From: support Date: Mon, 20 Jun 2022 15:26:52 +0000 (+0000) Subject: Built motion from commit e515d77c.|2.6.11 X-Git-Url: http://repos.xcallymotion.com/base/%22https:/wiki.xcallymotion.com/display/XMV//%22?a=commitdiff_plain;h=da8aae550acea30b25b2d6c858fec1c7434f5ed3;p=motion2.git Built motion from commit e515d77c.|2.6.11 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 4e6d995..f6bb600 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-06-20T13:43:47.197Z", + "time": "2022-06-20T15:18:40.055Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 8d13af2..21b37ad 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2022-06-20T13:43:47.197Z", + "time": "2022-06-20T15:18:40.055Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/legacy-libs/json-bigint/LICENSE b/legacy-libs/json-bigint/LICENSE new file mode 100644 index 0000000..9ab4d83 --- /dev/null +++ b/legacy-libs/json-bigint/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2013 Andrey Sidorov + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/legacy-libs/json-bigint/README.md b/legacy-libs/json-bigint/README.md new file mode 100644 index 0000000..7cb7919 --- /dev/null +++ b/legacy-libs/json-bigint/README.md @@ -0,0 +1,117 @@ +json-bigint +=========== + +[![Build Status](https://secure.travis-ci.org/sidorares/json-bigint.png)](http://travis-ci.org/sidorares/json-bigint) +[![NPM](https://nodei.co/npm/json-bigint.png?downloads=true&stars=true)](https://nodei.co/npm/json-bigint/) + +JSON.parse/stringify with bigints support. Based on Douglas Crockford [JSON.js](https://github.com/douglascrockford/JSON-js) package and [bignumber.js](https://github.com/MikeMcl/bignumber.js) library. + +While most JSON parsers assume numeric values have same precision restrictions as IEEE 754 double, JSON specification _does not_ say anything about number precision. Any floating point number in decimal (optionally scientific) notation is valid JSON value. It's a good idea to serialize values which might fall out of IEEE 754 integer precision as strings in your JSON api, but `{ "value" : 9223372036854775807}`, for example, is still a valid RFC4627 JSON string, and in most JS runtimes the result of `JSON.parse` is this object: `{ value: 9223372036854776000 }` + +========== + +example: + +```js +var JSONbig = require('json-bigint'); + +var json = '{ "value" : 9223372036854775807, "v2": 123 }'; +console.log('Input:', json); +console.log(''); + +console.log('node.js bult-in JSON:') +var r = JSON.parse(json); +console.log('JSON.parse(input).value : ', r.value.toString()); +console.log('JSON.stringify(JSON.parse(input)):', JSON.stringify(r)); + +console.log('\n\nbig number JSON:'); +var r1 = JSONbig.parse(json); +console.log('JSONbig.parse(input).value : ', r1.value.toString()); +console.log('JSONbig.stringify(JSONbig.parse(input)):', JSONbig.stringify(r1)); +``` + +Output: + +``` +Input: { "value" : 9223372036854775807, "v2": 123 } + +node.js bult-in JSON: +JSON.parse(input).value : 9223372036854776000 +JSON.stringify(JSON.parse(input)): {"value":9223372036854776000,"v2":123} + + +big number JSON: +JSONbig.parse(input).value : 9223372036854775807 +JSONbig.stringify(JSONbig.parse(input)): {"value":9223372036854775807,"v2":123} +``` +### Options +The behaviour of the parser is somewhat configurable through 'options' + +#### options.strict, boolean, default false +Specifies the parsing should be "strict" towards reporting duplicate-keys in the parsed string. +The default follows what is allowed in standard json and resembles the behavior of JSON.parse, but overwrites any previous values with the last one assigned to the duplicate-key. + +Setting options.strict = true will fail-fast on such duplicate-key occurances and thus warn you upfront of possible lost information. + +example: +```js +var JSONbig = require('json-bigint'); +var JSONstrict = require('json-bigint')({"strict": true}); + +var dupkeys = '{ "dupkey": "value 1", "dupkey": "value 2"}'; +console.log('\n\nDuplicate Key test with both lenient and strict JSON parsing'); +console.log('Input:', dupkeys); +var works = JSONbig.parse(dupkeys); +console.log('JSON.parse(dupkeys).dupkey: %s', works.dupkey); +var fails = "will stay like this"; +try { + fails = JSONstrict.parse(dupkeys); + console.log('ERROR!! Should never get here'); +} catch (e) { + console.log('Succesfully catched expected exception on duplicate keys: %j', e); +} +``` + +Output +``` +Duplicate Key test with big number JSON +Input: { "dupkey": "value 1", "dupkey": "value 2"} +JSON.parse(dupkeys).dupkey: value 2 +Succesfully catched expected exception on duplicate keys: {"name":"SyntaxError","message":"Duplicate key \"dupkey\"","at":33,"text":"{ \"dupkey\": \"value 1\", \"dupkey\": \"value 2\"}"} + +``` + +#### options.storeAsString, boolean, default false +Specifies if BigInts should be stored in the object as a string, rather than the default BigNumber. + +Note that this is a dangerous behavior as it breaks the default functionality of being able to convert back-and-forth without data type changes (as this will convert all BigInts to be-and-stay strings). + +example: +```js +var JSONbig = require('json-bigint'); +var JSONbigString = require('json-bigint')({"storeAsString": true}); +var key = '{ "key": 1234567890123456789 }'; +console.log('\n\nStoring the BigInt as a string, instead of a BigNumber'); +console.log('Input:', key); +var withInt = JSONbig.parse(key); +var withString = JSONbigString.parse(key); +console.log('Default type: %s, With option type: %s', typeof withInt.key, typeof withString.key); + +``` + +Output +``` +Storing the BigInt as a string, instead of a BigNumber +Input: { "key": 1234567890123456789 } +Default type: object, With option type: string + +``` + + +### Links: +- [RFC4627: The application/json Media Type for JavaScript Object Notation (JSON)](http://www.ietf.org/rfc/rfc4627.txt) +- [Re: \[Json\] Limitations on number size?](http://www.ietf.org/mail-archive/web/json/current/msg00297.html) +- [Is there any proper way to parse JSON with large numbers? (long, bigint, int64)](http://stackoverflow.com/questions/18755125/node-js-is-there-any-proper-way-to-parse-json-with-large-numbers-long-bigint) +- [What is JavaScript's Max Int? What's the highest Integer value a Number can go to without losing precision?](http://stackoverflow.com/questions/307179/what-is-javascripts-max-int-whats-the-highest-integer-value-a-number-can-go-t) +- [Large numbers erroneously rounded in Javascript](http://stackoverflow.com/questions/1379934/large-numbers-erroneously-rounded-in-javascript) + diff --git a/legacy-libs/json-bigint/index.js b/legacy-libs/json-bigint/index.js new file mode 100644 index 0000000..4757600 --- /dev/null +++ b/legacy-libs/json-bigint/index.js @@ -0,0 +1,12 @@ +var json_stringify = require('./lib/stringify.js').stringify; +var json_parse = require('./lib/parse.js'); + +module.exports = function(options) { + return { + parse: json_parse(options), + stringify: json_stringify + } +}; +//create the default method members with no options applied for backwards compatibility +module.exports.parse = json_parse(); +module.exports.stringify = json_stringify; diff --git a/legacy-libs/json-bigint/lib/parse.js b/legacy-libs/json-bigint/lib/parse.js new file mode 100644 index 0000000..2941c81 --- /dev/null +++ b/legacy-libs/json-bigint/lib/parse.js @@ -0,0 +1,384 @@ +var BigNumber = null; +/* + json_parse.js + 2012-06-20 + + Public Domain. + + NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. + + This file creates a json_parse function. + During create you can (optionally) specify some behavioural switches + + require('json-bigint')(options) + + The optional options parameter holds switches that drive certain + aspects of the parsing process: + * options.strict = true will warn about duplicate-key usage in the json. + The default (strict = false) will silently ignore those and overwrite + values for keys that are in duplicate use. + + The resulting function follows this signature: + json_parse(text, reviver) + This method parses a JSON text to produce an object or array. + It can throw a SyntaxError exception. + + The optional reviver parameter is a function that can filter and + transform the results. It receives each of the keys and values, + and its return value is used instead of the original value. + If it returns what it received, then the structure is not modified. + If it returns undefined then the member is deleted. + + Example: + + // Parse the text. Values that look like ISO date strings will + // be converted to Date objects. + + myData = json_parse(text, function (key, value) { + var a; + if (typeof value === 'string') { + a = +/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); + if (a) { + return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], + +a[5], +a[6])); + } + } + return value; + }); + + This is a reference implementation. You are free to copy, modify, or + redistribute. + + This code should be minified before deployment. + See http://javascript.crockford.com/jsmin.html + + USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO + NOT CONTROL. +*/ + +/*members "", "\"", "\/", "\\", at, b, call, charAt, f, fromCharCode, + hasOwnProperty, message, n, name, prototype, push, r, t, text +*/ + +var json_parse = function (options) { + "use strict"; + +// This is a function that can parse a JSON text, producing a JavaScript +// data structure. It is a simple, recursive descent parser. It does not use +// eval or regular expressions, so it can be used as a model for implementing +// a JSON parser in other languages. + +// We are defining the function inside of another function to avoid creating +// global variables. + + +// Default options one can override by passing options to the parse() + var _options = { + "strict": false, // not being strict means do not generate syntax errors for "duplicate key" + "storeAsString": false // toggles whether the values should be stored as BigNumber (default) or a string + }; + + +// If there are options, then use them to override the default _options + if (options !== undefined && options !== null) { + if (options.strict === true) { + _options.strict = true; + } + if (options.storeAsString === true) { + _options.storeAsString = true; + } + } + + + var at, // The index of the current character + ch, // The current character + escapee = { + '"': '"', + '\\': '\\', + '/': '/', + b: '\b', + f: '\f', + n: '\n', + r: '\r', + t: '\t' + }, + text, + + error = function (m) { + +// Call error when something is wrong. + + throw { + name: 'SyntaxError', + message: m, + at: at, + text: text + }; + }, + + next = function (c) { + +// If a c parameter is provided, verify that it matches the current character. + + if (c && c !== ch) { + error("Expected '" + c + "' instead of '" + ch + "'"); + } + +// Get the next character. When there are no more characters, +// return the empty string. + + ch = text.charAt(at); + at += 1; + return ch; + }, + + number = function () { +// Parse a number value. + + var number, + string = ''; + + if (ch === '-') { + string = '-'; + next('-'); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + if (ch === '.') { + string += '.'; + while (next() && ch >= '0' && ch <= '9') { + string += ch; + } + } + if (ch === 'e' || ch === 'E') { + string += ch; + next(); + if (ch === '-' || ch === '+') { + string += ch; + next(); + } + while (ch >= '0' && ch <= '9') { + string += ch; + next(); + } + } + number = +string; + if (!isFinite(number)) { + error("Bad number"); + } else { + if (BigNumber == null) + BigNumber = require('bignumber.js'); + //if (number > 9007199254740992 || number < -9007199254740992) + // Bignumber has stricter check: everything with length > 15 digits disallowed + if (string.length > 15) + return (_options.storeAsString === true) ? string : new BigNumber(string); + return number; + } + }, + + string = function () { + +// Parse a string value. + + var hex, + i, + string = '', + uffff; + +// When parsing for string values, we must look for " and \ characters. + + if (ch === '"') { + while (next()) { + if (ch === '"') { + next(); + return string; + } + if (ch === '\\') { + next(); + if (ch === 'u') { + uffff = 0; + for (i = 0; i < 4; i += 1) { + hex = parseInt(next(), 16); + if (!isFinite(hex)) { + break; + } + uffff = uffff * 16 + hex; + } + string += String.fromCharCode(uffff); + } else if (typeof escapee[ch] === 'string') { + string += escapee[ch]; + } else { + break; + } + } else { + string += ch; + } + } + } + error("Bad string"); + }, + + white = function () { + +// Skip whitespace. + + while (ch && ch <= ' ') { + next(); + } + }, + + word = function () { + +// true, false, or null. + + switch (ch) { + case 't': + next('t'); + next('r'); + next('u'); + next('e'); + return true; + case 'f': + next('f'); + next('a'); + next('l'); + next('s'); + next('e'); + return false; + case 'n': + next('n'); + next('u'); + next('l'); + next('l'); + return null; + } + error("Unexpected '" + ch + "'"); + }, + + value, // Place holder for the value function. + + array = function () { + +// Parse an array value. + + var array = []; + + if (ch === '[') { + next('['); + white(); + if (ch === ']') { + next(']'); + return array; // empty array + } + while (ch) { + array.push(value()); + white(); + if (ch === ']') { + next(']'); + return array; + } + next(','); + white(); + } + } + error("Bad array"); + }, + + object = function () { + +// Parse an object value. + + var key, + object = {}; + + if (ch === '{') { + next('{'); + white(); + if (ch === '}') { + next('}'); + return object; // empty object + } + while (ch) { + key = string(); + white(); + next(':'); + if (_options.strict === true && Object.hasOwnProperty.call(object, key)) { + error('Duplicate key "' + key + '"'); + } + object[key] = value(); + white(); + if (ch === '}') { + next('}'); + return object; + } + next(','); + white(); + } + } + error("Bad object"); + }; + + value = function () { + +// Parse a JSON value. It could be an object, an array, a string, a number, +// or a word. + + white(); + switch (ch) { + case '{': + return object(); + case '[': + return array(); + case '"': + return string(); + case '-': + return number(); + default: + return ch >= '0' && ch <= '9' ? number() : word(); + } + }; + +// Return the json_parse function. It will have access to all of the above +// functions and variables. + + return function (source, reviver) { + var result; + + text = source + ''; + at = 0; + ch = ' '; + result = value(); + white(); + if (ch) { + error("Syntax error"); + } + +// If there is a reviver function, we recursively walk the new structure, +// passing each name/value pair to the reviver function for possible +// transformation, starting with a temporary root object that holds the result +// in an empty key. If there is not a reviver function, we simply return the +// result. + + return typeof reviver === 'function' + ? (function walk(holder, key) { + var k, v, value = holder[key]; + if (value && typeof value === 'object') { + Object.keys(value).forEach(function(k) { + v = walk(value, k); + if (v !== undefined) { + value[k] = v; + } else { + delete value[k]; + } + }); + } + return reviver.call(holder, key, value); + }({'': result}, '')) + : result; + }; +} + +module.exports = json_parse; diff --git a/legacy-libs/json-bigint/lib/stringify.js b/legacy-libs/json-bigint/lib/stringify.js new file mode 100644 index 0000000..ce0592e --- /dev/null +++ b/legacy-libs/json-bigint/lib/stringify.js @@ -0,0 +1,383 @@ +var BigNumber = require('bignumber.js'); + +/* + json2.js + 2013-05-26 + + Public Domain. + + NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. + + See http://www.JSON.org/js.html + + + This code should be minified before deployment. + See http://javascript.crockford.com/jsmin.html + + USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO + NOT CONTROL. + + + This file creates a global JSON object containing two methods: stringify + and parse. + + JSON.stringify(value, replacer, space) + value any JavaScript value, usually an object or array. + + replacer an optional parameter that determines how object + values are stringified for objects. It can be a + function or an array of strings. + + space an optional parameter that specifies the indentation + of nested structures. If it is omitted, the text will + be packed without extra whitespace. If it is a number, + it will specify the number of spaces to indent at each + level. If it is a string (such as '\t' or ' '), + it contains the characters used to indent at each level. + + This method produces a JSON text from a JavaScript value. + + When an object value is found, if the object contains a toJSON + method, its toJSON method will be called and the result will be + stringified. A toJSON method does not serialize: it returns the + value represented by the name/value pair that should be serialized, + or undefined if nothing should be serialized. The toJSON method + will be passed the key associated with the value, and this will be + bound to the value + + For example, this would serialize Dates as ISO strings. + + Date.prototype.toJSON = function (key) { + function f(n) { + // Format integers to have at least two digits. + return n < 10 ? '0' + n : n; + } + + return this.getUTCFullYear() + '-' + + f(this.getUTCMonth() + 1) + '-' + + f(this.getUTCDate()) + 'T' + + f(this.getUTCHours()) + ':' + + f(this.getUTCMinutes()) + ':' + + f(this.getUTCSeconds()) + 'Z'; + }; + + You can provide an optional replacer method. It will be passed the + key and value of each member, with this bound to the containing + object. The value that is returned from your method will be + serialized. If your method returns undefined, then the member will + be excluded from the serialization. + + If the replacer parameter is an array of strings, then it will be + used to select the members to be serialized. It filters the results + such that only members with keys listed in the replacer array are + stringified. + + Values that do not have JSON representations, such as undefined or + functions, will not be serialized. Such values in objects will be + dropped; in arrays they will be replaced with null. You can use + a replacer function to replace those with JSON values. + JSON.stringify(undefined) returns undefined. + + The optional space parameter produces a stringification of the + value that is filled with line breaks and indentation to make it + easier to read. + + If the space parameter is a non-empty string, then that string will + be used for indentation. If the space parameter is a number, then + the indentation will be that many spaces. + + Example: + + text = JSON.stringify(['e', {pluribus: 'unum'}]); + // text is '["e",{"pluribus":"unum"}]' + + + text = JSON.stringify(['e', {pluribus: 'unum'}], null, '\t'); + // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]' + + text = JSON.stringify([new Date()], function (key, value) { + return this[key] instanceof Date ? + 'Date(' + this[key] + ')' : value; + }); + // text is '["Date(---current time---)"]' + + + JSON.parse(text, reviver) + This method parses a JSON text to produce an object or array. + It can throw a SyntaxError exception. + + The optional reviver parameter is a function that can filter and + transform the results. It receives each of the keys and values, + and its return value is used instead of the original value. + If it returns what it received, then the structure is not modified. + If it returns undefined then the member is deleted. + + Example: + + // Parse the text. Values that look like ISO date strings will + // be converted to Date objects. + + myData = JSON.parse(text, function (key, value) { + var a; + if (typeof value === 'string') { + a = +/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value); + if (a) { + return new Date(Date.UTC(+a[1], +a[2] - 1, +a[3], +a[4], + +a[5], +a[6])); + } + } + return value; + }); + + myData = JSON.parse('["Date(09/09/2001)"]', function (key, value) { + var d; + if (typeof value === 'string' && + value.slice(0, 5) === 'Date(' && + value.slice(-1) === ')') { + d = new Date(value.slice(5, -1)); + if (d) { + return d; + } + } + return value; + }); + + + This is a reference implementation. You are free to copy, modify, or + redistribute. +*/ + +/*jslint evil: true, regexp: true */ + +/*members "", "\b", "\t", "\n", "\f", "\r", "\"", JSON, "\\", apply, + call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours, + getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join, + lastIndex, length, parse, prototype, push, replace, slice, stringify, + test, toJSON, toString, valueOf +*/ + + +// Create a JSON object only if one does not already exist. We create the +// methods in a closure to avoid creating global variables. + +var JSON = module.exports; + +(function () { + 'use strict'; + + function f(n) { + // Format integers to have at least two digits. + return n < 10 ? '0' + n : n; + } + + var cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + escapable = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g, + gap, + indent, + meta = { // table of character substitutions + '\b': '\\b', + '\t': '\\t', + '\n': '\\n', + '\f': '\\f', + '\r': '\\r', + '"' : '\\"', + '\\': '\\\\' + }, + rep; + + + function quote(string) { + +// If the string contains no control characters, no quote characters, and no +// backslash characters, then we can safely slap some quotes around it. +// Otherwise we must also replace the offending characters with safe escape +// sequences. + + escapable.lastIndex = 0; + return escapable.test(string) ? '"' + string.replace(escapable, function (a) { + var c = meta[a]; + return typeof c === 'string' + ? c + : '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4); + }) + '"' : '"' + string + '"'; + } + + + function str(key, holder) { + +// Produce a string from holder[key]. + + var i, // The loop counter. + k, // The member key. + v, // The member value. + length, + mind = gap, + partial, + value = holder[key], + isBigNumber = value != null && (value instanceof BigNumber || BigNumber.isBigNumber(value)); + +// If the value has a toJSON method, call it to obtain a replacement value. + + if (value && typeof value === 'object' && + typeof value.toJSON === 'function') { + value = value.toJSON(key); + } + +// If we were called with a replacer function, then call the replacer to +// obtain a replacement value. + + if (typeof rep === 'function') { + value = rep.call(holder, key, value); + } + +// What happens next depends on the value's type. + + switch (typeof value) { + case 'string': + if (isBigNumber) { + return value; + } else { + return quote(value); + } + + case 'number': + +// JSON numbers must be finite. Encode non-finite numbers as null. + + return isFinite(value) ? String(value) : 'null'; + + case 'boolean': + case 'null': + +// If the value is a boolean or null, convert it to a string. Note: +// typeof null does not produce 'null'. The case is included here in +// the remote chance that this gets fixed someday. + + return String(value); + +// If the type is 'object', we might be dealing with an object or an array or +// null. + + case 'object': + +// Due to a specification blunder in ECMAScript, typeof null is 'object', +// so watch out for that case. + + if (!value) { + return 'null'; + } + +// Make an array to hold the partial results of stringifying this object value. + + gap += indent; + partial = []; + +// Is the value an array? + + if (Object.prototype.toString.apply(value) === '[object Array]') { + +// The value is an array. Stringify every element. Use null as a placeholder +// for non-JSON values. + + length = value.length; + for (i = 0; i < length; i += 1) { + partial[i] = str(i, value) || 'null'; + } + +// Join all of the elements together, separated with commas, and wrap them in +// brackets. + + v = partial.length === 0 + ? '[]' + : gap + ? '[\n' + gap + partial.join(',\n' + gap) + '\n' + mind + ']' + : '[' + partial.join(',') + ']'; + gap = mind; + return v; + } + +// If the replacer is an array, use it to select the members to be stringified. + + if (rep && typeof rep === 'object') { + length = rep.length; + for (i = 0; i < length; i += 1) { + if (typeof rep[i] === 'string') { + k = rep[i]; + v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + } + } + } else { + +// Otherwise, iterate through all of the keys in the object. + + Object.keys(value).forEach(function(k) { + var v = str(k, value); + if (v) { + partial.push(quote(k) + (gap ? ': ' : ':') + v); + } + }); + } + +// Join all of the member texts together, separated with commas, +// and wrap them in braces. + + v = partial.length === 0 + ? '{}' + : gap + ? '{\n' + gap + partial.join(',\n' + gap) + '\n' + mind + '}' + : '{' + partial.join(',') + '}'; + gap = mind; + return v; + } + } + +// If the JSON object does not yet have a stringify method, give it one. + + if (typeof JSON.stringify !== 'function') { + JSON.stringify = function (value, replacer, space) { + +// The stringify method takes a value and an optional replacer, and an optional +// space parameter, and returns a JSON text. The replacer can be a function +// that can replace values, or an array of strings that will select the keys. +// A default replacer method can be provided. Use of the space parameter can +// produce text that is more easily readable. + + var i; + gap = ''; + indent = ''; + +// If the space parameter is a number, make an indent string containing that +// many spaces. + + if (typeof space === 'number') { + for (i = 0; i < space; i += 1) { + indent += ' '; + } + +// If the space parameter is a string, it will be used as the indent string. + + } else if (typeof space === 'string') { + indent = space; + } + +// If there is a replacer, it must be a function or an array. +// Otherwise, throw an error. + + rep = replacer; + if (replacer && typeof replacer !== 'function' && + (typeof replacer !== 'object' || + typeof replacer.length !== 'number')) { + throw new Error('JSON.stringify'); + } + +// Make a fake root object containing our value under the key of ''. +// Return the result of stringifying the value. + + return str('', {'': value}); + }; + } +}()); diff --git a/legacy-libs/json-bigint/package.json b/legacy-libs/json-bigint/package.json new file mode 100644 index 0000000..6d3e2c7 --- /dev/null +++ b/legacy-libs/json-bigint/package.json @@ -0,0 +1,101 @@ +{ + "_args": [ + [ + { + "raw": "json-bigint@^0.3.0", + "scope": null, + "escapedName": "json-bigint", + "name": "json-bigint", + "rawSpec": "^0.3.0", + "spec": ">=0.3.0 <0.4.0", + "type": "range" + }, + "/var/opt/motion2/node_modules/gcp-metadata" + ] + ], + "_from": "json-bigint@>=0.3.0 <0.4.0", + "_hasShrinkwrap": false, + "_id": "json-bigint@0.3.1", + "_inCache": true, + "_location": "/json-bigint", + "_nodeVersion": "12.13.0", + "_npmOperationalInternal": { + "host": "s3://npm-registry-packages", + "tmp": "tmp/json-bigint_0.3.1_1592365825784_0.15984931652351175" + }, + "_npmUser": { + "name": "sidorares", + "email": "sidorares@yandex.com" + }, + "_npmVersion": "6.12.0", + "_phantomChildren": {}, + "_requested": { + "raw": "json-bigint@^0.3.0", + "scope": null, + "escapedName": "json-bigint", + "name": "json-bigint", + "rawSpec": "^0.3.0", + "spec": ">=0.3.0 <0.4.0", + "type": "range" + }, + "_requiredBy": [ + "/gcp-metadata" + ], + "_resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-0.3.1.tgz", + "_shasum": "0c1729d679f580d550899d6a2226c228564afe60", + "_shrinkwrap": null, + "_spec": "json-bigint@^0.3.0", + "_where": "/var/opt/motion2/node_modules/gcp-metadata", + "author": { + "name": "Andrey Sidorov", + "email": "sidorares@yandex.ru" + }, + "bugs": { + "url": "https://github.com/sidorares/json-bigint/issues" + }, + "dependencies": { + "bignumber.js": "^9.0.0" + }, + "description": "JSON.parse with bigints support", + "devDependencies": { + "chai": "~1.9.1", + "mocha": "~1.20.1" + }, + "directories": {}, + "dist": { + "integrity": "sha512-DGWnSzmusIreWlEupsUelHrhwmPPE+FiQvg+drKfk2p+bdEYa5mp4PJ8JsCWqae0M2jQNb0HPvnwvf1qOTThzQ==", + "shasum": "0c1729d679f580d550899d6a2226c228564afe60", + "tarball": "https://registry.npmjs.org/json-bigint/-/json-bigint-0.3.1.tgz", + "fileCount": 10, + "unpackedSize": 35380, + "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6ZMCCRA9TVsSAnZWagAAJPAP/RooIwg7pQ6ICpdeAqFd\nZdEGmgffg8M9NrGvPcmRJq0B3iuGGB7hsuG+ca9lt+j2PmGNCdA4NCkL0M7+\noo+XK/GMrc4kbpHRg+XyCtDKZRN6lZdjwtq2YhY/ASUEsAGqUrWBGqbALvuO\neQHD+D9gq590gU3sTLSjS6TE1t8pa3IdZZ6C8q9D3Kqr1e64zTfbVKXgUdCb\n6okYMJNensxxlWXWdIj/igWIoyg5vY62lv7PzRA07YqhwHggwwYl+e+JuuIQ\nTcNhm+46qrTiKjlkv1VZEzXp1acq/79+92SmjYVIcFwg4Vffo3YSd6as6YaZ\nl4oBoLhA2laQw4G7wDe5u2Cv6ExRpA5KF4UCLCH8RmB0WOrunjx/tDOM/cSw\ngszOtAHZRdhJKtpHcqXGGtJ4f69C4MrUJ1rtQAhVVOH+BxwC7/xQ5kumwUQj\n0dXm8ImVCPH6x2EdPfjA2dvmjspBiTFq68UGlgvAu1vAD7snOYYVy6YLXl2E\nptyUZHKl06vL57SQsrUcV/gObmLlJGn7NxtUJgnwWxcgxWfxsKScA+G0uwP6\n94bdLfulDagm+OIJz5dM2/+6YVcDdu1sUKgR2wbb+u8OlRC01Jt6LQ+U5+XL\n386s7ktoWAsAD1TFTp6DaKsOJbaFaMgRngEUGrPhh6GQIaV2os+8ThHeOfef\nGGla\r\n=RzVR\r\n-----END PGP SIGNATURE-----\r\n" + }, + "gitHead": "6ae8272a90ea188311a02d5d9d288b44f456acd0", + "homepage": "https://github.com/sidorares/json-bigint#readme", + "keywords": [ + "JSON", + "bigint", + "bignumber", + "parse", + "json" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "sidorares", + "email": "sidorares@yandex.com" + } + ], + "name": "json-bigint", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/sidorares/json-bigint.git" + }, + "scripts": { + "test": "./node_modules/mocha/bin/mocha -R spec --check-leaks test/*-test.js" + }, + "version": "0.3.1" +} diff --git a/legacy-libs/json-bigint/test/bigint-test.js b/legacy-libs/json-bigint/test/bigint-test.js new file mode 100644 index 0000000..5f5e1a3 --- /dev/null +++ b/legacy-libs/json-bigint/test/bigint-test.js @@ -0,0 +1,31 @@ +var mocha = require('mocha') + , assert = require('chai').assert + , expect = require('chai').expect + , BigNumber = require('bignumber.js') + ; + +describe("Testing bigint support", function(){ + var input = '{"big":9223372036854775807,"small":123}'; + + it("Should show classic JSON.parse lacks bigint support", function(done){ + var obj = JSON.parse(input); + expect(obj.small.toString(), "string from small int").to.equal("123"); + expect(obj.big.toString(), "string from big int").to.not.equal("9223372036854775807"); + + var output = JSON.stringify(obj); + expect(output).to.not.equal(input); + done(); + }); + + it("Should show JSNbig does support bigint parse/stringify roundtrip", function(done){ + var JSONbig = require('../index'); + var obj = JSONbig.parse(input); + expect(obj.small.toString(), "string from small int").to.equal("123"); + expect(obj.big.toString(), "string from big int").to.equal("9223372036854775807"); + expect(obj.big, "instanceof big int").to.be.instanceof(BigNumber); + + var output = JSONbig.stringify(obj); + expect(output).to.equal(input); + done(); + }); +}); diff --git a/legacy-libs/json-bigint/test/strict-option-test.js b/legacy-libs/json-bigint/test/strict-option-test.js new file mode 100644 index 0000000..bb27bd9 --- /dev/null +++ b/legacy-libs/json-bigint/test/strict-option-test.js @@ -0,0 +1,34 @@ +var mocha = require('mocha') + , assert = require('chai').assert + , expect = require('chai').expect + ; + +describe("Testing 'strict' option", function(){ + var dupkeys = '{ "dupkey": "value 1", "dupkey": "value 2"}'; + it("Should show that duplicate keys just get overwritten by default", function(done){ + var JSONbig = require('../index'); + var result = "before"; + function tryParse() { + result = JSONbig.parse(dupkeys); + } + expect(tryParse).to.not.throw("anything"); + expect(result.dupkey).to.equal("value 2"); + done(); + }); + + it("Should show that the 'strict' option will fail-fast on duplicate keys", function(done){ + var JSONstrict = require('../index')({"strict": true}); + var result = "before"; + function tryParse() { + result = JSONstrict.parse(dupkeys); + } + expect(tryParse).to.throw({ + name: 'SyntaxError', + message: 'Duplicate key "dupkey"', + at: 33, + text: '{ "dupkey": "value 1", "dupkey": "value 2"}' + }); + expect(result).to.equal("before"); + done(); + }); +}); diff --git a/legacy-libs/json-bigint/test/string-option-test.js b/legacy-libs/json-bigint/test/string-option-test.js new file mode 100644 index 0000000..c729f34 --- /dev/null +++ b/legacy-libs/json-bigint/test/string-option-test.js @@ -0,0 +1,21 @@ +var mocha = require('mocha') + , assert = require('chai').assert + , expect = require('chai').expect + ; + +describe("Testing 'storeAsString' option", function(){ + var key = '{ "key": 12345678901234567 }'; + it("Should show that the key is of type object", function(done){ + var JSONbig = require('../index'); + var result = JSONbig.parse(key); + expect(typeof result.key).to.equal("object"); + done(); + }); + + it("Should show that key is of type string, when storeAsString option is true", function(done){ + var JSONstring = require('../index')({"storeAsString": true}); + var result = JSONstring.parse(key); + expect(typeof result.key).to.equal("string"); + done(); + }); +}); diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 962cfac..6a3ffd9 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -87,6 +87,11 @@ "from": "abbrev@>=1.0.0 <2.0.0", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz" }, + "abort-controller": { + "version": "3.0.0", + "from": "abort-controller@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz" + }, "abstract-logging": { "version": "2.0.1", "from": "abstract-logging@>=2.0.0 <3.0.0", @@ -129,6 +134,11 @@ "from": "after@0.8.2", "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz" }, + "agent-base": { + "version": "4.3.0", + "from": "agent-base@>=4.3.0 <5.0.0", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz" + }, "ajv": { "version": "5.5.2", "from": "ajv@>=5.1.0 <6.0.0", @@ -1502,6 +1512,11 @@ "from": "etag@>=1.8.1 <1.9.0", "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz" }, + "event-target-shim": { + "version": "5.0.1", + "from": "event-target-shim@>=5.0.0 <6.0.0", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz" + }, "eventemitter2": { "version": "1.0.5", "from": "eventemitter2@1.0.5", @@ -1660,6 +1675,11 @@ "from": "fast-levenshtein@>=2.0.6 <2.1.0", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz" }, + "fast-text-encoding": { + "version": "1.0.0", + "from": "fast-text-encoding@1.0.0", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.0.tgz" + }, "faye": { "version": "1.4.0", "from": "faye@>=1.2.0 <2.0.0", @@ -1811,6 +1831,33 @@ } } }, + "gaxios": { + "version": "1.8.4", + "from": "gaxios@>=1.0.4 <2.0.0", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-1.8.4.tgz", + "dependencies": { + "node-fetch": { + "version": "2.6.7", + "from": "node-fetch@>=2.3.0 <3.0.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz" + }, + "tr46": { + "version": "0.0.3", + "from": "tr46@>=0.0.3 <0.1.0", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz" + }, + "webidl-conversions": { + "version": "3.0.1", + "from": "webidl-conversions@>=3.0.0 <4.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz" + }, + "whatwg-url": { + "version": "5.0.0", + "from": "whatwg-url@>=5.0.0 <6.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz" + } + } + }, "generic-pool": { "version": "2.4.2", "from": "generic-pool@2.4.2", @@ -1864,6 +1911,18 @@ } } }, + "google-p12-pem": { + "version": "1.0.5", + "from": "google-p12-pem@>=1.0.0 <2.0.0", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-1.0.5.tgz", + "dependencies": { + "pify": { + "version": "4.0.1", + "from": "pify@^4.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz" + } + } + }, "google-tts-api": { "version": "0.0.3", "from": "git+https://github.com/xmdevelop/google-tts.git", @@ -1879,6 +1938,23 @@ "from": "grpc@1.24.6", "resolved": "https://registry.npmjs.org/grpc/-/grpc-1.24.6.tgz" }, + "gtoken": { + "version": "2.3.2", + "from": "gtoken@2.3.2", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-2.3.2.tgz", + "dependencies": { + "mime": { + "version": "2.6.0", + "from": "mime@>=2.2.0 <3.0.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz" + }, + "pify": { + "version": "4.0.1", + "from": "pify@>=4.0.0 <5.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz" + } + } + }, "har-schema": { "version": "2.0.0", "from": "har-schema@>=2.0.0 <3.0.0", @@ -2042,6 +2118,23 @@ "from": "http-signature@>=1.2.0 <1.3.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz" }, + "https-proxy-agent": { + "version": "2.2.1", + "from": "https-proxy-agent@2.2.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", + "dependencies": { + "debug": { + "version": "3.2.7", + "from": "debug@>=3.1.0 <4.0.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz" + }, + "ms": { + "version": "2.1.3", + "from": "ms@>=2.1.1 <3.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" + } + } + }, "iconv": { "version": "2.3.5", "from": "iconv@2.3.5", @@ -3197,6 +3290,11 @@ "from": "node-fetch@>=1.0.1 <2.0.0", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz" }, + "node-forge": { + "version": "0.10.0", + "from": "node-forge@>=0.10.0 <0.11.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz" + }, "node-pre-gyp": { "version": "0.16.0", "from": "node-pre-gyp@>=0.16.0 <0.17.0", diff --git a/package.json b/package.json index 1b3369f..55df9e2 100644 --- a/package.json +++ b/package.json @@ -76,12 +76,15 @@ "express-winston": "2.6.0", "extract-zip": "1.7.0", "fast-json-patch": "1.2.2", + "fast-text-encoding": "^1.0.0", "fs-extra": "8.1.0", "google-tts-api": "git+https://github.com/xmdevelop/google-tts.git", "grpc": "1.24.6", + "gtoken": "^2.3.2", "html-entities": "2.3.2", "html-to-pdfmake": "2.1.7", "html-to-text": "4.0.0", + "https-proxy-agent": "^2.2.1", "iconv": "2.3.5", "imap": "0.8.19", "ioredis": "4.17.3", diff --git a/public/app/forgot/i18n/is.json b/public/app/forgot/i18n/is.json index be7b81a..0d7912e 100644 --- a/public/app/forgot/i18n/is.json +++ b/public/app/forgot/i18n/is.json @@ -1,15 +1,15 @@ { "FORGOTPASSWORD": { - "TITLE": "Recover your password", - "EMAIL_ADRESS": "Email address", - "SEND_RESET_LINK": "SEND RESET LINK", - "GO_BACK": "Go back to login", - "LINK_SENT": "Link Sent", - "LINNK_SENT_MESSAGE": "An email containing a link to reset your password has been sent to your address!", - "PASSWORD_RESET_ERROR": "Password Reset Error", + "TITLE": "Endurnýjaðu lykilorðið þitt", + "EMAIL_ADRESS": "Netfang", + "SEND_RESET_LINK": "Sendu endurnýjunar hlekk", + "GO_BACK": "farðu aftur í innskráningu", + "LINK_SENT": "Hlekkur sendu", + "LINNK_SENT_MESSAGE": "Tölvupóstur sem inniheldur hlekk hefur verið sendur á netfangið þitt", + "PASSWORD_RESET_ERROR": "Villa við endurnýju á lykilorði", "ERRORS": { - "EMAIL_REQUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format" + "EMAIL_REQUIRED": "Skilyrtur reitur", + "EMAIL_MUST_VALID": "Rangt format" } } } diff --git a/public/app/login/i18n/is.json b/public/app/login/i18n/is.json index 78f3f74..261b193 100644 --- a/public/app/login/i18n/is.json +++ b/public/app/login/i18n/is.json @@ -1,26 +1,26 @@ { "LOGIN": { - "TELEPHONES": "Telephones", - "SELECT": "Select", - "CANCEL": "Cancel", - "TITLE": "Log in to your account", - "EMAIL": "Email", - "USERNAME": "Username", - "PASSWORD": "Password", - "REMEMBER_ME": "Remember Me", - "FORGOT_PASSWORD": "Forgot Password?", - "LOG_IN": "LOG IN", - "OR": "OR", - "WITH_GOOGLE": "Log in with Google", - "WITH_AD": "Log in with Active Directory", - "WITH_FACEBOOK": "Log in with Facebook", - "DONT_HAVE_ACCOUNT": "No account?", - "CREATE_ACCOUNT": "Create an account", + "TELEPHONES": "Símanúmr", + "SELECT": "Velja", + "CANCEL": "Hætta við", + "TITLE": "Skráðu þig inn", + "EMAIL": "Netfang", + "USERNAME": "Notendanafn", + "PASSWORD": "Lykilorð", + "REMEMBER_ME": "Mundu mig", + "FORGOT_PASSWORD": "Gleymt Lykilorð?", + "LOG_IN": "Skráðu ig inn", + "OR": "Eða", + "WITH_GOOGLE": "Skrá sig inn með Google", + "WITH_AD": "Skrá sig inn með Microsoft AD", + "WITH_FACEBOOK": "Skrá sig inn með Facebook", + "DONT_HAVE_ACCOUNT": "Ertu ekki með aðgang?", + "CREATE_ACCOUNT": "Stofna aðgang", "ERRORS": { - "EMAIL_REQUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format", - "PASSWORD_REQUIRED": "Mandatory field", - "USERNAME_REQUIRED": "Mandatory field" + "EMAIL_REQUIRED": "Skilyrtur reitur", + "EMAIL_MUST_VALID": "Rangt snið", + "PASSWORD_REQUIRED": "Skilyrtur reitur", + "USERNAME_REQUIRED": "Skilyrtur reitur" } } } diff --git a/public/app/main/apps/analytics/i18n/de.json b/public/app/main/apps/analytics/i18n/de.json index e6b577a..293f319 100644 --- a/public/app/main/apps/analytics/i18n/de.json +++ b/public/app/main/apps/analytics/i18n/de.json @@ -2,19 +2,19 @@ "ANALYTICS": { "NAME": "Name", "ANALYTICS": "Analytics", - "METRICS": "Kennzahlen", - "ID": "Id", + "METRICS": "Metriken", + "ID": "ID", "TABLE": "Tabelle", "DESCRIPTION": "Beschreibung", "SEARCH_FOR_ANYONE": "Suche", "METRIC": "Metrik", "ERRORS": { - "NAME_REQUIRED": "Pflichtfeld", - "METRIC_REQUIRED": "Pflichtfeld", - "COLUMN_REQUIRED": "Pflichtfeld", - "VALUE_REQUIRED": "Pflichtfeld", - "CUSTOM_METRIC_REQUIRED": "Pflichtfeld", - "ALIAS_REQUIRED": "Pflichtfeld" + "NAME_REQUIRED": "Name erforderlich", + "METRIC_REQUIRED": "Metrik erforderlich", + "COLUMN_REQUIRED": "Spalte erforderlich", + "VALUE_REQUIRED": "Wert erforderlich", + "CUSTOM_METRIC_REQUIRED": "Benutzerdef. Metrik erforderlich", + "ALIAS_REQUIRED": "Alias erforderlich" }, "NEW_METRIC": "Neue Metrik", "ADD_METRIC": "Metrik hinzufügen", @@ -22,35 +22,35 @@ "DELETE_METRIC": "Metrik löschen", "SAVE": "Speichern", "BACK": "Zurück", - "SELECTED": "Ausgewählte", + "SELECTED": "Ausgewählt", "SELECT_ALL": "Alles auswählen", "SELECT_NONE": "Nichts auswählen", "TYPE": "Typ", - "EXTRACTEDREPORTS": "Extrahierte Berichte", + "EXTRACTEDREPORTS": "Ausgeführte Berichte", "DATE_RANGE_FROM": "Datum von", "DATE_RANGE_TO": "Datum bis", "GENERATED_AT": "Generiert am", "STATUS": "Status", - "OUTPUT": "Format", + "OUTPUT": "Ausgabeformat", "REPORTS": "Berichte", "SEARCH_FOR_FOLDER": "Ordner suchen", "CREATED_AT": "Erstellt am", "NEW_REPORT": "Neuer Bericht", "ADD_REPORT": "Bericht hinzufügen", "COPY_REPORT": "Bericht kopieren", - "PREVIEW_REPORT": "Berichtvorschau", + "PREVIEW_REPORT": "Vorschau", "RUN_REPORT": "Bericht ausführen", "DOWNLOAD_JSON_REPORT": "Bericht exportieren JSON", "EDIT_REPORT": "Bericht bearbeiten", "DELETE_REPORT": "Bericht löschen", "CREATE": "Ordner erstellen", "RENAME": "Ordner umbenennen", - "REMOVE": "Ordner entfernen", + "REMOVE": "Ordner löschen", "SELECT_NODE": "Ordner auswählen", "ERROR": "Fehler", - "QUERY_ERROR": "Abfragefehler", + "QUERY_ERROR": "Fehler bei Abfrage", "MESSAGE": "Nachricht", - "CLOSE": "Schliessen", + "CLOSE": "Schließen", "FORMAT": "Format", "SETTINGS": "Einstellungen", "GENERAL": "Allgemein", @@ -61,7 +61,7 @@ "COLUMN": "Spalte", "VALUE": "Wert", "PREVIEW": "Vorschau", - "LIMITED_RESULT": "Ergebins begrenzt", + "LIMITED_RESULT": "Ergebnis begrenzt", "NO_DATA": "Keine Daten", "CONDITIONS": "Bedingungen", "ALIAS": "Alias", @@ -73,11 +73,11 @@ "DELETE_REPORTFIELD": "Feld löschen", "METRIC_NAME": "Metrik Name", "NO_METRIC_FOUND": "Keine Metrik gefunden", - "NO_AVAILABLE_INFO": "keine Informationen verfügbar", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", "CUSTOM_METRIC": "Benutzerdefinierte Metrik", - "DELETE_EXTRACTEDREPORT": "Extrahierte Berichte löschen", - "EDIT_EXTRACTEDREPORT": "Extrahierte Berichte bearbeiten", - "DOWNLOAD_EXTRACTEDREPORT": "Extrahierte Berichte herunterladen", + "DELETE_EXTRACTEDREPORT": "Ausgeführten Bericht löschen", + "EDIT_EXTRACTEDREPORT": "Ausgeführten Bericht bearbeiten", + "DOWNLOAD_EXTRACTEDREPORT": "Ausgeführten Bericht herunterladen", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", "OF": "von", diff --git a/public/app/main/apps/analytics/i18n/is.json b/public/app/main/apps/analytics/i18n/is.json index 71cf72f..7de08ba 100644 --- a/public/app/main/apps/analytics/i18n/is.json +++ b/public/app/main/apps/analytics/i18n/is.json @@ -1,89 +1,89 @@ { "ANALYTICS": { - "SEND_IF_EMPTY": "Send if empty", - "REPORTNAME": "Report Name", - "DELETE": "Delete", - "NAME": "Name", - "ANALYTICS": "Analytics", - "METRICS": "Metrics", - "ID": "Id", - "TABLE": "Table", - "DESCRIPTION": "Description", - "SEARCH_FOR_ANYONE": "Search", - "METRIC": "Metric", + "SEND_IF_EMPTY": "Sendið ef er tómt", + "REPORTNAME": "Nafn á skýrslu", + "DELETE": "Eyða", + "NAME": "Nafn", + "ANALYTICS": "Greiningar", + "METRICS": "eining", + "ID": "Auðkenni", + "TABLE": "Tafla", + "DESCRIPTION": "Lýsing", + "SEARCH_FOR_ANYONE": "Leitið", + "METRIC": "Eining", "ERRORS": { - "NAME_REQUIRED": "Mandatory field", - "METRIC_REQUIRED": "Mandatory field", - "COLUMN_REQUIRED": "Mandatory field", - "VALUE_REQUIRED": "Mandatory field", - "CUSTOM_METRIC_REQUIRED": "Mandatory field", - "ALIAS_REQUIRED": "Mandatory field" + "NAME_REQUIRED": "Skylyrtur reitur", + "METRIC_REQUIRED": "Skylyrtur reitur", + "COLUMN_REQUIRED": "Skilyrtur reitur", + "VALUE_REQUIRED": "Skylyrtur reitur", + "CUSTOM_METRIC_REQUIRED": "Skilyrtur reitur", + "ALIAS_REQUIRED": "Skilyrtur reitur" }, - "NEW_METRIC": "New Metric", - "ADD_METRIC": "Add Metric", - "EDIT_METRIC": "Edit Metric", - "DELETE_METRIC": "Delete Metric", - "SAVE": "Save", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "TYPE": "Type", - "EXTRACTEDREPORTS": "Extracted Reports", - "DATE_RANGE_FROM": "Date Range From", - "DATE_RANGE_TO": "Date Range To", - "GENERATED_AT": "Generated At", - "STATUS": "Status", - "OUTPUT": "Output", - "REPORTS": "Reports", - "SEARCH_FOR_FOLDER": "Search for folder", - "CREATED_AT": "Created At", - "NEW_REPORT": "New Report", - "ADD_REPORT": "Add Report", - "COPY_REPORT": "Copy Report", - "PREVIEW_REPORT": "Preview Report", - "WEB_REPORT": "Web Report", - "RUN_REPORT": "Run Report", - "DOWNLOAD_JSON_REPORT": "Export Report JSON", - "EDIT_REPORT": "Edit Report", - "DELETE_REPORT": "Delete Report", - "CREATE": "Create Folder", - "RENAME": "Rename Folder", - "REMOVE": "Remove Folder", - "SELECT_NODE": "Select Folder", - "ERROR": "Error", - "QUERY_ERROR": "Query Error", - "MESSAGE": "Message", - "CLOSE": "Close", - "FORMAT": "Format", - "SETTINGS": "Settings", - "GENERAL": "General", - "FIELDS": "Fields", - "CONDITION": "Condition", - "OPERATOR": "Operator", - "GROUP": "Group", - "COLUMN": "Column", - "VALUE": "Value", - "PREVIEW": "Preview", - "LIMITED_RESULT": "*Limited Results", - "NO_DATA": "No data results", - "CONDITIONS": "Conditions", + "NEW_METRIC": "Ný eining", + "ADD_METRIC": "Bætið við mælieiningu", + "EDIT_METRIC": "Breytið einingu", + "DELETE_METRIC": "Eyðið einingu", + "SAVE": "Vistið", + "BACK": "Til baka", + "SELECTED": "Valið", + "SELECT_ALL": "Veljið allt", + "SELECT_NONE": "Veljið ekkert", + "TYPE": "Tegund", + "EXTRACTEDREPORTS": "Útdregin skýrsla", + "DATE_RANGE_FROM": "Tímabil frá", + "DATE_RANGE_TO": "Tímabil til", + "GENERATED_AT": "Stofnað kl.", + "STATUS": "Staða", + "OUTPUT": "Útgangur", + "REPORTS": "skýrslur", + "SEARCH_FOR_FOLDER": "Leitið að möppu", + "CREATED_AT": "Stofnað kl.", + "NEW_REPORT": "Ný skýrsla", + "ADD_REPORT": "Bætið við skýrslu", + "COPY_REPORT": "Afritið skýrslu", + "PREVIEW_REPORT": "Forskoða skýrslu", + "WEB_REPORT": "Vef skýrsla", + "RUN_REPORT": "Keyrið skýrslu", + "DOWNLOAD_JSON_REPORT": "Flytjið út JSON", + "EDIT_REPORT": "Breytið skýrslu", + "DELETE_REPORT": "Eyðið skýrslu", + "CREATE": "Stofnið möppu", + "RENAME": "Endurskýrið möppu", + "REMOVE": "Fjarlægið möppur", + "SELECT_NODE": "Veljið möppu", + "ERROR": "Villa", + "QUERY_ERROR": "Fyrirspurnar villa", + "MESSAGE": "Skilaboð", + "CLOSE": "Loka", + "FORMAT": "Snið", + "SETTINGS": "Stillingar", + "GENERAL": "Almennt", + "FIELDS": "Reitur", + "CONDITION": "Skilyrði", + "OPERATOR": "Rekstraraðili", + "GROUP": "Hopur", + "COLUMN": "Dálkur", + "VALUE": "Gildi", + "PREVIEW": "Forskoðun", + "LIMITED_RESULT": "*Takmarkaðar niðurstöður", + "NO_DATA": "Engin gögn fáanleg", + "CONDITIONS": "Skilyrði", "ALIAS": "Alias", - "FUNCTION": "Function", - "GROUP_BY": "Group By", - "ORDER_BY": "Order By", - "ADD_REPORTFIELD": "Add Field", - "EDIT_REPORTFIELD": "Edit Field", - "DELETE_REPORTFIELD": "Delete Field", - "METRIC_NAME": "Metric", - "NO_METRIC_FOUND": "No metric found", - "NO_AVAILABLE_INFO": "No available info", - "CUSTOM_METRIC": "Custom Metric", - "DELETE_EXTRACTEDREPORT": "Delete Extracted Report", - "EDIT_EXTRACTEDREPORT": "Edit Extracted Report", - "DOWNLOAD_EXTRACTEDREPORT": "Download Extracted Report", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of" + "FUNCTION": "Virkni", + "GROUP_BY": "Hópur af", + "ORDER_BY": "Pantað af", + "ADD_REPORTFIELD": "Bætið við reit", + "EDIT_REPORTFIELD": "Breytið reit", + "DELETE_REPORTFIELD": "Eyðið reit", + "METRIC_NAME": "eining", + "NO_METRIC_FOUND": "Finn ekki mæli einingu", + "NO_AVAILABLE_INFO": "Engar upplýsingar fáanlegar", + "CUSTOM_METRIC": "Sérhönnuð eining", + "DELETE_EXTRACTEDREPORT": "Eyða útdreginni skýrslu", + "EDIT_EXTRACTEDREPORT": "Breytið útdreginni skýrslu", + "DOWNLOAD_EXTRACTEDREPORT": "Hlaðið niður útdreginni skýrslu", + "PAGE": "Síða", + "ROWSPERPAGE": "Raðir á síðu", + "OF": "Slökt" } } diff --git a/public/app/main/apps/callysquare/i18n/de.json b/public/app/main/apps/callysquare/i18n/de.json index 43d5be6..b6eee9d 100644 --- a/public/app/main/apps/callysquare/i18n/de.json +++ b/public/app/main/apps/callysquare/i18n/de.json @@ -1,28 +1,28 @@ { "CALLYSQUARE": { "ACCOUNT_ID": "Account", - "ADDUSER_PROJECTS": "Benutzer zu dem Projekt hinzufügen", - "ADD_ODBC": "ODBC hinzufügen", + "ADDUSER_PROJECTS": "Nutzer zu Projekt hinzufügen", + "ADD_ODBC": "Datenbank-Anbindung (ODBC) hinzufügen", "ADD_PROJECT": "Projekt hinzufügen", "ADD_VARIABLE": "Variable hinzufügen", "AGENTS": "Agenten", "AGI": "AGI", - "ALL_USERS": "Alle Benutzer", - "ANSWER": "Antwort", + "ALL_USERS": "Alle Nutzer", + "ANSWER": "Antworten", "APIKEY": "API-Schlüssel", "APPID": "App-ID", - "APPLICATION": "Application", - "APPSECRET": "App Geheimnis", - "ARGS": "Arguments", - "ATTACHMENT_NAME": "Name des Anhangs", - "ATTACHMENT_PATH": "Anhangspfad", - "ATTACHMENT_TYPE": "Anhangstyp", + "APPLICATION": "Anwendung", + "APPSECRET": "App-Secret", + "ARGS": "Argumente", + "ATTACHMENT_NAME": "Anhang Name", + "ATTACHMENT_PATH": "Anhang Pfad", + "ATTACHMENT_TYPE": "Anhang Typ", "AUDIO": "Audio", "AUDIOENCODING": "Audio-Codierung", "AWSLEX": "Amazon Lex", "AWSPOLLY": "AWS Polly", "AWS_ACCESS_KEY_ID": "Zugangsschlüssel-ID", - "AWS_BOT_NAME": "Bot-Name", + "AWS_BOT_NAME": "BOT-Name", "AWS_LEX_REGION": "Region", "AWS_POLLY_REGION": "Region", "AWS_POLLY_VOICE": "Sprache", @@ -34,13 +34,13 @@ "BODY": "Body", "CALLBACK": "Rückruf", "CALLBACK_PRIORITY": "Priorität", - "CALLYSQUARE": "Cally Square", + "CALLYSQUARE": "CallySquare", "CC": "CC", - "CHOOSE_ATTACHMENT": "Anhang wählen", + "CHOOSE_ATTACHMENT": "Anhang auswählen", "CLOSE": "Schließen", - "COMMAND": "Befehlen", + "COMMAND": "Eingabe", "COMPUTEDVARIABLES": "Skriptpfad für berechnete Variablen", - "CONDITION": "Voraussetzung", + "CONDITION": "Bedingung", "CONTEXT": "Kontext", "COPY": "Kopieren", "COPY_PROJECT": "Projekt kopieren", @@ -53,41 +53,41 @@ "DELETE": "Löschen", "DELETE_ODBC": "ODBC löschen", "DELETE_PROJECT": "Projekt löschen", - "DELETE_SQUARERECORDING": "Aufnahme löschen", + "DELETE_SQUARERECORDING": "Aufzeichnung löschen", "DESCRIPTION": "Beschreibung", "DIAL": "Wählen", - "DIALOGFLOW": "Dialogflow", + "DIALOGFLOW": "DialogFlow", "DIALOGFLOW_LANGUAGE": "Sprache", "DIGIT": "Maximale Ziffern", "DIGITS": "Ziffern", - "DOWNLOAD_SQUARERECORDING": "Aufnahme hochladen", - "DROP_TO_UPLOAD": "ABLEGEN ZUM UPLOADEN", - "DROP_TO_UPLOAD_MESSAGE": "Sie können hier auch Dateien hochladen. Nur XML- max.5 MB", + "DOWNLOAD_SQUARERECORDING": "Aufzeichnung hochladen", + "DROP_TO_UPLOAD": "Hochladen", + "DROP_TO_UPLOAD_MESSAGE": "Dateien hier hinein ziehen zum Hochladen. Nur XML- max.5 MB", "DSN": "DSN", "EDIT": "Bearbeiten", "EDIT_ODBC": "ODBC bearbeiten", "EDIT_PROJECT": "Projekt bearbeiten", - "EDIT_SQUARERECORDING": "Aufnahme bearbeiten", + "EDIT_SQUARERECORDING": "Aufzeichnung bearbeiten", "EDIT_XML": "XML bearbeiten", "END": "Ende", "ERRORS": { - "DSN_REQUIRED": "Pflichtfeld", - "FIELD_REQUIRED": "Pflichtfeld", - "NAME_REQUIRED": "Pflichtfeld", - "PROJECT_REQUIRED": "Pflichtfeld", - "URL_REQUIRED": "Pflichtfeld" + "DSN_REQUIRED": "DSN erforderlich", + "FIELD_REQUIRED": "Feld erforderlich", + "NAME_REQUIRED": "Name erforderlich", + "PROJECT_REQUIRED": "Projekt erforderlich", + "URL_REQUIRED": "URL erforderlich" }, - "ESCAPE_DIGITS": "Escape Digits", - "EXTEN": "Erweitern", - "EXTENSION": "Erweiterung", - "EXT_DIAL": "Wählen extern", - "FILE": "Dateiname", + "ESCAPE_DIGITS": "Ausgangsziffern", + "EXTEN": "Nst", + "EXTENSION": "Nebenstelle", + "EXT_DIAL": "Externes Wählen", + "FILE": "Datei", "FILENAME": "Dateiname", - "FILE_ID": "Audio", - "FINALLY": "Schliesslich", + "FILE_ID": "ID", + "FINALLY": "Finally", "FINDBY": "Suchen nach", - "GETDIGITS": "Ziffern erhalten", - "GETSECRETDIGITS": "Geheime Ziffern erhalten", + "GETDIGITS": "Ziffern abfragen", + "GETSECRETDIGITS": "Geheime Ziffern abfragen", "GOAL": "Ziel", "GOALNAME": "Zielname", "GOOGLEASR": "GoogleASR", @@ -99,7 +99,7 @@ "GOTOC": "GoTo", "GOTOIF": "GoToIf", "GOTOIFTIME": "GoToIfTime", - "GO_TO_PROJECTS": "Zu den Projekten gehen", + "GO_TO_PROJECTS": "Zu Projekten gehen", "GRAMMAR": "Grammatik", "HANGUP": "Auflegen", "HEADERS": "Überschriften", @@ -111,13 +111,13 @@ "MAX_TEXT_TTS": "Die maximal unterstützte Anzahl von Zeichen beträgt 200", "TO": "Sie können mehrere Adressen durch Kommas hinzufügen (z. b. John.doe@xcally.com, jane.miller@xcally.com)" }, - "HIDDENDIGITSNUM": "Versteckte Ziffern Zahl", - "HIDDENDIGITSPOS": "Position der versteckten Ziffern", + "HIDDENDIGITSNUM": "Anzahl geheime Ziffern", + "HIDDENDIGITSPOS": "Position geheime Ziffern", "ID": "ID", "IMPORT": "Importieren", "IMPORT_XML": "XML importieren", - "INTERVAL_ID": "Intervall", - "INTKEY": "Unterbrechungstaste", + "INTERVAL_ID": "Intervall-ID", + "INTKEY": "Int-Key", "ISPEECHASR": "ISpeech ASR", "ISPEECHTTS": "ISpeech Text-To-Speech", "ISPEECH_ASR_LANGUAGE": "Sprache", @@ -126,7 +126,7 @@ "LABEL": "Label", "LANGUAGECODE": "Sprachcode", "LASTNAME": "Nachname", - "LIST_ID": "Liste", + "LIST_ID": "Listen-ID", "LOGIN": "Einloggen", "LOGOUT": "Ausloggen", "LUMENVOXASR": "Lumenvox ASR", @@ -151,24 +151,24 @@ "NEW_PROJECT": "Neues Projekt", "NEW_VARIABLE": "Neue Variable", "NOOP": "NoOp", - "NOTES": "Notizen", - "NO_AVAILABLE_INFO": "Keine verfügbaren Info", + "NOTES": "Anmerkungen", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", "NUMBER": "Nummer", "ODBC": "ODBC", "ODBC_ID": "ODBC Verbindung", - "OF": "Von", + "OF": "von", "OPEN": "Öffnen", "OPEN_NEW_WINDOW": "In einem neuen Fenster öffnen", "OPEN_PROJECT": "Projekt öffnen", "OPERATION": "Operation", "OPTIONS": "Optionen", "OPTS": "Optionen", - "OUTPUT": "Ausgang", + "OUTPUT": "Ausgabe", "PAGE": "Seite", "PASSWORD": "Passwort", "PAUSE": "Pause", - "PAUSE_ID": "Pause ID", - "PERMISSIONADD_PROJECTS": "Benutzer zu dem Projekt hinzufügen", + "PAUSE_ID": "Pausen-ID", + "PERMISSIONADD_PROJECTS": "Benutzer zum Projekt hinzufügen", "PHONE": "Telefon", "PLAYBACK": "Wiedergabe", "POSITION": "Position", @@ -181,21 +181,21 @@ "QUEUE_ID": "Warteschlange ID", "RAWBODY": "Body", "RAWHEADERS": "Überschriften", - "RECORD": "Aufnahme", - "RECORDINGFORMAT": "Aufnahme Format", - "RESPONSE": "Antwort Timeout", - "RESTAPI": "Rest API", - "RETRY": "Wiederholungen", + "RECORD": "Aufzeichnungen", + "RECORDINGFORMAT": "Aufzeichnungsformat", + "RESPONSE": "Antwort", + "RESTAPI": "Rest-API", + "RETRY": "Retry", "ROWSPERPAGE": "Zeilen pro Seite", "SAVE": "Speichern", - "SAYDIGITS": "Say Digits", - "SAYNUMBER": "Say number", - "SAYPHONETIC": "Say Phonetics", + "SAYDIGITS": "Ziffern ansagen", + "SAYNUMBER": "Nummer ansagen", + "SAYPHONETIC": "Text ansagen", "SEARCH_FOR_ANYONE": "Suchen", "SELECTED": "Ausgewählt", "SELECTED_USERS": "Ausgewählte Benutzer", - "SELECT_ALL": "Alle auswählen", - "SELECT_NONE": "Keine auswählen", + "SELECT_ALL": "Alles auswählen", + "SELECT_NONE": "Nichts auswählen", "SENDFAX": "Fax senden", "SENDMAIL": "E-Mail senden", "SENDSMS": "SMS senden", @@ -206,8 +206,8 @@ "SIP_ID": "SIP", "SMS_ACCOUNT_ID": "Konto", "SMS_TEXT": "Text", - "SPEED": "Speed", - "SQUARERECORDINGS": "Aufnahmen", + "SPEED": "Geschwindigkeit", + "SQUARERECORDINGS": "Aufzeichnungen", "SSMLGENDER": "Geschlecht", "START": "Start", "SUBJECT": "Betreff", @@ -219,26 +219,26 @@ "TEXT": "Text", "TILDEASR": "Tilde ASR", "TIMEOUT": "Timeout", - "TO": "To", + "TO": "An", "TRUNK_NAME": "Trunk", "TTS": "Google Text-To-Speech", "UNIQUEID": "Eindeutige ID", "UNPAUSE": "Pause beenden", "UPDATE_DESCRIPTION": "Update Beschreibung", - "UPDATE_INFO": "Info aktualisieren", + "UPDATE_INFO": "Information aktualisieren", "URI": "URI", "URL": "URL", - "USERNAME": "Benutzername", - "USERS": "Benutzer", + "USERNAME": "Nutzername", + "USERS": "Nutzer", "VARIABLE_ID": "Variable", "VARIABLE_VALUE": "Value", "VOICEMAIL": "Voicemail", "VSWITCH": "Variable Switch", - "CLIENT_EMAIL": "Kunden-E-Mail", - "DIALOGFLOWV2": "DialogflowV2", + "CLIENT_EMAIL": "Kunden E-Mail", + "DIALOGFLOWV2": "DialogFlowV2", "DIALOGFLOWV2_LANGUAGE": "Sprache", "DIALOGFLOWV2_PROJECT_ID": "Projekt-ID", - "PRIVATE_KEY": "Privat Schlüssel", + "PRIVATE_KEY": "Privater Schlüssel", "DIALTIMEZONE": "Zeitzone wählen" } } diff --git a/public/app/main/apps/callysquare/i18n/is.json b/public/app/main/apps/callysquare/i18n/is.json index 22b9fef..8aeabd2 100644 --- a/public/app/main/apps/callysquare/i18n/is.json +++ b/public/app/main/apps/callysquare/i18n/is.json @@ -1,244 +1,244 @@ { "CALLYSQUARE": { - "ACCOUNT_ID": "Account", - "ADDUSER_PROJECTS": "Add Users to Project", - "ADD_ODBC": "Add ODBC", - "ADD_PROJECT": "Add Project", - "ADD_VARIABLE": "Add Variable", - "AGENTS": "Agents", + "ACCOUNT_ID": "Aðgangur", + "ADDUSER_PROJECTS": "Skrá notanda í verkefni", + "ADD_ODBC": "Skrá ODBC", + "ADD_PROJECT": "Skrá verkefni", + "ADD_VARIABLE": "Skrá breytu", + "AGENTS": "Þjónustufulltrúi", "AGI": "AGI", - "ALL_USERS": "All Users", - "ANSWER": "Answer", + "ALL_USERS": "Allir notendur", + "ANSWER": "Svar", "APIKEY": "ApiKey", "APPID": "App ID", - "APPLICATION": "Application", + "APPLICATION": "Forrit", "APPSECRET": "App Secret", - "ARGS": "Arguments", - "ATTACHMENT_NAME": "Attachment Name", - "ATTACHMENT_PATH": "Attachment Path", - "ATTACHMENT_TYPE": "Attachment Type", - "AUDIO": "Audio", - "AUDIOENCODING": "Audio Encoding", + "ARGS": "Frumbreytur", + "ATTACHMENT_NAME": "Nafn viðhengis", + "ATTACHMENT_PATH": "Nafn slóðar", + "ATTACHMENT_TYPE": "Nafn tegunds", + "AUDIO": "Hljóð", + "AUDIOENCODING": "Hljóðkóðun", "AWSLEX": "Amazon Lex", "AWSPOLLY": "AWS Polly", - "AWS_ACCESS_KEY_ID": "Access Key ID", + "AWS_ACCESS_KEY_ID": "Auðkenni aðgangslykils", "AWS_BOT_NAME": "Bot name", "AWS_LEX_REGION": "Region", "AWS_POLLY_REGION": "Region", - "AWS_POLLY_VOICE": "Voice", - "AWS_SECRET_ACCESS_KEY": "Secret Access Key", - "AWS_TEXT_TYPE": "Text type", - "BACK": "Back", + "AWS_POLLY_VOICE": "Rödd", + "AWS_SECRET_ACCESS_KEY": "Secret access key", + "AWS_TEXT_TYPE": "Gerð texta", + "BACK": "Tilbaka", "BCC": "BCC", "BEEP": "Beep", - "BODY": "Body", - "CALLBACK": "Callback", - "CALLBACK_PRIORITY": "Priority", + "BODY": "Meginmál", + "CALLBACK": "Hringja aftur", + "CALLBACK_PRIORITY": "Í forgang", "CALLYSQUARE": "Cally Square", "CC": "CC", - "CHOOSE_ATTACHMENT": "Choose Attachment", - "CLIENT_EMAIL": "Client Email", - "CLOSE": "Close", - "COMMAND": "Command", + "CHOOSE_ATTACHMENT": "Velja viðhengi", + "CLIENT_EMAIL": "Tölvupóstfang viðskiptavins", + "CLOSE": "Loka", + "COMMAND": "Skipun", "COMPUTEDVARIABLES": "Computed Variables Script Path", - "CONDITION": "Condition", - "CONTEXT": "Context", - "COPY": "Copy", - "COPY_PROJECT": "Copy Project", - "CREATED_AT": "Created At", - "CUSTOM_ACTION": "Custom Action", - "CUSTOM_ACTION_DATA": "Custom Action Data", - "CUSTOM_APP": "Custom Application", - "DATABASE": "Database", - "DELAY": "delay [min]", - "DELETE": "Delete", - "DELETE_ODBC": "Delete ODBC", - "DELETE_PROJECT": "Delete Project", - "DELETE_SQUARERECORDING": "Delete Square Recording", - "DESCRIPTION": "Description", - "DIAL": "Dial", + "CONDITION": "Skilyrði", + "CONTEXT": "Samhengi", + "COPY": "Afrita", + "COPY_PROJECT": "Afrita verkefni", + "CREATED_AT": "Stofnað kl.", + "CUSTOM_ACTION": "Sérsniðin aðgerð", + "CUSTOM_ACTION_DATA": "Sérsniðin aðgerðagögn", + "CUSTOM_APP": "Sérsniðið forrit", + "DATABASE": "Gagnagrunnur", + "DELAY": "Seinkun [mín]", + "DELETE": "Eyða", + "DELETE_ODBC": "Eyða ODBC", + "DELETE_PROJECT": "Eyða verkefni", + "DELETE_SQUARERECORDING": "Eyða upptöku símatorgs", + "DESCRIPTION": "Lýsing", + "DIAL": "Hringja", "DIALOGFLOW": "Dialogflow", "DIALOGFLOWV2": "DialogflowV2", - "DIALOGFLOWV2_LANGUAGE": "Language", - "DIALOGFLOWV2_PROJECT_ID": "Project ID", - "DIALOGFLOW_LANGUAGE": "Language", - "DIALTIMEZONE": "Dial timezone", - "DIGIT": "Max Digits", - "DIGITS": "Digits", - "DOWNLOAD_SQUARERECORDING": "Download Square Recording", - "DROP_TO_UPLOAD": "DROP TO UPLOAD", - "DROP_TO_UPLOAD_MESSAGE": "You can also drop files here to upload. Only XML - Max. 5MB", + "DIALOGFLOWV2_LANGUAGE": "Tungumál ", + "DIALOGFLOWV2_PROJECT_ID": "Auðkenni verkefnis", + "DIALOGFLOW_LANGUAGE": "Tungumál", + "DIALTIMEZONE": "Tímabelti hringingu", + "DIGIT": "Hámark tölustafa", + "DIGITS": "Tölustafir", + "DOWNLOAD_SQUARERECORDING": "Hlaða niður upptöku símatorgs", + "DROP_TO_UPLOAD": "Sleppa til að hlaða niður", + "DROP_TO_UPLOAD_MESSAGE": "Þú getur einnig sleppt skrám hér til þess að hlaða niður. Aðeins XML - Hámark 5MB ", "DSN": "DSN", - "EDIT": "Edit", - "EDIT_ODBC": "Edit ODBC", - "EDIT_PROJECT": "Edit Project", - "EDIT_SQUARERECORDING": "Edit Square Recording", - "EDIT_XML": "Edit XML", - "END": "End", + "EDIT": "Breyta", + "EDIT_ODBC": "Breyta ODBC", + "EDIT_PROJECT": "Breyta verkefni", + "EDIT_SQUARERECORDING": "Breyta upptöku símatorgs ", + "EDIT_XML": "Breyta XML", + "END": "Enda", "ERRORS": { - "DSN_REQUIRED": "Mandatory field", - "FIELD_REQUIRED": "Mandatory field", - "NAME_REQUIRED": "Mandatory field", - "PROJECT_REQUIRED": "Mandatory field", - "URL_REQUIRED": "Mandatory field" + "DSN_REQUIRED": "Áskilið svæði", + "FIELD_REQUIRED": "Áskilið svæði", + "NAME_REQUIRED": "Áskilið svæði", + "PROJECT_REQUIRED": "Áskilið svæði", + "URL_REQUIRED": "Áskilið svæði" }, - "ESCAPE_DIGITS": "Escape Digits", + "ESCAPE_DIGITS": "Hætta við tölustafi", "EXTEN": "Exten", - "EXTENSION": "Extension", - "EXT_DIAL": "External Dial", - "FILE": "Filename", - "FILENAME": "Filename", - "FILE_ID": "Audio", - "FINALLY": "Finally", - "FINDBY": "Find By", - "GETDIGITS": "Get Digits", - "GETSECRETDIGITS": "Get Secret Digits", - "GOAL": "Goal", - "GOALNAME": "Goal Name", + "EXTENSION": "Framlenging", + "EXT_DIAL": "Framlenging hringingu", + "FILE": "Skrá", + "FILENAME": "Skrárheiti", + "FILE_ID": "Hljóð", + "FINALLY": "Að lokum", + "FINDBY": "Leita eftir", + "GETDIGITS": "Sækja tölustafi", + "GETSECRETDIGITS": "Sækja leynistafi", + "GOAL": "Markmið", + "GOALNAME": "Nafn markmiðs", "GOOGLEASR": "GoogleASR", - "GOOGLE_ASR_LANGUAGE": "Language", + "GOOGLE_ASR_LANGUAGE": "Tungumál", "GOOGLE_CLOUD_TTS": "Google Cloud TTS", - "GOOGLE_CLOUD_TTS_TEXT_TYPE": "Text Type", - "GOOGLE_TTS_LANGUAGE": "Language", + "GOOGLE_CLOUD_TTS_TEXT_TYPE": "Gerð texta", + "GOOGLE_TTS_LANGUAGE": "Tungumál ", "GOSUB": "GoSub", "GOTOC": "GoTo", "GOTOIF": "GoToIf", "GOTOIFTIME": "GoToIfTime", - "GO_TO_PROJECTS": "Go to projects", - "GRAMMAR": "Grammar", - "HANGUP": "Hangup", - "HEADERS": "Headers", + "GO_TO_PROJECTS": "Fara í verkefni", + "GRAMMAR": "Málfræði", + "HANGUP": "Leggja á ", + "HEADERS": "Síðuhausar", "HELP": { - "BCC": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", - "CC": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", - "DSN": "Example: DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion", + "BCC": "Þú getur bætt við mörgum tölvupóstföngum með því að aðskilja þau með kommu (T.d. john.doe@xcally.com, jane.miller@xcally.com) ", + "CC": "Þú getur bætt við mörgum tölvupóstföngum með því að aðskilja þau með kommu (T.d. john.doe@xcally.com, jane.miller@xcally.com)", + "DSN": "Til dæmis: DRIVER=MySQL;SERVER=127.0.0.1;UID=xcall;PWD=password;DATABASE=motion", "MAILBOX": "mailbox@context", - "MAX_TEXT_TTS": "The maximum number of characters supported is 200", - "TO": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)" + "MAX_TEXT_TTS": "Hámarksfjöldi stafa er 200 ", + "TO": "Þú getur bætt við mörgum tölvupóstföngum með því að aðskilja þau með kommu (T.d. john.doe@xcally.com, jane.miller@xcally.com)" }, "HIDDENDIGITSNUM": "Hiddden Digits Number", "HIDDENDIGITSPOS": "hidden Digits Position", - "ID": "Id", - "IMPORT": "Import", - "IMPORT_XML": "Import XML", + "ID": "Auðkenni", + "IMPORT": "Flutt inn", + "IMPORT_XML": "Flytja inn XML", "INTERVAL_ID": "Interval", - "INTKEY": "Interrupt Key", + "INTKEY": "Roflykill", "ISPEECHASR": "iSpeech ASR", "ISPEECHTTS": "iSpeech Text-To-Speech", - "ISPEECH_ASR_LANGUAGE": "Language", - "ISPEECH_TTS_LANGUAGE": "Language", - "KEY": "Key", - "LABEL": "Label", - "LANGUAGECODE": "Language Code", - "LASTNAME": "Last Name", - "LIST_ID": "List", - "LOGIN": "Login", - "LOGOUT": "Logout", + "ISPEECH_ASR_LANGUAGE": "Tungumál", + "ISPEECH_TTS_LANGUAGE": "Tungumál", + "KEY": "Lykill", + "LABEL": "Merki", + "LANGUAGECODE": "Tungumálakóði", + "LASTNAME": "Eftirnafn", + "LIST_ID": "Listi", + "LOGIN": "Innskráning", + "LOGOUT": "Útskráning", "LUMENVOXASR": "Lumenvox ASR", "LUMENVOXTTS": "Lumenvox Text-To-Speech", "MACRO": "Macro", - "MAILBOX": "Mailbox", + "MAILBOX": "Pósthólf", "MATH": "Math", - "MAXDIGIT": "Maximum Digits", - "MENU": "Menu", - "METHOD": "Method", - "MINDIGIT": "Minimum Digits", - "MODEL": "Model", + "MAXDIGIT": "Hámarkstölur", + "MENU": "Valmynd", + "METHOD": "Aðferð", + "MINDIGIT": "Lágmarkstölur", + "MODEL": "Líkan", "MRCPRECOG": "MRCPRecog", "MRCPSYNTH": "MRCPSynth", - "NAME": "Name", - "NDAACTIVITY_TYPE": "Activity Type", - "NDAGENERATE_AUDIO": "Generate Audio File", + "NAME": "Nafn", + "NDAACTIVITY_TYPE": "Gerð verkþáttar", + "NDAGENERATE_AUDIO": "Búa til hljóðskrá", "NDASSISTANT_URL": "NDASSISTANT Url", "NDAUTH_URL": "NDAUTH Url", - "NEW": "New", + "NEW": "Nýtt", "NEW_ODBC": "New ODBC connection", - "NEW_PROJECT": "New Project", - "NEW_VARIABLE": "New Variable", + "NEW_PROJECT": "Nýtt verkefni", + "NEW_VARIABLE": "Ný breyta", "NOOP": "NoOp", - "NOTES": "Notes", - "NO_AVAILABLE_INFO": "No available info", - "NUMBER": "Number", + "NOTES": "Glósur", + "NO_AVAILABLE_INFO": "Engar tiltækar upplýsingar", + "NUMBER": "Númer", "ODBC": "ODBC", - "ODBC_ID": "ODBC Connection", - "OF": "of", - "OPEN": "Open", - "OPEN_NEW_WINDOW": "Open in a new window", - "OPEN_PROJECT": "Open Project", - "OPERATION": "Operation", - "OPTIONS": "Options", - "OPTS": "Options", + "ODBC_ID": "ODBC tenging", + "OF": "af", + "OPEN": "Opið", + "OPEN_NEW_WINDOW": "Opna í nýjum glugga", + "OPEN_PROJECT": "Opna verkefni", + "OPERATION": "Aðgerð", + "OPTIONS": "Möguleikar", + "OPTS": "Möguleikar", "OUTPUT": "Output", - "PAGE": "Page", - "PASSWORD": "Password", - "PAUSE": "Pause", - "PAUSE_ID": "Pause type", - "PERMISSIONADD_PROJECTS": "Add Users to Project", - "PHONE": "Phone", - "PLAYBACK": "Playback", - "POSITION": "Position", - "PRIORITY": "Priority", - "PRIVATE_KEY": "Private Key", - "PROJECT": "Project", - "PROJECTS": "Projects", - "PROJECT_ID": "Project", - "QUERY": "Query", - "QUEUE": "Queue", - "QUEUE_ID": "Queue", - "RAWBODY": "Body", - "RAWHEADERS": "Headers", - "RECORD": "Record", - "RECORDINGFORMAT": "Recording Format", - "RESPONSE": "Response Timeout", + "PAGE": "Blaðsíða", + "PASSWORD": "Lykilorð ", + "PAUSE": "Hlé", + "PAUSE_ID": "Gerð hlés", + "PERMISSIONADD_PROJECTS": "Bæta við notanda við verkefni", + "PHONE": "Sími", + "PLAYBACK": "Spilun", + "POSITION": "Staða", + "PRIORITY": "Forgangur", + "PRIVATE_KEY": "Einkalykill", + "PROJECT": "Verkefni", + "PROJECTS": "Verkefni", + "PROJECT_ID": "Verkefni", + "QUERY": "Fyrirspurn", + "QUEUE": "Biðröð", + "QUEUE_ID": "Auðkenni biðraðar", + "RAWBODY": "Meginmál", + "RAWHEADERS": "Síðuhaus", + "RECORD": "Upptaka", + "RECORDINGFORMAT": "Snið upptöku", + "RESPONSE": "Tímamörk fyrir svar", "RESTAPI": "Rest API", - "RETRY": "Retries", - "ROWSPERPAGE": "Rows per page", - "SAVE": "Save", - "SAYDIGITS": "Say Digits", - "SAYNUMBER": "Say number", - "SAYPHONETIC": "Say Phonetics", - "SEARCH_FOR_ANYONE": "Search", - "SELECTED": "Selected", - "SELECTED_USERS": "Selected Users", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "SENDFAX": "Send Fax", - "SENDMAIL": "Send Email", - "SENDSMS": "Send SMS", + "RETRY": "Ítrekanir", + "ROWSPERPAGE": "Raðir á síðu", + "SAVE": "Vista", + "SAYDIGITS": "Segja tölustafi", + "SAYNUMBER": "Segja númer", + "SAYPHONETIC": "Segja hlerunarbúðnað", + "SEARCH_FOR_ANYONE": "Leita", + "SELECTED": "Valin", + "SELECTED_USERS": "Valin númer", + "SELECT_ALL": "Velja öll", + "SELECT_NONE": "Ekki velja neitt", + "SENDFAX": "Senda Fax", + "SENDMAIL": "Senda tölvupóst", + "SENDSMS": "Senda sms skilaboð", "SESTEKASR": "Sestek ASR", "SESTEKNDA": "Sestek NDA", "SESTEKTTS": "Sestek TTS", "SET": "Set", "SIP_ID": "SIP", - "SMS_ACCOUNT_ID": "Account", - "SMS_TEXT": "Text", - "SPEED": "Speed", - "SQUARERECORDINGS": "Recordings", - "SSMLGENDER": "Gender", - "START": "Start", - "SUBJECT": "Subject", + "SMS_ACCOUNT_ID": "Aðgangur", + "SMS_TEXT": "Texti", + "SPEED": "Hraði", + "SQUARERECORDINGS": "Upptökur", + "SSMLGENDER": "Kyn", + "START": "Byrja", + "SUBJECT": "Efni", "SUBPROJECT": "Sub Project", - "SYSTEM": "System", - "TELEPHONES": "Telephones", - "TEMPLATE_ID": "Template", + "SYSTEM": "Kerfi", + "TELEPHONES": "Símar", + "TEMPLATE_ID": "Sniðmáti", "TEST_ODBC": "Test ODBC", - "TEXT": "Text", + "TEXT": "Texti", "TILDEASR": "Tilde ASR", "TIMEOUT": "Timeout", "TO": "To", "TRUNK_NAME": "Trunk", "TTS": "Google Text-To-Speech", - "UNIQUEID": "Unique ID", + "UNIQUEID": "Einkvæmt auðkenni", "UNPAUSE": "End Pause", - "UPDATE_DESCRIPTION": "Update Description", - "UPDATE_INFO": "Update Info", + "UPDATE_DESCRIPTION": "Uppfæra áskrift", + "UPDATE_INFO": "Uppfæra upplýsingar", "URI": "URI", "URL": "URL", - "USERNAME": "Username", - "USERS": "Users", - "VARIABLE_ID": "Variable", - "VARIABLE_VALUE": "Value", - "VOICEMAIL": "Voicemail", - "VSWITCH": "Variable Switch" + "USERNAME": "Notendanafn", + "USERS": "Notendur", + "VARIABLE_ID": "Breyta", + "VARIABLE_VALUE": "Gildi", + "VOICEMAIL": "Talhólf", + "VSWITCH": "Breytilegur rofi" } } diff --git a/public/app/main/apps/chat/i18n/bs.json b/public/app/main/apps/chat/i18n/bs.json index e51bee9..23ae914 100644 --- a/public/app/main/apps/chat/i18n/bs.json +++ b/public/app/main/apps/chat/i18n/bs.json @@ -110,9 +110,9 @@ "WAITING": "Čekanje", "WRITING": "PiÅ¡e", "CHAT": "Chat", - "MAIL": "E-mail", + "MAIL": "E-Mail", "SMS": "SMS", - "OPENCHANNEL": "Otvoreni kanal", + "OPENCHANNEL": "Otvoreni Kanal", "FAX": "Fax", "PAUSE": "Pauza", "REALTIME": "Realtime", @@ -478,7 +478,7 @@ "IN_USE": "U upotrebi", "VOICE": "Voice", "INTERACTIONS_CHATWEBSITE": "Idi na Interakcije", - "REFRESH_INTERACTIONS": "Osvježi Interakciju", + "REFRESH_INTERACTIONS": "Osvježi Interakcije", "DELETE_INTERACTION": "IzbriÅ¡i Interakciju", "AGENTADD_CHATWEBSITE": "Dodaj Specijalistu u Chat Website", "TEAMS_ASSOCIATION": "Asocijacija Timova", diff --git a/public/app/main/apps/chat/i18n/de.json b/public/app/main/apps/chat/i18n/de.json index 9fd2be8..4f9b32c 100644 --- a/public/app/main/apps/chat/i18n/de.json +++ b/public/app/main/apps/chat/i18n/de.json @@ -2,7 +2,7 @@ "CHAT": { "AMAZONLEX": "Amazon Lex", "TEXT": "Text", - "TIMES": "Anzahl der Zeiten pro Interaktion", + "TIMES": "Zeiten", "EDIT_AUTOREPLY": "Automatische Antwort bearbeiten", "AUTOREPLY": "Automatische Antwort", "NEW_CHATDISPOSITION": "Neue Chat-Qualifizierung", @@ -12,164 +12,164 @@ "NAME": "Name", "CHATQUEUES": "Chat-Warteschlangen", "SEARCH_FOR_ANYONE": "Suche", - "STRATEGY": "Strategie", - "AGENT_TIMEOUT": "Agent Timeout", + "STRATEGY": "Verteilungsstrategie", + "AGENT_TIMEOUT": "Zeitüberschreitung Agent", "DESCRIPTION": "Beschreibung", "KEY": "Schlüssel", "ALIAS": "Alias-Name", "VARIABLE": "Variable", - "INTERVAL": "Intervall", - "EDIT_CLOSE": "Bearbeitung abschließen", + "INTERVAL": "Zeitintervall", + "EDIT_CLOSE": "Verhalten bei Schließen bearbeiten", "TIMEZONE": "Zeitzone", "MESSAGE": "Nachricht", "ADVANCED": "Erweitert", "FORWARDTRANSCRIPT": "Transkript weiterleiten", "FORWARDTRANSCRIPTMESSAGE": "Transkript-Nachricht weiterleiten", - "SKIPMESSAGEBUTTON": "Nachrichtenbutton überspringen", + "SKIPMESSAGEBUTTON": "Button überspringen Nachricht", "EDIT_MESSAGE": "Nachricht bearbeiten", - "CONDITION_AGREEMENT": "Konditionelle Vereinbarung", + "CONDITION_AGREEMENT": "Chatbestimmungen akzeptieren", "NONE": "Nichts", "PRIORITY": "Priorität", - "ONLINESTATUS": "Online Status", - "UNMANAGEDSTATUS": "Status nicht bearbeitet", - "AUTOCLOSE": "Automatisches Schließen aktivieren", - "ENABLEUNMANAGEDNOTE": "Unbearbeitete Nachricht aktivieren", + "ONLINESTATUS": "Onlinestatus", + "UNMANAGEDSTATUS": "Nicht bearbeitet", + "AUTOCLOSE": "Automatisches Schließen", + "ENABLEUNMANAGEDNOTE": "Anmerkung für unbearbeitete Interaktionen aktivieren", "UNMANAGEDMESSAGE": "Unbearbeitete Nachricht", - "SKIPUNMANAGED": "Nachricht überspringen", + "SKIPUNMANAGED": "Nachricht bei Überspringen", "SENDUNMANAGED": "Nachricht senden", "WEBSITESCRIPT": "Webseiten-Skript", - "DELETE_OFFLINEMESSAGE": "Löschen", - "OFFLINEMESSAGES": "Offline Nachrichten", - "FORWARD_OFFLINE": "Offline weiterleiten", - "SHOW_OFFLINEMESSAGE": "Anzeigen", - "FORWARD_OFFLINE_ADDRESS": "Offline-Adresse weiterleiten", + "DELETE_OFFLINEMESSAGE": "Offline-Nachricht löschen", + "OFFLINEMESSAGES": "Offline-Nachrichten", + "FORWARD_OFFLINE": "Offline-Nachricht weiterleiten", + "SHOW_OFFLINEMESSAGE": "Offline-Nachrichten anzeigen", + "FORWARD_OFFLINE_ADDRESS": "Adresse für Weiterleitung Offline-Nachrichten", "CLOSINGFORM": "Formular schließen", "ENABLERATING": "Bewertung aktivieren", "ENABLECUSTOMERWRITING": "Kunde kann schreiben, bevor Chat akzeptiert wird", "ENABLEFEEDBACK": "Feedback aktivieren", "RATINGTYPE": "Bewertungstyp", - "CLOSINGMESSAGE": "Abschluss Nachricht", - "CLOSINGMESSAGEBUTTON": "Button für Abschluss Nachricht", + "CLOSINGMESSAGE": "Abschlussnachricht", + "CLOSINGMESSAGEBUTTON": "Button für Abschlussnachricht", "RATINGSTARSNUMBER": "Anzahl der Bewertungssterne", "EDIT_GOTOIF": "GotoIf bearbeiten", "CONDITION": "Bedingung", - "TRUEPRIORITY": "Wahre Priorität", - "FALSEPRIORITY": "Falsche Priorität", + "TRUEPRIORITY": "Priorität bei 'wahr'", + "FALSEPRIORITY": "Priorität bei 'falsch'", "VALUE": "Wert", "WEBSITEALIAS": "Website-Alias", "ERRORS": { - "TEXT_REQUIRED": "Pflichtfeld", - "SENDUNMANAGED_REQUIRED": "Pflichtfeld", - "SENDUNMANAGED_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", - "SKIPUNMANAGED_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", - "UNMANAGEDMESSAGE_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", - "WEBSITEALIAS_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", - "AGENT_REQUIRED": "Pflichtfeld", - "QUEUE_REQUIRED": "Pflichtfeld", - "CONDITION_REQUIRED": "Pflichtfeld", - "PRIORITY_REQUIRED": "Pflichtfeld", - "TRUEPRIORITY_REQUIRED": "Pflichtfeld", - "FALSEPRIORITY_REQUIRED": "Pflichtfeld", - "NAME_REQUIRED": "Pflichtfeld", - "LIST_REQUIRED": "Pflichtfeld", - "AGENT_TIMEOUT_REQUIRED": "Pflichtfeld", - "MOTIONADDRESS_REQUIRED": "Pflichtfeld", - "DISPOSITION_REQUIRED": "Pflichtfeld", - "MOTIONADDRESS_MUST_VALID_URL": "Falsches Format", - "EMAIL_MUST_BE_VALID": "Falsches Format", - "ADDRESS_REQUIRED": "Pflichtfeld", - "ADDRESS_MUST_VALID_URL": "Falsches Format", - "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "Pflichtfeld", - "ACCEPTURL_MUST_VALID_URL": "Falsches Format", - "TIMEOUT_REQUIRED": "Pflichtfeld", - "REJECTURL_MUST_VALID_URL": "Falsches Format", - "CLOSEURL_MUST_VALID_URL": "Falsches Format", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "POLLING_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "WAITINGMESSAGE_REQUIRED": "Pflichtfeld", - "WAITINGTITLE_REQUIRED": "Pflichtfeld", - "KEY_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", - "KEY_REQUIRED": "Pflichtfeld", - "WAITINGMESSAGE_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", - "WAITINGTITLE_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", - "RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "HEADER_OFFLINE_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", - "OFFLINE_CHAT_BUTTON_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", - "CLOSINGQUESTION_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", - "TEXT_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", - "VALUE_REQUIRED": "Pflichtfeld", - "OFFLINEMESSAGESUBJECT_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", - "OFFLINEMESSAGEBODY_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", - "PLACEHOLDERMESSAGE_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", - "NOTETITLE_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", - "FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", - "FORMSUBMITFAILUREMESSAGE_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", - "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "FONTSIZE_REQUIRED": "Pflichtfeld", - "COMMAND_REQUIRED": "Pflichtfeld", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "NAME_MUST_VALID_PATTERN": "Falsches Format", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Pflichtfeld", - "VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", - "VERTICALPOSITION_REQUIRED": "Pflichtfeld", - "CUSTOMERALIAS_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", - "TAG_REQUIRED": "Pflichtfeld", - "MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", - "MESSAGEFONTSIZE_REQUIRED": "Pflichtfeld", - "AGENTALIAS_REQUIRED": "Pflichtfeld", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", - "CUSTOMERALIAS_REQUIRED": "Pflichtfeld", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", - "SYSTEMALIAS_MAX_LENGTH": "Wert darf eine maximale Länge haben von {{max}} ", - "SYSTEMALIAS_REQUIRED": "Pflichtfeld", - "ACCESSKEYID_REQUIRED": "Pflichtfeld", - "BOTNAME_REQUIRED": "Pflichtfeld", - "SECRETACCESSKEY_REQUIRED": "Pflichtfeld", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pflichtfeld", - "VIDAOOAPIKEY_REQUIRED": "Pflichtfeld", - "CLIENTEMAIL_REQUIRED": "Pflichtfeld", - "PRIVATEKEY_REQUIRED": "Pflichtfeld", - "PROJECTID_REQUIRED": "Pflichtfeld", - "VIDAOOTOPIC_REQUIRED": "Pflichtfeld", - "EMAIL_ACCOUNT_REQUIRED": "Pflichtfeld" + "TEXT_REQUIRED": "Test erforderlich", + "SENDUNMANAGED_REQUIRED": "Eingabe erforderlich", + "SENDUNMANAGED_MAX_LENGTH": "Wert darf eine maximale Länge von {{max}} haben", + "SKIPUNMANAGED_MAX_LENGTH": "Wert darf eine maximale Länge von {{max}} haben", + "UNMANAGEDMESSAGE_MAX_LENGTH": "Nachricht darf eine maximale Länge von {{max}} haben", + "WEBSITEALIAS_MAX_LENGTH": "Alias darf eine maximale Länge von {{max}} haben", + "AGENT_REQUIRED": "Agent erforderlich", + "QUEUE_REQUIRED": "Warteschlange erforderlich", + "CONDITION_REQUIRED": "Bedingung erforderlich", + "PRIORITY_REQUIRED": "Priorität erforderlich", + "TRUEPRIORITY_REQUIRED": "Priorität bei 'wahr' erforderlich", + "FALSEPRIORITY_REQUIRED": "Priorität bei 'falsch' erforderlich", + "NAME_REQUIRED": "Name erforderlich", + "LIST_REQUIRED": "Liste erforderlich", + "AGENT_TIMEOUT_REQUIRED": "Zeitüberschreitung Agent erforderlich", + "MOTIONADDRESS_REQUIRED": "Adresse Server erforderlich", + "DISPOSITION_REQUIRED": "Qualifizierung erforderlich", + "MOTIONADDRESS_MUST_VALID_URL": "Ungültiges Format Adresse", + "EMAIL_MUST_BE_VALID": "Ungültiges Format E-Mail", + "ADDRESS_REQUIRED": "Adresse erforderlich", + "ADDRESS_MUST_VALID_URL": "Ungültiges Format URL", + "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "Adresse für Weiterleitung erforderlich", + "ACCEPTURL_MUST_VALID_URL": "Ungültiges Format URL", + "TIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", + "REJECTURL_MUST_VALID_URL": "Ungültiges Format URL", + "CLOSEURL_MUST_VALID_URL": "Ungültiges Format URL bei Schließen", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität muss größer oder gleich sein als", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei 'wahr' muss größer oder gleich sein als", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei 'falsch' muss größer oder gleich sein als", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", + "POLLING_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Abfrageintervall muss größer oder gleich sein als", + "WAITINGMESSAGE_REQUIRED": "Wartenachricht erforderlich", + "WAITINGTITLE_REQUIRED": "Titel Wartefenster erforderlich", + "KEY_MAX_LENGTH": "Schlüssel darf eine maximale Länge von {{max}} haben", + "KEY_REQUIRED": "Schlüssel erforderlich", + "WAITINGMESSAGE_MAX_LENGTH": "Nachricht darf eine maximale Länge von {{max}} haben", + "WAITINGTITLE_MAX_LENGTH": "Titel darf eine maximale Länge von {{max}} haben", + "RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Anzahl Bewertungssterne muss größer oder gleich sein als", + "HEADER_OFFLINE_MAX_LENGTH": "Titel darf eine maximale Länge von {{max}} haben", + "OFFLINE_CHAT_BUTTON_MAX_LENGTH": "Text darf eine maximale Länge von {{max}} haben", + "CLOSINGQUESTION_MAX_LENGTH": "Text darf eine maximale Länge von {{max}} haben", + "TEXT_MAX_LENGTH": "Text darf eine maximale Länge von {{max}} haben", + "VALUE_REQUIRED": "Wert erforderlich", + "OFFLINEMESSAGESUBJECT_MAX_LENGTH": "Betreff darf eine maximale Länge von {{max}} haben", + "OFFLINEMESSAGEBODY_MAX_LENGTH": "Text darf eine maximale Länge von {{max}} haben", + "PLACEHOLDERMESSAGE_MAX_LENGTH": "Text darf eine maximale Länge von {{max}} haben", + "NOTETITLE_MAX_LENGTH": "Titel darf eine maximale Länge von {{max}} haben", + "FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH": "Text darf eine maximale Länge von {{max}} haben", + "FORMSUBMITFAILUREMESSAGE_MAX_LENGTH": "Text darf eine maximale Länge von {{max}} haben", + "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Schriftgröße muss größer oder gleich sein als", + "FONTSIZE_REQUIRED": "Schriftgröße erforderlich", + "COMMAND_REQUIRED": "Eingabe erforderlich", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent muss größer oder gleich sein als", + "NAME_MUST_VALID_PATTERN": "Ungültiges Format Name", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent muss größer oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Warten auf zugew. Agenten muss größer oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Warten auf zugew. Agenten muss kleiner oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Warten auf zugew. Agenten erforderlich", + "VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Position muss größer oder gleich sein als", + "VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Position muss kleiner oder gleich sein als", + "VERTICALPOSITION_REQUIRED": "Position erforderlich", + "CUSTOMERALIAS_MAX_LENGTH": "Alias darf eine maximale Länge von {{max}} haben", + "TAG_REQUIRED": "Tag erforderlich", + "MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Schriftgröße muss größer oder gleich sein als", + "MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Schriftgröße muss kleiner oder gleich sein als", + "MESSAGEFONTSIZE_REQUIRED": "Schriftgröße erforderlich", + "AGENTALIAS_REQUIRED": "Agenten-Alias erforderlich", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agententransfer muss größer oder gleich sein als", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agententransfer muss kleiner oder gleich sein als", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Agententransfer erforderlich", + "CUSTOMERALIAS_REQUIRED": "Kunden-Alias erforderlich", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Warteschlangentransfer muss größer oder gleich sein als", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Warteschlangentransfer muss kleiner oder gleich sein als", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Warteschlangentransfer erforderlich", + "SYSTEMALIAS_MAX_LENGTH": "System-Alias darf eine maximale Länge von {{max}} haben", + "SYSTEMALIAS_REQUIRED": "System-Alias erforderlich", + "ACCESSKEYID_REQUIRED": "Zugangsschlüssel erforderlich", + "BOTNAME_REQUIRED": "BOT-Name erforderlich", + "SECRETACCESSKEY_REQUIRED": "Geheimer Zugangsschlüssel erforderlich", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Agentenstatus während Qualifizierung erforderlich", + "VIDAOOAPIKEY_REQUIRED": "Vidaoo-API-Schlüssel erforderlich", + "CLIENTEMAIL_REQUIRED": "Kunden E-Mail erforderlich", + "PRIVATEKEY_REQUIRED": "Privater Schlüssel erforderlich", + "PROJECTID_REQUIRED": "Projekt-ID erforderlich", + "VIDAOOTOPIC_REQUIRED": "Vidaoo-Thema erforderlich", + "EMAIL_ACCOUNT_REQUIRED": "E-Mail Konto erforderlich" }, "CM_FIELD": "Kontaktmanager-Feld", - "CHATPROACTIVEACTIONS": "Proaktive Anfragen", - "NEW_CHATPROACTIVEACTION": "Neue proaktive Anfrage", - "EDIT_CHATPROACTIVEACTION": "Proaktive Anfrage bearbeiten", - "DELETE_CHATPROACTIVEACTION": "Proaktive Anfrage löschen", - "ADD_CHATPROACTIVEACTION": "Proaktive Anfrage hinzufügen", - "NO_CHATPROACTIVEACTION_AVAILABLE": "Keine proaktiven Anfragen verfügbar", + "CHATPROACTIVEACTIONS": "Proaktive Chatanfragen", + "NEW_CHATPROACTIVEACTION": "Neue proaktive Chatanfrage", + "EDIT_CHATPROACTIVEACTION": "Proaktive Chatanfrage bearbeiten", + "DELETE_CHATPROACTIVEACTION": "Proaktive Chatanfrage löschen", + "ADD_CHATPROACTIVEACTION": "Proaktive Chatanfrage hinzufügen", + "NO_CHATPROACTIVEACTION_AVAILABLE": "Keine proaktiven Chatanfragen verfügbar", "NO_OFFLINEMESSAGE_AVAILABLE": "Keine Offline-Nachrichten verfügbar", "MOUSEOVER": "Mouse-Over", - "TIMEOUT": "Timeout", + "TIMEOUT": "Zeitüberschreitung", "TYPE": "Typ", - "SELECTOR": "Selektion", + "SELECTOR": "Auswahl", "AGENT": "Agent", - "GOTO": "Goto", - "GOTOIF": "GotoIf", - "NOOP": "Noop", + "GOTO": "Absprung (Goto)", + "GOTOIF": "Bedingter Absprung (GotoIf)", + "NOOP": "Log erstellen (NoOp)", "QUEUE": "Warteschlange", - "BUILDER": "Builder", + "BUILDER": "Editor", "PREVIEW": "Vorschau", "EDIT_AGENT": "Agenten bearbeiten", "EDIT_QUEUE": "Warteschlange bearbeiten", - "EDIT_GOTO": "Goto bearbeiten", - "EDIT_GOTOIf": "GotoIf bearbeiten", - "EDIT_NOOP": "Noop bearbeiten", + "EDIT_GOTO": "GoTo bearbeiten", + "EDIT_GOTOIf": "GoToIf bearbeiten", + "EDIT_NOOP": "NoOp bearbeiten", "ADD_CHATQUEUE": "Chat-Warteschlange hinzufügen", "EDIT_CHATQUEUE": "Chat-Warteschlange bearbeiten", "DELETE_CHATQUEUE": "Chat-Warteschlange löschen", @@ -190,10 +190,10 @@ "UP": "Nach Oben", "DOWN": "Nach Unten", "COLLAPSE": "Einklappen", - "PROACTIVEACTIONS": "Proaktive Anfragen", + "PROACTIVEACTIONS": "Proaktive Chatanfragen", "DISPOSITIONS": "Qualifizierungen", "WEBHOOKS": "WebHooks", - "ACTIONS": "Aktionen", + "ACTIONS": "Routing", "FIDELITY": "Treue", "APPEARANCE": "Darstellung", "MAINCOLOR": "Hauptfarbe", @@ -202,16 +202,16 @@ "HEADERSHAPE": "Kopfzeilenform", "ANIMATION": "Animation", "DEFAULT": "Standard", - "WHITELABEL": "White Label", + "WHITELABEL": "WhiteLabel", "LOGO": "Logo", "DOWNLOADTRANSCRIPT": "Transkript herunterladen", "ENQUIRY_ENABLE": "Anfrage aktivieren", "ENQUIRY_FORWARDING": "Weiterleitung von Anfragen", - "ENQUIRY_FORWARDING_ADDRESS": "Anfrage-Weiterleitungsadresse", + "ENQUIRY_FORWARDING_ADDRESS": "Adresse für Weiterleitung", "LABELS": "Labels", "HEADER_ONLINE": "Online-Kopfzeile", "ONLINE_MESSAGE": "Online Nachricht", - "NAME_TITLE": "Name Titel", + "NAME_TITLE": "Titel", "USERNAME_PLACEHOLDER": "Platzhalter für Nutzernamen", "EMAIL_TITLE": "E-Mail Titel", "EMAIL_PLACEHOLDER": "Platzhalter für E-Mail Adresse", @@ -219,7 +219,7 @@ "AGENTS_BUSY": "Agenten besetzt", "HEADER_OFFLINE": "Offline-Kopfzeile", "OFFLINE_MESSAGE": "Offline Nachricht", - "MESSAGE_TITLE": "Nachricht Titel", + "MESSAGE_TITLE": "Titel Nachricht", "ENQUIRY_MESSAGE_PLACEHOLDER": "Platzhalter für Nachrichteneingabe", "ENQUIRY_BUTTON": "Anfrage-Button", "RATING_MESSAGE": "Bewertungsnachricht", @@ -239,29 +239,29 @@ "CLOSEURL": "URL schließen", "EMBEDDING": "Einbetten", "GENERAL": "Allgemein", - "SELECTED": "Ausgewählte", + "SELECTED": "Ausgewählt", "SELECT_ALL": "Alles auswählen", "SELECT_NONE": "Nichts auswählen", "BACK": "Zurück", "HELP": { "MAPKEY": "Das folgende Feld aus dem Kontaktmanager:", "FROMKEY": "wird in dem Chat-Snippet wie folgt zugeordnet:", - "TOKEN": "Automatisch generierter Token zur Verwendung im Skript", - "COPYSCRIPTTOCLIPBOARD": "Kopieren Sie den Skripttext und fügen Sie ihn in Ihre Website ein", - "FORWARD_OFFLINE": "Sie können mehrere durch Kommas getrennte Adressen hinzufügen (z. B. john.doe@xcally.com, jane.miller@xcally.com)", - "MOTIONADDRESS": "Das Feld muss das folgende Format haben: ≪protocol>://[:]. Beispiel: https://X.Y.Z.W", - "MOTIONPROXY": "Das Feld muss das folgende Format haben: ≪Protocol>:// ≪IP-Adresse>: ≪port>]. Beispiel: https://X.Y.Z.W", + "TOKEN": "Token automatisch generieren", + "COPYSCRIPTTOCLIPBOARD": "Snippet zum Einfügen auf der Webseite", + "FORWARD_OFFLINE": "Mehrere Adressen können mit Komma getrennt werden. Bsp: ab@de.com, de@fg.com", + "MOTIONADDRESS": "Gültiges Format: protocol>://[:]. Beispiel: https://X.Y.Z.W", + "MOTIONPROXY": "Gültiges Format: Protocol>:// ≪IP-Adresse>: port>]. Beispiel: https://X.Y.Z.W", "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", "LIST": "Liste für die Zuordnung aus dem Kontaktmanager", - "KEY": "Website-Kurzname (5 Zeichen), der auf der Registerkarte \"Agent\" angezeigt wird", - "INTEVAL": "Wählen aus der Liste der verfügbaren Intervalle", + "KEY": "Website-Kurzname (5 Zeichen) zur Anzeige im Agenteninterface", + "INTEVAL": "Intervall auswählen", "TIMEZONE": "Zeitzone auswählen (Standard = lokale Zeitzone)", "ENABLERATING": "Bewertung nach Chat durch Kunden aktivieren", "ENABLEFEEDBACK": "Feedback nach Chat durch Kunden aktivieren (Max. 150 Zeichen)", "FORWARDTRANSCRIPT": "Chatprotokoll nach Abschluss per E-Mail senden", "AUTOCLOSE": "Aktivieren Sie diese Option, wenn Chat-Sitzungen als nicht bearbeitet geschlossen werden sollen, sofern kein Agent verfügbar ist.", "ENABLEUNMANAGEDNOTE": "Automatische Nachricht an den Kunden, wenn alle Agenten besetzt sind und somit der Chat nicht verfügbar ist", - "ENABLECUSTOMERWRITING": "Legt fest, ob der Kunde bereits im Chat schreiben kann, bevor ein Agent den Chat entgegen nimmmt. Hinweis: Dadurch kein Status \"unbearbeitet\"", + "ENABLECUSTOMERWRITING": "Legt fest, ob der Kunde bereits im Chat schreiben kann, bevor ein Agent den Chat entgegen nimmt. Hinweis: Dadurch kein Status \"unbearbeitet\"", "INTERVAL": "Bitte aus der Liste wählen", "HIDEWHENOFFLINE": "Snippet ausblenden, wenn offline", "AGENTIDENTIFIER": "Agentenkennung innerhalb der Chat-Sitzung im Snippet", @@ -269,11 +269,11 @@ "VERTICALPOSITION": "Prozentualer Abstand in Prozent vom oberen Bildschirmrand", "WELCOMEMESSAGE": "Leer lassen, um keine Nachricht zu senden", "MANDATORYDISPOSITION": "Qualifizierung erforderlich", - "MANDATORYDISPOSITIONPAUSEID": "PausenID bei erforderlicher Qualifizierung" + "MANDATORYDISPOSITIONPAUSEID": "Agentenstatus während Qualifizierung" }, "ADDRESS": "Adresse", - "ONLINESTATE": "Online Status", - "OFFLINESTATE": "Offline Status", + "ONLINESTATE": "Onlinestatus", + "OFFLINESTATE": "Offlinestatus", "RATINGSTATE": "Bewertungsstatus", "ENQUIRY": "Anfrage", "OFFLINETEMPLATE": "Offline Vorlage", @@ -309,26 +309,26 @@ "SELECT_STATUS": "Status auswählen", "FILTER": "Filter", "FILTERS": "Filter", - "TEAMADD_CHATQUEUE": "Team zur Chat-Warteschlange hinzufügen", - "AGENTADD_CHATQUEUE": "Agenten zur Chat-Warteschlange hinzufügen", + "TEAMADD_CHATQUEUE": "Team hinzufügen", + "AGENTADD_CHATQUEUE": "Agenten hinzufügen", "ALL_AGENTS": "Alle Agenten", "SELECTED_AGENTS": "Ausgewählte Agenten", "CLOSEDAT": "Geschlossen am", "DISPOSITION": "Qualifizierung", "CREATEDAT": "Erstellt am", - "NOTES": "Notizen", + "NOTES": "Anmerkungen", "NO_INTERACTION_AVAILABLE": "Keine Interaktionen verfügbar", "SELECTED_WEBSITE": "Ausgewählte Webseite", - "GOTOP": "Gotop", - "EDIT_GOTOP": "Gotop bearbeiten", + "GOTOP": "Absprung auf Anwendung (GoToP)", + "EDIT_GOTOP": "GoToP bearbeiten", "SELECT_WEBSITE": "Webseite auswählen", - "INFO": "Info", + "INFO": "Information", "OFFLINEMESSAGES_CHATWEBSITE": "Zu Offline-Nachrichten gehen", "WAITINGTITLE": "Titel während Warten", "WAITINGMESSAGE": "Wartenachricht", "RATING": "Bewertung", "NO_RATINGVALUE": "Keine Bewertung", - "AGENTSADD_QUEUE": "Agenten zur Chat-Warteschlange hinzufügen", + "AGENTSADD_QUEUE": "Agenten hinzufügen", "QUEUES": "Warteschlangen", "LOGGED_IN": "Angemeldet", "PAUSED": "in Pause", @@ -340,49 +340,49 @@ "OPENCHANNEL": "Offener Kanal", "FAX": "Fax", "PAUSE": "Pause", - "REALTIME": "Echtzeit", + "REALTIME": "Echtzeit-Ansicht", "AGENTS": "Agenten", "FULLNAME": "Vollständiger Name", "INTERNAL": "Intern", - "PHONE_STATE": "Telefonstatus", - "PHONE_STATUS": "Telefonstatus", + "PHONE_STATE": "Status Nebenstelle", + "PHONE_STATUS": "Status SIP", "LOGOUT": "Abmelden", "UNPAUSE": "Pause beenden", - "AGENTADD_QUEUE": "Agenten zur Chat-Warteschlange hinzufügen", - "DEFAULT_PAUSE": "Standard Pause", + "AGENTADD_QUEUE": "Agenten hinzufügen", + "DEFAULT_PAUSE": "Standard-Pause", "UNKNOWN": "Unbekannt", "UNREGISTERED": "Nicht registriert", "UNAVAILABLE": "Nicht verfügbar", "NOT_INUSE": "Nicht in Verwendung", "REACHABLE": "Erreichbar", "IN_USE": "In Verwendung", - "VOICE": "Anrufe", + "VOICE": "Sprachanrufe (Voice)", "NO_AGENT_ONLINE": "Kein Agent Online", - "GOTOREALTIME_CHATQUEUE": "Zur Echtzeit-Warteschlange für Chat gehen", + "GOTOREALTIME_CHATQUEUE": "Direkt zur Echtzeit-Ansicht", "PARTIALPAUSE": "Teilpause", "BUSY": "Besetzt", "TIMER": "Timer", - "IDLE": "Inaktiv", + "IDLE": "Leerlauf", "CAPACITY": "Kapazität", "TAGS": "Tags", - "SHOWAGENTAVATAR": "Persönlichen Agenten-Avatar anzeigen", + "SHOWAGENTAVATAR": "Agenten-Avatar anzeigen", "AGENTAVATAR": "Agenten-Avatar", - "SPYINTERACTION": "Mitlesen", + "SPYINTERACTION": "Interaktion anzeigen", "INTERACTIONS_CHATWEBSITE": "Zu den Interaktionen gehen", "REFRESH_INTERACTIONS": "Interaktionen aktualisieren", "CLOSINGQUESTION": "Abschlussfrage", "WEBSCRIPT": "Webskript", - "NO_CHATCANNEDANSWER_AVAILABLE": "Keine Textvorlagen verfügbar", - "NEW_CHATCANNEDANSWER": "Neue Textvorlage", - "ADD_CHATCANNEDANSWER": "Textvorlage hinzufügen", - "EDIT_CHATCANNEDANSWER": "Textvorlage bearbeiten", - "DELETE_CHATCANNEDANSWER": "Textvorlage löschen", - "OFFLINEMESSAGESUBJECT": "Betreff der Nachricht bei Offline", - "OFFLINEMESSAGEBODY": "Test der Nachricht bei Offline", + "NO_CHATCANNEDANSWER_AVAILABLE": "Keine Textbausteine verfügbar", + "NEW_CHATCANNEDANSWER": "Neuer Textbaustein", + "ADD_CHATCANNEDANSWER": "Textbaustein hinzufügen", + "EDIT_CHATCANNEDANSWER": "Textbaustein bearbeiten", + "DELETE_CHATCANNEDANSWER": "Textbaustein löschen", + "OFFLINEMESSAGESUBJECT": "Betreff der Offline-Nachricht", + "OFFLINEMESSAGEBODY": "Textinhalt Offline-Nachricht", "FORMSUBMITSUCCESSMESSAGE": "Meldung Formular erfolgreich gesendet", "FORMSUBMITFAILUREMESSAGE": "Meldung Fehler beim Senden des Formulars", "PLACEHOLDERMESSAGE": "Nachricht für Platzhalter", - "NOTETITLE": "Titel der Notiz", + "NOTETITLE": "Titel der Anmerkung", "DELETE_INTERACTION": "Interaktion löschen", "FONTSIZE": "Schriftgröße", "TEXTCOLOR": "Textfarbe", @@ -391,23 +391,23 @@ "SYSTEM": "System", "NOTIFICATION": "Benachrichtigung", "NOTIFICATIONSHAKE": "Schütteln", - "NOTIFICATIONSOUND": "Klingeln", + "NOTIFICATIONSOUND": "Ton abspielen", "NOTIFICATIONTEMPLATE": "Vorlage", "HIDEWHENOFFLINE": "Ausblenden, wenn offline", "INSERT_MESSAGE_HERE": "Nachricht hier eingeben", - "AGENTALIAS": "Agent Alias", + "AGENTALIAS": "Agenten-Alias", "AGENTFULLNAME": "Vollständiger Name des Agenten", - "AGENTIDENTIFIER": "Identifikator", - "WAITFORTHEASSIGNEDAGENT": "Warten auf den zugewiesenen Mitarbeiter", + "AGENTIDENTIFIER": "Agenten-Identifier", + "WAITFORTHEASSIGNEDAGENT": "Auf zugewiesenen Agenten warten", "ALIGNMENT": "Ausrichtung", "BOTTOM_RIGHT": "Unten rechts", - "LEFT": "Links", - "RIGHT": "Richtig", - "VERTICALALIGNMENT": "Vertikale Ausrichtung", + "LEFT": "Linksbündig", + "RIGHT": "Rechtsbündig", + "VERTICALALIGNMENT": "Vertikal", "POSITION": "Position", "VERTICALPOSITION": "Vertikale Position", - "SNIPPETSWIPEOUT": "Snippet ausschieben", - "ALTERNATE": "Wechseln", + "SNIPPETSWIPEOUT": "Snippet ausklappen", + "ALTERNATE": "Ansicht wechselnde Nachrichten", "CENTERED": "Zentriert", "CUSTOMERAVATAR": "Kunden-Avatar", "DEFAULTTITLE": "Standardtitel", @@ -416,66 +416,66 @@ "CUSTOMERALIAS": "Kunden-Alias", "EDIT_TAG": "Tag bearbeiten", "TAG": "Tag", - "AGENTADD_CHATWEBSITE": "Agenten zur Chat-Website hinzufügen", + "AGENTADD_CHATWEBSITE": "Agenten hinzufügen", "BACKGROUNDCOLOR": "Hintergrundfarbe", - "MESSAGEFONTSIZE": "Schriftgröße der Nachricht", - "AGENTTRANSFER": "Agententransfer", - "AGENTTRANSFERTIMEOUT": "Agententransfer-Timeout", - "DIALOGFLOW": "Dialogflow", - "EDIT_DIALOGFLOW": "Dialogflow bearbeiten", + "MESSAGEFONTSIZE": "Schriftgröße", + "AGENTTRANSFER": "Transfer an Agenten erlauben", + "AGENTTRANSFERTIMEOUT": "Zeitüberschreitung Agententransfer", + "DIALOGFLOW": "DialogFlow", + "EDIT_DIALOGFLOW": "DialogFlow bearbeiten", "LANGUAGE": "Sprache", - "QUEUETRANSFER": "Transfer in Warteschlange", - "QUEUETRANSFERTIMEOUT": "Timeout bei der Warteschlangenübertragung", - "SYSTEMALIAS": "Systemalias", + "QUEUETRANSFER": "Transfer in Warteschlange erlauben", + "QUEUETRANSFERTIMEOUT": "Zeitüberschreitung Warteschlangentransfer", + "SYSTEMALIAS": "System-Alias", "SYSTEMAVATAR": "System-Avatar", "TRANSFER": "Transfer", "WELCOMEMESSAGE": "Willkommensnachricht", "ENABLECUSTOMERCHECKMARKS": "Bestätigung Nachricht erhalten/gelesen", - "CANNEDANSWERS": "Textvorlagen", - "CHATCANNEDANSWERS": "Textvorlagen", - "DOWNLOAD_INTERACTION": "Herunterladen", + "CANNEDANSWERS": "Vordefinierte Antworten", + "CHATCANNEDANSWERS": "Vordefinierte Antworten", + "DOWNLOAD_INTERACTION": "Interaktion herunterladen", "LOGIN_TIME": "Zeit angemeldet", "PAUSE_TIME": "Zeit in Pause", "ACCESSKEYID": "Zugangsschlüssel-ID", - "BOTNAME": "Botname", + "BOTNAME": "BOT-Name", "EDIT_AMAZONLEX": "Amazon Lex bearbeiten", - "LEXREGION": "Region", + "LEXREGION": "Amazon Lex Region", "SECRETACCESSKEY": "Geheimer Zugangsschlüssel", "TEAMS_ASSOCIATION": "Teamzuweisung", "MANDATORYDISPOSITION": "Qualifizierung erforderlich", - "MANDATORYDISPOSITIONPAUSEID": "PausenID, wenn Qualifizierung erforderlich", + "MANDATORYDISPOSITIONPAUSEID": "Agentenstatus während Qualifizierung", "ENABLESENDBUTTON": "Senden-Button aktivieren", "FEEDBACKTITLE": "Feedback-Titel", - "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufzeichnung verfügbar", - "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufzeichnung läuft", + "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufzeichnung deaktiviert", + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufzeichnung aktiv", "DOWNLOAD_WITHOUT_ATTACHMENTS": "Herunterladen ohne Anhänge", "DOWNLOAD_WITH_ATTACHMENTS": "Herunterladen inkl. Anhänge", "LASTMESSAGE": "Letzte Nachricht", "VIDAOO": "Vidaoo", - "VIDAOOAPIKEY": "Vidaoo Api Key", + "VIDAOOAPIKEY": "Vidaoo API-Key", "VIDAOOESCALATION": "Videoanruf starten", "VIDAOOSESSION": "Videoanruf starten", "VIDEO": "Video", - "CLIENTEMAIL": "Kunden-E-Mail", - "DIALOGFLOWV2": "Dialogflow V2", - "EDIT_DIALOGFLOWV2": "Dialogflow V2 bearbeiten", + "CLIENTEMAIL": "Kunden E-Mail", + "DIALOGFLOWV2": "DialogFlow V2", + "EDIT_DIALOGFLOWV2": "DialogFlow V2 bearbeiten", "PRIVATEKEY": "Privater Schlüssel", "PROJECTID": "Projekt-ID", - "EMAIL_ACCOUNT": "Email-Konto", + "EMAIL_ACCOUNT": "E-Mail-Konto", "OPEN_NEW_INTERACTION": "Neue Interaktion öffnen", "SUBJECT": "Betreff", - "ADD_NOTE": "Notiz hinzufügen", - "CANNED_ANSWER_NOT_FOUND": "Keine Textvorlagen gefunden", - "NOTE": "Notiz", + "ADD_NOTE": "Anmerkung hinzufügen", + "CANNED_ANSWER_NOT_FOUND": "Keine vordefinierten Antworten gefunden", + "NOTE": "Anmerkung", "VIDAOOMETADATA": "Vidaoo-Metadaten", "VIDAOONOTE": "Vidaoo-Hinweis", "VIDAOOTOPIC": "Vidaoo-Thema", - "CHANNELID": "Kanal ID", + "CHANNELID": "Kanal-ID", "EDIT_TVOX": "TVox bearbeiten", - "MOTIONTITLE": "Bewegungstitel", - "MOTIONURL": "Bewegungs-URL", - "MOTIONURLONANSWER": "Bewegungs-URL bei Antwort", - "MOTIONURLONRING": "Bewegungs-URL auf Ring", + "MOTIONTITLE": "Titel", + "MOTIONURL": "URL", + "MOTIONURLONANSWER": "URL bei Antwort", + "MOTIONURLONRING": "URL bei Klingeln", "SERVICEID": "Service-ID", "SERVICENAME": "Dienstname", "TVOX": "TVox", diff --git a/public/app/main/apps/chat/i18n/is.json b/public/app/main/apps/chat/i18n/is.json index a8f7e5c..f89b020 100644 --- a/public/app/main/apps/chat/i18n/is.json +++ b/public/app/main/apps/chat/i18n/is.json @@ -1,491 +1,491 @@ { "CHAT": { - "EDIT_DIALOGFLOWV2": "Edit Dialogflow V2", + "EDIT_DIALOGFLOWV2": "Breyta Dialogflow V2", "DIALOGFLOWV2": "Dialogflow V2", - "PRIVATEKEY": "Private Key", - "CLIENTEMAIL": "Client Email", - "PROJECTID": "Project ID", - "VIDAOOESCALATION": "Start Video Call", + "PRIVATEKEY": "Einkalykill", + "CLIENTEMAIL": "Tölvupóstfang viðskiptavins", + "PROJECTID": "Auðkenni verkefnis - Project ID", + "VIDAOOESCALATION": "Byrja myndasímtal", "VIDAOOAPIKEY": "Vidaoo Api Key", - "VIDAOOSESSION": "Start Video Call", - "VIDAOOTOPIC": "Vidaoo Topic", - "VIDAOONOTE": "Vidaoo Note", + "VIDAOOSESSION": "Byrja myndasímtal", + "VIDAOOTOPIC": "Vidaoo efni", + "VIDAOONOTE": "Vidaoo athugasemd", "VIDAOOMETADATA": "Vidaoo Metadata", - "VIDEO": "Video", + "VIDEO": "Myndaband", "VIDAOO": "Vidaoo", - "EDIT_AMAZONLEX": "Edit Amazon Lex", + "EDIT_AMAZONLEX": "Breyta Amazon Lex", "AMAZONLEX": "Amazon Lex", - "ACCESSKEYID": "Access Key ID", - "SECRETACCESSKEY": "Secret Access Key", - "LEXREGION": "Region", + "ACCESSKEYID": "Auðkenni aðgangslykils", + "SECRETACCESSKEY": "Leynilegur aðgangslykill", + "LEXREGION": "Svæði", "BOTNAME": "Bot Name", - "LOGIN_TIME": "Login time", - "PAUSE_TIME": "Pause time", - "DOWNLOAD_INTERACTION": "Download", - "ENABLECUSTOMERCHECKMARKS": "Enable customer delivered/read notifications", - "TRANSFER": "Transfer", - "QUEUETRANSFER": "Queue Transfer", - "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", - "AGENTTRANSFER": "Agent Transfer", + "LOGIN_TIME": "Innskráningartími", + "PAUSE_TIME": "Tími hlés", + "DOWNLOAD_INTERACTION": "Hlaða niður", + "ENABLECUSTOMERCHECKMARKS": "Virkja afhentar/lesnar tilkynningar viðskiptamanna - Enable customer delivered/read notifications", + "TRANSFER": "Flutningur", + "QUEUETRANSFER": "Biðraðarflutningur - Queue Transfer", + "QUEUETRANSFERTIMEOUT": "Tímalokun biðraðarflutnings - Queue Transfer Timeout", + "AGENTTRANSFER": "Flutningur þjónustufulltrúa - Agent Transfer", "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", - "SYSTEMAVATAR": "System Avatar", - "SYSTEMALIAS": "System Alias", - "OPEN_NEW_INTERACTION": "Open new interaction", - "EMAIL_ACCOUNT": "Email account", - "SUBJECT": "Subject", - "WELCOMEMESSAGE": "Welcome Message", - "LANGUAGE": "Language", - "EDIT_DIALOGFLOW": "Edit Dialogflow", + "SYSTEMAVATAR": "Avatar kerfis", + "SYSTEMALIAS": "Dulnefni kerfis", + "OPEN_NEW_INTERACTION": "Opna ný samskipti - Open new interaction", + "EMAIL_ACCOUNT": "Tölvupóstreikningur", + "SUBJECT": "Viðfangsefni", + "WELCOMEMESSAGE": "Velkomin skilaboð", + "LANGUAGE": "Tungumál", + "EDIT_DIALOGFLOW": "Breyta Dialogflow", "DIALOGFLOW": "Dialogflow", - "BACKGROUNDCOLOR": "Background Color", - "MESSAGEFONTSIZE": "Message Font Size", - "ADD_NOTE": "Add note", - "NOTE": "Note", - "TAG": "Tag", - "EDIT_TAG": "Edit Tag", - "CUSTOMERALIAS": "Customer Alias", - "SNIPPETSWIPEOUT": "Snippet swipe out", - "CUSTOMERAVATAR": "Customer Avatar", - "SHOWCUSTOMERAVATAR": "Show customer avatar", - "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", - "DEFAULTTITLE": "Default Title", - "MESSAGESALIGNMENT": "Messages Alignment", - "ALTERNATE": "Alternate", - "CENTERED": "Centered", - "POSITION": "Position", - "VERTICALPOSITION": "Vertical position", - "ALIGNMENT": "Alignment", - "VERTICALALIGNMENT": "Vertical alignment", - "BOTTOM_RIGHT": "Bottom right", - "RIGHT": "Right", - "LEFT": "Left", - "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", - "AGENTIDENTIFIER": "Identifier", - "WEBSITEALIAS": "Website Alias", - "AGENTALIAS": "Agent Alias", - "AGENTFULLNAME": "Agent Fullname", - "INSERT_MESSAGE_HERE": "Insert your text message here", - "HIDEWHENOFFLINE": "Hide", - "NOTIFICATION": "Notification", - "NOTIFICATIONSOUND": "Sound", - "NOTIFICATIONSHAKE": "Shake", - "NOTIFICATIONTEMPLATE": "Template", - "SYSTEM": "System", - "EDIT_SYSTEM": "Edit System", - "COMMAND": "Command", - "TEXTCOLOR": "Text Color", - "TEXT_BUTTON_COLOR": "Text Button Color", - "FONTSIZE": "Font Size", - "WEBSCRIPT": "Web Script", - "CANNEDANSWERS": "Canned Answers", - "CHATCANNEDANSWERS": "Canned Answers", - "NO_CHATCANNEDANSWER_AVAILABLE": "No Canned Answers Available", - "NEW_CHATCANNEDANSWER": "New Canned Answer", - "ADD_CHATCANNEDANSWER": "Add Canned Answer", - "EDIT_CHATCANNEDANSWER": "Edit", - "DELETE_CHATCANNEDANSWER": "Delete", - "OFFLINEMESSAGESUBJECT": "Message subject", - "OFFLINEMESSAGEBODY": "Message body", - "FORMSUBMITSUCCESSMESSAGE": "Form submit success message", - "FORMSUBMITFAILUREMESSAGE": "Form submit failure message", - "PLACEHOLDERMESSAGE": "Message placeholder", - "NOTETITLE": "Note's title", - "CLOSINGQUESTION": "Closing question", - "TAGS": "Tags", - "SHOWAGENTAVATAR": "Show personal agent avatar", + "BACKGROUNDCOLOR": "Bakgrunnslitur", + "MESSAGEFONTSIZE": "Leturstærð skilaboða - Message Font Size", + "ADD_NOTE": "Bæta við minnispunkt", + "NOTE": "Athugasemd - Note", + "TAG": "Merki", + "EDIT_TAG": "Breyta um merki - Edit Tag", + "CUSTOMERALIAS": "Dulnefni viðskiptamanns", + "SNIPPETSWIPEOUT": "Stroka út brot", + "CUSTOMERAVATAR": "Avatar viðskiptamanns", + "SHOWCUSTOMERAVATAR": "Sýna Avatar viðskiptamanns - Show customer avatar", + "CANNED_ANSWER_NOT_FOUND": "Engin fyrirfram svör fundust - No Canned Answers were found", + "DEFAULTTITLE": "Sjálfgefinn tiltill - Default Title", + "MESSAGESALIGNMENT": "Staðsetning skilaboða - Messages Alignment", + "ALTERNATE": "Varamaður - Alternate", + "CENTERED": "Miðja - Centered", + "POSITION": "Staða", + "VERTICALPOSITION": "Lóðrétt staða", + "ALIGNMENT": "Röðun - Alignment", + "VERTICALALIGNMENT": "Lóðrétt röðun", + "BOTTOM_RIGHT": "Neðst til hægri", + "RIGHT": "Hægri", + "LEFT": "Vinstri", + "WAITFORTHEASSIGNEDAGENT": "Bíða eftir úthlutuðum þjónustufulltrúa", + "AGENTIDENTIFIER": "Auðkenni", + "WEBSITEALIAS": "Dulnefni vefsíðu", + "AGENTALIAS": "Dulnefni þjónustufulltrúa", + "AGENTFULLNAME": "Fullt nafn þjónustufulltrúa", + "INSERT_MESSAGE_HERE": "Settu inn textaskilaboðin þín hér - Insert your text message here", + "HIDEWHENOFFLINE": "Fela", + "NOTIFICATION": "Tilkynning", + "NOTIFICATIONSOUND": "Hljóð", + "NOTIFICATIONSHAKE": "Hrista", + "NOTIFICATIONTEMPLATE": "Sniðmát - Template", + "SYSTEM": "Kerfi", + "EDIT_SYSTEM": "Breyta um kerfi", + "COMMAND": "Skipun", + "TEXTCOLOR": "Textalitur", + "TEXT_BUTTON_COLOR": "Litur texta hnapps ", + "FONTSIZE": "Stærð leturs", + "WEBSCRIPT": "Vef handrit", + "CANNEDANSWERS": "Fyrirfram ákveðin svör við algengum spurningum - Canned Answers", + "CHATCANNEDANSWERS": "Fyrirfram ákveðin svör - canned answers", + "NO_CHATCANNEDANSWER_AVAILABLE": "Engin fyrirfram ákveðin svör í boði - No Canned Answers Available", + "NEW_CHATCANNEDANSWER": "Nýtt fyrirfram ákveðið svar - New Canned Answer", + "ADD_CHATCANNEDANSWER": "Bæta við fullnægjandi svari", + "EDIT_CHATCANNEDANSWER": "Breyta", + "DELETE_CHATCANNEDANSWER": "Eyða", + "OFFLINEMESSAGESUBJECT": "Efni skilaboða án nets", + "OFFLINEMESSAGEBODY": "Meginmál skilaboða ", + "FORMSUBMITSUCCESSMESSAGE": "Skilaboð um að eyðublað hafi ekki borist - Form submit success message", + "FORMSUBMITFAILUREMESSAGE": "Skilaboð um að eyðublað hafi ekki borist - Form submit failure message", + "PLACEHOLDERMESSAGE": "Frátakari skilaboða", + "NOTETITLE": "Titill athugasemda - Note's title", + "CLOSINGQUESTION": "Loka spurning", + "TAGS": "Merki", + "SHOWAGENTAVATAR": "Sýna persónulegan Avatar þjónustufulltrúa - Show personal agent avatar", "AGENTAVATAR": "Agent Avatar", - "SPYINTERACTION": "Spy", - "NO_AGENT_ONLINE": "No Agent Online", - "GOTOREALTIME_CHATQUEUE": "Go To Realtime Chat Queue", - "PARTIALPAUSE": "Partial Pause", - "BUSY": "Busy", - "TIMER": "Timer", - "IDLE": "Idle", - "CAPACITY": "Capacity", - "AGENTSADD_QUEUE": "Add Agent to Chat Queue", - "QUEUES": "Queues", - "LOGGED_IN": "Logged in", - "PAUSED": "Paused", - "READY": "Ready", - "WAITING": "Waiting", - "WRITING": "Writing", - "CHAT": "Chat", - "MAIL": "Email", + "SPYINTERACTION": "Njósna", + "NO_AGENT_ONLINE": "Enginn þjónustufulltrúi er tengdur - No Agent Online", + "GOTOREALTIME_CHATQUEUE": "Fara í spjallröð í rauntíma - Go To Realtime Chat Queue", + "PARTIALPAUSE": "Hlé að hluta", + "BUSY": "Upptekinn", + "TIMER": "Tímamælir", + "IDLE": "Aðgerðalaus - Idle", + "CAPACITY": "Afkastageta - Capacity", + "AGENTSADD_QUEUE": "Bæta þjónustufulltrúa við spjallröð", + "QUEUES": "Raðir", + "LOGGED_IN": "Innskráður", + "PAUSED": "Bið", + "READY": "Tilbúinn", + "WAITING": "Bið", + "WRITING": "Skrifa", + "CHAT": "Spjall", + "MAIL": "Tölvupóstfang - Email", "SMS": "SMS", - "OPENCHANNEL": "Openchannel", + "OPENCHANNEL": "Opna rás - Openchannel", "FAX": "Fax", - "PAUSE": "Pause", - "REALTIME": "Realtime", - "AGENTS": "Agents", - "FULLNAME": "Full Name", - "INTERNAL": "Internal", - "PHONE_STATE": "Phone State", - "PHONE_STATUS": "Phone Status", - "LOGOUT": "Logout", - "UNPAUSE": "End Pause", - "AGENTADD_QUEUE": "Add Agent to Chat Queue", - "TEXT": "Text", - "TIMES": "Number of times per interaction", - "EDIT_AUTOREPLY": "Edit Auto Reply", - "AUTOREPLY": "Auto Reply", - "NEW_CHATDISPOSITION": "New Chat Disposition", - "ENABLECUSTOMERATTACHMENT": "Enable Customer Attachments", - "ENABLESENDBUTTON": "Enable Send Button", - "OFFLINE_CHAT_BUTTON": "'Offline Chat' Button", - "OFFLINESTATUS": "Offline Status", - "NAME": "Name", - "CHATQUEUES": "Chat Queues", - "SEARCH_FOR_ANYONE": "Search", - "STRATEGY": "Strategy", - "AGENT_TIMEOUT": "Agent Timeout", - "DESCRIPTION": "Description", - "KEY": "Key", - "ALIAS": "Alias", - "VARIABLE": "Variable", - "INTERVAL": "Interval", - "EDIT_CLOSE": "Edit Close", - "TIMEZONE": "Timezone", - "MESSAGE": "Message", - "ADVANCED": "Advanced", - "FORWARDTRANSCRIPT": "Forward Transcript", - "FORWARDTRANSCRIPTMESSAGE": "Forward Transcript Message", - "SKIPMESSAGEBUTTON": "Skip Message Button", - "EDIT_MESSAGE": "Edit Message", + "PAUSE": "Hlé", + "REALTIME": "Rauntími", + "AGENTS": "Þjónustufulltrúar", + "FULLNAME": "Fullt nafn", + "INTERNAL": "Innanhús - Internal", + "PHONE_STATE": "Staða síma", + "PHONE_STATUS": "Staða síma", + "LOGOUT": "Skrá út - Logout", + "UNPAUSE": "Enda hlé", + "AGENTADD_QUEUE": "Bæta þjónustufulltrúa við spjallröð", + "TEXT": "Texti", + "TIMES": "Fjöldi skipta á milli samskipta - Number of times per interaction", + "EDIT_AUTOREPLY": "Breyta Auto Reply", + "AUTOREPLY": "Sjálvirkt svar", + "NEW_CHATDISPOSITION": "Nýtt spjall fyrirkomulag - New Chat Disposition", + "ENABLECUSTOMERATTACHMENT": "Virkja viðhengi viðskiptamanna - Enable Customer Attachments", + "ENABLESENDBUTTON": "Virkja senda hnappann - Enable Send Button", + "OFFLINE_CHAT_BUTTON": "'Utan nets spjall' hnappur - 'Offline Chat' Button", + "OFFLINESTATUS": "Utan nets staða - Offline Status", + "NAME": "Nafn", + "CHATQUEUES": "Spjallraðir - Chat Queues", + "SEARCH_FOR_ANYONE": "Leita", + "STRATEGY": "Stefna", + "AGENT_TIMEOUT": "Tímamörk þjónustufulltrúa", + "DESCRIPTION": "Lýsing", + "KEY": "Lykill - Key", + "ALIAS": "Dulnefni - Alias", + "VARIABLE": "Breyta", + "INTERVAL": "Innanhús - Interval", + "EDIT_CLOSE": "Breyta loka - Edit close", + "TIMEZONE": "Tímabelti", + "MESSAGE": "Skilaboð", + "ADVANCED": "Vanur", + "FORWARDTRANSCRIPT": "Áframsenda afrit - Forward Transcript", + "FORWARDTRANSCRIPTMESSAGE": "Áframsenda skilaboð afrits - Forward Transcript Message", + "SKIPMESSAGEBUTTON": "Sleppa skilaboða hnappanum", + "EDIT_MESSAGE": "Breyta skilaboðum", "CONDITION_AGREEMENT": "Condition Agreement", - "NONE": "None", - "PRIORITY": "Priority", - "ONLINESTATUS": "Online Status", - "UNMANAGEDSTATUS": "Unmanaged Status", - "AUTOCLOSE": "Enable Autoclose", - "ENABLEUNMANAGEDNOTE": "Enable Unmanaged Message", - "UNMANAGEDMESSAGE": "Message", - "SKIPUNMANAGED": "Skip Message", - "SENDUNMANAGED": "Send Message", - "WEBSITESCRIPT": "Website Script", - "DELETE_OFFLINEMESSAGE": "Delete", - "OFFLINEMESSAGES": "Offline Messages", - "FORWARD_OFFLINE": "Forward Offline", - "SHOW_OFFLINEMESSAGE": "Show", - "FORWARD_OFFLINE_ADDRESS": "Forward Offline Address", - "CLOSINGFORM": "Closing Form", - "ENABLERATING": "Enable Rating", - "ENABLECUSTOMERWRITING": "Allow customer writing before agent accepting", - "ENABLEFEEDBACK": "Enable Feedback", - "FEEDBACKTITLE": "Feedback Title", - "RATINGTYPE": "Rating Type", - "CLOSINGMESSAGE": "Closing Message", - "CLOSINGMESSAGEBUTTON": "Closing Message Button", - "RATINGSTARSNUMBER": "Rating Stars Number", - "EDIT_GOTOIF": "Edit GotoIf", - "CONDITION": "Condition", - "TRUEPRIORITY": "True Priority", - "FALSEPRIORITY": "False Priority", - "VALUE": "Value", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled", - "SERVICEID": "Service ID", - "CHANNELID": "Channel ID", - "EDIT_TVOX": "Edit TVox", - "SERVICENAME": "Service name", + "NONE": "Ekkert - None", + "PRIORITY": "Forgangur", + "ONLINESTATUS": "Nettengdur staða", + "UNMANAGEDSTATUS": "Óviðráðanleg staða", + "AUTOCLOSE": "Virkja sjálfvirka lokun - Enable Autoclose", + "ENABLEUNMANAGEDNOTE": "Virkja óstýrð skilaboð - Enable Unmanaged Message", + "UNMANAGEDMESSAGE": "Skilaboð", + "SKIPUNMANAGED": "Sleppa skilaboðum", + "SENDUNMANAGED": "Senda skilaboð", + "WEBSITESCRIPT": "Handrit vefsíðu", + "DELETE_OFFLINEMESSAGE": "Eyða", + "OFFLINEMESSAGES": "Skilaboð utan nets ", + "FORWARD_OFFLINE": "Áframsenda utan nets - Forward Offline", + "SHOW_OFFLINEMESSAGE": "Sýna", + "FORWARD_OFFLINE_ADDRESS": "Áframsenda aðsetur utan nets - Forward Offline Address", + "CLOSINGFORM": "Eyðublað fyrir lokun - Closing Form", + "ENABLERATING": "Virkja einkunnargjöf - Enable Rating", + "ENABLECUSTOMERWRITING": "Leyfa skrif viðskiptamanna áður en þjónustufulltrúi samþykkir - Allow customer writing before agent accepting", + "ENABLEFEEDBACK": "Virkja svörun - Enable Feedback", + "FEEDBACKTITLE": "Fyrirsögn endurgjafar - Feedback Title", + "RATINGTYPE": "Tegund einkunna", + "CLOSINGMESSAGE": "Skilaboð fyrir lokun - Closing Message", + "CLOSINGMESSAGEBUTTON": "Hnappurinn Loka skilaboðum - Closing Message Button", + "RATINGSTARSNUMBER": "Fjöldi stjarna í einkunn", + "EDIT_GOTOIF": "Breyta GotoIf", + "CONDITION": "Skilyrði", + "TRUEPRIORITY": "Réttur forgangur", + "FALSEPRIORITY": "Röng forgangsröðun - False Priority", + "VALUE": "Virði", + "MANDATORYDISPOSITION": "Skylduráðstöfun - Mandatory disposition", + "MANDATORYDISPOSITIONPAUSEID": " Hlé á notkun ef skylduráðstöfun er virk - Pause to use if mandatory disposition is enabled", + "SERVICEID": "Þjónustukenni - Service ID", + "CHANNELID": "Auðkenni rásar", + "EDIT_TVOX": "Breyta TVox", + "SERVICENAME": "Nafn þjónustu", "TVOX": "TVox", "TVOXURL": "TVox IP URL", - "TVOXIP": "TVox IP Address", - "TVOXUSERNAME": "TVox Username", - "TVOXPASSWD": "TVox Password", + "TVOXIP": "TVox IP aðsetur", + "TVOXUSERNAME": "TVox notendanafn", + "TVOXPASSWD": "TVox lykilorð", "TVOXLOGINURL": "TVox Login REST Url", "TVOXSESSIONURL": "TVox Session REST Url", - "MOTIONURLONRING": "Motion URL On Ring", - "MOTIONURLONANSWER": "Motion URL On Answer", - "MOTIONTITLE": "Motion Title", - "MOTIONURL": "Motion URL", + "MOTIONURLONRING": "URL hreyfimynda fyrir Hringja - Motion URL On Ring", + "MOTIONURLONANSWER": "URL hreyfimynda fyrir Svar - Motion URL On Answer", + "MOTIONTITLE": "Titill hreyfimynda - Motion Title", + "MOTIONURL": "URL hreyfimynda - Motion URL", "ERRORS": { - "PROJECTID_REQUIRED": "Mandatory Field", - "CLIENTEMAIL_REQUIRED": "Mandatory Field", - "PRIVATEKEY_REQUIRED": "Mandatory Field", - "VIDAOOAPIKEY_REQUIRED": "Mandatory Field", - "VIDAOOTOPIC_REQUIRED": "Mandatory Field", - "BOTNAME_REQUIRED": "Mandatory Field", - "SECRETACCESSKEY_REQUIRED": "Mandatory Field", - "ACCESSKEYID_REQUIRED": "Mandatory Field", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "CUSTOMERALIAS_REQUIRED": "Mandatory Field", - "AGENTALIAS_REQUIRED": "Mandatory Field", - "SYSTEMALIAS_REQUIRED": "Mandatory Field", - "MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MESSAGEFONTSIZE_REQUIRED": "Mandatory Field", - "TAG_REQUIRED": "Mandatory Field", - "VERTICALPOSITION_REQUIRED": "Mandatory Field", - "VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "NAME_MUST_VALID_PATTERN": "Wrong format", - "COMMAND_REQUIRED": "Mandatory Field", - "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "FONTSIZE_REQUIRED": "Mandatory Field", - "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "VALUE_REQUIRED": "Mandatory Field", - "CUSTOMERALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "SYSTEMALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "OFFLINEMESSAGESUBJECT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "OFFLINEMESSAGEBODY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "PLACEHOLDERMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "NOTETITLE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "FORMSUBMITFAILUREMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "CLOSINGQUESTION_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "HEADER_OFFLINE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "OFFLINE_CHAT_BUTTON_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "TEXT_REQUIRED": "Mandatory Field", - "SENDUNMANAGED_REQUIRED": "Mandatory Field", - "SENDUNMANAGED_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "SKIPUNMANAGED_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "UNMANAGEDMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "WEBSITEALIAS_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "AGENT_REQUIRED": "Mandatory Field", - "QUEUE_REQUIRED": "Mandatory Field", - "CONDITION_REQUIRED": "Mandatory Field", - "PRIORITY_REQUIRED": "Mandatory Field", - "TRUEPRIORITY_REQUIRED": "Mandatory Field", - "FALSEPRIORITY_REQUIRED": "Mandatory Field", - "NAME_REQUIRED": "Mandatory Field", - "LIST_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", - "MOTIONADDRESS_REQUIRED": "Mandatory Field", - "DISPOSITION_REQUIRED": "Mandatory Field", - "MOTIONADDRESS_MUST_VALID_URL": "Wrong format", - "EMAIL_MUST_BE_VALID": "Wrong format", - "ADDRESS_REQUIRED": "Mandatory Field", - "ADDRESS_MUST_VALID_URL": "Wrong format", - "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "Mandatory Field", - "ACCEPTURL_MUST_VALID_URL": "Wrong format", - "TIMEOUT_REQUIRED": "Mandatory Field", - "REJECTURL_MUST_VALID_URL": "Wrong format", - "CLOSEURL_MUST_VALID_URL": "Wrong format", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", - "POLLING_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": " The value must be greater than or equal to", - "WAITINGMESSAGE_REQUIRED": "Mandatory Field", - "WAITINGTITLE_REQUIRED": "Mandatory Field", - "KEY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "KEY_REQUIRED": "Mandatory Field", - "WAITINGMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "WAITINGTITLE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field", - "EMAIL_ACCOUNT_REQUIRED": "Mandatory field" + "PROJECTID_REQUIRED": "Áskilinn reitur - Mandatory Field", + "CLIENTEMAIL_REQUIRED": "Áskilinn reitur - Mandatory Field", + "PRIVATEKEY_REQUIRED": "Áskilinn reitur - Mandatory Field", + "VIDAOOAPIKEY_REQUIRED": "Áskilinn reitur - Mandatory Field", + "VIDAOOTOPIC_REQUIRED": "Áskilinn reitur - Mandatory Field", + "BOTNAME_REQUIRED": "Áskilinn reitur - Mandatory Field", + "SECRETACCESSKEY_REQUIRED": "Áskilinn reitur - Mandatory Field", + "ACCESSKEYID_REQUIRED": "Áskilinn reitur - Mandatory Field", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Gildið verður að vera minna en eða jafnt og ", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gildið verður að vera stærra en eða jafnt og ", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Áskilinn reitur - Mandatory Field", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Gildið verður að vera minna en eða jafnt og ", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gildið verður að vera stærra en eða jafnt og ", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Áskilinn reitur - Mandatory Field", + "CUSTOMERALIAS_REQUIRED": "Áskilinn reitur - Mandatory Field", + "AGENTALIAS_REQUIRED": "Áskilinn reitur - Mandatory Field", + "SYSTEMALIAS_REQUIRED": "Áskilinn reitur - Mandatory Field", + "MESSAGEFONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Gildið verður að vera minna en eða jafnt og ", + "MESSAGEFONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gildið verður að vera stærra en eða jafnt og ", + "MESSAGEFONTSIZE_REQUIRED": "Áskilinn reitur - Mandatory Field", + "TAG_REQUIRED": "Áskilinn reitur - Mandatory Field", + "VERTICALPOSITION_REQUIRED": "Áskilinn reitur - Mandatory Field", + "VERTICALPOSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gildið verður að vera stærra en eða jafnt og ", + "VERTICALPOSITION_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Gildið verður að vera minna en eða jafnt og", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Gildið verður að vera minna en eða jafnt og", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gildið verður að vera stærra en eða jafnt og ", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Áskilinn reitur - Mandatory Field", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Gildið verður að vera minna en eða jafnt og ", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Gildið verður að vera minna en eða jafnt og", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gildið verður að vera stærra en eða jafnt og ", + "NAME_MUST_VALID_PATTERN": "Rangt snið - Wrong format", + "COMMAND_REQUIRED": "Áskilinn reitur - Mandatory Field", + "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gildið verður að vera stærra en eða jafnt og ", + "FONTSIZE_REQUIRED": "Áskilinn reitur - Mandatory Field", + "TEXT_MAX_LENGTH": "Gildið verður að hafa hámarkslengd sem er jöfn og {{Hámark}} ", + "VALUE_REQUIRED": "Áskilinn reitur - Mandatory Field", + "CUSTOMERALIAS_MAX_LENGTH": "Gildið verður að hafa hámarkslengd sem er jöfn og {{Hámark}} - The value must have a maximum length equal to {{max}}", + "SYSTEMALIAS_MAX_LENGTH": "Gildið verður að hafa hámarkslengd sem er jöfn og {{Hámark}}", + "OFFLINEMESSAGESUBJECT_MAX_LENGTH": "Gildið verður að hafa hámarkslengd sem er jöfn og {{Hámark}}", + "OFFLINEMESSAGEBODY_MAX_LENGTH": "Gildið verður að hafa hámarkslengd sem er jöfn og {{Hámark}} ", + "PLACEHOLDERMESSAGE_MAX_LENGTH": "Gildið verður að hafa hámarkslengd sem er jöfn og {{Hámark}} ", + "NOTETITLE_MAX_LENGTH": "Gildið verður að hafa hámarkslengd sem er jöfn og {{Hámark}} - The value must have a maximum length equal to {{max}}", + "FORMSUBMITSUCCESSMESSAGE_MAX_LENGTH": "Gildið verður að hafa hámarkslengd sem er jöfn og {{Hámark}}", + "FORMSUBMITFAILUREMESSAGE_MAX_LENGTH": "Gildið verður að hafa hámarkslengd sem er jöfn og {{Hámark}} ", + "CLOSINGQUESTION_MAX_LENGTH": "Gildið verður að hafa hámarkslengd sem er jöfn og {{Hámark}} - The value must have a maximum length equal to {{max}}", + "HEADER_OFFLINE_MAX_LENGTH": "Gildið verður að hafa hámarkslengd sem er jöfn og {{Hámark}} ", + "OFFLINE_CHAT_BUTTON_MAX_LENGTH": "Gildið verður að hafa hámarkslengd sem er jöfn og {{Hámark}}", + "TEXT_REQUIRED": "Áskilinn reitur - Mandatory Field", + "SENDUNMANAGED_REQUIRED": "Áskilinn reitur - Mandatory Field", + "SENDUNMANAGED_MAX_LENGTH": "Gildið verður að hafa hámarkslengd sem er jöfn og {{Hámark}} ", + "SKIPUNMANAGED_MAX_LENGTH": "Gildið verður að vera stærra en eða jafnt og -", + "UNMANAGEDMESSAGE_MAX_LENGTH": "Gildið verður að hafa hámarkslengd sem er jöfn og {{Hámark}}", + "WEBSITEALIAS_MAX_LENGTH": "Gildið verður að hafa hámarkslengd sem er jöfn og {{Hámark}}", + "AGENT_REQUIRED": "Áskilinn reitur - Mandatory Field", + "QUEUE_REQUIRED": "Áskilinn reitur - Mandatory Field", + "CONDITION_REQUIRED": "Áskilinn reitur - Mandatory Field", + "PRIORITY_REQUIRED": "Áskilinn reitur - Mandatory Field", + "TRUEPRIORITY_REQUIRED": "Áskilinn reitur - Mandatory Field", + "FALSEPRIORITY_REQUIRED": "Áskilinn reitur - Mandatory Field", + "NAME_REQUIRED": "Áskilinn reitur - Mandatory Field", + "LIST_REQUIRED": "Áskilinn reitur - Mandatory Field", + "AGENT_TIMEOUT_REQUIRED": "Áskilinn reitur - Mandatory Field", + "MOTIONADDRESS_REQUIRED": "Áskilinn reitur - Mandatory Field", + "DISPOSITION_REQUIRED": "Áskilinn reitur - Mandatory Field", + "MOTIONADDRESS_MUST_VALID_URL": "Rangt snið - Wrong format", + "EMAIL_MUST_BE_VALID": "Rangt snið - Wrong format", + "ADDRESS_REQUIRED": "Áskilinn reitur - Mandatory Field", + "ADDRESS_MUST_VALID_URL": "Rangt snið - Wrong format", + "ENQUIRY_FORWARDING_ADDRESS_REQUIRED": "Áskilinn reitur - Mandatory Field", + "ACCEPTURL_MUST_VALID_URL": "Rangt snið - Wrong format", + "TIMEOUT_REQUIRED": "Áskilinn reitur - Mandatory Field", + "REJECTURL_MUST_VALID_URL": "Rangt snið", + "CLOSEURL_MUST_VALID_URL": "Rangt snið - Wrong format", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gildið verður að vera stærra en eða jafnt og ", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gildið verður að vera stærra en eða jafnt og", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gildið verður að vera stærra en eða jafnt og ", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gildið verður að vera stærra en eða jafnt og ", + "POLLING_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gildið verður að vera stærra en eða jafnt og", + "WAITINGMESSAGE_REQUIRED": "Áskilinn reitur - Mandatory Field", + "WAITINGTITLE_REQUIRED": "Áskilinn reitur - Mandatory Field", + "KEY_MAX_LENGTH": "Gildið verður að hafa hámarkslengd sem er jöfn og {{Hámark}}", + "KEY_REQUIRED": "Áskilinn reitur - Mandatory Field", + "WAITINGMESSAGE_MAX_LENGTH": "Gildið verður að hafa hámarkslengd sem er jöfn og {{Hámark}} ", + "WAITINGTITLE_MAX_LENGTH": "Gildið verður að hafa hámarkslengd sem er jöfn og {{Hámark}}", + "RATINGSTARSNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Gildið verður að vera minna en eða jafnt og", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Áskilinn reitur - Mandatory field", + "EMAIL_ACCOUNT_REQUIRED": "Áskilinn reitur - Mandatory field" }, - "CM_FIELD": "Contact Manager Field", - "CHATPROACTIVEACTIONS": "Proactive Actions", - "NEW_CHATPROACTIVEACTION": "New Proactive Action", - "EDIT_CHATPROACTIVEACTION": "Edit Proactive Action", + "CM_FIELD": "Reitur fyrir tengilið - Contact Manager field", + "CHATPROACTIVEACTIONS": "Fyrirbyggjandi aðgerðir - Proactive Actions", + "NEW_CHATPROACTIVEACTION": "Ný fyrirbyggjandi aðgerð - New Proactive Action", + "EDIT_CHATPROACTIVEACTION": "Breyta fyrirbyggjandi aðferð - Edit proactive action ", "DELETE_CHATPROACTIVEACTION": "Delete Proactive Action", - "ADD_CHATPROACTIVEACTION": "Add Proactive Action", - "NO_CHATPROACTIVEACTION_AVAILABLE": "No Proactive Actions Available", - "NO_OFFLINEMESSAGE_AVAILABLE": "No Offline Messages Available", + "ADD_CHATPROACTIVEACTION": "Bæta við markvissa aðgerð", + "NO_CHATPROACTIVEACTION_AVAILABLE": "Engar fyrirbyggjandi aðgerðir í boði - No Proactive Actions Available", + "NO_OFFLINEMESSAGE_AVAILABLE": "Engin skilaboð utan nets í boði - No Offline Messages Available", "MOUSEOVER": "Mouse Over", - "TIMEOUT": "Timeout", - "TYPE": "Type", - "SELECTOR": "Selector", - "AGENT": "Agent", + "TIMEOUT": "Tíminn runninn út", + "TYPE": "Gerð", + "SELECTOR": "Veljari", + "AGENT": "Þjónustufulltrúi", "GOTO": "Goto", "GOTOIF": "GotoIf", "NOOP": "Noop", - "QUEUE": "Queue", + "QUEUE": "Röð", "BUILDER": "Builder", - "PREVIEW": "Preview", - "EDIT_AGENT": "Edit Agent", - "EDIT_QUEUE": "Edit Queue", - "EDIT_GOTO": "Edit Goto", - "EDIT_GOTOIf": "Edit GotoIf", - "EDIT_NOOP": "Edit Noop", - "ADD_CHATQUEUE": "Add Chat Queue", - "EDIT_CHATQUEUE": "Edit Chat Queue", - "DELETE_CHATQUEUE": "Delete Chat Queue", - "SETTINGS": "Settings", - "SAVE": "Save", - "SCRIPT": "Script", - "TOKEN": "Token", - "CREATED_AT": "Created At", - "CHATWEBSITES": "Chat Websites", - "MOTIONADDRESS": "Website Domain", - "MOTIONPROXY": "Proxy Or Motion Domain", - "ADD_CHATWEBSITE": "Add Chat Website", - "EDIT_CHATWEBSITE": "Edit Chat Website", - "DELETE_CHATWEBSITE": "Delete Chat Website", - "LIST": "List", - "SNIPPET": "Snippet", - "FORMS": "Forms", - "UP": "Up", - "DOWN": "Down", - "COLLAPSE": "Collapse", - "PROACTIVEACTIONS": "Proactive Actions", - "DISPOSITIONS": "Dispositions", + "PREVIEW": "Birta", + "EDIT_AGENT": "Breyta þjónustufulltrúa - Edit Agent", + "EDIT_QUEUE": "Breyta um röð", + "EDIT_GOTO": "Breyta Goto", + "EDIT_GOTOIf": "Breyta GotoIf", + "EDIT_NOOP": "Breyta Noop", + "ADD_CHATQUEUE": "Bæta við spjallröð", + "EDIT_CHATQUEUE": "Breyta spjallröð - Edit Chat Queue", + "DELETE_CHATQUEUE": "Eyða spjallröð - Delete Chat Queue", + "SETTINGS": "Stillingar", + "SAVE": "Vista", + "SCRIPT": "Handrit", + "TOKEN": "Tákn", + "CREATED_AT": "Stofnað kl.", + "CHATWEBSITES": "Spjall vefsíður - Chat Websites", + "MOTIONADDRESS": "Vefsvæðislén - Website Domain", + "MOTIONPROXY": "Staðgengils- eða hreyfilén - Proxy Or Motion Domain", + "ADD_CHATWEBSITE": "Bæta við spjallvef", + "EDIT_CHATWEBSITE": "Breyta Spjallvef - Edit Chat Website", + "DELETE_CHATWEBSITE": "Eyða Spjallvef - Delete Chat Website", + "LIST": "Listi", + "SNIPPET": "Brot", + "FORMS": "Eyðublöð ", + "UP": "Upp", + "DOWN": "Niður", + "COLLAPSE": "Hrun - Collapse", + "PROACTIVEACTIONS": "Fyrirbyggjandi aðgerðir ", + "DISPOSITIONS": "Fyrirkomulag", "WEBHOOKS": "WebHooks", - "ACTIONS": "Actions", - "FIDELITY": "Fidelity", - "APPEARANCE": "Appearance", - "MAINCOLOR": "Main Color", - "FOCUSCOLOR": "Focus Color", - "BUTTONCOLOR": "Button Color", - "HEADERSHAPE": "Header Shape", - "ANIMATION": "Animation", - "DEFAULT": "Default", - "WHITELABEL": "White Label", - "LOGO": "Logo", - "DOWNLOADTRANSCRIPT": "Download Transcript", - "ENQUIRY_ENABLE": "Enquiry Enable", - "ENQUIRY_FORWARDING": "Enquiry Forwarding", - "ENQUIRY_FORWARDING_ADDRESS": "Enquiry Forwarding Address", - "LABELS": "Labels", - "HEADER_ONLINE": "Online Header", - "ONLINE_MESSAGE": "Online Message", - "NAME_TITLE": "Name Input Label", - "USERNAME_PLACEHOLDER": "Username Input Placeholder", - "EMAIL_TITLE": "Email Input Label", - "EMAIL_PLACEHOLDER": "Email Input Placeholder", - "START_CHAT_BUTTON": "'Start Chat' Button", - "AGENTS_BUSY": "Busy Agents Message", - "HEADER_OFFLINE": "Offline Header", - "OFFLINE_MESSAGE": "Offline Message", - "MESSAGE_TITLE": "Message Label", - "ENQUIRY_MESSAGE_PLACEHOLDER": "Enquiry Message Input Placeholder", - "ENQUIRY_BUTTON": "Enquiry Button Text", - "RATING_MESSAGE": "Rating Message", - "RATING_SEND": "Rating Send Button Text", - "RATING_SKIP": "Rating Skip Button Text", - "ONLINE": "Online", - "OFFLINE": "Offline", - "PROACTIVE": "Proactive", - "ACCEPT": "Accept", - "ACCEPTMETHOD": "Accept Method", - "ACCEPTURL": "Accept URL", - "REJECT": "Reject", - "REJECTMETHOD": "Reject Method", - "REJECTURL": "Reject URL", - "CLOSE": "Close", - "CLOSEMETHOD": "Close Method", - "CLOSEURL": "Close URL", + "ACTIONS": "Aðgerðir", + "FIDELITY": "Trúnaður - Fidelity", + "APPEARANCE": "Ásýnd - Appearance", + "MAINCOLOR": "Aðallitur - Main Color", + "FOCUSCOLOR": "Litur fókuss- Focus Color", + "BUTTONCOLOR": "Hnappa litur", + "HEADERSHAPE": "Lögun á haus - Header Shape", + "ANIMATION": "Hreyfimynd - Animation", + "DEFAULT": "Sjálfgefið - Default", + "WHITELABEL": "Hvítt merki", + "LOGO": "Merki - Logo", + "DOWNLOADTRANSCRIPT": "Hlaða niður handriti- Download Transcript", + "ENQUIRY_ENABLE": "Fyrirspurn virk - Enquiry Enable", + "ENQUIRY_FORWARDING": "Áframsending fyrirspurnar - Enquiry Forwarding", + "ENQUIRY_FORWARDING_ADDRESS": "Tölvupóstfang áframsendingu fyrirspurnar - Enquiry Forwarding Address", + "LABELS": "Merki - Labels", + "HEADER_ONLINE": "Haus þegar nettenging er (e.online) - Online Header", + "ONLINE_MESSAGE": "Skilaboð á netinu - Online Message", + "NAME_TITLE": "Nafn merkimiða - Name Input Label", + "USERNAME_PLACEHOLDER": "Notendanafn frátakara - Username Input Placeholder", + "EMAIL_TITLE": "Merkimiði tölvupóstfang - Email Input Label", + "EMAIL_PLACEHOLDER": "Frátakari tölvupósts - Email Input Placeholder", + "START_CHAT_BUTTON": "'Byrja spjall' Hnappur", + "AGENTS_BUSY": "Skilaboð upptekinna þjónustufulltrúa - Busy Agents Message", + "HEADER_OFFLINE": "Haus utan nettenginu (e.offline) - Offline Header", + "OFFLINE_MESSAGE": "Fara í utan nets skilaboð - Offline Message", + "MESSAGE_TITLE": "Merki skilaboða - Message Label", + "ENQUIRY_MESSAGE_PLACEHOLDER": "Frátakari fyrirspurnar skilaboða - Enquiry Message Input Placeholder", + "ENQUIRY_BUTTON": "Texti fyrirspurnar hnapps - Enquiry Button Text", + "RATING_MESSAGE": "Skilaboð einkunnar", + "RATING_SEND": "Texti einkunnasendingarhnapps - Rating Send Button Text", + "RATING_SKIP": "Texti sleppa einkunn hnappa - Rating Skip Button Text", + "ONLINE": "Nettengdur", + "OFFLINE": "Ótengdur", + "PROACTIVE": "Fyrirbyggjandi", + "ACCEPT": "Samþykkja", + "ACCEPTMETHOD": "Samþykkja aðferð", + "ACCEPTURL": "Samþykkja URL", + "REJECT": "Hafna", + "REJECTMETHOD": "Hafna aðferð", + "REJECTURL": "Hafna URL", + "CLOSE": "Loka", + "CLOSEMETHOD": "Loka aðferð", + "CLOSEURL": "Loka URL", "EMBEDDING": "Embedding", - "GENERAL": "General", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "BACK": "Back", + "GENERAL": "Almennt - General", + "SELECTED": "Valinn", + "SELECT_ALL": "Velja alla", + "SELECT_NONE": "Ekki velja neinn", + "BACK": "Til baka", "HELP": { - "VERTICALPOSITION": "Represents the distance in percentage from top", - "AGENTIDENTIFIER": "Represents the agent identifier within the chat session in the snippet", - "HIDEWHENOFFLINE": "Hides snippet when offline", - "KEY": "Website short name (5 char) shown on the Agent Tab", - "TOKEN": "Automatically generated token used in the Script", - "INTEVAL": "To be selected from the list of the available intervals", - "TIMEZONE": "Select one from the list (default=local timezone)", - "ENABLERATING": "Enable it if you want the web visitor can rate the interaction at the end", - "ENABLEFEEDBACK": "Enable it if you want the web visitor can send a feedback (up to 150 char) at the end", - "FORWARDTRANSCRIPT": "Enable it if you want the web visitor is asked to receive a chat transcript via email", - "AUTOCLOSE": "Enable it if you want chat sessions to be closed as Unmanaged if no agent is available. Learn more about it at: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet", - "ENABLEUNMANAGEDNOTE": "Enable it if you want the visitor is shown a message when all the agents are busy and the chat gets unmanaged", - "WEBSITEALIAS": "A prefix used to compose the agent name (prefix+Agent Id) shown to the web visitor during the chat session", - "ENABLECUSTOMERWRITING": " Enable it if you want the chat starts without waiting for an available agent (pay attention: if you enable it, your chats will never get unmanaged). Learn more at: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet", - "MAPKEY": "The following Motion Contact Manager field:", - "FROMKEY": "Will be mapped in your Motion Chat Snippet as:", - "COPYSCRIPTTOCLIPBOARD": "Copy and paste the script text into your website", - "FORWARD_OFFLINE": "You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", - "MOTIONADDRESS": "The field must have the following format: ://[:]. Example: https://X.Y.Z.W", - "MOTIONPROXY": "The field must have the following format: ://[:]. Example: https://X.Y.Z.W", - "NAME": "Only numbers, letters and specific characters (._) are supported", - "LIST": "Contact Manager list used to associate Contacts", - "INTERVAL": "Select one from the list", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled", - "WELCOMEMESSAGE": "Leave empty if you don't want to send any welcome message" + "VERTICALPOSITION": "Táknar fjarlægðina í prósentum frá toppi - Represents the distance in percentage from top", + "AGENTIDENTIFIER": "Birta auðkenni þjónustufulltrúa á meðan spjallinu stendur - Represents the agent identifier within the chat session in the snippet", + "HIDEWHENOFFLINE": "Felur brot þegar hann er utan nets - Hides snippet when offline", + "KEY": "Stuttheiti vefseturs (5 stafir) sem sýnt er á þjónustuflipanum- Website short name (5 char) shown on the Agent Tab", + "TOKEN": "Tákn sem er myndað sjálfkrafa í forskriftinni - Automatically generated token used in the Script", + "INTEVAL": "Veljið úr listanum yfir tiltæk tímabil - To be selected from the list of the available intervals", + "TIMEZONE": "Veldu einn af listanum (default=local timezone) - Select one from the list (default=local timezone)", + "ENABLERATING": "Virkja ef þú vilt að vefgestir geta gefið samskiptunum einkunn í lokin - Enable it if you want the web visitor can rate the interaction at the end", + "ENABLEFEEDBACK": "Virkja ef þú vilt að vefgestir geta sent endurgjöf (Allt að 150 stafir) í lokin - á Enable it if you want the web visitor can send a feedback (up to 150 char) at the end", + "FORWARDTRANSCRIPT": "Virkja ef þú vilt að vefgesturinn sé spurður hvort hann vilji fá handrit af spjallinu sent í tölvupósti - Enable it if you want the web visitor is asked to receive a chat transcript via email", + "AUTOCLOSE": "Virkja ef þú vilt að spjallinu sé lokað sem óviðráðanlegt ef enginn þjónustufulltrúi er tiltækur. Frekari upplýsingar á: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet -\nEnable it if you want chat sessions to be closed as Unmanaged if no agent is available. Learn more about it at: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet", + "ENABLEUNMANAGEDNOTE": "Virkja ef þú vilt að gesturinn sé sýnd skilaboð þegar allir þjónustufulltrúar eru uppteknir og spjallinu er ekki sinnt. - Enable it if you want the visitor is shown a message when all the agents are busy and the chat gets unmanaged", + "WEBSITEALIAS": "Forskeyti sem er notað til að semja nafn þjónustufulltrúa (forskeyti+auðkenni viðskiptamanns) sýnt vefgestinum meðan á spjalllotunni stendur - A prefix used to compose the agent name (prefix+Agent Id) shown to the web visitor during the chat session", + "ENABLECUSTOMERWRITING": "Virkja ef þú vilt að spjallið hefjist án þess að bíða eftir tiltækum þjónustufulltrúa (Taktu eftir:Ef þú virkjar það þá verða spjöllin aldrei ómeðhöndluð). Frekari upplýsingar á:https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet -\nEnable it if you want the chat starts without waiting for an available agent (pay attention: if you enable it, your chats will never get unmanaged). Learn more at: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet", + "MAPKEY": "Eftirfarandi svæði fyrir tengilið hreyfistjóra: - The following Motion Contact Manager field:", + "FROMKEY": "Verður varpað í hreyfispjallið þitt sem: - Will be mapped in your Motion Chat Snippet as:", + "COPYSCRIPTTOCLIPBOARD": "Afrita og líma forskriftartexta yfir á vefsíðuna þína - Copy and paste the script text into your website", + "FORWARD_OFFLINE": "Þú getur bætt við nýtt aðsetur með því að aðskilja með kommu (T.d.john.doe@xcally.com, jane.miller@xcally.com) - You can add multiple addresses separated by commas (e.g. john.doe@xcally.com, jane.miller@xcally.com)", + "MOTIONADDRESS": "Svæðið verður að hafa eftirfarandi snið:://[:]. Example: https://X.Y.Z.W - The field must have the following format: ://[:]. Example: https://X.Y.Z.W", + "MOTIONPROXY": "Svæðið verður að hafa eftirfarandi snið: ://[:]. Example: https://X.Y.Z.W", + "NAME": "Aðeins tölur, bókstafir og sérstakir stafir (._) eru studdir - Only numbers, letters and specific characters (._) are supported", + "LIST": "Listi yfir tengilið sem notaður er til að tengja tengiliði - Contact Manager list used to associate Contacts", + "INTERVAL": "Veldu einn af listanum - Select one from the list", + "MANDATORYDISPOSITION": "Skylduráðstöfun", + "MANDATORYDISPOSITIONPAUSEID": "Gera hlé á notkun ef skylduráðstöfun er virkjuð - Pause to use if mandatory disposition is enabled", + "WELCOMEMESSAGE": "Skildu eftir tómst ef þú vilt ekki senda nein velkomin skilaboð - Leave empty if you don't want to send any welcome message" }, - "ADDRESS": "Address", - "ONLINESTATE": "Online Status", - "OFFLINESTATE": "Offline Status", - "RATINGSTATE": "Rating State", - "ENQUIRY": "Enquiry", - "OFFLINETEMPLATE": "Offline Template", - "CHATDISPOSITIONS": "Chat Dispositions", - "NO_CHATDISPOSITION_AVAILABLE": "No Chat Dispositions available", - "ADD_CHATDISPOSITION": "Add Chat Disposition", - "DELETE": "Delete", - "EDIT_CHATDISPOSITION": "Edit Chat Disposition", + "ADDRESS": "Heimilisfang", + "ONLINESTATE": "Nettengdur staða", + "OFFLINESTATE": "Utan nets staða - Offline Status", + "RATINGSTATE": "Staða einkunna", + "ENQUIRY": "Fyrirspurn", + "OFFLINETEMPLATE": "Utan nets sniðmáti - Offline Template", + "CHATDISPOSITIONS": "Ráðstafanir vegna spjallrása - Chat Dispositions", + "NO_CHATDISPOSITION_AVAILABLE": "Ekkert spjall fyrirkomulag í boði - No Chat Dispositions available", + "ADD_CHATDISPOSITION": "Bæta við niðurlag svars", + "DELETE": "Eyða", + "EDIT_CHATDISPOSITION": "Breyta spjall fyrirkomulaginu ", "DELETE_CHATDISPOSITION": "Delete Chat Disposition", - "ID": "Id", - "NEW_CHATQUEUE": "New Chat Queue", - "NEW_CHATWEBSITE": "New Chat Website", - "ROUNDED": "Rounded", - "SQUARED": "Squared", - "NO_AVAILABLE_INFO": "No available info", - "ALL_TEAMS": "All Teams", - "SELECTED_TEAMS": "Selected Teams", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "CONTACT": "Contact", - "STARTEDAT": "Started At", - "LASTMESSAGE": "Last message", - "STATUS": "Status", - "CLOSED": "Closed", - "OPENED": "Open", - "OPEN": "Open", - "ACCOUNT": "Account", - "INTERACTION": "Interaction", - "INTERACTIONS": "Interactions", - "WEBSITE": "Website", - "ALL": "All", - "SELECT_STATUS": "Select a status", - "FILTER": "Filter", - "FILTERS": "Filters", - "TEAMADD_CHATQUEUE": "Add Team to Chat Queue", - "AGENTADD_CHATQUEUE": "Add Agent to Chat Queue", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", - "CLOSEDAT": "Closed At", - "DISPOSITION": "Disposition", - "CREATEDAT": "Created At", - "NOTES": "Notes", - "NO_INTERACTION_AVAILABLE": "No interactions available", - "SELECTED_WEBSITE": "Select a website", + "ID": "Auðkenni", + "NEW_CHATQUEUE": "Ný spjall röð - New Chat Queue", + "NEW_CHATWEBSITE": "Ný spjall vefsíða - New Chat Website", + "ROUNDED": "Hringlaga", + "SQUARED": "Ferningur", + "NO_AVAILABLE_INFO": "Engar upplýsingar í boði - No available info", + "ALL_TEAMS": "Öll lið - All Teams", + "SELECTED_TEAMS": "Valdir hópar", + "PAGE": "Blaðsíða", + "ROWSPERPAGE": "Raðir á síðu", + "OF": "af", + "CONTACT": "Hafa samband", + "STARTEDAT": "Byrja kl.", + "LASTMESSAGE": "Síðustu skilaboð", + "STATUS": "Staða", + "CLOSED": "Lokað", + "OPENED": "Opna", + "OPEN": "Opna", + "ACCOUNT": "Aðgangur", + "INTERACTION": "Samskipti - Interaction", + "INTERACTIONS": "Samskipti - Interactions", + "WEBSITE": "Vefsíða", + "ALL": "Allir", + "SELECT_STATUS": "Velja stöðu", + "FILTER": "Sía - Filter", + "FILTERS": "Síur - Filters", + "TEAMADD_CHATQUEUE": "Bæta hóp í spjallröðina ", + "AGENTADD_CHATQUEUE": "Bæta þjónustufulltrúa við spjallröð", + "ALL_AGENTS": "Allir þjónustufulltrúar", + "SELECTED_AGENTS": "Valdnir þjónustufulltrúar", + "CLOSEDAT": "Loka kl. ", + "DISPOSITION": "Fyrirkomlag", + "CREATEDAT": "Stofnað kl.", + "NOTES": "Athugasemdir - Notes", + "NO_INTERACTION_AVAILABLE": "Engin samskipti í boði - No interactions available", + "SELECTED_WEBSITE": "Velja vefsíðu", "GOTOP": "Gotop", - "EDIT_GOTOP": "Edit Gotop", - "SELECT_WEBSITE": "Select a website", - "INFO": "Info", - "OFFLINEMESSAGES_CHATWEBSITE": "Go to Offline Messages", - "WAITINGTITLE": "Waiting Title", - "WAITINGMESSAGE": "Waiting Message", - "RATING": "Rating", - "NO_RATINGVALUE": "No Rating", - "DEFAULT_PAUSE": "Default pause", - "UNKNOWN": "Unknown", - "UNREGISTERED": "Unregistered", - "UNAVAILABLE": "Unavailable", - "NOT_INUSE": "Not in use", - "REACHABLE": "Reachable", - "IN_USE": "In use", - "VOICE": "Voice", - "INTERACTIONS_CHATWEBSITE": "Go to Interactions", - "REFRESH_INTERACTIONS": "Refresh Interactions", - "DELETE_INTERACTION": "Delete Interaction", - "AGENTADD_CHATWEBSITE": "Add Agent to Chat Website", - "TEAMS_ASSOCIATION": "Teams Association", - "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", - "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", - "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments", - "LABELTEXT": "Label text" + "EDIT_GOTOP": "Breyta Gotop", + "SELECT_WEBSITE": "Velja vefsíðu", + "INFO": "Upplýsingar - Info", + "OFFLINEMESSAGES_CHATWEBSITE": "Fara í utan nets skilaboð - Go to Offline Messages", + "WAITINGTITLE": "Titill biðarinnar", + "WAITINGMESSAGE": "Skilaboð í bið", + "RATING": "Einkunn ", + "NO_RATINGVALUE": "Engin einkunn - No Rating", + "DEFAULT_PAUSE": "Sjálfgefið hlé - Default pause", + "UNKNOWN": "Óþekkt", + "UNREGISTERED": "Óskráð", + "UNAVAILABLE": "Ekki í boði", + "NOT_INUSE": "Ekki í notkun - Not in use", + "REACHABLE": "Tiltækur", + "IN_USE": "Í notkun - In use", + "VOICE": "Rödd", + "INTERACTIONS_CHATWEBSITE": "Fara í samskipti - Go to Interactions", + "REFRESH_INTERACTIONS": "Endurhlaða samskipti", + "DELETE_INTERACTION": "Eyða samskiptum - Delete Interaction", + "AGENTADD_CHATWEBSITE": "Bæta þjónustufulltrúa við spjallvef ", + "TEAMS_ASSOCIATION": "Hópfélag", + "TOOLTIP_SCREENRECORDING_ON": "Skjáupptaka í vinnslu - Screen Recording in progress", + "TOOLTIP_SCREENRECORDING_OFF": "Skjáupptaka í boði - Screen Recording available", + "DOWNLOAD_WITH_ATTACHMENTS": "Hlaða niður með viðhengjum - Download with attachments", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Hlaða niður án viðhengja - Download without attachments", + "LABELTEXT": "Texti merkis - Label text" } } diff --git a/public/app/main/apps/chat/i18n/pt-BR.json b/public/app/main/apps/chat/i18n/pt-BR.json index 8a05182..b3e621c 100644 --- a/public/app/main/apps/chat/i18n/pt-BR.json +++ b/public/app/main/apps/chat/i18n/pt-BR.json @@ -5,7 +5,7 @@ "ACCESSKEYID": "Access Key ID", "SECRETACCESSKEY": "Secret Access Key", "LEXREGION": "Região", - "BOTNAME": "Nome do bot", + "BOTNAME": "Nome do Bot", "LOGIN_TIME": "Tempo de login", "PAUSE_TIME": "Tempo de pausa", "DOWNLOAD_INTERACTION": "Download", @@ -13,21 +13,21 @@ "TRANSFER": "Transferir", "QUEUETRANSFER": "Transferência de fila", "QUEUETRANSFERTIMEOUT": "Tempo limite de transferência da fila", - "AGENTTRANSFER": "Transferência de Agente", - "AGENTTRANSFERTIMEOUT": "Tempo limite de transferência do agente", + "AGENTTRANSFER": "Trasferir de Agente", + "AGENTTRANSFERTIMEOUT": "Timeout de transferência do agente", "SYSTEMAVATAR": "Avatar do sistema", "SYSTEMALIAS": "Apelido do sistema", "WELCOMEMESSAGE": "Mensagem de boas-vindas", "LANGUAGE": "Idioma", "EDIT_DIALOGFLOW": "Editar Dialogflow", "DIALOGFLOW": "Dialogflow", - "BACKGROUNDCOLOR": "Cor de fundo", + "BACKGROUNDCOLOR": "Cor de Fundo", "MESSAGEFONTSIZE": "Tamanho da fonte da mensagem", "TAG": "Tag", "EDIT_TAG": "Editar Tag", - "CUSTOMERALIAS": "Apelido ​​do cliente", + "CUSTOMERALIAS": "Apelido ​​do Cliente", "SNIPPETSWIPEOUT": "Snippet deslize para fora", - "CUSTOMERAVATAR": "Avatar do cliente", + "CUSTOMERAVATAR": "Avatar do Cliente", "SHOWCUSTOMERAVATAR": "Mostrar avatar do cliente", "DEFAULTTITLE": "Título Padrão", "MESSAGESALIGNMENT": "Alinhamento de Mensagens", @@ -55,13 +55,13 @@ "EDIT_SYSTEM": "Editar Sistema", "COMMAND": "Comando", "TEXTCOLOR": "Cor do texto", - "FONTSIZE": "Tamanho da fonte", + "FONTSIZE": "Tamanho da Fonte", "WEBSCRIPT": "Web Script", - "CANNEDANSWERS": "Modelo de resposta", - "CHATCANNEDANSWERS": "Modelo de resposta", + "CANNEDANSWERS": "Respostas Pré-definidas", + "CHATCANNEDANSWERS": "Respostas Pré-definidas", "NO_CHATCANNEDANSWER_AVAILABLE": "Não há respostas prontas disponíveis", "NEW_CHATCANNEDANSWER": "Novo modelo de resposta", - "ADD_CHATCANNEDANSWER": "Adicionar modelo de resposta", + "ADD_CHATCANNEDANSWER": "Adicionar Resposta Pré-definida", "EDIT_CHATCANNEDANSWER": "Editar", "DELETE_CHATCANNEDANSWER": "Excluir", "OFFLINEMESSAGESUBJECT": "Assunto da mensagem", @@ -73,23 +73,23 @@ "CLOSINGQUESTION": "Pergunta de encerramento", "TAGS": "Tags", "SHOWAGENTAVATAR": "Mostrar avatar do agente pessoal", - "AGENTAVATAR": "Avatar do agente", + "AGENTAVATAR": "Avatar do Agente", "SPYINTERACTION": "Spy", "NO_AGENT_ONLINE": "Nenhum agente online", - "GOTOREALTIME_CHATQUEUE": "Ir para a fila de chat em tempo real", + "GOTOREALTIME_CHATQUEUE": "Ir para a Fila de Webchat em Tempo Real", "PARTIALPAUSE": "Pausa Parcial", "BUSY": "Ocupado", "TIMER": "Cronômetro", - "IDLE": "Ocioso", + "IDLE": "Disponível", "CAPACITY": "Capacidade", - "AGENTSADD_QUEUE": "Adicionar agente à fila de chat", + "AGENTSADD_QUEUE": "Adicionar Agente à Fila do Webchat", "QUEUES": "Filas", "LOGGED_IN": "Logado", "PAUSED": "Pausado", "READY": "Pronto", "WAITING": "Esperando", "WRITING": "Escrita", - "CHAT": "Chat", + "CHAT": "WebChat", "MAIL": "Email", "SMS": "SMS", "OPENCHANNEL": "Openchannel", @@ -97,62 +97,62 @@ "PAUSE": "Pausa", "REALTIME": "Tempo real", "AGENTS": "Agentes", - "FULLNAME": "Nome completo", + "FULLNAME": "Nome Completo", "INTERNAL": "Interno", "PHONE_STATE": "Estado do telefone", "PHONE_STATUS": "Status do telefone", "LOGOUT": "Sair", "UNPAUSE": "Pausa final", - "AGENTADD_QUEUE": "Adicionar agente à fila de chat", + "AGENTADD_QUEUE": "Adicionar Agente à Fila Webchat", "TEXT": "Texto", "TIMES": "Número de vezes por interação", - "EDIT_AUTOREPLY": "Editar resposta automática", - "AUTOREPLY": "Resposta automatica", - "NEW_CHATDISPOSITION": "Nova disposição de chat", + "EDIT_AUTOREPLY": "Editar Auto Resposta", + "AUTOREPLY": "Auto Resposta", + "NEW_CHATDISPOSITION": "Nova Qualificação Webchat", "ENABLECUSTOMERATTACHMENT": "Ativar Anexos do Cliente", "OFFLINE_CHAT_BUTTON": "Botão Chat off-line", "OFFLINESTATUS": "Status Offline", "NAME": "Nome", - "CHATQUEUES": "Filas de chat", + "CHATQUEUES": "Filas Webchat", "SEARCH_FOR_ANYONE": "Procurar", "STRATEGY": "Estratégia", - "AGENT_TIMEOUT": "Tempo limite do agente", + "AGENT_TIMEOUT": "Timeout do Agente", "DESCRIPTION": "Descrição", "KEY": "Key", "ALIAS": "Alias", "VARIABLE": "Variável", "INTERVAL": "Intervalo", - "EDIT_CLOSE": "Editar Fechar", + "EDIT_CLOSE": "Editar Encerramento", "TIMEZONE": "Fuso horário", "MESSAGE": "Messagem", "ADVANCED": "Avançado", "FORWARDTRANSCRIPT": "Encaminhar Transcrição", - "FORWARDTRANSCRIPTMESSAGE": "Mensagem de Transcrição Direta", + "FORWARDTRANSCRIPTMESSAGE": "Mensagem de Encaminhar Transcrição", "SKIPMESSAGEBUTTON": "Ignorar botão de mensagem", - "EDIT_MESSAGE": "Editar mensagem", - "CONDITION_AGREEMENT": "Contrato de Condição", + "EDIT_MESSAGE": "Editar Mensagem", + "CONDITION_AGREEMENT": "Condition Agreement", "NONE": "Nenhum", "PRIORITY": "Prioridade", "ONLINESTATUS": "Status online", "UNMANAGEDSTATUS": "Status não gerenciado", - "AUTOCLOSE": "Ativar o autoclose", - "ENABLEUNMANAGEDNOTE": "Ativar mensagem não gerenciada", + "AUTOCLOSE": "Ativar Autoclose", + "ENABLEUNMANAGEDNOTE": "Ativar Mensagem não Gerenciada", "UNMANAGEDMESSAGE": "Messagem", "SKIPUNMANAGED": "Pular Mensagem", "SENDUNMANAGED": "Enviar mensagem", "WEBSITESCRIPT": "Website Script", "DELETE_OFFLINEMESSAGE": "Excluir", "OFFLINEMESSAGES": "Mensagens Offline", - "FORWARD_OFFLINE": "Encaminhar off-line", + "FORWARD_OFFLINE": "Encaminhar Offline", "SHOW_OFFLINEMESSAGE": "Mostrar", - "FORWARD_OFFLINE_ADDRESS": "Endereço offline de encaminhamento", - "CLOSINGFORM": "Formulário de Fechamento", + "FORWARD_OFFLINE_ADDRESS": "Endereço para Encaminhar Offline", + "CLOSINGFORM": "Formulário de Encerramento", "ENABLERATING": "Ativar Classificação", - "ENABLECUSTOMERWRITING": "Permitir que o cliente escreva antes de aceitar o agente", - "ENABLEFEEDBACK": "Ativar feedback", + "ENABLECUSTOMERWRITING": "Permitir que o cliente escreva antes que seja atribuído ao agente", + "ENABLEFEEDBACK": "Ativar Feedback", "RATINGTYPE": "Tipo de Avaliação", "CLOSINGMESSAGE": "Mensagem de Encerramento", - "CLOSINGMESSAGEBUTTON": "Fechando o botão da mensagem", + "CLOSINGMESSAGEBUTTON": "Mensagem do Botão de Encerramento", "RATINGSTARSNUMBER": "Número de estrelas de avaliação", "EDIT_GOTOIF": "Editar GotoIf", "CONDITION": "Condição", @@ -249,11 +249,11 @@ "EMAIL_ACCOUNT_REQUIRED": "Campo obrigatório" }, "CM_FIELD": "Contact Manager Field", - "CHATPROACTIVEACTIONS": "Ações proativas", + "CHATPROACTIVEACTIONS": "Ações Proativas", "NEW_CHATPROACTIVEACTION": "Nova ação proativa", - "EDIT_CHATPROACTIVEACTION": "Editar ação proativa", - "DELETE_CHATPROACTIVEACTION": "Excluir ação proativa", - "ADD_CHATPROACTIVEACTION": "Adicionar ação proativa", + "EDIT_CHATPROACTIVEACTION": "Editar Ação Proativa", + "DELETE_CHATPROACTIVEACTION": "Excluir Ação Proativa", + "ADD_CHATPROACTIVEACTION": "Adicionar Ação Proativa", "NO_CHATPROACTIVEACTION_AVAILABLE": "Nenhuma ação proativa disponível", "NO_OFFLINEMESSAGE_AVAILABLE": "Nenhuma mensagem off-line disponível", "MOUSEOVER": "Mouse Over", @@ -272,20 +272,20 @@ "EDIT_GOTO": "Editar Goto", "EDIT_GOTOIf": "Editar GotoIf", "EDIT_NOOP": "Editar Noop", - "ADD_CHATQUEUE": "Adicionar fila de Chat", - "EDIT_CHATQUEUE": "Editar fila de Chat", - "DELETE_CHATQUEUE": "Excluir fila de Chat", + "ADD_CHATQUEUE": "Adicionar Fila WebChat", + "EDIT_CHATQUEUE": "Editar Fila WebChat", + "DELETE_CHATQUEUE": "Excluir Fila de WebChat", "SETTINGS": "Configurações", "SAVE": "Salvar", "SCRIPT": "Roteiro", "TOKEN": "Token", "CREATED_AT": "Criado em", - "CHATWEBSITES": "Chat Websites", + "CHATWEBSITES": "Websites do Webchat", "MOTIONADDRESS": "Domínio do site", "MOTIONPROXY": "Domínio de Proxy ou Motion", - "ADD_CHATWEBSITE": "Adicionar Chat Website", - "EDIT_CHATWEBSITE": "Editar Chat Website", - "DELETE_CHATWEBSITE": "Excluir Chat Website", + "ADD_CHATWEBSITE": "Adicionar Website do WebChat", + "EDIT_CHATWEBSITE": "Editar Website do Webchat", + "DELETE_CHATWEBSITE": "Excluir Website do Webchat", "LIST": "Lista", "SNIPPET": "Fragmento", "FORMS": "Formulários", @@ -293,37 +293,37 @@ "DOWN": "Baixo", "COLLAPSE": "Collapse", "PROACTIVEACTIONS": "Ações proativas", - "DISPOSITIONS": "Disposições", + "DISPOSITIONS": "Qualificações", "WEBHOOKS": "WebHooks", "ACTIONS": "Ações", "FIDELITY": "Fidelidade", "APPEARANCE": "Aparência", "MAINCOLOR": "Cor Principal", - "FOCUSCOLOR": "Cor de foco", - "BUTTONCOLOR": "Cor do botao", - "HEADERSHAPE": "Forma de cabeçalho", + "FOCUSCOLOR": "Cor de Foco", + "BUTTONCOLOR": "Cor do Botão", + "HEADERSHAPE": "Forma do Cabeçalho", "ANIMATION": "Animação", "DEFAULT": "Padrão", "WHITELABEL": "White Label", "LOGO": "Logo", "DOWNLOADTRANSCRIPT": "Download Transcrição", - "ENQUIRY_ENABLE": "Enquiry Enable", - "ENQUIRY_FORWARDING": "Enquiry Forwarding", - "ENQUIRY_FORWARDING_ADDRESS": "Enquiry Forwarding Address", + "ENQUIRY_ENABLE": "Habilitar Consulta", + "ENQUIRY_FORWARDING": "Encaminhamento de Consulta", + "ENQUIRY_FORWARDING_ADDRESS": "Endereço de Encaminhamento de Consulta", "LABELS": "Labels", - "HEADER_ONLINE": "Cabeçalho on-line", + "HEADER_ONLINE": "Cabeçalho Online", "ONLINE_MESSAGE": "Mensagem Online", "NAME_TITLE": "Nome da etiqueta de entrada", "USERNAME_PLACEHOLDER": "Local de entrada de nome de usuário", - "EMAIL_TITLE": "Etiqueta de entrada de e-mail", + "EMAIL_TITLE": "Email Input Label", "EMAIL_PLACEHOLDER": "Espaço reservado para entrada de e-mail", "START_CHAT_BUTTON": "Botão 'Iniciar chat'", - "AGENTS_BUSY": "Mensagem de Agentes Ocupados", + "AGENTS_BUSY": "Mensagem quando Agentes estão Ocupados", "HEADER_OFFLINE": "Cabeçalho Offline", "OFFLINE_MESSAGE": "Mensagem Offline", "MESSAGE_TITLE": "Rótulo de Mensagem", - "ENQUIRY_MESSAGE_PLACEHOLDER": "Espaço reservado para entrada de mensagem de consulta", - "ENQUIRY_BUTTON": "Texto do botão de consulta", + "ENQUIRY_MESSAGE_PLACEHOLDER": "Espaço reservado para entrada de Mensagem de Consulta", + "ENQUIRY_BUTTON": "Texto do Botão de Consulta", "RATING_MESSAGE": "Mensagem de Avaliação", "RATING_SEND": "Texto do botão de envio de classificação", "RATING_SKIP": "Texto do botão Ignorar classificação", @@ -336,9 +336,9 @@ "REJECT": "Rejeitar", "REJECTMETHOD": "Rejeitar Metodo", "REJECTURL": "Rejeitar URL", - "CLOSE": "Fechar", - "CLOSEMETHOD": "Fechar Metodo", - "CLOSEURL": "Fechar URL", + "CLOSE": "Encerrar", + "CLOSEMETHOD": "Método de Encerramento", + "CLOSEURL": "URL de Encerramento", "EMBEDDING": "Incorporação", "GENERAL": "Geral", "SELECTED": "Selecionado", @@ -347,51 +347,51 @@ "BACK": "Voltar", "HELP": { "VERTICALPOSITION": "Representa a distância em porcentagem do topo", - "AGENTIDENTIFIER": "Representa o identificador do agente dentro da sessão de chat", - "HIDEWHENOFFLINE": "Oculta a janela quando está off-line", - "KEY": "Nome abreviado do site (5 caracteres) exibido na guia Agente", + "AGENTIDENTIFIER": "Representa o identificador do agente dentro da sessão de Webchat", + "HIDEWHENOFFLINE": "Ocultar a janela quando está Offline", + "KEY": "Nome abreviado do website (5 caracteres) exibido na guia Agente", "TOKEN": "Token gerado automaticamente usado no script", - "INTEVAL": "Para ser selecionado na lista dos intervalos disponíveis", + "INTEVAL": "A ser selecionado na lista de intervalos disponíveis", "TIMEZONE": "Selecione um da lista (padrão = fuso horário local)", - "ENABLERATING": "Ativá-lo se você quiser que o visitante da Web possa avaliar a interação no final", - "ENABLEFEEDBACK": "Habilite-o se você quiser que o visitante da Web possa enviar um feedback (até 150 caracteres) no final", - "FORWARDTRANSCRIPT": "Habilite-o se você deseja que o visitante da Web receba uma transcrição do chat por e-mail", - "AUTOCLOSE": "Ative-o se quiser que as sessões de chat sejam encerradas como Não gerenciadas, se nenhum agente estiver disponível. Saiba mais sobre isso em: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet", - "ENABLEUNMANAGEDNOTE": "Ative-o se você quiser que o visitante receba uma mensagem quando todos os agentes estiverem ocupados e o bate-papo não for gerenciado", + "ENABLERATING": "Ative se quiser que o ciente possa avaliar a interação ao encerrar", + "ENABLEFEEDBACK": "Habilite se você quiser que o cliente possa enviar um feedback (até 150 caracteres) ao encerrar", + "FORWARDTRANSCRIPT": "Habilite se deseja que o cliente receba uma transcrição do webchat por e-mail", + "AUTOCLOSE": "Ative se quiser que as sessões de chat sejam encerradas como Não Gerenciadas, se nenhum agente estiver disponível.", + "ENABLEUNMANAGEDNOTE": "Ative se quiser que o cliente receba uma mensagem quando todos os agentes estiverem ocupados e o quando o webchat for Não Gerenciado", "WEBSITEALIAS": "Um prefixo usado para compor o nome do agente (prefixo + ID do agente) mostrado ao visitante da web durante a sessão de bate-papo", - "ENABLECUSTOMERWRITING": "Habilite se você deseja que o bate-papo inicie sem esperar por um agente disponível (preste atenção: se você ativá-lo, seus bate-papos nunca serão gerenciados). Saiba mais em: https://wiki.xcallymotion.com/display/XMV/Chat+Websites#ChatWebsites-Snippet", + "ENABLECUSTOMERWRITING": "Habilite se você deseja que o Webchat inicie sem esperar atribuir a um agente disponível (atenção: se você ativar, seus webchats nunca serão Não Gerenciados).", "MAPKEY": "O seguinte campo do Motion Contact Manager:", - "FROMKEY": "Será mapeado na sua janela do Motion Chat como:", - "COPYSCRIPTTOCLIPBOARD": "Copie e cole o texto do script no seu site", - "FORWARD_OFFLINE": "Você pode adicionar vários endereços separados por vírgulas (por exemplo, john.doe@xcally.com, jane.miller@xcally.com)", + "FROMKEY": "Será mapeado na sua janela do Webchat como:", + "COPYSCRIPTTOCLIPBOARD": "Copie e cole este script no seu website", + "FORWARD_OFFLINE": "Você pode adicionar vários endereços separados por vírgulas (por exemplo: john.doe@xcally.com, jane.miller@xcally.com)", "MOTIONADDRESS": "O campo deve ter o seguinte formato: : // [: ]. Exemplo: https: //X.Y.Z.W", "MOTIONPROXY": "O campo deve ter o seguinte formato: : // [: ]. Exemplo: https: //X.Y.Z.W", "NAME": "Somente números, letras e caracteres específicos (._) são suportados", - "LIST": "Lista do Gerenciador de contatos usada para associar os contatos", + "LIST": "Lista usada para associar os contatos", "INTERVAL": "Selecione um da lista", "WELCOMEMESSAGE": "Deixe em branco se não quiser enviar nenhuma mensagem de boas-vindas", - "MANDATORYDISPOSITION": "Disposição obrigatória", - "MANDATORYDISPOSITIONPAUSEID": "Pausar para usar se a disposição obrigatória estiver ativada" + "MANDATORYDISPOSITION": "Qualificação obrigatória", + "MANDATORYDISPOSITIONPAUSEID": "Pausa para Qualificação obrigatória" }, "ADDRESS": "Endereço", "ONLINESTATE": "Status online", "OFFLINESTATE": "Status Offline", "RATINGSTATE": "Status de Avaliação", - "ENQUIRY": "Enquiry", + "ENQUIRY": "Consulta", "OFFLINETEMPLATE": "Modelo Offline", - "CHATDISPOSITIONS": "Disposições de Chat", + "CHATDISPOSITIONS": "Qualificações de Webchat", "NO_CHATDISPOSITION_AVAILABLE": "Nenhuma disposição de chat disponível", - "ADD_CHATDISPOSITION": "Adicionar disposição de chat", + "ADD_CHATDISPOSITION": "Adicionar Qualificação Webchat", "DELETE": "Excluir", - "EDIT_CHATDISPOSITION": "Editar disposição do chat", - "DELETE_CHATDISPOSITION": "Excluir disposição do chat", + "EDIT_CHATDISPOSITION": "Editar Qualificação Webchat", + "DELETE_CHATDISPOSITION": "Excluir Qualificação Webchat", "ID": "Id", "NEW_CHATQUEUE": "Nova fila de chat", "NEW_CHATWEBSITE": "Novo site de chat", "ROUNDED": "Rounded", "SQUARED": "Squared", "NO_AVAILABLE_INFO": "Nenhuma informação disponível", - "ALL_TEAMS": "Todas as equipes", + "ALL_TEAMS": "Todas as Equipes", "SELECTED_TEAMS": "Equipes Selecionadas", "PAGE": "Pagina", "ROWSPERPAGE": "Linhas por página", @@ -399,7 +399,7 @@ "CONTACT": "Contato", "STARTEDAT": "Iniciado em", "STATUS": "Status", - "CLOSED": "Fechado", + "CLOSED": "Encerrado", "OPENED": "Aberto", "OPEN": "Abrir", "ACCOUNT": "Conta", @@ -411,11 +411,11 @@ "FILTER": "Filtro", "FILTERS": "Filtros", "TEAMADD_CHATQUEUE": "Adicionar equipe à fila de chat", - "AGENTADD_CHATQUEUE": "Adicionar agente à fila de chat", - "ALL_AGENTS": "Todos os agentes", + "AGENTADD_CHATQUEUE": "Adicionar Agente à Fila do Webchat", + "ALL_AGENTS": "Todos os Agentes", "SELECTED_AGENTS": "Agentes Selecionados", - "CLOSEDAT": "Fechado em", - "DISPOSITION": "Disposição", + "CLOSEDAT": "Encerrado em", + "DISPOSITION": "Qualificação", "CREATEDAT": "Criado em", "NOTES": "Notas", "NO_INTERACTION_AVAILABLE": "Não há interações disponíveis", @@ -439,12 +439,12 @@ "VOICE": "Voz", "INTERACTIONS_CHATWEBSITE": "Ir para Interações", "REFRESH_INTERACTIONS": "Atualizar Interações", - "DELETE_INTERACTION": "Excluir interação", - "AGENTADD_CHATWEBSITE": "Adicionar agente ao site de chat", + "DELETE_INTERACTION": "Excluir Interação", + "AGENTADD_CHATWEBSITE": "Adicionar Agente ao Website do Webchat", "TEAMS_ASSOCIATION": "Associação de equipes", - "MANDATORYDISPOSITION": "Disposição obrigatória", - "MANDATORYDISPOSITIONPAUSEID": "Pausar para usar se a disposição obrigatória estiver ativada", - "ENABLESENDBUTTON": "Ativar botão Enviar", + "MANDATORYDISPOSITION": "Qualificação obrigatória", + "MANDATORYDISPOSITIONPAUSEID": "Pausa para Qualificação obrigatória", + "ENABLESENDBUTTON": "Ativar Botão Enviar", "FEEDBACKTITLE": "Título do Feedback", "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento", @@ -456,7 +456,7 @@ "VIDAOOESCALATION": "Iniciar videochamada", "VIDAOOSESSION": "Iniciar videochamada", "VIDEO": "Vídeo", - "CLIENTEMAIL": "Email do cliente", + "CLIENTEMAIL": "Email do Cliente", "DIALOGFLOWV2": "Dialogflow V2", "EDIT_DIALOGFLOWV2": "Editar Dialogflow V2", "PRIVATEKEY": "Chave privada", @@ -464,13 +464,13 @@ "EMAIL_ACCOUNT": "Conta de e-mail", "OPEN_NEW_INTERACTION": "Abra uma nova interação", "SUBJECT": "Sujeito", - "ADD_NOTE": "Adicionar nota", - "CANNED_ANSWER_NOT_FOUND": "Nenhuma resposta automática foi encontrada", + "ADD_NOTE": "Adicionar Nota", + "CANNED_ANSWER_NOT_FOUND": "Nenhuma resposta pré-definida foi encontrada", "NOTE": "Observação", "VIDAOOMETADATA": "Vidaoo Metadata", "VIDAOONOTE": "Vidaoo Note", "VIDAOOTOPIC": "Tema Vidaoo", - "CHANNELID": "ID do canal", + "CHANNELID": "ID do Canal", "EDIT_TVOX": "Editar TVox", "MOTIONTITLE": "Título de Movimento", "MOTIONURL": "URL de movimento", diff --git a/public/app/main/apps/contactmanager/i18n/de.json b/public/app/main/apps/contactmanager/i18n/de.json index dc22557..d357c81 100644 --- a/public/app/main/apps/contactmanager/i18n/de.json +++ b/public/app/main/apps/contactmanager/i18n/de.json @@ -1,6 +1,6 @@ { "CONTACTMANAGER": { - "VOICEQUEUEID": "ID Warteschlange für Sprachanrufe", + "VOICEQUEUEID": "ID Anrufwarteschlange", "CAMPAIGNID": "Kampagnen-ID", "STATE": "Status", "NAME": "Name", @@ -9,30 +9,30 @@ "STATUS": "Status", "STARTTIME": "Startzeit", "ENDTIME": "Endzeit", - "MOTION_BULL": "Motion Bull", - "HOPPER": "Hopper", - "FINAL": "Hopper final", - "HISTORY": "Hopper historisch", + "MOTION_BULL": "Outbound-Dialer", + "HOPPER": "Kontakte in Ausführung", + "FINAL": "Kontakte abgeschlossen", + "HISTORY": "Kontakte historisch", "SCHEDULEDAT": "Geplant am", "SEARCH_FOR_ANYONE": "Suche", "EDIT_LIST": "Liste bearbeiten", - "EDIT_HOPPER": "Hopper bearbeiten", + "EDIT_HOPPER": "Kontakt in Ausführung bearbeiten", "DELETE_LIST": "Liste löschen", - "DELETE_HOPPER": "Hopper löschen", + "DELETE_HOPPER": "Kontakt in Ausführung löschen", "RELOAD": "Neu laden", "NO_COMPANIES": "Kein Unternehmen", "NO_AVAILABLE_ITEMS": "Keine Einträge verfügbar", "ADD": "Hinzufügen", "ERRORS": { - "NAME_REQUIRED": "Name ist erforderlich", - "FIRSTNAME_REQUIRED": "Vorname ist erforderlich", - "PHONE_REQUIRED": "Telefonnummer ist erforderlich", - "ALIAS_REQUIRED": "Alias ist erforderlich", - "VALUE_REQUIRED": "Wert ist erforderlich", - "EMAIL_MUST_VALID": "Falsches Format", - "PHONEBAR_API": "Statusprüfung für die MotionBar und des Remote-Switches für den Agenten", - "ACTIONTYPE_REQUIRED": "Pflichtfeld", - "CLICKTOACTION_REQUIRED": "Pflichtfeld" + "NAME_REQUIRED": "Name erforderlich", + "FIRSTNAME_REQUIRED": "Vorname erforderlich", + "PHONE_REQUIRED": "Telefonnummer erforderlich", + "ALIAS_REQUIRED": "Alias erforderlich", + "VALUE_REQUIRED": "Wert erforderlich", + "EMAIL_MUST_VALID": "Ungültiges Format E-Mail", + "PHONEBAR_API": "Statusprüfung PhoneBar für Agenten", + "ACTIONTYPE_REQUIRED": "Aktionstyp erforderlich", + "CLICKTOACTION_REQUIRED": "Aktion erforderlich" }, "DESCRIPTION": "Beschreibung", "DISPOSITION": "Qualifizierung", @@ -65,7 +65,7 @@ "CREATED_AT": "Erstellt am", "SAVE": "Speichern", "DETAIL": "Detail", - "PERSONAL_INFO": "Persönliche Infos", + "PERSONAL_INFO": "Persönliche Informationen", "MOBILE": "Mobiltelefon", "FAX": "Fax", "TAGS": "Tags", @@ -106,7 +106,7 @@ "DELETE_VOICEDISPOSITION": "Anrufqualifizierung löschen", "VAT": "Ust-ID.", "COMPANYID": "Unternehmens-ID", - "WEBSITE": "Website", + "WEBSITE": "Webseite", "EMAIL_DOMAIN": "E-Mail Domain", "ADDRESS": "Adresse", "POSTAL_CODE": "Postleitzahl", @@ -116,7 +116,7 @@ "GOTOCONTACTS_COMPANY": "Kontakte anzeigen", "ADD_AGENT_TO_LIST": "Agenten zur Liste hinzufügen", "AGENTADD_LIST": "Agenten zur Liste hinzufügen", - "NO_AVAILABLE_INFO": "Keine verfügbaren Informationen", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", "NONE": "Nichts", "FULLNAME": "Vollständiger Name", "CHECK_DUPLICATES": "auf Duplikate prüfen", @@ -128,17 +128,17 @@ "SELECTED_AGENTS": "Ausgewählte Agenten", "DATE_OF_BIRTH": "Geburtsdatum", "DATEOFBIRTH": "Geburtsdatum", - "NOTES": "Notizen", + "NOTES": "Anmerkungen", "EXPORTCSVCONTACTS_LIST": "In CSV-Datei exportieren", "GOTO_LIST": "Kontakte anzeigen", "GOTO_COMPANY": "Kontakte anzeigen", "REQUIRED": "Erforderlich", - "GLOBALCUSTOMFIELDS": "Globale benutzerdefinierte Felder", + "GLOBALCUSTOMFIELDS": "Globale nutzerdef. Felder", "NEW_GLOBALCUSTOMFIELD": "Neue benutzerdefinierte Felder", "ADD_GLOBALCUSTOMFIELD": "Benutzerdefiniertes Feld hinzufügen", "EDIT_GLOBALCUSTOMFIELD": "Benutzerdefiniertes Feld bearbeiten", "DELETE_GLOBALCUSTOMFIELD": "Benutzerdefiniertes Feld löschen", - "JSCRIPTY": "Jscripty", + "JSCRIPTY": "JScripty", "SESSIONS": "Sitzungen", "AGENT": "Agent", "PROJECT": "Projekt", @@ -146,8 +146,8 @@ "SELECT_COMPANY": "Unternehmen auswählen", "SELECT_TAGS": "Tags auswählen", "HELP": { - "PHONEBAR_API": "Um Click-to-Call zu aktivieren, geben Sie eine Telefonnummer ein und überprüfen Sie, ob der Remote-Switch für den Agenten eingeschaltet ist", - "PHONEBAR_API_MESSAGE": "Um Click-to-Call zu aktivieren, geben Sie eine Telefonnummer ein und überprüfen Sie, ob der Remote-Switch für den Agenten eingeschaltet ist" + "PHONEBAR_API": "Click-2-Dial in der PhoneBar aktivieren", + "PHONEBAR_API_MESSAGE": "Nur möglich mit PhoneBar. Fernzugriff muss aktiviert sein" }, "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", @@ -156,16 +156,16 @@ "ROW": "Reihe", "EXPORT_ERRORS": "Fehler-Log exportieren", "UPLOAD_COMPLETED": "Hochladen abgeschlossen", - "STOP": "Stopp", + "STOP": "Anhalten", "SELECT_FILE": "Datei auswählen", "IMPORT_CONTACTS": "Kontakte importieren", - "MOTIONDIALER": "Motion Bull", - "PREFIX": "Vorwahl wählen", + "MOTIONDIALER": "Outbound-Dialer", + "PREFIX": "Präfix", "PRIORITY": "Priorität", - "USERID": "Agent-ID abrufen", - "CUSTOMER_JOURNEY": "Kundenhistorie", + "USERID": "Nutzer-ID", + "CUSTOMER_JOURNEY": "Kundenreise", "SELECT_TAG": "Tag auswählen", - "ALL": "Alle", + "ALL": "Alles", "BILLINGINFORMATION": "Abrechnungsdaten", "COMPANY_FISCAL_TYPE": "Unternehmenssteuerart", "CREATE": "Erstellen", @@ -181,14 +181,14 @@ "SDICODE": "SDI-Code", "SOCIAL_CAPITAL": "Aktienkapital", "VATNUMBER_CF": "Umsatzsteuer Identnummer / VAT", - "RECALLME": "Rückruf anfordern", + "RECALLME": "Pers. Wiedervorlage", "ACTIONTYPE": "Aktionstyp", "CLICKTOACTION": "Klicken für Aktion", "ADDITIONAL_PHONES": "Zusätzliche Telefone", - "UPDATE_EXISTING_CONTACTS": "Bestehende Kontakte aktualisieren", "DIALTIMEZONE": "Zeitzone wählen", - "TIMEZONE": "Zeitzone wählen", "MOVE_DOWN": "Sich abwärts bewegen", - "MOVE_UP": "Bewegen Sie sich nach oben" + "MOVE_UP": "Bewegen Sie sich nach oben", + "TIMEZONE": "Zeitzone wählen", + "UPDATE_EXISTING_CONTACTS": "Aktualisieren Sie vorhandene Kontakte" } } diff --git a/public/app/main/apps/contactmanager/i18n/is.json b/public/app/main/apps/contactmanager/i18n/is.json index b700161..b329e81 100644 --- a/public/app/main/apps/contactmanager/i18n/is.json +++ b/public/app/main/apps/contactmanager/i18n/is.json @@ -1,200 +1,200 @@ { "CONTACTMANAGER": { - "SELECT_TAG": "Select tags", - "CUSTOMER_JOURNEY": "Customer Journey", - "USERID": "Recall Agent ID", - "PRIORITY": "Priority", + "SELECT_TAG": "Velja merki", + "CUSTOMER_JOURNEY": "Ferð viðskiptavina", + "USERID": "Auðkenni fyrir endurköllun þjónustufulltrúa - Recall Agent ID", + "PRIORITY": "Forgangur", "MOTIONDIALER": "Motion Bull", - "IMPORT_CONTACTS": "Import Contacts", + "IMPORT_CONTACTS": "Flytja inn tengiliði", "PREFIX": "Dial Prefix", - "VOICEQUEUEID": "VoiceQueue ID", - "CAMPAIGNID": "Campaign ID", - "STATE": "State", - "NAME": "Name", - "LISTS": "Lists", - "UNIQUEID": "Unique Id", - "STATUS": "Status", - "STARTTIME": "Start Time", - "ENDTIME": "End Time", + "VOICEQUEUEID": "Auðkenni radd biðraðar - VoiceQueue ID", + "CAMPAIGNID": "Auðkenni herferðar", + "STATE": "Ríki", + "NAME": "Nafn", + "LISTS": "Listar", + "UNIQUEID": "Einkvæmt kenni - Unique Id", + "STATUS": "Staða", + "STARTTIME": "Upphafstími", + "ENDTIME": "Loka tími", "MOTION_BULL": "Motion Bull", - "MOVE_DOWN": "Move down", - "MOVE_UP": "Move up", + "MOVE_DOWN": "Færa niður", + "MOVE_UP": "Færa upp", "HOPPER": "Hopper", "FINAL": "Hopper Final", "HISTORY": "Hopper History", - "SCHEDULEDAT": "Scheduled At", - "DIALTIMEZONE": "Dial Timezone", - "TIMEZONE": "Dial Timezone", - "SEARCH_FOR_ANYONE": "Search", - "EDIT_LIST": "Edit List", - "EDIT_HOPPER": "Edit Hopper", - "DELETE_LIST": "Delete List", - "DELETE_HOPPER": "Delete Hopper", - "RELOAD": "Reload", - "ADDITIONAL_PHONES": "Additional phones", - "NO_COMPANIES": "No Company", - "NO_AVAILABLE_ITEMS": "No Available Items", - "ADD": "Add", - "UPDATE_EXISTING_CONTACTS": "Update existing contacts", + "SCHEDULEDAT": "Áætlað kl. - Scheduled At", + "DIALTIMEZONE": "Tímabelti hringingar", + "TIMEZONE": "Tímabelti hringingar", + "SEARCH_FOR_ANYONE": "Leita", + "EDIT_LIST": "Breyta lista", + "EDIT_HOPPER": "Breyta Hopper", + "DELETE_LIST": "Eyða lista", + "DELETE_HOPPER": "Eyða Hopper", + "RELOAD": "Endurhlaða", + "ADDITIONAL_PHONES": "Viðbótarsímar", + "NO_COMPANIES": "Ekkert fyrirtæki - No Company", + "NO_AVAILABLE_ITEMS": "Engar tiltækar vörur - No Available Items", + "ADD": "Bæta við", + "UPDATE_EXISTING_CONTACTS": "Uppfæra tengiliði sem fyrir eru - Update existing contacts", "ERRORS": { - "NAME_REQUIRED": "Mandatory field", - "FIRSTNAME_REQUIRED": "Mandatory field", - "PHONE_REQUIRED": "Mandatory field", - "ALIAS_REQUIRED": "Mandatory field", - "VALUE_REQUIRED": "Mandatory field", - "CLICKTOACTION_REQUIRED": "Mandatory field", - "ACTIONTYPE_REQUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format", - "PHONEBAR_API": "Check the MotionBar is running and the remote control switch for the agent is turned on" + "NAME_REQUIRED": "Áskilinn reitur", + "FIRSTNAME_REQUIRED": "Áskilinn reitur", + "PHONE_REQUIRED": "Áskilinn reitur", + "ALIAS_REQUIRED": "Áskilinn reitur", + "VALUE_REQUIRED": "Áskilinn reitur", + "CLICKTOACTION_REQUIRED": "Áskilinn reitur", + "ACTIONTYPE_REQUIRED": "Áskilinn reitur", + "EMAIL_MUST_VALID": "Rangt snið", + "PHONEBAR_API": "Athuga hvort MotionBar sé í gangi og kveikt sé á fjarstýrirofanum fyrir þjónustufulltrúann " }, - "DESCRIPTION": "Description", - "DISPOSITION": "Disposition", - "DISPOSITIONS": "Dispositions", - "VOICEDISPOSITIONS": "Voice Dispositions", - "NEW_VOICEDISPOSITION": "New Voice Disposition", - "CUSTOM_FIELDS": "Custom Fields", - "ADD_LIST": "Add List", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "COMPANIES": "Companies", - "EDIT_COMPANY": "Edit Company", - "DELETE_COMPANY": "Delete Company", - "PHONE": "Phone", - "EMAIL": "Email", - "ADD_COMPANY": "Add Company", - "CONTACTS": "Contacts", - "NEW_LIST": "New List", - "FIRSTNAME": "First Name", - "LASTNAME": "Last Name", - "LIST": "List", - "COMPANY": "Company", - "ADD_CONTACT": "Add Contact", - "EDIT_CONTACT": "Edit Contact", - "MERGE_CONTACT": "Merge Contact", - "DUPLICATE_CONTACT": "Duplicate Contact", - "DELETE_CONTACT": "Delete Contact", - "CREATED_AT": "Created At", - "SAVE": "Save", - "DETAIL": "Detail", - "PERSONAL_INFO": "Personal Info", - "MOBILE": "Mobile", + "DESCRIPTION": "Lýsing", + "DISPOSITION": "Fyrirkomulag", + "DISPOSITIONS": "Fyrirkomulag", + "VOICEDISPOSITIONS": "Fyrirkomulag raddar - Voice Dispositions", + "NEW_VOICEDISPOSITION": "Nýtt fyrirkomulag raddar - New Voice Disposition", + "CUSTOM_FIELDS": "Sérsniðnir reitir ", + "ADD_LIST": "Bæta við lista", + "BACK": "Til baka", + "SELECTED": "Valinn", + "SELECT_ALL": "Velja allt", + "SELECT_NONE": "Velja ekkert", + "COMPANIES": "Fyrirtæki", + "EDIT_COMPANY": "Breyta fyrirtæki", + "DELETE_COMPANY": "Eyða fyrirtæki", + "PHONE": "Sími", + "EMAIL": "Tölvupóstfang", + "ADD_COMPANY": "Bæta við fyrirtæki", + "CONTACTS": "Tengiliðir", + "NEW_LIST": "Nýr listi", + "FIRSTNAME": "Eiginnafn", + "LASTNAME": "Eftirnafn", + "LIST": "Listi", + "COMPANY": "Fyrirtæki", + "ADD_CONTACT": "Bæta við tengilið", + "EDIT_CONTACT": "Breyta fyrirtæki", + "MERGE_CONTACT": "Sameina tengilið", + "DUPLICATE_CONTACT": "Tvöfalda þjónustufulltrúa", + "DELETE_CONTACT": "Eyða tengilið", + "CREATED_AT": "Stofnað kl. ", + "SAVE": "Vista", + "DETAIL": "Smáatriði", + "PERSONAL_INFO": "Persónuupplýsingar", + "MOBILE": "Farsími", "FAX": "Fax", - "TAGS": "Tags", - "SHOW_ALL_FIELDS": "Show all fields", - "FEWER_FIELDS": "Show less fields", - "COUNTRY": "Country", - "CITY": "City", - "STREET": "Street", - "POSTALCODE": "Postal Code", - "DELETE": "Delete", - "DELETE_ALL": "Delete All", - "CONTACTMANAGER": "Contacts Manager", - "ID": "Id", - "SETTINGS": "Settings", - "GENERAL": "General", - "CUSTOMFIELDS": "Custom Fields", - "NO_CUSTOMFIELD_AVAILABLE": "No Custom Fields available", - "ADD_TAG": "Add Tag", - "NO_TAG": "No Tags", - "ALIAS": "Alias", - "CLICKTOACTION": "Click to action", - "ACTIONTYPE": "Action type", - "TYPE": "Type", - "VALUE": "Value", - "ADD_CUSTOMFIELD": "Add Custom Field", - "EDIT_CUSTOMFIELD": "Edit Custom Field", - "DELETE_CUSTOMFIELD": "Delete Custom Field", - "NEW_COMPANY": "New Company", - "NEW_CONTACT": "New Contact", - "NEW_TAG": "New Tag", - "UPLOAD_CONTACTS": "Upload Contacts", - "FINISH": "Finish", - "SUCCESS": "Success", - "FAILURE": "Failure", - "ALL_CONTACTS": "All Contacts", - "NEW_CUSTOMFIELD": "New Custom Field", - "NO_VOICEDISPOSITION_AVAILABLE": "No Voice Dispositions available", - "ADD_VOICEDISPOSITION": "Add Voice Disposition", - "EDIT_VOICEDISPOSITION": "Edit Voice Disposition", - "DELETE_VOICEDISPOSITION": "Delete Voice Disposition", + "TAGS": "Merki", + "SHOW_ALL_FIELDS": "Sýna öll svæði", + "FEWER_FIELDS": "Sýna færri svæði - Show less fields", + "COUNTRY": "Land", + "CITY": "Borg", + "STREET": "Gata", + "POSTALCODE": "Póstnúmer", + "DELETE": "Eyða", + "DELETE_ALL": "Eyða öllu", + "CONTACTMANAGER": "Tengiliðastjóri - Contacts Manager", + "ID": "Auðkenni", + "SETTINGS": "Stillingar", + "GENERAL": "Almennt", + "CUSTOMFIELDS": "Sérsniðnir reitir ", + "NO_CUSTOMFIELD_AVAILABLE": "Engir sérsniðnir reitir tiltækir - No Custom Fields available", + "ADD_TAG": "Bæta við merki", + "NO_TAG": "Engin merki - No Tags", + "ALIAS": "Dulnefni", + "CLICKTOACTION": "Smellið til að aðhafast", + "ACTIONTYPE": "Gerð aðgerðar", + "TYPE": "Gerð", + "VALUE": "Virði- Value", + "ADD_CUSTOMFIELD": "Bæta við sérsniðnum reit", + "EDIT_CUSTOMFIELD": "Breyta sérsniðnum reitum ", + "DELETE_CUSTOMFIELD": "Eyða sérsniðnum reitum ", + "NEW_COMPANY": "Nýtt fyrirtæki", + "NEW_CONTACT": "Nýr tengiliður", + "NEW_TAG": "Nýtt merki", + "UPLOAD_CONTACTS": "Hlaða upp tengiliðum - Upload Contacts", + "FINISH": "Klára", + "SUCCESS": "Velgengni", + "FAILURE": "Mistök", + "ALL_CONTACTS": "Allir tengiliðir", + "NEW_CUSTOMFIELD": "Nýr sérsniðinn reitur - New Custom Field", + "NO_VOICEDISPOSITION_AVAILABLE": "Engar raddleiðingar í boði - No Voice Dispositions available", + "ADD_VOICEDISPOSITION": "Bæta við raddráðstöfun", + "EDIT_VOICEDISPOSITION": "Breyta fyrirkomulags raddar - Edit Voice Disposition", + "DELETE_VOICEDISPOSITION": "Eyða fyrirkomulag raddar - Delete Voice Disposition", "VAT": "VAT", - "COMPANYID": "Company ID", - "WEBSITE": "Website", - "EMAIL_DOMAIN": "Email Domain", - "ADDRESS": "Address", - "POSTAL_CODE": "Postal Code", - "SHIPMENTADDRESS": "Shipment Address", - "COPY_CONTACT": "Copy Contact", - "GOTOCONTACTS_LIST": "Show Contacts", - "GOTOCONTACTS_COMPANY": "Show Contacts", - "ADD_AGENT_TO_LIST": "Add Agent to List", - "AGENTADD_LIST": "Add Agents to List", - "NO_AVAILABLE_INFO": "No available info", - "NONE": "None", - "ALL": "All", - "FULLNAME": "Full Name", - "CHECK_DUPLICATES": "Check Duplicates", - "DUPLICATES": "Duplicates", - "UPLOAD_CSV": "Upload CSV", - "TAG": "Tag", - "UPLOAD": "Upload", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", - "DATE_OF_BIRTH": "Birthdate", - "DATEOFBIRTH": "Birthdate", - "NOTES": "Notes", - "EXPORTCSVCONTACTS_LIST": "Export to CSV", - "GOTO_LIST": "Show Contacts", - "GOTO_COMPANY": "Show Contacts", - "REQUIRED": "Required", - "GLOBALCUSTOMFIELDS": "Global Custom Fields", - "NEW_GLOBALCUSTOMFIELD": "New Custom Fields", - "ADD_GLOBALCUSTOMFIELD": "Add Custom Field", - "EDIT_GLOBALCUSTOMFIELD": "Edit Custom Field", - "DELETE_GLOBALCUSTOMFIELD": "Delete Custom Field", + "COMPANYID": "Auðkenni fyrirtækis", + "WEBSITE": "Vefsíða", + "EMAIL_DOMAIN": "Lén tölvupóstfangs", + "ADDRESS": "Aðsetur", + "POSTAL_CODE": "Póstnúmer", + "SHIPMENTADDRESS": "Aðsetur sendingar", + "COPY_CONTACT": "Afrita tengilið", + "GOTOCONTACTS_LIST": "Sýna tengiliði", + "GOTOCONTACTS_COMPANY": "Sýna tengiliði", + "ADD_AGENT_TO_LIST": "Bæta þjónustufulltrúa við listann", + "AGENTADD_LIST": "Bæta við þjónustufulltrúa við listann", + "NO_AVAILABLE_INFO": "Engar tiltækar upplýsingar - No available info", + "NONE": "Enginn", + "ALL": "Allir", + "FULLNAME": "Fullt nafn", + "CHECK_DUPLICATES": "Athuga tvítekningar", + "DUPLICATES": "Tvítekningar", + "UPLOAD_CSV": "Hlaða upp CSV - Upload CSV", + "TAG": "Merki", + "UPLOAD": "Hlaða upp", + "ALL_AGENTS": "Allir þjónustufulltrúar", + "SELECTED_AGENTS": "Valdnir þjónustufulltrúar", + "DATE_OF_BIRTH": "Fæðingardagur", + "DATEOFBIRTH": "Fæðingardagur", + "NOTES": "Athugasemdir", + "EXPORTCSVCONTACTS_LIST": "Flytja út CSV ", + "GOTO_LIST": "Sýna tengiliði", + "GOTO_COMPANY": "Sýna tengiliði", + "REQUIRED": "Nauðsynlegt", + "GLOBALCUSTOMFIELDS": "Alþjóðlegir sérsniðnir reitir", + "NEW_GLOBALCUSTOMFIELD": "Nýr sérsniðinn reitur - New Custom Fields", + "ADD_GLOBALCUSTOMFIELD": "Bæta við sérsniðnum reit", + "EDIT_GLOBALCUSTOMFIELD": "Breyta sérsniðnum reitum ", + "DELETE_GLOBALCUSTOMFIELD": "Eyða sérsniðnum reitum", "JSCRIPTY": "Jscripty", - "SESSIONS": "Sessions", - "AGENT": "Agent", - "PROJECT": "Project", - "SELECT_LIST": "Select a list", - "SELECT_COMPANY": "Select a company", - "SELECT_TAGS": "Select one or more tags", + "SESSIONS": "Lotur", + "AGENT": "Þjónustufulltrúi", + "PROJECT": "Verkefni", + "SELECT_LIST": "Velja lista", + "SELECT_COMPANY": "Velja fyrirtæki", + "SELECT_TAGS": "Velja eitt eða fleiri merki", "HELP": { - "PHONEBAR_API_MESSAGE": "To enable click-to-call, insert a phone number and check the remote control switch for the Agent is turned on", - "PHONEBAR_API": "To enable click-to-call, insert a phone number and check the remote control switch for the Agent is turned on" + "PHONEBAR_API_MESSAGE": "Til að hægt sé að hringja skal setja inn símanúmer og athuga hvort kveikt sé á fjarstýrirofa fyrir þjónustufulltrúann - To enable click-to-call, insert a phone number and check the remote control switch for the Agent is turned on", + "PHONEBAR_API": "Til að hægt sé að hringja skal setja inn símanúmer og athuga hvort kveikt sé á fjarstýrirofa fyrir þjónustufulltrúann - To enable click-to-call, insert a phone number and check the remote control switch for the Agent is turned on" }, - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "SOCIAL": "Social", - "ROW": "Row", - "EXPORT_ERRORS": "Export Errors", - "UPLOAD_COMPLETED": "Upload Completed", - "STOP": "Stop", - "SELECT_FILE": "Select File", - "BILLINGINFORMATION": "Billing Information", - "FLATDISCOUNT": "Company Discount", - "EUROPE": "Europe", - "ISOCODE": "ISO National Code", + "PAGE": "Blaðsíða", + "ROWSPERPAGE": "Raðir á síðu", + "OF": "af", + "SOCIAL": "Félagslegt", + "ROW": "Röð", + "EXPORT_ERRORS": "Flytja út villur", + "UPLOAD_COMPLETED": "Hleðslu lokið ", + "STOP": "Stoppa", + "SELECT_FILE": "Velja skrá ", + "BILLINGINFORMATION": "Reikningsupplýsingar", + "FLATDISCOUNT": "Afsláttur fyrirtækis", + "EUROPE": "Evrópa", + "ISOCODE": "ISO landskóði - ISO national code", "VATNUMBER_CF": "Codice Fiscale/VAT", - "PIVA": "VAT Number", - "SDICODE": "SDI Code", - "EXPIREDAY": "Expiration Days", - "INVOICEARTICLE": "Law Articles", - "PAYMENTMETHOD": "Payment Method", - "SOCIAL_CAPITAL": "Share Capital", - "COMPANY_FISCAL_TYPE": "Company Fiscal Type", - "RELATIONSHIP": "Relationship ...", - "RELATIONSHIPCOMPANY": " ... with", - "CREATE": "Create", - "RECALLME": "Recall Me", + "PIVA": "VAT númer", + "SDICODE": "SDI Kóði", + "EXPIREDAY": "Fyrningardagar - Expiration Days", + "INVOICEARTICLE": "Lagagreinar - Law Articles", + "PAYMENTMETHOD": "Greiðslumáti", + "SOCIAL_CAPITAL": "Hlutafé - Share Capital", + "COMPANY_FISCAL_TYPE": "Fjárhagsupplýsingar fyrirtækis - Company Fiscal Type", + "RELATIONSHIP": "Samband ... - Relationship ...", + "RELATIONSHIPCOMPANY": " ... með - ... with", + "CREATE": "Stofna", + "RECALLME": "Muna eftir mér", "NOTIFICATIONS": { - "NO_DATA_ERROR": "Unable to retrieve any data", - "INTERACTION_OPEN_ERROR": "Unable to open the interaction", - "ACCOUNTS_GET_ERROR": "Unable to retrieve any {{channel}} account", - "JSCRIPTY_GET_ERROR": "Unable to retrieve any Jscripty project" + "NO_DATA_ERROR": "Ekki er hægt að sækja nein gögn - Unable to retrieve any data", + "INTERACTION_OPEN_ERROR": "Ekki er hægt að opna samskiptin - Unable to open the interaction", + "ACCOUNTS_GET_ERROR": "Ekki er hægt að sækja neinn {{rás}} reikning - Unable to retrieve any {{channel}} account", + "JSCRIPTY_GET_ERROR": "Ekki er hægt að sækja Jscripty-verk - Unable to retrieve any Jscripty project" } } } diff --git a/public/app/main/apps/contactmanager/i18n/pt-BR.json b/public/app/main/apps/contactmanager/i18n/pt-BR.json index 8dae8b1..f16f522 100644 --- a/public/app/main/apps/contactmanager/i18n/pt-BR.json +++ b/public/app/main/apps/contactmanager/i18n/pt-BR.json @@ -2,7 +2,7 @@ "CONTACTMANAGER": { "SELECT_TAG": "Selecione Tags", "CUSTOMER_JOURNEY": "Jornada do Cliente", - "USERID": "Recall Agent ID", + "USERID": "Agent ID Agendamento", "PRIORITY": "Prioridade", "MOTIONDIALER": "Motion Bull", "IMPORT_CONTACTS": "Importar Contatos", @@ -18,7 +18,7 @@ "ENDTIME": "Fim", "MOTION_BULL": "Motion Bull", "HOPPER": "Funil", - "FINAL": "Final", + "FINAL": "Finalização", "HISTORY": "Histórico", "SCHEDULEDAT": "Agendado em", "SEARCH_FOR_ANYONE": "Procurar", @@ -26,7 +26,7 @@ "EDIT_HOPPER": "Editar Funil", "DELETE_LIST": "Excluir Lista", "DELETE_HOPPER": "Excluir Funil", - "RELOAD": "Recarregar", + "RELOAD": "Reload", "NO_COMPANIES": "Nenhuma Empresa", "NO_AVAILABLE_ITEMS": "Nenhum Item Disponível", "ADD": "Adicionar", @@ -46,12 +46,12 @@ "DISPOSITIONS": "Qualificações", "VOICEDISPOSITIONS": "Qualificações de Voz", "NEW_VOICEDISPOSITION": "Nova Qualificação de Voz", - "CUSTOM_FIELDS": "Os Campos Personalizados", + "CUSTOM_FIELDS": "Campos Personalizados", "ADD_LIST": "Adicionar Lista", "BACK": "Voltar", "SELECTED": "Selecionado", "SELECT_ALL": "Selecionar Todos", - "SELECT_NONE": "Selecionar Nenhum", + "SELECT_NONE": "Desselecionar", "COMPANIES": "Empresas", "EDIT_COMPANY": "Editar Empresa", "DELETE_COMPANY": "Excluir Empresa", @@ -76,7 +76,7 @@ "MOBILE": "Celular", "FAX": "Fax", "TAGS": "Tags", - "SHOW_ALL_FIELDS": "Mostrar Todos Campos", + "SHOW_ALL_FIELDS": "Mostrar todos campos", "FEWER_FIELDS": "Reduzir Campos", "COUNTRY": "País", "CITY": "Cidade", @@ -84,7 +84,7 @@ "POSTALCODE": "CEP", "DELETE": "Excluir", "DELETE_ALL": "Excluir Tudo", - "CONTACTMANAGER": "Gestor Contatos", + "CONTACTMANAGER": "Gestão de Contatos", "ID": "Id", "SETTINGS": "Configurações", "GENERAL": "Geral", @@ -107,10 +107,10 @@ "FAILURE": "Falha", "ALL_CONTACTS": "Todos os Contatos", "NEW_CUSTOMFIELD": "Novo Campo Personalizado", - "NO_VOICEDISPOSITION_AVAILABLE": "Nenhuma Disposição de Voz Disponível", - "ADD_VOICEDISPOSITION": "Adicionar Disposição de Voz", - "EDIT_VOICEDISPOSITION": "Editar Disposição de Voz", - "DELETE_VOICEDISPOSITION": "Excluir Disposição de Voz", + "NO_VOICEDISPOSITION_AVAILABLE": "Nenhuma Qualificação de Voz Disponível", + "ADD_VOICEDISPOSITION": "Adicionar Qualificação de Voz", + "EDIT_VOICEDISPOSITION": "Editar Qualificação de Voz", + "DELETE_VOICEDISPOSITION": "Excluir Qualificação de Voz", "VAT": "VAT", "COMPANYID": "ID Empresa", "WEBSITE": "Website", @@ -119,7 +119,7 @@ "POSTAL_CODE": "CEP", "SHIPMENTADDRESS": "Endereço de Envio", "COPY_CONTACT": "Copiar Contato", - "GOTOCONTACTS_LIST": "Ir para Lista de Contatos", + "GOTOCONTACTS_LIST": "Ir para Listas", "GOTOCONTACTS_COMPANY": "Ir para Empresas", "ADD_AGENT_TO_LIST": "Adicionar Agente à Lista", "AGENTADD_LIST": "Adicionar Agentes à Lista", @@ -153,8 +153,8 @@ "SELECT_COMPANY": "Selecione Empresa", "SELECT_TAGS": "Selecione uma ou mais Tags", "HELP": { - "PHONEBAR_API_MESSAGE": "Para habilitar click-to-call, insira o telefone e verifique se o controle remoto esta ativo.", - "PHONEBAR_API": "Para habilitar click-to-call, insira o telefone e verifique se o controle remoto esta ativo." + "PHONEBAR_API_MESSAGE": "Para habilitar click-to-call, insira o número do telefone e verifique se o controle remoto esta ativo.", + "PHONEBAR_API": "Para habilitar click-to-call, insira o número do telefone e verifique se o controle remoto esta ativo." }, "PAGE": "Página", "ROWSPERPAGE": "Linhas por Página", @@ -168,7 +168,7 @@ "ALL": "Tudo", "BILLINGINFORMATION": "Informações de Pagamento", "COMPANY_FISCAL_TYPE": "Tipo Fiscal da Empresa", - "CREATE": "Crio", + "CREATE": "Criado", "EUROPE": "Europa", "EXPIREDAY": "Dias de Vencimento", "FLATDISCOUNT": "Desconto da Empresa", @@ -177,16 +177,16 @@ "PAYMENTMETHOD": "Forma de pagamento", "PIVA": "Número de IVA", "RELATIONSHIP": "Relacionamento ...", - "RELATIONSHIPCOMPANY": " ... com", + "RELATIONSHIPCOMPANY": " ... com", "SDICODE": "Código SDI", "SOCIAL_CAPITAL": "Capital Social", "VATNUMBER_CF": "Código Fiscal / IVA", - "RECALLME": "Lembre-me", + "RECALLME": "Agendamento", "ACTIONTYPE": "Tipo de Acão", "CLICKTOACTION": "Clique para Ação", "ADDITIONAL_PHONES": "Telefones Adicionais", - "UPDATE_EXISTING_CONTACTS": "Atualizar Contatos Existentes", - "DIALTIMEZONE": "Disque fuso horário", + "UPDATE_EXISTING_CONTACTS": "Atualizar contatos existentes", + "DIALTIMEZONE": "Fuso Horário de Discagem", "TIMEZONE": "Fuso Horário", "MOVE_DOWN": "Mover para Baixo", "MOVE_UP": "Mover para Cima" diff --git a/public/app/main/apps/dashboards/i18n/de.json b/public/app/main/apps/dashboards/i18n/de.json index b494e4e..3649c74 100644 --- a/public/app/main/apps/dashboards/i18n/de.json +++ b/public/app/main/apps/dashboards/i18n/de.json @@ -20,31 +20,31 @@ "INTERACTION": "Interaktion", "BROWSER_NAME": "Browser Name", "BROWSER_VERSION": "Browser Version", - "OS_NAME": "Betriebssystem Name", + "OS_NAME": "Betriebssystem", "OS_VERSION": "Betriebssystem Version", "DEVICE_MODEL": "Gerätemodell", "DEVICE_VENDOR": "Gerätehersteller", "DEVICE_TYPE": "Gerätetyp", - "RECALLME": "Rückruf anfordern", - "DROP_RATE": "Abbruchrate Anrufe", - "DROPPED": "Abgebrochen", - "DROPPED_TEXT": "Abgebrochene Anrufe innerhalb der Warteschlange", - "DETAIL": "Detail", - "MOTION_BULL": "Motion Bull", + "RECALLME": "Rückruf planen", + "DROP_RATE": "Drop-Rate Anrufe", + "DROPPED": "Abgebrochen (Drop)", + "DROPPED_TEXT": "Abgebrochen bei Anwahl (Drop-Call)", + "DETAIL": "Details", + "MOTION_BULL": "Outbound-Dialer", "LIMITED": "Limitiert", - "LIMITED_TEXT": "IVR-Kampagnen Anrufe getätigt/limitiert", + "LIMITED_TEXT": "Outbound-IVR-Kampagnen gewählt/limitiert", "DASHBOARDS": "Dashboards", "RECORDINGS": "Aufzeichnungen", "TODAY_MOTION_BULL_STATS": "Tagesstatistiken Warteschlangen", "ORIGINATED": "Gewählt", - "ORIGINATED_TEXT": "Anrufe aus der Warteschlange gewählt", + "ORIGINATED_TEXT": "Gewählte Anrufe aus der IVR", "UPDATE": "Aktualisieren", "MORE": "Mehr", - "MOTIONDIALER": "Motion Dialer", + "MOTIONDIALER": "Outbound-Dialer", "DISPOSE": "Qualifizieren", "QUEUES": "Warteschlangen", "DIALER_CALL": "Dialer-Anruf", - "ELAPSED_TIME": "Abgelaufene Zeit", + "ELAPSED_TIME": "Zeit vergangen", "EDIT": "Bearbeiten", "MERGE": "Zusammenführen", "DUPLICATE": "Duplizieren", @@ -55,11 +55,11 @@ "ANSWER_MACHINE": "Anrufbeantworter", "INTERESTED": "Interessiert", "NOT_INTERESTED": "Kein Interesse", - "PERSONAL_INFO": "Persönliche Infos", - "SOLD": "Verkauft", + "PERSONAL_INFO": "Persönliche Informationen", + "SOLD": "Abschluss", "SPECIAL": "Speziell", - "BLACKLIST": "Blacklist", - "RESCHEDULE": "erneut Planen", + "BLACKLIST": "Schwarze Liste", + "RESCHEDULE": "erneute Planung", "FIRSTNAME": "Vorname", "LASTNAME": "Nachname", "MOBILE": "Mobilnummer", @@ -76,20 +76,20 @@ "TODAY_IVR_CAMPAIGNS_STATS": "IVR-Tagesstatistiken", "TODAY_INBOUND_STATS": "Tagesstatistiken - eingehende Warteschlangen", "TODAY_OUTBOUND_STATS": "Tagesstatistiken - ausgehende Warteschlangen", - "WAITING": "Anrufe in Warteschlange", - "TALKING": "Im Gespräch", + "WAITING": "Wartezustand", + "TALKING": "im Gespräch", "INBOUND_ANSWERED": "Angenommen eingehend", "OUTBOUND_ANSWERED": "Angenommen ausgehend", "ABANDONED": "Abgebrochen", "TOTAL_OFFERED": "Gesamt angeboten", - "AVG_HOLD_TIME": "Durchschnittliche Wartezeit", + "AVG_HOLD_TIME": "DS Wartezeit", "INBOUND_ANSWER_RATE": "Antwortrate eingehend", "OUTBOUND_ANSWER_RATE": "Antwortrate ausgehend", "ABANDON_RATE": "Abbruchrate", "UNMANAGED": "Nicht bearbeitet", "TOTAL": "Gesamt", "TOT_DURATION": "Gesamtdauer", - "AVG_DURATION": "Durchschnittliche Dauer", + "AVG_DURATION": "DS Dauer", "HELP": { "ORIGINATEDLIMITED": "IVR Kampagnen gewählt/limitiert", "DROPPED": "Gesamtzahl abgebrochener Anrufe innerhalb der Warteschlange", @@ -126,17 +126,17 @@ "LIKE_FILTER": "Suche nach variablen Übereinstimmungen der Suchbegriffe" }, "ERRORS": { - "FIRSTNAME_REQUIRED": "Der erste Name ist erforderlich", - "PHONE_REQUIRED": "Die Telefonnummer ist erforderlich", - "DISPOSITION_REQUIRED": "Pflichtfeld", - "AGENT_REQUIRED": "Pflichtfeld", - "QUEUE_REQUIRED": "Pflichtfeld", - "CAMPAIGN_REQUIRED": "Pflichtfeld", - "FAILED_INITIALIZATION": "Fehler während der Initialisierung" + "FIRSTNAME_REQUIRED": "Vorname erforderlich", + "PHONE_REQUIRED": "Telefonnummer erforderlich", + "DISPOSITION_REQUIRED": "Qualifizierung erforderlich", + "AGENT_REQUIRED": "Agent erforderlich", + "QUEUE_REQUIRED": "Warteschlange erforderlich", + "CAMPAIGN_REQUIRED": "Kampagne erforderlich", + "FAILED_INITIALIZATION": "Fehler während Initialisierung" }, - "NO_AVAILABLE_INFO": "Keine Information vorhanden", - "WELCOME_TO_MOTION": "Willkommen zu Motion", - "WELCOME_MESSAGE": "Verwenden Sie die linke Seitenleiste, um durch die verfügbaren Abschnitte zu navigieren", + "NO_AVAILABLE_INFO": "Keine Informationen vorhanden", + "WELCOME_TO_MOTION": "Willkommen bei SogedesX!", + "WELCOME_MESSAGE": "Navigationsmenü auf der linken Seite", "ADD": "Hinzufügen", "CONTACTMANAGER": "Kontaktmanager", "DASHBOARD": "Dashboard", @@ -156,21 +156,21 @@ "TALKING_TEXT": "Aktive Anrufe", "INBOUND_ANSWERED_TEXT": "Angenommene Anrufe", "ABANDONED_TEXT": "Abgebrochene Anrufe", - "DROP_RATE_TEXT": "Abbruchrate", + "DROP_RATE_TEXT": "Abbruchrate (Drop-Calls)", "TOTAL_OFFERED_TEXT": "Gesamt angebotene Interaktionen", - "AVG_HOLD_TIME_TEXT": "Durchschnittliche Wartezeit", - "AVG_TALK_TIME_TEXT": "Durchschnittliche Gesprächszeit", + "AVG_HOLD_TIME_TEXT": "DS Wartezeit", + "AVG_TALK_TIME_TEXT": "DS Gesprächszeit", "INBOUND_ANSWER_RATE_TEXT": "Antwortrate ", "UNMANAGED_TEXT": "Nicht bearbeitete Interaktionen", "TOTAL_TEXT": "Gesamt ausgehende Anrufe", - "OUTBOUND_ANSWERED_TEXT": "Beantwortete Anrufe (Ausgehend) ", + "OUTBOUND_ANSWERED_TEXT": "Gesamt beantwortet", "TOT_DURATION_TEXT": "Gesamtdauer ausgehender Anrufe ", - "AVG_DURATION_TEXT": "Durchschnittliche Dauer ausgehender Anrufe", - "OUTBOUND_ANSWER_RATE_TEXT": "Rate angenommener ausgehender Anrufe", + "AVG_DURATION_TEXT": "DS Dauer ausgehend", + "OUTBOUND_ANSWER_RATE_TEXT": "Antwortrate ausgehend", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", "OF": "von", - "REPLY_PLACEHOLDER": "Text eingeben und ENTER drücken zum Senden", + "REPLY_PLACEHOLDER": "Senden der Nachricht mit Eingabetaste", "CONTACT_INFO": "Kontaktinformationen", "CLOSE_AND_DISPOSE": "Schließen und Qualifizieren", "DISPOSITIONS": "Qualifizierungen", @@ -179,10 +179,10 @@ "REJECT": "Ablehnen", "CLOSED": "Geschlossen", "INFO": "Information", - "NOTE": "Hinweis", + "NOTE": "Anmerkung", "ACCEPT_ELSEWHERE": "Von anderem Teilnehmer angenommen", - "ATTENTION": "Achtung", - "SOCIAL": "Sozial", + "ATTENTION": "Hinweis", + "SOCIAL": "Soziale Medien", "NO_JSCRIPTY_PROJECTS_AVAILABLE": "Keine Jscripty-Projekte verfügbar", "OPENED": "Geöffnet", "FILTER": "Filter", @@ -193,18 +193,18 @@ "INTERACTIONS": "Interaktionen", "STARTEDAT": "Begonnen am", "STATUS": "Status", - "OPEN": "Öffnen", + "OPEN": "Offen", "SHOW": "Anzeigen", "ME": "ICH", "NOT_ASSIGNED": "Nicht zugewiesen", "UNKNOWN": "Unbekannt", - "SELECT_USER": "Benutzer auswählen", + "SELECT_USER": "Nutzer auswählen", "LAST_MESSAGE": "Letzte Nachricht", - "USER": "Benutzer", + "USER": "Nutzer", "TAGS": "Tags", "SELECT_TAG": "Tag auswählen", "TYPE": "Typ", - "SOURCE": "Quelle", + "SOURCE": "Ursprung", "DESTINATION": "Ziel", "CALLERID": "Anrufer-ID", "END_AT": "Beendet am", @@ -215,7 +215,7 @@ "SET_AS": "Festlegen als", "PENDING": "Ausstehend", "CANNED_ANSWER_NOT_FOUND": "Keine Textbausteine gefunden", - "CANNED_ANSWER_SEARCH": "Hier nach einem Textbaustein suchen", + "CANNED_ANSWER_SEARCH": "Hier nach Textbaustein suchen", "NO_MAIL_ACCOUNTS_AVAILABLE": "Keine E-Mail-Konten verfügbar", "NO_FAX_ACCOUNTS_AVAILABLE": "Keine Fax-Konten verfügbar", "NO_SMS_ACCOUNTS_AVAILABLE": "Keine SMS-Konten verfügbar", @@ -251,24 +251,24 @@ "YESTERDAY": "Gestern", "TODAY": "Heute", "SELECT_DATE": "Datum auswählen", - "SELECT_DATE_RANGE": "Wählen Sie einen Datumsbereich", - "CLEAR": "Löschen", + "SELECT_DATE_RANGE": "Zeitbereich auswählen", + "CLEAR": "Leeren", "CALL_NUMBER": "Anrufen", "TRANSFER_NUMBER": "Transfer", "CALL_SAVED": "Anruf erfolgreich gespeichert", "CALL_DISPOSED": "Anruf erfolgreich qualifiziert", "CHANNEL_WAITING_TEXT": "Wartende Interaktionen", "CHANNEL_QUEUE": "Warteschlange", - "CHANNEL_FROM": "von", + "CHANNEL_FROM": "Von", "MARK_AS_UNREAD": "Als ungelesen markieren", "SELECT_AGENT": "Agenten auswählen", "READ": "Gelesen", - "SELECT_READ_UNREAD": "Wählen ob Lesen/Ungelesen", + "SELECT_READ_UNREAD": "Wählen ob Gelesen/Ungelesen", "SELECT_SUBSTATUS": "Zwischenstatus auswählen", "UNREAD": "Ungelesen", "ABANDONAT": "Abgebrochen", "ABANDONEDQUEUECALLS": "Abgebrochene Anrufe", - "FREE": "Frei", + "FREE": "Verfügbar", "LASTASSIGNEDTO": "Zuletzt zugewiesen an", "QUEUE": "Warteschlange", "QUEUECALLEREXITAT": "Abgebrochen", @@ -279,43 +279,43 @@ "CLICKRELOAD": "Verpasste Anrufe! Bitte Seite erneut laden", "NOTAVAILABLE": "Nicht verfügbar", "CURRENTLY_IN_USE_BY": "Derzeit verwendet von", - "CUSTOMER_JOURNEY": "Kundenhistorie", + "CUSTOMER_JOURNEY": "Kundenreise", "NO_DATA_AVAILABLE": "Keine Daten verfügbar", "AGENTS": "Agenten", "TRANSFER": "Transfer", - "NO_DISPOSITION_SET": "Keine Qualifizierungen definiert", + "NO_DISPOSITION_SET": "Keine Qualifizierungen vorhanden", "ABANDONED_RATE": "Abbruchrate", - "ABANDONED_RATE_TEXT": "Rate der abgebrochenen Anrufe innerhalb der Warteschlange", - "AVG_MANAGED_TIME": "Durchschnittliche Bearbeitungszeit", - "AVG_MANAGED_TIME_TEXT": "Durchschnittliche Bearbeitungszeit aller Interkationen", + "ABANDONED_RATE_TEXT": "Rate abgebrochene Interaktionen", + "AVG_MANAGED_TIME": "DS Bearbeitungszeit", + "AVG_MANAGED_TIME_TEXT": "DS Bearbeitungszeit aller Interkationen", "MANAGED": "Bearbeitet", "MANAGED_RATE": "Bearbeitungsrate", "MANAGED_RATE_TEXT": "Rate der bearbeiteten Interaktionen", "MANAGED_TEXT": "Interaktionen bearbeitet", "OPENED_TEXT": "Interaktionen geöffnet", - "TODAY_INTERACTIONS_STATS": "Interaktionen Tagesstatistiken", + "TODAY_INTERACTIONS_STATS": "Tagesstatistiken Omnichannel-Interaktionen", "UNMANAGED_RATE": "Rate nicht Bearbeitet", - "UNMANAGED_RATE_TEXT": "Rate der nicht bearbeiteten Interaktionen in der Warteschlange", + "UNMANAGED_RATE_TEXT": "Rate nicht bearbeitete Interaktionen", "VOICE_ABANDONED": "Abgebrochen", - "VOICE_ABANDONED_TEXT": "Abgebrochene Anrufe innerhalb der Warteschlange", + "VOICE_ABANDONED_TEXT": "Gesamt abgebrochene Anrufe", "VOICE_ABANDON_RATE": "Abbruchrate", - "VOICE_ABANDON_RATE_TEXT": "Rate der abgebrochenen Anrufe innerhalb der Warteschlange", + "VOICE_ABANDON_RATE_TEXT": "Gesamt Abbruchrate", "VOICE_ANSWERED": "Angenommen", - "VOICE_ANSWERED_TEXT": "Angenommene Anrufe in der Warteschlange", + "VOICE_ANSWERED_TEXT": "Gesamt angenommene Anrufe", "VOICE_ANSWER_RATE": "Antwortrate", - "VOICE_ANSWER_RATE_TEXT": "Rate angenommener Anrufe in der Warteschlange", - "VOICE_AVG_HOLD_TIME": "Durchschnittliche Wartezeit", - "VOICE_AVG_HOLD_TIME_TEXT": "Durchschnittliche Wartezeit aller Sprachanrufe", - "VOICE_AVG_TALK_TIME": "Durchschnittliche Gesprächszeit", - "VOICE_AVG_TALK_TIME_TEXT": "Durchschnittliche Gesprächszeit aller Anrufe nach der Warteschleife", - "VOICE_TALKING": "IM GESPRÄCH", - "VOICE_TALKING_TEXT": "Aktive Anrufe in der Warteschlange", + "VOICE_ANSWER_RATE_TEXT": "Gesamt Antwortrate", + "VOICE_AVG_HOLD_TIME": "DS Wartezeit", + "VOICE_AVG_HOLD_TIME_TEXT": "DS Wartezeit Anrufe", + "VOICE_AVG_TALK_TIME": "DS Gesprächszeit", + "VOICE_AVG_TALK_TIME_TEXT": "DS Gesprächszeit aller Anrufe", + "VOICE_TALKING": "Im Gespräch", + "VOICE_TALKING_TEXT": "Gesamt aktive Anrufe", "VOICE_TOTAL_OFFERED": "Gesamt angeboten", - "VOICE_TOTAL_OFFERED_TEXT": "Gesamtzahl der angebotenen Anrufe in der Warteschlange", + "VOICE_TOTAL_OFFERED_TEXT": "Gesamt angebotene Anrufe", "VOICE_UNMANAGED": "Nicht bearbeitet", - "VOICE_UNMANAGED_TEXT": "Nicht bearbeitete Anrufe in der Warteschlange", + "VOICE_UNMANAGED_TEXT": "Gesamt nicht bearbeitete Anrufe", "VOICE_WAITING": "Wartende Anrufe", - "VOICE_WAITING_TEXT": "Wartende Anrufe in der Warteschlange", + "VOICE_WAITING_TEXT": "Gesamt wartende Anrufe", "DOWNLOAD": "Herunterladen", "SCHEDULED_CALLS": "Geplante Anrufe", "PRIVATE": "Persönlich", @@ -343,12 +343,12 @@ "UPDATE_DRAFT": "Entwurf aktualisieren", "NO_AVAILABLE_INTERACTION": "Keine Interaktionen verfügbar", "ACCOUNTINGDOC": "Abrechnungsdokumente", - "ADD_PRODUCTPRICELIST": "PRODUKT HINZUFÜGEN", + "ADD_PRODUCTPRICELIST": "Produkt hinzufügen", "AGENTFULLNAME": "Agent", "ALL_COMPANIES": "Alle Unternehmen", - "ALL_PRODUCTS": "Alles", - "ALL_STATUS": "Alles", - "ALL_STEP": "Alles", + "ALL_PRODUCTS": "Alle Produkte", + "ALL_STATUS": "Alle Status", + "ALL_STEP": "Alles Schritte", "ALL_WORKFLOW": "Alle Arbeitsabläufe", "ATTENDACELASTINVOICE": "Letzte Rechnung", "ATTENDACENEXTINVOICE": "Nächste Rechnung", @@ -357,12 +357,12 @@ "AUTOPROFORMA": "SELBST-PROFORMA", "BALANCE": "SALDO", "BY": "Durch", - "CLONEPROFORMA": "Klon", + "CLONEPROFORMA": "Klonen", "COMPANIES": "Unternehmen", "COMPANYCITY": "Stadt", "COMPANYCOUNTRY": "Land", "COMPANYDESC": "Beschreibung", - "COMPANYEMAIL": "Email", + "COMPANYEMAIL": "E-Mail", "COMPANYFAX": "Fax", "COMPANYNAME": "Unternehmen", "COMPANYNATION": "Staat", @@ -544,10 +544,10 @@ "VALUE_RANGE_CHECK": "Wert muss größer sein als", "CHOOSE": "Auswählen", "DOWNLOAD_WITHOUT_ATTACHMENTS": "Herunterladen ohne Anhänge", - "DOWNLOAD_WITH_ATTACHMENTS": "Mit Anhängen herunterladen", + "DOWNLOAD_WITH_ATTACHMENTS": "Herunterladen inkl. Anhängen", "SELECT_QUEUE": "Warteschlange auswählen", "VIDAOOSESSION": "Videoanruf starten", - "WHATSAPP": "WhatsApp Connector", + "WHATSAPP": "WhatsApp", "WHATSAPP_INTERACTIONS": "WhatsApp-Interaktionen", "LAST_UPDATED": "Zuletzt aktualisiert", "MATCHING_FIELD": "Übereinstimmendes Feld", @@ -556,36 +556,35 @@ "SELECT_CONTACT": "Kontakt auswählen", "WHICH_ONE_TO_USE": "Welcher Eintrag soll verwendet werden?", "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "Kein WhatsApp-Konto verfügbar", - "SECOND_LEVEL_DISPOSITION": "Qualifizierung der zweiten Ebene", - "THIRD_LEVEL_DISPOSITION": "Qualifizierung der dritten Ebene", + "SECOND_LEVEL_DISPOSITION": "Qualifizierung Ebene 2", + "THIRD_LEVEL_DISPOSITION": "Qualifizierung Ebene 3", "LICENSE_EXPIRE_REMAINING_DAYS": "Ihre Lizenz läuft bald ab! Bitte wenden Sie sich an Ihren Administrator", - "CREATEDAT": "Hergestellt in", + "CREATEDAT": "Erstellt am", "ELAPSED_ANSWERED": "Verstrichene Zeit seit dem Start des Anrufs", "ELAPSED_DISPOSED": "Verstrichene Zeit seit Beendigung des Anrufs", "LOST_CONNECTION": "Probleme mit der Netzwerkkonnektivität. Bitte Internetverbindung prüfen.", "NO_RESULTS_AVAILABLE": "Keine Ergebnisse verfügbar", - "AVAILABLE": "Erhältlich", - "CONFIRM": "Bestätigen Sie", + "AVAILABLE": "Verfügbar", + "CONFIRM": "Bestätigen", "FILTERS": "Filter", "FILTER_CHAT_WEBSITES": "Chat-Websites filtern", "FILTER_FAX_ACCOUNTS": "Faxkonten filtern", "FILTER_MAIL_ACCOUNTS": "E-Mail-Konten filtern", - "FILTER_OPENCHANNEL_ACCOUNTS": "Openchannel-Konten filtern", + "FILTER_OPENCHANNEL_ACCOUNTS": "Offener Kanal-Konten filtern", "FILTER_SMS_ACCOUNTS": "SMS-Konten filtern", "FILTER_WHATSAPP_ACCOUNTS": "WhatsApp-Konten filtern", "SETFILTERS": "Filter einstellen", "AUTOCLOSE": "Tab nach Qualifizierung automatisch schließen", "AGENT_PRESENCE": "Bereitschaftsstatus", "SELECT_TEAM": "Team auswählen", + "CONTACT_NAME": "Kontaktname", + "CONTACT_PHONE": "Kontakt-Telefon", "DIAL_TIMEZONE": "Zeitzone wählen", "LIMIT_TABS_REACHED": "Maximale Anzahl geöffneter Tabs erreicht", "LIST_NAME": "Listennamen", - "PREVIEW_CALL": "Anrufvorschau", - "SYSTEM_TIME": "Systemzeit", - "CONTACT_NAME": "Kontaktname", - "CONTACT_PHONE": "Kontakt-Telefon", "RECALLME_CALL_REMINDER": "Recall Me Anruferinnerung", "SCHEDULED_TIME": "Geplante Zeit", + "SYSTEM_TIME": "Systemzeit", "UPCOMING_RECALLME_CALL": "Anstehender Recall Me-Anruf", "WAITING_CALLS": "Wartende Anrufe", "WAITING_INTERACTIONS": "Wartende Interaktionen" diff --git a/public/app/main/apps/dashboards/i18n/is.json b/public/app/main/apps/dashboards/i18n/is.json index 34b7937..b0fe068 100644 --- a/public/app/main/apps/dashboards/i18n/is.json +++ b/public/app/main/apps/dashboards/i18n/is.json @@ -42,11 +42,11 @@ "OPENED_TEXT": "Opened Interactions", "MANAGED": "Managed", "MANAGED_TEXT": "Managed Interactions", - "ABANDONED": "Abandoned", + "ABANDONED": "Hætt við", "ABANDONED_TEXT": "Abandoned Interactions", - "ABANDONED_RATE": "Abandoned Rate", + "ABANDONED_RATE": "Hlutfall hætt við", "ABANDONED_RATE_TEXT": "Interactions Abandon Rate", - "SYSTEM_TIME": "System time", + "SYSTEM_TIME": "Kerfis tími", "TOTAL_OFFERED": "Total Offered", "TOTAL_OFFERED_TEXT": "Offered Interactions", "AVG_HOLD_TIME_TEXT": "Interactions AVG Hold Time", @@ -55,15 +55,15 @@ "AVG_MANAGED_TIME": "AVG Management Time", "AVG_MANAGED_TIME_TEXT": "Interactions AVG Management Time", "NO_DISPOSITION_SET": "No disposition set", - "AGENTS": "Agents", - "TRANSFER": "Transfer", + "AGENTS": "Fulltrúar", + "TRANSFER": "Flytja", "NO_DATA_AVAILABLE": "No data available", "CUSTOMER_JOURNEY": "Customer Journey", "ME": "Me", "CURRENTLY_IN_USE_BY": "Currently in use by", "NOTAVAILABLE": "Not available", "CLICKRELOAD": "New abandoned calls! Reload please", - "ASSIGNTO": "Assign to", + "ASSIGNTO": "Flutt til", "SELECT_QUEUE": "Select Queue", "SELECT_CAMPAIGN": "Select Queue", "FREE": "Free", @@ -71,8 +71,8 @@ "QUEUECALLEREXITREASON": "Reason", "QUEUECALLEREXITAT": "Dropped", "LASTASSIGNEDTO": "Last Assigned To", - "ABANDONEDQUEUECALLS": "Abandoned Queue Calls", - "ABANDONAT": "Abandoned", + "ABANDONEDQUEUECALLS": "Biðraðasamtöl sem hætt var við", + "ABANDONAT": "Hætt við", "QUEUE": "Queue", "SELECT_SUBSTATUS": "Select Substatus", "READ": "Read", @@ -88,24 +88,24 @@ "FILTER_MAIL_ACCOUNTS": "Filter Mail Accounts", "FILTER_WHATSAPP_ACCOUNTS": "Filter Whatsapp Accounts", "SETFILTERS": "Set Filters", - "FILTERS": "Filters", + "FILTERS": "Síur", "CONFIRM": "Confirm", "CHANNEL_WAITING_TEXT": "Waiting Queue Interactions", "CHANNEL_QUEUE": "Queue", "CHANNEL_FROM": "From", "LOADING_INTERACTION": "We are loading the interaction...", - "JANUARY": "January", - "FEBRUARY": "February", - "MARCH": "March", - "APRIL": "April", - "MAY": "May", - "JUNE": "June", - "JULY": "July", - "AUGUST": "August", + "JANUARY": "Janúar", + "FEBRUARY": "Febrúar", + "MARCH": "Mars", + "APRIL": "apríl", + "MAY": "Maí", + "JUNE": "Júní", + "JULY": "Júlí", + "AUGUST": "ágúst", "SEPTEMBER": "September", - "OCTOBER": "October", + "OCTOBER": "Október", "NOVEMBER": "November", - "DECEMBER": "December", + "DECEMBER": "Desember", "MON": "Mon", "TUE": "Tue", "WED": "Wed", @@ -113,23 +113,23 @@ "FRI": "Fri", "SAT": "Sat", "SUN": "Sun", - "DELETE": "Delete", - "LAST_3_DAYS": "Last 3 Day", - "LAST_YEAR": "Last Year", - "THIS_YEAR": "This Year", - "LAST_MONTH": "Last Month", - "THIS_MONTH": "This Month", - "LAST_WEEK": "Last Week", - "THIS_WEEK": "This Week", - "YESTERDAY": "Yesterday", - "TODAY": "Today", + "DELETE": "Eyða", + "LAST_3_DAYS": "Last 3 DaySeinustu 3 daga", + "LAST_YEAR": "Fyrra Ár", + "THIS_YEAR": "Þessu Ári", + "LAST_MONTH": "Fyrri Mánuður", + "THIS_MONTH": "Þessum Mánuði", + "LAST_WEEK": "Fyrri Vika", + "THIS_WEEK": "Þessari Viku", + "YESTERDAY": "Í Gær", + "TODAY": "í Dag", "SELECT_DATE": "Select Start Date", - "HOME": "Home", + "HOME": "Heim", "SET_AS": "Set As", "PENDING": "Pending", "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", "CANNED_ANSWER_SEARCH": "Enter a text to search a Canned Answer", - "TAGS": "Tags", + "TAGS": "Merki", "SELECT_TAG": "Select Tag", "TYPE": "Type", "SOURCE": "Source", @@ -140,21 +140,21 @@ "CHAT": "Chat", "MAIL": "Email", "SMS": "Sms", - "OPENCHANNEL": "Open Channel", + "OPENCHANNEL": "Opnar Rásir", "FAX": "Fax", "NOT_ASSIGNED": "Not Assigned", - "UNKNOWN": "Unknown", + "UNKNOWN": "Óþekkt", "SELECT_USER": "Select User", "LAST_MESSAGE": "Last message", - "USER": "User", + "USER": "Notandi", "RATING": "Rating", "FEEDBACK": "Feedback", "SUBJECT": "Subject", "CUSTOMER_IP": "Originating IP Address", "REFERER": "Referer", - "ACCOUNT": "Account", + "ACCOUNT": "Viðskiptavinur", "WEBSITE": "Website", - "AGENT": "Agent", + "AGENT": "Fulltrúi", "CREATED_AT": "Created At", "CLOSED_AT": "Closed At", "DISPOSITION": "Disposition", @@ -180,7 +180,7 @@ "TODAY_MOTION_BULL_STATS": "Queue Campaigns Daily Stats", "ORIGINATED": "Originated", "ORIGINATED_TEXT": "Queue Calls Originated", - "UPDATE": "Update", + "UPDATE": "Uppfæra", "MORE": "More", "MOTIONDIALER": "Motion Bull", "DISPOSE": "Dispose", @@ -191,11 +191,11 @@ "MERGE": "Merge", "DUPLICATE": "Duplicate", "UNIQUEID": "Uniqueid", - "AUTOCLOSE": "Automatically close contact tab after disposal", + "AUTOCLOSE": "Sjálfvirk lokun á tengilið eftir eyðslu", "CAMPAIGN": "Campaign", "NONE": "None", - "NAME": "Name", - "ANSWER_MACHINE": "Answer Machine", + "NAME": "Nafn", + "ANSWER_MACHINE": "Símsvari", "INTERESTED": "Interested", "NOT_INTERESTED": "Not Interested", "PERSONAL_INFO": "Personal Info", @@ -203,34 +203,34 @@ "SPECIAL": "Special", "BLACKLIST": "Blacklist", "RESCHEDULE": "Reschedule", - "FIRSTNAME": "Firstname", - "LASTNAME": "Lastname", + "FIRSTNAME": "Fornafn", + "LASTNAME": "Eftirnafn", "MOBILE": "Mobile", "DATE_OF_BIRTH": "Birthdate", "COMPANY": "Company", - "TAG": "Tag", + "TAG": "Merki", "COUNTRY": "Country", "CITY": "City", - "STREET": "Address", + "STREET": "Heimilisfang", "POSTALCODE": "Postal Code", "CUSTOM_FIELDS": "Custom Fields", "GENERAL": "General", - "VOICE": "Voice", + "VOICE": "Samtal", "TODAY_IVR_CAMPAIGNS_STATS": "Daily Ivr Campaigns Stats", "TODAY_INBOUND_STATS": "Inbound Queue Daily Stats", "TODAY_OUTBOUND_STATS": "Outbound Daily Stats", "WAITING": "Waiting", - "TALKING": "Talking", + "TALKING": "Í samtali", "INBOUND_ANSWERED": "Answered", "OUTBOUND_ANSWERED": "Answered", - "AVG_HOLD_TIME": "Average Hold Time", + "AVG_HOLD_TIME": "Meðal biðtími", "INBOUND_ANSWER_RATE": "Answer Rate", "OUTBOUND_ANSWER_RATE": "Answer Rate", "ABANDON_RATE": "Abandon Rate", "UNMANAGED": "Unmanaged", "TOTAL": "Total", "TOT_DURATION": "Total Duration", - "AVG_DURATION": "Average Duration", + "AVG_DURATION": "Meðaltí á lengd", "HELP": { "MANDATORY_DISPOSITION_ENABLED": "Mandatory disposition enabled for this account", "UNMANAGED_RATE": "The Unmanaged Rate of all the Interactions", @@ -278,7 +278,7 @@ "NO_AVAILABLE_INFO": "No available info", "WELCOME_TO_MOTION": "Welcome to Motion", "WELCOME_MESSAGE": "Use the left sidebar to navigate through available sections", - "ADD": "Add", + "ADD": "Bæta við", "CONTACTMANAGER": "Contact Manager", "DASHBOARD": "Dashboard", "EDIT_CONTACT": "Edit contact", @@ -286,13 +286,13 @@ "FULLNAME": "Fullname", "CREATEDAT": "Created At", "LIST": "List", - "NEW_CONTACT": "New Contact", + "NEW_CONTACT": "Nýr Tengiliður", "PHONE": "Phone", "SAVE": "Save", "INBOUND_WAITING_CALLS": "Inbound Waiting Calls", "CONTACTS": "Contacts", - "MYCONTACTS": "My Contacts", - "ADD_CONTACT": "Add Contact", + "MYCONTACTS": "Mínir Tengiliðir", + "ADD_CONTACT": "Bæta við tengilið", "RELOAD": "Reload", "WAITING_TEXT": "Waiting Interactions", "TALKING_TEXT": "Active Queue Calls", @@ -304,9 +304,9 @@ "TOTAL_TEXT": "Total Outbound Calls", "OUTBOUND_ANSWERED_TEXT": "Outbound Answered Calls", "TOT_DURATION_TEXT": "Outbound Calls Total Duration", - "AVG_DURATION_TEXT": "Outbound Calls Average Duration", + "AVG_DURATION_TEXT": "Meðaltals lengd á hringdum samtölum", "OUTBOUND_ANSWER_RATE_TEXT": "Outbound calls Answer Rate", - "PAGE": "Page", + "PAGE": "Síða", "ROWSPERPAGE": "Rows per page", "OF": "of", "REPLY_PLACEHOLDER": "Type and hit enter to send a message", @@ -314,24 +314,24 @@ "CLOSE_AND_DISPOSE": "Close and dispose", "DISPOSITIONS": "Dispositions", "CLOSE_WITHOUT_DISPOSE": "Close without dispose", - "ACCEPT": "Accept", + "ACCEPT": "Svarað", "REJECT": "Reject", "CLOSED": "Closed", "INFO": "Info", - "NOTE": "Note", - "ACCEPT_ELSEWHERE": "Accepted elsewhere", - "ATTENTION": "Attention", + "NOTE": "Athugasemd", + "ACCEPT_ELSEWHERE": "Svarað af öðrum", + "ATTENTION": "Takið eftir", "SOCIAL": "Social", "NO_JSCRIPTY_PROJECTS_AVAILABLE": "No Jscripty Projects available", - "OPENED": "Opened", - "FILTER": "Filter", + "OPENED": "Opnað", + "FILTER": "Sía", "SELECT_STATUS": "Select Status", "SELECT_ACCOUNT": "Select Account", "SELECT_WEBSITE": "Select Website", - "ALL": "All", + "ALL": "Allir", "INTERACTIONS": "Interactions", "STARTEDAT": "Started At", - "STATUS": "Status", + "STATUS": "Staða", "OPEN": "Open", "SHOW": "Show", "SHOW_DETAILS": "Show Details", @@ -344,7 +344,7 @@ "SELECT_DATE_RANGE": "Select Date Range", "CLEAR": "Clear", "CALL_NUMBER": "Call", - "TRANSFER_NUMBER": "Transfer", + "TRANSFER_NUMBER": "Flytja", "CALL_SAVED": "Call properly saved", "CALL_DISPOSED": "Call properly disposed", "CUSTOMER_PORT": "Originating TCP Port", @@ -352,7 +352,7 @@ "INTERACTION_DISPOSED": "Interaction properly disposed", "INTERACTION_CLOSED_DISPOSED": "Interaction properly closed and disposed", "SELECT_ALL": "Select all", - "ASSIGNED_TO_OTHERS": "Assigned to others", + "ASSIGNED_TO_OTHERS": "Flutt á aðra", "ID": "Id", "CHAT_INTERACTIONS": "Chat Interactions", "MAIL_INTERACTIONS": "Email Interactions", @@ -362,7 +362,7 @@ "DRAFT": "Draft", "DRAFT_SAVE_WARNING_TITLE": "Overwrite existing draft?", "DRAFT_SAVE_WARNING_MESSAGE": "There is already a draft saved for this interaction. Are you sure you want to overwrite it?", - "OVERWRITE": "Overwrite", + "OVERWRITE": "Yfirskrifa", "CANCEL": "Cancel", "UNTITLED": "Untitled", "SAVE_AS_DRAFT": "Save as draft", @@ -374,11 +374,11 @@ "SELECT_COMPANY": "Select Company", "DOSSIERNAME": "Dossier Name", "OPENDATE": "Open Date", - "ALL_COMPANIES": "All Companies", + "ALL_COMPANIES": "Öll Fyrirtæki", "SELECT_WORKFLOW": "Select Workflow", "WORKFLOW": "Select Workflow", "SELECT_WORKFLOWSTEPS": "Select Workflow State", - "ALL_WORKFLOW": "All Workflow", + "ALL_WORKFLOW": "Allir Verkferlar", "STATE": "State", "STEP": "Step", "NEW_DOSSIER": "New Dossier", @@ -394,9 +394,9 @@ "QUOTATIONSTATUS": "State", "REQUESTNAME": "Request Name", "REQUESTNOTES": "Request Notes", - "ALL_STEP": "All", + "ALL_STEP": "Öll þrep", "UPDATED_AT": "Modified on", - "BY": "By", + "BY": "Af", "ORDER": "Order", "PROFORMA": "PROFORMA", "INVOICE": "INVOICE", @@ -416,13 +416,13 @@ "REQUEST_INFO": "Request", "QUOTATION_INFO": "Quotation", "ORDERCLIENTCODE": "Customer Code", - "ORDERNOTES": "Note", + "ORDERNOTES": "Athugasemd", "PROFORMANAME": "Proforma name", - "AGENTFULLNAME": "Agent", + "AGENTFULLNAME": "Fulltrúi", "PROFORMANOTES": "Note", "PRODUCTINPROFORMA": "Products in proforma", "INVOICENAME": "Invoice Name", - "INVOICENOTES": "Note", + "INVOICENOTES": "Athugasemd", "DOSSIERNOTES": "Note", "QUOTATIONTOTALPRICE": "Total net", "QUOTATIONTOTALTAX": "Total tax", @@ -430,7 +430,7 @@ "PROFORMAID": "Id Proforma", "PRICESALELISTNETPRICE": "Prezzo listino", "PROFORMASTATUS": "State", - "INVOICESTATUS": "State", + "INVOICESTATUS": "Staða", "NO_PRODUCTINVOICE_AVAILABLE": "No product", "INVOICEID": "Invoice", "PRODUCTNOTE": "Note", @@ -443,11 +443,11 @@ "COMPANYVAT": "Fiscal Code/VAT", "COMPANYPHONE": "Telephone", "COMPANYEMAIL": "Email", - "NOTES": "Note", + "NOTES": "Athugasemd", "QUOTATIONPRODUCTNOTE": "Product Note", "QUOTATIONVAT": "VAT", - "AUTOPROFORMA": "SELF-PROFORMA", - "AUTOINVOICE": "SELF-INVOICE", + "AUTOPROFORMA": "Sjálfvirkur bráðabirgða reikningur", + "AUTOINVOICE": "Sjálfvirkur reikningur", "MOVEASSET": "ASSET", "ORDERSTATUS": "State", "QUOTATIONTOTALS": "Total", @@ -465,13 +465,13 @@ "PRODUCTDESCRIPTION": "Description", "NETPRICE": "Price", "DISCOUNT": "Discount", - "TAX": "Tax", - "ATTENDACELASTINVOICE": "Last invoice", - "ATTENDACENEXTINVOICE": "Next invoice", + "TAX": "VSK", + "ATTENDACELASTINVOICE": "Síðasti reikningur", + "ATTENDACENEXTINVOICE": "Næsti reikningur", "SELECT_PRODUCT": "Select product", "SELECT_PRODUCTTYPE": "Select type", - "ALL_PRODUCTS": "All", - "ALL_STATUS": "All", + "ALL_PRODUCTS": "Allar vörur", + "ALL_STATUS": "Allar stöður", "PAYMENT_INFO": "Payment information", "PAYMENTMETHOD": "Payment methods", "PAYMENT": "Payment", @@ -479,7 +479,7 @@ "INVOICEDETAILS": "INVOICE DETAILS", "QUANTITY": "Quantity", "MANAGESALES": "Subscriptions", - "ACCOUNTINGDOC": "Accounting", + "ACCOUNTINGDOC": "Viðskiptavina númr", "INVOICES": "INVOICES", "PROFORMAS": "PROFORMA", "PAYMENTS": "PAYMENTS", @@ -487,9 +487,9 @@ "NO_PRODUCTPROFORMA_AVAILABLE": "No data available", "NO_PRODUCTPRICELIST_AVAILABLE": "No data available", "PROFORMAAUTHORIZED": "Authorized proforma", - "ADD_PRODUCTPRICELIST": "ADD PRODUCT", - "DELETE_PRODUCT": "Delete Product", - "AUTHORIZED": "AUTHORIZED", + "ADD_PRODUCTPRICELIST": "Bæta við vöru", + "DELETE_PRODUCT": "Eyða Vöru", + "AUTHORIZED": "Samþykkt", "INVOICEDISCOUNT": "Discount", "DEPOSIT": "DEPOSIT", "BALANCE": "BALANCE", @@ -497,8 +497,8 @@ "INVOICENOPRODUCTDESCRIPTION": "Description on the invoice", "INVOICENOPRODUCTAMOUNT": "Amount", "INVOICENOTAXAMOUNT": "TAX", - "INVOICENOPRODUCTSAVE": "Save", - "INVOICENOPRODUCTUPDATE": "Update", + "INVOICENOPRODUCTSAVE": "Vista", + "INVOICENOPRODUCTUPDATE": "Uppfæra", "PDFPROFORMA": "PDF", "PDFINVOICE": "PDF", "PAIDANDEXPIRED": "Payment", @@ -513,7 +513,7 @@ "CREATIONDATE": "Created at", "STARTDATE": "Invoice Date", "ENDDATE": "Expiry Date", - "NUMBER": "Number", + "NUMBER": "Númer", "PRODUCTPRICE": "Price", "PRODUCTTAX": "Tax percentage", "PRODUCTQTY": "Quantity", @@ -524,34 +524,34 @@ "SELECT_PERIOD_CREATION": "Select Creation Date", "SELECT_PERIOD_START": "Select Date", "SELECT_PERIOD_EXPIRE": "Select Expiry Date", - "NEW_COMPANY": "New", + "NEW_COMPANY": "Nýtt", "COMPANIES": "Companies", "PAYED_AY": "Payed on", "CLONEPROFORMA": "Clone", "COMPANYDESC": "Description", "COMPANYNATION": "Nation", "GRAPHINVOICES": "Invoice emission chart", - "YEARS": "Years", + "YEARS": "Ár", "FROM": "From", - "TO": "To", + "TO": "Til", "INVOICEEMITED": "Issued", - "INVOICEPAYED": "Payed", + "INVOICEPAYED": "Greidd", "INVOICETOTAL": "Total", "CHOOSE": "Choose", - "ADVANCED_SEARCH": "Advanced Search", + "ADVANCED_SEARCH": "Ýtarleg leit", "NEW_CONDITION": "New Condition", "SELECT_FIELD": "Select field", "SELECT_OPERATOR": "Select operator", "VALUE": "Value", "VALUES": "Values", - "APPLY": "Apply", + "APPLY": "Virkkja", "MEET_ALL_CONDITIONS": "Meet all conditions", "MEET_ANY_CONDITIONS": "Meet at least one condition", "EQUALS": "Equals", "IS_NOT_EQUAL": "Does not equal", "IS_AMONG": "Is among", "IS_NOT_AMONG": "Is not among", - "IS_GREATER_THAN": "Is greater than", + "IS_GREATER_THAN": "Er stærra en", "IS_GREATER_THAN_OR_EQUAL_TO": "Is greater than or equal to", "IS_LESS_THAN": "Is less than", "IS_LESS_THAN_OR_EQUAL_TO": "Is less than or equal to", @@ -564,7 +564,7 @@ "STARTING_VALUE": "Starting value", "ENDING_VALUE": "Ending value", "VALUE_RANGE_CHECK": "Value must be greater than", - "AND": "And", + "AND": "Og", "ENABLED": "Enabled", "DISABLED": "Disabled", "ELAPSED_ANSWERED": "Elapsed time since call started", @@ -576,14 +576,14 @@ "VIDAOOSESSION": "Start Video Call", "SELECT_CONTACT": "Select contact", "SELECT": "Select", - "LAST_UPDATED": "Last updated", + "LAST_UPDATED": "Seinast Uppfært", "MATCHING_FIELD": "Matching field", "MULTIPLE_CONTACTS_FOUND": "Multiple contacts found for number", "WHICH_ONE_TO_USE": "Which one do you want to use?", "LICENSE_EXPIRE_REMAINING_DAYS": "Your license is about to expire! Please contact your Administrator", "NO_RESULTS_AVAILABLE": "No results available", - "AVAILABLE": "Available", - "AGENT_PRESENCE": "Agent Presence", + "AVAILABLE": "Aðgengilegur", + "AGENT_PRESENCE": "Staða á fulltrúum", "SELECT_TEAM": "Select Team", "NOTIFICATIONS": { "TRANSFER_AGENT_EXECUTED": "Transfer to agent successfully executed", diff --git a/public/app/main/apps/dashboards/i18n/pt-BR.json b/public/app/main/apps/dashboards/i18n/pt-BR.json index 38d32a2..174650f 100644 --- a/public/app/main/apps/dashboards/i18n/pt-BR.json +++ b/public/app/main/apps/dashboards/i18n/pt-BR.json @@ -28,25 +28,25 @@ "MANAGED": "Gerenciou", "MANAGED_TEXT": "Interações gerenciadas", "ABANDONED": "Abandonado", - "ABANDONED_TEXT": "Interações abandonadas", - "ABANDONED_RATE": "Taxa Abandonada", - "ABANDONED_RATE_TEXT": "Taxa de abandono de interações", + "ABANDONED_TEXT": "Interações Abandonadas", + "ABANDONED_RATE": "Taxa Abandono", + "ABANDONED_RATE_TEXT": "Taxa de Abandono de Interações", "TOTAL_OFFERED": "Total oferecido", "TOTAL_OFFERED_TEXT": "Interações Oferecidas", - "AVG_HOLD_TIME_TEXT": "Tempo médio de retenção das interações", + "AVG_HOLD_TIME_TEXT": "Tempo médio de Espera das Interações", "MANAGED_RATE": "Taxa gerenciada", "MANAGED_RATE_TEXT": "Taxa gerenciada de interações", - "AVG_MANAGED_TIME": "Tempo médio de gerenciamento", - "AVG_MANAGED_TIME_TEXT": "Tempo médio de gerenciamento das interações", + "AVG_MANAGED_TIME": "AVG Management Time", + "AVG_MANAGED_TIME_TEXT": "Interactions AVG Management Time", "NO_DISPOSITION_SET": "Nenhum conjunto de disposição", - "AGENTS": "AgentEs", + "AGENTS": "Agentes", "TRANSFER": "Transferir", "NO_DATA_AVAILABLE": "Não há dados disponíveis", "CUSTOMER_JOURNEY": "Jornada do Cliente", "ME": "Me", "CURRENTLY_IN_USE_BY": "Atualmente em uso por", "NOTAVAILABLE": "Não disponível", - "CLICKRELOAD": "Novas chamadas abandonadas! Recarregar por favor", + "CLICKRELOAD": "Novas chamadas abandonadas! Por favor faça reload", "ASSIGNTO": "Atribuir a", "SELECT_CAMPAIGN": "Selecione uma fila", "FREE": "Livre", @@ -54,7 +54,7 @@ "QUEUECALLEREXITREASON": "Motivo", "QUEUECALLEREXITAT": "Derrubado", "LASTASSIGNEDTO": "Último Atribuído Para", - "ABANDONEDQUEUECALLS": "Chamadas de Filas Abandonadas", + "ABANDONEDQUEUECALLS": "Chamadas Abandonadas na Fila", "ABANDONAT": "Abandonado", "QUEUE": "Fila", "SELECT_SUBSTATUS": "Selecione Substatus", @@ -63,8 +63,8 @@ "SELECT_READ_UNREAD": "Selecione Lido/Não Lido", "SELECT_AGENT": "Selecione o agente", "MARK_AS_UNREAD": "Marcar como não lido", - "FILTER_VOICE_QUEUES": "Filtrar filas de voz", - "CHANNEL_WAITING_TEXT": "Interações de espera na fila", + "FILTER_VOICE_QUEUES": "Filtrar Filas de voz", + "CHANNEL_WAITING_TEXT": "Interações aguardando em fila", "CHANNEL_QUEUE": "Fila", "CHANNEL_FROM": "De", "LOADING_INTERACTION": "Estamos carregando a interação...", @@ -84,7 +84,7 @@ "TUE": "Ter", "WED": "Qua", "THU": "Qui", - "FRI": "Sex", + "FRI": "Sexta", "SAT": "Sab", "SUN": "Dom", "DELETE": "Excluir", @@ -101,15 +101,15 @@ "HOME": "Inicio", "SET_AS": "Definir como", "PENDING": "Pendente", - "CANNED_ANSWER_NOT_FOUND": "Nenhuma resposta predefinida foi encontrada", - "CANNED_ANSWER_SEARCH": "Digite um texto para pesquisar uma resposta automática", + "CANNED_ANSWER_NOT_FOUND": "Nenhuma resposta pré-definida foi encontrada", + "CANNED_ANSWER_SEARCH": "Digite um texto para pesquisar uma resposta pré-definida", "TAGS": "Tags", "SELECT_TAG": "Selecione Tag", "TYPE": "Tipo", "SOURCE": "Fonte", "DESTINATION": "Destino", - "CALLERID": "Identificador de chamadas", - "END_AT": "Termina em", + "CALLERID": "Caller ID", + "END_AT": "Encerrado em", "DURATION": "Duração", "CHAT": "Chat", "MAIL": "Email", @@ -129,21 +129,21 @@ "WEBSITE": "Website", "AGENT": "Agente", "CREATED_AT": "Criado em", - "CLOSED_AT": "Fechado em", - "DISPOSITION": "Disposição", + "CLOSED_AT": "Encerrada em", + "DISPOSITION": "Qualificar", "CONTACT": "Contato", "INTERACTION": "Interação", "BROWSER_NAME": "Nome do Browser", "BROWSER_VERSION": "Versão Browser", "OS_NAME": "Nome do sistema operacional", "OS_VERSION": "Versão do sistema operacional", - "DEVICE_MODEL": "Modelo do dispositivo", - "DEVICE_VENDOR": "Fornecedor de dispositivos", - "DEVICE_TYPE": "Tipo de dispositivo", + "DEVICE_MODEL": "Modelo do Dispositivo", + "DEVICE_VENDOR": "Fabricante do Dispositivos", + "DEVICE_TYPE": "Tipo do Dispositivo", "RECALLME": "Lembre-me", - "DROP_RATE": "Taxa de queda", - "DROPPED": "Desistiu", - "DROPPED_TEXT": "Chamadas de Filas Derrubadas", + "DROP_RATE": "Taxa de Perda", + "DROPPED": "Perdidas", + "DROPPED_TEXT": "Chamadas Perdidas em Fila", "DETAIL": "Detalhe", "MOTION_BULL": "Motion Bull", "LIMITED": "Limitado", @@ -156,10 +156,10 @@ "UPDATE": "Atualizar", "MORE": "Adicionar", "MOTIONDIALER": "Motion Bull", - "DISPOSE": "Descarte", + "DISPOSE": "Encerrar", "QUEUES": "Filas", - "DIALER_CALL": "Ligação discada", - "ELAPSED_TIME": "Tempo gasto", + "DIALER_CALL": "Numéro discado", + "ELAPSED_TIME": "Tempo de Atendimento", "EDIT": "Editar", "MERGE": "Mesclar", "DUPLICATE": "Duplicado", @@ -167,25 +167,25 @@ "CAMPAIGN": "Campanha", "NONE": "Nenhum", "NAME": "Nome", - "ANSWER_MACHINE": "Máquina de resposta", + "ANSWER_MACHINE": "Answer Machine", "INTERESTED": "Interessado", "NOT_INTERESTED": "Não interessado", "PERSONAL_INFO": "Informação pessoal", "SOLD": "Vendido", "SPECIAL": "Especial", - "BLACKLIST": "Lista negra", + "BLACKLIST": "Blacklist", "RESCHEDULE": "Reprogramar", - "FIRSTNAME": "Primeiro nome", + "FIRSTNAME": "Primeiro Nome", "LASTNAME": "Último nome", "MOBILE": "Mobile", - "DATE_OF_BIRTH": "Data de aniversário", + "DATE_OF_BIRTH": "Data de Aniversário", "COMPANY": "Empresa", "TAG": "Tag", "COUNTRY": "País", "CITY": "Cidade", "STREET": "Rua", "POSTALCODE": "CEP", - "CUSTOM_FIELDS": "Os campos personalizados", + "CUSTOM_FIELDS": "Campos Personalizados", "GENERAL": "Geral", "VOICE": "Voz", "TODAY_IVR_CAMPAIGNS_STATS": "Estatísticas de Campanhas Gerais", @@ -195,10 +195,10 @@ "TALKING": "Falando", "INBOUND_ANSWERED": "Respondidas", "OUTBOUND_ANSWERED": "Respondidas", - "AVG_HOLD_TIME": "Tempo médio de espera", + "AVG_HOLD_TIME": "Tempo Médio de Espera", "INBOUND_ANSWER_RATE": "Taxa de resposta", "OUTBOUND_ANSWER_RATE": "Taxa de resposta", - "ABANDON_RATE": "Taxa de abandono", + "ABANDON_RATE": "Taxa de Abandono", "UNMANAGED": "Não gerenciado", "TOTAL": "Total", "TOT_DURATION": "Duração Total", @@ -251,7 +251,7 @@ "WELCOME_TO_MOTION": "Bem vindo ao Motion", "WELCOME_MESSAGE": "Use a barra lateral esquerda para navegar pelas seções disponíveis", "ADD": "Adicionar", - "CONTACTMANAGER": "Gerenciador de contatos", + "CONTACTMANAGER": "Gestão de Contatos", "DASHBOARD": "Dashboard", "EDIT_CONTACT": "Editar contato", "EMAIL": "Email", @@ -268,26 +268,26 @@ "WAITING_TEXT": "Esperando Interações", "TALKING_TEXT": "Chamadas de Filas Ativas", "INBOUND_ANSWERED_TEXT": "Chamadas de Filas Respondidas", - "DROP_RATE_TEXT": "Taxa de queda de chamadas da fila", - "AVG_TALK_TIME_TEXT": "Tempo de Conversa de Chamadas de Fila", + "DROP_RATE_TEXT": "Taxa de Perda de Chamadas em Fila", + "AVG_TALK_TIME_TEXT": "Tempo Total de Conversa de Chamadas em Fila", "INBOUND_ANSWER_RATE_TEXT": "Taxa de resposta de chamadas da fila", "UNMANAGED_TEXT": "Interações não gerenciadas", "TOTAL_TEXT": "Total de chamadas de saída", "OUTBOUND_ANSWERED_TEXT": "Chamadas de Saída Atendidas", "TOT_DURATION_TEXT": "Duração total das chamadas de saída", - "AVG_DURATION_TEXT": "Duração média das chamadas de saída", + "AVG_DURATION_TEXT": "Duração média das chamadas ativas", "OUTBOUND_ANSWER_RATE_TEXT": "Chamada de saída", "PAGE": "Pagina", "ROWSPERPAGE": "Linhas por Página", "OF": "do", "REPLY_PLACEHOLDER": "Digite e aperte enter para enviar uma mensagem", - "CONTACT_INFO": "Informações de contato", - "CLOSE_AND_DISPOSE": "Fechar e descartar", - "DISPOSITIONS": "Disposições", - "CLOSE_WITHOUT_DISPOSE": "Fechar sem descartar", + "CONTACT_INFO": "Informações de Contato", + "CLOSE_AND_DISPOSE": "Encerrar e Qualificar", + "DISPOSITIONS": "Qualificações", + "CLOSE_WITHOUT_DISPOSE": "Encerrar sem Qualificar", "ACCEPT": "Aceitar", "REJECT": "Rejeitar", - "CLOSED": "Fechar", + "CLOSED": "Encerrar", "INFO": "Informações", "NOTE": "Nota", "ACCEPT_ELSEWHERE": "Aceito em outro lugar", @@ -316,26 +316,26 @@ "CALL_NUMBER": "Ligar", "TRANSFER_NUMBER": "Transferir", "CALL_SAVED": "Chamada devidamente salva", - "CALL_DISPOSED": "Chamada devidamente eliminada", + "CALL_DISPOSED": "Chamada devidamente qualificada", "SCHEDULED_CALLS": "Chamadas agendadas", "PRIVATE": "Privado", "PUBLIC": "Público", "PUBLIC_INTERACTION": "A interação é pública", "VISIBILITY": "Visibilidade", "INTERACTION_CLOSED": "Interação devidamente fechada", - "INTERACTION_CLOSED_DISPOSED": "Interação devidamente fechada e descartada", - "INTERACTION_DISPOSED": "Interação devidamente descartada", - "ASSIGNED_TO_OTHERS": "Atribuído a outras pessoas", + "INTERACTION_CLOSED_DISPOSED": "Interação devidamente fechada e qualificada", + "INTERACTION_DISPOSED": "Interação devidamente qualificada", + "ASSIGNED_TO_OTHERS": "Atribuído a outros", "SELECT_ALL": "Selecionar tudo", - "CHAT_INTERACTIONS": "Interações de bate-papo", - "FAX_INTERACTIONS": "Interações de fax", + "CHAT_INTERACTIONS": "Interações de Webchat", + "FAX_INTERACTIONS": "Interações de Fax", "ID": "Id", "MAIL_INTERACTIONS": "Interações por email", "OPENCHANNEL_INTERACTIONS": "Interações de canal aberto", "SMS_INTERACTIONS": "Interações por SMS", "CANCEL": "Cancelar", - "DRAFT": "Esboço, projeto", - "DRAFT_SAVE_WARNING_MESSAGE": "Já existe um rascunho salvo para esta interação. Tem certeza de que deseja substituí-lo?", + "DRAFT": "Rascunho", + "DRAFT_SAVE_WARNING_MESSAGE": "Existe um rascunho salvo para esta interação. Tem certeza de que deseja substituí-lo?", "DRAFT_SAVE_WARNING_TITLE": "Substituir rascunho existente?", "OVERWRITE": "Substituir", "SAVE_AS_DRAFT": "Salvar como rascunho", @@ -345,11 +345,11 @@ "ACCOUNTINGDOC": "Contabilidade", "ADD_PRODUCTPRICELIST": "ADICIONAR PRODUTO", "AGENTFULLNAME": "Agente", - "ALL_COMPANIES": "Todas as empresas", + "ALL_COMPANIES": "Todas Empresas", "ALL_PRODUCTS": "Todos", "ALL_STATUS": "Todos", "ALL_STEP": "Todos", - "ALL_WORKFLOW": "Todo o fluxo de trabalho", + "ALL_WORKFLOW": "Todo Fluxo de Trabalho", "ATTENDACELASTINVOICE": "Última fatura", "ATTENDACENEXTINVOICE": "Próxima fatura", "AUTHORIZED": "AUTORIZADO", @@ -367,7 +367,7 @@ "COMPANYNAME": "Companhia", "COMPANYNATION": "Nação", "COMPANYPHONE": "Telefone", - "COMPANYPOSTALCODE": "Código postal", + "COMPANYPOSTALCODE": "Código Postal", "COMPANYSTREET": "Rua / Avenida / Praça", "COMPANYVAT": "Código Fiscal / IVA", "CREATIONDATE": "Criado em", @@ -375,18 +375,18 @@ "CREDITNOTE": "NOTA DE CRÉDITO", "CREDITNOTEDETAILS": "Detalhe da nota de crédito", "CREDITNOTE_INFO": "Nota de crédito", - "DELETE_PRODUCT": "Excluir produto", + "DELETE_PRODUCT": "Excluir Produto", "DEPOSIT": "DEPÓSITO", "DETAILS": "Detalhes", "DISCOUNT": "Desconto", "DOSSIER": "Dossiê", - "DOSSIERID": "ID do dossiê", + "DOSSIERID": "ID do Dossiê", "DOSSIERNAME": "Nome do Dossiê", "DOSSIERNOTES": "Nota", "DOSSIERS": "Dossiês", - "DOSSIER_INFO": "Em formação", - "ENDDATE": "Data de validade", - "FROM": "A partir de", + "DOSSIER_INFO": "Informação", + "ENDDATE": "Data de Encerramento", + "FROM": "From", "GRAPHINVOICES": "Tabela de emissão de faturas", "INASSET": "De ativos", "INVOICE": "FATURA", @@ -515,13 +515,13 @@ "CUSTOMER_PORT": "Porta TCP de origem", "ADVANCED_SEARCH": "Busca Avançada", "AND": "E", - "APPLY": "Aplique", + "APPLY": "Aplicar", "CONTAINS": "Contém", "DISABLED": "Desativado", - "ENABLED": "ativado", - "ENDING_DATE": "Data final", - "ENDING_VALUE": "Valor final", - "ENDS_WITH": "Termina com", + "ENABLED": "Ativado", + "ENDING_DATE": "Data de Encerramento", + "ENDING_VALUE": "Valor de Encerramento", + "ENDS_WITH": "Encerrado com", "EQUALS": "É igual a", "IS_AMONG": "Está entre", "IS_BETWEEN": "Está entre", @@ -561,29 +561,29 @@ "LICENSE_EXPIRE_REMAINING_DAYS": "Sua licença está prestes a expirar! Entre em contato com o seu administrador", "CREATEDAT": "Criado em", "ELAPSED_ANSWERED": "Tempo decorrido desde o início da chamada", - "ELAPSED_DISPOSED": "Tempo decorrido desde o final da chamada", + "ELAPSED_DISPOSED": "Tempo decorrido desde encerramento da chamada", "LOST_CONNECTION": "Enfrentando problemas de conectividade de rede. Por favor, verifique sua conexão à internet.", "NO_RESULTS_AVAILABLE": "Nenhum resultado disponível", - "AUTOCLOSE": "Fechar automaticamente a guia de contato após o descarte", - "AGENT_PRESENCE": "Presença do Agente", + "AUTOCLOSE": "Encerrar automaticamente a guia de contato após qualificação", + "AGENT_PRESENCE": "Agent Presence", "SELECT_TEAM": "Selecionar time", "AVAILABLE": "Disponível", - "CONFIRM": "confirme", + "CONFIRM": "Confirme", "FILTERS": "Filtros", - "FILTER_CHAT_WEBSITES": "Filtrar sites de bate-papo", - "FILTER_FAX_ACCOUNTS": "Filtrar contas de fax", - "FILTER_MAIL_ACCOUNTS": "Filtrar contas de correio", - "FILTER_OPENCHANNEL_ACCOUNTS": "Filtrar contas de canal aberto", - "FILTER_SMS_ACCOUNTS": "Filtrar contas de SMS", - "FILTER_WHATSAPP_ACCOUNTS": "Filtrar contas do Whatsapp", + "FILTER_CHAT_WEBSITES": "Filtrar Websites do Webchat", + "FILTER_FAX_ACCOUNTS": "Filtrar Contas de Fax", + "FILTER_MAIL_ACCOUNTS": "Filtrar Contas de Email", + "FILTER_OPENCHANNEL_ACCOUNTS": "Filtrar Contas de Open Channel", + "FILTER_SMS_ACCOUNTS": "Filtrar Contas de SMS", + "FILTER_WHATSAPP_ACCOUNTS": "Filtrar Contas de Whatsapp", "SETFILTERS": "Definir Filtros", - "DIAL_TIMEZONE": "Disque fuso horário", + "DIAL_TIMEZONE": "Fuso Horário de Discagem", "LIMIT_TABS_REACHED": "Número máximo de guias abertas atingido", "LIST_NAME": "Lista de nomes", "PREVIEW_CALL": "Pré-visualizar chamada", "SYSTEM_TIME": "Hora do sistema", "CONTACT_NAME": "Nome de contato", - "CONTACT_PHONE": "telefone de contato", + "CONTACT_PHONE": "Telefone de Contato", "RECALLME_CALL_REMINDER": "Lembrete de chamada de Recall Me", "SCHEDULED_TIME": "Hora marcada", "UPCOMING_RECALLME_CALL": "Próxima chamada de Recall Me", diff --git a/public/app/main/apps/fax/i18n/de.json b/public/app/main/apps/fax/i18n/de.json index e63ae66..387ff6f 100644 --- a/public/app/main/apps/fax/i18n/de.json +++ b/public/app/main/apps/fax/i18n/de.json @@ -1,87 +1,87 @@ { "FAX": { - "TEAMADD_FAXQUEUE": "Team zur Faxwarteschlange hinzufügen", - "AGENTADD_FAXQUEUE": "Agent Fax Warteschlange hinzufügen", + "TEAMADD_FAXQUEUE": "Team hinzufügen", + "AGENTADD_FAXQUEUE": "Agenten hinzufügen", "NAME": "Name", - "FAXQUEUES": "Fax Warteschlangen", - "SEARCH_FOR_ANYONE": "Suche für Jedermann", + "FAXQUEUES": "Fax-Warteschlangen", + "SEARCH_FOR_ANYONE": "Suche", "ERRORS": { - "NAME_REQUIRED": "Der Name ist erforderlich", - "AGENT_TIMEOUT_REQUIRED": "Der Agent Timeout ist erforderlich", - "MOTIONADDRESS_REQUIRED": "Die Adresse ist erforderlich", - "MOTIONADDRESS_MUST_VALID_URL": "Die Adresse muss in einem gültigen Format", - "LOCALSTATIONID_REQUIRED": "Die lokale Station-ID ist erforderlich", - "MODEM_REQUIRED": "Das Modem erforderlich.", - "GATEWAY_REQUIRED": "Das Gateway ist erforderlich", - "FAXDETECT_REQUIRED": "Die FAX Erkennung erforderlich ist", - "T38TIMEOUT_REQUIRED": "Die T.38-Timeout ist erforderlich", - "TIMEOUT_REQUIRED": "Der Timeout ist erforderlich", - "HEADERINFO_REQUIRED": "Die Information in der Kopfzeile sind erforderlich", - "TRUNK_REQUIRED": "Der Stamm ist erforderlich", - "LIST_REQUIRED": "Die Liste ist erforderlich", - "KEY_MAX_LENGTH": "Schlüssel muss eine maximale Länge von {{max}}", - "KEY_REQUIRED": "Der Schlüssel ist erforderlich", - "AGENT_REQUIRED": "Pflichtfeld", - "QUEUE_REQUIRED": "Pflichtfeld", - "TRUEPRIORITY_REQUIRED": "Pflichtfeld", - "FALSEPRIORITY_REQUIRED": "Pflichtfeld", - "CONDITION_REQUIRED": "Pflichtfeld", - "PRIORITY_REQUIRED": "Pflichtfeld", - "DISPOSITION_REQUIRED": "Pflichtfeld", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer als oder gleich", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer als oder gleich", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer als oder gleich", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer als oder gleich", - "TEXT_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", - "TEXT_REQUIRED": "Pflichtfeld", - "VALUE_REQUIRED": "Pflichtfeld", - "COMMAND_REQUIRED": "Pflichtfeld", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "NAME_MUST_VALID_PATTERN": "Falsches Format", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Pflichtfeld", - "TAG_REQUIRED": "Pflichtfeld", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Sie sollten einen Pausenstatus angeben, wenn Sie eine Zwangsdisposition haben" + "NAME_REQUIRED": "Name erforderlich", + "AGENT_TIMEOUT_REQUIRED": "Zeitüberschreitung Agent erforderlich", + "MOTIONADDRESS_REQUIRED": "Adresse erforderlich", + "MOTIONADDRESS_MUST_VALID_URL": "Ungültiges Format URL", + "LOCALSTATIONID_REQUIRED": "ID der lokalen Nebenstelle erforderlich", + "MODEM_REQUIRED": "Modem erforderlich", + "GATEWAY_REQUIRED": "Gateway erforderlich", + "FAXDETECT_REQUIRED": "FAXerkennung erforderlich", + "T38TIMEOUT_REQUIRED": "T.38-Timeout erforderlich", + "TIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", + "HEADERINFO_REQUIRED": "Header-Informationen erforderlich", + "TRUNK_REQUIRED": "SIP-Trunk erforderlich", + "LIST_REQUIRED": "Liste erforderlich", + "KEY_MAX_LENGTH": "Schlüssel darf eine maximale Länge von {{max}} haben", + "KEY_REQUIRED": "Schlüssel erforderlich", + "AGENT_REQUIRED": "Agent erforderlich", + "QUEUE_REQUIRED": "Warteschlange erforderlich", + "TRUEPRIORITY_REQUIRED": "Priorität bei 'wahr' erforderlich", + "FALSEPRIORITY_REQUIRED": "Priorität bei 'falsch' erforderlich", + "CONDITION_REQUIRED": "Bedingung erforderlich", + "PRIORITY_REQUIRED": "Priorität erforderlich", + "DISPOSITION_REQUIRED": "Qualifizierung erforderlich", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität muss größer oder gleich sein als", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei 'wahr' muss größer oder gleich sein als", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei 'falsch' muss größer oder gleich sein als", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", + "TEXT_MAX_LENGTH": "Text eine maximale Länge von {{max}} haben", + "TEXT_REQUIRED": "Text erforderlich", + "VALUE_REQUIRED": "Wert erforderlich", + "COMMAND_REQUIRED": "Eingabe erforderlich", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent muss größer oder gleich sein als", + "NAME_MUST_VALID_PATTERN": "Ungültiges Format Name", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss kleiner oder gleich sein als", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent muss kleiner oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Auf zugew. Agenten warten muss größer oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Auf zugew. Agenten warten muss kleiner oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Auf zugew. Agenten warten erforderlich", + "TAG_REQUIRED": "Tag erforderlich", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agententransfer muss größer oder gleich sein als", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agententransfer muss kleiner oder gleich sein als", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Agententransfer erforderlich", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Warteschlangentransfer muss größer oder gleich sein als", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Warteschlangentransfer muss kleiner oder gleich sein als", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Warteschlangentransfer erforderlich", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Agentenstatus während Qualifizierung erforderlich" }, - "STRATEGY": "Strategie", - "AGENT_TIMEOUT": "Agent Timeout", + "STRATEGY": "Verteilungsstrategie", + "AGENT_TIMEOUT": "Zeitüberschreitung Agent", "DESCRIPTION": "Beschreibung", - "ADD_FAXQUEUE": "Warteschlange hinzufügen Fax", - "EDIT_FAXQUEUE": "Bearbeiten Fax Warteschlange", - "DELETE_FAXQUEUE": "Fax Löschen der Warteschlange", + "ADD_FAXQUEUE": "Warteschlange hinzufügen", + "EDIT_FAXQUEUE": "Warteschlange bearbeiten", + "DELETE_FAXQUEUE": "Warteschlange löschen", "CREATED_AT": "Erstellt am", "SAVE": "Speichern", "SETTINGS": "Einstellungen", "GENERAL": "Allgemein", - "FAXACCOUNTS": "Fax Konten", + "FAXACCOUNTS": "Fax-Konten", "MOTIONADDRESS": "Motion Adresse", - "ADD_FAXACCOUNT": "Fax Konto hinzufügen", - "EDIT_FAXACCOUNT": "Fax Konto bearbeiten", - "DELETE_FAXACCOUNT": "Fax Konto löschen.", - "DISPOSITIONS": "Bestimmungen", + "ADD_FAXACCOUNT": "Fax-Konto hinzufügen", + "EDIT_FAXACCOUNT": "Fax-Konto bearbeiten", + "DELETE_FAXACCOUNT": "Fax-Konto löschen.", + "DISPOSITIONS": "Qualifizierungen", "WEBHOOKS": "WebHooks", - "ACTIONS": "Aktionen", + "ACTIONS": "Routing", "LIST": "Liste", "FIDELITY": "Treue", - "ACCEPT": "Akzeptieren", - "ACCEPTMETHOD": "Die Methode", - "ACCEPTURL": "URL akzeptieren", + "ACCEPT": "Annehmen", + "ACCEPTMETHOD": "Methode annehmen", + "ACCEPTURL": "URL annehmen", "REJECT": "Ablehnen", "REJECTMETHOD": "Methode ablehnen", "REJECTURL": "URL ablehnen", - "CLOSE": "In der Nähe", - "CLOSEMETHOD": "In der Nähe Methode", - "CLOSEURL": "Der URL", - "TRUNK": "Amtsleitung", + "CLOSE": "Schließen", + "CLOSEMETHOD": "Methode bei Schließen", + "CLOSEURL": "URL bei Schließen", + "TRUNK": "SIP-Trunk", "LOCALSTATIONID": "Lokale Station Identifier", "HELP": { "LOCALSTATIONID": "Lokale Station Identifier (Telefonnummer).", @@ -91,43 +91,43 @@ "FAXDETECT": "Die FAX Erkennung mit optionalen Timeout in Sekunden (Ja/T38/CNG/[Timeout]/Keine).", "T38TIMEOUT": "Der Timeout für die T.38-Verhandlung. Der Mindestwert ist 1000.", "ECM": "Fehler beim Connection Mode (ECM).", - "MINRATE": "Minimale Übertragungsrate eingestellt, bevor das Getriebe. Mögliche Werte sind: 2400, 4800, 7200, 9600, 12000 oder 14400.", - "MAXRATE": "Maximale Übertragungsrate eingestellt, bevor das Getriebe. Mögliche Werte sind: 2400, 4800, 7200, 9600, 12000 oder 14400.", + "MINRATE": "Minimale Übertragungsrate. Mögliche Werte sind: 2400, 4800, 7200, 9600, 12000 oder 14400.", + "MAXRATE": "Maximale Übertragungsrate. Mögliche Werte sind: 2400, 4800, 7200, 9600, 12000 oder 14400.", "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", - "MANDATORYDISPOSITION": "Zwingende Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Status für Zwangsdisposition anhalten" + "MANDATORYDISPOSITION": "Qualifizierung erforderlich", + "MANDATORYDISPOSITIONPAUSEID": "Agentenstatus während Qualifizierung" }, - "ADVANCED": "Erweiterte", + "ADVANCED": "Erweitert", "ECM": "ECM", "MINRATE": "Min. Geschwindigkeit", "MAXRATE": "Max. Geschwindigkeit", "MODEM": "Modem", "GATEWAY": "Gateway", - "FAXDETECT": "Fax Erkennung", + "FAXDETECT": "Faxerkennung", "T38TIMEOUT": "T.38-Timeout", "SIP": "Technologie", - "HEADERINFO": "Header-info", - "SELECTED": "Ausgewählte", - "SELECT_ALL": "Alle auswählen", - "SELECT_NONE": "Wählen Sie \"Keine\"", + "HEADERINFO": "Header-Info", + "SELECTED": "Ausgewählt", + "SELECT_ALL": "Alles auswählen", + "SELECT_NONE": "Nichts auswählen", "BACK": "Zurück", "FAX": "Fax", - "ID": "Id", - "TIMEOUT": "Timeout", - "FAXDISPOSITIONS": "Fax Disposition", - "NO_FAXDISPOSITION_AVAILABLE": "Kein Fax Dispositionen verfügbar", - "NEW_FAXDISPOSITION": "Neue Fax Disposition", - "ADD_FAXDISPOSITION": "Fax Disposition hinzufügen", - "EDIT_FAXDISPOSITION": "Fax Disposition bearbeiten", + "ID": "ID", + "TIMEOUT": "Zeitüberschreitung", + "FAXDISPOSITIONS": "Qualifizierung", + "NO_FAXDISPOSITION_AVAILABLE": "Keine Qualifizierungen verfügbar", + "NEW_FAXDISPOSITION": "Neue Fax-Qualifizierung", + "ADD_FAXDISPOSITION": "Qualifizierung hinzufügen", + "EDIT_FAXDISPOSITION": "Qualifizierung bearbeiten", "DELETE_FAXDISPOSITION": "Fax Disposition löschen", "NEW_FAXQUEUE": "Neue Warteschlange", - "NEW_FAXACCOUNT": "Neue Fax Konto", - "NO_AVAILABLE_INFO": "Keine verfügbaren Info", - "ALL_TEAMS": "Alle Mannschaften", + "NEW_FAXACCOUNT": "Neue Fax-Konto", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", + "ALL_TEAMS": "Alle Teams", "SELECTED_TEAMS": "Ausgewählte Teams", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "Von", + "OF": "von", "DELETE": "Löschen", "KEY": "Schlüssel", "ALL_AGENTS": "Alle Agenten", @@ -138,124 +138,124 @@ "CLOSED": "Geschlossen", "OPENED": "Geöffnet", "SELECT_ACCOUNT": "Konto auswählen", - "INTERACTIONS": "Wechselwirkungen", + "INTERACTIONS": "Interaktionen", "CONTACT": "Kontakt", - "STARTEDAT": "Gestartet am", + "STARTEDAT": "Begonnen am", "STATUS": "Status", "ACCOUNT": "Konto", - "GOTO_FAXACCOUNT": "In Echtzeit, Faxgerät", + "GOTO_FAXACCOUNT": "Zum Fax-Konto gehen", "ACCOUNTS": "Konten", - "GOTOREALTIME_FAXACCOUNT": "In Echtzeit, Faxgerät", - "TRUNK_STATUS": "Trunk Status", - "TRUNKS": "Amtsleitungen", + "GOTOREALTIME_FAXACCOUNT": "Direkt zur Echtzeit-Ansicht", + "TRUNK_STATUS": "Status SIP-Trunk", + "TRUNKS": "SIP-Trunks", "REGISTRY": "Registrierung", - "NO_REGISTRY": "Keine Registry", - "PAUSE": "Pause", - "INFO": "Info", - "FULLNAME": "Fullname", - "INTERNAL": "Interne", - "PHONE_STATE": "Telefonstatus", - "PHONE_STATUS": "Telefonstatus", - "LOGOUT": "An-/Abmelden", - "DEFAULT_PAUSE": "Standard Pause", - "AGENTADD_QUEUE": "Agent Fax Warteschlange hinzufügen", - "AGENTSADD_QUEUE": "Agenten zu Fax Warteschlange hinzufügen", - "UNPAUSE": "Pause", + "NO_REGISTRY": "Nicht registriert", + "PAUSE": "Pausenstatus vergeben", + "INFO": "Information", + "FULLNAME": "Vollständiger Name", + "INTERNAL": "Intern", + "PHONE_STATE": "Status Nebenstelle", + "PHONE_STATUS": "Status SIP", + "LOGOUT": "Agenten An-/Abmelden", + "DEFAULT_PAUSE": "Standard-Pause", + "AGENTADD_QUEUE": "Agenten hinzufügen", + "AGENTSADD_QUEUE": "Agenten hinzufügen", + "UNPAUSE": "Pause beenden", "AGENTS": "Agenten", "QUEUES": "Warteschlangen", "LOGGED_IN": "Angemeldet", - "PAUSED": "Angehalten", + "PAUSED": "in Pause", "READY": "Bereit", - "WAITING": "Warten", + "WAITING": "Wartezustand", "PRIORITY": "Priorität", - "CONDITION": "Zustand", - "TRUEPRIORITY": "Wahre Priorität", - "FALSEPRIORITY": "Falsche Priorität", + "CONDITION": "Bedingung", + "TRUEPRIORITY": "Priorität bei 'wahr'", + "FALSEPRIORITY": "Priorität bei 'falsch'", "VALUE": "Wert", - "EDIT_AGENT": "Agent bearbeiten", - "EDIT_GOTO": "Bearbeiten Gehe zu", - "EDIT_NOOP": "Bearbeiten Noop", + "EDIT_AGENT": "Agenten bearbeiten", + "EDIT_GOTO": "GoTo bearbeiten", + "EDIT_NOOP": "NoOp bearbeiten", "EDIT_GOTOP": "GotoP bearbeiten", - "EDIT_GOTOIF": "Bearbeiten GotoIf", - "EDIT_QUEUE": "Fax Warteschlange bearbeiten", - "EDIT_CLOSE": "Bearbeiten Schließen", + "EDIT_GOTOIF": "GotoIf bearbeiten", + "EDIT_QUEUE": "Warteschlange bearbeiten", + "EDIT_CLOSE": "Verhalten bei Schließen bearbeiten", "QUEUE": "Warteschlange", - "GOTOIF": "GotoIf", - "GOTOP": "GotoP", - "NOOP": "Noop", + "GOTOIF": "Bedingter Absprung (GotoIf)", + "GOTOP": "Absprung auf Anwendung (GotoP)", + "NOOP": "Log erstellen (NoOp)", "AGENT": "Agent", - "NOTES": "Hinweise", - "CLOSEDAT": "Geschlossen", - "DISPOSITION": "Disposition", - "REALTIME": "Echtzeit", + "NOTES": "Anmerkungen", + "CLOSEDAT": "Geschlossen am", + "DISPOSITION": "Qualifizierung", + "REALTIME": "Echtzeit-Ansicht", "UNKNOWN": "Unbekannt", - "UNREGISTERED": "Unregistrierte", + "UNREGISTERED": "Nicht registriert", "UNAVAILABLE": "Nicht verfügbar", - "NOT_INUSE": "Nicht in Gebrauch", + "NOT_INUSE": "Nicht in Verwendung", "REACHABLE": "Erreichbar", - "IN_USE": "Im Einsatz", - "VOICE": "Voice", + "IN_USE": "In Verwendung", + "VOICE": "Sprachanrufe (Voice)", "CHAT": "Chat", "MAIL": "E-Mail", "SMS": "SMS", "OPENCHANNEL": "Offener Kanal", "NO_AGENT_ONLINE": "Kein Agent Online", - "GOTOREALTIME_FAXQUEUE": "In Echtzeit Fax Warteschlange", - "EDIT_TRUNK": "Bearbeiten Trunk", + "GOTOREALTIME_FAXQUEUE": "Direkt zur Echtzeit-Ansicht", + "EDIT_TRUNK": "SIP-Trunk bearbeiten", "REGISTERED": "Registriert", - "EDIT_ACCOUNT": "Fax Konto bearbeiten", - "PARTIALPAUSE": "Teilweise Pause", + "EDIT_ACCOUNT": "Fax-Konto bearbeiten", + "PARTIALPAUSE": "Teilpause", "BUSY": "Besetzt", "TIMER": "Timer", "IDLE": "Leerlauf", "CAPACITY": "Kapazität", - "TOTAL": "Insgesamt", - "IN": "In", - "OUT": "Aus", - "NO_INTERACTION_AVAILABLE": "Es sind keine Wechselwirkungen zur Verfügung", + "TOTAL": "Gesamt", + "IN": "Eingehend", + "OUT": "Ausgehend", + "NO_INTERACTION_AVAILABLE": "Keine Interaktionen verfügbar", "TAGS": "Tags", - "REPLY": "Antwort", + "REPLY": "Antworten", "SEND": "Senden", - "TO": "Zu", + "TO": "An", "FROM": "Von", - "INTERACTIONS_FAXACCOUNT": "Zu Wechselwirkungen gehen", - "REFRESH_INTERACTIONS": "Aktualisieren Interaktionen", + "INTERACTIONS_FAXACCOUNT": "Zu Interaktionen gehen", + "REFRESH_INTERACTIONS": "Interaktionen aktualisieren", "NO_FAXCANNEDANSWER_AVAILABLE": "Keine vordefinierten Antworten verfügbar", "NEW_FAXCANNEDANSWER": "Neue vordefinierte Antwort", "ADD_FAXCANNEDANSWER": "Vordefinierte Antwort hinzufügen", "EDIT_CHATCANNEDANSWER": "Vordefinierte Antwort bearbeiten", "DELETE_CHATCANNEDANSWER": "Vordefinierte Antwort löschen", - "SPYINTERACTION": "Spion", + "SPYINTERACTION": "Interaktion anzeigen", "DELETE_INTERACTION": "Interaktion löschen", - "COMMAND": "Befehl", + "COMMAND": "Eingabe", "EDIT_SYSTEM": "System bearbeiten", "SYSTEM": "System", "VARIABLE": "Variable", "NOTIFICATION": "Benachrichtigung", - "NOTIFICATIONSHAKE": "Shake", - "NOTIFICATIONSOUND": "Klingen", + "NOTIFICATIONSHAKE": "Schütteln", + "NOTIFICATIONSOUND": "Ton abspielen", "NOTIFICATIONTEMPLATE": "Vorlage", - "WAITFORTHEASSIGNEDAGENT": "Warte auf den zugewiesenen Agenten", + "WAITFORTHEASSIGNEDAGENT": "Auf zugewiesenen Agenten warten", "EDIT_TAG": "Tag bearbeiten", - "TAG": "Etikett", - "AGENTADD_FAXACCOUNT": "Fügen Sie dem Faxkonto einen Agenten hinzu", - "AGENTTRANSFER": "Agent Transfer", + "TAG": "Tag", + "AGENTADD_FAXACCOUNT": "Agenten hinzufügen", + "AGENTTRANSFER": "Transfer an Agenten erlauben", "AGENTTRANSFERTIMEOUT": "Zeitüberschreitung für Agententransfer", - "QUEUETRANSFER": "Warteschlangenübertragung", - "QUEUETRANSFERTIMEOUT": "Warteschlangenübertragungs-Timeout", + "QUEUETRANSFER": "Transfer an Warteschlange erlauben", + "QUEUETRANSFERTIMEOUT": "Zeitüberschreitung Warteschlangentransfer", "TRANSFER": "Transfer", "CANNEDANSWERS": "Vordefinierte Antworten", "DOWNLOAD_INTERACTION": "Herunterladen", "FAXCANNEDANSWERS": "Vordefinierte Antworten", - "LOGIN_TIME": "Login-Zeit", - "PAUSE_TIME": "Pausenzeit", - "TEAMS_ASSOCIATION": "Vereinigung der Mannschaften", - "MANDATORYDISPOSITION": "Zwingende Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Status pausieren, wenn die Disposition obligatorisch ist", - "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", - "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download ohne Anhänge", - "DOWNLOAD_WITH_ATTACHMENTS": "Mit Anhängen herunterladen", + "LOGIN_TIME": "Zeit angemeldet", + "PAUSE_TIME": "Zeit in Pause", + "TEAMS_ASSOCIATION": "Teamzuweisung", + "MANDATORYDISPOSITION": "Qualifizierung erforderlich", + "MANDATORYDISPOSITIONPAUSEID": "Agentenstatus während Qualifizierung", + "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufzeichnung deaktiviert", + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufzeichnung aktiv", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Herunterladen ohne Anhänge", + "DOWNLOAD_WITH_ATTACHMENTS": "Herunterladen inkl. Anhängen", "LASTMESSAGE": "Letzte Nachricht" } } diff --git a/public/app/main/apps/fax/i18n/is.json b/public/app/main/apps/fax/i18n/is.json index bc9aa75..dee598e 100644 --- a/public/app/main/apps/fax/i18n/is.json +++ b/public/app/main/apps/fax/i18n/is.json @@ -44,7 +44,7 @@ "IDLE": "Idle", "CAPACITY": "Capacity", "GOTO_FAXACCOUNT": "Go To Realtime Fax", - "ACCOUNTS": "Accounts", + "ACCOUNTS": "Aðgangar", "GOTOREALTIME_FAXACCOUNT": "Go To Realtime Fax", "TRUNK_STATUS": "Trunk Status", "TRUNKS": "Trunks", @@ -154,17 +154,17 @@ "GENERAL": "General", "FAXACCOUNTS": "Fax Accounts", "MOTIONADDRESS": "Motion Address", - "ADD_FAXACCOUNT": "Add Fax Account", + "ADD_FAXACCOUNT": "Add fax account", "EDIT_FAXACCOUNT": "Edit Fax Account", "DELETE_FAXACCOUNT": "Delete Fax Account", "DISPOSITIONS": "Dispositions", "WEBHOOKS": "WebHooks", - "ACTIONS": "Actions", + "ACTIONS": "Aðgerðir", "LIST": "List", "FIDELITY": "Fidelity", - "ACCEPT": "Accept", - "ACCEPTMETHOD": "Accept Method", - "ACCEPTURL": "Accept URL", + "ACCEPT": "Samþykkja", + "ACCEPTMETHOD": "Samþykkja aðferð", + "ACCEPTURL": "Samþykkja URL", "REJECT": "Reject", "REJECTMETHOD": "Reject Method", "REJECTURL": "Reject URL", @@ -233,7 +233,7 @@ "STARTEDAT": "Started At", "LASTMESSAGE": "Last message", "STATUS": "Status", - "ACCOUNT": "Account", + "ACCOUNT": "Aðgangur", "UNKNOWN": "Unknown", "UNAVAILABLE": "Unavailable", "NOT_INUSE": "Not in use", diff --git a/public/app/main/apps/fax/i18n/pt-BR.json b/public/app/main/apps/fax/i18n/pt-BR.json index 3b562c6..0b91115 100644 --- a/public/app/main/apps/fax/i18n/pt-BR.json +++ b/public/app/main/apps/fax/i18n/pt-BR.json @@ -41,7 +41,7 @@ "PARTIALPAUSE": "Pausa Parcial", "BUSY": "Ocupado", "TIMER": "Tempo", - "IDLE": "Ocioso", + "IDLE": "Disponível", "CAPACITY": "Capacidade", "GOTO_FAXACCOUNT": "Ir para fax em tempo real", "ACCOUNTS": "Contas", diff --git a/public/app/main/apps/help/i18n/is.json b/public/app/main/apps/help/i18n/is.json index 4c1be43..3b70cb6 100644 --- a/public/app/main/apps/help/i18n/is.json +++ b/public/app/main/apps/help/i18n/is.json @@ -1,8 +1,8 @@ { "HELP": { - "ABOUT": "About", - "CONTACT_US": "Contact us", - "HELP": "Help", - "USEFUL_LINKS": "Useful links" + "ABOUT": "Um", + "CONTACT_US": "Hafðu samband við Svar", + "HELP": "Hjálp", + "USEFUL_LINKS": "Nytsamlegir hlekkir" } } diff --git a/public/app/main/apps/integrations/i18n/de.json b/public/app/main/apps/integrations/i18n/de.json index 83085e4..f5edc9a 100644 --- a/public/app/main/apps/integrations/i18n/de.json +++ b/public/app/main/apps/integrations/i18n/de.json @@ -1,64 +1,64 @@ { "INTEGRATIONS": { "INTEGRATIONS": "Integrationen", - "ZENDESKACCOUNTS": "Zendesk Konten", - "ID": "Id", + "ZENDESKACCOUNTS": "Zendesk-Konten", + "ID": "ID", "NAME": "Name", - "USERNAME": "Benutzername", + "USERNAME": "Nutzername", "URI": "URL", "BACK": "Zurück", - "SELECTED": "Ausgewählte", - "SELECT_ALL": "Alle auswählen", - "SELECT_NONE": "Wählen Sie \"Keine\"", - "EDIT_ZENDESKACCOUNT": "Bearbeiten von Zendesk Konto", - "DELETE_ZENDESKACCOUNT": "Löschen von Zendesk Konto", - "NEW_ZENDESKACCOUNT": "Neue Zendesk Konto", + "SELECTED": "Ausgewählt", + "SELECT_ALL": "Alles auswählen", + "SELECT_NONE": "Nichts auswählen", + "EDIT_ZENDESKACCOUNT": "Zendesk-Konto bearbeiten", + "DELETE_ZENDESKACCOUNT": "Zendesk-Konto löschen", + "NEW_ZENDESKACCOUNT": "Neues Zendesk-Konto", "AUTHTYPE": "Authentifizierungstyp", "PASSWORD": "Passwort", "CONFIRM_PASSWORD": "Passwort bestätigen", "TOKEN": "Token", "MOTIONPROXYADDRESS": "Motion oder Proxy-IP-Adresse", "DESCRIPTION": "Beschreibung", - "ADD_ZENDESKACCOUNT": "Konto hinzufügen ZENDESK", + "ADD_ZENDESKACCOUNT": "Neues Zendesk-Konto", "ERRORS": { - "NAME_REQUIRED": "Der Name ist erforderlich", - "USERNAME_REQUIRED": "Der Benutzername ist erforderlich", - "URI_REQUIRED": "Die URL ist erforderlich", - "URI_MUST_VALID_URL": "Der URL muss schriftlich in einem gültigen Format", - "PASSWORD_REQUIRED": "Das Kennwort ist erforderlich", - "CONFIRM_NOT_MATCH": "Die Kennwörter nicht übereinstimmen", - "TOKEN_REQUIRED": "Das Token ist erforderlich", - "MOTIONPROXYADDRESS_MUST_VALID_URL": "Die Adresse muss in einem gültigen Format", - "CLIENTID_REQUIRED": "Die Client-ID ist erforderlich", - "CLIENTSECRET_REQUIRED": "Der Client ist erforderlich", - "SECURITYTOKEN_REQUIRED": "Der Sicherheitsschlüssel ist erforderlich", - "APIKEY_REQUIRED": "Die API-Schlüssel erforderlich ist", - "CONTENT_REQUIRED": "Der Inhalt ist erforderlich", - "VARIABLENAME_REQUIRED": "Die Variable ist erforderlich", - "KEY_REQUIRED": "Der Schlüssel ist erforderlich", - "TYPE_REQUIRED": "Der Typ ist erforderlich", - "VALUE_REQUIRED": "Der Wert ist erforderlich", - "FIELD_REQUIRED": "Das Feld ist erforderlich.", - "CONSUMERKEY_REQUIRED": "Der Verbraucher Schlüssel ist erforderlich", - "CONSUMERSECRET_REQUIRED": "Der Verbraucher Geheimnis ist erforderlich", - "TOKENSECRET_REQUIRED": "Das Token Geheimnis ist erforderlich", - "HOST_REQUIRED": "Der Host wird benötigt", - "AUTHTOKEN_REQUIRED": "Die autorization Token ist erforderlich", - "ACCESS_KEY_REQUIRED": "Pflichtfeld", - "VTIGER_USER_NAME_REQUIRED": "Pflichtfeld", - "TENANTID_REQUIRED": "Pflichtfeld", - "EMAIL_REQUIRED": "Pflichtfeld", - "CODE_REQUIRED": "Pflichtfeld", - "MOTIONPROXYADDRESS_REQUIRED": "Pflichtfeld", - "MODULECREATE_REQUIRED": "Pflichtfeld" + "NAME_REQUIRED": "Name erforderlich", + "USERNAME_REQUIRED": "Nutzername erforderlich", + "URI_REQUIRED": "URL erforderlich", + "URI_MUST_VALID_URL": "Ungültiges Format URL", + "PASSWORD_REQUIRED": "Passwort erforderlich", + "CONFIRM_NOT_MATCH": "Die Passwörter stimmen nicht überein", + "TOKEN_REQUIRED": "Token erforderlich", + "MOTIONPROXYADDRESS_MUST_VALID_URL": "Ungültiges Format URL", + "CLIENTID_REQUIRED": "Client-ID erforderlich", + "CLIENTSECRET_REQUIRED": "Client-Secret erforderlich", + "SECURITYTOKEN_REQUIRED": "Sicherheitsschlüssel erforderlich", + "APIKEY_REQUIRED": "API-Schlüssel erforderlich", + "CONTENT_REQUIRED": "Inhalt erforderlich", + "VARIABLENAME_REQUIRED": "Variable erforderlich", + "KEY_REQUIRED": "Schlüssel erforderlich", + "TYPE_REQUIRED": "Typ erforderlich", + "VALUE_REQUIRED": "Wert erforderlich", + "FIELD_REQUIRED": "Feld erforderlich.", + "CONSUMERKEY_REQUIRED": "Consumer-Key erforderlich", + "CONSUMERSECRET_REQUIRED": "Consumer-Secret erforderlich", + "TOKENSECRET_REQUIRED": "Token-Secret erforderlich", + "HOST_REQUIRED": "Host erforderlich", + "AUTHTOKEN_REQUIRED": "Token für Authentifizierung erforderlich", + "ACCESS_KEY_REQUIRED": "Zugangsschlüssel erforderlich", + "VTIGER_USER_NAME_REQUIRED": "vTiger-Nutzername erforderlich", + "TENANTID_REQUIRED": "Tenant-ID erforderlich", + "EMAIL_REQUIRED": "E-Mail erforderlich", + "CODE_REQUIRED": "Code erforderlich", + "MOTIONPROXYADDRESS_REQUIRED": "Adresse erforderlich", + "MODULECREATE_REQUIRED": "Modul erforderlich" }, "HELP": { - "MOTIONPROXYADDRESS": "Bewegung (Proxy) Adresse: Es ist obligatorisch, wenn Sie wollen, füllen Sie das Ticket mit Neucodierungen URL. Bitte geben Sie im folgenden Format ein: ≪protocol> : //[:]. Beispiel: https://X.Y.Z.W", + "MOTIONPROXYADDRESS": "URL für Anfragen und Verbindung", "TICKETTYPE": "Art des Tickets", - "CLIENTID": "Die spezifische CLient-ID Ihrer Anwendung", - "CLIENTSECRET": "Das spezifische CLientSecret Ihrer Anwendung", + "CLIENTID": "Die spezifische Client-ID Ihrer Anwendung", + "CLIENTSECRET": "Das spezifische ClientSecret Ihrer Anwendung", "CODE": "Der spezifische Code, der über die Entwicklerkonsole generiert wird", - "REFRESHTOKEN": "Das automatisch generierte Aktualisierungstoken, mit dem abgelaufene Zugriffstoken aktualisiert werden. Außerdem wird das Zugriffstoken bei jedem Start einer API automatisch generiert.", + "REFRESHTOKEN": "Automatisch generierter Token beim Start der API", "ZONE": "Wählen Sie Ihre geografische Zone (US, AU, EU, IN, CN), um die domänenspezifischen Zoho-Konten zu aktivieren", "ADDITIONALSEARCHACCOUNT": "Zusätzlicher Feldname für die Suche nach der Telefonnummer des Kunden in den Konten", "ADDITIONALSEARCHCONTACT": "Zusätzlicher Feldname für die Suche nach der Telefonnummer des Kunden in den Kontakten", @@ -67,69 +67,69 @@ "MODERN_AUTHENTICATION": "Wechseln Sie, um die moderne Authentifizierung zu aktivieren" }, "ACCOUNT": "Konto", - "ZENDESKCONFIGURATIONS": "Zendesk Konfigurationen", + "ZENDESKCONFIGURATIONS": "Zendesk-Konfigurationen", "SALESFORCECONFIGURATIONS": "Salesforce-Konfigurationen", "SUGARCRMCONFIGURATIONS": "SugarCRM-Konfigurationen", "FRESHDESKCONFIGURATIONS": "Freshdesk-Konfigurationen", "GENERAL": "Allgemein", "CREATED_AT": "Erstellt am", "SAVE": "Speichern", - "NO_ZENDESKCONFIGURATION_AVAILABLE": "Keine Zendesk Konfigurationen erhältlich", - "NEW_ZENDESKCONFIGURATION": "Neue Zendesk Konfiguration", - "ADD_ZENDESKCONFIGURATION": "Hinzufügen von Zendesk Konfiguration", - "EDIT_ZENDESKCONFIGURATION": "Bearbeiten der Konfiguration Zendesk", - "DELETE_ZENDESKCONFIGURATION": "Löschen der Konfiguration Zendesk", - "NO_SALESFORCECONFIGURATION_AVAILABLE": "Ohne Salesforce Konfigurationen erhältlich", - "NEW_SALESFORCECONFIGURATION": "Neue Salesforce Konfiguration", - "ADD_SALESFORCECONFIGURATION": "Salesforce Konfiguration hinzufügen", - "EDIT_SALESFORCECONFIGURATION": "Salesforce Konfiguration bearbeiten", - "DELETE_SALESFORCECONFIGURATION": "Salesforce Konfiguration löschen", - "NO_SUGARCRMCONFIGURATION_AVAILABLE": "Keine SugarCRM-Konfigurationen", + "NO_ZENDESKCONFIGURATION_AVAILABLE": "Keine Zendesk-Konfiguration verfügbar", + "NEW_ZENDESKCONFIGURATION": "Neue Zendesk-Konfiguration", + "ADD_ZENDESKCONFIGURATION": "Zendesk-Konfiguration hinzufügen", + "EDIT_ZENDESKCONFIGURATION": "Zendesk-Konfiguration bearbeiten", + "DELETE_ZENDESKCONFIGURATION": "Zendesk-Konfiguration löschen", + "NO_SALESFORCECONFIGURATION_AVAILABLE": "Keine Salesforce-Konfiguration verfügbar", + "NEW_SALESFORCECONFIGURATION": "Neue Salesforce-Konfiguration", + "ADD_SALESFORCECONFIGURATION": "Salesforce-Konfiguration hinzufügen", + "EDIT_SALESFORCECONFIGURATION": "Salesforce-Konfiguration bearbeiten", + "DELETE_SALESFORCECONFIGURATION": "Salesforce-Konfiguration löschen", + "NO_SUGARCRMCONFIGURATION_AVAILABLE": "Keine SugarCRM-Konfiguration verfügbar", "NEW_SUGARCRMCONFIGURATION": "Neue SugarCRM-Konfiguration", "ADD_SUGARCRMCONFIGURATION": "SugarCRM-Konfiguration hinzufügen", - "EDIT_SUGARCRMCONFIGURATION": "Bearbeiten von SugarCRM-Konfiguration", - "DELETE_SUGARCRMCONFIGURATION": "Löschen von SugarCRM-Konfiguration", - "NO_FRESHDESKCONFIGURATION_AVAILABLE": "Freshdesk keine Konfigurationen erhältlich", - "NEW_FRESHDESKCONFIGURATION": "Neue Freshdesk Konfiguration", - "ADD_FRESHDESKCONFIGURATION": "Freshdesk Konfiguration hinzufügen", - "EDIT_FRESHDESKCONFIGURATION": "Bearbeiten Sie Freshdesk Konfiguration", - "DELETE_FRESHDESKCONFIGURATION": "Löschen Sie Freshdesk Konfiguration", - "SALESFORCEACCOUNTS": "Salesforce Konten", - "EDIT_SALESFORCEACCOUNT": "Salesforce Konto bearbeiten", - "DELETE_SALESFORCEACCOUNT": "Löschen Sie Salesforce Konto", - "NEW_SALESFORCEACCOUNT": "Neue Salesforce Konto", - "ADD_SALESFORCEACCOUNT": "Salesforce hinzufügen Konto", + "EDIT_SUGARCRMCONFIGURATION": "SugarCRM-Konfiguration bearbeiten", + "DELETE_SUGARCRMCONFIGURATION": "SugarCRM-Konfiguration löschen", + "NO_FRESHDESKCONFIGURATION_AVAILABLE": "Keine Freshdesk-Konfiguration verfügbar", + "NEW_FRESHDESKCONFIGURATION": "Neue Freshdesk-Konfiguration", + "ADD_FRESHDESKCONFIGURATION": "Freshdesk-Konfiguration hinzufügen", + "EDIT_FRESHDESKCONFIGURATION": "Freshdesk-Konfiguration bearbeiten", + "DELETE_FRESHDESKCONFIGURATION": "Freshdesk-Konfiguration löschen", + "SALESFORCEACCOUNTS": "Salesforce-Konten", + "EDIT_SALESFORCEACCOUNT": "Salesforce-Konto bearbeiten", + "DELETE_SALESFORCEACCOUNT": "Salesforce-Konto löschen", + "NEW_SALESFORCEACCOUNT": "Neues Salesforce-Konto", + "ADD_SALESFORCEACCOUNT": "Salesforce-Konto hinzufügen", "CLIENTID": "Client-ID", - "CLIENTSECRET": "Client Geheimnis", + "CLIENTSECRET": "Client Secret", "SECURITYTOKEN": "Sicherheitstoken", - "SEARCH_FOR_ANYONE": "Suche für Jedermann", - "APIKEY": "Api-Schlüssel", - "FRESHDESKACCOUNTS": "Freshdesk Konten", - "EDIT_FRESHDESKACCOUNT": "Freshdesk Konto bearbeiten", - "DELETE_FRESHDESKACCOUNT": "Löschen Sie Freshdesk Konto", - "NEW_FRESHDESKACCOUNT": "Neue Freshdesk Konto", - "ADD_FRESHDESKACCOUNT": "Fügen Sie Freshdesk Konto", + "SEARCH_FOR_ANYONE": "Suche", + "APIKEY": "API-Schlüssel", + "FRESHDESKACCOUNTS": "Freshdesk-Konten", + "EDIT_FRESHDESKACCOUNT": "Freshdesk-Konto bearbeiten", + "DELETE_FRESHDESKACCOUNT": "Freshdesk-Konto löschen", + "NEW_FRESHDESKACCOUNT": "Neues Freshdesk-Konto", + "ADD_FRESHDESKACCOUNT": "Freshdesk-Konto hinzufügen", "SUGARCRMACCOUNTS": "SugarCRM-Konten", - "EDIT_SUGARCRMACCOUNT": "Bearbeiten von SugarCRM Konto", - "DELETE_SUGARCRMACCOUNT": "Löschen von SugarCRM Konto", - "NEW_SUGARCRMACCOUNT": "Neues Konto für SugarCRM", - "ADD_SUGARCRMACCOUNT": "SugarCRM Konto hinzufügen", + "EDIT_SUGARCRMACCOUNT": "SugarCRM-Konto bearbeiten", + "DELETE_SUGARCRMACCOUNT": "SugarCRM-Konto löschen", + "NEW_SUGARCRMACCOUNT": "Neues SugarCRM-Konto", + "ADD_SUGARCRMACCOUNT": "SugarCRM-Konto hinzufügen", "CONFIGURATIONS": "Konfigurationen", "NO_CONFIGURATION_AVAILABLE": "Keine Konfigurationen verfügbar", "NEW_CONFIGURATION": "Neue Konfiguration", "ADD_CONFIGURATION": "Konfiguration hinzufügen", "EDIT_CONFIGURATION": "Konfiguration bearbeiten", - "DELETE_CONFIGURATION": "Löschen der Konfiguration", + "DELETE_CONFIGURATION": "Konfiguration löschen", "SUBJECTS": "Themen", "DESCRIPTIONS": "Beschreibungen", "FIELDS": "Felder", "TAGS": "Tags", "TYPE": "Typ", "CONTENT": "Inhalt", - "EDIT_SUBJECT": "Betreff bearbeiten", - "DELETE_SUBJECT": "Löschen von Themen", + "EDIT_SUBJECT": "Thema bearbeiten", + "DELETE_SUBJECT": "Thema Löschen", "NEW_SUBJECT": "Neues Thema", - "ADD_SUBJECT": "Betreff hinzufügen", + "ADD_SUBJECT": "Thema hinzufügen", "EDIT_DESCRIPTION": "Beschreibung bearbeiten", "DELETE_DESCRIPTION": "Beschreibung löschen", "NEW_DESCRIPTION": "Neue Beschreibung", @@ -139,7 +139,7 @@ "NEW_FIELD": "Neues Feld", "ADD_FIELD": "Feld hinzufügen", "ADD": "Hinzufügen", - "VOICE": "Voice", + "VOICE": "Sprachanrufe", "MAIL": "E-Mail", "CHAT": "Chat", "SMS": "SMS", @@ -151,83 +151,83 @@ "KEY": "Schlüssel", "CHANNEL": "Kanal", "DELETE": "Löschen", - "NO_AVAILABLE_INFO": "Keine verfügbaren Info", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", "TEST_ZENDESKACCOUNT": "Test Zendesk Konto", "TEST_FRESHDESKACCOUNT": "Test Freshdesk Konto", "TEST_SUGARCRMACCOUNT": "Test SugerCRM Konto", - "TEST_SALESFORCEACCOUNT": "Testen Sie Salesforce Konto", - "INTEGRATION_TAB": "Register Integration", + "TEST_SALESFORCEACCOUNT": "Teste Salesforce Konto", + "INTEGRATION_TAB": "Tab für Integration", "NEW_TAB": "Neue Registerkarte", - "DESKACCOUNTS": "Schreibtisch Konten", - "EDIT_DESKACCOUNT": "Schreibtisch Konto bearbeiten", - "TEST_DESKACCOUNT": "Test Schreibtisch Konto", - "DELETE_DESKACCOUNT": "Schreibtisch Konto löschen", - "CONSUMERKEY": "Verbraucher Schlüssel", - "CONSUMERSECRET": "Verbraucher Geheimnis", - "TOKENSECRET": "Token Geheimnis", - "ADD_DESKACCOUNT": "Hinzufügen Schreibtisch Konto", - "NEW_DESKACCOUNT": "Neuer Schreibtisch Konto", - "ADD_DESKCONFIGURATION": "Hinzufügen Schreibtisch Konfiguration", - "NEW_DESKCONFIGURATION": "Neuer Schreibtisch Konfiguration", - "DELETE_DESKCONFIGURATION": "Schreibtisch Konfiguration löschen", - "ZOHOACCOUNTS": "Zoho Konten", - "EDIT_ZOHOACCOUNT": "Zoho Konto bearbeiten", - "TEST_ZOHOACCOUNT": "Test Zoho Konto", - "DELETE_ZOHOACCOUNT": "Zoho Konto löschen", - "ADD_ZOHOACCOUNT": "Zoho Konto hinzufügen", - "NEW_ZOHOACCOUNT": "Neue Zoho Konto", - "ADD_ZOHOCONFIGURATION": "Hinzufügen Zoho Konfiguration", - "NEW_ZOHOCONFIGURATION": "Neue Zoho Konfiguration", - "AUTHTOKEN": "Genehmigung Token", + "DESKACCOUNTS": "Desk-Konten", + "EDIT_DESKACCOUNT": "Desk-Konto bearbeiten", + "TEST_DESKACCOUNT": "Test Desk-Konto", + "DELETE_DESKACCOUNT": "Desk-Konto löschen", + "CONSUMERKEY": "Consumer Key", + "CONSUMERSECRET": "Consumer Secret", + "TOKENSECRET": "Token Secret", + "ADD_DESKACCOUNT": "Desk-Konto hinzufügen", + "NEW_DESKACCOUNT": "Neues Desk-Konto", + "ADD_DESKCONFIGURATION": "Desk-Konfiguration hinzufügen", + "NEW_DESKCONFIGURATION": "Neue Desk-Konfiguration", + "DELETE_DESKCONFIGURATION": "Desk-Konfiguration löschen", + "ZOHOACCOUNTS": "Zoho-Konten", + "EDIT_ZOHOACCOUNT": "Zoho-Konto bearbeiten", + "TEST_ZOHOACCOUNT": "Test Zoho-Konto", + "DELETE_ZOHOACCOUNT": "Zoho-Konto löschen", + "ADD_ZOHOACCOUNT": "Zoho-Konto hinzufügen", + "NEW_ZOHOACCOUNT": "Neues Zoho-Konto", + "ADD_ZOHOCONFIGURATION": "Zoho-Konfiguration hinzufügen", + "NEW_ZOHOCONFIGURATION": "Neue Zoho-Konfiguration", + "AUTHTOKEN": "Token für Authentifizierung", "HOST": "Host", - "DELETE_ZOHOCONFIGURATION": "Zoho Konfiguration löschen", + "DELETE_ZOHOCONFIGURATION": "Zoho-Konfiguration löschen", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "Von", - "ADVANCED": "Erweiterte", + "OF": "von", + "ADVANCED": "Erweitert", "MODULE_SEARCH": "Modul Suche", "MODULE_CREATE": "Module erstellen", "ACCESS_KEY": "vTiger Access Key", "ADD_VTIGERACCOUNT": "Neues vTiger-Konto hinzufügen", - "ADD_VTIGERCONFIGURATION": "Fügen Sie die vTiger-Konfiguration hinzu", - "DELETE_VTIGERACCOUNT": "Löschen Sie das vTiger-Konto", - "DELETE_VTIGERCONFIGURATION": "Löschen Sie die vTiger-Konfiguration", - "EDIT_VTIGERACCOUNT": "VTiger-Konto bearbeiten", + "ADD_VTIGERCONFIGURATION": "vTiger-Konfiguration hinzufügen", + "DELETE_VTIGERACCOUNT": "vTiger-Konto löschen", + "DELETE_VTIGERCONFIGURATION": "vTiger-Konfiguration löschen", + "EDIT_VTIGERACCOUNT": "vTiger-Konto bearbeiten", "MODULE_NAME": "vTiger-Modulname", "NEW_VTIGERACCOUNT": "Neues vTiger-Konto", - "NEW_VTIGERCONFIGURATION": "Erstellen Sie eine vTiger-Konfiguration", - "TEST_VTIGERACCOUNT": "Testen Sie das vTiger-Konto", + "NEW_VTIGERCONFIGURATION": "Neue vTiger-Konfiguration", + "TEST_VTIGERACCOUNT": "Test vTiger-Konto", "VTIGERACCOUNTS": "vTiger-Konten", - "VTIGER_USER_NAME": "vTiger-Benutzername", - "ADD_DYNAMICS365ACCOUNT": "Fügen Sie ein neues Dynamics365-Konto hinzu", + "VTIGER_USER_NAME": "vTiger-Nutzername", + "ADD_DYNAMICS365ACCOUNT": "Dynamics365-Konto hinzufügen", "ADD_DYNAMICS365CONFIGURATION": "Dynamics365-Konfiguration hinzufügen", - "CASE": "Fall", + "CASE": "Case", "DELETE_DYNAMICS365ACCOUNT": "Dynamics365-Konto löschen", - "DELETE_DYNAMICS365CONFIGURATION": "Löschen Sie die Dynamics365-Konfiguration", + "DELETE_DYNAMICS365CONFIGURATION": "Dynamics365-Konfiguration löschen", "DYNAMICS365ACCOUNTS": "Dynamics365-Konten", - "EDIT_DYNAMICS365ACCOUNT": "Bearbeiten Sie das Dynamics365-Konto", + "EDIT_DYNAMICS365ACCOUNT": "Dynamics365-Konto bearbeiten", "NEW_DYNAMICS365ACCOUNT": "Neues Dynamics365-Konto", - "NEW_DYNAMICS365CONFIGURATION": "Erstellen Sie eine Dynamics365-Konfiguration", + "NEW_DYNAMICS365CONFIGURATION": "Neue Dynamics365-Konfiguration", "PHONECALL": "Anruf", - "TENANTID": "Mieter-ID", - "TEST_DYNAMICS365ACCOUNT": "Testen Sie das Dynamics365-Konto", + "TENANTID": "Tenant-ID", + "TEST_DYNAMICS365ACCOUNT": "Test Dynamics365-Konto", "TICKETTYPE": "Art des Tickets", - "ADD_SERVICENOWACCOUNT": "Neuen ServiceNow Account hinzufügen", + "ADD_SERVICENOWACCOUNT": "ServiceNow-Konto hinzufügen", "ADD_SERVICENOWCONFIGURATION": "ServiceNow-Konfiguration hinzufügen", - "DELETE_SERVICENOWACCOUNT": "Löschen Sie das ServiceNow-Konto", - "DELETE_SERVICENOWCONFIGURATION": "Löschen Sie die ServiceNow-Konfiguration", - "EDIT_SERVICENOWACCOUNT": "Bearbeiten Sie das ServiceNow-Konto", - "EMAIL": "Email", + "DELETE_SERVICENOWACCOUNT": "ServiceNow-Konto löschen", + "DELETE_SERVICENOWCONFIGURATION": "ServiceNow-Konfiguration löschen", + "EDIT_SERVICENOWACCOUNT": "ServiceNow-Konto bearbeiten", + "EMAIL": "E-Mail", "NEW_SERVICENOWACCOUNT": "Neues ServiceNow-Konto", - "NEW_SERVICENOWCONFIGURATION": "Erstellen Sie eine ServiceNow-Konfiguration", + "NEW_SERVICENOWCONFIGURATION": "Neue ServiceNow-Konfiguration", "SERVICENOWACCOUNTS": "ServiceNow-Konten", - "TEST_SERVICENOWACCOUNT": "Testen Sie das ServiceNow-Konto", + "TEST_SERVICENOWACCOUNT": "Test ServiceNow-Konto", "TASK": "Aufgabe", "CODE": "Entwicklerkonsolencode", "REFRESHTOKEN": "Refresh Token (generiert)", "ZONE": "Zone", - "CONTACTS": "Kontakt", - "LEADS": "Führen", + "CONTACTS": "Kontakte", + "LEADS": "Leads", "MODULECREATE": "Modul erstellen", "ADD_FRESHSALESACCOUNT": "Freshsales-Konto hinzufügen", "ADD_FRESHSALESCONFIGURATION": "Freshsales-Konfiguration hinzufügen", @@ -239,13 +239,13 @@ "NEW_FRESHSALESACCOUNT": "Neues Freshsales-Konto", "NEW_FRESHSALESCONFIGURATION": "Neue Freshsales-Konfiguration", "NO_FRESHSALESCONFIGURATION_AVAILABLE": "Keine Freshsales-Konfigurationen verfügbar", - "TEST_FRESHSALESACCOUNT": "Testen Sie das Freshsales-Konto", - "ADDITIONALSEARCHACCOUNT": "Zusätzliches Suchkonto", - "ADDITIONALSEARCHCONTACT": "Zusätzlicher Suchkontakt", - "ADDITIONALSEARCHLEAD": "Zusätzlicher Such-Lead", - "LEADID": "Lead Id", + "TEST_FRESHSALESACCOUNT": "Test Freshsales-Konto", + "ADDITIONALSEARCHACCOUNT": "Zusätzliches Suchen nach Konto", + "ADDITIONALSEARCHCONTACT": "Zusätzliches Suchen nach Kontakt", + "ADDITIONALSEARCHLEAD": "Zusätzliches Suchen nach Leads", + "LEADID": "Lead-ID", "DYNAMIC365CONTACT": "Kontakt", - "DYNAMIC365NOTHING": "Gar nichts", + "DYNAMIC365NOTHING": "Nichts", "MODERN_AUTHENTICATION": "Moderne Authentifizierung", "OPENNEWTAB": "Neue Registerkarte öffnen" } diff --git a/public/app/main/apps/integrations/i18n/is.json b/public/app/main/apps/integrations/i18n/is.json index da1fa10..09c9339 100644 --- a/public/app/main/apps/integrations/i18n/is.json +++ b/public/app/main/apps/integrations/i18n/is.json @@ -1,252 +1,252 @@ { "INTEGRATIONS": { - "ZONE": "Zone", - "ADVANCED": "Advanced", - "MODULE_SEARCH": "Module Search", - "MODULE_CREATE": "Module Create", + "ZONE": "Svæði", + "ADVANCED": "Sértækt", + "MODULE_SEARCH": "Leita að módúl", + "MODULE_CREATE": "Stofna módúl", "LEADS": "Lead", - "CONTACTS": "Contact", - "INTEGRATIONS": "Integrations", - "ZENDESKACCOUNTS": "Zendesk Accounts", - "ID": "Id", - "NAME": "Name", - "USERNAME": "Username", + "CONTACTS": "CTengiliður", + "INTEGRATIONS": "Samþáttanir", + "ZENDESKACCOUNTS": "Zendesk reikningur", + "ID": "Auðkenni", + "NAME": "Nafn", + "USERNAME": "Notendanafn", "URI": "URL", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "EDIT_ZENDESKACCOUNT": "Edit Zendesk Account", - "DELETE_ZENDESKACCOUNT": "Delete Zendesk Account", - "NEW_ZENDESKACCOUNT": "New Zendesk Account", - "AUTHTYPE": "Authentication Type", - "PASSWORD": "Password", - "CONFIRM_PASSWORD": "Confirm Password", - "EMAIL": "Email", + "BACK": "Til baka", + "SELECTED": "Valið", + "SELECT_ALL": "Veljið allt", + "SELECT_NONE": "Veljið nafn", + "EDIT_ZENDESKACCOUNT": "Breyttu Zendesk reikningi", + "DELETE_ZENDESKACCOUNT": "Eyddu Zendesk reikningi", + "NEW_ZENDESKACCOUNT": "Nýr Zendesk reikningur", + "AUTHTYPE": "Sannvottunar aðferð", + "PASSWORD": "Lykilorð", + "CONFIRM_PASSWORD": "Staðfesta lykilorð", + "EMAIL": "Netfang", "TOKEN": "Token", - "MOTIONPROXYADDRESS": "Motion or Proxy IP Address", - "DESCRIPTION": "Description", - "ADD_ZENDESKACCOUNT": "Add Zendesk Account", + "MOTIONPROXYADDRESS": "IP tala fyrir Motion eða Proxy", + "DESCRIPTION": "Lysing", + "ADD_ZENDESKACCOUNT": "Bættu við Zendesk reikningi", "ERRORS": { - "NAME_REQUIRED": "Mandatory field", - "USERNAME_REQUIRED": "Mandatory field", - "URI_REQUIRED": "Mandatory field", - "URI_MUST_VALID_URL": "Wrong format", - "PASSWORD_REQUIRED": "Mandatory field", - "CONFIRM_NOT_MATCH": "The passwords don't match", - "TOKEN_REQUIRED": "Mandatory field", - "MOTIONPROXYADDRESS_MUST_VALID_URL": "Wrong format", - "CLIENTID_REQUIRED": "Mandatory field", - "CLIENTSECRET_REQUIRED": "Mandatory field", - "SECURITYTOKEN_REQUIRED": "Mandatory field", - "APIKEY_REQUIRED": "Mandatory field", - "CONTENT_REQUIRED": "Mandatory field", - "VARIABLENAME_REQUIRED": "Mandatory field", - "KEY_REQUIRED": "Mandatory field", - "TYPE_REQUIRED": "Mandatory field", - "VALUE_REQUIRED": "Mandatory field", - "FIELD_REQUIRED": "Mandatory field", - "CONSUMERKEY_REQUIRED": "Mandatory field", - "CONSUMERSECRET_REQUIRED": "Mandatory field", - "TOKENSECRET_REQUIRED": "Mandatory field", - "HOST_REQUIRED": "Mandatory field", - "AUTHTOKEN_REQUIRED": "Mandatory field", - "VTIGER_USER_NAME_REQUIRED": "Mandatory field", - "ACCESS_KEY_REQUIRED": "Mandatory field", - "EMAIL_REQUIRED": "Mandatory field", - "TENANTID_REQUIRED": "Mandatory field", - "CODE_REQUIRED": "Mandatory field", - "MOTIONPROXYADDRESS_REQUIRED": "Mandatory field", - "MODULECREATE_REQUIRED": "Mandatory field" + "NAME_REQUIRED": "Skilyrtur reitur", + "USERNAME_REQUIRED": "Skilyrtur reitur", + "URI_REQUIRED": "Skilyrtur reitur", + "URI_MUST_VALID_URL": "Rangt snið", + "PASSWORD_REQUIRED": "Skilyrtur reitur", + "CONFIRM_NOT_MATCH": "Lykilorðin stemma ekki", + "TOKEN_REQUIRED": "Skilyrtur reitur", + "MOTIONPROXYADDRESS_MUST_VALID_URL": "Rangt snið", + "CLIENTID_REQUIRED": "Skilyrtur reitur", + "CLIENTSECRET_REQUIRED": "Skilyrtur reitur", + "SECURITYTOKEN_REQUIRED": "Skilyrtur reitur", + "APIKEY_REQUIRED": "Skilyrtur reiturM", + "CONTENT_REQUIRED": "Skilyrtur reitur", + "VARIABLENAME_REQUIRED": "Skilyrtur reitur", + "KEY_REQUIRED": "Skilyrtur reitur", + "TYPE_REQUIRED": "Skilyrtur reitur", + "VALUE_REQUIRED": "Skilyrtur reitur", + "FIELD_REQUIRED": "Skilyrtur reitur", + "CONSUMERKEY_REQUIRED": "Skilyrtur reitur", + "CONSUMERSECRET_REQUIRED": "Skilyrtur reitur", + "TOKENSECRET_REQUIRED": "Skilyrtur reitur", + "HOST_REQUIRED": "MSkilyrtur reitur", + "AUTHTOKEN_REQUIRED": "Skilyrtur reitur", + "VTIGER_USER_NAME_REQUIRED": "Skilyrtur reitur", + "ACCESS_KEY_REQUIRED": "Skilyrtur reitur", + "EMAIL_REQUIRED": "MSkilyrtur reitur", + "TENANTID_REQUIRED": "Skilyrtur reitur", + "CODE_REQUIRED": "Skilyrtur reitur", + "MOTIONPROXYADDRESS_REQUIRED": "Skilyrtur reitur", + "MODULECREATE_REQUIRED": "Skilyrtur reitur" }, "HELP": { "MOTIONPROXYADDRESS": "Motion (Proxy) Address: it is reqired if you want to fill the ticket body with Recording URL. Enter the address in the following format: : //[:]. Example: https://X.Y.Z.W", - "TICKETTYPE": "Ticket Type", - "ZONE": "Choose your geographic zone (US, AU, EU, IN, CN) to activate the domain-specific Zoho Accounts", - "CLIENTID": "The specific CLient Id of your application", - "CLIENTSECRET": "The specific CLientSecret of your application", - "CODE": "The specific code generated through Developer Console", + "TICKETTYPE": "Tiket tegund", + "ZONE": "Veldu landsvæði (US, AU, EU, IN, CN) til að virkja rétt lén fyrir Zoho reikninginn þinn", + "CLIENTID": "Sérstakt notenda auðkenni fyrir lausnina þína", + "CLIENTSECRET": "Sérstakt notenda lyniorð fyrir lausnina þína", + "CODE": "Sérstakur kóði frá forritinu", "REFRESHTOKEN": "The automatically generated refresh token used to refresh expired access tokens. Also the access token are automatically generated each time an api is launched.", - "LEADID": "Field name used to link Case and Lead objects", - "ADDITIONALSEARCHACCOUNT": "Additional field name used to search customer phone number in Accounts", - "ADDITIONALSEARCHCONTACT": "Additional field name used to search customer phone number in Contacts", - "ADDITIONALSEARCHLEAD": "Additional field name used to search customer phone number in Leads", - "MODERN_AUTHENTICATION": "Switch to enable Modern Authentication" + "LEADID": "Svæðis reitur til að tengja saman verkefni og Lead verkefni", + "ADDITIONALSEARCHACCOUNT": "Viðbótar nafna reitur, notaður til að leita að viðskiptavina símanúmeri í fyrirtækjum/reikningi", + "ADDITIONALSEARCHCONTACT": "Viðbótar nafna reitur, notaður til að leita að viðskiptavina símanúmeri í tengiliðum", + "ADDITIONALSEARCHLEAD": "Viðbótar reitur, notaður til að leita að viðskiptavina símanúmeri í Leads", + "MODERN_AUTHENTICATION": "Skiptið yfir til að virkja nútýma auðkenningu" }, - "MODULECREATE": "Module create", - "CODE": "Developer Console Code", - "REFRESHTOKEN": "Refresh Token (generated)", - "ACCOUNT": "Account", - "ZENDESKCONFIGURATIONS": "Zendesk Configurations", - "SALESFORCECONFIGURATIONS": "Salesforce Configurations", - "SUGARCRMCONFIGURATIONS": "SugarCRM Configurations", - "FRESHDESKCONFIGURATIONS": "Freshdesk Configurations", - "GENERAL": "General", - "CREATED_AT": "Created At", - "SAVE": "Save", - "NO_ZENDESKCONFIGURATION_AVAILABLE": "No Zendesk Configurations available", - "NEW_ZENDESKCONFIGURATION": "New Zendesk Configuration", - "ADD_ZENDESKCONFIGURATION": "Add Zendesk Configuration", - "EDIT_ZENDESKCONFIGURATION": "Edit Zendesk Configuration", - "DELETE_ZENDESKCONFIGURATION": "Delete Zendesk Configuration", - "NO_SALESFORCECONFIGURATION_AVAILABLE": "No Salesforce Configurations available", - "NEW_SALESFORCECONFIGURATION": "New Salesforce Configuration", - "ADD_SALESFORCECONFIGURATION": "Add Salesforce Configuration", - "EDIT_SALESFORCECONFIGURATION": "Edit Salesforce Configuration", - "DELETE_SALESFORCECONFIGURATION": "Delete Salesforce Configuration", - "NO_SUGARCRMCONFIGURATION_AVAILABLE": "No SugarCRM Configurations available", - "NEW_SUGARCRMCONFIGURATION": "New SugarCRM Configuration", - "ADD_SUGARCRMCONFIGURATION": "Add SugarCRM Configuration", - "EDIT_SUGARCRMCONFIGURATION": "Edit SugarCRM Configuration", - "DELETE_SUGARCRMCONFIGURATION": "Delete SugarCRM Configuration", - "NO_FRESHDESKCONFIGURATION_AVAILABLE": "No Freshdesk Configurations available", - "NEW_FRESHDESKCONFIGURATION": "New Freshdesk Configuration", - "ADD_FRESHDESKCONFIGURATION": "Add Freshdesk Configuration", - "EDIT_FRESHDESKCONFIGURATION": "Edit Freshdesk Configuration", - "DELETE_FRESHDESKCONFIGURATION": "Delete Freshdesk Configuration", - "SALESFORCEACCOUNTS": "Salesforce Accounts", - "EDIT_SALESFORCEACCOUNT": "Edit Salesforce Account", - "DELETE_SALESFORCEACCOUNT": "Delete Salesforce Account", - "NEW_SALESFORCEACCOUNT": "New Salesforce Account", - "ADD_SALESFORCEACCOUNT": "Add Salesforce Account", - "CLIENTID": "Client ID", - "CLIENTSECRET": "Client Secret", - "SECURITYTOKEN": "Security Token", - "SEARCH_FOR_ANYONE": "Search", - "APIKEY": "Api Key", - "FRESHDESKACCOUNTS": "Freshdesk Accounts", - "EDIT_FRESHDESKACCOUNT": "Edit Freshdesk Account", - "DELETE_FRESHDESKACCOUNT": "Delete Freshdesk Account", - "NEW_FRESHDESKACCOUNT": "New Freshdesk Account", - "ADD_FRESHDESKACCOUNT": "Add Freshdesk Account", - "SUGARCRMACCOUNTS": "SugarCRM Accounts", - "EDIT_SUGARCRMACCOUNT": "Edit SugarCRM Account", - "DELETE_SUGARCRMACCOUNT": "Delete SugarCRM Account", - "NEW_SUGARCRMACCOUNT": "New SugarCRM Account", - "ADD_SUGARCRMACCOUNT": "Add SugarCRM Account", - "CONFIGURATIONS": "Configurations", - "NO_CONFIGURATION_AVAILABLE": "No Configurations available", - "NEW_CONFIGURATION": "New Configuration", - "ADD_CONFIGURATION": "Add Configuration", - "EDIT_CONFIGURATION": "Edit Configuration", - "DELETE_CONFIGURATION": "Delete Configuration", - "SUBJECTS": "Subjects", - "DESCRIPTIONS": "Descriptions", - "FIELDS": "Fields", - "TAGS": "Tags", - "TYPE": "Type", - "CONTENT": "Content", - "EDIT_SUBJECT": "Edit Subject", - "DELETE_SUBJECT": "Delete Subject", - "NEW_SUBJECT": "New Subject", - "ADD_SUBJECT": "Add Subject", - "EDIT_DESCRIPTION": "Edit Description", - "DELETE_DESCRIPTION": "Delete Description", - "NEW_DESCRIPTION": "New Description", - "ADD_DESCRIPTION": "Add Description", - "EDIT_FIELD": "Edit Field", - "DELETE_FIELD": "Delete Field", - "NEW_FIELD": "New Field", - "ADD_FIELD": "Add Field", - "ADD": "Add", - "VOICE": "Voice", - "MAIL": "Email", - "CHAT": "Chat", + "MODULECREATE": "Stofna modúl", + "CODE": "Forritunar Console lykill", + "REFRESHTOKEN": "Endurnýjaðu Token (sem var búið til)", + "ACCOUNT": "Reikningur", + "ZENDESKCONFIGURATIONS": "Zendesk stillingar", + "SALESFORCECONFIGURATIONS": "Salesforce Stillingar", + "SUGARCRMCONFIGURATIONS": "SugarCRM stillingar", + "FRESHDESKCONFIGURATIONS": "Freshdesk stillingar", + "GENERAL": "almennt", + "CREATED_AT": "Stofnað kl.", + "SAVE": "Geyma", + "NO_ZENDESKCONFIGURATION_AVAILABLE": "Engin Zendesk stilling fáanleg", + "NEW_ZENDESKCONFIGURATION": "Ný Zendesk stilling", + "ADD_ZENDESKCONFIGURATION": "Bættu við Zendesk stillingum", + "EDIT_ZENDESKCONFIGURATION": "Breyttu Zendesk stillingum", + "DELETE_ZENDESKCONFIGURATION": "Eyddu Zendesk stillingum", + "NO_SALESFORCECONFIGURATION_AVAILABLE": "Engin Salesforce stilling fáanleg", + "NEW_SALESFORCECONFIGURATION": "Ný Salesforce stilling", + "ADD_SALESFORCECONFIGURATION": "Bættu við Salesforce Stillingum", + "EDIT_SALESFORCECONFIGURATION": "breyttu Salesforce stillingum", + "DELETE_SALESFORCECONFIGURATION": "Eyddu Salesforce stillingum", + "NO_SUGARCRMCONFIGURATION_AVAILABLE": "Engin SugarCRM stilling fáanleg", + "NEW_SUGARCRMCONFIGURATION": "Ný SugarCRM stilling", + "ADD_SUGARCRMCONFIGURATION": "Bættu við SugarCRM stillingum", + "EDIT_SUGARCRMCONFIGURATION": "Breyttu SugarCRM stillingum", + "DELETE_SUGARCRMCONFIGURATION": "Eyddu SugarCRM stillingum", + "NO_FRESHDESKCONFIGURATION_AVAILABLE": "Engin Freshdesk stilling fáanleg", + "NEW_FRESHDESKCONFIGURATION": "Ný Freshdesk stilling", + "ADD_FRESHDESKCONFIGURATION": "Bættu við Freshdesk Stillingum", + "EDIT_FRESHDESKCONFIGURATION": "Breyttu Freshdesk stillingum", + "DELETE_FRESHDESKCONFIGURATION": "Eyddu Freshdesk stillingum", + "SALESFORCEACCOUNTS": "Salesforce reikningur", + "EDIT_SALESFORCEACCOUNT": "Breyttu Salesforce reikningi", + "DELETE_SALESFORCEACCOUNT": "Eyddum Salesforce reikningi", + "NEW_SALESFORCEACCOUNT": "Nýr Salesforce reikningur", + "ADD_SALESFORCEACCOUNT": "Bættu við Salesforce reikningi", + "CLIENTID": "Auðkenni notanda", + "CLIENTSECRET": "Leyniorð notanda", + "SECURITYTOKEN": "Öryggis Token", + "SEARCH_FOR_ANYONE": "Leita", + "APIKEY": "Api lykill", + "FRESHDESKACCOUNTS": "Freshdesk reikningur", + "EDIT_FRESHDESKACCOUNT": "Breyttu Freshdesk reikningi", + "DELETE_FRESHDESKACCOUNT": "Eyddu Freshdesk reikningi", + "NEW_FRESHDESKACCOUNT": "Nér Freshdesk reikningur", + "ADD_FRESHDESKACCOUNT": "Bættu við Freshdesk Reikningi", + "SUGARCRMACCOUNTS": "SugarCRM reikningur", + "EDIT_SUGARCRMACCOUNT": "Breyttu SugarCRM reikningi", + "DELETE_SUGARCRMACCOUNT": "Eyddu SugarCRM reikningi", + "NEW_SUGARCRMACCOUNT": "Nýr SugarCRM reikningur", + "ADD_SUGARCRMACCOUNT": "Bættu við SugarCRM reikningi", + "CONFIGURATIONS": "Stillingar", + "NO_CONFIGURATION_AVAILABLE": "Engin stilling fáanleg", + "NEW_CONFIGURATION": "Nýar stillingar", + "ADD_CONFIGURATION": "Bættu við stillingum", + "EDIT_CONFIGURATION": "Breyttu stillingum", + "DELETE_CONFIGURATION": "Eyddu stillingum", + "SUBJECTS": "Efni", + "DESCRIPTIONS": "Lysing", + "FIELDS": "Reitir", + "TAGS": "Tögg", + "TYPE": "Tegund", + "CONTENT": "Innihald", + "EDIT_SUBJECT": "Breyttu viðfangsefni", + "DELETE_SUBJECT": "Eyddu viðfangsefni", + "NEW_SUBJECT": "Nýt viðfang", + "ADD_SUBJECT": "Bættu við viðfangsefni", + "EDIT_DESCRIPTION": "Breyttu lýsingu", + "DELETE_DESCRIPTION": "Eyddu lýsingu", + "NEW_DESCRIPTION": "Ný lýsing", + "ADD_DESCRIPTION": "Bættu við lýsingu", + "EDIT_FIELD": "Breyttu reit", + "DELETE_FIELD": "Eyddu reit", + "NEW_FIELD": "Nýr reitur", + "ADD_FIELD": "Bættu við reiti", + "ADD": "Bæta við", + "VOICE": "Tal", + "MAIL": "Netfang", + "CHAT": "Spjall", "SMS": "SMS", - "OPENCHANNEL": "Open Channel", - "INBOUND_IN_QUEUE": "Inbound in Queue", - "OUTBOUND_CALL": "Outbound Call", - "VALUE": "Value", - "FIELD": "Field", - "KEY": "Key", - "CHANNEL": "Channel", - "DELETE": "Delete", - "NO_AVAILABLE_INFO": "No available info", - "TEST_ZENDESKACCOUNT": "Test Zendesk Account", - "TEST_FRESHDESKACCOUNT": "Test Freshdesk Account", - "TEST_SUGARCRMACCOUNT": "Test SugerCRM Account", - "TEST_SALESFORCEACCOUNT": "Test Salesforce Account", - "INTEGRATION_TAB": "Integration Tab", - "NEW_TAB": "New Tab", - "DESKACCOUNTS": "Desk Accounts", - "EDIT_DESKACCOUNT": "Edit Desk Account", - "TEST_DESKACCOUNT": "Test Desk Account", - "DELETE_DESKACCOUNT": "Delete Desk Account", - "CONSUMERKEY": "Consumer Key", - "CONSUMERSECRET": "Consumer Secret", + "OPENCHANNEL": "Opin rás", + "INBOUND_IN_QUEUE": "Innkomandi í biðr0ð", + "OUTBOUND_CALL": "Útfarandi símtall", + "VALUE": "Gildi", + "FIELD": "Reitur", + "KEY": "Lykill", + "CHANNEL": "Rás", + "DELETE": "Eyða", + "NO_AVAILABLE_INFO": "Engar upplýsingar fáanlegar", + "TEST_ZENDESKACCOUNT": "Prufu Zendesk reikningur", + "TEST_FRESHDESKACCOUNT": "Prufu Freshdesk reikningur", + "TEST_SUGARCRMACCOUNT": "Prufu SugerCRM reikningur", + "TEST_SALESFORCEACCOUNT": "Prufu Salesforce reikningur", + "INTEGRATION_TAB": "Samþáttunar flipi", + "NEW_TAB": "Nýr flipi", + "DESKACCOUNTS": "Desk reikningur", + "EDIT_DESKACCOUNT": "Breyttu Desk reikningi", + "TEST_DESKACCOUNT": "Prufu Desk reikningur", + "DELETE_DESKACCOUNT": "Eyddu Desk reikningi", + "CONSUMERKEY": "Lykill fyrir notanda", + "CONSUMERSECRET": "Leyniorð notanda", "TOKENSECRET": "Token Secret", - "ADD_DESKACCOUNT": "Add Desk Account", - "NEW_DESKACCOUNT": "New Desk Account", - "ADD_DESKCONFIGURATION": "Add Desk Configuration", - "NEW_DESKCONFIGURATION": "New Desk Configuration", - "DELETE_DESKCONFIGURATION": "Delete Desk Configuration", - "ZOHOACCOUNTS": "Zoho Accounts", - "EDIT_ZOHOACCOUNT": "Edit Zoho Account", - "TEST_ZOHOACCOUNT": "Test Zoho Account", - "DELETE_ZOHOACCOUNT": "Delete Zoho Account", - "ADD_ZOHOACCOUNT": "Add Zoho Account", - "NEW_ZOHOACCOUNT": "New Zoho Account", - "ADD_ZOHOCONFIGURATION": "Add Zoho Configuration", - "NEW_ZOHOCONFIGURATION": "New Zoho Configuration", - "AUTHTOKEN": "Authorization Token", - "HOST": "Host", - "DELETE_ZOHOCONFIGURATION": "Delete Zoho Configuration", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "VTIGERACCOUNTS": "vTiger Accounts", - "VTIGER_USER_NAME": "vTiger User Name", - "MODULE_NAME": "vTiger Module Name", - "ACCESS_KEY": "vTiger Access Key", - "ADD_VTIGERACCOUNT": "Add new vTiger Account", - "EDIT_VTIGERACCOUNT": "Edit vTiger Account", - "TEST_VTIGERACCOUNT": "Test vTiger Account", - "DELETE_VTIGERACCOUNT": "Delete vTiger Account", - "NEW_VTIGERACCOUNT": "New vTiger Account", - "NEW_VTIGERCONFIGURATION": "Create vTiger Configuration", - "DELETE_VTIGERCONFIGURATION": "Delete vTiger Configuration", - "ADD_VTIGERCONFIGURATION": "Add vTiger Configuration", - "FRESHSALESACCOUNTS": "Freshsales Accounts", - "EDIT_FRESHSALESACCOUNT": "Edit Freshsales Account", - "DELETE_FRESHSALESACCOUNT": "Delete Freshsales Account", - "NEW_FRESHSALESACCOUNT": "New Freshsales Account", - "ADD_FRESHSALESACCOUNT": "Add Freshsales Account", - "NO_FRESHSALESCONFIGURATION_AVAILABLE": "No Freshsales Configurations available", - "NEW_FRESHSALESCONFIGURATION": "New Freshsales Configuration", - "ADD_FRESHSALESCONFIGURATION": "Add Freshsales Configuration", - "EDIT_FRESHSALESCONFIGURATION": "Edit Freshsales Configuration", - "DELETE_FRESHSALESCONFIGURATION": "Delete Freshsales Configuration", - "TEST_FRESHSALESACCOUNT": "Test Freshsales Account", - "SERVICENOWACCOUNTS": "ServiceNow Accounts", - "ADD_SERVICENOWACCOUNT": "Add new ServiceNow Account", - "EDIT_SERVICENOWACCOUNT": "Edit ServiceNow Account", - "TEST_SERVICENOWACCOUNT": "Test ServiceNow Account", - "DELETE_SERVICENOWACCOUNT": "Delete ServiceNow Account", - "NEW_SERVICENOWACCOUNT": "New ServiceNow Account", - "NEW_SERVICENOWCONFIGURATION": "Create ServiceNow Configuration", - "DELETE_SERVICENOWCONFIGURATION": "Delete ServiceNow Configuration", - "ADD_SERVICENOWCONFIGURATION": "Add ServiceNow Configuration", - "DYNAMICS365ACCOUNTS": "Dynamics365 Accounts", - "TENANTID": "Tenant Id", - "ADD_DYNAMICS365ACCOUNT": "Add new Dynamics365 Account", - "EDIT_DYNAMICS365ACCOUNT": "Edit Dynamics365 Account", - "TEST_DYNAMICS365ACCOUNT": "Test Dynamics365 Account", - "DELETE_DYNAMICS365ACCOUNT": "Delete Dynamics365 Account", - "NEW_DYNAMICS365ACCOUNT": "New Dynamics365 Account", - "NEW_DYNAMICS365CONFIGURATION": "Create Dynamics365 Configuration", - "DELETE_DYNAMICS365CONFIGURATION": "Delete Dynamics365 Configuration", - "ADD_DYNAMICS365CONFIGURATION": "Add Dynamics365 Configuration", - "TICKETTYPE": "Ticket Type", - "CASE": "Case", - "LEADID": "Lead Id", - "ADDITIONALSEARCHACCOUNT": "Additional Search Account", - "ADDITIONALSEARCHCONTACT": "Additional Search Contact", - "ADDITIONALSEARCHLEAD": "Additional Search Lead", - "PHONECALL": "Phonecall", - "TASK": "Task", - "DYNAMIC365CONTACT": "Contact", - "DYNAMIC365NOTHING": "Nothing", - "MODERN_AUTHENTICATION": "Modern Authentication", - "OPENNEWTAB": "Open new tab" + "ADD_DESKACCOUNT": "Bættu við reikningi fyrir Desk", + "NEW_DESKACCOUNT": "Nýr Desk reikningur", + "ADD_DESKCONFIGURATION": "Bættu við Desk Stillingum", + "NEW_DESKCONFIGURATION": "Ný Desk stilling", + "DELETE_DESKCONFIGURATION": "Eyddu Desk stillingum", + "ZOHOACCOUNTS": "Zoho reikningur", + "EDIT_ZOHOACCOUNT": "Breyttu Zoho reikningi", + "TEST_ZOHOACCOUNT": "Prufu Zoho reikningur", + "DELETE_ZOHOACCOUNT": "Eyddu Zoho reikningi", + "ADD_ZOHOACCOUNT": "Bættu við Zoho reikningi", + "NEW_ZOHOACCOUNT": "Nýr Zoho reikningur", + "ADD_ZOHOCONFIGURATION": "ABættu við Zoho stillingum", + "NEW_ZOHOCONFIGURATION": "Nýjar Zoho stillingar", + "AUTHTOKEN": "Auðkennis lykill, Token", + "HOST": "Hýsill", + "DELETE_ZOHOCONFIGURATION": "Eyddu Zoho stillingum", + "PAGE": "Bls.", + "ROWSPERPAGE": "Línur á bls.", + "OF": "Slökt", + "VTIGERACCOUNTS": "vTiger reikningur", + "VTIGER_USER_NAME": "vTiger notenda nafn", + "MODULE_NAME": "vTiger módúl nafn", + "ACCESS_KEY": "vTiger Aðgangs lykill", + "ADD_VTIGERACCOUNT": "Bættu við nýjum vTiger reikningi", + "EDIT_VTIGERACCOUNT": "Breyttu vTiger reikningi", + "TEST_VTIGERACCOUNT": "Prufu vTiger reikningur", + "DELETE_VTIGERACCOUNT": "Eyddu vTiger reikningi", + "NEW_VTIGERACCOUNT": "Nýr vTiger reikningur", + "NEW_VTIGERCONFIGURATION": "Búðu til vTiger stillingar", + "DELETE_VTIGERCONFIGURATION": "Eyddu vTiger stillingum", + "ADD_VTIGERCONFIGURATION": "Bættu við vTiger stillingum", + "FRESHSALESACCOUNTS": "Freshsales reikningur", + "EDIT_FRESHSALESACCOUNT": "Breyttu Freshsales reikningi", + "DELETE_FRESHSALESACCOUNT": "Eyddu Freshsales reikningi", + "NEW_FRESHSALESACCOUNT": "Nýr Freshsales reikningur", + "ADD_FRESHSALESACCOUNT": "Bættu við Freshsales reikningi", + "NO_FRESHSALESCONFIGURATION_AVAILABLE": "Engin Freshsales stilling fáanleg", + "NEW_FRESHSALESCONFIGURATION": "Ný Freshsales stilling", + "ADD_FRESHSALESCONFIGURATION": "Bættu við Freshsales stillingum", + "EDIT_FRESHSALESCONFIGURATION": "Breyttu Freshsales stillingum", + "DELETE_FRESHSALESCONFIGURATION": "Eyddu Freshsales stillingum", + "TEST_FRESHSALESACCOUNT": "Prufu Freshsales reikningur", + "SERVICENOWACCOUNTS": "ServiceNow reikningur", + "ADD_SERVICENOWACCOUNT": "Bættu við nýjum ServiceNow reikningi", + "EDIT_SERVICENOWACCOUNT": "Breyttu ServiceNow reikningi", + "TEST_SERVICENOWACCOUNT": "Prufu ServiceNow reikningur", + "DELETE_SERVICENOWACCOUNT": "Eyddu ServiceNow reikningi", + "NEW_SERVICENOWACCOUNT": "Nýr ServiceNow reikningur", + "NEW_SERVICENOWCONFIGURATION": "Búðu til Create ServiceNow stillingu", + "DELETE_SERVICENOWCONFIGURATION": "Eyddu ServiceNow stillingum", + "ADD_SERVICENOWCONFIGURATION": "Bættu við ServiceNow stillingum", + "DYNAMICS365ACCOUNTS": "Dynamics365 reikningur", + "TENANTID": "Auðkenni notanda", + "ADD_DYNAMICS365ACCOUNT": "Bættu við nýjum Dynamics365 Reikningi", + "EDIT_DYNAMICS365ACCOUNT": "Breyttu Dynamics365 reikningi", + "TEST_DYNAMICS365ACCOUNT": "Prufu Dynamics365 reikningur", + "DELETE_DYNAMICS365ACCOUNT": "Eyddu Dynamics365 reikningi", + "NEW_DYNAMICS365ACCOUNT": "Nýr Dynamics365 reikningur", + "NEW_DYNAMICS365CONFIGURATION": "Búðu til Dynamics365 stillingar", + "DELETE_DYNAMICS365CONFIGURATION": "Eyddu Dynamics365 stillingum", + "ADD_DYNAMICS365CONFIGURATION": "Bættu við Dynamics365 Stillingum", + "TICKETTYPE": "Tiket tegund", + "CASE": "Mál", + "LEADID": "Lead Auðkenni", + "ADDITIONALSEARCHACCOUNT": "Viðbótar leitar reikningur", + "ADDITIONALSEARCHCONTACT": "Viðbótar leitar tengiliður", + "ADDITIONALSEARCHLEAD": "Viðbótar leitar Lead", + "PHONECALL": "Símtal", + "TASK": "Verkefni", + "DYNAMIC365CONTACT": "Tengiliður", + "DYNAMIC365NOTHING": "Ekkert", + "MODERN_AUTHENTICATION": "Nútíma auðkenning", + "OPENNEWTAB": "Opnaðu nýjan flipa" } } diff --git a/public/app/main/apps/jscripty/i18n/de.json b/public/app/main/apps/jscripty/i18n/de.json index 40b33e8..6684a02 100644 --- a/public/app/main/apps/jscripty/i18n/de.json +++ b/public/app/main/apps/jscripty/i18n/de.json @@ -1,42 +1,42 @@ { "JSCRIPTY": { "NAME": "Name", - "SEARCH_FOR_ANYONE": "Suche für Jedermann", + "SEARCH_FOR_ANYONE": "Suche", "BACK": "Zurück", - "SELECTED": "Ausgewählte", - "SELECT_ALL": "Alle auswählen", - "SELECT_NONE": "Wählen Sie \"Keine\"", + "SELECTED": "Ausgewählt", + "SELECT_ALL": "Alles auswählen", + "SELECT_NONE": "Nichts auswählen", "DESCRIPTION": "Beschreibung", "ERRORS": { - "NAME_REQUIRED": "Der Name ist erforderlich", - "PROJECT_REQUIRED": "Das Projekt ist erforderlich", - "FIELD_REQUIRED": "Das Feld ist erforderlich.", - "NAME_MUST_VALID_PATTERN": "Der Name muss in einem gültigen Format geschrieben werden" + "NAME_REQUIRED": "Name erforderlich", + "PROJECT_REQUIRED": "Projekt erforderlich", + "FIELD_REQUIRED": "Feld erforderlich.", + "NAME_MUST_VALID_PATTERN": "Ungültiges Format Name" }, "SAVE": "Speichern", "PROJECTS": "Projekte", "ADD_PROJECT": "Projekt hinzufügen", "EDIT_PROJECT": "Projekt bearbeiten", "DELETE_PROJECT": "Projekt löschen", - "JSCRIPTY": "Jscripty", - "ID": "Id", + "JSCRIPTY": "JScripty", + "ID": "ID", "PROJECT": "Projekt", "CREATED_AT": "Erstellt am", "NEW_PROJECT": "Neues Projekt", "EDIT": "Bearbeiten", "SETTINGS": "Einstellungen", "GENERAL": "Allgemein", - "BUILDER": "Builder", + "BUILDER": "Editor", "PREVIEW": "Vorschau", "OPEN_CONTACT": "Kontakt öffnen", "HELP": { "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", - "ENABLEUNCOMPLETESAVE": "Die dem Bedienplatz-Sitzung zu speichern, auch wenn die Umfrage ist noch nicht abgeschlossen", - "SENDUNPAUSEONSUBMIT": "Beenden Sie am Ende der Umfrage automatisch die Pause des Agenten" + "ENABLEUNCOMPLETESAVE": "Speichert die Einträge auch wenn Formular noch nicht abgeschlossen", + "SENDUNPAUSEONSUBMIT": "Nach Abschicken des Formulars Agentenpause beenden" }, "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "Von", + "OF": "von", "JSCRIPTYSESSIONS": "Projektsitzungen", "SESSIONS": "Sitzungen", "STARTTIME": "Startzeit", @@ -44,185 +44,185 @@ "MEMBERNAME": "Mitgliedsname", "CALLERIDNUM": "Rufnummer des Anrufers", "NO_SESSION_AVAILABLE": "Keine Sitzungen verfügbar", - "SESSION_RESULTS": "Sitzung Ergebnisse", - "SHOW_QUESTIONS_SESSION": "Sitzung Ergebnisse anzeigen", + "SESSION_RESULTS": "Ergebnisse Sitzungen", + "SHOW_QUESTIONS_SESSION": "Ergebnisse anzeigen", "ANSWERS": "Antworten", "NO_RESULTS_AVAILABLE": "Keine Ergebnisse verfügbar", - "TOTAL": "Insgesamt", + "TOTAL": "Gesamt", "ANSWER": "Antwort", - "EXPORT_TO_CSV": "Export in CSV", + "EXPORT_TO_CSV": "In CSV exportieren", "NO_ANSWERS_AVAILABLE": "Keine Antworten vorhanden", - "DELETE_SESSION": "Session löschen", + "DELETE_SESSION": "Sitzung löschen", "RESET_SESSION": "Sitzung neu starten", "YES": "Ja", - "NO": "Keine", + "NO": "Nein", "DO_YOU_WANT_TO_RESET_SESSION": "Möchten Sie die Sitzung zurücksetzen?", "ALL_SURVEY_DATA_WILL_BE_LOST": "Alle Antworten auf die Umfragen gehen verloren!", - "ENABLEUNCOMPLETESAVE": "Aktivieren Sie unvollständig speichern", + "ENABLEUNCOMPLETESAVE": "Unvollständiges Speichern aktivieren", "SUBMIT": "Senden", "PROJECT_NOT_AVAILABLE": "Projekt ist nicht verfügbar. Bitte wenden Sie sich an den Administrator", - "COMPLETE": "Komplette", - "CLONE_PROJECT": "Klonprojekt", - "SESSIONS_PROJECT": "Gehe zu den Sitzungen", - "SENDUNPAUSEONSUBMIT": "Agent beim Senden abschalten" + "COMPLETE": "Abgeschlossen", + "CLONE_PROJECT": "Projekt klonen", + "SESSIONS_PROJECT": "Zu den Sitzungen wechseln", + "SENDUNPAUSEONSUBMIT": "Agentenpause beim Senden beenden" }, "mwForm": { "form": { - "name": "Title", - "name.placeholder": "Form title", - "description": "Description" + "name": "Titel", + "name.placeholder": "Formulartitel", + "description": "Beschreibung" }, "buttons": { - "addPage": "Add page", - "moveDown": "Move down", - "moveUp": "Move up", - "removePage": "Remove page", - "remove": "Remove", - "addElement": "Add element", - "questionReady": "Ready", - "next": "Next", - "back": "Back", - "submit": "Submit", - "begin": "Begin", - "fold": "Fold", - "unfold": "Unfold", - "edit": "Edit", - "clone": "Clone", - "view": "View" + "addPage": "Seite hinzufügen", + "moveDown": "Nach unten", + "moveUp": "nach oben", + "removePage": "Seite löschen", + "remove": "Löschen", + "addElement": "Element hinzufügen", + "questionReady": "Bereit", + "next": "Weiter", + "back": "Zurück", + "submit": "Übermitteln", + "begin": "Start", + "fold": "Einklappen", + "unfold": "Ausklappen", + "edit": "Bearbeiten", + "clone": "Klonen", + "view": "Ansicht" }, "page": { "tab": { - "heading": "Page {{page}} of {{allPages}}" + "heading": "Seite {{page}} von {{allPages}}" }, "elements": { - "empty": "Empty page" + "empty": "Leere Seite" }, - "pageWithNameCheckbox": "named", - "name": "Page name" + "pageWithNameCheckbox": "Benannt", + "name": "Seitenname" }, "pageFlow": { - "afterPage": "After page {{page}}:", - "afterQuestionAnswer": "Go to page based on answer", - "goToPage": "Go to page {{page.number}}", - "goToNextPage": "Continue to next page", - "submitForm": "Submit form" + "afterPage": "Nach Seite {{page}}:", + "afterQuestionAnswer": "Seite wechseln in Abhängigkeit von Antwort", + "goToPage": "Gehe zu Seite {{page.number}}", + "goToNextPage": "Weiter zur nächsten Seite", + "submitForm": "Formular übermitteln" }, "elements": { - "question": "Question", - "image": "Image", - "paragraph": "Paragraph" + "question": "Frage", + "image": "Bild", + "paragraph": "Paragraf" }, "question": { "types": { "text": { - "name": "Short text" + "name": "kurzer Text" }, "textarea": { - "name": "Long text" + "name": "langer Text" }, "radio": { - "name": "Radio" + "name": "Radio-Button" }, "select": { - "name": "Select" + "name": "Auswahl" }, "checkbox": { - "name": "Checkboxes" + "name": "Checkboxen" }, "grid": { - "name": "Grid" + "name": "Raster" }, "priority": { - "name": "Priority" + "name": "Priorität" }, "division": { - "name": "Division" + "name": "Aufteilung" }, "number": { - "name": "Number" + "name": "Nummer" }, "date": { - "name": "Date" + "name": "Datum" }, "datetime": { - "name": "Datetime" + "name": "Datum und Zeit" }, "time": { - "name": "Time" + "name": "Zeit" }, "email": { - "name": "Email" + "name": "E-Mail" }, "range": { - "name": "Range" + "name": "Bereich" }, "url": { "name": "URL" } }, - "text": "Question text", - "type": "Question type", - "required": "Required", + "text": "Text Frage", + "type": "Typ Frage", + "required": "Pflichteingabe", "preview": { - "text": "Short answer text", - "textarea": "Long answer text", - "otherAnswer": "Other" + "text": "Text kurze Antwort", + "textarea": "Text lange Antwort", + "otherAnswer": "Sonstiges" }, "division": { - "quantity": "Quantity", - "unit": "Unit label", - "assignedSumLabel": "Assigned", - "fromRequiredLabel": "from required" + "quantity": "Anzahl", + "unit": "Einheit", + "assignedSumLabel": "Zugewiesen", + "fromRequiredLabel": "'Von' erforderlich" }, "priority": { - "sorted": "Sorted", - "available": "Available", - "clickToAddItem": "Click to add item" + "sorted": "Sortiert", + "available": "Verfügbar", + "clickToAddItem": "Klicken um Element hinzuzufügen" }, "grid": { - "cellInputType": "Cell input type", + "cellInputType": "Eingabeformat Feld", "cellInputTypes": { - "radio": "Radio", + "radio": "Radio-Button", "checkbox": "Checkbox", "text": "Text", - "number": "Number", - "date": "Date", - "time": "Time" + "number": "Nummer", + "date": "Datum", + "time": "Zeit" }, - "rowLabel": "Row {{row}}", - "clickToAddRow": "Click to add row", - "columnLabel": "Column {{col}}", - "clickToAddColumn": "Click to add column" + "rowLabel": "Zeile {{row}}", + "clickToAddRow": "Klickem um Zeile hinzuzufügen", + "columnLabel": "Spalte {{col}}", + "clickToAddColumn": "Klicken um Spalte hinzuzufügen" }, "range": { - "from": "Range from", - "to": "to" + "from": "Bereich von", + "to": "bis" }, "number": { "min": "Min", "max": "Max" }, - "orLabel": "or ", - "otherLabel": "Other: ", - "userAnswer": "User answer", + "orLabel": "oder ", + "otherLabel": "Sonstiges: ", + "userAnswer": "Antwort Nutzer", "buttons": { - "addOption": "Click to add option", - "addOther": "Add 'Other'" + "addOption": "Klicken um Option hinzuzufügen", + "addOther": "Klicken um 'Sonstiges' hinzuzufügen" } }, "image": { - "selectImageButton": "Select image", - "caption": "Image caption" + "selectImageButton": "Bild auswählen", + "caption": "Image Caption" }, "paragraph": { - "placeholder": "Enter paragraph text" + "placeholder": "Text eingeben" }, "confirmationPage": { - "title": "Confirmation page", - "customMessage": "Custom confirmation message", - "defaultMessage": "Your response has been saved", - "errorMessage": "Error! Your response has not been saved", - "pendingMessage": "Your response is being saved." + "title": "Bestätigungsseite", + "customMessage": "Benutzerdefinierte Nachricht", + "defaultMessage": "Ihre Eingaben wurden gespeichert", + "errorMessage": "Fehler beim Speichern Ihrer Eingaben", + "pendingMessage": "Ihre Eingabe wurde registriert" } } } diff --git a/public/app/main/apps/jscripty/i18n/is.json b/public/app/main/apps/jscripty/i18n/is.json index c5e12d7..6221f63 100644 --- a/public/app/main/apps/jscripty/i18n/is.json +++ b/public/app/main/apps/jscripty/i18n/is.json @@ -1,94 +1,94 @@ { "JSCRIPTY": { - "CLONE_PROJECT": "Clone Project", - "NAME": "Name", + "CLONE_PROJECT": "Afrita verkefni", + "NAME": "Nafn", "SEARCH_FOR_ANYONE": "Search", - "BACK": "Back", + "BACK": "Til baka", "SELECTED": "Selected", "SELECT_ALL": "Select All", "SELECT_NONE": "Select None", - "DESCRIPTION": "Description", + "DESCRIPTION": "Lýsing", "ERRORS": { - "NAME_REQUIRED": "Mandatory field", - "PROJECT_REQUIRED": "Mandatory field", - "FIELD_REQUIRED": "Mandatory field", - "NAME_MUST_VALID_PATTERN": "Wrong format" + "NAME_REQUIRED": "Skilyrtur reitur", + "PROJECT_REQUIRED": "Skilyrtur reitur", + "FIELD_REQUIRED": "Skilyrtur reitur", + "NAME_MUST_VALID_PATTERN": "Rangt snið" }, - "SAVE": "Save", - "PROJECTS": "Projects", - "ADD_PROJECT": "Add Project", - "EDIT_PROJECT": "Edit Project", - "DELETE_PROJECT": "Delete Project", + "SAVE": "Vista", + "PROJECTS": "Verkefni", + "ADD_PROJECT": "Bæta við verkefni", + "EDIT_PROJECT": "Breyta verkefni", + "DELETE_PROJECT": "Eyða verkefni", "JSCRIPTY": "Jscripty", - "ID": "Id", - "PROJECT": "Project", - "CREATED_AT": "Created At", - "NEW_PROJECT": "New Project", - "EDIT": "Edit", + "ID": "Auðkenni", + "PROJECT": "Verkefni", + "CREATED_AT": "Búið til kl.", + "NEW_PROJECT": "Nýtt verkefni", + "EDIT": "Breyta", "SETTINGS": "Settings", - "GENERAL": "General", - "BUILDER": "Builder", - "PREVIEW": "Preview", - "OPEN_CONTACT": "Open Contact", + "GENERAL": "almennt", + "BUILDER": "Byggja", + "PREVIEW": "Forskoðun", + "OPEN_CONTACT": "Opin tengiliður", "SENDUNPAUSEONSUBMIT": "Unpause agent on Submit", "HELP": { - "NAME": "Only numbers, letters and specific characters (._) are supported", - "ENABLEUNCOMPLETESAVE": "Allow to save the agent session even if the survey is not complete", - "SENDUNPAUSEONSUBMIT": "At the end of the survey, automatically stop the agent's pause" + "NAME": "Aðeins tölur, bókstafir og sértákn ekki leyfð", + "ENABLEUNCOMPLETESAVE": "Leyfa vistun á hluta af könnuninni þótt könnuninni sé ekki lokið", + "SENDUNPAUSEONSUBMIT": "Við lok könnunarinnar, taka af sjálfvirkt af hlé fulltrúans" }, - "PAGE": "Page", + "PAGE": "Bls.", "ROWSPERPAGE": "Rows per page", - "OF": "of", - "JSCRIPTYSESSIONS": "Project Sessions", + "OF": "af", + "JSCRIPTYSESSIONS": "Verkefna hluti", "SESSIONS": "Sessions", - "STARTTIME": "Start Time", - "ENDTIME": "End Time", - "MEMBERNAME": "Member Name", - "CALLERIDNUM": "Caller Number", - "NO_SESSION_AVAILABLE": "No Sessions available", + "STARTTIME": "Upphafs tími", + "ENDTIME": "Loka tími", + "MEMBERNAME": "Nafn á meðlimi", + "CALLERIDNUM": "Uppkallsnúmer", + "NO_SESSION_AVAILABLE": "Engin verkhluti tiltækur", "SESSION_RESULTS": "Session Results", "SHOW_QUESTIONS_SESSION": "Show Session Results", - "ANSWERS": "Answers", - "NO_RESULTS_AVAILABLE": "No results available", - "TOTAL": "Total", - "ANSWER": "Answer", - "EXPORT_TO_CSV": "Export to CSV", - "NO_ANSWERS_AVAILABLE": "No answers available", - "DELETE_SESSION": "Delete Session", + "ANSWERS": "Svarað", + "NO_RESULTS_AVAILABLE": "Engin niðurstaða tiltæk", + "TOTAL": "Samtals", + "ANSWER": "Svar", + "EXPORT_TO_CSV": "Flytja út sem CSV skrá", + "NO_ANSWERS_AVAILABLE": "Ekkert svar tiltækt", + "DELETE_SESSION": "Eyða verki", "RESET_SESSION": "Reset Session", - "YES": "Yes", - "NO": "No", - "DO_YOU_WANT_TO_RESET_SESSION": "Do you want to reset the session?", - "ALL_SURVEY_DATA_WILL_BE_LOST": "All survey answers will be lost!", - "ENABLEUNCOMPLETESAVE": "Enable incomplete save", - "SUBMIT": "Submit", + "YES": "Já", + "NO": "Nei", + "DO_YOU_WANT_TO_RESET_SESSION": "Viltu endurstilla verkið?", + "ALL_SURVEY_DATA_WILL_BE_LOST": "Öll svör í könnuninni munu tapast!", + "ENABLEUNCOMPLETESAVE": "Leyfa ekki kláraða vistun", + "SUBMIT": "Sendið", "PROJECT_NOT_AVAILABLE": "Project is not available. Please contact the administrator", - "COMPLETE": "Complete", + "COMPLETE": "Klárað", "SESSIONS_PROJECT": "Go to Sessions" }, "mwForm": { "form": { - "name": "Title", - "name.placeholder": "Form title", - "description": "Description" + "name": "Titill", + "name.placeholder": "Form á titli", + "description": "Lýsing" }, "buttons": { - "addPage": "Add page", - "moveDown": "Move down", - "moveUp": "Move up", - "removePage": "Remove page", - "remove": "Remove", - "addElement": "Add element", - "questionReady": "Ready", - "next": "Next", - "back": "Back", - "submit": "Submit", - "begin": "Begin", - "fold": "Fold", - "unfold": "Unfold", - "edit": "Edit", - "clone": "Clone", - "view": "View" + "addPage": "Bætið við síðu", + "moveDown": "Færið niður", + "moveUp": "Færið up", + "removePage": "Fjarlægið síðu", + "remove": "Fjarlægja", + "addElement": "Bætið við þætti", + "questionReady": "Tilbúið", + "next": "Næst", + "back": "Til baka", + "submit": "Senda", + "begin": "Byrja", + "fold": "Lokið", + "unfold": "Opnið", + "edit": "Beytið", + "clone": "Afritið", + "view": "Skoða" }, "page": { "tab": { @@ -108,9 +108,9 @@ "submitForm": "Submit form" }, "elements": { - "question": "Question", - "image": "Image", - "paragraph": "Paragraph" + "question": "Spurning", + "image": "Mynd", + "paragraph": "Málsgrein" }, "question": { "types": { @@ -218,11 +218,11 @@ "placeholder": "Enter paragraph text" }, "confirmationPage": { - "title": "Confirmation page", - "customMessage": "Custom confirmation message", - "defaultMessage": "Your response has been saved", - "errorMessage": "Error! Your response has not been saved", - "pendingMessage": "Your response is being saved" + "title": "Samþyktar síða", + "customMessage": "Sérsniðin samþykktar skilaboð", + "defaultMessage": "Viðbrögð þín hafa verið vistuð", + "errorMessage": "Villa! Viðbrögð þín hafa ekki verið vistuð", + "pendingMessage": "Svarið þitt verður geymt" } } } diff --git a/public/app/main/apps/mail/i18n/de.json b/public/app/main/apps/mail/i18n/de.json index e258a20..502582b 100644 --- a/public/app/main/apps/mail/i18n/de.json +++ b/public/app/main/apps/mail/i18n/de.json @@ -1,89 +1,89 @@ { "MAIL": { - "TEXT": "Text", - "TIMES": "Die Anzahl der Zeiten pro Interaktion", - "EDIT_AUTOREPLY": "Bearbeiten Sie automatische Antwort", - "AUTOREPLY": "Automatische Antwort", - "SHOW_AUTOREPLY": "Die automatische Antwort anzeigen", + "TEXT": "Textinhalt", + "TIMES": "Zeiten", + "EDIT_AUTOREPLY": "Automatische E-Mail-Antwort bearbeiten", + "AUTOREPLY": "Automatische E-Mail-Antwort", + "SHOW_AUTOREPLY": "Automatische Antwort anzeigen", "SHOW_DETAILS": "Details anzeigen", "HIDE_DETAILS": "Details ausblenden", - "TO": "Zu", + "TO": "An", "FROM": "Von", "DATE": "Datum", - "CC": "Cc", - "REPLY": "Antwort", + "CC": "CC", + "REPLY": "Antworten", "REPLY_ALL": "Allen antworten", - "FORWARD": "Vorwärts", + "FORWARD": "Weiterleiten", "SUBJECT": "Betreff", - "BCC": "Bcc", + "BCC": "BCC", "SEND": "Senden", "ATTACHMENT": "Anhang", "ATTACHMENTS": "Anhänge", "NAME": "Name", "MAILQUEUES": "E-Mail Warteschlangen", - "SEARCH_FOR_ANYONE": "Suche für Jedermann", - "STRATEGY": "Strategie", + "SEARCH_FOR_ANYONE": "Suche", + "STRATEGY": "Verteilungsstrategie", "ERRORS": { - "TEXT_REQUIRED": "Das Feld \"Text\" ist erforderlich", - "NAME_REQUIRED": "Der Name ist erforderlich", - "AGENT_TIMEOUT_REQUIRED": "Der Agent Timeout ist erforderlich", - "EMAIL_ADDRESS_REQUIRED": "Die E-Mail-Adresse ist erforderlich", - "EMAIL_ADDRESS_MUST_VALID": "Die E-Mail Adresse muss in einem gültigen Format", - "HOST_REQUIRED": "Der Host wird benötigt", - "USERNAME_REQUIRED": "Der Benutzername ist erforderlich", - "PORT_REQUIRED": "Der Port ist erforderlich", - "CONNTIMEOUT_REQUIRED": "Timeout der Verbindung ist erforderlich", - "AUTHTIMEOUT_REQUIRED": "Das Zeitlimit für die Authentifizierung erforderlich ist", - "ACCEPTURL_MUST_VALID_URL": "Die URL muss in einem gültigen Format", - "TIMEOUT_REQUIRED": "Der Timeout ist erforderlich", - "REJECTURL_MUST_VALID_URL": "Die URL muss in einem gültigen Format", - "CLOSEURL_MUST_VALID_URL": "Die URL muss in einem gültigen Format", - "AGENT_REQUIRED": "Der Agent ist erforderlich", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Timeout muss größer als oder gleich", - "DISPOSITION_REQUIRED": "Die Disposition ist erforderlich", - "CONDITION_REQUIRED": "Der Zustand ist erforderlich", - "TRUEPRIORITY_REQUIRED": "Die wahre Priorität ist erforderlich", - "FALSEPRIORITY_REQUIRED": "Die falsche Priorität ist erforderlich", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die wahre Priorität muss größer als oder gleich", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die falsche Priorität muss größer als oder gleich", - "PRIORITY_REQUIRED": "Die Priorität ist erforderlich", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Priorität muss größer als oder gleich", - "QUEUE_REQUIRED": "Die Warteschlange ist erforderlich", - "LIST_REQUIRED": "Die Liste ist erforderlich", - "PASSWORD_REQUIRED": "Das Kennwort ist erforderlich", - "SERVICE_REQUIRED": "Der Dienst ist erforderlich,", - "IMAP_HOST_REQUIRED": "Der IMAP-Host wird benötigt", - "IMAP_PORT_REQUIRED": "Der IMAP-Anschluss erforderlich", - "SMTP_HOST_REQUIRED": "Der SMTP-Host ist erforderlich", - "SMTP_PORT_REQUIRED": "Der SMTP-Port ist erforderlich", - "CONFIRM_NOT_MATCH": "Die Passwörter nicht übereinstimmen", - "KEY_MAX_LENGTH": "Schlüssel muss eine maximale Länge von {{max}}", - "KEY_REQUIRED": "Der Schlüssel ist erforderlich", - "TEXT_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", - "VALUE_REQUIRED": "Pflichtfeld", - "FONT_SIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "FONT_SIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "FONT_SIZE_REQUIRED": "Pflichtfeld", - "COMMAND_REQUIRED": "Pflichtfeld", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "NAME_MUST_VALID_PATTERN": "Falsches Format", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Pflichtfeld", - "TAG_REQUIRED": "Pflichtfeld", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pflichtfeld", - "REPLY_TYPE_REQUIRED": "Pflichtfeld", + "TEXT_REQUIRED": "Testinhalt erforderlich", + "NAME_REQUIRED": "Name erforderlich", + "AGENT_TIMEOUT_REQUIRED": "Zeitüberschreitung Agent erforderlich", + "EMAIL_ADDRESS_REQUIRED": "E-Mail Adresse erforderlich", + "EMAIL_ADDRESS_MUST_VALID": "Ungültiges Format E-Mail", + "HOST_REQUIRED": "Host erforderlich", + "USERNAME_REQUIRED": "Nutzername erforderlich", + "PORT_REQUIRED": "Port erforderlich", + "CONNTIMEOUT_REQUIRED": "Zeitüberschreitung Verbindung erforderlich", + "AUTHTIMEOUT_REQUIRED": "Zeitüberschreitung Authentifizierung erforderlich", + "ACCEPTURL_MUST_VALID_URL": "Ungültiges Format URL", + "TIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", + "REJECTURL_MUST_VALID_URL": "Ungültiges Format URL bei Ablehnen", + "CLOSEURL_MUST_VALID_URL": "Ungültiges Format URL bei Schließen", + "AGENT_REQUIRED": "Agent erforderlich", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", + "DISPOSITION_REQUIRED": "Qualifizierung erforderlich", + "CONDITION_REQUIRED": "Bedingung erforderlich", + "TRUEPRIORITY_REQUIRED": "Priorität bei 'wahr' erforderlich", + "FALSEPRIORITY_REQUIRED": "Priorität bei 'falsch' erforderlich", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei 'wahr' muss größer oder gleich sein als", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei 'falsch' muss größer oder gleich sein als", + "PRIORITY_REQUIRED": "Priorität erforderlich", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität muss größer oder gleich sein als", + "QUEUE_REQUIRED": "Warteschlange erforderlich", + "LIST_REQUIRED": "Liste erforderlich", + "PASSWORD_REQUIRED": "Passwort erforderlich", + "SERVICE_REQUIRED": "Dienst erforderlich,", + "IMAP_HOST_REQUIRED": "IMAP-Host erforderlich", + "IMAP_PORT_REQUIRED": "IMAP-Port erforderlich", + "SMTP_HOST_REQUIRED": "SMTP-Host erforderlich", + "SMTP_PORT_REQUIRED": "SMTP-Port erforderlich", + "CONFIRM_NOT_MATCH": "Die Passwörter stimmen nicht überein", + "KEY_MAX_LENGTH": "Schlüssel darf eine maximale Länge von {{max}} haben", + "KEY_REQUIRED": "Schlüssel erforderlich", + "TEXT_MAX_LENGTH": "Text darf eine maximale Länge von {{max}} haben", + "VALUE_REQUIRED": "Wert erforderlich", + "FONT_SIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Schriftgröße muss größer oder gleich sein als", + "FONT_SIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Schriftgröße muss kleiner oder gleich sein als", + "FONT_SIZE_REQUIRED": "Schriftgröße erforderlich", + "COMMAND_REQUIRED": "Eingabe erforderlich", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent muss größer oder gleich sein als", + "NAME_MUST_VALID_PATTERN": "Ungültiges Format Name", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss kleiner oder gleich sein als", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent muss kleiner oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Warten auf zugew. Agenten muss größer oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Warten auf zugew. Agenten muss kleiner oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Warten auf zugew. Agenten erforderlich", + "TAG_REQUIRED": "Tag erforderlich", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agententransfer muss größer oder gleich sein als", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agententransfer muss kleiner oder gleich sein als", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Agententransfer erforderlich", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Warteschlangentransfer muss größer oder gleich sein als", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Warteschlangentransfer muss kleiner oder gleich sein als", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Warteschlangentransfer erforderlich", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Agentenstatus bei Qualifizierung erforderlich", + "REPLY_TYPE_REQUIRED": "Antworttyp erforderlich", "FIELD_REQUIRED": "Pflichtfeld" }, - "AGENT_TIMEOUT": "Agent Timeout", + "AGENT_TIMEOUT": "Zeitüberschreitung Agent", "DESCRIPTION": "Beschreibung", "ADD_MAILQUEUE": "E-Mail Warteschlange hinzufügen", "EDIT_MAILQUEUE": "E-Mail Warteschlange bearbeiten", @@ -94,104 +94,104 @@ "MAILACCOUNTS": "E-Mail Konten", "EMAIL_ADDRESS": "E-Mail Adresse", "ADD_MAILACCOUNT": "E-Mail Konto hinzufügen", - "EDIT_MAILACCOUNT": "E-Mail-Konto bearbeiten", - "DELETE_MAILACCOUNT": "E-Mail-Konten löschen", - "DISPOSITIONS": "Bestimmungen", + "EDIT_MAILACCOUNT": "E-Mail Konto bearbeiten", + "DELETE_MAILACCOUNT": "E-Mail Konto löschen", + "DISPOSITIONS": "Qualifizierungen", "WEBHOOKS": "WebHooks", - "ACTIONS": "Aktionen", - "OTHERS": "Andere", + "ACTIONS": "Routing", + "OTHERS": "Weitere", "LIST": "Liste", "TEMPLATE": "Vorlage", "FIDELITY": "Treue", "SERVICE": "Service", "CREATED_AT": "Erstellt am", - "ACCEPT": "Akzeptieren", - "ACCEPTMETHOD": "Die Methode", - "ACCEPTURL": "URL akzeptieren", + "ACCEPT": "Annehmen", + "ACCEPTMETHOD": "Annehmen Methode", + "ACCEPTURL": "Annehmen URL", "REJECT": "Ablehnen", - "REJECTMETHOD": "Methode ablehnen", - "REJECTURL": "URL ablehnen", - "CLOSE": "In der Nähe", - "CLOSEMETHOD": "In der Nähe Methode", - "CLOSEURL": "Der URL", - "WHITELABEL": "White Label", - "SIGNATURE": "Unterschrift", + "REJECTMETHOD": "Ablehnen Methode", + "REJECTURL": "Ablehnen URL", + "CLOSE": "Schließen", + "CLOSEMETHOD": "Verhalten bei Schließen bearbeiten", + "CLOSEURL": "URL bei Schließen", + "WHITELABEL": "WhiteLabel", + "SIGNATURE": "Signatur", "IMAP": "IMAP", "HOST": "Host", - "USERNAME": "Benutzername", - "PORT": "Hafen", - "MAILBOX": "Mailbox", + "USERNAME": "Nutzername", + "PORT": "Port", + "MAILBOX": "Postfach", "FILTER": "Filter", - "CONNTIMEOUT": "Connection Timeout [sek]", - "AUTHTIMEOUT": "Authentication Timeout [sek]", + "CONNTIMEOUT": "Zeitüberschreitung Verbindung [Sek]", + "AUTHTIMEOUT": "Zeitüberschreitung Authentifizierung [Sek]", "DELETE": "E-Mails vom Server löschen", "SSL": "SSL", "KEEPALIVE": "Keepalive", - "POLLING": "Polling", + "POLLING": "Abfrageintervall", "SMTP": "SMTP", - "SELECTED": "Ausgewählte", - "SELECT_ALL": "Alle auswählen", - "SELECT_NONE": "Wählen Sie \"Keine\"", + "SELECTED": "Ausgewählt", + "SELECT_ALL": "Alles auswählen", + "SELECT_NONE": "Nichts auswählen", "BACK": "Zurück", "MAIL": "E-Mail", - "ID": "Id", - "TIMEOUT": "Timeout", + "ID": "ID", + "TIMEOUT": "Zeitüberschreitung", "PASSWORD": "Passwort", - "NO_MAILDISPOSITION_AVAILABLE": "Keine E-Mail zur Verfügung Verfügungen", - "ADD_MAILDISPOSITION": "E-Mail hinzufügen Disposition", - "NEW_MAILDISPOSITION": "Neue E-Mail zur Verfügung", - "EDIT_MAILDISPOSITION": "Bearbeiten von E-Mail zur Verfügung", - "DELETE_MAILDISPOSITION": "Löschen von E-Mail zur Verfügung", - "MAILDISPOSITIONS": "E-Mail Verfügungen", + "NO_MAILDISPOSITION_AVAILABLE": "Keine Qualifizierungen vorhanden", + "ADD_MAILDISPOSITION": "E-Mail Qualifizierung hinzufügen", + "NEW_MAILDISPOSITION": "Neue E-Mail Qualifizierung", + "EDIT_MAILDISPOSITION": "E-Mail Qualifizierung bearbeiten", + "DELETE_MAILDISPOSITION": "E-Mail Qualifizierung löschen", + "MAILDISPOSITIONS": "E-Mail Qualifizierungen", "NEW_MAILQUEUE": "Neue E-Mail Warteschlange", - "NEW_MAILACCOUNT": "Neue E-Mail Konto", - "NO_AVAILABLE_INFO": "Keine verfügbaren Info", - "ALL_TEAMS": "Alle Mannschaften", + "NEW_MAILACCOUNT": "Neues E-Mail Konto", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", + "ALL_TEAMS": "Alle Teams", "SELECTED_TEAMS": "Ausgewählte Teams", "HELP": { "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", - "USERNAME": "Benutzername für die Authentifizierung verwendet werden", - "PASSWORD": "Kennwort für die Authentifizierung verwendet werden", - "SECURE": "Bei true wird die Verbindung TLS verwenden, wenn eine Verbindung zu Server", - "FONT_FAMILY": "Standardschriftfamilie", + "USERNAME": "Verwendeter Nutzername für die Authentifizierung", + "PASSWORD": "Verwendetes Passwort für die Authentifizierung", + "SECURE": "TLS-Verbindung aktivieren/deaktivieren", + "FONT_FAMILY": "Schriftfamilie", "FONT_SIZE": "Standard Schriftgröße", - "MARK_AS_UNREAD": "Agent aktivieren / deaktivieren, um die letzte Nachricht einer Interaktion als ungelesen zu markieren", - "MANDATORYDISPOSITION": "Zwingende Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Anhalten, um zu verwenden, wenn die obligatorische Disposition aktiviert ist", + "MARK_AS_UNREAD": "Agenten erlauben, eine E-Mail als gelesen/ungelesen zu markieren", + "MANDATORYDISPOSITION": "Qualifizierung erforderlich", + "MANDATORYDISPOSITIONPAUSEID": "Agentenstatus während Qualifizierung", "CLOUD_PROVIDER": "Für die Authentifizierung verwendeter Cloud-Anbieter" }, "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "Von", - "TEAMADD_MAILQUEUE": "Team Chat Warteschlange hinzufügen", - "AGENTADD_MAILQUEUE": "Agent zu Chatten Warteschlange hinzufügen", + "OF": "von", + "TEAMADD_MAILQUEUE": "Team hinzufügen", + "AGENTADD_MAILQUEUE": "Agenten hinzufügen", "ALL_AGENTS": "Alle Agenten", "SELECTED_AGENTS": "Ausgewählte Agenten", "AGENT": "Agent", - "EDIT_AGENT": "Agent bearbeiten", - "EDIT_CLOSE": "Bearbeiten Schließen", - "DISPOSITION": "Disposition", - "GOTOIF": "GotoIf", - "EDIT_GOTOIF": "Bearbeiten GotoIf", - "CONDITION": "Zustand", - "TRUEPRIORITY": "Wahre Priorität", - "FALSEPRIORITY": "Falsche Priorität", - "GOTOP": "GotoP", - "EDIT_GOTOP": "GotoP bearbeiten", + "EDIT_AGENT": "Agenten bearbeiten", + "EDIT_CLOSE": "Verhalten bei Schließen bearbeiten", + "DISPOSITION": "Qualifizierung", + "GOTOIF": "Absprung (GotoIf)", + "EDIT_GOTOIF": "Absprung (GoToIf) bearbeiten", + "CONDITION": "Bedingung", + "TRUEPRIORITY": "Absprung bei 'wahr'", + "FALSEPRIORITY": "Absprung bei 'falsch'", + "GOTOP": "Absprung auf Anwendung (GotoP)", + "EDIT_GOTOP": "Absprung (GotoP) bearbeiten", "PRIORITY": "Priorität", - "NOOP": "Noop", - "EDIT_NOOP": "Bearbeiten Noop", + "NOOP": "Log erstellen (NoOp)", + "EDIT_NOOP": "NoOp bearbeiten", "VALUE": "Wert", "QUEUE": "Warteschlange", "EDIT_QUEUE": "Warteschlange bearbeiten", - "INTERACTIONS": "Wechselwirkungen", - "STARTEDAT": "Gestartet am", + "INTERACTIONS": "Interaktionen", + "STARTEDAT": "Begonnen am", "CONTACT": "Kontakt", - "CLOSEDAT": "Geschlossen", - "NOTES": "Hinweise", - "NO_INTERACTION_AVAILABLE": "Es sind keine Wechselwirkungen zur Verfügung", + "CLOSEDAT": "Geschlossen am", + "NOTES": "Anmerkungen", + "NO_INTERACTION_AVAILABLE": "Keine Interaktionen vorhanden", "ACTIVE": "Aktiv", - "SECURE": "Sichere", + "SECURE": "Sicher", "AUTHENTICATION": "Authentifizierung", "SMTP_HOST": "SMTP-Host", "SMTP_PORT": "SMTP-Port", @@ -199,7 +199,7 @@ "IMAP_PORT": "IMAP-Port", "CONFIRM_PASSWORD": "Passwort bestätigen", "SELECT_STATUS": "Status auswählen", - "OPENED": "Öffnen", + "OPENED": "Geöffnet", "CLOSED": "Geschlossen", "ALL": "Alle", "SELECT_ACCOUNT": "Konto auswählen", @@ -209,124 +209,124 @@ "KEY": "Schlüssel", "SMTPSERVICE": "SMTP-Dienst", "UNPAUSE": "Pause beenden", - "DEFAULT_PAUSE": "Standard Pause", + "DEFAULT_PAUSE": "Standard-Pause", "LOGOUT": "An-/Abmelden", - "AGENTADD_QUEUE": "Agent E-Mail Warteschlange hinzufügen", - "VOICE": "Voice", + "AGENTADD_QUEUE": "Agenten hinzufügen", + "VOICE": "Sprachanrufe (Voice)", "CHAT": "Chat", - "SMS": "Sms", - "OPENCHANNEL": "Channel öffnen", + "SMS": "SMS", + "OPENCHANNEL": "Offener Kanal", "FAX": "Fax", - "REALTIME": "Echtzeit", + "REALTIME": "Echtzeit-Ansicht", "AGENTS": "Agenten", "QUEUES": "Warteschlangen", "ACCOUNTS": "Konten", - "FULLNAME": "Voller Name", - "INTERNAL": "Interne", - "PHONE_STATE": "Telefonstatus", - "PHONE_STATUS": "Telefonstatus", + "FULLNAME": "Vollständiger Name", + "INTERNAL": "Intern", + "PHONE_STATE": "Status Nebenstelle", + "PHONE_STATUS": "SIP-Status", "PAUSE": "Pause", "LOGGED_IN": "Angemeldet", - "PAUSED": "Angehalten", + "PAUSED": "in Pause", "READY": "Bereit", "WAITING": "Warten", - "TOTAL": "Insgesamt", - "IN": "In", - "OUT": "Aus", + "TOTAL": "Gesamt", + "IN": "Eingehend", + "OUT": "Ausgehend", "IMAP_STATUS": "IMAP-Status", "SMTP_STATUS": "SMTP-Status", "DISABLED": "Deaktiviert", "CONNECTED": "Verbunden", - "NEVER_VERIFIED": "Nie verifiziert", + "NEVER_VERIFIED": "Noch nicht verifiziert", "ERROR": "Fehler", "EDIT_ACCOUNT": "Konto bearbeiten", - "VERIFY_SMTP": "Überprüfen Sie die SMTP-", + "VERIFY_SMTP": "SMTP-Einstellungen überprüfen", "VERIFIED": "Überprüft", - "VERIFYSMTP_MAILACCOUNT": "Überprüfen Sie die SMTP-", - "GOTOREALTIME_MAILACCOUNT": "In Echtzeit, E-Mail Konto", - "GOTO_MAILACCOUNT": "In Echtzeit, E-Mail Konto", + "VERIFYSMTP_MAILACCOUNT": "E-Mail-Einstellungen überprüfen", + "GOTOREALTIME_MAILACCOUNT": "Direkt zur Echtzeit-Ansicht", + "GOTO_MAILACCOUNT": "Zum E-Mail Konto wechseln", "UNKNOWN": "Unbekannt", - "UNREGISTERED": "Unregistrierte", + "UNREGISTERED": "Nicht registriert", "UNAVAILABLE": "Nicht verfügbar", - "NOT_INUSE": "Nicht in Gebrauch", + "NOT_INUSE": "Nicht in Verwendung", "REACHABLE": "Erreichbar", - "IN_USE": "Im Einsatz", - "AGENTSADD_QUEUE": "Agenten zu Warteschlange hinzufügen", - "INFO": "Info", + "IN_USE": "In Verwendung", + "AGENTSADD_QUEUE": "Agenten hinzufügen", + "INFO": "Information", "NO_AGENT_ONLINE": "Kein Agent Online", - "GOTOREALTIME_MAILQUEUE": "In Echtzeit, E-Mail Warteschlange", - "PARTIALPAUSE": "Lastschriftzahlung teilweise Pause", + "GOTOREALTIME_MAILQUEUE": "Direkt zur Echtzeit-Ansicht", + "PARTIALPAUSE": "Teilpause", "BUSY": "Besetzt", "TIMER": "Timer", "IDLE": "Leerlauf", "CAPACITY": "Kapazität", - "SPYINTERACTION": "Spy", - "ADD_NOTE": "Notiz hinzufügen", - "NOTE": "Hinweis", + "SPYINTERACTION": "Interaktion anzeigen", + "ADD_NOTE": "Anmerkung hinzufügen", + "NOTE": "Anmerkung", "TAGS": "Tags", - "INTERACTIONS_MAILACCOUNT": "Zu Wechselwirkungen gehen", - "REFRESH_INTERACTIONS": "Aktualisieren Interaktionen", + "INTERACTIONS_MAILACCOUNT": "Direkt zu den Interaktionen", + "REFRESH_INTERACTIONS": "Interaktionen aktualisieren", "PENDING": "Ausstehend", - "SEND_AS_PENDING": "Senden als Ausstehend", + "SEND_AS_PENDING": "Senden und Zwischenstatus setzen", "SEND_AND_CLOSE": "Senden und Schließen", - "CANNED_ANSWER_NOT_FOUND": "Es wurden keine vordefinierten Antworten gefunden", - "CANNED_ANSWER_SEARCH": "Geben Sie einen Text ein, um eine vordefinierte Antwort zu suchen", + "CANNED_ANSWER_NOT_FOUND": "Vordefinierte Antwort konnte nicht gefunden werden", + "CANNED_ANSWER_SEARCH": "Textbaustein hier suchen", "NO_MAILCANNEDANSWER_AVAILABLE": "Keine vordefinierten Antworten verfügbar", - "NEW_MAILCANNEDANSWER": "Neue vordefinierte Antowrt", + "NEW_MAILCANNEDANSWER": "Neue vordefinierte Antwort", "ADD_MAILCANNEDANSWER": "Vordefinierte Antwort hinzufügen", - "EDIT_MAILCANNEDANSWER": "Vordefiierte Antwort bearbeiten", + "EDIT_MAILCANNEDANSWER": "Vordefinierte Antwort bearbeiten", "DELETE_MAILCANNEDANSWER": "Vordefinierte Antwort löschen", "SHOW_ORIGINAL_MESSAGE": "Ursprüngliche Nachricht anzeigen", "DELETE_INTERACTION": "Interaktion löschen", "ACCEPTED": "Akzeptiert", "FONT_FAMILY": "Schriftfamilie", "FONT_SIZE": "Schriftgröße", - "MARK_AS_UNREAD": "als ungelesen markieren", - "ADD_MAILSUBSTATUS": "Unterstatus hinzufügen", - "DELETE_MAILSUBSTATUS": "Löschen", - "EDIT_MAILSUBSTATUS": "Bearbeiten", - "MAILSUBSTATUSES": "E-Mail-Unterstatus", - "NEW_MAILSUBSTATUS": "Neuer Unterstatus", - "SEND_AS": "Senden Als", - "COMMAND": "Befehl", + "MARK_AS_UNREAD": "Als ungelesen markieren", + "ADD_MAILSUBSTATUS": "Zwischenstatus hinzufügen", + "DELETE_MAILSUBSTATUS": "Zwischenstatus löschen", + "EDIT_MAILSUBSTATUS": "Zwischenstatus bearbeiten", + "MAILSUBSTATUSES": "E-Mail Zwischenstatus", + "NEW_MAILSUBSTATUS": "Neuer Zwischenstatus", + "SEND_AS": "Senden als", + "COMMAND": "Eingabe", "EDIT_SYSTEM": "System bearbeiten", "SYSTEM": "System", "VARIABLE": "Variable", "NOTIFICATION": "Benachrichtigung", - "NOTIFICATIONSHAKE": "Shake", - "NOTIFICATIONSOUND": "Klingen", + "NOTIFICATIONSHAKE": "Schütteln", + "NOTIFICATIONSOUND": "Ton abspielen", "NOTIFICATIONTEMPLATE": "Vorlage", - "WAITFORTHEASSIGNEDAGENT": "Warte auf den zugewiesenen Agenten", + "WAITFORTHEASSIGNEDAGENT": "Auf zugewiesenen Agenten warten", "EDIT_TAG": "Tag bearbeiten", - "TAG": "Etikett", - "AGENTTRANSFER": "Agentenübertragung", - "AGENTTRANSFERTIMEOUT": "Zeitlimit für Agentenübertragungen", - "QUEUETRANSFER": "Warteschlangenübertragung", - "QUEUETRANSFERTIMEOUT": "Zeitüberschreitung bei der Warteschlangenübertragung", + "TAG": "Tag", + "AGENTTRANSFER": "Transfer an Agenten erlauben", + "AGENTTRANSFERTIMEOUT": "Zeitüberschreitung für Agententransfer", + "QUEUETRANSFER": "Transfer an Warteschlange erlauben", + "QUEUETRANSFERTIMEOUT": "Zeitüberschreitung für Warteschlangentransfer", "TRANSFER": "Transfer", - "AGENTADD_MAILACCOUNT": "Fügen Sie dem E-Mail-Konto Agent hinzu", - "YOU_ARE_REGISTERED_AS_A": "Sie sind registriert als", + "AGENTADD_MAILACCOUNT": "Agenten hinzufügen", + "YOU_ARE_REGISTERED_AS_A": "Sie sind angemeldet als", "CANNEDANSWERS": "Vordefinierte Antworten", - "DOWNLOAD_INTERACTION": "Herunterladen", + "DOWNLOAD_INTERACTION": "Interaktion herunterladen", "MAILCANNEDANSWERS": "Vordefinierte Antworten", - "LOGIN_TIME": "Login-Zeit", - "PAUSE_TIME": "Pausenzeit", + "LOGIN_TIME": "Zeit angemeldet", + "PAUSE_TIME": "Zeit in Pause", "DOWNLOAD": "Herunterladen", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download ohne Anhänge", - "DOWNLOAD_WITH_ATTACHMENTS": "Mit Anhängen herunterladen", - "TEAMS_ASSOCIATION": "Vereinigung der Mannschaften", - "MANDATORYDISPOSITION": "Zwingende Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause zur Verwendung, wenn die obligatorische Disposition aktiviert ist", - "ADVANCED": "Fortgeschritten", - "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", - "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft", - "DOWNLOAD_WITHOUT_ATTACHMENT": "Ohne Anhang herunterladen", - "DOWNLOAD_WITH_ATTACHMENT": "Download mit Anhang", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Herunterladen ohne Anhänge", + "DOWNLOAD_WITH_ATTACHMENTS": "Herunterladen inkl. Anhängen", + "TEAMS_ASSOCIATION": "Teamzuweisung", + "MANDATORYDISPOSITION": "Qualifizierung erforderlich", + "MANDATORYDISPOSITIONPAUSEID": "Agentenstatus während Qualifizierung", + "ADVANCED": "Erweitert", + "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufzeichnung deaktiviert", + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufzeichnung aktiv", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Herunterladen ohne Anhang", + "DOWNLOAD_WITH_ATTACHMENT": "Herunterladen inkl. Anhang", "LASTMESSAGE": "Letzte Nachricht", "REPLY_TYPE": "Antworttyp", "CLOUD_PROVIDER": "Cloud-Anbieter", - "CREDENTIALS": "Referenzen", - "CUSTOM": "Brauch", + "CREDENTIALS": "Zugangsdaten", + "CUSTOM": "Benutzerdefiniert", "MODERN_AUTHENTICATION": "Moderne Authentifizierung" } } diff --git a/public/app/main/apps/mail/i18n/is.json b/public/app/main/apps/mail/i18n/is.json index 22a7db6..1f72f92 100644 --- a/public/app/main/apps/mail/i18n/is.json +++ b/public/app/main/apps/mail/i18n/is.json @@ -1,6 +1,6 @@ { "MAIL": { - "ADVANCED": "Advanced", + "ADVANCED": "Ítarlegt", "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments", "DOWNLOAD": "Download", @@ -33,12 +33,12 @@ "FONT_FAMILY": "Font Family", "FONT_SIZE": "Font Size", "MARK_AS_UNREAD": "Mark as unread", - "ACCEPTED": "Accepted", + "ACCEPTED": "Samþykkt", "CANNEDANSWERS": "Canned Answers", "MAILCANNEDANSWERS": "Canned Answers", "NO_MAILCANNEDANSWER_AVAILABLE": "No Canned Answers Available", "NEW_MAILCANNEDANSWER": "New Canned Answer", - "ADD_MAILCANNEDANSWER": "Add Canned Answer", + "ADD_MAILCANNEDANSWER": "Bæta við fyrirfram ákveðin svör ", "EDIT_MAILCANNEDANSWER": "Edit Canned Answer", "DELETE_MAILCANNEDANSWER": "Delete Canned Answer", "SHOW_ORIGINAL_MESSAGE": "Show original message", @@ -48,7 +48,7 @@ "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", "CANNED_ANSWER_SEARCH": "Enter a text to search a Canned Answer", "SPYINTERACTION": "Spy", - "ADD_NOTE": "Add note", + "ADD_NOTE": "Bæta við athugasemd", "NOTE": "Note", "TAGS": "Tags", "NO_AGENT_ONLINE": "No Agent Online", @@ -61,16 +61,16 @@ "UNPAUSE": "End Pause", "DEFAULT_PAUSE": "Default pause", "LOGOUT": "Logout", - "AGENTADD_QUEUE": "Add agent to Email queue", + "AGENTADD_QUEUE": "Bæta þjónustufulltrúa við biðröð fyrir tölvupóst - Add agent to Email queue", "VOICE": "Voice", "CHAT": "Chat", "SMS": "Sms", "OPENCHANNEL": "Open channel", "FAX": "Fax", "REALTIME": "Realtime", - "AGENTS": "Agents", + "AGENTS": "Þjónustufulltrúar ", "QUEUES": "Queues", - "ACCOUNTS": "Accounts", + "ACCOUNTS": "Reikningar", "FULLNAME": "Full Name", "INTERNAL": "Internal", "PHONE_STATE": "Phone State", @@ -183,7 +183,7 @@ }, "AGENT_TIMEOUT": "Agent Timeout", "DESCRIPTION": "Description", - "ADD_MAILQUEUE": "Add Email Queue", + "ADD_MAILQUEUE": "Bæta við röð tölvupósts ", "EDIT_MAILQUEUE": "Edit Email Queue", "DELETE_MAILQUEUE": "Delete Email Queue", "SETTINGS": "Settings", @@ -191,21 +191,21 @@ "SAVE": "Save", "MAILACCOUNTS": "Email Accounts", "EMAIL_ADDRESS": "Email Address", - "ADD_MAILACCOUNT": "Add Email Account", + "ADD_MAILACCOUNT": "Bæta við tölvupóstsreikning", "EDIT_MAILACCOUNT": "Edit Email Account", "DELETE_MAILACCOUNT": "Delete Email Account", "DISPOSITIONS": "Dispositions", "WEBHOOKS": "WebHooks", - "ACTIONS": "Actions", + "ACTIONS": "Aðgerðir", "OTHERS": "Others", "LIST": "List", "TEMPLATE": "Template", "FIDELITY": "Fidelity", "SERVICE": "Service", "CREATED_AT": "Created At", - "ACCEPT": "Accept", - "ACCEPTMETHOD": "Accept Method", - "ACCEPTURL": "Accept URL", + "ACCEPT": "Samþykkja", + "ACCEPTMETHOD": "Samþykkja aðferð", + "ACCEPTURL": "Samþykkja URL", "REJECT": "Reject", "REJECTMETHOD": "Reject Method", "REJECTURL": "Reject URL", @@ -236,7 +236,7 @@ "TIMEOUT": "Timeout", "PASSWORD": "Password", "NO_MAILDISPOSITION_AVAILABLE": "No Email Dispositions available", - "ADD_MAILDISPOSITION": "Add Email Disposition", + "ADD_MAILDISPOSITION": "Bæta við fyrirkomulag tölvupósts ", "NEW_MAILDISPOSITION": "New Email Disposition", "EDIT_MAILDISPOSITION": "Edit Email Disposition", "DELETE_MAILDISPOSITION": "Delete Email Disposition", @@ -262,10 +262,10 @@ "ROWSPERPAGE": "Rows per page", "OF": "of", "TEAMADD_MAILQUEUE": "Add Team to Email Queue", - "AGENTADD_MAILQUEUE": "Add Agent to Email Queue", + "AGENTADD_MAILQUEUE": "Bæta þjónustufulltrúa við biðröð fyrir tölvupóst - Add Agent to Email Queue", "ALL_AGENTS": "All Agents", "SELECTED_AGENTS": "Selected Agents", - "AGENT": "Agent", + "AGENT": "Þjónustufulltrúi", "EDIT_AGENT": "Edit Agent", "EDIT_CLOSE": "Edit Close", "DISPOSITION": "Disposition", @@ -289,7 +289,7 @@ "CLOSEDAT": "Closed At", "NOTES": "Notes", "NO_INTERACTION_AVAILABLE": "No interactions available", - "ACTIVE": "Active", + "ACTIVE": "Virkur", "SECURE": "Secure", "AUTHENTICATION": "Authentication", "SMTP_HOST": "SMTP Host", @@ -303,7 +303,7 @@ "ALL": "All", "SELECT_ACCOUNT": "Select Account", "STATUS": "Status", - "ACCOUNT": "Account", + "ACCOUNT": "Reikningur", "OPEN": "Open", "KEY": "Key", "SMTPSERVICE": "SMTP Service", @@ -318,7 +318,7 @@ "INTERACTIONS_MAILACCOUNT": "Go to Interactions", "REFRESH_INTERACTIONS": "Refresh Interactions", "DELETE_INTERACTION": "Delete Interaction", - "AGENTADD_MAILACCOUNT": "Add Agent to Email Account", + "AGENTADD_MAILACCOUNT": "Bæta þjónustufulltrúa við tölvupóstsreikning", "TEAMS_ASSOCIATION": "Teams Association", "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", diff --git a/public/app/main/apps/marketplace/i18n/de.json b/public/app/main/apps/marketplace/i18n/de.json index f150ff2..054564e 100644 --- a/public/app/main/apps/marketplace/i18n/de.json +++ b/public/app/main/apps/marketplace/i18n/de.json @@ -15,7 +15,7 @@ "DESCRIPTION": "Beschreibung", "DOWNLOAD_PLUGIN": "Plugin herunterladen", "DROP_TO_UPLOAD": "Hochladen", - "DROP_TO_UPLOAD_MESSAGE": "Legen Sie Ihre Datei zum Hochladen hier ab. Nur PLZ - Max. 2 MB", + "DROP_TO_UPLOAD_MESSAGE": "Legen Sie Ihre Datei zum Hochladen hier ab. Nur PLZ - Max. 4 MB", "EDITOR": "Editor", "EDIT_PLUGIN": "Plugin bearbeiten", "FINISH": "Fertig", diff --git a/public/app/main/apps/motiondialer/i18n/de.json b/public/app/main/apps/motiondialer/i18n/de.json index 52050f2..52edfb7 100644 --- a/public/app/main/apps/motiondialer/i18n/de.json +++ b/public/app/main/apps/motiondialer/i18n/de.json @@ -2,700 +2,700 @@ "MOTIONDIALER": { "MOVE_HOPPERFINAL": "Kontakt wiederherstellen", "RESTORECONTACTS": "Kontakte wiederherstellen", - "NO_SUCH_NUMBER": "Keine solche Nummer", - "DIALORDERBYSCHEDULEDAT": "Bestellung Durch scheduledat", - "ASC": "ASC", - "DESC": "DESC", - "RECALLAGENT": "Agent abrufen", - "DIALRECALLINQUEUE": "In der Warteschlange abrufen", - "DIALRECALLMETIMEOUT": "Erinnere mich Timeout [min]", - "RECALLME": "Mich erinnern", + "NO_SUCH_NUMBER": "Nummer falsch", + "DIALORDERBYSCHEDULEDAT": "Wahlreihenfolge nach Planungsdatum", + "ASC": "Aufsteigend", + "DESC": "Absteigend", + "RECALLAGENT": "Agenten erneut anrufen", + "DIALRECALLINQUEUE": "In Warteschlange anrufen", + "DIALRECALLMETIMEOUT": "Zeitüberschreitung pers. Wiedervorlage [min]", + "RECALLME": "Pers. Wiedervorlage", "RECALLFAILEDTIMEOUT": "Rückruf fehlgeschlagen", - "PREVIEW_CAMPAIGN": "Vorschau Kampagnen", - "PREVIEW_CAMPAIGNS": "Vorschau Kampagnen", - "AMD": "Sternchen Anrufbeantwortererkennung (AMD)", - "AMDTOTALANALYSISTIME": "Insgesamt Analyse Zeit", - "AMDACTIVE": "AMD", - "AMDINITIALSILENCE": "Erste Stille", - "AMDGREETING": "Gruß", + "PREVIEW_CAMPAIGN": "Preview-Kampagne", + "PREVIEW_CAMPAIGNS": "Preview-Kampagnen", + "AMD": "Anrufbeantworter-Erkennung", + "AMDTOTALANALYSISTIME": "AB-Analyse Gesamtzeit", + "AMDACTIVE": "AB-Erkennung", + "AMDINITIALSILENCE": "Initiale Stille", + "AMDGREETING": "Willkommensnachricht", "AMDAFTERGREETINGSILENCE": "Stille nach Begrüßung", - "AMDSILENCETHRESHOLD": "Stille Schwellenwert", + "AMDSILENCETHRESHOLD": "Stille Schwellwert", "AMDMINWORDLENGTH": "Min. Wort Länge", - "AMDBETWEENWORDSSILENCE": "Die Stille zwischen den Worten", + "AMDBETWEENWORDSSILENCE": "Stille zwischen Worten", "AMDMAXIMUMWORDLENGTH": "Maximale Wortlänge", "AMDMAXIMUMNUMBEROFWORDS": "Maximale Anzahl der Wörter", - "GOTO_QUEUECAMPAIGN": "In Echtzeit, wenn Warteschlange Kampagnen gehen", - "GOTOREALTIME_QUEUECAMPAIGN": "In Echtzeit, wenn Warteschlange Kampagnen gehen", - "GOTO_IVRCAMPAIGN": "In Echtzeit, Ivr-Kampagnen gehen", - "GOTOREALTIME_IVRCAMPAIGN": "In Echtzeit, Ivr-Kampagnen gehen", - "LOGOUT": "An-/Abmelden", + "GOTO_QUEUECAMPAIGN": "Direkt zur Echtzeit-Ansicht", + "GOTOREALTIME_QUEUECAMPAIGN": "Direkt zur Echtzeit-Ansicht", + "GOTO_IVRCAMPAIGN": "Direkt zur IVR-Kampagne", + "GOTOREALTIME_IVRCAMPAIGN": "Direkt zur Echtzeit-Ansicht", + "LOGOUT": "An-/Abmeldung", "EDIT_CAMPAIGN": "Kampagne bearbeiten", - "LIMITED": "Begrenzt", - "IVR_CAMPAIGNS": "Ivr-Kampagnen", - "MOTIONDIALER": "Motion Bull", - "QUEUECAMPAIGNS": "Warteschlange Kampagnen", + "LIMITED": "Limitiert", + "IVR_CAMPAIGNS": "IVR-Kampagnen", + "MOTIONDIALER": "Outbound-Dialer", + "QUEUECAMPAIGNS": "Outbound-Kampagnen", "IVRCAMPAIGNS": "IVR-Kampagnen", - "MANAGED": "Verwaltet", + "MANAGED": "Bearbeitet", "AVAILABLE_CONTACTS_FINISHED": "Kontakte abgeschlossen", - "HISTORY": "Geschichte", - "SCHEDULEDAT": "Geplant für", - "HOPPERBLACKS": "Hopper Blacklist", - "NO_HOPPERBLACK_AVAILABLE": "Keine Reihen verfügbar", - "HOPPERFINALS": "Hopper Endg.", - "NO_HOPPERFINAL_AVAILABLE": "Keine Reihen verfügbar", - "HOPPERHISTORIES": "Hopper Geschichte", - "NO_HOPPERHISTORY_AVAILABLE": "Keine Reihen verfügbar", + "HISTORY": "Historie", + "SCHEDULEDAT": "Geplant am", + "HOPPERBLACKS": "Schwarze Liste - Kontakte in Anwahl", + "NO_HOPPERBLACK_AVAILABLE": "Keine Daten vorhanden", + "HOPPERFINALS": "Abgeschlossene Kontakte", + "NO_HOPPERFINAL_AVAILABLE": "Keine Daten verfügbar", + "HOPPERHISTORIES": "Kontakte in Anwahl - Historie", + "NO_HOPPERHISTORY_AVAILABLE": "Keine Daten verfügbar", "DELETE_HOPPERHISTORY": "Löschen", "DELETE_HOPPERFINAL": "Löschen", "CONTACTID": "Kontakt-ID", "STARTTIME": "Startzeit", - "RESPONSETIME": "Reaktionszeit", + "RESPONSETIME": "Antwortzeit", "ENDTIME": "Endzeit", "STATUS": "Status", - "HOPPERS": "Hopper", - "NO_HOPPER_AVAILABLE": "Keine Reihen verfügbar", - "EDIT_HOPPER": "Bearbeiten Hopper", - "DELETE_HOPPER": "Löschen Hopper", - "FINAL": "Endg.", + "HOPPERS": "Kontakte in Anwahl", + "NO_HOPPER_AVAILABLE": "Keine Daten vorhanden", + "EDIT_HOPPER": "Kontakte in Anwahl bearbeiten", + "DELETE_HOPPER": "Kontakte in Anwahl löschen", + "FINAL": "Abgeschlossen", "BLACKLIST": "Schwarze Liste", "NAME": "Name", - "VOICEQUEUES": "Voice Warteschlangen", - "SEARCH_FOR_ANYONE": "Suche für Jedermann", + "VOICEQUEUES": "Anruf-Warteschlangen", + "SEARCH_FOR_ANYONE": "Suche", "BACK": "Zurück", - "SELECTED": "Ausgewählte", - "SELECT_ALL": "Alle auswählen", - "SELECT_NONE": "Wählen Sie \"Keine\"", - "DELETE_VOICEDISPOSITION": "Löschen Stimme Disposition", - "EDIT_VOICEDISPOSITION": "Edit Voice Disposition", - "EDIT_VOICEQUEUE": "Edit Voice Warteschlange", + "SELECTED": "Ausgewählt", + "SELECT_ALL": "Alles auswählen", + "SELECT_NONE": "Nichts auswählen", + "DELETE_VOICEDISPOSITION": "Qualifizierung löschen", + "EDIT_VOICEDISPOSITION": "Qualifizierung bearbeiten", + "EDIT_VOICEQUEUE": "Warteschlange bearbeiten", "DELETE_VOICEQUEUE": "Warteschlange löschen", - "MOHSOUNDS": "Moh-Sounds", - "STRATEGY": "Strategie", + "MOHSOUNDS": "Halteansagen", + "STRATEGY": "Verteilungsstrategie", "DESCRIPTION": "Beschreibung", "INTERVAL": "Zeitintervall", - "ADD_VOICEQUEUE": "Voice Warteschlange hinzufügen", - "NEW_QUEUECAMPAIGN": "Neue Warteschlange Kampagne", + "ADD_VOICEQUEUE": "Warteschlange hinzufügen", + "NEW_QUEUECAMPAIGN": "Neue Warteschlangen-Kampagne", "ACTIVE": "Aktiv", "METHOD": "Methode", - "POWERLEVEL": "Leistung", - "DROPRATE": "Absenkgeschwindigkeit", - "AGENTBUSYFACTOR": "Agent besetzt Faktor", - "PREDICTIVEOPTIMIZATION": "Prädiktive Optimierung", - "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Prädiktive Optimierung Prozentsatz", - "PREDICTIVEINTERVAL": "Predictive Intervall", - "ADD_QUEUECAMPAIGN": "Warteschlange hinzufügen Kampagne", + "POWERLEVEL": "Level bei Power-Dialing", + "DROPRATE": "Drop-Rate", + "AGENTBUSYFACTOR": "Faktor Agenten besetzt", + "PREDICTIVEOPTIMIZATION": "Optimierung predictive-Dialing", + "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Optimierung Prozentsatz", + "PREDICTIVEINTERVAL": "Predictive-Intervall", + "ADD_QUEUECAMPAIGN": "Warteschlange hinzufügen", "CAMPAIGN": "Kampagne", "MAXCONCURRENTCALLS": "Max. Anzahl gleichzeitiger Anrufe", - "CONCURRENTCALLS": "Max. Anzahl gleichzeitiger Anrufe", - "ORIGINATE": "Stammen", - "ORIGINATECALLERIDNAME": "Die Anrufer-ID-Namen", - "ORIGINATECALLERIDNUMBER": "Anrufer-ID-Nummer", - "ORIGINATETIMEOUT": "Stammen Timeout", + "CONCURRENTCALLS": "Anzahl gleichzeitiger Anrufe", + "ORIGINATE": "Ursprung", + "ORIGINATECALLERIDNAME": "CallerID Name", + "ORIGINATECALLERIDNUMBER": "CallerID Nummer", + "ORIGINATETIMEOUT": "Zeitüberschreitung", "QUEUEOPTIONS": "Warteschlangenoptionen", - "QUEUETIMEOUT": "Warteschlange Timeout", - "CALLYSQUAREPROJECT": "Cally Square Projekt", - "RETRYANDFREQUENCY": "Wiederholen Sie Einstellungen", + "QUEUETIMEOUT": "Zeitüberschreitung Warteschlange", + "CALLYSQUAREPROJECT": "CallySquare Projekt", + "RETRYANDFREQUENCY": "Einstellungen Wiederversuch", "GLOBAL": "Global", - "GLOBALMAXRETRY": "Max. Wiederholungen", - "CONGESTION": "Überlastung", - "CONGESTIONMAXRETRY": "Max. Wiederholungen", - "CONGESTIONRETRYTIME": "Wiederholen Zeit [min]", - "BUSYMAXRETRY": "Max. Wiederholungen", - "BUSYRETRYTIME": "Wiederholen Zeit [min]", + "GLOBALMAXRETRY": "Max. Wiederversuche", + "CONGESTION": "Leitungsstau (Congestion)", + "CONGESTIONMAXRETRY": "Max Wiederversuche bei Leitungsstau", + "CONGESTIONRETRYTIME": "Erneut versuchen nach [min]", + "BUSYMAXRETRY": "Max. Wiederversuche bei Besetzt", + "BUSYRETRYTIME": "Erneut versuchen nach [min]", "NOANSWER": "Keine Antwort", - "NOANSWERMAXRETRY": "Max. Wiederholungen", - "NOANSWERRETRYTIME": "Wiederholen Zeit [min]", - "QUEUE_PARAMS": "Queue Parameter", - "ORIGINATED": "Entstanden", + "NOANSWERMAXRETRY": "Max. Wiederversuche bei keiner Antwort", + "NOANSWERRETRYTIME": "Erneut versuchen nach [min]", + "QUEUE_PARAMS": "Warteschlangen-Parameter", + "ORIGINATED": "Ursprung", "MESSAGE": "Nachricht", - "DROPPED": "Zurück", + "DROPPED": "Aufgelegt vom System (Drop)", "CREATED_AT": "Erstellt am", "LEGEND": { "CUSTOM_APPLICATION": "(*) - Benutzerdefinierte Anwendung." }, "ERRORS": { - "DIALRECALLMETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer als oder gleich", - "DIALRECALLMETIMEOUT_REQUIRED": "Pflichtfeld", - "NAME_MUST_VALID_PATTERN": "Name gültig sein muss eine gültige Muster", - "PREFIX_MUST_VALID_PATTERN": "Präfix gültig sein muss eine gültige Muster", - "NAME_REQUIRED": "Der Name ist erforderlich", - "TIMEOUT_REQUIRED": "Der Timeout ist erforderlich", - "PHONENUMBER_REQUIRED": "Die Telefonnummer ist erforderlich", - "CONTEXT_REQUIRED": "Der Kontext ist erforderlich", - "DESTINATIONPATTERN_REQUIRED": "Das Ziel-pattern ist erforderlich", - "FULLNAME_REQUIRED": "Der vollständige Name ist erforderlich", - "EMAIL_REQUUIRED": "Die E-Mail ist erforderlich", - "EMAIL_MUST_VALID": "Die E-Mail muss ein gültiges Format geschrieben werden", - "MAILBOX_REQUIRED": "Die Mailbox muss angegeben werden", - "PASSWORD_REQUIRED": "Das Kennwort ist erforderlich", + "DIALRECALLMETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung erneuter Versuch muss größer oder gleich sein als", + "DIALRECALLMETIMEOUT_REQUIRED": "Zeitüberschreitung erneuter Versuch erforderlich", + "NAME_MUST_VALID_PATTERN": "Ungültiges Format Name", + "PREFIX_MUST_VALID_PATTERN": "Ungültiges Format Präfix", + "NAME_REQUIRED": "Name erforderlich", + "TIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", + "PHONENUMBER_REQUIRED": "Telefonnummer erforderlich", + "CONTEXT_REQUIRED": "Kontext erforderlich", + "DESTINATIONPATTERN_REQUIRED": "Ziel-Pattern erforderlich", + "FULLNAME_REQUIRED": "Vollständiger Name erforderlich", + "EMAIL_REQUUIRED": "E-Mail erforderlich", + "EMAIL_MUST_VALID": "Ungültiges Format E-Mail", + "MAILBOX_REQUIRED": "Mailbox erforderlich", + "PASSWORD_REQUIRED": "Passwort erforderlich", "CONFIRM_NOT_MATCH": "Die Passwörter stimmen nicht überein.", - "TIMEZONE_REQUIRED": "Die Zeitzone ist erforderlich", - "PREFIX_REQUIRED": "Das Präfix ist erforderlich,", - "OPTIONS_REQUIRED": "Die Optionen sind Erforderlich", - "AFTERCALLWORKDURATION_REQUIRED": "Die Arbeit nach Anruf Dauer ist erforderlich", - "TECHNOLOGY/RESOURCE_REQUIRED": "Die Technologie/Ressource ist erforderlich", - "PHONE_REQUIRED": "Die Telefonnummer ist erforderlich", - "VALUE_REQUIRED": "Der Wert ist erforderlich", - "EXTENSION_REQUIRED": "Die Verlängerung ist erforderlich", - "PRIORITY_REQUIRED": "Die Priorität ist erforderlich", - "GLOBALMAXRETRY_REQUIRED": "Max. Wiederholungen ist erforderlich", - "CONGESTIONMAXRETRY_REQUIRED": "Max. Wiederholungen ist erforderlich", - "CONGESTIONRETRYTIME_REQUIRED": "Zeit für Wiederholungen ist erforderlich", - "BUSYMAXRETRY_REQUIRED": "Max. Wiederholungen ist erforderlich", - "BUSYRETRYTIME_REQUIRED": "Zeit für Wiederholungen ist erforderlich", - "NOANSWERMAXRETRY_REQUIRED": "Max. Wiederholungen ist erforderlich", - "NOANSWERRETRYTIME_REQUIRED": "Zeit für Wiederholungen ist erforderlich", - "QUEUETIMEOUT_REQUIRED": "Warteschlange Timeout ist erforderlich", - "ORIGINATETIMEOUT_REQUIRED": "Stammen Timeout ist erforderlich", - "GLOBALINTERVAL_REQUIRED": "Globale Intervall ist erforderlich", - "MAXCONCURRENTCALLS_REQUIRED": "Der Wert für die maximale Anzahl gleichzeitiger Anrufe ist erforderlich", - "CONCURRENTCALLS_REQUIRED": "Der Wert für die Anzahl gleichzeitiger Anrufe ist erforderlich", - "POWERLEVEL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Leistung muss größer als oder gleich", - "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die prädiktive Optimierung Prozentsatz muss größer als oder gleich", - "PREDICTIVEINTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die prädiktive Intervall muss größer als oder gleich", - "MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die maximale Anzahl gleichzeitiger Anrufe muss größer als oder gleich", - "ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die stammen Timeout muss größer als oder gleich", - "QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Warteschlange Timeout muss größer als oder gleich", - "AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Agent Timeout muss größer als oder gleich", - "RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Wiederholung muss größer als oder gleich", - "WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Nachlese Zeit muss größer als oder gleich", - "WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Das Gewicht muss größer als oder gleich", - "GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die globale Max wiederholen muss größer als oder gleich", - "CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Überlastung Max wiederholen muss größer als oder gleich", - "CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Verkehrsüberlastung erneut Zeit muss größer als oder gleich", - "BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die geschäftige Max wiederholen muss größer als oder gleich", - "BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die geschäftige Zeit für Wiederholungen muss größer als oder gleich", - "NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Antwort Nein Max wiederholen muss größer als oder gleich", - "NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Zeitüberschreitung für keine Antwort Zeit für Wiederholungen muss größer als oder gleich", - "CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die gleichzeitige Anrufe muss größer als oder gleich", - "POWERLEVEL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die Leistung muss kleiner als oder gleich", - "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die prädiktive Optimierung Prozentsatz muss kleiner als oder gleich", - "PREDICTIVEINTERVAL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die prädiktive Intervall muss kleiner als oder gleich", - "MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die maximale Anzahl gleichzeitiger Anrufe muss kleiner als oder gleich", - "ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die stammen Timeout muss kleiner als oder gleich", - "QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die Warteschlange Timeout muss kleiner als oder gleich", - "GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die globale Max wiederholen muss kleiner als oder gleich", - "CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die Überlastung Max wiederholen muss kleiner als oder gleich", - "CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die Überlastung Zeit für Wiederholungen muss kleiner als oder gleich", - "BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die geschäftige Max wiederholen muss kleiner als oder gleich", - "BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die geschäftige Zeit für Wiederholungen muss kleiner als oder gleich", - "NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die Antwort Nein Max wiederholen muss kleiner als oder gleich", - "NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die Zeitüberschreitung für keine Antwort Zeit für Wiederholungen muss kleiner als oder gleich", - "CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die gleichzeitige Anrufe muss kleiner als oder gleich", - "EMAIL_REQUIRED": "Pflichtfeld", - "AGENTTIMEOUT_REQUIRED": "Pflichtfeld", - "INTERVAL_REQUIRED": "Pflichtfeld", - "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED": "Pflichtfeld", - "CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "CUTDIGIT_REQUIRED": "Pflichtfeld", - "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "AGENT_REQUIRED": "Pflichtfeld", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pflichtfeld", - "ABANDONEDMAXRETRY_REQUIRED": "Pflichtfeld", - "ABANDONEDRETRYTIME_REQUIRED": "Pflichtfeld", - "AGENTREJECTMAXRETRY_REQUIRED": "Pflichtfeld", - "AGENTREJECTRETRYTIME_REQUIRED": "Pflichtfeld", - "DROPMAXRETRY_REQUIRED": "Pflichtfeld", - "DROPRETRYTIME_REQUIRED": "Pflichtfeld", - "MACHINEMAXRETRY_REQUIRED": "Pflichtfeld", - "MACHINERETRYTIME_REQUIRED": "Pflichtfeld", - "NOSUCHNUMBERMAXRETRY_REQUIRED": "Pflichtfeld", - "NOSUCHNUMBERRETRYTIME_REQUIRED": "Pflichtfeld", - "CALLYSQUAREPROJECT_REQUIRED": "Pflichtfeld", - "TRUNK_REQUIRED": "Pflichtfeld", - "ABANDONEDMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "ABANDONEDRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "AGENTREJECTMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "AGENTREJECTRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "DROPMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "DROPRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", + "TIMEZONE_REQUIRED": "Zeitzone erforderlich", + "PREFIX_REQUIRED": "Präfix erforderlich,", + "OPTIONS_REQUIRED": "Optionen Erforderlich", + "AFTERCALLWORKDURATION_REQUIRED": "Dauer Nacharbeit erforderlich", + "TECHNOLOGY/RESOURCE_REQUIRED": "Technologie für Sprachverbindung erforderlich", + "PHONE_REQUIRED": "Telefonnummer erforderlich", + "VALUE_REQUIRED": "Wert erforderlich", + "EXTENSION_REQUIRED": "Nebenstelle erforderlich", + "PRIORITY_REQUIRED": "Priorität erforderlich", + "GLOBALMAXRETRY_REQUIRED": "Max. globale Wiederversuche erforderlich", + "CONGESTIONMAXRETRY_REQUIRED": "Max. Wiederversuche bei Leitungsstau erforderlich", + "CONGESTIONRETRYTIME_REQUIRED": "Zeit für Wiederversuch bei Leitungsstau erforderlich", + "BUSYMAXRETRY_REQUIRED": "Max. Wiederversuche bei Besetzt erforderlich", + "BUSYRETRYTIME_REQUIRED": "Zeit für Wiederversuche bei Besetzt erforderlich", + "NOANSWERMAXRETRY_REQUIRED": "Max. Wiederversuche bei keiner Antwort erforderlich", + "NOANSWERRETRYTIME_REQUIRED": "Zeit für Wiederversuche bei keiner Antwort erforderlich", + "QUEUETIMEOUT_REQUIRED": "Zeitüberschreitung Warteschlange erforderlich", + "ORIGINATETIMEOUT_REQUIRED": "Zeitüberschreitung Ursprung erforderlich", + "GLOBALINTERVAL_REQUIRED": "Globales Intervall erforderlich", + "MAXCONCURRENTCALLS_REQUIRED": "Max. gleichzeitige Anrufe erforderlich", + "CONCURRENTCALLS_REQUIRED": "Wert für die Anzahl gleichzeitiger Anrufe erforderlich", + "POWERLEVEL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Level muss größer oder gleich sein als", + "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Prozentsatz Predictive-Dialing muss größer oder gleich sein als", + "PREDICTIVEINTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Intervall bei Predictive-Dialing muss größer oder gleich sein als", + "MAXCONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Max. Anzahl gleichzeitiger Anrufe muss größer oder gleich sein als", + "ORIGINATETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Ursprung muss größer oder gleich sein als", + "QUEUETIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Warteschlange muss größer oder gleich sein als", + "AGENTTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent muss größer oder gleich sein als", + "RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Anzahl Wiederversuche muss größer oder gleich sein als", + "WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Dauer Nacharbeit muss größer oder gleich sein als", + "WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gewichtung muss größer oder gleich sein als", + "GLOBALMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Max. globale Wiederversuche müssen größer oder gleich sein als", + "CONGESTIONMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Max. Wiederversuche bei Leitungsstau müssen größer oder gleich sein als", + "CONGESTIONRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeit bei Leitungsstau muss größer oder gleich sein als", + "BUSYMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Max. Anzahl Wiederversuche bei Besetzt muss größer oder gleich sein als", + "BUSYRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeit bei Besetzt muss größer oder gleich sein als", + "NOANSWERMAXRETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Max. Anzahl Wiederversuche bei keiner Antwort muss größer oder gleich sein als", + "NOANSWERRETRYTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung bei keiner Antwort muss größer oder gleich sein als", + "CONCURRENTCALLS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Anzahl gleichzeitiger Anrufe muss größer oder gleich sein als", + "POWERLEVEL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Power-Level muss kleiner oder gleich sein als", + "PREDICTIVEOPTIMIZATIONPERCENTAGE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Prozentsatz Optimierung muss kleiner oder gleich sein als", + "PREDICTIVEINTERVAL_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Intervall Optimierung muss kleiner oder gleich sein als", + "MAXCONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Anzahl gleichzeitiger Anrufe muss kleiner oder gleich sein als", + "ORIGINATETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Ursprung muss kleiner oder gleich sein als", + "QUEUETIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Warteschlange muss kleiner oder gleich sein als", + "GLOBALMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. globale Wiederversuche müssen kleiner oder gleich sein als", + "CONGESTIONMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Wiederversuche bei Leitungsstau muss kleiner oder gleich sein als", + "CONGESTIONRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeit für Wiederversuch bei Leitungsstau muss kleiner oder gleich sein als", + "BUSYMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Wiederversuche bei Besetzt müssen kleiner oder gleich sein als", + "BUSYRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeit für Wiederversuch bei Besetzt muss kleiner oder gleich sein als", + "NOANSWERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Zeit für Wiederversuch bei keiner Antwort muss kleiner oder gleich sein als", + "NOANSWERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung bei keiner Antwort muss kleiner oder gleich sein als", + "CONCURRENTCALLS_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Anzahl gleichzeitiger Anrufe muss kleiner oder gleich sein als", + "EMAIL_REQUIRED": "E-Mail erforderlich", + "AGENTTIMEOUT_REQUIRED": "Zeitüberschreitung Agent erforderlich", + "INTERVAL_REQUIRED": "Intervall erforderlich", + "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert muss kleiner oder gleich sein als", + "RANDOMLASTDIGITCALLERIDNUMBER_REQUIRED": "Zufällige letzte Ziffer erforderlich", + "CUTDIGIT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert abgeschnittene Ziffern muss größer oder gleich sein als", + "CUTDIGIT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Wert abgeschnittene Ziffern muss kleiner oder gleich sein als", + "CUTDIGIT_REQUIRED": "Wert abgeschnittene Ziffern erforderlich", + "RANDOMLASTDIGITCALLERIDNUMBER_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wert muss größer oder gleich sein als", + "AGENT_REQUIRED": "Agent erforderlich", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Status während Qualifizierung erforderlich", + "ABANDONEDMAXRETRY_REQUIRED": "Max. Wiederversuche bei Verloren erforderlich", + "ABANDONEDRETRYTIME_REQUIRED": "Zeit Wiederversuch bei Verloren erforderlich", + "AGENTREJECTMAXRETRY_REQUIRED": "Max. Wiederversuche bei Ablehnen durch Agent erforderlich", + "AGENTREJECTRETRYTIME_REQUIRED": "Zeit Wiederversuch bei Ablehnen durch Agent erforderlich", + "DROPMAXRETRY_REQUIRED": "Max. Wiederversuche bei Drop-Calls erforderlich", + "DROPRETRYTIME_REQUIRED": "Zeit Wiederversuche bei Drop-Calls erforderlich", + "MACHINEMAXRETRY_REQUIRED": "Max. Wiederversuche bei Anrufbeantworter erforderlich", + "MACHINERETRYTIME_REQUIRED": "Zeit Wiederversuche bei Anrufbeantworter erforderlich", + "NOSUCHNUMBERMAXRETRY_REQUIRED": "Max. Wiederversuche bei Nummer falsch erforderlich", + "NOSUCHNUMBERRETRYTIME_REQUIRED": "Zeit Wiederversuche bei Nummer falsch erforderlich", + "CALLYSQUAREPROJECT_REQUIRED": "CallySquare-Projekt erforderlich", + "TRUNK_REQUIRED": "SIP-Trunk erforderlich", + "ABANDONEDMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Wiederversuche bei Verloren müssen kleiner oder gleich sein als", + "ABANDONEDRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeit bei Verloren muss kleiner oder gleich sein als", + "AGENTREJECTMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Wiederversuche bei Ablehnung durch Agent muss kleiner oder gleich sein als", + "AGENTREJECTRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeit bei Ablehnung durch Agent muss kleiner oder gleich sein als", + "DROPMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Wiederversuche bei Drop-Calls muss kleiner oder gleich sein als", + "DROPRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeit bei Drop-Calls muss kleiner oder gleich sein als", + "MACHINEMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Wiederversuche bei Anrufbeantworter muss kleiner oder gleich sein als", + "MACHINERETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeit bei Anrufbeantworter muss kleiner oder gleich sein als", + "NOSUCHNUMBERMAXRETRY_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Wiederversuche bei Nummer falsch muss kleiner oder gleich sein als", + "NOSUCHNUMBERRETRYTIME_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeit bei falscher Nummer muss kleiner oder gleich sein als", "CALLADDITIONALPHONEAFTERMIN_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Rufen Sie add.phone nach min. sollte größer oder gleich sein", "CALLADDITIONALPHONEAFTERMIN_REQUIRED": "Pflichtfeld" }, "GENERAL": "Allgemein", - "AGENTTIMEOUT": "Agent Timeout", + "AGENTTIMEOUT": "Zeitüberschreitung Agent", "MAXLENGTH": "Maximale Länge", - "RETRY": "Erneut versuchen", - "WRAPUPTIME": "Wrapup Zeit", - "WEIGHT": "Gewicht", - "JOINWHENEMPTY": "Melden Sie wenn sie leer", - "LEAVEWHENEMPTY": "Verlassen, wenn leer", + "RETRY": "Wiederversuch", + "WRAPUPTIME": "Nacharbeitszeit", + "WEIGHT": "Gewichtung", + "JOINWHENEMPTY": "Eintritt, wenn leer", + "LEAVEWHENEMPTY": "Austritt, wenn leer", "HELP": { - "DIALORDERBYSCHEDULEDAT": "Sie Kontakte von Hopper (absteigend oder aufsteigend).", - "DIALRECALLINQUEUE": "Planen Sie für die Agenten in der Warteschlange", - "DIALRECALLMETIMEOUT": "Zeitintervall (in Minuten), für die mir der Gültigkeitsdauer", - "PRIORITY": "Priorität in der Liste", - "AMDMAXIMUMWORDLENGTH": "Zulässige Höchstdauer von einer einzigen Stimme auszusprechen.", - "AMDMINWORDLENGTH": "Minimale Dauer eines Voice ein Wort betrachtet zu werden.", - "AMDSILENCETHRESHOLD": "Wenn die durchschnittliche Höhe der Lärm in einer Probe, die diesen Wert nicht erreichen, aus einer Skala von 0 bis 32767, dann werden wir es als Stille betrachten", - "AMDTOTALANALYSISTIME": "Maximale Zeit für den Algorithmus, ob die Audio stellt ein Mensch oder eine Maschine zu entscheiden erlaubt", - "AMDAFTERGREETINGSILENCE": "Stille nach der Feststellung einer Begrüßung. Wenn die Zeit überschritten wird, dann ist das Ergebnis der Erkennung als Mensch", - "AMDGREETING": "Maximale Länge für eine Grußansage. Wenn die Zeit überschritten wird, dann ist das Ergebnis der Erkennung als Maschine", - "AMDINITIALSILENCE": "\"Längstmögliche Stille Dauer, bevor Sie die Grußansage auf. Wenn die Zeit überschritten wird, dann ist das Ergebnis der Erkennung als Maschine", - "AMDACTIVE": "Aktivieren oder Deaktivieren von Anrufbeantwortern Erkennung Versuche", - "AMDBETWEENWORDSSILENCE": "Minimale Dauer der Stille nach einem Wort, die Audio, die als neues Wort folgt in Betracht zu ziehen", - "AMDMAXIMUMNUMBEROFWORDS": "Maximale Anzahl der Wörter in der Begrüßung. Wenn es erreicht wird, dann ist das Ergebnis der Erkennung als Maschine", - "CALLYSQUAREPROJECT": "Wenn Sie ein IVR-Projekt aus der Liste aus, das Wählsystem den Anruf an den IVR-Dienst, bevor Sie ihn in einer Warteschlange.", + "DIALORDERBYSCHEDULEDAT": "Anwahl der Kontakte nach Planungsdatum sortieren (auf/absteigend)", + "DIALRECALLINQUEUE": "Wiedervorlage in Warteschlange anwählen", + "DIALRECALLMETIMEOUT": "Zeitüberschreitung (Minuten) für die allgemeine Wiedervorlage", + "PRIORITY": "Priorität inerhalb der Liste", + "AMDMAXIMUMWORDLENGTH": "Maximale Wortlänge für die AB-Erkennung", + "AMDMINWORDLENGTH": "Minimale Wortlänge für die AB-Erkennung", + "AMDSILENCETHRESHOLD": "Schwellwert für die Analyse der Stille bei AB-Erkennung", + "AMDTOTALANALYSISTIME": "Max. Zeit für die Entscheidung, ob ein Anrufbeantworter vorliegt, oder nicht", + "AMDAFTERGREETINGSILENCE": "Stille nach Begrüßungsansage für AB-Erkennung", + "AMDGREETING": "Maximale länge der Begrüßungsansage für die AB-Erkennung", + "AMDINITIALSILENCE": "Max. initiale Stille fpr die Analyse zur AB-Erkennung", + "AMDACTIVE": "Anruf aktivieren/deaktivieren", + "AMDBETWEENWORDSSILENCE": "Minimale Stille zwischen 2 Wörtern", + "AMDMAXIMUMNUMBEROFWORDS": "Max. Anzahl Wörter in der Begrüßungsansage", + "CALLYSQUAREPROJECT": "IVR-Projekt (CallySquare) aus der Liste auswählen", "PREFIX": "Vorwahl", "ACTIVE": "Aktiv", - "AGENTTIMEOUT": "Gibt die Anzahl von Sekunden, die ein Agent Gerät klingeln.", - "MAXLENGTH": "Gibt die maximale Anzahl der Anrufer in der Wartezeit in der Warteschlange. Ein Wert von Null bedeutet, dass eine unbegrenzte Anzahl von Anrufern in der Warteschlange erlaubt sind.", - "RETRY": "Gibt die Anzahl der Sekunden, bevor das nächste Mitglied in der Warteschlange, wenn der Wert für das Zeitlimit ausgeschöpft ist, während versucht wird, eine Mitglied der Warteschlange, um an den Zahnkranz zu warten.", - "WRAPUPTIME": "Die Anzahl der Sekunden, die ein Mitglied in einer Warteschlange nicht mehr verfügbar, nachdem Sie einen Anruf halten.", - "WEIGHT": "Legt das Gewicht einer Warteschlange. Eine Warteschlange mit einem höheren Gewicht definiert wird erste Priorität erhalten, wenn die Mitglieder mit mehreren Warteschlangen zugeordnet sind.", - "JOINWHENEMPTY": "Steuert, ob ein Anrufer in der Warteschlange hinzugefügt wird, wenn keine Mitglieder vorhanden sind.", - "LEAVEWHENEMPTY": "Verwendet, um zu steuern, ob Anrufer aus der Warteschlange gekickt werden, wenn Mitglieder nicht mehr Anrufe verfügbar sind.", - "ANNOUNCEFREQUENCY": "Legt fest, wie oft wir die Position des Anrufers und/verkünden sollten oder geschätzte Wartezeit in der Warteschlange. Stellen Sie diesen Wert auf Null zu deaktivieren.", - "MINANNOUNCEFREQUENCY": "Gibt die minimale Zeit, die verstreichen muss, bevor wir die Position des Anrufers in der Warteschlange erneut zu verkünden. Dies wird verwendet, wenn der Anrufer häufig ändern kann, wird der Anrufer hören mehrere Updates in einem kurzen Zeitraum zu verhindern.", - "PERIODICANNOUNCEFREQUENCY": "Gibt an, wie oft wir in regelmäßigen Abständen Mitteilungen an den Anrufer machen sollte.", - "ANNOUNCEPOSITIONLIMIT": "Wenn Sie definiert haben verkünden - Position als entweder einzuschränken oder mehr.", - "AFTERCALLWORKDURATION": "Die Dauer der Pause durch die Option \"Arbeit nach Anruf ausgelöst", - "MEMBERDELAY": "Verwendet, wenn es eine Verzögerung, bevor der Anrufer und Warteschlange Mitglied miteinander verbunden werden möchten.", - "MUSICONHOLD": "Setzt die Musik klasse von einer bestimmten Warteschlange verwendet werden.", - "ANNOUNCETOAGENT": "Für das Spielen eine Ansage, die auf den Agenten, der den Anruf entgegengenommen, in der Regel verwendet, um ihn wissen zu lassen, was der Anrufer Warteschlange kommt.", - "RANDOMPERIODICANNOUNCE": "Wenn \"yes\" festgelegt ist, wird die definierte in regelmäßigen Abständen Mitteilungen in einer zufälligen Reihenfolge wiedergeben.", - "ANNOUNCEHOLDTIME": "Legt fest, ob die geschätzte Wartezeit zusammen mit dem in regelmäßigen Abständen Mitteilungen gespielt werden sollte.", - "ANNOUNCECALLERPOSITION": "Legt fest, ob die Position des Anrufers in der Warteschlange zu Ihrem angekündigt werden sollte. Ist Nein eingestellt, wird die Position wird nie bekannt gegeben. Wenn Sie auf \"Ja\" setzen, wird die Position des Anrufers wird immer bekannt gegeben werden. Wenn der Wert eingestellt ist, wird der Anrufer ihre Position in der Warteschlange hört nur, wenn er sich innerhalb der Grenze von verkünden - Position - Grenzwert festgelegt werden. Wenn der Wert auf mehr eingestellt ist, wird der Anrufer ihre Position zu hören, wenn Sie über die Anzahl von verkünden - Position - Grenzwert definiert ist.", - "REPORTHOLDTIMEAGENT": "Ermöglicht die Berichterstattung des Anrufers Haltezeit auf die Warteschlange, die vor dem Bridging.", - "PERIODICANNOUNCE": "Eine Reihe von in regelmäßigen Abständen Mitteilungen gespielt zu werden, spielte in der Reihenfolge, in der sie definiert sind.", - "HOLDTIMEANNOUNCE": "Wenn nicht angegeben, wird der Standardwert spielen (\"hold\"). Wenn auf einen leeren Wert gesetzt ist, wird die Aufforderung nicht gespielt werden.", - "YOUARENEXTANNOUNCE": "Wenn nicht angegeben, wird der Standardwert (\" Jetzt sind Sie in erster Linie\"). Wenn auf einen leeren Wert gesetzt ist, wird die Aufforderung nicht gespielt werden.", - "THEREAREANNOUNCE": "Wenn nicht angegeben, wird der Standardwert spielen (\"Es gibt\"). Wenn auf einen leeren Wert gesetzt ist, wird die Aufforderung nicht gespielt werden.", - "WAITINGCALLSANNOUNCE": "Wenn nicht angegeben, wird der Standardwert (\"Wartende Anrufe\"). Wenn auf einen leeren Wert gesetzt ist, wird die Aufforderung nicht gespielt werden.", - "ESTIMATEDHOLDTIMEANNOUNCE": "Wenn nicht angegeben, wird der Standardwert spielen (\"Das Voraussichtliche Wartezeit\"). Wenn auf einen leeren Wert gesetzt ist, wird die Aufforderung nicht gespielt werden.", - "MINUTESANNOUNCE": "Wenn nicht angegeben, wird der Standardwert spielen (\"min\"). Wenn auf einen leeren Wert gesetzt ist, wird die Aufforderung nicht gespielt werden.", - "MINUTEANNOUNCE": "Wenn nicht angegeben, wird der Standardwert (\"Minute\"). Wenn auf einen leeren Wert gesetzt ist, wird die Aufforderung nicht gespielt werden.", - "SECONDSANNOUNCE": "Wenn nicht angegeben, wird der Standardwert spielen (\"Sekunden\"). Wenn auf einen leeren Wert gesetzt ist, wird die Aufforderung nicht gespielt werden.", - "THANKYOUANNOUNCE": "Wenn nicht angegeben, wird der Standardwert spielen (\"Vielen Dank für Ihr Geduld\"). Wenn auf einen leeren Wert gesetzt ist, wird die Aufforderung nicht gespielt werden.", - "AFTERCALLWORK": "Wenn aktiv, wird für den Agenten in Pause nach einer abgeschlossenen Anruf in die Warteschlange eingestellt werden.", - "AUTOPAUSE": "Aktiviert/deaktiviert das automatische Anhalten der Mitglieder, die es versäumen, um einen Anruf zu beantworten. Wenn aktiv Ursachen dieses Mitglied in allen Warteschlangen er ist Mitglied der angehalten zu werden.", - "RINGINUSE": "Verwendet Senden von Anrufen an Mitglieder, deren Status im Einsatz ist zu vermeiden.", - "TIMEOUTRESTART": "Wenn die Einstellung Ja lautet, setzt den Timeout für einen Agenten zu beantworten, wenn entweder ein Besetztzeichen oder Staus Status aus dem Kanal empfangen wird.", - "MONITORFORMAT": "Gibt das Dateiformat zu verwenden, wenn Sie die Aufnahme. Wenn der Monitor-Format deaktiviert ist, werden die Anrufe nicht aufgezeichnet werden.", - "CONTEXT": "Kann ein Anrufer in die Warteschlange verlassen Sie durch Drücken einer einzigen MFV-Ziffer. Wenn ein Kontext angegeben ist und der Anrufer gibt eine Reihe, kann diese Ziffer wird der Versuch unternommen, im Rahmen angegebenen ausgeziffert werden, und Nummernplan Ausführung wird es weiter.", - "SETINTERFACEVARIABLES": "Wenn die Einstellung Ja lautet, gerade vor der Anrufer mit einer Warteschlange Mitglied überbrückt werden einige Variablen gesetzt werden (siehe Wiki)", - "SETQUEUEVARIABLES": "Wenn die Einstellung Ja lautet, gerade vor der Anrufer mit einer Warteschlange Mitglied überbrückt werden, und kurz vor dem Anrufer die Warteschlange verlassen einige Variablen gesetzt werden (siehe Wiki)", - "SETQUEUEENTRYVARIABLES": "Wenn die Einstellung Ja lautet, gerade vor der Anrufer mit einer Warteschlange Mitglied überbrückt werden einige Variablen gesetzt werden (siehe Wiki)", - "RECORDING": "Die Anrufaufzeichnung aktivieren", - "VOICEMAIL_CONTEXT": "Im Zusammenhang mit der relativen Erweiterung.", - "METHOD": "Outbound Dialer Methode.", - "POWERLEVEL": "Anzahl der Kontakte, für einen verfügbaren Agenten.", - "PREDICTIVEOPTIMIZATION": "Ein Faktor in der vorbestimmten Algorithmus zu optimieren.", - "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Prozentsatz, der auf die ausgewählten prädiktive Optimierung Faktor", - "PREDICTIVEINTERVAL": "Zeitintervall in Minuten mit prädiktiver Algorithmus berücksichtigt werden Anrufe zu berechnen für die Optimierung der prädiktive Optimierung Faktor zu generieren", - "MAXCONCURRENTCALLS": "Die maximale Anzahl gleichzeitiger Anrufe, die vom Outbound Dialer entstanden sein wird.", - "CONCURRENTCALLS": "Die maximale Anzahl gleichzeitiger Anrufe, die vom Outbound Dialer für diese Kampagne entstanden sein wird.", - "ORIGINATECALLERIDNAME": "Ausgehende Anrufer-ID-Namen", - "ORIGINATECALLERIDNUMBER": "Ausgehende Anrufer-ID-Nummer", - "ORIGINATETIMEOUT": "Zeit in Sekunden, die ausgehende Anrufe mit Ursprung Verbindung herzustellen. Wenn die Busverbindungen nicht hergestellt ist, wird der Status stammen, wird keine Antwort sein.", - "QUEUETIMEOUT": "Zeit (in Sekunden) ein Anruf in der Warteschlange warten, bevor es gelöscht wird (Min 1 und Max. 999)", - "GLOBALMAXRETRY": "Maximale Anzahl, wie oft ein Kontakt genannt wird, bevor es geschlossen", - "CONGESTIONMAXRETRY": "Maximale Anzahl, wie oft ein Kontakt konnte nicht für Staus Grund genannt wird, bevor es geschlossen", - "CONGESTIONRETRYTIME": "Zeit in Minuten, bevor Sie es erneut versuchen einen Kontakt für Staus Grund fehlgeschlagen zu erreichen.", - "NOANSWERMAXRETRY": "Maximale Anzahl, wie oft ein Kontakt konnte nicht für Keine Antwort Grund genannt wird, bevor es geschlossen", - "NOANSWERRETRYTIME": "Zeit in Minuten, bevor Sie es erneut versuchen einen Kontakt für Keine Antwort Reason zu erreichen.", - "GLOBALINTERVAL": "Globale Zeit, in der sich der Dialer erlaubt ist, Kontakte zu nennen. Bitte achten Sie, wenn Sie dieses Feld nicht ändern. Wir sind nicht verantwortlich oder haftbar für die Nichteinhaltung mit Autodialer Gesetze und Bestimmungen einzuhalten.", + "AGENTTIMEOUT": "Zeitüberschreitung Agent, bis der Anruf zum nächsten freien Mitglied weitergeleitet wird", + "MAXLENGTH": "Maximale Anzahl Kontakte in der Warteschlange", + "RETRY": "Erneuter Anrufversuch, abhängig vom Systemergebnis der Anwahl", + "WRAPUPTIME": "Zeit in Sekunden, in welcher der Agent nach einem Anruf keine weitere Interaktion zugestellt bekommt", + "WEIGHT": "Gewichtung der Warteschlangen untereinander. Kann verwendet werden, wenn ein Agent mehr als einer Warteschlange/Kampagne zugewiesen ist", + "JOINWHENEMPTY": "Definiert, ob ein Kontakt in die Warteschlange eintreten kann, sofern kein Agent verfügbar", + "LEAVEWHENEMPTY": "Definiert, ob ein Kontakt aus der Warteschlange austreten soll, wenn kein Agent mehr verfügbar", + "ANNOUNCEFREQUENCY": "Häufigkeit der regelmäßigen Ansagen in der Warteschlange", + "MINANNOUNCEFREQUENCY": "Minimale Ansagefrequenz", + "PERIODICANNOUNCEFREQUENCY": "Frequenz der regelmäßigen Ansagen", + "ANNOUNCEPOSITIONLIMIT": "Limitierung für das Ansagen der Warteposition", + "AFTERCALLWORKDURATION": "Dauer der Nacharbeit im Anschluss an eine Interaktion", + "MEMBERDELAY": "Verzögert die Zustellung des Anrufes an den Agenten (Kann z.B. bei aktiver Auto-Annahme verwendet werden)", + "MUSICONHOLD": "Playlist der Audiodateien innerhalb der Warteschlange", + "ANNOUNCETOAGENT": "Gibt dem Agenten einen akustischen Hinweis vor der Annahme des Anrufes", + "RANDOMPERIODICANNOUNCE": "Regelmäßige Ansagen werden zufällig abgespielt", + "ANNOUNCEHOLDTIME": "Definiert, ob die geschätzte Wartezeit dem Kontakt angesagt wird", + "ANNOUNCECALLERPOSITION": "Definiert, ob die aktuelle Warteposition dem Kontakt angesagt wird", + "REPORTHOLDTIMEAGENT": "Spielt dem Agenten die tatsächliche Wartezeit des Kontaktes vor der Annahme eines Anrufes vor", + "PERIODICANNOUNCE": "Audiodateien für regelmäßige Ansagen", + "HOLDTIMEANNOUNCE": "Audiodaten Wartezeit", + "YOUARENEXTANNOUNCE": "Audiodatei 'Position 1 in Warteschlange'", + "THEREAREANNOUNCE": "Audiodatei Teil 1 der Ansage zur Warteposition (Bsp: 'Vor Ihen befinden sich...'", + "WAITINGCALLSANNOUNCE": "Audiodatei Teil 2 der Ansage zur Warteposition (Bsp: '...wartende Anrufe')", + "ESTIMATEDHOLDTIMEANNOUNCE": "Audiodatei geschätzte Wartezeit (Bsp: 'Ihre gescätzte Wartezeit beträgt ca...')", + "MINUTESANNOUNCE": "Audiodatei 'Minuten'", + "MINUTEANNOUNCE": "Audiodatei 'Minute'", + "SECONDSANNOUNCE": "Audiodatei 'Sekunde'", + "THANKYOUANNOUNCE": "Audiodatei Dankesnachricht", + "AFTERCALLWORK": "Dauer der Nacharbeit nach einer Interaktion", + "AUTOPAUSE": "Automatische Pause bei verpasster Interaktion", + "RINGINUSE": "Definiert, ob Anrufe an der Nebenstelle des Agenten 'anklopfen' dürfen, wenn der Agent besetzt ist", + "TIMEOUTRESTART": "Zeitüberschreitung zum erneuten Starten der Anwahl der Nebenstelle des Agenten", + "MONITORFORMAT": "Aktiviert/deaktiviert die automatische Gesprächsaufzeichnung und legt deren Format fest", + "CONTEXT": "ermöglicht dem Kontakt das Abspringen aus der Warteschlange durch Drücken einer DTMF-Ziffer. Das weitere Verhalten kann im Anschluss im Wählplan definiert werden", + "SETINTERFACEVARIABLES": "Setzt Variablen bezogen auf das Agenteninterface (siehe Wiki)", + "SETQUEUEVARIABLES": "Setzt Variablen im Bezug auf die Warteschlange (siehe Wiki)", + "SETQUEUEENTRYVARIABLES": "Setzt Variablen im Bezug auf den Eintritt in die Warteschlange (siehe Wiki)", + "RECORDING": "Gesprächsaufzeichnung aktivieren", + "VOICEMAIL_CONTEXT": "Kontext zum Absprung auf Voicemail", + "METHOD": "Wählmethode des Outbound-Dialers", + "POWERLEVEL": "Anzahl der Anwahlen pro verfügbarem Agenten", + "PREDICTIVEOPTIMIZATION": "Faktor zur Optimierung des Predictive-Dialers", + "PREDICTIVEOPTIMIZATIONPERCENTAGE": "Prozentsatz der Optimierung des Predictive-Dialers", + "PREDICTIVEINTERVAL": "Zeitintervall für die Analyse des Predictive-Dialers", + "MAXCONCURRENTCALLS": "Maximale Anzahl gleichzeitig vom System gewählter Kontakte", + "CONCURRENTCALLS": "Anzahl gleichzeitig vom System gewählter Kontakte für die Kampagne", + "ORIGINATECALLERIDNAME": "Ausgehender Name (CallerIDName)", + "ORIGINATECALLERIDNUMBER": "Angezeigte Nummer (CallerID)", + "ORIGINATETIMEOUT": "Zeit in Sekunden für die initale Anwahl des Dialers", + "QUEUETIMEOUT": "Zeit in Sekunden, in welcher die Anwahl aufrecht erhalten wird", + "GLOBALMAXRETRY": "Maximale Anzahl globaler Wiederversuche pro Kontakt", + "CONGESTIONMAXRETRY": "Maximale Anzahl Wiederversuche, bei Systemergebnis 'Congestion'", + "CONGESTIONRETRYTIME": "Zeit für Wiederversuch bei Systemergebnis 'Congestion'", + "NOANSWERMAXRETRY": "Maximale Anzahl Wiederversuche bei Systemergebnis 'No Answer'", + "NOANSWERRETRYTIME": "Zeit für Wiederversuch bei Systemergebnis 'No Answer'", + "GLOBALINTERVAL": "Globales Zeitintervall für Anwahl von Kontakten", "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", - "TIMEOUT": "Gibt die Anzahl von Sekunden an, die ein Gerät klingeln.", - "CALLYSQUAREPROJECTPREVIEW": "Wenn Sie ein IVR-Projekt auswählen, leitet der Dialer den Anruf an das IVR weiter, wenn ein Agent antwortet (das IVR wird an den Agenten weitergeleitet).", - "CALLYSQUAREPROJECTPREVIEW2": "Wenn Sie ein IVR-Projekt auswählen, leitet der Dialer den Anruf an das IVR weiter, wenn ein Client aufgelegt oder nicht erreichbar ist (das IVR wird an den Agenten weitergeleitet).", - "RUNIFHANGUPAGENT": "Führen Sie Cally Square Project nach, auch wenn der Agent den Anruf auflegt", - "CALLYSQUAREPROJECT2": "Wenn Sie ein IVR-Projekt auswählen, leitet der Dialer den Anruf nach der Warteschlange an das IVR weiter. (Wenn die Warteschlange nach einer Zeitüberschreitung endet)", - "RANDOMLASTDIGITCALLERIDNUMBER": "Wenn es größer als 0 ist, erzeugt es die letzten Nummern zufällig aus der Nummer der abgehenden Anrufer-ID", - "BUSYMAXRETRY": "Maximale Anzahl, wie oft ein Kontakt angerufen wird, bevor er als geschlossen betrachtet wird, wenn der Anruf wegen Besetzt fehlschlägt", - "BUSYRETRYTIME": "Zeit in Minuten, bevor erneut versucht wird, einen fehlgeschlagenen Kontakt anzurufen, weil er beschäftigt ist", - "MANDATORYDISPOSITIONPAUSEID": "Pausenstatus, der während der Zwangsdisposition festgelegt werden soll", - "PREDICTIVEMAXTHRESHOLD": "Wenn der Prozentsatz der im Zeitfenster verfügbaren Agenten im Vergleich zu den zum Zeitpunkt der Vorhersage verfügbaren Agenten den konfigurierten Maximalwert überschreitet, berechnet die Vorhersage die Vorhersage neu.", - "PREDICTIVEMINTHRESHOLD": "Wenn der Prozentsatz der im Zeitfenster verfügbaren Agenten im Vergleich zu den zum Zeitpunkt der Vorhersage verfügbaren Agenten den konfigurierten Mindestgrenzwert überschreitet, berechnet die Vorhersage die Vorhersage neu.", - "ABANDONEDMAXRETRY": "Maximale Häufigkeit, mit der ein Kontakt angerufen wird, bevor er als geschlossen betrachtet wird, wenn der Anruf zum Abbrechen fehlgeschlagen ist", - "ABANDONEDRETRYTIME": "Zeit in Minuten, bevor versucht wird, einen fehlgeschlagenen Kontakt aufgrund eines Abbruchs erneut anzurufen", - "AGENTREJECTMAXRETRY": "Maximale Häufigkeit, mit der ein Kontakt angerufen wird, bevor er als geschlossen betrachtet wird, wenn der Anruf für die Ablehnung des Agenten fehlgeschlagen ist", - "AGENTREJECTRETRYTIME": "Zeit in Minuten, bevor versucht wird, einen fehlgeschlagenen Kontakt aufgrund einer Ablehnung des Agenten erneut anzurufen", - "DROPMAXRETRY": "Maximale Häufigkeit, mit der ein Kontakt angerufen wird, bevor er als geschlossen betrachtet wird, wenn der Anruf nicht beendet werden konnte", - "DROPRETRYTIME": "Zeit in Minuten, bevor versucht wird, einen fehlgeschlagenen Kontakt aufgrund eines Verbindungsabbruchs erneut anzurufen", - "MACHINEMAXRETRY": "Maximale Häufigkeit, mit der ein Kontakt angerufen wird, bevor er als geschlossen betrachtet wird, wenn der Anruf für die Maschine fehlgeschlagen ist", - "MACHINERETRYTIME": "Zeit in Minuten, bevor versucht wird, einen fehlgeschlagenen Kontakt aufgrund der Maschine erneut anzurufen", - "NOSUCHNUMBERETRYTIME": "Zeit in Minuten, bevor versucht wird, einen fehlgeschlagenen Kontakt erneut anzurufen, da keine solche Nummer vorhanden ist", - "NOSUCHNUMBERMAXRETRY": "Maximale Häufigkeit, mit der ein Kontakt angerufen wird, bevor er als geschlossen betrachtet wird, wenn der Anruf für keine solche Nummer fehlgeschlagen ist", - "NOSUCHNUMBERRETRYTIME": "Zeit in Minuten, bevor versucht wird, einen fehlgeschlagenen Kontakt erneut anzurufen, da keine solche Nummer vorhanden ist", - "PREVIEW_AUTO_RECALL_ME": "Wenn aktiviert, generiert das System automatisch die Wiederanrufe für den Agent automatisch. Wenn deaktiviert, müssen diese Anrufe manuell geplant werden", - "PREVIEW_RECALL_ME_REMINDER": "Wenn aktiviert, sendet das System n Minuten (entsprechend dem in den allgemeinen Einstellungen eingestellten Zeitintervall) eine Benachrichtigung an den Agenten, bevor die Rückrufnachricht generiert wird", + "TIMEOUT": "Zeitüberschreitung Klingeln Nebenstelle", + "CALLYSQUAREPROJECTPREVIEW": "IVR-Projekt nach dem Verlassen der Warteschlange", + "CALLYSQUAREPROJECTPREVIEW2": "IVR-Projekt beim Auflegen des Agenten", + "RUNIFHANGUPAGENT": "Ausführen, wenn der Agent eine Interaktion beendet", + "CALLYSQUAREPROJECT2": "Ausführen, wenn der Kontakt die Warteschlange verlässt (z.B. Auflegen)", + "RANDOMLASTDIGITCALLERIDNUMBER": "Setzt eine zufällige Zahl für die letzten X Stellen der angezeigten Nummer", + "BUSYMAXRETRY": "Maximale Anzahl Wiederversuche bei Systemergebnis 'Busy'", + "BUSYRETRYTIME": "Zeit für Wiederversuch bei Systemergebnis 'Busy'", + "MANDATORYDISPOSITIONPAUSEID": "Agentenstatus während Qualifizierung", + "PREDICTIVEMAXTHRESHOLD": "Maximaler Schwellwert für die Predictive-Analyse", + "PREDICTIVEMINTHRESHOLD": "Minimaler Schwellwert für die Predictive-Analyse", + "ABANDONEDMAXRETRY": "Maximale Anzahl Wiederversuche bei Systemergebnis 'Abandoned'", + "ABANDONEDRETRYTIME": "Zeit für Wiederversuch bei Systemergebnis 'Abandoned'", + "AGENTREJECTMAXRETRY": "Maximale Anzahl Wiederversuche, bei Ablehnung durch den Agenten (Reject)", + "AGENTREJECTRETRYTIME": "Zeit für Wiederversuch bei Ablehnung durch den Agenten (Reject)", + "DROPMAXRETRY": "Maximale Anzahl Wiederversuche bei Systemergebnis 'Drop'", + "DROPRETRYTIME": "Zeit für Wiederversuch bei Systemergebnis 'Drop'", + "MACHINEMAXRETRY": "Maximale Anzahl Wiederversuche bei Systemergebnis 'AnsweringMachine'", + "MACHINERETRYTIME": "Zeit für Wiederversuch bei Systemergebnis 'AnsweringMachine'", + "NOSUCHNUMBERETRYTIME": "Zeit für Wiederversuch bei Systemergebnis 'No Such Number'", + "NOSUCHNUMBERMAXRETRY": "Maximale Anzahl Wiederversuche bei Systemergebnis 'No Such Number'", + "NOSUCHNUMBERRETRYTIME": "Zeit für Wiederversuch bei Systemergebnis 'No Such Number'", + "PREVIEW_AUTO_RECALL_ME": "Wenn aktiviert, generiert das System automatisch die Recall Me-Anrufe; Andernfalls muss der Agent dies manuell tun", + "PREVIEW_RECALL_ME_REMINDER": "Wenn diese Option aktiviert ist, sendet das System n Minuten (gemäß dem in den allgemeinen Einstellungen festgelegten Zeitintervall) eine Benachrichtigung an den Agenten, bevor der Rückruf generiert wird", "TIMEZONE": "Zeitzone angeben" }, - "MUSICONHOLD": "Musik auf Halten", - "ANNOUNCETOAGENT": "Verkünden auf Agenten", - "ANNOUNCEMENTS": "Ankündigungen", - "ADVANCEDPREVIEW": "Erweiterte", - "ADVANCED": "Erweiterte", - "ADVANCE": "Erweiterte", - "ANNOUNCEFREQUENCY": "Frequenz ankündigen", - "MINANNOUNCEFREQUENCY": "Minimale verkünden Frequenz", - "PERIODICANNOUNCEFREQUENCY": "Periodische verkünden Frequenz", - "RANDOMPERIODICANNOUNCE": "Random Periodische verkünden", - "ANNOUNCEHOLDTIME": "Verkünden. Haltezeit", - "ANNOUNCECALLERPOSITION": "Verkünden Anrufer Position", - "ANNOUNCEPOSITIONLIMIT": "Verkünden Position Limit", - "REPORTHOLDTIMEAGENT": "Bericht Bedienplatz Haltezeit", - "PERIODICANNOUNCE": "Periodische verkünden", - "HOLDTIMEANNOUNCE": "Hold Zeit verkünden", - "YOUARENEXTANNOUNCE": "\"Sie sind weiter' verkünden", - "THEREAREANNOUNCE": "'Es gibt' verkünden", - "WAITINGCALLSANNOUNCE": "Wartende Anrufe verkünden", - "ESTIMATEDHOLDTIMEANNOUNCE": "Halten Sie die geschätzte Zeit verkünden", - "MINUTESANNOUNCE": "Minuten ankündigen", - "MINUTEANNOUNCE": "Minute verkünden", - "SECONDSANNOUNCE": "Sekunden verkünden", - "THANKYOUANNOUNCE": "\"Danke\" ankündigen", - "AUTOPAUSE": "Auto Pause", - "AFTERCALLWORK": "Arbeit nach Anruf", - "AFTERCALLWORKDURATION": "Arbeit nach Anruf Dauer", - "RINGINUSE": "Ring im Einsatz", - "MEMBERDELAY": "Die Verzögerung", - "TIMEOUTRESTART": "Timeout neu starten", + "MUSICONHOLD": "Haltemusik", + "ANNOUNCETOAGENT": "Ansage an Agenten", + "ANNOUNCEMENTS": "Ansagen", + "ADVANCEDPREVIEW": "Vorschau erweitert", + "ADVANCED": "Erweitert", + "ADVANCE": "Erweitert", + "ANNOUNCEFREQUENCY": "Ansagefrequenz", + "MINANNOUNCEFREQUENCY": "Min. Ansagefrequenz", + "PERIODICANNOUNCEFREQUENCY": "Frequenz regelmäßige Ansagen", + "RANDOMPERIODICANNOUNCE": "Regelmäßige Ansagen zufällig abspielen", + "ANNOUNCEHOLDTIME": "Ansagen Wartezeit", + "ANNOUNCECALLERPOSITION": "Ansagen Warteposition", + "ANNOUNCEPOSITIONLIMIT": "Limit für Ansage", + "REPORTHOLDTIMEAGENT": "Wartezeit an Agenten ansagen", + "PERIODICANNOUNCE": "Regelmäßige Ansagen", + "HOLDTIMEANNOUNCE": "Ansage Wartezeit", + "YOUARENEXTANNOUNCE": "Ansage erste Warteposition", + "THEREAREANNOUNCE": "Teil 1 Ansage Warteposition", + "WAITINGCALLSANNOUNCE": "Teil 2 Ansage Warteposition", + "ESTIMATEDHOLDTIMEANNOUNCE": "Ansage geschätzte Wartezeit", + "MINUTESANNOUNCE": "Ansage 'Minuten'", + "MINUTEANNOUNCE": "Ansage 'Minute'", + "SECONDSANNOUNCE": "Ansage 'Sekunden'", + "THANKYOUANNOUNCE": "Ansage 'vielen Dank'", + "AUTOPAUSE": "Automatische Pause", + "AFTERCALLWORK": "Nacharbeit", + "AFTERCALLWORKDURATION": "Dauer Nacharbeit", + "RINGINUSE": "Klingeln bei Besetzt", + "MEMBERDELAY": "Verzögerung", + "TIMEOUTRESTART": "Zeitüberschreitung erneutes Starten", "MONITORFORMAT": "Aufzeichnungsformat", - "SETINTERFACEVARIABLES": "Set Interface Variablen", - "SETQUEUEVARIABLES": "Stellen Variablen", - "SETQUEUEENTRYVARIABLES": "Stellen ENTRY-Variablen", + "SETINTERFACEVARIABLES": "Interface-Variablen hinzufügen", + "SETQUEUEVARIABLES": "Variablen für Warteschlange hinzufügen", + "SETQUEUEENTRYVARIABLES": "Variablen zum Eintritt in Warteschlange hinzufügen", "CONTEXT": "Kontext", "SAVE": "Speichern", "SETTINGS": "Einstellungen", - "INBOUNDROUTES": "Ankommende Routen", + "INBOUNDROUTES": "Eingehende Routen", "PHONENUMBER": "Telefonnummer", - "ADD_INBOUNDROUTE": "Ankommende Route hinzufügen", - "EDIT_INBOUNDROUTE": "Bearbeiten Sie Eingehende Route", - "DELETE_INBOUNDROUTE": "Löschen Sie Eingehende Route", - "ACTIONS": "Aktionen", - "OUTBOUNDROUTES": "Abgehende Routen", - "DESTINATIONPATTERN": "Ziel Muster", - "ADD_OUTBOUNDROUTE": "Abgehende Route hinzufügen", - "EDIT_OUTBOUNDROUTE": "Abgehende Route bearbeiten", - "DELETE_OUTBOUNDROUTE": "Abgehende Route löschen", - "CUTDIGITS": "Schneiden Sie Ziffern", - "RECORDING": "Aufnahme", + "ADD_INBOUNDROUTE": "Eingehende Route hinzufügen", + "EDIT_INBOUNDROUTE": "Eingehende Route bearbeiten", + "DELETE_INBOUNDROUTE": "Eingehende Route löschen", + "ACTIONS": "Routing", + "OUTBOUNDROUTES": "Ausgehende Routen", + "DESTINATIONPATTERN": "Ziel-Pattern", + "ADD_OUTBOUNDROUTE": "Ausgehende Route hinzufügen", + "EDIT_OUTBOUNDROUTE": "Ausgehende Route bearbeiten", + "DELETE_OUTBOUNDROUTE": "Ausgehende Route löschen", + "CUTDIGITS": "Ziffern abschneiden", + "RECORDING": "Aufzeichnung", "RECORDINGFORMAT": "Aufzeichnungsformat", "INTERNALROUTES": "Interne Routen", - "ADD_INTERNALROUTE": "Fügen Sie interne Route", + "ADD_INTERNALROUTE": "Interne Route hinzufügen", "EDIT_INTERNALROUTE": "Interne Route bearbeiten", "DELETE_INTERNALROUTE": "Interne Route löschen", "CONTEXTS": "Kontexte", - "ADD_CONTEXT": "Rahmen hinzufügen", - "EDIT_CONTEXT": "Bearbeiten Kontext", - "DELETE_CONTEXT": "Löschen von Rahmen", + "ADD_CONTEXT": "Kontext hinzufügen", + "EDIT_CONTEXT": "Kontext bearbeiten", + "DELETE_CONTEXT": "Kontext löschen", "VOICEMAILS": "Voicemails", "ADD_VOICEMAIL": "Voicemail hinzufügen", - "EDIT_VOICEMAIL": "Bearbeiten von Voicemail", + "EDIT_VOICEMAIL": "Voicemail bearbeiten", "DELETE_VOICEMAIL": "Voicemail löschen", - "FULLNAME": "Voller Name", + "FULLNAME": "Vollständiger Name", "EMAIL": "E-Mail", "MAILBOX": "Mailbox", - "PASSWORD": "Kennwort", + "PASSWORD": "Passwort", "CONFIRM_PASSWORD": "Passwort bestätigen", "TIMEZONE": "Zeitzone", - "ATTACH": "Befestigen", - "ENVELOPE": "Umschlag", + "ATTACH": "Anhängen", + "ENVELOPE": "Eingangsdatum und Zeit ansagen", "DELETE": "Löschen", - "EMAILBODY": "E-Mail-Text", + "EMAILBODY": "E-Mail Text", "EMAILSUBJECT": "E-Mail Betreff", - "MAXSECONDS": "Max Sekunden", + "MAXSECONDS": "Max. Sekunden", "MAXMESSAGES": "Max. Nachrichten", "MESSAGES": "Nachrichten", "SORT": "Sortieren", - "ADD_MUSICONHOLD": "Musik auf Halten", - "MUSICONHOLDS": "Musik auf Halten", - "EDIT_MUSICONHOLD": "Bearbeiten Musik auf Halten", - "DELETE_MUSICONHOLD": "Löschen Sie Musik auf Halten", + "ADD_MUSICONHOLD": "Warteansagen hinzufügen", + "MUSICONHOLDS": "Warteansagen", + "EDIT_MUSICONHOLD": "Warteansage bearbeiten", + "DELETE_MUSICONHOLD": "Warteansage löschen", "DIRECTORY": "Verzeichnis", "AUDIOFILES": "Audiodateien", - "RECORDINGS": "Aufnahmen", - "CHANSPY": "ChanSpy", + "RECORDINGS": "Aufzeichnungen", + "CHANSPY": "Listen-In", "PREFIX": "Präfix", "OPTIONS": "Optionen", - "AUTH": "Auth", - "ADD_CHANSPY": "Chanspy hinzufügen", - "EDIT_CHANSPY": "Bearbeiten ChanSpy", - "DELETE_CHANSPY": "Löschen ChanSpy", + "AUTH": "Authentifizierung", + "ADD_CHANSPY": "Listen-In hinzufügen", + "EDIT_CHANSPY": "Listen-In bearbeiten", + "DELETE_CHANSPY": "Listen-In löschen", "AGENTS": "Agenten", "TELEPHONES": "Telefone", "QUEUES": "Warteschlangen", - "QUEUE_CALLS": "Anrufe aus der Warteschlange", - "QUEUE_PARAMETERS": "Queue Parameter", + "QUEUE_CALLS": "Sprachanrufe", + "QUEUE_PARAMETERS": "Warteschlangen-Parameter", "ABANDONED_CALLS": "Abgebrochene Anrufe", "OUTBOUND_CALLS": "Ausgehende Anrufe", "AGI": "AGI", "DIAL": "Wählen", - "INTERNALDIAL": "Interne Wahl", + "INTERNALDIAL": "Internes Wählen", "EXTERNALDIAL": "Externes Wählen", - "RINGGROUP": "Ring Gruppe", + "RINGGROUP": "Rufgruppe", "PLAYBACK": "Wiedergabe", "QUEUE": "Warteschlange", - "SET": "Einstellen", + "SET": "Einstellen (Set)", "VOICEMAIL": "Voicemail", - "GOTO": "Gehe zu", + "GOTO": "Absprung (GoTo)", "HANGUP": "Auflegen", - "CUSTOM": "Benutzerdefinierte", - "PROJECT": "Cally-Square Projekt", - "TECHNOLOGY/RESOURCE": "Technologie / Ressource", + "CUSTOM": "Benutzerdefiniert", + "PROJECT": "CallySquare Projekt", + "TECHNOLOGY/RESOURCE": "Ressource", "URL": "URL", - "EDIT_APP": "Bearbeiten Anwendung", - "EDIT_INTERVAL": "Bearbeiten Intervall", + "EDIT_APP": "Anwendung bearbeiten", + "EDIT_INTERVAL": "Zeitintervall bearbeiten", "DELETE_APP": "Anwendung löschen", - "INTERVALS": "Intervalle", - "USER": "Benutzer", - "TRUNK": "Amtsleitung", + "INTERVALS": "Zeitintervalle", + "USER": "Nutzer", + "TRUNK": "SIP-Trunk", "PHONE": "Telefon", "AUDIO_FILES": "Audiodateien", - "ANNOUNCE_OVERRIDES": "Verkünden überschreibt", + "ANNOUNCE_OVERRIDES": "Überschreibt die in der Kampagne definierte Ansage", "MACRO": "Makro", - "GOSUB": "GoSub", + "GOSUB": "Subroutine (GoSub)", "RULE": "Regel", "POSITION": "Position", - "ANSWER": "Antwort", + "ANSWER": "Antworteb", "VALUE": "Wert", - "MAILBOX@CONTEXT": "Mailbox @ Rahmen", - "EXTENSION": "Erweiterung", + "MAILBOX@CONTEXT": "Mailbox@Context", + "EXTENSION": "Nebenstelle", "PRIORITY": "Priorität", - "HANGUP_CAUSE": "Auflegen verursachen", - "OUTBOUNDDIAL": "Für ausgehende Anrufe wählen", - "CALLER_ID": "Anrufer-ID", - "NO_MESSAGE_AVAILABLE": "Keine Meldungen vorhanden", - "NO_SOUND_AVAILABLE": "Kein Ton verfügbar", - "VOICERECORDINGS": "Sprachaufnahmen", - "CHANSPIES": "ChanSpy", - "VOICE": "Voice", - "REALTIME": "Echtzeit", - "ID": "Id", + "HANGUP_CAUSE": "SIP-Auflegegrund", + "OUTBOUNDDIAL": "Ausgehend wählen", + "CALLER_ID": "Anrufer-ID (CallerID)", + "NO_MESSAGE_AVAILABLE": "Keine Nachrichten verfügbar", + "NO_SOUND_AVAILABLE": "Keine Audiodatei verfügbar", + "VOICERECORDINGS": "Sprachaufzeichnungen", + "CHANSPIES": "Listen-In", + "VOICE": "Sprachanrufe (Voice)", + "REALTIME": "Echtzeit-Ansicht", + "ID": "ID", "VOICEMAIL_CONTEXT": "Kontext", - "NO_MOHSOUND_AVAILABLE": "Keine Wartemusik verfügbar", + "NO_MOHSOUND_AVAILABLE": "Keine Halteansage verfügbar", "FILE": "Datei", - "ADD_MOHSOUND": "Musik hinzufügen Auf Klang", - "DOWNLOAD_MOHSOUND": "Download Music On Hold Sound", - "DELETE_MOHSOUND": "Löschen Sie Musik auf Halten Sound", + "ADD_MOHSOUND": "Halteansage hinzufügen", + "DOWNLOAD_MOHSOUND": "Halteansage herunterladen", + "DELETE_MOHSOUND": "Halteansage löschen", "UNIQUEID": "Eindeutige ID", "AGENT": "Agent", "TYPE": "Typ", "RATING": "Bewertung", "AUDIO": "Audio", "DATE": "Datum", - "NEW_VOICEQUEUE": "Neue Stimme Warteschlange", + "NEW_VOICEQUEUE": "Neue Anrufwarteschlange", "NEW_INBOUNDROUTE": "Neue eingehende Route", "NEW_OUTBOUNDROUTE": "Neue ausgehende Route", "NEW_INTERNALROUTE": "Neue interne Route", - "NEW_CONTEXT": "Neuen Kontext", + "NEW_CONTEXT": "Neuer Kontext", "NEW_VOICEMAIL": "Neue Voicemail", - "NEW_MUSICONHOLD": "Neue Musik auf Halten", - "NEW_CHANSPY": "Neue ChanSpy", - "PENALTY": "Strafe", - "ADD_TEAM_TO_VOICEQUEUE": "Team Voice Warteschlange hinzufügen", - "ADD_AGENT_TO_VOICEQUEUE": "Agent Voice Warteschlange hinzufügen", - "EDIT_DIAL": "Kurzwahl bearbeiten", - "EDIT_AGI": "Bearbeiten AGI", - "EDIT_INTERNALDIAL": "Interne Kurzwahl bearbeiten", - "EDIT_EXTERNALDIAL": "Externe Kurzwahl bearbeiten", - "EDIT_RINGGROUP": "Gruppe bearbeiten", - "EDIT_PLAYBACK": "Bearbeiten Wiedergabe", + "NEW_MUSICONHOLD": "Neue Halteansage", + "NEW_CHANSPY": "Neues Listen-In", + "PENALTY": "Verzögerung", + "ADD_TEAM_TO_VOICEQUEUE": "Team hinzufügen", + "ADD_AGENT_TO_VOICEQUEUE": "Agenten hinzufügen", + "EDIT_DIAL": "Wählen bearbeiten", + "EDIT_AGI": "AGI bearbeiten", + "EDIT_INTERNALDIAL": "Internes Wählen bearbeiten", + "EDIT_EXTERNALDIAL": "Externes Wählen bearbeiten", + "EDIT_RINGGROUP": "Rufgruppe bearbeiten", + "EDIT_PLAYBACK": "Wiedergabe bearbeiten", "EDIT_QUEUE": "Warteschlange bearbeiten", - "EDIT_SET": "Bearbeiten", - "EDIT_GOTO": "Bearbeiten Gehe zu", - "EDIT_HANGUP": "Bearbeiten auflegen", - "EDIT_CUSTOM": "Bearbeiten Benutzerdefinierte", + "EDIT_SET": "Set Bearbeiten", + "EDIT_GOTO": "GoTo bearbeiten", + "EDIT_HANGUP": "Auflegen bearbeiten", + "EDIT_CUSTOM": "Benutzerdefinierte Funktion bearbeiten", "DURATION": "Dauer", "RECEIVED_AT": "Eingegangen am", "YES": "Ja", - "NO": "Keine", - "HANGUPCAUSE_1": "1 = Nicht zugewiesene Nummer", - "HANGUPCAUSE_16": "16=Normail Anruf löschen", - "HANGUPCAUSE_17": "17 = Benutzer besetzt", - "HANGUPCAUSE_18": "18 = Kein Benutzer reagiert (Telefon Gerät nicht angeschlossen)", - "HANGUPCAUSE_21": "21 = Anruf abgewiesen", - "HANGUPCAUSE_22": "22 = Anzahl geändert", - "HANGUPCAUSE_27": "27 = Ziel nicht in Ordnung", - "HANGUPCAUSE_38": "38 = Netzwerk nicht in der richtigen Reihenfolge", - "HANGUPCAUSE_41": "41 = Temporärer Ausfall", - "RANDOM": "Random", + "NO": "Nein", + "HANGUPCAUSE_1": "1 = Nebenstelle nicht gefunden (SIP404 - Not found)", + "HANGUPCAUSE_16": "16 = Ein Nutzer hat aufgelegt (Normal clearing)", + "HANGUPCAUSE_17": "17 = Besetzt (SIP486 - Busy here)", + "HANGUPCAUSE_18": "18 = 18 = Zeitüberschreitung Gegenstelle (SIP408 - Request Timeout)", + "HANGUPCAUSE_21": "21 = Abgelehnt (SIP603 - Declined)", + "HANGUPCAUSE_22": "22 = Nummer geändert (SIP410 - Gone)", + "HANGUPCAUSE_27": "27 = Ziel nicht gefunden (SIP502 - Bad Gateway)", + "HANGUPCAUSE_38": "38 = Dienst nicht verfügbar (SIP 503 - Network out of order)", + "HANGUPCAUSE_41": "41 = Vorübergehend nicht verfügbar (Normal temporary failure)", + "RANDOM": "Zufall", "ALPHABETICAL": "Alphabetisch", "NO_APPS_AVAILABLE": "Keine Anwendungen verfügbar", - "DOWNLOAD_VOICERECORDING": "Download Voice Recording", - "DELETE_VOICERECORDING": "Löschen Sprachaufzeichnung", - "INTERNAL": "Interne", - "PHONE_STATE": "Telefonstatus", - "PHONE_STATUS": "Telefonstatus", + "DOWNLOAD_VOICERECORDING": "Gesprächsaufzeichnung herunterladen", + "DELETE_VOICERECORDING": "Gesprächsaufzeichnung löschen", + "INTERNAL": "Intern", + "PHONE_STATE": "Status Nebenstelle", + "PHONE_STATUS": "Status SIP", "REGISTERED": "Registriert", - "UNREGISTERED": "Unregistrierte", - "LAGGED": "Zurück", + "UNREGISTERED": "Nicht registriert", + "LAGGED": "Verzögert", "REACHABLE": "Erreichbar", "UNREACHABLE": "Nicht erreichbar", "UNKNOWN": "Unbekannt", - "NOT_INUSE": "Nicht in Gebrauch", - "INUSE": "Im Einsatz", + "NOT_INUSE": "Nicht in Verwendung", + "INUSE": "In Verwendung", "BUSY": "Besetzt", "INVALID": "Ungültig", "UNAVAILABLE": "Nicht verfügbar", "RINGING": "Klingeln", - "ONHOLD": "Auf Halten", - "RING": "Ring", - "UP": "Bis", - "INFO": "Info", - "TRUNKS": "Amtsleitungen", + "ONHOLD": "Halten", + "RING": "Klingeln", + "UP": "Online", + "INFO": "Information", + "TRUNKS": "SIP-Trunks", "REGISTRY": "Registrierung", - "NO_REGISTRY": "Keine registry", + "NO_REGISTRY": "Keine Registrierung", "LOGGED_IN": "Angemeldet", "PAUSED": "Angehalten", - "DISPOSITION": "Disposition", - "WAITING": "Warten", - "TALKING": "Sprechen", - "DID": "Haben", + "DISPOSITION": "Qualifizierung", + "WAITING": "Wartezustand", + "TALKING": "im Gespräch", + "DID": "DID", "CALLER": "Anrufer", - "TOTAL": "Insgesamt", + "TOTAL": "Gesamt", "ANSWERED": "Beantwortet", "ABANDONED": "Abgebrochen", - "UNMANAGED": "Nicht verwaltete", - "REDIRECT_TO_NUMBER": "Umleitung zu einer Nummer", - "REDIRECT_TO_AGENT": "Umleiten zu: Ein Agent", + "UNMANAGED": "Nicht bearbeitet", + "REDIRECT_TO_NUMBER": "Weiterleitung an Nummer", + "REDIRECT_TO_AGENT": "Weiterleitung an Agent", "CLOSING": "Schließen", - "AVG_HOLD_TIME": "Durchschnittl. Warteschleifenzeit", - "AVG_DURATION": "Av-Dauer", - "AVG_BILLABLE": "Avg Fakturierbaren", - "SOURCE": "Quelle", + "AVG_HOLD_TIME": "DS Warteschleifenzeit", + "AVG_DURATION": "DS Dauer", + "AVG_BILLABLE": "DS Abrechenbar", + "SOURCE": "Ursprung", "DESTINATION": "Ziel", "REJECTED": "Abgelehnt", "FAILED": "Fehlgeschlagen", - "CALLED": "Aufgerufen", + "CALLED": "Angerufen", "CONNECTED": "Verbunden", "NO_RATING": "Keine Bewertung", - "EDIT_VOICERECORDING": "Edit Voice Recording", + "EDIT_VOICERECORDING": "Gesprächsaufzeichnung bearbeiten", "APPLICATION_NAME": "Name der Anwendung", "ARGUMENTS": "Argumente", "EDIT_QUEUECAMPAIGN": "Kampagne bearbeiten", "LISTADD_QUEUECAMPAIGN": "Liste hinzufügen", - "BLACKLISTADD_QUEUECAMPAIGN": "Blacklist hinzufügen", - "TEAMADD_QUEUECAMPAIGN": "Gruppe hinzufügen", - "AGENTADD_QUEUECAMPAIGN": "Agent hinzufügen", + "BLACKLISTADD_QUEUECAMPAIGN": "Schwarze Liste hinzufügen", + "TEAMADD_QUEUECAMPAIGN": "Team hinzufügen", + "AGENTADD_QUEUECAMPAIGN": "Agenten hinzufügen", "DELETE_QUEUECAMPAIGN": "Kampagne löschen", - "DELETE_IVRCAMPAIGN": "Kampagne löschen", - "EDIT_IVRCAMPAIGN": "Kampagne bearbeiten", + "DELETE_IVRCAMPAIGN": "IVR-Kampagne löschen", + "EDIT_IVRCAMPAIGN": "IVR-Kampagne bearbeiten", "NEW_IVRCAMPAIGN": "Neue IVR-Kampagne", - "ADD_IVRCAMPAIGN": "Hinzufügen IVR-Kampagne", + "ADD_IVRCAMPAIGN": "IVR-Kampagne hinzufügen", "LISTADD_IVRCAMPAIGN": "Liste hinzufügen", - "BLACKLISTADD_IVRCAMPAIGN": "Blacklist hinzufügen", - "ENABLED": "Aktiviert", + "BLACKLISTADD_IVRCAMPAIGN": "Schwarze Liste hinzufügen", + "ENABLED": "Aktiv", "READY": "Bereit", - "PAUSE": "Pause", - "UNPAUSE": "Pause", - "DEFAULT_PAUSE": "Standard Pause", - "AGENTADD_QUEUE": "Kampagne hinzufügen Agent in der Warteschlange", - "AGENTSADD_QUEUE": "Agents hinzufügen Kampagne in die Warteschlange", - "ALL_TEAMS": "Alle Mannschaften", + "PAUSE": "Pausenstatus vergeben", + "UNPAUSE": "Pause beenden", + "DEFAULT_PAUSE": "Standardpause", + "AGENTADD_QUEUE": "Agent hinzufügen", + "AGENTSADD_QUEUE": "Agenten hinzufügen", + "ALL_TEAMS": "Alle Teams", "SELECTED_TEAMS": "Ausgewählte Teams", "ALL_LISTS": "Alle Listen", "SELECTED_LISTS": "Ausgewählte Listen", "ALL_AGENTS": "Alle Agenten", "SELECTED_AGENTS": "Ausgewählte Agenten", "WAITING_FOR_AGENT": "Warten auf Agenten", - "TOTAL_OFFERED": "Insgesamt", - "RUNNING": "Ausgeführt", - "TRUNK_IS_NOT_REACHABLE": "Trunk ist nicht erreichbar.", - "AGENTS_NOT_LOGGED": "Agent nicht angemeldet", - "NOT_ACTIVE": "Nicht Aktiv", - "IS_DISACTIVED": "Ist Disactived", + "TOTAL_OFFERED": "Gesamt angeboten", + "RUNNING": "in Ausführung", + "TRUNK_IS_NOT_REACHABLE": "SIP-Trunk ist nicht erreichbar.", + "AGENTS_NOT_LOGGED": "Keine Agenten angemeldet", + "NOT_ACTIVE": "Nicht aktiv", + "IS_DISACTIVED": "Deaktiviert", "BACKUPTRUNK": "Backup Trunk", - "GLOBALINTERVAL": "Globale Intervall", - "RESCHEDULED_CONTACTS": "Neu geplanten Kontakte", - "INTERVAL_IS_OVERTIME": "Intervall ist Überstunden", - "GLOBAL_INTERVAL_IS_OVERTIME": "Aus Intervall (Global)", + "GLOBALINTERVAL": "Globales Intervall", + "RESCHEDULED_CONTACTS": "Kontante in erneuter Planung", + "INTERVAL_IS_OVERTIME": "Intervall über Zeit", + "GLOBAL_INTERVAL_IS_OVERTIME": "Intervall (Global)", "INTERVAL_IS_NULL": "Intervall ist Null", - "TIMEZONE_UNKNOW": "Zeitzone Unknow", + "TIMEZONE_UNKNOW": "Zeitzone unbekannt", "INTERVAL_IS_EMPTY": "Intervall ist leer", - "TOTAL_MANAGED": "Insgesamt verwaltet", - "OPEN": "Öffnen", - "FRESH": "Frische", + "TOTAL_MANAGED": "Gesamt bearbeitet", + "OPEN": "Offen", + "FRESH": "Neu", "CLOSED": "Geschlossen", "ALWAYS": "Immer", "NEVER": "Nie", "ONLY_IF_OPEN": "Nur wenn offen", - "CHECKDUPLICATE": "Duplizieren", + "CHECKDUPLICATE": "Auf Duplikate prüfen", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "Von", - "TIMEOUT": "Timeout", + "OF": "von", + "TIMEOUT": "Zeitüberschreitung", "CHAT": "Chat", "MAIL": "E-Mail", "SMS": "SMS", "OPENCHANNEL": "Offener Kanal", "FAX": "Fax", "NO_AGENT_ONLINE": "Kein Agent Online", - "PARTIALPAUSE": "Lastschriftzahlung teilweise Pause", - "ALL": "Alle", + "PARTIALPAUSE": "Teilpause", + "ALL": "Alles", "IDLE": "Leerlauf", "TIMER": "Timer", - "NO_AVAILABLE_INFO": "Keine verfügbaren Informationen", - "CALLYSQUAREPROJECTPREVIEW": "Cally Square Projektvorschau", - "CALLYSQUAREPROJECTPREVIEW2": "Cally Square Projekt nach Vorschau", - "RUNIFHANGUPAGENT": "Führen Sie Cally Square Project nach, auch wenn der Agent den Anruf auflegt", - "CALLYSQUAREPROJECT2": "Cally Square Projekt nach der Warteschlange", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", + "CALLYSQUAREPROJECTPREVIEW": "CallySquare Vorschau bei Auflegen Agent", + "CALLYSQUAREPROJECTPREVIEW2": "CallySquare Vorschau nach Warteschlange", + "RUNIFHANGUPAGENT": "Ausführen, wenn Agent auflegt", + "CALLYSQUAREPROJECT2": "Ausführen nach Warteschlange", "RESET": "Zurücksetzen", "RESETLIST": "Listen zurücksetzen", "RESETLIST_IVRCAMPAIGN": "Listen zurücksetzen", "RESETLIST_QUEUECAMPAIGN": "Listen zurücksetzen", - "SELECTALL": "Wählen Sie Alle", - "UNSELECTALL": "Alles wiederufen", + "SELECTALL": "Alles auswählen", + "UNSELECTALL": "Nichts auswählen", "HOPPERWIDGET": "Zusammenfassung", - "ABANDONEDCALLS": "Verlassene Warteschlangenanrufe", + "ABANDONEDCALLS": "In Warteschlange verloren", "CLONE_QUEUECAMPAIGN": "Warteschlangen-Kampagne klonen", - "CLONE_IVRCAMPAIGN": "Kampagne klonen", - "RANDOMLASTDIGITCALLERIDNUMBER": "Zufällige ausgehende Anrufer-ID-Nummer", + "CLONE_IVRCAMPAIGN": "IVR-Kampagne klonen", + "RANDOMLASTDIGITCALLERIDNUMBER": "Zufällige ausgehende Anrufer-ID", "CUTDIGIT": "Ziffern ausschneiden", - "LOGIN_TIME": "Login-Zeit", - "PAUSE_TIME": "Pausenzeit", - "RECALLINQUEUE": "Rückruf in der Warteschlange", + "LOGIN_TIME": "Zeit angemeldet", + "PAUSE_TIME": "Zeit in Pause", + "RECALLINQUEUE": "Allgemeine Wiedervorlage", "REFRESH_SCHEDULED_CALLS": "Geplante Anrufe aktualisieren", "SCHEDULED_CALLS": "Geplante Anrufe", - "SELECT_CAMPAIGN": "Wählen Sie Kampagne", + "SELECT_CAMPAIGN": "Kampagne auswählen", "SELECT_DATE": "Datum auswählen", - "SELECT_TYPE": "Art auswählen", - "TEAMS_ASSOCIATION": "Vereinigung der Mannschaften", - "ANSWERING_MACHINE": "Antwortmaschine", - "MANDATORYDISPOSITION": "Zwingende Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Status der obligatorischen Dispositionspause", + "SELECT_TYPE": "Typ auswählen", + "TEAMS_ASSOCIATION": "Teamzuweisung", + "ANSWERING_MACHINE": "Anrufbeantworter", + "MANDATORYDISPOSITION": "Qualifizierung erforderlich", + "MANDATORYDISPOSITIONPAUSEID": "Agentenstatus während Qualifizierung", "ANSWERED_CALLS": "Beantwortete Anrufe", - "AVG_TALK_TIME": "Durchschnittliche Gesprächszeit", + "AVG_TALK_TIME": "DS Gesprächszeit", "CURRENT_INTERVAL": "Aktuelles Intervall", - "DATA_COLLECTION_IN_PROGRESSIVE": "Datenerfassung in Progressive", - "ONE_CALL_EVERY": "Ein Anruf für jeden", - "PREDICTIVEMAXTHRESHOLD": "Voraussagender maximaler Schwellenwert [%]", - "PREDICTIVEMINTHRESHOLD": "Predictive Min Threshold [%]", - "PREDICTIVE_IS_NOT_RUNNING": "Predictive läuft nicht", - "PREDICTIVE_IS_RUNNING": "Predictive läuft", + "DATA_COLLECTION_IN_PROGRESSIVE": "Datenerfassung Progressive", + "ONE_CALL_EVERY": "Ein Anruf alle", + "PREDICTIVEMAXTHRESHOLD": "Max. Schwellwert Predictive (%)", + "PREDICTIVEMINTHRESHOLD": "Min. Schwellwert Predictive (%)", + "PREDICTIVE_IS_NOT_RUNNING": "Predictive-Dialing nicht aktiv", + "PREDICTIVE_IS_RUNNING": "Predictive-Dialing aktiv", "PREVIOUS_INTERVAL": "Vorheriges Intervall", - "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Vorhersage-Info anzeigen", - "THRESHOLDS": "Schwellenwerte", - "TOTAL_CALLS": "Anrufe insgesamt", - "ABANDONEDMAXRETRY": "Max Wiederholungen", - "ABANDONEDRETRYTIME": "Wiederholungszeit [min]", - "AGENTREJECT": "Agent ablehnen", - "AGENTREJECTMAXRETRY": "Max Wiederholungen", - "AGENTREJECTRETRYTIME": "Wiederholungszeit [min]", - "DROP": "Fallen", - "DROPMAXRETRY": "Max Wiederholungen", - "DROPRETRYTIME": "Wiederholungszeit [min]", - "MACHINE": "Maschine", - "MACHINEMAXRETRY": "Max Wiederholungen", - "MACHINERETRYTIME": "Wiederholungszeit [min]", - "NOSUCHNUMBER": "Keine solche Nummer", - "NOSUCHNUMBERMAXRETRY": "Max Wiederholungen", - "NOSUCHNUMBERRETRYTIME": "Wiederholungszeit [min]", - "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", - "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft", - "SECOND_LEVEL_DISPOSITION": "Disposition der zweiten Ebene", - "THIRD_LEVEL_DISPOSITION": "Disposition der dritten Ebene", - "PREVIEW_AUTO_RECALL_ME": "Rückrufe automatisieren", - "PREVIEW_RECALL_ME_REMINDER": "Recall Me Erinnerung", + "SHOW_PREDICTIVE_QUEUE_CAMPAIGN_INFO": "Information über Kampagne anzeigen", + "THRESHOLDS": "Schwellwerte", + "TOTAL_CALLS": "Anrufe Gesamt", + "ABANDONEDMAXRETRY": "Max. Wiederversuche bei Verlassen (Abandon)", + "ABANDONEDRETRYTIME": "Bei Verlassen (Abandon) erneut versuchen nach [Min]", + "AGENTREJECT": "Ablehnung durch Agent", + "AGENTREJECTMAXRETRY": "Max. Wiederversuche bei Ablehnung durch Agent", + "AGENTREJECTRETRYTIME": "Bei Ablehnung durch Agent erneut versuchen nach [Min]", + "DROP": "Vom System aufgelegt (Drop-Call)", + "DROPMAXRETRY": "Max. Wiederversuche bei Dropped-Call", + "DROPRETRYTIME": "Bei Drop-Calls erneut versuchen nach [Min]", + "MACHINE": "Anrufbeantworter", + "MACHINEMAXRETRY": "Max. Wiederversuche bei Anrufbeantworter", + "MACHINERETRYTIME": "Bei Anrufbeantworter erneut versuchen nach [Min]", + "NOSUCHNUMBER": "Nummer falsch", + "NOSUCHNUMBERMAXRETRY": "Max. Wiederversuche bei Nummer falsch", + "NOSUCHNUMBERRETRYTIME": "Bei Nummer falsch erneut versuchen nach [Min]", + "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufzeichnung deaktiviert", + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufzeichnung aktiv", + "SECOND_LEVEL_DISPOSITION": "Qualifizierung Ebene 2", + "THIRD_LEVEL_DISPOSITION": "Qualifizierung Ebene 3", "ADDITIONALPHONES": "Zusätzliche Telefone", - "CALLADDITIONALPHONEAFTERMIN": "Weiteres Telefon anrufen nach [min]" + "CALLADDITIONALPHONEAFTERMIN": "Weiteres Telefon anrufen nach [min]", + "PREVIEW_AUTO_RECALL_ME": "Rückrufanrufe automatisieren", + "PREVIEW_RECALL_ME_REMINDER": "Erinnere dich an mich Erinnerung" } } diff --git a/public/app/main/apps/openchannel/i18n/de.json b/public/app/main/apps/openchannel/i18n/de.json index 0ef1225..5f7b19f 100644 --- a/public/app/main/apps/openchannel/i18n/de.json +++ b/public/app/main/apps/openchannel/i18n/de.json @@ -1,208 +1,208 @@ { "OPENCHANNEL": { "TEXT": "Text", - "TIMES": "Die Anzahl der Zeiten pro Interaktion", - "EDIT_AUTOREPLY": "Bearbeiten Sie automatische Antwort", + "TIMES": "Zeiten", + "EDIT_AUTOREPLY": "Automatische Antwort bearbeiten", "AUTOREPLY": "Automatische Antwort", "NAME": "Name", - "OPENCHANNELQUEUES": "Offener Kanal Warteschlangen", - "SEARCH_FOR_ANYONE": "Suche für Jedermann", + "OPENCHANNELQUEUES": "Warteschlangen", + "SEARCH_FOR_ANYONE": "Suche", "ERRORS": { - "TEXT_REQUIRED": "Das Feld \"Text\" ist erforderlich", - "NAME_REQUIRED": "Der Name ist erforderlich", - "AGENT_TIMEOUT_REQUIRED": "Der Agent Timeout ist erforderlich", - "MOTIONADDRESS_REQUIRED": "Die Adresse ist erforderlich", - "MOTIONADDRESS_MUST_VALID_URL": "Die Adresse muss in einem gültigen Format", - "ACCEPTURL_MUST_VALID_URL": "Die URL muss in einem gültigen Format", - "TIMEOUT_REQUIRED": "Der Timeout ist erforderlich", - "REJECTURL_MUST_VALID_URL": "Die URL muss in einem gültigen Format", - "CLOSEURL_MUST_VALID_URL": "Die URL muss in einem gültigen Format", - "REPLYURI_REQUIRED": "Die Antwort URL ist erforderlich", - "REPLYURI_MUST_VALID_URL": "Die Antwort URL muss im gültigen Format geschrieben werden", - "PRIORITY_REQUIRED": "Die Priorität ist erforderlich", - "CONDITION_REQUIRED": "Der Zustand ist erforderlich", - "TRUEPRIORITY_REQUIRED": "Die wahre Priorität ist erforderlich", - "FALSEPRIORITY_REQUIRED": "Die falsche Priorität ist erforderlich", - "AGENT_REQUIRED": "Pflichtfeld", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer als oder gleich", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer als oder gleich", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer als oder gleich", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer als oder gleich", - "DISPOSITION_REQUIRED": "Pflichtfeld", - "QUEUE_REQUIRED": "Pflichtfeld", - "KEY_MAX_LENGTH": "Schlüssel muss eine maximale Länge von {{max}}", - "TEXT_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", - "VALUE_REQUIRED": "Pflichtfeld", - "COMMAND_REQUIRED": "Pflichtfeld", - "LIST_REQUIRED": "Pflichtfeld", - "KEY_REQUIRED": "Pflichtfeld", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "NAME_MUST_VALID_PATTERN": "Falsches Format", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Pflichtfeld", - "TAG_REQUIRED": "Pflichtfeld", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pflichtfeld", - "ACCESSKEYID_REQUIRED": "Zugangsschlüssel-ID ist erforderlich", - "BOTNAME_REQUIRED": "Der Bot-Name ist erforderlich", - "SECRETACCESSKEY_REQUIRED": "Zugangsschlüssel geheim ist erforderlich", - "CLIENTEMAIL_REQUIRED": "Pflichtfeld", - "PRIVATEKEY_REQUIRED": "Pflichtfeld", - "PROJECTID_REQUIRED": "Pflichtfeld" + "TEXT_REQUIRED": "Test erforderlich", + "NAME_REQUIRED": "Name erforderlich", + "AGENT_TIMEOUT_REQUIRED": "Zeitüberschreitung Agent erforderlich", + "MOTIONADDRESS_REQUIRED": "URL erforderlich", + "MOTIONADDRESS_MUST_VALID_URL": "Ungültiges Format URL", + "ACCEPTURL_MUST_VALID_URL": "Ungültiges Format URL", + "TIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", + "REJECTURL_MUST_VALID_URL": "Ungültiges Format URL bei Ablehnen", + "CLOSEURL_MUST_VALID_URL": "Ungültiges Format URL bei Schließen", + "REPLYURI_REQUIRED": "URL für Antwort erforderlich", + "REPLYURI_MUST_VALID_URL": "Ungültiges Format URL bei Antwort", + "PRIORITY_REQUIRED": "Priorität erforderlich", + "CONDITION_REQUIRED": "Bedingung erforderlich", + "TRUEPRIORITY_REQUIRED": "Priorität bei 'wahr' erforderlich", + "FALSEPRIORITY_REQUIRED": "Priorität bei 'falsch' erforderlich", + "AGENT_REQUIRED": "Agent erforderlich", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität muss größer oder gleich sein als", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei 'wahr' muss größer oder gleich sein als", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei 'falsch' muss größer oder gleich sein als", + "DISPOSITION_REQUIRED": "Qualifizierung erforderlich", + "QUEUE_REQUIRED": "Warteschlange erforderlich", + "KEY_MAX_LENGTH": "Schlüssel darf eine maximale Länge von {{max}} haben", + "TEXT_MAX_LENGTH": "Text darf eine maximale Länge von {{max}} haben", + "VALUE_REQUIRED": "Wert erforderlich", + "COMMAND_REQUIRED": "Eingabe erforderlich", + "LIST_REQUIRED": "Liste erforderlich", + "KEY_REQUIRED": "Schlüssel erforderlich", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent muss größer oder gleich sein als", + "NAME_MUST_VALID_PATTERN": "Ungültiges Format Name", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss kleiner oder gleich sein als", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent muss kleiner oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Warten auf zugew. Agenten muss größer oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Warten auf zugew. Agenten muss kleiner oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Warten auf zugew. Agenten erforderlich", + "TAG_REQUIRED": "Tag erforderlich", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agententransfer muss größer oder gleich sein als", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agententransfer muss kleiner oder gleich sein als", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Agententransfer erforderlich", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Warteschlangentransfer muss größer oder gleich sein als", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Warteschlangentransfer muss kleiner oder gleich sein als", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Warteschlangentransfer erforderlich", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Agentenstatus während Qualifizierung erforderlich", + "ACCESSKEYID_REQUIRED": "Zugangsschlüssel-ID erforderlich", + "BOTNAME_REQUIRED": "BOT-Name erforderlich", + "SECRETACCESSKEY_REQUIRED": "Geheimer Zugangsschlüssel erforderlich", + "CLIENTEMAIL_REQUIRED": "Kunden E-Mail erforderlich", + "PRIVATEKEY_REQUIRED": "Privater Schlüssel erforderlich", + "PROJECTID_REQUIRED": "Projekt-ID erforderlich" }, - "STRATEGY": "Strategie", + "STRATEGY": "Verteilungsstrategie", "AGENT": "Agent", - "GOTO": "Gehe zu", - "GOTOIF": "Gotoif", - "NOOP": "Noop", + "GOTO": "Absprung (GoTo)", + "GOTOIF": "Bedingter Absprung (GoToIf)", + "NOOP": "Log erstellen (NoOp)", "QUEUE": "Warteschlange", - "EDIT_AGENT": "Agent bearbeiten", - "EDIT_GOTO": "Bearbeiten Gehe zu", - "EDIT_NOOP": "Bearbeiten Noop", - "EDIT_GOTOIF": "Bearbeiten Gotoif", + "EDIT_AGENT": "Agenten bearbeiten", + "EDIT_GOTO": "GoTo bearbeiten", + "EDIT_NOOP": "NoOp bearbeiten", + "EDIT_GOTOIF": "GoToIf bearbeiten", "EDIT_QUEUE": "Warteschlange bearbeiten", - "CONDITION": "Zustand", - "TRUEPRIORITY": "Wahre Priorität", - "FALSEPRIORITY": "Falsche Priorität", + "CONDITION": "Bedingung", + "TRUEPRIORITY": "Priorität bei 'wahr'", + "FALSEPRIORITY": "Priorität bei 'falsch'", "VALUE": "Wert", "PRIORITY": "Priorität", - "AGENT_TIMEOUT": "Agent Timeout", + "AGENT_TIMEOUT": "Zeitüberschreitung Agent", "DESCRIPTION": "Beschreibung", - "ADD_OPENCHANNELQUEUE": "Fügen Sie im Offenen Kanal Warteschlange", - "EDIT_OPENCHANNELQUEUE": "Offener Kanal Warteschlange bearbeiten", - "DELETE_OPENCHANNELQUEUE": "Löschen der Warteschlange im Offenen Kanal", - "PENALTY": "Strafe", - "TEAMADD_OPENCHANNELQUEUE": "Team zur Warteschlange hinzufügen", - "AGENTADD_OPENCHANNELQUEUE": "Agent zur Warteschlange hinzufügen", + "ADD_OPENCHANNELQUEUE": "Warteschlange hinzufügen", + "EDIT_OPENCHANNELQUEUE": "Warteschlange bearbeiten", + "DELETE_OPENCHANNELQUEUE": "Warteschlange löschen", + "PENALTY": "Verzögerung", + "TEAMADD_OPENCHANNELQUEUE": "Team hinzufügen", + "AGENTADD_OPENCHANNELQUEUE": "Agenten hinzufügen", "ALL_AGENTS": "Alle Agenten", "SELECTED_AGENTS": "Ausgewählte Agenten", "CREATED_AT": "Erstellt am", "SAVE": "Speichern", "SETTINGS": "Einstellungen", "GENERAL": "Allgemein", - "OPENCHANNELACCOUNTS": "Offener Kanal Konten", + "OPENCHANNELACCOUNTS": "Offener-Kanal Konten", "MOTIONADDRESS": "Motion Adresse", - "ADD_OPENCHANNELACCOUNT": "Öffnen Sie den Channel Account hinzufügen", - "EDIT_OPENCHANNELACCOUNT": "Öffnen Sie den Channel Account bearbeiten", - "DELETE_OPENCHANNELACCOUNT": "Öffnen Sie den Channel Account löschen.", + "ADD_OPENCHANNELACCOUNT": "Konto offener Kanal hinzufügen", + "EDIT_OPENCHANNELACCOUNT": "Konto offener Kanal bearbeiten", + "DELETE_OPENCHANNELACCOUNT": "Konto offener Kanal löschen.", "API": "API", - "DISPOSITIONS": "Bestimmungen", + "DISPOSITIONS": "Qualifizierungen", "WEBHOOKS": "WebHooks", - "ACTIONS": "Aktionen", + "ACTIONS": "Routing", "LIST": "Liste", "FIDELITY": "Treue", - "ACCEPT": "Akzeptieren", - "ACCEPTMETHOD": "Die Methode", - "ACCEPTURL": "URL akzeptieren", + "ACCEPT": "Annehmen", + "ACCEPTMETHOD": "Methode annehmen", + "ACCEPTURL": "URL annehmen", "REJECT": "Ablehnen", "REJECTMETHOD": "Methode ablehnen", "REJECTURL": "URL ablehnen", - "CLOSE": "In der Nähe", - "CLOSEMETHOD": "In der Nähe Methode", - "CLOSEURL": "Der URL", - "SELECTED": "Ausgewählte", - "SELECT_ALL": "Alle auswählen", - "SELECT_NONE": "Wählen Sie \"Keine\"", + "CLOSE": "Schließen", + "CLOSEMETHOD": "Methode bei Schließen", + "CLOSEURL": "URL bei Schließen", + "SELECTED": "Ausgewählt", + "SELECT_ALL": "Alles auswählen", + "SELECT_NONE": "Nichts auswählen", "BACK": "Zurück", "OPENCHANNEL": "Offener Kanal", - "ID": "Id", - "TIMEOUT": "Timeout", - "OPENCHANNELDISPOSITIONS": "Offener Kanal Verfügungen", - "NO_OPENCHANNELDISPOSITION_AVAILABLE": "Keine offenen Kanal Dispositionen verfügbar", - "NEW_OPENCHANNELDISPOSITION": "Neue Offene Kanal inspektion", - "ADD_OPENCHANNELDISPOSITION": "Fügen Sie im Offenen Kanal inspektion", - "EDIT_OPENCHANNELDISPOSITION": "Bearbeiten Sie im Offenen Kanal inspektion", - "DELETE_OPENCHANNELDISPOSITION": "Löschen Sie im Offenen Kanal inspektion", - "NEW_OPENCHANNELQUEUE": "Neue Offene Kanal Warteschlange", - "NEW_OPENCHANNELACCOUNT": "Neue Open Channel Account", - "NO_AVAILABLE_INFO": "Keine verfügbaren Info", - "ALL_TEAMS": "Alle Mannschaften", + "ID": "ID", + "TIMEOUT": "Zeitüberschreitung", + "OPENCHANNELDISPOSITIONS": "Qualifizierungen", + "NO_OPENCHANNELDISPOSITION_AVAILABLE": "Keine Qualifizierungen vorhanden", + "NEW_OPENCHANNELDISPOSITION": "Neue Qualifizierung", + "ADD_OPENCHANNELDISPOSITION": "Qualifizierung hinzufügen", + "EDIT_OPENCHANNELDISPOSITION": "Qualifizierung bearbeiten", + "DELETE_OPENCHANNELDISPOSITION": "Qualifizierung löschen", + "NEW_OPENCHANNELQUEUE": "Neue Warteschlange offener Kanal", + "NEW_OPENCHANNELACCOUNT": "Neues Konto offener Kanal", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", + "ALL_TEAMS": "Alle Teams", "SELECTED_TEAMS": "Ausgewählte Teams", - "REPLYURI": "Antwort URL", - "RECEIVEURI": "Erhalten URL", + "REPLYURI": "URL bei Antwort", + "RECEIVEURI": "URL bei Erhalt", "HELP": { - "RECEIVEURI": "Dies ist die automatisch generierte API-String müssen Sie die Nachrichten in Ihrem offenen Kanal zu erhalten von der externen Anwendung (POST-Methode verwendet werden muss). Drücken Sie die Zwischenablage, um Sie in die Zwischenablage zu kopieren.", - "REPLYURI": "Dies ist die URL der Offene Kanal wird beim Senden oder Beantworten von Nachrichten", + "RECEIVEURI": "API-String für die Verbindung mit dem offenen Kanal", + "REPLYURI": "URL für Antwort", "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", - "LIST": "Contact Manager Liste zu verknüpfen von Kontakten", - "TOKEN": "Fügen Sie diese Eigenschaft als Abfragezeichenfolge in Ihrer Web-Service-URL hinzu. Weitere Informationen finden Sie im Dokument doc here", @@ -199,73 +199,73 @@ "MANDATORYDISPOSITION": "Mandatory disposition", "MANDATORYDISPOSITIONPAUSEID": "Pause to use if mandatory disposition is enabled" }, - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "CONTACT": "Contact", - "STARTEDAT": "Started At", - "LASTMESSAGE": "Last message", - "STATUS": "Status", - "CLOSED": "Closed", - "OPENED": "Open", - "OPEN": "Open", - "ACCOUNT": "Account", - "INTERACTION": "Interaction", - "INTERACTIONS": "Interactions", - "ALL": "All", - "SELECT_STATUS": "Select a status", - "FILTER": "Filter", - "FILTERS": "Filters", - "CLOSEDAT": "Closed At", - "DISPOSITION": "Disposition", - "NOTES": "Notes", - "NO_INTERACTION_AVAILABLE": "No interactions available", - "SELECT_ACCOUNT": "Select an account", + "PAGE": "Blaðsíða", + "ROWSPERPAGE": "Línur á síðu", + "OF": "Af", + "CONTACT": "Tengiliður", + "STARTEDAT": "Hófst kl.", + "LASTMESSAGE": "síðustu skilaboð", + "STATUS": "Staða", + "CLOSED": "Lokað", + "OPENED": "Opin", + "OPEN": "Opin", + "ACCOUNT": "Reikningur", + "INTERACTION": "Samskipti", + "INTERACTIONS": "Samskiptum", + "ALL": "Allir", + "SELECT_STATUS": "Veldu stöðu", + "FILTER": "Sía", + "FILTERS": "Síur", + "CLOSEDAT": "Lokað kl.", + "DISPOSITION": "Niðurlag", + "NOTES": "Skilaboð", + "NO_INTERACTION_AVAILABLE": "Engin samskipti til", + "SELECT_ACCOUNT": "Veldu reikning", "GOTOP": "Gotop", - "EDIT_GOTOP": "Edit Gotop", - "EDIT_CLOSE": "Edit Close", - "INFO": "Info", - "KEY": "Key", - "UNKNOWN": "Unknown", - "UNREGISTERED": "Unregistered", - "UNAVAILABLE": "Unavailable", - "NOT_INUSE": "Not in use", - "REACHABLE": "Reachable", - "IN_USE": "In use", - "AGENTS": "Agents", - "QUEUES": "Queues", - "FULLNAME": "Fullname", - "INTERNAL": "Internal", - "PHONE_STATE": "Phone State", - "PHONE_STATUS": "Phone Status", - "PAUSE": "Pause", - "LOGOUT": "Logout", - "AGENTADD_QUEUE": "Add agent to Open Channel queue", - "UNPAUSE": "End Pause", - "DEFAULT_PAUSE": "Default pause", - "LOGGED_IN": "Logged in", - "PAUSED": "Paused", - "READY": "Ready", - "WAITING": "Waiting", - "VOICE": "Voice", - "CHAT": "Chat", - "MAIL": "Email", + "EDIT_GOTOP": "Breyta Gotop", + "EDIT_CLOSE": "Breyta lokun", + "INFO": "Upplýsingar", + "KEY": "Lykill", + "UNKNOWN": "Óþekktur", + "UNREGISTERED": "Óskráð", + "UNAVAILABLE": "Ekki aðgengilegur", + "NOT_INUSE": "Ekki í notkun", + "REACHABLE": "Hægt að ná í", + "IN_USE": "Í notkun", + "AGENTS": "Fullrúar", + "QUEUES": "Biðraðir", + "FULLNAME": "Fullt nafn", + "INTERNAL": "Innan", + "PHONE_STATE": "Síma staða", + "PHONE_STATUS": "Síma staða", + "PAUSE": "Hlé", + "LOGOUT": "Útskráning", + "AGENTADD_QUEUE": "Bættu við fulltrúa í Open Channel biðröð", + "UNPAUSE": "Eni á hlé", + "DEFAULT_PAUSE": "Staðlað hlé", + "LOGGED_IN": "Innskráning", + "PAUSED": "Hlé", + "READY": "Tilbúið", + "WAITING": "Bíður", + "VOICE": "Tal", + "CHAT": "Spjall", + "MAIL": "Netfang", "SMS": "SMS", "FAX": "Fax", - "AGENTSADD_QUEUE": "Add agents to Open Channel queue", - "INTERACTIONS_OPENCHANNELACCOUNT": "Go to Interactions", - "REFRESH_INTERACTIONS": "Refresh Interactions", - "DELETE_INTERACTION": "Delete Interaction", - "AGENTADD_OPENCHANNELACCOUNT": "Add Agent to Openchannel Account", - "CANNED_ANSWER_SEARCH": "Enter a text to seach a Canned Answer", - "CANNED_ANSWER_NOT_FOUND": "No Canned Answer were found", - "SEND": "Send", - "TO": "To", - "MAPKEY": "Map Key", - "TEAMS_ASSOCIATION": "Teams Association", - "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", - "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", - "DOWNLOAD_WITH_ATTACHMENTS": "Download with attachments", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download without attachments" + "AGENTSADD_QUEUE": "Bættu við fulltrúa í Open Channel biðröð", + "INTERACTIONS_OPENCHANNELACCOUNT": "Farðu í samskipti", + "REFRESH_INTERACTIONS": "Endurnýja samskipti", + "DELETE_INTERACTION": "Eyða samskiptum", + "AGENTADD_OPENCHANNELACCOUNT": "Bættu við fulltrúa á Openchannel reikning", + "CANNED_ANSWER_SEARCH": "Bættu við texta til að fá betra svar", + "CANNED_ANSWER_NOT_FOUND": "Ekkert fullnægjandi svar fannst", + "SEND": "Senda", + "TO": "Til", + "MAPKEY": "Kortalykill", + "TEAMS_ASSOCIATION": "Samstarfshópar", + "TOOLTIP_SCREENRECORDING_ON": "Upptaka á skjá í gangi.", + "TOOLTIP_SCREENRECORDING_OFF": "Upptaka á skjá möguleg", + "DOWNLOAD_WITH_ATTACHMENTS": "Sækja með viðhengi", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Sækja án viðhengis" } } diff --git a/public/app/main/apps/openchannel/i18n/pt-BR.json b/public/app/main/apps/openchannel/i18n/pt-BR.json index f0036b7..e0aeed6 100644 --- a/public/app/main/apps/openchannel/i18n/pt-BR.json +++ b/public/app/main/apps/openchannel/i18n/pt-BR.json @@ -4,48 +4,48 @@ "PAUSE_TIME": "Tempo de pausa", "DOWNLOAD_INTERACTION": "Download", "TRANSFER": "Transferir", - "QUEUETRANSFER": "Transferência de fila", - "QUEUETRANSFERTIMEOUT": "Tempo limite de transferência da fila", + "QUEUETRANSFER": "Transferência de Fila", + "QUEUETRANSFERTIMEOUT": "Tempo limite de Transferência de Fila", "AGENTTRANSFER": "Transferência de Agente", - "AGENTTRANSFERTIMEOUT": "Tempo limite de transferência do agente", + "AGENTTRANSFERTIMEOUT": "Timeout Transferência Agente", "TAG": "Tag", "EDIT_TAG": "Editar Tag", "ADVANCED": "Avançado", "PROXY": "Proxy", "TOKEN": "Token", - "WAITFORTHEASSIGNEDAGENT": "Aguarde o agente atribuído", + "WAITFORTHEASSIGNEDAGENT": "Aguardando atribuição de agentes", "INSERT_MESSAGE_HERE": "Insira sua mensagem de texto aqui", "NOTIFICATION": "Notificação", "NOTIFICATIONSOUND": "Som", - "NOTIFICATIONSHAKE": "Tremer", - "NOTIFICATIONTEMPLATE": "Modelo", + "NOTIFICATIONSHAKE": "Vibrar", + "NOTIFICATIONTEMPLATE": "Template", "SYSTEM": "Sistema", "EDIT_SYSTEM": "Editar Sistema", "COMMAND": "Comando", "VARIABLE": "Variável", "DELETE": "Excluir", - "CANNEDANSWERS": "Respostas Prontas", - "OPENCHANNELCANNEDANSWERS": "Respostas Prontas", - "NO_OPENCHANNELCANNEDANSWER_AVAILABLE": "Não há respostas prontas disponíveis", - "NEW_OPENCHANNELCANNEDANSWER": "Nova Resposta Pronta", - "ADD_OPENCHANNELCANNEDANSWER": "Adicionar resposta Pronta", + "CANNEDANSWERS": "Respostas Pré-definidas", + "OPENCHANNELCANNEDANSWERS": "Respostas Pré-definidas", + "NO_OPENCHANNELCANNEDANSWER_AVAILABLE": "Não há respostas pré-definidas disponíveis", + "NEW_OPENCHANNELCANNEDANSWER": "Nova Resposta Pré-definida", + "ADD_OPENCHANNELCANNEDANSWER": "Adicionar Resposta Pré-definida", "EDIT_OPENCHANNELCANNEDANSWER": "Editar", "DELETE_OPENCHANNELCANNEDANSWER": "Excluir", - "DELIVERYREPORTURL": "URL do relatório de entrega", + "DELIVERYREPORTURL": "Delivery Report URL", "TAGS": "Tags", - "SPYINTERACTION": "Espião", + "SPYINTERACTION": "Visualizar", "NO_AGENT_ONLINE": "Sem Agente Online", - "GOTOREALTIME_OPENCHANNELQUEUE": "Ir para a fila de Open Channel em tempo real", - "PARTIALPAUSE": "Pausa parcial", + "GOTOREALTIME_OPENCHANNELQUEUE": "Ir para Fila Open Channel em Tempo Real", + "PARTIALPAUSE": "Pausa Parcial", "BUSY": "Ocupado", - "TIMER": "Cronômetro", - "IDLE": "Ocioso", + "TIMER": "Timer", + "IDLE": "Disponível", "CAPACITY": "Capacidade", "REALTIME": "Tempo Real", "TEXT": "Texto", "TIMES": "Número de vezes por interação", - "EDIT_AUTOREPLY": "Editar resposta automática", - "AUTOREPLY": "Resposta automatica", + "EDIT_AUTOREPLY": "Editar Auto Resposta", + "AUTOREPLY": "Auto Resposta", "NAME": "Nome", "OPENCHANNELQUEUES": "Filas Open Channel", "SEARCH_FOR_ANYONE": "Procurar", @@ -92,10 +92,10 @@ "DISPOSITION_REQUIRED": "Campo Obrigatório", "QUEUE_REQUIRED": "Campo Obrigatório", "KEY_MAX_LENGTH": "O valor deve ter um tamanho máximo igual a {{max}}", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Campo obrigatório", - "ACCESSKEYID_REQUIRED": "O código da chave de acesso é obrigatório", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Campo Obrigatório", + "ACCESSKEYID_REQUIRED": "Access key ID é obrigatório", "BOTNAME_REQUIRED": "O nome do bot é obrigatório", - "SECRETACCESSKEY_REQUIRED": "É necessário segredo da chave de acesso", + "SECRETACCESSKEY_REQUIRED": "Access key secret é obrigatório", "CLIENTEMAIL_REQUIRED": "Campo Obrigatório", "PRIVATEKEY_REQUIRED": "Campo Obrigatório", "PROJECTID_REQUIRED": "Campo Obrigatório" @@ -112,31 +112,31 @@ "EDIT_GOTOIF": "Editar Gotoif", "EDIT_QUEUE": "Editar Fila", "CONDITION": "Condição", - "TRUEPRIORITY": "Verdadeira prioridade", + "TRUEPRIORITY": "Verdadeira Prioridade", "FALSEPRIORITY": "Falsa Prioridade", "VALUE": "Valor", "PRIORITY": "Prioridade", - "AGENT_TIMEOUT": "Tempo limite do agente", + "AGENT_TIMEOUT": "Timeout Agente", "DESCRIPTION": "Descrição", - "ADD_OPENCHANNELQUEUE": "Adicionar fila de canal aberto", - "EDIT_OPENCHANNELQUEUE": "Editar fila do Open Channel", - "DELETE_OPENCHANNELQUEUE": "Excluir fila do Open Channel", + "ADD_OPENCHANNELQUEUE": "Adicionar Fila Open Channel", + "EDIT_OPENCHANNELQUEUE": "Editar Fila Open Channel", + "DELETE_OPENCHANNELQUEUE": "Excluir Fila Open Channel", "PENALTY": "Prioridade", - "TEAMADD_OPENCHANNELQUEUE": "Adicionar equipe para abrir a fila do Open Channel", - "AGENTADD_OPENCHANNELQUEUE": "Adicionar agente para abrir a fila do Open Channel", - "ALL_AGENTS": "Todos os Agentes", + "TEAMADD_OPENCHANNELQUEUE": "Adicionar Equipe a Fila Open Channel", + "AGENTADD_OPENCHANNELQUEUE": "Adicionar Agente para Fila Open Channel", + "ALL_AGENTS": "Todos Agentes", "SELECTED_AGENTS": "Agentes Selecionados", "CREATED_AT": "Criado em", "SAVE": "Salvar", "SETTINGS": "Configurações", "GENERAL": "Geral", "OPENCHANNELACCOUNTS": "Contas Open Channel", - "MOTIONADDRESS": "Endereço do Motion", - "ADD_OPENCHANNELACCOUNT": "Adicionar conta Open Channel", - "EDIT_OPENCHANNELACCOUNT": "Editar conta Open Channel", + "MOTIONADDRESS": "Endereço do XCally Motion", + "ADD_OPENCHANNELACCOUNT": "Adicionar Conta Open Channel", + "EDIT_OPENCHANNELACCOUNT": "Editar Conta Open Channel", "DELETE_OPENCHANNELACCOUNT": "Excluir conta Open Channel", "API": "API", - "DISPOSITIONS": "Disposições", + "DISPOSITIONS": "Qualificações", "WEBHOOKS": "WebHooks", "ACTIONS": "Ações", "LIST": "Lista", @@ -147,46 +147,46 @@ "REJECT": "Rejeitar", "REJECTMETHOD": "Rejeitar Método", "REJECTURL": "Rejeitar URL", - "CLOSE": "Fechar", - "CLOSEMETHOD": "Fechar Método", - "CLOSEURL": "Fechar URL", + "CLOSE": "Encerrar", + "CLOSEMETHOD": "Método Encerramento", + "CLOSEURL": "Encerrar URL", "SELECTED": "Selecionado", - "SELECT_ALL": "Selecionar todos", - "SELECT_NONE": "Selecionar nenhum", + "SELECT_ALL": "Selecionar Todos", + "SELECT_NONE": "Desselecionar Todos", "BACK": "Voltar", "OPENCHANNEL": "Open Channel", "ID": "Id", - "TIMEOUT": "Tempo esgotado", - "OPENCHANNELDISPOSITIONS": "Disposições do Open Channel", - "NO_OPENCHANNELDISPOSITION_AVAILABLE": "Nenhuma disposição de Open Channel disponível", - "NEW_OPENCHANNELDISPOSITION": "Nova disposição do Open Channel", - "ADD_OPENCHANNELDISPOSITION": "Adicionar disposição do Open Channel", - "EDIT_OPENCHANNELDISPOSITION": "Editar disposição do Open Channel", - "DELETE_OPENCHANNELDISPOSITION": "Excluir disposição do Open Channel", - "NEW_OPENCHANNELQUEUE": "Nova Fila do Open channel", - "NEW_OPENCHANNELACCOUNT": "Nova Conta do Open channel", - "NO_AVAILABLE_INFO": "Nenhuma informação disponível", - "ALL_TEAMS": "Todas as equipes", + "TIMEOUT": "Timeout", + "OPENCHANNELDISPOSITIONS": "Qualificações Open Channel", + "NO_OPENCHANNELDISPOSITION_AVAILABLE": "Nenhuma Qualificação Open Channel disponível", + "NEW_OPENCHANNELDISPOSITION": "Nova Qualificação Open Channel", + "ADD_OPENCHANNELDISPOSITION": "Adicionar qualificação Open Channel", + "EDIT_OPENCHANNELDISPOSITION": "Editar Qualificação Open Channel", + "DELETE_OPENCHANNELDISPOSITION": "Excluir Qualificação Open Channel", + "NEW_OPENCHANNELQUEUE": "Nova Fila Open channel", + "NEW_OPENCHANNELACCOUNT": "Nova Conta Open channel", + "NO_AVAILABLE_INFO": "Nenhuma info disponível", + "ALL_TEAMS": "Todas Equipes", "SELECTED_TEAMS": "Equipes Selecionadas", - "REPLYURI": "URL de resposta", - "RECEIVEURI": "Receber URL", + "REPLYURI": "URL de Resposta", + "RECEIVEURI": "Receive URL", "HELP": { - "TOKEN": "Adicione esta propriedade como string de consulta em sua URL do serviço da Web. Para obter mais detalhes, consulte o documento aqui ", - "RECEIVEURI": "Cadeia de caracteres da API gerada automaticamente para ser usada para receber mensagens dentro de seu canal aberto a partir do aplicativo externo (usando o método POST). Clique no botão da área de transferência para copiá-lo", - "REPLYURI": "O URL que o canal aberto irá chamar ao enviar ou responder a uma mensagem. Para obter mais detalhes, consulte o documento aqui ", + "TOKEN": "Token para consumir API do XCally.", + "RECEIVEURI": "Auto-generated API string para receber mensagens dentro do Open Channel a partir do aplicativo externo (usando o método POST). Clique no botão da área de transferência para copiá-lo", + "REPLYURI": "O URL que o Open Channel chamará ao enviar ou responder a uma mensagem.", "NAME": "Somente números, letras e caracteres específicos (._) são suportados", - "LIST": "Lista de contatos do gerenciador usada para associar contatos", - "MANDATORYDISPOSITION": "Disposição obrigatória", - "MANDATORYDISPOSITIONPAUSEID": "Pausar para usar se a disposição obrigatória estiver ativada", - "WELCOMEMESSAGE": "Esta é a primeira mensagem enviada ao contator" + "LIST": "Lista usada para associar contatos", + "MANDATORYDISPOSITION": "Qualificação obrigatória", + "MANDATORYDISPOSITIONPAUSEID": "Pausa para Qualificação obrigatória", + "WELCOMEMESSAGE": "Esta é a primeira mensagem enviada em uma nova interação" }, "PAGE": "Página", "ROWSPERPAGE": "Linhas por Página", "OF": "do", "CONTACT": "Contato", - "STARTEDAT": "Começou às", + "STARTEDAT": "Iniciou em", "STATUS": "Status", - "CLOSED": "Fechadas", + "CLOSED": "Encerrado", "OPENED": "Aberto", "OPEN": "Abrir", "ACCOUNT": "Conta", @@ -196,18 +196,18 @@ "SELECT_STATUS": "Selecione um status", "FILTER": "Filtro", "FILTERS": "Filtros", - "CLOSEDAT": "Fechado em", - "DISPOSITION": "Disposição", - "NOTES": "Notas", + "CLOSEDAT": "Encerrado em", + "DISPOSITION": "Qualificação", + "NOTES": "Anotações", "NO_INTERACTION_AVAILABLE": "Não há interações disponíveis", "SELECT_ACCOUNT": "Selecione uma conta", "GOTOP": "Gotop", "EDIT_GOTOP": "Editar Gotop", - "EDIT_CLOSE": "Editar Fechar", - "INFO": "Informação", + "EDIT_CLOSE": "Editar Encerramento", + "INFO": "Info", "KEY": "Key", "UNKNOWN": "Desconhecido", - "UNREGISTERED": "Não registrado", + "UNREGISTERED": "Não Registrado", "UNAVAILABLE": "Indisponível", "NOT_INUSE": "Fora de uso", "REACHABLE": "Alcançável", @@ -220,8 +220,8 @@ "PHONE_STATUS": "Status do telefone", "PAUSE": "Pausa", "LOGOUT": "Sair", - "AGENTADD_QUEUE": "Adicionar agente à fila de Open Channel", - "UNPAUSE": "Finalizar Pausa", + "AGENTADD_QUEUE": "Adicionar Agente à Fila Open Channel", + "UNPAUSE": "Despausar", "DEFAULT_PAUSE": "Pausa padrão", "LOGGED_IN": "Logado", "PAUSED": "Pausado", @@ -232,40 +232,40 @@ "MAIL": "Email", "SMS": "SMS", "FAX": "Fax", - "AGENTSADD_QUEUE": "Adicionar agentes à fila de Open Channel", + "AGENTSADD_QUEUE": "Adicionar Agentes à fila Open Channel", "INTERACTIONS_OPENCHANNELACCOUNT": "Ir para Interações", "REFRESH_INTERACTIONS": "Atualizar Interações", "DELETE_INTERACTION": "Excluir interação", - "AGENTADD_OPENCHANNELACCOUNT": "Adicionar agente à conta do Openchannel", - "CANNED_ANSWER_SEARCH": "Digite um texto para pesquisar uma resposta automática", + "AGENTADD_OPENCHANNELACCOUNT": "Adicionar Agente à Conta Openchannel", + "CANNED_ANSWER_SEARCH": "Não econtrado Resposta Pré-definida", "CANNED_ANSWER_NOT_FOUND": "Nenhuma resposta automática foi encontrada", "SEND": "Enviar", "TO": "Para", "MAPKEY": "Map Key", - "TEAMS_ASSOCIATION": "Associação de equipes", - "MANDATORYDISPOSITION": "Disposição obrigatória", - "MANDATORYDISPOSITIONPAUSEID": "Pausar para usar se a disposição obrigatória estiver ativada", - "DIALOGFLOW": "Fluxo de Diálogo", - "EDIT_DIALOGFLOW": "Editar configuração do fluxo de diálogo", - "LANGUAGE": "Língua", - "WELCOMEMESSAGE": "Mensagem de boas-vindas", - "ACCESSKEYID": "ID da chave de acesso", + "TEAMS_ASSOCIATION": "Associação de Equipes", + "MANDATORYDISPOSITION": "Qualificação obrigatória", + "MANDATORYDISPOSITIONPAUSEID": "Pausa para Qualificação obrigatória", + "DIALOGFLOW": "Dialogflow", + "EDIT_DIALOGFLOW": "Editar Dialogflow ", + "LANGUAGE": "Idioma", + "WELCOMEMESSAGE": "Mensagem de Boas-Vindas", + "ACCESSKEYID": "ID Chave Acesso", "AMAZONLEX": "AmazonLex", - "BOTNAME": "Nome do bot", - "EDIT_AMAZONLEX": "Editar configuração de Lex", + "BOTNAME": "Nome Bot", + "EDIT_AMAZONLEX": "Editar configuração Lex", "LEXREGION": "Região", - "SECRETACCESSKEY": "Segredo da chave de acesso", - "TOOLTIP_SCREENRECORDING_OFF": "Gravação de tela disponível", - "TOOLTIP_SCREENRECORDING_ON": "Gravação de tela em andamento", + "SECRETACCESSKEY": "Access key secret", + "TOOLTIP_SCREENRECORDING_OFF": "Gravação de Tela disponível", + "TOOLTIP_SCREENRECORDING_ON": "Gravação de Tela em andamento", "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download sem anexos", "DOWNLOAD_WITH_ATTACHMENTS": "Download com anexos", "LASTMESSAGE": "Última mensagem", - "CLIENTEMAIL": "Email do cliente", + "CLIENTEMAIL": "Email Cliente", "DIALOGFLOWV2": "Dialogflow V2", "EDIT_DIALOGFLOWV2": "Editar Dialogflow V2", - "PRIVATEKEY": "Chave privada", - "PROJECTID": "ID do projeto", + "PRIVATEKEY": "Private Key", + "PROJECTID": "ID Projeto", "ADD_NOTE": "Adicionar nota", - "NOTE": "Observação" + "NOTE": "Anotação" } } diff --git a/public/app/main/apps/settings/i18n/bs.json b/public/app/main/apps/settings/i18n/bs.json index 6a12726..d7c7936 100644 --- a/public/app/main/apps/settings/i18n/bs.json +++ b/public/app/main/apps/settings/i18n/bs.json @@ -1,309 +1,309 @@ { "SETTINGS": { - "RTLSUPPORT": "RTL Support", - "PREFERRED": "Preferred Logo", - "DEFAULT_PREFERRED": "Default Preferred Logo", + "RTLSUPPORT": "RTL PodrÅ¡ka", + "PREFERRED": "Preferirani Logo", + "DEFAULT_PREFERRED": "Zadani Preferirani Logo", "FAVICON": "Favicon", - "DEFAULT_FAVICON": "Default Favicon", - "MOTIONBARREMEMBERME": "Remember Me", - "CHATTIMEOUT": "Chat closing interaction timeout", + "DEFAULT_FAVICON": "Zadani Favicon", + "MOTIONBARREMEMBERME": "Zapamti Me", + "CHATTIMEOUT": "Zatvaranje chat interakcije timeout", "VIRTUAL": "Chat", "VOICE": "Voice", - "SESSIONS": "Sessions", - "ADDONS": "Add-ons", - "REPORT": "Report", - "SPLIT": "Split report", - "SPLITSIZECSV": "Split report size [CSV records]", - "SPLITSIZEPDF": "Split report size [PDF records]", - "SPLITSIZEXLSX": "Split report size [XLSX records]", - "ENABLEEMAILPREVIEW": "Enable Email Preview", - "COPY_LICENSE": "Copy token to clipboard", - "DOWNLOAD_LICENSE_LOG_FILE": "Download license log file", - "LICENSE_LOG_FILE": "License log file", - "LICENSE_LOG_FILE_DOWNLOADED": "License log file downloaded!", - "CLIPBOARD": "Clipboard", - "COPIED_TO_CLIPBOARD": "Token copied to clipboard", + "SESSIONS": "Sesije", + "ADDONS": "Dodaci", + "REPORT": "IzvjeÅ¡taj", + "SPLIT": "Podijeli izvjeÅ¡taj", + "SPLITSIZECSV": "Podijeljeni izvjeÅ¡taj veličina [CSV zapisi]", + "SPLITSIZEPDF": "Podijeljeni izvjeÅ¡taj veličina [PDF zapisi]", + "SPLITSIZEXLSX": "Podijeljeni izvjeÅ¡taj veličina [XLSX zapisi]", + "ENABLEEMAILPREVIEW": "Omogući E-Mail Pregled", + "COPY_LICENSE": "Kopiraj token u međuspremnik", + "DOWNLOAD_LICENSE_LOG_FILE": "Skini log licence datoteku", + "LICENSE_LOG_FILE": "Log Licence datoteka", + "LICENSE_LOG_FILE_DOWNLOADED": "Log Licence datoteka skinuta!", + "CLIPBOARD": "Međuspremnik", + "COPIED_TO_CLIPBOARD": "Token kopiran u međuspremnik", "JAWS": "Jaws", "MOTIONBAR": "Motionbar", - "MOTIONBARAUTOUPDATER": "Auto Updater", - "MOTIONBARAUTOUPDATERURL": "Auto Updater URL", + "MOTIONBARAUTOUPDATER": "Automatsko Ažuriranje", + "MOTIONBARAUTOUPDATERURL": "Automatsko Ažuriranje URL", "SMTP_SSL": "SMTP SSL", - "CALL_RECORDING_ENCRYPTION": "Voice Recording Encryption", - "TURNADDR": "TURN Address", - "TURN_USERNAME": "TURN Username", - "TURN_PASSWORD": "TURN Password", + "CALL_RECORDING_ENCRYPTION": "Voice Snimanje Enkripcija", + "TURNADDR": "TURN Adresa", + "TURN_USERNAME": "TURN Korisničko ime", + "TURN_PASSWORD": "TURN Lozinka", "WEBRTC": "WebRTC", "CALLYSQUARE": "Cally Square", - "PREVIEW_RECALLME_REMINDER_INTERVAL": "Preview Recallme Reminder Interval", - "ENABLED": "Enabled", - "DISABLED": "Disabled", - "UNLIMITED_CHANNELS": "Unlimited Channels", - "RELOAD": "Reload", - "VERIFY": "Verify", - "INTERFACE": "Interface", - "UPDATING": "Updating", - "REMOTE_VERSION": "Remote Version", - "NO_NEW_VERSION_AVAILABLE": "No new version available", - "TOP_N_PROCESSES": "Top {{value}} processes", - "SYSTEM": "System", - "FILE_SYSTEM": "File System", - "PROCESSES": "Processes", - "MOUNT_POINT": "Mount", - "AVG_LOAD": "AVG Load", - "TOTAL": "Total", - "USED": "Used", - "FREE": "Free", - "NAME": "Name", - "STATE": "State", + "PREVIEW_RECALLME_REMINDER_INTERVAL": "Pregled Intervala Podsjetnika Recall Me", + "ENABLED": "Omogućeno", + "DISABLED": "Onemogućeno", + "UNLIMITED_CHANNELS": "Neograničeno Kanala", + "RELOAD": "Učitaj", + "VERIFY": "Verifikuj", + "INTERFACE": "Interfejs", + "UPDATING": "Ažuriranje", + "REMOTE_VERSION": "Udaljena Verzija ", + "NO_NEW_VERSION_AVAILABLE": "Nije dostupna nova verzija", + "TOP_N_PROCESSES": "Najbolji {{value}} procesi", + "SYSTEM": "Sistem", + "FILE_SYSTEM": "Datoteka Sistem", + "PROCESSES": "Procesi", + "MOUNT_POINT": "Montiraj", + "AVG_LOAD": "AVG Opterećenje", + "TOTAL": "Ukupno", + "USED": "KoriÅ¡ten", + "FREE": "Besplatno", + "NAME": "Naziv", + "STATE": "Država", "CHAT": "Chat", - "MAIL": "Email", - "MESSAGING": "Sms", - "WHATSAPP": "WhatsApp Connector", + "MAIL": "E-Mail", + "MESSAGING": "SMS", + "WHATSAPP": "WhatsApp Konektor", "FAX": "Fax", - "OPENCHANNEL": "Open Channel", - "AGENTS": "Agents", - "USERS": "Users", - "TELEPHONES": "Telephones", - "STAFF": "Staff", - "CHANNELS": "Channels", - "MODULES": "Modules", - "CM": "Contacts Manager", - "DIALER": "Dialer", + "OPENCHANNEL": "Otvoreni Kanal", + "AGENTS": "Specijalisti", + "USERS": "Korisnici", + "TELEPHONES": "Telefoni", + "STAFF": "Osoblje", + "CHANNELS": "Kanali", + "MODULES": "Moduli", + "CM": "Kontakt Menadžer", + "DIALER": "Birač", "JSCRIPTY": "Jscripty", - "CUSTOM": "Customization", + "CUSTOM": "Prilagođavanje", "VIDEO": "Video", - "SCREENRECORDING": "Screen Recording", - "UPDATE": "Update", - "OTHERS": "Others", - "SETTINGS": "Settings", - "GENERAL": "General", + "SCREENRECORDING": "Snimanje Ekrana", + "UPDATE": "Ažuriraj", + "OTHERS": "Ostali", + "SETTINGS": "Postavke", + "GENERAL": "Općenito", "SMTP": "SMTP", - "NETWORKS": "Networks", - "UPDATES": "Updates", - "LICENSE": "License", - "ID": "Id", - "MIN_INTERNAL": "Min Internal", - "MIN_MAILBOX": "Min Mailbox", - "INSTALLED_AT": "Installed At", - "SEARCH_FOR_ANYONE": "Search", - "EDIT_GENERAL": "Edit General", - "SECURE_PASSWORD": "Secure Password", + "NETWORKS": "Mreže", + "UPDATES": "Ažuriranja", + "LICENSE": "Licenca", + "ID": "ID", + "MIN_INTERNAL": "Min Interni", + "MIN_MAILBOX": "Min PoÅ¡tansko sanduče", + "INSTALLED_AT": "Instalirano Na", + "SEARCH_FOR_ANYONE": "Traži", + "EDIT_GENERAL": "Uredi Općenito", + "SECURE_PASSWORD": "Sigurna Lozinka", "LOGO": "Logo", - "DEFAULT_LOGO": "Default Logo", - "DEFAULT_LOGIN_LOGO": "Default Login Logo", + "DEFAULT_LOGO": "Zadani Logo", + "DEFAULT_LOGIN_LOGO": "Zadani Prijava Logo", "WHITELABEL": "White Label", - "DEFAULT_HEADER_WHITELABEL": "Default Header White Label", - "HEADER_WHITELABEL": "Header White Label", - "CREATED_AT": "Created At", - "SAVE": "Save", - "SMTP_SERVICE": "Service", + "DEFAULT_HEADER_WHITELABEL": "Zadano Zaglavnje White Label", + "HEADER_WHITELABEL": "Zaglavlje White Label", + "CREATED_AT": "Kreirano U", + "SAVE": "Sačuvaj", + "SMTP_SERVICE": "Usluga", "SMTP_HOST": "Host", - "SMTP_USERNAME": "Username", - "DESCRIPTION": "Description", - "SMTP_PASSWORD": "Password", + "SMTP_USERNAME": "Korisničko ime", + "DESCRIPTION": "Opis", + "SMTP_PASSWORD": "Lozinka", "SMTP_PORT": "Port", - "SMTP_SECURE": "Secure", - "TYPE": "Type", - "ADDRESS": "Address", - "USERNAME": "Username", - "NEW_NETWORK": "New Network", - "ADD_NETWORK": "Add Network", + "SMTP_SECURE": "Sigurno", + "TYPE": "Vrsta", + "ADDRESS": "Adresa", + "USERNAME": "Korisničko ime", + "NEW_NETWORK": "Nova Mreža", + "ADD_NETWORK": "DOdaj Mrežu", "IMAPGENERALSETTINGS": "IMAP", - "LOGINMAILFREQUENCY": "Login Mail Frequency (sec)", - "DEFAULTSCREENRECORDINGPATH": "Screen Recording path", - "APPZONE": "App Zone", - "EDIT_NETWORK": "Edit Network", - "DELETE_NETWORK": "Delete Network", - "BACK": "Back", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "EXPIRATION_DATE": "Expiration Date", - "REQUEST_LICENSE": "Request License", - "EMAIL": "Email", - "SEND": "Send", + "LOGINMAILFREQUENCY": "Učestalost Mail Prijave (sek)", + "DEFAULTSCREENRECORDINGPATH": "Snimanje Ekrana putanja", + "APPZONE": "App Zona", + "EDIT_NETWORK": "Uredi Mrežu", + "DELETE_NETWORK": "IzbriÅ¡i Mrežu", + "BACK": "Nazad", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odaberi Sve", + "SELECT_NONE": "Odaberi NiÅ¡ta", + "EXPIRATION_DATE": "Datum Isteka", + "REQUEST_LICENSE": "Zatjev za Licencu", + "EMAIL": "E-Mail", + "SEND": "PoÅ¡alji", "PLAN": "Plan", - "MONTH_TO_MONTH": "Month to month", - "MOTION_PROCESS_MANAGEMENT": "Motion Process Management", - "USEFUL_COMMANDS": "Useful Commands", - "COMMAND": "Command", - "PM2_LIST": "List all processes", - "PM2_START": "Start a process by id or name", - "PM2_STOP": "Stop a process by id or name or insert 'all' to stop all the active processes", - "PM2_RESTART": "Restart a process by id or name", - "PM2_LOGS": "Stream all processes log files, unless a specific process id or name is provided", - "PASSWORD": "Password", - "NO_AVAILABLE_INFO": "No available info", - "STUNADDR": "STUN Address", - "CHANGELOG": "Changelog", - "CURRENT_VERSION": "Current version", - "CUSTOMIZATIONS": "Customizations", - "LOCALNETADDRESS": "Localnet Address", - "NEW_VERSION": "New Version", - "TRIAL_VERSION": "Trial Version", + "MONTH_TO_MONTH": "Iz mjseca u mjesec", + "MOTION_PROCESS_MANAGEMENT": "Upravljanje Motion Procesima", + "USEFUL_COMMANDS": "Korisne Naredbe", + "COMMAND": "Naredba", + "PM2_LIST": "Navedi sve procese", + "PM2_START": "Započni proces pomoću ID ili naziva", + "PM2_STOP": "Zaustavi proces pomoću ID ili naziva ili ubaci 'sve' da zaustaviÅ¡ sve aktivne procese", + "PM2_RESTART": "Ponovo pokreni proces pomoću ID ili naziva", + "PM2_LOGS": "Pusti sve datoteke logove procesa, osim ako nije naveden određeni proces ID ili naziv", + "PASSWORD": "Lozinka", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "STUNADDR": "STUN Adresa", + "CHANGELOG": "Log Promjena", + "CURRENT_VERSION": "Trenutna verzija", + "CUSTOMIZATIONS": "Prilagođavanja", + "LOCALNETADDRESS": "Lokalna Adresa", + "NEW_VERSION": "Nova Verzija", + "TRIAL_VERSION": "Probna Verzija", "TOKEN": "Token", - "NEW_TOKEN_DETECTED": "New Token Detected", - "EXPIRATION_GRAY_PERIOD": "Gray Period Expiration", - "NEW_TOKEN": "New Token", - "PRICES": "Prices", - "UPDATE_LICENSE": "Update License", - "LOGOLOGIN": "Login Logo", - "EXPIRATION_REASON": "Expiration Reason", - "GLOBAL": "Global", - "SMTP_AUTHENTICATION": "Authentication", - "LICENSE_REQUEST_SENT": "Thank you! The Licensing Team will check your account asap in order to approve your request: you will receive an email when the changes become effective. Please refer to license@xcally.com for further informations.", - "ACCOUNTNAME": "Account Name", - "EMAILADDRESS": "Email Address", - "EXPIRATION_REASON_MESSAGE_DISABLED": "Your license has been disabled.", - "EXPIRATION_REASON_MESSAGE_CHANGED": "Your machine unique id has been updated due to a change to your system.", - "EXPIRATION_CHANGED_ADVISE": "Contact xCALLY Motion License Team sending both your old and your new uuid.", - "OLD_TOKEN": "Old Token", - "SEND_EMAIL_TO": "Send Email to", - "JIRA_ERROR_MESSAGE": "Error during license request. Please contact our license team at license@xcally.com with your request", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "PAGE_TITLE": "Page Title", - "DEFAULT_PAGE_TITLE": "Default Page Title", - "PERPETUAL": "Perpetual", - "SECURITY_SUITE": "Security Suite", - "ANNUALLY": "Annually", - "AGENTOMNIDESKTOPINTERFACE": "Agent Omni Desktop Interface", - "MESSAGESALIGNMENT": "Messages Alignment", - "ENTER_LICENSE": "Enter your license", - "UPDATE_LICENSE_MANUALLY": "Do you want to update your license manually?", - "SECURITY": "Security", - "ALLOWEDLOGINATTEMPTS": "Allowed login attempts before locking the user/agent", - "BLOCKDURATION": "Minutes to wait before automatic unlock", - "AI": "A.I. Tools", - "AITOOLS": "A.I. Tools", - "SERVICE": "Service", - "NEW_CLOUDPROVIDER": "New Account", - "ADD_CLOUDPROVIDER": "Add Account", - "DELETE": "Delete", - "SECRETACCESSKEY": "Secret Access Key", - "ACCESSKEY": "Access Key ID", - "EDIT_CLOUDPROVIDER": "Edit Account", - "DELETE_CLOUDPROVIDER": "Delete Account", - "LANGUAGE": "Language", - "BUCKET": "Bucket", + "NEW_TOKEN_DETECTED": "Novi Token Otkriven", + "EXPIRATION_GRAY_PERIOD": "Sivi Period Istek", + "NEW_TOKEN": "Novi Token", + "PRICES": "Cijene", + "UPDATE_LICENSE": "Ažuriraj Licence", + "LOGOLOGIN": "Logo Prijave", + "EXPIRATION_REASON": "Razlog Isteka", + "GLOBAL": "Globalno", + "SMTP_AUTHENTICATION": "Autentifikacija", + "LICENSE_REQUEST_SENT": "Hvala ti! Tim za licenciranje će provjeriti tvoj nalog, kako bi odobrio tvoj zahtjev: primit ćeÅ¡ e-mail kada promjene stupaju na snagu. Molim obrati se na license@xcally.com za viÅ¡e informacija.", + "ACCOUNTNAME": "Naziv Naloga", + "EMAILADDRESS": "E-Mail Adresa", + "EXPIRATION_REASON_MESSAGE_DISABLED": "Tvoja licenca je onemogućena", + "EXPIRATION_REASON_MESSAGE_CHANGED": "Jedinistveni ID tvoje maÅ¡ine je ažuriran zbog promjena na tvom sistemu.", + "EXPIRATION_CHANGED_ADVISE": "Kontaktiraj XCally Motion zajedno sa tvojim starim i novim UUID.", + "OLD_TOKEN": "Stari Token", + "SEND_EMAIL_TO": "PoÅ¡alji E-Mail na", + "JIRA_ERROR_MESSAGE": "GreÅ¡ka tokom zahtjeva za licencu. Molim kontaktirajte naÅ¡ tim za licenciranje na licence@xcally.com sa svojim zahtjevom", + "PAGE": "Strana", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", + "PAGE_TITLE": "Naslov Stranice", + "DEFAULT_PAGE_TITLE": "Zadani Naslog Stranice", + "PERPETUAL": "Vječan", + "SECURITY_SUITE": "Sigurnosni Suite", + "ANNUALLY": "GOdiÅ¡nje", + "AGENTOMNIDESKTOPINTERFACE": "Specijalista Omni Desktop Interfejs", + "MESSAGESALIGNMENT": "Poravnanje Poruka", + "ENTER_LICENSE": "Unesi svoju licencu", + "UPDATE_LICENSE_MANUALLY": "ŽeliÅ¡ li ručno ažurirati svoju licencu?", + "SECURITY": "Sigurnost", + "ALLOWEDLOGINATTEMPTS": "Dozvoljeni pokuÅ¡aji prijave prije zaključavanja korisnika/specijaliste", + "BLOCKDURATION": "Minute za čekanje prije automatskog otključavanja", + "AI": "A.I. Alati", + "AITOOLS": "A.I. Alati", + "SERVICE": "Servis", + "NEW_CLOUDPROVIDER": "Novi Nalog", + "ADD_CLOUDPROVIDER": "Dodaj Nalog", + "DELETE": "IzbriÅ¡i", + "SECRETACCESSKEY": "Tajni Pristupni Ključ", + "ACCESSKEY": "Pristupni ključ ID", + "EDIT_CLOUDPROVIDER": "Uredi Nalog", + "DELETE_CLOUDPROVIDER": "IzbriÅ¡i Nalog", + "LANGUAGE": "Jezik", + "BUCKET": "Kanta", "TRANSCRIBE": "Transcribe", "TRANSCRIBEREGION": "Transcribe Region", - "TRANSCRIBEACCOUNT": "Transcribe Account", - "SENTIMENTANALYSIS": "Sentiment Analysis", - "SENTIMENTREGION": "Sentiment Analysis Region", - "SENTIMENTACCOUNT": "Sentiment Analysis Account", + "TRANSCRIBEACCOUNT": "Transcribe Nalog", + "SENTIMENTANALYSIS": "Sentiment Analiza", + "SENTIMENTREGION": "Sentiment Analiza Region", + "SENTIMENTACCOUNT": "Sentiment Analiza Nalog", "SSO": "SSO", - "GOOGLE_SSO_ENABLED": "Google SSO Enabled", - "ENFORCE_PASSWORD_HISTORY": "Enforce Password History", - "PASSWORD_HISTORY_LIMIT": "Password History Limit", - "PRIVACY_POLICY_EMAIL": "Privacy Policy for Email Addresses", - "PRIVACY_POLICY_NAME": "Privacy Policy for Names", - "PRIVACY_POLICY_NUMBER": "Privacy Policy for Numbers", - "SEARCH_ON_ENTER_KEY": "Search on Enter key", - "CHAT_INTERACTIONS_RELOAD_TIMEOUT": "Chat interactions reload timeout", - "MAIL_INTERACTIONS_RELOAD_TIMEOUT": "Email interactions reload timeout", - "OPENCHANNEL_INTERACTIONS_RELOAD_TIMEOUT": "Open Channel interactions reload timeout", - "SMS_INTERACTIONS_RELOAD_TIMEOUT": "SMS interactions reload timeout", - "WHATSAPP_INTERACTIONS_RELOAD_TIMEOUT": "WhatsApp Connector interactions reload timeout", - "STOP_RECORDING_ON_VOICE_CALL_TRANSFER": "Stop recording on voice call transfer", - "DISABLED_COOKIE": "Cookies banner", - "AD_SSO_ENABLED": "Active Directory SSO Enabled", - "CLOUD_PROVIDERS": "Cloud Providers", - "APPLICATION_ID": "Application Id", - "TENANT_ID": "Tenant Id", - "CLIENT_SECRET": "Client Secret", - "NEW_CLIENT_SECRET": "New Client Secret", - "REDIRECT_URI": "Redirect URI", - "REMOTE_URI": "Remote URI", - "AUTHENTICATE": "Authenticate", - "AUTHENTICATE_TO_MICROSOFT_IDENTITY_PLATFORM": "Authenticate to Microsoft Identity Platform", - "MICROSOFT_AUTHENTICATION_SUCCESS": "Authentication to the Microsoft Identity Platform completed successfully", - "MICROSOFT_AUTHENTICATION_FAIL": "Something went wrong while authenticating to the Microsoft Identity Platform", - "UPDATE_CLIENT_SECRET": "Update Client Secret", + "GOOGLE_SSO_ENABLED": "Google SSO Omogućen", + "ENFORCE_PASSWORD_HISTORY": "Provedi Historiju Lozinki", + "PASSWORD_HISTORY_LIMIT": "Historija Lozinki Limit", + "PRIVACY_POLICY_EMAIL": "Politika privatnosti za E-Mail Adrese", + "PRIVACY_POLICY_NAME": "Politika privatnosti za Nazive", + "PRIVACY_POLICY_NUMBER": "Politika privatnosti za Brojeve", + "SEARCH_ON_ENTER_KEY": "Traži na Enter tipku", + "CHAT_INTERACTIONS_RELOAD_TIMEOUT": "Ponovno učitavanje chat interakcije timeout", + "MAIL_INTERACTIONS_RELOAD_TIMEOUT": "E-Mail interakcije učitavanje timeout", + "OPENCHANNEL_INTERACTIONS_RELOAD_TIMEOUT": "Otvoreni Kanal inerakcija učitavanje timeout", + "SMS_INTERACTIONS_RELOAD_TIMEOUT": "SMS interakcije učitavanje timeout", + "WHATSAPP_INTERACTIONS_RELOAD_TIMEOUT": "WhatsApp Konektor interakcije učitavanje timeout", + "STOP_RECORDING_ON_VOICE_CALL_TRANSFER": "Zaustavi snimanje pri prijenosu govornog poziva", + "DISABLED_COOKIE": "Kolačići baner", + "AD_SSO_ENABLED": "Active Directory SSO Omogućen", + "CLOUD_PROVIDERS": "Cloud Provajderi", + "APPLICATION_ID": "Aplikacija ID", + "TENANT_ID": "Stanar ID", + "CLIENT_SECRET": "Tajna Klijenta", + "NEW_CLIENT_SECRET": "Nova Klijent Tajna", + "REDIRECT_URI": "Preusmjeravanje URI", + "REMOTE_URI": "Udaljeni URI", + "AUTHENTICATE": "Autentifikacija", + "AUTHENTICATE_TO_MICROSOFT_IDENTITY_PLATFORM": "Autentificiraj za Microsoft Identitet Platformu", + "MICROSOFT_AUTHENTICATION_SUCCESS": "Autentifikacija za Microsoft Identifikacija Platformu je uspjeÅ¡no zavrÅ¡ena", + "MICROSOFT_AUTHENTICATION_FAIL": "NeÅ¡to je poÅ¡lo po zlu prilikom autentifikacije na Microsoft Identifikacija Platforma", + "UPDATE_CLIENT_SECRET": "Ažuriraj Klijent Tajnu", "HELP": { - "DEFAULTSCREENRECORDINGPATH": "Enter the path where to store screen recording files on the Agent computer (leave empty for default Video Folder path)", - "RTLSUPPORT": "Enables the RTL Support for Arabic, Persian and Hebrew languages", - "ADDRESS": "External (public) ip address", - "LOCALNETADDRESS": "Local ip address/subnet", - "SMTP_SECURE": "If true, the connection to the server will use TLS", - "SMTP_USERNAME": "Username used for authentication", - "SMTP_PASSWORD": "Password used for authentication", - "EMAILADDRESS": "The message origin Email address (from)", - "SECURITY_SUITE": "Enables the secure password format, the mandatory password reset after the first login and the password expiration after 90 days", - "MOTIONBARREMEMBERME": "Enable/Disable the Remember Me feature in Motion Phonebar", - "LOGINMAILFREQUENCY": "Please remember to restart the EMAIL service each time this parameter has been changed", - "USERNAME": "Username", - "PASSWORD": "Password", - "PREVIEW_RECALLME_REMINDER_INTERVAL": "Time interval in minutes before which notification will be sent to agent informing him about preview recall to be made", - "ENFORCE_PASSWORD_HISTORY": "Enables the validation against previously used passwords", - "PASSWORD_HISTORY_LIMIT": "Number of last used unique passwords to check", - "PRIVACY_POLICY": "Number of characters that will be replaced with an asterisk (*) (0 = all characters)", - "SEARCH_ON_ENTER_KEY": "Start searching only after the agent hits the Enter key", - "INTERACTIONS_RELOAD_TIMEOUT": "Time interval in seconds after which interactions are reloaded (0 = real-time update)", - "CLIENT_SECRET": "The secret will no longer be visible once the configuration is saved. Store it safely if you want to use it elsewhere.", - "LIMIT_TABS": "Maximum number of possible interaction tabs open" + "DEFAULTSCREENRECORDINGPATH": "Unesi putanju na kojoj ćeÅ¡ sačuvati datoteke snimanja ekrana na Specijalistinom računaru (ostavi prazno za zadanu putanju video foldera)", + "RTLSUPPORT": "Omogućava RTL PodrÅ¡ku za arapski, perzijski i hebrejski jezik", + "ADDRESS": "Eksterna (javna) IP adresa", + "LOCALNETADDRESS": "Lokalna IP adresa/podmreža", + "SMTP_SECURE": "Ako je tačno, veza sa serverom će koristiti TLS", + "SMTP_USERNAME": "Korisničko ime koje se koristi za autentifikaciju", + "SMTP_PASSWORD": "Lozinka koja se koristi za autentifikaciju", + "EMAILADDRESS": "Porijeklo poruke E-Mail adresa (od)", + "SECURITY_SUITE": "Omogućava siguran format lozinke, obavezno resetiranje lozinke nakon prve prijave i isteka lozinke nakon 90 dana", + "MOTIONBARREMEMBERME": "Omogući/Onemogući funkciju Zapamti Me u Motion Phonebar", + "LOGINMAILFREQUENCY": "Ne zaboravi ponovo pokrenuti E-Mail uslugu svaki put kada se ovaj parametar promijeni", + "USERNAME": "Korisničko ime", + "PASSWORD": "Lozinka", + "PREVIEW_RECALLME_REMINDER_INTERVAL": "Vremenski interval u minutama prije kojeg će Specijalisti biti poslano obavjeÅ¡tenje informiÅ¡ući ga o pregledu recalla koji se treba obaviti", + "ENFORCE_PASSWORD_HISTORY": "Omogućava provjeru valjanosti u odnosu na prethodnu koriÅ¡tenu lozinku", + "PASSWORD_HISTORY_LIMIT": "Broj posljednjih koriÅ¡tenih jedinstvenih jedinstvenih lozinki za provjeru", + "PRIVACY_POLICY": "Broj znakova koji će biti zamijenjeni zvjezdicom (*) (0 = svi znakovi)", + "SEARCH_ON_ENTER_KEY": "Počni tražiti tek nakon Å¡to Specijalist pritisne tipku Enter", + "INTERACTIONS_RELOAD_TIMEOUT": "Vremenski interval u sekundama nakon Å¡to se interakcije ponovo učitaju (0 = ažuriranje u stvarnom vremenu)", + "CLIENT_SECRET": "Tajna viÅ¡e neče biti vidljiva nakon Å¡to se konfiguracija sačuva. Čuvaj ga bezbjedno ako ga želiÅ¡ koristiti negdje drugdje.", + "LIMIT_TABS": "Maksimalan broj mogućih otvorenih interakcija u tabovima" }, "ERRORS": { - "CHATTIMEOUT_REQUIRED": "Mandatory field", - "CHATTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MOTIONBARAUTOUPDATERURL_MUST_VALID_URL": "Wrong format", - "MOTIONBARAUTOUPDATERURL_REQUIRED": "Mandatory field", - "ADDRESS_REQUIRED": "Mandatory field", - "MIN_INTERNAL_REQUIRED": "Mandatory field", - "MIN_MAILBOX_REQUIRED": "Mandatory field", - "NAME_REQUIRED": "Mandatory field", - "HEADER_WHITELABEL_REQUIRED": "Mandatory field", - "LOCALNETADDRESS_REQUIRED": "Mandatory field", - "LOCALNETADDRESS_MUST_VALID_PATTERN": "Wrong format", - "ADDRESS_MUST_VALID_PATTERN": "Wrong format", - "ACCOUNTNAME_REQUIRED": "Mandatory field", - "EMAIL_MUST_VALID": "Wrong format", - "SMTP_USERNAME_REQUIRED": "Mandatory field", - "PASSWORD_REQUIRED": "Mandatory field", - "SMTP_HOST_REQUIRED": "Mandatory field", - "SMTP_PORT_REQUIRED": "Mandatory field", - "PREVIEW_RECALLME_REMINDER_INTERVAL_REQUIRED": "Mandatory field", - "MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "MIN_MAILBOX_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "PAGE_TITLE_REQUIRED": "Mandatory field", - "EMAIL_REQUIRED": "Mandatory field", - "PLAN_REQUIRED": "Mandatory field", - "LICENSE_REQUIRED": "Mandatory field", - "LOGINMAILFREQUENCY_REQUIRED": "Mandatory field", - "LOGINMAILFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "ALLOWEDLOGINATTEMPTS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "BLOCKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "ALLOWEDLOGINATTEMPTS_REQUIRED": "Mandatory field", - "BLOCKDURATION_REQUIRED": "Mandatory field", - "SERVICE_REQUIRED": "Mandatory field", - "SECRETACCESSKEY_REQUIRED": "Mandatory field", - "ACCESSKEY_REQUIRED": "Mandatory field", - "LANGUAGE_REQUIRED": "Mandatory field", - "BUCKET_REQUIRED": "Mandatory field", - "TRANSCRIBEREGION_REQUIRED": "Mandatory field", - "TRANSCRIBEACCOUNT_REQUIRED": "Mandatory field", - "SENTIMENTREGION_REQUIRED": "Mandatory field", - "SENTIMENTACCOUNT_REQUIRED": "Mandatory field", - "USERNAME_REQUIRED": "Mandatory field", - "FIELD_REQUIRED": "Mandatory field", - "WRONG_FORMAT": "Wrong format", - "PREVIEW_RECALLME_REMINDER_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to" + "CHATTIMEOUT_REQUIRED": "Obavezno polje", + "CHATTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MOTIONBARAUTOUPDATERURL_MUST_VALID_URL": "PogreÅ¡an format", + "MOTIONBARAUTOUPDATERURL_REQUIRED": "Obavezno polje", + "ADDRESS_REQUIRED": "Obavezno polje", + "MIN_INTERNAL_REQUIRED": "Obavezno polje", + "MIN_MAILBOX_REQUIRED": "Obavezno polje", + "NAME_REQUIRED": "Obavezno polje", + "HEADER_WHITELABEL_REQUIRED": "Obavezno polje", + "LOCALNETADDRESS_REQUIRED": "Obavezno polje", + "LOCALNETADDRESS_MUST_VALID_PATTERN": "PogreÅ¡an format", + "ADDRESS_MUST_VALID_PATTERN": "PogreÅ¡an format", + "ACCOUNTNAME_REQUIRED": "Obavezno polje", + "EMAIL_MUST_VALID": "PogreÅ¡an format", + "SMTP_USERNAME_REQUIRED": "Obavezno polje", + "PASSWORD_REQUIRED": "Obavezno polje", + "SMTP_HOST_REQUIRED": "Obavezno polje", + "SMTP_PORT_REQUIRED": "Obavezno polje", + "PREVIEW_RECALLME_REMINDER_INTERVAL_REQUIRED": "Obavezno polje", + "MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "MIN_MAILBOX_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "PAGE_TITLE_REQUIRED": "Obavezno polje", + "EMAIL_REQUIRED": "Obavezno polje", + "PLAN_REQUIRED": "Obavezno polje", + "LICENSE_REQUIRED": "Obavezno polje", + "LOGINMAILFREQUENCY_REQUIRED": "Obavezno polje", + "LOGINMAILFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "ALLOWEDLOGINATTEMPTS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "BLOCKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "ALLOWEDLOGINATTEMPTS_REQUIRED": "Obavezno polje", + "BLOCKDURATION_REQUIRED": "Obavezno polje", + "SERVICE_REQUIRED": "Obavezno polje", + "SECRETACCESSKEY_REQUIRED": "Obavezno polje", + "ACCESSKEY_REQUIRED": "Obavezno polje", + "LANGUAGE_REQUIRED": "Obavezno polje", + "BUCKET_REQUIRED": "Obavezno polje", + "TRANSCRIBEREGION_REQUIRED": "Obavezno polje", + "TRANSCRIBEACCOUNT_REQUIRED": "Obavezno polje", + "SENTIMENTREGION_REQUIRED": "Obavezno polje", + "SENTIMENTACCOUNT_REQUIRED": "Obavezno polje", + "USERNAME_REQUIRED": "Obavezno polje", + "FIELD_REQUIRED": "Obavezno polje", + "WRONG_FORMAT": "PogreÅ¡an format", + "PREVIEW_RECALLME_REMINDER_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od" }, "NOTIFICATIONS": { - "MICROSOFT_AUTHENTICATION_SUCCESS": "Authentication to the Microsoft Identity Platform completed successfully", - "MICROSOFT_AUTHENTICATION_FAIL": "Something went wrong while authenticating to the Microsoft Identity Platform", - "CLOUD_PROVIDER_CREATED_SUCCESS_TITLE": "Cloud Provider successfully created", - "CLOUD_PROVIDER_SAVED_SUCCESS_TITLE": "Cloud Provider successfully saved", - "CLOUD_PROVIDER_DELETE_TITLE": "Are you sure want to delete the cloud provider?", - "CLOUD_PROVIDER_DELETE_MESSAGE": "{{ name }} will be deleted", - "CLOUD_PROVIDER_DELETED_SUCCESS_TITLE": "Cloud Provider successfully deleted", - "CLOUD_PROVIDERS_DELETE_TITLE": "Are you sure want to delete the selected cloud providers?", - "CLOUD_PROVIDERS_DELETE_MESSAGE": "{{ total }} cloud providers will be deleted", - "CLOUD_PROVIDERS_DELETED_SUCCESS_TITLE": "Cloud Providers successfully deleted", - "SMTP_SAVED_SUCCESS_TITLE": "SMTP configuration successfully saved", - "CLOUD_PROVIDER_SECRET_UPDATE_SUCCESS_TITLE": "Client Secret successfully updated" + "MICROSOFT_AUTHENTICATION_SUCCESS": "Autentifikacija na Microsoft Identifikacija Platformi je uspjeÅ¡no zavrÅ¡ena", + "MICROSOFT_AUTHENTICATION_FAIL": "NeÅ¡to je poÅ¡lo po zlu prilikom provjere autentičnosti na Microsoft Identifikacija Platforma", + "CLOUD_PROVIDER_CREATED_SUCCESS_TITLE": "Cloud Provajder uspjeÅ¡no kreiran", + "CLOUD_PROVIDER_SAVED_SUCCESS_TITLE": "Cloud Provajder uspjeÅ¡no sačuvan", + "CLOUD_PROVIDER_DELETE_TITLE": "Jesi li siguran da želiÅ¡ izbrisati cloud provajdera? ", + "CLOUD_PROVIDER_DELETE_MESSAGE": "{{ name }} će biti izbrisan", + "CLOUD_PROVIDER_DELETED_SUCCESS_TITLE": "Cloud Provajder uspjeÅ¡no izbrisan", + "CLOUD_PROVIDERS_DELETE_TITLE": "Jesi li siguran da želiÅ¡ izbrisati odabrane cloud provajdere?", + "CLOUD_PROVIDERS_DELETE_MESSAGE": "{{ total }} cloud provajderi će biti izbrisani", + "CLOUD_PROVIDERS_DELETED_SUCCESS_TITLE": "Cloud Provajderi uspjeÅ¡no izbrisani", + "SMTP_SAVED_SUCCESS_TITLE": "SMTP konfiguracija je uspjeÅ¡no sačuvana", + "CLOUD_PROVIDER_SECRET_UPDATE_SUCCESS_TITLE": "Klijent Tajna uspjeÅ¡no ažurirana" }, - "LIMIT_TABS": "Limit of interaction tab" + "LIMIT_TABS": "Limit interakcija taba" } } diff --git a/public/app/main/apps/settings/i18n/de.json b/public/app/main/apps/settings/i18n/de.json index aa643d6..205a273 100644 --- a/public/app/main/apps/settings/i18n/de.json +++ b/public/app/main/apps/settings/i18n/de.json @@ -1,69 +1,69 @@ { "SETTINGS": { - "PREFERRED": "Preferred Logo", - "DEFAULT_PREFERRED": "Default Preferred Logo", - "MOTIONBAR": "Motionbar", + "PREFERRED": "Bevorzugtes Logo", + "DEFAULT_PREFERRED": "Standard-Logo", + "MOTIONBAR": "MotionBar", "WEBRTC": "WebRTC", "RELOAD": "Neu laden", - "VERIFY": "Überprüfen Sie, ob", - "INTERFACE": "Schnittstelle", + "VERIFY": "Überprüfen", + "INTERFACE": "Interface", "UPDATING": "Aktualisierung", "REMOTE_VERSION": "Remote-Version", "NO_NEW_VERSION_AVAILABLE": "Keine neue Version verfügbar", - "TOP_N_PROCESSES": "Top {{Wert}} Prozesse", + "TOP_N_PROCESSES": "Top {{value}} Prozesse", "SYSTEM": "System", - "FILE_SYSTEM": "File System", + "FILE_SYSTEM": "Dateisystem", "PROCESSES": "Prozesse", - "MOUNT_POINT": "Berg", - "AVG_LOAD": "AVG Laden", + "MOUNT_POINT": "Mount", + "AVG_LOAD": "AVG Load", "TOTAL": "Gesamt", "USED": "Verwendet", - "FREE": "Kostenlos", + "FREE": "Frei", "NAME": "Name", - "STATE": "Zustand", + "STATE": "Status", "CHAT": "Chat", "MAIL": "E-Mail", - "MESSAGING": "Sms", + "MESSAGING": "SMS", "FAX": "Fax", "OPENCHANNEL": "Offener Kanal", "AGENTS": "Agenten", - "USERS": "Benutzer", + "USERS": "Nutzer", "TELEPHONES": "Telefone", "STAFF": "Personal", - "CHANNELS": "Tv", + "CHANNELS": "Kanäle", "MODULES": "Module", - "CM": "Contacts Manager", - "DIALER": "Dialer", - "JSCRIPTY": "Jscripty", + "CM": "Kontaktmanager", + "DIALER": "Outbound-Dialer", + "JSCRIPTY": "JScripty", "CUSTOM": "Anpassung", - "UPDATE": "Update", - "OTHERS": "Andere", + "UPDATE": "Aktualisieren", + "OTHERS": "Weitere", "SETTINGS": "Einstellungen", "GENERAL": "Allgemein", "SMTP": "SMTP", "NETWORKS": "Netzwerke", - "UPDATES": "Aktuelles", + "UPDATES": "Updates", "LICENSE": "Lizenz", - "ID": "Id", - "MIN_INTERNAL": "Min. Interne", + "ID": "ID", + "MIN_INTERNAL": "Min. Interne Nummer", "MIN_MAILBOX": "Min Mailbox", - "INSTALLED_AT": "Installiert", - "SEARCH_FOR_ANYONE": "Suche für Jedermann", + "INSTALLED_AT": "Installiert am", + "SEARCH_FOR_ANYONE": "Suche", "EDIT_GENERAL": "Allgemein bearbeiten", "SECURE_PASSWORD": "Sicheres Kennwort", "LOGO": "Logo", "DEFAULT_LOGO": "Standard Logo", "DEFAULT_LOGIN_LOGO": "Login Logo", - "WHITELABEL": "White Label", + "WHITELABEL": "WhiteLabel", "CREATED_AT": "Erstellt am", "SAVE": "Speichern", - "SMTP_SERVICE": "Service", + "SMTP_SERVICE": "SMTP-Dienst", "SMTP_HOST": "SMTP-Host", - "SMTP_USERNAME": "SMTP-Benutzername", + "SMTP_USERNAME": "SMTP-Nutzername", "DESCRIPTION": "Beschreibung", "SMTP_PASSWORD": "SMTP-Passwort", "SMTP_PORT": "SMTP-Port", - "SMTP_SECURE": "Sichere", + "SMTP_SECURE": "Sicher", "TYPE": "Typ", "ADDRESS": "Adresse", "NEW_NETWORK": "Neues Netzwerk", @@ -71,204 +71,204 @@ "HELP": { "ADDRESS": "Die Adresse des Netzwerks", "LOCALNETADDRESS": "IP-Adresse/Subnetzmaske", - "SMTP_SECURE": "Bei true wird die Verbindung TLS verwenden, wenn eine Verbindung zu Server", - "SMTP_USERNAME": "Benutzername für die Authentifizierung verwendet werden", - "SMTP_PASSWORD": "Kennwort für die Authentifizierung verwendet werden", - "EMAILADDRESS": "Geben Sie die E-Mail-Adresse der Nachricht (von)", - "SECURITY_SUITE": "Aktiviert das sichere Passwort-Format, das obligatorische Zurücksetzen des Passworts nach der ersten Anmeldung und den Ablauf des Passworts nach 90 Tagen", - "MOTIONBARREMEMBERME": "Aktivieren / Deaktivieren der Funktion \"Merken\" in Motion Phonebar", + "SMTP_SECURE": "Bei true wird die Verbindung TLS verwenden", + "SMTP_USERNAME": "Nutzername für die Authentifizierung", + "SMTP_PASSWORD": "Passwort für die Authentifizierung", + "EMAILADDRESS": "E-Mail Adresse (Von)", + "SECURITY_SUITE": "Sicherheitseinstellungen aktivieren. (Neues Passwort bei initialer Anmeldung und Ändern des Passwortes nach 90 Tagen)", + "MOTIONBARREMEMBERME": "Merken der Anmeldedaten in der PhoneBar", "RTLSUPPORT": "Aktiviert die RTL-Unterstützung für Arabisch, Persisch und Hebräisch", - "DEFAULTSCREENRECORDINGPATH": "Geben Sie den Pfad ein, in dem die Bildschirmaufzeichnungsdateien auf dem Agent-Computer gespeichert werden sollen (leer lassen für den Standardpfad für den Videoordner).", + "DEFAULTSCREENRECORDINGPATH": "Geben Sie den Pfad ein, in dem die Bildschirmaufzeichnungsdateien auf dem Agenten-Computer gespeichert werden sollen (leer lassen für den Standardpfad für den Videoordner).", "LOGINMAILFREQUENCY": "Bitte denken Sie daran, den EMAIL-Dienst jedes Mal neu zu starten, wenn dieser Parameter geändert wurde", "PASSWORD": "Passwort", "USERNAME": "Nutzername", "ENFORCE_PASSWORD_HISTORY": "Aktiviert die Validierung anhand zuvor verwendeter Kennwörter", "PASSWORD_HISTORY_LIMIT": "Anzahl der zuletzt zu überprüfenden eindeutigen Kennwörter", - "SEARCH_ON_ENTER_KEY": "Beginnen Sie erst mit der Suche, nachdem der Agent die Eingabetaste gedrückt hat", + "SEARCH_ON_ENTER_KEY": "Suche mit Eingabetaste starten", "INTERACTIONS_RELOAD_TIMEOUT": "Zeitintervall in Sekunden, nach dem Interaktionen neu geladen werden (0 = Echtzeitaktualisierung)", "PRIVACY_POLICY": "Anzahl der Zeichen, die durch ein Sternchen (*) ersetzt werden (0 = alle Zeichen)", - "CLIENT_SECRET": "Das Geheimnis ist nach dem Speichern der Konfiguration nicht mehr sichtbar. Bewahren Sie es sicher auf, wenn Sie es woanders verwenden möchten.", - "LIMIT_TABS": "Maximale Anzahl möglicher geöffneter Interaktionsregisterkarten", + "CLIENT_SECRET": "Das Geheimnis ist nach dem Speichern der Konfiguration nicht mehr sichtbar. Bewahren Sie es sicher auf, wenn Sie es anderweitig verwenden möchten.", + "LIMIT_TABS": "Maximale Anzahl möglicher Interaktions-Tabs geöffnet", "PREVIEW_RECALLME_REMINDER_INTERVAL": "Zeitintervall in Minuten, vor dem eine Benachrichtigung an den Agenten gesendet wird, die ihn über den durchzuführenden Vorschaurückruf informiert" }, "ERRORS": { - "ADDRESS_REQUIRED": "Die Adresse ist erforderlich", - "MIN_INTERNAL_REQUIRED": "Die minimale interne ist erforderlich", - "MIN_MAILBOX_REQUIRED": "Die Mailbox ist erforderlich", - "NAME_REQUIRED": "Der Name ist erforderlich", - "HEADER_WHITELABEL_REQUIRED": "Die whitelabel ist erforderlich", - "LOCALNETADDRESS_REQUIRED": "Localnet Adresse erforderlich", - "LOCALNETADDRESS_MUST_VALID_PATTERN": "Localnet gültig sein muss eine gültige Muster", - "ADDRESS_MUST_VALID_PATTERN": "Adresse muss eine gültige Muster sein", - "ACCOUNTNAME_REQUIRED": "Das Konto Name ist erforderlich", - "SMTP_USERNAME_REQUIRED": "Der Benutzername ist erforderlich", - "PASSWORD_REQUIRED": "Das Kennwort ist erforderlich", - "SMTP_HOST_REQUIRED": "Der Host wird benötigt", - "SMTP_PORT_REQUIRED": "Der Port ist erforderlich", - "MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Min-internen muss größer als oder gleich", - "MIN_MAILBOX_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Min-Mailbox muss größer als oder gleich", - "PAGE_TITLE_REQUIRED": "Pflichtfeld", - "EMAIL_REQUIRED": "Pflichtfeld", - "PLAN_REQUIRED": "Pflichtfeld", - "MOTIONBARAUTOUPDATERURL_MUST_VALID_URL": "Falsches Format", - "MOTIONBARAUTOUPDATERURL_REQUIRED": "Pflichtfeld", - "EMAIL_MUST_VALID": "Falsches Format", - "LICENSE_REQUIRED": "Pflichtfeld", - "CHATTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "CHATTIMEOUT_REQUIRED": "Pflichtfeld", - "ALLOWEDLOGINATTEMPTS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "ALLOWEDLOGINATTEMPTS_REQUIRED": "Pflichtfeld", - "BLOCKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "BLOCKDURATION_REQUIRED": "Pflichtfeld", - "LOGINMAILFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "LOGINMAILFREQUENCY_REQUIRED": "Pflichtfeld", - "USERNAME_REQUIRED": "Pflichtfeld", - "ACCESSKEY_REQUIRED": "Pflichtfeld", - "BUCKET_REQUIRED": "Pflichtfeld", - "LANGUAGE_REQUIRED": "Pflichtfeld", - "SECRETACCESSKEY_REQUIRED": "Pflichtfeld", - "SENTIMENTACCOUNT_REQUIRED": "Pflichtfeld", - "SENTIMENTREGION_REQUIRED": "Pflichtfeld", - "SERVICE_REQUIRED": "Pflichtfeld", - "TRANSCRIBEACCOUNT_REQUIRED": "Pflichtfeld", - "TRANSCRIBEREGION_REQUIRED": "Pflichtfeld", + "ADDRESS_REQUIRED": "Adresse erforderlich", + "MIN_INTERNAL_REQUIRED": "Minimale interne Nummer erforderlich", + "MIN_MAILBOX_REQUIRED": "Mailbox erforderlich", + "NAME_REQUIRED": "Name erforderlich", + "HEADER_WHITELABEL_REQUIRED": "WhiteLabel erforderlich", + "LOCALNETADDRESS_REQUIRED": "Localnet-Adresse erforderlich", + "LOCALNETADDRESS_MUST_VALID_PATTERN": "Ungültiges Format Adresse", + "ADDRESS_MUST_VALID_PATTERN": "Adresse muss einem gültigen Muster entsprechen", + "ACCOUNTNAME_REQUIRED": "Kontoname erforderlich", + "SMTP_USERNAME_REQUIRED": "Nutzername erforderlich", + "PASSWORD_REQUIRED": "Passwort erforderlich", + "SMTP_HOST_REQUIRED": "Host erforderlich", + "SMTP_PORT_REQUIRED": "Port erforderlich", + "MIN_INTERNAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Min interne Nummer muss größer oder gleich sein als", + "MIN_MAILBOX_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Min Mailbox-Nummer muss größer oder gleich sein als", + "PAGE_TITLE_REQUIRED": "Titel erforderlich", + "EMAIL_REQUIRED": "E-Mail erforderlich", + "PLAN_REQUIRED": "Plan erforderlich", + "MOTIONBARAUTOUPDATERURL_MUST_VALID_URL": "Ungültiges Format URL", + "MOTIONBARAUTOUPDATERURL_REQUIRED": "URL erforderlich", + "EMAIL_MUST_VALID": "Ungültiges Format E-Mail", + "LICENSE_REQUIRED": "Lizenz erforderlich", + "CHATTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", + "CHATTIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", + "ALLOWEDLOGINATTEMPTS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Erlaubte Anmeldeversuche müssen größer oder gleich sein als", + "ALLOWEDLOGINATTEMPTS_REQUIRED": "erlaubte Anmeldeversuche erforderlich", + "BLOCKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Sperrdauer muss größer oder gleich sein als", + "BLOCKDURATION_REQUIRED": "Sperrdauer erforderlich", + "LOGINMAILFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Abfrageintervall muss größer oder gleich sein als", + "LOGINMAILFREQUENCY_REQUIRED": "Abfrageintervall erforderlich", + "USERNAME_REQUIRED": "Nutzername erforderlich", + "ACCESSKEY_REQUIRED": "Zugangsschlüssel erforderlich", + "BUCKET_REQUIRED": "Behälter erforderlich", + "LANGUAGE_REQUIRED": "Sprache erforderlich", + "SECRETACCESSKEY_REQUIRED": "Geheimer Zugangsschlüssel erforderlich", + "SENTIMENTACCOUNT_REQUIRED": "Konto für Sentiment-Analyse erforderlich", + "SENTIMENTREGION_REQUIRED": "Region für Sentiment-Analyse erforderlich", + "SERVICE_REQUIRED": "Dienst erforderlich", + "TRANSCRIBEACCOUNT_REQUIRED": "Konto für Transkription erforderlich", + "TRANSCRIBEREGION_REQUIRED": "Region für Transkription erforderlich", "FIELD_REQUIRED": "Pflichtfeld", + "PREVIEW_RECALLME_REMINDER_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", "PREVIEW_RECALLME_REMINDER_INTERVAL_REQUIRED": "Pflichtfeld", - "WRONG_FORMAT": "Falsches Format", - "PREVIEW_RECALLME_REMINDER_INTERVAL_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein" + "WRONG_FORMAT": "Falsches Format" }, "EDIT_NETWORK": "Netzwerk bearbeiten", "DELETE_NETWORK": "Netzwerk löschen", "BACK": "Zurück", - "SELECTED": "Ausgewählte", - "SELECT_ALL": "Alle auswählen", - "SELECT_NONE": "Wählen Sie \"Keine\"", + "SELECTED": "Ausgewählt", + "SELECT_ALL": "Alles auswählen", + "SELECT_NONE": "Nichts auswählen", "EXPIRATION_DATE": "Ablaufdatum", "REQUEST_LICENSE": "Lizenz anfordern", "EMAIL": "E-Mail", "SEND": "Senden", "PLAN": "Plan", - "MONTH_TO_MONTH": "Von Monat zu Monat", + "MONTH_TO_MONTH": "Monatlich", "MOTION_PROCESS_MANAGEMENT": "Motion Process Management", "USEFUL_COMMANDS": "Nützliche Befehle", - "COMMAND": "Befehl", + "COMMAND": "Eingabe", "PM2_LIST": "Eine Liste aller Prozesse", - "PM2_START": "Starten eines Prozesses durch ID oder Name", - "PM2_STOP": "Stoppen Sie einen Prozess-ID oder Name, fügen Sie \"Alle\", um alle aktiven Prozesse", - "PM2_RESTART": "Starten Sie einen Prozess, durch ID oder Name", - "PM2_LOGS": "Alle Protokolle Stream Datei, oder spezifische eines Prozess-ID oder Name", + "PM2_START": "Starten eines Prozesses durch ID oder Namen", + "PM2_STOP": "Stoppen Sie einen Prozess durch ID oder Namen", + "PM2_RESTART": "Starten Sie einen Prozess erneut durch ID oder Name", + "PM2_LOGS": "Alle Protokolle Stream Datei", "PASSWORD": "Passwort", - "NO_AVAILABLE_INFO": "Keine verfügbaren Info", - "STUNADDR": "Die STUN-Adresse", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", + "STUNADDR": "STUN-Adresse", "CHANGELOG": "Changelog", "CURRENT_VERSION": "Aktuelle Version", - "CUSTOMIZATIONS": "Anpassungen", - "LOCALNETADDRESS": "Localnet Adresse", + "CUSTOMIZATIONS": "WhiteLabel", + "LOCALNETADDRESS": "Localnet-Adresse", "NEW_VERSION": "Neue Version", "TRIAL_VERSION": "Testversion", "TOKEN": "Token", - "NEW_TOKEN_DETECTED": "Neue Token erkannt", - "EXPIRATION_GRAY_PERIOD": "Grau Zeitraum Ablauf", - "NEW_TOKEN": "Neue Token", + "NEW_TOKEN_DETECTED": "Neuen Token erkannt", + "EXPIRATION_GRAY_PERIOD": "Ablauf Testzeitraum", + "NEW_TOKEN": "Neuer Token", "PRICES": "Preise", "UPDATE_LICENSE": "Lizenz aktualisieren", "LOGOLOGIN": "Login Logo", - "EXPIRATION_REASON": "Ablauf Grund", + "EXPIRATION_REASON": "Ablaufgrund", "GLOBAL": "Global", "SMTP_AUTHENTICATION": "Authentifizierung", - "LICENSE_REQUEST_SENT": "Vielen Dank! Die Lizenzierung Team wird Sie in Ihrem Konto so schnell wie möglich um Ihre Wünsche zu genehmigen: erhalten Sie eine e-Mail, wenn die Änderungen wirksam werden. Lesen Sie bitte für weitere Informationen an License@xcally.com.", - "ACCOUNTNAME": "Konto Name", - "EMAILADDRESS": "E-mail Adresse", - "OLD_TOKEN": "Alte Token", + "LICENSE_REQUEST_SENT": "Vielen Dank! Bitte treten Sie mit unserem Kundensupport in Kontakt", + "ACCOUNTNAME": "Kontoname", + "EMAILADDRESS": "E-Mail Adresse", + "OLD_TOKEN": "Alter Token", "SEND_EMAIL_TO": "E-Mail senden an", - "JIRA_ERROR_MESSAGE": "Fehler während der Lizenz anfordern. Bitte kontaktieren Sie unser Team bei License@xcally.com mit Ihrer Anfrage", + "JIRA_ERROR_MESSAGE": "Fehler bei Lizenzanfrage. Bitte wenden Sie sich an unseren Support", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "Von", + "OF": "von", "SMTP_SSL": "SMTP-SSL", "ENABLED": "Aktiviert", "DISABLED": "Deaktiviert", "UNLIMITED_CHANNELS": "Unbegrenzte Anzahl von Kanälen", - "PAGE_TITLE": "Titel der Seite", - "DEFAULT_PAGE_TITLE": "Standard Seitentitel", - "CALLYSQUARE": "Cally Square", - "DEFAULT_HEADER_WHITELABEL": "White Label Standardfußzeile", - "HEADER_WHITELABEL": "White Label Fußzeile", - "EXPIRATION_REASON_MESSAGE_CHANGED": "Ihre Maschine eindeutige Id wurde aufgrund einer Änderung an Ihrem System aktualisiert. Kontakt xCALLY Motion Support Team Ihre alte und Ihre neue uuid zu senden.", - "CALL_RECORDING_ENCRYPTION": "Sprachaufnahme-Verschlüsselung", - "TURNADDR": "Adresse", - "TURN_USERNAME": "TURN Benutzername", + "PAGE_TITLE": "Seitentitel", + "DEFAULT_PAGE_TITLE": "Standard-Seitentitel", + "CALLYSQUARE": "CallySquare", + "DEFAULT_HEADER_WHITELABEL": "WhiteLabel Standardfußzeile", + "HEADER_WHITELABEL": "WhiteLabel Fußzeile", + "EXPIRATION_REASON_MESSAGE_CHANGED": "Die eindeutige ID Ihres Servers wurde aufgrund von Anpassungen geändert. Bitte wenden Sie sich an unseren Support", + "CALL_RECORDING_ENCRYPTION": "Verschlüsselung der Gesprächsaufzeichnungen", + "TURNADDR": "TURN-Adresse", + "TURN_USERNAME": "TURN-Nutzername", "TURN_PASSWORD": "Passwort ändern", - "PERPETUAL": "Unaufhörlich", + "PERPETUAL": "Einmalige Lizenz", "SECURITY_SUITE": "Sicherheitssuite", "ANNUALLY": "Jährlich", - "MOTIONBARAUTOUPDATER": "Automatischer Updater", - "MOTIONBARAUTOUPDATERURL": "Automatische Updater-URL", - "JAWS": "Jaws", + "MOTIONBARAUTOUPDATER": "Automatische Updates PhoneBar", + "MOTIONBARAUTOUPDATERURL": "URL automatische Updated PhoneBar", + "JAWS": "Jaws-Unterstützung für Sehbehinderte", "ENABLEEMAILPREVIEW": "E-Mail-Vorschau aktivieren", "REPORT": "Bericht", "SPLIT": "Bericht teilen", - "SPLITSIZECSV": "Berichtgröße teilen [CSV-Datensätze]", - "SPLITSIZEPDF": "Split-Berichtsgröße [PDF-Datensätze]", - "SPLITSIZEXLSX": "Split-Berichtsgröße [XLSX-Datensätze]", - "AGENTOMNIDESKTOPINTERFACE": "Agent Omni Desktopschnittstelle", - "MESSAGESALIGNMENT": "Nachrichtenausrichtung", - "ENTER_LICENSE": "Geben Sie Ihre Lizenz ein", - "EXPIRATION_CHANGED_ADVISE": "Wenden Sie sich an das xCALLY Motion License Team und senden Sie Ihre alte und Ihre neue Uuid.", - "EXPIRATION_REASON_MESSAGE_DISABLED": "Ihre Lizenz wurde deaktiviert.", + "SPLITSIZECSV": "Aufteilung Bericht [CSV-Datensätze]", + "SPLITSIZEPDF": "Aufteilung Bericht [PDF-Datensätze]", + "SPLITSIZEXLSX": "Aufteilung Bericht [XLSX-Datensätze]", + "AGENTOMNIDESKTOPINTERFACE": "Agenten-Webinterface", + "MESSAGESALIGNMENT": "Ausrichtung der Nachrichten", + "ENTER_LICENSE": "Lizenz eingeben", + "EXPIRATION_CHANGED_ADVISE": "Bitte halten Sie bei Supportanfragen Ihren Lizenz-Token bereit", + "EXPIRATION_REASON_MESSAGE_DISABLED": "Lizenz deaktiviert", "UPDATE_LICENSE_MANUALLY": "Möchten Sie Ihre Lizenz manuell aktualisieren?", - "ADDONS": "Add-Ons", + "ADDONS": "AddOns", "SESSIONS": "Sitzungen", - "VIRTUAL": "Plaudern", - "VOICE": "Stimme", - "CHATTIMEOUT": "Chat schließt Interaktionszeitlimit", - "MOTIONBARREMEMBERME": "Erinnere dich an mich", + "VIRTUAL": "Chat", + "VOICE": "Voice", + "CHATTIMEOUT": "Zeitüberschreitung Chat schließen", + "MOTIONBARREMEMBERME": "Anmeldedaten in PhoneBar speichern", "RTLSUPPORT": "RTL-Unterstützung", - "DEFAULTSCREENRECORDINGPATH": "Bildschirmaufzeichnungspfad", - "SCREENRECORDING": "Bildschirmaufnahme", + "DEFAULTSCREENRECORDINGPATH": "Pfad für Bildschirmaufzeichnung", + "SCREENRECORDING": "Bildschirmaufzeichnung", "VIDEO": "Video", - "BLOCKDURATION": "Minuten vor dem automatischen Entsperren warten", + "BLOCKDURATION": "Dauer (Min) der Sperrung nach fehlgeschlagener Anmeldung", "SECURITY": "Sicherheit", - "ALLOWEDLOGINATTEMPTS": "Zulässige Anmeldeversuche vor dem Sperren des Benutzers / Agenten", + "ALLOWEDLOGINATTEMPTS": "Max. fehlgeschlagene Anmeldeversuche bis Sperrung", "DEFAULT_FAVICON": "Standard-Favicon", "FAVICON": "Favicon", "IMAPGENERALSETTINGS": "IMAP", - "LOGINMAILFREQUENCY": "Anmelde-Mail-Häufigkeit (Sek.)", + "LOGINMAILFREQUENCY": "Anmeldefrequenz E-Mail (Sek.)", "USERNAME": "Nutzername", "GOOGLE_SSO_ENABLED": "Google SSO aktiviert", "SSO": "SSO", "ACCESSKEY": "Zugriffsschlüssel-ID", - "ADD_CLOUDPROVIDER": "Konto hinzufügen", + "ADD_CLOUDPROVIDER": "Cloud-Anbieter hinzufügen", "AI": "A.I. Werkzeuge", "AITOOLS": "A.I. Werkzeuge", - "APPZONE": "App Zone", - "BUCKET": "Eimer", + "APPZONE": "App-Zone", + "BUCKET": "Behälter", "DELETE": "Löschen", "DELETE_CLOUDPROVIDER": "Konto löschen", "EDIT_CLOUDPROVIDER": "Konto bearbeiten", "LANGUAGE": "Sprache", - "NEW_CLOUDPROVIDER": "Neues Konto", + "NEW_CLOUDPROVIDER": "Neuer Cloud-Anbieter", "SECRETACCESSKEY": "Geheimer Zugangsschlüssel", - "SENTIMENTACCOUNT": "Sentiment Analysis Account", - "SENTIMENTANALYSIS": "Stimmungsanalyse", - "SENTIMENTREGION": "Sentiment Analysis Region", - "SERVICE": "Bedienung", - "TRANSCRIBE": "Transkribieren", - "TRANSCRIBEACCOUNT": "Konto transkribieren", - "TRANSCRIBEREGION": "Region transkribieren", - "WHATSAPP": "WhatsApp Connector", + "SENTIMENTACCOUNT": "Konto Sentiment-Analyse", + "SENTIMENTANALYSIS": "Sentiment-Analyse", + "SENTIMENTREGION": "Region Sentiment-Analyse", + "SERVICE": "Dienst", + "TRANSCRIBE": "Transkription", + "TRANSCRIBEACCOUNT": "Konto Transkription", + "TRANSCRIBEREGION": "Region Transkription", + "WHATSAPP": "WhatsApp", "ENFORCE_PASSWORD_HISTORY": "Kennwortverlauf erzwingen", "PASSWORD_HISTORY_LIMIT": "Kennwortverlaufslimit", - "SEARCH_ON_ENTER_KEY": "Suchen Sie mit der Eingabetaste", + "SEARCH_ON_ENTER_KEY": "Suche mit Eingabetaste starten", "CHAT_INTERACTIONS_RELOAD_TIMEOUT": "Zeitüberschreitung beim erneuten Laden von Chat-Interaktionen", "MAIL_INTERACTIONS_RELOAD_TIMEOUT": "Zeitlimit für das erneute Laden von E-Mail-Interaktionen", - "OPENCHANNEL_INTERACTIONS_RELOAD_TIMEOUT": "Zeitüberschreitung beim erneuten Laden von Open Channel-Interaktionen", + "OPENCHANNEL_INTERACTIONS_RELOAD_TIMEOUT": "Zeitüberschreitung beim erneuten Laden von offener Kanal-Interaktionen", "SMS_INTERACTIONS_RELOAD_TIMEOUT": "Zeitüberschreitung beim erneuten Laden von SMS-Interaktionen", - "WHATSAPP_INTERACTIONS_RELOAD_TIMEOUT": "WhatsApp Connector-Interaktionen laden das Zeitlimit neu", - "PRIVACY_POLICY_EMAIL": "Datenschutzerklärung für E-Mail-Adressen", - "PRIVACY_POLICY_NAME": "Datenschutzerklärung für Namen", - "PRIVACY_POLICY_NUMBER": "Datenschutzerklärung für Nummern", - "STOP_RECORDING_ON_VOICE_CALL_TRANSFER": "Beenden Sie die Aufzeichnung bei Sprachanrufweiterleitung", + "WHATSAPP_INTERACTIONS_RELOAD_TIMEOUT": "Zeitüberschreitung beim erneuten Laden von WhatsApp-Interaktionen", + "PRIVACY_POLICY_EMAIL": "Maskierung E-Mail Adressen", + "PRIVACY_POLICY_NAME": "Maskierung Namen", + "PRIVACY_POLICY_NUMBER": "Maskierung Nummern", + "STOP_RECORDING_ON_VOICE_CALL_TRANSFER": "Aufzeichnung bei Transfer beenden", "AD_SSO_ENABLED": "Active Directory SSO aktiviert", "APPLICATION_ID": "Anwendungs-ID", "AUTHENTICATE": "Authentifizieren", @@ -276,20 +276,20 @@ "CLIENT_SECRET": "Client-Geheimnis", "CLIPBOARD": "Zwischenablage", "CLOUD_PROVIDERS": "Cloud-Anbieter", - "COPIED_TO_CLIPBOARD": "Token in Zwischenablage kopiert", + "COPIED_TO_CLIPBOARD": "Token in die Zwischenablage kopiert", "COPY_LICENSE": "Token in die Zwischenablage kopieren", "DISABLED_COOKIE": "Cookies-Banner", - "DOWNLOAD_LICENSE_LOG_FILE": "Lizenzprotokolldatei herunterladen", + "DOWNLOAD_LICENSE_LOG_FILE": "Laden Sie die Lizenzprotokolldatei herunter", "LICENSE_LOG_FILE": "Lizenzprotokolldatei", "LICENSE_LOG_FILE_DOWNLOADED": "Lizenzprotokolldatei heruntergeladen!", - "LIMIT_TABS": "Registerkarte \"Interaktionsbeschränkung\"", + "LIMIT_TABS": "Registerkarte Interaktionslimit", "MICROSOFT_AUTHENTICATION_FAIL": "Bei der Authentifizierung bei der Microsoft Identity Platform ist ein Fehler aufgetreten", - "MICROSOFT_AUTHENTICATION_SUCCESS": "Authentifizierung bei der Microsoft Identity Platform erfolgreich abgeschlossen", + "MICROSOFT_AUTHENTICATION_SUCCESS": "Die Authentifizierung bei der Microsoft Identity Platform wurde erfolgreich abgeschlossen", "NEW_CLIENT_SECRET": "Neues Client-Geheimnis", - "PREVIEW_RECALLME_REMINDER_INTERVAL": "Vorschau Intervall für Recallme-Erinnerung", - "REDIRECT_URI": "Weiterleitungs-URI", + "PREVIEW_RECALLME_REMINDER_INTERVAL": "Vorschau des Recallme-Erinnerungsintervalls", + "REDIRECT_URI": "Umleitungs-URI", "REMOTE_URI": "Remote-URI", - "TENANT_ID": "Mandanten-ID", - "UPDATE_CLIENT_SECRET": "Client-Geheimnis aktualisieren" + "TENANT_ID": "Mieter-ID", + "UPDATE_CLIENT_SECRET": "Client-Secret aktualisieren" } } diff --git a/public/app/main/apps/sms/i18n/bs.json b/public/app/main/apps/sms/i18n/bs.json index 9f9a57b..c904bfc 100644 --- a/public/app/main/apps/sms/i18n/bs.json +++ b/public/app/main/apps/sms/i18n/bs.json @@ -1,297 +1,297 @@ { "SMS": { - "EDIT_DIALOGFLOWV2": "Edit Dialogflow V2", + "EDIT_DIALOGFLOWV2": "Uredi Dialogflow V2", "DIALOGFLOWV2": "Dialogflow V2", - "PRIVATEKEY": "Private Key", - "CLIENTEMAIL": "Client Email", - "PROJECTID": "Project ID", - "AMAZONLEX": "AmazonLex", - "EDIT_AMAZONLEX": "Edit Lex configuration", - "ACCESSKEYID": "Access key ID", - "SECRETACCESSKEY": "Access key secret", + "PRIVATEKEY": "Privatni Ključ", + "CLIENTEMAIL": "E-Mail Klijenta", + "PROJECTID": "Projekat ID", + "AMAZONLEX": "Amazon Lex", + "EDIT_AMAZONLEX": "Uredi Amazon Lex", + "ACCESSKEYID": "Pristupni Ključ ID", + "SECRETACCESSKEY": "Tajni Pristupni Ključ", "LEXREGION": "Region", - "BOTNAME": "Bot name", - "WELCOMEMESSAGE": "Welcome message", - "LOGIN_TIME": "Login time", - "PAUSE_TIME": "Pause time", - "DOWNLOAD_INTERACTION": "Download", - "TRANSFER": "Transfer", - "QUEUETRANSFER": "Queue Transfer", - "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", - "AGENTTRANSFER": "Agent Transfer", - "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", + "BOTNAME": "Bot Naziv", + "WELCOMEMESSAGE": "Poruka dobrodoÅ¡lice", + "LOGIN_TIME": "Vrijeme prijave", + "PAUSE_TIME": "Vrijeme pauze", + "DOWNLOAD_INTERACTION": "Skini", + "TRANSFER": "Prijenos", + "QUEUETRANSFER": "Prijenos Queue", + "QUEUETRANSFERTIMEOUT": "Prijenos Queue Timeout", + "AGENTTRANSFER": "Prijenost Specijaliste", + "AGENTTRANSFERTIMEOUT": "Timeout Prijenosa Specijaliste", "TAG": "Tag", - "EDIT_TAG": "Edit Tag", - "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", - "NOTIFICATION": "Notification", - "NOTIFICATIONSOUND": "Sound", - "NOTIFICATIONSHAKE": "Shake", - "NOTIFICATIONTEMPLATE": "Template", - "SYSTEM": "System", - "EDIT_SYSTEM": "Edit System", - "COMMAND": "Command", - "VARIABLE": "Variable", + "EDIT_TAG": "Uredi Tag", + "WAITFORTHEASSIGNEDAGENT": "Pričekaj dodijeljenog Specijalistu", + "NOTIFICATION": "Obavijest", + "NOTIFICATIONSOUND": "Zvuk", + "NOTIFICATIONSHAKE": "Protresi", + "NOTIFICATIONTEMPLATE": "Å ablon", + "SYSTEM": "Sistem", + "EDIT_SYSTEM": "Uredi Sistem", + "COMMAND": "Naredba", + "VARIABLE": "Varijabla", "AUTHID": "Auth ID", - "NO_SMSDISPOSITIONS_AVAILABLE": "No Sms Disposition Available", - "CANNEDANSWERS": "Canned Answers", - "SMSCANNEDANSWERS": "Canned Answers", - "NO_SMSCANNEDANSWER_AVAILABLE": "No Canned Answers Available", - "NEW_SMSCANNEDANSWER": "New Canned Answer", - "ADD_SMSCANNEDANSWER": "Add Canned Answer", - "EDIT_SMSCANNEDANSWER": "Edit", - "DELETE_SMSCANNEDANSWER": "Delete", - "DELIVERYREPORTURL": "Delivery Report URL", - "DELETE": "Delete", - "SENDERSTRING": "Sender String", - "DELIVERYREPORT": "Delivery Report", - "METHOD": "Method", - "ADD_NOTE": "Add note", - "NOTE": "Note", + "NO_SMSDISPOSITIONS_AVAILABLE": "Nema dostupnih SMS dispozicija", + "CANNEDANSWERS": "Pripremljeni Odgovori", + "SMSCANNEDANSWERS": "Pripremljeni Odgovori", + "NO_SMSCANNEDANSWER_AVAILABLE": "Nema dostupnih Pripremljenih Odgovora", + "NEW_SMSCANNEDANSWER": "Novi Pripremljeni Odgovor", + "ADD_SMSCANNEDANSWER": "Dodaj Pripremljeni Odgovor", + "EDIT_SMSCANNEDANSWER": "Uredi", + "DELETE_SMSCANNEDANSWER": "IzbriÅ¡i", + "DELIVERYREPORTURL": "IzvjeÅ¡taj Isporuke URL", + "DELETE": "IzbriÅ¡i", + "SENDERSTRING": "Niz PoÅ¡iljatelja", + "DELIVERYREPORT": "IzvjeÅ¡taj Isporuke", + "METHOD": "Metoda", + "ADD_NOTE": "Dodaj biljeÅ¡ku", + "NOTE": "BiljeÅ¡ka", "SPYINTERACTION": "Spy", - "AUTOREPLY": "Auto Reply", - "EDIT_AUTOREPLY": "Edit Auto Reply", - "TIMES": "Number of times per interaction", - "TEXT": "Text", - "INSERT_MESSAGE_HERE": "Insert your text message here", - "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", - "CANNED_ANSWER_SEARCH": "Enter a text to search a Canned Answer", - "SEND": "Send", - "TO": "To", - "MESSAGE": "Message", - "TAGS": "Tags", - "NO_AGENT_ONLINE": "No Agent Online", - "GOTOREALTIME_SMSQUEUE": "Go To Realtime Sms Queue", - "PARTIALPAUSE": "Parital Pause", - "BUSY": "Busy", + "AUTOREPLY": "Automatski Odgovor", + "EDIT_AUTOREPLY": "Uredi Automatski Odgovor", + "TIMES": "Broj puta po interakciji", + "TEXT": "Tekst", + "INSERT_MESSAGE_HERE": "Ovdje upiÅ¡i svoju tekstualnu poruku", + "CANNED_ANSWER_NOT_FOUND": "Nije pronađen nijedan pripremljeni odgovor", + "CANNED_ANSWER_SEARCH": "Unesite tekst za pretraživanje Pripremljenih Odgovora", + "SEND": "PoÅ¡alji", + "TO": "Za", + "MESSAGE": "Poruka", + "TAGS": "Tagovi", + "NO_AGENT_ONLINE": "Nema Specijalista Online", + "GOTOREALTIME_SMSQUEUE": "Idi na Realtime SMS Queue", + "PARTIALPAUSE": "Djelomična pauza", + "BUSY": "Zauzet", "TIMER": "Timer", "IDLE": "Idle", - "CAPACITY": "Capacity", + "CAPACITY": "Kapacitet", "PROXY": "Proxy", - "ADVANCED": "Advanced", - "MOTIONPROXY": "Proxy Or Motion Domain", + "ADVANCED": "Napredno", + "MOTIONPROXY": "Proxy Or Motion Domena", "REALTIME": "Realtime", - "KEY": "Key", - "NAME": "Name", + "KEY": "Ključ", + "NAME": "Ime", "SMSQUEUES": "SMS Queues", - "SEARCH_FOR_ANYONE": "Search", - "STRATEGY": "Strategy", - "BASEURL": "Base URL", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled", + "SEARCH_FOR_ANYONE": "Traži", + "STRATEGY": "Strategija", + "BASEURL": "Osnovni URL", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Pauza koja se koristi ukoliko je Obavezna dispozicija uključena", "ERRORS": { - "PROJECTID_REQUIRED": "Mandatory Field", - "CLIENTEMAIL_REQUIRED": "Mandatory Field", - "PRIVATEKEY_REQUIRED": "Mandatory Field", - "ACCESSKEYID_REQUIRED": "Access key ID is required", - "SECRETACCESSKEY_REQUIRED": "Access key secret is required", - "BOTNAME_REQUIRED": "Bot name is required", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "TAG_REQUIRED": "Mandatory Field", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less than or equal to", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater than or equal to", - "NAME_MUST_VALID_PATTERN": "Wrong format", - "COMMAND_REQUIRED": "Mandatory Field", - "AUTHID_REQUIRED": "Mandatory Field", - "TEXT_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "TEXT_REQUIRED": "Mandatory Field", - "VALUE_REQUIRED": "Mandatory Field", + "PROJECTID_REQUIRED": "Obavezno polje", + "CLIENTEMAIL_REQUIRED": "Obavezno polje", + "PRIVATEKEY_REQUIRED": "Obavezno polje", + "ACCESSKEYID_REQUIRED": "Pristupni Ključ ID je obavezan", + "SECRETACCESSKEY_REQUIRED": "Tajni Pristupni Ključ je obavezan", + "BOTNAME_REQUIRED": "Bot naziv je obavezan", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Obavezno polje", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Obavezno polje", + "TAG_REQUIRED": "Obavezno polje", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Obavezno polje", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Vrijednost mora biti manja ili jednaka od", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Vrijednost mora biti veća ili jednaka od", + "NAME_MUST_VALID_PATTERN": "PogreÅ¡an format", + "COMMAND_REQUIRED": "Obavezno polje", + "AUTHID_REQUIRED": "Obavezno polje", + "TEXT_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "TEXT_REQUIRED": "Obavezno polje", + "VALUE_REQUIRED": "Obavezno polje", "SENDERSTRING_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "SENDERSTRING_MUST_VALID_PATTERN": "Wrong format", - "METHOD_REQUIRED": "Mandatory Field", - "MOTIONPROXY_REQUIRED": "Mandatory Field", - "MOTIONPROXY_MUST_VALID_URL": "Wrong format", - "KEY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "KEY_REQUIRED": "Mandatory Field", - "NAME_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", - "PHONE_REQUIRED": "Mandatory Field", - "SID_REQUIRED": "Mandatory Field", - "TOKEN_REQUIRED": "Mandatory Field", - "USERNAME_REQUIRED": "Mandatory Field", - "PASSWORD_REQUIRED": "Mandatory Field", - "MOTIONADDRESS_REQUIRED": "Mandatory Field", - "MOTIONADDRESS_MUST_VALID_URL": "Wrong format", - "ACCEPTURL_MUST_VALID_URL": "Wrong format", - "TIMEOUT_REQUIRED": "Mandatory Field", - "REJECTURL_MUST_VALID_URL": "Wrong format", - "CLOSEURL_MUST_VALID_URL": "Wrong format", - "TYPE_REQUIRED": "Mandatory Field", - "LIST_REQUIRED": "Mandatory Field", - "PRIORITY_REQUIRED": "Mandatory Field", - "CONDITION_REQUIRED": "Mandatory Field", - "TRUEPRIORITY_REQUIRED": "Mandatory Field", - "FALSEPRIORITY_REQUIRED": "Mandatory Field", - "AGENT_REQUIRED": "Mandatory Field", - "QUEUE_REQUIRED": "Mandatory Field", - "DISPOSITION_REQUIRED": "Mandatory Field", - "ACCOUNTSID_REQUIRED": "Mandatory Field", - "AUTHTOKEN_REQUIRED": "Mandatory Field", - "BASEURL_REQUIRED": "Mandatory Field", - "APIKEY_REQUIRED": "Mandatory Field", - "APPLICATIONID_REQUIRED": "Mandatory Field", - "ACCOUNTID_REQUIRED": "Mandatory Field", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory field" + "SENDERSTRING_MUST_VALID_PATTERN": "PogreÅ¡an format", + "METHOD_REQUIRED": "Obavezno polje", + "MOTIONPROXY_REQUIRED": "Obavezno polje", + "MOTIONPROXY_MUST_VALID_URL": "PogreÅ¡an format", + "KEY_MAX_LENGTH": "Vrijednost mora imati maksimalnu dužinu jednaku {{max}}", + "KEY_REQUIRED": "Obavezno polje", + "NAME_REQUIRED": "Obavezno polje", + "AGENT_TIMEOUT_REQUIRED": "Obavezno polje", + "PHONE_REQUIRED": "Obavezno polje", + "SID_REQUIRED": "Obavezno polje", + "TOKEN_REQUIRED": "Obavezno polje", + "USERNAME_REQUIRED": "Obavezno polje", + "PASSWORD_REQUIRED": "Obavezno polje", + "MOTIONADDRESS_REQUIRED": "Obavezno polje", + "MOTIONADDRESS_MUST_VALID_URL": "PogreÅ¡an format", + "ACCEPTURL_MUST_VALID_URL": "PogreÅ¡an format", + "TIMEOUT_REQUIRED": "Obavezno polje", + "REJECTURL_MUST_VALID_URL": "PogreÅ¡an format", + "CLOSEURL_MUST_VALID_URL": "PogreÅ¡an format", + "TYPE_REQUIRED": "Obavezno polje", + "LIST_REQUIRED": "Obavezno polje", + "PRIORITY_REQUIRED": "Obavezno polje", + "CONDITION_REQUIRED": "Obavezno polje", + "TRUEPRIORITY_REQUIRED": "Obavezno polje", + "FALSEPRIORITY_REQUIRED": "Obavezno polje", + "AGENT_REQUIRED": "Obavezno polje", + "QUEUE_REQUIRED": "Obavezno polje", + "DISPOSITION_REQUIRED": "Obavezno polje", + "ACCOUNTSID_REQUIRED": "Obavezno polje", + "AUTHTOKEN_REQUIRED": "Obavezno polje", + "BASEURL_REQUIRED": "Obavezno polje", + "APIKEY_REQUIRED": "Obavezno polje", + "APPLICATIONID_REQUIRED": "Obavezno polje", + "ACCOUNTID_REQUIRED": "Obavezno polje", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Obavezno polje" }, - "AGENT_TIMEOUT": "Agent Timeout", - "DESCRIPTION": "Description", - "ADD_SMSQUEUE": "Add SMS Queue", - "EDIT_SMSQUEUE": "Edit SMS Queue", - "DELETE_SMSQUEUE": "Delete SMS Queue", - "SETTINGS": "Settings", - "GENERAL": "General", - "CREATED_AT": "Created At", - "SAVE": "Save", - "SMSACCOUNTS": "SMS Accounts", - "TYPE": "Type", - "PHONE": "Phone", + "AGENT_TIMEOUT": "Timeout Specijaliste", + "DESCRIPTION": "Opis", + "ADD_SMSQUEUE": "Dodaj SMS Queue", + "EDIT_SMSQUEUE": "Uredi SMS Queue", + "DELETE_SMSQUEUE": "IzbriÅ¡i SMS Queue", + "SETTINGS": "Postavke", + "GENERAL": "Općenito", + "CREATED_AT": "Kreirano U", + "SAVE": "Sačuvaj", + "SMSACCOUNTS": "SMS Nalozi", + "TYPE": "Vrsta", + "PHONE": "Telefon", "SID": "SID", "TOKEN": "Token", - "SMSTYPE": "SMS Type", - "USERNAME": "Username", - "PASSWORD": "Password", - "MOTIONADDRESS": "Motion Address", - "ADD_SMSACCOUNT": "Add SMS Account", - "EDIT_SMSACCOUNT": "Edit SMS Account", - "DELETE_SMSACCOUNT": "Delete SMS Account", - "LIST": "List", - "FIDELITY": "Fidelity", + "SMSTYPE": "SMS Vrsta", + "USERNAME": "Korisničko ime", + "PASSWORD": "Lozinka", + "MOTIONADDRESS": "Motion Adresa", + "ADD_SMSACCOUNT": "Dodaj SMS Nalog", + "EDIT_SMSACCOUNT": "Uredi SMS Nalog", + "DELETE_SMSACCOUNT": "IzbriÅ¡i SMS Nalog", + "LIST": "Lista", + "FIDELITY": "Vjernost", "API": "API", - "DISPOSITIONS": "Dispositions", + "DISPOSITIONS": "Dispozicije", "WEBHOOKS": "WebHooks", - "ACTIONS": "Actions", - "ACCEPT": "Accept", - "ACCEPTMETHOD": "Accept Method", - "ACCEPTURL": "Accept URL", - "REJECT": "Reject", - "REJECTMETHOD": "Reject Method", - "REJECTURL": "Reject URL", - "CLOSE": "Close", - "CLOSEMETHOD": "Close Method", - "CLOSEURL": "Close URL", - "SELECTED": "Selected", - "SELECT_ALL": "Select All", - "SELECT_NONE": "Select None", - "BACK": "Back", + "ACTIONS": "Radnje", + "ACCEPT": "Prihvati", + "ACCEPTMETHOD": "Prihvati Metodu", + "ACCEPTURL": "Prihvati URL", + "REJECT": "Odbaci", + "REJECTMETHOD": "Odbaci Metodu", + "REJECTURL": "Odbaci URL", + "CLOSE": "Zatvori", + "CLOSEMETHOD": "Metoda Zatvaranja", + "CLOSEURL": "Zatvori URL", + "SELECTED": "Odabrano", + "SELECT_ALL": "Odabneri Sve", + "SELECT_NONE": "Odaberi NiÅ¡ta", + "BACK": "Nazad", "SMS": "SMS", - "ID": "Id", - "APIKEY": "ApiKey", - "APPLICATIONID": "Application ID", - "ACCOUNTID": "Account ID", - "CONFIRM_PASSWORD": "Confirm Password", - "SMSDISPOSITIONS": "SMS Dispositions", - "NO_SMSDISPOSITION_AVAILABLE": "No SMS Dispositions available", - "NEW_SMSDISPOSITION": "New SMS Disposition", - "ADD_SMSDISPOSITION": "Add SMS Disposition", - "EDIT_SMSDISPOSITION": "Edit SMS Disposition", - "DELETE_SMSDISPOSITION": "Delete SMS Disposition", - "NEW_SMSQUEUE": "New SMS Queue", - "NEW_SMSACCOUNT": "New SMS Account", - "NO_AVAILABLE_INFO": "No available info", - "ALL_TEAMS": "All Teams", - "SELECTED_TEAMS": "Selected Teams", + "ID": "ID", + "APIKEY": "API KLjuč", + "APPLICATIONID": "Aplikacija ID", + "ACCOUNTID": "Nalog ID", + "CONFIRM_PASSWORD": "Potvrdite Lozinku", + "SMSDISPOSITIONS": "SMS Dispozicije", + "NO_SMSDISPOSITION_AVAILABLE": "Nema dostupnih SMS dispozicija", + "NEW_SMSDISPOSITION": "Nova SMS Dispozicija", + "ADD_SMSDISPOSITION": "Dodaj SMS Dispoziciju", + "EDIT_SMSDISPOSITION": "Uredi SMS Dispoziciju", + "DELETE_SMSDISPOSITION": "IzbriÅ¡i SMS Dispoziciju", + "NEW_SMSQUEUE": "Novi SMS Queue", + "NEW_SMSACCOUNT": "Novi SMS Nalog", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "ALL_TEAMS": "Svi Timovi", + "SELECTED_TEAMS": "Odabrani Timovi", "DIALOGFLOW": "DialogFlow", - "EDIT_DIALOGFLOW": "Edit DialogFlow configuration", - "LANGUAGE": "Language", + "EDIT_DIALOGFLOW": "Uredi Dialogflow", + "LANGUAGE": "Jezik", "HELP": { - "WELCOMEMESSAGE": "This is the first response message sent to new interactions", - "MOTIONPROXY": "The field must have the following format: ://[:]. Example: https://X.Y.Z.W", - "NAME": "Only numbers, letters and specific characters (._) are supported", - "LIST": "Contact Manager list used to associate contacts", + "WELCOMEMESSAGE": "Ovo je prva poruka poruka odgovora poslana novim interakcijam", + "MOTIONPROXY": "Polje mora imati sljedeći format: ://[:]. Primjer: https://X.Y.Z.W", + "NAME": "Samo brojevi, slova i specifični znakovi (._) su podržani", + "LIST": "Kontakt Menadžer Lista koja se koristi za povezivanje kontakata", "RECEIVEURL": "This is the auto-generated API string you need to use to receive the messages inside your account from your SMS provider (POST method must be used): click the clipboard button to copy it", - "DELIVERYREPORTURL": "This is the auto-generated API string you need to use to receive the delivery report of sent messages from your SMS provider (POST method must be used): click the clipboard button to copy it", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled" + "DELIVERYREPORTURL": "Ovo je automatski generisani API niz koji trebate koristiti za primanje izvjeÅ¡taja isporuke od tvog SMS provajdera (mora se korisiti POST metoda): klikni na dugme međuspremnika da bi ga kopirao", + "MANDATORYDISPOSITION": "Obavezna dispozicija", + "MANDATORYDISPOSITIONPAUSEID": "Zadana pauza kada je obavezna dispozicija omogućena" }, - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", - "TEAMADD_SMSQUEUE": "Add Team To SMS Queue", - "AGENTADD_SMSQUEUE": "Add Agent To SMS Queue", - "ALL_AGENTS": "All Agents", - "SELECTED_AGENTS": "Selected Agents", - "RECEIVEURL": "Receive URL", - "INTERACTION": "Interaction", - "INTERACTIONS": "Interactions", - "NO_INTERACTION_AVAILABLE": "No interactions available", - "CONTACT": "Contact", - "STARTEDAT": "Started At", - "LASTMESSAGE": "Last message", - "AGENT": "Agent", - "CLOSEDAT": "Closed At", - "DISPOSITION": "Disposition", - "NOTES": "Notes", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", + "TEAMADD_SMSQUEUE": "Dodaj Tim u SMS Queue", + "AGENTADD_SMSQUEUE": "Dodaj Specijalistu u SMS Queue", + "ALL_AGENTS": "Svi Specijalisti", + "SELECTED_AGENTS": "Odabrani Specijalisti", + "RECEIVEURL": "Primi URL", + "INTERACTION": "Interakcija", + "INTERACTIONS": "Interakcije", + "NO_INTERACTION_AVAILABLE": "Nema dostupnih Interakcija", + "CONTACT": "Kontakt", + "STARTEDAT": "Počelo U", + "LASTMESSAGE": "Zadnja poruka", + "AGENT": "Specijalist", + "CLOSEDAT": "Zatvoreno U", + "DISPOSITION": "Dispozicija", + "NOTES": "BiljeÅ¡ke", "GOTO": "Goto", "GOTOIF": "Gotoif", "NOOP": "Noop", "QUEUE": "Queue", "TIMEOUT": "Timeout", - "VALUE": "Value", - "EDIT_AGENT": "Edit Agent", - "EDIT_GOTO": "Edit Goto", - "EDIT_NOOP": "Edit Noop", - "EDIT_GOTOIF": "Edit Gotoif", - "EDIT_QUEUE": "Edit Queue", - "CONDITION": "Condition", - "TRUEPRIORITY": "True Priority", - "FALSEPRIORITY": "False Priority", - "PRIORITY": "Priority", + "VALUE": "Vrijednost", + "EDIT_AGENT": "Uredi Specijalistu", + "EDIT_GOTO": "Uredi Goto", + "EDIT_NOOP": "Uredi Noop", + "EDIT_GOTOIF": "Uredi GotoIf", + "EDIT_QUEUE": "Uredi Queue", + "CONDITION": "Stanje", + "TRUEPRIORITY": "Pravi Prioritet", + "FALSEPRIORITY": "Lažni Prioritet", + "PRIORITY": "Prioritet", "GOTOP": "Gotop", - "EDIT_GOTOP": "Edit Gotop", - "EDIT_CLOSE": "Edit Close", + "EDIT_GOTOP": "Uredi Gotop", + "EDIT_CLOSE": "Uredi Zatvaranje", "FILTER": "Filter", - "SELECT_STATUS": "Select a status", - "ALL": "All", - "SELECT_ACCOUNT": "Select an account", - "OPENED": "Open", - "CLOSED": "Closed", + "SELECT_STATUS": "Odaberi Status", + "ALL": "Svi", + "SELECT_ACCOUNT": "Odaberi Nalog", + "OPENED": "Otvoreno", + "CLOSED": "Zatvoreno", "STATUS": "Status", - "ACCOUNT": "Account", - "OPEN": "Open", + "ACCOUNT": "Nalog", + "OPEN": "Otvori", "INFO": "Info", - "ACCOUNTSID": "Account SID", + "ACCOUNTSID": "Nalog SID", "AUTHTOKEN": "Auth Token", - "UNKNOWN": "Unknown", - "UNREGISTERED": "Unregistered", - "UNAVAILABLE": "Unavailable", - "NOT_INUSE": "Not in use", - "REACHABLE": "Reachable", - "IN_USE": "In use", - "AGENTS": "Agents", + "UNKNOWN": "Nepoznato", + "UNREGISTERED": "Neregistrovan", + "UNAVAILABLE": "Nedostupno", + "NOT_INUSE": "Nije u upotrebi", + "REACHABLE": "Dostupno", + "IN_USE": "U upotrebi", + "AGENTS": "Specijaliste", "QUEUES": "Queues", - "FULLNAME": "Fullname", - "INTERNAL": "Internal", - "PHONE_STATE": "Phone State", - "PHONE_STATUS": "Phone Status", - "PAUSE": "Pause", - "LOGOUT": "Logout", - "AGENTADD_QUEUE": "Add agent to SMS queue", - "UNPAUSE": "End Pause", - "DEFAULT_PAUSE": "Default pause", - "LOGGED_IN": "Logged in", - "PAUSED": "Paused", - "READY": "Ready", - "WAITING": "Waiting", + "FULLNAME": "Puno ime", + "INTERNAL": "Interni", + "PHONE_STATE": "Stanje Telefona", + "PHONE_STATUS": "Status Telefona", + "PAUSE": "Pauza", + "LOGOUT": "Odjava", + "AGENTADD_QUEUE": "Dodaj Specijalistu u SMS Queue", + "UNPAUSE": "ZavrÅ¡i Pauzu", + "DEFAULT_PAUSE": "Zadana pauza", + "LOGGED_IN": "Prijavljen", + "PAUSED": "Pauzirano", + "READY": "Spreman", + "WAITING": "Čeka", "VOICE": "Voice", "CHAT": "Chat", - "MAIL": "Email", - "OPENCHANNEL": "Open channel", + "MAIL": "E-Mail", + "OPENCHANNEL": "Otvoreni Kanal", "FAX": "Fax", - "AGENTSADD_QUEUE": "Add agents to SMS queue", - "INTERACTIONS_SMSACCOUNT": "Go to Interactions", - "REFRESH_INTERACTIONS": "Refresh Interactions", - "DELETE_INTERACTION": "Delete Interaction", - "AGENTADD_SMSACCOUNT": "Add Agent to SMS Account", - "TEAMS_ASSOCIATION": "Teams Association", - "DOWNLOAD_WITH_ATTACHMENT": "Download with attachment", - "DOWNLOAD_WITHOUT_ATTACHMENT": "Download without attachment" + "AGENTSADD_QUEUE": "Dodaj Specijalistu u SMS Queue", + "INTERACTIONS_SMSACCOUNT": "Idi na Interakcije", + "REFRESH_INTERACTIONS": "Osvježi Interakcije", + "DELETE_INTERACTION": "IzbriÅ¡i Interakciju", + "AGENTADD_SMSACCOUNT": "Dodaj Specijalistu u SMS Nalog", + "TEAMS_ASSOCIATION": "Asocijacija Timova", + "DOWNLOAD_WITH_ATTACHMENT": "Preuzmi sa prilogom", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Preuzmi bez priloga" } } diff --git a/public/app/main/apps/sms/i18n/de.json b/public/app/main/apps/sms/i18n/de.json index cddbe68..6802f2f 100644 --- a/public/app/main/apps/sms/i18n/de.json +++ b/public/app/main/apps/sms/i18n/de.json @@ -3,76 +3,76 @@ "KEY": "Schlüssel", "NAME": "Name", "SMSQUEUES": "SMS-Warteschlangen", - "SEARCH_FOR_ANYONE": "Suche für Jedermann", - "STRATEGY": "Strategie", + "SEARCH_FOR_ANYONE": "Suche", + "STRATEGY": "Verteilungsstrategie", "ERRORS": { - "KEY_MAX_LENGTH": "Schlüssel muss eine maximale Länge von {{max}}", - "KEY_REQUIRED": "Schlüssel ist erforderlich", - "NAME_REQUIRED": "Der Name ist erforderlich", - "AGENT_TIMEOUT_REQUIRED": "Der Agent Timeout ist erforderlich", - "PHONE_REQUIRED": "Die Telefonnummer ist erforderlich", - "SID_REQUIRED": "Die SID ist erforderlich", - "TOKEN_REQUIRED": "Das Token ist erforderlich", - "USERNAME_REQUIRED": "Der Benutzername ist erforderlich", - "PASSWORD_REQUIRED": "Das Kennwort ist erforderlich", - "MOTIONADDRESS_REQUIRED": "Die Adresse ist erforderlich", - "MOTIONADDRESS_MUST_VALID_URL": "Die Adresse muss in einem gültigen Format", - "ACCEPTURL_MUST_VALID_URL": "Die URL muss in einem gültigen Format", - "TIMEOUT_REQUIRED": "Der Timeout ist erforderlich", - "REJECTURL_MUST_VALID_URL": "Die URL muss in einem gültigen Format", - "CLOSEURL_MUST_VALID_URL": "Die URL muss in einem gültigen Format", - "TYPE_REQUIRED": "Der Typ ist erforderlich", - "LIST_REQUIRED": "Die Liste ist erforderlich", - "PRIORITY_REQUIRED": "Die Priorität ist erforderlich", - "CONDITION_REQUIRED": "Der Zustand ist erforderlich", - "TRUEPRIORITY_REQUIRED": "Die wahre Priorität ist erforderlich", - "FALSEPRIORITY_REQUIRED": "Die falsche Priorität ist erforderlich", - "AGENT_REQUIRED": "Der Agent ist erforderlich", - "QUEUE_REQUIRED": "Die Warteschlange ist erforderlich", - "DISPOSITION_REQUIRED": "Die Disposition ist erforderlich", - "ACCOUNTSID_REQUIRED": "Konto SID ist erforderlich", - "AUTHTOKEN_REQUIRED": "Auth Token ist erforderlich", - "MOTIONPROXY_REQUIRED": "Pflichtfeld", - "MOTIONPROXY_MUST_VALID_URL": "Falsches Format", - "TEXT_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", - "TEXT_REQUIRED": "Pflichtfeld", - "VALUE_REQUIRED": "Pflichtfeld", - "SENDERSTRING_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", - "SENDERSTRING_MUST_VALID_PATTERN": "Falsches Format", - "METHOD_REQUIRED": "Pflichtfeld", - "AUTHID_REQUIRED": "Pflichtfeld", - "COMMAND_REQUIRED": "Pflichtfeld", - "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "NAME_MUST_VALID_PATTERN": "Falsches Format", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Pflichtfeld", - "TAG_REQUIRED": "Pflichtfeld", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", - "APIKEY_REQUIRED": "Pflichtfeld", - "BASEURL_REQUIRED": "Pflichtfeld", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pflichtfeld", - "ACCESSKEYID_REQUIRED": "Die Zugangsschlüssel-ID ist erforderlich", - "BOTNAME_REQUIRED": "Bot Name ist erforderlich", - "SECRETACCESSKEY_REQUIRED": "Zugriffsschlüsselgeheimnis ist erforderlich", - "CLIENTEMAIL_REQUIRED": "Pflichtfeld", - "PRIVATEKEY_REQUIRED": "Pflichtfeld", - "PROJECTID_REQUIRED": "Pflichtfeld", - "ACCOUNTID_REQUIRED": "Pflichtfeld", - "APPLICATIONID_REQUIRED": "Pflichtfeld" + "KEY_MAX_LENGTH": "Schlüssel darf eine maximale Länge von {{max}} haben", + "KEY_REQUIRED": "Schlüssel erforderlich", + "NAME_REQUIRED": "Name erforderlich", + "AGENT_TIMEOUT_REQUIRED": "Zeitüberschreitung Agent erforderlich", + "PHONE_REQUIRED": "Telefonnummer erforderlich", + "SID_REQUIRED": "SID erforderlich", + "TOKEN_REQUIRED": "Token erforderlich", + "USERNAME_REQUIRED": "Nutzername erforderlich", + "PASSWORD_REQUIRED": "Passwort erforderlich", + "MOTIONADDRESS_REQUIRED": "Adresse erforderlich", + "MOTIONADDRESS_MUST_VALID_URL": "Ungültiges Format URL", + "ACCEPTURL_MUST_VALID_URL": "Ungültiges Format URL", + "TIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", + "REJECTURL_MUST_VALID_URL": "Ungültiges Format URL", + "CLOSEURL_MUST_VALID_URL": "Ungültiges Format URL", + "TYPE_REQUIRED": "Typ erforderlich", + "LIST_REQUIRED": "Liste erforderlich", + "PRIORITY_REQUIRED": "Priorität erforderlich", + "CONDITION_REQUIRED": "Bedingung erforderlich", + "TRUEPRIORITY_REQUIRED": "Priorität bei 'wahr' erforderlich", + "FALSEPRIORITY_REQUIRED": "Priorität bei 'falsch' erforderlich", + "AGENT_REQUIRED": "Agent erforderlich", + "QUEUE_REQUIRED": "Warteschlange erforderlich", + "DISPOSITION_REQUIRED": "Qualifizierung erforderlich", + "ACCOUNTSID_REQUIRED": "Konto-ID erforderlich", + "AUTHTOKEN_REQUIRED": "Auth-Token erforderlich", + "MOTIONPROXY_REQUIRED": "Proxy oder URL erforderlich", + "MOTIONPROXY_MUST_VALID_URL": "Ungültiges Formar URL", + "TEXT_MAX_LENGTH": "Text darf eine maximale Länge von {{max}} haben", + "TEXT_REQUIRED": "Text erforderlich", + "VALUE_REQUIRED": "Wert erforderlich", + "SENDERSTRING_MAX_LENGTH": "Wert darf eine maximale Länge von {{max}} haben", + "SENDERSTRING_MUST_VALID_PATTERN": "Format ungültig", + "METHOD_REQUIRED": "Methode erforderlich", + "AUTHID_REQUIRED": "Auth-ID erforderlich", + "COMMAND_REQUIRED": "Eingabe erforderlich", + "AGENT_TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent muss größer oder gleich sein als", + "NAME_MUST_VALID_PATTERN": "Ungültiges Format Name", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss kleiner oder gleich sein als", + "AGENT_TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agent muss kleiner oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Warten auf zugew. Agenten muss größer oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Warten auf zugew. Agenten muss kleiner oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Warten auf zugew. Agenten erforderlich", + "TAG_REQUIRED": "Tag erforderlich", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agententransfer muss größer oder gleich sein als", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agententransfer muss kleiner oder gleich sein als", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Agententransfer erforderlich", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Warteschlangentransfer muss größer oder gleich sein als", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Warteschlangentransfer muss kleiner oder gleich sein als", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Warteschlangentransfer erforderlich", + "APIKEY_REQUIRED": "API-Schlüssel erforderlich", + "BASEURL_REQUIRED": "Base-URL erforderlich", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Agentenstatus während Qualifizierung erforderlich", + "ACCESSKEYID_REQUIRED": "Zugangsschlüssel-ID erforderlich", + "BOTNAME_REQUIRED": "BOT-Name erforderlich", + "SECRETACCESSKEY_REQUIRED": "Zugriffsschlüsselgeheimnis erforderlich", + "CLIENTEMAIL_REQUIRED": "Kunden E-Mail erforderlich", + "PRIVATEKEY_REQUIRED": "Privater Schlüssel erforderlich", + "PROJECTID_REQUIRED": "Projekt-ID erforderlich", + "ACCOUNTID_REQUIRED": "Konto-ID erforderlich", + "APPLICATIONID_REQUIRED": "Anwendungs-ID erforderlich" }, - "AGENT_TIMEOUT": "Agent Timeout", + "AGENT_TIMEOUT": "Zeitüberschreitung Agent", "DESCRIPTION": "Beschreibung", - "ADD_SMSQUEUE": "SMS-Warteschlange hinzufügen", - "EDIT_SMSQUEUE": "SMS-Warteschlange bearbeiten", - "DELETE_SMSQUEUE": "SMS-Warteschlange löschen", + "ADD_SMSQUEUE": "Warteschlange hinzufügen", + "EDIT_SMSQUEUE": "Warteschlange bearbeiten", + "DELETE_SMSQUEUE": "Warteschlange löschen", "SETTINGS": "Einstellungen", "GENERAL": "Allgemein", "CREATED_AT": "Erstellt am", @@ -83,7 +83,7 @@ "SID": "SID", "TOKEN": "Token", "SMSTYPE": "SMS-Typ", - "USERNAME": "Benutzername", + "USERNAME": "Nutzername", "PASSWORD": "Passwort", "MOTIONADDRESS": "Motion Adresse", "ADD_SMSACCOUNT": "SMS-Konto hinzufügen", @@ -92,204 +92,204 @@ "LIST": "Liste", "FIDELITY": "Treue", "API": "API", - "DISPOSITIONS": "Bestimmungen", + "DISPOSITIONS": "Qualifizierungen", "WEBHOOKS": "WebHooks", - "ACTIONS": "Aktionen", - "ACCEPT": "Akzeptieren", - "ACCEPTMETHOD": "Die Methode", - "ACCEPTURL": "URL akzeptieren", + "ACTIONS": "Routing", + "ACCEPT": "Annehmen", + "ACCEPTMETHOD": "Methode annehmen", + "ACCEPTURL": "URL annehmen", "REJECT": "Ablehnen", "REJECTMETHOD": "Methode ablehnen", "REJECTURL": "URL ablehnen", - "CLOSE": "In der Nähe", - "CLOSEMETHOD": "In der Nähe Methode", - "CLOSEURL": "Der URL", - "SELECTED": "Ausgewählte", - "SELECT_ALL": "Alle auswählen", - "SELECT_NONE": "Wählen Sie \"Keine\"", + "CLOSE": "Schließen", + "CLOSEMETHOD": "Methode bei Schließen", + "CLOSEURL": "URL bei Schließen", + "SELECTED": "Ausgewählt", + "SELECT_ALL": "Alles auswählen", + "SELECT_NONE": "Nichts auswählen", "BACK": "Zurück", "SMS": "SMS", - "ID": "Id", + "ID": "ID", "CONFIRM_PASSWORD": "Passwort bestätigen", - "SMSDISPOSITIONS": "SMS-Bestimmungen", - "NO_SMSDISPOSITION_AVAILABLE": "Keine SMS-Verfügungen zur Verfügung", - "NEW_SMSDISPOSITION": "Neue SMS-Disposition", - "ADD_SMSDISPOSITION": "SMS-Disposition", - "EDIT_SMSDISPOSITION": "Bearbeiten Sie SMS-Disposition", - "DELETE_SMSDISPOSITION": "SMS löschen Disposition", + "SMSDISPOSITIONS": "SMS-Qualifizierungen", + "NO_SMSDISPOSITION_AVAILABLE": "Keine Qualifizierungen verfügbar", + "NEW_SMSDISPOSITION": "Neue Qualifizierung", + "ADD_SMSDISPOSITION": "Qualifizierung hinzufügen", + "EDIT_SMSDISPOSITION": "Qualifizierung bearbeiten", + "DELETE_SMSDISPOSITION": "Qualifizierung löschen", "NEW_SMSQUEUE": "Neue SMS-Warteschlange", - "NEW_SMSACCOUNT": "Neue SMS-Konto", - "NO_AVAILABLE_INFO": "Keine verfügbaren Info", - "ALL_TEAMS": "Alle Mannschaften", + "NEW_SMSACCOUNT": "Neues SMS-Konto", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", + "ALL_TEAMS": "Alle Teams", "SELECTED_TEAMS": "Ausgewählte Teams", "HELP": { "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", - "LIST": "Contact Manager Liste zu verknüpfen von Kontakten", - "RECEIVEURL": "Dies ist die automatisch generierte API-String müssen Sie die Nachrichten in Ihrem Konto von Ihrem SMS-Anbieter zu erhalten (POST-Methode verwendet werden muss). Drücken Sie die Zwischenablage, um Sie in die Zwischenablage zu kopieren.", - "MOTIONPROXY": "Das Feld muss das folgende Format haben: ://[:]. Beispiel: https://X.Y.Z.W", - "DELIVERYREPORTURL": "Dies ist die automatisch generierte API-Zeichenfolge, die Sie verwenden müssen, um den Zustellungsbericht gesendeter Nachrichten von Ihrem SMS-Anbieter zu empfangen (die POST-Methode muss verwendet werden): Klicken Sie auf die Zwischenablage, um sie zu kopieren", - "MANDATORYDISPOSITION": "Zwingende Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Anhalten, um zu verwenden, wenn die obligatorische Disposition aktiviert ist", - "WELCOMEMESSAGE": "Dies ist die erste Antwortnachricht, die an neue Interaktionen gesendet wird" + "LIST": "Zugewiesene Liste aus dem Kontaktmanager", + "RECEIVEURL": "URL für Antwort", + "MOTIONPROXY": "Proxy oder URL im Format: ://[:]. Beispiel: https://X.Y.Z.W", + "DELIVERYREPORTURL": "URL für die Berichtsgenerierung", + "MANDATORYDISPOSITION": "Qualifizierung erforderlich", + "MANDATORYDISPOSITIONPAUSEID": "Agentenstatus während Qualifizierung", + "WELCOMEMESSAGE": "Initiale Nachricht bei neuer Interaktion" }, "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "Von", - "TEAMADD_SMSQUEUE": "Team zur Warteschlange hinzufügen", - "AGENTADD_SMSQUEUE": "Agent zur Warteschlange hinzufügen", + "OF": "von", + "TEAMADD_SMSQUEUE": "Team hinzufügen", + "AGENTADD_SMSQUEUE": "Agenten hinzufügen", "ALL_AGENTS": "Alle Agenten", "SELECTED_AGENTS": "Ausgewählte Agenten", - "RECEIVEURL": "Erhalten URL", + "RECEIVEURL": "URL bei Annahme", "INTERACTION": "Interaktion", - "INTERACTIONS": "Wechselwirkungen", - "NO_INTERACTION_AVAILABLE": "Es sind keine Wechselwirkungen zur Verfügung", + "INTERACTIONS": "Interaktionen", + "NO_INTERACTION_AVAILABLE": "Keine Interaktionen verfügbar", "CONTACT": "Kontakt", - "STARTEDAT": "Gestartet am", + "STARTEDAT": "Begonnen am", "AGENT": "Agent", - "CLOSEDAT": "Geschlossen", - "DISPOSITION": "Disposition", - "NOTES": "Hinweise", - "GOTO": "Gehe zu", - "GOTOIF": "Gotoif", - "NOOP": "Noop", + "CLOSEDAT": "Geschlossen am", + "DISPOSITION": "Qualifizierung", + "NOTES": "Anmerkungen", + "GOTO": "Absprung (GoTo)", + "GOTOIF": "Bedingter Absprung (GoToIf)", + "NOOP": "Log erstellen (NoOp)", "QUEUE": "Warteschlange", - "TIMEOUT": "Timeout", + "TIMEOUT": "Zeitüberschreitung", "VALUE": "Wert", - "EDIT_AGENT": "Agent bearbeiten", - "EDIT_GOTO": "Bearbeiten Gehe zu", - "EDIT_NOOP": "Bearbeiten Noop", - "EDIT_GOTOIF": "Bearbeiten Gotoif", + "EDIT_AGENT": "Agenten bearbeiten", + "EDIT_GOTO": "GoTo bearbeiten", + "EDIT_NOOP": "NoOp bearbeiten", + "EDIT_GOTOIF": "GoToIf bearbeiten", "EDIT_QUEUE": "Warteschlange bearbeiten", - "CONDITION": "Zustand", - "TRUEPRIORITY": "Wahre Priorität", - "FALSEPRIORITY": "Falsche Priorität", + "CONDITION": "Bedingung", + "TRUEPRIORITY": "Priorität bei 'wahr'", + "FALSEPRIORITY": "Priorität bei 'falsch'", "PRIORITY": "Priorität", - "GOTOP": "Gotop", - "EDIT_GOTOP": "Gotop bearbeiten", - "EDIT_CLOSE": "Bearbeiten Schließen", + "GOTOP": "Absprung auf Anwendung (GoToP)", + "EDIT_GOTOP": "GoToP bearbeiten", + "EDIT_CLOSE": "Verhaten bei Schließen bearbeiten", "FILTER": "Filter", - "SELECT_STATUS": "Wählen Sie einen Status", - "ALL": "Alle", - "SELECT_ACCOUNT": "Wählen Sie ein Konto", - "OPENED": "Öffnen", + "SELECT_STATUS": "Status auswählen", + "ALL": "Alles", + "SELECT_ACCOUNT": "Konto auswählen", + "OPENED": "Geöffnet", "CLOSED": "Geschlossen", "STATUS": "Status", "ACCOUNT": "Konto", - "OPEN": "Öffnen", - "INFO": "Info", - "ACCOUNTSID": "Konto SID", - "AUTHTOKEN": "Auth Token", + "OPEN": "Offen", + "INFO": "Information", + "ACCOUNTSID": "Konto-ID", + "AUTHTOKEN": "Auth-Token", "PROXY": "Proxy", - "ADVANCED": "Erweiterte", + "ADVANCED": "Erweitert", "MOTIONPROXY": "Proxy oder Motion Domain", - "REALTIME": "Echtzeit", + "REALTIME": "Echtzeit-Ansicht", "UNKNOWN": "Unbekannt", - "UNREGISTERED": "Unregistrierte", + "UNREGISTERED": "Nicht registriert", "UNAVAILABLE": "Nicht verfügbar", - "NOT_INUSE": "Nicht in Gebrauch", + "NOT_INUSE": "Nicht in Verwendung", "REACHABLE": "Erreichbar", - "IN_USE": "Im Einsatz", + "IN_USE": "In Verwendung", "AGENTS": "Agenten", "QUEUES": "Warteschlangen", - "FULLNAME": "Fullname", - "INTERNAL": "Interne", - "PHONE_STATE": "Telefonstatus", - "PHONE_STATUS": "Telefonstatus", - "PAUSE": "Pause", - "LOGOUT": "An-/Abmelden", - "AGENTADD_QUEUE": "Agent SMS-Warteschlange hinzufügen", + "FULLNAME": "Vollstängier Name", + "INTERNAL": "Intern", + "PHONE_STATE": "Status Nebenstelle", + "PHONE_STATUS": "Status SIP", + "PAUSE": "Pausenstatus vergeben", + "LOGOUT": "Agenten An-/Abmelden", + "AGENTADD_QUEUE": "Agenten hinzufügen", "UNPAUSE": "Pause beenden", - "DEFAULT_PAUSE": "Standard Pause", + "DEFAULT_PAUSE": "Standard-Pause", "LOGGED_IN": "Angemeldet", - "PAUSED": "Angehalten", + "PAUSED": "in Pause", "READY": "Bereit", - "WAITING": "Warten", - "VOICE": "Voice", + "WAITING": "Wartezustand", + "VOICE": "Sprachanrufe (Voice)", "CHAT": "Chat", "MAIL": "E-Mail", - "OPENCHANNEL": "Channel öffnen", + "OPENCHANNEL": "Offener Kanal", "FAX": "Fax", - "AGENTSADD_QUEUE": "Agenten zu SMS-Warteschlange hinzufügen", + "AGENTSADD_QUEUE": "Agenten hinzufügen", "NO_AGENT_ONLINE": "Kein Agent Online", - "GOTOREALTIME_SMSQUEUE": "In Echtzeit, SMS-Warteschlange", - "PARTIALPAUSE": "Lastschriftzahlung teilweise Pause", + "GOTOREALTIME_SMSQUEUE": "Direkt zur Echtzeit-Ansicht", + "PARTIALPAUSE": "Teilpause", "BUSY": "Besetzt", "TIMER": "Timer", "IDLE": "Leerlauf", "CAPACITY": "Kapazität", "SEND": "Senden", - "TO": "Zu", + "TO": "An", "MESSAGE": "Nachricht", "TAGS": "Tags", - "INTERACTIONS_SMSACCOUNT": "Zu Wechselwirkungen gehen", - "REFRESH_INTERACTIONS": "Aktualisieren Interaktionen", - "CANNED_ANSWER_NOT_FOUND": "Es wurden keine vordefinierten Antworten gefunden", - "CANNED_ANSWER_SEARCH": "Geben Sie einen Text ein, um eine vordefinerte Antwort zu suchen", - "NO_SMSDISPOSITIONS_AVAILABLE": "Keine Sms-Disposition verfügbar", + "INTERACTIONS_SMSACCOUNT": "Zu den Interaktionen gehen", + "REFRESH_INTERACTIONS": "Interaktionen aktualisieren", + "CANNED_ANSWER_NOT_FOUND": "Keine vordefinierten Antworten verfügbar", + "CANNED_ANSWER_SEARCH": "Hier nach Textbaustein suchen", + "NO_SMSDISPOSITIONS_AVAILABLE": "Keine Qualifizierung verfügbar", "NO_SMSCANNEDANSWER_AVAILABLE": "Keine vordefinierten Antworten verfügbar", "NEW_SMSCANNEDANSWER": "Neue vordefinierte Antwort", "ADD_SMSCANNEDANSWER": "Vordefinierte Antwort hinzufügen", "EDIT_SMSCANNEDANSWER": "Vordefinierte Antwort bearbeiten", "DELETE_SMSCANNEDANSWER": "Vordefinierte Antwort löschen", - "DELIVERYREPORTURL": "Zustellungsbericht-URL", + "DELIVERYREPORTURL": "URL für Zuestellbericht", "DELETE": "Löschen", - "SENDERSTRING": "Absenderzeichenfolge", + "SENDERSTRING": "Absender-String", "DELIVERYREPORT": "Sendebericht", "METHOD": "Methode", - "ADD_NOTE": "Notiz hinzufügen", - "NOTE": "Hinweis", - "SPYINTERACTION": "Spion", + "ADD_NOTE": "Anmerkung hinzufügen", + "NOTE": "Anmerkung", + "SPYINTERACTION": "Interaktion anzeigen", "AUTOREPLY": "Automatische Antwort", - "EDIT_AUTOREPLY": "Bearbeiten Sie die automatische Antwort", - "TIMES": "Anzahl der Male pro Interaktion", + "EDIT_AUTOREPLY": "Automatische Antwort bearbeiten", + "TIMES": "Zeiten", "TEXT": "Text", "INSERT_MESSAGE_HERE": "Fügen Sie hier Ihre Textnachricht ein", "DELETE_INTERACTION": "Interaktion löschen", "AUTHID": "Authentifizierungs-ID", - "COMMAND": "Befehl", + "COMMAND": "Eingabe", "EDIT_SYSTEM": "System bearbeiten", "SYSTEM": "System", "VARIABLE": "Variable", "NOTIFICATION": "Benachrichtigung", - "NOTIFICATIONSHAKE": "Shake", - "NOTIFICATIONSOUND": "Klingen", + "NOTIFICATIONSHAKE": "Schütteln", + "NOTIFICATIONSOUND": "Ton abspielen", "NOTIFICATIONTEMPLATE": "Vorlage", - "WAITFORTHEASSIGNEDAGENT": "Warte auf den zugewiesenen Agenten", + "WAITFORTHEASSIGNEDAGENT": "Auf zugewiesenen Agenten warten", "EDIT_TAG": "Tag bearbeiten", - "TAG": "Etikett", - "AGENTADD_SMSACCOUNT": "Fügen Sie einen Agenten zum SMS-Konto hinzu", - "AGENTTRANSFER": "Agent Transfer", - "AGENTTRANSFERTIMEOUT": "Zeitüberschreitung für Agententransfer", - "QUEUETRANSFER": "Warteschlangenübertragung", - "QUEUETRANSFERTIMEOUT": "Warteschlangenübertragungs-Timeout", + "TAG": "Tag", + "AGENTADD_SMSACCOUNT": "Agenten zu SMS-Konto hinzufügen", + "AGENTTRANSFER": "Transfer an Agenten erlauben", + "AGENTTRANSFERTIMEOUT": "Zeitüberschreitung Agententransfer", + "QUEUETRANSFER": "Transfer an Warteschlange erlauben", + "QUEUETRANSFERTIMEOUT": "Zeitüberschreitung Warteschlangentransfer", "TRANSFER": "Transfer", "CANNEDANSWERS": "Vordefinierte Antworten", "DOWNLOAD_INTERACTION": "Herunterladen", "SMSCANNEDANSWERS": "Vordefinierte Antworten", - "LOGIN_TIME": "Login-Zeit", - "PAUSE_TIME": "Pausenzeit", + "LOGIN_TIME": "Zeit angemeldet", + "PAUSE_TIME": "Zeit in Pause", "APIKEY": "API-Schlüssel", - "BASEURL": "Basis-URL", - "TEAMS_ASSOCIATION": "Vereinigung der Mannschaften", - "MANDATORYDISPOSITION": "Zwingende Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Anhalten, um zu verwenden, wenn die obligatorische Disposition aktiviert ist", + "BASEURL": "Base-URL", + "TEAMS_ASSOCIATION": "Teamzueweisung", + "MANDATORYDISPOSITION": "Qualifizierung erforderlich", + "MANDATORYDISPOSITIONPAUSEID": "Agentenstatus während Qualifizierung", "ACCESSKEYID": "Zugriffsschlüssel-ID", "AMAZONLEX": "AmazonLex", - "BOTNAME": "Bot Name", + "BOTNAME": "BOT-Name", "DIALOGFLOW": "DialogFlow", - "EDIT_AMAZONLEX": "Bearbeiten Sie die Lex-Konfiguration", - "EDIT_DIALOGFLOW": "Bearbeiten Sie die DialogFlow-Konfiguration", + "EDIT_AMAZONLEX": "Lex-Konfiguration bearbeiten", + "EDIT_DIALOGFLOW": "DialogFlow-Konfiguration bearbeiten", "LANGUAGE": "Sprache", "LEXREGION": "Region", - "SECRETACCESSKEY": "Zugriffsschlüsselgeheimnis", + "SECRETACCESSKEY": "Geheimer Zugriffsschlüssel", "WELCOMEMESSAGE": "Willkommensnachricht", - "DOWNLOAD_WITHOUT_ATTACHMENT": "Ohne Anhang herunterladen", - "DOWNLOAD_WITH_ATTACHMENT": "Download mit Anhang", + "DOWNLOAD_WITHOUT_ATTACHMENT": "Herunterladen ohne Anhang", + "DOWNLOAD_WITH_ATTACHMENT": "Herunterladen inkl. Anhängen", "LASTMESSAGE": "Letzte Nachricht", - "CLIENTEMAIL": "Kunden-E-Mail", - "DIALOGFLOWV2": "Dialogflow V2", - "EDIT_DIALOGFLOWV2": "Dialogflow V2 bearbeiten", - "PRIVATEKEY": "Privat Schlüssel", + "CLIENTEMAIL": "Kunden E-Mail", + "DIALOGFLOWV2": "DialogFlow V2", + "EDIT_DIALOGFLOWV2": "DialogFlow V2 bearbeiten", + "PRIVATEKEY": "Privater Schlüssel", "PROJECTID": "Projekt-ID", "ACCOUNTID": "Konto-ID", "APPLICATIONID": "Anwendungs-ID" diff --git a/public/app/main/apps/staff/i18n/bs.json b/public/app/main/apps/staff/i18n/bs.json index 40425f7..2683fcd 100644 --- a/public/app/main/apps/staff/i18n/bs.json +++ b/public/app/main/apps/staff/i18n/bs.json @@ -1,77 +1,77 @@ { "STAFF": { - "MANAGE_API_KEY": "API Key Manager", + "MANAGE_API_KEY": "API Ključ Menadžer", "GENERATE": "GeneriÅ¡i", - "REGENERATE": "Regenerate", - "REMOVE": "Remove", + "REGENERATE": "RegeneriÅ¡i", + "REMOVE": "Ukloni", "APIKEYMANAGER_USER": "API Upravitelj Ključeva", "APIKEY": "API Ključ", - "VIDEOSUPPORT": "Video support", + "VIDEOSUPPORT": "Video podrÅ¡ka", "HOTDESK": "Hot desk", "ENABLEVIDEOECORDING": "Omogući Video Snimanje", "ENABLESCREENRECORDINGBYAGENT": "Omogući Snimanje Ekrana od Specijaliste", "ENABLEAUTOMATICSCREENRECORDING": "Omogući Automatski Snimanje Ekrana", - "OLD_PASSWORD": "Old Password", + "OLD_PASSWORD": "Stara Lozinka", "ENABLEJAWSINTEGRATION": "Omogući Jaws Intergraciju", "ALIAS": "Pseudonim", - "NO_PASSWORD_CHANGE": "No Password Change", - "SECURITY_SUITE": "Security Suite", + "NO_PASSWORD_CHANGE": "Nema Promjene Lozinke", + "SECURITY_SUITE": "Sigurnosni Suite", "AUTO_ANSWER": "Automatski odgovor", "CHAT_AUTOANSWER": "Chat automatski odgovor", "CHAT_AUTOANSWERDELAY": "Chat automatski dogovor odgoda [s]", "EMAIL_AUTOANSWER": "E-Mail automatski odgovor", "EMAIL_AUTOANSWERDELAY": "E-Mail automatski odgovor odgoda [s]", - "SMS_AUTOANSWER": "Sms auto answer", - "SMS_AUTOANSWERDELAY": "Sms auto answer delay [s]", - "OPENCHANNEL_AUTOANSWER": "Openchannel auto answer", - "OPENCHANNEL_AUTOANSWERDELAY": "Openchannel auto answer delay [s]", + "SMS_AUTOANSWER": "SMS automatski odgovor", + "SMS_AUTOANSWERDELAY": "SMS automatski odgovor odgoda [s]", + "OPENCHANNEL_AUTOANSWER": "Otvoreni Kanal automatski odgovor", + "OPENCHANNEL_AUTOANSWERDELAY": "Otvoreni Kanal automatski odgovor odgoda [s]", "FAX_AUTOANSWER": "Fax automatski odgovor", "FAX_AUTOANSWERDELAY": "Fax automatski odgovor odgoda [s]", - "WHATSAPP_AUTOANSWER": "Whatsapp connector auto answer", - "WHATSAPP_AUTOANSWERDELAY": "Whatsapp connector auto answer delay [s]", - "LAST_PASSWORD_RESET_AT": "Last Password Reset At", - "SIP_WEBRTC": "Sip", - "SETTINGS_WEBRTC": "Settings", + "WHATSAPP_AUTOANSWER": "WhatsApp konektor automatski odgovor", + "WHATSAPP_AUTOANSWERDELAY": "WhatsApp konektor automatski odgovor odgoda [s]", + "LAST_PASSWORD_RESET_AT": "Posljednji Reset Lozinke U", + "SIP_WEBRTC": "SIP", + "SETTINGS_WEBRTC": "Postavke", "WEBRTC": "WebRTC", "DTLSCERTFILE": "TLS certifikat", "DTLSPRIVATEKEY": "TLS certifikatov privatni ključ", "CONTEXT": "Kontekst", - "RINGINUSE": "Ring In Use", - "USERS": "Users", + "RINGINUSE": "Zvono U Upotrebi", + "USERS": "Korisnici", "AGENTS": "Specijalisti", - "TOGGLE_SIDENAV": "Toggle sidenav", - "SEARCH_FOR_ANYONE": "Search", + "TOGGLE_SIDENAV": "Toggle Bočnu navigaciju", + "SEARCH_FOR_ANYONE": "Traži", "BACK": "Nazad", - "MULTI_SELECT_TOGGLE": "multi select toggle", - "SELECT_ALL": "Select all", - "SELECT_NONE": "Select None", - "SELECTED": "Selected", + "MULTI_SELECT_TOGGLE": "viÅ¡estruki odabir", + "SELECT_ALL": "Odaberi sve", + "SELECT_NONE": "Odaberi NiÅ¡ta", + "SELECTED": "Odabrano", "DELETE_SELECTED": "IzbriÅ¡i odabrano", "EXPORT_SELECTED": "Izvezi odabrano", "ALL_USERS": "Svi Korisnici", "ALL_AGENTS": "Svi specijalisti", - "SORT": "sort", - "NAME": "Name", + "SORT": "Sortiraj", + "NAME": "Naziv", "FULLNAME": "Puno Ime", "A_TO_Z": "(A do Z)", - "Z_TO_A": "(Z to A)", - "MORE": "More", + "Z_TO_A": "(Z do A)", + "MORE": "ViÅ¡e", "DELETE_USER": "IzbriÅ¡i Korisnika", "EDIT_USER": "Uredi Korisnika", "DELETE_AGENT": "IzbriÅ¡i Specijalistu", "EDIT_AGENT": "Uredi Specijalistu", "DELETE": "IzbriÅ¡i", - "SAVE": "SAVE", + "SAVE": "SAČUVAJ", "ADD_USER": "DODAJ KORISNIKA", "ADD_AGENT": "DODAJ SPECIJALISTU", - "NO_RESULTS": "No results..", + "NO_RESULTS": "Nema rezultata...", "CLOSE_DIALOG": "Zatvori dijalog", - "NAME_REQUIRED": "Name (required)", - "USERNAME": "Username", - "SHOW_ALL_FIELDS": "Show All Fields", - "PHONE_NUMBER": "Phone number", + "NAME_REQUIRED": "Naziv (potrebno)", + "USERNAME": "Korisničko ime", + "SHOW_ALL_FIELDS": "Pokaži Sva Polja", + "PHONE_NUMBER": "Broj telefona", "EMAIL": "E-Mail", - "PASSWORD": "Password", + "PASSWORD": "Lozinka", "ERRORS": { "CONFIRM_REQUIRED": "Obavezno polje", "ALLOWCODECS_REQUIRED": "Obavezno polje", @@ -115,12 +115,12 @@ "ACCOUNT": "Nalog", "VOICE": "Voice", "CREATED_AT": "Kreirano U", - "ROLE": "Role", - "PERSONAL_INFO": "Personal Info", + "ROLE": "Uloga", + "PERSONAL_INFO": "Lične Informacije", "DESCRIPTION": "Opis", "CHANGE_AVATAR": "Promijeni Avatar", "GENERAL": "Općenito", - "INTERNAL": "Internal", + "INTERNAL": "Interni", "TRANSPORT": "Transport", "ALLOWCODECS": "Dozvoljeni Kodeci", "DISABLED": "Deaktivirano", @@ -128,101 +128,101 @@ "AD_SSO_ENABLED": "Active Directory SSO", "AUTHENTICATION": "Autentifikacija", "HELP": { - "DISABLED": "select to deactivate / unselect to reactivate", - "BLOCKED": "Lock / Unlock access", + "DISABLED": "odaberi za deaktiviranje / poniÅ¡ti odabir za ponovno aktiviranje", + "BLOCKED": "Zaključaj / Otljučaj pristup", "APIKEY": "Molimo koristi 'API Menadžer Ključeva' dugme na traci sa alatkama za upravljanjem ovim ključem", - "LAST_PASSWORD_RESET_AT": "Last date and time the password has been changed. If Secure Suite General Setting is enabled, the password will expire after 90 days.", - "DTLSCERTFILE": "Link to the valid TLS certificate(.crt file). Default value: '/etc/pki/tls/certs/motion.crt'.", - "DTLSPRIVATEKEY": "Link to the certificate's private key(.key file). Default value: '/etc/pki/tls/private/motion.key'.", + "LAST_PASSWORD_RESET_AT": "Zadnji datum i vrijeme kada je lozinka promijenjena. Ako su Opće Postavke Sigurnosnog Suitea omogućene, lozinka će isteći nakon 90 dana.", + "DTLSCERTFILE": "Link za važeći TLS certifikat (.crt datoteku). Zadana vrijednost: '/etc/pki/tls/certs/motion.crt'.", + "DTLSPRIVATEKEY": "Link za certifikat Privatnog Ključa (.key datoteka). Zadana vrijednost: '/etc/pki/tls/private/motion.key'.", "ALLOWCODECS": "Dozvoljeni Kodeci prema željenemo poretku", - "TRANSPORT": "Set the default transports in order of preference", - "HOST": "How to find the client - IP or host name. If you want the phone to register itself, use the keyword dynamic instead of Host IP", - "NAT": "Changes the behaviour of Asterisk for clients behind a firewall. If any of the comma-separated options is 'no', Asterisk will ignore other settings and set nat=no", - "SIPEXPIRES": "Default: 160", - "SIPPORT": "Default: 5160", - "TYPE": "Determines the SIP role within asterisk. User: used to authenticate incoming - Peer: for outgoing calls - Friend: covers both characteristics of the above", - "CHATCAPACITY": "Maximum number of concurrent channel interactions per agent (0=unlimited)", - "MAILCAPACITY": "Maximum number of concurrent channel interactions per agent (0=unlimited)", - "FAXCAPACITY": "Maximum number of concurrent channel interactions per agent (0=unlimited)", - "SMSCAPACITY": "Maximum number of concurrent channel interactions per agent (0=unlimited)", - "WHATSAPPCAPACITY": "Maximum number of concurrent channel interactions per agent (0=unlimited)", - "OPENCHANNELCAPACITY": "Maximum number of concurrent channel interactions per agent (0=unlimited)", - "CALLGROUP": "The agent's callgroup", - "PICKUPGROUP": "The groups in which the agent can answer calls", - "USERNAME": "Only numbers, letters and specific characters (._) are supported", - "ENCRYPTION": "SRTP (Secure Realtime Protocol) Encryption", - "SAVE_PERMISSIONS": "Every section containing any pending changes will be saved", - "CUSTOM_DASHBOARDS_PERMISSIONS": "Custom Dashboards permissions are managed in the Tools module", - "ENABLEAUTOMATICSCREENRECORDING": "The functionality is available only for voice channel", - "MASK_SENSITIVE_DATA": "Mask any sensitive data throughout the application (e.g. phone numbers and email addresses)", - "WSS_PORT": "Default: 8089", + "TRANSPORT": "Postavi zadane trasporte prema željenom redoslijedu", + "HOST": "Kako pronaći klijenta - IP ili naziv hosta. Ako želiÅ¡ da se telefon sam registruje, koristite ključnu riječ 'dynamic' umjesto host IP", + "NAT": "Mijenja ponaÅ¡anje Asteriska za klijente iza firewall. Ako je bilo koja od opcija 'ne', Asterisk će zanemariti druge postavke i postaviti nat=ne", + "SIPEXPIRES": "Zadano: 160", + "SIPPORT": "Zadano: 5160", + "TYPE": "Određuje SIP ulogu unutar Asteriska. Korisnik: kristi se za autentifikaciju dolaznih -Peer: za odlazne pozive -Prijatelj: pokriva obje karakteristike gore navedenih", + "CHATCAPACITY": "Maksimalan broj istovremenih interakcija kanala po Specijalisti (0=neograničeno)", + "MAILCAPACITY": "Maksimalan broj istovremenih interakcija kanala po Specijalisti (0=neograničeno)", + "FAXCAPACITY": "Maksimalan broj istovremenih interakcija kanala po Specijalisti (0=neograničeno)", + "SMSCAPACITY": "Maksimalan broj istovremenih interakcija kanala po Specijalisti (0=neograničeno)", + "WHATSAPPCAPACITY": "Maksimalan broj istovremenih interakcija kanala po Specijalisti (0=neograničeno)", + "OPENCHANNELCAPACITY": "Maksimalan broj istovremenih interakcija kanala po Specijalisti (0=neograničeno)", + "CALLGROUP": "Specijalistina Pozivna Grupa", + "PICKUPGROUP": "Grupe u kojima Specijalista može odgovarati na pozive", + "USERNAME": "Samo brojevi, slova, i specifični znakovi (._).", + "ENCRYPTION": "SRTP (Secure Realtime Protocol) Enkripcija", + "SAVE_PERMISSIONS": "Svi odjeljci koji sadrže promjene na čekanju bit će sačuvani", + "CUSTOM_DASHBOARDS_PERMISSIONS": "Pravima Prilagođene Table se upravlja u modulu Alati", + "ENABLEAUTOMATICSCREENRECORDING": "Funkcija je dostupna samo za voice kanal", + "MASK_SENSITIVE_DATA": "Maskiraj sve osjetljive podatke u cijeloj aplikaciji (npr. telefonske brojeve i E-Mail adrese)", + "WSS_PORT": "Zadano:8089", "AD_SSO_ENABLED": "Prijavi se sa svojima Active Directory akreditivima" }, - "NEW_PASSWORD": "New Password", + "NEW_PASSWORD": "Nova Lozinka", "CONFIRM_PASSWORD": "Potvrdi Lozinku", "CHANGE_PASSWORD": "Promijeni Lozinku", "CHANGEPASSWORD_AGENT": "Promijeni Lozinku", "CHANGEPASSWORD_USER": "Promijeni Lozinku", "CHANGEPASSWORD_TELEPHONE": "Promijeni Lozinku", - "LOGININPAUSE": "Login In Pause", + "LOGININPAUSE": "Pauza Prijave", "HOST": "Host", "NAT": "NAT", "CHANSPY": "ChanSpy", - "OTHER_CHANNELS": "Other Channels", + "OTHER_CHANNELS": "Ostali Kanali", "CHATCAPACITY": "Chat Kapacitet", - "MAILCAPACITY": "Email Capacity", + "MAILCAPACITY": "E-Mail Kapacitet", "FAXCAPACITY": "Fax Kapacitet", - "SMSCAPACITY": "Sms Capacity", - "WHATSAPPCAPACITY": "WhatsApp Connector Capacity", - "OPENCHANNELCAPACITY": "Open Channel Capacity", + "SMSCAPACITY": "SMS Kapacitet", + "WHATSAPPCAPACITY": "WhatsApp Konektor Kapacitet", + "OPENCHANNELCAPACITY": "Otvoreni Kanal Kapacitet", "MOTIONBAR": "Motion Bar", - "SETTINGS": "Settings", + "SETTINGS": "Postavke", "AUTOANSWER": "Automatski Odgovor", "ENABLESETTINGS": "Omogući Postavke", "CALL_FORWARDING": "Prosljeđivanje Poziva", - "UNCONDITIONAL": "Unconditional", - "UNCONDITIONALNUMBER": "Unconditional Number", - "NOREPLY": "No Reply", - "NOREPLYNUMBER": "No Reply Number", + "UNCONDITIONAL": "Bezuslovno", + "UNCONDITIONALNUMBER": "Bezuslovni Broj", + "NOREPLY": "Bez Odgovora", + "NOREPLYNUMBER": "Bez Odgovora Broj", "BUSY": "Zauzet", "BUSYNUMBER": "Zauzet Broj", - "REMOTE_CONTROL": "Remote Control", - "REMOTECONTROL": "Remote Control", - "REMOTECONTROLPORT": "Remote Control Port", + "REMOTE_CONTROL": "Daljinsko Upravljanje", + "REMOTECONTROL": "Daljinsko Upravljanje", + "REMOTECONTROLPORT": "Daljinsko Upravljanje Port", "SIP": "SIP", - "SIPEXPIRES": "SIP Expires [sec]", + "SIPEXPIRES": "SIP Ističe [sec]", "SIPPORT": "SIP Port", - "PENALTY": "Penalty", + "PENALTY": "Kazna", "ACCOUNTNAME": "Nalog Naziv", "ADD_TELEPHONE": "Dodaj Telefon", "EDIT_TELEPHONE": "Uredi Telefon", "DELETE_TELEPHONE": "IzbriÅ¡i Telefon", - "TEAMS": "Teams", + "TEAMS": "Timovi", "DELETE_TEAM": "IzbriÅ¡i Tim", "AGENTADD_TEAM": "Dodaj Specijaliste u Tim", "EDIT_TEAM": "Uredi Tim", - "TYPE": "Type", - "TELEPHONES": "Telephones", + "TYPE": "Vrsta", + "TELEPHONES": "Telefoni", "CALLERID": "Pozivatelj ID", "ENABLERECORDING": "Omogući Snimanje", - "STAFF": "Staff", - "ID": "Id", - "NEW_USER": "New User", - "NEW_AGENT": "New Agent", - "NEW_TELEPHONE": "New Telephone", - "NEW_TEAM": "New Team", + "STAFF": "Osoblje", + "ID": "ID", + "NEW_USER": "Novi Korisnik", + "NEW_AGENT": "Novi Specijalist", + "NEW_TELEPHONE": "Novi Telefon", + "NEW_TEAM": "Novi Tim", "ADD_TEAM": "Dodaj Tim", - "JOIN_QUEUE": "Join Queue", + "JOIN_QUEUE": "Pridruži se Queue", "CAPACITY": "Kapacitet", "AUTOINTERNAL": "Automatsko generisanje internog broja", "ADD_AGENT_TO_TEAM": "Dodaj Specijalistu u Tim", - "TEAMADD_AGENT": "Add Agent to Team", - "NO_AVAILABLE_INFO": "No available info", - "PERMISSIONS": "Permissions", + "TEAMADD_AGENT": "Dodaj Specijalistu u Tim", + "NO_AVAILABLE_INFO": "Nema dostupnih informacija", + "PERMISSIONS": "Prava", "ADD_AGENT_TO_QUEUE": "Dodaj Specijalistu u Queue", "ALL_MODULES_AVAILABLE": "Svi dostupni moduli", "CALLGROUP": "Grupa Poziva", - "PICKUPGROUP": "Pickup Group", + "PICKUPGROUP": "Grupa Preuzimanja", "ADD_AGENT_TO_QUEUE_CAMPAIGNS": "Dodaj Specijalistu u Queue Kampanja", "ADD_AGENT_TO_VOICE_QUEUES": "Dodaj Specijalistu u Voice Queues", "ADD_AGENT_TO_CHAT_QUEUES": "Dodaj Specijalistu u Chat Queues", @@ -231,162 +231,162 @@ "ADD_AGENT_TO_WHATSAPP_QUEUES": "Dodaj Specijalistu u WhatsApp Queues", "ADD_AGENT_TO_OPENCHANNEL_QUEUES": "Dodaj Specijalistu u Otvoreni Kanal Queues", "ADD_AGENT_TO_FAX_QUEUES": "Dodaj Specijalistu u Fax Queues", - "QUEUEADD_USER_VOICE_INBOUND": "Add User to Voice Queues", - "QUEUEADD_USER_CHAT_INBOUND": "Add User to Chat Queues", - "QUEUEADD_USER_MAIL_INBOUND": "Add User to Email Queues", - "QUEUEADD_USER_SMS_INBOUND": "Add User to SMS Queues", - "QUEUEADD_USER_WHATSAPP_INBOUND": "Add User to WhatsApp Queues", - "QUEUEADD_USER_OPENCHANNEL_INBOUND": "Add User to Open Channel Queues", - "QUEUEADD_USER_FAX_INBOUND": "Add User to Fax Queues", + "QUEUEADD_USER_VOICE_INBOUND": "Dodaj Korisnika u Voice Queues", + "QUEUEADD_USER_CHAT_INBOUND": "Dodaj Korisnika u Chat Queues", + "QUEUEADD_USER_MAIL_INBOUND": "Dodaj Korisnika u E-Mail Queues", + "QUEUEADD_USER_SMS_INBOUND": "Dodaj Korisnika u SMS Queues", + "QUEUEADD_USER_WHATSAPP_INBOUND": "Dodaj Korisnika u WhatsApp Queues", + "QUEUEADD_USER_OPENCHANNEL_INBOUND": "Dodaj Korisnika u Otvoreni Kanal Queues", + "QUEUEADD_USER_FAX_INBOUND": "Dodaj Korisnika u Fax Queues", "ALL_TEAMS": "Svi Timovi", - "SELECTED_TEAMS": "Selected Teams", - "SELECTED_AGENTS": "Selected Agents", + "SELECTED_TEAMS": "Odabrani Timovi", + "SELECTED_AGENTS": "Odabrani Specijalisti", "ALL_QUEUE_CAMPAIGNS": "Sve Queue Kampanje", - "SELECTED_QUEUE_CAMPAIGNS": "Selected Queue Campaigns", + "SELECTED_QUEUE_CAMPAIGNS": "Odabrane Queue Kampanje", "ALL_VOICE_QUEUES": "Svi Voice Queues", - "SELECTED_VOICE_QUEUES": "Selected Voice Queues", + "SELECTED_VOICE_QUEUES": "Odabrani Voice Queues", "ALL_CHAT_QUEUES": "Svi Chat Queues", - "SELECTED_CHAT_QUEUES": "Selected Chat Queues", + "SELECTED_CHAT_QUEUES": "Odabrani Chat Queues", "ALL_MAIL_QUEUES": "Svi E-Mail Queues", - "SELECTED_MAIL_QUEUES": "Selected Email Queues", + "SELECTED_MAIL_QUEUES": "Odabrani E-Mail Queues", "ALL_SMS_QUEUES": "Svi SMS Queues", - "SELECTED_SMS_QUEUES": "Selected SMS Queues", + "SELECTED_SMS_QUEUES": "Odabrani SMS Queues", "ALL_WHATSAPP_QUEUES": "Svi WhatsApp Queues", - "SELECTED_WHATSAPP_QUEUES": "Selected WhatsApp Queues", + "SELECTED_WHATSAPP_QUEUES": "Odabrani WhatsApp Queues", "ALL_OPENCHANNEL_QUEUES": "Svi Otvoreni Kanal Queues", - "SELECTED_OPENCHANNEL_QUEUES": "Selected Open Channel Queues", + "SELECTED_OPENCHANNEL_QUEUES": "Odabrani Otvoreni Kanal Queues", "ALL_FAX_QUEUES": "Svi Fax Queues", - "SELECTED_FAX_QUEUES": "Selected Fax Queues", - "VOICEMAIL": "Voicemail", - "SHOWWEBCONTROL": "Typology", - "PAGE": "Page", - "ROWSPERPAGE": "Rows per page", - "OF": "of", + "SELECTED_FAX_QUEUES": "Odabrani Fax Queues", + "VOICEMAIL": "Govorna poÅ¡ta", + "SHOWWEBCONTROL": "Tipologija", + "PAGE": "Stranica", + "ROWSPERPAGE": "Redova po stranici", + "OF": "od", "CALLFORWARDING": "Prosljeđivanje Poziva", "DND": "Ne ometaj tokom pauze", - "UNANSWEREDCALLBADGE": "Show unanswered call badge", + "UNANSWEREDCALLBADGE": "Prikaži značku neodgovorenih poziva", "ENABLEDTMFTONE": "Omogući DTMF tonove", "AUTOANSWERDELAY": "Automatski Odgovor Odgoda [s]", "ENCRYPTION": "Enkripcija", "CHANNELS": "Kanali", "CHAT": "Chat", - "SMS": "Sms", - "WHATSAPP": "WhatsApp Connector", - "OPENCHANNEL": "Open Channel", + "SMS": "SMS", + "WHATSAPP": "WhatsApp Konektor", + "OPENCHANNEL": "Otvoreni Kanal", "FAX": "Fax", - "QUEUEADD_USER_VOICE_OUTBOUND": "Add User to Queue Campaigns", - "MONITOREXTENSION": "Record calls to user extension", + "QUEUEADD_USER_VOICE_OUTBOUND": "Dodaj Korisnika u Queue Kampanje", + "MONITOREXTENSION": "Snimi pozive na ekstenziju korisnika", "EDITPERMISSIONS": "Uredi Prava", - "READ_PERMISSION": "Read", + "READ_PERMISSION": "Čitaj", "EDIT_PERMISSION": "Uredi", "DELETE_PERMISSION": "IzbriÅ¡i", "GENERAL_PERMISSIONS": "Općenito", "ENABLEMESSENGER": "Omogući Interni Messenger", - "OUTBOUNDPROXY": "Oubound Proxy", - "PHONE": "Phone", - "MOBILE": "Mobile", - "PREFIXREQUIRED": "Prefix Required", - "MANAGE_PERMISSIONS": "Manage Permissions", - "USERADD_VOICEQUEUES": "Add Voice Queue to User", + "OUTBOUNDPROXY": "Odlazni Proxy", + "PHONE": "Telefon", + "MOBILE": "Mobilni", + "PREFIXREQUIRED": "Prefiks Potreban", + "MANAGE_PERMISSIONS": "Upravljaj Pravima", + "USERADD_VOICEQUEUES": "Dodaj Voice Queue Korisniku", "ALL_VOICEQUEUES": "Svi Voice Queues", - "SELECTED_VOICEQUEUES": "Selected Voice Queues", - "USERADD_CHATQUEUES": "Add Chat Queue to User", + "SELECTED_VOICEQUEUES": "Odabrani Voice Queues", + "USERADD_CHATQUEUES": "Dodaj Chat Queues Korisniku", "ALL_CHATQUEUES": "Svi Chat Queues", - "SELECTED_CHATQUEUES": "Selected Email Queues", - "USERADD_MAILQUEUES": "Add Email Queue to User", + "SELECTED_CHATQUEUES": "Odabrani E-Mail Queues", + "USERADD_MAILQUEUES": "Dodaj E-Mail Queue Korisniku", "ALL_MAILQUEUES": "Svi E-Mail Queues", - "SELECTED_MAILQUEUES": "Selected Chat Queues", - "USERADD_SMSQUEUES": "Add SMS Queue to User", + "SELECTED_MAILQUEUES": "Odabrani Chat Queues", + "USERADD_SMSQUEUES": "Dodaj SMS Queue Korisniku", "ALL_SMSQUEUES": "Svi SMS Queues", - "SELECTED_SMSQUEUES": "Selected SMS Queues", - "USERADD_WHATSAPPQUEUES": "Add Whataspp Queue to User", + "SELECTED_SMSQUEUES": "Odabrani SMS Queues", + "USERADD_WHATSAPPQUEUES": "Dodaj WhatsApp Queue Korisniku", "ALL_WHATSAPPQUEUES": "Svi WhatsApp Queues", - "SELECTED_WHATSAPPQUEUES": "Selected WhatsApp Queues", - "USERADD_FAXQUEUES": "Add Fax Queue to User", + "SELECTED_WHATSAPPQUEUES": "Odabrani WhatsApp Queues", + "USERADD_FAXQUEUES": "Dodaj Fax Queues Korisniku", "ALL_FAXQUEUES": "Svi Fax Queues", - "SELECTED_FAXQUEUES": "Selected Fax Queues", - "USERADD_OPENCHANNELQUEUES": "Add Open Channel Queue to User", + "SELECTED_FAXQUEUES": "Odabrani Fax Queues", + "USERADD_OPENCHANNELQUEUES": "Dodaj Otvoreni Kanal Queue Korisniku", "ALL_OPENCHANNELQUEUES": "Svi Otvoreni Kanal Queues", - "SELECTED_OPENCHANNELQUEUES": "Selected Open Channel Queues", - "USERADD_PROJECTS": "Add Cally Square Project to User", + "SELECTED_OPENCHANNELQUEUES": "Odabrani Otvoreni Kanal Queues", + "USERADD_PROJECTS": "Dodaj Cally Square Projekat Korisniku", "ALL_PROJECTS": "Svi Cally Square Projekti", - "SELECTED_PROJECTS": "Selected Cally Square Projects", - "USERADD_CHATWEBSITES": "Add Chat Website to User", + "SELECTED_PROJECTS": "Odabrani Cally Square Projekti", + "USERADD_CHATWEBSITES": "Dodaj Chat Webstranicu Korisniku", "ALL_CHATWEBSITES": "Sve Chat Webstranice", - "SELECTED_CHATWEBSITES": "Selected Chat Websites", - "USERADD_QUEUECAMPAIGNS": "Add Queue Campaign to User", + "SELECTED_CHATWEBSITES": "Odabrane Chat Webstranice", + "USERADD_QUEUECAMPAIGNS": "Dodaj Queue Kampanju Korisniku", "ALL_QUEUECAMPAIGNS": "Sve Queue Kampanje", - "SELECTED_QUEUECAMPAIGNS": "Selected Queue Campaigns", - "USERADD_MAILACCOUNTS": "Add Email Account to User", + "SELECTED_QUEUECAMPAIGNS": "Odabrane Queue Kampanje", + "USERADD_MAILACCOUNTS": "Dodaj E-Mail Nalog Korisniku", "ALL_MAILACCOUNTS": "Svi E-Mail Nalozi", - "SELECTED_MAILACCOUNTS": "Selected Email Accounts", - "USERADD_FAXACCOUNTS": "Add Fax Account to User", + "SELECTED_MAILACCOUNTS": "Odabrani E-Mail Nalozi", + "USERADD_FAXACCOUNTS": "Dodaj Fax Nalog Korisniku", "ALL_FAXACCOUNTS": "Svi Fax Nalozi", - "SELECTED_FAXACCOUNTS": "Selected Fax Accounts", - "USERADD_SMSACCOUNTS": "Add SMS Account to User", + "SELECTED_FAXACCOUNTS": "Odabrani Fax Nalozi", + "USERADD_SMSACCOUNTS": "Dodaj SMS Nalog Korisniku", "ALL_SMSACCOUNTS": "Svi SMS Nalozi", - "SELECTED_SMSACCOUNTS": "Selected SMS Accounts", - "USERADD_WHATSAPPACCOUNTS": "Add WhatsApp Account to User", + "SELECTED_SMSACCOUNTS": "Odabrani SMS Nalozi", + "USERADD_WHATSAPPACCOUNTS": "DOdaj WhatsApp Nalog Korisniku", "ALL_WHATSAPPACCOUNTS": "Svi WhatsApp Nalozi", - "SELECTED_WHATSAPPACCOUNTS": "Selected WhatsApp Accounts", - "USERADD_OPENCHANNELACCOUNTS": "Add Open Channel Account to User", + "SELECTED_WHATSAPPACCOUNTS": "Odabrani WhatsApp Nalozi", + "USERADD_OPENCHANNELACCOUNTS": "Dodaj Otvoreni Kanal Korisniku", "ALL_OPENCHANNELACCOUNTS": "Svi Otvoreni Kanal Nalozi", - "SELECTED_OPENCHANNELACCOUNTS": "Selected Open Channel Accounts", - "USERPROFILES": "User Profiles", - "USERPROFILE": "User Profile", - "NEW_USERPROFILE": "New User Profile", + "SELECTED_OPENCHANNELACCOUNTS": "Odabrani Otvoreni Kanal Nalozi", + "USERPROFILES": "Korisnički Porfili", + "USERPROFILE": "Korisnički Profil", + "NEW_USERPROFILE": "Novi Profil Korisnika", "ADD_USERPROFILE": "DODAJ PROFIL KORISNIKA", "EDIT_USERPROFILE": "Uredi Profil Korisnika", "CLONE_USERPROFILE": "Kloniraj Profil Korisnika", "DELETE_USERPROFILE": "IzbriÅ¡i Profil Korisnika", "CRUDPERMISSIONS": "Vrsta Prava", - "SECTIONS": "Sections", - "MODULES": "Modules", - "SUMMARY": "Summary", - "REPORT_TYPE": "Report Type", - "PERMISSIONS_MANAGE": "Manage", - "PERMISSIONS_SECTION_TITLE": "{{sectionName}} Permissions", - "PERMISSIONS_AUTO_ASSOCIATION_INFO": "Automatically associate every current and future resource of this section to the User Profile", - "PERMISSIONS_PLACEHOLDER_SEARCH": "Search...", - "PERMISSIONS_SELECT_SECTION": "Select a section", - "PERMISSIONS_SELECT_REPORT_TYPE": "Select report type", - "PERMISSIONS_ALL_RESOURCES": "All resources", - "PERMISSIONS_SELECTED_RESOURCES": "Selected resources", - "PERMISSIONS_SECTION_HIDE": "Hide section to the User", - "PERMISSIONS_SECTION_SHOW": "Show section to the User", - "PERMISSIONS_WARNING_ENABLE_ALL": "All {{sectionName}} subsections and their resources will be enabled. Are you sure you want to continue?", - "PERMISSIONS_WARNING_CLOSE": "You have unsaved changes. Are you sure you want to exit without saving?", + "SECTIONS": "Odjeljci", + "MODULES": "Moduli", + "SUMMARY": "Sažetak", + "REPORT_TYPE": "IzvjeÅ¡taj Vrsta", + "PERMISSIONS_MANAGE": "Upravljaj", + "PERMISSIONS_SECTION_TITLE": "{{sectionName}} Prava", + "PERMISSIONS_AUTO_ASSOCIATION_INFO": "Automatski pridruži svaki trenutni i budući resurs ovog odjeljka Profilu Korisnika", + "PERMISSIONS_PLACEHOLDER_SEARCH": "Traži...", + "PERMISSIONS_SELECT_SECTION": "Odaberi odjeljak", + "PERMISSIONS_SELECT_REPORT_TYPE": "Odaberi vrstu izvjeÅ¡taja", + "PERMISSIONS_ALL_RESOURCES": "Svi resursi", + "PERMISSIONS_SELECTED_RESOURCES": "Odabrani resursi", + "PERMISSIONS_SECTION_HIDE": "Sakrij odjeljak za Korisnika", + "PERMISSIONS_SECTION_SHOW": "Prikaži odjeljak za Korisnika", + "PERMISSIONS_WARNING_ENABLE_ALL": "Svi {{sectionName}} pododjeljci i njihovi resursi će biti omogućeni. Jesi li siguran da želiÅ¡ nastaviti?", + "PERMISSIONS_WARNING_CLOSE": "ImaÅ¡ nesačuvane promjene. Jesi li siguran da želiÅ¡ izaći bez spremanja?", "NOTIFICATIONS": { - "PERMISSIONS_ENABLED_ALL_SUCCESS_TITLE": "{{sectionName}} section enabled", - "PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE": "All {{sectionName}} resources have been added to {{userProfileName}} User Profile", - "PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE_NO_RESOURCES": "{{sectionName}} has been added to {{userProfileName}} User Profile", - "PERMISSIONS_DISABLED_ALL_SUCCESS_TITLE": "{{sectionName}} section disabled", - "PERMISSIONS_DISABLED_ALL_SUCCESS_MESSAGE": "All {{sectionName}} resources have been removed from {{userProfileName}} User Profile", - "PERMISSIONS_DISABLED_ALL_SUCCESS_MESSAGE_NO_RESOURCES": "{{sectionName}} has been removed from {{userProfileName}} User Profile", - "PERMISSIONS_SAVED_SUCCESS_TITLE": "{{sectionName}} section saved", - "PERMISSIONS_SAVED_SUCCESS_MESSAGE": "Permissions successfully updated!" + "PERMISSIONS_ENABLED_ALL_SUCCESS_TITLE": "{{sectionName}} odjeljak omogućen", + "PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE": "Svi {{sectionName}} resursi su dodani na {{userProfileName}} Profil Korisnika", + "PERMISSIONS_ENABLED_ALL_SUCCESS_MESSAGE_NO_RESOURCES": "{{sectionName}} je dodanu u {{userProfileName}} Profil Korisnika", + "PERMISSIONS_DISABLED_ALL_SUCCESS_TITLE": "{{sectionName}} odjeljak onemogućen", + "PERMISSIONS_DISABLED_ALL_SUCCESS_MESSAGE": "Svi {{sectionName}} resursi su oklonjeni sa {{userProfileName}} Profila Korisnika", + "PERMISSIONS_DISABLED_ALL_SUCCESS_MESSAGE_NO_RESOURCES": "{{sectionName}} je uklonjen sa {{userProfileName}} Porfila Korisnika", + "PERMISSIONS_SAVED_SUCCESS_TITLE": "{{sectionName}} odjeljak sačuvan", + "PERMISSIONS_SAVED_SUCCESS_MESSAGE": "Prava uspjeÅ¡no ažurirana!" }, "CONFIRM": "Potvrdi", "CANCEL": "Otkaži", "CLOSE": "Zatvori", - "QUEUES_ASSOCIATION": "{{channel}} Queues Association", - "TEAMS_ASSOCIATION": "Teams Association", - "PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE": "Unauthorized action", - "PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE": "You are not allowed to access the selected section", - "PERMISSIONS_UNAUTHORIZED_CREATION_MESSAGE": "You are not allowed to create the resource", - "MASK_SENSITIVE_DATA": "Mask Sensitive Data", + "QUEUES_ASSOCIATION": "{{channel}} Queues Asocijacija", + "TEAMS_ASSOCIATION": "Asocijacija Timova", + "PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE": "NeovlaÅ¡tena radnja", + "PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE": "Nije ti dozvoljen pristup odabranom odjeljku", + "PERMISSIONS_UNAUTHORIZED_CREATION_MESSAGE": "Nije ti dozvoljeno kreirati resurs", + "MASK_SENSITIVE_DATA": "Maskiraj Osjetljive Podatke", "WSS_PORT": "WSS Port", "DOWNLOADS": "Preuzimanja", "DOWNLOAD_PERMISSIONS": "Prava za Preuzimanja", - "VOICE_RECORDINGS": "Voice Recordings", - "OMNICHANNEL_INTERACTIONS": "Omnichannel Interactions", + "VOICE_RECORDINGS": "Voice Snimci", + "OMNICHANNEL_INTERACTIONS": "Omnichannel interkacije", "ATTACHMENTS": "Prilozi", - "SCREEN_RECORDINGS": "Screen Recordings", - "JSCRIPTY_SESSIONS": "Jscripty Sessions", + "SCREEN_RECORDINGS": "Snimci Ekrana", + "JSCRIPTY_SESSIONS": "Jscripty Sesije", "CONTACT_MANAGER_LISTS": "Kontakt Menadžer Lista", "CALLYSQUARE_RECORDINGS": "Cally Square Snimci", - "IGNORE_AGENT_BREAK_STATUS_FOR_PREVIEW_CALLS": "Ignore agent break status for preview calls", - "SELECT_RECALLME_CAMPAIGN": "Select Recall Me Campaign", + "IGNORE_AGENT_BREAK_STATUS_FOR_PREVIEW_CALLS": "Zanemari status pauze za pregled poziva", + "SELECT_RECALLME_CAMPAIGN": "Odaberi Recall Me Kampanju", "CLIENT_LOGS": "Logovi Klijenata", "CLIENT_LOGS_DISABLED": "Logovi klijenata su onemogućeni", "CLIENT_LOGS_ENABLED": "Logovi klijenata su omogućeni", @@ -396,29 +396,29 @@ "CLIENT_LOGS_ENABLED_MSG": "Logovi klijenata su omogućeni za tvog korisnika", "CLIENT_LOGS_DISABLED_MSG": "Logovi klijenata su onemogućeni za tvog korisnika", "CLIENT_LOGS_ALL_ENABLED_WARNING": "Upozorenje: ovo može ozbiljno uticati na performanse servera ako je viÅ¡e Specijalista istovremeno prijavljeno!", - "QUEUEADD_AGENT_VOICE_OUTBOUND": "Add Agent to Queue Campaigns", - "QUEUEADD_AGENT_VOICE_INBOUND": "Add Agent to Voice Queues", - "QUEUEADD_AGENT_CHAT_INBOUND": "Add Agent to Chat Queues", - "QUEUEADD_AGENT_MAIL_INBOUND": "Add Agent to Email Queues", - "QUEUEADD_AGENT_SMS_INBOUND": "Add Agent to SMS Queues", - "QUEUEADD_AGENT_WHATSAPP_INBOUND": "Add Agent to WhatsApp Queues", - "QUEUEADD_AGENT_OPENCHANNEL_INBOUND": "Add Agent to Open Channel Queues", - "QUEUEADD_AGENT_FAX_INBOUND": "Add Agent to Fax Queues", + "QUEUEADD_AGENT_VOICE_OUTBOUND": "Dodaj Specijalistu u Queue Kampanje", + "QUEUEADD_AGENT_VOICE_INBOUND": "Dodaj Specijalistu u Voice Queues", + "QUEUEADD_AGENT_CHAT_INBOUND": "Dodaj Specijalistu u Chat Queues", + "QUEUEADD_AGENT_MAIL_INBOUND": "Dodaj Specijalistu u E-Mail Queues", + "QUEUEADD_AGENT_SMS_INBOUND": "Dodaj Specijalistu u SMS Queues", + "QUEUEADD_AGENT_WHATSAPP_INBOUND": "Dodaj Specijalistu u WhatsApp Queues", + "QUEUEADD_AGENT_OPENCHANNEL_INBOUND": "Dodaj Specijalistu u Otvoreni Kanal Queues", + "QUEUEADD_AGENT_FAX_INBOUND": "Dodaj Specijalistu u Fax Queues", "ALL_QUEUES_VOICE_OUTBOUND": "Sve Queue Kampanje", - "SELECTED_QUEUES_VOICE_OUTBOUND": "Selected Queue Campaigns", + "SELECTED_QUEUES_VOICE_OUTBOUND": "Odabranje Queues Kampanje", "ALL_QUEUES_VOICE_INBOUND": "Svi Voice Queues", - "SELECTED_QUEUES_VOICE_INBOUND": "Selected Voice Queues", + "SELECTED_QUEUES_VOICE_INBOUND": "Odabrani Voice Queues", "ALL_QUEUES_CHAT_INBOUND": "Svi Chat Queues", - "SELECTED_QUEUES_CHAT_INBOUND": "Selected Chat Queues", + "SELECTED_QUEUES_CHAT_INBOUND": "Odabrani Chat Queues", "ALL_QUEUES_MAIL_INBOUND": "Svi E-Mail Queues", - "SELECTED_QUEUES_MAIL_INBOUND": "Selected Email Queues", + "SELECTED_QUEUES_MAIL_INBOUND": "Odabrani E-Mail Queues", "ALL_QUEUES_SMS_INBOUND": "Svi SMS Queues", - "SELECTED_QUEUES_SMS_INBOUND": "Selected SMS Queues", + "SELECTED_QUEUES_SMS_INBOUND": "Odabrani SMS Queues", "ALL_QUEUES_WHATSAPP_INBOUND": "Svi WhatsApp Queues", - "SELECTED_QUEUES_WHATSAPP_INBOUND": "Selected WhatsApp Queues", + "SELECTED_QUEUES_WHATSAPP_INBOUND": "Odabrani WhatsApp Queues", "ALL_QUEUES_OPENCHANNEL_INBOUND": "Svi Otvoreni Kanal Queues", - "SELECTED_QUEUES_OPENCHANNEL_INBOUND": "Selected Open Channel Queues", + "SELECTED_QUEUES_OPENCHANNEL_INBOUND": "Odabrani Otvoreni Kanal Queues", "ALL_QUEUES_FAX_INBOUND": "Svi Fax Queues", - "SELECTED_QUEUES_FAX_INBOUND": "Selected Fax Queues" + "SELECTED_QUEUES_FAX_INBOUND": "Odabrani Fax Queues" } } diff --git a/public/app/main/apps/staff/i18n/de.json b/public/app/main/apps/staff/i18n/de.json index a46e611..daf39ad 100644 --- a/public/app/main/apps/staff/i18n/de.json +++ b/public/app/main/apps/staff/i18n/de.json @@ -1,417 +1,417 @@ { "STAFF": { "CONTEXT": "Kontext", - "RINGINUSE": "Ring im Einsatz", + "RINGINUSE": "Klingeln wenn besetzt", "USERS": "Benutzer", "AGENTS": "Agenten", - "TOGGLE_SIDENAV": "Um sidenav", - "SEARCH_FOR_ANYONE": "Suche für Jedermann", + "TOGGLE_SIDENAV": "Seitliche Navigation umschalten", + "SEARCH_FOR_ANYONE": "Suche", "BACK": "Zurück", - "MULTI_SELECT_TOGGLE": "Wählen Sie toggle multi", - "SELECT_ALL": "Alle auswählen", - "SELECT_NONE": "Wählen Sie \"Keine\"", - "SELECTED": "Ausgewählte", + "MULTI_SELECT_TOGGLE": "Umschalten Mehrfachauswahl", + "SELECT_ALL": "Alles auswählen", + "SELECT_NONE": "Nichts auswählen", + "SELECTED": "Ausgewählt", "DELETE_SELECTED": "Auswahl löschen", "EXPORT_SELECTED": "Auswahl exportieren", - "ALL_USERS": "Alle Benutzer", + "ALL_USERS": "Alle Nutzer", "ALL_AGENTS": "Alle Agenten", "SORT": "Sortieren", "NAME": "Name", - "FULLNAME": "Voller Name", + "FULLNAME": "Vollständiger Name", "A_TO_Z": "(A bis Z)", "Z_TO_A": "(Z bis A)", "MORE": "Mehr", - "DELETE_USER": "Benutzer löschen", - "EDIT_USER": "Benutzer bearbeiten", - "DELETE_AGENT": "Bedienplatz löschen", - "EDIT_AGENT": "Agent bearbeiten", + "DELETE_USER": "Nutzer löschen", + "EDIT_USER": "Nutzer bearbeiten", + "DELETE_AGENT": "Agenten löschen", + "EDIT_AGENT": "Agenten bearbeiten", "DELETE": "Löschen", "SAVE": "Speichern", - "ADD_USER": "Benutzer hinzufügen", - "ADD_AGENT": "AGENT HINZUFÜGEN", - "NO_RESULTS": "Keine Ergebnisse.", + "ADD_USER": "Nutzer hinzufügen", + "ADD_AGENT": "Agenten hinzufügen", + "NO_RESULTS": "Keine Ergebnisse gefunden", "CLOSE_DIALOG": "Dialog schließen", - "NAME_REQUIRED": "Name (erforderlich).", - "USERNAME": "Benutzername", + "NAME_REQUIRED": "Name erforderlich", + "USERNAME": "Nutzername", "SHOW_ALL_FIELDS": "Alle Felder anzeigen", "PHONE_NUMBER": "Telefonnummer", "EMAIL": "E-Mail", "PASSWORD": "Passwort", "ERRORS": { - "FULLNAME_REQUIRED": "Der Fullname ist erforderlich", - "USERNAME_REQUIRED": "Der Benutzername ist erforderlich", + "FULLNAME_REQUIRED": "Vollständiger Name erforderlich", + "USERNAME_REQUIRED": "Nutzername erforderlich", "EMAIL_REQUIRED": "Die E-Mail ist erforderlich", - "PASSWORD_REQUIRED": "Das Kennwort ist erforderlich", - "CONFIRM_NOT_MATCH": "Die Kennwörter stimmen nicht überein.", - "EMAIL_MUST_VALID": "Die e-Mail muss in einem gültigen Format", - "ACCOUNTNAME_REQUIRED": "Der Account ist erforderlich.", - "NAME_REQUIRED": "Der Name ist erforderlich", - "HOST_REQUIRED": "Der Host wird benötigt", - "CHATCAPACITY_REQUIRED": "Die Kapazität ist erforderlich", - "MAILCAPACITY_REQUIRED": "Die E-Mail Kapazität erforderlich ist", - "FAXCAPACITY_REQUIRED": "Die Kapazität ist erforderlich", - "SMSCAPACITY_REQUIRED": "Die SMS-Kapazität erforderlich ist", - "OPENCHANNELCAPACITY_REQUIRED": "Der Offene Kanal Kapazität erforderlich ist", - "SIPEXPIRES_REQUIRED": "Der SIP-Ablauf ist erforderlich", - "SIPPORT_REQUIRED": "Die SIP-Port erforderlich.", - "UNCONDITIONALNUMBER_REQUIRED": "Die Zielrufnummer ist erforderlich", - "NOREPLYNUMBER_REQUIRED": "Die Nummer ist keine Antwort erforderlich", - "BUSYNUMBER_REQUIRED": "Die besetzt ist erforderlich", - "USERNAME_MUST_VALID_PATTERN": "Der Benutzername muss gültige {{regex}}.", - "REMOTECONTROLPORT_REQUIRED": "Die Fernbedienung Anschluss erforderlich", - "CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Chat Kapazität muss größer als oder gleich", - "MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die E-Mail Kapazität muss größer als oder gleich", - "FAXCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Das Fax Kapazität muss größer als oder gleich", - "OPENCHANNELCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der offene Kanal Kapazität muss größer als oder gleich", - "AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer als oder gleich", - "AUTOANSWERDELAY_REQUIRED": "Pflichtfeld", - "MONITOREXTENSION_REQUIRED": "Pflichtfeld", + "PASSWORD_REQUIRED": "Passwort erforderlich", + "CONFIRM_NOT_MATCH": "Die Passwörter stimmen nicht überein.", + "EMAIL_MUST_VALID": "Ungültiges Format E-Mail", + "ACCOUNTNAME_REQUIRED": "Konto erforderlich", + "NAME_REQUIRED": "Name erforderlich", + "HOST_REQUIRED": "Host erforderlich", + "CHATCAPACITY_REQUIRED": "Kapazität Chat erforderlich", + "MAILCAPACITY_REQUIRED": "Kapazität E-Mail erforderlich", + "FAXCAPACITY_REQUIRED": "Kapazität Fax erforderlich", + "SMSCAPACITY_REQUIRED": "Kapazität SMS erforderlich", + "OPENCHANNELCAPACITY_REQUIRED": "Kapazität offener Kanal erforderlich", + "SIPEXPIRES_REQUIRED": "Timeout SIP erforderlich", + "SIPPORT_REQUIRED": "SIP-Port erforderlich", + "UNCONDITIONALNUMBER_REQUIRED": "Zielrufnummer erforderlich", + "NOREPLYNUMBER_REQUIRED": "Nummer bei keiner Antwort erforderlich", + "BUSYNUMBER_REQUIRED": "Nummer bei Besetzt erforderlich", + "USERNAME_MUST_VALID_PATTERN": "Nutzername muss einem gültigen Muster entsprechen", + "REMOTECONTROLPORT_REQUIRED": "Port für Remote erforderlich", + "CHATCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Kapazität Chat muss größer oder gleich sein als", + "MAILCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Kapazität E-Mail muss größer oder gleich sein als", + "FAXCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Kapazität Fax muss größer oder gleich sein als", + "OPENCHANNELCAPACITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Kapazität offener Kanal muss größer oder gleich sein als", + "AUTOANSWERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Verzögerung automatische Antwort muss größer oder gleich sein als", + "AUTOANSWERDELAY_REQUIRED": "Verzögerung automatische Antwort erforderlich", + "MONITOREXTENSION_REQUIRED": "Monitoring-Nebenstelle erforderlich", "ENCRYPTION": "SRTP (Secure Realtime Protocol) Verschlüsselung", "DTLSCERTFILE_REQUIRED": "Pflichtfeld", "DTLSPRIVATEKEY_REQUIRED": "Pflichtfeld", - "SECURE_PASSWORD_PATTERN": "Das Passwort muss mindestens 8 Zeichen lang sein und 1 Kleinbuchstabe, 1 Großbuchstabe, 1 Zahl und 1 Sonderzeichen haben ~! @", - "ALLOWCODECS_REQUIRED": "Pflichtfeld", + "SECURE_PASSWORD_PATTERN": "Das Passwort muss mindestens 8 Zeichen lang sein und 1 Kleinbuchstaben, 1 Großbuchstaben, 1 Zahl und 1 Sonderzeichen enthalten", + "ALLOWCODECS_REQUIRED": "Erlaubte Codecs erforderlich", "CRUDPERMISSIONS_REQUIRED": "Pflichtfeld", - "USERPROFILE_REQUIRED": "Pflichtfeld", - "PASSWORD_OLDPASSWORD_MATCH": "Das neue Passwort muss sich vom vorherigen Passwort unterscheiden", - "CONFIRM_REQUIRED": "Pflichtfeld", - "WHATSAPPCAPACITY_REQUIRED": "Pflichtfeld" + "USERPROFILE_REQUIRED": "Nutzerprofil erforderlich", + "PASSWORD_OLDPASSWORD_MATCH": "Die Passwörter stimmen nicht überein", + "CONFIRM_REQUIRED": "Bestätigung erforderlich", + "WHATSAPPCAPACITY_REQUIRED": "Kapazität WhatsApp erforderlich" }, "ACCOUNT": "Konto", - "VOICE": "Voice", + "VOICE": "Sprachanrufe", "CREATED_AT": "Erstellt am", "ROLE": "Rolle", "PERSONAL_INFO": "Persönliche Infos", "DESCRIPTION": "Beschreibung", "CHANGE_AVATAR": "Avatar ändern.", "GENERAL": "Allgemein", - "INTERNAL": "Interne", - "TRANSPORT": "Verkehr", - "ALLOWCODECS": "Codecs erlaubt", + "INTERNAL": "Intern", + "TRANSPORT": "Sprachtransport", + "ALLOWCODECS": "Erlaubte Codecs", "HELP": { - "ALLOWCODECS": "Erlaubt Codecs in der Reihenfolge ihrer Präferenz", - "TRANSPORT": "Festlegen der Standardeinstellungen für Transporte. Die Reihenfolge bestimmt den primären Standard.", - "HOST": "Wie finden Sie die Client-IP oder den Host-Namen. Wenn Sie möchten, dass das Telefon zu registrieren, verwenden Sie das Schlüsselwort Dynamic anstelle von Host-IP.", - "NAT": "Ändert das Verhalten von Sternchen für Clients hinter einer Firewall.Wenn der Komma-getrennten Optionen ist \"Nein\", Asterisk ignoriert alle anderen Einstellungen und die nat=No.", + "ALLOWCODECS": "Erlaubte Audio-Codecs in der ausgewählten Reihenfolge", + "TRANSPORT": "Definiert die Reihenfolge der verwendeten transport-Protokolle", + "HOST": "Client-IP oder Hostname", + "NAT": "Passt das Verhalten des Telefonieservers hinter einer Firewall an", "SIPEXPIRES": "Standardeinstellung: 160", "SIPPORT": "Standardeinstellung: 5160", - "TYPE": "Legt das SIP-Rolle innerhalb der Sternchen. User: Wird verwendet, um die Authentifizierung für eingehende - Peer: für ausgehende Anrufe - Freund: Deckt sowohl die Eigenschaften der oben genannten.", - "CHATCAPACITY": "Null bedeutet unbegrenzt.", - "MAILCAPACITY": "Null bedeutet unbegrenzt.", - "FAXCAPACITY": "Null bedeutet unbegrenzt.", - "SMSCAPACITY": "Null bedeutet unbegrenzt.", - "OPENCHANNELCAPACITY": "Null bedeutet unbegrenzt.", - "CALLGROUP": "Legt der Agent callgroup", - "PICKUPGROUP": "Definiert die Gruppen in denen der Agent Anrufe annehmen können", + "TYPE": "Rolle der Nebenstelle innerhalb des Telefonieservers", + "CHATCAPACITY": "Max. simultane Chats (0 = unbegrenzt)", + "MAILCAPACITY": "Max. simultane E-Mails (0 = unbegrenzt)", + "FAXCAPACITY": "Max. simultane Faxe (0 = unbegrenzt)", + "SMSCAPACITY": "Max. simultane SMS (0 = unbegrenzt)", + "OPENCHANNELCAPACITY": "Max. simultane offener-Kanal-Interaktionen (0 = unbegrenzt)", + "CALLGROUP": "Definiert die Rufgruppe der Nebenstelle (PBX-Funktion)", + "PICKUPGROUP": "Definiert die Übernahmegruppe der Nebenstelle (PBX-Funktion)", "USERNAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", "ENCRYPTION": "SRTP (Secure Realtime Protocol) Verschlüsselung", - "LAST_PASSWORD_RESET_AT": "Letztes Datum und Uhrzeit, zu der das Passwort geändert wurde. Wenn die Allgemeinen Einstellungen für Secure Suite aktiviert sind, läuft das Passwort nach 90 Tagen ab.", - "DTLSCERTFILE": "Verknüpfen Sie mit dem gültigen TLS-Zertifikat (.crt-Datei). Standardwert: '/etc/pki/tls/certs/motion.crt'.", - "DTLSPRIVATEKEY": "Verknüpfen Sie mit dem privaten Schlüssel des Zertifikats (.key-Datei). Standardwert: '/etc/pki/tls/private/motion.key'.", + "LAST_PASSWORD_RESET_AT": "Datum des letztmaligen Zurücksetzens des Nutzerpasswortes", + "DTLSCERTFILE": "TLS-Zertifikat (.crt-Datei). Standardwert: '/etc/pki/tls/certs/motion.crt'.", + "DTLSPRIVATEKEY": "Privater Schlüssel des Zertifikats (.key-Datei). Standardwert: '/etc/pki/tls/private/motion.key'.", "SAVE_PERMISSIONS": "Jeder Abschnitt, der ausstehende Änderungen enthält, wird gespeichert", - "CUSTOM_DASHBOARDS_PERMISSIONS": "Berechtigungen für benutzerdefinierte Dashboards werden im Modul Tools verwaltet", - "APIKEY": "Verwenden Sie die Schaltfläche \"API-Schlüsselmanager\" in der Symbolleiste, um diesen Schlüssel zu verwalten", - "ENABLEAUTOMATICSCREENRECORDING": "Die Funktionalität ist nur für Sprachkanäle verfügbar", - "BLOCKED": "Zugriff sperren / entsperren", - "DISABLED": "Zum Deaktivieren auswählen / Zum Reaktivieren deaktivieren", - "WHATSAPPCAPACITY": "Maximale Anzahl gleichzeitiger Kanalinteraktionen pro Agent (0 = unbegrenzt)", - "MASK_SENSITIVE_DATA": "Maskieren Sie vertrauliche Daten in der gesamten Anwendung (z. B. Telefonnummern und E-Mail-Adressen).", + "CUSTOM_DASHBOARDS_PERMISSIONS": "Berechtigungen für benutzerdefinierte Dashboards werden im Modul 'Werkzeuge' verwaltet", + "APIKEY": "API Key für die Authentifizierung", + "ENABLEAUTOMATICSCREENRECORDING": "Nur verfügbar für Sprachkanäle", + "BLOCKED": "Gesperrt", + "DISABLED": "Deaktiviert", + "WHATSAPPCAPACITY": "Max. simultane WhatsApp-Interaktionen (0 = unbegrenzt)", + "MASK_SENSITIVE_DATA": "Maskieren Sie vertrauliche Daten in der gesamten Anwendung (z. B. Telefonnummern und E-Mail-Adressen)", "WSS_PORT": "Standard: 8089", "AD_SSO_ENABLED": "Melden Sie sich mit Ihren Active Directory-Anmeldeinformationen an" }, - "NEW_PASSWORD": "Neues Kennwort", + "NEW_PASSWORD": "Neues Passwort", "CONFIRM_PASSWORD": "Passwort bestätigen", "CHANGE_PASSWORD": "Passwort ändern", - "CHANGEPASSWORD_AGENT": "Passwort ändern", - "CHANGEPASSWORD_USER": "Passwort ändern", - "CHANGEPASSWORD_TELEPHONE": "Passwort ändern", - "LOGININPAUSE": "Geben Sie Ihren Benutzernamen und Ihr Passwort In der Pause", + "CHANGEPASSWORD_AGENT": "Passwort für Agenten ändern", + "CHANGEPASSWORD_USER": "Passwort für Nutzer ändern", + "CHANGEPASSWORD_TELEPHONE": "Passwort für Telefon ändern", + "LOGININPAUSE": "Anmelden in Pause", "HOST": "Host", "NAT": "NAT", - "CHANSPY": "ChanSpy", - "OTHER_CHANNELS": "Andere Kanäle", - "CHATCAPACITY": "Chat Kapazität", - "MAILCAPACITY": "E-Kapazität", - "FAXCAPACITY": "Fax Kapazität", - "SMSCAPACITY": "Sms-Kapazität", - "OPENCHANNELCAPACITY": "Offener Kanal Kapazität", - "MOTIONBAR": "Motion Bar", + "CHANSPY": "Listen-In erlauben", + "OTHER_CHANNELS": "Weitere Kanäle", + "CHATCAPACITY": "Kapazität Chat", + "MAILCAPACITY": "Kapazität E-Mail", + "FAXCAPACITY": "Kapazität Fax", + "SMSCAPACITY": "Kapazität SMS", + "OPENCHANNELCAPACITY": "Kapazität offener Kanal", + "MOTIONBAR": "Motion PhoneBar", "SETTINGS": "Einstellungen", - "AUTOANSWER": "\"Autom. Antwort\"", - "ENABLESETTINGS": "Einstellungen aktivieren", + "AUTOANSWER": "Automatische Antwort", + "ENABLESETTINGS": "Darf erweiterte Einstellungen öffnen", "CALL_FORWARDING": "Anrufweiterleitung", - "UNCONDITIONAL": "Unbedingte", - "UNCONDITIONALNUMBER": "Uneingeschränkte Anzahl", + "UNCONDITIONAL": "Generelle Anrufweiterleitung", + "UNCONDITIONALNUMBER": "Nummer generelle Anrufweiterleitung", "NOREPLY": "Keine Antwort", - "NOREPLYNUMBER": "\"Keine Antwort\"-Nummer", + "NOREPLYNUMBER": "Nummer bei 'keine Antwort'", "BUSY": "Besetzt", - "BUSYNUMBER": "Nummer besetzt", - "REMOTE_CONTROL": "Fernbedienung", - "REMOTECONTROL": "Fernbedienung", - "REMOTECONTROLPORT": "Fernbedienung", + "BUSYNUMBER": "Nummer bei besetzt", + "REMOTE_CONTROL": "Fernzugriff", + "REMOTECONTROL": "Fernzugriff", + "REMOTECONTROLPORT": "Port Fernzugriff", "SIP": "SIP", - "SIPEXPIRES": "SIP läuft [sec]", + "SIPEXPIRES": "SIP-Ablaufdatum (Sek)", "SIPPORT": "SIP-Port", - "PENALTY": "Strafe", - "ACCOUNTNAME": "Account Name", + "PENALTY": "Verzögerung", + "ACCOUNTNAME": "Kontoname", "ADD_TELEPHONE": "Telefon hinzufügen", "EDIT_TELEPHONE": "Telefon bearbeiten", "DELETE_TELEPHONE": "Telefon löschen", "TEAMS": "Teams", "DELETE_TEAM": "Team löschen", - "AGENTADD_TEAM": "Hinzufügen von Agenten zu einer Gruppe", - "EDIT_TEAM": "Team bearbeiten.", + "AGENTADD_TEAM": "Agenten zu Team hinzufügen", + "EDIT_TEAM": "Team bearbeiten", "TYPE": "Typ", "TELEPHONES": "Telefone", - "CALLERID": "Die Anrufer-ID", - "ENABLERECORDING": "Aktivieren der Aufzeichnung", + "CALLERID": "Anrufer-ID (CallerID)", + "ENABLERECORDING": "Darf Aufzeichnung starten/stoppen", "STAFF": "Personal", - "ID": "Id", - "NEW_USER": "Neuer Benutzer", + "ID": "ID", + "NEW_USER": "Neuer Nutzer", "NEW_AGENT": "Neuer Agent", "NEW_TELEPHONE": "Neues Telefon", "NEW_TEAM": "Neues Team", "ADD_TEAM": "Team hinzufügen", - "JOIN_QUEUE": "Melden Sie Warteschlange", + "JOIN_QUEUE": "Zu Warteschlange hinzufügen", "CAPACITY": "Kapazität", "AUTOINTERNAL": "Interne Nummer automatisch generieren", - "ADD_AGENT_TO_TEAM": "Hinzufügen von Agenten zu einer Gruppe", - "TEAMADD_AGENT": "Agent zu Gruppe hinzufügen", - "NO_AVAILABLE_INFO": "Keine verfügbaren Info", + "ADD_AGENT_TO_TEAM": "Agenten zu Team hinzufügen", + "TEAMADD_AGENT": "Agenten zu Team hinzufügen", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", "PERMISSIONS": "Berechtigungen", - "ADD_AGENT_TO_QUEUE": "Agent zur Warteschlange hinzufügen", + "ADD_AGENT_TO_QUEUE": "Agenten zur Warteschlange hinzufügen", "ALL_MODULES_AVAILABLE": "Alle Module verfügbar", - "CALLGROUP": "Gruppenruf", + "CALLGROUP": "Rufgruppe", "PICKUPGROUP": "Übernahmegruppe", - "ADD_AGENT_TO_QUEUE_CAMPAIGNS": "Agenten hinzufügen - ausgehende Anrufe", - "ADD_AGENT_TO_VOICE_QUEUES": "Agenten hinzufügen - eingehende Anrufe", - "ADD_AGENT_TO_CHAT_QUEUES": "Agenten hinzufügen - Chat-Warteschlangen", - "ADD_AGENT_TO_MAIL_QUEUES": "Agenten hinzufügen - E-Mail-Warteschlangen", - "ADD_AGENT_TO_SMS_QUEUES": "Agenten hinzufügen - SMS-Warteschlangen", - "ADD_AGENT_TO_OPENCHANNEL_QUEUES": "Agenten hinzufügen - offener Kanal-Warteschlangen", - "ADD_AGENT_TO_FAX_QUEUES": "Agenten hinzufügen - Fax-Warteschlangen", - "QUEUEADD_USER_VOICE_INBOUND": "Benutzer stimme Warteschlangen hinzufügen", - "QUEUEADD_USER_CHAT_INBOUND": "Benutzer zu chatten Warteschlangen hinzufügen", - "QUEUEADD_USER_MAIL_INBOUND": "Benutzer Mail Warteschlangen hinzufügen", - "QUEUEADD_USER_SMS_INBOUND": "Benutzer von SMS-Warteschlangen hinzufügen", - "QUEUEADD_USER_OPENCHANNEL_INBOUND": "Benutzer zum offenen Kanal Warteschlangen hinzufügen", - "QUEUEADD_USER_FAX_INBOUND": "Benutzer fax Warteschlangen hinzufügen", - "ALL_TEAMS": "Alle Mannschaften", + "QUEUEADD_AGENT_VOICE_OUTBOUND": "Agenten hinzufügen (ausgehende Sprachanrufe)", + "QUEUEADD_AGENT_VOICE_INBOUND": "Agenten hinzufügen (eingehende Sprachanrufe)", + "QUEUEADD_AGENT_CHAT_INBOUND": "Agenten hinzufügen (Chat-Warteschlangen)", + "QUEUEADD_AGENT_MAIL_INBOUND": "Agenten hinzufügen (E-Mail-Warteschlangen)", + "QUEUEADD_AGENT_SMS_INBOUND": "Agenten hinzufügen (SMS-Warteschlangen)", + "QUEUEADD_AGENT_OPENCHANNEL_INBOUND": "Agenten hinzufügen (offener Kanal)", + "QUEUEADD_AGENT_FAX_INBOUND": "Agenten hinzufügen (Fax-Warteschlangen)", + "QUEUEADD_USER_VOICE_INBOUND": "Nutzer hinzufügen (eingehende Sprachanrufe)", + "QUEUEADD_USER_CHAT_INBOUND": "Nutzer hinzufügen (Chat-Warteschlangen)", + "QUEUEADD_USER_MAIL_INBOUND": "Nutzer hinzufügen (E-Mail-Warteschlangen)", + "QUEUEADD_USER_SMS_INBOUND": "Nutzer hinzufügen (SMS-Warteschlangen)", + "QUEUEADD_USER_OPENCHANNEL_INBOUND": "Nutzer hinzufügen (offener Kanal)", + "QUEUEADD_USER_FAX_INBOUND": "Nutzer hinzufügen (Fax-Warteschlangen)", + "ALL_TEAMS": "Alle Teams", "SELECTED_TEAMS": "Ausgewählte Teams", "SELECTED_AGENTS": "Ausgewählte Agenten", - "ALL_QUEUE_CAMPAIGNS": "Alle Warteschlangen - ausgehende Anrufe", - "SELECTED_QUEUE_CAMPAIGNS": "Gewählte Warteschlangen - ausgehende Anrufe", - "ALL_VOICE_QUEUES": "Alle Warteschlangen - eingehende Anrufe", - "SELECTED_VOICE_QUEUES": "Ausgewählte Warteschlangen - eingehende Anrufe", - "ALL_CHAT_QUEUES": "Alle Warteschlangen - Chat", - "SELECTED_CHAT_QUEUES": "Ausgewählte Warteschlangen - Chat", - "ALL_MAIL_QUEUES": "Alle Warteschlangen - E-Mail", - "SELECTED_MAIL_QUEUES": "Ausgewählte Warteschlangen - E-Mail", - "ALL_SMS_QUEUES": "Alle Warteschlangen - SMS", - "SELECTED_SMS_QUEUES": "Ausgewählte Warteschlangen - SMS", - "ALL_OPENCHANNEL_QUEUES": "Alle Warteschlangen - offener Kanal", - "SELECTED_OPENCHANNEL_QUEUES": "Ausgewählte Warteschlangen - offener Kanal", - "ALL_FAX_QUEUES": "Alle Warteschlangen - Fax", - "SELECTED_FAX_QUEUES": "Ausgewählte Warteschlangen - Fax", + "ALL_QUEUES_VOICE_OUTBOUND": "Alle ausgehenden Sprachanrufe", + "SELECTED_QUEUES_VOICE_OUTBOUND": "Ausgewählte ausgehende Sprachanrufe", + "ALL_QUEUES_VOICE_INBOUND": "Alle eingehenden Sprachanrufe", + "SELECTED_QUEUES_VOICE_INBOUND": "Ausgewählte eingehende Sprachanrufe", + "ALL_QUEUES_CHAT_INBOUND": "Alle Chat Warteschlangen", + "SELECTED_QUEUES_CHAT_INBOUND": "Ausgewählte Chat-Warteschlangen", + "ALL_QUEUES_MAIL_INBOUND": "Alle E-Mail-Warteschlangen", + "SELECTED_QUEUES_MAIL_INBOUND": "Ausgewählte Mail Warteschlangen", + "ALL_QUEUES_SMS_INBOUND": "Alle SMS-Warteschlangen", + "SELECTED_QUEUES_SMS_INBOUND": "Ausgewählte SMS-Warteschlangen", + "ALL_QUEUES_OPENCHANNEL_INBOUND": "Alle Warteschlangen offener Kanal", + "SELECTED_QUEUES_OPENCHANNEL_INBOUND": "Ausgewählte Warteschlangen offener Kanal", + "ALL_QUEUES_FAX_INBOUND": "Alle Fax-Warteschlangen", + "SELECTED_QUEUES_FAX_INBOUND": "Ausgewählte Fax-Warteschlangen", "VOICEMAIL": "Voicemail", - "SHOWWEBCONTROL": "Anzeigen Web Control", + "SHOWWEBCONTROL": "Technologie für Sprachanrufe", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "Von", + "OF": "von", "CALLFORWARDING": "Anrufweiterleitung", - "DND": "Während der Pause nicht stören", - "UNANSWEREDCALLBADGE": "Zeige unbeantwortete Anruf Abzeichen", - "ENABLEDTMFTONE": "Dtmf-Töne aktivieren", - "AUTOANSWERDELAY": "Auto Antwortverzögerung", + "DND": "Nicht stören während Pause", + "UNANSWEREDCALLBADGE": "Benachrichtigung verpasste Anrufe", + "ENABLEDTMFTONE": "Darf DTMF-Töne senden", + "AUTOANSWERDELAY": "Verzögerung automatische Antwort", "ENCRYPTION": "Verschlüsselung", "CHANNELS": "Kanäle", "CHAT": "Chat", - "SMS": "Sms", + "SMS": "SMS", "OPENCHANNEL": "Offener Kanal", "FAX": "Fax", - "QUEUEADD_USER_VOICE_OUTBOUND": "Benutzer in Warteschlange Kampagnen hinzufügen", - "MONITOREXTENSION": "Anrufe an die Nebenstelle des Benutzers aufzeichnen", - "NO_PASSWORD_CHANGE": "Keine Passwortänderung", - "SECURITY_SUITE": "Sicherheitssuite", - "LAST_PASSWORD_RESET_AT": "Letzte Passwort zurücksetzen um", - "SIP_WEBRTC": "Schluck", - "SETTINGS_WEBRTC": "die Einstellungen", + "QUEUEADD_USER_VOICE_OUTBOUND": "Nutzer hinzufügen (ausgehende Sprachanrufe)", + "MONITOREXTENSION": "Aufzeichnung der Nebenstelle", + "NO_PASSWORD_CHANGE": "Keine Änderung des Passwortes", + "SECURITY_SUITE": "Sicherheitseinstellungen", + "LAST_PASSWORD_RESET_AT": "Passwort zuletzt geändert am:", + "SIP_WEBRTC": "WebRTC", + "SETTINGS_WEBRTC": "Einstellungen WebRTC", "WEBRTC": "WebRTC", "DTLSCERTFILE": "TLS-Zertifikat", - "DTLSPRIVATEKEY": "Der private Schlüssel des TLS-Zertifikats", - "EDITPERMISSIONS": "Bearbeiten von Berechtigungen", + "DTLSPRIVATEKEY": "Privater Schlüssel des TLS-Zertifikats", + "EDITPERMISSIONS": "Bearbeiten", "READANDEDIT": "Lesen, Bearbeiten", "READANDEDITANDDELETE": "Lesen, Bearbeiten, Löschen", - "GENERAL_PERMISSIONS": "Allgemeines", - "ENABLEMESSENGER": "Aktivieren Sie den internen Messenger", - "OUTBOUNDPROXY": "Oubound-Proxy", + "GENERAL_PERMISSIONS": "Allgemeine Berechtigungen", + "ENABLEMESSENGER": "Internen Messenger aktivieren", + "OUTBOUNDPROXY": "Outbound-Proxy", "PHONE": "Telefon", "MOBILE": "Handy, Mobiltelefon", "ALIAS": "Alias", "ENABLEJAWSINTEGRATION": "Jaws-Integration aktivieren", "PREFIXREQUIRED": "Präfix erforderlich", - "ENABLEVIDEORECORDING": "Aktiviere Videoaufnahme", + "ENABLEVIDEORECORDING": "Videoaufzeichnung aktivieren", "OLD_PASSWORD": "Altes Passwort", "ALL_CHATQUEUES": "Alle Chat-Warteschlangen", - "ALL_CHATWEBSITES": "Alle Chat-Websites", + "ALL_CHATWEBSITES": "Alle Chat-Webseiten", "ALL_FAXACCOUNTS": "Alle Faxkonten", - "ALL_FAXQUEUES": "Alle Faxwarteschlangen", + "ALL_FAXQUEUES": "Alle Fax-Warteschlangen", "ALL_MAILACCOUNTS": "Alle E-Mail-Konten", "ALL_MAILQUEUES": "Alle E-Mail-Warteschlangen", - "ALL_OPENCHANNELACCOUNTS": "Alle offenen Channel-Konten", - "ALL_OPENCHANNELQUEUES": "Alle offenen Kanalwarteschlangen", - "ALL_PROJECTS": "Alle Cally Square-Projekte", + "ALL_OPENCHANNELACCOUNTS": "Alle offenen Kanal-Konten", + "ALL_OPENCHANNELQUEUES": "Alle offenen Kanal-Warteschlangen", + "ALL_PROJECTS": "Alle CallySquare-Projekte", "ALL_QUEUECAMPAIGNS": "Alle Queue-Kampagnen", "ALL_SMSACCOUNTS": "Alle SMS-Konten", "ALL_SMSQUEUES": "Alle SMS-Warteschlangen", "ALL_VOICEQUEUES": "Alle Sprachwarteschlangen", "MANAGE_PERMISSIONS": "Berechtigungen verwalten", "SELECTED_CHATQUEUES": "Ausgewählte E-Mail-Warteschlangen", - "SELECTED_CHATWEBSITES": "Ausgewählte Chat-Websites", + "SELECTED_CHATWEBSITES": "Ausgewählte Chat-Webseiten", "SELECTED_FAXACCOUNTS": "Ausgewählte Faxkonten", - "SELECTED_FAXQUEUES": "Ausgewählte Faxwarteschlangen", + "SELECTED_FAXQUEUES": "Ausgewählte Fax-Warteschlangen", "SELECTED_MAILACCOUNTS": "Ausgewählte E-Mail-Konten", "SELECTED_MAILQUEUES": "Ausgewählte Chat-Warteschlangen", - "SELECTED_OPENCHANNELACCOUNTS": "Ausgewählte offene Channel-Konten", - "SELECTED_OPENCHANNELQUEUES": "Ausgewählte offene Kanalwarteschlangen", - "SELECTED_PROJECTS": "Ausgewählte Projekte von Cally Square", + "SELECTED_OPENCHANNELACCOUNTS": "Ausgewählte offener Kanal-Konten", + "SELECTED_OPENCHANNELQUEUES": "Ausgewählte offener Kanal-Warteschlangen", + "SELECTED_PROJECTS": "Ausgewählte CallySquare-Projekte", "SELECTED_QUEUECAMPAIGNS": "Ausgewählte Queue-Kampagnen", "SELECTED_SMSACCOUNTS": "Ausgewählte SMS-Konten", "SELECTED_SMSQUEUES": "Ausgewählte SMS-Warteschlangen", "SELECTED_VOICEQUEUES": "Ausgewählte Sprachwarteschlangen", - "USERADD_CHATQUEUES": "Chat-Warteschlange zum Benutzer hinzufügen", - "USERADD_CHATWEBSITES": "Chat-Website zum Benutzer hinzufügen", - "USERADD_FAXACCOUNTS": "Faxkonto zum Benutzer hinzufügen", - "USERADD_FAXQUEUES": "Faxwarteschlange zum Benutzer hinzufügen", - "USERADD_MAILACCOUNTS": "E-Mail-Konto zum Benutzer hinzufügen", - "USERADD_MAILQUEUES": "E-Mail-Warteschlange zum Benutzer hinzufügen", - "USERADD_OPENCHANNELACCOUNTS": "Open Channel-Konto zum Benutzer hinzufügen", - "USERADD_OPENCHANNELQUEUES": "Open Channel-Warteschlange zum Benutzer hinzufügen", - "USERADD_PROJECTS": "Cally Square-Projekt zum Benutzer hinzufügen", - "USERADD_QUEUECAMPAIGNS": "Queue-Kampagne zum Benutzer hinzufügen", - "USERADD_SMSACCOUNTS": "SMS-Konto zum Benutzer hinzufügen", - "USERADD_SMSQUEUES": "SMS-Warteschlange zum Benutzer hinzufügen", - "USERADD_VOICEQUEUES": "Sprachwarteschlange zum Benutzer hinzufügen", - "HOTDESK": "Heißer Schreibtisch", - "ADD_USERPROFILE": "Benutzerprofil hinzufügen", - "CANCEL": "Stornieren", - "CLONE_USERPROFILE": "Benutzerprofil klonen", + "USERADD_CHATQUEUES": "Nutzer hinzufügen (Chat-Warteschlangen)", + "USERADD_CHATWEBSITES": "Nutzer hinzufügen (Chat-Webseiten)", + "USERADD_FAXACCOUNTS": "Nutzer hinzufügen (Faxkonten)", + "USERADD_FAXQUEUES": "Nutzer hinzufügen (Fax-Warteschlangen)", + "USERADD_MAILACCOUNTS": "Nutzer hinzufügen (E-Mail-Konten)", + "USERADD_MAILQUEUES": "Nutzer hinzufügen (E-Mail-Warteschlangen)", + "USERADD_OPENCHANNELACCOUNTS": "Nutzer hinzufügen (offener Kanal-Konten)", + "USERADD_OPENCHANNELQUEUES": "Nutzer hinzufügen (offener Kanal-Warteschlangen)", + "USERADD_PROJECTS": "Nutzer hinzufügen (CallySquare-Projekte)", + "USERADD_QUEUECAMPAIGNS": "Nutzer hinzufügen (Queue-Kampagne)", + "USERADD_SMSACCOUNTS": "Nutzer hinzufügen (SMS-Konten)", + "USERADD_SMSQUEUES": "Nutzer hinzufügen (SMS-Warteschlangen)", + "USERADD_VOICEQUEUES": "Nutzer hinzufügen (Anruf-Warteschlangen)", + "HOTDESK": "Hot-Desk", + "ADD_USERPROFILE": "Nutzerprofil hinzufügen", + "CANCEL": "Abbrechen", + "CLONE_USERPROFILE": "Nutzerprofil klonen", "CLOSE": "Schließen", "CONFIRM": "Bestätigen", "CRUDPERMISSIONS": "Berechtigungsart", "DELETE_PERMISSION": "Löschen", - "DELETE_USERPROFILE": "Benutzerprofil löschen", - "EDIT_PERMISSION": "Bearbeiten", - "EDIT_USERPROFILE": "Benutzerprofil bearbeiten", + "DELETE_USERPROFILE": "Nutzerprofil löschen", + "EDIT_PERMISSION": "Berechtigung bearbeiten", + "EDIT_USERPROFILE": "Nutzerprofil bearbeiten", "MODULES": "Module", - "NEW_USERPROFILE": "Neues Benutzerprofil", + "NEW_USERPROFILE": "Neues Nutzerprofil", "PERMISSIONS_ALL_RESOURCES": "Alle Ressourcen", - "PERMISSIONS_AUTO_ASSOCIATION_INFO": "Ordnen Sie dem Benutzerprofil automatisch alle aktuellen und zukünftigen Ressourcen dieses Abschnitts zu", + "PERMISSIONS_AUTO_ASSOCIATION_INFO": "Automatische Zuordnung aller vorhandenen und zukünftigen Entitäten", "PERMISSIONS_MANAGE": "Verwalten", "PERMISSIONS_PLACEHOLDER_SEARCH": "Suche...", - "PERMISSIONS_SECTION_HIDE": "Abschnitt für den Benutzer ausblenden", - "PERMISSIONS_SECTION_SHOW": "Abschnitt dem Benutzer anzeigen", + "PERMISSIONS_SECTION_HIDE": "Sektion für Nutzer ausblenden", + "PERMISSIONS_SECTION_SHOW": "Sektion für Nutzer einblenden", "PERMISSIONS_SECTION_TITLE": "{{sectionName}} Berechtigungen", "PERMISSIONS_SELECTED_RESOURCES": "Ausgewählte Ressourcen", - "PERMISSIONS_SELECT_REPORT_TYPE": "Wählen Sie den Berichtstyp", - "PERMISSIONS_SELECT_SECTION": "Wählen Sie einen Abschnitt aus", - "PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE": "Sie dürfen nicht auf den ausgewählten Bereich zugreifen", - "PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE": "Unbefugte Handlung", - "PERMISSIONS_WARNING_CLOSE": "Du hast nicht gespeicherte Änderungen. Möchten Sie den Vorgang wirklich ohne Speichern beenden?", - "PERMISSIONS_WARNING_ENABLE_ALL": "Alle {{sectionName}} Unterabschnitte und ihre Ressourcen werden aktiviert. Sind Sie sicher, dass Sie fortfahren möchten?", - "QUEUES_ASSOCIATION": "{{channel}} Queues Association", + "PERMISSIONS_SELECT_REPORT_TYPE": "Typ der ausgewählten Ressource", + "PERMISSIONS_SELECT_SECTION": "Sektion auswählen", + "PERMISSIONS_UNAUTHORIZED_REDIRECT_MESSAGE": "Kein Zugriff auf die ausgewählte Sektion", + "PERMISSIONS_UNAUTHORIZED_REDIRECT_TITLE": "Keine Berechtigung vorhanden", + "PERMISSIONS_WARNING_CLOSE": "Es existieren ungespeicherte Änderungen. Wirklich fortfahren?", + "PERMISSIONS_WARNING_ENABLE_ALL": "Alle {{sectionName}} Sektionen und deren Ressourcen werden aktiviert. Fortfahren?", + "QUEUES_ASSOCIATION": "{{channel}} Warteschlangen-Zuweisung", "READ_PERMISSION": "Lesen", "REPORT_TYPE": "Berichtstyp", - "SECTIONS": "Abschnitte", + "SECTIONS": "Sektionen", "SUMMARY": "Zusammenfassung", - "TEAMS_ASSOCIATION": "Vereinigung der Mannschaften", - "USERPROFILE": "Benutzerprofil", - "USERPROFILES": "Benutzerprofil", - "PERMISSIONS_UNAUTHORIZED_CREATION_MESSAGE": "Sie dürfen die Ressource nicht erstellen", + "TEAMS_ASSOCIATION": "Teamzuweisung", + "USERPROFILE": "Nutzerprofil", + "USERPROFILES": "Nutzerprofil", + "PERMISSIONS_UNAUTHORIZED_CREATION_MESSAGE": "Keine Berechtigung zum Erstellen der Ressource", "VIDEOSUPPORT": "Video-Unterstützung", "APIKEY": "API-Schlüssel", - "APIKEYMANAGER_USER": "API Key Manager", - "GENERATE": "(Regenerieren", - "MANAGE_API_KEY": "API-Schlüsselmanager", + "APIKEYMANAGER_USER": "API Key Manager Nutzer", + "GENERATE": "Generieren", + "MANAGE_API_KEY": "API Key Manager", "REMOVE": "Löschen", - "ENABLEAUTOMATICSCREENRECORDING": "Aktivieren Sie die automatische Bildschirmaufnahme", - "ENABLESCREENRECORDINGBYAGENT": "Aktivieren Sie die Bildschirmaufzeichnung nach Agent", - "ENABLEVIDEOECORDING": "Videoaufnahme aktivieren", + "ENABLEAUTOMATICSCREENRECORDING": "Automatische Bildschirmaufzeichnung aktivieren", + "ENABLESCREENRECORDINGBYAGENT": "Automatische Bildschirmaufzeichnung auf Agentenbasis aktivieren", + "ENABLEVIDEOECORDING": "Videoaufzeichnung aktivieren", "BLOCKED": "Gesperrt", "DISABLED": "Deaktiviert", - "REGENERATE": "Regenerieren", - "ALL_WHATSAPP_QUEUES": "Alle WhatsApp-Warteschlangen", + "REGENERATE": "Erneut generieren", + "ALL_QUEUES_WHATSAPP_INBOUND": "Alle WhatsApp-Warteschlangen", "ALL_WHATSAPPACCOUNTS": "Alle WhatsApp-Konten", - "ALL_WHATSAPPQUEUES": "Alle Whataspp-Warteschlangen", - "ADD_AGENT_TO_WHATSAPP_QUEUES": "Agenten zu WhatsApp-Warteschlangen hinzufügen", - "QUEUEADD_USER_WHATSAPP_INBOUND": "Benutzer zu WhatsApp-Warteschlangen hinzufügen", - "SELECTED_WHATSAPP_QUEUES": "Ausgewählte WhatsApp-Warteschlangen", + "ALL_WHATSAPPQUEUES": "Alle WhatsApp-Warteschlangen", + "QUEUEADD_AGENT_WHATSAPP_INBOUND": "Agenten hinzufügen (WhatsApp-Warteschlangen)", + "QUEUEADD_USER_WHATSAPP_INBOUND": "Nutzer hinzufügen (WhatsApp-Warteschlangen)", + "SELECTED_QUEUES_WHATSAPP_INBOUND": "Ausgewählte WhatsApp-Warteschlangen", "SELECTED_WHATSAPPACCOUNTS": "Ausgewählte WhatsApp-Konten", "SELECTED_WHATSAPPQUEUES": "Ausgewählte WhatsApp-Warteschlangen", - "USERADD_WHATSAPPACCOUNTS": "WhatsApp-Konto zum Benutzer hinzufügen", - "USERADD_WHATSAPPQUEUES": "Fügen Sie dem Benutzer die Whataspp-Warteschlange hinzu", - "WHATSAPP": "WhatsApp Connector", - "WHATSAPPCAPACITY": "WhatsApp Connector-Kapazität", + "USERADD_WHATSAPPACCOUNTS": "Nutzer hinzufügen (WhatsApp-Konten)", + "USERADD_WHATSAPPQUEUES": "Nutzer hinzufügen (WhatsApp-Warteschlangen)", + "WHATSAPP": "WhatsApp", + "WHATSAPPCAPACITY": "Kapazität WhatsApp", "MASK_SENSITIVE_DATA": "Sensitive Daten maskieren", "WSS_PORT": "WSS-Port", "ATTACHMENTS": "Anhänge", - "CALLYSQUARE_RECORDINGS": "Cally Square-Aufnahmen", - "CONTACT_MANAGER_LISTS": "Kontaktmanagerlisten", - "DOWNLOADS": "Downloads", + "CALLYSQUARE_RECORDINGS": "Cally Square-Aufzeichnungen", + "CONTACT_MANAGER_LISTS": "Kontaktmanager-Listen", + "DOWNLOADS": "Download-Berechtigungen", "DOWNLOAD_PERMISSIONS": "Download-Berechtigungen", "JSCRIPTY_SESSIONS": "Jscripty-Sitzungen", "OMNICHANNEL_INTERACTIONS": "Omnichannel-Interaktionen", - "SCREEN_RECORDINGS": "Bildschirmaufnahmen", - "VOICE_RECORDINGS": "Sprachaufnahmen", - "IGNORE_AGENT_BREAK_STATUS_FOR_PREVIEW_CALLS": "Darf Outbound-Preview auch während Pause durchführen", - "SELECT_RECALLME_CAMPAIGN": "Darf Auswahl für Outbound-Kampagne treffen", - "QUEUEADD_AGENT_VOICE_OUTBOUND": "Agent in der Warteschlange Kampagnen hinzufügen", - "QUEUEADD_AGENT_VOICE_INBOUND": "Agent Voice Warteschlangen hinzufügen", - "QUEUEADD_AGENT_CHAT_INBOUND": "Agent zu chatten Warteschlangen hinzufügen", - "QUEUEADD_AGENT_MAIL_INBOUND": "Agent Mail Warteschlangen hinzufügen", - "QUEUEADD_AGENT_SMS_INBOUND": "Agent sms-Warteschlangen hinzufügen", - "QUEUEADD_AGENT_OPENCHANNEL_INBOUND": "Agent zu offenen Kanal Warteschlangen hinzufügen", - "QUEUEADD_AGENT_FAX_INBOUND": "Agent fax Warteschlangen hinzufügen", - "ALL_QUEUES_VOICE_OUTBOUND": "Alle Queue Kampagnen", - "SELECTED_QUEUES_VOICE_OUTBOUND": "Ausgewählte Warteschlange Kampagnen", - "ALL_QUEUES_VOICE_INBOUND": "Alle Warteschlangen", - "SELECTED_QUEUES_VOICE_INBOUND": "Ausgewählte Voice Warteschlangen", - "ALL_QUEUES_CHAT_INBOUND": "Alle Chat Warteschlangen", - "SELECTED_QUEUES_CHAT_INBOUND": "Ausgewählte Chat-warteschlangen", - "ALL_QUEUES_MAIL_INBOUND": "Alle E-Mail-Warteschlangen", - "SELECTED_QUEUES_MAIL_INBOUND": "Ausgewählte Mail Warteschlangen", - "ALL_QUEUES_SMS_INBOUND": "Alle SMS-Warteschlangen", - "SELECTED_QUEUES_SMS_INBOUND": "Ausgewählte SMS-Warteschlangen", - "ALL_QUEUES_OPENCHANNEL_INBOUND": "Alle offenen Kanal Warteschlangen", - "SELECTED_QUEUES_OPENCHANNEL_INBOUND": "Ausgewählten Offenen Kanal Warteschlangen", - "ALL_QUEUES_FAX_INBOUND": "Alle Fax Warteschlangen", - "SELECTED_QUEUES_FAX_INBOUND": "Ausgewählte Fax Warteschlangen", - "ALL_QUEUES_WHATSAPP_INBOUND": "Alle WhatsApp-Warteschlangen", - "QUEUEADD_AGENT_WHATSAPP_INBOUND": "Agent zu WhatsApp-Warteschlangen hinzufügen", - "SELECTED_QUEUES_WHATSAPP_INBOUND": "Ausgewählte WhatsApp-Warteschlangen", + "SCREEN_RECORDINGS": "Bildschirmaufzeichnungen", + "VOICE_RECORDINGS": "Sprachaufzeichnungen", + "ADD_AGENT_TO_CHAT_QUEUES": "Agent zu Chat-Warteschlangen hinzufügen", + "ADD_AGENT_TO_FAX_QUEUES": "Agent zu Faxwarteschlangen hinzufügen", + "ADD_AGENT_TO_MAIL_QUEUES": "Agent zu E-Mail-Warteschlangen hinzufügen", + "ADD_AGENT_TO_OPENCHANNEL_QUEUES": "Agent zu Warteschlangen für offene Kanäle hinzufügen", + "ADD_AGENT_TO_QUEUE_CAMPAIGNS": "Agent zu Warteschlangenkampagnen hinzufügen", + "ADD_AGENT_TO_SMS_QUEUES": "Agent zu SMS-Warteschlangen hinzufügen", + "ADD_AGENT_TO_VOICE_QUEUES": "Agent zu Sprachwarteschlangen hinzufügen", + "ADD_AGENT_TO_WHATSAPP_QUEUES": "Agent zu WhatsApp-Warteschlangen hinzufügen", "AD_SSO_ENABLED": "Active Directory-SSO", + "ALL_CHAT_QUEUES": "Alle Chat-Warteschlangen", + "ALL_FAX_QUEUES": "Alle Faxwarteschlangen", + "ALL_MAIL_QUEUES": "Alle E-Mail-Warteschlangen", + "ALL_OPENCHANNEL_QUEUES": "Alle Open-Channel-Warteschlangen", + "ALL_QUEUE_CAMPAIGNS": "Alle Warteschlangenkampagnen", + "ALL_SMS_QUEUES": "Alle SMS-Warteschlangen", + "ALL_VOICE_QUEUES": "Alle Sprachwarteschlangen", + "ALL_WHATSAPP_QUEUES": "Alle WhatsApp-Warteschlangen", "AUTHENTICATION": "Authentifizierung", - "CLIENT_LOGS": "Kundenprotokolle", - "CLIENT_LOGS_ALL_ENABLED_WARNING": "Achtung: Dies kann die Serverleistung stark beeinträchtigen, wenn viele Agenten gleichzeitig angemeldet sind!", - "CLIENT_LOGS_DISABLED": "Client-Logs sind deaktiviert", - "CLIENT_LOGS_ENABLED": "Client-Logs sind aktiviert", - "CLIENT_LOGS_ENABLED_SINCE": "Aktiviert seit: {{enabledSince}}", - "CLIENT_LOGS_LOGLEVEL": "Protokollebene: {{logLevel}}", - "CLIENT_LOGS_LOGLEVEL_SELECT": "Wählen Sie die Mindestprotokollierungsstufe (Schwere) aus.", - "CLIENT_LOGS_DISABLED_MSG": "Clientprotokolle wurden für Ihren Benutzer deaktiviert", - "CLIENT_LOGS_ENABLED_MSG": "Clientprotokolle wurden für Ihren Benutzer aktiviert", "AUTO_ANSWER": "Automatische Antwort", "CHAT_AUTOANSWER": "Automatische Chat-Antwort", "CHAT_AUTOANSWERDELAY": "Chat-Verzögerung bei automatischer Antwort [s]", + "CLIENT_LOGS": "Client-Protokolle", + "CLIENT_LOGS_ALL_ENABLED_WARNING": "Warnung: Dies könnte die Serverleistung stark beeinträchtigen, wenn viele Agenten gleichzeitig angemeldet sind!", + "CLIENT_LOGS_DISABLED": "Clientprotokolle sind deaktiviert", + "CLIENT_LOGS_DISABLED_MSG": "Clientprotokolle wurden für Ihren Benutzer deaktiviert", + "CLIENT_LOGS_ENABLED": "Clientprotokolle sind aktiviert", + "CLIENT_LOGS_ENABLED_MSG": "Clientprotokolle wurden für Ihren Benutzer aktiviert", + "CLIENT_LOGS_ENABLED_SINCE": "Aktiviert seit: {{enabledSince}}", + "CLIENT_LOGS_LOGLEVEL": "Protokollebene: {{logLevel}}", + "CLIENT_LOGS_LOGLEVEL_SELECT": "Wählen Sie die minimale Protokollierungsebene (Schweregrad)", "EMAIL_AUTOANSWER": "Automatische Antwort per E-Mail", "EMAIL_AUTOANSWERDELAY": "Verzögerung der automatischen E-Mail-Antwort [s]", "FAX_AUTOANSWER": "Automatische Faxantwort", "FAX_AUTOANSWERDELAY": "Automatische Faxantwortverzögerung [s]", + "IGNORE_AGENT_BREAK_STATUS_FOR_PREVIEW_CALLS": "Unterbrechungsstatus des Agenten für Vorschauanrufe ignorieren", "OPENCHANNEL_AUTOANSWER": "Automatische Openchannel-Antwort", "OPENCHANNEL_AUTOANSWERDELAY": "Automatische Antwortverzögerung von Openchannel [s]", + "SELECTED_CHAT_QUEUES": "Ausgewählte Chat-Warteschlangen", + "SELECTED_FAX_QUEUES": "Ausgewählte Faxwarteschlangen", + "SELECTED_MAIL_QUEUES": "Ausgewählte E-Mail-Warteschlangen", + "SELECTED_OPENCHANNEL_QUEUES": "Ausgewählte Open-Channel-Warteschlangen", + "SELECTED_QUEUE_CAMPAIGNS": "Ausgewählte Warteschlangenkampagnen", + "SELECTED_SMS_QUEUES": "Ausgewählte SMS-Warteschlangen", + "SELECTED_VOICE_QUEUES": "Ausgewählte Sprachwarteschlangen", + "SELECTED_WHATSAPP_QUEUES": "Ausgewählte WhatsApp-Warteschlangen", + "SELECT_RECALLME_CAMPAIGN": "Wählen Sie die Kampagne „Rückruf an mich“ aus", "SMS_AUTOANSWER": "Automatische SMS-Antwort", "SMS_AUTOANSWERDELAY": "Automatische SMS-Antwortverzögerung [s]", - "WHATSAPP_AUTOANSWER": "Whatsapp automatische antwort", - "WHATSAPP_AUTOANSWERDELAY": "Whatsapp automatische Antwortverzögerung [s]" + "WHATSAPP_AUTOANSWER": "Whatsapp Connector automatische Antwort", + "WHATSAPP_AUTOANSWERDELAY": "Automatische Antwortverzögerung des Whatsapp-Connectors [s]" } } diff --git a/public/app/main/apps/tools/i18n/de.json b/public/app/main/apps/tools/i18n/de.json index 4904d14..3e75274 100644 --- a/public/app/main/apps/tools/i18n/de.json +++ b/public/app/main/apps/tools/i18n/de.json @@ -1,216 +1,216 @@ { "TOOLS": { - "BOT": "Voicebot", + "BOT": "BOT", "CALL": "Anruf", "NAME": "Name", - "TRUNKS": "Amtsleitungen", - "SEARCH_FOR_ANYONE": "Suche für Jedermann", + "TRUNKS": "SIP-Trunks", + "SEARCH_FOR_ANYONE": "Suche", "ERRORS": { - "NAME_REQUIRED": "Der Name ist erforderlich", - "HOST_REQUIRED": "Der Host wird benötigt", - "DEFAULTUSER_REQUIRED": "Der Standardbenutzer ist erforderlich", - "CALLERID_REQUIRED": "Die Anrufer-ID ist erforderlich", - "KEY_REQUIRED": "Der Schlüssel ist erforderlich", - "CONFIRM_NOT_MATCH": "Die Kennwörter nicht übereinstimmen", - "VALIDITYSTART_REQUIRED": "Die Startzeit ist erforderlich", - "VALIDITYEND_REQUIRED": "Das Ende der Zeit ist erforderlich", - "MONTHDAY_REQUIRED": "Tag des Monats ist erforderlich", - "HOUR_REQUIRED": "Die Stunde ist erforderlich", - "CONTENT_REQUIRED": "Der Inhalt ist erforderlich", - "URL_REQUIRED": "Die URL ist erforderlich", - "URL_MUST_VALID_URL": "Die URL muss gültig sein", - "APPLICATION_REQUIRED": "Die Anwendung ist erforderlich", - "ARGUMENTS_REQUIRED": "Die Argumente sind erforderlich", - "NAME_MUST_VALID_PATTERN": "Der Name muss in einem gültigen Format geschrieben werden", - "POLLING_INTERVAL_REQUIRED": "Das Abfrageintervall ist erforderlich", - "TITLE_REQUIRED": "Der Titel ist erforderlich", - "EMAILADDRESS_REQUIRED": "Die E-Mail Adresse ist erforderlich", - "EVENTVARIABLES_REQUIRED": "Pflichtfeld", - "TYPE_REQUIRED": "Pflichtfeld", - "VALUE_REQUIRED": "Pflichtfeld", - "ACCOUNT_REQUIRED": "Pflichtfeld", - "FIELD_REQUIRED": "Pflichtfeld", - "INTEGRATION_REQUIRED": "Pflichtfeld", - "LIST_REQUIRED": "Pflichtfeld", - "TEMPLATE_REQUIRED": "Pflichtfeld", - "AUTOCREATECONTACT_REQUIRED": "Pflichtfeld", - "OUTBOUNDROUTE_REQUIRED": "Pflichtfeld", - "QUEUE_REQUIRED": "Pflichtfeld", - "TIME_RANGE_TO_REQUIRED": "Pflichtfeld", - "WEEK_DAYS_TO_REQUIRED": "Pflichtfeld", - "MONTH_DAYS_TO_REQUIRED": "Pflichtfeld", - "MONTH_TO_REQUIRED": "Pflichtfeld", - "TIME_RANGE_FROM_INVALID": "Falsches Format", - "TIME_RANGE_TO_INVALID": "Falsches Format", + "NAME_REQUIRED": "Name erforderlich", + "HOST_REQUIRED": "Host erforderlich", + "DEFAULTUSER_REQUIRED": "Standardnutzer erforderlich", + "CALLERID_REQUIRED": "Anrufer-ID erforderlich", + "KEY_REQUIRED": "Schlüssel erforderlich", + "CONFIRM_NOT_MATCH": "Die Passwörter stimmen nicht überein", + "VALIDITYSTART_REQUIRED": "Startzeit erforderlich", + "VALIDITYEND_REQUIRED": "Endzeit erforderlich", + "MONTHDAY_REQUIRED": "Tag des Monats erforderlich", + "HOUR_REQUIRED": "Stunde erforderlich", + "CONTENT_REQUIRED": "Inhalt erforderlich", + "URL_REQUIRED": "URL erforderlich", + "URL_MUST_VALID_URL": "Ungültiges Format URL", + "APPLICATION_REQUIRED": "Anwendung erforderlich", + "ARGUMENTS_REQUIRED": "Argumente erforderlich", + "NAME_MUST_VALID_PATTERN": "Der Name muss einem gültigen Pattern entsprechen", + "POLLING_INTERVAL_REQUIRED": "Abfrageintervall erforderlich", + "TITLE_REQUIRED": "Titel erforderlich", + "EMAILADDRESS_REQUIRED": "E-Mail erforderlich", + "EVENTVARIABLES_REQUIRED": "Event-Variablen erforderlich", + "TYPE_REQUIRED": "Typ erforderlich", + "VALUE_REQUIRED": "Wert erforderlich", + "ACCOUNT_REQUIRED": "Konto erforderlich", + "FIELD_REQUIRED": "Feld erforderlich", + "INTEGRATION_REQUIRED": "Integration erforderlich", + "LIST_REQUIRED": "Liste erforderlich", + "TEMPLATE_REQUIRED": "Vorlage erforderlich", + "AUTOCREATECONTACT_REQUIRED": "Autom. Kontaktgenerierung erforderlich", + "OUTBOUNDROUTE_REQUIRED": "Ausgehende Route erforderlich", + "QUEUE_REQUIRED": "Warteschlange erforderlich", + "TIME_RANGE_TO_REQUIRED": "Zeitintervall erforderlich", + "WEEK_DAYS_TO_REQUIRED": "Wochentage erforderlich", + "MONTH_DAYS_TO_REQUIRED": "Tage im Monat erforderlich", + "MONTH_TO_REQUIRED": "Monat erforderlich", + "TIME_RANGE_FROM_INVALID": "Format ungültig Zeitintervall", + "TIME_RANGE_TO_INVALID": "Format ungültig Zeitintervall", + "ACTION_REQUIRED": "Aktion erforderlich", + "CONFIGURATION_REQUIRED": "Konfiguration erforderlich", + "PROJECT_REQUIRED": "Projekt erforderlich", + "LOCATION_REQUIRED": "Standort erforderlich", + "FONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Schriftgröße muss kleiner oder gleich sein als", + "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Schriftgröße muss größer oder gleich sein als", + "FONTSIZE_REQUIRED": "Schriftgröße erforderlich", + "PATH_REQUIRED": "Pfad erforderlich", + "FORMAT_REQUIRED": "Format erforderlich", + "REPORT_REQUIRED": "Report erforderlich", + "REFRESH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", + "REFRESH_REQUIRED": "Zeitüberschreitung erforderlich", + "TITLE_MAX_LENGTH": "Titel darf eine maximale Länge von {{max}} haben", + "NAME_MAX_LENGTH": "Wert darf eine maximale Länge von {{max}} haben", + "OUTPUT_REQUIRED": "Ausgabe erforderlich", + "REPORTFOLDER_REQUIRED": "Ordner für Report erforderlich", + "REPORTSUBFOLDER_REQUIRED": "Unterordner für Report erforderlich", + "REPORTTYPE_REQUIRED": "Report-Typ erforderlich", + "AGENT_REQUIRED": "Agent erforderlich", + "INFO_REQUIRED": "Information erforderlich", + "SCRIPT_REQUIRED": "Skript erforderlich", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss kleiner oder gleich sein als", + "TIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", + "AUTOCREATE_FIELD_REQUIRED": "Autom. Felderstellung erforderlich", "CHANNEL_REQUIRED": "Pflichtfeld", - "ACTION_REQUIRED": "Pflichtfeld", - "CONFIGURATION_REQUIRED": "Pflichtfeld", - "PROJECT_REQUIRED": "Pflichtfeld", - "LOCATION_REQUIRED": "Pflichtfeld", - "FONTSIZE_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "FONTSIZE_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "FONTSIZE_REQUIRED": "Pflichtfeld", - "PATH_REQUIRED": "Pflichtfeld", - "FORMAT_REQUIRED": "Pflichtfeld", - "REPORT_REQUIRED": "Pflichtfeld", - "REFRESH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "REFRESH_REQUIRED": "Pflichtfeld", - "TITLE_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", - "NAME_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", - "OUTPUT_REQUIRED": "Pflichtfeld", - "REPORTFOLDER_REQUIRED": "Pflichtfeld", - "REPORTSUBFOLDER_REQUIRED": "Pflichtfeld", - "REPORTTYPE_REQUIRED": "Pflichtfeld", - "AGENT_REQUIRED": "Pflichtfeld", - "INFO_REQUIRED": "Pflichtfeld", - "SCRIPT_REQUIRED": "Pflichtfeld", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "TIMEOUT_REQUIRED": "Pflichtfeld", - "AUTOCREATE_FIELD_REQUIRED": "Pflichtfeld", - "IGNOREDIALERCONTACTID_REQUIRED": "KontaktID erforderlich" + "IGNOREDIALERCONTACTID_REQUIRED": "Das Feld „Dialer-Kontakt-ID ignorieren“ ist erforderlich" }, "HOST": "Host", - "SECRET": "Geheimnis", - "DEFAULTUSER": "Default User", + "SECRET": "Secret", + "DEFAULTUSER": "Standardnutzer", "DESCRIPTION": "Beschreibung", - "ADD_TRUNK": "Amtsleitung hinzufügen", + "ADD_TRUNK": "SIP-Trunk hinzufügen", "HELP": { - "SECRET": "Kennwort für die Authentifizierung, wenden Sie sich an den Anbieter.", - "HOST": "Die Domäne oder den Hostnamen für den Anbieter.", - "DEFAULTUSER": "Authentifizierung Benutzernamen, wenden Sie sich an den Anbieter.", - "CALLERID": "Die Anrufer-ID im Format \"name\" .", - "REGISTRY": "Die amtsleitung Registry, die von einigen Anbietern, die in der Regel defaultuser:Secret@host.", - "FROMDOMAIN": "Legt Standardeinstellungen von:domain in SIP-Nachrichten als SIP-ua (Client). Einige Ziele können die obligatorische Identität Name anstatt nur die IP-Adresse.", - "FROMUSER": "Rovider wie ihr sie kennt. Dies ist der Benutzer, um anstelle der Anrufer-ID beim Tätigen von Anrufen zu anderen Peer (SIP-Proxy). Nur gültig für den Typ=peer.", - "OUTBOUNDPROXY": "IP-Adresse oder DNS-SRV-Ressourceneintrag name (ausgenommen die _sip._udp-Präfix): SRV Name, den Hostnamen oder die IP-Adresse des ausgehenden SIP-Proxy. Senden Sie ausgehende Signale zu diesem Proxy und nicht direkt an die Geräte. Nur gültig für den Typ=peer.", - "PORT": "Die Nummer des Ports, zu dem Sie eine Verbindung herstellen möchten wir auf der anderen Seite.", - "CONTEXT": "Die nutzbaren Rahmen für den Trunk.", - "TYPE": "Legt das SIP-Rolle innerhalb der Sternchen. User: Wird verwendet, um die Authentifizierung für eingehende - Peer: für ausgehende Anrufe - Freund: Deckt sowohl die Eigenschaften der oben genannten.", - "DTMFMODE": "Wie DTMF (Dual-Tone Multi-Frequency): RFC2833: Die Standardeinstellung, die DTMF gesendet mit RTP, aber außerhalb der Audio Stream. INBAND DTMF gesendet wird: Die in der Audio Stream des aktuellen Gesprächs, wird über die Lautsprecher hörbar. Erfordert eine hohe CPU-Last. INFO: Diese Methode ist zwar sehr zuverlässig, es ist nicht für alle TK-Anlagen und viele SIP-Trunk.", - "NAT": "Ändert das Verhalten von Sternchen für Clients hinter einer Firewall.Wenn der Komma-getrennten Optionen ist \"Nein\", Asterisk ignoriert alle anderen Einstellungen und die nat=No.", - "QUALIFY": "Legt fest, wann die SIP erreichbar ist.", - "ALLOWCODECS": "Erlaubt Codecs in der Reihenfolge ihrer Präferenz.", - "INSECURE": "Legt fest, wie Verbindungen mit Peer, dass unsichere Einstellungen.", - "CALL_LIMIT": "Die Anzahl der eingehenden und abgehenden Anrufe, die zu einer Zeit.", - "DIRECTMEDIA": "Sternchen standardmäßig versucht, die RTP-Stream direkt aus den Anrufer an den Angerufenen. Einige Geräte werden nicht unterstützt wird (vor allem, wenn einer von Ihnen hinter einem NAT-Gerät befindet). Die Standardeinstellung ist Ja. Wenn Sie alle Clients hinter einem NAT-Gerät befindet, oder aus einem anderen Grund nicht möchten, dass Sternchen in der Audiospur, können Sie diese ausschalten.", - "CALLCOUNTER": "Aktivieren Sie die Zähler auf Geräte.", - "ADD_PHONE_TO_URI": "Legen Sie fest, ob die Provider ';user=Telefon\" an den URL.", + "SECRET": "Kennwort für Authentifizierung", + "HOST": "Client-IP oder Hostname", + "DEFAULTUSER": "Standardnutzer für die Authentifizierung", + "CALLERID": "Anrufer-ID im Format \"name\" .", + "REGISTRY": "SIP-Registry", + "FROMDOMAIN": "Domäne FROM", + "FROMUSER": "Nutzer FROM. Nur gültig für den Typ=peer.", + "OUTBOUNDPROXY": "Proxy für ausgehende Anrufe", + "PORT": "Port der Gegenstelle, zu welcher die Verbindung aufgebaut werden soll", + "CONTEXT": "Kontext für Kommunikation", + "TYPE": "Authentifizierung innerhalb des Telefonieservers. User: Auth. für eingehende Kommunikation - Peer: Auth. für ausgehende Kommunikation - Friend: beide Richtungen", + "DTMFMODE": "Senden der DTMF-Töne (Dual-Tone Multi-Frequency): RFC2833", + "NAT": "Passt das Verhalten des Telefonieservers hinter einer Firewall an", + "QUALIFY": "Erreichbarkeit des Servers", + "ALLOWCODECS": "Erlaubte Audio-Codecs in der ausgewählten Reihenfolge", + "INSECURE": "Sicherheitsprüfung", + "CALL_LIMIT": "Maximale simultane Anrufe (Ein/Ausgehend)", + "DIRECTMEDIA": "Direct-Media Unterstützung", + "CALLCOUNTER": "Aktivieren des Anrufzählers pro Gerät", + "ADD_PHONE_TO_URI": "Fügt die Telefonnummer des Nutzers zu einer URL: ';user=Telefon\" ", "TRUST_REMOTE_PARTY_ID": "Wenn Remote-Party-ID definieren sollte.", "SEND_REMOTE_PARTY_ID_HEADER": "Status", - "ENCRYPTION": "Festlegen, ob die Remote-Party-ID gesendet werden soll (standardmäßig auf Nein).", - "TRANSPORT": "Festlegen der Standardeinstellungen für Transporte. Die Reihenfolge bestimmt den primären Standard.", - "OTHERFIELDS": "Weitere Felder hinzufügen, in der Amtsleitungen conf-Dateien. In Sternchen format (key=value), jedes Feld auf einer Zeile.", - "EMAILADDRESS": "Sie können mehrere Adressen mit Kommata (z. b. John.doe@xcally.com, jane.miller@xcally.com)", + "ENCRYPTION": "Verschlüsselung", + "TRANSPORT": "Definiert die Reihenfolge der verwendeten Transport-Protokolle", + "OTHERFIELDS": "Weitere Felder aus der SIP-Konfiguration hinzufügen", + "EMAILADDRESS": "Mehrere Adressen können mit Komma getrennt werden. Bsp: ab@de.com, de@fg.com", "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", - "EVENTVARIABLES": "Wenn aktiviert, Es fügt alle Event Variablen an die Url", - "T38PT_UDPTL": "Es: Ja, Redundanz, maxdatagram = 400", - "EMAILBCCADDRESS": "Fügen Sie eine oder mehrere durch Kommas getrennte Adressen hinzu (z. B. john.doe@xcally.com, jane.miller@xcally.com).", - "EMAILCCADDRESS": "Fügen Sie eine oder mehrere durch Kommas getrennte Adressen hinzu (z. B. john.doe@xcally.com, jane.miller@xcally.com).", + "EVENTVARIABLES": "Fügt Event-Variablen der URL hinzu", + "T38PT_UDPTL": "maxdatagram = 400", + "EMAILBCCADDRESS": "Mehrere Adressen können mit Komma getrennt werden. Bsp: ab@de.com, de@fg.com", + "EMAILCCADDRESS": "Mehrere Adressen können mit Komma getrennt werden. Bsp: ab@de.com, de@fg.com", "BODY": "Wenn nicht ausgefüllt, wird der Standardwert gesendet", "INFO": "Titel einfügen", "SCRIPT": "Skript einfügen", - "SCRIPT_INFO": "Fügen Sie eine Beschreibung für das Skript ein", - "SCRIPT_TYPE": "Geben Sie eine Typologie für das Skript ein (zB curl, bash ...)", + "SCRIPT_INFO": "Informationen zum Skript", + "SCRIPT_TYPE": "Skript-Typ (zB. curl, bash ...)", + "HEADERS": "Hinweis: Der Header-Abschnitt muss im RAW-JSON-Format {\"key\": \"value\"} vorliegen", + "TIMEOUT": "Zeitüberschreitung in Sekunden. Der Wert muss zwischen 1 und 10 liegen. Standardwert = 5.", "MANAGED": "Die Gesamtzahl der abgeschlossenen Interaktionen", - "OPENED": "Die Gesamtzahl der aktiven Interaktionen", - "HEADERS": "Hinweis: Der Header-Abschnitt muss im RAW-JSON-Format {\"key\": \"value\"} vorliegen.\nHinweis: Wenn nicht ausgefüllt, wird der Standardwert gesendet", - "TIMEOUT": "Zeitüberschreitung in Sekunden anfordern. Der Wert muss zwischen 1 und 10 liegen und der Standardwert ist 5." + "OPENED": "Die Gesamtzahl der aktiven Interaktionen" }, - "EDIT_TRUNK": "Trunk bearbeiten", - "DELETE_TRUNK": "Löschen Sie Trunk", + "EDIT_TRUNK": "SIP-Trunk bearbeiten", + "DELETE_TRUNK": "SIP-Trunk löschen", "CREATED_AT": "Erstellt am", "SETTINGS": "Einstellungen", - "ADVANCED": "Erweiterte", - "OTHER": "Andere", + "ADVANCED": "Erweitert", + "OTHER": "Weitere", "ACTIVE": "Aktiv", "CONTEXT": "Kontext", - "CALLERID": "Die Anrufer-ID", + "CALLERID": "Anrufer-ID (CallerID)", "TYPE": "Typ", - "DTMFMODE": "Mfv-Modus", + "DTMFMODE": "DTMF-Modus", "NAT": "NAT", "QUALIFY": "Qualifizieren", - "ALLOWCODECS": "Codecs erlaubt", + "ALLOWCODECS": "Erlaubte Codecs", "INSECURE": "Unsicher", "REGISTRY": "Registrierung", - "DIRECTMEDIA": "Direkte Medien", + "DIRECTMEDIA": "Direct Media", "CALLCOUNTER": "Anrufzähler", - "FROMDOMAIN": "Aus der Domäne", - "FROMUSER": "Vom Benutzer", + "FROMDOMAIN": "FROM-Domain", + "FROMUSER": "FROM-User", "OUTBOUNDPROXY": "Ausgehender Proxy", - "ADD_PHONE_TO_URI": "Telefon hinzufügen, URL", - "TRUST_REMOTE_PARTY_ID": "Vertrauen Gegenstelle ID", - "SEND_REMOTE_PARTY_ID_HEADER": "Senden einer Partner-ID Header", + "ADD_PHONE_TO_URI": "Telefonnummer an URL hängen", + "TRUST_REMOTE_PARTY_ID": "ID der Gegenstelle", + "SEND_REMOTE_PARTY_ID_HEADER": "Header an Gegenstelle senden", "ENCRYPTION": "Verschlüsselung", - "PORT": "Hafen", - "TRANSPORT": "Verkehr", + "PORT": "Port", + "TRANSPORT": "Transport", "SAVE": "Speichern", "VARIABLES": "Variablen", "ADD_VARIABLE": "Variable hinzufügen", "EDIT_VARIABLE": "Variable bearbeiten", "DELETE_VARIABLE": "Variable löschen", - "SELECTED": "Ausgewählte", - "SELECT_ALL": "Alle auswählen", - "SELECT_NONE": "Wählen Sie \"Keine\"", + "SELECTED": "Ausgewählt", + "SELECT_ALL": "Alles auswählen", + "SELECT_NONE": "Nichts auswählen", "TAGS": "Tags", - "ADD_TAG": "Variable hinzufügen", - "EDIT_TAG": "Variable bearbeiten", - "DELETE_TAG": "Variable löschen", - "PAUSES": "Pausen", - "ADD_PAUSE": "Pause hinzufügen", - "EDIT_PAUSE": "Pause bearbeiten", - "DELETE_PAUSE": "Pause löschen", + "ADD_TAG": "Tag hinzufügen", + "EDIT_TAG": "Tag bearbeiten", + "DELETE_TAG": "Tag löschen", + "PAUSES": "Agentenstatus", + "ADD_PAUSE": "Agentenstatus hinzufügen", + "EDIT_PAUSE": "Agentenstatus bearbeiten", + "DELETE_PAUSE": "Agentenstatus löschen", "ADD_CANNEDANSWER": "Vordefinierte Antwort hinzufügen", "EDIT_CANNEDANSWER": "Vordefinierte Antwort bearbeiten", "DELETE_CANNEDANSWER": "Vordefinierte Antwort löschen", "KEY": "Schlüssel", "VALUE": "Wert", - "SOUNDS": "Sounds", - "EDIT_SOUND": "Ton bearbeiten", - "DELETE_SOUND": "Sound löschen", - "FINISH": "Fertig stellen", + "SOUNDS": "Audiodateien", + "EDIT_SOUND": "Audio bearbeiten", + "DELETE_SOUND": "Audio löschen", + "FINISH": "Beenden", "DROP_TO_UPLOAD": "Drop hochladen", "TRIGGERS": "Trigger", - "EDIT_TRIGGER": "Auslöser bearbeiten", - "DELETE_TRIGGER": "Auslöser löschen", + "EDIT_TRIGGER": "Trigger bearbeiten", + "DELETE_TRIGGER": "Trigger löschen", "ADD_TRIGGER": "Trigger hinzufügen", "DELETE": "Löschen", - "AUTOMATIONS": "Automatisierungen", - "EDIT_AUTOMATION": "Bearbeiten einer Automation", + "AUTOMATIONS": "Automation", + "EDIT_AUTOMATION": "Automation bearbeiten", "DELETE_AUTOMATION": "Automation löschen", "ADD_AUTOMATION": "Automation hinzufügen", - "INTERVALS": "Intervalle", - "EDIT_INTERVAL": "Intervall bearbeiten", - "DELETE_INTERVAL": "Intervall für Löschen.", - "ADD_INTERVAL": "Intervall hinzufügen", - "TOOLS": "Werkzeuge", - "ID": "Id", + "INTERVALS": "Zeitintervalle", + "EDIT_INTERVAL": "Zeitintervall bearbeiten", + "DELETE_INTERVAL": "Zeitintervall Löschen.", + "ADD_INTERVAL": "Zeitintervall hinzufügen", + "TOOLS": "WERKZEUGE", + "ID": "ID", "AUDIO": "Audio", - "DOWNLOAD_SOUND": "Download Sound", - "UPLOAD_SOUND": "Werkzeuge", + "DOWNLOAD_SOUND": "Audiodatei herunterladen", + "UPLOAD_SOUND": "Audiodatei hochladen", "CHANNEL": "Kanal", - "NEW_TRIGGER": "Neue Trigger", + "NEW_TRIGGER": "Neuer Trigger", "GENERAL": "Allgemein", "STATUS": "Status", "CONDITIONS&ACTIONS": "Bedingungen und Aktionen", - "ALLCONDITIONS": "Alle diese Bedingungen erfüllen:", - "ANYCONDITIONS": "Treffen diese Voraussetzungen:", + "ALLCONDITIONS": "Alle Bedingungen erfüllen:", + "ANYCONDITIONS": "Einige Bedingungen erfüllen:", "ACTIONS": "Aktionen:", "NEW_AUTOMATION": "Neue Automation", - "TIMEOUT": "Timeout", + "TIMEOUT": "Zeitüberschreitung", "PEERSTATUS": "Peer Status", - "CALL_LIMIT": "Anrufe beschränken", - "OTHERFIELDS": "Andere Felder", + "CALL_LIMIT": "Anrufe limitieren", + "OTHERFIELDS": "Weitere Felder", "NEW_VARIABLE": "Neue Variable", "NEW_TAG": "Neuer Tag", - "NEW_PAUSE": "Neue Pause", + "NEW_PAUSE": "Neuer Agentenstatus", "NEW_CANNEDANSWER": "Neue vordefinierte Antwort", "CONFIRM_PASSWORD": "Passwort bestätigen", - "NEW_TRUNK": "Neue Leitung", + "NEW_TRUNK": "Neuer SIP-Trunk", "FROM": "Von", - "TO": "Zu", - "WEEKDAY": "Woche Tag", - "MONTHDAY": "Monat Tag", + "TO": "Bis", + "WEEKDAY": "Wochentag", + "MONTHDAY": "Monatstag", "MONTH": "Monat", "ALWAYS": "Immer", "MON": "Montag", @@ -233,38 +233,38 @@ "NOV": "November", "DEC": "Dezember", "PASSWORD": "Passwort", - "CUSTOMDASHBOARDS": "Benutzerdefinierte Dashboards", - "NEW_CUSTOMDASHBOARD": "Neues benutzerdefiniertes Dashboard", - "ADD_CUSTOMDASHBOARD": "Hinzufügen von benutzerdefinierten Dashboard", - "EDIT_CUSTOMDASHBOARD": "Benutzerdefinierte Dashboards bearbeiten", - "DELETE_CUSTOMDASHBOARD": "Benutzerdefiniertes Dashboard löschen.", - "SCHEDULER": "Scheduler", - "NEW_SCHEDULE": "Neuer Zeitplan", - "ADD_SCHEDULE": "Zeitplan hinzufügen", - "EDIT_SCHEDULE": "Zeitplan bearbeiten", - "DELETE_SCHEDULE": "Zeitplan löschen", + "CUSTOMDASHBOARDS": "Benutzerdef. Dashboards", + "NEW_CUSTOMDASHBOARD": "Neues benutzerdef. Dashboard", + "ADD_CUSTOMDASHBOARD": "Benutzerdef. Dashboard hinzufügen", + "EDIT_CUSTOMDASHBOARD": "Benutzerdef. Dashboard bearbeiten", + "DELETE_CUSTOMDASHBOARD": "Benutzerdef. Dashboard löschen", + "SCHEDULER": "Berichtsplanung", + "NEW_SCHEDULE": "Neue Zeitplanung", + "ADD_SCHEDULE": "Zeitplanung hinzufügen", + "EDIT_SCHEDULE": "Zeitplanung bearbeiten", + "DELETE_SCHEDULE": "Zeitplanung löschen", "SENDMAIL": "E-Mail senden", "CONFIGURATION": "Konfiguration", "MAIL": "E-Mail", "REPORTTYPE": "Berichtstyp", "REPORT": "Bericht", - "OUTPUT": "Ausgang", - "EXECUTEON": "Ausführung", + "OUTPUT": "Ausgabeformat", + "EXECUTEON": "Ausführen am", "REPORTRANGE": "Berichtsbereich", "VALIDITYSTART": "Startzeit", "VALIDITYEND": "Endzeit", - "EXECUTEEVERY": "Alle ausführen", + "EXECUTEEVERY": "Ausführen jede(n)", "ACCOUNT": "Konto", "EMAILADDRESS": "E-Mail Adresse", - "CURRENTDAY": "Aktueller Tag", + "CURRENTDAY": "Heute", "DAILY": "Täglich", "WEEKLY": "Wöchentlich", "MONTHLY": "Monatlich", "PREVIOUS_DAY": "Vorheriger Tag", - "LAST_SEVEN_DAYS": "Letzte sieben Tage", - "LAST_THIRTY_DAYS": "33 verbotenen letzte Tage", + "LAST_SEVEN_DAYS": "Letzte 7 Tage", + "LAST_THIRTY_DAYS": "Letzte 30 Tage", "LAST_MONTH": "Letzter Monat", - "WEEKDAYS": "Woche Tage", + "WEEKDAYS": "Wochentage", "HOUR": "Stunde", "DEFAULT": "Standard", "CSV": "CSV", @@ -283,8 +283,8 @@ "ADD_TEMPLATE": "Vorlage hinzufügen", "CONTENT": "Inhalt", "FIELD": "Feld", - "NO_ANYCONDITION_AVAILABLE": "Keine Bedingungen verfügbar", - "NO_ALLCONDITION_AVAILABLE": "Keine Bedingungen verfügbar", + "NO_ANYCONDITION_AVAILABLE": "Keine Bedingungen vorhanden", + "NO_ALLCONDITION_AVAILABLE": "Keine Bedingungen vorhanden", "NO_ACTION_AVAILABLE": "Keine Aktionen verfügbar", "ACTION": "Aktion", "EDIT_ANYCONDITION": "Bedingung bearbeiten", @@ -297,184 +297,183 @@ "ADD_ALLCONDITION": "Bedingung hinzufügen", "EDIT_ACTION": "Aktion bearbeiten", "DELETE_ACTION": "Aktion löschen", - "NEW_ACTION": "Neue Maßnahme", + "NEW_ACTION": "Neue Aktion", "ADD_ACTION": "Aktion hinzufügen", "QUEUE": "Warteschlange", "CALL_STATUS": "Anrufstatus", "OUTBOUNDROUTE": "Abgehende Routen", - "EQUALS": "Ist gleich", - "NOT_EQUALS": "Nicht gleich", - "CONTACT_MANAGER": "Contacts Manager", + "EQUALS": "Entspricht", + "NOT_EQUALS": "Entspricht nicht", + "CONTACT_MANAGER": "Kontaktmanager", "INTEGRATIONS": "Integrationen", - "MOTIONBAR": "Motion Bar", + "MOTIONBAR": "MotionBar", "JSCRIPTY": "Jscripty", "URL_FORWARD": "URL Weiterleitung", - "WEB_POPUP": "Web Popup", + "WEB_POPUP": "Web-Popup", "LIST": "Liste", "INTEGRATION": "Integration", "TEMPLATE": "Vorlage", "URL": "URL", "APPLICATION": "Anwendung", "ARGUMENTS": "Argumente", - "NO_APPS_AVAILABLE": "Keine Anwendungen verfügbar", - "NEW_INTERVAL": "Neues Intervall", - "OPERATOR": "Betreiber", - "NO_INTERVALS_AVAILABLE": "Keine Intervalle zur Verfügung", + "NO_APPS_AVAILABLE": "Keine Anwendungen vorhanden", + "NEW_INTERVAL": "Neues Zeitintervall", + "OPERATOR": "Operator", + "NO_INTERVALS_AVAILABLE": "Keine Zeitintervalle vorhanden", "YES": "Ja", - "NO": "Keine", + "NO": "Nein", "SUBJECT": "Betreff", - "NO_AVAILABLE_INFO": "Keine verfügbaren Info", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", "BROWSER": "Browser", - "INTERVAL": "Intervall", - "INFO": "Info", + "INTERVAL": "Zeitintervall", + "INFO": "Information", "TIME_RANGE": "Zeitbereich", - "WEEK_DAYS": "Woche Tage", - "MONTH_DAYS": "Monat Tage", + "WEEK_DAYS": "Wochentage", + "MONTH_DAYS": "Monatstage", "MONTHS": "Monate", - "DROP_TO_UPLOAD_MESSAGE": "Sie können auch Audiodateien hier ablegen\" hochzuladen. Nur MP3-, WAV-, GSM-Max. 15 MB", + "DROP_TO_UPLOAD_MESSAGE": "Audiodatei hier hinein ziehen für Upload. Unterstützte Formate: .mp3, .wav (8bit/8kHz/Mono), .gsm, Max. 15 MB", "POLLING_INTERVAL": "Abfrageintervall (Sekunden)", - "DASHBOARD": "Armaturenbrett", - "NEW_DASHBOARDITEM": "Neue Dashboard Widget", + "DASHBOARD": "Dashboard", + "NEW_DASHBOARDITEM": "Neues Dashboard Widget", "COUNTER": "Zähler", "IFRAME": "IFrame", "CLOCK": "Uhr", "ADD_DASHBOARDITEM": "Dashboard Widget hinzufügen", - "EDIT_WIDGET": "Bearbeiten Widget", - "DELETE_WIDGET": "Löschen Widget", - "FLIP_WIDGET": "Flip Widget", + "EDIT_WIDGET": "Widget bearbeiten", + "DELETE_WIDGET": "Widget löschen", + "FLIP_WIDGET": "Widget drehen", "TITLE": "Titel", "UPDATE": "Aktualisieren", "LAYOUT": "Layout", "BACKGROUND_COLOR": "Hintergrundfarbe", "FOREGROUND_COLOR": "Vordergrundfarbe", - "FOREGROUND_TITLE_COLOR": "Vordergrund Titel Farbe", - "THEME": "Thema", - "LIGHT": "Licht", + "FOREGROUND_TITLE_COLOR": "Titelfarbe", + "THEME": "Design", + "LIGHT": "Hell", "DARK": "Dunkel", "TIMEZONE": "Zeitzone", - "DIGITAL_FORMAT": "Digitale Datum Format", - "TOOLS_QUERY": "Abfrage", - "SELECT": "Wählen Sie", - "WHERE": "Wo", + "DIGITAL_FORMAT": "Format Datum", + "TOOLS_QUERY": "SQL-Query", + "SELECT": "SELECT", + "WHERE": "WHERE", "BACK": "Zurück", "PROJECT": "Projekt", - "GOTOREALTIME_TRUNK": "In Echtzeit, Trunk gehen", - "GOTO_TRUNK": "Um die Leitungsbündel gehen", - "CRON": "Cron", + "GOTOREALTIME_TRUNK": "Direkt zur Echtzeit-Ansicht", + "GOTO_TRUNK": "Direkt zum SIP-Trunk", + "CRON": "Automatische Verarbeitung", "MINUTES": "Minuten", "HOURLY": "Stündlich", "YEARLY": "Jährlich", "EVERY": "Jede", "MINUTE": "Minute", - "ON_SECOND": "Im 2.", - "HOUR_ON_MINUTE": "Stunde Minute", - "AND_SECOND": "Und 2.", - "DAY_AT": "Tag an", + "ON_SECOND": "Sekunde", + "HOUR_ON_MINUTE": "Minute zur Stunde", + "AND_SECOND": "und Sekunde", + "DAY_AT": "Am Tag", "START_TIME": "Startzeit", - "ON_THE": "Auf der", - "OF_EVERY": "Jedes", + "ON_THE": "am", + "OF_EVERY": "jede(n)", "MONTH_AT": "Monat", - "AT": "An", + "AT": "Um", "LAST": "Letzte", "LASTUNIT": "Einheit", "MAILACCOUNT": "E-Mail Konto", - "OF": "Von", + "OF": "von", "PAST_THE_HOUR": "Nach der vollen Stunde", "DAY": "Tag", "WEEK": "Woche", "YEAR": "Jahr", - "ON": "Auf", + "ON": "am", "PAI": "P-Asserted-Identity", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OUTBOUND_ROUTE": "Abgehende Routen", - "EVENTVARIABLES": "Bei Variablen", + "OUTBOUND_ROUTE": "Ausgehende Routen", + "EVENTVARIABLES": "Event-Variablen", "FAX": "Fax", "INTERACTION": "Interaktion", "MESSAGE": "Nachricht", "T38PT_UDPTL": "T38 pt Udptl", - "AUTOCREATECONTACT": "Erstellen Sie automatisch", + "AUTOCREATECONTACT": "Automatische Kontakterstellung", "COLOR": "Farbe", - "LOCATION": "Lage", - "NEW_TAB": "Neue Registerkarte", + "LOCATION": "Standort", + "NEW_TAB": "Neuer Tab", "NEW_WINDOW": "Neues Fenster", "WINDOWWIDTH": "Fenster Breite (px)", "WINDOWHEIGHT": "Fensterhöhe (px)", - "EDIT_DASHBOARDITEM": "Dashboard-Widget bearbeiten", + "EDIT_DASHBOARDITEM": "Widget bearbeiten", "FONTSIZE": "Schriftgröße", - "CLONE_CUSTOMDASHBOARD": "Benutzerdefiniertes Dashboard klonen", + "CLONE_CUSTOMDASHBOARD": "Benutzerdef. Dashboard klonen", "LINK": "Link [https: //]", "BACKGROUND": "Hintergrund", "FOREGROUND": "Vordergrund", - "NONE": "Keiner", + "NONE": "Nichts", "TOTAL": "Gesamt", "ABANDONED": "Verlassen", - "WAITING": "Warten", - "TALKING": "Reden", - "ANSWERED": "Antwortete", - "UNMANAGED": "Nicht verwaltet", + "WAITING": "Wartezustand", + "TALKING": "im Gespräch", + "ANSWERED": "Beantwortet", + "UNMANAGED": "Nicht bearbeitet", "CUSTOMTYPE": "Benutzerdefiniert [Pfad]", - "WEBREPORT": "Webbericht", + "WEBREPORT": "Interner Bericht", "PIECHART": "Kuchendiagramm", "MULTIBARCHART": "Multibar-Diagramm", "MOVE_WIDGET": "Widget verschieben", - "USERADD_CUSTOMDASHBOARD": "Hinzufügen von Benutzerberechtigungen", - "GOTODASHBOARD_CUSTOMDASHBOARD": "Gehe zum Vorschau-Dashboard", - "GOTO_CUSTOMDASHBOARD": "Gehe zum Vorschau-Dashboard", - "METRIC": "Metrisch", - "FILTERVOICEQUEUES": "Voice-Warteschlangen filtern", + "USERADD_CUSTOMDASHBOARD": "Nutzer hinzufügen", + "GOTODASHBOARD_CUSTOMDASHBOARD": "Zum Dashboard gehen", + "GOTO_CUSTOMDASHBOARD": "Vorschau Dashboard", + "METRIC": "Metrik", + "FILTERVOICEQUEUES": "Filter nach Anruf-Warteschlangen", "SERIE1": "Serie 1", "SERIE2": "Serie 2", "SERIE3": "Serie 3", - "REFRESH": "Aktualisieren [s]", + "REFRESH": "Aktualisieren [S]", "FORMAT": "Format", "PATH": "Absoluter Pfad", "ALL_USERS": "Alle Nutzer", - "SELECTED_USERS": "Ausgewählte Benutzer", - "ADD_WIDGET": "Widget hinzufügen", - "NEXTCONTACT": "Nächster", + "SELECTED_USERS": "Ausgewählte Nutzer", + "ADD_WIDGET": "Neues Widget", + "NEXTCONTACT": "Nächster Kontakt", "SENDIFEMPTY": "Senden, wenn leer", - "CANCEL": "Stornieren", + "CANCEL": "Abbrechen", "UPLOADING": "Hochladen", - "EMAILBCCADDRESS": "Bcc", - "EMAILCCADDRESS": "Cc", - "RUN_SCHEDULE": "Zeitplan ausführen", - "ADD_DISPOSITION": "Disposition hinzufügen", - "DELETE_DISPOSITION": "Disposition löschen", - "DISPOSITIONS": "Dispositionen", - "EDIT_DISPOSITION": "Disposition bearbeiten", - "NEW_DISPOSITION": "Neue Disposition", - "CLONE_TRUNK": "Klon-Trunk", - "BODY": "Karosserie", + "EMAILBCCADDRESS": "BCC", + "EMAILCCADDRESS": "CC", + "RUN_SCHEDULE": "Zeitplanung ausführen", + "ADD_DISPOSITION": "Qualifizierung hinzufügen", + "DELETE_DISPOSITION": "Qualifizierung löschen", + "DISPOSITIONS": "Qualifizierungen", + "EDIT_DISPOSITION": "Qualifizierung bearbeiten", + "NEW_DISPOSITION": "Neue Qualifizierung", + "CLONE_TRUNK": "SIP-Trunk klonen", + "BODY": "Textinhalt", "CANNEDANSWERS": "Vordefinierte Antworten", - "REPORTFOLDER": "Berichtsordner", - "REPORTSUBFOLDER": "Unterordner melden", - "PREVIOUSCONTACT": "Bisherige", + "REPORTFOLDER": "Ordner für Bericht", + "REPORTSUBFOLDER": "Unterordner für Bericht", + "PREVIOUSCONTACT": "Vorheriger Kontakt", "VIDEOSUPPORT": "Video-Unterstützung", "AGENT": "Agent", "HEADERS": "Überschriften", "SCRIPT": "Skript", - "SCRIPT_INFO": "Info", - "SCRIPT_TYPE": "Art", + "SCRIPT_INFO": "Information", + "SCRIPT_TYPE": "Skript-Typ", "MOTION_TAB": "Neue Registerkarte \"Agent Dashboard\"", - "WHATSAPP": "WhatsApp Connector", + "WHATSAPP": "WhatsApp", "AUTOCREATE_FIELD": "Feld automatisch erstellen", - "GLOBALS": "Globals", + "GLOBALS": "Global", "SEARCH_FIELDS": "Suchfelder", "STANDARD": "Standard", - "MOTION_BAR": "Motion Bar", - "ALL": "Alle", - "ALL_DISPOSITIONS": "Alle Dispositionen", - "FIRST_LEVEL_DISPOSITION": "First Level Disposition", - "LEVEL": "Niveau", - "SECOND_LEVEL_DISPOSITION": "Disposition der zweiten Ebene", - "SELECT_LEVEL": "Wählen Sie eine Ebene", - "TITLEFONTSIZE": "Schrifttitelgröße", + "MOTION_BAR": "MotionBar", + "ALL": "Alles", + "ALL_DISPOSITIONS": "Alle Qualifizierungen", + "FIRST_LEVEL_DISPOSITION": "Qualifizierung Ebene 1", + "LEVEL": "Ebene", + "SECOND_LEVEL_DISPOSITION": "Qualifizierung Ebene 2", + "SELECT_LEVEL": "Ebene wählen", + "TITLEFONTSIZE": "Schriftgröße", "ADD_CONTACTITEMTYPE": "Hinzufügen", - "CONTACTITEMTYPE": "Kontaktartikeltypen", - "NEW_CONTACTITEMTYPE": "Neuer Kontaktelementtyp", - "ORDER_BY": "Sortieren nach", - "RGBBACKGROUNDCOLOR": "RGB-Hintergrundfarbe", + "CONTACTITEMTYPE": "Kontaktelementtypen", + "DELETE_CONTACTITEMTYPE": "Kontaktelementtyp löschen", + "EDIT_CONTACTITEMTYPE": "Kontaktelementtyp bearbeiten", "EMAIL": "Email", "FILTERCHATWEBSITES": "Chat-Websites filtern", "FILTEREMAILACCOUNTS": "E-Mail-Konten filtern", @@ -482,15 +481,16 @@ "FILTEROPENCHANNELACCOUNTS": "OpenChannel-Konten filtern", "FILTERSMSACCOUNTS": "SMS-Konten filtern", "FILTERWHATSAPPACCOUNTS": "WhatsApp-Konten filtern", + "IGNOREDIALERCONTACTID": "Dialer-Kontakt-ID ignorieren", + "MAIL_SUBSTATUS": "E-Mail-Substatus", "MANAGED": "Gelang es", "MANAGED_TEXT": "Verwaltete Interaktionen", + "NEW_CONTACTITEMTYPE": "Neuer Kontaktelementtyp", + "OFFLINE_MESSAGE": "Offline-Nachricht", "OPENED": "Geöffnet", "OPENED_TEXT": "Geöffnete Interaktionen", - "IGNOREDIALERCONTACTID": "Wählkontakt-ID ignorieren", - "MAIL_SUBSTATUS": "E-Mail Zwischenstatus", - "OFFLINE_MESSAGE": "Offline-Nachricht", - "DELETE_CONTACTITEMTYPE": "Kontaktelementtyp löschen", - "EDIT_CONTACTITEMTYPE": "Kontaktelementtyp bearbeiten", - "ORDER_BY_NUMERIC": "Sortieren nach Feld sollte ein numerischer Wert sein!" + "ORDER_BY": "Sortieren nach", + "ORDER_BY_NUMERIC": "Sortieren nach Feld sollte ein numerischer Wert sein!", + "RGBBACKGROUNDCOLOR": "RGB-Hintergrundfarbe" } } diff --git a/public/app/main/apps/video/i18n/de.json b/public/app/main/apps/video/i18n/de.json index 74aacaa..481a59f 100644 --- a/public/app/main/apps/video/i18n/de.json +++ b/public/app/main/apps/video/i18n/de.json @@ -4,37 +4,37 @@ "ERRORS": {}, "HELP": {}, "AGENT": "Agent", - "AGENTNAME": "Agent", + "AGENTNAME": "Agentenname", "CANT_DOWNLOAD_THIS_FILE": "Diese Datei kann nicht heruntergeladen werden", "CANT_PLAY_THIS_FILE": "Dieser Dateityp kann nicht abgespielt werden", "CHANNEL": "Kanal", - "CLOSEDAT": "Endzeit aufzeichnen", - "CREATEDAT": "Hergestellt in", + "CLOSEDAT": "Geschlossen am", + "CREATEDAT": "Erstellt am", "DELETE": "Löschen", - "DELETE_SCREENRECORDING": "Bildschirmaufnahme löschen", - "DOWNLOAD_SCREENRECORDING": "Bildschirmaufnahme herunterladen", + "DELETE_SCREENRECORDING": "Bildschirmaufzeichnung löschen", + "DOWNLOAD_SCREENRECORDING": "Bildschirmaufzeichnung herunterladen", "DURATION": "Dauer", - "EDIT_SCREENRECORDING": "Bildschirmaufnahme bewerten", + "EDIT_SCREENRECORDING": "Bildschirmaufzeichnung bewerten", "FILE_NOT_FOUND": "Datei nicht gefunden", "FORMAT": "Format", - "ID": "Ich würde", + "ID": "ID", "INTERACTIONID": "Interaktions-ID", - "NO_AVAILABLE_INFO": "Keine verfügbaren Informationen", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", "NO_RATING": "Keine Bewertung", "OF": "von", "PAGE": "Seite", - "PLAY_SCREENRECORDING": "Bildschirmaufnahme abspielen", + "PLAY_SCREENRECORDING": "Bildschirmaufzeichnung abspielen", "PROPERTIES": "Eigenschaften", "RATING": "Bewertung", - "RECORDENDTIME": "Endzeit aufzeichnen", - "RECORDSTARTTIME": "Startzeit aufzeichnen", + "RECORDENDTIME": "Endzeit Aufzeichnung", + "RECORDSTARTTIME": "Startzeit Aufzeichnung", "ROWSPERPAGE": "Zeilen pro Seite", "SAVE": "speichern", - "SCREENRECORDINGS": "Bildschirmaufnahmen", + "SCREENRECORDINGS": "Bildschirmaufzeichnungen", "SEARCH_FOR_ANYONE": "Suche", - "STARTEDAT": "Startzeit aufzeichnen", + "STARTEDAT": "Gestartet am", "UPDATEDAT": "Letztes Update", "VIDEO": "Video", - "WRONG_EXTENSION": "Die Datei weist die falsche Erweiterung auf" + "WRONG_EXTENSION": "Nebenstelle ungültig" } } diff --git a/public/app/main/apps/voice/i18n/de.json b/public/app/main/apps/voice/i18n/de.json index b2a2d0e..1cca22f 100644 --- a/public/app/main/apps/voice/i18n/de.json +++ b/public/app/main/apps/voice/i18n/de.json @@ -1,408 +1,408 @@ { "VOICE": { - "GOTO_VOICEQUEUE": "Zu Realtime Voice Warteschlangen gehen", - "GOTOREALTIME_VOICEQUEUE": "Zu Realtime Voice Warteschlangen gehen", + "GOTO_VOICEQUEUE": "Echtzeit-Ansicht", + "GOTOREALTIME_VOICEQUEUE": "Direkt zur Echtzeit-Ansicht", "NAME": "Name", - "LOGOUT": "An-/Abmelden", - "VOICEQUEUES": "Voice Warteschlangen", - "SEARCH_FOR_ANYONE": "Suche für Jedermann", + "LOGOUT": "Agenten an oder abmelden", + "VOICEQUEUES": "Anruf-Warteschlangen", + "SEARCH_FOR_ANYONE": "Suche", "BACK": "Zurück", - "SELECTED": "Ausgewählte", - "SELECT_ALL": "Alle auswählen", - "SELECT_NONE": "Wählen Sie \"Keine\"", - "DELETE_VOICEDISPOSITION": "Disposition löschen", - "EDIT_VOICEDISPOSITION": "Edit Voice Disposition", - "EDIT_VOICEQUEUE": "Edit Voice Warteschlange", + "SELECTED": "Ausgewählt", + "SELECT_ALL": "Alles auswählen", + "SELECT_NONE": "Nichts auswählen", + "DELETE_VOICEDISPOSITION": "Qualifizierung löschen", + "EDIT_VOICEDISPOSITION": "Qualifizierung bearbeiten", + "EDIT_VOICEQUEUE": "Warteschlange bearbeiten", "DELETE_VOICEQUEUE": "Warteschlange löschen", - "MOHSOUNDS": "Die MOH-Sounds", - "STRATEGY": "Strategie", + "MOHSOUNDS": "Audiodateien Musik auf Halten", + "STRATEGY": "Verteilungsstrategie", "DESCRIPTION": "Beschreibung", - "ADD_VOICEQUEUE": "Hinzufügen von Warteschlangen", + "ADD_VOICEQUEUE": "Warteschlange hinzufügen", "CREATED_AT": "Erstellt am", - "CANT_PLAY_GSM_AUDIO_FILES": "Nicht gsm-Audiodateien", - "APPLICATIONS_LIST": "Liste der Anwendungen", + "CANT_PLAY_GSM_AUDIO_FILES": "Nur GSM-Codierte Audiodateien werden verarbeitet", + "APPLICATIONS_LIST": "Anwendungsliste", "LEGEND": { "CUSTOM_APPLICATION": "(*) - Benutzerdefinierte Anwendung." }, "ERRORS": { - "NAME_REQUIRED": "Der Name ist erforderlich", - "APPLICATION_NAME_REQUIRED": "Der Name der Anwendung ist erforderlich", - "TIMEOUT_REQUIRED": "Der Timeout ist erforderlich", - "PHONENUMBER_REQUIRED": "Die Telefonnummer ist erforderlich", - "CONTEXT_REQUIRED": "Der Rahmen ist erforderlich", - "DESTINATIONPATTERN_REQUIRED": "Das Ziel-pattern ist erforderlich", - "FULLNAME_REQUIRED": "Der vollständige Name ist erforderlich", - "EMAIL_REQUIRED": "Die E-Mail ist erforderlich", - "EMAIL_MUST_VALID": "Die e-Mail muss in einem gültigen Format", - "MAILBOX_REQUIRED": "Die Mailbox ist erforderlich", - "PASSWORD_REQUIRED": "Das Kennwort ist erforderlich", - "CONFIRM_NOT_MATCH": "Die Kennwörter stimmen nicht überein.", - "TIMEZONE_REQUIRED": "Die Zeitzone ist erforderlich", - "PREFIX_REQUIRED": "Das Präfix ist erforderlich", - "OPTIONS_REQUIRED": "Die Optionen sind Erforderlich", - "AFTERCALLWORKDURATION_REQUIRED": "Die Arbeit nach Anruf Dauer ist erforderlich", - "TECHNOLOGY/RESOURCE_REQUIRED": "Die Technologie/Ressource erforderlich ist", - "PHONE_REQUIRED": "Die Telefonnummer ist erforderlich", - "VALUE_REQUIRED": "Der Wert ist erforderlich", - "EXTENSION_REQUIRED": "Die Verlängerung ist erforderlich", - "PRIORITY_REQUIRED": "Die Priorität ist erforderlich", - "NAME_MUST_VALID_PATTERN": "Der Name muss in einem gültigen Format geschrieben werden", - "APPLICATION_REQUIRED": "Die Anwendung ist erforderlich", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Timeout muss größer als oder gleich", - "MAXLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die max. Länge muss größer als oder gleich", - "RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Wiederholung muss größer als oder gleich", - "WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Nachlese Zeit muss größer als oder gleich", - "WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Das Gewicht muss größer als oder gleich", - "ANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Häufigkeit verkünden muss größer als oder gleich", - "MINANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Min Frequenz ankündigen muss größer als oder gleich", - "PERIODICANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die periodische Frequenz ankündigen muss größer als oder gleich", - "AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Arbeit nach Anruf Dauer muss größer als oder gleich", - "MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Verzögerung muss größer als oder gleich", - "POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Position muss größer als oder gleich", - "CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Den Schnitt stellen muss größer als oder gleich", - "MAXSECONDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Muss die Max Sekunden größer als oder gleich", - "MAXMESSAGES_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Die Max Meldungen muss größer als oder gleich", - "MAXMESSAGES_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Die Max Meldungen muss kleiner als oder gleich", - "CALLERIDALL_MUST_VALID_PATTERN": "Falsches Format", - "OUTBOUNDROUTE_REQUIRED": "Pflichtfeld", - "VARIABLE_REQUIRED": "Pflichtfeld", - "CALLER_ID_MUST_VALID_PATTERN": "Falsches Format", - "TRUNK_REQUIRED": "Pflichtfeld", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pflichtfeld", - "PROJECT_REQUIRED": "Pflichtfeld", - "PENALTY_REQUIRED": "Sie müssen einen Wert für die Strafe angeben" + "NAME_REQUIRED": "Name erforderlich", + "APPLICATION_NAME_REQUIRED": "Name Anwendung erforderlich", + "TIMEOUT_REQUIRED": "Timeout erforderlich", + "PHONENUMBER_REQUIRED": "Telefonnummer erforderlich", + "CONTEXT_REQUIRED": "Kontext erforderlich", + "DESTINATIONPATTERN_REQUIRED": "Ziel-pattern erforderlich", + "FULLNAME_REQUIRED": "Vollständiger Name erforderlich", + "EMAIL_REQUIRED": "E-Mail erforderlich", + "EMAIL_MUST_VALID": "Ungültiges Format E-Mail", + "MAILBOX_REQUIRED": "Mailbox erforderlich", + "PASSWORD_REQUIRED": "Passwort erforderlich", + "CONFIRM_NOT_MATCH": "Die Passwörter stimmen nicht überein", + "TIMEZONE_REQUIRED": "Zeitzone erforderlich", + "PREFIX_REQUIRED": "Präfix erforderlich", + "OPTIONS_REQUIRED": "Optionen Erforderlich", + "AFTERCALLWORKDURATION_REQUIRED": "Dauer Nacharbeit erforderlich", + "TECHNOLOGY/RESOURCE_REQUIRED": "Telefonieressource erforderlich", + "PHONE_REQUIRED": "Telefonnummer erforderlich", + "VALUE_REQUIRED": "Wert erforderlich", + "EXTENSION_REQUIRED": "Nebenstelle erforderlich", + "PRIORITY_REQUIRED": "Priorität erforderlich", + "NAME_MUST_VALID_PATTERN": "Der Name muss einem vorgegebenen Pattern folgen", + "APPLICATION_REQUIRED": "Anwendung erforderlich", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Timeout muss größer oder gleich sein als", + "MAXLENGTH_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Max. Länge muss größer oder gleich sein als", + "RETRY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Wiederversuch muss größer oder gleich sein als", + "WRAPUPTIME_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Nacharbeitszeit muss größer oder gleich sein als", + "WEIGHT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gewichtung muss größer oder gleich sein als", + "ANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Ansagefrequenz muss größer oder gleich sein als", + "MINANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Min. Ansagefrequenz muss größer oder gleich sein als", + "PERIODICANNOUNCEFREQUENCY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Frequenz regelmäßige Ansagen muss größer oder gleich sein als", + "AFTERCALLWORKDURATION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Dauer Nacharbeit muss größer oder gleich sein als", + "MEMBERDELAY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Verzögerung muss größer oder gleich sein als", + "POSITION_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Position muss größer oder gleich sein als", + "CUTDIGITS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Abgeschnittene Ziffern müssen größer oder gleich sein als", + "MAXSECONDS_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Max. Sekunden müssen größer oder gleich sein als", + "MAXMESSAGES_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Max. Anzahl Nachrichten muss größer oder gleich sein als", + "MAXMESSAGES_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Max. Anzahl Nachrichten muss kleiner oder gleich sein als", + "CALLERIDALL_MUST_VALID_PATTERN": "Ungültiges Format", + "OUTBOUNDROUTE_REQUIRED": "Ausgehende Route erforderlich", + "VARIABLE_REQUIRED": "Variable erforderlich", + "CALLER_ID_MUST_VALID_PATTERN": "Ungültiges Format Anrufer-ID", + "TRUNK_REQUIRED": "SIP-Trunk erforderlich", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pausen-ID bei Qualifizierung erforderlich", + "PROJECT_REQUIRED": "Projekt erforderlich", + "PENALTY_REQUIRED": "Verzögerung erforderlich" }, "GENERAL": "Allgemein", - "TIMEOUT": "Timeout", + "TIMEOUT": "Zeitüberschreitung", "MAXLENGTH": "Maximale Länge", - "RETRY": "Versuchen Sie es erneut", - "WRAPUPTIME": "-Zeit", - "WEIGHT": "Gewicht", - "JOINWHENEMPTY": "Melden Sie wenn sie leer sind", - "LEAVEWHENEMPTY": "Wenn sie leer lassen", + "RETRY": "Erneuter Versuch", + "WRAPUPTIME": "Nacharbeitszeit", + "WEIGHT": "Gewichtung", + "JOINWHENEMPTY": "Eintritt, wenn kein Agent angemeldet", + "LEAVEWHENEMPTY": "Austritt, wenn kein Agent angemeldet", "HELP": { - "TIMEOUT": "Gibt die Anzahl von Sekunden an, die das Gerät.", - "MAXLENGTH": "Gibt die maximale Anzahl der Anrufer, die in der Warteschlange. Ein Wert von Null bedeutet, dass eine unbegrenzte Anzahl von Anrufern in der Warteschlange sind erlaubt.", - "RETRY": "Gibt die Anzahl der Sekunden, die gewartet wird, bevor das nächste Mitglied in die Warteschlange, wenn der Wert für die Zeitüberschreitung erschöpft ist, während versucht wird, den ein Mitglied der Warteschlange.", - "WRAPUPTIME": "Die Anzahl der Sekunden, die ein Mitglied in einer Warteschlange verfügbar, nachdem Sie einen Anruf.", - "WEIGHT": "Legt das Gewicht einer Warteschlange. Eine Warteschlange mit einem höheren Gewicht definiert werden erste Priorität, wenn Mitglieder, die mit mehreren Warteschlangen.", - "JOINWHENEMPTY": "Steuert, ob ein Anrufer wird zur Warteschlange hinzugefügt werden, wenn keine Mitglieder verfügbar sind.", - "LEAVEWHENEMPTY": "Zur Kontrolle, ob die Anrufer aus der Warteschlange, wenn die Mitglieder nicht mehr bereit sind, Anrufe zu beantworten.", - "ANNOUNCEFREQUENCY": "Legt fest, wie oft sollten wir den Anrufer ankündigen und/oder geschätzte Wartezeit in der Warteschlange. Setzen Sie diesen Wert auf Null, um die Funktion zu deaktivieren.", - "MINANNOUNCEFREQUENCY": "Gibt die minimale Zeit, die verstreichen müssen, bevor wir Ihnen die Anrufer in der Warteschlange wieder. Dieser wird verwendet, wenn der Anrufer die Position kann sich häufig ändern, um zu verhindern, dass der Anrufer hören mehrere Updates in einem kurzen Zeitraum.", - "PERIODICANNOUNCEFREQUENCY": "Gibt an, wie oft wir sollten regelmäßige Ansagen, die dem Anrufer vorgespielt werden.", - "ANNOUNCEPOSITIONLIMIT": "Sie kann verwendet werden, wenn Sie definiert haben, verkünden-Position entweder als Begrenzung oder mehr.", - "AFTERCALLWORKDURATION": "Die Dauer der Pause durch die Option \"Arbeit nach Anruf", - "MEMBERDELAY": "Sie kann verwendet werden, wenn Sie wollen, dass es eine Verzögerung, bevor der Anrufer und Mitglied der Warteschlange, die miteinander verbunden sind.", - "MUSICONHOLD": "Setzt die Musik klasse verwendet werden, die von einer bestimmten Warteschlange an.", - "ANNOUNCETOAGENT": "Für die Wiedergabe einer Ansage auf den Agenten, der den Anruf entgegengenommen hat, ihn wissen zu lassen, was der Anrufer die Warteschlange aus.", - "RANDOMPERIODICANNOUNCE": "Falls auf Ja eingestellt, wird die festgelegte regelmäßige Mitteilungen in einer zufälligen Reihenfolge.", - "ANNOUNCEHOLDTIME": "Legt fest, ob die geschätzte Wartezeit gespielt werden sollte zusammen mit den regelmäßigen Ankündigungen.", - "ANNOUNCECALLERPOSITION": "Legt fest, ob es sich bei dem Anrufer seine Position in der Warteschlange mitgeteilt werden sollten. Wenn die Einstellung Nein lautet, die Position wird nicht bekannt gegeben. Falls auf Ja eingestellt, wird die Position des Anrufers wird immer bekannt gegeben. Wenn der Wert überschritten wird, wird der Anrufer hört ihre Position in der Warteschlange nur, wenn er sich innerhalb der Grenze von AK-Position. Wenn der Wert auf Mehr, hört der Anrufer ihre Position, wenn es über die Zahl von AK-Position.", - "REPORTHOLDTIMEAGENT": "Die Berichterstattung über die CLI des Anrufers mit der Zeit in der Warteschleife in der Warteschlange vor.", - "PERIODICANNOUNCE": "Eine Reihe von regelmäßigen Mitteilungen gespielt zu werden, in der Reihenfolge wiedergegeben, in der sie definiert sind.", - "HOLDTIMEANNOUNCE": "Wenn nicht definiert, wird die Standardeinstellung (\"Hold\"). Wenn Sie auf einen leeren Wert, wird die Aufforderung werden nicht gespielt.", - "YOUARENEXTANNOUNCE": "Wenn nicht definiert, wird die Standardeinstellung (\"Sie sind jetzt in erster Linie\"). Wenn Sie auf einen leeren Wert, wird die Aufforderung werden nicht gespielt.", - "THEREAREANNOUNCE": "Wenn nicht definiert, wird die Standardeinstellung (\"Es gibt\"). Wenn Sie auf einen leeren Wert, wird die Aufforderung werden nicht gespielt.", - "WAITINGCALLSANNOUNCE": "Wenn nicht definiert, wird die Standardeinstellung (\"Wartende Anrufe\"). Wenn Sie auf einen leeren Wert, wird die Aufforderung werden nicht gespielt.", - "ESTIMATEDHOLDTIMEANNOUNCE": "Wenn nicht definiert, wird die Standardeinstellung (\"Die voraussichtliche Wartezeit ist\"). Wenn Sie auf einen leeren Wert, wird die Aufforderung werden nicht gespielt.", - "MINUTESANNOUNCE": "Wenn nicht definiert, wird die Standardeinstellung (\"min\"). Wenn Sie auf einen leeren Wert, wird die Aufforderung werden nicht gespielt.", - "MINUTEANNOUNCE": "Wenn nicht definiert, wird die Standardeinstellung (\"min\"). Wenn Sie auf einen leeren Wert, wird die Aufforderung werden nicht gespielt.", - "SECONDSANNOUNCE": "Wenn nicht definiert, wird die Standardeinstellung (\"Sekunden\"). Wenn Sie auf einen leeren Wert, wird die Aufforderung werden nicht gespielt.", - "THANKYOUANNOUNCE": "Wenn nicht definiert, wird die Standardeinstellung (\"Vielen Dank für Ihre Geduld.\"). Wenn Sie auf einen leeren Wert, wird die Aufforderung werden nicht gespielt.", - "AFTERCALLWORK": "Wenn der Agent aktiv ist, wird auf eine Pause nach einer abgeschlossenen Anruf in der Warteschlange", - "AUTOPAUSE": "Aktiviert/Deaktiviert die automatische Unterbrechung der Mitglieder, die es versäumen, um einen Anruf zu beantworten. Wenn aktiv, wird diese Mitgliedstaaten angehalten zu werden in allen Warteschlangen er Mitglied ist.", - "RINGINUSE": "Verwendet werden, um zu vermeiden, Senden von Anrufen an Mitglieder, deren Status im Einsatz ist.", - "TIMEOUTRESTART": "Falls auf Ja eingestellt, wird das Timeout für einen Agenten zu beantworten, wenn entweder ein Besetztzeichen oder wird mit dem Status \"Überlastung des Kanals.", - "CONTEXT": "Ermöglicht einem Anrufer zu beenden, die die Warteschlange durch Drücken einer einzigen Taste MFV-Ziffer. Wenn Sie einen Kontext angegeben ist und der Anrufer gibt eine Zahl, Ziffer wird versuchen, die angepasst werden können, im Rahmen festgelegt, und es wird auch weiterhin die Ausführung Nummernplan.", - "SETINTERFACEVARIABLES": "Falls auf Ja eingestellt, kurz vor dem Anrufer, die mit einer Warteschlange, die einige Variablen werden(siehe wiki)", - "SETQUEUEVARIABLES": "Falls auf Ja eingestellt, kurz vor dem Anrufer, die mit einer Warteschlange und kurz vor dem Anrufer die Warteschlange verlassen einige Variablen werden(siehe wiki)", - "SETQUEUEENTRYVARIABLES": "Falls auf Ja eingestellt, kurz vor dem Anrufer, die mit einer Warteschlange, die einige Variablen werden(siehe wiki)", - "RECORDING": "Aktivieren der Aufzeichnung", - "VOICEMAIL_CONTEXT": "Im Rahmen der relativen Erweiterung.", + "TIMEOUT": "Definiert die Zeit (Sek) wie lange eine Nebenstelle max. klingeln darf", + "MAXLENGTH": "Maximale Anzahl wartender Anrufe in der Warteschlange. 0 = unbegrenzt", + "RETRY": "Zusätzliche Zeit (Sek) nach Erreichen des Timeouts, bevor der nächste freie Agent in der Warteschlange angerufen wird", + "WRAPUPTIME": "Zeit (Sek) in welcher ein Agent nach einem Anruf auf nicht verfügbar verbleibt", + "WEIGHT": "Gewichtung der Warteschlange zur Bestimmung der Priorität, sofern Agenten auf mehreren Warteschlangen arbeiten", + "JOINWHENEMPTY": "Definiert, ob der Anrufer in die Warteschlange eintreten darf, wenn keine Agenten verfügbar sind", + "LEAVEWHENEMPTY": "Definiert, ob Anrufer in der Warteschlange verbleiben, sobald keine Agenten verfügbar sind", + "ANNOUNCEFREQUENCY": "Ansagehäufigkeit der geschätzten Wartezeit und/oder Warteposition. 0 = deaktiviert", + "MINANNOUNCEFREQUENCY": "Minimale Ansagefrequenz. Sinnvoll, wenn sich die Warteposition des Anrufers häufig ändert", + "PERIODICANNOUNCEFREQUENCY": "Häufigkeit der regelmäßigen Ansagen", + "ANNOUNCEPOSITIONLIMIT": "Einstellen der Limitierung, wenn Ansage der Warteposition auf 'Limit' oder 'More'", + "AFTERCALLWORKDURATION": "Dauer der automatischen Nacharbeit (ACW)", + "MEMBERDELAY": "Fügt eine Verzögerung (Sek) hinzu, bevor der Anrufer an den Agenten durchgestellt wird", + "MUSICONHOLD": "Definiert die verwendete Wartemusik in der Warteschlange", + "ANNOUNCETOAGENT": "Gibt dem Agenten einen akustischen Hinweis bevor der Anrufer durchgestellt wird", + "RANDOMPERIODICANNOUNCE": "Zufällige Wiedergabe der regelmäßigen Ansagen", + "ANNOUNCEHOLDTIME": "Ansage der erwarteten Wartezeit an den Anrufer. No = keine Ansage, Once = Ansage einmalig bei Eintritt in die Warteschlange, Yes = Ansage nach jedem Loop", + "ANNOUNCECALLERPOSITION": "Ansage der Position innerhalb der Warteschlange an den Anrufer. No = keine Ansage; Yes = Immer; Limit = Ansage nur, wenn unterhalb des Limitierungswertes; More = nur wenn oberhalb des Limitierungswertes", + "REPORTHOLDTIMEAGENT": "Sagt dem Agenten die tatsächliche Wartezeit des Anrufers an, bevor dieser durchgestellt wird", + "PERIODICANNOUNCE": "Erstellt eine Playlist der Audiodateien, welche regelmäßig in der Warteschlange gespielt werden", + "HOLDTIMEANNOUNCE": "Audiodatei zur Ansage der Wartezeit an den Agenten. Bsp: 'Wartezeit des Kunden:'", + "YOUARENEXTANNOUNCE": "Audiodatei zur Ansage an den Anrufer bei aktiver Warteposition. Bsp: 'Sie sind nun an der 1. Position der Warteschlange'", + "THEREAREANNOUNCE": "Teil 1 Ansage Warteposition. Bsp: 'Vor Ihnen befinden sich...'", + "WAITINGCALLSANNOUNCE": "Teil 2 Ansage Warteposition. Bsp: '...Anrufe in der Warteschlange'", + "ESTIMATEDHOLDTIMEANNOUNCE": "Audiodatei zur Ansage der geschätzten Wartezeit an den Anrufer. Bsp: 'Ihre geschätzte Wartezeit beträgt ca.'", + "MINUTESANNOUNCE": "Audiodatei 'Minuten' zur Verwendung bei aktiver Ansage der geschätzten Wartezeit", + "MINUTEANNOUNCE": "Audiodatei 'Minute' zur Verwendung bei aktiver Ansage der geschätzten Wartezeit", + "SECONDSANNOUNCE": "Audiodatei 'Sekunden' zur Verwendung bei aktiver Ansage der geschätzten Wartezeit", + "THANKYOUANNOUNCE": "Audiodatei 'Vielen Dank für Ihre Geduld'", + "AFTERCALLWORK": "Wenn aktiviert, wird der Agent nach einer Interaktion automatisch in eine Pause zur Nacharbeit (ACW) gesetzt", + "AUTOPAUSE": "Automatische Pause für den Agenten, sofern der Anruf nicht innerhalb der definierten Zeit entgegengenommen wird", + "RINGINUSE": "Legt fest, ob Anrufe beim Agenten anklopfen dürfen, obwohl Besetzt", + "TIMEOUTRESTART": "Zeitüberschreitung für erneutes Starten des Verbindungsversuchs zum Agenten bei Leitungsüberlastung", + "CONTEXT": "Ermöglicht den Absprung des Anrufers aus der Warteschleife nach Drücken einer Taste mittels DTMF. Das weitere Verhalten kann im Anschluss innerhalb des Wählplans definiert werden", + "SETINTERFACEVARIABLES": "Speichert Variablen (Bezug zum Agenten) vor dem Durchstellen des Anrufers (Bsp: MEMBERNAME, MEMBERLASTCALL, MEMBERPENALTY) siehe Wiki", + "SETQUEUEVARIABLES": "Speichert Variablen (Bezug zur Warteschlange) vor dem Durchstellen des Anrufers (Bsp: QUEUEHOLDTIME, QEUEORIGINALPOS) siehe Wiki", + "SETQUEUEENTRYVARIABLES": "Speichert Variablen (Bezug zum Eintritt in die Warteschlange) vor dem Durchstellen des Anrufers (Bsp: QUEUENAME, QUEUESTRATEGY) siehe Wiki", + "RECORDING": "Aktivieren der automatischen Aufzeichnung", + "VOICEMAIL_CONTEXT": "Kontext (DTMF-Eingabe) für den Absprung auf Voicemail", "NAME": "Nur Zahlen, Buchstaben und Sonderzeichen (._) werden unterstützt.", - "CALLERIDALL": "Unterstützte Formate: \"CallerId\" & lt; number & gt;", - "CALLER_ID": "Unterstützte Formate: \"CallerId\" & lt; number & gt;", - "MANDATORYDISPOSITIONPAUSEID": "Pausenstatus, der während der Zwangsdisposition festgelegt werden soll", - "SERVICELEVEL": "Zweite Einstellungen für Service Level (Standard = 0, kein SL). Wird für Service Level-Statistiken verwendet (Anrufe werden innerhalb des Service Level-Zeitrahmens beantwortet)", - "MONITORFORMAT": "Gibt das Format der Aufnahmedatei an. Wenn es auf 'inaktiv' gesetzt ist, werden Anrufe nicht aufgezeichnet", - "SAVE_ROUTES": "Die Einstellungen der Route wurden geändert. Bitte nicht vergessen, zu Speichern." + "CALLERIDALL": "Unterstütztes Format: \"CallerId\" <+490000000>", + "CALLER_ID": "Unterstütztes Format: \"CallerId\" <+490000000>", + "MANDATORYDISPOSITIONPAUSEID": "Definiert den Agentenstatus während der Qualifizierung einer Interaktion", + "SERVICELEVEL": "Anzahl Sekunden, welche für die Berechnung des Service-Levels verwendet werden", + "MONITORFORMAT": "Aktiviert die automatische Aufzeichnung und legt deren Audioformat fest", + "SAVE_ROUTES": "Die Streckenführung wurde geändert. Denken Sie daran, zu speichern, wenn Sie Ihre Änderungen nicht verlieren möchten." }, - "MUSICONHOLD": "Musik auf Halten", - "ANNOUNCETOAGENT": "Geben Sie Agent", - "ANNOUNCEMENTS": "Ankündigungen", - "ADVANCED": "Erweiterte", - "ANNOUNCEFREQUENCY": "Frequenz ankündigen", - "MINANNOUNCEFREQUENCY": "Minimale Frequenz ankündigen", - "PERIODICANNOUNCEFREQUENCY": "Periodische Frequenz ankündigen", - "RANDOMPERIODICANNOUNCE": "Random Periodische verkünden", - "ANNOUNCEHOLDTIME": "Geben Sie Zeit", - "ANNOUNCECALLERPOSITION": "Position des Anrufers bekannt", - "ANNOUNCEPOSITIONLIMIT": "Geben Position Limit", - "REPORTHOLDTIMEAGENT": "Bericht Agenten", - "PERIODICANNOUNCE": "Periodische verkünden", - "HOLDTIMEANNOUNCE": "Zeit in der Warteschleife verkünden", - "YOUARENEXTANNOUNCE": "\"Sie sind weiter' verkünden", - "THEREAREANNOUNCE": "'Es gibt' verkünden", - "WAITINGCALLSANNOUNCE": "Wartende Anrufe,", - "ESTIMATEDHOLDTIMEANNOUNCE": "Geschätzte Zeit halten,", - "MINUTESANNOUNCE": "Minuten ankündigen", - "MINUTEANNOUNCE": "Minute verkünden", - "SECONDSANNOUNCE": "Sekunden,", - "THANKYOUANNOUNCE": "'Vielen Dank' verkünden", - "AUTOPAUSE": "Auto Pause", - "AFTERCALLWORK": "Arbeit nach Anruf", - "AFTERCALLWORKDURATION": "Arbeit nach Anruf Dauer", - "RINGINUSE": "Ring in Verwendung", - "MEMBERDELAY": "Die Verzögerung", - "TIMEOUTRESTART": "Timeout starten", + "MUSICONHOLD": "Warteansage", + "ANNOUNCETOAGENT": "Ansage an Agenten vor Gespräch", + "ANNOUNCEMENTS": "Ansagen", + "ADVANCED": "Erweitert", + "ANNOUNCEFREQUENCY": "Ansagehäufigkeit", + "MINANNOUNCEFREQUENCY": "Minimale Ansagefrequenz", + "PERIODICANNOUNCEFREQUENCY": "Frequenz regelmäßiger Ansagen", + "RANDOMPERIODICANNOUNCE": "Regelmäßige Ansagen zufällig abspielen", + "ANNOUNCEHOLDTIME": "Ansage geschätzte Wartezeit an Anrufer", + "ANNOUNCECALLERPOSITION": "Position des Anrufers ansagen", + "ANNOUNCEPOSITIONLIMIT": "Limit für Ansage der Warteposition", + "REPORTHOLDTIMEAGENT": "Ansage Wartezeit an Agenten", + "PERIODICANNOUNCE": "Regelmäßige Ansage", + "HOLDTIMEANNOUNCE": "Ansage Wartezeit an Agenten", + "YOUARENEXTANNOUNCE": "Ansage Position 1 in Warteschleife", + "THEREAREANNOUNCE": "Ansage Teil 1 Warteposition", + "WAITINGCALLSANNOUNCE": "Ansage Teil 2 Warteposition", + "ESTIMATEDHOLDTIMEANNOUNCE": "Ansage geschätzte Wartezeit", + "MINUTESANNOUNCE": "Ansage 'Minuten'", + "MINUTEANNOUNCE": "Ansage 'Minute'", + "SECONDSANNOUNCE": "Ansage 'Sekunden'", + "THANKYOUANNOUNCE": "Ansage Dankesnachricht", + "AUTOPAUSE": "Automatische Pause für Agenten bei fehlgeschlagener Annahme", + "AFTERCALLWORK": "Nacharbeit", + "AFTERCALLWORKDURATION": "Dauer Nacharbeit", + "RINGINUSE": "Klingeln während 'Besetzt'", + "MEMBERDELAY": "Verzögerung Zustellung an Agenten", + "TIMEOUTRESTART": "Zeitüberschreitung Neustart", "MONITORFORMAT": "Aufzeichnungsformat", - "SETINTERFACEVARIABLES": "Die Interface- Variablen", - "SETQUEUEVARIABLES": "Die Warteschlange Variablen", - "SETQUEUEENTRYVARIABLES": "Die Warteschlange ENTRY-Variablen", + "SETINTERFACEVARIABLES": "Interface-Variablen hinzufügen", + "SETQUEUEVARIABLES": "Variablen für Warteschlange hinzufügen", + "SETQUEUEENTRYVARIABLES": "Variablen für Eintritt in Warteschlange hinzufügen", "VARIABLE": "Variable", "CONTEXT": "Kontext", "SAVE": "Speichern", "SETTINGS": "Einstellungen", - "INBOUNDROUTES": "Ankommende Routen", + "INBOUNDROUTES": "Eingehende Routen", "PHONENUMBER": "Telefonnummer", "ADD_INBOUNDROUTE": "Eingehende Route hinzufügen", - "EDIT_INBOUNDROUTE": "Route für eingehende Anrufe bearbeiten.", - "DELETE_INBOUNDROUTE": "Löschen der Route für eingehende Anrufe", - "ACTIONS": "Aktionen", - "OUTBOUNDROUTES": "Abgehende Routen", - "DESTINATIONPATTERN": "Ziel Muster", + "EDIT_INBOUNDROUTE": "Eingehende Route bearbeiten", + "DELETE_INBOUNDROUTE": "Eingehende Route löschen", + "ACTIONS": "Routing", + "OUTBOUNDROUTES": "Ausgehende Routen", + "DESTINATIONPATTERN": "Ziel-Pattern", "ADD_OUTBOUNDROUTE": "Ausgehende Route hinzufügen", - "EDIT_OUTBOUNDROUTE": "Abgehende Route bearbeiten", - "DELETE_OUTBOUNDROUTE": "Abgehende Route löschen", - "CUTDIGITS": "Die Ziffern", - "RECORDING": "Aufnahme", + "EDIT_OUTBOUNDROUTE": "Ausgehende Route bearbeiten", + "DELETE_OUTBOUNDROUTE": "Ausgehende Route löschen", + "CUTDIGITS": "Ziffern abschneiden", + "RECORDING": "Aufzeichnung", "RECORDINGFORMAT": "Aufzeichnungsformat", "INTERNALROUTES": "Interne Routen", - "ADD_INTERNALROUTE": "Fügen Sie interne Routen", + "ADD_INTERNALROUTE": "Interne Route hinzufügen", "EDIT_INTERNALROUTE": "Interne Route bearbeiten", - "DELETE_INTERNALROUTE": "Interne Routen löschen", + "DELETE_INTERNALROUTE": "Interne Route löschen", "CONTEXTS": "Kontexte", - "ADD_CONTEXT": "Rahmen hinzufügen", + "ADD_CONTEXT": "Kontext hinzufügen", "EDIT_CONTEXT": "Kontext bearbeiten", - "DELETE_CONTEXT": "Löschen von Rahmen", - "VOICEMAILS": "Von Voicemails", - "ADD_VOICEMAIL": "Fügen Sie Voicemail", - "EDIT_VOICEMAIL": "Bearbeiten von Voicemail", + "DELETE_CONTEXT": "Kontext löschen", + "VOICEMAILS": "Voicemails", + "ADD_VOICEMAIL": "Voicemail hinzufügen", + "EDIT_VOICEMAIL": "Voicemail bearbeiten", "DELETE_VOICEMAIL": "Voicemail löschen", - "FULLNAME": "Voller Name", + "FULLNAME": "Vollständiger Name", "EMAIL": "E-Mail", - "MAILBOX": "Mailbox", + "MAILBOX": "Postfach", "PASSWORD": "Passwort", "CONFIRM_PASSWORD": "Passwort bestätigen", "TIMEZONE": "Zeitzone", - "ATTACH": "Befestigen Sie", - "ENVELOPE": "Umschlag", + "ATTACH": "Anhängen", + "ENVELOPE": "Eingangsdatum und Zeit ansagen", "DELETE": "Löschen", - "EMAILBODY": "E-Mail-Text", - "EMAILSUBJECT": "Betreff der E-Mail", - "MAXSECONDS": "In Sekunden", + "EMAILBODY": "E-Mail-Textinhalt", + "EMAILSUBJECT": "E-Mail Betreff", + "MAXSECONDS": "Max. Sekunden", "MAXMESSAGES": "Max. Nachrichten", "MESSAGES": "Nachrichten", "SORT": "Sortieren", - "ADD_MUSICONHOLD": "Hinzufügen von Musik auf Halten", - "MUSICONHOLDS": "Musik auf Halten", - "EDIT_MUSICONHOLD": "Bearbeiten Musik auf Halten", - "DELETE_MUSICONHOLD": "Löschen Sie Musik auf Halten", + "ADD_MUSICONHOLD": "Warteansage hinzufügen", + "MUSICONHOLDS": "Warteansagen", + "EDIT_MUSICONHOLD": "Warteansage bearbeiten", + "DELETE_MUSICONHOLD": "Warteansage löschen", "DIRECTORY": "Verzeichnis", "AUDIOFILES": "Audiodateien", - "RECORDINGS": "Aufnahmen", - "CHANSPY": "ChanSpy", + "RECORDINGS": "Aufzeichnungen", + "CHANSPY": "Listen-In", "PREFIX": "Präfix", "OPTIONS": "Optionen", "AUTH": "Auth", - "ADD_CHANSPY": "Fügen Sie ChanSpy", - "EDIT_CHANSPY": "Bearbeiten Sie ChanSpy", - "DELETE_CHANSPY": "Löschen Sie ChanSpy", + "ADD_CHANSPY": "Listen-In hinzufügen", + "EDIT_CHANSPY": "Listen-In bearbeiten", + "DELETE_CHANSPY": "Listen-In löschen", "AGENTS": "Agenten", "TELEPHONES": "Telefone", "QUEUES": "Warteschlangen", - "QUEUE_CALLS": "Anrufe aus einer Warteschlange", - "QUEUE_PARAMETERS": "Queue Parameter", + "QUEUE_CALLS": "Anrufe", + "QUEUE_PARAMETERS": "Warteschlangen-Parameter", "ABANDONED_CALLS": "Abgebrochene Anrufe", "OUTBOUND_CALLS": "Ausgehende Anrufe", "AGI": "AGI", - "DIAL": "Kurzwahl", + "DIAL": "Wählen", "CALLYSQUARE": "CallySquare", - "INTERNALDIAL": "Interne Wahl", + "INTERNALDIAL": "Internes Wählen", "EXTERNALDIAL": "Externes Wählen", - "RINGGROUP": "Ring-Gruppe", + "RINGGROUP": "Rufgruppe", "PLAYBACK": "Wiedergabe", "QUEUE": "Warteschlange", "SET": "Set", "VOICEMAIL": "Voicemail", - "GOTO": "Gehe zu", + "GOTO": "Absprung (GoTo)", "HANGUP": "Auflegen", - "CUSTOM": "Benutzerdefinierte", + "CUSTOM": "Benutzerdefiniert", "PROJECT": "Cally-Square Projekt", - "TECHNOLOGY/RESOURCE": "Technologie-/Ressourcen", + "TECHNOLOGY/RESOURCE": "Ressource", "URL": "URL", "EDIT_APP": "Anwendung bearbeiten.", - "EDIT_INTERVAL": "Intervall bearbeiten", + "EDIT_INTERVAL": "Zeitintervall bearbeiten", "DELETE_APP": "Anwendung löschen", - "INTERVALS": "Intervalle", + "INTERVALS": "Zeitintervalle", "USER": "Benutzer", - "TRUNK": "Amtsleitung", + "TRUNK": "SIP-Trunk", "PHONE": "Telefon", "AUDIO_FILES": "Audiodateien", - "ANNOUNCE_OVERRIDES": "Überschreibt ankündigen", + "ANNOUNCE_OVERRIDES": "Willkommensnachricht (Überschreibt Standard-Ansage in Warteschlange)", "MACRO": "Makro", - "GOSUB": "GoSub", + "GOSUB": "Subroutine (GoSub)", "RULE": "Regel", "POSITION": "Position", "ANSWER": "Antwort", "VALUE": "Wert", - "MAILBOX@CONTEXT": "Mailbox@Kontext", - "EXTENSION": "Erweiterung", + "MAILBOX@CONTEXT": "MailboxID@Kontext", + "EXTENSION": "Nebenstelle", "PRIORITY": "Priorität", - "HANGUP_CAUSE": "Ursache auflegen", - "OUTBOUNDDIAL": "Wählen Sie für abgehende Anrufe", - "CALLER_ID": "Die Anrufer-ID", - "NO_MESSAGE_AVAILABLE": "Keine Meldungen vorhanden", - "NO_SOUND_AVAILABLE": "Kein Ton verfügbar", - "VOICERECORDINGS": "Sprachaufnahmen", - "CHANSPIES": "Chan Spies", - "VOICE": "Voice", - "REALTIME": "Echtzeit", - "ID": "Id", - "VOICEMAIL_CONTEXT": "Kontext", - "NO_MOHSOUND_AVAILABLE": "Keine Wartemusik verfügbar", + "HANGUP_CAUSE": "SIP-Auflegegrund", + "OUTBOUNDDIAL": "Ausgehend wählen", + "CALLER_ID": "Anrufer-ID (CallerID)", + "NO_MESSAGE_AVAILABLE": "Keine Nachrichten verfügbar", + "NO_SOUND_AVAILABLE": "Keine Audiodatei verfügbar", + "VOICERECORDINGS": "Sprachaufzeichnungen", + "CHANSPIES": "Listen-Ins", + "VOICE": "Sprachanrufe (Voice)", + "REALTIME": "Echtzeitansicht", + "ID": "ID", + "VOICEMAIL_CONTEXT": "Kontext zum Absprung auf Voicemail", + "NO_MOHSOUND_AVAILABLE": "Keine Halteansage verfügbar", "FILE": "Datei", - "ADD_MOHSOUND": "Hinzufügen von Musik auf Halten sound", - "DOWNLOAD_MOHSOUND": "Download Music-on-Hold sound", - "DELETE_MOHSOUND": "Löschen Sie Music On Hold sound", + "ADD_MOHSOUND": "Halteansage hinzufügen", + "DOWNLOAD_MOHSOUND": "Halteansage herunterladen", + "DELETE_MOHSOUND": "Halteansage löschen", "UNIQUEID": "Eindeutige ID", "AGENT": "Agent", "TYPE": "Typ", "RATING": "Bewertung", "AUDIO": "Audio", "DATE": "Datum", - "NEW_VOICEQUEUE": "Neue Stimme der Warteschlange", - "NEW_INBOUNDROUTE": "Neue Route für eingehende Anrufe", - "NEW_OUTBOUNDROUTE": "Neue abgehende Route", + "NEW_VOICEQUEUE": "Neue Anrufwarteschlange", + "NEW_INBOUNDROUTE": "Neue eingehende Route", + "NEW_OUTBOUNDROUTE": "Neue ausgehende Route", "NEW_INTERNALROUTE": "Neue interne Routen", - "NEW_CONTEXT": "Neue Kontext", + "NEW_CONTEXT": "Neuer Kontext", "NEW_VOICEMAIL": "Neue Voicemail", - "NEW_MUSICONHOLD": "Neue Musik auf Halten", - "NEW_CHANSPY": "Neue ChanSpy", - "PENALTY": "Strafe", - "ADD_TEAM_TO_VOICEQUEUE": "Team hinzufügen, Warteschlange", - "ADD_AGENT_TO_VOICEQUEUE": "Hinzufügen von Agenten der Warteschlange an die Mailbox", - "EDIT_DIAL": "Wählen Sie Bearbeiten.", - "EDIT_AGI": "AGI bearbeiten", - "EDIT_INTERNALDIAL": "Interne Wahl bearbeiten.", - "EDIT_EXTERNALDIAL": "Wählen Sie Externen bearbeiten", - "EDIT_RINGGROUP": "Gruppe bearbeiten", - "EDIT_PLAYBACK": "Bearbeiten Sie die Wiedergabe", - "EDIT_QUEUE": "Bearbeiten von Warteschlangen", - "EDIT_SET": "Bearbeiten", - "EDIT_GOTO": "Gehe zu bearbeiten.", - "EDIT_HANGUP": "Bearbeiten Sie Auflegen", - "EDIT_CUSTOM": "Bearbeiten von benutzerdefinierten", + "NEW_MUSICONHOLD": "Neue Warteansage", + "NEW_CHANSPY": "Neues Listen-In", + "PENALTY": "Verzögerung", + "ADD_TEAM_TO_VOICEQUEUE": "Team hinzufügen", + "ADD_AGENT_TO_VOICEQUEUE": "Agenten hinzufügen", + "EDIT_DIAL": "Wählverhalten bearbeiten", + "EDIT_AGI": "Projekt bearbeiten", + "EDIT_INTERNALDIAL": "Internes Wählen bearbeiten", + "EDIT_EXTERNALDIAL": "Externes Wählen bearbeiten", + "EDIT_RINGGROUP": "Rufgruppe bearbeiten", + "EDIT_PLAYBACK": "Wiedergabe bearbeiten", + "EDIT_QUEUE": "Warteschlange bearbeiten", + "EDIT_SET": "Set Bearbeiten", + "EDIT_GOTO": "'Gehe zu' bearbeiten.", + "EDIT_HANGUP": "Auflegeverhalten bearbeiten", + "EDIT_CUSTOM": "Benutzerdefinierte Anwendung bearbeiten", "DURATION": "Dauer", "RECEIVED_AT": "Empfangen am", "YES": "Ja", - "NO": "Keine", - "HANGUPCAUSE_1": "1 = Nicht zugewiesene Nummer", - "HANGUPCAUSE_16": "16 = Normail Anruf löschen", - "HANGUPCAUSE_17": "17 = Benutzer besetzt", - "HANGUPCAUSE_18": "18 = Keine Reaktion (Telefon Gerät nicht verbunden)", - "HANGUPCAUSE_21": "21 = Anruf abgelehnt", - "HANGUPCAUSE_22": "22 = Anzahl geändert", - "HANGUPCAUSE_27": "27 = Ziel nicht in Ordnung", - "HANGUPCAUSE_38": "38 = Netzwerk aus, um", - "HANGUPCAUSE_41": "41 = vorübergehende Störung", - "RANDOM": "Random", + "NO": "Nein", + "HANGUPCAUSE_1": "1 = Nebenstelle nicht gefunden (SIP404 - Not found)", + "HANGUPCAUSE_16": "16 = Ein Nutzer hat aufgelegt (Normal clearing)", + "HANGUPCAUSE_17": "17 = Besetzt (SIP486 - Busy here)", + "HANGUPCAUSE_18": "18 = Zeitüberschreitung Gegenstelle (SIP408 - Request Timeout)", + "HANGUPCAUSE_21": "21 = Abgelehnt (SIP603 - Declined)", + "HANGUPCAUSE_22": "22 = Nummer geändert (SIP410 - Gone)", + "HANGUPCAUSE_27": "27 = Ziel nicht gefunden (SIP502 - Bad Gateway)", + "HANGUPCAUSE_38": "38 = Dienst nicht verfügbar (SIP 503 - Network out of order)", + "HANGUPCAUSE_41": "41 = Vorübergehend nicht verfügbar (Normal temporary failure)", + "RANDOM": "Zufall", "ALPHABETICAL": "Alphabetisch", "NO_APPS_AVAILABLE": "Keine Anwendungen verfügbar", - "DOWNLOAD_VOICERECORDING": "Download Voice Recording", - "DELETE_VOICERECORDING": "Löschen von Voice Recording", - "INTERNAL": "Interne", - "PHONE_STATE": "Telefonstatus", - "PHONE_STATUS": "Telefonstatus", - "TRUNK_STATUS": "Trunk Status", + "DOWNLOAD_VOICERECORDING": "Gesprächsaufzeichnung herunterladen", + "DELETE_VOICERECORDING": "Gesprächsaufzeichnung löschen", + "INTERNAL": "Intern", + "PHONE_STATE": "Status Nebenstelle", + "PHONE_STATUS": "Status SIP", + "TRUNK_STATUS": "Status SIP-Trunk", "REGISTERED": "Registriert", - "UNREGISTERED": "Unregistrierte", - "LAGGED": "Zurück", + "UNREGISTERED": "Nicht registriert", + "LAGGED": "Verzögert", "REACHABLE": "Erreichbar", "UNREACHABLE": "Nicht erreichbar", "UNKNOWN": "Unbekannt", - "NOT_INUSE": "Nicht in Gebrauch", - "INUSE": "Im Einsatz", + "NOT_INUSE": "Nicht in Verwendung", + "INUSE": "In Verwendung", "BUSY": "Besetzt", "INVALID": "Ungültig", "UNAVAILABLE": "Nicht verfügbar", "RINGING": "Klingeln", - "ONHOLD": "Auf Halten", - "RING": "Ring", - "UP": "Bis", - "INFO": "Info", - "TRUNKS": "Amtsleitungen", + "ONHOLD": "Halten", + "RING": "Klingeln", + "UP": "Online", + "INFO": "Information", + "TRUNKS": "SIP-Trunks", "REGISTRY": "Registrierung", - "NO_REGISTRY": "Keine registry", + "NO_REGISTRY": "Keine Registrierung", "LOGGED_IN": "Angemeldet", "PAUSED": "Angehalten", - "WAITING": "Warten", - "TALKING": "Sprechen", - "DID": "Haben", + "WAITING": "Wartezustand", + "TALKING": "im Gespräch", + "DID": "DID", "CALLER": "Anrufer", - "TOTAL": "Insgesamt", + "TOTAL": "Gesamt", "ANSWERED": "Beantwortet", "ABANDONED": "Abgebrochen", - "UNMANAGED": "Nicht verwaltete", - "AVG_HOLD_TIME": "Durchschnittl. Warteschleifenzeit", - "AVG_DURATION": "Av-Dauer", - "AVG_BILLABLE": "Avg Fakturierbaren", - "SOURCE": "Quelle", + "UNMANAGED": "Nicht verwaltet", + "AVG_HOLD_TIME": "DS Wartezeit", + "AVG_DURATION": "DS Dauer", + "AVG_BILLABLE": "DS Abrechenbar", + "SOURCE": "Ursprung", "DESTINATION": "Ziel", "REJECTED": "Abgelehnt", "FAILED": "Fehlgeschlagen", - "CALLED": "Aufgerufen", + "CALLED": "Angerufen", "CONNECTED": "Verbunden", "NO_RATING": "Keine Bewertung", - "EDIT_VOICERECORDING": "Edit Voice Recording", + "EDIT_VOICERECORDING": "Gesprächsaufzeichnung bearbeiten", "APPLICATION_NAME": "Name der Anwendung", "ARGUMENTS": "Argumente", - "NO_AVAILABLE_INFO": "Keine verfügbaren Info", - "ADD_AGENT_TO_QUEUE": "Agent zur Warteschlange hinzufügen", - "DEFAULT_PAUSE": "Standard PAUSE", - "PAUSE": "Pause", - "UNPAUSE": "Pause", - "REDIRECT_TO_NUMBER": "Umleiten zu: Anzahl", - "REDIRECT_TO_AGENT": "Umleiten zu: Agent", - "AGENTADD_VOICEQUEUE": "Hinzufügen von Agenten der Warteschlange an die Mailbox", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", + "ADD_AGENT_TO_QUEUE": "Agenten hinzufügen", + "DEFAULT_PAUSE": "Standardpause", + "PAUSE": "Pausenstatus vergeben", + "UNPAUSE": "Pause beenden", + "REDIRECT_TO_NUMBER": "Weiterleiten an Nummer", + "REDIRECT_TO_AGENT": "Weiterleiten an Agent", + "AGENTADD_VOICEQUEUE": "Agenten hinzufügen", "APPLICATION": "Anwendung", "FILES": "Dateien", "FORMAT": "Format", "MODE": "Modus", - "RECORD": "Datensatz", - "TEAMADD_VOICEQUEUE": "Hinzufügen Team voicequeue", - "NEW_MOHSOUND": "Neue Musik auf Halten", - "DOWNLOAD_MESSAGE": "Download", - "DELETE_MESSAGE": "Löschen", - "QUEUE_PARAMS": "Queue Parameter", - "TOTAL_OFFERED": "Insgesamt", + "RECORD": "Aufzeichnung", + "TEAMADD_VOICEQUEUE": "Team hinzufügen", + "NEW_MOHSOUND": "Neue Halteansage", + "DOWNLOAD_MESSAGE": "Nachricht herunterladen", + "DELETE_MESSAGE": "Nachricht löschen", + "QUEUE_PARAMS": "Warteschlangen-Parameter", + "TOTAL_OFFERED": "Gesamt angeboten", "READY": "Bereit", - "AGENTADD_QUEUE": "Agent hinzufügen Warteschlangen zu Voice", - "AGENTSADD_QUEUE": "Hinzufügen von Agenten der Warteschlange an die Mailbox", - "ALL_TEAMS": "Alle Mannschaften", + "AGENTADD_QUEUE": "Agenten hinzufügen", + "AGENTSADD_QUEUE": "Agenten hinzufügen", + "ALL_TEAMS": "Alle Teams", "SELECTED_TEAMS": "Ausgewählte Teams", "ALL_AGENTS": "Alle Agenten", "SELECTED_AGENTS": "Ausgewählte Agenten", - "CLOSING": "Schließen", + "CLOSING": "Wird geschlossen", "TAGS": "Tags", "WAITING_FOR_AGENT": "Warten auf Agenten", - "EDIT_OUTBOUNDDIAL": "Bearbeiten ausgehenden DFÜ", - "ACCOUNTNAME": "Konto Name", + "EDIT_OUTBOUNDDIAL": "Ausgehendes Wählen bearbeiten", + "ACCOUNTNAME": "Kontoname", "PAGE": "Seite", "ROWSPERPAGE": "Zeilen pro Seite", - "OF": "Von", - "DISPOSITION": "Disposition", + "OF": "von", + "DISPOSITION": "Qualifizierung", "WAITING_FOR_AGENTS": "Warten auf Agenten", "CHAT": "Chat", "MAIL": "E-Mail", @@ -410,77 +410,77 @@ "OPENCHANNEL": "Offener Kanal", "FAX": "Fax", "NO_AGENT_ONLINE": "Kein Agent Online", - "PARTIALPAUSE": "Teilweise Pause", + "PARTIALPAUSE": "Teilpause", "STATUS": "Status", - "TIMER": "Timer", - "ALL": "Alle", + "TIMER": "Zeitanzeige", + "ALL": "Alles", "IDLE": "Leerlauf", - "EDIT_TRUNK": "Bearbeiten Trunk", + "EDIT_TRUNK": "SIP-Trunk bearbeiten", "ACTIVE": "Aktiv", - "CLEAR": "klar", + "CLEAR": "Leeren", "CALLS": "Anrufe", - "STARTEDAT": "Fing an bei", - "ENDEDAT": "Beendet bei", - "TAG": "Etikett", - "DETAILS": "Einzelheiten", + "STARTEDAT": "Startdatum", + "ENDEDAT": "Enddatum", + "TAG": "Tag", + "DETAILS": "Details", "BILLABLESECONDS": "Abrechenbare Sekunden", - "ANSWEREDAT": "Beantwortet bei", - "NOTE": "Hinweis", + "ANSWEREDAT": "Beantwortet am", + "NOTE": "Anmerkung", "CLOSE": "Schließen", - "SELECT_DATE": "Wählen Sie Startdatum", - "SELECT_TYPE": "Art auswählen", - "ABANDONEDCALLS": "Verlassene Warteschlangenanrufe", + "SELECT_DATE": "Datum auswählen", + "SELECT_TYPE": "Typ auswählen", + "ABANDONEDCALLS": "Abgebrochene Anrufe", "ADD_VOICEPREFIX": "Präfix hinzufügen", - "AGENTADD_VOICEPREFIX": "Fügen Sie Agent zu Präfix hinzu", + "AGENTADD_VOICEPREFIX": "Agenten hinzufügen", "DELETE_VOICEPREFIX": "Präfix löschen", "EDIT_VOICEPREFIX": "Präfix bearbeiten", "NEW_VOICEPREFIX": "Neues Präfix", - "VOICEPREFIXES": "Vorgegebene Präfixe", + "VOICEPREFIXES": "Präfixe", "CALLERIDALL": "Anruferidentifikation", "OUTBOUNDROUTE": "Ausgehende Route", - "LOGIN_TIME": "Login-Zeit", - "PAUSE_TIME": "Pausenzeit", - "DIALER": "Dialer", - "INBOUND": "Eingehende", + "LOGIN_TIME": "Zeit angemeldet", + "PAUSE_TIME": "Zeit in Pause", + "DIALER": "Outbound-Dialer", + "INBOUND": "Eingehend", "OUTBOUND": "Ausgehend", - "MANDATORYDISPOSITION": "Zwingende Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Status der obligatorischen Dispositionspause", - "TEAMS_ASSOCIATION": "Vereinigung der Mannschaften", - "CANT_DOWNLOAD_THIS_FILE": "Diese Datei kann nicht heruntergeladen werden", + "MANDATORYDISPOSITION": "Qualifizierung erforderlich", + "MANDATORYDISPOSITIONPAUSEID": "Agentenstatus während Qualifizierung", + "TEAMS_ASSOCIATION": "Teamzuweisung", + "CANT_DOWNLOAD_THIS_FILE": "Datei kann nicht heruntergeladen werden", "FILE_NOT_FOUND": "Datei nicht gefunden", - "SCREENRECORDING": "Bildschirmaufzeichnung verwalten", - "START_SCREENRECORDING": "Starten Sie die Bildschirmaufnahme", - "STOP_SCREENRECORDING": "Beenden Sie die Bildschirmaufnahme", - "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", - "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft", - "WRONG_EXTENSION": "Die Datei weist die falsche Erweiterung auf", + "SCREENRECORDING": "Bildschirmaufzeichnung", + "START_SCREENRECORDING": "Bildschirmaufzeichnung starten", + "STOP_SCREENRECORDING": "Bildschirmaufzeichnung anhalten", + "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufzeichnung nicht aktiv", + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufzeichnung aktiv", + "WRONG_EXTENSION": "Nebenstelle ungültig", "DOWNLOADTRANSCRIBE_VOICERECORDING": "Transkript herunterladen", "FAILUREREASON": "Fehlergrund", - "RUNSENTIMENT_VOICERECORDING": "Führen Sie Sentiment", - "RUNTRANSCRIBESENTIMENT_VOICERECORDING": "Führen Sie Transcribe & Sentiment aus", - "RUNTRANSCRIBE_VOICERECORDING": "Führen Sie Transcribe aus", - "SENTIMENT": "Gefühl", - "SENTIMENTANALYSIS": "Stimmungsanalyse", + "RUNSENTIMENT_VOICERECORDING": "Sentiment-Analyse starten", + "RUNTRANSCRIBESENTIMENT_VOICERECORDING": "Transkription und Sentiment-Analyse starten", + "RUNTRANSCRIBE_VOICERECORDING": "Transkription starten", + "SENTIMENT": "Sentiment", + "SENTIMENTANALYSIS": "Sentiment-Analyse", "SENTIMENT_MIXED": "Gemischt", "SENTIMENT_NEGATIVE": "Negativ", "SENTIMENT_NEUTRAL": "Neutral", "SENTIMENT_POSITIVE": "Positiv", "TEXT": "Text", - "TRANSCRIBE": "Transkribieren", - "TRANSCRIBESTATUS_COMPLETED": "Abgeschlossen", - "TRANSCRIBESTATUS_FAILED": "Gescheitert", - "TRANSCRIBESTATUS_IN_PROGRESS": "In Bearbeitung", - "TRANSCRIBESTATUS_NEW": "Neu", + "TRANSCRIBE": "Transkription erstellen", + "TRANSCRIBESTATUS_COMPLETED": "Transkription abgeschlossen", + "TRANSCRIBESTATUS_FAILED": "Transkription fehlgeschlagen", + "TRANSCRIBESTATUS_IN_PROGRESS": "Transkription in Bearbeitung", + "TRANSCRIBESTATUS_NEW": "nicht gestartet", "TRANSCRIPT": "Transkript", - "TRANSCRIPTANALYSIS": "Transkript & Analyse", - "SERVICELEVEL": "Service Level", - "SECOND_LEVEL_DISPOSITION": "Disposition der zweiten Ebene", - "THIRD_LEVEL_DISPOSITION": "Disposition der dritten Ebene", - "TEAMADD_VOICEPREFIX": "Team zum Präfix hinzufügen", + "TRANSCRIPTANALYSIS": "Transkription & Sentiment-Analyse", + "SERVICELEVEL": "Service-Level", + "SECOND_LEVEL_DISPOSITION": "Qualifizierung 2. Ebene", + "THIRD_LEVEL_DISPOSITION": "Qualifizierung 3. Ebene", "ALIAS": "Alias", - "MAXCAPACITY": "Max. Kapazität erreicht", - "WORKING": "am Arbeiten", "CALL_NUMBER_REDIRECT": "Auf welche Nummer möchten Sie den Anruf umleiten?", - "NO_AGENT_AVAILABLE": "Kein Agent verfügbar" + "MAXCAPACITY": "maximale Kapazität", + "NO_AGENT_AVAILABLE": "Kein Agent verfügbar", + "TEAMADD_VOICEPREFIX": "Team zu Präfix hinzufügen", + "WORKING": "Arbeiten" } } diff --git a/public/app/main/apps/voice/i18n/pt-BR.json b/public/app/main/apps/voice/i18n/pt-BR.json index 5fec1b5..7e2c6e6 100644 --- a/public/app/main/apps/voice/i18n/pt-BR.json +++ b/public/app/main/apps/voice/i18n/pt-BR.json @@ -10,7 +10,7 @@ "STATUS": "Status", "TIMER": "Cronômetro", "ALL": "Todos", - "IDLE": "Ocioso", + "IDLE": "Disponível", "EDIT_TRUNK": "Editar Tronco", "GOTO_VOICEQUEUE": "Ir para Filas de Voz em Tempo Real", "GOTOREALTIME_VOICEQUEUE": "Ir para Filas de Voz em Tempo Real", diff --git a/public/app/main/apps/whatsapp/i18n/de.json b/public/app/main/apps/whatsapp/i18n/de.json index 978ed15..3766778 100644 --- a/public/app/main/apps/whatsapp/i18n/de.json +++ b/public/app/main/apps/whatsapp/i18n/de.json @@ -1,247 +1,247 @@ { "WHATSAPP": { "ERRORS": { - "ACCESSKEYID_REQUIRED": "Pflichtfeld", - "ACCOUNTSID_REQUIRED": "Pflichtfeld", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", - "AGENT_REQUIRED": "Pflichtfeld", - "AGENT_TIMEOUT_REQUIRED": "Pflichtfeld", - "AUTHTOKEN_REQUIRED": "Pflichtfeld", - "BOTNAME_REQUIRED": "Pflichtfeld", - "COMMAND_REQUIRED": "Pflichtfeld", - "CONDITION_REQUIRED": "Pflichtfeld", - "DESCRIPTION_REQUIRED": "Pflichtfeld", - "DISPOSITION_REQUIRED": "Pflichtfeld", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", - "FALSEPRIORITY_REQUIRED": "Pflichtfeld", - "KEY_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", - "KEY_REQUIRED": "Pflichtfeld", - "LANGUAGE_REQUIRED": "Pflichtfeld", - "LEXREGION_REQUIRED": "Pflichtfeld", - "LIST_REQUIRED": "Pflichtfeld", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Pflichtfeld", - "NAME_REQUIRED": "Pflichtfeld", - "PHONE_REQUIRED": "Pflichtfeld", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", - "PRIORITY_REQUIRED": "Pflichtfeld", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Pflichtfeld", - "QUEUE_REQUIRED": "Pflichtfeld", - "SECRETACCESSKEY_REQUIRED": "Pflichtfeld", - "TAG_REQUIRED": "Pflichtfeld", - "TEXT_REQUIRED": "Pflichtfeld", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "TIMEOUT_REQUIRED": "Pflichtfeld", - "TIMES_REQUIRED": "Pflichtfeld", - "TOKEN_REQUIRED": "Pflichtfeld", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", - "TRUEPRIORITY_REQUIRED": "Pflichtfeld", - "TYPE_REQUIRED": "Pflichtfeld", - "VALUE_REQUIRED": "Pflichtfeld", - "VARIABLE_REQUIRED": "Pflichtfeld", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Der Wert muss größer oder gleich sein als", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Der Wert muss kleiner oder gleich sein", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Pflichtfeld", - "WELCOMEMESSAGE_MAX_LENGTH": "Der Wert muss eine maximale Länge von {{max}} haben", - "WELCOMEMESSAGE_REQUIRED": "Pflichtfeld", - "CLIENTEMAIL_REQUIRED": "Pflichtfeld", - "PRIVATEKEY_REQUIRED": "Pflichtfeld", - "PROJECTID_REQUIRED": "Pflichtfeld", - "BASEURL_REQUIRED": "Base_URL erforderlich" + "ACCESSKEYID_REQUIRED": "Zugangsschlüssel-ID erforderlich", + "ACCOUNTSID_REQUIRED": "Konto-ID erforderlich", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agententransfer muss größer oder gleich sein als", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Agententransfer muss kleiner oder gleich sein als", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Agententransfer erforderlich", + "AGENT_REQUIRED": "Agent erforderlich", + "AGENT_TIMEOUT_REQUIRED": "Zeitüberschreitung Agent erforderlich", + "AUTHTOKEN_REQUIRED": "Auth-Token erforderlich", + "BOTNAME_REQUIRED": "BOT-Name erforderlich", + "COMMAND_REQUIRED": "Eingabe erforderlich", + "CONDITION_REQUIRED": "Bedingung erforderlich", + "DESCRIPTION_REQUIRED": "Beschreibung erforderlich", + "DISPOSITION_REQUIRED": "Qualifizierung erforderlich", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei 'falsch' muss größer oder gleich sein als", + "FALSEPRIORITY_REQUIRED": "Priorität bei 'falsch' erforderlich", + "KEY_MAX_LENGTH": "Schlüssel darf eine maximale Länge von {{max}} haben", + "KEY_REQUIRED": "Schlüssel erforderlich", + "LANGUAGE_REQUIRED": "Sprache erforderlich", + "LEXREGION_REQUIRED": "Regio erforderlich", + "LIST_REQUIRED": "Liste erforderlich", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Agentenstatus während Qualifizierung erforderlich", + "NAME_REQUIRED": "Name erforderlich", + "PHONE_REQUIRED": "Telefon erforderlich", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität muss größer oder gleich sein als ", + "PRIORITY_REQUIRED": "Priorität erforderlich", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung Warteschlangentransfer muss größer oder gleich sein als", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung Warteschlangentransfer muss kleiner oder gleich sein als", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Zeitüberschreitung Warteschlangentransfer erforderlich", + "QUEUE_REQUIRED": "Warteschlange erforderlich", + "SECRETACCESSKEY_REQUIRED": "Geheimer Zugangsschlüssel erforderlich", + "TAG_REQUIRED": "Tag erforderlich", + "TEXT_REQUIRED": "Text erforderlich", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss größer oder gleich sein als", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Zeitüberschreitung muss kleiner oder gleich sein als", + "TIMEOUT_REQUIRED": "Zeitüberschreitung erforderlich", + "TIMES_REQUIRED": "Zeiten erforderlich", + "TOKEN_REQUIRED": "Token erforderlich", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Priorität bei 'wahr' muss größer oder gleich sein als", + "TRUEPRIORITY_REQUIRED": "Priorität bei 'wahr' erforderlich", + "TYPE_REQUIRED": "Typ erforderlich", + "VALUE_REQUIRED": "Wert erforderlich", + "VARIABLE_REQUIRED": "Variable erforderlich", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Warten auf zugew. Agenten muss größer oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Warten auf zugew. Agenten muss kleiner oder gleich sein als", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Warten auf zugew. Agenten erforderlich", + "WELCOMEMESSAGE_MAX_LENGTH": "Willkommensnachricht darf eine maximale Länge von {{max}} haben", + "WELCOMEMESSAGE_REQUIRED": "Willkommensnachricht erforderlich", + "CLIENTEMAIL_REQUIRED": "Kunden E-Mail erforderlich", + "PRIVATEKEY_REQUIRED": "Privater Schlüssel erforderlich", + "PROJECTID_REQUIRED": "Projekt-ID erforderlich", + "BASEURL_REQUIRED": "Pflichtfeld" }, "HELP": { - "LIST": "Kontaktmanagerliste zum Zuordnen von Kontakten", - "MANDATORYDISPOSITION": "Obligatorische Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause, um zu verwenden, wenn die obligatorische Disposition aktiviert ist", - "MOTIONPROXY": "Das Feld muss das folgende Format haben: : // [: ]. Beispiel: https: //X.Y.Z.W", + "LIST": "Zuordnung zu einer Liste im Kontaktmanager", + "MANDATORYDISPOSITION": "Qualifizierung erforderlich", + "MANDATORYDISPOSITIONPAUSEID": "Agentenstatus während Qualifizierung", + "MOTIONPROXY": "Gültiges Format: : // [: ]. Beispiel: https: //X.Y.Z.W", "NAME": "Es werden nur Zahlen, Buchstaben und bestimmte Zeichen (._) unterstützt", - "RECEIVEURL": "Dies ist die automatisch generierte API-Zeichenfolge, die Sie zum Empfangen der Nachrichten in Ihrem Konto von Ihrem WhatsApp Connector-Anbieter verwenden müssen (POST-Methode muss verwendet werden): Klicken Sie auf die Schaltfläche in der Zwischenablage, um sie zu kopieren", - "WELCOMEMESSAGE": "Dies ist die erste Antwortnachricht, die an neue Interaktionen gesendet wird" + "RECEIVEURL": "URL zum Empfangen von Nachrichten über die WhatsApp Business-API", + "WELCOMEMESSAGE": "Initiale Nachricht an den Kunden bei neuer Interaktion" }, "ACCESSKEYID": "Zugriffsschlüssel-ID", - "ACCOUNTSID": "Konto-SID", - "ACTIONS": "Aktionen", - "ADD_NOTE": "Notiz hinzufügen", - "ADD_WHATSAPPACCOUNT": "Hinzufügen", + "ACCOUNTSID": "Konto-ID", + "ACTIONS": "Routing", + "ADD_NOTE": "Anmerkung hinzufügen", + "ADD_WHATSAPPACCOUNT": "WhatsApp-Konto hinzufügen", "ADD_WHATSAPPCANNEDANSWER": "Vordefinierte Antwort hinzufügen", - "ADD_WHATSAPPDISPOSITION": "WhatsApp Disposition hinzufügen", + "ADD_WHATSAPPDISPOSITION": "Qualifizierung hinzufügen", "ADD_WHATSAPPQUEUE": "WhatsApp-Warteschlange hinzufügen", - "ADVANCED": "Fortgeschrittene", + "ADVANCED": "Fortgeschritten", "AGENT": "Agent", - "AGENTADD_QUEUE": "Agent zur WhatsApp-Warteschlange hinzufügen", - "AGENTADD_WHATSAPPACCOUNT": "Agent zum WhatsApp-Konto hinzufügen", - "AGENTADD_WHATSAPPQUEUE": "Agent zur WhatsApp-Warteschlange hinzufügen", + "AGENTADD_QUEUE": "Agenten hinzufügen", + "AGENTADD_WHATSAPPACCOUNT": "Agenten zum Konto hinzufügen", + "AGENTADD_WHATSAPPQUEUE": "Agenten hinzufügen", "AGENTS": "Agenten", - "AGENTSADD_QUEUE": "Hinzufügen von Agenten zur WhatsApp-Warteschlange", - "AGENTTRANSFER": "Agententransfer", - "AGENTTRANSFERTIMEOUT": "Zeitüberschreitung bei der Agentenübertragung", - "AGENT_TIMEOUT": "Agent Timeout", + "AGENTSADD_QUEUE": "Agenten hinzufügen", + "AGENTTRANSFER": "Transfer an Agenten erlauben", + "AGENTTRANSFERTIMEOUT": "Zeitüberschreitung Agententransfer", + "AGENT_TIMEOUT": "Zeitüberschreitung Agent", "ALL": "Alles", "ALL_AGENTS": "Alle Agenten", "ALL_TEAMS": "Alle Teams", - "AMAZONLEX": "AmazonLex", + "AMAZONLEX": "Amazon Lex", "AUTHTOKEN": "Auth Token", "AUTOREPLY": "Automatische Antwort", "BACK": "Zurück", - "BOTNAME": "Bot Name", - "BUSY": "Beschäftigt", + "BOTNAME": "BOT-Name", + "BUSY": "Besetzt", "CANNEDANSWERS": "Vordefinierte Antworten", - "CANNED_ANSWER_NOT_FOUND": "Es wurden keine vordefinierten Antworten gefunden", - "CANNED_ANSWER_SEARCH": "Geben Sie einen Text ein, um eine vordefinierte Antwort zu suchen", + "CANNED_ANSWER_NOT_FOUND": "Keine vordefinierten Antworten gefunden", + "CANNED_ANSWER_SEARCH": "Hier nach Textbaustein suchen", "CAPACITY": "Kapazität", "CLOSE": "Schließen", "CLOSED": "Geschlossen", "CLOSEMETHOD": "Methode schließen", "CLOSEURL": "URL schließen", - "COMMAND": "Befehl", + "COMMAND": "Eingabe", "CONDITION": "Bedingung", "CONTACT": "Kontakt", - "CREATED_AT": "Hergestellt in", - "DEFAULT_PAUSE": "STANDARD PAUSE", + "CREATED_AT": "Erstellt am", + "DEFAULT_PAUSE": "Standard-Pause", "DELETE": "Löschen", "DELETE_INTERACTION": "Interaktion löschen", - "DELETE_SELECTED": "Ausgewählte löschen", + "DELETE_SELECTED": "Ausgewählte Einträge löschen", "DELETE_WHATSAPPACCOUNT": "WhatsApp-Konto löschen", "DELETE_WHATSAPPCANNEDANSWER": "Vordefinierte Antwort löschen", - "DELETE_WHATSAPPDISPOSITION": "WhatsApp-Disposition löschen", - "DELETE_WHATSAPPQUEUE": "WhatsApp-Warteschlange löschen", + "DELETE_WHATSAPPDISPOSITION": "Qualifizierung löschen", + "DELETE_WHATSAPPQUEUE": "Warteschlange löschen", "DESCRIPTION": "Beschreibung", "DIALOGFLOW": "DialogFlow", - "DISPOSITION": "Anordnung", - "DISPOSITIONS": "Dispositionen", - "DOWNLOAD_INTERACTION": "Herunterladen", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Ohne Anhänge herunterladen", - "DOWNLOAD_WITH_ATTACHMENTS": "Mit Anhängen herunterladen", - "EDIT_AGENT": "Agent bearbeiten", - "EDIT_AMAZONLEX": "Bearbeiten Sie die Lex-Konfiguration", + "DISPOSITION": "Qualifizierung", + "DISPOSITIONS": "Qualifizierungen", + "DOWNLOAD_INTERACTION": "Interaktion herunterladen", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Herunterladen ohne Anhänge", + "DOWNLOAD_WITH_ATTACHMENTS": "Herunterladen inkl. Anhängen", + "EDIT_AGENT": "Agenten bearbeiten", + "EDIT_AMAZONLEX": "Lex-Konfiguration bearbeiten", "EDIT_AUTOREPLY": "Automatische Antwort bearbeiten", - "EDIT_CLOSE": "Bearbeiten Schließen", - "EDIT_DIALOGFLOW": "Bearbeiten Sie die DialogFlow-Konfiguration", - "EDIT_GOTOIF": "Bearbeiten Sie Gotoif", - "EDIT_GOTOP": "Gotop bearbeiten", - "EDIT_NOOP": "Noop bearbeiten", + "EDIT_CLOSE": "Verhalten bei Schließen bearbeiten", + "EDIT_DIALOGFLOW": "DialogFlow-Konfiguration bearbeiten", + "EDIT_GOTOIF": "GoToIf bearbeiten", + "EDIT_GOTOP": "GoToP bearbeiten", + "EDIT_NOOP": "NoOp bearbeiten", "EDIT_QUEUE": "Warteschlange bearbeiten", "EDIT_SYSTEM": "System bearbeiten", "EDIT_TAG": "Tag bearbeiten", "EDIT_WHATSAPPACCOUNT": "WhatsApp-Konto bearbeiten", "EDIT_WHATSAPPCANNEDANSWER": "Vordefinierte Antwort bearbeiten", - "EDIT_WHATSAPPDISPOSITION": "WhatsApp-Disposition bearbeiten", - "EDIT_WHATSAPPQUEUE": "Bearbeiten Sie die WhatsApp-Warteschlange", - "FALSEPRIORITY": "Falsche Priorität", - "GENERAL": "Allgemeines", - "GOTOIF": "Gotoif", - "GOTOP": "Zum Seitenanfang", - "GOTOREALTIME_WHATSAPPQUEUE": "Wechseln Sie zur WhatsApp-Warteschlange in Echtzeit", - "GO_TO_WHATSAPPACCOUNTS": "Gehe zu Konto", - "ID": "Ich würde", + "EDIT_WHATSAPPDISPOSITION": "Qualifizierung bearbeiten", + "EDIT_WHATSAPPQUEUE": "Warteschlange bearbeiten", + "FALSEPRIORITY": "Priorität bei 'falsch'", + "GENERAL": "Allgemeine", + "GOTOIF": "Bedingter Absprung (GoToIf)", + "GOTOP": "Absprung auf Anwendung (GoToP)", + "GOTOREALTIME_WHATSAPPQUEUE": "Direkt zur Echtzeit-Ansicht", + "GO_TO_WHATSAPPACCOUNTS": "Direkt zum WhatsApp-Konto", + "ID": "ID", "IDLE": "Leerlauf", "INSERT_MESSAGE_HERE": "Nachricht hier einfügen", "INTERACTIONS": "Interaktionen", - "INTERACTIONS_WHATSAPPACCOUNT": "Gehen Sie zu Interaktionen", + "INTERACTIONS_WHATSAPPACCOUNT": "Zu den Interaktionen", "KEY": "Schlüssel", "LANGUAGE": "Sprache", "LASTMESSAGE": "Letzte Nachricht", "LEXREGION": "Region", - "LIST": "Aufführen", - "LOGGED_IN": "Eingeloggt (SIP verbunden)", + "LIST": "Liste", + "LOGGED_IN": "Angemeldet", "LOGIN_TIME": "Anmeldezeit", - "LOGOUT": "Ausloggen", - "MANDATORYDISPOSITION": "Obligatorische Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause, um zu verwenden, wenn die obligatorische Disposition aktiviert ist", + "LOGOUT": "Abgemeldet", + "MANDATORYDISPOSITION": "Qualifizierung erforderlich", + "MANDATORYDISPOSITIONPAUSEID": "Agentenstatus während Qualifizierung", "MORE": "Mehr", - "MOTIONPROXY": "Proxy- oder Bewegungsdomäne", - "MULTI_SELECT_TOGGLE": "Mehrfachauswahl umschalten", + "MOTIONPROXY": "Proxy-Domäne", + "MULTI_SELECT_TOGGLE": "Umschalten Mehrfachauswahl", "NAME": "Name", "NEW_WHATSAPPACCOUNT": "Neues WhatsApp-Konto", - "NEW_WHATSAPPCANNEDANSWER": "Neue vordefinierte WhatsApp-Antwort", - "NEW_WHATSAPPDISPOSITION": "Neue WhatsApp-Disposition", + "NEW_WHATSAPPCANNEDANSWER": "Neue vordefinierte Antwort", + "NEW_WHATSAPPDISPOSITION": "Neue Qualifizierung", "NEW_WHATSAPPQUEUE": "Neue WhatsApp-Warteschlange", - "NOOP": "Noop", - "NOTE": "Hinweis", + "NOOP": "Log erstellen (NoOp)", + "NOTE": "Anmerkung", "NOTIFICATION": "Benachrichtigung", - "NOTIFICATIONSHAKE": "Shake", - "NOTIFICATIONSOUND": "Klang", + "NOTIFICATIONSHAKE": "Schütteln", + "NOTIFICATIONSOUND": "Ton abspielen", "NOTIFICATIONTEMPLATE": "Vorlage", "NO_AGENT_ONLINE": "Kein Agent online", - "NO_AVAILABLE_INFO": "Keine verfügbaren Informationen", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", "NO_INTERACTION_AVAILABLE": "Keine Interaktionen verfügbar", - "NO_WHATSAPPCANNEDANSWER_AVAILABLE": "Keine vordefinierten WhatsApp-Antworten verfügbar", - "NO_WHATSAPPDISPOSITION_AVAILABLE": "Keine WhatsApp-Dispositionen verfügbar", + "NO_WHATSAPPCANNEDANSWER_AVAILABLE": "Keine vordefinierten Antworten verfügbar", + "NO_WHATSAPPDISPOSITION_AVAILABLE": "Keine Qualifizierungen verfügbar", "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "Keine WhatsApp-Konten verfügbar", "OF": "von", "OPENED": "Geöffnet", "PAGE": "Seite", "PARTIALPAUSE": "Teilpause", "PAUSE": "Pause", - "PAUSED": "Pause", - "PAUSE_TIME": "Pausenzeit", + "PAUSED": "in Pause", + "PAUSE_TIME": "Zeit in Pause", "PHONE": "Telefon", "PRIORITY": "Priorität", "PROXY": "Proxy", "QUEUE": "Warteschlange", "QUEUES": "Warteschlangen", - "QUEUETRANSFER": "Warteschlangenübertragung", - "QUEUETRANSFERTIMEOUT": "Zeitüberschreitung bei der Warteschlangenübertragung", + "QUEUETRANSFER": "Transfer an Warteschlange erlauben", + "QUEUETRANSFERTIMEOUT": "Zeitüberschreitung Warteschlangentransfer", "READY": "Bereit", - "REALTIME": "Echtzeit", - "RECEIVEURL": "URL erhalten", + "REALTIME": "Echtzeit-Ansicht", + "RECEIVEURL": "URL für Erhalt von Nachrichten", "REFRESH_INTERACTIONS": "Interaktionen aktualisieren", - "REMOTE": "Fernbedienung", + "REMOTE": "Fernzugriff", "ROWSPERPAGE": "Zeilen pro Seite", - "SAVE": "sparen", + "SAVE": "Speichern", "SCREENRECORDING": "Bildschirmaufzeichnung verwalten", "SEARCH_FOR_ANYONE": "Suche", - "SECRETACCESSKEY": "Zugriffsschlüsselgeheimnis", + "SECRETACCESSKEY": "Geheimer Zugangsschlüssel", "SELECTED": "Ausgewählt", "SELECTED_AGENTS": "Ausgewählte Agenten", "SELECTED_TEAMS": "Ausgewählte Teams", - "SELECT_ALL": "Wählen Sie Alle", - "SELECT_NONE": "Nichts ausgewählt", + "SELECT_ALL": "Alles auswählen", + "SELECT_NONE": "Nichts auswählen", "SEND": "Senden", - "SETTINGS": "die Einstellungen", - "SPYINTERACTION": "Spionage-Interaktion", - "STARTEDAT": "Fing an bei", - "START_SCREENRECORDING": "Bildschirmaufnahme starten", + "SETTINGS": "Einstellungen", + "SPYINTERACTION": "Interaktion anzeigen", + "STARTEDAT": "Startdatum", + "START_SCREENRECORDING": "Bildschirmaufzeichnung starten", "STATUS": "Status", "STOP_SCREENRECORDING": "Bildschirmaufzeichnung stoppen", - "STRATEGY": "Strategie", + "STRATEGY": "Verteilungsstrategie", "SYSTEM": "System", - "TAG": "Etikett", - "TAGS": "Stichworte", - "TEAMADD_WHATSAPPQUEUE": "Team zur WhatsApp-Warteschlange hinzufügen", - "TEAMS_ASSOCIATION": "Mannschaftsverband", + "TAG": "Tag", + "TAGS": "Tags", + "TEAMADD_WHATSAPPQUEUE": "Team hinzufügen", + "TEAMS_ASSOCIATION": "Teamzuweisung", "TEXT": "Text", - "TIMEOUT": "Auszeit", + "TIMEOUT": "Zeitüberschreitung", "TIMER": "Timer", - "TIMES": "Mal", - "TO": "Zu", - "TOKEN": "Zeichen", - "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufnahme verfügbar", - "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufnahme läuft", + "TIMES": "Zeiten", + "TO": "An", + "TOKEN": "Token", + "TOOLTIP_SCREENRECORDING_OFF": "Bildschirmaufzeichnung deaktiviert", + "TOOLTIP_SCREENRECORDING_ON": "Bildschirmaufzeichnung aktiv", "TRANSFER": "Transfer", - "TRUEPRIORITY": "Wahre Priorität", - "TYPE": "Art", + "TRUEPRIORITY": "Priorität bei 'wahr'", + "TYPE": "Typ", "UNPAUSE": "Pause beenden", "VALUE": "Wert", "VARIABLE": "Variable", - "WAITFORTHEASSIGNEDAGENT": "Warten Sie auf den zugewiesenen Agenten", - "WAITING": "Warten", + "WAITFORTHEASSIGNEDAGENT": "Auf zugewiesenen Agenten warten", + "WAITING": "Wartezustand", "WELCOMEMESSAGE": "Willkommensnachricht", - "WHATSAPP": "WhatsApp Connector", + "WHATSAPP": "WhatsApp", "WHATSAPPACCOUNTS": "WhatsApp-Konten", "WHATSAPPCANNEDANSWERS": "WhatsApp vordefinierte Antworten", - "WHATSAPPDISPOSITIONS": "WhatsApp Dispositionen", - "WHATSAPPQUEUES": "WhatsApp-Warteschlangen", - "CLIENTEMAIL": "Kunden-E-Mail", - "DIALOGFLOWV2": "Dialogflow V2", - "EDIT_DIALOGFLOWV2": "Dialogflow V2 bearbeiten", - "PRIVATEKEY": "Privat Schlüssel", + "WHATSAPPDISPOSITIONS": "WhatsApp Qualifizierungen", + "WHATSAPPQUEUES": "WhatsApp Warteschlangen", + "CLIENTEMAIL": "Kunden E-Mail", + "DIALOGFLOWV2": "DialogFlow V2", + "EDIT_DIALOGFLOWV2": "DialogFlow V2 bearbeiten", + "PRIVATEKEY": "Privater Schlüssel", "PROJECTID": "Projekt-ID", - "BASEURL": "Base_URL", - "DELIVERYREPORTURL": "URL für Erhalt" + "BASEURL": "Basis-URL", + "DELIVERYREPORTURL": "URL des Übermittlungsberichts" } } diff --git a/public/app/main/apps/whatsapp/i18n/is.json b/public/app/main/apps/whatsapp/i18n/is.json index 68808ad..e23ddb0 100644 --- a/public/app/main/apps/whatsapp/i18n/is.json +++ b/public/app/main/apps/whatsapp/i18n/is.json @@ -1,247 +1,247 @@ { "WHATSAPP": { - "EDIT_DIALOGFLOWV2": "Edit Dialogflow V2", - "DIALOGFLOWV2": "Dialogflow V2", - "PRIVATEKEY": "Private Key", - "CLIENTEMAIL": "Client Email", - "PROJECTID": "Project ID", - "ACCESSKEYID": "Access Key ID", - "ACCOUNTSID": "Account SID", - "ACTIONS": "Actions", - "ADD_NOTE": "Add note", - "ADD_WHATSAPPACCOUNT": "Add", - "ADD_WHATSAPPCANNEDANSWER": "Add Canned Answer", - "ADD_WHATSAPPDISPOSITION": "Add WhatsApp Disposition", - "ADD_WHATSAPPQUEUE": "Add WhatsApp queue", - "ADVANCED": "Advanced", - "AGENT": "Agent", - "AGENT_TIMEOUT": "Agent Timeout", - "AGENTADD_QUEUE": "Add Agent To WhatsApp Queue", - "AGENTADD_WHATSAPPACCOUNT": "Add Agent To WhatsApp Account", - "AGENTADD_WHATSAPPQUEUE": "Add Agent To WhatsApp Queue", - "AGENTS": "Agents", - "AGENTSADD_QUEUE": "Add agents to WhatsApp queue", - "AGENTTRANSFER": "Agent Transfer", - "AGENTTRANSFERTIMEOUT": "Agent Transfer Timeout", - "ALL": "All", - "ALL_AGENTS": "All Agents", - "ALL_TEAMS": "All Teams", + "EDIT_DIALOGFLOWV2": "Breyttu Dialogflow V2", + "DIALOGFLOWV2": "Samskiptaflði V2", + "PRIVATEKEY": "Einka lykill", + "CLIENTEMAIL": "Notanda netfang", + "PROJECTID": "Auðkenni verkefnis", + "ACCESSKEYID": "Auðkenni aðgangslykils", + "ACCOUNTSID": "Reyknings auðkenni", + "ACTIONS": "Aðgerð", + "ADD_NOTE": "Bættu við skilaboðum", + "ADD_WHATSAPPACCOUNT": "Bæta við", + "ADD_WHATSAPPCANNEDANSWER": "Bæta við framhalds svari", + "ADD_WHATSAPPDISPOSITION": "Bættu við í WhatsApp", + "ADD_WHATSAPPQUEUE": "Bættu við WhatsApp röð", + "ADVANCED": "Þróða", + "AGENT": "Fulltrúi", + "AGENT_TIMEOUT": "Of langur tími á fulltrúa", + "AGENTADD_QUEUE": "Bættu við fulltrúa í WhatsApp biðröðina", + "AGENTADD_WHATSAPPACCOUNT": "Bættu við fulltrúa í WhatsApp reikninginn", + "AGENTADD_WHATSAPPQUEUE": "Bættu við fulltrúa í WhatsApp biðröðina", + "AGENTS": "Fulltrúi", + "AGENTSADD_QUEUE": "Bættu við fulltrúa í WhatsApp biðröðina", + "AGENTTRANSFER": "Fulltrúi fluttur", + "AGENTTRANSFERTIMEOUT": "Of langur tími á flutningi", + "ALL": "Allt", + "ALL_AGENTS": "Allir fulltrúar", + "ALL_TEAMS": "allir hópar", "AMAZONLEX": "AmazonLex", "AUTHTOKEN": "Auth Token", - "AUTOREPLY": "Auto Reply", - "BACK": "Back", - "BASEURL": "Base URL", - "BOTNAME": "Bot Name", - "BUSY": "Busy", - "CANNED_ANSWER_NOT_FOUND": "No Canned Answers were found", - "CANNED_ANSWER_SEARCH": "Enter a text to search a Canned Answer", - "CANNEDANSWERS": "Canned Answers", - "CAPACITY": "Capacity", - "CLOSE": "Close", - "CLOSED": "Closed", - "CLOSEMETHOD": "Close Method", - "CLOSEURL": "Close URL", - "COMMAND": "Command", - "CONDITION": "Condition", - "CONTACT": "Contact", - "CREATED_AT": "Created at", - "DEFAULT_PAUSE": "DEFAULT PAUSE", - "DELETE": "Delete", - "DELETE_INTERACTION": "Delete Interaction", - "DELETE_SELECTED": "Delete selected", - "DELETE_WHATSAPPACCOUNT": "Delete WhatsApp Account", - "DELETE_WHATSAPPCANNEDANSWER": "Deleted", - "DELETE_WHATSAPPDISPOSITION": "Delete WhatsApp Disposition", - "DELETE_WHATSAPPQUEUE": "Delete WhatsApp Queue", - "DESCRIPTION": "Description", - "DIALOGFLOW": "DialogFlow", - "DISPOSITION": "Disposition", - "DISPOSITIONS": "Dispositions", - "DOWNLOAD_INTERACTION": "Download", - "DOWNLOAD_WITH_ATTACHMENTS": "Download With Attachments", - "DOWNLOAD_WITHOUT_ATTACHMENTS": "Download Without Attachments", - "EDIT_AGENT": "Edit Agent", - "EDIT_AMAZONLEX": "Edit Lex configuration", - "EDIT_AUTOREPLY": "Edit Auto Reply", - "EDIT_CLOSE": "Edit Close", - "EDIT_DIALOGFLOW": "Edit DialogFlow configuration", - "EDIT_GOTOIF": "Edit Gotoif", - "EDIT_GOTOP": "Edit Gotop", - "EDIT_NOOP": "Edit Noop", + "AUTOREPLY": "Sjálfvirkt svar", + "BACK": "Til baka", + "BASEURL": "Grunn URL", + "BOTNAME": "Nafn á botta", + "BUSY": "Upptekin", + "CANNED_ANSWER_NOT_FOUND": "Ekkert tengt svar fannst", + "CANNED_ANSWER_SEARCH": "Settu inn texta til að leita að tengdu svari", + "CANNEDANSWERS": "Tengt svar", + "CAPACITY": "Geta/magn", + "CLOSE": "Loka", + "CLOSED": "Lokað", + "CLOSEMETHOD": "Loka aðferð", + "CLOSEURL": "Loka URL", + "COMMAND": "Skipun", + "CONDITION": "Skilyrði", + "CONTACT": "Tengiliður", + "CREATED_AT": "Stofnað kl.", + "DEFAULT_PAUSE": "Staðlað hlé", + "DELETE": "Eyða", + "DELETE_INTERACTION": "Eyða samskiptum", + "DELETE_SELECTED": "Eyða völdu", + "DELETE_WHATSAPPACCOUNT": "Eyða WhatsApp reikningi", + "DELETE_WHATSAPPCANNEDANSWER": "Eytt", + "DELETE_WHATSAPPDISPOSITION": "Eyða WhatsApp ráðstöfuninni", + "DELETE_WHATSAPPQUEUE": "Eyða WhatsApp biðröð", + "DESCRIPTION": "Lýsing", + "DIALOGFLOW": "Samskiptaflæði", + "DISPOSITION": "Ráðstöfun", + "DISPOSITIONS": "Ráðstöfun", + "DOWNLOAD_INTERACTION": "Niðurhal", + "DOWNLOAD_WITH_ATTACHMENTS": "Niðurhal með viðhengi", + "DOWNLOAD_WITHOUT_ATTACHMENTS": "Niðurhal án viðhengis", + "EDIT_AGENT": "Breyttu fulltrúa", + "EDIT_AMAZONLEX": "Breyttu Lex stillingum", + "EDIT_AUTOREPLY": "Breyttu sjálfvirku svari", + "EDIT_CLOSE": "Breyttu lokun", + "EDIT_DIALOGFLOW": "Breyttu DialogFlow stillingum", + "EDIT_GOTOIF": "Breyttu Gotoif", + "EDIT_GOTOP": "Breyttu Gotop", + "EDIT_NOOP": "Breyttu Noop", "EDIT_QUEUE": "Edit Queue", - "EDIT_SYSTEM": "Edit System", - "EDIT_TAG": "Edit Tag", - "EDIT_WHATSAPPACCOUNT": "Edit WhatsApp Account", - "EDIT_WHATSAPPCANNEDANSWER": "Edit", - "EDIT_WHATSAPPDISPOSITION": "Edit WhatsApp Disposition", - "EDIT_WHATSAPPQUEUE": "Edit WhatsApp Queue", + "EDIT_SYSTEM": "Breyttu System", + "EDIT_TAG": "Breyttu töggum", + "EDIT_WHATSAPPACCOUNT": "Breyttu WhatsApp reikningi", + "EDIT_WHATSAPPCANNEDANSWER": "Breyta", + "EDIT_WHATSAPPDISPOSITION": "Breyttu WhatsApp ráðstöfuninni", + "EDIT_WHATSAPPQUEUE": "Breyttu WhatsApp biðröð", "ERRORS": { - "PROJECTID_REQUIRED": "Mandatory Field", - "CLIENTEMAIL_REQUIRED": "Mandatory Field", - "PRIVATEKEY_REQUIRED": "Mandatory Field", - "ACCESSKEYID_REQUIRED": "Mandatory Field", - "ACCOUNTSID_REQUIRED": "Mandatory Field", - "AGENT_REQUIRED": "Mandatory Field", - "AGENT_TIMEOUT_REQUIRED": "Mandatory Field", - "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", - "AGENTTRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "AUTHTOKEN_REQUIRED": "Mandatory Field", - "BASEURL_REQUIRED": "Mandatory Field", - "BOTNAME_REQUIRED": "Mandatory Field", - "COMMAND_REQUIRED": "Mandatory Field", - "CONDITION_REQUIRED": "Mandatory Field", - "DESCRIPTION_REQUIRED": "Mandatory Field", - "DISPOSITION_REQUIRED": "Mandatory Field", - "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "FALSEPRIORITY_REQUIRED": "Mandatory Field", - "KEY_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "KEY_REQUIRED": "Mandatory Field", - "LANGUAGE_REQUIRED": "Mandtory Field", - "LEXREGION_REQUIRED": "Mandatory Field", - "LIST_REQUIRED": "Mandatory Field", - "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Mandatory Field", - "NAME_REQUIRED": "Mandatory Field", - "PHONE_REQUIRED": "Mandatory Field", - "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "PRIORITY_REQUIRED": "Mandatory Field", - "QUEUE_REQUIRED": "Mandatory Field", - "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", - "QUEUETRANSFERTIMEOUT_REQUIRED": "Mandatory Field", - "SECRETACCESSKEY_REQUIRED": "Mandatory Field", - "TAG_REQUIRED": "Mandatory Field", - "TEXT_REQUIRED": "Mandatory Field", - "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", - "TIMEOUT_REQUIRED": "Mandatory Field", - "TIMES_REQUIRED": "Mandatory Field", - "TOKEN_REQUIRED": "Mandatory Field", - "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "TRUEPRIORITY_REQUIRED": "Mandatory Field", - "TYPE_REQUIRED": "Mandatory Field", - "VALUE_REQUIRED": "Mandatory Field", - "VARIABLE_REQUIRED": "Mandatory Field", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "The value must be greater or equal than", - "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "The value must be less or equal than", - "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Mandatory Field", - "WELCOMEMESSAGE_MAX_LENGTH": "The value must have a maximum length equal to {{max}}", - "WELCOMEMESSAGE_REQUIRED": "Mandatory Field" + "PROJECTID_REQUIRED": "Skilyrtur reitur", + "CLIENTEMAIL_REQUIRED": "Skilyrtur reitur", + "PRIVATEKEY_REQUIRED": "Skilyrtur reitur", + "ACCESSKEYID_REQUIRED": "Skilyrtur reitur", + "ACCOUNTSID_REQUIRED": "Skilyrtur reitur", + "AGENT_REQUIRED": "Skilyrtur reitur", + "AGENT_TIMEOUT_REQUIRED": "Skilyrtur reitur", + "AGENTTRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gildið verður að vera jafnt eða stærra en", + "AGENTTRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Gildið verður að vera minna eða jafnt en", + "AGENTTRANSFERTIMEOUT_REQUIRED": "Skilyrtur reitur", + "AUTHTOKEN_REQUIRED": "Skilyrtur reitur", + "BASEURL_REQUIRED": "Skilyrtur reitur", + "BOTNAME_REQUIRED": "Skilyrtur reitur", + "COMMAND_REQUIRED": "Skilyrtur reitur", + "CONDITION_REQUIRED": "Skilyrtur reitur", + "DESCRIPTION_REQUIRED": "Skilyrtur reitur", + "DISPOSITION_REQUIRED": "Skilyrtur reitur", + "FALSEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gildið verður að vera jafnt eða stærra en", + "FALSEPRIORITY_REQUIRED": "Skilyrtur reitur", + "KEY_MAX_LENGTH": "Gildið verður að vera að hámarki eða jafnt og {{max}}", + "KEY_REQUIRED": "Skilyrtur reitur", + "LANGUAGE_REQUIRED": "Skilyrtur reitur", + "LEXREGION_REQUIRED": "Skilyrtur reitur", + "LIST_REQUIRED": "Skilyrtur reitur", + "MANDATORYDISPOSITIONPAUSEID_REQUIRED": "Skilyrtur reitur", + "NAME_REQUIRED": "Skilyrtur reitur", + "PHONE_REQUIRED": "Skilyrtur reitur", + "PRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gildið verður að vera jafnt eða stærra en", + "PRIORITY_REQUIRED": "Skilyrtur reitur", + "QUEUE_REQUIRED": "Skilyrtur reitur", + "QUEUETRANSFERTIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gildið verður að vera jafnt eða stærra en", + "QUEUETRANSFERTIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Gildið verður að vera minna eða jafnt en", + "QUEUETRANSFERTIMEOUT_REQUIRED": "Skilyrtur reitur", + "SECRETACCESSKEY_REQUIRED": "Skilyrtur reitur", + "TAG_REQUIRED": "Skilyrtur reitur", + "TEXT_REQUIRED": "Skilyrtur reitur", + "TIMEOUT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gildið verður að vera jafnt eða stærra en", + "TIMEOUT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Gildið verður að vera minna eða jafnt en", + "TIMEOUT_REQUIRED": "Skilyrtur reitur", + "TIMES_REQUIRED": "Skilyrtur reitur", + "TOKEN_REQUIRED": "Skilyrtur reitur", + "TRUEPRIORITY_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gildið verður að vera jafnt eða stærra en", + "TRUEPRIORITY_REQUIRED": "Skilyrtur reitur", + "TYPE_REQUIRED": "Skilyrtur reitur", + "VALUE_REQUIRED": "Skilyrtur reitur", + "VARIABLE_REQUIRED": "Skilyrtur reitur", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_GREATER_THAN_OR_EQUAL_TO": "Gildið verður að vera jafnt eða stærra en", + "WAITFORTHEASSIGNEDAGENT_MUST_BE_LESS_THAN_OR_EQUAL_TO": "Gildið verður að vera minna eða jafnt en", + "WAITFORTHEASSIGNEDAGENT_REQUIRED": "Skilyrtur reitur", + "WELCOMEMESSAGE_MAX_LENGTH": "Gildið verður að vera að hámarki eða jafnt og {{max}}", + "WELCOMEMESSAGE_REQUIRED": "Skilyrtur reitur" }, - "FALSEPRIORITY": "False Priority", - "GENERAL": "General", - "GO_TO_WHATSAPPACCOUNTS": "Go To Account", + "FALSEPRIORITY": "Rangur forgangur", + "GENERAL": "Almennt", + "GO_TO_WHATSAPPACCOUNTS": "Farðu í reikning", "GOTOIF": "Gotoif", "GOTOP": "Gotop", - "GOTOREALTIME_WHATSAPPQUEUE": "Go To Realtime WhatsApp Queue", + "GOTOREALTIME_WHATSAPPQUEUE": "Go To Realtime WhatsApp biðröð", "HELP": { - "LIST": "Contact Manager list used to associate contacts", - "MANDATORYDISPOSITION": "Mandatory disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled", - "MOTIONPROXY": "The field must have the following format: ://[:]. Example: https://X.Y.Z.W", - "NAME": "Only numbers, letters and specific characters (._) are supported", - "RECEIVEURL": "This is the auto-generated API string you need to use to receive the messages inside your account from your WhatsApp Connector provider (POST method must be used): click the clipboard button to copy it", - "WELCOMEMESSAGE": "This is the first response message sent to new interactions" + "LIST": "Tengiliða listi er notaður tengja við tengiliði", + "MANDATORYDISPOSITION": "Skilyrtur reitur", + "MANDATORYDISPOSITIONPAUSEID": "Gera hlé þegar skilyrt ráðstöfun er virk", + "MOTIONPROXY": "Reiturinn þarf að hafa eftirfarandi snið: ://[:]. Example: https://X.Y.Z.W", + "NAME": "Einungis tölustafir, bókstafir og skilgreindir stafir (._) eru studdir", + "RECEIVEURL": "Þetta er sjálfvirkur API strengur sem þú þarft að nota til að fá skilaboðin inn í WhatsApp tengilinn sem er í boði (POST method must be used): click the clipboard button to copy it", + "WELCOMEMESSAGE": "Þetta eru fyrstu skilaboðin sem eru send til nýrra aðila" }, - "ID": "Id", - "IDLE": "Idle", - "INSERT_MESSAGE_HERE": "Insert message here", - "INTERACTIONS": "Interactions", - "INTERACTIONS_WHATSAPPACCOUNT": "Go to Interactions", - "KEY": "Key", - "LANGUAGE": "Language", - "LASTMESSAGE": "Last Message", - "LEXREGION": "Region", - "LIST": "List", - "LOGGED_IN": "Logged In (SIP Connected)", - "LOGIN_TIME": "Login Time", - "LOGOUT": "Logout", - "MANDATORYDISPOSITION": "Mandatory Disposition", - "MANDATORYDISPOSITIONPAUSEID": "Pause to use when mandatory disposition is enabled", - "MORE": "More", + "ID": "auðkenni", + "IDLE": "Engin aðgerð", + "INSERT_MESSAGE_HERE": "Settu inn skilaboðin hér", + "INTERACTIONS": "Samskipti", + "INTERACTIONS_WHATSAPPACCOUNT": "Farðu í samskipti", + "KEY": "Lykill", + "LANGUAGE": "Tungumál", + "LASTMESSAGE": "Síðustu skilaboð", + "LEXREGION": "Landssvæði", + "LIST": "Listi", + "LOGGED_IN": "Loggasður inn(SIP Connected)", + "LOGIN_TIME": "Innskráningar tími", + "LOGOUT": "Útskrá", + "MANDATORYDISPOSITION": "Skilyrt ráðstöfun", + "MANDATORYDISPOSITIONPAUSEID": "Gera hlé þegar skilyrt ráðstöfun er virk", + "MORE": "Meira", "MOTIONPROXY": "Proxy Or Motion Domain", - "MULTI_SELECT_TOGGLE": "Multi select toggle", - "NAME": "Name", - "NEW_WHATSAPPACCOUNT": "New WhatsApp Account", - "NEW_WHATSAPPCANNEDANSWER": "New WhatsApp Canned Answer", - "NEW_WHATSAPPDISPOSITION": "New WhatsApp Disposition", - "NEW_WHATSAPPQUEUE": "New WhatsApp Queue", - "NO_AGENT_ONLINE": "No Agent Online", - "NO_AVAILABLE_INFO": "No Available Info", - "NO_INTERACTION_AVAILABLE": "No Interactions Available", - "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "No WhatsApp Accounts available", - "NO_WHATSAPPCANNEDANSWER_AVAILABLE": "No WhatsApp Canned Answers Available", - "NO_WHATSAPPDISPOSITION_AVAILABLE": "No WhatsApp Dispositions Available", + "MULTI_SELECT_TOGGLE": "Fjölsvalrofi", + "NAME": "Nafn", + "NEW_WHATSAPPACCOUNT": "Nýr WhatsApp reikningur", + "NEW_WHATSAPPCANNEDANSWER": "Nýtt WhatsApp samtengt svar", + "NEW_WHATSAPPDISPOSITION": "Ný WhatsApp ráðstöfun", + "NEW_WHATSAPPQUEUE": "Ný WhatsApp röð", + "NO_AGENT_ONLINE": "engin fulltrúi er Online", + "NO_AVAILABLE_INFO": "Engar upplýsingar aðgengilegar", + "NO_INTERACTION_AVAILABLE": "Engin skilaboð eru til staðar", + "NO_WHATSAPP_ACCOUNTS_AVAILABLE": "Engin WhatsApp reikningur í boði", + "NO_WHATSAPPCANNEDANSWER_AVAILABLE": "Engin WhatsApp tengd svör í boði", + "NO_WHATSAPPDISPOSITION_AVAILABLE": "engin WhatsApp ráðstöfun er í boði", "NOOP": "Noop", - "NOTE": "Note", - "NOTIFICATION": "Notification", - "NOTIFICATIONSHAKE": "Shake", - "NOTIFICATIONSOUND": "Sound", - "NOTIFICATIONTEMPLATE": "Template", - "OF": "of", - "OPENED": "Opened", - "PAGE": "Page", - "PARTIALPAUSE": "Partial Pause", - "PAUSE": "Pause", - "PAUSE_TIME": "Pause Time", - "PAUSED": "Paused", - "PHONE": "Phone", - "PRIORITY": "Priority", + "NOTE": "Skilaboð", + "NOTIFICATION": "Skilaboð", + "NOTIFICATIONSHAKE": "Hrista", + "NOTIFICATIONSOUND": "Hljóð", + "NOTIFICATIONTEMPLATE": "Sniðmát", + "OF": "Slökt", + "OPENED": "Opnað", + "PAGE": "Bls.", + "PARTIALPAUSE": "Hlé að hluta", + "PAUSE": "Hlé", + "PAUSE_TIME": "Stoppa tíma", + "PAUSED": "Gert hlé", + "PHONE": "Sími", + "PRIORITY": "Forgangur", "PROXY": "Proxy", - "QUEUE": "Queue", - "QUEUES": "Queues", - "QUEUETRANSFER": "Queue Transfer", - "QUEUETRANSFERTIMEOUT": "Queue Transfer Timeout", - "READY": "Ready", - "REALTIME": "Realtime", - "RECEIVEURL": "Receive URL", - "DELIVERYREPORTURL": "Delivery report URL", - "REFRESH_INTERACTIONS": "Refresh Interactions", - "REMOTE": "Remote", - "ROWSPERPAGE": "Rows per page", - "SAVE": "Save", - "SCREENRECORDING": "Manage Screen Recording", - "SEARCH_FOR_ANYONE": "Search", - "SECRETACCESSKEY": "Access key secret", - "SELECT_ALL": "Select all", - "SELECT_NONE": "Select none", - "SELECTED": "Selected", - "SELECTED_AGENTS": "Selected Agents", - "SELECTED_TEAMS": "Selected Teams", - "SEND": "Send", - "SETTINGS": "Settings", - "SPYINTERACTION": "Spy Interaction", - "START_SCREENRECORDING": "Start Screen Recording", - "STARTEDAT": "Started at", - "STATUS": "Status", - "STOP_SCREENRECORDING": "Stop Screen Recording", - "STRATEGY": "Strategy", - "SYSTEM": "System", - "TAG": "Tag", - "TAGS": "Tags", - "TEAMADD_WHATSAPPQUEUE": "Add Team To WhatsApp Queue", - "TEAMS_ASSOCIATION": "Teams Association", - "TEXT": "Text", - "TIMEOUT": "Timeout", - "TIMER": "Timer", - "TIMES": "Times", - "TO": "To", + "QUEUE": "Biðröð", + "QUEUES": "biðraðir", + "QUEUETRANSFER": "Biðröð flutt", + "QUEUETRANSFERTIMEOUT": "Tími á biðraðar flutningi rann út", + "READY": "Tilbúið", + "REALTIME": "Rauntími", + "RECEIVEURL": "Taka á móti URL", + "DELIVERYREPORTURL": "Vefslóð fyrir afhendingar skýrslu", + "REFRESH_INTERACTIONS": "Endurnýja skilaboð", + "REMOTE": "Fjarvinnsla", + "ROWSPERPAGE": "Raðir á síðu", + "SAVE": "Geyma", + "SCREENRECORDING": "Stilla skjá upptöku", + "SEARCH_FOR_ANYONE": "Leita", + "SECRETACCESSKEY": "Leini orð fyrir aðgang", + "SELECT_ALL": "Veldu allt", + "SELECT_NONE": "Veldu ekkert", + "SELECTED": "Valið", + "SELECTED_AGENTS": "Valdir fulltrúar", + "SELECTED_TEAMS": "Valdir hópar", + "SEND": "Senda", + "SETTINGS": "Stillingar", + "SPYINTERACTION": "Meðhlustun á samskiptum", + "START_SCREENRECORDING": "Byrja skjá upptöku", + "STARTEDAT": "Byrjað kl.", + "STATUS": "Staða", + "STOP_SCREENRECORDING": "Stöðva skjá upptöku", + "STRATEGY": "Stefna", + "SYSTEM": "Kerfi", + "TAG": "Tögg", + "TAGS": "Tögg", + "TEAMADD_WHATSAPPQUEUE": "Bæta við hópi í WhatsApp biðröð", + "TEAMS_ASSOCIATION": "Félaga hópur", + "TEXT": "Texti", + "TIMEOUT": "Útrunninn tími", + "TIMER": "Tímamælir", + "TIMES": "Tímar", + "TO": "Til", "TOKEN": "Token", - "TOOLTIP_SCREENRECORDING_OFF": "Screen Recording available", - "TOOLTIP_SCREENRECORDING_ON": "Screen Recording in progress", - "TRANSFER": "Transfer", - "TRUEPRIORITY": "True Priority", - "TYPE": "Type", - "UNPAUSE": "End Pause", - "VALUE": "Value", - "VARIABLE": "Variable", - "WAITFORTHEASSIGNEDAGENT": "Wait for the assigned agent", - "WAITING": "Waiting", - "WELCOMEMESSAGE": "Welcome Message", - "WHATSAPP": "WhatsApp Connector", - "WHATSAPPACCOUNTS": "WhatsApp Accounts", - "WHATSAPPCANNEDANSWERS": "WhatsApp Canned Answers", - "WHATSAPPDISPOSITIONS": "WhatsApp Dispositions", - "WHATSAPPQUEUES": "WhatsApp Queues" + "TOOLTIP_SCREENRECORDING_OFF": "Skjáupptaka aðgengileg", + "TOOLTIP_SCREENRECORDING_ON": "Skjáupptaka er í gangi", + "TRANSFER": "Flutningur", + "TRUEPRIORITY": "Réttur forgangur", + "TYPE": "Tegund", + "UNPAUSE": "Enda hlé", + "VALUE": "Gildi", + "VARIABLE": "Breyta", + "WAITFORTHEASSIGNEDAGENT": "Bið eftir skráðum fulltrúa", + "WAITING": "Bíður", + "WELCOMEMESSAGE": "Velkominn skilaboð", + "WHATSAPP": "WhatsApp tengill", + "WHATSAPPACCOUNTS": "WhatsApp reikningur", + "WHATSAPPCANNEDANSWERS": "WhatsApp tengd svör", + "WHATSAPPDISPOSITIONS": "WhatsApp ráðstöfun", + "WHATSAPPQUEUES": "WhatsApp biðraðir" } } diff --git a/public/app/quick-panel/i18n/is.json b/public/app/quick-panel/i18n/is.json index fd2a755..dbf17b1 100644 --- a/public/app/quick-panel/i18n/is.json +++ b/public/app/quick-panel/i18n/is.json @@ -1,73 +1,73 @@ { "QUICKPANEL": { - "EXPIRATION_GRAY_PERIOD": "Expiration Gray Period", - "NO_AVAILABLE_GROUPS": "No Available Groups", - "SAVE": "Save", - "INFO": "Info", - "NEW_CHATGROUP": "New Group", - "NAME": "Name", - "MEMBERS": "Members", - "ENABLE_WRITING": "Enable Writing", - "GROUPS": "Groups", - "YOU": "You + {{participants}}", - "NEW_INTERNAL_MESSAGE": "New internal message", - "DELETE": "Delete", - "SEARCH": "Search", - "USERS": "Users", - "TODAY": "TODAY", - "MONDAY": "Monday", - "TUESDAY": "Tuesday", - "WEDNESDAY": "Wednesday", - "THURSDAY": "Thursday", - "FRIDAY": "Friday", - "SATURDAY": "Saturday", - "SUNDAY": "Sunday", - "JANUARY": "January", - "FEBRUARY": "February", - "MARCH": "March", - "APRIL": "April", - "MAY": "May", - "JUNE": "June", - "JULY": "July", - "AUGUST": "August", + "EXPIRATION_GRAY_PERIOD": "Prufutímabili er lokið", + "NO_AVAILABLE_GROUPS": "Engin hópur aðgengilegur", + "SAVE": "Geyma", + "INFO": "Uppl.", + "NEW_CHATGROUP": "Nýr hópur", + "NAME": "Nafn", + "MEMBERS": "Meðlimir", + "ENABLE_WRITING": "Leyfa skráningu", + "GROUPS": "Hópar", + "YOU": "Þú + {{participants}}", + "NEW_INTERNAL_MESSAGE": "Ný innahúss skilaboð", + "DELETE": "Eyða", + "SEARCH": "Leita", + "USERS": "Notendur", + "TODAY": "Í dag", + "MONDAY": "Mánudagur", + "TUESDAY": "Þriðjudagur", + "WEDNESDAY": "Miðvikudagur", + "THURSDAY": "Fimmtudagur", + "FRIDAY": "Föstudagur", + "SATURDAY": "Laugardagur", + "SUNDAY": "Sunnudagur", + "JANUARY": "Janúar", + "FEBRUARY": "Febrúar", + "MARCH": "Mars", + "APRIL": "Apríl", + "MAY": "Maí", + "JUNE": "Júní", + "JULY": "Júlí", + "AUGUST": "Ágúst", "SEPTEMBER": "September", - "OCTOBER": "October", - "NOVEMBER": "November", - "DECEMBER": "December", - "CHAT": "CHAT", - "ACTIVITY": "ACTIVITY", - "FRIENDS": "Friends", - "APP_SERVERS": "Application Servers", - "USER_STATS": "User Stats", - "EVENTS": "Events", - "NOTES": "Notes", - "QUICK_SETTINGS": "Quick Settings", - "NOTIFICATIONS": "Notifications", - "CLOUD_SYNC": "Cloud Sync", + "OCTOBER": "Október", + "NOVEMBER": "Nóvember", + "DECEMBER": "Desember", + "CHAT": "Spjall", + "ACTIVITY": "Virkni", + "FRIENDS": "Vinir", + "APP_SERVERS": "Forrita netþjónn", + "USER_STATS": "Staða á notanda", + "EVENTS": "Atburðir", + "NOTES": "skilaboð", + "QUICK_SETTINGS": "Hraðstillingar", + "NOTIFICATIONS": "Skilaboð", + "CLOUD_SYNC": "Samþáttun við skýið", "RETRO_THRUSTERS": "Retro Thrusters", - "RECENT": "Recent", - "START_NEW_CHAT": "Start New Chat", - "BACK": "Back", - "CALL": "Call", - "MORE": "More", - "SEND_MESSAGE": "Send message", - "REPLY_PLACEHOLDER": "Type and hit enter to send message", - "CONTACT_XCALLY_MOTION_SUPPORT": "Contact xCALLY Motion Support", - "EXPIRATION_DATE": "Expiration Date", - "EXPIRATION_REASON": "Expiration Reason", - "LICENSE": "License", - "NEW_TOKEN": "New Token", - "OLD_TOKEN": "Old Token", - "SEND_EMAIL_TO": "Send Email To", + "RECENT": "Nýlegt", + "START_NEW_CHAT": "Hefja nýtt spjall", + "BACK": "Til baka", + "CALL": "Símtal", + "MORE": "Meira", + "SEND_MESSAGE": "Senda skilaboð", + "REPLY_PLACEHOLDER": "Skrifaðu og ýttu á \"enter\" til að senda skilaboð", + "CONTACT_XCALLY_MOTION_SUPPORT": "Hafðu samband við tæknideild Svars", + "EXPIRATION_DATE": "Tímasetning er útrunninn", + "EXPIRATION_REASON": "Ástæða útrunnunarinnar", + "LICENSE": "Leyfið", + "NEW_TOKEN": "Nýtt Token", + "OLD_TOKEN": "Eldra Token", + "SEND_EMAIL_TO": "Sendu tölvupóst á", "TOKEN": "Token", - "EXPIRATION_REASON_MESSAGE": "Your license has expired or your machine unique id has been updated due to a change to your system. Contact xCALLY Motion Support Team sending both your old and your new uuid.", - "GRAY_PERIOD_EXPIRATION": "Gray Period Expiration", - "EXPIRATION_REASON_MESSAGE_GRAY": "Your license has expired or has been disabled. Contact xCALLY Motion Support Team.", - "EXPIRATION_REASON_MESSAGE_CHANGED": "Your machine unique id has been updated due to a change to your system. Contact xCALLY Motion Support Team sending both your old and your new uuid.", - "MESSENGER_DISABLED": "The internal messaging is disabled for this agent!", - "WARNING": "Warning", + "EXPIRATION_REASON_MESSAGE": "Leyfið þitt er útrunnið eða vélbúnaður hefur verið uppfærður. Hafðu samband við Svar og sendu með bæði eldra og nýja auðkennið þitt.", + "GRAY_PERIOD_EXPIRATION": "Prufutímabili er lokið", + "EXPIRATION_REASON_MESSAGE_GRAY": "Leyfið þitt er útrunnið eða hefur verið gert óvirkt. Hafðu samband við Svar.", + "EXPIRATION_REASON_MESSAGE_CHANGED": "Leyfið þitt er útrunnið eða vélbúnaður hefur verið uppfærður. Hafðu samband við Svar og sendu með bæði eldra og nýja auðkennið þitt.", + "MESSENGER_DISABLED": "Innandyra skilaboðum hafa verið óvirkjuð fyrir þennann fulltrúa.!", + "WARNING": "Aðvörun", "ERRORS": { - "NAME_REQUIRED": "Mandatory Field" + "NAME_REQUIRED": "Skilyrtur reitur" } } } diff --git a/public/app/quick-panel/i18n/pt-BR.json b/public/app/quick-panel/i18n/pt-BR.json index c7b067f..a599e14 100644 --- a/public/app/quick-panel/i18n/pt-BR.json +++ b/public/app/quick-panel/i18n/pt-BR.json @@ -1,13 +1,13 @@ { "QUICKPANEL": { - "EXPIRATION_GRAY_PERIOD": "Período Cinzento de Expiração", - "NO_AVAILABLE_GROUPS": "Não há grupos disponíveis", + "EXPIRATION_GRAY_PERIOD": "Período Pré Expiração (Gray Period)", + "NO_AVAILABLE_GROUPS": "Não há Grupos Disponíveis", "SAVE": "Salvar", - "INFO": "Informação", + "INFO": "Info", "NEW_CHATGROUP": "Novo Grupo", "NAME": "Nome", "MEMBERS": "Membros", - "ENABLE_WRITING": "Ativar escrita", + "ENABLE_WRITING": "Ativar Escrita", "GROUPS": "Grupos", "YOU": "Você + {{participantes}}", "NEW_INTERNAL_MESSAGE": "Nova mensagem interna", @@ -17,7 +17,7 @@ "TODAY": "HOJE", "MONDAY": "Segunda", "TUESDAY": "Terça", - "WEDNESDAY": "QUarta", + "WEDNESDAY": "Quarta", "THURSDAY": "Quinta", "FRIDAY": "Sexta", "SATURDAY": "Sábado", @@ -35,35 +35,35 @@ "NOVEMBER": "Novembro", "DECEMBER": "Dezembro", "CHAT": "CHAT", - "ACTIVITY": "Atividade", + "ACTIVITY": "ATIVIDADE", "FRIENDS": "Amigos", "APP_SERVERS": "Servidores de Aplicativos", - "USER_STATS": "Estatísticas do usuário", + "USER_STATS": "Estatísticas do Usuário", "EVENTS": "Eventos", "NOTES": "Notas", - "QUICK_SETTINGS": "Configurações rápidas", + "QUICK_SETTINGS": "Configurações Rápidas", "NOTIFICATIONS": "Notificações", - "CLOUD_SYNC": "Sincronizar nuvem", - "RETRO_THRUSTERS": "Retro propulsores", + "CLOUD_SYNC": "Cloud Sync", + "RETRO_THRUSTERS": "Retro Propulsores", "RECENT": "Recente", - "START_NEW_CHAT": "Começar novo Chat", + "START_NEW_CHAT": "Começar Novo Chat", "BACK": "Voltar", "CALL": "Chamada", "MORE": "Mais", "SEND_MESSAGE": "Enviar mensagem", - "REPLY_PLACEHOLDER": "Digite e aperte enter para enviar mensagem", - "CONTACT_XCALLY_MOTION_SUPPORT": "Entre em contato com xCALLY Motion Support", - "EXPIRATION_DATE": "Data de validade", + "REPLY_PLACEHOLDER": "Digite e pressione enter para enviar mensagem", + "CONTACT_XCALLY_MOTION_SUPPORT": "Entre em contato com o suporte xCALLY Motion", + "EXPIRATION_DATE": "Data de Validade", "EXPIRATION_REASON": "Razão de Expiração", "LICENSE": "Licença", "NEW_TOKEN": "Novo Token", "OLD_TOKEN": "Token Antigo", "SEND_EMAIL_TO": "Enviar Email para", "TOKEN": "Token", - "EXPIRATION_REASON_MESSAGE": "Sua licença expirou ou sua ID exclusiva da máquina foi atualizada devido a uma alteração em seu sistema. Contate o xCALLY Equipe de apoio do movimento que envia seu uuid velho e novo.", - "GRAY_PERIOD_EXPIRATION": "Expiração do período cinza", - "EXPIRATION_REASON_MESSAGE_GRAY": "Sua licença expirou ou foi desativada. Entre em contato com a equipe de suporte do xCALLY Motion.", - "EXPIRATION_REASON_MESSAGE_CHANGED": "O ID exclusivo da sua máquina foi atualizado devido a uma alteração no seu sistema. Contate o xCALLY Equipe de apoio do movimento que envia seu uuid velho e novo.", + "EXPIRATION_REASON_MESSAGE": "Sua licença expirou ou seu Token foi alterado devido a mudença em seu sistema. Contate o suporte xCALLY Motion enviando o Token antigo e o novo", + "GRAY_PERIOD_EXPIRATION": "Período Pré Expiração (Gray Period)", + "EXPIRATION_REASON_MESSAGE_GRAY": "Sua licença expirou ou foi desativada. Entre em contato com o suporte do xCALLY Motion", + "EXPIRATION_REASON_MESSAGE_CHANGED": "Seu Token foi alterado devido a uma alteração no seu sistema. Contate o suporte xCALLY Motion enviando o Token antigo e o novo", "MESSENGER_DISABLED": "A mensagem interna está desativada para este agente!", "WARNING": "Aviso", "ERRORS": { diff --git a/public/app/reset/i18n/is.json b/public/app/reset/i18n/is.json index c3cf8da..e6aa48c 100644 --- a/public/app/reset/i18n/is.json +++ b/public/app/reset/i18n/is.json @@ -1,20 +1,20 @@ { "RESETPASSWORD": { - "TITLE": "Reset your password", - "EMAIL_ADRESS": "Email address", - "PASSWORD": "Password", - "PASSWORD_CONFIRM": "Password (Confirm)", - "UPDATE_PASSWORD": "RESET MY PASSWORD", - "GO_BACK": "Go back to login", - "PASSWORD_RESET": "Password Reset", - "PASSWORD_RESET_MESSAGE": "Your password has been correctly reset, you can now login!", - "PASSWORD_RESET_ERROR": "Password Reset Error", + "TITLE": "Endurstilltu lykilorðið þitt", + "EMAIL_ADRESS": "Netfang", + "PASSWORD": "Lykilorð", + "PASSWORD_CONFIRM": "Staðfestu lykilorð", + "UPDATE_PASSWORD": "Endurstilltu likilorðið mitt", + "GO_BACK": "Aftur á innskráningu", + "PASSWORD_RESET": "Lykilorð endurstillt", + "PASSWORD_RESET_MESSAGE": "Búið er að endurstilla lykilorðið þitt, þú getur núna skráð þig inn!", + "PASSWORD_RESET_ERROR": "Villa við endurstillingu á lykilorði", "ERRORS": { - "EMAIL_REQUIRED": "Email field is required", - "EMAIL_MUST_VALID": "Email must be a valid e-mail address", - "PASSWORD_REQUIRED": "Password field is required", - "CONFIRM_NOT_MATCH": "The passwords don't match", - "SECURE_PASSWORD_PATTERN": "Must contain at least 8 characters, with a minimum of 1 lowercase letter, 1 uppercase letter, 1 numeric character and 1 special character ~!?*@#$%^&-_=+[{]}." + "EMAIL_REQUIRED": "Netfang er skilyrt", + "EMAIL_MUST_VALID": "Netfang verður að vera gilt netfang", + "PASSWORD_REQUIRED": "Lykilorð er skilyrt", + "CONFIRM_NOT_MATCH": "Lykilorðin stemma ekki", + "SECURE_PASSWORD_PATTERN": "Verður að innihalda að lámarki 8 stafi, með að lámarki 1 lágstaf, 1 hástaf, 1 tölustaf og 1 sértákn ~!?*@#$%^&-_=+[{]}." } } } diff --git a/public/app/toolbar/i18n/bs.json b/public/app/toolbar/i18n/bs.json index ebaee51..dbe8cbb 100644 --- a/public/app/toolbar/i18n/bs.json +++ b/public/app/toolbar/i18n/bs.json @@ -123,7 +123,7 @@ "HELP": { "PREVIEW_RECALLME": "Ovo je Recall Me poziv zakazan za {{date}}" }, - "BOSNIAN": "Bosanski", - "ICELANDIC": "Islandic" + "BOSNIAN": "Bosanski jezik", + "ICELANDIC": "Islandski" } } diff --git a/public/app/toolbar/i18n/de.json b/public/app/toolbar/i18n/de.json index d452759..7fe5d1f 100644 --- a/public/app/toolbar/i18n/de.json +++ b/public/app/toolbar/i18n/de.json @@ -2,10 +2,10 @@ "TOOLBAR": { "TOGGLE_NAVIGATION": "Navigation umschalten", "TOGGLE_NAVIGATION_FOLD": "Navigation einklappen", - "TOGGLE_NAVIGATION_MODE": "Navigation Moduswechsel", + "TOGGLE_NAVIGATION_MODE": "Navigation wechseln", "SEARCH": "Suche", "USER_SETTINGS": "Nutzereinstellungen", - "TOGGLE_QUICK_PANEL": "Schnelles Panel umschalten", + "TOGGLE_QUICK_PANEL": "QuickPanel", "ENGLISH": "Englisch", "ITALIAN": "Italienisch", "FRENCH": "Französisch", @@ -33,24 +33,24 @@ "OLD_PASSWORD": "Altes Passwort", "SAVE": "Speichern", "TRIAL_VERSION": "Testversion", - "SOMEONE_LOGGED_YOU_OUT": "Sie wurden von einem anderen Benutzer abgemeldet. Erneut anmelden?", + "SOMEONE_LOGGED_YOU_OUT": "Abmeldung durch anderen Nutzer. Erneut anmelden?", "STAY_LOGGED": "Angemeldet bleiben", "WARNING": "Warnung", "PAUSE": "Pause", - "RESUME": "Fortsetzen", + "RESUME": "Pause beenden", "NO_PAUSES_AVAILABLE": "Keine Pausen verfügbar", "LATVIAN": "Lettisch", "POLISH": "Polnisch", "ERRORS": { - "FIELD_REQUIRED": "Pflichtfeld", - "PASSWORD_REQUIRED": "Pflichtfeld", + "FIELD_REQUIRED": "Feld erforderlich", + "PASSWORD_REQUIRED": "Passwort erforderlich", "CONFIRM_NOT_MATCH": "Die Passwörter stimmen nicht überein", "SECURE_PASSWORD_PATTERN": "Das Passwort muss mindestens 8 Zeichen lang sein und 1 Kleinbuchstaben, 1 Großbuchstaben, 1 Zahl und 1 Sonderzeichen enthalten.", "PASSWORD_OLDPASSWORD_MATCH": "Die Passwörter stimmen nicht überein" }, "RESETPASSWORD": "Passwort zurücksetzen", "PASSWORD_EXPIRE_REMAINING_DAYS": "Verbleibende Tage, bis zum Ablauf des Passwortes", - "BROWSER_COMPATIBILITY": "Browserkompatibilität [Chrome, Opera, Safari]", + "BROWSER_COMPATIBILITY": "Browserkompatibilität [Chrome, Edge, Opera, Safari]", "RECORDING": "Aufzeichnung", "INVALID_LICENSE": "Lizenz ungültig", "BROWSER": "Browser", @@ -96,30 +96,30 @@ "CHANGE_LANGUAGE_MESSAGE": "Bitte Seite aktualisieren, um Änderungen zu übernehmen", "CHANGE_LANGUAGE_TITLE": "Sprache ändern", "WEBRTC_AUDIO_DEVICES_NOT_AVAILABLE": "Keine Audiogeräte verfügbar", - "WEBRTC_MICROPHONE_NOT_AVAILABLE": "Kein Mikrofon vorhanden", + "WEBRTC_MICROPHONE_NOT_AVAILABLE": "Kein Mikrofon verfügbar", "WEBRTC_SPEAKER_NOT_AVAILABLE": "Kein Lautsprecher verfügbar", - "NO_AVAILABLE_INFO": "Keine verfügbaren Informationen", + "NO_AVAILABLE_INFO": "Keine Informationen verfügbar", "LITHUANIAN": "Litauisch", - "NOTIFICATION_TITLE": "Neue Benachrichtigung von {{Absender}}", + "NOTIFICATION_TITLE": "Neue Nachricht von {{Absender}}", "NOTIFICATION_TITLE_RECIPIENT": "an {{Empfänger}}", - "USER_FORCE_LOGOUT": "{{ip}} hat sich mit Ihren Anmeldeinformationen angemeldet.\nMehrfachanmeldungen sind nicht zulässig", - "LOGOUT": "Ausloggen", + "USER_FORCE_LOGOUT": "{{ip}} hat sich mit Ihren Anmeldeinformationen angemeldet", + "LOGOUT": "Abmelden", "SESSION_TIMEOUT": "Die Sitzung wird nach 60 Sekunden automatisch geschlossen", "PHONE2CALL": "Telefon zum Anrufen", - "HUNGARIAN": "ungarisch", - "AUTOANSWER_NOTIFICATIONS": "Automatische Antwortbenachrichtigungen", + "HUNGARIAN": "Ungarisch", + "AUTOANSWER_NOTIFICATIONS": "Benachrichtigung bei automatischer Antwort", "CHANNEL": "Kanal", "CHANNELS": "Kanäle", - "CHAT": "Plaudern", - "DELAY": "Automatische Antwortverzögerung [Sek.]", - "EMAIL": "Email", + "CHAT": "Chat", + "DELAY": "Verzögerung automatische Antwort [Sek.]", + "EMAIL": "E-Mail", "FAX": "Fax", "NOTIFICATIONS": "Automatische Antwort aktiviert", "NUM_NOTIFICATIONS": "Benachrichtigungen", "OPENCHANNEL": "Offener Kanal", "SMS": "SMS", "WHATSAPP": "WhatsApp", - "NO_AUTOANSWER_CONFIGURED": "Keine automatische Antwort für Kanäle konfiguriert", + "NO_AUTOANSWER_CONFIGURED": "Keine automatische Antwort konfiguriert", "BOSNIAN": "bosnisch", "ICELANDIC": "Isländisch" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 23677a6..7b07a4e 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 _0x383c=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','VIRTUAL','getDataValue','STRING','contactManager','motionbar','urlForward','bot','script'];(function(_0x5dc919,_0x16326b){var _0x2447d7=function(_0x2181c8){while(--_0x2181c8){_0x5dc919['push'](_0x5dc919['shift']());}};_0x2447d7(++_0x16326b);}(_0x383c,0x164));var _0xc383=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x383c[_0x29d915];return _0x160f86;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc383('0x0')],'get':function(_0x588d90){return this[_0xc383('0x1')]('action');}},'action':{'type':Sequelize[_0xc383('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0xc383('0x3'),'integration',_0xc383('0x4'),'jscripty',_0xc383('0x5'),'browser',_0xc383('0x6'),_0xc383('0x7')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0xc383('0x8')},'data1':{'type':Sequelize[_0xc383('0x2')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0xc383('0x2')](0x1000),'comment':_0xc383('0x9')},'data3':{'type':Sequelize[_0xc383('0x2')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0xc383('0x2')](0x1000),'comments':_0xc383('0xa')},'data5':{'type':Sequelize[_0xc383('0x2')](0x1000),'comments':_0xc383('0xb')},'data6':{'type':Sequelize[_0xc383('0x2')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0xc383('0xc')],'comments':_0xc383('0xd')}}; \ No newline at end of file +var _0xc076=['contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xc076,0x84));var _0x6c07=function(_0x4ac076,_0x36fee5){_0x4ac076=_0x4ac076-0x0;var _0x303566=_0xc076[_0x4ac076];return _0x303566;};'use strict';var Sequelize=require(_0x6c07('0x0'));module[_0x6c07('0x1')]={'name':{'type':Sequelize[_0x6c07('0x2')],'get':function(_0x55b13c){return this[_0x6c07('0x3')](_0x6c07('0x4'));}},'action':{'type':Sequelize[_0x6c07('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6c07('0x6'),_0x6c07('0x7'),_0x6c07('0x8'),_0x6c07('0x9'),'urlForward',_0x6c07('0xa'),'bot',_0x6c07('0xb')]],'msg':_0x6c07('0xc')}},'comment':_0x6c07('0xc')},'data1':{'type':Sequelize[_0x6c07('0x5')](0x1000),'comment':_0x6c07('0xd')},'data2':{'type':Sequelize[_0x6c07('0x5')](0x1000),'comment':_0x6c07('0xe')},'data3':{'type':Sequelize[_0x6c07('0x5')](0x1000),'comment':_0x6c07('0xf')},'data4':{'type':Sequelize[_0x6c07('0x5')](0x1000),'comments':_0x6c07('0x10')},'data5':{'type':Sequelize[_0x6c07('0x5')](0x1000),'comments':_0x6c07('0x11')},'data6':{'type':Sequelize[_0x6c07('0x5')],'comments':_0x6c07('0x12')},'data7':{'type':Sequelize[_0x6c07('0x13')],'comments':_0x6c07('0x14')}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index f7e122a..a100b1f 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 _0x25e6=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','update','destroy','error','stack','name','send','body','Action','params','then','catch','find','rimraf','zip-dir','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x19a87b,_0x26c651){var _0x4e41e6=function(_0x235345){while(--_0x235345){_0x19a87b['push'](_0x19a87b['shift']());}};_0x4e41e6(++_0x26c651);}(_0x25e6,0xdb));var _0x625e=function(_0x5581a3,_0x2fabd8){_0x5581a3=_0x5581a3-0x0;var _0x3c277b=_0x25e6[_0x5581a3];return _0x3c277b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x625e('0x0'));var zipdir=require(_0x625e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x625e('0x2'));var BPromise=require(_0x625e('0x3'));var Mustache=require(_0x625e('0x4'));var util=require('util');var path=require('path');var sox=require(_0x625e('0x5'));var csv=require('to-csv');var ejs=require(_0x625e('0x6'));var fs=require('fs');var fs_extra=require(_0x625e('0x7'));var _=require(_0x625e('0x8'));var squel=require(_0x625e('0x9'));var crypto=require('crypto');var jsforce=require(_0x625e('0xa'));var deskjs=require(_0x625e('0xb'));var toCsv=require('to-csv');var querystring=require(_0x625e('0xc'));var Papa=require(_0x625e('0xd'));var Redis=require(_0x625e('0xe'));var authService=require(_0x625e('0xf'));var qs=require(_0x625e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x625e('0x11'));var logger=require('../../config/logger')(_0x625e('0x12'));var utils=require(_0x625e('0x13'));var config=require(_0x625e('0x14'));var licenseUtil=require(_0x625e('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49f895,_0x17bc27){_0x17bc27=_0x17bc27||0xcc;return function(_0x1fe4a6){if(_0x1fe4a6){return _0x49f895[_0x625e('0x16')](_0x17bc27);}return _0x49f895[_0x625e('0x17')](_0x17bc27)[_0x625e('0x18')]();};}function respondWithResult(_0x1e0410,_0xbabaf){_0xbabaf=_0xbabaf||0xc8;return function(_0x2c169a){if(_0x2c169a){return _0x1e0410[_0x625e('0x17')](_0xbabaf)[_0x625e('0x19')](_0x2c169a);}};}function respondWithFilteredResult(_0x4beb13,_0x2b6b13){return function(_0x3e8813){if(_0x3e8813){var _0x65b2a4=typeof _0x2b6b13['offset']==='undefined'&&typeof _0x2b6b13[_0x625e('0x1a')]===_0x625e('0x1b');var _0x41dc53=_0x3e8813[_0x625e('0x1c')];var _0x47260c=_0x65b2a4?0x0:_0x2b6b13[_0x625e('0x1d')];var _0x4b4bca=_0x65b2a4?_0x3e8813[_0x625e('0x1c')]:_0x2b6b13[_0x625e('0x1d')]+_0x2b6b13[_0x625e('0x1a')];var _0x5e1d7a;if(_0x4b4bca>=_0x41dc53){_0x4b4bca=_0x41dc53;_0x5e1d7a=0xc8;}else{_0x5e1d7a=0xce;}_0x4beb13['status'](_0x5e1d7a);return _0x4beb13[_0x625e('0x1e')](_0x625e('0x1f'),_0x47260c+'-'+_0x4b4bca+'/'+_0x41dc53)['json'](_0x3e8813);}return null;};}function patchUpdates(_0x3efd2c){return function(_0x2842c4){try{jsonpatch[_0x625e('0x20')](_0x2842c4,_0x3efd2c,!![]);}catch(_0x30e548){return BPromise['reject'](_0x30e548);}return _0x2842c4[_0x625e('0x21')]();};}function saveUpdates(_0x1e7d4d,_0x5043f9){return function(_0x55693a){if(_0x55693a){return _0x55693a[_0x625e('0x22')](_0x1e7d4d)['then'](function(_0x3d3ff0){return _0x3d3ff0;});}return null;};}function removeEntity(_0x2e4b51,_0x2d0e81){return function(_0x2fb4f2){if(_0x2fb4f2){return _0x2fb4f2[_0x625e('0x23')]()['then'](function(){_0x2e4b51[_0x625e('0x17')](0xcc)[_0x625e('0x18')]();});}};}function handleEntityNotFound(_0x491a03,_0x2dc1c1){return function(_0x138505){if(!_0x138505){_0x491a03[_0x625e('0x16')](0x194);}return _0x138505;};}function handleError(_0x4e22b6,_0x45a451){_0x45a451=_0x45a451||0x1f4;return function(_0x531246){logger[_0x625e('0x24')](_0x531246[_0x625e('0x25')]);if(_0x531246['name']){delete _0x531246[_0x625e('0x26')];}_0x4e22b6[_0x625e('0x17')](_0x45a451)[_0x625e('0x27')](_0x531246);};}exports['update']=function(_0x5a94b2,_0x3bdb2d){if(_0x5a94b2['body']['id']){delete _0x5a94b2[_0x625e('0x28')]['id'];}return db[_0x625e('0x29')]['find']({'where':{'id':_0x5a94b2[_0x625e('0x2a')]['id']}})[_0x625e('0x2b')](handleEntityNotFound(_0x3bdb2d,null))[_0x625e('0x2b')](saveUpdates(_0x5a94b2['body'],null))[_0x625e('0x2b')](respondWithResult(_0x3bdb2d,null))[_0x625e('0x2c')](handleError(_0x3bdb2d,null));};exports['destroy']=function(_0x38a391,_0x5d86c3){return db['Action'][_0x625e('0x2d')]({'where':{'id':_0x38a391[_0x625e('0x2a')]['id']}})['then'](handleEntityNotFound(_0x5d86c3,null))['then'](removeEntity(_0x5d86c3,null))[_0x625e('0x2c')](handleError(_0x5d86c3,null));}; \ No newline at end of file +var _0x9576=['then','destroy','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','count','set','Content-Range','json','reject','save','update'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x9576,0x182));var _0x6957=function(_0x40a211,_0x4a0d3c){_0x40a211=_0x40a211-0x0;var _0x5d2a02=_0x9576[_0x40a211];return _0x5d2a02;};'use strict';var emlformat=require(_0x6957('0x0'));var rimraf=require(_0x6957('0x1'));var zipdir=require(_0x6957('0x2'));var jsonpatch=require(_0x6957('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6957('0x4'));var Mustache=require(_0x6957('0x5'));var util=require(_0x6957('0x6'));var path=require(_0x6957('0x7'));var sox=require(_0x6957('0x8'));var csv=require(_0x6957('0x9'));var ejs=require(_0x6957('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6957('0xb'));var squel=require(_0x6957('0xc'));var crypto=require(_0x6957('0xd'));var jsforce=require(_0x6957('0xe'));var deskjs=require(_0x6957('0xf'));var toCsv=require(_0x6957('0x9'));var querystring=require('querystring');var Papa=require(_0x6957('0x10'));var Redis=require(_0x6957('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6957('0x12'));var hardwareService=require(_0x6957('0x13'));var logger=require(_0x6957('0x14'))(_0x6957('0x15'));var utils=require(_0x6957('0x16'));var config=require(_0x6957('0x17'));var licenseUtil=require(_0x6957('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5888d6,_0x548647){_0x548647=_0x548647||0xcc;return function(_0x3f40f0){if(_0x3f40f0){return _0x5888d6[_0x6957('0x19')](_0x548647);}return _0x5888d6[_0x6957('0x1a')](_0x548647)[_0x6957('0x1b')]();};}function respondWithResult(_0x345c3e,_0x1fd3d9){_0x1fd3d9=_0x1fd3d9||0xc8;return function(_0x25d32e){if(_0x25d32e){return _0x345c3e['status'](_0x1fd3d9)['json'](_0x25d32e);}};}function respondWithFilteredResult(_0x4f82cb,_0x35fffc){return function(_0x256ac7){if(_0x256ac7){var _0x228f76=typeof _0x35fffc[_0x6957('0x1c')]==='undefined'&&typeof _0x35fffc[_0x6957('0x1d')]==='undefined';var _0x2a39b5=_0x256ac7[_0x6957('0x1e')];var _0x49aa31=_0x228f76?0x0:_0x35fffc[_0x6957('0x1c')];var _0x448ff6=_0x228f76?_0x256ac7[_0x6957('0x1e')]:_0x35fffc['offset']+_0x35fffc[_0x6957('0x1d')];var _0x2c103c;if(_0x448ff6>=_0x2a39b5){_0x448ff6=_0x2a39b5;_0x2c103c=0xc8;}else{_0x2c103c=0xce;}_0x4f82cb[_0x6957('0x1a')](_0x2c103c);return _0x4f82cb[_0x6957('0x1f')](_0x6957('0x20'),_0x49aa31+'-'+_0x448ff6+'/'+_0x2a39b5)[_0x6957('0x21')](_0x256ac7);}return null;};}function patchUpdates(_0x35ee5b){return function(_0x3081b2){try{jsonpatch['apply'](_0x3081b2,_0x35ee5b,!![]);}catch(_0x5ee3f8){return BPromise[_0x6957('0x22')](_0x5ee3f8);}return _0x3081b2[_0x6957('0x23')]();};}function saveUpdates(_0x18037f,_0x2569f4){return function(_0x3591fa){if(_0x3591fa){return _0x3591fa[_0x6957('0x24')](_0x18037f)[_0x6957('0x25')](function(_0x310a5e){return _0x310a5e;});}return null;};}function removeEntity(_0x56b0ba,_0x2b2dcd){return function(_0x3c9de7){if(_0x3c9de7){return _0x3c9de7[_0x6957('0x26')]()[_0x6957('0x25')](function(){_0x56b0ba['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xa1e6af,_0x2a57b6){return function(_0x5c4e49){if(!_0x5c4e49){_0xa1e6af['sendStatus'](0x194);}return _0x5c4e49;};}function handleError(_0x320e7d,_0xa2f92f){_0xa2f92f=_0xa2f92f||0x1f4;return function(_0x3bc22f){logger['error'](_0x3bc22f[_0x6957('0x27')]);if(_0x3bc22f[_0x6957('0x28')]){delete _0x3bc22f[_0x6957('0x28')];}_0x320e7d[_0x6957('0x1a')](_0xa2f92f)[_0x6957('0x29')](_0x3bc22f);};}exports[_0x6957('0x24')]=function(_0x2d33ef,_0x320e1a){if(_0x2d33ef['body']['id']){delete _0x2d33ef[_0x6957('0x2a')]['id'];}return db[_0x6957('0x2b')][_0x6957('0x2c')]({'where':{'id':_0x2d33ef[_0x6957('0x2d')]['id']}})[_0x6957('0x25')](handleEntityNotFound(_0x320e1a,null))[_0x6957('0x25')](saveUpdates(_0x2d33ef[_0x6957('0x2a')],null))[_0x6957('0x25')](respondWithResult(_0x320e1a,null))[_0x6957('0x2e')](handleError(_0x320e1a,null));};exports[_0x6957('0x26')]=function(_0x3de770,_0x4950eb){return db['Action'][_0x6957('0x2c')]({'where':{'id':_0x3de770[_0x6957('0x2d')]['id']}})[_0x6957('0x25')](handleEntityNotFound(_0x4950eb,null))[_0x6957('0x25')](removeEntity(_0x4950eb,null))['catch'](handleError(_0x4950eb,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index ed47394..629c9f8 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 _0x7bad=['api','bluebird','request-promise','rimraf','./action.attributes','define','Action','lodash','util','../../config/logger'];(function(_0x378720,_0xa711f1){var _0x47920a=function(_0xc5056){while(--_0xc5056){_0x378720['push'](_0x378720['shift']());}};_0x47920a(++_0xa711f1);}(_0x7bad,0xb1));var _0xd7ba=function(_0x5b142f,_0x10815a){_0x5b142f=_0x5b142f-0x0;var _0x327bbd=_0x7bad[_0x5b142f];return _0x327bbd;};'use strict';var _=require(_0xd7ba('0x0'));var util=require(_0xd7ba('0x1'));var logger=require(_0xd7ba('0x2'))(_0xd7ba('0x3'));var moment=require('moment');var BPromise=require(_0xd7ba('0x4'));var rp=require(_0xd7ba('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd7ba('0x6'));var config=require('../../config/environment');var attributes=require(_0xd7ba('0x7'));module['exports']=function(_0xacb246,_0x1d8288){return _0xacb246[_0xd7ba('0x8')](_0xd7ba('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd137=['moment','bluebird','request-promise','rimraf','../../config/environment','./action.attributes','exports','define','lodash','util','../../config/logger','api'];(function(_0x163cab,_0xae05a6){var _0x22d4c8=function(_0x3b0232){while(--_0x3b0232){_0x163cab['push'](_0x163cab['shift']());}};_0x22d4c8(++_0xae05a6);}(_0xd137,0x140));var _0x7d13=function(_0x26781a,_0x5d2070){_0x26781a=_0x26781a-0x0;var _0x37d270=_0xd137[_0x26781a];return _0x37d270;};'use strict';var _=require(_0x7d13('0x0'));var util=require(_0x7d13('0x1'));var logger=require(_0x7d13('0x2'))(_0x7d13('0x3'));var moment=require(_0x7d13('0x4'));var BPromise=require(_0x7d13('0x5'));var rp=require(_0x7d13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7d13('0x7'));var config=require(_0x7d13('0x8'));var attributes=require(_0x7d13('0x9'));module[_0x7d13('0xa')]=function(_0x4e0c6f,_0x3d2817){return _0x4e0c6f[_0x7d13('0xb')]('Action',attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 58ad728..5867e55 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 _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x52cde3,_0x28d007){var _0x106ff1=function(_0x54613e){while(--_0x54613e){_0x52cde3['push'](_0x52cde3['shift']());}};_0x106ff1(++_0x28d007);}(_0x5fab,0x177));var _0xb5fa=function(_0xf0f7ba,_0x48be70){_0xf0f7ba=_0xf0f7ba-0x0;var _0x44382c=_0x5fab[_0xf0f7ba];return _0x44382c;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});} \ No newline at end of file +var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x53ec,0x192));var _0xc53e=function(_0x30e804,_0x8d453b){_0x30e804=_0x30e804-0x0;var _0x529374=_0x53ec[_0x30e804];return _0x529374;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index e73def9..1ea9316 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 _0xf464=['update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated'];(function(_0x1d1a0e,_0x38aa63){var _0x42ad05=function(_0x5a506d){while(--_0x5a506d){_0x1d1a0e['push'](_0x1d1a0e['shift']());}};_0x42ad05(++_0x38aa63);}(_0xf464,0x146));var _0x4f46=function(_0x2eb5b4,_0x452438){_0x2eb5b4=_0x2eb5b4-0x0;var _0xcd022e=_0xf464[_0x2eb5b4];return _0xcd022e;};'use strict';var multer=require('multer');var util=require(_0x4f46('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4f46('0x1'));var router=express[_0x4f46('0x2')]();var fs_extra=require(_0x4f46('0x3'));var auth=require(_0x4f46('0x4'));var interaction=require(_0x4f46('0x5'));var config=require(_0x4f46('0x6'));var controller=require('./action.controller');router[_0x4f46('0x7')](_0x4f46('0x8'),auth[_0x4f46('0x9')](),controller[_0x4f46('0xa')]);router[_0x4f46('0xb')](_0x4f46('0x8'),auth[_0x4f46('0x9')](),controller[_0x4f46('0xc')]);module[_0x4f46('0xd')]=router; \ No newline at end of file +var _0xe3ca=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated','update','delete','destroy'];(function(_0x326ea9,_0x1baad3){var _0x20f4a3=function(_0x22c934){while(--_0x22c934){_0x326ea9['push'](_0x326ea9['shift']());}};_0x20f4a3(++_0x1baad3);}(_0xe3ca,0x187));var _0xae3c=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xe3ca[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0xae3c('0x0'));var util=require(_0xae3c('0x1'));var path=require(_0xae3c('0x2'));var timeout=require(_0xae3c('0x3'));var express=require('express');var router=express[_0xae3c('0x4')]();var fs_extra=require(_0xae3c('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xae3c('0x6'));var config=require(_0xae3c('0x7'));var controller=require('./action.controller');router[_0xae3c('0x8')](_0xae3c('0x9'),auth[_0xae3c('0xa')](),controller[_0xae3c('0xb')]);router[_0xae3c('0xc')](_0xae3c('0x9'),auth[_0xae3c('0xa')](),controller[_0xae3c('0xd')]);module[_0xae3c('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 73d3693..5d26080 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 _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x6c0123,_0x4c8d3b){var _0x5a87d2=function(_0x1ff614){while(--_0x1ff614){_0x6c0123['push'](_0x6c0123['shift']());}};_0x5a87d2(++_0x4c8d3b);}(_0x5fab,0x177));var _0xb5fa=function(_0x493030,_0x29ec7e){_0x493030=_0x493030-0x0;var _0x56f5e4=_0x5fab[_0x493030];return _0x56f5e4;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}}; \ No newline at end of file +var _0x5d58=['TEXT','STRING'];(function(_0xc37fd1,_0x21fc8b){var _0x2f23e6=function(_0x476d91){while(--_0x476d91){_0xc37fd1['push'](_0xc37fd1['shift']());}};_0x2f23e6(++_0x21fc8b);}(_0x5d58,0x187));var _0x85d5=function(_0x410a90,_0x494e8d){_0x410a90=_0x410a90-0x0;var _0x5a745f=_0x5d58[_0x410a90];return _0x5a745f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x85d5('0x0')]},'conditions':{'type':Sequelize[_0x85d5('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 88a54b3..c6883ad 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 _0x053c=['Reports','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','toString','sequelize','SELECT','left_join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','value','getFields','from','DESC','foreignKey','output','web','%s-%s.%s','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','../../components/export/','savename','countTable','COUNT(*)','QueryTypes','runReport','HOUR(%s)','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','fs-extra','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','undefined','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','stack','name','index','AnalyticCustomReport','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','get','role','user'];(function(_0x8012b2,_0x370e3b){var _0x99bfa9=function(_0x4d1e29){while(--_0x4d1e29){_0x8012b2['push'](_0x8012b2['shift']());}};_0x99bfa9(++_0x370e3b);}(_0x053c,0xfc));var _0xc053=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x053c[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0xc053('0x0'));var rimraf=require(_0xc053('0x1'));var zipdir=require(_0xc053('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc053('0x3'));var BPromise=require(_0xc053('0x4'));var Mustache=require(_0xc053('0x5'));var util=require(_0xc053('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xc053('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc053('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc053('0x9'));var jsforce=require(_0xc053('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xc053('0x7'));var querystring=require('querystring');var Papa=require(_0xc053('0xb'));var Redis=require(_0xc053('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xc053('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc053('0xe'));var logger=require(_0xc053('0xf'))(_0xc053('0x10'));var utils=require(_0xc053('0x11'));var config=require(_0xc053('0x12'));var licenseUtil=require(_0xc053('0x13'));var db=require(_0xc053('0x14'))['db'];var dbH=require(_0xc053('0x14'))[_0xc053('0x15')];function respondWithStatusCode(_0x57f00e,_0x1a5749){_0x1a5749=_0x1a5749||0xcc;return function(_0x32032e){if(_0x32032e){return _0x57f00e[_0xc053('0x16')](_0x1a5749);}return _0x57f00e[_0xc053('0x17')](_0x1a5749)[_0xc053('0x18')]();};}function respondWithResult(_0x7ea9f3,_0x22d111){_0x22d111=_0x22d111||0xc8;return function(_0x2b1854){if(_0x2b1854){return _0x7ea9f3['status'](_0x22d111)[_0xc053('0x19')](_0x2b1854);}};}function respondWithFilteredResult(_0x264c0e,_0x8a4b1b){return function(_0xb50f73){if(_0xb50f73){var _0x116d00=typeof _0x8a4b1b['offset']===_0xc053('0x1a')&&typeof _0x8a4b1b['limit']===_0xc053('0x1a');var _0x4f8ce9=_0xb50f73['count'];var _0x55a034=_0x116d00?0x0:_0x8a4b1b[_0xc053('0x1b')];var _0x521734=_0x116d00?_0xb50f73[_0xc053('0x1c')]:_0x8a4b1b[_0xc053('0x1b')]+_0x8a4b1b[_0xc053('0x1d')];var _0x23287e;if(_0x521734>=_0x4f8ce9){_0x521734=_0x4f8ce9;_0x23287e=0xc8;}else{_0x23287e=0xce;}_0x264c0e[_0xc053('0x17')](_0x23287e);return _0x264c0e[_0xc053('0x1e')](_0xc053('0x1f'),_0x55a034+'-'+_0x521734+'/'+_0x4f8ce9)[_0xc053('0x19')](_0xb50f73);}return null;};}function patchUpdates(_0x4af9dd){return function(_0x5ee846){try{jsonpatch[_0xc053('0x20')](_0x5ee846,_0x4af9dd,!![]);}catch(_0x4d9a88){return BPromise[_0xc053('0x21')](_0x4d9a88);}return _0x5ee846[_0xc053('0x22')]();};}function saveUpdates(_0x2d58f2,_0x9a6f91){return function(_0x48459d){if(_0x48459d){return _0x48459d[_0xc053('0x23')](_0x2d58f2)[_0xc053('0x24')](function(_0x27e75d){return _0x27e75d;});}return null;};}function removeEntity(_0x4918e2,_0x46bf14){return function(_0x2e93d7){if(_0x2e93d7){return _0x2e93d7[_0xc053('0x25')]()['then'](function(){var _0x29d74b=_0x2e93d7['get']({'plain':!![]});var _0x31c535=_0xc053('0x26');return db[_0xc053('0x27')][_0xc053('0x25')]({'where':{'type':_0x31c535,'resourceId':_0x29d74b['id']}})[_0xc053('0x24')](function(){return _0x2e93d7;});})['then'](function(){_0x4918e2[_0xc053('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x211fc7,_0x5a56d2){return function(_0x55b3e6){if(!_0x55b3e6){_0x211fc7[_0xc053('0x16')](0x194);}return _0x55b3e6;};}function handleError(_0x4b6b47,_0x1f4020){_0x1f4020=_0x1f4020||0x1f4;return function(_0x259092){logger['error'](_0x259092[_0xc053('0x28')]);if(_0x259092[_0xc053('0x29')]){delete _0x259092[_0xc053('0x29')];}_0x4b6b47['status'](_0x1f4020)['send'](_0x259092);};}exports[_0xc053('0x2a')]=function(_0x5e4f7e,_0x51cdb3){var _0x11d526={},_0x7c7a9b={},_0x1a761f={'count':0x0,'rows':[]};var _0xf4e60=_['map'](db[_0xc053('0x2b')][_0xc053('0x2c')],function(_0x46414a){return{'name':_0x46414a[_0xc053('0x2d')],'type':_0x46414a[_0xc053('0x2e')][_0xc053('0x2f')]};});_0x7c7a9b['model']=_['map'](_0xf4e60,_0xc053('0x29'));_0x7c7a9b['query']=_[_0xc053('0x30')](_0x5e4f7e[_0xc053('0x31')]);_0x7c7a9b[_0xc053('0x32')]=_[_0xc053('0x33')](_0x7c7a9b[_0xc053('0x34')],_0x7c7a9b[_0xc053('0x31')]);_0x11d526[_0xc053('0x35')]=_[_0xc053('0x33')](_0x7c7a9b[_0xc053('0x34')],qs[_0xc053('0x36')](_0x5e4f7e[_0xc053('0x31')]['fields']));_0x11d526[_0xc053('0x35')]=_0x11d526[_0xc053('0x35')][_0xc053('0x37')]?_0x11d526[_0xc053('0x35')]:_0x7c7a9b[_0xc053('0x34')];if(!_0x5e4f7e['query'][_0xc053('0x38')](_0xc053('0x39'))){_0x11d526[_0xc053('0x1d')]=qs[_0xc053('0x1d')](_0x5e4f7e[_0xc053('0x31')][_0xc053('0x1d')]);_0x11d526[_0xc053('0x1b')]=qs[_0xc053('0x1b')](_0x5e4f7e['query']['offset']);}_0x11d526[_0xc053('0x3a')]=qs[_0xc053('0x3b')](_0x5e4f7e[_0xc053('0x31')][_0xc053('0x3b')]);_0x11d526[_0xc053('0x3c')]=qs[_0xc053('0x32')](_[_0xc053('0x3d')](_0x5e4f7e[_0xc053('0x31')],_0x7c7a9b[_0xc053('0x32')]),_0xf4e60);if(_0x5e4f7e[_0xc053('0x31')][_0xc053('0x3e')]){_0x11d526['where']=_[_0xc053('0x3f')](_0x11d526[_0xc053('0x3c')],{'$or':_[_0xc053('0x40')](_0xf4e60,function(_0x1fa566){if(_0x1fa566[_0xc053('0x2e')]!==_0xc053('0x41')){var _0x2660df={};_0x2660df[_0x1fa566['name']]={'$like':'%'+_0x5e4f7e[_0xc053('0x31')][_0xc053('0x3e')]+'%'};return _0x2660df;}})});}_0x11d526=_[_0xc053('0x3f')]({},_0x11d526,_0x5e4f7e[_0xc053('0x42')]);var _0x565058={'where':_0x11d526['where']};return db[_0xc053('0x2b')][_0xc053('0x1c')](_0x565058)[_0xc053('0x24')](function(_0x39638f){_0x1a761f[_0xc053('0x1c')]=_0x39638f;if(_0x5e4f7e[_0xc053('0x31')][_0xc053('0x43')]){_0x11d526[_0xc053('0x44')]=[{'all':!![]}];}return db[_0xc053('0x2b')]['findAll'](_0x11d526);})[_0xc053('0x24')](function(_0x24a9e7){_0x1a761f[_0xc053('0x45')]=_0x24a9e7;return _0x1a761f;})[_0xc053('0x24')](respondWithFilteredResult(_0x51cdb3,_0x11d526))[_0xc053('0x46')](handleError(_0x51cdb3,null));};exports[_0xc053('0x47')]=function(_0x14436d,_0x2c86c5){var _0x311ff8={'raw':![],'where':{'id':_0x14436d[_0xc053('0x48')]['id']}},_0x5a3d4c={};_0x5a3d4c[_0xc053('0x34')]=_['keys'](db['AnalyticCustomReport'][_0xc053('0x2c')]);_0x5a3d4c[_0xc053('0x31')]=_[_0xc053('0x30')](_0x14436d['query']);_0x5a3d4c['filters']=_['intersection'](_0x5a3d4c[_0xc053('0x34')],_0x5a3d4c[_0xc053('0x31')]);_0x311ff8[_0xc053('0x35')]=_[_0xc053('0x33')](_0x5a3d4c[_0xc053('0x34')],qs[_0xc053('0x36')](_0x14436d[_0xc053('0x31')][_0xc053('0x36')]));_0x311ff8['attributes']=_0x311ff8['attributes'][_0xc053('0x37')]?_0x311ff8[_0xc053('0x35')]:_0x5a3d4c['model'];if(_0x14436d[_0xc053('0x31')][_0xc053('0x43')]){_0x311ff8[_0xc053('0x44')]=[{'all':!![]}];}_0x311ff8=_['merge']({},_0x311ff8,_0x14436d[_0xc053('0x42')]);return db[_0xc053('0x2b')][_0xc053('0x49')](_0x311ff8)['then'](handleEntityNotFound(_0x2c86c5,null))['then'](respondWithResult(_0x2c86c5,null))['catch'](handleError(_0x2c86c5,null));};exports[_0xc053('0x4a')]=function(_0x445dbe,_0x428bf2){return db[_0xc053('0x2b')][_0xc053('0x4a')](_0x445dbe['body'],{})['then'](function(_0x2eab3e){var _0x24dd02=_0x445dbe['user'][_0xc053('0x4b')]({'plain':!![]});if(!_0x24dd02)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x24dd02[_0xc053('0x4c')]===_0xc053('0x4d')){var _0x487722=_0x2eab3e[_0xc053('0x4b')]({'plain':!![]});var _0x190a0d=_0xc053('0x4e');return db[_0xc053('0x4f')][_0xc053('0x49')]({'where':{'name':_0x190a0d,'userProfileId':_0x24dd02['userProfileId']},'raw':!![]})['then'](function(_0x38d3bc){if(_0x38d3bc&&_0x38d3bc[_0xc053('0x50')]===0x0){return db['UserProfileResource'][_0xc053('0x4a')]({'name':_0x487722[_0xc053('0x29')],'resourceId':_0x487722['id'],'type':_0xc053('0x26'),'sectionId':_0x38d3bc['id']},{})[_0xc053('0x24')](function(){return _0x2eab3e;});}else{return _0x2eab3e;}})['catch'](function(_0x2e95a8){logger[_0xc053('0x51')](_0xc053('0x52'),_0x2e95a8);throw _0x2e95a8;});}return _0x2eab3e;})[_0xc053('0x24')](respondWithResult(_0x428bf2,0xc9))[_0xc053('0x46')](handleError(_0x428bf2,null));};exports[_0xc053('0x23')]=function(_0x44dda1,_0x1f8f3e){if(_0x44dda1[_0xc053('0x53')]['id']){delete _0x44dda1['body']['id'];}return db[_0xc053('0x2b')][_0xc053('0x49')]({'where':{'id':_0x44dda1[_0xc053('0x48')]['id']}})[_0xc053('0x24')](handleEntityNotFound(_0x1f8f3e,null))[_0xc053('0x24')](saveUpdates(_0x44dda1[_0xc053('0x53')],null))[_0xc053('0x24')](respondWithResult(_0x1f8f3e,null))['catch'](handleError(_0x1f8f3e,null));};exports[_0xc053('0x25')]=function(_0x360454,_0x2e0388){return db[_0xc053('0x2b')][_0xc053('0x49')]({'where':{'id':_0x360454[_0xc053('0x48')]['id']}})['then'](handleEntityNotFound(_0x2e0388,null))[_0xc053('0x24')](removeEntity(_0x2e0388,null))['catch'](handleError(_0x2e0388,null));};exports[_0xc053('0x54')]=function(_0x1f1ebe,_0x1dba92){var _0x2e7ff0=0xa;var _0xf15d13=[_0xc053('0x55'),'left_join',_0xc053('0x56'),_0xc053('0x57')];var _0x6d7b78={'SUM':_0xc053('0x58'),'COUNT':_0xc053('0x59'),'COUNT DISTINCT':_0xc053('0x5a'),'MAX':_0xc053('0x5b'),'MIN':_0xc053('0x5c'),'AVG':_0xc053('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc053('0x5e'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x47c883={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xc053('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xc053('0x60'),'UNIX_TIMESTAMP':_0xc053('0x61')};var _0x40510e=function(_0x591150){return!_[_0xc053('0x62')]([_0xc053('0x63'),_0xc053('0x64'),_0xc053('0x65'),_0xc053('0x66')],_0x591150);};var _0xf079c7=function(_0x382414){if(!_0x382414||!_0x382414[_0xc053('0x67')][_0xc053('0x37')]){return'';}for(var _0x5c54e2='(',_0x158b40=0x0;_0x158b40<_0x382414[_0xc053('0x67')][_0xc053('0x37')];_0x158b40+=0x1){_0x158b40>0x0&&(_0x5c54e2+='\x20'+_0x382414[_0xc053('0x68')]+'\x20');_0x5c54e2+=_0x382414[_0xc053('0x67')][_0x158b40][_0xc053('0x69')]?_0xf079c7(_0x382414[_0xc053('0x67')][_0x158b40][_0xc053('0x69')]):_0x382414[_0xc053('0x67')][_0x158b40][_0xc053('0x6a')]+'\x20'+_0x382414[_0xc053('0x67')][_0x158b40][_0xc053('0x6b')]+(_0x40510e(_0x382414[_0xc053('0x67')][_0x158b40][_0xc053('0x6b')])?'\x20'+_0x382414[_0xc053('0x67')][_0x158b40]['value']:'');}return _0x5c54e2+')';};var _0x1b2bda={'where':{'id':_0x1f1ebe[_0xc053('0x48')]['id']}},_0x336e0f,_0x3e95fa,_0x5cf202,_0x348347,_0x3e7c75;_0x1b2bda=_[_0xc053('0x3f')]({},_0x1b2bda,_0x1f1ebe[_0xc053('0x42')]);return db[_0xc053('0x2b')][_0xc053('0x49')](_0x1b2bda)[_0xc053('0x24')](function(_0x3395c5){if(_0x3395c5){_0x336e0f=_0x3395c5;return _0x3395c5['getFields']();}return null;})['then'](function(_0x2439ed){if(_0x2439ed){if(!_0x2439ed[_0xc053('0x37')]){throw new db[(_0xc053('0x6c'))][(_0xc053('0x6d'))](_0xc053('0x6e'),0x193);}_0x3e95fa=_0x2439ed;return db[_0xc053('0x6f')][_0xc053('0x70')]({'raw':!![]});}return null;})[_0xc053('0x24')](function(_0x14733f){if(_0x14733f){_0x5cf202=_[_0xc053('0x71')](_0x14733f,'id');var _0x59e7ab;var _0x39ad2c=squel[_0xc053('0x72')]();_0x39ad2c['from'](_0x336e0f[_0xc053('0x73')]);for(var _0x359938=0x0;_0x359938<_0x3e95fa['length'];_0x359938+=0x1){_0x59e7ab=_0x3e95fa[_0x359938][_0xc053('0x74')]?_0x5cf202[_0x3e95fa[_0x359938]['MetricId']][_0xc053('0x75')]:_0x3e95fa[_0x359938]['field'];_0x59e7ab=_0x3e95fa[_0x359938][_0xc053('0x76')]?_[_0xc053('0x77')](_0x6d7b78[_0x3e95fa[_0x359938]['function']],'%s',_0x59e7ab):_0x59e7ab;_0x59e7ab=_0x3e95fa[_0x359938]['format']?_[_0xc053('0x77')](_0x47c883[_0x3e95fa[_0x359938][_0xc053('0x78')]],'%s',_0x59e7ab):_0x59e7ab;if(_0x3e95fa[_0x359938][_0xc053('0x79')]){_0x39ad2c[_0xc053('0x69')](_0x59e7ab);}_0x3e95fa[_0x359938][_0xc053('0x7a')]&&_0x39ad2c['order'](_0x59e7ab,_0x3e95fa[_0x359938]['orderBy']==='DESC'?![]:!![]);_0x39ad2c['field'](_0x59e7ab,_0x3e95fa[_0x359938][_0xc053('0x7b')]||_0x59e7ab);}if(_0x336e0f[_0xc053('0x7c')]){_0x336e0f[_0xc053('0x7c')]=JSON[_0xc053('0x7d')](_0x336e0f[_0xc053('0x7c')]);for(var _0x2cd9ad=0x0;_0x2cd9ad<_0x336e0f['joins']['length'];_0x2cd9ad+=0x1){if(_0x336e0f['joins'][_0x2cd9ad]['type']&&_[_0xc053('0x62')](_0xf15d13,_0x336e0f[_0xc053('0x7c')][_0x2cd9ad][_0xc053('0x2e')])&&_0x336e0f['joins'][_0x2cd9ad]['parentKey']&&_0x336e0f[_0xc053('0x7c')][_0x2cd9ad][_0xc053('0x7e')]&&_0x336e0f[_0xc053('0x7c')][_0x2cd9ad]['foreignKey']){_0x39ad2c[_0x336e0f[_0xc053('0x7c')][_0x2cd9ad]['type']](_0x336e0f['joins'][_0x2cd9ad][_0xc053('0x7e')],null,util[_0xc053('0x78')](_0xc053('0x7f'),_0x336e0f[_0xc053('0x73')],_0x336e0f[_0xc053('0x7c')][_0x2cd9ad][_0xc053('0x80')],_0x336e0f[_0xc053('0x7c')][_0x2cd9ad][_0xc053('0x7e')],_0x336e0f[_0xc053('0x7c')][_0x2cd9ad]['foreignKey']));}}}if(_0x336e0f[_0xc053('0x81')]){_0x336e0f['conditions']=JSON['parse'](_0x336e0f[_0xc053('0x81')]);_0x39ad2c[_0xc053('0x3c')](_0xf079c7(_0x336e0f[_0xc053('0x81')][_0xc053('0x69')]));}_0x3e7c75=_0x39ad2c[_0xc053('0x82')]();_0x39ad2c[_0xc053('0x1d')](_0x2e7ff0);_0x39ad2c[_0xc053('0x1b')](0x0);logger[_0xc053('0x83')](_0xc053('0x84'),_0x39ad2c[_0xc053('0x85')]());return dbH[_0xc053('0x86')][_0xc053('0x31')](_0x39ad2c['toString'](),{'type':dbH[_0xc053('0x86')]['QueryTypes'][_0xc053('0x87')]});}})[_0xc053('0x24')](respondWithResult(_0x1dba92,null))['catch'](handleError(_0x1dba92,null));};function runReport(_0x4b0e4b,_0x3c8ef2,_0x2ce017){var _0xb3e19=_0x3c8ef2['name'];var _0x44bea2=0xa;var _0x41db2a=['join',_0xc053('0x88'),_0xc053('0x56'),_0xc053('0x57')];var _0xff585a={'SUM':_0xc053('0x58'),'COUNT':_0xc053('0x59'),'COUNT DISTINCT':_0xc053('0x5a'),'MAX':'MAX(%s)','MIN':_0xc053('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xc053('0x89'),'GROUP_CONCAT ASC':_0xc053('0x5e'),'GROUP_CONCAT DESC':_0xc053('0x8a')};var _0x455624={'SEC_TO_TIME':_0xc053('0x8b'),'DATE':_0xc053('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0xc053('0x60'),'UNIX_TIMESTAMP':_0xc053('0x61')};var _0x175b2d=function(_0x582b58){return!_[_0xc053('0x62')]([_0xc053('0x63'),'IS\x20NOT\x20NULL',_0xc053('0x65'),'IS\x20NOT\x20EMPTY'],_0x582b58);};var _0x1d58e7=function(_0x912610){if(!_0x912610||!_0x912610[_0xc053('0x67')][_0xc053('0x37')]){return'';}for(var _0xc4b5c2='(',_0x498fbd=0x0;_0x498fbd<_0x912610[_0xc053('0x67')][_0xc053('0x37')];_0x498fbd+=0x1){_0x498fbd>0x0&&(_0xc4b5c2+='\x20'+_0x912610[_0xc053('0x68')]+'\x20');_0xc4b5c2+=_0x912610[_0xc053('0x67')][_0x498fbd][_0xc053('0x69')]?_0x1d58e7(_0x912610['rules'][_0x498fbd][_0xc053('0x69')]):_0x912610['rules'][_0x498fbd][_0xc053('0x6a')]+'\x20'+_0x912610[_0xc053('0x67')][_0x498fbd][_0xc053('0x6b')]+(_0x175b2d(_0x912610[_0xc053('0x67')][_0x498fbd]['condition'])?'\x20'+_0x912610['rules'][_0x498fbd][_0xc053('0x8c')]:'');}return _0xc4b5c2+')';};var _0x48e883={'where':{'id':_0x4b0e4b['id']}},_0x554167,_0x3541ae,_0x4ffa82,_0x23b526,_0x532d2d;_0x48e883=_[_0xc053('0x3f')]({},_0x48e883,_0x2ce017);return db[_0xc053('0x2b')]['find'](_0x48e883)['then'](function(_0x5f3457){if(_0x5f3457){_0x554167=_0x5f3457;return _0x5f3457[_0xc053('0x8d')]();}return null;})[_0xc053('0x24')](function(_0x382c5f){if(_0x382c5f){if(!_0x382c5f[_0xc053('0x37')]){throw new db[(_0xc053('0x6c'))][(_0xc053('0x6d'))](_0xc053('0x6e'),0x193);}_0x3541ae=_0x382c5f;return db['AnalyticMetric'][_0xc053('0x70')]({'raw':!![]});}return null;})[_0xc053('0x24')](function(_0x18779d){if(_0x18779d){_0x4ffa82=_['keyBy'](_0x18779d,'id');var _0x422598;var _0x35c486=squel['select']();_0x35c486[_0xc053('0x8e')](_0x554167[_0xc053('0x73')]);for(var _0x18a9f8=0x0;_0x18a9f8<_0x3541ae[_0xc053('0x37')];_0x18a9f8+=0x1){_0x422598=_0x3541ae[_0x18a9f8]['MetricId']?_0x4ffa82[_0x3541ae[_0x18a9f8][_0xc053('0x74')]][_0xc053('0x75')]:_0x3541ae[_0x18a9f8][_0xc053('0x6a')];_0x422598=_0x3541ae[_0x18a9f8][_0xc053('0x76')]?_[_0xc053('0x77')](_0xff585a[_0x3541ae[_0x18a9f8][_0xc053('0x76')]],'%s',_0x422598):_0x422598;_0x422598=_0x3541ae[_0x18a9f8][_0xc053('0x78')]?_[_0xc053('0x77')](_0x455624[_0x3541ae[_0x18a9f8][_0xc053('0x78')]],'%s',_0x422598):_0x422598;if(_0x3541ae[_0x18a9f8][_0xc053('0x79')]){_0x35c486[_0xc053('0x69')](_0x422598);}_0x3541ae[_0x18a9f8][_0xc053('0x7a')]&&_0x35c486[_0xc053('0x3a')](_0x422598,_0x3541ae[_0x18a9f8][_0xc053('0x7a')]===_0xc053('0x8f')?![]:!![]);_0x35c486['field'](_0x422598,_0x3541ae[_0x18a9f8][_0xc053('0x7b')]||_0x422598);}if(_0x554167[_0xc053('0x7c')]){_0x554167[_0xc053('0x7c')]=JSON[_0xc053('0x7d')](_0x554167[_0xc053('0x7c')]);for(var _0x24efb6=0x0;_0x24efb6<_0x554167[_0xc053('0x7c')]['length'];_0x24efb6+=0x1){if(_0x554167[_0xc053('0x7c')][_0x24efb6][_0xc053('0x2e')]&&_[_0xc053('0x62')](_0x41db2a,_0x554167[_0xc053('0x7c')][_0x24efb6][_0xc053('0x2e')])&&_0x554167['joins'][_0x24efb6][_0xc053('0x80')]&&_0x554167[_0xc053('0x7c')][_0x24efb6][_0xc053('0x7e')]&&_0x554167['joins'][_0x24efb6][_0xc053('0x90')]){_0x35c486[_0x554167['joins'][_0x24efb6][_0xc053('0x2e')]](_0x554167['joins'][_0x24efb6][_0xc053('0x7e')],null,util[_0xc053('0x78')]('%s.%s\x20=\x20%s.%s',_0x554167['table'],_0x554167[_0xc053('0x7c')][_0x24efb6][_0xc053('0x80')],_0x554167['joins'][_0x24efb6][_0xc053('0x7e')],_0x554167[_0xc053('0x7c')][_0x24efb6][_0xc053('0x90')]));}}}if(_0x554167['conditions']){_0x554167[_0xc053('0x81')]=JSON[_0xc053('0x7d')](_0x554167[_0xc053('0x81')]);_0x35c486['where'](_0x1d58e7(_0x554167[_0xc053('0x81')]['group']));}_0x532d2d=_0x35c486[_0xc053('0x82')]();_0x35c486['limit'](_0x44bea2);_0x35c486[_0xc053('0x1b')](0x0);return;}})[_0xc053('0x24')](function(){if(_0x3c8ef2[_0xc053('0x91')]===_0xc053('0x92')){return null;}var _0x462082=_[_0xc053('0x3f')](_0x3c8ef2,{'name':_0x3c8ef2['fullPath']||_0x3c8ef2[_0xc053('0x29')]||_0x554167[_0xc053('0x29')],'basename':_0xb3e19,'savename':util[_0xc053('0x78')](_0xc053('0x93'),_0x3c8ef2[_0xc053('0x29')]||_0x554167[_0xc053('0x29')],require('randomstring')[_0xc053('0x94')](0x4),_0x3c8ef2[_0xc053('0x91')]||_0xc053('0x95')),'reportId':_0x554167['id'],'reportType':'custom'});return db[_0xc053('0x96')]['create'](_0x462082,{'raw':!![]});})[_0xc053('0x24')](function(_0x43a803){if(_0x554167[_0xc053('0x73')]===_0xc053('0x97')){_0x532d2d[_0xc053('0x3c')](_0x554167['table']+_0xc053('0x98'),_0x3c8ef2['startDate'],_0x3c8ef2['endDate']);}else{_0x532d2d[_0xc053('0x3c')](_0x554167[_0xc053('0x73')]+_0xc053('0x99'),_0x3c8ef2[_0xc053('0x9a')],_0x3c8ef2[_0xc053('0x9b')]);}if(_0x43a803){logger[_0xc053('0x9c')]('Run\x20Query:',_0x532d2d[_0xc053('0x85')]());require(_0xc053('0x9d'))['fork'](path[_0xc053('0x55')](__dirname,_0xc053('0x9e'),_0x43a803[_0xc053('0x91')]),[_0x43a803['id'],_0x532d2d['toString'](),path['join'](__dirname,'../../files/reports',_0x43a803[_0xc053('0x9f')]),_0xb3e19]);return _0x43a803;}else{var _0x2a35f7=squel[_0xc053('0x72')]();_0x2a35f7['from']('('+_0x532d2d[_0xc053('0x85')]()+')',_0xc053('0xa0'));_0x2a35f7[_0xc053('0x6a')](_0xc053('0xa1'),_0xc053('0x1c'));_0x532d2d[_0xc053('0x1d')](_0x3c8ef2[_0xc053('0x1d')]||_0x44bea2);_0x532d2d[_0xc053('0x1b')](_0x3c8ef2[_0xc053('0x1b')]||0x0);return dbH[_0xc053('0x86')][_0xc053('0x31')](_0x2a35f7['toString'](),{'type':dbH[_0xc053('0x86')][_0xc053('0xa2')]['SELECT']})['then'](function(_0x4ce280){if(!_0x4ce280[_0xc053('0x37')]){_0x23b526=0x0;}else{_0x23b526=_0x4ce280[0x0][_0xc053('0x1c')]||0x0;}return dbH['sequelize'][_0xc053('0x31')](_0x532d2d[_0xc053('0x85')](),{'type':dbH[_0xc053('0x86')][_0xc053('0xa2')][_0xc053('0x87')]});})[_0xc053('0x24')](function(_0xfa9717){return{'rows':_0xfa9717||[],'count':_0x23b526};});}});}exports['run']=function(_0x541b23,_0x5cbe53){return runReport(_0x541b23[_0xc053('0x48')],_0x541b23[_0xc053('0x31')],_0x541b23[_0xc053('0x42')])[_0xc053('0x24')](respondWithResult(_0x5cbe53,null))[_0xc053('0x46')](handleError(_0x5cbe53,null));};exports[_0xc053('0xa3')]=runReport;exports[_0xc053('0x31')]=function(_0x4c338f,_0x1c5125){var _0x5d1dc1=0xa;var _0x307832=[_0xc053('0x55'),_0xc053('0x88'),_0xc053('0x56'),_0xc053('0x57')];var _0x294585={'SUM':_0xc053('0x58'),'COUNT':_0xc053('0x59'),'COUNT DISTINCT':_0xc053('0x5a'),'MAX':_0xc053('0x5b'),'MIN':_0xc053('0x5c'),'AVG':_0xc053('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc053('0x5e'),'GROUP_CONCAT DESC':_0xc053('0x8a')};var _0x5c93fe={'SEC_TO_TIME':_0xc053('0x8b'),'DATE':_0xc053('0x5f'),'HOUR':_0xc053('0xa4'),'ROUND':_0xc053('0x60'),'UNIX_TIMESTAMP':_0xc053('0x61')};var _0x5b7718=function(_0x213616){return!_[_0xc053('0x62')](['IS\x20NULL',_0xc053('0x64'),_0xc053('0x65'),_0xc053('0x66')],_0x213616);};var _0x49be74=function(_0x41fd14){if(!_0x41fd14||!_0x41fd14[_0xc053('0x67')]['length']){return'';}for(var _0x478c6e='(',_0x5535ea=0x0;_0x5535ea<_0x41fd14[_0xc053('0x67')][_0xc053('0x37')];_0x5535ea+=0x1){_0x5535ea>0x0&&(_0x478c6e+='\x20'+_0x41fd14[_0xc053('0x68')]+'\x20');_0x478c6e+=_0x41fd14[_0xc053('0x67')][_0x5535ea][_0xc053('0x69')]?_0x49be74(_0x41fd14[_0xc053('0x67')][_0x5535ea][_0xc053('0x69')]):_0x41fd14[_0xc053('0x67')][_0x5535ea][_0xc053('0x6a')]+'\x20'+_0x41fd14[_0xc053('0x67')][_0x5535ea][_0xc053('0x6b')]+(_0x5b7718(_0x41fd14[_0xc053('0x67')][_0x5535ea][_0xc053('0x6b')])?'\x20'+_0x41fd14[_0xc053('0x67')][_0x5535ea]['value']:'');}return _0x478c6e+')';};var _0x4440db={'where':{'id':_0x4c338f['params']['id']}},_0x4c25ff,_0x22d7d5,_0x31d8a4,_0x2dab0d,_0x122ba0;_0x4440db=_['merge']({},_0x4440db,_0x4c338f['options']);return db[_0xc053('0x2b')]['find'](_0x4440db)[_0xc053('0x24')](function(_0x4dc941){if(_0x4dc941){_0x4c25ff=_0x4dc941;return _0x4dc941['getFields']();}return null;})[_0xc053('0x24')](function(_0x9ac83f){if(_0x9ac83f){if(!_0x9ac83f[_0xc053('0x37')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x22d7d5=_0x9ac83f;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xc053('0x24')](function(_0x8b0205){if(_0x8b0205){_0x31d8a4=_[_0xc053('0x71')](_0x8b0205,'id');var _0x371aa2;var _0x21fbe1=squel['select']();_0x21fbe1['from'](_0x4c25ff[_0xc053('0x73')]);for(var _0x384a77=0x0;_0x384a77<_0x22d7d5[_0xc053('0x37')];_0x384a77+=0x1){_0x371aa2=_0x22d7d5[_0x384a77][_0xc053('0x74')]?_0x31d8a4[_0x22d7d5[_0x384a77][_0xc053('0x74')]][_0xc053('0x75')]:_0x22d7d5[_0x384a77][_0xc053('0x6a')];_0x371aa2=_0x22d7d5[_0x384a77][_0xc053('0x76')]?_[_0xc053('0x77')](_0x294585[_0x22d7d5[_0x384a77][_0xc053('0x76')]],'%s',_0x371aa2):_0x371aa2;_0x371aa2=_0x22d7d5[_0x384a77][_0xc053('0x78')]?_[_0xc053('0x77')](_0x5c93fe[_0x22d7d5[_0x384a77][_0xc053('0x78')]],'%s',_0x371aa2):_0x371aa2;if(_0x22d7d5[_0x384a77][_0xc053('0x79')]){_0x21fbe1[_0xc053('0x69')](_0x371aa2);}_0x22d7d5[_0x384a77][_0xc053('0x7a')]&&_0x21fbe1[_0xc053('0x3a')](_0x371aa2,_0x22d7d5[_0x384a77]['orderBy']===_0xc053('0x8f')?![]:!![]);_0x21fbe1[_0xc053('0x6a')](_0x371aa2,_0x22d7d5[_0x384a77][_0xc053('0x7b')]||_0x371aa2);}if(_0x4c25ff[_0xc053('0x7c')]){_0x4c25ff[_0xc053('0x7c')]=JSON[_0xc053('0x7d')](_0x4c25ff[_0xc053('0x7c')]);for(var _0x490dd7=0x0;_0x490dd7<_0x4c25ff[_0xc053('0x7c')]['length'];_0x490dd7+=0x1){if(_0x4c25ff['joins'][_0x490dd7][_0xc053('0x2e')]&&_[_0xc053('0x62')](_0x307832,_0x4c25ff[_0xc053('0x7c')][_0x490dd7][_0xc053('0x2e')])&&_0x4c25ff[_0xc053('0x7c')][_0x490dd7][_0xc053('0x80')]&&_0x4c25ff[_0xc053('0x7c')][_0x490dd7]['foreignTable']&&_0x4c25ff[_0xc053('0x7c')][_0x490dd7]['foreignKey']){_0x21fbe1[_0x4c25ff[_0xc053('0x7c')][_0x490dd7][_0xc053('0x2e')]](_0x4c25ff[_0xc053('0x7c')][_0x490dd7][_0xc053('0x7e')],null,util[_0xc053('0x78')](_0xc053('0x7f'),_0x4c25ff[_0xc053('0x73')],_0x4c25ff[_0xc053('0x7c')][_0x490dd7][_0xc053('0x80')],_0x4c25ff['joins'][_0x490dd7]['foreignTable'],_0x4c25ff['joins'][_0x490dd7][_0xc053('0x90')]));}}}if(_0x4c25ff[_0xc053('0x81')]){_0x4c25ff[_0xc053('0x81')]=JSON[_0xc053('0x7d')](_0x4c25ff[_0xc053('0x81')]);_0x21fbe1[_0xc053('0x3c')](_0x49be74(_0x4c25ff[_0xc053('0x81')][_0xc053('0x69')]));}_0x122ba0=_0x21fbe1[_0xc053('0x82')]();_0x21fbe1[_0xc053('0x1d')](_0x5d1dc1);_0x21fbe1[_0xc053('0x1b')](0x0);logger['debug'](_0xc053('0x84'),_0x21fbe1[_0xc053('0x85')]());return dbH[_0xc053('0x86')]['query'](_0x21fbe1[_0xc053('0x85')](),{'type':dbH[_0xc053('0x86')][_0xc053('0xa2')][_0xc053('0x87')]});}})[_0xc053('0x24')](function(){return{'sql':_0x122ba0[_0xc053('0x85')]()};})[_0xc053('0x24')](respondWithResult(_0x1c5125,null))[_0xc053('0x46')](handleError(_0x1c5125,null));}; \ No newline at end of file +var _0x649c=['set','Content-Range','apply','reject','update','then','destroy','name','send','index','map','AnalyticCustomReport','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','keys','rawAttributes','length','include','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','userProfileId','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','replace','function','format','groupBy','orderBy','alias','joins','includes','parentKey','foreignTable','foreignKey','conditions','parse','clone','debug','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','IS\x20NULL','IS\x20NOT\x20NULL','value','order','%s.%s\x20=\x20%s.%s','output','web','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/','toString','../../files/reports','savename','countTable','runReport','AVG(%s)','metric','DESC','Limited\x20Query:','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','count','limit'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x649c,0x1cf));var _0xc649=function(_0x776936,_0x4a698f){_0x776936=_0x776936-0x0;var _0x3b26b0=_0x649c[_0x776936];return _0x3b26b0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc649('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc649('0x1'));var rp=require(_0xc649('0x2'));var moment=require(_0xc649('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xc649('0x4'));var util=require(_0xc649('0x5'));var path=require(_0xc649('0x6'));var sox=require(_0xc649('0x7'));var csv=require(_0xc649('0x8'));var ejs=require(_0xc649('0x9'));var fs=require('fs');var fs_extra=require(_0xc649('0xa'));var _=require(_0xc649('0xb'));var squel=require(_0xc649('0xc'));var crypto=require(_0xc649('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc649('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc649('0xf'));var Papa=require(_0xc649('0x10'));var Redis=require(_0xc649('0x11'));var authService=require(_0xc649('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xc649('0x13'));var hardwareService=require(_0xc649('0x14'));var logger=require(_0xc649('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc649('0x16'));var db=require(_0xc649('0x17'))['db'];var dbH=require('../../mysqldb')[_0xc649('0x18')];function respondWithStatusCode(_0x15aa38,_0x134050){_0x134050=_0x134050||0xcc;return function(_0x43cede){if(_0x43cede){return _0x15aa38['sendStatus'](_0x134050);}return _0x15aa38[_0xc649('0x19')](_0x134050)[_0xc649('0x1a')]();};}function respondWithResult(_0x332931,_0x4cf996){_0x4cf996=_0x4cf996||0xc8;return function(_0x4bc2b9){if(_0x4bc2b9){return _0x332931['status'](_0x4cf996)[_0xc649('0x1b')](_0x4bc2b9);}};}function respondWithFilteredResult(_0x45c254,_0x124104){return function(_0x37c8cd){if(_0x37c8cd){var _0x159815=typeof _0x124104[_0xc649('0x1c')]==='undefined'&&typeof _0x124104['limit']===_0xc649('0x1d');var _0x18dcaa=_0x37c8cd['count'];var _0x4820ee=_0x159815?0x0:_0x124104['offset'];var _0x189f8d=_0x159815?_0x37c8cd[_0xc649('0x1e')]:_0x124104[_0xc649('0x1c')]+_0x124104[_0xc649('0x1f')];var _0x5b581b;if(_0x189f8d>=_0x18dcaa){_0x189f8d=_0x18dcaa;_0x5b581b=0xc8;}else{_0x5b581b=0xce;}_0x45c254['status'](_0x5b581b);return _0x45c254[_0xc649('0x20')](_0xc649('0x21'),_0x4820ee+'-'+_0x189f8d+'/'+_0x18dcaa)['json'](_0x37c8cd);}return null;};}function patchUpdates(_0x52928b){return function(_0x384aff){try{jsonpatch[_0xc649('0x22')](_0x384aff,_0x52928b,!![]);}catch(_0x518379){return BPromise[_0xc649('0x23')](_0x518379);}return _0x384aff['save']();};}function saveUpdates(_0xaf4028,_0x1d32ef){return function(_0x4a18af){if(_0x4a18af){return _0x4a18af[_0xc649('0x24')](_0xaf4028)[_0xc649('0x25')](function(_0x149580){return _0x149580;});}return null;};}function removeEntity(_0x4374a2,_0x39da86){return function(_0x900010){if(_0x900010){return _0x900010[_0xc649('0x26')]()[_0xc649('0x25')](function(){var _0x328b4f=_0x900010['get']({'plain':!![]});var _0x5302e2='CustomReports';return db['UserProfileResource'][_0xc649('0x26')]({'where':{'type':_0x5302e2,'resourceId':_0x328b4f['id']}})[_0xc649('0x25')](function(){return _0x900010;});})[_0xc649('0x25')](function(){_0x4374a2[_0xc649('0x19')](0xcc)[_0xc649('0x1a')]();});}};}function handleEntityNotFound(_0xfef499,_0x573a61){return function(_0x5f1141){if(!_0x5f1141){_0xfef499['sendStatus'](0x194);}return _0x5f1141;};}function handleError(_0x4e74f0,_0x3c5fbe){_0x3c5fbe=_0x3c5fbe||0x1f4;return function(_0xe9319d){logger['error'](_0xe9319d['stack']);if(_0xe9319d[_0xc649('0x27')]){delete _0xe9319d[_0xc649('0x27')];}_0x4e74f0['status'](_0x3c5fbe)[_0xc649('0x28')](_0xe9319d);};}exports[_0xc649('0x29')]=function(_0x2990da,_0x1038a9){var _0x404b24={},_0xedd296={},_0x115722={'count':0x0,'rows':[]};var _0x203a5c=_[_0xc649('0x2a')](db[_0xc649('0x2b')]['rawAttributes'],function(_0x34e791){return{'name':_0x34e791['fieldName'],'type':_0x34e791[_0xc649('0x2c')]['key']};});_0xedd296[_0xc649('0x2d')]=_[_0xc649('0x2a')](_0x203a5c,_0xc649('0x27'));_0xedd296[_0xc649('0x2e')]=_['keys'](_0x2990da['query']);_0xedd296['filters']=_[_0xc649('0x2f')](_0xedd296[_0xc649('0x2d')],_0xedd296['query']);_0x404b24[_0xc649('0x30')]=_[_0xc649('0x2f')](_0xedd296[_0xc649('0x2d')],qs[_0xc649('0x31')](_0x2990da[_0xc649('0x2e')][_0xc649('0x31')]));_0x404b24['attributes']=_0x404b24[_0xc649('0x30')]['length']?_0x404b24[_0xc649('0x30')]:_0xedd296['model'];if(!_0x2990da[_0xc649('0x2e')][_0xc649('0x32')](_0xc649('0x33'))){_0x404b24['limit']=qs[_0xc649('0x1f')](_0x2990da[_0xc649('0x2e')]['limit']);_0x404b24[_0xc649('0x1c')]=qs[_0xc649('0x1c')](_0x2990da['query'][_0xc649('0x1c')]);}_0x404b24['order']=qs[_0xc649('0x34')](_0x2990da[_0xc649('0x2e')]['sort']);_0x404b24[_0xc649('0x35')]=qs[_0xc649('0x36')](_[_0xc649('0x37')](_0x2990da[_0xc649('0x2e')],_0xedd296[_0xc649('0x36')]),_0x203a5c);if(_0x2990da[_0xc649('0x2e')][_0xc649('0x38')]){_0x404b24[_0xc649('0x35')]=_[_0xc649('0x39')](_0x404b24[_0xc649('0x35')],{'$or':_[_0xc649('0x2a')](_0x203a5c,function(_0x5525c9){if(_0x5525c9[_0xc649('0x2c')]!==_0xc649('0x3a')){var _0x4ad7a6={};_0x4ad7a6[_0x5525c9[_0xc649('0x27')]]={'$like':'%'+_0x2990da[_0xc649('0x2e')][_0xc649('0x38')]+'%'};return _0x4ad7a6;}})});}_0x404b24=_[_0xc649('0x39')]({},_0x404b24,_0x2990da[_0xc649('0x3b')]);var _0x535c33={'where':_0x404b24[_0xc649('0x35')]};return db[_0xc649('0x2b')][_0xc649('0x1e')](_0x535c33)['then'](function(_0xe2695f){_0x115722['count']=_0xe2695f;if(_0x2990da[_0xc649('0x2e')][_0xc649('0x3c')]){_0x404b24['include']=[{'all':!![]}];}return db[_0xc649('0x2b')][_0xc649('0x3d')](_0x404b24);})['then'](function(_0xd7c0d0){_0x115722['rows']=_0xd7c0d0;return _0x115722;})['then'](respondWithFilteredResult(_0x1038a9,_0x404b24))[_0xc649('0x3e')](handleError(_0x1038a9,null));};exports[_0xc649('0x3f')]=function(_0x29ccdb,_0x941bb9){var _0x1d3aad={'raw':![],'where':{'id':_0x29ccdb[_0xc649('0x40')]['id']}},_0x323003={};_0x323003[_0xc649('0x2d')]=_[_0xc649('0x41')](db[_0xc649('0x2b')][_0xc649('0x42')]);_0x323003[_0xc649('0x2e')]=_[_0xc649('0x41')](_0x29ccdb['query']);_0x323003[_0xc649('0x36')]=_[_0xc649('0x2f')](_0x323003[_0xc649('0x2d')],_0x323003[_0xc649('0x2e')]);_0x1d3aad['attributes']=_[_0xc649('0x2f')](_0x323003[_0xc649('0x2d')],qs[_0xc649('0x31')](_0x29ccdb[_0xc649('0x2e')][_0xc649('0x31')]));_0x1d3aad[_0xc649('0x30')]=_0x1d3aad[_0xc649('0x30')][_0xc649('0x43')]?_0x1d3aad[_0xc649('0x30')]:_0x323003[_0xc649('0x2d')];if(_0x29ccdb['query'][_0xc649('0x3c')]){_0x1d3aad[_0xc649('0x44')]=[{'all':!![]}];}_0x1d3aad=_[_0xc649('0x39')]({},_0x1d3aad,_0x29ccdb[_0xc649('0x3b')]);return db[_0xc649('0x2b')][_0xc649('0x45')](_0x1d3aad)[_0xc649('0x25')](handleEntityNotFound(_0x941bb9,null))['then'](respondWithResult(_0x941bb9,null))[_0xc649('0x3e')](handleError(_0x941bb9,null));};exports[_0xc649('0x46')]=function(_0x1868e1,_0x2c1f8c){return db[_0xc649('0x2b')][_0xc649('0x46')](_0x1868e1[_0xc649('0x47')],{})[_0xc649('0x25')](function(_0x42669b){var _0x32d9b5=_0x1868e1['user'][_0xc649('0x48')]({'plain':!![]});if(!_0x32d9b5)throw new Error(_0xc649('0x49'));if(_0x32d9b5['role']===_0xc649('0x4a')){var _0x3c75ac=_0x42669b[_0xc649('0x48')]({'plain':!![]});var _0x501308=_0xc649('0x4b');return db[_0xc649('0x4c')]['find']({'where':{'name':_0x501308,'userProfileId':_0x32d9b5[_0xc649('0x4d')]},'raw':!![]})['then'](function(_0x10b102){if(_0x10b102&&_0x10b102['autoAssociation']===0x0){return db['UserProfileResource'][_0xc649('0x46')]({'name':_0x3c75ac[_0xc649('0x27')],'resourceId':_0x3c75ac['id'],'type':_0xc649('0x4e'),'sectionId':_0x10b102['id']},{})[_0xc649('0x25')](function(){return _0x42669b;});}else{return _0x42669b;}})[_0xc649('0x3e')](function(_0x42f346){logger[_0xc649('0x4f')](_0xc649('0x50'),_0x42f346);throw _0x42f346;});}return _0x42669b;})[_0xc649('0x25')](respondWithResult(_0x2c1f8c,0xc9))[_0xc649('0x3e')](handleError(_0x2c1f8c,null));};exports[_0xc649('0x24')]=function(_0x4f26f3,_0x54b15a){if(_0x4f26f3[_0xc649('0x47')]['id']){delete _0x4f26f3[_0xc649('0x47')]['id'];}return db[_0xc649('0x2b')][_0xc649('0x45')]({'where':{'id':_0x4f26f3[_0xc649('0x40')]['id']}})[_0xc649('0x25')](handleEntityNotFound(_0x54b15a,null))[_0xc649('0x25')](saveUpdates(_0x4f26f3[_0xc649('0x47')],null))[_0xc649('0x25')](respondWithResult(_0x54b15a,null))[_0xc649('0x3e')](handleError(_0x54b15a,null));};exports[_0xc649('0x26')]=function(_0x5acbca,_0x574045){return db[_0xc649('0x2b')][_0xc649('0x45')]({'where':{'id':_0x5acbca[_0xc649('0x40')]['id']}})['then'](handleEntityNotFound(_0x574045,null))[_0xc649('0x25')](removeEntity(_0x574045,null))['catch'](handleError(_0x574045,null));};exports[_0xc649('0x51')]=function(_0x303d44,_0x763325){var _0x58f999=0xa;var _0x6851c2=[_0xc649('0x52'),_0xc649('0x53'),_0xc649('0x54'),_0xc649('0x55')];var _0x3fe388={'SUM':'SUM(%s)','COUNT':_0xc649('0x56'),'COUNT DISTINCT':_0xc649('0x57'),'MAX':_0xc649('0x58'),'MIN':_0xc649('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xc649('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5be926={'SEC_TO_TIME':_0xc649('0x5b'),'DATE':_0xc649('0x5c'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xc649('0x5d')};var _0x56f486=function(_0x45d186){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xc649('0x5e'),_0xc649('0x5f')],_0x45d186);};var _0xd99c74=function(_0x128ce2){if(!_0x128ce2||!_0x128ce2[_0xc649('0x60')][_0xc649('0x43')]){return'';}for(var _0x3bdf31='(',_0x50ee92=0x0;_0x50ee92<_0x128ce2[_0xc649('0x60')][_0xc649('0x43')];_0x50ee92+=0x1){_0x50ee92>0x0&&(_0x3bdf31+='\x20'+_0x128ce2[_0xc649('0x61')]+'\x20');_0x3bdf31+=_0x128ce2[_0xc649('0x60')][_0x50ee92][_0xc649('0x62')]?_0xd99c74(_0x128ce2[_0xc649('0x60')][_0x50ee92][_0xc649('0x62')]):_0x128ce2['rules'][_0x50ee92][_0xc649('0x63')]+'\x20'+_0x128ce2[_0xc649('0x60')][_0x50ee92][_0xc649('0x64')]+(_0x56f486(_0x128ce2[_0xc649('0x60')][_0x50ee92][_0xc649('0x64')])?'\x20'+_0x128ce2[_0xc649('0x60')][_0x50ee92]['value']:'');}return _0x3bdf31+')';};var _0x6b99e5={'where':{'id':_0x303d44['params']['id']}},_0x27af66,_0x5406c0,_0x5eec34,_0x3bf7c5,_0x194236;_0x6b99e5=_[_0xc649('0x39')]({},_0x6b99e5,_0x303d44[_0xc649('0x3b')]);return db[_0xc649('0x2b')]['find'](_0x6b99e5)['then'](function(_0x8f73bc){if(_0x8f73bc){_0x27af66=_0x8f73bc;return _0x8f73bc[_0xc649('0x65')]();}return null;})[_0xc649('0x25')](function(_0x4b9823){if(_0x4b9823){if(!_0x4b9823[_0xc649('0x43')]){throw new db[(_0xc649('0x66'))][(_0xc649('0x67'))](_0xc649('0x68'),0x193);}_0x5406c0=_0x4b9823;return db[_0xc649('0x69')][_0xc649('0x3d')]({'raw':!![]});}return null;})[_0xc649('0x25')](function(_0x30b1a8){if(_0x30b1a8){_0x5eec34=_[_0xc649('0x6a')](_0x30b1a8,'id');var _0x3f9a0d;var _0x750537=squel[_0xc649('0x6b')]();_0x750537[_0xc649('0x6c')](_0x27af66[_0xc649('0x6d')]);for(var _0x3f2977=0x0;_0x3f2977<_0x5406c0[_0xc649('0x43')];_0x3f2977+=0x1){_0x3f9a0d=_0x5406c0[_0x3f2977][_0xc649('0x6e')]?_0x5eec34[_0x5406c0[_0x3f2977][_0xc649('0x6e')]]['metric']:_0x5406c0[_0x3f2977][_0xc649('0x63')];_0x3f9a0d=_0x5406c0[_0x3f2977]['function']?_[_0xc649('0x6f')](_0x3fe388[_0x5406c0[_0x3f2977][_0xc649('0x70')]],'%s',_0x3f9a0d):_0x3f9a0d;_0x3f9a0d=_0x5406c0[_0x3f2977][_0xc649('0x71')]?_[_0xc649('0x6f')](_0x5be926[_0x5406c0[_0x3f2977][_0xc649('0x71')]],'%s',_0x3f9a0d):_0x3f9a0d;if(_0x5406c0[_0x3f2977][_0xc649('0x72')]){_0x750537[_0xc649('0x62')](_0x3f9a0d);}_0x5406c0[_0x3f2977][_0xc649('0x73')]&&_0x750537['order'](_0x3f9a0d,_0x5406c0[_0x3f2977][_0xc649('0x73')]==='DESC'?![]:!![]);_0x750537[_0xc649('0x63')](_0x3f9a0d,_0x5406c0[_0x3f2977][_0xc649('0x74')]||_0x3f9a0d);}if(_0x27af66[_0xc649('0x75')]){_0x27af66['joins']=JSON['parse'](_0x27af66[_0xc649('0x75')]);for(var _0x2381c3=0x0;_0x2381c3<_0x27af66['joins'][_0xc649('0x43')];_0x2381c3+=0x1){if(_0x27af66[_0xc649('0x75')][_0x2381c3][_0xc649('0x2c')]&&_[_0xc649('0x76')](_0x6851c2,_0x27af66[_0xc649('0x75')][_0x2381c3][_0xc649('0x2c')])&&_0x27af66[_0xc649('0x75')][_0x2381c3][_0xc649('0x77')]&&_0x27af66[_0xc649('0x75')][_0x2381c3][_0xc649('0x78')]&&_0x27af66[_0xc649('0x75')][_0x2381c3][_0xc649('0x79')]){_0x750537[_0x27af66['joins'][_0x2381c3][_0xc649('0x2c')]](_0x27af66['joins'][_0x2381c3][_0xc649('0x78')],null,util[_0xc649('0x71')]('%s.%s\x20=\x20%s.%s',_0x27af66[_0xc649('0x6d')],_0x27af66[_0xc649('0x75')][_0x2381c3][_0xc649('0x77')],_0x27af66[_0xc649('0x75')][_0x2381c3][_0xc649('0x78')],_0x27af66['joins'][_0x2381c3][_0xc649('0x79')]));}}}if(_0x27af66[_0xc649('0x7a')]){_0x27af66['conditions']=JSON[_0xc649('0x7b')](_0x27af66['conditions']);_0x750537[_0xc649('0x35')](_0xd99c74(_0x27af66['conditions']['group']));}_0x194236=_0x750537[_0xc649('0x7c')]();_0x750537['limit'](_0x58f999);_0x750537[_0xc649('0x1c')](0x0);logger[_0xc649('0x7d')]('Limited\x20Query:',_0x750537['toString']());return dbH[_0xc649('0x7e')][_0xc649('0x2e')](_0x750537['toString'](),{'type':dbH[_0xc649('0x7e')][_0xc649('0x7f')][_0xc649('0x80')]});}})[_0xc649('0x25')](respondWithResult(_0x763325,null))[_0xc649('0x3e')](handleError(_0x763325,null));};function runReport(_0x62ba8e,_0x27a4e0,_0x46114a){var _0x10ea27=_0x27a4e0['name'];var _0x137e46=0xa;var _0x3a321c=['join','left_join','right_join',_0xc649('0x55')];var _0x401e37={'SUM':_0xc649('0x81'),'COUNT':_0xc649('0x56'),'COUNT DISTINCT':_0xc649('0x57'),'MAX':_0xc649('0x58'),'MIN':_0xc649('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xc649('0x82'),'GROUP_CONCAT DESC':_0xc649('0x83')};var _0x112b2b={'SEC_TO_TIME':_0xc649('0x5b'),'DATE':_0xc649('0x5c'),'HOUR':_0xc649('0x84'),'ROUND':_0xc649('0x85'),'UNIX_TIMESTAMP':_0xc649('0x5d')};var _0x2a7125=function(_0x2c0c93){return!_[_0xc649('0x76')]([_0xc649('0x86'),_0xc649('0x87'),_0xc649('0x5e'),_0xc649('0x5f')],_0x2c0c93);};var _0x240f80=function(_0x2f1a18){if(!_0x2f1a18||!_0x2f1a18[_0xc649('0x60')]['length']){return'';}for(var _0x468467='(',_0x336ac2=0x0;_0x336ac2<_0x2f1a18[_0xc649('0x60')]['length'];_0x336ac2+=0x1){_0x336ac2>0x0&&(_0x468467+='\x20'+_0x2f1a18[_0xc649('0x61')]+'\x20');_0x468467+=_0x2f1a18[_0xc649('0x60')][_0x336ac2][_0xc649('0x62')]?_0x240f80(_0x2f1a18[_0xc649('0x60')][_0x336ac2]['group']):_0x2f1a18[_0xc649('0x60')][_0x336ac2][_0xc649('0x63')]+'\x20'+_0x2f1a18['rules'][_0x336ac2][_0xc649('0x64')]+(_0x2a7125(_0x2f1a18[_0xc649('0x60')][_0x336ac2][_0xc649('0x64')])?'\x20'+_0x2f1a18['rules'][_0x336ac2][_0xc649('0x88')]:'');}return _0x468467+')';};var _0x63c35a={'where':{'id':_0x62ba8e['id']}},_0x46d4c2,_0x78bfb4,_0x27ddad,_0xd92bf9,_0x13931d;_0x63c35a=_[_0xc649('0x39')]({},_0x63c35a,_0x46114a);return db[_0xc649('0x2b')][_0xc649('0x45')](_0x63c35a)[_0xc649('0x25')](function(_0x8419da){if(_0x8419da){_0x46d4c2=_0x8419da;return _0x8419da[_0xc649('0x65')]();}return null;})[_0xc649('0x25')](function(_0xef7261){if(_0xef7261){if(!_0xef7261['length']){throw new db['Sequelize'][(_0xc649('0x67'))](_0xc649('0x68'),0x193);}_0x78bfb4=_0xef7261;return db[_0xc649('0x69')][_0xc649('0x3d')]({'raw':!![]});}return null;})[_0xc649('0x25')](function(_0x3beca5){if(_0x3beca5){_0x27ddad=_[_0xc649('0x6a')](_0x3beca5,'id');var _0x255ce3;var _0x1fe615=squel[_0xc649('0x6b')]();_0x1fe615[_0xc649('0x6c')](_0x46d4c2[_0xc649('0x6d')]);for(var _0x4d8733=0x0;_0x4d8733<_0x78bfb4[_0xc649('0x43')];_0x4d8733+=0x1){_0x255ce3=_0x78bfb4[_0x4d8733][_0xc649('0x6e')]?_0x27ddad[_0x78bfb4[_0x4d8733][_0xc649('0x6e')]]['metric']:_0x78bfb4[_0x4d8733][_0xc649('0x63')];_0x255ce3=_0x78bfb4[_0x4d8733][_0xc649('0x70')]?_['replace'](_0x401e37[_0x78bfb4[_0x4d8733][_0xc649('0x70')]],'%s',_0x255ce3):_0x255ce3;_0x255ce3=_0x78bfb4[_0x4d8733][_0xc649('0x71')]?_[_0xc649('0x6f')](_0x112b2b[_0x78bfb4[_0x4d8733]['format']],'%s',_0x255ce3):_0x255ce3;if(_0x78bfb4[_0x4d8733][_0xc649('0x72')]){_0x1fe615['group'](_0x255ce3);}_0x78bfb4[_0x4d8733][_0xc649('0x73')]&&_0x1fe615[_0xc649('0x89')](_0x255ce3,_0x78bfb4[_0x4d8733][_0xc649('0x73')]==='DESC'?![]:!![]);_0x1fe615[_0xc649('0x63')](_0x255ce3,_0x78bfb4[_0x4d8733]['alias']||_0x255ce3);}if(_0x46d4c2[_0xc649('0x75')]){_0x46d4c2[_0xc649('0x75')]=JSON[_0xc649('0x7b')](_0x46d4c2[_0xc649('0x75')]);for(var _0x51b8b0=0x0;_0x51b8b0<_0x46d4c2[_0xc649('0x75')][_0xc649('0x43')];_0x51b8b0+=0x1){if(_0x46d4c2['joins'][_0x51b8b0]['type']&&_['includes'](_0x3a321c,_0x46d4c2['joins'][_0x51b8b0][_0xc649('0x2c')])&&_0x46d4c2[_0xc649('0x75')][_0x51b8b0]['parentKey']&&_0x46d4c2['joins'][_0x51b8b0]['foreignTable']&&_0x46d4c2[_0xc649('0x75')][_0x51b8b0][_0xc649('0x79')]){_0x1fe615[_0x46d4c2[_0xc649('0x75')][_0x51b8b0]['type']](_0x46d4c2[_0xc649('0x75')][_0x51b8b0][_0xc649('0x78')],null,util[_0xc649('0x71')](_0xc649('0x8a'),_0x46d4c2[_0xc649('0x6d')],_0x46d4c2[_0xc649('0x75')][_0x51b8b0]['parentKey'],_0x46d4c2[_0xc649('0x75')][_0x51b8b0][_0xc649('0x78')],_0x46d4c2[_0xc649('0x75')][_0x51b8b0][_0xc649('0x79')]));}}}if(_0x46d4c2[_0xc649('0x7a')]){_0x46d4c2[_0xc649('0x7a')]=JSON[_0xc649('0x7b')](_0x46d4c2['conditions']);_0x1fe615['where'](_0x240f80(_0x46d4c2[_0xc649('0x7a')]['group']));}_0x13931d=_0x1fe615[_0xc649('0x7c')]();_0x1fe615[_0xc649('0x1f')](_0x137e46);_0x1fe615[_0xc649('0x1c')](0x0);return;}})['then'](function(){if(_0x27a4e0[_0xc649('0x8b')]===_0xc649('0x8c')){return null;}var _0x416cb8=_[_0xc649('0x39')](_0x27a4e0,{'name':_0x27a4e0['fullPath']||_0x27a4e0[_0xc649('0x27')]||_0x46d4c2['name'],'basename':_0x10ea27,'savename':util[_0xc649('0x71')](_0xc649('0x8d'),_0x27a4e0[_0xc649('0x27')]||_0x46d4c2['name'],require(_0xc649('0x8e'))[_0xc649('0x8f')](0x4),_0x27a4e0[_0xc649('0x8b')]||_0xc649('0x90')),'reportId':_0x46d4c2['id'],'reportType':_0xc649('0x91')});return db[_0xc649('0x92')][_0xc649('0x46')](_0x416cb8,{'raw':!![]});})[_0xc649('0x25')](function(_0x28b04b){if(_0x46d4c2[_0xc649('0x6d')]===_0xc649('0x93')){_0x13931d[_0xc649('0x35')](_0x46d4c2['table']+_0xc649('0x94'),_0x27a4e0[_0xc649('0x95')],_0x27a4e0[_0xc649('0x96')]);}else{_0x13931d[_0xc649('0x35')](_0x46d4c2[_0xc649('0x6d')]+_0xc649('0x97'),_0x27a4e0[_0xc649('0x95')],_0x27a4e0[_0xc649('0x96')]);}if(_0x28b04b){logger[_0xc649('0x98')]('Run\x20Query:',_0x13931d['toString']());require(_0xc649('0x99'))[_0xc649('0x9a')](path[_0xc649('0x52')](__dirname,_0xc649('0x9b'),_0x28b04b[_0xc649('0x8b')]),[_0x28b04b['id'],_0x13931d[_0xc649('0x9c')](),path[_0xc649('0x52')](__dirname,_0xc649('0x9d'),_0x28b04b[_0xc649('0x9e')]),_0x10ea27]);return _0x28b04b;}else{var _0x258ea8=squel[_0xc649('0x6b')]();_0x258ea8['from']('('+_0x13931d['toString']()+')',_0xc649('0x9f'));_0x258ea8['field']('COUNT(*)',_0xc649('0x1e'));_0x13931d[_0xc649('0x1f')](_0x27a4e0[_0xc649('0x1f')]||_0x137e46);_0x13931d['offset'](_0x27a4e0[_0xc649('0x1c')]||0x0);return dbH[_0xc649('0x7e')]['query'](_0x258ea8[_0xc649('0x9c')](),{'type':dbH['sequelize'][_0xc649('0x7f')][_0xc649('0x80')]})[_0xc649('0x25')](function(_0x41f575){if(!_0x41f575['length']){_0xd92bf9=0x0;}else{_0xd92bf9=_0x41f575[0x0][_0xc649('0x1e')]||0x0;}return dbH['sequelize']['query'](_0x13931d[_0xc649('0x9c')](),{'type':dbH['sequelize'][_0xc649('0x7f')][_0xc649('0x80')]});})['then'](function(_0x25cf6a){return{'rows':_0x25cf6a||[],'count':_0xd92bf9};});}});}exports['run']=function(_0x46e901,_0x50b363){return runReport(_0x46e901['params'],_0x46e901[_0xc649('0x2e')],_0x46e901[_0xc649('0x3b')])['then'](respondWithResult(_0x50b363,null))[_0xc649('0x3e')](handleError(_0x50b363,null));};exports[_0xc649('0xa0')]=runReport;exports[_0xc649('0x2e')]=function(_0x8e9542,_0x1f0f15){var _0x53f30a=0xa;var _0x31ed41=[_0xc649('0x52'),_0xc649('0x53'),_0xc649('0x54'),'cross_join'];var _0x582f5a={'SUM':_0xc649('0x81'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc649('0x57'),'MAX':_0xc649('0x58'),'MIN':_0xc649('0x59'),'AVG':_0xc649('0xa1'),'GROUP_CONCAT':_0xc649('0x5a'),'GROUP_CONCAT ASC':_0xc649('0x82'),'GROUP_CONCAT DESC':_0xc649('0x83')};var _0x2d5424={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xc649('0x5c'),'HOUR':_0xc649('0x84'),'ROUND':_0xc649('0x85'),'UNIX_TIMESTAMP':_0xc649('0x5d')};var _0x1af908=function(_0x19c760){return!_[_0xc649('0x76')]([_0xc649('0x86'),_0xc649('0x87'),_0xc649('0x5e'),_0xc649('0x5f')],_0x19c760);};var _0x5b819c=function(_0x477496){if(!_0x477496||!_0x477496['rules'][_0xc649('0x43')]){return'';}for(var _0x1279ad='(',_0x2f5456=0x0;_0x2f5456<_0x477496[_0xc649('0x60')]['length'];_0x2f5456+=0x1){_0x2f5456>0x0&&(_0x1279ad+='\x20'+_0x477496[_0xc649('0x61')]+'\x20');_0x1279ad+=_0x477496['rules'][_0x2f5456]['group']?_0x5b819c(_0x477496['rules'][_0x2f5456]['group']):_0x477496['rules'][_0x2f5456][_0xc649('0x63')]+'\x20'+_0x477496[_0xc649('0x60')][_0x2f5456][_0xc649('0x64')]+(_0x1af908(_0x477496[_0xc649('0x60')][_0x2f5456]['condition'])?'\x20'+_0x477496['rules'][_0x2f5456][_0xc649('0x88')]:'');}return _0x1279ad+')';};var _0x56d113={'where':{'id':_0x8e9542['params']['id']}},_0x33cb19,_0x53d525,_0x26ed09,_0x35cd28,_0x5cb9e9;_0x56d113=_[_0xc649('0x39')]({},_0x56d113,_0x8e9542[_0xc649('0x3b')]);return db[_0xc649('0x2b')][_0xc649('0x45')](_0x56d113)[_0xc649('0x25')](function(_0xd033a8){if(_0xd033a8){_0x33cb19=_0xd033a8;return _0xd033a8['getFields']();}return null;})['then'](function(_0x12c93c){if(_0x12c93c){if(!_0x12c93c[_0xc649('0x43')]){throw new db['Sequelize'][(_0xc649('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x53d525=_0x12c93c;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x41ec39){if(_0x41ec39){_0x26ed09=_[_0xc649('0x6a')](_0x41ec39,'id');var _0x1e624f;var _0x520d86=squel[_0xc649('0x6b')]();_0x520d86['from'](_0x33cb19[_0xc649('0x6d')]);for(var _0x8bcf2f=0x0;_0x8bcf2f<_0x53d525['length'];_0x8bcf2f+=0x1){_0x1e624f=_0x53d525[_0x8bcf2f][_0xc649('0x6e')]?_0x26ed09[_0x53d525[_0x8bcf2f][_0xc649('0x6e')]][_0xc649('0xa2')]:_0x53d525[_0x8bcf2f][_0xc649('0x63')];_0x1e624f=_0x53d525[_0x8bcf2f][_0xc649('0x70')]?_['replace'](_0x582f5a[_0x53d525[_0x8bcf2f][_0xc649('0x70')]],'%s',_0x1e624f):_0x1e624f;_0x1e624f=_0x53d525[_0x8bcf2f]['format']?_[_0xc649('0x6f')](_0x2d5424[_0x53d525[_0x8bcf2f][_0xc649('0x71')]],'%s',_0x1e624f):_0x1e624f;if(_0x53d525[_0x8bcf2f][_0xc649('0x72')]){_0x520d86['group'](_0x1e624f);}_0x53d525[_0x8bcf2f]['orderBy']&&_0x520d86[_0xc649('0x89')](_0x1e624f,_0x53d525[_0x8bcf2f][_0xc649('0x73')]===_0xc649('0xa3')?![]:!![]);_0x520d86[_0xc649('0x63')](_0x1e624f,_0x53d525[_0x8bcf2f][_0xc649('0x74')]||_0x1e624f);}if(_0x33cb19[_0xc649('0x75')]){_0x33cb19[_0xc649('0x75')]=JSON[_0xc649('0x7b')](_0x33cb19['joins']);for(var _0x4801c4=0x0;_0x4801c4<_0x33cb19[_0xc649('0x75')][_0xc649('0x43')];_0x4801c4+=0x1){if(_0x33cb19[_0xc649('0x75')][_0x4801c4][_0xc649('0x2c')]&&_[_0xc649('0x76')](_0x31ed41,_0x33cb19[_0xc649('0x75')][_0x4801c4][_0xc649('0x2c')])&&_0x33cb19[_0xc649('0x75')][_0x4801c4][_0xc649('0x77')]&&_0x33cb19[_0xc649('0x75')][_0x4801c4][_0xc649('0x78')]&&_0x33cb19[_0xc649('0x75')][_0x4801c4]['foreignKey']){_0x520d86[_0x33cb19[_0xc649('0x75')][_0x4801c4][_0xc649('0x2c')]](_0x33cb19['joins'][_0x4801c4][_0xc649('0x78')],null,util[_0xc649('0x71')](_0xc649('0x8a'),_0x33cb19['table'],_0x33cb19['joins'][_0x4801c4][_0xc649('0x77')],_0x33cb19[_0xc649('0x75')][_0x4801c4]['foreignTable'],_0x33cb19[_0xc649('0x75')][_0x4801c4][_0xc649('0x79')]));}}}if(_0x33cb19[_0xc649('0x7a')]){_0x33cb19[_0xc649('0x7a')]=JSON[_0xc649('0x7b')](_0x33cb19[_0xc649('0x7a')]);_0x520d86[_0xc649('0x35')](_0x5b819c(_0x33cb19[_0xc649('0x7a')][_0xc649('0x62')]));}_0x5cb9e9=_0x520d86['clone']();_0x520d86['limit'](_0x53f30a);_0x520d86[_0xc649('0x1c')](0x0);logger[_0xc649('0x7d')](_0xc649('0xa4'),_0x520d86[_0xc649('0x9c')]());return dbH['sequelize'][_0xc649('0x2e')](_0x520d86['toString'](),{'type':dbH[_0xc649('0x7e')][_0xc649('0x7f')][_0xc649('0x80')]});}})[_0xc649('0x25')](function(){return{'sql':_0x5cb9e9['toString']()};})[_0xc649('0x25')](respondWithResult(_0x1f0f15,null))[_0xc649('0x3e')](handleError(_0x1f0f15,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 69b69cb..3eb363d 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 _0xa66e=['moment','bluebird','request-promise','path','../../config/environment','./analyticCustomReport.attributes','exports','define','lodash','../../config/logger'];(function(_0x2f57b2,_0xa8e91a){var _0x5ace77=function(_0x59c00a){while(--_0x59c00a){_0x2f57b2['push'](_0x2f57b2['shift']());}};_0x5ace77(++_0xa8e91a);}(_0xa66e,0x1f2));var _0xea66=function(_0x4e5dcf,_0x32ef3e){_0x4e5dcf=_0x4e5dcf-0x0;var _0xff7a0f=_0xa66e[_0x4e5dcf];return _0xff7a0f;};'use strict';var _=require(_0xea66('0x0'));var util=require('util');var logger=require(_0xea66('0x1'))('api');var moment=require(_0xea66('0x2'));var BPromise=require(_0xea66('0x3'));var rp=require(_0xea66('0x4'));var fs=require('fs');var path=require(_0xea66('0x5'));var rimraf=require('rimraf');var config=require(_0xea66('0x6'));var attributes=require(_0xea66('0x7'));module[_0xea66('0x8')]=function(_0x499344,_0x5b60c6){return _0x499344[_0xea66('0x9')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1705=['./analyticCustomReport.attributes','exports','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment'];(function(_0x58fd67,_0x4bf710){var _0x5628fd=function(_0x5a1e09){while(--_0x5a1e09){_0x58fd67['push'](_0x58fd67['shift']());}};_0x5628fd(++_0x4bf710);}(_0x1705,0x77));var _0x5170=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0x1705[_0x49052b];return _0x48c045;};'use strict';var _=require(_0x5170('0x0'));var util=require(_0x5170('0x1'));var logger=require(_0x5170('0x2'))(_0x5170('0x3'));var moment=require(_0x5170('0x4'));var BPromise=require('bluebird');var rp=require(_0x5170('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5170('0x6'));var attributes=require(_0x5170('0x7'));module[_0x5170('0x8')]=function(_0x593e87,_0x133113){return _0x593e87['define']('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','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 e7ce7b9..14a5fd2 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 _0x69ee=['AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4fe370,_0x3e5324){var _0x4c191e=function(_0x4c0517){while(--_0x4c0517){_0x4fe370['push'](_0x4fe370['shift']());}};_0x4c191e(++_0x3e5324);}(_0x69ee,0x133));var _0xe69e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x69ee[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xe69e('0x0'));var util=require(_0xe69e('0x1'));var moment=require(_0xe69e('0x2'));var BPromise=require(_0xe69e('0x3'));var rs=require(_0xe69e('0x4'));var fs=require('fs');var Redis=require(_0xe69e('0x5'));var db=require(_0xe69e('0x6'))['db'];var utils=require(_0xe69e('0x7'));var logger=require(_0xe69e('0x8'))(_0xe69e('0x9'));var config=require(_0xe69e('0xa'));var jayson=require(_0xe69e('0xb'));var client=jayson[_0xe69e('0xc')][_0xe69e('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x53e87d,_0x3f169a,_0x24af57){return new BPromise(function(_0x3b482c,_0x338e6f){return client[_0xe69e('0xe')](_0x53e87d,_0x24af57)[_0xe69e('0xf')](function(_0x4661ad){logger[_0xe69e('0x10')](_0xe69e('0x11'),_0x3f169a,_0xe69e('0x12'));logger[_0xe69e('0x13')](_0xe69e('0x14'),_0x3f169a,'request\x20sent',JSON[_0xe69e('0x15')](_0x4661ad));if(_0x4661ad[_0xe69e('0x16')]){if(_0x4661ad['error'][_0xe69e('0x17')]===0x1f4){logger[_0xe69e('0x16')](_0xe69e('0x11'),_0x3f169a,_0x4661ad[_0xe69e('0x16')][_0xe69e('0x18')]);return _0x338e6f(_0x4661ad[_0xe69e('0x16')][_0xe69e('0x18')]);}logger['error'](_0xe69e('0x11'),_0x3f169a,_0x4661ad[_0xe69e('0x16')][_0xe69e('0x18')]);return _0x3b482c(_0x4661ad[_0xe69e('0x16')]['message']);}else{logger['info'](_0xe69e('0x11'),_0x3f169a,_0xe69e('0x12'));_0x3b482c(_0x4661ad[_0xe69e('0x19')][_0xe69e('0x18')]);}})[_0xe69e('0x1a')](function(_0x345d55){logger[_0xe69e('0x16')](_0xe69e('0x11'),_0x3f169a,_0x345d55);_0x338e6f(_0x345d55);});});} \ No newline at end of file +var _0x8618=['then','info','request\x20sent','debug','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x8618,0x16a));var _0x8861=function(_0x417b5a,_0xb886e4){_0x417b5a=_0x417b5a-0x0;var _0x2eafbe=_0x8618[_0x417b5a];return _0x2eafbe;};'use strict';var _=require('lodash');var util=require(_0x8861('0x0'));var moment=require(_0x8861('0x1'));var BPromise=require(_0x8861('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8861('0x3'))['db'];var utils=require(_0x8861('0x4'));var logger=require(_0x8861('0x5'))(_0x8861('0x6'));var config=require(_0x8861('0x7'));var jayson=require(_0x8861('0x8'));var client=jayson[_0x8861('0x9')][_0x8861('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x12cf22,_0xc0053a,_0x6a3e1e){return new BPromise(function(_0x59b413,_0x39dd4c){return client[_0x8861('0xb')](_0x12cf22,_0x6a3e1e)[_0x8861('0xc')](function(_0x779b7){logger[_0x8861('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0xc0053a,_0x8861('0xe'));logger[_0x8861('0xf')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0xc0053a,_0x8861('0xe'),JSON['stringify'](_0x779b7));if(_0x779b7[_0x8861('0x10')]){if(_0x779b7[_0x8861('0x10')][_0x8861('0x11')]===0x1f4){logger['error'](_0x8861('0x12'),_0xc0053a,_0x779b7[_0x8861('0x10')][_0x8861('0x13')]);return _0x39dd4c(_0x779b7['error'][_0x8861('0x13')]);}logger[_0x8861('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0xc0053a,_0x779b7[_0x8861('0x10')]['message']);return _0x59b413(_0x779b7[_0x8861('0x10')][_0x8861('0x13')]);}else{logger[_0x8861('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0xc0053a,_0x8861('0xe'));_0x59b413(_0x779b7[_0x8861('0x14')][_0x8861('0x13')]);}})[_0x8861('0x15')](function(_0x5ccd0a){logger[_0x8861('0x10')](_0x8861('0x12'),_0xc0053a,_0x5ccd0a);_0x39dd4c(_0x5ccd0a);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 48f21d9..d044199 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 _0x43af=['isAuthenticated','/:id','show','/:id/preview','run','post','put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x549feb,_0x544a55){var _0x30b9b6=function(_0x12b583){while(--_0x12b583){_0x549feb['push'](_0x549feb['shift']());}};_0x30b9b6(++_0x544a55);}(_0x43af,0x100));var _0xf43a=function(_0x5267b3,_0x556b53){_0x5267b3=_0x5267b3-0x0;var _0x77157=_0x43af[_0x5267b3];return _0x77157;};'use strict';var multer=require(_0xf43a('0x0'));var util=require(_0xf43a('0x1'));var path=require(_0xf43a('0x2'));var timeout=require(_0xf43a('0x3'));var express=require(_0xf43a('0x4'));var router=express[_0xf43a('0x5')]();var fs_extra=require(_0xf43a('0x6'));var auth=require(_0xf43a('0x7'));var interaction=require(_0xf43a('0x8'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0xf43a('0x9')]('/',auth[_0xf43a('0xa')](),controller['index']);router['get'](_0xf43a('0xb'),auth[_0xf43a('0xa')](),controller[_0xf43a('0xc')]);router[_0xf43a('0x9')](_0xf43a('0xd'),auth['isAuthenticated'](),controller['preview']);router[_0xf43a('0x9')]('/:id/run',auth['isAuthenticated'](),controller[_0xf43a('0xe')]);router[_0xf43a('0x9')]('/:id/query',auth[_0xf43a('0xa')](),controller['query']);router[_0xf43a('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf43a('0x10')](_0xf43a('0xb'),auth[_0xf43a('0xa')](),controller[_0xf43a('0x11')]);router['delete']('/:id',auth[_0xf43a('0xa')](),controller['destroy']);module[_0xf43a('0x12')]=router; \ No newline at end of file +var _0x4b49=['/:id/query','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','./analyticCustomReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','run'];(function(_0x102f97,_0x5bda2f){var _0xd22058=function(_0x2ccc1f){while(--_0x2ccc1f){_0x102f97['push'](_0x102f97['shift']());}};_0xd22058(++_0x5bda2f);}(_0x4b49,0x7a));var _0x94b4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4b49[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x94b4('0x0'));var util=require(_0x94b4('0x1'));var path=require(_0x94b4('0x2'));var timeout=require(_0x94b4('0x3'));var express=require('express');var router=express[_0x94b4('0x4')]();var fs_extra=require(_0x94b4('0x5'));var auth=require(_0x94b4('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x94b4('0x7'));router['get']('/',auth[_0x94b4('0x8')](),controller[_0x94b4('0x9')]);router[_0x94b4('0xa')](_0x94b4('0xb'),auth[_0x94b4('0x8')](),controller[_0x94b4('0xc')]);router[_0x94b4('0xa')](_0x94b4('0xd'),auth[_0x94b4('0x8')](),controller[_0x94b4('0xe')]);router['get']('/:id/run',auth[_0x94b4('0x8')](),controller[_0x94b4('0xf')]);router[_0x94b4('0xa')](_0x94b4('0x10'),auth['isAuthenticated'](),controller['query']);router[_0x94b4('0x11')]('/',auth[_0x94b4('0x8')](),controller[_0x94b4('0x12')]);router[_0x94b4('0x13')](_0x94b4('0xb'),auth[_0x94b4('0x8')](),controller[_0x94b4('0x14')]);router[_0x94b4('0x15')](_0x94b4('0xb'),auth[_0x94b4('0x8')](),controller['destroy']);module[_0x94b4('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 6ed90f5..a5ffe0a 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 _0x5d17=['sequelize','exports','STRING','TEXT'];(function(_0x51b6ac,_0xa7a756){var _0x52e611=function(_0x3beb01){while(--_0x3beb01){_0x51b6ac['push'](_0x51b6ac['shift']());}};_0x52e611(++_0xa7a756);}(_0x5d17,0x114));var _0x75d1=function(_0x32e2eb,_0x3347b7){_0x32e2eb=_0x32e2eb-0x0;var _0x2418ce=_0x5d17[_0x32e2eb];return _0x2418ce;};'use strict';var Sequelize=require(_0x75d1('0x0'));module[_0x75d1('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x75d1('0x2')]},'table':{'type':Sequelize[_0x75d1('0x2')]},'conditions':{'type':Sequelize[_0x75d1('0x3')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x3b36df,_0x3a1ac8){var _0x27c050=function(_0x2ff75a){while(--_0x2ff75a){_0x3b36df['push'](_0x3b36df['shift']());}};_0x27c050(++_0x3a1ac8);}(_0xac9d,0x14d));var _0xdac9=function(_0xf3897e,_0x3ac8b7){_0xf3897e=_0xf3897e-0x0;var _0x26b187=_0xac9d[_0xf3897e];return _0x26b187;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 81b164f..84c83ab 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 _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2ef3,0xba));var _0x32ef=function(_0x2e32e2,_0x5506ab){_0x2e32e2=_0x2e32e2-0x0;var _0x40d019=_0x2ef3[_0x2e32e2];return _0x40d019;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));}; \ No newline at end of file +var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0xf35bd4,_0x51ff64){var _0x47912b=function(_0x269818){while(--_0x269818){_0xf35bd4['push'](_0xf35bd4['shift']());}};_0x47912b(++_0x51ff64);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xc4aa[_0x88cd7b];return _0x56fcc8;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));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('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 083f60e..41da25e 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 _0x483d=['rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5e92a5,_0x450ab4){var _0x48918a=function(_0x1a553f){while(--_0x1a553f){_0x5e92a5['push'](_0x5e92a5['shift']());}};_0x48918a(++_0x450ab4);}(_0x483d,0x1c6));var _0xd483=function(_0x1372fd,_0x24da45){_0x1372fd=_0x1372fd-0x0;var _0x57d743=_0x483d[_0x1372fd];return _0x57d743;};'use strict';var _=require(_0xd483('0x0'));var util=require(_0xd483('0x1'));var logger=require(_0xd483('0x2'))(_0xd483('0x3'));var moment=require(_0xd483('0x4'));var BPromise=require(_0xd483('0x5'));var rp=require(_0xd483('0x6'));var fs=require('fs');var path=require(_0xd483('0x7'));var rimraf=require(_0xd483('0x8'));var config=require(_0xd483('0x9'));var attributes=require(_0xd483('0xa'));module['exports']=function(_0x1198cd,_0x2d6535){return _0x1198cd[_0xd483('0xb')](_0xd483('0xc'),attributes,{'tableName':_0xd483('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf13=['api','moment','bluebird','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger'];(function(_0x24ad5f,_0x4fcf81){var _0xabb54e=function(_0x3b4e86){while(--_0x3b4e86){_0x24ad5f['push'](_0x24ad5f['shift']());}};_0xabb54e(++_0x4fcf81);}(_0xbf13,0x169));var _0x3bf1=function(_0x11bd35,_0x34dd08){_0x11bd35=_0x11bd35-0x0;var _0xab3fe7=_0xbf13[_0x11bd35];return _0xab3fe7;};'use strict';var _=require(_0x3bf1('0x0'));var util=require(_0x3bf1('0x1'));var logger=require(_0x3bf1('0x2'))(_0x3bf1('0x3'));var moment=require(_0x3bf1('0x4'));var BPromise=require(_0x3bf1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3bf1('0x6'));var rimraf=require(_0x3bf1('0x7'));var config=require(_0x3bf1('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0x3bf1('0x9')]=function(_0x5b9693,_0x24ef94){return _0x5b9693[_0x3bf1('0xa')](_0x3bf1('0xb'),attributes,{'tableName':_0x3bf1('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 495a15c..cf43dcf 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 _0xc424=['stringify','error','message','result','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x166445,_0xed011){var _0x590e17=function(_0x4d053b){while(--_0x4d053b){_0x166445['push'](_0x166445['shift']());}};_0x590e17(++_0xed011);}(_0xc424,0x6e));var _0x4c42=function(_0x3fef06,_0x8c9962){_0x3fef06=_0x3fef06-0x0;var _0x5d3b49=_0xc424[_0x3fef06];return _0x5d3b49;};'use strict';var _=require(_0x4c42('0x0'));var util=require('util');var moment=require(_0x4c42('0x1'));var BPromise=require('bluebird');var rs=require(_0x4c42('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c42('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4c42('0x4'))('rpc');var config=require(_0x4c42('0x5'));var jayson=require(_0x4c42('0x6'));var client=jayson[_0x4c42('0x7')][_0x4c42('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1203bf,_0x48435f,_0x518199){return new BPromise(function(_0x156044,_0x3eaec4){return client[_0x4c42('0x9')](_0x1203bf,_0x518199)[_0x4c42('0xa')](function(_0x35fbe2){logger[_0x4c42('0xb')](_0x4c42('0xc'),_0x48435f,_0x4c42('0xd'));logger[_0x4c42('0xe')](_0x4c42('0xf'),_0x48435f,_0x4c42('0xd'),JSON[_0x4c42('0x10')](_0x35fbe2));if(_0x35fbe2[_0x4c42('0x11')]){if(_0x35fbe2[_0x4c42('0x11')]['code']===0x1f4){logger['error'](_0x4c42('0xc'),_0x48435f,_0x35fbe2[_0x4c42('0x11')][_0x4c42('0x12')]);return _0x3eaec4(_0x35fbe2[_0x4c42('0x11')][_0x4c42('0x12')]);}logger[_0x4c42('0x11')](_0x4c42('0xc'),_0x48435f,_0x35fbe2['error'][_0x4c42('0x12')]);return _0x156044(_0x35fbe2[_0x4c42('0x11')][_0x4c42('0x12')]);}else{logger['info'](_0x4c42('0xc'),_0x48435f,'request\x20sent');_0x156044(_0x35fbe2[_0x4c42('0x13')][_0x4c42('0x12')]);}})[_0x4c42('0x14')](function(_0x13fe7c){logger[_0x4c42('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x48435f,_0x13fe7c);_0x3eaec4(_0x13fe7c);});});} \ No newline at end of file +var _0x8f8a=['result','catch','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message'];(function(_0x4d2010,_0x1cdaf1){var _0x5ce455=function(_0x34ea58){while(--_0x34ea58){_0x4d2010['push'](_0x4d2010['shift']());}};_0x5ce455(++_0x1cdaf1);}(_0x8f8a,0x1f0));var _0xa8f8=function(_0x40f888,_0x1ae281){_0x40f888=_0x40f888-0x0;var _0x575a50=_0x8f8a[_0x40f888];return _0x575a50;};'use strict';var _=require('lodash');var util=require(_0xa8f8('0x0'));var moment=require(_0xa8f8('0x1'));var BPromise=require(_0xa8f8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa8f8('0x3'));var db=require(_0xa8f8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa8f8('0x5'));var config=require(_0xa8f8('0x6'));var jayson=require(_0xa8f8('0x7'));var client=jayson['client'][_0xa8f8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xc790da,_0x25b724,_0x33561f){return new BPromise(function(_0x4f4911,_0x30d768){return client['request'](_0xc790da,_0x33561f)[_0xa8f8('0x9')](function(_0x562f5c){logger[_0xa8f8('0xa')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x25b724,_0xa8f8('0xb'));logger['debug'](_0xa8f8('0xc'),_0x25b724,'request\x20sent',JSON['stringify'](_0x562f5c));if(_0x562f5c[_0xa8f8('0xd')]){if(_0x562f5c[_0xa8f8('0xd')][_0xa8f8('0xe')]===0x1f4){logger[_0xa8f8('0xd')](_0xa8f8('0xf'),_0x25b724,_0x562f5c[_0xa8f8('0xd')][_0xa8f8('0x10')]);return _0x30d768(_0x562f5c['error'][_0xa8f8('0x10')]);}logger[_0xa8f8('0xd')](_0xa8f8('0xf'),_0x25b724,_0x562f5c[_0xa8f8('0xd')][_0xa8f8('0x10')]);return _0x4f4911(_0x562f5c[_0xa8f8('0xd')][_0xa8f8('0x10')]);}else{logger[_0xa8f8('0xa')](_0xa8f8('0xf'),_0x25b724,'request\x20sent');_0x4f4911(_0x562f5c[_0xa8f8('0x11')]['message']);}})[_0xa8f8('0x12')](function(_0x9ae9f4){logger[_0xa8f8('0xd')](_0xa8f8('0xf'),_0x25b724,_0x9ae9f4);_0x30d768(_0x9ae9f4);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 9a05819..fc65471 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 _0x5173=['preview','/:id/run','run','query','post','create','put','update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show'];(function(_0x254723,_0x101579){var _0x2104b8=function(_0x12314a){while(--_0x12314a){_0x254723['push'](_0x254723['shift']());}};_0x2104b8(++_0x101579);}(_0x5173,0xd8));var _0x3517=function(_0x157255,_0x38090f){_0x157255=_0x157255-0x0;var _0xb59ae6=_0x5173[_0x157255];return _0xb59ae6;};'use strict';var multer=require(_0x3517('0x0'));var util=require(_0x3517('0x1'));var path=require(_0x3517('0x2'));var timeout=require(_0x3517('0x3'));var express=require(_0x3517('0x4'));var router=express['Router']();var fs_extra=require(_0x3517('0x5'));var auth=require(_0x3517('0x6'));var interaction=require(_0x3517('0x7'));var config=require(_0x3517('0x8'));var controller=require(_0x3517('0x9'));router[_0x3517('0xa')]('/',auth[_0x3517('0xb')](),controller['index']);router[_0x3517('0xa')](_0x3517('0xc'),auth['isAuthenticated'](),controller[_0x3517('0xd')]);router[_0x3517('0xa')]('/:id/preview',auth['isAuthenticated'](),controller[_0x3517('0xe')]);router['get'](_0x3517('0xf'),auth[_0x3517('0xb')](),controller[_0x3517('0x10')]);router[_0x3517('0xa')]('/:id/query',auth['isAuthenticated'](),controller[_0x3517('0x11')]);router[_0x3517('0x12')]('/',auth[_0x3517('0xb')](),controller[_0x3517('0x13')]);router[_0x3517('0x14')](_0x3517('0xc'),auth['isAuthenticated'](),controller[_0x3517('0x15')]);router['delete']('/:id',auth[_0x3517('0xb')](),controller['destroy']);module[_0x3517('0x16')]=router; \ No newline at end of file +var _0x49c7=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','/:id','show','get','/:id/preview','preview','/:id/run','/:id/query','query','update','delete','destroy','exports'];(function(_0x38feda,_0x34d3ca){var _0x13eccb=function(_0x524b8f){while(--_0x524b8f){_0x38feda['push'](_0x38feda['shift']());}};_0x13eccb(++_0x34d3ca);}(_0x49c7,0x111));var _0x749c=function(_0x45aa87,_0x2342ab){_0x45aa87=_0x45aa87-0x0;var _0x340892=_0x49c7[_0x45aa87];return _0x340892;};'use strict';var multer=require(_0x749c('0x0'));var util=require(_0x749c('0x1'));var path=require(_0x749c('0x2'));var timeout=require(_0x749c('0x3'));var express=require(_0x749c('0x4'));var router=express[_0x749c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x749c('0x6'));var config=require(_0x749c('0x7'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x749c('0x8')](),controller['index']);router['get'](_0x749c('0x9'),auth[_0x749c('0x8')](),controller[_0x749c('0xa')]);router[_0x749c('0xb')](_0x749c('0xc'),auth[_0x749c('0x8')](),controller[_0x749c('0xd')]);router[_0x749c('0xb')](_0x749c('0xe'),auth[_0x749c('0x8')](),controller['run']);router[_0x749c('0xb')](_0x749c('0xf'),auth[_0x749c('0x8')](),controller[_0x749c('0x10')]);router['post']('/',auth[_0x749c('0x8')](),controller['create']);router['put']('/:id',auth[_0x749c('0x8')](),controller[_0x749c('0x11')]);router[_0x749c('0x12')]('/:id',auth[_0x749c('0x8')](),controller[_0x749c('0x13')]);module[_0x749c('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 082435c..29bfa97 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 _0x9c28=['STRING','csv','xlsx','DATE','ENUM','UNSIGNED','sequelize','moment'];(function(_0x35ccab,_0x170c29){var _0x42a2c=function(_0x3ffd2d){while(--_0x3ffd2d){_0x35ccab['push'](_0x35ccab['shift']());}};_0x42a2c(++_0x170c29);}(_0x9c28,0xb6));var _0x89c2=function(_0x19020c,_0x1c1d9c){_0x19020c=_0x19020c-0x0;var _0x15d6ea=_0x9c28[_0x19020c];return _0x15d6ea;};'use strict';var Sequelize=require(_0x89c2('0x0'));var moment=require(_0x89c2('0x1'));module['exports']={'name':{'type':Sequelize[_0x89c2('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x89c2('0x2')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x89c2('0x3'),'pdf',_0x89c2('0x4')),'allowNull':![],'defaultValue':_0x89c2('0x3')},'savename':{'type':Sequelize[_0x89c2('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x89c2('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x89c2('0x6')]('manual','scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x89c2('0x7')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7108=['csv','pdf','Loading','scheduled','manual','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x2c02db,_0x4e46ad){var _0x1623f8=function(_0x2aeb3b){while(--_0x2aeb3b){_0x2c02db['push'](_0x2c02db['shift']());}};_0x1623f8(++_0x4e46ad);}(_0x7108,0xd8));var _0x8710=function(_0x33973e,_0x4bc984){_0x33973e=_0x33973e-0x0;var _0x2e10d7=_0x7108[_0x33973e];return _0x2e10d7;};'use strict';var Sequelize=require(_0x8710('0x0'));var moment=require('moment');module[_0x8710('0x1')]={'name':{'type':Sequelize[_0x8710('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x8710('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x8710('0x3')](_0x8710('0x4'),_0x8710('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x8710('0x4')},'savename':{'type':Sequelize[_0x8710('0x2')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x8710('0x2')],'defaultValue':_0x8710('0x6')},'type':{'type':Sequelize[_0x8710('0x3')]('manual',_0x8710('0x7')),'allowNull':![],'defaultValue':_0x8710('0x8')},'reportId':{'type':Sequelize[_0x8710('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x8710('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 1f9d6f8..6e7921b 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 _0x24d2=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','get','ExtractedReports','UserProfileResource','destroy','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','server/files/reports','ValidationError','exists','format','%s.%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse'];(function(_0x4521cc,_0xd02d95){var _0x4c3bfd=function(_0x400860){while(--_0x400860){_0x4521cc['push'](_0x4521cc['shift']());}};_0x4c3bfd(++_0xd02d95);}(_0x24d2,0xaf));var _0x224d=function(_0x5d0fb2,_0x43e289){_0x5d0fb2=_0x5d0fb2-0x0;var _0x3d909a=_0x24d2[_0x5d0fb2];return _0x3d909a;};'use strict';var emlformat=require(_0x224d('0x0'));var rimraf=require(_0x224d('0x1'));var zipdir=require(_0x224d('0x2'));var jsonpatch=require(_0x224d('0x3'));var rp=require('request-promise');var moment=require(_0x224d('0x4'));var BPromise=require(_0x224d('0x5'));var Mustache=require('mustache');var util=require(_0x224d('0x6'));var path=require(_0x224d('0x7'));var sox=require(_0x224d('0x8'));var csv=require(_0x224d('0x9'));var ejs=require(_0x224d('0xa'));var fs=require('fs');var fs_extra=require(_0x224d('0xb'));var _=require('lodash');var squel=require(_0x224d('0xc'));var crypto=require(_0x224d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x224d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x224d('0xf'));var Papa=require(_0x224d('0x10'));var Redis=require(_0x224d('0x11'));var authService=require(_0x224d('0x12'));var qs=require(_0x224d('0x13'));var as=require(_0x224d('0x14'));var hardwareService=require(_0x224d('0x15'));var logger=require(_0x224d('0x16'))('api');var utils=require(_0x224d('0x17'));var config=require(_0x224d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x224d('0x19'))['db'];function respondWithStatusCode(_0x2e6295,_0x28a2da){_0x28a2da=_0x28a2da||0xcc;return function(_0x46fbc1){if(_0x46fbc1){return _0x2e6295[_0x224d('0x1a')](_0x28a2da);}return _0x2e6295[_0x224d('0x1b')](_0x28a2da)[_0x224d('0x1c')]();};}function respondWithResult(_0x49c64a,_0xb480ee){_0xb480ee=_0xb480ee||0xc8;return function(_0x7b2bb9){if(_0x7b2bb9){return _0x49c64a[_0x224d('0x1b')](_0xb480ee)[_0x224d('0x1d')](_0x7b2bb9);}};}function respondWithFilteredResult(_0x42e2e7,_0x271634){return function(_0x128024){if(_0x128024){var _0x192108=typeof _0x271634['offset']===_0x224d('0x1e')&&typeof _0x271634[_0x224d('0x1f')]===_0x224d('0x1e');var _0x1092d3=_0x128024[_0x224d('0x20')];var _0xc1f59d=_0x192108?0x0:_0x271634['offset'];var _0x32ef78=_0x192108?_0x128024[_0x224d('0x20')]:_0x271634[_0x224d('0x21')]+_0x271634['limit'];var _0xe38320;if(_0x32ef78>=_0x1092d3){_0x32ef78=_0x1092d3;_0xe38320=0xc8;}else{_0xe38320=0xce;}_0x42e2e7['status'](_0xe38320);return _0x42e2e7[_0x224d('0x22')](_0x224d('0x23'),_0xc1f59d+'-'+_0x32ef78+'/'+_0x1092d3)['json'](_0x128024);}return null;};}function patchUpdates(_0x57978a){return function(_0x48e4ba){try{jsonpatch[_0x224d('0x24')](_0x48e4ba,_0x57978a,!![]);}catch(_0x1b5530){return BPromise[_0x224d('0x25')](_0x1b5530);}return _0x48e4ba['save']();};}function saveUpdates(_0x5bf783,_0x34e268){return function(_0x4d61a8){if(_0x4d61a8){return _0x4d61a8[_0x224d('0x26')](_0x5bf783)[_0x224d('0x27')](function(_0xd8597d){return _0xd8597d;});}return null;};}function removeEntity(_0x11aa60,_0x440c26){return function(_0x28853b){if(_0x28853b){return _0x28853b['destroy']()['then'](function(){var _0x2743cd=_0x28853b[_0x224d('0x28')]({'plain':!![]});var _0x4434d0=_0x224d('0x29');return db[_0x224d('0x2a')][_0x224d('0x2b')]({'where':{'type':_0x4434d0,'resourceId':_0x2743cd['id']}})[_0x224d('0x27')](function(){return _0x28853b;});})[_0x224d('0x27')](function(){_0x11aa60[_0x224d('0x1b')](0xcc)[_0x224d('0x1c')]();});}};}function handleEntityNotFound(_0x5d8db1,_0x53e62d){return function(_0x3f13ef){if(!_0x3f13ef){_0x5d8db1[_0x224d('0x1a')](0x194);}return _0x3f13ef;};}function handleError(_0x454e56,_0x1f209e){_0x1f209e=_0x1f209e||0x1f4;return function(_0x1925e3){logger[_0x224d('0x2c')](_0x1925e3[_0x224d('0x2d')]);if(_0x1925e3[_0x224d('0x2e')]){delete _0x1925e3[_0x224d('0x2e')];}_0x454e56[_0x224d('0x1b')](_0x1f209e)[_0x224d('0x2f')](_0x1925e3);};}exports['index']=function(_0x4c7e41,_0x25bd1c){var _0x1e9f6c={},_0x4c5900={},_0x40cb06={'count':0x0,'rows':[]};var _0x1e022a=_[_0x224d('0x30')](db[_0x224d('0x31')][_0x224d('0x32')],function(_0x14efeb){return{'name':_0x14efeb[_0x224d('0x33')],'type':_0x14efeb['type'][_0x224d('0x34')]};});_0x4c5900[_0x224d('0x35')]=_[_0x224d('0x30')](_0x1e022a,_0x224d('0x2e'));_0x4c5900[_0x224d('0x36')]=_[_0x224d('0x37')](_0x4c7e41[_0x224d('0x36')]);_0x4c5900[_0x224d('0x38')]=_[_0x224d('0x39')](_0x4c5900['model'],_0x4c5900[_0x224d('0x36')]);_0x1e9f6c[_0x224d('0x3a')]=_['intersection'](_0x4c5900[_0x224d('0x35')],qs[_0x224d('0x3b')](_0x4c7e41[_0x224d('0x36')][_0x224d('0x3b')]));_0x1e9f6c[_0x224d('0x3a')]=_0x1e9f6c['attributes'][_0x224d('0x3c')]?_0x1e9f6c[_0x224d('0x3a')]:_0x4c5900[_0x224d('0x35')];if(!_0x4c7e41[_0x224d('0x36')][_0x224d('0x3d')](_0x224d('0x3e'))){_0x1e9f6c[_0x224d('0x1f')]=qs[_0x224d('0x1f')](_0x4c7e41['query'][_0x224d('0x1f')]);_0x1e9f6c[_0x224d('0x21')]=qs['offset'](_0x4c7e41[_0x224d('0x36')][_0x224d('0x21')]);}_0x1e9f6c[_0x224d('0x3f')]=qs[_0x224d('0x40')](_0x4c7e41[_0x224d('0x36')][_0x224d('0x40')]);_0x1e9f6c['where']=qs[_0x224d('0x38')](_[_0x224d('0x41')](_0x4c7e41[_0x224d('0x36')],_0x4c5900[_0x224d('0x38')]),_0x1e022a);if(_0x4c7e41[_0x224d('0x36')][_0x224d('0x42')]){_0x1e9f6c[_0x224d('0x43')]=_[_0x224d('0x44')](_0x1e9f6c['where'],{'$or':_[_0x224d('0x30')](_0x1e022a,function(_0x214445){if(_0x214445['type']!==_0x224d('0x45')){var _0x51334f={};_0x51334f[_0x214445['name']]={'$like':'%'+_0x4c7e41[_0x224d('0x36')][_0x224d('0x42')]+'%'};return _0x51334f;}})});}_0x1e9f6c=_['merge']({},_0x1e9f6c,_0x4c7e41[_0x224d('0x46')]);var _0x11fede={'where':_0x1e9f6c['where']};return db[_0x224d('0x31')][_0x224d('0x20')](_0x11fede)[_0x224d('0x27')](function(_0x42ab56){_0x40cb06[_0x224d('0x20')]=_0x42ab56;if(_0x4c7e41[_0x224d('0x36')][_0x224d('0x47')]){_0x1e9f6c[_0x224d('0x48')]=[{'all':!![]}];}return db[_0x224d('0x31')][_0x224d('0x49')](_0x1e9f6c);})[_0x224d('0x27')](function(_0x193c2c){_0x40cb06[_0x224d('0x4a')]=_0x193c2c;return _0x40cb06;})['then'](respondWithFilteredResult(_0x25bd1c,_0x1e9f6c))['catch'](handleError(_0x25bd1c,null));};exports[_0x224d('0x4b')]=function(_0x48b40a,_0x4953ac){var _0x4150ca={'raw':!![],'where':{'id':_0x48b40a[_0x224d('0x4c')]['id']}},_0x32f330={};_0x32f330[_0x224d('0x35')]=_[_0x224d('0x37')](db[_0x224d('0x31')][_0x224d('0x32')]);_0x32f330[_0x224d('0x36')]=_[_0x224d('0x37')](_0x48b40a[_0x224d('0x36')]);_0x32f330['filters']=_[_0x224d('0x39')](_0x32f330[_0x224d('0x35')],_0x32f330[_0x224d('0x36')]);_0x4150ca[_0x224d('0x3a')]=_[_0x224d('0x39')](_0x32f330[_0x224d('0x35')],qs[_0x224d('0x3b')](_0x48b40a[_0x224d('0x36')]['fields']));_0x4150ca['attributes']=_0x4150ca[_0x224d('0x3a')][_0x224d('0x3c')]?_0x4150ca['attributes']:_0x32f330[_0x224d('0x35')];if(_0x48b40a[_0x224d('0x36')][_0x224d('0x47')]){_0x4150ca['include']=[{'all':!![]}];}_0x4150ca=_[_0x224d('0x44')]({},_0x4150ca,_0x48b40a['options']);return db[_0x224d('0x31')][_0x224d('0x4d')](_0x4150ca)[_0x224d('0x27')](handleEntityNotFound(_0x4953ac,null))[_0x224d('0x27')](respondWithResult(_0x4953ac,null))[_0x224d('0x4e')](handleError(_0x4953ac,null));};exports[_0x224d('0x4f')]=function(_0x1e834c,_0x4bdbc4){return db[_0x224d('0x31')]['create'](_0x1e834c[_0x224d('0x50')],{})[_0x224d('0x27')](function(_0x353171){var _0x56db02=_0x1e834c[_0x224d('0x51')][_0x224d('0x28')]({'plain':!![]});if(!_0x56db02)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56db02['role']===_0x224d('0x51')){var _0x2c0cf9=_0x353171[_0x224d('0x28')]({'plain':!![]});var _0x26cb60=_0x224d('0x29');return db['UserProfileSection'][_0x224d('0x4d')]({'where':{'name':_0x26cb60,'userProfileId':_0x56db02[_0x224d('0x52')]},'raw':!![]})[_0x224d('0x27')](function(_0xc7acfc){if(_0xc7acfc&&_0xc7acfc[_0x224d('0x53')]===0x0){return db[_0x224d('0x2a')][_0x224d('0x4f')]({'name':_0x2c0cf9[_0x224d('0x2e')],'resourceId':_0x2c0cf9['id'],'type':_0xc7acfc[_0x224d('0x2e')],'sectionId':_0xc7acfc['id']},{})[_0x224d('0x27')](function(){return _0x353171;});}else{return _0x353171;}})[_0x224d('0x4e')](function(_0x47086e){logger[_0x224d('0x2c')](_0x224d('0x54'),_0x47086e);throw _0x47086e;});}return _0x353171;})['then'](respondWithResult(_0x4bdbc4,0xc9))[_0x224d('0x4e')](handleError(_0x4bdbc4,null));};exports[_0x224d('0x26')]=function(_0x2b09fc,_0x2b7047){if(_0x2b09fc[_0x224d('0x50')]['id']){delete _0x2b09fc[_0x224d('0x50')]['id'];}return db['AnalyticExtractedReport'][_0x224d('0x4d')]({'where':{'id':_0x2b09fc[_0x224d('0x4c')]['id']}})[_0x224d('0x27')](handleEntityNotFound(_0x2b7047,null))[_0x224d('0x27')](saveUpdates(_0x2b09fc[_0x224d('0x50')],null))[_0x224d('0x27')](respondWithResult(_0x2b7047,null))[_0x224d('0x4e')](handleError(_0x2b7047,null));};exports['destroy']=function(_0x400027,_0xe1db5f){return db[_0x224d('0x31')][_0x224d('0x4d')]({'where':{'id':_0x400027[_0x224d('0x4c')]['id']}})[_0x224d('0x27')](handleEntityNotFound(_0xe1db5f,null))[_0x224d('0x27')](removeEntity(_0xe1db5f,null))[_0x224d('0x4e')](handleError(_0xe1db5f,null));};exports[_0x224d('0x55')]=function(_0x5834a2,_0x19d75f,_0x36ce9b){return db[_0x224d('0x31')][_0x224d('0x4d')]({'where':{'id':_0x5834a2[_0x224d('0x4c')]['id']},'attributes':[_0x224d('0x2e'),_0x224d('0x56'),_0x224d('0x57'),_0x224d('0x58')],'raw':!![]})[_0x224d('0x27')](handleEntityNotFound(_0x19d75f,null))['then'](function(_0x10f5fb){if(_0x10f5fb){if(!fs[_0x224d('0x59')](path[_0x224d('0x5a')](config['root'],_0x224d('0x5b'),_0x10f5fb['savename']))){throw new db['Sequelize'][(_0x224d('0x5c'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x5834a2[_0x224d('0x36')][_0x224d('0x5d')]){return _0x19d75f[_0x224d('0x1a')](0xc8);}return _0x19d75f['download'](path[_0x224d('0x5a')](config['root'],_0x224d('0x5b'),_0x10f5fb[_0x224d('0x57')]),util[_0x224d('0x5e')](_0x224d('0x5f'),_0x10f5fb[_0x224d('0x56')]||_0x10f5fb['name'],_0x10f5fb[_0x224d('0x58')]['toLowerCase']()));}})[_0x224d('0x4e')](handleError(_0x19d75f,null));}; \ No newline at end of file +var _0x5c4d=['jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','count','set','reject','save','update','then','destroy','get','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','params','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','savename','output','existsSync','join','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','root','toLowerCase','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto'];(function(_0x31797a,_0x3274d4){var _0x2490e1=function(_0x1303a7){while(--_0x1303a7){_0x31797a['push'](_0x31797a['shift']());}};_0x2490e1(++_0x3274d4);}(_0x5c4d,0x16e));var _0xd5c4=function(_0x27dba4,_0x419253){_0x27dba4=_0x27dba4-0x0;var _0x35ec9d=_0x5c4d[_0x27dba4];return _0x35ec9d;};'use strict';var emlformat=require(_0xd5c4('0x0'));var rimraf=require(_0xd5c4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd5c4('0x2'));var moment=require(_0xd5c4('0x3'));var BPromise=require(_0xd5c4('0x4'));var Mustache=require(_0xd5c4('0x5'));var util=require(_0xd5c4('0x6'));var path=require(_0xd5c4('0x7'));var sox=require(_0xd5c4('0x8'));var csv=require('to-csv');var ejs=require(_0xd5c4('0x9'));var fs=require('fs');var fs_extra=require(_0xd5c4('0xa'));var _=require(_0xd5c4('0xb'));var squel=require(_0xd5c4('0xc'));var crypto=require(_0xd5c4('0xd'));var jsforce=require(_0xd5c4('0xe'));var deskjs=require(_0xd5c4('0xf'));var toCsv=require(_0xd5c4('0x10'));var querystring=require(_0xd5c4('0x11'));var Papa=require(_0xd5c4('0x12'));var Redis=require(_0xd5c4('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd5c4('0x14'));var as=require(_0xd5c4('0x15'));var hardwareService=require(_0xd5c4('0x16'));var logger=require('../../config/logger')(_0xd5c4('0x17'));var utils=require(_0xd5c4('0x18'));var config=require(_0xd5c4('0x19'));var licenseUtil=require(_0xd5c4('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49a25b,_0x3a6463){_0x3a6463=_0x3a6463||0xcc;return function(_0x3ec6ae){if(_0x3ec6ae){return _0x49a25b[_0xd5c4('0x1b')](_0x3a6463);}return _0x49a25b[_0xd5c4('0x1c')](_0x3a6463)['end']();};}function respondWithResult(_0x32a397,_0x456e1a){_0x456e1a=_0x456e1a||0xc8;return function(_0x827ad4){if(_0x827ad4){return _0x32a397[_0xd5c4('0x1c')](_0x456e1a)[_0xd5c4('0x1d')](_0x827ad4);}};}function respondWithFilteredResult(_0x1328a5,_0x17a405){return function(_0x43aeb3){if(_0x43aeb3){var _0x9f4f9b=typeof _0x17a405[_0xd5c4('0x1e')]==='undefined'&&typeof _0x17a405[_0xd5c4('0x1f')]==='undefined';var _0x328f1f=_0x43aeb3[_0xd5c4('0x20')];var _0x3a6a68=_0x9f4f9b?0x0:_0x17a405[_0xd5c4('0x1e')];var _0x4373c4=_0x9f4f9b?_0x43aeb3[_0xd5c4('0x20')]:_0x17a405[_0xd5c4('0x1e')]+_0x17a405['limit'];var _0x161961;if(_0x4373c4>=_0x328f1f){_0x4373c4=_0x328f1f;_0x161961=0xc8;}else{_0x161961=0xce;}_0x1328a5[_0xd5c4('0x1c')](_0x161961);return _0x1328a5[_0xd5c4('0x21')]('Content-Range',_0x3a6a68+'-'+_0x4373c4+'/'+_0x328f1f)[_0xd5c4('0x1d')](_0x43aeb3);}return null;};}function patchUpdates(_0x2fb867){return function(_0x28f4e1){try{jsonpatch['apply'](_0x28f4e1,_0x2fb867,!![]);}catch(_0x41c882){return BPromise[_0xd5c4('0x22')](_0x41c882);}return _0x28f4e1[_0xd5c4('0x23')]();};}function saveUpdates(_0x523fa9,_0x31b3de){return function(_0x1892e5){if(_0x1892e5){return _0x1892e5[_0xd5c4('0x24')](_0x523fa9)[_0xd5c4('0x25')](function(_0x39776f){return _0x39776f;});}return null;};}function removeEntity(_0x5ac428,_0x15c4dc){return function(_0x3304c0){if(_0x3304c0){return _0x3304c0[_0xd5c4('0x26')]()[_0xd5c4('0x25')](function(){var _0x126224=_0x3304c0[_0xd5c4('0x27')]({'plain':!![]});var _0x5a62e8='ExtractedReports';return db['UserProfileResource'][_0xd5c4('0x26')]({'where':{'type':_0x5a62e8,'resourceId':_0x126224['id']}})[_0xd5c4('0x25')](function(){return _0x3304c0;});})[_0xd5c4('0x25')](function(){_0x5ac428[_0xd5c4('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3df2c4,_0x4dca86){return function(_0x311749){if(!_0x311749){_0x3df2c4[_0xd5c4('0x1b')](0x194);}return _0x311749;};}function handleError(_0x314da7,_0x4e6388){_0x4e6388=_0x4e6388||0x1f4;return function(_0x370b97){logger[_0xd5c4('0x28')](_0x370b97['stack']);if(_0x370b97[_0xd5c4('0x29')]){delete _0x370b97[_0xd5c4('0x29')];}_0x314da7[_0xd5c4('0x1c')](_0x4e6388)[_0xd5c4('0x2a')](_0x370b97);};}exports[_0xd5c4('0x2b')]=function(_0x1ae462,_0x6f2f2){var _0x1c4cdc={},_0xa67098={},_0x393654={'count':0x0,'rows':[]};var _0x5cb3e4=_[_0xd5c4('0x2c')](db[_0xd5c4('0x2d')][_0xd5c4('0x2e')],function(_0x518f2b){return{'name':_0x518f2b[_0xd5c4('0x2f')],'type':_0x518f2b['type'][_0xd5c4('0x30')]};});_0xa67098[_0xd5c4('0x31')]=_['map'](_0x5cb3e4,_0xd5c4('0x29'));_0xa67098[_0xd5c4('0x32')]=_[_0xd5c4('0x33')](_0x1ae462['query']);_0xa67098[_0xd5c4('0x34')]=_[_0xd5c4('0x35')](_0xa67098['model'],_0xa67098[_0xd5c4('0x32')]);_0x1c4cdc[_0xd5c4('0x36')]=_[_0xd5c4('0x35')](_0xa67098['model'],qs[_0xd5c4('0x37')](_0x1ae462[_0xd5c4('0x32')][_0xd5c4('0x37')]));_0x1c4cdc[_0xd5c4('0x36')]=_0x1c4cdc[_0xd5c4('0x36')][_0xd5c4('0x38')]?_0x1c4cdc['attributes']:_0xa67098[_0xd5c4('0x31')];if(!_0x1ae462[_0xd5c4('0x32')][_0xd5c4('0x39')](_0xd5c4('0x3a'))){_0x1c4cdc[_0xd5c4('0x1f')]=qs[_0xd5c4('0x1f')](_0x1ae462['query']['limit']);_0x1c4cdc[_0xd5c4('0x1e')]=qs[_0xd5c4('0x1e')](_0x1ae462[_0xd5c4('0x32')][_0xd5c4('0x1e')]);}_0x1c4cdc['order']=qs['sort'](_0x1ae462[_0xd5c4('0x32')][_0xd5c4('0x3b')]);_0x1c4cdc['where']=qs[_0xd5c4('0x34')](_[_0xd5c4('0x3c')](_0x1ae462[_0xd5c4('0x32')],_0xa67098['filters']),_0x5cb3e4);if(_0x1ae462[_0xd5c4('0x32')][_0xd5c4('0x3d')]){_0x1c4cdc[_0xd5c4('0x3e')]=_[_0xd5c4('0x3f')](_0x1c4cdc[_0xd5c4('0x3e')],{'$or':_[_0xd5c4('0x2c')](_0x5cb3e4,function(_0x31543f){if(_0x31543f[_0xd5c4('0x40')]!==_0xd5c4('0x41')){var _0x705dfc={};_0x705dfc[_0x31543f[_0xd5c4('0x29')]]={'$like':'%'+_0x1ae462[_0xd5c4('0x32')][_0xd5c4('0x3d')]+'%'};return _0x705dfc;}})});}_0x1c4cdc=_[_0xd5c4('0x3f')]({},_0x1c4cdc,_0x1ae462['options']);var _0x232ab7={'where':_0x1c4cdc[_0xd5c4('0x3e')]};return db[_0xd5c4('0x2d')][_0xd5c4('0x20')](_0x232ab7)[_0xd5c4('0x25')](function(_0x475c3f){_0x393654[_0xd5c4('0x20')]=_0x475c3f;if(_0x1ae462['query'][_0xd5c4('0x42')]){_0x1c4cdc[_0xd5c4('0x43')]=[{'all':!![]}];}return db[_0xd5c4('0x2d')]['findAll'](_0x1c4cdc);})[_0xd5c4('0x25')](function(_0x3a2dec){_0x393654['rows']=_0x3a2dec;return _0x393654;})[_0xd5c4('0x25')](respondWithFilteredResult(_0x6f2f2,_0x1c4cdc))['catch'](handleError(_0x6f2f2,null));};exports['show']=function(_0x2399bd,_0x2579e3){var _0x1e508e={'raw':!![],'where':{'id':_0x2399bd[_0xd5c4('0x44')]['id']}},_0x1c1887={};_0x1c1887[_0xd5c4('0x31')]=_[_0xd5c4('0x33')](db[_0xd5c4('0x2d')][_0xd5c4('0x2e')]);_0x1c1887[_0xd5c4('0x32')]=_[_0xd5c4('0x33')](_0x2399bd['query']);_0x1c1887[_0xd5c4('0x34')]=_[_0xd5c4('0x35')](_0x1c1887[_0xd5c4('0x31')],_0x1c1887[_0xd5c4('0x32')]);_0x1e508e[_0xd5c4('0x36')]=_['intersection'](_0x1c1887['model'],qs[_0xd5c4('0x37')](_0x2399bd['query']['fields']));_0x1e508e['attributes']=_0x1e508e[_0xd5c4('0x36')]['length']?_0x1e508e['attributes']:_0x1c1887['model'];if(_0x2399bd[_0xd5c4('0x32')][_0xd5c4('0x42')]){_0x1e508e['include']=[{'all':!![]}];}_0x1e508e=_[_0xd5c4('0x3f')]({},_0x1e508e,_0x2399bd[_0xd5c4('0x45')]);return db[_0xd5c4('0x2d')][_0xd5c4('0x46')](_0x1e508e)[_0xd5c4('0x25')](handleEntityNotFound(_0x2579e3,null))[_0xd5c4('0x25')](respondWithResult(_0x2579e3,null))[_0xd5c4('0x47')](handleError(_0x2579e3,null));};exports[_0xd5c4('0x48')]=function(_0x331070,_0x228d82){return db[_0xd5c4('0x2d')][_0xd5c4('0x48')](_0x331070['body'],{})[_0xd5c4('0x25')](function(_0x2d5006){var _0x42ac05=_0x331070[_0xd5c4('0x49')][_0xd5c4('0x27')]({'plain':!![]});if(!_0x42ac05)throw new Error(_0xd5c4('0x4a'));if(_0x42ac05[_0xd5c4('0x4b')]===_0xd5c4('0x49')){var _0x649d15=_0x2d5006[_0xd5c4('0x27')]({'plain':!![]});var _0x55a593=_0xd5c4('0x4c');return db[_0xd5c4('0x4d')][_0xd5c4('0x46')]({'where':{'name':_0x55a593,'userProfileId':_0x42ac05[_0xd5c4('0x4e')]},'raw':!![]})['then'](function(_0x486ffd){if(_0x486ffd&&_0x486ffd[_0xd5c4('0x4f')]===0x0){return db[_0xd5c4('0x50')][_0xd5c4('0x48')]({'name':_0x649d15[_0xd5c4('0x29')],'resourceId':_0x649d15['id'],'type':_0x486ffd[_0xd5c4('0x29')],'sectionId':_0x486ffd['id']},{})[_0xd5c4('0x25')](function(){return _0x2d5006;});}else{return _0x2d5006;}})[_0xd5c4('0x47')](function(_0x2a8dde){logger[_0xd5c4('0x28')](_0xd5c4('0x51'),_0x2a8dde);throw _0x2a8dde;});}return _0x2d5006;})[_0xd5c4('0x25')](respondWithResult(_0x228d82,0xc9))[_0xd5c4('0x47')](handleError(_0x228d82,null));};exports[_0xd5c4('0x24')]=function(_0x5cf2c3,_0x1d22c0){if(_0x5cf2c3[_0xd5c4('0x52')]['id']){delete _0x5cf2c3[_0xd5c4('0x52')]['id'];}return db[_0xd5c4('0x2d')][_0xd5c4('0x46')]({'where':{'id':_0x5cf2c3[_0xd5c4('0x44')]['id']}})[_0xd5c4('0x25')](handleEntityNotFound(_0x1d22c0,null))['then'](saveUpdates(_0x5cf2c3[_0xd5c4('0x52')],null))[_0xd5c4('0x25')](respondWithResult(_0x1d22c0,null))[_0xd5c4('0x47')](handleError(_0x1d22c0,null));};exports[_0xd5c4('0x26')]=function(_0x48be42,_0x548302){return db[_0xd5c4('0x2d')]['find']({'where':{'id':_0x48be42[_0xd5c4('0x44')]['id']}})[_0xd5c4('0x25')](handleEntityNotFound(_0x548302,null))['then'](removeEntity(_0x548302,null))[_0xd5c4('0x47')](handleError(_0x548302,null));};exports[_0xd5c4('0x53')]=function(_0x59d80f,_0x3e66d6,_0x300057){return db[_0xd5c4('0x2d')][_0xd5c4('0x46')]({'where':{'id':_0x59d80f[_0xd5c4('0x44')]['id']},'attributes':[_0xd5c4('0x29'),_0xd5c4('0x54'),_0xd5c4('0x55'),_0xd5c4('0x56')],'raw':!![]})[_0xd5c4('0x25')](handleEntityNotFound(_0x3e66d6,null))[_0xd5c4('0x25')](function(_0x5624ed){if(_0x5624ed){if(!fs[_0xd5c4('0x57')](path[_0xd5c4('0x58')](config['root'],_0xd5c4('0x59'),_0x5624ed[_0xd5c4('0x55')]))){throw new db['Sequelize'][(_0xd5c4('0x5a'))](_0xd5c4('0x5b'));}if(_0x59d80f[_0xd5c4('0x32')][_0xd5c4('0x5c')]){return _0x3e66d6['sendStatus'](0xc8);}return _0x3e66d6['download'](path[_0xd5c4('0x58')](config[_0xd5c4('0x5d')],'server/files/reports',_0x5624ed['savename']),util['format']('%s.%s',_0x5624ed[_0xd5c4('0x54')]||_0x5624ed[_0xd5c4('0x29')],_0x5624ed['output'][_0xd5c4('0x5e')]()));}})[_0xd5c4('0x47')](handleError(_0x3e66d6,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index f3d535c..3e4e5e4 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 _0x85e1=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','analytics_extracted_reports','util'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0x85e1,0x11f));var _0x185e=function(_0x2ebc18,_0x239f20){_0x2ebc18=_0x2ebc18-0x0;var _0x4113b4=_0x85e1[_0x2ebc18];return _0x4113b4;};'use strict';var _=require('lodash');var util=require(_0x185e('0x0'));var logger=require(_0x185e('0x1'))(_0x185e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x185e('0x3'));var fs=require('fs');var path=require(_0x185e('0x4'));var rimraf=require(_0x185e('0x5'));var config=require(_0x185e('0x6'));var attributes=require(_0x185e('0x7'));module[_0x185e('0x8')]=function(_0x2dbe50,_0x314626){return _0x2dbe50[_0x185e('0x9')](_0x185e('0xa'),attributes,{'tableName':_0x185e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe8ea=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api'];(function(_0x29f203,_0x555b42){var _0x50ebb3=function(_0x3bd2ec){while(--_0x3bd2ec){_0x29f203['push'](_0x29f203['shift']());}};_0x50ebb3(++_0x555b42);}(_0xe8ea,0x96));var _0xae8e=function(_0x30e56e,_0x133fea){_0x30e56e=_0x30e56e-0x0;var _0x36f9cb=_0xe8ea[_0x30e56e];return _0x36f9cb;};'use strict';var _=require(_0xae8e('0x0'));var util=require(_0xae8e('0x1'));var logger=require(_0xae8e('0x2'))(_0xae8e('0x3'));var moment=require(_0xae8e('0x4'));var BPromise=require(_0xae8e('0x5'));var rp=require(_0xae8e('0x6'));var fs=require('fs');var path=require(_0xae8e('0x7'));var rimraf=require(_0xae8e('0x8'));var config=require(_0xae8e('0x9'));var attributes=require(_0xae8e('0xa'));module[_0xae8e('0xb')]=function(_0x2e018a,_0x190c15){return _0x2e018a['define'](_0xae8e('0xc'),attributes,{'tableName':_0xae8e('0xd'),'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 c7253d6..ebd91db 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 _0x73ab=['debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent'];(function(_0x51ef40,_0x48a870){var _0x3ff060=function(_0x25e0a2){while(--_0x25e0a2){_0x51ef40['push'](_0x51ef40['shift']());}};_0x3ff060(++_0x48a870);}(_0x73ab,0x182));var _0xb73a=function(_0x22f85a,_0x195ed5){_0x22f85a=_0x22f85a-0x0;var _0xaa717=_0x73ab[_0x22f85a];return _0xaa717;};'use strict';var _=require(_0xb73a('0x0'));var util=require(_0xb73a('0x1'));var moment=require(_0xb73a('0x2'));var BPromise=require(_0xb73a('0x3'));var rs=require(_0xb73a('0x4'));var fs=require('fs');var Redis=require(_0xb73a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb73a('0x6'))(_0xb73a('0x7'));var config=require('../../config/environment');var jayson=require(_0xb73a('0x8'));var client=jayson[_0xb73a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x309c91,_0x5b056d,_0x13e533){return new BPromise(function(_0x21a5b6,_0x1f5c91){return client['request'](_0x309c91,_0x13e533)['then'](function(_0x2b1934){logger[_0xb73a('0xa')](_0xb73a('0xb'),_0x5b056d,_0xb73a('0xc'));logger[_0xb73a('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x5b056d,_0xb73a('0xc'),JSON[_0xb73a('0xe')](_0x2b1934));if(_0x2b1934[_0xb73a('0xf')]){if(_0x2b1934[_0xb73a('0xf')][_0xb73a('0x10')]===0x1f4){logger[_0xb73a('0xf')](_0xb73a('0xb'),_0x5b056d,_0x2b1934[_0xb73a('0xf')][_0xb73a('0x11')]);return _0x1f5c91(_0x2b1934[_0xb73a('0xf')][_0xb73a('0x11')]);}logger[_0xb73a('0xf')](_0xb73a('0xb'),_0x5b056d,_0x2b1934[_0xb73a('0xf')][_0xb73a('0x11')]);return _0x21a5b6(_0x2b1934[_0xb73a('0xf')][_0xb73a('0x11')]);}else{logger[_0xb73a('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5b056d,_0xb73a('0xc'));_0x21a5b6(_0x2b1934[_0xb73a('0x12')][_0xb73a('0x11')]);}})['catch'](function(_0x1197e6){logger[_0xb73a('0xf')](_0xb73a('0xb'),_0x5b056d,_0x1197e6);_0x1f5c91(_0x1197e6);});});} \ No newline at end of file +var _0xed65=['randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird'];(function(_0x30a204,_0x48370f){var _0x1a1350=function(_0x5844db){while(--_0x5844db){_0x30a204['push'](_0x30a204['shift']());}};_0x1a1350(++_0x48370f);}(_0xed65,0xcf));var _0x5ed6=function(_0x30b057,_0x1d1505){_0x30b057=_0x30b057-0x0;var _0x331671=_0xed65[_0x30b057];return _0x331671;};'use strict';var _=require(_0x5ed6('0x0'));var util=require('util');var moment=require(_0x5ed6('0x1'));var BPromise=require(_0x5ed6('0x2'));var rs=require(_0x5ed6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5ed6('0x4'));var logger=require('../../config/logger')(_0x5ed6('0x5'));var config=require(_0x5ed6('0x6'));var jayson=require(_0x5ed6('0x7'));var client=jayson[_0x5ed6('0x8')][_0x5ed6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c46e2,_0x136e67,_0x2ce5cc){return new BPromise(function(_0x3a7d74,_0x102f8d){return client[_0x5ed6('0xa')](_0x1c46e2,_0x2ce5cc)[_0x5ed6('0xb')](function(_0x4f9990){logger[_0x5ed6('0xc')](_0x5ed6('0xd'),_0x136e67,_0x5ed6('0xe'));logger[_0x5ed6('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x136e67,'request\x20sent',JSON[_0x5ed6('0x10')](_0x4f9990));if(_0x4f9990[_0x5ed6('0x11')]){if(_0x4f9990[_0x5ed6('0x11')]['code']===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x136e67,_0x4f9990[_0x5ed6('0x11')]['message']);return _0x102f8d(_0x4f9990['error'][_0x5ed6('0x12')]);}logger['error'](_0x5ed6('0xd'),_0x136e67,_0x4f9990[_0x5ed6('0x11')][_0x5ed6('0x12')]);return _0x3a7d74(_0x4f9990[_0x5ed6('0x11')][_0x5ed6('0x12')]);}else{logger[_0x5ed6('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x136e67,_0x5ed6('0xe'));_0x3a7d74(_0x4f9990[_0x5ed6('0x13')]['message']);}})[_0x5ed6('0x14')](function(_0x3e6d14){logger[_0x5ed6('0x11')](_0x5ed6('0xd'),_0x136e67,_0x3e6d14);_0x102f8d(_0x3e6d14);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 6b7c8f2..7b18461 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 _0x3e8a=['post','create','put','update','delete','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','/:id','show','download'];(function(_0x1adb5f,_0x4a633e){var _0x536d8a=function(_0x2bb2ac){while(--_0x2bb2ac){_0x1adb5f['push'](_0x1adb5f['shift']());}};_0x536d8a(++_0x4a633e);}(_0x3e8a,0x9a));var _0xa3e8=function(_0x5440d3,_0x68412d){_0x5440d3=_0x5440d3-0x0;var _0x49b20a=_0x3e8a[_0x5440d3];return _0x49b20a;};'use strict';var multer=require(_0xa3e8('0x0'));var util=require(_0xa3e8('0x1'));var path=require(_0xa3e8('0x2'));var timeout=require('connect-timeout');var express=require(_0xa3e8('0x3'));var router=express['Router']();var fs_extra=require(_0xa3e8('0x4'));var auth=require(_0xa3e8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa3e8('0x6'));var controller=require(_0xa3e8('0x7'));router['get']('/',auth[_0xa3e8('0x8')](),controller[_0xa3e8('0x9')]);router[_0xa3e8('0xa')](_0xa3e8('0xb'),auth[_0xa3e8('0x8')](),controller[_0xa3e8('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xa3e8('0xd')]);router[_0xa3e8('0xe')]('/',auth[_0xa3e8('0x8')](),controller[_0xa3e8('0xf')]);router[_0xa3e8('0x10')](_0xa3e8('0xb'),auth[_0xa3e8('0x8')](),controller[_0xa3e8('0x11')]);router[_0xa3e8('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xa3e8('0x13')]);module[_0xa3e8('0x14')]=router; \ No newline at end of file +var _0x52fc=['delete','destroy','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','create','put','update'];(function(_0xa060e7,_0x15768f){var _0x15b6c5=function(_0x4420f4){while(--_0x4420f4){_0xa060e7['push'](_0xa060e7['shift']());}};_0x15b6c5(++_0x15768f);}(_0x52fc,0x153));var _0xc52f=function(_0x274ed1,_0x5b0590){_0x274ed1=_0x274ed1-0x0;var _0x48433b=_0x52fc[_0x274ed1];return _0x48433b;};'use strict';var multer=require('multer');var util=require(_0xc52f('0x0'));var path=require(_0xc52f('0x1'));var timeout=require(_0xc52f('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc52f('0x3'));var auth=require(_0xc52f('0x4'));var interaction=require(_0xc52f('0x5'));var config=require(_0xc52f('0x6'));var controller=require(_0xc52f('0x7'));router[_0xc52f('0x8')]('/',auth[_0xc52f('0x9')](),controller[_0xc52f('0xa')]);router[_0xc52f('0x8')](_0xc52f('0xb'),auth['isAuthenticated'](),controller[_0xc52f('0xc')]);router[_0xc52f('0x8')](_0xc52f('0xd'),auth[_0xc52f('0x9')](),controller[_0xc52f('0xe')]);router['post']('/',auth[_0xc52f('0x9')](),controller[_0xc52f('0xf')]);router[_0xc52f('0x10')](_0xc52f('0xb'),auth[_0xc52f('0x9')](),controller[_0xc52f('0x11')]);router[_0xc52f('0x12')](_0xc52f('0xb'),auth[_0xc52f('0x9')](),controller[_0xc52f('0x13')]);module[_0xc52f('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index c40dd9f..5195fd8 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 _0x53c0=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x439150,_0x4a87ab){var _0x51ec95=function(_0x543fdd){while(--_0x543fdd){_0x439150['push'](_0x439150['shift']());}};_0x51ec95(++_0x4a87ab);}(_0x53c0,0xd2));var _0x053c=function(_0x59f0dc,_0x1e2497){_0x59f0dc=_0x59f0dc-0x0;var _0x5b5445=_0x53c0[_0x59f0dc];return _0x5b5445;};'use strict';var Sequelize=require(_0x053c('0x0'));module[_0x053c('0x1')]={'field':{'type':Sequelize[_0x053c('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x053c('0x3')]},'groupBy':{'type':Sequelize[_0x053c('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x053c('0x3')]},'custom':{'type':Sequelize[_0x053c('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xeffc=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x3ad940,_0x15749a){var _0x1f3e62=function(_0x3cfe2b){while(--_0x3cfe2b){_0x3ad940['push'](_0x3ad940['shift']());}};_0x1f3e62(++_0x15749a);}(_0xeffc,0xf6));var _0xceff=function(_0x2dad18,_0x4af20d){_0x2dad18=_0x2dad18-0x0;var _0x1a78eb=_0xeffc[_0x2dad18];return _0x1a78eb;};'use strict';var Sequelize=require(_0xceff('0x0'));module[_0xceff('0x1')]={'field':{'type':Sequelize[_0xceff('0x2')]},'alias':{'type':Sequelize[_0xceff('0x3')]},'function':{'type':Sequelize[_0xceff('0x3')]},'format':{'type':Sequelize[_0xceff('0x3')]},'groupBy':{'type':Sequelize[_0xceff('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xceff('0x3')]},'custom':{'type':Sequelize[_0xceff('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 2935e87..29d0325 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 _0x4e2d=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','include','findAll','catch','show','keys','includeAll','options','find','create','bulkCreate','body','params','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','rimraf','request-promise','moment','mustache','path','sox','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x3536e9,_0x78bee3){var _0x1958af=function(_0x51db3d){while(--_0x51db3d){_0x3536e9['push'](_0x3536e9['shift']());}};_0x1958af(++_0x78bee3);}(_0x4e2d,0x11c));var _0xd4e2=function(_0x5206a8,_0x140f28){_0x5206a8=_0x5206a8-0x0;var _0x19a917=_0x4e2d[_0x5206a8];return _0x19a917;};'use strict';var emlformat=require(_0xd4e2('0x0'));var rimraf=require(_0xd4e2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd4e2('0x2'));var moment=require(_0xd4e2('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd4e2('0x4'));var util=require('util');var path=require(_0xd4e2('0x5'));var sox=require(_0xd4e2('0x6'));var csv=require(_0xd4e2('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd4e2('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd4e2('0x9'));var jsforce=require(_0xd4e2('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xd4e2('0x7'));var querystring=require(_0xd4e2('0xb'));var Papa=require(_0xd4e2('0xc'));var Redis=require(_0xd4e2('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xd4e2('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd4e2('0xf'))(_0xd4e2('0x10'));var utils=require(_0xd4e2('0x11'));var config=require(_0xd4e2('0x12'));var licenseUtil=require(_0xd4e2('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x400c23,_0x421090){_0x421090=_0x421090||0xcc;return function(_0x1f4989){if(_0x1f4989){return _0x400c23[_0xd4e2('0x14')](_0x421090);}return _0x400c23[_0xd4e2('0x15')](_0x421090)[_0xd4e2('0x16')]();};}function respondWithResult(_0x2d60e7,_0x2effbc){_0x2effbc=_0x2effbc||0xc8;return function(_0x2d2704){if(_0x2d2704){return _0x2d60e7[_0xd4e2('0x15')](_0x2effbc)[_0xd4e2('0x17')](_0x2d2704);}};}function respondWithFilteredResult(_0x144994,_0x3a1fbf){return function(_0xcb3c94){if(_0xcb3c94){var _0x265b01=typeof _0x3a1fbf[_0xd4e2('0x18')]===_0xd4e2('0x19')&&typeof _0x3a1fbf[_0xd4e2('0x1a')]==='undefined';var _0x3acf9e=_0xcb3c94[_0xd4e2('0x1b')];var _0x5c0415=_0x265b01?0x0:_0x3a1fbf[_0xd4e2('0x18')];var _0x484f5f=_0x265b01?_0xcb3c94[_0xd4e2('0x1b')]:_0x3a1fbf[_0xd4e2('0x18')]+_0x3a1fbf['limit'];var _0x3cc689;if(_0x484f5f>=_0x3acf9e){_0x484f5f=_0x3acf9e;_0x3cc689=0xc8;}else{_0x3cc689=0xce;}_0x144994[_0xd4e2('0x15')](_0x3cc689);return _0x144994[_0xd4e2('0x1c')](_0xd4e2('0x1d'),_0x5c0415+'-'+_0x484f5f+'/'+_0x3acf9e)[_0xd4e2('0x17')](_0xcb3c94);}return null;};}function patchUpdates(_0xc7eb39){return function(_0x30d725){try{jsonpatch[_0xd4e2('0x1e')](_0x30d725,_0xc7eb39,!![]);}catch(_0x75d9ee){return BPromise[_0xd4e2('0x1f')](_0x75d9ee);}return _0x30d725[_0xd4e2('0x20')]();};}function saveUpdates(_0x26eae4,_0x4cbbf9){return function(_0x286e81){if(_0x286e81){return _0x286e81[_0xd4e2('0x21')](_0x26eae4)[_0xd4e2('0x22')](function(_0x5164b4){return _0x5164b4;});}return null;};}function removeEntity(_0x66d5b6,_0x34a40b){return function(_0x1521ba){if(_0x1521ba){return _0x1521ba[_0xd4e2('0x23')]()[_0xd4e2('0x22')](function(){_0x66d5b6[_0xd4e2('0x15')](0xcc)[_0xd4e2('0x16')]();});}};}function handleEntityNotFound(_0x34cda0,_0x527561){return function(_0x457cb0){if(!_0x457cb0){_0x34cda0[_0xd4e2('0x14')](0x194);}return _0x457cb0;};}function handleError(_0x22cf9b,_0x26a1e3){_0x26a1e3=_0x26a1e3||0x1f4;return function(_0x2fa2e9){logger['error'](_0x2fa2e9['stack']);if(_0x2fa2e9[_0xd4e2('0x24')]){delete _0x2fa2e9[_0xd4e2('0x24')];}_0x22cf9b[_0xd4e2('0x15')](_0x26a1e3)[_0xd4e2('0x25')](_0x2fa2e9);};}exports['index']=function(_0x105ac5,_0x45242b){var _0x55026c={},_0x3270a5={},_0xdfaad0={'count':0x0,'rows':[]};var _0x19a36c=_[_0xd4e2('0x26')](db[_0xd4e2('0x27')][_0xd4e2('0x28')],function(_0x3d80b2){return{'name':_0x3d80b2[_0xd4e2('0x29')],'type':_0x3d80b2[_0xd4e2('0x2a')][_0xd4e2('0x2b')]};});_0x3270a5[_0xd4e2('0x2c')]=_[_0xd4e2('0x26')](_0x19a36c,_0xd4e2('0x24'));_0x3270a5[_0xd4e2('0x2d')]=_['keys'](_0x105ac5[_0xd4e2('0x2d')]);_0x3270a5[_0xd4e2('0x2e')]=_[_0xd4e2('0x2f')](_0x3270a5[_0xd4e2('0x2c')],_0x3270a5[_0xd4e2('0x2d')]);_0x55026c[_0xd4e2('0x30')]=_[_0xd4e2('0x2f')](_0x3270a5[_0xd4e2('0x2c')],qs[_0xd4e2('0x31')](_0x105ac5[_0xd4e2('0x2d')][_0xd4e2('0x31')]));_0x55026c[_0xd4e2('0x30')]=_0x55026c[_0xd4e2('0x30')][_0xd4e2('0x32')]?_0x55026c['attributes']:_0x3270a5[_0xd4e2('0x2c')];if(!_0x105ac5[_0xd4e2('0x2d')][_0xd4e2('0x33')](_0xd4e2('0x34'))){_0x55026c[_0xd4e2('0x1a')]=qs[_0xd4e2('0x1a')](_0x105ac5[_0xd4e2('0x2d')]['limit']);_0x55026c['offset']=qs[_0xd4e2('0x18')](_0x105ac5[_0xd4e2('0x2d')][_0xd4e2('0x18')]);}_0x55026c[_0xd4e2('0x35')]=qs[_0xd4e2('0x36')](_0x105ac5[_0xd4e2('0x2d')][_0xd4e2('0x36')]);_0x55026c['where']=qs[_0xd4e2('0x2e')](_[_0xd4e2('0x37')](_0x105ac5[_0xd4e2('0x2d')],_0x3270a5[_0xd4e2('0x2e')]),_0x19a36c);if(_0x105ac5[_0xd4e2('0x2d')][_0xd4e2('0x38')]){_0x55026c[_0xd4e2('0x39')]=_[_0xd4e2('0x3a')](_0x55026c[_0xd4e2('0x39')],{'$or':_['map'](_0x19a36c,function(_0x81492e){if(_0x81492e[_0xd4e2('0x2a')]!=='VIRTUAL'){var _0xee02d6={};_0xee02d6[_0x81492e[_0xd4e2('0x24')]]={'$like':'%'+_0x105ac5[_0xd4e2('0x2d')]['filter']+'%'};return _0xee02d6;}})});}_0x55026c=_[_0xd4e2('0x3a')]({},_0x55026c,_0x105ac5['options']);var _0x28b502={'where':_0x55026c[_0xd4e2('0x39')]};return db[_0xd4e2('0x27')]['count'](_0x28b502)['then'](function(_0x310b9d){_0xdfaad0[_0xd4e2('0x1b')]=_0x310b9d;if(_0x105ac5[_0xd4e2('0x2d')]['includeAll']){_0x55026c[_0xd4e2('0x3b')]=[{'all':!![]}];}return db[_0xd4e2('0x27')][_0xd4e2('0x3c')](_0x55026c);})[_0xd4e2('0x22')](function(_0x29a92a){_0xdfaad0['rows']=_0x29a92a;return _0xdfaad0;})[_0xd4e2('0x22')](respondWithFilteredResult(_0x45242b,_0x55026c))[_0xd4e2('0x3d')](handleError(_0x45242b,null));};exports[_0xd4e2('0x3e')]=function(_0x3be9fa,_0xb21a87){var _0x355763={'raw':![],'where':{'id':_0x3be9fa['params']['id']}},_0x4748ff={};_0x4748ff['model']=_['keys'](db[_0xd4e2('0x27')]['rawAttributes']);_0x4748ff[_0xd4e2('0x2d')]=_[_0xd4e2('0x3f')](_0x3be9fa[_0xd4e2('0x2d')]);_0x4748ff[_0xd4e2('0x2e')]=_[_0xd4e2('0x2f')](_0x4748ff[_0xd4e2('0x2c')],_0x4748ff['query']);_0x355763[_0xd4e2('0x30')]=_[_0xd4e2('0x2f')](_0x4748ff['model'],qs[_0xd4e2('0x31')](_0x3be9fa[_0xd4e2('0x2d')]['fields']));_0x355763[_0xd4e2('0x30')]=_0x355763['attributes'][_0xd4e2('0x32')]?_0x355763[_0xd4e2('0x30')]:_0x4748ff[_0xd4e2('0x2c')];if(_0x3be9fa[_0xd4e2('0x2d')][_0xd4e2('0x40')]){_0x355763[_0xd4e2('0x3b')]=[{'all':!![]}];}_0x355763=_[_0xd4e2('0x3a')]({},_0x355763,_0x3be9fa[_0xd4e2('0x41')]);return db[_0xd4e2('0x27')][_0xd4e2('0x42')](_0x355763)['then'](handleEntityNotFound(_0xb21a87,null))[_0xd4e2('0x22')](respondWithResult(_0xb21a87,null))[_0xd4e2('0x3d')](handleError(_0xb21a87,null));};exports[_0xd4e2('0x43')]=function(_0x404fb8,_0xeb83d3){return db[_0xd4e2('0x27')][_0xd4e2('0x43')](_0x404fb8['body'],{})['then'](respondWithResult(_0xeb83d3,0xc9))['catch'](handleError(_0xeb83d3,null));};exports['bulkCreate']=function(_0xdb4141,_0x470547){return db[_0xd4e2('0x27')][_0xd4e2('0x44')](_0xdb4141['body'],{'raw':![],'individualHooks':!![]})[_0xd4e2('0x22')](respondWithResult(_0x470547,0xc9))[_0xd4e2('0x3d')](handleError(_0x470547,null));};exports[_0xd4e2('0x21')]=function(_0x3bac07,_0x407ccc){if(_0x3bac07['body']['id']){delete _0x3bac07[_0xd4e2('0x45')]['id'];}return db[_0xd4e2('0x27')][_0xd4e2('0x42')]({'where':{'id':_0x3bac07[_0xd4e2('0x46')]['id']}})[_0xd4e2('0x22')](handleEntityNotFound(_0x407ccc,null))[_0xd4e2('0x22')](saveUpdates(_0x3bac07[_0xd4e2('0x45')],null))['then'](respondWithResult(_0x407ccc,null))[_0xd4e2('0x3d')](handleError(_0x407ccc,null));};exports[_0xd4e2('0x23')]=function(_0x5eab33,_0x3a925f){return db[_0xd4e2('0x27')][_0xd4e2('0x42')]({'where':{'id':_0x5eab33['params']['id']}})['then'](handleEntityNotFound(_0x3a925f,null))['then'](removeEntity(_0x3a925f,null))[_0xd4e2('0x3d')](handleError(_0x3a925f,null));};exports['bulkDestroy']=function(_0x61b1df,_0x33de1c){return db[_0xd4e2('0x27')]['destroy']({'where':{'id':_0x61b1df['query']['ids']||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x33de1c,0xcc))[_0xd4e2('0x3d')](handleError(_0x33de1c,null));};exports[_0xd4e2('0x47')]=function(_0x57f68b,_0x1428b2,_0x5670cb){return db[_0xd4e2('0x48')][_0xd4e2('0x49')]({'where':{'id':_0x57f68b['params']['id']}})['then'](handleEntityNotFound(_0x1428b2,null))['then'](function(_0x3c973c){if(_0x3c973c){return db[_0xd4e2('0x4a')]['transaction'](function(_0x370f8a){return db['AnalyticFieldReport'][_0xd4e2('0x23')]({'where':{'CustomReportId':_0x57f68b[_0xd4e2('0x46')]['id']},'transaction':_0x370f8a})[_0xd4e2('0x22')](function(_0x30595a){var _0x20a526=_[_0xd4e2('0x26')](_0x57f68b[_0xd4e2('0x45')],function(_0x59b6e0){delete _0x59b6e0['id'];_0x59b6e0[_0xd4e2('0x4b')]=_0x57f68b[_0xd4e2('0x46')]['id'];return _0x59b6e0;});return db[_0xd4e2('0x27')][_0xd4e2('0x44')](_0x20a526,{'transaction':_0x370f8a});});})[_0xd4e2('0x22')](function(){return db[_0xd4e2('0x27')][_0xd4e2('0x3c')]({'where':{'CustomReportId':_0x57f68b[_0xd4e2('0x46')]['id']}});});}})[_0xd4e2('0x22')](respondWithResult(_0x1428b2,null))['catch'](handleError(_0x1428b2,null));}; \ No newline at end of file +var _0x3f1f=['util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','merge','options','find','create','body','bulkCreate','params','ids','addFields','findOne','sequelize','destroy','CustomReportId','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache'];(function(_0x2bf680,_0x3baa21){var _0x4f4391=function(_0x471934){while(--_0x471934){_0x2bf680['push'](_0x2bf680['shift']());}};_0x4f4391(++_0x3baa21);}(_0x3f1f,0x1e6));var _0xf3f1=function(_0xd5dac7,_0x26b807){_0xd5dac7=_0xd5dac7-0x0;var _0x47b7e8=_0x3f1f[_0xd5dac7];return _0x47b7e8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf3f1('0x0'));var zipdir=require(_0xf3f1('0x1'));var jsonpatch=require(_0xf3f1('0x2'));var rp=require(_0xf3f1('0x3'));var moment=require(_0xf3f1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf3f1('0x5'));var util=require(_0xf3f1('0x6'));var path=require(_0xf3f1('0x7'));var sox=require(_0xf3f1('0x8'));var csv=require(_0xf3f1('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf3f1('0xa'));var _=require('lodash');var squel=require(_0xf3f1('0xb'));var crypto=require(_0xf3f1('0xc'));var jsforce=require(_0xf3f1('0xd'));var deskjs=require(_0xf3f1('0xe'));var toCsv=require(_0xf3f1('0x9'));var querystring=require(_0xf3f1('0xf'));var Papa=require('papaparse');var Redis=require(_0xf3f1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf3f1('0x11'));var as=require(_0xf3f1('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf3f1('0x13'))('api');var utils=require(_0xf3f1('0x14'));var config=require(_0xf3f1('0x15'));var licenseUtil=require(_0xf3f1('0x16'));var db=require(_0xf3f1('0x17'))['db'];function respondWithStatusCode(_0x4d8217,_0x54ce57){_0x54ce57=_0x54ce57||0xcc;return function(_0x2e3dc1){if(_0x2e3dc1){return _0x4d8217[_0xf3f1('0x18')](_0x54ce57);}return _0x4d8217[_0xf3f1('0x19')](_0x54ce57)[_0xf3f1('0x1a')]();};}function respondWithResult(_0x1ee17e,_0x3a649e){_0x3a649e=_0x3a649e||0xc8;return function(_0x42adc2){if(_0x42adc2){return _0x1ee17e['status'](_0x3a649e)['json'](_0x42adc2);}};}function respondWithFilteredResult(_0x4ec9d3,_0x5cd68f){return function(_0x176090){if(_0x176090){var _0x16f708=typeof _0x5cd68f[_0xf3f1('0x1b')]==='undefined'&&typeof _0x5cd68f[_0xf3f1('0x1c')]===_0xf3f1('0x1d');var _0x1ed1f3=_0x176090['count'];var _0x53180a=_0x16f708?0x0:_0x5cd68f[_0xf3f1('0x1b')];var _0x83d2d0=_0x16f708?_0x176090[_0xf3f1('0x1e')]:_0x5cd68f['offset']+_0x5cd68f[_0xf3f1('0x1c')];var _0x197477;if(_0x83d2d0>=_0x1ed1f3){_0x83d2d0=_0x1ed1f3;_0x197477=0xc8;}else{_0x197477=0xce;}_0x4ec9d3[_0xf3f1('0x19')](_0x197477);return _0x4ec9d3[_0xf3f1('0x1f')](_0xf3f1('0x20'),_0x53180a+'-'+_0x83d2d0+'/'+_0x1ed1f3)[_0xf3f1('0x21')](_0x176090);}return null;};}function patchUpdates(_0x553002){return function(_0x594164){try{jsonpatch[_0xf3f1('0x22')](_0x594164,_0x553002,!![]);}catch(_0x3998b0){return BPromise['reject'](_0x3998b0);}return _0x594164[_0xf3f1('0x23')]();};}function saveUpdates(_0x2809f4,_0x5ad1d6){return function(_0x5a0a9b){if(_0x5a0a9b){return _0x5a0a9b[_0xf3f1('0x24')](_0x2809f4)[_0xf3f1('0x25')](function(_0xaee686){return _0xaee686;});}return null;};}function removeEntity(_0x44d647,_0x23a216){return function(_0x46ab1b){if(_0x46ab1b){return _0x46ab1b['destroy']()[_0xf3f1('0x25')](function(){_0x44d647[_0xf3f1('0x19')](0xcc)[_0xf3f1('0x1a')]();});}};}function handleEntityNotFound(_0x2f23f2,_0xb3dd5d){return function(_0x3c5c8b){if(!_0x3c5c8b){_0x2f23f2[_0xf3f1('0x18')](0x194);}return _0x3c5c8b;};}function handleError(_0xc6ae69,_0x219bf1){_0x219bf1=_0x219bf1||0x1f4;return function(_0x489e2c){logger[_0xf3f1('0x26')](_0x489e2c['stack']);if(_0x489e2c[_0xf3f1('0x27')]){delete _0x489e2c[_0xf3f1('0x27')];}_0xc6ae69['status'](_0x219bf1)[_0xf3f1('0x28')](_0x489e2c);};}exports[_0xf3f1('0x29')]=function(_0x1c6ad0,_0x410305){var _0x1988c3={},_0x6a5b7e={},_0x5f0262={'count':0x0,'rows':[]};var _0x92f75b=_[_0xf3f1('0x2a')](db[_0xf3f1('0x2b')][_0xf3f1('0x2c')],function(_0x583672){return{'name':_0x583672[_0xf3f1('0x2d')],'type':_0x583672[_0xf3f1('0x2e')]['key']};});_0x6a5b7e[_0xf3f1('0x2f')]=_[_0xf3f1('0x2a')](_0x92f75b,_0xf3f1('0x27'));_0x6a5b7e['query']=_[_0xf3f1('0x30')](_0x1c6ad0['query']);_0x6a5b7e[_0xf3f1('0x31')]=_['intersection'](_0x6a5b7e[_0xf3f1('0x2f')],_0x6a5b7e[_0xf3f1('0x32')]);_0x1988c3[_0xf3f1('0x33')]=_[_0xf3f1('0x34')](_0x6a5b7e[_0xf3f1('0x2f')],qs['fields'](_0x1c6ad0['query'][_0xf3f1('0x35')]));_0x1988c3[_0xf3f1('0x33')]=_0x1988c3['attributes'][_0xf3f1('0x36')]?_0x1988c3[_0xf3f1('0x33')]:_0x6a5b7e[_0xf3f1('0x2f')];if(!_0x1c6ad0[_0xf3f1('0x32')][_0xf3f1('0x37')](_0xf3f1('0x38'))){_0x1988c3['limit']=qs[_0xf3f1('0x1c')](_0x1c6ad0[_0xf3f1('0x32')][_0xf3f1('0x1c')]);_0x1988c3['offset']=qs[_0xf3f1('0x1b')](_0x1c6ad0[_0xf3f1('0x32')][_0xf3f1('0x1b')]);}_0x1988c3[_0xf3f1('0x39')]=qs['sort'](_0x1c6ad0['query'][_0xf3f1('0x3a')]);_0x1988c3['where']=qs[_0xf3f1('0x31')](_[_0xf3f1('0x3b')](_0x1c6ad0[_0xf3f1('0x32')],_0x6a5b7e[_0xf3f1('0x31')]),_0x92f75b);if(_0x1c6ad0['query']['filter']){_0x1988c3[_0xf3f1('0x3c')]=_['merge'](_0x1988c3[_0xf3f1('0x3c')],{'$or':_[_0xf3f1('0x2a')](_0x92f75b,function(_0x29af81){if(_0x29af81[_0xf3f1('0x2e')]!==_0xf3f1('0x3d')){var _0x5b38ec={};_0x5b38ec[_0x29af81[_0xf3f1('0x27')]]={'$like':'%'+_0x1c6ad0[_0xf3f1('0x32')][_0xf3f1('0x3e')]+'%'};return _0x5b38ec;}})});}_0x1988c3=_['merge']({},_0x1988c3,_0x1c6ad0['options']);var _0x40ed92={'where':_0x1988c3[_0xf3f1('0x3c')]};return db[_0xf3f1('0x2b')][_0xf3f1('0x1e')](_0x40ed92)[_0xf3f1('0x25')](function(_0x1cdf88){_0x5f0262[_0xf3f1('0x1e')]=_0x1cdf88;if(_0x1c6ad0['query'][_0xf3f1('0x3f')]){_0x1988c3[_0xf3f1('0x40')]=[{'all':!![]}];}return db[_0xf3f1('0x2b')][_0xf3f1('0x41')](_0x1988c3);})['then'](function(_0x24cc5d){_0x5f0262[_0xf3f1('0x42')]=_0x24cc5d;return _0x5f0262;})['then'](respondWithFilteredResult(_0x410305,_0x1988c3))[_0xf3f1('0x43')](handleError(_0x410305,null));};exports[_0xf3f1('0x44')]=function(_0x324126,_0x377af3){var _0x324dbc={'raw':![],'where':{'id':_0x324126['params']['id']}},_0x30dbb7={};_0x30dbb7[_0xf3f1('0x2f')]=_[_0xf3f1('0x30')](db[_0xf3f1('0x2b')]['rawAttributes']);_0x30dbb7[_0xf3f1('0x32')]=_[_0xf3f1('0x30')](_0x324126[_0xf3f1('0x32')]);_0x30dbb7[_0xf3f1('0x31')]=_[_0xf3f1('0x34')](_0x30dbb7[_0xf3f1('0x2f')],_0x30dbb7[_0xf3f1('0x32')]);_0x324dbc[_0xf3f1('0x33')]=_[_0xf3f1('0x34')](_0x30dbb7[_0xf3f1('0x2f')],qs[_0xf3f1('0x35')](_0x324126[_0xf3f1('0x32')][_0xf3f1('0x35')]));_0x324dbc[_0xf3f1('0x33')]=_0x324dbc[_0xf3f1('0x33')][_0xf3f1('0x36')]?_0x324dbc[_0xf3f1('0x33')]:_0x30dbb7[_0xf3f1('0x2f')];if(_0x324126[_0xf3f1('0x32')][_0xf3f1('0x3f')]){_0x324dbc['include']=[{'all':!![]}];}_0x324dbc=_[_0xf3f1('0x45')]({},_0x324dbc,_0x324126[_0xf3f1('0x46')]);return db[_0xf3f1('0x2b')][_0xf3f1('0x47')](_0x324dbc)[_0xf3f1('0x25')](handleEntityNotFound(_0x377af3,null))['then'](respondWithResult(_0x377af3,null))[_0xf3f1('0x43')](handleError(_0x377af3,null));};exports[_0xf3f1('0x48')]=function(_0x33f7fb,_0x21df9b){return db[_0xf3f1('0x2b')][_0xf3f1('0x48')](_0x33f7fb[_0xf3f1('0x49')],{})[_0xf3f1('0x25')](respondWithResult(_0x21df9b,0xc9))['catch'](handleError(_0x21df9b,null));};exports[_0xf3f1('0x4a')]=function(_0x30b785,_0x10fddc){return db[_0xf3f1('0x2b')][_0xf3f1('0x4a')](_0x30b785[_0xf3f1('0x49')],{'raw':![],'individualHooks':!![]})[_0xf3f1('0x25')](respondWithResult(_0x10fddc,0xc9))[_0xf3f1('0x43')](handleError(_0x10fddc,null));};exports[_0xf3f1('0x24')]=function(_0x177ec5,_0x22c40b){if(_0x177ec5[_0xf3f1('0x49')]['id']){delete _0x177ec5[_0xf3f1('0x49')]['id'];}return db[_0xf3f1('0x2b')][_0xf3f1('0x47')]({'where':{'id':_0x177ec5['params']['id']}})[_0xf3f1('0x25')](handleEntityNotFound(_0x22c40b,null))[_0xf3f1('0x25')](saveUpdates(_0x177ec5[_0xf3f1('0x49')],null))['then'](respondWithResult(_0x22c40b,null))[_0xf3f1('0x43')](handleError(_0x22c40b,null));};exports['destroy']=function(_0x181644,_0x210eeb){return db[_0xf3f1('0x2b')][_0xf3f1('0x47')]({'where':{'id':_0x181644[_0xf3f1('0x4b')]['id']}})[_0xf3f1('0x25')](handleEntityNotFound(_0x210eeb,null))[_0xf3f1('0x25')](removeEntity(_0x210eeb,null))['catch'](handleError(_0x210eeb,null));};exports['bulkDestroy']=function(_0x52f57d,_0x45f390){return db[_0xf3f1('0x2b')]['destroy']({'where':{'id':_0x52f57d[_0xf3f1('0x32')][_0xf3f1('0x4c')]||[]},'raw':![],'individualHooks':!![]})[_0xf3f1('0x25')](respondWithResult(_0x45f390,0xcc))[_0xf3f1('0x43')](handleError(_0x45f390,null));};exports[_0xf3f1('0x4d')]=function(_0x154e52,_0x250db0,_0x29384c){return db['AnalyticCustomReport'][_0xf3f1('0x4e')]({'where':{'id':_0x154e52[_0xf3f1('0x4b')]['id']}})[_0xf3f1('0x25')](handleEntityNotFound(_0x250db0,null))['then'](function(_0x8eae8a){if(_0x8eae8a){return db[_0xf3f1('0x4f')]['transaction'](function(_0x39102e){return db[_0xf3f1('0x2b')][_0xf3f1('0x50')]({'where':{'CustomReportId':_0x154e52[_0xf3f1('0x4b')]['id']},'transaction':_0x39102e})[_0xf3f1('0x25')](function(_0x210757){var _0x4f9c17=_[_0xf3f1('0x2a')](_0x154e52[_0xf3f1('0x49')],function(_0x5077f9){delete _0x5077f9['id'];_0x5077f9[_0xf3f1('0x51')]=_0x154e52[_0xf3f1('0x4b')]['id'];return _0x5077f9;});return db[_0xf3f1('0x2b')][_0xf3f1('0x4a')](_0x4f9c17,{'transaction':_0x39102e});});})[_0xf3f1('0x25')](function(){return db['AnalyticFieldReport'][_0xf3f1('0x41')]({'where':{'CustomReportId':_0x154e52[_0xf3f1('0x4b')]['id']}});});}})[_0xf3f1('0x25')](respondWithResult(_0x250db0,null))['catch'](handleError(_0x250db0,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index b24730a..cc43942 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 _0xca26=['./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','util','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xca26,0x65));var _0x6ca2=function(_0x2a75e3,_0x339c92){_0x2a75e3=_0x2a75e3-0x0;var _0xd396de=_0xca26[_0x2a75e3];return _0xd396de;};'use strict';var _=require(_0x6ca2('0x0'));var util=require(_0x6ca2('0x1'));var logger=require('../../config/logger')(_0x6ca2('0x2'));var moment=require(_0x6ca2('0x3'));var BPromise=require(_0x6ca2('0x4'));var rp=require(_0x6ca2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6ca2('0x6'));var attributes=require(_0x6ca2('0x7'));module[_0x6ca2('0x8')]=function(_0x2c6831,_0x37a935){return _0x2c6831[_0x6ca2('0x9')](_0x6ca2('0xa'),attributes,{'tableName':_0x6ca2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d71=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport'];(function(_0x444563,_0x311d82){var _0x3f5867=function(_0x5b9a65){while(--_0x5b9a65){_0x444563['push'](_0x444563['shift']());}};_0x3f5867(++_0x311d82);}(_0x1d71,0xc6));var _0x11d7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d71[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x11d7('0x0'));var logger=require(_0x11d7('0x1'))(_0x11d7('0x2'));var moment=require(_0x11d7('0x3'));var BPromise=require(_0x11d7('0x4'));var rp=require(_0x11d7('0x5'));var fs=require('fs');var path=require(_0x11d7('0x6'));var rimraf=require(_0x11d7('0x7'));var config=require(_0x11d7('0x8'));var attributes=require(_0x11d7('0x9'));module['exports']=function(_0x3a1c11,_0x379c9b){return _0x3a1c11['define'](_0x11d7('0xa'),attributes,{'tableName':'analytics_report_fields','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 57d9ce9..371df02 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 _0xcaab=['message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3e4c0c,_0x33c473){var _0x4e9b0d=function(_0x4dc6b2){while(--_0x4dc6b2){_0x3e4c0c['push'](_0x3e4c0c['shift']());}};_0x4e9b0d(++_0x33c473);}(_0xcaab,0x1a7));var _0xbcaa=function(_0x30a4d1,_0x31a1f2){_0x30a4d1=_0x30a4d1-0x0;var _0x4cbf87=_0xcaab[_0x30a4d1];return _0x4cbf87;};'use strict';var _=require(_0xbcaa('0x0'));var util=require(_0xbcaa('0x1'));var moment=require(_0xbcaa('0x2'));var BPromise=require(_0xbcaa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbcaa('0x4'))['db'];var utils=require(_0xbcaa('0x5'));var logger=require(_0xbcaa('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbcaa('0x7'));var client=jayson[_0xbcaa('0x8')][_0xbcaa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x539ae9,_0x2815c4,_0x256ecc){return new BPromise(function(_0x31c167,_0x40511c){return client['request'](_0x539ae9,_0x256ecc)['then'](function(_0x2d7c03){logger[_0xbcaa('0xa')](_0xbcaa('0xb'),_0x2815c4,_0xbcaa('0xc'));logger[_0xbcaa('0xd')](_0xbcaa('0xe'),_0x2815c4,'request\x20sent',JSON['stringify'](_0x2d7c03));if(_0x2d7c03[_0xbcaa('0xf')]){if(_0x2d7c03[_0xbcaa('0xf')][_0xbcaa('0x10')]===0x1f4){logger[_0xbcaa('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2815c4,_0x2d7c03[_0xbcaa('0xf')][_0xbcaa('0x11')]);return _0x40511c(_0x2d7c03[_0xbcaa('0xf')]['message']);}logger[_0xbcaa('0xf')](_0xbcaa('0xb'),_0x2815c4,_0x2d7c03[_0xbcaa('0xf')][_0xbcaa('0x11')]);return _0x31c167(_0x2d7c03[_0xbcaa('0xf')][_0xbcaa('0x11')]);}else{logger[_0xbcaa('0xa')](_0xbcaa('0xb'),_0x2815c4,'request\x20sent');_0x31c167(_0x2d7c03[_0xbcaa('0x12')]['message']);}})[_0xbcaa('0x13')](function(_0x2d60e4){logger['error'](_0xbcaa('0xb'),_0x2815c4,_0x2d60e4);_0x40511c(_0x2d60e4);});});} \ No newline at end of file +var _0x6ddd=['info','debug','request\x20sent','stringify','code','error','AnalyticFieldReport,\x20%s,\x20%s','message','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x51a97a,_0xdcd82a){var _0x497189=function(_0x380472){while(--_0x380472){_0x51a97a['push'](_0x51a97a['shift']());}};_0x497189(++_0xdcd82a);}(_0x6ddd,0x1ec));var _0xd6dd=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6ddd[_0x432682];return _0x463d05;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd6dd('0x0'));var BPromise=require(_0xd6dd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd6dd('0x2'));var db=require(_0xd6dd('0x3'))['db'];var utils=require(_0xd6dd('0x4'));var logger=require(_0xd6dd('0x5'))(_0xd6dd('0x6'));var config=require(_0xd6dd('0x7'));var jayson=require(_0xd6dd('0x8'));var client=jayson[_0xd6dd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x498a6c,_0xd09a0f,_0x485fc1){return new BPromise(function(_0x28bf4b,_0xdd7ea2){return client[_0xd6dd('0xa')](_0x498a6c,_0x485fc1)[_0xd6dd('0xb')](function(_0x3cbf83){logger[_0xd6dd('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0xd09a0f,'request\x20sent');logger[_0xd6dd('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0xd09a0f,_0xd6dd('0xe'),JSON[_0xd6dd('0xf')](_0x3cbf83));if(_0x3cbf83['error']){if(_0x3cbf83['error'][_0xd6dd('0x10')]===0x1f4){logger[_0xd6dd('0x11')](_0xd6dd('0x12'),_0xd09a0f,_0x3cbf83['error'][_0xd6dd('0x13')]);return _0xdd7ea2(_0x3cbf83[_0xd6dd('0x11')]['message']);}logger[_0xd6dd('0x11')](_0xd6dd('0x12'),_0xd09a0f,_0x3cbf83[_0xd6dd('0x11')]['message']);return _0x28bf4b(_0x3cbf83['error']['message']);}else{logger[_0xd6dd('0xc')](_0xd6dd('0x12'),_0xd09a0f,_0xd6dd('0xe'));_0x28bf4b(_0x3cbf83['result'][_0xd6dd('0x13')]);}})[_0xd6dd('0x14')](function(_0x5220c1){logger['error'](_0xd6dd('0x12'),_0xd09a0f,_0x5220c1);_0xdd7ea2(_0x5220c1);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 66a7bf6..50b05d7 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 _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x5a2613,_0x10617a){var _0x4cde56=function(_0x168f11){while(--_0x168f11){_0x5a2613['push'](_0x5a2613['shift']());}};_0x4cde56(++_0x10617a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x5882a3,_0x2f1f36){var _0x1ea409=function(_0x56f2c3){while(--_0x56f2c3){_0x5882a3['push'](_0x5882a3['shift']());}};_0x1ea409(++_0x2f1f36);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 044939c..98a1a08 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 _0xb63f=['TEXT','STRING','name'];(function(_0x35e54a,_0x46953a){var _0x35c2b0=function(_0x3c0ab9){while(--_0x3c0ab9){_0x35e54a['push'](_0x35e54a['shift']());}};_0x35c2b0(++_0x46953a);}(_0xb63f,0xa3));var _0xfb63=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xb63f[_0x5f309e];return _0x487b5e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfb63('0x0')],'allowNull':![],'unique':_0xfb63('0x1')},'table':{'type':Sequelize[_0xfb63('0x0')]},'metric':{'type':Sequelize[_0xfb63('0x2')]},'description':{'type':Sequelize[_0xfb63('0x0')]}}; \ No newline at end of file +var _0x5525=['exports','STRING','name','TEXT','sequelize'];(function(_0x11af33,_0x3d0c69){var _0x55e8d9=function(_0xedac13){while(--_0xedac13){_0x11af33['push'](_0x11af33['shift']());}};_0x55e8d9(++_0x3d0c69);}(_0x5525,0xd1));var _0x5552=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x5525[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x5552('0x0'));module[_0x5552('0x1')]={'name':{'type':Sequelize[_0x5552('0x2')],'allowNull':![],'unique':_0x5552('0x3')},'table':{'type':Sequelize[_0x5552('0x2')]},'metric':{'type':Sequelize[_0x5552('0x4')]},'description':{'type':Sequelize[_0x5552('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 56eff14..3f0a143 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 _0x3e74=['status','set','Content-Range','apply','save','update','then','destroy','get','Metrics','sendStatus','stack','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','params','rawAttributes','length','includeAll','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count'];(function(_0x75a9f6,_0x1f27e0){var _0x227845=function(_0x165ca3){while(--_0x165ca3){_0x75a9f6['push'](_0x75a9f6['shift']());}};_0x227845(++_0x1f27e0);}(_0x3e74,0x175));var _0x43e7=function(_0x200a9d,_0x5a86ae){_0x200a9d=_0x200a9d-0x0;var _0x5ecdd9=_0x3e74[_0x200a9d];return _0x5ecdd9;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));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('0x7'));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 as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){var _0x4b2b9f=_0x4c9df3[_0x43e7('0x23')]({'plain':!![]});var _0x4ca5cf=_0x43e7('0x24');return db['UserProfileResource'][_0x43e7('0x22')]({'where':{'type':_0x4ca5cf,'resourceId':_0x4b2b9f['id']}})[_0x43e7('0x21')](function(){return _0x4c9df3;});})[_0x43e7('0x21')](function(){_0x454359[_0x43e7('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x52b7b3,_0x805b54){return function(_0x501551){if(!_0x501551){_0x52b7b3[_0x43e7('0x25')](0x194);}return _0x501551;};}function handleError(_0x40dc8f,_0x3565cf){_0x3565cf=_0x3565cf||0x1f4;return function(_0xb1fc63){logger['error'](_0xb1fc63[_0x43e7('0x26')]);if(_0xb1fc63[_0x43e7('0x27')]){delete _0xb1fc63[_0x43e7('0x27')];}_0x40dc8f[_0x43e7('0x1b')](_0x3565cf)[_0x43e7('0x28')](_0xb1fc63);};}exports[_0x43e7('0x29')]=function(_0x2b85a5,_0x31b2a6){var _0x3bf475={},_0x35dbcd={},_0x17df44={'count':0x0,'rows':[]};var _0x19725a=_[_0x43e7('0x2a')](db[_0x43e7('0x2b')]['rawAttributes'],function(_0x238321){return{'name':_0x238321[_0x43e7('0x2c')],'type':_0x238321[_0x43e7('0x2d')][_0x43e7('0x2e')]};});_0x35dbcd[_0x43e7('0x2f')]=_['map'](_0x19725a,_0x43e7('0x27'));_0x35dbcd[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x2b85a5[_0x43e7('0x30')]);_0x35dbcd['filters']=_['intersection'](_0x35dbcd['model'],_0x35dbcd[_0x43e7('0x30')]);_0x3bf475[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0x35dbcd[_0x43e7('0x2f')],qs[_0x43e7('0x34')](_0x2b85a5[_0x43e7('0x30')]['fields']));_0x3bf475['attributes']=_0x3bf475['attributes']['length']?_0x3bf475['attributes']:_0x35dbcd['model'];if(!_0x2b85a5['query'][_0x43e7('0x35')]('nolimit')){_0x3bf475[_0x43e7('0x18')]=qs[_0x43e7('0x18')](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x18')]);_0x3bf475[_0x43e7('0x19')]=qs[_0x43e7('0x19')](_0x2b85a5[_0x43e7('0x30')]['offset']);}_0x3bf475['order']=qs['sort'](_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x36')]);_0x3bf475[_0x43e7('0x37')]=qs[_0x43e7('0x38')](_[_0x43e7('0x39')](_0x2b85a5[_0x43e7('0x30')],_0x35dbcd[_0x43e7('0x38')]),_0x19725a);if(_0x2b85a5[_0x43e7('0x30')]['filter']){_0x3bf475[_0x43e7('0x37')]=_[_0x43e7('0x3a')](_0x3bf475['where'],{'$or':_[_0x43e7('0x2a')](_0x19725a,function(_0x4c0c7a){if(_0x4c0c7a[_0x43e7('0x2d')]!==_0x43e7('0x3b')){var _0x1c6f45={};_0x1c6f45[_0x4c0c7a[_0x43e7('0x27')]]={'$like':'%'+_0x2b85a5[_0x43e7('0x30')][_0x43e7('0x3c')]+'%'};return _0x1c6f45;}})});}_0x3bf475=_['merge']({},_0x3bf475,_0x2b85a5['options']);var _0x30dfa9={'where':_0x3bf475[_0x43e7('0x37')]};return db[_0x43e7('0x2b')][_0x43e7('0x1a')](_0x30dfa9)[_0x43e7('0x21')](function(_0x4a4a85){_0x17df44[_0x43e7('0x1a')]=_0x4a4a85;if(_0x2b85a5[_0x43e7('0x30')]['includeAll']){_0x3bf475[_0x43e7('0x3d')]=[{'all':!![]}];}return db['AnalyticMetric'][_0x43e7('0x3e')](_0x3bf475);})['then'](function(_0x3d81ae){_0x17df44[_0x43e7('0x3f')]=_0x3d81ae;return _0x17df44;})[_0x43e7('0x21')](respondWithFilteredResult(_0x31b2a6,_0x3bf475))[_0x43e7('0x40')](handleError(_0x31b2a6,null));};exports['show']=function(_0x47d6a1,_0x103393){var _0x40c509={'raw':!![],'where':{'id':_0x47d6a1[_0x43e7('0x41')]['id']}},_0xe979b5={};_0xe979b5['model']=_['keys'](db['AnalyticMetric'][_0x43e7('0x42')]);_0xe979b5['query']=_[_0x43e7('0x31')](_0x47d6a1['query']);_0xe979b5['filters']=_[_0x43e7('0x33')](_0xe979b5['model'],_0xe979b5[_0x43e7('0x30')]);_0x40c509[_0x43e7('0x32')]=_[_0x43e7('0x33')](_0xe979b5[_0x43e7('0x2f')],qs['fields'](_0x47d6a1[_0x43e7('0x30')][_0x43e7('0x34')]));_0x40c509[_0x43e7('0x32')]=_0x40c509[_0x43e7('0x32')][_0x43e7('0x43')]?_0x40c509[_0x43e7('0x32')]:_0xe979b5['model'];if(_0x47d6a1['query'][_0x43e7('0x44')]){_0x40c509[_0x43e7('0x3d')]=[{'all':!![]}];}_0x40c509=_[_0x43e7('0x3a')]({},_0x40c509,_0x47d6a1['options']);return db['AnalyticMetric']['find'](_0x40c509)[_0x43e7('0x21')](handleEntityNotFound(_0x103393,null))[_0x43e7('0x21')](respondWithResult(_0x103393,null))['catch'](handleError(_0x103393,null));};exports[_0x43e7('0x45')]=function(_0x47686e,_0x3c96fe){return db['AnalyticMetric']['create'](_0x47686e['body'],{})['then'](function(_0x214e7e){var _0xe955fc=_0x47686e['user'][_0x43e7('0x23')]({'plain':!![]});if(!_0xe955fc)throw new Error(_0x43e7('0x46'));if(_0xe955fc[_0x43e7('0x47')]===_0x43e7('0x48')){var _0x4a0ce5=_0x214e7e[_0x43e7('0x23')]({'plain':!![]});var _0x483f20='Metrics';return db[_0x43e7('0x49')][_0x43e7('0x4a')]({'where':{'name':_0x483f20,'userProfileId':_0xe955fc[_0x43e7('0x4b')]},'raw':!![]})[_0x43e7('0x21')](function(_0x13503c){if(_0x13503c&&_0x13503c[_0x43e7('0x4c')]===0x0){return db[_0x43e7('0x4d')][_0x43e7('0x45')]({'name':_0x4a0ce5[_0x43e7('0x27')],'resourceId':_0x4a0ce5['id'],'type':_0x13503c[_0x43e7('0x27')],'sectionId':_0x13503c['id']},{})['then'](function(){return _0x214e7e;});}else{return _0x214e7e;}})[_0x43e7('0x40')](function(_0x46c910){logger['error'](_0x43e7('0x4e'),_0x46c910);throw _0x46c910;});}return _0x214e7e;})['then'](respondWithResult(_0x3c96fe,0xc9))[_0x43e7('0x40')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x20')]=function(_0x34e2ec,_0x1f561f){if(_0x34e2ec[_0x43e7('0x4f')]['id']){delete _0x34e2ec['body']['id'];}return db['AnalyticMetric'][_0x43e7('0x4a')]({'where':{'id':_0x34e2ec[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x1f561f,null))[_0x43e7('0x21')](saveUpdates(_0x34e2ec[_0x43e7('0x4f')],null))[_0x43e7('0x21')](respondWithResult(_0x1f561f,null))[_0x43e7('0x40')](handleError(_0x1f561f,null));};exports[_0x43e7('0x22')]=function(_0x26d86c,_0x24e758){return db[_0x43e7('0x2b')]['find']({'where':{'id':_0x26d86c[_0x43e7('0x41')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x24e758,null))['then'](removeEntity(_0x24e758,null))[_0x43e7('0x40')](handleError(_0x24e758,null));}; \ No newline at end of file +var _0x9c5a=['update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','length','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','body','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save'];(function(_0x8dec24,_0x903de0){var _0x381de1=function(_0x1aceb4){while(--_0x1aceb4){_0x8dec24['push'](_0x8dec24['shift']());}};_0x381de1(++_0x903de0);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x4e37ef,_0x118b36){_0x4e37ef=_0x4e37ef-0x0;var _0x2cd882=_0x9c5a[_0x4e37ef];return _0x2cd882;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){var _0x424b4c=_0x11d395[_0xa9c5('0x25')]({'plain':!![]});var _0x32fc7d=_0xa9c5('0x26');return db[_0xa9c5('0x27')][_0xa9c5('0x28')]({'where':{'type':_0x32fc7d,'resourceId':_0x424b4c['id']}})['then'](function(){return _0x11d395;});})['then'](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1762ac,_0x830bad){return function(_0x4caefa){if(!_0x4caefa){_0x1762ac[_0xa9c5('0x17')](0x194);}return _0x4caefa;};}function handleError(_0x320dc0,_0x5f468b){_0x5f468b=_0x5f468b||0x1f4;return function(_0x413edf){logger[_0xa9c5('0x29')](_0x413edf[_0xa9c5('0x2a')]);if(_0x413edf[_0xa9c5('0x2b')]){delete _0x413edf[_0xa9c5('0x2b')];}_0x320dc0['status'](_0x5f468b)[_0xa9c5('0x2c')](_0x413edf);};}exports['index']=function(_0x3c3da7,_0x1ef388){var _0x2eeed1={},_0x541475={},_0xc6d0c1={'count':0x0,'rows':[]};var _0xbe29c5=_['map'](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')],function(_0x431e07){return{'name':_0x431e07[_0xa9c5('0x2f')],'type':_0x431e07[_0xa9c5('0x30')][_0xa9c5('0x31')]};});_0x541475[_0xa9c5('0x32')]=_['map'](_0xbe29c5,_0xa9c5('0x2b'));_0x541475[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0x3c3da7[_0xa9c5('0x33')]);_0x541475[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0x541475[_0xa9c5('0x32')],_0x541475[_0xa9c5('0x33')]);_0x2eeed1['attributes']=_['intersection'](_0x541475[_0xa9c5('0x32')],qs[_0xa9c5('0x37')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x2eeed1[_0xa9c5('0x38')]=_0x2eeed1[_0xa9c5('0x38')]['length']?_0x2eeed1['attributes']:_0x541475['model'];if(!_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x39')]('nolimit')){_0x2eeed1[_0xa9c5('0x1c')]=qs['limit'](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x1c')]);_0x2eeed1[_0xa9c5('0x1e')]=qs[_0xa9c5('0x1e')](_0x3c3da7['query'][_0xa9c5('0x1e')]);}_0x2eeed1[_0xa9c5('0x3a')]=qs[_0xa9c5('0x3b')](_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3b')]);_0x2eeed1[_0xa9c5('0x3c')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x3d')](_0x3c3da7['query'],_0x541475[_0xa9c5('0x35')]),_0xbe29c5);if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]){_0x2eeed1[_0xa9c5('0x3c')]=_[_0xa9c5('0x3f')](_0x2eeed1[_0xa9c5('0x3c')],{'$or':_['map'](_0xbe29c5,function(_0x307736){if(_0x307736['type']!==_0xa9c5('0x40')){var _0x5c89e7={};_0x5c89e7[_0x307736[_0xa9c5('0x2b')]]={'$like':'%'+_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x3e')]+'%'};return _0x5c89e7;}})});}_0x2eeed1=_['merge']({},_0x2eeed1,_0x3c3da7[_0xa9c5('0x41')]);var _0x1ddd72={'where':_0x2eeed1[_0xa9c5('0x3c')]};return db[_0xa9c5('0x2d')]['count'](_0x1ddd72)[_0xa9c5('0x24')](function(_0x97803f){_0xc6d0c1[_0xa9c5('0x1d')]=_0x97803f;if(_0x3c3da7[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x2eeed1['include']=[{'all':!![]}];}return db[_0xa9c5('0x2d')]['findAll'](_0x2eeed1);})[_0xa9c5('0x24')](function(_0x397614){_0xc6d0c1[_0xa9c5('0x43')]=_0x397614;return _0xc6d0c1;})[_0xa9c5('0x24')](respondWithFilteredResult(_0x1ef388,_0x2eeed1))[_0xa9c5('0x44')](handleError(_0x1ef388,null));};exports[_0xa9c5('0x45')]=function(_0xf35cb3,_0x3e8633){var _0x1f895a={'raw':!![],'where':{'id':_0xf35cb3['params']['id']}},_0xc28b1a={};_0xc28b1a[_0xa9c5('0x32')]=_[_0xa9c5('0x34')](db[_0xa9c5('0x2d')][_0xa9c5('0x2e')]);_0xc28b1a[_0xa9c5('0x33')]=_[_0xa9c5('0x34')](_0xf35cb3['query']);_0xc28b1a[_0xa9c5('0x35')]=_[_0xa9c5('0x36')](_0xc28b1a['model'],_0xc28b1a['query']);_0x1f895a['attributes']=_['intersection'](_0xc28b1a['model'],qs[_0xa9c5('0x37')](_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x37')]));_0x1f895a[_0xa9c5('0x38')]=_0x1f895a[_0xa9c5('0x38')][_0xa9c5('0x46')]?_0x1f895a[_0xa9c5('0x38')]:_0xc28b1a[_0xa9c5('0x32')];if(_0xf35cb3[_0xa9c5('0x33')][_0xa9c5('0x42')]){_0x1f895a[_0xa9c5('0x47')]=[{'all':!![]}];}_0x1f895a=_[_0xa9c5('0x3f')]({},_0x1f895a,_0xf35cb3[_0xa9c5('0x41')]);return db['AnalyticMetric'][_0xa9c5('0x48')](_0x1f895a)['then'](handleEntityNotFound(_0x3e8633,null))[_0xa9c5('0x24')](respondWithResult(_0x3e8633,null))[_0xa9c5('0x44')](handleError(_0x3e8633,null));};exports['create']=function(_0x5cbd33,_0xf00970){return db[_0xa9c5('0x2d')][_0xa9c5('0x49')](_0x5cbd33['body'],{})['then'](function(_0x2333c4){var _0xd03cec=_0x5cbd33['user'][_0xa9c5('0x25')]({'plain':!![]});if(!_0xd03cec)throw new Error(_0xa9c5('0x4a'));if(_0xd03cec[_0xa9c5('0x4b')]===_0xa9c5('0x4c')){var _0x34020f=_0x2333c4[_0xa9c5('0x25')]({'plain':!![]});var _0x4b6fc9='Metrics';return db['UserProfileSection'][_0xa9c5('0x48')]({'where':{'name':_0x4b6fc9,'userProfileId':_0xd03cec[_0xa9c5('0x4d')]},'raw':!![]})[_0xa9c5('0x24')](function(_0xef4d2){if(_0xef4d2&&_0xef4d2[_0xa9c5('0x4e')]===0x0){return db[_0xa9c5('0x27')]['create']({'name':_0x34020f[_0xa9c5('0x2b')],'resourceId':_0x34020f['id'],'type':_0xef4d2[_0xa9c5('0x2b')],'sectionId':_0xef4d2['id']},{})[_0xa9c5('0x24')](function(){return _0x2333c4;});}else{return _0x2333c4;}})[_0xa9c5('0x44')](function(_0xa0b458){logger[_0xa9c5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa0b458);throw _0xa0b458;});}return _0x2333c4;})['then'](respondWithResult(_0xf00970,0xc9))[_0xa9c5('0x44')](handleError(_0xf00970,null));};exports['update']=function(_0x1b158f,_0x5ea9b0){if(_0x1b158f[_0xa9c5('0x4f')]['id']){delete _0x1b158f[_0xa9c5('0x4f')]['id'];}return db[_0xa9c5('0x2d')]['find']({'where':{'id':_0x1b158f[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x5ea9b0,null))[_0xa9c5('0x24')](saveUpdates(_0x1b158f[_0xa9c5('0x4f')],null))['then'](respondWithResult(_0x5ea9b0,null))['catch'](handleError(_0x5ea9b0,null));};exports[_0xa9c5('0x28')]=function(_0x2b66ee,_0x3205f2){return db['AnalyticMetric'][_0xa9c5('0x48')]({'where':{'id':_0x2b66ee[_0xa9c5('0x50')]['id']}})[_0xa9c5('0x24')](handleEntityNotFound(_0x3205f2,null))[_0xa9c5('0x24')](removeEntity(_0x3205f2,null))[_0xa9c5('0x44')](handleError(_0x3205f2,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index fc16128..37262e0 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 _0x0f89=['moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0f89,0x111));var _0x90f8=function(_0x2e56bc,_0x1a7e2c){_0x2e56bc=_0x2e56bc-0x0;var _0x1e34b7=_0x0f89[_0x2e56bc];return _0x1e34b7;};'use strict';var _=require(_0x90f8('0x0'));var util=require(_0x90f8('0x1'));var logger=require(_0x90f8('0x2'))('api');var moment=require(_0x90f8('0x3'));var BPromise=require(_0x90f8('0x4'));var rp=require(_0x90f8('0x5'));var fs=require('fs');var path=require(_0x90f8('0x6'));var rimraf=require('rimraf');var config=require(_0x90f8('0x7'));var attributes=require(_0x90f8('0x8'));module['exports']=function(_0x7b8d25,_0x4439a9){return _0x7b8d25[_0x90f8('0x9')](_0x90f8('0xa'),attributes,{'tableName':_0x90f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c5a=['define','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x911cb9,_0x69e3f){var _0x59c239=function(_0x1c918e){while(--_0x1c918e){_0x911cb9['push'](_0x911cb9['shift']());}};_0x59c239(++_0x69e3f);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x351380,_0x44bd1c){_0x351380=_0x351380-0x0;var _0x4e29f2=_0x9c5a[_0x351380];return _0x4e29f2;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var logger=require('../../config/logger')(_0xa9c5('0x2'));var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var rp=require(_0xa9c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require('./analyticMetric.attributes');module[_0xa9c5('0x8')]=function(_0x4d9c7a,_0x394d84){return _0x4d9c7a[_0xa9c5('0x9')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index 4ccdb24..8067aa8 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 _0xaccb=['then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x40fb42,_0x3b15e4){var _0x1901d6=function(_0x5f067a){while(--_0x5f067a){_0x40fb42['push'](_0x40fb42['shift']());}};_0x1901d6(++_0x3b15e4);}(_0xaccb,0xb5));var _0xbacc=function(_0x3bd282,_0x31a0ce){_0x3bd282=_0x3bd282-0x0;var _0x36e2ac=_0xaccb[_0x3bd282];return _0x36e2ac;};'use strict';var _=require('lodash');var util=require(_0xbacc('0x0'));var moment=require(_0xbacc('0x1'));var BPromise=require(_0xbacc('0x2'));var rs=require(_0xbacc('0x3'));var fs=require('fs');var Redis=require(_0xbacc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbacc('0x5'));var logger=require(_0xbacc('0x6'))(_0xbacc('0x7'));var config=require(_0xbacc('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1af07e,_0x29819a,_0x2fe890){return new BPromise(function(_0x50379a,_0x27aa0a){return client['request'](_0x1af07e,_0x2fe890)[_0xbacc('0x9')](function(_0x4deab4){logger[_0xbacc('0xa')](_0xbacc('0xb'),_0x29819a,_0xbacc('0xc'));logger[_0xbacc('0xd')](_0xbacc('0xe'),_0x29819a,_0xbacc('0xc'),JSON['stringify'](_0x4deab4));if(_0x4deab4[_0xbacc('0xf')]){if(_0x4deab4[_0xbacc('0xf')]['code']===0x1f4){logger[_0xbacc('0xf')](_0xbacc('0xb'),_0x29819a,_0x4deab4[_0xbacc('0xf')][_0xbacc('0x10')]);return _0x27aa0a(_0x4deab4[_0xbacc('0xf')][_0xbacc('0x10')]);}logger['error'](_0xbacc('0xb'),_0x29819a,_0x4deab4[_0xbacc('0xf')]['message']);return _0x50379a(_0x4deab4[_0xbacc('0xf')][_0xbacc('0x10')]);}else{logger[_0xbacc('0xa')](_0xbacc('0xb'),_0x29819a,_0xbacc('0xc'));_0x50379a(_0x4deab4[_0xbacc('0x11')][_0xbacc('0x10')]);}})[_0xbacc('0x12')](function(_0x29000d){logger[_0xbacc('0xf')](_0xbacc('0xb'),_0x29819a,_0x29000d);_0x27aa0a(_0x29000d);});});} \ No newline at end of file +var _0x1d8c=['request','then','info','request\x20sent','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticMetric,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x1deee5,_0x1d4485){var _0x1d6c3a=function(_0x433abf){while(--_0x433abf){_0x1deee5['push'](_0x1deee5['shift']());}};_0x1d6c3a(++_0x1d4485);}(_0x1d8c,0x1af));var _0xc1d8=function(_0x3a2f66,_0x16c55a){_0x3a2f66=_0x3a2f66-0x0;var _0x5b8a76=_0x1d8c[_0x3a2f66];return _0x5b8a76;};'use strict';var _=require(_0xc1d8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc1d8('0x1'));var rs=require(_0xc1d8('0x2'));var fs=require('fs');var Redis=require(_0xc1d8('0x3'));var db=require(_0xc1d8('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc1d8('0x5'));var config=require(_0xc1d8('0x6'));var jayson=require(_0xc1d8('0x7'));var client=jayson[_0xc1d8('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x149196,_0x2621d7,_0x2c739f){return new BPromise(function(_0x260ee2,_0x14daa7){return client[_0xc1d8('0x9')](_0x149196,_0x2c739f)[_0xc1d8('0xa')](function(_0x421544){logger[_0xc1d8('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x2621d7,_0xc1d8('0xc'));logger['debug'](_0xc1d8('0xd'),_0x2621d7,_0xc1d8('0xc'),JSON[_0xc1d8('0xe')](_0x421544));if(_0x421544[_0xc1d8('0xf')]){if(_0x421544[_0xc1d8('0xf')][_0xc1d8('0x10')]===0x1f4){logger[_0xc1d8('0xf')](_0xc1d8('0x11'),_0x2621d7,_0x421544[_0xc1d8('0xf')]['message']);return _0x14daa7(_0x421544[_0xc1d8('0xf')][_0xc1d8('0x12')]);}logger['error'](_0xc1d8('0x11'),_0x2621d7,_0x421544[_0xc1d8('0xf')]['message']);return _0x260ee2(_0x421544[_0xc1d8('0xf')][_0xc1d8('0x12')]);}else{logger[_0xc1d8('0xb')]('AnalyticMetric,\x20%s,\x20%s',_0x2621d7,_0xc1d8('0xc'));_0x260ee2(_0x421544['result']['message']);}})[_0xc1d8('0x13')](function(_0x5ff1a2){logger[_0xc1d8('0xf')](_0xc1d8('0x11'),_0x2621d7,_0x5ff1a2);_0x14daa7(_0x5ff1a2);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index b9d316f..e2fe15b 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 _0x3e9d=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','show','post','create'];(function(_0x3c4f1f,_0x20d3ec){var _0x19cb69=function(_0x2e04bc){while(--_0x2e04bc){_0x3c4f1f['push'](_0x3c4f1f['shift']());}};_0x19cb69(++_0x20d3ec);}(_0x3e9d,0x1ba));var _0xd3e9=function(_0x2fa465,_0x188c11){_0x2fa465=_0x2fa465-0x0;var _0x4fc9f9=_0x3e9d[_0x2fa465];return _0x4fc9f9;};'use strict';var multer=require(_0xd3e9('0x0'));var util=require(_0xd3e9('0x1'));var path=require('path');var timeout=require(_0xd3e9('0x2'));var express=require(_0xd3e9('0x3'));var router=express[_0xd3e9('0x4')]();var fs_extra=require(_0xd3e9('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd3e9('0x6'));var controller=require(_0xd3e9('0x7'));router[_0xd3e9('0x8')]('/',auth[_0xd3e9('0x9')](),controller['index']);router['get'](_0xd3e9('0xa'),auth[_0xd3e9('0x9')](),controller[_0xd3e9('0xb')]);router[_0xd3e9('0xc')]('/',auth[_0xd3e9('0x9')](),controller[_0xd3e9('0xd')]);router[_0xd3e9('0xe')]('/:id',auth[_0xd3e9('0x9')](),controller[_0xd3e9('0xf')]);router[_0xd3e9('0x10')](_0xd3e9('0xa'),auth[_0xd3e9('0x9')](),controller[_0xd3e9('0x11')]);module[_0xd3e9('0x12')]=router; \ No newline at end of file +var _0xcddb=['post','put','delete','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','get','/:id','show'];(function(_0x3cef3b,_0xf2c24f){var _0x35b6bb=function(_0x1d5175){while(--_0x1d5175){_0x3cef3b['push'](_0x3cef3b['shift']());}};_0x35b6bb(++_0xf2c24f);}(_0xcddb,0x1c4));var _0xbcdd=function(_0x305734,_0x106e4e){_0x305734=_0x305734-0x0;var _0x131b90=_0xcddb[_0x305734];return _0x131b90;};'use strict';var multer=require(_0xbcdd('0x0'));var util=require(_0xbcdd('0x1'));var path=require(_0xbcdd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbcdd('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbcdd('0x4'));var interaction=require(_0xbcdd('0x5'));var config=require(_0xbcdd('0x6'));var controller=require(_0xbcdd('0x7'));router['get']('/',auth[_0xbcdd('0x8')](),controller['index']);router[_0xbcdd('0x9')](_0xbcdd('0xa'),auth['isAuthenticated'](),controller[_0xbcdd('0xb')]);router[_0xbcdd('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xbcdd('0xd')](_0xbcdd('0xa'),auth[_0xbcdd('0x8')](),controller['update']);router[_0xbcdd('0xe')](_0xbcdd('0xa'),auth[_0xbcdd('0x8')](),controller[_0xbcdd('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 2dc3b35..ac30666 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 _0xf69c=['TEXT','exports'];(function(_0x13ee16,_0x9b0374){var _0x48a844=function(_0x10bc0e){while(--_0x10bc0e){_0x13ee16['push'](_0x13ee16['shift']());}};_0x48a844(++_0x9b0374);}(_0xf69c,0xaf));var _0xcf69=function(_0x5b13c3,_0x378e0a){_0x5b13c3=_0x5b13c3-0x0;var _0x3d6780=_0xf69c[_0x5b13c3];return _0x3d6780;};'use strict';var Sequelize=require('sequelize');module[_0xcf69('0x0')]={'tree':{'type':Sequelize[_0xcf69('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x35fe=['exports','TEXT','sequelize'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x35fe,0x158));var _0xe35f=function(_0xf0bc07,_0x510ebf){_0xf0bc07=_0xf0bc07-0x0;var _0x1c50c2=_0x35fe[_0xf0bc07];return _0x1c50c2;};'use strict';var Sequelize=require(_0xe35f('0x0'));module[_0xe35f('0x1')]={'tree':{'type':Sequelize[_0xe35f('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index eb9ea27..60abff2 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 _0xcb5f=['apply','reject','save','update','then','destroy','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','order','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','json'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xcb5f,0x110));var _0xfcb5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcb5f[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xfcb5('0x0'));var rimraf=require(_0xfcb5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xfcb5('0x2'));var moment=require(_0xfcb5('0x3'));var BPromise=require(_0xfcb5('0x4'));var Mustache=require('mustache');var util=require(_0xfcb5('0x5'));var path=require(_0xfcb5('0x6'));var sox=require(_0xfcb5('0x7'));var csv=require(_0xfcb5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfcb5('0x9'));var _=require(_0xfcb5('0xa'));var squel=require(_0xfcb5('0xb'));var crypto=require(_0xfcb5('0xc'));var jsforce=require(_0xfcb5('0xd'));var deskjs=require(_0xfcb5('0xe'));var toCsv=require(_0xfcb5('0x8'));var querystring=require(_0xfcb5('0xf'));var Papa=require(_0xfcb5('0x10'));var Redis=require(_0xfcb5('0x11'));var authService=require(_0xfcb5('0x12'));var qs=require(_0xfcb5('0x13'));var as=require(_0xfcb5('0x14'));var hardwareService=require(_0xfcb5('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xfcb5('0x16'));var config=require(_0xfcb5('0x17'));var licenseUtil=require(_0xfcb5('0x18'));var db=require(_0xfcb5('0x19'))['db'];function respondWithStatusCode(_0x12bfaa,_0x14fcef){_0x14fcef=_0x14fcef||0xcc;return function(_0x56512c){if(_0x56512c){return _0x12bfaa[_0xfcb5('0x1a')](_0x14fcef);}return _0x12bfaa[_0xfcb5('0x1b')](_0x14fcef)[_0xfcb5('0x1c')]();};}function respondWithResult(_0x3bb582,_0x4eb92f){_0x4eb92f=_0x4eb92f||0xc8;return function(_0x19eafd){if(_0x19eafd){return _0x3bb582[_0xfcb5('0x1b')](_0x4eb92f)['json'](_0x19eafd);}};}function respondWithFilteredResult(_0x321853,_0x5cf6d5){return function(_0x4facf2){if(_0x4facf2){var _0x4030f9=typeof _0x5cf6d5['offset']==='undefined'&&typeof _0x5cf6d5[_0xfcb5('0x1d')]===_0xfcb5('0x1e');var _0x104f6b=_0x4facf2[_0xfcb5('0x1f')];var _0x2780f7=_0x4030f9?0x0:_0x5cf6d5['offset'];var _0x3fef68=_0x4030f9?_0x4facf2[_0xfcb5('0x1f')]:_0x5cf6d5[_0xfcb5('0x20')]+_0x5cf6d5['limit'];var _0x34a56a;if(_0x3fef68>=_0x104f6b){_0x3fef68=_0x104f6b;_0x34a56a=0xc8;}else{_0x34a56a=0xce;}_0x321853[_0xfcb5('0x1b')](_0x34a56a);return _0x321853[_0xfcb5('0x21')](_0xfcb5('0x22'),_0x2780f7+'-'+_0x3fef68+'/'+_0x104f6b)[_0xfcb5('0x23')](_0x4facf2);}return null;};}function patchUpdates(_0xadb24b){return function(_0x933ab7){try{jsonpatch[_0xfcb5('0x24')](_0x933ab7,_0xadb24b,!![]);}catch(_0x3176ba){return BPromise[_0xfcb5('0x25')](_0x3176ba);}return _0x933ab7[_0xfcb5('0x26')]();};}function saveUpdates(_0x2fcbb5,_0x438aaf){return function(_0x216795){if(_0x216795){return _0x216795[_0xfcb5('0x27')](_0x2fcbb5)[_0xfcb5('0x28')](function(_0x221045){return _0x221045;});}return null;};}function removeEntity(_0x302dce,_0x5349ca){return function(_0x3cde3f){if(_0x3cde3f){return _0x3cde3f[_0xfcb5('0x29')]()['then'](function(){_0x302dce['status'](0xcc)[_0xfcb5('0x1c')]();});}};}function handleEntityNotFound(_0x36f1d3,_0x2cc2e6){return function(_0x5a2a64){if(!_0x5a2a64){_0x36f1d3[_0xfcb5('0x1a')](0x194);}return _0x5a2a64;};}function handleError(_0x512b6e,_0x17968f){_0x17968f=_0x17968f||0x1f4;return function(_0x3bc7b9){logger[_0xfcb5('0x2a')](_0x3bc7b9[_0xfcb5('0x2b')]);if(_0x3bc7b9['name']){delete _0x3bc7b9[_0xfcb5('0x2c')];}_0x512b6e[_0xfcb5('0x1b')](_0x17968f)[_0xfcb5('0x2d')](_0x3bc7b9);};}exports[_0xfcb5('0x2e')]=function(_0x4f5762,_0x23b949){var _0x55040b={},_0x410d24={},_0xb971e6={'count':0x0,'rows':[]};var _0x1eff0b=_[_0xfcb5('0x2f')](db[_0xfcb5('0x30')][_0xfcb5('0x31')],function(_0x52200a){return{'name':_0x52200a[_0xfcb5('0x32')],'type':_0x52200a[_0xfcb5('0x33')][_0xfcb5('0x34')]};});_0x410d24[_0xfcb5('0x35')]=_['map'](_0x1eff0b,_0xfcb5('0x2c'));_0x410d24[_0xfcb5('0x36')]=_[_0xfcb5('0x37')](_0x4f5762[_0xfcb5('0x36')]);_0x410d24[_0xfcb5('0x38')]=_[_0xfcb5('0x39')](_0x410d24[_0xfcb5('0x35')],_0x410d24[_0xfcb5('0x36')]);_0x55040b[_0xfcb5('0x3a')]=_[_0xfcb5('0x39')](_0x410d24[_0xfcb5('0x35')],qs[_0xfcb5('0x3b')](_0x4f5762[_0xfcb5('0x36')][_0xfcb5('0x3b')]));_0x55040b[_0xfcb5('0x3a')]=_0x55040b[_0xfcb5('0x3a')]['length']?_0x55040b['attributes']:_0x410d24[_0xfcb5('0x35')];if(!_0x4f5762['query']['hasOwnProperty']('nolimit')){_0x55040b['limit']=qs[_0xfcb5('0x1d')](_0x4f5762[_0xfcb5('0x36')][_0xfcb5('0x1d')]);_0x55040b[_0xfcb5('0x20')]=qs[_0xfcb5('0x20')](_0x4f5762[_0xfcb5('0x36')][_0xfcb5('0x20')]);}_0x55040b[_0xfcb5('0x3c')]=qs['sort'](_0x4f5762[_0xfcb5('0x36')]['sort']);_0x55040b[_0xfcb5('0x3d')]=qs['filters'](_[_0xfcb5('0x3e')](_0x4f5762[_0xfcb5('0x36')],_0x410d24[_0xfcb5('0x38')]),_0x1eff0b);if(_0x4f5762[_0xfcb5('0x36')][_0xfcb5('0x3f')]){_0x55040b[_0xfcb5('0x3d')]=_[_0xfcb5('0x40')](_0x55040b[_0xfcb5('0x3d')],{'$or':_[_0xfcb5('0x2f')](_0x1eff0b,function(_0x18c266){if(_0x18c266[_0xfcb5('0x33')]!=='VIRTUAL'){var _0x462b45={};_0x462b45[_0x18c266[_0xfcb5('0x2c')]]={'$like':'%'+_0x4f5762[_0xfcb5('0x36')][_0xfcb5('0x3f')]+'%'};return _0x462b45;}})});}_0x55040b=_[_0xfcb5('0x40')]({},_0x55040b,_0x4f5762['options']);var _0x20c260={'where':_0x55040b[_0xfcb5('0x3d')]};return db[_0xfcb5('0x30')][_0xfcb5('0x1f')](_0x20c260)['then'](function(_0x525c73){_0xb971e6[_0xfcb5('0x1f')]=_0x525c73;if(_0x4f5762['query'][_0xfcb5('0x41')]){_0x55040b[_0xfcb5('0x42')]=[{'all':!![]}];}return db[_0xfcb5('0x30')][_0xfcb5('0x43')](_0x55040b);})[_0xfcb5('0x28')](function(_0x39094c){_0xb971e6[_0xfcb5('0x44')]=_0x39094c;return _0xb971e6;})[_0xfcb5('0x28')](respondWithFilteredResult(_0x23b949,_0x55040b))[_0xfcb5('0x45')](handleError(_0x23b949,null));};exports[_0xfcb5('0x46')]=function(_0x1e0113,_0x5c2fc4){var _0x1bc309={'raw':!![],'where':{'id':_0x1e0113[_0xfcb5('0x47')]['id']}},_0x3e747e={};_0x3e747e['model']=_[_0xfcb5('0x37')](db['AnalyticTreeReport']['rawAttributes']);_0x3e747e[_0xfcb5('0x36')]=_[_0xfcb5('0x37')](_0x1e0113[_0xfcb5('0x36')]);_0x3e747e['filters']=_[_0xfcb5('0x39')](_0x3e747e[_0xfcb5('0x35')],_0x3e747e['query']);_0x1bc309[_0xfcb5('0x3a')]=_['intersection'](_0x3e747e['model'],qs[_0xfcb5('0x3b')](_0x1e0113['query']['fields']));_0x1bc309[_0xfcb5('0x3a')]=_0x1bc309[_0xfcb5('0x3a')][_0xfcb5('0x48')]?_0x1bc309['attributes']:_0x3e747e[_0xfcb5('0x35')];if(_0x1e0113[_0xfcb5('0x36')]['includeAll']){_0x1bc309[_0xfcb5('0x42')]=[{'all':!![]}];}_0x1bc309=_['merge']({},_0x1bc309,_0x1e0113[_0xfcb5('0x49')]);return db['AnalyticTreeReport'][_0xfcb5('0x4a')](_0x1bc309)['then'](handleEntityNotFound(_0x5c2fc4,null))[_0xfcb5('0x28')](respondWithResult(_0x5c2fc4,null))['catch'](handleError(_0x5c2fc4,null));};exports['create']=function(_0x1f1e23,_0x57ca6a){return db[_0xfcb5('0x30')][_0xfcb5('0x4b')](_0x1f1e23['body'],{})['then'](respondWithResult(_0x57ca6a,0xc9))['catch'](handleError(_0x57ca6a,null));};exports[_0xfcb5('0x27')]=function(_0x239d60,_0x4d7eae){if(_0x239d60[_0xfcb5('0x4c')]['id']){delete _0x239d60[_0xfcb5('0x4c')]['id'];}return db['AnalyticTreeReport'][_0xfcb5('0x4a')]({'where':{'id':_0x239d60[_0xfcb5('0x47')]['id']}})[_0xfcb5('0x28')](handleEntityNotFound(_0x4d7eae,null))['then'](saveUpdates(_0x239d60[_0xfcb5('0x4c')],null))[_0xfcb5('0x28')](respondWithResult(_0x4d7eae,null))['catch'](handleError(_0x4d7eae,null));};exports[_0xfcb5('0x29')]=function(_0x137e59,_0x559caf){return db['AnalyticTreeReport'][_0xfcb5('0x4a')]({'where':{'id':_0x137e59['params']['id']}})[_0xfcb5('0x28')](handleEntityNotFound(_0x559caf,null))[_0xfcb5('0x28')](removeEntity(_0x559caf,null))[_0xfcb5('0x45')](handleError(_0x559caf,null));}; \ No newline at end of file +var _0x66c2=['type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','stack','name','index','AnalyticTreeReport','rawAttributes','fieldName'];(function(_0x105abe,_0x55545c){var _0xc77aa4=function(_0x5c80e0){while(--_0x5c80e0){_0x105abe['push'](_0x105abe['shift']());}};_0xc77aa4(++_0x55545c);}(_0x66c2,0xfe));var _0x266c=function(_0x5e238d,_0x39ff2d){_0x5e238d=_0x5e238d-0x0;var _0x371d83=_0x66c2[_0x5e238d];return _0x371d83;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x266c('0x0'));var zipdir=require(_0x266c('0x1'));var jsonpatch=require(_0x266c('0x2'));var rp=require(_0x266c('0x3'));var moment=require(_0x266c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x266c('0x5'));var util=require(_0x266c('0x6'));var path=require('path');var sox=require(_0x266c('0x7'));var csv=require(_0x266c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x266c('0x9'));var squel=require(_0x266c('0xa'));var crypto=require(_0x266c('0xb'));var jsforce=require(_0x266c('0xc'));var deskjs=require(_0x266c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x266c('0xe'));var Papa=require(_0x266c('0xf'));var Redis=require(_0x266c('0x10'));var authService=require(_0x266c('0x11'));var qs=require(_0x266c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x266c('0x13'))(_0x266c('0x14'));var utils=require(_0x266c('0x15'));var config=require(_0x266c('0x16'));var licenseUtil=require(_0x266c('0x17'));var db=require(_0x266c('0x18'))['db'];function respondWithStatusCode(_0x280625,_0x443203){_0x443203=_0x443203||0xcc;return function(_0x213321){if(_0x213321){return _0x280625[_0x266c('0x19')](_0x443203);}return _0x280625[_0x266c('0x1a')](_0x443203)[_0x266c('0x1b')]();};}function respondWithResult(_0x2f927d,_0x813c93){_0x813c93=_0x813c93||0xc8;return function(_0x4f1999){if(_0x4f1999){return _0x2f927d['status'](_0x813c93)['json'](_0x4f1999);}};}function respondWithFilteredResult(_0xbe7b26,_0x242d40){return function(_0x18bb02){if(_0x18bb02){var _0x4a688c=typeof _0x242d40[_0x266c('0x1c')]==='undefined'&&typeof _0x242d40['limit']===_0x266c('0x1d');var _0x5dec3c=_0x18bb02[_0x266c('0x1e')];var _0x24900d=_0x4a688c?0x0:_0x242d40[_0x266c('0x1c')];var _0x54af08=_0x4a688c?_0x18bb02[_0x266c('0x1e')]:_0x242d40[_0x266c('0x1c')]+_0x242d40[_0x266c('0x1f')];var _0x3e8569;if(_0x54af08>=_0x5dec3c){_0x54af08=_0x5dec3c;_0x3e8569=0xc8;}else{_0x3e8569=0xce;}_0xbe7b26['status'](_0x3e8569);return _0xbe7b26[_0x266c('0x20')](_0x266c('0x21'),_0x24900d+'-'+_0x54af08+'/'+_0x5dec3c)[_0x266c('0x22')](_0x18bb02);}return null;};}function patchUpdates(_0x2db091){return function(_0x44600b){try{jsonpatch[_0x266c('0x23')](_0x44600b,_0x2db091,!![]);}catch(_0x4c9058){return BPromise['reject'](_0x4c9058);}return _0x44600b[_0x266c('0x24')]();};}function saveUpdates(_0x7a3071,_0x4e9a1a){return function(_0x407da5){if(_0x407da5){return _0x407da5[_0x266c('0x25')](_0x7a3071)[_0x266c('0x26')](function(_0x3f9b79){return _0x3f9b79;});}return null;};}function removeEntity(_0x3175b8,_0x5419d0){return function(_0x27b645){if(_0x27b645){return _0x27b645[_0x266c('0x27')]()[_0x266c('0x26')](function(){_0x3175b8[_0x266c('0x1a')](0xcc)[_0x266c('0x1b')]();});}};}function handleEntityNotFound(_0xc53783,_0x1352ca){return function(_0xbcf8c9){if(!_0xbcf8c9){_0xc53783[_0x266c('0x19')](0x194);}return _0xbcf8c9;};}function handleError(_0x2cf20c,_0x4c447a){_0x4c447a=_0x4c447a||0x1f4;return function(_0x151ea1){logger['error'](_0x151ea1[_0x266c('0x28')]);if(_0x151ea1['name']){delete _0x151ea1[_0x266c('0x29')];}_0x2cf20c[_0x266c('0x1a')](_0x4c447a)['send'](_0x151ea1);};}exports[_0x266c('0x2a')]=function(_0x7816eb,_0x3e930c){var _0x1eec4c={},_0x5d69f1={},_0x248962={'count':0x0,'rows':[]};var _0x2e3ba7=_['map'](db[_0x266c('0x2b')][_0x266c('0x2c')],function(_0x4191a3){return{'name':_0x4191a3[_0x266c('0x2d')],'type':_0x4191a3[_0x266c('0x2e')][_0x266c('0x2f')]};});_0x5d69f1[_0x266c('0x30')]=_[_0x266c('0x31')](_0x2e3ba7,_0x266c('0x29'));_0x5d69f1[_0x266c('0x32')]=_[_0x266c('0x33')](_0x7816eb[_0x266c('0x32')]);_0x5d69f1['filters']=_[_0x266c('0x34')](_0x5d69f1[_0x266c('0x30')],_0x5d69f1['query']);_0x1eec4c[_0x266c('0x35')]=_[_0x266c('0x34')](_0x5d69f1[_0x266c('0x30')],qs[_0x266c('0x36')](_0x7816eb[_0x266c('0x32')][_0x266c('0x36')]));_0x1eec4c['attributes']=_0x1eec4c[_0x266c('0x35')][_0x266c('0x37')]?_0x1eec4c[_0x266c('0x35')]:_0x5d69f1[_0x266c('0x30')];if(!_0x7816eb[_0x266c('0x32')]['hasOwnProperty'](_0x266c('0x38'))){_0x1eec4c[_0x266c('0x1f')]=qs[_0x266c('0x1f')](_0x7816eb[_0x266c('0x32')][_0x266c('0x1f')]);_0x1eec4c[_0x266c('0x1c')]=qs[_0x266c('0x1c')](_0x7816eb[_0x266c('0x32')]['offset']);}_0x1eec4c['order']=qs[_0x266c('0x39')](_0x7816eb[_0x266c('0x32')]['sort']);_0x1eec4c[_0x266c('0x3a')]=qs[_0x266c('0x3b')](_[_0x266c('0x3c')](_0x7816eb[_0x266c('0x32')],_0x5d69f1[_0x266c('0x3b')]),_0x2e3ba7);if(_0x7816eb[_0x266c('0x32')][_0x266c('0x3d')]){_0x1eec4c[_0x266c('0x3a')]=_[_0x266c('0x3e')](_0x1eec4c[_0x266c('0x3a')],{'$or':_[_0x266c('0x31')](_0x2e3ba7,function(_0x1cd94a){if(_0x1cd94a['type']!==_0x266c('0x3f')){var _0x3e7fcf={};_0x3e7fcf[_0x1cd94a[_0x266c('0x29')]]={'$like':'%'+_0x7816eb[_0x266c('0x32')][_0x266c('0x3d')]+'%'};return _0x3e7fcf;}})});}_0x1eec4c=_['merge']({},_0x1eec4c,_0x7816eb[_0x266c('0x40')]);var _0x334803={'where':_0x1eec4c[_0x266c('0x3a')]};return db[_0x266c('0x2b')][_0x266c('0x1e')](_0x334803)[_0x266c('0x26')](function(_0x3473c2){_0x248962[_0x266c('0x1e')]=_0x3473c2;if(_0x7816eb[_0x266c('0x32')]['includeAll']){_0x1eec4c[_0x266c('0x41')]=[{'all':!![]}];}return db[_0x266c('0x2b')][_0x266c('0x42')](_0x1eec4c);})[_0x266c('0x26')](function(_0x104a5b){_0x248962[_0x266c('0x43')]=_0x104a5b;return _0x248962;})[_0x266c('0x26')](respondWithFilteredResult(_0x3e930c,_0x1eec4c))[_0x266c('0x44')](handleError(_0x3e930c,null));};exports[_0x266c('0x45')]=function(_0x98218c,_0xb70874){var _0x480db0={'raw':!![],'where':{'id':_0x98218c[_0x266c('0x46')]['id']}},_0x5c57e5={};_0x5c57e5[_0x266c('0x30')]=_['keys'](db[_0x266c('0x2b')]['rawAttributes']);_0x5c57e5['query']=_['keys'](_0x98218c[_0x266c('0x32')]);_0x5c57e5[_0x266c('0x3b')]=_[_0x266c('0x34')](_0x5c57e5[_0x266c('0x30')],_0x5c57e5[_0x266c('0x32')]);_0x480db0[_0x266c('0x35')]=_[_0x266c('0x34')](_0x5c57e5[_0x266c('0x30')],qs[_0x266c('0x36')](_0x98218c[_0x266c('0x32')][_0x266c('0x36')]));_0x480db0[_0x266c('0x35')]=_0x480db0['attributes'][_0x266c('0x37')]?_0x480db0[_0x266c('0x35')]:_0x5c57e5[_0x266c('0x30')];if(_0x98218c[_0x266c('0x32')][_0x266c('0x47')]){_0x480db0[_0x266c('0x41')]=[{'all':!![]}];}_0x480db0=_[_0x266c('0x3e')]({},_0x480db0,_0x98218c[_0x266c('0x40')]);return db[_0x266c('0x2b')][_0x266c('0x48')](_0x480db0)[_0x266c('0x26')](handleEntityNotFound(_0xb70874,null))[_0x266c('0x26')](respondWithResult(_0xb70874,null))[_0x266c('0x44')](handleError(_0xb70874,null));};exports[_0x266c('0x49')]=function(_0x48fd56,_0x51259a){return db[_0x266c('0x2b')][_0x266c('0x49')](_0x48fd56[_0x266c('0x4a')],{})['then'](respondWithResult(_0x51259a,0xc9))['catch'](handleError(_0x51259a,null));};exports[_0x266c('0x25')]=function(_0x38fee5,_0x31a2ca){if(_0x38fee5[_0x266c('0x4a')]['id']){delete _0x38fee5[_0x266c('0x4a')]['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x38fee5['params']['id']}})[_0x266c('0x26')](handleEntityNotFound(_0x31a2ca,null))['then'](saveUpdates(_0x38fee5[_0x266c('0x4a')],null))[_0x266c('0x26')](respondWithResult(_0x31a2ca,null))[_0x266c('0x44')](handleError(_0x31a2ca,null));};exports[_0x266c('0x27')]=function(_0x4ee5c6,_0x4e09fd){return db[_0x266c('0x2b')][_0x266c('0x48')]({'where':{'id':_0x4ee5c6[_0x266c('0x46')]['id']}})[_0x266c('0x26')](handleEntityNotFound(_0x4e09fd,null))[_0x266c('0x26')](removeEntity(_0x4e09fd,null))[_0x266c('0x44')](handleError(_0x4e09fd,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index b9fa528..fbea1b3 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 _0x7188=['util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash'];(function(_0x3edc8b,_0x1996cb){var _0xbf74e5=function(_0x2fcc27){while(--_0x2fcc27){_0x3edc8b['push'](_0x3edc8b['shift']());}};_0xbf74e5(++_0x1996cb);}(_0x7188,0xef));var _0x8718=function(_0x2cce70,_0x417165){_0x2cce70=_0x2cce70-0x0;var _0x798d77=_0x7188[_0x2cce70];return _0x798d77;};'use strict';var _=require(_0x8718('0x0'));var util=require(_0x8718('0x1'));var logger=require(_0x8718('0x2'))('api');var moment=require(_0x8718('0x3'));var BPromise=require('bluebird');var rp=require(_0x8718('0x4'));var fs=require('fs');var path=require(_0x8718('0x5'));var rimraf=require(_0x8718('0x6'));var config=require(_0x8718('0x7'));var attributes=require(_0x8718('0x8'));module[_0x8718('0x9')]=function(_0x12233b,_0x4b9a91){return _0x12233b[_0x8718('0xa')](_0x8718('0xb'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe685=['exports','define','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x8d3032,_0x38cac2){var _0x237394=function(_0xc821b3){while(--_0xc821b3){_0x8d3032['push'](_0x8d3032['shift']());}};_0x237394(++_0x38cac2);}(_0xe685,0x1b2));var _0x5e68=function(_0x394ecd,_0x1f65dc){_0x394ecd=_0x394ecd-0x0;var _0x173e46=_0xe685[_0x394ecd];return _0x173e46;};'use strict';var _=require(_0x5e68('0x0'));var util=require(_0x5e68('0x1'));var logger=require(_0x5e68('0x2'))(_0x5e68('0x3'));var moment=require(_0x5e68('0x4'));var BPromise=require('bluebird');var rp=require(_0x5e68('0x5'));var fs=require('fs');var path=require(_0x5e68('0x6'));var rimraf=require(_0x5e68('0x7'));var config=require(_0x5e68('0x8'));var attributes=require(_0x5e68('0x9'));module[_0x5e68('0xa')]=function(_0xa5ff2,_0x5c68de){return _0xa5ff2[_0x5e68('0xb')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index 721b99e..da583b6 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x59881a,_0x5ef668){var _0x33a221=function(_0x396188){while(--_0x396188){_0x59881a['push'](_0x59881a['shift']());}};_0x33a221(++_0x5ef668);}(_0xadb5,0xad));var _0x5adb=function(_0x2ab64b,_0x4ae122){_0x2ab64b=_0x2ab64b-0x0;var _0x1765fd=_0xadb5[_0x2ab64b];return _0x1765fd;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0xdd188d,_0x3ee3d0){var _0x4081d8=function(_0x33ee77){while(--_0x33ee77){_0xdd188d['push'](_0xdd188d['shift']());}};_0x4081d8(++_0x3ee3d0);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x5f66[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 49fa467..b3e69fa 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 _0x9888=['index','/:id','show','post','create','put','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x9888,0x1bd));var _0x8988=function(_0xfe01b3,_0x1bbed1){_0xfe01b3=_0xfe01b3-0x0;var _0x4b95d4=_0x9888[_0xfe01b3];return _0x4b95d4;};'use strict';var multer=require(_0x8988('0x0'));var util=require(_0x8988('0x1'));var path=require(_0x8988('0x2'));var timeout=require(_0x8988('0x3'));var express=require('express');var router=express[_0x8988('0x4')]();var fs_extra=require(_0x8988('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8988('0x6'));var config=require(_0x8988('0x7'));var controller=require(_0x8988('0x8'));router[_0x8988('0x9')]('/',auth[_0x8988('0xa')](),controller[_0x8988('0xb')]);router[_0x8988('0x9')](_0x8988('0xc'),auth[_0x8988('0xa')](),controller[_0x8988('0xd')]);router[_0x8988('0xe')]('/',auth[_0x8988('0xa')](),controller[_0x8988('0xf')]);router[_0x8988('0x10')](_0x8988('0xc'),auth[_0x8988('0xa')](),controller['update']);router[_0x8988('0x11')](_0x8988('0xc'),auth[_0x8988('0xa')](),controller['destroy']);module[_0x8988('0x12')]=router; \ No newline at end of file +var _0xe20a=['update','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','index','/:id','isAuthenticated','show','post','put'];(function(_0x403007,_0xd4d4d8){var _0x5354a8=function(_0xf1a73e){while(--_0xf1a73e){_0x403007['push'](_0x403007['shift']());}};_0x5354a8(++_0xd4d4d8);}(_0xe20a,0x1ac));var _0xae20=function(_0x50247c,_0x1b2c43){_0x50247c=_0x50247c-0x0;var _0x17b2c5=_0xe20a[_0x50247c];return _0x17b2c5;};'use strict';var multer=require('multer');var util=require(_0xae20('0x0'));var path=require('path');var timeout=require(_0xae20('0x1'));var express=require('express');var router=express[_0xae20('0x2')]();var fs_extra=require(_0xae20('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xae20('0x4'));var config=require(_0xae20('0x5'));var controller=require(_0xae20('0x6'));router[_0xae20('0x7')]('/',auth['isAuthenticated'](),controller[_0xae20('0x8')]);router[_0xae20('0x7')](_0xae20('0x9'),auth[_0xae20('0xa')](),controller[_0xae20('0xb')]);router[_0xae20('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xae20('0xd')](_0xae20('0x9'),auth['isAuthenticated'](),controller[_0xae20('0xe')]);router['delete'](_0xae20('0x9'),auth[_0xae20('0xa')](),controller[_0xae20('0xf')]);module[_0xae20('0x10')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 761fdc9..c6d62df 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 _0xe64a=['sequelize','exports','STRING'];(function(_0x1d4081,_0x2e0fa1){var _0x2eb5ea=function(_0x551e7a){while(--_0x551e7a){_0x1d4081['push'](_0x1d4081['shift']());}};_0x2eb5ea(++_0x2e0fa1);}(_0xe64a,0x1e0));var _0xae64=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe64a[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xae64('0x0'));module[_0xae64('0x1')]={'name':{'type':Sequelize[_0xae64('0x2')]},'basename':{'type':Sequelize[_0xae64('0x2')]},'type':{'type':Sequelize[_0xae64('0x2')]}}; \ No newline at end of file +var _0x8a9c=['STRING','sequelize','exports'];(function(_0x39cbb4,_0x3bb936){var _0x2cdd2f=function(_0x5bca4a){while(--_0x5bca4a){_0x39cbb4['push'](_0x39cbb4['shift']());}};_0x2cdd2f(++_0x3bb936);}(_0x8a9c,0x12d));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc8a9('0x0'));module[_0xc8a9('0x1')]={'name':{'type':Sequelize[_0xc8a9('0x2')]},'basename':{'type':Sequelize[_0xc8a9('0x2')]},'type':{'type':Sequelize[_0xc8a9('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 3d4abbf..18daba2 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 _0x9512=['crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map','Attachment','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','findAll','catch','params','fields','include','find','get','body','createdAt','updatedAt','create','file','originalname','filename','download','findOne','ChatOfflineMessageId','root','join','basename','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel'];(function(_0x473c48,_0x3c3ce7){var _0x3a45b6=function(_0x537c35){while(--_0x537c35){_0x473c48['push'](_0x473c48['shift']());}};_0x3a45b6(++_0x3c3ce7);}(_0x9512,0xf6));var _0x2951=function(_0x471448,_0x1c0e9e){_0x471448=_0x471448-0x0;var _0x38190b=_0x9512[_0x471448];return _0x38190b;};'use strict';var emlformat=require(_0x2951('0x0'));var rimraf=require(_0x2951('0x1'));var zipdir=require(_0x2951('0x2'));var jsonpatch=require(_0x2951('0x3'));var rp=require('request-promise');var moment=require(_0x2951('0x4'));var BPromise=require(_0x2951('0x5'));var Mustache=require(_0x2951('0x6'));var util=require('util');var path=require('path');var sox=require(_0x2951('0x7'));var csv=require('to-csv');var ejs=require(_0x2951('0x8'));var fs=require('fs');var fs_extra=require(_0x2951('0x9'));var _=require(_0x2951('0xa'));var squel=require(_0x2951('0xb'));var crypto=require(_0x2951('0xc'));var jsforce=require(_0x2951('0xd'));var deskjs=require(_0x2951('0xe'));var toCsv=require('to-csv');var querystring=require(_0x2951('0xf'));var Papa=require(_0x2951('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2951('0x11'));var as=require(_0x2951('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2951('0x13'))(_0x2951('0x14'));var utils=require(_0x2951('0x15'));var config=require(_0x2951('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2951('0x17'))['db'];function respondWithStatusCode(_0x16a209,_0x1a4c74){_0x1a4c74=_0x1a4c74||0xcc;return function(_0x6a7c07){if(_0x6a7c07){return _0x16a209[_0x2951('0x18')](_0x1a4c74);}return _0x16a209[_0x2951('0x19')](_0x1a4c74)[_0x2951('0x1a')]();};}function respondWithResult(_0x37eaf4,_0x4152b4){_0x4152b4=_0x4152b4||0xc8;return function(_0x633847){if(_0x633847){return _0x37eaf4[_0x2951('0x19')](_0x4152b4)[_0x2951('0x1b')](_0x633847);}};}function respondWithFilteredResult(_0x5b46ee,_0x520d0b){return function(_0x4c2110){if(_0x4c2110){var _0x959597=typeof _0x520d0b[_0x2951('0x1c')]===_0x2951('0x1d')&&typeof _0x520d0b[_0x2951('0x1e')]==='undefined';var _0x1d4236=_0x4c2110[_0x2951('0x1f')];var _0x53d385=_0x959597?0x0:_0x520d0b[_0x2951('0x1c')];var _0x131028=_0x959597?_0x4c2110['count']:_0x520d0b[_0x2951('0x1c')]+_0x520d0b[_0x2951('0x1e')];var _0x1fe121;if(_0x131028>=_0x1d4236){_0x131028=_0x1d4236;_0x1fe121=0xc8;}else{_0x1fe121=0xce;}_0x5b46ee[_0x2951('0x19')](_0x1fe121);return _0x5b46ee['set'](_0x2951('0x20'),_0x53d385+'-'+_0x131028+'/'+_0x1d4236)[_0x2951('0x1b')](_0x4c2110);}return null;};}function patchUpdates(_0xa7a101){return function(_0x2cbf1d){try{jsonpatch[_0x2951('0x21')](_0x2cbf1d,_0xa7a101,!![]);}catch(_0x3608a0){return BPromise[_0x2951('0x22')](_0x3608a0);}return _0x2cbf1d['save']();};}function saveUpdates(_0x17806b,_0x27185a){return function(_0x48ae8a){if(_0x48ae8a){return _0x48ae8a[_0x2951('0x23')](_0x17806b)[_0x2951('0x24')](function(_0x1d99cb){return _0x1d99cb;});}return null;};}function removeEntity(_0x22277a,_0x5e15c3){return function(_0x134e46){if(_0x134e46){return _0x134e46[_0x2951('0x25')]()[_0x2951('0x24')](function(){_0x22277a[_0x2951('0x19')](0xcc)[_0x2951('0x1a')]();});}};}function handleEntityNotFound(_0x1af13f,_0x4897fc){return function(_0x5f0ab2){if(!_0x5f0ab2){_0x1af13f[_0x2951('0x18')](0x194);}return _0x5f0ab2;};}function handleError(_0x40d6aa,_0x55d4ae){_0x55d4ae=_0x55d4ae||0x1f4;return function(_0x5e119e){logger[_0x2951('0x26')](_0x5e119e[_0x2951('0x27')]);if(_0x5e119e[_0x2951('0x28')]){delete _0x5e119e[_0x2951('0x28')];}_0x40d6aa[_0x2951('0x19')](_0x55d4ae)[_0x2951('0x29')](_0x5e119e);};}exports['index']=function(_0x2dc713,_0x40d82e){var _0x138ae3={},_0x3e9dd4={},_0x34b35e={'count':0x0,'rows':[]};var _0x2bd35c=_[_0x2951('0x2a')](db[_0x2951('0x2b')][_0x2951('0x2c')],function(_0x3b8ae1){return{'name':_0x3b8ae1[_0x2951('0x2d')],'type':_0x3b8ae1['type'][_0x2951('0x2e')]};});_0x3e9dd4[_0x2951('0x2f')]=_[_0x2951('0x2a')](_0x2bd35c,'name');_0x3e9dd4['query']=_[_0x2951('0x30')](_0x2dc713['query']);_0x3e9dd4['filters']=_[_0x2951('0x31')](_0x3e9dd4[_0x2951('0x2f')],_0x3e9dd4[_0x2951('0x32')]);_0x138ae3[_0x2951('0x33')]=_['intersection'](_0x3e9dd4['model'],qs['fields'](_0x2dc713[_0x2951('0x32')]['fields']));_0x138ae3[_0x2951('0x33')]=_0x138ae3[_0x2951('0x33')][_0x2951('0x34')]?_0x138ae3[_0x2951('0x33')]:_0x3e9dd4[_0x2951('0x2f')];if(!_0x2dc713['query'][_0x2951('0x35')](_0x2951('0x36'))){_0x138ae3['limit']=qs['limit'](_0x2dc713[_0x2951('0x32')][_0x2951('0x1e')]);_0x138ae3[_0x2951('0x1c')]=qs[_0x2951('0x1c')](_0x2dc713[_0x2951('0x32')][_0x2951('0x1c')]);}_0x138ae3[_0x2951('0x37')]=qs[_0x2951('0x38')](_0x2dc713['query'][_0x2951('0x38')]);_0x138ae3[_0x2951('0x39')]=qs[_0x2951('0x3a')](_[_0x2951('0x3b')](_0x2dc713[_0x2951('0x32')],_0x3e9dd4[_0x2951('0x3a')]),_0x2bd35c);if(_0x2dc713[_0x2951('0x32')][_0x2951('0x3c')]){_0x138ae3['where']=_['merge'](_0x138ae3[_0x2951('0x39')],{'$or':_[_0x2951('0x2a')](_0x2bd35c,function(_0x20dfbd){if(_0x20dfbd[_0x2951('0x3d')]!==_0x2951('0x3e')){var _0x5e136e={};_0x5e136e[_0x20dfbd[_0x2951('0x28')]]={'$like':'%'+_0x2dc713[_0x2951('0x32')][_0x2951('0x3c')]+'%'};return _0x5e136e;}})});}_0x138ae3=_[_0x2951('0x3f')]({},_0x138ae3,_0x2dc713[_0x2951('0x40')]);var _0x31d92b={'where':_0x138ae3[_0x2951('0x39')]};return db[_0x2951('0x2b')][_0x2951('0x1f')](_0x31d92b)[_0x2951('0x24')](function(_0x4b5f99){_0x34b35e[_0x2951('0x1f')]=_0x4b5f99;if(_0x2dc713[_0x2951('0x32')][_0x2951('0x41')]){_0x138ae3['include']=[{'all':!![]}];}return db[_0x2951('0x2b')][_0x2951('0x42')](_0x138ae3);})[_0x2951('0x24')](function(_0x3f8e4c){_0x34b35e['rows']=_0x3f8e4c;return _0x34b35e;})['then'](respondWithFilteredResult(_0x40d82e,_0x138ae3))[_0x2951('0x43')](handleError(_0x40d82e,null));};exports['show']=function(_0x2db622,_0xef8ca9){var _0x155e3b={'raw':!![],'where':{'id':_0x2db622[_0x2951('0x44')]['id']}},_0x30f86a={};_0x30f86a['model']=_[_0x2951('0x30')](db[_0x2951('0x2b')]['rawAttributes']);_0x30f86a[_0x2951('0x32')]=_[_0x2951('0x30')](_0x2db622['query']);_0x30f86a['filters']=_[_0x2951('0x31')](_0x30f86a['model'],_0x30f86a[_0x2951('0x32')]);_0x155e3b[_0x2951('0x33')]=_[_0x2951('0x31')](_0x30f86a[_0x2951('0x2f')],qs[_0x2951('0x45')](_0x2db622[_0x2951('0x32')][_0x2951('0x45')]));_0x155e3b[_0x2951('0x33')]=_0x155e3b[_0x2951('0x33')][_0x2951('0x34')]?_0x155e3b[_0x2951('0x33')]:_0x30f86a[_0x2951('0x2f')];if(_0x2db622[_0x2951('0x32')]['includeAll']){_0x155e3b[_0x2951('0x46')]=[{'all':!![]}];}_0x155e3b=_[_0x2951('0x3f')]({},_0x155e3b,_0x2db622[_0x2951('0x40')]);return db[_0x2951('0x2b')][_0x2951('0x47')](_0x155e3b)[_0x2951('0x24')](handleEntityNotFound(_0xef8ca9,null))[_0x2951('0x24')](respondWithResult(_0xef8ca9,null))[_0x2951('0x43')](handleError(_0xef8ca9,null));};exports['clone']=function(_0x56728a,_0x1c4e6e){var _0x475f0a={'where':{'id':_0x56728a[_0x2951('0x44')]['id']}},_0xb8b92c={};_0xb8b92c[_0x2951('0x2f')]=_[_0x2951('0x30')](db['Attachment'][_0x2951('0x2c')]);_0x475f0a[_0x2951('0x33')]=_[_0x2951('0x31')](_0xb8b92c['model'],qs[_0x2951('0x45')](_0x56728a[_0x2951('0x32')][_0x2951('0x45')]));_0x475f0a['attributes']=_0x475f0a['attributes'][_0x2951('0x34')]?_0x475f0a[_0x2951('0x33')]:_0xb8b92c[_0x2951('0x2f')];if(_0x56728a[_0x2951('0x32')]['includeAll']){_0x475f0a['include']=[{'all':!![]}];}_0x475f0a=_[_0x2951('0x3f')]({},_0x475f0a,_0x56728a[_0x2951('0x40')]);return db['Attachment']['find'](_0x475f0a)[_0x2951('0x24')](handleEntityNotFound(_0x1c4e6e,null))[_0x2951('0x24')](function(_0x3505d3){if(_0x3505d3){var _0x164a9e=_0x3505d3[_0x2951('0x48')]({'plain':!![]});_0x164a9e=qs['omit'](_0x164a9e,['id','createdAt','updatedAt']);_0x56728a[_0x2951('0x49')]=_['omit'](_0x56728a['body'],['id',_0x2951('0x4a'),_0x2951('0x4b')]);return db[_0x2951('0x2b')]['create'](_[_0x2951('0x3f')](_0x164a9e,_0x56728a[_0x2951('0x49')]),{'include':_0x56728a[_0x2951('0x32')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x2951('0x24')](respondWithResult(_0x1c4e6e,0xc9))[_0x2951('0x43')](handleError(_0x1c4e6e,null));};exports['update']=function(_0x53f367,_0x2707fd){if(_0x53f367[_0x2951('0x49')]['id']){delete _0x53f367['body']['id'];}return db[_0x2951('0x2b')][_0x2951('0x47')]({'where':{'id':_0x53f367[_0x2951('0x44')]['id']}})[_0x2951('0x24')](handleEntityNotFound(_0x2707fd,null))[_0x2951('0x24')](saveUpdates(_0x53f367['body'],null))[_0x2951('0x24')](respondWithResult(_0x2707fd,null))[_0x2951('0x43')](handleError(_0x2707fd,null));};exports[_0x2951('0x25')]=function(_0x557dc9,_0x12db91){return db['Attachment']['find']({'where':{'id':_0x557dc9[_0x2951('0x44')]['id']}})[_0x2951('0x24')](handleEntityNotFound(_0x12db91,null))[_0x2951('0x24')](removeEntity(_0x12db91,null))[_0x2951('0x43')](handleError(_0x12db91,null));};exports[_0x2951('0x4c')]=function(_0x4f98ff,_0x3b4231,_0x41daef){_0x4f98ff[_0x2951('0x49')][_0x2951('0x28')]=_0x4f98ff[_0x2951('0x4d')][_0x2951('0x4e')];_0x4f98ff['body']['basename']=_0x4f98ff[_0x2951('0x4d')][_0x2951('0x4f')];_0x4f98ff[_0x2951('0x49')]['type']=_0x4f98ff[_0x2951('0x4d')]['mimetype'];return db['Attachment'][_0x2951('0x4c')](_0x4f98ff[_0x2951('0x49')])['then'](respondWithResult(_0x3b4231,0xc9))[_0x2951('0x43')](handleError(_0x3b4231,null));};exports[_0x2951('0x50')]=function(_0x52e7ed,_0x5a8cb9,_0x2cebaf){return db['Attachment'][_0x2951('0x51')]({'where':{'id':_0x52e7ed['params']['id']},'raw':!![]})[_0x2951('0x24')](handleEntityNotFound(_0x5a8cb9,null))[_0x2951('0x24')](function(_0x5dcd3a){if(_0x5dcd3a){var _0x10d99d=_0x5dcd3a[_0x2951('0x52')]!==null;var _0x2243a1=path['join'](config[_0x2951('0x53')],'server/files/attachments/');if(_0x10d99d){_0x2243a1=path[_0x2951('0x54')](_0x2243a1,'offline-chat/');}var _0x50062d=path[_0x2951('0x54')](_0x2243a1,_0x5dcd3a[_0x2951('0x55')]);return _0x5a8cb9[_0x2951('0x50')](_0x50062d);}})[_0x2951('0x43')](handleError(_0x5a8cb9,null));}; \ No newline at end of file +var _0xa0e3=['../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','update','then','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','length','clone','params','find','get','createdAt','updatedAt','body','omit','create','file','originalname','basename','filename','download','ChatOfflineMessageId','join','root','offline-chat/','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs'];(function(_0x9391df,_0x2bebda){var _0x59255b=function(_0x1db709){while(--_0x1db709){_0x9391df['push'](_0x9391df['shift']());}};_0x59255b(++_0x2bebda);}(_0xa0e3,0xe7));var _0x3a0e=function(_0x17ba23,_0x1f321c){_0x17ba23=_0x17ba23-0x0;var _0x204fce=_0xa0e3[_0x17ba23];return _0x204fce;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3a0e('0x0'));var rp=require(_0x3a0e('0x1'));var moment=require(_0x3a0e('0x2'));var BPromise=require(_0x3a0e('0x3'));var Mustache=require('mustache');var util=require(_0x3a0e('0x4'));var path=require(_0x3a0e('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3a0e('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3a0e('0x7'));var squel=require(_0x3a0e('0x8'));var crypto=require(_0x3a0e('0x9'));var jsforce=require(_0x3a0e('0xa'));var deskjs=require(_0x3a0e('0xb'));var toCsv=require(_0x3a0e('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3a0e('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3a0e('0xe'));var as=require(_0x3a0e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3a0e('0x10'));var utils=require(_0x3a0e('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x3a0e('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x47560e,_0x7d941e){_0x7d941e=_0x7d941e||0xcc;return function(_0x167a38){if(_0x167a38){return _0x47560e[_0x3a0e('0x13')](_0x7d941e);}return _0x47560e[_0x3a0e('0x14')](_0x7d941e)[_0x3a0e('0x15')]();};}function respondWithResult(_0x46d1e2,_0x139b6e){_0x139b6e=_0x139b6e||0xc8;return function(_0x5c064b){if(_0x5c064b){return _0x46d1e2['status'](_0x139b6e)[_0x3a0e('0x16')](_0x5c064b);}};}function respondWithFilteredResult(_0x24c3a2,_0x5b7ef8){return function(_0x5abd8e){if(_0x5abd8e){var _0x5e28e3=typeof _0x5b7ef8[_0x3a0e('0x17')]===_0x3a0e('0x18')&&typeof _0x5b7ef8['limit']===_0x3a0e('0x18');var _0x10de8c=_0x5abd8e['count'];var _0xb3cfa8=_0x5e28e3?0x0:_0x5b7ef8['offset'];var _0x35164f=_0x5e28e3?_0x5abd8e[_0x3a0e('0x19')]:_0x5b7ef8[_0x3a0e('0x17')]+_0x5b7ef8[_0x3a0e('0x1a')];var _0x3c931d;if(_0x35164f>=_0x10de8c){_0x35164f=_0x10de8c;_0x3c931d=0xc8;}else{_0x3c931d=0xce;}_0x24c3a2[_0x3a0e('0x14')](_0x3c931d);return _0x24c3a2[_0x3a0e('0x1b')]('Content-Range',_0xb3cfa8+'-'+_0x35164f+'/'+_0x10de8c)[_0x3a0e('0x16')](_0x5abd8e);}return null;};}function patchUpdates(_0x589286){return function(_0x2b3842){try{jsonpatch['apply'](_0x2b3842,_0x589286,!![]);}catch(_0x3e8c02){return BPromise[_0x3a0e('0x1c')](_0x3e8c02);}return _0x2b3842['save']();};}function saveUpdates(_0xe8f158,_0x5c38a6){return function(_0x4a736e){if(_0x4a736e){return _0x4a736e[_0x3a0e('0x1d')](_0xe8f158)[_0x3a0e('0x1e')](function(_0xca718){return _0xca718;});}return null;};}function removeEntity(_0x1395d6,_0xb70032){return function(_0x326c77){if(_0x326c77){return _0x326c77['destroy']()[_0x3a0e('0x1e')](function(){_0x1395d6[_0x3a0e('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2696d4,_0x320827){return function(_0x3962cd){if(!_0x3962cd){_0x2696d4[_0x3a0e('0x13')](0x194);}return _0x3962cd;};}function handleError(_0x49cfa1,_0x45830a){_0x45830a=_0x45830a||0x1f4;return function(_0x3b7ed6){logger[_0x3a0e('0x1f')](_0x3b7ed6[_0x3a0e('0x20')]);if(_0x3b7ed6[_0x3a0e('0x21')]){delete _0x3b7ed6[_0x3a0e('0x21')];}_0x49cfa1['status'](_0x45830a)[_0x3a0e('0x22')](_0x3b7ed6);};}exports[_0x3a0e('0x23')]=function(_0x23000e,_0x1eefb8){var _0x519c41={},_0x115bd9={},_0x5d532c={'count':0x0,'rows':[]};var _0x3b6aea=_[_0x3a0e('0x24')](db[_0x3a0e('0x25')][_0x3a0e('0x26')],function(_0x1b452e){return{'name':_0x1b452e[_0x3a0e('0x27')],'type':_0x1b452e[_0x3a0e('0x28')][_0x3a0e('0x29')]};});_0x115bd9[_0x3a0e('0x2a')]=_['map'](_0x3b6aea,_0x3a0e('0x21'));_0x115bd9[_0x3a0e('0x2b')]=_[_0x3a0e('0x2c')](_0x23000e[_0x3a0e('0x2b')]);_0x115bd9[_0x3a0e('0x2d')]=_[_0x3a0e('0x2e')](_0x115bd9[_0x3a0e('0x2a')],_0x115bd9[_0x3a0e('0x2b')]);_0x519c41['attributes']=_[_0x3a0e('0x2e')](_0x115bd9[_0x3a0e('0x2a')],qs[_0x3a0e('0x2f')](_0x23000e[_0x3a0e('0x2b')][_0x3a0e('0x2f')]));_0x519c41[_0x3a0e('0x30')]=_0x519c41[_0x3a0e('0x30')]['length']?_0x519c41[_0x3a0e('0x30')]:_0x115bd9['model'];if(!_0x23000e[_0x3a0e('0x2b')][_0x3a0e('0x31')](_0x3a0e('0x32'))){_0x519c41[_0x3a0e('0x1a')]=qs['limit'](_0x23000e[_0x3a0e('0x2b')][_0x3a0e('0x1a')]);_0x519c41[_0x3a0e('0x17')]=qs[_0x3a0e('0x17')](_0x23000e['query'][_0x3a0e('0x17')]);}_0x519c41['order']=qs[_0x3a0e('0x33')](_0x23000e[_0x3a0e('0x2b')]['sort']);_0x519c41['where']=qs[_0x3a0e('0x2d')](_['pick'](_0x23000e[_0x3a0e('0x2b')],_0x115bd9[_0x3a0e('0x2d')]),_0x3b6aea);if(_0x23000e['query']['filter']){_0x519c41[_0x3a0e('0x34')]=_[_0x3a0e('0x35')](_0x519c41[_0x3a0e('0x34')],{'$or':_[_0x3a0e('0x24')](_0x3b6aea,function(_0x580a42){if(_0x580a42['type']!==_0x3a0e('0x36')){var _0x2d2396={};_0x2d2396[_0x580a42[_0x3a0e('0x21')]]={'$like':'%'+_0x23000e[_0x3a0e('0x2b')][_0x3a0e('0x37')]+'%'};return _0x2d2396;}})});}_0x519c41=_['merge']({},_0x519c41,_0x23000e[_0x3a0e('0x38')]);var _0x28d6ef={'where':_0x519c41[_0x3a0e('0x34')]};return db[_0x3a0e('0x25')][_0x3a0e('0x19')](_0x28d6ef)['then'](function(_0x3929ad){_0x5d532c[_0x3a0e('0x19')]=_0x3929ad;if(_0x23000e[_0x3a0e('0x2b')][_0x3a0e('0x39')]){_0x519c41[_0x3a0e('0x3a')]=[{'all':!![]}];}return db[_0x3a0e('0x25')][_0x3a0e('0x3b')](_0x519c41);})[_0x3a0e('0x1e')](function(_0x277316){_0x5d532c[_0x3a0e('0x3c')]=_0x277316;return _0x5d532c;})[_0x3a0e('0x1e')](respondWithFilteredResult(_0x1eefb8,_0x519c41))[_0x3a0e('0x3d')](handleError(_0x1eefb8,null));};exports[_0x3a0e('0x3e')]=function(_0x3690f8,_0x3c1b7c){var _0x353016={'raw':!![],'where':{'id':_0x3690f8['params']['id']}},_0x32f3b8={};_0x32f3b8[_0x3a0e('0x2a')]=_['keys'](db['Attachment'][_0x3a0e('0x26')]);_0x32f3b8['query']=_[_0x3a0e('0x2c')](_0x3690f8['query']);_0x32f3b8[_0x3a0e('0x2d')]=_[_0x3a0e('0x2e')](_0x32f3b8[_0x3a0e('0x2a')],_0x32f3b8[_0x3a0e('0x2b')]);_0x353016[_0x3a0e('0x30')]=_['intersection'](_0x32f3b8[_0x3a0e('0x2a')],qs['fields'](_0x3690f8['query']['fields']));_0x353016['attributes']=_0x353016[_0x3a0e('0x30')][_0x3a0e('0x3f')]?_0x353016[_0x3a0e('0x30')]:_0x32f3b8['model'];if(_0x3690f8['query'][_0x3a0e('0x39')]){_0x353016['include']=[{'all':!![]}];}_0x353016=_['merge']({},_0x353016,_0x3690f8[_0x3a0e('0x38')]);return db[_0x3a0e('0x25')]['find'](_0x353016)[_0x3a0e('0x1e')](handleEntityNotFound(_0x3c1b7c,null))[_0x3a0e('0x1e')](respondWithResult(_0x3c1b7c,null))['catch'](handleError(_0x3c1b7c,null));};exports[_0x3a0e('0x40')]=function(_0x24c60c,_0x38da68){var _0x55c2ea={'where':{'id':_0x24c60c[_0x3a0e('0x41')]['id']}},_0x58e27f={};_0x58e27f[_0x3a0e('0x2a')]=_['keys'](db[_0x3a0e('0x25')][_0x3a0e('0x26')]);_0x55c2ea[_0x3a0e('0x30')]=_[_0x3a0e('0x2e')](_0x58e27f[_0x3a0e('0x2a')],qs['fields'](_0x24c60c[_0x3a0e('0x2b')][_0x3a0e('0x2f')]));_0x55c2ea[_0x3a0e('0x30')]=_0x55c2ea[_0x3a0e('0x30')][_0x3a0e('0x3f')]?_0x55c2ea[_0x3a0e('0x30')]:_0x58e27f[_0x3a0e('0x2a')];if(_0x24c60c['query']['includeAll']){_0x55c2ea['include']=[{'all':!![]}];}_0x55c2ea=_[_0x3a0e('0x35')]({},_0x55c2ea,_0x24c60c[_0x3a0e('0x38')]);return db[_0x3a0e('0x25')][_0x3a0e('0x42')](_0x55c2ea)[_0x3a0e('0x1e')](handleEntityNotFound(_0x38da68,null))[_0x3a0e('0x1e')](function(_0x5a38e0){if(_0x5a38e0){var _0x1fd5f7=_0x5a38e0[_0x3a0e('0x43')]({'plain':!![]});_0x1fd5f7=qs['omit'](_0x1fd5f7,['id',_0x3a0e('0x44'),_0x3a0e('0x45')]);_0x24c60c[_0x3a0e('0x46')]=_[_0x3a0e('0x47')](_0x24c60c['body'],['id','createdAt','updatedAt']);return db[_0x3a0e('0x25')][_0x3a0e('0x48')](_[_0x3a0e('0x35')](_0x1fd5f7,_0x24c60c['body']),{'include':_0x24c60c[_0x3a0e('0x2b')][_0x3a0e('0x39')]?[{'all':!![]}]:undefined});}})[_0x3a0e('0x1e')](respondWithResult(_0x38da68,0xc9))[_0x3a0e('0x3d')](handleError(_0x38da68,null));};exports[_0x3a0e('0x1d')]=function(_0x32d65d,_0x49f35f){if(_0x32d65d['body']['id']){delete _0x32d65d['body']['id'];}return db[_0x3a0e('0x25')][_0x3a0e('0x42')]({'where':{'id':_0x32d65d['params']['id']}})[_0x3a0e('0x1e')](handleEntityNotFound(_0x49f35f,null))['then'](saveUpdates(_0x32d65d['body'],null))[_0x3a0e('0x1e')](respondWithResult(_0x49f35f,null))[_0x3a0e('0x3d')](handleError(_0x49f35f,null));};exports['destroy']=function(_0x4d68cd,_0x5e16cc){return db[_0x3a0e('0x25')][_0x3a0e('0x42')]({'where':{'id':_0x4d68cd[_0x3a0e('0x41')]['id']}})[_0x3a0e('0x1e')](handleEntityNotFound(_0x5e16cc,null))[_0x3a0e('0x1e')](removeEntity(_0x5e16cc,null))['catch'](handleError(_0x5e16cc,null));};exports[_0x3a0e('0x48')]=function(_0x2ec262,_0x2427ba,_0x36cf49){_0x2ec262[_0x3a0e('0x46')][_0x3a0e('0x21')]=_0x2ec262[_0x3a0e('0x49')][_0x3a0e('0x4a')];_0x2ec262[_0x3a0e('0x46')][_0x3a0e('0x4b')]=_0x2ec262[_0x3a0e('0x49')][_0x3a0e('0x4c')];_0x2ec262[_0x3a0e('0x46')][_0x3a0e('0x28')]=_0x2ec262[_0x3a0e('0x49')]['mimetype'];return db[_0x3a0e('0x25')][_0x3a0e('0x48')](_0x2ec262['body'])[_0x3a0e('0x1e')](respondWithResult(_0x2427ba,0xc9))['catch'](handleError(_0x2427ba,null));};exports[_0x3a0e('0x4d')]=function(_0x48153a,_0x5ea421,_0x5993c2){return db[_0x3a0e('0x25')]['findOne']({'where':{'id':_0x48153a[_0x3a0e('0x41')]['id']},'raw':!![]})[_0x3a0e('0x1e')](handleEntityNotFound(_0x5ea421,null))[_0x3a0e('0x1e')](function(_0x4c2c2c){if(_0x4c2c2c){var _0x3a76d1=_0x4c2c2c[_0x3a0e('0x4e')]!==null;var _0xeac9b6=path[_0x3a0e('0x4f')](config[_0x3a0e('0x50')],'server/files/attachments/');if(_0x3a76d1){_0xeac9b6=path[_0x3a0e('0x4f')](_0xeac9b6,_0x3a0e('0x51'));}var _0x3eed3c=path[_0x3a0e('0x4f')](_0xeac9b6,_0x4c2c2c['basename']);return _0x5ea421[_0x3a0e('0x4d')](_0x3eed3c);}})[_0x3a0e('0x3d')](handleError(_0x5ea421,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 4a494fb..a93e3ff 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 _0x140d=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash'];(function(_0x304f57,_0x1d51db){var _0x4bd430=function(_0x4f1b54){while(--_0x4f1b54){_0x304f57['push'](_0x304f57['shift']());}};_0x4bd430(++_0x1d51db);}(_0x140d,0x14f));var _0xd140=function(_0x9a2980,_0x27c0b8){_0x9a2980=_0x9a2980-0x0;var _0x88b506=_0x140d[_0x9a2980];return _0x88b506;};'use strict';var _=require(_0xd140('0x0'));var util=require(_0xd140('0x1'));var logger=require('../../config/logger')(_0xd140('0x2'));var moment=require(_0xd140('0x3'));var BPromise=require(_0xd140('0x4'));var rp=require(_0xd140('0x5'));var fs=require('fs');var path=require(_0xd140('0x6'));var rimraf=require(_0xd140('0x7'));var config=require(_0xd140('0x8'));var attributes=require(_0xd140('0x9'));module[_0xd140('0xa')]=function(_0x4d51d9,_0x4a30e5){return _0x4d51d9[_0xd140('0xb')](_0xd140('0xc'),attributes,{'tableName':_0xd140('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3d0=['rimraf','../../config/environment','define','Attachment','attachments','lodash','util','api','moment','bluebird','request-promise'];(function(_0x45f8ce,_0x1631e3){var _0x47019a=function(_0x1a05c0){while(--_0x1a05c0){_0x45f8ce['push'](_0x45f8ce['shift']());}};_0x47019a(++_0x1631e3);}(_0xc3d0,0x123));var _0x0c3d=function(_0x557c9e,_0x3f5795){_0x557c9e=_0x557c9e-0x0;var _0xcb704=_0xc3d0[_0x557c9e];return _0xcb704;};'use strict';var _=require(_0x0c3d('0x0'));var util=require(_0x0c3d('0x1'));var logger=require('../../config/logger')(_0x0c3d('0x2'));var moment=require(_0x0c3d('0x3'));var BPromise=require(_0x0c3d('0x4'));var rp=require(_0x0c3d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0c3d('0x6'));var config=require(_0x0c3d('0x7'));var attributes=require('./attachment.attributes');module['exports']=function(_0x2c6981,_0x1743a9){return _0x2c6981[_0x0c3d('0x8')](_0x0c3d('0x9'),attributes,{'tableName':_0x0c3d('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 2ecb570..56eb13a 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 _0xf53f=['create','options','raw','then','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','info','result','CreateAttachment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf53f,0x8d));var _0xff53=function(_0x44a297,_0x34d9d8){_0x44a297=_0x44a297-0x0;var _0x4b25de=_0xf53f[_0x44a297];return _0x4b25de;};'use strict';var _=require(_0xff53('0x0'));var util=require(_0xff53('0x1'));var moment=require(_0xff53('0x2'));var BPromise=require(_0xff53('0x3'));var rs=require(_0xff53('0x4'));var fs=require('fs');var Redis=require(_0xff53('0x5'));var db=require(_0xff53('0x6'))['db'];var utils=require(_0xff53('0x7'));var logger=require(_0xff53('0x8'))(_0xff53('0x9'));var config=require(_0xff53('0xa'));var jayson=require(_0xff53('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27b397,_0x5751e7,_0x1c27bb){return new BPromise(function(_0x122746,_0x1bc4b3){return client['request'](_0x27b397,_0x1c27bb)['then'](function(_0x3c001d){logger['info'](_0xff53('0xc'),_0x5751e7,_0xff53('0xd'));logger['debug'](_0xff53('0xe'),_0x5751e7,_0xff53('0xd'),JSON['stringify'](_0x3c001d));if(_0x3c001d[_0xff53('0xf')]){if(_0x3c001d[_0xff53('0xf')][_0xff53('0x10')]===0x1f4){logger['error'](_0xff53('0xc'),_0x5751e7,_0x3c001d[_0xff53('0xf')][_0xff53('0x11')]);return _0x1bc4b3(_0x3c001d['error'][_0xff53('0x11')]);}logger[_0xff53('0xf')]('Attachment,\x20%s,\x20%s',_0x5751e7,_0x3c001d['error']['message']);return _0x122746(_0x3c001d['error'][_0xff53('0x11')]);}else{logger[_0xff53('0x12')](_0xff53('0xc'),_0x5751e7,'request\x20sent');_0x122746(_0x3c001d[_0xff53('0x13')]['message']);}})['catch'](function(_0x12e90b){logger[_0xff53('0xf')](_0xff53('0xc'),_0x5751e7,_0x12e90b);_0x1bc4b3(_0x12e90b);});});}exports[_0xff53('0x14')]=function(_0x38883f){var _0x319ce5=this;return new Promise(function(_0x14b502,_0x5e9ba6){return db['Attachment'][_0xff53('0x15')](_0x38883f['body'],{'raw':_0x38883f[_0xff53('0x16')]?_0x38883f[_0xff53('0x16')][_0xff53('0x17')]===undefined?!![]:![]:!![]})[_0xff53('0x18')](function(_0x39b3d1){logger[_0xff53('0x12')](_0xff53('0x14'),_0x38883f);logger[_0xff53('0x19')](_0xff53('0x14'),_0x38883f,JSON['stringify'](_0x39b3d1));_0x14b502(_0x39b3d1);})[_0xff53('0x1a')](function(_0x5cd878){logger['error']('CreateAttachment',_0x5cd878['message'],_0x38883f);_0x5e9ba6(_0x319ce5[_0xff53('0xf')](0x1f4,_0x5cd878[_0xff53('0x11')]));});});}; \ No newline at end of file +var _0x1be1=['Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateAttachment','body','options','raw','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Attachment,\x20%s,\x20%s','debug'];(function(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0x1be1,0x192));var _0x11be=function(_0x204c47,_0x211675){_0x204c47=_0x204c47-0x0;var _0x5e5e92=_0x1be1[_0x204c47];return _0x5e5e92;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x11be('0x0'));var BPromise=require(_0x11be('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11be('0x2'));var db=require(_0x11be('0x3'))['db'];var utils=require(_0x11be('0x4'));var logger=require(_0x11be('0x5'))('rpc');var config=require(_0x11be('0x6'));var jayson=require(_0x11be('0x7'));var client=jayson[_0x11be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfe8c62,_0x497730,_0x18f661){return new BPromise(function(_0x11fc15,_0x246772){return client[_0x11be('0x9')](_0xfe8c62,_0x18f661)[_0x11be('0xa')](function(_0x5f3d04){logger[_0x11be('0xb')](_0x11be('0xc'),_0x497730,'request\x20sent');logger[_0x11be('0xd')](_0x11be('0xe'),_0x497730,_0x11be('0xf'),JSON[_0x11be('0x10')](_0x5f3d04));if(_0x5f3d04['error']){if(_0x5f3d04[_0x11be('0x11')][_0x11be('0x12')]===0x1f4){logger[_0x11be('0x11')]('Attachment,\x20%s,\x20%s',_0x497730,_0x5f3d04[_0x11be('0x11')][_0x11be('0x13')]);return _0x246772(_0x5f3d04['error'][_0x11be('0x13')]);}logger['error']('Attachment,\x20%s,\x20%s',_0x497730,_0x5f3d04['error']['message']);return _0x11fc15(_0x5f3d04['error']['message']);}else{logger['info'](_0x11be('0xc'),_0x497730,'request\x20sent');_0x11fc15(_0x5f3d04[_0x11be('0x14')][_0x11be('0x13')]);}})[_0x11be('0x15')](function(_0x216b8c){logger['error'](_0x11be('0xc'),_0x497730,_0x216b8c);_0x246772(_0x216b8c);});});}exports[_0x11be('0x16')]=function(_0x56ab61){var _0x299f45=this;return new Promise(function(_0xc3263c,_0x23aa5f){return db['Attachment']['create'](_0x56ab61[_0x11be('0x17')],{'raw':_0x56ab61[_0x11be('0x18')]?_0x56ab61[_0x11be('0x18')][_0x11be('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x12a5bd){logger[_0x11be('0xb')](_0x11be('0x16'),_0x56ab61);logger[_0x11be('0xd')](_0x11be('0x16'),_0x56ab61,JSON[_0x11be('0x10')](_0x12a5bd));_0xc3263c(_0x12a5bd);})[_0x11be('0x15')](function(_0x17678d){logger[_0x11be('0x11')](_0x11be('0x16'),_0x17678d['message'],_0x56ab61);_0x23aa5f(_0x299f45[_0x11be('0x11')](0x1f4,_0x17678d[_0x11be('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 6472294..c44efd4 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 _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x7f8a44,_0x13830e){var _0x93f2de=function(_0x1134c0){while(--_0x1134c0){_0x7f8a44['push'](_0x7f8a44['shift']());}};_0x93f2de(++_0x13830e);}(_0x2032,0xd9));var _0x2203=function(_0x3d8706,_0x382abc){_0x3d8706=_0x3d8706-0x0;var _0x46cd13=_0x2032[_0x3d8706];return _0x46cd13;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file +var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x3610f6,_0x52f821){var _0x45ff1b=function(_0x2af7a5){while(--_0x2af7a5){_0x3610f6['push'](_0x3610f6['shift']());}};_0x45ff1b(++_0x52f821);}(_0x5f2f,0x73));var _0xf5f2=function(_0x292526,_0x2d3480){_0x292526=_0x292526-0x0;var _0x563dfd=_0x5f2f[_0x292526];return _0x563dfd;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index d8a62c8..65c0c4c 100644 --- a/server/api/authActiveDirectory/authActiveDirectory.controller.js +++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb0af=['message','login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','User','passport-local','moment','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','activedirectory','undefined','baseDN','url','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','online','admin','user','agent','domain','blockedAt','add','blockDuration','clearBlockUser','getLicense','catch','status'];(function(_0x325552,_0x2244c4){var _0x40b052=function(_0x268961){while(--_0x268961){_0x325552['push'](_0x325552['shift']());}};_0x40b052(++_0x2244c4);}(_0xb0af,0xed));var _0xfb0a=function(_0x309817,_0x44d860){_0x309817=_0x309817-0x0;var _0x1c6922=_0xb0af[_0x309817];return _0x1c6922;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xfb0a('0x0'))['Strategy'];var moment=require(_0xfb0a('0x1'));var ActiveDirectory=require(_0xfb0a('0x2'));var BPromise=require(_0xfb0a('0x3'));var util=require('util');var db=require(_0xfb0a('0x4'))['db'];var authService=require(_0xfb0a('0x5'));var utils=require(_0xfb0a('0x6'));var config=require('../../config/environment');var logger=require(_0xfb0a('0x7'))('api');function isActiveDirectoryConfigured(_0x220005){var _0x3ff04c=![];if(typeof _0x220005[_0xfb0a('0x8')]!==_0xfb0a('0x9')){_0x3ff04c=_0x220005[_0xfb0a('0x8')][_0xfb0a('0xa')]&&_0x220005[_0xfb0a('0x8')][_0xfb0a('0xb')]&&_0x220005[_0xfb0a('0x8')]['domain'];}return _0x3ff04c;}function adAuthenticate(_0x57c2b8,_0x1307d4,_0x1ce68d){return new BPromise(function(_0x4f7a04,_0x5abad9){try{var _0x482f3e=new ActiveDirectory(_0x57c2b8);_0x482f3e['authenticate'](_0x1307d4,_0x1ce68d,function(_0x49e3dd,_0x29605e){if(_0x49e3dd){logger[_0xfb0a('0xc')](_0xfb0a('0xd'),_0x1307d4,util[_0xfb0a('0xe')](_0x49e3dd,{'showHidden':![],'depth':null}));_0x5abad9(_0xfb0a('0xf'));}else if(!_0x29605e){logger[_0xfb0a('0xc')](_0xfb0a('0x10'),_0x1307d4);_0x5abad9(_0xfb0a('0xf'));}else{_0x4f7a04(_0x29605e);}});}catch(_0x3e8f78){_0x5abad9(_0x3e8f78);}});}function ActiveDirectoryAuthenticate(_0x4a72cd,_0x5d14b9,_0x316127,_0x41642c){var _0x4e331a,_0x1a3407;if(!isActiveDirectoryConfigured(config)){logger[_0xfb0a('0xc')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x5d14b9);return _0x41642c(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db['Setting'][_0xfb0a('0x11')]({'where':{'id':0x1},'attributes':[_0xfb0a('0x12'),'blockDuration'],'raw':!![]})[_0xfb0a('0x13')](function(_0x4e72ba){_0x4e331a=_0x4e72ba;if(!_0x4e331a[_0xfb0a('0x12')]){logger[_0xfb0a('0xc')](_0xfb0a('0x14'),_0x5d14b9);throw new Error(_0xfb0a('0xf'));}return _0x4a72cd['findOne']({'attributes':['id',_0xfb0a('0x15'),_0xfb0a('0x16'),_0xfb0a('0x17'),_0xfb0a('0x18'),_0xfb0a('0x19'),_0xfb0a('0x1a'),'blockedAt',_0xfb0a('0x1b')],'where':{'name':_0x5d14b9,'role':{'$or':[_0xfb0a('0x1c'),_0xfb0a('0x1d'),_0xfb0a('0x1e')]},'adSsoEnabled':!![]}});})[_0xfb0a('0x13')](function(_0x1328cb){if(!_0x1328cb||_0x1328cb&&_0x1328cb['name']!==_0x5d14b9){throw new Error(_0xfb0a('0xf'));}_0x1a3407=_0x1328cb;var _0x1c051e=_0x1a3407['name']+'@'+config['activedirectory'][_0xfb0a('0x1f')];return adAuthenticate(config[_0xfb0a('0x8')],_0x1c051e,_0x316127);})['then'](function(_0x51d5f0){if(_0x1a3407['disabled']){throw new Error(_0xfb0a('0xf'));}if(_0x4e331a['blockDuration']>0x0){if(_0x1a3407[_0xfb0a('0x1a')]){if(moment(_0x1a3407[_0xfb0a('0x20')])[_0xfb0a('0x21')](_0x4e331a[_0xfb0a('0x22')],'minutes')>moment()){throw new Error(_0xfb0a('0xf'));}return utils[_0xfb0a('0x23')](_0x1a3407,0x0,![],null)[_0xfb0a('0x13')](function(){return utils[_0xfb0a('0x24')](_0x1a3407);})[_0xfb0a('0x13')](function(){return _0x41642c(null,_0x1a3407);});}else{return utils[_0xfb0a('0x24')](_0x1a3407)[_0xfb0a('0x13')](function(){return _0x41642c(null,_0x1a3407);});}}else{return utils[_0xfb0a('0x24')](_0x1a3407)[_0xfb0a('0x13')](function(){return _0x41642c(null,_0x1a3407);});}})[_0xfb0a('0x25')](function(_0x54ef1a){return _0x41642c(null,![],_0x54ef1a);});}function handleError(_0x21c3ee,_0x229fce,_0x47b783){return _0x21c3ee[_0xfb0a('0x26')](_0x229fce||0x1f4)['send']({'message':_0x47b783?_0x47b783[_0xfb0a('0x27')]||_0x47b783:''});}exports[_0xfb0a('0x28')]=function(_0x3186e2,_0x1abd37,_0x49b3ee){passport[_0xfb0a('0x29')](_0xfb0a('0x2a'),function(_0x2482f1,_0x59a701,_0x1cd61b){var _0x107e7f=_0x2482f1||_0x1cd61b;if(_0x107e7f){return handleError(_0x1abd37,0x191,_0x107e7f);}if(!_0x59a701){return handleError(_0x1abd37,0x194,{'message':_0xfb0a('0x2b')});}else{var _0x48be35={'payload':{'id':_0x59a701['id'],'role':_0x59a701[_0xfb0a('0x18')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x48be35)[_0xfb0a('0x13')](function(_0x1e7f04){_0x1abd37[_0xfb0a('0x2c')]({'id':_0x59a701['id'],'token':_0x1e7f04,'statusCall':'','isAlreadyLogged':_0x59a701[_0xfb0a('0x1b')]});});}})(_0x3186e2,_0x1abd37,_0x49b3ee);};passport['use']('ad-login',new LocalStrategy({'usernameField':'name','passwordField':_0xfb0a('0x16')},function(_0x50470d,_0x4b907c,_0x52c86f){return ActiveDirectoryAuthenticate(db[_0xfb0a('0x2d')],_0x50470d,_0x4b907c,_0x52c86f);})); \ No newline at end of file +var _0x8390=['login','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','use','passport','passport-local','moment','activedirectory2','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','api','undefined','activedirectory','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','role','blocked','blockedAt','admin','user','agent','disabled','add','minutes','getLicense','send','message'];(function(_0x10d098,_0x66d37){var _0x4d8848=function(_0x3466c8){while(--_0x3466c8){_0x10d098['push'](_0x10d098['shift']());}};_0x4d8848(++_0x66d37);}(_0x8390,0xf8));var _0x0839=function(_0x3aeb36,_0x312dc9){_0x3aeb36=_0x3aeb36-0x0;var _0xa2ef21=_0x8390[_0x3aeb36];return _0xa2ef21;};'use strict';var passport=require(_0x0839('0x0'));var LocalStrategy=require(_0x0839('0x1'))['Strategy'];var moment=require(_0x0839('0x2'));var ActiveDirectory=require(_0x0839('0x3'));var BPromise=require(_0x0839('0x4'));var util=require(_0x0839('0x5'));var db=require(_0x0839('0x6'))['db'];var authService=require(_0x0839('0x7'));var utils=require('../../config/utils');var config=require(_0x0839('0x8'));var logger=require('../../config/logger')(_0x0839('0x9'));function isActiveDirectoryConfigured(_0x54e7b7){var _0x12f31c=![];if(typeof _0x54e7b7['activedirectory']!==_0x0839('0xa')){_0x12f31c=_0x54e7b7[_0x0839('0xb')][_0x0839('0xc')]&&_0x54e7b7[_0x0839('0xb')]['url']&&_0x54e7b7[_0x0839('0xb')][_0x0839('0xd')];}return _0x12f31c;}function adAuthenticate(_0x3444c6,_0x20a158,_0x2c8b2c){return new BPromise(function(_0x68c675,_0x567582){try{var _0x4cbcca=new ActiveDirectory(_0x3444c6);_0x4cbcca['authenticate'](_0x20a158,_0x2c8b2c,function(_0x550977,_0x5775a9){if(_0x550977){logger[_0x0839('0xe')](_0x0839('0xf'),_0x20a158,util[_0x0839('0x10')](_0x550977,{'showHidden':![],'depth':null}));_0x567582('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x5775a9){logger[_0x0839('0xe')](_0x0839('0x11'),_0x20a158);_0x567582(_0x0839('0x12'));}else{_0x68c675(_0x5775a9);}});}catch(_0x46c1f3){_0x567582(_0x46c1f3);}});}function ActiveDirectoryAuthenticate(_0x2b8b48,_0x11a3ff,_0xd32e4a,_0xbf87a3){var _0x3f7226,_0x5a9ebb;if(!isActiveDirectoryConfigured(config)){logger[_0x0839('0xe')](_0x0839('0x13'),_0x11a3ff);return _0xbf87a3(null,![],{'message':_0x0839('0x12')});}return db[_0x0839('0x14')][_0x0839('0x15')]({'where':{'id':0x1},'attributes':[_0x0839('0x16'),_0x0839('0x17')],'raw':!![]})[_0x0839('0x18')](function(_0xf5d2d2){_0x3f7226=_0xf5d2d2;if(!_0x3f7226[_0x0839('0x16')]){logger[_0x0839('0xe')](_0x0839('0x19'),_0x11a3ff);throw new Error(_0x0839('0x12'));}return _0x2b8b48['findOne']({'attributes':['id',_0x0839('0x1a'),_0x0839('0x1b'),'salt',_0x0839('0x1c'),'disabled',_0x0839('0x1d'),_0x0839('0x1e'),'online'],'where':{'name':_0x11a3ff,'role':{'$or':[_0x0839('0x1f'),_0x0839('0x20'),_0x0839('0x21')]},'adSsoEnabled':!![]}});})[_0x0839('0x18')](function(_0x31b98d){if(!_0x31b98d||_0x31b98d&&_0x31b98d[_0x0839('0x1a')]!==_0x11a3ff){throw new Error(_0x0839('0x12'));}_0x5a9ebb=_0x31b98d;var _0x393193=_0x5a9ebb[_0x0839('0x1a')]+'@'+config[_0x0839('0xb')][_0x0839('0xd')];return adAuthenticate(config[_0x0839('0xb')],_0x393193,_0xd32e4a);})['then'](function(_0x48e42c){if(_0x5a9ebb[_0x0839('0x22')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x3f7226[_0x0839('0x17')]>0x0){if(_0x5a9ebb[_0x0839('0x1d')]){if(moment(_0x5a9ebb[_0x0839('0x1e')])[_0x0839('0x23')](_0x3f7226[_0x0839('0x17')],_0x0839('0x24'))>moment()){throw new Error(_0x0839('0x12'));}return utils['clearBlockUser'](_0x5a9ebb,0x0,![],null)[_0x0839('0x18')](function(){return utils[_0x0839('0x25')](_0x5a9ebb);})[_0x0839('0x18')](function(){return _0xbf87a3(null,_0x5a9ebb);});}else{return utils[_0x0839('0x25')](_0x5a9ebb)[_0x0839('0x18')](function(){return _0xbf87a3(null,_0x5a9ebb);});}}else{return utils['getLicense'](_0x5a9ebb)['then'](function(){return _0xbf87a3(null,_0x5a9ebb);});}})['catch'](function(_0x1f5389){return _0xbf87a3(null,![],_0x1f5389);});}function handleError(_0x5d833c,_0x444353,_0x567f11){return _0x5d833c['status'](_0x444353||0x1f4)[_0x0839('0x26')]({'message':_0x567f11?_0x567f11[_0x0839('0x27')]||_0x567f11:''});}exports[_0x0839('0x28')]=function(_0x3273e5,_0x24c740,_0x4eb7fe){passport[_0x0839('0x29')](_0x0839('0x2a'),function(_0x59fe62,_0x301a49,_0x40a495){var _0x4733eb=_0x59fe62||_0x40a495;if(_0x4733eb){return handleError(_0x24c740,0x191,_0x4733eb);}if(!_0x301a49){return handleError(_0x24c740,0x194,{'message':_0x0839('0x2b')});}else{var _0x27e15a={'payload':{'id':_0x301a49['id'],'role':_0x301a49[_0x0839('0x1c')]},'options':{'expiresIn':0x15180}};return authService[_0x0839('0x2c')](_0x27e15a)[_0x0839('0x18')](function(_0x2fd00f){_0x24c740[_0x0839('0x2d')]({'id':_0x301a49['id'],'token':_0x2fd00f,'statusCall':'','isAlreadyLogged':_0x301a49[_0x0839('0x2e')]});});}})(_0x3273e5,_0x24c740,_0x4eb7fe);};passport[_0x0839('0x2f')](_0x0839('0x2a'),new LocalStrategy({'usernameField':_0x0839('0x1a'),'passwordField':_0x0839('0x1b')},function(_0x34d2a0,_0x523a1c,_0x3ee66e){return ActiveDirectoryAuthenticate(db['User'],_0x34d2a0,_0x523a1c,_0x3ee66e);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index 73910dc..fd2ab9a 100644 --- a/server/api/authActiveDirectory/index.js +++ b/server/api/authActiveDirectory/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2361=['Router','./authActiveDirectory.controller','post','exports'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x2361,0x150));var _0x1236=function(_0x19b941,_0x61476f){_0x19b941=_0x19b941-0x0;var _0x222d17=_0x2361[_0x19b941];return _0x222d17;};'use strict';var express=require('express');var router=express[_0x1236('0x0')]();var controller=require(_0x1236('0x1'));router[_0x1236('0x2')]('/',controller['login']);module[_0x1236('0x3')]=router; \ No newline at end of file +var _0x2982=['post','login','exports','Router','./authActiveDirectory.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2982,0x8f));var _0x2298=function(_0x437956,_0xb80d14){_0x437956=_0x437956-0x0;var _0xc59bf6=_0x2982[_0x437956];return _0xc59bf6;};'use strict';var express=require('express');var router=express[_0x2298('0x0')]();var controller=require(_0x2298('0x1'));router[_0x2298('0x2')]('/',controller[_0x2298('0x3')]);module[_0x2298('0x4')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index d80f377..0410aa4 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 _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x4c60cc,_0x42acaf){var _0x26c875=function(_0x52e0de){while(--_0x52e0de){_0x4c60cc['push'](_0x4c60cc['shift']());}};_0x26c875(++_0x42acaf);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});})); \ No newline at end of file +var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x7a54,0x106));var _0x47a5=function(_0x2a9910,_0x22a2ab){_0x2a9910=_0x2a9910-0x0;var _0x426cf4=_0x7a54[_0x2a9910];return _0x426cf4;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index bc527c3..bfcc599 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 _0xa807=['./authGoogle.controller','get','login','/callback','setTokenCookie','exports','express','passport','Router'];(function(_0x55e907,_0x317402){var _0x20ac83=function(_0x10a88c){while(--_0x10a88c){_0x55e907['push'](_0x55e907['shift']());}};_0x20ac83(++_0x317402);}(_0xa807,0x1e3));var _0x7a80=function(_0x5c9630,_0x2ac5a0){_0x5c9630=_0x5c9630-0x0;var _0x1a724=_0xa807[_0x5c9630];return _0x1a724;};'use strict';var express=require(_0x7a80('0x0'));var passport=require(_0x7a80('0x1'));var router=express[_0x7a80('0x2')]();var controller=require(_0x7a80('0x3'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x7a80('0x4')]('/',controller[_0x7a80('0x5')]);router[_0x7a80('0x4')](_0x7a80('0x6'),controller['callback'],authService['isMiddleware'],userController[_0x7a80('0x5')],authService[_0x7a80('0x7')]);module[_0x7a80('0x8')]=router; \ No newline at end of file +var _0x01e3=['isMiddleware','login','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','get','/callback'];(function(_0x43d11d,_0xccff91){var _0x38cd08=function(_0x131ae2){while(--_0x131ae2){_0x43d11d['push'](_0x43d11d['shift']());}};_0x38cd08(++_0xccff91);}(_0x01e3,0x122));var _0x301e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x01e3[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x301e('0x0'));var passport=require(_0x301e('0x1'));var router=express[_0x301e('0x2')]();var controller=require(_0x301e('0x3'));var userController=require(_0x301e('0x4'));var authService=require('../../components/auth/service');router[_0x301e('0x5')]('/',controller['login']);router['get'](_0x301e('0x6'),controller['callback'],authService[_0x301e('0x7')],userController[_0x301e('0x8')],authService[_0x301e('0x9')]);module[_0x301e('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 1455a12..b8541a9 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 _0xbe72=['online','forgot','body','email','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','https://','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','securePassword','passwordHistoryLimit','validatePasswordPattern','enforcePasswordHistory','validatePasswordHistory','resetPasswordToken','Password\x20reset!','use','util','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../components/auth/service','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','loginAttempts','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockedAt','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','user','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','json'];(function(_0x3712c6,_0x178102){var _0x15ab9b=function(_0x324474){while(--_0x324474){_0x3712c6['push'](_0x3712c6['shift']());}};_0x15ab9b(++_0x178102);}(_0xbe72,0x6d));var _0x2be7=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xbe72[_0x311c35];return _0x5cc50c;};'use strict';var util=require(_0x2be7('0x0'));var passport=require('passport');var LocalStrategy=require(_0x2be7('0x1'))[_0x2be7('0x2')];var jayson=require(_0x2be7('0x3'));var _=require(_0x2be7('0x4'));var rs=require(_0x2be7('0x5'));var moment=require(_0x2be7('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x2be7('0x7'));var utils=require(_0x2be7('0x8'));var client=jayson[_0x2be7('0x9')]['http']({'port':0x232b});function localAuthenticate(_0x47418d,_0x28a202,_0x49be6b,_0x3b07bc){var _0x26cb7a,_0x355b00;return db[_0x2be7('0xa')][_0x2be7('0xb')]({'where':{'id':0x1},'attributes':[_0x2be7('0xc'),_0x2be7('0xd')],'raw':!![]})[_0x2be7('0xe')](function(_0x492aff){_0x26cb7a=_0x492aff;return _0x47418d[_0x2be7('0xb')]({'attributes':['id',_0x2be7('0xf'),_0x2be7('0x10'),_0x2be7('0x11'),_0x2be7('0x12'),_0x2be7('0x13'),_0x2be7('0x14'),'blockedAt',_0x2be7('0x15')],'where':{'name':_0x28a202,'role':{'$or':['admin','user',_0x2be7('0x16')]}}});})[_0x2be7('0xe')](function(_0x4498d4){if(!_0x4498d4||_0x4498d4&&_0x4498d4[_0x2be7('0xf')]!==_0x28a202){throw new Error(_0x2be7('0x17'));}else{_0x355b00=_0x4498d4;return _0x355b00;}})[_0x2be7('0xe')](function(){_0x355b00['authenticate'](_0x49be6b,function(_0x5dc5f4,_0x1dfc3e){var _0x3d7939=_0x355b00[_0x2be7('0x15')]+0x1;if(_0x5dc5f4){return _0x3b07bc(_0x5dc5f4);}else if(!_0x1dfc3e){if(_0x355b00[_0x2be7('0x13')]){return _0x3b07bc(null,![],{'message':_0x2be7('0x17')});}else if(_0x26cb7a['allowedLoginAttempts']>0x0){if(_0x355b00[_0x2be7('0x14')]){if(_0x26cb7a['blockDuration']>0x0){if(moment(_0x355b00[_0x2be7('0x18')])[_0x2be7('0x19')](_0x26cb7a['blockDuration'],_0x2be7('0x1a'))>moment()){return _0x3b07bc(null,![],{'message':_0x2be7('0x17')});}else{return utils['clearBlockUser'](_0x355b00,_0x3d7939,![],null)[_0x2be7('0xe')](function(){return _0x3b07bc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x3b07bc(null,![],{'message':_0x2be7('0x17')});}}else{if(_0x3d7939>=_0x26cb7a[_0x2be7('0xc')]){return utils[_0x2be7('0x1b')](_0x355b00,0x0,!![],moment())[_0x2be7('0xe')](function(){return _0x3b07bc(null,![],{'message':_0x2be7('0x17')});});}else{return utils['clearBlockUser'](_0x355b00,_0x3d7939,![],null)[_0x2be7('0xe')](function(){return _0x3b07bc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x3b07bc(null,![],{'message':_0x2be7('0x17')});}}else{if(_0x355b00[_0x2be7('0x13')]){return _0x3b07bc(null,![],{'message':_0x2be7('0x17')});}else if(_0x26cb7a[_0x2be7('0xc')]>0x0){if(_0x355b00[_0x2be7('0x14')]){if(_0x26cb7a[_0x2be7('0xd')]>0x0){if(moment(_0x355b00['blockedAt'])[_0x2be7('0x19')](_0x26cb7a['blockDuration'],'minutes')>moment()){return _0x3b07bc(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['clearBlockUser'](_0x355b00,0x0,![],null)[_0x2be7('0xe')](function(){return utils[_0x2be7('0x1c')](_0x355b00);})[_0x2be7('0xe')](function(){return _0x3b07bc(null,_0x355b00);});}}else{return _0x3b07bc(null,![],{'message':_0x2be7('0x17')});}}else{return utils[_0x2be7('0x1b')](_0x355b00,0x0,![],null)[_0x2be7('0xe')](function(){return utils['getLicense'](_0x355b00);})[_0x2be7('0xe')](function(){return _0x3b07bc(null,_0x355b00);})['catch'](function(_0x2f309d){return _0x3b07bc(null,![],_0x2f309d);});}}else{if(_0x355b00[_0x2be7('0x14')]){return _0x3b07bc(null,![],{'message':_0x2be7('0x17')});}else{return utils[_0x2be7('0x1c')](_0x355b00)[_0x2be7('0xe')](function(){return _0x3b07bc(null,_0x355b00);});}}}});})[_0x2be7('0x1d')](function(_0x179180){return _0x3b07bc(null,![],_0x179180);});}function sendServiceMail(_0xc6949c){return db[_0x2be7('0x1e')][_0x2be7('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x2be7('0xf'),'email'],'include':[{'model':db[_0x2be7('0x20')],'as':_0x2be7('0x21'),'include':[{'model':db[_0x2be7('0x22')],'as':_0x2be7('0x22')}]}]})[_0x2be7('0xe')](function(_0x4fa96e){if(!_0x4fa96e){throw new Error(_0x2be7('0x23'));}var _0xcaa196=_0x4fa96e[_0x2be7('0x24')]();var _0x297839={'account':_0xcaa196,'message':_[_0x2be7('0x25')]({'from':util[_0x2be7('0x26')](_0x2be7('0x27'),_0x4fa96e[_0x2be7('0xf')],_0x4fa96e['email']||_0x4fa96e[_0x2be7('0x21')][_0x2be7('0x28')])},_0xc6949c)};return client[_0x2be7('0x29')]('SendMail',_0x297839);})[_0x2be7('0xe')](function(_0x3e18fe){if(_0x3e18fe[_0x2be7('0x2a')]){throw new Error(util[_0x2be7('0x26')](_0x2be7('0x2b'),_0x3e18fe[_0x2be7('0x2a')][_0x2be7('0x2c')]||JSON[_0x2be7('0x2d')](_0x3e18fe[_0x2be7('0x2a')])));}return!![];});}function handleError(_0x41e7d3,_0x11cea2,_0x1f721c){return _0x41e7d3[_0x2be7('0x2e')](_0x11cea2||0x1f4)[_0x2be7('0x2f')]({'message':_0x1f721c?_0x1f721c[_0x2be7('0x2c')]||_0x1f721c:''});}exports[_0x2be7('0x30')]=function(_0x3614ca,_0x27d3be,_0x159818){passport['authenticate'](_0x2be7('0x31'),function(_0x61a87f,_0x53da36,_0x3f96e1){var _0x13e459=_0x61a87f||_0x3f96e1;if(_0x13e459){return handleError(_0x27d3be,0x191,_0x13e459);}if(!_0x53da36){return handleError(_0x27d3be,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x596d0f={'payload':{'id':_0x53da36['id'],'role':_0x53da36[_0x2be7('0x12')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x596d0f)[_0x2be7('0xe')](function(_0x761f94){_0x27d3be[_0x2be7('0x32')]({'id':_0x53da36['id'],'token':_0x761f94,'statusCall':'','isAlreadyLogged':_0x53da36[_0x2be7('0x33')]});});}})(_0x3614ca,_0x27d3be,_0x159818);};exports[_0x2be7('0x34')]=function(_0xdb7266,_0x2e572e){if(!_0xdb7266[_0x2be7('0x35')][_0x2be7('0x36')]){return handleError(_0x2e572e,0x1f4,{'message':_0x2be7('0x37')});}var _0x2897bc=rs[_0x2be7('0x38')]();_0xdb7266[_0x2be7('0x35')][_0x2be7('0x36')]=_0xdb7266['body']['email'][_0x2be7('0x39')]()[_0x2be7('0x3a')]();var _0x2ced07;return db[_0x2be7('0xa')][_0x2be7('0xb')]({'where':{'id':0x1},'attributes':[_0x2be7('0xc'),'blockDuration'],'raw':!![]})['then'](function(_0x572595){_0x2ced07=_0x572595;return db[_0x2be7('0x3b')][_0x2be7('0x1f')]({'where':{'email':_0xdb7266[_0x2be7('0x35')][_0x2be7('0x36')]}});})[_0x2be7('0xe')](function(_0x4d3901){if(!_0x4d3901){throw new Error(_0x2be7('0x3c'));}if(_0x4d3901[_0x2be7('0x13')]){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x4d3901[_0x2be7('0x14')]){if(moment(_0x4d3901[_0x2be7('0x18')])[_0x2be7('0x19')](_0x2ced07[_0x2be7('0xd')],_0x2be7('0x1a'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x4d3901['blocked']=![];_0x4d3901[_0x2be7('0x18')]=null;}}_0x4d3901['resetPasswordToken']=_0x2897bc;_0x4d3901[_0x2be7('0x3d')]=Date[_0x2be7('0x3e')]()+0x36ee80;return _0x4d3901[_0x2be7('0x3f')]();})[_0x2be7('0xe')](function(){return sendServiceMail({'to':_0xdb7266[_0x2be7('0x35')]['email'],'subject':_0x2be7('0x40'),'text':'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'+_0x2be7('0x41')+_0xdb7266['headers']['host']+_0x2be7('0x42')+_0x2897bc+'\x0a\x0a'+_0x2be7('0x43')});})[_0x2be7('0xe')](function(){_0x2e572e[_0x2be7('0x2e')](0xc8)[_0x2be7('0x2f')]({'message':_0x2be7('0x44')});})['catch'](function(_0x3825a1){return handleError(_0x2e572e,0x1f4,_0x3825a1);});};exports[_0x2be7('0x45')]=function(_0x5a7a2b,_0x4fe1a2){return db[_0x2be7('0x3b')]['find']({'where':{'resetPasswordToken':_0x5a7a2b[_0x2be7('0x46')][_0x2be7('0x47')],'resetPasswordExpires':{'$gt':Date[_0x2be7('0x3e')]()}}})[_0x2be7('0xe')](function(_0x3498a3){if(!_0x3498a3){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x2be7('0xa')]['findOne']({'attributes':['id',_0x2be7('0x48'),'enforcePasswordHistory',_0x2be7('0x49')]})[_0x2be7('0xe')](function(_0x768d9d){if(_0x768d9d[_0x2be7('0x48')])authService[_0x2be7('0x4a')](_0x5a7a2b[_0x2be7('0x35')][_0x2be7('0x10')]);if(!_0x768d9d[_0x2be7('0x4b')]||!_0x3498a3['previousPasswords'])return _0x3498a3;authService[_0x2be7('0x4c')](_0x5a7a2b['body'][_0x2be7('0x10')],_0x3498a3['previousPasswords'],_0x768d9d['passwordHistoryLimit']);return _0x3498a3;})[_0x2be7('0xe')](function(){_0x3498a3[_0x2be7('0x10')]=_0x5a7a2b[_0x2be7('0x35')][_0x2be7('0x10')];_0x3498a3[_0x2be7('0x4d')]=null;_0x3498a3['resetPasswordExpires']=null;return _0x3498a3[_0x2be7('0x3f')]();});})[_0x2be7('0xe')](function(){_0x4fe1a2['status'](0xc8)['send']({'message':_0x2be7('0x4e')});})[_0x2be7('0x1d')](function(_0x289584){return handleError(_0x4fe1a2,0x1f4,_0x289584);});};passport[_0x2be7('0x4f')](_0x2be7('0x31'),new LocalStrategy({'usernameField':_0x2be7('0xf'),'passwordField':_0x2be7('0x10')},function(_0x3390cb,_0x16df06,_0x58cebb){return localAuthenticate(db[_0x2be7('0x3b')],_0x3390cb,_0x16df06,_0x58cebb);})); \ No newline at end of file +var _0x4265=['Setting','securePassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','local-login','util','passport','passport-local','jayson/promise','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','add','minutes','clearBlockUser','blockedAt','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','user','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','User','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','https://','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset'];(function(_0x278698,_0x4bf078){var _0x4e5a64=function(_0x3eead7){while(--_0x3eead7){_0x278698['push'](_0x278698['shift']());}};_0x4e5a64(++_0x4bf078);}(_0x4265,0xb1));var _0x5426=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x4265[_0x4a9fb1];return _0x348672;};'use strict';var util=require(_0x5426('0x0'));var passport=require(_0x5426('0x1'));var LocalStrategy=require(_0x5426('0x2'))['Strategy'];var jayson=require(_0x5426('0x3'));var _=require('lodash');var rs=require(_0x5426('0x4'));var moment=require('moment');var db=require(_0x5426('0x5'))['db'];var authService=require(_0x5426('0x6'));var utils=require(_0x5426('0x7'));var client=jayson[_0x5426('0x8')][_0x5426('0x9')]({'port':0x232b});function localAuthenticate(_0x31a3b7,_0x5aec23,_0x1ab3b2,_0x1f12da){var _0x213a5d,_0x32af87;return db['Setting'][_0x5426('0xa')]({'where':{'id':0x1},'attributes':[_0x5426('0xb'),_0x5426('0xc')],'raw':!![]})[_0x5426('0xd')](function(_0x16c269){_0x213a5d=_0x16c269;return _0x31a3b7[_0x5426('0xa')]({'attributes':['id',_0x5426('0xe'),_0x5426('0xf'),_0x5426('0x10'),_0x5426('0x11'),_0x5426('0x12'),_0x5426('0x13'),'blockedAt','loginAttempts'],'where':{'name':_0x5aec23,'role':{'$or':[_0x5426('0x14'),'user',_0x5426('0x15')]}}});})['then'](function(_0x2bd666){if(!_0x2bd666||_0x2bd666&&_0x2bd666[_0x5426('0xe')]!==_0x5aec23){throw new Error(_0x5426('0x16'));}else{_0x32af87=_0x2bd666;return _0x32af87;}})[_0x5426('0xd')](function(){_0x32af87[_0x5426('0x17')](_0x1ab3b2,function(_0x548a55,_0x18959c){var _0x50e0ca=_0x32af87[_0x5426('0x18')]+0x1;if(_0x548a55){return _0x1f12da(_0x548a55);}else if(!_0x18959c){if(_0x32af87[_0x5426('0x12')]){return _0x1f12da(null,![],{'message':_0x5426('0x16')});}else if(_0x213a5d[_0x5426('0xb')]>0x0){if(_0x32af87[_0x5426('0x13')]){if(_0x213a5d[_0x5426('0xc')]>0x0){if(moment(_0x32af87['blockedAt'])[_0x5426('0x19')](_0x213a5d['blockDuration'],_0x5426('0x1a'))>moment()){return _0x1f12da(null,![],{'message':_0x5426('0x16')});}else{return utils['clearBlockUser'](_0x32af87,_0x50e0ca,![],null)[_0x5426('0xd')](function(){return _0x1f12da(null,![],{'message':_0x5426('0x16')});});}}else{return _0x1f12da(null,![],{'message':_0x5426('0x16')});}}else{if(_0x50e0ca>=_0x213a5d['allowedLoginAttempts']){return utils[_0x5426('0x1b')](_0x32af87,0x0,!![],moment())['then'](function(){return _0x1f12da(null,![],{'message':_0x5426('0x16')});});}else{return utils[_0x5426('0x1b')](_0x32af87,_0x50e0ca,![],null)[_0x5426('0xd')](function(){return _0x1f12da(null,![],{'message':_0x5426('0x16')});});}}}else{return _0x1f12da(null,![],{'message':_0x5426('0x16')});}}else{if(_0x32af87[_0x5426('0x12')]){return _0x1f12da(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x213a5d['allowedLoginAttempts']>0x0){if(_0x32af87[_0x5426('0x13')]){if(_0x213a5d[_0x5426('0xc')]>0x0){if(moment(_0x32af87[_0x5426('0x1c')])['add'](_0x213a5d[_0x5426('0xc')],_0x5426('0x1a'))>moment()){return _0x1f12da(null,![],{'message':_0x5426('0x16')});}else{return utils['clearBlockUser'](_0x32af87,0x0,![],null)[_0x5426('0xd')](function(){return utils['getLicense'](_0x32af87);})[_0x5426('0xd')](function(){return _0x1f12da(null,_0x32af87);});}}else{return _0x1f12da(null,![],{'message':_0x5426('0x16')});}}else{return utils[_0x5426('0x1b')](_0x32af87,0x0,![],null)[_0x5426('0xd')](function(){return utils[_0x5426('0x1d')](_0x32af87);})[_0x5426('0xd')](function(){return _0x1f12da(null,_0x32af87);})['catch'](function(_0x3e832d){return _0x1f12da(null,![],_0x3e832d);});}}else{if(_0x32af87[_0x5426('0x13')]){return _0x1f12da(null,![],{'message':_0x5426('0x16')});}else{return utils[_0x5426('0x1d')](_0x32af87)[_0x5426('0xd')](function(){return _0x1f12da(null,_0x32af87);});}}}});})[_0x5426('0x1e')](function(_0x384ccf){return _0x1f12da(null,![],_0x384ccf);});}function sendServiceMail(_0x1a1e94){return db[_0x5426('0x1f')][_0x5426('0x20')]({'where':{'service':!![]},'attributes':['id','name',_0x5426('0x21')],'include':[{'model':db[_0x5426('0x22')],'as':_0x5426('0x23'),'include':[{'model':db['CloudProvider'],'as':_0x5426('0x24')}]}]})['then'](function(_0x2e2157){if(!_0x2e2157){throw new Error(_0x5426('0x25'));}var _0xa54679=_0x2e2157[_0x5426('0x26')]();var _0x243038={'account':_0xa54679,'message':_[_0x5426('0x27')]({'from':util[_0x5426('0x28')](_0x5426('0x29'),_0x2e2157[_0x5426('0xe')],_0x2e2157['email']||_0x2e2157[_0x5426('0x23')][_0x5426('0x2a')])},_0x1a1e94)};return client[_0x5426('0x2b')](_0x5426('0x2c'),_0x243038);})[_0x5426('0xd')](function(_0x47400d){if(_0x47400d[_0x5426('0x2d')]){throw new Error(util[_0x5426('0x28')](_0x5426('0x2e'),_0x47400d['error'][_0x5426('0x2f')]||JSON[_0x5426('0x30')](_0x47400d['error'])));}return!![];});}function handleError(_0x284e38,_0x590323,_0x5cf6eb){return _0x284e38[_0x5426('0x31')](_0x590323||0x1f4)[_0x5426('0x32')]({'message':_0x5cf6eb?_0x5cf6eb['message']||_0x5cf6eb:''});}exports[_0x5426('0x33')]=function(_0x37cb64,_0x445d56,_0x13ba94){passport['authenticate']('local-login',function(_0x2aa6bb,_0x12fc8e,_0x1ce218){var _0x2fdbbb=_0x2aa6bb||_0x1ce218;if(_0x2fdbbb){return handleError(_0x445d56,0x191,_0x2fdbbb);}if(!_0x12fc8e){return handleError(_0x445d56,0x194,{'message':_0x5426('0x34')});}else{var _0x371b5b={'payload':{'id':_0x12fc8e['id'],'role':_0x12fc8e[_0x5426('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x5426('0x35')](_0x371b5b)['then'](function(_0x51f2ee){_0x445d56[_0x5426('0x36')]({'id':_0x12fc8e['id'],'token':_0x51f2ee,'statusCall':'','isAlreadyLogged':_0x12fc8e[_0x5426('0x37')]});});}})(_0x37cb64,_0x445d56,_0x13ba94);};exports['forgot']=function(_0x57019f,_0x1f255e){if(!_0x57019f['body'][_0x5426('0x21')]){return handleError(_0x1f255e,0x1f4,{'message':_0x5426('0x38')});}var _0x16d6c0=rs[_0x5426('0x39')]();_0x57019f[_0x5426('0x3a')][_0x5426('0x21')]=_0x57019f[_0x5426('0x3a')]['email']['trim']()[_0x5426('0x3b')]();var _0x582e1a;return db['Setting'][_0x5426('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x5426('0xc')],'raw':!![]})[_0x5426('0xd')](function(_0x1169ab){_0x582e1a=_0x1169ab;return db[_0x5426('0x3c')][_0x5426('0x20')]({'where':{'email':_0x57019f[_0x5426('0x3a')][_0x5426('0x21')]}});})['then'](function(_0x30575d){if(!_0x30575d){throw new Error(_0x5426('0x3d'));}if(_0x30575d[_0x5426('0x12')]){throw new Error(_0x5426('0x3e'));}if(_0x30575d['blocked']){if(moment(_0x30575d[_0x5426('0x1c')])[_0x5426('0x19')](_0x582e1a[_0x5426('0xc')],_0x5426('0x1a'))>moment()){throw new Error(_0x5426('0x3f'));}else{_0x30575d[_0x5426('0x13')]=![];_0x30575d['blockedAt']=null;}}_0x30575d[_0x5426('0x40')]=_0x16d6c0;_0x30575d[_0x5426('0x41')]=Date[_0x5426('0x42')]()+0x36ee80;return _0x30575d['save']();})[_0x5426('0xd')](function(){return sendServiceMail({'to':_0x57019f[_0x5426('0x3a')]['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'+_0x5426('0x43')+_0x5426('0x44')+_0x57019f[_0x5426('0x45')][_0x5426('0x46')]+_0x5426('0x47')+_0x16d6c0+'\x0a\x0a'+_0x5426('0x48')});})[_0x5426('0xd')](function(){_0x1f255e[_0x5426('0x31')](0xc8)[_0x5426('0x32')]({'message':_0x5426('0x49')});})['catch'](function(_0x3ed169){return handleError(_0x1f255e,0x1f4,_0x3ed169);});};exports[_0x5426('0x4a')]=function(_0x587251,_0x1dbd8a){return db[_0x5426('0x3c')][_0x5426('0x20')]({'where':{'resetPasswordToken':_0x587251['params']['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x5426('0xd')](function(_0x9c3029){if(!_0x9c3029){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x5426('0x4b')][_0x5426('0xa')]({'attributes':['id',_0x5426('0x4c'),_0x5426('0x4d'),'passwordHistoryLimit']})[_0x5426('0xd')](function(_0x45b9db){if(_0x45b9db[_0x5426('0x4c')])authService['validatePasswordPattern'](_0x587251['body'][_0x5426('0xf')]);if(!_0x45b9db[_0x5426('0x4d')]||!_0x9c3029[_0x5426('0x4e')])return _0x9c3029;authService[_0x5426('0x4f')](_0x587251[_0x5426('0x3a')][_0x5426('0xf')],_0x9c3029[_0x5426('0x4e')],_0x45b9db['passwordHistoryLimit']);return _0x9c3029;})[_0x5426('0xd')](function(){_0x9c3029[_0x5426('0xf')]=_0x587251[_0x5426('0x3a')][_0x5426('0xf')];_0x9c3029[_0x5426('0x40')]=null;_0x9c3029[_0x5426('0x41')]=null;return _0x9c3029[_0x5426('0x50')]();});})[_0x5426('0xd')](function(){_0x1dbd8a[_0x5426('0x31')](0xc8)[_0x5426('0x32')]({'message':_0x5426('0x51')});})[_0x5426('0x1e')](function(_0x887bec){return handleError(_0x1dbd8a,0x1f4,_0x887bec);});};passport[_0x5426('0x52')](_0x5426('0x53'),new LocalStrategy({'usernameField':_0x5426('0xe'),'passwordField':'password'},function(_0x4b7475,_0x101d8e,_0x23112b){return localAuthenticate(db['User'],_0x4b7475,_0x101d8e,_0x23112b);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 5381d83..62f89d2 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 _0x93d1=['forgot','/reset/:token','reset','Router','post','login'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x93d1,0xab));var _0x193d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x93d1[_0x3dd15e];return _0x231fd0;};'use strict';var express=require('express');var router=express[_0x193d('0x0')]();var controller=require('./authLocal.controller');router[_0x193d('0x1')]('/',controller[_0x193d('0x2')]);router['post']('/forgot',controller[_0x193d('0x3')]);router[_0x193d('0x1')](_0x193d('0x4'),controller[_0x193d('0x5')]);module['exports']=router; \ No newline at end of file +var _0x77e1=['./authLocal.controller','post','forgot','/reset/:token','reset','exports','express','Router'];(function(_0x1b70e3,_0x3a15b1){var _0x1452ab=function(_0x692883){while(--_0x692883){_0x1b70e3['push'](_0x1b70e3['shift']());}};_0x1452ab(++_0x3a15b1);}(_0x77e1,0x13e));var _0x177e=function(_0x1a064a,_0x3fedcf){_0x1a064a=_0x1a064a-0x0;var _0x5abbc8=_0x77e1[_0x1a064a];return _0x5abbc8;};'use strict';var express=require(_0x177e('0x0'));var router=express[_0x177e('0x1')]();var controller=require(_0x177e('0x2'));router[_0x177e('0x3')]('/',controller['login']);router[_0x177e('0x3')]('/forgot',controller[_0x177e('0x4')]);router[_0x177e('0x3')](_0x177e('0x5'),controller[_0x177e('0x6')]);module[_0x177e('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 48d4756..cf168e6 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 _0xad1f=['STRING','INTEGER','sequelize','exports'];(function(_0x112b01,_0x7fbb25){var _0x2af193=function(_0x43198c){while(--_0x43198c){_0x112b01['push'](_0x112b01['shift']());}};_0x2af193(++_0x7fbb25);}(_0xad1f,0x13e));var _0xfad1=function(_0xc83e25,_0x5b5aaa){_0xc83e25=_0xc83e25-0x0;var _0x3a8424=_0xad1f[_0xc83e25];return _0x3a8424;};'use strict';var Sequelize=require(_0xfad1('0x0'));module[_0xfad1('0x1')]={'name':{'type':Sequelize[_0xfad1('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfad1('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xfad1('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x6d15=['STRING','INTEGER','sequelize','exports'];(function(_0x226e53,_0x26ed06){var _0x571b89=function(_0x288163){while(--_0x288163){_0x226e53['push'](_0x226e53['shift']());}};_0x571b89(++_0x26ed06);}(_0x6d15,0x10a));var _0x56d1=function(_0x46eed4,_0x23d556){_0x46eed4=_0x46eed4-0x0;var _0x1a6d1b=_0x6d15[_0x46eed4];return _0x1a6d1b;};'use strict';var Sequelize=require(_0x56d1('0x0'));module[_0x56d1('0x1')]={'name':{'type':Sequelize[_0x56d1('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x56d1('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0x56d1('0x3')],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index b0d06c8..d6478f4 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 _0xa180=['show','params','keys','rawAttributes','filters','fields','length','options','create','body','update','find','addConditions','Condition','ids','omit','findOne','getConditions','addActions','Action','getActions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','save','then','destroy','end','name','send','index','map','Automation','fieldName','type','key','model','query','attributes','intersection','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch'];(function(_0x5e9920,_0x3dbf38){var _0x1adeba=function(_0x3f9c1d){while(--_0x3f9c1d){_0x5e9920['push'](_0x5e9920['shift']());}};_0x1adeba(++_0x3dbf38);}(_0xa180,0x1b9));var _0x0a18=function(_0x1d272c,_0x337619){_0x1d272c=_0x1d272c-0x0;var _0x30423e=_0xa180[_0x1d272c];return _0x30423e;};'use strict';var emlformat=require(_0x0a18('0x0'));var rimraf=require(_0x0a18('0x1'));var zipdir=require(_0x0a18('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a18('0x3'));var BPromise=require(_0x0a18('0x4'));var Mustache=require(_0x0a18('0x5'));var util=require('util');var path=require(_0x0a18('0x6'));var sox=require(_0x0a18('0x7'));var csv=require(_0x0a18('0x8'));var ejs=require(_0x0a18('0x9'));var fs=require('fs');var fs_extra=require(_0x0a18('0xa'));var _=require('lodash');var squel=require(_0x0a18('0xb'));var crypto=require(_0x0a18('0xc'));var jsforce=require(_0x0a18('0xd'));var deskjs=require(_0x0a18('0xe'));var toCsv=require(_0x0a18('0x8'));var querystring=require(_0x0a18('0xf'));var Papa=require('papaparse');var Redis=require(_0x0a18('0x10'));var authService=require(_0x0a18('0x11'));var qs=require(_0x0a18('0x12'));var as=require(_0x0a18('0x13'));var hardwareService=require(_0x0a18('0x14'));var logger=require('../../config/logger')(_0x0a18('0x15'));var utils=require('../../config/utils');var config=require(_0x0a18('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a18('0x17'))['db'];function respondWithStatusCode(_0x2ec77c,_0x560348){_0x560348=_0x560348||0xcc;return function(_0x1ec720){if(_0x1ec720){return _0x2ec77c[_0x0a18('0x18')](_0x560348);}return _0x2ec77c['status'](_0x560348)['end']();};}function respondWithResult(_0x281000,_0x52a0ff){_0x52a0ff=_0x52a0ff||0xc8;return function(_0x2a0cee){if(_0x2a0cee){return _0x281000[_0x0a18('0x19')](_0x52a0ff)[_0x0a18('0x1a')](_0x2a0cee);}};}function respondWithFilteredResult(_0x35573b,_0x1eb825){return function(_0x582a3f){if(_0x582a3f){var _0x2d1c0c=typeof _0x1eb825[_0x0a18('0x1b')]===_0x0a18('0x1c')&&typeof _0x1eb825['limit']==='undefined';var _0x35d370=_0x582a3f['count'];var _0x10b3af=_0x2d1c0c?0x0:_0x1eb825[_0x0a18('0x1b')];var _0x52cc51=_0x2d1c0c?_0x582a3f[_0x0a18('0x1d')]:_0x1eb825[_0x0a18('0x1b')]+_0x1eb825['limit'];var _0x48bccd;if(_0x52cc51>=_0x35d370){_0x52cc51=_0x35d370;_0x48bccd=0xc8;}else{_0x48bccd=0xce;}_0x35573b[_0x0a18('0x19')](_0x48bccd);return _0x35573b[_0x0a18('0x1e')](_0x0a18('0x1f'),_0x10b3af+'-'+_0x52cc51+'/'+_0x35d370)[_0x0a18('0x1a')](_0x582a3f);}return null;};}function patchUpdates(_0x319dc1){return function(_0x2c135d){try{jsonpatch['apply'](_0x2c135d,_0x319dc1,!![]);}catch(_0x45280e){return BPromise[_0x0a18('0x20')](_0x45280e);}return _0x2c135d[_0x0a18('0x21')]();};}function saveUpdates(_0x2a6c40,_0x27b4ca){return function(_0x19d8ed){if(_0x19d8ed){return _0x19d8ed['update'](_0x2a6c40)[_0x0a18('0x22')](function(_0x2f03cd){return _0x2f03cd;});}return null;};}function removeEntity(_0x2f387b,_0xe8c24c){return function(_0x2871ef){if(_0x2871ef){return _0x2871ef[_0x0a18('0x23')]()[_0x0a18('0x22')](function(){_0x2f387b[_0x0a18('0x19')](0xcc)[_0x0a18('0x24')]();});}};}function handleEntityNotFound(_0x28ebe3,_0x1f0aff){return function(_0x3d462a){if(!_0x3d462a){_0x28ebe3[_0x0a18('0x18')](0x194);}return _0x3d462a;};}function handleError(_0x1a4945,_0x512f93){_0x512f93=_0x512f93||0x1f4;return function(_0xa2dc5){logger['error'](_0xa2dc5['stack']);if(_0xa2dc5[_0x0a18('0x25')]){delete _0xa2dc5['name'];}_0x1a4945[_0x0a18('0x19')](_0x512f93)[_0x0a18('0x26')](_0xa2dc5);};}exports[_0x0a18('0x27')]=function(_0x424f6d,_0x22d579){var _0xd92825={},_0x2013b0={},_0x40e007={'count':0x0,'rows':[]};var _0x5a95ab=_[_0x0a18('0x28')](db[_0x0a18('0x29')]['rawAttributes'],function(_0x26ae95){return{'name':_0x26ae95[_0x0a18('0x2a')],'type':_0x26ae95[_0x0a18('0x2b')][_0x0a18('0x2c')]};});_0x2013b0[_0x0a18('0x2d')]=_[_0x0a18('0x28')](_0x5a95ab,'name');_0x2013b0[_0x0a18('0x2e')]=_['keys'](_0x424f6d[_0x0a18('0x2e')]);_0x2013b0['filters']=_['intersection'](_0x2013b0[_0x0a18('0x2d')],_0x2013b0[_0x0a18('0x2e')]);_0xd92825[_0x0a18('0x2f')]=_[_0x0a18('0x30')](_0x2013b0[_0x0a18('0x2d')],qs['fields'](_0x424f6d[_0x0a18('0x2e')]['fields']));_0xd92825[_0x0a18('0x2f')]=_0xd92825[_0x0a18('0x2f')]['length']?_0xd92825[_0x0a18('0x2f')]:_0x2013b0[_0x0a18('0x2d')];if(!_0x424f6d[_0x0a18('0x2e')][_0x0a18('0x31')](_0x0a18('0x32'))){_0xd92825['limit']=qs[_0x0a18('0x33')](_0x424f6d[_0x0a18('0x2e')][_0x0a18('0x33')]);_0xd92825[_0x0a18('0x1b')]=qs[_0x0a18('0x1b')](_0x424f6d[_0x0a18('0x2e')][_0x0a18('0x1b')]);}_0xd92825[_0x0a18('0x34')]=qs[_0x0a18('0x35')](_0x424f6d[_0x0a18('0x2e')][_0x0a18('0x35')]);_0xd92825['where']=qs['filters'](_[_0x0a18('0x36')](_0x424f6d[_0x0a18('0x2e')],_0x2013b0['filters']),_0x5a95ab);if(_0x424f6d['query'][_0x0a18('0x37')]){_0xd92825[_0x0a18('0x38')]=_[_0x0a18('0x39')](_0xd92825[_0x0a18('0x38')],{'$or':_['map'](_0x5a95ab,function(_0x55abf5){if(_0x55abf5[_0x0a18('0x2b')]!==_0x0a18('0x3a')){var _0x31e099={};_0x31e099[_0x55abf5['name']]={'$like':'%'+_0x424f6d[_0x0a18('0x2e')][_0x0a18('0x37')]+'%'};return _0x31e099;}})});}_0xd92825=_[_0x0a18('0x39')]({},_0xd92825,_0x424f6d['options']);var _0x555b2f={'where':_0xd92825[_0x0a18('0x38')]};return db[_0x0a18('0x29')]['count'](_0x555b2f)[_0x0a18('0x22')](function(_0x53733b){_0x40e007[_0x0a18('0x1d')]=_0x53733b;if(_0x424f6d[_0x0a18('0x2e')][_0x0a18('0x3b')]){_0xd92825['include']=[{'all':!![]}];}return db[_0x0a18('0x29')][_0x0a18('0x3c')](_0xd92825);})[_0x0a18('0x22')](function(_0x36d4e7){_0x40e007[_0x0a18('0x3d')]=_0x36d4e7;return _0x40e007;})[_0x0a18('0x22')](respondWithFilteredResult(_0x22d579,_0xd92825))[_0x0a18('0x3e')](handleError(_0x22d579,null));};exports[_0x0a18('0x3f')]=function(_0x37e4bf,_0x2394b2){var _0x98a1cf={'raw':![],'where':{'id':_0x37e4bf[_0x0a18('0x40')]['id']}},_0x128271={};_0x128271[_0x0a18('0x2d')]=_[_0x0a18('0x41')](db[_0x0a18('0x29')][_0x0a18('0x42')]);_0x128271['query']=_[_0x0a18('0x41')](_0x37e4bf['query']);_0x128271[_0x0a18('0x43')]=_[_0x0a18('0x30')](_0x128271[_0x0a18('0x2d')],_0x128271[_0x0a18('0x2e')]);_0x98a1cf[_0x0a18('0x2f')]=_['intersection'](_0x128271[_0x0a18('0x2d')],qs[_0x0a18('0x44')](_0x37e4bf['query'][_0x0a18('0x44')]));_0x98a1cf[_0x0a18('0x2f')]=_0x98a1cf['attributes'][_0x0a18('0x45')]?_0x98a1cf[_0x0a18('0x2f')]:_0x128271[_0x0a18('0x2d')];if(_0x37e4bf[_0x0a18('0x2e')][_0x0a18('0x3b')]){_0x98a1cf['include']=[{'all':!![]}];}_0x98a1cf=_[_0x0a18('0x39')]({},_0x98a1cf,_0x37e4bf[_0x0a18('0x46')]);return db['Automation']['find'](_0x98a1cf)[_0x0a18('0x22')](handleEntityNotFound(_0x2394b2,null))[_0x0a18('0x22')](respondWithResult(_0x2394b2,null))[_0x0a18('0x3e')](handleError(_0x2394b2,null));};exports[_0x0a18('0x47')]=function(_0x48b137,_0x2d3120){return db[_0x0a18('0x29')][_0x0a18('0x47')](_0x48b137[_0x0a18('0x48')],{})[_0x0a18('0x22')](respondWithResult(_0x2d3120,0xc9))[_0x0a18('0x3e')](handleError(_0x2d3120,null));};exports[_0x0a18('0x49')]=function(_0x44a83d,_0x28e13f){if(_0x44a83d[_0x0a18('0x48')]['id']){delete _0x44a83d[_0x0a18('0x48')]['id'];}return db[_0x0a18('0x29')][_0x0a18('0x4a')]({'where':{'id':_0x44a83d['params']['id']}})[_0x0a18('0x22')](handleEntityNotFound(_0x28e13f,null))[_0x0a18('0x22')](saveUpdates(_0x44a83d['body'],null))[_0x0a18('0x22')](respondWithResult(_0x28e13f,null))[_0x0a18('0x3e')](handleError(_0x28e13f,null));};exports['destroy']=function(_0x267117,_0x205d4a){return db['Automation'][_0x0a18('0x4a')]({'where':{'id':_0x267117[_0x0a18('0x40')]['id']}})['then'](handleEntityNotFound(_0x205d4a,null))[_0x0a18('0x22')](removeEntity(_0x205d4a,null))[_0x0a18('0x3e')](handleError(_0x205d4a,null));};exports[_0x0a18('0x4b')]=function(_0x12e869,_0x3af4c9,_0x1dd96a){return db[_0x0a18('0x4c')][_0x0a18('0x4a')]({'where':{'id':_0x12e869[_0x0a18('0x40')]['id']}})[_0x0a18('0x22')](handleEntityNotFound(_0x3af4c9,null))[_0x0a18('0x22')](function(_0x214fb3){if(_0x214fb3){return _0x214fb3[_0x0a18('0x4b')](_0x12e869[_0x0a18('0x48')][_0x0a18('0x4d')],_[_0x0a18('0x4e')](_0x12e869[_0x0a18('0x48')],[_0x0a18('0x4d'),'id'])||{});}})[_0x0a18('0x22')](respondWithResult(_0x3af4c9,null))[_0x0a18('0x3e')](handleError(_0x3af4c9,null));};exports['getConditions']=function(_0x503d37,_0x4fd4ca,_0x307d9d){var _0xadce1b={};var _0x56a3ec={};var _0x4aca19;var _0x19bbc6;return db[_0x0a18('0x29')][_0x0a18('0x4f')]({'where':{'id':_0x503d37['params']['id']}})[_0x0a18('0x22')](handleEntityNotFound(_0x4fd4ca,null))[_0x0a18('0x22')](function(_0x1477e6){if(_0x1477e6){_0x4aca19=_0x1477e6;_0x56a3ec[_0x0a18('0x2d')]=_[_0x0a18('0x41')](db[_0x0a18('0x4c')]['rawAttributes']);_0x56a3ec[_0x0a18('0x2e')]=_[_0x0a18('0x41')](_0x503d37[_0x0a18('0x2e')]);_0x56a3ec[_0x0a18('0x43')]=_['intersection'](_0x56a3ec['model'],_0x56a3ec[_0x0a18('0x2e')]);_0xadce1b[_0x0a18('0x2f')]=_['intersection'](_0x56a3ec[_0x0a18('0x2d')],qs[_0x0a18('0x44')](_0x503d37[_0x0a18('0x2e')][_0x0a18('0x44')]));_0xadce1b[_0x0a18('0x2f')]=_0xadce1b[_0x0a18('0x2f')][_0x0a18('0x45')]?_0xadce1b[_0x0a18('0x2f')]:_0x56a3ec[_0x0a18('0x2d')];_0xadce1b[_0x0a18('0x34')]=qs[_0x0a18('0x35')](_0x503d37['query'][_0x0a18('0x35')]);_0xadce1b['where']=qs[_0x0a18('0x43')](_['pick'](_0x503d37[_0x0a18('0x2e')],_0x56a3ec['filters']));if(_0x503d37[_0x0a18('0x2e')][_0x0a18('0x37')]){_0xadce1b['where']=_[_0x0a18('0x39')](_0xadce1b[_0x0a18('0x38')],{'$or':_[_0x0a18('0x28')](_0xadce1b['attributes'],function(_0x373f46){var _0x5b1890={};_0x5b1890[_0x373f46]={'$like':'%'+_0x503d37[_0x0a18('0x2e')][_0x0a18('0x37')]+'%'};return _0x5b1890;})});}_0xadce1b=_[_0x0a18('0x39')]({},_0xadce1b,_0x503d37[_0x0a18('0x46')]);return _0x4aca19[_0x0a18('0x50')](_0xadce1b);}})[_0x0a18('0x22')](function(_0x387bf9){if(_0x387bf9){_0x19bbc6=_0x387bf9[_0x0a18('0x45')];if(!_0x503d37[_0x0a18('0x2e')][_0x0a18('0x31')](_0x0a18('0x32'))){_0xadce1b[_0x0a18('0x33')]=qs[_0x0a18('0x33')](_0x503d37['query'][_0x0a18('0x33')]);_0xadce1b[_0x0a18('0x1b')]=qs[_0x0a18('0x1b')](_0x503d37[_0x0a18('0x2e')][_0x0a18('0x1b')]);}return _0x4aca19['getConditions'](_0xadce1b);}})[_0x0a18('0x22')](function(_0x1fda0b){if(_0x1fda0b){return _0x1fda0b?{'count':_0x19bbc6,'rows':_0x1fda0b}:null;}})[_0x0a18('0x22')](respondWithResult(_0x4fd4ca,null))['catch'](handleError(_0x4fd4ca,null));};exports[_0x0a18('0x51')]=function(_0x27e0a1,_0x203c2a,_0x15fd9a){return db[_0x0a18('0x52')]['find']({'where':{'id':_0x27e0a1[_0x0a18('0x40')]['id']}})['then'](handleEntityNotFound(_0x203c2a,null))[_0x0a18('0x22')](function(_0x37009f){if(_0x37009f){return _0x37009f[_0x0a18('0x51')](_0x27e0a1[_0x0a18('0x48')][_0x0a18('0x4d')],_['omit'](_0x27e0a1[_0x0a18('0x48')],[_0x0a18('0x4d'),'id'])||{});}})[_0x0a18('0x22')](respondWithResult(_0x203c2a,null))[_0x0a18('0x3e')](handleError(_0x203c2a,null));};exports[_0x0a18('0x53')]=function(_0x4f8a92,_0x46dcc5,_0x20a59a){var _0x4cd50a={};var _0x580cf8={};var _0x34eb9d;var _0x35acbc;return db['Automation'][_0x0a18('0x4f')]({'where':{'id':_0x4f8a92[_0x0a18('0x40')]['id']}})[_0x0a18('0x22')](handleEntityNotFound(_0x46dcc5,null))[_0x0a18('0x22')](function(_0x1f3ed1){if(_0x1f3ed1){_0x34eb9d=_0x1f3ed1;_0x580cf8[_0x0a18('0x2d')]=_[_0x0a18('0x41')](db['Action'][_0x0a18('0x42')]);_0x580cf8[_0x0a18('0x2e')]=_['keys'](_0x4f8a92[_0x0a18('0x2e')]);_0x580cf8[_0x0a18('0x43')]=_[_0x0a18('0x30')](_0x580cf8[_0x0a18('0x2d')],_0x580cf8[_0x0a18('0x2e')]);_0x4cd50a['attributes']=_['intersection'](_0x580cf8[_0x0a18('0x2d')],qs[_0x0a18('0x44')](_0x4f8a92[_0x0a18('0x2e')]['fields']));_0x4cd50a[_0x0a18('0x2f')]=_0x4cd50a[_0x0a18('0x2f')][_0x0a18('0x45')]?_0x4cd50a[_0x0a18('0x2f')]:_0x580cf8[_0x0a18('0x2d')];_0x4cd50a[_0x0a18('0x34')]=qs[_0x0a18('0x35')](_0x4f8a92[_0x0a18('0x2e')]['sort']);_0x4cd50a[_0x0a18('0x38')]=qs[_0x0a18('0x43')](_[_0x0a18('0x36')](_0x4f8a92['query'],_0x580cf8[_0x0a18('0x43')]));if(_0x4f8a92[_0x0a18('0x2e')][_0x0a18('0x37')]){_0x4cd50a['where']=_[_0x0a18('0x39')](_0x4cd50a[_0x0a18('0x38')],{'$or':_['map'](_0x4cd50a[_0x0a18('0x2f')],function(_0x519359){var _0x5c28d8={};_0x5c28d8[_0x519359]={'$like':'%'+_0x4f8a92[_0x0a18('0x2e')][_0x0a18('0x37')]+'%'};return _0x5c28d8;})});}_0x4cd50a=_[_0x0a18('0x39')]({},_0x4cd50a,_0x4f8a92['options']);return _0x34eb9d[_0x0a18('0x53')](_0x4cd50a);}})[_0x0a18('0x22')](function(_0x28c460){if(_0x28c460){_0x35acbc=_0x28c460[_0x0a18('0x45')];if(!_0x4f8a92[_0x0a18('0x2e')][_0x0a18('0x31')](_0x0a18('0x32'))){_0x4cd50a[_0x0a18('0x33')]=qs['limit'](_0x4f8a92['query'][_0x0a18('0x33')]);_0x4cd50a[_0x0a18('0x1b')]=qs[_0x0a18('0x1b')](_0x4f8a92[_0x0a18('0x2e')][_0x0a18('0x1b')]);}return _0x34eb9d['getActions'](_0x4cd50a);}})['then'](function(_0xc9a07f){if(_0xc9a07f){return _0xc9a07f?{'count':_0x35acbc,'rows':_0xc9a07f}:null;}})[_0x0a18('0x22')](respondWithResult(_0x46dcc5,null))[_0x0a18('0x3e')](handleError(_0x46dcc5,null));}; \ No newline at end of file +var _0xb8b4=['eml-format','zip-dir','fast-json-patch','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','../../config/license/util','../../mysqldb','sendStatus','status','undefined','count','offset','set','Content-Range','apply','reject','save','destroy','end','error','name','send','index','map','Automation','fieldName','type','query','keys','model','attributes','fields','length','nolimit','limit','where','filters','pick','VIRTUAL','filter','merge','options','then','includeAll','catch','show','rawAttributes','intersection','create','body','update','find','params','addConditions','Condition','ids','omit','getConditions','findOne','order','sort','hasOwnProperty','Action','addActions','getActions'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0xb8b4,0x148));var _0x4b8b=function(_0x535029,_0x13c8e2){_0x535029=_0x535029-0x0;var _0x594f33=_0xb8b4[_0x535029];return _0x594f33;};'use strict';var emlformat=require(_0x4b8b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4b8b('0x1'));var jsonpatch=require(_0x4b8b('0x2'));var rp=require('request-promise');var moment=require(_0x4b8b('0x3'));var BPromise=require(_0x4b8b('0x4'));var Mustache=require(_0x4b8b('0x5'));var util=require(_0x4b8b('0x6'));var path=require(_0x4b8b('0x7'));var sox=require(_0x4b8b('0x8'));var csv=require(_0x4b8b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4b8b('0xa'));var squel=require('squel');var crypto=require(_0x4b8b('0xb'));var jsforce=require(_0x4b8b('0xc'));var deskjs=require(_0x4b8b('0xd'));var toCsv=require(_0x4b8b('0x9'));var querystring=require(_0x4b8b('0xe'));var Papa=require(_0x4b8b('0xf'));var Redis=require(_0x4b8b('0x10'));var authService=require(_0x4b8b('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b8b('0x12'))(_0x4b8b('0x13'));var utils=require(_0x4b8b('0x14'));var config=require(_0x4b8b('0x15'));var licenseUtil=require(_0x4b8b('0x16'));var db=require(_0x4b8b('0x17'))['db'];function respondWithStatusCode(_0x21bbea,_0x4cda0f){_0x4cda0f=_0x4cda0f||0xcc;return function(_0x496e6e){if(_0x496e6e){return _0x21bbea[_0x4b8b('0x18')](_0x4cda0f);}return _0x21bbea[_0x4b8b('0x19')](_0x4cda0f)['end']();};}function respondWithResult(_0x159cc9,_0x1ebfc6){_0x1ebfc6=_0x1ebfc6||0xc8;return function(_0x5dc1c7){if(_0x5dc1c7){return _0x159cc9[_0x4b8b('0x19')](_0x1ebfc6)['json'](_0x5dc1c7);}};}function respondWithFilteredResult(_0x53a50f,_0x1c203b){return function(_0x938563){if(_0x938563){var _0x28c776=typeof _0x1c203b['offset']===_0x4b8b('0x1a')&&typeof _0x1c203b['limit']==='undefined';var _0x5aa664=_0x938563[_0x4b8b('0x1b')];var _0x1a9e94=_0x28c776?0x0:_0x1c203b[_0x4b8b('0x1c')];var _0x5a0642=_0x28c776?_0x938563[_0x4b8b('0x1b')]:_0x1c203b[_0x4b8b('0x1c')]+_0x1c203b['limit'];var _0x43c633;if(_0x5a0642>=_0x5aa664){_0x5a0642=_0x5aa664;_0x43c633=0xc8;}else{_0x43c633=0xce;}_0x53a50f[_0x4b8b('0x19')](_0x43c633);return _0x53a50f[_0x4b8b('0x1d')](_0x4b8b('0x1e'),_0x1a9e94+'-'+_0x5a0642+'/'+_0x5aa664)['json'](_0x938563);}return null;};}function patchUpdates(_0x12a297){return function(_0x45322d){try{jsonpatch[_0x4b8b('0x1f')](_0x45322d,_0x12a297,!![]);}catch(_0x431150){return BPromise[_0x4b8b('0x20')](_0x431150);}return _0x45322d[_0x4b8b('0x21')]();};}function saveUpdates(_0x1c0e7f,_0x1a289a){return function(_0x563085){if(_0x563085){return _0x563085['update'](_0x1c0e7f)['then'](function(_0x45a26f){return _0x45a26f;});}return null;};}function removeEntity(_0x1d039c,_0x4479f2){return function(_0x2cfbe4){if(_0x2cfbe4){return _0x2cfbe4[_0x4b8b('0x22')]()['then'](function(){_0x1d039c[_0x4b8b('0x19')](0xcc)[_0x4b8b('0x23')]();});}};}function handleEntityNotFound(_0x7a291d,_0xaf6cd4){return function(_0x205eac){if(!_0x205eac){_0x7a291d['sendStatus'](0x194);}return _0x205eac;};}function handleError(_0x1c4ac7,_0x38da1b){_0x38da1b=_0x38da1b||0x1f4;return function(_0x4c7855){logger[_0x4b8b('0x24')](_0x4c7855['stack']);if(_0x4c7855[_0x4b8b('0x25')]){delete _0x4c7855['name'];}_0x1c4ac7[_0x4b8b('0x19')](_0x38da1b)[_0x4b8b('0x26')](_0x4c7855);};}exports[_0x4b8b('0x27')]=function(_0x413456,_0x158b59){var _0x3f1bd3={},_0x3a7209={},_0x1fe0e7={'count':0x0,'rows':[]};var _0xd3dd02=_[_0x4b8b('0x28')](db[_0x4b8b('0x29')]['rawAttributes'],function(_0x1d6779){return{'name':_0x1d6779[_0x4b8b('0x2a')],'type':_0x1d6779[_0x4b8b('0x2b')]['key']};});_0x3a7209['model']=_[_0x4b8b('0x28')](_0xd3dd02,'name');_0x3a7209[_0x4b8b('0x2c')]=_[_0x4b8b('0x2d')](_0x413456[_0x4b8b('0x2c')]);_0x3a7209['filters']=_['intersection'](_0x3a7209[_0x4b8b('0x2e')],_0x3a7209['query']);_0x3f1bd3[_0x4b8b('0x2f')]=_['intersection'](_0x3a7209['model'],qs[_0x4b8b('0x30')](_0x413456[_0x4b8b('0x2c')]['fields']));_0x3f1bd3[_0x4b8b('0x2f')]=_0x3f1bd3[_0x4b8b('0x2f')][_0x4b8b('0x31')]?_0x3f1bd3['attributes']:_0x3a7209[_0x4b8b('0x2e')];if(!_0x413456[_0x4b8b('0x2c')]['hasOwnProperty'](_0x4b8b('0x32'))){_0x3f1bd3[_0x4b8b('0x33')]=qs[_0x4b8b('0x33')](_0x413456[_0x4b8b('0x2c')][_0x4b8b('0x33')]);_0x3f1bd3[_0x4b8b('0x1c')]=qs[_0x4b8b('0x1c')](_0x413456[_0x4b8b('0x2c')]['offset']);}_0x3f1bd3['order']=qs['sort'](_0x413456['query']['sort']);_0x3f1bd3[_0x4b8b('0x34')]=qs[_0x4b8b('0x35')](_[_0x4b8b('0x36')](_0x413456[_0x4b8b('0x2c')],_0x3a7209[_0x4b8b('0x35')]),_0xd3dd02);if(_0x413456[_0x4b8b('0x2c')]['filter']){_0x3f1bd3['where']=_['merge'](_0x3f1bd3['where'],{'$or':_[_0x4b8b('0x28')](_0xd3dd02,function(_0x2e9419){if(_0x2e9419[_0x4b8b('0x2b')]!==_0x4b8b('0x37')){var _0x5df97b={};_0x5df97b[_0x2e9419[_0x4b8b('0x25')]]={'$like':'%'+_0x413456[_0x4b8b('0x2c')][_0x4b8b('0x38')]+'%'};return _0x5df97b;}})});}_0x3f1bd3=_[_0x4b8b('0x39')]({},_0x3f1bd3,_0x413456[_0x4b8b('0x3a')]);var _0x2d9c2a={'where':_0x3f1bd3[_0x4b8b('0x34')]};return db['Automation'][_0x4b8b('0x1b')](_0x2d9c2a)[_0x4b8b('0x3b')](function(_0x2bc4a1){_0x1fe0e7[_0x4b8b('0x1b')]=_0x2bc4a1;if(_0x413456[_0x4b8b('0x2c')][_0x4b8b('0x3c')]){_0x3f1bd3['include']=[{'all':!![]}];}return db[_0x4b8b('0x29')]['findAll'](_0x3f1bd3);})['then'](function(_0x1a3288){_0x1fe0e7['rows']=_0x1a3288;return _0x1fe0e7;})[_0x4b8b('0x3b')](respondWithFilteredResult(_0x158b59,_0x3f1bd3))[_0x4b8b('0x3d')](handleError(_0x158b59,null));};exports[_0x4b8b('0x3e')]=function(_0xd6a59b,_0x5483ed){var _0xbec1b9={'raw':![],'where':{'id':_0xd6a59b['params']['id']}},_0x318e8c={};_0x318e8c[_0x4b8b('0x2e')]=_['keys'](db[_0x4b8b('0x29')][_0x4b8b('0x3f')]);_0x318e8c[_0x4b8b('0x2c')]=_[_0x4b8b('0x2d')](_0xd6a59b[_0x4b8b('0x2c')]);_0x318e8c['filters']=_['intersection'](_0x318e8c[_0x4b8b('0x2e')],_0x318e8c[_0x4b8b('0x2c')]);_0xbec1b9[_0x4b8b('0x2f')]=_[_0x4b8b('0x40')](_0x318e8c[_0x4b8b('0x2e')],qs[_0x4b8b('0x30')](_0xd6a59b[_0x4b8b('0x2c')][_0x4b8b('0x30')]));_0xbec1b9[_0x4b8b('0x2f')]=_0xbec1b9['attributes'][_0x4b8b('0x31')]?_0xbec1b9[_0x4b8b('0x2f')]:_0x318e8c[_0x4b8b('0x2e')];if(_0xd6a59b['query'][_0x4b8b('0x3c')]){_0xbec1b9['include']=[{'all':!![]}];}_0xbec1b9=_[_0x4b8b('0x39')]({},_0xbec1b9,_0xd6a59b[_0x4b8b('0x3a')]);return db[_0x4b8b('0x29')]['find'](_0xbec1b9)[_0x4b8b('0x3b')](handleEntityNotFound(_0x5483ed,null))['then'](respondWithResult(_0x5483ed,null))['catch'](handleError(_0x5483ed,null));};exports[_0x4b8b('0x41')]=function(_0x54da42,_0x36c580){return db[_0x4b8b('0x29')][_0x4b8b('0x41')](_0x54da42[_0x4b8b('0x42')],{})[_0x4b8b('0x3b')](respondWithResult(_0x36c580,0xc9))['catch'](handleError(_0x36c580,null));};exports[_0x4b8b('0x43')]=function(_0x28eee2,_0x49c2a5){if(_0x28eee2[_0x4b8b('0x42')]['id']){delete _0x28eee2[_0x4b8b('0x42')]['id'];}return db[_0x4b8b('0x29')]['find']({'where':{'id':_0x28eee2['params']['id']}})[_0x4b8b('0x3b')](handleEntityNotFound(_0x49c2a5,null))[_0x4b8b('0x3b')](saveUpdates(_0x28eee2[_0x4b8b('0x42')],null))[_0x4b8b('0x3b')](respondWithResult(_0x49c2a5,null))[_0x4b8b('0x3d')](handleError(_0x49c2a5,null));};exports[_0x4b8b('0x22')]=function(_0x4b19ad,_0xb823b0){return db['Automation'][_0x4b8b('0x44')]({'where':{'id':_0x4b19ad[_0x4b8b('0x45')]['id']}})[_0x4b8b('0x3b')](handleEntityNotFound(_0xb823b0,null))[_0x4b8b('0x3b')](removeEntity(_0xb823b0,null))[_0x4b8b('0x3d')](handleError(_0xb823b0,null));};exports[_0x4b8b('0x46')]=function(_0x28b82d,_0x8126ed,_0x4acffd){return db[_0x4b8b('0x47')][_0x4b8b('0x44')]({'where':{'id':_0x28b82d[_0x4b8b('0x45')]['id']}})[_0x4b8b('0x3b')](handleEntityNotFound(_0x8126ed,null))['then'](function(_0x4cddf6){if(_0x4cddf6){return _0x4cddf6['addConditions'](_0x28b82d[_0x4b8b('0x42')][_0x4b8b('0x48')],_[_0x4b8b('0x49')](_0x28b82d['body'],['ids','id'])||{});}})[_0x4b8b('0x3b')](respondWithResult(_0x8126ed,null))['catch'](handleError(_0x8126ed,null));};exports[_0x4b8b('0x4a')]=function(_0x1bdbd6,_0x31896c,_0x1ae4fe){var _0x39b279={};var _0x284353={};var _0x3fcbc2;var _0x1a4dc8;return db[_0x4b8b('0x29')][_0x4b8b('0x4b')]({'where':{'id':_0x1bdbd6[_0x4b8b('0x45')]['id']}})[_0x4b8b('0x3b')](handleEntityNotFound(_0x31896c,null))['then'](function(_0x7a1093){if(_0x7a1093){_0x3fcbc2=_0x7a1093;_0x284353[_0x4b8b('0x2e')]=_[_0x4b8b('0x2d')](db[_0x4b8b('0x47')][_0x4b8b('0x3f')]);_0x284353['query']=_[_0x4b8b('0x2d')](_0x1bdbd6[_0x4b8b('0x2c')]);_0x284353[_0x4b8b('0x35')]=_[_0x4b8b('0x40')](_0x284353[_0x4b8b('0x2e')],_0x284353[_0x4b8b('0x2c')]);_0x39b279[_0x4b8b('0x2f')]=_[_0x4b8b('0x40')](_0x284353[_0x4b8b('0x2e')],qs[_0x4b8b('0x30')](_0x1bdbd6['query'][_0x4b8b('0x30')]));_0x39b279[_0x4b8b('0x2f')]=_0x39b279[_0x4b8b('0x2f')][_0x4b8b('0x31')]?_0x39b279['attributes']:_0x284353['model'];_0x39b279[_0x4b8b('0x4c')]=qs[_0x4b8b('0x4d')](_0x1bdbd6['query'][_0x4b8b('0x4d')]);_0x39b279[_0x4b8b('0x34')]=qs[_0x4b8b('0x35')](_[_0x4b8b('0x36')](_0x1bdbd6[_0x4b8b('0x2c')],_0x284353[_0x4b8b('0x35')]));if(_0x1bdbd6['query'][_0x4b8b('0x38')]){_0x39b279[_0x4b8b('0x34')]=_[_0x4b8b('0x39')](_0x39b279[_0x4b8b('0x34')],{'$or':_[_0x4b8b('0x28')](_0x39b279[_0x4b8b('0x2f')],function(_0x401b57){var _0x10cb78={};_0x10cb78[_0x401b57]={'$like':'%'+_0x1bdbd6[_0x4b8b('0x2c')]['filter']+'%'};return _0x10cb78;})});}_0x39b279=_['merge']({},_0x39b279,_0x1bdbd6[_0x4b8b('0x3a')]);return _0x3fcbc2[_0x4b8b('0x4a')](_0x39b279);}})['then'](function(_0x550ce7){if(_0x550ce7){_0x1a4dc8=_0x550ce7[_0x4b8b('0x31')];if(!_0x1bdbd6['query'][_0x4b8b('0x4e')](_0x4b8b('0x32'))){_0x39b279[_0x4b8b('0x33')]=qs['limit'](_0x1bdbd6[_0x4b8b('0x2c')]['limit']);_0x39b279[_0x4b8b('0x1c')]=qs['offset'](_0x1bdbd6[_0x4b8b('0x2c')]['offset']);}return _0x3fcbc2[_0x4b8b('0x4a')](_0x39b279);}})[_0x4b8b('0x3b')](function(_0x2e9cb8){if(_0x2e9cb8){return _0x2e9cb8?{'count':_0x1a4dc8,'rows':_0x2e9cb8}:null;}})[_0x4b8b('0x3b')](respondWithResult(_0x31896c,null))['catch'](handleError(_0x31896c,null));};exports['addActions']=function(_0x4a4acc,_0x4cb674,_0x33f261){return db[_0x4b8b('0x4f')][_0x4b8b('0x44')]({'where':{'id':_0x4a4acc[_0x4b8b('0x45')]['id']}})[_0x4b8b('0x3b')](handleEntityNotFound(_0x4cb674,null))[_0x4b8b('0x3b')](function(_0x48801f){if(_0x48801f){return _0x48801f[_0x4b8b('0x50')](_0x4a4acc[_0x4b8b('0x42')][_0x4b8b('0x48')],_[_0x4b8b('0x49')](_0x4a4acc[_0x4b8b('0x42')],[_0x4b8b('0x48'),'id'])||{});}})[_0x4b8b('0x3b')](respondWithResult(_0x4cb674,null))[_0x4b8b('0x3d')](handleError(_0x4cb674,null));};exports['getActions']=function(_0x2e9a53,_0x186a48,_0x4ff1a6){var _0x489d2b={};var _0x2c3023={};var _0x37e623;var _0x30b680;return db[_0x4b8b('0x29')][_0x4b8b('0x4b')]({'where':{'id':_0x2e9a53[_0x4b8b('0x45')]['id']}})[_0x4b8b('0x3b')](handleEntityNotFound(_0x186a48,null))[_0x4b8b('0x3b')](function(_0x48cdde){if(_0x48cdde){_0x37e623=_0x48cdde;_0x2c3023[_0x4b8b('0x2e')]=_['keys'](db[_0x4b8b('0x4f')][_0x4b8b('0x3f')]);_0x2c3023['query']=_[_0x4b8b('0x2d')](_0x2e9a53[_0x4b8b('0x2c')]);_0x2c3023[_0x4b8b('0x35')]=_[_0x4b8b('0x40')](_0x2c3023[_0x4b8b('0x2e')],_0x2c3023['query']);_0x489d2b[_0x4b8b('0x2f')]=_[_0x4b8b('0x40')](_0x2c3023['model'],qs[_0x4b8b('0x30')](_0x2e9a53[_0x4b8b('0x2c')][_0x4b8b('0x30')]));_0x489d2b[_0x4b8b('0x2f')]=_0x489d2b[_0x4b8b('0x2f')][_0x4b8b('0x31')]?_0x489d2b[_0x4b8b('0x2f')]:_0x2c3023[_0x4b8b('0x2e')];_0x489d2b[_0x4b8b('0x4c')]=qs[_0x4b8b('0x4d')](_0x2e9a53[_0x4b8b('0x2c')][_0x4b8b('0x4d')]);_0x489d2b[_0x4b8b('0x34')]=qs[_0x4b8b('0x35')](_[_0x4b8b('0x36')](_0x2e9a53[_0x4b8b('0x2c')],_0x2c3023['filters']));if(_0x2e9a53[_0x4b8b('0x2c')][_0x4b8b('0x38')]){_0x489d2b[_0x4b8b('0x34')]=_[_0x4b8b('0x39')](_0x489d2b[_0x4b8b('0x34')],{'$or':_[_0x4b8b('0x28')](_0x489d2b[_0x4b8b('0x2f')],function(_0xd8e609){var _0x2c225d={};_0x2c225d[_0xd8e609]={'$like':'%'+_0x2e9a53['query'][_0x4b8b('0x38')]+'%'};return _0x2c225d;})});}_0x489d2b=_[_0x4b8b('0x39')]({},_0x489d2b,_0x2e9a53[_0x4b8b('0x3a')]);return _0x37e623[_0x4b8b('0x51')](_0x489d2b);}})['then'](function(_0x17b62d){if(_0x17b62d){_0x30b680=_0x17b62d['length'];if(!_0x2e9a53['query'][_0x4b8b('0x4e')](_0x4b8b('0x32'))){_0x489d2b[_0x4b8b('0x33')]=qs[_0x4b8b('0x33')](_0x2e9a53[_0x4b8b('0x2c')][_0x4b8b('0x33')]);_0x489d2b['offset']=qs[_0x4b8b('0x1c')](_0x2e9a53[_0x4b8b('0x2c')]['offset']);}return _0x37e623[_0x4b8b('0x51')](_0x489d2b);}})[_0x4b8b('0x3b')](function(_0x1a709a){if(_0x1a709a){return _0x1a709a?{'count':_0x30b680,'rows':_0x1a709a}:null;}})[_0x4b8b('0x3b')](respondWithResult(_0x186a48,null))[_0x4b8b('0x3d')](handleError(_0x186a48,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 9834720..17bed9d 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 _0x8709=['../../config/environment','exports','define','Automation','tools_automations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x8709,0x109));var _0x9870=function(_0x324f7d,_0x3a0184){_0x324f7d=_0x324f7d-0x0;var _0x158d1e=_0x8709[_0x324f7d];return _0x158d1e;};'use strict';var _=require('lodash');var util=require(_0x9870('0x0'));var logger=require(_0x9870('0x1'))(_0x9870('0x2'));var moment=require(_0x9870('0x3'));var BPromise=require(_0x9870('0x4'));var rp=require(_0x9870('0x5'));var fs=require('fs');var path=require(_0x9870('0x6'));var rimraf=require(_0x9870('0x7'));var config=require(_0x9870('0x8'));var attributes=require('./automation.attributes');module[_0x9870('0x9')]=function(_0x35292a,_0x2a14d8){return _0x35292a[_0x9870('0xa')](_0x9870('0xb'),attributes,{'tableName':_0x9870('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc429=['api','moment','bluebird','rimraf','../../config/environment','./automation.attributes','exports','define','lodash','util'];(function(_0x1b89fd,_0x106d96){var _0x21aadb=function(_0x3e4377){while(--_0x3e4377){_0x1b89fd['push'](_0x1b89fd['shift']());}};_0x21aadb(++_0x106d96);}(_0xc429,0x184));var _0x9c42=function(_0x2525f1,_0x47034f){_0x2525f1=_0x2525f1-0x0;var _0x13c1b5=_0xc429[_0x2525f1];return _0x13c1b5;};'use strict';var _=require(_0x9c42('0x0'));var util=require(_0x9c42('0x1'));var logger=require('../../config/logger')(_0x9c42('0x2'));var moment=require(_0x9c42('0x3'));var BPromise=require(_0x9c42('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9c42('0x5'));var config=require(_0x9c42('0x6'));var attributes=require(_0x9c42('0x7'));module[_0x9c42('0x8')]=function(_0x56139f,_0x2cce7c){return _0x56139f[_0x9c42('0x9')]('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 5e85bc6..3146461 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 _0x39d0=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x39d0,0x144));var _0x039d=function(_0x22ebfb,_0x936122){_0x22ebfb=_0x22ebfb-0x0;var _0x1eaee0=_0x39d0[_0x22ebfb];return _0x1eaee0;};'use strict';var _=require(_0x039d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x039d('0x1'));var rs=require(_0x039d('0x2'));var fs=require('fs');var Redis=require(_0x039d('0x3'));var db=require(_0x039d('0x4'))['db'];var utils=require(_0x039d('0x5'));var logger=require('../../config/logger')(_0x039d('0x6'));var config=require(_0x039d('0x7'));var jayson=require(_0x039d('0x8'));var client=jayson[_0x039d('0x9')][_0x039d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7dcc60,_0x2f8c4b,_0x4705e8){return new BPromise(function(_0x425f6e,_0x210090){return client[_0x039d('0xb')](_0x7dcc60,_0x4705e8)['then'](function(_0x591f97){logger[_0x039d('0xc')]('Automation,\x20%s,\x20%s',_0x2f8c4b,_0x039d('0xd'));logger[_0x039d('0xe')](_0x039d('0xf'),_0x2f8c4b,_0x039d('0xd'),JSON['stringify'](_0x591f97));if(_0x591f97[_0x039d('0x10')]){if(_0x591f97[_0x039d('0x10')][_0x039d('0x11')]===0x1f4){logger['error'](_0x039d('0x12'),_0x2f8c4b,_0x591f97[_0x039d('0x10')][_0x039d('0x13')]);return _0x210090(_0x591f97[_0x039d('0x10')][_0x039d('0x13')]);}logger[_0x039d('0x10')](_0x039d('0x12'),_0x2f8c4b,_0x591f97['error']['message']);return _0x425f6e(_0x591f97[_0x039d('0x10')][_0x039d('0x13')]);}else{logger[_0x039d('0xc')](_0x039d('0x12'),_0x2f8c4b,_0x039d('0xd'));_0x425f6e(_0x591f97[_0x039d('0x14')]['message']);}})[_0x039d('0x15')](function(_0x226853){logger[_0x039d('0x10')]('Automation,\x20%s,\x20%s',_0x2f8c4b,_0x226853);_0x210090(_0x226853);});});} \ No newline at end of file +var _0xa413=['result','catch','lodash','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','info'];(function(_0x761b6d,_0x7c7fa8){var _0x3a1639=function(_0x33b90a){while(--_0x33b90a){_0x761b6d['push'](_0x761b6d['shift']());}};_0x3a1639(++_0x7c7fa8);}(_0xa413,0x1e5));var _0x3a41=function(_0x2bf41b,_0x3f739c){_0x2bf41b=_0x2bf41b-0x0;var _0x5627ab=_0xa413[_0x2bf41b];return _0x5627ab;};'use strict';var _=require(_0x3a41('0x0'));var util=require('util');var moment=require(_0x3a41('0x1'));var BPromise=require('bluebird');var rs=require(_0x3a41('0x2'));var fs=require('fs');var Redis=require(_0x3a41('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3a41('0x4'))(_0x3a41('0x5'));var config=require(_0x3a41('0x6'));var jayson=require(_0x3a41('0x7'));var client=jayson[_0x3a41('0x8')][_0x3a41('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x45f6d2,_0x407d52,_0xca7253){return new BPromise(function(_0x473cd2,_0x27c2e5){return client['request'](_0x45f6d2,_0xca7253)[_0x3a41('0xa')](function(_0x570304){logger['info']('Automation,\x20%s,\x20%s',_0x407d52,_0x3a41('0xb'));logger['debug'](_0x3a41('0xc'),_0x407d52,'request\x20sent',JSON[_0x3a41('0xd')](_0x570304));if(_0x570304[_0x3a41('0xe')]){if(_0x570304['error'][_0x3a41('0xf')]===0x1f4){logger[_0x3a41('0xe')](_0x3a41('0x10'),_0x407d52,_0x570304[_0x3a41('0xe')][_0x3a41('0x11')]);return _0x27c2e5(_0x570304['error'][_0x3a41('0x11')]);}logger[_0x3a41('0xe')](_0x3a41('0x10'),_0x407d52,_0x570304[_0x3a41('0xe')][_0x3a41('0x11')]);return _0x473cd2(_0x570304[_0x3a41('0xe')][_0x3a41('0x11')]);}else{logger[_0x3a41('0x12')](_0x3a41('0x10'),_0x407d52,_0x3a41('0xb'));_0x473cd2(_0x570304[_0x3a41('0x13')]['message']);}})[_0x3a41('0x14')](function(_0x30d675){logger['error']('Automation,\x20%s,\x20%s',_0x407d52,_0x30d675);_0x27c2e5(_0x30d675);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 22e71dd..dca53da 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 _0x56ff=['get','index','isAuthenticated','/:id/conditions','getConditions','getActions','post','create','addConditions','/:id/actions','addActions','put','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller'];(function(_0x2ac856,_0x5b3cf3){var _0x522d28=function(_0xe7b035){while(--_0xe7b035){_0x2ac856['push'](_0x2ac856['shift']());}};_0x522d28(++_0x5b3cf3);}(_0x56ff,0xb9));var _0xf56f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x56ff[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xf56f('0x0'));var util=require(_0xf56f('0x1'));var path=require(_0xf56f('0x2'));var timeout=require(_0xf56f('0x3'));var express=require(_0xf56f('0x4'));var router=express[_0xf56f('0x5')]();var fs_extra=require(_0xf56f('0x6'));var auth=require(_0xf56f('0x7'));var interaction=require(_0xf56f('0x8'));var config=require(_0xf56f('0x9'));var controller=require(_0xf56f('0xa'));router[_0xf56f('0xb')]('/',auth['isAuthenticated'](),controller[_0xf56f('0xc')]);router[_0xf56f('0xb')]('/:id',auth[_0xf56f('0xd')](),controller['show']);router[_0xf56f('0xb')](_0xf56f('0xe'),auth[_0xf56f('0xd')](),controller[_0xf56f('0xf')]);router['get']('/:id/actions',auth['isAuthenticated'](),controller[_0xf56f('0x10')]);router[_0xf56f('0x11')]('/',auth[_0xf56f('0xd')](),controller[_0xf56f('0x12')]);router['post']('/:id/conditions',auth['isAuthenticated'](),controller[_0xf56f('0x13')]);router[_0xf56f('0x11')](_0xf56f('0x14'),auth[_0xf56f('0xd')](),controller[_0xf56f('0x15')]);router[_0xf56f('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xf56f('0x17')]);router[_0xf56f('0x18')](_0xf56f('0x19'),auth[_0xf56f('0xd')](),controller[_0xf56f('0x1a')]);module[_0xf56f('0x1b')]=router; \ No newline at end of file +var _0x2fb5=['post','put','update','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','isAuthenticated','get','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','create','addConditions'];(function(_0x2f8805,_0x2f1d21){var _0xa16375=function(_0x1c5bcc){while(--_0x1c5bcc){_0x2f8805['push'](_0x2f8805['shift']());}};_0xa16375(++_0x2f1d21);}(_0x2fb5,0xff));var _0x52fb=function(_0x4eec9b,_0x4aea09){_0x4eec9b=_0x4eec9b-0x0;var _0x2e3849=_0x2fb5[_0x4eec9b];return _0x2e3849;};'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 fs_extra=require('fs-extra');var auth=require(_0x52fb('0x4'));var interaction=require(_0x52fb('0x5'));var config=require(_0x52fb('0x6'));var controller=require(_0x52fb('0x7'));router['get']('/',auth[_0x52fb('0x8')](),controller['index']);router[_0x52fb('0x9')](_0x52fb('0xa'),auth[_0x52fb('0x8')](),controller[_0x52fb('0xb')]);router[_0x52fb('0x9')](_0x52fb('0xc'),auth['isAuthenticated'](),controller[_0x52fb('0xd')]);router['get'](_0x52fb('0xe'),auth[_0x52fb('0x8')](),controller[_0x52fb('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x52fb('0x10')]);router['post'](_0x52fb('0xc'),auth['isAuthenticated'](),controller[_0x52fb('0x11')]);router[_0x52fb('0x12')](_0x52fb('0xe'),auth[_0x52fb('0x8')](),controller['addActions']);router[_0x52fb('0x13')](_0x52fb('0xa'),auth[_0x52fb('0x8')](),controller[_0x52fb('0x14')]);router['delete'](_0x52fb('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index bd8a04e..2a6ec1e 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 _0x9c33=['UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','BOOLEAN','INTEGER'];(function(_0x6116ee,_0x316cb9){var _0x58320a=function(_0x2b6fdd){while(--_0x2b6fdd){_0x6116ee['push'](_0x6116ee['shift']());}};_0x58320a(++_0x316cb9);}(_0x9c33,0xe0));var _0x39c3=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x9c33[_0xe73080];return _0x12cbc4;};'use strict';var Sequelize=require('sequelize');module[_0x39c3('0x0')]={'name':{'type':Sequelize[_0x39c3('0x1')],'unique':_0x39c3('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x39c3('0x3')](_0x39c3('0x4')),'allowNull':![],'defaultValue':_0x39c3('0x4')},'description':{'type':Sequelize[_0x39c3('0x1')]},'active':{'type':Sequelize[_0x39c3('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x39c3('0x6')](0x4)[_0x39c3('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x39c3('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x39c3('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x39c3('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x39c3('0x6')](0x3)[_0x39c3('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x39c3('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x39c3('0x6')](0x3)[_0x39c3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x39c3('0x6')](0x5)[_0x39c3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x39c3('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x39c3('0x6')](0x3)[_0x39c3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x39c3('0x6')](0x5)[_0x39c3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x39c3('0x6')](0x3)[_0x39c3('0x7')],'defaultValue':0x3,'comment':_0x39c3('0xb')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x39c3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x39c3('0xc')},'dialGlobalMaxRetry':{'type':Sequelize[_0x39c3('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x39c3('0xd')},'dialTimezone':{'type':Sequelize[_0x39c3('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x39c3('0x1')],'defaultValue':_0x39c3('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0x39c3('0x3')](_0x39c3('0xf'),'never',_0x39c3('0x10')),'defaultValue':_0x39c3('0xf')},'dialAMDActive':{'type':Sequelize[_0x39c3('0x5')],'defaultValue':0x0,'comment':_0x39c3('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x39c3('0x6')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x39c3('0x6')](0x9)[_0x39c3('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x39c3('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x39c3('0x6')](0x9)[_0x39c3('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x39c3('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x39c3('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x39c3('0x14')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x39c3('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x39c3('0x6')](0x9)[_0x39c3('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x39c3('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x39c3('0x6')](0x9)[_0x39c3('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x39c3('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x39c3('0x6')](0x5)[_0x39c3('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0x39c3('0x6')](0x9)[_0x39c3('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x39c3('0x3')](_0x39c3('0x17'),_0x39c3('0x18')),'defaultValue':_0x39c3('0x17')},'dialPrefix':{'type':Sequelize[_0x39c3('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x39c3('0x6')](0x3)[_0x39c3('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x39c3('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x39c3('0x19')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x39c3('0x6')](0x3)[_0x39c3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x39c3('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x39c3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x39c3('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0x39c3('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x39c3('0x6')](0x5)[_0x39c3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x39c3('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x39c3('0x6')](0x3)[_0x39c3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x39c3('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x39c3('0x6')](0x5)[_0x39c3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x39c3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x39c3('0x1e')},'dialMachineRetryFrequency':{'type':Sequelize[_0x39c3('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x39c3('0x6')](0x3)[_0x39c3('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x39c3('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x39c3('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x39c3('0x20')}}; \ No newline at end of file +var _0x8f9d=['#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','#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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x3ffebc,_0x5c25a7){var _0x5346f4=function(_0xa1d3b2){while(--_0xa1d3b2){_0x3ffebc['push'](_0x3ffebc['shift']());}};_0x5346f4(++_0x5c25a7);}(_0x8f9d,0x1d6));var _0xd8f9=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x8f9d[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0xd8f9('0x0'));module[_0xd8f9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xd8f9('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd8f9('0x3')]('ivr'),'allowNull':![],'defaultValue':_0xd8f9('0x4')},'description':{'type':Sequelize[_0xd8f9('0x5')]},'active':{'type':Sequelize[_0xd8f9('0x6')],'defaultValue':0x0,'comment':_0xd8f9('0x7')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0xd8f9('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd8f9('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xd8f9('0xa')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xd8f9('0xa')](0x3)[_0xd8f9('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8f9('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd8f9('0xa')](0x5)[_0xd8f9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8f9('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0xd8f9('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8f9('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd8f9('0xa')](0x5)[_0xd8f9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8f9('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd8f9('0x8')],'defaultValue':0x3,'comment':_0xd8f9('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd8f9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8f9('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0xd8f9('0xa')](0x3)[_0xd8f9('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd8f9('0x11')},'dialTimezone':{'type':Sequelize[_0xd8f9('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd8f9('0x5')],'defaultValue':_0xd8f9('0x12')},'dialCheckDuplicateType':{'type':Sequelize[_0xd8f9('0x3')](_0xd8f9('0x13'),'never',_0xd8f9('0x14')),'defaultValue':_0xd8f9('0x13')},'dialAMDActive':{'type':Sequelize[_0xd8f9('0x6')],'defaultValue':0x0,'comment':_0xd8f9('0x15')},'dialAMDInitialSilence':{'type':Sequelize[_0xd8f9('0xa')](0x9)[_0xd8f9('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd8f9('0x16')},'dialAMDGreeting':{'type':Sequelize[_0xd8f9('0xa')](0x9)[_0xd8f9('0x8')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd8f9('0x17')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd8f9('0xa')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xd8f9('0xa')](0x9)[_0xd8f9('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd8f9('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd8f9('0xa')](0x9)[_0xd8f9('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd8f9('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd8f9('0xa')](0x9)[_0xd8f9('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd8f9('0xa')](0x5)[_0xd8f9('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd8f9('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd8f9('0xa')](0x9)[_0xd8f9('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xd8f9('0x3')]('DESC',_0xd8f9('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xd8f9('0xa')](0x3)[_0xd8f9('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd8f9('0x1c')},'dialCutDigit':{'type':Sequelize[_0xd8f9('0xa')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd8f9('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd8f9('0xa')](0x3)[_0xd8f9('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8f9('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd8f9('0xa')](0x5)[_0xd8f9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xd8f9('0xa')](0x3)[_0xd8f9('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8f9('0x1f')},'dialDropRetryFrequency':{'type':Sequelize[_0xd8f9('0xa')](0x5)[_0xd8f9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8f9('0x20')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xd8f9('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8f9('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd8f9('0xa')](0x5)[_0xd8f9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8f9('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xd8f9('0xa')](0x3)[_0xd8f9('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8f9('0x23')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd8f9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8f9('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd8f9('0xa')](0x3)[_0xd8f9('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8f9('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd8f9('0xa')](0x5)[_0xd8f9('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8f9('0x26')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index aa08646..c9b5118 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 _0xeb43=['fromQuery','scheduledAt','ContactId','select','phone','field','CmListId','toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','NOW()','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','push','sequelize','all','removeLists','CmList','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','mustache','util','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','get','IvrCampaigns','UserProfileResource','then','stack','name','index','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','userProfileId','autoAssociation','findOne','CmHopper','length','pick','CmHopperHistory','CampaignId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeb43,0x149));var _0x3eb4=function(_0x1fd5eb,_0x235203){_0x1fd5eb=_0x1fd5eb-0x0;var _0x102365=_0xeb43[_0x1fd5eb];return _0x102365;};'use strict';var emlformat=require(_0x3eb4('0x0'));var rimraf=require(_0x3eb4('0x1'));var zipdir=require(_0x3eb4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3eb4('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3eb4('0x4'));var util=require(_0x3eb4('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x3eb4('0x6'));var ejs=require(_0x3eb4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3eb4('0x8'));var squel=require('squel');var crypto=require(_0x3eb4('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x3eb4('0xa'));var toCsv=require(_0x3eb4('0x6'));var querystring=require(_0x3eb4('0xb'));var Papa=require(_0x3eb4('0xc'));var Redis=require(_0x3eb4('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3eb4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3eb4('0xf'));var logger=require(_0x3eb4('0x10'))(_0x3eb4('0x11'));var utils=require(_0x3eb4('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x3eb4('0x13'));var db=require(_0x3eb4('0x14'))['db'];function respondWithStatusCode(_0x282ffa,_0x10e49e){_0x10e49e=_0x10e49e||0xcc;return function(_0x1e738e){if(_0x1e738e){return _0x282ffa[_0x3eb4('0x15')](_0x10e49e);}return _0x282ffa['status'](_0x10e49e)[_0x3eb4('0x16')]();};}function respondWithResult(_0x4caa07,_0x5549e5){_0x5549e5=_0x5549e5||0xc8;return function(_0x45342a){if(_0x45342a){return _0x4caa07['status'](_0x5549e5)[_0x3eb4('0x17')](_0x45342a);}};}function respondWithFilteredResult(_0x7d975e,_0x450a5e){return function(_0x123861){if(_0x123861){var _0xc5b9c2=typeof _0x450a5e[_0x3eb4('0x18')]===_0x3eb4('0x19')&&typeof _0x450a5e[_0x3eb4('0x1a')]===_0x3eb4('0x19');var _0x1af3ed=_0x123861['count'];var _0x3fb1c0=_0xc5b9c2?0x0:_0x450a5e[_0x3eb4('0x18')];var _0x1fcc85=_0xc5b9c2?_0x123861[_0x3eb4('0x1b')]:_0x450a5e[_0x3eb4('0x18')]+_0x450a5e[_0x3eb4('0x1a')];var _0x175d3c;if(_0x1fcc85>=_0x1af3ed){_0x1fcc85=_0x1af3ed;_0x175d3c=0xc8;}else{_0x175d3c=0xce;}_0x7d975e[_0x3eb4('0x1c')](_0x175d3c);return _0x7d975e[_0x3eb4('0x1d')](_0x3eb4('0x1e'),_0x3fb1c0+'-'+_0x1fcc85+'/'+_0x1af3ed)['json'](_0x123861);}return null;};}function patchUpdates(_0x55fe47){return function(_0x276934){try{jsonpatch[_0x3eb4('0x1f')](_0x276934,_0x55fe47,!![]);}catch(_0x25ee8d){return BPromise[_0x3eb4('0x20')](_0x25ee8d);}return _0x276934[_0x3eb4('0x21')]();};}function saveUpdates(_0x47b4bd,_0x35c4ec){return function(_0x5eb01d){if(_0x5eb01d){return _0x5eb01d[_0x3eb4('0x22')](_0x47b4bd)['then'](function(_0x2edf82){return _0x2edf82;});}return null;};}function removeEntity(_0x425457,_0x1e87a6){return function(_0x1c2f04){if(_0x1c2f04){return _0x1c2f04[_0x3eb4('0x23')]()['then'](function(){var _0x1b4c97=_0x1c2f04[_0x3eb4('0x24')]({'plain':!![]});var _0x5b8149=_0x3eb4('0x25');return db[_0x3eb4('0x26')][_0x3eb4('0x23')]({'where':{'type':_0x5b8149,'resourceId':_0x1b4c97['id']}})[_0x3eb4('0x27')](function(){return _0x1c2f04;});})['then'](function(){_0x425457[_0x3eb4('0x1c')](0xcc)[_0x3eb4('0x16')]();});}};}function handleEntityNotFound(_0x96d1e,_0x5303f2){return function(_0x50684f){if(!_0x50684f){_0x96d1e[_0x3eb4('0x15')](0x194);}return _0x50684f;};}function handleError(_0x281a5a,_0x3fd1a7){_0x3fd1a7=_0x3fd1a7||0x1f4;return function(_0x51ef72){logger['error'](_0x51ef72[_0x3eb4('0x28')]);if(_0x51ef72['name']){delete _0x51ef72[_0x3eb4('0x29')];}_0x281a5a['status'](_0x3fd1a7)['send'](_0x51ef72);};}exports[_0x3eb4('0x2a')]=function(_0x5975e4,_0x3d9af8){var _0x2ba4fe={},_0xc8bb50={},_0xb55d7e={'count':0x0,'rows':[]};var _0x43e992=_[_0x3eb4('0x2b')](db['Campaign']['rawAttributes'],function(_0x248e37){return{'name':_0x248e37[_0x3eb4('0x2c')],'type':_0x248e37[_0x3eb4('0x2d')][_0x3eb4('0x2e')]};});_0xc8bb50[_0x3eb4('0x2f')]=_['map'](_0x43e992,_0x3eb4('0x29'));_0xc8bb50[_0x3eb4('0x30')]=_[_0x3eb4('0x31')](_0x5975e4[_0x3eb4('0x30')]);_0xc8bb50[_0x3eb4('0x32')]=_['intersection'](_0xc8bb50['model'],_0xc8bb50[_0x3eb4('0x30')]);_0x2ba4fe[_0x3eb4('0x33')]=_[_0x3eb4('0x34')](_0xc8bb50[_0x3eb4('0x2f')],qs[_0x3eb4('0x35')](_0x5975e4[_0x3eb4('0x30')][_0x3eb4('0x35')]));_0x2ba4fe['attributes']=_0x2ba4fe[_0x3eb4('0x33')]['length']?_0x2ba4fe[_0x3eb4('0x33')]:_0xc8bb50['model'];if(!_0x5975e4[_0x3eb4('0x30')][_0x3eb4('0x36')](_0x3eb4('0x37'))){_0x2ba4fe['limit']=qs['limit'](_0x5975e4[_0x3eb4('0x30')][_0x3eb4('0x1a')]);_0x2ba4fe[_0x3eb4('0x18')]=qs[_0x3eb4('0x18')](_0x5975e4[_0x3eb4('0x30')]['offset']);}_0x2ba4fe[_0x3eb4('0x38')]=qs[_0x3eb4('0x39')](_0x5975e4['query'][_0x3eb4('0x39')]);_0x2ba4fe[_0x3eb4('0x3a')]=qs[_0x3eb4('0x32')](_['pick'](_0x5975e4['query'],_0xc8bb50[_0x3eb4('0x32')]),_0x43e992);if(_0x5975e4['query'][_0x3eb4('0x3b')]){_0x2ba4fe[_0x3eb4('0x3a')]=_[_0x3eb4('0x3c')](_0x2ba4fe[_0x3eb4('0x3a')],{'$or':_['map'](_0x43e992,function(_0x2e62e1){if(_0x2e62e1[_0x3eb4('0x2d')]!==_0x3eb4('0x3d')){var _0x4ede9a={};_0x4ede9a[_0x2e62e1[_0x3eb4('0x29')]]={'$like':'%'+_0x5975e4[_0x3eb4('0x30')][_0x3eb4('0x3b')]+'%'};return _0x4ede9a;}})});}_0x2ba4fe=_[_0x3eb4('0x3c')]({},_0x2ba4fe,_0x5975e4[_0x3eb4('0x3e')]);var _0x8b69b2={'where':_0x2ba4fe[_0x3eb4('0x3a')]};return db[_0x3eb4('0x3f')][_0x3eb4('0x1b')](_0x8b69b2)[_0x3eb4('0x27')](function(_0x1f1376){_0xb55d7e['count']=_0x1f1376;if(_0x5975e4['query'][_0x3eb4('0x40')]){_0x2ba4fe[_0x3eb4('0x41')]=[{'all':!![]}];}return db[_0x3eb4('0x3f')][_0x3eb4('0x42')](_0x2ba4fe);})[_0x3eb4('0x27')](function(_0x14d5be){_0xb55d7e[_0x3eb4('0x43')]=_0x14d5be;return _0xb55d7e;})[_0x3eb4('0x27')](respondWithFilteredResult(_0x3d9af8,_0x2ba4fe))['catch'](handleError(_0x3d9af8,null));};exports[_0x3eb4('0x44')]=function(_0x5be81b,_0x2c958){var _0x140343={'raw':![],'where':{'id':_0x5be81b[_0x3eb4('0x45')]['id']}},_0x34da0d={};_0x34da0d[_0x3eb4('0x2f')]=_[_0x3eb4('0x31')](db[_0x3eb4('0x3f')][_0x3eb4('0x46')]);_0x34da0d[_0x3eb4('0x30')]=_[_0x3eb4('0x31')](_0x5be81b['query']);_0x34da0d[_0x3eb4('0x32')]=_[_0x3eb4('0x34')](_0x34da0d[_0x3eb4('0x2f')],_0x34da0d['query']);_0x140343[_0x3eb4('0x33')]=_['intersection'](_0x34da0d[_0x3eb4('0x2f')],qs['fields'](_0x5be81b[_0x3eb4('0x30')][_0x3eb4('0x35')]));_0x140343[_0x3eb4('0x33')]=_0x140343[_0x3eb4('0x33')]['length']?_0x140343['attributes']:_0x34da0d[_0x3eb4('0x2f')];if(_0x5be81b[_0x3eb4('0x30')][_0x3eb4('0x40')]){_0x140343[_0x3eb4('0x41')]=[{'all':!![]}];}_0x140343=_[_0x3eb4('0x3c')]({},_0x140343,_0x5be81b[_0x3eb4('0x3e')]);return db[_0x3eb4('0x3f')][_0x3eb4('0x47')](_0x140343)[_0x3eb4('0x27')](handleEntityNotFound(_0x2c958,null))[_0x3eb4('0x27')](respondWithResult(_0x2c958,null))['catch'](handleError(_0x2c958,null));};exports[_0x3eb4('0x48')]=function(_0x7cb397,_0x11362b){return db['Campaign']['create'](_0x7cb397[_0x3eb4('0x49')],{})['then'](function(_0x3da2e6){var _0x453ba4=_0x7cb397[_0x3eb4('0x4a')][_0x3eb4('0x24')]({'plain':!![]});if(!_0x453ba4)throw new Error(_0x3eb4('0x4b'));if(_0x453ba4[_0x3eb4('0x4c')]===_0x3eb4('0x4a')){var _0x1ff839=_0x3da2e6[_0x3eb4('0x24')]({'plain':!![]});var _0x20221d=_0x3eb4('0x25');return db[_0x3eb4('0x4d')][_0x3eb4('0x47')]({'where':{'name':_0x20221d,'userProfileId':_0x453ba4['userProfileId']},'raw':!![]})[_0x3eb4('0x27')](function(_0x85da6f){if(_0x85da6f&&_0x85da6f['autoAssociation']===0x0){return db[_0x3eb4('0x26')]['create']({'name':_0x1ff839[_0x3eb4('0x29')],'resourceId':_0x1ff839['id'],'type':_0x85da6f[_0x3eb4('0x29')],'sectionId':_0x85da6f['id']},{})[_0x3eb4('0x27')](function(){return _0x3da2e6;});}else{return _0x3da2e6;}})[_0x3eb4('0x4e')](function(_0x134d2e){logger[_0x3eb4('0x4f')](_0x3eb4('0x50'),_0x134d2e);throw _0x134d2e;});}return _0x3da2e6;})[_0x3eb4('0x27')](respondWithResult(_0x11362b,0xc9))['catch'](handleError(_0x11362b,null));};exports['clone']=function(_0x34b431,_0x1eab5a){var _0x5a9eec={'where':{'id':_0x34b431[_0x3eb4('0x45')]['id']}},_0x1c8f40={};_0x1c8f40['model']=_[_0x3eb4('0x31')](db['Campaign'][_0x3eb4('0x46')]);_0x5a9eec[_0x3eb4('0x33')]=_['intersection'](_0x1c8f40[_0x3eb4('0x2f')],qs['fields'](_0x34b431[_0x3eb4('0x30')][_0x3eb4('0x35')]));_0x5a9eec[_0x3eb4('0x33')]=_0x5a9eec[_0x3eb4('0x33')]['length']?_0x5a9eec['attributes']:_0x1c8f40[_0x3eb4('0x2f')];if(_0x34b431[_0x3eb4('0x30')]['includeAll']){_0x5a9eec[_0x3eb4('0x41')]=[{'all':!![]}];}_0x5a9eec=_[_0x3eb4('0x3c')]({},_0x5a9eec,_0x34b431[_0x3eb4('0x3e')]);return db[_0x3eb4('0x3f')][_0x3eb4('0x47')](_0x5a9eec)[_0x3eb4('0x27')](handleEntityNotFound(_0x1eab5a,null))['then'](function(_0x4c1315){if(_0x4c1315){var _0x16e131=_0x4c1315[_0x3eb4('0x24')]({'plain':!![]});_0x16e131=qs[_0x3eb4('0x51')](_0x16e131,['id',_0x3eb4('0x52'),_0x3eb4('0x53')]);_0x34b431[_0x3eb4('0x49')]=_[_0x3eb4('0x51')](_0x34b431['body'],['id',_0x3eb4('0x52'),'updatedAt']);return db[_0x3eb4('0x3f')][_0x3eb4('0x48')](_[_0x3eb4('0x3c')](_0x16e131,_0x34b431[_0x3eb4('0x49')]),{'include':_0x34b431[_0x3eb4('0x30')][_0x3eb4('0x40')]?[{'all':!![]}]:undefined})[_0x3eb4('0x27')](function(_0x5b22fa){var _0x565e18=_0x34b431[_0x3eb4('0x4a')][_0x3eb4('0x24')]({'plain':!![]});if(!_0x565e18)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x565e18[_0x3eb4('0x4c')]===_0x3eb4('0x4a')){var _0x1ca2a2=_0x5b22fa[_0x3eb4('0x24')]({'plain':!![]});var _0x156304=_0x3eb4('0x25');return db[_0x3eb4('0x4d')][_0x3eb4('0x47')]({'where':{'name':_0x156304,'userProfileId':_0x565e18[_0x3eb4('0x54')]},'raw':!![]})['then'](function(_0x43d75f){if(_0x43d75f&&_0x43d75f[_0x3eb4('0x55')]===0x0){return db[_0x3eb4('0x26')]['create']({'name':_0x1ca2a2[_0x3eb4('0x29')],'resourceId':_0x1ca2a2['id'],'type':_0x43d75f[_0x3eb4('0x29')],'sectionId':_0x43d75f['id']},{})['then'](function(){return _0x5b22fa;});}else{return _0x5b22fa;}})[_0x3eb4('0x4e')](function(_0x4d3bd2){logger[_0x3eb4('0x4f')](_0x3eb4('0x50'),_0x4d3bd2);throw _0x4d3bd2;});}return _0x5b22fa;});}})['then'](respondWithResult(_0x1eab5a,0xc9))[_0x3eb4('0x4e')](handleError(_0x1eab5a,null));};exports['update']=function(_0x1f8584,_0x58a2b8){if(_0x1f8584['body']['id']){delete _0x1f8584[_0x3eb4('0x49')]['id'];}return db[_0x3eb4('0x3f')][_0x3eb4('0x47')]({'where':{'id':_0x1f8584[_0x3eb4('0x45')]['id']}})[_0x3eb4('0x27')](handleEntityNotFound(_0x58a2b8,null))[_0x3eb4('0x27')](saveUpdates(_0x1f8584[_0x3eb4('0x49')],null))[_0x3eb4('0x27')](respondWithResult(_0x58a2b8,null))[_0x3eb4('0x4e')](handleError(_0x58a2b8,null));};exports[_0x3eb4('0x23')]=function(_0x1a0215,_0x23455f){return db[_0x3eb4('0x3f')]['find']({'where':{'id':_0x1a0215['params']['id']}})[_0x3eb4('0x27')](handleEntityNotFound(_0x23455f,null))[_0x3eb4('0x27')](removeEntity(_0x23455f,null))[_0x3eb4('0x4e')](handleError(_0x23455f,null));};exports['getHoppers']=function(_0x2dc9d9,_0x229261,_0xe77724){var _0x32b1b8={'raw':!![],'where':{}};var _0x2fcfc2={};var _0x4b12d3={'count':0x0,'rows':[]};return db[_0x3eb4('0x3f')][_0x3eb4('0x56')]({'where':{'id':_0x2dc9d9[_0x3eb4('0x45')]['id']}})['then'](handleEntityNotFound(_0x229261,null))[_0x3eb4('0x27')](function(_0x140a4a){if(_0x140a4a){_0x2fcfc2[_0x3eb4('0x2f')]=_[_0x3eb4('0x31')](db[_0x3eb4('0x57')][_0x3eb4('0x46')]);_0x2fcfc2[_0x3eb4('0x30')]=_[_0x3eb4('0x31')](_0x2dc9d9['query']);_0x2fcfc2['filters']=_['intersection'](_0x2fcfc2[_0x3eb4('0x2f')],_0x2fcfc2['query']);_0x32b1b8[_0x3eb4('0x33')]=_[_0x3eb4('0x34')](_0x2fcfc2[_0x3eb4('0x2f')],qs[_0x3eb4('0x35')](_0x2dc9d9['query']['fields']));_0x32b1b8['attributes']=_0x32b1b8['attributes'][_0x3eb4('0x58')]?_0x32b1b8[_0x3eb4('0x33')]:_0x2fcfc2[_0x3eb4('0x2f')];if(!_0x2dc9d9[_0x3eb4('0x30')][_0x3eb4('0x36')]('nolimit')){_0x32b1b8[_0x3eb4('0x1a')]=qs['limit'](_0x2dc9d9[_0x3eb4('0x30')][_0x3eb4('0x1a')]);_0x32b1b8[_0x3eb4('0x18')]=qs[_0x3eb4('0x18')](_0x2dc9d9[_0x3eb4('0x30')][_0x3eb4('0x18')]);}_0x32b1b8[_0x3eb4('0x38')]=qs[_0x3eb4('0x39')](_0x2dc9d9['query'][_0x3eb4('0x39')]);_0x32b1b8[_0x3eb4('0x3a')]=qs[_0x3eb4('0x32')](_[_0x3eb4('0x59')](_0x2dc9d9[_0x3eb4('0x30')],_0x2fcfc2['filters']));_0x32b1b8[_0x3eb4('0x3a')]['CampaignId']=_0x140a4a['id'];if(_0x2dc9d9[_0x3eb4('0x30')][_0x3eb4('0x3b')]){_0x32b1b8[_0x3eb4('0x3a')]=_[_0x3eb4('0x3c')](_0x32b1b8[_0x3eb4('0x3a')],{'$or':_[_0x3eb4('0x2b')](_0x32b1b8[_0x3eb4('0x33')],function(_0xa5a9d0){var _0x514f99={};_0x514f99[_0xa5a9d0]={'$like':'%'+_0x2dc9d9[_0x3eb4('0x30')][_0x3eb4('0x3b')]+'%'};return _0x514f99;})});}_0x32b1b8=_[_0x3eb4('0x3c')]({},_0x32b1b8,_0x2dc9d9[_0x3eb4('0x3e')]);return db['CmHopper'][_0x3eb4('0x1b')]({'where':_0x32b1b8['where']})[_0x3eb4('0x27')](function(_0x160bda){_0x4b12d3['count']=_0x160bda;if(_0x2dc9d9[_0x3eb4('0x30')][_0x3eb4('0x40')]){_0x32b1b8[_0x3eb4('0x41')]=[{'all':!![]}];}return db[_0x3eb4('0x57')][_0x3eb4('0x42')](_0x32b1b8);})[_0x3eb4('0x27')](function(_0x27818a){_0x4b12d3[_0x3eb4('0x43')]=_0x27818a;return _0x4b12d3;});}})[_0x3eb4('0x27')](respondWithFilteredResult(_0x229261,_0x32b1b8))[_0x3eb4('0x4e')](handleError(_0x229261,null));};exports['getHopperHistories']=function(_0x337595,_0x513146,_0x1453b8){var _0x750267={'raw':!![],'where':{}};var _0x4286f3={};var _0x4e9984={'count':0x0,'rows':[]};return db[_0x3eb4('0x3f')][_0x3eb4('0x56')]({'where':{'id':_0x337595['params']['id']}})['then'](handleEntityNotFound(_0x513146,null))[_0x3eb4('0x27')](function(_0x80000f){if(_0x80000f){_0x4286f3['model']=_[_0x3eb4('0x31')](db[_0x3eb4('0x5a')][_0x3eb4('0x46')]);_0x4286f3[_0x3eb4('0x30')]=_[_0x3eb4('0x31')](_0x337595[_0x3eb4('0x30')]);_0x4286f3[_0x3eb4('0x32')]=_[_0x3eb4('0x34')](_0x4286f3['model'],_0x4286f3[_0x3eb4('0x30')]);_0x750267['attributes']=_['intersection'](_0x4286f3['model'],qs[_0x3eb4('0x35')](_0x337595[_0x3eb4('0x30')][_0x3eb4('0x35')]));_0x750267[_0x3eb4('0x33')]=_0x750267[_0x3eb4('0x33')][_0x3eb4('0x58')]?_0x750267[_0x3eb4('0x33')]:_0x4286f3[_0x3eb4('0x2f')];if(!_0x337595[_0x3eb4('0x30')][_0x3eb4('0x36')](_0x3eb4('0x37'))){_0x750267[_0x3eb4('0x1a')]=qs[_0x3eb4('0x1a')](_0x337595[_0x3eb4('0x30')][_0x3eb4('0x1a')]);_0x750267['offset']=qs[_0x3eb4('0x18')](_0x337595[_0x3eb4('0x30')][_0x3eb4('0x18')]);}_0x750267[_0x3eb4('0x38')]=qs[_0x3eb4('0x39')](_0x337595[_0x3eb4('0x30')][_0x3eb4('0x39')]);_0x750267[_0x3eb4('0x3a')]=qs[_0x3eb4('0x32')](_[_0x3eb4('0x59')](_0x337595[_0x3eb4('0x30')],_0x4286f3['filters']));_0x750267[_0x3eb4('0x3a')][_0x3eb4('0x5b')]=_0x80000f['id'];if(_0x337595[_0x3eb4('0x30')][_0x3eb4('0x3b')]){_0x750267[_0x3eb4('0x3a')]=_[_0x3eb4('0x3c')](_0x750267[_0x3eb4('0x3a')],{'$or':_[_0x3eb4('0x2b')](_0x750267['attributes'],function(_0xf4928d){var _0x1fa262={};_0x1fa262[_0xf4928d]={'$like':'%'+_0x337595[_0x3eb4('0x30')]['filter']+'%'};return _0x1fa262;})});}_0x750267=_[_0x3eb4('0x3c')]({},_0x750267,_0x337595[_0x3eb4('0x3e')]);return db[_0x3eb4('0x5a')][_0x3eb4('0x1b')]({'where':_0x750267[_0x3eb4('0x3a')]})[_0x3eb4('0x27')](function(_0x7a85e4){_0x4e9984[_0x3eb4('0x1b')]=_0x7a85e4;if(_0x337595[_0x3eb4('0x30')][_0x3eb4('0x40')]){_0x750267[_0x3eb4('0x41')]=[{'all':!![]}];}return db[_0x3eb4('0x5a')]['findAll'](_0x750267);})['then'](function(_0x983a61){_0x4e9984[_0x3eb4('0x43')]=_0x983a61;return _0x4e9984;});}})[_0x3eb4('0x27')](respondWithFilteredResult(_0x513146,_0x750267))['catch'](handleError(_0x513146,null));};exports[_0x3eb4('0x5c')]=function(_0x38e7dc,_0x322108,_0x1dfc71){var _0x27538e={'raw':!![],'where':{}};var _0x3806d2={};var _0x485a76={'count':0x0,'rows':[]};return db[_0x3eb4('0x3f')]['findOne']({'where':{'id':_0x38e7dc[_0x3eb4('0x45')]['id']}})['then'](handleEntityNotFound(_0x322108,null))[_0x3eb4('0x27')](function(_0x382cfe){if(_0x382cfe){_0x3806d2['model']=_[_0x3eb4('0x31')](db[_0x3eb4('0x5d')]['rawAttributes']);_0x3806d2[_0x3eb4('0x30')]=_[_0x3eb4('0x31')](_0x38e7dc[_0x3eb4('0x30')]);_0x3806d2[_0x3eb4('0x32')]=_[_0x3eb4('0x34')](_0x3806d2[_0x3eb4('0x2f')],_0x3806d2['query']);_0x27538e[_0x3eb4('0x33')]=_[_0x3eb4('0x34')](_0x3806d2[_0x3eb4('0x2f')],qs[_0x3eb4('0x35')](_0x38e7dc[_0x3eb4('0x30')][_0x3eb4('0x35')]));_0x27538e[_0x3eb4('0x33')]=_0x27538e[_0x3eb4('0x33')]['length']?_0x27538e[_0x3eb4('0x33')]:_0x3806d2['model'];if(!_0x38e7dc['query'][_0x3eb4('0x36')]('nolimit')){_0x27538e[_0x3eb4('0x1a')]=qs['limit'](_0x38e7dc[_0x3eb4('0x30')][_0x3eb4('0x1a')]);_0x27538e[_0x3eb4('0x18')]=qs[_0x3eb4('0x18')](_0x38e7dc['query'][_0x3eb4('0x18')]);}_0x27538e[_0x3eb4('0x38')]=qs['sort'](_0x38e7dc[_0x3eb4('0x30')][_0x3eb4('0x39')]);_0x27538e[_0x3eb4('0x3a')]=qs[_0x3eb4('0x32')](_[_0x3eb4('0x59')](_0x38e7dc[_0x3eb4('0x30')],_0x3806d2[_0x3eb4('0x32')]));_0x27538e['where'][_0x3eb4('0x5b')]=_0x382cfe['id'];if(_0x38e7dc[_0x3eb4('0x30')][_0x3eb4('0x3b')]){_0x27538e[_0x3eb4('0x3a')]=_['merge'](_0x27538e[_0x3eb4('0x3a')],{'$or':_[_0x3eb4('0x2b')](_0x27538e[_0x3eb4('0x33')],function(_0x230958){var _0x171885={};_0x171885[_0x230958]={'$like':'%'+_0x38e7dc[_0x3eb4('0x30')]['filter']+'%'};return _0x171885;})});}_0x27538e=_[_0x3eb4('0x3c')]({},_0x27538e,_0x38e7dc[_0x3eb4('0x3e')]);return db['CmHopperFinal'][_0x3eb4('0x1b')]({'where':_0x27538e['where']})[_0x3eb4('0x27')](function(_0x513ab6){_0x485a76[_0x3eb4('0x1b')]=_0x513ab6;if(_0x38e7dc[_0x3eb4('0x30')][_0x3eb4('0x40')]){_0x27538e[_0x3eb4('0x41')]=[{'all':!![]}];}return db[_0x3eb4('0x5d')][_0x3eb4('0x42')](_0x27538e);})[_0x3eb4('0x27')](function(_0x15ae28){_0x485a76[_0x3eb4('0x43')]=_0x15ae28;return _0x485a76;});}})[_0x3eb4('0x27')](respondWithFilteredResult(_0x322108,_0x27538e))[_0x3eb4('0x4e')](handleError(_0x322108,null));};exports[_0x3eb4('0x5e')]=function(_0x4756fd,_0x364a96,_0x5cd0d7){var _0x280d04={'raw':!![],'where':{}};var _0x31ebe4={};var _0x36d096={'count':0x0,'rows':[]};return db['Campaign'][_0x3eb4('0x56')]({'where':{'id':_0x4756fd[_0x3eb4('0x45')]['id']}})[_0x3eb4('0x27')](handleEntityNotFound(_0x364a96,null))[_0x3eb4('0x27')](function(_0x339dc7){if(_0x339dc7){_0x31ebe4[_0x3eb4('0x2f')]=_[_0x3eb4('0x31')](db[_0x3eb4('0x5f')][_0x3eb4('0x46')]);_0x31ebe4['query']=_[_0x3eb4('0x31')](_0x4756fd[_0x3eb4('0x30')]);_0x31ebe4[_0x3eb4('0x32')]=_[_0x3eb4('0x34')](_0x31ebe4[_0x3eb4('0x2f')],_0x31ebe4[_0x3eb4('0x30')]);_0x280d04[_0x3eb4('0x33')]=_['intersection'](_0x31ebe4[_0x3eb4('0x2f')],qs[_0x3eb4('0x35')](_0x4756fd['query'][_0x3eb4('0x35')]));_0x280d04[_0x3eb4('0x33')]=_0x280d04['attributes'][_0x3eb4('0x58')]?_0x280d04[_0x3eb4('0x33')]:_0x31ebe4[_0x3eb4('0x2f')];if(!_0x4756fd['query'][_0x3eb4('0x36')](_0x3eb4('0x37'))){_0x280d04[_0x3eb4('0x1a')]=qs[_0x3eb4('0x1a')](_0x4756fd[_0x3eb4('0x30')]['limit']);_0x280d04[_0x3eb4('0x18')]=qs['offset'](_0x4756fd['query'][_0x3eb4('0x18')]);}_0x280d04[_0x3eb4('0x38')]=qs['sort'](_0x4756fd[_0x3eb4('0x30')]['sort']);_0x280d04[_0x3eb4('0x3a')]=qs[_0x3eb4('0x32')](_[_0x3eb4('0x59')](_0x4756fd['query'],_0x31ebe4[_0x3eb4('0x32')]));_0x280d04['where'][_0x3eb4('0x5b')]=_0x339dc7['id'];if(_0x4756fd[_0x3eb4('0x30')][_0x3eb4('0x3b')]){_0x280d04[_0x3eb4('0x3a')]=_[_0x3eb4('0x3c')](_0x280d04[_0x3eb4('0x3a')],{'$or':_[_0x3eb4('0x2b')](_0x280d04[_0x3eb4('0x33')],function(_0x3476b9){var _0x9a89cd={};_0x9a89cd[_0x3476b9]={'$like':'%'+_0x4756fd[_0x3eb4('0x30')][_0x3eb4('0x3b')]+'%'};return _0x9a89cd;})});}_0x280d04=_[_0x3eb4('0x3c')]({},_0x280d04,_0x4756fd[_0x3eb4('0x3e')]);return db[_0x3eb4('0x5f')]['count']({'where':_0x280d04['where']})['then'](function(_0x38171e){_0x36d096[_0x3eb4('0x1b')]=_0x38171e;if(_0x4756fd['query'][_0x3eb4('0x40')]){_0x280d04[_0x3eb4('0x41')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x3eb4('0x42')](_0x280d04);})[_0x3eb4('0x27')](function(_0x3fcff8){_0x36d096[_0x3eb4('0x43')]=_0x3fcff8;return _0x36d096;});}})[_0x3eb4('0x27')](respondWithFilteredResult(_0x364a96,_0x280d04))[_0x3eb4('0x4e')](handleError(_0x364a96,null));};exports[_0x3eb4('0x60')]=function(_0x47f1a9,_0x36b46a,_0x55b83a){var _0x1f527f={};var _0x269043={};var _0x2d845d;var _0x3697e8;return db['Campaign'][_0x3eb4('0x56')]({'where':{'id':_0x47f1a9['params']['id']}})[_0x3eb4('0x27')](handleEntityNotFound(_0x36b46a,null))[_0x3eb4('0x27')](function(_0x1b05eb){if(_0x1b05eb){_0x2d845d=_0x1b05eb;_0x269043[_0x3eb4('0x2f')]=_['keys'](db['CmList'][_0x3eb4('0x46')]);_0x269043[_0x3eb4('0x30')]=_[_0x3eb4('0x31')](_0x47f1a9[_0x3eb4('0x30')]);_0x269043['filters']=_['intersection'](_0x269043[_0x3eb4('0x2f')],_0x269043[_0x3eb4('0x30')]);_0x1f527f[_0x3eb4('0x33')]=_[_0x3eb4('0x34')](_0x269043[_0x3eb4('0x2f')],qs[_0x3eb4('0x35')](_0x47f1a9[_0x3eb4('0x30')][_0x3eb4('0x35')]));_0x1f527f[_0x3eb4('0x33')]=_0x1f527f['attributes'][_0x3eb4('0x58')]?_0x1f527f[_0x3eb4('0x33')]:_0x269043['model'];_0x1f527f[_0x3eb4('0x38')]=qs[_0x3eb4('0x39')](_0x47f1a9[_0x3eb4('0x30')][_0x3eb4('0x39')]);_0x1f527f[_0x3eb4('0x3a')]=qs[_0x3eb4('0x32')](_['pick'](_0x47f1a9[_0x3eb4('0x30')],_0x269043[_0x3eb4('0x32')]));if(_0x47f1a9['query']['filter']){_0x1f527f[_0x3eb4('0x3a')]=_[_0x3eb4('0x3c')](_0x1f527f[_0x3eb4('0x3a')],{'$or':_['map'](_0x1f527f[_0x3eb4('0x33')],function(_0xabc43b){var _0x68e89f={};_0x68e89f[_0xabc43b]={'$like':'%'+_0x47f1a9[_0x3eb4('0x30')][_0x3eb4('0x3b')]+'%'};return _0x68e89f;})});}_0x1f527f=_[_0x3eb4('0x3c')]({},_0x1f527f,_0x47f1a9[_0x3eb4('0x3e')]);return _0x2d845d['getLists'](_0x1f527f);}})[_0x3eb4('0x27')](function(_0x36cb11){if(_0x36cb11){_0x3697e8=_0x36cb11['length'];if(!_0x47f1a9[_0x3eb4('0x30')][_0x3eb4('0x36')](_0x3eb4('0x37'))){_0x1f527f[_0x3eb4('0x1a')]=qs[_0x3eb4('0x1a')](_0x47f1a9[_0x3eb4('0x30')][_0x3eb4('0x1a')]);_0x1f527f[_0x3eb4('0x18')]=qs[_0x3eb4('0x18')](_0x47f1a9[_0x3eb4('0x30')]['offset']);}return _0x2d845d[_0x3eb4('0x60')](_0x1f527f);}})[_0x3eb4('0x27')](function(_0x1b84f7){if(_0x1b84f7){return _0x1b84f7?{'count':_0x3697e8,'rows':_0x1b84f7}:null;}})[_0x3eb4('0x27')](respondWithResult(_0x36b46a,null))['catch'](handleError(_0x36b46a,null));};exports['addLists']=function(_0x3b5844,_0x35d863,_0x2a8795){var _0x2e90dd,_0x1de48d;var _0x5c45b7=[];var _0xb2f96c=moment()[_0x3eb4('0x61')](_0x3eb4('0x62'));return db['Campaign'][_0x3eb4('0x47')]({'where':{'id':_0x3b5844[_0x3eb4('0x45')]['id']}})[_0x3eb4('0x27')](handleEntityNotFound(_0x35d863,null))[_0x3eb4('0x27')](function(_0x262b1d){if(_0x262b1d){_0x1de48d=_0x262b1d;return _0x262b1d[_0x3eb4('0x63')](_0x3b5844[_0x3eb4('0x49')][_0x3eb4('0x64')],_['omit'](_0x3b5844[_0x3eb4('0x49')],['ids','id'])||{});}return null;})[_0x3eb4('0x65')](function(_0x231eb5){var _0x57e7f1;var _0x42366d;_0x2e90dd=_0x231eb5||[];var _0x59297c=[];if(_0x231eb5){for(var _0x3c90f6=0x0;_0x3c90f6<_0x231eb5[_0x3eb4('0x58')];_0x3c90f6+=0x1){var _0x2dca0f=_0x231eb5[_0x3c90f6][_0x3eb4('0x24')]({'plain':!![]});_0x1de48d[_0x3eb4('0x66')]=_0x3b5844[_0x3eb4('0x49')]['dialCheckDuplicateType']?_0x3b5844[_0x3eb4('0x49')][_0x3eb4('0x66')]:_0x1de48d[_0x3eb4('0x66')];switch(_0x1de48d[_0x3eb4('0x66')]){case _0x3eb4('0x67'):_0x57e7f1=squel['insert']()[_0x3eb4('0x68')](_0x3eb4('0x69'))[_0x3eb4('0x6a')](['phone',_0x3eb4('0x6b'),_0x3eb4('0x6c'),'ListId',_0x3eb4('0x5b'),_0x3eb4('0x52'),_0x3eb4('0x53')],squel[_0x3eb4('0x6d')]()['field'](_0x3eb4('0x6e'),'phone')[_0x3eb4('0x6f')]('NOW()',_0x3eb4('0x6b'))[_0x3eb4('0x6f')]('id',_0x3eb4('0x6c'))['field'](_0x2dca0f[_0x3eb4('0x70')][_0x3eb4('0x71')](),_0x3eb4('0x72'))['field'](_0x3b5844['params']['id'][_0x3eb4('0x71')](),_0x3eb4('0x5b'))[_0x3eb4('0x6f')]('\x27'+_0xb2f96c+'\x27',_0x3eb4('0x52'))[_0x3eb4('0x6f')]('\x27'+_0xb2f96c+'\x27',_0x3eb4('0x53'))[_0x3eb4('0x73')](_0x3eb4('0x74'))[_0x3eb4('0x3a')](_0x3eb4('0x75'))[_0x3eb4('0x3a')]('ListId\x20=\x20?',_0x2dca0f[_0x3eb4('0x70')][_0x3eb4('0x71')]())[_0x3eb4('0x3a')]('phone\x20IS\x20NOT\x20NULL')[_0x3eb4('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x3eb4('0x76'))[_0x3eb4('0x73')](_0x3eb4('0x77'))['where'](_0x3eb4('0x78'),_0x3b5844[_0x3eb4('0x45')]['id'][_0x3eb4('0x71')]()))['where'](_0x3eb4('0x79'),squel[_0x3eb4('0x6d')]()['field'](_0x3eb4('0x7a'))[_0x3eb4('0x73')]('cm_hopper')['where'](_0x3eb4('0x78'),_0x3b5844['params']['id']['toString']())))[_0x3eb4('0x71')]();break;case _0x3eb4('0x7b'):_0x57e7f1=squel[_0x3eb4('0x7c')]()['into'](_0x3eb4('0x69'))['fromQuery']([_0x3eb4('0x6e'),_0x3eb4('0x6b'),_0x3eb4('0x6c'),_0x3eb4('0x72'),_0x3eb4('0x5b'),_0x3eb4('0x52'),'updatedAt'],squel[_0x3eb4('0x6d')]()['field'](_0x3eb4('0x6e'),_0x3eb4('0x6e'))[_0x3eb4('0x6f')](_0x3eb4('0x7d'),'scheduledAt')[_0x3eb4('0x6f')]('id',_0x3eb4('0x6c'))['field'](_0x2dca0f['CmListId'][_0x3eb4('0x71')](),'ListId')[_0x3eb4('0x6f')](_0x3b5844['params']['id']['toString'](),_0x3eb4('0x5b'))[_0x3eb4('0x6f')]('\x27'+_0xb2f96c+'\x27',_0x3eb4('0x52'))['field']('\x27'+_0xb2f96c+'\x27',_0x3eb4('0x53'))[_0x3eb4('0x73')](_0x3eb4('0x74'))[_0x3eb4('0x3a')]('deletedAt\x20IS\x20NULL')[_0x3eb4('0x3a')](_0x3eb4('0x7e'),_0x2dca0f[_0x3eb4('0x70')][_0x3eb4('0x71')]())[_0x3eb4('0x3a')](_0x3eb4('0x7f'))[_0x3eb4('0x3a')](_0x3eb4('0x79'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0x3eb4('0x73')](_0x3eb4('0x69'))[_0x3eb4('0x3a')]('CampaignId\x20=\x20?',_0x3b5844[_0x3eb4('0x45')]['id'][_0x3eb4('0x71')]())))[_0x3eb4('0x71')]();break;default:_0x57e7f1=squel[_0x3eb4('0x7c')]()[_0x3eb4('0x68')]('cm_hopper')['fromQuery'](['phone',_0x3eb4('0x6b'),_0x3eb4('0x6c'),_0x3eb4('0x72'),_0x3eb4('0x5b'),_0x3eb4('0x52'),_0x3eb4('0x53')],squel[_0x3eb4('0x6d')]()[_0x3eb4('0x6f')](_0x3eb4('0x6e'),_0x3eb4('0x6e'))[_0x3eb4('0x6f')](_0x3eb4('0x7d'),'scheduledAt')['field']('id',_0x3eb4('0x6c'))['field'](_0x2dca0f[_0x3eb4('0x70')][_0x3eb4('0x71')](),'ListId')[_0x3eb4('0x6f')](_0x3b5844[_0x3eb4('0x45')]['id'][_0x3eb4('0x71')](),'CampaignId')[_0x3eb4('0x6f')]('\x27'+_0xb2f96c+'\x27',_0x3eb4('0x52'))[_0x3eb4('0x6f')]('\x27'+_0xb2f96c+'\x27',_0x3eb4('0x53'))['from'](_0x3eb4('0x74'))['where'](_0x3eb4('0x75'))[_0x3eb4('0x3a')](_0x3eb4('0x7e'),_0x2dca0f['CmListId'][_0x3eb4('0x71')]())[_0x3eb4('0x3a')](_0x3eb4('0x7f')))[_0x3eb4('0x71')]();}_0x42366d=squel[_0x3eb4('0x7c')]()[_0x3eb4('0x68')]('cm_hopper_additional_phones')[_0x3eb4('0x6a')]([_0x3eb4('0x80'),_0x3eb4('0x6b'),_0x3eb4('0x6e'),_0x3eb4('0x81'),_0x3eb4('0x52'),_0x3eb4('0x53')],squel['select']()[_0x3eb4('0x6f')](_0x3eb4('0x82'),'id')[_0x3eb4('0x6f')](_0x3eb4('0x7d'),_0x3eb4('0x6b'))['field'](_0x3eb4('0x83'),_0x3eb4('0x6e'))[_0x3eb4('0x6f')]('ci.OrderBY',_0x3eb4('0x81'))[_0x3eb4('0x6f')]('\x27'+_0xb2f96c+'\x27','createdAt')[_0x3eb4('0x6f')]('\x27'+_0xb2f96c+'\x27',_0x3eb4('0x53'))[_0x3eb4('0x73')](_0x3eb4('0x84'),'ci')[_0x3eb4('0x85')]('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0x3eb4('0x3a')](_0x3eb4('0x86'),_0x2dca0f[_0x3eb4('0x70')][_0x3eb4('0x71')]())[_0x3eb4('0x3a')](_0x3eb4('0x87'),_0x3b5844[_0x3eb4('0x45')]['id'][_0x3eb4('0x71')]())[_0x3eb4('0x3a')]('h.createdAt\x20=\x20?',_0xb2f96c))[_0x3eb4('0x71')]();_0x59297c[_0x3eb4('0x88')](db['sequelize'][_0x3eb4('0x30')](_0x57e7f1));_0x5c45b7['push'](db[_0x3eb4('0x89')][_0x3eb4('0x30')](_0x42366d));}return BPromise['all'](_0x59297c);}})['then'](function(){return BPromise[_0x3eb4('0x8a')](_0x5c45b7);})[_0x3eb4('0x27')](function(){return _0x2e90dd;})[_0x3eb4('0x27')](respondWithResult(_0x35d863,null))['catch'](handleError(_0x35d863,null));};exports[_0x3eb4('0x8b')]=function(_0x385f87,_0x5d6613,_0x1d24cc){return db[_0x3eb4('0x3f')][_0x3eb4('0x47')]({'where':{'id':_0x385f87['params']['id']}})[_0x3eb4('0x27')](handleEntityNotFound(_0x5d6613,null))[_0x3eb4('0x27')](function(_0x18018c){if(_0x18018c){return _0x18018c[_0x3eb4('0x8b')](_0x385f87['query'][_0x3eb4('0x64')]);}})[_0x3eb4('0x27')](function(_0x14dbb6){if(_0x14dbb6){return db['CmHopper']['destroy']({'where':{'ListId':_0x385f87[_0x3eb4('0x30')][_0x3eb4('0x64')],'CampaignId':_0x385f87['params']['id']}})[_0x3eb4('0x27')](function(){return _0x14dbb6;});}})[_0x3eb4('0x27')](respondWithStatusCode(_0x5d6613,null))[_0x3eb4('0x4e')](handleError(_0x5d6613,null));};exports['getBlackLists']=function(_0xbad989,_0x517544,_0x13f2e8){var _0x1fafc2={};var _0x45d8b4={};var _0x324cd3;var _0x23db46;return db[_0x3eb4('0x3f')][_0x3eb4('0x56')]({'where':{'id':_0xbad989[_0x3eb4('0x45')]['id']}})[_0x3eb4('0x27')](handleEntityNotFound(_0x517544,null))[_0x3eb4('0x27')](function(_0x148a33){if(_0x148a33){_0x324cd3=_0x148a33;_0x45d8b4['model']=_['keys'](db[_0x3eb4('0x8c')][_0x3eb4('0x46')]);_0x45d8b4[_0x3eb4('0x30')]=_[_0x3eb4('0x31')](_0xbad989[_0x3eb4('0x30')]);_0x45d8b4[_0x3eb4('0x32')]=_[_0x3eb4('0x34')](_0x45d8b4['model'],_0x45d8b4['query']);_0x1fafc2[_0x3eb4('0x33')]=_[_0x3eb4('0x34')](_0x45d8b4[_0x3eb4('0x2f')],qs['fields'](_0xbad989[_0x3eb4('0x30')][_0x3eb4('0x35')]));_0x1fafc2['attributes']=_0x1fafc2[_0x3eb4('0x33')][_0x3eb4('0x58')]?_0x1fafc2['attributes']:_0x45d8b4[_0x3eb4('0x2f')];_0x1fafc2[_0x3eb4('0x38')]=qs[_0x3eb4('0x39')](_0xbad989[_0x3eb4('0x30')][_0x3eb4('0x39')]);_0x1fafc2[_0x3eb4('0x3a')]=qs[_0x3eb4('0x32')](_[_0x3eb4('0x59')](_0xbad989['query'],_0x45d8b4['filters']));if(_0xbad989['query']['filter']){_0x1fafc2[_0x3eb4('0x3a')]=_[_0x3eb4('0x3c')](_0x1fafc2['where'],{'$or':_['map'](_0x1fafc2[_0x3eb4('0x33')],function(_0x4b129f){var _0x62454={};_0x62454[_0x4b129f]={'$like':'%'+_0xbad989[_0x3eb4('0x30')][_0x3eb4('0x3b')]+'%'};return _0x62454;})});}_0x1fafc2=_['merge']({},_0x1fafc2,_0xbad989['options']);return _0x324cd3['getBlackLists'](_0x1fafc2);}})['then'](function(_0x4eadf6){if(_0x4eadf6){_0x23db46=_0x4eadf6[_0x3eb4('0x58')];if(!_0xbad989[_0x3eb4('0x30')]['hasOwnProperty'](_0x3eb4('0x37'))){_0x1fafc2[_0x3eb4('0x1a')]=qs[_0x3eb4('0x1a')](_0xbad989[_0x3eb4('0x30')][_0x3eb4('0x1a')]);_0x1fafc2[_0x3eb4('0x18')]=qs[_0x3eb4('0x18')](_0xbad989[_0x3eb4('0x30')][_0x3eb4('0x18')]);}return _0x324cd3[_0x3eb4('0x8d')](_0x1fafc2);}})[_0x3eb4('0x27')](function(_0x3dde3f){if(_0x3dde3f){return _0x3dde3f?{'count':_0x23db46,'rows':_0x3dde3f}:null;}})[_0x3eb4('0x27')](respondWithResult(_0x517544,null))[_0x3eb4('0x4e')](handleError(_0x517544,null));};exports[_0x3eb4('0x8e')]=function(_0x28af87,_0x34b434,_0x51f5f7){var _0x2e00d6,_0x56bdc1;var _0x3a6066=[];var _0x4da1d6=moment()[_0x3eb4('0x61')](_0x3eb4('0x62'));return db[_0x3eb4('0x3f')][_0x3eb4('0x47')]({'where':{'id':_0x28af87[_0x3eb4('0x45')]['id']}})[_0x3eb4('0x27')](handleEntityNotFound(_0x34b434,null))[_0x3eb4('0x27')](function(_0x565b9b){if(_0x565b9b){_0x56bdc1=_0x565b9b;return _0x565b9b[_0x3eb4('0x8e')](_0x28af87['body'][_0x3eb4('0x64')],_[_0x3eb4('0x51')](_0x28af87['body'],['ids','id'])||{});}return null;})[_0x3eb4('0x65')](function(_0x527cac){var _0xf6ac3c;var _0x222ae2;_0x2e00d6=_0x527cac||[];var _0x50134d=[];if(_0x527cac){for(var _0x91faa=0x0;_0x91faa<_0x527cac['length'];_0x91faa+=0x1){var _0x40bdc7=_0x527cac[_0x91faa][_0x3eb4('0x24')]({'plain':!![]});_0xf6ac3c=squel[_0x3eb4('0x7c')]()[_0x3eb4('0x68')](_0x3eb4('0x8f'))[_0x3eb4('0x6a')]([_0x3eb4('0x6e'),'ContactId',_0x3eb4('0x72'),_0x3eb4('0x5b'),_0x3eb4('0x52'),_0x3eb4('0x53')],squel[_0x3eb4('0x6d')]()[_0x3eb4('0x6f')](_0x3eb4('0x6e'),_0x3eb4('0x6e'))[_0x3eb4('0x6f')]('id',_0x3eb4('0x6c'))[_0x3eb4('0x6f')](_0x40bdc7[_0x3eb4('0x70')][_0x3eb4('0x71')](),_0x3eb4('0x72'))[_0x3eb4('0x6f')](_0x28af87[_0x3eb4('0x45')]['id'][_0x3eb4('0x71')](),_0x3eb4('0x5b'))[_0x3eb4('0x6f')](_0x3eb4('0x7d'),_0x3eb4('0x52'))[_0x3eb4('0x6f')](_0x3eb4('0x7d'),'updatedAt')[_0x3eb4('0x73')](_0x3eb4('0x74'))[_0x3eb4('0x3a')]('deletedAt\x20IS\x20NULL')[_0x3eb4('0x3a')](_0x3eb4('0x7e'),_0x40bdc7['CmListId']['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x50134d[_0x3eb4('0x88')](db['sequelize']['query'](_0xf6ac3c));}return BPromise[_0x3eb4('0x8a')](_0x50134d);}})[_0x3eb4('0x27')](function(){return _0x2e00d6;})['then'](respondWithResult(_0x34b434,null))[_0x3eb4('0x4e')](handleError(_0x34b434,null));};exports[_0x3eb4('0x90')]=function(_0x286db0,_0x51808b,_0x453924){return db[_0x3eb4('0x3f')]['find']({'where':{'id':_0x286db0[_0x3eb4('0x45')]['id']}})['then'](handleEntityNotFound(_0x51808b,null))[_0x3eb4('0x27')](function(_0x512db9){if(_0x512db9){return _0x512db9[_0x3eb4('0x90')](_0x286db0['query'][_0x3eb4('0x64')]);}})[_0x3eb4('0x27')](function(_0xb7b30e){if(_0xb7b30e){return db[_0x3eb4('0x5f')][_0x3eb4('0x23')]({'where':{'ListId':_0x286db0['query']['ids'],'CampaignId':_0x286db0['params']['id']}})['then'](function(){return _0xb7b30e;});}})[_0x3eb4('0x27')](respondWithStatusCode(_0x51808b,null))[_0x3eb4('0x4e')](handleError(_0x51808b,null));}; \ No newline at end of file +var _0xa1bf=['YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','save','then','destroy','get','IvrCampaigns','error','stack','name','send','index','map','Campaign','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','keys','omit','createdAt','updatedAt','UserProfileResource','update','findOne','CmHopper','pick','rows','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','CampaignId','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','phone','scheduledAt','select','field','ContactId','toString','cm_contacts','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','from','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_hopper','fromQuery','ListId','NOW()','deletedAt\x20IS\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','format'];(function(_0x4fad2c,_0x22cacc){var _0x1bb1b7=function(_0x4914a4){while(--_0x4914a4){_0x4fad2c['push'](_0x4fad2c['shift']());}};_0x1bb1b7(++_0x22cacc);}(_0xa1bf,0x91));var _0xfa1b=function(_0x513dde,_0x27b9c2){_0x513dde=_0x513dde-0x0;var _0x592532=_0xa1bf[_0x513dde];return _0x592532;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfa1b('0x0'));var zipdir=require(_0xfa1b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfa1b('0x2'));var moment=require(_0xfa1b('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfa1b('0x4'));var util=require(_0xfa1b('0x5'));var path=require(_0xfa1b('0x6'));var sox=require('sox');var csv=require(_0xfa1b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfa1b('0x8'));var _=require(_0xfa1b('0x9'));var squel=require(_0xfa1b('0xa'));var crypto=require(_0xfa1b('0xb'));var jsforce=require(_0xfa1b('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfa1b('0xd'));var Redis=require(_0xfa1b('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfa1b('0xf'));var hardwareService=require(_0xfa1b('0x10'));var logger=require('../../config/logger')(_0xfa1b('0x11'));var utils=require(_0xfa1b('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xfa1b('0x13'));var db=require(_0xfa1b('0x14'))['db'];function respondWithStatusCode(_0x48e55d,_0x1c5188){_0x1c5188=_0x1c5188||0xcc;return function(_0x495990){if(_0x495990){return _0x48e55d[_0xfa1b('0x15')](_0x1c5188);}return _0x48e55d[_0xfa1b('0x16')](_0x1c5188)[_0xfa1b('0x17')]();};}function respondWithResult(_0x5a4759,_0x5df8d5){_0x5df8d5=_0x5df8d5||0xc8;return function(_0x203e42){if(_0x203e42){return _0x5a4759[_0xfa1b('0x16')](_0x5df8d5)[_0xfa1b('0x18')](_0x203e42);}};}function respondWithFilteredResult(_0x22f72c,_0x34f8cf){return function(_0x4abc7e){if(_0x4abc7e){var _0xd7c372=typeof _0x34f8cf['offset']==='undefined'&&typeof _0x34f8cf['limit']===_0xfa1b('0x19');var _0x4afde3=_0x4abc7e[_0xfa1b('0x1a')];var _0x477f6d=_0xd7c372?0x0:_0x34f8cf['offset'];var _0xe79c2f=_0xd7c372?_0x4abc7e['count']:_0x34f8cf[_0xfa1b('0x1b')]+_0x34f8cf[_0xfa1b('0x1c')];var _0x4dab20;if(_0xe79c2f>=_0x4afde3){_0xe79c2f=_0x4afde3;_0x4dab20=0xc8;}else{_0x4dab20=0xce;}_0x22f72c[_0xfa1b('0x16')](_0x4dab20);return _0x22f72c[_0xfa1b('0x1d')]('Content-Range',_0x477f6d+'-'+_0xe79c2f+'/'+_0x4afde3)[_0xfa1b('0x18')](_0x4abc7e);}return null;};}function patchUpdates(_0x555a06){return function(_0x4be457){try{jsonpatch[_0xfa1b('0x1e')](_0x4be457,_0x555a06,!![]);}catch(_0x1a3453){return BPromise['reject'](_0x1a3453);}return _0x4be457[_0xfa1b('0x1f')]();};}function saveUpdates(_0x493051,_0x57783c){return function(_0x5a54d3){if(_0x5a54d3){return _0x5a54d3['update'](_0x493051)[_0xfa1b('0x20')](function(_0x517354){return _0x517354;});}return null;};}function removeEntity(_0xf2d345,_0xd753c7){return function(_0x124eaf){if(_0x124eaf){return _0x124eaf[_0xfa1b('0x21')]()[_0xfa1b('0x20')](function(){var _0x4a4560=_0x124eaf[_0xfa1b('0x22')]({'plain':!![]});var _0x3b32c3=_0xfa1b('0x23');return db['UserProfileResource'][_0xfa1b('0x21')]({'where':{'type':_0x3b32c3,'resourceId':_0x4a4560['id']}})['then'](function(){return _0x124eaf;});})[_0xfa1b('0x20')](function(){_0xf2d345['status'](0xcc)[_0xfa1b('0x17')]();});}};}function handleEntityNotFound(_0x454e1b,_0x46c651){return function(_0x467f02){if(!_0x467f02){_0x454e1b[_0xfa1b('0x15')](0x194);}return _0x467f02;};}function handleError(_0x451508,_0x10644b){_0x10644b=_0x10644b||0x1f4;return function(_0x55d028){logger[_0xfa1b('0x24')](_0x55d028[_0xfa1b('0x25')]);if(_0x55d028[_0xfa1b('0x26')]){delete _0x55d028[_0xfa1b('0x26')];}_0x451508[_0xfa1b('0x16')](_0x10644b)[_0xfa1b('0x27')](_0x55d028);};}exports[_0xfa1b('0x28')]=function(_0x27b5b8,_0x15d1fc){var _0x16d5ab={},_0x11a4dc={},_0x1b2bcf={'count':0x0,'rows':[]};var _0x3d8f55=_[_0xfa1b('0x29')](db[_0xfa1b('0x2a')][_0xfa1b('0x2b')],function(_0x2d9cd5){return{'name':_0x2d9cd5['fieldName'],'type':_0x2d9cd5[_0xfa1b('0x2c')][_0xfa1b('0x2d')]};});_0x11a4dc[_0xfa1b('0x2e')]=_[_0xfa1b('0x29')](_0x3d8f55,'name');_0x11a4dc[_0xfa1b('0x2f')]=_['keys'](_0x27b5b8['query']);_0x11a4dc[_0xfa1b('0x30')]=_[_0xfa1b('0x31')](_0x11a4dc[_0xfa1b('0x2e')],_0x11a4dc[_0xfa1b('0x2f')]);_0x16d5ab[_0xfa1b('0x32')]=_[_0xfa1b('0x31')](_0x11a4dc[_0xfa1b('0x2e')],qs[_0xfa1b('0x33')](_0x27b5b8[_0xfa1b('0x2f')][_0xfa1b('0x33')]));_0x16d5ab[_0xfa1b('0x32')]=_0x16d5ab['attributes'][_0xfa1b('0x34')]?_0x16d5ab[_0xfa1b('0x32')]:_0x11a4dc['model'];if(!_0x27b5b8[_0xfa1b('0x2f')][_0xfa1b('0x35')](_0xfa1b('0x36'))){_0x16d5ab[_0xfa1b('0x1c')]=qs[_0xfa1b('0x1c')](_0x27b5b8['query'][_0xfa1b('0x1c')]);_0x16d5ab[_0xfa1b('0x1b')]=qs[_0xfa1b('0x1b')](_0x27b5b8[_0xfa1b('0x2f')][_0xfa1b('0x1b')]);}_0x16d5ab[_0xfa1b('0x37')]=qs[_0xfa1b('0x38')](_0x27b5b8[_0xfa1b('0x2f')]['sort']);_0x16d5ab[_0xfa1b('0x39')]=qs[_0xfa1b('0x30')](_['pick'](_0x27b5b8[_0xfa1b('0x2f')],_0x11a4dc[_0xfa1b('0x30')]),_0x3d8f55);if(_0x27b5b8[_0xfa1b('0x2f')][_0xfa1b('0x3a')]){_0x16d5ab['where']=_[_0xfa1b('0x3b')](_0x16d5ab[_0xfa1b('0x39')],{'$or':_[_0xfa1b('0x29')](_0x3d8f55,function(_0x1a3b99){if(_0x1a3b99[_0xfa1b('0x2c')]!=='VIRTUAL'){var _0x21b588={};_0x21b588[_0x1a3b99[_0xfa1b('0x26')]]={'$like':'%'+_0x27b5b8[_0xfa1b('0x2f')][_0xfa1b('0x3a')]+'%'};return _0x21b588;}})});}_0x16d5ab=_[_0xfa1b('0x3b')]({},_0x16d5ab,_0x27b5b8[_0xfa1b('0x3c')]);var _0x35ff3b={'where':_0x16d5ab[_0xfa1b('0x39')]};return db[_0xfa1b('0x2a')]['count'](_0x35ff3b)[_0xfa1b('0x20')](function(_0x378979){_0x1b2bcf[_0xfa1b('0x1a')]=_0x378979;if(_0x27b5b8[_0xfa1b('0x2f')][_0xfa1b('0x3d')]){_0x16d5ab[_0xfa1b('0x3e')]=[{'all':!![]}];}return db['Campaign'][_0xfa1b('0x3f')](_0x16d5ab);})[_0xfa1b('0x20')](function(_0x11cdad){_0x1b2bcf['rows']=_0x11cdad;return _0x1b2bcf;})[_0xfa1b('0x20')](respondWithFilteredResult(_0x15d1fc,_0x16d5ab))[_0xfa1b('0x40')](handleError(_0x15d1fc,null));};exports[_0xfa1b('0x41')]=function(_0x389433,_0x2b6e80){var _0x29fa0e={'raw':![],'where':{'id':_0x389433['params']['id']}},_0xd96416={};_0xd96416['model']=_['keys'](db[_0xfa1b('0x2a')][_0xfa1b('0x2b')]);_0xd96416[_0xfa1b('0x2f')]=_['keys'](_0x389433['query']);_0xd96416[_0xfa1b('0x30')]=_[_0xfa1b('0x31')](_0xd96416[_0xfa1b('0x2e')],_0xd96416[_0xfa1b('0x2f')]);_0x29fa0e[_0xfa1b('0x32')]=_[_0xfa1b('0x31')](_0xd96416['model'],qs[_0xfa1b('0x33')](_0x389433[_0xfa1b('0x2f')][_0xfa1b('0x33')]));_0x29fa0e[_0xfa1b('0x32')]=_0x29fa0e[_0xfa1b('0x32')][_0xfa1b('0x34')]?_0x29fa0e[_0xfa1b('0x32')]:_0xd96416['model'];if(_0x389433[_0xfa1b('0x2f')][_0xfa1b('0x3d')]){_0x29fa0e[_0xfa1b('0x3e')]=[{'all':!![]}];}_0x29fa0e=_[_0xfa1b('0x3b')]({},_0x29fa0e,_0x389433[_0xfa1b('0x3c')]);return db[_0xfa1b('0x2a')][_0xfa1b('0x42')](_0x29fa0e)[_0xfa1b('0x20')](handleEntityNotFound(_0x2b6e80,null))[_0xfa1b('0x20')](respondWithResult(_0x2b6e80,null))['catch'](handleError(_0x2b6e80,null));};exports[_0xfa1b('0x43')]=function(_0x12cf87,_0xc04d24){return db[_0xfa1b('0x2a')][_0xfa1b('0x43')](_0x12cf87[_0xfa1b('0x44')],{})[_0xfa1b('0x20')](function(_0xadffd){var _0x49ee1a=_0x12cf87['user'][_0xfa1b('0x22')]({'plain':!![]});if(!_0x49ee1a)throw new Error(_0xfa1b('0x45'));if(_0x49ee1a[_0xfa1b('0x46')]===_0xfa1b('0x47')){var _0x1bcc53=_0xadffd[_0xfa1b('0x22')]({'plain':!![]});var _0x436bc4=_0xfa1b('0x23');return db[_0xfa1b('0x48')][_0xfa1b('0x42')]({'where':{'name':_0x436bc4,'userProfileId':_0x49ee1a[_0xfa1b('0x49')]},'raw':!![]})['then'](function(_0xe37180){if(_0xe37180&&_0xe37180[_0xfa1b('0x4a')]===0x0){return db['UserProfileResource']['create']({'name':_0x1bcc53[_0xfa1b('0x26')],'resourceId':_0x1bcc53['id'],'type':_0xe37180[_0xfa1b('0x26')],'sectionId':_0xe37180['id']},{})[_0xfa1b('0x20')](function(){return _0xadffd;});}else{return _0xadffd;}})['catch'](function(_0x4c2862){logger[_0xfa1b('0x24')](_0xfa1b('0x4b'),_0x4c2862);throw _0x4c2862;});}return _0xadffd;})[_0xfa1b('0x20')](respondWithResult(_0xc04d24,0xc9))['catch'](handleError(_0xc04d24,null));};exports[_0xfa1b('0x4c')]=function(_0x197177,_0x4912d8){var _0x432e80={'where':{'id':_0x197177[_0xfa1b('0x4d')]['id']}},_0x546daf={};_0x546daf['model']=_[_0xfa1b('0x4e')](db[_0xfa1b('0x2a')]['rawAttributes']);_0x432e80[_0xfa1b('0x32')]=_['intersection'](_0x546daf['model'],qs['fields'](_0x197177[_0xfa1b('0x2f')][_0xfa1b('0x33')]));_0x432e80['attributes']=_0x432e80['attributes'][_0xfa1b('0x34')]?_0x432e80[_0xfa1b('0x32')]:_0x546daf[_0xfa1b('0x2e')];if(_0x197177[_0xfa1b('0x2f')][_0xfa1b('0x3d')]){_0x432e80[_0xfa1b('0x3e')]=[{'all':!![]}];}_0x432e80=_[_0xfa1b('0x3b')]({},_0x432e80,_0x197177[_0xfa1b('0x3c')]);return db[_0xfa1b('0x2a')]['find'](_0x432e80)[_0xfa1b('0x20')](handleEntityNotFound(_0x4912d8,null))[_0xfa1b('0x20')](function(_0x5d6169){if(_0x5d6169){var _0x1cf88e=_0x5d6169[_0xfa1b('0x22')]({'plain':!![]});_0x1cf88e=qs[_0xfa1b('0x4f')](_0x1cf88e,['id',_0xfa1b('0x50'),'updatedAt']);_0x197177[_0xfa1b('0x44')]=_[_0xfa1b('0x4f')](_0x197177['body'],['id',_0xfa1b('0x50'),_0xfa1b('0x51')]);return db[_0xfa1b('0x2a')][_0xfa1b('0x43')](_['merge'](_0x1cf88e,_0x197177['body']),{'include':_0x197177['query']['includeAll']?[{'all':!![]}]:undefined})[_0xfa1b('0x20')](function(_0x26cd17){var _0x5e93fe=_0x197177[_0xfa1b('0x47')][_0xfa1b('0x22')]({'plain':!![]});if(!_0x5e93fe)throw new Error(_0xfa1b('0x45'));if(_0x5e93fe['role']===_0xfa1b('0x47')){var _0x2a2e41=_0x26cd17[_0xfa1b('0x22')]({'plain':!![]});var _0x15e01d=_0xfa1b('0x23');return db[_0xfa1b('0x48')][_0xfa1b('0x42')]({'where':{'name':_0x15e01d,'userProfileId':_0x5e93fe['userProfileId']},'raw':!![]})['then'](function(_0x3293ce){if(_0x3293ce&&_0x3293ce[_0xfa1b('0x4a')]===0x0){return db[_0xfa1b('0x52')][_0xfa1b('0x43')]({'name':_0x2a2e41[_0xfa1b('0x26')],'resourceId':_0x2a2e41['id'],'type':_0x3293ce[_0xfa1b('0x26')],'sectionId':_0x3293ce['id']},{})[_0xfa1b('0x20')](function(){return _0x26cd17;});}else{return _0x26cd17;}})[_0xfa1b('0x40')](function(_0x20215b){logger[_0xfa1b('0x24')](_0xfa1b('0x4b'),_0x20215b);throw _0x20215b;});}return _0x26cd17;});}})['then'](respondWithResult(_0x4912d8,0xc9))['catch'](handleError(_0x4912d8,null));};exports[_0xfa1b('0x53')]=function(_0x3e3fc2,_0x31f52f){if(_0x3e3fc2['body']['id']){delete _0x3e3fc2[_0xfa1b('0x44')]['id'];}return db['Campaign'][_0xfa1b('0x42')]({'where':{'id':_0x3e3fc2[_0xfa1b('0x4d')]['id']}})['then'](handleEntityNotFound(_0x31f52f,null))[_0xfa1b('0x20')](saveUpdates(_0x3e3fc2[_0xfa1b('0x44')],null))[_0xfa1b('0x20')](respondWithResult(_0x31f52f,null))[_0xfa1b('0x40')](handleError(_0x31f52f,null));};exports[_0xfa1b('0x21')]=function(_0x53dcea,_0x3ef2e2){return db['Campaign']['find']({'where':{'id':_0x53dcea[_0xfa1b('0x4d')]['id']}})[_0xfa1b('0x20')](handleEntityNotFound(_0x3ef2e2,null))[_0xfa1b('0x20')](removeEntity(_0x3ef2e2,null))['catch'](handleError(_0x3ef2e2,null));};exports['getHoppers']=function(_0x4eb4e2,_0x389222,_0x39b11b){var _0x552c7b={'raw':!![],'where':{}};var _0x3a4fe6={};var _0x333a8c={'count':0x0,'rows':[]};return db[_0xfa1b('0x2a')][_0xfa1b('0x54')]({'where':{'id':_0x4eb4e2[_0xfa1b('0x4d')]['id']}})[_0xfa1b('0x20')](handleEntityNotFound(_0x389222,null))[_0xfa1b('0x20')](function(_0x519e0e){if(_0x519e0e){_0x3a4fe6['model']=_[_0xfa1b('0x4e')](db[_0xfa1b('0x55')][_0xfa1b('0x2b')]);_0x3a4fe6[_0xfa1b('0x2f')]=_[_0xfa1b('0x4e')](_0x4eb4e2[_0xfa1b('0x2f')]);_0x3a4fe6['filters']=_[_0xfa1b('0x31')](_0x3a4fe6[_0xfa1b('0x2e')],_0x3a4fe6['query']);_0x552c7b[_0xfa1b('0x32')]=_[_0xfa1b('0x31')](_0x3a4fe6[_0xfa1b('0x2e')],qs[_0xfa1b('0x33')](_0x4eb4e2[_0xfa1b('0x2f')]['fields']));_0x552c7b['attributes']=_0x552c7b[_0xfa1b('0x32')][_0xfa1b('0x34')]?_0x552c7b[_0xfa1b('0x32')]:_0x3a4fe6[_0xfa1b('0x2e')];if(!_0x4eb4e2[_0xfa1b('0x2f')][_0xfa1b('0x35')](_0xfa1b('0x36'))){_0x552c7b['limit']=qs[_0xfa1b('0x1c')](_0x4eb4e2[_0xfa1b('0x2f')][_0xfa1b('0x1c')]);_0x552c7b[_0xfa1b('0x1b')]=qs[_0xfa1b('0x1b')](_0x4eb4e2[_0xfa1b('0x2f')]['offset']);}_0x552c7b['order']=qs[_0xfa1b('0x38')](_0x4eb4e2['query'][_0xfa1b('0x38')]);_0x552c7b['where']=qs[_0xfa1b('0x30')](_[_0xfa1b('0x56')](_0x4eb4e2[_0xfa1b('0x2f')],_0x3a4fe6['filters']));_0x552c7b[_0xfa1b('0x39')]['CampaignId']=_0x519e0e['id'];if(_0x4eb4e2[_0xfa1b('0x2f')][_0xfa1b('0x3a')]){_0x552c7b['where']=_[_0xfa1b('0x3b')](_0x552c7b[_0xfa1b('0x39')],{'$or':_[_0xfa1b('0x29')](_0x552c7b[_0xfa1b('0x32')],function(_0x3dcbf1){var _0x3cac24={};_0x3cac24[_0x3dcbf1]={'$like':'%'+_0x4eb4e2[_0xfa1b('0x2f')]['filter']+'%'};return _0x3cac24;})});}_0x552c7b=_['merge']({},_0x552c7b,_0x4eb4e2[_0xfa1b('0x3c')]);return db['CmHopper']['count']({'where':_0x552c7b[_0xfa1b('0x39')]})[_0xfa1b('0x20')](function(_0x9ff210){_0x333a8c[_0xfa1b('0x1a')]=_0x9ff210;if(_0x4eb4e2['query'][_0xfa1b('0x3d')]){_0x552c7b[_0xfa1b('0x3e')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x552c7b);})['then'](function(_0x364b4b){_0x333a8c[_0xfa1b('0x57')]=_0x364b4b;return _0x333a8c;});}})[_0xfa1b('0x20')](respondWithFilteredResult(_0x389222,_0x552c7b))[_0xfa1b('0x40')](handleError(_0x389222,null));};exports[_0xfa1b('0x58')]=function(_0x385fc0,_0x5cd2af,_0x36e539){var _0x268dad={'raw':!![],'where':{}};var _0x28e105={};var _0x32bfde={'count':0x0,'rows':[]};return db[_0xfa1b('0x2a')][_0xfa1b('0x54')]({'where':{'id':_0x385fc0[_0xfa1b('0x4d')]['id']}})[_0xfa1b('0x20')](handleEntityNotFound(_0x5cd2af,null))['then'](function(_0x3412f9){if(_0x3412f9){_0x28e105[_0xfa1b('0x2e')]=_[_0xfa1b('0x4e')](db[_0xfa1b('0x59')]['rawAttributes']);_0x28e105['query']=_[_0xfa1b('0x4e')](_0x385fc0[_0xfa1b('0x2f')]);_0x28e105[_0xfa1b('0x30')]=_['intersection'](_0x28e105[_0xfa1b('0x2e')],_0x28e105[_0xfa1b('0x2f')]);_0x268dad[_0xfa1b('0x32')]=_[_0xfa1b('0x31')](_0x28e105[_0xfa1b('0x2e')],qs[_0xfa1b('0x33')](_0x385fc0['query'][_0xfa1b('0x33')]));_0x268dad['attributes']=_0x268dad['attributes'][_0xfa1b('0x34')]?_0x268dad[_0xfa1b('0x32')]:_0x28e105[_0xfa1b('0x2e')];if(!_0x385fc0[_0xfa1b('0x2f')][_0xfa1b('0x35')](_0xfa1b('0x36'))){_0x268dad[_0xfa1b('0x1c')]=qs[_0xfa1b('0x1c')](_0x385fc0['query'][_0xfa1b('0x1c')]);_0x268dad['offset']=qs[_0xfa1b('0x1b')](_0x385fc0[_0xfa1b('0x2f')][_0xfa1b('0x1b')]);}_0x268dad['order']=qs[_0xfa1b('0x38')](_0x385fc0['query'][_0xfa1b('0x38')]);_0x268dad[_0xfa1b('0x39')]=qs[_0xfa1b('0x30')](_[_0xfa1b('0x56')](_0x385fc0[_0xfa1b('0x2f')],_0x28e105[_0xfa1b('0x30')]));_0x268dad[_0xfa1b('0x39')]['CampaignId']=_0x3412f9['id'];if(_0x385fc0[_0xfa1b('0x2f')]['filter']){_0x268dad['where']=_[_0xfa1b('0x3b')](_0x268dad['where'],{'$or':_[_0xfa1b('0x29')](_0x268dad['attributes'],function(_0x3f95d6){var _0x3e4ff6={};_0x3e4ff6[_0x3f95d6]={'$like':'%'+_0x385fc0[_0xfa1b('0x2f')][_0xfa1b('0x3a')]+'%'};return _0x3e4ff6;})});}_0x268dad=_[_0xfa1b('0x3b')]({},_0x268dad,_0x385fc0[_0xfa1b('0x3c')]);return db[_0xfa1b('0x59')][_0xfa1b('0x1a')]({'where':_0x268dad[_0xfa1b('0x39')]})[_0xfa1b('0x20')](function(_0xd2190f){_0x32bfde['count']=_0xd2190f;if(_0x385fc0['query'][_0xfa1b('0x3d')]){_0x268dad[_0xfa1b('0x3e')]=[{'all':!![]}];}return db[_0xfa1b('0x59')]['findAll'](_0x268dad);})[_0xfa1b('0x20')](function(_0x399f54){_0x32bfde[_0xfa1b('0x57')]=_0x399f54;return _0x32bfde;});}})[_0xfa1b('0x20')](respondWithFilteredResult(_0x5cd2af,_0x268dad))[_0xfa1b('0x40')](handleError(_0x5cd2af,null));};exports['getHopperFinals']=function(_0x28164c,_0x39267e,_0x4395a2){var _0x2d4e7d={'raw':!![],'where':{}};var _0x183e79={};var _0x53be52={'count':0x0,'rows':[]};return db[_0xfa1b('0x2a')][_0xfa1b('0x54')]({'where':{'id':_0x28164c['params']['id']}})[_0xfa1b('0x20')](handleEntityNotFound(_0x39267e,null))[_0xfa1b('0x20')](function(_0x21dd98){if(_0x21dd98){_0x183e79[_0xfa1b('0x2e')]=_[_0xfa1b('0x4e')](db[_0xfa1b('0x5a')][_0xfa1b('0x2b')]);_0x183e79['query']=_[_0xfa1b('0x4e')](_0x28164c[_0xfa1b('0x2f')]);_0x183e79[_0xfa1b('0x30')]=_[_0xfa1b('0x31')](_0x183e79[_0xfa1b('0x2e')],_0x183e79[_0xfa1b('0x2f')]);_0x2d4e7d['attributes']=_[_0xfa1b('0x31')](_0x183e79[_0xfa1b('0x2e')],qs['fields'](_0x28164c['query'][_0xfa1b('0x33')]));_0x2d4e7d[_0xfa1b('0x32')]=_0x2d4e7d[_0xfa1b('0x32')][_0xfa1b('0x34')]?_0x2d4e7d[_0xfa1b('0x32')]:_0x183e79[_0xfa1b('0x2e')];if(!_0x28164c['query'][_0xfa1b('0x35')](_0xfa1b('0x36'))){_0x2d4e7d[_0xfa1b('0x1c')]=qs[_0xfa1b('0x1c')](_0x28164c[_0xfa1b('0x2f')][_0xfa1b('0x1c')]);_0x2d4e7d[_0xfa1b('0x1b')]=qs['offset'](_0x28164c[_0xfa1b('0x2f')]['offset']);}_0x2d4e7d['order']=qs[_0xfa1b('0x38')](_0x28164c[_0xfa1b('0x2f')][_0xfa1b('0x38')]);_0x2d4e7d[_0xfa1b('0x39')]=qs[_0xfa1b('0x30')](_['pick'](_0x28164c[_0xfa1b('0x2f')],_0x183e79[_0xfa1b('0x30')]));_0x2d4e7d[_0xfa1b('0x39')]['CampaignId']=_0x21dd98['id'];if(_0x28164c[_0xfa1b('0x2f')][_0xfa1b('0x3a')]){_0x2d4e7d['where']=_['merge'](_0x2d4e7d[_0xfa1b('0x39')],{'$or':_[_0xfa1b('0x29')](_0x2d4e7d['attributes'],function(_0x2e6ce4){var _0x5fc1a2={};_0x5fc1a2[_0x2e6ce4]={'$like':'%'+_0x28164c[_0xfa1b('0x2f')][_0xfa1b('0x3a')]+'%'};return _0x5fc1a2;})});}_0x2d4e7d=_[_0xfa1b('0x3b')]({},_0x2d4e7d,_0x28164c[_0xfa1b('0x3c')]);return db[_0xfa1b('0x5a')][_0xfa1b('0x1a')]({'where':_0x2d4e7d[_0xfa1b('0x39')]})['then'](function(_0x2e1f60){_0x53be52[_0xfa1b('0x1a')]=_0x2e1f60;if(_0x28164c[_0xfa1b('0x2f')]['includeAll']){_0x2d4e7d[_0xfa1b('0x3e')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xfa1b('0x3f')](_0x2d4e7d);})[_0xfa1b('0x20')](function(_0x5c8b97){_0x53be52[_0xfa1b('0x57')]=_0x5c8b97;return _0x53be52;});}})['then'](respondWithFilteredResult(_0x39267e,_0x2d4e7d))['catch'](handleError(_0x39267e,null));};exports[_0xfa1b('0x5b')]=function(_0x472997,_0x220c65,_0x236f63){var _0x34cc40={'raw':!![],'where':{}};var _0x3f8e0c={};var _0x5078d3={'count':0x0,'rows':[]};return db['Campaign'][_0xfa1b('0x54')]({'where':{'id':_0x472997[_0xfa1b('0x4d')]['id']}})[_0xfa1b('0x20')](handleEntityNotFound(_0x220c65,null))[_0xfa1b('0x20')](function(_0x31d8e6){if(_0x31d8e6){_0x3f8e0c['model']=_['keys'](db[_0xfa1b('0x5c')][_0xfa1b('0x2b')]);_0x3f8e0c['query']=_[_0xfa1b('0x4e')](_0x472997['query']);_0x3f8e0c[_0xfa1b('0x30')]=_[_0xfa1b('0x31')](_0x3f8e0c['model'],_0x3f8e0c[_0xfa1b('0x2f')]);_0x34cc40['attributes']=_[_0xfa1b('0x31')](_0x3f8e0c[_0xfa1b('0x2e')],qs[_0xfa1b('0x33')](_0x472997[_0xfa1b('0x2f')]['fields']));_0x34cc40[_0xfa1b('0x32')]=_0x34cc40[_0xfa1b('0x32')][_0xfa1b('0x34')]?_0x34cc40[_0xfa1b('0x32')]:_0x3f8e0c[_0xfa1b('0x2e')];if(!_0x472997[_0xfa1b('0x2f')]['hasOwnProperty']('nolimit')){_0x34cc40[_0xfa1b('0x1c')]=qs['limit'](_0x472997[_0xfa1b('0x2f')][_0xfa1b('0x1c')]);_0x34cc40['offset']=qs[_0xfa1b('0x1b')](_0x472997['query'][_0xfa1b('0x1b')]);}_0x34cc40[_0xfa1b('0x37')]=qs[_0xfa1b('0x38')](_0x472997[_0xfa1b('0x2f')][_0xfa1b('0x38')]);_0x34cc40[_0xfa1b('0x39')]=qs[_0xfa1b('0x30')](_['pick'](_0x472997[_0xfa1b('0x2f')],_0x3f8e0c[_0xfa1b('0x30')]));_0x34cc40[_0xfa1b('0x39')][_0xfa1b('0x5d')]=_0x31d8e6['id'];if(_0x472997[_0xfa1b('0x2f')][_0xfa1b('0x3a')]){_0x34cc40[_0xfa1b('0x39')]=_[_0xfa1b('0x3b')](_0x34cc40[_0xfa1b('0x39')],{'$or':_['map'](_0x34cc40[_0xfa1b('0x32')],function(_0x18397d){var _0x43b550={};_0x43b550[_0x18397d]={'$like':'%'+_0x472997[_0xfa1b('0x2f')]['filter']+'%'};return _0x43b550;})});}_0x34cc40=_[_0xfa1b('0x3b')]({},_0x34cc40,_0x472997[_0xfa1b('0x3c')]);return db[_0xfa1b('0x5c')]['count']({'where':_0x34cc40[_0xfa1b('0x39')]})[_0xfa1b('0x20')](function(_0x2b0984){_0x5078d3[_0xfa1b('0x1a')]=_0x2b0984;if(_0x472997['query'][_0xfa1b('0x3d')]){_0x34cc40['include']=[{'all':!![]}];}return db[_0xfa1b('0x5c')][_0xfa1b('0x3f')](_0x34cc40);})[_0xfa1b('0x20')](function(_0x467c72){_0x5078d3['rows']=_0x467c72;return _0x5078d3;});}})[_0xfa1b('0x20')](respondWithFilteredResult(_0x220c65,_0x34cc40))['catch'](handleError(_0x220c65,null));};exports[_0xfa1b('0x5e')]=function(_0x130085,_0x1d26bf,_0x379693){var _0x246002={};var _0x4fc6c0={};var _0x507952;var _0xfb6667;return db[_0xfa1b('0x2a')][_0xfa1b('0x54')]({'where':{'id':_0x130085[_0xfa1b('0x4d')]['id']}})[_0xfa1b('0x20')](handleEntityNotFound(_0x1d26bf,null))[_0xfa1b('0x20')](function(_0x2b392c){if(_0x2b392c){_0x507952=_0x2b392c;_0x4fc6c0['model']=_[_0xfa1b('0x4e')](db[_0xfa1b('0x5f')][_0xfa1b('0x2b')]);_0x4fc6c0[_0xfa1b('0x2f')]=_[_0xfa1b('0x4e')](_0x130085[_0xfa1b('0x2f')]);_0x4fc6c0[_0xfa1b('0x30')]=_['intersection'](_0x4fc6c0[_0xfa1b('0x2e')],_0x4fc6c0[_0xfa1b('0x2f')]);_0x246002[_0xfa1b('0x32')]=_[_0xfa1b('0x31')](_0x4fc6c0[_0xfa1b('0x2e')],qs[_0xfa1b('0x33')](_0x130085['query'][_0xfa1b('0x33')]));_0x246002[_0xfa1b('0x32')]=_0x246002[_0xfa1b('0x32')][_0xfa1b('0x34')]?_0x246002[_0xfa1b('0x32')]:_0x4fc6c0[_0xfa1b('0x2e')];_0x246002[_0xfa1b('0x37')]=qs[_0xfa1b('0x38')](_0x130085['query'][_0xfa1b('0x38')]);_0x246002['where']=qs[_0xfa1b('0x30')](_[_0xfa1b('0x56')](_0x130085[_0xfa1b('0x2f')],_0x4fc6c0[_0xfa1b('0x30')]));if(_0x130085['query'][_0xfa1b('0x3a')]){_0x246002[_0xfa1b('0x39')]=_[_0xfa1b('0x3b')](_0x246002[_0xfa1b('0x39')],{'$or':_[_0xfa1b('0x29')](_0x246002['attributes'],function(_0x4c1d06){var _0x4ca01e={};_0x4ca01e[_0x4c1d06]={'$like':'%'+_0x130085[_0xfa1b('0x2f')][_0xfa1b('0x3a')]+'%'};return _0x4ca01e;})});}_0x246002=_[_0xfa1b('0x3b')]({},_0x246002,_0x130085[_0xfa1b('0x3c')]);return _0x507952[_0xfa1b('0x5e')](_0x246002);}})[_0xfa1b('0x20')](function(_0x5edf79){if(_0x5edf79){_0xfb6667=_0x5edf79[_0xfa1b('0x34')];if(!_0x130085[_0xfa1b('0x2f')][_0xfa1b('0x35')](_0xfa1b('0x36'))){_0x246002[_0xfa1b('0x1c')]=qs[_0xfa1b('0x1c')](_0x130085[_0xfa1b('0x2f')][_0xfa1b('0x1c')]);_0x246002[_0xfa1b('0x1b')]=qs['offset'](_0x130085[_0xfa1b('0x2f')][_0xfa1b('0x1b')]);}return _0x507952[_0xfa1b('0x5e')](_0x246002);}})['then'](function(_0x2224a5){if(_0x2224a5){return _0x2224a5?{'count':_0xfb6667,'rows':_0x2224a5}:null;}})[_0xfa1b('0x20')](respondWithResult(_0x1d26bf,null))[_0xfa1b('0x40')](handleError(_0x1d26bf,null));};exports['addLists']=function(_0xd77725,_0x490794,_0x359e1b){var _0x2bec59,_0x3218ba;var _0x1817df=[];var _0x2885aa=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0xfa1b('0x2a')][_0xfa1b('0x42')]({'where':{'id':_0xd77725[_0xfa1b('0x4d')]['id']}})['then'](handleEntityNotFound(_0x490794,null))[_0xfa1b('0x20')](function(_0x4f3caa){if(_0x4f3caa){_0x3218ba=_0x4f3caa;return _0x4f3caa[_0xfa1b('0x60')](_0xd77725[_0xfa1b('0x44')][_0xfa1b('0x61')],_[_0xfa1b('0x4f')](_0xd77725[_0xfa1b('0x44')],['ids','id'])||{});}return null;})[_0xfa1b('0x62')](function(_0x2b2be1){var _0x29bb42;var _0x175cdd;_0x2bec59=_0x2b2be1||[];var _0x2f3f00=[];if(_0x2b2be1){for(var _0xa110d8=0x0;_0xa110d8<_0x2b2be1[_0xfa1b('0x34')];_0xa110d8+=0x1){var _0x603e1e=_0x2b2be1[_0xa110d8]['get']({'plain':!![]});_0x3218ba[_0xfa1b('0x63')]=_0xd77725[_0xfa1b('0x44')]['dialCheckDuplicateType']?_0xd77725[_0xfa1b('0x44')][_0xfa1b('0x63')]:_0x3218ba[_0xfa1b('0x63')];switch(_0x3218ba['dialCheckDuplicateType']){case _0xfa1b('0x64'):_0x29bb42=squel[_0xfa1b('0x65')]()[_0xfa1b('0x66')]('cm_hopper')['fromQuery']([_0xfa1b('0x67'),_0xfa1b('0x68'),'ContactId','ListId',_0xfa1b('0x5d'),_0xfa1b('0x50'),'updatedAt'],squel[_0xfa1b('0x69')]()[_0xfa1b('0x6a')](_0xfa1b('0x67'),_0xfa1b('0x67'))[_0xfa1b('0x6a')]('NOW()','scheduledAt')[_0xfa1b('0x6a')]('id',_0xfa1b('0x6b'))['field'](_0x603e1e['CmListId'][_0xfa1b('0x6c')](),'ListId')['field'](_0xd77725[_0xfa1b('0x4d')]['id'][_0xfa1b('0x6c')](),'CampaignId')[_0xfa1b('0x6a')]('\x27'+_0x2885aa+'\x27',_0xfa1b('0x50'))['field']('\x27'+_0x2885aa+'\x27','updatedAt')['from'](_0xfa1b('0x6d'))[_0xfa1b('0x39')]('deletedAt\x20IS\x20NULL')[_0xfa1b('0x39')](_0xfa1b('0x6e'),_0x603e1e[_0xfa1b('0x6f')]['toString']())[_0xfa1b('0x39')](_0xfa1b('0x70'))['where'](_0xfa1b('0x71'),squel[_0xfa1b('0x69')]()[_0xfa1b('0x6a')]('COALESCE(calleridnum,\x27\x27)')[_0xfa1b('0x72')]('cm_hopper_final')[_0xfa1b('0x39')](_0xfa1b('0x73'),_0xd77725['params']['id'][_0xfa1b('0x6c')]()))[_0xfa1b('0x39')](_0xfa1b('0x71'),squel[_0xfa1b('0x69')]()[_0xfa1b('0x6a')](_0xfa1b('0x74'))[_0xfa1b('0x72')]('cm_hopper')[_0xfa1b('0x39')](_0xfa1b('0x73'),_0xd77725[_0xfa1b('0x4d')]['id'][_0xfa1b('0x6c')]())))[_0xfa1b('0x6c')]();break;case _0xfa1b('0x75'):_0x29bb42=squel[_0xfa1b('0x65')]()['into'](_0xfa1b('0x76'))[_0xfa1b('0x77')]([_0xfa1b('0x67'),_0xfa1b('0x68'),_0xfa1b('0x6b'),_0xfa1b('0x78'),_0xfa1b('0x5d'),_0xfa1b('0x50'),'updatedAt'],squel[_0xfa1b('0x69')]()[_0xfa1b('0x6a')]('phone',_0xfa1b('0x67'))[_0xfa1b('0x6a')](_0xfa1b('0x79'),_0xfa1b('0x68'))['field']('id',_0xfa1b('0x6b'))[_0xfa1b('0x6a')](_0x603e1e[_0xfa1b('0x6f')][_0xfa1b('0x6c')](),_0xfa1b('0x78'))['field'](_0xd77725[_0xfa1b('0x4d')]['id'][_0xfa1b('0x6c')](),'CampaignId')[_0xfa1b('0x6a')]('\x27'+_0x2885aa+'\x27',_0xfa1b('0x50'))[_0xfa1b('0x6a')]('\x27'+_0x2885aa+'\x27','updatedAt')['from']('cm_contacts')[_0xfa1b('0x39')]('deletedAt\x20IS\x20NULL')[_0xfa1b('0x39')](_0xfa1b('0x6e'),_0x603e1e[_0xfa1b('0x6f')]['toString']())[_0xfa1b('0x39')](_0xfa1b('0x70'))[_0xfa1b('0x39')](_0xfa1b('0x71'),squel[_0xfa1b('0x69')]()[_0xfa1b('0x6a')](_0xfa1b('0x74'))['from']('cm_hopper')['where']('CampaignId\x20=\x20?',_0xd77725[_0xfa1b('0x4d')]['id'][_0xfa1b('0x6c')]())))[_0xfa1b('0x6c')]();break;default:_0x29bb42=squel['insert']()['into'](_0xfa1b('0x76'))[_0xfa1b('0x77')]([_0xfa1b('0x67'),_0xfa1b('0x68'),_0xfa1b('0x6b'),'ListId',_0xfa1b('0x5d'),_0xfa1b('0x50'),_0xfa1b('0x51')],squel[_0xfa1b('0x69')]()['field'](_0xfa1b('0x67'),_0xfa1b('0x67'))[_0xfa1b('0x6a')](_0xfa1b('0x79'),_0xfa1b('0x68'))[_0xfa1b('0x6a')]('id',_0xfa1b('0x6b'))['field'](_0x603e1e[_0xfa1b('0x6f')][_0xfa1b('0x6c')](),_0xfa1b('0x78'))[_0xfa1b('0x6a')](_0xd77725[_0xfa1b('0x4d')]['id'][_0xfa1b('0x6c')](),'CampaignId')[_0xfa1b('0x6a')]('\x27'+_0x2885aa+'\x27',_0xfa1b('0x50'))[_0xfa1b('0x6a')]('\x27'+_0x2885aa+'\x27','updatedAt')[_0xfa1b('0x72')](_0xfa1b('0x6d'))['where'](_0xfa1b('0x7a'))[_0xfa1b('0x39')]('ListId\x20=\x20?',_0x603e1e[_0xfa1b('0x6f')][_0xfa1b('0x6c')]())[_0xfa1b('0x39')](_0xfa1b('0x70')))[_0xfa1b('0x6c')]();}_0x175cdd=squel[_0xfa1b('0x65')]()[_0xfa1b('0x66')](_0xfa1b('0x7b'))[_0xfa1b('0x77')]([_0xfa1b('0x7c'),_0xfa1b('0x68'),_0xfa1b('0x67'),_0xfa1b('0x7d'),_0xfa1b('0x50'),_0xfa1b('0x51')],squel['select']()[_0xfa1b('0x6a')](_0xfa1b('0x7e'),'id')[_0xfa1b('0x6a')](_0xfa1b('0x79'),_0xfa1b('0x68'))[_0xfa1b('0x6a')](_0xfa1b('0x7f'),'phone')[_0xfa1b('0x6a')](_0xfa1b('0x80'),'OrderBy')['field']('\x27'+_0x2885aa+'\x27','createdAt')[_0xfa1b('0x6a')]('\x27'+_0x2885aa+'\x27',_0xfa1b('0x51'))[_0xfa1b('0x72')](_0xfa1b('0x81'),'ci')[_0xfa1b('0x82')]('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0xfa1b('0x39')]('h.ListId\x20=\x20?',_0x603e1e['CmListId'][_0xfa1b('0x6c')]())[_0xfa1b('0x39')]('h.CampaignId=?',_0xd77725[_0xfa1b('0x4d')]['id'][_0xfa1b('0x6c')]())['where'](_0xfa1b('0x83'),_0x2885aa))[_0xfa1b('0x6c')]();_0x2f3f00[_0xfa1b('0x84')](db[_0xfa1b('0x85')][_0xfa1b('0x2f')](_0x29bb42));_0x1817df[_0xfa1b('0x84')](db[_0xfa1b('0x85')][_0xfa1b('0x2f')](_0x175cdd));}return BPromise['all'](_0x2f3f00);}})[_0xfa1b('0x20')](function(){return BPromise[_0xfa1b('0x86')](_0x1817df);})[_0xfa1b('0x20')](function(){return _0x2bec59;})['then'](respondWithResult(_0x490794,null))[_0xfa1b('0x40')](handleError(_0x490794,null));};exports[_0xfa1b('0x87')]=function(_0xa61450,_0x539d5b,_0x24a533){return db[_0xfa1b('0x2a')][_0xfa1b('0x42')]({'where':{'id':_0xa61450['params']['id']}})['then'](handleEntityNotFound(_0x539d5b,null))[_0xfa1b('0x20')](function(_0x3a7364){if(_0x3a7364){return _0x3a7364[_0xfa1b('0x87')](_0xa61450['query']['ids']);}})[_0xfa1b('0x20')](function(_0x3a0e83){if(_0x3a0e83){return db['CmHopper'][_0xfa1b('0x21')]({'where':{'ListId':_0xa61450[_0xfa1b('0x2f')]['ids'],'CampaignId':_0xa61450['params']['id']}})[_0xfa1b('0x20')](function(){return _0x3a0e83;});}})['then'](respondWithStatusCode(_0x539d5b,null))['catch'](handleError(_0x539d5b,null));};exports[_0xfa1b('0x88')]=function(_0x4f73cf,_0x981621,_0x54fc11){var _0x31d6eb={};var _0x593822={};var _0xf78934;var _0x27b880;return db[_0xfa1b('0x2a')][_0xfa1b('0x54')]({'where':{'id':_0x4f73cf[_0xfa1b('0x4d')]['id']}})['then'](handleEntityNotFound(_0x981621,null))[_0xfa1b('0x20')](function(_0x570863){if(_0x570863){_0xf78934=_0x570863;_0x593822[_0xfa1b('0x2e')]=_['keys'](db[_0xfa1b('0x5f')]['rawAttributes']);_0x593822[_0xfa1b('0x2f')]=_['keys'](_0x4f73cf['query']);_0x593822[_0xfa1b('0x30')]=_[_0xfa1b('0x31')](_0x593822[_0xfa1b('0x2e')],_0x593822['query']);_0x31d6eb[_0xfa1b('0x32')]=_[_0xfa1b('0x31')](_0x593822[_0xfa1b('0x2e')],qs[_0xfa1b('0x33')](_0x4f73cf['query'][_0xfa1b('0x33')]));_0x31d6eb[_0xfa1b('0x32')]=_0x31d6eb[_0xfa1b('0x32')][_0xfa1b('0x34')]?_0x31d6eb[_0xfa1b('0x32')]:_0x593822['model'];_0x31d6eb[_0xfa1b('0x37')]=qs[_0xfa1b('0x38')](_0x4f73cf[_0xfa1b('0x2f')][_0xfa1b('0x38')]);_0x31d6eb['where']=qs[_0xfa1b('0x30')](_[_0xfa1b('0x56')](_0x4f73cf[_0xfa1b('0x2f')],_0x593822[_0xfa1b('0x30')]));if(_0x4f73cf['query'][_0xfa1b('0x3a')]){_0x31d6eb[_0xfa1b('0x39')]=_[_0xfa1b('0x3b')](_0x31d6eb[_0xfa1b('0x39')],{'$or':_['map'](_0x31d6eb[_0xfa1b('0x32')],function(_0x484d9d){var _0x189250={};_0x189250[_0x484d9d]={'$like':'%'+_0x4f73cf[_0xfa1b('0x2f')]['filter']+'%'};return _0x189250;})});}_0x31d6eb=_[_0xfa1b('0x3b')]({},_0x31d6eb,_0x4f73cf[_0xfa1b('0x3c')]);return _0xf78934[_0xfa1b('0x88')](_0x31d6eb);}})['then'](function(_0x3259e5){if(_0x3259e5){_0x27b880=_0x3259e5[_0xfa1b('0x34')];if(!_0x4f73cf[_0xfa1b('0x2f')][_0xfa1b('0x35')](_0xfa1b('0x36'))){_0x31d6eb['limit']=qs[_0xfa1b('0x1c')](_0x4f73cf['query'][_0xfa1b('0x1c')]);_0x31d6eb[_0xfa1b('0x1b')]=qs['offset'](_0x4f73cf[_0xfa1b('0x2f')][_0xfa1b('0x1b')]);}return _0xf78934['getBlackLists'](_0x31d6eb);}})[_0xfa1b('0x20')](function(_0x5e8f1d){if(_0x5e8f1d){return _0x5e8f1d?{'count':_0x27b880,'rows':_0x5e8f1d}:null;}})[_0xfa1b('0x20')](respondWithResult(_0x981621,null))[_0xfa1b('0x40')](handleError(_0x981621,null));};exports[_0xfa1b('0x89')]=function(_0x127608,_0x24e386,_0x28ae57){var _0x518cb6,_0xcf8904;var _0x2d2e46=[];var _0x41b6a0=moment()[_0xfa1b('0x8a')](_0xfa1b('0x8b'));return db[_0xfa1b('0x2a')]['find']({'where':{'id':_0x127608['params']['id']}})[_0xfa1b('0x20')](handleEntityNotFound(_0x24e386,null))['then'](function(_0x495ac6){if(_0x495ac6){_0xcf8904=_0x495ac6;return _0x495ac6[_0xfa1b('0x89')](_0x127608[_0xfa1b('0x44')][_0xfa1b('0x61')],_[_0xfa1b('0x4f')](_0x127608[_0xfa1b('0x44')],[_0xfa1b('0x61'),'id'])||{});}return null;})[_0xfa1b('0x62')](function(_0x5b26a1){var _0xbf80b9;var _0x1f9998;_0x518cb6=_0x5b26a1||[];var _0x14032c=[];if(_0x5b26a1){for(var _0x7f7945=0x0;_0x7f7945<_0x5b26a1[_0xfa1b('0x34')];_0x7f7945+=0x1){var _0x133ce7=_0x5b26a1[_0x7f7945][_0xfa1b('0x22')]({'plain':!![]});_0xbf80b9=squel[_0xfa1b('0x65')]()[_0xfa1b('0x66')](_0xfa1b('0x8c'))[_0xfa1b('0x77')](['phone',_0xfa1b('0x6b'),_0xfa1b('0x78'),'CampaignId','createdAt',_0xfa1b('0x51')],squel['select']()['field'](_0xfa1b('0x67'),_0xfa1b('0x67'))[_0xfa1b('0x6a')]('id',_0xfa1b('0x6b'))[_0xfa1b('0x6a')](_0x133ce7['CmListId'][_0xfa1b('0x6c')](),_0xfa1b('0x78'))['field'](_0x127608['params']['id'][_0xfa1b('0x6c')](),'CampaignId')['field'](_0xfa1b('0x79'),'createdAt')[_0xfa1b('0x6a')](_0xfa1b('0x79'),_0xfa1b('0x51'))[_0xfa1b('0x72')]('cm_contacts')['where'](_0xfa1b('0x7a'))[_0xfa1b('0x39')](_0xfa1b('0x6e'),_0x133ce7[_0xfa1b('0x6f')][_0xfa1b('0x6c')]())['where'](_0xfa1b('0x70')))['toString']();_0x14032c[_0xfa1b('0x84')](db[_0xfa1b('0x85')][_0xfa1b('0x2f')](_0xbf80b9));}return BPromise[_0xfa1b('0x86')](_0x14032c);}})[_0xfa1b('0x20')](function(){return _0x518cb6;})[_0xfa1b('0x20')](respondWithResult(_0x24e386,null))[_0xfa1b('0x40')](handleError(_0x24e386,null));};exports[_0xfa1b('0x8d')]=function(_0xcfe024,_0x5bb839,_0x46b627){return db['Campaign'][_0xfa1b('0x42')]({'where':{'id':_0xcfe024[_0xfa1b('0x4d')]['id']}})[_0xfa1b('0x20')](handleEntityNotFound(_0x5bb839,null))[_0xfa1b('0x20')](function(_0x1758d5){if(_0x1758d5){return _0x1758d5[_0xfa1b('0x8d')](_0xcfe024[_0xfa1b('0x2f')][_0xfa1b('0x61')]);}})[_0xfa1b('0x20')](function(_0x3e23e0){if(_0x3e23e0){return db[_0xfa1b('0x5c')][_0xfa1b('0x21')]({'where':{'ListId':_0xcfe024['query'][_0xfa1b('0x61')],'CampaignId':_0xcfe024[_0xfa1b('0x4d')]['id']}})[_0xfa1b('0x20')](function(){return _0x3e23e0;});}})[_0xfa1b('0x20')](respondWithStatusCode(_0x5bb839,null))[_0xfa1b('0x40')](handleError(_0x5bb839,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 3481f7c..3ec9c6a 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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x16ebbf,_0x429317){var _0x48d0d3=function(_0xa281a5){while(--_0xa281a5){_0x16ebbf['push'](_0x16ebbf['shift']());}};_0x48d0d3(++_0x429317);}(_0x7a54,0x106));var _0x47a5=function(_0x664b93,_0x2438cc){_0x664b93=_0x664b93-0x0;var _0x47a06a=_0x7a54[_0x664b93];return _0x47a06a;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x22fe70,_0x6e1a47){var _0x93d0b4=function(_0x413e0f){while(--_0x413e0f){_0x22fe70['push'](_0x22fe70['shift']());}};_0x93d0b4(++_0x6e1a47);}(_0x7a54,0x106));var _0x47a5=function(_0x515d93,_0x48c6e0){_0x515d93=_0x515d93-0x0;var _0xe6e697=_0x7a54[_0x515d93];return _0xe6e697;};'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':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index cdcb6d5..3fe60f4 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 _0x62da=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','Campaign','options','raw','attributes','limit','map','include','model','stringify','GetCampaign','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0x62da,0xc0));var _0xa62d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x62da[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xa62d('0x0'));var util=require('util');var moment=require(_0xa62d('0x1'));var BPromise=require(_0xa62d('0x2'));var rs=require(_0xa62d('0x3'));var fs=require('fs');var Redis=require(_0xa62d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa62d('0x5'));var logger=require(_0xa62d('0x6'))(_0xa62d('0x7'));var config=require(_0xa62d('0x8'));var jayson=require(_0xa62d('0x9'));var client=jayson[_0xa62d('0xa')][_0xa62d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ceb21,_0x149386,_0x2f6c03){return new BPromise(function(_0x2e8e25,_0x2d6e41){return client['request'](_0x3ceb21,_0x2f6c03)[_0xa62d('0xc')](function(_0x1208d0){logger['info'](_0xa62d('0xd'),_0x149386,_0xa62d('0xe'));logger[_0xa62d('0xf')](_0xa62d('0x10'),_0x149386,_0xa62d('0xe'),JSON['stringify'](_0x1208d0));if(_0x1208d0[_0xa62d('0x11')]){if(_0x1208d0[_0xa62d('0x11')][_0xa62d('0x12')]===0x1f4){logger[_0xa62d('0x11')](_0xa62d('0xd'),_0x149386,_0x1208d0[_0xa62d('0x11')][_0xa62d('0x13')]);return _0x2d6e41(_0x1208d0[_0xa62d('0x11')][_0xa62d('0x13')]);}logger['error'](_0xa62d('0xd'),_0x149386,_0x1208d0[_0xa62d('0x11')][_0xa62d('0x13')]);return _0x2e8e25(_0x1208d0['error'][_0xa62d('0x13')]);}else{logger[_0xa62d('0x14')](_0xa62d('0xd'),_0x149386,_0xa62d('0xe'));_0x2e8e25(_0x1208d0[_0xa62d('0x15')]['message']);}})[_0xa62d('0x16')](function(_0x51226a){logger[_0xa62d('0x11')]('Campaign,\x20%s,\x20%s',_0x149386,_0x51226a);_0x2d6e41(_0x51226a);});});}exports['GetCampaign']=function(_0x192e4e){var _0xa04d7b=this;return new Promise(function(_0x8394e6,_0x30801f){return db[_0xa62d('0x17')]['findAll']({'raw':_0x192e4e['options']?_0x192e4e[_0xa62d('0x18')][_0xa62d('0x19')]===undefined?!![]:![]:!![],'where':_0x192e4e['options']?_0x192e4e[_0xa62d('0x18')]['where']||null:null,'attributes':_0x192e4e[_0xa62d('0x18')]?_0x192e4e['options'][_0xa62d('0x1a')]||null:null,'limit':_0x192e4e['options']?_0x192e4e[_0xa62d('0x18')][_0xa62d('0x1b')]||null:null,'include':_0x192e4e[_0xa62d('0x18')]?_0x192e4e['options']['include']?_[_0xa62d('0x1c')](_0x192e4e[_0xa62d('0x18')][_0xa62d('0x1d')],function(_0x40e577){return{'model':db[_0x40e577[_0xa62d('0x1e')]],'as':_0x40e577['as'],'attributes':_0x40e577['attributes'],'include':_0x40e577['include']?_[_0xa62d('0x1c')](_0x40e577['include'],function(_0x36cfff){return{'model':db[_0x36cfff[_0xa62d('0x1e')]],'as':_0x36cfff['as'],'attributes':_0x36cfff['attributes'],'include':_0x36cfff['include']?_[_0xa62d('0x1c')](_0x36cfff['include'],function(_0x191dd6){return{'model':db[_0x191dd6['model']],'as':_0x191dd6['as'],'attributes':_0x191dd6[_0xa62d('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x104aae){logger[_0xa62d('0x14')]('GetCampaign',_0x192e4e);logger[_0xa62d('0xf')]('GetCampaign',_0x192e4e,JSON[_0xa62d('0x1f')](_0x104aae));_0x8394e6(_0x104aae);})[_0xa62d('0x16')](function(_0xfab048){logger[_0xa62d('0x11')](_0xa62d('0x20'),_0xfab048[_0xa62d('0x13')],_0x192e4e);_0x30801f(_0xa04d7b[_0xa62d('0x11')](0x1f4,_0xfab048[_0xa62d('0x13')]));});});}; \ No newline at end of file +var _0xe13e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetCampaign','Campaign','options','where','attributes','limit','include','model','map','moment','bluebird'];(function(_0x5a130d,_0x5a9e96){var _0x1822f2=function(_0x335bcd){while(--_0x335bcd){_0x5a130d['push'](_0x5a130d['shift']());}};_0x1822f2(++_0x5a9e96);}(_0xe13e,0xde));var _0xee13=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe13e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xee13('0x0'));var BPromise=require(_0xee13('0x1'));var rs=require(_0xee13('0x2'));var fs=require('fs');var Redis=require(_0xee13('0x3'));var db=require(_0xee13('0x4'))['db'];var utils=require(_0xee13('0x5'));var logger=require(_0xee13('0x6'))(_0xee13('0x7'));var config=require(_0xee13('0x8'));var jayson=require(_0xee13('0x9'));var client=jayson[_0xee13('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8f606d,_0x3ae6e2,_0xfdb836){return new BPromise(function(_0x64ee02,_0x4810bd){return client[_0xee13('0xb')](_0x8f606d,_0xfdb836)[_0xee13('0xc')](function(_0x1cc55b){logger[_0xee13('0xd')](_0xee13('0xe'),_0x3ae6e2,'request\x20sent');logger[_0xee13('0xf')](_0xee13('0x10'),_0x3ae6e2,'request\x20sent',JSON[_0xee13('0x11')](_0x1cc55b));if(_0x1cc55b['error']){if(_0x1cc55b['error']['code']===0x1f4){logger[_0xee13('0x12')]('Campaign,\x20%s,\x20%s',_0x3ae6e2,_0x1cc55b[_0xee13('0x12')][_0xee13('0x13')]);return _0x4810bd(_0x1cc55b[_0xee13('0x12')][_0xee13('0x13')]);}logger[_0xee13('0x12')](_0xee13('0xe'),_0x3ae6e2,_0x1cc55b[_0xee13('0x12')]['message']);return _0x64ee02(_0x1cc55b[_0xee13('0x12')][_0xee13('0x13')]);}else{logger[_0xee13('0xd')]('Campaign,\x20%s,\x20%s',_0x3ae6e2,_0xee13('0x14'));_0x64ee02(_0x1cc55b[_0xee13('0x15')]['message']);}})[_0xee13('0x16')](function(_0xcd1482){logger[_0xee13('0x12')](_0xee13('0xe'),_0x3ae6e2,_0xcd1482);_0x4810bd(_0xcd1482);});});}exports[_0xee13('0x17')]=function(_0x3a5819){var _0xd353d0=this;return new Promise(function(_0x33bd9c,_0x3806b0){return db[_0xee13('0x18')]['findAll']({'raw':_0x3a5819[_0xee13('0x19')]?_0x3a5819[_0xee13('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x3a5819[_0xee13('0x19')]?_0x3a5819['options'][_0xee13('0x1a')]||null:null,'attributes':_0x3a5819['options']?_0x3a5819[_0xee13('0x19')][_0xee13('0x1b')]||null:null,'limit':_0x3a5819['options']?_0x3a5819[_0xee13('0x19')][_0xee13('0x1c')]||null:null,'include':_0x3a5819[_0xee13('0x19')]?_0x3a5819[_0xee13('0x19')][_0xee13('0x1d')]?_['map'](_0x3a5819[_0xee13('0x19')][_0xee13('0x1d')],function(_0x4c705c){return{'model':db[_0x4c705c[_0xee13('0x1e')]],'as':_0x4c705c['as'],'attributes':_0x4c705c['attributes'],'include':_0x4c705c[_0xee13('0x1d')]?_['map'](_0x4c705c['include'],function(_0x381508){return{'model':db[_0x381508[_0xee13('0x1e')]],'as':_0x381508['as'],'attributes':_0x381508['attributes'],'include':_0x381508[_0xee13('0x1d')]?_[_0xee13('0x1f')](_0x381508[_0xee13('0x1d')],function(_0x48b604){return{'model':db[_0x48b604['model']],'as':_0x48b604['as'],'attributes':_0x48b604[_0xee13('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xee13('0xc')](function(_0x257323){logger[_0xee13('0xd')](_0xee13('0x17'),_0x3a5819);logger[_0xee13('0xf')](_0xee13('0x17'),_0x3a5819,JSON[_0xee13('0x11')](_0x257323));_0x33bd9c(_0x257323);})[_0xee13('0x16')](function(_0x458e12){logger[_0xee13('0x12')](_0xee13('0x17'),_0x458e12[_0xee13('0x13')],_0x3a5819);_0x3806b0(_0xd353d0[_0xee13('0x12')](0x1f4,_0x458e12[_0xee13('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 5651fc4..a5e9247 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 _0x043d=['post','create','/:id/clone','clone','addBlackLists','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','getLists','/:id/blacklists','getBlackLists'];(function(_0x31d637,_0x5c2c8b){var _0x233e25=function(_0x23a3f0){while(--_0x23a3f0){_0x31d637['push'](_0x31d637['shift']());}};_0x233e25(++_0x5c2c8b);}(_0x043d,0x1ba));var _0xd043=function(_0x12d6c2,_0x409bc8){_0x12d6c2=_0x12d6c2-0x0;var _0x1c9825=_0x043d[_0x12d6c2];return _0x1c9825;};'use strict';var multer=require(_0xd043('0x0'));var util=require(_0xd043('0x1'));var path=require(_0xd043('0x2'));var timeout=require(_0xd043('0x3'));var express=require(_0xd043('0x4'));var router=express[_0xd043('0x5')]();var fs_extra=require(_0xd043('0x6'));var auth=require(_0xd043('0x7'));var interaction=require(_0xd043('0x8'));var config=require(_0xd043('0x9'));var controller=require(_0xd043('0xa'));router[_0xd043('0xb')]('/',auth[_0xd043('0xc')](),controller[_0xd043('0xd')]);router['get'](_0xd043('0xe'),auth[_0xd043('0xc')](),controller['show']);router[_0xd043('0xb')]('/:id/hoppers',auth[_0xd043('0xc')](),controller[_0xd043('0xf')]);router[_0xd043('0xb')]('/:id/hopper_histories',auth[_0xd043('0xc')](),controller[_0xd043('0x10')]);router[_0xd043('0xb')](_0xd043('0x11'),auth[_0xd043('0xc')](),controller[_0xd043('0x12')]);router['get']('/:id/hopper_black',auth[_0xd043('0xc')](),controller['getHopperBlacks']);router[_0xd043('0xb')](_0xd043('0x13'),auth[_0xd043('0xc')](),controller[_0xd043('0x14')]);router[_0xd043('0xb')](_0xd043('0x15'),auth[_0xd043('0xc')](),controller[_0xd043('0x16')]);router[_0xd043('0x17')]('/',auth[_0xd043('0xc')](),controller[_0xd043('0x18')]);router[_0xd043('0x17')](_0xd043('0x19'),auth[_0xd043('0xc')](),controller[_0xd043('0x1a')]);router[_0xd043('0x17')](_0xd043('0x13'),auth[_0xd043('0xc')](),controller['addLists']);router[_0xd043('0x17')](_0xd043('0x15'),auth[_0xd043('0xc')](),controller[_0xd043('0x1b')]);router['put'](_0xd043('0xe'),auth[_0xd043('0xc')](),controller[_0xd043('0x1c')]);router[_0xd043('0x1d')]('/:id',auth[_0xd043('0xc')](),controller[_0xd043('0x1e')]);router[_0xd043('0x1d')](_0xd043('0x13'),auth[_0xd043('0xc')](),controller['removeLists']);router[_0xd043('0x1d')](_0xd043('0x15'),auth[_0xd043('0xc')](),controller['removeBlackLists']);module['exports']=router; \ No newline at end of file +var _0x9366=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','/:id/blacklists','post','create','/:id/clone','clone','addBlackLists','put','delete','/:id','destroy','removeLists','removeBlackLists','exports'];(function(_0x59d0cc,_0xa7c52b){var _0x2ae79f=function(_0x33042e){while(--_0x33042e){_0x59d0cc['push'](_0x59d0cc['shift']());}};_0x2ae79f(++_0xa7c52b);}(_0x9366,0x14a));var _0x6936=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9366[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x6936('0x0'));var path=require(_0x6936('0x1'));var timeout=require(_0x6936('0x2'));var express=require(_0x6936('0x3'));var router=express[_0x6936('0x4')]();var fs_extra=require(_0x6936('0x5'));var auth=require(_0x6936('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6936('0x7'));var controller=require(_0x6936('0x8'));router[_0x6936('0x9')]('/',auth[_0x6936('0xa')](),controller[_0x6936('0xb')]);router['get']('/:id',auth[_0x6936('0xa')](),controller[_0x6936('0xc')]);router['get']('/:id/hoppers',auth['isAuthenticated'](),controller[_0x6936('0xd')]);router[_0x6936('0x9')](_0x6936('0xe'),auth[_0x6936('0xa')](),controller[_0x6936('0xf')]);router['get'](_0x6936('0x10'),auth['isAuthenticated'](),controller[_0x6936('0x11')]);router[_0x6936('0x9')]('/:id/hopper_black',auth[_0x6936('0xa')](),controller[_0x6936('0x12')]);router[_0x6936('0x9')](_0x6936('0x13'),auth[_0x6936('0xa')](),controller['getLists']);router[_0x6936('0x9')](_0x6936('0x14'),auth[_0x6936('0xa')](),controller['getBlackLists']);router[_0x6936('0x15')]('/',auth['isAuthenticated'](),controller[_0x6936('0x16')]);router[_0x6936('0x15')](_0x6936('0x17'),auth[_0x6936('0xa')](),controller[_0x6936('0x18')]);router[_0x6936('0x15')](_0x6936('0x13'),auth[_0x6936('0xa')](),controller['addLists']);router['post'](_0x6936('0x14'),auth['isAuthenticated'](),controller[_0x6936('0x19')]);router[_0x6936('0x1a')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x6936('0x1b')](_0x6936('0x1c'),auth[_0x6936('0xa')](),controller[_0x6936('0x1d')]);router[_0x6936('0x1b')](_0x6936('0x13'),auth[_0x6936('0xa')](),controller[_0x6936('0x1e')]);router[_0x6936('0x1b')](_0x6936('0x14'),auth[_0x6936('0xa')](),controller[_0x6936('0x1f')]);module[_0x6936('0x20')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index cf3133b..d796c65 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 _0x806b=['getDataValue','sequelize','exports','TEXT','STRING'];(function(_0x2128d3,_0x420dfa){var _0x49fa00=function(_0x2c091e){while(--_0x2c091e){_0x2128d3['push'](_0x2128d3['shift']());}};_0x49fa00(++_0x420dfa);}(_0x806b,0x6f));var _0xb806=function(_0x206a2a,_0xa14ea1){_0x206a2a=_0x206a2a-0x0;var _0x462dc2=_0x806b[_0x206a2a];return _0x462dc2;};'use strict';var Sequelize=require(_0xb806('0x0'));module[_0xb806('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xb806('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb806('0x3')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xb806('0x4')]('key');}}}; \ No newline at end of file +var _0x286f=['VIRTUAL','key','sequelize','exports','STRING'];(function(_0x8cb836,_0x426bb3){var _0x4547cd=function(_0x4afc54){while(--_0x4afc54){_0x8cb836['push'](_0x8cb836['shift']());}};_0x4547cd(++_0x426bb3);}(_0x286f,0x101));var _0xf286=function(_0x1a50f3,_0x2d185f){_0x1a50f3=_0x1a50f3-0x0;var _0x5edfe1=_0x286f[_0x1a50f3];return _0x5edfe1;};'use strict';var Sequelize=require(_0xf286('0x0'));module[_0xf286('0x1')]={'key':{'type':Sequelize[_0xf286('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xf286('0x2')]},'name':{'type':Sequelize[_0xf286('0x3')],'get':function(){return this['getDataValue'](_0xf286('0x4'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index e194e78..8d12264 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 _0xdd3a=['sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','CannedAnswers','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','UserProfileResource','error','name','send','map','CannedAnswer','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd3a,0x1e5));var _0xadd3=function(_0x34036e,_0x171ab7){_0x34036e=_0x34036e-0x0;var _0xbcb8db=_0xdd3a[_0x34036e];return _0xbcb8db;};'use strict';var emlformat=require(_0xadd3('0x0'));var rimraf=require(_0xadd3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xadd3('0x2'));var rp=require(_0xadd3('0x3'));var moment=require('moment');var BPromise=require(_0xadd3('0x4'));var Mustache=require(_0xadd3('0x5'));var util=require(_0xadd3('0x6'));var path=require(_0xadd3('0x7'));var sox=require(_0xadd3('0x8'));var csv=require('to-csv');var ejs=require(_0xadd3('0x9'));var fs=require('fs');var fs_extra=require(_0xadd3('0xa'));var _=require(_0xadd3('0xb'));var squel=require(_0xadd3('0xc'));var crypto=require(_0xadd3('0xd'));var jsforce=require(_0xadd3('0xe'));var deskjs=require(_0xadd3('0xf'));var toCsv=require(_0xadd3('0x10'));var querystring=require(_0xadd3('0x11'));var Papa=require(_0xadd3('0x12'));var Redis=require('ioredis');var authService=require(_0xadd3('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xadd3('0x14'));var hardwareService=require(_0xadd3('0x15'));var logger=require(_0xadd3('0x16'))(_0xadd3('0x17'));var utils=require(_0xadd3('0x18'));var config=require(_0xadd3('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xadd3('0x1a'))['db'];function respondWithStatusCode(_0x39e80f,_0x128517){_0x128517=_0x128517||0xcc;return function(_0x3915fc){if(_0x3915fc){return _0x39e80f[_0xadd3('0x1b')](_0x128517);}return _0x39e80f[_0xadd3('0x1c')](_0x128517)[_0xadd3('0x1d')]();};}function respondWithResult(_0x88d5f0,_0x2da1be){_0x2da1be=_0x2da1be||0xc8;return function(_0x5c0ab8){if(_0x5c0ab8){return _0x88d5f0[_0xadd3('0x1c')](_0x2da1be)[_0xadd3('0x1e')](_0x5c0ab8);}};}function respondWithFilteredResult(_0x53b7eb,_0x12b2bb){return function(_0x4fb253){if(_0x4fb253){var _0x8bd9c3=typeof _0x12b2bb[_0xadd3('0x1f')]===_0xadd3('0x20')&&typeof _0x12b2bb[_0xadd3('0x21')]===_0xadd3('0x20');var _0x39946e=_0x4fb253['count'];var _0x58c795=_0x8bd9c3?0x0:_0x12b2bb['offset'];var _0x31bc06=_0x8bd9c3?_0x4fb253[_0xadd3('0x22')]:_0x12b2bb[_0xadd3('0x1f')]+_0x12b2bb['limit'];var _0x5e78c9;if(_0x31bc06>=_0x39946e){_0x31bc06=_0x39946e;_0x5e78c9=0xc8;}else{_0x5e78c9=0xce;}_0x53b7eb[_0xadd3('0x1c')](_0x5e78c9);return _0x53b7eb[_0xadd3('0x23')](_0xadd3('0x24'),_0x58c795+'-'+_0x31bc06+'/'+_0x39946e)[_0xadd3('0x1e')](_0x4fb253);}return null;};}function patchUpdates(_0x2d7479){return function(_0x3223e5){try{jsonpatch['apply'](_0x3223e5,_0x2d7479,!![]);}catch(_0xc8735){return BPromise[_0xadd3('0x25')](_0xc8735);}return _0x3223e5[_0xadd3('0x26')]();};}function saveUpdates(_0x27eb86,_0x149f5d){return function(_0x4fadcf){if(_0x4fadcf){return _0x4fadcf[_0xadd3('0x27')](_0x27eb86)['then'](function(_0x29939b){return _0x29939b;});}return null;};}function removeEntity(_0x5dd86e,_0x106574){return function(_0x72c8c1){if(_0x72c8c1){return _0x72c8c1[_0xadd3('0x28')]()[_0xadd3('0x29')](function(){var _0x1e520e=_0x72c8c1['get']({'plain':!![]});var _0x1e9634='CannedAnswers';return db[_0xadd3('0x2a')][_0xadd3('0x28')]({'where':{'type':_0x1e9634,'resourceId':_0x1e520e['id']}})['then'](function(){return _0x72c8c1;});})[_0xadd3('0x29')](function(){_0x5dd86e[_0xadd3('0x1c')](0xcc)[_0xadd3('0x1d')]();});}};}function handleEntityNotFound(_0x404e6b,_0x35024e){return function(_0x46714b){if(!_0x46714b){_0x404e6b[_0xadd3('0x1b')](0x194);}return _0x46714b;};}function handleError(_0x2b6470,_0x5cf7b1){_0x5cf7b1=_0x5cf7b1||0x1f4;return function(_0x5b7c6a){logger[_0xadd3('0x2b')](_0x5b7c6a['stack']);if(_0x5b7c6a[_0xadd3('0x2c')]){delete _0x5b7c6a[_0xadd3('0x2c')];}_0x2b6470[_0xadd3('0x1c')](_0x5cf7b1)[_0xadd3('0x2d')](_0x5b7c6a);};}exports['index']=function(_0x17c2af,_0x1dc01e){var _0x28486c={},_0x4ea72d={},_0x369a02={'count':0x0,'rows':[]};var _0x4c7511=_[_0xadd3('0x2e')](db[_0xadd3('0x2f')][_0xadd3('0x30')],function(_0x4bc9ec){return{'name':_0x4bc9ec['fieldName'],'type':_0x4bc9ec[_0xadd3('0x31')][_0xadd3('0x32')]};});_0x4ea72d[_0xadd3('0x33')]=_[_0xadd3('0x2e')](_0x4c7511,_0xadd3('0x2c'));_0x4ea72d['query']=_[_0xadd3('0x34')](_0x17c2af[_0xadd3('0x35')]);_0x4ea72d[_0xadd3('0x36')]=_['intersection'](_0x4ea72d[_0xadd3('0x33')],_0x4ea72d['query']);_0x28486c[_0xadd3('0x37')]=_[_0xadd3('0x38')](_0x4ea72d[_0xadd3('0x33')],qs['fields'](_0x17c2af['query'][_0xadd3('0x39')]));_0x28486c['attributes']=_0x28486c['attributes'][_0xadd3('0x3a')]?_0x28486c[_0xadd3('0x37')]:_0x4ea72d['model'];if(!_0x17c2af['query']['hasOwnProperty'](_0xadd3('0x3b'))){_0x28486c[_0xadd3('0x21')]=qs[_0xadd3('0x21')](_0x17c2af[_0xadd3('0x35')][_0xadd3('0x21')]);_0x28486c[_0xadd3('0x1f')]=qs[_0xadd3('0x1f')](_0x17c2af[_0xadd3('0x35')][_0xadd3('0x1f')]);}_0x28486c[_0xadd3('0x3c')]=qs[_0xadd3('0x3d')](_0x17c2af[_0xadd3('0x35')][_0xadd3('0x3d')]);_0x28486c[_0xadd3('0x3e')]=qs[_0xadd3('0x36')](_[_0xadd3('0x3f')](_0x17c2af['query'],_0x4ea72d[_0xadd3('0x36')]),_0x4c7511);if(_0x17c2af[_0xadd3('0x35')][_0xadd3('0x40')]){_0x28486c[_0xadd3('0x3e')]=_[_0xadd3('0x41')](_0x28486c[_0xadd3('0x3e')],{'$or':[{'key':{'$like':'%'+_0x17c2af[_0xadd3('0x35')][_0xadd3('0x40')]+'%'}},{'value':{'$like':'%'+_0x17c2af['query'][_0xadd3('0x40')]+'%'}}]});}_0x28486c=_['merge']({},_0x28486c,_0x17c2af[_0xadd3('0x42')]);var _0x287bdd={'where':_0x28486c[_0xadd3('0x3e')]};return db[_0xadd3('0x2f')][_0xadd3('0x22')](_0x287bdd)[_0xadd3('0x29')](function(_0x54b17a){_0x369a02[_0xadd3('0x22')]=_0x54b17a;if(_0x17c2af[_0xadd3('0x35')][_0xadd3('0x43')]){_0x28486c['include']=[{'all':!![]}];}return db[_0xadd3('0x2f')][_0xadd3('0x44')](_0x28486c);})[_0xadd3('0x29')](function(_0x18e98b){_0x369a02[_0xadd3('0x45')]=_0x18e98b;return _0x369a02;})[_0xadd3('0x29')](respondWithFilteredResult(_0x1dc01e,_0x28486c))[_0xadd3('0x46')](handleError(_0x1dc01e,null));};exports[_0xadd3('0x47')]=function(_0x1484e8,_0x2316d9){var _0x38e1b1={'raw':!![],'where':{'id':_0x1484e8[_0xadd3('0x48')]['id']}},_0x39393f={};_0x39393f[_0xadd3('0x33')]=_[_0xadd3('0x34')](db[_0xadd3('0x2f')]['rawAttributes']);_0x39393f[_0xadd3('0x35')]=_[_0xadd3('0x34')](_0x1484e8[_0xadd3('0x35')]);_0x39393f['filters']=_[_0xadd3('0x38')](_0x39393f[_0xadd3('0x33')],_0x39393f[_0xadd3('0x35')]);_0x38e1b1['attributes']=_[_0xadd3('0x38')](_0x39393f['model'],qs['fields'](_0x1484e8[_0xadd3('0x35')][_0xadd3('0x39')]));_0x38e1b1['attributes']=_0x38e1b1['attributes'][_0xadd3('0x3a')]?_0x38e1b1[_0xadd3('0x37')]:_0x39393f[_0xadd3('0x33')];if(_0x1484e8[_0xadd3('0x35')][_0xadd3('0x43')]){_0x38e1b1['include']=[{'all':!![]}];}_0x38e1b1=_[_0xadd3('0x41')]({},_0x38e1b1,_0x1484e8[_0xadd3('0x42')]);return db[_0xadd3('0x2f')][_0xadd3('0x49')](_0x38e1b1)['then'](handleEntityNotFound(_0x2316d9,null))[_0xadd3('0x29')](respondWithResult(_0x2316d9,null))[_0xadd3('0x46')](handleError(_0x2316d9,null));};exports['update']=function(_0x7f6e12,_0xf6c5cd){if(_0x7f6e12[_0xadd3('0x4a')]['id']){delete _0x7f6e12[_0xadd3('0x4a')]['id'];}return db[_0xadd3('0x2f')]['find']({'where':{'id':_0x7f6e12[_0xadd3('0x48')]['id']}})[_0xadd3('0x29')](handleEntityNotFound(_0xf6c5cd,null))[_0xadd3('0x29')](saveUpdates(_0x7f6e12[_0xadd3('0x4a')],null))['then'](respondWithResult(_0xf6c5cd,null))['catch'](handleError(_0xf6c5cd,null));};exports[_0xadd3('0x28')]=function(_0x3d1742,_0x55d224){return db[_0xadd3('0x2f')][_0xadd3('0x49')]({'where':{'id':_0x3d1742['params']['id']}})[_0xadd3('0x29')](handleEntityNotFound(_0x55d224,null))['then'](removeEntity(_0x55d224,null))[_0xadd3('0x46')](handleError(_0x55d224,null));};exports[_0xadd3('0x4b')]=function(_0x258b8f,_0x272bf1){var _0x15834c={'key':_0x258b8f[_0xadd3('0x4a')]['key']};if(_0x258b8f[_0xadd3('0x4a')][_0xadd3('0x4c')]){_0x15834c[_0xadd3('0x4c')]=_0x258b8f[_0xadd3('0x4a')][_0xadd3('0x4c')];}else if(_0x258b8f[_0xadd3('0x4a')][_0xadd3('0x4d')]){_0x15834c['SmsAccountId']=_0x258b8f['body'][_0xadd3('0x4d')];}else if(_0x258b8f[_0xadd3('0x4a')][_0xadd3('0x4e')]){_0x15834c['OpenchannelAccountId']=_0x258b8f['body'][_0xadd3('0x4e')];}else if(_0x258b8f[_0xadd3('0x4a')][_0xadd3('0x4f')]){_0x15834c['ChatWebsiteId']=_0x258b8f[_0xadd3('0x4a')][_0xadd3('0x4f')];}return db[_0xadd3('0x2f')][_0xadd3('0x49')]({'where':_0x15834c})[_0xadd3('0x29')](function(_0x539627){if(_0x539627){throw new db[(_0xadd3('0x50'))][(_0xadd3('0x51'))](_0xadd3('0x52'));}return db[_0xadd3('0x2f')][_0xadd3('0x4b')](_0x258b8f['body']);})[_0xadd3('0x29')](function(_0x10e9b7){var _0x5572c5=_0x258b8f['user']['get']({'plain':!![]});if(!_0x5572c5)throw new Error(_0xadd3('0x53'));if(_0x5572c5[_0xadd3('0x54')]===_0xadd3('0x55')){var _0x16e1c8=_0x10e9b7[_0xadd3('0x56')]({'plain':!![]});return db[_0xadd3('0x57')][_0xadd3('0x49')]({'where':{'name':_0xadd3('0x58'),'userProfileId':_0x5572c5[_0xadd3('0x59')]},'raw':!![]})[_0xadd3('0x29')](function(_0x4df9d9){if(_0x4df9d9&&_0x4df9d9['autoAssociation']===0x0){return db[_0xadd3('0x2a')]['create']({'name':_0x16e1c8[_0xadd3('0x2c')],'resourceId':_0x16e1c8['id'],'type':_0x4df9d9[_0xadd3('0x2c')],'sectionId':_0x4df9d9['id']},{})[_0xadd3('0x29')](function(){return _0x10e9b7;});}else{return _0x10e9b7;}})[_0xadd3('0x46')](function(_0x184c7a){logger['error'](_0xadd3('0x5a'),_0x184c7a);throw _0x184c7a;});}return _0x10e9b7;})[_0xadd3('0x29')](respondWithResult(_0x272bf1,0xc9))[_0xadd3('0x46')](handleError(_0x272bf1,null));}; \ No newline at end of file +var _0x4e88=['save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','send','index','rawAttributes','fieldName','type','key','model','map','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','CannedAnswer','includeAll','include','findAll','rows','catch','keys','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','apply','reject'];(function(_0x469a3c,_0x5ebc10){var _0x968f4=function(_0x22403b){while(--_0x22403b){_0x469a3c['push'](_0x469a3c['shift']());}};_0x968f4(++_0x5ebc10);}(_0x4e88,0x1f1));var _0x84e8=function(_0x4bc45f,_0x682fc5){_0x4bc45f=_0x4bc45f-0x0;var _0x56bc3b=_0x4e88[_0x4bc45f];return _0x56bc3b;};'use strict';var emlformat=require(_0x84e8('0x0'));var rimraf=require(_0x84e8('0x1'));var zipdir=require(_0x84e8('0x2'));var jsonpatch=require(_0x84e8('0x3'));var rp=require(_0x84e8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x84e8('0x5'));var util=require(_0x84e8('0x6'));var path=require(_0x84e8('0x7'));var sox=require('sox');var csv=require(_0x84e8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x84e8('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x84e8('0xa'));var jsforce=require(_0x84e8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x84e8('0x8'));var querystring=require(_0x84e8('0xc'));var Papa=require(_0x84e8('0xd'));var Redis=require(_0x84e8('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x84e8('0xf'));var as=require(_0x84e8('0x10'));var hardwareService=require(_0x84e8('0x11'));var logger=require('../../config/logger')(_0x84e8('0x12'));var utils=require(_0x84e8('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x84e8('0x14'))['db'];function respondWithStatusCode(_0x70a241,_0x317fe7){_0x317fe7=_0x317fe7||0xcc;return function(_0x4cd47b){if(_0x4cd47b){return _0x70a241[_0x84e8('0x15')](_0x317fe7);}return _0x70a241[_0x84e8('0x16')](_0x317fe7)['end']();};}function respondWithResult(_0x4ea428,_0x49cc09){_0x49cc09=_0x49cc09||0xc8;return function(_0x1d3a45){if(_0x1d3a45){return _0x4ea428[_0x84e8('0x16')](_0x49cc09)[_0x84e8('0x17')](_0x1d3a45);}};}function respondWithFilteredResult(_0x599de9,_0x46532a){return function(_0x2c69f8){if(_0x2c69f8){var _0x12e0e1=typeof _0x46532a['offset']===_0x84e8('0x18')&&typeof _0x46532a[_0x84e8('0x19')]==='undefined';var _0x12026e=_0x2c69f8[_0x84e8('0x1a')];var _0x197b43=_0x12e0e1?0x0:_0x46532a[_0x84e8('0x1b')];var _0x40d76e=_0x12e0e1?_0x2c69f8[_0x84e8('0x1a')]:_0x46532a[_0x84e8('0x1b')]+_0x46532a[_0x84e8('0x19')];var _0x3d5328;if(_0x40d76e>=_0x12026e){_0x40d76e=_0x12026e;_0x3d5328=0xc8;}else{_0x3d5328=0xce;}_0x599de9[_0x84e8('0x16')](_0x3d5328);return _0x599de9[_0x84e8('0x1c')]('Content-Range',_0x197b43+'-'+_0x40d76e+'/'+_0x12026e)[_0x84e8('0x17')](_0x2c69f8);}return null;};}function patchUpdates(_0x3d0888){return function(_0x1d9162){try{jsonpatch[_0x84e8('0x1d')](_0x1d9162,_0x3d0888,!![]);}catch(_0x593865){return BPromise[_0x84e8('0x1e')](_0x593865);}return _0x1d9162[_0x84e8('0x1f')]();};}function saveUpdates(_0x31352f,_0x23b441){return function(_0x470697){if(_0x470697){return _0x470697[_0x84e8('0x20')](_0x31352f)[_0x84e8('0x21')](function(_0x1c1f84){return _0x1c1f84;});}return null;};}function removeEntity(_0x42ad7a,_0x5d7e54){return function(_0x4657b9){if(_0x4657b9){return _0x4657b9[_0x84e8('0x22')]()[_0x84e8('0x21')](function(){var _0xc1cd19=_0x4657b9[_0x84e8('0x23')]({'plain':!![]});var _0x45cda2=_0x84e8('0x24');return db[_0x84e8('0x25')]['destroy']({'where':{'type':_0x45cda2,'resourceId':_0xc1cd19['id']}})[_0x84e8('0x21')](function(){return _0x4657b9;});})[_0x84e8('0x21')](function(){_0x42ad7a['status'](0xcc)[_0x84e8('0x26')]();});}};}function handleEntityNotFound(_0xf0cf15,_0x145bc4){return function(_0x7dd3d1){if(!_0x7dd3d1){_0xf0cf15[_0x84e8('0x15')](0x194);}return _0x7dd3d1;};}function handleError(_0x19f4b0,_0xbb4224){_0xbb4224=_0xbb4224||0x1f4;return function(_0x1bac72){logger[_0x84e8('0x27')](_0x1bac72['stack']);if(_0x1bac72[_0x84e8('0x28')]){delete _0x1bac72[_0x84e8('0x28')];}_0x19f4b0[_0x84e8('0x16')](_0xbb4224)[_0x84e8('0x29')](_0x1bac72);};}exports[_0x84e8('0x2a')]=function(_0x1e6406,_0x3382a2){var _0x1904d9={},_0x75bfe8={},_0x1b9766={'count':0x0,'rows':[]};var _0x59d051=_['map'](db['CannedAnswer'][_0x84e8('0x2b')],function(_0xbe037d){return{'name':_0xbe037d[_0x84e8('0x2c')],'type':_0xbe037d[_0x84e8('0x2d')][_0x84e8('0x2e')]};});_0x75bfe8[_0x84e8('0x2f')]=_[_0x84e8('0x30')](_0x59d051,_0x84e8('0x28'));_0x75bfe8['query']=_['keys'](_0x1e6406['query']);_0x75bfe8['filters']=_[_0x84e8('0x31')](_0x75bfe8['model'],_0x75bfe8[_0x84e8('0x32')]);_0x1904d9[_0x84e8('0x33')]=_[_0x84e8('0x31')](_0x75bfe8[_0x84e8('0x2f')],qs[_0x84e8('0x34')](_0x1e6406['query'][_0x84e8('0x34')]));_0x1904d9['attributes']=_0x1904d9[_0x84e8('0x33')][_0x84e8('0x35')]?_0x1904d9['attributes']:_0x75bfe8[_0x84e8('0x2f')];if(!_0x1e6406[_0x84e8('0x32')][_0x84e8('0x36')](_0x84e8('0x37'))){_0x1904d9[_0x84e8('0x19')]=qs[_0x84e8('0x19')](_0x1e6406[_0x84e8('0x32')][_0x84e8('0x19')]);_0x1904d9[_0x84e8('0x1b')]=qs[_0x84e8('0x1b')](_0x1e6406[_0x84e8('0x32')]['offset']);}_0x1904d9[_0x84e8('0x38')]=qs[_0x84e8('0x39')](_0x1e6406[_0x84e8('0x32')][_0x84e8('0x39')]);_0x1904d9[_0x84e8('0x3a')]=qs[_0x84e8('0x3b')](_[_0x84e8('0x3c')](_0x1e6406[_0x84e8('0x32')],_0x75bfe8[_0x84e8('0x3b')]),_0x59d051);if(_0x1e6406[_0x84e8('0x32')][_0x84e8('0x3d')]){_0x1904d9[_0x84e8('0x3a')]=_[_0x84e8('0x3e')](_0x1904d9[_0x84e8('0x3a')],{'$or':[{'key':{'$like':'%'+_0x1e6406[_0x84e8('0x32')][_0x84e8('0x3d')]+'%'}},{'value':{'$like':'%'+_0x1e6406[_0x84e8('0x32')][_0x84e8('0x3d')]+'%'}}]});}_0x1904d9=_[_0x84e8('0x3e')]({},_0x1904d9,_0x1e6406[_0x84e8('0x3f')]);var _0x44b0cc={'where':_0x1904d9[_0x84e8('0x3a')]};return db[_0x84e8('0x40')]['count'](_0x44b0cc)[_0x84e8('0x21')](function(_0x14893f){_0x1b9766['count']=_0x14893f;if(_0x1e6406[_0x84e8('0x32')][_0x84e8('0x41')]){_0x1904d9[_0x84e8('0x42')]=[{'all':!![]}];}return db[_0x84e8('0x40')][_0x84e8('0x43')](_0x1904d9);})['then'](function(_0x33a5ae){_0x1b9766[_0x84e8('0x44')]=_0x33a5ae;return _0x1b9766;})[_0x84e8('0x21')](respondWithFilteredResult(_0x3382a2,_0x1904d9))[_0x84e8('0x45')](handleError(_0x3382a2,null));};exports['show']=function(_0x808383,_0x1d9d4c){var _0x4ce24a={'raw':!![],'where':{'id':_0x808383['params']['id']}},_0x2ed02b={};_0x2ed02b[_0x84e8('0x2f')]=_['keys'](db[_0x84e8('0x40')][_0x84e8('0x2b')]);_0x2ed02b[_0x84e8('0x32')]=_[_0x84e8('0x46')](_0x808383['query']);_0x2ed02b['filters']=_[_0x84e8('0x31')](_0x2ed02b[_0x84e8('0x2f')],_0x2ed02b['query']);_0x4ce24a[_0x84e8('0x33')]=_[_0x84e8('0x31')](_0x2ed02b['model'],qs[_0x84e8('0x34')](_0x808383[_0x84e8('0x32')][_0x84e8('0x34')]));_0x4ce24a[_0x84e8('0x33')]=_0x4ce24a[_0x84e8('0x33')][_0x84e8('0x35')]?_0x4ce24a[_0x84e8('0x33')]:_0x2ed02b['model'];if(_0x808383[_0x84e8('0x32')][_0x84e8('0x41')]){_0x4ce24a['include']=[{'all':!![]}];}_0x4ce24a=_[_0x84e8('0x3e')]({},_0x4ce24a,_0x808383[_0x84e8('0x3f')]);return db['CannedAnswer'][_0x84e8('0x47')](_0x4ce24a)[_0x84e8('0x21')](handleEntityNotFound(_0x1d9d4c,null))[_0x84e8('0x21')](respondWithResult(_0x1d9d4c,null))[_0x84e8('0x45')](handleError(_0x1d9d4c,null));};exports[_0x84e8('0x20')]=function(_0x13a3f1,_0x297dae){if(_0x13a3f1[_0x84e8('0x48')]['id']){delete _0x13a3f1['body']['id'];}return db[_0x84e8('0x40')][_0x84e8('0x47')]({'where':{'id':_0x13a3f1[_0x84e8('0x49')]['id']}})[_0x84e8('0x21')](handleEntityNotFound(_0x297dae,null))['then'](saveUpdates(_0x13a3f1['body'],null))['then'](respondWithResult(_0x297dae,null))[_0x84e8('0x45')](handleError(_0x297dae,null));};exports[_0x84e8('0x22')]=function(_0x26d2b6,_0x560a89){return db[_0x84e8('0x40')]['find']({'where':{'id':_0x26d2b6[_0x84e8('0x49')]['id']}})[_0x84e8('0x21')](handleEntityNotFound(_0x560a89,null))[_0x84e8('0x21')](removeEntity(_0x560a89,null))['catch'](handleError(_0x560a89,null));};exports[_0x84e8('0x4a')]=function(_0x58c0e5,_0x42c1e2){var _0x1b1c34={'key':_0x58c0e5[_0x84e8('0x48')]['key']};if(_0x58c0e5[_0x84e8('0x48')][_0x84e8('0x4b')]){_0x1b1c34[_0x84e8('0x4b')]=_0x58c0e5[_0x84e8('0x48')][_0x84e8('0x4b')];}else if(_0x58c0e5[_0x84e8('0x48')]['SmsAccountId']){_0x1b1c34[_0x84e8('0x4c')]=_0x58c0e5[_0x84e8('0x48')][_0x84e8('0x4c')];}else if(_0x58c0e5[_0x84e8('0x48')][_0x84e8('0x4d')]){_0x1b1c34[_0x84e8('0x4d')]=_0x58c0e5[_0x84e8('0x48')][_0x84e8('0x4d')];}else if(_0x58c0e5[_0x84e8('0x48')]['ChatWebsiteId']){_0x1b1c34[_0x84e8('0x4e')]=_0x58c0e5['body'][_0x84e8('0x4e')];}return db[_0x84e8('0x40')][_0x84e8('0x47')]({'where':_0x1b1c34})[_0x84e8('0x21')](function(_0x3e5e84){if(_0x3e5e84){throw new db[(_0x84e8('0x4f'))][(_0x84e8('0x50'))](_0x84e8('0x51'));}return db[_0x84e8('0x40')][_0x84e8('0x4a')](_0x58c0e5[_0x84e8('0x48')]);})[_0x84e8('0x21')](function(_0x39916d){var _0x3c8bbd=_0x58c0e5[_0x84e8('0x52')][_0x84e8('0x23')]({'plain':!![]});if(!_0x3c8bbd)throw new Error(_0x84e8('0x53'));if(_0x3c8bbd[_0x84e8('0x54')]===_0x84e8('0x52')){var _0x3338fa=_0x39916d[_0x84e8('0x23')]({'plain':!![]});return db[_0x84e8('0x55')][_0x84e8('0x47')]({'where':{'name':_0x84e8('0x24'),'userProfileId':_0x3c8bbd['userProfileId']},'raw':!![]})['then'](function(_0x1034b5){if(_0x1034b5&&_0x1034b5[_0x84e8('0x56')]===0x0){return db[_0x84e8('0x25')][_0x84e8('0x4a')]({'name':_0x3338fa[_0x84e8('0x28')],'resourceId':_0x3338fa['id'],'type':_0x1034b5[_0x84e8('0x28')],'sectionId':_0x1034b5['id']},{})[_0x84e8('0x21')](function(){return _0x39916d;});}else{return _0x39916d;}})['catch'](function(_0x22e4d7){logger[_0x84e8('0x27')](_0x84e8('0x57'),_0x22e4d7);throw _0x22e4d7;});}return _0x39916d;})[_0x84e8('0x21')](respondWithResult(_0x42c1e2,0xc9))['catch'](handleError(_0x42c1e2,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 6d81504..315ed82 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 _0xabd2=['exports','define','tools_canned_answers','utf8mb4','lodash','util','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes'];(function(_0x3255c4,_0x273558){var _0x288469=function(_0x3931d9){while(--_0x3931d9){_0x3255c4['push'](_0x3255c4['shift']());}};_0x288469(++_0x273558);}(_0xabd2,0x10c));var _0x2abd=function(_0x1ec623,_0x2202ff){_0x1ec623=_0x1ec623-0x0;var _0x44fdeb=_0xabd2[_0x1ec623];return _0x44fdeb;};'use strict';var _=require(_0x2abd('0x0'));var util=require(_0x2abd('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2abd('0x2'));var fs=require('fs');var path=require(_0x2abd('0x3'));var rimraf=require(_0x2abd('0x4'));var config=require(_0x2abd('0x5'));var attributes=require(_0x2abd('0x6'));module[_0x2abd('0x7')]=function(_0x3c9c06,_0x315870){return _0x3c9c06[_0x2abd('0x8')]('CannedAnswer',attributes,{'tableName':_0x2abd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2abd('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf3f2=['exports','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes'];(function(_0x3fb166,_0x4eb985){var _0x5e91be=function(_0x53f4d9){while(--_0x53f4d9){_0x3fb166['push'](_0x3fb166['shift']());}};_0x5e91be(++_0x4eb985);}(_0xf3f2,0x140));var _0x2f3f=function(_0xd255a7,_0x3c688f){_0xd255a7=_0xd255a7-0x0;var _0x30273f=_0xf3f2[_0xd255a7];return _0x30273f;};'use strict';var _=require(_0x2f3f('0x0'));var util=require(_0x2f3f('0x1'));var logger=require(_0x2f3f('0x2'))(_0x2f3f('0x3'));var moment=require(_0x2f3f('0x4'));var BPromise=require(_0x2f3f('0x5'));var rp=require(_0x2f3f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2f3f('0x7'));var config=require(_0x2f3f('0x8'));var attributes=require(_0x2f3f('0x9'));module[_0x2f3f('0xa')]=function(_0x361aff,_0x47d0d4){return _0x361aff['define'](_0x2f3f('0xb'),attributes,{'tableName':_0x2f3f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2f3f('0xd'),'collate':_0x2f3f('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 9f635cc..2e58a0e 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 _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\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(_0x4c9fdb,_0x224981){var _0x4c86db=function(_0x1c1b46){while(--_0x1c1b46){_0x4c9fdb['push'](_0x4c9fdb['shift']());}};_0x4c86db(++_0x224981);}(_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});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','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\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(_0x2ebcd1,_0x5b1f6a){var _0x48eb0c=function(_0x51997a){while(--_0x51997a){_0x2ebcd1['push'](_0x2ebcd1['shift']());}};_0x48eb0c(++_0x5b1f6a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 4d8f7a0..40825d1 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 _0x0170=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete'];(function(_0x9a5c1b,_0x38ad26){var _0x4ffde4=function(_0x3b1dae){while(--_0x3b1dae){_0x9a5c1b['push'](_0x9a5c1b['shift']());}};_0x4ffde4(++_0x38ad26);}(_0x0170,0xca));var _0x0017=function(_0x23fbd3,_0x2f5c14){_0x23fbd3=_0x23fbd3-0x0;var _0x4d46ad=_0x0170[_0x23fbd3];return _0x4d46ad;};'use strict';var multer=require(_0x0017('0x0'));var util=require('util');var path=require(_0x0017('0x1'));var timeout=require(_0x0017('0x2'));var express=require(_0x0017('0x3'));var router=express[_0x0017('0x4')]();var fs_extra=require(_0x0017('0x5'));var auth=require(_0x0017('0x6'));var interaction=require(_0x0017('0x7'));var config=require(_0x0017('0x8'));var controller=require('./cannedAnswer.controller');router[_0x0017('0x9')]('/',auth[_0x0017('0xa')](),controller['index']);router[_0x0017('0x9')](_0x0017('0xb'),auth[_0x0017('0xa')](),controller[_0x0017('0xc')]);router[_0x0017('0xd')]('/',auth[_0x0017('0xa')](),controller[_0x0017('0xe')]);router[_0x0017('0xf')](_0x0017('0xb'),auth[_0x0017('0xa')](),controller[_0x0017('0x10')]);router[_0x0017('0x11')](_0x0017('0xb'),auth['isAuthenticated'](),controller[_0x0017('0x12')]);module[_0x0017('0x13')]=router; \ No newline at end of file +var _0x0a7e=['../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','isAuthenticated','index','get','show','post','put','/:id','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x3f3cc0,_0x10a90d){var _0x47963f=function(_0x33dad0){while(--_0x33dad0){_0x3f3cc0['push'](_0x3f3cc0['shift']());}};_0x47963f(++_0x10a90d);}(_0x0a7e,0x13e));var _0xe0a7=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x0a7e[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0xe0a7('0x0'));var util=require(_0xe0a7('0x1'));var path=require(_0xe0a7('0x2'));var timeout=require('connect-timeout');var express=require(_0xe0a7('0x3'));var router=express[_0xe0a7('0x4')]();var fs_extra=require(_0xe0a7('0x5'));var auth=require(_0xe0a7('0x6'));var interaction=require(_0xe0a7('0x7'));var config=require('../../config/environment');var controller=require(_0xe0a7('0x8'));router['get']('/',auth[_0xe0a7('0x9')](),controller[_0xe0a7('0xa')]);router[_0xe0a7('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xe0a7('0xc')]);router[_0xe0a7('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe0a7('0xe')](_0xe0a7('0xf'),auth[_0xe0a7('0x9')](),controller['update']);router['delete']('/:id',auth[_0xe0a7('0x9')](),controller[_0xe0a7('0x10')]);module[_0xe0a7('0x11')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 364fa06..d928f22 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 _0x7d5a=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x3ed51e,_0x4527ef){var _0x37f196=function(_0x39c3ca){while(--_0x39c3ca){_0x3ed51e['push'](_0x3ed51e['shift']());}};_0x37f196(++_0x4527ef);}(_0x7d5a,0x17b));var _0xa7d5=function(_0x1ad9c1,_0x25fb1a){_0x1ad9c1=_0x1ad9c1-0x0;var _0xe51c37=_0x7d5a[_0x1ad9c1];return _0xe51c37;};'use strict';var Sequelize=require(_0xa7d5('0x0'));module[_0xa7d5('0x1')]={'calldate':{'type':Sequelize[_0xa7d5('0x2')],'allowNull':![],'defaultValue':_0xa7d5('0x3')},'clid':{'type':Sequelize[_0xa7d5('0x4')]},'src':{'type':Sequelize[_0xa7d5('0x4')]},'dst':{'type':Sequelize[_0xa7d5('0x4')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xa7d5('0x4')]},'lastapp':{'type':Sequelize[_0xa7d5('0x4')]},'lastdata':{'type':Sequelize[_0xa7d5('0x4')]},'duration':{'type':Sequelize[_0xa7d5('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xa7d5('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xa7d5('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xa7d5('0x4')]},'userfield':{'type':Sequelize[_0xa7d5('0x4')]},'uniqueid':{'type':Sequelize[_0xa7d5('0x4')]},'linkedid':{'type':Sequelize[_0xa7d5('0x4')]},'sequence':{'type':Sequelize[_0xa7d5('0x4')]},'peeraccount':{'type':Sequelize[_0xa7d5('0x4')]},'type':{'type':Sequelize[_0xa7d5('0x4')]},'tag':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x138d=['STRING','INTEGER','sequelize','exports','1970-01-01\x2000:00:01'];(function(_0x25ae2e,_0x91a20b){var _0x3fc64f=function(_0x2d00ca){while(--_0x2d00ca){_0x25ae2e['push'](_0x25ae2e['shift']());}};_0x3fc64f(++_0x91a20b);}(_0x138d,0x1ab));var _0xd138=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x138d[_0x4e6ae6];return _0x23c108;};'use strict';var Sequelize=require(_0xd138('0x0'));module[_0xd138('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xd138('0x2')},'clid':{'type':Sequelize[_0xd138('0x3')]},'src':{'type':Sequelize[_0xd138('0x3')]},'dst':{'type':Sequelize[_0xd138('0x3')]},'dcontext':{'type':Sequelize[_0xd138('0x3')]},'channel':{'type':Sequelize[_0xd138('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xd138('0x3')]},'lastdata':{'type':Sequelize[_0xd138('0x3')]},'duration':{'type':Sequelize[_0xd138('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd138('0x3')]},'amaflags':{'type':Sequelize[_0xd138('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd138('0x3')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xd138('0x3')]},'sequence':{'type':Sequelize[_0xd138('0x3')]},'peeraccount':{'type':Sequelize[_0xd138('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xd138('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index ae6a043..7b9e6fc 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 _0xe107=['Cdr','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','type','VIRTUAL','filter','options','include','rows','catch','show','params','includeAll','create','body','find','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0x4f4921,_0xbe213c){var _0x2fa710=function(_0x201b14){while(--_0x201b14){_0x4f4921['push'](_0x4f4921['shift']());}};_0x2fa710(++_0xbe213c);}(_0xe107,0xb3));var _0x7e10=function(_0x1e1b24,_0x35078f){_0x1e1b24=_0x1e1b24-0x0;var _0x4a3f83=_0xe107[_0x1e1b24];return _0x4a3f83;};'use strict';var emlformat=require(_0x7e10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7e10('0x1'));var jsonpatch=require(_0x7e10('0x2'));var rp=require(_0x7e10('0x3'));var moment=require('moment');var BPromise=require(_0x7e10('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7e10('0x5'));var sox=require(_0x7e10('0x6'));var csv=require(_0x7e10('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7e10('0x8'));var squel=require(_0x7e10('0x9'));var crypto=require(_0x7e10('0xa'));var jsforce=require(_0x7e10('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7e10('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7e10('0xd'));var qs=require(_0x7e10('0xe'));var as=require(_0x7e10('0xf'));var hardwareService=require(_0x7e10('0x10'));var logger=require(_0x7e10('0x11'))('api');var utils=require(_0x7e10('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x7e10('0x13'));var db=require(_0x7e10('0x14'))['db'];function respondWithStatusCode(_0x2f4d72,_0x5434dd){_0x5434dd=_0x5434dd||0xcc;return function(_0xc2e42b){if(_0xc2e42b){return _0x2f4d72[_0x7e10('0x15')](_0x5434dd);}return _0x2f4d72[_0x7e10('0x16')](_0x5434dd)[_0x7e10('0x17')]();};}function respondWithResult(_0x119ff5,_0x1b4d9d){_0x1b4d9d=_0x1b4d9d||0xc8;return function(_0x1c2b22){if(_0x1c2b22){return _0x119ff5[_0x7e10('0x16')](_0x1b4d9d)['json'](_0x1c2b22);}};}function respondWithFilteredResult(_0x15e9e5,_0x433221){return function(_0x4bd78a){if(_0x4bd78a){var _0x48339f=typeof _0x433221[_0x7e10('0x18')]==='undefined'&&typeof _0x433221[_0x7e10('0x19')]===_0x7e10('0x1a');var _0xdbda1a=_0x4bd78a[_0x7e10('0x1b')];var _0x4fd639=_0x48339f?0x0:_0x433221[_0x7e10('0x18')];var _0x2b4850=_0x48339f?_0x4bd78a[_0x7e10('0x1b')]:_0x433221['offset']+_0x433221[_0x7e10('0x19')];var _0x36149a;if(_0x2b4850>=_0xdbda1a){_0x2b4850=_0xdbda1a;_0x36149a=0xc8;}else{_0x36149a=0xce;}_0x15e9e5[_0x7e10('0x16')](_0x36149a);return _0x15e9e5[_0x7e10('0x1c')](_0x7e10('0x1d'),_0x4fd639+'-'+_0x2b4850+'/'+_0xdbda1a)['json'](_0x4bd78a);}return null;};}function patchUpdates(_0x45a0cb){return function(_0x2c6227){try{jsonpatch['apply'](_0x2c6227,_0x45a0cb,!![]);}catch(_0x3c5629){return BPromise[_0x7e10('0x1e')](_0x3c5629);}return _0x2c6227[_0x7e10('0x1f')]();};}function saveUpdates(_0x482faa,_0x4a667b){return function(_0x415cb7){if(_0x415cb7){return _0x415cb7[_0x7e10('0x20')](_0x482faa)[_0x7e10('0x21')](function(_0x1c72df){return _0x1c72df;});}return null;};}function removeEntity(_0x35e7c9,_0x105a55){return function(_0x12c36d){if(_0x12c36d){return _0x12c36d[_0x7e10('0x22')]()['then'](function(){_0x35e7c9['status'](0xcc)[_0x7e10('0x17')]();});}};}function handleEntityNotFound(_0xe34c1e,_0x1bfe8a){return function(_0x13eeb3){if(!_0x13eeb3){_0xe34c1e['sendStatus'](0x194);}return _0x13eeb3;};}function handleError(_0x537365,_0x116446){_0x116446=_0x116446||0x1f4;return function(_0x12ba1b){logger[_0x7e10('0x23')](_0x12ba1b[_0x7e10('0x24')]);if(_0x12ba1b[_0x7e10('0x25')]){delete _0x12ba1b[_0x7e10('0x25')];}_0x537365[_0x7e10('0x16')](_0x116446)[_0x7e10('0x26')](_0x12ba1b);};}exports[_0x7e10('0x27')]=function(_0x3b020c,_0x5691f8){var _0x4e225d={},_0xbc509={},_0x884343={'count':0x0,'rows':[]};var _0x560460=_['map'](db[_0x7e10('0x28')][_0x7e10('0x29')],function(_0x537587){return{'name':_0x537587[_0x7e10('0x2a')],'type':_0x537587['type'][_0x7e10('0x2b')]};});_0xbc509[_0x7e10('0x2c')]=_[_0x7e10('0x2d')](_0x560460,_0x7e10('0x25'));_0xbc509[_0x7e10('0x2e')]=_[_0x7e10('0x2f')](_0x3b020c['query']);_0xbc509[_0x7e10('0x30')]=_['intersection'](_0xbc509[_0x7e10('0x2c')],_0xbc509[_0x7e10('0x2e')]);_0x4e225d[_0x7e10('0x31')]=_[_0x7e10('0x32')](_0xbc509[_0x7e10('0x2c')],qs[_0x7e10('0x33')](_0x3b020c[_0x7e10('0x2e')][_0x7e10('0x33')]));_0x4e225d[_0x7e10('0x31')]=_0x4e225d['attributes'][_0x7e10('0x34')]?_0x4e225d[_0x7e10('0x31')]:_0xbc509[_0x7e10('0x2c')];if(!_0x3b020c[_0x7e10('0x2e')][_0x7e10('0x35')]('nolimit')){_0x4e225d[_0x7e10('0x19')]=qs[_0x7e10('0x19')](_0x3b020c[_0x7e10('0x2e')][_0x7e10('0x19')]);_0x4e225d['offset']=qs['offset'](_0x3b020c[_0x7e10('0x2e')][_0x7e10('0x18')]);}_0x4e225d[_0x7e10('0x36')]=qs[_0x7e10('0x37')](_0x3b020c['query'][_0x7e10('0x37')]);_0x4e225d[_0x7e10('0x38')]=qs['filters'](_[_0x7e10('0x39')](_0x3b020c[_0x7e10('0x2e')],_0xbc509['filters']),_0x560460);if(_0x3b020c['query']['filter']){_0x4e225d[_0x7e10('0x38')]=_[_0x7e10('0x3a')](_0x4e225d[_0x7e10('0x38')],{'$or':_[_0x7e10('0x2d')](_0x560460,function(_0xd696d2){if(_0xd696d2[_0x7e10('0x3b')]!==_0x7e10('0x3c')){var _0x419085={};_0x419085[_0xd696d2['name']]={'$like':'%'+_0x3b020c[_0x7e10('0x2e')][_0x7e10('0x3d')]+'%'};return _0x419085;}})});}_0x4e225d=_[_0x7e10('0x3a')]({},_0x4e225d,_0x3b020c[_0x7e10('0x3e')]);var _0x4ebf4a={'where':_0x4e225d[_0x7e10('0x38')]};return db[_0x7e10('0x28')][_0x7e10('0x1b')](_0x4ebf4a)[_0x7e10('0x21')](function(_0x3ad2f0){_0x884343[_0x7e10('0x1b')]=_0x3ad2f0;if(_0x3b020c[_0x7e10('0x2e')]['includeAll']){_0x4e225d[_0x7e10('0x3f')]=[{'all':!![]}];}return db[_0x7e10('0x28')]['findAll'](_0x4e225d);})[_0x7e10('0x21')](function(_0x5c62ac){_0x884343[_0x7e10('0x40')]=_0x5c62ac;return _0x884343;})['then'](respondWithFilteredResult(_0x5691f8,_0x4e225d))[_0x7e10('0x41')](handleError(_0x5691f8,null));};exports[_0x7e10('0x42')]=function(_0x1940ff,_0x18e9b2){var _0x3c6a01={'raw':!![],'where':{'id':_0x1940ff[_0x7e10('0x43')]['id']}},_0x4c2946={};_0x4c2946[_0x7e10('0x2c')]=_[_0x7e10('0x2f')](db[_0x7e10('0x28')][_0x7e10('0x29')]);_0x4c2946['query']=_[_0x7e10('0x2f')](_0x1940ff[_0x7e10('0x2e')]);_0x4c2946['filters']=_['intersection'](_0x4c2946[_0x7e10('0x2c')],_0x4c2946[_0x7e10('0x2e')]);_0x3c6a01['attributes']=_[_0x7e10('0x32')](_0x4c2946['model'],qs[_0x7e10('0x33')](_0x1940ff['query'][_0x7e10('0x33')]));_0x3c6a01[_0x7e10('0x31')]=_0x3c6a01['attributes']['length']?_0x3c6a01['attributes']:_0x4c2946['model'];if(_0x1940ff['query'][_0x7e10('0x44')]){_0x3c6a01[_0x7e10('0x3f')]=[{'all':!![]}];}_0x3c6a01=_[_0x7e10('0x3a')]({},_0x3c6a01,_0x1940ff[_0x7e10('0x3e')]);return db[_0x7e10('0x28')]['find'](_0x3c6a01)[_0x7e10('0x21')](handleEntityNotFound(_0x18e9b2,null))['then'](respondWithResult(_0x18e9b2,null))[_0x7e10('0x41')](handleError(_0x18e9b2,null));};exports[_0x7e10('0x45')]=function(_0x43745a,_0x290f9c){return db['Cdr']['create'](_0x43745a[_0x7e10('0x46')],{})[_0x7e10('0x21')](respondWithResult(_0x290f9c,0xc9))['catch'](handleError(_0x290f9c,null));};exports['update']=function(_0x2ceaec,_0x3f0a05){if(_0x2ceaec[_0x7e10('0x46')]['id']){delete _0x2ceaec[_0x7e10('0x46')]['id'];}return db[_0x7e10('0x28')][_0x7e10('0x47')]({'where':{'id':_0x2ceaec[_0x7e10('0x43')]['id']}})[_0x7e10('0x21')](handleEntityNotFound(_0x3f0a05,null))['then'](saveUpdates(_0x2ceaec[_0x7e10('0x46')],null))['then'](respondWithResult(_0x3f0a05,null))[_0x7e10('0x41')](handleError(_0x3f0a05,null));};exports[_0x7e10('0x22')]=function(_0x29bd0d,_0x4fec7f){return db['Cdr'][_0x7e10('0x47')]({'where':{'id':_0x29bd0d[_0x7e10('0x43')]['id']}})[_0x7e10('0x21')](handleEntityNotFound(_0x4fec7f,null))[_0x7e10('0x21')](removeEntity(_0x4fec7f,null))[_0x7e10('0x41')](handleError(_0x4fec7f,null));};exports['describe']=function(_0x39c23d,_0x498ebf){return db['Cdr'][_0x7e10('0x48')]()[_0x7e10('0x21')](respondWithResult(_0x498ebf,null))['catch'](handleError(_0x498ebf,null));}; \ No newline at end of file +var _0xc3b5=['destroy','error','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','show','find','create','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','then'];(function(_0x3bd555,_0x2081bf){var _0xdd3a1b=function(_0x3b6f87){while(--_0x3b6f87){_0x3bd555['push'](_0x3bd555['shift']());}};_0xdd3a1b(++_0x2081bf);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x3e4134,_0x2df961){_0x3e4134=_0x3e4134-0x0;var _0x32674d=_0xc3b5[_0x3e4134];return _0x32674d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5c3b('0x0'));var jsonpatch=require(_0x5c3b('0x1'));var rp=require(_0x5c3b('0x2'));var moment=require(_0x5c3b('0x3'));var BPromise=require(_0x5c3b('0x4'));var Mustache=require(_0x5c3b('0x5'));var util=require(_0x5c3b('0x6'));var path=require(_0x5c3b('0x7'));var sox=require('sox');var csv=require(_0x5c3b('0x8'));var ejs=require(_0x5c3b('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c3b('0xa'));var squel=require(_0x5c3b('0xb'));var crypto=require(_0x5c3b('0xc'));var jsforce=require(_0x5c3b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5c3b('0x8'));var querystring=require(_0x5c3b('0xe'));var Papa=require(_0x5c3b('0xf'));var Redis=require(_0x5c3b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5c3b('0x11'));var as=require(_0x5c3b('0x12'));var hardwareService=require(_0x5c3b('0x13'));var logger=require(_0x5c3b('0x14'))(_0x5c3b('0x15'));var utils=require('../../config/utils');var config=require(_0x5c3b('0x16'));var licenseUtil=require(_0x5c3b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b2815,_0x3b953d){_0x3b953d=_0x3b953d||0xcc;return function(_0x507c2e){if(_0x507c2e){return _0x1b2815[_0x5c3b('0x18')](_0x3b953d);}return _0x1b2815[_0x5c3b('0x19')](_0x3b953d)[_0x5c3b('0x1a')]();};}function respondWithResult(_0x2384b9,_0x315e68){_0x315e68=_0x315e68||0xc8;return function(_0x3fef28){if(_0x3fef28){return _0x2384b9[_0x5c3b('0x19')](_0x315e68)['json'](_0x3fef28);}};}function respondWithFilteredResult(_0x2f7ab2,_0x5b55be){return function(_0x4cf80d){if(_0x4cf80d){var _0x195c1e=typeof _0x5b55be[_0x5c3b('0x1b')]===_0x5c3b('0x1c')&&typeof _0x5b55be['limit']===_0x5c3b('0x1c');var _0x229e28=_0x4cf80d[_0x5c3b('0x1d')];var _0x59f71b=_0x195c1e?0x0:_0x5b55be[_0x5c3b('0x1b')];var _0x34144d=_0x195c1e?_0x4cf80d['count']:_0x5b55be[_0x5c3b('0x1b')]+_0x5b55be[_0x5c3b('0x1e')];var _0x2b2307;if(_0x34144d>=_0x229e28){_0x34144d=_0x229e28;_0x2b2307=0xc8;}else{_0x2b2307=0xce;}_0x2f7ab2[_0x5c3b('0x19')](_0x2b2307);return _0x2f7ab2[_0x5c3b('0x1f')](_0x5c3b('0x20'),_0x59f71b+'-'+_0x34144d+'/'+_0x229e28)[_0x5c3b('0x21')](_0x4cf80d);}return null;};}function patchUpdates(_0x1af39c){return function(_0xc63307){try{jsonpatch[_0x5c3b('0x22')](_0xc63307,_0x1af39c,!![]);}catch(_0x4ec8c1){return BPromise['reject'](_0x4ec8c1);}return _0xc63307[_0x5c3b('0x23')]();};}function saveUpdates(_0x143022,_0x5942f1){return function(_0x439d8e){if(_0x439d8e){return _0x439d8e['update'](_0x143022)[_0x5c3b('0x24')](function(_0xb8006){return _0xb8006;});}return null;};}function removeEntity(_0x2bb9dc,_0xe9261d){return function(_0x529c39){if(_0x529c39){return _0x529c39[_0x5c3b('0x25')]()[_0x5c3b('0x24')](function(){_0x2bb9dc['status'](0xcc)[_0x5c3b('0x1a')]();});}};}function handleEntityNotFound(_0x2c8682,_0x3a8141){return function(_0x3c3991){if(!_0x3c3991){_0x2c8682['sendStatus'](0x194);}return _0x3c3991;};}function handleError(_0x15ae38,_0x20469d){_0x20469d=_0x20469d||0x1f4;return function(_0x2099dc){logger[_0x5c3b('0x26')](_0x2099dc[_0x5c3b('0x27')]);if(_0x2099dc[_0x5c3b('0x28')]){delete _0x2099dc['name'];}_0x15ae38['status'](_0x20469d)['send'](_0x2099dc);};}exports[_0x5c3b('0x29')]=function(_0x3e6832,_0x59b640){var _0xd93418={},_0x15044e={},_0x421d96={'count':0x0,'rows':[]};var _0x2a26df=_[_0x5c3b('0x2a')](db[_0x5c3b('0x2b')][_0x5c3b('0x2c')],function(_0x292266){return{'name':_0x292266[_0x5c3b('0x2d')],'type':_0x292266[_0x5c3b('0x2e')][_0x5c3b('0x2f')]};});_0x15044e[_0x5c3b('0x30')]=_['map'](_0x2a26df,_0x5c3b('0x28'));_0x15044e[_0x5c3b('0x31')]=_[_0x5c3b('0x32')](_0x3e6832[_0x5c3b('0x31')]);_0x15044e[_0x5c3b('0x33')]=_[_0x5c3b('0x34')](_0x15044e[_0x5c3b('0x30')],_0x15044e[_0x5c3b('0x31')]);_0xd93418[_0x5c3b('0x35')]=_[_0x5c3b('0x34')](_0x15044e[_0x5c3b('0x30')],qs[_0x5c3b('0x36')](_0x3e6832[_0x5c3b('0x31')][_0x5c3b('0x36')]));_0xd93418[_0x5c3b('0x35')]=_0xd93418[_0x5c3b('0x35')][_0x5c3b('0x37')]?_0xd93418['attributes']:_0x15044e[_0x5c3b('0x30')];if(!_0x3e6832[_0x5c3b('0x31')][_0x5c3b('0x38')](_0x5c3b('0x39'))){_0xd93418['limit']=qs[_0x5c3b('0x1e')](_0x3e6832[_0x5c3b('0x31')]['limit']);_0xd93418[_0x5c3b('0x1b')]=qs[_0x5c3b('0x1b')](_0x3e6832[_0x5c3b('0x31')][_0x5c3b('0x1b')]);}_0xd93418[_0x5c3b('0x3a')]=qs[_0x5c3b('0x3b')](_0x3e6832[_0x5c3b('0x31')][_0x5c3b('0x3b')]);_0xd93418[_0x5c3b('0x3c')]=qs['filters'](_[_0x5c3b('0x3d')](_0x3e6832[_0x5c3b('0x31')],_0x15044e['filters']),_0x2a26df);if(_0x3e6832['query'][_0x5c3b('0x3e')]){_0xd93418[_0x5c3b('0x3c')]=_[_0x5c3b('0x3f')](_0xd93418[_0x5c3b('0x3c')],{'$or':_[_0x5c3b('0x2a')](_0x2a26df,function(_0x406bf9){if(_0x406bf9[_0x5c3b('0x2e')]!=='VIRTUAL'){var _0x499335={};_0x499335[_0x406bf9[_0x5c3b('0x28')]]={'$like':'%'+_0x3e6832[_0x5c3b('0x31')][_0x5c3b('0x3e')]+'%'};return _0x499335;}})});}_0xd93418=_[_0x5c3b('0x3f')]({},_0xd93418,_0x3e6832['options']);var _0x16400b={'where':_0xd93418['where']};return db[_0x5c3b('0x2b')][_0x5c3b('0x1d')](_0x16400b)[_0x5c3b('0x24')](function(_0xea3ae1){_0x421d96[_0x5c3b('0x1d')]=_0xea3ae1;if(_0x3e6832[_0x5c3b('0x31')][_0x5c3b('0x40')]){_0xd93418[_0x5c3b('0x41')]=[{'all':!![]}];}return db[_0x5c3b('0x2b')]['findAll'](_0xd93418);})['then'](function(_0x345149){_0x421d96[_0x5c3b('0x42')]=_0x345149;return _0x421d96;})[_0x5c3b('0x24')](respondWithFilteredResult(_0x59b640,_0xd93418))[_0x5c3b('0x43')](handleError(_0x59b640,null));};exports[_0x5c3b('0x44')]=function(_0x22fd28,_0x2cec5d){var _0x1d9427={'raw':!![],'where':{'id':_0x22fd28['params']['id']}},_0x29ffdc={};_0x29ffdc[_0x5c3b('0x30')]=_[_0x5c3b('0x32')](db[_0x5c3b('0x2b')]['rawAttributes']);_0x29ffdc[_0x5c3b('0x31')]=_[_0x5c3b('0x32')](_0x22fd28[_0x5c3b('0x31')]);_0x29ffdc[_0x5c3b('0x33')]=_[_0x5c3b('0x34')](_0x29ffdc[_0x5c3b('0x30')],_0x29ffdc[_0x5c3b('0x31')]);_0x1d9427[_0x5c3b('0x35')]=_[_0x5c3b('0x34')](_0x29ffdc[_0x5c3b('0x30')],qs[_0x5c3b('0x36')](_0x22fd28['query'][_0x5c3b('0x36')]));_0x1d9427['attributes']=_0x1d9427[_0x5c3b('0x35')][_0x5c3b('0x37')]?_0x1d9427['attributes']:_0x29ffdc[_0x5c3b('0x30')];if(_0x22fd28[_0x5c3b('0x31')][_0x5c3b('0x40')]){_0x1d9427['include']=[{'all':!![]}];}_0x1d9427=_[_0x5c3b('0x3f')]({},_0x1d9427,_0x22fd28['options']);return db[_0x5c3b('0x2b')][_0x5c3b('0x45')](_0x1d9427)[_0x5c3b('0x24')](handleEntityNotFound(_0x2cec5d,null))[_0x5c3b('0x24')](respondWithResult(_0x2cec5d,null))[_0x5c3b('0x43')](handleError(_0x2cec5d,null));};exports[_0x5c3b('0x46')]=function(_0x2dd72c,_0x3d6034){return db[_0x5c3b('0x2b')][_0x5c3b('0x46')](_0x2dd72c[_0x5c3b('0x47')],{})['then'](respondWithResult(_0x3d6034,0xc9))[_0x5c3b('0x43')](handleError(_0x3d6034,null));};exports['update']=function(_0x155b22,_0x11bf0a){if(_0x155b22[_0x5c3b('0x47')]['id']){delete _0x155b22['body']['id'];}return db[_0x5c3b('0x2b')][_0x5c3b('0x45')]({'where':{'id':_0x155b22['params']['id']}})[_0x5c3b('0x24')](handleEntityNotFound(_0x11bf0a,null))[_0x5c3b('0x24')](saveUpdates(_0x155b22[_0x5c3b('0x47')],null))[_0x5c3b('0x24')](respondWithResult(_0x11bf0a,null))[_0x5c3b('0x43')](handleError(_0x11bf0a,null));};exports[_0x5c3b('0x25')]=function(_0x37870f,_0x21e430){return db[_0x5c3b('0x2b')][_0x5c3b('0x45')]({'where':{'id':_0x37870f[_0x5c3b('0x48')]['id']}})['then'](handleEntityNotFound(_0x21e430,null))['then'](removeEntity(_0x21e430,null))['catch'](handleError(_0x21e430,null));};exports[_0x5c3b('0x49')]=function(_0x203ae2,_0x5f14fa){return db[_0x5c3b('0x2b')][_0x5c3b('0x49')]()[_0x5c3b('0x24')](respondWithResult(_0x5f14fa,null))[_0x5c3b('0x43')](handleError(_0x5f14fa,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index edcc51a..3c7ca1c 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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x49fa6d,_0x53b3d9){var _0x73d281=function(_0x599cc8){while(--_0x599cc8){_0x49fa6d['push'](_0x49fa6d['shift']());}};_0x73d281(++_0x53b3d9);}(_0x7a54,0x106));var _0x47a5=function(_0x366f98,_0xf535eb){_0x366f98=_0x366f98-0x0;var _0x41487d=_0x7a54[_0x366f98];return _0x41487d;};'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':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x147ae8,_0x284102){var _0x7cc0ec=function(_0x1daf2b){while(--_0x1daf2b){_0x147ae8['push'](_0x147ae8['shift']());}};_0x7cc0ec(++_0x284102);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('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 cde9b26..66acda6 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 _0xafa1=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x4c3c4e,_0x2623b0){var _0x1f3ee6=function(_0x1737f8){while(--_0x1737f8){_0x4c3c4e['push'](_0x4c3c4e['shift']());}};_0x1f3ee6(++_0x2623b0);}(_0xafa1,0x18f));var _0x1afa=function(_0x3198fd,_0x3729d8){_0x3198fd=_0x3198fd-0x0;var _0x2dd0b=_0xafa1[_0x3198fd];return _0x2dd0b;};'use strict';var _=require(_0x1afa('0x0'));var util=require(_0x1afa('0x1'));var moment=require('moment');var BPromise=require(_0x1afa('0x2'));var rs=require(_0x1afa('0x3'));var fs=require('fs');var Redis=require(_0x1afa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1afa('0x5'));var logger=require(_0x1afa('0x6'))('rpc');var config=require(_0x1afa('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1afa('0x8')][_0x1afa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3b0733,_0x48c586,_0x565090){return new BPromise(function(_0x5ac762,_0x3aaa00){return client[_0x1afa('0xa')](_0x3b0733,_0x565090)['then'](function(_0x1996f6){logger[_0x1afa('0xb')](_0x1afa('0xc'),_0x48c586,_0x1afa('0xd'));logger['debug']('Cdr,\x20%s,\x20%s,\x20%s',_0x48c586,_0x1afa('0xd'),JSON[_0x1afa('0xe')](_0x1996f6));if(_0x1996f6['error']){if(_0x1996f6[_0x1afa('0xf')][_0x1afa('0x10')]===0x1f4){logger['error'](_0x1afa('0xc'),_0x48c586,_0x1996f6['error'][_0x1afa('0x11')]);return _0x3aaa00(_0x1996f6[_0x1afa('0xf')][_0x1afa('0x11')]);}logger[_0x1afa('0xf')](_0x1afa('0xc'),_0x48c586,_0x1996f6[_0x1afa('0xf')][_0x1afa('0x11')]);return _0x5ac762(_0x1996f6[_0x1afa('0xf')]['message']);}else{logger[_0x1afa('0xb')](_0x1afa('0xc'),_0x48c586,_0x1afa('0xd'));_0x5ac762(_0x1996f6[_0x1afa('0x12')]['message']);}})[_0x1afa('0x13')](function(_0x207c82){logger[_0x1afa('0xf')](_0x1afa('0xc'),_0x48c586,_0x207c82);_0x3aaa00(_0x207c82);});});} \ No newline at end of file +var _0xb523=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x581960,_0x1232ff){var _0x4ee892=function(_0x2a920d){while(--_0x2a920d){_0x581960['push'](_0x581960['shift']());}};_0x4ee892(++_0x1232ff);}(_0xb523,0x139));var _0x3b52=function(_0x449f76,_0x1c6ebc){_0x449f76=_0x449f76-0x0;var _0x417aa7=_0xb523[_0x449f76];return _0x417aa7;};'use strict';var _=require(_0x3b52('0x0'));var util=require(_0x3b52('0x1'));var moment=require(_0x3b52('0x2'));var BPromise=require(_0x3b52('0x3'));var rs=require(_0x3b52('0x4'));var fs=require('fs');var Redis=require(_0x3b52('0x5'));var db=require(_0x3b52('0x6'))['db'];var utils=require(_0x3b52('0x7'));var logger=require(_0x3b52('0x8'))(_0x3b52('0x9'));var config=require(_0x3b52('0xa'));var jayson=require(_0x3b52('0xb'));var client=jayson['client'][_0x3b52('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x161711,_0x41258a,_0xbebdb9){return new BPromise(function(_0x544bef,_0x5f43c7){return client[_0x3b52('0xd')](_0x161711,_0xbebdb9)[_0x3b52('0xe')](function(_0x30b849){logger[_0x3b52('0xf')](_0x3b52('0x10'),_0x41258a,_0x3b52('0x11'));logger[_0x3b52('0x12')]('Cdr,\x20%s,\x20%s,\x20%s',_0x41258a,_0x3b52('0x11'),JSON[_0x3b52('0x13')](_0x30b849));if(_0x30b849[_0x3b52('0x14')]){if(_0x30b849['error'][_0x3b52('0x15')]===0x1f4){logger[_0x3b52('0x14')](_0x3b52('0x10'),_0x41258a,_0x30b849['error']['message']);return _0x5f43c7(_0x30b849['error'][_0x3b52('0x16')]);}logger[_0x3b52('0x14')](_0x3b52('0x10'),_0x41258a,_0x30b849[_0x3b52('0x14')][_0x3b52('0x16')]);return _0x544bef(_0x30b849[_0x3b52('0x14')]['message']);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x41258a,_0x3b52('0x11'));_0x544bef(_0x30b849['result']['message']);}})[_0x3b52('0x17')](function(_0x5ee682){logger[_0x3b52('0x14')](_0x3b52('0x10'),_0x41258a,_0x5ee682);_0x5f43c7(_0x5ee682);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 3b94a34..d13e3f0 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x2afbb0,_0x44f16d){var _0x411ff2=function(_0x5edd7e){while(--_0x5edd7e){_0x2afbb0['push'](_0x2afbb0['shift']());}};_0x411ff2(++_0x44f16d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b828b,_0x344400){_0x1b828b=_0x1b828b-0x0;var _0x98da1a=_0xa9e0[_0x1b828b];return _0x98da1a;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x4cbdb7,_0x1b82f6){var _0x4ecb18=function(_0x48271f){while(--_0x48271f){_0x4cbdb7['push'](_0x4cbdb7['shift']());}};_0x4ecb18(++_0x1b82f6);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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 fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index da6699e..952df99 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 _0xbf29=['STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x550b7b,_0x3d6314){var _0x451b9f=function(_0x156429){while(--_0x156429){_0x550b7b['push'](_0x550b7b['shift']());}};_0x451b9f(++_0x3d6314);}(_0xbf29,0x151));var _0x9bf2=function(_0x4e592d,_0x4aa9e9){_0x4e592d=_0x4e592d-0x0;var _0x3be22f=_0xbf29[_0x4e592d];return _0x3be22f;};'use strict';var Sequelize=require(_0x9bf2('0x0'));module[_0x9bf2('0x1')]={'priority':{'type':Sequelize[_0x9bf2('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9bf2('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9bf2('0x4')}}; \ No newline at end of file +var _0xaf34=['STRING','*,*,*,*','exports','INTEGER'];(function(_0x4ff7d2,_0x25629b){var _0x6df362=function(_0x497b1b){while(--_0x497b1b){_0x4ff7d2['push'](_0x4ff7d2['shift']());}};_0x6df362(++_0x25629b);}(_0xaf34,0x1de));var _0x4af3=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xaf34[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require('sequelize');module[_0x4af3('0x0')]={'priority':{'type':Sequelize[_0x4af3('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x4af3('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4af3('0x2')]},'interval':{'type':Sequelize[_0x4af3('0x2')],'defaultValue':_0x4af3('0x3')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 1725fc0..737ce6b 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 _0x8482=['length','find','catch','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','show','params','ChatApplication','rawAttributes','query','keys','filters','intersection','model','attributes','fields'];(function(_0x2467ba,_0x1ffac7){var _0x91162f=function(_0x2fa166){while(--_0x2fa166){_0x2467ba['push'](_0x2467ba['shift']());}};_0x91162f(++_0x1ffac7);}(_0x8482,0x14e));var _0x2848=function(_0x1a38e9,_0x174ad0){_0x1a38e9=_0x1a38e9-0x0;var _0x586a53=_0x8482[_0x1a38e9];return _0x586a53;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2848('0x0'));var zipdir=require(_0x2848('0x1'));var jsonpatch=require(_0x2848('0x2'));var rp=require(_0x2848('0x3'));var moment=require(_0x2848('0x4'));var BPromise=require(_0x2848('0x5'));var Mustache=require(_0x2848('0x6'));var util=require(_0x2848('0x7'));var path=require(_0x2848('0x8'));var sox=require(_0x2848('0x9'));var csv=require('to-csv');var ejs=require(_0x2848('0xa'));var fs=require('fs');var fs_extra=require(_0x2848('0xb'));var _=require('lodash');var squel=require(_0x2848('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2848('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2848('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2848('0xf'));var as=require(_0x2848('0x10'));var hardwareService=require(_0x2848('0x11'));var logger=require(_0x2848('0x12'))(_0x2848('0x13'));var utils=require(_0x2848('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2848('0x15'))['db'];function respondWithStatusCode(_0x465380,_0xf0658d){_0xf0658d=_0xf0658d||0xcc;return function(_0x566a0b){if(_0x566a0b){return _0x465380[_0x2848('0x16')](_0xf0658d);}return _0x465380[_0x2848('0x17')](_0xf0658d)[_0x2848('0x18')]();};}function respondWithResult(_0x5e64c7,_0xbddd26){_0xbddd26=_0xbddd26||0xc8;return function(_0x501a0e){if(_0x501a0e){return _0x5e64c7[_0x2848('0x17')](_0xbddd26)['json'](_0x501a0e);}};}function respondWithFilteredResult(_0x1002d2,_0xeba65b){return function(_0x6600c5){if(_0x6600c5){var _0x59f39a=typeof _0xeba65b['offset']==='undefined'&&typeof _0xeba65b['limit']===_0x2848('0x19');var _0x1acd41=_0x6600c5[_0x2848('0x1a')];var _0x46755c=_0x59f39a?0x0:_0xeba65b[_0x2848('0x1b')];var _0x3b4eeb=_0x59f39a?_0x6600c5[_0x2848('0x1a')]:_0xeba65b[_0x2848('0x1b')]+_0xeba65b[_0x2848('0x1c')];var _0x193ffa;if(_0x3b4eeb>=_0x1acd41){_0x3b4eeb=_0x1acd41;_0x193ffa=0xc8;}else{_0x193ffa=0xce;}_0x1002d2[_0x2848('0x17')](_0x193ffa);return _0x1002d2['set'](_0x2848('0x1d'),_0x46755c+'-'+_0x3b4eeb+'/'+_0x1acd41)[_0x2848('0x1e')](_0x6600c5);}return null;};}function patchUpdates(_0x1a1f79){return function(_0x5748ae){try{jsonpatch[_0x2848('0x1f')](_0x5748ae,_0x1a1f79,!![]);}catch(_0x1f67a7){return BPromise[_0x2848('0x20')](_0x1f67a7);}return _0x5748ae[_0x2848('0x21')]();};}function saveUpdates(_0x3b99a2,_0x555279){return function(_0x3dd7db){if(_0x3dd7db){return _0x3dd7db[_0x2848('0x22')](_0x3b99a2)[_0x2848('0x23')](function(_0x436709){return _0x436709;});}return null;};}function removeEntity(_0xea4128,_0x40f510){return function(_0x5f38e2){if(_0x5f38e2){return _0x5f38e2[_0x2848('0x24')]()['then'](function(){_0xea4128[_0x2848('0x17')](0xcc)[_0x2848('0x18')]();});}};}function handleEntityNotFound(_0x2d936a,_0x4517d3){return function(_0x51c924){if(!_0x51c924){_0x2d936a[_0x2848('0x16')](0x194);}return _0x51c924;};}function handleError(_0xecd4f4,_0xdba069){_0xdba069=_0xdba069||0x1f4;return function(_0x2dc32e){logger[_0x2848('0x25')](_0x2dc32e[_0x2848('0x26')]);if(_0x2dc32e[_0x2848('0x27')]){delete _0x2dc32e['name'];}_0xecd4f4['status'](_0xdba069)['send'](_0x2dc32e);};}exports[_0x2848('0x28')]=function(_0x18df37,_0x3b9c0d){var _0x3f915b={'raw':!![],'where':{'id':_0x18df37[_0x2848('0x29')]['id']}},_0x189701={};_0x189701['model']=_['keys'](db[_0x2848('0x2a')][_0x2848('0x2b')]);_0x189701[_0x2848('0x2c')]=_[_0x2848('0x2d')](_0x18df37[_0x2848('0x2c')]);_0x189701[_0x2848('0x2e')]=_[_0x2848('0x2f')](_0x189701[_0x2848('0x30')],_0x189701[_0x2848('0x2c')]);_0x3f915b[_0x2848('0x31')]=_[_0x2848('0x2f')](_0x189701['model'],qs[_0x2848('0x32')](_0x18df37[_0x2848('0x2c')][_0x2848('0x32')]));_0x3f915b[_0x2848('0x31')]=_0x3f915b['attributes'][_0x2848('0x33')]?_0x3f915b[_0x2848('0x31')]:_0x189701[_0x2848('0x30')];if(_0x18df37[_0x2848('0x2c')]['includeAll']){_0x3f915b['include']=[{'all':!![]}];}_0x3f915b=_['merge']({},_0x3f915b,_0x18df37['options']);return db[_0x2848('0x2a')][_0x2848('0x34')](_0x3f915b)['then'](handleEntityNotFound(_0x3b9c0d,null))['then'](respondWithResult(_0x3b9c0d,null))[_0x2848('0x35')](handleError(_0x3b9c0d,null));};exports[_0x2848('0x22')]=function(_0x31a27d,_0x274b5a){if(_0x31a27d[_0x2848('0x36')]['id']){delete _0x31a27d['body']['id'];}return db[_0x2848('0x2a')][_0x2848('0x34')]({'where':{'id':_0x31a27d[_0x2848('0x29')]['id']}})['then'](handleEntityNotFound(_0x274b5a,null))[_0x2848('0x23')](saveUpdates(_0x31a27d[_0x2848('0x36')],null))[_0x2848('0x23')](respondWithResult(_0x274b5a,null))[_0x2848('0x35')](handleError(_0x274b5a,null));};exports[_0x2848('0x24')]=function(_0x510a53,_0x5578fe){return db[_0x2848('0x2a')][_0x2848('0x34')]({'where':{'id':_0x510a53[_0x2848('0x29')]['id']}})[_0x2848('0x23')](handleEntityNotFound(_0x5578fe,null))[_0x2848('0x23')](removeEntity(_0x5578fe,null))[_0x2848('0x35')](handleError(_0x5578fe,null));}; \ No newline at end of file +var _0x9234=['query','intersection','attributes','fields','includeAll','include','merge','catch','update','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','error','stack','name','send','show','params','model','keys','ChatApplication','rawAttributes'];(function(_0x4c8b00,_0x16c38a){var _0x406a86=function(_0x93805a){while(--_0x93805a){_0x4c8b00['push'](_0x4c8b00['shift']());}};_0x406a86(++_0x16c38a);}(_0x9234,0x1bd));var _0x4923=function(_0x32d414,_0x4d23da){_0x32d414=_0x32d414-0x0;var _0x4e0bca=_0x9234[_0x32d414];return _0x4e0bca;};'use strict';var emlformat=require(_0x4923('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4923('0x1'));var jsonpatch=require(_0x4923('0x2'));var rp=require(_0x4923('0x3'));var moment=require(_0x4923('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4923('0x5'));var util=require(_0x4923('0x6'));var path=require('path');var sox=require(_0x4923('0x7'));var csv=require(_0x4923('0x8'));var ejs=require(_0x4923('0x9'));var fs=require('fs');var fs_extra=require(_0x4923('0xa'));var _=require(_0x4923('0xb'));var squel=require(_0x4923('0xc'));var crypto=require(_0x4923('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x4923('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4923('0xf'));var Papa=require(_0x4923('0x10'));var Redis=require(_0x4923('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4923('0x12'));var as=require(_0x4923('0x13'));var hardwareService=require(_0x4923('0x14'));var logger=require(_0x4923('0x15'))(_0x4923('0x16'));var utils=require(_0x4923('0x17'));var config=require(_0x4923('0x18'));var licenseUtil=require(_0x4923('0x19'));var db=require(_0x4923('0x1a'))['db'];function respondWithStatusCode(_0x1e04b7,_0x5b950f){_0x5b950f=_0x5b950f||0xcc;return function(_0x4d6fda){if(_0x4d6fda){return _0x1e04b7[_0x4923('0x1b')](_0x5b950f);}return _0x1e04b7[_0x4923('0x1c')](_0x5b950f)[_0x4923('0x1d')]();};}function respondWithResult(_0x4c9289,_0x31a469){_0x31a469=_0x31a469||0xc8;return function(_0x27a52b){if(_0x27a52b){return _0x4c9289[_0x4923('0x1c')](_0x31a469)[_0x4923('0x1e')](_0x27a52b);}};}function respondWithFilteredResult(_0x27dbb2,_0x29a354){return function(_0x1f8375){if(_0x1f8375){var _0x2897da=typeof _0x29a354[_0x4923('0x1f')]===_0x4923('0x20')&&typeof _0x29a354['limit']===_0x4923('0x20');var _0x260e53=_0x1f8375[_0x4923('0x21')];var _0x1be04d=_0x2897da?0x0:_0x29a354['offset'];var _0x50fd18=_0x2897da?_0x1f8375[_0x4923('0x21')]:_0x29a354['offset']+_0x29a354[_0x4923('0x22')];var _0x1ab861;if(_0x50fd18>=_0x260e53){_0x50fd18=_0x260e53;_0x1ab861=0xc8;}else{_0x1ab861=0xce;}_0x27dbb2['status'](_0x1ab861);return _0x27dbb2[_0x4923('0x23')](_0x4923('0x24'),_0x1be04d+'-'+_0x50fd18+'/'+_0x260e53)[_0x4923('0x1e')](_0x1f8375);}return null;};}function patchUpdates(_0x8a9ab7){return function(_0x528b6b){try{jsonpatch[_0x4923('0x25')](_0x528b6b,_0x8a9ab7,!![]);}catch(_0x39039f){return BPromise['reject'](_0x39039f);}return _0x528b6b[_0x4923('0x26')]();};}function saveUpdates(_0x522753,_0x3de8f5){return function(_0x168bb4){if(_0x168bb4){return _0x168bb4['update'](_0x522753)[_0x4923('0x27')](function(_0xb1b3d3){return _0xb1b3d3;});}return null;};}function removeEntity(_0x2eb1b7,_0x161cf9){return function(_0x3aaede){if(_0x3aaede){return _0x3aaede[_0x4923('0x28')]()[_0x4923('0x27')](function(){_0x2eb1b7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x23ec97,_0x36cc38){return function(_0xdb893b){if(!_0xdb893b){_0x23ec97[_0x4923('0x1b')](0x194);}return _0xdb893b;};}function handleError(_0x2ea650,_0x4473a3){_0x4473a3=_0x4473a3||0x1f4;return function(_0x13681b){logger[_0x4923('0x29')](_0x13681b[_0x4923('0x2a')]);if(_0x13681b[_0x4923('0x2b')]){delete _0x13681b[_0x4923('0x2b')];}_0x2ea650['status'](_0x4473a3)[_0x4923('0x2c')](_0x13681b);};}exports[_0x4923('0x2d')]=function(_0x7944b2,_0x39decd){var _0x21c229={'raw':!![],'where':{'id':_0x7944b2[_0x4923('0x2e')]['id']}},_0x47158c={};_0x47158c[_0x4923('0x2f')]=_[_0x4923('0x30')](db[_0x4923('0x31')][_0x4923('0x32')]);_0x47158c[_0x4923('0x33')]=_[_0x4923('0x30')](_0x7944b2[_0x4923('0x33')]);_0x47158c['filters']=_[_0x4923('0x34')](_0x47158c[_0x4923('0x2f')],_0x47158c[_0x4923('0x33')]);_0x21c229[_0x4923('0x35')]=_[_0x4923('0x34')](_0x47158c[_0x4923('0x2f')],qs[_0x4923('0x36')](_0x7944b2[_0x4923('0x33')]['fields']));_0x21c229['attributes']=_0x21c229[_0x4923('0x35')]['length']?_0x21c229['attributes']:_0x47158c['model'];if(_0x7944b2[_0x4923('0x33')][_0x4923('0x37')]){_0x21c229[_0x4923('0x38')]=[{'all':!![]}];}_0x21c229=_[_0x4923('0x39')]({},_0x21c229,_0x7944b2['options']);return db[_0x4923('0x31')]['find'](_0x21c229)[_0x4923('0x27')](handleEntityNotFound(_0x39decd,null))[_0x4923('0x27')](respondWithResult(_0x39decd,null))[_0x4923('0x3a')](handleError(_0x39decd,null));};exports[_0x4923('0x3b')]=function(_0x542fc,_0x56259c){if(_0x542fc[_0x4923('0x3c')]['id']){delete _0x542fc['body']['id'];}return db['ChatApplication'][_0x4923('0x3d')]({'where':{'id':_0x542fc[_0x4923('0x2e')]['id']}})[_0x4923('0x27')](handleEntityNotFound(_0x56259c,null))[_0x4923('0x27')](saveUpdates(_0x542fc[_0x4923('0x3c')],null))[_0x4923('0x27')](respondWithResult(_0x56259c,null))[_0x4923('0x3a')](handleError(_0x56259c,null));};exports['destroy']=function(_0x1f41b6,_0x547682){return db['ChatApplication'][_0x4923('0x3d')]({'where':{'id':_0x1f41b6[_0x4923('0x2e')]['id']}})['then'](handleEntityNotFound(_0x547682,null))[_0x4923('0x27')](removeEntity(_0x547682,null))[_0x4923('0x3a')](handleError(_0x547682,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index ed9d6a3..f6cd6dc 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 _0xa664=['exports','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path','../../config/environment','./chatApplication.attributes'];(function(_0x335c9e,_0xf265bd){var _0x318ba5=function(_0x2e5e43){while(--_0x2e5e43){_0x335c9e['push'](_0x335c9e['shift']());}};_0x318ba5(++_0xf265bd);}(_0xa664,0x1f0));var _0x4a66=function(_0x1eb2e4,_0x1ecaf3){_0x1eb2e4=_0x1eb2e4-0x0;var _0x166287=_0xa664[_0x1eb2e4];return _0x166287;};'use strict';var _=require(_0x4a66('0x0'));var util=require(_0x4a66('0x1'));var logger=require('../../config/logger')(_0x4a66('0x2'));var moment=require(_0x4a66('0x3'));var BPromise=require(_0x4a66('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4a66('0x5'));var rimraf=require('rimraf');var config=require(_0x4a66('0x6'));var attributes=require(_0x4a66('0x7'));module[_0x4a66('0x8')]=function(_0x5560d4,_0x21b4e8){return _0x5560d4['define'](_0x4a66('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4a66('0xa'),'collate':_0x4a66('0xb')});}; \ No newline at end of file +var _0x28e6=['utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','define','ChatApplication','chat_applications','utf8mb4'];(function(_0x252fbf,_0x59126d){var _0x102b85=function(_0x536e59){while(--_0x536e59){_0x252fbf['push'](_0x252fbf['shift']());}};_0x102b85(++_0x59126d);}(_0x28e6,0x181));var _0x628e=function(_0x4a2130,_0x3e5628){_0x4a2130=_0x4a2130-0x0;var _0x3b5d53=_0x28e6[_0x4a2130];return _0x3b5d53;};'use strict';var _=require('lodash');var util=require(_0x628e('0x0'));var logger=require(_0x628e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x628e('0x2'));var rp=require(_0x628e('0x3'));var fs=require('fs');var path=require(_0x628e('0x4'));var rimraf=require(_0x628e('0x5'));var config=require(_0x628e('0x6'));var attributes=require('./chatApplication.attributes');module['exports']=function(_0x20c439,_0x3d0064){return _0x20c439[_0x628e('0x7')](_0x628e('0x8'),attributes,{'tableName':_0x628e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x628e('0xa'),'collate':_0x628e('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 3758daa..e6b28a6 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 _0x9403=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x55587d,_0x2e13b7){var _0x440f69=function(_0x23abbd){while(--_0x23abbd){_0x55587d['push'](_0x55587d['shift']());}};_0x440f69(++_0x2e13b7);}(_0x9403,0x75));var _0x3940=function(_0x5b4fc0,_0xc317ea){_0x5b4fc0=_0x5b4fc0-0x0;var _0x15e56a=_0x9403[_0x5b4fc0];return _0x15e56a;};'use strict';var _=require(_0x3940('0x0'));var util=require(_0x3940('0x1'));var moment=require(_0x3940('0x2'));var BPromise=require(_0x3940('0x3'));var rs=require(_0x3940('0x4'));var fs=require('fs');var Redis=require(_0x3940('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3940('0x6'));var logger=require('../../config/logger')(_0x3940('0x7'));var config=require(_0x3940('0x8'));var jayson=require(_0x3940('0x9'));var client=jayson[_0x3940('0xa')][_0x3940('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22f5de,_0x3ee2bf,_0xa98d46){return new BPromise(function(_0x5c28f9,_0x2b2e28){return client[_0x3940('0xc')](_0x22f5de,_0xa98d46)[_0x3940('0xd')](function(_0x60b29f){logger[_0x3940('0xe')]('ChatApplication,\x20%s,\x20%s',_0x3ee2bf,_0x3940('0xf'));logger[_0x3940('0x10')](_0x3940('0x11'),_0x3ee2bf,_0x3940('0xf'),JSON[_0x3940('0x12')](_0x60b29f));if(_0x60b29f[_0x3940('0x13')]){if(_0x60b29f[_0x3940('0x13')][_0x3940('0x14')]===0x1f4){logger[_0x3940('0x13')](_0x3940('0x15'),_0x3ee2bf,_0x60b29f['error'][_0x3940('0x16')]);return _0x2b2e28(_0x60b29f[_0x3940('0x13')][_0x3940('0x16')]);}logger[_0x3940('0x13')](_0x3940('0x15'),_0x3ee2bf,_0x60b29f[_0x3940('0x13')][_0x3940('0x16')]);return _0x5c28f9(_0x60b29f['error'][_0x3940('0x16')]);}else{logger[_0x3940('0xe')]('ChatApplication,\x20%s,\x20%s',_0x3ee2bf,_0x3940('0xf'));_0x5c28f9(_0x60b29f[_0x3940('0x17')]['message']);}})[_0x3940('0x18')](function(_0x26a7b1){logger[_0x3940('0x13')](_0x3940('0x15'),_0x3ee2bf,_0x26a7b1);_0x2b2e28(_0x26a7b1);});});} \ No newline at end of file +var _0x81f8=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ChatApplication,\x20%s,\x20%s','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result'];(function(_0x5d5f6e,_0x3cacab){var _0xe1fe8d=function(_0x76427){while(--_0x76427){_0x5d5f6e['push'](_0x5d5f6e['shift']());}};_0xe1fe8d(++_0x3cacab);}(_0x81f8,0xd2));var _0x881f=function(_0x499729,_0x195f21){_0x499729=_0x499729-0x0;var _0x5342d4=_0x81f8[_0x499729];return _0x5342d4;};'use strict';var _=require(_0x881f('0x0'));var util=require(_0x881f('0x1'));var moment=require('moment');var BPromise=require(_0x881f('0x2'));var rs=require(_0x881f('0x3'));var fs=require('fs');var Redis=require(_0x881f('0x4'));var db=require(_0x881f('0x5'))['db'];var utils=require(_0x881f('0x6'));var logger=require(_0x881f('0x7'))(_0x881f('0x8'));var config=require(_0x881f('0x9'));var jayson=require(_0x881f('0xa'));var client=jayson['client'][_0x881f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x42b4ae,_0x3e77f0,_0x2c4f3a){return new BPromise(function(_0x1b7bf6,_0x3e8cbe){return client[_0x881f('0xc')](_0x42b4ae,_0x2c4f3a)[_0x881f('0xd')](function(_0x4c16ef){logger['info'](_0x881f('0xe'),_0x3e77f0,'request\x20sent');logger['debug'](_0x881f('0xf'),_0x3e77f0,'request\x20sent',JSON['stringify'](_0x4c16ef));if(_0x4c16ef[_0x881f('0x10')]){if(_0x4c16ef[_0x881f('0x10')][_0x881f('0x11')]===0x1f4){logger['error']('ChatApplication,\x20%s,\x20%s',_0x3e77f0,_0x4c16ef[_0x881f('0x10')][_0x881f('0x12')]);return _0x3e8cbe(_0x4c16ef[_0x881f('0x10')][_0x881f('0x12')]);}logger['error'](_0x881f('0xe'),_0x3e77f0,_0x4c16ef['error'][_0x881f('0x12')]);return _0x1b7bf6(_0x4c16ef['error'][_0x881f('0x12')]);}else{logger['info']('ChatApplication,\x20%s,\x20%s',_0x3e77f0,_0x881f('0x13'));_0x1b7bf6(_0x4c16ef[_0x881f('0x14')][_0x881f('0x12')]);}})['catch'](function(_0x2907f3){logger[_0x881f('0x10')](_0x881f('0xe'),_0x3e77f0,_0x2907f3);_0x3e8cbe(_0x2907f3);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 79225dc..0e496cd 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 _0x9585=['isAuthenticated','destroy','exports','multer','path','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','show','put','update'];(function(_0x8a654b,_0x4be2f9){var _0x94bfbb=function(_0x29efa4){while(--_0x29efa4){_0x8a654b['push'](_0x8a654b['shift']());}};_0x94bfbb(++_0x4be2f9);}(_0x9585,0x16f));var _0x5958=function(_0x151345,_0x3b8555){_0x151345=_0x151345-0x0;var _0x31c549=_0x9585[_0x151345];return _0x31c549;};'use strict';var multer=require(_0x5958('0x0'));var util=require('util');var path=require(_0x5958('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5958('0x2'));var config=require(_0x5958('0x3'));var controller=require(_0x5958('0x4'));router[_0x5958('0x5')](_0x5958('0x6'),auth['isAuthenticated'](),controller[_0x5958('0x7')]);router[_0x5958('0x8')](_0x5958('0x6'),auth['isAuthenticated'](),controller[_0x5958('0x9')]);router['delete']('/:id',auth[_0x5958('0xa')](),controller[_0x5958('0xb')]);module[_0x5958('0xc')]=router; \ No newline at end of file +var _0xc669=['exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','/:id','update','delete','destroy'];(function(_0x467c35,_0x36cf32){var _0x4b5547=function(_0x546798){while(--_0x546798){_0x467c35['push'](_0x467c35['shift']());}};_0x4b5547(++_0x36cf32);}(_0xc669,0x144));var _0x9c66=function(_0x5acafb,_0x289611){_0x5acafb=_0x5acafb-0x0;var _0x11fb89=_0xc669[_0x5acafb];return _0x11fb89;};'use strict';var multer=require(_0x9c66('0x0'));var util=require(_0x9c66('0x1'));var path=require(_0x9c66('0x2'));var timeout=require('connect-timeout');var express=require(_0x9c66('0x3'));var router=express[_0x9c66('0x4')]();var fs_extra=require(_0x9c66('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9c66('0x6'));var config=require(_0x9c66('0x7'));var controller=require(_0x9c66('0x8'));router[_0x9c66('0x9')]('/:id',auth[_0x9c66('0xa')](),controller[_0x9c66('0xb')]);router['put'](_0x9c66('0xc'),auth[_0x9c66('0xa')](),controller[_0x9c66('0xd')]);router[_0x9c66('0xe')](_0x9c66('0xc'),auth[_0x9c66('0xa')](),controller[_0x9c66('0xf')]);module[_0x9c66('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 48fb9f9..d64e127 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 _0x605b=['STRING','sequelize','exports'];(function(_0x49392e,_0x441b28){var _0xe978bb=function(_0x4404d1){while(--_0x4404d1){_0x49392e['push'](_0x49392e['shift']());}};_0xe978bb(++_0x441b28);}(_0x605b,0xf4));var _0xb605=function(_0x38f3da,_0x43d895){_0x38f3da=_0x38f3da-0x0;var _0x18a10e=_0x605b[_0x38f3da];return _0x18a10e;};'use strict';var Sequelize=require(_0xb605('0x0'));module[_0xb605('0x1')]={'name':{'type':Sequelize[_0xb605('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb605('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x9e2e=['STRING','BOOLEAN','sequelize','exports'];(function(_0x100815,_0x4279a7){var _0x14d54d=function(_0x38ced6){while(--_0x38ced6){_0x100815['push'](_0x100815['shift']());}};_0x14d54d(++_0x4279a7);}(_0x9e2e,0xd6));var _0xe9e2=function(_0x5effcf,_0x47af59){_0x5effcf=_0x5effcf-0x0;var _0x4d123c=_0x9e2e[_0x5effcf];return _0x4d123c;};'use strict';var Sequelize=require(_0xe9e2('0x0'));module[_0xe9e2('0x1')]={'name':{'type':Sequelize[_0xe9e2('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xe9e2('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 7690bd2..90824ca 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 _0xab0e=['rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','body','describe','ChatInternalMessage','count','user','addMembers','findOne','User','getMembers','hasOwnProperty','removeMembers','ids','addMessage','ChatGroupId','getMessages','pick','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','undefined','limit','offset','set','Content-Range','json','apply','save','update','then','destroy','stack','name','send','index','map','ChatGroup'];(function(_0x3d6785,_0x492ea3){var _0x39a624=function(_0x27d7db){while(--_0x27d7db){_0x3d6785['push'](_0x3d6785['shift']());}};_0x39a624(++_0x492ea3);}(_0xab0e,0x93));var _0xeab0=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xab0e[_0xa148b7];return _0x51efd3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xeab0('0x0'));var zipdir=require(_0xeab0('0x1'));var jsonpatch=require(_0xeab0('0x2'));var rp=require(_0xeab0('0x3'));var moment=require(_0xeab0('0x4'));var BPromise=require(_0xeab0('0x5'));var Mustache=require(_0xeab0('0x6'));var util=require(_0xeab0('0x7'));var path=require(_0xeab0('0x8'));var sox=require(_0xeab0('0x9'));var csv=require(_0xeab0('0xa'));var ejs=require(_0xeab0('0xb'));var fs=require('fs');var fs_extra=require(_0xeab0('0xc'));var _=require(_0xeab0('0xd'));var squel=require(_0xeab0('0xe'));var crypto=require(_0xeab0('0xf'));var jsforce=require(_0xeab0('0x10'));var deskjs=require(_0xeab0('0x11'));var toCsv=require('to-csv');var querystring=require(_0xeab0('0x12'));var Papa=require(_0xeab0('0x13'));var Redis=require('ioredis');var authService=require(_0xeab0('0x14'));var qs=require(_0xeab0('0x15'));var as=require(_0xeab0('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeab0('0x17'))('api');var utils=require(_0xeab0('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xeab0('0x19'))['db'];config['redis']=_[_0xeab0('0x1a')](config[_0xeab0('0x1b')],{'host':_0xeab0('0x1c'),'port':0x18eb});var socket=require(_0xeab0('0x1d'))(new Redis(config['redis']));require('./chatGroup.socket')[_0xeab0('0x1e')](socket);function respondWithStatusCode(_0x4922a4,_0x22d16f){_0x22d16f=_0x22d16f||0xcc;return function(_0x174b00){if(_0x174b00){return _0x4922a4[_0xeab0('0x1f')](_0x22d16f);}return _0x4922a4[_0xeab0('0x20')](_0x22d16f)[_0xeab0('0x21')]();};}function respondWithResult(_0x2597b4,_0x4b94dd){_0x4b94dd=_0x4b94dd||0xc8;return function(_0x3f605e){if(_0x3f605e){return _0x2597b4[_0xeab0('0x20')](_0x4b94dd)['json'](_0x3f605e);}};}function respondWithFilteredResult(_0x617c3e,_0x5cbe81){return function(_0x593514){if(_0x593514){var _0x324fb3=typeof _0x5cbe81['offset']===_0xeab0('0x22')&&typeof _0x5cbe81[_0xeab0('0x23')]===_0xeab0('0x22');var _0x46f1fb=_0x593514['count'];var _0xcb19ea=_0x324fb3?0x0:_0x5cbe81[_0xeab0('0x24')];var _0xc79951=_0x324fb3?_0x593514['count']:_0x5cbe81['offset']+_0x5cbe81['limit'];var _0x33e17c;if(_0xc79951>=_0x46f1fb){_0xc79951=_0x46f1fb;_0x33e17c=0xc8;}else{_0x33e17c=0xce;}_0x617c3e['status'](_0x33e17c);return _0x617c3e[_0xeab0('0x25')](_0xeab0('0x26'),_0xcb19ea+'-'+_0xc79951+'/'+_0x46f1fb)[_0xeab0('0x27')](_0x593514);}return null;};}function patchUpdates(_0x80b8a0){return function(_0x324e29){try{jsonpatch[_0xeab0('0x28')](_0x324e29,_0x80b8a0,!![]);}catch(_0x393f3d){return BPromise['reject'](_0x393f3d);}return _0x324e29[_0xeab0('0x29')]();};}function saveUpdates(_0x5d6a7c,_0x32f385){return function(_0x3a198a){if(_0x3a198a){return _0x3a198a[_0xeab0('0x2a')](_0x5d6a7c)[_0xeab0('0x2b')](function(_0x311d4a){return _0x311d4a;});}return null;};}function removeEntity(_0x1d1f50,_0x4f173e){return function(_0x8ef84a){if(_0x8ef84a){return _0x8ef84a[_0xeab0('0x2c')]()[_0xeab0('0x2b')](function(){_0x1d1f50['status'](0xcc)[_0xeab0('0x21')]();});}};}function handleEntityNotFound(_0x1b5822,_0x355dfe){return function(_0xb7a7c4){if(!_0xb7a7c4){_0x1b5822[_0xeab0('0x1f')](0x194);}return _0xb7a7c4;};}function handleError(_0x4b3e82,_0x2627e7){_0x2627e7=_0x2627e7||0x1f4;return function(_0x276651){logger['error'](_0x276651[_0xeab0('0x2d')]);if(_0x276651[_0xeab0('0x2e')]){delete _0x276651[_0xeab0('0x2e')];}_0x4b3e82[_0xeab0('0x20')](_0x2627e7)[_0xeab0('0x2f')](_0x276651);};}exports[_0xeab0('0x30')]=function(_0x433932,_0x2f07ac){var _0x25b1ae={},_0x30e6b5={},_0x1295ae={'count':0x0,'rows':[]};var _0x284c1b=_[_0xeab0('0x31')](db[_0xeab0('0x32')][_0xeab0('0x33')],function(_0x1bedfa){return{'name':_0x1bedfa[_0xeab0('0x34')],'type':_0x1bedfa[_0xeab0('0x35')]['key']};});_0x30e6b5[_0xeab0('0x36')]=_[_0xeab0('0x31')](_0x284c1b,_0xeab0('0x2e'));_0x30e6b5['query']=_['keys'](_0x433932[_0xeab0('0x37')]);_0x30e6b5[_0xeab0('0x38')]=_[_0xeab0('0x39')](_0x30e6b5[_0xeab0('0x36')],_0x30e6b5[_0xeab0('0x37')]);_0x25b1ae[_0xeab0('0x3a')]=_['intersection'](_0x30e6b5[_0xeab0('0x36')],qs[_0xeab0('0x3b')](_0x433932[_0xeab0('0x37')][_0xeab0('0x3b')]));_0x25b1ae[_0xeab0('0x3a')]=_0x25b1ae[_0xeab0('0x3a')][_0xeab0('0x3c')]?_0x25b1ae['attributes']:_0x30e6b5[_0xeab0('0x36')];if(!_0x433932[_0xeab0('0x37')]['hasOwnProperty'](_0xeab0('0x3d'))){_0x25b1ae['limit']=qs[_0xeab0('0x23')](_0x433932[_0xeab0('0x37')][_0xeab0('0x23')]);_0x25b1ae[_0xeab0('0x24')]=qs[_0xeab0('0x24')](_0x433932[_0xeab0('0x37')]['offset']);}_0x25b1ae[_0xeab0('0x3e')]=qs[_0xeab0('0x3f')](_0x433932[_0xeab0('0x37')][_0xeab0('0x3f')]);_0x25b1ae['where']=qs[_0xeab0('0x38')](_['pick'](_0x433932[_0xeab0('0x37')],_0x30e6b5[_0xeab0('0x38')]),_0x284c1b);if(_0x433932[_0xeab0('0x37')]['filter']){_0x25b1ae[_0xeab0('0x40')]=_[_0xeab0('0x41')](_0x25b1ae[_0xeab0('0x40')],{'$or':_[_0xeab0('0x31')](_0x284c1b,function(_0x2c5f73){if(_0x2c5f73[_0xeab0('0x35')]!==_0xeab0('0x42')){var _0x58b4e2={};_0x58b4e2[_0x2c5f73[_0xeab0('0x2e')]]={'$like':'%'+_0x433932[_0xeab0('0x37')][_0xeab0('0x43')]+'%'};return _0x58b4e2;}})});}_0x25b1ae=_[_0xeab0('0x41')]({},_0x25b1ae,_0x433932[_0xeab0('0x44')]);var _0x13a7b7={'where':_0x25b1ae[_0xeab0('0x40')]};return db[_0xeab0('0x32')]['count'](_0x13a7b7)[_0xeab0('0x2b')](function(_0x416057){_0x1295ae['count']=_0x416057;if(_0x433932[_0xeab0('0x37')]['includeAll']){_0x25b1ae[_0xeab0('0x45')]=[{'all':!![]}];}return db[_0xeab0('0x32')][_0xeab0('0x46')](_0x25b1ae);})[_0xeab0('0x2b')](function(_0x4e162f){_0x1295ae[_0xeab0('0x47')]=_0x4e162f;return _0x1295ae;})[_0xeab0('0x2b')](respondWithFilteredResult(_0x2f07ac,_0x25b1ae))[_0xeab0('0x48')](handleError(_0x2f07ac,null));};exports[_0xeab0('0x49')]=function(_0x2d27ed,_0x3faa6f){var _0x57862e={'raw':!![],'where':{'id':_0x2d27ed[_0xeab0('0x4a')]['id']}},_0x211c0e={};_0x211c0e['model']=_[_0xeab0('0x4b')](db['ChatGroup'][_0xeab0('0x33')]);_0x211c0e[_0xeab0('0x37')]=_[_0xeab0('0x4b')](_0x2d27ed[_0xeab0('0x37')]);_0x211c0e['filters']=_[_0xeab0('0x39')](_0x211c0e[_0xeab0('0x36')],_0x211c0e['query']);_0x57862e[_0xeab0('0x3a')]=_[_0xeab0('0x39')](_0x211c0e[_0xeab0('0x36')],qs[_0xeab0('0x3b')](_0x2d27ed['query'][_0xeab0('0x3b')]));_0x57862e[_0xeab0('0x3a')]=_0x57862e[_0xeab0('0x3a')][_0xeab0('0x3c')]?_0x57862e[_0xeab0('0x3a')]:_0x211c0e[_0xeab0('0x36')];if(_0x2d27ed[_0xeab0('0x37')][_0xeab0('0x4c')]){_0x57862e[_0xeab0('0x45')]=[{'all':!![]}];}_0x57862e=_[_0xeab0('0x41')]({},_0x57862e,_0x2d27ed[_0xeab0('0x44')]);return db[_0xeab0('0x32')][_0xeab0('0x4d')](_0x57862e)['then'](handleEntityNotFound(_0x3faa6f,null))[_0xeab0('0x2b')](respondWithResult(_0x3faa6f,null))['catch'](handleError(_0x3faa6f,null));};exports[_0xeab0('0x4e')]=function(_0x199e3e,_0x1d57d7){return db[_0xeab0('0x32')][_0xeab0('0x4e')](_0x199e3e[_0xeab0('0x4f')],{})[_0xeab0('0x2b')](respondWithResult(_0x1d57d7,0xc9))[_0xeab0('0x48')](handleError(_0x1d57d7,null));};exports['update']=function(_0x4a6998,_0x585ab7){if(_0x4a6998['body']['id']){delete _0x4a6998[_0xeab0('0x4f')]['id'];}return db[_0xeab0('0x32')][_0xeab0('0x4d')]({'where':{'id':_0x4a6998[_0xeab0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x585ab7,null))[_0xeab0('0x2b')](saveUpdates(_0x4a6998[_0xeab0('0x4f')],null))['then'](respondWithResult(_0x585ab7,null))[_0xeab0('0x48')](handleError(_0x585ab7,null));};exports[_0xeab0('0x2c')]=function(_0x4e5402,_0x5675c8){return db[_0xeab0('0x32')][_0xeab0('0x4d')]({'where':{'id':_0x4e5402['params']['id']}})[_0xeab0('0x2b')](handleEntityNotFound(_0x5675c8,null))[_0xeab0('0x2b')](removeEntity(_0x5675c8,null))['catch'](handleError(_0x5675c8,null));};exports[_0xeab0('0x50')]=function(_0x1f4fc7,_0x51958a){return db[_0xeab0('0x32')][_0xeab0('0x50')]()[_0xeab0('0x2b')](respondWithResult(_0x51958a,null))[_0xeab0('0x48')](handleError(_0x51958a,null));};exports['getUnread']=function(_0x2cb0a9,_0x54b4ab,_0x3b0b77){return db[_0xeab0('0x51')][_0xeab0('0x52')]({'where':{'ChatGroupId':_0x2cb0a9[_0xeab0('0x4a')]['id'],'ToId':_0x2cb0a9[_0xeab0('0x53')]['id'],'read':![]}})[_0xeab0('0x2b')](function(_0x24c910){return{'id':_['toInteger'](_0x2cb0a9['params']['id']),'count':_0x24c910};})[_0xeab0('0x2b')](respondWithResult(_0x54b4ab,null))['catch'](handleError(_0x54b4ab,null));};exports['addMembers']=function(_0x1b8b81,_0xe5a684,_0x5c95dc){return db['ChatGroup']['find']({'where':{'id':_0x1b8b81[_0xeab0('0x4a')]['id']}})['then'](handleEntityNotFound(_0xe5a684,null))[_0xeab0('0x2b')](function(_0x305220){if(_0x305220){return _0x305220[_0xeab0('0x54')](_0x1b8b81[_0xeab0('0x4f')]['ids'],_['omit'](_0x1b8b81[_0xeab0('0x4f')],['ids','id'])||{});}})[_0xeab0('0x2b')](respondWithResult(_0xe5a684,null))['catch'](handleError(_0xe5a684,null));};exports['getMembers']=function(_0x27a0b4,_0x46ddf0,_0x51c4fa){var _0x2e030e={};var _0x482704={};var _0x3ff6b8;var _0xccfadd;return db[_0xeab0('0x32')][_0xeab0('0x55')]({'where':{'id':_0x27a0b4['params']['id']}})[_0xeab0('0x2b')](handleEntityNotFound(_0x46ddf0,null))[_0xeab0('0x2b')](function(_0x2b3698){if(_0x2b3698){_0x3ff6b8=_0x2b3698;_0x482704[_0xeab0('0x36')]=_[_0xeab0('0x4b')](db[_0xeab0('0x56')][_0xeab0('0x33')]);_0x482704[_0xeab0('0x37')]=_[_0xeab0('0x4b')](_0x27a0b4[_0xeab0('0x37')]);_0x482704[_0xeab0('0x38')]=_[_0xeab0('0x39')](_0x482704[_0xeab0('0x36')],_0x482704['query']);_0x2e030e['attributes']=_[_0xeab0('0x39')](_0x482704['model'],qs[_0xeab0('0x3b')](_0x27a0b4[_0xeab0('0x37')]['fields']));_0x2e030e[_0xeab0('0x3a')]=_0x2e030e[_0xeab0('0x3a')][_0xeab0('0x3c')]?_0x2e030e[_0xeab0('0x3a')]:_0x482704[_0xeab0('0x36')];_0x2e030e[_0xeab0('0x3e')]=qs[_0xeab0('0x3f')](_0x27a0b4[_0xeab0('0x37')][_0xeab0('0x3f')]);_0x2e030e[_0xeab0('0x40')]=qs[_0xeab0('0x38')](_['pick'](_0x27a0b4[_0xeab0('0x37')],_0x482704[_0xeab0('0x38')]));if(_0x27a0b4['query'][_0xeab0('0x43')]){_0x2e030e[_0xeab0('0x40')]=_[_0xeab0('0x41')](_0x2e030e['where'],{'$or':_[_0xeab0('0x31')](_0x2e030e[_0xeab0('0x3a')],function(_0x2d23a8){var _0x25d9b5={};_0x25d9b5[_0x2d23a8]={'$like':'%'+_0x27a0b4[_0xeab0('0x37')]['filter']+'%'};return _0x25d9b5;})});}_0x2e030e=_[_0xeab0('0x41')]({},_0x2e030e,_0x27a0b4['options']);return _0x3ff6b8[_0xeab0('0x57')](_0x2e030e);}})[_0xeab0('0x2b')](function(_0x2e244b){if(_0x2e244b){_0xccfadd=_0x2e244b['length'];if(!_0x27a0b4[_0xeab0('0x37')][_0xeab0('0x58')](_0xeab0('0x3d'))){_0x2e030e[_0xeab0('0x23')]=qs[_0xeab0('0x23')](_0x27a0b4[_0xeab0('0x37')][_0xeab0('0x23')]);_0x2e030e[_0xeab0('0x24')]=qs[_0xeab0('0x24')](_0x27a0b4['query'][_0xeab0('0x24')]);}return _0x3ff6b8[_0xeab0('0x57')](_0x2e030e);}})[_0xeab0('0x2b')](function(_0x40de8f){if(_0x40de8f){return _0x40de8f?{'count':_0xccfadd,'rows':_0x40de8f}:null;}})['then'](respondWithResult(_0x46ddf0,null))[_0xeab0('0x48')](handleError(_0x46ddf0,null));};exports[_0xeab0('0x59')]=function(_0x3f14ca,_0x401be,_0x24c176){return db[_0xeab0('0x32')][_0xeab0('0x4d')]({'where':{'id':_0x3f14ca[_0xeab0('0x4a')]['id']}})[_0xeab0('0x2b')](handleEntityNotFound(_0x401be,null))[_0xeab0('0x2b')](function(_0x445cff){if(_0x445cff){return _0x445cff[_0xeab0('0x59')](_0x3f14ca[_0xeab0('0x37')][_0xeab0('0x5a')]);}})[_0xeab0('0x2b')](respondWithStatusCode(_0x401be,null))[_0xeab0('0x48')](handleError(_0x401be,null));};exports[_0xeab0('0x5b')]=function(_0x4d3ebb,_0x5eda8b,_0x4d2afb){if(_0x4d3ebb[_0xeab0('0x4f')]['id']){delete _0x4d3ebb[_0xeab0('0x4f')]['id'];}return db[_0xeab0('0x32')][_0xeab0('0x4d')]({'where':{'id':_0x4d3ebb[_0xeab0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5eda8b,null))[_0xeab0('0x2b')](function(_0xd11aec){if(_0xd11aec){_0x4d3ebb[_0xeab0('0x4f')][_0xeab0('0x5c')]=_0xd11aec['id'];return db[_0xeab0('0x51')][_0xeab0('0x4e')](_0x4d3ebb[_0xeab0('0x4f')]);}})[_0xeab0('0x2b')](respondWithResult(_0x5eda8b,null))[_0xeab0('0x48')](handleError(_0x5eda8b,null));};exports[_0xeab0('0x5d')]=function(_0x337495,_0x6fad92,_0x70cb85){var _0x3c5852={};var _0x343902={};var _0xf9e855;var _0x3a652a;return db[_0xeab0('0x32')][_0xeab0('0x55')]({'where':{'id':_0x337495[_0xeab0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x6fad92,null))['then'](function(_0x3e73fc){if(_0x3e73fc){_0xf9e855=_0x3e73fc;_0x343902[_0xeab0('0x36')]=_[_0xeab0('0x4b')](db[_0xeab0('0x51')]['rawAttributes']);_0x343902['query']=_[_0xeab0('0x4b')](_0x337495['query']);_0x343902[_0xeab0('0x38')]=_[_0xeab0('0x39')](_0x343902[_0xeab0('0x36')],_0x343902['query']);_0x3c5852['attributes']=_[_0xeab0('0x39')](_0x343902[_0xeab0('0x36')],qs['fields'](_0x337495['query'][_0xeab0('0x3b')]));_0x3c5852[_0xeab0('0x3a')]=_0x3c5852[_0xeab0('0x3a')][_0xeab0('0x3c')]?_0x3c5852[_0xeab0('0x3a')]:_0x343902[_0xeab0('0x36')];_0x3c5852[_0xeab0('0x3e')]=qs['sort'](_0x337495[_0xeab0('0x37')][_0xeab0('0x3f')]);_0x3c5852[_0xeab0('0x40')]=qs[_0xeab0('0x38')](_[_0xeab0('0x5e')](_0x337495[_0xeab0('0x37')],_0x343902[_0xeab0('0x38')]));if(_0x337495[_0xeab0('0x37')][_0xeab0('0x43')]){_0x3c5852[_0xeab0('0x40')]=_[_0xeab0('0x41')](_0x3c5852[_0xeab0('0x40')],{'$or':_[_0xeab0('0x31')](_0x3c5852['attributes'],function(_0x495cc9){var _0x2609a1={};_0x2609a1[_0x495cc9]={'$like':'%'+_0x337495[_0xeab0('0x37')][_0xeab0('0x43')]+'%'};return _0x2609a1;})});}if(_0x337495[_0xeab0('0x37')][_0xeab0('0x5f')]){var _0x124506=_0x337495['query'][_0xeab0('0x5f')][_0xeab0('0x60')](',');var _0x17d3b2={};_0x17d3b2[_0x124506[0x0]]={'$gte':moment(_0x124506[0x1])[_0xeab0('0x61')](_0xeab0('0x62'))};_0x3c5852[_0xeab0('0x40')]=_[_0xeab0('0x41')](_0x3c5852[_0xeab0('0x40')],_0x17d3b2);}_0x3c5852=_[_0xeab0('0x41')]({},_0x3c5852,_0x337495[_0xeab0('0x44')]);return _0xf9e855[_0xeab0('0x5d')](_0x3c5852);}})[_0xeab0('0x2b')](function(_0x448a66){if(_0x448a66){_0x3a652a=_0x448a66[_0xeab0('0x3c')];if(!_0x337495[_0xeab0('0x37')][_0xeab0('0x58')](_0xeab0('0x3d'))){_0x3c5852[_0xeab0('0x23')]=qs[_0xeab0('0x23')](_0x337495[_0xeab0('0x37')][_0xeab0('0x23')]);_0x3c5852[_0xeab0('0x24')]=qs['offset'](_0x337495[_0xeab0('0x37')][_0xeab0('0x24')]);}return _0xf9e855[_0xeab0('0x5d')](_0x3c5852);}})['then'](function(_0x3ae9b6){if(_0x3ae9b6){return _0x3ae9b6?{'count':_0x3a652a,'rows':_0x3ae9b6}:null;}})[_0xeab0('0x2b')](respondWithResult(_0x6fad92,null))[_0xeab0('0x48')](handleError(_0x6fad92,null));}; \ No newline at end of file +var _0x40f8=['register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ChatGroup','includeAll','include','rows','catch','show','params','keys','create','body','find','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket'];(function(_0x2a8860,_0x2da926){var _0x2f47a4=function(_0x3b7f54){while(--_0x3b7f54){_0x2a8860['push'](_0x2a8860['shift']());}};_0x2f47a4(++_0x2da926);}(_0x40f8,0x10a));var _0x840f=function(_0x1cf418,_0x115f58){_0x1cf418=_0x1cf418-0x0;var _0x456ddf=_0x40f8[_0x1cf418];return _0x456ddf;};'use strict';var emlformat=require(_0x840f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x840f('0x1'));var rp=require(_0x840f('0x2'));var moment=require(_0x840f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x840f('0x4'));var util=require(_0x840f('0x5'));var path=require(_0x840f('0x6'));var sox=require(_0x840f('0x7'));var csv=require(_0x840f('0x8'));var ejs=require(_0x840f('0x9'));var fs=require('fs');var fs_extra=require(_0x840f('0xa'));var _=require('lodash');var squel=require(_0x840f('0xb'));var crypto=require('crypto');var jsforce=require(_0x840f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x840f('0x8'));var querystring=require(_0x840f('0xd'));var Papa=require(_0x840f('0xe'));var Redis=require(_0x840f('0xf'));var authService=require(_0x840f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x840f('0x11'));var hardwareService=require(_0x840f('0x12'));var logger=require(_0x840f('0x13'))(_0x840f('0x14'));var utils=require('../../config/utils');var config=require(_0x840f('0x15'));var licenseUtil=require(_0x840f('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x840f('0x17')](config[_0x840f('0x18')],{'host':_0x840f('0x19'),'port':0x18eb});var socket=require(_0x840f('0x1a'))(new Redis(config[_0x840f('0x18')]));require(_0x840f('0x1b'))[_0x840f('0x1c')](socket);function respondWithStatusCode(_0x2c9e14,_0x7392fd){_0x7392fd=_0x7392fd||0xcc;return function(_0x43c727){if(_0x43c727){return _0x2c9e14[_0x840f('0x1d')](_0x7392fd);}return _0x2c9e14[_0x840f('0x1e')](_0x7392fd)[_0x840f('0x1f')]();};}function respondWithResult(_0x52b1c6,_0x152c97){_0x152c97=_0x152c97||0xc8;return function(_0x120edc){if(_0x120edc){return _0x52b1c6['status'](_0x152c97)[_0x840f('0x20')](_0x120edc);}};}function respondWithFilteredResult(_0x1414d8,_0x5eae07){return function(_0x4c721e){if(_0x4c721e){var _0x253856=typeof _0x5eae07[_0x840f('0x21')]===_0x840f('0x22')&&typeof _0x5eae07[_0x840f('0x23')]==='undefined';var _0x4aa2af=_0x4c721e[_0x840f('0x24')];var _0x41e376=_0x253856?0x0:_0x5eae07['offset'];var _0x1e6e68=_0x253856?_0x4c721e[_0x840f('0x24')]:_0x5eae07['offset']+_0x5eae07['limit'];var _0x45b029;if(_0x1e6e68>=_0x4aa2af){_0x1e6e68=_0x4aa2af;_0x45b029=0xc8;}else{_0x45b029=0xce;}_0x1414d8['status'](_0x45b029);return _0x1414d8['set'](_0x840f('0x25'),_0x41e376+'-'+_0x1e6e68+'/'+_0x4aa2af)[_0x840f('0x20')](_0x4c721e);}return null;};}function patchUpdates(_0x4b2287){return function(_0x30e41a){try{jsonpatch['apply'](_0x30e41a,_0x4b2287,!![]);}catch(_0x43952d){return BPromise['reject'](_0x43952d);}return _0x30e41a[_0x840f('0x26')]();};}function saveUpdates(_0x83fa9,_0x222b61){return function(_0x10f6ab){if(_0x10f6ab){return _0x10f6ab[_0x840f('0x27')](_0x83fa9)[_0x840f('0x28')](function(_0x2efdd0){return _0x2efdd0;});}return null;};}function removeEntity(_0x9a6c6b,_0x5c3c7c){return function(_0x4fe326){if(_0x4fe326){return _0x4fe326[_0x840f('0x29')]()[_0x840f('0x28')](function(){_0x9a6c6b[_0x840f('0x1e')](0xcc)[_0x840f('0x1f')]();});}};}function handleEntityNotFound(_0x2a32a8,_0x4c5736){return function(_0xc1b10e){if(!_0xc1b10e){_0x2a32a8[_0x840f('0x1d')](0x194);}return _0xc1b10e;};}function handleError(_0x45f1e1,_0x2e5010){_0x2e5010=_0x2e5010||0x1f4;return function(_0x19b441){logger['error'](_0x19b441[_0x840f('0x2a')]);if(_0x19b441[_0x840f('0x2b')]){delete _0x19b441[_0x840f('0x2b')];}_0x45f1e1['status'](_0x2e5010)[_0x840f('0x2c')](_0x19b441);};}exports[_0x840f('0x2d')]=function(_0x5ac58e,_0x519bc4){var _0x537383={},_0x2fb007={},_0x2d5302={'count':0x0,'rows':[]};var _0x4f8fd9=_[_0x840f('0x2e')](db['ChatGroup'][_0x840f('0x2f')],function(_0x524937){return{'name':_0x524937[_0x840f('0x30')],'type':_0x524937[_0x840f('0x31')][_0x840f('0x32')]};});_0x2fb007[_0x840f('0x33')]=_[_0x840f('0x2e')](_0x4f8fd9,'name');_0x2fb007['query']=_['keys'](_0x5ac58e[_0x840f('0x34')]);_0x2fb007[_0x840f('0x35')]=_['intersection'](_0x2fb007[_0x840f('0x33')],_0x2fb007[_0x840f('0x34')]);_0x537383['attributes']=_[_0x840f('0x36')](_0x2fb007[_0x840f('0x33')],qs[_0x840f('0x37')](_0x5ac58e[_0x840f('0x34')][_0x840f('0x37')]));_0x537383['attributes']=_0x537383[_0x840f('0x38')][_0x840f('0x39')]?_0x537383['attributes']:_0x2fb007[_0x840f('0x33')];if(!_0x5ac58e[_0x840f('0x34')][_0x840f('0x3a')](_0x840f('0x3b'))){_0x537383[_0x840f('0x23')]=qs[_0x840f('0x23')](_0x5ac58e[_0x840f('0x34')]['limit']);_0x537383[_0x840f('0x21')]=qs[_0x840f('0x21')](_0x5ac58e[_0x840f('0x34')]['offset']);}_0x537383[_0x840f('0x3c')]=qs[_0x840f('0x3d')](_0x5ac58e[_0x840f('0x34')][_0x840f('0x3d')]);_0x537383['where']=qs[_0x840f('0x35')](_[_0x840f('0x3e')](_0x5ac58e[_0x840f('0x34')],_0x2fb007['filters']),_0x4f8fd9);if(_0x5ac58e[_0x840f('0x34')][_0x840f('0x3f')]){_0x537383[_0x840f('0x40')]=_[_0x840f('0x41')](_0x537383[_0x840f('0x40')],{'$or':_[_0x840f('0x2e')](_0x4f8fd9,function(_0x1665e5){if(_0x1665e5[_0x840f('0x31')]!==_0x840f('0x42')){var _0x1634f2={};_0x1634f2[_0x1665e5[_0x840f('0x2b')]]={'$like':'%'+_0x5ac58e['query'][_0x840f('0x3f')]+'%'};return _0x1634f2;}})});}_0x537383=_[_0x840f('0x41')]({},_0x537383,_0x5ac58e[_0x840f('0x43')]);var _0x401222={'where':_0x537383[_0x840f('0x40')]};return db[_0x840f('0x44')][_0x840f('0x24')](_0x401222)[_0x840f('0x28')](function(_0x59feee){_0x2d5302[_0x840f('0x24')]=_0x59feee;if(_0x5ac58e[_0x840f('0x34')][_0x840f('0x45')]){_0x537383[_0x840f('0x46')]=[{'all':!![]}];}return db[_0x840f('0x44')]['findAll'](_0x537383);})[_0x840f('0x28')](function(_0x4aa74a){_0x2d5302[_0x840f('0x47')]=_0x4aa74a;return _0x2d5302;})[_0x840f('0x28')](respondWithFilteredResult(_0x519bc4,_0x537383))[_0x840f('0x48')](handleError(_0x519bc4,null));};exports[_0x840f('0x49')]=function(_0x2f6a32,_0x53d792){var _0x42bfb8={'raw':!![],'where':{'id':_0x2f6a32[_0x840f('0x4a')]['id']}},_0x1baf1d={};_0x1baf1d[_0x840f('0x33')]=_[_0x840f('0x4b')](db[_0x840f('0x44')][_0x840f('0x2f')]);_0x1baf1d[_0x840f('0x34')]=_[_0x840f('0x4b')](_0x2f6a32['query']);_0x1baf1d['filters']=_[_0x840f('0x36')](_0x1baf1d[_0x840f('0x33')],_0x1baf1d['query']);_0x42bfb8[_0x840f('0x38')]=_[_0x840f('0x36')](_0x1baf1d['model'],qs[_0x840f('0x37')](_0x2f6a32[_0x840f('0x34')][_0x840f('0x37')]));_0x42bfb8[_0x840f('0x38')]=_0x42bfb8['attributes'][_0x840f('0x39')]?_0x42bfb8[_0x840f('0x38')]:_0x1baf1d[_0x840f('0x33')];if(_0x2f6a32[_0x840f('0x34')]['includeAll']){_0x42bfb8[_0x840f('0x46')]=[{'all':!![]}];}_0x42bfb8=_['merge']({},_0x42bfb8,_0x2f6a32[_0x840f('0x43')]);return db[_0x840f('0x44')]['find'](_0x42bfb8)['then'](handleEntityNotFound(_0x53d792,null))['then'](respondWithResult(_0x53d792,null))[_0x840f('0x48')](handleError(_0x53d792,null));};exports[_0x840f('0x4c')]=function(_0x75fb81,_0x3570f4){return db['ChatGroup'][_0x840f('0x4c')](_0x75fb81['body'],{})[_0x840f('0x28')](respondWithResult(_0x3570f4,0xc9))[_0x840f('0x48')](handleError(_0x3570f4,null));};exports[_0x840f('0x27')]=function(_0x227e80,_0x1dc164){if(_0x227e80['body']['id']){delete _0x227e80[_0x840f('0x4d')]['id'];}return db[_0x840f('0x44')]['find']({'where':{'id':_0x227e80[_0x840f('0x4a')]['id']}})[_0x840f('0x28')](handleEntityNotFound(_0x1dc164,null))[_0x840f('0x28')](saveUpdates(_0x227e80[_0x840f('0x4d')],null))[_0x840f('0x28')](respondWithResult(_0x1dc164,null))[_0x840f('0x48')](handleError(_0x1dc164,null));};exports[_0x840f('0x29')]=function(_0x247875,_0x4bf215){return db['ChatGroup'][_0x840f('0x4e')]({'where':{'id':_0x247875['params']['id']}})[_0x840f('0x28')](handleEntityNotFound(_0x4bf215,null))[_0x840f('0x28')](removeEntity(_0x4bf215,null))[_0x840f('0x48')](handleError(_0x4bf215,null));};exports[_0x840f('0x4f')]=function(_0x15d6a9,_0x12e969){return db['ChatGroup'][_0x840f('0x4f')]()[_0x840f('0x28')](respondWithResult(_0x12e969,null))[_0x840f('0x48')](handleError(_0x12e969,null));};exports[_0x840f('0x50')]=function(_0x148c2b,_0x31e44f,_0x3a621b){return db[_0x840f('0x51')][_0x840f('0x24')]({'where':{'ChatGroupId':_0x148c2b[_0x840f('0x4a')]['id'],'ToId':_0x148c2b[_0x840f('0x52')]['id'],'read':![]}})[_0x840f('0x28')](function(_0x11275d){return{'id':_[_0x840f('0x53')](_0x148c2b[_0x840f('0x4a')]['id']),'count':_0x11275d};})[_0x840f('0x28')](respondWithResult(_0x31e44f,null))['catch'](handleError(_0x31e44f,null));};exports['addMembers']=function(_0x4e6ead,_0x8ebfec,_0x538d45){return db[_0x840f('0x44')][_0x840f('0x4e')]({'where':{'id':_0x4e6ead[_0x840f('0x4a')]['id']}})[_0x840f('0x28')](handleEntityNotFound(_0x8ebfec,null))[_0x840f('0x28')](function(_0x58cd4f){if(_0x58cd4f){return _0x58cd4f[_0x840f('0x54')](_0x4e6ead[_0x840f('0x4d')][_0x840f('0x55')],_[_0x840f('0x56')](_0x4e6ead[_0x840f('0x4d')],['ids','id'])||{});}})[_0x840f('0x28')](respondWithResult(_0x8ebfec,null))[_0x840f('0x48')](handleError(_0x8ebfec,null));};exports[_0x840f('0x57')]=function(_0x43c8f5,_0x1bdb8c,_0x30742){var _0x52673a={};var _0x41561b={};var _0xf98d96;var _0x44c072;return db[_0x840f('0x44')][_0x840f('0x58')]({'where':{'id':_0x43c8f5['params']['id']}})[_0x840f('0x28')](handleEntityNotFound(_0x1bdb8c,null))[_0x840f('0x28')](function(_0x2b934e){if(_0x2b934e){_0xf98d96=_0x2b934e;_0x41561b[_0x840f('0x33')]=_[_0x840f('0x4b')](db[_0x840f('0x59')][_0x840f('0x2f')]);_0x41561b[_0x840f('0x34')]=_[_0x840f('0x4b')](_0x43c8f5['query']);_0x41561b[_0x840f('0x35')]=_[_0x840f('0x36')](_0x41561b[_0x840f('0x33')],_0x41561b[_0x840f('0x34')]);_0x52673a[_0x840f('0x38')]=_[_0x840f('0x36')](_0x41561b[_0x840f('0x33')],qs['fields'](_0x43c8f5['query'][_0x840f('0x37')]));_0x52673a[_0x840f('0x38')]=_0x52673a['attributes']['length']?_0x52673a[_0x840f('0x38')]:_0x41561b[_0x840f('0x33')];_0x52673a[_0x840f('0x3c')]=qs[_0x840f('0x3d')](_0x43c8f5[_0x840f('0x34')][_0x840f('0x3d')]);_0x52673a[_0x840f('0x40')]=qs['filters'](_[_0x840f('0x3e')](_0x43c8f5[_0x840f('0x34')],_0x41561b['filters']));if(_0x43c8f5[_0x840f('0x34')][_0x840f('0x3f')]){_0x52673a[_0x840f('0x40')]=_[_0x840f('0x41')](_0x52673a[_0x840f('0x40')],{'$or':_[_0x840f('0x2e')](_0x52673a[_0x840f('0x38')],function(_0x3fe6bf){var _0x1ecc51={};_0x1ecc51[_0x3fe6bf]={'$like':'%'+_0x43c8f5[_0x840f('0x34')]['filter']+'%'};return _0x1ecc51;})});}_0x52673a=_[_0x840f('0x41')]({},_0x52673a,_0x43c8f5['options']);return _0xf98d96['getMembers'](_0x52673a);}})[_0x840f('0x28')](function(_0x47d308){if(_0x47d308){_0x44c072=_0x47d308['length'];if(!_0x43c8f5[_0x840f('0x34')][_0x840f('0x3a')](_0x840f('0x3b'))){_0x52673a[_0x840f('0x23')]=qs[_0x840f('0x23')](_0x43c8f5[_0x840f('0x34')][_0x840f('0x23')]);_0x52673a['offset']=qs[_0x840f('0x21')](_0x43c8f5[_0x840f('0x34')]['offset']);}return _0xf98d96['getMembers'](_0x52673a);}})[_0x840f('0x28')](function(_0x512943){if(_0x512943){return _0x512943?{'count':_0x44c072,'rows':_0x512943}:null;}})[_0x840f('0x28')](respondWithResult(_0x1bdb8c,null))[_0x840f('0x48')](handleError(_0x1bdb8c,null));};exports['removeMembers']=function(_0x3e7781,_0x5c7f65,_0xdfd21f){return db['ChatGroup'][_0x840f('0x4e')]({'where':{'id':_0x3e7781[_0x840f('0x4a')]['id']}})[_0x840f('0x28')](handleEntityNotFound(_0x5c7f65,null))[_0x840f('0x28')](function(_0x1aa33b){if(_0x1aa33b){return _0x1aa33b[_0x840f('0x5a')](_0x3e7781[_0x840f('0x34')][_0x840f('0x55')]);}})['then'](respondWithStatusCode(_0x5c7f65,null))[_0x840f('0x48')](handleError(_0x5c7f65,null));};exports[_0x840f('0x5b')]=function(_0x1a4932,_0x3976c2,_0x524a0d){if(_0x1a4932[_0x840f('0x4d')]['id']){delete _0x1a4932[_0x840f('0x4d')]['id'];}return db[_0x840f('0x44')]['find']({'where':{'id':_0x1a4932[_0x840f('0x4a')]['id']}})[_0x840f('0x28')](handleEntityNotFound(_0x3976c2,null))['then'](function(_0x30dc0b){if(_0x30dc0b){_0x1a4932[_0x840f('0x4d')][_0x840f('0x5c')]=_0x30dc0b['id'];return db[_0x840f('0x51')]['create'](_0x1a4932[_0x840f('0x4d')]);}})[_0x840f('0x28')](respondWithResult(_0x3976c2,null))[_0x840f('0x48')](handleError(_0x3976c2,null));};exports['getMessages']=function(_0x2e93d0,_0x1a0d44,_0x337a7f){var _0x19417c={};var _0x35d7eb={};var _0x3e3c7a;var _0x2bba51;return db[_0x840f('0x44')]['findOne']({'where':{'id':_0x2e93d0['params']['id']}})[_0x840f('0x28')](handleEntityNotFound(_0x1a0d44,null))[_0x840f('0x28')](function(_0x20592a){if(_0x20592a){_0x3e3c7a=_0x20592a;_0x35d7eb[_0x840f('0x33')]=_[_0x840f('0x4b')](db[_0x840f('0x51')][_0x840f('0x2f')]);_0x35d7eb[_0x840f('0x34')]=_[_0x840f('0x4b')](_0x2e93d0[_0x840f('0x34')]);_0x35d7eb[_0x840f('0x35')]=_['intersection'](_0x35d7eb[_0x840f('0x33')],_0x35d7eb['query']);_0x19417c[_0x840f('0x38')]=_[_0x840f('0x36')](_0x35d7eb[_0x840f('0x33')],qs['fields'](_0x2e93d0[_0x840f('0x34')]['fields']));_0x19417c[_0x840f('0x38')]=_0x19417c['attributes'][_0x840f('0x39')]?_0x19417c['attributes']:_0x35d7eb['model'];_0x19417c['order']=qs[_0x840f('0x3d')](_0x2e93d0[_0x840f('0x34')]['sort']);_0x19417c[_0x840f('0x40')]=qs[_0x840f('0x35')](_[_0x840f('0x3e')](_0x2e93d0[_0x840f('0x34')],_0x35d7eb['filters']));if(_0x2e93d0[_0x840f('0x34')][_0x840f('0x3f')]){_0x19417c[_0x840f('0x40')]=_[_0x840f('0x41')](_0x19417c[_0x840f('0x40')],{'$or':_[_0x840f('0x2e')](_0x19417c['attributes'],function(_0x55ca47){var _0xd87d5d={};_0xd87d5d[_0x55ca47]={'$like':'%'+_0x2e93d0[_0x840f('0x34')][_0x840f('0x3f')]+'%'};return _0xd87d5d;})});}if(_0x2e93d0['query'][_0x840f('0x5d')]){var _0x223317=_0x2e93d0[_0x840f('0x34')][_0x840f('0x5d')][_0x840f('0x5e')](',');var _0x46bda9={};_0x46bda9[_0x223317[0x0]]={'$gte':moment(_0x223317[0x1])[_0x840f('0x5f')](_0x840f('0x60'))};_0x19417c[_0x840f('0x40')]=_[_0x840f('0x41')](_0x19417c[_0x840f('0x40')],_0x46bda9);}_0x19417c=_[_0x840f('0x41')]({},_0x19417c,_0x2e93d0[_0x840f('0x43')]);return _0x3e3c7a[_0x840f('0x61')](_0x19417c);}})[_0x840f('0x28')](function(_0x5ca88b){if(_0x5ca88b){_0x2bba51=_0x5ca88b[_0x840f('0x39')];if(!_0x2e93d0[_0x840f('0x34')][_0x840f('0x3a')](_0x840f('0x3b'))){_0x19417c[_0x840f('0x23')]=qs[_0x840f('0x23')](_0x2e93d0[_0x840f('0x34')][_0x840f('0x23')]);_0x19417c['offset']=qs[_0x840f('0x21')](_0x2e93d0[_0x840f('0x34')][_0x840f('0x21')]);}return _0x3e3c7a[_0x840f('0x61')](_0x19417c);}})['then'](function(_0x2527ff){if(_0x2527ff){return _0x2527ff?{'count':_0x2bba51,'rows':_0x2527ff}:null;}})['then'](respondWithResult(_0x1a0d44,null))[_0x840f('0x48')](handleError(_0x1a0d44,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index a5581c0..3dd021b 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 _0x4689=['update','emit','hasOwnProperty','exports','../../mysqldb','ChatGroup','setMaxListeners'];(function(_0x1e1b18,_0x5d471b){var _0x3da8f2=function(_0x51fe71){while(--_0x51fe71){_0x1e1b18['push'](_0x1e1b18['shift']());}};_0x3da8f2(++_0x5d471b);}(_0x4689,0xf2));var _0x9468=function(_0x48e33b,_0x136b29){_0x48e33b=_0x48e33b-0x0;var _0x3a83aa=_0x4689[_0x48e33b];return _0x3a83aa;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x9468('0x0'))['db'][_0x9468('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x9468('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9468('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5ec58d){return function(_0xae5f0b,_0x5dea11,_0x54de70){ChatGroupEvents[_0x9468('0x4')](_0x5ec58d+':'+_0xae5f0b['id'],_0xae5f0b);ChatGroupEvents[_0x9468('0x4')](_0x5ec58d,_0xae5f0b);_0x54de70(null);};}for(var e in events){if(events[_0x9468('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x9468('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0x1ddf=['emit','hasOwnProperty','hook','events','../../mysqldb','save','update','remove'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x1ddf,0x1ab));var _0xf1dd=function(_0x40a4ee,_0x515400){_0x40a4ee=_0x40a4ee-0x0;var _0x57c3cc=_0x1ddf[_0x40a4ee];return _0x57c3cc;};'use strict';var EventEmitter=require(_0xf1dd('0x0'));var ChatGroup=require(_0xf1dd('0x1'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf1dd('0x2'),'afterUpdate':_0xf1dd('0x3'),'afterDestroy':_0xf1dd('0x4')};function emitEvent(_0x52a8d6){return function(_0x53271b,_0x370ac3,_0x17f7da){ChatGroupEvents[_0xf1dd('0x5')](_0x52a8d6+':'+_0x53271b['id'],_0x53271b);ChatGroupEvents[_0xf1dd('0x5')](_0x52a8d6,_0x53271b);_0x17f7da(null);};}for(var e in events){if(events[_0xf1dd('0x6')](e)){var event=events[e];ChatGroup[_0xf1dd('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index bd5160a..488a2d3 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 _0x19e5=['./chatGroup.attributes','define','ChatGroup','chat_groups','lodash','util','moment','bluebird','path','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x19e5,0xae));var _0x519e=function(_0x1f544e,_0x1edbbd){_0x1f544e=_0x1f544e-0x0;var _0x394caa=_0x19e5[_0x1f544e];return _0x394caa;};'use strict';var _=require(_0x519e('0x0'));var util=require(_0x519e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x519e('0x2'));var BPromise=require(_0x519e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x519e('0x4'));var rimraf=require('rimraf');var config=require(_0x519e('0x5'));var attributes=require(_0x519e('0x6'));module['exports']=function(_0x1f6949,_0x21c74d){return _0x1f6949[_0x519e('0x7')](_0x519e('0x8'),attributes,{'tableName':_0x519e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b1c=['rimraf','../../config/environment','define','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5118ed,_0x5815e6){var _0x4855da=function(_0x46f834){while(--_0x46f834){_0x5118ed['push'](_0x5118ed['shift']());}};_0x4855da(++_0x5815e6);}(_0x8b1c,0xf6));var _0xc8b1=function(_0x32cd82,_0x545328){_0x32cd82=_0x32cd82-0x0;var _0x52af6f=_0x8b1c[_0x32cd82];return _0x52af6f;};'use strict';var _=require(_0xc8b1('0x0'));var util=require(_0xc8b1('0x1'));var logger=require(_0xc8b1('0x2'))(_0xc8b1('0x3'));var moment=require(_0xc8b1('0x4'));var BPromise=require(_0xc8b1('0x5'));var rp=require(_0xc8b1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc8b1('0x7'));var config=require(_0xc8b1('0x8'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0xf9a2e2,_0x5b8db3){return _0xf9a2e2[_0xc8b1('0x9')]('ChatGroup',attributes,{'tableName':_0xc8b1('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 6f064e5..55c4a64 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 _0x3a32=['error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0xe13780,_0x5526f8){var _0x33b690=function(_0x25fb63){while(--_0x25fb63){_0xe13780['push'](_0xe13780['shift']());}};_0x33b690(++_0x5526f8);}(_0x3a32,0x9b));var _0x23a3=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x3a32[_0xd09668];return _0x68726;};'use strict';var _=require(_0x23a3('0x0'));var util=require(_0x23a3('0x1'));var moment=require(_0x23a3('0x2'));var BPromise=require(_0x23a3('0x3'));var rs=require(_0x23a3('0x4'));var fs=require('fs');var Redis=require(_0x23a3('0x5'));var db=require(_0x23a3('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x23a3('0x7'));var config=require(_0x23a3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x23a3('0x9')]['http']({'port':0x232a});config[_0x23a3('0xa')]=_[_0x23a3('0xb')](config[_0x23a3('0xa')],{'host':_0x23a3('0xc'),'port':0x18eb});var socket=require(_0x23a3('0xd'))(new Redis(config[_0x23a3('0xa')]));require('./chatGroup.socket')[_0x23a3('0xe')](socket);function respondWithRpcPromise(_0x238fbe,_0x5bdf73,_0x5f4b21){return new BPromise(function(_0x93e9d,_0xf9b603){return client[_0x23a3('0xf')](_0x238fbe,_0x5f4b21)['then'](function(_0x2137e4){logger['info'](_0x23a3('0x10'),_0x5bdf73,_0x23a3('0x11'));logger[_0x23a3('0x12')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x5bdf73,_0x23a3('0x11'),JSON[_0x23a3('0x13')](_0x2137e4));if(_0x2137e4[_0x23a3('0x14')]){if(_0x2137e4[_0x23a3('0x14')][_0x23a3('0x15')]===0x1f4){logger['error'](_0x23a3('0x10'),_0x5bdf73,_0x2137e4[_0x23a3('0x14')]['message']);return _0xf9b603(_0x2137e4[_0x23a3('0x14')][_0x23a3('0x16')]);}logger['error'](_0x23a3('0x10'),_0x5bdf73,_0x2137e4[_0x23a3('0x14')][_0x23a3('0x16')]);return _0x93e9d(_0x2137e4[_0x23a3('0x14')][_0x23a3('0x16')]);}else{logger[_0x23a3('0x17')](_0x23a3('0x10'),_0x5bdf73,_0x23a3('0x11'));_0x93e9d(_0x2137e4['result'][_0x23a3('0x16')]);}})[_0x23a3('0x18')](function(_0x5ed775){logger['error'](_0x23a3('0x10'),_0x5bdf73,_0x5ed775);_0xf9b603(_0x5ed775);});});} \ No newline at end of file +var _0x38fb=['register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatGroup.socket'];(function(_0x33a308,_0x5ceed8){var _0x362c75=function(_0x16c5e1){while(--_0x16c5e1){_0x33a308['push'](_0x33a308['shift']());}};_0x362c75(++_0x5ceed8);}(_0x38fb,0x1b0));var _0xb38f=function(_0x802997,_0x5534a2){_0x802997=_0x802997-0x0;var _0x35c641=_0x38fb[_0x802997];return _0x35c641;};'use strict';var _=require(_0xb38f('0x0'));var util=require(_0xb38f('0x1'));var moment=require(_0xb38f('0x2'));var BPromise=require(_0xb38f('0x3'));var rs=require(_0xb38f('0x4'));var fs=require('fs');var Redis=require(_0xb38f('0x5'));var db=require(_0xb38f('0x6'))['db'];var utils=require(_0xb38f('0x7'));var logger=require(_0xb38f('0x8'))(_0xb38f('0x9'));var config=require(_0xb38f('0xa'));var jayson=require(_0xb38f('0xb'));var client=jayson[_0xb38f('0xc')][_0xb38f('0xd')]({'port':0x232a});config[_0xb38f('0xe')]=_[_0xb38f('0xf')](config[_0xb38f('0xe')],{'host':_0xb38f('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb38f('0xe')]));require(_0xb38f('0x11'))[_0xb38f('0x12')](socket);function respondWithRpcPromise(_0x5e037a,_0x3a5441,_0x1252b6){return new BPromise(function(_0xc17932,_0x331549){return client[_0xb38f('0x13')](_0x5e037a,_0x1252b6)[_0xb38f('0x14')](function(_0x3eb027){logger[_0xb38f('0x15')](_0xb38f('0x16'),_0x3a5441,_0xb38f('0x17'));logger[_0xb38f('0x18')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3a5441,'request\x20sent',JSON['stringify'](_0x3eb027));if(_0x3eb027['error']){if(_0x3eb027[_0xb38f('0x19')][_0xb38f('0x1a')]===0x1f4){logger[_0xb38f('0x19')](_0xb38f('0x16'),_0x3a5441,_0x3eb027[_0xb38f('0x19')][_0xb38f('0x1b')]);return _0x331549(_0x3eb027[_0xb38f('0x19')][_0xb38f('0x1b')]);}logger['error']('ChatGroup,\x20%s,\x20%s',_0x3a5441,_0x3eb027[_0xb38f('0x19')]['message']);return _0xc17932(_0x3eb027[_0xb38f('0x19')][_0xb38f('0x1b')]);}else{logger[_0xb38f('0x15')](_0xb38f('0x16'),_0x3a5441,_0xb38f('0x17'));_0xc17932(_0x3eb027[_0xb38f('0x1c')][_0xb38f('0x1b')]);}})[_0xb38f('0x1d')](function(_0x57c380){logger[_0xb38f('0x19')](_0xb38f('0x16'),_0x3a5441,_0x57c380);_0x331549(_0x57c380);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index ff71da0..382c1ee 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 _0x7cba=['emit','length','./chatGroup.events','save'];(function(_0xfdb2df,_0x5517ff){var _0x42dc28=function(_0x3b547e){while(--_0x3b547e){_0xfdb2df['push'](_0xfdb2df['shift']());}};_0x42dc28(++_0x5517ff);}(_0x7cba,0x1ca));var _0xa7cb=function(_0x3c5832,_0x1d3f0e){_0x3c5832=_0x3c5832-0x0;var _0xfae7fc=_0x7cba[_0x3c5832];return _0xfae7fc;};'use strict';var ChatGroupEvents=require(_0xa7cb('0x0'));var events=[_0xa7cb('0x1'),'remove','update'];function createListener(_0x5a441d,_0x125ad8){return function(_0x5d239f){_0x125ad8[_0xa7cb('0x2')](_0x5a441d,_0x5d239f);};}function removeListener(_0x4bd8fd,_0x4d7313){return function(){ChatGroupEvents['removeListener'](_0x4bd8fd,_0x4d7313);};}exports['register']=function(_0x30437c){for(var _0x36ce42=0x0,_0x5cad2=events[_0xa7cb('0x3')];_0x36ce42<_0x5cad2;_0x36ce42++){var _0x563ff3=events[_0x36ce42];var _0x43870e=createListener('chatGroup:'+_0x563ff3,_0x30437c);ChatGroupEvents['on'](_0x563ff3,_0x43870e);}}; \ No newline at end of file +var _0x4d08=['chatGroup:','./chatGroup.events','save','remove','emit','register','length'];(function(_0x1d6302,_0x582df7){var _0x1f8f5c=function(_0xe4ddc2){while(--_0xe4ddc2){_0x1d6302['push'](_0x1d6302['shift']());}};_0x1f8f5c(++_0x582df7);}(_0x4d08,0x94));var _0x84d0=function(_0x10f68e,_0xf198ea){_0x10f68e=_0x10f68e-0x0;var _0x4c8372=_0x4d08[_0x10f68e];return _0x4c8372;};'use strict';var ChatGroupEvents=require(_0x84d0('0x0'));var events=[_0x84d0('0x1'),_0x84d0('0x2'),'update'];function createListener(_0x3036b6,_0x2392bd){return function(_0x584efe){_0x2392bd[_0x84d0('0x3')](_0x3036b6,_0x584efe);};}function removeListener(_0x4281d7,_0x445c6b){return function(){ChatGroupEvents['removeListener'](_0x4281d7,_0x445c6b);};}exports[_0x84d0('0x4')]=function(_0x66bf0e){for(var _0x329ef6=0x0,_0x118ef2=events[_0x84d0('0x5')];_0x329ef6<_0x118ef2;_0x329ef6++){var _0x268c7d=events[_0x329ef6];var _0x2f2397=createListener(_0x84d0('0x6')+_0x268c7d,_0x66bf0e);ChatGroupEvents['on'](_0x268c7d,_0x2f2397);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 31fbc56..6752733 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 _0x3374=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/messages','getMessages','post','create','addMembers','addMessage','update','destroy','delete','removeMembers','exports','util','connect-timeout','express','Router','fs-extra','./chatGroup.controller'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x3374,0x166));var _0x4337=function(_0x47d364,_0x506c2f){_0x47d364=_0x47d364-0x0;var _0x4b8e5b=_0x3374[_0x47d364];return _0x4b8e5b;};'use strict';var multer=require('multer');var util=require(_0x4337('0x0'));var path=require('path');var timeout=require(_0x4337('0x1'));var express=require(_0x4337('0x2'));var router=express[_0x4337('0x3')]();var fs_extra=require(_0x4337('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4337('0x5'));router[_0x4337('0x6')]('/',auth[_0x4337('0x7')](),controller[_0x4337('0x8')]);router[_0x4337('0x6')](_0x4337('0x9'),auth['isAuthenticated'](),controller[_0x4337('0xa')]);router['get'](_0x4337('0xb'),auth[_0x4337('0x7')](),controller[_0x4337('0xc')]);router[_0x4337('0x6')](_0x4337('0xd'),auth[_0x4337('0x7')](),controller[_0x4337('0xe')]);router[_0x4337('0x6')]('/:id/members',auth[_0x4337('0x7')](),controller['getMembers']);router[_0x4337('0x6')](_0x4337('0xf'),auth[_0x4337('0x7')](),controller[_0x4337('0x10')]);router[_0x4337('0x11')]('/',auth[_0x4337('0x7')](),controller[_0x4337('0x12')]);router[_0x4337('0x11')]('/:id/members',auth[_0x4337('0x7')](),controller[_0x4337('0x13')]);router[_0x4337('0x11')](_0x4337('0xf'),auth[_0x4337('0x7')](),controller[_0x4337('0x14')]);router['put'](_0x4337('0xb'),auth['isAuthenticated'](),controller[_0x4337('0x15')]);router['delete'](_0x4337('0xb'),auth[_0x4337('0x7')](),controller[_0x4337('0x16')]);router[_0x4337('0x17')]('/:id/members',auth['isAuthenticated'](),controller[_0x4337('0x18')]);module[_0x4337('0x19')]=router; \ No newline at end of file +var _0xf8c9=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','put','update','destroy','delete'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf8c9,0x106));var _0x9f8c=function(_0x47f71f,_0x152fd8){_0x47f71f=_0x47f71f-0x0;var _0x41e749=_0xf8c9[_0x47f71f];return _0x41e749;};'use strict';var multer=require(_0x9f8c('0x0'));var util=require(_0x9f8c('0x1'));var path=require(_0x9f8c('0x2'));var timeout=require(_0x9f8c('0x3'));var express=require(_0x9f8c('0x4'));var router=express[_0x9f8c('0x5')]();var fs_extra=require(_0x9f8c('0x6'));var auth=require(_0x9f8c('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9f8c('0x8'));router[_0x9f8c('0x9')]('/',auth[_0x9f8c('0xa')](),controller[_0x9f8c('0xb')]);router[_0x9f8c('0x9')](_0x9f8c('0xc'),auth['isAuthenticated'](),controller[_0x9f8c('0xd')]);router[_0x9f8c('0x9')](_0x9f8c('0xe'),auth[_0x9f8c('0xa')](),controller[_0x9f8c('0xf')]);router[_0x9f8c('0x9')]('/:id/unread',auth[_0x9f8c('0xa')](),controller[_0x9f8c('0x10')]);router[_0x9f8c('0x9')](_0x9f8c('0x11'),auth[_0x9f8c('0xa')](),controller[_0x9f8c('0x12')]);router[_0x9f8c('0x9')](_0x9f8c('0x13'),auth[_0x9f8c('0xa')](),controller[_0x9f8c('0x14')]);router[_0x9f8c('0x15')]('/',auth[_0x9f8c('0xa')](),controller[_0x9f8c('0x16')]);router['post'](_0x9f8c('0x11'),auth['isAuthenticated'](),controller['addMembers']);router[_0x9f8c('0x15')](_0x9f8c('0x13'),auth[_0x9f8c('0xa')](),controller[_0x9f8c('0x17')]);router[_0x9f8c('0x18')](_0x9f8c('0xe'),auth[_0x9f8c('0xa')](),controller[_0x9f8c('0x19')]);router['delete']('/:id',auth[_0x9f8c('0xa')](),controller[_0x9f8c('0x1a')]);router[_0x9f8c('0x1b')]('/:id/members',auth[_0x9f8c('0xa')](),controller['removeMembers']);module[_0x9f8c('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 3f6518f..92b4bc6 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(_0x4b6f5c,_0x56f7ce){var _0x55548b=function(_0x125619){while(--_0x125619){_0x4b6f5c['push'](_0x4b6f5c['shift']());}};_0x55548b(++_0x56f7ce);}(_0x3266,0x6a));var _0x6326=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x3266[_0x9c2427];return _0x51984f;};'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')]},'secondDisposition':{'type':Sequelize[_0x6326('0x8')]},'thirdDisposition':{'type':Sequelize[_0x6326('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x6326('0x8')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x6326('0x8')]},'osVersion':{'type':Sequelize[_0x6326('0x8')]},'deviceModel':{'type':Sequelize[_0x6326('0x8')]},'deviceVendor':{'type':Sequelize[_0x6326('0x8')]},'deviceType':{'type':Sequelize[_0x6326('0x8')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x6326('0x8')]},'formData':{'type':Sequelize[_0x6326('0x7')](_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')]},'customerPort':{'type':Sequelize[_0x6326('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x6326('0x7')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xeb74=['exports','BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out','sequelize'];(function(_0x5dede5,_0x22c5ca){var _0x3f8b62=function(_0xf4333){while(--_0xf4333){_0x5dede5['push'](_0x5dede5['shift']());}};_0x3f8b62(++_0x22c5ca);}(_0xeb74,0xe3));var _0x4eb7=function(_0x46e7af,_0x485859){_0x46e7af=_0x46e7af-0x0;var _0x1efc66=_0xeb74[_0x46e7af];return _0x1efc66;};'use strict';var Sequelize=require(_0x4eb7('0x0'));module[_0x4eb7('0x1')]={'closed':{'type':Sequelize[_0x4eb7('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x4eb7('0x3')]},'ratingType':{'type':Sequelize[_0x4eb7('0x4')](_0x4eb7('0x5'),_0x4eb7('0x6')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x4eb7('0x7')]},'pathTranscript':{'type':Sequelize[_0x4eb7('0x7')]},'mailTranscript':{'type':Sequelize[_0x4eb7('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x4eb7('0x9')]},'disposition':{'type':Sequelize[_0x4eb7('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x4eb7('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x4eb7('0x8')]},'browserVersion':{'type':Sequelize[_0x4eb7('0x8')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x4eb7('0x8')]},'deviceVendor':{'type':Sequelize[_0x4eb7('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x4eb7('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x4eb7('0x7')](_0x4eb7('0xa'))},'read1stAt':{'type':Sequelize[_0x4eb7('0x9')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x4eb7('0x4')]('in',_0x4eb7('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x4eb7('0x8')]},'customerPort':{'type':Sequelize[_0x4eb7('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x4eb7('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x4eb7('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 703bde6..b3fdd30 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 _0x1867=['jayson/promise','client','http','request','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','offset','undefined','limit','status','set','Content-Range','json','update','then','destroy','end','stack','name','send','render','merge','body','contact','agent','account','index','map','ChatInteraction','fieldName','getOptions','chat','query','user','catch','show','params','model','keys','rawAttributes','filters','intersection','fields','attributes','length','includeAll','include','options','create','find','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Sequelize','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachId','root','server/files/attachments/','offline-chat/','join','mailTranscript','format','transcript-%s.txt','now','pathTranscript','User','ContactId','Messages','%s%d','agentAlias','customer','Visitor','website_alias','System','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','hasOwnProperty','nolimit','order','sort','where','pick','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','count','findAll','rows','includeAgent','push','setTags','Tag','color','chatInteractionTags:save','removeTags','download','unix','toString','server','files','attachments','firstName','lastName','direction','Account','get','mkdirSync','Chat','Owner','N.A.','closedAt','browserName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','value','views','downloadInteraction.ejs','.pdf','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./chatInteraction.socket','register'];(function(_0x1e936d,_0x47c8c3){var _0x1992f6=function(_0x1fdab2){while(--_0x1fdab2){_0x1e936d['push'](_0x1e936d['shift']());}};_0x1992f6(++_0x47c8c3);}(_0x1867,0xbf));var _0x7186=function(_0x59a3fb,_0x8e90f5){_0x59a3fb=_0x59a3fb-0x0;var _0x1ab2e7=_0x1867[_0x59a3fb];return _0x1ab2e7;};'use strict';var rimraf=require(_0x7186('0x0'));var zipdir=require(_0x7186('0x1'));var rp=require(_0x7186('0x2'));var moment=require(_0x7186('0x3'));var BPromise=require(_0x7186('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7186('0x5'));var Redis=require(_0x7186('0x6'));var interaction=require(_0x7186('0x7'));var qs=require(_0x7186('0x8'));var pdf=require('../../components/export/pdf');var logger=require(_0x7186('0x9'))('api');var config=require(_0x7186('0xa'));var db=require('../../mysqldb')['db'];config[_0x7186('0xb')]=_['defaults'](config[_0x7186('0xb')],{'host':_0x7186('0xc'),'port':0x18eb});var socket=require(_0x7186('0xd'))(new Redis(config[_0x7186('0xb')]));require(_0x7186('0xe'))[_0x7186('0xf')](socket);var jayson=require(_0x7186('0x10'));var client=jayson[_0x7186('0x11')][_0x7186('0x12')]({'port':0x232b});var client9004=jayson[_0x7186('0x11')]['http']({'port':0x232c});function respondWithRpcPromise(_0x1d679d,_0x5efbed,_0x1a0804,_0x33320c){return new BPromise(function(_0x15e7b0,_0x586ca3){var _0x1d6407=_0x33320c||client;return _0x1d6407[_0x7186('0x13')](_0x1d679d,_0x1a0804)['then'](function(_0x7beaf3){logger[_0x7186('0x14')](_0x7186('0x15'),_0x5efbed,'request\x20sent');logger[_0x7186('0x16')](_0x7186('0x17'),_0x5efbed,_0x7186('0x18'),JSON[_0x7186('0x19')](_0x7beaf3));if(_0x7beaf3['error']){if(_0x7beaf3[_0x7186('0x1a')][_0x7186('0x1b')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x5efbed,_0x7beaf3[_0x7186('0x1a')][_0x7186('0x1c')]);return _0x586ca3(_0x7beaf3[_0x7186('0x1a')][_0x7186('0x1c')]);}logger[_0x7186('0x1a')](_0x7186('0x15'),_0x5efbed,_0x7beaf3[_0x7186('0x1a')][_0x7186('0x1c')]);return _0x15e7b0(_0x7beaf3[_0x7186('0x1a')]['message']);}else{logger[_0x7186('0x14')](_0x7186('0x15'),_0x5efbed,'request\x20sent');_0x15e7b0(_0x7beaf3[_0x7186('0x1d')][_0x7186('0x1c')]);}})['catch'](function(_0x4b347d){logger['error'](_0x7186('0x15'),_0x5efbed,_0x4b347d);_0x586ca3(_0x4b347d);});});}function respondWithStatusCode(_0x2eec8b,_0x5cf4ef){_0x5cf4ef=_0x5cf4ef||0xcc;return function(_0x300f09){if(_0x300f09){return _0x2eec8b[_0x7186('0x1e')](_0x5cf4ef);}return _0x2eec8b['status'](_0x5cf4ef)['end']();};}function respondWithResult(_0x2781c1,_0x54da0b){_0x54da0b=_0x54da0b||0xc8;return function(_0x455226){if(_0x455226){return _0x2781c1['status'](_0x54da0b)['json'](_0x455226);}};}function respondWithFilteredResult(_0x260617,_0x5044ef){return function(_0x4b1ade){if(_0x4b1ade){var _0x546af9=typeof _0x5044ef[_0x7186('0x1f')]===_0x7186('0x20')&&typeof _0x5044ef[_0x7186('0x21')]==='undefined';var _0x4d709e=_0x4b1ade['count'];var _0x49379b=_0x546af9?0x0:_0x5044ef[_0x7186('0x1f')];var _0x28f219=_0x546af9?_0x4b1ade['count']:_0x5044ef[_0x7186('0x1f')]+_0x5044ef[_0x7186('0x21')];var _0x3990e2;if(_0x28f219>=_0x4d709e){_0x28f219=_0x4d709e;_0x3990e2=0xc8;}else{_0x3990e2=0xce;}_0x260617[_0x7186('0x22')](_0x3990e2);return _0x260617[_0x7186('0x23')](_0x7186('0x24'),_0x49379b+'-'+_0x28f219+'/'+_0x4d709e)[_0x7186('0x25')](_0x4b1ade);}return null;};}function saveUpdates(_0x168277){return function(_0x532754){if(_0x532754){return _0x532754[_0x7186('0x26')](_0x168277)[_0x7186('0x27')](function(_0x14b4fe){return _0x14b4fe;});}return null;};}function removeEntity(_0x439b38){return function(_0x1bcca2){if(_0x1bcca2){return _0x1bcca2[_0x7186('0x28')]()['then'](function(){_0x439b38[_0x7186('0x22')](0xcc)[_0x7186('0x29')]();});}};}function handleEntityNotFound(_0x12c082){return function(_0x2617a5){if(!_0x2617a5){_0x12c082[_0x7186('0x1e')](0x194);}return _0x2617a5;};}function handleError(_0x4f5163,_0x1f6570){_0x1f6570=_0x1f6570||0x1f4;return function(_0x1d9369){logger[_0x7186('0x1a')](_0x1d9369[_0x7186('0x2a')]);if(_0x1d9369[_0x7186('0x2b')]){delete _0x1d9369[_0x7186('0x2b')];}_0x4f5163[_0x7186('0x22')](_0x1f6570)[_0x7186('0x2c')](_0x1d9369);};}function getMustacheRender(_0x1e6b1c,_0x791667){return Mustache[_0x7186('0x2d')](_0x1e6b1c,_[_0x7186('0x2e')](_0x791667[_0x7186('0x2f')],{'contact':_0x791667[_0x7186('0x30')],'message':_0x791667['message'],'agent':_0x791667[_0x7186('0x31')],'interaction':_0x791667['interaction'],'account':_0x791667[_0x7186('0x32')]}))||'';}exports[_0x7186('0x33')]=function(_0x43eea3,_0x5db5bd){var _0x3a6a38={};var _0x5f0ee1=_[_0x7186('0x34')](db[_0x7186('0x35')]['rawAttributes'],function(_0x3f1f29){return{'name':_0x3f1f29[_0x7186('0x36')],'type':_0x3f1f29['type']['key']};});_0x3a6a38=qs[_0x7186('0x37')](_0x5f0ee1,_0x43eea3);return interaction['findAll'](_0x7186('0x38'),_0x43eea3[_0x7186('0x39')],_0x43eea3[_0x7186('0x3a')],_0x3a6a38,_0x5f0ee1)[_0x7186('0x27')](respondWithFilteredResult(_0x5db5bd,_0x3a6a38))[_0x7186('0x3b')](handleError(_0x5db5bd,null));};exports[_0x7186('0x3c')]=function(_0x3f51cd,_0xa38d6c){var _0x3ddb2c={'raw':![],'where':{'id':_0x3f51cd[_0x7186('0x3d')]['id']}},_0x532a8b={};_0x532a8b[_0x7186('0x3e')]=_[_0x7186('0x3f')](db[_0x7186('0x35')][_0x7186('0x40')]);_0x532a8b[_0x7186('0x39')]=_['keys'](_0x3f51cd[_0x7186('0x39')]);_0x532a8b[_0x7186('0x41')]=_[_0x7186('0x42')](_0x532a8b[_0x7186('0x3e')],_0x532a8b[_0x7186('0x39')]);_0x3ddb2c['attributes']=_['intersection'](_0x532a8b[_0x7186('0x3e')],qs[_0x7186('0x43')](_0x3f51cd['query'][_0x7186('0x43')]));_0x3ddb2c['attributes']=_0x3ddb2c[_0x7186('0x44')][_0x7186('0x45')]?_0x3ddb2c['attributes']:_0x532a8b[_0x7186('0x3e')];if(_0x3f51cd[_0x7186('0x39')][_0x7186('0x46')]){_0x3ddb2c[_0x7186('0x47')]=[{'all':!![]}];}_0x3ddb2c=_['merge']({},_0x3ddb2c,_0x3f51cd[_0x7186('0x48')]);return db['ChatInteraction']['find'](_0x3ddb2c)[_0x7186('0x27')](handleEntityNotFound(_0xa38d6c,null))['then'](respondWithResult(_0xa38d6c,null))[_0x7186('0x3b')](handleError(_0xa38d6c,null));};exports[_0x7186('0x49')]=function(_0x2d8e73,_0x22275e){return db['ChatInteraction'][_0x7186('0x49')](_0x2d8e73[_0x7186('0x2f')],{})['then'](respondWithResult(_0x22275e,0xc9))[_0x7186('0x3b')](handleError(_0x22275e,null));};exports[_0x7186('0x26')]=function(_0x2554b8,_0xb6bad4){if(_0x2554b8['body']['id']){delete _0x2554b8[_0x7186('0x2f')]['id'];}return db[_0x7186('0x35')][_0x7186('0x4a')]({'where':{'id':_0x2554b8[_0x7186('0x3d')]['id']}})['then'](handleEntityNotFound(_0xb6bad4,null))[_0x7186('0x27')](saveUpdates(_0x2554b8[_0x7186('0x2f')],null))['then'](respondWithResult(_0xb6bad4,null))['catch'](handleError(_0xb6bad4,null));};exports[_0x7186('0x28')]=function(_0x5c0bf8,_0x36a662){return db[_0x7186('0x35')][_0x7186('0x4a')]({'where':{'id':_0x5c0bf8[_0x7186('0x3d')]['id']}})[_0x7186('0x27')](handleEntityNotFound(_0x36a662,null))['then'](removeEntity(_0x36a662,null))[_0x7186('0x3b')](handleError(_0x36a662,null));};exports[_0x7186('0x4b')]=function(_0x330243,_0xac7c2e){return db['ChatInteraction']['describe']()[_0x7186('0x27')](respondWithResult(_0xac7c2e,null))[_0x7186('0x3b')](handleError(_0xac7c2e,null));};exports[_0x7186('0x4c')]=function(_0x241d52,_0x567d88){var _0x5ee135=_0x241d52[_0x7186('0x3d')]['id'];var _0x475395;var _0x2e224e;var _0x4185f5;return db[_0x7186('0x35')][_0x7186('0x4d')]({'where':{'id':_0x5ee135}})[_0x7186('0x27')](function(_0x54813d){_0x475395=_0x54813d;return db[_0x7186('0x4e')][_0x7186('0x4d')]({'where':{'id':_0x54813d[_0x7186('0x4f')]},'attributes':['id',_0x7186('0x50'),_0x7186('0x51'),_0x7186('0x52'),_0x7186('0x53'),_0x7186('0x54')],'raw':!![]});})[_0x7186('0x27')](function(_0x57d638){if(_0x57d638&&_0x57d638[_0x7186('0x50')]&&_0x57d638['vidaooEscalation']){_0x2e224e=_0x57d638;var _0xac5239={'interaction':{'id':_0x5ee135},'agent':{'id':_0x241d52[_0x7186('0x3a')]['id'],'name':_0x241d52[_0x7186('0x3a')][_0x7186('0x2b')],'fullname':_0x241d52[_0x7186('0x3a')][_0x7186('0x55')],'email':_0x241d52[_0x7186('0x3a')][_0x7186('0x56')]},'contact':_0x241d52['body'][_0x7186('0x30')],'account':_0x241d52[_0x7186('0x2f')]['account']};var _0x7fc537={'rejectUnauthorized':![],'method':_0x7186('0x57'),'url':_0x7186('0x58'),'headers':{'X-APIKEY':_0x57d638[_0x7186('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x241d52[_0x7186('0x3a')][_0x7186('0x56')]],'buttons':null,'topic':_0x2e224e[_0x7186('0x52')],'note':_[_0x7186('0x59')](_0x2e224e[_0x7186('0x53')])?null:getMustacheRender(_0x2e224e[_0x7186('0x53')],_0xac5239),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x7186('0x59')](_0x2e224e['vidaooMetadata'])){var _0x33bee7=getMustacheRender(_0x2e224e[_0x7186('0x54')],_0xac5239);var _0x1d796b=JSON[_0x7186('0x5a')](_0x33bee7);_0x7fc537[_0x7186('0x2f')]['metadata']=_0x1d796b;}}catch(_0x419b8e){throw new db['Sequelize'][(_0x7186('0x5b'))](_0x7186('0x5c'));}return rp(_0x7fc537);}else{throw new db['Sequelize'][(_0x7186('0x5b'))](_0x7186('0x5d'));}})[_0x7186('0x27')](function(_0x458e09){_0x4185f5=_0x458e09;if(_0x4185f5['id']){var _0x2c9c29={'body':_0x4185f5['join_url'],'ChatWebsiteId':_0x2e224e['id'],'ChatInteractionId':_0x475395['id'],'direction':'out','UserId':_0x241d52['user']['id']};return db[_0x7186('0x5e')][_0x7186('0x49')](_0x2c9c29,{});}else{throw new db['Sequelize']['ValidationError'](_0x7186('0x5f'));}})[_0x7186('0x27')](function(){return _0x475395[_0x7186('0x60')]({'vidaooSessionId':_0x4185f5['id']});})[_0x7186('0x27')](respondWithResult(_0x567d88,null))[_0x7186('0x3b')](handleError(_0x567d88,null));};exports[_0x7186('0x61')]=function(_0x10d5ae,_0x3bccd5){if(_0x10d5ae['body']['id']){delete _0x10d5ae[_0x7186('0x2f')]['id'];}return db[_0x7186('0x35')][_0x7186('0x4a')]({'where':{'id':_0x10d5ae['params']['id']},'include':[{'model':db[_0x7186('0x62')],'as':_0x7186('0x63')}]})['then'](handleEntityNotFound(_0x3bccd5,null))['then'](saveUpdates(_0x10d5ae['body'],null))['then'](respondWithResult(_0x3bccd5,null))[_0x7186('0x3b')](handleError(_0x3bccd5,null));};exports[_0x7186('0x64')]=function(_0x25c54a,_0x1dcda8){if(_0x25c54a[_0x7186('0x2f')]['id']){delete _0x25c54a['body']['id'];}return db[_0x7186('0x35')][_0x7186('0x4a')]({'where':{'id':_0x25c54a[_0x7186('0x3d')]['id']}})[_0x7186('0x27')](function(_0x279672){if(!_0x279672){logger[_0x7186('0x1a')](_0x7186('0x65'),'abandon',0x194,_0x7186('0x66'));_0x1dcda8['sendStatus'](0x194);}else{if(_0x279672[_0x7186('0x67')]){throw new db[(_0x7186('0x68'))][(_0x7186('0x5b'))](_0x7186('0x69'));}}return _0x279672;})[_0x7186('0x27')](function(_0x11810d){if(_0x11810d){return _0x11810d[_0x7186('0x26')]({'closed':_0x25c54a[_0x7186('0x2f')][_0x7186('0x6a')],'disposition':_0x25c54a['body'][_0x7186('0x6b')]})['then'](function(_0x2577f5){return _0x2577f5;});}})['then'](function(){return respondWithRpcPromise(_0x7186('0x6c'),'abandon',_0x25c54a[_0x7186('0x2f')],client9004);})['then'](respondWithResult(_0x1dcda8,null))[_0x7186('0x3b')](handleError(_0x1dcda8,null));};exports[_0x7186('0x6d')]=function(_0x2aee69,_0x13f127){_0x2aee69[_0x7186('0x2f')][_0x7186('0x2b')]=_0x2aee69[_0x7186('0x6e')][_0x7186('0x6f')];_0x2aee69[_0x7186('0x2f')][_0x7186('0x70')]=_0x2aee69[_0x7186('0x6e')][_0x7186('0x71')];_0x2aee69[_0x7186('0x2f')]['type']=_0x2aee69[_0x7186('0x6e')][_0x7186('0x72')];return db[_0x7186('0x73')][_0x7186('0x49')](_0x2aee69[_0x7186('0x2f')])['then'](respondWithResult(_0x13f127,0xc9))['catch'](handleError(_0x13f127,null));};exports['attachmentDownload']=function(_0x7cb2a3,_0x276980){return db[_0x7186('0x35')]['findOne']({'where':{'id':_0x7cb2a3[_0x7186('0x3d')]['id']},'raw':!![]})[_0x7186('0x27')](handleEntityNotFound(_0x276980,null))['then'](function(_0x31abe8){if(_0x31abe8){if(_0x31abe8['closed']){return _0x276980[_0x7186('0x22')](0x193)[_0x7186('0x25')]({'status':0x193,'message':'Unauthorized'});}return db[_0x7186('0x73')]['findOne']({'where':{'id':_0x7cb2a3[_0x7186('0x39')][_0x7186('0x74')]},'raw':!![]})[_0x7186('0x27')](handleEntityNotFound(_0x276980,null));}})[_0x7186('0x27')](function(_0xb22a5){if(_0xb22a5){var _0x37c7d7=_0xb22a5['ChatOfflineMessageId']!==null;var _0xc58069=path['join'](config[_0x7186('0x75')],_0x7186('0x76'));if(_0x37c7d7){_0xc58069=path['join'](_0xc58069,_0x7186('0x77'));}var _0x3a0e1f=path[_0x7186('0x78')](_0xc58069,_0xb22a5[_0x7186('0x70')]);return _0x276980['download'](_0x3a0e1f);}})[_0x7186('0x3b')](handleError(_0x276980,null));};exports['close']=function(_0x3f460a,_0x3f0bf9){var _0x5e1fc6=null;var _0x5f1a27=null;var _0x3a0336=null;if(_0x3f460a[_0x7186('0x2f')]['id']){delete _0x3f460a['body']['id'];}if(_0x3f460a[_0x7186('0x2f')][_0x7186('0x79')]){_0x3a0336=path[_0x7186('0x78')](config['root'],'server/files/chat/upload/',util[_0x7186('0x7a')](_0x7186('0x7b'),Date[_0x7186('0x7c')]()));_0x3f460a['body'][_0x7186('0x7d')]=_0x3a0336;}return db[_0x7186('0x35')][_0x7186('0x4a')]({'where':{'id':_0x3f460a[_0x7186('0x3d')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db['User'],'as':_0x7186('0x7e')}]}]})[_0x7186('0x27')](handleEntityNotFound(_0x3f0bf9,null))['then'](saveUpdates(_0x3f460a[_0x7186('0x2f')],null))[_0x7186('0x27')](function(_0x5513a5){if(_0x5513a5){_0x5e1fc6=_0x5513a5;return db[_0x7186('0x4e')][_0x7186('0x4a')]({'where':{'id':_0x5e1fc6[_0x7186('0x4f')]}});}})['then'](function(_0x1b95a9){if(_0x1b95a9){_0x5f1a27=_0x1b95a9;return db['CmContact'][_0x7186('0x4a')]({'where':{'id':_0x5e1fc6[_0x7186('0x7f')]}});}})['then'](function(_0x29892c){if(_0x29892c){if(_0x3a0336){var _0x2dc7bb=null;for(var _0x2b7aad=0x1;_0x2b7aad<_0x5e1fc6['Messages'][_0x7186('0x45')];++_0x2b7aad){_0x2dc7bb=_0x5e1fc6[_0x7186('0x80')][_0x2b7aad];var _0x16ea46=_0x2dc7bb[_0x7186('0x67')]?util[_0x7186('0x7a')](_0x7186('0x81'),_0x5f1a27[_0x7186('0x82')],_0x2dc7bb['UserId']):'System';var _0x5f1b93=_0x3f460a[_0x7186('0x2f')][_0x7186('0x83')]||util[_0x7186('0x7a')](_0x7186('0x81'),_0x7186('0x84'),_0x2dc7bb[_0x7186('0x7f')]);switch(_0x5f1a27['agentIdentifier']){case _0x7186('0x85'):_0x16ea46=_0x2dc7bb[_0x7186('0x67')]?util[_0x7186('0x7a')](_0x7186('0x81'),_0x5f1a27[_0x7186('0x82')],_0x2dc7bb['UserId']):_0x7186('0x86');break;case _0x7186('0x87'):_0x16ea46=_0x2dc7bb[_0x7186('0x67')]?_0x2dc7bb[_0x7186('0x7e')][_0x7186('0x88')]||_0x2dc7bb[_0x7186('0x7e')]['fullname']:_0x7186('0x86');break;case _0x7186('0x89'):_0x16ea46=_0x2dc7bb[_0x7186('0x67')]?_0x2dc7bb[_0x7186('0x7e')][_0x7186('0x55')]:_0x7186('0x86');break;default:_0x16ea46=_0x2dc7bb['UserId']?util[_0x7186('0x7a')](_0x7186('0x81'),_0x5f1a27[_0x7186('0x82')],_0x2dc7bb[_0x7186('0x67')]):_0x7186('0x86');}var _0x49c915=util[_0x7186('0x7a')]('[%s]\x20%s:\x20%s\x0a',moment(_0x2dc7bb[_0x7186('0x8a')])[_0x7186('0x7a')](_0x7186('0x8b')),_0x2dc7bb['direction']==='in'?_0x5f1b93:_0x16ea46,_0x2dc7bb['body']);if(!_0x2dc7bb[_0x7186('0x8c')]){fs[_0x7186('0x8d')](_0x3a0336,_0x49c915);}}return db[_0x7186('0x8e')][_0x7186('0x4d')]({'where':{'service':!![]},'include':[{'model':db[_0x7186('0x8f')],'as':_0x7186('0x90'),'raw':!![],'include':[{'model':db[_0x7186('0x91')],'as':_0x7186('0x91'),'raw':!![]}]}]});}}})[_0x7186('0x27')](function(_0x5572b4){if(!_0x5572b4||!_0x5572b4[_0x7186('0x90')]||!_0x3f460a[_0x7186('0x2f')])return _0x5e1fc6;var _0x403f0e=_0x5572b4[_0x7186('0x92')]();return respondWithRpcPromise(_0x7186('0x93'),_0x7186('0x94'),{'account':_0x403f0e,'message':{'from':util[_0x7186('0x7a')]('\x22%s\x22\x20<%s>',_0x5572b4[_0x7186('0x2b')],_0x5572b4['email']||_0x5572b4[_0x7186('0x90')][_0x7186('0x3a')]),'to':_0x3f460a[_0x7186('0x2f')]['mailTranscript'],'subject':_0x7186('0x95'),'text':util[_0x7186('0x7a')](_0x7186('0x96'),_0x3f460a['body']['mailTranscript']),'attachments':[{'path':_0x3a0336}]}})['then'](function(){return _0x5e1fc6;})['catch'](function(_0x593c05){logger['error'](_0x593c05);});})['then'](respondWithStatusCode(_0x3f0bf9,0xc8))[_0x7186('0x3b')](handleError(_0x3f0bf9,null));};exports['addMessage']=function(_0x14df9b,_0x46f006){return db[_0x7186('0x5e')][_0x7186('0x4a')]({'where':{'id':_0x14df9b['params']['id']}})['then'](handleEntityNotFound(_0x46f006,null))[_0x7186('0x27')](function(_0x18134e){if(_0x18134e){return _0x18134e[_0x7186('0x97')](_0x14df9b[_0x7186('0x2f')][_0x7186('0x98')],_[_0x7186('0x99')](_0x14df9b[_0x7186('0x2f')],[_0x7186('0x98'),'id'])||{});}})[_0x7186('0x27')](respondWithResult(_0x46f006,null))[_0x7186('0x3b')](handleError(_0x46f006,null));};exports[_0x7186('0x9a')]=function(_0x5453d7,_0x1620a1){var _0x518f64={'raw':![],'where':{}};var _0x4aa775={};var _0x4bdaee={'count':0x0,'rows':[]};return db[_0x7186('0x35')][_0x7186('0x4d')]({'where':{'id':_0x5453d7[_0x7186('0x3d')]['id']}})[_0x7186('0x27')](handleEntityNotFound(_0x1620a1,null))[_0x7186('0x27')](function(_0x11675a){if(_0x11675a){_0x4aa775['model']=_[_0x7186('0x3f')](db[_0x7186('0x5e')][_0x7186('0x40')]);_0x4aa775['query']=_[_0x7186('0x3f')](_0x5453d7[_0x7186('0x39')]);_0x4aa775[_0x7186('0x41')]=_[_0x7186('0x42')](_0x4aa775[_0x7186('0x3e')],_0x4aa775[_0x7186('0x39')]);_0x518f64['attributes']=_[_0x7186('0x42')](_0x4aa775['model'],qs[_0x7186('0x43')](_0x5453d7[_0x7186('0x39')][_0x7186('0x43')]));_0x518f64[_0x7186('0x44')]=_0x518f64[_0x7186('0x44')][_0x7186('0x45')]?_0x518f64[_0x7186('0x44')]:_0x4aa775[_0x7186('0x3e')];if(!_0x5453d7[_0x7186('0x39')][_0x7186('0x9b')](_0x7186('0x9c'))){_0x518f64[_0x7186('0x21')]=qs[_0x7186('0x21')](_0x5453d7[_0x7186('0x39')][_0x7186('0x21')]);_0x518f64['offset']=qs[_0x7186('0x1f')](_0x5453d7[_0x7186('0x39')][_0x7186('0x1f')]);}_0x518f64[_0x7186('0x9d')]=qs[_0x7186('0x9e')](_0x5453d7[_0x7186('0x39')]['sort']);_0x518f64[_0x7186('0x9f')]=qs['filters'](_[_0x7186('0xa0')](_0x5453d7[_0x7186('0x39')],_0x4aa775['filters']));_0x518f64[_0x7186('0x9f')][_0x7186('0xa1')]=_0x11675a['id'];if(_0x5453d7['query'][_0x7186('0xa2')]){_0x518f64['where']=_[_0x7186('0x2e')](_0x518f64['where'],{'$or':_[_0x7186('0x34')](_0x518f64[_0x7186('0x44')],function(_0x2e0d51){var _0x87fb21={};_0x87fb21[_0x2e0d51]={'$like':'%'+_0x5453d7['query'][_0x7186('0xa2')]+'%'};return _0x87fb21;})});}if(_0x5453d7[_0x7186('0x39')][_0x7186('0xa3')]){var _0xe0fdb9=_0x5453d7[_0x7186('0x39')][_0x7186('0xa3')][_0x7186('0xa4')](',');var _0x349b53={};_0x349b53[_0xe0fdb9[0x0]]={'$gte':moment(_0xe0fdb9[0x1])[_0x7186('0x7a')](_0x7186('0xa5'))};_0x518f64['where']=_[_0x7186('0x2e')](_0x518f64[_0x7186('0x9f')],_0x349b53);}_0x518f64=_[_0x7186('0x2e')]({},_0x518f64,_0x5453d7[_0x7186('0x48')]);return db[_0x7186('0x5e')]['count']({'where':_0x518f64['where']})[_0x7186('0x27')](function(_0x4a07e9){_0x4bdaee[_0x7186('0xa6')]=_0x4a07e9;if(_0x5453d7[_0x7186('0x39')]['includeAll']){_0x518f64['include']=[{'all':!![]}];}return db[_0x7186('0x5e')][_0x7186('0xa7')](_0x518f64);})[_0x7186('0x27')](function(_0x1478ff){_0x4bdaee[_0x7186('0xa8')]=_0x1478ff;return _0x4bdaee;});}})[_0x7186('0x27')](respondWithFilteredResult(_0x1620a1,_0x518f64))[_0x7186('0x3b')](handleError(_0x1620a1,null));};exports['getMyMessages']=function(_0x2fd194,_0x339f0c){var _0x4c7426={'where':{}},_0x238d27={},_0x147732={'count':0x0,'rows':[]};return db[_0x7186('0x35')][_0x7186('0x4d')]({'where':{'id':_0x2fd194[_0x7186('0x3d')]['id']}})[_0x7186('0x27')](handleEntityNotFound(_0x339f0c,null))[_0x7186('0x27')](function(_0x178b6d){if(_0x178b6d){_0x238d27['model']=_[_0x7186('0x3f')](db[_0x7186('0x5e')][_0x7186('0x40')]);_0x238d27[_0x7186('0x39')]=_[_0x7186('0x3f')](_0x2fd194[_0x7186('0x39')]);_0x238d27[_0x7186('0x41')]=_[_0x7186('0x42')](_0x238d27[_0x7186('0x3e')],_0x238d27[_0x7186('0x39')]);_0x4c7426[_0x7186('0x44')]=_[_0x7186('0x42')](_0x238d27[_0x7186('0x3e')],qs['fields'](_0x2fd194[_0x7186('0x39')]['fields']));_0x4c7426[_0x7186('0x44')]=_0x4c7426[_0x7186('0x44')][_0x7186('0x45')]?_0x4c7426['attributes']:_0x238d27['model'];if(!_0x2fd194[_0x7186('0x39')][_0x7186('0x9b')]('nolimit')){_0x4c7426[_0x7186('0x21')]=qs['limit'](_0x2fd194[_0x7186('0x39')][_0x7186('0x21')]);_0x4c7426[_0x7186('0x1f')]=qs['offset'](_0x2fd194[_0x7186('0x39')][_0x7186('0x1f')]);}_0x4c7426[_0x7186('0x9d')]=qs[_0x7186('0x9e')](_0x2fd194[_0x7186('0x39')]['sort']);_0x4c7426['where']=qs[_0x7186('0x41')](_[_0x7186('0xa0')](_0x2fd194[_0x7186('0x39')],_0x238d27[_0x7186('0x41')]));_0x4c7426['where'][_0x7186('0xa1')]=_0x178b6d['id'];if(_0x2fd194[_0x7186('0x39')][_0x7186('0xa2')]){_0x4c7426['where']=_[_0x7186('0x2e')](_0x4c7426[_0x7186('0x9f')],{'$or':_[_0x7186('0x34')](_0x4c7426[_0x7186('0x44')],function(_0x62e58d){var _0x27102c={};_0x27102c[_0x62e58d]={'$like':'%'+_0x2fd194[_0x7186('0x39')][_0x7186('0xa2')]+'%'};return _0x27102c;})});}_0x4c7426[_0x7186('0x9f')][_0x7186('0x8c')]=![];if(_0x2fd194['query']['id']){_0x4c7426[_0x7186('0x9f')]['id']={'$gt':_0x2fd194[_0x7186('0x39')]['id']};}_0x4c7426=_[_0x7186('0x2e')]({},_0x4c7426,_0x2fd194[_0x7186('0x48')]);return db[_0x7186('0x5e')][_0x7186('0xa6')]({'where':_0x4c7426[_0x7186('0x9f')]})[_0x7186('0x27')](function(_0x1be191){_0x147732[_0x7186('0xa6')]=_0x1be191;_0x4c7426[_0x7186('0x47')]=[];if(_0x2fd194['query'][_0x7186('0xa9')]){_0x4c7426[_0x7186('0x47')][_0x7186('0xaa')]({'model':db[_0x7186('0x7e')],'as':'User','attributes':['id',_0x7186('0x55'),'alias']});}if(_0x2fd194[_0x7186('0x39')][_0x7186('0x46')]){_0x4c7426[_0x7186('0x47')]=[{'all':!![]}];}return db['ChatMessage'][_0x7186('0xa7')](_0x4c7426);})[_0x7186('0x27')](function(_0x31dfb0){_0x147732[_0x7186('0xa8')]=_0x31dfb0;return _0x147732;});}})[_0x7186('0x27')](respondWithFilteredResult(_0x339f0c,_0x4c7426))[_0x7186('0x3b')](handleError(_0x339f0c,null));};exports['addTags']=function(_0x5012b5,_0x56a2c8){return db['ChatInteraction'][_0x7186('0x4a')]({'where':{'id':_0x5012b5[_0x7186('0x3d')]['id']}})['then'](handleEntityNotFound(_0x56a2c8,null))[_0x7186('0x27')](function(_0xad6c07){if(_0xad6c07){return _0xad6c07[_0x7186('0xab')](_0x5012b5[_0x7186('0x2f')]['ids'],_[_0x7186('0x99')](_0x5012b5['body'],[_0x7186('0x98'),'id'])||{})['spread'](function(){return db[_0x7186('0xac')]['findAll']({'attributes':['id',_0x7186('0x2b'),_0x7186('0xad')],'where':{'id':_0x5012b5[_0x7186('0x2f')][_0x7186('0x98')]}});})['then'](function(_0x40a096){socket['emit'](_0x7186('0xae'),{'id':Number(_0x5012b5[_0x7186('0x3d')]['id']),'tags':_0x40a096||[]});return{'id':Number(_0x5012b5[_0x7186('0x3d')]['id']),'tags':_0x40a096||[]};});}})[_0x7186('0x27')](respondWithResult(_0x56a2c8,null))['catch'](handleError(_0x56a2c8,null));};exports[_0x7186('0xaf')]=function(_0xcd4007,_0x3b99a2){return db[_0x7186('0x35')][_0x7186('0x4a')]({'where':{'id':_0xcd4007[_0x7186('0x3d')]['id']}})[_0x7186('0x27')](handleEntityNotFound(_0x3b99a2,null))[_0x7186('0x27')](function(_0xc91831){if(_0xc91831){return _0xc91831['removeTags'](_0xcd4007['query'][_0x7186('0x98')]);}})[_0x7186('0x27')](respondWithStatusCode(_0x3b99a2,null))[_0x7186('0x3b')](handleError(_0x3b99a2,null));};exports[_0x7186('0xb0')]=function(_0x19721c,_0x3cd502){var _0x25d63e=moment()[_0x7186('0xb1')]()[_0x7186('0xb2')]();var _0x242414=path['join'](config['root'],_0x7186('0xb3'),'files','tmp');var _0x296330=path[_0x7186('0x78')](config[_0x7186('0x75')],_0x7186('0xb3'),_0x7186('0xb4'),_0x7186('0xb5'));var _0x179c47=path['join'](_0x242414,_0x25d63e);var _0x4e06a1=util[_0x7186('0x7a')]('transcript-%d-%s.zip',_0x19721c[_0x7186('0x3d')]['id'],_0x25d63e);var _0x5b68f0=path[_0x7186('0x78')](_0x242414,_0x4e06a1);var _0x4cdd8e=[];_0x4cdd8e[_0x7186('0xaa')]({'model':db[_0x7186('0x7e')],'as':_0x7186('0x7e'),'attributes':['id',_0x7186('0x55')],'raw':!![]});_0x4cdd8e[_0x7186('0xaa')]({'model':db[_0x7186('0x62')],'as':'Contact','attributes':['id',_0x7186('0xb6'),_0x7186('0xb7')],'raw':!![]});if(_0x19721c[_0x7186('0x39')][_0x7186('0xb5')]){_0x4cdd8e[_0x7186('0xaa')]({'model':db[_0x7186('0x73')],'as':_0x7186('0x73'),'raw':!![]});}var _0x1e340f=[{'model':db[_0x7186('0x5e')],'as':_0x7186('0x80'),'attributes':['id',_0x7186('0x2f'),_0x7186('0x8a'),_0x7186('0xb8'),_0x7186('0x8c'),'read'],'include':_0x4cdd8e}];_0x1e340f[_0x7186('0xaa')]({'model':db[_0x7186('0x4e')],'as':_0x7186('0xb9'),'attributes':['id',_0x7186('0x2b')]});_0x1e340f[_0x7186('0xaa')]({'model':db[_0x7186('0x7e')],'as':'Owner','attributes':['id',_0x7186('0x55')]});return db[_0x7186('0x35')][_0x7186('0x4a')]({'where':{'id':_0x19721c[_0x7186('0x3d')]['id']},'include':_0x1e340f})[_0x7186('0x27')](handleEntityNotFound(_0x3cd502,null))[_0x7186('0x27')](function(_0x2a263f){if(_0x2a263f){var _0x3eb6ac=_0x2a263f[_0x7186('0xba')]({'plain':!![]});fs[_0x7186('0xbb')](_0x179c47);var _0x3944b4={'channel':_0x7186('0xbc'),'account':_0x3eb6ac[_0x7186('0xb9')][_0x7186('0x2b')],'agent':_0x3eb6ac[_0x7186('0xbd')]?_0x3eb6ac[_0x7186('0xbd')][_0x7186('0x55')]:_0x7186('0xbe'),'createdAt':moment(_0x3eb6ac[_0x7186('0x8a')])[_0x7186('0x7a')](_0x7186('0xa5'))[_0x7186('0xb2')](),'closedAt':_0x3eb6ac[_0x7186('0x6a')]?moment(_0x3eb6ac[_0x7186('0xbf')])[_0x7186('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x3eb6ac[_0x7186('0x6b')],'chatInfo':{'browser':_0x3eb6ac[_0x7186('0xc0')],'os':_0x3eb6ac['osName'],'referer':_0x3eb6ac[_0x7186('0xc1')],'customerIp':_0x3eb6ac[_0x7186('0xc2')],'customerPort':_0x3eb6ac[_0x7186('0xc3')]?_0x3eb6ac[_0x7186('0xc3')]:_0x7186('0xbe')},'messages':_(_0x3eb6ac[_0x7186('0x80')])['tail']()[_0x7186('0xa2')]({'secret':![]})[_0x7186('0x34')](function(_0xbee7e8){if(_0xbee7e8[_0x7186('0x73')]){var _0x1beccf=path[_0x7186('0x78')](_0x296330,_0xbee7e8[_0x7186('0x73')][_0x7186('0x70')]);if(fs[_0x7186('0xc4')](_0x1beccf)){fs[_0x7186('0xc5')](_0x1beccf)[_0x7186('0xc6')](fs[_0x7186('0xc7')](path['join'](_0x179c47,_0xbee7e8[_0x7186('0x73')][_0x7186('0x70')])));}}return{'date':moment(_0xbee7e8[_0x7186('0x8a')])[_0x7186('0x7a')](_0x7186('0xa5'))['toString'](),'sender':_0xbee7e8['direction']===_0x7186('0xc8')?_0xbee7e8['User']?_0xbee7e8['User']['fullname']:_0x7186('0x86'):_0xbee7e8['Contact']['firstName']+(_0xbee7e8[_0x7186('0x63')]['lastName']?'\x20'+_0xbee7e8['Contact']['lastName']:''),'body':_0xbee7e8['Attachment']?_0xbee7e8['Attachment'][_0x7186('0x70')]:_0xbee7e8[_0x7186('0x2f')],'direction':_0xbee7e8[_0x7186('0xb8')]==='out'?'A':'C','secret':_0xbee7e8[_0x7186('0x8c')],'read':_0xbee7e8['read'],'attachment':_0xbee7e8['Attachment']};})[_0x7186('0xc9')]()};return ejs['renderFile'](path[_0x7186('0x78')](config[_0x7186('0x75')],_0x7186('0xb3'),_0x7186('0xca'),_0x7186('0xcb')),{'interaction':_0x3944b4})[_0x7186('0x27')](function(_0xde5c7e){var _0x9b2cfb=path['join'](_0x179c47,'transcript-'+_0x3eb6ac['id']+'-'+_0x25d63e+_0x7186('0xcc'));var _0x5a6c66={'path':_0x9b2cfb,'channel':_0x7186('0xbc'),'interactionId':_0x3eb6ac['id']};return pdf['createPdfFromHTML'](_0xde5c7e,_0x5a6c66);})[_0x7186('0x27')](function(){return new Promise(function(_0x5eaabb,_0x2c5f78){zipdir(_0x179c47,{'saveTo':_0x5b68f0},function(_0x19094a,_0x423978){if(_0x19094a)return _0x2c5f78(_0x19094a);return _0x5eaabb(_0x423978);});})['then'](function(){return new BPromise(function(_0x43bc28,_0x5dc2f8){rimraf(_0x179c47,function(_0x164e81){if(_0x164e81)_0x5dc2f8(_0x164e81);return _0x43bc28();});});})[_0x7186('0x27')](function(){return _0x3cd502[_0x7186('0xb0')](_0x5b68f0,_0x4e06a1,function(_0x351925){if(_0x351925){logger[_0x7186('0x1a')](_0x7186('0xcd'),_0x351925);}else{fs[_0x7186('0xce')](_0x5b68f0);}});});});}else{return _0x3cd502[_0x7186('0x1e')](0xc8);}})[_0x7186('0x3b')](handleError(_0x3cd502,null));}; \ No newline at end of file +var _0x8903=['now','Messages','User','ChatWebsiteId','ContactId','agentAlias','System','customer','%s%d','website_alias','alias','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','mailTranscript','addMessage','ids','omit','length','hasOwnProperty','nolimit','sort','pick','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','merge','rows','order','map','include','push','spread','emit','chatInteractionTags:save','removeTags','toString','server','files','tmp','transcript-%d-%s.zip','firstName','lastName','attachments','direction','read','Account','mkdirSync','Chat','Owner','closedAt','osName','referer','customerIp','customerPort','N.A.','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','rimraf','zip-dir','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatInteraction.socket','register','jayson/promise','client','http','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','update','then','stack','name','send','contact','interaction','index','ChatInteraction','rawAttributes','key','getOptions','findAll','chat','query','show','params','model','keys','filters','intersection','attributes','fields','includeAll','options','find','create','body','destroy','createVidaooSession','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooMetadata','user','fullname','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooNote','isNull','parse','metadata','ValidationError','Sequelize','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','file','originalname','basename','filename','type','attachmentDownload','findOne','Unauthorized','Attachment','attachId','ChatOfflineMessageId','join','server/files/attachments/','offline-chat/','download','close','root','format','transcript-%s.txt'];(function(_0x365919,_0x130223){var _0x12d60c=function(_0x1eae09){while(--_0x1eae09){_0x365919['push'](_0x365919['shift']());}};_0x12d60c(++_0x130223);}(_0x8903,0x1e1));var _0x3890=function(_0x313d6f,_0x122c8d){_0x313d6f=_0x313d6f-0x0;var _0x2059ac=_0x8903[_0x313d6f];return _0x2059ac;};'use strict';var rimraf=require(_0x3890('0x0'));var zipdir=require(_0x3890('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3890('0x2'));var Mustache=require('mustache');var util=require(_0x3890('0x3'));var path=require(_0x3890('0x4'));var ejs=require(_0x3890('0x5'));var fs=require('fs');var _=require(_0x3890('0x6'));var Redis=require(_0x3890('0x7'));var interaction=require(_0x3890('0x8'));var qs=require(_0x3890('0x9'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0x3890('0xa'));var config=require(_0x3890('0xb'));var db=require(_0x3890('0xc'))['db'];config[_0x3890('0xd')]=_[_0x3890('0xe')](config[_0x3890('0xd')],{'host':_0x3890('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3890('0xd')]));require(_0x3890('0x10'))[_0x3890('0x11')](socket);var jayson=require(_0x3890('0x12'));var client=jayson[_0x3890('0x13')]['http']({'port':0x232b});var client9004=jayson[_0x3890('0x13')][_0x3890('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x411af3,_0x58c2af,_0xdc51a4,_0x3c9111){return new BPromise(function(_0xc269d3,_0x585bea){var _0x5221c6=_0x3c9111||client;return _0x5221c6['request'](_0x411af3,_0xdc51a4)['then'](function(_0x279884){logger[_0x3890('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x58c2af,_0x3890('0x16'));logger[_0x3890('0x17')](_0x3890('0x18'),_0x58c2af,'request\x20sent',JSON[_0x3890('0x19')](_0x279884));if(_0x279884['error']){if(_0x279884[_0x3890('0x1a')][_0x3890('0x1b')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x58c2af,_0x279884['error'][_0x3890('0x1c')]);return _0x585bea(_0x279884[_0x3890('0x1a')][_0x3890('0x1c')]);}logger[_0x3890('0x1a')](_0x3890('0x1d'),_0x58c2af,_0x279884['error'][_0x3890('0x1c')]);return _0xc269d3(_0x279884[_0x3890('0x1a')][_0x3890('0x1c')]);}else{logger[_0x3890('0x15')](_0x3890('0x1d'),_0x58c2af,'request\x20sent');_0xc269d3(_0x279884[_0x3890('0x1e')][_0x3890('0x1c')]);}})[_0x3890('0x1f')](function(_0x2a896d){logger['error'](_0x3890('0x1d'),_0x58c2af,_0x2a896d);_0x585bea(_0x2a896d);});});}function respondWithStatusCode(_0x2491cc,_0x5541b9){_0x5541b9=_0x5541b9||0xcc;return function(_0x3a12cd){if(_0x3a12cd){return _0x2491cc[_0x3890('0x20')](_0x5541b9);}return _0x2491cc['status'](_0x5541b9)[_0x3890('0x21')]();};}function respondWithResult(_0x2e3ccb,_0x4652e3){_0x4652e3=_0x4652e3||0xc8;return function(_0x2504dd){if(_0x2504dd){return _0x2e3ccb['status'](_0x4652e3)[_0x3890('0x22')](_0x2504dd);}};}function respondWithFilteredResult(_0x33c161,_0x499657){return function(_0xa3cb39){if(_0xa3cb39){var _0x54f3c3=typeof _0x499657[_0x3890('0x23')]===_0x3890('0x24')&&typeof _0x499657[_0x3890('0x25')]===_0x3890('0x24');var _0x109d47=_0xa3cb39[_0x3890('0x26')];var _0x6c44f9=_0x54f3c3?0x0:_0x499657['offset'];var _0x4b7b1c=_0x54f3c3?_0xa3cb39[_0x3890('0x26')]:_0x499657['offset']+_0x499657[_0x3890('0x25')];var _0x24b0fc;if(_0x4b7b1c>=_0x109d47){_0x4b7b1c=_0x109d47;_0x24b0fc=0xc8;}else{_0x24b0fc=0xce;}_0x33c161[_0x3890('0x27')](_0x24b0fc);return _0x33c161[_0x3890('0x28')]('Content-Range',_0x6c44f9+'-'+_0x4b7b1c+'/'+_0x109d47)[_0x3890('0x22')](_0xa3cb39);}return null;};}function saveUpdates(_0x53d6a9){return function(_0xc7ae26){if(_0xc7ae26){return _0xc7ae26[_0x3890('0x29')](_0x53d6a9)[_0x3890('0x2a')](function(_0x8c68c3){return _0x8c68c3;});}return null;};}function removeEntity(_0x1fef71){return function(_0x4094b0){if(_0x4094b0){return _0x4094b0['destroy']()[_0x3890('0x2a')](function(){_0x1fef71[_0x3890('0x27')](0xcc)[_0x3890('0x21')]();});}};}function handleEntityNotFound(_0x48a345){return function(_0xf260dd){if(!_0xf260dd){_0x48a345['sendStatus'](0x194);}return _0xf260dd;};}function handleError(_0x443d08,_0x4f1efb){_0x4f1efb=_0x4f1efb||0x1f4;return function(_0x4b312b){logger['error'](_0x4b312b[_0x3890('0x2b')]);if(_0x4b312b[_0x3890('0x2c')]){delete _0x4b312b[_0x3890('0x2c')];}_0x443d08[_0x3890('0x27')](_0x4f1efb)[_0x3890('0x2d')](_0x4b312b);};}function getMustacheRender(_0x1c7cec,_0xf97cfe){return Mustache['render'](_0x1c7cec,_['merge'](_0xf97cfe['body'],{'contact':_0xf97cfe[_0x3890('0x2e')],'message':_0xf97cfe[_0x3890('0x1c')],'agent':_0xf97cfe['agent'],'interaction':_0xf97cfe[_0x3890('0x2f')],'account':_0xf97cfe['account']}))||'';}exports[_0x3890('0x30')]=function(_0x580a8b,_0x5713ce){var _0x583edb={};var _0x58688b=_['map'](db[_0x3890('0x31')][_0x3890('0x32')],function(_0x46229e){return{'name':_0x46229e['fieldName'],'type':_0x46229e['type'][_0x3890('0x33')]};});_0x583edb=qs[_0x3890('0x34')](_0x58688b,_0x580a8b);return interaction[_0x3890('0x35')](_0x3890('0x36'),_0x580a8b[_0x3890('0x37')],_0x580a8b['user'],_0x583edb,_0x58688b)['then'](respondWithFilteredResult(_0x5713ce,_0x583edb))[_0x3890('0x1f')](handleError(_0x5713ce,null));};exports[_0x3890('0x38')]=function(_0x5c03ef,_0x70485c){var _0x1c8083={'raw':![],'where':{'id':_0x5c03ef[_0x3890('0x39')]['id']}},_0x4dc614={};_0x4dc614[_0x3890('0x3a')]=_[_0x3890('0x3b')](db[_0x3890('0x31')][_0x3890('0x32')]);_0x4dc614[_0x3890('0x37')]=_[_0x3890('0x3b')](_0x5c03ef[_0x3890('0x37')]);_0x4dc614[_0x3890('0x3c')]=_[_0x3890('0x3d')](_0x4dc614[_0x3890('0x3a')],_0x4dc614[_0x3890('0x37')]);_0x1c8083[_0x3890('0x3e')]=_[_0x3890('0x3d')](_0x4dc614[_0x3890('0x3a')],qs[_0x3890('0x3f')](_0x5c03ef['query'][_0x3890('0x3f')]));_0x1c8083[_0x3890('0x3e')]=_0x1c8083[_0x3890('0x3e')]['length']?_0x1c8083[_0x3890('0x3e')]:_0x4dc614[_0x3890('0x3a')];if(_0x5c03ef['query'][_0x3890('0x40')]){_0x1c8083['include']=[{'all':!![]}];}_0x1c8083=_['merge']({},_0x1c8083,_0x5c03ef[_0x3890('0x41')]);return db[_0x3890('0x31')][_0x3890('0x42')](_0x1c8083)[_0x3890('0x2a')](handleEntityNotFound(_0x70485c,null))[_0x3890('0x2a')](respondWithResult(_0x70485c,null))[_0x3890('0x1f')](handleError(_0x70485c,null));};exports['create']=function(_0x5cceae,_0x58e6ef){return db[_0x3890('0x31')][_0x3890('0x43')](_0x5cceae[_0x3890('0x44')],{})[_0x3890('0x2a')](respondWithResult(_0x58e6ef,0xc9))['catch'](handleError(_0x58e6ef,null));};exports[_0x3890('0x29')]=function(_0x166b19,_0xc815a5){if(_0x166b19[_0x3890('0x44')]['id']){delete _0x166b19[_0x3890('0x44')]['id'];}return db['ChatInteraction'][_0x3890('0x42')]({'where':{'id':_0x166b19[_0x3890('0x39')]['id']}})[_0x3890('0x2a')](handleEntityNotFound(_0xc815a5,null))[_0x3890('0x2a')](saveUpdates(_0x166b19[_0x3890('0x44')],null))['then'](respondWithResult(_0xc815a5,null))[_0x3890('0x1f')](handleError(_0xc815a5,null));};exports[_0x3890('0x45')]=function(_0xe11f64,_0x1ca01b){return db['ChatInteraction'][_0x3890('0x42')]({'where':{'id':_0xe11f64[_0x3890('0x39')]['id']}})[_0x3890('0x2a')](handleEntityNotFound(_0x1ca01b,null))['then'](removeEntity(_0x1ca01b,null))['catch'](handleError(_0x1ca01b,null));};exports['describe']=function(_0x2c85aa,_0x5aadb8){return db[_0x3890('0x31')]['describe']()[_0x3890('0x2a')](respondWithResult(_0x5aadb8,null))[_0x3890('0x1f')](handleError(_0x5aadb8,null));};exports[_0x3890('0x46')]=function(_0x5f17d0,_0x414f81){var _0x1bb7dd=_0x5f17d0['params']['id'];var _0x4eb267;var _0x95b561;var _0x1c0983;return db[_0x3890('0x31')]['findOne']({'where':{'id':_0x1bb7dd}})['then'](function(_0x4303d3){_0x4eb267=_0x4303d3;return db[_0x3890('0x47')]['findOne']({'where':{'id':_0x4303d3['ChatWebsiteId']},'attributes':['id',_0x3890('0x48'),'vidaooEscalation',_0x3890('0x49'),'vidaooNote',_0x3890('0x4a')],'raw':!![]});})[_0x3890('0x2a')](function(_0x393882){if(_0x393882&&_0x393882['vidaooApiKey']&&_0x393882['vidaooEscalation']){_0x95b561=_0x393882;var _0x16e93a={'interaction':{'id':_0x1bb7dd},'agent':{'id':_0x5f17d0[_0x3890('0x4b')]['id'],'name':_0x5f17d0[_0x3890('0x4b')]['name'],'fullname':_0x5f17d0[_0x3890('0x4b')][_0x3890('0x4c')],'email':_0x5f17d0[_0x3890('0x4b')][_0x3890('0x4d')]},'contact':_0x5f17d0['body'][_0x3890('0x2e')],'account':_0x5f17d0[_0x3890('0x44')][_0x3890('0x4e')]};var _0x20aaa0={'rejectUnauthorized':![],'method':_0x3890('0x4f'),'url':_0x3890('0x50'),'headers':{'X-APIKEY':_0x393882[_0x3890('0x48')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5f17d0['user'][_0x3890('0x4d')]],'buttons':null,'topic':_0x95b561[_0x3890('0x49')],'note':_['isNull'](_0x95b561[_0x3890('0x51')])?null:getMustacheRender(_0x95b561['vidaooNote'],_0x16e93a),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x3890('0x52')](_0x95b561['vidaooMetadata'])){var _0xcd8ee0=getMustacheRender(_0x95b561[_0x3890('0x4a')],_0x16e93a);var _0x5761fd=JSON[_0x3890('0x53')](_0xcd8ee0);_0x20aaa0[_0x3890('0x44')][_0x3890('0x54')]=_0x5761fd;}}catch(_0x41f2f4){throw new db['Sequelize'][(_0x3890('0x55'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x20aaa0);}else{throw new db[(_0x3890('0x56'))]['ValidationError'](_0x3890('0x57'));}})['then'](function(_0x52119f){_0x1c0983=_0x52119f;if(_0x1c0983['id']){var _0x567fb5={'body':_0x1c0983[_0x3890('0x58')],'ChatWebsiteId':_0x95b561['id'],'ChatInteractionId':_0x4eb267['id'],'direction':_0x3890('0x59'),'UserId':_0x5f17d0[_0x3890('0x4b')]['id']};return db[_0x3890('0x5a')][_0x3890('0x43')](_0x567fb5,{});}else{throw new db['Sequelize']['ValidationError'](_0x3890('0x5b'));}})['then'](function(){return _0x4eb267[_0x3890('0x5c')]({'vidaooSessionId':_0x1c0983['id']});})[_0x3890('0x2a')](respondWithResult(_0x414f81,null))[_0x3890('0x1f')](handleError(_0x414f81,null));};exports[_0x3890('0x5d')]=function(_0x1df945,_0x35b82d){if(_0x1df945['body']['id']){delete _0x1df945[_0x3890('0x44')]['id'];}return db[_0x3890('0x31')]['find']({'where':{'id':_0x1df945[_0x3890('0x39')]['id']},'include':[{'model':db[_0x3890('0x5e')],'as':_0x3890('0x5f')}]})[_0x3890('0x2a')](handleEntityNotFound(_0x35b82d,null))['then'](saveUpdates(_0x1df945[_0x3890('0x44')],null))[_0x3890('0x2a')](respondWithResult(_0x35b82d,null))[_0x3890('0x1f')](handleError(_0x35b82d,null));};exports[_0x3890('0x60')]=function(_0x1d8f28,_0x2df05d){if(_0x1d8f28[_0x3890('0x44')]['id']){delete _0x1d8f28['body']['id'];}return db[_0x3890('0x31')][_0x3890('0x42')]({'where':{'id':_0x1d8f28[_0x3890('0x39')]['id']}})[_0x3890('0x2a')](function(_0x483ee6){if(!_0x483ee6){logger[_0x3890('0x1a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x3890('0x60'),0x194,_0x3890('0x61'));_0x2df05d[_0x3890('0x20')](0x194);}else{if(_0x483ee6[_0x3890('0x62')]){throw new db[(_0x3890('0x56'))]['ValidationError'](_0x3890('0x63'));}}return _0x483ee6;})[_0x3890('0x2a')](function(_0xf9b4b9){if(_0xf9b4b9){return _0xf9b4b9[_0x3890('0x29')]({'closed':_0x1d8f28[_0x3890('0x44')][_0x3890('0x64')],'disposition':_0x1d8f28[_0x3890('0x44')][_0x3890('0x65')]})[_0x3890('0x2a')](function(_0x5dc246){return _0x5dc246;});}})[_0x3890('0x2a')](function(){return respondWithRpcPromise(_0x3890('0x66'),'abandon',_0x1d8f28[_0x3890('0x44')],client9004);})[_0x3890('0x2a')](respondWithResult(_0x2df05d,null))[_0x3890('0x1f')](handleError(_0x2df05d,null));};exports['attachmentUpload']=function(_0x12290d,_0x929a2a){_0x12290d[_0x3890('0x44')][_0x3890('0x2c')]=_0x12290d[_0x3890('0x67')][_0x3890('0x68')];_0x12290d['body'][_0x3890('0x69')]=_0x12290d[_0x3890('0x67')][_0x3890('0x6a')];_0x12290d['body'][_0x3890('0x6b')]=_0x12290d[_0x3890('0x67')]['mimetype'];return db['Attachment']['create'](_0x12290d[_0x3890('0x44')])[_0x3890('0x2a')](respondWithResult(_0x929a2a,0xc9))[_0x3890('0x1f')](handleError(_0x929a2a,null));};exports[_0x3890('0x6c')]=function(_0x3fb537,_0x1c75c2){return db[_0x3890('0x31')][_0x3890('0x6d')]({'where':{'id':_0x3fb537[_0x3890('0x39')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x1c75c2,null))[_0x3890('0x2a')](function(_0x5b3222){if(_0x5b3222){if(_0x5b3222[_0x3890('0x64')]){return _0x1c75c2[_0x3890('0x27')](0x193)[_0x3890('0x22')]({'status':0x193,'message':_0x3890('0x6e')});}return db[_0x3890('0x6f')][_0x3890('0x6d')]({'where':{'id':_0x3fb537[_0x3890('0x37')][_0x3890('0x70')]},'raw':!![]})['then'](handleEntityNotFound(_0x1c75c2,null));}})[_0x3890('0x2a')](function(_0x1197c2){if(_0x1197c2){var _0x5c1a2f=_0x1197c2[_0x3890('0x71')]!==null;var _0xad562c=path[_0x3890('0x72')](config['root'],_0x3890('0x73'));if(_0x5c1a2f){_0xad562c=path[_0x3890('0x72')](_0xad562c,_0x3890('0x74'));}var _0x2a0312=path['join'](_0xad562c,_0x1197c2['basename']);return _0x1c75c2[_0x3890('0x75')](_0x2a0312);}})[_0x3890('0x1f')](handleError(_0x1c75c2,null));};exports[_0x3890('0x76')]=function(_0xb9e3c8,_0x3024c5){var _0x3aeb7b=null;var _0x163731=null;var _0x52e9b0=null;if(_0xb9e3c8[_0x3890('0x44')]['id']){delete _0xb9e3c8[_0x3890('0x44')]['id'];}if(_0xb9e3c8[_0x3890('0x44')]['mailTranscript']){_0x52e9b0=path['join'](config[_0x3890('0x77')],'server/files/chat/upload/',util[_0x3890('0x78')](_0x3890('0x79'),Date[_0x3890('0x7a')]()));_0xb9e3c8[_0x3890('0x44')]['pathTranscript']=_0x52e9b0;}return db[_0x3890('0x31')]['find']({'where':{'id':_0xb9e3c8[_0x3890('0x39')]['id']},'include':[{'model':db[_0x3890('0x5a')],'as':_0x3890('0x7b'),'include':[{'model':db[_0x3890('0x7c')],'as':_0x3890('0x7c')}]}]})['then'](handleEntityNotFound(_0x3024c5,null))['then'](saveUpdates(_0xb9e3c8['body'],null))[_0x3890('0x2a')](function(_0x34bdc1){if(_0x34bdc1){_0x3aeb7b=_0x34bdc1;return db[_0x3890('0x47')][_0x3890('0x42')]({'where':{'id':_0x3aeb7b[_0x3890('0x7d')]}});}})[_0x3890('0x2a')](function(_0xcbe0c4){if(_0xcbe0c4){_0x163731=_0xcbe0c4;return db['CmContact'][_0x3890('0x42')]({'where':{'id':_0x3aeb7b[_0x3890('0x7e')]}});}})[_0x3890('0x2a')](function(_0x5693a0){if(_0x5693a0){if(_0x52e9b0){var _0x5d4913=null;for(var _0xa72199=0x1;_0xa72199<_0x3aeb7b[_0x3890('0x7b')]['length'];++_0xa72199){_0x5d4913=_0x3aeb7b['Messages'][_0xa72199];var _0x2084a4=_0x5d4913[_0x3890('0x62')]?util[_0x3890('0x78')]('%s%d',_0x163731[_0x3890('0x7f')],_0x5d4913['UserId']):_0x3890('0x80');var _0x2a06cb=_0xb9e3c8['body'][_0x3890('0x81')]||util[_0x3890('0x78')](_0x3890('0x82'),'Visitor',_0x5d4913['ContactId']);switch(_0x163731['agentIdentifier']){case _0x3890('0x83'):_0x2084a4=_0x5d4913['UserId']?util['format'](_0x3890('0x82'),_0x163731[_0x3890('0x7f')],_0x5d4913[_0x3890('0x62')]):_0x3890('0x80');break;case'agent_alias':_0x2084a4=_0x5d4913[_0x3890('0x62')]?_0x5d4913['User'][_0x3890('0x84')]||_0x5d4913['User'][_0x3890('0x4c')]:_0x3890('0x80');break;case'agent_fullname':_0x2084a4=_0x5d4913[_0x3890('0x62')]?_0x5d4913[_0x3890('0x7c')][_0x3890('0x4c')]:_0x3890('0x80');break;default:_0x2084a4=_0x5d4913[_0x3890('0x62')]?util['format'](_0x3890('0x82'),_0x163731[_0x3890('0x7f')],_0x5d4913[_0x3890('0x62')]):_0x3890('0x80');}var _0x2679d3=util[_0x3890('0x78')]('[%s]\x20%s:\x20%s\x0a',moment(_0x5d4913[_0x3890('0x85')])[_0x3890('0x78')](_0x3890('0x86')),_0x5d4913['direction']==='in'?_0x2a06cb:_0x2084a4,_0x5d4913[_0x3890('0x44')]);if(!_0x5d4913[_0x3890('0x87')]){fs[_0x3890('0x88')](_0x52e9b0,_0x2679d3);}}return db[_0x3890('0x89')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x3890('0x8a')],'as':_0x3890('0x8b'),'raw':!![],'include':[{'model':db[_0x3890('0x8c')],'as':_0x3890('0x8c'),'raw':!![]}]}]});}}})[_0x3890('0x2a')](function(_0x22c668){if(!_0x22c668||!_0x22c668[_0x3890('0x8b')]||!_0xb9e3c8[_0x3890('0x44')])return _0x3aeb7b;var _0x555730=_0x22c668[_0x3890('0x8d')]();return respondWithRpcPromise(_0x3890('0x8e'),_0x3890('0x8f'),{'account':_0x555730,'message':{'from':util['format'](_0x3890('0x90'),_0x22c668[_0x3890('0x2c')],_0x22c668['email']||_0x22c668[_0x3890('0x8b')][_0x3890('0x4b')]),'to':_0xb9e3c8[_0x3890('0x44')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x3890('0x78')](_0x3890('0x91'),_0xb9e3c8['body'][_0x3890('0x92')]),'attachments':[{'path':_0x52e9b0}]}})['then'](function(){return _0x3aeb7b;})[_0x3890('0x1f')](function(_0xf05698){logger[_0x3890('0x1a')](_0xf05698);});})[_0x3890('0x2a')](respondWithStatusCode(_0x3024c5,0xc8))[_0x3890('0x1f')](handleError(_0x3024c5,null));};exports[_0x3890('0x93')]=function(_0x1ddbb5,_0x5ac0e6){return db['ChatMessage'][_0x3890('0x42')]({'where':{'id':_0x1ddbb5[_0x3890('0x39')]['id']}})[_0x3890('0x2a')](handleEntityNotFound(_0x5ac0e6,null))[_0x3890('0x2a')](function(_0x5ed9c0){if(_0x5ed9c0){return _0x5ed9c0['addMessage'](_0x1ddbb5[_0x3890('0x44')][_0x3890('0x94')],_[_0x3890('0x95')](_0x1ddbb5[_0x3890('0x44')],[_0x3890('0x94'),'id'])||{});}})[_0x3890('0x2a')](respondWithResult(_0x5ac0e6,null))[_0x3890('0x1f')](handleError(_0x5ac0e6,null));};exports['getMessages']=function(_0x2de9d3,_0x17e938){var _0x379e4b={'raw':![],'where':{}};var _0x1cd0eb={};var _0xd3aab7={'count':0x0,'rows':[]};return db[_0x3890('0x31')][_0x3890('0x6d')]({'where':{'id':_0x2de9d3[_0x3890('0x39')]['id']}})[_0x3890('0x2a')](handleEntityNotFound(_0x17e938,null))[_0x3890('0x2a')](function(_0x58774f){if(_0x58774f){_0x1cd0eb['model']=_['keys'](db[_0x3890('0x5a')][_0x3890('0x32')]);_0x1cd0eb[_0x3890('0x37')]=_[_0x3890('0x3b')](_0x2de9d3[_0x3890('0x37')]);_0x1cd0eb[_0x3890('0x3c')]=_[_0x3890('0x3d')](_0x1cd0eb[_0x3890('0x3a')],_0x1cd0eb[_0x3890('0x37')]);_0x379e4b[_0x3890('0x3e')]=_[_0x3890('0x3d')](_0x1cd0eb[_0x3890('0x3a')],qs[_0x3890('0x3f')](_0x2de9d3['query'][_0x3890('0x3f')]));_0x379e4b[_0x3890('0x3e')]=_0x379e4b[_0x3890('0x3e')][_0x3890('0x96')]?_0x379e4b[_0x3890('0x3e')]:_0x1cd0eb['model'];if(!_0x2de9d3[_0x3890('0x37')][_0x3890('0x97')](_0x3890('0x98'))){_0x379e4b[_0x3890('0x25')]=qs[_0x3890('0x25')](_0x2de9d3['query'][_0x3890('0x25')]);_0x379e4b[_0x3890('0x23')]=qs[_0x3890('0x23')](_0x2de9d3[_0x3890('0x37')][_0x3890('0x23')]);}_0x379e4b['order']=qs['sort'](_0x2de9d3[_0x3890('0x37')][_0x3890('0x99')]);_0x379e4b['where']=qs[_0x3890('0x3c')](_[_0x3890('0x9a')](_0x2de9d3['query'],_0x1cd0eb[_0x3890('0x3c')]));_0x379e4b[_0x3890('0x9b')][_0x3890('0x9c')]=_0x58774f['id'];if(_0x2de9d3[_0x3890('0x37')]['filter']){_0x379e4b['where']=_['merge'](_0x379e4b[_0x3890('0x9b')],{'$or':_['map'](_0x379e4b[_0x3890('0x3e')],function(_0x3671ec){var _0x53b08e={};_0x53b08e[_0x3671ec]={'$like':'%'+_0x2de9d3['query'][_0x3890('0x9d')]+'%'};return _0x53b08e;})});}if(_0x2de9d3[_0x3890('0x37')][_0x3890('0x9e')]){var _0x28a48f=_0x2de9d3[_0x3890('0x37')][_0x3890('0x9e')][_0x3890('0x9f')](',');var _0x3fb1f7={};_0x3fb1f7[_0x28a48f[0x0]]={'$gte':moment(_0x28a48f[0x1])[_0x3890('0x78')](_0x3890('0xa0'))};_0x379e4b['where']=_['merge'](_0x379e4b[_0x3890('0x9b')],_0x3fb1f7);}_0x379e4b=_[_0x3890('0xa1')]({},_0x379e4b,_0x2de9d3[_0x3890('0x41')]);return db['ChatMessage']['count']({'where':_0x379e4b[_0x3890('0x9b')]})['then'](function(_0x18328d){_0xd3aab7[_0x3890('0x26')]=_0x18328d;if(_0x2de9d3['query'][_0x3890('0x40')]){_0x379e4b['include']=[{'all':!![]}];}return db[_0x3890('0x5a')][_0x3890('0x35')](_0x379e4b);})['then'](function(_0x30eee6){_0xd3aab7[_0x3890('0xa2')]=_0x30eee6;return _0xd3aab7;});}})[_0x3890('0x2a')](respondWithFilteredResult(_0x17e938,_0x379e4b))['catch'](handleError(_0x17e938,null));};exports['getMyMessages']=function(_0x2cf557,_0x370929){var _0x2158b6={'where':{}},_0x7ef32f={},_0x96dd98={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x3890('0x6d')]({'where':{'id':_0x2cf557[_0x3890('0x39')]['id']}})[_0x3890('0x2a')](handleEntityNotFound(_0x370929,null))[_0x3890('0x2a')](function(_0x318d2e){if(_0x318d2e){_0x7ef32f['model']=_[_0x3890('0x3b')](db[_0x3890('0x5a')][_0x3890('0x32')]);_0x7ef32f[_0x3890('0x37')]=_[_0x3890('0x3b')](_0x2cf557[_0x3890('0x37')]);_0x7ef32f[_0x3890('0x3c')]=_['intersection'](_0x7ef32f[_0x3890('0x3a')],_0x7ef32f[_0x3890('0x37')]);_0x2158b6[_0x3890('0x3e')]=_['intersection'](_0x7ef32f['model'],qs['fields'](_0x2cf557[_0x3890('0x37')][_0x3890('0x3f')]));_0x2158b6['attributes']=_0x2158b6[_0x3890('0x3e')][_0x3890('0x96')]?_0x2158b6[_0x3890('0x3e')]:_0x7ef32f[_0x3890('0x3a')];if(!_0x2cf557[_0x3890('0x37')][_0x3890('0x97')](_0x3890('0x98'))){_0x2158b6[_0x3890('0x25')]=qs['limit'](_0x2cf557[_0x3890('0x37')][_0x3890('0x25')]);_0x2158b6['offset']=qs['offset'](_0x2cf557[_0x3890('0x37')][_0x3890('0x23')]);}_0x2158b6[_0x3890('0xa3')]=qs[_0x3890('0x99')](_0x2cf557[_0x3890('0x37')][_0x3890('0x99')]);_0x2158b6[_0x3890('0x9b')]=qs['filters'](_[_0x3890('0x9a')](_0x2cf557[_0x3890('0x37')],_0x7ef32f['filters']));_0x2158b6['where'][_0x3890('0x9c')]=_0x318d2e['id'];if(_0x2cf557[_0x3890('0x37')][_0x3890('0x9d')]){_0x2158b6[_0x3890('0x9b')]=_['merge'](_0x2158b6[_0x3890('0x9b')],{'$or':_[_0x3890('0xa4')](_0x2158b6[_0x3890('0x3e')],function(_0x2fc64d){var _0x3325f7={};_0x3325f7[_0x2fc64d]={'$like':'%'+_0x2cf557[_0x3890('0x37')][_0x3890('0x9d')]+'%'};return _0x3325f7;})});}_0x2158b6['where'][_0x3890('0x87')]=![];if(_0x2cf557['query']['id']){_0x2158b6[_0x3890('0x9b')]['id']={'$gt':_0x2cf557[_0x3890('0x37')]['id']};}_0x2158b6=_[_0x3890('0xa1')]({},_0x2158b6,_0x2cf557[_0x3890('0x41')]);return db['ChatMessage'][_0x3890('0x26')]({'where':_0x2158b6[_0x3890('0x9b')]})['then'](function(_0x5831c7){_0x96dd98[_0x3890('0x26')]=_0x5831c7;_0x2158b6[_0x3890('0xa5')]=[];if(_0x2cf557[_0x3890('0x37')]['includeAgent']){_0x2158b6[_0x3890('0xa5')][_0x3890('0xa6')]({'model':db[_0x3890('0x7c')],'as':'User','attributes':['id',_0x3890('0x4c'),_0x3890('0x84')]});}if(_0x2cf557[_0x3890('0x37')][_0x3890('0x40')]){_0x2158b6[_0x3890('0xa5')]=[{'all':!![]}];}return db[_0x3890('0x5a')][_0x3890('0x35')](_0x2158b6);})['then'](function(_0x39a53c){_0x96dd98[_0x3890('0xa2')]=_0x39a53c;return _0x96dd98;});}})[_0x3890('0x2a')](respondWithFilteredResult(_0x370929,_0x2158b6))[_0x3890('0x1f')](handleError(_0x370929,null));};exports['addTags']=function(_0x586783,_0x44a6ea){return db['ChatInteraction']['find']({'where':{'id':_0x586783[_0x3890('0x39')]['id']}})[_0x3890('0x2a')](handleEntityNotFound(_0x44a6ea,null))['then'](function(_0x4a8080){if(_0x4a8080){return _0x4a8080['setTags'](_0x586783[_0x3890('0x44')][_0x3890('0x94')],_[_0x3890('0x95')](_0x586783[_0x3890('0x44')],[_0x3890('0x94'),'id'])||{})[_0x3890('0xa7')](function(){return db['Tag']['findAll']({'attributes':['id',_0x3890('0x2c'),'color'],'where':{'id':_0x586783[_0x3890('0x44')][_0x3890('0x94')]}});})[_0x3890('0x2a')](function(_0x4f3718){socket[_0x3890('0xa8')](_0x3890('0xa9'),{'id':Number(_0x586783[_0x3890('0x39')]['id']),'tags':_0x4f3718||[]});return{'id':Number(_0x586783[_0x3890('0x39')]['id']),'tags':_0x4f3718||[]};});}})['then'](respondWithResult(_0x44a6ea,null))['catch'](handleError(_0x44a6ea,null));};exports[_0x3890('0xaa')]=function(_0x5efb95,_0x170798){return db[_0x3890('0x31')][_0x3890('0x42')]({'where':{'id':_0x5efb95[_0x3890('0x39')]['id']}})[_0x3890('0x2a')](handleEntityNotFound(_0x170798,null))[_0x3890('0x2a')](function(_0x2ed436){if(_0x2ed436){return _0x2ed436[_0x3890('0xaa')](_0x5efb95['query'][_0x3890('0x94')]);}})[_0x3890('0x2a')](respondWithStatusCode(_0x170798,null))['catch'](handleError(_0x170798,null));};exports[_0x3890('0x75')]=function(_0x49779c,_0x4d5400){var _0x5e705b=moment()['unix']()[_0x3890('0xab')]();var _0x5c8837=path['join'](config[_0x3890('0x77')],_0x3890('0xac'),_0x3890('0xad'),_0x3890('0xae'));var _0x304c69=path[_0x3890('0x72')](config['root'],_0x3890('0xac'),_0x3890('0xad'),'attachments');var _0x5a9a29=path[_0x3890('0x72')](_0x5c8837,_0x5e705b);var _0x58b8a5=util[_0x3890('0x78')](_0x3890('0xaf'),_0x49779c[_0x3890('0x39')]['id'],_0x5e705b);var _0x122bce=path[_0x3890('0x72')](_0x5c8837,_0x58b8a5);var _0x16c10d=[];_0x16c10d[_0x3890('0xa6')]({'model':db[_0x3890('0x7c')],'as':_0x3890('0x7c'),'attributes':['id',_0x3890('0x4c')],'raw':!![]});_0x16c10d[_0x3890('0xa6')]({'model':db[_0x3890('0x5e')],'as':'Contact','attributes':['id',_0x3890('0xb0'),_0x3890('0xb1')],'raw':!![]});if(_0x49779c[_0x3890('0x37')][_0x3890('0xb2')]){_0x16c10d[_0x3890('0xa6')]({'model':db[_0x3890('0x6f')],'as':_0x3890('0x6f'),'raw':!![]});}var _0xccea7d=[{'model':db['ChatMessage'],'as':_0x3890('0x7b'),'attributes':['id',_0x3890('0x44'),'createdAt',_0x3890('0xb3'),_0x3890('0x87'),_0x3890('0xb4')],'include':_0x16c10d}];_0xccea7d[_0x3890('0xa6')]({'model':db[_0x3890('0x47')],'as':_0x3890('0xb5'),'attributes':['id',_0x3890('0x2c')]});_0xccea7d[_0x3890('0xa6')]({'model':db[_0x3890('0x7c')],'as':'Owner','attributes':['id',_0x3890('0x4c')]});return db[_0x3890('0x31')][_0x3890('0x42')]({'where':{'id':_0x49779c['params']['id']},'include':_0xccea7d})['then'](handleEntityNotFound(_0x4d5400,null))[_0x3890('0x2a')](function(_0x434ad5){if(_0x434ad5){var _0x458f79=_0x434ad5['get']({'plain':!![]});fs[_0x3890('0xb6')](_0x5a9a29);var _0x136218={'channel':_0x3890('0xb7'),'account':_0x458f79['Account']['name'],'agent':_0x458f79[_0x3890('0xb8')]?_0x458f79[_0x3890('0xb8')][_0x3890('0x4c')]:'N.A.','createdAt':moment(_0x458f79[_0x3890('0x85')])[_0x3890('0x78')](_0x3890('0xa0'))[_0x3890('0xab')](),'closedAt':_0x458f79['closed']?moment(_0x458f79[_0x3890('0xb9')])[_0x3890('0x78')]('YYYY-MM-DD\x20HH:mm:ss')[_0x3890('0xab')]():'','disposition':_0x458f79['disposition'],'chatInfo':{'browser':_0x458f79['browserName'],'os':_0x458f79[_0x3890('0xba')],'referer':_0x458f79[_0x3890('0xbb')],'customerIp':_0x458f79[_0x3890('0xbc')],'customerPort':_0x458f79['customerPort']?_0x458f79[_0x3890('0xbd')]:_0x3890('0xbe')},'messages':_(_0x458f79['Messages'])['tail']()[_0x3890('0x9d')]({'secret':![]})['map'](function(_0x3b635d){if(_0x3b635d[_0x3890('0x6f')]){var _0x3923b5=path[_0x3890('0x72')](_0x304c69,_0x3b635d[_0x3890('0x6f')][_0x3890('0x69')]);if(fs[_0x3890('0xbf')](_0x3923b5)){fs[_0x3890('0xc0')](_0x3923b5)[_0x3890('0xc1')](fs[_0x3890('0xc2')](path[_0x3890('0x72')](_0x5a9a29,_0x3b635d[_0x3890('0x6f')][_0x3890('0x69')])));}}return{'date':moment(_0x3b635d['createdAt'])['format'](_0x3890('0xa0'))['toString'](),'sender':_0x3b635d['direction']===_0x3890('0x59')?_0x3b635d[_0x3890('0x7c')]?_0x3b635d[_0x3890('0x7c')][_0x3890('0x4c')]:_0x3890('0x80'):_0x3b635d[_0x3890('0x5f')][_0x3890('0xb0')]+(_0x3b635d[_0x3890('0x5f')][_0x3890('0xb1')]?'\x20'+_0x3b635d[_0x3890('0x5f')][_0x3890('0xb1')]:''),'body':_0x3b635d[_0x3890('0x6f')]?_0x3b635d[_0x3890('0x6f')][_0x3890('0x69')]:_0x3b635d[_0x3890('0x44')],'direction':_0x3b635d[_0x3890('0xb3')]===_0x3890('0x59')?'A':'C','secret':_0x3b635d[_0x3890('0x87')],'read':_0x3b635d[_0x3890('0xb4')],'attachment':_0x3b635d['Attachment']};})['value']()};return ejs[_0x3890('0xc3')](path['join'](config[_0x3890('0x77')],'server',_0x3890('0xc4'),_0x3890('0xc5')),{'interaction':_0x136218})[_0x3890('0x2a')](function(_0x1d9f65){var _0x3e348c=path[_0x3890('0x72')](_0x5a9a29,'transcript-'+_0x458f79['id']+'-'+_0x5e705b+_0x3890('0xc6'));var _0x4a38a2={'path':_0x3e348c,'channel':_0x3890('0xb7'),'interactionId':_0x458f79['id']};return pdf[_0x3890('0xc7')](_0x1d9f65,_0x4a38a2);})[_0x3890('0x2a')](function(){return new Promise(function(_0x5b3d1c,_0x1e90c1){zipdir(_0x5a9a29,{'saveTo':_0x122bce},function(_0x2be5d6,_0x5db3a5){if(_0x2be5d6)return _0x1e90c1(_0x2be5d6);return _0x5b3d1c(_0x5db3a5);});})[_0x3890('0x2a')](function(){return new BPromise(function(_0x3c6296,_0x22e0b4){rimraf(_0x5a9a29,function(_0x435a83){if(_0x435a83)_0x22e0b4(_0x435a83);return _0x3c6296();});});})['then'](function(){return _0x4d5400[_0x3890('0x75')](_0x122bce,_0x58b8a5,function(_0x381926){if(_0x381926){logger[_0x3890('0x1a')](_0x3890('0xc8'),_0x381926);}else{fs['unlinkSync'](_0x122bce);}});});});}else{return _0x4d5400[_0x3890('0x20')](0xc8);}})['catch'](handleError(_0x4d5400,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index f5a2005..974d2d2 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 _0x7508=['emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','getUsers','then','setDataValue','Users'];(function(_0x7d9c0d,_0x165295){var _0x26a3c7=function(_0x493af9){while(--_0x493af9){_0x7d9c0d['push'](_0x7d9c0d['shift']());}};_0x26a3c7(++_0x165295);}(_0x7508,0x1e5));var _0x8750=function(_0x15d685,_0x2c9b5b){_0x15d685=_0x15d685-0x0;var _0xc75766=_0x7508[_0x15d685];return _0xc75766;};'use strict';var EventEmitter=require(_0x8750('0x0'));var ChatInteraction=require(_0x8750('0x1'))['db'][_0x8750('0x2')];var ChatMessage=require(_0x8750('0x1'))['db'][_0x8750('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8750('0x4')](0x0);var events={'afterCreate':_0x8750('0x5'),'afterUpdate':'update','afterDestroy':_0x8750('0x6')};function emitEvent(_0x3a9854){return function(_0x2d0299,_0x1ff80c,_0x2c23d8){_0x2d0299[_0x8750('0x7')]({'attributes':['id'],'raw':!![]})[_0x8750('0x8')](function(_0x181f0f){_0x2d0299[_0x8750('0x9')](_0x8750('0xa'),_0x181f0f['map'](function(_0x3e29d3){return{'id':_0x3e29d3['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x2d0299['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8750('0x8')](function(_0x19d1bc){_0x2d0299[_0x8750('0x9')]('unreadMessages',_0x19d1bc['length']);ChatInteractionEvents[_0x8750('0xb')](_0x3a9854+':'+_0x2d0299['id'],_0x2d0299);ChatInteractionEvents[_0x8750('0xb')](_0x3a9854,_0x2d0299);_0x2c23d8(null);})[_0x8750('0xc')](_0x2c23d8(null));};}for(var e in events){if(events[_0x8750('0xd')](e)){var event=events[e];ChatInteraction[_0x8750('0xe')](e,emitEvent(event));}}module[_0x8750('0xf')]=ChatInteractionEvents; \ No newline at end of file +var _0x40f8=['setMaxListeners','save','update','getUsers','then','setDataValue','map','findAll','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','ChatMessage'];(function(_0x209603,_0x351b88){var _0x3e06d4=function(_0x4e9655){while(--_0x4e9655){_0x209603['push'](_0x209603['shift']());}};_0x3e06d4(++_0x351b88);}(_0x40f8,0x17e));var _0x840f=function(_0x299686,_0x39ac7e){_0x299686=_0x299686-0x0;var _0x444c00=_0x40f8[_0x299686];return _0x444c00;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0x840f('0x0'))['db']['ChatInteraction'];var ChatMessage=require(_0x840f('0x0'))['db'][_0x840f('0x1')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x840f('0x2')](0x0);var events={'afterCreate':_0x840f('0x3'),'afterUpdate':_0x840f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x6b3a15){return function(_0x41c58d,_0x270d0e,_0x1f0271){_0x41c58d[_0x840f('0x5')]({'attributes':['id'],'raw':!![]})[_0x840f('0x6')](function(_0x359906){_0x41c58d[_0x840f('0x7')]('Users',_0x359906[_0x840f('0x8')](function(_0x246e15){return{'id':_0x246e15['id']};}));return ChatMessage[_0x840f('0x9')]({'where':{'ChatInteractionId':_0x41c58d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x840f('0x6')](function(_0x5151cf){_0x41c58d['setDataValue']('unreadMessages',_0x5151cf[_0x840f('0xa')]);ChatInteractionEvents[_0x840f('0xb')](_0x6b3a15+':'+_0x41c58d['id'],_0x41c58d);ChatInteractionEvents[_0x840f('0xb')](_0x6b3a15,_0x41c58d);_0x1f0271(null);})[_0x840f('0xc')](_0x1f0271(null));};}for(var e in events){if(events[_0x840f('0xd')](e)){var event=events[e];ChatInteraction[_0x840f('0xe')](e,emitEvent(event));}}module[_0x840f('0xf')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index a176e82..b579789 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 _0x2ac8=['closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed'];(function(_0x1b95df,_0x135ab4){var _0x5e530a=function(_0x4917cb){while(--_0x4917cb){_0x1b95df['push'](_0x1b95df['shift']());}};_0x5e530a(++_0x135ab4);}(_0x2ac8,0x1cb));var _0x82ac=function(_0x203eb4,_0x235cb8){_0x203eb4=_0x203eb4-0x0;var _0x5b061c=_0x2ac8[_0x203eb4];return _0x5b061c;};'use strict';var _=require(_0x82ac('0x0'));var util=require(_0x82ac('0x1'));var logger=require(_0x82ac('0x2'))(_0x82ac('0x3'));var moment=require(_0x82ac('0x4'));var BPromise=require(_0x82ac('0x5'));var rp=require(_0x82ac('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x82ac('0x7'));var config=require(_0x82ac('0x8'));var attributes=require(_0x82ac('0x9'));module[_0x82ac('0xa')]=function(_0x510cb4,_0x5ec377){return _0x510cb4[_0x82ac('0xb')](_0x82ac('0xc'),attributes,{'tableName':_0x82ac('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3a3aeb,_0x1fc54f,_0x5bd21b){if(_0x3a3aeb[_0x82ac('0xe')](_0x82ac('0xf'))){_0x3a3aeb[_0x82ac('0x10')]=moment()['format'](_0x82ac('0x11'));}_0x5bd21b(null,_0x3a3aeb);}},'charset':'utf8mb4','collate':_0x82ac('0x12')});}; \ No newline at end of file +var _0x7ddb=['YYYY-MM-DD\x20HH:mm:ss','utf8mb4','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format'];(function(_0x11b58d,_0x555c55){var _0xc2811b=function(_0x396d22){while(--_0x396d22){_0x11b58d['push'](_0x11b58d['shift']());}};_0xc2811b(++_0x555c55);}(_0x7ddb,0x1c4));var _0xb7dd=function(_0x2450f3,_0x287cbf){_0x2450f3=_0x2450f3-0x0;var _0x537258=_0x7ddb[_0x2450f3];return _0x537258;};'use strict';var _=require('lodash');var util=require(_0xb7dd('0x0'));var logger=require(_0xb7dd('0x1'))(_0xb7dd('0x2'));var moment=require(_0xb7dd('0x3'));var BPromise=require(_0xb7dd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7dd('0x5'));var rimraf=require('rimraf');var config=require(_0xb7dd('0x6'));var attributes=require(_0xb7dd('0x7'));module[_0xb7dd('0x8')]=function(_0x377682,_0x5650ca){return _0x377682[_0xb7dd('0x9')](_0xb7dd('0xa'),attributes,{'tableName':_0xb7dd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x264aa7,_0xd56b1,_0x412561){if(_0x264aa7[_0xb7dd('0xc')](_0xb7dd('0xd'))){_0x264aa7[_0xb7dd('0xe')]=moment()[_0xb7dd('0xf')](_0xb7dd('0x10'));}_0x412561(null,_0x264aa7);}},'charset':_0xb7dd('0x11'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 2a26cf2..a628812 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 _0x9979=['request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','ChatInteraction','update','body','options','raw','where','attributes','limit','UpdateChatInteraction','debug','stringify','catch','AddTagsToChatInteraction','find','addTags','ids','omit','AddTags','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./chatInteraction.socket','register'];(function(_0x26d6a2,_0x35dd17){var _0x3771e4=function(_0x385a1c){while(--_0x385a1c){_0x26d6a2['push'](_0x26d6a2['shift']());}};_0x3771e4(++_0x35dd17);}(_0x9979,0x1d4));var _0x9997=function(_0x1ee8cb,_0x4d1c68){_0x1ee8cb=_0x1ee8cb-0x0;var _0x21f29b=_0x9979[_0x1ee8cb];return _0x21f29b;};'use strict';var _=require(_0x9997('0x0'));var util=require('util');var moment=require(_0x9997('0x1'));var BPromise=require('bluebird');var rs=require(_0x9997('0x2'));var fs=require('fs');var Redis=require(_0x9997('0x3'));var db=require(_0x9997('0x4'))['db'];var utils=require(_0x9997('0x5'));var logger=require('../../config/logger')(_0x9997('0x6'));var config=require(_0x9997('0x7'));var jayson=require(_0x9997('0x8'));var client=jayson[_0x9997('0x9')][_0x9997('0xa')]({'port':0x232a});config['redis']=_[_0x9997('0xb')](config['redis'],{'host':_0x9997('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9997('0xd')]));require(_0x9997('0xe'))[_0x9997('0xf')](socket);function respondWithRpcPromise(_0xd47c7e,_0x1f606a,_0x165ea4){return new BPromise(function(_0x5e6ca6,_0x26b8eb){return client[_0x9997('0x10')](_0xd47c7e,_0x165ea4)[_0x9997('0x11')](function(_0x24cc97){logger[_0x9997('0x12')](_0x9997('0x13'),_0x1f606a,'request\x20sent');logger['debug'](_0x9997('0x14'),_0x1f606a,_0x9997('0x15'),JSON['stringify'](_0x24cc97));if(_0x24cc97['error']){if(_0x24cc97[_0x9997('0x16')][_0x9997('0x17')]===0x1f4){logger[_0x9997('0x16')](_0x9997('0x13'),_0x1f606a,_0x24cc97[_0x9997('0x16')][_0x9997('0x18')]);return _0x26b8eb(_0x24cc97['error'][_0x9997('0x18')]);}logger[_0x9997('0x16')](_0x9997('0x13'),_0x1f606a,_0x24cc97[_0x9997('0x16')][_0x9997('0x18')]);return _0x5e6ca6(_0x24cc97['error']['message']);}else{logger[_0x9997('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x1f606a,_0x9997('0x15'));_0x5e6ca6(_0x24cc97[_0x9997('0x19')][_0x9997('0x18')]);}})['catch'](function(_0x3f2720){logger[_0x9997('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x1f606a,_0x3f2720);_0x26b8eb(_0x3f2720);});});}exports['UpdateChatInteraction']=function(_0x44debd){var _0x3f9601=this;return new Promise(function(_0x4e3ae2,_0x311240){return db[_0x9997('0x1a')][_0x9997('0x1b')](_0x44debd[_0x9997('0x1c')],{'raw':_0x44debd[_0x9997('0x1d')]?_0x44debd[_0x9997('0x1d')][_0x9997('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x44debd['options']?_0x44debd[_0x9997('0x1d')][_0x9997('0x1f')]||null:null,'attributes':_0x44debd[_0x9997('0x1d')]?_0x44debd[_0x9997('0x1d')][_0x9997('0x20')]||null:null,'limit':_0x44debd['options']?_0x44debd[_0x9997('0x1d')][_0x9997('0x21')]||null:null})['then'](function(_0x30226d){logger[_0x9997('0x12')](_0x9997('0x22'),_0x44debd);logger[_0x9997('0x23')]('UpdateChatInteraction',_0x44debd,JSON[_0x9997('0x24')](_0x30226d));_0x4e3ae2(_0x30226d);})[_0x9997('0x25')](function(_0xc3a6a6){logger[_0x9997('0x16')](_0x9997('0x22'),_0xc3a6a6[_0x9997('0x18')],_0x44debd);_0x311240(_0x3f9601['error'](0x1f4,_0xc3a6a6[_0x9997('0x18')]));});});};exports[_0x9997('0x26')]=function(_0x4af455){return new Promise(function(_0x4922f6,_0x4b1fba){return db[_0x9997('0x1a')][_0x9997('0x27')]({'where':_0x4af455[_0x9997('0x1d')]?_0x4af455[_0x9997('0x1d')][_0x9997('0x1f')]||null:null})['then'](function(_0x2f102f){if(_0x2f102f){return _0x2f102f[_0x9997('0x28')](_0x4af455[_0x9997('0x1c')][_0x9997('0x29')],_[_0x9997('0x2a')](_0x4af455['body'],[_0x9997('0x29'),'id'])||{});}})['spread'](function(_0x2f6534){logger['info'](_0x9997('0x2b'),_0x4af455);logger[_0x9997('0x23')](_0x9997('0x2b'),_0x4af455,JSON[_0x9997('0x24')](_0x2f6534));_0x4922f6(_0x2f6534);})[_0x9997('0x25')](function(_0x2cb677){logger[_0x9997('0x16')](_0x9997('0x2b'),_0x2cb677[_0x9997('0x18')],_0x4af455);_0x4b1fba(_this[_0x9997('0x16')](0x1f4,_0x2cb677[_0x9997('0x18')]));});});}; \ No newline at end of file +var _0x1e9c=['message','result','catch','ChatInteraction','update','body','options','raw','where','attributes','limit','then','UpdateChatInteraction','AddTagsToChatInteraction','find','addTags','omit','ids','spread','AddTags','lodash','moment','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x1e9c,0x133));var _0xc1e9=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x1e9c[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0xc1e9('0x0'));var util=require('util');var moment=require(_0xc1e9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc1e9('0x2'));var db=require(_0xc1e9('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc1e9('0x4'));var config=require(_0xc1e9('0x5'));var jayson=require(_0xc1e9('0x6'));var client=jayson['client'][_0xc1e9('0x7')]({'port':0x232a});config[_0xc1e9('0x8')]=_[_0xc1e9('0x9')](config[_0xc1e9('0x8')],{'host':_0xc1e9('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc1e9('0x8')]));require('./chatInteraction.socket')[_0xc1e9('0xb')](socket);function respondWithRpcPromise(_0x34a936,_0x2430f3,_0x36ae0e){return new BPromise(function(_0x16b827,_0x5c785b){return client[_0xc1e9('0xc')](_0x34a936,_0x36ae0e)['then'](function(_0x256eb9){logger[_0xc1e9('0xd')](_0xc1e9('0xe'),_0x2430f3,_0xc1e9('0xf'));logger[_0xc1e9('0x10')](_0xc1e9('0x11'),_0x2430f3,'request\x20sent',JSON[_0xc1e9('0x12')](_0x256eb9));if(_0x256eb9['error']){if(_0x256eb9[_0xc1e9('0x13')][_0xc1e9('0x14')]===0x1f4){logger[_0xc1e9('0x13')](_0xc1e9('0xe'),_0x2430f3,_0x256eb9[_0xc1e9('0x13')][_0xc1e9('0x15')]);return _0x5c785b(_0x256eb9['error']['message']);}logger[_0xc1e9('0x13')](_0xc1e9('0xe'),_0x2430f3,_0x256eb9[_0xc1e9('0x13')][_0xc1e9('0x15')]);return _0x16b827(_0x256eb9[_0xc1e9('0x13')][_0xc1e9('0x15')]);}else{logger[_0xc1e9('0xd')](_0xc1e9('0xe'),_0x2430f3,_0xc1e9('0xf'));_0x16b827(_0x256eb9[_0xc1e9('0x16')][_0xc1e9('0x15')]);}})[_0xc1e9('0x17')](function(_0x5b6404){logger['error'](_0xc1e9('0xe'),_0x2430f3,_0x5b6404);_0x5c785b(_0x5b6404);});});}exports['UpdateChatInteraction']=function(_0x51b6cc){var _0x42167d=this;return new Promise(function(_0x4c342f,_0x4e923d){return db[_0xc1e9('0x18')][_0xc1e9('0x19')](_0x51b6cc[_0xc1e9('0x1a')],{'raw':_0x51b6cc['options']?_0x51b6cc[_0xc1e9('0x1b')][_0xc1e9('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51b6cc['options']?_0x51b6cc['options'][_0xc1e9('0x1d')]||null:null,'attributes':_0x51b6cc[_0xc1e9('0x1b')]?_0x51b6cc['options'][_0xc1e9('0x1e')]||null:null,'limit':_0x51b6cc['options']?_0x51b6cc[_0xc1e9('0x1b')][_0xc1e9('0x1f')]||null:null})[_0xc1e9('0x20')](function(_0x2829bb){logger[_0xc1e9('0xd')](_0xc1e9('0x21'),_0x51b6cc);logger[_0xc1e9('0x10')](_0xc1e9('0x21'),_0x51b6cc,JSON['stringify'](_0x2829bb));_0x4c342f(_0x2829bb);})['catch'](function(_0xd93223){logger[_0xc1e9('0x13')](_0xc1e9('0x21'),_0xd93223[_0xc1e9('0x15')],_0x51b6cc);_0x4e923d(_0x42167d['error'](0x1f4,_0xd93223['message']));});});};exports[_0xc1e9('0x22')]=function(_0x495481){return new Promise(function(_0x1fe49e,_0x363c39){return db[_0xc1e9('0x18')][_0xc1e9('0x23')]({'where':_0x495481[_0xc1e9('0x1b')]?_0x495481[_0xc1e9('0x1b')][_0xc1e9('0x1d')]||null:null})[_0xc1e9('0x20')](function(_0x2a3fd3){if(_0x2a3fd3){return _0x2a3fd3[_0xc1e9('0x24')](_0x495481[_0xc1e9('0x1a')]['ids'],_[_0xc1e9('0x25')](_0x495481[_0xc1e9('0x1a')],[_0xc1e9('0x26'),'id'])||{});}})[_0xc1e9('0x27')](function(_0x2af7bc){logger['info'](_0xc1e9('0x28'),_0x495481);logger[_0xc1e9('0x10')](_0xc1e9('0x28'),_0x495481,JSON[_0xc1e9('0x12')](_0x2af7bc));_0x1fe49e(_0x2af7bc);})['catch'](function(_0xb3f29d){logger[_0xc1e9('0x13')](_0xc1e9('0x28'),_0xb3f29d[_0xc1e9('0x15')],_0x495481);_0x363c39(_this[_0xc1e9('0x13')](0x1f4,_0xb3f29d[_0xc1e9('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 3f86a10..34fc617 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 _0x9348=['chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x2e8ce7,_0x40ef19){var _0x563d95=function(_0x118ec0){while(--_0x118ec0){_0x2e8ce7['push'](_0x2e8ce7['shift']());}};_0x563d95(++_0x40ef19);}(_0x9348,0x160));var _0x8934=function(_0x43058d,_0x567311){_0x43058d=_0x43058d-0x0;var _0x2793d3=_0x9348[_0x43058d];return _0x2793d3;};'use strict';var ChatInteractionEvents=require(_0x8934('0x0'));var events=[_0x8934('0x1'),_0x8934('0x2'),_0x8934('0x3')];function createListener(_0xc7aa75,_0x48c51d){return function(_0x39979e){_0x48c51d[_0x8934('0x4')](_0xc7aa75,_0x39979e);};}function removeListener(_0x386b51,_0xed8e23){return function(){ChatInteractionEvents[_0x8934('0x5')](_0x386b51,_0xed8e23);};}exports[_0x8934('0x6')]=function(_0x3bb404){for(var _0x5ae829=0x0,_0x4420a7=events[_0x8934('0x7')];_0x5ae829<_0x4420a7;_0x5ae829++){var _0x3fc698=events[_0x5ae829];var _0x533196=createListener(_0x8934('0x8')+_0x3fc698,_0x3bb404);ChatInteractionEvents['on'](_0x3fc698,_0x533196);}}; \ No newline at end of file +var _0x22c5=['remove','removeListener','register','length','chatInteraction:'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x22c5,0x6e));var _0x522c=function(_0x156098,_0x3bf5e4){_0x156098=_0x156098-0x0;var _0x146fae=_0x22c5[_0x156098];return _0x146fae;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save',_0x522c('0x0'),'update'];function createListener(_0x4a314d,_0x26aaf5){return function(_0x510943){_0x26aaf5['emit'](_0x4a314d,_0x510943);};}function removeListener(_0x561452,_0x549f75){return function(){ChatInteractionEvents[_0x522c('0x1')](_0x561452,_0x549f75);};}exports[_0x522c('0x2')]=function(_0x84e973){for(var _0x3be57e=0x0,_0x1ecf19=events[_0x522c('0x3')];_0x3be57e<_0x1ecf19;_0x3be57e++){var _0x484e03=events[_0x3be57e];var _0x4d495e=createListener(_0x522c('0x4')+_0x484e03,_0x84e973);ChatInteractionEvents['on'](_0x484e03,_0x4d495e);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index d6dec71..72707df 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 _0x4c91=['now','originalname','replace','single','file','/:id/messages','addMessage','/:id/tags','tracked','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','express','Router','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/attachment_download','getMessages','isChatInteractionAuthorized','getMyMessages','/:id/download','download','post','/:id/vidaoo','createVidaooSession','diskStorage','root','server/files/attachments/'];(function(_0x13f4a3,_0x5139b2){var _0x51b1d9=function(_0x4291e3){while(--_0x4291e3){_0x13f4a3['push'](_0x13f4a3['shift']());}};_0x51b1d9(++_0x5139b2);}(_0x4c91,0x191));var _0x14c9=function(_0x5ab5e0,_0x36bdf5){_0x5ab5e0=_0x5ab5e0-0x0;var _0x16ecd4=_0x4c91[_0x5ab5e0];return _0x16ecd4;};'use strict';var multer=require(_0x14c9('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x14c9('0x1'));var router=express[_0x14c9('0x2')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x14c9('0x3'));router[_0x14c9('0x4')]('/',auth[_0x14c9('0x5')](),controller[_0x14c9('0x6')]);router['get'](_0x14c9('0x7'),auth[_0x14c9('0x5')](),controller[_0x14c9('0x8')]);router['get'](_0x14c9('0x9'),auth['isChatInteractionAuthorized'](),controller['show']);router[_0x14c9('0x4')](_0x14c9('0xa'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0x14c9('0x4')]('/:id/messages',auth[_0x14c9('0x5')](),controller[_0x14c9('0xb')]);router['get']('/:id/my_messages',auth[_0x14c9('0xc')](),controller[_0x14c9('0xd')]);router['get'](_0x14c9('0xe'),auth[_0x14c9('0x5')](),controller[_0x14c9('0xf')]);router['post']('/',auth[_0x14c9('0x5')](),controller['create']);router[_0x14c9('0x10')](_0x14c9('0x11'),auth[_0x14c9('0x5')](),controller[_0x14c9('0x12')]);var upload=multer({'storage':multer[_0x14c9('0x13')]({'destination':function(_0x1815eb,_0x2ad90e,_0x5d6af0){_0x5d6af0(null,path['join'](config[_0x14c9('0x14')],_0x14c9('0x15')));},'filename':function(_0x27f86d,_0x1d1cc8,_0xf5c322){_0xf5c322(null,util['format']('%s-%s',Date[_0x14c9('0x16')](),_0x1d1cc8[_0x14c9('0x17')][_0x14c9('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x14c9('0x10')]('/:id/attachment_upload',upload[_0x14c9('0x19')](_0x14c9('0x1a')),controller['attachmentUpload']);router[_0x14c9('0x10')](_0x14c9('0x1b'),auth[_0x14c9('0xc')](),controller[_0x14c9('0x1c')]);router[_0x14c9('0x10')](_0x14c9('0x1d'),auth['isAuthenticated'](),interaction[_0x14c9('0x1e')](_0x14c9('0x1f'),'chatinteraction:addtags'),controller[_0x14c9('0x20')]);router[_0x14c9('0x21')](_0x14c9('0x9'),auth['isAuthenticated'](),interaction[_0x14c9('0x1e')]('chat',_0x14c9('0x22')),controller[_0x14c9('0x23')]);router[_0x14c9('0x21')](_0x14c9('0x24'),controller[_0x14c9('0x25')]);router['put'](_0x14c9('0x26'),auth[_0x14c9('0xc')](),controller[_0x14c9('0x27')]);router[_0x14c9('0x21')](_0x14c9('0x28'),controller[_0x14c9('0x29')]);router[_0x14c9('0x2a')]('/:id',auth[_0x14c9('0x5')](),interaction[_0x14c9('0x1e')](_0x14c9('0x1f'),_0x14c9('0x2b')),controller[_0x14c9('0x2c')]);router['delete']('/:id/tags',auth[_0x14c9('0x5')](),controller[_0x14c9('0x2d')]);module[_0x14c9('0x2e')]=router; \ No newline at end of file +var _0x6d3e=['../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','/:id/vidaoo','join','format','originalname','file','/:id/tags','tracked','chat','addTags','put','/:id','chatinteraction:update','/:id/custom_update','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','removeTags','exports','multer','Router','fs-extra','../../components/auth/service'];(function(_0x344f5c,_0x20945c){var _0x40ff5f=function(_0x2323bd){while(--_0x2323bd){_0x344f5c['push'](_0x344f5c['shift']());}};_0x40ff5f(++_0x20945c);}(_0x6d3e,0x196));var _0xe6d3=function(_0x4ce479,_0x116f2a){_0x4ce479=_0x4ce479-0x0;var _0x38bb9d=_0x6d3e[_0x4ce479];return _0x38bb9d;};'use strict';var multer=require(_0xe6d3('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe6d3('0x1')]();var fs_extra=require(_0xe6d3('0x2'));var auth=require(_0xe6d3('0x3'));var interaction=require(_0xe6d3('0x4'));var config=require(_0xe6d3('0x5'));var controller=require(_0xe6d3('0x6'));router[_0xe6d3('0x7')]('/',auth[_0xe6d3('0x8')](),controller[_0xe6d3('0x9')]);router[_0xe6d3('0x7')](_0xe6d3('0xa'),auth['isAuthenticated'](),controller[_0xe6d3('0xb')]);router[_0xe6d3('0x7')]('/:id',auth[_0xe6d3('0xc')](),controller['show']);router[_0xe6d3('0x7')](_0xe6d3('0xd'),auth[_0xe6d3('0xc')](),controller['attachmentDownload']);router['get'](_0xe6d3('0xe'),auth[_0xe6d3('0x8')](),controller[_0xe6d3('0xf')]);router[_0xe6d3('0x7')](_0xe6d3('0x10'),auth['isChatInteractionAuthorized'](),controller[_0xe6d3('0x11')]);router[_0xe6d3('0x7')](_0xe6d3('0x12'),auth[_0xe6d3('0x8')](),controller['download']);router['post']('/',auth[_0xe6d3('0x8')](),controller['create']);router[_0xe6d3('0x13')](_0xe6d3('0x14'),auth[_0xe6d3('0x8')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x39ee23,_0x11dfb5,_0x152d24){_0x152d24(null,path[_0xe6d3('0x15')](config['root'],'server/files/attachments/'));},'filename':function(_0x59719d,_0x25c5b6,_0x128401){_0x128401(null,util[_0xe6d3('0x16')]('%s-%s',Date['now'](),_0x25c5b6[_0xe6d3('0x17')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload['single'](_0xe6d3('0x18')),controller['attachmentUpload']);router[_0xe6d3('0x13')](_0xe6d3('0xe'),auth[_0xe6d3('0xc')](),controller['addMessage']);router[_0xe6d3('0x13')](_0xe6d3('0x19'),auth['isAuthenticated'](),interaction[_0xe6d3('0x1a')](_0xe6d3('0x1b'),'chatinteraction:addtags'),controller[_0xe6d3('0x1c')]);router[_0xe6d3('0x1d')](_0xe6d3('0x1e'),auth[_0xe6d3('0x8')](),interaction[_0xe6d3('0x1a')](_0xe6d3('0x1b'),_0xe6d3('0x1f')),controller['update']);router[_0xe6d3('0x1d')](_0xe6d3('0x20'),controller['customUpdate']);router[_0xe6d3('0x1d')](_0xe6d3('0x21'),auth[_0xe6d3('0xc')](),controller[_0xe6d3('0x22')]);router[_0xe6d3('0x1d')](_0xe6d3('0x23'),controller[_0xe6d3('0x24')]);router[_0xe6d3('0x25')](_0xe6d3('0x1e'),auth['isAuthenticated'](),interaction[_0xe6d3('0x1a')](_0xe6d3('0x1b'),_0xe6d3('0x26')),controller['destroy']);router['delete'](_0xe6d3('0x19'),auth[_0xe6d3('0x8')](),controller[_0xe6d3('0x27')]);module[_0xe6d3('0x28')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 8290766..592c4ac 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 _0xb689=['exports','TEXT','medium','BOOLEAN','sequelize'];(function(_0xa00a06,_0x163e41){var _0x45d3e5=function(_0x2885f8){while(--_0x2885f8){_0xa00a06['push'](_0xa00a06['shift']());}};_0x45d3e5(++_0x163e41);}(_0xb689,0x95));var _0x9b68=function(_0x1da709,_0x1eddb9){_0x1da709=_0x1da709-0x0;var _0x17e59c=_0xb689[_0x1da709];return _0x17e59c;};'use strict';var Sequelize=require(_0x9b68('0x0'));module[_0x9b68('0x1')]={'body':{'type':Sequelize[_0x9b68('0x2')](_0x9b68('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x9b68('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x137a=['TEXT','medium','INTEGER','exports'];(function(_0x153279,_0x390c38){var _0x344843=function(_0x32fa22){while(--_0x32fa22){_0x153279['push'](_0x153279['shift']());}};_0x344843(++_0x390c38);}(_0x137a,0x177));var _0xa137=function(_0x1ebf92,_0x5c3ce0){_0x1ebf92=_0x1ebf92-0x0;var _0x554e1c=_0x137a[_0x1ebf92];return _0x554e1c;};'use strict';var Sequelize=require('sequelize');module[_0xa137('0x0')]={'body':{'type':Sequelize[_0xa137('0x1')](_0xa137('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa137('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index a7b225c..67cf2fd 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 _0xc8d5=['options','find','create','body','describe','get','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','role','userpic','internal','online','allowmessenger','showWebBar','-online','VoiceQueue','user','UserProfileSection','Agents','userProfileId','autoAssociation','resourceId','push','createdAt','ToId','read','eml-format','zip-dir','request-promise','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','map','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','type','filter','ChatInternalMessage','includeAll','include','findAll','rows','catch','params','rawAttributes','keys'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc8d5,0x1b7));var _0x5c8d=function(_0x166eda,_0x5f0071){_0x166eda=_0x166eda-0x0;var _0x1661c7=_0xc8d5[_0x166eda];return _0x1661c7;};'use strict';var emlformat=require(_0x5c8d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5c8d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5c8d('0x2'));var moment=require(_0x5c8d('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x5c8d('0x4'));var path=require(_0x5c8d('0x5'));var sox=require(_0x5c8d('0x6'));var csv=require(_0x5c8d('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5c8d('0x8'));var _=require(_0x5c8d('0x9'));var squel=require(_0x5c8d('0xa'));var crypto=require(_0x5c8d('0xb'));var jsforce=require(_0x5c8d('0xc'));var deskjs=require(_0x5c8d('0xd'));var toCsv=require(_0x5c8d('0x7'));var querystring=require(_0x5c8d('0xe'));var Papa=require(_0x5c8d('0xf'));var Redis=require(_0x5c8d('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5c8d('0x11'));var hardwareService=require(_0x5c8d('0x12'));var logger=require(_0x5c8d('0x13'))(_0x5c8d('0x14'));var utils=require(_0x5c8d('0x15'));var config=require(_0x5c8d('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x5c8d('0x17')]=_[_0x5c8d('0x18')](config[_0x5c8d('0x17')],{'host':_0x5c8d('0x19'),'port':0x18eb});var socket=require(_0x5c8d('0x1a'))(new Redis(config[_0x5c8d('0x17')]));require(_0x5c8d('0x1b'))['register'](socket);function respondWithStatusCode(_0x2c3d07,_0x4f70e8){_0x4f70e8=_0x4f70e8||0xcc;return function(_0x5aa99a){if(_0x5aa99a){return _0x2c3d07['sendStatus'](_0x4f70e8);}return _0x2c3d07[_0x5c8d('0x1c')](_0x4f70e8)[_0x5c8d('0x1d')]();};}function respondWithResult(_0x2f6da2,_0x4102b6){_0x4102b6=_0x4102b6||0xc8;return function(_0x89181f){if(_0x89181f){return _0x2f6da2[_0x5c8d('0x1c')](_0x4102b6)[_0x5c8d('0x1e')](_0x89181f);}};}function respondWithFilteredResult(_0x52e9aa,_0x4c7c1f){return function(_0x36b00f){if(_0x36b00f){var _0xc99a5b=typeof _0x4c7c1f['offset']==='undefined'&&typeof _0x4c7c1f[_0x5c8d('0x1f')]===_0x5c8d('0x20');var _0x4168c4=_0x36b00f[_0x5c8d('0x21')];var _0x5bd34b=_0xc99a5b?0x0:_0x4c7c1f[_0x5c8d('0x22')];var _0x3e9010=_0xc99a5b?_0x36b00f[_0x5c8d('0x21')]:_0x4c7c1f['offset']+_0x4c7c1f['limit'];var _0x47a83f;if(_0x3e9010>=_0x4168c4){_0x3e9010=_0x4168c4;_0x47a83f=0xc8;}else{_0x47a83f=0xce;}_0x52e9aa[_0x5c8d('0x1c')](_0x47a83f);return _0x52e9aa[_0x5c8d('0x23')]('Content-Range',_0x5bd34b+'-'+_0x3e9010+'/'+_0x4168c4)['json'](_0x36b00f);}return null;};}function patchUpdates(_0x44d9e5){return function(_0x5ed207){try{jsonpatch[_0x5c8d('0x24')](_0x5ed207,_0x44d9e5,!![]);}catch(_0x5a58ad){return BPromise[_0x5c8d('0x25')](_0x5a58ad);}return _0x5ed207[_0x5c8d('0x26')]();};}function saveUpdates(_0x4339e4,_0x3e4031){return function(_0x5eade5){if(_0x5eade5){return _0x5eade5[_0x5c8d('0x27')](_0x4339e4)[_0x5c8d('0x28')](function(_0x3fe870){return _0x3fe870;});}return null;};}function removeEntity(_0x3f1958,_0x3f68ba){return function(_0x2741d4){if(_0x2741d4){return _0x2741d4[_0x5c8d('0x29')]()['then'](function(){_0x3f1958[_0x5c8d('0x1c')](0xcc)[_0x5c8d('0x1d')]();});}};}function handleEntityNotFound(_0x5ae294,_0x2a66b4){return function(_0x22a1a1){if(!_0x22a1a1){_0x5ae294['sendStatus'](0x194);}return _0x22a1a1;};}function handleError(_0x5dd572,_0x30992e){_0x30992e=_0x30992e||0x1f4;return function(_0x850cae){logger[_0x5c8d('0x2a')](_0x850cae[_0x5c8d('0x2b')]);if(_0x850cae[_0x5c8d('0x2c')]){delete _0x850cae[_0x5c8d('0x2c')];}_0x5dd572['status'](_0x30992e)['send'](_0x850cae);};}exports['index']=function(_0xc86011,_0x1168cd){var _0x222bae={},_0x33dee2={},_0x41147d={'count':0x0,'rows':[]};var _0x130d93=_[_0x5c8d('0x2d')](db['ChatInternalMessage']['rawAttributes'],function(_0x2397b1){return{'name':_0x2397b1['fieldName'],'type':_0x2397b1['type'][_0x5c8d('0x2e')]};});_0x33dee2[_0x5c8d('0x2f')]=_[_0x5c8d('0x2d')](_0x130d93,_0x5c8d('0x2c'));_0x33dee2[_0x5c8d('0x30')]=_['keys'](_0xc86011[_0x5c8d('0x30')]);_0x33dee2[_0x5c8d('0x31')]=_[_0x5c8d('0x32')](_0x33dee2['model'],_0x33dee2['query']);_0x222bae[_0x5c8d('0x33')]=_[_0x5c8d('0x32')](_0x33dee2[_0x5c8d('0x2f')],qs[_0x5c8d('0x34')](_0xc86011['query'][_0x5c8d('0x34')]));_0x222bae[_0x5c8d('0x33')]=_0x222bae[_0x5c8d('0x33')][_0x5c8d('0x35')]?_0x222bae[_0x5c8d('0x33')]:_0x33dee2['model'];if(!_0xc86011[_0x5c8d('0x30')][_0x5c8d('0x36')](_0x5c8d('0x37'))){_0x222bae[_0x5c8d('0x1f')]=qs[_0x5c8d('0x1f')](_0xc86011[_0x5c8d('0x30')][_0x5c8d('0x1f')]);_0x222bae['offset']=qs[_0x5c8d('0x22')](_0xc86011['query'][_0x5c8d('0x22')]);}_0x222bae['order']=qs[_0x5c8d('0x38')](_0xc86011['query'][_0x5c8d('0x38')]);_0x222bae[_0x5c8d('0x39')]=qs[_0x5c8d('0x31')](_[_0x5c8d('0x3a')](_0xc86011['query'],_0x33dee2[_0x5c8d('0x31')]),_0x130d93);if(_0xc86011[_0x5c8d('0x30')]['filter']){_0x222bae[_0x5c8d('0x39')]=_[_0x5c8d('0x3b')](_0x222bae['where'],{'$or':_[_0x5c8d('0x2d')](_0x130d93,function(_0x3e71be){if(_0x3e71be[_0x5c8d('0x3c')]!=='VIRTUAL'){var _0xbb1c6c={};_0xbb1c6c[_0x3e71be[_0x5c8d('0x2c')]]={'$like':'%'+_0xc86011[_0x5c8d('0x30')][_0x5c8d('0x3d')]+'%'};return _0xbb1c6c;}})});}_0x222bae=_[_0x5c8d('0x3b')]({},_0x222bae,_0xc86011['options']);var _0x1389a0={'where':_0x222bae[_0x5c8d('0x39')]};return db[_0x5c8d('0x3e')][_0x5c8d('0x21')](_0x1389a0)['then'](function(_0x1b33c8){_0x41147d[_0x5c8d('0x21')]=_0x1b33c8;if(_0xc86011[_0x5c8d('0x30')][_0x5c8d('0x3f')]){_0x222bae[_0x5c8d('0x40')]=[{'all':!![]}];}return db[_0x5c8d('0x3e')][_0x5c8d('0x41')](_0x222bae);})['then'](function(_0x2af939){_0x41147d[_0x5c8d('0x42')]=_0x2af939;return _0x41147d;})[_0x5c8d('0x28')](respondWithFilteredResult(_0x1168cd,_0x222bae))[_0x5c8d('0x43')](handleError(_0x1168cd,null));};exports['show']=function(_0xb0dbce,_0x367bce){var _0x17c593={'raw':!![],'where':{'id':_0xb0dbce[_0x5c8d('0x44')]['id']}},_0x4dc025={};_0x4dc025[_0x5c8d('0x2f')]=_['keys'](db[_0x5c8d('0x3e')][_0x5c8d('0x45')]);_0x4dc025[_0x5c8d('0x30')]=_[_0x5c8d('0x46')](_0xb0dbce[_0x5c8d('0x30')]);_0x4dc025['filters']=_[_0x5c8d('0x32')](_0x4dc025[_0x5c8d('0x2f')],_0x4dc025[_0x5c8d('0x30')]);_0x17c593[_0x5c8d('0x33')]=_[_0x5c8d('0x32')](_0x4dc025[_0x5c8d('0x2f')],qs[_0x5c8d('0x34')](_0xb0dbce[_0x5c8d('0x30')][_0x5c8d('0x34')]));_0x17c593['attributes']=_0x17c593['attributes'][_0x5c8d('0x35')]?_0x17c593['attributes']:_0x4dc025[_0x5c8d('0x2f')];if(_0xb0dbce[_0x5c8d('0x30')][_0x5c8d('0x3f')]){_0x17c593['include']=[{'all':!![]}];}_0x17c593=_['merge']({},_0x17c593,_0xb0dbce[_0x5c8d('0x47')]);return db[_0x5c8d('0x3e')][_0x5c8d('0x48')](_0x17c593)[_0x5c8d('0x28')](handleEntityNotFound(_0x367bce,null))[_0x5c8d('0x28')](respondWithResult(_0x367bce,null))[_0x5c8d('0x43')](handleError(_0x367bce,null));};exports[_0x5c8d('0x49')]=function(_0x327a8d,_0x17da63){return db['ChatInternalMessage'][_0x5c8d('0x49')](_0x327a8d[_0x5c8d('0x4a')],{})['then'](respondWithResult(_0x17da63,0xc9))[_0x5c8d('0x43')](handleError(_0x17da63,null));};exports[_0x5c8d('0x27')]=function(_0x419d31,_0x177273){if(_0x419d31[_0x5c8d('0x4a')]['id']){delete _0x419d31[_0x5c8d('0x4a')]['id'];}return db[_0x5c8d('0x3e')]['find']({'where':{'id':_0x419d31[_0x5c8d('0x44')]['id']}})['then'](handleEntityNotFound(_0x177273,null))[_0x5c8d('0x28')](saveUpdates(_0x419d31[_0x5c8d('0x4a')],null))[_0x5c8d('0x28')](respondWithResult(_0x177273,null))[_0x5c8d('0x43')](handleError(_0x177273,null));};exports[_0x5c8d('0x29')]=function(_0x21c84f,_0x2630ad){return db[_0x5c8d('0x3e')][_0x5c8d('0x48')]({'where':{'id':_0x21c84f[_0x5c8d('0x44')]['id']}})['then'](handleEntityNotFound(_0x2630ad,null))[_0x5c8d('0x28')](removeEntity(_0x2630ad,null))['catch'](handleError(_0x2630ad,null));};exports[_0x5c8d('0x4b')]=function(_0x52c977,_0xea48ba){return db[_0x5c8d('0x3e')][_0x5c8d('0x4b')]()[_0x5c8d('0x28')](respondWithResult(_0xea48ba,null))[_0x5c8d('0x43')](handleError(_0xea48ba,null));};function wrapUser(_0x2dbc34){return function(_0xf602cf){var _0x17bddd=_0x2dbc34[_0x5c8d('0x4c')]({'plain':!![]});_0x17bddd['messages']=[];if(_0xf602cf){_0x17bddd[_0x5c8d('0x4d')]=_0xf602cf['createdAt'];_0x17bddd['lastMessage']=_0xf602cf;}else{_0x17bddd[_0x5c8d('0x4d')]=moment(0x0)[_0x5c8d('0x4e')](_0x5c8d('0x4f'));_0x17bddd[_0x5c8d('0x50')]={};}return _0x17bddd;};}exports[_0x5c8d('0x51')]=function(_0x59100a,_0x3f28e6,_0x4580fc){var _0x3ce5f0=[];return db[_0x5c8d('0x52')][_0x5c8d('0x41')]({'where':{'role':[_0x5c8d('0x53'),'admin','user']},'attributes':['id','fullname',_0x5c8d('0x2c'),_0x5c8d('0x54'),_0x5c8d('0x55'),_0x5c8d('0x56'),_0x5c8d('0x57'),'lastLoginAt',_0x5c8d('0x58'),_0x5c8d('0x59')],'order':qs[_0x5c8d('0x38')](_0x5c8d('0x5a')),'include':[{'model':db[_0x5c8d('0x5b')],'as':'VoiceQueues','attributes':['id','name','type'],'through':{'attributes':[]}}]})['then'](function(_0x4c01e9){if(_0x4c01e9){var _0x3728d1=_0x59100a[_0x5c8d('0x5c')][_0x5c8d('0x4c')]({'plain':!![]});if(!_0x3728d1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3728d1[_0x5c8d('0x54')]===_0x5c8d('0x5c')){return db[_0x5c8d('0x5d')][_0x5c8d('0x48')]({'where':{'name':_0x5c8d('0x5e'),'userProfileId':_0x3728d1[_0x5c8d('0x5f')]},'raw':!![]})[_0x5c8d('0x28')](function(_0x206605){if(_0x206605){if(_0x206605[_0x5c8d('0x60')]===0x0){return db['UserProfileResource'][_0x5c8d('0x41')]({'where':{'sectionId':_0x206605['id']},'raw':!![]})[_0x5c8d('0x28')](function(_0x4c591e){var _0xca5c8d=[];if(_['isEmpty'](_0x4c591e)){_0xca5c8d=_[_0x5c8d('0x3d')](_0x4c01e9,function(_0x122f43){if(_0x122f43[_0x5c8d('0x54')]!==_0x5c8d('0x53')){return _0x122f43;}});return _0xca5c8d;}else{for(var _0x2f4443=0x0;_0x2f4443<_0x4c01e9[_0x5c8d('0x35')];_0x2f4443++){var _0x5f16ec=_0x4c01e9[_0x2f4443];if(_0x5f16ec[_0x5c8d('0x54')]===_0x5c8d('0x53')){var _0xd7ae7c=_[_0x5c8d('0x48')](_0x4c591e,function(_0x417197){return _0x417197[_0x5c8d('0x61')]===_0x5f16ec['id'];});if(_0xd7ae7c)_0xca5c8d['push'](_0x5f16ec);}else{_0xca5c8d[_0x5c8d('0x62')](_0x5f16ec);}}return _0xca5c8d;}});}else{return _0x4c01e9;}}else{var _0x53f4e9=_[_0x5c8d('0x3d')](_0x4c01e9,function(_0x3830fa){if(_0x3830fa[_0x5c8d('0x54')]!==_0x5c8d('0x53')){return _0x3830fa;}});return _0x53f4e9;}});}else{return _0x4c01e9;}}})[_0x5c8d('0x28')](function(_0x4d65b9){var _0x3c30ce=[];if(_0x4d65b9){_0x3ce5f0=_0x4d65b9;for(var _0x169a12=0x0;_0x169a12<_0x4d65b9[_0x5c8d('0x35')];_0x169a12+=0x1){_0x3ce5f0[_0x169a12]['messages']=[];_0x3c30ce[_0x5c8d('0x62')](db[_0x5c8d('0x3e')][_0x5c8d('0x48')]({'where':{'FromId':[_0x59100a[_0x5c8d('0x5c')]['id'],_0x4d65b9[_0x169a12]['id']],'ToId':[_0x59100a[_0x5c8d('0x5c')]['id'],_0x4d65b9[_0x169a12]['id']],'ChatGroupId':null},'attributes':['id',_0x5c8d('0x63'),'FromId',_0x5c8d('0x64'),_0x5c8d('0x65'),_0x5c8d('0x4a')],'order':qs[_0x5c8d('0x38')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x5c8d('0x28')](wrapUser(_0x4d65b9[_0x169a12])));}return BPromise['all'](_0x3c30ce);}return[];})['then'](function(_0xefbe00){return{'rows':_0xefbe00,'count':_0xefbe00['length']};})[_0x5c8d('0x28')](respondWithResult(_0x3f28e6,null))[_0x5c8d('0x43')](handleError(_0x3f28e6,null));}; \ No newline at end of file +var _0x3013=['index','map','ChatInternalMessage','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','include','findAll','then','rows','catch','params','rawAttributes','includeAll','options','find','create','body','describe','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','fullname','role','userpic','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','UserProfileResource','agent','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name'];(function(_0x44feb5,_0x3f7964){var _0x45e3b8=function(_0x2848be){while(--_0x2848be){_0x44feb5['push'](_0x44feb5['shift']());}};_0x45e3b8(++_0x3f7964);}(_0x3013,0x128));var _0x3301=function(_0x3e7a88,_0x3c9aa0){_0x3e7a88=_0x3e7a88-0x0;var _0x307a3b=_0x3013[_0x3e7a88];return _0x307a3b;};'use strict';var emlformat=require(_0x3301('0x0'));var rimraf=require(_0x3301('0x1'));var zipdir=require(_0x3301('0x2'));var jsonpatch=require(_0x3301('0x3'));var rp=require(_0x3301('0x4'));var moment=require(_0x3301('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3301('0x6'));var path=require(_0x3301('0x7'));var sox=require(_0x3301('0x8'));var csv=require('to-csv');var ejs=require(_0x3301('0x9'));var fs=require('fs');var fs_extra=require(_0x3301('0xa'));var _=require(_0x3301('0xb'));var squel=require(_0x3301('0xc'));var crypto=require(_0x3301('0xd'));var jsforce=require(_0x3301('0xe'));var deskjs=require(_0x3301('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3301('0x10'));var Papa=require('papaparse');var Redis=require(_0x3301('0x11'));var authService=require(_0x3301('0x12'));var qs=require(_0x3301('0x13'));var as=require(_0x3301('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3301('0x15'))(_0x3301('0x16'));var utils=require(_0x3301('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3301('0x18'));var db=require(_0x3301('0x19'))['db'];config[_0x3301('0x1a')]=_['defaults'](config[_0x3301('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x3301('0x1b'))(new Redis(config[_0x3301('0x1a')]));require(_0x3301('0x1c'))['register'](socket);function respondWithStatusCode(_0x4e1f97,_0x233cd5){_0x233cd5=_0x233cd5||0xcc;return function(_0x4003f5){if(_0x4003f5){return _0x4e1f97[_0x3301('0x1d')](_0x233cd5);}return _0x4e1f97[_0x3301('0x1e')](_0x233cd5)[_0x3301('0x1f')]();};}function respondWithResult(_0x328842,_0x1349d5){_0x1349d5=_0x1349d5||0xc8;return function(_0xc7a6a7){if(_0xc7a6a7){return _0x328842[_0x3301('0x1e')](_0x1349d5)[_0x3301('0x20')](_0xc7a6a7);}};}function respondWithFilteredResult(_0x2d0082,_0x4e27db){return function(_0x6a09eb){if(_0x6a09eb){var _0x23a78c=typeof _0x4e27db[_0x3301('0x21')]===_0x3301('0x22')&&typeof _0x4e27db[_0x3301('0x23')]===_0x3301('0x22');var _0x46fdd9=_0x6a09eb[_0x3301('0x24')];var _0x237b5e=_0x23a78c?0x0:_0x4e27db[_0x3301('0x21')];var _0x27e957=_0x23a78c?_0x6a09eb['count']:_0x4e27db[_0x3301('0x21')]+_0x4e27db[_0x3301('0x23')];var _0x4df357;if(_0x27e957>=_0x46fdd9){_0x27e957=_0x46fdd9;_0x4df357=0xc8;}else{_0x4df357=0xce;}_0x2d0082['status'](_0x4df357);return _0x2d0082[_0x3301('0x25')](_0x3301('0x26'),_0x237b5e+'-'+_0x27e957+'/'+_0x46fdd9)[_0x3301('0x20')](_0x6a09eb);}return null;};}function patchUpdates(_0x4c8534){return function(_0x7ce5ce){try{jsonpatch[_0x3301('0x27')](_0x7ce5ce,_0x4c8534,!![]);}catch(_0x493134){return BPromise[_0x3301('0x28')](_0x493134);}return _0x7ce5ce[_0x3301('0x29')]();};}function saveUpdates(_0x44b423,_0x3524c8){return function(_0x26659b){if(_0x26659b){return _0x26659b[_0x3301('0x2a')](_0x44b423)['then'](function(_0x5410f3){return _0x5410f3;});}return null;};}function removeEntity(_0x2a1324,_0x31a0d3){return function(_0x4920ae){if(_0x4920ae){return _0x4920ae[_0x3301('0x2b')]()['then'](function(){_0x2a1324[_0x3301('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c293a,_0xbdc072){return function(_0x54b25e){if(!_0x54b25e){_0x4c293a['sendStatus'](0x194);}return _0x54b25e;};}function handleError(_0x4b6ca0,_0x5ed27a){_0x5ed27a=_0x5ed27a||0x1f4;return function(_0xe97b9b){logger['error'](_0xe97b9b[_0x3301('0x2c')]);if(_0xe97b9b[_0x3301('0x2d')]){delete _0xe97b9b['name'];}_0x4b6ca0[_0x3301('0x1e')](_0x5ed27a)['send'](_0xe97b9b);};}exports[_0x3301('0x2e')]=function(_0x56d7a1,_0x1be18e){var _0x30d525={},_0x52cf43={},_0x599d7d={'count':0x0,'rows':[]};var _0x59a2be=_[_0x3301('0x2f')](db[_0x3301('0x30')]['rawAttributes'],function(_0x2c6bcc){return{'name':_0x2c6bcc[_0x3301('0x31')],'type':_0x2c6bcc[_0x3301('0x32')][_0x3301('0x33')]};});_0x52cf43[_0x3301('0x34')]=_[_0x3301('0x2f')](_0x59a2be,_0x3301('0x2d'));_0x52cf43[_0x3301('0x35')]=_[_0x3301('0x36')](_0x56d7a1['query']);_0x52cf43['filters']=_[_0x3301('0x37')](_0x52cf43['model'],_0x52cf43['query']);_0x30d525['attributes']=_[_0x3301('0x37')](_0x52cf43[_0x3301('0x34')],qs[_0x3301('0x38')](_0x56d7a1[_0x3301('0x35')][_0x3301('0x38')]));_0x30d525[_0x3301('0x39')]=_0x30d525[_0x3301('0x39')][_0x3301('0x3a')]?_0x30d525[_0x3301('0x39')]:_0x52cf43['model'];if(!_0x56d7a1[_0x3301('0x35')][_0x3301('0x3b')]('nolimit')){_0x30d525[_0x3301('0x23')]=qs[_0x3301('0x23')](_0x56d7a1['query'][_0x3301('0x23')]);_0x30d525[_0x3301('0x21')]=qs['offset'](_0x56d7a1[_0x3301('0x35')][_0x3301('0x21')]);}_0x30d525[_0x3301('0x3c')]=qs['sort'](_0x56d7a1[_0x3301('0x35')][_0x3301('0x3d')]);_0x30d525[_0x3301('0x3e')]=qs[_0x3301('0x3f')](_[_0x3301('0x40')](_0x56d7a1[_0x3301('0x35')],_0x52cf43[_0x3301('0x3f')]),_0x59a2be);if(_0x56d7a1[_0x3301('0x35')]['filter']){_0x30d525['where']=_[_0x3301('0x41')](_0x30d525[_0x3301('0x3e')],{'$or':_[_0x3301('0x2f')](_0x59a2be,function(_0x31cd89){if(_0x31cd89['type']!==_0x3301('0x42')){var _0x457762={};_0x457762[_0x31cd89[_0x3301('0x2d')]]={'$like':'%'+_0x56d7a1[_0x3301('0x35')][_0x3301('0x43')]+'%'};return _0x457762;}})});}_0x30d525=_[_0x3301('0x41')]({},_0x30d525,_0x56d7a1['options']);var _0x182a06={'where':_0x30d525['where']};return db[_0x3301('0x30')]['count'](_0x182a06)['then'](function(_0x5a908c){_0x599d7d[_0x3301('0x24')]=_0x5a908c;if(_0x56d7a1[_0x3301('0x35')]['includeAll']){_0x30d525[_0x3301('0x44')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x3301('0x45')](_0x30d525);})[_0x3301('0x46')](function(_0x5a9d88){_0x599d7d[_0x3301('0x47')]=_0x5a9d88;return _0x599d7d;})['then'](respondWithFilteredResult(_0x1be18e,_0x30d525))[_0x3301('0x48')](handleError(_0x1be18e,null));};exports['show']=function(_0x3d19d4,_0x3f8b42){var _0x5cb2cd={'raw':!![],'where':{'id':_0x3d19d4[_0x3301('0x49')]['id']}},_0x251677={};_0x251677[_0x3301('0x34')]=_['keys'](db['ChatInternalMessage'][_0x3301('0x4a')]);_0x251677[_0x3301('0x35')]=_[_0x3301('0x36')](_0x3d19d4[_0x3301('0x35')]);_0x251677[_0x3301('0x3f')]=_[_0x3301('0x37')](_0x251677[_0x3301('0x34')],_0x251677[_0x3301('0x35')]);_0x5cb2cd[_0x3301('0x39')]=_[_0x3301('0x37')](_0x251677[_0x3301('0x34')],qs[_0x3301('0x38')](_0x3d19d4[_0x3301('0x35')][_0x3301('0x38')]));_0x5cb2cd[_0x3301('0x39')]=_0x5cb2cd[_0x3301('0x39')][_0x3301('0x3a')]?_0x5cb2cd[_0x3301('0x39')]:_0x251677[_0x3301('0x34')];if(_0x3d19d4[_0x3301('0x35')][_0x3301('0x4b')]){_0x5cb2cd['include']=[{'all':!![]}];}_0x5cb2cd=_[_0x3301('0x41')]({},_0x5cb2cd,_0x3d19d4[_0x3301('0x4c')]);return db[_0x3301('0x30')][_0x3301('0x4d')](_0x5cb2cd)[_0x3301('0x46')](handleEntityNotFound(_0x3f8b42,null))[_0x3301('0x46')](respondWithResult(_0x3f8b42,null))[_0x3301('0x48')](handleError(_0x3f8b42,null));};exports[_0x3301('0x4e')]=function(_0x2f4fed,_0x411333){return db[_0x3301('0x30')][_0x3301('0x4e')](_0x2f4fed[_0x3301('0x4f')],{})['then'](respondWithResult(_0x411333,0xc9))['catch'](handleError(_0x411333,null));};exports[_0x3301('0x2a')]=function(_0x4d5d20,_0x277af9){if(_0x4d5d20[_0x3301('0x4f')]['id']){delete _0x4d5d20[_0x3301('0x4f')]['id'];}return db[_0x3301('0x30')][_0x3301('0x4d')]({'where':{'id':_0x4d5d20[_0x3301('0x49')]['id']}})[_0x3301('0x46')](handleEntityNotFound(_0x277af9,null))[_0x3301('0x46')](saveUpdates(_0x4d5d20[_0x3301('0x4f')],null))['then'](respondWithResult(_0x277af9,null))[_0x3301('0x48')](handleError(_0x277af9,null));};exports[_0x3301('0x2b')]=function(_0xd18192,_0x4ba3f5){return db[_0x3301('0x30')][_0x3301('0x4d')]({'where':{'id':_0xd18192['params']['id']}})[_0x3301('0x46')](handleEntityNotFound(_0x4ba3f5,null))['then'](removeEntity(_0x4ba3f5,null))[_0x3301('0x48')](handleError(_0x4ba3f5,null));};exports[_0x3301('0x50')]=function(_0x52c704,_0x5976c3){return db['ChatInternalMessage']['describe']()[_0x3301('0x46')](respondWithResult(_0x5976c3,null))[_0x3301('0x48')](handleError(_0x5976c3,null));};function wrapUser(_0x1020ae){return function(_0xf25db4){var _0xd13eb1=_0x1020ae['get']({'plain':!![]});_0xd13eb1[_0x3301('0x51')]=[];if(_0xf25db4){_0xd13eb1[_0x3301('0x52')]=_0xf25db4[_0x3301('0x53')];_0xd13eb1[_0x3301('0x54')]=_0xf25db4;}else{_0xd13eb1[_0x3301('0x52')]=moment(0x0)[_0x3301('0x55')](_0x3301('0x56'));_0xd13eb1['lastMessage']={};}return _0xd13eb1;};}exports[_0x3301('0x57')]=function(_0x12c212,_0x5e73c8,_0x7beca){var _0x4b505a=[];return db[_0x3301('0x58')][_0x3301('0x45')]({'where':{'role':['agent',_0x3301('0x59'),'user']},'attributes':['id',_0x3301('0x5a'),_0x3301('0x2d'),_0x3301('0x5b'),_0x3301('0x5c'),'internal',_0x3301('0x5d'),_0x3301('0x5e'),_0x3301('0x5f'),_0x3301('0x60')],'order':qs['sort'](_0x3301('0x61')),'include':[{'model':db[_0x3301('0x62')],'as':_0x3301('0x63'),'attributes':['id',_0x3301('0x2d'),'type'],'through':{'attributes':[]}}]})[_0x3301('0x46')](function(_0x14e2d8){if(_0x14e2d8){var _0x527a40=_0x12c212[_0x3301('0x64')][_0x3301('0x65')]({'plain':!![]});if(!_0x527a40)throw new Error(_0x3301('0x66'));if(_0x527a40[_0x3301('0x5b')]==='user'){return db[_0x3301('0x67')]['find']({'where':{'name':_0x3301('0x68'),'userProfileId':_0x527a40['userProfileId']},'raw':!![]})[_0x3301('0x46')](function(_0x37783f){if(_0x37783f){if(_0x37783f[_0x3301('0x69')]===0x0){return db[_0x3301('0x6a')][_0x3301('0x45')]({'where':{'sectionId':_0x37783f['id']},'raw':!![]})[_0x3301('0x46')](function(_0x167ad6){var _0xd0bca7=[];if(_['isEmpty'](_0x167ad6)){_0xd0bca7=_['filter'](_0x14e2d8,function(_0x525b31){if(_0x525b31[_0x3301('0x5b')]!==_0x3301('0x6b')){return _0x525b31;}});return _0xd0bca7;}else{for(var _0x10e212=0x0;_0x10e212<_0x14e2d8[_0x3301('0x3a')];_0x10e212++){var _0x5bd3e3=_0x14e2d8[_0x10e212];if(_0x5bd3e3[_0x3301('0x5b')]==='agent'){var _0x3808a3=_['find'](_0x167ad6,function(_0x53ba89){return _0x53ba89['resourceId']===_0x5bd3e3['id'];});if(_0x3808a3)_0xd0bca7[_0x3301('0x6c')](_0x5bd3e3);}else{_0xd0bca7[_0x3301('0x6c')](_0x5bd3e3);}}return _0xd0bca7;}});}else{return _0x14e2d8;}}else{var _0x501f85=_[_0x3301('0x43')](_0x14e2d8,function(_0x3b125f){if(_0x3b125f[_0x3301('0x5b')]!==_0x3301('0x6b')){return _0x3b125f;}});return _0x501f85;}});}else{return _0x14e2d8;}}})[_0x3301('0x46')](function(_0x3a454a){var _0x26372a=[];if(_0x3a454a){_0x4b505a=_0x3a454a;for(var _0x545263=0x0;_0x545263<_0x3a454a[_0x3301('0x3a')];_0x545263+=0x1){_0x4b505a[_0x545263][_0x3301('0x51')]=[];_0x26372a['push'](db[_0x3301('0x30')][_0x3301('0x4d')]({'where':{'FromId':[_0x12c212[_0x3301('0x64')]['id'],_0x3a454a[_0x545263]['id']],'ToId':[_0x12c212[_0x3301('0x64')]['id'],_0x3a454a[_0x545263]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x3301('0x6d'),_0x3301('0x6e'),_0x3301('0x6f'),_0x3301('0x4f')],'order':qs['sort'](_0x3301('0x70')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3301('0x46')](wrapUser(_0x3a454a[_0x545263])));}return BPromise[_0x3301('0x71')](_0x26372a);}return[];})['then'](function(_0x4d6447){return{'rows':_0x4d6447,'count':_0x4d6447['length']};})['then'](respondWithResult(_0x5e73c8,null))['catch'](handleError(_0x5e73c8,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 7d40d2a..c4e50c4 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 _0xdf97=['hasOwnProperty','hook','exports','../../mysqldb','ChatInternalMessage','setMaxListeners','update','remove','emit'];(function(_0x2df3e3,_0x4358f0){var _0x513853=function(_0x15db16){while(--_0x15db16){_0x2df3e3['push'](_0x2df3e3['shift']());}};_0x513853(++_0x4358f0);}(_0xdf97,0x1ce));var _0x7df9=function(_0x182c6e,_0x31831a){_0x182c6e=_0x182c6e-0x0;var _0xfc0e5c=_0xdf97[_0x182c6e];return _0xfc0e5c;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x7df9('0x0'))['db'][_0x7df9('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x7df9('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7df9('0x3'),'afterDestroy':_0x7df9('0x4')};function emitEvent(_0x3908f8){return function(_0x5a5440,_0x236379,_0x494fb6){ChatInternalMessageEvents[_0x7df9('0x5')](_0x3908f8+':'+_0x5a5440['id'],_0x5a5440);ChatInternalMessageEvents['emit'](_0x3908f8,_0x5a5440);_0x494fb6(null);};}for(var e in events){if(events[_0x7df9('0x6')](e)){var event=events[e];ChatInternalMessage[_0x7df9('0x7')](e,emitEvent(event));}}module[_0x7df9('0x8')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x77cb=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','remove'];(function(_0x1c9b78,_0xc1ba53){var _0x4ac5e7=function(_0x2fecdc){while(--_0x2fecdc){_0x1c9b78['push'](_0x1c9b78['shift']());}};_0x4ac5e7(++_0xc1ba53);}(_0x77cb,0x1e1));var _0xb77c=function(_0x512ead,_0x1f8b25){_0x512ead=_0x512ead-0x0;var _0x250bb0=_0x77cb[_0x512ead];return _0x250bb0;};'use strict';var EventEmitter=require(_0xb77c('0x0'));var ChatInternalMessage=require(_0xb77c('0x1'))['db'][_0xb77c('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb77c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xb77c('0x4')};function emitEvent(_0x24ae55){return function(_0x5533c8,_0x236c21,_0x5ced87){ChatInternalMessageEvents[_0xb77c('0x5')](_0x24ae55+':'+_0x5533c8['id'],_0x5533c8);ChatInternalMessageEvents[_0xb77c('0x5')](_0x24ae55,_0x5533c8);_0x5ced87(null);};}for(var e in events){if(events[_0xb77c('0x6')](e)){var event=events[e];ChatInternalMessage[_0xb77c('0x7')](e,emitEvent(event));}}module[_0xb77c('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index fbfe065..c4a3641 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 _0x92bd=['api','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x92bd,0x11a));var _0xd92b=function(_0x525a60,_0x4c2846){_0x525a60=_0x525a60-0x0;var _0x398893=_0x92bd[_0x525a60];return _0x398893;};'use strict';var _=require(_0xd92b('0x0'));var util=require(_0xd92b('0x1'));var logger=require(_0xd92b('0x2'))(_0xd92b('0x3'));var moment=require('moment');var BPromise=require(_0xd92b('0x4'));var rp=require(_0xd92b('0x5'));var fs=require('fs');var path=require(_0xd92b('0x6'));var rimraf=require('rimraf');var config=require(_0xd92b('0x7'));var attributes=require(_0xd92b('0x8'));module[_0xd92b('0x9')]=function(_0x1a0db3,_0x4f9995){return _0x1a0db3[_0xd92b('0xa')](_0xd92b('0xb'),attributes,{'tableName':_0xd92b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd92b('0xd'),'collate':_0xd92b('0xe')});}; \ No newline at end of file +var _0x3e86=['moment','bluebird','request-promise','path','rimraf','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x2b49bc,_0x47b636){var _0x43cc65=function(_0x236ec3){while(--_0x236ec3){_0x2b49bc['push'](_0x2b49bc['shift']());}};_0x43cc65(++_0x47b636);}(_0x3e86,0x106));var _0x63e8=function(_0x1eea83,_0x472b27){_0x1eea83=_0x1eea83-0x0;var _0x2902a3=_0x3e86[_0x1eea83];return _0x2902a3;};'use strict';var _=require(_0x63e8('0x0'));var util=require(_0x63e8('0x1'));var logger=require(_0x63e8('0x2'))(_0x63e8('0x3'));var moment=require(_0x63e8('0x4'));var BPromise=require(_0x63e8('0x5'));var rp=require(_0x63e8('0x6'));var fs=require('fs');var path=require(_0x63e8('0x7'));var rimraf=require(_0x63e8('0x8'));var config=require('../../config/environment');var attributes=require(_0x63e8('0x9'));module['exports']=function(_0x33b6a1,_0x2306ff){return _0x33b6a1['define'](_0x63e8('0xa'),attributes,{'tableName':_0x63e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x63e8('0xc'),'collate':_0x63e8('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 824f41e..e0e4296 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 _0x7857=['socket.io-emitter','register','request','then','info','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','request\x20sent','result','catch','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults'];(function(_0x4e90e3,_0x570a1d){var _0x295e5b=function(_0x754043){while(--_0x754043){_0x4e90e3['push'](_0x4e90e3['shift']());}};_0x295e5b(++_0x570a1d);}(_0x7857,0x1af));var _0x7785=function(_0x1e2de9,_0x1f488b){_0x1e2de9=_0x1e2de9-0x0;var _0x500905=_0x7857[_0x1e2de9];return _0x500905;};'use strict';var _=require('lodash');var util=require(_0x7785('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7785('0x1'));var fs=require('fs');var Redis=require(_0x7785('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7785('0x3'))(_0x7785('0x4'));var config=require(_0x7785('0x5'));var jayson=require(_0x7785('0x6'));var client=jayson[_0x7785('0x7')][_0x7785('0x8')]({'port':0x232a});config[_0x7785('0x9')]=_[_0x7785('0xa')](config[_0x7785('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x7785('0xb'))(new Redis(config[_0x7785('0x9')]));require('./chatInternalMessage.socket')[_0x7785('0xc')](socket);function respondWithRpcPromise(_0xd65aa8,_0x297d3b,_0x24fc56){return new BPromise(function(_0x5552da,_0x3b79e9){return client[_0x7785('0xd')](_0xd65aa8,_0x24fc56)[_0x7785('0xe')](function(_0x320c33){logger[_0x7785('0xf')]('ChatInternalMessage,\x20%s,\x20%s',_0x297d3b,'request\x20sent');logger[_0x7785('0x10')](_0x7785('0x11'),_0x297d3b,'request\x20sent',JSON[_0x7785('0x12')](_0x320c33));if(_0x320c33['error']){if(_0x320c33[_0x7785('0x13')][_0x7785('0x14')]===0x1f4){logger[_0x7785('0x13')](_0x7785('0x15'),_0x297d3b,_0x320c33[_0x7785('0x13')]['message']);return _0x3b79e9(_0x320c33[_0x7785('0x13')][_0x7785('0x16')]);}logger[_0x7785('0x13')](_0x7785('0x15'),_0x297d3b,_0x320c33[_0x7785('0x13')][_0x7785('0x16')]);return _0x5552da(_0x320c33[_0x7785('0x13')][_0x7785('0x16')]);}else{logger[_0x7785('0xf')](_0x7785('0x15'),_0x297d3b,_0x7785('0x17'));_0x5552da(_0x320c33[_0x7785('0x18')][_0x7785('0x16')]);}})[_0x7785('0x19')](function(_0x269947){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x297d3b,_0x269947);_0x3b79e9(_0x269947);});});} \ No newline at end of file +var _0xfafd=['then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request'];(function(_0x1ff454,_0x12372d){var _0x5dcf92=function(_0x2f026a){while(--_0x2f026a){_0x1ff454['push'](_0x1ff454['shift']());}};_0x5dcf92(++_0x12372d);}(_0xfafd,0xcc));var _0xdfaf=function(_0x1b7933,_0x1fefc2){_0x1b7933=_0x1b7933-0x0;var _0x32e824=_0xfafd[_0x1b7933];return _0x32e824;};'use strict';var _=require('lodash');var util=require(_0xdfaf('0x0'));var moment=require(_0xdfaf('0x1'));var BPromise=require(_0xdfaf('0x2'));var rs=require(_0xdfaf('0x3'));var fs=require('fs');var Redis=require(_0xdfaf('0x4'));var db=require(_0xdfaf('0x5'))['db'];var utils=require(_0xdfaf('0x6'));var logger=require(_0xdfaf('0x7'))(_0xdfaf('0x8'));var config=require(_0xdfaf('0x9'));var jayson=require(_0xdfaf('0xa'));var client=jayson[_0xdfaf('0xb')][_0xdfaf('0xc')]({'port':0x232a});config[_0xdfaf('0xd')]=_[_0xdfaf('0xe')](config['redis'],{'host':_0xdfaf('0xf'),'port':0x18eb});var socket=require(_0xdfaf('0x10'))(new Redis(config[_0xdfaf('0xd')]));require(_0xdfaf('0x11'))[_0xdfaf('0x12')](socket);function respondWithRpcPromise(_0x23712a,_0x466923,_0x26fd47){return new BPromise(function(_0x5092d6,_0x3747ce){return client[_0xdfaf('0x13')](_0x23712a,_0x26fd47)[_0xdfaf('0x14')](function(_0x42ea9f){logger[_0xdfaf('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x466923,_0xdfaf('0x16'));logger[_0xdfaf('0x17')](_0xdfaf('0x18'),_0x466923,_0xdfaf('0x16'),JSON[_0xdfaf('0x19')](_0x42ea9f));if(_0x42ea9f[_0xdfaf('0x1a')]){if(_0x42ea9f[_0xdfaf('0x1a')][_0xdfaf('0x1b')]===0x1f4){logger[_0xdfaf('0x1a')](_0xdfaf('0x1c'),_0x466923,_0x42ea9f['error'][_0xdfaf('0x1d')]);return _0x3747ce(_0x42ea9f[_0xdfaf('0x1a')][_0xdfaf('0x1d')]);}logger['error'](_0xdfaf('0x1c'),_0x466923,_0x42ea9f[_0xdfaf('0x1a')][_0xdfaf('0x1d')]);return _0x5092d6(_0x42ea9f['error']['message']);}else{logger[_0xdfaf('0x15')]('ChatInternalMessage,\x20%s,\x20%s',_0x466923,'request\x20sent');_0x5092d6(_0x42ea9f[_0xdfaf('0x1e')][_0xdfaf('0x1d')]);}})[_0xdfaf('0x1f')](function(_0x120e5d){logger[_0xdfaf('0x1a')](_0xdfaf('0x1c'),_0x466923,_0x120e5d);_0x3747ce(_0x120e5d);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index cf1424c..43aa16b 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 _0x2b04=['remove','update','emit','register','length','chatInternalMessage:','save'];(function(_0x5805dc,_0x243355){var _0x531bc9=function(_0x3bf09b){while(--_0x3bf09b){_0x5805dc['push'](_0x5805dc['shift']());}};_0x531bc9(++_0x243355);}(_0x2b04,0x1cd));var _0x42b0=function(_0x5d1a0a,_0x3df1b4){_0x5d1a0a=_0x5d1a0a-0x0;var _0x165ee2=_0x2b04[_0x5d1a0a];return _0x165ee2;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x42b0('0x0'),_0x42b0('0x1'),_0x42b0('0x2')];function createListener(_0x2a3927,_0x466b93){return function(_0x1a63aa){_0x466b93[_0x42b0('0x3')](_0x2a3927,_0x1a63aa);};}function removeListener(_0x540487,_0x556ca4){return function(){ChatInternalMessageEvents['removeListener'](_0x540487,_0x556ca4);};}exports[_0x42b0('0x4')]=function(_0x33b678){for(var _0x5c9858=0x0,_0x5daa2d=events[_0x42b0('0x5')];_0x5c9858<_0x5daa2d;_0x5c9858++){var _0x15cb14=events[_0x5c9858];var _0x5474b6=createListener(_0x42b0('0x6')+_0x15cb14,_0x33b678);ChatInternalMessageEvents['on'](_0x15cb14,_0x5474b6);}}; \ No newline at end of file +var _0xa5fb=['./chatInternalMessage.events','remove','emit','removeListener','register','length','chatInternalMessage:'];(function(_0x1bdaf7,_0x1f89fd){var _0x4f0b16=function(_0x5c3c60){while(--_0x5c3c60){_0x1bdaf7['push'](_0x1bdaf7['shift']());}};_0x4f0b16(++_0x1f89fd);}(_0xa5fb,0xc4));var _0xba5f=function(_0x344438,_0x409de0){_0x344438=_0x344438-0x0;var _0x19c4f9=_0xa5fb[_0x344438];return _0x19c4f9;};'use strict';var ChatInternalMessageEvents=require(_0xba5f('0x0'));var events=['save',_0xba5f('0x1'),'update'];function createListener(_0x410f84,_0x5b9d0d){return function(_0x429193){_0x5b9d0d[_0xba5f('0x2')](_0x410f84,_0x429193);};}function removeListener(_0x2d7637,_0x43f176){return function(){ChatInternalMessageEvents[_0xba5f('0x3')](_0x2d7637,_0x43f176);};}exports[_0xba5f('0x4')]=function(_0x1d6767){for(var _0x3e07a5=0x0,_0x549974=events[_0xba5f('0x5')];_0x3e07a5<_0x549974;_0x3e07a5++){var _0x35f5ba=events[_0x3e07a5];var _0xafb136=createListener(_0xba5f('0x6')+_0x35f5ba,_0x1d6767);ChatInternalMessageEvents['on'](_0x35f5ba,_0xafb136);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index d7cd44c..55f2eb7 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 _0xbf60=['/:id','show','post','create','put','update','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','index','isAuthenticated','describe','get','/users','getUsers'];(function(_0x37e3d3,_0x98b6){var _0x23d36a=function(_0x19b6c7){while(--_0x19b6c7){_0x37e3d3['push'](_0x37e3d3['shift']());}};_0x23d36a(++_0x98b6);}(_0xbf60,0x127));var _0x0bf6=function(_0xcda377,_0x1e2678){_0xcda377=_0xcda377-0x0;var _0x1c024f=_0xbf60[_0xcda377];return _0x1c024f;};'use strict';var multer=require(_0x0bf6('0x0'));var util=require(_0x0bf6('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0bf6('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0bf6('0x3'));var interaction=require(_0x0bf6('0x4'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x0bf6('0x5')]);router['get']('/describe',auth[_0x0bf6('0x6')](),controller[_0x0bf6('0x7')]);router[_0x0bf6('0x8')](_0x0bf6('0x9'),auth['isAuthenticated'](),controller[_0x0bf6('0xa')]);router[_0x0bf6('0x8')](_0x0bf6('0xb'),auth[_0x0bf6('0x6')](),controller[_0x0bf6('0xc')]);router[_0x0bf6('0xd')]('/',auth[_0x0bf6('0x6')](),controller[_0x0bf6('0xe')]);router[_0x0bf6('0xf')]('/:id',controller[_0x0bf6('0x10')]);router['delete'](_0x0bf6('0xb'),auth[_0x0bf6('0x6')](),controller['destroy']);module[_0x0bf6('0x11')]=router; \ No newline at end of file +var _0x2807=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','update','delete','destroy','exports','multer','util','path'];(function(_0x228c86,_0xeaff09){var _0x1f2b0d=function(_0x13430e){while(--_0x13430e){_0x228c86['push'](_0x228c86['shift']());}};_0x1f2b0d(++_0xeaff09);}(_0x2807,0xc5));var _0x7280=function(_0xe46c64,_0x2aa797){_0xe46c64=_0xe46c64-0x0;var _0x5c56eb=_0x2807[_0xe46c64];return _0x5c56eb;};'use strict';var multer=require(_0x7280('0x0'));var util=require(_0x7280('0x1'));var path=require(_0x7280('0x2'));var timeout=require(_0x7280('0x3'));var express=require(_0x7280('0x4'));var router=express[_0x7280('0x5')]();var fs_extra=require(_0x7280('0x6'));var auth=require(_0x7280('0x7'));var interaction=require(_0x7280('0x8'));var config=require(_0x7280('0x9'));var controller=require(_0x7280('0xa'));router[_0x7280('0xb')]('/',auth[_0x7280('0xc')](),controller[_0x7280('0xd')]);router[_0x7280('0xb')](_0x7280('0xe'),auth['isAuthenticated'](),controller[_0x7280('0xf')]);router['get'](_0x7280('0x10'),auth['isAuthenticated'](),controller[_0x7280('0x11')]);router[_0x7280('0xb')](_0x7280('0x12'),auth[_0x7280('0xc')](),controller[_0x7280('0x13')]);router[_0x7280('0x14')]('/',auth[_0x7280('0xc')](),controller['create']);router['put'](_0x7280('0x12'),controller[_0x7280('0x15')]);router[_0x7280('0x16')](_0x7280('0x12'),auth[_0x7280('0xc')](),controller[_0x7280('0x17')]);module[_0x7280('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index b22d15c..31719f7 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 _0x1131=['BOOLEAN','ENUM','out','DATE','STRING','exports'];(function(_0x152136,_0x4f14f1){var _0x20df44=function(_0x362877){while(--_0x362877){_0x152136['push'](_0x152136['shift']());}};_0x20df44(++_0x4f14f1);}(_0x1131,0x71));var _0x1113=function(_0x2b58fb,_0x353e04){_0x2b58fb=_0x2b58fb-0x0;var _0xd865fa=_0x1131[_0x2b58fb];return _0xd865fa;};'use strict';var Sequelize=require('sequelize');module[_0x1113('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x1113('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1113('0x2')]('in',_0x1113('0x3')),'defaultValue':_0x1113('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0x1113('0x4')]},'providerName':{'type':Sequelize[_0x1113('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x5713=['sequelize','exports','medium','BOOLEAN','ENUM','out','TEXT'];(function(_0x88204e,_0x231b02){var _0x7b46d2=function(_0x1649b7){while(--_0x1649b7){_0x88204e['push'](_0x88204e['shift']());}};_0x7b46d2(++_0x231b02);}(_0x5713,0x1c7));var _0x3571=function(_0x24aed7,_0x2a6852){_0x24aed7=_0x24aed7-0x0;var _0x2224ee=_0x5713[_0x24aed7];return _0x2224ee;};'use strict';var Sequelize=require(_0x3571('0x0'));module[_0x3571('0x1')]={'body':{'type':Sequelize['TEXT'](_0x3571('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x3571('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3571('0x4')]('in',_0x3571('0x5')),'defaultValue':_0x3571('0x5'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x3571('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 300deb1..d5bcc32 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 _0x3124=['stack','name','index','map','ChatMessage','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','rawAttributes','length','options','find','create','body','params','describe','chat-interactions','accept','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','interaction','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','fullname','email','internal','interface','SIP/%s','channel','EventManager','acceptmessage','formData','ChatInteraction','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','Sequelize','User','event','parse','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','client','http','request','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','offset','undefined','limit','count','set','json','reject','update','then','destroy','end'];(function(_0x45d510,_0x513557){var _0x20d720=function(_0x43e5de){while(--_0x43e5de){_0x45d510['push'](_0x45d510['shift']());}};_0x20d720(++_0x513557);}(_0x3124,0x149));var _0x4312=function(_0x36e807,_0x3f3e2d){_0x36e807=_0x36e807-0x0;var _0x6b408d=_0x3124[_0x36e807];return _0x6b408d;};'use strict';var emlformat=require(_0x4312('0x0'));var rimraf=require(_0x4312('0x1'));var zipdir=require(_0x4312('0x2'));var jsonpatch=require(_0x4312('0x3'));var rp=require('request-promise');var moment=require(_0x4312('0x4'));var BPromise=require(_0x4312('0x5'));var Mustache=require('mustache');var util=require(_0x4312('0x6'));var path=require(_0x4312('0x7'));var sox=require('sox');var csv=require(_0x4312('0x8'));var ejs=require(_0x4312('0x9'));var fs=require('fs');var fs_extra=require(_0x4312('0xa'));var _=require(_0x4312('0xb'));var squel=require(_0x4312('0xc'));var crypto=require(_0x4312('0xd'));var jsforce=require(_0x4312('0xe'));var deskjs=require(_0x4312('0xf'));var toCsv=require(_0x4312('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4312('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4312('0x11'));var as=require(_0x4312('0x12'));var hardwareService=require(_0x4312('0x13'));var logger=require(_0x4312('0x14'))(_0x4312('0x15'));var utils=require(_0x4312('0x16'));var config=require(_0x4312('0x17'));var licenseUtil=require(_0x4312('0x18'));var db=require(_0x4312('0x19'))['db'];config[_0x4312('0x1a')]=_[_0x4312('0x1b')](config[_0x4312('0x1a')],{'host':_0x4312('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4312('0x1a')]));require(_0x4312('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x4312('0x1e')][_0x4312('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x4312('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x4d5608,_0x40d7ff,_0xf1dd9c,_0x4acaae){return new BPromise(function(_0x216a7c,_0x3da494){var _0x367d94=_0x4acaae||client;return _0x367d94[_0x4312('0x20')](_0x4d5608,_0xf1dd9c)['then'](function(_0xd6e6c3){logger['info'](_0x4312('0x21'),_0x40d7ff,_0x4312('0x22'));logger[_0x4312('0x23')](_0x4312('0x24'),_0x40d7ff,_0x4312('0x22'),JSON[_0x4312('0x25')](_0xd6e6c3));if(_0xd6e6c3[_0x4312('0x26')]){if(_0xd6e6c3[_0x4312('0x26')][_0x4312('0x27')]===0x1f4){logger[_0x4312('0x26')](_0x4312('0x21'),_0x40d7ff,_0xd6e6c3[_0x4312('0x26')]['message']);return _0x3da494(_0xd6e6c3[_0x4312('0x26')][_0x4312('0x28')]);}logger[_0x4312('0x26')](_0x4312('0x21'),_0x40d7ff,_0xd6e6c3[_0x4312('0x26')][_0x4312('0x28')]);return _0x216a7c(_0xd6e6c3['error'][_0x4312('0x28')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x40d7ff,_0x4312('0x22'));_0x216a7c(_0xd6e6c3['result']['message']);}})[_0x4312('0x29')](function(_0x1095e1){logger[_0x4312('0x26')](_0x4312('0x21'),_0x40d7ff,_0x1095e1);_0x3da494(_0x1095e1);});});}function respondWithStatusCode(_0x5ce5cc,_0x2f37c6){_0x2f37c6=_0x2f37c6||0xcc;return function(_0x4dbef7){if(_0x4dbef7){return _0x5ce5cc[_0x4312('0x2a')](_0x2f37c6);}return _0x5ce5cc[_0x4312('0x2b')](_0x2f37c6)['end']();};}function respondWithResult(_0xcf95e6,_0x13dbd5){_0x13dbd5=_0x13dbd5||0xc8;return function(_0x457970){if(_0x457970){return _0xcf95e6[_0x4312('0x2b')](_0x13dbd5)['json'](_0x457970);}};}function respondWithFilteredResult(_0x4e9908,_0x6905e6){return function(_0x507b4c){if(_0x507b4c){var _0x145942=typeof _0x6905e6[_0x4312('0x2c')]===_0x4312('0x2d')&&typeof _0x6905e6[_0x4312('0x2e')]===_0x4312('0x2d');var _0x49306a=_0x507b4c[_0x4312('0x2f')];var _0x5200c8=_0x145942?0x0:_0x6905e6[_0x4312('0x2c')];var _0x40b99f=_0x145942?_0x507b4c[_0x4312('0x2f')]:_0x6905e6[_0x4312('0x2c')]+_0x6905e6[_0x4312('0x2e')];var _0x3d684e;if(_0x40b99f>=_0x49306a){_0x40b99f=_0x49306a;_0x3d684e=0xc8;}else{_0x3d684e=0xce;}_0x4e9908['status'](_0x3d684e);return _0x4e9908[_0x4312('0x30')]('Content-Range',_0x5200c8+'-'+_0x40b99f+'/'+_0x49306a)[_0x4312('0x31')](_0x507b4c);}return null;};}function patchUpdates(_0x346a8f){return function(_0x5f0217){try{jsonpatch['apply'](_0x5f0217,_0x346a8f,!![]);}catch(_0x1fcee5){return BPromise[_0x4312('0x32')](_0x1fcee5);}return _0x5f0217['save']();};}function saveUpdates(_0x292b9d,_0x236496){return function(_0x517dd3){if(_0x517dd3){return _0x517dd3[_0x4312('0x33')](_0x292b9d)[_0x4312('0x34')](function(_0xc1ccb0){return _0xc1ccb0;});}return null;};}function removeEntity(_0x2d31bc,_0x5e8560){return function(_0x565e49){if(_0x565e49){return _0x565e49[_0x4312('0x35')]()[_0x4312('0x34')](function(){_0x2d31bc['status'](0xcc)[_0x4312('0x36')]();});}};}function handleEntityNotFound(_0xa8d776,_0x1e9f0d){return function(_0x275131){if(!_0x275131){_0xa8d776[_0x4312('0x2a')](0x194);}return _0x275131;};}function handleError(_0xde109e,_0x54f536){_0x54f536=_0x54f536||0x1f4;return function(_0x3593c5){logger[_0x4312('0x26')](_0x3593c5[_0x4312('0x37')]);if(_0x3593c5[_0x4312('0x38')]){delete _0x3593c5['name'];}_0xde109e['status'](_0x54f536)['send'](_0x3593c5);};}exports[_0x4312('0x39')]=function(_0x176e00,_0x385aa8){var _0x4bcbd9={},_0x486f95={},_0x334d93={'count':0x0,'rows':[]};var _0x38f650=_[_0x4312('0x3a')](db[_0x4312('0x3b')]['rawAttributes'],function(_0x552e9b){return{'name':_0x552e9b['fieldName'],'type':_0x552e9b['type'][_0x4312('0x3c')]};});_0x486f95[_0x4312('0x3d')]=_['map'](_0x38f650,_0x4312('0x38'));_0x486f95[_0x4312('0x3e')]=_[_0x4312('0x3f')](_0x176e00[_0x4312('0x3e')]);_0x486f95['filters']=_[_0x4312('0x40')](_0x486f95[_0x4312('0x3d')],_0x486f95[_0x4312('0x3e')]);_0x4bcbd9[_0x4312('0x41')]=_[_0x4312('0x40')](_0x486f95[_0x4312('0x3d')],qs[_0x4312('0x42')](_0x176e00['query'][_0x4312('0x42')]));_0x4bcbd9['attributes']=_0x4bcbd9[_0x4312('0x41')]['length']?_0x4bcbd9[_0x4312('0x41')]:_0x486f95[_0x4312('0x3d')];if(!_0x176e00['query'][_0x4312('0x43')]('nolimit')){_0x4bcbd9[_0x4312('0x2e')]=qs['limit'](_0x176e00[_0x4312('0x3e')][_0x4312('0x2e')]);_0x4bcbd9[_0x4312('0x2c')]=qs[_0x4312('0x2c')](_0x176e00[_0x4312('0x3e')][_0x4312('0x2c')]);}_0x4bcbd9[_0x4312('0x44')]=qs[_0x4312('0x45')](_0x176e00[_0x4312('0x3e')]['sort']);_0x4bcbd9[_0x4312('0x46')]=qs[_0x4312('0x47')](_[_0x4312('0x48')](_0x176e00[_0x4312('0x3e')],_0x486f95['filters']),_0x38f650);if(_0x176e00[_0x4312('0x3e')][_0x4312('0x49')]){_0x4bcbd9[_0x4312('0x46')]=_[_0x4312('0x4a')](_0x4bcbd9[_0x4312('0x46')],{'$or':_[_0x4312('0x3a')](_0x38f650,function(_0x586ba1){if(_0x586ba1[_0x4312('0x4b')]!==_0x4312('0x4c')){var _0x280846={};_0x280846[_0x586ba1[_0x4312('0x38')]]={'$like':'%'+_0x176e00[_0x4312('0x3e')][_0x4312('0x49')]+'%'};return _0x280846;}})});}_0x4bcbd9=_['merge']({},_0x4bcbd9,_0x176e00['options']);var _0x4c4e79={'where':_0x4bcbd9[_0x4312('0x46')]};return db[_0x4312('0x3b')][_0x4312('0x2f')](_0x4c4e79)['then'](function(_0xd4927e){_0x334d93[_0x4312('0x2f')]=_0xd4927e;if(_0x176e00[_0x4312('0x3e')][_0x4312('0x4d')]){_0x4bcbd9[_0x4312('0x4e')]=[{'all':!![]}];}return db[_0x4312('0x3b')][_0x4312('0x4f')](_0x4bcbd9);})[_0x4312('0x34')](function(_0x587fa2){_0x334d93[_0x4312('0x50')]=_0x587fa2;return _0x334d93;})[_0x4312('0x34')](respondWithFilteredResult(_0x385aa8,_0x4bcbd9))['catch'](handleError(_0x385aa8,null));};exports[_0x4312('0x51')]=function(_0x471ceb,_0x110f4d){var _0x4f7793={'raw':!![],'where':{'id':_0x471ceb['params']['id']}},_0x35052a={};_0x35052a[_0x4312('0x3d')]=_[_0x4312('0x3f')](db['ChatMessage'][_0x4312('0x52')]);_0x35052a['query']=_[_0x4312('0x3f')](_0x471ceb[_0x4312('0x3e')]);_0x35052a[_0x4312('0x47')]=_[_0x4312('0x40')](_0x35052a['model'],_0x35052a[_0x4312('0x3e')]);_0x4f7793[_0x4312('0x41')]=_['intersection'](_0x35052a['model'],qs['fields'](_0x471ceb['query'][_0x4312('0x42')]));_0x4f7793[_0x4312('0x41')]=_0x4f7793[_0x4312('0x41')][_0x4312('0x53')]?_0x4f7793[_0x4312('0x41')]:_0x35052a[_0x4312('0x3d')];if(_0x471ceb[_0x4312('0x3e')][_0x4312('0x4d')]){_0x4f7793['include']=[{'all':!![]}];}_0x4f7793=_[_0x4312('0x4a')]({},_0x4f7793,_0x471ceb[_0x4312('0x54')]);return db[_0x4312('0x3b')][_0x4312('0x55')](_0x4f7793)[_0x4312('0x34')](handleEntityNotFound(_0x110f4d,null))['then'](respondWithResult(_0x110f4d,null))[_0x4312('0x29')](handleError(_0x110f4d,null));};exports[_0x4312('0x56')]=function(_0x18621a,_0x4ba0f2){return db['ChatMessage'][_0x4312('0x56')](_0x18621a[_0x4312('0x57')],{})[_0x4312('0x34')](respondWithResult(_0x4ba0f2,0xc9))[_0x4312('0x29')](handleError(_0x4ba0f2,null));};exports['update']=function(_0x4b0c84,_0x31a6d6){if(_0x4b0c84[_0x4312('0x57')]['id']){delete _0x4b0c84[_0x4312('0x57')]['id'];}return db[_0x4312('0x3b')][_0x4312('0x55')]({'where':{'id':_0x4b0c84[_0x4312('0x58')]['id']}})['then'](handleEntityNotFound(_0x31a6d6,null))[_0x4312('0x34')](saveUpdates(_0x4b0c84[_0x4312('0x57')],null))[_0x4312('0x34')](respondWithResult(_0x31a6d6,null))[_0x4312('0x29')](handleError(_0x31a6d6,null));};exports[_0x4312('0x35')]=function(_0x299169,_0x5abafe){return db[_0x4312('0x3b')][_0x4312('0x55')]({'where':{'id':_0x299169[_0x4312('0x58')]['id']}})[_0x4312('0x34')](handleEntityNotFound(_0x5abafe,null))[_0x4312('0x34')](removeEntity(_0x5abafe,null))[_0x4312('0x29')](handleError(_0x5abafe,null));};exports[_0x4312('0x59')]=function(_0x5bcb0f,_0x1e9306){return db[_0x4312('0x3b')][_0x4312('0x59')]()[_0x4312('0x34')](respondWithResult(_0x1e9306,null))[_0x4312('0x29')](handleError(_0x1e9306,null));};var interaction_log=require(_0x4312('0x14'))(_0x4312('0x5a'));exports[_0x4312('0x5b')]=function(_0x70ea4c,_0xd6e83a,_0x5d407b){var _0x24217d={'agent':{},'channel':_0x4312('0x5c')};if(_0x70ea4c['body']['id']){delete _0x70ea4c[_0x4312('0x57')]['id'];}_0x70ea4c['body']['read']=!![];_0x70ea4c[_0x4312('0x57')]['readAt']=moment()[_0x4312('0x5d')](_0x4312('0x5e'));_0x70ea4c[_0x4312('0x57')]['UserId']=_0x70ea4c[_0x4312('0x57')][_0x4312('0x5f')]||_0x70ea4c[_0x4312('0x60')]['id'];_0x24217d[_0x4312('0x61')]['id']=_0x70ea4c['body']['UserId'];return db['ChatMessage'][_0x4312('0x55')]({'where':{'id':_0x70ea4c[_0x4312('0x58')]['id'],'UserId':null}})[_0x4312('0x34')](handleEntityNotFound(_0xd6e83a,null))['then'](saveUpdates(_0x70ea4c[_0x4312('0x57')],null))[_0x4312('0x34')](function(_0x1c3799){if(_0x1c3799){_0x24217d['message']=_0x1c3799[_0x4312('0x62')]({'plain':!![]});return db['ChatInteraction'][_0x4312('0x55')]({'where':{'id':_0x1c3799['ChatInteractionId']}});}return null;})[_0x4312('0x34')](handleEntityNotFound(_0xd6e83a,null))['then'](function(_0x494aae){if(_0x494aae){return _0x494aae[_0x4312('0x33')]({'UserId':_0x70ea4c[_0x4312('0x57')][_0x4312('0x5f')],'read1stAt':_['isNil'](_0x494aae['read1stAt'])?moment()['format'](_0x4312('0x5e')):undefined});}return null;})[_0x4312('0x34')](function(_0x18e724){if(_0x18e724){_0x24217d[_0x4312('0x63')]=_0x18e724[_0x4312('0x62')]({'plain':!![]});interaction_log[_0x4312('0x64')](_0x4312('0x65'),_0x70ea4c[_0x4312('0x60')]['id'],_0x70ea4c[_0x4312('0x60')]['name'],_0x70ea4c[_0x4312('0x60')]['role'],_0x24217d[_0x4312('0x63')]['id'],_0x70ea4c[_0x4312('0x57')]?JSON[_0x4312('0x25')](_0x70ea4c['body']):_0x4312('0x66'));return respondWithRpcPromise(_0x4312('0x67'),'acceptMessage',_0x24217d);}return null;})[_0x4312('0x34')](function(_0x372d8){var _0x3db72e=_0x4312('0x68')+_0x372d8['message'][_0x4312('0x69')];return db[_0x4312('0x6a')][_0x4312('0x3e')](_0x3db72e,{'type':db['Sequelize'][_0x4312('0x6b')][_0x4312('0x6c')],'raw':!![]})[_0x4312('0x34')](function(_0x3929a5){return _0x3929a5;});})[_0x4312('0x34')](function(_0x5b7a79){if(_0x5b7a79){_0x24217d['message'][_0x4312('0x6d')]=_0x5b7a79[0x0];if(!_0x70ea4c[_0x4312('0x57')][_0x4312('0x5f')])return;return db['User'][_0x4312('0x55')]({'where':{'id':_0x70ea4c[_0x4312('0x57')]['UserId'],'role':'agent'},'attributes':['id',_0x4312('0x38'),_0x4312('0x6e'),_0x4312('0x6f'),_0x4312('0x70')],'raw':!![]});}return null;})['then'](function(_0x9f77a3){if(!_0x9f77a3)return null;_0x24217d[_0x4312('0x28')]['agent']=_0x9f77a3;return _0x24217d;})['then'](function(_0x1037ef){if(_0x1037ef){if(_0x70ea4c[_0x4312('0x57')]['manual']){_0x24217d[_0x4312('0x28')][_0x4312('0x71')]=util[_0x4312('0x5d')](_0x4312('0x72'),_0x70ea4c[_0x4312('0x60')]['name']);_0x24217d[_0x4312('0x28')]['channel']=_0x24217d[_0x4312('0x73')];_0x24217d['message']['motionChannel']=_0x24217d[_0x4312('0x73')];_0x24217d['message']['event']='accept';return respondWithRpcPromise('EventManager',_0x4312('0x74'),{'event':_0x4312('0x75'),'message':_['merge'](_0x24217d[_0x4312('0x28')],JSON['parse'](_0x24217d['interaction'][_0x4312('0x76')]))},client9002)[_0x4312('0x34')](function(){return _0x24217d;});}return _0x24217d;}return null;})['then'](respondWithResult(_0xd6e83a,null))['catch'](handleError(_0xd6e83a,null));};var interaction_log=require(_0x4312('0x14'))(_0x4312('0x5a'));exports['reject']=function(_0x56560b,_0x1631bd,_0x46762b){var _0x31e4de={'agent':{},'channel':_0x4312('0x5c')};if(_0x56560b[_0x4312('0x57')]['id']){delete _0x56560b[_0x4312('0x57')]['id'];}_0x56560b['body'][_0x4312('0x5f')]=_0x56560b[_0x4312('0x57')][_0x4312('0x5f')]||_0x56560b[_0x4312('0x60')]['id'];_0x31e4de[_0x4312('0x61')]['id']=_0x56560b['body'][_0x4312('0x5f')];return db[_0x4312('0x3b')][_0x4312('0x55')]({'where':{'id':_0x56560b['params']['id'],'UserId':null}})[_0x4312('0x34')](handleEntityNotFound(_0x1631bd,null))['then'](function(_0x433270){if(_0x433270){_0x31e4de[_0x4312('0x28')]=_0x433270['get']({'plain':!![]});return db[_0x4312('0x77')][_0x4312('0x55')]({'where':{'id':_0x433270[_0x4312('0x78')]}});}return null;})[_0x4312('0x34')](handleEntityNotFound(_0x1631bd,null))[_0x4312('0x34')](function(_0x41ee6f){if(_0x41ee6f){_0x31e4de['interaction']=_0x41ee6f[_0x4312('0x62')]({'plain':!![]});interaction_log['info'](_0x4312('0x79'),_0x56560b[_0x4312('0x60')]['id'],_0x56560b[_0x4312('0x60')][_0x4312('0x38')],_0x56560b[_0x4312('0x60')][_0x4312('0x7a')],_0x31e4de['interaction']['id'],_0x56560b['body']?JSON[_0x4312('0x25')](_0x56560b['body']):_0x4312('0x66'));return respondWithRpcPromise('RejectMessage',_0x4312('0x7b'),_0x31e4de);}return null;})[_0x4312('0x34')](function(_0x166c20){var _0x268fae=_0x4312('0x68')+_0x166c20[_0x4312('0x28')][_0x4312('0x69')];return db[_0x4312('0x6a')][_0x4312('0x3e')](_0x268fae,{'type':db[_0x4312('0x7c')][_0x4312('0x6b')][_0x4312('0x6c')],'raw':!![]})[_0x4312('0x34')](function(_0x566695){return _0x566695;});})['then'](function(_0x4d3128){if(_0x4d3128){_0x31e4de['message'][_0x4312('0x6d')]=_0x4d3128[0x0];if(!_0x56560b[_0x4312('0x57')][_0x4312('0x5f')])return;return db[_0x4312('0x7d')][_0x4312('0x55')]({'where':{'id':_0x56560b['body'][_0x4312('0x5f')],'role':_0x4312('0x61')},'attributes':['id',_0x4312('0x38'),_0x4312('0x6e'),_0x4312('0x6f'),_0x4312('0x70')],'raw':!![]});}return null;})['then'](function(_0x37f603){if(!_0x37f603)return null;_0x31e4de['message']['agent']=_0x37f603;return _0x31e4de;})[_0x4312('0x34')](function(_0x2375ec){if(_0x2375ec){_0x2375ec['message']['interface']=util[_0x4312('0x5d')](_0x4312('0x72'),_0x56560b[_0x4312('0x60')]['name']);_0x2375ec[_0x4312('0x28')][_0x4312('0x73')]=_0x31e4de[_0x4312('0x73')];_0x2375ec[_0x4312('0x28')]['motionChannel']=_0x31e4de['channel'];_0x2375ec[_0x4312('0x28')][_0x4312('0x7e')]='reject';respondWithRpcPromise(_0x4312('0x74'),'EventManager',{'event':'rejectmessage','message':_[_0x4312('0x4a')](_0x31e4de[_0x4312('0x28')],JSON[_0x4312('0x7f')](_0x31e4de[_0x4312('0x63')]['formData']))},client9002);return _0x31e4de;}return null;})['then'](respondWithResult(_0x1631bd,null))[_0x4312('0x29')](handleError(_0x1631bd,null));}; \ No newline at end of file +var _0x1d9c=['undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','index','ChatMessage','fieldName','key','model','keys','filters','intersection','attributes','fields','query','nolimit','order','sort','where','filter','map','type','VIRTUAL','merge','options','include','rows','show','params','rawAttributes','length','find','create','body','describe','chat-interactions','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','interaction','info','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','parse','formData','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','sequelize','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','client','http','then','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','catch','status','json','offset'];(function(_0x337f7b,_0x326e33){var _0x2184b9=function(_0x497ecf){while(--_0x497ecf){_0x337f7b['push'](_0x337f7b['shift']());}};_0x2184b9(++_0x326e33);}(_0x1d9c,0x14b));var _0xc1d9=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x1d9c[_0xda464c];return _0x19e222;};'use strict';var emlformat=require(_0xc1d9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc1d9('0x1'));var jsonpatch=require(_0xc1d9('0x2'));var rp=require('request-promise');var moment=require(_0xc1d9('0x3'));var BPromise=require(_0xc1d9('0x4'));var Mustache=require(_0xc1d9('0x5'));var util=require(_0xc1d9('0x6'));var path=require('path');var sox=require(_0xc1d9('0x7'));var csv=require(_0xc1d9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc1d9('0x9'));var _=require(_0xc1d9('0xa'));var squel=require(_0xc1d9('0xb'));var crypto=require(_0xc1d9('0xc'));var jsforce=require(_0xc1d9('0xd'));var deskjs=require(_0xc1d9('0xe'));var toCsv=require(_0xc1d9('0x8'));var querystring=require('querystring');var Papa=require(_0xc1d9('0xf'));var Redis=require(_0xc1d9('0x10'));var authService=require(_0xc1d9('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc1d9('0x12'))(_0xc1d9('0x13'));var utils=require(_0xc1d9('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xc1d9('0x15'));var db=require(_0xc1d9('0x16'))['db'];config['redis']=_[_0xc1d9('0x17')](config['redis'],{'host':_0xc1d9('0x18'),'port':0x18eb});var socket=require(_0xc1d9('0x19'))(new Redis(config[_0xc1d9('0x1a')]));require('./chatMessage.socket')[_0xc1d9('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc1d9('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0xc1d9('0x1c')][_0xc1d9('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x37efc4,_0x3c74ad,_0x4fae79,_0x1ed4ec){return new BPromise(function(_0x585da4,_0xa5a32d){var _0x2741a6=_0x1ed4ec||client;return _0x2741a6['request'](_0x37efc4,_0x4fae79)[_0xc1d9('0x1e')](function(_0x297861){logger['info']('ChatMessage,\x20%s,\x20%s',_0x3c74ad,'request\x20sent');logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x3c74ad,_0xc1d9('0x1f'),JSON[_0xc1d9('0x20')](_0x297861));if(_0x297861[_0xc1d9('0x21')]){if(_0x297861[_0xc1d9('0x21')][_0xc1d9('0x22')]===0x1f4){logger[_0xc1d9('0x21')](_0xc1d9('0x23'),_0x3c74ad,_0x297861[_0xc1d9('0x21')][_0xc1d9('0x24')]);return _0xa5a32d(_0x297861[_0xc1d9('0x21')][_0xc1d9('0x24')]);}logger['error'](_0xc1d9('0x23'),_0x3c74ad,_0x297861[_0xc1d9('0x21')][_0xc1d9('0x24')]);return _0x585da4(_0x297861[_0xc1d9('0x21')][_0xc1d9('0x24')]);}else{logger['info'](_0xc1d9('0x23'),_0x3c74ad,_0xc1d9('0x1f'));_0x585da4(_0x297861['result'][_0xc1d9('0x24')]);}})[_0xc1d9('0x25')](function(_0x27a49e){logger[_0xc1d9('0x21')](_0xc1d9('0x23'),_0x3c74ad,_0x27a49e);_0xa5a32d(_0x27a49e);});});}function respondWithStatusCode(_0x21635a,_0x1a00d7){_0x1a00d7=_0x1a00d7||0xcc;return function(_0x8fc75b){if(_0x8fc75b){return _0x21635a['sendStatus'](_0x1a00d7);}return _0x21635a[_0xc1d9('0x26')](_0x1a00d7)['end']();};}function respondWithResult(_0x31e7c8,_0x467063){_0x467063=_0x467063||0xc8;return function(_0x5eb701){if(_0x5eb701){return _0x31e7c8[_0xc1d9('0x26')](_0x467063)[_0xc1d9('0x27')](_0x5eb701);}};}function respondWithFilteredResult(_0x38ae0b,_0x1737c6){return function(_0xcbae75){if(_0xcbae75){var _0x529915=typeof _0x1737c6[_0xc1d9('0x28')]===_0xc1d9('0x29')&&typeof _0x1737c6[_0xc1d9('0x2a')]==='undefined';var _0x55e185=_0xcbae75[_0xc1d9('0x2b')];var _0x462699=_0x529915?0x0:_0x1737c6['offset'];var _0x2a02cc=_0x529915?_0xcbae75['count']:_0x1737c6['offset']+_0x1737c6[_0xc1d9('0x2a')];var _0x3d65e1;if(_0x2a02cc>=_0x55e185){_0x2a02cc=_0x55e185;_0x3d65e1=0xc8;}else{_0x3d65e1=0xce;}_0x38ae0b[_0xc1d9('0x26')](_0x3d65e1);return _0x38ae0b[_0xc1d9('0x2c')](_0xc1d9('0x2d'),_0x462699+'-'+_0x2a02cc+'/'+_0x55e185)['json'](_0xcbae75);}return null;};}function patchUpdates(_0x27f207){return function(_0x353ebd){try{jsonpatch[_0xc1d9('0x2e')](_0x353ebd,_0x27f207,!![]);}catch(_0x88c1e0){return BPromise[_0xc1d9('0x2f')](_0x88c1e0);}return _0x353ebd[_0xc1d9('0x30')]();};}function saveUpdates(_0x2c10d3,_0x40c95f){return function(_0x28d504){if(_0x28d504){return _0x28d504[_0xc1d9('0x31')](_0x2c10d3)[_0xc1d9('0x1e')](function(_0x5395e9){return _0x5395e9;});}return null;};}function removeEntity(_0x5110fc,_0x4f3108){return function(_0x4a4a88){if(_0x4a4a88){return _0x4a4a88[_0xc1d9('0x32')]()[_0xc1d9('0x1e')](function(){_0x5110fc[_0xc1d9('0x26')](0xcc)[_0xc1d9('0x33')]();});}};}function handleEntityNotFound(_0x8048ac,_0x4c2abb){return function(_0x42971a){if(!_0x42971a){_0x8048ac['sendStatus'](0x194);}return _0x42971a;};}function handleError(_0x1f17ab,_0x633f73){_0x633f73=_0x633f73||0x1f4;return function(_0x116bcb){logger[_0xc1d9('0x21')](_0x116bcb[_0xc1d9('0x34')]);if(_0x116bcb[_0xc1d9('0x35')]){delete _0x116bcb[_0xc1d9('0x35')];}_0x1f17ab[_0xc1d9('0x26')](_0x633f73)['send'](_0x116bcb);};}exports[_0xc1d9('0x36')]=function(_0x4bddbd,_0x47e62f){var _0x33cf4c={},_0x47645f={},_0x34fabc={'count':0x0,'rows':[]};var _0x339446=_['map'](db[_0xc1d9('0x37')]['rawAttributes'],function(_0x4af64f){return{'name':_0x4af64f[_0xc1d9('0x38')],'type':_0x4af64f['type'][_0xc1d9('0x39')]};});_0x47645f[_0xc1d9('0x3a')]=_['map'](_0x339446,_0xc1d9('0x35'));_0x47645f['query']=_[_0xc1d9('0x3b')](_0x4bddbd['query']);_0x47645f[_0xc1d9('0x3c')]=_[_0xc1d9('0x3d')](_0x47645f['model'],_0x47645f['query']);_0x33cf4c[_0xc1d9('0x3e')]=_[_0xc1d9('0x3d')](_0x47645f['model'],qs[_0xc1d9('0x3f')](_0x4bddbd[_0xc1d9('0x40')][_0xc1d9('0x3f')]));_0x33cf4c[_0xc1d9('0x3e')]=_0x33cf4c[_0xc1d9('0x3e')]['length']?_0x33cf4c[_0xc1d9('0x3e')]:_0x47645f[_0xc1d9('0x3a')];if(!_0x4bddbd['query']['hasOwnProperty'](_0xc1d9('0x41'))){_0x33cf4c[_0xc1d9('0x2a')]=qs['limit'](_0x4bddbd[_0xc1d9('0x40')][_0xc1d9('0x2a')]);_0x33cf4c[_0xc1d9('0x28')]=qs[_0xc1d9('0x28')](_0x4bddbd['query'][_0xc1d9('0x28')]);}_0x33cf4c[_0xc1d9('0x42')]=qs[_0xc1d9('0x43')](_0x4bddbd[_0xc1d9('0x40')]['sort']);_0x33cf4c[_0xc1d9('0x44')]=qs['filters'](_['pick'](_0x4bddbd['query'],_0x47645f[_0xc1d9('0x3c')]),_0x339446);if(_0x4bddbd['query'][_0xc1d9('0x45')]){_0x33cf4c[_0xc1d9('0x44')]=_['merge'](_0x33cf4c[_0xc1d9('0x44')],{'$or':_[_0xc1d9('0x46')](_0x339446,function(_0x4fe376){if(_0x4fe376[_0xc1d9('0x47')]!==_0xc1d9('0x48')){var _0x8b193c={};_0x8b193c[_0x4fe376['name']]={'$like':'%'+_0x4bddbd['query'][_0xc1d9('0x45')]+'%'};return _0x8b193c;}})});}_0x33cf4c=_[_0xc1d9('0x49')]({},_0x33cf4c,_0x4bddbd[_0xc1d9('0x4a')]);var _0x6795c3={'where':_0x33cf4c[_0xc1d9('0x44')]};return db[_0xc1d9('0x37')][_0xc1d9('0x2b')](_0x6795c3)['then'](function(_0x3fcc8c){_0x34fabc[_0xc1d9('0x2b')]=_0x3fcc8c;if(_0x4bddbd[_0xc1d9('0x40')]['includeAll']){_0x33cf4c[_0xc1d9('0x4b')]=[{'all':!![]}];}return db[_0xc1d9('0x37')]['findAll'](_0x33cf4c);})[_0xc1d9('0x1e')](function(_0x5a8666){_0x34fabc[_0xc1d9('0x4c')]=_0x5a8666;return _0x34fabc;})[_0xc1d9('0x1e')](respondWithFilteredResult(_0x47e62f,_0x33cf4c))[_0xc1d9('0x25')](handleError(_0x47e62f,null));};exports[_0xc1d9('0x4d')]=function(_0x52a799,_0x299c4f){var _0x5bdfe2={'raw':!![],'where':{'id':_0x52a799[_0xc1d9('0x4e')]['id']}},_0x1d5fb2={};_0x1d5fb2['model']=_[_0xc1d9('0x3b')](db[_0xc1d9('0x37')][_0xc1d9('0x4f')]);_0x1d5fb2[_0xc1d9('0x40')]=_[_0xc1d9('0x3b')](_0x52a799[_0xc1d9('0x40')]);_0x1d5fb2['filters']=_[_0xc1d9('0x3d')](_0x1d5fb2[_0xc1d9('0x3a')],_0x1d5fb2[_0xc1d9('0x40')]);_0x5bdfe2[_0xc1d9('0x3e')]=_['intersection'](_0x1d5fb2['model'],qs[_0xc1d9('0x3f')](_0x52a799[_0xc1d9('0x40')]['fields']));_0x5bdfe2[_0xc1d9('0x3e')]=_0x5bdfe2[_0xc1d9('0x3e')][_0xc1d9('0x50')]?_0x5bdfe2[_0xc1d9('0x3e')]:_0x1d5fb2['model'];if(_0x52a799['query']['includeAll']){_0x5bdfe2['include']=[{'all':!![]}];}_0x5bdfe2=_['merge']({},_0x5bdfe2,_0x52a799[_0xc1d9('0x4a')]);return db['ChatMessage'][_0xc1d9('0x51')](_0x5bdfe2)[_0xc1d9('0x1e')](handleEntityNotFound(_0x299c4f,null))[_0xc1d9('0x1e')](respondWithResult(_0x299c4f,null))[_0xc1d9('0x25')](handleError(_0x299c4f,null));};exports[_0xc1d9('0x52')]=function(_0xa7dd10,_0x3e0e63){return db[_0xc1d9('0x37')][_0xc1d9('0x52')](_0xa7dd10[_0xc1d9('0x53')],{})[_0xc1d9('0x1e')](respondWithResult(_0x3e0e63,0xc9))[_0xc1d9('0x25')](handleError(_0x3e0e63,null));};exports[_0xc1d9('0x31')]=function(_0x2fb585,_0x2a0a4e){if(_0x2fb585[_0xc1d9('0x53')]['id']){delete _0x2fb585[_0xc1d9('0x53')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x2fb585['params']['id']}})[_0xc1d9('0x1e')](handleEntityNotFound(_0x2a0a4e,null))[_0xc1d9('0x1e')](saveUpdates(_0x2fb585[_0xc1d9('0x53')],null))[_0xc1d9('0x1e')](respondWithResult(_0x2a0a4e,null))[_0xc1d9('0x25')](handleError(_0x2a0a4e,null));};exports['destroy']=function(_0x51fd0b,_0x2991ce){return db[_0xc1d9('0x37')][_0xc1d9('0x51')]({'where':{'id':_0x51fd0b[_0xc1d9('0x4e')]['id']}})[_0xc1d9('0x1e')](handleEntityNotFound(_0x2991ce,null))[_0xc1d9('0x1e')](removeEntity(_0x2991ce,null))[_0xc1d9('0x25')](handleError(_0x2991ce,null));};exports[_0xc1d9('0x54')]=function(_0x3470be,_0x3a9a27){return db[_0xc1d9('0x37')][_0xc1d9('0x54')]()[_0xc1d9('0x1e')](respondWithResult(_0x3a9a27,null))[_0xc1d9('0x25')](handleError(_0x3a9a27,null));};var interaction_log=require(_0xc1d9('0x12'))(_0xc1d9('0x55'));exports[_0xc1d9('0x56')]=function(_0x1ec318,_0x3b4a03,_0x5ad219){var _0x5e879b={'agent':{},'channel':_0xc1d9('0x57')};if(_0x1ec318[_0xc1d9('0x53')]['id']){delete _0x1ec318[_0xc1d9('0x53')]['id'];}_0x1ec318[_0xc1d9('0x53')][_0xc1d9('0x58')]=!![];_0x1ec318['body']['readAt']=moment()[_0xc1d9('0x59')](_0xc1d9('0x5a'));_0x1ec318[_0xc1d9('0x53')][_0xc1d9('0x5b')]=_0x1ec318['body'][_0xc1d9('0x5b')]||_0x1ec318[_0xc1d9('0x5c')]['id'];_0x5e879b[_0xc1d9('0x5d')]['id']=_0x1ec318['body']['UserId'];return db[_0xc1d9('0x37')][_0xc1d9('0x51')]({'where':{'id':_0x1ec318[_0xc1d9('0x4e')]['id'],'UserId':null}})[_0xc1d9('0x1e')](handleEntityNotFound(_0x3b4a03,null))[_0xc1d9('0x1e')](saveUpdates(_0x1ec318[_0xc1d9('0x53')],null))['then'](function(_0x31940c){if(_0x31940c){_0x5e879b['message']=_0x31940c[_0xc1d9('0x5e')]({'plain':!![]});return db[_0xc1d9('0x5f')]['find']({'where':{'id':_0x31940c['ChatInteractionId']}});}return null;})[_0xc1d9('0x1e')](handleEntityNotFound(_0x3b4a03,null))['then'](function(_0x4ccd02){if(_0x4ccd02){return _0x4ccd02['update']({'UserId':_0x1ec318[_0xc1d9('0x53')]['UserId'],'read1stAt':_['isNil'](_0x4ccd02['read1stAt'])?moment()[_0xc1d9('0x59')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xc1d9('0x1e')](function(_0x3c0ef1){if(_0x3c0ef1){_0x5e879b[_0xc1d9('0x60')]=_0x3c0ef1[_0xc1d9('0x5e')]({'plain':!![]});interaction_log[_0xc1d9('0x61')](_0xc1d9('0x62'),_0x1ec318['user']['id'],_0x1ec318[_0xc1d9('0x5c')][_0xc1d9('0x35')],_0x1ec318['user']['role'],_0x5e879b[_0xc1d9('0x60')]['id'],_0x1ec318[_0xc1d9('0x53')]?JSON[_0xc1d9('0x20')](_0x1ec318[_0xc1d9('0x53')]):_0xc1d9('0x63'));return respondWithRpcPromise('AcceptMessage',_0xc1d9('0x64'),_0x5e879b);}return null;})['then'](function(_0x31484c){var _0xfaafd8=_0xc1d9('0x65')+_0x31484c[_0xc1d9('0x24')][_0xc1d9('0x66')];return db['sequelize']['query'](_0xfaafd8,{'type':db[_0xc1d9('0x67')][_0xc1d9('0x68')][_0xc1d9('0x69')],'raw':!![]})['then'](function(_0x2559a7){return _0x2559a7;});})['then'](function(_0xbd779){if(_0xbd779){_0x5e879b[_0xc1d9('0x24')]['contact']=_0xbd779[0x0];if(!_0x1ec318[_0xc1d9('0x53')]['UserId'])return;return db[_0xc1d9('0x6a')][_0xc1d9('0x51')]({'where':{'id':_0x1ec318[_0xc1d9('0x53')][_0xc1d9('0x5b')],'role':_0xc1d9('0x5d')},'attributes':['id',_0xc1d9('0x35'),_0xc1d9('0x6b'),_0xc1d9('0x6c'),_0xc1d9('0x6d')],'raw':!![]});}return null;})[_0xc1d9('0x1e')](function(_0x41202d){if(!_0x41202d)return null;_0x5e879b[_0xc1d9('0x24')][_0xc1d9('0x5d')]=_0x41202d;return _0x5e879b;})[_0xc1d9('0x1e')](function(_0x5da42a){if(_0x5da42a){if(_0x1ec318[_0xc1d9('0x53')][_0xc1d9('0x6e')]){_0x5e879b[_0xc1d9('0x24')][_0xc1d9('0x6f')]=util['format'](_0xc1d9('0x70'),_0x1ec318[_0xc1d9('0x5c')][_0xc1d9('0x35')]);_0x5e879b[_0xc1d9('0x24')][_0xc1d9('0x71')]=_0x5e879b[_0xc1d9('0x71')];_0x5e879b['message'][_0xc1d9('0x72')]=_0x5e879b[_0xc1d9('0x71')];_0x5e879b['message'][_0xc1d9('0x73')]='accept';return respondWithRpcPromise('EventManager',_0xc1d9('0x74'),{'event':'acceptmessage','message':_[_0xc1d9('0x49')](_0x5e879b[_0xc1d9('0x24')],JSON[_0xc1d9('0x75')](_0x5e879b[_0xc1d9('0x60')][_0xc1d9('0x76')]))},client9002)[_0xc1d9('0x1e')](function(){return _0x5e879b;});}return _0x5e879b;}return null;})['then'](respondWithResult(_0x3b4a03,null))['catch'](handleError(_0x3b4a03,null));};var interaction_log=require(_0xc1d9('0x12'))(_0xc1d9('0x55'));exports['reject']=function(_0x5376ae,_0x33372e,_0x5ccd43){var _0x5c3997={'agent':{},'channel':_0xc1d9('0x57')};if(_0x5376ae['body']['id']){delete _0x5376ae[_0xc1d9('0x53')]['id'];}_0x5376ae[_0xc1d9('0x53')][_0xc1d9('0x5b')]=_0x5376ae['body'][_0xc1d9('0x5b')]||_0x5376ae[_0xc1d9('0x5c')]['id'];_0x5c3997['agent']['id']=_0x5376ae[_0xc1d9('0x53')]['UserId'];return db[_0xc1d9('0x37')]['find']({'where':{'id':_0x5376ae[_0xc1d9('0x4e')]['id'],'UserId':null}})[_0xc1d9('0x1e')](handleEntityNotFound(_0x33372e,null))[_0xc1d9('0x1e')](function(_0x264108){if(_0x264108){_0x5c3997[_0xc1d9('0x24')]=_0x264108['get']({'plain':!![]});return db[_0xc1d9('0x5f')]['find']({'where':{'id':_0x264108[_0xc1d9('0x77')]}});}return null;})[_0xc1d9('0x1e')](handleEntityNotFound(_0x33372e,null))[_0xc1d9('0x1e')](function(_0x4fbec){if(_0x4fbec){_0x5c3997['interaction']=_0x4fbec[_0xc1d9('0x5e')]({'plain':!![]});interaction_log[_0xc1d9('0x61')](_0xc1d9('0x78'),_0x5376ae[_0xc1d9('0x5c')]['id'],_0x5376ae[_0xc1d9('0x5c')][_0xc1d9('0x35')],_0x5376ae[_0xc1d9('0x5c')][_0xc1d9('0x79')],_0x5c3997['interaction']['id'],_0x5376ae[_0xc1d9('0x53')]?JSON[_0xc1d9('0x20')](_0x5376ae[_0xc1d9('0x53')]):_0xc1d9('0x63'));return respondWithRpcPromise(_0xc1d9('0x7a'),'rejectMessage',_0x5c3997);}return null;})[_0xc1d9('0x1e')](function(_0x33eeb0){var _0x2e7fcc=_0xc1d9('0x65')+_0x33eeb0[_0xc1d9('0x24')][_0xc1d9('0x66')];return db[_0xc1d9('0x7b')][_0xc1d9('0x40')](_0x2e7fcc,{'type':db[_0xc1d9('0x67')]['QueryTypes'][_0xc1d9('0x69')],'raw':!![]})[_0xc1d9('0x1e')](function(_0x177f3f){return _0x177f3f;});})[_0xc1d9('0x1e')](function(_0x406260){if(_0x406260){_0x5c3997[_0xc1d9('0x24')]['contact']=_0x406260[0x0];if(!_0x5376ae[_0xc1d9('0x53')][_0xc1d9('0x5b')])return;return db[_0xc1d9('0x6a')]['find']({'where':{'id':_0x5376ae[_0xc1d9('0x53')][_0xc1d9('0x5b')],'role':_0xc1d9('0x5d')},'attributes':['id',_0xc1d9('0x35'),_0xc1d9('0x6b'),'email',_0xc1d9('0x6d')],'raw':!![]});}return null;})[_0xc1d9('0x1e')](function(_0x2b6054){if(!_0x2b6054)return null;_0x5c3997['message'][_0xc1d9('0x5d')]=_0x2b6054;return _0x5c3997;})[_0xc1d9('0x1e')](function(_0x208777){if(_0x208777){_0x208777[_0xc1d9('0x24')][_0xc1d9('0x6f')]=util['format'](_0xc1d9('0x70'),_0x5376ae[_0xc1d9('0x5c')][_0xc1d9('0x35')]);_0x208777[_0xc1d9('0x24')][_0xc1d9('0x71')]=_0x5c3997[_0xc1d9('0x71')];_0x208777[_0xc1d9('0x24')][_0xc1d9('0x72')]=_0x5c3997[_0xc1d9('0x71')];_0x208777[_0xc1d9('0x24')][_0xc1d9('0x73')]=_0xc1d9('0x2f');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_['merge'](_0x5c3997[_0xc1d9('0x24')],JSON[_0xc1d9('0x75')](_0x5c3997[_0xc1d9('0x60')]['formData']))},client9002);return _0x5c3997;}return null;})['then'](respondWithResult(_0x33372e,null))[_0xc1d9('0x25')](handleError(_0x33372e,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 47e6103..71fb7a2 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 _0x692e=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatMessage'];(function(_0x4049a7,_0x883b1a){var _0x42702a=function(_0x44252f){while(--_0x44252f){_0x4049a7['push'](_0x4049a7['shift']());}};_0x42702a(++_0x883b1a);}(_0x692e,0x134));var _0xe692=function(_0x443c2d,_0x23570a){_0x443c2d=_0x443c2d-0x0;var _0x2a7eae=_0x692e[_0x443c2d];return _0x2a7eae;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xe692('0x0'))['db'][_0xe692('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xe692('0x2')](0x0);var events={'afterCreate':_0xe692('0x3'),'afterUpdate':_0xe692('0x4'),'afterDestroy':_0xe692('0x5')};function emitEvent(_0x4d1797){return function(_0x324432,_0x45472b,_0x27e802){ChatMessageEvents[_0xe692('0x6')](_0x4d1797+':'+_0x324432['id'],_0x324432);ChatMessageEvents[_0xe692('0x6')](_0x4d1797,_0x324432);_0x27e802(null);};}for(var e in events){if(events[_0xe692('0x7')](e)){var event=events[e];ChatMessage[_0xe692('0x8')](e,emitEvent(event));}}module[_0xe692('0x9')]=ChatMessageEvents; \ No newline at end of file +var _0x3c14=['emit','hasOwnProperty','exports','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x3c14,0x1b3));var _0x43c1=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x3c14[_0x29d94e];return _0x106237;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x43c1('0x0'))['db'][_0x43c1('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x43c1('0x2')](0x0);var events={'afterCreate':_0x43c1('0x3'),'afterUpdate':_0x43c1('0x4'),'afterDestroy':_0x43c1('0x5')};function emitEvent(_0x4fe7b9){return function(_0x37aee9,_0x4bbd0d,_0x3cd48a){ChatMessageEvents[_0x43c1('0x6')](_0x4fe7b9+':'+_0x37aee9['id'],_0x37aee9);ChatMessageEvents[_0x43c1('0x6')](_0x4fe7b9,_0x37aee9);_0x3cd48a(null);};}for(var e in events){if(events[_0x43c1('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x43c1('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 4e4049b..98e09f9 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 _0x9f1a=['FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','ChatInteraction','ChatInteractionId','then','error','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','chat_messages','fti_chat_messages','body'];(function(_0x5678b5,_0x1c4aa8){var _0x4c09a5=function(_0x2aa89a){while(--_0x2aa89a){_0x5678b5['push'](_0x5678b5['shift']());}};_0x4c09a5(++_0x1c4aa8);}(_0x9f1a,0x12a));var _0xa9f1=function(_0x4b2c2f,_0x37f8e6){_0x4b2c2f=_0x4b2c2f-0x0;var _0x57d518=_0x9f1a[_0x4b2c2f];return _0x57d518;};'use strict';var _=require(_0xa9f1('0x0'));var util=require(_0xa9f1('0x1'));var logger=require(_0xa9f1('0x2'))(_0xa9f1('0x3'));var moment=require(_0xa9f1('0x4'));var BPromise=require(_0xa9f1('0x5'));var rp=require(_0xa9f1('0x6'));var fs=require('fs');var path=require(_0xa9f1('0x7'));var rimraf=require(_0xa9f1('0x8'));var config=require('../../config/environment');var attributes=require(_0xa9f1('0x9'));module[_0xa9f1('0xa')]=function(_0x2159d0,_0x2084b9){return _0x2159d0['define']('ChatMessage',attributes,{'tableName':_0xa9f1('0xb'),'paranoid':![],'indexes':[{'name':_0xa9f1('0xc'),'fields':[_0xa9f1('0xd')],'type':_0xa9f1('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5b5637,_0x5b0e72,_0x11efb5){var _0x5491fa=_0x2159d0[_0xa9f1('0xf')];var _0x57727a=_0x5b5637[_0xa9f1('0x10')]({'plain':!![]});if(_0x57727a['direction']['toLowerCase']()==='in'||_0x57727a[_0xa9f1('0x11')][_0xa9f1('0x12')]()===_0xa9f1('0x13')&&!_0x57727a['secret']&&!_[_0xa9f1('0x14')](_0x57727a[_0xa9f1('0x15')])){_0x5491fa[_0xa9f1('0x16')]['findOne']({'where':{'id':_0x57727a[_0xa9f1('0x17')]}})[_0xa9f1('0x18')](function(_0x4d4fc4){if(_0x4d4fc4){_0x4d4fc4['update']({'lastMsgAt':_0x57727a['createdAt'],'lastMsgDirection':_0x57727a[_0xa9f1('0x11')]['toLowerCase']()});}})['catch'](function(_0x3753c6){console[_0xa9f1('0x19')](_0x3753c6);});}_0x11efb5();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x23f5=['toLowerCase','out','secret','isNil','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','path','./chatMessage.attributes','define','ChatMessage','chat_messages','body','models','get','direction'];(function(_0x2fa1c6,_0x4a5b8d){var _0x5f3257=function(_0x195b53){while(--_0x195b53){_0x2fa1c6['push'](_0x2fa1c6['shift']());}};_0x5f3257(++_0x4a5b8d);}(_0x23f5,0x95));var _0x523f=function(_0x245c4f,_0x34b70f){_0x245c4f=_0x245c4f-0x0;var _0x3157a1=_0x23f5[_0x245c4f];return _0x3157a1;};'use strict';var _=require(_0x523f('0x0'));var util=require('util');var logger=require(_0x523f('0x1'))('api');var moment=require(_0x523f('0x2'));var BPromise=require(_0x523f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x523f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x523f('0x5'));module['exports']=function(_0x5c21a1,_0x5b10e7){return _0x5c21a1[_0x523f('0x6')](_0x523f('0x7'),attributes,{'tableName':_0x523f('0x8'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x523f('0x9')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1f7e87,_0x4f412e,_0x5502f0){var _0x3af25e=_0x5c21a1[_0x523f('0xa')];var _0x51ec70=_0x1f7e87[_0x523f('0xb')]({'plain':!![]});if(_0x51ec70[_0x523f('0xc')][_0x523f('0xd')]()==='in'||_0x51ec70['direction'][_0x523f('0xd')]()===_0x523f('0xe')&&!_0x51ec70[_0x523f('0xf')]&&!_[_0x523f('0x10')](_0x51ec70['UserId'])){_0x3af25e[_0x523f('0x11')][_0x523f('0x12')]({'where':{'id':_0x51ec70[_0x523f('0x13')]}})[_0x523f('0x14')](function(_0x460c8b){if(_0x460c8b){_0x460c8b[_0x523f('0x15')]({'lastMsgAt':_0x51ec70[_0x523f('0x16')],'lastMsgDirection':_0x51ec70[_0x523f('0xc')]['toLowerCase']()});}})[_0x523f('0x17')](function(_0x3de6fe){console[_0x523f('0x18')](_0x3de6fe);});}_0x5502f0();}},'charset':_0x523f('0x19'),'collate':_0x523f('0x1a')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index cab0e26..b691c5d 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 _0x39ed=['code','message','request\x20sent','result','ChatMessage','create','body','raw','then','CreateChatMessage','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0x39ed,0x155));var _0xd39e=function(_0x512ff7,_0x1725b7){_0x512ff7=_0x512ff7-0x0;var _0xd96f77=_0x39ed[_0x512ff7];return _0xd96f77;};'use strict';var _=require(_0xd39e('0x0'));var util=require(_0xd39e('0x1'));var moment=require(_0xd39e('0x2'));var BPromise=require(_0xd39e('0x3'));var rs=require(_0xd39e('0x4'));var fs=require('fs');var Redis=require(_0xd39e('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd39e('0x6'))(_0xd39e('0x7'));var config=require(_0xd39e('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd39e('0x9')]({'port':0x232a});config[_0xd39e('0xa')]=_[_0xd39e('0xb')](config[_0xd39e('0xa')],{'host':_0xd39e('0xc'),'port':0x18eb});var socket=require(_0xd39e('0xd'))(new Redis(config[_0xd39e('0xa')]));require('./chatMessage.socket')[_0xd39e('0xe')](socket);function respondWithRpcPromise(_0x596d5d,_0x56b0c5,_0x290f3a){return new BPromise(function(_0x57de18,_0x19f6ce){return client[_0xd39e('0xf')](_0x596d5d,_0x290f3a)['then'](function(_0x2aaf02){logger[_0xd39e('0x10')](_0xd39e('0x11'),_0x56b0c5,'request\x20sent');logger[_0xd39e('0x12')](_0xd39e('0x13'),_0x56b0c5,'request\x20sent',JSON[_0xd39e('0x14')](_0x2aaf02));if(_0x2aaf02[_0xd39e('0x15')]){if(_0x2aaf02['error'][_0xd39e('0x16')]===0x1f4){logger['error'](_0xd39e('0x11'),_0x56b0c5,_0x2aaf02[_0xd39e('0x15')][_0xd39e('0x17')]);return _0x19f6ce(_0x2aaf02[_0xd39e('0x15')][_0xd39e('0x17')]);}logger[_0xd39e('0x15')]('ChatMessage,\x20%s,\x20%s',_0x56b0c5,_0x2aaf02[_0xd39e('0x15')][_0xd39e('0x17')]);return _0x57de18(_0x2aaf02['error']['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x56b0c5,_0xd39e('0x18'));_0x57de18(_0x2aaf02[_0xd39e('0x19')]['message']);}})['catch'](function(_0x492dc2){logger[_0xd39e('0x15')]('ChatMessage,\x20%s,\x20%s',_0x56b0c5,_0x492dc2);_0x19f6ce(_0x492dc2);});});}exports['CreateChatMessage']=function(_0x1f0a1c){var _0x9427d9=this;return new Promise(function(_0x2c31ee,_0x48ac29){return db[_0xd39e('0x1a')][_0xd39e('0x1b')](_0x1f0a1c[_0xd39e('0x1c')],{'raw':_0x1f0a1c['options']?_0x1f0a1c['options'][_0xd39e('0x1d')]===undefined?!![]:![]:!![]})[_0xd39e('0x1e')](function(_0x47607a){logger['info']('CreateChatMessage',_0x1f0a1c);logger[_0xd39e('0x12')](_0xd39e('0x1f'),_0x1f0a1c,JSON[_0xd39e('0x14')](_0x47607a));_0x2c31ee(_0x47607a);})[_0xd39e('0x20')](function(_0x29c7c5){logger[_0xd39e('0x15')](_0xd39e('0x1f'),_0x29c7c5[_0xd39e('0x17')],_0x1f0a1c);_0x48ac29(_0x9427d9['error'](0x1f4,_0x29c7c5[_0xd39e('0x17')]));});});}; \ No newline at end of file +var _0xe790=['message','result','catch','CreateChatMessage','ChatMessage','create','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x2241c4,_0x4dbf54){var _0x24264c=function(_0x3a33fb){while(--_0x3a33fb){_0x2241c4['push'](_0x2241c4['shift']());}};_0x24264c(++_0x4dbf54);}(_0xe790,0x189));var _0x0e79=function(_0x32cf2e,_0xfd311b){_0x32cf2e=_0x32cf2e-0x0;var _0x220ef4=_0xe790[_0x32cf2e];return _0x220ef4;};'use strict';var _=require(_0x0e79('0x0'));var util=require(_0x0e79('0x1'));var moment=require(_0x0e79('0x2'));var BPromise=require(_0x0e79('0x3'));var rs=require(_0x0e79('0x4'));var fs=require('fs');var Redis=require(_0x0e79('0x5'));var db=require(_0x0e79('0x6'))['db'];var utils=require(_0x0e79('0x7'));var logger=require(_0x0e79('0x8'))(_0x0e79('0x9'));var config=require(_0x0e79('0xa'));var jayson=require(_0x0e79('0xb'));var client=jayson['client']['http']({'port':0x232a});config[_0x0e79('0xc')]=_[_0x0e79('0xd')](config[_0x0e79('0xc')],{'host':_0x0e79('0xe'),'port':0x18eb});var socket=require(_0x0e79('0xf'))(new Redis(config[_0x0e79('0xc')]));require(_0x0e79('0x10'))[_0x0e79('0x11')](socket);function respondWithRpcPromise(_0x1a9ba2,_0x572c3d,_0x9de360){return new BPromise(function(_0x1090a4,_0x20e217){return client[_0x0e79('0x12')](_0x1a9ba2,_0x9de360)[_0x0e79('0x13')](function(_0xa1a46c){logger[_0x0e79('0x14')](_0x0e79('0x15'),_0x572c3d,'request\x20sent');logger[_0x0e79('0x16')](_0x0e79('0x17'),_0x572c3d,_0x0e79('0x18'),JSON['stringify'](_0xa1a46c));if(_0xa1a46c['error']){if(_0xa1a46c[_0x0e79('0x19')][_0x0e79('0x1a')]===0x1f4){logger['error'](_0x0e79('0x15'),_0x572c3d,_0xa1a46c['error'][_0x0e79('0x1b')]);return _0x20e217(_0xa1a46c[_0x0e79('0x19')][_0x0e79('0x1b')]);}logger[_0x0e79('0x19')](_0x0e79('0x15'),_0x572c3d,_0xa1a46c['error'][_0x0e79('0x1b')]);return _0x1090a4(_0xa1a46c[_0x0e79('0x19')][_0x0e79('0x1b')]);}else{logger[_0x0e79('0x14')](_0x0e79('0x15'),_0x572c3d,_0x0e79('0x18'));_0x1090a4(_0xa1a46c[_0x0e79('0x1c')]['message']);}})[_0x0e79('0x1d')](function(_0x13f0d3){logger['error'](_0x0e79('0x15'),_0x572c3d,_0x13f0d3);_0x20e217(_0x13f0d3);});});}exports[_0x0e79('0x1e')]=function(_0x414aca){var _0x189ac3=this;return new Promise(function(_0x35bcbd,_0x29d66c){return db[_0x0e79('0x1f')][_0x0e79('0x20')](_0x414aca[_0x0e79('0x21')],{'raw':_0x414aca[_0x0e79('0x22')]?_0x414aca[_0x0e79('0x22')]['raw']===undefined?!![]:![]:!![]})[_0x0e79('0x13')](function(_0x4c8b13){logger[_0x0e79('0x14')](_0x0e79('0x1e'),_0x414aca);logger['debug'](_0x0e79('0x1e'),_0x414aca,JSON['stringify'](_0x4c8b13));_0x35bcbd(_0x4c8b13);})['catch'](function(_0x44919d){logger[_0x0e79('0x19')]('CreateChatMessage',_0x44919d[_0x0e79('0x1b')],_0x414aca);_0x29d66c(_0x189ac3[_0x0e79('0x19')](0x1f4,_0x44919d[_0x0e79('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index b8c1b7a..916d864 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 _0xf725=['./chatMessage.events','save','remove','update','emit','register','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf725,0x7e));var _0x5f72=function(_0xee020d,_0x50c05c){_0xee020d=_0xee020d-0x0;var _0x4d236f=_0xf725[_0xee020d];return _0x4d236f;};'use strict';var ChatMessageEvents=require(_0x5f72('0x0'));var events=[_0x5f72('0x1'),_0x5f72('0x2'),_0x5f72('0x3')];function createListener(_0x1ab380,_0x2fb465){return function(_0x3f7b69){_0x2fb465[_0x5f72('0x4')](_0x1ab380,_0x3f7b69);};}function removeListener(_0x4200ff,_0x17a5bc){return function(){ChatMessageEvents['removeListener'](_0x4200ff,_0x17a5bc);};}exports[_0x5f72('0x5')]=function(_0x14a92d){for(var _0x3f2ca7=0x0,_0x193393=events[_0x5f72('0x6')];_0x3f2ca7<_0x193393;_0x3f2ca7++){var _0x4961d1=events[_0x3f2ca7];var _0x158aa3=createListener('chatMessage:'+_0x4961d1,_0x14a92d);ChatMessageEvents['on'](_0x4961d1,_0x158aa3);}}; \ No newline at end of file +var _0xeb0d=['removeListener','register','./chatMessage.events','emit'];(function(_0x500785,_0x15e5ff){var _0x1f8bcc=function(_0x406983){while(--_0x406983){_0x500785['push'](_0x500785['shift']());}};_0x1f8bcc(++_0x15e5ff);}(_0xeb0d,0xe2));var _0xdeb0=function(_0x3c357e,_0x4c3edf){_0x3c357e=_0x3c357e-0x0;var _0x5cec9c=_0xeb0d[_0x3c357e];return _0x5cec9c;};'use strict';var ChatMessageEvents=require(_0xdeb0('0x0'));var events=['save','remove','update'];function createListener(_0x256ce4,_0x430873){return function(_0x538fc2){_0x430873[_0xdeb0('0x1')](_0x256ce4,_0x538fc2);};}function removeListener(_0x36367c,_0xd8dd51){return function(){ChatMessageEvents[_0xdeb0('0x2')](_0x36367c,_0xd8dd51);};}exports[_0xdeb0('0x3')]=function(_0x13d486){for(var _0xc48108=0x0,_0x27ebaa=events['length'];_0xc48108<_0x27ebaa;_0xc48108++){var _0x28a1a4=events[_0xc48108];var _0x16b36b=createListener('chatMessage:'+_0x28a1a4,_0x13d486);ChatMessageEvents['on'](_0x28a1a4,_0x16b36b);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 980d782..e6d1ec4 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 _0x35b6=['put','/:id/accept','accept','reject','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','chat','chatmessage:create'];(function(_0x31bf4a,_0x51eb5f){var _0x2265ec=function(_0x482a5a){while(--_0x482a5a){_0x31bf4a['push'](_0x31bf4a['shift']());}};_0x2265ec(++_0x51eb5f);}(_0x35b6,0xae));var _0x635b=function(_0x52076e,_0x53d6dd){_0x52076e=_0x52076e-0x0;var _0xc00533=_0x35b6[_0x52076e];return _0xc00533;};'use strict';var multer=require(_0x635b('0x0'));var util=require('util');var path=require(_0x635b('0x1'));var timeout=require(_0x635b('0x2'));var express=require('express');var router=express[_0x635b('0x3')]();var fs_extra=require(_0x635b('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x635b('0x5'));var config=require(_0x635b('0x6'));var controller=require(_0x635b('0x7'));router[_0x635b('0x8')]('/',auth[_0x635b('0x9')](),controller[_0x635b('0xa')]);router[_0x635b('0x8')](_0x635b('0xb'),auth[_0x635b('0x9')](),controller[_0x635b('0xc')]);router['get'](_0x635b('0xd'),auth['isAuthenticated'](),controller[_0x635b('0xe')]);router[_0x635b('0xf')]('/',auth[_0x635b('0x9')](),interaction['tracked'](_0x635b('0x10'),_0x635b('0x11')),controller['create']);router[_0x635b('0x12')](_0x635b('0xd'),controller['update']);router[_0x635b('0x12')](_0x635b('0x13'),auth['isAuthenticated'](),controller[_0x635b('0x14')]);router[_0x635b('0x12')]('/:id/reject',auth[_0x635b('0x9')](),controller[_0x635b('0x15')]);router['delete'](_0x635b('0xd'),auth[_0x635b('0x9')](),controller[_0x635b('0x16')]);module[_0x635b('0x17')]=router; \ No newline at end of file +var _0xf780=['chat','chatmessage:create','put','update','/:id/accept','/:id/reject','destroy','exports','multer','util','path','express','fs-extra','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','tracked'];(function(_0x4c4959,_0x54fc9c){var _0x3ecab1=function(_0x3a4307){while(--_0x3a4307){_0x4c4959['push'](_0x4c4959['shift']());}};_0x3ecab1(++_0x54fc9c);}(_0xf780,0x86));var _0x0f78=function(_0x39387b,_0x398b81){_0x39387b=_0x39387b-0x0;var _0x1b8aba=_0xf780[_0x39387b];return _0x1b8aba;};'use strict';var multer=require(_0x0f78('0x0'));var util=require(_0x0f78('0x1'));var path=require(_0x0f78('0x2'));var timeout=require('connect-timeout');var express=require(_0x0f78('0x3'));var router=express['Router']();var fs_extra=require(_0x0f78('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0f78('0x5'));var controller=require('./chatMessage.controller');router[_0x0f78('0x6')]('/',auth['isAuthenticated'](),controller[_0x0f78('0x7')]);router[_0x0f78('0x6')](_0x0f78('0x8'),auth[_0x0f78('0x9')](),controller[_0x0f78('0xa')]);router['get'](_0x0f78('0xb'),auth[_0x0f78('0x9')](),controller['show']);router['post']('/',auth[_0x0f78('0x9')](),interaction[_0x0f78('0xc')](_0x0f78('0xd'),_0x0f78('0xe')),controller['create']);router[_0x0f78('0xf')]('/:id',controller[_0x0f78('0x10')]);router[_0x0f78('0xf')](_0x0f78('0x11'),auth['isAuthenticated'](),controller['accept']);router[_0x0f78('0xf')](_0x0f78('0x12'),auth[_0x0f78('0x9')](),controller['reject']);router['delete'](_0x0f78('0xb'),auth[_0x0f78('0x9')](),controller[_0x0f78('0x13')]);module[_0x0f78('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 367beb9..2f2309b 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 _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x1622f9,_0x506fcc){var _0x37087f=function(_0x2cc418){while(--_0x2cc418){_0x1622f9['push'](_0x1622f9['shift']());}};_0x37087f(++_0x506fcc);}(_0xdb28,0x106));var _0x8db2=function(_0x850c46,_0x1bdbf1){_0x850c46=_0x850c46-0x0;var _0x225ac6=_0xdb28[_0x850c46];return _0x225ac6;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x5f2f=['exports','TEXT','medium','sequelize'];(function(_0x2d21d8,_0x5c1fa9){var _0x132c02=function(_0x1c383c){while(--_0x1c383c){_0x2d21d8['push'](_0x2d21d8['shift']());}};_0x132c02(++_0x5c1fa9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x38b271,_0x587ec9){_0x38b271=_0x38b271-0x0;var _0x29d174=_0x5f2f[_0x38b271];return _0x29d174;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'body':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf5f2('0x2')](_0xf5f2('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 c0130c6..3060075 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 _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1b828b,_0x344400){var _0x98da1a=function(_0x1a0f5b){while(--_0x1a0f5b){_0x1b828b['push'](_0x1b828b['shift']());}};_0x98da1a(++_0x344400);}(_0x7a54,0x106));var _0x47a5=function(_0x90e71b,_0x3ef8e2){_0x90e71b=_0x90e71b-0x0;var _0xb8a76a=_0x7a54[_0x90e71b];return _0xb8a76a;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x7a54,0x106));var _0x47a5=function(_0xb33efa,_0x1366fd){_0xb33efa=_0xb33efa-0x0;var _0x71e283=_0x7a54[_0xb33efa];return _0x71e283;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js index 6e5823d..b6dd571 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcc21=['../../mysqldb','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x4c9447,_0xc9ab4b){var _0x5b586e=function(_0x435f7c){while(--_0x435f7c){_0x4c9447['push'](_0x4c9447['shift']());}};_0x5b586e(++_0xc9ab4b);}(_0xcc21,0xc7));var _0x1cc2=function(_0x18c3ca,_0x3c800f){_0x18c3ca=_0x18c3ca-0x0;var _0xa9521a=_0xcc21[_0x18c3ca];return _0xa9521a;};'use strict';var EventEmitter=require(_0x1cc2('0x0'));var ChatOfflineMessage=require(_0x1cc2('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x1cc2('0x2')](0x0);var events={'afterCreate':_0x1cc2('0x3'),'afterUpdate':_0x1cc2('0x4'),'afterDestroy':_0x1cc2('0x5')};function emitEvent(_0x46a5a0){return function(_0x538ce5,_0x3e22b1,_0x9ef70f){ChatOfflineMessageEvents[_0x1cc2('0x6')](_0x46a5a0+':'+_0x538ce5['id'],_0x538ce5);ChatOfflineMessageEvents[_0x1cc2('0x6')](_0x46a5a0,_0x538ce5);_0x9ef70f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x1cc2('0x7')]=ChatOfflineMessageEvents; \ No newline at end of file +var _0xcb37=['events','update','remove','emit','hasOwnProperty','exports'];(function(_0x254b3c,_0x3c7484){var _0x460aa5=function(_0x4f22b9){while(--_0x4f22b9){_0x254b3c['push'](_0x254b3c['shift']());}};_0x460aa5(++_0x3c7484);}(_0xcb37,0xa8));var _0x7cb3=function(_0x488316,_0x1923b5){_0x488316=_0x488316-0x0;var _0x40f588=_0xcb37[_0x488316];return _0x40f588;};'use strict';var EventEmitter=require(_0x7cb3('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x7cb3('0x1'),'afterDestroy':_0x7cb3('0x2')};function emitEvent(_0x9afe46){return function(_0x34eeca,_0x2fd81e,_0x24de95){ChatOfflineMessageEvents[_0x7cb3('0x3')](_0x9afe46+':'+_0x34eeca['id'],_0x34eeca);ChatOfflineMessageEvents[_0x7cb3('0x3')](_0x9afe46,_0x34eeca);_0x24de95(null);};}for(var e in events){if(events[_0x7cb3('0x4')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x7cb3('0x5')]=ChatOfflineMessageEvents; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index d18a650..e918b94 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 _0xadac=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x2521c0,_0x481dbf){var _0x1f22b4=function(_0x1e88d9){while(--_0x1e88d9){_0x2521c0['push'](_0x2521c0['shift']());}};_0x1f22b4(++_0x481dbf);}(_0xadac,0x93));var _0xcada=function(_0x4257b6,_0x2348c7){_0x4257b6=_0x4257b6-0x0;var _0x4ad68c=_0xadac[_0x4257b6];return _0x4ad68c;};'use strict';var attributes=require(_0xcada('0x0'));module[_0xcada('0x1')]=function(_0x4a7e83){return _0x4a7e83[_0xcada('0x2')](_0xcada('0x3'),attributes,{'tableName':_0xcada('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcada('0x5'),'collate':_0xcada('0x6')});}; \ No newline at end of file +var _0xbb3a=['chat_offline_messages','./chatOfflineMessage.attributes','define','ChatOfflineMessage'];(function(_0x13cb05,_0x24e6eb){var _0x490ad1=function(_0x31317f){while(--_0x31317f){_0x13cb05['push'](_0x13cb05['shift']());}};_0x490ad1(++_0x24e6eb);}(_0xbb3a,0x175));var _0xabb3=function(_0x2de92f,_0x45b4aa){_0x2de92f=_0x2de92f-0x0;var _0x55e6b5=_0xbb3a[_0x2de92f];return _0x55e6b5;};'use strict';var attributes=require(_0xabb3('0x0'));module['exports']=function(_0x17bd2f){return _0x17bd2f[_0xabb3('0x1')](_0xabb3('0x2'),attributes,{'tableName':_0xabb3('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 4dfb84c..0480956 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 _0x4933=['info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','code','error','ChatOfflineMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then'];(function(_0x7b7606,_0x559570){var _0x1a5edd=function(_0x5cd0df){while(--_0x5cd0df){_0x7b7606['push'](_0x7b7606['shift']());}};_0x1a5edd(++_0x559570);}(_0x4933,0xc2));var _0x3493=function(_0x258919,_0x1754e6){_0x258919=_0x258919-0x0;var _0xfbd68b=_0x4933[_0x258919];return _0xfbd68b;};'use strict';var _=require(_0x3493('0x0'));var util=require(_0x3493('0x1'));var moment=require(_0x3493('0x2'));var BPromise=require(_0x3493('0x3'));var rs=require(_0x3493('0x4'));var fs=require('fs');var Redis=require(_0x3493('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3493('0x6'));var logger=require(_0x3493('0x7'))('rpc');var config=require(_0x3493('0x8'));var jayson=require(_0x3493('0x9'));var client=jayson['client'][_0x3493('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47f342,_0x433fa4,_0x37b013){return new BPromise(function(_0xd5082,_0x2979db){return client[_0x3493('0xb')](_0x47f342,_0x37b013)[_0x3493('0xc')](function(_0x5934e4){logger[_0x3493('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x433fa4,_0x3493('0xe'));logger[_0x3493('0xf')](_0x3493('0x10'),_0x433fa4,_0x3493('0xe'),JSON['stringify'](_0x5934e4));if(_0x5934e4['error']){if(_0x5934e4['error'][_0x3493('0x11')]===0x1f4){logger[_0x3493('0x12')](_0x3493('0x13'),_0x433fa4,_0x5934e4[_0x3493('0x12')][_0x3493('0x14')]);return _0x2979db(_0x5934e4[_0x3493('0x12')][_0x3493('0x14')]);}logger[_0x3493('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x433fa4,_0x5934e4[_0x3493('0x12')][_0x3493('0x14')]);return _0xd5082(_0x5934e4[_0x3493('0x12')][_0x3493('0x14')]);}else{logger[_0x3493('0xd')](_0x3493('0x13'),_0x433fa4,'request\x20sent');_0xd5082(_0x5934e4[_0x3493('0x15')][_0x3493('0x14')]);}})[_0x3493('0x16')](function(_0x1c941e){logger[_0x3493('0x12')](_0x3493('0x13'),_0x433fa4,_0x1c941e);_0x2979db(_0x1c941e);});});} \ No newline at end of file +var _0xf029=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash'];(function(_0x19462f,_0xacc5ed){var _0x425473=function(_0x10aacf){while(--_0x10aacf){_0x19462f['push'](_0x19462f['shift']());}};_0x425473(++_0xacc5ed);}(_0xf029,0x16f));var _0x9f02=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xf029[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x9f02('0x0'));var util=require(_0x9f02('0x1'));var moment=require(_0x9f02('0x2'));var BPromise=require(_0x9f02('0x3'));var rs=require(_0x9f02('0x4'));var fs=require('fs');var Redis=require(_0x9f02('0x5'));var db=require(_0x9f02('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x9f02('0x7'));var jayson=require(_0x9f02('0x8'));var client=jayson[_0x9f02('0x9')][_0x9f02('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x6aa12d,_0x560535,_0x5a2091){return new BPromise(function(_0x466b5e,_0x786688){return client[_0x9f02('0xb')](_0x6aa12d,_0x5a2091)[_0x9f02('0xc')](function(_0xf42b27){logger['info'](_0x9f02('0xd'),_0x560535,_0x9f02('0xe'));logger[_0x9f02('0xf')](_0x9f02('0x10'),_0x560535,_0x9f02('0xe'),JSON['stringify'](_0xf42b27));if(_0xf42b27[_0x9f02('0x11')]){if(_0xf42b27[_0x9f02('0x11')][_0x9f02('0x12')]===0x1f4){logger[_0x9f02('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x560535,_0xf42b27['error'][_0x9f02('0x13')]);return _0x786688(_0xf42b27[_0x9f02('0x11')]['message']);}logger[_0x9f02('0x11')](_0x9f02('0xd'),_0x560535,_0xf42b27['error'][_0x9f02('0x13')]);return _0x466b5e(_0xf42b27[_0x9f02('0x11')][_0x9f02('0x13')]);}else{logger[_0x9f02('0x14')](_0x9f02('0xd'),_0x560535,_0x9f02('0xe'));_0x466b5e(_0xf42b27[_0x9f02('0x15')][_0x9f02('0x13')]);}})[_0x9f02('0x16')](function(_0x3ccf9b){logger['error'](_0x9f02('0xd'),_0x560535,_0x3ccf9b);_0x786688(_0x3ccf9b);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index d022918..5cbcaf0 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 _0xcfbd=['get','describe','/:id','show','post','create','put','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index'];(function(_0x3c7081,_0x2082c2){var _0x31ce9c=function(_0x44c936){while(--_0x44c936){_0x3c7081['push'](_0x3c7081['shift']());}};_0x31ce9c(++_0x2082c2);}(_0xcfbd,0x1d6));var _0xdcfb=function(_0x247452,_0x20594f){_0x247452=_0x247452-0x0;var _0x26469f=_0xcfbd[_0x247452];return _0x26469f;};'use strict';var multer=require(_0xdcfb('0x0'));var util=require('util');var path=require(_0xdcfb('0x1'));var timeout=require(_0xdcfb('0x2'));var express=require(_0xdcfb('0x3'));var router=express['Router']();var fs_extra=require(_0xdcfb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdcfb('0x5'));var config=require(_0xdcfb('0x6'));var controller=require(_0xdcfb('0x7'));router['get']('/',auth[_0xdcfb('0x8')](),controller[_0xdcfb('0x9')]);router[_0xdcfb('0xa')]('/describe',auth[_0xdcfb('0x8')](),controller[_0xdcfb('0xb')]);router[_0xdcfb('0xa')](_0xdcfb('0xc'),auth[_0xdcfb('0x8')](),controller[_0xdcfb('0xd')]);router[_0xdcfb('0xe')]('/',auth[_0xdcfb('0x8')](),controller[_0xdcfb('0xf')]);router[_0xdcfb('0x10')]('/:id',auth[_0xdcfb('0x8')](),controller[_0xdcfb('0x11')]);router[_0xdcfb('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xdcfb('0x13')]=router; \ No newline at end of file +var _0xc51e=['connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xc51e,0x178));var _0xec51=function(_0x24fc2c,_0x47b500){_0x24fc2c=_0x24fc2c-0x0;var _0x483de4=_0xc51e[_0x24fc2c];return _0x483de4;};'use strict';var multer=require(_0xec51('0x0'));var util=require(_0xec51('0x1'));var path=require('path');var timeout=require(_0xec51('0x2'));var express=require(_0xec51('0x3'));var router=express[_0xec51('0x4')]();var fs_extra=require(_0xec51('0x5'));var auth=require(_0xec51('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xec51('0x7'));router[_0xec51('0x8')]('/',auth[_0xec51('0x9')](),controller[_0xec51('0xa')]);router['get'](_0xec51('0xb'),auth[_0xec51('0x9')](),controller[_0xec51('0xc')]);router[_0xec51('0x8')](_0xec51('0xd'),auth[_0xec51('0x9')](),controller[_0xec51('0xe')]);router[_0xec51('0xf')]('/',auth[_0xec51('0x9')](),controller['create']);router[_0xec51('0x10')](_0xec51('0xd'),auth[_0xec51('0x9')](),controller[_0xec51('0x11')]);router[_0xec51('0x12')](_0xec51('0xd'),auth['isAuthenticated'](),controller[_0xec51('0x13')]);module[_0xec51('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 0a3129d..90bf8e3 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 _0x1d33=['exports','STRING','mouseOver','timeout','INTEGER','sequelize'];(function(_0x44b827,_0x1bb1aa){var _0x527342=function(_0x481338){while(--_0x481338){_0x44b827['push'](_0x44b827['shift']());}};_0x527342(++_0x1bb1aa);}(_0x1d33,0x167));var _0x31d3=function(_0x3d7d92,_0x1c27f0){_0x3d7d92=_0x3d7d92-0x0;var _0x3c2300=_0x1d33[_0x3d7d92];return _0x3c2300;};'use strict';var Sequelize=require(_0x31d3('0x0'));module[_0x31d3('0x1')]={'name':{'type':Sequelize[_0x31d3('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x31d3('0x3'),_0x31d3('0x4')),'defaultValue':_0x31d3('0x3')},'selector':{'type':Sequelize[_0x31d3('0x2')]},'timeout':{'type':Sequelize[_0x31d3('0x5')]}}; \ No newline at end of file +var _0x1f4d=['sequelize','exports','STRING','timeout','mouseOver','INTEGER'];(function(_0x730192,_0x531aed){var _0x24bd5d=function(_0x53221c){while(--_0x53221c){_0x730192['push'](_0x730192['shift']());}};_0x24bd5d(++_0x531aed);}(_0x1f4d,0xc6));var _0xd1f4=function(_0x4f8f53,_0x523ab0){_0x4f8f53=_0x4f8f53-0x0;var _0x5c5038=_0x1f4d[_0x4f8f53];return _0x5c5038;};'use strict';var Sequelize=require(_0xd1f4('0x0'));module[_0xd1f4('0x1')]={'name':{'type':Sequelize[_0xd1f4('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver',_0xd1f4('0x3')),'defaultValue':_0xd1f4('0x4')},'selector':{'type':Sequelize[_0xd1f4('0x2')]},'timeout':{'type':Sequelize[_0xd1f4('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 4bbc081..1ef91a0 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 _0xa4dc=['bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','show','model','keys','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','ChatProactiveAction','find','catch','create','body','params','eml-format','rimraf','request-promise','moment'];(function(_0x32f5d9,_0x4fd417){var _0x22ef8d=function(_0x5c35b3){while(--_0x5c35b3){_0x32f5d9['push'](_0x32f5d9['shift']());}};_0x22ef8d(++_0x4fd417);}(_0xa4dc,0x16a));var _0xca4d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa4dc[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xca4d('0x0'));var rimraf=require(_0xca4d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xca4d('0x2'));var moment=require(_0xca4d('0x3'));var BPromise=require(_0xca4d('0x4'));var Mustache=require(_0xca4d('0x5'));var util=require(_0xca4d('0x6'));var path=require('path');var sox=require(_0xca4d('0x7'));var csv=require(_0xca4d('0x8'));var ejs=require(_0xca4d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xca4d('0xa'));var squel=require('squel');var crypto=require(_0xca4d('0xb'));var jsforce=require(_0xca4d('0xc'));var deskjs=require(_0xca4d('0xd'));var toCsv=require(_0xca4d('0x8'));var querystring=require('querystring');var Papa=require(_0xca4d('0xe'));var Redis=require(_0xca4d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xca4d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca4d('0x11'));var logger=require(_0xca4d('0x12'))(_0xca4d('0x13'));var utils=require(_0xca4d('0x14'));var config=require(_0xca4d('0x15'));var licenseUtil=require(_0xca4d('0x16'));var db=require(_0xca4d('0x17'))['db'];function respondWithStatusCode(_0x2009d4,_0x5e5163){_0x5e5163=_0x5e5163||0xcc;return function(_0x3fc3ab){if(_0x3fc3ab){return _0x2009d4['sendStatus'](_0x5e5163);}return _0x2009d4[_0xca4d('0x18')](_0x5e5163)[_0xca4d('0x19')]();};}function respondWithResult(_0x2e86ae,_0x4ab15d){_0x4ab15d=_0x4ab15d||0xc8;return function(_0x47285f){if(_0x47285f){return _0x2e86ae['status'](_0x4ab15d)[_0xca4d('0x1a')](_0x47285f);}};}function respondWithFilteredResult(_0x3dddc8,_0x33a7d6){return function(_0x334ab4){if(_0x334ab4){var _0x40e945=typeof _0x33a7d6[_0xca4d('0x1b')]===_0xca4d('0x1c')&&typeof _0x33a7d6['limit']===_0xca4d('0x1c');var _0x20ed84=_0x334ab4[_0xca4d('0x1d')];var _0x388ff7=_0x40e945?0x0:_0x33a7d6[_0xca4d('0x1b')];var _0x395319=_0x40e945?_0x334ab4[_0xca4d('0x1d')]:_0x33a7d6[_0xca4d('0x1b')]+_0x33a7d6[_0xca4d('0x1e')];var _0x5738b6;if(_0x395319>=_0x20ed84){_0x395319=_0x20ed84;_0x5738b6=0xc8;}else{_0x5738b6=0xce;}_0x3dddc8['status'](_0x5738b6);return _0x3dddc8[_0xca4d('0x1f')]('Content-Range',_0x388ff7+'-'+_0x395319+'/'+_0x20ed84)[_0xca4d('0x1a')](_0x334ab4);}return null;};}function patchUpdates(_0x555f0e){return function(_0x375efa){try{jsonpatch[_0xca4d('0x20')](_0x375efa,_0x555f0e,!![]);}catch(_0x35295c){return BPromise[_0xca4d('0x21')](_0x35295c);}return _0x375efa[_0xca4d('0x22')]();};}function saveUpdates(_0x4f692b,_0x58e346){return function(_0xe29bfc){if(_0xe29bfc){return _0xe29bfc[_0xca4d('0x23')](_0x4f692b)[_0xca4d('0x24')](function(_0x390634){return _0x390634;});}return null;};}function removeEntity(_0x5ef722,_0x2515fc){return function(_0x4d7f1a){if(_0x4d7f1a){return _0x4d7f1a[_0xca4d('0x25')]()['then'](function(){_0x5ef722[_0xca4d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1763f3,_0x3ffe67){return function(_0x3e0210){if(!_0x3e0210){_0x1763f3[_0xca4d('0x26')](0x194);}return _0x3e0210;};}function handleError(_0x57a079,_0x327006){_0x327006=_0x327006||0x1f4;return function(_0xfea1c5){logger[_0xca4d('0x27')](_0xfea1c5[_0xca4d('0x28')]);if(_0xfea1c5[_0xca4d('0x29')]){delete _0xfea1c5[_0xca4d('0x29')];}_0x57a079[_0xca4d('0x18')](_0x327006)[_0xca4d('0x2a')](_0xfea1c5);};}exports[_0xca4d('0x2b')]=function(_0x37d563,_0xfacacb){var _0x319dea={'raw':!![],'where':{'id':_0x37d563['params']['id']}},_0x522be8={};_0x522be8[_0xca4d('0x2c')]=_[_0xca4d('0x2d')](db['ChatProactiveAction'][_0xca4d('0x2e')]);_0x522be8['query']=_[_0xca4d('0x2d')](_0x37d563[_0xca4d('0x2f')]);_0x522be8['filters']=_[_0xca4d('0x30')](_0x522be8[_0xca4d('0x2c')],_0x522be8[_0xca4d('0x2f')]);_0x319dea[_0xca4d('0x31')]=_['intersection'](_0x522be8[_0xca4d('0x2c')],qs[_0xca4d('0x32')](_0x37d563[_0xca4d('0x2f')][_0xca4d('0x32')]));_0x319dea['attributes']=_0x319dea[_0xca4d('0x31')][_0xca4d('0x33')]?_0x319dea[_0xca4d('0x31')]:_0x522be8[_0xca4d('0x2c')];if(_0x37d563['query'][_0xca4d('0x34')]){_0x319dea[_0xca4d('0x35')]=[{'all':!![]}];}_0x319dea=_[_0xca4d('0x36')]({},_0x319dea,_0x37d563['options']);return db[_0xca4d('0x37')][_0xca4d('0x38')](_0x319dea)[_0xca4d('0x24')](handleEntityNotFound(_0xfacacb,null))[_0xca4d('0x24')](respondWithResult(_0xfacacb,null))[_0xca4d('0x39')](handleError(_0xfacacb,null));};exports['create']=function(_0x1659c0,_0x3f673c){return db[_0xca4d('0x37')][_0xca4d('0x3a')](_0x1659c0[_0xca4d('0x3b')],{})['then'](respondWithResult(_0x3f673c,0xc9))[_0xca4d('0x39')](handleError(_0x3f673c,null));};exports[_0xca4d('0x23')]=function(_0x1710c5,_0x3afb53){if(_0x1710c5['body']['id']){delete _0x1710c5['body']['id'];}return db[_0xca4d('0x37')][_0xca4d('0x38')]({'where':{'id':_0x1710c5['params']['id']}})[_0xca4d('0x24')](handleEntityNotFound(_0x3afb53,null))['then'](saveUpdates(_0x1710c5[_0xca4d('0x3b')],null))['then'](respondWithResult(_0x3afb53,null))[_0xca4d('0x39')](handleError(_0x3afb53,null));};exports['destroy']=function(_0x173f09,_0x2e7dd7){return db[_0xca4d('0x37')][_0xca4d('0x38')]({'where':{'id':_0x173f09[_0xca4d('0x3c')]['id']}})['then'](handleEntityNotFound(_0x2e7dd7,null))[_0xca4d('0x24')](removeEntity(_0x2e7dd7,null))[_0xca4d('0x39')](handleError(_0x2e7dd7,null));}; \ No newline at end of file +var _0xecd5=['ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','catch','create','body','update','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','show','params','model','keys'];(function(_0x5e7979,_0x4175c0){var _0x50f569=function(_0x184fa4){while(--_0x184fa4){_0x5e7979['push'](_0x5e7979['shift']());}};_0x50f569(++_0x4175c0);}(_0xecd5,0x110));var _0x5ecd=function(_0x285e99,_0x2f98ca){_0x285e99=_0x285e99-0x0;var _0x17623b=_0xecd5[_0x285e99];return _0x17623b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ecd('0x0'));var zipdir=require(_0x5ecd('0x1'));var jsonpatch=require(_0x5ecd('0x2'));var rp=require('request-promise');var moment=require(_0x5ecd('0x3'));var BPromise=require(_0x5ecd('0x4'));var Mustache=require(_0x5ecd('0x5'));var util=require(_0x5ecd('0x6'));var path=require('path');var sox=require(_0x5ecd('0x7'));var csv=require('to-csv');var ejs=require(_0x5ecd('0x8'));var fs=require('fs');var fs_extra=require(_0x5ecd('0x9'));var _=require('lodash');var squel=require(_0x5ecd('0xa'));var crypto=require(_0x5ecd('0xb'));var jsforce=require(_0x5ecd('0xc'));var deskjs=require(_0x5ecd('0xd'));var toCsv=require(_0x5ecd('0xe'));var querystring=require(_0x5ecd('0xf'));var Papa=require(_0x5ecd('0x10'));var Redis=require(_0x5ecd('0x11'));var authService=require(_0x5ecd('0x12'));var qs=require(_0x5ecd('0x13'));var as=require(_0x5ecd('0x14'));var hardwareService=require(_0x5ecd('0x15'));var logger=require('../../config/logger')(_0x5ecd('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5ecd('0x17'));var db=require(_0x5ecd('0x18'))['db'];function respondWithStatusCode(_0x4b7add,_0x4fc1ec){_0x4fc1ec=_0x4fc1ec||0xcc;return function(_0x3eaad7){if(_0x3eaad7){return _0x4b7add[_0x5ecd('0x19')](_0x4fc1ec);}return _0x4b7add[_0x5ecd('0x1a')](_0x4fc1ec)[_0x5ecd('0x1b')]();};}function respondWithResult(_0x57bd97,_0x3b918c){_0x3b918c=_0x3b918c||0xc8;return function(_0x3b54f1){if(_0x3b54f1){return _0x57bd97['status'](_0x3b918c)[_0x5ecd('0x1c')](_0x3b54f1);}};}function respondWithFilteredResult(_0xacc5c4,_0x48442a){return function(_0x458899){if(_0x458899){var _0x4a0e19=typeof _0x48442a[_0x5ecd('0x1d')]===_0x5ecd('0x1e')&&typeof _0x48442a[_0x5ecd('0x1f')]===_0x5ecd('0x1e');var _0x3d4973=_0x458899[_0x5ecd('0x20')];var _0x231da2=_0x4a0e19?0x0:_0x48442a[_0x5ecd('0x1d')];var _0x3078ea=_0x4a0e19?_0x458899[_0x5ecd('0x20')]:_0x48442a[_0x5ecd('0x1d')]+_0x48442a[_0x5ecd('0x1f')];var _0x575985;if(_0x3078ea>=_0x3d4973){_0x3078ea=_0x3d4973;_0x575985=0xc8;}else{_0x575985=0xce;}_0xacc5c4[_0x5ecd('0x1a')](_0x575985);return _0xacc5c4[_0x5ecd('0x21')](_0x5ecd('0x22'),_0x231da2+'-'+_0x3078ea+'/'+_0x3d4973)[_0x5ecd('0x1c')](_0x458899);}return null;};}function patchUpdates(_0xea18b7){return function(_0x5e7d1f){try{jsonpatch[_0x5ecd('0x23')](_0x5e7d1f,_0xea18b7,!![]);}catch(_0x5628c4){return BPromise[_0x5ecd('0x24')](_0x5628c4);}return _0x5e7d1f[_0x5ecd('0x25')]();};}function saveUpdates(_0x38e74e,_0x3c8e2b){return function(_0x31a6d9){if(_0x31a6d9){return _0x31a6d9['update'](_0x38e74e)[_0x5ecd('0x26')](function(_0x1453ed){return _0x1453ed;});}return null;};}function removeEntity(_0x1d9161,_0x57168b){return function(_0xe80905){if(_0xe80905){return _0xe80905[_0x5ecd('0x27')]()[_0x5ecd('0x26')](function(){_0x1d9161[_0x5ecd('0x1a')](0xcc)[_0x5ecd('0x1b')]();});}};}function handleEntityNotFound(_0x20f134,_0x3d0086){return function(_0x14b07b){if(!_0x14b07b){_0x20f134['sendStatus'](0x194);}return _0x14b07b;};}function handleError(_0x1e3902,_0x5ae414){_0x5ae414=_0x5ae414||0x1f4;return function(_0x12a109){logger[_0x5ecd('0x28')](_0x12a109[_0x5ecd('0x29')]);if(_0x12a109[_0x5ecd('0x2a')]){delete _0x12a109[_0x5ecd('0x2a')];}_0x1e3902['status'](_0x5ae414)[_0x5ecd('0x2b')](_0x12a109);};}exports[_0x5ecd('0x2c')]=function(_0x33ca9e,_0x38c87d){var _0x389b88={'raw':!![],'where':{'id':_0x33ca9e[_0x5ecd('0x2d')]['id']}},_0x1c3eb8={};_0x1c3eb8[_0x5ecd('0x2e')]=_[_0x5ecd('0x2f')](db[_0x5ecd('0x30')][_0x5ecd('0x31')]);_0x1c3eb8[_0x5ecd('0x32')]=_[_0x5ecd('0x2f')](_0x33ca9e[_0x5ecd('0x32')]);_0x1c3eb8[_0x5ecd('0x33')]=_[_0x5ecd('0x34')](_0x1c3eb8[_0x5ecd('0x2e')],_0x1c3eb8['query']);_0x389b88[_0x5ecd('0x35')]=_[_0x5ecd('0x34')](_0x1c3eb8[_0x5ecd('0x2e')],qs[_0x5ecd('0x36')](_0x33ca9e[_0x5ecd('0x32')]['fields']));_0x389b88[_0x5ecd('0x35')]=_0x389b88[_0x5ecd('0x35')][_0x5ecd('0x37')]?_0x389b88[_0x5ecd('0x35')]:_0x1c3eb8[_0x5ecd('0x2e')];if(_0x33ca9e['query'][_0x5ecd('0x38')]){_0x389b88[_0x5ecd('0x39')]=[{'all':!![]}];}_0x389b88=_[_0x5ecd('0x3a')]({},_0x389b88,_0x33ca9e['options']);return db[_0x5ecd('0x30')][_0x5ecd('0x3b')](_0x389b88)[_0x5ecd('0x26')](handleEntityNotFound(_0x38c87d,null))[_0x5ecd('0x26')](respondWithResult(_0x38c87d,null))[_0x5ecd('0x3c')](handleError(_0x38c87d,null));};exports[_0x5ecd('0x3d')]=function(_0x57ebf0,_0xce7884){return db['ChatProactiveAction']['create'](_0x57ebf0[_0x5ecd('0x3e')],{})[_0x5ecd('0x26')](respondWithResult(_0xce7884,0xc9))[_0x5ecd('0x3c')](handleError(_0xce7884,null));};exports[_0x5ecd('0x3f')]=function(_0x38809f,_0x41975e){if(_0x38809f['body']['id']){delete _0x38809f['body']['id'];}return db[_0x5ecd('0x30')][_0x5ecd('0x3b')]({'where':{'id':_0x38809f[_0x5ecd('0x2d')]['id']}})[_0x5ecd('0x26')](handleEntityNotFound(_0x41975e,null))[_0x5ecd('0x26')](saveUpdates(_0x38809f[_0x5ecd('0x3e')],null))[_0x5ecd('0x26')](respondWithResult(_0x41975e,null))['catch'](handleError(_0x41975e,null));};exports[_0x5ecd('0x27')]=function(_0x2f4377,_0x2a499b){return db['ChatProactiveAction'][_0x5ecd('0x3b')]({'where':{'id':_0x2f4377[_0x5ecd('0x2d')]['id']}})[_0x5ecd('0x26')](handleEntityNotFound(_0x2a499b,null))['then'](removeEntity(_0x2a499b,null))['catch'](handleError(_0x2a499b,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 7e6c7eb..0a6cff6 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 _0xcc9e=['request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api','moment','bluebird'];(function(_0x2a306f,_0x3e416f){var _0x319373=function(_0x520f2b){while(--_0x520f2b){_0x2a306f['push'](_0x2a306f['shift']());}};_0x319373(++_0x3e416f);}(_0xcc9e,0x119));var _0xecc9=function(_0xe608b8,_0x35ee07){_0xe608b8=_0xe608b8-0x0;var _0x217aa1=_0xcc9e[_0xe608b8];return _0x217aa1;};'use strict';var _=require('lodash');var util=require(_0xecc9('0x0'));var logger=require(_0xecc9('0x1'))(_0xecc9('0x2'));var moment=require(_0xecc9('0x3'));var BPromise=require(_0xecc9('0x4'));var rp=require(_0xecc9('0x5'));var fs=require('fs');var path=require(_0xecc9('0x6'));var rimraf=require('rimraf');var config=require(_0xecc9('0x7'));var attributes=require(_0xecc9('0x8'));module[_0xecc9('0x9')]=function(_0x2f122a,_0x4303f6){return _0x2f122a[_0xecc9('0xa')](_0xecc9('0xb'),attributes,{'tableName':_0xecc9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe809=['../../config/logger','moment','path','rimraf','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe809,0x153));var _0x9e80=function(_0x1497a2,_0x296f51){_0x1497a2=_0x1497a2-0x0;var _0x20f0ea=_0xe809[_0x1497a2];return _0x20f0ea;};'use strict';var _=require(_0x9e80('0x0'));var util=require(_0x9e80('0x1'));var logger=require(_0x9e80('0x2'))('api');var moment=require(_0x9e80('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e80('0x4'));var rimraf=require(_0x9e80('0x5'));var config=require('../../config/environment');var attributes=require(_0x9e80('0x6'));module[_0x9e80('0x7')]=function(_0x2f60b5,_0x46cd28){return _0x2f60b5[_0x9e80('0x8')](_0x9e80('0x9'),attributes,{'tableName':_0x9e80('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 50372e5..d6904b0 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 _0xd909=['info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x36befb,_0x4ed2f5){var _0x2b0373=function(_0x20a4ce){while(--_0x20a4ce){_0x36befb['push'](_0x36befb['shift']());}};_0x2b0373(++_0x4ed2f5);}(_0xd909,0x1c1));var _0x9d90=function(_0x226175,_0x1b78a0){_0x226175=_0x226175-0x0;var _0x21d7e2=_0xd909[_0x226175];return _0x21d7e2;};'use strict';var _=require('lodash');var util=require(_0x9d90('0x0'));var moment=require(_0x9d90('0x1'));var BPromise=require(_0x9d90('0x2'));var rs=require(_0x9d90('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9d90('0x4'))['db'];var utils=require(_0x9d90('0x5'));var logger=require(_0x9d90('0x6'))(_0x9d90('0x7'));var config=require(_0x9d90('0x8'));var jayson=require(_0x9d90('0x9'));var client=jayson[_0x9d90('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10930a,_0x1036d5,_0x36ff88){return new BPromise(function(_0x19d78a,_0x3a815b){return client[_0x9d90('0xb')](_0x10930a,_0x36ff88)[_0x9d90('0xc')](function(_0x115e66){logger[_0x9d90('0xd')](_0x9d90('0xe'),_0x1036d5,_0x9d90('0xf'));logger['debug'](_0x9d90('0x10'),_0x1036d5,_0x9d90('0xf'),JSON['stringify'](_0x115e66));if(_0x115e66[_0x9d90('0x11')]){if(_0x115e66['error']['code']===0x1f4){logger[_0x9d90('0x11')](_0x9d90('0xe'),_0x1036d5,_0x115e66[_0x9d90('0x11')][_0x9d90('0x12')]);return _0x3a815b(_0x115e66[_0x9d90('0x11')]['message']);}logger['error'](_0x9d90('0xe'),_0x1036d5,_0x115e66[_0x9d90('0x11')][_0x9d90('0x12')]);return _0x19d78a(_0x115e66[_0x9d90('0x11')][_0x9d90('0x12')]);}else{logger['info'](_0x9d90('0xe'),_0x1036d5,_0x9d90('0xf'));_0x19d78a(_0x115e66[_0x9d90('0x13')][_0x9d90('0x12')]);}})[_0x9d90('0x14')](function(_0x4007d0){logger[_0x9d90('0x11')](_0x9d90('0xe'),_0x1036d5,_0x4007d0);_0x3a815b(_0x4007d0);});});} \ No newline at end of file +var _0x32ba=['../../mysqldb','../../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','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x296297,_0x46209b){var _0x31cd6d=function(_0x3142ed){while(--_0x3142ed){_0x296297['push'](_0x296297['shift']());}};_0x31cd6d(++_0x46209b);}(_0x32ba,0x1aa));var _0xa32b=function(_0x4c8a8f,_0x997ef){_0x4c8a8f=_0x4c8a8f-0x0;var _0x404500=_0x32ba[_0x4c8a8f];return _0x404500;};'use strict';var _=require(_0xa32b('0x0'));var util=require(_0xa32b('0x1'));var moment=require(_0xa32b('0x2'));var BPromise=require(_0xa32b('0x3'));var rs=require(_0xa32b('0x4'));var fs=require('fs');var Redis=require(_0xa32b('0x5'));var db=require(_0xa32b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa32b('0x7'))('rpc');var config=require(_0xa32b('0x8'));var jayson=require(_0xa32b('0x9'));var client=jayson[_0xa32b('0xa')][_0xa32b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a4ada,_0x6c002e,_0x4e22d8){return new BPromise(function(_0x272f34,_0x320aeb){return client['request'](_0x4a4ada,_0x4e22d8)[_0xa32b('0xc')](function(_0x54de4f){logger[_0xa32b('0xd')](_0xa32b('0xe'),_0x6c002e,_0xa32b('0xf'));logger[_0xa32b('0x10')](_0xa32b('0x11'),_0x6c002e,_0xa32b('0xf'),JSON[_0xa32b('0x12')](_0x54de4f));if(_0x54de4f[_0xa32b('0x13')]){if(_0x54de4f[_0xa32b('0x13')][_0xa32b('0x14')]===0x1f4){logger[_0xa32b('0x13')](_0xa32b('0xe'),_0x6c002e,_0x54de4f[_0xa32b('0x13')][_0xa32b('0x15')]);return _0x320aeb(_0x54de4f[_0xa32b('0x13')][_0xa32b('0x15')]);}logger[_0xa32b('0x13')](_0xa32b('0xe'),_0x6c002e,_0x54de4f[_0xa32b('0x13')][_0xa32b('0x15')]);return _0x272f34(_0x54de4f[_0xa32b('0x13')]['message']);}else{logger['info'](_0xa32b('0xe'),_0x6c002e,_0xa32b('0xf'));_0x272f34(_0x54de4f[_0xa32b('0x16')][_0xa32b('0x15')]);}})[_0xa32b('0x17')](function(_0x1712d4){logger[_0xa32b('0x13')](_0xa32b('0xe'),_0x6c002e,_0x1712d4);_0x320aeb(_0x1712d4);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 2e8b7e7..67d1a59 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 _0x2d17=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util'];(function(_0x31bd20,_0x11de2f){var _0x5f2017=function(_0x3f65a4){while(--_0x3f65a4){_0x31bd20['push'](_0x31bd20['shift']());}};_0x5f2017(++_0x11de2f);}(_0x2d17,0x17e));var _0x72d1=function(_0xe361cf,_0x11db2f){_0xe361cf=_0xe361cf-0x0;var _0x2648b9=_0x2d17[_0xe361cf];return _0x2648b9;};'use strict';var multer=require(_0x72d1('0x0'));var util=require(_0x72d1('0x1'));var path=require('path');var timeout=require(_0x72d1('0x2'));var express=require(_0x72d1('0x3'));var router=express['Router']();var fs_extra=require(_0x72d1('0x4'));var auth=require(_0x72d1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x72d1('0x6'));var controller=require('./chatProactiveAction.controller');router[_0x72d1('0x7')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0x9')]);router['post']('/',auth[_0x72d1('0x8')](),controller[_0x72d1('0xa')]);router[_0x72d1('0xb')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0xc')]);router[_0x72d1('0xd')]('/:id',auth[_0x72d1('0x8')](),controller[_0x72d1('0xe')]);module[_0x72d1('0xf')]=router; \ No newline at end of file +var _0x31f0=['fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','show','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','path','express','Router'];(function(_0xac0de1,_0x12d3d9){var _0x1c1995=function(_0x3f96e8){while(--_0x3f96e8){_0xac0de1['push'](_0xac0de1['shift']());}};_0x1c1995(++_0x12d3d9);}(_0x31f0,0xb7));var _0x031f=function(_0x338fe5,_0x3ef01f){_0x338fe5=_0x338fe5-0x0;var _0x10d6ae=_0x31f0[_0x338fe5];return _0x10d6ae;};'use strict';var multer=require(_0x031f('0x0'));var util=require('util');var path=require(_0x031f('0x1'));var timeout=require('connect-timeout');var express=require(_0x031f('0x2'));var router=express[_0x031f('0x3')]();var fs_extra=require(_0x031f('0x4'));var auth=require(_0x031f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x031f('0x6'));var controller=require(_0x031f('0x7'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x031f('0x8')]);router['post']('/',auth[_0x031f('0x9')](),controller[_0x031f('0xa')]);router[_0x031f('0xb')](_0x031f('0xc'),auth['isAuthenticated'](),controller[_0x031f('0xd')]);router[_0x031f('0xe')](_0x031f('0xc'),auth[_0x031f('0x9')](),controller[_0x031f('0xf')]);module[_0x031f('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index ae1aa96..3745170 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 _0xf80a=['ENUM','rrmemory','beepall','sequelize','exports','STRING','name'];(function(_0x10c95c,_0x912d30){var _0x598320=function(_0x2fd065){while(--_0x2fd065){_0x10c95c['push'](_0x10c95c['shift']());}};_0x598320(++_0x912d30);}(_0xf80a,0x6c));var _0xaf80=function(_0x29ff42,_0xa8257e){_0x29ff42=_0x29ff42-0x0;var _0x4ff720=_0xf80a[_0x29ff42];return _0x4ff720;};'use strict';var Sequelize=require(_0xaf80('0x0'));module[_0xaf80('0x1')]={'name':{'type':Sequelize[_0xaf80('0x2')],'unique':_0xaf80('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xaf80('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xaf80('0x4')](_0xaf80('0x5'),_0xaf80('0x6'),'roundrobin')}}; \ No newline at end of file +var _0xf189=['name','STRING','INTEGER','ENUM','beepall','roundrobin','sequelize','exports'];(function(_0x26740c,_0x509842){var _0x6682c5=function(_0x579bd2){while(--_0x579bd2){_0x26740c['push'](_0x26740c['shift']());}};_0x6682c5(++_0x509842);}(_0xf189,0x146));var _0x9f18=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xf189[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require(_0x9f18('0x0'));module[_0x9f18('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9f18('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9f18('0x3')]},'timeout':{'type':Sequelize[_0x9f18('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9f18('0x5')]('rrmemory',_0x9f18('0x6'),_0x9f18('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 8a061a1..8685834 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 _0xc0a7=['./chatQueue.socket','register','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','map','ChatQueue','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','length','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserChatQueue','User','findAndCountAll','agent','chatPause','createdAt','rows','format','%s/%s','SIP','updatedAt','getTeams','hasOwnProperty','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','userChatQueue:save','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','sequelize','toString','QueryTypes','every','includes','union','compact','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc0a7,0x1ba));var _0x7c0a=function(_0x1d378a,_0x1a7269){_0x1d378a=_0x1d378a-0x0;var _0x472f87=_0xc0a7[_0x1d378a];return _0x472f87;};'use strict';var emlformat=require(_0x7c0a('0x0'));var rimraf=require(_0x7c0a('0x1'));var zipdir=require(_0x7c0a('0x2'));var jsonpatch=require(_0x7c0a('0x3'));var rp=require(_0x7c0a('0x4'));var moment=require(_0x7c0a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7c0a('0x6'));var util=require(_0x7c0a('0x7'));var path=require(_0x7c0a('0x8'));var sox=require(_0x7c0a('0x9'));var csv=require(_0x7c0a('0xa'));var ejs=require(_0x7c0a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7c0a('0xc'));var squel=require(_0x7c0a('0xd'));var crypto=require(_0x7c0a('0xe'));var jsforce=require(_0x7c0a('0xf'));var deskjs=require(_0x7c0a('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7c0a('0x11'));var Redis=require(_0x7c0a('0x12'));var authService=require(_0x7c0a('0x13'));var qs=require(_0x7c0a('0x14'));var as=require(_0x7c0a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7c0a('0x16'))(_0x7c0a('0x17'));var utils=require(_0x7c0a('0x18'));var config=require(_0x7c0a('0x19'));var licenseUtil=require(_0x7c0a('0x1a'));var db=require(_0x7c0a('0x1b'))['db'];config['redis']=_[_0x7c0a('0x1c')](config[_0x7c0a('0x1d')],{'host':_0x7c0a('0x1e'),'port':0x18eb});var socket=require(_0x7c0a('0x1f'))(new Redis(config[_0x7c0a('0x1d')]));require(_0x7c0a('0x20'))[_0x7c0a('0x21')](socket);var jayson=require(_0x7c0a('0x22'));var client=jayson[_0x7c0a('0x23')][_0x7c0a('0x24')]({'port':0x232a});function respondWithRpcPromise(_0x88933f,_0x5899e6,_0x16a217,_0x48b0f0){return new BPromise(function(_0x56d9db,_0x3a4eb7){var _0x430684=_0x48b0f0||client;return _0x430684[_0x7c0a('0x25')](_0x88933f,_0x16a217)[_0x7c0a('0x26')](function(_0x17310c){logger[_0x7c0a('0x27')](_0x7c0a('0x28'),_0x5899e6,'request\x20sent');logger[_0x7c0a('0x29')](_0x7c0a('0x2a'),_0x5899e6,_0x7c0a('0x2b'),JSON['stringify'](_0x17310c));if(_0x17310c[_0x7c0a('0x2c')]){if(_0x17310c[_0x7c0a('0x2c')][_0x7c0a('0x2d')]===0x1f4){logger['error'](_0x7c0a('0x28'),_0x5899e6,_0x17310c[_0x7c0a('0x2c')][_0x7c0a('0x2e')]);return _0x3a4eb7(_0x17310c['error'][_0x7c0a('0x2e')]);}logger[_0x7c0a('0x2c')](_0x7c0a('0x28'),_0x5899e6,_0x17310c[_0x7c0a('0x2c')][_0x7c0a('0x2e')]);return _0x56d9db(_0x17310c[_0x7c0a('0x2c')][_0x7c0a('0x2e')]);}else{logger[_0x7c0a('0x27')](_0x7c0a('0x28'),_0x5899e6,_0x7c0a('0x2b'));_0x56d9db(_0x17310c[_0x7c0a('0x2f')][_0x7c0a('0x2e')]);}})[_0x7c0a('0x30')](function(_0x9f2614){logger[_0x7c0a('0x2c')]('ChatQueue,\x20%s,\x20%s',_0x5899e6,_0x9f2614);_0x3a4eb7(_0x9f2614);});});}function respondWithStatusCode(_0x4eb733,_0x5bb549){_0x5bb549=_0x5bb549||0xcc;return function(_0x129d13){if(_0x129d13){return _0x4eb733[_0x7c0a('0x31')](_0x5bb549);}return _0x4eb733[_0x7c0a('0x32')](_0x5bb549)[_0x7c0a('0x33')]();};}function respondWithResult(_0x2df6f5,_0x55b4e3){_0x55b4e3=_0x55b4e3||0xc8;return function(_0x5bcee7){if(_0x5bcee7){return _0x2df6f5[_0x7c0a('0x32')](_0x55b4e3)[_0x7c0a('0x34')](_0x5bcee7);}};}function respondWithFilteredResult(_0x4cf449,_0x445bdd){return function(_0x5399fd){if(_0x5399fd){var _0x1640ca=typeof _0x445bdd[_0x7c0a('0x35')]===_0x7c0a('0x36')&&typeof _0x445bdd[_0x7c0a('0x37')]===_0x7c0a('0x36');var _0x2e1cb5=_0x5399fd[_0x7c0a('0x38')];var _0x43190c=_0x1640ca?0x0:_0x445bdd[_0x7c0a('0x35')];var _0x2ead92=_0x1640ca?_0x5399fd[_0x7c0a('0x38')]:_0x445bdd[_0x7c0a('0x35')]+_0x445bdd[_0x7c0a('0x37')];var _0x28c25c;if(_0x2ead92>=_0x2e1cb5){_0x2ead92=_0x2e1cb5;_0x28c25c=0xc8;}else{_0x28c25c=0xce;}_0x4cf449['status'](_0x28c25c);return _0x4cf449[_0x7c0a('0x39')](_0x7c0a('0x3a'),_0x43190c+'-'+_0x2ead92+'/'+_0x2e1cb5)['json'](_0x5399fd);}return null;};}function patchUpdates(_0x1d5223){return function(_0x346d46){try{jsonpatch[_0x7c0a('0x3b')](_0x346d46,_0x1d5223,!![]);}catch(_0x211f4d){return BPromise[_0x7c0a('0x3c')](_0x211f4d);}return _0x346d46[_0x7c0a('0x3d')]();};}function saveUpdates(_0x313a36,_0x32da89){return function(_0x2ef130){if(_0x2ef130){return _0x2ef130[_0x7c0a('0x3e')](_0x313a36)[_0x7c0a('0x26')](function(_0x5a4fc6){return _0x5a4fc6;});}return null;};}function removeEntity(_0x118faa,_0x38a919){return function(_0x14113a){if(_0x14113a){return _0x14113a[_0x7c0a('0x3f')]()[_0x7c0a('0x26')](function(){var _0xb6d835=_0x14113a[_0x7c0a('0x40')]({'plain':!![]});var _0x2a3e6d=_0x7c0a('0x41');return db[_0x7c0a('0x42')][_0x7c0a('0x3f')]({'where':{'type':_0x2a3e6d,'resourceId':_0xb6d835['id']}})[_0x7c0a('0x26')](function(){return _0x14113a;});})[_0x7c0a('0x26')](function(){_0x118faa['status'](0xcc)[_0x7c0a('0x33')]();});}};}function handleEntityNotFound(_0x288525,_0x385a79){return function(_0x38a09f){if(!_0x38a09f){_0x288525['sendStatus'](0x194);}return _0x38a09f;};}function handleError(_0x518412,_0x1d2323){_0x1d2323=_0x1d2323||0x1f4;return function(_0x385952){logger[_0x7c0a('0x2c')](_0x385952[_0x7c0a('0x43')]);if(_0x385952[_0x7c0a('0x44')]){delete _0x385952[_0x7c0a('0x44')];}_0x518412[_0x7c0a('0x32')](_0x1d2323)[_0x7c0a('0x45')](_0x385952);};}exports['index']=function(_0x2cbb45,_0x35392d){var _0x11d22c={},_0x2fcbfb={},_0x1cf8ba={'count':0x0,'rows':[]};var _0x113b35=_[_0x7c0a('0x46')](db[_0x7c0a('0x47')][_0x7c0a('0x48')],function(_0x1464c2){return{'name':_0x1464c2[_0x7c0a('0x49')],'type':_0x1464c2[_0x7c0a('0x4a')][_0x7c0a('0x4b')]};});_0x2fcbfb['model']=_['map'](_0x113b35,_0x7c0a('0x44'));_0x2fcbfb[_0x7c0a('0x4c')]=_[_0x7c0a('0x4d')](_0x2cbb45[_0x7c0a('0x4c')]);_0x2fcbfb[_0x7c0a('0x4e')]=_[_0x7c0a('0x4f')](_0x2fcbfb['model'],_0x2fcbfb['query']);_0x11d22c['attributes']=_['intersection'](_0x2fcbfb[_0x7c0a('0x50')],qs[_0x7c0a('0x51')](_0x2cbb45[_0x7c0a('0x4c')][_0x7c0a('0x51')]));_0x11d22c[_0x7c0a('0x52')]=_0x11d22c[_0x7c0a('0x52')]['length']?_0x11d22c[_0x7c0a('0x52')]:_0x2fcbfb[_0x7c0a('0x50')];if(!_0x2cbb45[_0x7c0a('0x4c')]['hasOwnProperty'](_0x7c0a('0x53'))){_0x11d22c['limit']=qs[_0x7c0a('0x37')](_0x2cbb45[_0x7c0a('0x4c')][_0x7c0a('0x37')]);_0x11d22c[_0x7c0a('0x35')]=qs[_0x7c0a('0x35')](_0x2cbb45[_0x7c0a('0x4c')][_0x7c0a('0x35')]);}_0x11d22c[_0x7c0a('0x54')]=qs[_0x7c0a('0x55')](_0x2cbb45[_0x7c0a('0x4c')][_0x7c0a('0x55')]);_0x11d22c[_0x7c0a('0x56')]=qs[_0x7c0a('0x4e')](_[_0x7c0a('0x57')](_0x2cbb45[_0x7c0a('0x4c')],_0x2fcbfb[_0x7c0a('0x4e')]),_0x113b35);if(_0x2cbb45[_0x7c0a('0x4c')][_0x7c0a('0x58')]){_0x11d22c[_0x7c0a('0x56')]=_[_0x7c0a('0x59')](_0x11d22c[_0x7c0a('0x56')],{'$or':_[_0x7c0a('0x46')](_0x113b35,function(_0x101ae1){if(_0x101ae1[_0x7c0a('0x4a')]!==_0x7c0a('0x5a')){var _0x27d473={};_0x27d473[_0x101ae1[_0x7c0a('0x44')]]={'$like':'%'+_0x2cbb45[_0x7c0a('0x4c')]['filter']+'%'};return _0x27d473;}})});}_0x11d22c=_[_0x7c0a('0x59')]({},_0x11d22c,_0x2cbb45[_0x7c0a('0x5b')]);var _0x1975c1={'where':_0x11d22c[_0x7c0a('0x56')]};return db['ChatQueue']['count'](_0x1975c1)['then'](function(_0x52b7cd){_0x1cf8ba[_0x7c0a('0x38')]=_0x52b7cd;if(_0x2cbb45[_0x7c0a('0x4c')]['includeAll']){_0x11d22c[_0x7c0a('0x5c')]=[{'all':!![]}];}return db[_0x7c0a('0x47')][_0x7c0a('0x5d')](_0x11d22c);})[_0x7c0a('0x26')](function(_0x46a221){_0x1cf8ba['rows']=_0x46a221;return _0x1cf8ba;})[_0x7c0a('0x26')](respondWithFilteredResult(_0x35392d,_0x11d22c))['catch'](handleError(_0x35392d,null));};exports[_0x7c0a('0x5e')]=function(_0x455457,_0x4cc93d){var _0x4f9fae={'raw':!![],'where':{'id':_0x455457[_0x7c0a('0x5f')]['id']}},_0x5f0a16={};_0x5f0a16[_0x7c0a('0x50')]=_[_0x7c0a('0x4d')](db[_0x7c0a('0x47')][_0x7c0a('0x48')]);_0x5f0a16[_0x7c0a('0x4c')]=_[_0x7c0a('0x4d')](_0x455457[_0x7c0a('0x4c')]);_0x5f0a16[_0x7c0a('0x4e')]=_[_0x7c0a('0x4f')](_0x5f0a16[_0x7c0a('0x50')],_0x5f0a16[_0x7c0a('0x4c')]);_0x4f9fae[_0x7c0a('0x52')]=_[_0x7c0a('0x4f')](_0x5f0a16[_0x7c0a('0x50')],qs[_0x7c0a('0x51')](_0x455457[_0x7c0a('0x4c')][_0x7c0a('0x51')]));_0x4f9fae[_0x7c0a('0x52')]=_0x4f9fae['attributes'][_0x7c0a('0x60')]?_0x4f9fae[_0x7c0a('0x52')]:_0x5f0a16[_0x7c0a('0x50')];if(_0x455457[_0x7c0a('0x4c')][_0x7c0a('0x61')]){_0x4f9fae['include']=[{'all':!![]}];}_0x4f9fae=_['merge']({},_0x4f9fae,_0x455457['options']);return db[_0x7c0a('0x47')][_0x7c0a('0x62')](_0x4f9fae)[_0x7c0a('0x26')](handleEntityNotFound(_0x4cc93d,null))[_0x7c0a('0x26')](respondWithResult(_0x4cc93d,null))[_0x7c0a('0x30')](handleError(_0x4cc93d,null));};exports[_0x7c0a('0x63')]=function(_0x450691,_0x17dcd5){return db['ChatQueue'][_0x7c0a('0x63')](_0x450691['body'],{})[_0x7c0a('0x26')](function(_0x5c9860){var _0x15d290=_0x450691[_0x7c0a('0x64')][_0x7c0a('0x40')]({'plain':!![]});if(!_0x15d290)throw new Error(_0x7c0a('0x65'));if(_0x15d290['role']===_0x7c0a('0x64')){var _0x2666ac=_0x5c9860[_0x7c0a('0x40')]({'plain':!![]});var _0x4f6a6c=_0x7c0a('0x41');return db[_0x7c0a('0x66')]['find']({'where':{'name':_0x4f6a6c,'userProfileId':_0x15d290[_0x7c0a('0x67')]},'raw':!![]})['then'](function(_0x23ba90){if(_0x23ba90&&_0x23ba90[_0x7c0a('0x68')]===0x0){return db[_0x7c0a('0x42')]['create']({'name':_0x2666ac[_0x7c0a('0x44')],'resourceId':_0x2666ac['id'],'type':_0x23ba90[_0x7c0a('0x44')],'sectionId':_0x23ba90['id']},{})['then'](function(){return _0x5c9860;});}else{return _0x5c9860;}})[_0x7c0a('0x30')](function(_0x2e0ff8){logger[_0x7c0a('0x2c')](_0x7c0a('0x69'),_0x2e0ff8);throw _0x2e0ff8;});}return _0x5c9860;})[_0x7c0a('0x26')](respondWithResult(_0x17dcd5,0xc9))[_0x7c0a('0x30')](handleError(_0x17dcd5,null));};exports[_0x7c0a('0x3e')]=function(_0xf09dac,_0x26a833){if(_0xf09dac[_0x7c0a('0x6a')]['id']){delete _0xf09dac['body']['id'];}return db[_0x7c0a('0x47')][_0x7c0a('0x62')]({'where':{'id':_0xf09dac[_0x7c0a('0x5f')]['id']}})[_0x7c0a('0x26')](handleEntityNotFound(_0x26a833,null))[_0x7c0a('0x26')](saveUpdates(_0xf09dac['body'],null))[_0x7c0a('0x26')](respondWithResult(_0x26a833,null))[_0x7c0a('0x30')](handleError(_0x26a833,null));};exports[_0x7c0a('0x3f')]=function(_0x1f01d2,_0x1663f6){return db[_0x7c0a('0x47')][_0x7c0a('0x62')]({'where':{'id':_0x1f01d2[_0x7c0a('0x5f')]['id']}})['then'](handleEntityNotFound(_0x1663f6,null))[_0x7c0a('0x26')](removeEntity(_0x1663f6,null))[_0x7c0a('0x30')](handleError(_0x1663f6,null));};exports[_0x7c0a('0x6b')]=function(_0x6fbbaa,_0xd11216){return db[_0x7c0a('0x47')]['describe']()[_0x7c0a('0x26')](respondWithResult(_0xd11216,null))[_0x7c0a('0x30')](handleError(_0xd11216,null));};exports['getMembers']=function(_0x2c15f4,_0x26bd3a,_0x43ba11){var _0x2342ed={'raw':!![],'where':{}},_0x118ae0={},_0x4e9379;return db[_0x7c0a('0x47')][_0x7c0a('0x6c')]({'where':{'id':_0x2c15f4[_0x7c0a('0x5f')]['id']}})['then'](handleEntityNotFound(_0x26bd3a,null))['then'](function(_0x2f300d){if(_0x2f300d){_0x4e9379=_0x2f300d[_0x7c0a('0x40')]({'plain':!![]});_0x118ae0[_0x7c0a('0x50')]=_[_0x7c0a('0x4d')](db[_0x7c0a('0x6d')][_0x7c0a('0x48')]);_0x118ae0[_0x7c0a('0x4c')]=_[_0x7c0a('0x4d')](_0x2c15f4['query']);_0x118ae0['filters']=_[_0x7c0a('0x4f')](_0x118ae0[_0x7c0a('0x50')],_0x118ae0['query']);_0x2342ed[_0x7c0a('0x52')]=_[_0x7c0a('0x4f')](_0x118ae0[_0x7c0a('0x50')],qs[_0x7c0a('0x51')](_0x2c15f4['query'][_0x7c0a('0x51')]));_0x2342ed[_0x7c0a('0x52')]=_0x2342ed[_0x7c0a('0x52')]['length']?_0x2342ed['attributes']:_0x118ae0['model'];if(!_0x2c15f4[_0x7c0a('0x4c')]['hasOwnProperty'](_0x7c0a('0x53'))){_0x2342ed[_0x7c0a('0x37')]=qs[_0x7c0a('0x37')](_0x2c15f4[_0x7c0a('0x4c')][_0x7c0a('0x37')]);_0x2342ed['offset']=qs[_0x7c0a('0x35')](_0x2c15f4['query'][_0x7c0a('0x35')]);}_0x2342ed[_0x7c0a('0x54')]=qs['sort'](_0x2c15f4['query']['sort']);_0x2342ed[_0x7c0a('0x56')]=qs[_0x7c0a('0x4e')](_[_0x7c0a('0x57')](_0x2c15f4[_0x7c0a('0x4c')],_0x118ae0[_0x7c0a('0x4e')]));_0x2342ed['where']['ChatQueueId']=_0x2f300d['id'];if(_0x2c15f4['query'][_0x7c0a('0x58')]){_0x2342ed[_0x7c0a('0x56')]=_[_0x7c0a('0x59')](_0x2342ed[_0x7c0a('0x56')],{'$or':_['map'](_0x2342ed[_0x7c0a('0x52')],function(_0x4ef8c4){var _0x3b5c17={};_0x3b5c17[_0x4ef8c4]={'$like':'%'+_0x2c15f4['query'][_0x7c0a('0x58')]+'%'};return _0x3b5c17;})});}_0x2342ed=_[_0x7c0a('0x59')]({},_0x2342ed,_0x2c15f4['options']);return db[_0x7c0a('0x6d')][_0x7c0a('0x5d')](_0x2342ed);}})[_0x7c0a('0x26')](function(_0x4e1630){if(_0x4e1630){return db[_0x7c0a('0x6e')][_0x7c0a('0x6f')]({'where':{'id':_[_0x7c0a('0x46')](_0x4e1630,'UserId'),'role':_0x7c0a('0x70')},'attributes':['id',_0x7c0a('0x44'),_0x7c0a('0x71'),'updatedAt',_0x7c0a('0x72')]});}})[_0x7c0a('0x26')](function(_0x37dd01){if(_0x37dd01){return{'count':_0x37dd01['count'],'rows':_[_0x7c0a('0x46')](_0x37dd01[_0x7c0a('0x73')],function(_0x3bc6f3){return{'membername':_0x3bc6f3[_0x7c0a('0x44')],'UserId':_0x3bc6f3['id'],'queue_name':_0x4e9379[_0x7c0a('0x44')],'ChatQueueId':_0x4e9379['id'],'interface':util[_0x7c0a('0x74')](_0x7c0a('0x75'),_0x7c0a('0x76'),_0x3bc6f3[_0x7c0a('0x44')]),'penalty':0x0,'paused':_0x3bc6f3[_0x7c0a('0x71')],'createdAt':_0x3bc6f3[_0x7c0a('0x72')],'updatedAt':_0x3bc6f3[_0x7c0a('0x77')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7c0a('0x26')](respondWithFilteredResult(_0x26bd3a,_0x2342ed))[_0x7c0a('0x30')](handleError(_0x26bd3a,null));};exports[_0x7c0a('0x78')]=function(_0x1f1988,_0x216641,_0x38ec7f){var _0x2cfb77={};var _0x31f030={};var _0x3cb93c;var _0x447f02;return db[_0x7c0a('0x47')][_0x7c0a('0x6c')]({'where':{'id':_0x1f1988[_0x7c0a('0x5f')]['id']}})[_0x7c0a('0x26')](handleEntityNotFound(_0x216641,null))[_0x7c0a('0x26')](function(_0x34247e){if(_0x34247e){_0x3cb93c=_0x34247e;_0x31f030['model']=_[_0x7c0a('0x4d')](db['Team'][_0x7c0a('0x48')]);_0x31f030[_0x7c0a('0x4c')]=_[_0x7c0a('0x4d')](_0x1f1988[_0x7c0a('0x4c')]);_0x31f030[_0x7c0a('0x4e')]=_[_0x7c0a('0x4f')](_0x31f030[_0x7c0a('0x50')],_0x31f030[_0x7c0a('0x4c')]);_0x2cfb77[_0x7c0a('0x52')]=_[_0x7c0a('0x4f')](_0x31f030[_0x7c0a('0x50')],qs[_0x7c0a('0x51')](_0x1f1988[_0x7c0a('0x4c')][_0x7c0a('0x51')]));_0x2cfb77[_0x7c0a('0x52')]=_0x2cfb77['attributes'][_0x7c0a('0x60')]?_0x2cfb77[_0x7c0a('0x52')]:_0x31f030['model'];_0x2cfb77[_0x7c0a('0x54')]=qs[_0x7c0a('0x55')](_0x1f1988[_0x7c0a('0x4c')][_0x7c0a('0x55')]);_0x2cfb77[_0x7c0a('0x56')]=qs[_0x7c0a('0x4e')](_[_0x7c0a('0x57')](_0x1f1988[_0x7c0a('0x4c')],_0x31f030[_0x7c0a('0x4e')]));if(_0x1f1988[_0x7c0a('0x4c')][_0x7c0a('0x58')]){_0x2cfb77['where']=_[_0x7c0a('0x59')](_0x2cfb77['where'],{'$or':_[_0x7c0a('0x46')](_0x2cfb77['attributes'],function(_0x555ec4){var _0x1dc01a={};_0x1dc01a[_0x555ec4]={'$like':'%'+_0x1f1988[_0x7c0a('0x4c')][_0x7c0a('0x58')]+'%'};return _0x1dc01a;})});}_0x2cfb77=_[_0x7c0a('0x59')]({},_0x2cfb77,_0x1f1988['options']);return _0x3cb93c[_0x7c0a('0x78')](_0x2cfb77);}})['then'](function(_0xb18065){if(_0xb18065){_0x447f02=_0xb18065[_0x7c0a('0x60')];if(!_0x1f1988[_0x7c0a('0x4c')][_0x7c0a('0x79')](_0x7c0a('0x53'))){_0x2cfb77[_0x7c0a('0x37')]=qs[_0x7c0a('0x37')](_0x1f1988[_0x7c0a('0x4c')]['limit']);_0x2cfb77[_0x7c0a('0x35')]=qs[_0x7c0a('0x35')](_0x1f1988[_0x7c0a('0x4c')][_0x7c0a('0x35')]);}return _0x3cb93c['getTeams'](_0x2cfb77);}})[_0x7c0a('0x26')](function(_0x4340c3){if(_0x4340c3){return _0x4340c3?{'count':_0x447f02,'rows':_0x4340c3}:null;}})['then'](respondWithResult(_0x216641,null))[_0x7c0a('0x30')](handleError(_0x216641,null));};exports[_0x7c0a('0x7a')]=function(_0x3c0058,_0x3b2701,_0x4978da){var _0x7658a8=_0x3c0058[_0x7c0a('0x6a')][_0x7c0a('0x7b')];return db[_0x7c0a('0x7c')][_0x7c0a('0x5d')]({'where':{'id':_0x7658a8},'attributes':['id'],'include':[{'model':db[_0x7c0a('0x6e')],'as':_0x7c0a('0x7d'),'attributes':['id',_0x7c0a('0x44'),_0x7c0a('0x7e'),_0x7c0a('0x7f'),_0x7c0a('0x80')],'raw':!![]}]})['then'](function(_0x579cb3){if(_0x579cb3){var _0xb643ea=_[_0x7c0a('0x81')](_0x579cb3,function(_0x3bae40){var _0xe82f32=_0x3bae40[_0x7c0a('0x40')]({'plain':!![]});return _0xe82f32['Agents'];});return db[_0x7c0a('0x47')][_0x7c0a('0x62')]({'where':{'id':_0x3c0058['params']['id']}})[_0x7c0a('0x26')](function(_0xeff6ac){return db['sequelize']['transaction'](function(_0x26b310){return _0xeff6ac['addTeams'](_0x7658a8,{'transaction':_0x26b310})[_0x7c0a('0x26')](function(){return BPromise[_0x7c0a('0x82')](_0xb643ea,function(_0x10f1b3){return db[_0x7c0a('0x6d')][_0x7c0a('0x83')]({'where':{'UserId':_0x10f1b3['id'],'ChatQueueId':_0x3c0058[_0x7c0a('0x5f')]['id']},'transaction':_0x26b310});});})['then'](function(){_0xb643ea[_0x7c0a('0x84')](function(_0x66dd83){socket[_0x7c0a('0x85')](_0x7c0a('0x86'),{'UserId':_0x66dd83['id'],'ChatQueueId':_0xeff6ac['id']});});});});});}})['then'](respondWithStatusCode(_0x3b2701,null))['catch'](handleError(_0x3b2701,null));};exports['removeTeams']=function(_0x85553c,_0x1b14bf,_0x51955f){return db[_0x7c0a('0x7c')][_0x7c0a('0x5d')]({'where':{'id':_0x85553c[_0x7c0a('0x4c')][_0x7c0a('0x7b')]},'attributes':['id'],'include':[{'model':db[_0x7c0a('0x6e')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1b14bf,null))[_0x7c0a('0x26')](function(_0x4bb514){var _0x52a10e=_[_0x7c0a('0x46')](_0x4bb514,'id');var _0x11c5b3=[];var _0x33382b=[];var _0x4bfdb3=squel[_0x7c0a('0x87')]();_0x4bfdb3[_0x7c0a('0x88')](_0x7c0a('0x89'))[_0x7c0a('0x8a')](_0x7c0a('0x8b'),'tq')[_0x7c0a('0x8c')](_0x7c0a('0x8d'),'ut',_0x7c0a('0x8e'))[_0x7c0a('0x56')](_0x7c0a('0x8f'),_0x85553c[_0x7c0a('0x5f')]['id']);for(var _0xe89ebf=0x0;_0xe89ebf<_0x4bb514[_0x7c0a('0x60')];_0xe89ebf+=0x1){let _0x380e70=_0x4bb514[_0xe89ebf];for(var _0x42d4cf=0x0;_0x42d4cf<_0x380e70[_0x7c0a('0x7d')][_0x7c0a('0x60')];_0x42d4cf+=0x1){let _0x194837=_0x380e70['Agents'][_0x42d4cf];var _0x37e4d1=_0x4bfdb3['clone']();_0x37e4d1[_0x7c0a('0x56')]('ut.UserId\x20=\x20?',_0x194837['id']);_0x33382b['push'](db[_0x7c0a('0x90')][_0x7c0a('0x4c')](_0x37e4d1[_0x7c0a('0x91')](),{'type':db[_0x7c0a('0x90')][_0x7c0a('0x92')]['SELECT']})[_0x7c0a('0x26')](function(_0x4233e1){if(_0x4233e1[_0x7c0a('0x60')]===0x1){return _0x194837['id'];}else{var _0x4f5444=_[_0x7c0a('0x93')](_['map'](_0x4233e1,'TeamId'),function(_0x2cdf81){return _[_0x7c0a('0x94')](_0x52a10e,_0x2cdf81);});if(_0x4f5444){return _0x194837['id'];}}}));}}return BPromise['all'](_0x33382b)[_0x7c0a('0x26')](function(_0x3ab0f5){_0x11c5b3=_(_0x11c5b3)[_0x7c0a('0x95')](_0x3ab0f5)[_0x7c0a('0x96')]()['value']();return db['ChatQueue']['find']({'where':{'id':_0x85553c['params']['id']}})[_0x7c0a('0x26')](function(_0x3cce7f){return db[_0x7c0a('0x90')]['transaction'](function(_0x449028){return _0x3cce7f[_0x7c0a('0x97')](_0x85553c[_0x7c0a('0x4c')][_0x7c0a('0x7b')],{'transaction':_0x449028})['then'](function(){if(!_[_0x7c0a('0x98')](_0x11c5b3)){return _0x3cce7f[_0x7c0a('0x99')](_0x11c5b3,{'transaction':_0x449028});}})[_0x7c0a('0x26')](function(){_0x11c5b3[_0x7c0a('0x84')](function(_0x5ef1af){socket[_0x7c0a('0x85')](_0x7c0a('0x9a'),{'UserId':_0x5ef1af,'ChatQueueId':_0x3cce7f['id']});});});});});});})[_0x7c0a('0x26')](respondWithStatusCode(_0x1b14bf,null))[_0x7c0a('0x30')](handleError(_0x1b14bf,null));};exports[_0x7c0a('0x9b')]=function(_0x179110,_0xb0d25b,_0x4b0889){return db['ChatQueue'][_0x7c0a('0x62')]({'where':{'id':_0x179110[_0x7c0a('0x5f')]['id']}})[_0x7c0a('0x26')](handleEntityNotFound(_0xb0d25b,null))[_0x7c0a('0x26')](function(_0x50a070){if(_0x50a070){return _0x50a070['addAgents'](_0x179110[_0x7c0a('0x6a')]['ids'],_['omit'](_0x179110['body'],[_0x7c0a('0x7b'),'id'])||{})['spread'](function(_0x17d7c0){for(var _0x344bc4=0x0;_0x344bc4<_0x179110[_0x7c0a('0x6a')][_0x7c0a('0x7b')]['length'];_0x344bc4+=0x1){socket['emit'](_0x7c0a('0x86'),{'UserId':Number(_0x179110[_0x7c0a('0x6a')][_0x7c0a('0x7b')][_0x344bc4]),'ChatQueueId':Number(_0x179110[_0x7c0a('0x5f')]['id'])});}return _0x17d7c0;});}})['then'](respondWithResult(_0xb0d25b,null))['catch'](handleError(_0xb0d25b,null));};exports[_0x7c0a('0x99')]=function(_0xa9f568,_0x4b4df9,_0x222605){return db[_0x7c0a('0x47')][_0x7c0a('0x62')]({'where':{'id':_0xa9f568['params']['id']}})['then'](handleEntityNotFound(_0x4b4df9,null))[_0x7c0a('0x26')](function(_0xf03111){if(_0xf03111){return _0xf03111[_0x7c0a('0x99')](_0xa9f568['query'][_0x7c0a('0x7b')])[_0x7c0a('0x26')](function(){if(_[_0x7c0a('0x9c')](_0xa9f568[_0x7c0a('0x4c')][_0x7c0a('0x7b')])){for(var _0x9030fd=0x0;_0x9030fd<_0xa9f568[_0x7c0a('0x4c')]['ids'][_0x7c0a('0x60')];_0x9030fd+=0x1){socket[_0x7c0a('0x85')]('userChatQueue:remove',{'UserId':Number(_0xa9f568['query'][_0x7c0a('0x7b')][_0x9030fd]),'ChatQueueId':Number(_0xa9f568[_0x7c0a('0x5f')]['id'])});}}else{socket[_0x7c0a('0x85')](_0x7c0a('0x9a'),{'UserId':Number(_0xa9f568[_0x7c0a('0x4c')][_0x7c0a('0x7b')]),'ChatQueueId':Number(_0xa9f568[_0x7c0a('0x5f')]['id'])});}});}})[_0x7c0a('0x26')](respondWithStatusCode(_0x4b4df9,null))[_0x7c0a('0x30')](handleError(_0x4b4df9,null));};exports['getAgents']=function(_0x1d6b4b,_0x3f5872,_0x210cc0){var _0x53d65f={};var _0x5081c2={};var _0x180bfb;var _0x38fbc7;return db[_0x7c0a('0x47')][_0x7c0a('0x6c')]({'where':{'id':_0x1d6b4b[_0x7c0a('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3f5872,null))[_0x7c0a('0x26')](function(_0x515b96){if(_0x515b96){_0x180bfb=_0x515b96;_0x5081c2[_0x7c0a('0x50')]=_[_0x7c0a('0x4d')](db[_0x7c0a('0x6e')]['rawAttributes']);_0x5081c2[_0x7c0a('0x4c')]=_['keys'](_0x1d6b4b[_0x7c0a('0x4c')]);_0x5081c2[_0x7c0a('0x4e')]=_[_0x7c0a('0x4f')](_0x5081c2[_0x7c0a('0x50')],_0x5081c2[_0x7c0a('0x4c')]);_0x53d65f[_0x7c0a('0x52')]=_[_0x7c0a('0x4f')](_0x5081c2[_0x7c0a('0x50')],qs[_0x7c0a('0x51')](_0x1d6b4b[_0x7c0a('0x4c')][_0x7c0a('0x51')]));_0x53d65f['attributes']=_0x53d65f[_0x7c0a('0x52')][_0x7c0a('0x60')]?_0x53d65f[_0x7c0a('0x52')]:_0x5081c2[_0x7c0a('0x50')];_0x53d65f['order']=qs['sort'](_0x1d6b4b[_0x7c0a('0x4c')]['sort']);_0x53d65f[_0x7c0a('0x56')]=qs[_0x7c0a('0x4e')](_[_0x7c0a('0x57')](_0x1d6b4b[_0x7c0a('0x4c')],_0x5081c2[_0x7c0a('0x4e')]));if(_0x1d6b4b[_0x7c0a('0x4c')][_0x7c0a('0x58')]){_0x53d65f[_0x7c0a('0x56')]=_[_0x7c0a('0x59')](_0x53d65f[_0x7c0a('0x56')],{'$or':_[_0x7c0a('0x46')](_0x53d65f['attributes'],function(_0x46c1ce){var _0x3a1ec0={};_0x3a1ec0[_0x46c1ce]={'$like':'%'+_0x1d6b4b[_0x7c0a('0x4c')][_0x7c0a('0x58')]+'%'};return _0x3a1ec0;})});}_0x53d65f=_[_0x7c0a('0x59')]({},_0x53d65f,_0x1d6b4b['options']);return _0x180bfb[_0x7c0a('0x9d')](_0x53d65f);}})[_0x7c0a('0x26')](function(_0xcfb445){if(_0xcfb445){_0x38fbc7=_0xcfb445[_0x7c0a('0x60')];if(!_0x1d6b4b[_0x7c0a('0x4c')][_0x7c0a('0x79')](_0x7c0a('0x53'))){_0x53d65f[_0x7c0a('0x37')]=qs[_0x7c0a('0x37')](_0x1d6b4b[_0x7c0a('0x4c')][_0x7c0a('0x37')]);_0x53d65f[_0x7c0a('0x35')]=qs[_0x7c0a('0x35')](_0x1d6b4b[_0x7c0a('0x4c')]['offset']);}return _0x180bfb[_0x7c0a('0x9d')](_0x53d65f);}})[_0x7c0a('0x26')](function(_0x3591e0){if(_0x3591e0){return _0x3591e0?{'count':_0x38fbc7,'rows':_0x3591e0}:null;}})[_0x7c0a('0x26')](respondWithResult(_0x3f5872,null))[_0x7c0a('0x30')](handleError(_0x3f5872,null));}; \ No newline at end of file +var _0xa4b2=['select','field','team_has_chat_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','./chatQueue.socket','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','ChatQueues','UserProfileResource','name','index','map','ChatQueue','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','show','params','length','include','options','create','body','user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','get','UserChatQueue','sort','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams'];(function(_0x2744fe,_0x305ebf){var _0x4cc095=function(_0x2c460b){while(--_0x2c460b){_0x2744fe['push'](_0x2744fe['shift']());}};_0x4cc095(++_0x305ebf);}(_0xa4b2,0x1da));var _0x2a4b=function(_0x1151d6,_0x36ec8f){_0x1151d6=_0x1151d6-0x0;var _0xdff6ca=_0xa4b2[_0x1151d6];return _0xdff6ca;};'use strict';var emlformat=require(_0x2a4b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2a4b('0x1'));var jsonpatch=require(_0x2a4b('0x2'));var rp=require(_0x2a4b('0x3'));var moment=require('moment');var BPromise=require(_0x2a4b('0x4'));var Mustache=require(_0x2a4b('0x5'));var util=require('util');var path=require(_0x2a4b('0x6'));var sox=require(_0x2a4b('0x7'));var csv=require(_0x2a4b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2a4b('0x9'));var _=require(_0x2a4b('0xa'));var squel=require(_0x2a4b('0xb'));var crypto=require(_0x2a4b('0xc'));var jsforce=require(_0x2a4b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2a4b('0x8'));var querystring=require(_0x2a4b('0xe'));var Papa=require(_0x2a4b('0xf'));var Redis=require('ioredis');var authService=require(_0x2a4b('0x10'));var qs=require(_0x2a4b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2a4b('0x12'));var logger=require(_0x2a4b('0x13'))(_0x2a4b('0x14'));var utils=require(_0x2a4b('0x15'));var config=require(_0x2a4b('0x16'));var licenseUtil=require(_0x2a4b('0x17'));var db=require(_0x2a4b('0x18'))['db'];config['redis']=_[_0x2a4b('0x19')](config['redis'],{'host':_0x2a4b('0x1a'),'port':0x18eb});var socket=require(_0x2a4b('0x1b'))(new Redis(config['redis']));require(_0x2a4b('0x1c'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ce7cb,_0xb50a42,_0x2f4051,_0x11c9a1){return new BPromise(function(_0x498d9c,_0x5828f6){var _0x5c96e4=_0x11c9a1||client;return _0x5c96e4[_0x2a4b('0x1d')](_0x1ce7cb,_0x2f4051)[_0x2a4b('0x1e')](function(_0x185dff){logger[_0x2a4b('0x1f')](_0x2a4b('0x20'),_0xb50a42,_0x2a4b('0x21'));logger[_0x2a4b('0x22')](_0x2a4b('0x23'),_0xb50a42,_0x2a4b('0x21'),JSON['stringify'](_0x185dff));if(_0x185dff[_0x2a4b('0x24')]){if(_0x185dff[_0x2a4b('0x24')][_0x2a4b('0x25')]===0x1f4){logger[_0x2a4b('0x24')](_0x2a4b('0x20'),_0xb50a42,_0x185dff[_0x2a4b('0x24')][_0x2a4b('0x26')]);return _0x5828f6(_0x185dff['error']['message']);}logger[_0x2a4b('0x24')](_0x2a4b('0x20'),_0xb50a42,_0x185dff[_0x2a4b('0x24')][_0x2a4b('0x26')]);return _0x498d9c(_0x185dff['error'][_0x2a4b('0x26')]);}else{logger[_0x2a4b('0x1f')]('ChatQueue,\x20%s,\x20%s',_0xb50a42,_0x2a4b('0x21'));_0x498d9c(_0x185dff[_0x2a4b('0x27')][_0x2a4b('0x26')]);}})[_0x2a4b('0x28')](function(_0xd1af2b){logger['error'](_0x2a4b('0x20'),_0xb50a42,_0xd1af2b);_0x5828f6(_0xd1af2b);});});}function respondWithStatusCode(_0xfd0dc2,_0x54b362){_0x54b362=_0x54b362||0xcc;return function(_0xae1592){if(_0xae1592){return _0xfd0dc2[_0x2a4b('0x29')](_0x54b362);}return _0xfd0dc2[_0x2a4b('0x2a')](_0x54b362)[_0x2a4b('0x2b')]();};}function respondWithResult(_0x3a5c42,_0xf17012){_0xf17012=_0xf17012||0xc8;return function(_0x27954b){if(_0x27954b){return _0x3a5c42[_0x2a4b('0x2a')](_0xf17012)[_0x2a4b('0x2c')](_0x27954b);}};}function respondWithFilteredResult(_0x5eadd7,_0x42d14d){return function(_0x5613ee){if(_0x5613ee){var _0x107894=typeof _0x42d14d[_0x2a4b('0x2d')]===_0x2a4b('0x2e')&&typeof _0x42d14d[_0x2a4b('0x2f')]===_0x2a4b('0x2e');var _0x41f071=_0x5613ee[_0x2a4b('0x30')];var _0x2bda1e=_0x107894?0x0:_0x42d14d[_0x2a4b('0x2d')];var _0x1f6467=_0x107894?_0x5613ee[_0x2a4b('0x30')]:_0x42d14d[_0x2a4b('0x2d')]+_0x42d14d[_0x2a4b('0x2f')];var _0x468c70;if(_0x1f6467>=_0x41f071){_0x1f6467=_0x41f071;_0x468c70=0xc8;}else{_0x468c70=0xce;}_0x5eadd7['status'](_0x468c70);return _0x5eadd7[_0x2a4b('0x31')](_0x2a4b('0x32'),_0x2bda1e+'-'+_0x1f6467+'/'+_0x41f071)[_0x2a4b('0x2c')](_0x5613ee);}return null;};}function patchUpdates(_0x48ea5a){return function(_0x1d0209){try{jsonpatch[_0x2a4b('0x33')](_0x1d0209,_0x48ea5a,!![]);}catch(_0x39b389){return BPromise[_0x2a4b('0x34')](_0x39b389);}return _0x1d0209[_0x2a4b('0x35')]();};}function saveUpdates(_0x43854e,_0x41384d){return function(_0x23f957){if(_0x23f957){return _0x23f957[_0x2a4b('0x36')](_0x43854e)['then'](function(_0x3b9b6d){return _0x3b9b6d;});}return null;};}function removeEntity(_0x2394e5,_0x3528c7){return function(_0x164e99){if(_0x164e99){return _0x164e99[_0x2a4b('0x37')]()[_0x2a4b('0x1e')](function(){var _0x3c82a5=_0x164e99['get']({'plain':!![]});var _0x54879e=_0x2a4b('0x38');return db[_0x2a4b('0x39')][_0x2a4b('0x37')]({'where':{'type':_0x54879e,'resourceId':_0x3c82a5['id']}})[_0x2a4b('0x1e')](function(){return _0x164e99;});})['then'](function(){_0x2394e5[_0x2a4b('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17d4e6,_0x18ac62){return function(_0x2ac71f){if(!_0x2ac71f){_0x17d4e6[_0x2a4b('0x29')](0x194);}return _0x2ac71f;};}function handleError(_0x1dc4c5,_0x51ab6b){_0x51ab6b=_0x51ab6b||0x1f4;return function(_0x4e1733){logger['error'](_0x4e1733['stack']);if(_0x4e1733[_0x2a4b('0x3a')]){delete _0x4e1733[_0x2a4b('0x3a')];}_0x1dc4c5[_0x2a4b('0x2a')](_0x51ab6b)['send'](_0x4e1733);};}exports[_0x2a4b('0x3b')]=function(_0x44774b,_0x327c75){var _0x57fe6c={},_0x450a58={},_0x1c1a6c={'count':0x0,'rows':[]};var _0x58b445=_[_0x2a4b('0x3c')](db[_0x2a4b('0x3d')][_0x2a4b('0x3e')],function(_0x33ad5e){return{'name':_0x33ad5e[_0x2a4b('0x3f')],'type':_0x33ad5e[_0x2a4b('0x40')]['key']};});_0x450a58[_0x2a4b('0x41')]=_[_0x2a4b('0x3c')](_0x58b445,'name');_0x450a58['query']=_[_0x2a4b('0x42')](_0x44774b[_0x2a4b('0x43')]);_0x450a58[_0x2a4b('0x44')]=_[_0x2a4b('0x45')](_0x450a58[_0x2a4b('0x41')],_0x450a58[_0x2a4b('0x43')]);_0x57fe6c[_0x2a4b('0x46')]=_[_0x2a4b('0x45')](_0x450a58[_0x2a4b('0x41')],qs[_0x2a4b('0x47')](_0x44774b[_0x2a4b('0x43')][_0x2a4b('0x47')]));_0x57fe6c['attributes']=_0x57fe6c['attributes']['length']?_0x57fe6c[_0x2a4b('0x46')]:_0x450a58[_0x2a4b('0x41')];if(!_0x44774b[_0x2a4b('0x43')][_0x2a4b('0x48')](_0x2a4b('0x49'))){_0x57fe6c[_0x2a4b('0x2f')]=qs['limit'](_0x44774b['query'][_0x2a4b('0x2f')]);_0x57fe6c['offset']=qs['offset'](_0x44774b[_0x2a4b('0x43')][_0x2a4b('0x2d')]);}_0x57fe6c[_0x2a4b('0x4a')]=qs['sort'](_0x44774b[_0x2a4b('0x43')]['sort']);_0x57fe6c['where']=qs['filters'](_[_0x2a4b('0x4b')](_0x44774b[_0x2a4b('0x43')],_0x450a58[_0x2a4b('0x44')]),_0x58b445);if(_0x44774b['query'][_0x2a4b('0x4c')]){_0x57fe6c[_0x2a4b('0x4d')]=_[_0x2a4b('0x4e')](_0x57fe6c[_0x2a4b('0x4d')],{'$or':_[_0x2a4b('0x3c')](_0x58b445,function(_0x1e502a){if(_0x1e502a[_0x2a4b('0x40')]!==_0x2a4b('0x4f')){var _0x403841={};_0x403841[_0x1e502a['name']]={'$like':'%'+_0x44774b['query'][_0x2a4b('0x4c')]+'%'};return _0x403841;}})});}_0x57fe6c=_['merge']({},_0x57fe6c,_0x44774b['options']);var _0x45199f={'where':_0x57fe6c[_0x2a4b('0x4d')]};return db[_0x2a4b('0x3d')]['count'](_0x45199f)[_0x2a4b('0x1e')](function(_0x13998a){_0x1c1a6c['count']=_0x13998a;if(_0x44774b['query'][_0x2a4b('0x50')]){_0x57fe6c['include']=[{'all':!![]}];}return db['ChatQueue'][_0x2a4b('0x51')](_0x57fe6c);})[_0x2a4b('0x1e')](function(_0x525a68){_0x1c1a6c[_0x2a4b('0x52')]=_0x525a68;return _0x1c1a6c;})[_0x2a4b('0x1e')](respondWithFilteredResult(_0x327c75,_0x57fe6c))[_0x2a4b('0x28')](handleError(_0x327c75,null));};exports[_0x2a4b('0x53')]=function(_0x4c5e00,_0x4ae08f){var _0x1d0188={'raw':!![],'where':{'id':_0x4c5e00[_0x2a4b('0x54')]['id']}},_0x4c45fd={};_0x4c45fd[_0x2a4b('0x41')]=_[_0x2a4b('0x42')](db[_0x2a4b('0x3d')][_0x2a4b('0x3e')]);_0x4c45fd[_0x2a4b('0x43')]=_[_0x2a4b('0x42')](_0x4c5e00[_0x2a4b('0x43')]);_0x4c45fd['filters']=_[_0x2a4b('0x45')](_0x4c45fd[_0x2a4b('0x41')],_0x4c45fd[_0x2a4b('0x43')]);_0x1d0188['attributes']=_[_0x2a4b('0x45')](_0x4c45fd[_0x2a4b('0x41')],qs['fields'](_0x4c5e00[_0x2a4b('0x43')][_0x2a4b('0x47')]));_0x1d0188[_0x2a4b('0x46')]=_0x1d0188[_0x2a4b('0x46')][_0x2a4b('0x55')]?_0x1d0188['attributes']:_0x4c45fd[_0x2a4b('0x41')];if(_0x4c5e00[_0x2a4b('0x43')][_0x2a4b('0x50')]){_0x1d0188[_0x2a4b('0x56')]=[{'all':!![]}];}_0x1d0188=_[_0x2a4b('0x4e')]({},_0x1d0188,_0x4c5e00[_0x2a4b('0x57')]);return db[_0x2a4b('0x3d')]['find'](_0x1d0188)[_0x2a4b('0x1e')](handleEntityNotFound(_0x4ae08f,null))[_0x2a4b('0x1e')](respondWithResult(_0x4ae08f,null))[_0x2a4b('0x28')](handleError(_0x4ae08f,null));};exports[_0x2a4b('0x58')]=function(_0x576515,_0x2e62d9){return db[_0x2a4b('0x3d')][_0x2a4b('0x58')](_0x576515[_0x2a4b('0x59')],{})['then'](function(_0x339ab5){var _0x29064e=_0x576515[_0x2a4b('0x5a')]['get']({'plain':!![]});if(!_0x29064e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29064e[_0x2a4b('0x5b')]===_0x2a4b('0x5a')){var _0x3e80a7=_0x339ab5['get']({'plain':!![]});var _0x456182=_0x2a4b('0x38');return db['UserProfileSection'][_0x2a4b('0x5c')]({'where':{'name':_0x456182,'userProfileId':_0x29064e[_0x2a4b('0x5d')]},'raw':!![]})[_0x2a4b('0x1e')](function(_0x21e440){if(_0x21e440&&_0x21e440[_0x2a4b('0x5e')]===0x0){return db[_0x2a4b('0x39')][_0x2a4b('0x58')]({'name':_0x3e80a7['name'],'resourceId':_0x3e80a7['id'],'type':_0x21e440[_0x2a4b('0x3a')],'sectionId':_0x21e440['id']},{})[_0x2a4b('0x1e')](function(){return _0x339ab5;});}else{return _0x339ab5;}})[_0x2a4b('0x28')](function(_0x316f79){logger['error'](_0x2a4b('0x5f'),_0x316f79);throw _0x316f79;});}return _0x339ab5;})[_0x2a4b('0x1e')](respondWithResult(_0x2e62d9,0xc9))['catch'](handleError(_0x2e62d9,null));};exports[_0x2a4b('0x36')]=function(_0x63f5a5,_0x5aef7c){if(_0x63f5a5[_0x2a4b('0x59')]['id']){delete _0x63f5a5['body']['id'];}return db['ChatQueue']['find']({'where':{'id':_0x63f5a5['params']['id']}})[_0x2a4b('0x1e')](handleEntityNotFound(_0x5aef7c,null))[_0x2a4b('0x1e')](saveUpdates(_0x63f5a5[_0x2a4b('0x59')],null))[_0x2a4b('0x1e')](respondWithResult(_0x5aef7c,null))[_0x2a4b('0x28')](handleError(_0x5aef7c,null));};exports[_0x2a4b('0x37')]=function(_0xe1fefd,_0x5eca4e){return db[_0x2a4b('0x3d')][_0x2a4b('0x5c')]({'where':{'id':_0xe1fefd[_0x2a4b('0x54')]['id']}})[_0x2a4b('0x1e')](handleEntityNotFound(_0x5eca4e,null))[_0x2a4b('0x1e')](removeEntity(_0x5eca4e,null))['catch'](handleError(_0x5eca4e,null));};exports['describe']=function(_0x12814b,_0x525c6a){return db[_0x2a4b('0x3d')][_0x2a4b('0x60')]()['then'](respondWithResult(_0x525c6a,null))[_0x2a4b('0x28')](handleError(_0x525c6a,null));};exports['getMembers']=function(_0x430b6a,_0x46d28e,_0x1ce457){var _0x3fc8f4={'raw':!![],'where':{}},_0x1e6962={},_0x7ae236;return db[_0x2a4b('0x3d')][_0x2a4b('0x61')]({'where':{'id':_0x430b6a[_0x2a4b('0x54')]['id']}})[_0x2a4b('0x1e')](handleEntityNotFound(_0x46d28e,null))['then'](function(_0x24e075){if(_0x24e075){_0x7ae236=_0x24e075[_0x2a4b('0x62')]({'plain':!![]});_0x1e6962[_0x2a4b('0x41')]=_['keys'](db[_0x2a4b('0x63')][_0x2a4b('0x3e')]);_0x1e6962[_0x2a4b('0x43')]=_[_0x2a4b('0x42')](_0x430b6a[_0x2a4b('0x43')]);_0x1e6962[_0x2a4b('0x44')]=_[_0x2a4b('0x45')](_0x1e6962[_0x2a4b('0x41')],_0x1e6962[_0x2a4b('0x43')]);_0x3fc8f4[_0x2a4b('0x46')]=_['intersection'](_0x1e6962[_0x2a4b('0x41')],qs[_0x2a4b('0x47')](_0x430b6a[_0x2a4b('0x43')][_0x2a4b('0x47')]));_0x3fc8f4[_0x2a4b('0x46')]=_0x3fc8f4[_0x2a4b('0x46')][_0x2a4b('0x55')]?_0x3fc8f4['attributes']:_0x1e6962[_0x2a4b('0x41')];if(!_0x430b6a[_0x2a4b('0x43')][_0x2a4b('0x48')]('nolimit')){_0x3fc8f4['limit']=qs[_0x2a4b('0x2f')](_0x430b6a[_0x2a4b('0x43')][_0x2a4b('0x2f')]);_0x3fc8f4['offset']=qs[_0x2a4b('0x2d')](_0x430b6a[_0x2a4b('0x43')][_0x2a4b('0x2d')]);}_0x3fc8f4[_0x2a4b('0x4a')]=qs[_0x2a4b('0x64')](_0x430b6a['query'][_0x2a4b('0x64')]);_0x3fc8f4[_0x2a4b('0x4d')]=qs[_0x2a4b('0x44')](_['pick'](_0x430b6a[_0x2a4b('0x43')],_0x1e6962['filters']));_0x3fc8f4[_0x2a4b('0x4d')][_0x2a4b('0x65')]=_0x24e075['id'];if(_0x430b6a['query'][_0x2a4b('0x4c')]){_0x3fc8f4[_0x2a4b('0x4d')]=_[_0x2a4b('0x4e')](_0x3fc8f4['where'],{'$or':_[_0x2a4b('0x3c')](_0x3fc8f4[_0x2a4b('0x46')],function(_0x125857){var _0x202847={};_0x202847[_0x125857]={'$like':'%'+_0x430b6a[_0x2a4b('0x43')][_0x2a4b('0x4c')]+'%'};return _0x202847;})});}_0x3fc8f4=_['merge']({},_0x3fc8f4,_0x430b6a[_0x2a4b('0x57')]);return db[_0x2a4b('0x63')][_0x2a4b('0x51')](_0x3fc8f4);}})[_0x2a4b('0x1e')](function(_0x512cfe){if(_0x512cfe){return db[_0x2a4b('0x66')][_0x2a4b('0x67')]({'where':{'id':_['map'](_0x512cfe,_0x2a4b('0x68')),'role':_0x2a4b('0x69')},'attributes':['id','name',_0x2a4b('0x6a'),_0x2a4b('0x6b'),_0x2a4b('0x6c')]});}})[_0x2a4b('0x1e')](function(_0x22d313){if(_0x22d313){return{'count':_0x22d313['count'],'rows':_[_0x2a4b('0x3c')](_0x22d313[_0x2a4b('0x52')],function(_0x2f27cf){return{'membername':_0x2f27cf[_0x2a4b('0x3a')],'UserId':_0x2f27cf['id'],'queue_name':_0x7ae236[_0x2a4b('0x3a')],'ChatQueueId':_0x7ae236['id'],'interface':util['format']('%s/%s','SIP',_0x2f27cf['name']),'penalty':0x0,'paused':_0x2f27cf[_0x2a4b('0x6a')],'createdAt':_0x2f27cf[_0x2a4b('0x6c')],'updatedAt':_0x2f27cf[_0x2a4b('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2a4b('0x1e')](respondWithFilteredResult(_0x46d28e,_0x3fc8f4))['catch'](handleError(_0x46d28e,null));};exports['getTeams']=function(_0xce835c,_0x41c204,_0x482d1f){var _0x373f1b={};var _0xf385db={};var _0x1f992a;var _0x93485c;return db[_0x2a4b('0x3d')][_0x2a4b('0x61')]({'where':{'id':_0xce835c[_0x2a4b('0x54')]['id']}})[_0x2a4b('0x1e')](handleEntityNotFound(_0x41c204,null))[_0x2a4b('0x1e')](function(_0x22d8e1){if(_0x22d8e1){_0x1f992a=_0x22d8e1;_0xf385db[_0x2a4b('0x41')]=_['keys'](db['Team']['rawAttributes']);_0xf385db[_0x2a4b('0x43')]=_['keys'](_0xce835c[_0x2a4b('0x43')]);_0xf385db[_0x2a4b('0x44')]=_[_0x2a4b('0x45')](_0xf385db[_0x2a4b('0x41')],_0xf385db[_0x2a4b('0x43')]);_0x373f1b[_0x2a4b('0x46')]=_[_0x2a4b('0x45')](_0xf385db[_0x2a4b('0x41')],qs[_0x2a4b('0x47')](_0xce835c[_0x2a4b('0x43')][_0x2a4b('0x47')]));_0x373f1b[_0x2a4b('0x46')]=_0x373f1b[_0x2a4b('0x46')][_0x2a4b('0x55')]?_0x373f1b['attributes']:_0xf385db[_0x2a4b('0x41')];_0x373f1b[_0x2a4b('0x4a')]=qs[_0x2a4b('0x64')](_0xce835c[_0x2a4b('0x43')][_0x2a4b('0x64')]);_0x373f1b[_0x2a4b('0x4d')]=qs[_0x2a4b('0x44')](_[_0x2a4b('0x4b')](_0xce835c[_0x2a4b('0x43')],_0xf385db[_0x2a4b('0x44')]));if(_0xce835c[_0x2a4b('0x43')][_0x2a4b('0x4c')]){_0x373f1b['where']=_[_0x2a4b('0x4e')](_0x373f1b[_0x2a4b('0x4d')],{'$or':_[_0x2a4b('0x3c')](_0x373f1b[_0x2a4b('0x46')],function(_0x1d2b12){var _0x21daea={};_0x21daea[_0x1d2b12]={'$like':'%'+_0xce835c[_0x2a4b('0x43')]['filter']+'%'};return _0x21daea;})});}_0x373f1b=_[_0x2a4b('0x4e')]({},_0x373f1b,_0xce835c[_0x2a4b('0x57')]);return _0x1f992a[_0x2a4b('0x6d')](_0x373f1b);}})[_0x2a4b('0x1e')](function(_0x4a6c97){if(_0x4a6c97){_0x93485c=_0x4a6c97['length'];if(!_0xce835c[_0x2a4b('0x43')]['hasOwnProperty']('nolimit')){_0x373f1b[_0x2a4b('0x2f')]=qs[_0x2a4b('0x2f')](_0xce835c['query'][_0x2a4b('0x2f')]);_0x373f1b[_0x2a4b('0x2d')]=qs[_0x2a4b('0x2d')](_0xce835c[_0x2a4b('0x43')][_0x2a4b('0x2d')]);}return _0x1f992a[_0x2a4b('0x6d')](_0x373f1b);}})[_0x2a4b('0x1e')](function(_0xe2cdef){if(_0xe2cdef){return _0xe2cdef?{'count':_0x93485c,'rows':_0xe2cdef}:null;}})[_0x2a4b('0x1e')](respondWithResult(_0x41c204,null))[_0x2a4b('0x28')](handleError(_0x41c204,null));};exports[_0x2a4b('0x6e')]=function(_0x42192f,_0x579c91,_0x38fb81){var _0x44a39e=_0x42192f[_0x2a4b('0x59')][_0x2a4b('0x6f')];return db[_0x2a4b('0x70')][_0x2a4b('0x51')]({'where':{'id':_0x44a39e},'attributes':['id'],'include':[{'model':db[_0x2a4b('0x66')],'as':_0x2a4b('0x71'),'attributes':['id',_0x2a4b('0x3a'),_0x2a4b('0x72'),_0x2a4b('0x73'),_0x2a4b('0x74')],'raw':!![]}]})['then'](function(_0x40d4aa){if(_0x40d4aa){var _0x112ba8=_[_0x2a4b('0x75')](_0x40d4aa,function(_0x2d1d61){var _0x42a969=_0x2d1d61['get']({'plain':!![]});return _0x42a969['Agents'];});return db[_0x2a4b('0x3d')][_0x2a4b('0x5c')]({'where':{'id':_0x42192f['params']['id']}})[_0x2a4b('0x1e')](function(_0x2ef434){return db[_0x2a4b('0x76')][_0x2a4b('0x77')](function(_0x6f1e7){return _0x2ef434['addTeams'](_0x44a39e,{'transaction':_0x6f1e7})[_0x2a4b('0x1e')](function(){return BPromise[_0x2a4b('0x78')](_0x112ba8,function(_0x1f8987){return db['UserChatQueue'][_0x2a4b('0x79')]({'where':{'UserId':_0x1f8987['id'],'ChatQueueId':_0x42192f[_0x2a4b('0x54')]['id']},'transaction':_0x6f1e7});});})[_0x2a4b('0x1e')](function(){_0x112ba8[_0x2a4b('0x7a')](function(_0x1bdc8c){socket[_0x2a4b('0x7b')](_0x2a4b('0x7c'),{'UserId':_0x1bdc8c['id'],'ChatQueueId':_0x2ef434['id']});});});});});}})[_0x2a4b('0x1e')](respondWithStatusCode(_0x579c91,null))[_0x2a4b('0x28')](handleError(_0x579c91,null));};exports[_0x2a4b('0x7d')]=function(_0x569a86,_0x4b16fc,_0x2bd697){return db['Team'][_0x2a4b('0x51')]({'where':{'id':_0x569a86['query'][_0x2a4b('0x6f')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x2a4b('0x71'),'attributes':['id'],'raw':!![]}]})[_0x2a4b('0x1e')](handleEntityNotFound(_0x4b16fc,null))[_0x2a4b('0x1e')](function(_0x14f2c9){var _0x4c259d=_[_0x2a4b('0x3c')](_0x14f2c9,'id');var _0x209abd=[];var _0x3dfe83=[];var _0x308883=squel[_0x2a4b('0x7e')]();_0x308883[_0x2a4b('0x7f')]('tq.TeamId')['from'](_0x2a4b('0x80'),'tq')[_0x2a4b('0x81')](_0x2a4b('0x82'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('ChatQueueId\x20=\x20?',_0x569a86[_0x2a4b('0x54')]['id']);for(var _0x15e641=0x0;_0x15e641<_0x14f2c9[_0x2a4b('0x55')];_0x15e641+=0x1){let _0x404dd2=_0x14f2c9[_0x15e641];for(var _0x2305e1=0x0;_0x2305e1<_0x404dd2[_0x2a4b('0x71')][_0x2a4b('0x55')];_0x2305e1+=0x1){let _0x1cc342=_0x404dd2[_0x2a4b('0x71')][_0x2305e1];var _0x3d7ffa=_0x308883[_0x2a4b('0x83')]();_0x3d7ffa['where'](_0x2a4b('0x84'),_0x1cc342['id']);_0x3dfe83[_0x2a4b('0x85')](db['sequelize'][_0x2a4b('0x43')](_0x3d7ffa[_0x2a4b('0x86')](),{'type':db[_0x2a4b('0x76')][_0x2a4b('0x87')][_0x2a4b('0x88')]})[_0x2a4b('0x1e')](function(_0x44f51e){if(_0x44f51e[_0x2a4b('0x55')]===0x1){return _0x1cc342['id'];}else{var _0x2047ab=_['every'](_[_0x2a4b('0x3c')](_0x44f51e,_0x2a4b('0x89')),function(_0x293062){return _[_0x2a4b('0x8a')](_0x4c259d,_0x293062);});if(_0x2047ab){return _0x1cc342['id'];}}}));}}return BPromise[_0x2a4b('0x8b')](_0x3dfe83)[_0x2a4b('0x1e')](function(_0x1f643c){_0x209abd=_(_0x209abd)[_0x2a4b('0x8c')](_0x1f643c)['compact']()[_0x2a4b('0x8d')]();return db[_0x2a4b('0x3d')][_0x2a4b('0x5c')]({'where':{'id':_0x569a86['params']['id']}})['then'](function(_0x540128){return db['sequelize']['transaction'](function(_0x588cf0){return _0x540128[_0x2a4b('0x7d')](_0x569a86['query'][_0x2a4b('0x6f')],{'transaction':_0x588cf0})[_0x2a4b('0x1e')](function(){if(!_[_0x2a4b('0x8e')](_0x209abd)){return _0x540128[_0x2a4b('0x8f')](_0x209abd,{'transaction':_0x588cf0});}})[_0x2a4b('0x1e')](function(){_0x209abd['forEach'](function(_0x333ae8){socket[_0x2a4b('0x7b')](_0x2a4b('0x90'),{'UserId':_0x333ae8,'ChatQueueId':_0x540128['id']});});});});});});})[_0x2a4b('0x1e')](respondWithStatusCode(_0x4b16fc,null))[_0x2a4b('0x28')](handleError(_0x4b16fc,null));};exports[_0x2a4b('0x91')]=function(_0x2a6157,_0x2ac115,_0x413469){return db[_0x2a4b('0x3d')][_0x2a4b('0x5c')]({'where':{'id':_0x2a6157['params']['id']}})[_0x2a4b('0x1e')](handleEntityNotFound(_0x2ac115,null))[_0x2a4b('0x1e')](function(_0x1acf03){if(_0x1acf03){return _0x1acf03['addAgents'](_0x2a6157[_0x2a4b('0x59')]['ids'],_[_0x2a4b('0x92')](_0x2a6157['body'],[_0x2a4b('0x6f'),'id'])||{})[_0x2a4b('0x93')](function(_0x35137d){for(var _0x2c86d6=0x0;_0x2c86d6<_0x2a6157[_0x2a4b('0x59')][_0x2a4b('0x6f')][_0x2a4b('0x55')];_0x2c86d6+=0x1){socket['emit'](_0x2a4b('0x7c'),{'UserId':Number(_0x2a6157[_0x2a4b('0x59')][_0x2a4b('0x6f')][_0x2c86d6]),'ChatQueueId':Number(_0x2a6157['params']['id'])});}return _0x35137d;});}})[_0x2a4b('0x1e')](respondWithResult(_0x2ac115,null))[_0x2a4b('0x28')](handleError(_0x2ac115,null));};exports[_0x2a4b('0x8f')]=function(_0x3f0e00,_0x396a2a,_0x304bfc){return db['ChatQueue']['find']({'where':{'id':_0x3f0e00[_0x2a4b('0x54')]['id']}})[_0x2a4b('0x1e')](handleEntityNotFound(_0x396a2a,null))['then'](function(_0x5cad03){if(_0x5cad03){return _0x5cad03[_0x2a4b('0x8f')](_0x3f0e00[_0x2a4b('0x43')]['ids'])[_0x2a4b('0x1e')](function(){if(_[_0x2a4b('0x94')](_0x3f0e00['query'][_0x2a4b('0x6f')])){for(var _0x4eebf3=0x0;_0x4eebf3<_0x3f0e00[_0x2a4b('0x43')][_0x2a4b('0x6f')][_0x2a4b('0x55')];_0x4eebf3+=0x1){socket[_0x2a4b('0x7b')](_0x2a4b('0x90'),{'UserId':Number(_0x3f0e00[_0x2a4b('0x43')][_0x2a4b('0x6f')][_0x4eebf3]),'ChatQueueId':Number(_0x3f0e00['params']['id'])});}}else{socket['emit'](_0x2a4b('0x90'),{'UserId':Number(_0x3f0e00[_0x2a4b('0x43')]['ids']),'ChatQueueId':Number(_0x3f0e00[_0x2a4b('0x54')]['id'])});}});}})[_0x2a4b('0x1e')](respondWithStatusCode(_0x396a2a,null))[_0x2a4b('0x28')](handleError(_0x396a2a,null));};exports[_0x2a4b('0x95')]=function(_0x72cf93,_0x5157a5,_0x48b873){var _0x11ae68={};var _0x5e7e63={};var _0x13938d;var _0x222301;return db[_0x2a4b('0x3d')][_0x2a4b('0x61')]({'where':{'id':_0x72cf93[_0x2a4b('0x54')]['id']}})[_0x2a4b('0x1e')](handleEntityNotFound(_0x5157a5,null))[_0x2a4b('0x1e')](function(_0x45a6e0){if(_0x45a6e0){_0x13938d=_0x45a6e0;_0x5e7e63['model']=_[_0x2a4b('0x42')](db['User'][_0x2a4b('0x3e')]);_0x5e7e63[_0x2a4b('0x43')]=_['keys'](_0x72cf93['query']);_0x5e7e63[_0x2a4b('0x44')]=_[_0x2a4b('0x45')](_0x5e7e63['model'],_0x5e7e63[_0x2a4b('0x43')]);_0x11ae68['attributes']=_[_0x2a4b('0x45')](_0x5e7e63['model'],qs['fields'](_0x72cf93[_0x2a4b('0x43')][_0x2a4b('0x47')]));_0x11ae68['attributes']=_0x11ae68[_0x2a4b('0x46')][_0x2a4b('0x55')]?_0x11ae68[_0x2a4b('0x46')]:_0x5e7e63[_0x2a4b('0x41')];_0x11ae68['order']=qs[_0x2a4b('0x64')](_0x72cf93[_0x2a4b('0x43')][_0x2a4b('0x64')]);_0x11ae68[_0x2a4b('0x4d')]=qs[_0x2a4b('0x44')](_['pick'](_0x72cf93['query'],_0x5e7e63[_0x2a4b('0x44')]));if(_0x72cf93['query'][_0x2a4b('0x4c')]){_0x11ae68[_0x2a4b('0x4d')]=_[_0x2a4b('0x4e')](_0x11ae68['where'],{'$or':_[_0x2a4b('0x3c')](_0x11ae68[_0x2a4b('0x46')],function(_0x674ee){var _0x4b907f={};_0x4b907f[_0x674ee]={'$like':'%'+_0x72cf93[_0x2a4b('0x43')]['filter']+'%'};return _0x4b907f;})});}_0x11ae68=_['merge']({},_0x11ae68,_0x72cf93[_0x2a4b('0x57')]);return _0x13938d[_0x2a4b('0x95')](_0x11ae68);}})[_0x2a4b('0x1e')](function(_0x15bd4b){if(_0x15bd4b){_0x222301=_0x15bd4b['length'];if(!_0x72cf93[_0x2a4b('0x43')][_0x2a4b('0x48')](_0x2a4b('0x49'))){_0x11ae68[_0x2a4b('0x2f')]=qs[_0x2a4b('0x2f')](_0x72cf93[_0x2a4b('0x43')][_0x2a4b('0x2f')]);_0x11ae68[_0x2a4b('0x2d')]=qs['offset'](_0x72cf93[_0x2a4b('0x43')][_0x2a4b('0x2d')]);}return _0x13938d[_0x2a4b('0x95')](_0x11ae68);}})[_0x2a4b('0x1e')](function(_0x8f5f0c){if(_0x8f5f0c){return _0x8f5f0c?{'count':_0x222301,'rows':_0x8f5f0c}:null;}})[_0x2a4b('0x1e')](respondWithResult(_0x5157a5,null))[_0x2a4b('0x28')](handleError(_0x5157a5,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 8da1c02..5da5713 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 _0xd13d=['save','update','hasOwnProperty','hook','exports','events','ChatQueue','setMaxListeners'];(function(_0x33b3c7,_0x403382){var _0x4dadc7=function(_0x314e85){while(--_0x314e85){_0x33b3c7['push'](_0x33b3c7['shift']());}};_0x4dadc7(++_0x403382);}(_0xd13d,0x155));var _0xdd13=function(_0x2d74d5,_0x15971b){_0x2d74d5=_0x2d74d5-0x0;var _0x342a67=_0xd13d[_0x2d74d5];return _0x342a67;};'use strict';var EventEmitter=require(_0xdd13('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xdd13('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xdd13('0x2')](0x0);var events={'afterCreate':_0xdd13('0x3'),'afterUpdate':_0xdd13('0x4'),'afterDestroy':'remove'};function emitEvent(_0x577016){return function(_0x40a980,_0x363c43,_0xca2d72){ChatQueueEvents['emit'](_0x577016+':'+_0x40a980['id'],_0x40a980);ChatQueueEvents['emit'](_0x577016,_0x40a980);_0xca2d72(null);};}for(var e in events){if(events[_0xdd13('0x5')](e)){var event=events[e];ChatQueue[_0xdd13('0x6')](e,emitEvent(event));}}module[_0xdd13('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0x3f18=['ChatQueue','save','update','remove','hasOwnProperty','exports','events'];(function(_0x205dd4,_0x269d4a){var _0x561d69=function(_0x46c17d){while(--_0x46c17d){_0x205dd4['push'](_0x205dd4['shift']());}};_0x561d69(++_0x269d4a);}(_0x3f18,0x1aa));var _0x83f1=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x3f18[_0x4b369d];return _0x571a98;};'use strict';var EventEmitter=require(_0x83f1('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x83f1('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x83f1('0x2'),'afterUpdate':_0x83f1('0x3'),'afterDestroy':_0x83f1('0x4')};function emitEvent(_0x2fb87e){return function(_0x571eab,_0x282d9d,_0x5e8af8){ChatQueueEvents['emit'](_0x2fb87e+':'+_0x571eab['id'],_0x571eab);ChatQueueEvents['emit'](_0x2fb87e,_0x571eab);_0x5e8af8(null);};}for(var e in events){if(events[_0x83f1('0x5')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x83f1('0x6')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index ff12ece..54b1a5e 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 _0x1200=['ChatQueue','chat_queues','util','../../config/logger','moment','bluebird','request-promise','rimraf','./chatQueue.attributes','exports','define'];(function(_0x40158f,_0x2d156a){var _0x486d65=function(_0x2e0d46){while(--_0x2e0d46){_0x40158f['push'](_0x40158f['shift']());}};_0x486d65(++_0x2d156a);}(_0x1200,0x16d));var _0x0120=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x1200[_0x45783c];return _0x1161da;};'use strict';var _=require('lodash');var util=require(_0x0120('0x0'));var logger=require(_0x0120('0x1'))('api');var moment=require(_0x0120('0x2'));var BPromise=require(_0x0120('0x3'));var rp=require(_0x0120('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0120('0x5'));var config=require('../../config/environment');var attributes=require(_0x0120('0x6'));module[_0x0120('0x7')]=function(_0x5019ae,_0x488d7f){return _0x5019ae[_0x0120('0x8')](_0x0120('0x9'),attributes,{'tableName':_0x0120('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x946c=['request-promise','path','rimraf','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api'];(function(_0x4d666d,_0x5d729d){var _0x304bdd=function(_0x272197){while(--_0x272197){_0x4d666d['push'](_0x4d666d['shift']());}};_0x304bdd(++_0x5d729d);}(_0x946c,0x188));var _0xc946=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x946c[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0xc946('0x0'));var util=require(_0xc946('0x1'));var logger=require(_0xc946('0x2'))(_0xc946('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc946('0x4'));var fs=require('fs');var path=require(_0xc946('0x5'));var rimraf=require(_0xc946('0x6'));var config=require('../../config/environment');var attributes=require(_0xc946('0x7'));module[_0xc946('0x8')]=function(_0x5dc620,_0x1770f4){return _0x5dc620[_0xc946('0x9')](_0xc946('0xa'),attributes,{'tableName':_0xc946('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 cc8d4e3..a6f4b77 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 _0xafa7=['error','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','map','include','model','attributes','debug','ShowChatQueue','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x15f306,_0x4b7328){var _0x2138bb=function(_0x393e5d){while(--_0x393e5d){_0x15f306['push'](_0x15f306['shift']());}};_0x2138bb(++_0x4b7328);}(_0xafa7,0x122));var _0x7afa=function(_0x4a0e68,_0x45c08c){_0x4a0e68=_0x4a0e68-0x0;var _0x4fb274=_0xafa7[_0x4a0e68];return _0x4fb274;};'use strict';var _=require(_0x7afa('0x0'));var util=require(_0x7afa('0x1'));var moment=require('moment');var BPromise=require(_0x7afa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7afa('0x3'));var db=require(_0x7afa('0x4'))['db'];var utils=require(_0x7afa('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x7afa('0x6'));var jayson=require(_0x7afa('0x7'));var client=jayson[_0x7afa('0x8')][_0x7afa('0x9')]({'port':0x232a});config[_0x7afa('0xa')]=_[_0x7afa('0xb')](config['redis'],{'host':_0x7afa('0xc'),'port':0x18eb});var socket=require(_0x7afa('0xd'))(new Redis(config[_0x7afa('0xa')]));require(_0x7afa('0xe'))[_0x7afa('0xf')](socket);function respondWithRpcPromise(_0x2ba3dd,_0xb3aee5,_0x4a5f44){return new BPromise(function(_0x2eaa82,_0xde0626){return client[_0x7afa('0x10')](_0x2ba3dd,_0x4a5f44)[_0x7afa('0x11')](function(_0x32f85c){logger[_0x7afa('0x12')](_0x7afa('0x13'),_0xb3aee5,_0x7afa('0x14'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0xb3aee5,'request\x20sent',JSON[_0x7afa('0x15')](_0x32f85c));if(_0x32f85c[_0x7afa('0x16')]){if(_0x32f85c[_0x7afa('0x16')]['code']===0x1f4){logger[_0x7afa('0x16')](_0x7afa('0x13'),_0xb3aee5,_0x32f85c[_0x7afa('0x16')]['message']);return _0xde0626(_0x32f85c['error'][_0x7afa('0x17')]);}logger['error'](_0x7afa('0x13'),_0xb3aee5,_0x32f85c['error']['message']);return _0x2eaa82(_0x32f85c[_0x7afa('0x16')][_0x7afa('0x17')]);}else{logger[_0x7afa('0x12')](_0x7afa('0x13'),_0xb3aee5,'request\x20sent');_0x2eaa82(_0x32f85c[_0x7afa('0x18')][_0x7afa('0x17')]);}})[_0x7afa('0x19')](function(_0x5015fc){logger['error'](_0x7afa('0x13'),_0xb3aee5,_0x5015fc);_0xde0626(_0x5015fc);});});}exports[_0x7afa('0x1a')]=function(_0x4b86b0){var _0x4fc800=this;return new Promise(function(_0x1f1bcf,_0x30aa81){return db[_0x7afa('0x1b')][_0x7afa('0x1c')]({'raw':_0x4b86b0[_0x7afa('0x1d')]?_0x4b86b0['options'][_0x7afa('0x1e')]===undefined?!![]:![]:!![],'where':_0x4b86b0[_0x7afa('0x1d')]?_0x4b86b0[_0x7afa('0x1d')][_0x7afa('0x1f')]||null:null,'attributes':_0x4b86b0[_0x7afa('0x1d')]?_0x4b86b0[_0x7afa('0x1d')]['attributes']||null:null,'limit':_0x4b86b0[_0x7afa('0x1d')]?_0x4b86b0[_0x7afa('0x1d')]['limit']||null:null,'include':_0x4b86b0['options']?_0x4b86b0['options']['include']?_[_0x7afa('0x20')](_0x4b86b0[_0x7afa('0x1d')][_0x7afa('0x21')],function(_0x26d0e0){return{'model':db[_0x26d0e0[_0x7afa('0x22')]],'as':_0x26d0e0['as'],'attributes':_0x26d0e0[_0x7afa('0x23')],'include':_0x26d0e0[_0x7afa('0x21')]?_[_0x7afa('0x20')](_0x26d0e0[_0x7afa('0x21')],function(_0x449c4d){return{'model':db[_0x449c4d[_0x7afa('0x22')]],'as':_0x449c4d['as'],'attributes':_0x449c4d[_0x7afa('0x23')],'include':_0x449c4d[_0x7afa('0x21')]?_['map'](_0x449c4d[_0x7afa('0x21')],function(_0xbb3dff){return{'model':db[_0xbb3dff[_0x7afa('0x22')]],'as':_0xbb3dff['as'],'attributes':_0xbb3dff['attributes']};}):[]};}):[]};}):[]:[]})[_0x7afa('0x11')](function(_0x24e0c){logger[_0x7afa('0x12')]('GetChatQueue',_0x4b86b0);logger[_0x7afa('0x24')](_0x7afa('0x1a'),_0x4b86b0,JSON[_0x7afa('0x15')](_0x24e0c));_0x1f1bcf(_0x24e0c);})['catch'](function(_0x43e3ae){logger[_0x7afa('0x16')](_0x7afa('0x1a'),_0x43e3ae[_0x7afa('0x17')],_0x4b86b0);_0x30aa81(_0x4fc800[_0x7afa('0x16')](0x1f4,_0x43e3ae['message']));});});};exports[_0x7afa('0x25')]=function(_0x599af7){var _0x5c396f=this;return new Promise(function(_0x29c000,_0x169b7b){return db[_0x7afa('0x1b')][_0x7afa('0x26')]({'raw':_0x599af7[_0x7afa('0x1d')]?_0x599af7['options'][_0x7afa('0x1e')]===undefined?!![]:![]:!![],'where':_0x599af7[_0x7afa('0x1d')]?_0x599af7[_0x7afa('0x1d')][_0x7afa('0x1f')]||null:null,'attributes':_0x599af7[_0x7afa('0x1d')]?_0x599af7[_0x7afa('0x1d')][_0x7afa('0x23')]||null:null,'include':_0x599af7[_0x7afa('0x1d')]?_0x599af7[_0x7afa('0x1d')]['include']?_[_0x7afa('0x20')](_0x599af7[_0x7afa('0x1d')]['include'],function(_0x3b49d3){return{'model':db[_0x3b49d3[_0x7afa('0x22')]],'as':_0x3b49d3['as'],'attributes':_0x3b49d3[_0x7afa('0x23')],'include':_0x3b49d3[_0x7afa('0x21')]?_[_0x7afa('0x20')](_0x3b49d3[_0x7afa('0x21')],function(_0xda9fa6){return{'model':db[_0xda9fa6[_0x7afa('0x22')]],'as':_0xda9fa6['as'],'attributes':_0xda9fa6[_0x7afa('0x23')],'include':_0xda9fa6[_0x7afa('0x21')]?_['map'](_0xda9fa6[_0x7afa('0x21')],function(_0x9c0763){return{'model':db[_0x9c0763[_0x7afa('0x22')]],'as':_0x9c0763['as'],'attributes':_0x9c0763['attributes']};}):[]};}):[]};}):[]:[]})[_0x7afa('0x11')](function(_0x433adc){logger[_0x7afa('0x12')]('ShowChatQueue',_0x599af7);logger['debug'](_0x7afa('0x25'),_0x599af7,JSON[_0x7afa('0x15')](_0x433adc));_0x29c000(_0x433adc);})[_0x7afa('0x19')](function(_0x57e9b4){logger['error'](_0x7afa('0x25'),_0x57e9b4[_0x7afa('0x17')],_0x599af7);_0x169b7b(_0x5c396f['error'](0x1f4,_0x57e9b4[_0x7afa('0x17')]));});});}; \ No newline at end of file +var _0x6d0c=['request\x20sent','error','code','message','catch','ChatQueue','findAll','options','raw','where','limit','include','map','model','attributes','GetChatQueue','debug','stringify','ShowChatQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0x46b93c,_0x55b143){var _0x91b789=function(_0x51d88f){while(--_0x51d88f){_0x46b93c['push'](_0x46b93c['shift']());}};_0x91b789(++_0x55b143);}(_0x6d0c,0x8c));var _0xc6d0=function(_0x235f3d,_0x35daa3){_0x235f3d=_0x235f3d-0x0;var _0x4d244d=_0x6d0c[_0x235f3d];return _0x4d244d;};'use strict';var _=require(_0xc6d0('0x0'));var util=require(_0xc6d0('0x1'));var moment=require(_0xc6d0('0x2'));var BPromise=require(_0xc6d0('0x3'));var rs=require(_0xc6d0('0x4'));var fs=require('fs');var Redis=require(_0xc6d0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc6d0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc6d0('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc6d0('0x8')]({'port':0x232a});config[_0xc6d0('0x9')]=_[_0xc6d0('0xa')](config[_0xc6d0('0x9')],{'host':_0xc6d0('0xb'),'port':0x18eb});var socket=require(_0xc6d0('0xc'))(new Redis(config[_0xc6d0('0x9')]));require(_0xc6d0('0xd'))[_0xc6d0('0xe')](socket);function respondWithRpcPromise(_0x2e59b2,_0x577e64,_0xfdaf17){return new BPromise(function(_0x1f3ed1,_0x395085){return client[_0xc6d0('0xf')](_0x2e59b2,_0xfdaf17)[_0xc6d0('0x10')](function(_0x12f0db){logger[_0xc6d0('0x11')](_0xc6d0('0x12'),_0x577e64,'request\x20sent');logger['debug'](_0xc6d0('0x13'),_0x577e64,_0xc6d0('0x14'),JSON['stringify'](_0x12f0db));if(_0x12f0db[_0xc6d0('0x15')]){if(_0x12f0db[_0xc6d0('0x15')][_0xc6d0('0x16')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x577e64,_0x12f0db[_0xc6d0('0x15')][_0xc6d0('0x17')]);return _0x395085(_0x12f0db[_0xc6d0('0x15')]['message']);}logger[_0xc6d0('0x15')]('ChatQueue,\x20%s,\x20%s',_0x577e64,_0x12f0db[_0xc6d0('0x15')][_0xc6d0('0x17')]);return _0x1f3ed1(_0x12f0db[_0xc6d0('0x15')][_0xc6d0('0x17')]);}else{logger[_0xc6d0('0x11')]('ChatQueue,\x20%s,\x20%s',_0x577e64,'request\x20sent');_0x1f3ed1(_0x12f0db['result'][_0xc6d0('0x17')]);}})[_0xc6d0('0x18')](function(_0x1dd9e8){logger['error'](_0xc6d0('0x12'),_0x577e64,_0x1dd9e8);_0x395085(_0x1dd9e8);});});}exports['GetChatQueue']=function(_0x5200bf){var _0x2fca06=this;return new Promise(function(_0x26eb00,_0x2121f2){return db[_0xc6d0('0x19')][_0xc6d0('0x1a')]({'raw':_0x5200bf[_0xc6d0('0x1b')]?_0x5200bf[_0xc6d0('0x1b')][_0xc6d0('0x1c')]===undefined?!![]:![]:!![],'where':_0x5200bf['options']?_0x5200bf[_0xc6d0('0x1b')][_0xc6d0('0x1d')]||null:null,'attributes':_0x5200bf[_0xc6d0('0x1b')]?_0x5200bf[_0xc6d0('0x1b')]['attributes']||null:null,'limit':_0x5200bf['options']?_0x5200bf[_0xc6d0('0x1b')][_0xc6d0('0x1e')]||null:null,'include':_0x5200bf[_0xc6d0('0x1b')]?_0x5200bf[_0xc6d0('0x1b')][_0xc6d0('0x1f')]?_[_0xc6d0('0x20')](_0x5200bf[_0xc6d0('0x1b')][_0xc6d0('0x1f')],function(_0x420cf4){return{'model':db[_0x420cf4[_0xc6d0('0x21')]],'as':_0x420cf4['as'],'attributes':_0x420cf4[_0xc6d0('0x22')],'include':_0x420cf4[_0xc6d0('0x1f')]?_[_0xc6d0('0x20')](_0x420cf4['include'],function(_0x5ad146){return{'model':db[_0x5ad146[_0xc6d0('0x21')]],'as':_0x5ad146['as'],'attributes':_0x5ad146[_0xc6d0('0x22')],'include':_0x5ad146[_0xc6d0('0x1f')]?_[_0xc6d0('0x20')](_0x5ad146['include'],function(_0xa457fa){return{'model':db[_0xa457fa[_0xc6d0('0x21')]],'as':_0xa457fa['as'],'attributes':_0xa457fa[_0xc6d0('0x22')]};}):[]};}):[]};}):[]:[]})[_0xc6d0('0x10')](function(_0x6d0d94){logger['info'](_0xc6d0('0x23'),_0x5200bf);logger[_0xc6d0('0x24')](_0xc6d0('0x23'),_0x5200bf,JSON[_0xc6d0('0x25')](_0x6d0d94));_0x26eb00(_0x6d0d94);})[_0xc6d0('0x18')](function(_0x122c2c){logger['error'](_0xc6d0('0x23'),_0x122c2c[_0xc6d0('0x17')],_0x5200bf);_0x2121f2(_0x2fca06[_0xc6d0('0x15')](0x1f4,_0x122c2c[_0xc6d0('0x17')]));});});};exports[_0xc6d0('0x26')]=function(_0x4d3da0){var _0x58291a=this;return new Promise(function(_0x1dfa28,_0x1fda95){return db['ChatQueue'][_0xc6d0('0x27')]({'raw':_0x4d3da0[_0xc6d0('0x1b')]?_0x4d3da0[_0xc6d0('0x1b')][_0xc6d0('0x1c')]===undefined?!![]:![]:!![],'where':_0x4d3da0[_0xc6d0('0x1b')]?_0x4d3da0[_0xc6d0('0x1b')]['where']||null:null,'attributes':_0x4d3da0[_0xc6d0('0x1b')]?_0x4d3da0['options']['attributes']||null:null,'include':_0x4d3da0[_0xc6d0('0x1b')]?_0x4d3da0[_0xc6d0('0x1b')][_0xc6d0('0x1f')]?_['map'](_0x4d3da0['options'][_0xc6d0('0x1f')],function(_0x1a8eda){return{'model':db[_0x1a8eda['model']],'as':_0x1a8eda['as'],'attributes':_0x1a8eda['attributes'],'include':_0x1a8eda[_0xc6d0('0x1f')]?_[_0xc6d0('0x20')](_0x1a8eda['include'],function(_0x21403c){return{'model':db[_0x21403c[_0xc6d0('0x21')]],'as':_0x21403c['as'],'attributes':_0x21403c[_0xc6d0('0x22')],'include':_0x21403c['include']?_['map'](_0x21403c[_0xc6d0('0x1f')],function(_0x1c6d10){return{'model':db[_0x1c6d10[_0xc6d0('0x21')]],'as':_0x1c6d10['as'],'attributes':_0x1c6d10['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5eb2e4){logger[_0xc6d0('0x11')](_0xc6d0('0x26'),_0x4d3da0);logger[_0xc6d0('0x24')]('ShowChatQueue',_0x4d3da0,JSON['stringify'](_0x5eb2e4));_0x1dfa28(_0x5eb2e4);})[_0xc6d0('0x18')](function(_0x69d9dd){logger[_0xc6d0('0x15')]('ShowChatQueue',_0x69d9dd[_0xc6d0('0x17')],_0x4d3da0);_0x1fda95(_0x58291a[_0xc6d0('0x15')](0x1f4,_0x69d9dd['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 4baf5a9..0500ca6 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 _0x72b1=['register','length','./chatQueue.events','remove','update','emit','removeListener'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x72b1,0x16e));var _0x172b=function(_0x2563b8,_0x1b7fa1){_0x2563b8=_0x2563b8-0x0;var _0x1da178=_0x72b1[_0x2563b8];return _0x1da178;};'use strict';var ChatQueueEvents=require(_0x172b('0x0'));var events=['save',_0x172b('0x1'),_0x172b('0x2')];function createListener(_0x42b795,_0x18fd16){return function(_0x23bc7a){_0x18fd16[_0x172b('0x3')](_0x42b795,_0x23bc7a);};}function removeListener(_0x2c1d6e,_0x558038){return function(){ChatQueueEvents[_0x172b('0x4')](_0x2c1d6e,_0x558038);};}exports[_0x172b('0x5')]=function(_0x475fd6){for(var _0x222624=0x0,_0x571994=events[_0x172b('0x6')];_0x222624<_0x571994;_0x222624++){var _0x517363=events[_0x222624];var _0x1f98e9=createListener('chatQueue:'+_0x517363,_0x475fd6);ChatQueueEvents['on'](_0x517363,_0x1f98e9);}}; \ No newline at end of file +var _0x222f=['./chatQueue.events','save','remove','update','emit','register'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x222f,0x1a4));var _0xf222=function(_0x59cf8a,_0x163bb9){_0x59cf8a=_0x59cf8a-0x0;var _0x22dde8=_0x222f[_0x59cf8a];return _0x22dde8;};'use strict';var ChatQueueEvents=require(_0xf222('0x0'));var events=[_0xf222('0x1'),_0xf222('0x2'),_0xf222('0x3')];function createListener(_0x4d09ec,_0x4b4237){return function(_0x195de1){_0x4b4237[_0xf222('0x4')](_0x4d09ec,_0x195de1);};}function removeListener(_0x307791,_0x7b187d){return function(){ChatQueueEvents['removeListener'](_0x307791,_0x7b187d);};}exports[_0xf222('0x5')]=function(_0x54a758){for(var _0x112e6d=0x0,_0x26f129=events['length'];_0x112e6d<_0x26f129;_0x112e6d++){var _0xf5a105=events[_0x112e6d];var _0x302d7a=createListener('chatQueue:'+_0xf5a105,_0x54a758);ChatQueueEvents['on'](_0xf5a105,_0x302d7a);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index d05dbd4..1b028fc 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 _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3e74,0x175));var _0x43e7=function(_0x48c15e,_0x3b1130){_0x48c15e=_0x48c15e-0x0;var _0x32f80a=_0x3e74[_0x48c15e];return _0x32f80a;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file +var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x4bf550,_0x131bb9){var _0x36f6b5=function(_0x1bc4aa){while(--_0x1bc4aa){_0x4bf550['push'](_0x4bf550['shift']());}};_0x36f6b5(++_0x131bb9);}(_0x7217,0x19e));var _0x7721=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x7217[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('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 6fe7d32..8f06ec3 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 _0xb8ba=['sequelize','exports','STRING','DATE','moment'];(function(_0x426560,_0x297102){var _0x1ef7ed=function(_0x15bc67){while(--_0x15bc67){_0x426560['push'](_0x426560['shift']());}};_0x1ef7ed(++_0x297102);}(_0xb8ba,0x6d));var _0xab8b=function(_0x1c80a3,_0x286877){_0x1c80a3=_0x1c80a3-0x0;var _0x23f9c8=_0xb8ba[_0x1c80a3];return _0x23f9c8;};'use strict';var moment=require(_0xab8b('0x0'));var Sequelize=require(_0xab8b('0x1'));module[_0xab8b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xab8b('0x3')]},'joinAt':{'type':Sequelize[_0xab8b('0x4')]},'leaveAt':{'type':Sequelize[_0xab8b('0x4')]},'acceptAt':{'type':Sequelize[_0xab8b('0x4')]},'exitAt':{'type':Sequelize[_0xab8b('0x4')]},'reason':{'type':Sequelize[_0xab8b('0x3')]}}; \ No newline at end of file +var _0xe1ef=['sequelize','exports','STRING','DATE','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe1ef,0x72));var _0xfe1e=function(_0xd204bd,_0x52cc59){_0xd204bd=_0xd204bd-0x0;var _0x54cc75=_0xe1ef[_0xd204bd];return _0x54cc75;};'use strict';var moment=require(_0xfe1e('0x0'));var Sequelize=require(_0xfe1e('0x1'));module[_0xfe1e('0x2')]={'uniqueid':{'type':Sequelize[_0xfe1e('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xfe1e('0x4')]},'acceptAt':{'type':Sequelize[_0xfe1e('0x4')]},'exitAt':{'type':Sequelize[_0xfe1e('0x4')]},'reason':{'type':Sequelize[_0xfe1e('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 7f2b35e..85f87ce 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 _0xc0f9=['../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','update','then','error','stack','name','index','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','order','sort','pick','filter','merge','VIRTUAL','options','ChatQueueReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x4dcca3,_0x3b88d2){var _0x4b2703=function(_0xa5e865){while(--_0xa5e865){_0x4dcca3['push'](_0x4dcca3['shift']());}};_0x4b2703(++_0x3b88d2);}(_0xc0f9,0xc5));var _0x9c0f=function(_0x1f1fb4,_0x15a561){_0x1f1fb4=_0x1f1fb4-0x0;var _0x12fa15=_0xc0f9[_0x1f1fb4];return _0x12fa15;};'use strict';var emlformat=require(_0x9c0f('0x0'));var rimraf=require(_0x9c0f('0x1'));var zipdir=require(_0x9c0f('0x2'));var jsonpatch=require(_0x9c0f('0x3'));var rp=require(_0x9c0f('0x4'));var moment=require(_0x9c0f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9c0f('0x6'));var util=require(_0x9c0f('0x7'));var path=require(_0x9c0f('0x8'));var sox=require('sox');var csv=require(_0x9c0f('0x9'));var ejs=require(_0x9c0f('0xa'));var fs=require('fs');var fs_extra=require(_0x9c0f('0xb'));var _=require(_0x9c0f('0xc'));var squel=require('squel');var crypto=require(_0x9c0f('0xd'));var jsforce=require(_0x9c0f('0xe'));var deskjs=require(_0x9c0f('0xf'));var toCsv=require(_0x9c0f('0x9'));var querystring=require('querystring');var Papa=require(_0x9c0f('0x10'));var Redis=require(_0x9c0f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9c0f('0x12'));var as=require(_0x9c0f('0x13'));var hardwareService=require(_0x9c0f('0x14'));var logger=require(_0x9c0f('0x15'))(_0x9c0f('0x16'));var utils=require(_0x9c0f('0x17'));var config=require(_0x9c0f('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x9c0f('0x19'))['db'];function respondWithStatusCode(_0x31b2b6,_0x2c269c){_0x2c269c=_0x2c269c||0xcc;return function(_0x150d35){if(_0x150d35){return _0x31b2b6[_0x9c0f('0x1a')](_0x2c269c);}return _0x31b2b6[_0x9c0f('0x1b')](_0x2c269c)[_0x9c0f('0x1c')]();};}function respondWithResult(_0x2daf5c,_0x14a724){_0x14a724=_0x14a724||0xc8;return function(_0x1201db){if(_0x1201db){return _0x2daf5c[_0x9c0f('0x1b')](_0x14a724)['json'](_0x1201db);}};}function respondWithFilteredResult(_0xa3d1a9,_0x484f8f){return function(_0x392de2){if(_0x392de2){var _0x4d2611=typeof _0x484f8f[_0x9c0f('0x1d')]===_0x9c0f('0x1e')&&typeof _0x484f8f[_0x9c0f('0x1f')]==='undefined';var _0x58a631=_0x392de2[_0x9c0f('0x20')];var _0x339c47=_0x4d2611?0x0:_0x484f8f[_0x9c0f('0x1d')];var _0x40ac5c=_0x4d2611?_0x392de2[_0x9c0f('0x20')]:_0x484f8f['offset']+_0x484f8f[_0x9c0f('0x1f')];var _0x2aa887;if(_0x40ac5c>=_0x58a631){_0x40ac5c=_0x58a631;_0x2aa887=0xc8;}else{_0x2aa887=0xce;}_0xa3d1a9[_0x9c0f('0x1b')](_0x2aa887);return _0xa3d1a9[_0x9c0f('0x21')]('Content-Range',_0x339c47+'-'+_0x40ac5c+'/'+_0x58a631)[_0x9c0f('0x22')](_0x392de2);}return null;};}function patchUpdates(_0x24a892){return function(_0x27fbed){try{jsonpatch[_0x9c0f('0x23')](_0x27fbed,_0x24a892,!![]);}catch(_0x2485dc){return BPromise['reject'](_0x2485dc);}return _0x27fbed['save']();};}function saveUpdates(_0xd84d31,_0x1b4dc8){return function(_0x3b16dc){if(_0x3b16dc){return _0x3b16dc[_0x9c0f('0x24')](_0xd84d31)[_0x9c0f('0x25')](function(_0x4f5f61){return _0x4f5f61;});}return null;};}function removeEntity(_0x5a2277,_0x43856e){return function(_0x463ea6){if(_0x463ea6){return _0x463ea6['destroy']()[_0x9c0f('0x25')](function(){_0x5a2277[_0x9c0f('0x1b')](0xcc)[_0x9c0f('0x1c')]();});}};}function handleEntityNotFound(_0x1af538,_0x56e12e){return function(_0x540842){if(!_0x540842){_0x1af538[_0x9c0f('0x1a')](0x194);}return _0x540842;};}function handleError(_0x3d1dc7,_0xe2f0f5){_0xe2f0f5=_0xe2f0f5||0x1f4;return function(_0x46fef1){logger[_0x9c0f('0x26')](_0x46fef1[_0x9c0f('0x27')]);if(_0x46fef1[_0x9c0f('0x28')]){delete _0x46fef1[_0x9c0f('0x28')];}_0x3d1dc7[_0x9c0f('0x1b')](_0xe2f0f5)['send'](_0x46fef1);};}exports[_0x9c0f('0x29')]=function(_0x497f24,_0xe724b){var _0x22a88d={},_0x1622ba={},_0x3bbc35={'count':0x0,'rows':[]};var _0x4fdd61=_['map'](db['ChatQueueReport']['rawAttributes'],function(_0x222d97){return{'name':_0x222d97[_0x9c0f('0x2a')],'type':_0x222d97[_0x9c0f('0x2b')][_0x9c0f('0x2c')]};});_0x1622ba['model']=_[_0x9c0f('0x2d')](_0x4fdd61,'name');_0x1622ba[_0x9c0f('0x2e')]=_[_0x9c0f('0x2f')](_0x497f24['query']);_0x1622ba[_0x9c0f('0x30')]=_[_0x9c0f('0x31')](_0x1622ba['model'],_0x1622ba[_0x9c0f('0x2e')]);_0x22a88d[_0x9c0f('0x32')]=_[_0x9c0f('0x31')](_0x1622ba[_0x9c0f('0x33')],qs[_0x9c0f('0x34')](_0x497f24[_0x9c0f('0x2e')]['fields']));_0x22a88d[_0x9c0f('0x32')]=_0x22a88d['attributes'][_0x9c0f('0x35')]?_0x22a88d[_0x9c0f('0x32')]:_0x1622ba[_0x9c0f('0x33')];if(!_0x497f24[_0x9c0f('0x2e')]['hasOwnProperty']('nolimit')){_0x22a88d['limit']=qs['limit'](_0x497f24[_0x9c0f('0x2e')][_0x9c0f('0x1f')]);_0x22a88d['offset']=qs[_0x9c0f('0x1d')](_0x497f24[_0x9c0f('0x2e')][_0x9c0f('0x1d')]);}_0x22a88d[_0x9c0f('0x36')]=qs[_0x9c0f('0x37')](_0x497f24['query'][_0x9c0f('0x37')]);_0x22a88d['where']=qs[_0x9c0f('0x30')](_[_0x9c0f('0x38')](_0x497f24[_0x9c0f('0x2e')],_0x1622ba[_0x9c0f('0x30')]),_0x4fdd61);if(_0x497f24[_0x9c0f('0x2e')][_0x9c0f('0x39')]){_0x22a88d['where']=_[_0x9c0f('0x3a')](_0x22a88d['where'],{'$or':_[_0x9c0f('0x2d')](_0x4fdd61,function(_0x4e36be){if(_0x4e36be[_0x9c0f('0x2b')]!==_0x9c0f('0x3b')){var _0x145790={};_0x145790[_0x4e36be[_0x9c0f('0x28')]]={'$like':'%'+_0x497f24['query'][_0x9c0f('0x39')]+'%'};return _0x145790;}})});}_0x22a88d=_[_0x9c0f('0x3a')]({},_0x22a88d,_0x497f24[_0x9c0f('0x3c')]);var _0x59cf7f={'where':_0x22a88d['where']};return db[_0x9c0f('0x3d')]['count'](_0x59cf7f)[_0x9c0f('0x25')](function(_0x132193){_0x3bbc35['count']=_0x132193;if(_0x497f24[_0x9c0f('0x2e')][_0x9c0f('0x3e')]){_0x22a88d[_0x9c0f('0x3f')]=[{'all':!![]}];}return db[_0x9c0f('0x3d')][_0x9c0f('0x40')](_0x22a88d);})['then'](function(_0x25af2b){_0x3bbc35[_0x9c0f('0x41')]=_0x25af2b;return _0x3bbc35;})[_0x9c0f('0x25')](respondWithFilteredResult(_0xe724b,_0x22a88d))[_0x9c0f('0x42')](handleError(_0xe724b,null));};exports[_0x9c0f('0x43')]=function(_0x2bc11c,_0x5f2340){var _0x2c397a={'raw':!![],'where':{'id':_0x2bc11c[_0x9c0f('0x44')]['id']}},_0x59696a={};_0x59696a[_0x9c0f('0x33')]=_[_0x9c0f('0x2f')](db['ChatQueueReport']['rawAttributes']);_0x59696a[_0x9c0f('0x2e')]=_[_0x9c0f('0x2f')](_0x2bc11c['query']);_0x59696a[_0x9c0f('0x30')]=_['intersection'](_0x59696a[_0x9c0f('0x33')],_0x59696a[_0x9c0f('0x2e')]);_0x2c397a[_0x9c0f('0x32')]=_[_0x9c0f('0x31')](_0x59696a[_0x9c0f('0x33')],qs['fields'](_0x2bc11c[_0x9c0f('0x2e')][_0x9c0f('0x34')]));_0x2c397a[_0x9c0f('0x32')]=_0x2c397a[_0x9c0f('0x32')][_0x9c0f('0x35')]?_0x2c397a['attributes']:_0x59696a['model'];if(_0x2bc11c[_0x9c0f('0x2e')][_0x9c0f('0x3e')]){_0x2c397a[_0x9c0f('0x3f')]=[{'all':!![]}];}_0x2c397a=_[_0x9c0f('0x3a')]({},_0x2c397a,_0x2bc11c[_0x9c0f('0x3c')]);return db[_0x9c0f('0x3d')][_0x9c0f('0x45')](_0x2c397a)[_0x9c0f('0x25')](handleEntityNotFound(_0x5f2340,null))[_0x9c0f('0x25')](respondWithResult(_0x5f2340,null))[_0x9c0f('0x42')](handleError(_0x5f2340,null));};exports['create']=function(_0x41cbee,_0x42afb0){return db[_0x9c0f('0x3d')][_0x9c0f('0x46')](_0x41cbee[_0x9c0f('0x47')],{})[_0x9c0f('0x25')](respondWithResult(_0x42afb0,0xc9))[_0x9c0f('0x42')](handleError(_0x42afb0,null));};exports['update']=function(_0x26f562,_0x1ab16c){if(_0x26f562[_0x9c0f('0x47')]['id']){delete _0x26f562[_0x9c0f('0x47')]['id'];}return db[_0x9c0f('0x3d')][_0x9c0f('0x45')]({'where':{'id':_0x26f562[_0x9c0f('0x44')]['id']}})[_0x9c0f('0x25')](handleEntityNotFound(_0x1ab16c,null))[_0x9c0f('0x25')](saveUpdates(_0x26f562[_0x9c0f('0x47')],null))[_0x9c0f('0x25')](respondWithResult(_0x1ab16c,null))[_0x9c0f('0x42')](handleError(_0x1ab16c,null));};exports[_0x9c0f('0x48')]=function(_0x127b51,_0x155b54){return db[_0x9c0f('0x3d')]['find']({'where':{'id':_0x127b51[_0x9c0f('0x44')]['id']}})[_0x9c0f('0x25')](handleEntityNotFound(_0x155b54,null))[_0x9c0f('0x25')](removeEntity(_0x155b54,null))['catch'](handleError(_0x155b54,null));};exports[_0x9c0f('0x49')]=function(_0x283c08,_0x6f7da7){return db[_0x9c0f('0x3d')][_0x9c0f('0x49')]()[_0x9c0f('0x25')](respondWithResult(_0x6f7da7,null))[_0x9c0f('0x42')](handleError(_0x6f7da7,null));}; \ No newline at end of file +var _0x8110=['name','send','index','map','ChatQueueReport','rawAttributes','fieldName','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','update','find','describe','rimraf','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x8110,0x185));var _0x0811=function(_0x8a8252,_0x24b338){_0x8a8252=_0x8a8252-0x0;var _0x21c0a0=_0x8110[_0x8a8252];return _0x21c0a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0811('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0811('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x0811('0x2'));var util=require(_0x0811('0x3'));var path=require(_0x0811('0x4'));var sox=require(_0x0811('0x5'));var csv=require(_0x0811('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0811('0x7'));var _=require('lodash');var squel=require(_0x0811('0x8'));var crypto=require(_0x0811('0x9'));var jsforce=require(_0x0811('0xa'));var deskjs=require(_0x0811('0xb'));var toCsv=require(_0x0811('0x6'));var querystring=require(_0x0811('0xc'));var Papa=require(_0x0811('0xd'));var Redis=require(_0x0811('0xe'));var authService=require(_0x0811('0xf'));var qs=require(_0x0811('0x10'));var as=require(_0x0811('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0811('0x12'));var utils=require(_0x0811('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0811('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x220ec1,_0x20e525){_0x20e525=_0x20e525||0xcc;return function(_0x3e6050){if(_0x3e6050){return _0x220ec1[_0x0811('0x15')](_0x20e525);}return _0x220ec1[_0x0811('0x16')](_0x20e525)['end']();};}function respondWithResult(_0x535d3e,_0x203cca){_0x203cca=_0x203cca||0xc8;return function(_0x553502){if(_0x553502){return _0x535d3e['status'](_0x203cca)[_0x0811('0x17')](_0x553502);}};}function respondWithFilteredResult(_0x4ca03c,_0x4c0add){return function(_0x5c5e84){if(_0x5c5e84){var _0x3c06ec=typeof _0x4c0add[_0x0811('0x18')]===_0x0811('0x19')&&typeof _0x4c0add[_0x0811('0x1a')]===_0x0811('0x19');var _0x5baffe=_0x5c5e84[_0x0811('0x1b')];var _0x3c1856=_0x3c06ec?0x0:_0x4c0add[_0x0811('0x18')];var _0x1367c7=_0x3c06ec?_0x5c5e84['count']:_0x4c0add['offset']+_0x4c0add[_0x0811('0x1a')];var _0x414c49;if(_0x1367c7>=_0x5baffe){_0x1367c7=_0x5baffe;_0x414c49=0xc8;}else{_0x414c49=0xce;}_0x4ca03c['status'](_0x414c49);return _0x4ca03c[_0x0811('0x1c')](_0x0811('0x1d'),_0x3c1856+'-'+_0x1367c7+'/'+_0x5baffe)[_0x0811('0x17')](_0x5c5e84);}return null;};}function patchUpdates(_0x2b9aa3){return function(_0x47dd14){try{jsonpatch[_0x0811('0x1e')](_0x47dd14,_0x2b9aa3,!![]);}catch(_0x43102f){return BPromise[_0x0811('0x1f')](_0x43102f);}return _0x47dd14[_0x0811('0x20')]();};}function saveUpdates(_0x24bec4,_0x43c1a4){return function(_0x19e222){if(_0x19e222){return _0x19e222['update'](_0x24bec4)[_0x0811('0x21')](function(_0x3e5c14){return _0x3e5c14;});}return null;};}function removeEntity(_0x4e7e96,_0xc4b95c){return function(_0x46303e){if(_0x46303e){return _0x46303e[_0x0811('0x22')]()[_0x0811('0x21')](function(){_0x4e7e96['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x6d74ac,_0x5cce2e){return function(_0x3fe842){if(!_0x3fe842){_0x6d74ac['sendStatus'](0x194);}return _0x3fe842;};}function handleError(_0x33844b,_0x2957da){_0x2957da=_0x2957da||0x1f4;return function(_0x45170e){logger[_0x0811('0x23')](_0x45170e[_0x0811('0x24')]);if(_0x45170e[_0x0811('0x25')]){delete _0x45170e[_0x0811('0x25')];}_0x33844b['status'](_0x2957da)[_0x0811('0x26')](_0x45170e);};}exports[_0x0811('0x27')]=function(_0x3a190c,_0x1f9f1e){var _0x39af29={},_0x36c96a={},_0x58ef46={'count':0x0,'rows':[]};var _0x59c623=_[_0x0811('0x28')](db[_0x0811('0x29')][_0x0811('0x2a')],function(_0x5a9e10){return{'name':_0x5a9e10[_0x0811('0x2b')],'type':_0x5a9e10['type']['key']};});_0x36c96a['model']=_[_0x0811('0x28')](_0x59c623,_0x0811('0x25'));_0x36c96a['query']=_['keys'](_0x3a190c[_0x0811('0x2c')]);_0x36c96a['filters']=_[_0x0811('0x2d')](_0x36c96a[_0x0811('0x2e')],_0x36c96a['query']);_0x39af29[_0x0811('0x2f')]=_[_0x0811('0x2d')](_0x36c96a[_0x0811('0x2e')],qs['fields'](_0x3a190c[_0x0811('0x2c')][_0x0811('0x30')]));_0x39af29[_0x0811('0x2f')]=_0x39af29[_0x0811('0x2f')][_0x0811('0x31')]?_0x39af29[_0x0811('0x2f')]:_0x36c96a[_0x0811('0x2e')];if(!_0x3a190c[_0x0811('0x2c')][_0x0811('0x32')]('nolimit')){_0x39af29[_0x0811('0x1a')]=qs[_0x0811('0x1a')](_0x3a190c[_0x0811('0x2c')]['limit']);_0x39af29['offset']=qs[_0x0811('0x18')](_0x3a190c[_0x0811('0x2c')][_0x0811('0x18')]);}_0x39af29[_0x0811('0x33')]=qs[_0x0811('0x34')](_0x3a190c[_0x0811('0x2c')][_0x0811('0x34')]);_0x39af29[_0x0811('0x35')]=qs[_0x0811('0x36')](_[_0x0811('0x37')](_0x3a190c[_0x0811('0x2c')],_0x36c96a['filters']),_0x59c623);if(_0x3a190c[_0x0811('0x2c')]['filter']){_0x39af29[_0x0811('0x35')]=_[_0x0811('0x38')](_0x39af29[_0x0811('0x35')],{'$or':_['map'](_0x59c623,function(_0x2c50f6){if(_0x2c50f6[_0x0811('0x39')]!==_0x0811('0x3a')){var _0x3b155b={};_0x3b155b[_0x2c50f6[_0x0811('0x25')]]={'$like':'%'+_0x3a190c[_0x0811('0x2c')]['filter']+'%'};return _0x3b155b;}})});}_0x39af29=_['merge']({},_0x39af29,_0x3a190c[_0x0811('0x3b')]);var _0x17062b={'where':_0x39af29[_0x0811('0x35')]};return db[_0x0811('0x29')][_0x0811('0x1b')](_0x17062b)[_0x0811('0x21')](function(_0x220c8a){_0x58ef46[_0x0811('0x1b')]=_0x220c8a;if(_0x3a190c[_0x0811('0x2c')][_0x0811('0x3c')]){_0x39af29[_0x0811('0x3d')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x0811('0x3e')](_0x39af29);})['then'](function(_0x1ea7c5){_0x58ef46[_0x0811('0x3f')]=_0x1ea7c5;return _0x58ef46;})[_0x0811('0x21')](respondWithFilteredResult(_0x1f9f1e,_0x39af29))[_0x0811('0x40')](handleError(_0x1f9f1e,null));};exports['show']=function(_0x232757,_0x1b7954){var _0x20d34a={'raw':!![],'where':{'id':_0x232757[_0x0811('0x41')]['id']}},_0xccdd8b={};_0xccdd8b['model']=_['keys'](db['ChatQueueReport']['rawAttributes']);_0xccdd8b[_0x0811('0x2c')]=_['keys'](_0x232757['query']);_0xccdd8b['filters']=_[_0x0811('0x2d')](_0xccdd8b['model'],_0xccdd8b[_0x0811('0x2c')]);_0x20d34a['attributes']=_[_0x0811('0x2d')](_0xccdd8b[_0x0811('0x2e')],qs[_0x0811('0x30')](_0x232757[_0x0811('0x2c')][_0x0811('0x30')]));_0x20d34a['attributes']=_0x20d34a[_0x0811('0x2f')][_0x0811('0x31')]?_0x20d34a[_0x0811('0x2f')]:_0xccdd8b[_0x0811('0x2e')];if(_0x232757[_0x0811('0x2c')]['includeAll']){_0x20d34a[_0x0811('0x3d')]=[{'all':!![]}];}_0x20d34a=_[_0x0811('0x38')]({},_0x20d34a,_0x232757[_0x0811('0x3b')]);return db['ChatQueueReport']['find'](_0x20d34a)[_0x0811('0x21')](handleEntityNotFound(_0x1b7954,null))[_0x0811('0x21')](respondWithResult(_0x1b7954,null))[_0x0811('0x40')](handleError(_0x1b7954,null));};exports['create']=function(_0x4701c7,_0x39be7d){return db[_0x0811('0x29')][_0x0811('0x42')](_0x4701c7[_0x0811('0x43')],{})[_0x0811('0x21')](respondWithResult(_0x39be7d,0xc9))['catch'](handleError(_0x39be7d,null));};exports[_0x0811('0x44')]=function(_0x2b578c,_0x54c088){if(_0x2b578c['body']['id']){delete _0x2b578c[_0x0811('0x43')]['id'];}return db['ChatQueueReport'][_0x0811('0x45')]({'where':{'id':_0x2b578c[_0x0811('0x41')]['id']}})['then'](handleEntityNotFound(_0x54c088,null))['then'](saveUpdates(_0x2b578c[_0x0811('0x43')],null))['then'](respondWithResult(_0x54c088,null))[_0x0811('0x40')](handleError(_0x54c088,null));};exports[_0x0811('0x22')]=function(_0x52d23a,_0x39fad3){return db[_0x0811('0x29')][_0x0811('0x45')]({'where':{'id':_0x52d23a[_0x0811('0x41')]['id']}})[_0x0811('0x21')](handleEntityNotFound(_0x39fad3,null))['then'](removeEntity(_0x39fad3,null))[_0x0811('0x40')](handleError(_0x39fad3,null));};exports[_0x0811('0x46')]=function(_0x26d6b1,_0x5b0e18){return db[_0x0811('0x29')][_0x0811('0x46')]()[_0x0811('0x21')](respondWithResult(_0x5b0e18,null))[_0x0811('0x40')](handleError(_0x5b0e18,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 7f62fe5..58a56a1 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 _0xb7e7=['../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','define','ChatQueueReport','uniqueid','lodash'];(function(_0x21d589,_0x1e07f5){var _0x4ccf43=function(_0x55a33c){while(--_0x55a33c){_0x21d589['push'](_0x21d589['shift']());}};_0x4ccf43(++_0x1e07f5);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xb7e7[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x7b7e('0x9'),'fields':[_0x7b7e('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x1cf1c7,_0x1e0f72){var _0x362b0a=function(_0xfec7cd){while(--_0xfec7cd){_0x1cf1c7['push'](_0x1cf1c7['shift']());}};_0x362b0a(++_0x1e0f72);}(_0xe706,0xa3));var _0x6e70=function(_0x10291b,_0x518773){_0x10291b=_0x10291b-0x0;var _0x1d5fbe=_0xe706[_0x10291b];return _0x1d5fbe;};'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')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 130d022..b3ef84e 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 _0xdef5=['code','message','info','CreateChatQueueReport','ChatQueueReport','create','body','options','catch','UpdateChatQueueReport','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xdef5,0x183));var _0x5def=function(_0x44b604,_0x21c079){_0x44b604=_0x44b604-0x0;var _0x3968ac=_0xdef5[_0x44b604];return _0x3968ac;};'use strict';var _=require(_0x5def('0x0'));var util=require(_0x5def('0x1'));var moment=require(_0x5def('0x2'));var BPromise=require(_0x5def('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5def('0x4'));var db=require(_0x5def('0x5'))['db'];var utils=require(_0x5def('0x6'));var logger=require(_0x5def('0x7'))(_0x5def('0x8'));var config=require(_0x5def('0x9'));var jayson=require(_0x5def('0xa'));var client=jayson[_0x5def('0xb')][_0x5def('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x30ae9f,_0x4687d5,_0x3c9df1){return new BPromise(function(_0x37db5a,_0x1abd2a){return client[_0x5def('0xd')](_0x30ae9f,_0x3c9df1)[_0x5def('0xe')](function(_0x151948){logger['info'](_0x5def('0xf'),_0x4687d5,_0x5def('0x10'));logger[_0x5def('0x11')](_0x5def('0x12'),_0x4687d5,_0x5def('0x10'),JSON[_0x5def('0x13')](_0x151948));if(_0x151948[_0x5def('0x14')]){if(_0x151948[_0x5def('0x14')][_0x5def('0x15')]===0x1f4){logger['error'](_0x5def('0xf'),_0x4687d5,_0x151948[_0x5def('0x14')]['message']);return _0x1abd2a(_0x151948['error'][_0x5def('0x16')]);}logger[_0x5def('0x14')](_0x5def('0xf'),_0x4687d5,_0x151948['error']['message']);return _0x37db5a(_0x151948['error']['message']);}else{logger[_0x5def('0x17')](_0x5def('0xf'),_0x4687d5,_0x5def('0x10'));_0x37db5a(_0x151948['result']['message']);}})['catch'](function(_0x27a55e){logger[_0x5def('0x14')](_0x5def('0xf'),_0x4687d5,_0x27a55e);_0x1abd2a(_0x27a55e);});});}exports[_0x5def('0x18')]=function(_0xde58f7){var _0x3c306a=this;return new Promise(function(_0x4f4da2,_0x54712f){return db[_0x5def('0x19')][_0x5def('0x1a')](_0xde58f7[_0x5def('0x1b')],{'raw':_0xde58f7[_0x5def('0x1c')]?_0xde58f7['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4c5f8e){logger['info'](_0x5def('0x18'),_0xde58f7);logger[_0x5def('0x11')](_0x5def('0x18'),_0xde58f7,JSON[_0x5def('0x13')](_0x4c5f8e));_0x4f4da2(_0x4c5f8e);})[_0x5def('0x1d')](function(_0x849ea2){logger[_0x5def('0x14')]('CreateChatQueueReport',_0x849ea2['message'],_0xde58f7);_0x54712f(_0x3c306a[_0x5def('0x14')](0x1f4,_0x849ea2['message']));});});};exports[_0x5def('0x1e')]=function(_0x3ff7c9){var _0x205ad9=this;return new Promise(function(_0x311f05,_0x257db3){return db[_0x5def('0x19')][_0x5def('0x1f')](_0x3ff7c9[_0x5def('0x1b')],{'raw':_0x3ff7c9[_0x5def('0x1c')]?_0x3ff7c9['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ff7c9[_0x5def('0x1c')]?_0x3ff7c9[_0x5def('0x1c')]['where']||null:null,'attributes':_0x3ff7c9[_0x5def('0x1c')]?_0x3ff7c9[_0x5def('0x1c')][_0x5def('0x20')]||null:null,'limit':_0x3ff7c9['options']?_0x3ff7c9[_0x5def('0x1c')][_0x5def('0x21')]||null:null})[_0x5def('0xe')](function(_0x33c0af){logger[_0x5def('0x17')]('UpdateChatQueueReport',_0x3ff7c9);logger[_0x5def('0x11')]('UpdateChatQueueReport',_0x3ff7c9,JSON[_0x5def('0x13')](_0x33c0af));_0x311f05(_0x33c0af);})[_0x5def('0x1d')](function(_0x401464){logger[_0x5def('0x14')](_0x5def('0x1e'),_0x401464[_0x5def('0x16')],_0x3ff7c9);_0x257db3(_0x205ad9[_0x5def('0x14')](0x1f4,_0x401464[_0x5def('0x16')]));});});}; \ No newline at end of file +var _0x7b1b=['request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','UpdateChatQueueReport','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','ChatQueueReport,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7b1b,0x17d));var _0xb7b1=function(_0x4741af,_0x2305b3){_0x4741af=_0x4741af-0x0;var _0xbf6b99=_0x7b1b[_0x4741af];return _0xbf6b99;};'use strict';var _=require(_0xb7b1('0x0'));var util=require(_0xb7b1('0x1'));var moment=require(_0xb7b1('0x2'));var BPromise=require(_0xb7b1('0x3'));var rs=require(_0xb7b1('0x4'));var fs=require('fs');var Redis=require(_0xb7b1('0x5'));var db=require(_0xb7b1('0x6'))['db'];var utils=require(_0xb7b1('0x7'));var logger=require(_0xb7b1('0x8'))('rpc');var config=require(_0xb7b1('0x9'));var jayson=require(_0xb7b1('0xa'));var client=jayson['client'][_0xb7b1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a0740,_0x4ba25d,_0x159a90){return new BPromise(function(_0x3d0b52,_0x1e3431){return client[_0xb7b1('0xc')](_0x3a0740,_0x159a90)['then'](function(_0x4b5481){logger[_0xb7b1('0xd')](_0xb7b1('0xe'),_0x4ba25d,_0xb7b1('0xf'));logger[_0xb7b1('0x10')](_0xb7b1('0x11'),_0x4ba25d,_0xb7b1('0xf'),JSON[_0xb7b1('0x12')](_0x4b5481));if(_0x4b5481[_0xb7b1('0x13')]){if(_0x4b5481[_0xb7b1('0x13')][_0xb7b1('0x14')]===0x1f4){logger[_0xb7b1('0x13')](_0xb7b1('0xe'),_0x4ba25d,_0x4b5481['error'][_0xb7b1('0x15')]);return _0x1e3431(_0x4b5481['error']['message']);}logger[_0xb7b1('0x13')](_0xb7b1('0xe'),_0x4ba25d,_0x4b5481[_0xb7b1('0x13')][_0xb7b1('0x15')]);return _0x3d0b52(_0x4b5481[_0xb7b1('0x13')]['message']);}else{logger[_0xb7b1('0xd')](_0xb7b1('0xe'),_0x4ba25d,_0xb7b1('0xf'));_0x3d0b52(_0x4b5481['result'][_0xb7b1('0x15')]);}})[_0xb7b1('0x16')](function(_0x8e2ff9){logger['error'](_0xb7b1('0xe'),_0x4ba25d,_0x8e2ff9);_0x1e3431(_0x8e2ff9);});});}exports[_0xb7b1('0x17')]=function(_0x59e2c7){var _0x526fc6=this;return new Promise(function(_0x14c02c,_0x55457d){return db[_0xb7b1('0x18')][_0xb7b1('0x19')](_0x59e2c7[_0xb7b1('0x1a')],{'raw':_0x59e2c7['options']?_0x59e2c7[_0xb7b1('0x1b')][_0xb7b1('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x507c5b){logger['info'](_0xb7b1('0x17'),_0x59e2c7);logger[_0xb7b1('0x10')](_0xb7b1('0x17'),_0x59e2c7,JSON[_0xb7b1('0x12')](_0x507c5b));_0x14c02c(_0x507c5b);})['catch'](function(_0x21f01f){logger[_0xb7b1('0x13')](_0xb7b1('0x17'),_0x21f01f[_0xb7b1('0x15')],_0x59e2c7);_0x55457d(_0x526fc6['error'](0x1f4,_0x21f01f[_0xb7b1('0x15')]));});});};exports[_0xb7b1('0x1d')]=function(_0xbbe040){var _0x4beaa4=this;return new Promise(function(_0x39ab05,_0x540027){return db[_0xb7b1('0x18')]['update'](_0xbbe040[_0xb7b1('0x1a')],{'raw':_0xbbe040['options']?_0xbbe040[_0xb7b1('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbbe040[_0xb7b1('0x1b')]?_0xbbe040[_0xb7b1('0x1b')][_0xb7b1('0x1e')]||null:null,'attributes':_0xbbe040[_0xb7b1('0x1b')]?_0xbbe040[_0xb7b1('0x1b')][_0xb7b1('0x1f')]||null:null,'limit':_0xbbe040[_0xb7b1('0x1b')]?_0xbbe040[_0xb7b1('0x1b')][_0xb7b1('0x20')]||null:null})['then'](function(_0x4c22b2){logger[_0xb7b1('0xd')](_0xb7b1('0x1d'),_0xbbe040);logger[_0xb7b1('0x10')](_0xb7b1('0x1d'),_0xbbe040,JSON['stringify'](_0x4c22b2));_0x39ab05(_0x4c22b2);})[_0xb7b1('0x16')](function(_0x5f115a){logger[_0xb7b1('0x13')](_0xb7b1('0x1d'),_0x5f115a[_0xb7b1('0x15')],_0xbbe040);_0x540027(_0x4beaa4['error'](0x1f4,_0x5f115a[_0xb7b1('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 9509012..dc819cb 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 _0x52c0=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x813d0a,_0x4fd3d7){var _0x241352=function(_0x3ca375){while(--_0x3ca375){_0x813d0a['push'](_0x813d0a['shift']());}};_0x241352(++_0x4fd3d7);}(_0x52c0,0xa5));var _0x052c=function(_0x2f81f4,_0xee02fd){_0x2f81f4=_0x2f81f4-0x0;var _0x29b0ea=_0x52c0[_0x2f81f4];return _0x29b0ea;};'use strict';var multer=require(_0x052c('0x0'));var util=require(_0x052c('0x1'));var path=require(_0x052c('0x2'));var timeout=require(_0x052c('0x3'));var express=require('express');var router=express[_0x052c('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x052c('0x5'));var interaction=require(_0x052c('0x6'));var config=require('../../config/environment');var controller=require(_0x052c('0x7'));router[_0x052c('0x8')]('/',auth[_0x052c('0x9')](),controller[_0x052c('0xa')]);router['get'](_0x052c('0xb'),auth[_0x052c('0x9')](),controller['describe']);router[_0x052c('0x8')](_0x052c('0xc'),auth[_0x052c('0x9')](),controller[_0x052c('0xd')]);router[_0x052c('0xe')]('/',auth['isAuthenticated'](),controller[_0x052c('0xf')]);router[_0x052c('0x10')]('/:id',auth[_0x052c('0x9')](),controller[_0x052c('0x11')]);router[_0x052c('0x12')](_0x052c('0xc'),auth['isAuthenticated'](),controller[_0x052c('0x13')]);module[_0x052c('0x14')]=router; \ No newline at end of file +var _0x4e3d=['index','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated'];(function(_0x3da594,_0x246a24){var _0x502753=function(_0x6965cd){while(--_0x6965cd){_0x3da594['push'](_0x3da594['shift']());}};_0x502753(++_0x246a24);}(_0x4e3d,0x146));var _0xd4e3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x4e3d[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0xd4e3('0x0'));var util=require(_0xd4e3('0x1'));var path=require(_0xd4e3('0x2'));var timeout=require(_0xd4e3('0x3'));var express=require(_0xd4e3('0x4'));var router=express[_0xd4e3('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd4e3('0x6'));var config=require('../../config/environment');var controller=require(_0xd4e3('0x7'));router[_0xd4e3('0x8')]('/',auth[_0xd4e3('0x9')](),controller[_0xd4e3('0xa')]);router[_0xd4e3('0x8')](_0xd4e3('0xb'),auth[_0xd4e3('0x9')](),controller[_0xd4e3('0xc')]);router['get'](_0xd4e3('0xd'),auth[_0xd4e3('0x9')](),controller[_0xd4e3('0xe')]);router[_0xd4e3('0xf')]('/',auth[_0xd4e3('0x9')](),controller[_0xd4e3('0x10')]);router[_0xd4e3('0x11')]('/:id',auth[_0xd4e3('0x9')](),controller[_0xd4e3('0x12')]);router['delete'](_0xd4e3('0xd'),auth[_0xd4e3('0x9')](),controller[_0xd4e3('0x13')]);module[_0xd4e3('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index f78d618..ec06a38 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x54ea7a,_0x19df9b){var _0x65a10d=function(_0x1bf936){while(--_0x1bf936){_0x54ea7a['push'](_0x54ea7a['shift']());}};_0x65a10d(++_0x19df9b);}(_0x9bde,0xe1));var _0xe9bd=function(_0x21de91,_0x389fd8){_0x21de91=_0x21de91-0x0;var _0x18d348=_0x9bde[_0x21de91];return _0x18d348;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0xcb91=['STRING','ENUM','account','queue','NOW','exports'];(function(_0x4fe1df,_0x413bd2){var _0x4a0b2c=function(_0x4d463a){while(--_0x4d463a){_0x4fe1df['push'](_0x4fe1df['shift']());}};_0x4a0b2c(++_0x413bd2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x232ec0,_0x45fdd0){_0x232ec0=_0x232ec0-0x0;var _0x356705=_0xcb91[_0x232ec0];return _0x356705;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x1cb9('0x0')]={'uniqueid':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x1cb9('0x2')](_0x1cb9('0x3'),'agent',_0x1cb9('0x4')),'allowNull':![],'defaultValue':_0x1cb9('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x1cb9('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index e6be113..fb13f11 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 _0x9991=['index','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','map','options','ChatTransferReport','includeAll','include','findAll','rows','catch','params','merge','find','create','body','describe','eml-format','rimraf','request-promise','moment','mustache','path','sox','to-csv','fs-extra','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','update','destroy','then','stack','name'];(function(_0xeff08e,_0x33b36f){var _0x372099=function(_0x10e875){while(--_0x10e875){_0xeff08e['push'](_0xeff08e['shift']());}};_0x372099(++_0x33b36f);}(_0x9991,0xf2));var _0x1999=function(_0x437314,_0x979155){_0x437314=_0x437314-0x0;var _0x56c465=_0x9991[_0x437314];return _0x56c465;};'use strict';var emlformat=require(_0x1999('0x0'));var rimraf=require(_0x1999('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1999('0x2'));var moment=require(_0x1999('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1999('0x4'));var util=require('util');var path=require(_0x1999('0x5'));var sox=require(_0x1999('0x6'));var csv=require(_0x1999('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1999('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x1999('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x1999('0xa'));var toCsv=require('to-csv');var querystring=require(_0x1999('0xb'));var Papa=require('papaparse');var Redis=require(_0x1999('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x1999('0xd'));var as=require(_0x1999('0xe'));var hardwareService=require(_0x1999('0xf'));var logger=require(_0x1999('0x10'))(_0x1999('0x11'));var utils=require(_0x1999('0x12'));var config=require(_0x1999('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x1999('0x14'))['db'];function respondWithStatusCode(_0x554ee4,_0x44fd50){_0x44fd50=_0x44fd50||0xcc;return function(_0x4d981a){if(_0x4d981a){return _0x554ee4[_0x1999('0x15')](_0x44fd50);}return _0x554ee4[_0x1999('0x16')](_0x44fd50)[_0x1999('0x17')]();};}function respondWithResult(_0x27accf,_0x1aef8e){_0x1aef8e=_0x1aef8e||0xc8;return function(_0x22e63e){if(_0x22e63e){return _0x27accf[_0x1999('0x16')](_0x1aef8e)[_0x1999('0x18')](_0x22e63e);}};}function respondWithFilteredResult(_0x37796e,_0x5b6c18){return function(_0x58467f){if(_0x58467f){var _0x6b978f=typeof _0x5b6c18[_0x1999('0x19')]==='undefined'&&typeof _0x5b6c18[_0x1999('0x1a')]===_0x1999('0x1b');var _0x2fc3cc=_0x58467f[_0x1999('0x1c')];var _0x2c7cd7=_0x6b978f?0x0:_0x5b6c18[_0x1999('0x19')];var _0x464369=_0x6b978f?_0x58467f['count']:_0x5b6c18[_0x1999('0x19')]+_0x5b6c18[_0x1999('0x1a')];var _0x4aca69;if(_0x464369>=_0x2fc3cc){_0x464369=_0x2fc3cc;_0x4aca69=0xc8;}else{_0x4aca69=0xce;}_0x37796e[_0x1999('0x16')](_0x4aca69);return _0x37796e[_0x1999('0x1d')](_0x1999('0x1e'),_0x2c7cd7+'-'+_0x464369+'/'+_0x2fc3cc)['json'](_0x58467f);}return null;};}function patchUpdates(_0x106732){return function(_0xee83ec){try{jsonpatch[_0x1999('0x1f')](_0xee83ec,_0x106732,!![]);}catch(_0x590801){return BPromise[_0x1999('0x20')](_0x590801);}return _0xee83ec['save']();};}function saveUpdates(_0x395a58,_0x199641){return function(_0x34b4c5){if(_0x34b4c5){return _0x34b4c5[_0x1999('0x21')](_0x395a58)['then'](function(_0x4a0045){return _0x4a0045;});}return null;};}function removeEntity(_0x4d34da,_0x564edb){return function(_0x46c902){if(_0x46c902){return _0x46c902[_0x1999('0x22')]()[_0x1999('0x23')](function(){_0x4d34da['status'](0xcc)[_0x1999('0x17')]();});}};}function handleEntityNotFound(_0x25d9b1,_0x1ab3e4){return function(_0x2ac5cf){if(!_0x2ac5cf){_0x25d9b1['sendStatus'](0x194);}return _0x2ac5cf;};}function handleError(_0x1ea108,_0x2f1975){_0x2f1975=_0x2f1975||0x1f4;return function(_0x4c28a5){logger['error'](_0x4c28a5[_0x1999('0x24')]);if(_0x4c28a5[_0x1999('0x25')]){delete _0x4c28a5[_0x1999('0x25')];}_0x1ea108[_0x1999('0x16')](_0x2f1975)['send'](_0x4c28a5);};}exports[_0x1999('0x26')]=function(_0x5110f6,_0x4fc5da){var _0x2d92ea={},_0x43b6a6={},_0x2ddf9e={'count':0x0,'rows':[]};var _0x25558f=_['map'](db['ChatTransferReport'][_0x1999('0x27')],function(_0x59e821){return{'name':_0x59e821['fieldName'],'type':_0x59e821[_0x1999('0x28')][_0x1999('0x29')]};});_0x43b6a6[_0x1999('0x2a')]=_['map'](_0x25558f,'name');_0x43b6a6[_0x1999('0x2b')]=_[_0x1999('0x2c')](_0x5110f6[_0x1999('0x2b')]);_0x43b6a6['filters']=_[_0x1999('0x2d')](_0x43b6a6[_0x1999('0x2a')],_0x43b6a6[_0x1999('0x2b')]);_0x2d92ea[_0x1999('0x2e')]=_[_0x1999('0x2d')](_0x43b6a6[_0x1999('0x2a')],qs[_0x1999('0x2f')](_0x5110f6[_0x1999('0x2b')][_0x1999('0x2f')]));_0x2d92ea['attributes']=_0x2d92ea[_0x1999('0x2e')][_0x1999('0x30')]?_0x2d92ea[_0x1999('0x2e')]:_0x43b6a6[_0x1999('0x2a')];if(!_0x5110f6['query'][_0x1999('0x31')]('nolimit')){_0x2d92ea[_0x1999('0x1a')]=qs[_0x1999('0x1a')](_0x5110f6[_0x1999('0x2b')][_0x1999('0x1a')]);_0x2d92ea[_0x1999('0x19')]=qs[_0x1999('0x19')](_0x5110f6['query']['offset']);}_0x2d92ea[_0x1999('0x32')]=qs[_0x1999('0x33')](_0x5110f6[_0x1999('0x2b')][_0x1999('0x33')]);_0x2d92ea[_0x1999('0x34')]=qs[_0x1999('0x35')](_[_0x1999('0x36')](_0x5110f6[_0x1999('0x2b')],_0x43b6a6[_0x1999('0x35')]),_0x25558f);if(_0x5110f6[_0x1999('0x2b')][_0x1999('0x37')]){_0x2d92ea[_0x1999('0x34')]=_['merge'](_0x2d92ea[_0x1999('0x34')],{'$or':_[_0x1999('0x38')](_0x25558f,function(_0x549145){if(_0x549145[_0x1999('0x28')]!=='VIRTUAL'){var _0x2d2613={};_0x2d2613[_0x549145['name']]={'$like':'%'+_0x5110f6['query'][_0x1999('0x37')]+'%'};return _0x2d2613;}})});}_0x2d92ea=_['merge']({},_0x2d92ea,_0x5110f6[_0x1999('0x39')]);var _0xa8b231={'where':_0x2d92ea['where']};return db[_0x1999('0x3a')][_0x1999('0x1c')](_0xa8b231)[_0x1999('0x23')](function(_0x1936da){_0x2ddf9e['count']=_0x1936da;if(_0x5110f6[_0x1999('0x2b')][_0x1999('0x3b')]){_0x2d92ea[_0x1999('0x3c')]=[{'all':!![]}];}return db[_0x1999('0x3a')][_0x1999('0x3d')](_0x2d92ea);})['then'](function(_0x4c869a){_0x2ddf9e[_0x1999('0x3e')]=_0x4c869a;return _0x2ddf9e;})['then'](respondWithFilteredResult(_0x4fc5da,_0x2d92ea))[_0x1999('0x3f')](handleError(_0x4fc5da,null));};exports['show']=function(_0x38747e,_0xbd91b6){var _0x2ab5cc={'raw':!![],'where':{'id':_0x38747e[_0x1999('0x40')]['id']}},_0x4ffb0e={};_0x4ffb0e[_0x1999('0x2a')]=_[_0x1999('0x2c')](db['ChatTransferReport'][_0x1999('0x27')]);_0x4ffb0e[_0x1999('0x2b')]=_[_0x1999('0x2c')](_0x38747e['query']);_0x4ffb0e[_0x1999('0x35')]=_[_0x1999('0x2d')](_0x4ffb0e[_0x1999('0x2a')],_0x4ffb0e[_0x1999('0x2b')]);_0x2ab5cc[_0x1999('0x2e')]=_['intersection'](_0x4ffb0e[_0x1999('0x2a')],qs[_0x1999('0x2f')](_0x38747e[_0x1999('0x2b')][_0x1999('0x2f')]));_0x2ab5cc[_0x1999('0x2e')]=_0x2ab5cc[_0x1999('0x2e')]['length']?_0x2ab5cc[_0x1999('0x2e')]:_0x4ffb0e[_0x1999('0x2a')];if(_0x38747e[_0x1999('0x2b')][_0x1999('0x3b')]){_0x2ab5cc['include']=[{'all':!![]}];}_0x2ab5cc=_[_0x1999('0x41')]({},_0x2ab5cc,_0x38747e[_0x1999('0x39')]);return db[_0x1999('0x3a')][_0x1999('0x42')](_0x2ab5cc)['then'](handleEntityNotFound(_0xbd91b6,null))[_0x1999('0x23')](respondWithResult(_0xbd91b6,null))['catch'](handleError(_0xbd91b6,null));};exports[_0x1999('0x43')]=function(_0x3a237a,_0x3fe14f){return db[_0x1999('0x3a')]['create'](_0x3a237a[_0x1999('0x44')],{})[_0x1999('0x23')](respondWithResult(_0x3fe14f,0xc9))[_0x1999('0x3f')](handleError(_0x3fe14f,null));};exports['update']=function(_0x3a5b7a,_0x503627){if(_0x3a5b7a[_0x1999('0x44')]['id']){delete _0x3a5b7a[_0x1999('0x44')]['id'];}return db[_0x1999('0x3a')][_0x1999('0x42')]({'where':{'id':_0x3a5b7a[_0x1999('0x40')]['id']}})['then'](handleEntityNotFound(_0x503627,null))['then'](saveUpdates(_0x3a5b7a[_0x1999('0x44')],null))[_0x1999('0x23')](respondWithResult(_0x503627,null))[_0x1999('0x3f')](handleError(_0x503627,null));};exports['destroy']=function(_0x732292,_0x378fbf){return db[_0x1999('0x3a')][_0x1999('0x42')]({'where':{'id':_0x732292[_0x1999('0x40')]['id']}})[_0x1999('0x23')](handleEntityNotFound(_0x378fbf,null))[_0x1999('0x23')](removeEntity(_0x378fbf,null))[_0x1999('0x3f')](handleError(_0x378fbf,null));};exports[_0x1999('0x45')]=function(_0x13289b,_0x3bb3c2){return db[_0x1999('0x3a')]['describe']()[_0x1999('0x23')](respondWithResult(_0x3bb3c2,null))['catch'](handleError(_0x3bb3c2,null));}; \ No newline at end of file +var _0x8968=['apply','reject','update','then','destroy','end','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','keys','filters','intersection','query','attributes','fields','length','model','nolimit','order','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x3c39f7,_0xcd2c1d){var _0x476581=function(_0x822b74){while(--_0x822b74){_0x3c39f7['push'](_0x3c39f7['shift']());}};_0x476581(++_0xcd2c1d);}(_0x8968,0x75));var _0x8896=function(_0x1f75e8,_0x7fa97f){_0x1f75e8=_0x1f75e8-0x0;var _0x120699=_0x8968[_0x1f75e8];return _0x120699;};'use strict';var emlformat=require(_0x8896('0x0'));var rimraf=require(_0x8896('0x1'));var zipdir=require(_0x8896('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8896('0x3'));var BPromise=require(_0x8896('0x4'));var Mustache=require('mustache');var util=require(_0x8896('0x5'));var path=require(_0x8896('0x6'));var sox=require(_0x8896('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8896('0x8'));var _=require(_0x8896('0x9'));var squel=require(_0x8896('0xa'));var crypto=require(_0x8896('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x8896('0xc'));var Papa=require(_0x8896('0xd'));var Redis=require(_0x8896('0xe'));var authService=require(_0x8896('0xf'));var qs=require(_0x8896('0x10'));var as=require(_0x8896('0x11'));var hardwareService=require(_0x8896('0x12'));var logger=require(_0x8896('0x13'))('api');var utils=require(_0x8896('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8896('0x15'));var db=require(_0x8896('0x16'))['db'];function respondWithStatusCode(_0x7ce721,_0x5a7ede){_0x5a7ede=_0x5a7ede||0xcc;return function(_0x486c07){if(_0x486c07){return _0x7ce721[_0x8896('0x17')](_0x5a7ede);}return _0x7ce721[_0x8896('0x18')](_0x5a7ede)['end']();};}function respondWithResult(_0x568de8,_0x5a62ae){_0x5a62ae=_0x5a62ae||0xc8;return function(_0x4d5ddd){if(_0x4d5ddd){return _0x568de8['status'](_0x5a62ae)[_0x8896('0x19')](_0x4d5ddd);}};}function respondWithFilteredResult(_0x4ffc4e,_0x16e0f0){return function(_0x26e750){if(_0x26e750){var _0x2ea7b1=typeof _0x16e0f0[_0x8896('0x1a')]===_0x8896('0x1b')&&typeof _0x16e0f0[_0x8896('0x1c')]==='undefined';var _0x5a007a=_0x26e750['count'];var _0x55c82f=_0x2ea7b1?0x0:_0x16e0f0['offset'];var _0xe46b3b=_0x2ea7b1?_0x26e750[_0x8896('0x1d')]:_0x16e0f0[_0x8896('0x1a')]+_0x16e0f0[_0x8896('0x1c')];var _0x32bf56;if(_0xe46b3b>=_0x5a007a){_0xe46b3b=_0x5a007a;_0x32bf56=0xc8;}else{_0x32bf56=0xce;}_0x4ffc4e[_0x8896('0x18')](_0x32bf56);return _0x4ffc4e[_0x8896('0x1e')]('Content-Range',_0x55c82f+'-'+_0xe46b3b+'/'+_0x5a007a)[_0x8896('0x19')](_0x26e750);}return null;};}function patchUpdates(_0xc5fce){return function(_0xd00f98){try{jsonpatch[_0x8896('0x1f')](_0xd00f98,_0xc5fce,!![]);}catch(_0x2154fc){return BPromise[_0x8896('0x20')](_0x2154fc);}return _0xd00f98['save']();};}function saveUpdates(_0x1994f0,_0xb9e59){return function(_0x1bf510){if(_0x1bf510){return _0x1bf510[_0x8896('0x21')](_0x1994f0)[_0x8896('0x22')](function(_0x168963){return _0x168963;});}return null;};}function removeEntity(_0x5cc79c,_0x42f53e){return function(_0x384c19){if(_0x384c19){return _0x384c19[_0x8896('0x23')]()[_0x8896('0x22')](function(){_0x5cc79c[_0x8896('0x18')](0xcc)[_0x8896('0x24')]();});}};}function handleEntityNotFound(_0xa64a3f,_0x5f1a0a){return function(_0x2964c3){if(!_0x2964c3){_0xa64a3f['sendStatus'](0x194);}return _0x2964c3;};}function handleError(_0x5cd665,_0x392777){_0x392777=_0x392777||0x1f4;return function(_0x1ea9e6){logger[_0x8896('0x25')](_0x1ea9e6[_0x8896('0x26')]);if(_0x1ea9e6[_0x8896('0x27')]){delete _0x1ea9e6['name'];}_0x5cd665[_0x8896('0x18')](_0x392777)[_0x8896('0x28')](_0x1ea9e6);};}exports[_0x8896('0x29')]=function(_0xce069b,_0x294778){var _0x16191={},_0xd9f40d={},_0x222973={'count':0x0,'rows':[]};var _0x58f07e=_[_0x8896('0x2a')](db[_0x8896('0x2b')][_0x8896('0x2c')],function(_0x3ebc23){return{'name':_0x3ebc23[_0x8896('0x2d')],'type':_0x3ebc23[_0x8896('0x2e')][_0x8896('0x2f')]};});_0xd9f40d['model']=_['map'](_0x58f07e,_0x8896('0x27'));_0xd9f40d['query']=_[_0x8896('0x30')](_0xce069b['query']);_0xd9f40d[_0x8896('0x31')]=_[_0x8896('0x32')](_0xd9f40d['model'],_0xd9f40d[_0x8896('0x33')]);_0x16191[_0x8896('0x34')]=_['intersection'](_0xd9f40d['model'],qs[_0x8896('0x35')](_0xce069b[_0x8896('0x33')][_0x8896('0x35')]));_0x16191[_0x8896('0x34')]=_0x16191[_0x8896('0x34')][_0x8896('0x36')]?_0x16191['attributes']:_0xd9f40d[_0x8896('0x37')];if(!_0xce069b[_0x8896('0x33')]['hasOwnProperty'](_0x8896('0x38'))){_0x16191[_0x8896('0x1c')]=qs[_0x8896('0x1c')](_0xce069b['query']['limit']);_0x16191[_0x8896('0x1a')]=qs['offset'](_0xce069b[_0x8896('0x33')][_0x8896('0x1a')]);}_0x16191[_0x8896('0x39')]=qs['sort'](_0xce069b['query']['sort']);_0x16191[_0x8896('0x3a')]=qs['filters'](_[_0x8896('0x3b')](_0xce069b[_0x8896('0x33')],_0xd9f40d[_0x8896('0x31')]),_0x58f07e);if(_0xce069b[_0x8896('0x33')]['filter']){_0x16191[_0x8896('0x3a')]=_['merge'](_0x16191[_0x8896('0x3a')],{'$or':_[_0x8896('0x2a')](_0x58f07e,function(_0xdae7ab){if(_0xdae7ab[_0x8896('0x2e')]!==_0x8896('0x3c')){var _0x3c2da3={};_0x3c2da3[_0xdae7ab[_0x8896('0x27')]]={'$like':'%'+_0xce069b[_0x8896('0x33')][_0x8896('0x3d')]+'%'};return _0x3c2da3;}})});}_0x16191=_[_0x8896('0x3e')]({},_0x16191,_0xce069b[_0x8896('0x3f')]);var _0x36054c={'where':_0x16191[_0x8896('0x3a')]};return db['ChatTransferReport'][_0x8896('0x1d')](_0x36054c)[_0x8896('0x22')](function(_0x547304){_0x222973[_0x8896('0x1d')]=_0x547304;if(_0xce069b[_0x8896('0x33')][_0x8896('0x40')]){_0x16191[_0x8896('0x41')]=[{'all':!![]}];}return db[_0x8896('0x2b')][_0x8896('0x42')](_0x16191);})[_0x8896('0x22')](function(_0x2336f7){_0x222973[_0x8896('0x43')]=_0x2336f7;return _0x222973;})['then'](respondWithFilteredResult(_0x294778,_0x16191))[_0x8896('0x44')](handleError(_0x294778,null));};exports['show']=function(_0x1806bc,_0x3bcd00){var _0x1d2ef1={'raw':!![],'where':{'id':_0x1806bc[_0x8896('0x45')]['id']}},_0x1265b6={};_0x1265b6['model']=_['keys'](db['ChatTransferReport'][_0x8896('0x2c')]);_0x1265b6['query']=_[_0x8896('0x30')](_0x1806bc['query']);_0x1265b6[_0x8896('0x31')]=_[_0x8896('0x32')](_0x1265b6['model'],_0x1265b6[_0x8896('0x33')]);_0x1d2ef1[_0x8896('0x34')]=_[_0x8896('0x32')](_0x1265b6[_0x8896('0x37')],qs[_0x8896('0x35')](_0x1806bc[_0x8896('0x33')]['fields']));_0x1d2ef1[_0x8896('0x34')]=_0x1d2ef1[_0x8896('0x34')][_0x8896('0x36')]?_0x1d2ef1[_0x8896('0x34')]:_0x1265b6[_0x8896('0x37')];if(_0x1806bc['query']['includeAll']){_0x1d2ef1[_0x8896('0x41')]=[{'all':!![]}];}_0x1d2ef1=_[_0x8896('0x3e')]({},_0x1d2ef1,_0x1806bc[_0x8896('0x3f')]);return db['ChatTransferReport'][_0x8896('0x46')](_0x1d2ef1)[_0x8896('0x22')](handleEntityNotFound(_0x3bcd00,null))[_0x8896('0x22')](respondWithResult(_0x3bcd00,null))[_0x8896('0x44')](handleError(_0x3bcd00,null));};exports[_0x8896('0x47')]=function(_0x2c0fa8,_0xf47559){return db[_0x8896('0x2b')][_0x8896('0x47')](_0x2c0fa8[_0x8896('0x48')],{})[_0x8896('0x22')](respondWithResult(_0xf47559,0xc9))[_0x8896('0x44')](handleError(_0xf47559,null));};exports[_0x8896('0x21')]=function(_0x22d0a3,_0x2b5d20){if(_0x22d0a3[_0x8896('0x48')]['id']){delete _0x22d0a3['body']['id'];}return db[_0x8896('0x2b')][_0x8896('0x46')]({'where':{'id':_0x22d0a3[_0x8896('0x45')]['id']}})[_0x8896('0x22')](handleEntityNotFound(_0x2b5d20,null))['then'](saveUpdates(_0x22d0a3['body'],null))[_0x8896('0x22')](respondWithResult(_0x2b5d20,null))[_0x8896('0x44')](handleError(_0x2b5d20,null));};exports[_0x8896('0x23')]=function(_0x1cf94a,_0x2b6c63){return db[_0x8896('0x2b')]['find']({'where':{'id':_0x1cf94a['params']['id']}})['then'](handleEntityNotFound(_0x2b6c63,null))[_0x8896('0x22')](removeEntity(_0x2b6c63,null))[_0x8896('0x44')](handleError(_0x2b6c63,null));};exports[_0x8896('0x49')]=function(_0x1e3806,_0x252b97){return db[_0x8896('0x2b')][_0x8896('0x49')]()[_0x8896('0x22')](respondWithResult(_0x252b97,null))['catch'](handleError(_0x252b97,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index f479f27..e4a9819 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 _0x3eb3=['path','rimraf','../../config/environment','./chatTransferReport.attributes','report_chat_transfer','uniqueid','lodash','util','../../config/logger','bluebird','request-promise'];(function(_0x3088bf,_0x4f34b1){var _0x226d9f=function(_0x224579){while(--_0x224579){_0x3088bf['push'](_0x3088bf['shift']());}};_0x226d9f(++_0x4f34b1);}(_0x3eb3,0xcc));var _0x33eb=function(_0x29adfe,_0x4593aa){_0x29adfe=_0x29adfe-0x0;var _0x295dc1=_0x3eb3[_0x29adfe];return _0x295dc1;};'use strict';var _=require(_0x33eb('0x0'));var util=require(_0x33eb('0x1'));var logger=require(_0x33eb('0x2'))('api');var moment=require('moment');var BPromise=require(_0x33eb('0x3'));var rp=require(_0x33eb('0x4'));var fs=require('fs');var path=require(_0x33eb('0x5'));var rimraf=require(_0x33eb('0x6'));var config=require(_0x33eb('0x7'));var attributes=require(_0x33eb('0x8'));module['exports']=function(_0x38ec6b,_0x495e26){return _0x38ec6b['define']('ChatTransferReport',attributes,{'tableName':_0x33eb('0x9'),'paranoid':![],'indexes':[{'name':_0x33eb('0xa'),'fields':[_0x33eb('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4ea=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','report_chat_transfer','uniqueid'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xc4ea,0x142));var _0xac4e=function(_0x39e74d,_0x54966b){_0x39e74d=_0x39e74d-0x0;var _0x4b5075=_0xc4ea[_0x39e74d];return _0x4b5075;};'use strict';var _=require(_0xac4e('0x0'));var util=require(_0xac4e('0x1'));var logger=require(_0xac4e('0x2'))(_0xac4e('0x3'));var moment=require(_0xac4e('0x4'));var BPromise=require(_0xac4e('0x5'));var rp=require(_0xac4e('0x6'));var fs=require('fs');var path=require(_0xac4e('0x7'));var rimraf=require(_0xac4e('0x8'));var config=require(_0xac4e('0x9'));var attributes=require(_0xac4e('0xa'));module[_0xac4e('0xb')]=function(_0x485fae,_0x2cc28b){return _0x485fae['define']('ChatTransferReport',attributes,{'tableName':_0xac4e('0xc'),'paranoid':![],'indexes':[{'name':_0xac4e('0xd'),'fields':[_0xac4e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 2175a9d..e82cded 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 _0xcfc8=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb'];(function(_0x268ad0,_0x3cdfcd){var _0xc8139a=function(_0x248abd){while(--_0x248abd){_0x268ad0['push'](_0x268ad0['shift']());}};_0xc8139a(++_0x3cdfcd);}(_0xcfc8,0x17b));var _0x8cfc=function(_0x5945a3,_0x3cb745){_0x5945a3=_0x5945a3-0x0;var _0xa4949d=_0xcfc8[_0x5945a3];return _0xa4949d;};'use strict';var _=require(_0x8cfc('0x0'));var util=require(_0x8cfc('0x1'));var moment=require('moment');var BPromise=require(_0x8cfc('0x2'));var rs=require(_0x8cfc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8cfc('0x4'))['db'];var utils=require(_0x8cfc('0x5'));var logger=require(_0x8cfc('0x6'))(_0x8cfc('0x7'));var config=require(_0x8cfc('0x8'));var jayson=require(_0x8cfc('0x9'));var client=jayson[_0x8cfc('0xa')][_0x8cfc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d6192,_0x3ec99d,_0x2df522){return new BPromise(function(_0x1a0450,_0x4f333d){return client[_0x8cfc('0xc')](_0x4d6192,_0x2df522)[_0x8cfc('0xd')](function(_0x133f3d){logger[_0x8cfc('0xe')](_0x8cfc('0xf'),_0x3ec99d,'request\x20sent');logger[_0x8cfc('0x10')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x3ec99d,_0x8cfc('0x11'),JSON[_0x8cfc('0x12')](_0x133f3d));if(_0x133f3d[_0x8cfc('0x13')]){if(_0x133f3d['error'][_0x8cfc('0x14')]===0x1f4){logger[_0x8cfc('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x3ec99d,_0x133f3d[_0x8cfc('0x13')][_0x8cfc('0x15')]);return _0x4f333d(_0x133f3d[_0x8cfc('0x13')][_0x8cfc('0x15')]);}logger[_0x8cfc('0x13')](_0x8cfc('0xf'),_0x3ec99d,_0x133f3d[_0x8cfc('0x13')]['message']);return _0x1a0450(_0x133f3d[_0x8cfc('0x13')]['message']);}else{logger['info'](_0x8cfc('0xf'),_0x3ec99d,'request\x20sent');_0x1a0450(_0x133f3d[_0x8cfc('0x16')]['message']);}})[_0x8cfc('0x17')](function(_0x378965){logger[_0x8cfc('0x13')](_0x8cfc('0xf'),_0x3ec99d,_0x378965);_0x4f333d(_0x378965);});});} \ No newline at end of file +var _0xdafe=['client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise'];(function(_0x25d221,_0xfec86f){var _0x453db5=function(_0x2d721e){while(--_0x2d721e){_0x25d221['push'](_0x25d221['shift']());}};_0x453db5(++_0xfec86f);}(_0xdafe,0x111));var _0xedaf=function(_0x12f16f,_0x23691a){_0x12f16f=_0x12f16f-0x0;var _0x5c1188=_0xdafe[_0x12f16f];return _0x5c1188;};'use strict';var _=require(_0xedaf('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xedaf('0x1'));var rs=require(_0xedaf('0x2'));var fs=require('fs');var Redis=require(_0xedaf('0x3'));var db=require(_0xedaf('0x4'))['db'];var utils=require(_0xedaf('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xedaf('0x6'));var client=jayson[_0xedaf('0x7')][_0xedaf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x216fae,_0x4b5327,_0x78a275){return new BPromise(function(_0xc2772d,_0x2175b3){return client[_0xedaf('0x9')](_0x216fae,_0x78a275)[_0xedaf('0xa')](function(_0xbd11fd){logger[_0xedaf('0xb')](_0xedaf('0xc'),_0x4b5327,_0xedaf('0xd'));logger[_0xedaf('0xe')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x4b5327,'request\x20sent',JSON[_0xedaf('0xf')](_0xbd11fd));if(_0xbd11fd['error']){if(_0xbd11fd[_0xedaf('0x10')][_0xedaf('0x11')]===0x1f4){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x4b5327,_0xbd11fd[_0xedaf('0x10')][_0xedaf('0x12')]);return _0x2175b3(_0xbd11fd[_0xedaf('0x10')][_0xedaf('0x12')]);}logger[_0xedaf('0x10')](_0xedaf('0xc'),_0x4b5327,_0xbd11fd[_0xedaf('0x10')][_0xedaf('0x12')]);return _0xc2772d(_0xbd11fd[_0xedaf('0x10')][_0xedaf('0x12')]);}else{logger['info'](_0xedaf('0xc'),_0x4b5327,_0xedaf('0xd'));_0xc2772d(_0xbd11fd['result']['message']);}})[_0xedaf('0x13')](function(_0x58a1ad){logger[_0xedaf('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x4b5327,_0x58a1ad);_0x2175b3(_0x58a1ad);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 437c505..3200816 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 _0x2071=['describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get'];(function(_0x10bb2b,_0x4f1976){var _0x2946d7=function(_0x3274d6){while(--_0x3274d6){_0x10bb2b['push'](_0x10bb2b['shift']());}};_0x2946d7(++_0x4f1976);}(_0x2071,0xb1));var _0x1207=function(_0x326d35,_0x4f65b3){_0x326d35=_0x326d35-0x0;var _0xd3f8f3=_0x2071[_0x326d35];return _0xd3f8f3;};'use strict';var multer=require(_0x1207('0x0'));var util=require(_0x1207('0x1'));var path=require(_0x1207('0x2'));var timeout=require('connect-timeout');var express=require(_0x1207('0x3'));var router=express[_0x1207('0x4')]();var fs_extra=require(_0x1207('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1207('0x6'));var config=require(_0x1207('0x7'));var controller=require(_0x1207('0x8'));router['get']('/',auth[_0x1207('0x9')](),controller[_0x1207('0xa')]);router[_0x1207('0xb')]('/describe',auth[_0x1207('0x9')](),controller[_0x1207('0xc')]);router[_0x1207('0xb')](_0x1207('0xd'),auth[_0x1207('0x9')](),controller[_0x1207('0xe')]);router['post']('/',auth[_0x1207('0x9')](),controller[_0x1207('0xf')]);router[_0x1207('0x10')]('/:id',auth[_0x1207('0x9')](),controller[_0x1207('0x11')]);router[_0x1207('0x12')](_0x1207('0xd'),auth[_0x1207('0x9')](),controller[_0x1207('0x13')]);module[_0x1207('0x14')]=router; \ No newline at end of file +var _0x79f0=['./chatTransferReport.controller','/:id','isAuthenticated','post','create','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x24d464,_0xd9decc){var _0x13d881=function(_0x20a09e){while(--_0x20a09e){_0x24d464['push'](_0x24d464['shift']());}};_0x13d881(++_0xd9decc);}(_0x79f0,0x189));var _0x079f=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x79f0[_0x16d10f];return _0x50c823;};'use strict';var multer=require(_0x079f('0x0'));var util=require('util');var path=require(_0x079f('0x1'));var timeout=require('connect-timeout');var express=require(_0x079f('0x2'));var router=express[_0x079f('0x3')]();var fs_extra=require(_0x079f('0x4'));var auth=require(_0x079f('0x5'));var interaction=require(_0x079f('0x6'));var config=require('../../config/environment');var controller=require(_0x079f('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x079f('0x8'),auth[_0x079f('0x9')](),controller['show']);router[_0x079f('0xa')]('/',auth[_0x079f('0x9')](),controller[_0x079f('0xb')]);router['put'](_0x079f('0x8'),auth[_0x079f('0x9')](),controller[_0x079f('0xc')]);router[_0x079f('0xd')]('/:id',auth[_0x079f('0x9')](),controller[_0x079f('0xe')]);module[_0x079f('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 22245bf..7b682c4 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 _0x1be1=['textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','TEXT','stringify','input','name','getDataValue','onlineForm','parse','setDataValue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1be1,0x192));var _0x11be=function(_0x298832,_0x152118){_0x298832=_0x298832-0x0;var _0x366814=_0x1be1[_0x298832];return _0x366814;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x11be('0x0')]={'name':{'type':Sequelize[_0x11be('0x1')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x11be('0x2')},'description':{'type':Sequelize[_0x11be('0x1')]},'mapKey':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x3')},'key':{'type':Sequelize[_0x11be('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x11be('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x11be('0x1')],'allowNull':![],'defaultValue':_0x11be('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x11be('0x1')],'allowNull':![],'defaultValue':_0x11be('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x11be('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x11be('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x11be('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x11be('0x8')](_0x11be('0x9'),_0x11be('0xa')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0xb')},'start_chat_button':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0xe')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x10')},'noteTitle':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x11')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x12')},'closingMessageButton':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x13')},'ratingType':{'type':Sequelize[_0x11be('0x8')](_0x11be('0x14'),_0x11be('0x15')),'defaultValue':_0x11be('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x11be('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x11be('0x16')],'defaultValue':function(){return JSON[_0x11be('0x17')]({'items':[{'type':_0x11be('0x18'),'variable':null,'config':{'placeholder':_0x11be('0x19'),'type':'text','required':!![]},'props':{'title':_0x11be('0x19'),'helpText':''}},{'type':_0x11be('0x18'),'props':{'title':_0x11be('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x11be('0x1a')](_0x11be('0x1b'))?JSON[_0x11be('0x1c')](this['getDataValue'](_0x11be('0x1b'))):{};},'set':function(_0x518e2b){return this[_0x11be('0x1d')]('onlineForm',JSON[_0x11be('0x17')](_0x518e2b));}},'offlineForm':{'type':Sequelize[_0x11be('0x16')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x11be('0x18'),'props':{'title':_0x11be('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x11be('0x3'),'type':_0x11be('0x3')},'variable':null},{'type':_0x11be('0x1e'),'config':{'placeholder':_0x11be('0x1f')},'props':{'title':_0x11be('0x1f'),'helpText':_0x11be('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x11be('0x1a')]('offlineForm')?JSON[_0x11be('0x1c')](this['getDataValue'](_0x11be('0x21'))):{};},'set':function(_0x147b62){return this['setDataValue']('offlineForm',JSON[_0x11be('0x17')](_0x147b62));}},'token':{'type':Sequelize[_0x11be('0x1')],'defaultValue':function(){return rs[_0x11be('0x22')]();}},'autoclose':{'type':Sequelize[_0x11be('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x11be('0x1')]},'forwardOffline':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x11be('0x1')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x23')},'waitingMessage':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x25')},'offlineMessageBody':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x11be('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x26')},'skipUnmanaged':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x27')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x11be('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x11be('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x28')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x29')},'defaultTitle':{'type':Sequelize[_0x11be('0x1')]},'customerAvatar':{'type':Sequelize[_0x11be('0x16')]},'showCustomerAvatar':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x11be('0x1')],'allowNull':![],'defaultValue':_0x11be('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x11be('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x11be('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x2b')},'systemAvatar':{'type':Sequelize[_0x11be('0x16')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x11be('0x6')],'comment':_0x11be('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2618f5){if(!_0x2618f5)this[_0x11be('0x1d')]('mandatoryDispositionPauseId',null);this[_0x11be('0x1d')](_0x11be('0x2d'),_0x2618f5);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x11be('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x11be('0x2e')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x11be('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x11be('0x16')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x11be('0x16')]}}; \ No newline at end of file +var _0xbdb7=['address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Chat','Send','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','star','thumb','stringify','input','name','onlineForm','textarea','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','parse','generate','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:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING'];(function(_0x35c2a9,_0x4e8953){var _0x5ab481=function(_0x16beeb){while(--_0x16beeb){_0x35c2a9['push'](_0x35c2a9['shift']());}};_0x5ab481(++_0x4e8953);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3bd52b,_0xbbc735){_0x3bd52b=_0x3bd52b-0x0;var _0x1e5b89=_0xbdb7[_0x3bd52b];return _0x1e5b89;};'use strict';var Sequelize=require(_0x7bdb('0x0'));var rs=require(_0x7bdb('0x1'));module[_0x7bdb('0x2')]={'name':{'type':Sequelize[_0x7bdb('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x7bdb('0x3')],'allowNull':![],'unique':_0x7bdb('0x4')},'description':{'type':Sequelize[_0x7bdb('0x3')]},'mapKey':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0x5')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0x6')},'customerAlias':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x7bdb('0x3')],'allowNull':![],'defaultValue':_0x7bdb('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x7bdb('0x3')],'allowNull':![],'defaultValue':_0x7bdb('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x7bdb('0x9')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x7bdb('0x3')]},'animation':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x7bdb('0xd')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0xf')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x7bdb('0x9')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x7bdb('0x10')]},'closingQuestion':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0x13')},'noteTitle':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0x14')},'closingMessage':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0xf')},'skipMessageButton':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize['ENUM'](_0x7bdb('0x16'),_0x7bdb('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x7bdb('0x9')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x7bdb('0x10')],'defaultValue':function(){return JSON[_0x7bdb('0x18')]({'items':[{'type':_0x7bdb('0x19'),'variable':null,'config':{'placeholder':_0x7bdb('0x1a'),'type':'text','required':!![]},'props':{'title':_0x7bdb('0x1a'),'helpText':''}},{'type':_0x7bdb('0x19'),'props':{'title':_0x7bdb('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x7bdb('0x5'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x7bdb('0x1b'))?JSON['parse'](this['getDataValue']('onlineForm')):{};},'set':function(_0x2abef6){return this['setDataValue'](_0x7bdb('0x1b'),JSON[_0x7bdb('0x18')](_0x2abef6));}},'offlineForm':{'type':Sequelize[_0x7bdb('0x10')],'defaultValue':function(){return JSON[_0x7bdb('0x18')]({'items':[{'type':_0x7bdb('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x7bdb('0x5'),'type':_0x7bdb('0x5')},'variable':null},{'type':_0x7bdb('0x1c'),'config':{'placeholder':_0x7bdb('0x1d')},'props':{'title':_0x7bdb('0x1d'),'helpText':_0x7bdb('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0x7bdb('0x1f')](_0x7bdb('0x20'))?JSON[_0x7bdb('0x21')](this[_0x7bdb('0x1f')](_0x7bdb('0x20'))):{};},'set':function(_0x81ca6f){return this['setDataValue'](_0x7bdb('0x20'),JSON[_0x7bdb('0x18')](_0x81ca6f));}},'token':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':function(){return rs[_0x7bdb('0x22')]();}},'autoclose':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x7bdb('0x3')]},'forwardOffline':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x7bdb('0x3')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0x23')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0x24')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0x25')},'enableUnmanagedNote':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0xf')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize[_0x7bdb('0x3')]},'notificationTemplate':{'type':Sequelize[_0x7bdb('0x10')],'defaultValue':function(){return _0x7bdb('0x26');}},'notificationSound':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x7bdb('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0x28')},'verticalAlignment':{'type':Sequelize[_0x7bdb('0x9')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0x29')},'messagesAlignment':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':_0x7bdb('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x7bdb('0x9')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x7bdb('0x3')],'allowNull':![],'defaultValue':_0x7bdb('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7bdb('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x7bdb('0x2c')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7bdb('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x7bdb('0x2d'),'set':function(_0x2d578e){if(!_0x2d578e)this[_0x7bdb('0x2e')](_0x7bdb('0x2f'),null);this[_0x7bdb('0x2e')](_0x7bdb('0x30'),_0x2d578e);}},'vidaooEscalation':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x7bdb('0x31')},'vidaooNote':{'type':Sequelize[_0x7bdb('0x3')],'defaultValue':function(){return _0x7bdb('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x7bdb('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x7bdb('0xa')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x7bdb('0x10')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index dfcd795..e98efbc 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 _0x3f0b=['getDispositions','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','sitepic','file','filename','agentAvatar','systemAvatar','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','root','server/files/images/avatars/','download','getCustomerAvatar','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','Sequelize','ValidationError','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','ChatApplication','Applications','applications','list','orderBy','account','Contacts','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','format','%s\x20%s','version','unknown','%s\x20%s\x20%s','device','vendor','stringify','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','close','unmanaged','ChatMessage','UserId','User','unshift','agent','*,*,*,*','forcedOwnership','startRouting','EventManager','notify','offline','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','ChatOfflineMessage','originalname','mimetype','server','files','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','bulkCreate','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','subjectOffline','toPairsIn','mapValues','Chat','MailAccountId','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','Owner','fullname','internal','color','tag','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','push','some','server/files/chat/iframe.ejs','URL','address','3.1.0','remote','x-real-ip','connection','replace','labelText','textColor','textButtonColor','color_button','hideWhenOffline','IntervalId','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','omit','ChatProactiveAction','getFields','online','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','ejs','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','url','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','html-to-text','jayson/promise','client','http','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','VIRTUAL','options','count','includeAll','include','findAll','rows','show','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','addDisposition','ChatWebsiteId','Disposition'];(function(_0x448f76,_0x466124){var _0x165970=function(_0x2c15b6){while(--_0x2c15b6){_0x448f76['push'](_0x448f76['shift']());}};_0x165970(++_0x466124);}(_0x3f0b,0x1ee));var _0xb3f0=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0x3f0b[_0x513aa5];return _0x1a1a7c;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xb3f0('0x0'));var util=require(_0xb3f0('0x1'));var path=require('path');var ejs=require(_0xb3f0('0x2'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0xb3f0('0x3'));var Redis=require(_0xb3f0('0x4'));var qs=require(_0xb3f0('0x5'));var logger=require('../../config/logger')(_0xb3f0('0x6'));var config=require(_0xb3f0('0x7'));var url=require(_0xb3f0('0x8'));var db=require(_0xb3f0('0x9'))['db'];config[_0xb3f0('0xa')]=_[_0xb3f0('0xb')](config[_0xb3f0('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xb3f0('0xc'))(new Redis(config[_0xb3f0('0xa')]));require(_0xb3f0('0xd'))['register'](socket);var htmlToText=require(_0xb3f0('0xe'));var jayson=require(_0xb3f0('0xf'));var client=jayson[_0xb3f0('0x10')][_0xb3f0('0x11')]({'port':0x232c});var client9002=jayson[_0xb3f0('0x10')]['http']({'port':0x232a});var client9003=jayson['client'][_0xb3f0('0x11')]({'port':0x232b});var client9001=jayson[_0xb3f0('0x10')]['http']({'port':0x2329});function respondWithRpcPromise(_0x26ebaf,_0x2e9b97,_0x10af85,_0x150167){return new BPromise(function(_0x14e13f,_0x2de4d4){var _0x58f87f=_0x150167||client;return _0x58f87f[_0xb3f0('0x12')](_0x26ebaf,_0x10af85)[_0xb3f0('0x13')](function(_0x23966b){logger[_0xb3f0('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x2e9b97,'request\x20sent');logger[_0xb3f0('0x15')](_0xb3f0('0x16'),_0x2e9b97,_0xb3f0('0x17'),JSON['stringify'](_0x23966b));if(_0x23966b[_0xb3f0('0x18')]){if(_0x23966b[_0xb3f0('0x18')][_0xb3f0('0x19')]===0x1f4){logger[_0xb3f0('0x18')](_0xb3f0('0x1a'),_0x2e9b97,_0x23966b[_0xb3f0('0x18')][_0xb3f0('0x1b')]);return _0x2de4d4(_0x23966b[_0xb3f0('0x18')][_0xb3f0('0x1b')]);}logger['error'](_0xb3f0('0x1a'),_0x2e9b97,_0x23966b[_0xb3f0('0x18')][_0xb3f0('0x1b')]);return _0x14e13f(_0x23966b['error'][_0xb3f0('0x1b')]);}else{logger['info'](_0xb3f0('0x1a'),_0x2e9b97,_0xb3f0('0x17'));_0x14e13f(_0x23966b[_0xb3f0('0x1c')][_0xb3f0('0x1b')]);}})[_0xb3f0('0x1d')](function(_0x35b3b5){logger[_0xb3f0('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x2e9b97,_0x35b3b5);_0x2de4d4(_0x35b3b5);});});}function respondWithStatusCode(_0x4ae9de,_0x2baf56){_0x2baf56=_0x2baf56||0xcc;return function(_0x526e7f){if(_0x526e7f){return _0x4ae9de[_0xb3f0('0x1e')](_0x2baf56);}return _0x4ae9de[_0xb3f0('0x1f')](_0x2baf56)[_0xb3f0('0x20')]();};}function respondWithResult(_0x36443d,_0x473295){_0x473295=_0x473295||0xc8;return function(_0x2f9bd5){if(_0x2f9bd5){return _0x36443d['status'](_0x473295)[_0xb3f0('0x21')](_0x2f9bd5);}};}function respondWithFilteredResult(_0x4b4856,_0x436fb1){return function(_0x4f046b){if(_0x4f046b){var _0x3f7a7a=typeof _0x436fb1['offset']===_0xb3f0('0x22')&&typeof _0x436fb1[_0xb3f0('0x23')]===_0xb3f0('0x22');var _0xbfad27=_0x4f046b['count'];var _0x4d0c44=_0x3f7a7a?0x0:_0x436fb1['offset'];var _0xdb486b=_0x3f7a7a?_0x4f046b['count']:_0x436fb1[_0xb3f0('0x24')]+_0x436fb1[_0xb3f0('0x23')];var _0x3f8c92;if(_0xdb486b>=_0xbfad27){_0xdb486b=_0xbfad27;_0x3f8c92=0xc8;}else{_0x3f8c92=0xce;}_0x4b4856[_0xb3f0('0x1f')](_0x3f8c92);return _0x4b4856[_0xb3f0('0x25')](_0xb3f0('0x26'),_0x4d0c44+'-'+_0xdb486b+'/'+_0xbfad27)[_0xb3f0('0x21')](_0x4f046b);}return null;};}function saveUpdates(_0x1fc89b){return function(_0x2bfe4b){if(_0x2bfe4b){return _0x2bfe4b['update'](_0x1fc89b)[_0xb3f0('0x13')](function(_0xfa6297){return _0xfa6297;});}return null;};}function removeEntity(_0x2edcae){return function(_0x5bad58){if(_0x5bad58){return _0x5bad58[_0xb3f0('0x27')]()[_0xb3f0('0x13')](function(){var _0x2ddac8=_0x5bad58[_0xb3f0('0x28')]({'plain':!![]});var _0x23f1a2=_0xb3f0('0x29');return db[_0xb3f0('0x2a')]['destroy']({'where':{'type':_0x23f1a2,'resourceId':_0x2ddac8['id']}})[_0xb3f0('0x13')](function(){return _0x5bad58;});})[_0xb3f0('0x13')](function(){_0x2edcae[_0xb3f0('0x1f')](0xcc)[_0xb3f0('0x20')]();});}};}function handleEntityNotFound(_0x1a5516){return function(_0x26e198){if(!_0x26e198){_0x1a5516[_0xb3f0('0x1e')](0x194);}return _0x26e198;};}function handleError(_0x560f03,_0x1ffdc8){_0x1ffdc8=_0x1ffdc8||0x1f4;return function(_0x1c21ac){logger[_0xb3f0('0x18')](_0x1c21ac[_0xb3f0('0x2b')]);if(_0x1c21ac[_0xb3f0('0x2c')]){delete _0x1c21ac[_0xb3f0('0x2c')];}_0x560f03[_0xb3f0('0x1f')](_0x1ffdc8)[_0xb3f0('0x2d')](_0x1c21ac);};}exports[_0xb3f0('0x2e')]=function(_0x5e7aa7,_0x1fea84){var _0x54ff46={'include':[{'model':db[_0xb3f0('0x2f')],'as':_0xb3f0('0x30')}]},_0x22dc1a={},_0x27535d={'count':0x0,'rows':[]};var _0x5e8eff=_['map'](db[_0xb3f0('0x31')][_0xb3f0('0x32')],function(_0x58f93a){return{'name':_0x58f93a[_0xb3f0('0x33')],'type':_0x58f93a[_0xb3f0('0x34')]['key']};});_0x22dc1a['model']=_['map'](_0x5e8eff,_0xb3f0('0x2c'));_0x22dc1a[_0xb3f0('0x35')]=_[_0xb3f0('0x36')](_0x5e7aa7['query']);_0x22dc1a[_0xb3f0('0x37')]=_[_0xb3f0('0x38')](_0x22dc1a[_0xb3f0('0x39')],_0x22dc1a[_0xb3f0('0x35')]);_0x54ff46[_0xb3f0('0x3a')]=_[_0xb3f0('0x38')](_0x22dc1a[_0xb3f0('0x39')],qs[_0xb3f0('0x3b')](_0x5e7aa7[_0xb3f0('0x35')][_0xb3f0('0x3b')]));_0x54ff46[_0xb3f0('0x3a')]=_0x54ff46[_0xb3f0('0x3a')][_0xb3f0('0x3c')]?_0x54ff46[_0xb3f0('0x3a')]:_0x22dc1a[_0xb3f0('0x39')];if(!_0x5e7aa7[_0xb3f0('0x35')][_0xb3f0('0x3d')](_0xb3f0('0x3e'))){_0x54ff46[_0xb3f0('0x23')]=qs[_0xb3f0('0x23')](_0x5e7aa7[_0xb3f0('0x35')][_0xb3f0('0x23')]);_0x54ff46[_0xb3f0('0x24')]=qs[_0xb3f0('0x24')](_0x5e7aa7[_0xb3f0('0x35')][_0xb3f0('0x24')]);}_0x54ff46['order']=qs[_0xb3f0('0x3f')](_0x5e7aa7[_0xb3f0('0x35')][_0xb3f0('0x3f')]);_0x54ff46['where']=qs[_0xb3f0('0x37')](_[_0xb3f0('0x40')](_0x5e7aa7[_0xb3f0('0x35')],_0x22dc1a[_0xb3f0('0x37')]),_0x5e8eff);if(_0x5e7aa7[_0xb3f0('0x35')][_0xb3f0('0x41')]){_0x54ff46[_0xb3f0('0x42')]=_[_0xb3f0('0x43')](_0x54ff46[_0xb3f0('0x42')],{'$or':_[_0xb3f0('0x44')](_0x5e8eff,function(_0x216419){if(_0x216419[_0xb3f0('0x34')]!==_0xb3f0('0x45')){var _0x5f2aa2={};_0x5f2aa2[_0x216419[_0xb3f0('0x2c')]]={'$like':'%'+_0x5e7aa7[_0xb3f0('0x35')][_0xb3f0('0x41')]+'%'};return _0x5f2aa2;}})});}_0x54ff46=_[_0xb3f0('0x43')]({},_0x54ff46,_0x5e7aa7[_0xb3f0('0x46')]);var _0x443143={'where':_0x54ff46[_0xb3f0('0x42')]};return db[_0xb3f0('0x31')][_0xb3f0('0x47')](_0x443143)[_0xb3f0('0x13')](function(_0x5dcfc3){_0x27535d[_0xb3f0('0x47')]=_0x5dcfc3;if(_0x5e7aa7[_0xb3f0('0x35')][_0xb3f0('0x48')]){_0x54ff46[_0xb3f0('0x49')]=[{'all':!![]}];}return db[_0xb3f0('0x31')][_0xb3f0('0x4a')](_0x54ff46);})['then'](function(_0x1feae4){_0x27535d[_0xb3f0('0x4b')]=_0x1feae4;return _0x27535d;})['then'](respondWithFilteredResult(_0x1fea84,_0x54ff46))[_0xb3f0('0x1d')](handleError(_0x1fea84,null));};exports[_0xb3f0('0x4c')]=function(_0x54e03d,_0x635a17){var _0x294613={'raw':![],'where':{'id':_0x54e03d['params']['id']},'include':[{'model':db[_0xb3f0('0x2f')],'as':_0xb3f0('0x30')}]},_0x5175cf={};_0x5175cf['model']=_['keys'](db[_0xb3f0('0x31')][_0xb3f0('0x32')]);_0x5175cf[_0xb3f0('0x35')]=_[_0xb3f0('0x36')](_0x54e03d[_0xb3f0('0x35')]);_0x5175cf[_0xb3f0('0x37')]=_[_0xb3f0('0x38')](_0x5175cf[_0xb3f0('0x39')],_0x5175cf[_0xb3f0('0x35')]);_0x294613['attributes']=_[_0xb3f0('0x38')](_0x5175cf[_0xb3f0('0x39')],qs[_0xb3f0('0x3b')](_0x54e03d['query'][_0xb3f0('0x3b')]));_0x294613[_0xb3f0('0x3a')]=_0x294613[_0xb3f0('0x3a')][_0xb3f0('0x3c')]?_0x294613[_0xb3f0('0x3a')]:_0x5175cf[_0xb3f0('0x39')];if(_0x54e03d[_0xb3f0('0x35')][_0xb3f0('0x48')]){_0x294613['include']=[{'all':!![]}];}_0x294613=_['merge']({},_0x294613,_0x54e03d[_0xb3f0('0x46')]);return db[_0xb3f0('0x31')][_0xb3f0('0x4d')](_0x294613)['then'](handleEntityNotFound(_0x635a17,null))[_0xb3f0('0x13')](respondWithResult(_0x635a17,null))[_0xb3f0('0x1d')](handleError(_0x635a17,null));};exports[_0xb3f0('0x4e')]=function(_0x5f4c19,_0x1d5beb){return db['ChatWebsite'][_0xb3f0('0x4e')](_0x5f4c19[_0xb3f0('0x4f')],{})[_0xb3f0('0x13')](function(_0x59d10a){var _0x1b0311=_0x5f4c19[_0xb3f0('0x50')][_0xb3f0('0x28')]({'plain':!![]});if(!_0x1b0311)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1b0311[_0xb3f0('0x51')]===_0xb3f0('0x50')){var _0x4ca1ad=_0x59d10a[_0xb3f0('0x28')]({'plain':!![]});var _0x46152e=_0xb3f0('0x29');return db[_0xb3f0('0x52')]['find']({'where':{'name':_0x46152e,'userProfileId':_0x1b0311[_0xb3f0('0x53')]},'raw':!![]})[_0xb3f0('0x13')](function(_0x268444){if(_0x268444&&_0x268444[_0xb3f0('0x54')]===0x0){return db[_0xb3f0('0x2a')][_0xb3f0('0x4e')]({'name':_0x4ca1ad[_0xb3f0('0x2c')],'resourceId':_0x4ca1ad['id'],'type':_0x268444[_0xb3f0('0x2c')],'sectionId':_0x268444['id']},{})['then'](function(){return _0x59d10a;});}else{return _0x59d10a;}})[_0xb3f0('0x1d')](function(_0x169b77){logger['error'](_0xb3f0('0x55'),_0x169b77);throw _0x169b77;});}return _0x59d10a;})[_0xb3f0('0x13')](respondWithResult(_0x1d5beb,0xc9))[_0xb3f0('0x1d')](handleError(_0x1d5beb,null));};exports[_0xb3f0('0x56')]=function(_0x494f5c,_0x2a9f1e){if(_0x494f5c['body']['id']){delete _0x494f5c['body']['id'];}return db[_0xb3f0('0x31')][_0xb3f0('0x4d')]({'where':{'id':_0x494f5c[_0xb3f0('0x57')]['id']},'include':[{'model':db[_0xb3f0('0x2f')],'as':_0xb3f0('0x30')}]})['then'](handleEntityNotFound(_0x2a9f1e,null))['then'](saveUpdates(_0x494f5c[_0xb3f0('0x4f')],null))[_0xb3f0('0x13')](respondWithResult(_0x2a9f1e,null))[_0xb3f0('0x1d')](handleError(_0x2a9f1e,null));};exports['destroy']=function(_0x2d1d7a,_0x441b3f){return db[_0xb3f0('0x31')]['find']({'where':{'id':_0x2d1d7a['params']['id']}})[_0xb3f0('0x13')](handleEntityNotFound(_0x441b3f,null))['then'](removeEntity(_0x441b3f,null))['catch'](handleError(_0x441b3f,null));};exports[_0xb3f0('0x58')]=function(_0x21a405,_0x284240){return db['ChatWebsite'][_0xb3f0('0x58')]()[_0xb3f0('0x13')](respondWithResult(_0x284240,null))['catch'](handleError(_0x284240,null));};exports[_0xb3f0('0x59')]=function(_0x3368c9,_0x3c3cfd){if(_0x3368c9[_0xb3f0('0x4f')]['id']){delete _0x3368c9[_0xb3f0('0x4f')]['id'];}return db[_0xb3f0('0x31')]['find']({'where':{'id':_0x3368c9[_0xb3f0('0x57')]['id']}})[_0xb3f0('0x13')](handleEntityNotFound(_0x3c3cfd,null))[_0xb3f0('0x13')](function(_0x30732c){if(_0x30732c){_0x3368c9[_0xb3f0('0x4f')][_0xb3f0('0x5a')]=_0x30732c['id'];return db[_0xb3f0('0x5b')][_0xb3f0('0x4e')](_0x3368c9[_0xb3f0('0x4f')]);}})[_0xb3f0('0x13')](respondWithResult(_0x3c3cfd,null))[_0xb3f0('0x1d')](handleError(_0x3c3cfd,null));};exports[_0xb3f0('0x5c')]=function(_0x168998,_0x4e738a){var _0x58d0ea={'raw':![],'where':{}};var _0x58981d={};var _0x3e6d2b={'count':0x0,'rows':[]};return db[_0xb3f0('0x31')][_0xb3f0('0x5d')]({'where':{'id':_0x168998[_0xb3f0('0x57')]['id']}})[_0xb3f0('0x13')](handleEntityNotFound(_0x4e738a,null))[_0xb3f0('0x13')](function(_0x3fee2f){if(_0x3fee2f){_0x58981d[_0xb3f0('0x39')]=_[_0xb3f0('0x36')](db[_0xb3f0('0x5b')][_0xb3f0('0x32')]);_0x58981d[_0xb3f0('0x35')]=_[_0xb3f0('0x36')](_0x168998[_0xb3f0('0x35')]);_0x58981d[_0xb3f0('0x37')]=_['intersection'](_0x58981d[_0xb3f0('0x39')],_0x58981d[_0xb3f0('0x35')]);_0x58d0ea[_0xb3f0('0x3a')]=_[_0xb3f0('0x38')](_0x58981d['model'],qs[_0xb3f0('0x3b')](_0x168998[_0xb3f0('0x35')][_0xb3f0('0x3b')]));_0x58d0ea[_0xb3f0('0x3a')]=_0x58d0ea[_0xb3f0('0x3a')][_0xb3f0('0x3c')]?_0x58d0ea[_0xb3f0('0x3a')]:_0x58981d['model'];if(!_0x168998[_0xb3f0('0x35')][_0xb3f0('0x3d')]('nolimit')){_0x58d0ea[_0xb3f0('0x23')]=qs[_0xb3f0('0x23')](_0x168998['query'][_0xb3f0('0x23')]);_0x58d0ea[_0xb3f0('0x24')]=qs['offset'](_0x168998[_0xb3f0('0x35')]['offset']);}_0x58d0ea[_0xb3f0('0x5e')]=qs['sort'](_0x168998['query'][_0xb3f0('0x3f')]);_0x58d0ea[_0xb3f0('0x42')]=qs[_0xb3f0('0x37')](_[_0xb3f0('0x40')](_0x168998[_0xb3f0('0x35')],_0x58981d[_0xb3f0('0x37')]));_0x58d0ea[_0xb3f0('0x42')][_0xb3f0('0x5a')]=_0x3fee2f['id'];if(_0x168998[_0xb3f0('0x35')][_0xb3f0('0x41')]){_0x58d0ea[_0xb3f0('0x42')]=_['merge'](_0x58d0ea[_0xb3f0('0x42')],{'$or':_['map'](_0x58d0ea[_0xb3f0('0x3a')],function(_0x279c02){var _0x356874={};_0x356874[_0x279c02]={'$like':'%'+_0x168998['query'][_0xb3f0('0x41')]+'%'};return _0x356874;})});}_0x58d0ea=_['merge']({},_0x58d0ea,_0x168998[_0xb3f0('0x46')]);return db['Disposition'][_0xb3f0('0x47')]({'where':_0x58d0ea[_0xb3f0('0x42')]})[_0xb3f0('0x13')](function(_0x2f86a0){_0x3e6d2b['count']=_0x2f86a0;if(_0x168998[_0xb3f0('0x35')][_0xb3f0('0x48')]){_0x58d0ea[_0xb3f0('0x49')]=[{'all':!![]}];}return db[_0xb3f0('0x5b')][_0xb3f0('0x4a')](_0x58d0ea);})[_0xb3f0('0x13')](function(_0x3c0f55){_0x3e6d2b[_0xb3f0('0x4b')]=_0x3c0f55;return _0x3e6d2b;});}})[_0xb3f0('0x13')](respondWithFilteredResult(_0x4e738a,_0x58d0ea))['catch'](handleError(_0x4e738a,null));};exports[_0xb3f0('0x5f')]=function(_0x4c2f37,_0x1c217c){return db[_0xb3f0('0x31')]['find']({'where':{'id':_0x4c2f37[_0xb3f0('0x57')]['id']}})['then'](handleEntityNotFound(_0x1c217c,null))[_0xb3f0('0x13')](function(_0x3cb81c){if(_0x3cb81c){return _0x3cb81c[_0xb3f0('0x5f')](_0x4c2f37[_0xb3f0('0x35')][_0xb3f0('0x60')]);}})[_0xb3f0('0x13')](respondWithStatusCode(_0x1c217c,null))[_0xb3f0('0x1d')](handleError(_0x1c217c,null));};exports[_0xb3f0('0x61')]=function(_0x1d0176,_0x5d53e4){if(_0x1d0176[_0xb3f0('0x4f')]['id']){delete _0x1d0176[_0xb3f0('0x4f')]['id'];}return db[_0xb3f0('0x31')][_0xb3f0('0x4d')]({'where':{'id':_0x1d0176[_0xb3f0('0x57')]['id']}})[_0xb3f0('0x13')](handleEntityNotFound(_0x5d53e4,null))[_0xb3f0('0x13')](function(_0x467110){if(_0x467110){_0x1d0176[_0xb3f0('0x4f')][_0xb3f0('0x5a')]=_0x467110['id'];return db[_0xb3f0('0x62')]['create'](_0x1d0176[_0xb3f0('0x4f')]);}})['then'](respondWithResult(_0x5d53e4,null))[_0xb3f0('0x1d')](handleError(_0x5d53e4,null));};exports[_0xb3f0('0x63')]=function(_0x53c02b,_0xca0040){var _0x458225={'raw':![],'where':{}};var _0x46b4d7={};var _0x5d0289={'count':0x0,'rows':[]};return db[_0xb3f0('0x31')][_0xb3f0('0x5d')]({'where':{'id':_0x53c02b[_0xb3f0('0x57')]['id']}})[_0xb3f0('0x13')](handleEntityNotFound(_0xca0040,null))['then'](function(_0x2f274c){if(_0x2f274c){_0x46b4d7['model']=_[_0xb3f0('0x36')](db[_0xb3f0('0x62')][_0xb3f0('0x32')]);_0x46b4d7[_0xb3f0('0x35')]=_[_0xb3f0('0x36')](_0x53c02b['query']);_0x46b4d7[_0xb3f0('0x37')]=_[_0xb3f0('0x38')](_0x46b4d7['model'],_0x46b4d7[_0xb3f0('0x35')]);_0x458225[_0xb3f0('0x3a')]=_[_0xb3f0('0x38')](_0x46b4d7[_0xb3f0('0x39')],qs[_0xb3f0('0x3b')](_0x53c02b[_0xb3f0('0x35')][_0xb3f0('0x3b')]));_0x458225[_0xb3f0('0x3a')]=_0x458225[_0xb3f0('0x3a')]['length']?_0x458225[_0xb3f0('0x3a')]:_0x46b4d7[_0xb3f0('0x39')];if(!_0x53c02b[_0xb3f0('0x35')][_0xb3f0('0x3d')](_0xb3f0('0x3e'))){_0x458225[_0xb3f0('0x23')]=qs['limit'](_0x53c02b[_0xb3f0('0x35')][_0xb3f0('0x23')]);_0x458225[_0xb3f0('0x24')]=qs[_0xb3f0('0x24')](_0x53c02b[_0xb3f0('0x35')]['offset']);}_0x458225[_0xb3f0('0x5e')]=qs['sort'](_0x53c02b[_0xb3f0('0x35')][_0xb3f0('0x3f')]);_0x458225[_0xb3f0('0x42')]=qs[_0xb3f0('0x37')](_[_0xb3f0('0x40')](_0x53c02b[_0xb3f0('0x35')],_0x46b4d7['filters']));_0x458225[_0xb3f0('0x42')][_0xb3f0('0x5a')]=_0x2f274c['id'];if(_0x53c02b['query']['filter']){_0x458225['where']=_[_0xb3f0('0x43')](_0x458225[_0xb3f0('0x42')],{'$or':_[_0xb3f0('0x44')](_0x458225[_0xb3f0('0x3a')],function(_0x4ea61b){var _0x23ce1b={};_0x23ce1b[_0x4ea61b]={'$like':'%'+_0x53c02b['query']['filter']+'%'};return _0x23ce1b;})});}_0x458225=_['merge']({},_0x458225,_0x53c02b[_0xb3f0('0x46')]);return db[_0xb3f0('0x62')][_0xb3f0('0x47')]({'where':_0x458225[_0xb3f0('0x42')]})['then'](function(_0x2ae805){_0x5d0289[_0xb3f0('0x47')]=_0x2ae805;if(_0x53c02b[_0xb3f0('0x35')][_0xb3f0('0x48')]){_0x458225[_0xb3f0('0x49')]=[{'all':!![]}];}return db[_0xb3f0('0x62')][_0xb3f0('0x4a')](_0x458225);})['then'](function(_0x1b3310){_0x5d0289['rows']=_0x1b3310;return _0x5d0289;});}})[_0xb3f0('0x13')](respondWithFilteredResult(_0xca0040,_0x458225))[_0xb3f0('0x1d')](handleError(_0xca0040,null));};exports['removeAnswers']=function(_0x127a4d,_0x272189){return db[_0xb3f0('0x31')][_0xb3f0('0x4d')]({'where':{'id':_0x127a4d[_0xb3f0('0x57')]['id']}})[_0xb3f0('0x13')](handleEntityNotFound(_0x272189,null))['then'](function(_0x5789f2){if(_0x5789f2){return _0x5789f2[_0xb3f0('0x64')](_0x127a4d['query'][_0xb3f0('0x60')]);}})[_0xb3f0('0x13')](respondWithStatusCode(_0x272189,null))['catch'](handleError(_0x272189,null));};exports['addLogo']=function(_0x2f380d,_0x5b3f24){_0x2f380d[_0xb3f0('0x4f')][_0xb3f0('0x65')]=_0x2f380d[_0xb3f0('0x66')][_0xb3f0('0x67')];return db['ChatWebsite']['find']({'where':{'id':_0x2f380d[_0xb3f0('0x57')]['id']}})['then'](handleEntityNotFound(_0x5b3f24,null))[_0xb3f0('0x13')](saveUpdates(_0x2f380d[_0xb3f0('0x4f')],null))[_0xb3f0('0x13')](respondWithResult(_0x5b3f24,null))[_0xb3f0('0x1d')](handleError(_0x5b3f24,null));};exports['addAvatar']=function(_0x4482df,_0x43956b){_0x4482df[_0xb3f0('0x4f')][_0xb3f0('0x68')]=_0x4482df[_0xb3f0('0x66')]['filename'];return db[_0xb3f0('0x31')][_0xb3f0('0x4d')]({'where':{'id':_0x4482df[_0xb3f0('0x57')]['id']}})[_0xb3f0('0x13')](handleEntityNotFound(_0x43956b,null))[_0xb3f0('0x13')](saveUpdates(_0x4482df[_0xb3f0('0x4f')],null))[_0xb3f0('0x13')](respondWithResult(_0x43956b,null))[_0xb3f0('0x1d')](handleError(_0x43956b,null));};exports['addCustomerAvatar']=function(_0x21c2d5,_0x43639b){_0x21c2d5['body']['customerAvatar']=_0x21c2d5['file'][_0xb3f0('0x67')];return db['ChatWebsite'][_0xb3f0('0x4d')]({'where':{'id':_0x21c2d5[_0xb3f0('0x57')]['id']}})['then'](handleEntityNotFound(_0x43639b,null))[_0xb3f0('0x13')](saveUpdates(_0x21c2d5[_0xb3f0('0x4f')],null))['then'](respondWithResult(_0x43639b,null))[_0xb3f0('0x1d')](handleError(_0x43639b,null));};exports['addSystemAvatar']=function(_0x47976e,_0x49149d){_0x47976e['body'][_0xb3f0('0x69')]=_0x47976e['file'][_0xb3f0('0x67')];return db[_0xb3f0('0x31')][_0xb3f0('0x4d')]({'where':{'id':_0x47976e[_0xb3f0('0x57')]['id']}})[_0xb3f0('0x13')](handleEntityNotFound(_0x49149d,null))[_0xb3f0('0x13')](saveUpdates(_0x47976e[_0xb3f0('0x4f')],null))['then'](respondWithResult(_0x49149d,null))[_0xb3f0('0x1d')](handleError(_0x49149d,null));};exports['getLogo']=function(_0x3845e0,_0x22d72c){var _0x2afa0c=path['join'](config['root'],_0xb3f0('0x6a'));var _0x4be3e8={'where':{'id':_0x3845e0[_0xb3f0('0x57')]['id']},'attributes':['id',_0xb3f0('0x65')],'raw':!![]};var _0x3dc649=![];return require(_0xb3f0('0x6b'))[_0xb3f0('0x6c')]()[_0xb3f0('0x13')](function(_0x463519){if(_0x463519){_0x3dc649=_0x463519[_0xb3f0('0x6d')];}})[_0xb3f0('0x13')](function(){return db[_0xb3f0('0x31')]['find'](_0x4be3e8);})[_0xb3f0('0x13')](handleEntityNotFound(_0x22d72c,null))[_0xb3f0('0x13')](function(_0x5ebc1c){if(_0x5ebc1c){if(!_[_0xb3f0('0x6e')](_0x5ebc1c['sitepic'])){if(fs[_0xb3f0('0x6f')](path[_0xb3f0('0x70')](config['root'],_0xb3f0('0x71'),_0x5ebc1c[_0xb3f0('0x65')]))&&_0x3dc649){_0x2afa0c=path[_0xb3f0('0x70')](config[_0xb3f0('0x72')],'server/files/images/logos/',_0x5ebc1c[_0xb3f0('0x65')]);}}return _0x22d72c['download'](_0x2afa0c);}})[_0xb3f0('0x1d')](handleError(_0x22d72c,null));};exports['getAvatar']=function(_0x37bcb9,_0x4ea8df){var _0xd570a7=path[_0xb3f0('0x70')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x35b5c1={'where':{'id':_0x37bcb9['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0xb3f0('0x31')][_0xb3f0('0x4d')](_0x35b5c1)[_0xb3f0('0x13')](handleEntityNotFound(_0x4ea8df,null))[_0xb3f0('0x13')](function(_0x17993f){if(_0x17993f){if(!_['isNil'](_0x17993f[_0xb3f0('0x68')])){if(fs['existsSync'](path[_0xb3f0('0x70')](config[_0xb3f0('0x72')],_0xb3f0('0x73'),_0x17993f['agentAvatar']))){_0xd570a7=path['join'](config[_0xb3f0('0x72')],_0xb3f0('0x73'),_0x17993f[_0xb3f0('0x68')]);}}return _0x4ea8df[_0xb3f0('0x74')](_0xd570a7);}})[_0xb3f0('0x1d')](handleError(_0x4ea8df,null));};exports[_0xb3f0('0x75')]=function(_0x50d256,_0x17dc1d){var _0x147357=path[_0xb3f0('0x70')](config[_0xb3f0('0x72')],'server/files/images/avatars/customer_avatar.png');var _0x21f657={'where':{'id':_0x50d256['params']['id']},'attributes':['id',_0xb3f0('0x76'),_0xb3f0('0x77')],'raw':!![]};return db[_0xb3f0('0x31')][_0xb3f0('0x4d')](_0x21f657)[_0xb3f0('0x13')](handleEntityNotFound(_0x17dc1d,null))[_0xb3f0('0x13')](function(_0x246aeb){if(_0x246aeb){if(!_['isNil'](_0x246aeb['customerAvatar'])){if(fs[_0xb3f0('0x6f')](path[_0xb3f0('0x70')](config[_0xb3f0('0x72')],_0xb3f0('0x73'),_0x246aeb[_0xb3f0('0x76')]))&&_0x246aeb[_0xb3f0('0x77')]){_0x147357=path['join'](config[_0xb3f0('0x72')],_0xb3f0('0x73'),_0x246aeb[_0xb3f0('0x76')]);}}return _0x17dc1d[_0xb3f0('0x74')](_0x147357);}})[_0xb3f0('0x1d')](handleError(_0x17dc1d,null));};exports[_0xb3f0('0x78')]=function(_0x2f9edd,_0x42087e){var _0x2b80ef=path[_0xb3f0('0x70')](config['root'],_0xb3f0('0x79'));var _0x254d2c={'where':{'id':_0x2f9edd[_0xb3f0('0x57')]['id']},'attributes':['id',_0xb3f0('0x69')],'raw':!![]};return db['ChatWebsite'][_0xb3f0('0x4d')](_0x254d2c)[_0xb3f0('0x13')](handleEntityNotFound(_0x42087e,null))[_0xb3f0('0x13')](function(_0x501ae2){if(_0x501ae2){if(!_[_0xb3f0('0x6e')](_0x501ae2[_0xb3f0('0x69')])){if(fs['existsSync'](path[_0xb3f0('0x70')](config['root'],'server/files/images/avatars/',_0x501ae2[_0xb3f0('0x69')]))){_0x2b80ef=path[_0xb3f0('0x70')](config[_0xb3f0('0x72')],_0xb3f0('0x73'),_0x501ae2[_0xb3f0('0x69')]);}}return _0x42087e[_0xb3f0('0x74')](_0x2b80ef);}})[_0xb3f0('0x1d')](handleError(_0x42087e,null));};exports['notify']=function(_0x5a1c66,_0x23efdd){var _0x3c8e81=require(_0xb3f0('0x7a'));var _0x4f5d69=new _0x3c8e81();var _0x4b3ee1=_0x4f5d69[_0xb3f0('0x7b')](_0x5a1c66[_0xb3f0('0x7c')][_0xb3f0('0x7d')])[_0xb3f0('0x7e')]();var _0x221f5f={'body':_0x5a1c66[_0xb3f0('0x4f')],'channel':_0xb3f0('0x7f')};var _0x3279e1=[];var _0x1b99b5=[];var _0x2106c3={};var _0x3a2805=![];return db[_0xb3f0('0x80')][_0xb3f0('0x58')]()[_0xb3f0('0x13')](function(_0x544fde){if(!_0x544fde){throw new db['Sequelize']['ValidationError'](_0xb3f0('0x81'));}_0x3279e1=_[_0xb3f0('0x82')](_[_0xb3f0('0x36')](_0x544fde),[_0xb3f0('0x83'),_0xb3f0('0x84')]);_0x1b99b5=_['difference'](_['keys'](_0x544fde),[_0xb3f0('0x83'),_0xb3f0('0x84'),_0xb3f0('0x85'),_0xb3f0('0x86')]);if(_0x5a1c66['body']['id']){delete _0x5a1c66['body']['id'];}if(_['isNil'](_0x5a1c66[_0xb3f0('0x4f')][_0xb3f0('0x87')])){throw new db[(_0xb3f0('0x88'))][(_0xb3f0('0x89'))](_0xb3f0('0x8a'));}if(_[_0xb3f0('0x6e')](_0x5a1c66['body'][_0xb3f0('0x4f')])||_0x5a1c66['body'][_0xb3f0('0x4f')]===''){throw new db['Sequelize'][(_0xb3f0('0x89'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xb3f0('0x6e')](_0x5a1c66[_0xb3f0('0x4f')][_0xb3f0('0x8b')])){throw new db[(_0xb3f0('0x88'))][(_0xb3f0('0x89'))](_0xb3f0('0x8c')+_0x1b99b5);}if(!_[_0xb3f0('0x8d')](_0x1b99b5,_0x5a1c66[_0xb3f0('0x4f')][_0xb3f0('0x8b')])){throw new db[(_0xb3f0('0x88'))][(_0xb3f0('0x89'))](_0xb3f0('0x8e')+_0x1b99b5);}_0x2106c3[_0x5a1c66[_0xb3f0('0x4f')]['mapKey']]=_0x5a1c66[_0xb3f0('0x4f')][_0xb3f0('0x87')];})[_0xb3f0('0x13')](function(){return db[_0xb3f0('0x31')][_0xb3f0('0x4d')]({'where':{'id':_0x5a1c66[_0xb3f0('0x57')]['id']},'include':[{'model':db[_0xb3f0('0x8f')],'as':_0xb3f0('0x90'),'include':[{'model':db[_0xb3f0('0x80')],'as':'Contacts','where':_0x2106c3,'limit':0x1,'order':[[_0xb3f0('0x84'),_0xb3f0('0x91')]]}]},{'model':db[_0xb3f0('0x92')],'as':_0xb3f0('0x93')}]});})[_0xb3f0('0x13')](handleEntityNotFound(_0x23efdd,null))[_0xb3f0('0x13')](function(_0x2362aa){if(_0x2362aa&&_0x2362aa[_0xb3f0('0x90')]){_0x221f5f['account']=_0x2362aa;_0x221f5f[_0xb3f0('0x94')]=_0x2362aa[_0xb3f0('0x93')];_0x221f5f[_0xb3f0('0x95')]=_0x2362aa[_0xb3f0('0x90')];_0x221f5f[_0xb3f0('0x94')]=_[_0xb3f0('0x96')](_0x221f5f[_0xb3f0('0x94')],['priority'],['asc']);if(_0x221f5f[_0xb3f0('0x97')][_0xb3f0('0x93')]){delete _0x221f5f[_0xb3f0('0x97')][_0xb3f0('0x93')];}if(_0x221f5f[_0xb3f0('0x97')][_0xb3f0('0x90')]&&_0x221f5f['account']['List'][_0xb3f0('0x98')][_0xb3f0('0x3c')]){return _0x221f5f[_0xb3f0('0x97')]['List'][_0xb3f0('0x98')][0x0];}var _0xe0613d=_[_0xb3f0('0xb')](_0x5a1c66[_0xb3f0('0x4f')],{'firstName':_0x5a1c66['body']['from'],'ListId':_0x2362aa[_0xb3f0('0x86')]});_0xe0613d[_0x5a1c66[_0xb3f0('0x4f')][_0xb3f0('0x8b')]]=_0x5a1c66['body'][_0xb3f0('0x87')];return db[_0xb3f0('0x80')]['create'](_0xe0613d,{'fields':_0x3279e1,'raw':!![]});}})[_0xb3f0('0x13')](handleEntityNotFound(_0x23efdd,null))[_0xb3f0('0x13')](function(_0x5a487e){_0x221f5f[_0xb3f0('0x99')]=_0x5a487e;var _0x4d5825=_0x5a1c66[_0xb3f0('0x4f')][_0xb3f0('0x9a')];if(_0x5a1c66[_0xb3f0('0x7c')]['cf-connecting-ip']){_0x4d5825=_0x5a1c66[_0xb3f0('0x7c')][_0xb3f0('0x9b')];}else if(_0x5a1c66[_0xb3f0('0x7c')]['x-forwarded-for']){_0x4d5825=_['first'](_0x5a1c66[_0xb3f0('0x7c')][_0xb3f0('0x9c')][_0xb3f0('0x9d')](','));}if(_0x5a487e){var _0x44deb8={'ContactId':_0x5a487e['id'],'ChatWebsiteId':_0x5a1c66[_0xb3f0('0x57')]['id'],'from':(_0x5a487e[_0xb3f0('0x9e')]||'')+'\x20'+(_0x5a487e[_0xb3f0('0x9f')]||''),'customerIp':_0x4d5825,'customerPort':_0x5a1c66[_0xb3f0('0x7c')][_0xb3f0('0xa0')]?_0x5a1c66[_0xb3f0('0x7c')][_0xb3f0('0xa0')]:null,'referer':_0x5a1c66[_0xb3f0('0x4f')][_0xb3f0('0xa1')],'browserName':_0x4b3ee1[_0xb3f0('0xa2')][_0xb3f0('0x2c')]&&_0x4b3ee1[_0xb3f0('0xa2')]['version']?util[_0xb3f0('0xa3')](_0xb3f0('0xa4'),_0x4b3ee1[_0xb3f0('0xa2')][_0xb3f0('0x2c')],_0x4b3ee1[_0xb3f0('0xa2')][_0xb3f0('0xa5')]):_0xb3f0('0xa6'),'browserVersion':_0x4b3ee1[_0xb3f0('0xa2')]['version']||_0xb3f0('0xa6'),'osName':util[_0xb3f0('0xa3')](_0xb3f0('0xa4'),_0x4b3ee1['os']['name'],_0x4b3ee1['os'][_0xb3f0('0xa5')]),'osVersion':_0x4b3ee1['os']['version'],'deviceModel':_0x4b3ee1['device'][_0xb3f0('0x39')]&&_0x4b3ee1['device']['vendor']?util[_0xb3f0('0xa3')](_0xb3f0('0xa7'),_0x4b3ee1[_0xb3f0('0xa8')][_0xb3f0('0x39')],_0x4b3ee1[_0xb3f0('0xa8')]['vendor'],_0x4b3ee1[_0xb3f0('0xa8')][_0xb3f0('0x34')]):null,'deviceVendor':_0x4b3ee1[_0xb3f0('0xa8')][_0xb3f0('0xa9')],'deviceType':_0x4b3ee1['device'][_0xb3f0('0x34')],'formData':JSON[_0xb3f0('0xaa')](_0x5a1c66[_0xb3f0('0x4f')])};var _0x5d64db={'ChatWebsiteId':_0x5a1c66[_0xb3f0('0x57')]['id'],'closed':![]};if(_0x5a1c66[_0xb3f0('0x4f')][_0xb3f0('0xab')]){_0x5d64db['threadId']=_0x5a1c66[_0xb3f0('0x4f')][_0xb3f0('0xab')];return db[_0xb3f0('0xac')][_0xb3f0('0x4d')]({'where':_0x5d64db})['then'](function(_0x99b86f){if(_0x99b86f){return[_0x99b86f,![]];}_0x44deb8['threadId']=_0x5a1c66['body'][_0xb3f0('0xab')];_0x44deb8[_0xb3f0('0xad')]=_0x5a1c66[_0xb3f0('0x4f')][_0xb3f0('0xad')];return db[_0xb3f0('0xac')]['create'](_0x44deb8)['then'](function(_0x4e99b7){return[_0x4e99b7,!![]];});});}_0x5d64db[_0xb3f0('0xae')]=_0x5a487e['id'];if(_0x5a1c66[_0xb3f0('0x4f')][_0xb3f0('0xaf')]&&_0x5a1c66['body']['interaction']['id']){_0x5d64db['id']=_0x5a1c66['body']['interaction']['id'];return db[_0xb3f0('0xac')][_0xb3f0('0x4d')]({'where':_0x5d64db})[_0xb3f0('0x13')](function(_0x52b941){if(_0x52b941){return[_0x52b941,![]];}return db[_0xb3f0('0xac')]['create'](_0x44deb8)[_0xb3f0('0x13')](function(_0xb3e5bb){return[_0xb3e5bb,!![]];});});}return db[_0xb3f0('0xac')][_0xb3f0('0x4e')](_0x44deb8)[_0xb3f0('0x13')](function(_0xbd433d){return[_0xbd433d,!![]];});}})[_0xb3f0('0xb0')](function(_0x2f8407,_0x5cda95){if(_0x2f8407){_0x3a2805=_0x5cda95;if(!_0x5cda95){var _0x5dedcf={'from':(_0x221f5f['contact'][_0xb3f0('0x9e')]||'')+'\x20'+(_0x221f5f[_0xb3f0('0x99')][_0xb3f0('0x9f')]||'')};if(_0x5a1c66[_0xb3f0('0x4f')][_0xb3f0('0xab')]&&_0x5a1c66[_0xb3f0('0x4f')][_0xb3f0('0xb1')]&&_0x5a1c66[_0xb3f0('0x4f')][_0xb3f0('0xab')]!=_0x5a1c66[_0xb3f0('0x4f')][_0xb3f0('0xb1')]){_0x5dedcf[_0xb3f0('0xab')]=_0x5a1c66[_0xb3f0('0x4f')][_0xb3f0('0xb1')];}return _0x2f8407[_0xb3f0('0x56')](_0x5dedcf);}else{return _0x2f8407;}}})[_0xb3f0('0x13')](function(_0xb93c2e){_0x221f5f[_0xb3f0('0xaf')]=_0xb93c2e[_0xb3f0('0x28')]({'plain':!![]});_0x221f5f[_0xb3f0('0xaf')][_0xb3f0('0xb2')]=_0x3a2805;if(_0x221f5f[_0xb3f0('0xaf')][_0xb3f0('0xb2')]){if(_0x221f5f[_0xb3f0('0x97')]['autoclose']){_0x221f5f['applications']['push']({'id':0x0,'priority':_0x221f5f[_0xb3f0('0x94')][_0xb3f0('0x3c')]+0x1,'app':_0xb3f0('0xb3'),'appdata':_0xb3f0('0xb4'),'interval':'*,*,*,*'});}}return db[_0xb3f0('0xb5')][_0xb3f0('0x4e')]({'body':_0x5a1c66['body'][_0xb3f0('0x4f')],'ChatWebsiteId':_0x5a1c66[_0xb3f0('0x57')]['id'],'ChatInteractionId':_0xb93c2e['id'],'direction':'in','ContactId':_0x221f5f[_0xb3f0('0x99')]['id'],'AttachmentId':_0x5a1c66['body']['AttachmentId']});})['then'](function(_0x2f9a0d){_0x221f5f[_0xb3f0('0x1b')]=_0x2f9a0d;if(_0x221f5f[_0xb3f0('0xaf')][_0xb3f0('0xb6')]){return db[_0xb3f0('0xb7')][_0xb3f0('0x4d')]({'attributes':['id',_0xb3f0('0x2c')],'where':{'id':_0x221f5f[_0xb3f0('0xaf')][_0xb3f0('0xb6')]}})[_0xb3f0('0x13')](function(_0x59bb69){if(_0x59bb69){_0x221f5f[_0xb3f0('0x94')][_0xb3f0('0xb8')]({'id':0x0,'priority':0x0,'app':_0xb3f0('0xb9'),'appdata':_0x59bb69[_0xb3f0('0x2c')]+','+(_0x221f5f[_0xb3f0('0x97')]['waitForTheAssignedAgent']||0xa),'interval':_0xb3f0('0xba')});_0x221f5f[_0xb3f0('0xbb')]=!![];}return respondWithRpcPromise('Start',_0xb3f0('0xbc'),_0x221f5f);});}return respondWithRpcPromise('Start',_0xb3f0('0xbc'),_0x221f5f);})['then'](function(_0x783ba0){respondWithRpcPromise(_0xb3f0('0xbd'),_0xb3f0('0xbd'),{'event':_0xb3f0('0xbe'),'message':_0x783ba0},client9002);return _0x783ba0;})[_0xb3f0('0x13')](respondWithResult(_0x23efdd,null))[_0xb3f0('0x1d')](handleError(_0x23efdd,null));};exports[_0xb3f0('0xbf')]=function(_0x2a52ba,_0x3e3021){var _0x49e913,_0x465f15,_0x38b5d9;var _0x1c2ba7=[];var _0x4a3828={};var _0x48ba32=_0x2a52ba['files']||[];var _0xddec5e=[];var _0x2ad981;return db[_0xb3f0('0x80')]['describe']()['then'](function(_0x33228c){if(!_0x33228c){throw new db[(_0xb3f0('0x88'))][(_0xb3f0('0x89'))](_0xb3f0('0x81'));}_0x1c2ba7=_[_0xb3f0('0x82')](_['keys'](_0x33228c),['createdAt',_0xb3f0('0x84'),'CompanyId',_0xb3f0('0x86')]);if(_0x2a52ba['body']['id']){delete _0x2a52ba['body']['id'];}if(_[_0xb3f0('0x6e')](_0x2a52ba[_0xb3f0('0x4f')][_0xb3f0('0x87')])){throw _0x3e3021[_0xb3f0('0x1f')](0x1f4)[_0xb3f0('0x2d')](new db['Sequelize'][(_0xb3f0('0x89'))]('from\x20is\x20mandatory'));}if(_[_0xb3f0('0x6e')](_0x2a52ba[_0xb3f0('0x4f')][_0xb3f0('0x4f')])||_0x2a52ba['body']['body']===''){throw _0x3e3021[_0xb3f0('0x1f')](0x1f4)[_0xb3f0('0x2d')](new db[(_0xb3f0('0x88'))]['ValidationError'](_0xb3f0('0xc0')));}if(_[_0xb3f0('0x6e')](_0x2a52ba[_0xb3f0('0x4f')]['mapKeyOffline'])){throw _0x3e3021['status'](0x1f4)[_0xb3f0('0x2d')](new db[(_0xb3f0('0x88'))]['ValidationError'](_0xb3f0('0xc1')+_0x1c2ba7));}if(!_[_0xb3f0('0x8d')](_0x1c2ba7,_0x2a52ba[_0xb3f0('0x4f')]['mapKeyOffline'])){throw _0x3e3021['status'](0x1f4)[_0xb3f0('0x2d')](new db[(_0xb3f0('0x88'))][(_0xb3f0('0x89'))](_0xb3f0('0xc2')+_0x1c2ba7));}_0x4a3828[_0x2a52ba[_0xb3f0('0x4f')][_0xb3f0('0xc3')]]=_0x2a52ba['body'][_0xb3f0('0x87')];})['then'](function(){return db[_0xb3f0('0x31')][_0xb3f0('0x4d')]({'where':{'id':_0x2a52ba[_0xb3f0('0x57')]['id']},'include':[{'model':db['CmList'],'as':_0xb3f0('0x90')},{'model':db[_0xb3f0('0xc4')],'as':_0xb3f0('0xc4')}]});})[_0xb3f0('0x13')](handleEntityNotFound(_0x3e3021,null))['then'](function(_0x170cc5){if(_0x170cc5&&_0x170cc5[_0xb3f0('0x90')]){_0x465f15=_0x170cc5;var _0x40e2fa=_[_0xb3f0('0xb')](_0x2a52ba[_0xb3f0('0x4f')],{'firstName':_0x2a52ba['body'][_0xb3f0('0x87')],'phone':_0x2a52ba[_0xb3f0('0x4f')][_0xb3f0('0x87')],'ListId':_0x170cc5['ListId']});_0x40e2fa[_0x2a52ba[_0xb3f0('0x4f')][_0xb3f0('0xc3')]]=_0x2a52ba[_0xb3f0('0x4f')]['from'];return db['CmContact']['findOrCreate']({'where':_0x4a3828,'defaults':_0x40e2fa});}})[_0xb3f0('0xb0')](function(_0xadd3cc){if(_0xadd3cc){_0x38b5d9=_0xadd3cc;var _0x2ce352=fs[_0xb3f0('0xc5')](path['join'](config[_0xb3f0('0x72')],_0xb3f0('0xc6')),_0xb3f0('0xc7'));var _0x217651=ejs[_0xb3f0('0xc8')](_0x2ce352,{'body':_['toPairs'](_0x2a52ba[_0xb3f0('0x4f')][_0xb3f0('0x4f')]),'bodyTitle':_0x465f15['offlineMessageBody']});return db[_0xb3f0('0xc9')]['create']({'body':_0x217651,'plainBody':htmlToText['fromString'](_0x217651),'ContactId':_0xadd3cc['id'],'ChatWebsiteId':_0x465f15['id']});}})[_0xb3f0('0x13')](function(_0x172ef0){_0x2ad981=_0x172ef0;if(_0x48ba32[_0xb3f0('0x3c')]){var _0x3f5504=_0x48ba32['map'](function(_0x35a6cb){return{'name':_0x35a6cb[_0xb3f0('0xca')],'basename':_0x35a6cb[_0xb3f0('0x67')],'type':_0x35a6cb[_0xb3f0('0xcb')],'ChatOfflineMessageId':_0x172ef0['id']};});_0xddec5e=_0x3f5504['map'](_0x21b6fa=>{var _0x56357a={'filename':_0x21b6fa[_0xb3f0('0x2c')],'path':path[_0xb3f0('0x70')](config[_0xb3f0('0x72')],_0xb3f0('0xcc'),_0xb3f0('0xcd'),_0xb3f0('0xce'),_0xb3f0('0xcf'),_0x21b6fa['basename'])};return _0x56357a;});if(!_0x465f15[_0xb3f0('0xd0')]){return db[_0xb3f0('0xd1')][_0xb3f0('0xd2')](function(_0x5e884d){return db[_0xb3f0('0xd3')][_0xb3f0('0xd4')](_0x3f5504,{'transaction':_0x5e884d});});}}})[_0xb3f0('0x13')](function(){if(_0x2ad981){_0x49e913=_0x2ad981;return db[_0xb3f0('0xc4')]['findOne']({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xb3f0('0xd5'),'raw':!![],'include':[{'model':db[_0xb3f0('0xd6')],'as':_0xb3f0('0xd6'),'raw':!![]}]}]});}})['then'](function(_0x58e593){if(_0x58e593&&_0x58e593[_0xb3f0('0xd5')]&&_0x465f15['forwardOffline']&&_0x465f15[_0xb3f0('0xd7')]){var _0x5f266d=_0x58e593[_0xb3f0('0xd8')]();return respondWithRpcPromise(_0xb3f0('0xd9'),'sendMail',{'account':_0x5f266d,'message':{'from':util[_0xb3f0('0xa3')](_0xb3f0('0xda'),_0x58e593[_0xb3f0('0x2c')],_0x58e593[_0xb3f0('0xdb')]||_0x58e593[_0xb3f0('0xd5')][_0xb3f0('0x50')]),'to':_0x465f15[_0xb3f0('0xd7')],'subject':_0x465f15[_0xb3f0('0xdc')],'html':_0x49e913['body'],'attachments':_0xddec5e}},client9003)[_0xb3f0('0x13')](function(){return _0x49e913;})['catch'](function(_0x2748ca){logger[_0xb3f0('0x18')](_0x2748ca);});}})[_0xb3f0('0x13')](function(){if(_0x465f15&&_0x465f15[_0xb3f0('0xd0')]&&_0x465f15['MailAccountId']){var _0x252dbd=[];if(_0x48ba32['length']){_0x252dbd=_0x48ba32[_0xb3f0('0x44')](function(_0x3da7d5){return{'name':_0x3da7d5[_0xb3f0('0xca')],'basename':_0x3da7d5[_0xb3f0('0x67')],'type':_0x3da7d5['mimetype'],'ChatOfflineMessageId':_0x2ad981['id']};});}var _0x653f99;if(!_[_0xb3f0('0x6e')](_0x465f15[_0xb3f0('0xdd')])){var _0x39db37=_['map'](_0x2a52ba['body'],function(_0x573e74){return _0x573e74;});var _0x1c6010=_[_0xb3f0('0xde')](_0x39db37)[0x0];var _0x4c6c6e=_[_0xb3f0('0xdf')](_0x1c6010,function(_0x5ecae3){return _0x5ecae3;});_0x653f99=_0x4c6c6e[0x1][_0x465f15[_0xb3f0('0xdd')]];}var _0x11d84f={'from':_0x38b5d9[_0xb3f0('0xdb')],'firstName':_0x38b5d9[_0xb3f0('0x9e')],'lastName':_0x38b5d9[_0xb3f0('0x9f')],'mapKey':_0xb3f0('0xdb'),'message':{'from':_0x38b5d9['email'],'to':_0x465f15[_0xb3f0('0xc4')][_0xb3f0('0xdb')],'cc':'','subject':_['isNil'](_0x653f99)?_0x465f15['offlineMessageSubject']:_0x653f99,'messageId':'','sentAt':new Date(),'attach':_0x252dbd[_0xb3f0('0x3c')],'attachments':_0x252dbd,'originChannel':_0xb3f0('0xe0'),'ChatWebsiteId':_0x465f15['id'],'ChatOfflineMessageId':_0x49e913['id'],'originTo':_0x465f15['MailAccount'][_0xb3f0('0xdb')]},'body':_0x49e913[_0xb3f0('0x4f')]};var _0x153197={'account':{'id':_0x465f15[_0xb3f0('0xe1')]},'body':_0x11d84f,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0xb3f0('0xe2'),_0x153197,client9001)['then'](function(){return _0x49e913;})[_0xb3f0('0x1d')](function(_0x4b16f2){logger[_0xb3f0('0x18')](_0x4b16f2);});}return;})[_0xb3f0('0x13')](function(){if(_0x49e913){return _0x49e913;}})[_0xb3f0('0x13')](respondWithResult(_0x3e3021,null))[_0xb3f0('0x1d')](function(_0x17c921){logger[_0xb3f0('0x18')](_0xb3f0('0x1d'),_0x17c921);for(var _0x4ce163 of _0x48ba32){var _0x224566=path[_0xb3f0('0x70')](config[_0xb3f0('0x72')],_0xb3f0('0xcc'),_0xb3f0('0xcd'),_0xb3f0('0xce'),_0xb3f0('0xcf'),_0x4ce163['filename']);fs_extra[_0xb3f0('0xe3')](_0x224566)[_0xb3f0('0x1d')](function(_0x5c44d5){logger[_0xb3f0('0x18')](_0xb3f0('0xe4'),_0x224566,_0x5c44d5);});}});};exports['addInteraction']=function(_0x3e61f8,_0x2770d5){return db[_0xb3f0('0xac')][_0xb3f0('0x4d')]({'where':{'id':_0x3e61f8[_0xb3f0('0x57')]['id']}})['then'](handleEntityNotFound(_0x2770d5,null))[_0xb3f0('0x13')](function(_0xe413cb){if(_0xe413cb){return _0xe413cb[_0xb3f0('0xe5')](_0x3e61f8['body'][_0xb3f0('0x60')],_['omit'](_0x3e61f8[_0xb3f0('0x4f')],[_0xb3f0('0x60'),'id'])||{});}})['then'](respondWithResult(_0x2770d5,null))[_0xb3f0('0x1d')](handleError(_0x2770d5,null));};exports['getInteractions']=function(_0x4c13bd,_0x1db8d3){var _0x51ae42={'raw':![],'where':{}};var _0x48df58={};var _0x8394cd={'count':0x0,'rows':[]};return db[_0xb3f0('0x31')]['findOne']({'where':{'id':_0x4c13bd[_0xb3f0('0x57')]['id']}})[_0xb3f0('0x13')](handleEntityNotFound(_0x1db8d3,null))[_0xb3f0('0x13')](function(_0x2cac1c){if(_0x2cac1c){_0x48df58[_0xb3f0('0x39')]=_['keys'](db[_0xb3f0('0xac')][_0xb3f0('0x32')]);_0x48df58[_0xb3f0('0x35')]=_[_0xb3f0('0x36')](_0x4c13bd[_0xb3f0('0x35')]);_0x48df58['filters']=_['intersection'](_0x48df58[_0xb3f0('0x39')],_0x48df58['query']);_0x51ae42[_0xb3f0('0x3a')]=_['intersection'](_0x48df58['model'],qs[_0xb3f0('0x3b')](_0x4c13bd[_0xb3f0('0x35')][_0xb3f0('0x3b')]));_0x51ae42[_0xb3f0('0x3a')]=_0x51ae42[_0xb3f0('0x3a')]['length']?_0x51ae42['attributes']:_0x48df58[_0xb3f0('0x39')];if(!_0x4c13bd['query'][_0xb3f0('0x3d')]('nolimit')){_0x51ae42['limit']=qs['limit'](_0x4c13bd[_0xb3f0('0x35')]['limit']);_0x51ae42[_0xb3f0('0x24')]=qs[_0xb3f0('0x24')](_0x4c13bd['query'][_0xb3f0('0x24')]);}_0x51ae42['order']=qs[_0xb3f0('0x3f')](_0x4c13bd[_0xb3f0('0x35')][_0xb3f0('0x3f')]);_0x51ae42[_0xb3f0('0x42')]=qs[_0xb3f0('0x37')](_[_0xb3f0('0x40')](_0x4c13bd[_0xb3f0('0x35')],_0x48df58['filters']));_0x51ae42[_0xb3f0('0x42')][_0xb3f0('0x5a')]=_0x2cac1c['id'];if(_0x4c13bd[_0xb3f0('0x35')][_0xb3f0('0x41')]){_0x51ae42['where']=_[_0xb3f0('0x43')](_0x51ae42[_0xb3f0('0x42')],{'$or':_[_0xb3f0('0x44')](_0x51ae42[_0xb3f0('0x3a')],function(_0x96998c){var _0x3862cd={};_0x3862cd[_0x96998c]={'$like':'%'+_0x4c13bd[_0xb3f0('0x35')]['filter']+'%'};return _0x3862cd;})});}_0x51ae42=_[_0xb3f0('0x43')]({},_0x51ae42,_0x4c13bd[_0xb3f0('0x46')]);return db[_0xb3f0('0xac')][_0xb3f0('0x47')]({'where':_0x51ae42[_0xb3f0('0x42')]})[_0xb3f0('0x13')](function(_0x453e1c){_0x8394cd[_0xb3f0('0x47')]=_0x453e1c;if(_0x4c13bd[_0xb3f0('0x35')][_0xb3f0('0x48')]){_0x51ae42[_0xb3f0('0x49')]=[{'model':db[_0xb3f0('0x80')],'as':'Contact','required':![]},{'model':db[_0xb3f0('0xb7')],'as':_0xb3f0('0xe6'),'attributes':[_0xb3f0('0x2c'),_0xb3f0('0xe7'),_0xb3f0('0xe8')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0xb3f0('0x2c'),_0xb3f0('0xe9')],'where':_0x4c13bd[_0xb3f0('0x35')][_0xb3f0('0xea')]?{'id':_0x4c13bd[_0xb3f0('0x35')][_0xb3f0('0xea')]}:undefined,'required':_0x4c13bd[_0xb3f0('0x35')]['tag']?!![]:![]}];}return db[_0xb3f0('0xac')]['findAll'](_0x51ae42);})[_0xb3f0('0x13')](function(_0x455779){_0x8394cd[_0xb3f0('0x4b')]=_0x455779;return _0x8394cd;});}})[_0xb3f0('0x13')](respondWithFilteredResult(_0x1db8d3,_0x51ae42))[_0xb3f0('0x1d')](handleError(_0x1db8d3,null));};function iftimePromise(_0x16cbe7,_0x32c6e1){return respondWithRpcPromise('Command',_0xb3f0('0xeb'),{'command':_0x32c6e1[_0xb3f0('0xec')]?util[_0xb3f0('0xa3')](_0xb3f0('0xed'),_0x16cbe7[_0xb3f0('0xee')],_0x32c6e1['timezone']):util[_0xb3f0('0xa3')](_0xb3f0('0xef'),_0x16cbe7[_0xb3f0('0xee')])},client9002)[_0xb3f0('0x13')](function(_0x349dff){var _0x6f32bf=_0x349dff&&_0x349dff['indexOf'](_0xb3f0('0xf0'))>=0x0?!![]:![];logger[_0xb3f0('0x14')](_0xb3f0('0xf1'),_0x32c6e1['id'],_0x16cbe7['id'],_0x16cbe7[_0xb3f0('0xee')],_0x6f32bf?_0xb3f0('0xf2'):_0xb3f0('0xf3'),_0x32c6e1[_0xb3f0('0xec')]?_0x32c6e1[_0xb3f0('0xec')]:_0xb3f0('0xf4'));return _0x6f32bf;})[_0xb3f0('0x1d')](function(_0xfadeef){logger[_0xb3f0('0x18')](_0xb3f0('0xf1'),_0x32c6e1['id'],_0x16cbe7['id'],_0x16cbe7['interval'],util[_0xb3f0('0xf5')](_0xfadeef,{'showHidden':![],'depth':null}),_0x32c6e1['timezone']?_0x32c6e1[_0xb3f0('0xec')]:_0xb3f0('0xf4'));return![];});}exports[_0xb3f0('0xeb')]=function(_0x2393d5,_0x140993){var _0x57495b=0x0;var _0x4c90e7=0x0;var _0x2425ee=![];var _0x595163;var _0x5d953e;return db['ChatWebsite'][_0xb3f0('0x4d')]({'where':{'id':_0x2393d5[_0xb3f0('0x57')]['id']},'include':[{'model':db[_0xb3f0('0xf6')],'as':_0xb3f0('0xf6'),'include':[{'model':db[_0xb3f0('0xf6')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0xb3f0('0x13')](handleEntityNotFound(_0x140993,null))['then'](function(_0x3048bf){if(_0x3048bf){_0x595163=_0x3048bf;return _0x3048bf[_0xb3f0('0xf7')]({'raw':!![]});}})['then'](function(_0x2d4336){if(_0x595163){if(_0x2d4336){_0x5d953e=_0x2d4336;}}return require(_0xb3f0('0x6b'))[_0xb3f0('0x6c')]();})['then'](function(_0x1dbdf4){if(_0x1dbdf4){_0x4c90e7=_0x1dbdf4[_0xb3f0('0xf8')];_0x2425ee=_0x1dbdf4['custom'];}})[_0xb3f0('0x13')](function(){return db[_0xb3f0('0xac')]['count']({'where':{'closed':![]}});})[_0xb3f0('0x13')](function(_0x3c252d){_0x57495b=_0x3c252d;if(_0x4c90e7&&_0x3c252d>_0x4c90e7){return db[_0xb3f0('0xf9')][_0xb3f0('0x5d')]({'where':{'id':0x1}})[_0xb3f0('0x13')](function(_0x126622){if(_0x126622){_0x126622[_0xb3f0('0xfa')](_0xb3f0('0xfb'));}});}})[_0xb3f0('0x13')](function(){if(_0x595163[_0xb3f0('0xf6')]&&_0x595163[_0xb3f0('0xf6')][_0xb3f0('0xfc')]){var _0x58dc9f=[];for(var _0x239c49=0x0;_0x239c49<_0x595163[_0xb3f0('0xf6')][_0xb3f0('0xfc')][_0xb3f0('0x3c')];_0x239c49++){var _0x28b3d1=_0x595163[_0xb3f0('0xf6')]['Intervals'][_0x239c49][_0xb3f0('0x28')]({'plain':!![]});_0x58dc9f[_0xb3f0('0xfd')](iftimePromise(_0x28b3d1,_0x595163));}return BPromise['all'](_0x58dc9f)[_0xb3f0('0x13')](function(_0x11eb67){return _[_0xb3f0('0xfe')](_0x11eb67);});}else{return!![];}})['then'](function(_0x16cff3){var _0x180611=fs[_0xb3f0('0xc5')](path[_0xb3f0('0x70')](config[_0xb3f0('0x72')],_0xb3f0('0xff')),_0xb3f0('0xc7'));var _0x53e6db=new url[(_0xb3f0('0x100'))](_0x595163[_0xb3f0('0x101')])['origin'];var _0x3d9d5d=_0xb3f0('0x102');var _0xe04bd6=![];var _0x12d02d={'chatVersion':_0x3d9d5d,'chatWebsiteAddressOrigin':_0x53e6db,'remote':_0x595163[_0xb3f0('0x103')],'query':querystring[_0xb3f0('0xaa')](_[_0xb3f0('0x43')](_0x595163[_0xb3f0('0x28')]({'plain':!![]}),{'customerIp':_0x2393d5['headers'][_0xb3f0('0x9c')]||_0x2393d5[_0xb3f0('0x7c')][_0xb3f0('0x104')]||_0x2393d5[_0xb3f0('0x105')]['remoteAddress']||_0x2393d5['ip'],'referer':_0x2393d5[_0xb3f0('0x7c')][_0xb3f0('0xa1')],'openedInteractions':_0x57495b,'maxInteractions':_0x4c90e7,'virtual':_0x2425ee[_0xb3f0('0xf8')],'online':_0x16cff3,'custom':_0x2425ee}))[_0xb3f0('0x106')](/'/g,'\x5c\x27')};_0x140993[_0xb3f0('0x2d')](ejs[_0xb3f0('0xc8')](Mustache[_0xb3f0('0xc8')](_0x180611,_0x12d02d),{'proactiveActions':_0x5d953e,'alignment':_0x595163['alignment'],'verticalAlignment':_0x595163['verticalAlignment'],'div_color':_0x595163[_0xb3f0('0xe9')],'labelText':_0x595163[_0xb3f0('0x107')],'text_color':_0x595163[_0xb3f0('0x108')],'text_button_color':_0x595163[_0xb3f0('0x109')],'button_color':_0x595163[_0xb3f0('0x10a')],'background_color':_0x595163['backgroundColor'],'hideWhenOffline':_0x595163[_0xb3f0('0x10b')],'intervalId':_0x595163[_0xb3f0('0x10c')],'isDevelopment':_0xe04bd6,'chatVersion':_0x3d9d5d}));})['catch'](handleError(_0x140993,null));};exports['addApplications']=function(_0x345700,_0x506a67){var _0x7746c9=_0x345700[_0xb3f0('0x57')]['id'];var _0x200d23=_0x345700[_0xb3f0('0x4f')];var _0x511263=0xc8;var _0x12a6f1=null;return db[_0xb3f0('0xd1')][_0xb3f0('0xd2')]({'isolationLevel':db[_0xb3f0('0xd1')][_0xb3f0('0x10d')][_0xb3f0('0x10e')][_0xb3f0('0x10f')]},function(_0x16036d){return db[_0xb3f0('0x31')][_0xb3f0('0x5d')]({'where':{'id':_0x7746c9},'transaction':_0x16036d})['then'](function(_0x456ade){if(_0x456ade){return db[_0xb3f0('0x92')]['destroy']({'where':{'ChatWebsiteId':_0x7746c9},'transaction':_0x16036d})['then'](function(){var _0x2a81e4=_[_0xb3f0('0x44')](_0x200d23,function(_0x345a27){_0x345a27['ChatWebsiteId']=_0x7746c9;return _0x345a27;});return db[_0xb3f0('0x92')][_0xb3f0('0xd4')](_0x2a81e4,{'transaction':_0x16036d});});}else{_0x511263=0x194;_0x12a6f1=[];}});})[_0xb3f0('0x13')](function(){if(_0x511263!==0x194){return db[_0xb3f0('0x92')][_0xb3f0('0x110')]({'where':{'ChatWebsiteId':_0x7746c9},'order':_0xb3f0('0x111')})[_0xb3f0('0x13')](function(_0x514fc4){_0x12a6f1=_0x514fc4;});}})['catch'](function(_0x2e1ac5){_0x511263=0x1f4;logger['error'](_0x2e1ac5[_0xb3f0('0x2b')]);if(_0x2e1ac5[_0xb3f0('0x2c')]){delete _0x2e1ac5['name'];}_0x12a6f1=_0x2e1ac5;})[_0xb3f0('0x112')](function(){if(_0x12a6f1===null){_0x506a67[_0xb3f0('0x1e')](_0x511263);}else{if(_0x511263===0x1f4){_0x506a67[_0xb3f0('0x1f')](_0x511263)['send'](_0x12a6f1);}else{_0x506a67['status'](_0x511263)[_0xb3f0('0x21')](_0x12a6f1);}}});};exports[_0xb3f0('0x113')]=function(_0x54e7df,_0x289d3b){var _0x17b7af={};var _0x57a441={};var _0x433a9f;var _0x5d67b1;return db[_0xb3f0('0x31')]['findOne']({'where':{'id':_0x54e7df[_0xb3f0('0x57')]['id']}})[_0xb3f0('0x13')](handleEntityNotFound(_0x289d3b,null))['then'](function(_0x4eff45){if(_0x4eff45){_0x433a9f=_0x4eff45;_0x57a441[_0xb3f0('0x39')]=_['keys'](db[_0xb3f0('0x92')][_0xb3f0('0x32')]);_0x57a441[_0xb3f0('0x35')]=_[_0xb3f0('0x36')](_0x54e7df[_0xb3f0('0x35')]);_0x57a441[_0xb3f0('0x37')]=_[_0xb3f0('0x38')](_0x57a441[_0xb3f0('0x39')],_0x57a441[_0xb3f0('0x35')]);_0x17b7af[_0xb3f0('0x3a')]=_[_0xb3f0('0x38')](_0x57a441[_0xb3f0('0x39')],qs['fields'](_0x54e7df[_0xb3f0('0x35')]['fields']));_0x17b7af[_0xb3f0('0x3a')]=_0x17b7af[_0xb3f0('0x3a')][_0xb3f0('0x3c')]?_0x17b7af[_0xb3f0('0x3a')]:_0x57a441['model'];_0x17b7af[_0xb3f0('0x5e')]=qs[_0xb3f0('0x3f')](_0x54e7df[_0xb3f0('0x35')][_0xb3f0('0x3f')]);_0x17b7af[_0xb3f0('0x42')]=qs[_0xb3f0('0x37')](_[_0xb3f0('0x40')](_0x54e7df['query'],_0x57a441[_0xb3f0('0x37')]));if(_0x54e7df[_0xb3f0('0x35')][_0xb3f0('0x41')]){_0x17b7af[_0xb3f0('0x42')]=_[_0xb3f0('0x43')](_0x17b7af[_0xb3f0('0x42')],{'$or':_[_0xb3f0('0x44')](_0x17b7af[_0xb3f0('0x3a')],function(_0x4ebc10){var _0x304bcf={};_0x304bcf[_0x4ebc10]={'$like':'%'+_0x54e7df[_0xb3f0('0x35')][_0xb3f0('0x41')]+'%'};return _0x304bcf;})});}_0x17b7af=_[_0xb3f0('0x43')]({},_0x17b7af,_0x54e7df[_0xb3f0('0x46')]);return _0x433a9f[_0xb3f0('0x113')](_0x17b7af);}})[_0xb3f0('0x13')](function(_0x2b8629){if(_0x2b8629){_0x5d67b1=_0x2b8629[_0xb3f0('0x3c')];if(!_0x54e7df[_0xb3f0('0x35')][_0xb3f0('0x3d')](_0xb3f0('0x3e'))){_0x17b7af[_0xb3f0('0x23')]=qs['limit'](_0x54e7df[_0xb3f0('0x35')][_0xb3f0('0x23')]);_0x17b7af[_0xb3f0('0x24')]=qs[_0xb3f0('0x24')](_0x54e7df[_0xb3f0('0x35')][_0xb3f0('0x24')]);}return _0x433a9f[_0xb3f0('0x113')](_0x17b7af);}})['then'](function(_0x5b7dfc){if(_0x5b7dfc){return _0x5b7dfc?{'count':_0x5d67b1,'rows':_0x5b7dfc}:null;}})[_0xb3f0('0x13')](respondWithResult(_0x289d3b,null))[_0xb3f0('0x1d')](handleError(_0x289d3b,null));};exports['addProactiveActions']=function(_0xa828d1,_0x33b2c6){return db['chatProactiveAction'][_0xb3f0('0x4d')]({'where':{'id':_0xa828d1['params']['id']}})[_0xb3f0('0x13')](handleEntityNotFound(_0x33b2c6,null))[_0xb3f0('0x13')](function(_0x1ce5e3){if(_0x1ce5e3){return _0x1ce5e3['addProactiveActions'](_0xa828d1[_0xb3f0('0x4f')][_0xb3f0('0x60')],_[_0xb3f0('0x114')](_0xa828d1[_0xb3f0('0x4f')],['ids','id'])||{});}})['then'](respondWithResult(_0x33b2c6,null))['catch'](handleError(_0x33b2c6,null));};exports[_0xb3f0('0xf7')]=function(_0x5b43d2,_0x11c4a7){var _0x586aef={};var _0x5daef9={};var _0x3b0bae;var _0x4ed00f;return db[_0xb3f0('0x31')][_0xb3f0('0x5d')]({'where':{'id':_0x5b43d2[_0xb3f0('0x57')]['id']}})[_0xb3f0('0x13')](handleEntityNotFound(_0x11c4a7,null))['then'](function(_0xb74082){if(_0xb74082){_0x3b0bae=_0xb74082;_0x5daef9['model']=_[_0xb3f0('0x36')](db[_0xb3f0('0x115')]['rawAttributes']);_0x5daef9[_0xb3f0('0x35')]=_[_0xb3f0('0x36')](_0x5b43d2[_0xb3f0('0x35')]);_0x5daef9[_0xb3f0('0x37')]=_['intersection'](_0x5daef9[_0xb3f0('0x39')],_0x5daef9[_0xb3f0('0x35')]);_0x586aef['attributes']=_[_0xb3f0('0x38')](_0x5daef9['model'],qs[_0xb3f0('0x3b')](_0x5b43d2[_0xb3f0('0x35')][_0xb3f0('0x3b')]));_0x586aef[_0xb3f0('0x3a')]=_0x586aef[_0xb3f0('0x3a')][_0xb3f0('0x3c')]?_0x586aef[_0xb3f0('0x3a')]:_0x5daef9[_0xb3f0('0x39')];_0x586aef['order']=qs[_0xb3f0('0x3f')](_0x5b43d2[_0xb3f0('0x35')][_0xb3f0('0x3f')]);_0x586aef[_0xb3f0('0x42')]=qs[_0xb3f0('0x37')](_[_0xb3f0('0x40')](_0x5b43d2[_0xb3f0('0x35')],_0x5daef9['filters']));if(_0x5b43d2['query'][_0xb3f0('0x41')]){_0x586aef['where']=_['merge'](_0x586aef['where'],{'$or':_['map'](_0x586aef['attributes'],function(_0x22fc46){var _0x2fbf01={};_0x2fbf01[_0x22fc46]={'$like':'%'+_0x5b43d2['query'][_0xb3f0('0x41')]+'%'};return _0x2fbf01;})});}_0x586aef=_[_0xb3f0('0x43')]({},_0x586aef,_0x5b43d2[_0xb3f0('0x46')]);return _0x3b0bae[_0xb3f0('0xf7')](_0x586aef);}})[_0xb3f0('0x13')](function(_0x19a6b1){if(_0x19a6b1){_0x4ed00f=_0x19a6b1['length'];if(!_0x5b43d2[_0xb3f0('0x35')][_0xb3f0('0x3d')](_0xb3f0('0x3e'))){_0x586aef[_0xb3f0('0x23')]=qs['limit'](_0x5b43d2[_0xb3f0('0x35')][_0xb3f0('0x23')]);_0x586aef['offset']=qs['offset'](_0x5b43d2[_0xb3f0('0x35')][_0xb3f0('0x24')]);}return _0x3b0bae[_0xb3f0('0xf7')](_0x586aef);}})[_0xb3f0('0x13')](function(_0x2e769c){if(_0x2e769c){return _0x2e769c?{'count':_0x4ed00f,'rows':_0x2e769c}:null;}})['then'](respondWithResult(_0x11c4a7,null))['catch'](handleError(_0x11c4a7,null));};exports[_0xb3f0('0x116')]=function(_0x39a53e,_0x7d8845){var _0x307952=_0x39a53e[_0xb3f0('0x35')][_0xb3f0('0x117')]==='false'?_0xb3f0('0x118'):_0xb3f0('0x119');return db[_0xb3f0('0x31')][_0xb3f0('0x4d')]({'attributes':['id',_0x307952],'where':{'id':_0x39a53e[_0xb3f0('0x57')]['id']}})[_0xb3f0('0x13')](handleEntityNotFound(_0x7d8845,null))[_0xb3f0('0x13')](function(_0x2dc103){if(_0x2dc103){var _0x1dbeff=_0x2dc103[_0x307952];var _0x4fb6a1=_0x1dbeff&&_0x1dbeff[_0xb3f0('0x11a')]?_0x1dbeff['items']:[];_0x7d8845['send']({'fromKey':_[_0xb3f0('0x6e')](_0x1dbeff[_0xb3f0('0x11b')])?undefined:_0x1dbeff[_0xb3f0('0x11b')],'count':_0x4fb6a1[_0xb3f0('0x3c')],'rows':_0x4fb6a1});}})['catch'](handleError(_0x7d8845,null));};exports[_0xb3f0('0x11c')]=function(_0x454956,_0xdeb8b3){var _0x246d7f={'raw':![],'where':{}};var _0xe1a53b={};var _0x4e1f19={'count':0x0,'rows':[]};return db[_0xb3f0('0x31')][_0xb3f0('0x5d')]({'where':{'id':_0x454956[_0xb3f0('0x57')]['id']}})[_0xb3f0('0x13')](handleEntityNotFound(_0xdeb8b3,null))[_0xb3f0('0x13')](function(_0x3f80d8){if(_0x3f80d8){_0xe1a53b['model']=_[_0xb3f0('0x36')](db[_0xb3f0('0xc9')]['rawAttributes']);_0xe1a53b[_0xb3f0('0x35')]=_[_0xb3f0('0x36')](_0x454956[_0xb3f0('0x35')]);_0xe1a53b[_0xb3f0('0x37')]=_[_0xb3f0('0x38')](_0xe1a53b[_0xb3f0('0x39')],_0xe1a53b[_0xb3f0('0x35')]);_0x246d7f[_0xb3f0('0x3a')]=_[_0xb3f0('0x38')](_0xe1a53b[_0xb3f0('0x39')],qs[_0xb3f0('0x3b')](_0x454956['query'][_0xb3f0('0x3b')]));_0x246d7f[_0xb3f0('0x3a')]=_0x246d7f[_0xb3f0('0x3a')]['length']?_0x246d7f['attributes']:_0xe1a53b['model'];if(!_0x454956[_0xb3f0('0x35')][_0xb3f0('0x3d')](_0xb3f0('0x3e'))){_0x246d7f[_0xb3f0('0x23')]=qs['limit'](_0x454956[_0xb3f0('0x35')][_0xb3f0('0x23')]);_0x246d7f['offset']=qs[_0xb3f0('0x24')](_0x454956['query'][_0xb3f0('0x24')]);}_0x246d7f[_0xb3f0('0x5e')]=qs['sort'](_0x454956['query'][_0xb3f0('0x3f')]);_0x246d7f['where']=qs[_0xb3f0('0x37')](_['pick'](_0x454956[_0xb3f0('0x35')],_0xe1a53b['filters']));_0x246d7f[_0xb3f0('0x42')]['ChatWebsiteId']=_0x3f80d8['id'];if(_0x454956['query'][_0xb3f0('0x41')]){_0x246d7f[_0xb3f0('0x42')]=_[_0xb3f0('0x43')](_0x246d7f[_0xb3f0('0x42')],{'$or':_[_0xb3f0('0x44')](_0x246d7f[_0xb3f0('0x3a')],function(_0x491843){var _0x3f9962={};_0x3f9962[_0x491843]={'$like':'%'+_0x454956[_0xb3f0('0x35')][_0xb3f0('0x41')]+'%'};return _0x3f9962;})});}_0x246d7f=_['merge']({},_0x246d7f,_0x454956[_0xb3f0('0x46')]);return db['ChatOfflineMessage'][_0xb3f0('0x47')]({'where':_0x246d7f['where']})['then'](function(_0x5ba4e8){_0x4e1f19['count']=_0x5ba4e8;if(_0x454956[_0xb3f0('0x35')][_0xb3f0('0x48')]){_0x246d7f[_0xb3f0('0x49')]=[{'all':!![]}];}else{_0x246d7f['include']=[{'model':db[_0xb3f0('0x80')],'as':'Contact','required':![]},{'model':db[_0xb3f0('0xd3')],'as':_0xb3f0('0x11d'),'required':![]}];}return db[_0xb3f0('0xc9')]['findAll'](_0x246d7f);})[_0xb3f0('0x13')](function(_0xe11320){_0x4e1f19[_0xb3f0('0x4b')]=_0xe11320;return _0x4e1f19;});}})[_0xb3f0('0x13')](respondWithFilteredResult(_0xdeb8b3,_0x246d7f))[_0xb3f0('0x1d')](handleError(_0xdeb8b3,null));};exports[_0xb3f0('0x11e')]=function(_0x519389,_0x35479d){return db[_0xb3f0('0x31')]['find']({'where':{'id':_0x519389[_0xb3f0('0x57')]['id']}})[_0xb3f0('0x13')](handleEntityNotFound(_0x35479d,null))['then'](function(_0x50d640){if(_0x50d640){return _0x50d640[_0xb3f0('0x11e')](_0x519389[_0xb3f0('0x4f')]['ids'],_[_0xb3f0('0x114')](_0x519389[_0xb3f0('0x4f')],['ids','id'])||{})[_0xb3f0('0xb0')](function(_0x3f1f30){for(var _0x2c9b4f=0x0;_0x2c9b4f<_0x519389['body']['ids'][_0xb3f0('0x3c')];_0x2c9b4f+=0x1){socket[_0xb3f0('0x11f')](_0xb3f0('0x120'),{'UserId':Number(_0x519389[_0xb3f0('0x4f')]['ids'][_0x2c9b4f]),'ChatWebsiteId':Number(_0x519389[_0xb3f0('0x57')]['id'])});}return _0x3f1f30;});}})['then'](respondWithResult(_0x35479d,null))[_0xb3f0('0x1d')](handleError(_0x35479d,null));};exports[_0xb3f0('0x121')]=function(_0x3ce121,_0x3ea082){return db[_0xb3f0('0x31')][_0xb3f0('0x4d')]({'where':{'id':_0x3ce121[_0xb3f0('0x57')]['id']}})[_0xb3f0('0x13')](handleEntityNotFound(_0x3ea082,null))[_0xb3f0('0x13')](function(_0x237b91){if(_0x237b91){return _0x237b91['removeAgents'](_0x3ce121[_0xb3f0('0x35')][_0xb3f0('0x60')])[_0xb3f0('0x13')](function(){if(_[_0xb3f0('0x122')](_0x3ce121['query'][_0xb3f0('0x60')])){for(var _0x5579a4=0x0;_0x5579a4<_0x3ce121[_0xb3f0('0x35')][_0xb3f0('0x60')]['length'];_0x5579a4+=0x1){socket[_0xb3f0('0x11f')](_0xb3f0('0x123'),{'UserId':Number(_0x3ce121[_0xb3f0('0x35')]['ids'][_0x5579a4]),'ChatWebsiteId':Number(_0x3ce121[_0xb3f0('0x57')]['id'])});}}else{socket[_0xb3f0('0x11f')](_0xb3f0('0x123'),{'UserId':Number(_0x3ce121[_0xb3f0('0x35')][_0xb3f0('0x60')]),'ChatWebsiteId':Number(_0x3ce121[_0xb3f0('0x57')]['id'])});}});}})[_0xb3f0('0x13')](respondWithStatusCode(_0x3ea082,null))[_0xb3f0('0x1d')](handleError(_0x3ea082,null));};exports['getAgents']=function(_0x4081f4,_0x364302){var _0x44d09a={};var _0xbbebae={};var _0x48104b;var _0x3d1535;return db[_0xb3f0('0x31')][_0xb3f0('0x5d')]({'where':{'id':_0x4081f4['params']['id']}})[_0xb3f0('0x13')](handleEntityNotFound(_0x364302,null))[_0xb3f0('0x13')](function(_0x5145f7){if(_0x5145f7){_0x48104b=_0x5145f7;_0xbbebae[_0xb3f0('0x39')]=_['keys'](db[_0xb3f0('0xb7')][_0xb3f0('0x32')]);_0xbbebae['query']=_['keys'](_0x4081f4[_0xb3f0('0x35')]);_0xbbebae[_0xb3f0('0x37')]=_[_0xb3f0('0x38')](_0xbbebae[_0xb3f0('0x39')],_0xbbebae[_0xb3f0('0x35')]);_0x44d09a[_0xb3f0('0x3a')]=_[_0xb3f0('0x38')](_0xbbebae[_0xb3f0('0x39')],qs['fields'](_0x4081f4[_0xb3f0('0x35')][_0xb3f0('0x3b')]));_0x44d09a[_0xb3f0('0x3a')]=_0x44d09a[_0xb3f0('0x3a')][_0xb3f0('0x3c')]?_0x44d09a[_0xb3f0('0x3a')]:_0xbbebae['model'];_0x44d09a[_0xb3f0('0x5e')]=qs[_0xb3f0('0x3f')](_0x4081f4[_0xb3f0('0x35')][_0xb3f0('0x3f')]);_0x44d09a[_0xb3f0('0x42')]=qs['filters'](_[_0xb3f0('0x40')](_0x4081f4[_0xb3f0('0x35')],_0xbbebae[_0xb3f0('0x37')]));if(_0x4081f4[_0xb3f0('0x35')]['filter']){_0x44d09a['where']=_[_0xb3f0('0x43')](_0x44d09a['where'],{'$or':_[_0xb3f0('0x44')](_0x44d09a[_0xb3f0('0x3a')],function(_0x5a0197){var _0x64ba7={};_0x64ba7[_0x5a0197]={'$like':'%'+_0x4081f4[_0xb3f0('0x35')][_0xb3f0('0x41')]+'%'};return _0x64ba7;})});}_0x44d09a=_[_0xb3f0('0x43')]({},_0x44d09a,_0x4081f4[_0xb3f0('0x46')]);return _0x48104b[_0xb3f0('0x124')](_0x44d09a);}})[_0xb3f0('0x13')](function(_0x5a985a){if(_0x5a985a){_0x3d1535=_0x5a985a[_0xb3f0('0x3c')];if(!_0x4081f4[_0xb3f0('0x35')][_0xb3f0('0x3d')](_0xb3f0('0x3e'))){_0x44d09a['limit']=qs['limit'](_0x4081f4[_0xb3f0('0x35')]['limit']);_0x44d09a[_0xb3f0('0x24')]=qs['offset'](_0x4081f4['query'][_0xb3f0('0x24')]);}return _0x48104b[_0xb3f0('0x124')](_0x44d09a);}})['then'](function(_0x2b71fc){if(_0x2b71fc){return _0x2b71fc?{'count':_0x3d1535,'rows':_0x2b71fc}:null;}})[_0xb3f0('0x13')](respondWithResult(_0x364302,null))[_0xb3f0('0x1d')](handleError(_0x364302,null));}; \ No newline at end of file +var _0xad6a=['Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','inspect','No\x20timezone','Interval','getProactiveActions','../../config/license/util','getLicense','virtual','custom','License','increment','chatLicenseExceeded','Intervals','push','all','some','readFileSync','address','remote','stringify','x-real-ip','connection','replace','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','querystring','ioredis','../../config/logger','../../config/environment','url','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','limit','count','offset','set','json','then','destroy','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','pick','filter','VIRTUAL','merge','ChatWebsite','includeAll','include','findAll','rows','length','body','user','get','role','ChatWebsites','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','describe','addDisposition','ChatWebsiteId','findOne','Disposition','nolimit','order','options','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','isNil','existsSync','root','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','account','applications','Applications','list','orderBy','priority','ListId','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','contact','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','User','UserId','agent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKeyOffline','MailAccount','findOrCreate','utf8','render','toPairs','offlineMessageBody','fromString','originalname','mimetype','server','attachments','basename','openNewInteraction','transaction','Attachment','bulkCreate','CloudProvider','forwardOffline','forwardOfflineAddress','SendMail','sendMail','MailAccountId','subjectOffline','toPairsIn','mapValues','email','offlineMessageSubject','Chat','NotifyMailAccount','addInteraction','omit','getInteractions','Contact','Owner','internal','Tags','color','tag'];(function(_0x439557,_0x9dd976){var _0xd7641=function(_0x28c58b){while(--_0x28c58b){_0x439557['push'](_0x439557['shift']());}};_0xd7641(++_0x9dd976);}(_0xad6a,0x165));var _0xaad6=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xad6a[_0x13b8f3];return _0x1a6d06;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0xaad6('0x0'));var util=require(_0xaad6('0x1'));var path=require(_0xaad6('0x2'));var ejs=require(_0xaad6('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0xaad6('0x4'));var Redis=require(_0xaad6('0x5'));var qs=require('../../components/parsers/qs');var logger=require(_0xaad6('0x6'))('api');var config=require(_0xaad6('0x7'));var url=require(_0xaad6('0x8'));var db=require(_0xaad6('0x9'))['db'];config[_0xaad6('0xa')]=_[_0xaad6('0xb')](config[_0xaad6('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xaad6('0xc'))(new Redis(config[_0xaad6('0xa')]));require(_0xaad6('0xd'))['register'](socket);var htmlToText=require('html-to-text');var jayson=require(_0xaad6('0xe'));var client=jayson[_0xaad6('0xf')][_0xaad6('0x10')]({'port':0x232c});var client9002=jayson['client'][_0xaad6('0x10')]({'port':0x232a});var client9003=jayson[_0xaad6('0xf')][_0xaad6('0x10')]({'port':0x232b});var client9001=jayson[_0xaad6('0xf')][_0xaad6('0x10')]({'port':0x2329});function respondWithRpcPromise(_0x28531c,_0x3d287f,_0x291cab,_0x1516e2){return new BPromise(function(_0x198384,_0xf9c737){var _0x314825=_0x1516e2||client;return _0x314825[_0xaad6('0x11')](_0x28531c,_0x291cab)['then'](function(_0x1fd484){logger[_0xaad6('0x12')](_0xaad6('0x13'),_0x3d287f,_0xaad6('0x14'));logger[_0xaad6('0x15')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3d287f,_0xaad6('0x14'),JSON['stringify'](_0x1fd484));if(_0x1fd484[_0xaad6('0x16')]){if(_0x1fd484[_0xaad6('0x16')][_0xaad6('0x17')]===0x1f4){logger[_0xaad6('0x16')](_0xaad6('0x13'),_0x3d287f,_0x1fd484[_0xaad6('0x16')][_0xaad6('0x18')]);return _0xf9c737(_0x1fd484[_0xaad6('0x16')][_0xaad6('0x18')]);}logger[_0xaad6('0x16')](_0xaad6('0x13'),_0x3d287f,_0x1fd484['error'][_0xaad6('0x18')]);return _0x198384(_0x1fd484[_0xaad6('0x16')][_0xaad6('0x18')]);}else{logger['info'](_0xaad6('0x13'),_0x3d287f,_0xaad6('0x14'));_0x198384(_0x1fd484[_0xaad6('0x19')][_0xaad6('0x18')]);}})[_0xaad6('0x1a')](function(_0x3448e6){logger[_0xaad6('0x16')](_0xaad6('0x13'),_0x3d287f,_0x3448e6);_0xf9c737(_0x3448e6);});});}function respondWithStatusCode(_0x3dab92,_0x3d8034){_0x3d8034=_0x3d8034||0xcc;return function(_0x568b47){if(_0x568b47){return _0x3dab92[_0xaad6('0x1b')](_0x3d8034);}return _0x3dab92[_0xaad6('0x1c')](_0x3d8034)[_0xaad6('0x1d')]();};}function respondWithResult(_0x214d7e,_0x283831){_0x283831=_0x283831||0xc8;return function(_0x235ef7){if(_0x235ef7){return _0x214d7e[_0xaad6('0x1c')](_0x283831)['json'](_0x235ef7);}};}function respondWithFilteredResult(_0x522b8a,_0x2c2139){return function(_0x7cb3de){if(_0x7cb3de){var _0x5c9d58=typeof _0x2c2139['offset']==='undefined'&&typeof _0x2c2139[_0xaad6('0x1e')]==='undefined';var _0xce10b6=_0x7cb3de[_0xaad6('0x1f')];var _0x39089f=_0x5c9d58?0x0:_0x2c2139['offset'];var _0x681eb=_0x5c9d58?_0x7cb3de[_0xaad6('0x1f')]:_0x2c2139[_0xaad6('0x20')]+_0x2c2139[_0xaad6('0x1e')];var _0x34d6a3;if(_0x681eb>=_0xce10b6){_0x681eb=_0xce10b6;_0x34d6a3=0xc8;}else{_0x34d6a3=0xce;}_0x522b8a[_0xaad6('0x1c')](_0x34d6a3);return _0x522b8a[_0xaad6('0x21')]('Content-Range',_0x39089f+'-'+_0x681eb+'/'+_0xce10b6)[_0xaad6('0x22')](_0x7cb3de);}return null;};}function saveUpdates(_0x425fca){return function(_0x16a437){if(_0x16a437){return _0x16a437['update'](_0x425fca)[_0xaad6('0x23')](function(_0x38de72){return _0x38de72;});}return null;};}function removeEntity(_0x25e858){return function(_0x3c17b8){if(_0x3c17b8){return _0x3c17b8[_0xaad6('0x24')]()[_0xaad6('0x23')](function(){var _0x3a8dfa=_0x3c17b8['get']({'plain':!![]});var _0x23c801='ChatWebsites';return db[_0xaad6('0x25')][_0xaad6('0x24')]({'where':{'type':_0x23c801,'resourceId':_0x3a8dfa['id']}})[_0xaad6('0x23')](function(){return _0x3c17b8;});})[_0xaad6('0x23')](function(){_0x25e858[_0xaad6('0x1c')](0xcc)[_0xaad6('0x1d')]();});}};}function handleEntityNotFound(_0x4bea15){return function(_0x126fe8){if(!_0x126fe8){_0x4bea15[_0xaad6('0x1b')](0x194);}return _0x126fe8;};}function handleError(_0x3b32c1,_0x12d93a){_0x12d93a=_0x12d93a||0x1f4;return function(_0x1df3a3){logger['error'](_0x1df3a3['stack']);if(_0x1df3a3[_0xaad6('0x26')]){delete _0x1df3a3['name'];}_0x3b32c1[_0xaad6('0x1c')](_0x12d93a)[_0xaad6('0x27')](_0x1df3a3);};}exports[_0xaad6('0x28')]=function(_0x15a8cd,_0x393c14){var _0x311da0={'include':[{'model':db[_0xaad6('0x29')],'as':_0xaad6('0x2a')}]},_0x3a96aa={},_0x4b6ce7={'count':0x0,'rows':[]};var _0x2efa4d=_[_0xaad6('0x2b')](db['ChatWebsite'][_0xaad6('0x2c')],function(_0x2651b5){return{'name':_0x2651b5['fieldName'],'type':_0x2651b5[_0xaad6('0x2d')]['key']};});_0x3a96aa['model']=_[_0xaad6('0x2b')](_0x2efa4d,_0xaad6('0x26'));_0x3a96aa['query']=_[_0xaad6('0x2e')](_0x15a8cd[_0xaad6('0x2f')]);_0x3a96aa[_0xaad6('0x30')]=_[_0xaad6('0x31')](_0x3a96aa[_0xaad6('0x32')],_0x3a96aa[_0xaad6('0x2f')]);_0x311da0[_0xaad6('0x33')]=_[_0xaad6('0x31')](_0x3a96aa[_0xaad6('0x32')],qs[_0xaad6('0x34')](_0x15a8cd[_0xaad6('0x2f')][_0xaad6('0x34')]));_0x311da0[_0xaad6('0x33')]=_0x311da0['attributes']['length']?_0x311da0[_0xaad6('0x33')]:_0x3a96aa[_0xaad6('0x32')];if(!_0x15a8cd[_0xaad6('0x2f')][_0xaad6('0x35')]('nolimit')){_0x311da0[_0xaad6('0x1e')]=qs[_0xaad6('0x1e')](_0x15a8cd[_0xaad6('0x2f')][_0xaad6('0x1e')]);_0x311da0[_0xaad6('0x20')]=qs[_0xaad6('0x20')](_0x15a8cd['query'][_0xaad6('0x20')]);}_0x311da0['order']=qs['sort'](_0x15a8cd[_0xaad6('0x2f')][_0xaad6('0x36')]);_0x311da0[_0xaad6('0x37')]=qs['filters'](_[_0xaad6('0x38')](_0x15a8cd[_0xaad6('0x2f')],_0x3a96aa[_0xaad6('0x30')]),_0x2efa4d);if(_0x15a8cd[_0xaad6('0x2f')][_0xaad6('0x39')]){_0x311da0['where']=_['merge'](_0x311da0[_0xaad6('0x37')],{'$or':_[_0xaad6('0x2b')](_0x2efa4d,function(_0xb678cf){if(_0xb678cf[_0xaad6('0x2d')]!==_0xaad6('0x3a')){var _0x3b8f83={};_0x3b8f83[_0xb678cf[_0xaad6('0x26')]]={'$like':'%'+_0x15a8cd[_0xaad6('0x2f')][_0xaad6('0x39')]+'%'};return _0x3b8f83;}})});}_0x311da0=_[_0xaad6('0x3b')]({},_0x311da0,_0x15a8cd['options']);var _0x14d4d8={'where':_0x311da0[_0xaad6('0x37')]};return db[_0xaad6('0x3c')][_0xaad6('0x1f')](_0x14d4d8)[_0xaad6('0x23')](function(_0x3437dd){_0x4b6ce7[_0xaad6('0x1f')]=_0x3437dd;if(_0x15a8cd[_0xaad6('0x2f')][_0xaad6('0x3d')]){_0x311da0[_0xaad6('0x3e')]=[{'all':!![]}];}return db[_0xaad6('0x3c')][_0xaad6('0x3f')](_0x311da0);})['then'](function(_0x4a8fcb){_0x4b6ce7[_0xaad6('0x40')]=_0x4a8fcb;return _0x4b6ce7;})[_0xaad6('0x23')](respondWithFilteredResult(_0x393c14,_0x311da0))[_0xaad6('0x1a')](handleError(_0x393c14,null));};exports['show']=function(_0x3fd898,_0x266066){var _0x5a2e46={'raw':![],'where':{'id':_0x3fd898['params']['id']},'include':[{'model':db[_0xaad6('0x29')],'as':'mandatoryDispositionPause'}]},_0x223f49={};_0x223f49['model']=_[_0xaad6('0x2e')](db[_0xaad6('0x3c')][_0xaad6('0x2c')]);_0x223f49['query']=_['keys'](_0x3fd898[_0xaad6('0x2f')]);_0x223f49['filters']=_['intersection'](_0x223f49[_0xaad6('0x32')],_0x223f49['query']);_0x5a2e46[_0xaad6('0x33')]=_[_0xaad6('0x31')](_0x223f49[_0xaad6('0x32')],qs['fields'](_0x3fd898[_0xaad6('0x2f')][_0xaad6('0x34')]));_0x5a2e46[_0xaad6('0x33')]=_0x5a2e46[_0xaad6('0x33')][_0xaad6('0x41')]?_0x5a2e46[_0xaad6('0x33')]:_0x223f49[_0xaad6('0x32')];if(_0x3fd898[_0xaad6('0x2f')][_0xaad6('0x3d')]){_0x5a2e46[_0xaad6('0x3e')]=[{'all':!![]}];}_0x5a2e46=_[_0xaad6('0x3b')]({},_0x5a2e46,_0x3fd898['options']);return db[_0xaad6('0x3c')]['find'](_0x5a2e46)[_0xaad6('0x23')](handleEntityNotFound(_0x266066,null))[_0xaad6('0x23')](respondWithResult(_0x266066,null))[_0xaad6('0x1a')](handleError(_0x266066,null));};exports['create']=function(_0x4ae38c,_0x5eff00){return db['ChatWebsite']['create'](_0x4ae38c[_0xaad6('0x42')],{})[_0xaad6('0x23')](function(_0x174e11){var _0x13f811=_0x4ae38c[_0xaad6('0x43')][_0xaad6('0x44')]({'plain':!![]});if(!_0x13f811)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x13f811[_0xaad6('0x45')]==='user'){var _0x437d33=_0x174e11[_0xaad6('0x44')]({'plain':!![]});var _0x3f6964=_0xaad6('0x46');return db[_0xaad6('0x47')]['find']({'where':{'name':_0x3f6964,'userProfileId':_0x13f811[_0xaad6('0x48')]},'raw':!![]})['then'](function(_0x3c2c55){if(_0x3c2c55&&_0x3c2c55['autoAssociation']===0x0){return db['UserProfileResource'][_0xaad6('0x49')]({'name':_0x437d33[_0xaad6('0x26')],'resourceId':_0x437d33['id'],'type':_0x3c2c55['name'],'sectionId':_0x3c2c55['id']},{})[_0xaad6('0x23')](function(){return _0x174e11;});}else{return _0x174e11;}})[_0xaad6('0x1a')](function(_0x368c2a){logger['error'](_0xaad6('0x4a'),_0x368c2a);throw _0x368c2a;});}return _0x174e11;})[_0xaad6('0x23')](respondWithResult(_0x5eff00,0xc9))[_0xaad6('0x1a')](handleError(_0x5eff00,null));};exports[_0xaad6('0x4b')]=function(_0x49275c,_0xc0a40f){if(_0x49275c['body']['id']){delete _0x49275c['body']['id'];}return db[_0xaad6('0x3c')][_0xaad6('0x4c')]({'where':{'id':_0x49275c[_0xaad6('0x4d')]['id']},'include':[{'model':db[_0xaad6('0x29')],'as':_0xaad6('0x2a')}]})['then'](handleEntityNotFound(_0xc0a40f,null))[_0xaad6('0x23')](saveUpdates(_0x49275c[_0xaad6('0x42')],null))[_0xaad6('0x23')](respondWithResult(_0xc0a40f,null))[_0xaad6('0x1a')](handleError(_0xc0a40f,null));};exports[_0xaad6('0x24')]=function(_0x432da9,_0x5e1b7a){return db[_0xaad6('0x3c')]['find']({'where':{'id':_0x432da9['params']['id']}})[_0xaad6('0x23')](handleEntityNotFound(_0x5e1b7a,null))[_0xaad6('0x23')](removeEntity(_0x5e1b7a,null))[_0xaad6('0x1a')](handleError(_0x5e1b7a,null));};exports[_0xaad6('0x4e')]=function(_0x3ad917,_0x3677ae){return db[_0xaad6('0x3c')][_0xaad6('0x4e')]()[_0xaad6('0x23')](respondWithResult(_0x3677ae,null))[_0xaad6('0x1a')](handleError(_0x3677ae,null));};exports[_0xaad6('0x4f')]=function(_0x44258c,_0x487beb){if(_0x44258c[_0xaad6('0x42')]['id']){delete _0x44258c[_0xaad6('0x42')]['id'];}return db['ChatWebsite'][_0xaad6('0x4c')]({'where':{'id':_0x44258c[_0xaad6('0x4d')]['id']}})[_0xaad6('0x23')](handleEntityNotFound(_0x487beb,null))['then'](function(_0x48f624){if(_0x48f624){_0x44258c['body'][_0xaad6('0x50')]=_0x48f624['id'];return db['Disposition'][_0xaad6('0x49')](_0x44258c[_0xaad6('0x42')]);}})[_0xaad6('0x23')](respondWithResult(_0x487beb,null))[_0xaad6('0x1a')](handleError(_0x487beb,null));};exports['getDispositions']=function(_0x38a976,_0x3bd5ee){var _0x271595={'raw':![],'where':{}};var _0x54bc52={};var _0x4a5468={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xaad6('0x51')]({'where':{'id':_0x38a976[_0xaad6('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3bd5ee,null))[_0xaad6('0x23')](function(_0x4cb651){if(_0x4cb651){_0x54bc52[_0xaad6('0x32')]=_[_0xaad6('0x2e')](db[_0xaad6('0x52')][_0xaad6('0x2c')]);_0x54bc52['query']=_[_0xaad6('0x2e')](_0x38a976[_0xaad6('0x2f')]);_0x54bc52[_0xaad6('0x30')]=_[_0xaad6('0x31')](_0x54bc52[_0xaad6('0x32')],_0x54bc52['query']);_0x271595[_0xaad6('0x33')]=_[_0xaad6('0x31')](_0x54bc52[_0xaad6('0x32')],qs[_0xaad6('0x34')](_0x38a976['query'][_0xaad6('0x34')]));_0x271595['attributes']=_0x271595[_0xaad6('0x33')][_0xaad6('0x41')]?_0x271595[_0xaad6('0x33')]:_0x54bc52['model'];if(!_0x38a976[_0xaad6('0x2f')]['hasOwnProperty'](_0xaad6('0x53'))){_0x271595[_0xaad6('0x1e')]=qs[_0xaad6('0x1e')](_0x38a976[_0xaad6('0x2f')][_0xaad6('0x1e')]);_0x271595[_0xaad6('0x20')]=qs['offset'](_0x38a976[_0xaad6('0x2f')]['offset']);}_0x271595[_0xaad6('0x54')]=qs[_0xaad6('0x36')](_0x38a976[_0xaad6('0x2f')][_0xaad6('0x36')]);_0x271595['where']=qs['filters'](_[_0xaad6('0x38')](_0x38a976[_0xaad6('0x2f')],_0x54bc52[_0xaad6('0x30')]));_0x271595[_0xaad6('0x37')]['ChatWebsiteId']=_0x4cb651['id'];if(_0x38a976['query'][_0xaad6('0x39')]){_0x271595[_0xaad6('0x37')]=_['merge'](_0x271595[_0xaad6('0x37')],{'$or':_[_0xaad6('0x2b')](_0x271595['attributes'],function(_0x34701f){var _0x4d0722={};_0x4d0722[_0x34701f]={'$like':'%'+_0x38a976[_0xaad6('0x2f')][_0xaad6('0x39')]+'%'};return _0x4d0722;})});}_0x271595=_[_0xaad6('0x3b')]({},_0x271595,_0x38a976[_0xaad6('0x55')]);return db[_0xaad6('0x52')][_0xaad6('0x1f')]({'where':_0x271595[_0xaad6('0x37')]})['then'](function(_0x4d9f9e){_0x4a5468['count']=_0x4d9f9e;if(_0x38a976[_0xaad6('0x2f')]['includeAll']){_0x271595[_0xaad6('0x3e')]=[{'all':!![]}];}return db[_0xaad6('0x52')][_0xaad6('0x3f')](_0x271595);})[_0xaad6('0x23')](function(_0x47948c){_0x4a5468[_0xaad6('0x40')]=_0x47948c;return _0x4a5468;});}})[_0xaad6('0x23')](respondWithFilteredResult(_0x3bd5ee,_0x271595))[_0xaad6('0x1a')](handleError(_0x3bd5ee,null));};exports[_0xaad6('0x56')]=function(_0x23d844,_0x1a6bf2){return db[_0xaad6('0x3c')]['find']({'where':{'id':_0x23d844['params']['id']}})['then'](handleEntityNotFound(_0x1a6bf2,null))[_0xaad6('0x23')](function(_0x32d1a5){if(_0x32d1a5){return _0x32d1a5['removeDispositions'](_0x23d844[_0xaad6('0x2f')][_0xaad6('0x57')]);}})['then'](respondWithStatusCode(_0x1a6bf2,null))['catch'](handleError(_0x1a6bf2,null));};exports[_0xaad6('0x58')]=function(_0x585d84,_0x22ea29){if(_0x585d84[_0xaad6('0x42')]['id']){delete _0x585d84[_0xaad6('0x42')]['id'];}return db[_0xaad6('0x3c')][_0xaad6('0x4c')]({'where':{'id':_0x585d84[_0xaad6('0x4d')]['id']}})[_0xaad6('0x23')](handleEntityNotFound(_0x22ea29,null))[_0xaad6('0x23')](function(_0x41382c){if(_0x41382c){_0x585d84[_0xaad6('0x42')]['ChatWebsiteId']=_0x41382c['id'];return db[_0xaad6('0x59')]['create'](_0x585d84[_0xaad6('0x42')]);}})[_0xaad6('0x23')](respondWithResult(_0x22ea29,null))['catch'](handleError(_0x22ea29,null));};exports[_0xaad6('0x5a')]=function(_0x855046,_0x2d41a3){var _0x4b9e3d={'raw':![],'where':{}};var _0x31437f={};var _0x44e8c5={'count':0x0,'rows':[]};return db[_0xaad6('0x3c')]['findOne']({'where':{'id':_0x855046[_0xaad6('0x4d')]['id']}})[_0xaad6('0x23')](handleEntityNotFound(_0x2d41a3,null))[_0xaad6('0x23')](function(_0x491f60){if(_0x491f60){_0x31437f[_0xaad6('0x32')]=_[_0xaad6('0x2e')](db[_0xaad6('0x59')]['rawAttributes']);_0x31437f[_0xaad6('0x2f')]=_[_0xaad6('0x2e')](_0x855046['query']);_0x31437f[_0xaad6('0x30')]=_['intersection'](_0x31437f[_0xaad6('0x32')],_0x31437f[_0xaad6('0x2f')]);_0x4b9e3d[_0xaad6('0x33')]=_[_0xaad6('0x31')](_0x31437f[_0xaad6('0x32')],qs[_0xaad6('0x34')](_0x855046[_0xaad6('0x2f')][_0xaad6('0x34')]));_0x4b9e3d[_0xaad6('0x33')]=_0x4b9e3d[_0xaad6('0x33')][_0xaad6('0x41')]?_0x4b9e3d[_0xaad6('0x33')]:_0x31437f[_0xaad6('0x32')];if(!_0x855046[_0xaad6('0x2f')][_0xaad6('0x35')](_0xaad6('0x53'))){_0x4b9e3d[_0xaad6('0x1e')]=qs['limit'](_0x855046['query'][_0xaad6('0x1e')]);_0x4b9e3d[_0xaad6('0x20')]=qs[_0xaad6('0x20')](_0x855046[_0xaad6('0x2f')]['offset']);}_0x4b9e3d['order']=qs[_0xaad6('0x36')](_0x855046[_0xaad6('0x2f')]['sort']);_0x4b9e3d['where']=qs[_0xaad6('0x30')](_[_0xaad6('0x38')](_0x855046[_0xaad6('0x2f')],_0x31437f[_0xaad6('0x30')]));_0x4b9e3d[_0xaad6('0x37')][_0xaad6('0x50')]=_0x491f60['id'];if(_0x855046[_0xaad6('0x2f')][_0xaad6('0x39')]){_0x4b9e3d['where']=_['merge'](_0x4b9e3d[_0xaad6('0x37')],{'$or':_[_0xaad6('0x2b')](_0x4b9e3d[_0xaad6('0x33')],function(_0x2df595){var _0x626870={};_0x626870[_0x2df595]={'$like':'%'+_0x855046[_0xaad6('0x2f')][_0xaad6('0x39')]+'%'};return _0x626870;})});}_0x4b9e3d=_[_0xaad6('0x3b')]({},_0x4b9e3d,_0x855046[_0xaad6('0x55')]);return db[_0xaad6('0x59')][_0xaad6('0x1f')]({'where':_0x4b9e3d['where']})[_0xaad6('0x23')](function(_0x15a0d5){_0x44e8c5[_0xaad6('0x1f')]=_0x15a0d5;if(_0x855046['query'][_0xaad6('0x3d')]){_0x4b9e3d[_0xaad6('0x3e')]=[{'all':!![]}];}return db[_0xaad6('0x59')]['findAll'](_0x4b9e3d);})[_0xaad6('0x23')](function(_0x15649c){_0x44e8c5['rows']=_0x15649c;return _0x44e8c5;});}})[_0xaad6('0x23')](respondWithFilteredResult(_0x2d41a3,_0x4b9e3d))[_0xaad6('0x1a')](handleError(_0x2d41a3,null));};exports[_0xaad6('0x5b')]=function(_0x3b42aa,_0x11ea71){return db[_0xaad6('0x3c')][_0xaad6('0x4c')]({'where':{'id':_0x3b42aa[_0xaad6('0x4d')]['id']}})[_0xaad6('0x23')](handleEntityNotFound(_0x11ea71,null))[_0xaad6('0x23')](function(_0xbe015){if(_0xbe015){return _0xbe015['removeAnswers'](_0x3b42aa[_0xaad6('0x2f')][_0xaad6('0x57')]);}})['then'](respondWithStatusCode(_0x11ea71,null))[_0xaad6('0x1a')](handleError(_0x11ea71,null));};exports[_0xaad6('0x5c')]=function(_0x3d6496,_0x1e71eb){_0x3d6496[_0xaad6('0x42')][_0xaad6('0x5d')]=_0x3d6496[_0xaad6('0x5e')][_0xaad6('0x5f')];return db[_0xaad6('0x3c')]['find']({'where':{'id':_0x3d6496[_0xaad6('0x4d')]['id']}})[_0xaad6('0x23')](handleEntityNotFound(_0x1e71eb,null))['then'](saveUpdates(_0x3d6496['body'],null))[_0xaad6('0x23')](respondWithResult(_0x1e71eb,null))['catch'](handleError(_0x1e71eb,null));};exports[_0xaad6('0x60')]=function(_0x165ca9,_0x4e64f0){_0x165ca9[_0xaad6('0x42')][_0xaad6('0x61')]=_0x165ca9['file']['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x165ca9[_0xaad6('0x4d')]['id']}})[_0xaad6('0x23')](handleEntityNotFound(_0x4e64f0,null))['then'](saveUpdates(_0x165ca9[_0xaad6('0x42')],null))[_0xaad6('0x23')](respondWithResult(_0x4e64f0,null))[_0xaad6('0x1a')](handleError(_0x4e64f0,null));};exports[_0xaad6('0x62')]=function(_0x46e27e,_0x31e675){_0x46e27e[_0xaad6('0x42')][_0xaad6('0x63')]=_0x46e27e[_0xaad6('0x5e')][_0xaad6('0x5f')];return db[_0xaad6('0x3c')][_0xaad6('0x4c')]({'where':{'id':_0x46e27e[_0xaad6('0x4d')]['id']}})[_0xaad6('0x23')](handleEntityNotFound(_0x31e675,null))['then'](saveUpdates(_0x46e27e[_0xaad6('0x42')],null))[_0xaad6('0x23')](respondWithResult(_0x31e675,null))[_0xaad6('0x1a')](handleError(_0x31e675,null));};exports[_0xaad6('0x64')]=function(_0x338b6e,_0x33e154){_0x338b6e[_0xaad6('0x42')][_0xaad6('0x65')]=_0x338b6e[_0xaad6('0x5e')]['filename'];return db[_0xaad6('0x3c')][_0xaad6('0x4c')]({'where':{'id':_0x338b6e[_0xaad6('0x4d')]['id']}})['then'](handleEntityNotFound(_0x33e154,null))[_0xaad6('0x23')](saveUpdates(_0x338b6e[_0xaad6('0x42')],null))['then'](respondWithResult(_0x33e154,null))[_0xaad6('0x1a')](handleError(_0x33e154,null));};exports[_0xaad6('0x66')]=function(_0x52b81a,_0x1d806d){var _0x463cab=path[_0xaad6('0x67')](config['root'],_0xaad6('0x68'));var _0x238c0f={'where':{'id':_0x52b81a['params']['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x2227f1=![];return require('../../config/license/util')['getLicense']()[_0xaad6('0x23')](function(_0x33716c){if(_0x33716c){_0x2227f1=_0x33716c['custom'];}})[_0xaad6('0x23')](function(){return db[_0xaad6('0x3c')][_0xaad6('0x4c')](_0x238c0f);})[_0xaad6('0x23')](handleEntityNotFound(_0x1d806d,null))[_0xaad6('0x23')](function(_0x69fff0){if(_0x69fff0){if(!_[_0xaad6('0x69')](_0x69fff0[_0xaad6('0x5d')])){if(fs[_0xaad6('0x6a')](path[_0xaad6('0x67')](config[_0xaad6('0x6b')],_0xaad6('0x6c'),_0x69fff0[_0xaad6('0x5d')]))&&_0x2227f1){_0x463cab=path[_0xaad6('0x67')](config[_0xaad6('0x6b')],_0xaad6('0x6c'),_0x69fff0['sitepic']);}}return _0x1d806d[_0xaad6('0x6d')](_0x463cab);}})[_0xaad6('0x1a')](handleError(_0x1d806d,null));};exports['getAvatar']=function(_0x3db1d2,_0x4b53ee){var _0xbd8691=path['join'](config[_0xaad6('0x6b')],_0xaad6('0x6e'));var _0x1c7125={'where':{'id':_0x3db1d2['params']['id']},'attributes':['id',_0xaad6('0x61')],'raw':!![]};return db[_0xaad6('0x3c')]['find'](_0x1c7125)['then'](handleEntityNotFound(_0x4b53ee,null))[_0xaad6('0x23')](function(_0x5b2b78){if(_0x5b2b78){if(!_['isNil'](_0x5b2b78[_0xaad6('0x61')])){if(fs[_0xaad6('0x6a')](path[_0xaad6('0x67')](config['root'],_0xaad6('0x6f'),_0x5b2b78['agentAvatar']))){_0xbd8691=path[_0xaad6('0x67')](config[_0xaad6('0x6b')],_0xaad6('0x6f'),_0x5b2b78['agentAvatar']);}}return _0x4b53ee[_0xaad6('0x6d')](_0xbd8691);}})[_0xaad6('0x1a')](handleError(_0x4b53ee,null));};exports[_0xaad6('0x70')]=function(_0x372855,_0x533df8){var _0x342ed7=path[_0xaad6('0x67')](config[_0xaad6('0x6b')],'server/files/images/avatars/customer_avatar.png');var _0x284941={'where':{'id':_0x372855['params']['id']},'attributes':['id',_0xaad6('0x63'),_0xaad6('0x71')],'raw':!![]};return db[_0xaad6('0x3c')][_0xaad6('0x4c')](_0x284941)[_0xaad6('0x23')](handleEntityNotFound(_0x533df8,null))['then'](function(_0x485ff5){if(_0x485ff5){if(!_['isNil'](_0x485ff5['customerAvatar'])){if(fs['existsSync'](path[_0xaad6('0x67')](config[_0xaad6('0x6b')],'server/files/images/avatars/',_0x485ff5['customerAvatar']))&&_0x485ff5[_0xaad6('0x71')]){_0x342ed7=path[_0xaad6('0x67')](config[_0xaad6('0x6b')],_0xaad6('0x6f'),_0x485ff5[_0xaad6('0x63')]);}}return _0x533df8[_0xaad6('0x6d')](_0x342ed7);}})['catch'](handleError(_0x533df8,null));};exports[_0xaad6('0x72')]=function(_0x1c16fa,_0x492b24){var _0x22aea2=path['join'](config[_0xaad6('0x6b')],_0xaad6('0x73'));var _0xce8a6b={'where':{'id':_0x1c16fa[_0xaad6('0x4d')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db['ChatWebsite']['find'](_0xce8a6b)[_0xaad6('0x23')](handleEntityNotFound(_0x492b24,null))[_0xaad6('0x23')](function(_0x1aa576){if(_0x1aa576){if(!_['isNil'](_0x1aa576[_0xaad6('0x65')])){if(fs['existsSync'](path[_0xaad6('0x67')](config[_0xaad6('0x6b')],'server/files/images/avatars/',_0x1aa576[_0xaad6('0x65')]))){_0x22aea2=path['join'](config[_0xaad6('0x6b')],_0xaad6('0x6f'),_0x1aa576[_0xaad6('0x65')]);}}return _0x492b24[_0xaad6('0x6d')](_0x22aea2);}})[_0xaad6('0x1a')](handleError(_0x492b24,null));};exports[_0xaad6('0x74')]=function(_0x2da91d,_0x6c7855){var _0x2cbe80=require('user-agent-parser');var _0x3cae8f=new _0x2cbe80();var _0x2dc124=_0x3cae8f['setUA'](_0x2da91d[_0xaad6('0x75')][_0xaad6('0x76')])[_0xaad6('0x77')]();var _0x51034d={'body':_0x2da91d['body'],'channel':_0xaad6('0x78')};var _0x1402bf=[];var _0x517566=[];var _0x18f3e3={};var _0x3962c1=![];return db[_0xaad6('0x79')][_0xaad6('0x4e')]()['then'](function(_0x729b60){if(!_0x729b60){throw new db['Sequelize'][(_0xaad6('0x7a'))](_0xaad6('0x7b'));}_0x1402bf=_[_0xaad6('0x7c')](_[_0xaad6('0x2e')](_0x729b60),[_0xaad6('0x7d'),_0xaad6('0x7e')]);_0x517566=_[_0xaad6('0x7c')](_[_0xaad6('0x2e')](_0x729b60),[_0xaad6('0x7d'),'updatedAt',_0xaad6('0x7f'),'ListId']);if(_0x2da91d[_0xaad6('0x42')]['id']){delete _0x2da91d[_0xaad6('0x42')]['id'];}if(_[_0xaad6('0x69')](_0x2da91d[_0xaad6('0x42')][_0xaad6('0x80')])){throw new db[(_0xaad6('0x81'))]['ValidationError'](_0xaad6('0x82'));}if(_[_0xaad6('0x69')](_0x2da91d[_0xaad6('0x42')]['body'])||_0x2da91d['body'][_0xaad6('0x42')]===''){throw new db[(_0xaad6('0x81'))][(_0xaad6('0x7a'))](_0xaad6('0x83'));}if(_[_0xaad6('0x69')](_0x2da91d[_0xaad6('0x42')][_0xaad6('0x84')])){throw new db[(_0xaad6('0x81'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x517566);}if(!_['includes'](_0x517566,_0x2da91d['body'][_0xaad6('0x84')])){throw new db[(_0xaad6('0x81'))][(_0xaad6('0x7a'))](_0xaad6('0x85')+_0x517566);}_0x18f3e3[_0x2da91d[_0xaad6('0x42')]['mapKey']]=_0x2da91d[_0xaad6('0x42')][_0xaad6('0x80')];})[_0xaad6('0x23')](function(){return db[_0xaad6('0x3c')][_0xaad6('0x4c')]({'where':{'id':_0x2da91d['params']['id']},'include':[{'model':db[_0xaad6('0x86')],'as':_0xaad6('0x87'),'include':[{'model':db[_0xaad6('0x79')],'as':_0xaad6('0x88'),'where':_0x18f3e3,'limit':0x1,'order':[[_0xaad6('0x7e'),_0xaad6('0x89')]]}]},{'model':db[_0xaad6('0x8a')],'as':'Applications'}]});})[_0xaad6('0x23')](handleEntityNotFound(_0x6c7855,null))[_0xaad6('0x23')](function(_0x1aaff3){if(_0x1aaff3&&_0x1aaff3[_0xaad6('0x87')]){_0x51034d[_0xaad6('0x8b')]=_0x1aaff3;_0x51034d[_0xaad6('0x8c')]=_0x1aaff3[_0xaad6('0x8d')];_0x51034d[_0xaad6('0x8e')]=_0x1aaff3['List'];_0x51034d[_0xaad6('0x8c')]=_[_0xaad6('0x8f')](_0x51034d['applications'],[_0xaad6('0x90')],['asc']);if(_0x51034d['account'][_0xaad6('0x8d')]){delete _0x51034d['account'][_0xaad6('0x8d')];}if(_0x51034d[_0xaad6('0x8b')][_0xaad6('0x87')]&&_0x51034d['account'][_0xaad6('0x87')]['Contacts'][_0xaad6('0x41')]){return _0x51034d[_0xaad6('0x8b')][_0xaad6('0x87')]['Contacts'][0x0];}var _0x5b3356=_[_0xaad6('0xb')](_0x2da91d[_0xaad6('0x42')],{'firstName':_0x2da91d[_0xaad6('0x42')]['from'],'ListId':_0x1aaff3[_0xaad6('0x91')]});_0x5b3356[_0x2da91d[_0xaad6('0x42')][_0xaad6('0x84')]]=_0x2da91d['body'][_0xaad6('0x80')];return db[_0xaad6('0x79')][_0xaad6('0x49')](_0x5b3356,{'fields':_0x1402bf,'raw':!![]});}})[_0xaad6('0x23')](handleEntityNotFound(_0x6c7855,null))[_0xaad6('0x23')](function(_0x2a9bba){_0x51034d['contact']=_0x2a9bba;var _0x33295d=_0x2da91d[_0xaad6('0x42')]['customerIp'];if(_0x2da91d[_0xaad6('0x75')]['cf-connecting-ip']){_0x33295d=_0x2da91d['headers']['cf-connecting-ip'];}else if(_0x2da91d[_0xaad6('0x75')][_0xaad6('0x92')]){_0x33295d=_[_0xaad6('0x93')](_0x2da91d[_0xaad6('0x75')][_0xaad6('0x92')][_0xaad6('0x94')](','));}if(_0x2a9bba){var _0x156ba6={'ContactId':_0x2a9bba['id'],'ChatWebsiteId':_0x2da91d['params']['id'],'from':(_0x2a9bba[_0xaad6('0x95')]||'')+'\x20'+(_0x2a9bba[_0xaad6('0x96')]||''),'customerIp':_0x33295d,'customerPort':_0x2da91d[_0xaad6('0x75')][_0xaad6('0x97')]?_0x2da91d['headers'][_0xaad6('0x97')]:null,'referer':_0x2da91d['body'][_0xaad6('0x98')],'browserName':_0x2dc124[_0xaad6('0x99')]['name']&&_0x2dc124[_0xaad6('0x99')][_0xaad6('0x9a')]?util[_0xaad6('0x9b')](_0xaad6('0x9c'),_0x2dc124[_0xaad6('0x99')][_0xaad6('0x26')],_0x2dc124[_0xaad6('0x99')][_0xaad6('0x9a')]):'unknown','browserVersion':_0x2dc124[_0xaad6('0x99')][_0xaad6('0x9a')]||_0xaad6('0x9d'),'osName':util[_0xaad6('0x9b')](_0xaad6('0x9c'),_0x2dc124['os'][_0xaad6('0x26')],_0x2dc124['os'][_0xaad6('0x9a')]),'osVersion':_0x2dc124['os'][_0xaad6('0x9a')],'deviceModel':_0x2dc124['device'][_0xaad6('0x32')]&&_0x2dc124[_0xaad6('0x9e')][_0xaad6('0x9f')]?util[_0xaad6('0x9b')]('%s\x20%s\x20%s',_0x2dc124['device'][_0xaad6('0x32')],_0x2dc124[_0xaad6('0x9e')]['vendor'],_0x2dc124['device'][_0xaad6('0x2d')]):null,'deviceVendor':_0x2dc124['device'][_0xaad6('0x9f')],'deviceType':_0x2dc124[_0xaad6('0x9e')][_0xaad6('0x2d')],'formData':JSON['stringify'](_0x2da91d[_0xaad6('0x42')])};var _0x41a1db={'ChatWebsiteId':_0x2da91d[_0xaad6('0x4d')]['id'],'closed':![]};if(_0x2da91d[_0xaad6('0x42')][_0xaad6('0xa0')]){_0x41a1db[_0xaad6('0xa0')]=_0x2da91d[_0xaad6('0x42')][_0xaad6('0xa0')];return db[_0xaad6('0xa1')][_0xaad6('0x4c')]({'where':_0x41a1db})[_0xaad6('0x23')](function(_0x41a9b2){if(_0x41a9b2){return[_0x41a9b2,![]];}_0x156ba6['threadId']=_0x2da91d['body'][_0xaad6('0xa0')];_0x156ba6[_0xaad6('0xa2')]=_0x2da91d[_0xaad6('0x42')]['externalUrl'];return db[_0xaad6('0xa1')][_0xaad6('0x49')](_0x156ba6)[_0xaad6('0x23')](function(_0xdb494e){return[_0xdb494e,!![]];});});}_0x41a1db[_0xaad6('0xa3')]=_0x2a9bba['id'];if(_0x2da91d[_0xaad6('0x42')]['interaction']&&_0x2da91d[_0xaad6('0x42')][_0xaad6('0xa4')]['id']){_0x41a1db['id']=_0x2da91d[_0xaad6('0x42')][_0xaad6('0xa4')]['id'];return db[_0xaad6('0xa1')]['find']({'where':_0x41a1db})['then'](function(_0x8de1a8){if(_0x8de1a8){return[_0x8de1a8,![]];}return db[_0xaad6('0xa1')][_0xaad6('0x49')](_0x156ba6)[_0xaad6('0x23')](function(_0x277c17){return[_0x277c17,!![]];});});}return db['ChatInteraction']['create'](_0x156ba6)[_0xaad6('0x23')](function(_0x41144f){return[_0x41144f,!![]];});}})[_0xaad6('0xa5')](function(_0x3a847b,_0x513e51){if(_0x3a847b){_0x3962c1=_0x513e51;if(!_0x513e51){var _0x304d0c={'from':(_0x51034d['contact'][_0xaad6('0x95')]||'')+'\x20'+(_0x51034d[_0xaad6('0xa6')][_0xaad6('0x96')]||'')};if(_0x2da91d[_0xaad6('0x42')][_0xaad6('0xa0')]&&_0x2da91d[_0xaad6('0x42')]['messageId']&&_0x2da91d[_0xaad6('0x42')]['threadId']!=_0x2da91d['body'][_0xaad6('0xa7')]){_0x304d0c[_0xaad6('0xa0')]=_0x2da91d[_0xaad6('0x42')][_0xaad6('0xa7')];}return _0x3a847b[_0xaad6('0x4b')](_0x304d0c);}else{return _0x3a847b;}}})[_0xaad6('0x23')](function(_0x2d4f61){_0x51034d[_0xaad6('0xa4')]=_0x2d4f61[_0xaad6('0x44')]({'plain':!![]});_0x51034d['interaction'][_0xaad6('0xa8')]=_0x3962c1;if(_0x51034d[_0xaad6('0xa4')][_0xaad6('0xa8')]){if(_0x51034d[_0xaad6('0x8b')][_0xaad6('0xa9')]){_0x51034d[_0xaad6('0x8c')]['push']({'id':0x0,'priority':_0x51034d[_0xaad6('0x8c')][_0xaad6('0x41')]+0x1,'app':_0xaad6('0xaa'),'appdata':_0xaad6('0xab'),'interval':_0xaad6('0xac')});}}return db[_0xaad6('0xad')][_0xaad6('0x49')]({'body':_0x2da91d[_0xaad6('0x42')][_0xaad6('0x42')],'ChatWebsiteId':_0x2da91d[_0xaad6('0x4d')]['id'],'ChatInteractionId':_0x2d4f61['id'],'direction':'in','ContactId':_0x51034d[_0xaad6('0xa6')]['id'],'AttachmentId':_0x2da91d[_0xaad6('0x42')][_0xaad6('0xae')]});})['then'](function(_0x1255c4){_0x51034d['message']=_0x1255c4;if(_0x51034d[_0xaad6('0xa4')]['UserId']){return db[_0xaad6('0xaf')][_0xaad6('0x4c')]({'attributes':['id',_0xaad6('0x26')],'where':{'id':_0x51034d[_0xaad6('0xa4')][_0xaad6('0xb0')]}})[_0xaad6('0x23')](function(_0x3bb266){if(_0x3bb266){_0x51034d['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0xaad6('0xb1'),'appdata':_0x3bb266[_0xaad6('0x26')]+','+(_0x51034d[_0xaad6('0x8b')]['waitForTheAssignedAgent']||0xa),'interval':_0xaad6('0xac')});_0x51034d[_0xaad6('0xb2')]=!![];}return respondWithRpcPromise(_0xaad6('0xb3'),'startRouting',_0x51034d);});}return respondWithRpcPromise(_0xaad6('0xb3'),_0xaad6('0xb4'),_0x51034d);})['then'](function(_0x3db535){respondWithRpcPromise(_0xaad6('0xb5'),_0xaad6('0xb5'),{'event':_0xaad6('0x74'),'message':_0x3db535},client9002);return _0x3db535;})[_0xaad6('0x23')](respondWithResult(_0x6c7855,null))[_0xaad6('0x1a')](handleError(_0x6c7855,null));};exports[_0xaad6('0xb6')]=function(_0x4b0846,_0x5353b3){var _0x5d0299,_0x289d1f,_0x1ae190;var _0x2328d9=[];var _0x4d9a4f={};var _0x376cf2=_0x4b0846[_0xaad6('0xb7')]||[];var _0x4bef66=[];var _0x15efac;return db[_0xaad6('0x79')][_0xaad6('0x4e')]()[_0xaad6('0x23')](function(_0x2b7824){if(!_0x2b7824){throw new db[(_0xaad6('0x81'))][(_0xaad6('0x7a'))](_0xaad6('0x7b'));}_0x2328d9=_['difference'](_[_0xaad6('0x2e')](_0x2b7824),['createdAt',_0xaad6('0x7e'),_0xaad6('0x7f'),_0xaad6('0x91')]);if(_0x4b0846[_0xaad6('0x42')]['id']){delete _0x4b0846['body']['id'];}if(_[_0xaad6('0x69')](_0x4b0846[_0xaad6('0x42')][_0xaad6('0x80')])){throw _0x5353b3[_0xaad6('0x1c')](0x1f4)[_0xaad6('0x27')](new db['Sequelize'][(_0xaad6('0x7a'))](_0xaad6('0x82')));}if(_[_0xaad6('0x69')](_0x4b0846[_0xaad6('0x42')][_0xaad6('0x42')])||_0x4b0846['body'][_0xaad6('0x42')]===''){throw _0x5353b3['status'](0x1f4)['send'](new db[(_0xaad6('0x81'))][(_0xaad6('0x7a'))](_0xaad6('0x83')));}if(_[_0xaad6('0x69')](_0x4b0846[_0xaad6('0x42')]['mapKeyOffline'])){throw _0x5353b3[_0xaad6('0x1c')](0x1f4)[_0xaad6('0x27')](new db[(_0xaad6('0x81'))][(_0xaad6('0x7a'))](_0xaad6('0xb8')+_0x2328d9));}if(!_[_0xaad6('0xb9')](_0x2328d9,_0x4b0846[_0xaad6('0x42')]['mapKeyOffline'])){throw _0x5353b3['status'](0x1f4)[_0xaad6('0x27')](new db[(_0xaad6('0x81'))][(_0xaad6('0x7a'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2328d9));}_0x4d9a4f[_0x4b0846['body'][_0xaad6('0xba')]]=_0x4b0846[_0xaad6('0x42')][_0xaad6('0x80')];})[_0xaad6('0x23')](function(){return db[_0xaad6('0x3c')][_0xaad6('0x4c')]({'where':{'id':_0x4b0846[_0xaad6('0x4d')]['id']},'include':[{'model':db[_0xaad6('0x86')],'as':'List'},{'model':db[_0xaad6('0xbb')],'as':'MailAccount'}]});})[_0xaad6('0x23')](handleEntityNotFound(_0x5353b3,null))['then'](function(_0x4b4585){if(_0x4b4585&&_0x4b4585['List']){_0x289d1f=_0x4b4585;var _0x151a07=_['defaults'](_0x4b0846['body'],{'firstName':_0x4b0846[_0xaad6('0x42')][_0xaad6('0x80')],'phone':_0x4b0846[_0xaad6('0x42')][_0xaad6('0x80')],'ListId':_0x4b4585[_0xaad6('0x91')]});_0x151a07[_0x4b0846[_0xaad6('0x42')][_0xaad6('0xba')]]=_0x4b0846[_0xaad6('0x42')][_0xaad6('0x80')];return db[_0xaad6('0x79')][_0xaad6('0xbc')]({'where':_0x4d9a4f,'defaults':_0x151a07});}})['spread'](function(_0x12fa56){if(_0x12fa56){_0x1ae190=_0x12fa56;var _0x348045=fs['readFileSync'](path[_0xaad6('0x67')](config[_0xaad6('0x6b')],'server/files/templates/chatOfflineMessage.ejs'),_0xaad6('0xbd'));var _0x1c1e52=ejs[_0xaad6('0xbe')](_0x348045,{'body':_[_0xaad6('0xbf')](_0x4b0846[_0xaad6('0x42')][_0xaad6('0x42')]),'bodyTitle':_0x289d1f[_0xaad6('0xc0')]});return db['ChatOfflineMessage'][_0xaad6('0x49')]({'body':_0x1c1e52,'plainBody':htmlToText[_0xaad6('0xc1')](_0x1c1e52),'ContactId':_0x12fa56['id'],'ChatWebsiteId':_0x289d1f['id']});}})[_0xaad6('0x23')](function(_0x2a5bb4){_0x15efac=_0x2a5bb4;if(_0x376cf2[_0xaad6('0x41')]){var _0x26c39f=_0x376cf2[_0xaad6('0x2b')](function(_0x2a5bcc){return{'name':_0x2a5bcc[_0xaad6('0xc2')],'basename':_0x2a5bcc['filename'],'type':_0x2a5bcc[_0xaad6('0xc3')],'ChatOfflineMessageId':_0x2a5bb4['id']};});_0x4bef66=_0x26c39f[_0xaad6('0x2b')](_0x187b35=>{var _0x85e417={'filename':_0x187b35[_0xaad6('0x26')],'path':path[_0xaad6('0x67')](config[_0xaad6('0x6b')],_0xaad6('0xc4'),'files',_0xaad6('0xc5'),'offline-chat',_0x187b35[_0xaad6('0xc6')])};return _0x85e417;});if(!_0x289d1f[_0xaad6('0xc7')]){return db['sequelize'][_0xaad6('0xc8')](function(_0x30cd9b){return db[_0xaad6('0xc9')][_0xaad6('0xca')](_0x26c39f,{'transaction':_0x30cd9b});});}}})[_0xaad6('0x23')](function(){if(_0x15efac){_0x5d0299=_0x15efac;return db[_0xaad6('0xbb')][_0xaad6('0x51')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xaad6('0xcb')],'as':_0xaad6('0xcb'),'raw':!![]}]}]});}})['then'](function(_0x18b5bb){if(_0x18b5bb&&_0x18b5bb['Smtp']&&_0x289d1f[_0xaad6('0xcc')]&&_0x289d1f[_0xaad6('0xcd')]){var _0xb950cb=_0x18b5bb['getSmtpOptions']();return respondWithRpcPromise(_0xaad6('0xce'),_0xaad6('0xcf'),{'account':_0xb950cb,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x18b5bb[_0xaad6('0x26')],_0x18b5bb['email']||_0x18b5bb['Smtp']['user']),'to':_0x289d1f[_0xaad6('0xcd')],'subject':_0x289d1f['offlineMessageSubject'],'html':_0x5d0299[_0xaad6('0x42')],'attachments':_0x4bef66}},client9003)[_0xaad6('0x23')](function(){return _0x5d0299;})[_0xaad6('0x1a')](function(_0x2fc4b7){logger[_0xaad6('0x16')](_0x2fc4b7);});}})['then'](function(){if(_0x289d1f&&_0x289d1f['openNewInteraction']&&_0x289d1f[_0xaad6('0xd0')]){var _0x207c4b=[];if(_0x376cf2[_0xaad6('0x41')]){_0x207c4b=_0x376cf2[_0xaad6('0x2b')](function(_0x574266){return{'name':_0x574266[_0xaad6('0xc2')],'basename':_0x574266[_0xaad6('0x5f')],'type':_0x574266['mimetype'],'ChatOfflineMessageId':_0x15efac['id']};});}var _0x25fb76;if(!_['isNil'](_0x289d1f[_0xaad6('0xd1')])){var _0x5a14b5=_[_0xaad6('0x2b')](_0x4b0846[_0xaad6('0x42')],function(_0x53e550){return _0x53e550;});var _0x5a0e22=_[_0xaad6('0xd2')](_0x5a14b5)[0x0];var _0xb622a6=_[_0xaad6('0xd3')](_0x5a0e22,function(_0x413a75){return _0x413a75;});_0x25fb76=_0xb622a6[0x1][_0x289d1f[_0xaad6('0xd1')]];}var _0x4bc0ab={'from':_0x1ae190['email'],'firstName':_0x1ae190[_0xaad6('0x95')],'lastName':_0x1ae190[_0xaad6('0x96')],'mapKey':_0xaad6('0xd4'),'message':{'from':_0x1ae190['email'],'to':_0x289d1f[_0xaad6('0xbb')][_0xaad6('0xd4')],'cc':'','subject':_[_0xaad6('0x69')](_0x25fb76)?_0x289d1f[_0xaad6('0xd5')]:_0x25fb76,'messageId':'','sentAt':new Date(),'attach':_0x207c4b['length'],'attachments':_0x207c4b,'originChannel':_0xaad6('0xd6'),'ChatWebsiteId':_0x289d1f['id'],'ChatOfflineMessageId':_0x5d0299['id'],'originTo':_0x289d1f[_0xaad6('0xbb')][_0xaad6('0xd4')]},'body':_0x5d0299['body']};var _0x21133d={'account':{'id':_0x289d1f['MailAccountId']},'body':_0x4bc0ab,'log':_0xaad6('0xd7')};return respondWithRpcPromise(_0xaad6('0xd7'),'notifyMail',_0x21133d,client9001)['then'](function(){return _0x5d0299;})[_0xaad6('0x1a')](function(_0xc0ed1f){logger[_0xaad6('0x16')](_0xc0ed1f);});}return;})['then'](function(){if(_0x5d0299){return _0x5d0299;}})[_0xaad6('0x23')](respondWithResult(_0x5353b3,null))['catch'](function(_0x4bd03a){logger[_0xaad6('0x16')]('catch',_0x4bd03a);for(var _0x195ef3 of _0x376cf2){var _0x2a3378=path[_0xaad6('0x67')](config[_0xaad6('0x6b')],'server',_0xaad6('0xb7'),_0xaad6('0xc5'),'offline-chat',_0x195ef3[_0xaad6('0x5f')]);fs_extra['remove'](_0x2a3378)[_0xaad6('0x1a')](function(_0x2575f3){logger[_0xaad6('0x16')]('Could\x20not\x20remove\x20attachment\x20file',_0x2a3378,_0x2575f3);});}});};exports[_0xaad6('0xd8')]=function(_0x3c9240,_0x586d61){return db[_0xaad6('0xa1')][_0xaad6('0x4c')]({'where':{'id':_0x3c9240[_0xaad6('0x4d')]['id']}})[_0xaad6('0x23')](handleEntityNotFound(_0x586d61,null))['then'](function(_0xbf4d9c){if(_0xbf4d9c){return _0xbf4d9c[_0xaad6('0xd8')](_0x3c9240[_0xaad6('0x42')]['ids'],_[_0xaad6('0xd9')](_0x3c9240[_0xaad6('0x42')],['ids','id'])||{});}})[_0xaad6('0x23')](respondWithResult(_0x586d61,null))['catch'](handleError(_0x586d61,null));};exports[_0xaad6('0xda')]=function(_0x3337ef,_0x2c2fe4){var _0x18f441={'raw':![],'where':{}};var _0x5bf1cd={};var _0x54b1c5={'count':0x0,'rows':[]};return db[_0xaad6('0x3c')]['findOne']({'where':{'id':_0x3337ef['params']['id']}})[_0xaad6('0x23')](handleEntityNotFound(_0x2c2fe4,null))['then'](function(_0x3f4420){if(_0x3f4420){_0x5bf1cd['model']=_[_0xaad6('0x2e')](db[_0xaad6('0xa1')][_0xaad6('0x2c')]);_0x5bf1cd[_0xaad6('0x2f')]=_[_0xaad6('0x2e')](_0x3337ef[_0xaad6('0x2f')]);_0x5bf1cd[_0xaad6('0x30')]=_[_0xaad6('0x31')](_0x5bf1cd['model'],_0x5bf1cd[_0xaad6('0x2f')]);_0x18f441[_0xaad6('0x33')]=_[_0xaad6('0x31')](_0x5bf1cd[_0xaad6('0x32')],qs['fields'](_0x3337ef[_0xaad6('0x2f')][_0xaad6('0x34')]));_0x18f441[_0xaad6('0x33')]=_0x18f441['attributes'][_0xaad6('0x41')]?_0x18f441[_0xaad6('0x33')]:_0x5bf1cd[_0xaad6('0x32')];if(!_0x3337ef['query']['hasOwnProperty'](_0xaad6('0x53'))){_0x18f441[_0xaad6('0x1e')]=qs['limit'](_0x3337ef['query'][_0xaad6('0x1e')]);_0x18f441['offset']=qs['offset'](_0x3337ef[_0xaad6('0x2f')][_0xaad6('0x20')]);}_0x18f441[_0xaad6('0x54')]=qs[_0xaad6('0x36')](_0x3337ef['query'][_0xaad6('0x36')]);_0x18f441[_0xaad6('0x37')]=qs['filters'](_[_0xaad6('0x38')](_0x3337ef[_0xaad6('0x2f')],_0x5bf1cd[_0xaad6('0x30')]));_0x18f441['where'][_0xaad6('0x50')]=_0x3f4420['id'];if(_0x3337ef[_0xaad6('0x2f')]['filter']){_0x18f441[_0xaad6('0x37')]=_[_0xaad6('0x3b')](_0x18f441[_0xaad6('0x37')],{'$or':_[_0xaad6('0x2b')](_0x18f441['attributes'],function(_0x118699){var _0x260971={};_0x260971[_0x118699]={'$like':'%'+_0x3337ef['query'][_0xaad6('0x39')]+'%'};return _0x260971;})});}_0x18f441=_[_0xaad6('0x3b')]({},_0x18f441,_0x3337ef[_0xaad6('0x55')]);return db[_0xaad6('0xa1')][_0xaad6('0x1f')]({'where':_0x18f441[_0xaad6('0x37')]})[_0xaad6('0x23')](function(_0x485125){_0x54b1c5[_0xaad6('0x1f')]=_0x485125;if(_0x3337ef[_0xaad6('0x2f')][_0xaad6('0x3d')]){_0x18f441[_0xaad6('0x3e')]=[{'model':db[_0xaad6('0x79')],'as':_0xaad6('0xdb'),'required':![]},{'model':db[_0xaad6('0xaf')],'as':_0xaad6('0xdc'),'attributes':['name','fullname',_0xaad6('0xdd')],'required':![]},{'model':db['Tag'],'as':_0xaad6('0xde'),'attributes':['id',_0xaad6('0x26'),_0xaad6('0xdf')],'where':_0x3337ef[_0xaad6('0x2f')][_0xaad6('0xe0')]?{'id':_0x3337ef['query'][_0xaad6('0xe0')]}:undefined,'required':_0x3337ef['query']['tag']?!![]:![]}];}return db[_0xaad6('0xa1')]['findAll'](_0x18f441);})[_0xaad6('0x23')](function(_0x4d6f80){_0x54b1c5[_0xaad6('0x40')]=_0x4d6f80;return _0x54b1c5;});}})['then'](respondWithFilteredResult(_0x2c2fe4,_0x18f441))[_0xaad6('0x1a')](handleError(_0x2c2fe4,null));};function iftimePromise(_0x141b1e,_0x3dfc1a){return respondWithRpcPromise(_0xaad6('0xe1'),_0xaad6('0xe2'),{'command':_0x3dfc1a[_0xaad6('0xe3')]?util['format'](_0xaad6('0xe4'),_0x141b1e[_0xaad6('0xe5')],_0x3dfc1a[_0xaad6('0xe3')]):util[_0xaad6('0x9b')](_0xaad6('0xe6'),_0x141b1e[_0xaad6('0xe5')])},client9002)[_0xaad6('0x23')](function(_0x90ea9b){var _0x3106a2=_0x90ea9b&&_0x90ea9b[_0xaad6('0xe7')](_0xaad6('0xe8'))>=0x0?!![]:![];logger['info'](_0xaad6('0xe9'),_0x3dfc1a['id'],_0x141b1e['id'],_0x141b1e['interval'],_0x3106a2?_0xaad6('0xea'):'OFFLINE',_0x3dfc1a['timezone']?_0x3dfc1a[_0xaad6('0xe3')]:'No\x20timezone');return _0x3106a2;})[_0xaad6('0x1a')](function(_0x59b79c){logger[_0xaad6('0x16')](_0xaad6('0xe9'),_0x3dfc1a['id'],_0x141b1e['id'],_0x141b1e[_0xaad6('0xe5')],util[_0xaad6('0xeb')](_0x59b79c,{'showHidden':![],'depth':null}),_0x3dfc1a[_0xaad6('0xe3')]?_0x3dfc1a[_0xaad6('0xe3')]:_0xaad6('0xec'));return![];});}exports['getSnippet']=function(_0x1a7fd1,_0x55215c){var _0x126550=0x0;var _0x411204=0x0;var _0xe3bacb=![];var _0x53c2f1;var _0x2395bf;return db[_0xaad6('0x3c')][_0xaad6('0x4c')]({'where':{'id':_0x1a7fd1[_0xaad6('0x4d')]['id']},'include':[{'model':db[_0xaad6('0xed')],'as':'Interval','include':[{'model':db[_0xaad6('0xed')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0xaad6('0x23')](handleEntityNotFound(_0x55215c,null))[_0xaad6('0x23')](function(_0x48a5dc){if(_0x48a5dc){_0x53c2f1=_0x48a5dc;return _0x48a5dc[_0xaad6('0xee')]({'raw':!![]});}})[_0xaad6('0x23')](function(_0x21f593){if(_0x53c2f1){if(_0x21f593){_0x2395bf=_0x21f593;}}return require(_0xaad6('0xef'))[_0xaad6('0xf0')]();})[_0xaad6('0x23')](function(_0x1738c4){if(_0x1738c4){_0x411204=_0x1738c4[_0xaad6('0xf1')];_0xe3bacb=_0x1738c4[_0xaad6('0xf2')];}})['then'](function(){return db[_0xaad6('0xa1')][_0xaad6('0x1f')]({'where':{'closed':![]}});})['then'](function(_0x22f7fb){_0x126550=_0x22f7fb;if(_0x411204&&_0x22f7fb>_0x411204){return db[_0xaad6('0xf3')][_0xaad6('0x51')]({'where':{'id':0x1}})[_0xaad6('0x23')](function(_0x29e4e7){if(_0x29e4e7){_0x29e4e7[_0xaad6('0xf4')](_0xaad6('0xf5'));}});}})[_0xaad6('0x23')](function(){if(_0x53c2f1[_0xaad6('0xed')]&&_0x53c2f1[_0xaad6('0xed')]['Intervals']){var _0xb9fec0=[];for(var _0x3e451a=0x0;_0x3e451a<_0x53c2f1['Interval'][_0xaad6('0xf6')][_0xaad6('0x41')];_0x3e451a++){var _0x30abe2=_0x53c2f1['Interval']['Intervals'][_0x3e451a]['get']({'plain':!![]});_0xb9fec0[_0xaad6('0xf7')](iftimePromise(_0x30abe2,_0x53c2f1));}return BPromise[_0xaad6('0xf8')](_0xb9fec0)[_0xaad6('0x23')](function(_0x127328){return _[_0xaad6('0xf9')](_0x127328);});}else{return!![];}})['then'](function(_0x3735a7){var _0x5f449f=fs[_0xaad6('0xfa')](path[_0xaad6('0x67')](config['root'],'server/files/chat/iframe.ejs'),_0xaad6('0xbd'));var _0x951b0c=new url['URL'](_0x53c2f1[_0xaad6('0xfb')])['origin'];var _0x18715d='3.1.0';var _0x1714e8=![];var _0x4600ed={'chatVersion':_0x18715d,'chatWebsiteAddressOrigin':_0x951b0c,'remote':_0x53c2f1[_0xaad6('0xfc')],'query':querystring[_0xaad6('0xfd')](_[_0xaad6('0x3b')](_0x53c2f1[_0xaad6('0x44')]({'plain':!![]}),{'customerIp':_0x1a7fd1[_0xaad6('0x75')][_0xaad6('0x92')]||_0x1a7fd1['headers'][_0xaad6('0xfe')]||_0x1a7fd1[_0xaad6('0xff')]['remoteAddress']||_0x1a7fd1['ip'],'referer':_0x1a7fd1[_0xaad6('0x75')][_0xaad6('0x98')],'openedInteractions':_0x126550,'maxInteractions':_0x411204,'virtual':_0xe3bacb[_0xaad6('0xf1')],'online':_0x3735a7,'custom':_0xe3bacb}))[_0xaad6('0x100')](/'/g,'\x5c\x27')};_0x55215c[_0xaad6('0x27')](ejs['render'](Mustache['render'](_0x5f449f,_0x4600ed),{'proactiveActions':_0x2395bf,'alignment':_0x53c2f1[_0xaad6('0x101')],'verticalAlignment':_0x53c2f1[_0xaad6('0x102')],'div_color':_0x53c2f1[_0xaad6('0xdf')],'labelText':_0x53c2f1[_0xaad6('0x103')],'text_color':_0x53c2f1[_0xaad6('0x104')],'text_button_color':_0x53c2f1[_0xaad6('0x105')],'button_color':_0x53c2f1[_0xaad6('0x106')],'background_color':_0x53c2f1[_0xaad6('0x107')],'hideWhenOffline':_0x53c2f1[_0xaad6('0x108')],'intervalId':_0x53c2f1['IntervalId'],'isDevelopment':_0x1714e8,'chatVersion':_0x18715d}));})[_0xaad6('0x1a')](handleError(_0x55215c,null));};exports[_0xaad6('0x109')]=function(_0x42d4c3,_0x35db63){var _0x574d16=_0x42d4c3[_0xaad6('0x4d')]['id'];var _0x357217=_0x42d4c3[_0xaad6('0x42')];var _0x5deec1=0xc8;var _0x2f7c84=null;return db[_0xaad6('0x10a')]['transaction']({'isolationLevel':db[_0xaad6('0x10a')]['Transaction'][_0xaad6('0x10b')][_0xaad6('0x10c')]},function(_0x3832a1){return db[_0xaad6('0x3c')]['findOne']({'where':{'id':_0x574d16},'transaction':_0x3832a1})[_0xaad6('0x23')](function(_0x3b99d6){if(_0x3b99d6){return db[_0xaad6('0x8a')][_0xaad6('0x24')]({'where':{'ChatWebsiteId':_0x574d16},'transaction':_0x3832a1})[_0xaad6('0x23')](function(){var _0x39d6cb=_['map'](_0x357217,function(_0x533d62){_0x533d62[_0xaad6('0x50')]=_0x574d16;return _0x533d62;});return db[_0xaad6('0x8a')][_0xaad6('0xca')](_0x39d6cb,{'transaction':_0x3832a1});});}else{_0x5deec1=0x194;_0x2f7c84=[];}});})['then'](function(){if(_0x5deec1!==0x194){return db[_0xaad6('0x8a')][_0xaad6('0x10d')]({'where':{'ChatWebsiteId':_0x574d16},'order':'priority'})[_0xaad6('0x23')](function(_0x5c4063){_0x2f7c84=_0x5c4063;});}})['catch'](function(_0x487b61){_0x5deec1=0x1f4;logger[_0xaad6('0x16')](_0x487b61[_0xaad6('0x10e')]);if(_0x487b61[_0xaad6('0x26')]){delete _0x487b61[_0xaad6('0x26')];}_0x2f7c84=_0x487b61;})[_0xaad6('0x10f')](function(){if(_0x2f7c84===null){_0x35db63['sendStatus'](_0x5deec1);}else{if(_0x5deec1===0x1f4){_0x35db63[_0xaad6('0x1c')](_0x5deec1)[_0xaad6('0x27')](_0x2f7c84);}else{_0x35db63[_0xaad6('0x1c')](_0x5deec1)[_0xaad6('0x22')](_0x2f7c84);}}});};exports[_0xaad6('0x110')]=function(_0x58d307,_0x381fca){var _0x34b02b={};var _0x487dbe={};var _0x62770d;var _0x2755b9;return db[_0xaad6('0x3c')]['findOne']({'where':{'id':_0x58d307[_0xaad6('0x4d')]['id']}})[_0xaad6('0x23')](handleEntityNotFound(_0x381fca,null))[_0xaad6('0x23')](function(_0x4cb054){if(_0x4cb054){_0x62770d=_0x4cb054;_0x487dbe[_0xaad6('0x32')]=_['keys'](db[_0xaad6('0x8a')][_0xaad6('0x2c')]);_0x487dbe[_0xaad6('0x2f')]=_[_0xaad6('0x2e')](_0x58d307[_0xaad6('0x2f')]);_0x487dbe[_0xaad6('0x30')]=_['intersection'](_0x487dbe[_0xaad6('0x32')],_0x487dbe['query']);_0x34b02b[_0xaad6('0x33')]=_['intersection'](_0x487dbe[_0xaad6('0x32')],qs[_0xaad6('0x34')](_0x58d307[_0xaad6('0x2f')]['fields']));_0x34b02b[_0xaad6('0x33')]=_0x34b02b[_0xaad6('0x33')][_0xaad6('0x41')]?_0x34b02b[_0xaad6('0x33')]:_0x487dbe['model'];_0x34b02b[_0xaad6('0x54')]=qs[_0xaad6('0x36')](_0x58d307[_0xaad6('0x2f')][_0xaad6('0x36')]);_0x34b02b[_0xaad6('0x37')]=qs[_0xaad6('0x30')](_[_0xaad6('0x38')](_0x58d307['query'],_0x487dbe['filters']));if(_0x58d307[_0xaad6('0x2f')]['filter']){_0x34b02b['where']=_[_0xaad6('0x3b')](_0x34b02b[_0xaad6('0x37')],{'$or':_[_0xaad6('0x2b')](_0x34b02b[_0xaad6('0x33')],function(_0x2385fb){var _0x22a279={};_0x22a279[_0x2385fb]={'$like':'%'+_0x58d307[_0xaad6('0x2f')]['filter']+'%'};return _0x22a279;})});}_0x34b02b=_[_0xaad6('0x3b')]({},_0x34b02b,_0x58d307[_0xaad6('0x55')]);return _0x62770d[_0xaad6('0x110')](_0x34b02b);}})[_0xaad6('0x23')](function(_0x2be7a8){if(_0x2be7a8){_0x2755b9=_0x2be7a8[_0xaad6('0x41')];if(!_0x58d307[_0xaad6('0x2f')][_0xaad6('0x35')](_0xaad6('0x53'))){_0x34b02b[_0xaad6('0x1e')]=qs[_0xaad6('0x1e')](_0x58d307['query'][_0xaad6('0x1e')]);_0x34b02b['offset']=qs[_0xaad6('0x20')](_0x58d307[_0xaad6('0x2f')]['offset']);}return _0x62770d[_0xaad6('0x110')](_0x34b02b);}})[_0xaad6('0x23')](function(_0x58b325){if(_0x58b325){return _0x58b325?{'count':_0x2755b9,'rows':_0x58b325}:null;}})['then'](respondWithResult(_0x381fca,null))[_0xaad6('0x1a')](handleError(_0x381fca,null));};exports[_0xaad6('0x111')]=function(_0x2a3f8e,_0x527730){return db[_0xaad6('0x112')][_0xaad6('0x4c')]({'where':{'id':_0x2a3f8e['params']['id']}})['then'](handleEntityNotFound(_0x527730,null))[_0xaad6('0x23')](function(_0x1d5480){if(_0x1d5480){return _0x1d5480[_0xaad6('0x111')](_0x2a3f8e[_0xaad6('0x42')]['ids'],_[_0xaad6('0xd9')](_0x2a3f8e[_0xaad6('0x42')],[_0xaad6('0x57'),'id'])||{});}})[_0xaad6('0x23')](respondWithResult(_0x527730,null))[_0xaad6('0x1a')](handleError(_0x527730,null));};exports[_0xaad6('0xee')]=function(_0x719874,_0x512bb1){var _0x2928db={};var _0x154533={};var _0x131da4;var _0xc19528;return db[_0xaad6('0x3c')][_0xaad6('0x51')]({'where':{'id':_0x719874['params']['id']}})[_0xaad6('0x23')](handleEntityNotFound(_0x512bb1,null))['then'](function(_0x3743dc){if(_0x3743dc){_0x131da4=_0x3743dc;_0x154533[_0xaad6('0x32')]=_[_0xaad6('0x2e')](db[_0xaad6('0x113')][_0xaad6('0x2c')]);_0x154533[_0xaad6('0x2f')]=_[_0xaad6('0x2e')](_0x719874[_0xaad6('0x2f')]);_0x154533[_0xaad6('0x30')]=_[_0xaad6('0x31')](_0x154533[_0xaad6('0x32')],_0x154533[_0xaad6('0x2f')]);_0x2928db['attributes']=_[_0xaad6('0x31')](_0x154533[_0xaad6('0x32')],qs['fields'](_0x719874[_0xaad6('0x2f')][_0xaad6('0x34')]));_0x2928db['attributes']=_0x2928db[_0xaad6('0x33')][_0xaad6('0x41')]?_0x2928db[_0xaad6('0x33')]:_0x154533[_0xaad6('0x32')];_0x2928db[_0xaad6('0x54')]=qs['sort'](_0x719874[_0xaad6('0x2f')]['sort']);_0x2928db[_0xaad6('0x37')]=qs[_0xaad6('0x30')](_['pick'](_0x719874['query'],_0x154533['filters']));if(_0x719874['query'][_0xaad6('0x39')]){_0x2928db[_0xaad6('0x37')]=_[_0xaad6('0x3b')](_0x2928db[_0xaad6('0x37')],{'$or':_['map'](_0x2928db[_0xaad6('0x33')],function(_0x58f261){var _0x4fcc0d={};_0x4fcc0d[_0x58f261]={'$like':'%'+_0x719874['query']['filter']+'%'};return _0x4fcc0d;})});}_0x2928db=_['merge']({},_0x2928db,_0x719874[_0xaad6('0x55')]);return _0x131da4['getProactiveActions'](_0x2928db);}})['then'](function(_0x270c1e){if(_0x270c1e){_0xc19528=_0x270c1e[_0xaad6('0x41')];if(!_0x719874[_0xaad6('0x2f')][_0xaad6('0x35')](_0xaad6('0x53'))){_0x2928db['limit']=qs[_0xaad6('0x1e')](_0x719874[_0xaad6('0x2f')][_0xaad6('0x1e')]);_0x2928db[_0xaad6('0x20')]=qs[_0xaad6('0x20')](_0x719874['query'][_0xaad6('0x20')]);}return _0x131da4[_0xaad6('0xee')](_0x2928db);}})[_0xaad6('0x23')](function(_0x5ecfff){if(_0x5ecfff){return _0x5ecfff?{'count':_0xc19528,'rows':_0x5ecfff}:null;}})[_0xaad6('0x23')](respondWithResult(_0x512bb1,null))[_0xaad6('0x1a')](handleError(_0x512bb1,null));};exports[_0xaad6('0x114')]=function(_0x55cba6,_0x2c0733){var _0x1d767a=_0x55cba6[_0xaad6('0x2f')][_0xaad6('0x115')]===_0xaad6('0x116')?'offlineForm':_0xaad6('0x117');return db['ChatWebsite'][_0xaad6('0x4c')]({'attributes':['id',_0x1d767a],'where':{'id':_0x55cba6[_0xaad6('0x4d')]['id']}})[_0xaad6('0x23')](handleEntityNotFound(_0x2c0733,null))[_0xaad6('0x23')](function(_0x20141a){if(_0x20141a){var _0x10d859=_0x20141a[_0x1d767a];var _0x441084=_0x10d859&&_0x10d859[_0xaad6('0x118')]?_0x10d859[_0xaad6('0x118')]:[];_0x2c0733[_0xaad6('0x27')]({'fromKey':_[_0xaad6('0x69')](_0x10d859[_0xaad6('0x119')])?undefined:_0x10d859[_0xaad6('0x119')],'count':_0x441084['length'],'rows':_0x441084});}})['catch'](handleError(_0x2c0733,null));};exports[_0xaad6('0x11a')]=function(_0x846abf,_0x309761){var _0x233604={'raw':![],'where':{}};var _0x1aeee1={};var _0x483bf4={'count':0x0,'rows':[]};return db[_0xaad6('0x3c')][_0xaad6('0x51')]({'where':{'id':_0x846abf[_0xaad6('0x4d')]['id']}})[_0xaad6('0x23')](handleEntityNotFound(_0x309761,null))[_0xaad6('0x23')](function(_0x40ccb4){if(_0x40ccb4){_0x1aeee1[_0xaad6('0x32')]=_['keys'](db[_0xaad6('0x11b')][_0xaad6('0x2c')]);_0x1aeee1[_0xaad6('0x2f')]=_['keys'](_0x846abf[_0xaad6('0x2f')]);_0x1aeee1['filters']=_['intersection'](_0x1aeee1['model'],_0x1aeee1['query']);_0x233604[_0xaad6('0x33')]=_[_0xaad6('0x31')](_0x1aeee1[_0xaad6('0x32')],qs[_0xaad6('0x34')](_0x846abf[_0xaad6('0x2f')][_0xaad6('0x34')]));_0x233604['attributes']=_0x233604[_0xaad6('0x33')]['length']?_0x233604[_0xaad6('0x33')]:_0x1aeee1[_0xaad6('0x32')];if(!_0x846abf[_0xaad6('0x2f')][_0xaad6('0x35')]('nolimit')){_0x233604[_0xaad6('0x1e')]=qs['limit'](_0x846abf[_0xaad6('0x2f')][_0xaad6('0x1e')]);_0x233604['offset']=qs[_0xaad6('0x20')](_0x846abf[_0xaad6('0x2f')][_0xaad6('0x20')]);}_0x233604[_0xaad6('0x54')]=qs[_0xaad6('0x36')](_0x846abf[_0xaad6('0x2f')][_0xaad6('0x36')]);_0x233604[_0xaad6('0x37')]=qs[_0xaad6('0x30')](_[_0xaad6('0x38')](_0x846abf[_0xaad6('0x2f')],_0x1aeee1['filters']));_0x233604[_0xaad6('0x37')][_0xaad6('0x50')]=_0x40ccb4['id'];if(_0x846abf[_0xaad6('0x2f')]['filter']){_0x233604[_0xaad6('0x37')]=_[_0xaad6('0x3b')](_0x233604['where'],{'$or':_[_0xaad6('0x2b')](_0x233604[_0xaad6('0x33')],function(_0xe9b00a){var _0x3d3c1a={};_0x3d3c1a[_0xe9b00a]={'$like':'%'+_0x846abf[_0xaad6('0x2f')][_0xaad6('0x39')]+'%'};return _0x3d3c1a;})});}_0x233604=_[_0xaad6('0x3b')]({},_0x233604,_0x846abf['options']);return db[_0xaad6('0x11b')][_0xaad6('0x1f')]({'where':_0x233604[_0xaad6('0x37')]})[_0xaad6('0x23')](function(_0x38a40e){_0x483bf4[_0xaad6('0x1f')]=_0x38a40e;if(_0x846abf[_0xaad6('0x2f')][_0xaad6('0x3d')]){_0x233604[_0xaad6('0x3e')]=[{'all':!![]}];}else{_0x233604['include']=[{'model':db[_0xaad6('0x79')],'as':_0xaad6('0xdb'),'required':![]},{'model':db['Attachment'],'as':_0xaad6('0x11c'),'required':![]}];}return db[_0xaad6('0x11b')][_0xaad6('0x3f')](_0x233604);})['then'](function(_0x4fa8a6){_0x483bf4[_0xaad6('0x40')]=_0x4fa8a6;return _0x483bf4;});}})[_0xaad6('0x23')](respondWithFilteredResult(_0x309761,_0x233604))[_0xaad6('0x1a')](handleError(_0x309761,null));};exports[_0xaad6('0x11d')]=function(_0x1a412b,_0x6c241f){return db[_0xaad6('0x3c')][_0xaad6('0x4c')]({'where':{'id':_0x1a412b['params']['id']}})[_0xaad6('0x23')](handleEntityNotFound(_0x6c241f,null))['then'](function(_0x1d09da){if(_0x1d09da){return _0x1d09da[_0xaad6('0x11d')](_0x1a412b[_0xaad6('0x42')][_0xaad6('0x57')],_[_0xaad6('0xd9')](_0x1a412b[_0xaad6('0x42')],[_0xaad6('0x57'),'id'])||{})[_0xaad6('0xa5')](function(_0x50fe23){for(var _0x305c3a=0x0;_0x305c3a<_0x1a412b['body'][_0xaad6('0x57')][_0xaad6('0x41')];_0x305c3a+=0x1){socket[_0xaad6('0x11e')](_0xaad6('0x11f'),{'UserId':Number(_0x1a412b[_0xaad6('0x42')]['ids'][_0x305c3a]),'ChatWebsiteId':Number(_0x1a412b[_0xaad6('0x4d')]['id'])});}return _0x50fe23;});}})[_0xaad6('0x23')](respondWithResult(_0x6c241f,null))[_0xaad6('0x1a')](handleError(_0x6c241f,null));};exports['removeAgents']=function(_0x231284,_0x2f95f9){return db[_0xaad6('0x3c')][_0xaad6('0x4c')]({'where':{'id':_0x231284['params']['id']}})[_0xaad6('0x23')](handleEntityNotFound(_0x2f95f9,null))['then'](function(_0x19a890){if(_0x19a890){return _0x19a890['removeAgents'](_0x231284[_0xaad6('0x2f')][_0xaad6('0x57')])[_0xaad6('0x23')](function(){if(_[_0xaad6('0x120')](_0x231284[_0xaad6('0x2f')][_0xaad6('0x57')])){for(var _0x105376=0x0;_0x105376<_0x231284[_0xaad6('0x2f')][_0xaad6('0x57')][_0xaad6('0x41')];_0x105376+=0x1){socket[_0xaad6('0x11e')](_0xaad6('0x121'),{'UserId':Number(_0x231284[_0xaad6('0x2f')][_0xaad6('0x57')][_0x105376]),'ChatWebsiteId':Number(_0x231284[_0xaad6('0x4d')]['id'])});}}else{socket[_0xaad6('0x11e')](_0xaad6('0x121'),{'UserId':Number(_0x231284[_0xaad6('0x2f')][_0xaad6('0x57')]),'ChatWebsiteId':Number(_0x231284[_0xaad6('0x4d')]['id'])});}});}})[_0xaad6('0x23')](respondWithStatusCode(_0x2f95f9,null))['catch'](handleError(_0x2f95f9,null));};exports['getAgents']=function(_0xefb478,_0x29cb78){var _0x54f37c={};var _0x47e6a8={};var _0x5c6f10;var _0x4d453a;return db[_0xaad6('0x3c')][_0xaad6('0x51')]({'where':{'id':_0xefb478[_0xaad6('0x4d')]['id']}})[_0xaad6('0x23')](handleEntityNotFound(_0x29cb78,null))[_0xaad6('0x23')](function(_0x54901e){if(_0x54901e){_0x5c6f10=_0x54901e;_0x47e6a8[_0xaad6('0x32')]=_[_0xaad6('0x2e')](db[_0xaad6('0xaf')][_0xaad6('0x2c')]);_0x47e6a8[_0xaad6('0x2f')]=_[_0xaad6('0x2e')](_0xefb478[_0xaad6('0x2f')]);_0x47e6a8[_0xaad6('0x30')]=_['intersection'](_0x47e6a8[_0xaad6('0x32')],_0x47e6a8[_0xaad6('0x2f')]);_0x54f37c[_0xaad6('0x33')]=_[_0xaad6('0x31')](_0x47e6a8[_0xaad6('0x32')],qs[_0xaad6('0x34')](_0xefb478['query'][_0xaad6('0x34')]));_0x54f37c[_0xaad6('0x33')]=_0x54f37c['attributes'][_0xaad6('0x41')]?_0x54f37c[_0xaad6('0x33')]:_0x47e6a8['model'];_0x54f37c[_0xaad6('0x54')]=qs[_0xaad6('0x36')](_0xefb478[_0xaad6('0x2f')][_0xaad6('0x36')]);_0x54f37c[_0xaad6('0x37')]=qs[_0xaad6('0x30')](_['pick'](_0xefb478['query'],_0x47e6a8['filters']));if(_0xefb478[_0xaad6('0x2f')]['filter']){_0x54f37c[_0xaad6('0x37')]=_[_0xaad6('0x3b')](_0x54f37c[_0xaad6('0x37')],{'$or':_[_0xaad6('0x2b')](_0x54f37c['attributes'],function(_0x2a3a4d){var _0x48a8ac={};_0x48a8ac[_0x2a3a4d]={'$like':'%'+_0xefb478['query'][_0xaad6('0x39')]+'%'};return _0x48a8ac;})});}_0x54f37c=_[_0xaad6('0x3b')]({},_0x54f37c,_0xefb478[_0xaad6('0x55')]);return _0x5c6f10[_0xaad6('0x122')](_0x54f37c);}})[_0xaad6('0x23')](function(_0x178440){if(_0x178440){_0x4d453a=_0x178440[_0xaad6('0x41')];if(!_0xefb478[_0xaad6('0x2f')][_0xaad6('0x35')]('nolimit')){_0x54f37c[_0xaad6('0x1e')]=qs[_0xaad6('0x1e')](_0xefb478[_0xaad6('0x2f')][_0xaad6('0x1e')]);_0x54f37c['offset']=qs[_0xaad6('0x20')](_0xefb478['query'][_0xaad6('0x20')]);}return _0x5c6f10[_0xaad6('0x122')](_0x54f37c);}})[_0xaad6('0x23')](function(_0x2a8a6f){if(_0x2a8a6f){return _0x2a8a6f?{'count':_0x4d453a,'rows':_0x2a8a6f}:null;}})[_0xaad6('0x23')](respondWithResult(_0x29cb78,null))[_0xaad6('0x1a')](handleError(_0x29cb78,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 84917af..8eae7cd 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 _0x7da7=['remove','emit','hook','events','../../mysqldb','ChatWebsite','update'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7da7,0x10d));var _0x77da=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x7da7[_0x243b2f];return _0xcb3c2d;};'use strict';var EventEmitter=require(_0x77da('0x0'));var ChatWebsite=require(_0x77da('0x1'))['db'][_0x77da('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x77da('0x3'),'afterDestroy':_0x77da('0x4')};function emitEvent(_0x4f60c3){return function(_0x3a9fa6,_0x37b3d9,_0x56458c){ChatWebsiteEvents[_0x77da('0x5')](_0x4f60c3+':'+_0x3a9fa6['id'],_0x3a9fa6);ChatWebsiteEvents[_0x77da('0x5')](_0x4f60c3,_0x3a9fa6);_0x56458c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x77da('0x6')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x27bf=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','save','update','remove'];(function(_0x4ded65,_0xc8d7c1){var _0x5864fb=function(_0x40df9d){while(--_0x40df9d){_0x4ded65['push'](_0x4ded65['shift']());}};_0x5864fb(++_0xc8d7c1);}(_0x27bf,0x117));var _0xf27b=function(_0x4bd1de,_0x325c78){_0x4bd1de=_0x4bd1de-0x0;var _0xaeced4=_0x27bf[_0x4bd1de];return _0xaeced4;};'use strict';var EventEmitter=require(_0xf27b('0x0'));var ChatWebsite=require(_0xf27b('0x1'))['db'][_0xf27b('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf27b('0x3')](0x0);var events={'afterCreate':_0xf27b('0x4'),'afterUpdate':_0xf27b('0x5'),'afterDestroy':_0xf27b('0x6')};function emitEvent(_0x2ff64c){return function(_0x339bb9,_0x1542e3,_0x2e1396){ChatWebsiteEvents['emit'](_0x2ff64c+':'+_0x339bb9['id'],_0x339bb9);ChatWebsiteEvents[_0xf27b('0x7')](_0x2ff64c,_0x339bb9);_0x2e1396(null);};}for(var e in events){if(events[_0xf27b('0x8')](e)){var event=events[e];ChatWebsite[_0xf27b('0x9')](e,emitEvent(event));}}module[_0xf27b('0xa')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index ca1dfc4..abbc343 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 _0x83c0=['api','moment','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','chat_websites'];(function(_0x229f2f,_0x4e7bd3){var _0x46913a=function(_0x3b9283){while(--_0x3b9283){_0x229f2f['push'](_0x229f2f['shift']());}};_0x46913a(++_0x4e7bd3);}(_0x83c0,0x6c));var _0x083c=function(_0x441395,_0x432826){_0x441395=_0x441395-0x0;var _0x3b8eb2=_0x83c0[_0x441395];return _0x3b8eb2;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x083c('0x0'));var moment=require(_0x083c('0x1'));var BPromise=require('bluebird');var rp=require(_0x083c('0x2'));var fs=require('fs');var path=require(_0x083c('0x3'));var rimraf=require(_0x083c('0x4'));var config=require(_0x083c('0x5'));var attributes=require(_0x083c('0x6'));module[_0x083c('0x7')]=function(_0x19cbf0,_0x3b3076){return _0x19cbf0['define']('ChatWebsite',attributes,{'tableName':_0x083c('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8f4e=['chat_websites','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite'];(function(_0x5b81d2,_0x171d53){var _0x9d99ef=function(_0xec8974){while(--_0xec8974){_0x5b81d2['push'](_0x5b81d2['shift']());}};_0x9d99ef(++_0x171d53);}(_0x8f4e,0x169));var _0xe8f4=function(_0x21e42e,_0x3ee520){_0x21e42e=_0x21e42e-0x0;var _0x3c5888=_0x8f4e[_0x21e42e];return _0x3c5888;};'use strict';var _=require(_0xe8f4('0x0'));var util=require(_0xe8f4('0x1'));var logger=require(_0xe8f4('0x2'))(_0xe8f4('0x3'));var moment=require(_0xe8f4('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe8f4('0x5'));var config=require(_0xe8f4('0x6'));var attributes=require(_0xe8f4('0x7'));module[_0xe8f4('0x8')]=function(_0x57103a,_0x5edf1b){return _0x57103a[_0xe8f4('0x9')](_0xe8f4('0xa'),attributes,{'tableName':_0xe8f4('0xb'),'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 b85924f..db8e5c9 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 _0x41c7=['debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatWebsite,\x20%s,\x20%s','message','info','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x41c7,0x1e5));var _0x741c=function(_0x19c66b,_0x4cb7e2){_0x19c66b=_0x19c66b-0x0;var _0x2cc1d9=_0x41c7[_0x19c66b];return _0x2cc1d9;};'use strict';var _=require('lodash');var util=require(_0x741c('0x0'));var moment=require(_0x741c('0x1'));var BPromise=require(_0x741c('0x2'));var rs=require(_0x741c('0x3'));var fs=require('fs');var Redis=require(_0x741c('0x4'));var db=require(_0x741c('0x5'))['db'];var utils=require(_0x741c('0x6'));var logger=require(_0x741c('0x7'))(_0x741c('0x8'));var config=require(_0x741c('0x9'));var jayson=require(_0x741c('0xa'));var client=jayson[_0x741c('0xb')][_0x741c('0xc')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x741c('0xd'),'port':0x18eb});var socket=require(_0x741c('0xe'))(new Redis(config['redis']));require(_0x741c('0xf'))[_0x741c('0x10')](socket);function respondWithRpcPromise(_0x2e9c14,_0x4654d8,_0x503dd1){return new BPromise(function(_0x5c8c3a,_0x5c7b5b){return client[_0x741c('0x11')](_0x2e9c14,_0x503dd1)[_0x741c('0x12')](function(_0x575905){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4654d8,'request\x20sent');logger[_0x741c('0x13')](_0x741c('0x14'),_0x4654d8,_0x741c('0x15'),JSON['stringify'](_0x575905));if(_0x575905['error']){if(_0x575905[_0x741c('0x16')][_0x741c('0x17')]===0x1f4){logger['error'](_0x741c('0x18'),_0x4654d8,_0x575905[_0x741c('0x16')][_0x741c('0x19')]);return _0x5c7b5b(_0x575905[_0x741c('0x16')][_0x741c('0x19')]);}logger[_0x741c('0x16')](_0x741c('0x18'),_0x4654d8,_0x575905[_0x741c('0x16')][_0x741c('0x19')]);return _0x5c8c3a(_0x575905['error']['message']);}else{logger[_0x741c('0x1a')](_0x741c('0x18'),_0x4654d8,_0x741c('0x15'));_0x5c8c3a(_0x575905[_0x741c('0x1b')][_0x741c('0x19')]);}})['catch'](function(_0x2ecd23){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x4654d8,_0x2ecd23);_0x5c7b5b(_0x2ecd23);});});} \ No newline at end of file +var _0xfe74=['info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','then'];(function(_0x1a4b5e,_0x37550a){var _0x5145cc=function(_0x1ed405){while(--_0x1ed405){_0x1a4b5e['push'](_0x1a4b5e['shift']());}};_0x5145cc(++_0x37550a);}(_0xfe74,0x1c3));var _0x4fe7=function(_0x2185e8,_0x277e33){_0x2185e8=_0x2185e8-0x0;var _0x72984f=_0xfe74[_0x2185e8];return _0x72984f;};'use strict';var _=require(_0x4fe7('0x0'));var util=require(_0x4fe7('0x1'));var moment=require('moment');var BPromise=require(_0x4fe7('0x2'));var rs=require(_0x4fe7('0x3'));var fs=require('fs');var Redis=require(_0x4fe7('0x4'));var db=require(_0x4fe7('0x5'))['db'];var utils=require(_0x4fe7('0x6'));var logger=require(_0x4fe7('0x7'))('rpc');var config=require(_0x4fe7('0x8'));var jayson=require(_0x4fe7('0x9'));var client=jayson['client'][_0x4fe7('0xa')]({'port':0x232a});config[_0x4fe7('0xb')]=_[_0x4fe7('0xc')](config[_0x4fe7('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x4fe7('0xd'))(new Redis(config[_0x4fe7('0xb')]));require(_0x4fe7('0xe'))[_0x4fe7('0xf')](socket);function respondWithRpcPromise(_0x25402a,_0x20a22b,_0x4b34b5){return new BPromise(function(_0x3db4db,_0x736939){return client['request'](_0x25402a,_0x4b34b5)[_0x4fe7('0x10')](function(_0x1a56e9){logger[_0x4fe7('0x11')](_0x4fe7('0x12'),_0x20a22b,'request\x20sent');logger[_0x4fe7('0x13')](_0x4fe7('0x14'),_0x20a22b,'request\x20sent',JSON[_0x4fe7('0x15')](_0x1a56e9));if(_0x1a56e9['error']){if(_0x1a56e9[_0x4fe7('0x16')][_0x4fe7('0x17')]===0x1f4){logger['error'](_0x4fe7('0x12'),_0x20a22b,_0x1a56e9['error'][_0x4fe7('0x18')]);return _0x736939(_0x1a56e9[_0x4fe7('0x16')][_0x4fe7('0x18')]);}logger['error'](_0x4fe7('0x12'),_0x20a22b,_0x1a56e9[_0x4fe7('0x16')][_0x4fe7('0x18')]);return _0x3db4db(_0x1a56e9[_0x4fe7('0x16')]['message']);}else{logger['info'](_0x4fe7('0x12'),_0x20a22b,_0x4fe7('0x19'));_0x3db4db(_0x1a56e9['result'][_0x4fe7('0x18')]);}})['catch'](function(_0x45241c){logger[_0x4fe7('0x16')](_0x4fe7('0x12'),_0x20a22b,_0x45241c);_0x736939(_0x45241c);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 8ee5792..95d54e9 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 _0xf3b7=['emit','removeListener','register','length','./chatWebsite.events'];(function(_0x7fd20b,_0x440d27){var _0x1b94d8=function(_0x22b2b0){while(--_0x22b2b0){_0x7fd20b['push'](_0x7fd20b['shift']());}};_0x1b94d8(++_0x440d27);}(_0xf3b7,0x16c));var _0x7f3b=function(_0x1948c6,_0xe9c670){_0x1948c6=_0x1948c6-0x0;var _0x316cd0=_0xf3b7[_0x1948c6];return _0x316cd0;};'use strict';var ChatWebsiteEvents=require(_0x7f3b('0x0'));var events=['save','remove','update'];function createListener(_0x31969f,_0x2eb821){return function(_0x1ce13c){_0x2eb821[_0x7f3b('0x1')](_0x31969f,_0x1ce13c);};}function removeListener(_0x5032a1,_0x40919b){return function(){ChatWebsiteEvents[_0x7f3b('0x2')](_0x5032a1,_0x40919b);};}exports[_0x7f3b('0x3')]=function(_0x4665a3){for(var _0x36b784=0x0,_0x510dd1=events[_0x7f3b('0x4')];_0x36b784<_0x510dd1;_0x36b784++){var _0x12381b=events[_0x36b784];var _0x28bbb5=createListener('chatWebsite:'+_0x12381b,_0x4665a3);ChatWebsiteEvents['on'](_0x12381b,_0x28bbb5);}}; \ No newline at end of file +var _0x0f1f=['removeListener','./chatWebsite.events','save','remove','update','emit'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0x0f1f,0x10f));var _0xf0f1=function(_0x294726,_0x5db9e9){_0x294726=_0x294726-0x0;var _0x39e2e3=_0x0f1f[_0x294726];return _0x39e2e3;};'use strict';var ChatWebsiteEvents=require(_0xf0f1('0x0'));var events=[_0xf0f1('0x1'),_0xf0f1('0x2'),_0xf0f1('0x3')];function createListener(_0x1277ae,_0x36c3be){return function(_0x42d811){_0x36c3be[_0xf0f1('0x4')](_0x1277ae,_0x42d811);};}function removeListener(_0x28d3f2,_0x232a3a){return function(){ChatWebsiteEvents[_0xf0f1('0x5')](_0x28d3f2,_0x232a3a);};}exports['register']=function(_0x4620be){for(var _0x58b684=0x0,_0x5148e6=events['length'];_0x58b684<_0x5148e6;_0x58b684++){var _0x305398=events[_0x58b684];var _0x179d1e=createListener('chatWebsite:'+_0x305398,_0x4620be);ChatWebsiteEvents['on'](_0x305398,_0x179d1e);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index cbe0c14..5fc41ad 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 _0x745c=['/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','post','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','now','originalname','single','file','addLogo','server/files/images/avatars/','%s-%s','addAvatar','addSystemAvatar','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','addApplications','/:id/proactive_actions','addAgents','put','delete','destroy','removeDispositions','removeAnswers','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x745c,0x75));var _0xc745=function(_0x20d8d3,_0x118ad0){_0x20d8d3=_0x20d8d3-0x0;var _0x7c229e=_0x745c[_0x20d8d3];return _0x7c229e;};'use strict';var multer=require(_0xc745('0x0'));var util=require('util');var path=require(_0xc745('0x1'));var timeout=require(_0xc745('0x2'));var express=require('express');var router=express[_0xc745('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc745('0x4'));var interaction=require(_0xc745('0x5'));var config=require(_0xc745('0x6'));var controller=require('./chatWebsite.controller');router['get']('/',auth[_0xc745('0x7')](),controller[_0xc745('0x8')]);router['get'](_0xc745('0x9'),auth[_0xc745('0x7')](),controller[_0xc745('0xa')]);router[_0xc745('0xb')](_0xc745('0xc'),auth['isAuthenticated'](),controller[_0xc745('0xd')]);router['get'](_0xc745('0xe'),auth[_0xc745('0x7')](),controller[_0xc745('0xf')]);router[_0xc745('0xb')](_0xc745('0x10'),auth[_0xc745('0x7')](),controller[_0xc745('0x11')]);router[_0xc745('0xb')](_0xc745('0x12'),controller['getLogo']);router[_0xc745('0xb')](_0xc745('0x13'),controller[_0xc745('0x14')]);router['get'](_0xc745('0x15'),controller[_0xc745('0x16')]);router[_0xc745('0xb')](_0xc745('0x17'),controller['getSystemAvatar']);router[_0xc745('0xb')](_0xc745('0x18'),auth[_0xc745('0x7')](),controller[_0xc745('0x19')]);router[_0xc745('0xb')](_0xc745('0x1a'),controller['getSnippet']);router[_0xc745('0xb')](_0xc745('0x1b'),auth[_0xc745('0x7')](),controller[_0xc745('0x1c')]);router[_0xc745('0xb')]('/:id/proactive_actions',auth[_0xc745('0x7')](),controller[_0xc745('0x1d')]);router[_0xc745('0xb')](_0xc745('0x1e'),controller['getFields']);router[_0xc745('0xb')](_0xc745('0x1f'),auth['isAuthenticated'](),controller[_0xc745('0x20')]);router[_0xc745('0xb')](_0xc745('0x21'),auth[_0xc745('0x7')](),controller['getAgents']);router[_0xc745('0x22')]('/',auth[_0xc745('0x7')](),controller['create']);router[_0xc745('0x22')](_0xc745('0xe'),auth[_0xc745('0x7')](),controller[_0xc745('0x23')]);router[_0xc745('0x22')](_0xc745('0x10'),auth[_0xc745('0x7')](),controller[_0xc745('0x24')]);var upload=multer({'storage':multer[_0xc745('0x25')]({'destination':function(_0x5c794a,_0x1f7b6b,_0x461b28){_0x461b28(null,path[_0xc745('0x26')](config[_0xc745('0x27')],_0xc745('0x28')));},'filename':function(_0x530c05,_0x2478b5,_0x4fb0a7){_0x4fb0a7(null,util[_0xc745('0x29')]('%s-%s',Date[_0xc745('0x2a')](),_0x2478b5[_0xc745('0x2b')]));}})});router[_0xc745('0x22')]('/:id/logo',upload[_0xc745('0x2c')](_0xc745('0x2d')),controller[_0xc745('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xbdea62,_0x46d333,_0x342d64){_0x342d64(null,path[_0xc745('0x26')](config[_0xc745('0x27')],_0xc745('0x2f')));},'filename':function(_0xbe1911,_0x1e20f3,_0x501fd4){_0x501fd4(null,util[_0xc745('0x29')](_0xc745('0x30'),Date['now'](),_0x1e20f3['originalname']));}})});router[_0xc745('0x22')]('/:id/avatar',upload[_0xc745('0x2c')](_0xc745('0x2d')),controller[_0xc745('0x31')]);var upload=multer({'storage':multer[_0xc745('0x25')]({'destination':function(_0x17be7d,_0x3c70ca,_0x4f1c8d){_0x4f1c8d(null,path[_0xc745('0x26')](config[_0xc745('0x27')],_0xc745('0x2f')));},'filename':function(_0x3b0c61,_0x13a4c8,_0x489312){_0x489312(null,util[_0xc745('0x29')](_0xc745('0x30'),Date[_0xc745('0x2a')](),_0x13a4c8['originalname']));}})});router[_0xc745('0x22')](_0xc745('0x15'),upload[_0xc745('0x2c')](_0xc745('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xc745('0x25')]({'destination':function(_0x2c0586,_0x3b62b4,_0xedfb9f){_0xedfb9f(null,path[_0xc745('0x26')](config[_0xc745('0x27')],'server/files/images/avatars/'));},'filename':function(_0xed3b15,_0x24b038,_0x407e1a){_0x407e1a(null,util['format'](_0xc745('0x30'),Date[_0xc745('0x2a')](),_0x24b038[_0xc745('0x2b')]));}})});router['post'](_0xc745('0x17'),upload[_0xc745('0x2c')](_0xc745('0x2d')),controller[_0xc745('0x32')]);router[_0xc745('0x22')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xc745('0x25')]({'destination':function(_0x16bf11,_0x39f988,_0x26eeb5){const _0x428709=path[_0xc745('0x26')](config[_0xc745('0x27')],_0xc745('0x33'),_0xc745('0x34'),_0xc745('0x35'));fs_extra[_0xc745('0x36')](_0x428709,function(){_0x26eeb5(null,_0x428709);});},'filename':function(_0x31915e,_0x4968ce,_0x8583ba){const _0x1c83e6=_0x4968ce[_0xc745('0x2b')][_0xc745('0x37')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x5c2a17=path[_0xc745('0x38')](_0x1c83e6);const _0x5888a9=Date[_0xc745('0x2a')]()+'-'+_0x1c83e6[_0xc745('0x37')](_0x5c2a17,'')+_0x5c2a17;_0x8583ba(null,_0x5888a9);}})});router[_0xc745('0x22')](_0xc745('0x39'),offlineUploadMulter[_0xc745('0x3a')](),controller['offline']);router[_0xc745('0x22')]('/:id/interactions',auth[_0xc745('0x7')](),controller['addInteraction']);router[_0xc745('0x22')](_0xc745('0x1b'),auth[_0xc745('0x7')](),controller[_0xc745('0x3b')]);router[_0xc745('0x22')](_0xc745('0x3c'),auth[_0xc745('0x7')](),controller['addProactiveActions']);router['post']('/:id/users',auth[_0xc745('0x7')](),controller[_0xc745('0x3d')]);router[_0xc745('0x3e')]('/:id',auth[_0xc745('0x7')](),controller['update']);router[_0xc745('0x3f')]('/:id',auth[_0xc745('0x7')](),controller[_0xc745('0x40')]);router[_0xc745('0x3f')](_0xc745('0xe'),auth[_0xc745('0x7')](),controller[_0xc745('0x41')]);router['delete'](_0xc745('0x10'),auth[_0xc745('0x7')](),controller[_0xc745('0x42')]);router['delete']('/:id/users',auth[_0xc745('0x7')](),controller['removeAgents']);module[_0xc745('0x43')]=router; \ No newline at end of file +var _0x7766=['getOfflineMessages','post','create','addDisposition','addAnswer','root','format','%s-%s','now','originalname','/:id/logo','single','file','addLogo','join','server/files/images/avatars/','diskStorage','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','extname','replace','/:id/offline','any','offline','addApplications','addProactiveActions','put','/:id','update','delete','destroy','removeDispositions','/:id/users','multer','util','path','express','Router','fs-extra','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getFields','/:id/offline_messages'];(function(_0x2274ed,_0x5cc62d){var _0xf9c7cf=function(_0x32f8cf){while(--_0x32f8cf){_0x2274ed['push'](_0x2274ed['shift']());}};_0xf9c7cf(++_0x5cc62d);}(_0x7766,0xad));var _0x6776=function(_0x5e0ca0,_0x3f3560){_0x5e0ca0=_0x5e0ca0-0x0;var _0x3dd119=_0x7766[_0x5e0ca0];return _0x3dd119;};'use strict';var multer=require(_0x6776('0x0'));var util=require(_0x6776('0x1'));var path=require(_0x6776('0x2'));var timeout=require('connect-timeout');var express=require(_0x6776('0x3'));var router=express[_0x6776('0x4')]();var fs_extra=require(_0x6776('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./chatWebsite.controller');router[_0x6776('0x6')]('/',auth[_0x6776('0x7')](),controller[_0x6776('0x8')]);router[_0x6776('0x6')](_0x6776('0x9'),auth[_0x6776('0x7')](),controller[_0x6776('0xa')]);router[_0x6776('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x6776('0xb')]);router[_0x6776('0x6')](_0x6776('0xc'),auth[_0x6776('0x7')](),controller[_0x6776('0xd')]);router[_0x6776('0x6')](_0x6776('0xe'),auth[_0x6776('0x7')](),controller[_0x6776('0xf')]);router[_0x6776('0x6')]('/:id/logo',controller[_0x6776('0x10')]);router[_0x6776('0x6')](_0x6776('0x11'),controller[_0x6776('0x12')]);router[_0x6776('0x6')](_0x6776('0x13'),controller[_0x6776('0x14')]);router[_0x6776('0x6')](_0x6776('0x15'),controller[_0x6776('0x16')]);router[_0x6776('0x6')](_0x6776('0x17'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x6776('0x6')](_0x6776('0x18'),controller[_0x6776('0x19')]);router[_0x6776('0x6')](_0x6776('0x1a'),auth[_0x6776('0x7')](),controller[_0x6776('0x1b')]);router['get'](_0x6776('0x1c'),auth[_0x6776('0x7')](),controller['getProactiveActions']);router['get']('/:id/fields',controller[_0x6776('0x1d')]);router[_0x6776('0x6')](_0x6776('0x1e'),auth[_0x6776('0x7')](),controller[_0x6776('0x1f')]);router[_0x6776('0x6')]('/:id/users',auth[_0x6776('0x7')](),controller['getAgents']);router[_0x6776('0x20')]('/',auth[_0x6776('0x7')](),controller[_0x6776('0x21')]);router['post'](_0x6776('0xc'),auth[_0x6776('0x7')](),controller[_0x6776('0x22')]);router[_0x6776('0x20')](_0x6776('0xe'),auth[_0x6776('0x7')](),controller[_0x6776('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x59557e,_0xfdac4f,_0x4a9f52){_0x4a9f52(null,path['join'](config[_0x6776('0x24')],'server/files/images/logos/'));},'filename':function(_0x56881d,_0x2580de,_0x20981e){_0x20981e(null,util[_0x6776('0x25')](_0x6776('0x26'),Date[_0x6776('0x27')](),_0x2580de[_0x6776('0x28')]));}})});router[_0x6776('0x20')](_0x6776('0x29'),upload[_0x6776('0x2a')](_0x6776('0x2b')),controller[_0x6776('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x482f30,_0x3a7232,_0x4f8919){_0x4f8919(null,path[_0x6776('0x2d')](config[_0x6776('0x24')],_0x6776('0x2e')));},'filename':function(_0x14a01f,_0x5cee19,_0x435bd1){_0x435bd1(null,util[_0x6776('0x25')](_0x6776('0x26'),Date[_0x6776('0x27')](),_0x5cee19['originalname']));}})});router['post'](_0x6776('0x11'),upload[_0x6776('0x2a')](_0x6776('0x2b')),controller['addAvatar']);var upload=multer({'storage':multer[_0x6776('0x2f')]({'destination':function(_0x12d91f,_0x446fed,_0xde4223){_0xde4223(null,path[_0x6776('0x2d')](config[_0x6776('0x24')],'server/files/images/avatars/'));},'filename':function(_0x5b204a,_0x1cc6f4,_0x14dd32){_0x14dd32(null,util['format'](_0x6776('0x26'),Date[_0x6776('0x27')](),_0x1cc6f4[_0x6776('0x28')]));}})});router['post'](_0x6776('0x13'),upload[_0x6776('0x2a')](_0x6776('0x2b')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x6776('0x2f')]({'destination':function(_0x2be896,_0x353203,_0x30f6ee){_0x30f6ee(null,path[_0x6776('0x2d')](config[_0x6776('0x24')],_0x6776('0x2e')));},'filename':function(_0x4f6311,_0x16a76e,_0x4d8df2){_0x4d8df2(null,util['format'](_0x6776('0x26'),Date[_0x6776('0x27')](),_0x16a76e[_0x6776('0x28')]));}})});router['post'](_0x6776('0x15'),upload[_0x6776('0x2a')](_0x6776('0x2b')),controller[_0x6776('0x30')]);router[_0x6776('0x20')](_0x6776('0x31'),controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x4d3c40,_0x6b4cd8,_0x447f17){const _0x1424f8=path[_0x6776('0x2d')](config[_0x6776('0x24')],_0x6776('0x32'),_0x6776('0x33'),_0x6776('0x34'));fs_extra[_0x6776('0x35')](_0x1424f8,function(){_0x447f17(null,_0x1424f8);});},'filename':function(_0x22c447,_0x21c265,_0x3c193a){const _0x47d406=_0x21c265['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x44dfe6=path[_0x6776('0x36')](_0x47d406);const _0x34eca8=Date[_0x6776('0x27')]()+'-'+_0x47d406[_0x6776('0x37')](_0x44dfe6,'')+_0x44dfe6;_0x3c193a(null,_0x34eca8);}})});router[_0x6776('0x20')](_0x6776('0x38'),offlineUploadMulter[_0x6776('0x39')](),controller[_0x6776('0x3a')]);router['post']('/:id/interactions',auth[_0x6776('0x7')](),controller['addInteraction']);router[_0x6776('0x20')](_0x6776('0x1a'),auth[_0x6776('0x7')](),controller[_0x6776('0x3b')]);router['post']('/:id/proactive_actions',auth[_0x6776('0x7')](),controller[_0x6776('0x3c')]);router[_0x6776('0x20')]('/:id/users',auth[_0x6776('0x7')](),controller['addAgents']);router[_0x6776('0x3d')](_0x6776('0x3e'),auth[_0x6776('0x7')](),controller[_0x6776('0x3f')]);router[_0x6776('0x40')](_0x6776('0x3e'),auth[_0x6776('0x7')](),controller[_0x6776('0x41')]);router[_0x6776('0x40')](_0x6776('0xc'),auth[_0x6776('0x7')](),controller[_0x6776('0x42')]);router[_0x6776('0x40')](_0x6776('0xe'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0x6776('0x43'),auth[_0x6776('0x7')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js index 626a56e..ddbc0e1 100644 --- a/server/api/client-side-logs.js +++ b/server/api/client-side-logs.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x47c0=['expressEndpoint','/client-logs','isAuthenticated','exports','beaver-logger/server','../config/environment','Router','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x2c24ba,_0x3d089f){var _0xd68a3=function(_0x41a345){while(--_0x41a345){_0x2c24ba['push'](_0x2c24ba['shift']());}};_0xd68a3(++_0x3d089f);}(_0x47c0,0xa9));var _0x047c=function(_0x190674,_0x457608){_0x190674=_0x190674-0x0;var _0x3914c7=_0x47c0[_0x190674];return _0x3914c7;};var beaverLogger=require(_0x047c('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require(_0x047c('0x1'));var router=express[_0x047c('0x2')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x468c93,_0x199ee2,_0x47b3d9){var _0x59cafa=_0x468c93[_0x047c('0x3')][_0x047c('0x4')](_0x047c('0x5'));if(!_0x59cafa){throw new Error(_0x047c('0x6'));}return beaverLogger[_0x047c('0x7')]({'uri':_0x047c('0x8'),'logger':_0x59cafa,'enableCors':!isProduction})(_0x468c93,_0x199ee2,_0x47b3d9);}router['use'](auth[_0x047c('0x9')](),clientSideLogs);module[_0x047c('0xa')]=router; \ No newline at end of file +var _0xbb1c=['/client-logs','use','isAuthenticated','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint'];(function(_0x1f2891,_0x4f436c){var _0x334493=function(_0x49801f){while(--_0x49801f){_0x1f2891['push'](_0x1f2891['shift']());}};_0x334493(++_0x4f436c);}(_0xbb1c,0x199));var _0xcbb1=function(_0x5a9c87,_0x11c8bc){_0x5a9c87=_0x5a9c87-0x0;var _0x33ed72=_0xbb1c[_0x5a9c87];return _0x33ed72;};var beaverLogger=require(_0xcbb1('0x0'));var express=require(_0xcbb1('0x1'));var auth=require(_0xcbb1('0x2'));var config=require(_0xcbb1('0x3'));var router=express[_0xcbb1('0x4')]();var isProduction=config['env']===_0xcbb1('0x5')||![];function clientSideLogs(_0xad863b,_0x510445,_0x386059){var _0x19a3bb=_0xad863b[_0xcbb1('0x6')][_0xcbb1('0x7')](_0xcbb1('0x8'));if(!_0x19a3bb){throw new Error(_0xcbb1('0x9'));}return beaverLogger[_0xcbb1('0xa')]({'uri':_0xcbb1('0xb'),'logger':_0x19a3bb,'enableCors':!isProduction})(_0xad863b,_0x510445,_0x386059);}router[_0xcbb1('0xc')](auth[_0xcbb1('0xd')](),clientSideLogs);module[_0xcbb1('0xe')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index c067442..263551b 100644 --- a/server/api/cloudProvider/cloudProvider.attributes.js +++ b/server/api/cloudProvider/cloudProvider.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xad65=['MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT'];(function(_0x5e2a0f,_0x447ab4){var _0x3e8c10=function(_0x56dd4e){while(--_0x56dd4e){_0x5e2a0f['push'](_0x5e2a0f['shift']());}};_0x3e8c10(++_0x447ab4);}(_0xad65,0xdf));var _0x5ad6=function(_0x527354,_0x1e0a5b){_0x527354=_0x527354-0x0;var _0xc1f444=_0xad65[_0x527354];return _0xc1f444;};'use strict';var Sequelize=require(_0x5ad6('0x0'));module[_0x5ad6('0x1')]={'name':{'type':Sequelize[_0x5ad6('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x5ad6('0x3')]('AmazonAWS','Google',_0x5ad6('0x4')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x5ad6('0x5'),_0x5ad6('0x6'))},'data1':{'type':Sequelize[_0x5ad6('0x2')],'comment':_0x5ad6('0x7')},'data2':{'type':Sequelize[_0x5ad6('0x2')],'comment':_0x5ad6('0x8')},'data3':{'type':Sequelize[_0x5ad6('0x2')],'comment':_0x5ad6('0x9')},'data4':{'type':Sequelize[_0x5ad6('0x2')],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x5ad6('0xa')],'comment':_0x5ad6('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x5ad6('0xa')],'comment':_0x5ad6('0xc')}}; \ No newline at end of file +var _0xf72a=['Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','sequelize','STRING','AmazonAWS','MicrosoftAzure'];(function(_0x282ccc,_0x5d66a1){var _0x27c2dd=function(_0x58431a){while(--_0x58431a){_0x282ccc['push'](_0x282ccc['shift']());}};_0x27c2dd(++_0x5d66a1);}(_0xf72a,0xd4));var _0xaf72=function(_0x4d451c,_0x4b228d){_0x4d451c=_0x4d451c-0x0;var _0x5aac97=_0xf72a[_0x4d451c];return _0x5aac97;};'use strict';var Sequelize=require(_0xaf72('0x0'));module['exports']={'name':{'type':Sequelize[_0xaf72('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize['ENUM'](_0xaf72('0x2'),'Google',_0xaf72('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xaf72('0x4'),_0xaf72('0x5'))},'data1':{'type':Sequelize[_0xaf72('0x1')],'comment':_0xaf72('0x6')},'data2':{'type':Sequelize['STRING'],'comment':_0xaf72('0x7')},'data3':{'type':Sequelize[_0xaf72('0x1')],'comment':_0xaf72('0x8')},'data4':{'type':Sequelize['STRING'],'comment':_0xaf72('0x9')},'data5':{'type':Sequelize[_0xaf72('0xa')],'comment':_0xaf72('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 05971cf..d6dc73d 100644 --- a/server/api/cloudProvider/cloudProvider.controller.js +++ b/server/api/cloudProvider/cloudProvider.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe58d=['MicrosoftAzure','decryptString','data3','catch','show','params','rawAttributes','includeAll','create','body','values','includes','find','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','error','get','state','Invalid\x20state\x20parameter','parse','from','base64','ascii','isValidIdToken','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','update','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','then','destroy','stack','name','index','map','CloudProvider','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xe58d,0x139));var _0xde58=function(_0x1ed7e7,_0x546a7f){_0x1ed7e7=_0x1ed7e7-0x0;var _0xc8da5=_0xe58d[_0x1ed7e7];return _0xc8da5;};'use strict';var _=require(_0xde58('0x0'));var Redis=require('ioredis');var qs=require(_0xde58('0x1'));var encryptor=require(_0xde58('0x2'));var config=require(_0xde58('0x3'));var logger=require(_0xde58('0x4'))(_0xde58('0x5'));var db=require(_0xde58('0x6'))['db'];var oauth=require(_0xde58('0x7'));config[_0xde58('0x8')]=_['defaults'](config[_0xde58('0x8')],{'host':_0xde58('0x9'),'port':0x18eb});var socket=require(_0xde58('0xa'))(new Redis(config[_0xde58('0x8')]));var redis=new Redis(config[_0xde58('0x8')]);function respondWithStatusCode(_0x45cfce,_0x565356){_0x565356=_0x565356||0xcc;return function(_0xbf0ad7){if(_0xbf0ad7){return _0x45cfce[_0xde58('0xb')](_0x565356);}return _0x45cfce[_0xde58('0xc')](_0x565356)[_0xde58('0xd')]();};}function respondWithResult(_0x3e4b6c,_0x2d24cd){_0x2d24cd=_0x2d24cd||0xc8;return function(_0x3507b8){if(_0x3507b8){return _0x3e4b6c[_0xde58('0xc')](_0x2d24cd)[_0xde58('0xe')](_0x3507b8);}};}function respondWithFilteredResult(_0x540ffb,_0x53fab9){return function(_0x528c9d){if(_0x528c9d){var _0x3affcd=typeof _0x53fab9[_0xde58('0xf')]===_0xde58('0x10')&&typeof _0x53fab9[_0xde58('0x11')]==='undefined';var _0x2a4891=_0x528c9d['count'];var _0x252591=_0x3affcd?0x0:_0x53fab9['offset'];var _0x47ca7f=_0x3affcd?_0x528c9d[_0xde58('0x12')]:_0x53fab9[_0xde58('0xf')]+_0x53fab9[_0xde58('0x11')];var _0x5d844b;if(_0x47ca7f>=_0x2a4891){_0x47ca7f=_0x2a4891;_0x5d844b=0xc8;}else{_0x5d844b=0xce;}_0x540ffb[_0xde58('0xc')](_0x5d844b);return _0x540ffb[_0xde58('0x13')](_0xde58('0x14'),_0x252591+'-'+_0x47ca7f+'/'+_0x2a4891)[_0xde58('0xe')](_0x528c9d);}return null;};}function saveUpdates(_0x5f2e43){return function(_0xdc9a){if(_0xdc9a){return _0xdc9a['update'](_0x5f2e43)[_0xde58('0x15')](function(_0x23dfbf){return _0x23dfbf;});}return null;};}function removeEntity(_0x23e70d){return function(_0x1d988d){if(_0x1d988d){return _0x1d988d[_0xde58('0x16')]()['then'](function(){_0x23e70d[_0xde58('0xc')](0xcc)[_0xde58('0xd')]();});}};}function handleEntityNotFound(_0x5385a2){return function(_0x2451b0){if(!_0x2451b0){_0x5385a2[_0xde58('0xb')](0x194);}return _0x2451b0;};}function handleError(_0x48c587,_0x31d017){_0x31d017=_0x31d017||0x1f4;return function(_0x54f7aa){logger['error'](_0x54f7aa[_0xde58('0x17')]);if(_0x54f7aa[_0xde58('0x18')]){delete _0x54f7aa[_0xde58('0x18')];}_0x48c587['status'](_0x31d017)['send'](_0x54f7aa);};}function maskClientSecret(_0x5d1f67){return _['padEnd'](_0x5d1f67['slice'](0x0,0x3),0x14,'*');}exports[_0xde58('0x19')]=function(_0x2b6eeb,_0x4d7792){var _0x204557={},_0x2abf4f={},_0x162c35={'count':0x0,'rows':[]};var _0x297da8=_[_0xde58('0x1a')](db[_0xde58('0x1b')]['rawAttributes'],function(_0x33241b){return{'name':_0x33241b[_0xde58('0x1c')],'type':_0x33241b[_0xde58('0x1d')]['key']};});_0x2abf4f[_0xde58('0x1e')]=_[_0xde58('0x1a')](_0x297da8,'name');_0x2abf4f[_0xde58('0x1f')]=_[_0xde58('0x20')](_0x2b6eeb[_0xde58('0x1f')]);_0x2abf4f[_0xde58('0x21')]=_[_0xde58('0x22')](_0x2abf4f[_0xde58('0x1e')],_0x2abf4f[_0xde58('0x1f')]);_0x204557[_0xde58('0x23')]=_[_0xde58('0x22')](_0x2abf4f[_0xde58('0x1e')],qs[_0xde58('0x24')](_0x2b6eeb[_0xde58('0x1f')]['fields']));_0x204557[_0xde58('0x23')]=_0x204557['attributes'][_0xde58('0x25')]?_0x204557[_0xde58('0x23')]:_0x2abf4f[_0xde58('0x1e')];if(!_0x2b6eeb[_0xde58('0x1f')][_0xde58('0x26')](_0xde58('0x27'))){_0x204557[_0xde58('0x11')]=qs[_0xde58('0x11')](_0x2b6eeb[_0xde58('0x1f')][_0xde58('0x11')]);_0x204557[_0xde58('0xf')]=qs[_0xde58('0xf')](_0x2b6eeb['query'][_0xde58('0xf')]);}_0x204557[_0xde58('0x28')]=qs['sort'](_0x2b6eeb[_0xde58('0x1f')][_0xde58('0x29')]);_0x204557[_0xde58('0x2a')]=qs[_0xde58('0x21')](_[_0xde58('0x2b')](_0x2b6eeb['query'],_0x2abf4f[_0xde58('0x21')]),_0x297da8);if(_0x2b6eeb[_0xde58('0x1f')][_0xde58('0x2c')]){_0x204557[_0xde58('0x2a')]=_[_0xde58('0x2d')](_0x204557[_0xde58('0x2a')],{'$or':_['map'](_0x297da8,function(_0x3ee583){if(_0x3ee583[_0xde58('0x1d')]!==_0xde58('0x2e')){var _0x5c3321={};_0x5c3321[_0x3ee583[_0xde58('0x18')]]={'$like':'%'+_0x2b6eeb['query']['filter']+'%'};return _0x5c3321;}})});}_0x204557=_['merge']({},_0x204557,_0x2b6eeb[_0xde58('0x2f')]);var _0x2a30ea={'where':_0x204557[_0xde58('0x2a')]};return db[_0xde58('0x1b')][_0xde58('0x12')](_0x2a30ea)['then'](function(_0xbc0f08){_0x162c35[_0xde58('0x12')]=_0xbc0f08;if(_0x2b6eeb[_0xde58('0x1f')]['includeAll']){_0x204557[_0xde58('0x30')]=[{'all':!![]}];}return db[_0xde58('0x1b')]['findAll'](_0x204557);})['then'](function(_0x3256b7){_0x162c35[_0xde58('0x31')]=_[_0xde58('0x1a')](_0x3256b7,function(_0x500cbb){if(_0x500cbb[_0xde58('0x32')]===_0xde58('0x33')){var _0x5bef89=encryptor[_0xde58('0x34')](_0x500cbb[_0xde58('0x35')]);_0x500cbb[_0xde58('0x35')]=maskClientSecret(_0x5bef89);}return _0x500cbb;});return _0x162c35;})[_0xde58('0x15')](respondWithFilteredResult(_0x4d7792,_0x204557))[_0xde58('0x36')](handleError(_0x4d7792,null));};exports[_0xde58('0x37')]=function(_0x166bd4,_0xfe182a){var _0x466f61={'raw':!![],'where':{'id':_0x166bd4[_0xde58('0x38')]['id']}},_0x15681a={};_0x15681a['model']=_[_0xde58('0x20')](db[_0xde58('0x1b')][_0xde58('0x39')]);_0x15681a[_0xde58('0x1f')]=_['keys'](_0x166bd4[_0xde58('0x1f')]);_0x15681a[_0xde58('0x21')]=_[_0xde58('0x22')](_0x15681a['model'],_0x15681a[_0xde58('0x1f')]);_0x466f61[_0xde58('0x23')]=_[_0xde58('0x22')](_0x15681a['model'],qs['fields'](_0x166bd4[_0xde58('0x1f')][_0xde58('0x24')]));_0x466f61[_0xde58('0x23')]=_0x466f61[_0xde58('0x23')][_0xde58('0x25')]?_0x466f61['attributes']:_0x15681a['model'];if(_0x166bd4[_0xde58('0x1f')][_0xde58('0x3a')]){_0x466f61['include']=[{'all':!![]}];}_0x466f61=_[_0xde58('0x2d')]({},_0x466f61,_0x166bd4['options']);return db['CloudProvider']['find'](_0x466f61)[_0xde58('0x15')](handleEntityNotFound(_0xfe182a,null))[_0xde58('0x15')](function(_0x172b7a){if(_0x172b7a[_0xde58('0x32')]==='MicrosoftAzure'){var _0x571187=encryptor['decryptString'](_0x172b7a['data3']);_0x172b7a[_0xde58('0x35')]=maskClientSecret(_0x571187);}return _0x172b7a;})[_0xde58('0x15')](respondWithResult(_0xfe182a,null))['catch'](handleError(_0xfe182a,null));};exports[_0xde58('0x3b')]=function(_0x214836,_0x15b8f4){if(!_0x214836[_0xde58('0x3c')][_0xde58('0x18')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x214836[_0xde58('0x3c')][_0xde58('0x32')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x3485b5=db['CloudProvider'][_0xde58('0x39')]['service'][_0xde58('0x3d')];if(!_0x3485b5[_0xde58('0x3e')](_0x214836[_0xde58('0x3c')][_0xde58('0x32')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x3485b5['join'](',\x20'));if(_0x214836[_0xde58('0x3c')][_0xde58('0x32')]===_0xde58('0x33')&&_0x214836[_0xde58('0x3c')][_0xde58('0x35')]){_0x214836[_0xde58('0x3c')][_0xde58('0x35')]=encryptor['encryptString'](_0x214836['body'][_0xde58('0x35')]);}return db['CloudProvider']['create'](_0x214836[_0xde58('0x3c')],{})[_0xde58('0x15')](respondWithResult(_0x15b8f4,0xc9))[_0xde58('0x36')](handleError(_0x15b8f4,null));};exports['update']=function(_0x5e53e4,_0x3aa83d){if(_0x5e53e4[_0xde58('0x3c')]['id']){delete _0x5e53e4[_0xde58('0x3c')]['id'];}return db[_0xde58('0x1b')][_0xde58('0x3f')]({'where':{'id':_0x5e53e4[_0xde58('0x38')]['id']}})['then'](handleEntityNotFound(_0x3aa83d,null))[_0xde58('0x15')](function(_0x283d29){if(_0x283d29[_0xde58('0x32')]===_0xde58('0x33')&&_0x5e53e4[_0xde58('0x3c')]['data3']){_0x5e53e4[_0xde58('0x3c')][_0xde58('0x35')]=encryptor['encryptString'](_0x5e53e4['body'][_0xde58('0x35')]);}return _0x283d29;})[_0xde58('0x15')](saveUpdates(_0x5e53e4[_0xde58('0x3c')],null))[_0xde58('0x15')](respondWithResult(_0x3aa83d,null))[_0xde58('0x36')](handleError(_0x3aa83d,null));};exports['destroy']=function(_0x4cc5b0,_0x1affae){return db['CloudProvider'][_0xde58('0x3f')]({'where':{'id':_0x4cc5b0['params']['id']}})[_0xde58('0x15')](handleEntityNotFound(_0x1affae,null))[_0xde58('0x15')](removeEntity(_0x1affae,null))[_0xde58('0x36')](handleError(_0x1affae,null));};exports['oauth2MicrosoftAuthorize']=function(_0x2537a6,_0x21706d){return db[_0xde58('0x1b')]['findOne']({'where':{'id':_0x2537a6[_0xde58('0x38')]['id']},'raw':!![]})[_0xde58('0x15')](function(_0x2d2a26){if(!_0x2d2a26)return _0x21706d[_0xde58('0xb')](0x194);return{'url':oauth[_0xde58('0x40')](_0x2d2a26,_0x2537a6['user']['id'])};})[_0xde58('0x15')](respondWithResult(_0x21706d,null))[_0xde58('0x36')](handleError(_0x21706d,null));};exports[_0xde58('0x41')]=function(_0x48ba4b,_0x5e2354){var _0x46339f=_0x48ba4b[_0xde58('0x3c')];var _0x4f3d15;var _0x1ce4e5;if(_0x46339f[_0xde58('0x42')])throw _0x46339f;redis[_0xde58('0x43')](_0x46339f[_0xde58('0x44')])['then'](function(_0x49cd28){if(!_0x49cd28)throw new Error(_0xde58('0x45'));_0x4f3d15=JSON[_0xde58('0x46')](_0x49cd28);var _0x498e3e=Buffer[_0xde58('0x47')](_0x46339f['state'],_0xde58('0x48'))['toString'](_0xde58('0x49'));_0x1ce4e5=JSON[_0xde58('0x46')](_0x498e3e);if(!oauth[_0xde58('0x4a')](_0x46339f['id_token'],_0x4f3d15['oauth2Claims']))throw new Error(_0xde58('0x4b'));redis['del'](_0x46339f['state']);return oauth[_0xde58('0x4c')](_0x46339f[_0xde58('0x4d')],_0x4f3d15);})[_0xde58('0x15')](function(_0x4bcb6a){_0x4f3d15[_0xde58('0x4e')]=_0x4bcb6a[_0xde58('0x4f')];_0x4f3d15['data6']=_0x4bcb6a[_0xde58('0x50')];return db[_0xde58('0x1b')][_0xde58('0x51')]({'data5':_0x4f3d15[_0xde58('0x4e')],'data6':_0x4f3d15[_0xde58('0x52')]},{'where':{'id':_0x4f3d15['id']}});})['then'](function(){oauth[_0xde58('0x53')](_0x4f3d15);socket[_0xde58('0x54')](_0xde58('0x55'),{'id':_0x1ce4e5['id']});return;})[_0xde58('0x15')](respondWithStatusCode(_0x5e2354,null))['catch'](function(_0x4714d7){if(_0x1ce4e5){socket[_0xde58('0x54')](_0xde58('0x56'),{'id':_0x1ce4e5['id']});}if(!_0x4f3d15){logger['error'](_0xde58('0x57'),_0x4714d7);return _0x5e2354[_0xde58('0xc')](0x1f4)[_0xde58('0x58')](_0x4714d7['message']);}logger[_0xde58('0x42')](_0xde58('0x59'),_0x4f3d15['id'],JSON[_0xde58('0x5a')](_0x4714d7));});}; \ No newline at end of file +var _0xdf31=['emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','status','json','undefined','limit','count','offset','update','then','destroy','end','error','stack','name','padEnd','slice','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','CloudProvider','includeAll','include','findAll','rows','service','MicrosoftAzure','data3','show','params','find','decryptString','body','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','catch','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','code','data5','data6','startRefreshInterval'];(function(_0x5c6900,_0x53a947){var _0x3d0d4a=function(_0x390e4b){while(--_0x390e4b){_0x5c6900['push'](_0x5c6900['shift']());}};_0x3d0d4a(++_0x53a947);}(_0xdf31,0x66));var _0x1df3=function(_0xee599f,_0x302b54){_0xee599f=_0xee599f-0x0;var _0x47944d=_0xdf31[_0xee599f];return _0x47944d;};'use strict';var _=require(_0x1df3('0x0'));var Redis=require(_0x1df3('0x1'));var qs=require(_0x1df3('0x2'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0x1df3('0x3'))(_0x1df3('0x4'));var db=require('../../mysqldb')['db'];var oauth=require(_0x1df3('0x5'));config['redis']=_[_0x1df3('0x6')](config[_0x1df3('0x7')],{'host':_0x1df3('0x8'),'port':0x18eb});var socket=require(_0x1df3('0x9'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x439c22,_0x1a5418){_0x1a5418=_0x1a5418||0xcc;return function(_0x516e6d){if(_0x516e6d){return _0x439c22[_0x1df3('0xa')](_0x1a5418);}return _0x439c22[_0x1df3('0xb')](_0x1a5418)['end']();};}function respondWithResult(_0x2ff5bc,_0x53468d){_0x53468d=_0x53468d||0xc8;return function(_0x76dd74){if(_0x76dd74){return _0x2ff5bc[_0x1df3('0xb')](_0x53468d)[_0x1df3('0xc')](_0x76dd74);}};}function respondWithFilteredResult(_0x4e2866,_0x32a33f){return function(_0x719382){if(_0x719382){var _0x101e28=typeof _0x32a33f['offset']===_0x1df3('0xd')&&typeof _0x32a33f[_0x1df3('0xe')]===_0x1df3('0xd');var _0x531e6d=_0x719382[_0x1df3('0xf')];var _0x5d99e0=_0x101e28?0x0:_0x32a33f[_0x1df3('0x10')];var _0x5bd6c5=_0x101e28?_0x719382['count']:_0x32a33f[_0x1df3('0x10')]+_0x32a33f[_0x1df3('0xe')];var _0x937ff4;if(_0x5bd6c5>=_0x531e6d){_0x5bd6c5=_0x531e6d;_0x937ff4=0xc8;}else{_0x937ff4=0xce;}_0x4e2866[_0x1df3('0xb')](_0x937ff4);return _0x4e2866['set']('Content-Range',_0x5d99e0+'-'+_0x5bd6c5+'/'+_0x531e6d)['json'](_0x719382);}return null;};}function saveUpdates(_0x3e4e13){return function(_0x3d1943){if(_0x3d1943){return _0x3d1943[_0x1df3('0x11')](_0x3e4e13)[_0x1df3('0x12')](function(_0x45218c){return _0x45218c;});}return null;};}function removeEntity(_0x3c1689){return function(_0x318d5a){if(_0x318d5a){return _0x318d5a[_0x1df3('0x13')]()[_0x1df3('0x12')](function(){_0x3c1689[_0x1df3('0xb')](0xcc)[_0x1df3('0x14')]();});}};}function handleEntityNotFound(_0x117b03){return function(_0x398867){if(!_0x398867){_0x117b03['sendStatus'](0x194);}return _0x398867;};}function handleError(_0x101639,_0x331a75){_0x331a75=_0x331a75||0x1f4;return function(_0x38023e){logger[_0x1df3('0x15')](_0x38023e[_0x1df3('0x16')]);if(_0x38023e[_0x1df3('0x17')]){delete _0x38023e['name'];}_0x101639[_0x1df3('0xb')](_0x331a75)['send'](_0x38023e);};}function maskClientSecret(_0x54b4fa){return _[_0x1df3('0x18')](_0x54b4fa[_0x1df3('0x19')](0x0,0x3),0x14,'*');}exports['index']=function(_0x4135ab,_0x4ca061){var _0xf5dd74={},_0x3beb9d={},_0x13c197={'count':0x0,'rows':[]};var _0x393f76=_[_0x1df3('0x1a')](db['CloudProvider'][_0x1df3('0x1b')],function(_0x40b428){return{'name':_0x40b428[_0x1df3('0x1c')],'type':_0x40b428[_0x1df3('0x1d')][_0x1df3('0x1e')]};});_0x3beb9d[_0x1df3('0x1f')]=_[_0x1df3('0x1a')](_0x393f76,_0x1df3('0x17'));_0x3beb9d[_0x1df3('0x20')]=_[_0x1df3('0x21')](_0x4135ab[_0x1df3('0x20')]);_0x3beb9d[_0x1df3('0x22')]=_[_0x1df3('0x23')](_0x3beb9d[_0x1df3('0x1f')],_0x3beb9d[_0x1df3('0x20')]);_0xf5dd74[_0x1df3('0x24')]=_['intersection'](_0x3beb9d[_0x1df3('0x1f')],qs[_0x1df3('0x25')](_0x4135ab[_0x1df3('0x20')][_0x1df3('0x25')]));_0xf5dd74['attributes']=_0xf5dd74[_0x1df3('0x24')][_0x1df3('0x26')]?_0xf5dd74[_0x1df3('0x24')]:_0x3beb9d[_0x1df3('0x1f')];if(!_0x4135ab[_0x1df3('0x20')]['hasOwnProperty'](_0x1df3('0x27'))){_0xf5dd74[_0x1df3('0xe')]=qs[_0x1df3('0xe')](_0x4135ab[_0x1df3('0x20')][_0x1df3('0xe')]);_0xf5dd74[_0x1df3('0x10')]=qs[_0x1df3('0x10')](_0x4135ab[_0x1df3('0x20')][_0x1df3('0x10')]);}_0xf5dd74[_0x1df3('0x28')]=qs[_0x1df3('0x29')](_0x4135ab[_0x1df3('0x20')][_0x1df3('0x29')]);_0xf5dd74['where']=qs[_0x1df3('0x22')](_[_0x1df3('0x2a')](_0x4135ab[_0x1df3('0x20')],_0x3beb9d[_0x1df3('0x22')]),_0x393f76);if(_0x4135ab[_0x1df3('0x20')][_0x1df3('0x2b')]){_0xf5dd74['where']=_[_0x1df3('0x2c')](_0xf5dd74['where'],{'$or':_[_0x1df3('0x1a')](_0x393f76,function(_0x4de616){if(_0x4de616[_0x1df3('0x1d')]!==_0x1df3('0x2d')){var _0x166dc1={};_0x166dc1[_0x4de616[_0x1df3('0x17')]]={'$like':'%'+_0x4135ab[_0x1df3('0x20')][_0x1df3('0x2b')]+'%'};return _0x166dc1;}})});}_0xf5dd74=_[_0x1df3('0x2c')]({},_0xf5dd74,_0x4135ab[_0x1df3('0x2e')]);var _0x590586={'where':_0xf5dd74['where']};return db[_0x1df3('0x2f')][_0x1df3('0xf')](_0x590586)['then'](function(_0x46137e){_0x13c197[_0x1df3('0xf')]=_0x46137e;if(_0x4135ab[_0x1df3('0x20')][_0x1df3('0x30')]){_0xf5dd74[_0x1df3('0x31')]=[{'all':!![]}];}return db[_0x1df3('0x2f')][_0x1df3('0x32')](_0xf5dd74);})[_0x1df3('0x12')](function(_0x56080f){_0x13c197[_0x1df3('0x33')]=_[_0x1df3('0x1a')](_0x56080f,function(_0x4f797e){if(_0x4f797e[_0x1df3('0x34')]===_0x1df3('0x35')){var _0x3bac65=encryptor['decryptString'](_0x4f797e['data3']);_0x4f797e[_0x1df3('0x36')]=maskClientSecret(_0x3bac65);}return _0x4f797e;});return _0x13c197;})['then'](respondWithFilteredResult(_0x4ca061,_0xf5dd74))['catch'](handleError(_0x4ca061,null));};exports[_0x1df3('0x37')]=function(_0x29a6bc,_0x34dd17){var _0x3b8043={'raw':!![],'where':{'id':_0x29a6bc[_0x1df3('0x38')]['id']}},_0x1839c4={};_0x1839c4[_0x1df3('0x1f')]=_[_0x1df3('0x21')](db[_0x1df3('0x2f')][_0x1df3('0x1b')]);_0x1839c4[_0x1df3('0x20')]=_[_0x1df3('0x21')](_0x29a6bc[_0x1df3('0x20')]);_0x1839c4[_0x1df3('0x22')]=_[_0x1df3('0x23')](_0x1839c4[_0x1df3('0x1f')],_0x1839c4[_0x1df3('0x20')]);_0x3b8043['attributes']=_['intersection'](_0x1839c4[_0x1df3('0x1f')],qs['fields'](_0x29a6bc[_0x1df3('0x20')]['fields']));_0x3b8043[_0x1df3('0x24')]=_0x3b8043[_0x1df3('0x24')][_0x1df3('0x26')]?_0x3b8043[_0x1df3('0x24')]:_0x1839c4['model'];if(_0x29a6bc['query'][_0x1df3('0x30')]){_0x3b8043[_0x1df3('0x31')]=[{'all':!![]}];}_0x3b8043=_[_0x1df3('0x2c')]({},_0x3b8043,_0x29a6bc['options']);return db[_0x1df3('0x2f')][_0x1df3('0x39')](_0x3b8043)[_0x1df3('0x12')](handleEntityNotFound(_0x34dd17,null))[_0x1df3('0x12')](function(_0x132863){if(_0x132863[_0x1df3('0x34')]==='MicrosoftAzure'){var _0x17ba58=encryptor[_0x1df3('0x3a')](_0x132863[_0x1df3('0x36')]);_0x132863[_0x1df3('0x36')]=maskClientSecret(_0x17ba58);}return _0x132863;})['then'](respondWithResult(_0x34dd17,null))['catch'](handleError(_0x34dd17,null));};exports['create']=function(_0x4a67e3,_0x292922){if(!_0x4a67e3[_0x1df3('0x3b')][_0x1df3('0x17')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x4a67e3[_0x1df3('0x3b')][_0x1df3('0x34')])throw new Error(_0x1df3('0x3c'));var _0x287dbc=db[_0x1df3('0x2f')][_0x1df3('0x1b')][_0x1df3('0x34')][_0x1df3('0x3d')];if(!_0x287dbc[_0x1df3('0x3e')](_0x4a67e3[_0x1df3('0x3b')]['service']))throw new Error(_0x1df3('0x3f')+_0x287dbc[_0x1df3('0x40')](',\x20'));if(_0x4a67e3[_0x1df3('0x3b')][_0x1df3('0x34')]===_0x1df3('0x35')&&_0x4a67e3['body'][_0x1df3('0x36')]){_0x4a67e3[_0x1df3('0x3b')][_0x1df3('0x36')]=encryptor[_0x1df3('0x41')](_0x4a67e3[_0x1df3('0x3b')][_0x1df3('0x36')]);}return db['CloudProvider']['create'](_0x4a67e3[_0x1df3('0x3b')],{})[_0x1df3('0x12')](respondWithResult(_0x292922,0xc9))['catch'](handleError(_0x292922,null));};exports['update']=function(_0x2d70ab,_0x429021){if(_0x2d70ab[_0x1df3('0x3b')]['id']){delete _0x2d70ab[_0x1df3('0x3b')]['id'];}return db['CloudProvider'][_0x1df3('0x39')]({'where':{'id':_0x2d70ab[_0x1df3('0x38')]['id']}})[_0x1df3('0x12')](handleEntityNotFound(_0x429021,null))[_0x1df3('0x12')](function(_0x26d3e7){if(_0x26d3e7[_0x1df3('0x34')]==='MicrosoftAzure'&&_0x2d70ab[_0x1df3('0x3b')][_0x1df3('0x36')]){_0x2d70ab[_0x1df3('0x3b')][_0x1df3('0x36')]=encryptor['encryptString'](_0x2d70ab[_0x1df3('0x3b')][_0x1df3('0x36')]);}return _0x26d3e7;})[_0x1df3('0x12')](saveUpdates(_0x2d70ab[_0x1df3('0x3b')],null))[_0x1df3('0x12')](respondWithResult(_0x429021,null))[_0x1df3('0x42')](handleError(_0x429021,null));};exports[_0x1df3('0x13')]=function(_0x3797b9,_0x342693){return db['CloudProvider'][_0x1df3('0x39')]({'where':{'id':_0x3797b9[_0x1df3('0x38')]['id']}})['then'](handleEntityNotFound(_0x342693,null))['then'](removeEntity(_0x342693,null))['catch'](handleError(_0x342693,null));};exports[_0x1df3('0x43')]=function(_0x1c6ae3,_0x3d4d34){return db[_0x1df3('0x2f')][_0x1df3('0x44')]({'where':{'id':_0x1c6ae3['params']['id']},'raw':!![]})[_0x1df3('0x12')](function(_0x349e2d){if(!_0x349e2d)return _0x3d4d34[_0x1df3('0xa')](0x194);return{'url':oauth[_0x1df3('0x45')](_0x349e2d,_0x1c6ae3[_0x1df3('0x46')]['id'])};})[_0x1df3('0x12')](respondWithResult(_0x3d4d34,null))[_0x1df3('0x42')](handleError(_0x3d4d34,null));};exports[_0x1df3('0x47')]=function(_0x2c5839,_0x6b8435){var _0x3ef283=_0x2c5839[_0x1df3('0x3b')];var _0x1a5459;var _0x305bac;if(_0x3ef283[_0x1df3('0x15')])throw _0x3ef283;redis[_0x1df3('0x48')](_0x3ef283[_0x1df3('0x49')])[_0x1df3('0x12')](function(_0x511561){if(!_0x511561)throw new Error(_0x1df3('0x4a'));_0x1a5459=JSON[_0x1df3('0x4b')](_0x511561);var _0x1c0923=Buffer['from'](_0x3ef283[_0x1df3('0x49')],'base64')[_0x1df3('0x4c')](_0x1df3('0x4d'));_0x305bac=JSON[_0x1df3('0x4b')](_0x1c0923);if(!oauth[_0x1df3('0x4e')](_0x3ef283[_0x1df3('0x4f')],_0x1a5459[_0x1df3('0x50')]))throw new Error(_0x1df3('0x51'));redis['del'](_0x3ef283['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x3ef283[_0x1df3('0x52')],_0x1a5459);})[_0x1df3('0x12')](function(_0x5eceee){_0x1a5459[_0x1df3('0x53')]=_0x5eceee['access_token'];_0x1a5459[_0x1df3('0x54')]=_0x5eceee['refresh_token'];return db[_0x1df3('0x2f')]['update']({'data5':_0x1a5459[_0x1df3('0x53')],'data6':_0x1a5459[_0x1df3('0x54')]},{'where':{'id':_0x1a5459['id']}});})[_0x1df3('0x12')](function(){oauth[_0x1df3('0x55')](_0x1a5459);socket[_0x1df3('0x56')](_0x1df3('0x57'),{'id':_0x305bac['id']});return;})[_0x1df3('0x12')](respondWithStatusCode(_0x6b8435,null))['catch'](function(_0x32d884){if(_0x305bac){socket['emit'](_0x1df3('0x58'),{'id':_0x305bac['id']});}if(!_0x1a5459){logger[_0x1df3('0x15')](_0x1df3('0x59'),_0x32d884);return _0x6b8435[_0x1df3('0xb')](0x1f4)[_0x1df3('0x5a')](_0x32d884[_0x1df3('0x5b')]);}logger[_0x1df3('0x15')](_0x1df3('0x5c'),_0x1a5459['id'],JSON[_0x1df3('0x5d')](_0x32d884));});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 90398a2..83da0b6 100644 --- a/server/api/cloudProvider/cloudProvider.model.js +++ b/server/api/cloudProvider/cloudProvider.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x580e=['api','moment','bluebird','path','rimraf','./cloudProvider.attributes','exports','CloudProvider','cloud_providers','lodash','util','../../config/logger'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0x580e,0xf9));var _0xe580=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x580e[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xe580('0x0'));var util=require(_0xe580('0x1'));var logger=require(_0xe580('0x2'))(_0xe580('0x3'));var moment=require(_0xe580('0x4'));var BPromise=require(_0xe580('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe580('0x6'));var rimraf=require(_0xe580('0x7'));var config=require('../../config/environment');var attributes=require(_0xe580('0x8'));module[_0xe580('0x9')]=function(_0x3156b9,_0x1acb27){return _0x3156b9['define'](_0xe580('0xa'),attributes,{'tableName':_0xe580('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf406=['./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x199628,_0x198fc7){var _0x1b9c08=function(_0x15aac8){while(--_0x15aac8){_0x199628['push'](_0x199628['shift']());}};_0x1b9c08(++_0x198fc7);}(_0xf406,0x1a9));var _0x6f40=function(_0x59ae8f,_0x148344){_0x59ae8f=_0x59ae8f-0x0;var _0x3900b5=_0xf406[_0x59ae8f];return _0x3900b5;};'use strict';var _=require(_0x6f40('0x0'));var util=require(_0x6f40('0x1'));var logger=require(_0x6f40('0x2'))(_0x6f40('0x3'));var moment=require('moment');var BPromise=require(_0x6f40('0x4'));var rp=require(_0x6f40('0x5'));var fs=require('fs');var path=require(_0x6f40('0x6'));var rimraf=require(_0x6f40('0x7'));var config=require(_0x6f40('0x8'));var attributes=require(_0x6f40('0x9'));module[_0x6f40('0xa')]=function(_0x3e7cb2,_0x179a7a){return _0x3e7cb2[_0x6f40('0xb')](_0x6f40('0xc'),attributes,{'tableName':_0x6f40('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index 022518e..4ea5503 100644 --- a/server/api/cloudProvider/cloudProvider.oauth.js +++ b/server/api/cloudProvider/cloudProvider.oauth.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba16=['Dynamics365','replace','{TENANT_ID}','data2','from','stringify','toString','base64','randomBytes','hex','client_id','data1','response_type','state','nonce','prompt','login','map','key','value','oauth2/','set','decode','issuer','aud','unix','exp','data3','then','refresh_token','data6','POST','data5','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','decryptString','intervals','bind','CloudProvider','all','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','type','push','/.default','join'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xba16,0x1d0));var _0x6ba1=function(_0x385c76,_0xb97335){_0x385c76=_0x385c76-0x0;var _0x5c8367=_0xba16[_0x385c76];return _0x5c8367;};'use strict';var _=require('lodash');var crypto=require(_0x6ba1('0x0'));var jwt=require(_0x6ba1('0x1'));var moment=require(_0x6ba1('0x2'));var Redis=require('ioredis');var rp=require(_0x6ba1('0x3'));var util=require(_0x6ba1('0x4'));var encryptor=require(_0x6ba1('0x5'));var config=require(_0x6ba1('0x6'));var logger=require(_0x6ba1('0x7'))('api');var schedule=require(_0x6ba1('0x8'));var db=require(_0x6ba1('0x9'))['db'];config[_0x6ba1('0xa')]=_[_0x6ba1('0xb')](config[_0x6ba1('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x6ba1('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0x6ba1('0xd'),_0x6ba1('0xe'),_0x6ba1('0xf'),_0x6ba1('0x10'),_0x6ba1('0x11'),_0x6ba1('0x12'),_0x6ba1('0x13')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x6ba1('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x6ba1('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5814a4){var _0x444637=_['map'](AZURE_AUTH_SCOPES[_0x5814a4[_0x6ba1('0x16')]]);if(_0x5814a4['type']==='Dynamics365')_0x444637[_0x6ba1('0x17')](_0x5814a4['data7']+_0x6ba1('0x18'));return _0x444637[_0x6ba1('0x19')]('\x20');}function getAccessTokenScope(_0x50d10c){if(_0x50d10c[_0x6ba1('0x16')]==='Outlook365')return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x50d10c[_0x6ba1('0x16')]===_0x6ba1('0x1a'))return _0x50d10c['data7']+_0x6ba1('0x18');}function generateMicrosoftAuthorizationUrl(_0x1edb53,_0x258254){var _0x2392ea=MICROSOFT_AUTH_URL[_0x6ba1('0x1b')](_0x6ba1('0x1c'),_0x1edb53[_0x6ba1('0x1d')]);var _0x130bf8=['code','id_token'];var _0x559f42=Buffer[_0x6ba1('0x1e')](JSON[_0x6ba1('0x1f')]({'id':_0x258254}))[_0x6ba1('0x20')](_0x6ba1('0x21'));var _0x1e6173=crypto[_0x6ba1('0x22')](0x10)[_0x6ba1('0x20')](_0x6ba1('0x23'));var _0x444cd1=getAuthorizationScopes(_0x1edb53);var _0x26b86f=[{'key':_0x6ba1('0x24'),'value':_0x1edb53[_0x6ba1('0x25')]},{'key':_0x6ba1('0x26'),'value':encodeURIComponent(_0x130bf8[_0x6ba1('0x19')]('\x20'))},{'key':'redirect_uri','value':_0x1edb53['data4']},{'key':'response_mode','value':'form_post'},{'key':'scope','value':encodeURIComponent(_0x444cd1)},{'key':_0x6ba1('0x27'),'value':_0x559f42},{'key':_0x6ba1('0x28'),'value':_0x1e6173},{'key':_0x6ba1('0x29'),'value':_0x6ba1('0x2a')}];var _0x1d55c5=_0x2392ea+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x6ba1('0x2b')](_0x26b86f,function(_0x271a61){return _0x271a61[_0x6ba1('0x2c')]+'='+_0x271a61[_0x6ba1('0x2d')];})['join']('&');_0x1edb53['oauth2Claims']={'issuer':_0x2392ea[_0x6ba1('0x1b')](_0x6ba1('0x2e'),''),'audience':_0x1edb53[_0x6ba1('0x25')],'state':_0x559f42,'nonce':_0x1e6173};redis[_0x6ba1('0x2f')](_0x559f42,JSON[_0x6ba1('0x1f')](_0x1edb53));return _0x1d55c5;}function isValidIdToken(_0x31a558,_0x5f53cd){try{var _0x557458=jwt[_0x6ba1('0x30')](_0x31a558,{'complete':!![]});var _0x3d8e75=_0x557458['payload'];if(_0x3d8e75['iss']!==_0x5f53cd[_0x6ba1('0x31')])return![];if(_0x3d8e75[_0x6ba1('0x32')]!==_0x5f53cd['audience'])return![];if(_0x3d8e75[_0x6ba1('0x28')]!==_0x5f53cd[_0x6ba1('0x28')])return![];if(moment()['isAfter'](moment[_0x6ba1('0x33')](_0x3d8e75[_0x6ba1('0x34')])))return![];return!![];}catch(_0x59d31c){throw _0x59d31c;}}function refreshOauth2MicrosoftAccessToken(_0x4c1d6e){return Promise['resolve']()['then'](function(){if(_0x4c1d6e[_0x6ba1('0x35')])return _0x4c1d6e;return db['CloudProvider']['findOne']({'where':{'id':_0x4c1d6e['id']},'raw':!![]});})[_0x6ba1('0x36')](function(_0x51b798){var _0x484110={'grant_type':_0x6ba1('0x37'),'refresh_token':_0x51b798[_0x6ba1('0x38')],'scope':getAccessTokenScope(_0x51b798),'redirect_uri':_0x51b798['data4'],'client_id':_0x51b798[_0x6ba1('0x25')],'client_secret':encryptor['decryptString'](_0x51b798[_0x6ba1('0x35')])};var _0x3c1b68={'method':_0x6ba1('0x39'),'uri':MICROSOFT_AUTH_URL[_0x6ba1('0x1b')](_0x6ba1('0x1c'),_0x51b798[_0x6ba1('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x484110,'json':!![]};return rp(_0x3c1b68);})[_0x6ba1('0x36')](function(_0x4937e0){_0x4c1d6e[_0x6ba1('0x3a')]=_0x4937e0['access_token'];_0x4c1d6e[_0x6ba1('0x38')]=_0x4937e0[_0x6ba1('0x37')];return db['CloudProvider'][_0x6ba1('0x3b')]({'data5':_0x4c1d6e[_0x6ba1('0x3a')],'data6':_0x4c1d6e[_0x6ba1('0x38')]},{'where':{'id':_0x4c1d6e['id']}});})[_0x6ba1('0x36')](function(){return _0x4c1d6e;})[_0x6ba1('0x3c')](function(_0x45daae){logger[_0x6ba1('0x3d')](_0x6ba1('0x3e'),_0x4c1d6e['id'],_0x45daae);});}function getOauth2MicrosoftAccessToken(_0xee32e2,_0x544b36){var _0x4767f0={'grant_type':'authorization_code','code':_0xee32e2,'scope':getAccessTokenScope(_0x544b36),'redirect_uri':_0x544b36['data4'],'client_id':_0x544b36[_0x6ba1('0x25')],'client_secret':encryptor[_0x6ba1('0x3f')](_0x544b36[_0x6ba1('0x35')])};var _0x266428={'method':_0x6ba1('0x39'),'uri':MICROSOFT_AUTH_URL[_0x6ba1('0x1b')](_0x6ba1('0x1c'),_0x544b36[_0x6ba1('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4767f0,'json':!![]};return rp(_0x266428);}function startRefreshInterval(_0x297c12){var _0xbe6e2b=schedule[_0x6ba1('0x40')];if(_0xbe6e2b[_0x297c12['id']])clearInterval(_0xbe6e2b[_0x297c12['id']]);_0xbe6e2b[_0x297c12['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x6ba1('0x41')](this,{'id':_0x297c12['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x6ba1('0x40')]=_0xbe6e2b;}function startAllRefreshIntervals(){return db[_0x6ba1('0x42')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x6ba1('0x36')](function(_0x4a68ae){var _0x423dd5=_0x4a68ae[_0x6ba1('0x2b')](function(_0x5c880d){return refreshOauth2MicrosoftAccessToken(_0x5c880d)[_0x6ba1('0x36')](function(_0x3e8c45){startRefreshInterval(_0x3e8c45);});});return Promise[_0x6ba1('0x43')](_0x423dd5);})[_0x6ba1('0x3c')](function(_0x369c79){var _0xe77464=_0x369c79?util[_0x6ba1('0x44')](_0x369c79,{'showHidden':![],'depth':null}):'';logger['error'](_0x6ba1('0x45'),_0xe77464);});}module['exports']={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xf7fa=['bind','findAll','map','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','jsonwebtoken','moment','ioredis','request-promise','util','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','type','Dynamics365','push','data7','/.default','join','replace','{TENANT_ID}','data2','code','from','stringify','toString','base64','randomBytes','client_id','data1','response_type','redirect_uri','data4','scope','prompt','key','value','oauth2Claims','set','payload','iss','issuer','aud','nonce','isAfter','unix','exp','resolve','CloudProvider','refresh_token','data6','decryptString','data3','POST','then','access_token','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals'];(function(_0x7bbab4,_0xd306ec){var _0x19e00b=function(_0x72bd0){while(--_0x72bd0){_0x7bbab4['push'](_0x7bbab4['shift']());}};_0x19e00b(++_0xd306ec);}(_0xf7fa,0x9f));var _0xaf7f=function(_0x16bc83,_0x426eaf){_0x16bc83=_0x16bc83-0x0;var _0x426ebc=_0xf7fa[_0x16bc83];return _0x426ebc;};'use strict';var _=require(_0xaf7f('0x0'));var crypto=require('crypto');var jwt=require(_0xaf7f('0x1'));var moment=require(_0xaf7f('0x2'));var Redis=require(_0xaf7f('0x3'));var rp=require(_0xaf7f('0x4'));var util=require(_0xaf7f('0x5'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require(_0xaf7f('0x6'))(_0xaf7f('0x7'));var schedule=require(_0xaf7f('0x8'));var db=require(_0xaf7f('0x9'))['db'];config[_0xaf7f('0xa')]=_[_0xaf7f('0xb')](config[_0xaf7f('0xa')],{'host':_0xaf7f('0xc'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0xaf7f('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xaf7f('0xe'),_0xaf7f('0xf'),_0xaf7f('0x10'),_0xaf7f('0x11'),_0xaf7f('0x12'),_0xaf7f('0x13'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0xaf7f('0xe'),_0xaf7f('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0xaf7f('0x14');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x73ca47){var _0x50943f=_['map'](AZURE_AUTH_SCOPES[_0x73ca47['type']]);if(_0x73ca47[_0xaf7f('0x15')]===_0xaf7f('0x16'))_0x50943f[_0xaf7f('0x17')](_0x73ca47[_0xaf7f('0x18')]+_0xaf7f('0x19'));return _0x50943f[_0xaf7f('0x1a')]('\x20');}function getAccessTokenScope(_0x3446ab){if(_0x3446ab[_0xaf7f('0x15')]==='Outlook365')return _0xaf7f('0x12');if(_0x3446ab[_0xaf7f('0x15')]===_0xaf7f('0x16'))return _0x3446ab[_0xaf7f('0x18')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x479ec2,_0x35f36c){var _0x32e2f7=MICROSOFT_AUTH_URL[_0xaf7f('0x1b')](_0xaf7f('0x1c'),_0x479ec2[_0xaf7f('0x1d')]);var _0x5d47bf=[_0xaf7f('0x1e'),'id_token'];var _0x5c37d9=Buffer[_0xaf7f('0x1f')](JSON[_0xaf7f('0x20')]({'id':_0x35f36c}))[_0xaf7f('0x21')](_0xaf7f('0x22'));var _0x37e9c7=crypto[_0xaf7f('0x23')](0x10)[_0xaf7f('0x21')]('hex');var _0x42543c=getAuthorizationScopes(_0x479ec2);var _0x25fd64=[{'key':_0xaf7f('0x24'),'value':_0x479ec2[_0xaf7f('0x25')]},{'key':_0xaf7f('0x26'),'value':encodeURIComponent(_0x5d47bf[_0xaf7f('0x1a')]('\x20'))},{'key':_0xaf7f('0x27'),'value':_0x479ec2[_0xaf7f('0x28')]},{'key':'response_mode','value':'form_post'},{'key':_0xaf7f('0x29'),'value':encodeURIComponent(_0x42543c)},{'key':'state','value':_0x5c37d9},{'key':'nonce','value':_0x37e9c7},{'key':_0xaf7f('0x2a'),'value':'login'}];var _0x1d5367=_0x32e2f7+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x25fd64,function(_0xaf2c50){return _0xaf2c50[_0xaf7f('0x2b')]+'='+_0xaf2c50[_0xaf7f('0x2c')];})['join']('&');_0x479ec2[_0xaf7f('0x2d')]={'issuer':_0x32e2f7['replace']('oauth2/',''),'audience':_0x479ec2[_0xaf7f('0x25')],'state':_0x5c37d9,'nonce':_0x37e9c7};redis[_0xaf7f('0x2e')](_0x5c37d9,JSON[_0xaf7f('0x20')](_0x479ec2));return _0x1d5367;}function isValidIdToken(_0x391aa5,_0x35f869){try{var _0x4fe507=jwt['decode'](_0x391aa5,{'complete':!![]});var _0x378dc0=_0x4fe507[_0xaf7f('0x2f')];if(_0x378dc0[_0xaf7f('0x30')]!==_0x35f869[_0xaf7f('0x31')])return![];if(_0x378dc0[_0xaf7f('0x32')]!==_0x35f869['audience'])return![];if(_0x378dc0[_0xaf7f('0x33')]!==_0x35f869['nonce'])return![];if(moment()[_0xaf7f('0x34')](moment[_0xaf7f('0x35')](_0x378dc0[_0xaf7f('0x36')])))return![];return!![];}catch(_0x2339b2){throw _0x2339b2;}}function refreshOauth2MicrosoftAccessToken(_0x569d78){return Promise[_0xaf7f('0x37')]()['then'](function(){if(_0x569d78['data3'])return _0x569d78;return db[_0xaf7f('0x38')]['findOne']({'where':{'id':_0x569d78['id']},'raw':!![]});})['then'](function(_0x27bf59){var _0x4f29ea={'grant_type':_0xaf7f('0x39'),'refresh_token':_0x27bf59[_0xaf7f('0x3a')],'scope':getAccessTokenScope(_0x27bf59),'redirect_uri':_0x27bf59['data4'],'client_id':_0x27bf59[_0xaf7f('0x25')],'client_secret':encryptor[_0xaf7f('0x3b')](_0x27bf59[_0xaf7f('0x3c')])};var _0x390ebe={'method':_0xaf7f('0x3d'),'uri':MICROSOFT_AUTH_URL['replace'](_0xaf7f('0x1c'),_0x27bf59[_0xaf7f('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4f29ea,'json':!![]};return rp(_0x390ebe);})[_0xaf7f('0x3e')](function(_0x13d135){_0x569d78['data5']=_0x13d135[_0xaf7f('0x3f')];_0x569d78[_0xaf7f('0x3a')]=_0x13d135[_0xaf7f('0x39')];return db[_0xaf7f('0x38')][_0xaf7f('0x40')]({'data5':_0x569d78['data5'],'data6':_0x569d78[_0xaf7f('0x3a')]},{'where':{'id':_0x569d78['id']}});})[_0xaf7f('0x3e')](function(){return _0x569d78;})[_0xaf7f('0x41')](function(_0x5eeba0){logger['error'](_0xaf7f('0x42'),_0x569d78['id'],_0x5eeba0);});}function getOauth2MicrosoftAccessToken(_0xb11ae,_0x4f7b14){var _0x231cef={'grant_type':_0xaf7f('0x43'),'code':_0xb11ae,'scope':getAccessTokenScope(_0x4f7b14),'redirect_uri':_0x4f7b14[_0xaf7f('0x28')],'client_id':_0x4f7b14[_0xaf7f('0x25')],'client_secret':encryptor[_0xaf7f('0x3b')](_0x4f7b14[_0xaf7f('0x3c')])};var _0x438c16={'method':_0xaf7f('0x3d'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x4f7b14[_0xaf7f('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x231cef,'json':!![]};return rp(_0x438c16);}function startRefreshInterval(_0x20dd95){var _0x4e2886=schedule[_0xaf7f('0x44')];if(_0x4e2886[_0x20dd95['id']])clearInterval(_0x4e2886[_0x20dd95['id']]);_0x4e2886[_0x20dd95['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xaf7f('0x45')](this,{'id':_0x20dd95['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xaf7f('0x44')]=_0x4e2886;}function startAllRefreshIntervals(){return db[_0xaf7f('0x38')][_0xaf7f('0x46')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xaf7f('0x3e')](function(_0x18a9fc){var _0x3155bd=_0x18a9fc[_0xaf7f('0x47')](function(_0x328aae){return refreshOauth2MicrosoftAccessToken(_0x328aae)['then'](function(_0x19eaa5){startRefreshInterval(_0x19eaa5);});});return Promise['all'](_0x3155bd);})['catch'](function(_0xde45ab){var _0x33b543=_0xde45ab?util[_0xaf7f('0x48')](_0xde45ab,{'showHidden':![],'depth':null}):'';logger[_0xaf7f('0x49')](_0xaf7f('0x4a'),_0x33b543);});}module[_0xaf7f('0x4b')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index c57d284..fb6451c 100644 --- a/server/api/cloudProvider/cloudProvider.rpc.js +++ b/server/api/cloudProvider/cloudProvider.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5453=['randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','request','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x1bd6b1,_0x57e4c5){var _0x199e9=function(_0x5ae181){while(--_0x5ae181){_0x1bd6b1['push'](_0x1bd6b1['shift']());}};_0x199e9(++_0x57e4c5);}(_0x5453,0x18b));var _0x3545=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5453[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require(_0x3545('0x0'));var util=require(_0x3545('0x1'));var moment=require(_0x3545('0x2'));var BPromise=require(_0x3545('0x3'));var rs=require(_0x3545('0x4'));var fs=require('fs');var Redis=require(_0x3545('0x5'));var db=require(_0x3545('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3545('0x7'));var config=require(_0x3545('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3545('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x290aa5,_0x496d6b,_0x5d5808){return new BPromise(function(_0x2974ae,_0x3cf0cc){return client[_0x3545('0xa')](_0x290aa5,_0x5d5808)['then'](function(_0x21dc51){logger[_0x3545('0xb')](_0x3545('0xc'),_0x496d6b,_0x3545('0xd'));logger[_0x3545('0xe')](_0x3545('0xf'),_0x496d6b,_0x3545('0xd'),JSON['stringify'](_0x21dc51));if(_0x21dc51['error']){if(_0x21dc51[_0x3545('0x10')][_0x3545('0x11')]===0x1f4){logger[_0x3545('0x10')](_0x3545('0xc'),_0x496d6b,_0x21dc51['error']['message']);return _0x3cf0cc(_0x21dc51['error'][_0x3545('0x12')]);}logger[_0x3545('0x10')]('CloudProvider,\x20%s,\x20%s',_0x496d6b,_0x21dc51[_0x3545('0x10')]['message']);return _0x2974ae(_0x21dc51['error'][_0x3545('0x12')]);}else{logger[_0x3545('0xb')]('CloudProvider,\x20%s,\x20%s',_0x496d6b,_0x3545('0xd'));_0x2974ae(_0x21dc51[_0x3545('0x13')]['message']);}})[_0x3545('0x14')](function(_0x51f69b){logger[_0x3545('0x10')](_0x3545('0xc'),_0x496d6b,_0x51f69b);_0x3cf0cc(_0x51f69b);});});} \ No newline at end of file +var _0xfff0=['../../config/environment','client','http','then','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x40162c,_0x256d00){var _0x816aad=function(_0x550d13){while(--_0x550d13){_0x40162c['push'](_0x40162c['shift']());}};_0x816aad(++_0x256d00);}(_0xfff0,0x139));var _0x0fff=function(_0x89cada,_0x585233){_0x89cada=_0x89cada-0x0;var _0x494834=_0xfff0[_0x89cada];return _0x494834;};'use strict';var _=require('lodash');var util=require(_0x0fff('0x0'));var moment=require(_0x0fff('0x1'));var BPromise=require(_0x0fff('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fff('0x3'));var db=require(_0x0fff('0x4'))['db'];var utils=require(_0x0fff('0x5'));var logger=require('../../config/logger')(_0x0fff('0x6'));var config=require(_0x0fff('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0fff('0x8')][_0x0fff('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f1d2b,_0x586dc5,_0x24cfb0){return new BPromise(function(_0x5e9672,_0x1f2658){return client['request'](_0x2f1d2b,_0x24cfb0)[_0x0fff('0xa')](function(_0x3db6f6){logger['info'](_0x0fff('0xb'),_0x586dc5,_0x0fff('0xc'));logger[_0x0fff('0xd')](_0x0fff('0xe'),_0x586dc5,_0x0fff('0xc'),JSON[_0x0fff('0xf')](_0x3db6f6));if(_0x3db6f6[_0x0fff('0x10')]){if(_0x3db6f6[_0x0fff('0x10')][_0x0fff('0x11')]===0x1f4){logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6['error'][_0x0fff('0x12')]);return _0x1f2658(_0x3db6f6['error'][_0x0fff('0x12')]);}logger[_0x0fff('0x10')](_0x0fff('0xb'),_0x586dc5,_0x3db6f6[_0x0fff('0x10')]['message']);return _0x5e9672(_0x3db6f6['error'][_0x0fff('0x12')]);}else{logger['info']('CloudProvider,\x20%s,\x20%s',_0x586dc5,'request\x20sent');_0x5e9672(_0x3db6f6[_0x0fff('0x13')][_0x0fff('0x12')]);}})['catch'](function(_0x431b33){logger[_0x0fff('0x10')]('CloudProvider,\x20%s,\x20%s',_0x586dc5,_0x431b33);_0x1f2658(_0x431b33);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 366ba9b..d1d590f 100644 --- a/server/api/cloudProvider/index.js +++ b/server/api/cloudProvider/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1261=['/:id','show','create','put','update','delete','/:id/oauth2/microsoft/authorize/','post','exports','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index'];(function(_0x112e2a,_0x364486){var _0x4f8af9=function(_0xa11c0d){while(--_0xa11c0d){_0x112e2a['push'](_0x112e2a['shift']());}};_0x4f8af9(++_0x364486);}(_0x1261,0x144));var _0x1126=function(_0xdbb6cb,_0x3b8fda){_0xdbb6cb=_0xdbb6cb-0x0;var _0x476b50=_0x1261[_0xdbb6cb];return _0x476b50;};'use strict';var express=require('express');var router=express[_0x1126('0x0')]();var auth=require(_0x1126('0x1'));var controller=require(_0x1126('0x2'));router[_0x1126('0x3')]('/',auth[_0x1126('0x4')](),controller[_0x1126('0x5')]);router[_0x1126('0x3')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller[_0x1126('0x7')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1126('0x8')]);router[_0x1126('0x9')]('/:id',auth[_0x1126('0x4')](),controller[_0x1126('0xa')]);router[_0x1126('0xb')](_0x1126('0x6'),auth[_0x1126('0x4')](),controller['destroy']);router[_0x1126('0x3')](_0x1126('0xc'),auth[_0x1126('0x4')](),controller['oauth2MicrosoftAuthorize']);router[_0x1126('0xd')]('/oauth2/microsoft/callback',controller['oauth2MicrosoftCallback']);module[_0x1126('0xe')]=router; \ No newline at end of file +var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x2e5c9c,_0x1e81f3){var _0x9200c1=function(_0x10eae5){while(--_0x10eae5){_0x2e5c9c['push'](_0x2e5c9c['shift']());}};_0x9200c1(++_0x1e81f3);}(_0xadb5,0xad));var _0x5adb=function(_0x1d30b3,_0x3d499b){_0x1d30b3=_0x1d30b3-0x0;var _0x1f9a3f=_0xadb5[_0x1d30b3];return _0x1f9a3f;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 5fdde79..4612862 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 _0x7429=['STRING'];(function(_0x283127,_0x54d4d5){var _0x43da5d=function(_0x10947f){while(--_0x10947f){_0x283127['push'](_0x283127['shift']());}};_0x43da5d(++_0x54d4d5);}(_0x7429,0x6f));var _0x9742=function(_0x29bb5e,_0x2869d9){_0x29bb5e=_0x29bb5e-0x0;var _0xea7fb9=_0x7429[_0x29bb5e];return _0xea7fb9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9742('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9742('0x0')]},'companyId':{'type':Sequelize[_0x9742('0x0')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x9742('0x0')]},'fax':{'type':Sequelize[_0x9742('0x0')]},'type':{'type':Sequelize[_0x9742('0x0')]},'street':{'type':Sequelize[_0x9742('0x0')]},'postalCode':{'type':Sequelize[_0x9742('0x0')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9742('0x0')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9742('0x0')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x9742('0x0')]},'sCity':{'type':Sequelize[_0x9742('0x0')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9742('0x0')]}}; \ No newline at end of file +var _0x3270=['exports','STRING','name','sequelize'];(function(_0x49ad79,_0x48ee93){var _0xa4e38a=function(_0x4925c7){while(--_0x4925c7){_0x49ad79['push'](_0x49ad79['shift']());}};_0xa4e38a(++_0x48ee93);}(_0x3270,0xcf));var _0x0327=function(_0x5f1cf8,_0x5e0923){_0x5f1cf8=_0x5f1cf8-0x0;var _0x27d0fa=_0x3270[_0x5f1cf8];return _0x27d0fa;};'use strict';var Sequelize=require(_0x0327('0x0'));module[_0x0327('0x1')]={'name':{'type':Sequelize[_0x0327('0x2')],'unique':_0x0327('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x0327('0x2')]},'companyId':{'type':Sequelize[_0x0327('0x2')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x0327('0x2')]},'type':{'type':Sequelize[_0x0327('0x2')]},'street':{'type':Sequelize[_0x0327('0x2')]},'postalCode':{'type':Sequelize[_0x0327('0x2')]},'city':{'type':Sequelize[_0x0327('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x0327('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x0327('0x2')]},'sStreet':{'type':Sequelize[_0x0327('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x0327('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 02c282a..b307d50 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 _0x66aa=['keys','include','create','body','user','get','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','ids','omit','getContacts','findOne','rawAttributes','nolimit','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','Companies','UserProfileResource','end','stack','name','send','CmCompany','describe','model','filters','intersection','query','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','map','options','includeAll','findAll','catch','show','params'];(function(_0x53f07b,_0x4ad80a){var _0x59a8bb=function(_0x5a295d){while(--_0x5a295d){_0x53f07b['push'](_0x53f07b['shift']());}};_0x59a8bb(++_0x4ad80a);}(_0x66aa,0x68));var _0xa66a=function(_0x5bb0be,_0x387b95){_0x5bb0be=_0x5bb0be-0x0;var _0x14b5c3=_0x66aa[_0x5bb0be];return _0x14b5c3;};'use strict';var emlformat=require(_0xa66a('0x0'));var rimraf=require(_0xa66a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa66a('0x2'));var rp=require('request-promise');var moment=require(_0xa66a('0x3'));var BPromise=require(_0xa66a('0x4'));var Mustache=require(_0xa66a('0x5'));var util=require(_0xa66a('0x6'));var path=require('path');var sox=require(_0xa66a('0x7'));var csv=require('to-csv');var ejs=require(_0xa66a('0x8'));var fs=require('fs');var fs_extra=require(_0xa66a('0x9'));var _=require(_0xa66a('0xa'));var squel=require(_0xa66a('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa66a('0xc'));var toCsv=require(_0xa66a('0xd'));var querystring=require('querystring');var Papa=require(_0xa66a('0xe'));var Redis=require(_0xa66a('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa66a('0x10'));var hardwareService=require(_0xa66a('0x11'));var logger=require(_0xa66a('0x12'))(_0xa66a('0x13'));var utils=require(_0xa66a('0x14'));var config=require(_0xa66a('0x15'));var licenseUtil=require(_0xa66a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a8a6e,_0x135651){_0x135651=_0x135651||0xcc;return function(_0x56cc5c){if(_0x56cc5c){return _0x5a8a6e[_0xa66a('0x17')](_0x135651);}return _0x5a8a6e[_0xa66a('0x18')](_0x135651)['end']();};}function respondWithResult(_0x311e64,_0x434599){_0x434599=_0x434599||0xc8;return function(_0xd0b3d9){if(_0xd0b3d9){return _0x311e64['status'](_0x434599)[_0xa66a('0x19')](_0xd0b3d9);}};}function respondWithFilteredResult(_0x256454,_0x3fe34f){return function(_0x179e22){if(_0x179e22){var _0x38c996=typeof _0x3fe34f[_0xa66a('0x1a')]==='undefined'&&typeof _0x3fe34f[_0xa66a('0x1b')]===_0xa66a('0x1c');var _0x598175=_0x179e22['count'];var _0x59b20c=_0x38c996?0x0:_0x3fe34f[_0xa66a('0x1a')];var _0x40d6f4=_0x38c996?_0x179e22[_0xa66a('0x1d')]:_0x3fe34f[_0xa66a('0x1a')]+_0x3fe34f['limit'];var _0x23eb74;if(_0x40d6f4>=_0x598175){_0x40d6f4=_0x598175;_0x23eb74=0xc8;}else{_0x23eb74=0xce;}_0x256454[_0xa66a('0x18')](_0x23eb74);return _0x256454[_0xa66a('0x1e')](_0xa66a('0x1f'),_0x59b20c+'-'+_0x40d6f4+'/'+_0x598175)[_0xa66a('0x19')](_0x179e22);}return null;};}function patchUpdates(_0x4ba095){return function(_0x58ec7c){try{jsonpatch['apply'](_0x58ec7c,_0x4ba095,!![]);}catch(_0x24dd39){return BPromise[_0xa66a('0x20')](_0x24dd39);}return _0x58ec7c[_0xa66a('0x21')]();};}function saveUpdates(_0x5f47db,_0x5e52f4){return function(_0x2f2f01){if(_0x2f2f01){return _0x2f2f01[_0xa66a('0x22')](_0x5f47db)[_0xa66a('0x23')](function(_0x29ea78){return _0x29ea78;});}return null;};}function removeEntity(_0x13a4d1,_0x5bfc94){return function(_0x427307){if(_0x427307){return _0x427307[_0xa66a('0x24')]()[_0xa66a('0x23')](function(){var _0x2b76a2=_0x427307['get']({'plain':!![]});var _0x1d4af2=_0xa66a('0x25');return db[_0xa66a('0x26')][_0xa66a('0x24')]({'where':{'type':_0x1d4af2,'resourceId':_0x2b76a2['id']}})['then'](function(){return _0x427307;});})[_0xa66a('0x23')](function(){_0x13a4d1[_0xa66a('0x18')](0xcc)[_0xa66a('0x27')]();});}};}function handleEntityNotFound(_0x5a1312,_0x24a271){return function(_0x387b38){if(!_0x387b38){_0x5a1312[_0xa66a('0x17')](0x194);}return _0x387b38;};}function handleError(_0x55d090,_0x707a91){_0x707a91=_0x707a91||0x1f4;return function(_0x81bc41){logger['error'](_0x81bc41[_0xa66a('0x28')]);if(_0x81bc41[_0xa66a('0x29')]){delete _0x81bc41[_0xa66a('0x29')];}_0x55d090[_0xa66a('0x18')](_0x707a91)[_0xa66a('0x2a')](_0x81bc41);};}exports['index']=function(_0x1b4477,_0x4ddabe){var _0xf71e={},_0x5d1096={},_0x125735={'count':0x0,'rows':[]};return db[_0xa66a('0x2b')][_0xa66a('0x2c')]()[_0xa66a('0x23')](function(_0x41135d){_0x5d1096[_0xa66a('0x2d')]=_['keys'](_0x41135d);_0x5d1096['query']=_['keys'](_0x1b4477['query']);_0x5d1096[_0xa66a('0x2e')]=_[_0xa66a('0x2f')](_0x5d1096[_0xa66a('0x2d')],_0x5d1096['query']);_0xf71e['attributes']=_['intersection'](_0x5d1096['model'],qs['fields'](_0x1b4477[_0xa66a('0x30')][_0xa66a('0x31')]));_0xf71e[_0xa66a('0x32')]=_0xf71e[_0xa66a('0x32')][_0xa66a('0x33')]?_0xf71e[_0xa66a('0x32')]:_0x5d1096[_0xa66a('0x2d')];if(!_0x1b4477['query'][_0xa66a('0x34')]('nolimit')){_0xf71e[_0xa66a('0x1b')]=qs[_0xa66a('0x1b')](_0x1b4477[_0xa66a('0x30')]['limit']);_0xf71e[_0xa66a('0x1a')]=qs[_0xa66a('0x1a')](_0x1b4477[_0xa66a('0x30')][_0xa66a('0x1a')]);}_0xf71e[_0xa66a('0x35')]=qs[_0xa66a('0x36')](_0x1b4477[_0xa66a('0x30')]['sort']);_0xf71e[_0xa66a('0x37')]=qs[_0xa66a('0x2e')](_[_0xa66a('0x38')](_0x1b4477[_0xa66a('0x30')],_0x5d1096[_0xa66a('0x2e')]),_0x41135d);if(_0x1b4477['query'][_0xa66a('0x39')]){_0xf71e[_0xa66a('0x37')]=_[_0xa66a('0x3a')](_0xf71e['where'],{'$or':_[_0xa66a('0x3b')](_0xf71e[_0xa66a('0x32')],function(_0x19b23b){var _0x34de4f={};_0x34de4f[_0x19b23b]={'$like':'%'+_0x1b4477[_0xa66a('0x30')]['filter']+'%'};return _0x34de4f;})});}_0xf71e=_[_0xa66a('0x3a')]({},_0xf71e,_0x1b4477[_0xa66a('0x3c')]);var _0x372a41={'where':_0xf71e[_0xa66a('0x37')]};return db[_0xa66a('0x2b')][_0xa66a('0x1d')](_0x372a41)[_0xa66a('0x23')](function(_0x540ccc){_0x125735[_0xa66a('0x1d')]=_0x540ccc;if(_0x1b4477[_0xa66a('0x30')][_0xa66a('0x3d')]){_0xf71e['include']=[{'all':!![]}];}return db[_0xa66a('0x2b')][_0xa66a('0x3e')](_0xf71e);})[_0xa66a('0x23')](function(_0x55eeca){_0x125735['rows']=_0x55eeca;return _0x125735;})[_0xa66a('0x23')](respondWithFilteredResult(_0x4ddabe,_0xf71e))[_0xa66a('0x3f')](handleError(_0x4ddabe,null));})[_0xa66a('0x3f')](handleError(_0x4ddabe,null));};exports[_0xa66a('0x40')]=function(_0x1259ca,_0x2254bd){var _0x43a441={'raw':![],'where':{'id':_0x1259ca[_0xa66a('0x41')]['id']}},_0xba2702={};_0xba2702[_0xa66a('0x2d')]=_['keys'](db[_0xa66a('0x2b')]['rawAttributes']);_0xba2702[_0xa66a('0x30')]=_[_0xa66a('0x42')](_0x1259ca['query']);_0xba2702[_0xa66a('0x2e')]=_[_0xa66a('0x2f')](_0xba2702[_0xa66a('0x2d')],_0xba2702[_0xa66a('0x30')]);_0x43a441[_0xa66a('0x32')]=_[_0xa66a('0x2f')](_0xba2702['model'],qs['fields'](_0x1259ca[_0xa66a('0x30')][_0xa66a('0x31')]));_0x43a441[_0xa66a('0x32')]=_0x43a441[_0xa66a('0x32')][_0xa66a('0x33')]?_0x43a441['attributes']:_0xba2702[_0xa66a('0x2d')];if(_0x1259ca[_0xa66a('0x30')][_0xa66a('0x3d')]){_0x43a441[_0xa66a('0x43')]=[{'all':!![]}];}_0x43a441=_[_0xa66a('0x3a')]({},_0x43a441,_0x1259ca['options']);return db[_0xa66a('0x2b')]['find'](_0x43a441)[_0xa66a('0x23')](handleEntityNotFound(_0x2254bd,null))[_0xa66a('0x23')](respondWithResult(_0x2254bd,null))[_0xa66a('0x3f')](handleError(_0x2254bd,null));};exports[_0xa66a('0x44')]=function(_0x4cd697,_0x1844fc){return db[_0xa66a('0x2b')][_0xa66a('0x44')](_0x4cd697[_0xa66a('0x45')],{})[_0xa66a('0x23')](function(_0x2618e6){var _0x3a5d22=_0x4cd697[_0xa66a('0x46')][_0xa66a('0x47')]({'plain':!![]});if(!_0x3a5d22)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a5d22['role']==='user'){var _0x13b8d2=_0x2618e6[_0xa66a('0x47')]({'plain':!![]});var _0x241fdb=_0xa66a('0x25');return db[_0xa66a('0x48')][_0xa66a('0x49')]({'where':{'name':_0x241fdb,'userProfileId':_0x3a5d22[_0xa66a('0x4a')]},'raw':!![]})[_0xa66a('0x23')](function(_0x32e646){if(_0x32e646&&_0x32e646[_0xa66a('0x4b')]===0x0){return db[_0xa66a('0x26')][_0xa66a('0x44')]({'name':_0x13b8d2[_0xa66a('0x29')],'resourceId':_0x13b8d2['id'],'type':_0x32e646[_0xa66a('0x29')],'sectionId':_0x32e646['id']},{})[_0xa66a('0x23')](function(){return _0x2618e6;});}else{return _0x2618e6;}})[_0xa66a('0x3f')](function(_0x442e5f){logger[_0xa66a('0x4c')](_0xa66a('0x4d'),_0x442e5f);throw _0x442e5f;});}return _0x2618e6;})[_0xa66a('0x23')](respondWithResult(_0x1844fc,0xc9))[_0xa66a('0x3f')](handleError(_0x1844fc,null));};exports[_0xa66a('0x22')]=function(_0x26af6f,_0x235555){if(_0x26af6f[_0xa66a('0x45')]['id']){delete _0x26af6f[_0xa66a('0x45')]['id'];}return db['CmCompany'][_0xa66a('0x49')]({'where':{'id':_0x26af6f[_0xa66a('0x41')]['id']}})[_0xa66a('0x23')](handleEntityNotFound(_0x235555,null))['then'](saveUpdates(_0x26af6f[_0xa66a('0x45')],null))[_0xa66a('0x23')](respondWithResult(_0x235555,null))[_0xa66a('0x3f')](handleError(_0x235555,null));};exports[_0xa66a('0x24')]=function(_0x532de6,_0x2ade7f){return db['CmCompany']['find']({'where':{'id':_0x532de6[_0xa66a('0x41')]['id']}})[_0xa66a('0x23')](handleEntityNotFound(_0x2ade7f,null))[_0xa66a('0x23')](removeEntity(_0x2ade7f,null))[_0xa66a('0x3f')](handleError(_0x2ade7f,null));};exports[_0xa66a('0x2c')]=function(_0x5dac6a,_0x1447bb){return db[_0xa66a('0x2b')]['describe']()['then'](respondWithResult(_0x1447bb,null))[_0xa66a('0x3f')](handleError(_0x1447bb,null));};exports[_0xa66a('0x4e')]=function(_0x15965f,_0x5dee5e,_0x5851d7){return db['CmContact'][_0xa66a('0x49')]({'where':{'id':_0x15965f[_0xa66a('0x41')]['id']}})[_0xa66a('0x23')](handleEntityNotFound(_0x5dee5e,null))['then'](function(_0x5a6398){if(_0x5a6398){return _0x5a6398['addContacts'](_0x15965f[_0xa66a('0x45')][_0xa66a('0x4f')],_[_0xa66a('0x50')](_0x15965f[_0xa66a('0x45')],[_0xa66a('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x5dee5e,null))['catch'](handleError(_0x5dee5e,null));};exports[_0xa66a('0x51')]=function(_0x18b3e2,_0x3d7061,_0x241000){var _0x330422={};var _0xc61c91={};var _0x7376b4;var _0x3d9dec;return db[_0xa66a('0x2b')][_0xa66a('0x52')]({'where':{'id':_0x18b3e2[_0xa66a('0x41')]['id']}})[_0xa66a('0x23')](handleEntityNotFound(_0x3d7061,null))[_0xa66a('0x23')](function(_0x3109bd){if(_0x3109bd){_0x7376b4=_0x3109bd;_0xc61c91[_0xa66a('0x2d')]=_[_0xa66a('0x42')](db['CmContact'][_0xa66a('0x53')]);_0xc61c91['query']=_[_0xa66a('0x42')](_0x18b3e2['query']);_0xc61c91[_0xa66a('0x2e')]=_[_0xa66a('0x2f')](_0xc61c91[_0xa66a('0x2d')],_0xc61c91['query']);_0x330422[_0xa66a('0x32')]=_[_0xa66a('0x2f')](_0xc61c91['model'],qs[_0xa66a('0x31')](_0x18b3e2[_0xa66a('0x30')]['fields']));_0x330422[_0xa66a('0x32')]=_0x330422[_0xa66a('0x32')]['length']?_0x330422['attributes']:_0xc61c91['model'];_0x330422[_0xa66a('0x35')]=qs[_0xa66a('0x36')](_0x18b3e2[_0xa66a('0x30')]['sort']);_0x330422[_0xa66a('0x37')]=qs[_0xa66a('0x2e')](_[_0xa66a('0x38')](_0x18b3e2[_0xa66a('0x30')],_0xc61c91[_0xa66a('0x2e')]));if(_0x18b3e2[_0xa66a('0x30')][_0xa66a('0x39')]){_0x330422[_0xa66a('0x37')]=_[_0xa66a('0x3a')](_0x330422['where'],{'$or':_['map'](_0x330422[_0xa66a('0x32')],function(_0x1f0ce7){var _0x5c013d={};_0x5c013d[_0x1f0ce7]={'$like':'%'+_0x18b3e2['query']['filter']+'%'};return _0x5c013d;})});}_0x330422=_[_0xa66a('0x3a')]({},_0x330422,_0x18b3e2[_0xa66a('0x3c')]);return _0x7376b4['getContacts'](_0x330422);}})[_0xa66a('0x23')](function(_0x2c7e6b){if(_0x2c7e6b){_0x3d9dec=_0x2c7e6b[_0xa66a('0x33')];if(!_0x18b3e2['query'][_0xa66a('0x34')](_0xa66a('0x54'))){_0x330422[_0xa66a('0x1b')]=qs[_0xa66a('0x1b')](_0x18b3e2[_0xa66a('0x30')][_0xa66a('0x1b')]);_0x330422[_0xa66a('0x1a')]=qs[_0xa66a('0x1a')](_0x18b3e2['query'][_0xa66a('0x1a')]);}return _0x7376b4[_0xa66a('0x51')](_0x330422);}})[_0xa66a('0x23')](function(_0x2f79d0){if(_0x2f79d0){return _0x2f79d0?{'count':_0x3d9dec,'rows':_0x2f79d0}:null;}})[_0xa66a('0x23')](respondWithResult(_0x3d7061,null))[_0xa66a('0x3f')](handleError(_0x3d7061,null));}; \ No newline at end of file +var _0x99b8=['body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','findOne','order','pick','map','options','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','json','reject','save','update','then','destroy','get','error','stack','name','CmCompany','describe','keys','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','where','merge','include','findAll','rows','catch','show','params','intersection','includeAll','create'];(function(_0x2375d6,_0x54fb98){var _0x4e3ab3=function(_0x16eede){while(--_0x16eede){_0x2375d6['push'](_0x2375d6['shift']());}};_0x4e3ab3(++_0x54fb98);}(_0x99b8,0x67));var _0x899b=function(_0x5e22f0,_0x346e80){_0x5e22f0=_0x5e22f0-0x0;var _0x2861a5=_0x99b8[_0x5e22f0];return _0x2861a5;};'use strict';var emlformat=require(_0x899b('0x0'));var rimraf=require(_0x899b('0x1'));var zipdir=require(_0x899b('0x2'));var jsonpatch=require(_0x899b('0x3'));var rp=require(_0x899b('0x4'));var moment=require(_0x899b('0x5'));var BPromise=require(_0x899b('0x6'));var Mustache=require(_0x899b('0x7'));var util=require(_0x899b('0x8'));var path=require(_0x899b('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x899b('0xa'));var _=require(_0x899b('0xb'));var squel=require('squel');var crypto=require(_0x899b('0xc'));var jsforce=require(_0x899b('0xd'));var deskjs=require(_0x899b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x899b('0xf'));var Papa=require(_0x899b('0x10'));var Redis=require(_0x899b('0x11'));var authService=require(_0x899b('0x12'));var qs=require(_0x899b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x899b('0x14'));var logger=require('../../config/logger')(_0x899b('0x15'));var utils=require(_0x899b('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x899b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37fdfd,_0x4a1d37){_0x4a1d37=_0x4a1d37||0xcc;return function(_0x1eb090){if(_0x1eb090){return _0x37fdfd[_0x899b('0x18')](_0x4a1d37);}return _0x37fdfd['status'](_0x4a1d37)[_0x899b('0x19')]();};}function respondWithResult(_0xc0aafa,_0x33561c){_0x33561c=_0x33561c||0xc8;return function(_0x1933e0){if(_0x1933e0){return _0xc0aafa[_0x899b('0x1a')](_0x33561c)['json'](_0x1933e0);}};}function respondWithFilteredResult(_0x3c231c,_0x9c3c44){return function(_0x21cf3c){if(_0x21cf3c){var _0x5420b4=typeof _0x9c3c44[_0x899b('0x1b')]===_0x899b('0x1c')&&typeof _0x9c3c44[_0x899b('0x1d')]===_0x899b('0x1c');var _0x3f0ee2=_0x21cf3c[_0x899b('0x1e')];var _0x1be7af=_0x5420b4?0x0:_0x9c3c44[_0x899b('0x1b')];var _0x566231=_0x5420b4?_0x21cf3c[_0x899b('0x1e')]:_0x9c3c44['offset']+_0x9c3c44['limit'];var _0x33874d;if(_0x566231>=_0x3f0ee2){_0x566231=_0x3f0ee2;_0x33874d=0xc8;}else{_0x33874d=0xce;}_0x3c231c[_0x899b('0x1a')](_0x33874d);return _0x3c231c['set']('Content-Range',_0x1be7af+'-'+_0x566231+'/'+_0x3f0ee2)[_0x899b('0x1f')](_0x21cf3c);}return null;};}function patchUpdates(_0x297715){return function(_0xd401c0){try{jsonpatch['apply'](_0xd401c0,_0x297715,!![]);}catch(_0x207d87){return BPromise[_0x899b('0x20')](_0x207d87);}return _0xd401c0[_0x899b('0x21')]();};}function saveUpdates(_0x2e3d07,_0x42e193){return function(_0x1544d2){if(_0x1544d2){return _0x1544d2[_0x899b('0x22')](_0x2e3d07)[_0x899b('0x23')](function(_0x1e5235){return _0x1e5235;});}return null;};}function removeEntity(_0x274e39,_0x463fa1){return function(_0x429402){if(_0x429402){return _0x429402[_0x899b('0x24')]()[_0x899b('0x23')](function(){var _0x3cce91=_0x429402[_0x899b('0x25')]({'plain':!![]});var _0x2ec734='Companies';return db['UserProfileResource']['destroy']({'where':{'type':_0x2ec734,'resourceId':_0x3cce91['id']}})[_0x899b('0x23')](function(){return _0x429402;});})[_0x899b('0x23')](function(){_0x274e39[_0x899b('0x1a')](0xcc)[_0x899b('0x19')]();});}};}function handleEntityNotFound(_0x197073,_0x463ef1){return function(_0x45d570){if(!_0x45d570){_0x197073[_0x899b('0x18')](0x194);}return _0x45d570;};}function handleError(_0x1ea5d0,_0x391c96){_0x391c96=_0x391c96||0x1f4;return function(_0x4bc518){logger[_0x899b('0x26')](_0x4bc518[_0x899b('0x27')]);if(_0x4bc518[_0x899b('0x28')]){delete _0x4bc518[_0x899b('0x28')];}_0x1ea5d0[_0x899b('0x1a')](_0x391c96)['send'](_0x4bc518);};}exports['index']=function(_0x4ffcd6,_0x420abd){var _0xef4c65={},_0x5b8b53={},_0x58c62f={'count':0x0,'rows':[]};return db[_0x899b('0x29')][_0x899b('0x2a')]()[_0x899b('0x23')](function(_0x4653d5){_0x5b8b53['model']=_[_0x899b('0x2b')](_0x4653d5);_0x5b8b53[_0x899b('0x2c')]=_[_0x899b('0x2b')](_0x4ffcd6[_0x899b('0x2c')]);_0x5b8b53[_0x899b('0x2d')]=_['intersection'](_0x5b8b53[_0x899b('0x2e')],_0x5b8b53[_0x899b('0x2c')]);_0xef4c65[_0x899b('0x2f')]=_['intersection'](_0x5b8b53[_0x899b('0x2e')],qs[_0x899b('0x30')](_0x4ffcd6[_0x899b('0x2c')][_0x899b('0x30')]));_0xef4c65['attributes']=_0xef4c65[_0x899b('0x2f')][_0x899b('0x31')]?_0xef4c65[_0x899b('0x2f')]:_0x5b8b53['model'];if(!_0x4ffcd6['query'][_0x899b('0x32')](_0x899b('0x33'))){_0xef4c65['limit']=qs[_0x899b('0x1d')](_0x4ffcd6[_0x899b('0x2c')]['limit']);_0xef4c65[_0x899b('0x1b')]=qs[_0x899b('0x1b')](_0x4ffcd6['query'][_0x899b('0x1b')]);}_0xef4c65['order']=qs[_0x899b('0x34')](_0x4ffcd6['query'][_0x899b('0x34')]);_0xef4c65['where']=qs[_0x899b('0x2d')](_['pick'](_0x4ffcd6[_0x899b('0x2c')],_0x5b8b53[_0x899b('0x2d')]),_0x4653d5);if(_0x4ffcd6[_0x899b('0x2c')][_0x899b('0x35')]){_0xef4c65[_0x899b('0x36')]=_[_0x899b('0x37')](_0xef4c65[_0x899b('0x36')],{'$or':_['map'](_0xef4c65[_0x899b('0x2f')],function(_0x4b4695){var _0x2b028f={};_0x2b028f[_0x4b4695]={'$like':'%'+_0x4ffcd6[_0x899b('0x2c')][_0x899b('0x35')]+'%'};return _0x2b028f;})});}_0xef4c65=_[_0x899b('0x37')]({},_0xef4c65,_0x4ffcd6['options']);var _0x1c2361={'where':_0xef4c65['where']};return db[_0x899b('0x29')][_0x899b('0x1e')](_0x1c2361)[_0x899b('0x23')](function(_0x48265c){_0x58c62f[_0x899b('0x1e')]=_0x48265c;if(_0x4ffcd6['query']['includeAll']){_0xef4c65[_0x899b('0x38')]=[{'all':!![]}];}return db[_0x899b('0x29')][_0x899b('0x39')](_0xef4c65);})[_0x899b('0x23')](function(_0x5c93f9){_0x58c62f[_0x899b('0x3a')]=_0x5c93f9;return _0x58c62f;})[_0x899b('0x23')](respondWithFilteredResult(_0x420abd,_0xef4c65))[_0x899b('0x3b')](handleError(_0x420abd,null));})[_0x899b('0x3b')](handleError(_0x420abd,null));};exports[_0x899b('0x3c')]=function(_0x5165cf,_0x2bddf4){var _0x1ca1c3={'raw':![],'where':{'id':_0x5165cf[_0x899b('0x3d')]['id']}},_0x3e365b={};_0x3e365b[_0x899b('0x2e')]=_[_0x899b('0x2b')](db[_0x899b('0x29')]['rawAttributes']);_0x3e365b[_0x899b('0x2c')]=_[_0x899b('0x2b')](_0x5165cf[_0x899b('0x2c')]);_0x3e365b[_0x899b('0x2d')]=_[_0x899b('0x3e')](_0x3e365b[_0x899b('0x2e')],_0x3e365b[_0x899b('0x2c')]);_0x1ca1c3[_0x899b('0x2f')]=_['intersection'](_0x3e365b[_0x899b('0x2e')],qs[_0x899b('0x30')](_0x5165cf['query'][_0x899b('0x30')]));_0x1ca1c3[_0x899b('0x2f')]=_0x1ca1c3[_0x899b('0x2f')][_0x899b('0x31')]?_0x1ca1c3[_0x899b('0x2f')]:_0x3e365b[_0x899b('0x2e')];if(_0x5165cf[_0x899b('0x2c')][_0x899b('0x3f')]){_0x1ca1c3[_0x899b('0x38')]=[{'all':!![]}];}_0x1ca1c3=_[_0x899b('0x37')]({},_0x1ca1c3,_0x5165cf['options']);return db[_0x899b('0x29')]['find'](_0x1ca1c3)['then'](handleEntityNotFound(_0x2bddf4,null))[_0x899b('0x23')](respondWithResult(_0x2bddf4,null))[_0x899b('0x3b')](handleError(_0x2bddf4,null));};exports[_0x899b('0x40')]=function(_0x4de4a8,_0x1b18af){return db[_0x899b('0x29')]['create'](_0x4de4a8[_0x899b('0x41')],{})['then'](function(_0x4d2141){var _0x136871=_0x4de4a8['user'][_0x899b('0x25')]({'plain':!![]});if(!_0x136871)throw new Error(_0x899b('0x42'));if(_0x136871[_0x899b('0x43')]===_0x899b('0x44')){var _0x383522=_0x4d2141[_0x899b('0x25')]({'plain':!![]});var _0xfbd1d3='Companies';return db['UserProfileSection'][_0x899b('0x45')]({'where':{'name':_0xfbd1d3,'userProfileId':_0x136871[_0x899b('0x46')]},'raw':!![]})[_0x899b('0x23')](function(_0x27cf8b){if(_0x27cf8b&&_0x27cf8b[_0x899b('0x47')]===0x0){return db[_0x899b('0x48')]['create']({'name':_0x383522[_0x899b('0x28')],'resourceId':_0x383522['id'],'type':_0x27cf8b[_0x899b('0x28')],'sectionId':_0x27cf8b['id']},{})[_0x899b('0x23')](function(){return _0x4d2141;});}else{return _0x4d2141;}})[_0x899b('0x3b')](function(_0x29e70a){logger[_0x899b('0x26')](_0x899b('0x49'),_0x29e70a);throw _0x29e70a;});}return _0x4d2141;})['then'](respondWithResult(_0x1b18af,0xc9))[_0x899b('0x3b')](handleError(_0x1b18af,null));};exports[_0x899b('0x22')]=function(_0x18bacd,_0x5d9ace){if(_0x18bacd[_0x899b('0x41')]['id']){delete _0x18bacd['body']['id'];}return db['CmCompany'][_0x899b('0x45')]({'where':{'id':_0x18bacd['params']['id']}})[_0x899b('0x23')](handleEntityNotFound(_0x5d9ace,null))[_0x899b('0x23')](saveUpdates(_0x18bacd[_0x899b('0x41')],null))[_0x899b('0x23')](respondWithResult(_0x5d9ace,null))[_0x899b('0x3b')](handleError(_0x5d9ace,null));};exports[_0x899b('0x24')]=function(_0x46463e,_0x431d1f){return db[_0x899b('0x29')][_0x899b('0x45')]({'where':{'id':_0x46463e[_0x899b('0x3d')]['id']}})[_0x899b('0x23')](handleEntityNotFound(_0x431d1f,null))[_0x899b('0x23')](removeEntity(_0x431d1f,null))['catch'](handleError(_0x431d1f,null));};exports[_0x899b('0x2a')]=function(_0x5686c5,_0x10d570){return db[_0x899b('0x29')][_0x899b('0x2a')]()['then'](respondWithResult(_0x10d570,null))[_0x899b('0x3b')](handleError(_0x10d570,null));};exports[_0x899b('0x4a')]=function(_0x4d106f,_0x39f5b3,_0x306268){return db[_0x899b('0x4b')][_0x899b('0x45')]({'where':{'id':_0x4d106f['params']['id']}})[_0x899b('0x23')](handleEntityNotFound(_0x39f5b3,null))[_0x899b('0x23')](function(_0x53191d){if(_0x53191d){return _0x53191d['addContacts'](_0x4d106f[_0x899b('0x41')][_0x899b('0x4c')],_[_0x899b('0x4d')](_0x4d106f[_0x899b('0x41')],['ids','id'])||{});}})[_0x899b('0x23')](respondWithResult(_0x39f5b3,null))[_0x899b('0x3b')](handleError(_0x39f5b3,null));};exports[_0x899b('0x4e')]=function(_0x52a44a,_0x4b58e6,_0x92d6ad){var _0x269bea={};var _0xbe9cbc={};var _0x5980b6;var _0x2aa4af;return db['CmCompany'][_0x899b('0x4f')]({'where':{'id':_0x52a44a[_0x899b('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4b58e6,null))[_0x899b('0x23')](function(_0x2e02e0){if(_0x2e02e0){_0x5980b6=_0x2e02e0;_0xbe9cbc[_0x899b('0x2e')]=_[_0x899b('0x2b')](db[_0x899b('0x4b')]['rawAttributes']);_0xbe9cbc['query']=_['keys'](_0x52a44a[_0x899b('0x2c')]);_0xbe9cbc[_0x899b('0x2d')]=_[_0x899b('0x3e')](_0xbe9cbc[_0x899b('0x2e')],_0xbe9cbc[_0x899b('0x2c')]);_0x269bea['attributes']=_[_0x899b('0x3e')](_0xbe9cbc[_0x899b('0x2e')],qs['fields'](_0x52a44a[_0x899b('0x2c')][_0x899b('0x30')]));_0x269bea[_0x899b('0x2f')]=_0x269bea[_0x899b('0x2f')]['length']?_0x269bea['attributes']:_0xbe9cbc[_0x899b('0x2e')];_0x269bea[_0x899b('0x50')]=qs['sort'](_0x52a44a[_0x899b('0x2c')][_0x899b('0x34')]);_0x269bea[_0x899b('0x36')]=qs[_0x899b('0x2d')](_[_0x899b('0x51')](_0x52a44a[_0x899b('0x2c')],_0xbe9cbc[_0x899b('0x2d')]));if(_0x52a44a[_0x899b('0x2c')]['filter']){_0x269bea[_0x899b('0x36')]=_['merge'](_0x269bea[_0x899b('0x36')],{'$or':_[_0x899b('0x52')](_0x269bea['attributes'],function(_0x3e033e){var _0x2e660e={};_0x2e660e[_0x3e033e]={'$like':'%'+_0x52a44a['query'][_0x899b('0x35')]+'%'};return _0x2e660e;})});}_0x269bea=_[_0x899b('0x37')]({},_0x269bea,_0x52a44a[_0x899b('0x53')]);return _0x5980b6[_0x899b('0x4e')](_0x269bea);}})[_0x899b('0x23')](function(_0x5c5421){if(_0x5c5421){_0x2aa4af=_0x5c5421['length'];if(!_0x52a44a[_0x899b('0x2c')][_0x899b('0x32')]('nolimit')){_0x269bea['limit']=qs[_0x899b('0x1d')](_0x52a44a['query'][_0x899b('0x1d')]);_0x269bea[_0x899b('0x1b')]=qs[_0x899b('0x1b')](_0x52a44a['query'][_0x899b('0x1b')]);}return _0x5980b6[_0x899b('0x4e')](_0x269bea);}})[_0x899b('0x23')](function(_0x6d3ca4){if(_0x6d3ca4){return _0x6d3ca4?{'count':_0x2aa4af,'rows':_0x6d3ca4}:null;}})[_0x899b('0x23')](respondWithResult(_0x4b58e6,null))['catch'](handleError(_0x4b58e6,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 8557cb9..4416669 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 _0x2002=['define','cm_companies','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports'];(function(_0x4801f4,_0x594dd9){var _0x1717ac=function(_0x1d8e59){while(--_0x1d8e59){_0x4801f4['push'](_0x4801f4['shift']());}};_0x1717ac(++_0x594dd9);}(_0x2002,0x86));var _0x2200=function(_0x51a6d6,_0x3c9c49){_0x51a6d6=_0x51a6d6-0x0;var _0x5ef1a8=_0x2002[_0x51a6d6];return _0x5ef1a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2200('0x0'))(_0x2200('0x1'));var moment=require(_0x2200('0x2'));var BPromise=require(_0x2200('0x3'));var rp=require(_0x2200('0x4'));var fs=require('fs');var path=require(_0x2200('0x5'));var rimraf=require(_0x2200('0x6'));var config=require(_0x2200('0x7'));var attributes=require(_0x2200('0x8'));module[_0x2200('0x9')]=function(_0x19b2c0,_0x45c2ff){return _0x19b2c0[_0x2200('0xa')]('CmCompany',attributes,{'tableName':_0x2200('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe945=['CmCompany','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define'];(function(_0x25228c,_0x4c028c){var _0x5416a1=function(_0x4f0478){while(--_0x4f0478){_0x25228c['push'](_0x25228c['shift']());}};_0x5416a1(++_0x4c028c);}(_0xe945,0x139));var _0x5e94=function(_0x259ca4,_0x1b4dcc){_0x259ca4=_0x259ca4-0x0;var _0x1516bc=_0xe945[_0x259ca4];return _0x1516bc;};'use strict';var _=require(_0x5e94('0x0'));var util=require(_0x5e94('0x1'));var logger=require(_0x5e94('0x2'))(_0x5e94('0x3'));var moment=require('moment');var BPromise=require(_0x5e94('0x4'));var rp=require(_0x5e94('0x5'));var fs=require('fs');var path=require(_0x5e94('0x6'));var rimraf=require(_0x5e94('0x7'));var config=require(_0x5e94('0x8'));var attributes=require(_0x5e94('0x9'));module['exports']=function(_0x4d6da4,_0x4d0bd8){return _0x4d6da4[_0x5e94('0xa')](_0x5e94('0xb'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 938d63b..cd3351f 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 _0x61fb=['../../config/environment','jayson/promise','client','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x443c80,_0x33ffd4){var _0x463d65=function(_0xc1c54b){while(--_0xc1c54b){_0x443c80['push'](_0x443c80['shift']());}};_0x463d65(++_0x33ffd4);}(_0x61fb,0x1da));var _0xb61f=function(_0x4b790a,_0x45edd1){_0x4b790a=_0x4b790a-0x0;var _0x598214=_0x61fb[_0x4b790a];return _0x598214;};'use strict';var _=require(_0xb61f('0x0'));var util=require('util');var moment=require(_0xb61f('0x1'));var BPromise=require(_0xb61f('0x2'));var rs=require(_0xb61f('0x3'));var fs=require('fs');var Redis=require(_0xb61f('0x4'));var db=require(_0xb61f('0x5'))['db'];var utils=require(_0xb61f('0x6'));var logger=require(_0xb61f('0x7'))(_0xb61f('0x8'));var config=require(_0xb61f('0x9'));var jayson=require(_0xb61f('0xa'));var client=jayson[_0xb61f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32e5f6,_0x379e87,_0x1ae3d4){return new BPromise(function(_0x5220eb,_0x1e1327){return client['request'](_0x32e5f6,_0x1ae3d4)['then'](function(_0x365cd3){logger[_0xb61f('0xc')](_0xb61f('0xd'),_0x379e87,_0xb61f('0xe'));logger[_0xb61f('0xf')](_0xb61f('0x10'),_0x379e87,'request\x20sent',JSON['stringify'](_0x365cd3));if(_0x365cd3[_0xb61f('0x11')]){if(_0x365cd3['error'][_0xb61f('0x12')]===0x1f4){logger[_0xb61f('0x11')]('CmCompany,\x20%s,\x20%s',_0x379e87,_0x365cd3['error']['message']);return _0x1e1327(_0x365cd3[_0xb61f('0x11')][_0xb61f('0x13')]);}logger[_0xb61f('0x11')](_0xb61f('0xd'),_0x379e87,_0x365cd3['error'][_0xb61f('0x13')]);return _0x5220eb(_0x365cd3[_0xb61f('0x11')][_0xb61f('0x13')]);}else{logger[_0xb61f('0xc')](_0xb61f('0xd'),_0x379e87,_0xb61f('0xe'));_0x5220eb(_0x365cd3[_0xb61f('0x14')][_0xb61f('0x13')]);}})['catch'](function(_0xac06d9){logger[_0xb61f('0x11')](_0xb61f('0xd'),_0x379e87,_0xac06d9);_0x1e1327(_0xac06d9);});});} \ No newline at end of file +var _0xc910=['error','message','CmCompany,\x20%s,\x20%s','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','stringify','code'];(function(_0x4e9c0a,_0x16a894){var _0x3448dd=function(_0x13eef7){while(--_0x13eef7){_0x4e9c0a['push'](_0x4e9c0a['shift']());}};_0x3448dd(++_0x16a894);}(_0xc910,0x7c));var _0x0c91=function(_0x56c53f,_0x4bd865){_0x56c53f=_0x56c53f-0x0;var _0x52b7b7=_0xc910[_0x56c53f];return _0x52b7b7;};'use strict';var _=require(_0x0c91('0x0'));var util=require('util');var moment=require(_0x0c91('0x1'));var BPromise=require(_0x0c91('0x2'));var rs=require(_0x0c91('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c91('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c91('0x5'))(_0x0c91('0x6'));var config=require(_0x0c91('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0c91('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f0d9f,_0x18b494,_0x1940cc){return new BPromise(function(_0x1350f9,_0x9fa0bf){return client[_0x0c91('0x9')](_0x5f0d9f,_0x1940cc)[_0x0c91('0xa')](function(_0x299dad){logger[_0x0c91('0xb')]('CmCompany,\x20%s,\x20%s',_0x18b494,_0x0c91('0xc'));logger[_0x0c91('0xd')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x18b494,_0x0c91('0xc'),JSON[_0x0c91('0xe')](_0x299dad));if(_0x299dad['error']){if(_0x299dad['error'][_0x0c91('0xf')]===0x1f4){logger[_0x0c91('0x10')]('CmCompany,\x20%s,\x20%s',_0x18b494,_0x299dad[_0x0c91('0x10')][_0x0c91('0x11')]);return _0x9fa0bf(_0x299dad['error'][_0x0c91('0x11')]);}logger[_0x0c91('0x10')](_0x0c91('0x12'),_0x18b494,_0x299dad[_0x0c91('0x10')][_0x0c91('0x11')]);return _0x1350f9(_0x299dad[_0x0c91('0x10')]['message']);}else{logger[_0x0c91('0xb')](_0x0c91('0x12'),_0x18b494,_0x0c91('0xc'));_0x1350f9(_0x299dad['result']['message']);}})[_0x0c91('0x13')](function(_0x1967c7){logger['error'](_0x0c91('0x12'),_0x18b494,_0x1967c7);_0x9fa0bf(_0x1967c7);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index a2ff3b8..e070e33 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 _0xe9bd=['../../components/auth/service','../../config/environment','get','/describe','isAuthenticated','show','/:id/contacts','getContacts','post','put','/:id','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x2eec66,_0x3a145b){var _0x50d1b9=function(_0x89008){while(--_0x89008){_0x2eec66['push'](_0x2eec66['shift']());}};_0x50d1b9(++_0x3a145b);}(_0xe9bd,0x111));var _0xde9b=function(_0x34817b,_0x20294d){_0x34817b=_0x34817b-0x0;var _0x2beab2=_0xe9bd[_0x34817b];return _0x2beab2;};'use strict';var multer=require(_0xde9b('0x0'));var util=require(_0xde9b('0x1'));var path=require(_0xde9b('0x2'));var timeout=require(_0xde9b('0x3'));var express=require(_0xde9b('0x4'));var router=express[_0xde9b('0x5')]();var fs_extra=require(_0xde9b('0x6'));var auth=require(_0xde9b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xde9b('0x8'));var controller=require('./cmCompany.controller');router[_0xde9b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xde9b('0x9')](_0xde9b('0xa'),auth[_0xde9b('0xb')](),controller['describe']);router[_0xde9b('0x9')]('/:id',auth[_0xde9b('0xb')](),controller[_0xde9b('0xc')]);router[_0xde9b('0x9')](_0xde9b('0xd'),auth[_0xde9b('0xb')](),controller[_0xde9b('0xe')]);router[_0xde9b('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xde9b('0xf')](_0xde9b('0xd'),auth[_0xde9b('0xb')](),controller['addContacts']);router[_0xde9b('0x10')](_0xde9b('0x11'),auth[_0xde9b('0xb')](),controller[_0xde9b('0x12')]);router['delete'](_0xde9b('0x11'),auth[_0xde9b('0xb')](),controller[_0xde9b('0x13')]);module['exports']=router; \ No newline at end of file +var _0x5120=['get','index','/describe','isAuthenticated','describe','show','/:id/contacts','post','create','addContacts','put','/:id','update','delete','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller'];(function(_0x2e024c,_0x3fe31b){var _0x3192b7=function(_0x5be52e){while(--_0x5be52e){_0x2e024c['push'](_0x2e024c['shift']());}};_0x3192b7(++_0x3fe31b);}(_0x5120,0xe7));var _0x0512=function(_0x185a5a,_0x19442b){_0x185a5a=_0x185a5a-0x0;var _0x39bd2d=_0x5120[_0x185a5a];return _0x39bd2d;};'use strict';var multer=require('multer');var util=require(_0x0512('0x0'));var path=require(_0x0512('0x1'));var timeout=require('connect-timeout');var express=require(_0x0512('0x2'));var router=express[_0x0512('0x3')]();var fs_extra=require(_0x0512('0x4'));var auth=require(_0x0512('0x5'));var interaction=require(_0x0512('0x6'));var config=require(_0x0512('0x7'));var controller=require(_0x0512('0x8'));router[_0x0512('0x9')]('/',auth['isAuthenticated'](),controller[_0x0512('0xa')]);router[_0x0512('0x9')](_0x0512('0xb'),auth[_0x0512('0xc')](),controller[_0x0512('0xd')]);router[_0x0512('0x9')]('/:id',auth[_0x0512('0xc')](),controller[_0x0512('0xe')]);router[_0x0512('0x9')](_0x0512('0xf'),auth[_0x0512('0xc')](),controller['getContacts']);router[_0x0512('0x10')]('/',auth[_0x0512('0xc')](),controller[_0x0512('0x11')]);router[_0x0512('0x10')](_0x0512('0xf'),auth[_0x0512('0xc')](),controller[_0x0512('0x12')]);router[_0x0512('0x13')](_0x0512('0x14'),auth[_0x0512('0xc')](),controller[_0x0512('0x15')]);router[_0x0512('0x16')](_0x0512('0x14'),auth[_0x0512('0xc')](),controller[_0x0512('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index a5718a7..1efcb1a 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 _0x5d89=['sequelize','exports','STRING','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x48f3e2,_0x19e0ca){var _0x418a58=function(_0x4d19d6){while(--_0x4d19d6){_0x48f3e2['push'](_0x48f3e2['shift']());}};_0x418a58(++_0x19e0ca);}(_0x5d89,0x1b9));var _0x95d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5d89[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var Sequelize=require(_0x95d8('0x0'));module[_0x95d8('0x1')]={'firstName':{'type':Sequelize[_0x95d8('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x95d8('0x2')]},'street':{'type':Sequelize[_0x95d8('0x2')]},'postalCode':{'type':Sequelize[_0x95d8('0x2')]},'city':{'type':Sequelize[_0x95d8('0x2')]},'country':{'type':Sequelize[_0x95d8('0x2')]},'dateOfBirth':{'type':Sequelize[_0x95d8('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x95d8('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x95d8('0x2')]},'email':{'type':Sequelize[_0x95d8('0x2')]},'url':{'type':Sequelize[_0x95d8('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x95d8('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x95d8('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x95d8('0x2')]},'telegram':{'type':Sequelize[_0x95d8('0x2')]},'UserId':{'type':Sequelize[_0x95d8('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x95d8('0x2')]},'priority':{'type':Sequelize[_0x95d8('0x3')](0x2)[_0x95d8('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x95d8('0x5')],'defaultValue':Sequelize[_0x95d8('0x6')]},'dialTimezone':{'type':Sequelize[_0x95d8('0x2')]},'utcOffset':{'type':Sequelize[_0x95d8('0x3')]}}; \ No newline at end of file +var _0xabb6=['TEXT','INTEGER','UNSIGNED','DATE','sequelize','exports','STRING'];(function(_0x17a9c7,_0x4f33f3){var _0x32831e=function(_0x33132c){while(--_0x33132c){_0x17a9c7['push'](_0x17a9c7['shift']());}};_0x32831e(++_0x4f33f3);}(_0xabb6,0x18c));var _0x6abb=function(_0x339287,_0x2f3015){_0x339287=_0x339287-0x0;var _0x4e0df0=_0xabb6[_0x339287];return _0x4e0df0;};'use strict';var _=require('lodash');var Sequelize=require(_0x6abb('0x0'));module[_0x6abb('0x1')]={'firstName':{'type':Sequelize[_0x6abb('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x6abb('0x2')]},'street':{'type':Sequelize[_0x6abb('0x2')]},'postalCode':{'type':Sequelize[_0x6abb('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x6abb('0x2')]},'dateOfBirth':{'type':Sequelize[_0x6abb('0x2')]},'description':{'type':Sequelize[_0x6abb('0x3')]},'phone':{'type':Sequelize[_0x6abb('0x2')]},'mobile':{'type':Sequelize[_0x6abb('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x6abb('0x2')]},'url':{'type':Sequelize[_0x6abb('0x2')]},'facebook':{'type':Sequelize[_0x6abb('0x2')]},'fb_data':{'type':Sequelize[_0x6abb('0x2')]},'twitter':{'type':Sequelize[_0x6abb('0x2')]},'skype':{'type':Sequelize[_0x6abb('0x2')]},'teams':{'type':Sequelize[_0x6abb('0x2')]},'viber':{'type':Sequelize[_0x6abb('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x6abb('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x6abb('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x6abb('0x2')]},'priority':{'type':Sequelize[_0x6abb('0x4')](0x2)[_0x6abb('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x6abb('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x6abb('0x2')]},'utcOffset':{'type':Sequelize[_0x6abb('0x4')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 5ea9c83..629954b 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','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','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x37b7b6,_0x165a5c){var _0x10c4c3=function(_0x16d71e){while(--_0x16d71e){_0x37b7b6['push'](_0x37b7b6['shift']());}};_0x10c4c3(++_0x165a5c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file +var _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','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','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x138f59,_0x1b53fb){var _0x3d114d=function(_0x1f9461){while(--_0x1f9461){_0x138f59['push'](_0x138f59['shift']());}};_0x3d114d(++_0x1b53fb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b60x0){return new Promise(function(_0x56e31e){var _0x3ef315=[];for(var _0x427946=0x0;_0x427946<_0x401837[_0x0a9e('0x2b')];_0x427946++){_0x3ef315['push'](insertAdditionalPhones(_0x401837[_0x427946]['contact'],_0x401837[_0x427946]['additionalPhones']));}Promise[_0x0a9e('0x62')](_0x3ef315)[_0x0a9e('0x15')](function(){_0x56e31e(0x1);});})[_0x0a9e('0x15')](function(){return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};});}else{return{'success':_0x17e88c,'failure':_0x88dcbf,'duplicates':_0x409b29};}}})[_0x0a9e('0x15')](respondWithResult(_0x797b45,0xc9))[_0x0a9e('0x20')](handleError(_0x797b45,null));};exports[_0x0a9e('0x63')]=function(_0xeef20,_0x1a0677){var _0x5512d1;return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x4a4fc7){return db[_0x0a9e('0x21')]['find']({'where':{'id':_0xeef20[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x0a9e('0x64')],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'required':_0xeef20[_0x0a9e('0x1e')][_0x0a9e('0x66')]?!![]:![]},{'model':db['CmContactHasItem'],'as':_0x0a9e('0x67'),'where':{'CmContactId':_0xeef20[_0x0a9e('0x23')]['id']},'required':![],'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}]}],'order':[db['sequelize'][_0x0a9e('0x6a')](_0x0a9e('0x6b'))],'attributes':_[_0x0a9e('0x25')](_0x4a4fc7)});})[_0x0a9e('0x15')](function(_0x4abc8f){if(!_[_0x0a9e('0x56')](_0x4abc8f)){_0x5512d1=_0x4abc8f[_0x0a9e('0x34')]({'plain':!![]});var _0x30a4c7={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0x4abc8f&&_0x4abc8f[_0x0a9e('0x5f')]){if(_0x4abc8f[_0x0a9e('0x5f')]){_0x30a4c7[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0x4abc8f[_0x0a9e('0x5f')]}});}}return db[_0x0a9e('0x2a')][_0x0a9e('0x1d')](_0x30a4c7);}})[_0x0a9e('0x15')](function(_0x25744a){if(!_[_0x0a9e('0x56')](_0x25744a)){return _['omit'](_0x5512d1,_[_0x0a9e('0x6d')](_0x25744a,function(_0x11da9c){return util[_0x0a9e('0x6e')]('cf_%d',_0x11da9c['id']);}));}})[_0x0a9e('0x15')](handleEntityNotFound(_0x1a0677,null))[_0x0a9e('0x15')](respondWithResult(_0x1a0677,null))[_0x0a9e('0x20')](handleError(_0x1a0677,null));};exports[_0x0a9e('0x3f')]=function(_0x56d650,_0x541e80){var _0x7ebea8;if(_0x56d650[_0x0a9e('0x32')]['id']){delete _0x56d650['body']['id'];}if(!_[_0x0a9e('0x56')](_0x56d650['body'][_0x0a9e('0x55')])){var _0x8ebf02=_0x56d650['body'][_0x0a9e('0x55')];if(!_[_0x0a9e('0x56')](shared[_0x0a9e('0x57')][_0x8ebf02]))_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x58')]=shared[_0x0a9e('0x57')][_0x8ebf02][_0x0a9e('0x58')];}return db['CmContact'][_0x0a9e('0x22')]({'where':{'id':_0x56d650[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x541e80,null))[_0x0a9e('0x15')](saveUpdates(_0x56d650['body'],null))[_0x0a9e('0x15')](function(_0xf0db1){_0x7ebea8=_0xf0db1;var _0x4bf3a5={'where':{'$and':[{'ListId':{'$ne':null}}]}};if(_0xf0db1&&_0xf0db1[_0x0a9e('0x5f')]){if(_0xf0db1['ListId']){_0x4bf3a5[_0x0a9e('0x5c')][_0x0a9e('0x6c')][_0x0a9e('0x5e')]({'ListId':{'$ne':_0xf0db1[_0x0a9e('0x5f')]}});}}return db['CmCustomField']['findAll'](_0x4bf3a5);})[_0x0a9e('0x15')](function(_0x2b9c01){if(_0x2b9c01){return _[_0x0a9e('0x6f')](_['pickBy'](_0x56d650[_0x0a9e('0x32')],function(_0x36e975,_0x524e38){return _['startsWith'](_0x524e38,_0x0a9e('0x27'));}),_['map'](_0x2b9c01,function(_0x5ea541){return util['format'](_0x0a9e('0x70'),_0x5ea541['id']);}));}})[_0x0a9e('0x15')](function(_0x9044fe){if(_0x9044fe&&!_[_0x0a9e('0x71')](_0x9044fe)){var _0x3c6dd6=squel[_0x0a9e('0x3f')]()['table'](_0x0a9e('0x72'))['setFields'](_0x9044fe)[_0x0a9e('0x5c')](_0x0a9e('0x73'),_0x56d650[_0x0a9e('0x23')]['id'])[_0x0a9e('0x74')]();return db['sequelize'][_0x0a9e('0x1e')](_0x3c6dd6[_0x0a9e('0x75')],{'replacements':_0x3c6dd6[_0x0a9e('0x2f')]});}})['then'](function(){if(_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')]&&_0x7ebea8){return db[_0x0a9e('0x39')][_0x0a9e('0x3f')]({'phone':_0x56d650[_0x0a9e('0x32')][_0x0a9e('0x76')],'OrderBy':0x0},{'where':{'ContactId':_0x7ebea8['id']}});}})[_0x0a9e('0x15')](function(){return _0x7ebea8;})[_0x0a9e('0x15')](respondWithResult(_0x541e80,null))['catch'](handleError(_0x541e80,null));};exports[_0x0a9e('0x77')]=function(_0x3325c5,_0x589ff3){var _0x40e0f0={};var _0x982340={};var _0x3a1974;var _0x5a26c8;return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x3325c5[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x589ff3,null))[_0x0a9e('0x15')](function(_0x1f29bd){if(_0x1f29bd){_0x3a1974=_0x1f29bd;_0x982340[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x64')][_0x0a9e('0x79')]);_0x982340['query']=_[_0x0a9e('0x25')](_0x3325c5[_0x0a9e('0x1e')]);_0x982340[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],_0x982340[_0x0a9e('0x1e')]);_0x40e0f0[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x982340[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x40e0f0[_0x0a9e('0x7c')]=_0x40e0f0['attributes'][_0x0a9e('0x2b')]?_0x40e0f0[_0x0a9e('0x7c')]:_0x982340[_0x0a9e('0x78')];_0x40e0f0[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x3325c5['query'][_0x0a9e('0x7f')]);_0x40e0f0[_0x0a9e('0x5c')]=qs['filters'](_[_0x0a9e('0x80')](_0x3325c5['query'],_0x982340[_0x0a9e('0x7a')]));if(_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x40e0f0[_0x0a9e('0x5c')]=_['merge'](_0x40e0f0[_0x0a9e('0x5c')],{'$or':_['map'](_0x40e0f0[_0x0a9e('0x7c')],function(_0x3d0a77){var _0x5e5b89={};_0x5e5b89[_0x3d0a77]={'$like':'%'+_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x5e5b89;})});}_0x40e0f0=_[_0x0a9e('0x82')]({},_0x40e0f0,_0x3325c5['options']);return _0x3a1974['getTags'](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x6ba2be){if(_0x6ba2be){_0x5a26c8=_0x6ba2be[_0x0a9e('0x2b')];if(!_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x40e0f0[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3325c5[_0x0a9e('0x1e')]['limit']);_0x40e0f0[_0x0a9e('0x10')]=qs['offset'](_0x3325c5[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}return _0x3a1974[_0x0a9e('0x77')](_0x40e0f0);}})[_0x0a9e('0x15')](function(_0x1b61d5){if(_0x1b61d5){return _0x1b61d5?{'count':_0x5a26c8,'rows':_0x1b61d5}:null;}})['then'](respondWithResult(_0x589ff3,null))[_0x0a9e('0x20')](handleError(_0x589ff3,null));};exports[_0x0a9e('0x84')]=function(_0x2791c5,_0x2aa5f2){if(_0x2791c5[_0x0a9e('0x32')]['id']){delete _0x2791c5['body']['id'];}return db['CmContact'][_0x0a9e('0x85')]({'where':{'id':_0x2791c5['params']['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x2aa5f2,null))[_0x0a9e('0x15')](function(_0x4672e1){if(_0x4672e1){return _0x4672e1[_0x0a9e('0x84')](_0x2791c5[_0x0a9e('0x32')][_0x0a9e('0x86')]||[]);}return null;})['then'](respondWithResult(_0x2aa5f2,null))['catch'](handleError(_0x2aa5f2,null));};exports[_0x0a9e('0x87')]=function(_0x5dfbe2,_0x2469d1){var _0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](addAdditionalPhones(_0x5dfbe2['body']));Promise['all'](_0x5c689c)[_0x0a9e('0x15')](function(){_0x5c689c=[];_0x5c689c[_0x0a9e('0x5e')](deleteCmHopperPhones(_0x5dfbe2['body']['id']));_0x5c689c[_0x0a9e('0x5e')](addCmHopperPhones(_0x5dfbe2[_0x0a9e('0x32')]['id']));Promise[_0x0a9e('0x62')](_0x5c689c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x2469d1,null));});};function addAdditionalPhones(_0x5ab0bc){var _0x5505f4;return new Promise(function(_0x16449b){return db[_0x0a9e('0x4a')][_0x0a9e('0x16')]({'where':{'CmContactId':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){db[_0x0a9e('0x68')]['findAll']({'raw':!![],'attributes':['id',_0x0a9e('0x88')]})[_0x0a9e('0x15')](function(_0x5416a9){var _0x3c313d=[];for(var _0x19fd11=0x0;_0x19fd11<_0x5ab0bc[_0x0a9e('0x89')][_0x0a9e('0x2b')];_0x19fd11++){var _0x23b25b=_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?'':_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['ItemTypeId']?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:'';var _0x2ada60=_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11]['description'])?'':_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8c')];var _0x16ae1a=_0x23b25b+':'+_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')]+'§'+_0x2ada60;if(_[_0x0a9e('0x56')](_0x5505f4))_0x5505f4=_0x16ae1a;else _0x5505f4+=';'+_0x16ae1a;var _0x59e46f=null;var _0x1339d0=null;if(_0x5ab0bc[_0x0a9e('0x8a')]){if(!_[_0x0a9e('0x56')](_0x5ab0bc['item_types'][_0x19fd11])){_0x1339d0=_[_0x0a9e('0x22')](_0x5416a9,function(_0x59aa7b){return _0x59aa7b['id']===_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11];});if(!_['isNil'](_0x1339d0)){_0x59e46f=_0x1339d0[_0x0a9e('0x88')];}}}else{if(!_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11])){_0x1339d0=_['find'](_0x5416a9,function(_0xc9529d){return _0xc9529d['id']===_0x5ab0bc['items'][_0x19fd11][_0x0a9e('0x8b')];});if(!_[_0x0a9e('0x56')](_0x1339d0)){_0x59e46f=_0x19fd11;}}}if(_[_0x0a9e('0x56')](_0x59e46f)){_0x59e46f=0x64;}_0x3c313d[_0x0a9e('0x5e')](addAdditionalPhone(_0x5ab0bc['id'],_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x76')],_0x5ab0bc[_0x0a9e('0x8a')]?_[_0x0a9e('0x56')](_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11])?null:_0x5ab0bc[_0x0a9e('0x8a')][_0x19fd11]:_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]?_0x5ab0bc[_0x0a9e('0x89')][_0x19fd11][_0x0a9e('0x8b')]:null,_0x59e46f,_0x2ada60));}Promise[_0x0a9e('0x62')](_0x3c313d)[_0x0a9e('0x15')](function(){db['CmContact']['update']({'AdditionalPhones':_0x5505f4},{'where':{'id':_0x5ab0bc['id']}})[_0x0a9e('0x15')](function(){_0x16449b(0x1);});});});});});}function addAdditionalPhone(_0x5c4be0,_0x1d999b,_0x3428c9,_0x5d6b69,_0x1a3754){return db[_0x0a9e('0x4a')][_0x0a9e('0x22')]({'where':{'CmContactId':_0x5c4be0,'item':_0x1d999b}})[_0x0a9e('0x15')](function(_0x5585d5){if(_0x5585d5)logger[_0x0a9e('0x37')](_0x0a9e('0x8d'),_0x5585d5);else{db[_0x0a9e('0x4a')][_0x0a9e('0x3d')]({'CmContactId':_0x5c4be0,'item':_0x1d999b,'ItemTypeId':_0x3428c9,'OrderBy':_0x5d6b69,'ItemClass':'PHONE','description':_0x1a3754});}});}function deleteCmHopperPhones(_0x19e9ed){return new Promise(function(_0x1a0b08){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x19e9ed}})[_0x0a9e('0x15')](function(_0x270df8){db[_0x0a9e('0x8e')]['destroy']({'where':{'CmHopperId':{'$in':_[_0x0a9e('0x6d')](_0x270df8,'id')}}});})[_0x0a9e('0x15')](function(){_0x1a0b08(0x1);});});}function addCmHopperPhones(_0x1d9b57){return new Promise(function(_0x1a7f58){return db[_0x0a9e('0x39')]['findAll']({'raw':!![],'attributes':['id'],'where':{'ContactId':_0x1d9b57}})[_0x0a9e('0x15')](function(_0x289e65){var _0x4795ae=[];_[_0x0a9e('0x6d')](_0x289e65,function(_0x1fcfe6){_0x4795ae[_0x0a9e('0x5e')](createCmHopperPhone(_0x1d9b57,_0x1fcfe6['id']));});Promise['all'](_0x4795ae)['then'](function(){_0x1a7f58(0x1);});});});}function createCmHopperPhone(_0x523d08,_0x1015aa){return new Promise(function(_0x4a70ce){db['CmContactHasItem'][_0x0a9e('0x1d')]({'raw':!![],'attributes':[_0x0a9e('0x8f'),_0x0a9e('0x88')],'where':{'CmContactId':_0x523d08,'ItemClass':'PHONE'},'include':[{'model':db[_0x0a9e('0x68')],'attributes':[_0x0a9e('0x88')],'as':_0x0a9e('0x69')}],'order':[_0x0a9e('0x88'),db[_0x0a9e('0x90')][_0x0a9e('0x6a')](_0x0a9e('0x91'))]})[_0x0a9e('0x15')](function(_0x3b5bda){var _0x5a1848=0x1;var _0x43c397=_['map'](_0x3b5bda,function(_0x138cf5){_0x138cf5[_0x0a9e('0x92')]=_0x1015aa;_0x138cf5[_0x0a9e('0x76')]=_0x138cf5[_0x0a9e('0x8f')];_0x138cf5[_0x0a9e('0x88')]=_0x5a1848;delete _0x138cf5[_0x0a9e('0x93')];_0x5a1848=_0x5a1848+0x1;return _0x138cf5;});return db['CmHopperAdditionalPhone'][_0x0a9e('0x5a')](_0x43c397,{});})[_0x0a9e('0x15')](function(){_0x4a70ce(0x1);});});}function insertAdditionalPhones(_0xe25eb5,_0x1af799){return new Promise(function(_0x51aa2f){var _0x2e4887=[];for(var _0x3c9135=0x0;_0x3c9135<_0x1af799[_0x0a9e('0x2b')];_0x3c9135++){var _0x1c9539=_0x1af799[_0x3c9135];_0x2e4887[_0x0a9e('0x5e')](parseContactItemType(_0x1c9539));}Promise[_0x0a9e('0x62')](_0x2e4887)[_0x0a9e('0x15')](function(){var _0x25931e={'id':_0xe25eb5['id'],'items':_0x1af799};return addAdditionalPhones(_0x25931e)[_0x0a9e('0x15')](function(){return addCmHopperPhones(_0xe25eb5['id']);});})[_0x0a9e('0x15')](function(){_0x51aa2f(_0xe25eb5);});});}function parseContactItemType(_0x57f0ad){return new Promise(function(_0x2272bc){if(_0x57f0ad[_0x0a9e('0x31')](_0x0a9e('0x8b'))){_0x2272bc(_0x57f0ad);}else{return db[_0x0a9e('0x68')][_0x0a9e('0x22')]({'where':{'name':_0x57f0ad[_0x0a9e('0x69')]}})[_0x0a9e('0x15')](function(_0x20ae21){if(_['isNil'](_0x20ae21))_0x57f0ad[_0x0a9e('0x8b')]=null;else _0x57f0ad[_0x0a9e('0x8b')]=_0x20ae21['id'];_0x2272bc(_0x57f0ad);});}});}exports[_0x0a9e('0x94')]=function(_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x4a')][_0x0a9e('0x1d')]({'raw':!![],'where':{'CmContactId':_0x5c65fc[_0x0a9e('0x23')]['id'],'ItemClass':_0x0a9e('0x95')},'include':[{'model':db[_0x0a9e('0x68')],'as':_0x0a9e('0x69')}],'order':[[_0x0a9e('0x88')],[db[_0x0a9e('0x90')][_0x0a9e('0x6a')]('`ItemType`.OrderBy')]]})[_0x0a9e('0x15')](function(_0x446e6){return _0x446e6;})[_0x0a9e('0x15')](respondWithResult(_0x1402c7,null))[_0x0a9e('0x20')](handleError(_0x1402c7,null));};exports[_0x0a9e('0x96')]=function(_0x3942fd,_0x5cb48d){return db[_0x0a9e('0x4a')]['findAll']({'raw':!![],'where':{'CmContactId':_0x3942fd['body']['fromContactId']}})[_0x0a9e('0x15')](function(_0x3fa3f2){var _0x426cb4=_[_0x0a9e('0x6d')](_0x3fa3f2,function(_0x4d99a8){_0x4d99a8[_0x0a9e('0x97')]=_0x3942fd[_0x0a9e('0x32')][_0x0a9e('0x98')];return _0x4d99a8;});return db[_0x0a9e('0x4a')][_0x0a9e('0x5a')](_0x426cb4,{});})['then'](function(){return addCmHopperPhones(_0x3942fd['body'][_0x0a9e('0x98')]);})[_0x0a9e('0x15')](function(){return['ok'];})[_0x0a9e('0x15')](respondWithResult(_0x5cb48d,null))['catch'](handleError(_0x5cb48d,null));};exports[_0x0a9e('0x99')]=function(_0x248a9a,_0x422f0a){var _0x4cee8c=[];_0x4cee8c[_0x0a9e('0x5e')](createCmHopperPhone(_0x248a9a[_0x0a9e('0x32')]['id'],_0x248a9a[_0x0a9e('0x32')]['hopperId']));Promise[_0x0a9e('0x62')](_0x4cee8c)[_0x0a9e('0x15')](function(){return[0x1];})[_0x0a9e('0x15')](respondWithResult(_0x422f0a,null));};exports['getHoppers']=function(_0x549697,_0x53ef46){var _0x3b04fd={'raw':![],'where':{}};var _0x1f50db={};var _0xcbc73c={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')]['findOne']({'where':{'id':_0x549697[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x53ef46,null))[_0x0a9e('0x15')](function(_0x2ff2ab){if(_0x2ff2ab){_0x1f50db[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x39')][_0x0a9e('0x79')]);_0x1f50db[_0x0a9e('0x1e')]=_['keys'](_0x549697[_0x0a9e('0x1e')]);_0x1f50db['filters']=_[_0x0a9e('0x7b')](_0x1f50db['model'],_0x1f50db[_0x0a9e('0x1e')]);_0x3b04fd['attributes']=_[_0x0a9e('0x7b')](_0x1f50db[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x3b04fd[_0x0a9e('0x7c')]=_0x3b04fd[_0x0a9e('0x7c')]['length']?_0x3b04fd[_0x0a9e('0x7c')]:_0x1f50db[_0x0a9e('0x78')];if(!_0x549697['query'][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x3b04fd['limit']=qs[_0x0a9e('0x12')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x3b04fd['offset']=qs[_0x0a9e('0x10')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x3b04fd[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x3b04fd[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x549697['query'],_0x1f50db[_0x0a9e('0x7a')]));_0x3b04fd['where'][_0x0a9e('0x9a')]=_0x2ff2ab['id'];if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x3b04fd[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x3b04fd[_0x0a9e('0x5c')],{'$or':_['map'](_0x3b04fd[_0x0a9e('0x7c')],function(_0x469035){var _0x2977a7={};_0x2977a7[_0x469035]={'$like':'%'+_0x549697['query'][_0x0a9e('0x81')]+'%'};return _0x2977a7;})});}_0x3b04fd=_[_0x0a9e('0x82')]({},_0x3b04fd,_0x549697[_0x0a9e('0x9b')]);return db[_0x0a9e('0x39')][_0x0a9e('0x13')]({'where':_0x3b04fd[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x5f2c51){_0xcbc73c[_0x0a9e('0x13')]=_0x5f2c51;if(_0x549697[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x3b04fd[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x39')][_0x0a9e('0x1d')](_0x3b04fd);})[_0x0a9e('0x15')](function(_0x5d6a48){_0xcbc73c['rows']=_0x5d6a48;return _0xcbc73c;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x53ef46,_0x3b04fd))[_0x0a9e('0x20')](handleError(_0x53ef46,null));};exports[_0x0a9e('0x9e')]=function(_0x1bf692,_0x40e2da){var _0x131da8={'raw':!![],'where':{}};var _0x609711={};var _0x584854={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x1bf692[_0x0a9e('0x23')]['id']}})[_0x0a9e('0x15')](handleEntityNotFound(_0x40e2da,null))[_0x0a9e('0x15')](function(_0x3c6082){if(_0x3c6082){_0x609711[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0x9f')][_0x0a9e('0x79')]);_0x609711[_0x0a9e('0x1e')]=_['keys'](_0x1bf692[_0x0a9e('0x1e')]);_0x609711[_0x0a9e('0x7a')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],_0x609711['query']);_0x131da8[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x609711[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x131da8[_0x0a9e('0x7c')]=_0x131da8[_0x0a9e('0x7c')]['length']?_0x131da8[_0x0a9e('0x7c')]:_0x609711[_0x0a9e('0x78')];if(!_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0x131da8['limit']=qs[_0x0a9e('0x12')](_0x1bf692[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x131da8['offset']=qs[_0x0a9e('0x10')](_0x1bf692[_0x0a9e('0x1e')]['offset']);}_0x131da8[_0x0a9e('0x7e')]=qs['sort'](_0x1bf692[_0x0a9e('0x1e')]['sort']);_0x131da8['where']=qs['filters'](_[_0x0a9e('0x80')](_0x1bf692[_0x0a9e('0x1e')],_0x609711[_0x0a9e('0x7a')]));_0x131da8[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x3c6082['id'];if(_0x1bf692[_0x0a9e('0x1e')]['filter']){_0x131da8[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x131da8[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x131da8[_0x0a9e('0x7c')],function(_0x18dccf){var _0x31c937={};_0x31c937[_0x18dccf]={'$like':'%'+_0x1bf692['query']['filter']+'%'};return _0x31c937;})});}_0x131da8=_[_0x0a9e('0x82')]({},_0x131da8,_0x1bf692['options']);return db[_0x0a9e('0x9f')][_0x0a9e('0x13')]({'where':_0x131da8[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x37a448){_0x584854[_0x0a9e('0x13')]=_0x37a448;if(_0x1bf692['query'][_0x0a9e('0x9c')]){_0x131da8['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0x0a9e('0x1d')](_0x131da8);})['then'](function(_0x38dceb){_0x584854['rows']=_0x38dceb;return _0x584854;});}})['then'](respondWithFilteredResult(_0x40e2da,_0x131da8))[_0x0a9e('0x20')](handleError(_0x40e2da,null));};exports['getHopperFinals']=function(_0x24470a,_0x142e53){var _0xe1ab0d={'raw':!![],'where':{}};var _0x48f532={};var _0x4152cd={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x24470a['params']['id']}})['then'](handleEntityNotFound(_0x142e53,null))[_0x0a9e('0x15')](function(_0x948aab){if(_0x948aab){_0x48f532[_0x0a9e('0x78')]=_[_0x0a9e('0x25')](db[_0x0a9e('0x4b')][_0x0a9e('0x79')]);_0x48f532[_0x0a9e('0x1e')]=_[_0x0a9e('0x25')](_0x24470a[_0x0a9e('0x1e')]);_0x48f532[_0x0a9e('0x7a')]=_['intersection'](_0x48f532['model'],_0x48f532['query']);_0xe1ab0d[_0x0a9e('0x7c')]=_[_0x0a9e('0x7b')](_0x48f532[_0x0a9e('0x78')],qs[_0x0a9e('0x7d')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0xe1ab0d[_0x0a9e('0x7c')]=_0xe1ab0d[_0x0a9e('0x7c')]['length']?_0xe1ab0d['attributes']:_0x48f532[_0x0a9e('0x78')];if(!_0x24470a[_0x0a9e('0x1e')]['hasOwnProperty'](_0x0a9e('0x83'))){_0xe1ab0d[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0xe1ab0d[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0xe1ab0d[_0x0a9e('0x7e')]=qs[_0x0a9e('0x7f')](_0x24470a[_0x0a9e('0x1e')]['sort']);_0xe1ab0d[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_[_0x0a9e('0x80')](_0x24470a[_0x0a9e('0x1e')],_0x48f532[_0x0a9e('0x7a')]));_0xe1ab0d[_0x0a9e('0x5c')][_0x0a9e('0x9a')]=_0x948aab['id'];if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0xe1ab0d[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0xe1ab0d[_0x0a9e('0x5c')],{'$or':_['map'](_0xe1ab0d['attributes'],function(_0x3e5182){var _0x401207={};_0x401207[_0x3e5182]={'$like':'%'+_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x81')]+'%'};return _0x401207;})});}_0xe1ab0d=_[_0x0a9e('0x82')]({},_0xe1ab0d,_0x24470a[_0x0a9e('0x9b')]);return db[_0x0a9e('0x4b')]['count']({'where':_0xe1ab0d[_0x0a9e('0x5c')]})['then'](function(_0x26aa44){_0x4152cd[_0x0a9e('0x13')]=_0x26aa44;if(_0x24470a[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0xe1ab0d[_0x0a9e('0x9d')]=[{'all':!![]}];}return db[_0x0a9e('0x4b')][_0x0a9e('0x1d')](_0xe1ab0d);})[_0x0a9e('0x15')](function(_0xa7a754){_0x4152cd[_0x0a9e('0xa0')]=_0xa7a754;return _0x4152cd;});}})[_0x0a9e('0x15')](respondWithFilteredResult(_0x142e53,_0xe1ab0d))[_0x0a9e('0x20')](handleError(_0x142e53,null));};exports[_0x0a9e('0xa1')]=function(_0x3f7cb6,_0x3c8a9a){var _0x2d5e00={'raw':!![],'where':{}};var _0x5b78a8={};var _0x54cf62={'count':0x0,'rows':[]};return db[_0x0a9e('0x21')][_0x0a9e('0x85')]({'where':{'id':_0x3f7cb6['params']['id']}})['then'](handleEntityNotFound(_0x3c8a9a,null))[_0x0a9e('0x15')](function(_0x1feb9){if(_0x1feb9){_0x5b78a8[_0x0a9e('0x78')]=_['keys'](db[_0x0a9e('0xa2')]['rawAttributes']);_0x5b78a8[_0x0a9e('0x1e')]=_['keys'](_0x3f7cb6[_0x0a9e('0x1e')]);_0x5b78a8['filters']=_[_0x0a9e('0x7b')](_0x5b78a8[_0x0a9e('0x78')],_0x5b78a8[_0x0a9e('0x1e')]);_0x2d5e00['attributes']=_[_0x0a9e('0x7b')](_0x5b78a8['model'],qs['fields'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7d')]));_0x2d5e00[_0x0a9e('0x7c')]=_0x2d5e00[_0x0a9e('0x7c')][_0x0a9e('0x2b')]?_0x2d5e00[_0x0a9e('0x7c')]:_0x5b78a8[_0x0a9e('0x78')];if(!_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x31')](_0x0a9e('0x83'))){_0x2d5e00[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x12')]);_0x2d5e00[_0x0a9e('0x10')]=qs[_0x0a9e('0x10')](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}_0x2d5e00[_0x0a9e('0x7e')]=qs['sort'](_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x7f')]);_0x2d5e00[_0x0a9e('0x5c')]=qs[_0x0a9e('0x7a')](_['pick'](_0x3f7cb6['query'],_0x5b78a8['filters']));_0x2d5e00[_0x0a9e('0x5c')]['ContactId']=_0x1feb9['id'];if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x81')]){_0x2d5e00[_0x0a9e('0x5c')]=_[_0x0a9e('0x82')](_0x2d5e00[_0x0a9e('0x5c')],{'$or':_[_0x0a9e('0x6d')](_0x2d5e00[_0x0a9e('0x7c')],function(_0x1cc73e){var _0x2154d8={};_0x2154d8[_0x1cc73e]={'$like':'%'+_0x3f7cb6[_0x0a9e('0x1e')]['filter']+'%'};return _0x2154d8;})});}_0x2d5e00=_[_0x0a9e('0x82')]({},_0x2d5e00,_0x3f7cb6['options']);return db[_0x0a9e('0xa2')]['count']({'where':_0x2d5e00[_0x0a9e('0x5c')]})[_0x0a9e('0x15')](function(_0x216791){_0x54cf62['count']=_0x216791;if(_0x3f7cb6[_0x0a9e('0x1e')][_0x0a9e('0x9c')]){_0x2d5e00['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0x0a9e('0x1d')](_0x2d5e00);})[_0x0a9e('0x15')](function(_0x1262ff){_0x54cf62['rows']=_0x1262ff;return _0x54cf62;});}})['then'](respondWithFilteredResult(_0x3c8a9a,_0x2d5e00))['catch'](handleError(_0x3c8a9a,null));};exports[_0x0a9e('0xa3')]=function(_0x22c591,_0x2b7ba9){try{if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]){throw new Error(_0x0a9e('0xa6'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')]){throw new Error(_0x0a9e('0xa8'));}if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error(_0x0a9e('0xaa'));}var _0x1a74c4=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa5')]['split'](',');var _0xb33e27=_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')][_0x0a9e('0xab')](',');if(!_0x1a74c4[_0x0a9e('0x2b')]||!_0xb33e27[_0x0a9e('0x2b')]||_0x1a74c4['length']!==_0xb33e27[_0x0a9e('0x2b')]){throw new Error(_0x0a9e('0xac'));}_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')]=_[_0x0a9e('0xad')](_0x1a74c4,_0xb33e27);if(!_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x7d')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x22c591['body']['fields'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}var _0x5c2996=path[_0x0a9e('0x36')](config[_0x0a9e('0xb1')],'server/files/tmp',_0x22c591[_0x0a9e('0xb2')]['filename']);fs[_0x0a9e('0xb3')](_0x5c2996,parseInt(_0x0a9e('0xb4'),0x8));var _0x58c53c=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xb7')),[_0x5c2996,_0x22c591[_0x0a9e('0x32')]['binding_keys'],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xa7')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0x5f')],_0x22c591[_0x0a9e('0x32')][_0x0a9e('0xb8')],_0x22c591['body'][_0x0a9e('0x5b')],_0x22c591[_0x0a9e('0x32')]['socket_timestamp']]);return _0x2b7ba9[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xba'),'pid':_0x58c53c[_0x0a9e('0xbb')]});}catch(_0x3fae71){return _0x2b7ba9[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xbc')](_0x3fae71);}};exports['upload']=function(_0x49e1b8,_0x5a2013){var _0x55d764=fs['createReadStream'](_0x49e1b8[_0x0a9e('0xb2')][_0x0a9e('0xbd')]);Papa['parse'](_0x55d764,{'header':!![],'skipEmptyLines':!![],'preview':0x1,'complete':function(_0x5c23aa){return _0x5a2013[_0x0a9e('0xf')](0xc8)['json']({'file':_0x49e1b8[_0x0a9e('0xb2')],'fields':_0x5c23aa[_0x0a9e('0xbe')][_0x0a9e('0x7d')]});}});};exports[_0x0a9e('0xbf')]=function(_0x336518,_0x14a683){return db['User'][_0x0a9e('0x1d')]({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})['then'](function(_0x44cdb8){var _0x1c0d54=![];if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xc1')]['phone']){throw new Error(_0x0a9e('0xae'));}if(!_0x336518['body'][_0x0a9e('0xc1')][_0x0a9e('0xaf')]){throw new Error('No\x20firstName\x20column\x20specified');}if(!_0x336518[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x78a398=require('child_process')[_0x0a9e('0xb6')](path[_0x0a9e('0x36')](__dirname,'../../components/import/cm/csv2'),[_0x336518[_0x0a9e('0x23')]['id'],JSON['stringify'](_0x336518[_0x0a9e('0x32')]),JSON[_0x0a9e('0xc2')](_0x44cdb8)]);_0x78a398['on'](_0x0a9e('0xc3'),function(){_0x1c0d54=!![];return _0x14a683[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x78a398[_0x0a9e('0xbb')]});});_0x78a398['on']('exit',function(_0x36318d){if(_0x36318d&&!_0x1c0d54){return _0x14a683[_0x0a9e('0xf')](0x1f4)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc5'),'pid':_0x78a398[_0x0a9e('0xbb')]});}});})['catch'](handleError(_0x14a683,null));};exports[_0x0a9e('0xc6')]=function(_0x49a6b2,_0x5d1159){return db[_0x0a9e('0xc7')]['findAll']({'raw':!![],'attributes':['id'],'where':{'role':_0x0a9e('0xc0')}})[_0x0a9e('0x15')](function(_0x58d5fd){var _0x171a69=![];if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0x5f')]){throw new Error(_0x0a9e('0xa4'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xc1')][_0x0a9e('0x76')]){throw new Error(_0x0a9e('0xae'));}if(!_0x49a6b2[_0x0a9e('0x32')]['binding'][_0x0a9e('0xaf')]){throw new Error(_0x0a9e('0xb0'));}if(!_0x49a6b2[_0x0a9e('0x32')][_0x0a9e('0xa9')]){throw new Error('Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed');}var _0x38d95a=require(_0x0a9e('0xb5'))[_0x0a9e('0xb6')](path['join'](__dirname,_0x0a9e('0xc8')),[_0x49a6b2[_0x0a9e('0x23')]['id'],JSON[_0x0a9e('0xc2')](_0x49a6b2['body']),JSON[_0x0a9e('0xc2')](_0x58d5fd)]);_0x38d95a['on']('message',function(){_0x171a69=!![];return _0x5d1159[_0x0a9e('0xf')](0xc8)[_0x0a9e('0xb9')]({'message':_0x0a9e('0xc4'),'pid':_0x38d95a[_0x0a9e('0xbb')]});});_0x38d95a['on'](_0x0a9e('0xc9'),function(_0x1b86e6){if(_0x1b86e6&&!_0x171a69){return _0x5d1159[_0x0a9e('0xf')](0x1f4)['json']({'message':_0x0a9e('0xc5'),'pid':_0x38d95a[_0x0a9e('0xbb')]});}});})[_0x0a9e('0x20')](handleError(_0x5d1159,null));};exports[_0x0a9e('0xca')]=function(_0x1eb768,_0x117694){var _0x3a4def=[_0x0a9e('0xcb'),_0x0a9e('0xcc'),_0x0a9e('0xcd'),_0x0a9e('0xce'),_0x0a9e('0xcf'),_0x0a9e('0xd0'),_0x0a9e('0xd1')];var _0xdce963={'offset':0x0,'order':qs[_0x0a9e('0x7f')](_0x0a9e('0xd2'))},_0xfc4f={'count':0x0,'rows':[]};Promise[_0x0a9e('0xd3')]()[_0x0a9e('0x15')](function(){if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd4')]){if(!_[_0x0a9e('0xd5')](_0x3a4def,_0x1eb768['query'][_0x0a9e('0xd4')][_0x0a9e('0xd6')]())){throw new Error(_0x0a9e('0xd7'));}_0x3a4def=[_0x1eb768['query'][_0x0a9e('0xd4')]['toLowerCase']()];}if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){try{var _0x20a292=JSON[_0x0a9e('0xd9')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]);if(!moment(_0x20a292[_0x0a9e('0x33')])[_0x0a9e('0xda')]()){throw new Error('Invalid\x20date\x20for\x20range\x20from\x20filter');}if(!moment(_0x20a292['to'])[_0x0a9e('0xda')]()){throw new Error(_0x0a9e('0xdb'));}}catch(_0x4d6f2d){throw new Error(_0x0a9e('0xdc'));}}if(!_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x31')]('nolimit')){_0xdce963[_0x0a9e('0x12')]=qs[_0x0a9e('0x12')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x12')]||0xa);_0xdce963['offset']=qs[_0x0a9e('0x10')](_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0x10')]);}var _0x2b8eed=_0x3a4def[_0x0a9e('0x6d')](function(_0x4ea917){if(_0x4ea917===_0x0a9e('0xd1')){var _0x3fc431={'attributes':['id','uniqueid',_0x0a9e('0x2e'),_0x0a9e('0xdd'),_0x0a9e('0xde'),'callerid','starttime',_0x0a9e('0xdf'),_0x0a9e('0xe0'),_0x0a9e('0xe1'),_0x0a9e('0xe2'),_0x0a9e('0xe3'),_0x0a9e('0xe4'),_0x0a9e('0xe5'),_0x0a9e('0xe6')],'where':{'ContactId':_0x1eb768['params']['id']},'include':[{'model':db['User'],'as':_0x0a9e('0xc7'),'attributes':['id','name',_0x0a9e('0xe7'),_0x0a9e('0xe8')]}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768['query'][_0x0a9e('0xd8')]){_0x3fc431[_0x0a9e('0x5c')]['createdAt']={'$gte':_0x20a292[_0x0a9e('0x33')],'$lte':_0x20a292['to']};}return db['VoiceCallReport'][_0x0a9e('0xea')](_0x3fc431)[_0x0a9e('0x15')](function(_0xd63c87){_0xfc4f[_0x0a9e('0x13')]+=_0xd63c87[_0x0a9e('0x13')];return _[_0x0a9e('0x6d')](_0xd63c87['rows'],function(_0x16d50b){var _0x580dd2=_0x16d50b[_0x0a9e('0x34')]({'plain':!![]});_0x580dd2[_0x0a9e('0xd4')]=_0x4ea917;if(_0x580dd2[_0x0a9e('0xc7')]){_0x580dd2[_0x0a9e('0xc7')]={'id':_0x580dd2[_0x0a9e('0xc7')]['id'],'name':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0x1a')],'fullname':_0x580dd2['User'][_0x0a9e('0xe7')],'alias':_0x580dd2[_0x0a9e('0xc7')][_0x0a9e('0xe8')]};}return _0x580dd2;});});}else{var _0x188231=_[_0x0a9e('0xeb')](_0x4ea917)+(_0x4ea917==='chat'?_0x0a9e('0xec'):_0x0a9e('0xed'));var _0x488d6c={'attributes':['id','closed',_0x0a9e('0xee'),_0x0a9e('0xe2'),_0x0a9e('0xe1'),_0x0a9e('0xef'),_0x0a9e('0xf0'),_0x0a9e('0xf1'),'UserId',_0x188231+'Id'],'where':{'ContactId':_0x1eb768[_0x0a9e('0x23')]['id']},'include':[{'model':db[_0x188231],'as':_0x0a9e('0xed'),'attributes':['id',_0x0a9e('0x1a'),'key']},{'model':db[_0x0a9e('0xc7')],'as':_0x0a9e('0xf2'),'attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0xe7')]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x0a9e('0x1a'),_0x0a9e('0x65')],'through':{'attributes':[]}}],'order':[[_0x0a9e('0xe2'),_0x0a9e('0xe9')]]};if(_0x1eb768[_0x0a9e('0x1e')][_0x0a9e('0xd8')]){_0x488d6c[_0x0a9e('0x5c')][_0x0a9e('0xe2')]={'$gte':_0x20a292['from'],'$lte':_0x20a292['to']};}switch(_0x4ea917){case _0x0a9e('0xcc'):_0x488d6c['attributes'][_0x0a9e('0x5e')](_0x0a9e('0xf3'),_0x0a9e('0xf4'),'customerPort','deviceModel',_0x0a9e('0xf5'),'ratingMessage',_0x0a9e('0xf6'),'ratingValue','referer');break;case _0x0a9e('0xcb'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf7'),_0x0a9e('0xf8'));break;case _0x0a9e('0xce'):_0x488d6c[_0x0a9e('0x7c')][_0x0a9e('0x5e')](_0x0a9e('0xf9'),_0x0a9e('0xfa'));break;}return db[_[_0x0a9e('0xeb')](_0x4ea917)+_0x0a9e('0xfb')][_0x0a9e('0xea')](_0x488d6c)['then'](function(_0x58f251){_0xfc4f[_0x0a9e('0x13')]+=_0x58f251['count'];return _[_0x0a9e('0x6d')](_0x58f251[_0x0a9e('0xa0')],function(_0x27be90){var _0x54befc=_0x27be90['get']({'plain':!![]});_0x54befc[_0x0a9e('0xd4')]=_0x4ea917;if(_0x54befc[_0x0a9e('0xf2')]){_0x54befc[_0x0a9e('0xf2')]={'id':_0x54befc[_0x0a9e('0xf2')]['id'],'name':_0x54befc[_0x0a9e('0xf2')][_0x0a9e('0x1a')],'fullname':_0x54befc[_0x0a9e('0xf2')]['fullname']};}return _0x54befc;});});}});return Promise[_0x0a9e('0x62')](_0x2b8eed);})['then'](function(_0x46b11b){return _(_0x46b11b)[_0x0a9e('0xfc')]()['sortBy'](_0x0a9e('0xe2'))[_0x0a9e('0xfd')]()[_0x0a9e('0xfe')]();})[_0x0a9e('0x15')](function(_0xb0fb60){_0xfc4f[_0x0a9e('0xa0')]=_0xdce963['limit']?_0xb0fb60[_0x0a9e('0xff')](_0xdce963[_0x0a9e('0x10')],_0xdce963[_0x0a9e('0x10')]+_0xdce963['limit']):_0xb0fb60;return _0xfc4f;})[_0x0a9e('0x15')](respondWithFilteredResult(_0x117694,_0xdce963))[_0x0a9e('0x20')](handleError(_0x117694,null));}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.events.js b/server/api/cmContact/cmContact.events.js index 91899e0..631cf8f 100644 --- a/server/api/cmContact/cmContact.events.js +++ b/server/api/cmContact/cmContact.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb72c=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0xb72c,0x7b));var _0xcb72=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb72c[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var CmContact=require(_0xcb72('0x0'))['db']['CmContact'];var CmContactEvents=new EventEmitter();CmContactEvents[_0xcb72('0x1')](0x0);var events={'afterCreate':_0xcb72('0x2'),'afterUpdate':_0xcb72('0x3'),'afterDestroy':_0xcb72('0x4')};function emitEvent(_0x3ae533){return function(_0x2afe3a,_0x3abde2,_0xfa3487){CmContactEvents['emit'](_0x3ae533+':'+_0x2afe3a['id'],_0x2afe3a);CmContactEvents[_0xcb72('0x5')](_0x3ae533,_0x2afe3a);_0xfa3487(null);};}for(var e in events){if(events[_0xcb72('0x6')](e)){var event=events[e];CmContact[_0xcb72('0x7')](e,emitEvent(event));}}module[_0xcb72('0x8')]=CmContactEvents; \ No newline at end of file +var _0x9491=['events','../../mysqldb','CmContact','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5e33b7,_0x1ad038){var _0x3d245c=function(_0x55e40c){while(--_0x55e40c){_0x5e33b7['push'](_0x5e33b7['shift']());}};_0x3d245c(++_0x1ad038);}(_0x9491,0x14a));var _0x1949=function(_0x39fe66,_0x13734c){_0x39fe66=_0x39fe66-0x0;var _0x36bda3=_0x9491[_0x39fe66];return _0x36bda3;};'use strict';var EventEmitter=require(_0x1949('0x0'));var CmContact=require(_0x1949('0x1'))['db'][_0x1949('0x2')];var CmContactEvents=new EventEmitter();CmContactEvents[_0x1949('0x3')](0x0);var events={'afterCreate':_0x1949('0x4'),'afterUpdate':_0x1949('0x5'),'afterDestroy':_0x1949('0x6')};function emitEvent(_0x5ced81){return function(_0x19452d,_0xbedfe8,_0x57a1dc){CmContactEvents[_0x1949('0x7')](_0x5ced81+':'+_0x19452d['id'],_0x19452d);CmContactEvents[_0x1949('0x7')](_0x5ced81,_0x19452d);_0x57a1dc(null);};}for(var e in events){if(events[_0x1949('0x8')](e)){var event=events[e];CmContact[_0x1949('0x9')](e,emitEvent(event));}}module[_0x1949('0xa')]=CmContactEvents; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.model.js b/server/api/cmContact/cmContact.model.js index a9b2267..74cd9e4 100644 --- a/server/api/cmContact/cmContact.model.js +++ b/server/api/cmContact/cmContact.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa55a=['YYYY-MM-DD\x20HH:mm:ss','isNil','findOne','then','dialTimezone','timezones','utcOffset','add','minutes','format','ret','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopper','create','ListId','priority','callbackUniqueid','catch','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20','error','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','VoiceQueue','outbound','dialCheckDuplicateType','CmList','Lists','length','get','onlyIfOpen','BlackLists','CmHopperBlack','cmContact,\x20%s,\x20%s','afterCreate','message','Campaign','findAll','always','List\x20not\x20found','isEmpty','ContactId','VoiceQueueId','push','all','[CmContact][afterDestroy][Succesfull]','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','../../config/environment/shared','define','CmContact','cm_contacts','phone','firstName','lastName','fax','FULLTEXT','utf8mb4','models','cmContact','inspect','scheduledat'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0xa55a,0x7a));var _0xaa55=function(_0x1d8499,_0x20642f){_0x1d8499=_0x1d8499-0x0;var _0x17abc7=_0xa55a[_0x1d8499];return _0x17abc7;};'use strict';var _=require(_0xaa55('0x0'));var util=require(_0xaa55('0x1'));var logger=require(_0xaa55('0x2'))(_0xaa55('0x3'));var moment=require(_0xaa55('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa55('0x5'));var rimraf=require(_0xaa55('0x6'));var config=require(_0xaa55('0x7'));var shared=require(_0xaa55('0x8'));var attributes=require('./cmContact.attributes');module['exports']=function(_0x220faa,_0x45bcbb){return _0x220faa[_0xaa55('0x9')](_0xaa55('0xa'),attributes,{'tableName':_0xaa55('0xb'),'paranoid':!![],'indexes':[{'name':'phone','fields':[_0xaa55('0xc')]},{'name':'fti_cm_contacts','fields':[_0xaa55('0xd'),_0xaa55('0xe'),_0xaa55('0xc'),'mobile',_0xaa55('0xf'),'email'],'type':_0xaa55('0x10')}],'timestamps':!![],'charset':_0xaa55('0x11'),'collate':'utf8mb4_unicode_ci','hooks':{'afterCreate':function(_0x559618,_0x5cc1bb,_0x167eaf){var _0x570d76=_0x220faa[_0xaa55('0x12')];var _0x3027d6=_0x559618['get']({'plain':!![]});function _0x437b11(){return function(_0x1b02e9){logger['error'](_0xaa55('0x13'),'afterCreate',util[_0xaa55('0x14')](_0x1b02e9,{'showHidden':![],'depth':null}));};}function _0xfece9a(_0x630e71,_0x15081d){var _0x124b52=_0x15081d[_0xaa55('0x15')]?_0x15081d['scheduledat']:moment()['format'](_0xaa55('0x16'));return new BPromise(function(_0x5691a2,_0x491404){if(_[_0xaa55('0x17')](_0x15081d['dialTimezone'])){_0x5691a2({'ret':_0x124b52});}else{_0x570d76['VoiceQueue'][_0xaa55('0x18')]({'where':{'id':_0x630e71['id']}})[_0xaa55('0x19')](function(_0xd09430){if(!_[_0xaa55('0x17')](_0xd09430)){var _0x5e85f6=_0xd09430[_0xaa55('0x1a')];if(!_['isNil'](_0x5e85f6)){var _0x5e0cbb=shared[_0xaa55('0x1b')];var _0x3389e4=_0x5e0cbb[_0x5e85f6];var _0x3c937b=_0x5e0cbb[_0x15081d[_0xaa55('0x1a')]];if(!_['isNil'](_0x3389e4)&&!_[_0xaa55('0x17')](_0x3c937b)){var _0x120387=_0x3389e4[_0xaa55('0x1c')]-_0x3c937b[_0xaa55('0x1c')];_0x124b52=_0x15081d['scheduledat']?_0x15081d[_0xaa55('0x15')]:moment();var _0x4e0198=moment(_0x124b52)[_0xaa55('0x1d')](_0x120387,_0xaa55('0x1e'));_0x5691a2({'ret':_0x4e0198[_0xaa55('0x1f')](_0xaa55('0x16'))});}else _0x5691a2({'ret':_0x124b52});}else _0x5691a2({'ret':_0x124b52});}else{_0x5691a2({'ret':_0x124b52});}});}});return 0xa;}var _0x238f73=function(_0xa12a3a){return new BPromise(function(_0x46402f,_0x3d4128){_0xfece9a(_0xa12a3a,_0x3027d6)[_0xaa55('0x19')](function(_0x2eeda9){_0x3027d6['scheduledat']=_0x2eeda9[_0xaa55('0x20')];_0x570d76['CmHopper'][_0xaa55('0x18')]({'where':{'phone':_0x3027d6[_0xaa55('0xc')],'VoiceQueueId':_0xa12a3a['id']}})['then'](function(_0x183265){if(!_[_0xaa55('0x17')](_0x183265)){throw new Error(_0xaa55('0x21')+_0x3027d6['phone']+_0xaa55('0x22')+_0xa12a3a['id']);}return _0x570d76[_0xaa55('0x23')][_0xaa55('0x24')]({'phone':_0x3027d6[_0xaa55('0xc')],'ContactId':_0x3027d6['id'],'ListId':_0x3027d6[_0xaa55('0x25')],'priority':_0x3027d6[_0xaa55('0x26')]?_0x3027d6[_0xaa55('0x26')]:0x2,'scheduledat':_0x3027d6[_0xaa55('0x15')]?_0x3027d6['scheduledat']:moment()[_0xaa55('0x1f')](_0xaa55('0x16')),'callback':_0x3027d6['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3027d6[_0xaa55('0x27')]?_0x3027d6[_0xaa55('0x27')]:undefined,'callbackat':_0x3027d6['callbackUniqueid']?moment()[_0xaa55('0x1f')](_0xaa55('0x16')):undefined,'VoiceQueueId':_0xa12a3a['id']});})[_0xaa55('0x28')](function(_0x38ce3c){_0x3d4128(_0x38ce3c);});});});};var _0x29a423=function(_0x48f5e6){return new BPromise(function(_0x5a49c1,_0x546b16){_0xfece9a(_0x48f5e6,_0x3027d6)[_0xaa55('0x19')](function(_0x184bd7){_0x3027d6[_0xaa55('0x15')]=_0x184bd7[_0xaa55('0x20')];_0x570d76[_0xaa55('0x23')][_0xaa55('0x18')]({'where':{'phone':_0x3027d6['phone'],'VoiceQueueId':_0x48f5e6['id']}})[_0xaa55('0x19')](function(_0x25a923){if(!_[_0xaa55('0x17')](_0x25a923)){throw new Error('cmContact,\x20afterCreate\x20'+_0x3027d6[_0xaa55('0xc')]+_0xaa55('0x29')+_0x48f5e6['id']);}return _0x570d76[_0xaa55('0x2a')]['findOne']({'where':{'calleridnum':_0x3027d6[_0xaa55('0xc')],'VoiceQueueId':_0x48f5e6['id']}});})[_0xaa55('0x19')](function(_0x2298cb){if(!_[_0xaa55('0x17')](_0x2298cb)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x3027d6[_0xaa55('0xc')]+_0xaa55('0x2b')+_0x48f5e6['id']);}return _0x570d76[_0xaa55('0x23')]['create']({'phone':_0x3027d6[_0xaa55('0xc')],'ContactId':_0x3027d6['id'],'ListId':_0x3027d6[_0xaa55('0x25')],'priority':_0x3027d6[_0xaa55('0x26')]?_0x3027d6[_0xaa55('0x26')]:0x2,'scheduledat':_0x3027d6[_0xaa55('0x15')]?_0x3027d6[_0xaa55('0x15')]:moment()[_0xaa55('0x1f')](_0xaa55('0x16')),'callback':_0x3027d6[_0xaa55('0x27')]?!![]:![],'callbackuniqueid':_0x3027d6[_0xaa55('0x27')]?_0x3027d6[_0xaa55('0x27')]:undefined,'callbackat':_0x3027d6[_0xaa55('0x27')]?moment()[_0xaa55('0x1f')](_0xaa55('0x16')):undefined,'VoiceQueueId':_0x48f5e6['id']});})[_0xaa55('0x28')](function(_0x36c4f2){_0x546b16(_0x36c4f2);});});});};function _0x39d07f(){return function(_0x534380){logger[_0xaa55('0x2c')](_0xaa55('0x13'),'afterCreate',util['inspect'](_0x534380,{'showHidden':![],'depth':null}));};}function _0x427c5a(_0x2e9b24,_0x55f428){var _0x536456=_0x55f428[_0xaa55('0x15')]?_0x55f428[_0xaa55('0x15')]:moment()[_0xaa55('0x1f')](_0xaa55('0x16'));return new BPromise(function(_0x3cdc20,_0x3ee085){if(_[_0xaa55('0x17')](_0x55f428[_0xaa55('0x1a')])){_0x3cdc20({'ret':_0x536456});}else{_0x570d76['Campaign']['findOne']({'where':{'id':_0x2e9b24['id']}})[_0xaa55('0x19')](function(_0x32b30d){if(!_[_0xaa55('0x17')](_0x32b30d)){var _0x56188f=_0x32b30d[_0xaa55('0x1a')];if(!_['isNil'](_0x56188f)){var _0x5068ac=shared[_0xaa55('0x1b')];var _0x2f7992=_0x5068ac[_0x56188f];var _0x21dccd=_0x5068ac[_0x55f428[_0xaa55('0x1a')]];if(!_[_0xaa55('0x17')](_0x2f7992)&&!_['isNil'](_0x21dccd)){var _0x4d4404=_0x2f7992[_0xaa55('0x1c')]-_0x21dccd[_0xaa55('0x1c')];_0x536456=_0x55f428[_0xaa55('0x15')]?_0x55f428[_0xaa55('0x15')]:moment();var _0x32b682=moment(_0x536456)[_0xaa55('0x1d')](_0x4d4404,_0xaa55('0x1e'));_0x3cdc20({'ret':_0x32b682[_0xaa55('0x1f')](_0xaa55('0x16'))});}else _0x3cdc20({'ret':_0x536456});}else _0x3cdc20({'ret':_0x536456});}else{_0x3cdc20({'ret':_0x536456});}});}});return 0xa;}var _0x1f04da=function(_0x1ec27a){return new BPromise(function(_0x58895b,_0x449ddb){_0x427c5a(_0x1ec27a,_0x3027d6)[_0xaa55('0x19')](function(_0x4f51d5){_0x3027d6[_0xaa55('0x15')]=_0x4f51d5['ret'];_0x570d76[_0xaa55('0x23')][_0xaa55('0x18')]({'where':{'phone':_0x3027d6[_0xaa55('0xc')],'CampaignId':_0x1ec27a['id']}})[_0xaa55('0x19')](function(_0x5c1df3){if(!_[_0xaa55('0x17')](_0x5c1df3)){throw new Error(_0xaa55('0x21')+_0x3027d6[_0xaa55('0xc')]+_0xaa55('0x2d')+_0x1ec27a['id']);}return _0x570d76[_0xaa55('0x23')][_0xaa55('0x24')]({'phone':_0x3027d6[_0xaa55('0xc')],'ContactId':_0x3027d6['id'],'ListId':_0x3027d6[_0xaa55('0x25')],'priority':_0x3027d6[_0xaa55('0x26')]?_0x3027d6['priority']:0x2,'scheduledat':_0x3027d6['scheduledat']?_0x3027d6[_0xaa55('0x15')]:moment()[_0xaa55('0x1f')](_0xaa55('0x16')),'callback':_0x3027d6[_0xaa55('0x27')]?!![]:![],'callbackuniqueid':_0x3027d6['callbackUniqueid']?_0x3027d6[_0xaa55('0x27')]:undefined,'callbackat':_0x3027d6['callbackUniqueid']?moment()[_0xaa55('0x1f')](_0xaa55('0x16')):undefined,'CampaignId':_0x1ec27a['id']});})[_0xaa55('0x28')](function(_0x501346){_0x449ddb(_0x501346);});});});};var _0x236c58=function(_0x3ff4f3){return new BPromise(function(_0x455d36,_0x47cd42){_0x427c5a(_0x3ff4f3,_0x3027d6)['then'](function(_0x1f37eb){_0x3027d6['scheduledat']=_0x1f37eb[_0xaa55('0x20')];_0x570d76[_0xaa55('0x23')][_0xaa55('0x18')]({'where':{'phone':_0x3027d6[_0xaa55('0xc')],'CampaignId':_0x3ff4f3['id']}})[_0xaa55('0x19')](function(_0x5038b0){if(!_[_0xaa55('0x17')](_0x5038b0)){throw new Error(_0xaa55('0x21')+_0x3027d6[_0xaa55('0xc')]+_0xaa55('0x2e')+_0x3ff4f3['id']);}return _0x570d76[_0xaa55('0x2a')][_0xaa55('0x18')]({'where':{'calleridnum':_0x3027d6[_0xaa55('0xc')],'CampaignId':_0x3ff4f3['id']}});})[_0xaa55('0x19')](function(_0x578657){if(!_[_0xaa55('0x17')](_0x578657)){throw new Error(_0xaa55('0x2f')+_0x3027d6[_0xaa55('0xc')]+_0xaa55('0x30')+_0x3ff4f3['id']);}return _0x570d76[_0xaa55('0x23')]['create']({'phone':_0x3027d6[_0xaa55('0xc')],'ContactId':_0x3027d6['id'],'ListId':_0x3027d6[_0xaa55('0x25')],'priority':_0x3027d6[_0xaa55('0x26')]?_0x3027d6[_0xaa55('0x26')]:0x2,'scheduledat':_0x3027d6[_0xaa55('0x15')]?_0x3027d6['scheduledat']:moment()[_0xaa55('0x1f')](_0xaa55('0x16')),'callback':_0x3027d6['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3027d6[_0xaa55('0x27')]?_0x3027d6[_0xaa55('0x27')]:undefined,'callbackat':_0x3027d6[_0xaa55('0x27')]?moment()[_0xaa55('0x1f')](_0xaa55('0x16')):undefined,'CampaignId':_0x3ff4f3['id']});})[_0xaa55('0x28')](function(_0x4b9ef9){_0x47cd42(_0x4b9ef9);});});});};if(_0x3027d6[_0xaa55('0x25')]){_0x570d76[_0xaa55('0x31')]['findAll']({'where':{'type':_0xaa55('0x32')},'attributes':['id',_0xaa55('0x33'),_0xaa55('0x1a')],'include':[{'model':_0x570d76[_0xaa55('0x34')],'as':_0xaa55('0x35'),'where':{'id':_0x3027d6[_0xaa55('0x25')]}}]})[_0xaa55('0x19')](function(_0x2e855d){if(_0x2e855d){var _0x4d3de4=[];for(var _0x73ca73=0x0,_0x13b4b2;_0x73ca73<_0x2e855d[_0xaa55('0x36')];_0x73ca73+=0x1){_0x13b4b2=_0x2e855d[_0x73ca73][_0xaa55('0x37')]({'plain':!![]});switch(_0x13b4b2[_0xaa55('0x33')]){case'always':_0x29a423(_0x13b4b2)[_0xaa55('0x28')](_0x437b11());break;case _0xaa55('0x38'):_0x238f73(_0x13b4b2)['catch'](_0x437b11());break;default:_0x427c5a(_0x13b4b2,_0x3027d6)[_0xaa55('0x19')](function(_0x3a6cdc){_0x3027d6[_0xaa55('0x15')]=_0x3a6cdc[_0xaa55('0x20')];_0x570d76[_0xaa55('0x23')]['create']({'phone':_0x3027d6[_0xaa55('0xc')],'ContactId':_0x3027d6['id'],'ListId':_0x3027d6[_0xaa55('0x25')],'scheduledat':_0x3027d6['scheduledat']?_0x3027d6[_0xaa55('0x15')]:moment()[_0xaa55('0x1f')](_0xaa55('0x16')),'priority':_0x3027d6[_0xaa55('0x26')]?_0x3027d6[_0xaa55('0x26')]:0x2,'callback':_0x3027d6[_0xaa55('0x27')]?!![]:![],'callbackuniqueid':_0x3027d6['callbackUniqueid']?_0x3027d6[_0xaa55('0x27')]:undefined,'callbackat':_0x3027d6[_0xaa55('0x27')]?moment()[_0xaa55('0x1f')](_0xaa55('0x16')):undefined,'VoiceQueueId':_0x13b4b2['id']})[_0xaa55('0x28')](_0x437b11());});}}}})[_0xaa55('0x19')](function(){return _0x570d76['VoiceQueue']['findAll']({'where':{'type':_0xaa55('0x32')},'attributes':['id'],'include':[{'model':_0x570d76[_0xaa55('0x34')],'as':_0xaa55('0x39'),'where':{'id':_0x3027d6[_0xaa55('0x25')]}}]})[_0xaa55('0x19')](function(_0x32eb65){if(_0x32eb65){var _0xc9e583=[];for(var _0x9e5ec7=0x0,_0x551783;_0x9e5ec7<_0x32eb65[_0xaa55('0x36')];_0x9e5ec7+=0x1){_0x551783=_0x32eb65[_0x9e5ec7]['get']({'plain':!![]});_0x570d76[_0xaa55('0x3a')][_0xaa55('0x24')]({'phone':_0x3027d6[_0xaa55('0xc')],'ContactId':_0x3027d6['id'],'ListId':_0x3027d6['ListId'],'VoiceQueueId':_0x551783['id']})['catch'](function(_0x1a9ccf){logger[_0xaa55('0x2c')](_0xaa55('0x3b'),_0xaa55('0x3c'),_0x1a9ccf[_0xaa55('0x3d')]);});}}});})['then'](function(){return _0x570d76[_0xaa55('0x3e')][_0xaa55('0x3f')]({'attributes':['id',_0xaa55('0x33'),_0xaa55('0x1a')],'include':[{'model':_0x570d76['CmList'],'as':_0xaa55('0x35'),'where':{'id':_0x3027d6[_0xaa55('0x25')]}}]})['then'](function(_0x441740){if(_0x441740){var _0x3dcaf4=[];for(var _0x8672ad=0x0,_0x3fdfb8;_0x8672ad<_0x441740[_0xaa55('0x36')];_0x8672ad+=0x1){_0x3fdfb8=_0x441740[_0x8672ad][_0xaa55('0x37')]({'plain':!![]});switch(_0x3fdfb8['dialCheckDuplicateType']){case _0xaa55('0x40'):_0x236c58(_0x3fdfb8)[_0xaa55('0x28')](_0x39d07f());break;case'onlyIfOpen':_0x1f04da(_0x3fdfb8)[_0xaa55('0x28')](_0x39d07f());break;default:_0x570d76[_0xaa55('0x23')][_0xaa55('0x24')]({'phone':_0x3027d6[_0xaa55('0xc')],'ContactId':_0x3027d6['id'],'ListId':_0x3027d6[_0xaa55('0x25')],'scheduledat':_0x3027d6['scheduledat']?_0x3027d6['scheduledat']:moment()[_0xaa55('0x1f')](_0xaa55('0x16')),'priority':_0x3027d6[_0xaa55('0x26')]?_0x3027d6[_0xaa55('0x26')]:0x2,'callback':_0x3027d6['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x3027d6[_0xaa55('0x27')]?_0x3027d6[_0xaa55('0x27')]:undefined,'callbackat':_0x3027d6[_0xaa55('0x27')]?moment()[_0xaa55('0x1f')](_0xaa55('0x16')):undefined,'CampaignId':_0x3fdfb8['id']})[_0xaa55('0x28')](_0x39d07f());}}}});})[_0xaa55('0x19')](function(){return _0x570d76[_0xaa55('0x3e')][_0xaa55('0x3f')]({'attributes':['id'],'include':[{'model':_0x570d76[_0xaa55('0x34')],'as':_0xaa55('0x39'),'where':{'id':_0x3027d6[_0xaa55('0x25')]}}]})[_0xaa55('0x19')](function(_0x4d4d7e){if(_0x4d4d7e){var _0x225dd6=[];for(var _0x734e48=0x0,_0x3a9cd1;_0x734e48<_0x4d4d7e['length'];_0x734e48+=0x1){_0x3a9cd1=_0x4d4d7e[_0x734e48]['get']({'plain':!![]});_0x570d76[_0xaa55('0x3a')][_0xaa55('0x24')]({'phone':_0x3027d6[_0xaa55('0xc')],'ContactId':_0x3027d6['id'],'ListId':_0x3027d6[_0xaa55('0x25')],'CampaignId':_0x3a9cd1['id']})['catch'](function(_0x3ce6e0){logger[_0xaa55('0x2c')](_0xaa55('0x3b'),_0xaa55('0x3c'),_0x3ce6e0[_0xaa55('0x3d')]);});}}});})[_0xaa55('0x19')](function(){_0x167eaf();})[_0xaa55('0x28')](function(_0x1c6359){logger[_0xaa55('0x2c')](_0xaa55('0x3b'),_0xaa55('0x3c'),_0x1c6359[_0xaa55('0x3d')]);_0x167eaf(_0x1c6359);});}else{_0x167eaf(new Error(_0xaa55('0x41')));}},'afterDestroy':function(_0x1d0d7b,_0x37bcce,_0x3f1342){var _0x242dca=_0x220faa[_0xaa55('0x12')];var _0x43b12f=_0x1d0d7b[_0xaa55('0x37')]({'plain':!![]});return _0x242dca['CmHopper'][_0xaa55('0x3f')]({'raw':!![],'where':{'ListId':_0x43b12f[_0xaa55('0x25')],'ContactId':_0x43b12f['id']}})[_0xaa55('0x19')](function(_0xcbb2b){if(!_[_0xaa55('0x42')](_0xcbb2b)){var _0x1bbaaa=[];for(var _0x30861a=0x0;_0x30861a<_0xcbb2b['length'];_0x30861a+=0x1){var _0x90e409=_0x242dca[_0xaa55('0x23')]['destroy']({'where':{'ListId':_0xcbb2b[_0x30861a][_0xaa55('0x25')],'ContactId':_0xcbb2b[_0x30861a][_0xaa55('0x43')],'VoiceQueueId':_0xcbb2b[_0x30861a][_0xaa55('0x44')],'CampaignId':_0xcbb2b[_0x30861a]['CampaignId']}});_0x1bbaaa[_0xaa55('0x45')](_0x90e409);}return BPromise[_0xaa55('0x46')](_0x1bbaaa);}})['then'](function(_0x2817db){logger['info'](_0xaa55('0x47'),util[_0xaa55('0x14')](_0x2817db,{'showHidden':![],'depth':null}));_0x3f1342();})[_0xaa55('0x28')](function(_0x506b19){logger[_0xaa55('0x2c')]('[CmContact][afterDestroy][Error]',util[_0xaa55('0x14')](_0x506b19,{'showHidden':![],'depth':null}));_0x3f1342(_0x506b19);});}}});}; \ No newline at end of file +var _0x36ff=['catch','error','afterCreate','Campaign','minutes','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20Campaign\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20Campaign\x20','findAll','outbound','dialCheckDuplicateType','CmList','always','onlyIfOpen','BlackLists','length','cmContact,\x20%s,\x20%s','message','Lists','CmHopperBlack','List\x20not\x20found','isEmpty','destroy','VoiceQueueId','push','info','[CmContact][afterDestroy][Succesfull]','inspect','util','../../config/logger','bluebird','rimraf','../../config/environment','./cmContact.attributes','exports','define','CmContact','cm_contacts','phone','fti_cm_contacts','lastName','fax','email','utf8mb4','utf8mb4_unicode_ci','models','get','cmContact','scheduledat','format','YYYY-MM-DD\x20HH:mm:ss','isNil','dialTimezone','VoiceQueue','findOne','then','timezones','utcOffset','add','ret','CmHopper','cmContact,\x20afterCreate\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20onlyIfOpen,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','create','ListId','priority','callbackUniqueid','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopper\x20VoiceQueue\x20','CmHopperFinal','cmContact,\x20afterCreate,\x20','\x20contact\x20not\x20insert\x20in\x20hopper,\x20check\x20duplicate\x20always,\x20exist\x20in\x20hopperFinal\x20VoiceQueue\x20'];(function(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0x36ff,0x1c6));var _0xf36f=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x36ff[_0x2763f2];return _0x3ef471;};'use strict';var _=require('lodash');var util=require(_0xf36f('0x0'));var logger=require(_0xf36f('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf36f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf36f('0x3'));var config=require(_0xf36f('0x4'));var shared=require('../../config/environment/shared');var attributes=require(_0xf36f('0x5'));module[_0xf36f('0x6')]=function(_0xb5262,_0x4da29a){return _0xb5262[_0xf36f('0x7')](_0xf36f('0x8'),attributes,{'tableName':_0xf36f('0x9'),'paranoid':!![],'indexes':[{'name':_0xf36f('0xa'),'fields':['phone']},{'name':_0xf36f('0xb'),'fields':['firstName',_0xf36f('0xc'),_0xf36f('0xa'),'mobile',_0xf36f('0xd'),_0xf36f('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'charset':_0xf36f('0xf'),'collate':_0xf36f('0x10'),'hooks':{'afterCreate':function(_0x57f185,_0x202b58,_0x546c88){var _0xe55f27=_0xb5262[_0xf36f('0x11')];var _0x4a7ee9=_0x57f185[_0xf36f('0x12')]({'plain':!![]});function _0x289b92(){return function(_0x2e0d55){logger['error'](_0xf36f('0x13'),'afterCreate',util['inspect'](_0x2e0d55,{'showHidden':![],'depth':null}));};}function _0xe252b8(_0x302a11,_0x32e30d){var _0x2e0c90=_0x32e30d[_0xf36f('0x14')]?_0x32e30d[_0xf36f('0x14')]:moment()[_0xf36f('0x15')](_0xf36f('0x16'));return new BPromise(function(_0x3a70e6,_0x1da9e8){if(_[_0xf36f('0x17')](_0x32e30d[_0xf36f('0x18')])){_0x3a70e6({'ret':_0x2e0c90});}else{_0xe55f27[_0xf36f('0x19')][_0xf36f('0x1a')]({'where':{'id':_0x302a11['id']}})[_0xf36f('0x1b')](function(_0x4f9bd2){if(!_['isNil'](_0x4f9bd2)){var _0x5e3acd=_0x4f9bd2[_0xf36f('0x18')];if(!_[_0xf36f('0x17')](_0x5e3acd)){var _0x138860=shared[_0xf36f('0x1c')];var _0xf2d753=_0x138860[_0x5e3acd];var _0x327064=_0x138860[_0x32e30d[_0xf36f('0x18')]];if(!_[_0xf36f('0x17')](_0xf2d753)&&!_[_0xf36f('0x17')](_0x327064)){var _0x4311c7=_0xf2d753[_0xf36f('0x1d')]-_0x327064[_0xf36f('0x1d')];_0x2e0c90=_0x32e30d['scheduledat']?_0x32e30d[_0xf36f('0x14')]:moment();var _0x4a2ad2=moment(_0x2e0c90)[_0xf36f('0x1e')](_0x4311c7,'minutes');_0x3a70e6({'ret':_0x4a2ad2[_0xf36f('0x15')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x3a70e6({'ret':_0x2e0c90});}else _0x3a70e6({'ret':_0x2e0c90});}else{_0x3a70e6({'ret':_0x2e0c90});}});}});return 0xa;}var _0x520e32=function(_0x588cbb){return new BPromise(function(_0x3dd356,_0x4a27a3){_0xe252b8(_0x588cbb,_0x4a7ee9)[_0xf36f('0x1b')](function(_0x18b277){_0x4a7ee9[_0xf36f('0x14')]=_0x18b277[_0xf36f('0x1f')];_0xe55f27[_0xf36f('0x20')][_0xf36f('0x1a')]({'where':{'phone':_0x4a7ee9['phone'],'VoiceQueueId':_0x588cbb['id']}})[_0xf36f('0x1b')](function(_0x2baeb7){if(!_[_0xf36f('0x17')](_0x2baeb7)){throw new Error(_0xf36f('0x21')+_0x4a7ee9[_0xf36f('0xa')]+_0xf36f('0x22')+_0x588cbb['id']);}return _0xe55f27[_0xf36f('0x20')][_0xf36f('0x23')]({'phone':_0x4a7ee9[_0xf36f('0xa')],'ContactId':_0x4a7ee9['id'],'ListId':_0x4a7ee9[_0xf36f('0x24')],'priority':_0x4a7ee9[_0xf36f('0x25')]?_0x4a7ee9[_0xf36f('0x25')]:0x2,'scheduledat':_0x4a7ee9[_0xf36f('0x14')]?_0x4a7ee9[_0xf36f('0x14')]:moment()[_0xf36f('0x15')](_0xf36f('0x16')),'callback':_0x4a7ee9[_0xf36f('0x26')]?!![]:![],'callbackuniqueid':_0x4a7ee9[_0xf36f('0x26')]?_0x4a7ee9['callbackUniqueid']:undefined,'callbackat':_0x4a7ee9[_0xf36f('0x26')]?moment()[_0xf36f('0x15')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x588cbb['id']});})['catch'](function(_0x34044e){_0x4a27a3(_0x34044e);});});});};var _0x4b1d5c=function(_0x444b62){return new BPromise(function(_0x8e4cf6,_0x27dbfa){_0xe252b8(_0x444b62,_0x4a7ee9)[_0xf36f('0x1b')](function(_0x18ab3a){_0x4a7ee9[_0xf36f('0x14')]=_0x18ab3a[_0xf36f('0x1f')];_0xe55f27['CmHopper'][_0xf36f('0x1a')]({'where':{'phone':_0x4a7ee9[_0xf36f('0xa')],'VoiceQueueId':_0x444b62['id']}})['then'](function(_0x2a7de5){if(!_[_0xf36f('0x17')](_0x2a7de5)){throw new Error('cmContact,\x20afterCreate\x20'+_0x4a7ee9[_0xf36f('0xa')]+_0xf36f('0x27')+_0x444b62['id']);}return _0xe55f27[_0xf36f('0x28')]['findOne']({'where':{'calleridnum':_0x4a7ee9[_0xf36f('0xa')],'VoiceQueueId':_0x444b62['id']}});})['then'](function(_0x2cf951){if(!_[_0xf36f('0x17')](_0x2cf951)){throw new Error(_0xf36f('0x29')+_0x4a7ee9[_0xf36f('0xa')]+_0xf36f('0x2a')+_0x444b62['id']);}return _0xe55f27[_0xf36f('0x20')][_0xf36f('0x23')]({'phone':_0x4a7ee9[_0xf36f('0xa')],'ContactId':_0x4a7ee9['id'],'ListId':_0x4a7ee9[_0xf36f('0x24')],'priority':_0x4a7ee9['priority']?_0x4a7ee9[_0xf36f('0x25')]:0x2,'scheduledat':_0x4a7ee9['scheduledat']?_0x4a7ee9['scheduledat']:moment()[_0xf36f('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x4a7ee9[_0xf36f('0x26')]?!![]:![],'callbackuniqueid':_0x4a7ee9[_0xf36f('0x26')]?_0x4a7ee9['callbackUniqueid']:undefined,'callbackat':_0x4a7ee9[_0xf36f('0x26')]?moment()[_0xf36f('0x15')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x444b62['id']});})[_0xf36f('0x2b')](function(_0x5ede3d){_0x27dbfa(_0x5ede3d);});});});};function _0x2cd31d(){return function(_0x16f443){logger[_0xf36f('0x2c')]('cmContact',_0xf36f('0x2d'),util['inspect'](_0x16f443,{'showHidden':![],'depth':null}));};}function _0x1dd0f4(_0x175cc4,_0x548f39){var _0x5d1cd9=_0x548f39[_0xf36f('0x14')]?_0x548f39[_0xf36f('0x14')]:moment()[_0xf36f('0x15')](_0xf36f('0x16'));return new BPromise(function(_0x2649f9,_0x4bc372){if(_[_0xf36f('0x17')](_0x548f39[_0xf36f('0x18')])){_0x2649f9({'ret':_0x5d1cd9});}else{_0xe55f27[_0xf36f('0x2e')][_0xf36f('0x1a')]({'where':{'id':_0x175cc4['id']}})['then'](function(_0x206d12){if(!_[_0xf36f('0x17')](_0x206d12)){var _0x4db58c=_0x206d12[_0xf36f('0x18')];if(!_['isNil'](_0x4db58c)){var _0x4833ce=shared['timezones'];var _0x499648=_0x4833ce[_0x4db58c];var _0x125a4c=_0x4833ce[_0x548f39[_0xf36f('0x18')]];if(!_[_0xf36f('0x17')](_0x499648)&&!_[_0xf36f('0x17')](_0x125a4c)){var _0x2666d0=_0x499648[_0xf36f('0x1d')]-_0x125a4c[_0xf36f('0x1d')];_0x5d1cd9=_0x548f39[_0xf36f('0x14')]?_0x548f39['scheduledat']:moment();var _0x49a0d4=moment(_0x5d1cd9)[_0xf36f('0x1e')](_0x2666d0,_0xf36f('0x2f'));_0x2649f9({'ret':_0x49a0d4[_0xf36f('0x15')]('YYYY-MM-DD\x20HH:mm:ss')});}else _0x2649f9({'ret':_0x5d1cd9});}else _0x2649f9({'ret':_0x5d1cd9});}else{_0x2649f9({'ret':_0x5d1cd9});}});}});return 0xa;}var _0x2cb568=function(_0x4965b2){return new BPromise(function(_0x5dcd63,_0x57539a){_0x1dd0f4(_0x4965b2,_0x4a7ee9)[_0xf36f('0x1b')](function(_0x24b4ab){_0x4a7ee9[_0xf36f('0x14')]=_0x24b4ab[_0xf36f('0x1f')];_0xe55f27[_0xf36f('0x20')]['findOne']({'where':{'phone':_0x4a7ee9[_0xf36f('0xa')],'CampaignId':_0x4965b2['id']}})[_0xf36f('0x1b')](function(_0x26c56e){if(!_[_0xf36f('0x17')](_0x26c56e)){throw new Error(_0xf36f('0x21')+_0x4a7ee9[_0xf36f('0xa')]+_0xf36f('0x30')+_0x4965b2['id']);}return _0xe55f27[_0xf36f('0x20')][_0xf36f('0x23')]({'phone':_0x4a7ee9['phone'],'ContactId':_0x4a7ee9['id'],'ListId':_0x4a7ee9['ListId'],'priority':_0x4a7ee9[_0xf36f('0x25')]?_0x4a7ee9['priority']:0x2,'scheduledat':_0x4a7ee9[_0xf36f('0x14')]?_0x4a7ee9[_0xf36f('0x14')]:moment()[_0xf36f('0x15')](_0xf36f('0x16')),'callback':_0x4a7ee9[_0xf36f('0x26')]?!![]:![],'callbackuniqueid':_0x4a7ee9[_0xf36f('0x26')]?_0x4a7ee9['callbackUniqueid']:undefined,'callbackat':_0x4a7ee9[_0xf36f('0x26')]?moment()[_0xf36f('0x15')](_0xf36f('0x16')):undefined,'CampaignId':_0x4965b2['id']});})[_0xf36f('0x2b')](function(_0x16c291){_0x57539a(_0x16c291);});});});};var _0x1362fa=function(_0x54c245){return new BPromise(function(_0x338ea5,_0x2b75b2){_0x1dd0f4(_0x54c245,_0x4a7ee9)[_0xf36f('0x1b')](function(_0x3119d7){_0x4a7ee9[_0xf36f('0x14')]=_0x3119d7[_0xf36f('0x1f')];_0xe55f27[_0xf36f('0x20')][_0xf36f('0x1a')]({'where':{'phone':_0x4a7ee9[_0xf36f('0xa')],'CampaignId':_0x54c245['id']}})[_0xf36f('0x1b')](function(_0x444d44){if(!_[_0xf36f('0x17')](_0x444d44)){throw new Error(_0xf36f('0x21')+_0x4a7ee9[_0xf36f('0xa')]+_0xf36f('0x31')+_0x54c245['id']);}return _0xe55f27[_0xf36f('0x28')][_0xf36f('0x1a')]({'where':{'calleridnum':_0x4a7ee9[_0xf36f('0xa')],'CampaignId':_0x54c245['id']}});})[_0xf36f('0x1b')](function(_0x51c69b){if(!_[_0xf36f('0x17')](_0x51c69b)){throw new Error('cmContact,\x20afterCreate,\x20'+_0x4a7ee9[_0xf36f('0xa')]+_0xf36f('0x32')+_0x54c245['id']);}return _0xe55f27[_0xf36f('0x20')][_0xf36f('0x23')]({'phone':_0x4a7ee9['phone'],'ContactId':_0x4a7ee9['id'],'ListId':_0x4a7ee9['ListId'],'priority':_0x4a7ee9[_0xf36f('0x25')]?_0x4a7ee9[_0xf36f('0x25')]:0x2,'scheduledat':_0x4a7ee9['scheduledat']?_0x4a7ee9['scheduledat']:moment()[_0xf36f('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'callback':_0x4a7ee9[_0xf36f('0x26')]?!![]:![],'callbackuniqueid':_0x4a7ee9[_0xf36f('0x26')]?_0x4a7ee9['callbackUniqueid']:undefined,'callbackat':_0x4a7ee9[_0xf36f('0x26')]?moment()[_0xf36f('0x15')](_0xf36f('0x16')):undefined,'CampaignId':_0x54c245['id']});})[_0xf36f('0x2b')](function(_0x2c503e){_0x2b75b2(_0x2c503e);});});});};if(_0x4a7ee9['ListId']){_0xe55f27[_0xf36f('0x19')][_0xf36f('0x33')]({'where':{'type':_0xf36f('0x34')},'attributes':['id',_0xf36f('0x35'),'dialTimezone'],'include':[{'model':_0xe55f27[_0xf36f('0x36')],'as':'Lists','where':{'id':_0x4a7ee9['ListId']}}]})[_0xf36f('0x1b')](function(_0x1f6835){if(_0x1f6835){var _0x5a0254=[];for(var _0x17e1b7=0x0,_0x1a102e;_0x17e1b7<_0x1f6835['length'];_0x17e1b7+=0x1){_0x1a102e=_0x1f6835[_0x17e1b7][_0xf36f('0x12')]({'plain':!![]});switch(_0x1a102e[_0xf36f('0x35')]){case _0xf36f('0x37'):_0x4b1d5c(_0x1a102e)[_0xf36f('0x2b')](_0x289b92());break;case _0xf36f('0x38'):_0x520e32(_0x1a102e)[_0xf36f('0x2b')](_0x289b92());break;default:_0x1dd0f4(_0x1a102e,_0x4a7ee9)['then'](function(_0x56519b){_0x4a7ee9['scheduledat']=_0x56519b[_0xf36f('0x1f')];_0xe55f27[_0xf36f('0x20')][_0xf36f('0x23')]({'phone':_0x4a7ee9[_0xf36f('0xa')],'ContactId':_0x4a7ee9['id'],'ListId':_0x4a7ee9[_0xf36f('0x24')],'scheduledat':_0x4a7ee9[_0xf36f('0x14')]?_0x4a7ee9['scheduledat']:moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'priority':_0x4a7ee9[_0xf36f('0x25')]?_0x4a7ee9[_0xf36f('0x25')]:0x2,'callback':_0x4a7ee9['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4a7ee9[_0xf36f('0x26')]?_0x4a7ee9[_0xf36f('0x26')]:undefined,'callbackat':_0x4a7ee9['callbackUniqueid']?moment()[_0xf36f('0x15')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'VoiceQueueId':_0x1a102e['id']})['catch'](_0x289b92());});}}}})[_0xf36f('0x1b')](function(){return _0xe55f27[_0xf36f('0x19')][_0xf36f('0x33')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':_0xe55f27[_0xf36f('0x36')],'as':_0xf36f('0x39'),'where':{'id':_0x4a7ee9['ListId']}}]})[_0xf36f('0x1b')](function(_0x355118){if(_0x355118){var _0x3cbd68=[];for(var _0xf84ae=0x0,_0x9d50a5;_0xf84ae<_0x355118[_0xf36f('0x3a')];_0xf84ae+=0x1){_0x9d50a5=_0x355118[_0xf84ae][_0xf36f('0x12')]({'plain':!![]});_0xe55f27['CmHopperBlack'][_0xf36f('0x23')]({'phone':_0x4a7ee9[_0xf36f('0xa')],'ContactId':_0x4a7ee9['id'],'ListId':_0x4a7ee9[_0xf36f('0x24')],'VoiceQueueId':_0x9d50a5['id']})['catch'](function(_0x586895){logger[_0xf36f('0x2c')](_0xf36f('0x3b'),_0xf36f('0x2d'),_0x586895[_0xf36f('0x3c')]);});}}});})[_0xf36f('0x1b')](function(){return _0xe55f27[_0xf36f('0x2e')][_0xf36f('0x33')]({'attributes':['id','dialCheckDuplicateType','dialTimezone'],'include':[{'model':_0xe55f27[_0xf36f('0x36')],'as':_0xf36f('0x3d'),'where':{'id':_0x4a7ee9[_0xf36f('0x24')]}}]})[_0xf36f('0x1b')](function(_0x513296){if(_0x513296){var _0x5a6a6a=[];for(var _0x44e611=0x0,_0x1bc296;_0x44e611<_0x513296[_0xf36f('0x3a')];_0x44e611+=0x1){_0x1bc296=_0x513296[_0x44e611][_0xf36f('0x12')]({'plain':!![]});switch(_0x1bc296[_0xf36f('0x35')]){case _0xf36f('0x37'):_0x1362fa(_0x1bc296)[_0xf36f('0x2b')](_0x2cd31d());break;case _0xf36f('0x38'):_0x2cb568(_0x1bc296)['catch'](_0x2cd31d());break;default:_0xe55f27[_0xf36f('0x20')]['create']({'phone':_0x4a7ee9[_0xf36f('0xa')],'ContactId':_0x4a7ee9['id'],'ListId':_0x4a7ee9[_0xf36f('0x24')],'scheduledat':_0x4a7ee9['scheduledat']?_0x4a7ee9[_0xf36f('0x14')]:moment()['format'](_0xf36f('0x16')),'priority':_0x4a7ee9[_0xf36f('0x25')]?_0x4a7ee9[_0xf36f('0x25')]:0x2,'callback':_0x4a7ee9['callbackUniqueid']?!![]:![],'callbackuniqueid':_0x4a7ee9[_0xf36f('0x26')]?_0x4a7ee9[_0xf36f('0x26')]:undefined,'callbackat':_0x4a7ee9['callbackUniqueid']?moment()[_0xf36f('0x15')]('YYYY-MM-DD\x20HH:mm:ss'):undefined,'CampaignId':_0x1bc296['id']})[_0xf36f('0x2b')](_0x2cd31d());}}}});})[_0xf36f('0x1b')](function(){return _0xe55f27[_0xf36f('0x2e')][_0xf36f('0x33')]({'attributes':['id'],'include':[{'model':_0xe55f27[_0xf36f('0x36')],'as':'BlackLists','where':{'id':_0x4a7ee9[_0xf36f('0x24')]}}]})['then'](function(_0x181eba){if(_0x181eba){var _0x51c7fa=[];for(var _0x3a670d=0x0,_0x36ff25;_0x3a670d<_0x181eba[_0xf36f('0x3a')];_0x3a670d+=0x1){_0x36ff25=_0x181eba[_0x3a670d]['get']({'plain':!![]});_0xe55f27[_0xf36f('0x3e')]['create']({'phone':_0x4a7ee9[_0xf36f('0xa')],'ContactId':_0x4a7ee9['id'],'ListId':_0x4a7ee9[_0xf36f('0x24')],'CampaignId':_0x36ff25['id']})[_0xf36f('0x2b')](function(_0x245549){logger[_0xf36f('0x2c')](_0xf36f('0x3b'),_0xf36f('0x2d'),_0x245549['message']);});}}});})[_0xf36f('0x1b')](function(){_0x546c88();})['catch'](function(_0x316f72){logger[_0xf36f('0x2c')]('cmContact,\x20%s,\x20%s',_0xf36f('0x2d'),_0x316f72[_0xf36f('0x3c')]);_0x546c88(_0x316f72);});}else{_0x546c88(new Error(_0xf36f('0x3f')));}},'afterDestroy':function(_0x432c44,_0x112086,_0x217509){var _0x543559=_0xb5262['models'];var _0x417859=_0x432c44['get']({'plain':!![]});return _0x543559[_0xf36f('0x20')][_0xf36f('0x33')]({'raw':!![],'where':{'ListId':_0x417859[_0xf36f('0x24')],'ContactId':_0x417859['id']}})[_0xf36f('0x1b')](function(_0x5691cd){if(!_[_0xf36f('0x40')](_0x5691cd)){var _0x32c70d=[];for(var _0x524e21=0x0;_0x524e21<_0x5691cd[_0xf36f('0x3a')];_0x524e21+=0x1){var _0x49d6b0=_0x543559[_0xf36f('0x20')][_0xf36f('0x41')]({'where':{'ListId':_0x5691cd[_0x524e21][_0xf36f('0x24')],'ContactId':_0x5691cd[_0x524e21]['ContactId'],'VoiceQueueId':_0x5691cd[_0x524e21][_0xf36f('0x42')],'CampaignId':_0x5691cd[_0x524e21]['CampaignId']}});_0x32c70d[_0xf36f('0x43')](_0x49d6b0);}return BPromise['all'](_0x32c70d);}})[_0xf36f('0x1b')](function(_0x560c0a){logger[_0xf36f('0x44')](_0xf36f('0x45'),util[_0xf36f('0x46')](_0x560c0a,{'showHidden':![],'depth':null}));_0x217509();})[_0xf36f('0x2b')](function(_0x54b583){logger[_0xf36f('0x2c')]('[CmContact][afterDestroy][Error]',util[_0xf36f('0x46')](_0x54b583,{'showHidden':![],'depth':null}));_0x217509(_0x54b583);});}}});}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.rpc.js b/server/api/cmContact/cmContact.rpc.js index e05c1f6..7ce828a 100644 --- a/server/api/cmContact/cmContact.rpc.js +++ b/server/api/cmContact/cmContact.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['phone','ListId','Contact','CmContactId','create','body','keys','length','startsWith','update','table','cm_contacts','id\x20=\x20?','sequelize','query','CreateCmContact','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','./cmContact.socket','register','info','CmContact,\x20%s,\x20%s','request\x20sent','debug','CmContact,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetCmContact','CmContact','findAll','options','where','limit','include','map','model','attributes','then','stringify','CmContactHasItem','find'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_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 moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var squel=require('squel');var db=require(_0x0a9e('0x4'))['db'];var utils=require(_0x0a9e('0x5'));var logger=require(_0x0a9e('0x6'))(_0x0a9e('0x7'));var config=require(_0x0a9e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0a9e('0x9')][_0x0a9e('0xa')]({'port':0x232a});config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithRpcPromise(_0x307b3e,_0x3ab53f,_0xfeb75b){return new BPromise(function(_0xbd1168,_0x4a4c56){return client['request'](_0x307b3e,_0xfeb75b)['then'](function(_0x4cfe67){logger[_0x0a9e('0xf')](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));logger[_0x0a9e('0x12')](_0x0a9e('0x13'),_0x3ab53f,_0x0a9e('0x11'),JSON['stringify'](_0x4cfe67));if(_0x4cfe67[_0x0a9e('0x14')]){if(_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x15')]===0x1f4){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')]['message']);return _0x4a4c56(_0x4cfe67[_0x0a9e('0x14')]['message']);}logger[_0x0a9e('0x14')]('CmContact,\x20%s,\x20%s',_0x3ab53f,_0x4cfe67[_0x0a9e('0x14')][_0x0a9e('0x16')]);return _0xbd1168(_0x4cfe67['error'][_0x0a9e('0x16')]);}else{logger['info'](_0x0a9e('0x10'),_0x3ab53f,_0x0a9e('0x11'));_0xbd1168(_0x4cfe67[_0x0a9e('0x17')][_0x0a9e('0x16')]);}})[_0x0a9e('0x18')](function(_0x2eb11f){logger[_0x0a9e('0x14')](_0x0a9e('0x10'),_0x3ab53f,_0x2eb11f);_0x4a4c56(_0x2eb11f);});});}exports[_0x0a9e('0x19')]=function(_0x112016){var _0x1c696a=this;return new Promise(function(_0x105080,_0x4bb1e3){return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':_0x112016['options']?_0x112016[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x112016['options']?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')]||null:null,'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')]['attributes']||null:null,'limit':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1e')]||null:null,'include':_0x112016[_0x0a9e('0x1c')]?_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x112016['options']['include'],function(_0x197ec0){return{'model':db[_0x197ec0[_0x0a9e('0x21')]],'as':_0x197ec0['as'],'attributes':_0x197ec0[_0x0a9e('0x22')],'include':_0x197ec0[_0x0a9e('0x1f')]?_['map'](_0x197ec0[_0x0a9e('0x1f')],function(_0x479bc4){return{'model':db[_0x479bc4[_0x0a9e('0x21')]],'as':_0x479bc4['as'],'attributes':_0x479bc4['attributes'],'include':_0x479bc4[_0x0a9e('0x1f')]?_[_0x0a9e('0x20')](_0x479bc4[_0x0a9e('0x1f')],function(_0x14433c){return{'model':db[_0x14433c[_0x0a9e('0x21')]],'as':_0x14433c['as'],'attributes':_0x14433c[_0x0a9e('0x22')]};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x23')](function(_0x14de77){logger['info'](_0x0a9e('0x19'),_0x112016);logger[_0x0a9e('0x12')](_0x0a9e('0x19'),_0x112016,JSON[_0x0a9e('0x24')](_0x14de77));if(_0x14de77['length']==0x0){return db[_0x0a9e('0x25')][_0x0a9e('0x26')]({'raw':!![],'where':{'item':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x27')]},'include':[{'model':db[_0x0a9e('0x1a')],'where':{'ListId':_0x112016[_0x0a9e('0x1c')][_0x0a9e('0x1d')][_0x0a9e('0x28')],'deletedAt':{'$eq':null}},'as':_0x0a9e('0x29')}]})['then'](function(_0x426950){if(_['isNil'](_0x426950)){_0x105080(_0x14de77);}else{var _0x2407f9=_0x426950[_0x0a9e('0x2a')];return db[_0x0a9e('0x1a')][_0x0a9e('0x1b')]({'raw':!![],'where':{'id':_0x2407f9},'attributes':_0x112016[_0x0a9e('0x1c')]?_0x112016['options'][_0x0a9e('0x22')]||null:null})[_0x0a9e('0x23')](function(_0x40cb85){_0x105080(_0x40cb85);});}});}else{_0x105080(_0x14de77);}})[_0x0a9e('0x18')](function(_0x2b45ea){logger[_0x0a9e('0x14')](_0x0a9e('0x19'),_0x2b45ea[_0x0a9e('0x16')],_0x112016);_0x4bb1e3(_0x1c696a['error'](0x1f4,_0x2b45ea[_0x0a9e('0x16')]));});});};exports['CreateCmContact']=function(_0x2cc7a0){var _0x14b13f=this;return new Promise(function(_0x2b7e7f,_0x3f3d41){return db['CmContact'][_0x0a9e('0x2b')](_0x2cc7a0[_0x0a9e('0x2c')],{'raw':_0x2cc7a0[_0x0a9e('0x1c')]?_0x2cc7a0[_0x0a9e('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1e8694){var _0x5640eb;for(var _0x24936a=0x0;_0x24936a{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file +var _0xa9e0=['basename','extname','now','/csv','single','file','uploadCsv','%s-%s%s','upload','/upload/:id','import','put','/:id','update','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','index','/describe','show','/:id/tags','isAuthenticated','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','getJourney','post','create','/create_many','bulkCreate','setTags','setAdditionalPhones','/:id/duplicateAdditionalPhones','/:id/rescheduleAdditionalPhones','rescheduleAdditionalPhones','join','root','server/files/tmp','originalname','replace','format'];(function(_0x68a9ad,_0x535fcb){var _0x548825=function(_0x1d8503){while(--_0x1d8503){_0x68a9ad['push'](_0x68a9ad['shift']());}};_0x548825(++_0x535fcb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/phones',auth['isAuthenticated'](),controller['getAdditionalPhones']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getHopperHistories']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['get'](_0x0a9e('0x16'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router[_0x0a9e('0x18')]('/merge',auth[_0x0a9e('0xd')](),controller['merge']);router[_0x0a9e('0x18')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x18')](_0x0a9e('0x1a'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x18')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router[_0x0a9e('0x18')]('/:id/phones',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1d')]);router['post'](_0x0a9e('0x1e'),auth['isAuthenticated'](),controller['duplicateAdditionalPhones']);router[_0x0a9e('0x18')](_0x0a9e('0x1f'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xfb6e48,_0x2fb0e4,_0x3b45bc){_0x3b45bc(null,path[_0x0a9e('0x21')](config[_0x0a9e('0x22')],_0x0a9e('0x23')));},'filename':function(_0x16b1ca,_0x5ea472,_0x59181e){_0x5ea472[_0x0a9e('0x24')]=_0x5ea472[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x59181e(null,util[_0x0a9e('0x26')]('%s-%s%s',path[_0x0a9e('0x27')](_0x5ea472['originalname'],path[_0x0a9e('0x28')](_0x5ea472['originalname'])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x5ea472[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')](_0x0a9e('0x2a'),upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3652a7,_0x468813,_0x2b1f27){_0x2b1f27(null,path[_0x0a9e('0x21')](config['root'],_0x0a9e('0x23')));},'filename':function(_0x40e7a3,_0x1843b2,_0x824a4f){_0x1843b2[_0x0a9e('0x24')]=_0x1843b2[_0x0a9e('0x24')][_0x0a9e('0x25')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x824a4f(null,util[_0x0a9e('0x26')](_0x0a9e('0x2e'),path['basename'](_0x1843b2[_0x0a9e('0x24')],path['extname'](_0x1843b2[_0x0a9e('0x24')])),Date[_0x0a9e('0x29')](),path[_0x0a9e('0x28')](_0x1843b2[_0x0a9e('0x24')])));}})});router[_0x0a9e('0x18')]('/upload',upload[_0x0a9e('0x2b')](_0x0a9e('0x2c')),controller[_0x0a9e('0x2f')]);router[_0x0a9e('0x18')](_0x0a9e('0x30'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x31')]);router[_0x0a9e('0x18')]('/uploadUpdates/:id',auth[_0x0a9e('0xd')](),controller['importUpdates']);router[_0x0a9e('0x32')](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x34')]);router['delete'](_0x0a9e('0x33'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x35')]);module[_0x0a9e('0x36')]=router; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.attributes.js b/server/api/cmContactHasItem/cmContactHasItem.attributes.js index e9d34d5..182e057 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.attributes.js +++ b/server/api/cmContactHasItem/cmContactHasItem.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa98d=['STRING','sequelize','INTEGER'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa98d,0xa3));var _0xda98=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xa98d[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xda98('0x0'));module['exports']={'CmContactId':{'type':Sequelize[_0xda98('0x1')],'primaryKey':!![]},'item':{'type':Sequelize['STRING'],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0xda98('0x1')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0xda98('0x2')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0xda98('0x1')],'defaultValue':null},'description':{'type':Sequelize[_0xda98('0x2')],'defaultValue':null}}; \ No newline at end of file +var _0x4f99=['exports','STRING','INTEGER','sequelize'];(function(_0x576e06,_0x2387f2){var _0x135ec2=function(_0x276a53){while(--_0x276a53){_0x576e06['push'](_0x576e06['shift']());}};_0x135ec2(++_0x2387f2);}(_0x4f99,0x157));var _0x94f9=function(_0x4e61aa,_0xda3b53){_0x4e61aa=_0x4e61aa-0x0;var _0x4d2bd2=_0x4f99[_0x4e61aa];return _0x4d2bd2;};'use strict';var Sequelize=require(_0x94f9('0x0'));module[_0x94f9('0x1')]={'CmContactId':{'type':Sequelize['INTEGER'],'primaryKey':!![]},'item':{'type':Sequelize[_0x94f9('0x2')],'defaultValue':'','primaryKey':!![]},'ItemTypeId':{'type':Sequelize[_0x94f9('0x3')],'defaultValue':null},'ItemClass':{'type':Sequelize[_0x94f9('0x2')],'defaultValue':'PHONE'},'OrderBy':{'type':Sequelize[_0x94f9('0x3')],'defaultValue':null},'description':{'type':Sequelize[_0x94f9('0x2')],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.controller.js b/server/api/cmContactHasItem/cmContactHasItem.controller.js index cd6de2f..a00c1e4 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.controller.js +++ b/server/api/cmContactHasItem/cmContactHasItem.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x03ee=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','CmContactHasItems','UserProfileResource','stack','name','send','index','map','fieldName','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','CmContactHasItem','includeAll','include','findAll','rows','catch','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring'];(function(_0x6228e7,_0x295d6a){var _0x4809a8=function(_0xa70e5){while(--_0xa70e5){_0x6228e7['push'](_0x6228e7['shift']());}};_0x4809a8(++_0x295d6a);}(_0x03ee,0xe8));var _0xe03e=function(_0x1cbcb2,_0x1237a3){_0x1cbcb2=_0x1cbcb2-0x0;var _0x41ac9f=_0x03ee[_0x1cbcb2];return _0x41ac9f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe03e('0x0'));var zipdir=require(_0xe03e('0x1'));var jsonpatch=require(_0xe03e('0x2'));var rp=require(_0xe03e('0x3'));var moment=require(_0xe03e('0x4'));var BPromise=require(_0xe03e('0x5'));var Mustache=require(_0xe03e('0x6'));var util=require(_0xe03e('0x7'));var path=require(_0xe03e('0x8'));var sox=require(_0xe03e('0x9'));var csv=require(_0xe03e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe03e('0xb'));var _=require(_0xe03e('0xc'));var squel=require(_0xe03e('0xd'));var crypto=require(_0xe03e('0xe'));var jsforce=require(_0xe03e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xe03e('0xa'));var querystring=require(_0xe03e('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe03e('0x11'));var qs=require(_0xe03e('0x12'));var as=require(_0xe03e('0x13'));var hardwareService=require(_0xe03e('0x14'));var logger=require(_0xe03e('0x15'))(_0xe03e('0x16'));var utils=require(_0xe03e('0x17'));var config=require(_0xe03e('0x18'));var licenseUtil=require(_0xe03e('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56fa89,_0x110947){_0x110947=_0x110947||0xcc;return function(_0x35dd67){if(_0x35dd67){return _0x56fa89[_0xe03e('0x1a')](_0x110947);}return _0x56fa89[_0xe03e('0x1b')](_0x110947)[_0xe03e('0x1c')]();};}function respondWithResult(_0x4cff9b,_0x476752){_0x476752=_0x476752||0xc8;return function(_0x166a2d){if(_0x166a2d){return _0x4cff9b[_0xe03e('0x1b')](_0x476752)[_0xe03e('0x1d')](_0x166a2d);}};}function respondWithFilteredResult(_0x2bf7d3,_0x9e7457){return function(_0x54748c){if(_0x54748c){var _0x18ebe0=typeof _0x9e7457[_0xe03e('0x1e')]===_0xe03e('0x1f')&&typeof _0x9e7457[_0xe03e('0x20')]===_0xe03e('0x1f');var _0x50fb35=_0x54748c[_0xe03e('0x21')];var _0xabd802=_0x18ebe0?0x0:_0x9e7457['offset'];var _0x307258=_0x18ebe0?_0x54748c[_0xe03e('0x21')]:_0x9e7457[_0xe03e('0x1e')]+_0x9e7457['limit'];var _0x1816a9;if(_0x307258>=_0x50fb35){_0x307258=_0x50fb35;_0x1816a9=0xc8;}else{_0x1816a9=0xce;}_0x2bf7d3[_0xe03e('0x1b')](_0x1816a9);return _0x2bf7d3['set'](_0xe03e('0x22'),_0xabd802+'-'+_0x307258+'/'+_0x50fb35)[_0xe03e('0x1d')](_0x54748c);}return null;};}function patchUpdates(_0x564e28){return function(_0x3f43c0){try{jsonpatch['apply'](_0x3f43c0,_0x564e28,!![]);}catch(_0x2f9685){return BPromise[_0xe03e('0x23')](_0x2f9685);}return _0x3f43c0[_0xe03e('0x24')]();};}function saveUpdates(_0x5dab9a,_0x28adeb){return function(_0x25cc60){if(_0x25cc60){return _0x25cc60[_0xe03e('0x25')](_0x5dab9a)[_0xe03e('0x26')](function(_0x4bb654){return _0x4bb654;});}return null;};}function removeEntity(_0xbfe5c1,_0x13abb1){return function(_0x374405){if(_0x374405){return _0x374405[_0xe03e('0x27')]()[_0xe03e('0x26')](function(){var _0x25c461=_0x374405['get']({'plain':!![]});var _0x2f314f=_0xe03e('0x28');return db[_0xe03e('0x29')][_0xe03e('0x27')]({'where':{'type':_0x2f314f,'resourceId':_0x25c461['id']}})[_0xe03e('0x26')](function(){return _0x374405;});})[_0xe03e('0x26')](function(){_0xbfe5c1['status'](0xcc)[_0xe03e('0x1c')]();});}};}function handleEntityNotFound(_0x57cf57,_0x2c53d2){return function(_0x3b2ce7){if(!_0x3b2ce7){_0x57cf57['sendStatus'](0x194);}return _0x3b2ce7;};}function handleError(_0x2b7257,_0x5a0607){_0x5a0607=_0x5a0607||0x1f4;return function(_0x2b9c47){logger['error'](_0x2b9c47[_0xe03e('0x2a')]);if(_0x2b9c47[_0xe03e('0x2b')]){delete _0x2b9c47[_0xe03e('0x2b')];}_0x2b7257['status'](_0x5a0607)[_0xe03e('0x2c')](_0x2b9c47);};}exports[_0xe03e('0x2d')]=function(_0x3fa85c,_0x4695d4){var _0x211b3f={},_0x4ae8e2={},_0x43273b={'count':0x0,'rows':[]};var _0x527b9b=_[_0xe03e('0x2e')](db['CmContactHasItem']['rawAttributes'],function(_0xaec64e){return{'name':_0xaec64e[_0xe03e('0x2f')],'type':_0xaec64e['type']['key']};});_0x4ae8e2[_0xe03e('0x30')]=_[_0xe03e('0x2e')](_0x527b9b,_0xe03e('0x2b'));_0x4ae8e2['query']=_[_0xe03e('0x31')](_0x3fa85c[_0xe03e('0x32')]);_0x4ae8e2[_0xe03e('0x33')]=_[_0xe03e('0x34')](_0x4ae8e2['model'],_0x4ae8e2[_0xe03e('0x32')]);_0x211b3f[_0xe03e('0x35')]=_[_0xe03e('0x34')](_0x4ae8e2[_0xe03e('0x30')],qs[_0xe03e('0x36')](_0x3fa85c[_0xe03e('0x32')][_0xe03e('0x36')]));_0x211b3f[_0xe03e('0x35')]=_0x211b3f[_0xe03e('0x35')]['length']?_0x211b3f[_0xe03e('0x35')]:_0x4ae8e2['model'];if(!_0x3fa85c[_0xe03e('0x32')][_0xe03e('0x37')](_0xe03e('0x38'))){_0x211b3f['limit']=qs[_0xe03e('0x20')](_0x3fa85c[_0xe03e('0x32')]['limit']);_0x211b3f[_0xe03e('0x1e')]=qs[_0xe03e('0x1e')](_0x3fa85c[_0xe03e('0x32')][_0xe03e('0x1e')]);}_0x211b3f[_0xe03e('0x39')]=qs['sort'](_0x3fa85c[_0xe03e('0x32')][_0xe03e('0x3a')]);_0x211b3f[_0xe03e('0x3b')]=qs[_0xe03e('0x33')](_['pick'](_0x3fa85c[_0xe03e('0x32')],_0x4ae8e2[_0xe03e('0x33')]),_0x527b9b);if(_0x3fa85c[_0xe03e('0x32')][_0xe03e('0x3c')]){_0x211b3f[_0xe03e('0x3b')]=_[_0xe03e('0x3d')](_0x211b3f[_0xe03e('0x3b')],{'$or':_['map'](_0x527b9b,function(_0x4f7d3a){if(_0x4f7d3a['type']!==_0xe03e('0x3e')){var _0x1dcafa={};_0x1dcafa[_0x4f7d3a['name']]={'$like':'%'+_0x3fa85c[_0xe03e('0x32')][_0xe03e('0x3c')]+'%'};return _0x1dcafa;}})});}_0x211b3f=_['merge']({},_0x211b3f,_0x3fa85c[_0xe03e('0x3f')]);var _0xde64a4={'where':_0x211b3f[_0xe03e('0x3b')]};return db[_0xe03e('0x40')][_0xe03e('0x21')](_0xde64a4)[_0xe03e('0x26')](function(_0x3192dd){_0x43273b[_0xe03e('0x21')]=_0x3192dd;if(_0x3fa85c['query'][_0xe03e('0x41')]){_0x211b3f[_0xe03e('0x42')]=[{'all':!![]}];}return db[_0xe03e('0x40')][_0xe03e('0x43')](_0x211b3f);})['then'](function(_0x4f07cd){_0x43273b[_0xe03e('0x44')]=_0x4f07cd;return _0x43273b;})[_0xe03e('0x26')](respondWithFilteredResult(_0x4695d4,_0x211b3f))[_0xe03e('0x45')](handleError(_0x4695d4,null));};exports['show']=function(_0x4d52d8,_0x5cfca2){var _0x1b383c={'raw':!![],'where':{'id':_0x4d52d8['params']['id']}},_0x10a7d0={};_0x10a7d0[_0xe03e('0x30')]=_[_0xe03e('0x31')](db[_0xe03e('0x40')][_0xe03e('0x46')]);_0x10a7d0[_0xe03e('0x32')]=_[_0xe03e('0x31')](_0x4d52d8['query']);_0x10a7d0[_0xe03e('0x33')]=_[_0xe03e('0x34')](_0x10a7d0[_0xe03e('0x30')],_0x10a7d0[_0xe03e('0x32')]);_0x1b383c[_0xe03e('0x35')]=_[_0xe03e('0x34')](_0x10a7d0[_0xe03e('0x30')],qs[_0xe03e('0x36')](_0x4d52d8[_0xe03e('0x32')]['fields']));_0x1b383c[_0xe03e('0x35')]=_0x1b383c[_0xe03e('0x35')]['length']?_0x1b383c['attributes']:_0x10a7d0[_0xe03e('0x30')];if(_0x4d52d8[_0xe03e('0x32')]['includeAll']){_0x1b383c[_0xe03e('0x42')]=[{'all':!![]}];}_0x1b383c=_[_0xe03e('0x3d')]({},_0x1b383c,_0x4d52d8['options']);return db[_0xe03e('0x40')]['find'](_0x1b383c)[_0xe03e('0x26')](handleEntityNotFound(_0x5cfca2,null))['then'](respondWithResult(_0x5cfca2,null))[_0xe03e('0x45')](handleError(_0x5cfca2,null));};exports[_0xe03e('0x47')]=function(_0x42561c,_0x3e1a9d){return db[_0xe03e('0x40')][_0xe03e('0x47')](_0x42561c[_0xe03e('0x48')],{})[_0xe03e('0x26')](function(_0x20d75d){var _0x23e69f=_0x42561c[_0xe03e('0x49')][_0xe03e('0x4a')]({'plain':!![]});if(!_0x23e69f)throw new Error(_0xe03e('0x4b'));if(_0x23e69f[_0xe03e('0x4c')]===_0xe03e('0x49')){var _0x10116e=_0x20d75d[_0xe03e('0x4a')]({'plain':!![]});var _0x31edef=_0xe03e('0x28');return db[_0xe03e('0x4d')][_0xe03e('0x4e')]({'where':{'name':_0x31edef,'userProfileId':_0x23e69f[_0xe03e('0x4f')]},'raw':!![]})[_0xe03e('0x26')](function(_0x31a821){if(_0x31a821&&_0x31a821[_0xe03e('0x50')]===0x0){return db['UserProfileResource'][_0xe03e('0x47')]({'name':_0x10116e[_0xe03e('0x2b')],'resourceId':_0x10116e['id'],'type':_0x31a821['name'],'sectionId':_0x31a821['id']},{})[_0xe03e('0x26')](function(){return _0x20d75d;});}else{return _0x20d75d;}})[_0xe03e('0x45')](function(_0x54c5fb){logger[_0xe03e('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54c5fb);throw _0x54c5fb;});}return _0x20d75d;})[_0xe03e('0x26')](respondWithResult(_0x3e1a9d,0xc9))[_0xe03e('0x45')](handleError(_0x3e1a9d,null));};exports['update']=function(_0x343247,_0x150968){if(_0x343247[_0xe03e('0x48')]['id']){delete _0x343247[_0xe03e('0x48')]['id'];}return db[_0xe03e('0x40')][_0xe03e('0x4e')]({'where':{'id':_0x343247[_0xe03e('0x52')]['id']}})[_0xe03e('0x26')](handleEntityNotFound(_0x150968,null))['then'](saveUpdates(_0x343247[_0xe03e('0x48')],null))['then'](respondWithResult(_0x150968,null))[_0xe03e('0x45')](handleError(_0x150968,null));};exports['destroy']=function(_0x46be99,_0x2c4b03){return db[_0xe03e('0x40')][_0xe03e('0x4e')]({'where':{'id':_0x46be99[_0xe03e('0x52')]['id']}})[_0xe03e('0x26')](handleEntityNotFound(_0x2c4b03,null))[_0xe03e('0x26')](removeEntity(_0x2c4b03,null))['catch'](handleError(_0x2c4b03,null));}; \ No newline at end of file +var _0x200c=['sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','set','Content-Range','apply','reject','update','then','destroy','get','CmContactHasItems','UserProfileResource','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','count','includeAll','include','CmContactHasItem','findAll','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x200c,0x1b9));var _0xc200=function(_0x2ea313,_0x5e0da7){_0x2ea313=_0x2ea313-0x0;var _0x4d23ae=_0x200c[_0x2ea313];return _0x4d23ae;};'use strict';var emlformat=require(_0xc200('0x0'));var rimraf=require(_0xc200('0x1'));var zipdir=require(_0xc200('0x2'));var jsonpatch=require(_0xc200('0x3'));var rp=require(_0xc200('0x4'));var moment=require(_0xc200('0x5'));var BPromise=require(_0xc200('0x6'));var Mustache=require(_0xc200('0x7'));var util=require(_0xc200('0x8'));var path=require('path');var sox=require(_0xc200('0x9'));var csv=require(_0xc200('0xa'));var ejs=require(_0xc200('0xb'));var fs=require('fs');var fs_extra=require(_0xc200('0xc'));var _=require(_0xc200('0xd'));var squel=require(_0xc200('0xe'));var crypto=require(_0xc200('0xf'));var jsforce=require(_0xc200('0x10'));var deskjs=require(_0xc200('0x11'));var toCsv=require(_0xc200('0xa'));var querystring=require(_0xc200('0x12'));var Papa=require(_0xc200('0x13'));var Redis=require(_0xc200('0x14'));var authService=require(_0xc200('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xc200('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc200('0x17'))(_0xc200('0x18'));var utils=require('../../config/utils');var config=require(_0xc200('0x19'));var licenseUtil=require(_0xc200('0x1a'));var db=require(_0xc200('0x1b'))['db'];function respondWithStatusCode(_0x17c866,_0x103b98){_0x103b98=_0x103b98||0xcc;return function(_0x2ccde7){if(_0x2ccde7){return _0x17c866[_0xc200('0x1c')](_0x103b98);}return _0x17c866[_0xc200('0x1d')](_0x103b98)['end']();};}function respondWithResult(_0x30478f,_0x43e79b){_0x43e79b=_0x43e79b||0xc8;return function(_0x535151){if(_0x535151){return _0x30478f[_0xc200('0x1d')](_0x43e79b)[_0xc200('0x1e')](_0x535151);}};}function respondWithFilteredResult(_0x484885,_0x2cc692){return function(_0x286d01){if(_0x286d01){var _0x5ae7d4=typeof _0x2cc692[_0xc200('0x1f')]===_0xc200('0x20')&&typeof _0x2cc692[_0xc200('0x21')]===_0xc200('0x20');var _0x2cb699=_0x286d01['count'];var _0x555a74=_0x5ae7d4?0x0:_0x2cc692['offset'];var _0x3049af=_0x5ae7d4?_0x286d01['count']:_0x2cc692['offset']+_0x2cc692['limit'];var _0x329c45;if(_0x3049af>=_0x2cb699){_0x3049af=_0x2cb699;_0x329c45=0xc8;}else{_0x329c45=0xce;}_0x484885[_0xc200('0x1d')](_0x329c45);return _0x484885[_0xc200('0x22')](_0xc200('0x23'),_0x555a74+'-'+_0x3049af+'/'+_0x2cb699)['json'](_0x286d01);}return null;};}function patchUpdates(_0x748a40){return function(_0x207ed9){try{jsonpatch[_0xc200('0x24')](_0x207ed9,_0x748a40,!![]);}catch(_0x5533f3){return BPromise[_0xc200('0x25')](_0x5533f3);}return _0x207ed9['save']();};}function saveUpdates(_0x4bed5e,_0x431b59){return function(_0xbd93fd){if(_0xbd93fd){return _0xbd93fd[_0xc200('0x26')](_0x4bed5e)[_0xc200('0x27')](function(_0x8347fd){return _0x8347fd;});}return null;};}function removeEntity(_0x143f59,_0x3c3d80){return function(_0x1a5a16){if(_0x1a5a16){return _0x1a5a16[_0xc200('0x28')]()[_0xc200('0x27')](function(){var _0x23ae15=_0x1a5a16[_0xc200('0x29')]({'plain':!![]});var _0x9d1831=_0xc200('0x2a');return db[_0xc200('0x2b')][_0xc200('0x28')]({'where':{'type':_0x9d1831,'resourceId':_0x23ae15['id']}})[_0xc200('0x27')](function(){return _0x1a5a16;});})[_0xc200('0x27')](function(){_0x143f59[_0xc200('0x1d')](0xcc)[_0xc200('0x2c')]();});}};}function handleEntityNotFound(_0x50a7ed,_0x51aa79){return function(_0x20bb7c){if(!_0x20bb7c){_0x50a7ed[_0xc200('0x1c')](0x194);}return _0x20bb7c;};}function handleError(_0x28d4ac,_0x3dfcee){_0x3dfcee=_0x3dfcee||0x1f4;return function(_0x221ba3){logger['error'](_0x221ba3[_0xc200('0x2d')]);if(_0x221ba3[_0xc200('0x2e')]){delete _0x221ba3[_0xc200('0x2e')];}_0x28d4ac[_0xc200('0x1d')](_0x3dfcee)[_0xc200('0x2f')](_0x221ba3);};}exports[_0xc200('0x30')]=function(_0x13bd6f,_0x17e3a1){var _0xe5eefc={},_0x420029={},_0x4d8b24={'count':0x0,'rows':[]};var _0x2ee760=_[_0xc200('0x31')](db['CmContactHasItem'][_0xc200('0x32')],function(_0x53ae4c){return{'name':_0x53ae4c[_0xc200('0x33')],'type':_0x53ae4c[_0xc200('0x34')][_0xc200('0x35')]};});_0x420029[_0xc200('0x36')]=_[_0xc200('0x31')](_0x2ee760,_0xc200('0x2e'));_0x420029[_0xc200('0x37')]=_[_0xc200('0x38')](_0x13bd6f[_0xc200('0x37')]);_0x420029[_0xc200('0x39')]=_[_0xc200('0x3a')](_0x420029['model'],_0x420029[_0xc200('0x37')]);_0xe5eefc[_0xc200('0x3b')]=_[_0xc200('0x3a')](_0x420029[_0xc200('0x36')],qs[_0xc200('0x3c')](_0x13bd6f['query']['fields']));_0xe5eefc[_0xc200('0x3b')]=_0xe5eefc[_0xc200('0x3b')][_0xc200('0x3d')]?_0xe5eefc[_0xc200('0x3b')]:_0x420029['model'];if(!_0x13bd6f['query'][_0xc200('0x3e')](_0xc200('0x3f'))){_0xe5eefc[_0xc200('0x21')]=qs[_0xc200('0x21')](_0x13bd6f['query'][_0xc200('0x21')]);_0xe5eefc[_0xc200('0x1f')]=qs[_0xc200('0x1f')](_0x13bd6f[_0xc200('0x37')]['offset']);}_0xe5eefc[_0xc200('0x40')]=qs['sort'](_0x13bd6f[_0xc200('0x37')][_0xc200('0x41')]);_0xe5eefc[_0xc200('0x42')]=qs['filters'](_[_0xc200('0x43')](_0x13bd6f[_0xc200('0x37')],_0x420029[_0xc200('0x39')]),_0x2ee760);if(_0x13bd6f[_0xc200('0x37')]['filter']){_0xe5eefc[_0xc200('0x42')]=_[_0xc200('0x44')](_0xe5eefc[_0xc200('0x42')],{'$or':_['map'](_0x2ee760,function(_0x2afef5){if(_0x2afef5[_0xc200('0x34')]!==_0xc200('0x45')){var _0x168ea9={};_0x168ea9[_0x2afef5[_0xc200('0x2e')]]={'$like':'%'+_0x13bd6f[_0xc200('0x37')]['filter']+'%'};return _0x168ea9;}})});}_0xe5eefc=_[_0xc200('0x44')]({},_0xe5eefc,_0x13bd6f[_0xc200('0x46')]);var _0x104f97={'where':_0xe5eefc[_0xc200('0x42')]};return db['CmContactHasItem'][_0xc200('0x47')](_0x104f97)['then'](function(_0x27fc26){_0x4d8b24[_0xc200('0x47')]=_0x27fc26;if(_0x13bd6f[_0xc200('0x37')][_0xc200('0x48')]){_0xe5eefc[_0xc200('0x49')]=[{'all':!![]}];}return db[_0xc200('0x4a')][_0xc200('0x4b')](_0xe5eefc);})['then'](function(_0x1e44d6){_0x4d8b24['rows']=_0x1e44d6;return _0x4d8b24;})[_0xc200('0x27')](respondWithFilteredResult(_0x17e3a1,_0xe5eefc))[_0xc200('0x4c')](handleError(_0x17e3a1,null));};exports[_0xc200('0x4d')]=function(_0x5b63f8,_0x5b7542){var _0x3b66c7={'raw':!![],'where':{'id':_0x5b63f8[_0xc200('0x4e')]['id']}},_0x378848={};_0x378848[_0xc200('0x36')]=_[_0xc200('0x38')](db[_0xc200('0x4a')][_0xc200('0x32')]);_0x378848[_0xc200('0x37')]=_[_0xc200('0x38')](_0x5b63f8[_0xc200('0x37')]);_0x378848['filters']=_[_0xc200('0x3a')](_0x378848[_0xc200('0x36')],_0x378848[_0xc200('0x37')]);_0x3b66c7['attributes']=_[_0xc200('0x3a')](_0x378848[_0xc200('0x36')],qs[_0xc200('0x3c')](_0x5b63f8[_0xc200('0x37')][_0xc200('0x3c')]));_0x3b66c7['attributes']=_0x3b66c7[_0xc200('0x3b')][_0xc200('0x3d')]?_0x3b66c7['attributes']:_0x378848[_0xc200('0x36')];if(_0x5b63f8['query'][_0xc200('0x48')]){_0x3b66c7[_0xc200('0x49')]=[{'all':!![]}];}_0x3b66c7=_[_0xc200('0x44')]({},_0x3b66c7,_0x5b63f8[_0xc200('0x46')]);return db['CmContactHasItem']['find'](_0x3b66c7)[_0xc200('0x27')](handleEntityNotFound(_0x5b7542,null))[_0xc200('0x27')](respondWithResult(_0x5b7542,null))['catch'](handleError(_0x5b7542,null));};exports[_0xc200('0x4f')]=function(_0xf0f027,_0x223fa7){return db[_0xc200('0x4a')][_0xc200('0x4f')](_0xf0f027['body'],{})['then'](function(_0x52d15e){var _0x6ce12f=_0xf0f027[_0xc200('0x50')]['get']({'plain':!![]});if(!_0x6ce12f)throw new Error(_0xc200('0x51'));if(_0x6ce12f[_0xc200('0x52')]==='user'){var _0x57d160=_0x52d15e['get']({'plain':!![]});var _0x18d295=_0xc200('0x2a');return db[_0xc200('0x53')][_0xc200('0x54')]({'where':{'name':_0x18d295,'userProfileId':_0x6ce12f[_0xc200('0x55')]},'raw':!![]})[_0xc200('0x27')](function(_0x11d7e4){if(_0x11d7e4&&_0x11d7e4[_0xc200('0x56')]===0x0){return db[_0xc200('0x2b')][_0xc200('0x4f')]({'name':_0x57d160['name'],'resourceId':_0x57d160['id'],'type':_0x11d7e4['name'],'sectionId':_0x11d7e4['id']},{})['then'](function(){return _0x52d15e;});}else{return _0x52d15e;}})[_0xc200('0x4c')](function(_0xf370f3){logger[_0xc200('0x57')](_0xc200('0x58'),_0xf370f3);throw _0xf370f3;});}return _0x52d15e;})[_0xc200('0x27')](respondWithResult(_0x223fa7,0xc9))['catch'](handleError(_0x223fa7,null));};exports[_0xc200('0x26')]=function(_0x1c7489,_0x546a84){if(_0x1c7489[_0xc200('0x59')]['id']){delete _0x1c7489[_0xc200('0x59')]['id'];}return db['CmContactHasItem']['find']({'where':{'id':_0x1c7489[_0xc200('0x4e')]['id']}})['then'](handleEntityNotFound(_0x546a84,null))[_0xc200('0x27')](saveUpdates(_0x1c7489[_0xc200('0x59')],null))[_0xc200('0x27')](respondWithResult(_0x546a84,null))[_0xc200('0x4c')](handleError(_0x546a84,null));};exports[_0xc200('0x28')]=function(_0x2db997,_0x2b6b91){return db['CmContactHasItem'][_0xc200('0x54')]({'where':{'id':_0x2db997[_0xc200('0x4e')]['id']}})[_0xc200('0x27')](handleEntityNotFound(_0x2b6b91,null))['then'](removeEntity(_0x2b6b91,null))[_0xc200('0x4c')](handleError(_0x2b6b91,null));}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.model.js b/server/api/cmContactHasItem/cmContactHasItem.model.js index 8b0c7e8..8837b5f 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.model.js +++ b/server/api/cmContactHasItem/cmContactHasItem.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x59f5=['exports','define','cm_contact_has_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cmContactHasItem.attributes'];(function(_0x4b6c16,_0x1e2006){var _0x214d6d=function(_0x4c5f96){while(--_0x4c5f96){_0x4b6c16['push'](_0x4b6c16['shift']());}};_0x214d6d(++_0x1e2006);}(_0x59f5,0x16f));var _0x559f=function(_0x6b4306,_0x394520){_0x6b4306=_0x6b4306-0x0;var _0xf7568c=_0x59f5[_0x6b4306];return _0xf7568c;};'use strict';var _=require(_0x559f('0x0'));var util=require(_0x559f('0x1'));var logger=require(_0x559f('0x2'))(_0x559f('0x3'));var moment=require(_0x559f('0x4'));var BPromise=require(_0x559f('0x5'));var rp=require(_0x559f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x559f('0x7'));var config=require(_0x559f('0x8'));var attributes=require(_0x559f('0x9'));module[_0x559f('0xa')]=function(_0x21b84a,_0x225968){return _0x21b84a[_0x559f('0xb')]('CmContactHasItem',attributes,{'tableName':_0x559f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x72de=['moment','request-promise','path','rimraf','../../config/environment','./cmContactHasItem.attributes','exports','cm_contact_has_items','../../config/logger','api'];(function(_0x465845,_0x15007c){var _0x314825=function(_0x4f24b8){while(--_0x4f24b8){_0x465845['push'](_0x465845['shift']());}};_0x314825(++_0x15007c);}(_0x72de,0x1b6));var _0xe72d=function(_0x3a3d4f,_0xa32003){_0x3a3d4f=_0x3a3d4f-0x0;var _0x7c03cd=_0x72de[_0x3a3d4f];return _0x7c03cd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe72d('0x0'))(_0xe72d('0x1'));var moment=require(_0xe72d('0x2'));var BPromise=require('bluebird');var rp=require(_0xe72d('0x3'));var fs=require('fs');var path=require(_0xe72d('0x4'));var rimraf=require(_0xe72d('0x5'));var config=require(_0xe72d('0x6'));var attributes=require(_0xe72d('0x7'));module[_0xe72d('0x8')]=function(_0x440de2,_0x8cb051){return _0x440de2['define']('CmContactHasItem',attributes,{'tableName':_0xe72d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmContactHasItem/cmContactHasItem.rpc.js b/server/api/cmContactHasItem/cmContactHasItem.rpc.js index 4e50a41..e1b6f21 100644 --- a/server/api/cmContactHasItem/cmContactHasItem.rpc.js +++ b/server/api/cmContactHasItem/cmContactHasItem.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6456=['error','code','CmContactHasItem,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','debug','CmContactHasItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4a6edc,_0x43edab){var _0x5a9617=function(_0x4b0a67){while(--_0x4b0a67){_0x4a6edc['push'](_0x4a6edc['shift']());}};_0x5a9617(++_0x43edab);}(_0x6456,0x1e2));var _0x6645=function(_0x3ef45a,_0x4b6756){_0x3ef45a=_0x3ef45a-0x0;var _0x86f9aa=_0x6456[_0x3ef45a];return _0x86f9aa;};'use strict';var _=require('lodash');var util=require(_0x6645('0x0'));var moment=require(_0x6645('0x1'));var BPromise=require(_0x6645('0x2'));var rs=require(_0x6645('0x3'));var fs=require('fs');var Redis=require(_0x6645('0x4'));var db=require(_0x6645('0x5'))['db'];var utils=require(_0x6645('0x6'));var logger=require(_0x6645('0x7'))(_0x6645('0x8'));var config=require(_0x6645('0x9'));var jayson=require(_0x6645('0xa'));var client=jayson[_0x6645('0xb')][_0x6645('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xa99c4f,_0x12cb8a,_0x1f3c8b){return new BPromise(function(_0x36a200,_0x1c7c38){return client['request'](_0xa99c4f,_0x1f3c8b)[_0x6645('0xd')](function(_0x31a3ea){logger['info']('CmContactHasItem,\x20%s,\x20%s',_0x12cb8a,'request\x20sent');logger[_0x6645('0xe')](_0x6645('0xf'),_0x12cb8a,_0x6645('0x10'),JSON[_0x6645('0x11')](_0x31a3ea));if(_0x31a3ea[_0x6645('0x12')]){if(_0x31a3ea[_0x6645('0x12')][_0x6645('0x13')]===0x1f4){logger['error'](_0x6645('0x14'),_0x12cb8a,_0x31a3ea['error'][_0x6645('0x15')]);return _0x1c7c38(_0x31a3ea[_0x6645('0x12')]['message']);}logger[_0x6645('0x12')](_0x6645('0x14'),_0x12cb8a,_0x31a3ea[_0x6645('0x12')][_0x6645('0x15')]);return _0x36a200(_0x31a3ea['error']['message']);}else{logger[_0x6645('0x16')](_0x6645('0x14'),_0x12cb8a,_0x6645('0x10'));_0x36a200(_0x31a3ea[_0x6645('0x17')][_0x6645('0x15')]);}})[_0x6645('0x18')](function(_0x35f122){logger[_0x6645('0x12')](_0x6645('0x14'),_0x12cb8a,_0x35f122);_0x1c7c38(_0x35f122);});});} \ No newline at end of file +var _0x548c=['../../config/environment','then','info','request\x20sent','CmContactHasItem,\x20%s,\x20%s,\x20%s','stringify','error','code','CmContactHasItem,\x20%s,\x20%s','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x7f22d1,_0x2211b6){var _0xb152c5=function(_0x48047b){while(--_0x48047b){_0x7f22d1['push'](_0x7f22d1['shift']());}};_0xb152c5(++_0x2211b6);}(_0x548c,0x173));var _0xc548=function(_0x494d57,_0x188221){_0x494d57=_0x494d57-0x0;var _0x2661e5=_0x548c[_0x494d57];return _0x2661e5;};'use strict';var _=require(_0xc548('0x0'));var util=require(_0xc548('0x1'));var moment=require('moment');var BPromise=require(_0xc548('0x2'));var rs=require(_0xc548('0x3'));var fs=require('fs');var Redis=require(_0xc548('0x4'));var db=require(_0xc548('0x5'))['db'];var utils=require(_0xc548('0x6'));var logger=require(_0xc548('0x7'))(_0xc548('0x8'));var config=require(_0xc548('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2bcc3f,_0x2098ab,_0x121e70){return new BPromise(function(_0x2fdfb3,_0x28793e){return client['request'](_0x2bcc3f,_0x121e70)[_0xc548('0xa')](function(_0x450d12){logger[_0xc548('0xb')]('CmContactHasItem,\x20%s,\x20%s',_0x2098ab,_0xc548('0xc'));logger['debug'](_0xc548('0xd'),_0x2098ab,'request\x20sent',JSON[_0xc548('0xe')](_0x450d12));if(_0x450d12[_0xc548('0xf')]){if(_0x450d12[_0xc548('0xf')][_0xc548('0x10')]===0x1f4){logger[_0xc548('0xf')](_0xc548('0x11'),_0x2098ab,_0x450d12[_0xc548('0xf')][_0xc548('0x12')]);return _0x28793e(_0x450d12['error']['message']);}logger['error'](_0xc548('0x11'),_0x2098ab,_0x450d12[_0xc548('0xf')]['message']);return _0x2fdfb3(_0x450d12[_0xc548('0xf')]['message']);}else{logger[_0xc548('0xb')](_0xc548('0x11'),_0x2098ab,_0xc548('0xc'));_0x2fdfb3(_0x450d12['result'][_0xc548('0x12')]);}})[_0xc548('0x13')](function(_0x1ac603){logger[_0xc548('0xf')]('CmContactHasItem,\x20%s,\x20%s',_0x2098ab,_0x1ac603);_0x28793e(_0x1ac603);});});} \ No newline at end of file diff --git a/server/api/cmContactHasItem/index.js b/server/api/cmContactHasItem/index.js index b0de380..d7fec93 100644 --- a/server/api/cmContactHasItem/index.js +++ b/server/api/cmContactHasItem/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xed73=['Router','fs-extra','./cmContactHasItem.controller','get','isAuthenticated','index','/:id','create','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x4a6a00,_0x4471b8){var _0x73d8c8=function(_0x4c2608){while(--_0x4c2608){_0x4a6a00['push'](_0x4a6a00['shift']());}};_0x73d8c8(++_0x4471b8);}(_0xed73,0x132));var _0x3ed7=function(_0x3d846e,_0x31ec6e){_0x3d846e=_0x3d846e-0x0;var _0x145539=_0xed73[_0x3d846e];return _0x145539;};'use strict';var multer=require(_0x3ed7('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3ed7('0x1'));var express=require('express');var router=express[_0x3ed7('0x2')]();var fs_extra=require(_0x3ed7('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3ed7('0x4'));router[_0x3ed7('0x5')]('/',auth[_0x3ed7('0x6')](),controller[_0x3ed7('0x7')]);router[_0x3ed7('0x5')](_0x3ed7('0x8'),auth[_0x3ed7('0x6')](),controller['show']);router['post']('/',auth[_0x3ed7('0x6')](),controller[_0x3ed7('0x9')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x3ed7('0xa')]);router[_0x3ed7('0xb')](_0x3ed7('0x8'),auth[_0x3ed7('0x6')](),controller[_0x3ed7('0xc')]);module[_0x3ed7('0xd')]=router; \ No newline at end of file +var _0x2096=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContactHasItem.controller','get','isAuthenticated','/:id','post','create','put','update','delete','destroy'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x2096,0x112));var _0x6209=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2096[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x6209('0x0'));var util=require(_0x6209('0x1'));var path=require(_0x6209('0x2'));var timeout=require(_0x6209('0x3'));var express=require(_0x6209('0x4'));var router=express[_0x6209('0x5')]();var fs_extra=require(_0x6209('0x6'));var auth=require(_0x6209('0x7'));var interaction=require(_0x6209('0x8'));var config=require(_0x6209('0x9'));var controller=require(_0x6209('0xa'));router[_0x6209('0xb')]('/',auth[_0x6209('0xc')](),controller['index']);router[_0x6209('0xb')](_0x6209('0xd'),auth[_0x6209('0xc')](),controller['show']);router[_0x6209('0xe')]('/',auth['isAuthenticated'](),controller[_0x6209('0xf')]);router[_0x6209('0x10')](_0x6209('0xd'),auth['isAuthenticated'](),controller[_0x6209('0x11')]);router[_0x6209('0x12')](_0x6209('0xd'),auth[_0x6209('0xc')](),controller[_0x6209('0x13')]);module[_0x6209('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index d52aff4..5771586 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 _0x2497=['sequelize','getDataValue','alias','STRING','setDataValue','name','select','values','isArray','stringify','BOOLEAN'];(function(_0x23aa41,_0x2944df){var _0x293abb=function(_0x96c603){while(--_0x96c603){_0x23aa41['push'](_0x23aa41['shift']());}};_0x293abb(++_0x2944df);}(_0x2497,0x14a));var _0x7249=function(_0x542d43,_0x581432){_0x542d43=_0x542d43-0x0;var _0x3fb854=_0x2497[_0x542d43];return _0x3fb854;};'use strict';var Sequelize=require(_0x7249('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x17cea2){return this[_0x7249('0x1')](_0x7249('0x2'));}},'alias':{'type':Sequelize[_0x7249('0x3')],'allowNull':![],'set':function(_0x362342){this[_0x7249('0x4')]('alias',_0x362342?_0x362342:this[_0x7249('0x1')](_0x7249('0x5')));}},'type':{'type':Sequelize[_0x7249('0x3')],'allowNull':![]},'values':{'type':Sequelize['TEXT']('long'),'get':function(){if(this[_0x7249('0x1')]('type')===_0x7249('0x6')){return JSON['parse'](this['getDataValue'](_0x7249('0x7')));}else{return this[_0x7249('0x1')](_0x7249('0x7'));}},'set':function(_0x32fc6e){if(Array[_0x7249('0x8')](_0x32fc6e)){this[_0x7249('0x4')](_0x7249('0x7'),JSON[_0x7249('0x9')](_0x32fc6e));}else{this[_0x7249('0x4')](_0x7249('0x7'),_0x32fc6e);}}},'required':{'type':Sequelize[_0x7249('0xa')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x7249('0xa')],'defaultValue':![]},'actionType':{'type':Sequelize['ENUM']('voice')}}; \ No newline at end of file +var _0xccfc=['sequelize','lodash','exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','long','type','parse','isArray','values','stringify','BOOLEAN','ENUM'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0xccfc,0x1cb));var _0xcccf=function(_0x4b440e,_0x190138){_0x4b440e=_0x4b440e-0x0;var _0x5932c2=_0xccfc[_0x4b440e];return _0x5932c2;};'use strict';var Sequelize=require(_0xcccf('0x0'));var _=require(_0xcccf('0x1'));module[_0xcccf('0x2')]={'name':{'type':Sequelize[_0xcccf('0x3')],'get':function(_0x1bb8a){return this[_0xcccf('0x4')](_0xcccf('0x5'));}},'alias':{'type':Sequelize[_0xcccf('0x6')],'allowNull':![],'set':function(_0x342707){this[_0xcccf('0x7')](_0xcccf('0x5'),_0x342707?_0x342707:this[_0xcccf('0x4')](_0xcccf('0x8')));}},'type':{'type':Sequelize[_0xcccf('0x6')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xcccf('0x9')),'get':function(){if(this[_0xcccf('0x4')](_0xcccf('0xa'))==='select'){return JSON[_0xcccf('0xb')](this[_0xcccf('0x4')]('values'));}else{return this['getDataValue']('values');}},'set':function(_0x22a8f2){if(Array[_0xcccf('0xc')](_0x22a8f2)){this[_0xcccf('0x7')](_0xcccf('0xd'),JSON[_0xcccf('0xe')](_0x22a8f2));}else{this[_0xcccf('0x7')](_0xcccf('0xd'),_0x22a8f2);}}},'required':{'type':Sequelize[_0xcccf('0xf')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0xcccf('0xf')],'defaultValue':![]},'actionType':{'type':Sequelize[_0xcccf('0x10')]('voice')}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index e27d406..6d541ca 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 _0xfd69=['model','intersection','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','body','create','sequelize','transaction','Sequelize','text','TEXT','number','type','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmCustomField','rawAttributes','key','query','keys'];(function(_0x2ba436,_0xa0adbc){var _0x3a6706=function(_0x4b9d89){while(--_0x4b9d89){_0x2ba436['push'](_0x2ba436['shift']());}};_0x3a6706(++_0xa0adbc);}(_0xfd69,0x146));var _0x9fd6=function(_0x3ae10d,_0x1a7d1d){_0x3ae10d=_0x3ae10d-0x0;var _0x27e528=_0xfd69[_0x3ae10d];return _0x27e528;};'use strict';var emlformat=require(_0x9fd6('0x0'));var rimraf=require(_0x9fd6('0x1'));var zipdir=require(_0x9fd6('0x2'));var jsonpatch=require(_0x9fd6('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9fd6('0x4'));var Mustache=require(_0x9fd6('0x5'));var util=require(_0x9fd6('0x6'));var path=require('path');var sox=require(_0x9fd6('0x7'));var csv=require(_0x9fd6('0x8'));var ejs=require(_0x9fd6('0x9'));var fs=require('fs');var fs_extra=require(_0x9fd6('0xa'));var _=require(_0x9fd6('0xb'));var squel=require(_0x9fd6('0xc'));var crypto=require(_0x9fd6('0xd'));var jsforce=require(_0x9fd6('0xe'));var deskjs=require(_0x9fd6('0xf'));var toCsv=require(_0x9fd6('0x8'));var querystring=require(_0x9fd6('0x10'));var Papa=require(_0x9fd6('0x11'));var Redis=require(_0x9fd6('0x12'));var authService=require(_0x9fd6('0x13'));var qs=require(_0x9fd6('0x14'));var as=require(_0x9fd6('0x15'));var hardwareService=require(_0x9fd6('0x16'));var logger=require(_0x9fd6('0x17'))(_0x9fd6('0x18'));var utils=require(_0x9fd6('0x19'));var config=require(_0x9fd6('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5cb155,_0x4f9821){_0x4f9821=_0x4f9821||0xcc;return function(_0x1add84){if(_0x1add84){return _0x5cb155[_0x9fd6('0x1b')](_0x4f9821);}return _0x5cb155[_0x9fd6('0x1c')](_0x4f9821)[_0x9fd6('0x1d')]();};}function respondWithResult(_0x339c9b,_0x1a59a0){_0x1a59a0=_0x1a59a0||0xc8;return function(_0x3036e2){if(_0x3036e2){return _0x339c9b[_0x9fd6('0x1c')](_0x1a59a0)[_0x9fd6('0x1e')](_0x3036e2);}};}function respondWithFilteredResult(_0x1ac3c4,_0xe35ea){return function(_0x375c1e){if(_0x375c1e){var _0x5ed9dd=typeof _0xe35ea[_0x9fd6('0x1f')]===_0x9fd6('0x20')&&typeof _0xe35ea[_0x9fd6('0x21')]===_0x9fd6('0x20');var _0x5e865a=_0x375c1e['count'];var _0x41e521=_0x5ed9dd?0x0:_0xe35ea[_0x9fd6('0x1f')];var _0x5cebe2=_0x5ed9dd?_0x375c1e[_0x9fd6('0x22')]:_0xe35ea[_0x9fd6('0x1f')]+_0xe35ea[_0x9fd6('0x21')];var _0x47ee61;if(_0x5cebe2>=_0x5e865a){_0x5cebe2=_0x5e865a;_0x47ee61=0xc8;}else{_0x47ee61=0xce;}_0x1ac3c4[_0x9fd6('0x1c')](_0x47ee61);return _0x1ac3c4[_0x9fd6('0x23')](_0x9fd6('0x24'),_0x41e521+'-'+_0x5cebe2+'/'+_0x5e865a)[_0x9fd6('0x1e')](_0x375c1e);}return null;};}function patchUpdates(_0xb9c54b){return function(_0x11283e){try{jsonpatch[_0x9fd6('0x25')](_0x11283e,_0xb9c54b,!![]);}catch(_0x6325f0){return BPromise[_0x9fd6('0x26')](_0x6325f0);}return _0x11283e[_0x9fd6('0x27')]();};}function saveUpdates(_0x3a81ba,_0x24412a){return function(_0x232d9e){if(_0x232d9e){return _0x232d9e[_0x9fd6('0x28')](_0x3a81ba)[_0x9fd6('0x29')](function(_0x5c85d4){return _0x5c85d4;});}return null;};}function removeEntity(_0xea3d56,_0x1254ab){return function(_0x5c59fa){if(_0x5c59fa){return _0x5c59fa[_0x9fd6('0x2a')]()[_0x9fd6('0x29')](function(){_0xea3d56[_0x9fd6('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5902ef,_0x51bca8){return function(_0x90d4c8){if(!_0x90d4c8){_0x5902ef[_0x9fd6('0x1b')](0x194);}return _0x90d4c8;};}function handleError(_0xb7c4b2,_0x52c57){_0x52c57=_0x52c57||0x1f4;return function(_0x40ef61){logger[_0x9fd6('0x2b')](_0x40ef61[_0x9fd6('0x2c')]);if(_0x40ef61[_0x9fd6('0x2d')]){delete _0x40ef61['name'];}_0xb7c4b2[_0x9fd6('0x1c')](_0x52c57)[_0x9fd6('0x2e')](_0x40ef61);};}exports[_0x9fd6('0x2f')]=function(_0x2a3105,_0x273a62){var _0x414d8c={},_0x37b002={},_0x1c5be0={'count':0x0,'rows':[]};var _0x10339c=_[_0x9fd6('0x30')](db[_0x9fd6('0x31')][_0x9fd6('0x32')],function(_0x3887eb){return{'name':_0x3887eb['fieldName'],'type':_0x3887eb['type'][_0x9fd6('0x33')]};});_0x37b002['model']=_['differenceBy'](_[_0x9fd6('0x30')](_0x10339c,_0x9fd6('0x2d')),[_0x9fd6('0x2d')]);_0x37b002[_0x9fd6('0x34')]=_[_0x9fd6('0x35')](_0x2a3105[_0x9fd6('0x34')]);_0x37b002['filters']=_['intersection'](_0x37b002[_0x9fd6('0x36')],_0x37b002[_0x9fd6('0x34')]);_0x414d8c['attributes']=_[_0x9fd6('0x37')](_0x37b002[_0x9fd6('0x36')],qs[_0x9fd6('0x38')](_0x2a3105[_0x9fd6('0x34')][_0x9fd6('0x38')]));_0x414d8c['attributes']=_0x414d8c['attributes'][_0x9fd6('0x39')]?_0x414d8c[_0x9fd6('0x3a')]:_0x37b002[_0x9fd6('0x36')];if(!_0x2a3105['query'][_0x9fd6('0x3b')](_0x9fd6('0x3c'))){_0x414d8c['limit']=qs[_0x9fd6('0x21')](_0x2a3105[_0x9fd6('0x34')]['limit']);_0x414d8c[_0x9fd6('0x1f')]=qs[_0x9fd6('0x1f')](_0x2a3105[_0x9fd6('0x34')][_0x9fd6('0x1f')]);}_0x414d8c[_0x9fd6('0x3d')]=qs[_0x9fd6('0x3e')](_0x2a3105[_0x9fd6('0x34')][_0x9fd6('0x3e')]);_0x414d8c[_0x9fd6('0x3f')]=qs[_0x9fd6('0x40')](_[_0x9fd6('0x41')](_0x2a3105[_0x9fd6('0x34')],_0x37b002[_0x9fd6('0x40')]),_0x10339c);if(_0x2a3105[_0x9fd6('0x34')][_0x9fd6('0x42')]){_0x414d8c[_0x9fd6('0x3f')]=_[_0x9fd6('0x43')](_0x414d8c[_0x9fd6('0x3f')],{'$or':_[_0x9fd6('0x30')](_0x10339c,function(_0x51475b){if(_0x51475b['type']!==_0x9fd6('0x44')){var _0x5a2dcb={};_0x5a2dcb[_0x51475b[_0x9fd6('0x2d')]]={'$like':'%'+_0x2a3105['query'][_0x9fd6('0x42')]+'%'};return _0x5a2dcb;}})});}_0x414d8c=_[_0x9fd6('0x43')]({},_0x414d8c,_0x2a3105[_0x9fd6('0x45')]);var _0x524567={'where':_0x414d8c['where']};return db[_0x9fd6('0x31')][_0x9fd6('0x22')](_0x524567)[_0x9fd6('0x29')](function(_0x482c04){_0x1c5be0['count']=_0x482c04;if(_0x2a3105[_0x9fd6('0x34')][_0x9fd6('0x46')]){_0x414d8c['include']=[{'all':!![]}];}return db[_0x9fd6('0x31')][_0x9fd6('0x47')](_0x414d8c);})[_0x9fd6('0x29')](function(_0x1de446){_0x1c5be0['rows']=_0x1de446;return _0x1c5be0;})['then'](respondWithFilteredResult(_0x273a62,_0x414d8c))[_0x9fd6('0x48')](handleError(_0x273a62,null));};exports[_0x9fd6('0x49')]=function(_0x268160,_0x15fab9){var _0x4b973e={'raw':!![],'where':{'id':_0x268160[_0x9fd6('0x4a')]['id']}},_0x423098={};_0x423098['model']=_[_0x9fd6('0x35')](db[_0x9fd6('0x31')][_0x9fd6('0x32')]);_0x423098['query']=_[_0x9fd6('0x35')](_0x268160[_0x9fd6('0x34')]);_0x423098[_0x9fd6('0x40')]=_[_0x9fd6('0x37')](_0x423098[_0x9fd6('0x36')],_0x423098[_0x9fd6('0x34')]);_0x4b973e[_0x9fd6('0x3a')]=_[_0x9fd6('0x37')](_0x423098[_0x9fd6('0x36')],qs['fields'](_0x268160[_0x9fd6('0x34')]['fields']));_0x4b973e[_0x9fd6('0x3a')]=_0x4b973e['attributes'][_0x9fd6('0x39')]?_0x4b973e[_0x9fd6('0x3a')]:_0x423098['model'];if(_0x268160['query'][_0x9fd6('0x46')]){_0x4b973e[_0x9fd6('0x4b')]=[{'all':!![]}];}_0x4b973e=_[_0x9fd6('0x43')]({},_0x4b973e,_0x268160[_0x9fd6('0x45')]);return db[_0x9fd6('0x31')][_0x9fd6('0x4c')](_0x4b973e)[_0x9fd6('0x29')](handleEntityNotFound(_0x15fab9,null))[_0x9fd6('0x29')](respondWithResult(_0x15fab9,null))['catch'](handleError(_0x15fab9,null));};exports[_0x9fd6('0x28')]=function(_0x25e773,_0x283aec){if(_0x25e773[_0x9fd6('0x4d')]['id']){delete _0x25e773['body']['id'];}return db[_0x9fd6('0x31')][_0x9fd6('0x4c')]({'where':{'id':_0x25e773['params']['id']}})[_0x9fd6('0x29')](handleEntityNotFound(_0x283aec,null))[_0x9fd6('0x29')](saveUpdates(_0x25e773['body'],null))[_0x9fd6('0x29')](respondWithResult(_0x283aec,null))[_0x9fd6('0x48')](handleError(_0x283aec,null));};exports['destroy']=function(_0x1e5ef4,_0x232776){return db[_0x9fd6('0x31')][_0x9fd6('0x4c')]({'where':{'id':_0x1e5ef4[_0x9fd6('0x4a')]['id']}})[_0x9fd6('0x29')](handleEntityNotFound(_0x232776,null))[_0x9fd6('0x29')](removeEntity(_0x232776,null))['catch'](handleError(_0x232776,null));};exports[_0x9fd6('0x4e')]=function(_0x468894,_0x56a3be){var _0x147da6;return db[_0x9fd6('0x4f')][_0x9fd6('0x50')](function(_0x45eab0){return db[_0x9fd6('0x31')][_0x9fd6('0x4e')](_0x468894[_0x9fd6('0x4d')],{'transaction':_0x45eab0})[_0x9fd6('0x29')](function(_0x34dc39){_0x147da6=_0x34dc39;var _0x103bce={'type':db[_0x9fd6('0x51')]['TEXT'],'transaction':_0x45eab0};switch(_0x468894[_0x9fd6('0x4d')]['type']){case _0x9fd6('0x52'):_0x103bce['type']=db[_0x9fd6('0x51')][_0x9fd6('0x53')];break;case _0x9fd6('0x54'):_0x103bce[_0x9fd6('0x55')]=db['Sequelize'][_0x9fd6('0x56')];break;case _0x9fd6('0x57'):_0x103bce[_0x9fd6('0x55')]=db[_0x9fd6('0x51')][_0x9fd6('0x58')];_0x103bce[_0x9fd6('0x59')]=![];break;default:}return db[_0x9fd6('0x4f')][_0x9fd6('0x5a')][_0x9fd6('0x5b')](_0x9fd6('0x5c'),util[_0x9fd6('0x5d')](_0x9fd6('0x5e'),_0x147da6['id']),_0x103bce);})['then'](function(){return _0x147da6;});})[_0x9fd6('0x29')](respondWithResult(_0x56a3be,0xc9))[_0x9fd6('0x48')](handleError(_0x56a3be,null));}; \ No newline at end of file +var _0x5c36=['sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','intersection','length','find','catch','body','params','create','sequelize','transaction','TEXT','text','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','format','cf_%d','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','map','CmCustomField','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x5c36,0x1d1));var _0x65c3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5c36[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x65c3('0x0'));var jsonpatch=require(_0x65c3('0x1'));var rp=require(_0x65c3('0x2'));var moment=require(_0x65c3('0x3'));var BPromise=require(_0x65c3('0x4'));var Mustache=require('mustache');var util=require(_0x65c3('0x5'));var path=require(_0x65c3('0x6'));var sox=require(_0x65c3('0x7'));var csv=require(_0x65c3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x65c3('0x9'));var squel=require(_0x65c3('0xa'));var crypto=require(_0x65c3('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x65c3('0x8'));var querystring=require(_0x65c3('0xc'));var Papa=require(_0x65c3('0xd'));var Redis=require(_0x65c3('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x65c3('0xf'));var as=require(_0x65c3('0x10'));var hardwareService=require(_0x65c3('0x11'));var logger=require(_0x65c3('0x12'))(_0x65c3('0x13'));var utils=require(_0x65c3('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x65c3('0x15'));var db=require(_0x65c3('0x16'))['db'];function respondWithStatusCode(_0x349b03,_0x5afc37){_0x5afc37=_0x5afc37||0xcc;return function(_0x2f54ef){if(_0x2f54ef){return _0x349b03[_0x65c3('0x17')](_0x5afc37);}return _0x349b03[_0x65c3('0x18')](_0x5afc37)['end']();};}function respondWithResult(_0x223e29,_0x146db5){_0x146db5=_0x146db5||0xc8;return function(_0x2b2381){if(_0x2b2381){return _0x223e29['status'](_0x146db5)['json'](_0x2b2381);}};}function respondWithFilteredResult(_0x4712cf,_0x36fbf6){return function(_0x12be12){if(_0x12be12){var _0x4c9a7b=typeof _0x36fbf6[_0x65c3('0x19')]===_0x65c3('0x1a')&&typeof _0x36fbf6[_0x65c3('0x1b')]===_0x65c3('0x1a');var _0x5efdea=_0x12be12[_0x65c3('0x1c')];var _0x2a7bc1=_0x4c9a7b?0x0:_0x36fbf6[_0x65c3('0x19')];var _0x266847=_0x4c9a7b?_0x12be12['count']:_0x36fbf6['offset']+_0x36fbf6[_0x65c3('0x1b')];var _0x31670e;if(_0x266847>=_0x5efdea){_0x266847=_0x5efdea;_0x31670e=0xc8;}else{_0x31670e=0xce;}_0x4712cf[_0x65c3('0x18')](_0x31670e);return _0x4712cf[_0x65c3('0x1d')](_0x65c3('0x1e'),_0x2a7bc1+'-'+_0x266847+'/'+_0x5efdea)[_0x65c3('0x1f')](_0x12be12);}return null;};}function patchUpdates(_0x582bac){return function(_0x1ff354){try{jsonpatch[_0x65c3('0x20')](_0x1ff354,_0x582bac,!![]);}catch(_0x4ac1b4){return BPromise[_0x65c3('0x21')](_0x4ac1b4);}return _0x1ff354['save']();};}function saveUpdates(_0x2a256d,_0x5fd38){return function(_0x41f969){if(_0x41f969){return _0x41f969[_0x65c3('0x22')](_0x2a256d)[_0x65c3('0x23')](function(_0x191ce2){return _0x191ce2;});}return null;};}function removeEntity(_0x233fe1,_0x3488a1){return function(_0x578bb3){if(_0x578bb3){return _0x578bb3[_0x65c3('0x24')]()[_0x65c3('0x23')](function(){_0x233fe1[_0x65c3('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x264647,_0x2ac060){return function(_0x3d7b49){if(!_0x3d7b49){_0x264647[_0x65c3('0x17')](0x194);}return _0x3d7b49;};}function handleError(_0x2cedc9,_0x396ca5){_0x396ca5=_0x396ca5||0x1f4;return function(_0x1c191e){logger[_0x65c3('0x25')](_0x1c191e[_0x65c3('0x26')]);if(_0x1c191e[_0x65c3('0x27')]){delete _0x1c191e[_0x65c3('0x27')];}_0x2cedc9[_0x65c3('0x18')](_0x396ca5)[_0x65c3('0x28')](_0x1c191e);};}exports[_0x65c3('0x29')]=function(_0x12efa7,_0x55e38c){var _0x5e97bc={},_0x3c5571={},_0x18945a={'count':0x0,'rows':[]};var _0xb04283=_[_0x65c3('0x2a')](db[_0x65c3('0x2b')][_0x65c3('0x2c')],function(_0x32f340){return{'name':_0x32f340[_0x65c3('0x2d')],'type':_0x32f340[_0x65c3('0x2e')][_0x65c3('0x2f')]};});_0x3c5571['model']=_['differenceBy'](_['map'](_0xb04283,_0x65c3('0x27')),[_0x65c3('0x27')]);_0x3c5571['query']=_[_0x65c3('0x30')](_0x12efa7[_0x65c3('0x31')]);_0x3c5571[_0x65c3('0x32')]=_['intersection'](_0x3c5571[_0x65c3('0x33')],_0x3c5571[_0x65c3('0x31')]);_0x5e97bc[_0x65c3('0x34')]=_['intersection'](_0x3c5571[_0x65c3('0x33')],qs[_0x65c3('0x35')](_0x12efa7[_0x65c3('0x31')][_0x65c3('0x35')]));_0x5e97bc[_0x65c3('0x34')]=_0x5e97bc[_0x65c3('0x34')]['length']?_0x5e97bc[_0x65c3('0x34')]:_0x3c5571[_0x65c3('0x33')];if(!_0x12efa7[_0x65c3('0x31')][_0x65c3('0x36')](_0x65c3('0x37'))){_0x5e97bc['limit']=qs[_0x65c3('0x1b')](_0x12efa7[_0x65c3('0x31')][_0x65c3('0x1b')]);_0x5e97bc[_0x65c3('0x19')]=qs[_0x65c3('0x19')](_0x12efa7['query']['offset']);}_0x5e97bc[_0x65c3('0x38')]=qs[_0x65c3('0x39')](_0x12efa7[_0x65c3('0x31')][_0x65c3('0x39')]);_0x5e97bc[_0x65c3('0x3a')]=qs[_0x65c3('0x32')](_[_0x65c3('0x3b')](_0x12efa7[_0x65c3('0x31')],_0x3c5571[_0x65c3('0x32')]),_0xb04283);if(_0x12efa7[_0x65c3('0x31')][_0x65c3('0x3c')]){_0x5e97bc['where']=_['merge'](_0x5e97bc['where'],{'$or':_['map'](_0xb04283,function(_0x1fc713){if(_0x1fc713[_0x65c3('0x2e')]!==_0x65c3('0x3d')){var _0x5515e0={};_0x5515e0[_0x1fc713[_0x65c3('0x27')]]={'$like':'%'+_0x12efa7[_0x65c3('0x31')][_0x65c3('0x3c')]+'%'};return _0x5515e0;}})});}_0x5e97bc=_[_0x65c3('0x3e')]({},_0x5e97bc,_0x12efa7[_0x65c3('0x3f')]);var _0x1800af={'where':_0x5e97bc[_0x65c3('0x3a')]};return db['CmCustomField'][_0x65c3('0x1c')](_0x1800af)[_0x65c3('0x23')](function(_0x538bc1){_0x18945a[_0x65c3('0x1c')]=_0x538bc1;if(_0x12efa7['query'][_0x65c3('0x40')]){_0x5e97bc[_0x65c3('0x41')]=[{'all':!![]}];}return db[_0x65c3('0x2b')]['findAll'](_0x5e97bc);})[_0x65c3('0x23')](function(_0x19791d){_0x18945a['rows']=_0x19791d;return _0x18945a;})['then'](respondWithFilteredResult(_0x55e38c,_0x5e97bc))['catch'](handleError(_0x55e38c,null));};exports['show']=function(_0x22c0a6,_0x3237ed){var _0x241769={'raw':!![],'where':{'id':_0x22c0a6['params']['id']}},_0x5968ed={};_0x5968ed[_0x65c3('0x33')]=_[_0x65c3('0x30')](db['CmCustomField'][_0x65c3('0x2c')]);_0x5968ed[_0x65c3('0x31')]=_['keys'](_0x22c0a6[_0x65c3('0x31')]);_0x5968ed['filters']=_[_0x65c3('0x42')](_0x5968ed['model'],_0x5968ed[_0x65c3('0x31')]);_0x241769['attributes']=_['intersection'](_0x5968ed[_0x65c3('0x33')],qs['fields'](_0x22c0a6[_0x65c3('0x31')][_0x65c3('0x35')]));_0x241769[_0x65c3('0x34')]=_0x241769['attributes'][_0x65c3('0x43')]?_0x241769[_0x65c3('0x34')]:_0x5968ed[_0x65c3('0x33')];if(_0x22c0a6['query'][_0x65c3('0x40')]){_0x241769[_0x65c3('0x41')]=[{'all':!![]}];}_0x241769=_[_0x65c3('0x3e')]({},_0x241769,_0x22c0a6[_0x65c3('0x3f')]);return db[_0x65c3('0x2b')][_0x65c3('0x44')](_0x241769)[_0x65c3('0x23')](handleEntityNotFound(_0x3237ed,null))['then'](respondWithResult(_0x3237ed,null))[_0x65c3('0x45')](handleError(_0x3237ed,null));};exports[_0x65c3('0x22')]=function(_0x56777a,_0x48d78a){if(_0x56777a[_0x65c3('0x46')]['id']){delete _0x56777a[_0x65c3('0x46')]['id'];}return db[_0x65c3('0x2b')][_0x65c3('0x44')]({'where':{'id':_0x56777a[_0x65c3('0x47')]['id']}})['then'](handleEntityNotFound(_0x48d78a,null))[_0x65c3('0x23')](saveUpdates(_0x56777a[_0x65c3('0x46')],null))['then'](respondWithResult(_0x48d78a,null))[_0x65c3('0x45')](handleError(_0x48d78a,null));};exports['destroy']=function(_0x3ae192,_0x278825){return db[_0x65c3('0x2b')][_0x65c3('0x44')]({'where':{'id':_0x3ae192[_0x65c3('0x47')]['id']}})[_0x65c3('0x23')](handleEntityNotFound(_0x278825,null))[_0x65c3('0x23')](removeEntity(_0x278825,null))[_0x65c3('0x45')](handleError(_0x278825,null));};exports[_0x65c3('0x48')]=function(_0x1f5dd6,_0x5d76d1){var _0x155151;return db[_0x65c3('0x49')][_0x65c3('0x4a')](function(_0x43182b){return db[_0x65c3('0x2b')][_0x65c3('0x48')](_0x1f5dd6[_0x65c3('0x46')],{'transaction':_0x43182b})[_0x65c3('0x23')](function(_0x74d18f){_0x155151=_0x74d18f;var _0x58ab7a={'type':db['Sequelize'][_0x65c3('0x4b')],'transaction':_0x43182b};switch(_0x1f5dd6[_0x65c3('0x46')][_0x65c3('0x2e')]){case _0x65c3('0x4c'):_0x58ab7a[_0x65c3('0x2e')]=db[_0x65c3('0x4d')][_0x65c3('0x4b')];break;case _0x65c3('0x4e'):_0x58ab7a[_0x65c3('0x2e')]=db[_0x65c3('0x4d')][_0x65c3('0x4f')];break;case _0x65c3('0x50'):_0x58ab7a[_0x65c3('0x2e')]=db['Sequelize'][_0x65c3('0x51')];_0x58ab7a[_0x65c3('0x52')]=![];break;default:}return db[_0x65c3('0x49')][_0x65c3('0x53')]['addColumn'](_0x65c3('0x54'),util[_0x65c3('0x55')](_0x65c3('0x56'),_0x155151['id']),_0x58ab7a);})[_0x65c3('0x23')](function(){return _0x155151;});})[_0x65c3('0x23')](respondWithResult(_0x5d76d1,0xc9))[_0x65c3('0x45')](handleError(_0x5d76d1,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index c7e5670..3e031d3 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 _0x2d6a=['path','rimraf','../../config/environment','./cmCustomField.attributes','define','CmCustomField','cm_custom_fields','../../config/logger','api','moment','request-promise'];(function(_0x10d3b1,_0x35db4d){var _0x15c8aa=function(_0x182f0a){while(--_0x182f0a){_0x10d3b1['push'](_0x10d3b1['shift']());}};_0x15c8aa(++_0x35db4d);}(_0x2d6a,0x10f));var _0xa2d6=function(_0x4f63b2,_0x3d1472){_0x4f63b2=_0x4f63b2-0x0;var _0x1a86d5=_0x2d6a[_0x4f63b2];return _0x1a86d5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa2d6('0x0'))(_0xa2d6('0x1'));var moment=require(_0xa2d6('0x2'));var BPromise=require('bluebird');var rp=require(_0xa2d6('0x3'));var fs=require('fs');var path=require(_0xa2d6('0x4'));var rimraf=require(_0xa2d6('0x5'));var config=require(_0xa2d6('0x6'));var attributes=require(_0xa2d6('0x7'));module['exports']=function(_0x2ab5ab,_0x4e47f8){return _0x2ab5ab[_0xa2d6('0x8')](_0xa2d6('0x9'),attributes,{'tableName':_0xa2d6('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3060=['cm_custom_fields','util','../../config/logger','api','bluebird','path','rimraf','exports','define','CmCustomField'];(function(_0x27604f,_0x5ae336){var _0x40d189=function(_0xebacde){while(--_0xebacde){_0x27604f['push'](_0x27604f['shift']());}};_0x40d189(++_0x5ae336);}(_0x3060,0x17d));var _0x0306=function(_0x8036e9,_0xb2a199){_0x8036e9=_0x8036e9-0x0;var _0x34a8eb=_0x3060[_0x8036e9];return _0x34a8eb;};'use strict';var _=require('lodash');var util=require(_0x0306('0x0'));var logger=require(_0x0306('0x1'))(_0x0306('0x2'));var moment=require('moment');var BPromise=require(_0x0306('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0306('0x4'));var rimraf=require(_0x0306('0x5'));var config=require('../../config/environment');var attributes=require('./cmCustomField.attributes');module[_0x0306('0x6')]=function(_0x4e2dd5,_0x337217){return _0x4e2dd5[_0x0306('0x7')](_0x0306('0x8'),attributes,{'tableName':_0x0306('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 29e5ee3..715d1a8 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 _0xd820=['then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x4117af,_0x147e60){var _0x71c88=function(_0x513e29){while(--_0x513e29){_0x4117af['push'](_0x4117af['shift']());}};_0x71c88(++_0x147e60);}(_0xd820,0x18b));var _0x0d82=function(_0x240625,_0x5521aa){_0x240625=_0x240625-0x0;var _0x5d3a5d=_0xd820[_0x240625];return _0x5d3a5d;};'use strict';var _=require(_0x0d82('0x0'));var util=require('util');var moment=require(_0x0d82('0x1'));var BPromise=require(_0x0d82('0x2'));var rs=require(_0x0d82('0x3'));var fs=require('fs');var Redis=require(_0x0d82('0x4'));var db=require(_0x0d82('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d82('0x6'))(_0x0d82('0x7'));var config=require(_0x0d82('0x8'));var jayson=require(_0x0d82('0x9'));var client=jayson[_0x0d82('0xa')][_0x0d82('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5da97f,_0x14054a,_0x2a13f1){return new BPromise(function(_0x40b6fa,_0x30e5b0){return client[_0x0d82('0xc')](_0x5da97f,_0x2a13f1)[_0x0d82('0xd')](function(_0x372778){logger[_0x0d82('0xe')](_0x0d82('0xf'),_0x14054a,_0x0d82('0x10'));logger['debug'](_0x0d82('0x11'),_0x14054a,_0x0d82('0x10'),JSON[_0x0d82('0x12')](_0x372778));if(_0x372778['error']){if(_0x372778[_0x0d82('0x13')][_0x0d82('0x14')]===0x1f4){logger['error'](_0x0d82('0xf'),_0x14054a,_0x372778[_0x0d82('0x13')]['message']);return _0x30e5b0(_0x372778[_0x0d82('0x13')]['message']);}logger[_0x0d82('0x13')]('CmCustomField,\x20%s,\x20%s',_0x14054a,_0x372778[_0x0d82('0x13')][_0x0d82('0x15')]);return _0x40b6fa(_0x372778['error'][_0x0d82('0x15')]);}else{logger['info'](_0x0d82('0xf'),_0x14054a,_0x0d82('0x10'));_0x40b6fa(_0x372778[_0x0d82('0x16')][_0x0d82('0x15')]);}})[_0x0d82('0x17')](function(_0x9273de){logger[_0x0d82('0x13')](_0x0d82('0xf'),_0x14054a,_0x9273de);_0x30e5b0(_0x9273de);});});} \ No newline at end of file +var _0x1ee1=['http','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2bb86b,_0x32d63){var _0x3c8c9a=function(_0x551de8){while(--_0x551de8){_0x2bb86b['push'](_0x2bb86b['shift']());}};_0x3c8c9a(++_0x32d63);}(_0x1ee1,0xa6));var _0x11ee=function(_0x341e0f,_0xadbb66){_0x341e0f=_0x341e0f-0x0;var _0x5962c1=_0x1ee1[_0x341e0f];return _0x5962c1;};'use strict';var _=require('lodash');var util=require(_0x11ee('0x0'));var moment=require('moment');var BPromise=require(_0x11ee('0x1'));var rs=require(_0x11ee('0x2'));var fs=require('fs');var Redis=require(_0x11ee('0x3'));var db=require(_0x11ee('0x4'))['db'];var utils=require(_0x11ee('0x5'));var logger=require(_0x11ee('0x6'))(_0x11ee('0x7'));var config=require(_0x11ee('0x8'));var jayson=require(_0x11ee('0x9'));var client=jayson['client'][_0x11ee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58c513,_0x53d6ed,_0x5b1222){return new BPromise(function(_0xd307a5,_0x5844ac){return client[_0x11ee('0xb')](_0x58c513,_0x5b1222)[_0x11ee('0xc')](function(_0x28ba02){logger[_0x11ee('0xd')](_0x11ee('0xe'),_0x53d6ed,_0x11ee('0xf'));logger[_0x11ee('0x10')]('CmCustomField,\x20%s,\x20%s,\x20%s',_0x53d6ed,'request\x20sent',JSON[_0x11ee('0x11')](_0x28ba02));if(_0x28ba02['error']){if(_0x28ba02[_0x11ee('0x12')][_0x11ee('0x13')]===0x1f4){logger[_0x11ee('0x12')](_0x11ee('0xe'),_0x53d6ed,_0x28ba02[_0x11ee('0x12')][_0x11ee('0x14')]);return _0x5844ac(_0x28ba02['error'][_0x11ee('0x14')]);}logger[_0x11ee('0x12')](_0x11ee('0xe'),_0x53d6ed,_0x28ba02[_0x11ee('0x12')]['message']);return _0xd307a5(_0x28ba02[_0x11ee('0x12')]['message']);}else{logger[_0x11ee('0xd')]('CmCustomField,\x20%s,\x20%s',_0x53d6ed,_0x11ee('0xf'));_0xd307a5(_0x28ba02[_0x11ee('0x15')][_0x11ee('0x14')]);}})['catch'](function(_0x169faa){logger['error'](_0x11ee('0xe'),_0x53d6ed,_0x169faa);_0x5844ac(_0x169faa);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 5715d4e..0a60f49 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 _0xecb2=['show','post','put','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','/:id','isAuthenticated'];(function(_0x36b098,_0x2003d5){var _0x333d3c=function(_0x336df3){while(--_0x336df3){_0x36b098['push'](_0x36b098['shift']());}};_0x333d3c(++_0x2003d5);}(_0xecb2,0xf6));var _0x2ecb=function(_0x5d5f5e,_0x3d8f31){_0x5d5f5e=_0x5d5f5e-0x0;var _0x5dd032=_0xecb2[_0x5d5f5e];return _0x5dd032;};'use strict';var multer=require(_0x2ecb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2ecb('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x2ecb('0x2'));var auth=require(_0x2ecb('0x3'));var interaction=require(_0x2ecb('0x4'));var config=require(_0x2ecb('0x5'));var controller=require(_0x2ecb('0x6'));router[_0x2ecb('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2ecb('0x8'),auth[_0x2ecb('0x9')](),controller[_0x2ecb('0xa')]);router[_0x2ecb('0xb')]('/',auth[_0x2ecb('0x9')](),controller['create']);router[_0x2ecb('0xc')](_0x2ecb('0x8'),auth[_0x2ecb('0x9')](),controller['update']);router[_0x2ecb('0xd')](_0x2ecb('0x8'),auth[_0x2ecb('0x9')](),controller[_0x2ecb('0xe')]);module[_0x2ecb('0xf')]=router; \ No newline at end of file +var _0x7163=['../../components/interaction/service','../../config/environment','./cmCustomField.controller','index','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service'];(function(_0x36de10,_0xfe25e8){var _0x58100f=function(_0x1fee3f){while(--_0x1fee3f){_0x36de10['push'](_0x36de10['shift']());}};_0x58100f(++_0xfe25e8);}(_0x7163,0x1ef));var _0x3716=function(_0x54defc,_0x627178){_0x54defc=_0x54defc-0x0;var _0x1955d3=_0x7163[_0x54defc];return _0x1955d3;};'use strict';var multer=require(_0x3716('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3716('0x1'));var express=require(_0x3716('0x2'));var router=express[_0x3716('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3716('0x4'));var interaction=require(_0x3716('0x5'));var config=require(_0x3716('0x6'));var controller=require(_0x3716('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3716('0x8')]);router[_0x3716('0x9')](_0x3716('0xa'),auth[_0x3716('0xb')](),controller[_0x3716('0xc')]);router[_0x3716('0xd')]('/',auth[_0x3716('0xb')](),controller[_0x3716('0xe')]);router[_0x3716('0xf')](_0x3716('0xa'),auth[_0x3716('0xb')](),controller[_0x3716('0x10')]);router[_0x3716('0x11')](_0x3716('0xa'),auth[_0x3716('0xb')](),controller[_0x3716('0x12')]);module[_0x3716('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 86ff9df..ddb997e 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 _0x4f26=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','DATE','UNSIGNED','contactListQueue','moment','sequelize','STRING','BOOLEAN'];(function(_0xd9954b,_0x228faa){var _0x4f5c1b=function(_0x1b2ed1){while(--_0x1b2ed1){_0xd9954b['push'](_0xd9954b['shift']());}};_0x4f5c1b(++_0x228faa);}(_0x4f26,0x125));var _0x64f2=function(_0x546b2c,_0x30f8fa){_0x546b2c=_0x546b2c-0x0;var _0x4ae298=_0x4f26[_0x546b2c];return _0x4ae298;};'use strict';var moment=require(_0x64f2('0x0'));var Sequelize=require(_0x64f2('0x1'));module['exports']={'phone':{'type':Sequelize[_0x64f2('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x64f2('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()['format'](_0x64f2('0x4'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x64f2('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x64f2('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x64f2('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x64f2('0x6')]},'priority':{'type':Sequelize[_0x64f2('0x5')](0x2)[_0x64f2('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x64f2('0x5')],'unique':_0x64f2('0x8')},'UserId':{'type':Sequelize[_0x64f2('0x5')]},'VoiceQueueId':{'type':Sequelize[_0x64f2('0x5')],'unique':_0x64f2('0x8')},'CampaignId':{'type':Sequelize[_0x64f2('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x64f2('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x64f2('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x64f2('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x64f2('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x64f2('0x2')]},'recallmeNotifiedDate':{'type':Sequelize[_0x64f2('0x6')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file +var _0xa296=['sequelize','exports','DATE','format','INTEGER','BOOLEAN','UNSIGNED','contactListQueue','STRING','moment'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0xa296,0xc7));var _0x6a29=function(_0x3c60fc,_0x593ef5){_0x3c60fc=_0x3c60fc-0x0;var _0x495fd2=_0xa296[_0x3c60fc];return _0x495fd2;};'use strict';var moment=require(_0x6a29('0x0'));var Sequelize=require(_0x6a29('0x1'));module[_0x6a29('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x6a29('0x3')],'defaultValue':moment()[_0x6a29('0x4')]('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0x6a29('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x6a29('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x6a29('0x5')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x6a29('0x6')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x6a29('0x3')]},'priority':{'type':Sequelize[_0x6a29('0x5')](0x2)[_0x6a29('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x6a29('0x5')],'unique':_0x6a29('0x8')},'ListId':{'type':Sequelize[_0x6a29('0x5')],'unique':_0x6a29('0x8')},'UserId':{'type':Sequelize[_0x6a29('0x5')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x6a29('0x8')},'CampaignId':{'type':Sequelize[_0x6a29('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x6a29('0x5')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x6a29('0x5')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x6a29('0x5')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x6a29('0x5')],'defaultValue':0x0},'OrderBy':{'type':Sequelize[_0x6a29('0x5')],'allowNull':!![],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x6a29('0x9')]},'recallmeNotifiedDate':{'type':Sequelize[_0x6a29('0x3')],'allowNull':!![],'defaultValue':null}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index cfdcccc..177997a 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 _0xe0c3=['$contained','$any','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','ivr','CmContact','ContactId','lastName','isNil','firstName','calleridname','finally','CmHopperFinal','CmHopperAdditionalPhone','end','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','transaction','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20ASC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','recallme','UPDATE','Contact','Company','CmList','List','Queue','dialActive','getPreviewRecall','LOCK','CmCompany','getOpenContacts','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','getTimezones','timezones','utcOffset','getTimezone','moment','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','update','then','sendStatus','error','stack','name','CmHopper','rawAttributes','type','map','query','keys','intersection','filters','concat','$or','$gt','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$notLike','$like','$overlap'];(function(_0x35dd73,_0xd88195){var _0x54c68e=function(_0x388e51){while(--_0x388e51){_0x35dd73['push'](_0x35dd73['shift']());}};_0x54c68e(++_0xd88195);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0x3e0c('0x0'));var _=require('lodash');var qs=require(_0x3e0c('0x1'));var logger=require(_0x3e0c('0x2'))(_0x3e0c('0x3'));var shared=require(_0x3e0c('0x4'));var db=require(_0x3e0c('0x5'))['db'];function respondWithResult(_0x410ec4,_0x31851c){_0x31851c=_0x31851c||0xc8;return function(_0x26c964){if(_0x26c964){return _0x410ec4[_0x3e0c('0x6')](_0x31851c)['json'](_0x26c964);}};}function respondWithFilteredResult(_0x530ebf,_0x163adf){return function(_0x1e339a){if(_0x1e339a){var _0x3f6607=typeof _0x163adf[_0x3e0c('0x7')]===_0x3e0c('0x8')&&typeof _0x163adf[_0x3e0c('0x9')]===_0x3e0c('0x8');var _0x448907=_0x1e339a[_0x3e0c('0xa')];var _0x35d56f=_0x3f6607?0x0:_0x163adf[_0x3e0c('0x7')];var _0x4f7e71=_0x3f6607?_0x1e339a['count']:_0x163adf[_0x3e0c('0x7')]+_0x163adf[_0x3e0c('0x9')];var _0x13ce3e;if(_0x4f7e71>=_0x448907){_0x4f7e71=_0x448907;_0x13ce3e=0xc8;}else{_0x13ce3e=0xce;}_0x530ebf[_0x3e0c('0x6')](_0x13ce3e);return _0x530ebf[_0x3e0c('0xb')](_0x3e0c('0xc'),_0x35d56f+'-'+_0x4f7e71+'/'+_0x448907)[_0x3e0c('0xd')](_0x1e339a);}return null;};}function saveUpdates(_0x5dc732,_0x38b416){return function(_0x491432){if(_0x491432){return _0x491432[_0x3e0c('0xe')](_0x5dc732)[_0x3e0c('0xf')](function(_0x5d0ab7){return _0x5d0ab7;});}return null;};}function handleEntityNotFound(_0x5f2654,_0x6d9c61){return function(_0x409b2c){if(!_0x409b2c){_0x5f2654[_0x3e0c('0x10')](0x194);}return _0x409b2c;};}function handleError(_0xea4ed,_0x15a269){_0x15a269=_0x15a269||0x1f4;return function(_0x24fcf9){logger[_0x3e0c('0x11')](_0x24fcf9[_0x3e0c('0x12')]);if(_0x24fcf9[_0x3e0c('0x13')]){delete _0x24fcf9[_0x3e0c('0x13')];}_0xea4ed[_0x3e0c('0x6')](_0x15a269)['send'](_0x24fcf9);};}exports['index']=function(_0x20db28,_0x216993){var _0x1b2e17={},_0x41b19f={},_0x108d4a={'count':0x0,'rows':[]};var _0x8825b7=_['map'](db[_0x3e0c('0x14')][_0x3e0c('0x15')],function(_0x95ce16){return{'name':_0x95ce16['fieldName'],'type':_0x95ce16[_0x3e0c('0x16')]['key']};});_0x41b19f['model']=_[_0x3e0c('0x17')](_0x8825b7,_0x3e0c('0x13'));_0x41b19f[_0x3e0c('0x18')]=_[_0x3e0c('0x19')](_0x20db28['query']);_0x41b19f['filters']=_[_0x3e0c('0x1a')](_0x41b19f['model'],_0x41b19f['query']);_0x41b19f[_0x3e0c('0x1b')]=_[_0x3e0c('0x1c')](_0x41b19f[_0x3e0c('0x1b')],['$and',_0x3e0c('0x1d'),_0x3e0c('0x1e'),'$gte',_0x3e0c('0x1f'),_0x3e0c('0x20'),_0x3e0c('0x21'),_0x3e0c('0x22'),'$not',_0x3e0c('0x23'),_0x3e0c('0x24'),_0x3e0c('0x25'),_0x3e0c('0x26'),'$like',_0x3e0c('0x27'),'$iLike','$notILike',_0x3e0c('0x28'),_0x3e0c('0x29'),'$contains',_0x3e0c('0x2a'),_0x3e0c('0x2b')]);_0x1b2e17[_0x3e0c('0x2c')]=_['intersection'](_0x41b19f[_0x3e0c('0x2d')],qs[_0x3e0c('0x2e')](_0x20db28['query'][_0x3e0c('0x2e')]));_0x1b2e17[_0x3e0c('0x2c')]=_0x1b2e17[_0x3e0c('0x2c')][_0x3e0c('0x2f')]?_0x1b2e17['attributes']:_0x41b19f[_0x3e0c('0x2d')];if(!_0x20db28[_0x3e0c('0x18')][_0x3e0c('0x30')]('nolimit')){_0x1b2e17[_0x3e0c('0x9')]=qs[_0x3e0c('0x9')](_0x20db28[_0x3e0c('0x18')]['limit']);_0x1b2e17[_0x3e0c('0x7')]=qs[_0x3e0c('0x7')](_0x20db28[_0x3e0c('0x18')][_0x3e0c('0x7')]);}_0x1b2e17[_0x3e0c('0x31')]=qs[_0x3e0c('0x32')](_0x20db28[_0x3e0c('0x18')][_0x3e0c('0x32')]);_0x1b2e17[_0x3e0c('0x33')]=qs[_0x3e0c('0x1b')](_[_0x3e0c('0x34')](_0x20db28[_0x3e0c('0x18')],_0x41b19f[_0x3e0c('0x1b')]),_0x8825b7);if(_0x20db28[_0x3e0c('0x18')]['filter']){_0x1b2e17[_0x3e0c('0x33')]=_[_0x3e0c('0x35')](_0x1b2e17[_0x3e0c('0x33')],{'$or':_[_0x3e0c('0x17')](_0x8825b7,function(_0xd89af9){if(_0xd89af9[_0x3e0c('0x16')]!==_0x3e0c('0x36')){var _0x2ef238={};_0x2ef238[_0xd89af9['name']]={'$like':'%'+_0x20db28['query'][_0x3e0c('0x37')]+'%'};return _0x2ef238;}})});}_0x1b2e17=_[_0x3e0c('0x35')]({},_0x1b2e17,_0x20db28[_0x3e0c('0x38')]);var _0x319cd4={'where':_0x1b2e17[_0x3e0c('0x33')]};return db[_0x3e0c('0x14')]['count'](_0x319cd4)[_0x3e0c('0xf')](function(_0x168784){_0x108d4a['count']=_0x168784;if(_0x20db28['query']['includeAll']){_0x1b2e17[_0x3e0c('0x39')]=[{'all':!![]}];}return db[_0x3e0c('0x14')][_0x3e0c('0x3a')](_0x1b2e17);})[_0x3e0c('0xf')](function(_0x320bf1){_0x108d4a[_0x3e0c('0x3b')]=_0x320bf1;return _0x108d4a;})[_0x3e0c('0xf')](respondWithFilteredResult(_0x216993,_0x1b2e17))[_0x3e0c('0x3c')](handleError(_0x216993,null));};exports[_0x3e0c('0x3d')]=function(_0xb38f09,_0x427207){var _0x20135d={'raw':!![],'where':{'id':_0xb38f09['params']['id']}},_0x4f0e6c={};_0x4f0e6c['model']=_[_0x3e0c('0x19')](db[_0x3e0c('0x14')]['rawAttributes']);_0x4f0e6c['query']=_[_0x3e0c('0x19')](_0xb38f09[_0x3e0c('0x18')]);_0x4f0e6c[_0x3e0c('0x1b')]=_[_0x3e0c('0x1a')](_0x4f0e6c['model'],_0x4f0e6c[_0x3e0c('0x18')]);_0x20135d[_0x3e0c('0x2c')]=_[_0x3e0c('0x1a')](_0x4f0e6c[_0x3e0c('0x2d')],qs[_0x3e0c('0x2e')](_0xb38f09['query'][_0x3e0c('0x2e')]));_0x20135d['attributes']=_0x20135d[_0x3e0c('0x2c')][_0x3e0c('0x2f')]?_0x20135d['attributes']:_0x4f0e6c['model'];if(_0xb38f09[_0x3e0c('0x18')][_0x3e0c('0x3e')]){_0x20135d['include']=[{'all':!![]}];}_0x20135d=_[_0x3e0c('0x35')]({},_0x20135d,_0xb38f09[_0x3e0c('0x38')]);return db[_0x3e0c('0x14')][_0x3e0c('0x3f')](_0x20135d)[_0x3e0c('0xf')](handleEntityNotFound(_0x427207,null))[_0x3e0c('0xf')](respondWithResult(_0x427207,null))['catch'](handleError(_0x427207,null));};exports[_0x3e0c('0x40')]=function(_0x20a85f,_0xec802a){return db[_0x3e0c('0x14')][_0x3e0c('0x40')](_0x20a85f[_0x3e0c('0x41')],{})['then'](respondWithResult(_0xec802a,0xc9))[_0x3e0c('0x3c')](handleError(_0xec802a,null));};exports[_0x3e0c('0xe')]=function(_0x323246,_0x563251){if(_0x323246[_0x3e0c('0x41')]['id']){delete _0x323246[_0x3e0c('0x41')]['id'];}return db['CmHopper'][_0x3e0c('0x3f')]({'where':{'id':_0x323246[_0x3e0c('0x42')]['id']}})[_0x3e0c('0xf')](handleEntityNotFound(_0x563251,null))['then'](saveUpdates(_0x323246[_0x3e0c('0x41')],null))[_0x3e0c('0xf')](respondWithResult(_0x563251,null))[_0x3e0c('0x3c')](handleError(_0x563251,null));};exports[_0x3e0c('0x43')]=function(_0x109078,_0x2e0a90){return db[_0x3e0c('0x14')][_0x3e0c('0x43')]()[_0x3e0c('0xf')](respondWithResult(_0x2e0a90,null))[_0x3e0c('0x3c')](handleError(_0x2e0a90,null));};exports[_0x3e0c('0x44')]=function(_0x4efbf2,_0x20c9df){var _0x58dac7;var _0x4b2062=_0x4efbf2[_0x3e0c('0x42')]['id'];return db['CmHopper'][_0x3e0c('0x3f')]({'where':{'id':_0x4efbf2[_0x3e0c('0x42')]['id']}})['then'](handleEntityNotFound(_0x20c9df,null))[_0x3e0c('0xf')](function(_0x14b718){if(_0x14b718){return _0x14b718['destroy']()[_0x3e0c('0xf')](function(_0x3e04c9){return _0x3e04c9;});}})[_0x3e0c('0xf')](function(_0x20b0bc){_0x58dac7=_0x20b0bc;if(_0x20b0bc){if(_0x20b0bc[_0x3e0c('0x45')]||_0x20b0bc[_0x3e0c('0x46')]){return db[_0x20b0bc[_0x3e0c('0x45')]?_0x3e0c('0x47'):_0x3e0c('0x48')][_0x3e0c('0x3f')]({'where':{'id':_0x20b0bc['VoiceQueueId']?_0x20b0bc[_0x3e0c('0x45')]:_0x20b0bc[_0x3e0c('0x46')]},'attributes':['id',_0x3e0c('0x13')],'raw':!![]});}}})[_0x3e0c('0xf')](function(_0x1a2cf2){var _0x14299c={};if(_0x1a2cf2){_[_0x3e0c('0x35')](_0x14299c,_[_0x3e0c('0x49')](_0x58dac7[_0x3e0c('0x4a')],[_0x3e0c('0x4b'),_0x3e0c('0x4c'),'id']));_0x14299c[_0x3e0c('0x4d')]=0x15;_0x14299c[_0x3e0c('0x4e')]=_0x3e0c('0x4f');_0x14299c['campaign']=_0x1a2cf2[_0x3e0c('0x13')];_0x14299c[_0x3e0c('0x50')]=_0x4efbf2[_0x3e0c('0x51')]['name'];_0x14299c[_0x3e0c('0x52')]=_0x4efbf2[_0x3e0c('0x51')]['id'];_0x14299c[_0x3e0c('0x4f')]=!![];_0x14299c[_0x3e0c('0x53')]=moment()[_0x3e0c('0x54')](_0x3e0c('0x55'));_0x14299c[_0x3e0c('0x56')]=_0x58dac7[_0x3e0c('0x57')];_0x14299c[_0x3e0c('0x58')]=_0x58dac7[_0x3e0c('0x45')]?'queue':_0x3e0c('0x59');return db[_0x3e0c('0x5a')]['find']({'where':{'id':_0x14299c[_0x3e0c('0x5b')]},'attributes':['firstName',_0x3e0c('0x5c')]})[_0x3e0c('0xf')](function(_0x28b2d5){if(!_[_0x3e0c('0x5d')](_0x20c9df)&&!_[_0x3e0c('0x5d')](_0x28b2d5[_0x3e0c('0x5e')])){_0x14299c[_0x3e0c('0x5f')]=_0x28b2d5[_0x3e0c('0x5e')];if(!_[_0x3e0c('0x5d')](_0x28b2d5[_0x3e0c('0x5c')])){_0x14299c[_0x3e0c('0x5f')]+='\x20'+_0x28b2d5[_0x3e0c('0x5c')];}}})[_0x3e0c('0x60')](function(){return db[_0x3e0c('0x61')][_0x3e0c('0x40')](_0x14299c);});}})[_0x3e0c('0xf')](function(_0x117e2f){return db[_0x3e0c('0x62')][_0x3e0c('0x44')]({'where':{'CmHopperId':_0x4b2062}});})[_0x3e0c('0xf')](function(){return _0x20c9df[_0x3e0c('0x6')](0xcc)[_0x3e0c('0x63')]();})[_0x3e0c('0x3c')](handleError(_0x20c9df,null));};exports[_0x3e0c('0x64')]=function(_0x2f6666,_0xcc965b){var _0x58aa5d=[];return db[_0x3e0c('0x5a')][_0x3e0c('0x43')]()[_0x3e0c('0xf')](function(_0x874b04){_0x58aa5d=_['keys'](_0x874b04);return _0x2f6666[_0x3e0c('0x51')][_0x3e0c('0x65')]({'where':{'type':_0x3e0c('0x66'),'dialActive':!![],'dialMethod':_0x3e0c('0x67')},'attributes':['id',_0x3e0c('0x68'),_0x3e0c('0x69')],'raw':!![]});})['then'](function(_0x3e1c8a){if(_0x3e1c8a&&_0x3e1c8a[_0x3e0c('0x2f')]){return db['sequelize'][_0x3e0c('0x6a')](function(_0x368b04){var _0x2b0eae={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3e0c('0x54')](_0x3e0c('0x55'))},'VoiceQueueId':{'$in':_['map'](_0x3e1c8a,'id')},'$or':[{'UserId':null},{'UserId':_0x2f6666['user']['id']}]};var _0x1b57dd={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x3e1c8a)[_0x3e0c('0x37')](['dialPreviewAutoRecallMe',0x0])['map']('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x2f6666[_0x3e0c('0x51')]['id']}]};var _0x274fcc={'$or':[_0x2b0eae,_0x1b57dd]};var _0x10e951=[];if(_0x2f6666[_0x3e0c('0x41')][_0x3e0c('0x6b')]&&_0x2f6666[_0x3e0c('0x41')][_0x3e0c('0x6b')]===_0x3e0c('0x6c')){if(!_[_0x3e0c('0x6d')](_0x2f6666[_0x3e0c('0x41')][_0x3e0c('0x6e')])){_0x274fcc['id']={'$in':_0x2f6666[_0x3e0c('0x41')][_0x3e0c('0x6e')]};}_0x10e951=[[_0x3e0c('0x6f'),_0x3e0c('0x70')],[_0x3e0c('0x71'),_0x3e1c8a[0x0][_0x3e0c('0x68')]==='ASC'?_0x3e0c('0x72'):_0x3e0c('0x70')],db[_0x3e0c('0x73')]['literal'](_0x3e0c('0x74')),['id',_0x3e0c('0x72')]];}else{if(!_[_0x3e0c('0x6d')](_0x2f6666[_0x3e0c('0x41')][_0x3e0c('0x6e')])){_0x274fcc['id']={'$notIn':_0x2f6666[_0x3e0c('0x41')][_0x3e0c('0x6e')]};}_0x10e951=[[_0x3e0c('0x6f'),'DESC'],[_0x3e0c('0x71'),_0x3e1c8a[0x0][_0x3e0c('0x68')]],db[_0x3e0c('0x73')]['literal'](_0x3e0c('0x75')),['id',_0x3e0c('0x70')]];}return db['CmHopper'][_0x3e0c('0x76')]({'attributes':['id',_0x3e0c('0x77'),'phone',_0x3e0c('0x78')],'where':_0x274fcc,'order':_0x10e951,'transaction':_0x368b04,'lock':_0x368b04['LOCK'][_0x3e0c('0x79')],'include':[{'model':db[_0x3e0c('0x5a')],'as':_0x3e0c('0x7a'),'attributes':_0x58aa5d,'include':[{'model':db['CmCompany'],'as':_0x3e0c('0x7b'),'attributes':['id',_0x3e0c('0x13')]}]},{'model':db[_0x3e0c('0x7c')],'as':_0x3e0c('0x7d'),'attributes':['id','name']},{'model':db[_0x3e0c('0x47')],'as':_0x3e0c('0x7e'),'attributes':['id','name',_0x3e0c('0x7f')]}]})[_0x3e0c('0xf')](function(_0x13cca3){if(_0x13cca3){return _0x13cca3[_0x3e0c('0xe')]({'UserId':_0x2f6666['user']['id']},{'transaction':_0x368b04});}});});}})[_0x3e0c('0xf')](handleEntityNotFound(_0xcc965b,null))['then'](respondWithResult(_0xcc965b,null))[_0x3e0c('0x3c')](handleError(_0xcc965b,null));};exports[_0x3e0c('0x80')]=function(_0x32f787,_0x7a867b,_0xe2533b){var _0x1474f5=[];var _0x345108=_0x32f787[_0x3e0c('0x42')]['id'];var _0x518f39=_0x32f787['user']['id'];return db[_0x3e0c('0x5a')]['describe']()[_0x3e0c('0xf')](function(_0x573576){_0x1474f5=_[_0x3e0c('0x19')](_0x573576);return db['sequelize'][_0x3e0c('0x6a')](function(_0x2ad053){const _0x383387={'id':_0x345108};return db['CmHopper'][_0x3e0c('0x76')]({'attributes':['id',_0x3e0c('0x77'),_0x3e0c('0x78')],'where':_0x383387,'transaction':_0x2ad053,'lock':_0x2ad053[_0x3e0c('0x81')][_0x3e0c('0x79')],'include':[{'model':db[_0x3e0c('0x5a')],'as':_0x3e0c('0x7a'),'attributes':_0x1474f5,'include':[{'model':db[_0x3e0c('0x82')],'as':_0x3e0c('0x7b'),'attributes':['id','name']}]},{'model':db[_0x3e0c('0x7c')],'as':_0x3e0c('0x7d'),'attributes':['id',_0x3e0c('0x13')]},{'model':db[_0x3e0c('0x47')],'as':'Queue','attributes':['id',_0x3e0c('0x13'),_0x3e0c('0x7f')]}]})[_0x3e0c('0xf')](function(_0x234fae){if(_0x234fae){return _0x234fae['update']({'UserId':_0x518f39},{'transaction':_0x2ad053});}});});})[_0x3e0c('0xf')](handleEntityNotFound(_0x7a867b,null))[_0x3e0c('0xf')](respondWithResult(_0x7a867b,null))[_0x3e0c('0x3c')](handleError(_0x7a867b,null));};exports[_0x3e0c('0x83')]=function(_0x15fc4b,_0xed0325){return _0x15fc4b[_0x3e0c('0x51')][_0x3e0c('0x65')]({'where':{'type':_0x3e0c('0x66'),'dialActive':!![],'dialMethod':_0x3e0c('0x67')},'attributes':['id'],'raw':!![]})[_0x3e0c('0xf')](function(_0x2eec6a){if(_0x2eec6a&&_0x2eec6a[_0x3e0c('0x2f')]){return db[_0x3e0c('0x14')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x3e0c('0x54')](_0x3e0c('0x55'))},'VoiceQueueId':{'$in':_[_0x3e0c('0x17')](_0x2eec6a,'id')},'$or':[{'UserId':null},{'UserId':_0x15fc4b[_0x3e0c('0x51')]['id']}]}});}return 0x0;})[_0x3e0c('0xf')](function(_0x11b2d0){if(!_['isNil'](_0x11b2d0)&&_['isNumber'](_0x11b2d0)){return _0xed0325[_0x3e0c('0x6')](0xc8)['json']({'contacts':_0x11b2d0});}else{logger[_0x3e0c('0x11')](_0x3e0c('0x84'),_0x3e0c('0x83'),0x194,_0x3e0c('0x85'));_0xed0325[_0x3e0c('0x10')](0x194);}})[_0x3e0c('0x3c')](handleError(_0xed0325,null));};exports[_0x3e0c('0x86')]=function(_0x4cd2d0,_0x3283d0){var _0x1efb21=shared[_0x3e0c('0x87')];var _0x20dc9c=[];_[_0x3e0c('0x17')](_0x1efb21,function(_0x373b81){_0x20dc9c['push']({'id':_0x373b81[_0x3e0c('0x13')],'name':_0x373b81[_0x3e0c('0x13')],'utcOffset':_0x373b81[_0x3e0c('0x88')]});});return _0x3283d0[_0x3e0c('0x6')](0xc8)['json']({'tz':_0x20dc9c});};exports[_0x3e0c('0x89')]=function(_0x489b45,_0x5f56e9){var _0x181bd8=shared[_0x3e0c('0x87')];var _0xd83a3c={};if(!_[_0x3e0c('0x5d')](_0x181bd8[_0x489b45['body']['id']]))_0xd83a3c=_0x181bd8[_0x489b45['body']['id']];return _0x5f56e9[_0x3e0c('0x6')](0xc8)[_0x3e0c('0xd')](_0xd83a3c);}; \ No newline at end of file +var _0xe198=['key','model','query','keys','filters','intersection','concat','$or','$gt','$gte','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$any','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','findAll','catch','show','length','includeAll','include','find','create','body','update','describe','destroy','params','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','format','calleridnum','campaigntype','queue','ivr','CmContact','ContactId','firstName','isNil','lastName','calleridname','finally','CmHopperAdditionalPhone','end','preview','dialOrderByScheduledAt','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','prev','isEmpty','hopperIds','priority','DESC','ASC','literal','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','phone','recallme','LOCK','UPDATE','Contact','CmCompany','Company','List','Queue','getPreviewRecall','CmList','dialActive','getOpenContacts','getVoiceQueues','outbound','CmHopper,\x20%s,\x20%s,\x20%s','getTimezones','push','utcOffset','getTimezone','moment','lodash','api','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','then','sendStatus','error','name','send','index','map','CmHopper','rawAttributes','fieldName','type'];(function(_0x460fd7,_0x2012db){var _0x44d1c2=function(_0x545e11){while(--_0x545e11){_0x460fd7['push'](_0x460fd7['shift']());}};_0x44d1c2(++_0x2012db);}(_0xe198,0x6f));var _0x8e19=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xe198[_0x1d9aa0];return _0x226868;};'use strict';var moment=require(_0x8e19('0x0'));var _=require(_0x8e19('0x1'));var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0x8e19('0x2'));var shared=require(_0x8e19('0x3'));var db=require(_0x8e19('0x4'))['db'];function respondWithResult(_0x529200,_0x32f52f){_0x32f52f=_0x32f52f||0xc8;return function(_0x4e3f58){if(_0x4e3f58){return _0x529200[_0x8e19('0x5')](_0x32f52f)[_0x8e19('0x6')](_0x4e3f58);}};}function respondWithFilteredResult(_0x2fb138,_0x188ce0){return function(_0x1175d6){if(_0x1175d6){var _0x4db35e=typeof _0x188ce0[_0x8e19('0x7')]===_0x8e19('0x8')&&typeof _0x188ce0[_0x8e19('0x9')]===_0x8e19('0x8');var _0x3fbe35=_0x1175d6[_0x8e19('0xa')];var _0x375054=_0x4db35e?0x0:_0x188ce0['offset'];var _0x146989=_0x4db35e?_0x1175d6[_0x8e19('0xa')]:_0x188ce0[_0x8e19('0x7')]+_0x188ce0[_0x8e19('0x9')];var _0x358d90;if(_0x146989>=_0x3fbe35){_0x146989=_0x3fbe35;_0x358d90=0xc8;}else{_0x358d90=0xce;}_0x2fb138[_0x8e19('0x5')](_0x358d90);return _0x2fb138[_0x8e19('0xb')](_0x8e19('0xc'),_0x375054+'-'+_0x146989+'/'+_0x3fbe35)['json'](_0x1175d6);}return null;};}function saveUpdates(_0x51a0c4,_0x3f4a6d){return function(_0x4b1b8d){if(_0x4b1b8d){return _0x4b1b8d['update'](_0x51a0c4)[_0x8e19('0xd')](function(_0x2c2d05){return _0x2c2d05;});}return null;};}function handleEntityNotFound(_0x16b584,_0x76ccdb){return function(_0x4a75e0){if(!_0x4a75e0){_0x16b584[_0x8e19('0xe')](0x194);}return _0x4a75e0;};}function handleError(_0x32f3ef,_0x5c474d){_0x5c474d=_0x5c474d||0x1f4;return function(_0x34a7c9){logger[_0x8e19('0xf')](_0x34a7c9['stack']);if(_0x34a7c9[_0x8e19('0x10')]){delete _0x34a7c9[_0x8e19('0x10')];}_0x32f3ef[_0x8e19('0x5')](_0x5c474d)[_0x8e19('0x11')](_0x34a7c9);};}exports[_0x8e19('0x12')]=function(_0x2e61e9,_0x27be43){var _0x1dde49={},_0x28d288={},_0x1c64f9={'count':0x0,'rows':[]};var _0x18a9d0=_[_0x8e19('0x13')](db[_0x8e19('0x14')][_0x8e19('0x15')],function(_0x4aa341){return{'name':_0x4aa341[_0x8e19('0x16')],'type':_0x4aa341[_0x8e19('0x17')][_0x8e19('0x18')]};});_0x28d288[_0x8e19('0x19')]=_[_0x8e19('0x13')](_0x18a9d0,_0x8e19('0x10'));_0x28d288[_0x8e19('0x1a')]=_[_0x8e19('0x1b')](_0x2e61e9[_0x8e19('0x1a')]);_0x28d288[_0x8e19('0x1c')]=_[_0x8e19('0x1d')](_0x28d288[_0x8e19('0x19')],_0x28d288[_0x8e19('0x1a')]);_0x28d288['filters']=_[_0x8e19('0x1e')](_0x28d288['filters'],['$and',_0x8e19('0x1f'),_0x8e19('0x20'),_0x8e19('0x21'),'$lt',_0x8e19('0x22'),_0x8e19('0x23'),_0x8e19('0x24'),_0x8e19('0x25'),_0x8e19('0x26'),_0x8e19('0x27'),'$in',_0x8e19('0x28'),_0x8e19('0x29'),_0x8e19('0x2a'),_0x8e19('0x2b'),_0x8e19('0x2c'),_0x8e19('0x29'),_0x8e19('0x2d'),'$contains','$contained',_0x8e19('0x2e')]);_0x1dde49[_0x8e19('0x2f')]=_[_0x8e19('0x1d')](_0x28d288[_0x8e19('0x19')],qs[_0x8e19('0x30')](_0x2e61e9[_0x8e19('0x1a')]['fields']));_0x1dde49['attributes']=_0x1dde49[_0x8e19('0x2f')]['length']?_0x1dde49[_0x8e19('0x2f')]:_0x28d288[_0x8e19('0x19')];if(!_0x2e61e9[_0x8e19('0x1a')][_0x8e19('0x31')]('nolimit')){_0x1dde49[_0x8e19('0x9')]=qs[_0x8e19('0x9')](_0x2e61e9['query']['limit']);_0x1dde49[_0x8e19('0x7')]=qs[_0x8e19('0x7')](_0x2e61e9[_0x8e19('0x1a')][_0x8e19('0x7')]);}_0x1dde49[_0x8e19('0x32')]=qs[_0x8e19('0x33')](_0x2e61e9[_0x8e19('0x1a')][_0x8e19('0x33')]);_0x1dde49['where']=qs[_0x8e19('0x1c')](_[_0x8e19('0x34')](_0x2e61e9['query'],_0x28d288[_0x8e19('0x1c')]),_0x18a9d0);if(_0x2e61e9[_0x8e19('0x1a')][_0x8e19('0x35')]){_0x1dde49[_0x8e19('0x36')]=_[_0x8e19('0x37')](_0x1dde49[_0x8e19('0x36')],{'$or':_[_0x8e19('0x13')](_0x18a9d0,function(_0x547368){if(_0x547368[_0x8e19('0x17')]!==_0x8e19('0x38')){var _0x398b9d={};_0x398b9d[_0x547368[_0x8e19('0x10')]]={'$like':'%'+_0x2e61e9[_0x8e19('0x1a')][_0x8e19('0x35')]+'%'};return _0x398b9d;}})});}_0x1dde49=_[_0x8e19('0x37')]({},_0x1dde49,_0x2e61e9[_0x8e19('0x39')]);var _0x15e4e6={'where':_0x1dde49[_0x8e19('0x36')]};return db[_0x8e19('0x14')][_0x8e19('0xa')](_0x15e4e6)['then'](function(_0x841669){_0x1c64f9['count']=_0x841669;if(_0x2e61e9['query']['includeAll']){_0x1dde49['include']=[{'all':!![]}];}return db[_0x8e19('0x14')][_0x8e19('0x3a')](_0x1dde49);})[_0x8e19('0xd')](function(_0xc15b5){_0x1c64f9['rows']=_0xc15b5;return _0x1c64f9;})[_0x8e19('0xd')](respondWithFilteredResult(_0x27be43,_0x1dde49))[_0x8e19('0x3b')](handleError(_0x27be43,null));};exports[_0x8e19('0x3c')]=function(_0x39aee0,_0x40bab6){var _0x1aa40b={'raw':!![],'where':{'id':_0x39aee0['params']['id']}},_0x5b71bb={};_0x5b71bb[_0x8e19('0x19')]=_[_0x8e19('0x1b')](db[_0x8e19('0x14')][_0x8e19('0x15')]);_0x5b71bb['query']=_[_0x8e19('0x1b')](_0x39aee0[_0x8e19('0x1a')]);_0x5b71bb['filters']=_[_0x8e19('0x1d')](_0x5b71bb[_0x8e19('0x19')],_0x5b71bb[_0x8e19('0x1a')]);_0x1aa40b['attributes']=_['intersection'](_0x5b71bb[_0x8e19('0x19')],qs[_0x8e19('0x30')](_0x39aee0[_0x8e19('0x1a')]['fields']));_0x1aa40b[_0x8e19('0x2f')]=_0x1aa40b[_0x8e19('0x2f')][_0x8e19('0x3d')]?_0x1aa40b[_0x8e19('0x2f')]:_0x5b71bb['model'];if(_0x39aee0[_0x8e19('0x1a')][_0x8e19('0x3e')]){_0x1aa40b[_0x8e19('0x3f')]=[{'all':!![]}];}_0x1aa40b=_[_0x8e19('0x37')]({},_0x1aa40b,_0x39aee0['options']);return db[_0x8e19('0x14')][_0x8e19('0x40')](_0x1aa40b)[_0x8e19('0xd')](handleEntityNotFound(_0x40bab6,null))[_0x8e19('0xd')](respondWithResult(_0x40bab6,null))[_0x8e19('0x3b')](handleError(_0x40bab6,null));};exports[_0x8e19('0x41')]=function(_0x1042d7,_0x118b2b){return db[_0x8e19('0x14')]['create'](_0x1042d7[_0x8e19('0x42')],{})['then'](respondWithResult(_0x118b2b,0xc9))[_0x8e19('0x3b')](handleError(_0x118b2b,null));};exports[_0x8e19('0x43')]=function(_0x2324f8,_0x241104){if(_0x2324f8[_0x8e19('0x42')]['id']){delete _0x2324f8[_0x8e19('0x42')]['id'];}return db[_0x8e19('0x14')][_0x8e19('0x40')]({'where':{'id':_0x2324f8['params']['id']}})[_0x8e19('0xd')](handleEntityNotFound(_0x241104,null))[_0x8e19('0xd')](saveUpdates(_0x2324f8[_0x8e19('0x42')],null))[_0x8e19('0xd')](respondWithResult(_0x241104,null))[_0x8e19('0x3b')](handleError(_0x241104,null));};exports[_0x8e19('0x44')]=function(_0x1bb5c8,_0x3edb29){return db[_0x8e19('0x14')]['describe']()[_0x8e19('0xd')](respondWithResult(_0x3edb29,null))[_0x8e19('0x3b')](handleError(_0x3edb29,null));};exports[_0x8e19('0x45')]=function(_0x19831c,_0xe30216){var _0xd9fa7d;var _0x3445cc=_0x19831c['params']['id'];return db['CmHopper']['find']({'where':{'id':_0x19831c[_0x8e19('0x46')]['id']}})[_0x8e19('0xd')](handleEntityNotFound(_0xe30216,null))[_0x8e19('0xd')](function(_0x271502){if(_0x271502){return _0x271502[_0x8e19('0x45')]()['then'](function(_0x2aaf42){return _0x2aaf42;});}})[_0x8e19('0xd')](function(_0x63e5db){_0xd9fa7d=_0x63e5db;if(_0x63e5db){if(_0x63e5db[_0x8e19('0x47')]||_0x63e5db[_0x8e19('0x48')]){return db[_0x63e5db[_0x8e19('0x47')]?_0x8e19('0x49'):_0x8e19('0x4a')]['find']({'where':{'id':_0x63e5db['VoiceQueueId']?_0x63e5db[_0x8e19('0x47')]:_0x63e5db[_0x8e19('0x48')]},'attributes':['id',_0x8e19('0x10')],'raw':!![]});}}})[_0x8e19('0xd')](function(_0x3197d1){var _0x3bdc42={};if(_0x3197d1){_[_0x8e19('0x37')](_0x3bdc42,_[_0x8e19('0x4b')](_0xd9fa7d[_0x8e19('0x4c')],[_0x8e19('0x4d'),_0x8e19('0x4e'),'id']));_0x3bdc42[_0x8e19('0x4f')]=0x15;_0x3bdc42[_0x8e19('0x50')]=_0x8e19('0x51');_0x3bdc42[_0x8e19('0x52')]=_0x3197d1[_0x8e19('0x10')];_0x3bdc42[_0x8e19('0x53')]=_0x19831c[_0x8e19('0x54')]['name'];_0x3bdc42['UserId']=_0x19831c[_0x8e19('0x54')]['id'];_0x3bdc42[_0x8e19('0x51')]=!![];_0x3bdc42['deletedat']=moment()[_0x8e19('0x55')]('YYYY-MM-DD\x20HH:mm:ss');_0x3bdc42[_0x8e19('0x56')]=_0xd9fa7d['phone'];_0x3bdc42[_0x8e19('0x57')]=_0xd9fa7d[_0x8e19('0x47')]?_0x8e19('0x58'):_0x8e19('0x59');return db[_0x8e19('0x5a')][_0x8e19('0x40')]({'where':{'id':_0x3bdc42[_0x8e19('0x5b')]},'attributes':[_0x8e19('0x5c'),'lastName']})[_0x8e19('0xd')](function(_0xdbc7fa){if(!_[_0x8e19('0x5d')](_0xe30216)&&!_[_0x8e19('0x5d')](_0xdbc7fa[_0x8e19('0x5c')])){_0x3bdc42['calleridname']=_0xdbc7fa[_0x8e19('0x5c')];if(!_['isNil'](_0xdbc7fa[_0x8e19('0x5e')])){_0x3bdc42[_0x8e19('0x5f')]+='\x20'+_0xdbc7fa[_0x8e19('0x5e')];}}})[_0x8e19('0x60')](function(){return db['CmHopperFinal']['create'](_0x3bdc42);});}})[_0x8e19('0xd')](function(_0x568302){return db[_0x8e19('0x61')][_0x8e19('0x45')]({'where':{'CmHopperId':_0x3445cc}});})[_0x8e19('0xd')](function(){return _0xe30216[_0x8e19('0x5')](0xcc)[_0x8e19('0x62')]();})[_0x8e19('0x3b')](handleError(_0xe30216,null));};exports['getPreview']=function(_0x4e63e4,_0x2cab3b){var _0xca2cab=[];return db[_0x8e19('0x5a')][_0x8e19('0x44')]()[_0x8e19('0xd')](function(_0x238783){_0xca2cab=_['keys'](_0x238783);return _0x4e63e4['user']['getVoiceQueues']({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x8e19('0x63')},'attributes':['id',_0x8e19('0x64'),'dialPreviewAutoRecallMe'],'raw':!![]});})[_0x8e19('0xd')](function(_0x17f614){if(_0x17f614&&_0x17f614['length']){return db[_0x8e19('0x65')][_0x8e19('0x66')](function(_0x50308e){var _0x550da4={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x8e19('0x55')](_0x8e19('0x67'))},'VoiceQueueId':{'$in':_[_0x8e19('0x13')](_0x17f614,'id')},'$or':[{'UserId':null},{'UserId':_0x4e63e4[_0x8e19('0x54')]['id']}]};var _0x5cb961={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x17f614)[_0x8e19('0x35')](['dialPreviewAutoRecallMe',0x0])[_0x8e19('0x13')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x4e63e4['user']['id']}]};var _0x1e9cd2={'$or':[_0x550da4,_0x5cb961]};var _0x27c021=[];if(_0x4e63e4['body'][_0x8e19('0x68')]&&_0x4e63e4[_0x8e19('0x42')][_0x8e19('0x68')]===_0x8e19('0x69')){if(!_[_0x8e19('0x6a')](_0x4e63e4['body']['hopperIds'])){_0x1e9cd2['id']={'$in':_0x4e63e4[_0x8e19('0x42')][_0x8e19('0x6b')]};}_0x27c021=[[_0x8e19('0x6c'),'ASC'],['scheduledAt',_0x17f614[0x0][_0x8e19('0x64')]==='ASC'?_0x8e19('0x6d'):_0x8e19('0x6e')],db['sequelize'][_0x8e19('0x6f')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id','DESC']];}else{if(!_[_0x8e19('0x6a')](_0x4e63e4[_0x8e19('0x42')]['hopperIds'])){_0x1e9cd2['id']={'$notIn':_0x4e63e4[_0x8e19('0x42')]['hopperIds']};}_0x27c021=[[_0x8e19('0x6c'),_0x8e19('0x6d')],[_0x8e19('0x70'),_0x17f614[0x0][_0x8e19('0x64')]],db[_0x8e19('0x65')][_0x8e19('0x6f')](_0x8e19('0x71')),['id',_0x8e19('0x6e')]];}return db[_0x8e19('0x14')][_0x8e19('0x72')]({'attributes':['id','scheduledat',_0x8e19('0x73'),_0x8e19('0x74')],'where':_0x1e9cd2,'order':_0x27c021,'transaction':_0x50308e,'lock':_0x50308e[_0x8e19('0x75')][_0x8e19('0x76')],'include':[{'model':db[_0x8e19('0x5a')],'as':_0x8e19('0x77'),'attributes':_0xca2cab,'include':[{'model':db[_0x8e19('0x78')],'as':_0x8e19('0x79'),'attributes':['id',_0x8e19('0x10')]}]},{'model':db['CmList'],'as':_0x8e19('0x7a'),'attributes':['id',_0x8e19('0x10')]},{'model':db[_0x8e19('0x49')],'as':_0x8e19('0x7b'),'attributes':['id',_0x8e19('0x10'),'dialActive']}]})[_0x8e19('0xd')](function(_0x1235aa){if(_0x1235aa){return _0x1235aa[_0x8e19('0x43')]({'UserId':_0x4e63e4[_0x8e19('0x54')]['id']},{'transaction':_0x50308e});}});});}})[_0x8e19('0xd')](handleEntityNotFound(_0x2cab3b,null))[_0x8e19('0xd')](respondWithResult(_0x2cab3b,null))['catch'](handleError(_0x2cab3b,null));};exports[_0x8e19('0x7c')]=function(_0x37b474,_0x8fddd2,_0x50c11a){var _0x1b7a5a=[];var _0x39f694=_0x37b474[_0x8e19('0x46')]['id'];var _0x1f0d29=_0x37b474['user']['id'];return db['CmContact'][_0x8e19('0x44')]()[_0x8e19('0xd')](function(_0x573ab9){_0x1b7a5a=_[_0x8e19('0x1b')](_0x573ab9);return db['sequelize'][_0x8e19('0x66')](function(_0x1f4e62){const _0x3e9d2d={'id':_0x39f694};return db[_0x8e19('0x14')][_0x8e19('0x72')]({'attributes':['id','scheduledat',_0x8e19('0x74')],'where':_0x3e9d2d,'transaction':_0x1f4e62,'lock':_0x1f4e62[_0x8e19('0x75')]['UPDATE'],'include':[{'model':db[_0x8e19('0x5a')],'as':'Contact','attributes':_0x1b7a5a,'include':[{'model':db[_0x8e19('0x78')],'as':_0x8e19('0x79'),'attributes':['id','name']}]},{'model':db[_0x8e19('0x7d')],'as':'List','attributes':['id',_0x8e19('0x10')]},{'model':db[_0x8e19('0x49')],'as':_0x8e19('0x7b'),'attributes':['id','name',_0x8e19('0x7e')]}]})[_0x8e19('0xd')](function(_0x228c0c){if(_0x228c0c){return _0x228c0c[_0x8e19('0x43')]({'UserId':_0x1f0d29},{'transaction':_0x1f4e62});}});});})['then'](handleEntityNotFound(_0x8fddd2,null))[_0x8e19('0xd')](respondWithResult(_0x8fddd2,null))[_0x8e19('0x3b')](handleError(_0x8fddd2,null));};exports[_0x8e19('0x7f')]=function(_0x4af320,_0x3e0480){return _0x4af320[_0x8e19('0x54')][_0x8e19('0x80')]({'where':{'type':_0x8e19('0x81'),'dialActive':!![],'dialMethod':_0x8e19('0x63')},'attributes':['id'],'raw':!![]})['then'](function(_0x3af920){if(_0x3af920&&_0x3af920[_0x8e19('0x3d')]){return db[_0x8e19('0x14')][_0x8e19('0xa')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x8e19('0x67'))},'VoiceQueueId':{'$in':_[_0x8e19('0x13')](_0x3af920,'id')},'$or':[{'UserId':null},{'UserId':_0x4af320[_0x8e19('0x54')]['id']}]}});}return 0x0;})[_0x8e19('0xd')](function(_0x4030c0){if(!_[_0x8e19('0x5d')](_0x4030c0)&&_['isNumber'](_0x4030c0)){return _0x3e0480[_0x8e19('0x5')](0xc8)['json']({'contacts':_0x4030c0});}else{logger[_0x8e19('0xf')](_0x8e19('0x82'),_0x8e19('0x7f'),0x194,'entity\x20not\x20found');_0x3e0480[_0x8e19('0xe')](0x194);}})[_0x8e19('0x3b')](handleError(_0x3e0480,null));};exports[_0x8e19('0x83')]=function(_0x45d292,_0x5a0465){var _0x140022=shared['timezones'];var _0x2f4637=[];_[_0x8e19('0x13')](_0x140022,function(_0x5fafca){_0x2f4637[_0x8e19('0x84')]({'id':_0x5fafca[_0x8e19('0x10')],'name':_0x5fafca['name'],'utcOffset':_0x5fafca[_0x8e19('0x85')]});});return _0x5a0465[_0x8e19('0x5')](0xc8)[_0x8e19('0x6')]({'tz':_0x2f4637});};exports[_0x8e19('0x86')]=function(_0x572868,_0x330096){var _0x3ad259=shared['timezones'];var _0x284368={};if(!_['isNil'](_0x3ad259[_0x572868[_0x8e19('0x42')]['id']]))_0x284368=_0x3ad259[_0x572868[_0x8e19('0x42')]['id']];return _0x330096['status'](0xc8)['json'](_0x284368);}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 64e387d..e410749 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 _0x038b=['util','../../config/logger','api','bluebird','path','rimraf','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','phone'];(function(_0x46becb,_0x7dd620){var _0x30bfe5=function(_0x36c3c1){while(--_0x36c3c1){_0x46becb['push'](_0x46becb['shift']());}};_0x30bfe5(++_0x7dd620);}(_0x038b,0x114));var _0xb038=function(_0x3cf314,_0x332fc3){_0x3cf314=_0x3cf314-0x0;var _0x34276f=_0x038b[_0x3cf314];return _0x34276f;};'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':'scheduledat','fields':['scheduledat']},{'name':_0xb038('0xb'),'fields':[_0xb038('0xb')]},{'name':'priority','fields':['priority']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd117=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xd117,0x182));var _0x7d11=function(_0xac0de1,_0x12d3d9){_0xac0de1=_0xac0de1-0x0;var _0x1c1995=_0xd117[_0xac0de1];return _0x1c1995;};'use strict';var _=require(_0x7d11('0x0'));var util=require(_0x7d11('0x1'));var logger=require(_0x7d11('0x2'))(_0x7d11('0x3'));var moment=require(_0x7d11('0x4'));var BPromise=require(_0x7d11('0x5'));var rp=require(_0x7d11('0x6'));var fs=require('fs');var path=require(_0x7d11('0x7'));var rimraf=require(_0x7d11('0x8'));var config=require(_0x7d11('0x9'));var attributes=require(_0x7d11('0xa'));module[_0x7d11('0xb')]=function(_0x27d7e8,_0x40c3c4){return _0x27d7e8[_0x7d11('0xc')](_0x7d11('0xd'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x7d11('0xe'),'fields':[_0x7d11('0xe')]},{'name':_0x7d11('0xf'),'fields':['phone']},{'name':_0x7d11('0x10'),'fields':[_0x7d11('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 6e9f95b..adb216e 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 _0xc28b=['model','then','info','GetCmHopper','debug','stringify','catch','error','message','ShowCmHopper','CmHopper','find','CreateCmHopper','create','UpdateCmHopper','update','body','active','DestroyCmHopper','destroy','CmContact','sequelize','LOCK','UPDATE','keys','User','Agent','voicePause','length','UserId','push','includes','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','GetContactDialer','MoveContactManagedDialer','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','transaction','order','GetContactRecallMe','GetCmHopperPreview','describe','Contact','GetContactByPhone','findOne','phone','dialTimezone','DESC','getContactByPhone','ResetActiveCalls','voiceQueueIds','interval','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','name','List','CmHopperHandlePreviewRecallNotifications','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','findAll','options','raw','where','attributes','limit','include','map'];(function(_0x1997d2,_0x3ee494){var _0x1e3df7=function(_0x35ce26){while(--_0x35ce26){_0x1997d2['push'](_0x1997d2['shift']());}};_0x1e3df7(++_0x3ee494);}(_0xc28b,0x93));var _0xbc28=function(_0x1920f7,_0x13552f){_0x1920f7=_0x1920f7-0x0;var _0x5d2cb0=_0xc28b[_0x1920f7];return _0x5d2cb0;};'use strict';var _=require(_0xbc28('0x0'));var util=require(_0xbc28('0x1'));var moment=require(_0xbc28('0x2'));var BPromise=require(_0xbc28('0x3'));var db=require(_0xbc28('0x4'))['db'];var logger=require(_0xbc28('0x5'))(_0xbc28('0x6'));exports['GetCmHopper']=function(_0xb01412){var _0x1836ac=this;return new Promise(function(_0x16e184,_0x164901){return db['CmHopper'][_0xbc28('0x7')]({'raw':_0xb01412[_0xbc28('0x8')]?_0xb01412[_0xbc28('0x8')][_0xbc28('0x9')]===undefined?!![]:![]:!![],'where':_0xb01412[_0xbc28('0x8')]?_0xb01412[_0xbc28('0x8')][_0xbc28('0xa')]||null:null,'attributes':_0xb01412[_0xbc28('0x8')]?_0xb01412[_0xbc28('0x8')][_0xbc28('0xb')]||null:null,'limit':_0xb01412['options']?_0xb01412['options'][_0xbc28('0xc')]||null:null,'include':_0xb01412[_0xbc28('0x8')]?_0xb01412['options'][_0xbc28('0xd')]?_['map'](_0xb01412[_0xbc28('0x8')][_0xbc28('0xd')],function(_0x17b74d){return{'model':db[_0x17b74d['model']],'as':_0x17b74d['as'],'attributes':_0x17b74d[_0xbc28('0xb')],'include':_0x17b74d[_0xbc28('0xd')]?_[_0xbc28('0xe')](_0x17b74d[_0xbc28('0xd')],function(_0x2fcd4c){return{'model':db[_0x2fcd4c['model']],'as':_0x2fcd4c['as'],'attributes':_0x2fcd4c['attributes'],'include':_0x2fcd4c[_0xbc28('0xd')]?_[_0xbc28('0xe')](_0x2fcd4c[_0xbc28('0xd')],function(_0x32d5d9){return{'model':db[_0x32d5d9[_0xbc28('0xf')]],'as':_0x32d5d9['as'],'attributes':_0x32d5d9[_0xbc28('0xb')]};}):[]};}):[]};}):[]:[]})[_0xbc28('0x10')](function(_0xdbfa37){logger[_0xbc28('0x11')](_0xbc28('0x12'),_0xb01412);logger[_0xbc28('0x13')](_0xbc28('0x12'),_0xb01412,JSON[_0xbc28('0x14')](_0xdbfa37));_0x16e184(_0xdbfa37);})[_0xbc28('0x15')](function(_0xf22079){logger[_0xbc28('0x16')](_0xbc28('0x12'),_0xf22079[_0xbc28('0x17')],_0xb01412);_0x164901(_0x1836ac['error'](0x1f4,_0xf22079[_0xbc28('0x17')]));});});};exports[_0xbc28('0x18')]=function(_0x5e9125){var _0x336edf=this;return new Promise(function(_0x349e51,_0x38cc20){return db[_0xbc28('0x19')][_0xbc28('0x1a')]({'raw':_0x5e9125[_0xbc28('0x8')]?_0x5e9125['options'][_0xbc28('0x9')]===undefined?!![]:![]:!![],'where':_0x5e9125[_0xbc28('0x8')]?_0x5e9125[_0xbc28('0x8')][_0xbc28('0xa')]||null:null,'attributes':_0x5e9125[_0xbc28('0x8')]?_0x5e9125[_0xbc28('0x8')][_0xbc28('0xb')]||null:null,'include':_0x5e9125['options']?_0x5e9125['options']['include']?_[_0xbc28('0xe')](_0x5e9125[_0xbc28('0x8')]['include'],function(_0x57dde2){return{'model':db[_0x57dde2[_0xbc28('0xf')]],'as':_0x57dde2['as'],'attributes':_0x57dde2['attributes'],'include':_0x57dde2[_0xbc28('0xd')]?_[_0xbc28('0xe')](_0x57dde2[_0xbc28('0xd')],function(_0x5a1e7b){return{'model':db[_0x5a1e7b[_0xbc28('0xf')]],'as':_0x5a1e7b['as'],'attributes':_0x5a1e7b[_0xbc28('0xb')],'include':_0x5a1e7b[_0xbc28('0xd')]?_[_0xbc28('0xe')](_0x5a1e7b[_0xbc28('0xd')],function(_0x432892){return{'model':db[_0x432892[_0xbc28('0xf')]],'as':_0x432892['as'],'attributes':_0x432892[_0xbc28('0xb')]};}):[]};}):[]};}):[]:[]})[_0xbc28('0x10')](function(_0x129f12){logger[_0xbc28('0x11')](_0xbc28('0x18'),_0x5e9125);logger[_0xbc28('0x13')]('ShowCmHopper',_0x5e9125,JSON[_0xbc28('0x14')](_0x129f12));_0x349e51(_0x129f12);})[_0xbc28('0x15')](function(_0x4b9e90){logger['error'](_0xbc28('0x18'),_0x4b9e90['message'],_0x5e9125);_0x38cc20(_0x336edf[_0xbc28('0x16')](0x1f4,_0x4b9e90['message']));});});};exports[_0xbc28('0x1b')]=function(_0x145702){var _0x1c57b9=this;return new Promise(function(_0x5887af,_0x5dfd35){return db[_0xbc28('0x19')][_0xbc28('0x1c')](_0x145702['body'],{'raw':_0x145702[_0xbc28('0x8')]?_0x145702['options'][_0xbc28('0x9')]===undefined?!![]:![]:!![]})[_0xbc28('0x10')](function(_0x322376){logger['info'](_0xbc28('0x1b'),_0x145702);logger['debug']('CreateCmHopper',_0x145702,JSON[_0xbc28('0x14')](_0x322376));_0x5887af(_0x322376);})[_0xbc28('0x15')](function(_0x262267){logger[_0xbc28('0x16')](_0xbc28('0x1b'),_0x262267['message'],_0x145702);_0x5dfd35(_0x1c57b9[_0xbc28('0x16')](0x1f4,_0x262267[_0xbc28('0x17')]));});});};exports[_0xbc28('0x1d')]=function(_0x211cd2){var _0x391e41=this;return new Promise(function(_0x2fc05e,_0x3bad10){return db['CmHopper'][_0xbc28('0x1e')](_0x211cd2[_0xbc28('0x1f')],{'raw':_0x211cd2[_0xbc28('0x8')]?_0x211cd2[_0xbc28('0x8')][_0xbc28('0x9')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x211cd2[_0xbc28('0x8')]?_0x211cd2[_0xbc28('0x8')]['where']||null:null,'attributes':_0x211cd2[_0xbc28('0x8')]?_0x211cd2[_0xbc28('0x8')]['attributes']||null:null,'limit':_0x211cd2[_0xbc28('0x8')]?_0x211cd2['options'][_0xbc28('0xc')]||null:null})[_0xbc28('0x10')](function(_0x2f8ae3){logger['info'](_0xbc28('0x1d'),_0x211cd2);logger['info']('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xbc28('0x14')](_0x211cd2[_0xbc28('0x8')]['where']),_0x211cd2[_0xbc28('0x1f')][_0xbc28('0x20')]);logger[_0xbc28('0x13')](_0xbc28('0x1d'),_0x211cd2,JSON['stringify'](_0x2f8ae3));_0x2fc05e(_0x2f8ae3);})[_0xbc28('0x15')](function(_0x2f1693){logger[_0xbc28('0x16')](_0xbc28('0x1d'),_0x2f1693[_0xbc28('0x17')],_0x211cd2);_0x3bad10(_0x391e41[_0xbc28('0x16')](0x1f4,_0x2f1693['message']));});});};exports[_0xbc28('0x21')]=function(_0x825539){var _0x1958f8=this;return new Promise(function(_0x456361,_0x79581a){return db[_0xbc28('0x19')][_0xbc28('0x22')]({'where':_0x825539[_0xbc28('0x8')]?_0x825539[_0xbc28('0x8')][_0xbc28('0xa')]||null:null})[_0xbc28('0x10')](function(_0x132fe2){logger['info'](_0xbc28('0x21'),_0x825539);logger[_0xbc28('0x13')](_0xbc28('0x21'),_0x825539,JSON[_0xbc28('0x14')](_0x132fe2));_0x456361(_0x132fe2);})['catch'](function(_0x5c50f9){logger[_0xbc28('0x16')](_0xbc28('0x21'),_0x5c50f9[_0xbc28('0x17')],_0x825539);_0x79581a(_0x1958f8['error'](0x1f4,_0x5c50f9[_0xbc28('0x17')]));});});};exports['GetContactDialer']=function(_0x5033b9){var _0x5bea82=this;return new Promise(function(_0x5bedb3,_0x4dc3df){return db[_0xbc28('0x23')]['describe']()[_0xbc28('0x10')](function(_0x5455a3){return db[_0xbc28('0x24')]['transaction'](function(_0x2204d3){return db['CmHopper']['findAll']({'where':_0x5033b9[_0xbc28('0x8')]?_0x5033b9[_0xbc28('0x8')][_0xbc28('0xa')]||null:null,'attributes':_0x5033b9[_0xbc28('0x8')]?_0x5033b9[_0xbc28('0x8')][_0xbc28('0xb')]||null:null,'limit':_0x5033b9[_0xbc28('0x8')]?_0x5033b9[_0xbc28('0x8')][_0xbc28('0xc')]||null:null,'order':_0x5033b9[_0xbc28('0x8')]?_0x5033b9[_0xbc28('0x8')]['order']||null:null,'transaction':_0x2204d3,'lock':_0x2204d3[_0xbc28('0x25')][_0xbc28('0x26')],'include':[{'model':db[_0xbc28('0x23')],'as':'Contact','attributes':_[_0xbc28('0x27')](_0x5455a3)},{'model':db[_0xbc28('0x28')],'as':_0xbc28('0x29'),'attributes':['id','name',_0xbc28('0x2a')]}]})[_0xbc28('0x10')](function(_0x575004){var _0x537d34=[];var _0x3e8931=[];for(var _0x54dcb7=0x0;_0x54dcb7<_0x575004[_0xbc28('0x2b')];_0x54dcb7+=0x1){var _0x1d840b=_0x575004[_0x54dcb7][_0xbc28('0x2c')];if(_0x1d840b===null){_0x537d34[_0xbc28('0x2d')](_0x575004[_0x54dcb7][_0xbc28('0x1e')](_0x5033b9['body'],{'transaction':_0x2204d3}));}else if(!_0x3e8931[_0xbc28('0x2e')](_0x1d840b)){_0x3e8931[_0xbc28('0x2d')](_0x1d840b);_0x537d34[_0xbc28('0x2d')](_0x575004[_0x54dcb7][_0xbc28('0x1e')](_0x5033b9[_0xbc28('0x1f')],{'transaction':_0x2204d3}));}}return BPromise['all'](_0x537d34);});})[_0xbc28('0x10')](function(_0x224dc8){logger[_0xbc28('0x11')]('GetContactDialer',_0x5033b9);if(_0x224dc8['length']>0x0){logger['info'](_0xbc28('0x2f'),_0x224dc8[0x0][_0xbc28('0x30')]['id'],_0x224dc8[0x0][_0xbc28('0x30')][_0xbc28('0x31')],_0x224dc8[0x0][_0xbc28('0x30')][_0xbc28('0x20')]);}logger[_0xbc28('0x13')](_0xbc28('0x32'),_0x5033b9,JSON[_0xbc28('0x14')](_0x224dc8));_0x5bedb3(_0x224dc8);})[_0xbc28('0x15')](function(_0x10a1ae){logger[_0xbc28('0x16')](_0xbc28('0x32'),_0x10a1ae['message'],_0x5033b9);_0x4dc3df(_0x5bea82[_0xbc28('0x16')](0x1f4,_0x10a1ae[_0xbc28('0x17')]));});});});};exports[_0xbc28('0x33')]=function(_0x538f43){var _0x41dcf8=this;return new Promise(function(_0x279c18,_0x4955a1){return db['sequelize']['transaction'](function(_0xb322a3){return db['CmHopperFinal']['create'](_0x538f43[_0xbc28('0x1f')],{'raw':_0x538f43['options']?_0x538f43[_0xbc28('0x8')]['raw']===undefined?!![]:![]:!![],'transaction':_0xb322a3})[_0xbc28('0x10')](function(){logger[_0xbc28('0x11')](_0xbc28('0x34'),JSON['stringify'](_0x538f43[_0xbc28('0x8')][_0xbc28('0xa')]),_0x538f43[_0xbc28('0x8')][_0xbc28('0xa')]['active']);return db['CmHopper']['destroy']({'where':_0x538f43[_0xbc28('0x8')]?_0x538f43['options'][_0xbc28('0xa')]||null:null,'transaction':_0xb322a3});});})['then'](function(_0x52ceef){logger[_0xbc28('0x11')](_0xbc28('0x33'),_0x538f43);logger[_0xbc28('0x13')](_0xbc28('0x33'),_0x538f43,JSON['stringify'](_0x52ceef));_0x279c18(_0x52ceef);})[_0xbc28('0x15')](function(_0x5e4429){logger['error'](_0xbc28('0x33'),_0x5e4429['message'],_0x538f43);_0x4955a1(_0x41dcf8['error'](0x1f4,_0x5e4429[_0xbc28('0x17')]));});});};exports[_0xbc28('0x35')]=function(_0x10a30e){var _0x1a274b=this;return new Promise(function(_0x8b99b0,_0x29d250){return db[_0xbc28('0x19')]['findAll']({'raw':_0x10a30e['options']?_0x10a30e['options'][_0xbc28('0x9')]===undefined?!![]:![]:!![],'where':_0x10a30e['options']?_0x10a30e[_0xbc28('0x8')][_0xbc28('0xa')]||null:null,'attributes':[[db['sequelize']['fn'](_0xbc28('0x36'),db['sequelize']['fn']('IF',db[_0xbc28('0x24')]['literal'](_0xbc28('0x37')+util[_0xbc28('0x38')](_0xbc28('0x39'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'))+_0xbc28('0x3a')))),_0xbc28('0x3b')]]})['then'](function(_0x51abb1){logger[_0xbc28('0x11')](_0xbc28('0x35'),_0x10a30e);logger[_0xbc28('0x13')]('CountReScheduled',_0x10a30e,JSON[_0xbc28('0x14')](_0x51abb1));_0x8b99b0(_0x51abb1);})[_0xbc28('0x15')](function(_0x203293){logger[_0xbc28('0x16')](_0xbc28('0x35'),_0x203293[_0xbc28('0x17')],_0x10a30e);_0x29d250(_0x1a274b[_0xbc28('0x16')](0x1f4,_0x203293[_0xbc28('0x17')]));});});};exports['GetContactRecallMe']=function(_0x16ee06){var _0x5168e3=this;return new Promise(function(_0x19051e,_0x7e03e1){return db[_0xbc28('0x23')]['describe']()[_0xbc28('0x10')](function(){return db['sequelize'][_0xbc28('0x3c')](function(_0x14685a){return db[_0xbc28('0x19')]['findAll']({'where':_0x16ee06['options']?_0x16ee06[_0xbc28('0x8')][_0xbc28('0xa')]||null:null,'attributes':_0x16ee06[_0xbc28('0x8')]?_0x16ee06[_0xbc28('0x8')][_0xbc28('0xb')]||null:null,'limit':0x1,'order':_0x16ee06[_0xbc28('0x8')]?_0x16ee06[_0xbc28('0x8')][_0xbc28('0x3d')]||null:null,'group':db[_0xbc28('0x19')][_0xbc28('0x2c')],'transaction':_0x14685a,'lock':_0x14685a[_0xbc28('0x25')][_0xbc28('0x26')],'include':_0x16ee06[_0xbc28('0x8')]?_0x16ee06[_0xbc28('0x8')][_0xbc28('0xd')]?_[_0xbc28('0xe')](_0x16ee06[_0xbc28('0x8')][_0xbc28('0xd')],function(_0x84188d){return{'model':db[_0x84188d['model']],'as':_0x84188d['as'],'attributes':_0x84188d['attributes'],'include':_0x84188d['include']?_[_0xbc28('0xe')](_0x84188d[_0xbc28('0xd')],function(_0xbb582c){return{'model':db[_0xbb582c['model']],'as':_0xbb582c['as'],'attributes':_0xbb582c[_0xbc28('0xb')],'include':_0xbb582c[_0xbc28('0xd')]?_[_0xbc28('0xe')](_0xbb582c['include'],function(_0x331610){return{'model':db[_0x331610['model']],'as':_0x331610['as'],'attributes':_0x331610[_0xbc28('0xb')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2644a3){var _0x5013c6=[];for(var _0x667652=0x0;_0x667652<_0x2644a3[_0xbc28('0x2b')];_0x667652+=0x1){_0x5013c6[_0xbc28('0x2d')](_0x2644a3[_0x667652][_0xbc28('0x1e')](_0x16ee06[_0xbc28('0x1f')],{'transaction':_0x14685a}));}return BPromise['all'](_0x5013c6);});})[_0xbc28('0x10')](function(_0x4d4bb0){logger['info']('GetContactRecallMe',_0x16ee06);logger[_0xbc28('0x13')](_0xbc28('0x3e'),_0x16ee06,JSON[_0xbc28('0x14')](_0x4d4bb0));_0x19051e(_0x4d4bb0);})[_0xbc28('0x15')](function(_0x557d7f){logger['error']('GetContactRecallMe',_0x557d7f[_0xbc28('0x17')],_0x16ee06);_0x7e03e1(_0x5168e3[_0xbc28('0x16')](0x1f4,_0x557d7f[_0xbc28('0x17')]));});});});};exports[_0xbc28('0x3f')]=function(_0x351fc1){var _0x400e54=this;return new Promise(function(_0x4f2c60,_0x1909d0){db['CmContact'][_0xbc28('0x40')]()[_0xbc28('0x10')](function(_0xb84202){return db[_0xbc28('0x19')][_0xbc28('0x7')]({'raw':_0x351fc1['options']?_0x351fc1[_0xbc28('0x8')][_0xbc28('0x9')]===undefined?!![]:![]:!![],'where':_0x351fc1[_0xbc28('0x8')]?_0x351fc1[_0xbc28('0x8')][_0xbc28('0xa')]||null:null,'attributes':_0x351fc1[_0xbc28('0x8')]?_0x351fc1['options']['attributes']||null:null,'limit':_0x351fc1['options']?_0x351fc1[_0xbc28('0x8')][_0xbc28('0xc')]||null:null,'include':_0x351fc1[_0xbc28('0x8')]?_0x351fc1['options'][_0xbc28('0xd')]?_[_0xbc28('0xe')](_0x351fc1['options'][_0xbc28('0xd')],function(_0x1c7a18){return{'model':db[_0x1c7a18['model']],'as':_0x1c7a18['as'],'attributes':_0x1c7a18['as']===_0xbc28('0x41')?_[_0xbc28('0x27')](_0xb84202):_0x1c7a18[_0xbc28('0xb')],'include':_0x1c7a18[_0xbc28('0xd')]?_[_0xbc28('0xe')](_0x1c7a18['include'],function(_0x2ed734){return{'model':db[_0x2ed734[_0xbc28('0xf')]],'as':_0x2ed734['as'],'attributes':_0x2ed734['attributes'],'include':_0x2ed734['include']?_[_0xbc28('0xe')](_0x2ed734[_0xbc28('0xd')],function(_0x58dadd){return{'model':db[_0x58dadd[_0xbc28('0xf')]],'as':_0x58dadd['as'],'attributes':_0x58dadd[_0xbc28('0xb')]};}):[]};}):[]};}):[]:[]})[_0xbc28('0x10')](function(_0x320fcc){logger['info'](_0xbc28('0x12'),_0x351fc1);logger[_0xbc28('0x13')]('GetCmHopper',_0x351fc1,JSON[_0xbc28('0x14')](_0x320fcc));_0x4f2c60(_0x320fcc);})['catch'](function(_0x9a37ad){logger[_0xbc28('0x16')](_0xbc28('0x12'),_0x9a37ad[_0xbc28('0x17')],_0x351fc1);_0x1909d0(_0x400e54[_0xbc28('0x16')](0x1f4,_0x9a37ad[_0xbc28('0x17')]));});});});};exports[_0xbc28('0x42')]=function(_0x4eb239){var _0x4c1cc1=this;return new Promise(function(_0x5017c0,_0x393bb5){return db[_0xbc28('0x23')][_0xbc28('0x43')]({'raw':!![],'where':{'phone':_0x4eb239[_0xbc28('0x8')][_0xbc28('0xa')][_0xbc28('0x44')]},'attributes':['id',_0xbc28('0x45')],'order':[['id',_0xbc28('0x46')]]})['then'](function(_0x1ad0b5){logger['info']('getContactByPhone',_0x4eb239);logger[_0xbc28('0x13')]('getContactByPhone',_0x4eb239,JSON[_0xbc28('0x14')](_0x1ad0b5));_0x5017c0(_0x1ad0b5);})[_0xbc28('0x15')](function(_0x177390){logger['error'](_0xbc28('0x47'),_0x177390[_0xbc28('0x17')],_0x4eb239);_0x393bb5(_0x4c1cc1[_0xbc28('0x16')](0x1f4,_0x177390[_0xbc28('0x17')]));});});};exports[_0xbc28('0x48')]=function(_0x2918f4){var _0x5c6d17=this;return new Promise(function(_0x3c3d83,_0x335bfd){return db[_0xbc28('0x24')][_0xbc28('0x3c')](function(_0x2cf53b){var _0x40c9fc=_0x2918f4[_0xbc28('0x8')]&&_0x2918f4[_0xbc28('0x8')][_0xbc28('0xa')]?_0x2918f4[_0xbc28('0x8')]['where']:{};return db[_0xbc28('0x19')][_0xbc28('0x1e')](_0x2918f4[_0xbc28('0x1f')],{'where':_0x40c9fc,'transaction':_0x2cf53b})[_0xbc28('0x10')](function(_0x23b249){logger[_0xbc28('0x11')](_0xbc28('0x48'),_0x2918f4);logger[_0xbc28('0x13')](_0xbc28('0x48'),_0x2918f4,JSON['stringify'](_0x23b249));_0x3c3d83(_0x23b249);})[_0xbc28('0x15')](function(_0x1aa2c7){logger[_0xbc28('0x16')]('ResetActiveCalls',_0x1aa2c7[_0xbc28('0x17')],_0x2918f4);_0x335bfd(_0x5c6d17[_0xbc28('0x16')](0x1f4,_0x1aa2c7[_0xbc28('0x17')]));});});});};exports['CmHopperHandlePreviewRecallNotifications']=function(_0x35cd18){var _0x20e0c9=this;var _0x4f169f=_0x35cd18[_0xbc28('0x1f')][_0xbc28('0xa')][_0xbc28('0x49')];var _0x2f47e8=_0x35cd18[_0xbc28('0x1f')][_0xbc28('0xa')][_0xbc28('0x4a')];var _0x5b7b60=_0x35cd18[_0xbc28('0x1f')][_0xbc28('0xa')]['availableAgentsIds'];return new Promise(function(_0x5c7327,_0x4c38d1){return db[_0xbc28('0x19')][_0xbc28('0x7')]({'where':{'voiceQueueId':{'$in':_0x4f169f},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db['sequelize'][_0xbc28('0x4b')](_0xbc28('0x4c')+_0x2f47e8+_0xbc28('0x4d')),'$gt':db[_0xbc28('0x24')][_0xbc28('0x4b')]('NOW()')}},'UserId':{'$in':_0x5b7b60}},'include':[{'model':db[_0xbc28('0x23')],'as':_0xbc28('0x41')},{'model':db[_0xbc28('0x28')],'as':_0xbc28('0x29'),'attributes':['id',_0xbc28('0x4e'),_0xbc28('0x2a')]},{'model':db['CmList'],'as':_0xbc28('0x4f')}]})[_0xbc28('0x10')](function(_0x34711f){if(_0x34711f[_0xbc28('0x2b')]>0x0){return db['sequelize']['transaction'](function(_0x19b635){return db['CmHopper'][_0xbc28('0x1e')]({'recallmeNotifiedDate':db[_0xbc28('0x24')][_0xbc28('0x4b')]('NOW()')},{'where':{'id':{'$in':_['map'](_0x34711f,'id')}},'transaction':_0x19b635})[_0xbc28('0x10')](function(){_0x5c7327(_0x34711f);})[_0xbc28('0x15')](function(_0x1c309e){logger[_0xbc28('0x16')](_0xbc28('0x50'),_0x1c309e[_0xbc28('0x17')],_0x35cd18);_0x4c38d1(_0x20e0c9[_0xbc28('0x16')](0x1f4,_0x1c309e[_0xbc28('0x17')]));});})[_0xbc28('0x15')](function(_0xbdfc5d){logger[_0xbc28('0x16')](_0xbc28('0x50'),_0xbdfc5d[_0xbc28('0x17')],_0x35cd18);_0x4c38d1(_0x20e0c9['error'](0x1f4,_0xbdfc5d['message']));});}else{_0x5c7327(_0x34711f);}});});}; \ No newline at end of file +var _0x26c7=['debug','stringify','catch','error','message','find','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','Contact','keys','Agent','name','length','UserId','push','includes','all','dataValues','ContactId','MoveContactManagedDialer','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','`scheduledat`\x20>=\x20','format','\x22%s\x22','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','LOCK','UPDATE','GetContactByPhone','findOne','phone','dialTimezone','getContactByPhone','ResetActiveCalls','CmHopperHandlePreviewRecallNotifications','voiceQueueIds','interval','literal','NOW()\x20+\x20INTERVAL\x20','\x20MINUTE','User','voicePause','CmList','List','NOW()','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','GetCmHopper','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','then','info'];(function(_0x1e475e,_0x3cc2b3){var _0x115606=function(_0x51db95){while(--_0x51db95){_0x1e475e['push'](_0x1e475e['shift']());}};_0x115606(++_0x3cc2b3);}(_0x26c7,0x13c));var _0x726c=function(_0x2233be,_0xd10120){_0x2233be=_0x2233be-0x0;var _0x1a6468=_0x26c7[_0x2233be];return _0x1a6468;};'use strict';var _=require(_0x726c('0x0'));var util=require(_0x726c('0x1'));var moment=require(_0x726c('0x2'));var BPromise=require(_0x726c('0x3'));var db=require(_0x726c('0x4'))['db'];var logger=require(_0x726c('0x5'))(_0x726c('0x6'));exports[_0x726c('0x7')]=function(_0x5bb6de){var _0x45ac8f=this;return new Promise(function(_0x3434f2,_0x1dd9e3){return db[_0x726c('0x8')][_0x726c('0x9')]({'raw':_0x5bb6de[_0x726c('0xa')]?_0x5bb6de[_0x726c('0xa')][_0x726c('0xb')]===undefined?!![]:![]:!![],'where':_0x5bb6de[_0x726c('0xa')]?_0x5bb6de['options'][_0x726c('0xc')]||null:null,'attributes':_0x5bb6de[_0x726c('0xa')]?_0x5bb6de[_0x726c('0xa')][_0x726c('0xd')]||null:null,'limit':_0x5bb6de[_0x726c('0xa')]?_0x5bb6de[_0x726c('0xa')][_0x726c('0xe')]||null:null,'include':_0x5bb6de[_0x726c('0xa')]?_0x5bb6de['options'][_0x726c('0xf')]?_[_0x726c('0x10')](_0x5bb6de[_0x726c('0xa')][_0x726c('0xf')],function(_0x2c6621){return{'model':db[_0x2c6621[_0x726c('0x11')]],'as':_0x2c6621['as'],'attributes':_0x2c6621[_0x726c('0xd')],'include':_0x2c6621[_0x726c('0xf')]?_[_0x726c('0x10')](_0x2c6621[_0x726c('0xf')],function(_0x312b91){return{'model':db[_0x312b91[_0x726c('0x11')]],'as':_0x312b91['as'],'attributes':_0x312b91[_0x726c('0xd')],'include':_0x312b91[_0x726c('0xf')]?_[_0x726c('0x10')](_0x312b91['include'],function(_0x32c5cc){return{'model':db[_0x32c5cc['model']],'as':_0x32c5cc['as'],'attributes':_0x32c5cc[_0x726c('0xd')]};}):[]};}):[]};}):[]:[]})[_0x726c('0x12')](function(_0x5d12c2){logger[_0x726c('0x13')](_0x726c('0x7'),_0x5bb6de);logger[_0x726c('0x14')](_0x726c('0x7'),_0x5bb6de,JSON[_0x726c('0x15')](_0x5d12c2));_0x3434f2(_0x5d12c2);})[_0x726c('0x16')](function(_0x433947){logger[_0x726c('0x17')]('GetCmHopper',_0x433947[_0x726c('0x18')],_0x5bb6de);_0x1dd9e3(_0x45ac8f[_0x726c('0x17')](0x1f4,_0x433947['message']));});});};exports['ShowCmHopper']=function(_0x1a501d){var _0x33042d=this;return new Promise(function(_0xb66be1,_0x54755e){return db[_0x726c('0x8')][_0x726c('0x19')]({'raw':_0x1a501d[_0x726c('0xa')]?_0x1a501d['options']['raw']===undefined?!![]:![]:!![],'where':_0x1a501d[_0x726c('0xa')]?_0x1a501d[_0x726c('0xa')]['where']||null:null,'attributes':_0x1a501d[_0x726c('0xa')]?_0x1a501d[_0x726c('0xa')]['attributes']||null:null,'include':_0x1a501d['options']?_0x1a501d['options'][_0x726c('0xf')]?_['map'](_0x1a501d[_0x726c('0xa')][_0x726c('0xf')],function(_0x5eb24e){return{'model':db[_0x5eb24e[_0x726c('0x11')]],'as':_0x5eb24e['as'],'attributes':_0x5eb24e['attributes'],'include':_0x5eb24e[_0x726c('0xf')]?_['map'](_0x5eb24e[_0x726c('0xf')],function(_0x3a47cf){return{'model':db[_0x3a47cf[_0x726c('0x11')]],'as':_0x3a47cf['as'],'attributes':_0x3a47cf[_0x726c('0xd')],'include':_0x3a47cf[_0x726c('0xf')]?_[_0x726c('0x10')](_0x3a47cf[_0x726c('0xf')],function(_0x1049ad){return{'model':db[_0x1049ad[_0x726c('0x11')]],'as':_0x1049ad['as'],'attributes':_0x1049ad['attributes']};}):[]};}):[]};}):[]:[]})[_0x726c('0x12')](function(_0x1a3228){logger[_0x726c('0x13')]('ShowCmHopper',_0x1a501d);logger[_0x726c('0x14')](_0x726c('0x1a'),_0x1a501d,JSON[_0x726c('0x15')](_0x1a3228));_0xb66be1(_0x1a3228);})[_0x726c('0x16')](function(_0x497141){logger['error']('ShowCmHopper',_0x497141[_0x726c('0x18')],_0x1a501d);_0x54755e(_0x33042d['error'](0x1f4,_0x497141['message']));});});};exports[_0x726c('0x1b')]=function(_0x26b456){var _0x21b211=this;return new Promise(function(_0xbee588,_0x56edab){return db['CmHopper'][_0x726c('0x1c')](_0x26b456[_0x726c('0x1d')],{'raw':_0x26b456['options']?_0x26b456['options'][_0x726c('0xb')]===undefined?!![]:![]:!![]})['then'](function(_0x62cee2){logger[_0x726c('0x13')]('CreateCmHopper',_0x26b456);logger['debug'](_0x726c('0x1b'),_0x26b456,JSON[_0x726c('0x15')](_0x62cee2));_0xbee588(_0x62cee2);})['catch'](function(_0x227c0c){logger['error'](_0x726c('0x1b'),_0x227c0c[_0x726c('0x18')],_0x26b456);_0x56edab(_0x21b211[_0x726c('0x17')](0x1f4,_0x227c0c['message']));});});};exports[_0x726c('0x1e')]=function(_0x2fcec5){var _0x567920=this;return new Promise(function(_0x492598,_0x54e484){return db[_0x726c('0x8')][_0x726c('0x1f')](_0x2fcec5['body'],{'raw':_0x2fcec5[_0x726c('0xa')]?_0x2fcec5[_0x726c('0xa')][_0x726c('0xb')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2fcec5[_0x726c('0xa')]?_0x2fcec5['options'][_0x726c('0xc')]||null:null,'attributes':_0x2fcec5[_0x726c('0xa')]?_0x2fcec5[_0x726c('0xa')][_0x726c('0xd')]||null:null,'limit':_0x2fcec5[_0x726c('0xa')]?_0x2fcec5[_0x726c('0xa')]['limit']||null:null})['then'](function(_0x52ca69){logger['info']('UpdateCmHopper',_0x2fcec5);logger[_0x726c('0x13')](_0x726c('0x20'),JSON[_0x726c('0x15')](_0x2fcec5[_0x726c('0xa')][_0x726c('0xc')]),_0x2fcec5[_0x726c('0x1d')][_0x726c('0x21')]);logger['debug'](_0x726c('0x1e'),_0x2fcec5,JSON['stringify'](_0x52ca69));_0x492598(_0x52ca69);})['catch'](function(_0x5d462c){logger[_0x726c('0x17')](_0x726c('0x1e'),_0x5d462c[_0x726c('0x18')],_0x2fcec5);_0x54e484(_0x567920['error'](0x1f4,_0x5d462c['message']));});});};exports[_0x726c('0x22')]=function(_0x36f995){var _0x2bfe92=this;return new Promise(function(_0x31c2ab,_0x490fc4){return db[_0x726c('0x8')][_0x726c('0x23')]({'where':_0x36f995[_0x726c('0xa')]?_0x36f995[_0x726c('0xa')][_0x726c('0xc')]||null:null})[_0x726c('0x12')](function(_0x42eef4){logger['info'](_0x726c('0x22'),_0x36f995);logger[_0x726c('0x14')](_0x726c('0x22'),_0x36f995,JSON[_0x726c('0x15')](_0x42eef4));_0x31c2ab(_0x42eef4);})['catch'](function(_0x2bc848){logger[_0x726c('0x17')]('DestroyCmHopper',_0x2bc848[_0x726c('0x18')],_0x36f995);_0x490fc4(_0x2bfe92['error'](0x1f4,_0x2bc848['message']));});});};exports[_0x726c('0x24')]=function(_0x54bbb1){var _0x1c625b=this;return new Promise(function(_0x506523,_0x51a154){return db[_0x726c('0x25')][_0x726c('0x26')]()['then'](function(_0x17cbf4){return db[_0x726c('0x27')][_0x726c('0x28')](function(_0x212b53){return db[_0x726c('0x8')][_0x726c('0x9')]({'where':_0x54bbb1[_0x726c('0xa')]?_0x54bbb1['options'][_0x726c('0xc')]||null:null,'attributes':_0x54bbb1[_0x726c('0xa')]?_0x54bbb1[_0x726c('0xa')][_0x726c('0xd')]||null:null,'limit':_0x54bbb1[_0x726c('0xa')]?_0x54bbb1[_0x726c('0xa')][_0x726c('0xe')]||null:null,'order':_0x54bbb1[_0x726c('0xa')]?_0x54bbb1[_0x726c('0xa')][_0x726c('0x29')]||null:null,'transaction':_0x212b53,'lock':_0x212b53['LOCK']['UPDATE'],'include':[{'model':db[_0x726c('0x25')],'as':_0x726c('0x2a'),'attributes':_[_0x726c('0x2b')](_0x17cbf4)},{'model':db['User'],'as':_0x726c('0x2c'),'attributes':['id',_0x726c('0x2d'),'voicePause']}]})[_0x726c('0x12')](function(_0x3ed48b){var _0x30f283=[];var _0x422828=[];for(var _0x4f31c3=0x0;_0x4f31c3<_0x3ed48b[_0x726c('0x2e')];_0x4f31c3+=0x1){var _0x538316=_0x3ed48b[_0x4f31c3][_0x726c('0x2f')];if(_0x538316===null){_0x30f283[_0x726c('0x30')](_0x3ed48b[_0x4f31c3]['update'](_0x54bbb1[_0x726c('0x1d')],{'transaction':_0x212b53}));}else if(!_0x422828[_0x726c('0x31')](_0x538316)){_0x422828[_0x726c('0x30')](_0x538316);_0x30f283[_0x726c('0x30')](_0x3ed48b[_0x4f31c3][_0x726c('0x1f')](_0x54bbb1[_0x726c('0x1d')],{'transaction':_0x212b53}));}}return BPromise[_0x726c('0x32')](_0x30f283);});})[_0x726c('0x12')](function(_0x4bb1db){logger['info']('GetContactDialer',_0x54bbb1);if(_0x4bb1db[_0x726c('0x2e')]>0x0){logger[_0x726c('0x13')]('GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]',_0x4bb1db[0x0]['dataValues']['id'],_0x4bb1db[0x0][_0x726c('0x33')][_0x726c('0x34')],_0x4bb1db[0x0]['dataValues'][_0x726c('0x21')]);}logger[_0x726c('0x14')](_0x726c('0x24'),_0x54bbb1,JSON[_0x726c('0x15')](_0x4bb1db));_0x506523(_0x4bb1db);})[_0x726c('0x16')](function(_0x2d01d6){logger['error']('GetContactDialer',_0x2d01d6['message'],_0x54bbb1);_0x51a154(_0x1c625b[_0x726c('0x17')](0x1f4,_0x2d01d6[_0x726c('0x18')]));});});});};exports[_0x726c('0x35')]=function(_0x597779){var _0x1a769b=this;return new Promise(function(_0x59849c,_0x563382){return db[_0x726c('0x27')]['transaction'](function(_0x4aee60){return db[_0x726c('0x36')][_0x726c('0x1c')](_0x597779['body'],{'raw':_0x597779[_0x726c('0xa')]?_0x597779[_0x726c('0xa')][_0x726c('0xb')]===undefined?!![]:![]:!![],'transaction':_0x4aee60})['then'](function(){logger[_0x726c('0x13')](_0x726c('0x37'),JSON['stringify'](_0x597779[_0x726c('0xa')][_0x726c('0xc')]),_0x597779[_0x726c('0xa')][_0x726c('0xc')][_0x726c('0x21')]);return db[_0x726c('0x8')][_0x726c('0x23')]({'where':_0x597779[_0x726c('0xa')]?_0x597779[_0x726c('0xa')][_0x726c('0xc')]||null:null,'transaction':_0x4aee60});});})[_0x726c('0x12')](function(_0x419a09){logger[_0x726c('0x13')](_0x726c('0x35'),_0x597779);logger['debug'](_0x726c('0x35'),_0x597779,JSON[_0x726c('0x15')](_0x419a09));_0x59849c(_0x419a09);})[_0x726c('0x16')](function(_0x42cf50){logger['error'](_0x726c('0x35'),_0x42cf50[_0x726c('0x18')],_0x597779);_0x563382(_0x1a769b[_0x726c('0x17')](0x1f4,_0x42cf50['message']));});});};exports[_0x726c('0x38')]=function(_0x71a172){var _0x19babf=this;return new Promise(function(_0x15b1a5,_0x3e76c5){return db[_0x726c('0x8')][_0x726c('0x9')]({'raw':_0x71a172['options']?_0x71a172['options'][_0x726c('0xb')]===undefined?!![]:![]:!![],'where':_0x71a172[_0x726c('0xa')]?_0x71a172[_0x726c('0xa')][_0x726c('0xc')]||null:null,'attributes':[[db[_0x726c('0x27')]['fn'](_0x726c('0x39'),db['sequelize']['fn']('IF',db[_0x726c('0x27')]['literal'](_0x726c('0x3a')+util[_0x726c('0x3b')](_0x726c('0x3c'),moment()['format'](_0x726c('0x3d')))+_0x726c('0x3e')))),_0x726c('0x3f')]]})[_0x726c('0x12')](function(_0x1eb8f4){logger['info'](_0x726c('0x38'),_0x71a172);logger[_0x726c('0x14')]('CountReScheduled',_0x71a172,JSON[_0x726c('0x15')](_0x1eb8f4));_0x15b1a5(_0x1eb8f4);})['catch'](function(_0x3643bc){logger[_0x726c('0x17')](_0x726c('0x38'),_0x3643bc[_0x726c('0x18')],_0x71a172);_0x3e76c5(_0x19babf['error'](0x1f4,_0x3643bc['message']));});});};exports[_0x726c('0x40')]=function(_0x175147){var _0x585190=this;return new Promise(function(_0x5c69c8,_0x3dc265){return db[_0x726c('0x25')][_0x726c('0x26')]()[_0x726c('0x12')](function(){return db[_0x726c('0x27')][_0x726c('0x28')](function(_0x20d3b9){return db['CmHopper'][_0x726c('0x9')]({'where':_0x175147[_0x726c('0xa')]?_0x175147['options']['where']||null:null,'attributes':_0x175147[_0x726c('0xa')]?_0x175147[_0x726c('0xa')][_0x726c('0xd')]||null:null,'limit':0x1,'order':_0x175147[_0x726c('0xa')]?_0x175147[_0x726c('0xa')][_0x726c('0x29')]||null:null,'group':db[_0x726c('0x8')]['UserId'],'transaction':_0x20d3b9,'lock':_0x20d3b9[_0x726c('0x41')][_0x726c('0x42')],'include':_0x175147[_0x726c('0xa')]?_0x175147[_0x726c('0xa')][_0x726c('0xf')]?_['map'](_0x175147[_0x726c('0xa')][_0x726c('0xf')],function(_0x51e9e6){return{'model':db[_0x51e9e6[_0x726c('0x11')]],'as':_0x51e9e6['as'],'attributes':_0x51e9e6['attributes'],'include':_0x51e9e6[_0x726c('0xf')]?_[_0x726c('0x10')](_0x51e9e6['include'],function(_0x32d019){return{'model':db[_0x32d019[_0x726c('0x11')]],'as':_0x32d019['as'],'attributes':_0x32d019[_0x726c('0xd')],'include':_0x32d019[_0x726c('0xf')]?_[_0x726c('0x10')](_0x32d019[_0x726c('0xf')],function(_0x1c0691){return{'model':db[_0x1c0691[_0x726c('0x11')]],'as':_0x1c0691['as'],'attributes':_0x1c0691[_0x726c('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x287c9d){var _0x14c97f=[];for(var _0x21821c=0x0;_0x21821c<_0x287c9d[_0x726c('0x2e')];_0x21821c+=0x1){_0x14c97f['push'](_0x287c9d[_0x21821c][_0x726c('0x1f')](_0x175147[_0x726c('0x1d')],{'transaction':_0x20d3b9}));}return BPromise[_0x726c('0x32')](_0x14c97f);});})['then'](function(_0x31a90e){logger[_0x726c('0x13')]('GetContactRecallMe',_0x175147);logger[_0x726c('0x14')](_0x726c('0x40'),_0x175147,JSON[_0x726c('0x15')](_0x31a90e));_0x5c69c8(_0x31a90e);})['catch'](function(_0x207b8d){logger[_0x726c('0x17')](_0x726c('0x40'),_0x207b8d[_0x726c('0x18')],_0x175147);_0x3dc265(_0x585190[_0x726c('0x17')](0x1f4,_0x207b8d[_0x726c('0x18')]));});});});};exports['GetCmHopperPreview']=function(_0x18bbbf){var _0x4c430f=this;return new Promise(function(_0x3cf35f,_0xac7111){db[_0x726c('0x25')][_0x726c('0x26')]()[_0x726c('0x12')](function(_0x5b3d66){return db[_0x726c('0x8')][_0x726c('0x9')]({'raw':_0x18bbbf[_0x726c('0xa')]?_0x18bbbf[_0x726c('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x18bbbf[_0x726c('0xa')]?_0x18bbbf[_0x726c('0xa')][_0x726c('0xc')]||null:null,'attributes':_0x18bbbf[_0x726c('0xa')]?_0x18bbbf['options'][_0x726c('0xd')]||null:null,'limit':_0x18bbbf[_0x726c('0xa')]?_0x18bbbf[_0x726c('0xa')][_0x726c('0xe')]||null:null,'include':_0x18bbbf[_0x726c('0xa')]?_0x18bbbf[_0x726c('0xa')][_0x726c('0xf')]?_[_0x726c('0x10')](_0x18bbbf[_0x726c('0xa')][_0x726c('0xf')],function(_0x3dcf95){return{'model':db[_0x3dcf95[_0x726c('0x11')]],'as':_0x3dcf95['as'],'attributes':_0x3dcf95['as']===_0x726c('0x2a')?_[_0x726c('0x2b')](_0x5b3d66):_0x3dcf95[_0x726c('0xd')],'include':_0x3dcf95['include']?_[_0x726c('0x10')](_0x3dcf95['include'],function(_0x3f1c75){return{'model':db[_0x3f1c75[_0x726c('0x11')]],'as':_0x3f1c75['as'],'attributes':_0x3f1c75[_0x726c('0xd')],'include':_0x3f1c75[_0x726c('0xf')]?_[_0x726c('0x10')](_0x3f1c75[_0x726c('0xf')],function(_0x1fff60){return{'model':db[_0x1fff60['model']],'as':_0x1fff60['as'],'attributes':_0x1fff60[_0x726c('0xd')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45ac64){logger[_0x726c('0x13')](_0x726c('0x7'),_0x18bbbf);logger['debug'](_0x726c('0x7'),_0x18bbbf,JSON[_0x726c('0x15')](_0x45ac64));_0x3cf35f(_0x45ac64);})[_0x726c('0x16')](function(_0x41b4c2){logger[_0x726c('0x17')](_0x726c('0x7'),_0x41b4c2[_0x726c('0x18')],_0x18bbbf);_0xac7111(_0x4c430f[_0x726c('0x17')](0x1f4,_0x41b4c2['message']));});});});};exports[_0x726c('0x43')]=function(_0x2b5ef9){var _0x20ec2c=this;return new Promise(function(_0x2af669,_0x569187){return db['CmContact'][_0x726c('0x44')]({'raw':!![],'where':{'phone':_0x2b5ef9[_0x726c('0xa')][_0x726c('0xc')][_0x726c('0x45')]},'attributes':['id',_0x726c('0x46')],'order':[['id','DESC']]})[_0x726c('0x12')](function(_0x495e95){logger[_0x726c('0x13')](_0x726c('0x47'),_0x2b5ef9);logger['debug']('getContactByPhone',_0x2b5ef9,JSON[_0x726c('0x15')](_0x495e95));_0x2af669(_0x495e95);})['catch'](function(_0x51730c){logger[_0x726c('0x17')]('getContactByPhone',_0x51730c[_0x726c('0x18')],_0x2b5ef9);_0x569187(_0x20ec2c['error'](0x1f4,_0x51730c[_0x726c('0x18')]));});});};exports[_0x726c('0x48')]=function(_0xbf344){var _0x18cf66=this;return new Promise(function(_0x309f78,_0x3cd8c){return db[_0x726c('0x27')][_0x726c('0x28')](function(_0x5bb871){var _0x2d4c1e=_0xbf344[_0x726c('0xa')]&&_0xbf344[_0x726c('0xa')]['where']?_0xbf344['options']['where']:{};return db[_0x726c('0x8')][_0x726c('0x1f')](_0xbf344[_0x726c('0x1d')],{'where':_0x2d4c1e,'transaction':_0x5bb871})[_0x726c('0x12')](function(_0x24f084){logger[_0x726c('0x13')](_0x726c('0x48'),_0xbf344);logger[_0x726c('0x14')](_0x726c('0x48'),_0xbf344,JSON[_0x726c('0x15')](_0x24f084));_0x309f78(_0x24f084);})[_0x726c('0x16')](function(_0x380ab3){logger[_0x726c('0x17')](_0x726c('0x48'),_0x380ab3[_0x726c('0x18')],_0xbf344);_0x3cd8c(_0x18cf66[_0x726c('0x17')](0x1f4,_0x380ab3[_0x726c('0x18')]));});});});};exports[_0x726c('0x49')]=function(_0xcb80b6){var _0x1c035f=this;var _0x47155c=_0xcb80b6[_0x726c('0x1d')][_0x726c('0xc')][_0x726c('0x4a')];var _0x1b7ef2=_0xcb80b6[_0x726c('0x1d')][_0x726c('0xc')][_0x726c('0x4b')];var _0x180e95=_0xcb80b6[_0x726c('0x1d')]['where']['availableAgentsIds'];return new Promise(function(_0x5ddedd,_0x3de2b3){return db['CmHopper'][_0x726c('0x9')]({'where':{'voiceQueueId':{'$in':_0x47155c},'recallme':0x1,'active':0x0,'recallmeNotifiedDate':{'$eq':null},'scheduledat':{'$and':{'$lte':db[_0x726c('0x27')][_0x726c('0x4c')](_0x726c('0x4d')+_0x1b7ef2+_0x726c('0x4e')),'$gt':db['sequelize']['literal']('NOW()')}},'UserId':{'$in':_0x180e95}},'include':[{'model':db['CmContact'],'as':_0x726c('0x2a')},{'model':db[_0x726c('0x4f')],'as':_0x726c('0x2c'),'attributes':['id',_0x726c('0x2d'),_0x726c('0x50')]},{'model':db[_0x726c('0x51')],'as':_0x726c('0x52')}]})[_0x726c('0x12')](function(_0x1f6d5d){if(_0x1f6d5d['length']>0x0){return db[_0x726c('0x27')][_0x726c('0x28')](function(_0x14721c){return db['CmHopper'][_0x726c('0x1f')]({'recallmeNotifiedDate':db[_0x726c('0x27')][_0x726c('0x4c')](_0x726c('0x53'))},{'where':{'id':{'$in':_[_0x726c('0x10')](_0x1f6d5d,'id')}},'transaction':_0x14721c})[_0x726c('0x12')](function(){_0x5ddedd(_0x1f6d5d);})[_0x726c('0x16')](function(_0x3d202e){logger['error'](_0x726c('0x49'),_0x3d202e['message'],_0xcb80b6);_0x3de2b3(_0x1c035f['error'](0x1f4,_0x3d202e[_0x726c('0x18')]));});})[_0x726c('0x16')](function(_0x49cc59){logger[_0x726c('0x17')]('CmHopperHandlePreviewRecallNotifications',_0x49cc59['message'],_0xcb80b6);_0x3de2b3(_0x1c035f['error'](0x1f4,_0x49cc59[_0x726c('0x18')]));});}else{_0x5ddedd(_0x1f6d5d);}});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 66b8b92..7916302 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 _0xaf11=['getPreviewRecall','post','create','/preview','getPreview','/timezone','getTimezone','put','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','index','get','/describe','describe','getOpenContacts','/timezones','/:id','show','/:id/previewrecall'];(function(_0x55006e,_0x49c1f9){var _0x507a85=function(_0x549386){while(--_0x549386){_0x55006e['push'](_0x55006e['shift']());}};_0x507a85(++_0x49c1f9);}(_0xaf11,0x7d));var _0x1af1=function(_0x3152f0,_0x3cb3e0){_0x3152f0=_0x3152f0-0x0;var _0x3d0e49=_0xaf11[_0x3152f0];return _0x3d0e49;};'use strict';var express=require(_0x1af1('0x0'));var router=express[_0x1af1('0x1')]();var auth=require(_0x1af1('0x2'));var controller=require('./cmHopper.controller');router['get']('/',auth[_0x1af1('0x3')](),controller[_0x1af1('0x4')]);router[_0x1af1('0x5')](_0x1af1('0x6'),auth[_0x1af1('0x3')](),controller[_0x1af1('0x7')]);router[_0x1af1('0x5')]('/opencontacts',auth['isAuthenticated'](),controller[_0x1af1('0x8')]);router[_0x1af1('0x5')](_0x1af1('0x9'),auth[_0x1af1('0x3')](),controller['getTimezones']);router[_0x1af1('0x5')](_0x1af1('0xa'),auth[_0x1af1('0x3')](),controller[_0x1af1('0xb')]);router['get'](_0x1af1('0xc'),auth[_0x1af1('0x3')](),controller[_0x1af1('0xd')]);router[_0x1af1('0xe')]('/',auth['isAuthenticated'](),controller[_0x1af1('0xf')]);router[_0x1af1('0xe')](_0x1af1('0x10'),auth[_0x1af1('0x3')](),controller[_0x1af1('0x11')]);router[_0x1af1('0xe')](_0x1af1('0x12'),auth[_0x1af1('0x3')](),controller[_0x1af1('0x13')]);router[_0x1af1('0x14')](_0x1af1('0xa'),auth[_0x1af1('0x3')](),controller['update']);router['delete'](_0x1af1('0xa'),auth[_0x1af1('0x3')](),controller[_0x1af1('0x15')]);module[_0x1af1('0x16')]=router; \ No newline at end of file +var _0x4f4d=['destroy','exports','express','Router','./cmHopper.controller','get','index','/describe','isAuthenticated','describe','/opencontacts','getTimezones','/:id','post','create','/preview','getPreview','getTimezone','put'];(function(_0x557701,_0x180f95){var _0x4c6d09=function(_0x241b67){while(--_0x241b67){_0x557701['push'](_0x557701['shift']());}};_0x4c6d09(++_0x180f95);}(_0x4f4d,0x9a));var _0xd4f4=function(_0x20008a,_0x362490){_0x20008a=_0x20008a-0x0;var _0x5d0f1c=_0x4f4d[_0x20008a];return _0x5d0f1c;};'use strict';var express=require(_0xd4f4('0x0'));var router=express[_0xd4f4('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xd4f4('0x2'));router[_0xd4f4('0x3')]('/',auth['isAuthenticated'](),controller[_0xd4f4('0x4')]);router[_0xd4f4('0x3')](_0xd4f4('0x5'),auth[_0xd4f4('0x6')](),controller[_0xd4f4('0x7')]);router['get'](_0xd4f4('0x8'),auth[_0xd4f4('0x6')](),controller['getOpenContacts']);router[_0xd4f4('0x3')]('/timezones',auth[_0xd4f4('0x6')](),controller[_0xd4f4('0x9')]);router[_0xd4f4('0x3')](_0xd4f4('0xa'),auth[_0xd4f4('0x6')](),controller['show']);router['get']('/:id/previewrecall',auth[_0xd4f4('0x6')](),controller['getPreviewRecall']);router[_0xd4f4('0xb')]('/',auth[_0xd4f4('0x6')](),controller[_0xd4f4('0xc')]);router[_0xd4f4('0xb')](_0xd4f4('0xd'),auth['isAuthenticated'](),controller[_0xd4f4('0xe')]);router[_0xd4f4('0xb')]('/timezone',auth['isAuthenticated'](),controller[_0xd4f4('0xf')]);router[_0xd4f4('0x10')](_0xd4f4('0xa'),auth[_0xd4f4('0x6')](),controller['update']);router['delete'](_0xd4f4('0xa'),auth[_0xd4f4('0x6')](),controller[_0xd4f4('0x11')]);module[_0xd4f4('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js index 4d11a03..7757833 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1c31=['INTEGER','STRING','format','YYYY-MM-DD\x20HH:mm:ss','moment','sequelize','exports'];(function(_0x442661,_0x759662){var _0x529b61=function(_0x17c5a8){while(--_0x17c5a8){_0x442661['push'](_0x442661['shift']());}};_0x529b61(++_0x759662);}(_0x1c31,0x1ee));var _0x11c3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x1c31[_0x502c7d];return _0x30b7ed;};'use strict';var moment=require(_0x11c3('0x0'));var Sequelize=require(_0x11c3('0x1'));module[_0x11c3('0x2')]={'CmHopperId':{'type':Sequelize[_0x11c3('0x3')]},'phone':{'type':Sequelize[_0x11c3('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize[_0x11c3('0x3')],'defaultValue':0x0},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x11c3('0x5')](_0x11c3('0x6'))},'countbusyretry':{'type':Sequelize[_0x11c3('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x11c3('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x11c3('0x3')],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0x11c3('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x11c3('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x11c3('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x11c3('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x34bb=['INTEGER','STRING','DATE','moment','sequelize','exports'];(function(_0x277534,_0x198d19){var _0x24bba4=function(_0x6999be){while(--_0x6999be){_0x277534['push'](_0x277534['shift']());}};_0x24bba4(++_0x198d19);}(_0x34bb,0xdb));var _0xb34b=function(_0xd11d13,_0x49d529){_0xd11d13=_0xd11d13-0x0;var _0x27f7e4=_0x34bb[_0xd11d13];return _0x27f7e4;};'use strict';var moment=require(_0xb34b('0x0'));var Sequelize=require(_0xb34b('0x1'));module[_0xb34b('0x2')]={'CmHopperId':{'type':Sequelize[_0xb34b('0x3')]},'phone':{'type':Sequelize[_0xb34b('0x4')],'allowNull':![]},'OrderBy':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'scheduledat':{'type':Sequelize[_0xb34b('0x5')],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'countbusyretry':{'type':Sequelize[_0xb34b('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnosuchnumberretry':{'type':Sequelize[_0xb34b('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xb34b('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xb34b('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xb34b('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js index e640d62..9bdd6e5 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7258=['apply','reject','save','update','then','destroy','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','index','map','CmHopperAdditionalPhone','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','json'];(function(_0x56930f,_0x978287){var _0x1e32ca=function(_0x1cdb91){while(--_0x1cdb91){_0x56930f['push'](_0x56930f['shift']());}};_0x1e32ca(++_0x978287);}(_0x7258,0xd7));var _0x8725=function(_0xae4dcb,_0x301073){_0xae4dcb=_0xae4dcb-0x0;var _0x5afccb=_0x7258[_0xae4dcb];return _0x5afccb;};'use strict';var emlformat=require(_0x8725('0x0'));var rimraf=require(_0x8725('0x1'));var zipdir=require(_0x8725('0x2'));var jsonpatch=require(_0x8725('0x3'));var rp=require('request-promise');var moment=require(_0x8725('0x4'));var BPromise=require(_0x8725('0x5'));var Mustache=require(_0x8725('0x6'));var util=require(_0x8725('0x7'));var path=require(_0x8725('0x8'));var sox=require(_0x8725('0x9'));var csv=require('to-csv');var ejs=require(_0x8725('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8725('0xb'));var squel=require('squel');var crypto=require(_0x8725('0xc'));var jsforce=require(_0x8725('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x8725('0xe'));var querystring=require(_0x8725('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8725('0x10'));var qs=require(_0x8725('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8725('0x12'));var logger=require(_0x8725('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x8725('0x14'));var licenseUtil=require(_0x8725('0x15'));var db=require(_0x8725('0x16'))['db'];function respondWithStatusCode(_0x1caa49,_0x3577f9){_0x3577f9=_0x3577f9||0xcc;return function(_0x2aa5b6){if(_0x2aa5b6){return _0x1caa49[_0x8725('0x17')](_0x3577f9);}return _0x1caa49[_0x8725('0x18')](_0x3577f9)[_0x8725('0x19')]();};}function respondWithResult(_0x48d16f,_0x472c5d){_0x472c5d=_0x472c5d||0xc8;return function(_0xb57340){if(_0xb57340){return _0x48d16f[_0x8725('0x18')](_0x472c5d)['json'](_0xb57340);}};}function respondWithFilteredResult(_0x4715c7,_0x4cbf70){return function(_0x2d11de){if(_0x2d11de){var _0x1ce73f=typeof _0x4cbf70['offset']===_0x8725('0x1a')&&typeof _0x4cbf70[_0x8725('0x1b')]===_0x8725('0x1a');var _0x5621a4=_0x2d11de['count'];var _0x2e9e36=_0x1ce73f?0x0:_0x4cbf70[_0x8725('0x1c')];var _0x4ba158=_0x1ce73f?_0x2d11de[_0x8725('0x1d')]:_0x4cbf70[_0x8725('0x1c')]+_0x4cbf70['limit'];var _0x4f5b96;if(_0x4ba158>=_0x5621a4){_0x4ba158=_0x5621a4;_0x4f5b96=0xc8;}else{_0x4f5b96=0xce;}_0x4715c7[_0x8725('0x18')](_0x4f5b96);return _0x4715c7['set']('Content-Range',_0x2e9e36+'-'+_0x4ba158+'/'+_0x5621a4)[_0x8725('0x1e')](_0x2d11de);}return null;};}function patchUpdates(_0x2c7808){return function(_0x2c8363){try{jsonpatch[_0x8725('0x1f')](_0x2c8363,_0x2c7808,!![]);}catch(_0xdb673c){return BPromise[_0x8725('0x20')](_0xdb673c);}return _0x2c8363[_0x8725('0x21')]();};}function saveUpdates(_0xf6572f,_0x1acf21){return function(_0x3b6004){if(_0x3b6004){return _0x3b6004[_0x8725('0x22')](_0xf6572f)[_0x8725('0x23')](function(_0x311631){return _0x311631;});}return null;};}function removeEntity(_0x2ae6a5,_0x3535f5){return function(_0x83deeb){if(_0x83deeb){return _0x83deeb[_0x8725('0x24')]()[_0x8725('0x23')](function(){var _0x555c26=_0x83deeb['get']({'plain':!![]});var _0x58496e=_0x8725('0x25');return db[_0x8725('0x26')][_0x8725('0x24')]({'where':{'type':_0x58496e,'resourceId':_0x555c26['id']}})[_0x8725('0x23')](function(){return _0x83deeb;});})[_0x8725('0x23')](function(){_0x2ae6a5['status'](0xcc)[_0x8725('0x19')]();});}};}function handleEntityNotFound(_0x50c24f,_0x19b273){return function(_0x619813){if(!_0x619813){_0x50c24f[_0x8725('0x17')](0x194);}return _0x619813;};}function handleError(_0x548c7d,_0x2bcc3a){_0x2bcc3a=_0x2bcc3a||0x1f4;return function(_0x3cca66){logger[_0x8725('0x27')](_0x3cca66[_0x8725('0x28')]);if(_0x3cca66['name']){delete _0x3cca66[_0x8725('0x29')];}_0x548c7d['status'](_0x2bcc3a)[_0x8725('0x2a')](_0x3cca66);};}exports[_0x8725('0x2b')]=function(_0x4861d5,_0x14468a){var _0x5c0d17={},_0x3f3dab={},_0x42772a={'count':0x0,'rows':[]};var _0xe3f73=_[_0x8725('0x2c')](db[_0x8725('0x2d')][_0x8725('0x2e')],function(_0xd1158f){return{'name':_0xd1158f[_0x8725('0x2f')],'type':_0xd1158f[_0x8725('0x30')]['key']};});_0x3f3dab[_0x8725('0x31')]=_[_0x8725('0x2c')](_0xe3f73,_0x8725('0x29'));_0x3f3dab[_0x8725('0x32')]=_[_0x8725('0x33')](_0x4861d5[_0x8725('0x32')]);_0x3f3dab[_0x8725('0x34')]=_[_0x8725('0x35')](_0x3f3dab[_0x8725('0x31')],_0x3f3dab[_0x8725('0x32')]);_0x5c0d17[_0x8725('0x36')]=_[_0x8725('0x35')](_0x3f3dab[_0x8725('0x31')],qs['fields'](_0x4861d5['query'][_0x8725('0x37')]));_0x5c0d17[_0x8725('0x36')]=_0x5c0d17[_0x8725('0x36')][_0x8725('0x38')]?_0x5c0d17[_0x8725('0x36')]:_0x3f3dab[_0x8725('0x31')];if(!_0x4861d5[_0x8725('0x32')][_0x8725('0x39')](_0x8725('0x3a'))){_0x5c0d17['limit']=qs['limit'](_0x4861d5[_0x8725('0x32')]['limit']);_0x5c0d17[_0x8725('0x1c')]=qs['offset'](_0x4861d5[_0x8725('0x32')]['offset']);}_0x5c0d17[_0x8725('0x3b')]=qs[_0x8725('0x3c')](_0x4861d5[_0x8725('0x32')][_0x8725('0x3c')]);_0x5c0d17[_0x8725('0x3d')]=qs[_0x8725('0x34')](_[_0x8725('0x3e')](_0x4861d5['query'],_0x3f3dab[_0x8725('0x34')]),_0xe3f73);if(_0x4861d5[_0x8725('0x32')][_0x8725('0x3f')]){_0x5c0d17['where']=_[_0x8725('0x40')](_0x5c0d17[_0x8725('0x3d')],{'$or':_[_0x8725('0x2c')](_0xe3f73,function(_0xca0b1){if(_0xca0b1[_0x8725('0x30')]!=='VIRTUAL'){var _0x270e02={};_0x270e02[_0xca0b1[_0x8725('0x29')]]={'$like':'%'+_0x4861d5['query']['filter']+'%'};return _0x270e02;}})});}_0x5c0d17=_[_0x8725('0x40')]({},_0x5c0d17,_0x4861d5[_0x8725('0x41')]);var _0x11befd={'where':_0x5c0d17[_0x8725('0x3d')]};return db[_0x8725('0x2d')][_0x8725('0x1d')](_0x11befd)[_0x8725('0x23')](function(_0x5dee10){_0x42772a['count']=_0x5dee10;if(_0x4861d5[_0x8725('0x32')][_0x8725('0x42')]){_0x5c0d17[_0x8725('0x43')]=[{'all':!![]}];}return db[_0x8725('0x2d')][_0x8725('0x44')](_0x5c0d17);})[_0x8725('0x23')](function(_0x2a860b){_0x42772a[_0x8725('0x45')]=_0x2a860b;return _0x42772a;})[_0x8725('0x23')](respondWithFilteredResult(_0x14468a,_0x5c0d17))['catch'](handleError(_0x14468a,null));};exports[_0x8725('0x46')]=function(_0x2c2562,_0xdb4f81){var _0x1f9e34={'raw':!![],'where':{'id':_0x2c2562['params']['id']}},_0x5b8b2a={};_0x5b8b2a[_0x8725('0x31')]=_['keys'](db['CmHopperAdditionalPhone'][_0x8725('0x2e')]);_0x5b8b2a['query']=_['keys'](_0x2c2562[_0x8725('0x32')]);_0x5b8b2a['filters']=_['intersection'](_0x5b8b2a['model'],_0x5b8b2a[_0x8725('0x32')]);_0x1f9e34[_0x8725('0x36')]=_[_0x8725('0x35')](_0x5b8b2a[_0x8725('0x31')],qs[_0x8725('0x37')](_0x2c2562[_0x8725('0x32')][_0x8725('0x37')]));_0x1f9e34[_0x8725('0x36')]=_0x1f9e34[_0x8725('0x36')]['length']?_0x1f9e34[_0x8725('0x36')]:_0x5b8b2a['model'];if(_0x2c2562[_0x8725('0x32')][_0x8725('0x42')]){_0x1f9e34[_0x8725('0x43')]=[{'all':!![]}];}_0x1f9e34=_[_0x8725('0x40')]({},_0x1f9e34,_0x2c2562[_0x8725('0x41')]);return db[_0x8725('0x2d')][_0x8725('0x47')](_0x1f9e34)['then'](handleEntityNotFound(_0xdb4f81,null))[_0x8725('0x23')](respondWithResult(_0xdb4f81,null))['catch'](handleError(_0xdb4f81,null));};exports[_0x8725('0x48')]=function(_0x483d40,_0x122561){return db[_0x8725('0x2d')][_0x8725('0x48')](_0x483d40[_0x8725('0x49')],{})[_0x8725('0x23')](function(_0x141b4c){var _0xcad5ac=_0x483d40[_0x8725('0x4a')][_0x8725('0x4b')]({'plain':!![]});if(!_0xcad5ac)throw new Error(_0x8725('0x4c'));if(_0xcad5ac[_0x8725('0x4d')]===_0x8725('0x4a')){var _0x5936a1=_0x141b4c[_0x8725('0x4b')]({'plain':!![]});var _0x18998f='CmHopperAdditionalPhones';return db[_0x8725('0x4e')]['find']({'where':{'name':_0x18998f,'userProfileId':_0xcad5ac['userProfileId']},'raw':!![]})[_0x8725('0x23')](function(_0x2fb20b){if(_0x2fb20b&&_0x2fb20b[_0x8725('0x4f')]===0x0){return db['UserProfileResource'][_0x8725('0x48')]({'name':_0x5936a1[_0x8725('0x29')],'resourceId':_0x5936a1['id'],'type':_0x2fb20b['name'],'sectionId':_0x2fb20b['id']},{})[_0x8725('0x23')](function(){return _0x141b4c;});}else{return _0x141b4c;}})[_0x8725('0x50')](function(_0x3b2ba9){logger[_0x8725('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3b2ba9);throw _0x3b2ba9;});}return _0x141b4c;})[_0x8725('0x23')](respondWithResult(_0x122561,0xc9))[_0x8725('0x50')](handleError(_0x122561,null));};exports['update']=function(_0x543469,_0x2883e6){if(_0x543469[_0x8725('0x49')]['id']){delete _0x543469[_0x8725('0x49')]['id'];}return db[_0x8725('0x2d')][_0x8725('0x47')]({'where':{'id':_0x543469[_0x8725('0x51')]['id']}})['then'](handleEntityNotFound(_0x2883e6,null))['then'](saveUpdates(_0x543469[_0x8725('0x49')],null))[_0x8725('0x23')](respondWithResult(_0x2883e6,null))[_0x8725('0x50')](handleError(_0x2883e6,null));};exports['destroy']=function(_0x4a82cc,_0x8f14c3){return db[_0x8725('0x2d')][_0x8725('0x47')]({'where':{'id':_0x4a82cc[_0x8725('0x51')]['id']}})[_0x8725('0x23')](handleEntityNotFound(_0x8f14c3,null))[_0x8725('0x23')](removeEntity(_0x8f14c3,null))[_0x8725('0x50')](handleError(_0x8f14c3,null));}; \ No newline at end of file +var _0x10e9=['merge','VIRTUAL','include','findAll','rows','show','params','rawAttributes','includeAll','options','find','catch','create','body','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','get','CmHopperAdditionalPhones','UserProfileResource','error','stack','name','send','map','CmHopperAdditionalPhone','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where'];(function(_0x39fff1,_0x3f859e){var _0x235670=function(_0x29b698){while(--_0x29b698){_0x39fff1['push'](_0x39fff1['shift']());}};_0x235670(++_0x3f859e);}(_0x10e9,0xbf));var _0x910e=function(_0x33c637,_0x597c26){_0x33c637=_0x33c637-0x0;var _0x14aa20=_0x10e9[_0x33c637];return _0x14aa20;};'use strict';var emlformat=require(_0x910e('0x0'));var rimraf=require(_0x910e('0x1'));var zipdir=require(_0x910e('0x2'));var jsonpatch=require(_0x910e('0x3'));var rp=require(_0x910e('0x4'));var moment=require(_0x910e('0x5'));var BPromise=require(_0x910e('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x910e('0x7'));var sox=require(_0x910e('0x8'));var csv=require(_0x910e('0x9'));var ejs=require(_0x910e('0xa'));var fs=require('fs');var fs_extra=require(_0x910e('0xb'));var _=require(_0x910e('0xc'));var squel=require(_0x910e('0xd'));var crypto=require('crypto');var jsforce=require(_0x910e('0xe'));var deskjs=require(_0x910e('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x910e('0x10'));var Redis=require(_0x910e('0x11'));var authService=require(_0x910e('0x12'));var qs=require(_0x910e('0x13'));var as=require(_0x910e('0x14'));var hardwareService=require(_0x910e('0x15'));var logger=require(_0x910e('0x16'))(_0x910e('0x17'));var utils=require(_0x910e('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x910e('0x19'))['db'];function respondWithStatusCode(_0x4757af,_0x53213e){_0x53213e=_0x53213e||0xcc;return function(_0x25e54c){if(_0x25e54c){return _0x4757af[_0x910e('0x1a')](_0x53213e);}return _0x4757af[_0x910e('0x1b')](_0x53213e)[_0x910e('0x1c')]();};}function respondWithResult(_0x495931,_0x3309ea){_0x3309ea=_0x3309ea||0xc8;return function(_0x16540d){if(_0x16540d){return _0x495931[_0x910e('0x1b')](_0x3309ea)[_0x910e('0x1d')](_0x16540d);}};}function respondWithFilteredResult(_0x3037f1,_0x4341f7){return function(_0x4c6688){if(_0x4c6688){var _0x389578=typeof _0x4341f7[_0x910e('0x1e')]===_0x910e('0x1f')&&typeof _0x4341f7['limit']===_0x910e('0x1f');var _0x153d1d=_0x4c6688[_0x910e('0x20')];var _0x5b2220=_0x389578?0x0:_0x4341f7[_0x910e('0x1e')];var _0x1b2f35=_0x389578?_0x4c6688[_0x910e('0x20')]:_0x4341f7[_0x910e('0x1e')]+_0x4341f7['limit'];var _0x29a201;if(_0x1b2f35>=_0x153d1d){_0x1b2f35=_0x153d1d;_0x29a201=0xc8;}else{_0x29a201=0xce;}_0x3037f1[_0x910e('0x1b')](_0x29a201);return _0x3037f1[_0x910e('0x21')](_0x910e('0x22'),_0x5b2220+'-'+_0x1b2f35+'/'+_0x153d1d)[_0x910e('0x1d')](_0x4c6688);}return null;};}function patchUpdates(_0x414210){return function(_0x2296cc){try{jsonpatch[_0x910e('0x23')](_0x2296cc,_0x414210,!![]);}catch(_0x139cb5){return BPromise[_0x910e('0x24')](_0x139cb5);}return _0x2296cc['save']();};}function saveUpdates(_0x112dd3,_0x3ee945){return function(_0x3d9775){if(_0x3d9775){return _0x3d9775[_0x910e('0x25')](_0x112dd3)[_0x910e('0x26')](function(_0x1e1434){return _0x1e1434;});}return null;};}function removeEntity(_0x55a036,_0x4278aa){return function(_0x4d86c9){if(_0x4d86c9){return _0x4d86c9[_0x910e('0x27')]()['then'](function(){var _0x234c6d=_0x4d86c9[_0x910e('0x28')]({'plain':!![]});var _0xff268f=_0x910e('0x29');return db[_0x910e('0x2a')]['destroy']({'where':{'type':_0xff268f,'resourceId':_0x234c6d['id']}})[_0x910e('0x26')](function(){return _0x4d86c9;});})['then'](function(){_0x55a036[_0x910e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33473a,_0x532c30){return function(_0x38de98){if(!_0x38de98){_0x33473a[_0x910e('0x1a')](0x194);}return _0x38de98;};}function handleError(_0x806c41,_0x592863){_0x592863=_0x592863||0x1f4;return function(_0x51bd6f){logger[_0x910e('0x2b')](_0x51bd6f[_0x910e('0x2c')]);if(_0x51bd6f[_0x910e('0x2d')]){delete _0x51bd6f[_0x910e('0x2d')];}_0x806c41['status'](_0x592863)[_0x910e('0x2e')](_0x51bd6f);};}exports['index']=function(_0x4c3d98,_0x2ff42e){var _0x2fde1e={},_0x4418b2={},_0x5f43d2={'count':0x0,'rows':[]};var _0x21852d=_[_0x910e('0x2f')](db[_0x910e('0x30')]['rawAttributes'],function(_0x831bf3){return{'name':_0x831bf3[_0x910e('0x31')],'type':_0x831bf3[_0x910e('0x32')][_0x910e('0x33')]};});_0x4418b2[_0x910e('0x34')]=_[_0x910e('0x2f')](_0x21852d,_0x910e('0x2d'));_0x4418b2['query']=_[_0x910e('0x35')](_0x4c3d98[_0x910e('0x36')]);_0x4418b2['filters']=_[_0x910e('0x37')](_0x4418b2[_0x910e('0x34')],_0x4418b2[_0x910e('0x36')]);_0x2fde1e[_0x910e('0x38')]=_['intersection'](_0x4418b2[_0x910e('0x34')],qs[_0x910e('0x39')](_0x4c3d98[_0x910e('0x36')][_0x910e('0x39')]));_0x2fde1e[_0x910e('0x38')]=_0x2fde1e[_0x910e('0x38')][_0x910e('0x3a')]?_0x2fde1e[_0x910e('0x38')]:_0x4418b2[_0x910e('0x34')];if(!_0x4c3d98[_0x910e('0x36')][_0x910e('0x3b')](_0x910e('0x3c'))){_0x2fde1e[_0x910e('0x3d')]=qs[_0x910e('0x3d')](_0x4c3d98[_0x910e('0x36')]['limit']);_0x2fde1e[_0x910e('0x1e')]=qs['offset'](_0x4c3d98['query']['offset']);}_0x2fde1e[_0x910e('0x3e')]=qs[_0x910e('0x3f')](_0x4c3d98[_0x910e('0x36')][_0x910e('0x3f')]);_0x2fde1e['where']=qs[_0x910e('0x40')](_['pick'](_0x4c3d98['query'],_0x4418b2[_0x910e('0x40')]),_0x21852d);if(_0x4c3d98[_0x910e('0x36')][_0x910e('0x41')]){_0x2fde1e[_0x910e('0x42')]=_[_0x910e('0x43')](_0x2fde1e[_0x910e('0x42')],{'$or':_[_0x910e('0x2f')](_0x21852d,function(_0x331020){if(_0x331020[_0x910e('0x32')]!==_0x910e('0x44')){var _0x4392c1={};_0x4392c1[_0x331020[_0x910e('0x2d')]]={'$like':'%'+_0x4c3d98['query'][_0x910e('0x41')]+'%'};return _0x4392c1;}})});}_0x2fde1e=_[_0x910e('0x43')]({},_0x2fde1e,_0x4c3d98['options']);var _0xc67fea={'where':_0x2fde1e[_0x910e('0x42')]};return db[_0x910e('0x30')][_0x910e('0x20')](_0xc67fea)[_0x910e('0x26')](function(_0x392b01){_0x5f43d2[_0x910e('0x20')]=_0x392b01;if(_0x4c3d98[_0x910e('0x36')]['includeAll']){_0x2fde1e[_0x910e('0x45')]=[{'all':!![]}];}return db[_0x910e('0x30')][_0x910e('0x46')](_0x2fde1e);})[_0x910e('0x26')](function(_0x142c72){_0x5f43d2[_0x910e('0x47')]=_0x142c72;return _0x5f43d2;})[_0x910e('0x26')](respondWithFilteredResult(_0x2ff42e,_0x2fde1e))['catch'](handleError(_0x2ff42e,null));};exports[_0x910e('0x48')]=function(_0x10511d,_0x40dacb){var _0x48c10c={'raw':!![],'where':{'id':_0x10511d[_0x910e('0x49')]['id']}},_0x45009c={};_0x45009c['model']=_[_0x910e('0x35')](db[_0x910e('0x30')][_0x910e('0x4a')]);_0x45009c[_0x910e('0x36')]=_[_0x910e('0x35')](_0x10511d['query']);_0x45009c[_0x910e('0x40')]=_[_0x910e('0x37')](_0x45009c[_0x910e('0x34')],_0x45009c[_0x910e('0x36')]);_0x48c10c[_0x910e('0x38')]=_[_0x910e('0x37')](_0x45009c[_0x910e('0x34')],qs[_0x910e('0x39')](_0x10511d[_0x910e('0x36')][_0x910e('0x39')]));_0x48c10c[_0x910e('0x38')]=_0x48c10c[_0x910e('0x38')][_0x910e('0x3a')]?_0x48c10c[_0x910e('0x38')]:_0x45009c[_0x910e('0x34')];if(_0x10511d[_0x910e('0x36')][_0x910e('0x4b')]){_0x48c10c['include']=[{'all':!![]}];}_0x48c10c=_['merge']({},_0x48c10c,_0x10511d[_0x910e('0x4c')]);return db['CmHopperAdditionalPhone'][_0x910e('0x4d')](_0x48c10c)[_0x910e('0x26')](handleEntityNotFound(_0x40dacb,null))[_0x910e('0x26')](respondWithResult(_0x40dacb,null))[_0x910e('0x4e')](handleError(_0x40dacb,null));};exports[_0x910e('0x4f')]=function(_0x5730f6,_0x42474a){return db[_0x910e('0x30')][_0x910e('0x4f')](_0x5730f6[_0x910e('0x50')],{})[_0x910e('0x26')](function(_0x1b6d48){var _0x5e54e2=_0x5730f6[_0x910e('0x51')][_0x910e('0x28')]({'plain':!![]});if(!_0x5e54e2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5e54e2[_0x910e('0x52')]===_0x910e('0x51')){var _0x1dce53=_0x1b6d48[_0x910e('0x28')]({'plain':!![]});var _0x1ef7a6=_0x910e('0x29');return db[_0x910e('0x53')]['find']({'where':{'name':_0x1ef7a6,'userProfileId':_0x5e54e2['userProfileId']},'raw':!![]})[_0x910e('0x26')](function(_0x11ddce){if(_0x11ddce&&_0x11ddce[_0x910e('0x54')]===0x0){return db[_0x910e('0x2a')][_0x910e('0x4f')]({'name':_0x1dce53[_0x910e('0x2d')],'resourceId':_0x1dce53['id'],'type':_0x11ddce[_0x910e('0x2d')],'sectionId':_0x11ddce['id']},{})[_0x910e('0x26')](function(){return _0x1b6d48;});}else{return _0x1b6d48;}})[_0x910e('0x4e')](function(_0x464d5d){logger['error'](_0x910e('0x55'),_0x464d5d);throw _0x464d5d;});}return _0x1b6d48;})[_0x910e('0x26')](respondWithResult(_0x42474a,0xc9))[_0x910e('0x4e')](handleError(_0x42474a,null));};exports['update']=function(_0x1fac76,_0x337f7d){if(_0x1fac76[_0x910e('0x50')]['id']){delete _0x1fac76[_0x910e('0x50')]['id'];}return db[_0x910e('0x30')][_0x910e('0x4d')]({'where':{'id':_0x1fac76[_0x910e('0x49')]['id']}})[_0x910e('0x26')](handleEntityNotFound(_0x337f7d,null))[_0x910e('0x26')](saveUpdates(_0x1fac76[_0x910e('0x50')],null))[_0x910e('0x26')](respondWithResult(_0x337f7d,null))['catch'](handleError(_0x337f7d,null));};exports[_0x910e('0x27')]=function(_0x28a2fb,_0x212e8e){return db[_0x910e('0x30')][_0x910e('0x4d')]({'where':{'id':_0x28a2fb[_0x910e('0x49')]['id']}})['then'](handleEntityNotFound(_0x212e8e,null))[_0x910e('0x26')](removeEntity(_0x212e8e,null))[_0x910e('0x4e')](handleError(_0x212e8e,null));}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js index 0c02572..b4009df 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x072c=['cm_hopper_additional_phones','lodash','api','moment','bluebird','request-promise','path','./cmHopperAdditionalPhone.attributes','define','CmHopperAdditionalPhone'];(function(_0x2d6c9c,_0x1ad5b0){var _0x157313=function(_0x584070){while(--_0x584070){_0x2d6c9c['push'](_0x2d6c9c['shift']());}};_0x157313(++_0x1ad5b0);}(_0x072c,0x10f));var _0xc072=function(_0xe18a3a,_0x405850){_0xe18a3a=_0xe18a3a-0x0;var _0x2d01d1=_0x072c[_0xe18a3a];return _0x2d01d1;};'use strict';var _=require(_0xc072('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc072('0x1'));var moment=require(_0xc072('0x2'));var BPromise=require(_0xc072('0x3'));var rp=require(_0xc072('0x4'));var fs=require('fs');var path=require(_0xc072('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc072('0x6'));module['exports']=function(_0x852f18,_0x2fdd9a){return _0x852f18[_0xc072('0x7')](_0xc072('0x8'),attributes,{'tableName':_0xc072('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb468=['path','rimraf','../../config/environment','./cmHopperAdditionalPhone.attributes','exports','CmHopperAdditionalPhone','cm_hopper_additional_phones','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5ded96,_0x35805c){var _0x3cd145=function(_0x324285){while(--_0x324285){_0x5ded96['push'](_0x5ded96['shift']());}};_0x3cd145(++_0x35805c);}(_0xb468,0x1b7));var _0x8b46=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xb468[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8b46('0x0'))(_0x8b46('0x1'));var moment=require(_0x8b46('0x2'));var BPromise=require(_0x8b46('0x3'));var rp=require(_0x8b46('0x4'));var fs=require('fs');var path=require(_0x8b46('0x5'));var rimraf=require(_0x8b46('0x6'));var config=require(_0x8b46('0x7'));var attributes=require(_0x8b46('0x8'));module[_0x8b46('0x9')]=function(_0x54a293,_0x50f6ba){return _0x54a293['define'](_0x8b46('0xa'),attributes,{'tableName':_0x8b46('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js index f44ae75..38bbee9 100644 --- a/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js +++ b/server/api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbef1=['IncrementPreviewCounters','field','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VerifyAdditionalPhones','CmHopper','findOne','ListId','body','VoiceQueueId','CampaignId','CmHopperAdditionalPhone','OrderBy','ASC','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countbusyretry','catch','SwapAdditionalPhones','ContactId','duration','waitTime','isNil','scheduledat','minutes','add','phone','createdAt','updatedAt','transaction','update','activateAdditionalPhone'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xbef1,0x78));var _0x1bef=function(_0x109f4d,_0x39dabd){_0x109f4d=_0x109f4d-0x0;var _0x541706=_0xbef1[_0x109f4d];return _0x541706;};'use strict';var _=require(_0x1bef('0x0'));var util=require('util');var moment=require(_0x1bef('0x1'));var BPromise=require(_0x1bef('0x2'));var rs=require(_0x1bef('0x3'));var fs=require('fs');var Redis=require(_0x1bef('0x4'));var db=require(_0x1bef('0x5'))['db'];var utils=require(_0x1bef('0x6'));var logger=require(_0x1bef('0x7'))(_0x1bef('0x8'));var config=require(_0x1bef('0x9'));var jayson=require(_0x1bef('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e54bf,_0x484355,_0x224fc5){return new BPromise(function(_0x491c49,_0x348de9){return client[_0x1bef('0xb')](_0x2e54bf,_0x224fc5)[_0x1bef('0xc')](function(_0x3a59fb){logger[_0x1bef('0xd')](_0x1bef('0xe'),_0x484355,_0x1bef('0xf'));logger[_0x1bef('0x10')](_0x1bef('0x11'),_0x484355,'request\x20sent',JSON[_0x1bef('0x12')](_0x3a59fb));if(_0x3a59fb[_0x1bef('0x13')]){if(_0x3a59fb[_0x1bef('0x13')][_0x1bef('0x14')]===0x1f4){logger[_0x1bef('0x13')]('CmHopperAdditionalPhone,\x20%s,\x20%s',_0x484355,_0x3a59fb['error']['message']);return _0x348de9(_0x3a59fb[_0x1bef('0x13')]['message']);}logger[_0x1bef('0x13')](_0x1bef('0xe'),_0x484355,_0x3a59fb['error'][_0x1bef('0x15')]);return _0x491c49(_0x3a59fb[_0x1bef('0x13')][_0x1bef('0x15')]);}else{logger[_0x1bef('0xd')](_0x1bef('0xe'),_0x484355,_0x1bef('0xf'));_0x491c49(_0x3a59fb['result']['message']);}})['catch'](function(_0x434db3){logger[_0x1bef('0x13')](_0x1bef('0xe'),_0x484355,_0x434db3);_0x348de9(_0x434db3);});});}exports[_0x1bef('0x16')]=function(_0x185585){var _0xfc4686=this;return new Promise(function(_0x3fde6c,_0x521e66){return db[_0x1bef('0x17')][_0x1bef('0x18')]({'raw':!![],'where':{'ContactId':_0x185585['body']['ContactId'],'ListId':_0x185585['body'][_0x1bef('0x19')],'VoiceQueueId':_0x185585[_0x1bef('0x1a')][_0x1bef('0x1b')]===undefined?null:_0x185585['body']['VoiceQueueId'],'CampaignId':_0x185585[_0x1bef('0x1a')][_0x1bef('0x1c')]===undefined?null:_0x185585[_0x1bef('0x1a')]['CampaignId']}})[_0x1bef('0xc')](function(_0x5960fb){if(_0x5960fb!=null){return db[_0x1bef('0x1d')][_0x1bef('0x18')]({'raw':!![],'where':{'CmHopperId':_0x5960fb['id'],'OrderBy':{'$gt':_0x5960fb[_0x1bef('0x1e')]}},'order':[[_0x1bef('0x1e'),_0x1bef('0x1f')]]})[_0x1bef('0xc')](function(_0x1d7dd0){var _0x2d642f=0x0;if(_0x1d7dd0){if(_0x1d7dd0['countbusyretry']+_0x1d7dd0[_0x1bef('0x20')]+_0x1d7dd0[_0x1bef('0x21')]+_0x1d7dd0[_0x1bef('0x22')]+_0x1d7dd0[_0x1bef('0x23')]+_0x1d7dd0[_0x1bef('0x24')]+_0x1d7dd0[_0x1bef('0x25')]+_0x1d7dd0[_0x1bef('0x26')]<_0x185585[_0x1bef('0x27')][_0x1bef('0x28')])_0x2d642f=0x1;_0x3fde6c({'additional':_0x2d642f});}else{return db[_0x1bef('0x1d')][_0x1bef('0x18')]({'raw':!![],'where':{'CmHopperId':_0x5960fb['id']},'order':[['OrderBy','ASC']]})[_0x1bef('0xc')](function(_0x56a6ff){var _0x47d995=0x0;if(_0x56a6ff){if(_0x56a6ff[_0x1bef('0x29')]+_0x56a6ff['countcongestionretry']+_0x56a6ff[_0x1bef('0x21')]+_0x56a6ff['countnosuchnumberretry']+_0x56a6ff[_0x1bef('0x23')]+_0x56a6ff[_0x1bef('0x24')]+_0x56a6ff[_0x1bef('0x25')]+_0x56a6ff[_0x1bef('0x26')]<_0x185585[_0x1bef('0x27')][_0x1bef('0x28')])_0x47d995=0x1;_0x3fde6c({'additional':_0x47d995});}else{_0x3fde6c({'additional':0x0});}})[_0x1bef('0x2a')](function(_0x15cd15){logger[_0x1bef('0x13')](_0x1bef('0x16'),_0x15cd15[_0x1bef('0x15')]);_0x521e66(_0xfc4686[_0x1bef('0x13')](0x1f4,_0x15cd15[_0x1bef('0x15')]));});}})[_0x1bef('0x2a')](function(_0x47e6dc){logger[_0x1bef('0x13')](_0x1bef('0x16'),_0x47e6dc['message']);_0x521e66(_0xfc4686[_0x1bef('0x13')](0x1f4,_0x47e6dc['message']));});}else _0x3fde6c({'additional':0x0});});});};exports[_0x1bef('0x2b')]=function(_0x26d810){var _0x56f0fa=this;return new Promise(function(_0x19fa9d,_0x3764a0){return db[_0x1bef('0x17')][_0x1bef('0x18')]({'raw':!![],'where':{'ContactId':_0x26d810[_0x1bef('0x1a')][_0x1bef('0x2c')],'ListId':_0x26d810['body'][_0x1bef('0x19')],'VoiceQueueId':_0x26d810[_0x1bef('0x1a')][_0x1bef('0x1b')]===undefined?null:_0x26d810[_0x1bef('0x1a')][_0x1bef('0x1b')],'CampaignId':_0x26d810[_0x1bef('0x1a')][_0x1bef('0x1c')]===undefined?null:_0x26d810['body'][_0x1bef('0x1c')]}})[_0x1bef('0xc')](function(_0xef510a){if(_0xef510a!=null){return db[_0x1bef('0x1d')][_0x1bef('0x18')]({'raw':!![],'where':{'CmHopperId':_0xef510a['id'],'OrderBy':{'$gte':_0xef510a[_0x1bef('0x1e')]}},'order':[[_0x1bef('0x1e'),_0x1bef('0x1f')]]})[_0x1bef('0xc')](function(_0x5c8512){if(_0x5c8512)return activateAdditionalPhone(_0xef510a,_0x26d810[_0x1bef('0x1a')],_0x5c8512,_0x26d810[_0x1bef('0x2d')],_0x26d810['waitTime'])[_0x1bef('0xc')](function(_0x178c81){_0x19fa9d(_0x178c81);});else{return db[_0x1bef('0x1d')][_0x1bef('0x18')]({'raw':!![],'where':{'CmHopperId':_0xef510a['id']},'order':[['OrderBy',_0x1bef('0x1f')]]})[_0x1bef('0xc')](function(_0x3c2eb5){if(_0x3c2eb5)return activateAdditionalPhone(_0xef510a,_0x26d810[_0x1bef('0x1a')],_0x3c2eb5,_0x26d810[_0x1bef('0x2d')],_0x26d810[_0x1bef('0x2e')])['then'](function(_0x45e5b7){_0x19fa9d(_0x45e5b7);});else{_0x19fa9d({'id':_0xef510a['id'],'phone':''});}})['catch'](function(_0x3fb28c){logger[_0x1bef('0x13')](_0x1bef('0x16'),_0x3fb28c[_0x1bef('0x15')]);_0x3764a0(_0x56f0fa['error'](0x1f4,_0x3fb28c['message']));});}})['catch'](function(_0x17865d){logger[_0x1bef('0x13')]('VerifyAdditionalPhones',_0x17865d[_0x1bef('0x15')]);_0x3764a0(_0x56f0fa['error'](0x1f4,_0x17865d[_0x1bef('0x15')]));});}else _0x19fa9d(0x1);});});};function activateAdditionalPhone(_0x2ed5b4,_0xe24bc,_0x342203,_0x55859e,_0x46efe4){return new Promise(function(_0x3b50bd,_0x666a61){var _0x4c240d;if(_[_0x1bef('0x2f')](_0x342203[_0x1bef('0x30')])){_0x342203[_0x1bef('0x30')]=moment();}if(moment()>moment(_0x342203[_0x1bef('0x30')])){_0x4c240d=moment()['add'](_0x46efe4||0x3,_0x1bef('0x31'));}else{if(_0x342203[_0x1bef('0x1e')]==0x0){_0x4c240d=moment(_0x342203[_0x1bef('0x30')]);}else{_0x4c240d=moment()[_0x1bef('0x32')](_0x46efe4||0x3,'minutes');}}if(_[_0x1bef('0x2f')](_0x4c240d)){_0x4c240d=moment()[_0x1bef('0x32')](_0x46efe4||0x3,_0x1bef('0x31'));}var _0x514d4a={'phone':_0x2ed5b4[_0x1bef('0x33')],'active':0x0,'OrderBy':_[_0x1bef('0x2f')](_0x2ed5b4[_0x1bef('0x1e')])?0x0:_0x2ed5b4[_0x1bef('0x1e')],'scheduledat':moment()[_0x1bef('0x32')](_0x55859e||0x1,_0x1bef('0x31')),'countbusyretry':_0xe24bc['countbusyretry'],'countcongestionretry':_0xe24bc['countcongestionretry'],'countnoanswerretry':_0xe24bc['countnoanswerretry'],'countnosuchnumberretry':_0xe24bc['countnosuchnumberretry'],'countdropretry':_0xe24bc[_0x1bef('0x23')],'countabandonedretry':_0xe24bc['countabandonedretry'],'countmachineretry':_0xe24bc[_0x1bef('0x25')],'countagentrejectretry':_0xe24bc['countagentrejectretry'],'createdAt':_0xe24bc[_0x1bef('0x34')],'updatedAt':_0xe24bc['updatedAt']};var _0x584ecc={'CmHopperId':_0x2ed5b4['id'],'phone':_0x342203[_0x1bef('0x33')],'active':0x0,'OrderBy':_['isNil'](_0x342203[_0x1bef('0x1e')])?0x0:_0x342203[_0x1bef('0x1e')],'scheduledat':_0x4c240d,'countbusyretry':_0x342203[_0x1bef('0x29')],'countcongestionretry':_0x342203[_0x1bef('0x20')],'countnoanswerretry':_0x342203[_0x1bef('0x21')],'countnosuchnumberretry':_0x342203[_0x1bef('0x22')],'countdropretry':_0x342203['countdropretry'],'countabandonedretry':_0x342203['countabandonedretry'],'countmachineretry':_0x342203[_0x1bef('0x25')],'countagentrejectretry':_0x342203[_0x1bef('0x26')],'createdAt':_0x342203[_0x1bef('0x34')],'updatedAt':_0x342203[_0x1bef('0x35')]};return db['sequelize'][_0x1bef('0x36')](function(_0x1daac0){return db[_0x1bef('0x1d')][_0x1bef('0x37')](_0x514d4a,{'where':{'id':_0x342203['id']}},{'transaction':_0x1daac0})[_0x1bef('0xc')](function(){return db[_0x1bef('0x17')][_0x1bef('0x37')](_0x584ecc,{'where':{'id':_0x2ed5b4['id']}},{'transaction':_0x1daac0});});})[_0x1bef('0xc')](function(_0x1faaae){_0x3b50bd({'id':_0x2ed5b4['id'],'phone':_0x342203[_0x1bef('0x33')]});})['catch'](function(_0x6a8daf){logger[_0x1bef('0x13')](_0x1bef('0x38'),_0x6a8daf[_0x1bef('0x15')]);_0x666a61({'error':_0x6a8daf[_0x1bef('0x15')]});});});}exports[_0x1bef('0x39')]=function(_0x4c25dc){var _0x3bbb78=this;return new Promise(function(_0x31153b,_0x2c1b92){return db[_0x1bef('0x17')][_0x1bef('0x37')](_0x4c25dc[_0x1bef('0x1a')][_0x1bef('0x3a')],{'where':{'id':_0x4c25dc[_0x1bef('0x1a')]['id']}})[_0x1bef('0xc')](function(_0x4f4574){_0x31153b(_0x4f4574);})[_0x1bef('0x2a')](function(_0x3bc96a){logger[_0x1bef('0x13')](_0x1bef('0x39'),_0x3bc96a['message']);_0x2c1b92(_0x3bbb78[_0x1bef('0x13')](0x1f4,_0x3bc96a['message']));});});}; \ No newline at end of file +var _0x2f3a=['CmHopperAdditionalPhone','OrderBy','ASC','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','entity','dialGlobalMaxRetry','countbusyretry','countnoanswerretry','duration','waitTime','isNil','scheduledat','add','minutes','phone','createdAt','updatedAt','transaction','update','activateAdditionalPhone','field','IncrementPreviewCounters','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','CmHopperAdditionalPhone,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','VerifyAdditionalPhones','CmHopper','findOne','body','ContactId','ListId','VoiceQueueId','CampaignId'];(function(_0x23c01d,_0x3aa26d){var _0x506a34=function(_0x49c07a){while(--_0x49c07a){_0x23c01d['push'](_0x23c01d['shift']());}};_0x506a34(++_0x3aa26d);}(_0x2f3a,0x195));var _0xa2f3=function(_0x3b2c24,_0x1cee91){_0x3b2c24=_0x3b2c24-0x0;var _0x166618=_0x2f3a[_0x3b2c24];return _0x166618;};'use strict';var _=require('lodash');var util=require(_0xa2f3('0x0'));var moment=require('moment');var BPromise=require(_0xa2f3('0x1'));var rs=require(_0xa2f3('0x2'));var fs=require('fs');var Redis=require(_0xa2f3('0x3'));var db=require(_0xa2f3('0x4'))['db'];var utils=require(_0xa2f3('0x5'));var logger=require('../../config/logger')(_0xa2f3('0x6'));var config=require(_0xa2f3('0x7'));var jayson=require(_0xa2f3('0x8'));var client=jayson['client'][_0xa2f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f8502,_0x23b7dd,_0x2bf7d0){return new BPromise(function(_0x41b31d,_0x143b95){return client[_0xa2f3('0xa')](_0x4f8502,_0x2bf7d0)[_0xa2f3('0xb')](function(_0x11026f){logger['info'](_0xa2f3('0xc'),_0x23b7dd,_0xa2f3('0xd'));logger[_0xa2f3('0xe')]('CmHopperAdditionalPhone,\x20%s,\x20%s,\x20%s',_0x23b7dd,_0xa2f3('0xd'),JSON['stringify'](_0x11026f));if(_0x11026f['error']){if(_0x11026f[_0xa2f3('0xf')][_0xa2f3('0x10')]===0x1f4){logger[_0xa2f3('0xf')](_0xa2f3('0xc'),_0x23b7dd,_0x11026f['error'][_0xa2f3('0x11')]);return _0x143b95(_0x11026f[_0xa2f3('0xf')][_0xa2f3('0x11')]);}logger[_0xa2f3('0xf')](_0xa2f3('0xc'),_0x23b7dd,_0x11026f['error'][_0xa2f3('0x11')]);return _0x41b31d(_0x11026f[_0xa2f3('0xf')][_0xa2f3('0x11')]);}else{logger['info'](_0xa2f3('0xc'),_0x23b7dd,_0xa2f3('0xd'));_0x41b31d(_0x11026f['result'][_0xa2f3('0x11')]);}})[_0xa2f3('0x12')](function(_0x1e097c){logger[_0xa2f3('0xf')](_0xa2f3('0xc'),_0x23b7dd,_0x1e097c);_0x143b95(_0x1e097c);});});}exports[_0xa2f3('0x13')]=function(_0x13255b){var _0xe4bf8d=this;return new Promise(function(_0x519f3b,_0x173987){return db[_0xa2f3('0x14')][_0xa2f3('0x15')]({'raw':!![],'where':{'ContactId':_0x13255b[_0xa2f3('0x16')][_0xa2f3('0x17')],'ListId':_0x13255b[_0xa2f3('0x16')][_0xa2f3('0x18')],'VoiceQueueId':_0x13255b[_0xa2f3('0x16')][_0xa2f3('0x19')]===undefined?null:_0x13255b[_0xa2f3('0x16')][_0xa2f3('0x19')],'CampaignId':_0x13255b[_0xa2f3('0x16')][_0xa2f3('0x1a')]===undefined?null:_0x13255b[_0xa2f3('0x16')][_0xa2f3('0x1a')]}})['then'](function(_0x1faca5){if(_0x1faca5!=null){return db[_0xa2f3('0x1b')]['findOne']({'raw':!![],'where':{'CmHopperId':_0x1faca5['id'],'OrderBy':{'$gt':_0x1faca5[_0xa2f3('0x1c')]}},'order':[[_0xa2f3('0x1c'),_0xa2f3('0x1d')]]})['then'](function(_0xe32cdd){var _0x9b3fc6=0x0;if(_0xe32cdd){if(_0xe32cdd['countbusyretry']+_0xe32cdd[_0xa2f3('0x1e')]+_0xe32cdd['countnoanswerretry']+_0xe32cdd[_0xa2f3('0x1f')]+_0xe32cdd[_0xa2f3('0x20')]+_0xe32cdd[_0xa2f3('0x21')]+_0xe32cdd[_0xa2f3('0x22')]+_0xe32cdd[_0xa2f3('0x23')]<_0x13255b[_0xa2f3('0x24')][_0xa2f3('0x25')])_0x9b3fc6=0x1;_0x519f3b({'additional':_0x9b3fc6});}else{return db['CmHopperAdditionalPhone'][_0xa2f3('0x15')]({'raw':!![],'where':{'CmHopperId':_0x1faca5['id']},'order':[['OrderBy',_0xa2f3('0x1d')]]})[_0xa2f3('0xb')](function(_0x2a09e0){var _0x6b9f68=0x0;if(_0x2a09e0){if(_0x2a09e0[_0xa2f3('0x26')]+_0x2a09e0[_0xa2f3('0x1e')]+_0x2a09e0[_0xa2f3('0x27')]+_0x2a09e0[_0xa2f3('0x1f')]+_0x2a09e0[_0xa2f3('0x20')]+_0x2a09e0[_0xa2f3('0x21')]+_0x2a09e0[_0xa2f3('0x22')]+_0x2a09e0[_0xa2f3('0x23')]<_0x13255b[_0xa2f3('0x24')][_0xa2f3('0x25')])_0x6b9f68=0x1;_0x519f3b({'additional':_0x6b9f68});}else{_0x519f3b({'additional':0x0});}})[_0xa2f3('0x12')](function(_0x33d33d){logger['error'](_0xa2f3('0x13'),_0x33d33d[_0xa2f3('0x11')]);_0x173987(_0xe4bf8d[_0xa2f3('0xf')](0x1f4,_0x33d33d['message']));});}})[_0xa2f3('0x12')](function(_0x434a12){logger[_0xa2f3('0xf')]('VerifyAdditionalPhones',_0x434a12[_0xa2f3('0x11')]);_0x173987(_0xe4bf8d[_0xa2f3('0xf')](0x1f4,_0x434a12[_0xa2f3('0x11')]));});}else _0x519f3b({'additional':0x0});});});};exports['SwapAdditionalPhones']=function(_0x433bd8){var _0x54b278=this;return new Promise(function(_0x5335fe,_0x16962c){return db[_0xa2f3('0x14')][_0xa2f3('0x15')]({'raw':!![],'where':{'ContactId':_0x433bd8[_0xa2f3('0x16')]['ContactId'],'ListId':_0x433bd8[_0xa2f3('0x16')][_0xa2f3('0x18')],'VoiceQueueId':_0x433bd8[_0xa2f3('0x16')][_0xa2f3('0x19')]===undefined?null:_0x433bd8[_0xa2f3('0x16')][_0xa2f3('0x19')],'CampaignId':_0x433bd8[_0xa2f3('0x16')][_0xa2f3('0x1a')]===undefined?null:_0x433bd8['body'][_0xa2f3('0x1a')]}})[_0xa2f3('0xb')](function(_0x38c628){if(_0x38c628!=null){return db['CmHopperAdditionalPhone']['findOne']({'raw':!![],'where':{'CmHopperId':_0x38c628['id'],'OrderBy':{'$gte':_0x38c628[_0xa2f3('0x1c')]}},'order':[[_0xa2f3('0x1c'),'ASC']]})[_0xa2f3('0xb')](function(_0x4ec1ee){if(_0x4ec1ee)return activateAdditionalPhone(_0x38c628,_0x433bd8[_0xa2f3('0x16')],_0x4ec1ee,_0x433bd8['duration'],_0x433bd8['waitTime'])[_0xa2f3('0xb')](function(_0x27c3a7){_0x5335fe(_0x27c3a7);});else{return db['CmHopperAdditionalPhone'][_0xa2f3('0x15')]({'raw':!![],'where':{'CmHopperId':_0x38c628['id']},'order':[['OrderBy',_0xa2f3('0x1d')]]})[_0xa2f3('0xb')](function(_0x26a823){if(_0x26a823)return activateAdditionalPhone(_0x38c628,_0x433bd8[_0xa2f3('0x16')],_0x26a823,_0x433bd8[_0xa2f3('0x28')],_0x433bd8[_0xa2f3('0x29')])[_0xa2f3('0xb')](function(_0x2a534b){_0x5335fe(_0x2a534b);});else{_0x5335fe({'id':_0x38c628['id'],'phone':''});}})[_0xa2f3('0x12')](function(_0x39a588){logger[_0xa2f3('0xf')]('VerifyAdditionalPhones',_0x39a588[_0xa2f3('0x11')]);_0x16962c(_0x54b278[_0xa2f3('0xf')](0x1f4,_0x39a588[_0xa2f3('0x11')]));});}})[_0xa2f3('0x12')](function(_0x7a51c1){logger[_0xa2f3('0xf')](_0xa2f3('0x13'),_0x7a51c1[_0xa2f3('0x11')]);_0x16962c(_0x54b278[_0xa2f3('0xf')](0x1f4,_0x7a51c1[_0xa2f3('0x11')]));});}else _0x5335fe(0x1);});});};function activateAdditionalPhone(_0x23a410,_0x2335b3,_0x33f94d,_0x4db9f5,_0x12c715){return new Promise(function(_0xc823eb,_0x2f7e3b){var _0x3d9f7d;if(_[_0xa2f3('0x2a')](_0x33f94d['scheduledat'])){_0x33f94d[_0xa2f3('0x2b')]=moment();}if(moment()>moment(_0x33f94d[_0xa2f3('0x2b')])){_0x3d9f7d=moment()[_0xa2f3('0x2c')](_0x12c715||0x3,_0xa2f3('0x2d'));}else{if(_0x33f94d[_0xa2f3('0x1c')]==0x0){_0x3d9f7d=moment(_0x33f94d[_0xa2f3('0x2b')]);}else{_0x3d9f7d=moment()[_0xa2f3('0x2c')](_0x12c715||0x3,_0xa2f3('0x2d'));}}if(_['isNil'](_0x3d9f7d)){_0x3d9f7d=moment()[_0xa2f3('0x2c')](_0x12c715||0x3,_0xa2f3('0x2d'));}var _0x50df68={'phone':_0x23a410[_0xa2f3('0x2e')],'active':0x0,'OrderBy':_[_0xa2f3('0x2a')](_0x23a410[_0xa2f3('0x1c')])?0x0:_0x23a410['OrderBy'],'scheduledat':moment()[_0xa2f3('0x2c')](_0x4db9f5||0x1,_0xa2f3('0x2d')),'countbusyretry':_0x2335b3['countbusyretry'],'countcongestionretry':_0x2335b3[_0xa2f3('0x1e')],'countnoanswerretry':_0x2335b3['countnoanswerretry'],'countnosuchnumberretry':_0x2335b3[_0xa2f3('0x1f')],'countdropretry':_0x2335b3[_0xa2f3('0x20')],'countabandonedretry':_0x2335b3['countabandonedretry'],'countmachineretry':_0x2335b3['countmachineretry'],'countagentrejectretry':_0x2335b3[_0xa2f3('0x23')],'createdAt':_0x2335b3[_0xa2f3('0x2f')],'updatedAt':_0x2335b3[_0xa2f3('0x30')]};var _0x4e1d4f={'CmHopperId':_0x23a410['id'],'phone':_0x33f94d['phone'],'active':0x0,'OrderBy':_['isNil'](_0x33f94d[_0xa2f3('0x1c')])?0x0:_0x33f94d['OrderBy'],'scheduledat':_0x3d9f7d,'countbusyretry':_0x33f94d['countbusyretry'],'countcongestionretry':_0x33f94d[_0xa2f3('0x1e')],'countnoanswerretry':_0x33f94d[_0xa2f3('0x27')],'countnosuchnumberretry':_0x33f94d['countnosuchnumberretry'],'countdropretry':_0x33f94d[_0xa2f3('0x20')],'countabandonedretry':_0x33f94d['countabandonedretry'],'countmachineretry':_0x33f94d[_0xa2f3('0x22')],'countagentrejectretry':_0x33f94d[_0xa2f3('0x23')],'createdAt':_0x33f94d[_0xa2f3('0x2f')],'updatedAt':_0x33f94d['updatedAt']};return db['sequelize'][_0xa2f3('0x31')](function(_0x456af1){return db[_0xa2f3('0x1b')][_0xa2f3('0x32')](_0x50df68,{'where':{'id':_0x33f94d['id']}},{'transaction':_0x456af1})[_0xa2f3('0xb')](function(){return db[_0xa2f3('0x14')][_0xa2f3('0x32')](_0x4e1d4f,{'where':{'id':_0x23a410['id']}},{'transaction':_0x456af1});});})[_0xa2f3('0xb')](function(_0x10a0ba){_0xc823eb({'id':_0x23a410['id'],'phone':_0x33f94d[_0xa2f3('0x2e')]});})['catch'](function(_0x2aebc5){logger[_0xa2f3('0xf')](_0xa2f3('0x33'),_0x2aebc5[_0xa2f3('0x11')]);_0x2f7e3b({'error':_0x2aebc5[_0xa2f3('0x11')]});});});}exports['IncrementPreviewCounters']=function(_0x3e921d){var _0x73baf=this;return new Promise(function(_0xa863e7,_0x58335a){return db[_0xa2f3('0x14')]['update'](_0x3e921d[_0xa2f3('0x16')][_0xa2f3('0x34')],{'where':{'id':_0x3e921d[_0xa2f3('0x16')]['id']}})['then'](function(_0x317043){_0xa863e7(_0x317043);})['catch'](function(_0x52e271){logger[_0xa2f3('0xf')](_0xa2f3('0x35'),_0x52e271[_0xa2f3('0x11')]);_0x58335a(_0x73baf[_0xa2f3('0xf')](0x1f4,_0x52e271['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperAdditionalPhone/index.js b/server/api/cmHopperAdditionalPhone/index.js index d13629a..4717689 100644 --- a/server/api/cmHopperAdditionalPhone/index.js +++ b/server/api/cmHopperAdditionalPhone/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x55f4=['create','put','delete','util','path','connect-timeout','Router','fs-extra','./cmHopperAdditionalPhone.controller','get','isAuthenticated','/:id','show','post'];(function(_0x5cead4,_0x95c854){var _0x25c561=function(_0x564dec){while(--_0x564dec){_0x5cead4['push'](_0x5cead4['shift']());}};_0x25c561(++_0x95c854);}(_0x55f4,0x129));var _0x455f=function(_0x2e01e6,_0x53731d){_0x2e01e6=_0x2e01e6-0x0;var _0x3f00dd=_0x55f4[_0x2e01e6];return _0x3f00dd;};'use strict';var multer=require('multer');var util=require(_0x455f('0x0'));var path=require(_0x455f('0x1'));var timeout=require(_0x455f('0x2'));var express=require('express');var router=express[_0x455f('0x3')]();var fs_extra=require(_0x455f('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x455f('0x5'));router[_0x455f('0x6')]('/',auth[_0x455f('0x7')](),controller['index']);router['get'](_0x455f('0x8'),auth[_0x455f('0x7')](),controller[_0x455f('0x9')]);router[_0x455f('0xa')]('/',auth['isAuthenticated'](),controller[_0x455f('0xb')]);router[_0x455f('0xc')](_0x455f('0x8'),auth[_0x455f('0x7')](),controller['update']);router[_0x455f('0xd')](_0x455f('0x8'),auth[_0x455f('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x7f93=['delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperAdditionalPhone.controller','get','isAuthenticated','index','/:id','show','post','create','update'];(function(_0x364e79,_0x6e95d4){var _0x2221ef=function(_0x485f55){while(--_0x485f55){_0x364e79['push'](_0x364e79['shift']());}};_0x2221ef(++_0x6e95d4);}(_0x7f93,0x1a6));var _0x37f9=function(_0x4e9871,_0x2c3038){_0x4e9871=_0x4e9871-0x0;var _0x49372c=_0x7f93[_0x4e9871];return _0x49372c;};'use strict';var multer=require(_0x37f9('0x0'));var util=require(_0x37f9('0x1'));var path=require('path');var timeout=require(_0x37f9('0x2'));var express=require(_0x37f9('0x3'));var router=express[_0x37f9('0x4')]();var fs_extra=require(_0x37f9('0x5'));var auth=require(_0x37f9('0x6'));var interaction=require(_0x37f9('0x7'));var config=require(_0x37f9('0x8'));var controller=require(_0x37f9('0x9'));router[_0x37f9('0xa')]('/',auth[_0x37f9('0xb')](),controller[_0x37f9('0xc')]);router['get'](_0x37f9('0xd'),auth[_0x37f9('0xb')](),controller[_0x37f9('0xe')]);router[_0x37f9('0xf')]('/',auth['isAuthenticated'](),controller[_0x37f9('0x10')]);router['put']('/:id',auth[_0x37f9('0xb')](),controller[_0x37f9('0x11')]);router[_0x37f9('0x12')](_0x37f9('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x37f9('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 07e0e61..4a55a31 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 _0x3b1c=['sequelize','exports','STRING','contactListQueue','INTEGER','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3b1c,0xe9));var _0xc3b1=function(_0x5d3de6,_0x2dfe87){_0x5d3de6=_0x5d3de6-0x0;var _0x55b331=_0x3b1c[_0x5d3de6];return _0x55b331;};'use strict';var moment=require(_0xc3b1('0x0'));var Sequelize=require(_0xc3b1('0x1'));module[_0xc3b1('0x2')]={'phone':{'type':Sequelize[_0xc3b1('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xc3b1('0x4')},'ListId':{'type':Sequelize[_0xc3b1('0x5')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xc3b1('0x5')],'unique':_0xc3b1('0x4')}}; \ No newline at end of file +var _0x3468=['contactListQueue','moment','STRING','INTEGER'];(function(_0x263078,_0xdb379){var _0x238a95=function(_0x4bbba8){while(--_0x4bbba8){_0x263078['push'](_0x263078['shift']());}};_0x238a95(++_0xdb379);}(_0x3468,0x8d));var _0x8346=function(_0x4e2cd8,_0xdfb7ea){_0x4e2cd8=_0x4e2cd8-0x0;var _0x38bc0a=_0x3468[_0x4e2cd8];return _0x38bc0a;};'use strict';var moment=require(_0x8346('0x0'));var Sequelize=require('sequelize');module['exports']={'phone':{'type':Sequelize[_0x8346('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0x8346('0x2')],'unique':_0x8346('0x3')},'VoiceQueueId':{'type':Sequelize[_0x8346('0x2')],'unique':'contactListQueue'}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index e145807..a715526 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 _0x8c48=['Content-Range','apply','reject','save','update','error','stack','name','send','index','map','rawAttributes','type','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','CmHopperBlack','then','includeAll','findAll','rows','show','model','filters','include','options','find','catch','body','params','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set'];(function(_0x45411c,_0x424a3a){var _0x61af2d=function(_0x1ccadf){while(--_0x1ccadf){_0x45411c['push'](_0x45411c['shift']());}};_0x61af2d(++_0x424a3a);}(_0x8c48,0x7b));var _0x88c4=function(_0x28ad5b,_0x18078e){_0x28ad5b=_0x28ad5b-0x0;var _0x56f9b3=_0x8c48[_0x28ad5b];return _0x56f9b3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x88c4('0x0'));var zipdir=require(_0x88c4('0x1'));var jsonpatch=require(_0x88c4('0x2'));var rp=require(_0x88c4('0x3'));var moment=require(_0x88c4('0x4'));var BPromise=require(_0x88c4('0x5'));var Mustache=require(_0x88c4('0x6'));var util=require(_0x88c4('0x7'));var path=require('path');var sox=require(_0x88c4('0x8'));var csv=require(_0x88c4('0x9'));var ejs=require(_0x88c4('0xa'));var fs=require('fs');var fs_extra=require(_0x88c4('0xb'));var _=require(_0x88c4('0xc'));var squel=require(_0x88c4('0xd'));var crypto=require('crypto');var jsforce=require(_0x88c4('0xe'));var deskjs=require(_0x88c4('0xf'));var toCsv=require(_0x88c4('0x9'));var querystring=require('querystring');var Papa=require(_0x88c4('0x10'));var Redis=require(_0x88c4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x88c4('0x12'));var as=require(_0x88c4('0x13'));var hardwareService=require(_0x88c4('0x14'));var logger=require(_0x88c4('0x15'))(_0x88c4('0x16'));var utils=require(_0x88c4('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x88c4('0x18'));var db=require(_0x88c4('0x19'))['db'];function respondWithStatusCode(_0x1dc86c,_0x12e161){_0x12e161=_0x12e161||0xcc;return function(_0x5cf947){if(_0x5cf947){return _0x1dc86c[_0x88c4('0x1a')](_0x12e161);}return _0x1dc86c[_0x88c4('0x1b')](_0x12e161)[_0x88c4('0x1c')]();};}function respondWithResult(_0x3df3d3,_0x1c6677){_0x1c6677=_0x1c6677||0xc8;return function(_0x1076ca){if(_0x1076ca){return _0x3df3d3[_0x88c4('0x1b')](_0x1c6677)[_0x88c4('0x1d')](_0x1076ca);}};}function respondWithFilteredResult(_0x5ecd46,_0x105ac7){return function(_0x9d58cf){if(_0x9d58cf){var _0x2318ed=typeof _0x105ac7[_0x88c4('0x1e')]===_0x88c4('0x1f')&&typeof _0x105ac7['limit']==='undefined';var _0x2fbe46=_0x9d58cf[_0x88c4('0x20')];var _0x9d9511=_0x2318ed?0x0:_0x105ac7['offset'];var _0x796366=_0x2318ed?_0x9d58cf[_0x88c4('0x20')]:_0x105ac7[_0x88c4('0x1e')]+_0x105ac7[_0x88c4('0x21')];var _0x30049c;if(_0x796366>=_0x2fbe46){_0x796366=_0x2fbe46;_0x30049c=0xc8;}else{_0x30049c=0xce;}_0x5ecd46['status'](_0x30049c);return _0x5ecd46[_0x88c4('0x22')](_0x88c4('0x23'),_0x9d9511+'-'+_0x796366+'/'+_0x2fbe46)[_0x88c4('0x1d')](_0x9d58cf);}return null;};}function patchUpdates(_0x2738d3){return function(_0x3e7639){try{jsonpatch[_0x88c4('0x24')](_0x3e7639,_0x2738d3,!![]);}catch(_0x789cd){return BPromise[_0x88c4('0x25')](_0x789cd);}return _0x3e7639[_0x88c4('0x26')]();};}function saveUpdates(_0x5a573a,_0x2b0b86){return function(_0x47f072){if(_0x47f072){return _0x47f072[_0x88c4('0x27')](_0x5a573a)['then'](function(_0x32e35c){return _0x32e35c;});}return null;};}function removeEntity(_0x252143,_0x2e9324){return function(_0x5bc0b2){if(_0x5bc0b2){return _0x5bc0b2['destroy']()['then'](function(){_0x252143[_0x88c4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x647e76,_0xbb2c87){return function(_0x123724){if(!_0x123724){_0x647e76[_0x88c4('0x1a')](0x194);}return _0x123724;};}function handleError(_0x524fd1,_0x37e81a){_0x37e81a=_0x37e81a||0x1f4;return function(_0x1a9f52){logger[_0x88c4('0x28')](_0x1a9f52[_0x88c4('0x29')]);if(_0x1a9f52[_0x88c4('0x2a')]){delete _0x1a9f52[_0x88c4('0x2a')];}_0x524fd1[_0x88c4('0x1b')](_0x37e81a)[_0x88c4('0x2b')](_0x1a9f52);};}exports[_0x88c4('0x2c')]=function(_0x3df699,_0x5cd194){var _0x26a979={},_0x5331a7={},_0xa356cd={'count':0x0,'rows':[]};var _0x35c11f=_[_0x88c4('0x2d')](db['CmHopperBlack'][_0x88c4('0x2e')],function(_0x1f9b9b){return{'name':_0x1f9b9b['fieldName'],'type':_0x1f9b9b[_0x88c4('0x2f')]['key']};});_0x5331a7['model']=_[_0x88c4('0x2d')](_0x35c11f,_0x88c4('0x2a'));_0x5331a7['query']=_[_0x88c4('0x30')](_0x3df699[_0x88c4('0x31')]);_0x5331a7['filters']=_[_0x88c4('0x32')](_0x5331a7['model'],_0x5331a7[_0x88c4('0x31')]);_0x26a979[_0x88c4('0x33')]=_[_0x88c4('0x32')](_0x5331a7['model'],qs[_0x88c4('0x34')](_0x3df699['query'][_0x88c4('0x34')]));_0x26a979[_0x88c4('0x33')]=_0x26a979[_0x88c4('0x33')][_0x88c4('0x35')]?_0x26a979[_0x88c4('0x33')]:_0x5331a7['model'];if(!_0x3df699[_0x88c4('0x31')][_0x88c4('0x36')](_0x88c4('0x37'))){_0x26a979['limit']=qs[_0x88c4('0x21')](_0x3df699[_0x88c4('0x31')][_0x88c4('0x21')]);_0x26a979[_0x88c4('0x1e')]=qs[_0x88c4('0x1e')](_0x3df699[_0x88c4('0x31')][_0x88c4('0x1e')]);}_0x26a979[_0x88c4('0x38')]=qs[_0x88c4('0x39')](_0x3df699['query'][_0x88c4('0x39')]);_0x26a979[_0x88c4('0x3a')]=qs['filters'](_[_0x88c4('0x3b')](_0x3df699[_0x88c4('0x31')],_0x5331a7['filters']),_0x35c11f);if(_0x3df699[_0x88c4('0x31')][_0x88c4('0x3c')]){_0x26a979['where']=_['merge'](_0x26a979[_0x88c4('0x3a')],{'$or':_[_0x88c4('0x2d')](_0x35c11f,function(_0x4cca19){if(_0x4cca19[_0x88c4('0x2f')]!==_0x88c4('0x3d')){var _0xba9273={};_0xba9273[_0x4cca19['name']]={'$like':'%'+_0x3df699['query'][_0x88c4('0x3c')]+'%'};return _0xba9273;}})});}_0x26a979=_[_0x88c4('0x3e')]({},_0x26a979,_0x3df699['options']);var _0x252ca1={'where':_0x26a979['where']};return db[_0x88c4('0x3f')][_0x88c4('0x20')](_0x252ca1)[_0x88c4('0x40')](function(_0x1f6810){_0xa356cd[_0x88c4('0x20')]=_0x1f6810;if(_0x3df699[_0x88c4('0x31')][_0x88c4('0x41')]){_0x26a979['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x88c4('0x42')](_0x26a979);})[_0x88c4('0x40')](function(_0x518bb6){_0xa356cd[_0x88c4('0x43')]=_0x518bb6;return _0xa356cd;})['then'](respondWithFilteredResult(_0x5cd194,_0x26a979))['catch'](handleError(_0x5cd194,null));};exports[_0x88c4('0x44')]=function(_0x17795a,_0x1798e1){var _0x26b2ad={'raw':!![],'where':{'id':_0x17795a['params']['id']}},_0x5306ec={};_0x5306ec[_0x88c4('0x45')]=_[_0x88c4('0x30')](db[_0x88c4('0x3f')]['rawAttributes']);_0x5306ec['query']=_['keys'](_0x17795a['query']);_0x5306ec[_0x88c4('0x46')]=_[_0x88c4('0x32')](_0x5306ec[_0x88c4('0x45')],_0x5306ec[_0x88c4('0x31')]);_0x26b2ad[_0x88c4('0x33')]=_[_0x88c4('0x32')](_0x5306ec['model'],qs[_0x88c4('0x34')](_0x17795a[_0x88c4('0x31')][_0x88c4('0x34')]));_0x26b2ad[_0x88c4('0x33')]=_0x26b2ad[_0x88c4('0x33')]['length']?_0x26b2ad[_0x88c4('0x33')]:_0x5306ec[_0x88c4('0x45')];if(_0x17795a[_0x88c4('0x31')][_0x88c4('0x41')]){_0x26b2ad[_0x88c4('0x47')]=[{'all':!![]}];}_0x26b2ad=_[_0x88c4('0x3e')]({},_0x26b2ad,_0x17795a[_0x88c4('0x48')]);return db[_0x88c4('0x3f')][_0x88c4('0x49')](_0x26b2ad)[_0x88c4('0x40')](handleEntityNotFound(_0x1798e1,null))[_0x88c4('0x40')](respondWithResult(_0x1798e1,null))[_0x88c4('0x4a')](handleError(_0x1798e1,null));};exports[_0x88c4('0x27')]=function(_0x1b46ad,_0x4d9cb0){if(_0x1b46ad[_0x88c4('0x4b')]['id']){delete _0x1b46ad[_0x88c4('0x4b')]['id'];}return db[_0x88c4('0x3f')][_0x88c4('0x49')]({'where':{'id':_0x1b46ad[_0x88c4('0x4c')]['id']}})[_0x88c4('0x40')](handleEntityNotFound(_0x4d9cb0,null))[_0x88c4('0x40')](saveUpdates(_0x1b46ad[_0x88c4('0x4b')],null))[_0x88c4('0x40')](respondWithResult(_0x4d9cb0,null))[_0x88c4('0x4a')](handleError(_0x4d9cb0,null));};exports[_0x88c4('0x4d')]=function(_0x5c7299,_0xa2b1e9){return db['CmHopperBlack']['find']({'where':{'id':_0x5c7299[_0x88c4('0x4c')]['id']}})[_0x88c4('0x40')](handleEntityNotFound(_0xa2b1e9,null))['then'](removeEntity(_0xa2b1e9,null))[_0x88c4('0x4a')](handleError(_0xa2b1e9,null));};exports[_0x88c4('0x4e')]=function(_0x1e3587,_0x463e5c){return db['CmHopperBlack'][_0x88c4('0x4e')]()[_0x88c4('0x40')](respondWithResult(_0x463e5c,null))[_0x88c4('0x4a')](handleError(_0x463e5c,null));}; \ No newline at end of file +var _0x4d36=['limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filters','merge','filter','options','includeAll','findAll','rows','show','params','find','catch','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4d36,0x159));var _0x64d3=function(_0x4207f4,_0x1f778b){_0x4207f4=_0x4207f4-0x0;var _0x29a621=_0x4d36[_0x4207f4];return _0x29a621;};'use strict';var emlformat=require(_0x64d3('0x0'));var rimraf=require(_0x64d3('0x1'));var zipdir=require(_0x64d3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x64d3('0x3'));var moment=require(_0x64d3('0x4'));var BPromise=require(_0x64d3('0x5'));var Mustache=require(_0x64d3('0x6'));var util=require('util');var path=require(_0x64d3('0x7'));var sox=require(_0x64d3('0x8'));var csv=require(_0x64d3('0x9'));var ejs=require(_0x64d3('0xa'));var fs=require('fs');var fs_extra=require(_0x64d3('0xb'));var _=require(_0x64d3('0xc'));var squel=require(_0x64d3('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x64d3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x64d3('0xf'));var Papa=require(_0x64d3('0x10'));var Redis=require(_0x64d3('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x64d3('0x12'));var hardwareService=require(_0x64d3('0x13'));var logger=require(_0x64d3('0x14'))(_0x64d3('0x15'));var utils=require(_0x64d3('0x16'));var config=require(_0x64d3('0x17'));var licenseUtil=require(_0x64d3('0x18'));var db=require(_0x64d3('0x19'))['db'];function respondWithStatusCode(_0x1686cc,_0x28e3f2){_0x28e3f2=_0x28e3f2||0xcc;return function(_0x4caa41){if(_0x4caa41){return _0x1686cc['sendStatus'](_0x28e3f2);}return _0x1686cc['status'](_0x28e3f2)[_0x64d3('0x1a')]();};}function respondWithResult(_0x1de162,_0x1f59ab){_0x1f59ab=_0x1f59ab||0xc8;return function(_0x3802ea){if(_0x3802ea){return _0x1de162[_0x64d3('0x1b')](_0x1f59ab)[_0x64d3('0x1c')](_0x3802ea);}};}function respondWithFilteredResult(_0x2c0767,_0x5ace2a){return function(_0x4b362a){if(_0x4b362a){var _0x3f4fae=typeof _0x5ace2a[_0x64d3('0x1d')]==='undefined'&&typeof _0x5ace2a[_0x64d3('0x1e')]===_0x64d3('0x1f');var _0x297cfb=_0x4b362a[_0x64d3('0x20')];var _0x47d6cd=_0x3f4fae?0x0:_0x5ace2a[_0x64d3('0x1d')];var _0x279939=_0x3f4fae?_0x4b362a[_0x64d3('0x20')]:_0x5ace2a[_0x64d3('0x1d')]+_0x5ace2a[_0x64d3('0x1e')];var _0x17506e;if(_0x279939>=_0x297cfb){_0x279939=_0x297cfb;_0x17506e=0xc8;}else{_0x17506e=0xce;}_0x2c0767[_0x64d3('0x1b')](_0x17506e);return _0x2c0767[_0x64d3('0x21')](_0x64d3('0x22'),_0x47d6cd+'-'+_0x279939+'/'+_0x297cfb)[_0x64d3('0x1c')](_0x4b362a);}return null;};}function patchUpdates(_0x5e32b7){return function(_0x39174){try{jsonpatch[_0x64d3('0x23')](_0x39174,_0x5e32b7,!![]);}catch(_0x2e16a7){return BPromise[_0x64d3('0x24')](_0x2e16a7);}return _0x39174[_0x64d3('0x25')]();};}function saveUpdates(_0x553128,_0x11a429){return function(_0x44b8a3){if(_0x44b8a3){return _0x44b8a3[_0x64d3('0x26')](_0x553128)[_0x64d3('0x27')](function(_0x59c6d2){return _0x59c6d2;});}return null;};}function removeEntity(_0x1b5e84,_0x252b75){return function(_0x4b4fd3){if(_0x4b4fd3){return _0x4b4fd3[_0x64d3('0x28')]()['then'](function(){_0x1b5e84['status'](0xcc)[_0x64d3('0x1a')]();});}};}function handleEntityNotFound(_0x577c8b,_0x448246){return function(_0x2303b9){if(!_0x2303b9){_0x577c8b[_0x64d3('0x29')](0x194);}return _0x2303b9;};}function handleError(_0xe35229,_0x5134ee){_0x5134ee=_0x5134ee||0x1f4;return function(_0x478309){logger[_0x64d3('0x2a')](_0x478309['stack']);if(_0x478309[_0x64d3('0x2b')]){delete _0x478309[_0x64d3('0x2b')];}_0xe35229[_0x64d3('0x1b')](_0x5134ee)[_0x64d3('0x2c')](_0x478309);};}exports[_0x64d3('0x2d')]=function(_0x34b5b7,_0x3bd8f3){var _0x2364d7={},_0x57ffe5={},_0x324236={'count':0x0,'rows':[]};var _0x581391=_[_0x64d3('0x2e')](db[_0x64d3('0x2f')][_0x64d3('0x30')],function(_0xee39fe){return{'name':_0xee39fe[_0x64d3('0x31')],'type':_0xee39fe[_0x64d3('0x32')][_0x64d3('0x33')]};});_0x57ffe5['model']=_[_0x64d3('0x2e')](_0x581391,'name');_0x57ffe5[_0x64d3('0x34')]=_[_0x64d3('0x35')](_0x34b5b7['query']);_0x57ffe5['filters']=_[_0x64d3('0x36')](_0x57ffe5[_0x64d3('0x37')],_0x57ffe5[_0x64d3('0x34')]);_0x2364d7[_0x64d3('0x38')]=_[_0x64d3('0x36')](_0x57ffe5[_0x64d3('0x37')],qs['fields'](_0x34b5b7[_0x64d3('0x34')][_0x64d3('0x39')]));_0x2364d7['attributes']=_0x2364d7[_0x64d3('0x38')][_0x64d3('0x3a')]?_0x2364d7[_0x64d3('0x38')]:_0x57ffe5[_0x64d3('0x37')];if(!_0x34b5b7[_0x64d3('0x34')][_0x64d3('0x3b')]('nolimit')){_0x2364d7[_0x64d3('0x1e')]=qs[_0x64d3('0x1e')](_0x34b5b7['query'][_0x64d3('0x1e')]);_0x2364d7['offset']=qs[_0x64d3('0x1d')](_0x34b5b7[_0x64d3('0x34')][_0x64d3('0x1d')]);}_0x2364d7['order']=qs[_0x64d3('0x3c')](_0x34b5b7[_0x64d3('0x34')][_0x64d3('0x3c')]);_0x2364d7[_0x64d3('0x3d')]=qs[_0x64d3('0x3e')](_['pick'](_0x34b5b7[_0x64d3('0x34')],_0x57ffe5['filters']),_0x581391);if(_0x34b5b7['query']['filter']){_0x2364d7['where']=_[_0x64d3('0x3f')](_0x2364d7[_0x64d3('0x3d')],{'$or':_[_0x64d3('0x2e')](_0x581391,function(_0x40fe9d){if(_0x40fe9d[_0x64d3('0x32')]!=='VIRTUAL'){var _0x5d3c5e={};_0x5d3c5e[_0x40fe9d[_0x64d3('0x2b')]]={'$like':'%'+_0x34b5b7[_0x64d3('0x34')][_0x64d3('0x40')]+'%'};return _0x5d3c5e;}})});}_0x2364d7=_[_0x64d3('0x3f')]({},_0x2364d7,_0x34b5b7[_0x64d3('0x41')]);var _0x1564ec={'where':_0x2364d7[_0x64d3('0x3d')]};return db[_0x64d3('0x2f')]['count'](_0x1564ec)[_0x64d3('0x27')](function(_0x1d1bb1){_0x324236[_0x64d3('0x20')]=_0x1d1bb1;if(_0x34b5b7['query'][_0x64d3('0x42')]){_0x2364d7['include']=[{'all':!![]}];}return db[_0x64d3('0x2f')][_0x64d3('0x43')](_0x2364d7);})[_0x64d3('0x27')](function(_0x3bafd7){_0x324236[_0x64d3('0x44')]=_0x3bafd7;return _0x324236;})[_0x64d3('0x27')](respondWithFilteredResult(_0x3bd8f3,_0x2364d7))['catch'](handleError(_0x3bd8f3,null));};exports[_0x64d3('0x45')]=function(_0x45dc2b,_0x59a04e){var _0x501a14={'raw':!![],'where':{'id':_0x45dc2b[_0x64d3('0x46')]['id']}},_0x5d5dfe={};_0x5d5dfe[_0x64d3('0x37')]=_['keys'](db[_0x64d3('0x2f')][_0x64d3('0x30')]);_0x5d5dfe[_0x64d3('0x34')]=_[_0x64d3('0x35')](_0x45dc2b[_0x64d3('0x34')]);_0x5d5dfe['filters']=_[_0x64d3('0x36')](_0x5d5dfe[_0x64d3('0x37')],_0x5d5dfe[_0x64d3('0x34')]);_0x501a14[_0x64d3('0x38')]=_[_0x64d3('0x36')](_0x5d5dfe['model'],qs[_0x64d3('0x39')](_0x45dc2b['query']['fields']));_0x501a14[_0x64d3('0x38')]=_0x501a14[_0x64d3('0x38')][_0x64d3('0x3a')]?_0x501a14['attributes']:_0x5d5dfe[_0x64d3('0x37')];if(_0x45dc2b[_0x64d3('0x34')][_0x64d3('0x42')]){_0x501a14['include']=[{'all':!![]}];}_0x501a14=_[_0x64d3('0x3f')]({},_0x501a14,_0x45dc2b['options']);return db[_0x64d3('0x2f')][_0x64d3('0x47')](_0x501a14)[_0x64d3('0x27')](handleEntityNotFound(_0x59a04e,null))['then'](respondWithResult(_0x59a04e,null))[_0x64d3('0x48')](handleError(_0x59a04e,null));};exports[_0x64d3('0x26')]=function(_0x3716b4,_0x1970e6){if(_0x3716b4['body']['id']){delete _0x3716b4['body']['id'];}return db[_0x64d3('0x2f')]['find']({'where':{'id':_0x3716b4[_0x64d3('0x46')]['id']}})[_0x64d3('0x27')](handleEntityNotFound(_0x1970e6,null))[_0x64d3('0x27')](saveUpdates(_0x3716b4[_0x64d3('0x49')],null))[_0x64d3('0x27')](respondWithResult(_0x1970e6,null))[_0x64d3('0x48')](handleError(_0x1970e6,null));};exports['destroy']=function(_0x38d793,_0x30891d){return db[_0x64d3('0x2f')][_0x64d3('0x47')]({'where':{'id':_0x38d793[_0x64d3('0x46')]['id']}})['then'](handleEntityNotFound(_0x30891d,null))['then'](removeEntity(_0x30891d,null))[_0x64d3('0x48')](handleError(_0x30891d,null));};exports['describe']=function(_0x344f24,_0x2ab13c){return db[_0x64d3('0x2f')][_0x64d3('0x4a')]()['then'](respondWithResult(_0x2ab13c,null))[_0x64d3('0x48')](handleError(_0x2ab13c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index ca31190..3448d89 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 _0x9643=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','cm_hopper_black','lodash','util'];(function(_0x3fbc36,_0x4f3451){var _0xed45c6=function(_0x486713){while(--_0x486713){_0x3fbc36['push'](_0x3fbc36['shift']());}};_0xed45c6(++_0x4f3451);}(_0x9643,0x8e));var _0x3964=function(_0xcdcdf,_0x3c71b2){_0xcdcdf=_0xcdcdf-0x0;var _0x193b2a=_0x9643[_0xcdcdf];return _0x193b2a;};'use strict';var _=require(_0x3964('0x0'));var util=require(_0x3964('0x1'));var logger=require(_0x3964('0x2'))(_0x3964('0x3'));var moment=require('moment');var BPromise=require(_0x3964('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3964('0x5'));var rimraf=require(_0x3964('0x6'));var config=require(_0x3964('0x7'));var attributes=require(_0x3964('0x8'));module[_0x3964('0x9')]=function(_0x57c1eb,_0x563890){return _0x57c1eb[_0x3964('0xa')]('CmHopperBlack',attributes,{'tableName':_0x3964('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdde2=['api','moment','bluebird','request-promise','./cmHopperBlack.attributes','exports','define','cm_hopper_black','lodash','util','../../config/logger'];(function(_0x25b9f5,_0x259db4){var _0x2f81d0=function(_0x244b09){while(--_0x244b09){_0x25b9f5['push'](_0x25b9f5['shift']());}};_0x2f81d0(++_0x259db4);}(_0xdde2,0x11b));var _0x2dde=function(_0x19a669,_0x1719a8){_0x19a669=_0x19a669-0x0;var _0x4522bf=_0xdde2[_0x19a669];return _0x4522bf;};'use strict';var _=require(_0x2dde('0x0'));var util=require(_0x2dde('0x1'));var logger=require(_0x2dde('0x2'))(_0x2dde('0x3'));var moment=require(_0x2dde('0x4'));var BPromise=require(_0x2dde('0x5'));var rp=require(_0x2dde('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2dde('0x7'));module[_0x2dde('0x8')]=function(_0x32667b,_0x406cc9){return _0x32667b[_0x2dde('0x9')]('CmHopperBlack',attributes,{'tableName':_0x2dde('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index cd2642a..bbd2eb0 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 _0x5bdd=['../../mysqldb','../../config/utils','../../config/logger','client','http','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetCmHopperBlack','CmHopperBlack','options','where','attributes','limit','include','map','model','stringify','UpdateCmHopperBlack','DestroyCmHopperBlack','destroy','lodash','randomstring','ioredis'];(function(_0x3779c3,_0xf6b0db){var _0x4ee760=function(_0x497686){while(--_0x497686){_0x3779c3['push'](_0x3779c3['shift']());}};_0x4ee760(++_0xf6b0db);}(_0x5bdd,0x1af));var _0xd5bd=function(_0x3bd83b,_0x5b882b){_0x3bd83b=_0x3bd83b-0x0;var _0x4de274=_0x5bdd[_0x3bd83b];return _0x4de274;};'use strict';var _=require(_0xd5bd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd5bd('0x1'));var fs=require('fs');var Redis=require(_0xd5bd('0x2'));var db=require(_0xd5bd('0x3'))['db'];var utils=require(_0xd5bd('0x4'));var logger=require(_0xd5bd('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd5bd('0x6')][_0xd5bd('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1f836a,_0x28e70d,_0x4f913d){return new BPromise(function(_0x4e8a0d,_0x37df77){return client['request'](_0x1f836a,_0x4f913d)[_0xd5bd('0x8')](function(_0x54a6b0){logger[_0xd5bd('0x9')](_0xd5bd('0xa'),_0x28e70d,_0xd5bd('0xb'));logger[_0xd5bd('0xc')](_0xd5bd('0xd'),_0x28e70d,_0xd5bd('0xb'),JSON['stringify'](_0x54a6b0));if(_0x54a6b0['error']){if(_0x54a6b0[_0xd5bd('0xe')][_0xd5bd('0xf')]===0x1f4){logger[_0xd5bd('0xe')](_0xd5bd('0xa'),_0x28e70d,_0x54a6b0[_0xd5bd('0xe')]['message']);return _0x37df77(_0x54a6b0[_0xd5bd('0xe')][_0xd5bd('0x10')]);}logger[_0xd5bd('0xe')](_0xd5bd('0xa'),_0x28e70d,_0x54a6b0[_0xd5bd('0xe')][_0xd5bd('0x10')]);return _0x4e8a0d(_0x54a6b0[_0xd5bd('0xe')][_0xd5bd('0x10')]);}else{logger['info'](_0xd5bd('0xa'),_0x28e70d,_0xd5bd('0xb'));_0x4e8a0d(_0x54a6b0['result'][_0xd5bd('0x10')]);}})[_0xd5bd('0x11')](function(_0xdbb3f){logger[_0xd5bd('0xe')]('CmHopperBlack,\x20%s,\x20%s',_0x28e70d,_0xdbb3f);_0x37df77(_0xdbb3f);});});}exports[_0xd5bd('0x12')]=function(_0x3ec794){var _0x491825=this;return new Promise(function(_0x4a26b6,_0xbfb80e){return db[_0xd5bd('0x13')]['findAll']({'raw':_0x3ec794[_0xd5bd('0x14')]?_0x3ec794[_0xd5bd('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x3ec794[_0xd5bd('0x14')]?_0x3ec794['options'][_0xd5bd('0x15')]||null:null,'attributes':_0x3ec794[_0xd5bd('0x14')]?_0x3ec794['options'][_0xd5bd('0x16')]||null:null,'limit':_0x3ec794['options']?_0x3ec794[_0xd5bd('0x14')][_0xd5bd('0x17')]||null:null,'include':_0x3ec794['options']?_0x3ec794[_0xd5bd('0x14')][_0xd5bd('0x18')]?_[_0xd5bd('0x19')](_0x3ec794['options']['include'],function(_0x246774){return{'model':db[_0x246774[_0xd5bd('0x1a')]],'as':_0x246774['as'],'attributes':_0x246774[_0xd5bd('0x16')],'include':_0x246774[_0xd5bd('0x18')]?_[_0xd5bd('0x19')](_0x246774['include'],function(_0x23ca22){return{'model':db[_0x23ca22[_0xd5bd('0x1a')]],'as':_0x23ca22['as'],'attributes':_0x23ca22[_0xd5bd('0x16')],'include':_0x23ca22[_0xd5bd('0x18')]?_[_0xd5bd('0x19')](_0x23ca22[_0xd5bd('0x18')],function(_0x9578e6){return{'model':db[_0x9578e6['model']],'as':_0x9578e6['as'],'attributes':_0x9578e6[_0xd5bd('0x16')]};}):[]};}):[]};}):[]:[]})[_0xd5bd('0x8')](function(_0x522ce0){logger['info'](_0xd5bd('0x12'),_0x3ec794);logger[_0xd5bd('0xc')](_0xd5bd('0x12'),_0x3ec794,JSON[_0xd5bd('0x1b')](_0x522ce0));_0x4a26b6(_0x522ce0);})['catch'](function(_0x2bdb21){logger[_0xd5bd('0xe')](_0xd5bd('0x12'),_0x2bdb21[_0xd5bd('0x10')],_0x3ec794);_0xbfb80e(_0x491825[_0xd5bd('0xe')](0x1f4,_0x2bdb21[_0xd5bd('0x10')]));});});};exports[_0xd5bd('0x1c')]=function(_0x3e87f6){var _0x443cbb=this;return new Promise(function(_0x55c6c6,_0x3c24e6){return db[_0xd5bd('0x13')]['update'](_0x3e87f6['body'],{'raw':_0x3e87f6[_0xd5bd('0x14')]?_0x3e87f6[_0xd5bd('0x14')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e87f6[_0xd5bd('0x14')]?_0x3e87f6[_0xd5bd('0x14')]['where']||null:null,'attributes':_0x3e87f6[_0xd5bd('0x14')]?_0x3e87f6['options'][_0xd5bd('0x16')]||null:null,'limit':_0x3e87f6[_0xd5bd('0x14')]?_0x3e87f6[_0xd5bd('0x14')][_0xd5bd('0x17')]||null:null})[_0xd5bd('0x8')](function(_0x530a7c){logger[_0xd5bd('0x9')]('UpdateCmHopperBlack',_0x3e87f6);logger[_0xd5bd('0xc')](_0xd5bd('0x1c'),_0x3e87f6,JSON['stringify'](_0x530a7c));_0x55c6c6(_0x530a7c);})[_0xd5bd('0x11')](function(_0x19b737){logger[_0xd5bd('0xe')](_0xd5bd('0x1c'),_0x19b737[_0xd5bd('0x10')],_0x3e87f6);_0x3c24e6(_0x443cbb[_0xd5bd('0xe')](0x1f4,_0x19b737[_0xd5bd('0x10')]));});});};exports[_0xd5bd('0x1d')]=function(_0x29f216){var _0x495e37=this;return new Promise(function(_0x31b32f,_0x2b8853){return db['CmHopperBlack'][_0xd5bd('0x1e')]({'where':_0x29f216[_0xd5bd('0x14')]?_0x29f216['options'][_0xd5bd('0x15')]||null:null})[_0xd5bd('0x8')](function(_0x41efcd){logger['info'](_0xd5bd('0x1d'),_0x29f216);logger[_0xd5bd('0xc')](_0xd5bd('0x1d'),_0x29f216,JSON[_0xd5bd('0x1b')](_0x41efcd));_0x31b32f(_0x41efcd);})['catch'](function(_0x54e012){logger['error'](_0xd5bd('0x1d'),_0x54e012[_0xd5bd('0x10')],_0x29f216);_0x2b8853(_0x495e37[_0xd5bd('0xe')](0x1f4,_0x54e012['message']));});});}; \ No newline at end of file +var _0x909f=['model','UpdateCmHopperBlack','update','body','raw','where','then','stringify','DestroyCmHopperBlack','destroy','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','client','http','info','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','limit','include','attributes','map'];(function(_0x2e0a89,_0x2000f4){var _0x39b8dc=function(_0x50a48b){while(--_0x50a48b){_0x2e0a89['push'](_0x2e0a89['shift']());}};_0x39b8dc(++_0x2000f4);}(_0x909f,0x132));var _0xf909=function(_0x557c65,_0x3c1cfa){_0x557c65=_0x557c65-0x0;var _0x175c1b=_0x909f[_0x557c65];return _0x175c1b;};'use strict';var _=require(_0xf909('0x0'));var util=require('util');var moment=require(_0xf909('0x1'));var BPromise=require(_0xf909('0x2'));var rs=require(_0xf909('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf909('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf909('0x5'))(_0xf909('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf909('0x7')][_0xf909('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x91fb07,_0x10ce53,_0x232477){return new BPromise(function(_0x49e2db,_0x59e4fa){return client['request'](_0x91fb07,_0x232477)['then'](function(_0x49c12c){logger[_0xf909('0x9')](_0xf909('0xa'),_0x10ce53,'request\x20sent');logger[_0xf909('0xb')](_0xf909('0xc'),_0x10ce53,_0xf909('0xd'),JSON['stringify'](_0x49c12c));if(_0x49c12c[_0xf909('0xe')]){if(_0x49c12c[_0xf909('0xe')][_0xf909('0xf')]===0x1f4){logger[_0xf909('0xe')](_0xf909('0xa'),_0x10ce53,_0x49c12c[_0xf909('0xe')]['message']);return _0x59e4fa(_0x49c12c[_0xf909('0xe')][_0xf909('0x10')]);}logger['error'](_0xf909('0xa'),_0x10ce53,_0x49c12c['error']['message']);return _0x49e2db(_0x49c12c[_0xf909('0xe')][_0xf909('0x10')]);}else{logger[_0xf909('0x9')]('CmHopperBlack,\x20%s,\x20%s',_0x10ce53,'request\x20sent');_0x49e2db(_0x49c12c[_0xf909('0x11')][_0xf909('0x10')]);}})[_0xf909('0x12')](function(_0x2258fb){logger[_0xf909('0xe')](_0xf909('0xa'),_0x10ce53,_0x2258fb);_0x59e4fa(_0x2258fb);});});}exports[_0xf909('0x13')]=function(_0x574fad){var _0x1c712=this;return new Promise(function(_0xb52db1,_0x4f67d4){return db[_0xf909('0x14')][_0xf909('0x15')]({'raw':_0x574fad[_0xf909('0x16')]?_0x574fad[_0xf909('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x574fad[_0xf909('0x16')]?_0x574fad[_0xf909('0x16')]['where']||null:null,'attributes':_0x574fad[_0xf909('0x16')]?_0x574fad[_0xf909('0x16')]['attributes']||null:null,'limit':_0x574fad[_0xf909('0x16')]?_0x574fad[_0xf909('0x16')][_0xf909('0x17')]||null:null,'include':_0x574fad[_0xf909('0x16')]?_0x574fad['options'][_0xf909('0x18')]?_['map'](_0x574fad[_0xf909('0x16')][_0xf909('0x18')],function(_0x75c3e7){return{'model':db[_0x75c3e7['model']],'as':_0x75c3e7['as'],'attributes':_0x75c3e7[_0xf909('0x19')],'include':_0x75c3e7[_0xf909('0x18')]?_[_0xf909('0x1a')](_0x75c3e7['include'],function(_0x5d45ee){return{'model':db[_0x5d45ee[_0xf909('0x1b')]],'as':_0x5d45ee['as'],'attributes':_0x5d45ee[_0xf909('0x19')],'include':_0x5d45ee[_0xf909('0x18')]?_[_0xf909('0x1a')](_0x5d45ee[_0xf909('0x18')],function(_0x3da19a){return{'model':db[_0x3da19a[_0xf909('0x1b')]],'as':_0x3da19a['as'],'attributes':_0x3da19a[_0xf909('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x583a6b){logger[_0xf909('0x9')](_0xf909('0x13'),_0x574fad);logger[_0xf909('0xb')]('GetCmHopperBlack',_0x574fad,JSON['stringify'](_0x583a6b));_0xb52db1(_0x583a6b);})['catch'](function(_0x36e2c0){logger['error'](_0xf909('0x13'),_0x36e2c0[_0xf909('0x10')],_0x574fad);_0x4f67d4(_0x1c712[_0xf909('0xe')](0x1f4,_0x36e2c0[_0xf909('0x10')]));});});};exports[_0xf909('0x1c')]=function(_0x1e51a3){var _0x187778=this;return new Promise(function(_0x3d30a8,_0x5673dd){return db[_0xf909('0x14')][_0xf909('0x1d')](_0x1e51a3[_0xf909('0x1e')],{'raw':_0x1e51a3[_0xf909('0x16')]?_0x1e51a3[_0xf909('0x16')][_0xf909('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e51a3[_0xf909('0x16')]?_0x1e51a3[_0xf909('0x16')][_0xf909('0x20')]||null:null,'attributes':_0x1e51a3[_0xf909('0x16')]?_0x1e51a3[_0xf909('0x16')][_0xf909('0x19')]||null:null,'limit':_0x1e51a3[_0xf909('0x16')]?_0x1e51a3[_0xf909('0x16')][_0xf909('0x17')]||null:null})[_0xf909('0x21')](function(_0x3a66e1){logger[_0xf909('0x9')](_0xf909('0x1c'),_0x1e51a3);logger[_0xf909('0xb')](_0xf909('0x1c'),_0x1e51a3,JSON[_0xf909('0x22')](_0x3a66e1));_0x3d30a8(_0x3a66e1);})['catch'](function(_0xf68762){logger[_0xf909('0xe')](_0xf909('0x1c'),_0xf68762[_0xf909('0x10')],_0x1e51a3);_0x5673dd(_0x187778[_0xf909('0xe')](0x1f4,_0xf68762[_0xf909('0x10')]));});});};exports[_0xf909('0x23')]=function(_0x171fda){var _0x5af643=this;return new Promise(function(_0x361402,_0x58cd31){return db[_0xf909('0x14')][_0xf909('0x24')]({'where':_0x171fda[_0xf909('0x16')]?_0x171fda['options'][_0xf909('0x20')]||null:null})['then'](function(_0x5323d2){logger['info'](_0xf909('0x23'),_0x171fda);logger[_0xf909('0xb')](_0xf909('0x23'),_0x171fda,JSON['stringify'](_0x5323d2));_0x361402(_0x5323d2);})[_0xf909('0x12')](function(_0x18d08d){logger[_0xf909('0xe')](_0xf909('0x23'),_0x18d08d[_0xf909('0x10')],_0x171fda);_0x58cd31(_0x5af643[_0xf909('0xe')](0x1f4,_0x18d08d[_0xf909('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index b3a4e24..5c14dea 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 _0x5162=['/:id','show','update','exports','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','/describe','isAuthenticated','describe'];(function(_0x258532,_0x704f6b){var _0x8cd3e0=function(_0x502e4d){while(--_0x502e4d){_0x258532['push'](_0x258532['shift']());}};_0x8cd3e0(++_0x704f6b);}(_0x5162,0x103));var _0x2516=function(_0x1ec65c,_0x354923){_0x1ec65c=_0x1ec65c-0x0;var _0x5249c2=_0x5162[_0x1ec65c];return _0x5249c2;};'use strict';var multer=require(_0x2516('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2516('0x1')]();var fs_extra=require(_0x2516('0x2'));var auth=require(_0x2516('0x3'));var interaction=require(_0x2516('0x4'));var config=require(_0x2516('0x5'));var controller=require(_0x2516('0x6'));router[_0x2516('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2516('0x8'),auth[_0x2516('0x9')](),controller[_0x2516('0xa')]);router[_0x2516('0x7')](_0x2516('0xb'),auth[_0x2516('0x9')](),controller[_0x2516('0xc')]);router['put'](_0x2516('0xb'),auth[_0x2516('0x9')](),controller[_0x2516('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x2516('0xe')]=router; \ No newline at end of file +var _0x4fb4=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','show','put','/:id','update','delete','destroy'];(function(_0x459d7d,_0x55db19){var _0x26abf1=function(_0x39e5d5){while(--_0x39e5d5){_0x459d7d['push'](_0x459d7d['shift']());}};_0x26abf1(++_0x55db19);}(_0x4fb4,0x190));var _0x44fb=function(_0x40207e,_0x2c1e14){_0x40207e=_0x40207e-0x0;var _0x51cc73=_0x4fb4[_0x40207e];return _0x51cc73;};'use strict';var multer=require('multer');var util=require(_0x44fb('0x0'));var path=require(_0x44fb('0x1'));var timeout=require(_0x44fb('0x2'));var express=require(_0x44fb('0x3'));var router=express[_0x44fb('0x4')]();var fs_extra=require(_0x44fb('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x44fb('0x6'));var config=require(_0x44fb('0x7'));var controller=require(_0x44fb('0x8'));router[_0x44fb('0x9')]('/',auth[_0x44fb('0xa')](),controller[_0x44fb('0xb')]);router[_0x44fb('0x9')](_0x44fb('0xc'),auth['isAuthenticated'](),controller[_0x44fb('0xd')]);router[_0x44fb('0x9')]('/:id',auth[_0x44fb('0xa')](),controller[_0x44fb('0xe')]);router[_0x44fb('0xf')](_0x44fb('0x10'),auth[_0x44fb('0xa')](),controller[_0x44fb('0x11')]);router[_0x44fb('0x12')](_0x44fb('0x10'),auth[_0x44fb('0xa')](),controller[_0x44fb('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index b302647..1379578 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 _0xb9b1=['moment','exports','INTEGER','STRING','DATE','getDataValue','endtime','followuptime','BOOLEAN','sequelize'];(function(_0x490249,_0x4c01a1){var _0x5c6453=function(_0x5ec246){while(--_0x5ec246){_0x490249['push'](_0x490249['shift']());}};_0x5c6453(++_0x4c01a1);}(_0xb9b1,0xb3));var _0x1b9b=function(_0x2a4f5b,_0x11bd88){_0x2a4f5b=_0x2a4f5b-0x0;var _0x501954=_0xb9b1[_0x2a4f5b];return _0x501954;};'use strict';var Sequelize=require(_0x1b9b('0x0'));var moment=require(_0x1b9b('0x1'));module[_0x1b9b('0x2')]={'state':{'type':Sequelize[_0x1b9b('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x1b9b('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1b9b('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x1b9b('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1b9b('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x1b9b('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x1b9b('0x5')]},'responsetime':{'type':Sequelize[_0x1b9b('0x5')]},'answertime':{'type':Sequelize[_0x1b9b('0x5')]},'droptime':{'type':Sequelize[_0x1b9b('0x5')]},'endtime':{'type':Sequelize[_0x1b9b('0x5')]},'ringtime':{'type':Sequelize[_0x1b9b('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x1b9b('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1b9b('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1b9b('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x1b9b('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x1b9b('0x4')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x1b9b('0x4')]},'disposition':{'type':Sequelize[_0x1b9b('0x4')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x1b9b('0x4')]},'dispositionat':{'type':Sequelize[_0x1b9b('0x5')],'set':function(_0x21a1d7){var _0x104ff7=this[_0x1b9b('0x6')](_0x1b9b('0x7'));if(_0x104ff7&&_0x21a1d7){this['setDataValue'](_0x1b9b('0x8'),moment(_0x21a1d7)['diff'](moment(_0x104ff7),'seconds'));}}},'amd':{'type':Sequelize[_0x1b9b('0x9')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x1b9b('0x9')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x1b9b('0x9')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x1b9b('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1b9b('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1b9b('0x5')]},'deleted':{'type':Sequelize[_0x1b9b('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x1b9b('0x5')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x1b9b('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x1b9b('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1b9b('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1b9b('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1b9b('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1b9b('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3718=['exports','INTEGER','STRING','DATE','endtime','followuptime','diff','seconds','BOOLEAN','sequelize','moment'];(function(_0x55d8c5,_0x10287a){var _0x225ae5=function(_0x2ba03a){while(--_0x2ba03a){_0x55d8c5['push'](_0x55d8c5['shift']());}};_0x225ae5(++_0x10287a);}(_0x3718,0x1a0));var _0x8371=function(_0x2620d2,_0x3dd51a){_0x2620d2=_0x2620d2-0x0;var _0x2e37f1=_0x3718[_0x2620d2];return _0x2e37f1;};'use strict';var Sequelize=require(_0x8371('0x0'));var moment=require(_0x8371('0x1'));module[_0x8371('0x2')]={'state':{'type':Sequelize[_0x8371('0x3')](0x2)},'statedesc':{'type':Sequelize[_0x8371('0x4')]},'scheduledat':{'type':Sequelize[_0x8371('0x5')]},'countbusyretry':{'type':Sequelize[_0x8371('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8371('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x8371('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x8371('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x8371('0x4')]},'originatecalleridname':{'type':Sequelize[_0x8371('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8371('0x4')]},'starttime':{'type':Sequelize[_0x8371('0x5')]},'responsetime':{'type':Sequelize[_0x8371('0x5')]},'answertime':{'type':Sequelize[_0x8371('0x5')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x8371('0x5')]},'ringtime':{'type':Sequelize[_0x8371('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x8371('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x8371('0x4')]},'campaigntype':{'type':Sequelize[_0x8371('0x4')]},'membername':{'type':Sequelize[_0x8371('0x4')]},'reason':{'type':Sequelize[_0x8371('0x4')]},'disposition':{'type':Sequelize[_0x8371('0x4')]},'secondDisposition':{'type':Sequelize[_0x8371('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x8371('0x5')],'set':function(_0x55940f){var _0xf4ffbb=this['getDataValue'](_0x8371('0x6'));if(_0xf4ffbb&&_0x55940f){this['setDataValue'](_0x8371('0x7'),moment(_0x55940f)[_0x8371('0x8')](moment(_0xf4ffbb),_0x8371('0x9')));}}},'amd':{'type':Sequelize[_0x8371('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0x8371('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x8371('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x8371('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x8371('0x5')]},'callback':{'type':Sequelize[_0x8371('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x8371('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0x8371('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x8371('0x5')]},'recallme':{'type':Sequelize[_0x8371('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x8371('0x5')]},'countnosuchnumberretry':{'type':Sequelize[_0x8371('0x3')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x8371('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x8371('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x8371('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x8371('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 76de23c..f6f5977 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 _0x2542=['Content-Range','apply','update','then','error','stack','name','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','describe','body','uniqueid','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','abandonedContacts','VoiceQueue','into','fromQuery','phone','ListId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','scheduledAt','ContactId','ANY_VALUE(ListId)','NOW()','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','cm_hopper','state\x20=\x204','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set'];(function(_0x14653a,_0x2851cd){var _0x451eb1=function(_0x58d25d){while(--_0x58d25d){_0x14653a['push'](_0x14653a['shift']());}};_0x451eb1(++_0x2851cd);}(_0x2542,0x169));var _0x2254=function(_0xe7eb9,_0x256394){_0xe7eb9=_0xe7eb9-0x0;var _0xd7e40d=_0x2542[_0xe7eb9];return _0xd7e40d;};'use strict';var emlformat=require(_0x2254('0x0'));var rimraf=require(_0x2254('0x1'));var zipdir=require(_0x2254('0x2'));var jsonpatch=require(_0x2254('0x3'));var rp=require('request-promise');var moment=require(_0x2254('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2254('0x5'));var util=require(_0x2254('0x6'));var path=require(_0x2254('0x7'));var sox=require(_0x2254('0x8'));var csv=require(_0x2254('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2254('0xa'));var _=require(_0x2254('0xb'));var squel=require(_0x2254('0xc'));var crypto=require(_0x2254('0xd'));var jsforce=require(_0x2254('0xe'));var deskjs=require(_0x2254('0xf'));var toCsv=require(_0x2254('0x9'));var querystring=require(_0x2254('0x10'));var Papa=require(_0x2254('0x11'));var Redis=require(_0x2254('0x12'));var authService=require(_0x2254('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2254('0x14'));var hardwareService=require(_0x2254('0x15'));var logger=require(_0x2254('0x16'))(_0x2254('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2254('0x18'));var db=require(_0x2254('0x19'))['db'];function respondWithStatusCode(_0x116b70,_0xdcb670){_0xdcb670=_0xdcb670||0xcc;return function(_0x3c326b){if(_0x3c326b){return _0x116b70[_0x2254('0x1a')](_0xdcb670);}return _0x116b70['status'](_0xdcb670)[_0x2254('0x1b')]();};}function respondWithResult(_0x7c7ab0,_0x504749){_0x504749=_0x504749||0xc8;return function(_0x2f4de){if(_0x2f4de){return _0x7c7ab0[_0x2254('0x1c')](_0x504749)[_0x2254('0x1d')](_0x2f4de);}};}function respondWithFilteredResult(_0x145272,_0x26285a){return function(_0xbc5548){if(_0xbc5548){var _0x50f137=typeof _0x26285a[_0x2254('0x1e')]==='undefined'&&typeof _0x26285a[_0x2254('0x1f')]===_0x2254('0x20');var _0x170ffa=_0xbc5548[_0x2254('0x21')];var _0x1ae11e=_0x50f137?0x0:_0x26285a[_0x2254('0x1e')];var _0x497724=_0x50f137?_0xbc5548['count']:_0x26285a['offset']+_0x26285a[_0x2254('0x1f')];var _0x3a79f8;if(_0x497724>=_0x170ffa){_0x497724=_0x170ffa;_0x3a79f8=0xc8;}else{_0x3a79f8=0xce;}_0x145272[_0x2254('0x1c')](_0x3a79f8);return _0x145272[_0x2254('0x22')](_0x2254('0x23'),_0x1ae11e+'-'+_0x497724+'/'+_0x170ffa)[_0x2254('0x1d')](_0xbc5548);}return null;};}function patchUpdates(_0x487f72){return function(_0x28381e){try{jsonpatch[_0x2254('0x24')](_0x28381e,_0x487f72,!![]);}catch(_0x906cde){return BPromise['reject'](_0x906cde);}return _0x28381e['save']();};}function saveUpdates(_0x5bd982,_0x1e8a98){return function(_0x559af4){if(_0x559af4){return _0x559af4[_0x2254('0x25')](_0x5bd982)['then'](function(_0x5713e4){return _0x5713e4;});}return null;};}function removeEntity(_0x4d8faf,_0x540020){return function(_0x5e5edb){if(_0x5e5edb){return _0x5e5edb['destroy']()[_0x2254('0x26')](function(){_0x4d8faf[_0x2254('0x1c')](0xcc)[_0x2254('0x1b')]();});}};}function handleEntityNotFound(_0x265467,_0x13522d){return function(_0x1349c9){if(!_0x1349c9){_0x265467['sendStatus'](0x194);}return _0x1349c9;};}function handleError(_0x4a8274,_0x1ada42){_0x1ada42=_0x1ada42||0x1f4;return function(_0x4f6877){logger[_0x2254('0x27')](_0x4f6877[_0x2254('0x28')]);if(_0x4f6877[_0x2254('0x29')]){delete _0x4f6877[_0x2254('0x29')];}_0x4a8274[_0x2254('0x1c')](_0x1ada42)['send'](_0x4f6877);};}exports[_0x2254('0x2a')]=function(_0x2a789b,_0x21285d){var _0x37af8b={},_0x13366a={},_0x377c41={'count':0x0,'rows':[]};var _0x3214a7=_[_0x2254('0x2b')](db[_0x2254('0x2c')][_0x2254('0x2d')],function(_0x21c641){return{'name':_0x21c641[_0x2254('0x2e')],'type':_0x21c641[_0x2254('0x2f')][_0x2254('0x30')]};});_0x13366a[_0x2254('0x31')]=_[_0x2254('0x2b')](_0x3214a7,_0x2254('0x29'));_0x13366a[_0x2254('0x32')]=_[_0x2254('0x33')](_0x2a789b['query']);_0x13366a[_0x2254('0x34')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],_0x13366a[_0x2254('0x32')]);_0x37af8b[_0x2254('0x36')]=_[_0x2254('0x35')](_0x13366a[_0x2254('0x31')],qs[_0x2254('0x37')](_0x2a789b[_0x2254('0x32')]['fields']));_0x37af8b[_0x2254('0x36')]=_0x37af8b[_0x2254('0x36')]['length']?_0x37af8b[_0x2254('0x36')]:_0x13366a[_0x2254('0x31')];if(!_0x2a789b[_0x2254('0x32')][_0x2254('0x38')]('nolimit')){_0x37af8b['limit']=qs[_0x2254('0x1f')](_0x2a789b['query'][_0x2254('0x1f')]);_0x37af8b[_0x2254('0x1e')]=qs[_0x2254('0x1e')](_0x2a789b[_0x2254('0x32')][_0x2254('0x1e')]);}_0x37af8b[_0x2254('0x39')]=qs[_0x2254('0x3a')](_0x2a789b['query'][_0x2254('0x3a')]);_0x37af8b[_0x2254('0x3b')]=qs[_0x2254('0x34')](_[_0x2254('0x3c')](_0x2a789b[_0x2254('0x32')],_0x13366a[_0x2254('0x34')]),_0x3214a7);if(_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]){_0x37af8b[_0x2254('0x3b')]=_[_0x2254('0x3e')](_0x37af8b['where'],{'$or':_[_0x2254('0x2b')](_0x3214a7,function(_0xde3e4a){if(_0xde3e4a[_0x2254('0x2f')]!==_0x2254('0x3f')){var _0x4c7cc3={};_0x4c7cc3[_0xde3e4a[_0x2254('0x29')]]={'$like':'%'+_0x2a789b[_0x2254('0x32')][_0x2254('0x3d')]+'%'};return _0x4c7cc3;}})});}_0x37af8b=_[_0x2254('0x3e')]({},_0x37af8b,_0x2a789b[_0x2254('0x40')]);var _0x2602db={'where':_0x37af8b[_0x2254('0x3b')]};return db[_0x2254('0x2c')]['count'](_0x2602db)[_0x2254('0x26')](function(_0x5c15d7){_0x377c41[_0x2254('0x21')]=_0x5c15d7;if(_0x2a789b[_0x2254('0x32')][_0x2254('0x41')]){_0x37af8b[_0x2254('0x42')]=[{'all':!![]}];}return db[_0x2254('0x2c')][_0x2254('0x43')](_0x37af8b);})[_0x2254('0x26')](function(_0x568ec9){_0x377c41[_0x2254('0x44')]=_0x568ec9;return _0x377c41;})[_0x2254('0x26')](respondWithFilteredResult(_0x21285d,_0x37af8b))[_0x2254('0x45')](handleError(_0x21285d,null));};exports[_0x2254('0x46')]=function(_0x40d4da,_0x57cda2){var _0x22bb98={'raw':!![],'where':{'id':_0x40d4da[_0x2254('0x47')]['id']}},_0x1dec43={};_0x1dec43[_0x2254('0x31')]=_[_0x2254('0x33')](db['CmHopperFinal'][_0x2254('0x2d')]);_0x1dec43['query']=_[_0x2254('0x33')](_0x40d4da[_0x2254('0x32')]);_0x1dec43[_0x2254('0x34')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],_0x1dec43[_0x2254('0x32')]);_0x22bb98[_0x2254('0x36')]=_[_0x2254('0x35')](_0x1dec43[_0x2254('0x31')],qs[_0x2254('0x37')](_0x40d4da[_0x2254('0x32')][_0x2254('0x37')]));_0x22bb98[_0x2254('0x36')]=_0x22bb98['attributes'][_0x2254('0x48')]?_0x22bb98[_0x2254('0x36')]:_0x1dec43[_0x2254('0x31')];if(_0x40d4da['query'][_0x2254('0x41')]){_0x22bb98[_0x2254('0x42')]=[{'all':!![]}];}_0x22bb98=_[_0x2254('0x3e')]({},_0x22bb98,_0x40d4da[_0x2254('0x40')]);return db[_0x2254('0x2c')][_0x2254('0x49')](_0x22bb98)[_0x2254('0x26')](handleEntityNotFound(_0x57cda2,null))[_0x2254('0x26')](respondWithResult(_0x57cda2,null))[_0x2254('0x45')](handleError(_0x57cda2,null));};exports['describe']=function(_0x239ba0,_0x405eb2){return db[_0x2254('0x2c')][_0x2254('0x4a')]()[_0x2254('0x26')](respondWithResult(_0x405eb2,null))[_0x2254('0x45')](handleError(_0x405eb2,null));};exports[_0x2254('0x25')]=function(_0x438922,_0x3ac691){if(_0x438922[_0x2254('0x4b')]['uniqueid']){delete _0x438922[_0x2254('0x4b')][_0x2254('0x4c')];}return db['CmHopperFinal'][_0x2254('0x49')]({'where':{'uniqueid':_0x438922[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0x3ac691,null))[_0x2254('0x26')](saveUpdates(_0x438922['body'],null))[_0x2254('0x26')](respondWithResult(_0x3ac691,null))[_0x2254('0x45')](handleError(_0x3ac691,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x26d01a,_0x3f0670,_0x23014b){return db[_0x2254('0x2c')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x26d01a[_0x2254('0x47')]['id']},'attributes':[[db[_0x2254('0x4d')]['fn'](_0x2254('0x4e'),db['sequelize']['fn']('IF',db['sequelize'][_0x2254('0x4f')](_0x2254('0x50')))),'noSuchContacts'],[db[_0x2254('0x4d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')](_0x2254('0x51')))),_0x2254('0x52')],[db[_0x2254('0x4d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2254('0x4d')]['literal'](_0x2254('0x53')))),_0x2254('0x54')],[db[_0x2254('0x4d')]['fn'](_0x2254('0x4e'),db['sequelize']['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x2254('0x4d')]['fn']('COUNT',db[_0x2254('0x4d')]['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')](_0x2254('0x55')))),_0x2254('0x56')],[db['sequelize']['fn']('COUNT',db[_0x2254('0x4d')]['fn']('IF',db['sequelize'][_0x2254('0x4f')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn'](_0x2254('0x4e'),db[_0x2254('0x4d')]['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')](_0x2254('0x57')))),_0x2254('0x58')],[db[_0x2254('0x4d')]['fn'](_0x2254('0x4e'),db[_0x2254('0x4d')]['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')](_0x2254('0x59')))),_0x2254('0x5a')]]})[_0x2254('0x26')](handleEntityNotFound(_0x3f0670,null))[_0x2254('0x26')](respondWithResult(_0x3f0670,null))[_0x2254('0x45')](handleError(_0x3f0670,null));};exports[_0x2254('0x5b')]=function(_0x399ba2,_0x179cf1,_0x5b8909){return db[_0x2254('0x2c')][_0x2254('0x43')]({'raw':![],'where':{'CampaignId':_0x399ba2[_0x2254('0x47')]['id']},'attributes':[[db[_0x2254('0x4d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')](_0x2254('0x50')))),_0x2254('0x5c')],[db[_0x2254('0x4d')]['fn']('COUNT',db[_0x2254('0x4d')]['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')]('`state`\x20=\x203,\x201,\x20null'))),'noAnswerContacts'],[db[_0x2254('0x4d')]['fn']('COUNT',db[_0x2254('0x4d')]['fn']('IF',db[_0x2254('0x4d')]['literal'](_0x2254('0x53')))),_0x2254('0x54')],[db['sequelize']['fn'](_0x2254('0x4e'),db[_0x2254('0x4d')]['fn']('IF',db['sequelize']['literal'](_0x2254('0x5d')))),_0x2254('0x5e')],[db['sequelize']['fn']('COUNT',db[_0x2254('0x4d')]['fn']('IF',db['sequelize'][_0x2254('0x4f')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x2254('0x56')],[db[_0x2254('0x4d')]['fn'](_0x2254('0x4e'),db[_0x2254('0x4d')]['fn']('IF',db['sequelize'][_0x2254('0x4f')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x2254('0x5f')],[db[_0x2254('0x4d')]['fn']('COUNT',db[_0x2254('0x4d')]['fn']('IF',db[_0x2254('0x4d')]['literal'](_0x2254('0x57')))),_0x2254('0x58')],[db[_0x2254('0x4d')]['fn'](_0x2254('0x4e'),db['sequelize']['fn']('IF',db[_0x2254('0x4d')][_0x2254('0x4f')]('`state`\x20=\x2019,\x201,\x20null'))),_0x2254('0x5a')]]})[_0x2254('0x26')](handleEntityNotFound(_0x179cf1,null))['then'](respondWithResult(_0x179cf1,null))[_0x2254('0x45')](handleError(_0x179cf1,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x7075b1,_0x516595,_0x3cbd35){return db[_0x2254('0x60')]['find']({'where':{'id':_0x7075b1[_0x2254('0x47')]['id']}})['then'](handleEntityNotFound(_0x516595,null))[_0x2254('0x26')](function(_0x3e6070){var _0x38294d;if(_0x3e6070){_0x38294d=squel['insert']()[_0x2254('0x61')]('cm_hopper')[_0x2254('0x62')]([_0x2254('0x63'),'scheduledAt','ContactId',_0x2254('0x64'),_0x2254('0x65'),_0x2254('0x66'),_0x2254('0x67')],squel['select']()[_0x2254('0x68')](_0x2254('0x69'),_0x2254('0x63'))[_0x2254('0x68')]('NOW()',_0x2254('0x6a'))[_0x2254('0x68')]('ANY_VALUE(ContactId)',_0x2254('0x6b'))['field'](_0x2254('0x6c'),'ListId')['field']('ANY_VALUE(VoiceQueueId)',_0x2254('0x65'))['field'](_0x2254('0x6d'),_0x2254('0x66'))['field'](_0x2254('0x6d'),_0x2254('0x67'))[_0x2254('0x6e')](_0x2254('0x6f'))[_0x2254('0x3b')](_0x2254('0x70'),_0x7075b1['params']['id']['toString']())[_0x2254('0x3b')](_0x2254('0x71'),_0x7075b1[_0x2254('0x4b')][_0x2254('0x72')][_0x2254('0x73')]())[_0x2254('0x3b')](_0x2254('0x74'))[_0x2254('0x3b')](_0x2254('0x75'),squel[_0x2254('0x76')]()['field'](_0x2254('0x63'))[_0x2254('0x6e')]('cm_hopper')[_0x2254('0x3b')]('VoiceQueueId\x20=\x20?',_0x7075b1[_0x2254('0x47')]['id'][_0x2254('0x73')]()))['where'](_0x2254('0x75'),squel['select']()[_0x2254('0x68')](_0x2254('0x77'))[_0x2254('0x6e')](_0x2254('0x6f'))['where'](_0x2254('0x70'),_0x7075b1[_0x2254('0x47')]['id'][_0x2254('0x73')]())[_0x2254('0x3b')]('state\x20=\x204'))[_0x2254('0x78')](_0x2254('0x6b')))['toString']();return db[_0x2254('0x4d')][_0x2254('0x32')](_0x38294d);}return[];})['then'](respondWithResult(_0x516595,null))['catch'](handleError(_0x516595,null));};exports[_0x2254('0x79')]=function(_0x2f3650,_0x1a3fd9,_0x3058d9){return db[_0x2254('0x7a')][_0x2254('0x49')]({'where':{'id':_0x2f3650[_0x2254('0x47')]['id']}})[_0x2254('0x26')](handleEntityNotFound(_0x1a3fd9,null))[_0x2254('0x26')](function(_0x5df20f){var _0x10c44;if(_0x5df20f){_0x10c44=squel['insert']()[_0x2254('0x61')]('cm_hopper')[_0x2254('0x62')]([_0x2254('0x63'),_0x2254('0x6a'),'ContactId',_0x2254('0x64'),_0x2254('0x7b'),_0x2254('0x66'),_0x2254('0x67')],squel[_0x2254('0x76')]()[_0x2254('0x68')](_0x2254('0x69'),_0x2254('0x63'))[_0x2254('0x68')](_0x2254('0x6d'),_0x2254('0x6a'))[_0x2254('0x68')](_0x2254('0x7c'),'ContactId')[_0x2254('0x68')]('ANY_VALUE(ListId)',_0x2254('0x64'))[_0x2254('0x68')](_0x2254('0x7d'),_0x2254('0x7b'))[_0x2254('0x68')](_0x2254('0x6d'),_0x2254('0x66'))['field'](_0x2254('0x6d'),'updatedAt')[_0x2254('0x6e')]('cm_hopper_final')[_0x2254('0x3b')](_0x2254('0x7e'),_0x2f3650[_0x2254('0x47')]['id']['toString']())[_0x2254('0x3b')](_0x2254('0x71'),_0x2f3650[_0x2254('0x4b')][_0x2254('0x72')][_0x2254('0x73')]())[_0x2254('0x3b')](_0x2254('0x74'))[_0x2254('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x2254('0x68')]('phone')[_0x2254('0x6e')](_0x2254('0x7f'))[_0x2254('0x3b')](_0x2254('0x7e'),_0x2f3650[_0x2254('0x47')]['id'][_0x2254('0x73')]()))[_0x2254('0x3b')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x2254('0x76')]()[_0x2254('0x68')](_0x2254('0x77'))['from'](_0x2254('0x6f'))[_0x2254('0x3b')](_0x2254('0x7e'),_0x2f3650[_0x2254('0x47')]['id'][_0x2254('0x73')]())[_0x2254('0x3b')](_0x2254('0x80')))[_0x2254('0x78')](_0x2254('0x6b')))['toString']();return db[_0x2254('0x4d')][_0x2254('0x32')](_0x10c44);}return[];})['then'](respondWithResult(_0x1a3fd9,null))['catch'](handleError(_0x1a3fd9,null));};exports[_0x2254('0x81')]=function(_0x54339e,_0x226c19,_0x10645f){return db[_0x2254('0x82')][_0x2254('0x83')]({'where':{'VoiceQueueId':_0x54339e[_0x2254('0x4b')][_0x2254('0x65')],'CampaignId':_0x54339e[_0x2254('0x4b')][_0x2254('0x7b')],'ContactId':_0x54339e['body']['ContactId']}})[_0x2254('0x26')](handleEntityNotFound(_0x226c19,null))[_0x2254('0x26')](function(_0x1e8617){if(_0x1e8617){return _0x1e8617;}return null;})[_0x2254('0x26')](respondWithResult(_0x226c19,null))[_0x2254('0x45')](handleError(_0x226c19,null));}; \ No newline at end of file +var _0x5496=['set','Content-Range','apply','reject','save','update','then','error','stack','name','index','CmHopperFinal','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','rows','catch','show','params','keys','fields','include','options','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','findAll','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','COUNT','`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','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','countContactsIvrCampaignHopperFinal','dropContacts','abandonedContacts','reCallContacts','answeringMachine','into','cm_hopper','fromQuery','ListId','VoiceQueueId','createdAt','field','phone','NOW()','scheduledAt','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','updatedAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','CampaignId','ANY_VALUE(calleridnum)','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count'];(function(_0x4372b3,_0x380cfc){var _0x338133=function(_0x4a5198){while(--_0x4a5198){_0x4372b3['push'](_0x4372b3['shift']());}};_0x338133(++_0x380cfc);}(_0x5496,0x175));var _0x6549=function(_0x82b1cb,_0x43ed4f){_0x82b1cb=_0x82b1cb-0x0;var _0x4b7fb4=_0x5496[_0x82b1cb];return _0x4b7fb4;};'use strict';var emlformat=require(_0x6549('0x0'));var rimraf=require(_0x6549('0x1'));var zipdir=require(_0x6549('0x2'));var jsonpatch=require(_0x6549('0x3'));var rp=require(_0x6549('0x4'));var moment=require('moment');var BPromise=require(_0x6549('0x5'));var Mustache=require('mustache');var util=require(_0x6549('0x6'));var path=require(_0x6549('0x7'));var sox=require(_0x6549('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6549('0x9'));var _=require(_0x6549('0xa'));var squel=require('squel');var crypto=require(_0x6549('0xb'));var jsforce=require(_0x6549('0xc'));var deskjs=require(_0x6549('0xd'));var toCsv=require('to-csv');var querystring=require(_0x6549('0xe'));var Papa=require(_0x6549('0xf'));var Redis=require(_0x6549('0x10'));var authService=require(_0x6549('0x11'));var qs=require(_0x6549('0x12'));var as=require(_0x6549('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6549('0x14'));var utils=require(_0x6549('0x15'));var config=require(_0x6549('0x16'));var licenseUtil=require(_0x6549('0x17'));var db=require(_0x6549('0x18'))['db'];function respondWithStatusCode(_0x5bc018,_0x4dfb06){_0x4dfb06=_0x4dfb06||0xcc;return function(_0x3f844f){if(_0x3f844f){return _0x5bc018[_0x6549('0x19')](_0x4dfb06);}return _0x5bc018['status'](_0x4dfb06)[_0x6549('0x1a')]();};}function respondWithResult(_0x150fc8,_0x195d25){_0x195d25=_0x195d25||0xc8;return function(_0x12b068){if(_0x12b068){return _0x150fc8[_0x6549('0x1b')](_0x195d25)[_0x6549('0x1c')](_0x12b068);}};}function respondWithFilteredResult(_0x55c112,_0x5db86d){return function(_0x384f75){if(_0x384f75){var _0x25da29=typeof _0x5db86d['offset']===_0x6549('0x1d')&&typeof _0x5db86d[_0x6549('0x1e')]===_0x6549('0x1d');var _0x387e60=_0x384f75[_0x6549('0x1f')];var _0x53b12b=_0x25da29?0x0:_0x5db86d['offset'];var _0x26a212=_0x25da29?_0x384f75['count']:_0x5db86d['offset']+_0x5db86d[_0x6549('0x1e')];var _0x1e5079;if(_0x26a212>=_0x387e60){_0x26a212=_0x387e60;_0x1e5079=0xc8;}else{_0x1e5079=0xce;}_0x55c112[_0x6549('0x1b')](_0x1e5079);return _0x55c112[_0x6549('0x20')](_0x6549('0x21'),_0x53b12b+'-'+_0x26a212+'/'+_0x387e60)['json'](_0x384f75);}return null;};}function patchUpdates(_0x228117){return function(_0x4b40c1){try{jsonpatch[_0x6549('0x22')](_0x4b40c1,_0x228117,!![]);}catch(_0x72322b){return BPromise[_0x6549('0x23')](_0x72322b);}return _0x4b40c1[_0x6549('0x24')]();};}function saveUpdates(_0x22bcf8,_0x12d547){return function(_0x427b47){if(_0x427b47){return _0x427b47[_0x6549('0x25')](_0x22bcf8)[_0x6549('0x26')](function(_0x6ae00c){return _0x6ae00c;});}return null;};}function removeEntity(_0x40d3f9,_0x1fbfa4){return function(_0x23c0ba){if(_0x23c0ba){return _0x23c0ba['destroy']()[_0x6549('0x26')](function(){_0x40d3f9[_0x6549('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x126967,_0x29f89e){return function(_0x3768cb){if(!_0x3768cb){_0x126967['sendStatus'](0x194);}return _0x3768cb;};}function handleError(_0x31a95,_0xfb51a1){_0xfb51a1=_0xfb51a1||0x1f4;return function(_0x14de1f){logger[_0x6549('0x27')](_0x14de1f[_0x6549('0x28')]);if(_0x14de1f[_0x6549('0x29')]){delete _0x14de1f[_0x6549('0x29')];}_0x31a95[_0x6549('0x1b')](_0xfb51a1)['send'](_0x14de1f);};}exports[_0x6549('0x2a')]=function(_0x136518,_0x17fdfb){var _0x4c605c={},_0x3f1502={},_0x4acaf5={'count':0x0,'rows':[]};var _0x4f0ad1=_['map'](db[_0x6549('0x2b')][_0x6549('0x2c')],function(_0x4f3069){return{'name':_0x4f3069[_0x6549('0x2d')],'type':_0x4f3069[_0x6549('0x2e')][_0x6549('0x2f')]};});_0x3f1502[_0x6549('0x30')]=_[_0x6549('0x31')](_0x4f0ad1,_0x6549('0x29'));_0x3f1502[_0x6549('0x32')]=_['keys'](_0x136518[_0x6549('0x32')]);_0x3f1502[_0x6549('0x33')]=_[_0x6549('0x34')](_0x3f1502[_0x6549('0x30')],_0x3f1502[_0x6549('0x32')]);_0x4c605c[_0x6549('0x35')]=_['intersection'](_0x3f1502[_0x6549('0x30')],qs['fields'](_0x136518[_0x6549('0x32')]['fields']));_0x4c605c[_0x6549('0x35')]=_0x4c605c[_0x6549('0x35')][_0x6549('0x36')]?_0x4c605c['attributes']:_0x3f1502[_0x6549('0x30')];if(!_0x136518[_0x6549('0x32')][_0x6549('0x37')](_0x6549('0x38'))){_0x4c605c['limit']=qs['limit'](_0x136518['query'][_0x6549('0x1e')]);_0x4c605c[_0x6549('0x39')]=qs['offset'](_0x136518[_0x6549('0x32')][_0x6549('0x39')]);}_0x4c605c[_0x6549('0x3a')]=qs[_0x6549('0x3b')](_0x136518[_0x6549('0x32')]['sort']);_0x4c605c['where']=qs[_0x6549('0x33')](_[_0x6549('0x3c')](_0x136518[_0x6549('0x32')],_0x3f1502[_0x6549('0x33')]),_0x4f0ad1);if(_0x136518[_0x6549('0x32')][_0x6549('0x3d')]){_0x4c605c[_0x6549('0x3e')]=_[_0x6549('0x3f')](_0x4c605c[_0x6549('0x3e')],{'$or':_[_0x6549('0x31')](_0x4f0ad1,function(_0x525f82){if(_0x525f82[_0x6549('0x2e')]!==_0x6549('0x40')){var _0x2ea977={};_0x2ea977[_0x525f82[_0x6549('0x29')]]={'$like':'%'+_0x136518[_0x6549('0x32')]['filter']+'%'};return _0x2ea977;}})});}_0x4c605c=_['merge']({},_0x4c605c,_0x136518['options']);var _0x22b919={'where':_0x4c605c[_0x6549('0x3e')]};return db[_0x6549('0x2b')][_0x6549('0x1f')](_0x22b919)['then'](function(_0x56ce9f){_0x4acaf5[_0x6549('0x1f')]=_0x56ce9f;if(_0x136518[_0x6549('0x32')][_0x6549('0x41')]){_0x4c605c['include']=[{'all':!![]}];}return db[_0x6549('0x2b')]['findAll'](_0x4c605c);})[_0x6549('0x26')](function(_0x2ec614){_0x4acaf5[_0x6549('0x42')]=_0x2ec614;return _0x4acaf5;})[_0x6549('0x26')](respondWithFilteredResult(_0x17fdfb,_0x4c605c))[_0x6549('0x43')](handleError(_0x17fdfb,null));};exports[_0x6549('0x44')]=function(_0xbbfdc9,_0x4deaab){var _0x132625={'raw':!![],'where':{'id':_0xbbfdc9[_0x6549('0x45')]['id']}},_0x309f45={};_0x309f45[_0x6549('0x30')]=_[_0x6549('0x46')](db[_0x6549('0x2b')][_0x6549('0x2c')]);_0x309f45[_0x6549('0x32')]=_[_0x6549('0x46')](_0xbbfdc9[_0x6549('0x32')]);_0x309f45[_0x6549('0x33')]=_[_0x6549('0x34')](_0x309f45[_0x6549('0x30')],_0x309f45[_0x6549('0x32')]);_0x132625[_0x6549('0x35')]=_[_0x6549('0x34')](_0x309f45['model'],qs[_0x6549('0x47')](_0xbbfdc9[_0x6549('0x32')][_0x6549('0x47')]));_0x132625[_0x6549('0x35')]=_0x132625['attributes'][_0x6549('0x36')]?_0x132625['attributes']:_0x309f45[_0x6549('0x30')];if(_0xbbfdc9[_0x6549('0x32')]['includeAll']){_0x132625[_0x6549('0x48')]=[{'all':!![]}];}_0x132625=_[_0x6549('0x3f')]({},_0x132625,_0xbbfdc9[_0x6549('0x49')]);return db[_0x6549('0x2b')][_0x6549('0x4a')](_0x132625)['then'](handleEntityNotFound(_0x4deaab,null))['then'](respondWithResult(_0x4deaab,null))[_0x6549('0x43')](handleError(_0x4deaab,null));};exports[_0x6549('0x4b')]=function(_0x41d675,_0x1712f3){return db[_0x6549('0x2b')]['describe']()[_0x6549('0x26')](respondWithResult(_0x1712f3,null))[_0x6549('0x43')](handleError(_0x1712f3,null));};exports[_0x6549('0x25')]=function(_0x6121af,_0xa4c650){if(_0x6121af[_0x6549('0x4c')][_0x6549('0x4d')]){delete _0x6121af[_0x6549('0x4c')]['uniqueid'];}return db[_0x6549('0x2b')]['find']({'where':{'uniqueid':_0x6121af[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0xa4c650,null))[_0x6549('0x26')](saveUpdates(_0x6121af['body'],null))[_0x6549('0x26')](respondWithResult(_0xa4c650,null))[_0x6549('0x43')](handleError(_0xa4c650,null));};exports[_0x6549('0x4e')]=function(_0x5300c8,_0x19ac50,_0x17d7ce){return db[_0x6549('0x2b')][_0x6549('0x4f')]({'raw':![],'where':{'VoiceQueueId':_0x5300c8[_0x6549('0x45')]['id']},'attributes':[[db[_0x6549('0x50')]['fn']('COUNT',db[_0x6549('0x50')]['fn']('IF',db['sequelize'][_0x6549('0x51')](_0x6549('0x52')))),_0x6549('0x53')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x55')))),_0x6549('0x56')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x57')))),_0x6549('0x58')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')]['literal'](_0x6549('0x59')))),_0x6549('0x5a')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x5b')))),'dropContacts'],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x5c')))),'abandonedContacts'],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x5d')))),'reCallContacts'],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db[_0x6549('0x50')]['literal'](_0x6549('0x5e')))),'answeringMachine']]})[_0x6549('0x26')](handleEntityNotFound(_0x19ac50,null))[_0x6549('0x26')](respondWithResult(_0x19ac50,null))[_0x6549('0x43')](handleError(_0x19ac50,null));};exports[_0x6549('0x5f')]=function(_0x2da535,_0x45eb28,_0x3b01d9){return db[_0x6549('0x2b')][_0x6549('0x4f')]({'raw':![],'where':{'CampaignId':_0x2da535[_0x6549('0x45')]['id']},'attributes':[[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')]['literal'](_0x6549('0x52')))),_0x6549('0x53')],[db['sequelize']['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')]('`state`\x20=\x203,\x201,\x20null'))),_0x6549('0x56')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db['sequelize'][_0x6549('0x51')]('`state`\x20=\x205,\x201,\x20null'))),_0x6549('0x58')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x59')))),_0x6549('0x5a')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')](_0x6549('0x5b')))),_0x6549('0x60')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db['sequelize']['fn']('IF',db['sequelize'][_0x6549('0x51')](_0x6549('0x5c')))),_0x6549('0x61')],[db['sequelize']['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db['sequelize'][_0x6549('0x51')](_0x6549('0x5d')))),_0x6549('0x62')],[db[_0x6549('0x50')]['fn'](_0x6549('0x54'),db[_0x6549('0x50')]['fn']('IF',db[_0x6549('0x50')][_0x6549('0x51')]('`state`\x20=\x2019,\x201,\x20null'))),_0x6549('0x63')]]})['then'](handleEntityNotFound(_0x45eb28,null))[_0x6549('0x26')](respondWithResult(_0x45eb28,null))[_0x6549('0x43')](handleError(_0x45eb28,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x372b67,_0x2c00a1,_0x2e6b4b){return db['VoiceQueue'][_0x6549('0x4a')]({'where':{'id':_0x372b67[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x2c00a1,null))[_0x6549('0x26')](function(_0x15b906){var _0x34c5f9;if(_0x15b906){_0x34c5f9=squel['insert']()[_0x6549('0x64')](_0x6549('0x65'))[_0x6549('0x66')](['phone','scheduledAt','ContactId',_0x6549('0x67'),_0x6549('0x68'),_0x6549('0x69'),'updatedAt'],squel['select']()[_0x6549('0x6a')]('ANY_VALUE(calleridnum)',_0x6549('0x6b'))[_0x6549('0x6a')](_0x6549('0x6c'),_0x6549('0x6d'))[_0x6549('0x6a')](_0x6549('0x6e'),_0x6549('0x6f'))['field'](_0x6549('0x70'),_0x6549('0x67'))[_0x6549('0x6a')]('ANY_VALUE(VoiceQueueId)',_0x6549('0x68'))[_0x6549('0x6a')](_0x6549('0x6c'),_0x6549('0x69'))[_0x6549('0x6a')](_0x6549('0x6c'),_0x6549('0x71'))['from'](_0x6549('0x72'))['where'](_0x6549('0x73'),_0x372b67[_0x6549('0x45')]['id'][_0x6549('0x74')]())[_0x6549('0x3e')](_0x6549('0x75'),_0x372b67[_0x6549('0x4c')][_0x6549('0x76')][_0x6549('0x74')]())['where'](_0x6549('0x77'))[_0x6549('0x3e')](_0x6549('0x78'),squel[_0x6549('0x79')]()[_0x6549('0x6a')](_0x6549('0x6b'))[_0x6549('0x7a')](_0x6549('0x65'))[_0x6549('0x3e')](_0x6549('0x73'),_0x372b67['params']['id'][_0x6549('0x74')]()))[_0x6549('0x3e')](_0x6549('0x78'),squel[_0x6549('0x79')]()[_0x6549('0x6a')](_0x6549('0x7b'))[_0x6549('0x7a')](_0x6549('0x72'))[_0x6549('0x3e')](_0x6549('0x73'),_0x372b67[_0x6549('0x45')]['id'][_0x6549('0x74')]())[_0x6549('0x3e')](_0x6549('0x7c')))[_0x6549('0x7d')](_0x6549('0x6f')))[_0x6549('0x74')]();return db[_0x6549('0x50')]['query'](_0x34c5f9);}return[];})[_0x6549('0x26')](respondWithResult(_0x2c00a1,null))[_0x6549('0x43')](handleError(_0x2c00a1,null));};exports[_0x6549('0x7e')]=function(_0x35bad6,_0x371d8a,_0xfde69e){return db[_0x6549('0x7f')][_0x6549('0x4a')]({'where':{'id':_0x35bad6[_0x6549('0x45')]['id']}})[_0x6549('0x26')](handleEntityNotFound(_0x371d8a,null))[_0x6549('0x26')](function(_0x1da2d7){var _0x348d55;if(_0x1da2d7){_0x348d55=squel[_0x6549('0x80')]()[_0x6549('0x64')](_0x6549('0x65'))[_0x6549('0x66')](['phone',_0x6549('0x6d'),_0x6549('0x6f'),_0x6549('0x67'),_0x6549('0x81'),_0x6549('0x69'),_0x6549('0x71')],squel[_0x6549('0x79')]()['field'](_0x6549('0x82'),'phone')['field'](_0x6549('0x6c'),'scheduledAt')[_0x6549('0x6a')](_0x6549('0x6e'),_0x6549('0x6f'))[_0x6549('0x6a')](_0x6549('0x70'),'ListId')[_0x6549('0x6a')]('ANY_VALUE(CampaignId)',_0x6549('0x81'))[_0x6549('0x6a')](_0x6549('0x6c'),'createdAt')[_0x6549('0x6a')](_0x6549('0x6c'),'updatedAt')['from'](_0x6549('0x72'))[_0x6549('0x3e')](_0x6549('0x83'),_0x35bad6[_0x6549('0x45')]['id'][_0x6549('0x74')]())[_0x6549('0x3e')](_0x6549('0x75'),_0x35bad6[_0x6549('0x4c')][_0x6549('0x76')][_0x6549('0x74')]())[_0x6549('0x3e')](_0x6549('0x77'))[_0x6549('0x3e')](_0x6549('0x78'),squel[_0x6549('0x79')]()[_0x6549('0x6a')](_0x6549('0x6b'))[_0x6549('0x7a')](_0x6549('0x65'))['where']('CampaignId\x20=\x20?',_0x35bad6[_0x6549('0x45')]['id'][_0x6549('0x74')]()))[_0x6549('0x3e')](_0x6549('0x78'),squel[_0x6549('0x79')]()[_0x6549('0x6a')](_0x6549('0x7b'))[_0x6549('0x7a')](_0x6549('0x72'))[_0x6549('0x3e')]('CampaignId\x20=\x20?',_0x35bad6['params']['id']['toString']())[_0x6549('0x3e')](_0x6549('0x7c')))[_0x6549('0x7d')](_0x6549('0x6f')))[_0x6549('0x74')]();return db['sequelize'][_0x6549('0x32')](_0x348d55);}return[];})[_0x6549('0x26')](respondWithResult(_0x371d8a,null))[_0x6549('0x43')](handleError(_0x371d8a,null));};exports[_0x6549('0x84')]=function(_0x230874,_0x3be369,_0xaf1a80){return db[_0x6549('0x85')][_0x6549('0x86')]({'where':{'VoiceQueueId':_0x230874[_0x6549('0x4c')][_0x6549('0x68')],'CampaignId':_0x230874['body'][_0x6549('0x81')],'ContactId':_0x230874[_0x6549('0x4c')][_0x6549('0x6f')]}})[_0x6549('0x26')](handleEntityNotFound(_0x3be369,null))['then'](function(_0x158c92){if(_0x158c92){return _0x158c92;}return null;})[_0x6549('0x26')](respondWithResult(_0x3be369,null))[_0x6549('0x43')](handleError(_0x3be369,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 90abb51..3554c21 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 _0x7b0e=['exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','moment','path','rimraf','../../config/environment','./cmHopperFinal.attributes'];(function(_0x3d53b6,_0x3d468e){var _0x483f66=function(_0x5a88bc){while(--_0x5a88bc){_0x3d53b6['push'](_0x3d53b6['shift']());}};_0x483f66(++_0x3d468e);}(_0x7b0e,0xaf));var _0xe7b0=function(_0x21e752,_0x11e729){_0x21e752=_0x21e752-0x0;var _0x1db54c=_0x7b0e[_0x21e752];return _0x1db54c;};'use strict';var _=require(_0xe7b0('0x0'));var util=require(_0xe7b0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe7b0('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe7b0('0x3'));var rimraf=require(_0xe7b0('0x4'));var config=require(_0xe7b0('0x5'));var attributes=require(_0xe7b0('0x6'));module[_0xe7b0('0x7')]=function(_0xefe9b5,_0x482030){return _0xefe9b5[_0xe7b0('0x8')](_0xe7b0('0x9'),attributes,{'tableName':_0xe7b0('0xa'),'paranoid':![],'indexes':[{'name':_0xe7b0('0xb'),'fields':[_0xe7b0('0xb')]},{'name':'uniqueid','fields':[_0xe7b0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb57b=['../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','calleridnum','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xb57b,0x96));var _0xbb57=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0xb57b[_0x487b0c];return _0x1adbdc;};'use strict';var _=require('lodash');var util=require(_0xbb57('0x0'));var logger=require(_0xbb57('0x1'))('api');var moment=require(_0xbb57('0x2'));var BPromise=require(_0xbb57('0x3'));var rp=require(_0xbb57('0x4'));var fs=require('fs');var path=require(_0xbb57('0x5'));var rimraf=require('rimraf');var config=require(_0xbb57('0x6'));var attributes=require(_0xbb57('0x7'));module[_0xbb57('0x8')]=function(_0x27b6e9,_0xbbd110){return _0x27b6e9[_0xbb57('0x9')](_0xbb57('0xa'),attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':'calleridnum','fields':[_0xbb57('0xb')]},{'name':'uniqueid','fields':[_0xbb57('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 0c091f8..96615be 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 _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x2f4832,_0x5ddd74){var _0x426743=function(_0x37dcf3){while(--_0x37dcf3){_0x2f4832['push'](_0x2f4832['shift']());}};_0x426743(++_0x5ddd74);}(_0xb10b,0x12a));var _0xbb10=function(_0x34e4a0,_0x1fd446){_0x34e4a0=_0x34e4a0-0x0;var _0x3ead3e=_0xb10b[_0x34e4a0];return _0x3ead3e;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x55f104,_0x38d4e1){var _0x575026=function(_0x3f3112){while(--_0x3f3112){_0x55f104['push'](_0x55f104['shift']());}};_0x575026(++_0x38d4e1);}(_0xb10b,0x12a));var _0xbb10=function(_0x13137e,_0x29c0f3){_0x13137e=_0x13137e-0x0;var _0x346261=_0xb10b[_0x13137e];return _0x346261;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 693a38c..5aa9d38 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 _0x2ef3=['../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','get','/describe','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','/checkContactHopper','checkContactHopper','put','multer','util','path','connect-timeout','express','Router'];(function(_0x524c09,_0xb22408){var _0x17f290=function(_0x10a0aa){while(--_0x10a0aa){_0x524c09['push'](_0x524c09['shift']());}};_0x17f290(++_0xb22408);}(_0x2ef3,0xba));var _0x32ef=function(_0x2fbade,_0x4a3a21){_0x2fbade=_0x2fbade-0x0;var _0x23e8ef=_0x2ef3[_0x2fbade];return _0x23e8ef;};'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 fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['countContactsQueueCampaignHopperFinal']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post'](_0x32ef('0x12'),auth['isAuthenticated'](),controller[_0x32ef('0x13')]);router['post'](_0x32ef('0x14'),auth[_0x32ef('0xb')](),controller['moveContactsIvrCampaignHopperFinal']);router['post'](_0x32ef('0x15'),auth['isAuthenticated'](),controller[_0x32ef('0x16')]);router[_0x32ef('0x17')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller['update']);module['exports']=router; \ No newline at end of file +var _0x1373=['../../components/auth/service','../../components/interaction/service','./cmHopperFinal.controller','isAuthenticated','index','/describe','describe','get','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','exports','multer','connect-timeout','express','Router','fs-extra'];(function(_0x2f4054,_0x2a90f6){var _0x3cd1fd=function(_0x5d2723){while(--_0x5d2723){_0x2f4054['push'](_0x2f4054['shift']());}};_0x3cd1fd(++_0x2a90f6);}(_0x1373,0x1e1));var _0x3137=function(_0x21e71a,_0xf0b818){_0x21e71a=_0x21e71a-0x0;var _0x174f46=_0x1373[_0x21e71a];return _0x174f46;};'use strict';var multer=require(_0x3137('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3137('0x1'));var express=require(_0x3137('0x2'));var router=express[_0x3137('0x3')]();var fs_extra=require(_0x3137('0x4'));var auth=require(_0x3137('0x5'));var interaction=require(_0x3137('0x6'));var config=require('../../config/environment');var controller=require(_0x3137('0x7'));router['get']('/',auth[_0x3137('0x8')](),controller[_0x3137('0x9')]);router['get'](_0x3137('0xa'),auth['isAuthenticated'](),controller[_0x3137('0xb')]);router[_0x3137('0xc')]('/:id',auth[_0x3137('0x8')](),controller['show']);router[_0x3137('0xc')](_0x3137('0xd'),auth[_0x3137('0x8')](),controller[_0x3137('0xe')]);router[_0x3137('0xc')](_0x3137('0xf'),auth[_0x3137('0x8')](),controller[_0x3137('0x10')]);router[_0x3137('0x11')](_0x3137('0x12'),auth[_0x3137('0x8')](),controller[_0x3137('0x13')]);router[_0x3137('0x11')](_0x3137('0x14'),auth[_0x3137('0x8')](),controller[_0x3137('0x15')]);router[_0x3137('0x11')](_0x3137('0x16'),auth['isAuthenticated'](),controller[_0x3137('0x17')]);router[_0x3137('0x18')]('/:id',auth[_0x3137('0x8')](),controller[_0x3137('0x19')]);module[_0x3137('0x1a')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 5986eda..90842df 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 _0xd677=['STRING','INTEGER','DATE','BOOLEAN'];(function(_0x2671bc,_0x103d4b){var _0x1c5f76=function(_0x31f05f){while(--_0x31f05f){_0x2671bc['push'](_0x2671bc['shift']());}};_0x1c5f76(++_0x103d4b);}(_0xd677,0x94));var _0x7d67=function(_0x59aeb3,_0x32f513){_0x59aeb3=_0x59aeb3-0x0;var _0x3c6521=_0xd677[_0x59aeb3];return _0x3c6521;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x7d67('0x0')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0x7d67('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x7d67('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x7d67('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x7d67('0x0')]},'originatecalleridnum':{'type':Sequelize[_0x7d67('0x0')]},'originatecalleridname':{'type':Sequelize[_0x7d67('0x0')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x7d67('0x0')]},'starttime':{'type':Sequelize[_0x7d67('0x2')]},'responsetime':{'type':Sequelize[_0x7d67('0x2')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x7d67('0x2')]},'endtime':{'type':Sequelize[_0x7d67('0x2')]},'ringtime':{'type':Sequelize[_0x7d67('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x7d67('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x7d67('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x7d67('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x7d67('0x0')]},'campaign':{'type':Sequelize[_0x7d67('0x0')]},'campaigntype':{'type':Sequelize[_0x7d67('0x0')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x7d67('0x3')],'defaultValue':![]},'fax':{'type':Sequelize[_0x7d67('0x3')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x7d67('0x0')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x7d67('0x2')]},'recallme':{'type':Sequelize[_0x7d67('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x7d67('0x2')]},'edited':{'type':Sequelize[_0x7d67('0x3')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x7d67('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x7d67('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x7d67('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x7d67('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x7d67('0x1')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0x7d67('0x0')]}}; \ No newline at end of file +var _0x586d=['exports','INTEGER','STRING','DATE','BOOLEAN','sequelize'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x586d,0x155));var _0xd586=function(_0x2ee57a,_0x3cc404){_0x2ee57a=_0x2ee57a-0x0;var _0x55197f=_0x586d[_0x2ee57a];return _0x55197f;};'use strict';var Sequelize=require(_0xd586('0x0'));module[_0xd586('0x1')]={'state':{'type':Sequelize[_0xd586('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xd586('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize[_0xd586('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xd586('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xd586('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xd586('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xd586('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd586('0x3')]},'calleridname':{'type':Sequelize[_0xd586('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xd586('0x4')]},'answertime':{'type':Sequelize[_0xd586('0x4')]},'droptime':{'type':Sequelize[_0xd586('0x4')]},'endtime':{'type':Sequelize[_0xd586('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xd586('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xd586('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xd586('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xd586('0x3')]},'campaigntype':{'type':Sequelize[_0xd586('0x3')]},'membername':{'type':Sequelize[_0xd586('0x3')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0xd586('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xd586('0x5')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xd586('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xd586('0x4')]},'recallme':{'type':Sequelize[_0xd586('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xd586('0x4')]},'edited':{'type':Sequelize[_0xd586('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xd586('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xd586('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xd586('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xd586('0x2')],'defaultValue':0x0},'dialTimezone':{'type':Sequelize[_0xd586('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index f326df5..e5860fb 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 _0x48c7=['status','end','json','undefined','limit','offset','count','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','CmHopperHistory','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','rows','catch','show','params','merge','options','find','create','body','describe','update','uniqueid','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','sendStatus'];(function(_0xf2c879,_0x48258e){var _0x3c28d9=function(_0x1343fb){while(--_0x1343fb){_0xf2c879['push'](_0xf2c879['shift']());}};_0x3c28d9(++_0x48258e);}(_0x48c7,0xbe));var _0x748c=function(_0x38045f,_0x551f77){_0x38045f=_0x38045f-0x0;var _0xfd4f8c=_0x48c7[_0x38045f];return _0xfd4f8c;};'use strict';var emlformat=require(_0x748c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x748c('0x1'));var rp=require(_0x748c('0x2'));var moment=require('moment');var BPromise=require(_0x748c('0x3'));var Mustache=require(_0x748c('0x4'));var util=require(_0x748c('0x5'));var path=require('path');var sox=require(_0x748c('0x6'));var csv=require('to-csv');var ejs=require(_0x748c('0x7'));var fs=require('fs');var fs_extra=require(_0x748c('0x8'));var _=require('lodash');var squel=require(_0x748c('0x9'));var crypto=require(_0x748c('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x748c('0xb'));var toCsv=require(_0x748c('0xc'));var querystring=require('querystring');var Papa=require(_0x748c('0xd'));var Redis=require(_0x748c('0xe'));var authService=require(_0x748c('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x748c('0x10'));var logger=require('../../config/logger')(_0x748c('0x11'));var utils=require('../../config/utils');var config=require(_0x748c('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c3b82,_0x294d6c){_0x294d6c=_0x294d6c||0xcc;return function(_0x40ea48){if(_0x40ea48){return _0x3c3b82[_0x748c('0x13')](_0x294d6c);}return _0x3c3b82[_0x748c('0x14')](_0x294d6c)[_0x748c('0x15')]();};}function respondWithResult(_0x238cb2,_0x684407){_0x684407=_0x684407||0xc8;return function(_0x3ece1e){if(_0x3ece1e){return _0x238cb2['status'](_0x684407)[_0x748c('0x16')](_0x3ece1e);}};}function respondWithFilteredResult(_0x4ff2f5,_0x5e8aab){return function(_0x57b1a0){if(_0x57b1a0){var _0x3c0553=typeof _0x5e8aab['offset']===_0x748c('0x17')&&typeof _0x5e8aab[_0x748c('0x18')]===_0x748c('0x17');var _0x3b5d28=_0x57b1a0['count'];var _0x503ef1=_0x3c0553?0x0:_0x5e8aab[_0x748c('0x19')];var _0x5a7eca=_0x3c0553?_0x57b1a0[_0x748c('0x1a')]:_0x5e8aab[_0x748c('0x19')]+_0x5e8aab[_0x748c('0x18')];var _0x25d9ad;if(_0x5a7eca>=_0x3b5d28){_0x5a7eca=_0x3b5d28;_0x25d9ad=0xc8;}else{_0x25d9ad=0xce;}_0x4ff2f5['status'](_0x25d9ad);return _0x4ff2f5['set'](_0x748c('0x1b'),_0x503ef1+'-'+_0x5a7eca+'/'+_0x3b5d28)[_0x748c('0x16')](_0x57b1a0);}return null;};}function patchUpdates(_0x586782){return function(_0x1ab753){try{jsonpatch[_0x748c('0x1c')](_0x1ab753,_0x586782,!![]);}catch(_0x367fe0){return BPromise[_0x748c('0x1d')](_0x367fe0);}return _0x1ab753[_0x748c('0x1e')]();};}function saveUpdates(_0x17e2b7,_0x6a4bd3){return function(_0x572f8b){if(_0x572f8b){return _0x572f8b['update'](_0x17e2b7)[_0x748c('0x1f')](function(_0x5b2143){return _0x5b2143;});}return null;};}function removeEntity(_0x52f753,_0x4e305d){return function(_0x34beec){if(_0x34beec){return _0x34beec['destroy']()[_0x748c('0x1f')](function(){_0x52f753[_0x748c('0x14')](0xcc)[_0x748c('0x15')]();});}};}function handleEntityNotFound(_0x5d3f8d,_0x1b5c55){return function(_0xf8c38f){if(!_0xf8c38f){_0x5d3f8d[_0x748c('0x13')](0x194);}return _0xf8c38f;};}function handleError(_0x2745c3,_0x2f9f78){_0x2f9f78=_0x2f9f78||0x1f4;return function(_0x56193c){logger[_0x748c('0x20')](_0x56193c[_0x748c('0x21')]);if(_0x56193c[_0x748c('0x22')]){delete _0x56193c[_0x748c('0x22')];}_0x2745c3['status'](_0x2f9f78)[_0x748c('0x23')](_0x56193c);};}exports[_0x748c('0x24')]=function(_0x3283bf,_0x2aa534){var _0x3fa0ff={},_0x14f570={},_0x1d05a1={'count':0x0,'rows':[]};var _0x151ddc=_[_0x748c('0x25')](db[_0x748c('0x26')]['rawAttributes'],function(_0x51ba89){return{'name':_0x51ba89['fieldName'],'type':_0x51ba89[_0x748c('0x27')][_0x748c('0x28')]};});_0x14f570[_0x748c('0x29')]=_[_0x748c('0x25')](_0x151ddc,'name');_0x14f570[_0x748c('0x2a')]=_[_0x748c('0x2b')](_0x3283bf[_0x748c('0x2a')]);_0x14f570[_0x748c('0x2c')]=_[_0x748c('0x2d')](_0x14f570['model'],_0x14f570[_0x748c('0x2a')]);_0x3fa0ff['attributes']=_['intersection'](_0x14f570[_0x748c('0x29')],qs[_0x748c('0x2e')](_0x3283bf['query'][_0x748c('0x2e')]));_0x3fa0ff[_0x748c('0x2f')]=_0x3fa0ff[_0x748c('0x2f')][_0x748c('0x30')]?_0x3fa0ff['attributes']:_0x14f570['model'];if(!_0x3283bf[_0x748c('0x2a')][_0x748c('0x31')](_0x748c('0x32'))){_0x3fa0ff[_0x748c('0x18')]=qs[_0x748c('0x18')](_0x3283bf['query'][_0x748c('0x18')]);_0x3fa0ff[_0x748c('0x19')]=qs[_0x748c('0x19')](_0x3283bf[_0x748c('0x2a')]['offset']);}_0x3fa0ff[_0x748c('0x33')]=qs[_0x748c('0x34')](_0x3283bf['query'][_0x748c('0x34')]);_0x3fa0ff[_0x748c('0x35')]=qs[_0x748c('0x2c')](_[_0x748c('0x36')](_0x3283bf[_0x748c('0x2a')],_0x14f570['filters']),_0x151ddc);if(_0x3283bf[_0x748c('0x2a')][_0x748c('0x37')]){_0x3fa0ff[_0x748c('0x35')]=_['merge'](_0x3fa0ff['where'],{'$or':_[_0x748c('0x25')](_0x151ddc,function(_0x42658c){if(_0x42658c['type']!=='VIRTUAL'){var _0xa77b65={};_0xa77b65[_0x42658c[_0x748c('0x22')]]={'$like':'%'+_0x3283bf[_0x748c('0x2a')]['filter']+'%'};return _0xa77b65;}})});}_0x3fa0ff=_['merge']({},_0x3fa0ff,_0x3283bf['options']);var _0x3553bd={'where':_0x3fa0ff[_0x748c('0x35')]};return db[_0x748c('0x26')][_0x748c('0x1a')](_0x3553bd)[_0x748c('0x1f')](function(_0x474df5){_0x1d05a1[_0x748c('0x1a')]=_0x474df5;if(_0x3283bf[_0x748c('0x2a')][_0x748c('0x38')]){_0x3fa0ff[_0x748c('0x39')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x3fa0ff);})['then'](function(_0x5d527b){_0x1d05a1[_0x748c('0x3a')]=_0x5d527b;return _0x1d05a1;})['then'](respondWithFilteredResult(_0x2aa534,_0x3fa0ff))[_0x748c('0x3b')](handleError(_0x2aa534,null));};exports[_0x748c('0x3c')]=function(_0x1ab600,_0x192acf){var _0x1d82ff={'raw':!![],'where':{'id':_0x1ab600[_0x748c('0x3d')]['id']}},_0x55da0={};_0x55da0[_0x748c('0x29')]=_['keys'](db[_0x748c('0x26')]['rawAttributes']);_0x55da0[_0x748c('0x2a')]=_[_0x748c('0x2b')](_0x1ab600[_0x748c('0x2a')]);_0x55da0[_0x748c('0x2c')]=_[_0x748c('0x2d')](_0x55da0[_0x748c('0x29')],_0x55da0[_0x748c('0x2a')]);_0x1d82ff[_0x748c('0x2f')]=_['intersection'](_0x55da0[_0x748c('0x29')],qs[_0x748c('0x2e')](_0x1ab600[_0x748c('0x2a')]['fields']));_0x1d82ff['attributes']=_0x1d82ff['attributes'][_0x748c('0x30')]?_0x1d82ff[_0x748c('0x2f')]:_0x55da0[_0x748c('0x29')];if(_0x1ab600[_0x748c('0x2a')][_0x748c('0x38')]){_0x1d82ff['include']=[{'all':!![]}];}_0x1d82ff=_[_0x748c('0x3e')]({},_0x1d82ff,_0x1ab600[_0x748c('0x3f')]);return db[_0x748c('0x26')][_0x748c('0x40')](_0x1d82ff)[_0x748c('0x1f')](handleEntityNotFound(_0x192acf,null))[_0x748c('0x1f')](respondWithResult(_0x192acf,null))[_0x748c('0x3b')](handleError(_0x192acf,null));};exports[_0x748c('0x41')]=function(_0x48f8a7,_0x3c05c7){return db[_0x748c('0x26')]['create'](_0x48f8a7[_0x748c('0x42')],{})[_0x748c('0x1f')](respondWithResult(_0x3c05c7,0xc9))[_0x748c('0x3b')](handleError(_0x3c05c7,null));};exports[_0x748c('0x43')]=function(_0x3496a8,_0x581f81){return db[_0x748c('0x26')][_0x748c('0x43')]()[_0x748c('0x1f')](respondWithResult(_0x581f81,null))[_0x748c('0x3b')](handleError(_0x581f81,null));};exports[_0x748c('0x44')]=function(_0x303d6a,_0x433681){if(_0x303d6a[_0x748c('0x42')][_0x748c('0x45')]){delete _0x303d6a[_0x748c('0x42')][_0x748c('0x45')];}return db[_0x748c('0x26')]['find']({'where':{'uniqueid':_0x303d6a['params']['id']}})[_0x748c('0x1f')](handleEntityNotFound(_0x433681,null))[_0x748c('0x1f')](saveUpdates(_0x303d6a[_0x748c('0x42')],null))[_0x748c('0x1f')](respondWithResult(_0x433681,null))[_0x748c('0x3b')](handleError(_0x433681,null));}; \ No newline at end of file +var _0x7a80=['filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x810025,_0x34bb04){var _0x4dbc81=function(_0x2c3907){while(--_0x2c3907){_0x810025['push'](_0x810025['shift']());}};_0x4dbc81(++_0x34bb04);}(_0x7a80,0x10a));var _0x07a8=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x7a80[_0x57b54c];return _0x59cc19;};'use strict';var emlformat=require(_0x07a8('0x0'));var rimraf=require(_0x07a8('0x1'));var zipdir=require(_0x07a8('0x2'));var jsonpatch=require(_0x07a8('0x3'));var rp=require(_0x07a8('0x4'));var moment=require(_0x07a8('0x5'));var BPromise=require(_0x07a8('0x6'));var Mustache=require(_0x07a8('0x7'));var util=require(_0x07a8('0x8'));var path=require(_0x07a8('0x9'));var sox=require('sox');var csv=require(_0x07a8('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x07a8('0xb'));var _=require(_0x07a8('0xc'));var squel=require(_0x07a8('0xd'));var crypto=require(_0x07a8('0xe'));var jsforce=require(_0x07a8('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x07a8('0xa'));var querystring=require('querystring');var Papa=require(_0x07a8('0x10'));var Redis=require(_0x07a8('0x11'));var authService=require(_0x07a8('0x12'));var qs=require(_0x07a8('0x13'));var as=require(_0x07a8('0x14'));var hardwareService=require(_0x07a8('0x15'));var logger=require(_0x07a8('0x16'))(_0x07a8('0x17'));var utils=require('../../config/utils');var config=require(_0x07a8('0x18'));var licenseUtil=require(_0x07a8('0x19'));var db=require(_0x07a8('0x1a'))['db'];function respondWithStatusCode(_0x535dd6,_0xbd8352){_0xbd8352=_0xbd8352||0xcc;return function(_0x2c712e){if(_0x2c712e){return _0x535dd6['sendStatus'](_0xbd8352);}return _0x535dd6[_0x07a8('0x1b')](_0xbd8352)[_0x07a8('0x1c')]();};}function respondWithResult(_0x4c18ba,_0x2b165c){_0x2b165c=_0x2b165c||0xc8;return function(_0x1a9a93){if(_0x1a9a93){return _0x4c18ba['status'](_0x2b165c)[_0x07a8('0x1d')](_0x1a9a93);}};}function respondWithFilteredResult(_0x25bb33,_0x1f7e3c){return function(_0x177a4a){if(_0x177a4a){var _0xcf4f6a=typeof _0x1f7e3c[_0x07a8('0x1e')]===_0x07a8('0x1f')&&typeof _0x1f7e3c[_0x07a8('0x20')]===_0x07a8('0x1f');var _0xaf8b2a=_0x177a4a[_0x07a8('0x21')];var _0x3ce272=_0xcf4f6a?0x0:_0x1f7e3c[_0x07a8('0x1e')];var _0x560dfa=_0xcf4f6a?_0x177a4a[_0x07a8('0x21')]:_0x1f7e3c[_0x07a8('0x1e')]+_0x1f7e3c[_0x07a8('0x20')];var _0x4419e0;if(_0x560dfa>=_0xaf8b2a){_0x560dfa=_0xaf8b2a;_0x4419e0=0xc8;}else{_0x4419e0=0xce;}_0x25bb33['status'](_0x4419e0);return _0x25bb33[_0x07a8('0x22')](_0x07a8('0x23'),_0x3ce272+'-'+_0x560dfa+'/'+_0xaf8b2a)[_0x07a8('0x1d')](_0x177a4a);}return null;};}function patchUpdates(_0x15550d){return function(_0x25f84f){try{jsonpatch[_0x07a8('0x24')](_0x25f84f,_0x15550d,!![]);}catch(_0x5ef519){return BPromise[_0x07a8('0x25')](_0x5ef519);}return _0x25f84f[_0x07a8('0x26')]();};}function saveUpdates(_0x1cf742,_0x1b4ff9){return function(_0x4caafa){if(_0x4caafa){return _0x4caafa[_0x07a8('0x27')](_0x1cf742)[_0x07a8('0x28')](function(_0x449ccf){return _0x449ccf;});}return null;};}function removeEntity(_0x2a6fb9,_0x3a795f){return function(_0x3954d7){if(_0x3954d7){return _0x3954d7[_0x07a8('0x29')]()[_0x07a8('0x28')](function(){_0x2a6fb9[_0x07a8('0x1b')](0xcc)[_0x07a8('0x1c')]();});}};}function handleEntityNotFound(_0x5e3eab,_0x293a7f){return function(_0x51e37f){if(!_0x51e37f){_0x5e3eab[_0x07a8('0x2a')](0x194);}return _0x51e37f;};}function handleError(_0x432533,_0x394865){_0x394865=_0x394865||0x1f4;return function(_0x27b7b2){logger[_0x07a8('0x2b')](_0x27b7b2[_0x07a8('0x2c')]);if(_0x27b7b2[_0x07a8('0x2d')]){delete _0x27b7b2[_0x07a8('0x2d')];}_0x432533['status'](_0x394865)[_0x07a8('0x2e')](_0x27b7b2);};}exports[_0x07a8('0x2f')]=function(_0x4748c1,_0x2f529a){var _0x3f7b8a={},_0x2d6647={},_0x4603e5={'count':0x0,'rows':[]};var _0x501fd3=_[_0x07a8('0x30')](db[_0x07a8('0x31')][_0x07a8('0x32')],function(_0x11d4c2){return{'name':_0x11d4c2[_0x07a8('0x33')],'type':_0x11d4c2['type'][_0x07a8('0x34')]};});_0x2d6647[_0x07a8('0x35')]=_[_0x07a8('0x30')](_0x501fd3,'name');_0x2d6647['query']=_[_0x07a8('0x36')](_0x4748c1[_0x07a8('0x37')]);_0x2d6647['filters']=_[_0x07a8('0x38')](_0x2d6647[_0x07a8('0x35')],_0x2d6647['query']);_0x3f7b8a[_0x07a8('0x39')]=_['intersection'](_0x2d6647[_0x07a8('0x35')],qs[_0x07a8('0x3a')](_0x4748c1[_0x07a8('0x37')][_0x07a8('0x3a')]));_0x3f7b8a[_0x07a8('0x39')]=_0x3f7b8a['attributes'][_0x07a8('0x3b')]?_0x3f7b8a[_0x07a8('0x39')]:_0x2d6647[_0x07a8('0x35')];if(!_0x4748c1[_0x07a8('0x37')][_0x07a8('0x3c')](_0x07a8('0x3d'))){_0x3f7b8a[_0x07a8('0x20')]=qs[_0x07a8('0x20')](_0x4748c1['query'][_0x07a8('0x20')]);_0x3f7b8a[_0x07a8('0x1e')]=qs['offset'](_0x4748c1[_0x07a8('0x37')]['offset']);}_0x3f7b8a[_0x07a8('0x3e')]=qs['sort'](_0x4748c1[_0x07a8('0x37')][_0x07a8('0x3f')]);_0x3f7b8a[_0x07a8('0x40')]=qs['filters'](_[_0x07a8('0x41')](_0x4748c1[_0x07a8('0x37')],_0x2d6647[_0x07a8('0x42')]),_0x501fd3);if(_0x4748c1['query'][_0x07a8('0x43')]){_0x3f7b8a[_0x07a8('0x40')]=_[_0x07a8('0x44')](_0x3f7b8a[_0x07a8('0x40')],{'$or':_[_0x07a8('0x30')](_0x501fd3,function(_0x3c13ed){if(_0x3c13ed[_0x07a8('0x45')]!==_0x07a8('0x46')){var _0x68f8d5={};_0x68f8d5[_0x3c13ed[_0x07a8('0x2d')]]={'$like':'%'+_0x4748c1[_0x07a8('0x37')][_0x07a8('0x43')]+'%'};return _0x68f8d5;}})});}_0x3f7b8a=_[_0x07a8('0x44')]({},_0x3f7b8a,_0x4748c1[_0x07a8('0x47')]);var _0x1a8da7={'where':_0x3f7b8a[_0x07a8('0x40')]};return db[_0x07a8('0x31')][_0x07a8('0x21')](_0x1a8da7)[_0x07a8('0x28')](function(_0x3fb30d){_0x4603e5[_0x07a8('0x21')]=_0x3fb30d;if(_0x4748c1[_0x07a8('0x37')][_0x07a8('0x48')]){_0x3f7b8a[_0x07a8('0x49')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x07a8('0x4a')](_0x3f7b8a);})[_0x07a8('0x28')](function(_0x13ddad){_0x4603e5['rows']=_0x13ddad;return _0x4603e5;})[_0x07a8('0x28')](respondWithFilteredResult(_0x2f529a,_0x3f7b8a))[_0x07a8('0x4b')](handleError(_0x2f529a,null));};exports[_0x07a8('0x4c')]=function(_0x3c5f92,_0x5c95bc){var _0x30009d={'raw':!![],'where':{'id':_0x3c5f92[_0x07a8('0x4d')]['id']}},_0x1f3ca3={};_0x1f3ca3[_0x07a8('0x35')]=_['keys'](db[_0x07a8('0x31')][_0x07a8('0x32')]);_0x1f3ca3['query']=_[_0x07a8('0x36')](_0x3c5f92[_0x07a8('0x37')]);_0x1f3ca3[_0x07a8('0x42')]=_[_0x07a8('0x38')](_0x1f3ca3[_0x07a8('0x35')],_0x1f3ca3[_0x07a8('0x37')]);_0x30009d['attributes']=_[_0x07a8('0x38')](_0x1f3ca3[_0x07a8('0x35')],qs[_0x07a8('0x3a')](_0x3c5f92['query'][_0x07a8('0x3a')]));_0x30009d[_0x07a8('0x39')]=_0x30009d[_0x07a8('0x39')][_0x07a8('0x3b')]?_0x30009d[_0x07a8('0x39')]:_0x1f3ca3[_0x07a8('0x35')];if(_0x3c5f92[_0x07a8('0x37')][_0x07a8('0x48')]){_0x30009d[_0x07a8('0x49')]=[{'all':!![]}];}_0x30009d=_[_0x07a8('0x44')]({},_0x30009d,_0x3c5f92[_0x07a8('0x47')]);return db[_0x07a8('0x31')][_0x07a8('0x4e')](_0x30009d)[_0x07a8('0x28')](handleEntityNotFound(_0x5c95bc,null))[_0x07a8('0x28')](respondWithResult(_0x5c95bc,null))[_0x07a8('0x4b')](handleError(_0x5c95bc,null));};exports[_0x07a8('0x4f')]=function(_0x5d58e9,_0x2e49c4){return db['CmHopperHistory']['create'](_0x5d58e9[_0x07a8('0x50')],{})[_0x07a8('0x28')](respondWithResult(_0x2e49c4,0xc9))[_0x07a8('0x4b')](handleError(_0x2e49c4,null));};exports[_0x07a8('0x51')]=function(_0x20d854,_0x3d7ebf){return db[_0x07a8('0x31')][_0x07a8('0x51')]()[_0x07a8('0x28')](respondWithResult(_0x3d7ebf,null))[_0x07a8('0x4b')](handleError(_0x3d7ebf,null));};exports[_0x07a8('0x27')]=function(_0x1f6627,_0x319a55){if(_0x1f6627[_0x07a8('0x50')][_0x07a8('0x52')]){delete _0x1f6627['body'][_0x07a8('0x52')];}return db[_0x07a8('0x31')]['find']({'where':{'uniqueid':_0x1f6627[_0x07a8('0x4d')]['id']}})[_0x07a8('0x28')](handleEntityNotFound(_0x319a55,null))[_0x07a8('0x28')](saveUpdates(_0x1f6627[_0x07a8('0x50')],null))['then'](respondWithResult(_0x319a55,null))[_0x07a8('0x4b')](handleError(_0x319a55,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 8238a06..eb965e8 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 _0x77e6=['path','../../config/environment','./cmHopperHistory.attributes','define','endtime','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x28d225,_0x43be18){var _0x1f79e1=function(_0x362c23){while(--_0x362c23){_0x28d225['push'](_0x28d225['shift']());}};_0x1f79e1(++_0x43be18);}(_0x77e6,0x1a6));var _0x677e=function(_0x573e4d,_0x539620){_0x573e4d=_0x573e4d-0x0;var _0x703958=_0x77e6[_0x573e4d];return _0x703958;};'use strict';var _=require(_0x677e('0x0'));var util=require(_0x677e('0x1'));var logger=require(_0x677e('0x2'))(_0x677e('0x3'));var moment=require(_0x677e('0x4'));var BPromise=require(_0x677e('0x5'));var rp=require(_0x677e('0x6'));var fs=require('fs');var path=require(_0x677e('0x7'));var rimraf=require('rimraf');var config=require(_0x677e('0x8'));var attributes=require(_0x677e('0x9'));module['exports']=function(_0x18c5e1,_0x591b21){return _0x18c5e1[_0x677e('0xa')]('CmHopperHistory',attributes,{'tableName':'cm_hopper_history','paranoid':![],'indexes':[{'name':_0x677e('0xb'),'fields':[_0x677e('0xb')]},{'name':_0x677e('0xc'),'fields':[_0x677e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2ace=['CmHopperHistory','cm_hopper_history','endtime','uniqueid','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define'];(function(_0x133b0e,_0x23febb){var _0x5d3229=function(_0x53c328){while(--_0x53c328){_0x133b0e['push'](_0x133b0e['shift']());}};_0x5d3229(++_0x23febb);}(_0x2ace,0x17e));var _0xe2ac=function(_0x3ba566,_0x5e009d){_0x3ba566=_0x3ba566-0x0;var _0x480317=_0x2ace[_0x3ba566];return _0x480317;};'use strict';var _=require('lodash');var util=require(_0xe2ac('0x0'));var logger=require(_0xe2ac('0x1'))(_0xe2ac('0x2'));var moment=require('moment');var BPromise=require(_0xe2ac('0x3'));var rp=require(_0xe2ac('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe2ac('0x5'));var config=require(_0xe2ac('0x6'));var attributes=require(_0xe2ac('0x7'));module[_0xe2ac('0x8')]=function(_0x386b18,_0x46e9f3){return _0x386b18[_0xe2ac('0x9')](_0xe2ac('0xa'),attributes,{'tableName':_0xe2ac('0xb'),'paranoid':![],'indexes':[{'name':_0xe2ac('0xc'),'fields':[_0xe2ac('0xc')]},{'name':_0xe2ac('0xd'),'fields':[_0xe2ac('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 2a39380..22cfdb5 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 _0xc961=['options','catch','AvgHandleTime','where','sequelize','col','COUNT','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','raw','campaign','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','findAll','ivrTotalCallsDays','lodash','util','moment','bluebird','randomstring','ioredis','rpc','jayson/promise','http','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateCmHopperHistory','CmHopperHistory','create','body'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xc961,0x17a));var _0x1c96=function(_0x232d09,_0x30a518){_0x232d09=_0x232d09-0x0;var _0x454385=_0xc961[_0x232d09];return _0x454385;};'use strict';var _=require(_0x1c96('0x0'));var util=require(_0x1c96('0x1'));var moment=require(_0x1c96('0x2'));var BPromise=require(_0x1c96('0x3'));var rs=require(_0x1c96('0x4'));var fs=require('fs');var Redis=require(_0x1c96('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1c96('0x6'));var config=require('../../config/environment');var jayson=require(_0x1c96('0x7'));var client=jayson['client'][_0x1c96('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d4b23,_0x1f09ff,_0x307846){return new BPromise(function(_0x2e4fa5,_0x473a4c){return client['request'](_0x2d4b23,_0x307846)[_0x1c96('0x9')](function(_0x362e46){logger[_0x1c96('0xa')](_0x1c96('0xb'),_0x1f09ff,_0x1c96('0xc'));logger[_0x1c96('0xd')](_0x1c96('0xe'),_0x1f09ff,_0x1c96('0xc'),JSON[_0x1c96('0xf')](_0x362e46));if(_0x362e46[_0x1c96('0x10')]){if(_0x362e46[_0x1c96('0x10')][_0x1c96('0x11')]===0x1f4){logger['error'](_0x1c96('0xb'),_0x1f09ff,_0x362e46[_0x1c96('0x10')]['message']);return _0x473a4c(_0x362e46[_0x1c96('0x10')][_0x1c96('0x12')]);}logger[_0x1c96('0x10')](_0x1c96('0xb'),_0x1f09ff,_0x362e46[_0x1c96('0x10')][_0x1c96('0x12')]);return _0x2e4fa5(_0x362e46[_0x1c96('0x10')][_0x1c96('0x12')]);}else{logger[_0x1c96('0xa')](_0x1c96('0xb'),_0x1f09ff,_0x1c96('0xc'));_0x2e4fa5(_0x362e46[_0x1c96('0x13')][_0x1c96('0x12')]);}})['catch'](function(_0x32596e){logger['error'](_0x1c96('0xb'),_0x1f09ff,_0x32596e);_0x473a4c(_0x32596e);});});}exports[_0x1c96('0x14')]=function(_0x595429){var _0x29dafb=this;return new Promise(function(_0x491875,_0x57efce){return db[_0x1c96('0x15')][_0x1c96('0x16')](_0x595429[_0x1c96('0x17')],{'raw':_0x595429['options']?_0x595429[_0x1c96('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x1c96('0x9')](function(_0x174ebf){logger['info'](_0x1c96('0x14'),_0x595429);logger['debug'](_0x1c96('0x14'),_0x595429,JSON[_0x1c96('0xf')](_0x174ebf));_0x491875(_0x174ebf);})[_0x1c96('0x19')](function(_0x3f4293){logger[_0x1c96('0x10')](_0x1c96('0x14'),_0x3f4293[_0x1c96('0x12')],_0x595429);_0x57efce(_0x29dafb[_0x1c96('0x10')](0x1f4,_0x3f4293[_0x1c96('0x12')]));});});};exports[_0x1c96('0x1a')]=function(_0x4d2c9c){var _0x24c60c=this;return new Promise(function(_0x18b849,_0x289ee5){return db['CmHopperHistory']['findAll']({'raw':_0x4d2c9c[_0x1c96('0x18')]?_0x4d2c9c[_0x1c96('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4d2c9c[_0x1c96('0x18')]?_0x4d2c9c[_0x1c96('0x18')][_0x1c96('0x1b')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x1c96('0x1c')][_0x1c96('0x1d')]('id')),'predictiveIntervalTotalCalls'],[db[_0x1c96('0x1c')]['fn'](_0x1c96('0x1e'),db[_0x1c96('0x1c')]['fn']('IF',db[_0x1c96('0x1c')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x1c96('0x1f')],[db['sequelize']['fn'](_0x1c96('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x1c96('0x20')](_0x1c96('0x21')))),_0x1c96('0x22')],[db[_0x1c96('0x1c')]['fn'](_0x1c96('0x1e'),db[_0x1c96('0x1c')]['fn']('IF',db['sequelize']['literal'](_0x1c96('0x23')))),_0x1c96('0x24')],[db[_0x1c96('0x1c')]['fn'](_0x1c96('0x25'),db[_0x1c96('0x1c')]['fn']('IF',db[_0x1c96('0x1c')][_0x1c96('0x20')](_0x1c96('0x26')))),_0x1c96('0x27')],[db['sequelize']['fn'](_0x1c96('0x25'),db[_0x1c96('0x1c')]['fn']('IF',db[_0x1c96('0x1c')][_0x1c96('0x20')](_0x1c96('0x28')))),_0x1c96('0x29')]]})['then'](function(_0x353732){logger[_0x1c96('0xa')]('AvgHandleTime',_0x4d2c9c);logger[_0x1c96('0xd')](_0x1c96('0x1a'),_0x4d2c9c,JSON[_0x1c96('0xf')](_0x353732));_0x18b849(_0x353732);})[_0x1c96('0x19')](function(_0x2c812c){logger[_0x1c96('0x10')](_0x1c96('0x1a'),_0x2c812c['message'],_0x4d2c9c);_0x289ee5(_0x24c60c['error'](0x1f4,_0x2c812c[_0x1c96('0x12')]));});});};exports[_0x1c96('0x2a')]=function(_0x51fd52){var _0x30a200=this;return new Promise(function(_0x53214a,_0x2adcb3){return db[_0x1c96('0x15')]['findAll']({'raw':_0x51fd52['options']?_0x51fd52[_0x1c96('0x18')][_0x1c96('0x2b')]===undefined?!![]:![]:!![],'where':_0x51fd52[_0x1c96('0x18')]?_0x51fd52[_0x1c96('0x18')][_0x1c96('0x1b')]||null:null,'attributes':[[_0x1c96('0x2c'),_0x1c96('0x2d')],[db['sequelize']['fn'](_0x1c96('0x1e'),db[_0x1c96('0x1c')]['fn']('IF',db['sequelize'][_0x1c96('0x20')]('`state`\x20=\x200,\x201,\x20null'))),_0x1c96('0x2e')],[db[_0x1c96('0x1c')]['fn'](_0x1c96('0x1e'),db[_0x1c96('0x1c')]['fn']('IF',db['sequelize'][_0x1c96('0x20')](_0x1c96('0x2f')))),_0x1c96('0x30')],[db[_0x1c96('0x1c')]['fn']('COUNT',db[_0x1c96('0x1c')]['fn']('IF',db[_0x1c96('0x1c')]['literal'](_0x1c96('0x31')))),_0x1c96('0x32')],[db[_0x1c96('0x1c')]['fn'](_0x1c96('0x1e'),db[_0x1c96('0x1c')]['fn']('IF',db[_0x1c96('0x1c')][_0x1c96('0x20')](_0x1c96('0x33')))),'outboundBusyCallsDay'],[db[_0x1c96('0x1c')]['fn'](_0x1c96('0x1e'),db[_0x1c96('0x1c')]['fn']('IF',db[_0x1c96('0x1c')][_0x1c96('0x20')](_0x1c96('0x34')))),_0x1c96('0x35')],[db[_0x1c96('0x1c')]['fn'](_0x1c96('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x1c96('0x20')](_0x1c96('0x36')))),_0x1c96('0x37')],[db[_0x1c96('0x1c')]['fn'](_0x1c96('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0x1c96('0x20')](_0x1c96('0x38')))),_0x1c96('0x39')],[db['sequelize']['fn'](_0x1c96('0x1e'),db[_0x1c96('0x1c')]['fn']('IF',db['sequelize'][_0x1c96('0x20')]('`state`\x20=\x2012,\x201,\x20null'))),'outboundUnknownCallsDay'],[db[_0x1c96('0x1c')]['fn'](_0x1c96('0x1e'),db[_0x1c96('0x1c')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x2013,\x201,\x20null'))),_0x1c96('0x3a')],[db['sequelize']['fn'](_0x1c96('0x1e'),db['sequelize']['fn']('IF',db[_0x1c96('0x1c')][_0x1c96('0x20')](_0x1c96('0x3b')))),_0x1c96('0x3c')],[db['sequelize']['fn'](_0x1c96('0x1e'),db[_0x1c96('0x1c')]['fn']('IF',db[_0x1c96('0x1c')][_0x1c96('0x20')]('`state`\x20=\x2018,\x201,\x20null'))),_0x1c96('0x3d')],[db[_0x1c96('0x1c')]['fn'](_0x1c96('0x1e'),db[_0x1c96('0x1c')]['fn']('IF',db[_0x1c96('0x1c')][_0x1c96('0x20')](_0x1c96('0x3e')))),'outboundAnswerAgiCallsDay'],[db[_0x1c96('0x1c')]['fn']('COUNT',db[_0x1c96('0x1c')]['fn']('IF',db[_0x1c96('0x1c')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x1c96('0x3d')],[db[_0x1c96('0x1c')]['fn'](_0x1c96('0x1e'),db['sequelize']['fn']('IF',db[_0x1c96('0x1c')][_0x1c96('0x20')](_0x1c96('0x3f')))),'outboundReCallsDay']],'group':['campaign']})[_0x1c96('0x9')](function(_0x534f61){logger['info']('GetVoiceQueueHopperHistory',_0x51fd52);logger['debug'](_0x1c96('0x2a'),_0x51fd52,JSON['stringify'](_0x534f61));_0x53214a(_0x534f61);})['catch'](function(_0x5c896e){logger[_0x1c96('0x10')](_0x1c96('0x2a'),_0x5c896e[_0x1c96('0x12')],_0x51fd52);_0x2adcb3(_0x30a200[_0x1c96('0x10')](0x1f4,_0x5c896e[_0x1c96('0x12')]));});});};exports[_0x1c96('0x40')]=function(_0x42ac0d){var _0x365116=this;return new Promise(function(_0x9e73ff,_0x4e4342){return db[_0x1c96('0x15')][_0x1c96('0x41')]({'raw':_0x42ac0d[_0x1c96('0x18')]?_0x42ac0d[_0x1c96('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x42ac0d[_0x1c96('0x18')]?_0x42ac0d[_0x1c96('0x18')][_0x1c96('0x1b')]||null:null,'attributes':[[_0x1c96('0x2c'),_0x1c96('0x2d')],[db[_0x1c96('0x1c')]['fn'](_0x1c96('0x1e'),db[_0x1c96('0x1c')]['col']('id')),_0x1c96('0x42')],[db[_0x1c96('0x1c')]['fn'](_0x1c96('0x1e'),db['sequelize']['fn']('IF',db[_0x1c96('0x1c')][_0x1c96('0x20')](_0x1c96('0x31')))),'ivrAnswerCallsDay']],'group':['campaign']})[_0x1c96('0x9')](function(_0x457332){logger['info']('GetCampaignHopperHistory',_0x42ac0d);logger['debug'](_0x1c96('0x40'),_0x42ac0d,JSON[_0x1c96('0xf')](_0x457332));_0x9e73ff(_0x457332);})[_0x1c96('0x19')](function(_0x1f63ac){logger['error'](_0x1c96('0x40'),_0x1f63ac[_0x1c96('0x12')],_0x42ac0d);_0x4e4342(_0x365116[_0x1c96('0x10')](0x1f4,_0x1f63ac[_0x1c96('0x12')]));});});}; \ No newline at end of file +var _0xfecd=['create','body','options','AvgHandleTime','CmHopperHistory','raw','where','sequelize','COUNT','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','col','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory'];(function(_0xfe3349,_0x5b6ec0){var _0x4471af=function(_0x21b88a){while(--_0x21b88a){_0xfe3349['push'](_0xfe3349['shift']());}};_0x4471af(++_0x5b6ec0);}(_0xfecd,0x107));var _0xdfec=function(_0x4019cd,_0x13b1cc){_0x4019cd=_0x4019cd-0x0;var _0x5b6586=_0xfecd[_0x4019cd];return _0x5b6586;};'use strict';var _=require(_0xdfec('0x0'));var util=require('util');var moment=require(_0xdfec('0x1'));var BPromise=require(_0xdfec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdfec('0x3'));var db=require(_0xdfec('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdfec('0x5'))('rpc');var config=require(_0xdfec('0x6'));var jayson=require(_0xdfec('0x7'));var client=jayson[_0xdfec('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f35a8,_0x6090af,_0x40782c){return new BPromise(function(_0x81175c,_0x413c88){return client['request'](_0x2f35a8,_0x40782c)[_0xdfec('0x9')](function(_0x194755){logger[_0xdfec('0xa')]('CmHopperHistory,\x20%s,\x20%s',_0x6090af,'request\x20sent');logger[_0xdfec('0xb')](_0xdfec('0xc'),_0x6090af,'request\x20sent',JSON[_0xdfec('0xd')](_0x194755));if(_0x194755[_0xdfec('0xe')]){if(_0x194755['error'][_0xdfec('0xf')]===0x1f4){logger['error'](_0xdfec('0x10'),_0x6090af,_0x194755[_0xdfec('0xe')][_0xdfec('0x11')]);return _0x413c88(_0x194755[_0xdfec('0xe')][_0xdfec('0x11')]);}logger[_0xdfec('0xe')](_0xdfec('0x10'),_0x6090af,_0x194755[_0xdfec('0xe')]['message']);return _0x81175c(_0x194755[_0xdfec('0xe')][_0xdfec('0x11')]);}else{logger['info'](_0xdfec('0x10'),_0x6090af,'request\x20sent');_0x81175c(_0x194755[_0xdfec('0x12')][_0xdfec('0x11')]);}})[_0xdfec('0x13')](function(_0x2354ad){logger['error'](_0xdfec('0x10'),_0x6090af,_0x2354ad);_0x413c88(_0x2354ad);});});}exports[_0xdfec('0x14')]=function(_0x336abf){var _0x144890=this;return new Promise(function(_0x10c44c,_0x5deea6){return db['CmHopperHistory'][_0xdfec('0x15')](_0x336abf[_0xdfec('0x16')],{'raw':_0x336abf[_0xdfec('0x17')]?_0x336abf['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4b9614){logger[_0xdfec('0xa')](_0xdfec('0x14'),_0x336abf);logger['debug'](_0xdfec('0x14'),_0x336abf,JSON[_0xdfec('0xd')](_0x4b9614));_0x10c44c(_0x4b9614);})['catch'](function(_0x23c8fd){logger['error'](_0xdfec('0x14'),_0x23c8fd[_0xdfec('0x11')],_0x336abf);_0x5deea6(_0x144890[_0xdfec('0xe')](0x1f4,_0x23c8fd[_0xdfec('0x11')]));});});};exports[_0xdfec('0x18')]=function(_0x3e29aa){var _0x412b26=this;return new Promise(function(_0x3a0566,_0xbeb814){return db[_0xdfec('0x19')]['findAll']({'raw':_0x3e29aa[_0xdfec('0x17')]?_0x3e29aa['options'][_0xdfec('0x1a')]===undefined?!![]:![]:!![],'where':_0x3e29aa[_0xdfec('0x17')]?_0x3e29aa[_0xdfec('0x17')][_0xdfec('0x1b')]||null:null,'attributes':[[db[_0xdfec('0x1c')]['fn'](_0xdfec('0x1d'),db[_0xdfec('0x1c')]['col']('id')),_0xdfec('0x1e')],[db[_0xdfec('0x1c')]['fn']('COUNT',db[_0xdfec('0x1c')]['fn']('IF',db['sequelize']['literal'](_0xdfec('0x1f')))),_0xdfec('0x20')],[db[_0xdfec('0x1c')]['fn'](_0xdfec('0x1d'),db[_0xdfec('0x1c')]['fn']('IF',db[_0xdfec('0x1c')][_0xdfec('0x21')](_0xdfec('0x22')))),_0xdfec('0x23')],[db[_0xdfec('0x1c')]['fn'](_0xdfec('0x1d'),db[_0xdfec('0x1c')]['fn']('IF',db['sequelize'][_0xdfec('0x21')](_0xdfec('0x24')))),_0xdfec('0x25')],[db[_0xdfec('0x1c')]['fn'](_0xdfec('0x26'),db[_0xdfec('0x1c')]['fn']('IF',db[_0xdfec('0x1c')][_0xdfec('0x21')](_0xdfec('0x27')))),'predictiveIntervalAvgHoldtime'],[db['sequelize']['fn'](_0xdfec('0x26'),db[_0xdfec('0x1c')]['fn']('IF',db[_0xdfec('0x1c')][_0xdfec('0x21')](_0xdfec('0x28')))),_0xdfec('0x29')]]})['then'](function(_0x4ed5c3){logger[_0xdfec('0xa')](_0xdfec('0x18'),_0x3e29aa);logger[_0xdfec('0xb')](_0xdfec('0x18'),_0x3e29aa,JSON[_0xdfec('0xd')](_0x4ed5c3));_0x3a0566(_0x4ed5c3);})[_0xdfec('0x13')](function(_0x3a1d09){logger[_0xdfec('0xe')](_0xdfec('0x18'),_0x3a1d09[_0xdfec('0x11')],_0x3e29aa);_0xbeb814(_0x412b26[_0xdfec('0xe')](0x1f4,_0x3a1d09['message']));});});};exports[_0xdfec('0x2a')]=function(_0x30e164){var _0x261fc3=this;return new Promise(function(_0x4e4000,_0x2971a1){return db['CmHopperHistory'][_0xdfec('0x2b')]({'raw':_0x30e164[_0xdfec('0x17')]?_0x30e164['options'][_0xdfec('0x1a')]===undefined?!![]:![]:!![],'where':_0x30e164[_0xdfec('0x17')]?_0x30e164[_0xdfec('0x17')][_0xdfec('0x1b')]||null:null,'attributes':[[_0xdfec('0x2c'),_0xdfec('0x2d')],[db[_0xdfec('0x1c')]['fn'](_0xdfec('0x1d'),db[_0xdfec('0x1c')]['fn']('IF',db[_0xdfec('0x1c')][_0xdfec('0x21')](_0xdfec('0x2e')))),_0xdfec('0x2f')],[db['sequelize']['fn'](_0xdfec('0x1d'),db[_0xdfec('0x1c')]['fn']('IF',db[_0xdfec('0x1c')]['literal'](_0xdfec('0x30')))),_0xdfec('0x31')],[db[_0xdfec('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xdfec('0x1c')][_0xdfec('0x21')](_0xdfec('0x1f')))),'outboundAnswerCallsDay'],[db[_0xdfec('0x1c')]['fn']('COUNT',db[_0xdfec('0x1c')]['fn']('IF',db[_0xdfec('0x1c')]['literal'](_0xdfec('0x32')))),_0xdfec('0x33')],[db[_0xdfec('0x1c')]['fn'](_0xdfec('0x1d'),db[_0xdfec('0x1c')]['fn']('IF',db[_0xdfec('0x1c')][_0xdfec('0x21')](_0xdfec('0x34')))),_0xdfec('0x35')],[db['sequelize']['fn'](_0xdfec('0x1d'),db[_0xdfec('0x1c')]['fn']('IF',db[_0xdfec('0x1c')][_0xdfec('0x21')](_0xdfec('0x36')))),_0xdfec('0x37')],[db[_0xdfec('0x1c')]['fn'](_0xdfec('0x1d'),db[_0xdfec('0x1c')]['fn']('IF',db[_0xdfec('0x1c')][_0xdfec('0x21')](_0xdfec('0x38')))),_0xdfec('0x39')],[db[_0xdfec('0x1c')]['fn']('COUNT',db[_0xdfec('0x1c')]['fn']('IF',db[_0xdfec('0x1c')]['literal'](_0xdfec('0x3a')))),_0xdfec('0x3b')],[db[_0xdfec('0x1c')]['fn'](_0xdfec('0x1d'),db[_0xdfec('0x1c')]['fn']('IF',db['sequelize'][_0xdfec('0x21')]('`state`\x20=\x2013,\x201,\x20null'))),_0xdfec('0x3c')],[db['sequelize']['fn'](_0xdfec('0x1d'),db[_0xdfec('0x1c')]['fn']('IF',db[_0xdfec('0x1c')][_0xdfec('0x21')]('`state`\x20=\x2014,\x201,\x20null'))),_0xdfec('0x3d')],[db[_0xdfec('0x1c')]['fn'](_0xdfec('0x1d'),db[_0xdfec('0x1c')]['fn']('IF',db[_0xdfec('0x1c')][_0xdfec('0x21')](_0xdfec('0x3e')))),_0xdfec('0x3f')],[db[_0xdfec('0x1c')]['fn'](_0xdfec('0x1d'),db[_0xdfec('0x1c')]['fn']('IF',db[_0xdfec('0x1c')][_0xdfec('0x21')](_0xdfec('0x40')))),_0xdfec('0x41')],[db['sequelize']['fn'](_0xdfec('0x1d'),db[_0xdfec('0x1c')]['fn']('IF',db[_0xdfec('0x1c')][_0xdfec('0x21')]('`state`\x20=\x2020,\x201,\x20null'))),_0xdfec('0x3f')],[db[_0xdfec('0x1c')]['fn'](_0xdfec('0x1d'),db['sequelize']['fn']('IF',db[_0xdfec('0x1c')][_0xdfec('0x21')](_0xdfec('0x42')))),_0xdfec('0x43')]],'group':[_0xdfec('0x2c')]})[_0xdfec('0x9')](function(_0x4ff22e){logger['info'](_0xdfec('0x2a'),_0x30e164);logger[_0xdfec('0xb')](_0xdfec('0x2a'),_0x30e164,JSON['stringify'](_0x4ff22e));_0x4e4000(_0x4ff22e);})[_0xdfec('0x13')](function(_0x2b15e6){logger[_0xdfec('0xe')](_0xdfec('0x2a'),_0x2b15e6[_0xdfec('0x11')],_0x30e164);_0x2971a1(_0x261fc3[_0xdfec('0xe')](0x1f4,_0x2b15e6['message']));});});};exports['GetCampaignHopperHistory']=function(_0x45ca2b){var _0x905ff7=this;return new Promise(function(_0x496213,_0x7df95a){return db[_0xdfec('0x19')][_0xdfec('0x2b')]({'raw':_0x45ca2b[_0xdfec('0x17')]?_0x45ca2b[_0xdfec('0x17')][_0xdfec('0x1a')]===undefined?!![]:![]:!![],'where':_0x45ca2b[_0xdfec('0x17')]?_0x45ca2b['options'][_0xdfec('0x1b')]||null:null,'attributes':[[_0xdfec('0x2c'),_0xdfec('0x2d')],[db['sequelize']['fn']('COUNT',db[_0xdfec('0x1c')][_0xdfec('0x44')]('id')),_0xdfec('0x45')],[db[_0xdfec('0x1c')]['fn']('COUNT',db[_0xdfec('0x1c')]['fn']('IF',db[_0xdfec('0x1c')]['literal'](_0xdfec('0x1f')))),_0xdfec('0x46')]],'group':[_0xdfec('0x2c')]})['then'](function(_0xfc932e){logger[_0xdfec('0xa')]('GetCampaignHopperHistory',_0x45ca2b);logger[_0xdfec('0xb')]('GetCampaignHopperHistory',_0x45ca2b,JSON[_0xdfec('0xd')](_0xfc932e));_0x496213(_0xfc932e);})[_0xdfec('0x13')](function(_0x9b35da){logger[_0xdfec('0xe')]('GetCampaignHopperHistory',_0x9b35da[_0xdfec('0x11')],_0x45ca2b);_0x7df95a(_0x905ff7[_0xdfec('0xe')](0x1f4,_0x9b35da[_0xdfec('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index d681ef6..ea38dd4 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 _0xeb41=['create','put','/:id','update','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','post'];(function(_0x183a3c,_0x3f8402){var _0x31f8f1=function(_0x532279){while(--_0x532279){_0x183a3c['push'](_0x183a3c['shift']());}};_0x31f8f1(++_0x3f8402);}(_0xeb41,0x122));var _0x1eb4=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xeb41[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x1eb4('0x0'));var util=require(_0x1eb4('0x1'));var path=require('path');var timeout=require(_0x1eb4('0x2'));var express=require(_0x1eb4('0x3'));var router=express[_0x1eb4('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x1eb4('0x5'));var interaction=require(_0x1eb4('0x6'));var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router[_0x1eb4('0x7')]('/',auth[_0x1eb4('0x8')](),controller[_0x1eb4('0x9')]);router[_0x1eb4('0x7')](_0x1eb4('0xa'),auth[_0x1eb4('0x8')](),controller[_0x1eb4('0xb')]);router[_0x1eb4('0x7')]('/:id',auth[_0x1eb4('0x8')](),controller[_0x1eb4('0xc')]);router[_0x1eb4('0xd')]('/',auth[_0x1eb4('0x8')](),controller[_0x1eb4('0xe')]);router[_0x1eb4('0xf')](_0x1eb4('0x10'),auth['isAuthenticated'](),controller[_0x1eb4('0x11')]);module[_0x1eb4('0x12')]=router; \ No newline at end of file +var _0x6b08=['get','index','/describe','isAuthenticated','describe','/:id','show','create','put','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller'];(function(_0x3d2763,_0x2ec071){var _0x40ad02=function(_0x7a03e5){while(--_0x7a03e5){_0x3d2763['push'](_0x3d2763['shift']());}};_0x40ad02(++_0x2ec071);}(_0x6b08,0x12b));var _0x86b0=function(_0x176cf0,_0x5f39c5){_0x176cf0=_0x176cf0-0x0;var _0x5e052d=_0x6b08[_0x176cf0];return _0x5e052d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x86b0('0x0'));var express=require(_0x86b0('0x1'));var router=express[_0x86b0('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x86b0('0x3'));var interaction=require(_0x86b0('0x4'));var config=require(_0x86b0('0x5'));var controller=require(_0x86b0('0x6'));router[_0x86b0('0x7')]('/',auth['isAuthenticated'](),controller[_0x86b0('0x8')]);router[_0x86b0('0x7')](_0x86b0('0x9'),auth[_0x86b0('0xa')](),controller[_0x86b0('0xb')]);router[_0x86b0('0x7')](_0x86b0('0xc'),auth[_0x86b0('0xa')](),controller[_0x86b0('0xd')]);router['post']('/',auth[_0x86b0('0xa')](),controller[_0x86b0('0xe')]);router[_0x86b0('0xf')](_0x86b0('0xc'),auth['isAuthenticated'](),controller['update']);module[_0x86b0('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index b0b89e7..14256bf 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 _0x3a0f=['STRING'];(function(_0x532112,_0x37d94b){var _0x23e5fb=function(_0x690ac8){while(--_0x690ac8){_0x532112['push'](_0x532112['shift']());}};_0x23e5fb(++_0x37d94b);}(_0x3a0f,0x145));var _0xf3a0=function(_0x55e001,_0x82fc54){_0x55e001=_0x55e001-0x0;var _0xf487fa=_0x3a0f[_0x55e001];return _0xf487fa;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf3a0('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xf3a0('0x0')]}}; \ No newline at end of file +var _0xc01b=['sequelize','exports','STRING','name'];(function(_0x14e78b,_0x134776){var _0x53006f=function(_0x23cf65){while(--_0x23cf65){_0x14e78b['push'](_0x14e78b['shift']());}};_0x53006f(++_0x134776);}(_0xc01b,0x74));var _0xbc01=function(_0x2b5901,_0xe161c8){_0x2b5901=_0x2b5901-0x0;var _0x44e1e0=_0xc01b[_0x2b5901];return _0x44e1e0;};'use strict';var Sequelize=require(_0xbc01('0x0'));module[_0xbc01('0x1')]={'name':{'type':Sequelize[_0xbc01('0x2')],'unique':_0xbc01('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbc01('0x2')]},'dialPrefix':{'type':Sequelize[_0xbc01('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 63d603b..8c2a4d3 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 _0xa0e6=['raw','getContactsCsv','ContactItemType','OrderBy','alias','select','cm_contacts','c.ListId\x20=\x20?','field','c.cf_','item','from','cm_contact_has_items','ItemTypeId\x20=\x20?','CmContactId\x20=\x20c.id','description_additionalPhone_','toString','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','addCustomField','findOne','transaction','addCustomFields','Sequelize','TEXT','number','INTEGER','switch','sequelize','queryInterface','addColumn','findAndCountAll','getGlobalCustomFields','addAgents','spread','removeAgents','emit','userCmList:remove','getAgents','info','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','options','includeAll','CmList','findAll','rows','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','removeDispositions','CmContact','tags','isArray','push','each','omit','ids','success','errors','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d'];(function(_0x39f9ac,_0x2dae2d){var _0x500e6=function(_0x4b6bd4){while(--_0x4b6bd4){_0x39f9ac['push'](_0x39f9ac['shift']());}};_0x500e6(++_0x2dae2d);}(_0xa0e6,0xca));var _0x6a0e=function(_0x43eab0,_0x22ca92){_0x43eab0=_0x43eab0-0x0;var _0x1635bc=_0xa0e6[_0x43eab0];return _0x1635bc;};'use strict';var emlformat=require(_0x6a0e('0x0'));var rimraf=require(_0x6a0e('0x1'));var zipdir=require(_0x6a0e('0x2'));var jsonpatch=require(_0x6a0e('0x3'));var rp=require('request-promise');var moment=require(_0x6a0e('0x4'));var BPromise=require(_0x6a0e('0x5'));var Mustache=require(_0x6a0e('0x6'));var util=require(_0x6a0e('0x7'));var path=require(_0x6a0e('0x8'));var sox=require(_0x6a0e('0x9'));var csv=require(_0x6a0e('0xa'));var ejs=require(_0x6a0e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6a0e('0xc'));var crypto=require('crypto');var jsforce=require(_0x6a0e('0xd'));var deskjs=require(_0x6a0e('0xe'));var toCsv=require(_0x6a0e('0xa'));var querystring=require(_0x6a0e('0xf'));var Papa=require('papaparse');var Redis=require(_0x6a0e('0x10'));var authService=require(_0x6a0e('0x11'));var qs=require(_0x6a0e('0x12'));var as=require(_0x6a0e('0x13'));var hardwareService=require(_0x6a0e('0x14'));var logger=require('../../config/logger')(_0x6a0e('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6a0e('0x16'));var db=require(_0x6a0e('0x17'))['db'];var csv_results;config['redis']=_[_0x6a0e('0x18')](config[_0x6a0e('0x19')],{'host':_0x6a0e('0x1a'),'port':0x18eb});var socket=require(_0x6a0e('0x1b'))(new Redis(config[_0x6a0e('0x19')]));require('./cmList.socket')[_0x6a0e('0x1c')](socket);function respondWithStatusCode(_0x1d848f,_0x4ef6c1){_0x4ef6c1=_0x4ef6c1||0xcc;return function(_0x1f8449){if(_0x1f8449){return _0x1d848f[_0x6a0e('0x1d')](_0x4ef6c1);}return _0x1d848f[_0x6a0e('0x1e')](_0x4ef6c1)[_0x6a0e('0x1f')]();};}function respondWithResult(_0x14583f,_0x445222){_0x445222=_0x445222||0xc8;return function(_0x5762fc){if(_0x5762fc){return _0x14583f[_0x6a0e('0x1e')](_0x445222)[_0x6a0e('0x20')](_0x5762fc);}};}function respondWithFilteredResult(_0x49c482,_0xe7825){return function(_0x54a100){if(_0x54a100){var _0x585629=typeof _0xe7825['offset']===_0x6a0e('0x21')&&typeof _0xe7825[_0x6a0e('0x22')]===_0x6a0e('0x21');var _0x555899=_0x54a100[_0x6a0e('0x23')];var _0x1fe84f=_0x585629?0x0:_0xe7825['offset'];var _0x5a8983=_0x585629?_0x54a100[_0x6a0e('0x23')]:_0xe7825['offset']+_0xe7825[_0x6a0e('0x22')];var _0x39a1be;if(_0x5a8983>=_0x555899){_0x5a8983=_0x555899;_0x39a1be=0xc8;}else{_0x39a1be=0xce;}_0x49c482[_0x6a0e('0x1e')](_0x39a1be);return _0x49c482[_0x6a0e('0x24')](_0x6a0e('0x25'),_0x1fe84f+'-'+_0x5a8983+'/'+_0x555899)[_0x6a0e('0x20')](_0x54a100);}return null;};}function patchUpdates(_0x5246cf){return function(_0x210596){try{jsonpatch[_0x6a0e('0x26')](_0x210596,_0x5246cf,!![]);}catch(_0x38e92f){return BPromise[_0x6a0e('0x27')](_0x38e92f);}return _0x210596[_0x6a0e('0x28')]();};}function saveUpdates(_0x22c863,_0x52f42a){return function(_0x24304b){if(_0x24304b){return _0x24304b[_0x6a0e('0x29')](_0x22c863)[_0x6a0e('0x2a')](function(_0x2dc853){return _0x2dc853;});}return null;};}function removeEntity(_0x21e549,_0x2966b0){return function(_0x2fcdd5){if(_0x2fcdd5){return _0x2fcdd5[_0x6a0e('0x2b')]()[_0x6a0e('0x2a')](function(){var _0x426a62=_0x2fcdd5[_0x6a0e('0x2c')]({'plain':!![]});var _0x4efb4e=_0x6a0e('0x2d');return db[_0x6a0e('0x2e')]['destroy']({'where':{'type':_0x4efb4e,'resourceId':_0x426a62['id']}})['then'](function(){return _0x2fcdd5;});})[_0x6a0e('0x2a')](function(){_0x21e549[_0x6a0e('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5eb1a4,_0x5ad5d6){return function(_0x3160fc){if(!_0x3160fc){_0x5eb1a4[_0x6a0e('0x1d')](0x194);}return _0x3160fc;};}function handleError(_0x3374fa,_0x13604f){_0x13604f=_0x13604f||0x1f4;return function(_0x4effd3){logger[_0x6a0e('0x2f')](_0x4effd3[_0x6a0e('0x30')]);if(_0x4effd3[_0x6a0e('0x31')]){delete _0x4effd3[_0x6a0e('0x31')];}_0x3374fa['status'](_0x13604f)[_0x6a0e('0x32')](_0x4effd3);};}exports[_0x6a0e('0x33')]=function(_0x1b7dd5,_0x40a3f7){var _0x4ad104={},_0x53c4f0={},_0x7679ad={'count':0x0,'rows':[]};var _0x541dd2=_[_0x6a0e('0x34')](db['CmList'][_0x6a0e('0x35')],function(_0x453fb8){return{'name':_0x453fb8[_0x6a0e('0x36')],'type':_0x453fb8[_0x6a0e('0x37')]['key']};});_0x53c4f0[_0x6a0e('0x38')]=_[_0x6a0e('0x34')](_0x541dd2,_0x6a0e('0x31'));_0x53c4f0['query']=_[_0x6a0e('0x39')](_0x1b7dd5[_0x6a0e('0x3a')]);_0x53c4f0[_0x6a0e('0x3b')]=_[_0x6a0e('0x3c')](_0x53c4f0[_0x6a0e('0x38')],_0x53c4f0[_0x6a0e('0x3a')]);_0x4ad104['attributes']=_['intersection'](_0x53c4f0['model'],qs[_0x6a0e('0x3d')](_0x1b7dd5[_0x6a0e('0x3a')]['fields']));_0x4ad104[_0x6a0e('0x3e')]=_0x4ad104[_0x6a0e('0x3e')][_0x6a0e('0x3f')]?_0x4ad104[_0x6a0e('0x3e')]:_0x53c4f0[_0x6a0e('0x38')];if(!_0x1b7dd5[_0x6a0e('0x3a')][_0x6a0e('0x40')](_0x6a0e('0x41'))){_0x4ad104[_0x6a0e('0x22')]=qs[_0x6a0e('0x22')](_0x1b7dd5[_0x6a0e('0x3a')][_0x6a0e('0x22')]);_0x4ad104[_0x6a0e('0x42')]=qs[_0x6a0e('0x42')](_0x1b7dd5['query'][_0x6a0e('0x42')]);}_0x4ad104[_0x6a0e('0x43')]=qs[_0x6a0e('0x44')](_0x1b7dd5[_0x6a0e('0x3a')][_0x6a0e('0x44')]);_0x4ad104[_0x6a0e('0x45')]=qs['filters'](_[_0x6a0e('0x46')](_0x1b7dd5[_0x6a0e('0x3a')],_0x53c4f0[_0x6a0e('0x3b')]),_0x541dd2);if(_0x1b7dd5[_0x6a0e('0x3a')][_0x6a0e('0x47')]){_0x4ad104[_0x6a0e('0x45')]=_['merge'](_0x4ad104[_0x6a0e('0x45')],{'$or':_[_0x6a0e('0x34')](_0x541dd2,function(_0x1342ab){if(_0x1342ab[_0x6a0e('0x37')]!=='VIRTUAL'){var _0x432962={};_0x432962[_0x1342ab[_0x6a0e('0x31')]]={'$like':'%'+_0x1b7dd5[_0x6a0e('0x3a')][_0x6a0e('0x47')]+'%'};return _0x432962;}})});}_0x4ad104=_[_0x6a0e('0x48')]({},_0x4ad104,_0x1b7dd5[_0x6a0e('0x49')]);var _0x306bd6={'where':_0x4ad104[_0x6a0e('0x45')]};return db['CmList']['count'](_0x306bd6)['then'](function(_0x114b67){_0x7679ad[_0x6a0e('0x23')]=_0x114b67;if(_0x1b7dd5[_0x6a0e('0x3a')][_0x6a0e('0x4a')]){_0x4ad104['include']=[{'all':!![]}];}return db[_0x6a0e('0x4b')][_0x6a0e('0x4c')](_0x4ad104);})[_0x6a0e('0x2a')](function(_0x13f413){_0x7679ad[_0x6a0e('0x4d')]=_0x13f413;return _0x7679ad;})[_0x6a0e('0x2a')](respondWithFilteredResult(_0x40a3f7,_0x4ad104))[_0x6a0e('0x4e')](handleError(_0x40a3f7,null));};exports[_0x6a0e('0x4f')]=function(_0x5ce5d8,_0x1fa36b){var _0x5327ef={'raw':![],'where':{'id':_0x5ce5d8[_0x6a0e('0x50')]['id']}},_0x2d057b={};_0x2d057b['model']=_[_0x6a0e('0x39')](db[_0x6a0e('0x4b')]['rawAttributes']);_0x2d057b[_0x6a0e('0x3a')]=_[_0x6a0e('0x39')](_0x5ce5d8[_0x6a0e('0x3a')]);_0x2d057b[_0x6a0e('0x3b')]=_[_0x6a0e('0x3c')](_0x2d057b[_0x6a0e('0x38')],_0x2d057b[_0x6a0e('0x3a')]);_0x5327ef[_0x6a0e('0x3e')]=_[_0x6a0e('0x3c')](_0x2d057b[_0x6a0e('0x38')],qs[_0x6a0e('0x3d')](_0x5ce5d8['query'][_0x6a0e('0x3d')]));_0x5327ef[_0x6a0e('0x3e')]=_0x5327ef[_0x6a0e('0x3e')][_0x6a0e('0x3f')]?_0x5327ef['attributes']:_0x2d057b[_0x6a0e('0x38')];if(_0x5ce5d8[_0x6a0e('0x3a')][_0x6a0e('0x4a')]){_0x5327ef[_0x6a0e('0x51')]=[{'all':!![]}];}_0x5327ef=_[_0x6a0e('0x48')]({},_0x5327ef,_0x5ce5d8[_0x6a0e('0x49')]);return db[_0x6a0e('0x4b')]['find'](_0x5327ef)[_0x6a0e('0x2a')](handleEntityNotFound(_0x1fa36b,null))['then'](respondWithResult(_0x1fa36b,null))[_0x6a0e('0x4e')](handleError(_0x1fa36b,null));};exports[_0x6a0e('0x52')]=function(_0x5983a0,_0x3cb2fa){return db[_0x6a0e('0x4b')][_0x6a0e('0x52')](_0x5983a0[_0x6a0e('0x53')],{})['then'](function(_0x3acc80){var _0x4c2959=_0x5983a0[_0x6a0e('0x54')]['get']({'plain':!![]});if(!_0x4c2959)throw new Error(_0x6a0e('0x55'));if(_0x4c2959[_0x6a0e('0x56')]===_0x6a0e('0x54')){var _0x5b7b49=_0x3acc80['get']({'plain':!![]});var _0x16e15b=_0x6a0e('0x2d');return db[_0x6a0e('0x57')][_0x6a0e('0x58')]({'where':{'name':_0x16e15b,'userProfileId':_0x4c2959['userProfileId']},'raw':!![]})[_0x6a0e('0x2a')](function(_0x447f97){if(_0x447f97&&_0x447f97[_0x6a0e('0x59')]===0x0){return db[_0x6a0e('0x2e')][_0x6a0e('0x52')]({'name':_0x5b7b49['name'],'resourceId':_0x5b7b49['id'],'type':_0x447f97[_0x6a0e('0x31')],'sectionId':_0x447f97['id']},{})[_0x6a0e('0x2a')](function(){return _0x3acc80;});}else{return _0x3acc80;}})[_0x6a0e('0x4e')](function(_0x3fdfdd){logger[_0x6a0e('0x2f')](_0x6a0e('0x5a'),_0x3fdfdd);throw _0x3fdfdd;});}return _0x3acc80;})[_0x6a0e('0x2a')](respondWithResult(_0x3cb2fa,0xc9))[_0x6a0e('0x4e')](handleError(_0x3cb2fa,null));};exports['update']=function(_0x111434,_0x28b72a){if(_0x111434[_0x6a0e('0x53')]['id']){delete _0x111434[_0x6a0e('0x53')]['id'];}return db['CmList']['find']({'where':{'id':_0x111434[_0x6a0e('0x50')]['id']}})[_0x6a0e('0x2a')](handleEntityNotFound(_0x28b72a,null))['then'](saveUpdates(_0x111434[_0x6a0e('0x53')],null))[_0x6a0e('0x2a')](respondWithResult(_0x28b72a,null))[_0x6a0e('0x4e')](handleError(_0x28b72a,null));};exports['destroy']=function(_0x547395,_0x73f09f){return db[_0x6a0e('0x4b')]['find']({'where':{'id':_0x547395[_0x6a0e('0x50')]['id']}})['then'](handleEntityNotFound(_0x73f09f,null))[_0x6a0e('0x2a')](removeEntity(_0x73f09f,null))[_0x6a0e('0x4e')](handleError(_0x73f09f,null));};exports[_0x6a0e('0x5b')]=function(_0x387a1e,_0x4f734b){return db[_0x6a0e('0x4b')][_0x6a0e('0x5b')]()[_0x6a0e('0x2a')](respondWithResult(_0x4f734b,null))[_0x6a0e('0x4e')](handleError(_0x4f734b,null));};exports[_0x6a0e('0x5c')]=function(_0x3819d8,_0xd425d5,_0x4bcb80){if(_0x3819d8[_0x6a0e('0x53')]['id']){delete _0x3819d8[_0x6a0e('0x53')]['id'];}return db[_0x6a0e('0x4b')][_0x6a0e('0x58')]({'where':{'id':_0x3819d8[_0x6a0e('0x50')]['id']}})['then'](handleEntityNotFound(_0xd425d5,null))[_0x6a0e('0x2a')](function(_0x209d2c){if(_0x209d2c){_0x3819d8['body'][_0x6a0e('0x5d')]=_0x209d2c['id'];return db[_0x6a0e('0x5e')][_0x6a0e('0x52')](_0x3819d8[_0x6a0e('0x53')]);}})[_0x6a0e('0x2a')](respondWithResult(_0xd425d5,null))[_0x6a0e('0x4e')](handleError(_0xd425d5,null));};exports['getDispositions']=function(_0x37a4a1,_0x99cc1c,_0x2abc26){var _0xe30717={'raw':![],'where':{}};var _0x488ba2={};var _0x591a1f={'count':0x0,'rows':[]};return db[_0x6a0e('0x4b')]['findOne']({'where':{'id':_0x37a4a1[_0x6a0e('0x50')]['id']}})[_0x6a0e('0x2a')](handleEntityNotFound(_0x99cc1c,null))[_0x6a0e('0x2a')](function(_0x1c44aa){if(_0x1c44aa){_0x488ba2[_0x6a0e('0x38')]=_[_0x6a0e('0x39')](db[_0x6a0e('0x5e')][_0x6a0e('0x35')]);_0x488ba2[_0x6a0e('0x3a')]=_[_0x6a0e('0x39')](_0x37a4a1['query']);_0x488ba2['filters']=_[_0x6a0e('0x3c')](_0x488ba2[_0x6a0e('0x38')],_0x488ba2[_0x6a0e('0x3a')]);_0xe30717[_0x6a0e('0x3e')]=_[_0x6a0e('0x3c')](_0x488ba2['model'],qs[_0x6a0e('0x3d')](_0x37a4a1[_0x6a0e('0x3a')][_0x6a0e('0x3d')]));_0xe30717['attributes']=_0xe30717['attributes'][_0x6a0e('0x3f')]?_0xe30717[_0x6a0e('0x3e')]:_0x488ba2[_0x6a0e('0x38')];if(!_0x37a4a1[_0x6a0e('0x3a')]['hasOwnProperty']('nolimit')){_0xe30717[_0x6a0e('0x22')]=qs[_0x6a0e('0x22')](_0x37a4a1['query']['limit']);_0xe30717[_0x6a0e('0x42')]=qs[_0x6a0e('0x42')](_0x37a4a1['query'][_0x6a0e('0x42')]);}_0xe30717[_0x6a0e('0x43')]=qs[_0x6a0e('0x44')](_0x37a4a1[_0x6a0e('0x3a')][_0x6a0e('0x44')]);_0xe30717[_0x6a0e('0x45')]=qs[_0x6a0e('0x3b')](_[_0x6a0e('0x46')](_0x37a4a1[_0x6a0e('0x3a')],_0x488ba2[_0x6a0e('0x3b')]));_0xe30717[_0x6a0e('0x45')]['ListId']=_0x1c44aa['id'];if(_0x37a4a1['query'][_0x6a0e('0x47')]){_0xe30717[_0x6a0e('0x45')]=_[_0x6a0e('0x48')](_0xe30717[_0x6a0e('0x45')],{'$or':_['map'](_0xe30717[_0x6a0e('0x3e')],function(_0x2bf3be){var _0x1e502f={};_0x1e502f[_0x2bf3be]={'$like':'%'+_0x37a4a1['query'][_0x6a0e('0x47')]+'%'};return _0x1e502f;})});}_0xe30717=_['merge']({},_0xe30717,_0x37a4a1['options']);return db['Disposition'][_0x6a0e('0x23')]({'where':_0xe30717[_0x6a0e('0x45')]})['then'](function(_0x2e54be){_0x591a1f[_0x6a0e('0x23')]=_0x2e54be;if(_0x37a4a1[_0x6a0e('0x3a')][_0x6a0e('0x4a')]){_0xe30717['include']=[{'all':!![]}];}return db['Disposition'][_0x6a0e('0x4c')](_0xe30717);})[_0x6a0e('0x2a')](function(_0x523869){_0x591a1f[_0x6a0e('0x4d')]=_0x523869;return _0x591a1f;});}})['then'](respondWithFilteredResult(_0x99cc1c,_0xe30717))[_0x6a0e('0x4e')](handleError(_0x99cc1c,null));};exports[_0x6a0e('0x5f')]=function(_0x936c7a,_0x76ec97,_0x58766e){return db['CmList']['find']({'where':{'id':_0x936c7a['params']['id']}})[_0x6a0e('0x2a')](handleEntityNotFound(_0x76ec97,null))['then'](function(_0xc9d562){if(_0xc9d562){return _0xc9d562[_0x6a0e('0x5f')](_0x936c7a[_0x6a0e('0x3a')]['ids']);}})[_0x6a0e('0x2a')](respondWithStatusCode(_0x76ec97,null))[_0x6a0e('0x4e')](handleError(_0x76ec97,null));};exports['addContacts']=function(_0xb55ed6,_0x27b4d2,_0x4b1a2b){return db[_0x6a0e('0x4b')][_0x6a0e('0x58')]({'where':{'id':_0xb55ed6[_0x6a0e('0x50')]['id']}})['then'](handleEntityNotFound(_0x27b4d2,null))[_0x6a0e('0x2a')](function(_0x32f9c6){if(_0x32f9c6){var _0x383156=[];var _0x10b89f={'success':[],'errors':[]};return db[_0x6a0e('0x60')][_0x6a0e('0x5b')]()[_0x6a0e('0x2a')](function(_0x2e6f26){if(_0xb55ed6['body']['tags']&&_['isArray'](_0xb55ed6['body'][_0x6a0e('0x61')])){if(_0xb55ed6[_0x6a0e('0x53')]['tags'][_0x6a0e('0x3f')]){_0xb55ed6[_0x6a0e('0x53')]['tags']=_0xb55ed6[_0x6a0e('0x53')][_0x6a0e('0x61')]['join'](';')+';';}else{_0xb55ed6[_0x6a0e('0x53')][_0x6a0e('0x61')]=null;}}else{_0xb55ed6[_0x6a0e('0x53')][_0x6a0e('0x61')]=null;}if(_0xb55ed6[_0x6a0e('0x53')]&&_[_0x6a0e('0x62')](_0xb55ed6['body'])){for(var _0x11d897=0x0;_0x11d897<_0xb55ed6[_0x6a0e('0x53')][_0x6a0e('0x3f')];_0x11d897+=0x1){_0xb55ed6['body'][_0x11d897][_0x6a0e('0x5d')]=_0xb55ed6[_0x6a0e('0x50')]['id'];_0x383156[_0x6a0e('0x63')](_0xb55ed6['body'][_0x11d897]);}return BPromise[_0x6a0e('0x64')](_0x383156,function(_0x303587){return db['CmContact'][_0x6a0e('0x52')](_[_0x6a0e('0x65')](_0x303587,[_0x6a0e('0x66'),'id'])||{},{'fields':_['keys'](_0x2e6f26),'raw':!![]})[_0x6a0e('0x2a')](function(_0x4ed313){_0x10b89f[_0x6a0e('0x67')]['push'](_0x4ed313['dataValues']);})[_0x6a0e('0x4e')](function(_0x37bc89){_0x10b89f[_0x6a0e('0x68')]['push']({'data':_0x303587,'error':_0x37bc89['message']});});})['then'](function(_0x5442b1){return _0x10b89f;})[_0x6a0e('0x4e')](function(_0x237b10){return _0x237b10;});}else{_0x27b4d2[_0x6a0e('0x1e')](0x190)[_0x6a0e('0x20')]({'message':_0x6a0e('0x69')});}});}})[_0x6a0e('0x2a')](respondWithResult(_0x27b4d2,null))['catch'](handleError(_0x27b4d2,null));};exports[_0x6a0e('0x6a')]=function(_0x4426b3,_0x3233d8,_0x4ae3ba){var _0x20f520;return db[_0x6a0e('0x4b')]['find']({'where':{'id':_0x4426b3[_0x6a0e('0x50')]['id']},'include':[{'model':db[_0x6a0e('0x6b')],'as':_0x6a0e('0x6c')}]})[_0x6a0e('0x2a')](handleEntityNotFound(_0x3233d8,null))[_0x6a0e('0x2a')](function(_0x26adf0){if(_0x26adf0){_0x20f520=_0x26adf0;return db[_0x6a0e('0x60')][_0x6a0e('0x35')];}})[_0x6a0e('0x2a')](function(_0x94917f){if(_0x94917f){var _0x405633={};var _0x317cec={};_0x317cec[_0x6a0e('0x38')]=_[_0x6a0e('0x6d')](_['keys'](_0x94917f),_[_0x6a0e('0x34')](_0x20f520[_0x6a0e('0x6c')],function(_0x3a3872){return util[_0x6a0e('0x6e')](_0x6a0e('0x6f'),_0x3a3872['id']);}));_0x317cec[_0x6a0e('0x3a')]=_[_0x6a0e('0x39')](_0x4426b3[_0x6a0e('0x3a')]);_0x317cec[_0x6a0e('0x3b')]=_[_0x6a0e('0x3c')](_0x317cec[_0x6a0e('0x38')],_0x317cec['query']);_0x405633[_0x6a0e('0x3e')]=_[_0x6a0e('0x3c')](_0x317cec['model'],qs[_0x6a0e('0x3d')](_0x4426b3[_0x6a0e('0x3a')][_0x6a0e('0x3d')]));_0x405633[_0x6a0e('0x3e')]=_0x405633[_0x6a0e('0x3e')][_0x6a0e('0x3f')]?_0x405633[_0x6a0e('0x3e')]:_0x317cec[_0x6a0e('0x38')];if(!_0x4426b3['query'][_0x6a0e('0x40')](_0x6a0e('0x41'))){_0x405633[_0x6a0e('0x22')]=qs['limit'](_0x4426b3['query'][_0x6a0e('0x22')]);_0x405633[_0x6a0e('0x42')]=qs[_0x6a0e('0x42')](_0x4426b3['query'][_0x6a0e('0x42')]);}_0x405633['order']=qs['sort'](_0x4426b3['query'][_0x6a0e('0x44')]);_0x405633[_0x6a0e('0x45')]=qs['filters'](_[_0x6a0e('0x46')](_0x4426b3[_0x6a0e('0x3a')],_0x317cec[_0x6a0e('0x3b')]));_0x405633[_0x6a0e('0x70')]=!![];if(_0x4426b3[_0x6a0e('0x3a')][_0x6a0e('0x47')]){_0x405633[_0x6a0e('0x45')]=_['merge'](_0x405633[_0x6a0e('0x45')],{'$or':_[_0x6a0e('0x34')](_0x405633[_0x6a0e('0x3e')],function(_0x2b9554){var _0x1166c0={};_0x1166c0[_0x2b9554]={'$like':'%'+_0x4426b3[_0x6a0e('0x3a')][_0x6a0e('0x47')]+'%'};return _0x1166c0;})});}_0x405633=_[_0x6a0e('0x48')]({},_0x405633,_0x4426b3['options']);return _0x20f520[_0x6a0e('0x6a')](_0x405633);}})[_0x6a0e('0x2a')](respondWithResult(_0x3233d8,null))[_0x6a0e('0x4e')](handleError(_0x3233d8,null));};exports[_0x6a0e('0x71')]=function(_0x2017f6,_0x450cba,_0x1755c4){var _0x305566;var _0x2852d0;var _0x52a256;var _0xd8af5f=_0x2017f6[_0x6a0e('0x50')]['id'];csv_results=[];return db[_0x6a0e('0x72')][_0x6a0e('0x4c')]({'attributes':['id','name'],'raw':!![],'order':[_0x6a0e('0x73')]})[_0x6a0e('0x2a')](function(_0x181401){_0x305566=_0x181401;var _0x208198=_[_0x6a0e('0x39')](db[_0x6a0e('0x60')][_0x6a0e('0x35')]);return db[_0x6a0e('0x6b')][_0x6a0e('0x4c')]({'raw':!![],'attributes':['id',_0x6a0e('0x74')]})[_0x6a0e('0x2a')](function(_0x521e5d){_0x2852d0=_0x521e5d;var _0x269c29=squel[_0x6a0e('0x75')]()['fields'](_0x208198)['from'](_0x6a0e('0x76'),'c')[_0x6a0e('0x45')](_0x6a0e('0x77'),_0xd8af5f)[_0x6a0e('0x45')]('c.deletedAt\x20is\x20null')['distinct']();for(var _0x18dd17=0x0;_0x18dd17<_0x2852d0[_0x6a0e('0x3f')];_0x18dd17++){_0x269c29[_0x6a0e('0x78')](_0x6a0e('0x79')+_0x2852d0[_0x18dd17]['id'],'customField_'+_0x2852d0[_0x18dd17]['alias']);}for(var _0x18dd17=0x0;_0x18dd17<_0x305566[_0x6a0e('0x3f')];_0x18dd17++){_0x269c29[_0x6a0e('0x78')](squel[_0x6a0e('0x75')]()['field'](_0x6a0e('0x7a'))[_0x6a0e('0x7b')](_0x6a0e('0x7c'))[_0x6a0e('0x45')](_0x6a0e('0x7d'),_0x305566[_0x18dd17]['id'])[_0x6a0e('0x45')](_0x6a0e('0x7e')),'additionalPhone_'+_0x305566[_0x18dd17][_0x6a0e('0x31')]);_0x269c29[_0x6a0e('0x78')](squel['select']()[_0x6a0e('0x78')]('description')[_0x6a0e('0x7b')]('cm_contact_has_items')['where'](_0x6a0e('0x7d'),_0x305566[_0x18dd17]['id'])['where'](_0x6a0e('0x7e')),_0x6a0e('0x7f')+_0x305566[_0x18dd17]['name']);}var _0x704691=[];_0x704691[_0x6a0e('0x63')](_0x269c29[_0x6a0e('0x80')]());BPromise['each'](_0x704691,handleQuery)[_0x6a0e('0x2a')](function(_0x320f74){handleQuery(_0x269c29['toString']());var _0x4c5bc5=csv_results[0x0];if(!_['isEmpty'](_0x4c5bc5)){var _0x471dd5=toCsv(_0x4c5bc5);var _0x11889a=Date['now']();fs['writeFileSync'](util[_0x6a0e('0x6e')](_0x6a0e('0x81'),_0xd8af5f,_0x11889a),_0x471dd5);_0x450cba[_0x6a0e('0x82')]('Content-disposition',_0x6a0e('0x83')+util[_0x6a0e('0x6e')](_0x6a0e('0x84'),_0xd8af5f,_0x11889a));_0x450cba[_0x6a0e('0x82')](_0x6a0e('0x85'),_0x6a0e('0x86'));return _0x450cba[_0x6a0e('0x87')](util[_0x6a0e('0x6e')]('/tmp/list_%d_%s.csv',_0xd8af5f,_0x11889a));}else{return _0x450cba['sendStatus'](0xcc);}});});});};exports[_0x6a0e('0x88')]=function(_0x169866,_0x1ec278,_0x1d66ec){var _0x46adc8;delete _0x169866[_0x6a0e('0x53')]['id'];return db[_0x6a0e('0x4b')][_0x6a0e('0x89')]({'where':{'id':_0x169866[_0x6a0e('0x50')]['id']}})[_0x6a0e('0x2a')](handleEntityNotFound(_0x1ec278,null))['then'](function(_0x32b462){if(_0x32b462){return db['sequelize'][_0x6a0e('0x8a')](function(_0x47648b){return db[_0x6a0e('0x6b')][_0x6a0e('0x52')](_0x169866[_0x6a0e('0x53')],{'transaction':_0x47648b})['then'](function(_0x1605f6){_0x46adc8=_0x1605f6;return _0x32b462[_0x6a0e('0x8b')](_0x1605f6,{'transaction':_0x47648b});})[_0x6a0e('0x2a')](function(){var _0x16c0c8={'type':db[_0x6a0e('0x8c')][_0x6a0e('0x8d')],'transaction':_0x47648b};switch(_0x169866[_0x6a0e('0x53')]['type']){case'text':_0x16c0c8['type']=db[_0x6a0e('0x8c')][_0x6a0e('0x8d')];break;case _0x6a0e('0x8e'):_0x16c0c8[_0x6a0e('0x37')]=db[_0x6a0e('0x8c')][_0x6a0e('0x8f')];break;case _0x6a0e('0x90'):_0x16c0c8[_0x6a0e('0x37')]=db[_0x6a0e('0x8c')]['BOOLEAN'];_0x16c0c8['defaultValue']=![];break;default:}return db[_0x6a0e('0x91')][_0x6a0e('0x92')][_0x6a0e('0x93')]('cm_contacts',util[_0x6a0e('0x6e')]('cf_%s',_0x46adc8['id']),_0x16c0c8);})['then'](function(){return _0x46adc8;});});}})[_0x6a0e('0x2a')](respondWithResult(_0x1ec278,null))['catch'](handleError(_0x1ec278,null));};exports['getCustomFields']=function(_0x272306,_0x34f7a8,_0x3c4533){var _0x250dca={};var _0x212eb0={};var _0x1dd6af;var _0x130412;return db['CmList'][_0x6a0e('0x89')]({'where':{'id':_0x272306['params']['id']}})[_0x6a0e('0x2a')](handleEntityNotFound(_0x34f7a8,null))['then'](function(_0x5499e6){if(_0x5499e6){_0x1dd6af=_0x5499e6;_0x212eb0[_0x6a0e('0x38')]=_['keys'](db['CmCustomField']['rawAttributes']);_0x212eb0[_0x6a0e('0x3a')]=_[_0x6a0e('0x39')](_0x272306[_0x6a0e('0x3a')]);_0x212eb0['filters']=_[_0x6a0e('0x3c')](_0x212eb0[_0x6a0e('0x38')],_0x212eb0['query']);_0x250dca[_0x6a0e('0x3e')]=_[_0x6a0e('0x3c')](_0x212eb0['model'],qs[_0x6a0e('0x3d')](_0x272306[_0x6a0e('0x3a')][_0x6a0e('0x3d')]));_0x250dca['attributes']=_0x250dca[_0x6a0e('0x3e')][_0x6a0e('0x3f')]?_0x250dca[_0x6a0e('0x3e')]:_0x212eb0[_0x6a0e('0x38')];_0x250dca[_0x6a0e('0x43')]=qs[_0x6a0e('0x44')](_0x272306[_0x6a0e('0x3a')]['sort']);_0x250dca['where']=qs[_0x6a0e('0x3b')](_[_0x6a0e('0x46')](_0x272306[_0x6a0e('0x3a')],_0x212eb0[_0x6a0e('0x3b')]));_0x250dca['where']=_[_0x6a0e('0x48')](_0x250dca[_0x6a0e('0x45')],{'$or':[{'ListId':_0x5499e6['id']},{'ListId':null}]});if(_0x272306[_0x6a0e('0x3a')][_0x6a0e('0x47')]){_0x250dca[_0x6a0e('0x45')]=_[_0x6a0e('0x48')](_0x250dca[_0x6a0e('0x45')],{'$or':_['map'](_0x250dca['attributes'],function(_0x17dbaf){var _0x508089={};_0x508089[_0x17dbaf]={'$like':'%'+_0x272306[_0x6a0e('0x3a')][_0x6a0e('0x47')]+'%'};return _0x508089;})});}_0x250dca=_['merge']({},_0x250dca,_0x272306[_0x6a0e('0x49')]);return db[_0x6a0e('0x6b')][_0x6a0e('0x94')](_0x250dca);}})['then'](respondWithResult(_0x34f7a8,null))['catch'](handleError(_0x34f7a8,null));};exports[_0x6a0e('0x95')]=function(_0x4e9066,_0x1ef0ed){return db['CmCustomField'][_0x6a0e('0x94')]({'where':{'ListId':null}})['then'](handleEntityNotFound(_0x1ef0ed,null))[_0x6a0e('0x2a')](function(_0x33f4ae){return _0x33f4ae;})['then'](respondWithResult(_0x1ef0ed,null))[_0x6a0e('0x4e')](handleError(_0x1ef0ed,null));};exports[_0x6a0e('0x96')]=function(_0x2ea1b9,_0x4d317c,_0x1f93c8){return db[_0x6a0e('0x4b')][_0x6a0e('0x58')]({'where':{'id':_0x2ea1b9[_0x6a0e('0x50')]['id']}})[_0x6a0e('0x2a')](handleEntityNotFound(_0x4d317c,null))[_0x6a0e('0x2a')](function(_0x14a22e){if(_0x14a22e){return _0x14a22e[_0x6a0e('0x96')](_0x2ea1b9['body'][_0x6a0e('0x66')],_['omit'](_0x2ea1b9['body'],['ids','id'])||{})[_0x6a0e('0x97')](function(_0x323b64){for(var _0x1c35ab=0x0;_0x1c35ab<_0x2ea1b9[_0x6a0e('0x53')][_0x6a0e('0x66')][_0x6a0e('0x3f')];_0x1c35ab+=0x1){socket['emit']('userCmList:save',{'UserId':Number(_0x2ea1b9[_0x6a0e('0x53')][_0x6a0e('0x66')][_0x1c35ab]),'CmListId':Number(_0x2ea1b9[_0x6a0e('0x50')]['id'])});}return _0x323b64;});}})[_0x6a0e('0x2a')](respondWithResult(_0x4d317c,null))[_0x6a0e('0x4e')](handleError(_0x4d317c,null));};exports[_0x6a0e('0x98')]=function(_0x1c7a47,_0x54c9f1,_0x5d4677){return db[_0x6a0e('0x4b')]['find']({'where':{'id':_0x1c7a47[_0x6a0e('0x50')]['id']}})['then'](handleEntityNotFound(_0x54c9f1,null))[_0x6a0e('0x2a')](function(_0x4baf05){if(_0x4baf05){return _0x4baf05[_0x6a0e('0x98')](_0x1c7a47[_0x6a0e('0x3a')][_0x6a0e('0x66')])[_0x6a0e('0x2a')](function(){if(_[_0x6a0e('0x62')](_0x1c7a47[_0x6a0e('0x3a')]['ids'])){for(var _0xb40b53=0x0;_0xb40b53<_0x1c7a47[_0x6a0e('0x3a')][_0x6a0e('0x66')][_0x6a0e('0x3f')];_0xb40b53+=0x1){socket[_0x6a0e('0x99')](_0x6a0e('0x9a'),{'UserId':Number(_0x1c7a47[_0x6a0e('0x3a')][_0x6a0e('0x66')][_0xb40b53]),'CmListId':Number(_0x1c7a47[_0x6a0e('0x50')]['id'])});}}else{socket[_0x6a0e('0x99')](_0x6a0e('0x9a'),{'UserId':Number(_0x1c7a47[_0x6a0e('0x3a')][_0x6a0e('0x66')]),'CmListId':Number(_0x1c7a47[_0x6a0e('0x50')]['id'])});}});}})[_0x6a0e('0x2a')](respondWithStatusCode(_0x54c9f1,null))['catch'](handleError(_0x54c9f1,null));};exports[_0x6a0e('0x9b')]=function(_0x8e0702,_0x370310,_0x36f141){var _0x4f3d77={};var _0x1a0465={};var _0x50c4a6;var _0x4a5467;return db['CmList'][_0x6a0e('0x89')]({'where':{'id':_0x8e0702[_0x6a0e('0x50')]['id']}})[_0x6a0e('0x2a')](handleEntityNotFound(_0x370310,null))[_0x6a0e('0x2a')](function(_0x1ab68f){if(_0x1ab68f){_0x50c4a6=_0x1ab68f;_0x1a0465[_0x6a0e('0x38')]=_[_0x6a0e('0x39')](db['User'][_0x6a0e('0x35')]);_0x1a0465[_0x6a0e('0x3a')]=_[_0x6a0e('0x39')](_0x8e0702[_0x6a0e('0x3a')]);_0x1a0465[_0x6a0e('0x3b')]=_[_0x6a0e('0x3c')](_0x1a0465[_0x6a0e('0x38')],_0x1a0465[_0x6a0e('0x3a')]);_0x4f3d77[_0x6a0e('0x3e')]=_['intersection'](_0x1a0465[_0x6a0e('0x38')],qs['fields'](_0x8e0702[_0x6a0e('0x3a')][_0x6a0e('0x3d')]));_0x4f3d77[_0x6a0e('0x3e')]=_0x4f3d77[_0x6a0e('0x3e')][_0x6a0e('0x3f')]?_0x4f3d77[_0x6a0e('0x3e')]:_0x1a0465[_0x6a0e('0x38')];_0x4f3d77[_0x6a0e('0x43')]=qs[_0x6a0e('0x44')](_0x8e0702['query'][_0x6a0e('0x44')]);_0x4f3d77[_0x6a0e('0x45')]=qs['filters'](_[_0x6a0e('0x46')](_0x8e0702[_0x6a0e('0x3a')],_0x1a0465['filters']));if(_0x8e0702[_0x6a0e('0x3a')][_0x6a0e('0x47')]){_0x4f3d77[_0x6a0e('0x45')]=_[_0x6a0e('0x48')](_0x4f3d77['where'],{'$or':_[_0x6a0e('0x34')](_0x4f3d77['attributes'],function(_0x2e1043){var _0x5a98e8={};_0x5a98e8[_0x2e1043]={'$like':'%'+_0x8e0702[_0x6a0e('0x3a')][_0x6a0e('0x47')]+'%'};return _0x5a98e8;})});}_0x4f3d77=_[_0x6a0e('0x48')]({},_0x4f3d77,_0x8e0702[_0x6a0e('0x49')]);return _0x50c4a6[_0x6a0e('0x9b')](_0x4f3d77);}})[_0x6a0e('0x2a')](function(_0x163492){if(_0x163492){_0x4a5467=_0x163492['length'];if(!_0x8e0702[_0x6a0e('0x3a')]['hasOwnProperty'](_0x6a0e('0x41'))){_0x4f3d77[_0x6a0e('0x22')]=qs[_0x6a0e('0x22')](_0x8e0702['query']['limit']);_0x4f3d77['offset']=qs['offset'](_0x8e0702['query'][_0x6a0e('0x42')]);}return _0x50c4a6[_0x6a0e('0x9b')](_0x4f3d77);}})[_0x6a0e('0x2a')](function(_0xbba243){if(_0xbba243){return _0xbba243?{'count':_0x4a5467,'rows':_0xbba243}:null;}})[_0x6a0e('0x2a')](respondWithResult(_0x370310,null))[_0x6a0e('0x4e')](handleError(_0x370310,null));};function handleQuery(_0x4acdf0){logger[_0x6a0e('0x9c')](_0x4acdf0);return db[_0x6a0e('0x91')][_0x6a0e('0x3a')](_0x4acdf0)[_0x6a0e('0x97')](function(_0x3c62c2){csv_results['push'](_0x3c62c2);})[_0x6a0e('0x4e')](function(_0x28b3f2){logger[_0x6a0e('0x2f')](_0x28b3f2['message']);});} \ No newline at end of file +var _0xafcf=['autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','Disposition','hasOwnProperty','findAll','removeDispositions','ids','tags','join','push','CmContact','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','concat','format','raw','getContactsCsv','ContactItemType','alias','select','cm_contacts','c.ListId\x20=\x20?','c.deletedAt\x20is\x20null','distinct','field','c.cf_','customField_','item','cm_contact_has_items','CmContactId\x20=\x20c.id','additionalPhone_','description','from','ItemTypeId\x20=\x20?','toString','each','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','download','sendStatus','addCustomField','findOne','addCustomFields','TEXT','text','Sequelize','number','switch','queryInterface','addColumn','cf_%s','getCustomFields','findAndCountAll','getGlobalCustomFields','addAgents','emit','userCmList:save','removeAgents','isArray','userCmList:remove','User','getAgents','info','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','then','destroy','get','Lists','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','CmList','includeAll','include','rows','catch','params','keys','find','create','body','user','role'];(function(_0x527e60,_0x244fb4){var _0x23db33=function(_0x20de14){while(--_0x20de14){_0x527e60['push'](_0x527e60['shift']());}};_0x23db33(++_0x244fb4);}(_0xafcf,0xf2));var _0xfafc=function(_0x55527b,_0x293c9a){_0x55527b=_0x55527b-0x0;var _0xd2577b=_0xafcf[_0x55527b];return _0xd2577b;};'use strict';var emlformat=require(_0xfafc('0x0'));var rimraf=require(_0xfafc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfafc('0x2'));var rp=require(_0xfafc('0x3'));var moment=require(_0xfafc('0x4'));var BPromise=require(_0xfafc('0x5'));var Mustache=require(_0xfafc('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xfafc('0x7'));var ejs=require(_0xfafc('0x8'));var fs=require('fs');var fs_extra=require(_0xfafc('0x9'));var _=require(_0xfafc('0xa'));var squel=require('squel');var crypto=require(_0xfafc('0xb'));var jsforce=require(_0xfafc('0xc'));var deskjs=require(_0xfafc('0xd'));var toCsv=require(_0xfafc('0x7'));var querystring=require(_0xfafc('0xe'));var Papa=require(_0xfafc('0xf'));var Redis=require('ioredis');var authService=require(_0xfafc('0x10'));var qs=require(_0xfafc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfafc('0x12'))(_0xfafc('0x13'));var utils=require(_0xfafc('0x14'));var config=require(_0xfafc('0x15'));var licenseUtil=require(_0xfafc('0x16'));var db=require(_0xfafc('0x17'))['db'];var csv_results;config[_0xfafc('0x18')]=_[_0xfafc('0x19')](config['redis'],{'host':_0xfafc('0x1a'),'port':0x18eb});var socket=require(_0xfafc('0x1b'))(new Redis(config[_0xfafc('0x18')]));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0x49311f,_0x1a7c77){_0x1a7c77=_0x1a7c77||0xcc;return function(_0x157c7a){if(_0x157c7a){return _0x49311f['sendStatus'](_0x1a7c77);}return _0x49311f[_0xfafc('0x1c')](_0x1a7c77)[_0xfafc('0x1d')]();};}function respondWithResult(_0x359e96,_0x1358b0){_0x1358b0=_0x1358b0||0xc8;return function(_0x4a6f85){if(_0x4a6f85){return _0x359e96[_0xfafc('0x1c')](_0x1358b0)[_0xfafc('0x1e')](_0x4a6f85);}};}function respondWithFilteredResult(_0x506204,_0x42697e){return function(_0x3672dd){if(_0x3672dd){var _0x2dc4fe=typeof _0x42697e[_0xfafc('0x1f')]==='undefined'&&typeof _0x42697e[_0xfafc('0x20')]===_0xfafc('0x21');var _0x50d161=_0x3672dd[_0xfafc('0x22')];var _0x506593=_0x2dc4fe?0x0:_0x42697e[_0xfafc('0x1f')];var _0x5b685f=_0x2dc4fe?_0x3672dd[_0xfafc('0x22')]:_0x42697e[_0xfafc('0x1f')]+_0x42697e[_0xfafc('0x20')];var _0x2eddb9;if(_0x5b685f>=_0x50d161){_0x5b685f=_0x50d161;_0x2eddb9=0xc8;}else{_0x2eddb9=0xce;}_0x506204[_0xfafc('0x1c')](_0x2eddb9);return _0x506204[_0xfafc('0x23')](_0xfafc('0x24'),_0x506593+'-'+_0x5b685f+'/'+_0x50d161)[_0xfafc('0x1e')](_0x3672dd);}return null;};}function patchUpdates(_0x6a6588){return function(_0x219e85){try{jsonpatch[_0xfafc('0x25')](_0x219e85,_0x6a6588,!![]);}catch(_0x44c9ec){return BPromise['reject'](_0x44c9ec);}return _0x219e85['save']();};}function saveUpdates(_0x484271,_0x11f202){return function(_0x785380){if(_0x785380){return _0x785380['update'](_0x484271)[_0xfafc('0x26')](function(_0x4366a0){return _0x4366a0;});}return null;};}function removeEntity(_0x56aa13,_0x59e467){return function(_0x5dbb5b){if(_0x5dbb5b){return _0x5dbb5b[_0xfafc('0x27')]()[_0xfafc('0x26')](function(){var _0x508da6=_0x5dbb5b[_0xfafc('0x28')]({'plain':!![]});var _0x2aff29=_0xfafc('0x29');return db[_0xfafc('0x2a')]['destroy']({'where':{'type':_0x2aff29,'resourceId':_0x508da6['id']}})[_0xfafc('0x26')](function(){return _0x5dbb5b;});})[_0xfafc('0x26')](function(){_0x56aa13[_0xfafc('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x488a5e,_0x4fe593){return function(_0xd186d2){if(!_0xd186d2){_0x488a5e['sendStatus'](0x194);}return _0xd186d2;};}function handleError(_0x4f1f97,_0x1f46c2){_0x1f46c2=_0x1f46c2||0x1f4;return function(_0x10951d){logger['error'](_0x10951d[_0xfafc('0x2b')]);if(_0x10951d[_0xfafc('0x2c')]){delete _0x10951d[_0xfafc('0x2c')];}_0x4f1f97[_0xfafc('0x1c')](_0x1f46c2)[_0xfafc('0x2d')](_0x10951d);};}exports[_0xfafc('0x2e')]=function(_0x2f94bc,_0x1b246c){var _0xb5c9b6={},_0x4e0be5={},_0xecb732={'count':0x0,'rows':[]};var _0x376c93=_[_0xfafc('0x2f')](db['CmList'][_0xfafc('0x30')],function(_0x452a5f){return{'name':_0x452a5f[_0xfafc('0x31')],'type':_0x452a5f[_0xfafc('0x32')][_0xfafc('0x33')]};});_0x4e0be5['model']=_[_0xfafc('0x2f')](_0x376c93,_0xfafc('0x2c'));_0x4e0be5['query']=_['keys'](_0x2f94bc[_0xfafc('0x34')]);_0x4e0be5['filters']=_[_0xfafc('0x35')](_0x4e0be5['model'],_0x4e0be5['query']);_0xb5c9b6[_0xfafc('0x36')]=_['intersection'](_0x4e0be5[_0xfafc('0x37')],qs[_0xfafc('0x38')](_0x2f94bc[_0xfafc('0x34')][_0xfafc('0x38')]));_0xb5c9b6[_0xfafc('0x36')]=_0xb5c9b6[_0xfafc('0x36')][_0xfafc('0x39')]?_0xb5c9b6[_0xfafc('0x36')]:_0x4e0be5[_0xfafc('0x37')];if(!_0x2f94bc['query']['hasOwnProperty'](_0xfafc('0x3a'))){_0xb5c9b6[_0xfafc('0x20')]=qs['limit'](_0x2f94bc[_0xfafc('0x34')][_0xfafc('0x20')]);_0xb5c9b6[_0xfafc('0x1f')]=qs[_0xfafc('0x1f')](_0x2f94bc[_0xfafc('0x34')][_0xfafc('0x1f')]);}_0xb5c9b6[_0xfafc('0x3b')]=qs['sort'](_0x2f94bc[_0xfafc('0x34')][_0xfafc('0x3c')]);_0xb5c9b6[_0xfafc('0x3d')]=qs['filters'](_[_0xfafc('0x3e')](_0x2f94bc[_0xfafc('0x34')],_0x4e0be5[_0xfafc('0x3f')]),_0x376c93);if(_0x2f94bc[_0xfafc('0x34')][_0xfafc('0x40')]){_0xb5c9b6[_0xfafc('0x3d')]=_[_0xfafc('0x41')](_0xb5c9b6['where'],{'$or':_[_0xfafc('0x2f')](_0x376c93,function(_0x2ec943){if(_0x2ec943[_0xfafc('0x32')]!==_0xfafc('0x42')){var _0x17f5f3={};_0x17f5f3[_0x2ec943['name']]={'$like':'%'+_0x2f94bc[_0xfafc('0x34')]['filter']+'%'};return _0x17f5f3;}})});}_0xb5c9b6=_['merge']({},_0xb5c9b6,_0x2f94bc[_0xfafc('0x43')]);var _0x30f2c3={'where':_0xb5c9b6['where']};return db[_0xfafc('0x44')]['count'](_0x30f2c3)['then'](function(_0x5214e1){_0xecb732[_0xfafc('0x22')]=_0x5214e1;if(_0x2f94bc[_0xfafc('0x34')][_0xfafc('0x45')]){_0xb5c9b6[_0xfafc('0x46')]=[{'all':!![]}];}return db[_0xfafc('0x44')]['findAll'](_0xb5c9b6);})['then'](function(_0x4bc0bb){_0xecb732[_0xfafc('0x47')]=_0x4bc0bb;return _0xecb732;})[_0xfafc('0x26')](respondWithFilteredResult(_0x1b246c,_0xb5c9b6))[_0xfafc('0x48')](handleError(_0x1b246c,null));};exports['show']=function(_0x39d0e0,_0x2ab547){var _0x2329e5={'raw':![],'where':{'id':_0x39d0e0[_0xfafc('0x49')]['id']}},_0x2598ba={};_0x2598ba[_0xfafc('0x37')]=_[_0xfafc('0x4a')](db[_0xfafc('0x44')][_0xfafc('0x30')]);_0x2598ba[_0xfafc('0x34')]=_['keys'](_0x39d0e0['query']);_0x2598ba['filters']=_['intersection'](_0x2598ba[_0xfafc('0x37')],_0x2598ba[_0xfafc('0x34')]);_0x2329e5[_0xfafc('0x36')]=_[_0xfafc('0x35')](_0x2598ba[_0xfafc('0x37')],qs['fields'](_0x39d0e0[_0xfafc('0x34')]['fields']));_0x2329e5['attributes']=_0x2329e5['attributes']['length']?_0x2329e5[_0xfafc('0x36')]:_0x2598ba[_0xfafc('0x37')];if(_0x39d0e0['query'][_0xfafc('0x45')]){_0x2329e5[_0xfafc('0x46')]=[{'all':!![]}];}_0x2329e5=_[_0xfafc('0x41')]({},_0x2329e5,_0x39d0e0['options']);return db[_0xfafc('0x44')][_0xfafc('0x4b')](_0x2329e5)[_0xfafc('0x26')](handleEntityNotFound(_0x2ab547,null))[_0xfafc('0x26')](respondWithResult(_0x2ab547,null))[_0xfafc('0x48')](handleError(_0x2ab547,null));};exports['create']=function(_0x402b41,_0x196c29){return db['CmList'][_0xfafc('0x4c')](_0x402b41[_0xfafc('0x4d')],{})['then'](function(_0x13762c){var _0x3ba37d=_0x402b41[_0xfafc('0x4e')]['get']({'plain':!![]});if(!_0x3ba37d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ba37d[_0xfafc('0x4f')]==='user'){var _0x1dadec=_0x13762c[_0xfafc('0x28')]({'plain':!![]});var _0x119907=_0xfafc('0x29');return db['UserProfileSection'][_0xfafc('0x4b')]({'where':{'name':_0x119907,'userProfileId':_0x3ba37d['userProfileId']},'raw':!![]})[_0xfafc('0x26')](function(_0x2c8862){if(_0x2c8862&&_0x2c8862[_0xfafc('0x50')]===0x0){return db[_0xfafc('0x2a')][_0xfafc('0x4c')]({'name':_0x1dadec[_0xfafc('0x2c')],'resourceId':_0x1dadec['id'],'type':_0x2c8862['name'],'sectionId':_0x2c8862['id']},{})['then'](function(){return _0x13762c;});}else{return _0x13762c;}})[_0xfafc('0x48')](function(_0x8e9073){logger[_0xfafc('0x51')](_0xfafc('0x52'),_0x8e9073);throw _0x8e9073;});}return _0x13762c;})[_0xfafc('0x26')](respondWithResult(_0x196c29,0xc9))['catch'](handleError(_0x196c29,null));};exports[_0xfafc('0x53')]=function(_0x5f2dc1,_0x52bb55){if(_0x5f2dc1[_0xfafc('0x4d')]['id']){delete _0x5f2dc1[_0xfafc('0x4d')]['id'];}return db['CmList']['find']({'where':{'id':_0x5f2dc1['params']['id']}})[_0xfafc('0x26')](handleEntityNotFound(_0x52bb55,null))[_0xfafc('0x26')](saveUpdates(_0x5f2dc1[_0xfafc('0x4d')],null))[_0xfafc('0x26')](respondWithResult(_0x52bb55,null))[_0xfafc('0x48')](handleError(_0x52bb55,null));};exports[_0xfafc('0x27')]=function(_0x1f0488,_0xcc464c){return db[_0xfafc('0x44')][_0xfafc('0x4b')]({'where':{'id':_0x1f0488[_0xfafc('0x49')]['id']}})['then'](handleEntityNotFound(_0xcc464c,null))[_0xfafc('0x26')](removeEntity(_0xcc464c,null))[_0xfafc('0x48')](handleError(_0xcc464c,null));};exports[_0xfafc('0x54')]=function(_0x237597,_0x583039){return db[_0xfafc('0x44')][_0xfafc('0x54')]()[_0xfafc('0x26')](respondWithResult(_0x583039,null))['catch'](handleError(_0x583039,null));};exports[_0xfafc('0x55')]=function(_0xf703f8,_0x2720d6,_0x3af23e){if(_0xf703f8[_0xfafc('0x4d')]['id']){delete _0xf703f8[_0xfafc('0x4d')]['id'];}return db[_0xfafc('0x44')][_0xfafc('0x4b')]({'where':{'id':_0xf703f8[_0xfafc('0x49')]['id']}})['then'](handleEntityNotFound(_0x2720d6,null))[_0xfafc('0x26')](function(_0x3b4c54){if(_0x3b4c54){_0xf703f8[_0xfafc('0x4d')][_0xfafc('0x56')]=_0x3b4c54['id'];return db[_0xfafc('0x57')][_0xfafc('0x4c')](_0xf703f8['body']);}})['then'](respondWithResult(_0x2720d6,null))['catch'](handleError(_0x2720d6,null));};exports['getDispositions']=function(_0x559bf6,_0x5f224a,_0x12e71a){var _0x39c6b7={'raw':![],'where':{}};var _0x64b34d={};var _0x2c49ca={'count':0x0,'rows':[]};return db[_0xfafc('0x44')]['findOne']({'where':{'id':_0x559bf6[_0xfafc('0x49')]['id']}})[_0xfafc('0x26')](handleEntityNotFound(_0x5f224a,null))[_0xfafc('0x26')](function(_0x12331e){if(_0x12331e){_0x64b34d[_0xfafc('0x37')]=_[_0xfafc('0x4a')](db[_0xfafc('0x57')][_0xfafc('0x30')]);_0x64b34d[_0xfafc('0x34')]=_[_0xfafc('0x4a')](_0x559bf6[_0xfafc('0x34')]);_0x64b34d[_0xfafc('0x3f')]=_['intersection'](_0x64b34d[_0xfafc('0x37')],_0x64b34d[_0xfafc('0x34')]);_0x39c6b7[_0xfafc('0x36')]=_[_0xfafc('0x35')](_0x64b34d[_0xfafc('0x37')],qs[_0xfafc('0x38')](_0x559bf6['query']['fields']));_0x39c6b7[_0xfafc('0x36')]=_0x39c6b7[_0xfafc('0x36')][_0xfafc('0x39')]?_0x39c6b7[_0xfafc('0x36')]:_0x64b34d[_0xfafc('0x37')];if(!_0x559bf6[_0xfafc('0x34')][_0xfafc('0x58')](_0xfafc('0x3a'))){_0x39c6b7[_0xfafc('0x20')]=qs[_0xfafc('0x20')](_0x559bf6['query'][_0xfafc('0x20')]);_0x39c6b7[_0xfafc('0x1f')]=qs['offset'](_0x559bf6[_0xfafc('0x34')][_0xfafc('0x1f')]);}_0x39c6b7['order']=qs[_0xfafc('0x3c')](_0x559bf6[_0xfafc('0x34')][_0xfafc('0x3c')]);_0x39c6b7[_0xfafc('0x3d')]=qs[_0xfafc('0x3f')](_['pick'](_0x559bf6[_0xfafc('0x34')],_0x64b34d['filters']));_0x39c6b7[_0xfafc('0x3d')][_0xfafc('0x56')]=_0x12331e['id'];if(_0x559bf6['query'][_0xfafc('0x40')]){_0x39c6b7[_0xfafc('0x3d')]=_[_0xfafc('0x41')](_0x39c6b7[_0xfafc('0x3d')],{'$or':_[_0xfafc('0x2f')](_0x39c6b7[_0xfafc('0x36')],function(_0x6aa768){var _0x4c9380={};_0x4c9380[_0x6aa768]={'$like':'%'+_0x559bf6[_0xfafc('0x34')][_0xfafc('0x40')]+'%'};return _0x4c9380;})});}_0x39c6b7=_[_0xfafc('0x41')]({},_0x39c6b7,_0x559bf6[_0xfafc('0x43')]);return db[_0xfafc('0x57')][_0xfafc('0x22')]({'where':_0x39c6b7[_0xfafc('0x3d')]})[_0xfafc('0x26')](function(_0x2d38af){_0x2c49ca[_0xfafc('0x22')]=_0x2d38af;if(_0x559bf6['query'][_0xfafc('0x45')]){_0x39c6b7['include']=[{'all':!![]}];}return db['Disposition'][_0xfafc('0x59')](_0x39c6b7);})['then'](function(_0x134946){_0x2c49ca['rows']=_0x134946;return _0x2c49ca;});}})[_0xfafc('0x26')](respondWithFilteredResult(_0x5f224a,_0x39c6b7))[_0xfafc('0x48')](handleError(_0x5f224a,null));};exports[_0xfafc('0x5a')]=function(_0xbec6df,_0x5780ee,_0x30c557){return db[_0xfafc('0x44')]['find']({'where':{'id':_0xbec6df[_0xfafc('0x49')]['id']}})['then'](handleEntityNotFound(_0x5780ee,null))[_0xfafc('0x26')](function(_0x242e3b){if(_0x242e3b){return _0x242e3b[_0xfafc('0x5a')](_0xbec6df[_0xfafc('0x34')][_0xfafc('0x5b')]);}})[_0xfafc('0x26')](respondWithStatusCode(_0x5780ee,null))[_0xfafc('0x48')](handleError(_0x5780ee,null));};exports['addContacts']=function(_0x21762c,_0x38a155,_0xc9006e){return db[_0xfafc('0x44')][_0xfafc('0x4b')]({'where':{'id':_0x21762c[_0xfafc('0x49')]['id']}})[_0xfafc('0x26')](handleEntityNotFound(_0x38a155,null))[_0xfafc('0x26')](function(_0x310e27){if(_0x310e27){var _0x1a6b9b=[];var _0x2bc331={'success':[],'errors':[]};return db['CmContact'][_0xfafc('0x54')]()[_0xfafc('0x26')](function(_0xa47248){if(_0x21762c['body']['tags']&&_['isArray'](_0x21762c[_0xfafc('0x4d')][_0xfafc('0x5c')])){if(_0x21762c[_0xfafc('0x4d')]['tags']['length']){_0x21762c[_0xfafc('0x4d')][_0xfafc('0x5c')]=_0x21762c[_0xfafc('0x4d')][_0xfafc('0x5c')][_0xfafc('0x5d')](';')+';';}else{_0x21762c[_0xfafc('0x4d')][_0xfafc('0x5c')]=null;}}else{_0x21762c['body'][_0xfafc('0x5c')]=null;}if(_0x21762c[_0xfafc('0x4d')]&&_['isArray'](_0x21762c[_0xfafc('0x4d')])){for(var _0x2caa35=0x0;_0x2caa35<_0x21762c[_0xfafc('0x4d')][_0xfafc('0x39')];_0x2caa35+=0x1){_0x21762c['body'][_0x2caa35]['ListId']=_0x21762c['params']['id'];_0x1a6b9b[_0xfafc('0x5e')](_0x21762c[_0xfafc('0x4d')][_0x2caa35]);}return BPromise['each'](_0x1a6b9b,function(_0x2e0747){return db[_0xfafc('0x5f')][_0xfafc('0x4c')](_[_0xfafc('0x60')](_0x2e0747,[_0xfafc('0x5b'),'id'])||{},{'fields':_[_0xfafc('0x4a')](_0xa47248),'raw':!![]})['then'](function(_0x24da6a){_0x2bc331[_0xfafc('0x61')][_0xfafc('0x5e')](_0x24da6a[_0xfafc('0x62')]);})['catch'](function(_0x2528bb){_0x2bc331[_0xfafc('0x63')][_0xfafc('0x5e')]({'data':_0x2e0747,'error':_0x2528bb[_0xfafc('0x64')]});});})[_0xfafc('0x26')](function(_0x32307c){return _0x2bc331;})['catch'](function(_0x1601cc){return _0x1601cc;});}else{_0x38a155[_0xfafc('0x1c')](0x190)[_0xfafc('0x1e')]({'message':_0xfafc('0x65')});}});}})[_0xfafc('0x26')](respondWithResult(_0x38a155,null))[_0xfafc('0x48')](handleError(_0x38a155,null));};exports['getContacts']=function(_0x5e149f,_0x21c3c3,_0x5e4dc9){var _0x4445a6;return db['CmList'][_0xfafc('0x4b')]({'where':{'id':_0x5e149f[_0xfafc('0x49')]['id']},'include':[{'model':db[_0xfafc('0x66')],'as':_0xfafc('0x67')}]})[_0xfafc('0x26')](handleEntityNotFound(_0x21c3c3,null))[_0xfafc('0x26')](function(_0x48b969){if(_0x48b969){_0x4445a6=_0x48b969;return db[_0xfafc('0x5f')][_0xfafc('0x30')];}})[_0xfafc('0x26')](function(_0x12c931){if(_0x12c931){var _0x39c0ca={};var _0x303632={};_0x303632[_0xfafc('0x37')]=_[_0xfafc('0x68')](_[_0xfafc('0x4a')](_0x12c931),_[_0xfafc('0x2f')](_0x4445a6[_0xfafc('0x67')],function(_0x7eb61b){return util[_0xfafc('0x69')]('cf_%d',_0x7eb61b['id']);}));_0x303632[_0xfafc('0x34')]=_[_0xfafc('0x4a')](_0x5e149f[_0xfafc('0x34')]);_0x303632['filters']=_[_0xfafc('0x35')](_0x303632[_0xfafc('0x37')],_0x303632[_0xfafc('0x34')]);_0x39c0ca[_0xfafc('0x36')]=_[_0xfafc('0x35')](_0x303632[_0xfafc('0x37')],qs[_0xfafc('0x38')](_0x5e149f[_0xfafc('0x34')][_0xfafc('0x38')]));_0x39c0ca[_0xfafc('0x36')]=_0x39c0ca['attributes'][_0xfafc('0x39')]?_0x39c0ca[_0xfafc('0x36')]:_0x303632[_0xfafc('0x37')];if(!_0x5e149f[_0xfafc('0x34')][_0xfafc('0x58')](_0xfafc('0x3a'))){_0x39c0ca[_0xfafc('0x20')]=qs[_0xfafc('0x20')](_0x5e149f['query'][_0xfafc('0x20')]);_0x39c0ca[_0xfafc('0x1f')]=qs[_0xfafc('0x1f')](_0x5e149f[_0xfafc('0x34')]['offset']);}_0x39c0ca['order']=qs[_0xfafc('0x3c')](_0x5e149f[_0xfafc('0x34')]['sort']);_0x39c0ca[_0xfafc('0x3d')]=qs[_0xfafc('0x3f')](_[_0xfafc('0x3e')](_0x5e149f[_0xfafc('0x34')],_0x303632['filters']));_0x39c0ca[_0xfafc('0x6a')]=!![];if(_0x5e149f[_0xfafc('0x34')][_0xfafc('0x40')]){_0x39c0ca[_0xfafc('0x3d')]=_[_0xfafc('0x41')](_0x39c0ca[_0xfafc('0x3d')],{'$or':_[_0xfafc('0x2f')](_0x39c0ca[_0xfafc('0x36')],function(_0x239e54){var _0x42b43a={};_0x42b43a[_0x239e54]={'$like':'%'+_0x5e149f[_0xfafc('0x34')][_0xfafc('0x40')]+'%'};return _0x42b43a;})});}_0x39c0ca=_[_0xfafc('0x41')]({},_0x39c0ca,_0x5e149f[_0xfafc('0x43')]);return _0x4445a6['getContacts'](_0x39c0ca);}})[_0xfafc('0x26')](respondWithResult(_0x21c3c3,null))[_0xfafc('0x48')](handleError(_0x21c3c3,null));};exports[_0xfafc('0x6b')]=function(_0x41c50d,_0x8b3f83,_0x54a893){var _0x2afdc9;var _0x100e68;var _0x329efc;var _0x2b06c2=_0x41c50d[_0xfafc('0x49')]['id'];csv_results=[];return db[_0xfafc('0x6c')][_0xfafc('0x59')]({'attributes':['id',_0xfafc('0x2c')],'raw':!![],'order':['OrderBy']})[_0xfafc('0x26')](function(_0x4e180f){_0x2afdc9=_0x4e180f;var _0x119ff6=_[_0xfafc('0x4a')](db[_0xfafc('0x5f')][_0xfafc('0x30')]);return db[_0xfafc('0x66')]['findAll']({'raw':!![],'attributes':['id',_0xfafc('0x6d')]})[_0xfafc('0x26')](function(_0x2bf870){_0x100e68=_0x2bf870;var _0x1b0090=squel[_0xfafc('0x6e')]()[_0xfafc('0x38')](_0x119ff6)['from'](_0xfafc('0x6f'),'c')[_0xfafc('0x3d')](_0xfafc('0x70'),_0x2b06c2)[_0xfafc('0x3d')](_0xfafc('0x71'))[_0xfafc('0x72')]();for(var _0x10e9a7=0x0;_0x10e9a7<_0x100e68[_0xfafc('0x39')];_0x10e9a7++){_0x1b0090[_0xfafc('0x73')](_0xfafc('0x74')+_0x100e68[_0x10e9a7]['id'],_0xfafc('0x75')+_0x100e68[_0x10e9a7][_0xfafc('0x6d')]);}for(var _0x10e9a7=0x0;_0x10e9a7<_0x2afdc9[_0xfafc('0x39')];_0x10e9a7++){_0x1b0090['field'](squel[_0xfafc('0x6e')]()['field'](_0xfafc('0x76'))['from'](_0xfafc('0x77'))[_0xfafc('0x3d')]('ItemTypeId\x20=\x20?',_0x2afdc9[_0x10e9a7]['id'])[_0xfafc('0x3d')](_0xfafc('0x78')),_0xfafc('0x79')+_0x2afdc9[_0x10e9a7][_0xfafc('0x2c')]);_0x1b0090[_0xfafc('0x73')](squel['select']()[_0xfafc('0x73')](_0xfafc('0x7a'))[_0xfafc('0x7b')](_0xfafc('0x77'))['where'](_0xfafc('0x7c'),_0x2afdc9[_0x10e9a7]['id'])[_0xfafc('0x3d')](_0xfafc('0x78')),'description_additionalPhone_'+_0x2afdc9[_0x10e9a7][_0xfafc('0x2c')]);}var _0x514063=[];_0x514063['push'](_0x1b0090[_0xfafc('0x7d')]());BPromise[_0xfafc('0x7e')](_0x514063,handleQuery)[_0xfafc('0x26')](function(_0x41a302){handleQuery(_0x1b0090[_0xfafc('0x7d')]());var _0x47e86e=csv_results[0x0];if(!_[_0xfafc('0x7f')](_0x47e86e)){var _0xcab28f=toCsv(_0x47e86e);var _0x362605=Date[_0xfafc('0x80')]();fs[_0xfafc('0x81')](util[_0xfafc('0x69')](_0xfafc('0x82'),_0x2b06c2,_0x362605),_0xcab28f);_0x8b3f83[_0xfafc('0x83')](_0xfafc('0x84'),_0xfafc('0x85')+util[_0xfafc('0x69')](_0xfafc('0x86'),_0x2b06c2,_0x362605));_0x8b3f83[_0xfafc('0x83')](_0xfafc('0x87'),'text/csv');return _0x8b3f83[_0xfafc('0x88')](util[_0xfafc('0x69')](_0xfafc('0x82'),_0x2b06c2,_0x362605));}else{return _0x8b3f83[_0xfafc('0x89')](0xcc);}});});});};exports[_0xfafc('0x8a')]=function(_0x412b04,_0x51d189,_0x2a3031){var _0x57d259;delete _0x412b04[_0xfafc('0x4d')]['id'];return db[_0xfafc('0x44')][_0xfafc('0x8b')]({'where':{'id':_0x412b04[_0xfafc('0x49')]['id']}})[_0xfafc('0x26')](handleEntityNotFound(_0x51d189,null))[_0xfafc('0x26')](function(_0x33c5dc){if(_0x33c5dc){return db['sequelize']['transaction'](function(_0x4f4a04){return db[_0xfafc('0x66')][_0xfafc('0x4c')](_0x412b04[_0xfafc('0x4d')],{'transaction':_0x4f4a04})['then'](function(_0x509746){_0x57d259=_0x509746;return _0x33c5dc[_0xfafc('0x8c')](_0x509746,{'transaction':_0x4f4a04});})[_0xfafc('0x26')](function(){var _0x47262c={'type':db['Sequelize'][_0xfafc('0x8d')],'transaction':_0x4f4a04};switch(_0x412b04['body']['type']){case _0xfafc('0x8e'):_0x47262c[_0xfafc('0x32')]=db[_0xfafc('0x8f')]['TEXT'];break;case _0xfafc('0x90'):_0x47262c[_0xfafc('0x32')]=db[_0xfafc('0x8f')]['INTEGER'];break;case _0xfafc('0x91'):_0x47262c['type']=db[_0xfafc('0x8f')]['BOOLEAN'];_0x47262c['defaultValue']=![];break;default:}return db['sequelize'][_0xfafc('0x92')][_0xfafc('0x93')](_0xfafc('0x6f'),util[_0xfafc('0x69')](_0xfafc('0x94'),_0x57d259['id']),_0x47262c);})[_0xfafc('0x26')](function(){return _0x57d259;});});}})['then'](respondWithResult(_0x51d189,null))[_0xfafc('0x48')](handleError(_0x51d189,null));};exports[_0xfafc('0x95')]=function(_0x516cf4,_0x2f7947,_0x32005e){var _0xbf8821={};var _0x2f5785={};var _0x23c6bf;var _0x244665;return db[_0xfafc('0x44')]['findOne']({'where':{'id':_0x516cf4[_0xfafc('0x49')]['id']}})[_0xfafc('0x26')](handleEntityNotFound(_0x2f7947,null))[_0xfafc('0x26')](function(_0x291cce){if(_0x291cce){_0x23c6bf=_0x291cce;_0x2f5785[_0xfafc('0x37')]=_[_0xfafc('0x4a')](db[_0xfafc('0x66')][_0xfafc('0x30')]);_0x2f5785['query']=_['keys'](_0x516cf4[_0xfafc('0x34')]);_0x2f5785[_0xfafc('0x3f')]=_[_0xfafc('0x35')](_0x2f5785['model'],_0x2f5785[_0xfafc('0x34')]);_0xbf8821[_0xfafc('0x36')]=_['intersection'](_0x2f5785[_0xfafc('0x37')],qs[_0xfafc('0x38')](_0x516cf4[_0xfafc('0x34')]['fields']));_0xbf8821[_0xfafc('0x36')]=_0xbf8821[_0xfafc('0x36')]['length']?_0xbf8821['attributes']:_0x2f5785['model'];_0xbf8821[_0xfafc('0x3b')]=qs[_0xfafc('0x3c')](_0x516cf4[_0xfafc('0x34')][_0xfafc('0x3c')]);_0xbf8821[_0xfafc('0x3d')]=qs['filters'](_[_0xfafc('0x3e')](_0x516cf4[_0xfafc('0x34')],_0x2f5785[_0xfafc('0x3f')]));_0xbf8821[_0xfafc('0x3d')]=_[_0xfafc('0x41')](_0xbf8821[_0xfafc('0x3d')],{'$or':[{'ListId':_0x291cce['id']},{'ListId':null}]});if(_0x516cf4[_0xfafc('0x34')][_0xfafc('0x40')]){_0xbf8821[_0xfafc('0x3d')]=_['merge'](_0xbf8821['where'],{'$or':_['map'](_0xbf8821['attributes'],function(_0x352be){var _0x4214aa={};_0x4214aa[_0x352be]={'$like':'%'+_0x516cf4[_0xfafc('0x34')][_0xfafc('0x40')]+'%'};return _0x4214aa;})});}_0xbf8821=_[_0xfafc('0x41')]({},_0xbf8821,_0x516cf4[_0xfafc('0x43')]);return db['CmCustomField'][_0xfafc('0x96')](_0xbf8821);}})[_0xfafc('0x26')](respondWithResult(_0x2f7947,null))[_0xfafc('0x48')](handleError(_0x2f7947,null));};exports[_0xfafc('0x97')]=function(_0x18aa6a,_0x2a4675){return db[_0xfafc('0x66')][_0xfafc('0x96')]({'where':{'ListId':null}})[_0xfafc('0x26')](handleEntityNotFound(_0x2a4675,null))[_0xfafc('0x26')](function(_0x45b999){return _0x45b999;})[_0xfafc('0x26')](respondWithResult(_0x2a4675,null))[_0xfafc('0x48')](handleError(_0x2a4675,null));};exports['addAgents']=function(_0x1015e9,_0x2500b5,_0x358be0){return db[_0xfafc('0x44')]['find']({'where':{'id':_0x1015e9[_0xfafc('0x49')]['id']}})[_0xfafc('0x26')](handleEntityNotFound(_0x2500b5,null))[_0xfafc('0x26')](function(_0x41eb20){if(_0x41eb20){return _0x41eb20[_0xfafc('0x98')](_0x1015e9[_0xfafc('0x4d')]['ids'],_[_0xfafc('0x60')](_0x1015e9[_0xfafc('0x4d')],[_0xfafc('0x5b'),'id'])||{})['spread'](function(_0x2a0064){for(var _0x3557ac=0x0;_0x3557ac<_0x1015e9[_0xfafc('0x4d')][_0xfafc('0x5b')]['length'];_0x3557ac+=0x1){socket[_0xfafc('0x99')](_0xfafc('0x9a'),{'UserId':Number(_0x1015e9[_0xfafc('0x4d')][_0xfafc('0x5b')][_0x3557ac]),'CmListId':Number(_0x1015e9['params']['id'])});}return _0x2a0064;});}})[_0xfafc('0x26')](respondWithResult(_0x2500b5,null))[_0xfafc('0x48')](handleError(_0x2500b5,null));};exports[_0xfafc('0x9b')]=function(_0x4382b2,_0x47d3b7,_0x2c66ef){return db[_0xfafc('0x44')][_0xfafc('0x4b')]({'where':{'id':_0x4382b2[_0xfafc('0x49')]['id']}})['then'](handleEntityNotFound(_0x47d3b7,null))[_0xfafc('0x26')](function(_0x1c6099){if(_0x1c6099){return _0x1c6099[_0xfafc('0x9b')](_0x4382b2['query'][_0xfafc('0x5b')])[_0xfafc('0x26')](function(){if(_[_0xfafc('0x9c')](_0x4382b2[_0xfafc('0x34')][_0xfafc('0x5b')])){for(var _0x3cc5af=0x0;_0x3cc5af<_0x4382b2[_0xfafc('0x34')][_0xfafc('0x5b')][_0xfafc('0x39')];_0x3cc5af+=0x1){socket['emit'](_0xfafc('0x9d'),{'UserId':Number(_0x4382b2['query'][_0xfafc('0x5b')][_0x3cc5af]),'CmListId':Number(_0x4382b2[_0xfafc('0x49')]['id'])});}}else{socket[_0xfafc('0x99')]('userCmList:remove',{'UserId':Number(_0x4382b2[_0xfafc('0x34')]['ids']),'CmListId':Number(_0x4382b2['params']['id'])});}});}})['then'](respondWithStatusCode(_0x47d3b7,null))[_0xfafc('0x48')](handleError(_0x47d3b7,null));};exports['getAgents']=function(_0x38c066,_0x570bc9,_0x3faa95){var _0x4f434f={};var _0x430c17={};var _0x4f374d;var _0x4c4f76;return db['CmList'][_0xfafc('0x8b')]({'where':{'id':_0x38c066[_0xfafc('0x49')]['id']}})['then'](handleEntityNotFound(_0x570bc9,null))[_0xfafc('0x26')](function(_0x260792){if(_0x260792){_0x4f374d=_0x260792;_0x430c17[_0xfafc('0x37')]=_[_0xfafc('0x4a')](db[_0xfafc('0x9e')][_0xfafc('0x30')]);_0x430c17[_0xfafc('0x34')]=_['keys'](_0x38c066['query']);_0x430c17[_0xfafc('0x3f')]=_[_0xfafc('0x35')](_0x430c17[_0xfafc('0x37')],_0x430c17['query']);_0x4f434f[_0xfafc('0x36')]=_['intersection'](_0x430c17[_0xfafc('0x37')],qs[_0xfafc('0x38')](_0x38c066[_0xfafc('0x34')][_0xfafc('0x38')]));_0x4f434f[_0xfafc('0x36')]=_0x4f434f[_0xfafc('0x36')][_0xfafc('0x39')]?_0x4f434f[_0xfafc('0x36')]:_0x430c17['model'];_0x4f434f[_0xfafc('0x3b')]=qs['sort'](_0x38c066[_0xfafc('0x34')][_0xfafc('0x3c')]);_0x4f434f[_0xfafc('0x3d')]=qs[_0xfafc('0x3f')](_[_0xfafc('0x3e')](_0x38c066[_0xfafc('0x34')],_0x430c17[_0xfafc('0x3f')]));if(_0x38c066[_0xfafc('0x34')][_0xfafc('0x40')]){_0x4f434f['where']=_[_0xfafc('0x41')](_0x4f434f['where'],{'$or':_[_0xfafc('0x2f')](_0x4f434f[_0xfafc('0x36')],function(_0x249caf){var _0x450718={};_0x450718[_0x249caf]={'$like':'%'+_0x38c066[_0xfafc('0x34')]['filter']+'%'};return _0x450718;})});}_0x4f434f=_[_0xfafc('0x41')]({},_0x4f434f,_0x38c066[_0xfafc('0x43')]);return _0x4f374d['getAgents'](_0x4f434f);}})['then'](function(_0x12ae00){if(_0x12ae00){_0x4c4f76=_0x12ae00[_0xfafc('0x39')];if(!_0x38c066[_0xfafc('0x34')][_0xfafc('0x58')]('nolimit')){_0x4f434f[_0xfafc('0x20')]=qs['limit'](_0x38c066['query'][_0xfafc('0x20')]);_0x4f434f[_0xfafc('0x1f')]=qs[_0xfafc('0x1f')](_0x38c066[_0xfafc('0x34')][_0xfafc('0x1f')]);}return _0x4f374d[_0xfafc('0x9f')](_0x4f434f);}})[_0xfafc('0x26')](function(_0x35065e){if(_0x35065e){return _0x35065e?{'count':_0x4c4f76,'rows':_0x35065e}:null;}})[_0xfafc('0x26')](respondWithResult(_0x570bc9,null))[_0xfafc('0x48')](handleError(_0x570bc9,null));};function handleQuery(_0x2706d8){logger[_0xfafc('0xa0')](_0x2706d8);return db['sequelize'][_0xfafc('0x34')](_0x2706d8)['spread'](function(_0x181de6){csv_results[_0xfafc('0x5e')](_0x181de6);})[_0xfafc('0x48')](function(_0x269bba){logger[_0xfafc('0x51')](_0x269bba['message']);});} \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 1c6c2b5..0e64b36 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 _0x3e74=['hasOwnProperty','exports','events','CmList','setMaxListeners','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3e74,0x175));var _0x43e7=function(_0x59c0f4,_0x1074e6){_0x59c0f4=_0x59c0f4-0x0;var _0x4a87a3=_0x3e74[_0x59c0f4];return _0x4a87a3;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var CmList=require('../../mysqldb')['db'][_0x43e7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){CmListEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);CmListEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=CmListEvents; \ No newline at end of file +var _0x55ca=['events','../../mysqldb','update','remove','emit','hasOwnProperty','hook'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0x55ca,0x126));var _0xa55c=function(_0x24b53b,_0x57c20d){_0x24b53b=_0x24b53b-0x0;var _0x3b5c00=_0x55ca[_0x24b53b];return _0x3b5c00;};'use strict';var EventEmitter=require(_0xa55c('0x0'));var CmList=require(_0xa55c('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa55c('0x2'),'afterDestroy':_0xa55c('0x3')};function emitEvent(_0x5dc716){return function(_0x3b478a,_0x2db02a,_0xcb02e3){CmListEvents[_0xa55c('0x4')](_0x5dc716+':'+_0x3b478a['id'],_0x3b478a);CmListEvents[_0xa55c('0x4')](_0x5dc716,_0x3b478a);_0xcb02e3(null);};}for(var e in events){if(events[_0xa55c('0x5')](e)){var event=events[e];CmList[_0xa55c('0x6')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index ad2d43d..54552c5 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 _0x6f0d=['./cmList.attributes','define','CmList','cm_lists','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x2f1a01,_0x17cd42){_0x2f1a01=_0x2f1a01-0x0;var _0x323b3e=_0x6f0d[_0x2f1a01];return _0x323b3e;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var logger=require(_0xd6f0('0x1'))(_0xd6f0('0x2'));var moment=require(_0xd6f0('0x3'));var BPromise=require('bluebird');var rp=require(_0xd6f0('0x4'));var fs=require('fs');var path=require(_0xd6f0('0x5'));var rimraf=require(_0xd6f0('0x6'));var config=require(_0xd6f0('0x7'));var attributes=require(_0xd6f0('0x8'));module['exports']=function(_0x2d2ce6,_0x4a8b0c){return _0x2d2ce6[_0xd6f0('0x9')](_0xd6f0('0xa'),attributes,{'tableName':_0xd6f0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdb7=['request-promise','path','rimraf','./cmList.attributes','define','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x16a101,_0x12caba){_0x16a101=_0x16a101-0x0;var _0x47b258=_0xbdb7[_0x16a101];return _0x47b258;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var logger=require(_0x7bdb('0x2'))(_0x7bdb('0x3'));var moment=require(_0x7bdb('0x4'));var BPromise=require(_0x7bdb('0x5'));var rp=require(_0x7bdb('0x6'));var fs=require('fs');var path=require(_0x7bdb('0x7'));var rimraf=require(_0x7bdb('0x8'));var config=require('../../config/environment');var attributes=require(_0x7bdb('0x9'));module['exports']=function(_0x4b5fff,_0xffdc86){return _0x4b5fff[_0x7bdb('0xa')]('CmList',attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index a0ddec1..ff8c49f 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 _0xec35=['info','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','register','request','then','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','CmList,\x20%s,\x20%s','message'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xec35,0x172));var _0x5ec3=function(_0x416391,_0x390681){_0x416391=_0x416391-0x0;var _0x4e48e9=_0xec35[_0x416391];return _0x4e48e9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x5ec3('0x0'));var rs=require(_0x5ec3('0x1'));var fs=require('fs');var Redis=require(_0x5ec3('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5ec3('0x3'));var logger=require(_0x5ec3('0x4'))(_0x5ec3('0x5'));var config=require(_0x5ec3('0x6'));var jayson=require(_0x5ec3('0x7'));var client=jayson['client'][_0x5ec3('0x8')]({'port':0x232a});config[_0x5ec3('0x9')]=_['defaults'](config[_0x5ec3('0x9')],{'host':_0x5ec3('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5ec3('0x9')]));require('./cmList.socket')[_0x5ec3('0xb')](socket);function respondWithRpcPromise(_0x3fea0d,_0x2d22b6,_0x2cf6db){return new BPromise(function(_0x2466b6,_0x244fb6){return client[_0x5ec3('0xc')](_0x3fea0d,_0x2cf6db)[_0x5ec3('0xd')](function(_0x4a2a47){logger['info']('CmList,\x20%s,\x20%s',_0x2d22b6,'request\x20sent');logger[_0x5ec3('0xe')](_0x5ec3('0xf'),_0x2d22b6,_0x5ec3('0x10'),JSON['stringify'](_0x4a2a47));if(_0x4a2a47[_0x5ec3('0x11')]){if(_0x4a2a47[_0x5ec3('0x11')][_0x5ec3('0x12')]===0x1f4){logger['error'](_0x5ec3('0x13'),_0x2d22b6,_0x4a2a47[_0x5ec3('0x11')][_0x5ec3('0x14')]);return _0x244fb6(_0x4a2a47['error'][_0x5ec3('0x14')]);}logger['error']('CmList,\x20%s,\x20%s',_0x2d22b6,_0x4a2a47['error'][_0x5ec3('0x14')]);return _0x2466b6(_0x4a2a47[_0x5ec3('0x11')][_0x5ec3('0x14')]);}else{logger[_0x5ec3('0x15')]('CmList,\x20%s,\x20%s',_0x2d22b6,_0x5ec3('0x10'));_0x2466b6(_0x4a2a47['result']['message']);}})[_0x5ec3('0x16')](function(_0x46bca1){logger[_0x5ec3('0x11')](_0x5ec3('0x13'),_0x2d22b6,_0x46bca1);_0x244fb6(_0x46bca1);});});} \ No newline at end of file +var _0x7928=['util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x113c43,_0x171537){var _0x25a1ac=function(_0x5544b2){while(--_0x5544b2){_0x113c43['push'](_0x113c43['shift']());}};_0x25a1ac(++_0x171537);}(_0x7928,0x159));var _0x8792=function(_0x376ced,_0x240ab0){_0x376ced=_0x376ced-0x0;var _0x2c1248=_0x7928[_0x376ced];return _0x2c1248;};'use strict';var _=require('lodash');var util=require(_0x8792('0x0'));var moment=require(_0x8792('0x1'));var BPromise=require(_0x8792('0x2'));var rs=require(_0x8792('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8792('0x4'));var logger=require('../../config/logger')(_0x8792('0x5'));var config=require(_0x8792('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8792('0x7')]['http']({'port':0x232a});config[_0x8792('0x8')]=_[_0x8792('0x9')](config[_0x8792('0x8')],{'host':_0x8792('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./cmList.socket')['register'](socket);function respondWithRpcPromise(_0x4229f2,_0x471f36,_0x218dd4){return new BPromise(function(_0x443b03,_0x18170f){return client[_0x8792('0xb')](_0x4229f2,_0x218dd4)[_0x8792('0xc')](function(_0xe6371e){logger['info'](_0x8792('0xd'),_0x471f36,_0x8792('0xe'));logger[_0x8792('0xf')](_0x8792('0x10'),_0x471f36,'request\x20sent',JSON[_0x8792('0x11')](_0xe6371e));if(_0xe6371e['error']){if(_0xe6371e[_0x8792('0x12')][_0x8792('0x13')]===0x1f4){logger[_0x8792('0x12')](_0x8792('0xd'),_0x471f36,_0xe6371e['error'][_0x8792('0x14')]);return _0x18170f(_0xe6371e['error'][_0x8792('0x14')]);}logger[_0x8792('0x12')](_0x8792('0xd'),_0x471f36,_0xe6371e['error'][_0x8792('0x14')]);return _0x443b03(_0xe6371e[_0x8792('0x12')][_0x8792('0x14')]);}else{logger['info'](_0x8792('0xd'),_0x471f36,_0x8792('0xe'));_0x443b03(_0xe6371e[_0x8792('0x15')][_0x8792('0x14')]);}})[_0x8792('0x16')](function(_0x485a90){logger[_0x8792('0x12')]('CmList,\x20%s,\x20%s',_0x471f36,_0x485a90);_0x18170f(_0x485a90);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 4bf364e..46d7146 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 _0x96ad=['save','remove','emit','removeListener','register','length','cmList:','./cmList.events'];(function(_0x20cb20,_0x256051){var _0x2fcf4b=function(_0x26200b){while(--_0x26200b){_0x20cb20['push'](_0x20cb20['shift']());}};_0x2fcf4b(++_0x256051);}(_0x96ad,0x147));var _0xd96a=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0x96ad[_0x35da42];return _0x370035;};'use strict';var CmListEvents=require(_0xd96a('0x0'));var events=[_0xd96a('0x1'),_0xd96a('0x2'),'update'];function createListener(_0x17b71c,_0x4615a6){return function(_0x27b133){_0x4615a6[_0xd96a('0x3')](_0x17b71c,_0x27b133);};}function removeListener(_0x4f91a2,_0x558f82){return function(){CmListEvents[_0xd96a('0x4')](_0x4f91a2,_0x558f82);};}exports[_0xd96a('0x5')]=function(_0x5ea4ca){for(var _0x309300=0x0,_0x4bb53a=events[_0xd96a('0x6')];_0x309300<_0x4bb53a;_0x309300++){var _0x2aaae0=events[_0x309300];var _0x260d30=createListener(_0xd96a('0x7')+_0x2aaae0,_0x5ea4ca);CmListEvents['on'](_0x2aaae0,_0x260d30);}}; \ No newline at end of file +var _0x6ba3=['./cmList.events','save','update','emit','removeListener','register'];(function(_0x20119d,_0x5034fa){var _0x15c7bf=function(_0x3fe257){while(--_0x3fe257){_0x20119d['push'](_0x20119d['shift']());}};_0x15c7bf(++_0x5034fa);}(_0x6ba3,0x186));var _0x36ba=function(_0x48051b,_0x368d0b){_0x48051b=_0x48051b-0x0;var _0x5669e1=_0x6ba3[_0x48051b];return _0x5669e1;};'use strict';var CmListEvents=require(_0x36ba('0x0'));var events=[_0x36ba('0x1'),'remove',_0x36ba('0x2')];function createListener(_0x1030cb,_0x4d3da0){return function(_0x48b553){_0x4d3da0[_0x36ba('0x3')](_0x1030cb,_0x48b553);};}function removeListener(_0x19333a,_0x2f9b88){return function(){CmListEvents[_0x36ba('0x4')](_0x19333a,_0x2f9b88);};}exports[_0x36ba('0x5')]=function(_0x3547bb){for(var _0x2a8b90=0x0,_0xbbdeba=events['length'];_0x2a8b90<_0xbbdeba;_0x2a8b90++){var _0x55b92d=events[_0x2a8b90];var _0x5c3445=createListener('cmList:'+_0x55b92d,_0x3547bb);CmListEvents['on'](_0x55b92d,_0x5c3445);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index da16ac2..1f2cc17 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 _0x952f=['update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','isAuthenticated','index','/describe','describe','/global_fields','getGlobalCustomFields','/:id','show','getDispositions','getContacts','/:id/fields','getCustomFields','/:id/users','getAgents','create','post','/:id/dispositions','addDisposition','/:id/contacts','addContacts','addCustomField','put'];(function(_0x4d033a,_0x2aed96){var _0xddc28=function(_0x167936){while(--_0x167936){_0x4d033a['push'](_0x4d033a['shift']());}};_0xddc28(++_0x2aed96);}(_0x952f,0xad));var _0xf952=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0x952f[_0x45fc6a];return _0x14bcfd;};'use strict';var multer=require(_0xf952('0x0'));var util=require(_0xf952('0x1'));var path=require('path');var timeout=require(_0xf952('0x2'));var express=require('express');var router=express[_0xf952('0x3')]();var fs_extra=require(_0xf952('0x4'));var auth=require(_0xf952('0x5'));var interaction=require(_0xf952('0x6'));var config=require('../../config/environment');var controller=require(_0xf952('0x7'));router[_0xf952('0x8')]('/',auth[_0xf952('0x9')](),controller[_0xf952('0xa')]);router['get'](_0xf952('0xb'),auth[_0xf952('0x9')](),controller[_0xf952('0xc')]);router[_0xf952('0x8')](_0xf952('0xd'),auth[_0xf952('0x9')](),controller[_0xf952('0xe')]);router[_0xf952('0x8')](_0xf952('0xf'),auth[_0xf952('0x9')](),controller[_0xf952('0x10')]);router[_0xf952('0x8')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf952('0x11')]);router[_0xf952('0x8')]('/:id/contacts',auth[_0xf952('0x9')](),controller[_0xf952('0x12')]);router['get']('/:id/contacts/csv',auth[_0xf952('0x9')](),controller['getContactsCsv']);router[_0xf952('0x8')](_0xf952('0x13'),auth['isAuthenticated'](),controller[_0xf952('0x14')]);router[_0xf952('0x8')](_0xf952('0x15'),auth[_0xf952('0x9')](),controller[_0xf952('0x16')]);router['post']('/',auth[_0xf952('0x9')](),controller[_0xf952('0x17')]);router[_0xf952('0x18')](_0xf952('0x19'),auth['isAuthenticated'](),controller[_0xf952('0x1a')]);router[_0xf952('0x18')](_0xf952('0x1b'),auth[_0xf952('0x9')](),controller[_0xf952('0x1c')]);router['post'](_0xf952('0x13'),auth['isAuthenticated'](),controller[_0xf952('0x1d')]);router[_0xf952('0x18')](_0xf952('0x15'),auth['isAuthenticated'](),controller['addAgents']);router[_0xf952('0x1e')]('/:id',auth[_0xf952('0x9')](),controller[_0xf952('0x1f')]);router[_0xf952('0x20')](_0xf952('0xf'),auth[_0xf952('0x9')](),controller['destroy']);router['delete'](_0xf952('0x19'),auth[_0xf952('0x9')](),controller['removeDispositions']);router[_0xf952('0x20')](_0xf952('0x15'),auth[_0xf952('0x9')](),controller['removeAgents']);module[_0xf952('0x21')]=router; \ No newline at end of file +var _0x931f=['delete','removeDispositions','removeAgents','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','describe','getGlobalCustomFields','/:id','show','/:id/dispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','getAgents','post','create','addDisposition','addContacts','/:id/users','addAgents','put','update'];(function(_0x4ae78d,_0x1d6b50){var _0x27b850=function(_0x30f14a){while(--_0x30f14a){_0x4ae78d['push'](_0x4ae78d['shift']());}};_0x27b850(++_0x1d6b50);}(_0x931f,0x184));var _0xf931=function(_0x26fa43,_0x30a86c){_0x26fa43=_0x26fa43-0x0;var _0x81ca8d=_0x931f[_0x26fa43];return _0x81ca8d;};'use strict';var multer=require(_0xf931('0x0'));var util=require(_0xf931('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf931('0x2'));var router=express['Router']();var fs_extra=require(_0xf931('0x3'));var auth=require(_0xf931('0x4'));var interaction=require(_0xf931('0x5'));var config=require('../../config/environment');var controller=require('./cmList.controller');router[_0xf931('0x6')]('/',auth[_0xf931('0x7')](),controller[_0xf931('0x8')]);router['get']('/describe',auth[_0xf931('0x7')](),controller[_0xf931('0x9')]);router[_0xf931('0x6')]('/global_fields',auth[_0xf931('0x7')](),controller[_0xf931('0xa')]);router['get'](_0xf931('0xb'),auth['isAuthenticated'](),controller[_0xf931('0xc')]);router[_0xf931('0x6')](_0xf931('0xd'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xf931('0x6')](_0xf931('0xe'),auth[_0xf931('0x7')](),controller['getContacts']);router[_0xf931('0x6')](_0xf931('0xf'),auth['isAuthenticated'](),controller[_0xf931('0x10')]);router[_0xf931('0x6')](_0xf931('0x11'),auth[_0xf931('0x7')](),controller[_0xf931('0x12')]);router[_0xf931('0x6')]('/:id/users',auth[_0xf931('0x7')](),controller[_0xf931('0x13')]);router[_0xf931('0x14')]('/',auth[_0xf931('0x7')](),controller[_0xf931('0x15')]);router['post']('/:id/dispositions',auth[_0xf931('0x7')](),controller[_0xf931('0x16')]);router[_0xf931('0x14')](_0xf931('0xe'),auth[_0xf931('0x7')](),controller[_0xf931('0x17')]);router[_0xf931('0x14')]('/:id/fields',auth[_0xf931('0x7')](),controller['addCustomField']);router['post'](_0xf931('0x18'),auth[_0xf931('0x7')](),controller[_0xf931('0x19')]);router[_0xf931('0x1a')](_0xf931('0xb'),auth[_0xf931('0x7')](),controller[_0xf931('0x1b')]);router['delete'](_0xf931('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xf931('0x1c')](_0xf931('0xd'),auth['isAuthenticated'](),controller[_0xf931('0x1d')]);router[_0xf931('0x1c')](_0xf931('0x18'),auth[_0xf931('0x7')](),controller[_0xf931('0x1e')]);module[_0xf931('0x1f')]=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index efb9516..1c7a129 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 _0x6253=['exports','getDataValue','field','STRING'];(function(_0x3d39d4,_0x28426d){var _0x18f002=function(_0x3e6d34){while(--_0x3e6d34){_0x3d39d4['push'](_0x3d39d4['shift']());}};_0x18f002(++_0x28426d);}(_0x6253,0x1a0));var _0x3625=function(_0x3200ca,_0x23d1b3){_0x3200ca=_0x3200ca-0x0;var _0x562715=_0x6253[_0x3200ca];return _0x562715;};'use strict';var Sequelize=require('sequelize');module[_0x3625('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x48acff){return this[_0x3625('0x1')](_0x3625('0x2'));}},'field':{'type':Sequelize[_0x3625('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x3625('0x3')],'allowNull':![]}}; \ No newline at end of file +var _0x8b88=['STRING','sequelize','exports'];(function(_0x947202,_0xdc4efa){var _0xfa83e5=function(_0x39c1fd){while(--_0x39c1fd){_0x947202['push'](_0x947202['shift']());}};_0xfa83e5(++_0xdc4efa);}(_0x8b88,0x172));var _0x88b8=function(_0x440a33,_0x3a1841){_0x440a33=_0x440a33-0x0;var _0xd62392=_0x8b88[_0x440a33];return _0xd62392;};'use strict';var Sequelize=require(_0x88b8('0x0'));module[_0x88b8('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x55e7a0){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0x88b8('0x2')],'allowNull':![]},'operator':{'type':Sequelize[_0x88b8('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x88b8('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index d51f65a..21b1e26 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 _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x32eca1,_0xa4a407){var _0x202f7b=function(_0x41a85){while(--_0x41a85){_0x32eca1['push'](_0x32eca1['shift']());}};_0x202f7b(++_0xa4a407);}(_0x7a54,0x106));var _0x47a5=function(_0x7dda2e,_0x15f6d4){_0x7dda2e=_0x7dda2e-0x0;var _0x48db53=_0x7a54[_0x7dda2e];return _0x48db53;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x41908a,_0x4a5bb2){var _0x23ac1a=function(_0x59cd4d){while(--_0x59cd4d){_0x41908a['push'](_0x41908a['shift']());}};_0x23ac1a(++_0x4a5bb2);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 76d2802..42ba6e4 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 _0xe57a=['rimraf','../../config/environment','./condition.attributes','exports','define','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x180c82,_0x2613c4){var _0x48b115=function(_0x1bbb9d){while(--_0x1bbb9d){_0x180c82['push'](_0x180c82['shift']());}};_0x48b115(++_0x2613c4);}(_0xe57a,0x13d));var _0xae57=function(_0x2fa9da,_0x2fb5ee){_0x2fa9da=_0x2fa9da-0x0;var _0x5ae45b=_0xe57a[_0x2fa9da];return _0x5ae45b;};'use strict';var _=require('lodash');var util=require(_0xae57('0x0'));var logger=require(_0xae57('0x1'))(_0xae57('0x2'));var moment=require(_0xae57('0x3'));var BPromise=require(_0xae57('0x4'));var rp=require(_0xae57('0x5'));var fs=require('fs');var path=require(_0xae57('0x6'));var rimraf=require(_0xae57('0x7'));var config=require(_0xae57('0x8'));var attributes=require(_0xae57('0x9'));module[_0xae57('0xa')]=function(_0x588e2e,_0x39dffe){return _0x588e2e[_0xae57('0xb')]('Condition',attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe5d6=['exports','define','Condition','tools_conditions','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./condition.attributes'];(function(_0x988a68,_0x4bdf25){var _0x473c57=function(_0xdeef55){while(--_0xdeef55){_0x988a68['push'](_0x988a68['shift']());}};_0x473c57(++_0x4bdf25);}(_0xe5d6,0x149));var _0x6e5d=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xe5d6[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x6e5d('0x0'));var util=require(_0x6e5d('0x1'));var logger=require('../../config/logger')(_0x6e5d('0x2'));var moment=require(_0x6e5d('0x3'));var BPromise=require(_0x6e5d('0x4'));var rp=require(_0x6e5d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6e5d('0x6'));var config=require(_0x6e5d('0x7'));var attributes=require(_0x6e5d('0x8'));module[_0x6e5d('0x9')]=function(_0x342140,_0x5cf9e9){return _0x342140[_0x6e5d('0xa')](_0x6e5d('0xb'),attributes,{'tableName':_0x6e5d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 04c004e..0f8c827 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 _0x8bb9=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment'];(function(_0x38f8e8,_0x35eccc){var _0x4860f8=function(_0x3dd6eb){while(--_0x3dd6eb){_0x38f8e8['push'](_0x38f8e8['shift']());}};_0x4860f8(++_0x35eccc);}(_0x8bb9,0x1cb));var _0x98bb=function(_0x587fb5,_0x59cb3b){_0x587fb5=_0x587fb5-0x0;var _0x551105=_0x8bb9[_0x587fb5];return _0x551105;};'use strict';var _=require(_0x98bb('0x0'));var util=require(_0x98bb('0x1'));var moment=require(_0x98bb('0x2'));var BPromise=require(_0x98bb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x98bb('0x4'));var db=require(_0x98bb('0x5'))['db'];var utils=require(_0x98bb('0x6'));var logger=require('../../config/logger')(_0x98bb('0x7'));var config=require(_0x98bb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x98bb('0x9')][_0x98bb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58e9fb,_0x28c082,_0x2bb2db){return new BPromise(function(_0x28f287,_0x3d4d9e){return client[_0x98bb('0xb')](_0x58e9fb,_0x2bb2db)[_0x98bb('0xc')](function(_0x43ada6){logger[_0x98bb('0xd')](_0x98bb('0xe'),_0x28c082,_0x98bb('0xf'));logger[_0x98bb('0x10')]('Condition,\x20%s,\x20%s,\x20%s',_0x28c082,_0x98bb('0xf'),JSON['stringify'](_0x43ada6));if(_0x43ada6[_0x98bb('0x11')]){if(_0x43ada6[_0x98bb('0x11')][_0x98bb('0x12')]===0x1f4){logger['error'](_0x98bb('0xe'),_0x28c082,_0x43ada6['error']['message']);return _0x3d4d9e(_0x43ada6['error'][_0x98bb('0x13')]);}logger[_0x98bb('0x11')](_0x98bb('0xe'),_0x28c082,_0x43ada6[_0x98bb('0x11')][_0x98bb('0x13')]);return _0x28f287(_0x43ada6[_0x98bb('0x11')][_0x98bb('0x13')]);}else{logger[_0x98bb('0xd')](_0x98bb('0xe'),_0x28c082,_0x98bb('0xf'));_0x28f287(_0x43ada6[_0x98bb('0x14')]['message']);}})['catch'](function(_0x6b19da){logger[_0x98bb('0x11')](_0x98bb('0xe'),_0x28c082,_0x6b19da);_0x3d4d9e(_0x6b19da);});});} \ No newline at end of file +var _0x6118=['rpc','client','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x171fc7,_0x277ce3){var _0x58bba1=function(_0x27df90){while(--_0x27df90){_0x171fc7['push'](_0x171fc7['shift']());}};_0x58bba1(++_0x277ce3);}(_0x6118,0x82));var _0x8611=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0x6118[_0x4e93a9];return _0x43013c;};'use strict';var _=require(_0x8611('0x0'));var util=require(_0x8611('0x1'));var moment=require(_0x8611('0x2'));var BPromise=require(_0x8611('0x3'));var rs=require(_0x8611('0x4'));var fs=require('fs');var Redis=require(_0x8611('0x5'));var db=require(_0x8611('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8611('0x7'))(_0x8611('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8611('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x114c1d,_0x9b918a,_0x8d33f2){return new BPromise(function(_0x1f62dd,_0x79d210){return client[_0x8611('0xa')](_0x114c1d,_0x8d33f2)[_0x8611('0xb')](function(_0x3b492e){logger[_0x8611('0xc')](_0x8611('0xd'),_0x9b918a,_0x8611('0xe'));logger[_0x8611('0xf')](_0x8611('0x10'),_0x9b918a,_0x8611('0xe'),JSON[_0x8611('0x11')](_0x3b492e));if(_0x3b492e[_0x8611('0x12')]){if(_0x3b492e[_0x8611('0x12')][_0x8611('0x13')]===0x1f4){logger['error'](_0x8611('0xd'),_0x9b918a,_0x3b492e[_0x8611('0x12')]['message']);return _0x79d210(_0x3b492e[_0x8611('0x12')]['message']);}logger['error'](_0x8611('0xd'),_0x9b918a,_0x3b492e[_0x8611('0x12')][_0x8611('0x14')]);return _0x1f62dd(_0x3b492e[_0x8611('0x12')][_0x8611('0x14')]);}else{logger[_0x8611('0xc')]('Condition,\x20%s,\x20%s',_0x9b918a,_0x8611('0xe'));_0x1f62dd(_0x3b492e[_0x8611('0x15')][_0x8611('0x14')]);}})[_0x8611('0x16')](function(_0x451fc4){logger[_0x8611('0x12')](_0x8611('0xd'),_0x9b918a,_0x451fc4);_0x79d210(_0x451fc4);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index a1c130b..2bf873a 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 _0x2b34=['express','Router','../../components/auth/service','../../components/interaction/service','./condition.controller','put','isAuthenticated','update','exports','multer','util','path'];(function(_0x519990,_0x57672f){var _0x4cf293=function(_0x4df638){while(--_0x4df638){_0x519990['push'](_0x519990['shift']());}};_0x4cf293(++_0x57672f);}(_0x2b34,0x1e9));var _0x42b3=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x2b34[_0x1e7b16];return _0x37fadc;};'use strict';var multer=require(_0x42b3('0x0'));var util=require(_0x42b3('0x1'));var path=require(_0x42b3('0x2'));var timeout=require('connect-timeout');var express=require(_0x42b3('0x3'));var router=express[_0x42b3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x42b3('0x5'));var interaction=require(_0x42b3('0x6'));var config=require('../../config/environment');var controller=require(_0x42b3('0x7'));router[_0x42b3('0x8')]('/:id',auth[_0x42b3('0x9')](),controller[_0x42b3('0xa')]);router['delete']('/:id',auth[_0x42b3('0x9')](),controller['destroy']);module[_0x42b3('0xb')]=router; \ No newline at end of file +var _0xb783=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','util','path','connect-timeout','express'];(function(_0x59ae73,_0x36314d){var _0x18e551=function(_0x2e69fa){while(--_0x2e69fa){_0x59ae73['push'](_0x59ae73['shift']());}};_0x18e551(++_0x36314d);}(_0xb783,0xc0));var _0x3b78=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xb783[_0x255d5b];return _0x3e141a;};'use strict';var multer=require('multer');var util=require(_0x3b78('0x0'));var path=require(_0x3b78('0x1'));var timeout=require(_0x3b78('0x2'));var express=require(_0x3b78('0x3'));var router=express[_0x3b78('0x4')]();var fs_extra=require(_0x3b78('0x5'));var auth=require(_0x3b78('0x6'));var interaction=require(_0x3b78('0x7'));var config=require(_0x3b78('0x8'));var controller=require(_0x3b78('0x9'));router[_0x3b78('0xa')](_0x3b78('0xb'),auth[_0x3b78('0xc')](),controller[_0x3b78('0xd')]);router['delete'](_0x3b78('0xb'),auth[_0x3b78('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.attributes.js b/server/api/contactItemType/contactItemType.attributes.js index 5a4659d..33fc802 100644 --- a/server/api/contactItemType/contactItemType.attributes.js +++ b/server/api/contactItemType/contactItemType.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dab=['STRING','sequelize','exports','name','INTEGER'];(function(_0xd21f28,_0x483c59){var _0x3405bf=function(_0x19e330){while(--_0x19e330){_0xd21f28['push'](_0xd21f28['shift']());}};_0x3405bf(++_0x483c59);}(_0x7dab,0x10a));var _0xb7da=function(_0x388334,_0x488ec6){_0x388334=_0x388334-0x0;var _0x42b7f5=_0x7dab[_0x388334];return _0x42b7f5;};'use strict';var Sequelize=require(_0xb7da('0x0'));module[_0xb7da('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xb7da('0x2')},'OrderBy':{'type':Sequelize[_0xb7da('0x3')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize[_0xb7da('0x4')],'allowNull':!![]}}; \ No newline at end of file +var _0x7420=['exports','INTEGER','sequelize'];(function(_0x2306de,_0x5b9304){var _0x3143e9=function(_0x4c5c5e){while(--_0x4c5c5e){_0x2306de['push'](_0x2306de['shift']());}};_0x3143e9(++_0x5b9304);}(_0x7420,0x140));var _0x0742=function(_0x455dc3,_0x40ddaf){_0x455dc3=_0x455dc3-0x0;var _0x8180b6=_0x7420[_0x455dc3];return _0x8180b6;};'use strict';var Sequelize=require(_0x0742('0x0'));module[_0x0742('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'OrderBy':{'type':Sequelize[_0x0742('0x2')],'allowNull':!![]},'rgbBackgroundColor':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.controller.js b/server/api/contactItemType/contactItemType.controller.js index 0be3596..5d2c7fe 100644 --- a/server/api/contactItemType/contactItemType.controller.js +++ b/server/api/contactItemType/contactItemType.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x28f2=['api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','Content-Range','apply','reject','save','update','then','destroy','get','ContactItemTypes','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','ContactItemType','count','include','findAll','rows','catch','show','keys','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','params','CmContactHasItem','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x38c189,_0x2a4e79){var _0x6a730e=function(_0x5b9cbe){while(--_0x5b9cbe){_0x38c189['push'](_0x38c189['shift']());}};_0x6a730e(++_0x2a4e79);}(_0x28f2,0x193));var _0x228f=function(_0x23ed25,_0x555ded){_0x23ed25=_0x23ed25-0x0;var _0x411de2=_0x28f2[_0x23ed25];return _0x411de2;};'use strict';var emlformat=require(_0x228f('0x0'));var rimraf=require(_0x228f('0x1'));var zipdir=require(_0x228f('0x2'));var jsonpatch=require(_0x228f('0x3'));var rp=require(_0x228f('0x4'));var moment=require('moment');var BPromise=require(_0x228f('0x5'));var Mustache=require(_0x228f('0x6'));var util=require(_0x228f('0x7'));var path=require(_0x228f('0x8'));var sox=require(_0x228f('0x9'));var csv=require(_0x228f('0xa'));var ejs=require(_0x228f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x228f('0xc'));var squel=require('squel');var crypto=require(_0x228f('0xd'));var jsforce=require(_0x228f('0xe'));var deskjs=require(_0x228f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x228f('0x10'));var Papa=require('papaparse');var Redis=require(_0x228f('0x11'));var authService=require(_0x228f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x228f('0x13'));var hardwareService=require(_0x228f('0x14'));var logger=require(_0x228f('0x15'))(_0x228f('0x16'));var utils=require(_0x228f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x228f('0x18'));var db=require(_0x228f('0x19'))['db'];function respondWithStatusCode(_0x24f69c,_0x14073a){_0x14073a=_0x14073a||0xcc;return function(_0x2e1a43){if(_0x2e1a43){return _0x24f69c[_0x228f('0x1a')](_0x14073a);}return _0x24f69c[_0x228f('0x1b')](_0x14073a)[_0x228f('0x1c')]();};}function respondWithResult(_0x572535,_0x2fab95){_0x2fab95=_0x2fab95||0xc8;return function(_0xfb6aff){if(_0xfb6aff){return _0x572535[_0x228f('0x1b')](_0x2fab95)[_0x228f('0x1d')](_0xfb6aff);}};}function respondWithFilteredResult(_0x2a4d87,_0x21a913){return function(_0x272723){if(_0x272723){var _0x5b5abb=typeof _0x21a913[_0x228f('0x1e')]==='undefined'&&typeof _0x21a913[_0x228f('0x1f')]===_0x228f('0x20');var _0x195e65=_0x272723['count'];var _0x2d4819=_0x5b5abb?0x0:_0x21a913['offset'];var _0x33e32e=_0x5b5abb?_0x272723['count']:_0x21a913[_0x228f('0x1e')]+_0x21a913['limit'];var _0x5aa203;if(_0x33e32e>=_0x195e65){_0x33e32e=_0x195e65;_0x5aa203=0xc8;}else{_0x5aa203=0xce;}_0x2a4d87[_0x228f('0x1b')](_0x5aa203);return _0x2a4d87['set'](_0x228f('0x21'),_0x2d4819+'-'+_0x33e32e+'/'+_0x195e65)[_0x228f('0x1d')](_0x272723);}return null;};}function patchUpdates(_0x1294a8){return function(_0x3a623a){try{jsonpatch[_0x228f('0x22')](_0x3a623a,_0x1294a8,!![]);}catch(_0x313cf2){return BPromise[_0x228f('0x23')](_0x313cf2);}return _0x3a623a[_0x228f('0x24')]();};}function saveUpdates(_0x15d54f,_0x4ee0c9){return function(_0x1e96d4){if(_0x1e96d4){return _0x1e96d4[_0x228f('0x25')](_0x15d54f)[_0x228f('0x26')](function(_0x3c00ad){return _0x3c00ad;});}return null;};}function removeEntity(_0x1dad27,_0x194d1a){return function(_0x33e882){if(_0x33e882){return _0x33e882[_0x228f('0x27')]()[_0x228f('0x26')](function(){var _0x56fbc2=_0x33e882[_0x228f('0x28')]({'plain':!![]});var _0x306928=_0x228f('0x29');return db[_0x228f('0x2a')][_0x228f('0x27')]({'where':{'type':_0x306928,'resourceId':_0x56fbc2['id']}})['then'](function(){return _0x33e882;});})[_0x228f('0x26')](function(){_0x1dad27['status'](0xcc)[_0x228f('0x1c')]();});}};}function handleEntityNotFound(_0x5afa52,_0x58a151){return function(_0x2b9802){if(!_0x2b9802){_0x5afa52[_0x228f('0x1a')](0x194);}return _0x2b9802;};}function handleError(_0x2a7842,_0x3ab339){_0x3ab339=_0x3ab339||0x1f4;return function(_0x34c735){logger[_0x228f('0x2b')](_0x34c735[_0x228f('0x2c')]);if(_0x34c735[_0x228f('0x2d')]){delete _0x34c735[_0x228f('0x2d')];}_0x2a7842[_0x228f('0x1b')](_0x3ab339)[_0x228f('0x2e')](_0x34c735);};}exports[_0x228f('0x2f')]=function(_0xc25917,_0xc6921f){var _0x2a3677={},_0x4e9ca8={},_0x4148ff={'count':0x0,'rows':[]};var _0x40bf17=_[_0x228f('0x30')](db['ContactItemType'][_0x228f('0x31')],function(_0x41be2d){return{'name':_0x41be2d['fieldName'],'type':_0x41be2d[_0x228f('0x32')][_0x228f('0x33')]};});_0x4e9ca8[_0x228f('0x34')]=_[_0x228f('0x30')](_0x40bf17,'name');_0x4e9ca8[_0x228f('0x35')]=_['keys'](_0xc25917[_0x228f('0x35')]);_0x4e9ca8[_0x228f('0x36')]=_[_0x228f('0x37')](_0x4e9ca8[_0x228f('0x34')],_0x4e9ca8['query']);_0x2a3677[_0x228f('0x38')]=_[_0x228f('0x37')](_0x4e9ca8['model'],qs['fields'](_0xc25917['query'][_0x228f('0x39')]));_0x2a3677[_0x228f('0x38')]=_0x2a3677[_0x228f('0x38')][_0x228f('0x3a')]?_0x2a3677[_0x228f('0x38')]:_0x4e9ca8[_0x228f('0x34')];if(!_0xc25917[_0x228f('0x35')][_0x228f('0x3b')](_0x228f('0x3c'))){_0x2a3677['limit']=qs['limit'](_0xc25917[_0x228f('0x35')][_0x228f('0x1f')]);_0x2a3677[_0x228f('0x1e')]=qs[_0x228f('0x1e')](_0xc25917[_0x228f('0x35')][_0x228f('0x1e')]);}_0x2a3677[_0x228f('0x3d')]=qs[_0x228f('0x3e')](_0xc25917[_0x228f('0x35')][_0x228f('0x3e')]);_0x2a3677['where']=qs['filters'](_[_0x228f('0x3f')](_0xc25917[_0x228f('0x35')],_0x4e9ca8[_0x228f('0x36')]),_0x40bf17);if(_0xc25917[_0x228f('0x35')]['filter']){_0x2a3677[_0x228f('0x40')]=_[_0x228f('0x41')](_0x2a3677['where'],{'$or':_['map'](_0x40bf17,function(_0x3da115){if(_0x3da115[_0x228f('0x32')]!=='VIRTUAL'){var _0x12a750={};_0x12a750[_0x3da115[_0x228f('0x2d')]]={'$like':'%'+_0xc25917['query']['filter']+'%'};return _0x12a750;}})});}_0x2a3677=_[_0x228f('0x41')]({},_0x2a3677,_0xc25917['options']);var _0x323d68={'where':_0x2a3677[_0x228f('0x40')]};return db[_0x228f('0x42')][_0x228f('0x43')](_0x323d68)[_0x228f('0x26')](function(_0x20c178){_0x4148ff['count']=_0x20c178;if(_0xc25917[_0x228f('0x35')]['includeAll']){_0x2a3677[_0x228f('0x44')]=[{'all':!![]}];}return db[_0x228f('0x42')][_0x228f('0x45')](_0x2a3677);})[_0x228f('0x26')](function(_0x41cba5){_0x4148ff[_0x228f('0x46')]=_0x41cba5;return _0x4148ff;})[_0x228f('0x26')](respondWithFilteredResult(_0xc6921f,_0x2a3677))[_0x228f('0x47')](handleError(_0xc6921f,null));};exports[_0x228f('0x48')]=function(_0x2592a1,_0x788e8b){var _0x345114={'raw':!![],'where':{'id':_0x2592a1['params']['id']}},_0x19839d={};_0x19839d['model']=_[_0x228f('0x49')](db[_0x228f('0x42')][_0x228f('0x31')]);_0x19839d[_0x228f('0x35')]=_[_0x228f('0x49')](_0x2592a1[_0x228f('0x35')]);_0x19839d[_0x228f('0x36')]=_[_0x228f('0x37')](_0x19839d[_0x228f('0x34')],_0x19839d[_0x228f('0x35')]);_0x345114['attributes']=_[_0x228f('0x37')](_0x19839d[_0x228f('0x34')],qs['fields'](_0x2592a1[_0x228f('0x35')]['fields']));_0x345114[_0x228f('0x38')]=_0x345114['attributes'][_0x228f('0x3a')]?_0x345114['attributes']:_0x19839d[_0x228f('0x34')];if(_0x2592a1[_0x228f('0x35')][_0x228f('0x4a')]){_0x345114[_0x228f('0x44')]=[{'all':!![]}];}_0x345114=_[_0x228f('0x41')]({},_0x345114,_0x2592a1[_0x228f('0x4b')]);return db[_0x228f('0x42')][_0x228f('0x4c')](_0x345114)[_0x228f('0x26')](handleEntityNotFound(_0x788e8b,null))[_0x228f('0x26')](respondWithResult(_0x788e8b,null))[_0x228f('0x47')](handleError(_0x788e8b,null));};exports[_0x228f('0x4d')]=function(_0x4099d4,_0x250345){return db[_0x228f('0x42')][_0x228f('0x4d')](_0x4099d4[_0x228f('0x4e')],{})[_0x228f('0x26')](function(_0x1872e2){var _0x55e140=_0x4099d4['user'][_0x228f('0x28')]({'plain':!![]});if(!_0x55e140)throw new Error(_0x228f('0x4f'));if(_0x55e140[_0x228f('0x50')]==='user'){var _0x17bcd9=_0x1872e2[_0x228f('0x28')]({'plain':!![]});var _0x28f91e='ContactItemTypes';return db['UserProfileSection']['find']({'where':{'name':_0x28f91e,'userProfileId':_0x55e140[_0x228f('0x51')]},'raw':!![]})[_0x228f('0x26')](function(_0x208397){if(_0x208397&&_0x208397[_0x228f('0x52')]===0x0){return db[_0x228f('0x2a')][_0x228f('0x4d')]({'name':_0x17bcd9[_0x228f('0x2d')],'resourceId':_0x17bcd9['id'],'type':_0x208397[_0x228f('0x2d')],'sectionId':_0x208397['id']},{})[_0x228f('0x26')](function(){return _0x1872e2;});}else{return _0x1872e2;}})[_0x228f('0x47')](function(_0x43bbd2){logger[_0x228f('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43bbd2);throw _0x43bbd2;});}return _0x1872e2;})[_0x228f('0x26')](respondWithResult(_0x250345,0xc9))[_0x228f('0x47')](handleError(_0x250345,null));};exports[_0x228f('0x25')]=function(_0x561144,_0x3e9f76){if(_0x561144[_0x228f('0x4e')]['id']){delete _0x561144[_0x228f('0x4e')]['id'];}return db[_0x228f('0x42')]['find']({'where':{'id':_0x561144[_0x228f('0x53')]['id']}})[_0x228f('0x26')](handleEntityNotFound(_0x3e9f76,null))[_0x228f('0x26')](saveUpdates(_0x561144[_0x228f('0x4e')],null))['then'](respondWithResult(_0x3e9f76,null))[_0x228f('0x47')](handleError(_0x3e9f76,null));};exports[_0x228f('0x27')]=function(_0x4b516e,_0x32787c){return db[_0x228f('0x42')][_0x228f('0x4c')]({'where':{'id':_0x4b516e[_0x228f('0x53')]['id']}})[_0x228f('0x26')](handleEntityNotFound(_0x32787c,null))[_0x228f('0x26')](db[_0x228f('0x54')][_0x228f('0x25')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x4b516e[_0x228f('0x53')]['id']}}))[_0x228f('0x26')](removeEntity(_0x32787c,null))['catch'](handleError(_0x32787c,null));}; \ No newline at end of file +var _0x8603=['rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','VIRTUAL','options','where','ContactItemType','includeAll','include','findAll','rows','params','find','catch','create','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body'];(function(_0x119517,_0x383d12){var _0x140331=function(_0x48ef2c){while(--_0x48ef2c){_0x119517['push'](_0x119517['shift']());}};_0x140331(++_0x383d12);}(_0x8603,0x190));var _0x3860=function(_0x4a02e9,_0x5d7b67){_0x4a02e9=_0x4a02e9-0x0;var _0x229ed7=_0x8603[_0x4a02e9];return _0x229ed7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3860('0x0'));var zipdir=require(_0x3860('0x1'));var jsonpatch=require(_0x3860('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3860('0x3'));var Mustache=require(_0x3860('0x4'));var util=require(_0x3860('0x5'));var path=require('path');var sox=require(_0x3860('0x6'));var csv=require('to-csv');var ejs=require(_0x3860('0x7'));var fs=require('fs');var fs_extra=require(_0x3860('0x8'));var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3860('0x10'));var logger=require(_0x3860('0x11'))('api');var utils=require(_0x3860('0x12'));var config=require(_0x3860('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x3860('0x14'))['db'];function respondWithStatusCode(_0x8ad61d,_0x2428f6){_0x2428f6=_0x2428f6||0xcc;return function(_0x1ea619){if(_0x1ea619){return _0x8ad61d[_0x3860('0x15')](_0x2428f6);}return _0x8ad61d[_0x3860('0x16')](_0x2428f6)[_0x3860('0x17')]();};}function respondWithResult(_0x12b23b,_0x465d8d){_0x465d8d=_0x465d8d||0xc8;return function(_0x46264d){if(_0x46264d){return _0x12b23b['status'](_0x465d8d)[_0x3860('0x18')](_0x46264d);}};}function respondWithFilteredResult(_0x21eaf1,_0x122e40){return function(_0x37d9ab){if(_0x37d9ab){var _0x1055b3=typeof _0x122e40[_0x3860('0x19')]===_0x3860('0x1a')&&typeof _0x122e40[_0x3860('0x1b')]===_0x3860('0x1a');var _0x3c0d91=_0x37d9ab[_0x3860('0x1c')];var _0x45b799=_0x1055b3?0x0:_0x122e40['offset'];var _0x4863bd=_0x1055b3?_0x37d9ab[_0x3860('0x1c')]:_0x122e40[_0x3860('0x19')]+_0x122e40[_0x3860('0x1b')];var _0x53fc63;if(_0x4863bd>=_0x3c0d91){_0x4863bd=_0x3c0d91;_0x53fc63=0xc8;}else{_0x53fc63=0xce;}_0x21eaf1[_0x3860('0x16')](_0x53fc63);return _0x21eaf1[_0x3860('0x1d')](_0x3860('0x1e'),_0x45b799+'-'+_0x4863bd+'/'+_0x3c0d91)[_0x3860('0x18')](_0x37d9ab);}return null;};}function patchUpdates(_0x20a5b0){return function(_0x45081f){try{jsonpatch[_0x3860('0x1f')](_0x45081f,_0x20a5b0,!![]);}catch(_0x1f8891){return BPromise[_0x3860('0x20')](_0x1f8891);}return _0x45081f[_0x3860('0x21')]();};}function saveUpdates(_0xacd57f,_0x2e0b6e){return function(_0x280ea9){if(_0x280ea9){return _0x280ea9[_0x3860('0x22')](_0xacd57f)[_0x3860('0x23')](function(_0x564efd){return _0x564efd;});}return null;};}function removeEntity(_0xfc10a5,_0x133093){return function(_0x2b91f2){if(_0x2b91f2){return _0x2b91f2[_0x3860('0x24')]()[_0x3860('0x23')](function(){var _0x56a6d1=_0x2b91f2[_0x3860('0x25')]({'plain':!![]});var _0x568515='ContactItemTypes';return db[_0x3860('0x26')][_0x3860('0x24')]({'where':{'type':_0x568515,'resourceId':_0x56a6d1['id']}})['then'](function(){return _0x2b91f2;});})['then'](function(){_0xfc10a5['status'](0xcc)[_0x3860('0x17')]();});}};}function handleEntityNotFound(_0x3ebc5b,_0xb25cc2){return function(_0x371f3a){if(!_0x371f3a){_0x3ebc5b[_0x3860('0x15')](0x194);}return _0x371f3a;};}function handleError(_0x228d34,_0x544b9a){_0x544b9a=_0x544b9a||0x1f4;return function(_0x4c4314){logger[_0x3860('0x27')](_0x4c4314[_0x3860('0x28')]);if(_0x4c4314['name']){delete _0x4c4314[_0x3860('0x29')];}_0x228d34[_0x3860('0x16')](_0x544b9a)[_0x3860('0x2a')](_0x4c4314);};}exports[_0x3860('0x2b')]=function(_0x3628f7,_0x4bbae9){var _0x36ae2b={},_0xf624ba={},_0x367b14={'count':0x0,'rows':[]};var _0x4bd90c=_[_0x3860('0x2c')](db['ContactItemType'][_0x3860('0x2d')],function(_0x4825f0){return{'name':_0x4825f0[_0x3860('0x2e')],'type':_0x4825f0[_0x3860('0x2f')][_0x3860('0x30')]};});_0xf624ba['model']=_[_0x3860('0x2c')](_0x4bd90c,_0x3860('0x29'));_0xf624ba['query']=_[_0x3860('0x31')](_0x3628f7['query']);_0xf624ba[_0x3860('0x32')]=_[_0x3860('0x33')](_0xf624ba[_0x3860('0x34')],_0xf624ba[_0x3860('0x35')]);_0x36ae2b[_0x3860('0x36')]=_[_0x3860('0x33')](_0xf624ba[_0x3860('0x34')],qs['fields'](_0x3628f7[_0x3860('0x35')][_0x3860('0x37')]));_0x36ae2b['attributes']=_0x36ae2b[_0x3860('0x36')][_0x3860('0x38')]?_0x36ae2b[_0x3860('0x36')]:_0xf624ba['model'];if(!_0x3628f7['query'][_0x3860('0x39')](_0x3860('0x3a'))){_0x36ae2b[_0x3860('0x1b')]=qs[_0x3860('0x1b')](_0x3628f7['query']['limit']);_0x36ae2b[_0x3860('0x19')]=qs[_0x3860('0x19')](_0x3628f7[_0x3860('0x35')][_0x3860('0x19')]);}_0x36ae2b[_0x3860('0x3b')]=qs['sort'](_0x3628f7[_0x3860('0x35')][_0x3860('0x3c')]);_0x36ae2b['where']=qs['filters'](_[_0x3860('0x3d')](_0x3628f7[_0x3860('0x35')],_0xf624ba[_0x3860('0x32')]),_0x4bd90c);if(_0x3628f7[_0x3860('0x35')][_0x3860('0x3e')]){_0x36ae2b['where']=_[_0x3860('0x3f')](_0x36ae2b['where'],{'$or':_[_0x3860('0x2c')](_0x4bd90c,function(_0x35bf7a){if(_0x35bf7a['type']!==_0x3860('0x40')){var _0x162e65={};_0x162e65[_0x35bf7a['name']]={'$like':'%'+_0x3628f7[_0x3860('0x35')][_0x3860('0x3e')]+'%'};return _0x162e65;}})});}_0x36ae2b=_[_0x3860('0x3f')]({},_0x36ae2b,_0x3628f7[_0x3860('0x41')]);var _0x4f486e={'where':_0x36ae2b[_0x3860('0x42')]};return db[_0x3860('0x43')][_0x3860('0x1c')](_0x4f486e)['then'](function(_0x3a87e5){_0x367b14['count']=_0x3a87e5;if(_0x3628f7[_0x3860('0x35')][_0x3860('0x44')]){_0x36ae2b[_0x3860('0x45')]=[{'all':!![]}];}return db[_0x3860('0x43')][_0x3860('0x46')](_0x36ae2b);})[_0x3860('0x23')](function(_0x4e0a44){_0x367b14[_0x3860('0x47')]=_0x4e0a44;return _0x367b14;})[_0x3860('0x23')](respondWithFilteredResult(_0x4bbae9,_0x36ae2b))['catch'](handleError(_0x4bbae9,null));};exports['show']=function(_0x2938d4,_0x5840f7){var _0x4f2f53={'raw':!![],'where':{'id':_0x2938d4[_0x3860('0x48')]['id']}},_0x164a77={};_0x164a77['model']=_[_0x3860('0x31')](db[_0x3860('0x43')][_0x3860('0x2d')]);_0x164a77[_0x3860('0x35')]=_[_0x3860('0x31')](_0x2938d4[_0x3860('0x35')]);_0x164a77[_0x3860('0x32')]=_[_0x3860('0x33')](_0x164a77[_0x3860('0x34')],_0x164a77[_0x3860('0x35')]);_0x4f2f53[_0x3860('0x36')]=_[_0x3860('0x33')](_0x164a77[_0x3860('0x34')],qs['fields'](_0x2938d4[_0x3860('0x35')]['fields']));_0x4f2f53[_0x3860('0x36')]=_0x4f2f53[_0x3860('0x36')][_0x3860('0x38')]?_0x4f2f53[_0x3860('0x36')]:_0x164a77[_0x3860('0x34')];if(_0x2938d4[_0x3860('0x35')][_0x3860('0x44')]){_0x4f2f53[_0x3860('0x45')]=[{'all':!![]}];}_0x4f2f53=_['merge']({},_0x4f2f53,_0x2938d4[_0x3860('0x41')]);return db[_0x3860('0x43')][_0x3860('0x49')](_0x4f2f53)['then'](handleEntityNotFound(_0x5840f7,null))[_0x3860('0x23')](respondWithResult(_0x5840f7,null))[_0x3860('0x4a')](handleError(_0x5840f7,null));};exports[_0x3860('0x4b')]=function(_0x3dc957,_0x5ed2db){return db['ContactItemType'][_0x3860('0x4b')](_0x3dc957['body'],{})[_0x3860('0x23')](function(_0x4226da){var _0x410dab=_0x3dc957['user'][_0x3860('0x25')]({'plain':!![]});if(!_0x410dab)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x410dab[_0x3860('0x4c')]==='user'){var _0xf9edb4=_0x4226da[_0x3860('0x25')]({'plain':!![]});var _0x39b2e0='ContactItemTypes';return db['UserProfileSection'][_0x3860('0x49')]({'where':{'name':_0x39b2e0,'userProfileId':_0x410dab[_0x3860('0x4d')]},'raw':!![]})['then'](function(_0x3910f5){if(_0x3910f5&&_0x3910f5['autoAssociation']===0x0){return db[_0x3860('0x26')][_0x3860('0x4b')]({'name':_0xf9edb4[_0x3860('0x29')],'resourceId':_0xf9edb4['id'],'type':_0x3910f5[_0x3860('0x29')],'sectionId':_0x3910f5['id']},{})[_0x3860('0x23')](function(){return _0x4226da;});}else{return _0x4226da;}})[_0x3860('0x4a')](function(_0x3fad85){logger['error'](_0x3860('0x4e'),_0x3fad85);throw _0x3fad85;});}return _0x4226da;})[_0x3860('0x23')](respondWithResult(_0x5ed2db,0xc9))[_0x3860('0x4a')](handleError(_0x5ed2db,null));};exports[_0x3860('0x22')]=function(_0x279e6f,_0x447163){if(_0x279e6f['body']['id']){delete _0x279e6f[_0x3860('0x4f')]['id'];}return db[_0x3860('0x43')][_0x3860('0x49')]({'where':{'id':_0x279e6f[_0x3860('0x48')]['id']}})[_0x3860('0x23')](handleEntityNotFound(_0x447163,null))[_0x3860('0x23')](saveUpdates(_0x279e6f[_0x3860('0x4f')],null))[_0x3860('0x23')](respondWithResult(_0x447163,null))['catch'](handleError(_0x447163,null));};exports[_0x3860('0x24')]=function(_0x2ff0bf,_0x53a669){return db[_0x3860('0x43')][_0x3860('0x49')]({'where':{'id':_0x2ff0bf[_0x3860('0x48')]['id']}})['then'](handleEntityNotFound(_0x53a669,null))[_0x3860('0x23')](db['CmContactHasItem'][_0x3860('0x22')]({'ItemTypeId':null},{'where':{'ItemTypeId':_0x2ff0bf[_0x3860('0x48')]['id']}}))[_0x3860('0x23')](removeEntity(_0x53a669,null))[_0x3860('0x4a')](handleError(_0x53a669,null));}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.model.js b/server/api/contactItemType/contactItemType.model.js index eeb9356..c3b8c9a 100644 --- a/server/api/contactItemType/contactItemType.model.js +++ b/server/api/contactItemType/contactItemType.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf2a8=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./contactItemType.attributes','exports','ContactItemType'];(function(_0x5c1b40,_0x52af49){var _0x28c4e7=function(_0x3f2c8a){while(--_0x3f2c8a){_0x5c1b40['push'](_0x5c1b40['shift']());}};_0x28c4e7(++_0x52af49);}(_0xf2a8,0x14a));var _0x8f2a=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf2a8[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x8f2a('0x0'));var util=require(_0x8f2a('0x1'));var logger=require(_0x8f2a('0x2'))(_0x8f2a('0x3'));var moment=require('moment');var BPromise=require(_0x8f2a('0x4'));var rp=require(_0x8f2a('0x5'));var fs=require('fs');var path=require(_0x8f2a('0x6'));var rimraf=require(_0x8f2a('0x7'));var config=require('../../config/environment');var attributes=require(_0x8f2a('0x8'));module[_0x8f2a('0x9')]=function(_0x19b13,_0x40041e){return _0x19b13['define'](_0x8f2a('0xa'),attributes,{'tableName':'tools_contact_item_types','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e54=['define','ContactItemType','tools_contact_item_types','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./contactItemType.attributes','exports'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x4e54,0x65));var _0x44e5=function(_0x132d12,_0x2c9799){_0x132d12=_0x132d12-0x0;var _0x1c3163=_0x4e54[_0x132d12];return _0x1c3163;};'use strict';var _=require('lodash');var util=require(_0x44e5('0x0'));var logger=require(_0x44e5('0x1'))(_0x44e5('0x2'));var moment=require(_0x44e5('0x3'));var BPromise=require(_0x44e5('0x4'));var rp=require(_0x44e5('0x5'));var fs=require('fs');var path=require(_0x44e5('0x6'));var rimraf=require(_0x44e5('0x7'));var config=require(_0x44e5('0x8'));var attributes=require(_0x44e5('0x9'));module[_0x44e5('0xa')]=function(_0x5d8637,_0x37fd95){return _0x5d8637[_0x44e5('0xb')](_0x44e5('0xc'),attributes,{'tableName':_0x44e5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/contactItemType/contactItemType.rpc.js b/server/api/contactItemType/contactItemType.rpc.js index fbc1e88..8560b0e 100644 --- a/server/api/contactItemType/contactItemType.rpc.js +++ b/server/api/contactItemType/contactItemType.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8882=['rpc','../../config/environment','client','http','request','then','info','ContactItemType,\x20%s,\x20%s','debug','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger'];(function(_0xf6c630,_0x4c374b){var _0x45823c=function(_0x36f396){while(--_0x36f396){_0xf6c630['push'](_0xf6c630['shift']());}};_0x45823c(++_0x4c374b);}(_0x8882,0x169));var _0x2888=function(_0x446699,_0x25ae79){_0x446699=_0x446699-0x0;var _0x3b4e51=_0x8882[_0x446699];return _0x3b4e51;};'use strict';var _=require(_0x2888('0x0'));var util=require(_0x2888('0x1'));var moment=require(_0x2888('0x2'));var BPromise=require(_0x2888('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2888('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2888('0x5'));var logger=require(_0x2888('0x6'))(_0x2888('0x7'));var config=require(_0x2888('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2888('0x9')][_0x2888('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc1fddc,_0x3b22c0,_0x5c46e0){return new BPromise(function(_0x464b20,_0x77683b){return client[_0x2888('0xb')](_0xc1fddc,_0x5c46e0)[_0x2888('0xc')](function(_0x2e38b2){logger[_0x2888('0xd')](_0x2888('0xe'),_0x3b22c0,'request\x20sent');logger[_0x2888('0xf')](_0x2888('0x10'),_0x3b22c0,'request\x20sent',JSON[_0x2888('0x11')](_0x2e38b2));if(_0x2e38b2[_0x2888('0x12')]){if(_0x2e38b2[_0x2888('0x12')][_0x2888('0x13')]===0x1f4){logger['error'](_0x2888('0xe'),_0x3b22c0,_0x2e38b2['error']['message']);return _0x77683b(_0x2e38b2[_0x2888('0x12')][_0x2888('0x14')]);}logger[_0x2888('0x12')](_0x2888('0xe'),_0x3b22c0,_0x2e38b2['error'][_0x2888('0x14')]);return _0x464b20(_0x2e38b2[_0x2888('0x12')][_0x2888('0x14')]);}else{logger[_0x2888('0xd')](_0x2888('0xe'),_0x3b22c0,_0x2888('0x15'));_0x464b20(_0x2e38b2['result'][_0x2888('0x14')]);}})[_0x2888('0x16')](function(_0x5ae430){logger[_0x2888('0x12')](_0x2888('0xe'),_0x3b22c0,_0x5ae430);_0x77683b(_0x5ae430);});});} \ No newline at end of file +var _0x8319=['jayson/promise','http','request','ContactItemType,\x20%s,\x20%s','ContactItemType,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x4042c8,_0x516c2a){var _0x245c4e=function(_0x2a0474){while(--_0x2a0474){_0x4042c8['push'](_0x4042c8['shift']());}};_0x245c4e(++_0x516c2a);}(_0x8319,0xac));var _0x9831=function(_0x19e821,_0x4d2578){_0x19e821=_0x19e821-0x0;var _0x5cbd74=_0x8319[_0x19e821];return _0x5cbd74;};'use strict';var _=require(_0x9831('0x0'));var util=require(_0x9831('0x1'));var moment=require('moment');var BPromise=require(_0x9831('0x2'));var rs=require(_0x9831('0x3'));var fs=require('fs');var Redis=require(_0x9831('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9831('0x5'))(_0x9831('0x6'));var config=require(_0x9831('0x7'));var jayson=require(_0x9831('0x8'));var client=jayson['client'][_0x9831('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3f42f4,_0x428885,_0x4844ba){return new BPromise(function(_0x1e9d59,_0x72efd9){return client[_0x9831('0xa')](_0x3f42f4,_0x4844ba)['then'](function(_0x555f22){logger['info'](_0x9831('0xb'),_0x428885,'request\x20sent');logger['debug'](_0x9831('0xc'),_0x428885,'request\x20sent',JSON[_0x9831('0xd')](_0x555f22));if(_0x555f22[_0x9831('0xe')]){if(_0x555f22[_0x9831('0xe')][_0x9831('0xf')]===0x1f4){logger[_0x9831('0xe')](_0x9831('0xb'),_0x428885,_0x555f22[_0x9831('0xe')][_0x9831('0x10')]);return _0x72efd9(_0x555f22[_0x9831('0xe')][_0x9831('0x10')]);}logger[_0x9831('0xe')](_0x9831('0xb'),_0x428885,_0x555f22[_0x9831('0xe')][_0x9831('0x10')]);return _0x1e9d59(_0x555f22['error'][_0x9831('0x10')]);}else{logger[_0x9831('0x11')]('ContactItemType,\x20%s,\x20%s',_0x428885,_0x9831('0x12'));_0x1e9d59(_0x555f22['result'][_0x9831('0x10')]);}})[_0x9831('0x13')](function(_0x525c56){logger[_0x9831('0xe')]('ContactItemType,\x20%s,\x20%s',_0x428885,_0x525c56);_0x72efd9(_0x525c56);});});} \ No newline at end of file diff --git a/server/api/contactItemType/index.js b/server/api/contactItemType/index.js index b0505dd..40a5edb 100644 --- a/server/api/contactItemType/index.js +++ b/server/api/contactItemType/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x10ce=['show','post','isAuthenticated','create','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./contactItemType.controller','get','index'];(function(_0x2fa28d,_0x5cab8f){var _0x4488cb=function(_0x103141){while(--_0x103141){_0x2fa28d['push'](_0x2fa28d['shift']());}};_0x4488cb(++_0x5cab8f);}(_0x10ce,0x1d7));var _0xe10c=function(_0x42900b,_0x47e957){_0x42900b=_0x42900b-0x0;var _0x2ff564=_0x10ce[_0x42900b];return _0x2ff564;};'use strict';var multer=require(_0xe10c('0x0'));var util=require(_0xe10c('0x1'));var path=require(_0xe10c('0x2'));var timeout=require(_0xe10c('0x3'));var express=require(_0xe10c('0x4'));var router=express['Router']();var fs_extra=require(_0xe10c('0x5'));var auth=require(_0xe10c('0x6'));var interaction=require(_0xe10c('0x7'));var config=require(_0xe10c('0x8'));var controller=require(_0xe10c('0x9'));router[_0xe10c('0xa')]('/',auth['isAuthenticated'](),controller[_0xe10c('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xe10c('0xc')]);router[_0xe10c('0xd')]('/',auth[_0xe10c('0xe')](),controller[_0xe10c('0xf')]);router['put'](_0xe10c('0x10'),auth[_0xe10c('0xe')](),controller[_0xe10c('0x11')]);router[_0xe10c('0x12')](_0xe10c('0x10'),auth['isAuthenticated'](),controller[_0xe10c('0x13')]);module[_0xe10c('0x14')]=router; \ No newline at end of file +var _0xd954=['../../components/interaction/service','../../config/environment','./contactItemType.controller','get','index','/:id','show','post','create','put','isAuthenticated','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x30b4e1,_0x4fb045){var _0x50dcdc=function(_0x2c6384){while(--_0x2c6384){_0x30b4e1['push'](_0x30b4e1['shift']());}};_0x50dcdc(++_0x4fb045);}(_0xd954,0x15e));var _0x4d95=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0xd954[_0x31991b];return _0x307304;};'use strict';var multer=require(_0x4d95('0x0'));var util=require(_0x4d95('0x1'));var path=require(_0x4d95('0x2'));var timeout=require(_0x4d95('0x3'));var express=require(_0x4d95('0x4'));var router=express[_0x4d95('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4d95('0x6'));var interaction=require(_0x4d95('0x7'));var config=require(_0x4d95('0x8'));var controller=require(_0x4d95('0x9'));router[_0x4d95('0xa')]('/',auth['isAuthenticated'](),controller[_0x4d95('0xb')]);router[_0x4d95('0xa')](_0x4d95('0xc'),auth['isAuthenticated'](),controller[_0x4d95('0xd')]);router[_0x4d95('0xe')]('/',auth['isAuthenticated'](),controller[_0x4d95('0xf')]);router[_0x4d95('0x10')](_0x4d95('0xc'),auth[_0x4d95('0x11')](),controller[_0x4d95('0x12')]);router[_0x4d95('0x13')]('/:id',auth[_0x4d95('0x11')](),controller['destroy']);module[_0x4d95('0x14')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 9f014fb..2d672b8 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 _0xd8b0=['exports','sequelize'];(function(_0x212072,_0x203f9a){var _0x39595c=function(_0x269020){while(--_0x269020){_0x212072['push'](_0x212072['shift']());}};_0x39595c(++_0x203f9a);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x55b7c2,_0x171b87){var _0x362883=function(_0xbc61ea){while(--_0xbc61ea){_0x55b7c2['push'](_0x55b7c2['shift']());}};_0x362883(++_0x171b87);}(_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'],'allowNull':![],'unique':'name'},'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 6060402..84b1dce 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 _0x1fc7=['crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','sendStatus','error','send','index','map','Dashboard','rawAttributes','key','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','include','findAll','rows','catch','show','params','length','includeAll','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','autoAssociation','create','iframe','attrUrl','attrs','custom','attrPath','value','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','pie-chart','attrSerie1','attrSerie2','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','findOne','order','getItems','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x1fc7,0x75));var _0x71fc=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x1fc7[_0x1d1779];return _0x2377e9;};'use strict';var emlformat=require(_0x71fc('0x0'));var rimraf=require(_0x71fc('0x1'));var zipdir=require(_0x71fc('0x2'));var jsonpatch=require(_0x71fc('0x3'));var rp=require(_0x71fc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x71fc('0x5'));var util=require(_0x71fc('0x6'));var path=require(_0x71fc('0x7'));var sox=require(_0x71fc('0x8'));var csv=require(_0x71fc('0x9'));var ejs=require(_0x71fc('0xa'));var fs=require('fs');var fs_extra=require(_0x71fc('0xb'));var _=require(_0x71fc('0xc'));var squel=require(_0x71fc('0xd'));var crypto=require(_0x71fc('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x71fc('0xf'));var toCsv=require(_0x71fc('0x9'));var querystring=require(_0x71fc('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x71fc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x71fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x71fc('0x13'))(_0x71fc('0x14'));var utils=require(_0x71fc('0x15'));var config=require(_0x71fc('0x16'));var licenseUtil=require(_0x71fc('0x17'));var db=require(_0x71fc('0x18'))['db'];config[_0x71fc('0x19')]=_[_0x71fc('0x1a')](config[_0x71fc('0x19')],{'host':_0x71fc('0x1b'),'port':0x18eb});var socket=require(_0x71fc('0x1c'))(new Redis(config[_0x71fc('0x19')]));require(_0x71fc('0x1d'))[_0x71fc('0x1e')](socket);function respondWithStatusCode(_0x2dde4a,_0x5ee73e){_0x5ee73e=_0x5ee73e||0xcc;return function(_0x5e25b3){if(_0x5e25b3){return _0x2dde4a['sendStatus'](_0x5ee73e);}return _0x2dde4a[_0x71fc('0x1f')](_0x5ee73e)[_0x71fc('0x20')]();};}function respondWithResult(_0x3852d5,_0x298d15){_0x298d15=_0x298d15||0xc8;return function(_0x13692c){if(_0x13692c){return _0x3852d5[_0x71fc('0x1f')](_0x298d15)[_0x71fc('0x21')](_0x13692c);}};}function respondWithFilteredResult(_0x38362d,_0x29908c){return function(_0x23e8dd){if(_0x23e8dd){var _0x1bef37=typeof _0x29908c[_0x71fc('0x22')]===_0x71fc('0x23')&&typeof _0x29908c[_0x71fc('0x24')]===_0x71fc('0x23');var _0x2581cc=_0x23e8dd[_0x71fc('0x25')];var _0xa2b0f=_0x1bef37?0x0:_0x29908c[_0x71fc('0x22')];var _0x5a2333=_0x1bef37?_0x23e8dd[_0x71fc('0x25')]:_0x29908c[_0x71fc('0x22')]+_0x29908c[_0x71fc('0x24')];var _0x2c8a43;if(_0x5a2333>=_0x2581cc){_0x5a2333=_0x2581cc;_0x2c8a43=0xc8;}else{_0x2c8a43=0xce;}_0x38362d['status'](_0x2c8a43);return _0x38362d['set'](_0x71fc('0x26'),_0xa2b0f+'-'+_0x5a2333+'/'+_0x2581cc)['json'](_0x23e8dd);}return null;};}function patchUpdates(_0x464c83){return function(_0x2d5eb1){try{jsonpatch[_0x71fc('0x27')](_0x2d5eb1,_0x464c83,!![]);}catch(_0x400b0f){return BPromise[_0x71fc('0x28')](_0x400b0f);}return _0x2d5eb1[_0x71fc('0x29')]();};}function saveUpdates(_0x5f4145,_0x3a366c){return function(_0x105428){if(_0x105428){return _0x105428[_0x71fc('0x2a')](_0x5f4145)[_0x71fc('0x2b')](function(_0x13cdec){return _0x13cdec;});}return null;};}function removeEntity(_0x26f677,_0x4ee7b6){return function(_0x5631b6){if(_0x5631b6){return _0x5631b6[_0x71fc('0x2c')]()[_0x71fc('0x2b')](function(){var _0x447033=_0x5631b6[_0x71fc('0x2d')]({'plain':!![]});var _0x3bdc4f=_0x71fc('0x2e');return db[_0x71fc('0x2f')][_0x71fc('0x2c')]({'where':{'type':_0x3bdc4f,'resourceId':_0x447033['id']}})[_0x71fc('0x2b')](function(){return _0x5631b6;});})['then'](function(){_0x26f677[_0x71fc('0x1f')](0xcc)[_0x71fc('0x20')]();});}};}function handleEntityNotFound(_0x219629,_0x22d3e7){return function(_0x2034ea){if(!_0x2034ea){_0x219629[_0x71fc('0x30')](0x194);}return _0x2034ea;};}function handleError(_0x40a417,_0x3bcb2b){_0x3bcb2b=_0x3bcb2b||0x1f4;return function(_0x2a9f5a){logger[_0x71fc('0x31')](_0x2a9f5a['stack']);if(_0x2a9f5a['name']){delete _0x2a9f5a['name'];}_0x40a417[_0x71fc('0x1f')](_0x3bcb2b)[_0x71fc('0x32')](_0x2a9f5a);};}exports[_0x71fc('0x33')]=function(_0x20abfe,_0x5ae86e){var _0x45266e={},_0x697941={},_0x3787bc={'count':0x0,'rows':[]};var _0x455db9=_[_0x71fc('0x34')](db[_0x71fc('0x35')][_0x71fc('0x36')],function(_0xeda424){return{'name':_0xeda424['fieldName'],'type':_0xeda424['type'][_0x71fc('0x37')]};});_0x697941[_0x71fc('0x38')]=_[_0x71fc('0x34')](_0x455db9,_0x71fc('0x39'));_0x697941[_0x71fc('0x3a')]=_[_0x71fc('0x3b')](_0x20abfe[_0x71fc('0x3a')]);_0x697941[_0x71fc('0x3c')]=_[_0x71fc('0x3d')](_0x697941['model'],_0x697941[_0x71fc('0x3a')]);_0x45266e[_0x71fc('0x3e')]=_[_0x71fc('0x3d')](_0x697941[_0x71fc('0x38')],qs[_0x71fc('0x3f')](_0x20abfe[_0x71fc('0x3a')][_0x71fc('0x3f')]));_0x45266e[_0x71fc('0x3e')]=_0x45266e[_0x71fc('0x3e')]['length']?_0x45266e[_0x71fc('0x3e')]:_0x697941[_0x71fc('0x38')];if(!_0x20abfe[_0x71fc('0x3a')][_0x71fc('0x40')](_0x71fc('0x41'))){_0x45266e['limit']=qs[_0x71fc('0x24')](_0x20abfe[_0x71fc('0x3a')][_0x71fc('0x24')]);_0x45266e[_0x71fc('0x22')]=qs[_0x71fc('0x22')](_0x20abfe[_0x71fc('0x3a')][_0x71fc('0x22')]);}_0x45266e['order']=qs['sort'](_0x20abfe['query'][_0x71fc('0x42')]);_0x45266e[_0x71fc('0x43')]=qs[_0x71fc('0x3c')](_[_0x71fc('0x44')](_0x20abfe[_0x71fc('0x3a')],_0x697941['filters']),_0x455db9);if(_0x20abfe[_0x71fc('0x3a')][_0x71fc('0x45')]){_0x45266e[_0x71fc('0x43')]=_[_0x71fc('0x46')](_0x45266e[_0x71fc('0x43')],{'$or':_[_0x71fc('0x34')](_0x455db9,function(_0xc11437){if(_0xc11437[_0x71fc('0x47')]!=='VIRTUAL'){var _0x182739={};_0x182739[_0xc11437[_0x71fc('0x39')]]={'$like':'%'+_0x20abfe[_0x71fc('0x3a')][_0x71fc('0x45')]+'%'};return _0x182739;}})});}_0x45266e=_[_0x71fc('0x46')]({},_0x45266e,_0x20abfe[_0x71fc('0x48')]);var _0x33f89b={'where':_0x45266e[_0x71fc('0x43')]};return db[_0x71fc('0x35')][_0x71fc('0x25')](_0x33f89b)[_0x71fc('0x2b')](function(_0x4be7ff){_0x3787bc[_0x71fc('0x25')]=_0x4be7ff;if(_0x20abfe['query']['includeAll']){_0x45266e[_0x71fc('0x49')]=[{'all':!![]}];}return db[_0x71fc('0x35')][_0x71fc('0x4a')](_0x45266e);})['then'](function(_0x5a7f23){_0x3787bc[_0x71fc('0x4b')]=_0x5a7f23;return _0x3787bc;})[_0x71fc('0x2b')](respondWithFilteredResult(_0x5ae86e,_0x45266e))[_0x71fc('0x4c')](handleError(_0x5ae86e,null));};exports[_0x71fc('0x4d')]=function(_0x1e99fd,_0x382319){var _0x6fe2bc={'raw':![],'where':{'id':_0x1e99fd[_0x71fc('0x4e')]['id']}},_0x4010ec={};_0x4010ec[_0x71fc('0x38')]=_[_0x71fc('0x3b')](db[_0x71fc('0x35')][_0x71fc('0x36')]);_0x4010ec[_0x71fc('0x3a')]=_[_0x71fc('0x3b')](_0x1e99fd[_0x71fc('0x3a')]);_0x4010ec[_0x71fc('0x3c')]=_[_0x71fc('0x3d')](_0x4010ec[_0x71fc('0x38')],_0x4010ec['query']);_0x6fe2bc['attributes']=_[_0x71fc('0x3d')](_0x4010ec[_0x71fc('0x38')],qs['fields'](_0x1e99fd['query'][_0x71fc('0x3f')]));_0x6fe2bc[_0x71fc('0x3e')]=_0x6fe2bc[_0x71fc('0x3e')][_0x71fc('0x4f')]?_0x6fe2bc[_0x71fc('0x3e')]:_0x4010ec[_0x71fc('0x38')];if(_0x1e99fd[_0x71fc('0x3a')][_0x71fc('0x50')]){_0x6fe2bc['include']=[{'all':!![]}];}_0x6fe2bc=_[_0x71fc('0x46')]({},_0x6fe2bc,_0x1e99fd[_0x71fc('0x48')]);return db['Dashboard']['find'](_0x6fe2bc)[_0x71fc('0x2b')](handleEntityNotFound(_0x382319,null))['then'](respondWithResult(_0x382319,null))[_0x71fc('0x4c')](handleError(_0x382319,null));};exports['create']=function(_0x39c4aa,_0x2c98a1){return db[_0x71fc('0x35')]['create'](_0x39c4aa[_0x71fc('0x51')],{})[_0x71fc('0x2b')](function(_0x4b5f54){var _0x5e56ab=_0x39c4aa[_0x71fc('0x52')][_0x71fc('0x2d')]({'plain':!![]});if(!_0x5e56ab)throw new Error(_0x71fc('0x53'));if(_0x5e56ab[_0x71fc('0x54')]==='user'){var _0x262037=_0x4b5f54[_0x71fc('0x2d')]({'plain':!![]});var _0x596539=_0x71fc('0x2e');return db['UserProfileSection'][_0x71fc('0x55')]({'where':{'name':_0x596539,'userProfileId':_0x5e56ab[_0x71fc('0x56')]},'raw':!![]})['then'](function(_0xcea7c6){if(_0xcea7c6&&_0xcea7c6['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x262037[_0x71fc('0x39')],'resourceId':_0x262037['id'],'type':_0xcea7c6['name'],'sectionId':_0xcea7c6['id']},{})[_0x71fc('0x2b')](function(){return _0x4b5f54;});}else{return _0x4b5f54;}})['catch'](function(_0x438848){logger['error'](_0x71fc('0x57'),_0x438848);throw _0x438848;});}return _0x4b5f54;})[_0x71fc('0x2b')](respondWithResult(_0x2c98a1,0xc9))[_0x71fc('0x4c')](handleError(_0x2c98a1,null));};exports[_0x71fc('0x58')]=function(_0x4bb791,_0x3a5ca9){var _0x409251={'where':{'id':_0x4bb791[_0x71fc('0x4e')]['id']}},_0x4a16b3={};_0x4a16b3['model']=_['keys'](db[_0x71fc('0x35')][_0x71fc('0x36')]);_0x409251['attributes']=_[_0x71fc('0x3d')](_0x4a16b3[_0x71fc('0x38')],qs[_0x71fc('0x3f')](_0x4bb791[_0x71fc('0x3a')][_0x71fc('0x3f')]));_0x409251[_0x71fc('0x3e')]=_0x409251['attributes'][_0x71fc('0x4f')]?_0x409251['attributes']:_0x4a16b3[_0x71fc('0x38')];if(_0x4bb791[_0x71fc('0x3a')][_0x71fc('0x50')]){_0x409251[_0x71fc('0x49')]=[{'all':!![]}];}_0x409251=_[_0x71fc('0x46')]({},_0x409251,_0x4bb791[_0x71fc('0x48')]);return db['Dashboard'][_0x71fc('0x55')](_0x409251)[_0x71fc('0x2b')](handleEntityNotFound(_0x3a5ca9,null))[_0x71fc('0x2b')](function(_0x449b73){if(_0x449b73){var _0x2d72c6=_0x449b73[_0x71fc('0x2d')]({'plain':!![]});_0x2d72c6=qs[_0x71fc('0x59')](_0x2d72c6,['id','createdAt',_0x71fc('0x5a')]);_0x4bb791[_0x71fc('0x51')]=_['omit'](_0x4bb791['body'],['id',_0x71fc('0x5b'),_0x71fc('0x5a')]);return db[_0x71fc('0x35')]['create'](_[_0x71fc('0x46')](_0x2d72c6,_0x4bb791[_0x71fc('0x51')]),{'include':_0x4bb791['query'][_0x71fc('0x50')]?[{'all':!![]}]:undefined})[_0x71fc('0x2b')](function(_0x44c7af){var _0x30d7e5=_0x4bb791[_0x71fc('0x52')][_0x71fc('0x2d')]({'plain':!![]});if(!_0x30d7e5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30d7e5['role']===_0x71fc('0x52')){var _0x5a53ba=_0x44c7af['get']({'plain':!![]});var _0x3f6ecc='CustomDashboards';return db['UserProfileSection'][_0x71fc('0x55')]({'where':{'name':_0x3f6ecc,'userProfileId':_0x30d7e5[_0x71fc('0x56')]},'raw':!![]})[_0x71fc('0x2b')](function(_0x8a8a7b){if(_0x8a8a7b&&_0x8a8a7b[_0x71fc('0x5c')]===0x0){return db[_0x71fc('0x2f')][_0x71fc('0x5d')]({'name':_0x5a53ba['name'],'resourceId':_0x5a53ba['id'],'type':_0x8a8a7b['name'],'sectionId':_0x8a8a7b['id']},{})['then'](function(){return _0x44c7af;});}else{return _0x44c7af;}})[_0x71fc('0x4c')](function(_0x146ce2){logger[_0x71fc('0x31')](_0x71fc('0x57'),_0x146ce2);throw _0x146ce2;});}return _0x44c7af;});}})['then'](respondWithResult(_0x3a5ca9,0xc9))[_0x71fc('0x4c')](handleError(_0x3a5ca9,null));};exports[_0x71fc('0x2a')]=function(_0xbc392b,_0x1d14ab){if(_0xbc392b['body']['id']){delete _0xbc392b[_0x71fc('0x51')]['id'];}return db[_0x71fc('0x35')][_0x71fc('0x55')]({'where':{'id':_0xbc392b['params']['id']}})[_0x71fc('0x2b')](handleEntityNotFound(_0x1d14ab,null))[_0x71fc('0x2b')](saveUpdates(_0xbc392b['body'],null))[_0x71fc('0x2b')](respondWithResult(_0x1d14ab,null))[_0x71fc('0x4c')](handleError(_0x1d14ab,null));};exports[_0x71fc('0x2c')]=function(_0x2c1a2e,_0x8ef06){return db['Dashboard']['find']({'where':{'id':_0x2c1a2e[_0x71fc('0x4e')]['id']}})[_0x71fc('0x2b')](handleEntityNotFound(_0x8ef06,null))[_0x71fc('0x2b')](removeEntity(_0x8ef06,null))[_0x71fc('0x4c')](handleError(_0x8ef06,null));};function widgetAttributes(_0x58c78e){try{switch(_0x58c78e[_0x71fc('0x47')]){case _0x71fc('0x5e'):return[{'name':_0x71fc('0x5f'),'value':_0x58c78e[_0x71fc('0x5f')]||(_0x58c78e['attrs']&&_0x58c78e[_0x71fc('0x60')][0x0]?_0x58c78e['attrs'][0x0]['value']:undefined)||'https://'}];case _0x71fc('0x61'):return[{'name':_0x71fc('0x62'),'value':_0x58c78e[_0x71fc('0x62')]||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e[_0x71fc('0x60')][0x0]?_0x58c78e[_0x71fc('0x60')][0x0][_0x71fc('0x63')]:undefined)||''}];case _0x71fc('0x64'):return[{'name':'attrHourFormat','value':_0x58c78e[_0x71fc('0x65')]||(_0x58c78e['attrs']&&_0x58c78e[_0x71fc('0x60')][0x0]?_0x58c78e['attrs'][0x0][_0x71fc('0x63')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x58c78e[_0x71fc('0x66')]||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e['attrs'][0x1]?_0x58c78e[_0x71fc('0x60')][0x1]['value']:undefined)||'0.00'},{'name':'attrFontSize','value':_0x58c78e[_0x71fc('0x67')]||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e[_0x71fc('0x60')][0x2]?_0x58c78e[_0x71fc('0x60')][0x2][_0x71fc('0x63')]:undefined)||0xc}];case _0x71fc('0x68'):return[{'name':_0x71fc('0x69'),'value':_0x58c78e[_0x71fc('0x69')]||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e[_0x71fc('0x60')][0x0]?_0x58c78e[_0x71fc('0x60')][0x0]['value']:undefined)||_0x71fc('0x6a')},{'name':_0x71fc('0x6b'),'value':_0x58c78e[_0x71fc('0x6b')]||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e[_0x71fc('0x60')][0x1]?_0x58c78e[_0x71fc('0x60')][0x1][_0x71fc('0x63')]:undefined)||[]},{'name':_0x71fc('0x67'),'value':_0x58c78e[_0x71fc('0x67')]||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e['attrs'][0x2]?_0x58c78e[_0x71fc('0x60')][0x2][_0x71fc('0x63')]:undefined)||0x14},{'name':_0x71fc('0x6c'),'value':_0x58c78e['attrChannel']||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e['attrs'][0x3]?_0x58c78e[_0x71fc('0x60')][0x3][_0x71fc('0x63')]:undefined)||_0x71fc('0x6d')},{'name':_0x71fc('0x6e'),'value':_0x58c78e[_0x71fc('0x6e')]||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e[_0x71fc('0x60')][0x4]?_0x58c78e[_0x71fc('0x60')][0x4]['value']:undefined)||''},{'name':_0x71fc('0x6f'),'value':_0x58c78e[_0x71fc('0x6f')]||(_0x58c78e['attrs']&&_0x58c78e[_0x71fc('0x60')][0x5]?_0x58c78e['attrs'][0x5][_0x71fc('0x63')]:undefined)||''},{'name':_0x71fc('0x70'),'value':_0x58c78e['attrSmsAccounts']||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e[_0x71fc('0x60')][0x6]?_0x58c78e[_0x71fc('0x60')][0x6][_0x71fc('0x63')]:undefined)||''},{'name':_0x71fc('0x71'),'value':_0x58c78e[_0x71fc('0x71')]||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e[_0x71fc('0x60')][0x7]?_0x58c78e[_0x71fc('0x60')][0x7][_0x71fc('0x63')]:undefined)||''},{'name':_0x71fc('0x72'),'value':_0x58c78e['attrWhatsappAccounts']||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e[_0x71fc('0x60')][0x8]?_0x58c78e[_0x71fc('0x60')][0x8]['value']:undefined)||''},{'name':_0x71fc('0x73'),'value':_0x58c78e[_0x71fc('0x73')]||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e[_0x71fc('0x60')][0x9]?_0x58c78e[_0x71fc('0x60')][0x9][_0x71fc('0x63')]:undefined)||''}];case'multibar-chart':case _0x71fc('0x74'):return[{'name':_0x71fc('0x75'),'value':_0x58c78e[_0x71fc('0x75')]||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e[_0x71fc('0x60')][0x0]?_0x58c78e['attrs'][0x0][_0x71fc('0x63')]:undefined)||_0x71fc('0x6a')},{'name':_0x71fc('0x76'),'value':_0x58c78e[_0x71fc('0x76')]||(_0x58c78e['attrs']&&_0x58c78e['attrs'][0x1]?_0x58c78e[_0x71fc('0x60')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x58c78e['attrSerie3']||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e[_0x71fc('0x60')][0x2]?_0x58c78e[_0x71fc('0x60')][0x2][_0x71fc('0x63')]:undefined)||null},{'name':_0x71fc('0x6b'),'value':_0x58c78e['attrVoiceQueues']||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e['attrs'][0x3]?_0x58c78e['attrs'][0x3][_0x71fc('0x63')]:undefined)||[]},{'name':_0x71fc('0x6c'),'value':_0x58c78e[_0x71fc('0x6c')]||(_0x58c78e['attrs']&&_0x58c78e['attrs'][0x4]?_0x58c78e[_0x71fc('0x60')][0x4][_0x71fc('0x63')]:undefined)||_0x71fc('0x6d')},{'name':_0x71fc('0x6e'),'value':_0x58c78e['attrEmailAccounts']||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e[_0x71fc('0x60')][0x5]?_0x58c78e[_0x71fc('0x60')][0x5][_0x71fc('0x63')]:undefined)||''},{'name':_0x71fc('0x6f'),'value':_0x58c78e[_0x71fc('0x6f')]||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e['attrs'][0x6]?_0x58c78e['attrs'][0x6][_0x71fc('0x63')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x58c78e['attrSmsAccounts']||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e['attrs'][0x7]?_0x58c78e['attrs'][0x7][_0x71fc('0x63')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x58c78e[_0x71fc('0x71')]||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e[_0x71fc('0x60')][0x8]?_0x58c78e[_0x71fc('0x60')][0x8][_0x71fc('0x63')]:undefined)||''},{'name':_0x71fc('0x72'),'value':_0x58c78e['attrWhatsappAccounts']||(_0x58c78e['attrs']&&_0x58c78e[_0x71fc('0x60')][0x9]?_0x58c78e[_0x71fc('0x60')][0x9][_0x71fc('0x63')]:undefined)||''},{'name':_0x71fc('0x73'),'value':_0x58c78e[_0x71fc('0x73')]||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e[_0x71fc('0x60')][0xa]?_0x58c78e['attrs'][0xa][_0x71fc('0x63')]:undefined)||''}];case _0x71fc('0x77'):return[{'name':_0x71fc('0x78'),'type':_0x58c78e[_0x71fc('0x79')]||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e[_0x71fc('0x60')][0x0]?_0x58c78e[_0x71fc('0x60')][0x0]['type']:undefined)||null,'value':_0x58c78e[_0x71fc('0x78')]||(_0x58c78e['attrs']&&_0x58c78e[_0x71fc('0x60')][0x0]?_0x58c78e['attrs'][0x0][_0x71fc('0x63')]:undefined)||null},{'name':'attrRefresh','value':_0x58c78e[_0x71fc('0x7a')]||(_0x58c78e[_0x71fc('0x60')]&&_0x58c78e[_0x71fc('0x60')][0x1]?_0x58c78e[_0x71fc('0x60')][0x1][_0x71fc('0x63')]:undefined)||0x0}];default:return[];}}catch(_0x14a5b2){logger[_0x71fc('0x31')](_0x71fc('0x7b'),JSON[_0x71fc('0x7c')](_0x14a5b2));return[];}}exports[_0x71fc('0x7d')]=function(_0x4a2340,_0x5c8a90,_0x4e1dbe){if(_0x4a2340[_0x71fc('0x51')]['id']){delete _0x4a2340[_0x71fc('0x51')]['id'];}return db['Dashboard'][_0x71fc('0x55')]({'where':{'id':_0x4a2340[_0x71fc('0x4e')]['id']}})[_0x71fc('0x2b')](handleEntityNotFound(_0x5c8a90,null))['then'](function(_0x4916b8){if(_0x4916b8){_0x4a2340[_0x71fc('0x51')][_0x71fc('0x7e')]=_0x4916b8['id'];_0x4a2340['body'][_0x71fc('0x60')]=widgetAttributes(_0x4a2340[_0x71fc('0x51')]);return db[_0x71fc('0x7f')][_0x71fc('0x5d')](_0x4a2340['body']);}})[_0x71fc('0x2b')](respondWithResult(_0x5c8a90,null))[_0x71fc('0x4c')](handleError(_0x5c8a90,null));};exports['getItems']=function(_0x37431f,_0x59fc81,_0x1f506f){var _0x1724f6={};var _0x6a49ad={};var _0x2d9401;var _0x15c297;return db['Dashboard'][_0x71fc('0x80')]({'where':{'id':_0x37431f[_0x71fc('0x4e')]['id']}})[_0x71fc('0x2b')](handleEntityNotFound(_0x59fc81,null))[_0x71fc('0x2b')](function(_0x5418d9){if(_0x5418d9){_0x2d9401=_0x5418d9;_0x6a49ad[_0x71fc('0x38')]=_[_0x71fc('0x3b')](db[_0x71fc('0x7f')][_0x71fc('0x36')]);_0x6a49ad[_0x71fc('0x3a')]=_[_0x71fc('0x3b')](_0x37431f['query']);_0x6a49ad[_0x71fc('0x3c')]=_['intersection'](_0x6a49ad[_0x71fc('0x38')],_0x6a49ad['query']);_0x1724f6['attributes']=_[_0x71fc('0x3d')](_0x6a49ad[_0x71fc('0x38')],qs[_0x71fc('0x3f')](_0x37431f['query'][_0x71fc('0x3f')]));_0x1724f6['attributes']=_0x1724f6[_0x71fc('0x3e')]['length']?_0x1724f6['attributes']:_0x6a49ad['model'];_0x1724f6[_0x71fc('0x81')]=qs[_0x71fc('0x42')](_0x37431f[_0x71fc('0x3a')]['sort']);_0x1724f6[_0x71fc('0x43')]=qs[_0x71fc('0x3c')](_[_0x71fc('0x44')](_0x37431f[_0x71fc('0x3a')],_0x6a49ad[_0x71fc('0x3c')]));if(_0x37431f['query'][_0x71fc('0x45')]){_0x1724f6['where']=_[_0x71fc('0x46')](_0x1724f6[_0x71fc('0x43')],{'$or':_['map'](_0x1724f6[_0x71fc('0x3e')],function(_0x18d4fd){var _0x52e006={};_0x52e006[_0x18d4fd]={'$like':'%'+_0x37431f[_0x71fc('0x3a')]['filter']+'%'};return _0x52e006;})});}_0x1724f6=_['merge']({},_0x1724f6,_0x37431f['options']);return _0x2d9401['getItems'](_0x1724f6);}})['then'](function(_0x7573ee){if(_0x7573ee){_0x15c297=_0x7573ee['length'];if(!_0x37431f[_0x71fc('0x3a')]['hasOwnProperty']('nolimit')){_0x1724f6[_0x71fc('0x24')]=qs[_0x71fc('0x24')](_0x37431f[_0x71fc('0x3a')]['limit']);_0x1724f6[_0x71fc('0x22')]=qs[_0x71fc('0x22')](_0x37431f[_0x71fc('0x3a')]['offset']);}return _0x2d9401[_0x71fc('0x82')](_0x1724f6);}})[_0x71fc('0x2b')](function(_0x459a27){if(_0x459a27){return _0x459a27?{'count':_0x15c297,'rows':_0x459a27}:null;}})[_0x71fc('0x2b')](respondWithResult(_0x59fc81,null))[_0x71fc('0x4c')](handleError(_0x59fc81,null));}; \ No newline at end of file +var _0x0675=['widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','options','getItems','hasOwnProperty','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','get','error','stack','name','send','index','map','Dashboard','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','includeAll','include','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','CustomDashboards','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','omit','createdAt','body','updatedAt','UserProfileSection','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','voice','web-report','reportType','attrReport','attrRefresh'];(function(_0x3fbb62,_0x1c30b4){var _0x1e2f61=function(_0x2ab8fc){while(--_0x2ab8fc){_0x3fbb62['push'](_0x3fbb62['shift']());}};_0x1e2f61(++_0x1c30b4);}(_0x0675,0x109));var _0x5067=function(_0x2e0602,_0x3c396d){_0x2e0602=_0x2e0602-0x0;var _0x224585=_0x0675[_0x2e0602];return _0x224585;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5067('0x0'));var zipdir=require(_0x5067('0x1'));var jsonpatch=require(_0x5067('0x2'));var rp=require(_0x5067('0x3'));var moment=require(_0x5067('0x4'));var BPromise=require(_0x5067('0x5'));var Mustache=require(_0x5067('0x6'));var util=require(_0x5067('0x7'));var path=require(_0x5067('0x8'));var sox=require(_0x5067('0x9'));var csv=require('to-csv');var ejs=require(_0x5067('0xa'));var fs=require('fs');var fs_extra=require(_0x5067('0xb'));var _=require(_0x5067('0xc'));var squel=require('squel');var crypto=require(_0x5067('0xd'));var jsforce=require(_0x5067('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x5067('0xf'));var Papa=require('papaparse');var Redis=require(_0x5067('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x5067('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5067('0x12'));var logger=require(_0x5067('0x13'))(_0x5067('0x14'));var utils=require(_0x5067('0x15'));var config=require(_0x5067('0x16'));var licenseUtil=require(_0x5067('0x17'));var db=require(_0x5067('0x18'))['db'];config[_0x5067('0x19')]=_[_0x5067('0x1a')](config[_0x5067('0x19')],{'host':_0x5067('0x1b'),'port':0x18eb});var socket=require(_0x5067('0x1c'))(new Redis(config['redis']));require('./dashboard.socket')[_0x5067('0x1d')](socket);function respondWithStatusCode(_0x2f5a6e,_0x2a5e5c){_0x2a5e5c=_0x2a5e5c||0xcc;return function(_0x38566e){if(_0x38566e){return _0x2f5a6e[_0x5067('0x1e')](_0x2a5e5c);}return _0x2f5a6e[_0x5067('0x1f')](_0x2a5e5c)[_0x5067('0x20')]();};}function respondWithResult(_0x468945,_0x5ab32e){_0x5ab32e=_0x5ab32e||0xc8;return function(_0x2c79ce){if(_0x2c79ce){return _0x468945[_0x5067('0x1f')](_0x5ab32e)[_0x5067('0x21')](_0x2c79ce);}};}function respondWithFilteredResult(_0x1bc232,_0x5d9a04){return function(_0x1de30b){if(_0x1de30b){var _0x4a8784=typeof _0x5d9a04['offset']===_0x5067('0x22')&&typeof _0x5d9a04[_0x5067('0x23')]==='undefined';var _0x27fbdc=_0x1de30b[_0x5067('0x24')];var _0x4ba77c=_0x4a8784?0x0:_0x5d9a04[_0x5067('0x25')];var _0xa96a2c=_0x4a8784?_0x1de30b[_0x5067('0x24')]:_0x5d9a04[_0x5067('0x25')]+_0x5d9a04[_0x5067('0x23')];var _0x50b4f4;if(_0xa96a2c>=_0x27fbdc){_0xa96a2c=_0x27fbdc;_0x50b4f4=0xc8;}else{_0x50b4f4=0xce;}_0x1bc232[_0x5067('0x1f')](_0x50b4f4);return _0x1bc232['set'](_0x5067('0x26'),_0x4ba77c+'-'+_0xa96a2c+'/'+_0x27fbdc)[_0x5067('0x21')](_0x1de30b);}return null;};}function patchUpdates(_0x5ccc4a){return function(_0x3f92df){try{jsonpatch[_0x5067('0x27')](_0x3f92df,_0x5ccc4a,!![]);}catch(_0x831109){return BPromise[_0x5067('0x28')](_0x831109);}return _0x3f92df['save']();};}function saveUpdates(_0x4bce81,_0x972954){return function(_0x532cc7){if(_0x532cc7){return _0x532cc7[_0x5067('0x29')](_0x4bce81)[_0x5067('0x2a')](function(_0x24c74a){return _0x24c74a;});}return null;};}function removeEntity(_0x126784,_0x37fdf9){return function(_0x32b409){if(_0x32b409){return _0x32b409[_0x5067('0x2b')]()['then'](function(){var _0x1d2157=_0x32b409[_0x5067('0x2c')]({'plain':!![]});var _0x4f01bf='CustomDashboards';return db['UserProfileResource'][_0x5067('0x2b')]({'where':{'type':_0x4f01bf,'resourceId':_0x1d2157['id']}})[_0x5067('0x2a')](function(){return _0x32b409;});})[_0x5067('0x2a')](function(){_0x126784[_0x5067('0x1f')](0xcc)[_0x5067('0x20')]();});}};}function handleEntityNotFound(_0x509a9b,_0xc64b76){return function(_0x8ab78){if(!_0x8ab78){_0x509a9b['sendStatus'](0x194);}return _0x8ab78;};}function handleError(_0x1e47ed,_0x199a2a){_0x199a2a=_0x199a2a||0x1f4;return function(_0x327ed6){logger[_0x5067('0x2d')](_0x327ed6[_0x5067('0x2e')]);if(_0x327ed6[_0x5067('0x2f')]){delete _0x327ed6[_0x5067('0x2f')];}_0x1e47ed[_0x5067('0x1f')](_0x199a2a)[_0x5067('0x30')](_0x327ed6);};}exports[_0x5067('0x31')]=function(_0x5ed5c5,_0x3c7687){var _0x481d09={},_0x52caf8={},_0x5033ca={'count':0x0,'rows':[]};var _0x39ba4c=_[_0x5067('0x32')](db[_0x5067('0x33')][_0x5067('0x34')],function(_0x4e0b9b){return{'name':_0x4e0b9b[_0x5067('0x35')],'type':_0x4e0b9b[_0x5067('0x36')][_0x5067('0x37')]};});_0x52caf8[_0x5067('0x38')]=_['map'](_0x39ba4c,'name');_0x52caf8['query']=_[_0x5067('0x39')](_0x5ed5c5['query']);_0x52caf8[_0x5067('0x3a')]=_[_0x5067('0x3b')](_0x52caf8[_0x5067('0x38')],_0x52caf8[_0x5067('0x3c')]);_0x481d09[_0x5067('0x3d')]=_[_0x5067('0x3b')](_0x52caf8[_0x5067('0x38')],qs[_0x5067('0x3e')](_0x5ed5c5[_0x5067('0x3c')][_0x5067('0x3e')]));_0x481d09[_0x5067('0x3d')]=_0x481d09[_0x5067('0x3d')][_0x5067('0x3f')]?_0x481d09[_0x5067('0x3d')]:_0x52caf8[_0x5067('0x38')];if(!_0x5ed5c5[_0x5067('0x3c')]['hasOwnProperty'](_0x5067('0x40'))){_0x481d09[_0x5067('0x23')]=qs[_0x5067('0x23')](_0x5ed5c5[_0x5067('0x3c')][_0x5067('0x23')]);_0x481d09[_0x5067('0x25')]=qs['offset'](_0x5ed5c5[_0x5067('0x3c')]['offset']);}_0x481d09[_0x5067('0x41')]=qs['sort'](_0x5ed5c5[_0x5067('0x3c')][_0x5067('0x42')]);_0x481d09['where']=qs[_0x5067('0x3a')](_[_0x5067('0x43')](_0x5ed5c5['query'],_0x52caf8['filters']),_0x39ba4c);if(_0x5ed5c5[_0x5067('0x3c')][_0x5067('0x44')]){_0x481d09[_0x5067('0x45')]=_['merge'](_0x481d09['where'],{'$or':_[_0x5067('0x32')](_0x39ba4c,function(_0x205624){if(_0x205624[_0x5067('0x36')]!=='VIRTUAL'){var _0x322fc7={};_0x322fc7[_0x205624[_0x5067('0x2f')]]={'$like':'%'+_0x5ed5c5['query']['filter']+'%'};return _0x322fc7;}})});}_0x481d09=_[_0x5067('0x46')]({},_0x481d09,_0x5ed5c5['options']);var _0x2b2aad={'where':_0x481d09[_0x5067('0x45')]};return db[_0x5067('0x33')][_0x5067('0x24')](_0x2b2aad)[_0x5067('0x2a')](function(_0x4e771c){_0x5033ca[_0x5067('0x24')]=_0x4e771c;if(_0x5ed5c5[_0x5067('0x3c')][_0x5067('0x47')]){_0x481d09[_0x5067('0x48')]=[{'all':!![]}];}return db['Dashboard']['findAll'](_0x481d09);})[_0x5067('0x2a')](function(_0x2905d0){_0x5033ca['rows']=_0x2905d0;return _0x5033ca;})[_0x5067('0x2a')](respondWithFilteredResult(_0x3c7687,_0x481d09))[_0x5067('0x49')](handleError(_0x3c7687,null));};exports[_0x5067('0x4a')]=function(_0x5e3461,_0x16401d){var _0x1cc1c3={'raw':![],'where':{'id':_0x5e3461['params']['id']}},_0x3c342e={};_0x3c342e[_0x5067('0x38')]=_[_0x5067('0x39')](db[_0x5067('0x33')]['rawAttributes']);_0x3c342e[_0x5067('0x3c')]=_[_0x5067('0x39')](_0x5e3461[_0x5067('0x3c')]);_0x3c342e[_0x5067('0x3a')]=_['intersection'](_0x3c342e[_0x5067('0x38')],_0x3c342e[_0x5067('0x3c')]);_0x1cc1c3[_0x5067('0x3d')]=_[_0x5067('0x3b')](_0x3c342e[_0x5067('0x38')],qs['fields'](_0x5e3461['query'][_0x5067('0x3e')]));_0x1cc1c3[_0x5067('0x3d')]=_0x1cc1c3[_0x5067('0x3d')][_0x5067('0x3f')]?_0x1cc1c3[_0x5067('0x3d')]:_0x3c342e[_0x5067('0x38')];if(_0x5e3461[_0x5067('0x3c')][_0x5067('0x47')]){_0x1cc1c3[_0x5067('0x48')]=[{'all':!![]}];}_0x1cc1c3=_['merge']({},_0x1cc1c3,_0x5e3461['options']);return db['Dashboard'][_0x5067('0x4b')](_0x1cc1c3)[_0x5067('0x2a')](handleEntityNotFound(_0x16401d,null))[_0x5067('0x2a')](respondWithResult(_0x16401d,null))[_0x5067('0x49')](handleError(_0x16401d,null));};exports[_0x5067('0x4c')]=function(_0x7f2374,_0x58ff7b){return db[_0x5067('0x33')][_0x5067('0x4c')](_0x7f2374['body'],{})[_0x5067('0x2a')](function(_0x2203b4){var _0x1bde1e=_0x7f2374[_0x5067('0x4d')][_0x5067('0x2c')]({'plain':!![]});if(!_0x1bde1e)throw new Error(_0x5067('0x4e'));if(_0x1bde1e[_0x5067('0x4f')]===_0x5067('0x4d')){var _0x37cd90=_0x2203b4[_0x5067('0x2c')]({'plain':!![]});var _0x44c712=_0x5067('0x50');return db['UserProfileSection'][_0x5067('0x4b')]({'where':{'name':_0x44c712,'userProfileId':_0x1bde1e[_0x5067('0x51')]},'raw':!![]})[_0x5067('0x2a')](function(_0x361b04){if(_0x361b04&&_0x361b04[_0x5067('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x37cd90[_0x5067('0x2f')],'resourceId':_0x37cd90['id'],'type':_0x361b04[_0x5067('0x2f')],'sectionId':_0x361b04['id']},{})[_0x5067('0x2a')](function(){return _0x2203b4;});}else{return _0x2203b4;}})['catch'](function(_0x351d81){logger['error'](_0x5067('0x53'),_0x351d81);throw _0x351d81;});}return _0x2203b4;})[_0x5067('0x2a')](respondWithResult(_0x58ff7b,0xc9))[_0x5067('0x49')](handleError(_0x58ff7b,null));};exports['clone']=function(_0x3b52ce,_0x10c7b5){var _0x555493={'where':{'id':_0x3b52ce[_0x5067('0x54')]['id']}},_0x2adc08={};_0x2adc08[_0x5067('0x38')]=_['keys'](db[_0x5067('0x33')][_0x5067('0x34')]);_0x555493[_0x5067('0x3d')]=_['intersection'](_0x2adc08[_0x5067('0x38')],qs[_0x5067('0x3e')](_0x3b52ce[_0x5067('0x3c')][_0x5067('0x3e')]));_0x555493[_0x5067('0x3d')]=_0x555493['attributes']['length']?_0x555493['attributes']:_0x2adc08[_0x5067('0x38')];if(_0x3b52ce[_0x5067('0x3c')]['includeAll']){_0x555493[_0x5067('0x48')]=[{'all':!![]}];}_0x555493=_[_0x5067('0x46')]({},_0x555493,_0x3b52ce['options']);return db['Dashboard']['find'](_0x555493)['then'](handleEntityNotFound(_0x10c7b5,null))[_0x5067('0x2a')](function(_0x428425){if(_0x428425){var _0x417f55=_0x428425[_0x5067('0x2c')]({'plain':!![]});_0x417f55=qs[_0x5067('0x55')](_0x417f55,['id',_0x5067('0x56'),'updatedAt']);_0x3b52ce[_0x5067('0x57')]=_[_0x5067('0x55')](_0x3b52ce[_0x5067('0x57')],['id',_0x5067('0x56'),_0x5067('0x58')]);return db[_0x5067('0x33')][_0x5067('0x4c')](_[_0x5067('0x46')](_0x417f55,_0x3b52ce[_0x5067('0x57')]),{'include':_0x3b52ce['query'][_0x5067('0x47')]?[{'all':!![]}]:undefined})[_0x5067('0x2a')](function(_0x67f443){var _0x327b65=_0x3b52ce[_0x5067('0x4d')][_0x5067('0x2c')]({'plain':!![]});if(!_0x327b65)throw new Error(_0x5067('0x4e'));if(_0x327b65[_0x5067('0x4f')]===_0x5067('0x4d')){var _0x38a74c=_0x67f443['get']({'plain':!![]});var _0x1ebacd=_0x5067('0x50');return db[_0x5067('0x59')]['find']({'where':{'name':_0x1ebacd,'userProfileId':_0x327b65[_0x5067('0x51')]},'raw':!![]})[_0x5067('0x2a')](function(_0x3f276f){if(_0x3f276f&&_0x3f276f['autoAssociation']===0x0){return db['UserProfileResource'][_0x5067('0x4c')]({'name':_0x38a74c[_0x5067('0x2f')],'resourceId':_0x38a74c['id'],'type':_0x3f276f[_0x5067('0x2f')],'sectionId':_0x3f276f['id']},{})[_0x5067('0x2a')](function(){return _0x67f443;});}else{return _0x67f443;}})[_0x5067('0x49')](function(_0xab11f9){logger['error'](_0x5067('0x53'),_0xab11f9);throw _0xab11f9;});}return _0x67f443;});}})[_0x5067('0x2a')](respondWithResult(_0x10c7b5,0xc9))[_0x5067('0x49')](handleError(_0x10c7b5,null));};exports[_0x5067('0x29')]=function(_0x362577,_0x261a93){if(_0x362577['body']['id']){delete _0x362577[_0x5067('0x57')]['id'];}return db[_0x5067('0x33')][_0x5067('0x4b')]({'where':{'id':_0x362577[_0x5067('0x54')]['id']}})[_0x5067('0x2a')](handleEntityNotFound(_0x261a93,null))[_0x5067('0x2a')](saveUpdates(_0x362577[_0x5067('0x57')],null))[_0x5067('0x2a')](respondWithResult(_0x261a93,null))[_0x5067('0x49')](handleError(_0x261a93,null));};exports[_0x5067('0x2b')]=function(_0x3b9101,_0x4fc876){return db[_0x5067('0x33')][_0x5067('0x4b')]({'where':{'id':_0x3b9101[_0x5067('0x54')]['id']}})[_0x5067('0x2a')](handleEntityNotFound(_0x4fc876,null))['then'](removeEntity(_0x4fc876,null))['catch'](handleError(_0x4fc876,null));};function widgetAttributes(_0x25a290){try{switch(_0x25a290[_0x5067('0x36')]){case'iframe':return[{'name':_0x5067('0x5a'),'value':_0x25a290[_0x5067('0x5a')]||(_0x25a290[_0x5067('0x5b')]&&_0x25a290[_0x5067('0x5b')][0x0]?_0x25a290['attrs'][0x0][_0x5067('0x5c')]:undefined)||_0x5067('0x5d')}];case _0x5067('0x5e'):return[{'name':_0x5067('0x5f'),'value':_0x25a290[_0x5067('0x5f')]||(_0x25a290[_0x5067('0x5b')]&&_0x25a290['attrs'][0x0]?_0x25a290[_0x5067('0x5b')][0x0][_0x5067('0x5c')]:undefined)||''}];case _0x5067('0x60'):return[{'name':_0x5067('0x61'),'value':_0x25a290[_0x5067('0x61')]||(_0x25a290[_0x5067('0x5b')]&&_0x25a290[_0x5067('0x5b')][0x0]?_0x25a290[_0x5067('0x5b')][0x0][_0x5067('0x5c')]:undefined)||_0x5067('0x62')},{'name':'attrTimezone','value':_0x25a290[_0x5067('0x63')]||(_0x25a290[_0x5067('0x5b')]&&_0x25a290['attrs'][0x1]?_0x25a290[_0x5067('0x5b')][0x1]['value']:undefined)||'0.00'},{'name':_0x5067('0x64'),'value':_0x25a290[_0x5067('0x64')]||(_0x25a290['attrs']&&_0x25a290[_0x5067('0x5b')][0x2]?_0x25a290[_0x5067('0x5b')][0x2][_0x5067('0x5c')]:undefined)||0xc}];case _0x5067('0x65'):return[{'name':'attrMetric','value':_0x25a290[_0x5067('0x66')]||(_0x25a290['attrs']&&_0x25a290[_0x5067('0x5b')][0x0]?_0x25a290[_0x5067('0x5b')][0x0][_0x5067('0x5c')]:undefined)||_0x5067('0x67')},{'name':_0x5067('0x68'),'value':_0x25a290[_0x5067('0x68')]||(_0x25a290['attrs']&&_0x25a290['attrs'][0x1]?_0x25a290[_0x5067('0x5b')][0x1][_0x5067('0x5c')]:undefined)||[]},{'name':'attrFontSize','value':_0x25a290[_0x5067('0x64')]||(_0x25a290[_0x5067('0x5b')]&&_0x25a290[_0x5067('0x5b')][0x2]?_0x25a290['attrs'][0x2][_0x5067('0x5c')]:undefined)||0x14},{'name':_0x5067('0x69'),'value':_0x25a290['attrChannel']||(_0x25a290[_0x5067('0x5b')]&&_0x25a290['attrs'][0x3]?_0x25a290[_0x5067('0x5b')][0x3][_0x5067('0x5c')]:undefined)||'voice'},{'name':_0x5067('0x6a'),'value':_0x25a290[_0x5067('0x6a')]||(_0x25a290[_0x5067('0x5b')]&&_0x25a290[_0x5067('0x5b')][0x4]?_0x25a290[_0x5067('0x5b')][0x4]['value']:undefined)||''},{'name':_0x5067('0x6b'),'value':_0x25a290['attrFaxAccounts']||(_0x25a290['attrs']&&_0x25a290[_0x5067('0x5b')][0x5]?_0x25a290[_0x5067('0x5b')][0x5][_0x5067('0x5c')]:undefined)||''},{'name':_0x5067('0x6c'),'value':_0x25a290[_0x5067('0x6c')]||(_0x25a290[_0x5067('0x5b')]&&_0x25a290[_0x5067('0x5b')][0x6]?_0x25a290[_0x5067('0x5b')][0x6][_0x5067('0x5c')]:undefined)||''},{'name':_0x5067('0x6d'),'value':_0x25a290[_0x5067('0x6d')]||(_0x25a290[_0x5067('0x5b')]&&_0x25a290[_0x5067('0x5b')][0x7]?_0x25a290['attrs'][0x7][_0x5067('0x5c')]:undefined)||''},{'name':_0x5067('0x6e'),'value':_0x25a290[_0x5067('0x6e')]||(_0x25a290[_0x5067('0x5b')]&&_0x25a290['attrs'][0x8]?_0x25a290[_0x5067('0x5b')][0x8]['value']:undefined)||''},{'name':_0x5067('0x6f'),'value':_0x25a290['attrChatWebsites']||(_0x25a290[_0x5067('0x5b')]&&_0x25a290[_0x5067('0x5b')][0x9]?_0x25a290[_0x5067('0x5b')][0x9][_0x5067('0x5c')]:undefined)||''}];case _0x5067('0x70'):case _0x5067('0x71'):return[{'name':'attrSerie1','value':_0x25a290[_0x5067('0x72')]||(_0x25a290['attrs']&&_0x25a290[_0x5067('0x5b')][0x0]?_0x25a290[_0x5067('0x5b')][0x0]['value']:undefined)||'total'},{'name':_0x5067('0x73'),'value':_0x25a290[_0x5067('0x73')]||(_0x25a290[_0x5067('0x5b')]&&_0x25a290[_0x5067('0x5b')][0x1]?_0x25a290['attrs'][0x1][_0x5067('0x5c')]:undefined)||null},{'name':'attrSerie3','value':_0x25a290[_0x5067('0x74')]||(_0x25a290['attrs']&&_0x25a290[_0x5067('0x5b')][0x2]?_0x25a290[_0x5067('0x5b')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x25a290[_0x5067('0x68')]||(_0x25a290[_0x5067('0x5b')]&&_0x25a290[_0x5067('0x5b')][0x3]?_0x25a290[_0x5067('0x5b')][0x3][_0x5067('0x5c')]:undefined)||[]},{'name':'attrChannel','value':_0x25a290[_0x5067('0x69')]||(_0x25a290[_0x5067('0x5b')]&&_0x25a290['attrs'][0x4]?_0x25a290['attrs'][0x4]['value']:undefined)||_0x5067('0x75')},{'name':_0x5067('0x6a'),'value':_0x25a290['attrEmailAccounts']||(_0x25a290[_0x5067('0x5b')]&&_0x25a290[_0x5067('0x5b')][0x5]?_0x25a290[_0x5067('0x5b')][0x5][_0x5067('0x5c')]:undefined)||''},{'name':_0x5067('0x6b'),'value':_0x25a290[_0x5067('0x6b')]||(_0x25a290[_0x5067('0x5b')]&&_0x25a290[_0x5067('0x5b')][0x6]?_0x25a290[_0x5067('0x5b')][0x6]['value']:undefined)||''},{'name':'attrSmsAccounts','value':_0x25a290['attrSmsAccounts']||(_0x25a290['attrs']&&_0x25a290[_0x5067('0x5b')][0x7]?_0x25a290[_0x5067('0x5b')][0x7][_0x5067('0x5c')]:undefined)||''},{'name':_0x5067('0x6d'),'value':_0x25a290[_0x5067('0x6d')]||(_0x25a290[_0x5067('0x5b')]&&_0x25a290[_0x5067('0x5b')][0x8]?_0x25a290[_0x5067('0x5b')][0x8][_0x5067('0x5c')]:undefined)||''},{'name':_0x5067('0x6e'),'value':_0x25a290[_0x5067('0x6e')]||(_0x25a290[_0x5067('0x5b')]&&_0x25a290[_0x5067('0x5b')][0x9]?_0x25a290[_0x5067('0x5b')][0x9][_0x5067('0x5c')]:undefined)||''},{'name':_0x5067('0x6f'),'value':_0x25a290[_0x5067('0x6f')]||(_0x25a290[_0x5067('0x5b')]&&_0x25a290[_0x5067('0x5b')][0xa]?_0x25a290[_0x5067('0x5b')][0xa][_0x5067('0x5c')]:undefined)||''}];case _0x5067('0x76'):return[{'name':'attrReport','type':_0x25a290[_0x5067('0x77')]||(_0x25a290['attrs']&&_0x25a290[_0x5067('0x5b')][0x0]?_0x25a290[_0x5067('0x5b')][0x0][_0x5067('0x36')]:undefined)||null,'value':_0x25a290[_0x5067('0x78')]||(_0x25a290['attrs']&&_0x25a290[_0x5067('0x5b')][0x0]?_0x25a290['attrs'][0x0][_0x5067('0x5c')]:undefined)||null},{'name':_0x5067('0x79'),'value':_0x25a290[_0x5067('0x79')]||(_0x25a290[_0x5067('0x5b')]&&_0x25a290['attrs'][0x1]?_0x25a290[_0x5067('0x5b')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x55c6ab){logger[_0x5067('0x2d')](_0x5067('0x7a'),JSON[_0x5067('0x7b')](_0x55c6ab));return[];}}exports['addItem']=function(_0x536991,_0x41339f,_0x3cf13a){if(_0x536991['body']['id']){delete _0x536991[_0x5067('0x57')]['id'];}return db[_0x5067('0x33')][_0x5067('0x4b')]({'where':{'id':_0x536991[_0x5067('0x54')]['id']}})['then'](handleEntityNotFound(_0x41339f,null))[_0x5067('0x2a')](function(_0x40a460){if(_0x40a460){_0x536991[_0x5067('0x57')][_0x5067('0x7c')]=_0x40a460['id'];_0x536991[_0x5067('0x57')][_0x5067('0x5b')]=widgetAttributes(_0x536991[_0x5067('0x57')]);return db[_0x5067('0x7d')][_0x5067('0x4c')](_0x536991[_0x5067('0x57')]);}})[_0x5067('0x2a')](respondWithResult(_0x41339f,null))[_0x5067('0x49')](handleError(_0x41339f,null));};exports['getItems']=function(_0xea9049,_0x1d6bbf,_0xf22f6b){var _0x308b3e={};var _0xf325de={};var _0x388552;var _0x397ed6;return db[_0x5067('0x33')]['findOne']({'where':{'id':_0xea9049[_0x5067('0x54')]['id']}})[_0x5067('0x2a')](handleEntityNotFound(_0x1d6bbf,null))[_0x5067('0x2a')](function(_0x4ba653){if(_0x4ba653){_0x388552=_0x4ba653;_0xf325de['model']=_[_0x5067('0x39')](db[_0x5067('0x7d')]['rawAttributes']);_0xf325de[_0x5067('0x3c')]=_[_0x5067('0x39')](_0xea9049[_0x5067('0x3c')]);_0xf325de[_0x5067('0x3a')]=_[_0x5067('0x3b')](_0xf325de[_0x5067('0x38')],_0xf325de['query']);_0x308b3e[_0x5067('0x3d')]=_[_0x5067('0x3b')](_0xf325de['model'],qs['fields'](_0xea9049[_0x5067('0x3c')][_0x5067('0x3e')]));_0x308b3e[_0x5067('0x3d')]=_0x308b3e['attributes'][_0x5067('0x3f')]?_0x308b3e[_0x5067('0x3d')]:_0xf325de[_0x5067('0x38')];_0x308b3e[_0x5067('0x41')]=qs[_0x5067('0x42')](_0xea9049[_0x5067('0x3c')][_0x5067('0x42')]);_0x308b3e[_0x5067('0x45')]=qs['filters'](_[_0x5067('0x43')](_0xea9049[_0x5067('0x3c')],_0xf325de[_0x5067('0x3a')]));if(_0xea9049[_0x5067('0x3c')][_0x5067('0x44')]){_0x308b3e['where']=_['merge'](_0x308b3e['where'],{'$or':_[_0x5067('0x32')](_0x308b3e['attributes'],function(_0x5a61bf){var _0xaf4cd2={};_0xaf4cd2[_0x5a61bf]={'$like':'%'+_0xea9049[_0x5067('0x3c')]['filter']+'%'};return _0xaf4cd2;})});}_0x308b3e=_[_0x5067('0x46')]({},_0x308b3e,_0xea9049[_0x5067('0x7e')]);return _0x388552[_0x5067('0x7f')](_0x308b3e);}})[_0x5067('0x2a')](function(_0x5c0b67){if(_0x5c0b67){_0x397ed6=_0x5c0b67[_0x5067('0x3f')];if(!_0xea9049[_0x5067('0x3c')][_0x5067('0x80')]('nolimit')){_0x308b3e[_0x5067('0x23')]=qs['limit'](_0xea9049[_0x5067('0x3c')][_0x5067('0x23')]);_0x308b3e['offset']=qs['offset'](_0xea9049[_0x5067('0x3c')][_0x5067('0x25')]);}return _0x388552[_0x5067('0x7f')](_0x308b3e);}})['then'](function(_0x21099e){if(_0x21099e){return _0x21099e?{'count':_0x397ed6,'rows':_0x21099e}:null;}})['then'](respondWithResult(_0x1d6bbf,null))[_0x5067('0x49')](handleError(_0x1d6bbf,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index f7da2e6..35609ba 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 _0x0a01=['hasOwnProperty','exports','setMaxListeners','remove','emit'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0a01,0x10b));var _0x10a0=function(_0x3a9acd,_0x77ca4c){_0x3a9acd=_0x3a9acd-0x0;var _0x4c8cdb=_0x0a01[_0x3a9acd];return _0x4c8cdb;};'use strict';var EventEmitter=require('events');var Dashboard=require('../../mysqldb')['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x10a0('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x10a0('0x1')};function emitEvent(_0x4c9f4a){return function(_0x32a034,_0x3fc5fa,_0x290eb9){DashboardEvents[_0x10a0('0x2')](_0x4c9f4a+':'+_0x32a034['id'],_0x32a034);DashboardEvents[_0x10a0('0x2')](_0x4c9f4a,_0x32a034);_0x290eb9(null);};}for(var e in events){if(events[_0x10a0('0x3')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x10a0('0x4')]=DashboardEvents; \ No newline at end of file +var _0x9901=['setMaxListeners','save','update','remove','emit','hook','exports','../../mysqldb'];(function(_0x446186,_0x116e31){var _0x63b564=function(_0x590a14){while(--_0x590a14){_0x446186['push'](_0x446186['shift']());}};_0x63b564(++_0x116e31);}(_0x9901,0x1bf));var _0x1990=function(_0x54613d,_0x4b8872){_0x54613d=_0x54613d-0x0;var _0x11c35b=_0x9901[_0x54613d];return _0x11c35b;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x1990('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0x1990('0x1')](0x0);var events={'afterCreate':_0x1990('0x2'),'afterUpdate':_0x1990('0x3'),'afterDestroy':_0x1990('0x4')};function emitEvent(_0x583b77){return function(_0x3b76f0,_0x53a506,_0x5dfe3f){DashboardEvents[_0x1990('0x5')](_0x583b77+':'+_0x3b76f0['id'],_0x3b76f0);DashboardEvents['emit'](_0x583b77,_0x3b76f0);_0x5dfe3f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0x1990('0x6')](e,emitEvent(event));}}module[_0x1990('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 4001c80..fddb801 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 _0x066f=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','Dashboard','dashboards','lodash','util','../../config/logger'];(function(_0x523710,_0x5c0909){var _0x3e4973=function(_0x450592){while(--_0x450592){_0x523710['push'](_0x523710['shift']());}};_0x3e4973(++_0x5c0909);}(_0x066f,0x101));var _0xf066=function(_0xe6db94,_0x342d69){_0xe6db94=_0xe6db94-0x0;var _0x31abe3=_0x066f[_0xe6db94];return _0x31abe3;};'use strict';var _=require(_0xf066('0x0'));var util=require(_0xf066('0x1'));var logger=require(_0xf066('0x2'))(_0xf066('0x3'));var moment=require(_0xf066('0x4'));var BPromise=require(_0xf066('0x5'));var rp=require(_0xf066('0x6'));var fs=require('fs');var path=require(_0xf066('0x7'));var rimraf=require('rimraf');var config=require(_0xf066('0x8'));var attributes=require('./dashboard.attributes');module[_0xf066('0x9')]=function(_0x45e244,_0xc3ac86){return _0x45e244[_0xf066('0xa')](_0xf066('0xb'),attributes,{'tableName':_0xf066('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc27f=['rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x457796,_0x34ca8d){var _0x1edad3=function(_0x33ba8a){while(--_0x33ba8a){_0x457796['push'](_0x457796['shift']());}};_0x1edad3(++_0x34ca8d);}(_0xc27f,0x85));var _0xfc27=function(_0x176a4d,_0x5770af){_0x176a4d=_0x176a4d-0x0;var _0x411f3b=_0xc27f[_0x176a4d];return _0x411f3b;};'use strict';var _=require(_0xfc27('0x0'));var util=require(_0xfc27('0x1'));var logger=require(_0xfc27('0x2'))('api');var moment=require(_0xfc27('0x3'));var BPromise=require(_0xfc27('0x4'));var rp=require(_0xfc27('0x5'));var fs=require('fs');var path=require(_0xfc27('0x6'));var rimraf=require(_0xfc27('0x7'));var config=require(_0xfc27('0x8'));var attributes=require(_0xfc27('0x9'));module[_0xfc27('0xa')]=function(_0x14c86a,_0x15c405){return _0x14c86a[_0xfc27('0xb')](_0xfc27('0xc'),attributes,{'tableName':_0xfc27('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 313ce12..145c9ae 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 _0x2224=['register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x1f07fa,_0x5e2e6c){var _0x48db19=function(_0x3c02ac){while(--_0x3c02ac){_0x1f07fa['push'](_0x1f07fa['shift']());}};_0x48db19(++_0x5e2e6c);}(_0x2224,0x85));var _0x4222=function(_0x1ec8f9,_0x22f5e7){_0x1ec8f9=_0x1ec8f9-0x0;var _0x17cd3d=_0x2224[_0x1ec8f9];return _0x17cd3d;};'use strict';var _=require(_0x4222('0x0'));var util=require(_0x4222('0x1'));var moment=require(_0x4222('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4222('0x3'))(_0x4222('0x4'));var config=require(_0x4222('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x4222('0x6')]['http']({'port':0x232a});config[_0x4222('0x7')]=_[_0x4222('0x8')](config[_0x4222('0x7')],{'host':_0x4222('0x9'),'port':0x18eb});var socket=require(_0x4222('0xa'))(new Redis(config[_0x4222('0x7')]));require('./dashboard.socket')[_0x4222('0xb')](socket);function respondWithRpcPromise(_0x472660,_0x16eb2d,_0x586f21){return new BPromise(function(_0x313181,_0x323356){return client[_0x4222('0xc')](_0x472660,_0x586f21)[_0x4222('0xd')](function(_0x7fceb7){logger[_0x4222('0xe')](_0x4222('0xf'),_0x16eb2d,_0x4222('0x10'));logger[_0x4222('0x11')](_0x4222('0x12'),_0x16eb2d,'request\x20sent',JSON[_0x4222('0x13')](_0x7fceb7));if(_0x7fceb7[_0x4222('0x14')]){if(_0x7fceb7[_0x4222('0x14')][_0x4222('0x15')]===0x1f4){logger[_0x4222('0x14')](_0x4222('0xf'),_0x16eb2d,_0x7fceb7[_0x4222('0x14')]['message']);return _0x323356(_0x7fceb7[_0x4222('0x14')][_0x4222('0x16')]);}logger[_0x4222('0x14')](_0x4222('0xf'),_0x16eb2d,_0x7fceb7[_0x4222('0x14')][_0x4222('0x16')]);return _0x313181(_0x7fceb7['error']['message']);}else{logger[_0x4222('0xe')]('Dashboard,\x20%s,\x20%s',_0x16eb2d,'request\x20sent');_0x313181(_0x7fceb7['result'][_0x4222('0x16')]);}})[_0x4222('0x17')](function(_0x429c6d){logger[_0x4222('0x14')](_0x4222('0xf'),_0x16eb2d,_0x429c6d);_0x323356(_0x429c6d);});});} \ No newline at end of file +var _0xd6e8=['request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','Dashboard,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','request','then','info'];(function(_0xe257ee,_0x353e81){var _0x53b734=function(_0x16686e){while(--_0x16686e){_0xe257ee['push'](_0xe257ee['shift']());}};_0x53b734(++_0x353e81);}(_0xd6e8,0x166));var _0x8d6e=function(_0x720e20,_0x1a827){_0x720e20=_0x720e20-0x0;var _0xfef46e=_0xd6e8[_0x720e20];return _0xfef46e;};'use strict';var _=require(_0x8d6e('0x0'));var util=require(_0x8d6e('0x1'));var moment=require(_0x8d6e('0x2'));var BPromise=require(_0x8d6e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8d6e('0x4'));var db=require(_0x8d6e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8d6e('0x6'))(_0x8d6e('0x7'));var config=require(_0x8d6e('0x8'));var jayson=require(_0x8d6e('0x9'));var client=jayson[_0x8d6e('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x8d6e('0xb')],{'host':_0x8d6e('0xc'),'port':0x18eb});var socket=require(_0x8d6e('0xd'))(new Redis(config[_0x8d6e('0xb')]));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x42d7b8,_0xdce52d,_0x1fa5ce){return new BPromise(function(_0x46e011,_0xfef7a1){return client[_0x8d6e('0xe')](_0x42d7b8,_0x1fa5ce)[_0x8d6e('0xf')](function(_0x5e47e1){logger[_0x8d6e('0x10')]('Dashboard,\x20%s,\x20%s',_0xdce52d,_0x8d6e('0x11'));logger[_0x8d6e('0x12')](_0x8d6e('0x13'),_0xdce52d,_0x8d6e('0x11'),JSON['stringify'](_0x5e47e1));if(_0x5e47e1[_0x8d6e('0x14')]){if(_0x5e47e1[_0x8d6e('0x14')][_0x8d6e('0x15')]===0x1f4){logger[_0x8d6e('0x14')]('Dashboard,\x20%s,\x20%s',_0xdce52d,_0x5e47e1['error']['message']);return _0xfef7a1(_0x5e47e1[_0x8d6e('0x14')][_0x8d6e('0x16')]);}logger['error'](_0x8d6e('0x17'),_0xdce52d,_0x5e47e1[_0x8d6e('0x14')][_0x8d6e('0x16')]);return _0x46e011(_0x5e47e1[_0x8d6e('0x14')][_0x8d6e('0x16')]);}else{logger[_0x8d6e('0x10')]('Dashboard,\x20%s,\x20%s',_0xdce52d,'request\x20sent');_0x46e011(_0x5e47e1['result']['message']);}})[_0x8d6e('0x18')](function(_0x174200){logger[_0x8d6e('0x14')](_0x8d6e('0x17'),_0xdce52d,_0x174200);_0xfef7a1(_0x174200);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 6228f2e..ff6ae4e 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 _0x2da5=['dashboard:','./dashboard.events','save','remove','update','emit','removeListener','length'];(function(_0x4ee0a8,_0x1e7570){var _0x2ac1e9=function(_0x1be960){while(--_0x1be960){_0x4ee0a8['push'](_0x4ee0a8['shift']());}};_0x2ac1e9(++_0x1e7570);}(_0x2da5,0x71));var _0x52da=function(_0x5eecac,_0x2dcae9){_0x5eecac=_0x5eecac-0x0;var _0x3dea33=_0x2da5[_0x5eecac];return _0x3dea33;};'use strict';var DashboardEvents=require(_0x52da('0x0'));var events=[_0x52da('0x1'),_0x52da('0x2'),_0x52da('0x3')];function createListener(_0x1982ce,_0x5b9f3b){return function(_0xe54e6a){_0x5b9f3b[_0x52da('0x4')](_0x1982ce,_0xe54e6a);};}function removeListener(_0x127e92,_0x4551e7){return function(){DashboardEvents[_0x52da('0x5')](_0x127e92,_0x4551e7);};}exports['register']=function(_0x14c23c){for(var _0x113e54=0x0,_0x3e184e=events[_0x52da('0x6')];_0x113e54<_0x3e184e;_0x113e54++){var _0x585b74=events[_0x113e54];var _0x2bfe40=createListener(_0x52da('0x7')+_0x585b74,_0x14c23c);DashboardEvents['on'](_0x585b74,_0x2bfe40);}}; \ No newline at end of file +var _0xb2da=['dashboard:','./dashboard.events','save','remove','update','emit','removeListener'];(function(_0x5071a6,_0x5e183c){var _0xddda8b=function(_0x4be059){while(--_0x4be059){_0x5071a6['push'](_0x5071a6['shift']());}};_0xddda8b(++_0x5e183c);}(_0xb2da,0xe1));var _0xab2d=function(_0x39707b,_0x2caf4d){_0x39707b=_0x39707b-0x0;var _0xd9864b=_0xb2da[_0x39707b];return _0xd9864b;};'use strict';var DashboardEvents=require(_0xab2d('0x0'));var events=[_0xab2d('0x1'),_0xab2d('0x2'),_0xab2d('0x3')];function createListener(_0x555bcf,_0x1f9d9f){return function(_0xa6b230){_0x1f9d9f[_0xab2d('0x4')](_0x555bcf,_0xa6b230);};}function removeListener(_0x204044,_0x49f080){return function(){DashboardEvents[_0xab2d('0x5')](_0x204044,_0x49f080);};}exports['register']=function(_0x3da2fb){for(var _0x32f89a=0x0,_0x5b7808=events['length'];_0x32f89a<_0x5b7808;_0x32f89a++){var _0x555b8b=events[_0x32f89a];var _0x3fd57e=createListener(_0xab2d('0x6')+_0x555b8b,_0x3da2fb);DashboardEvents['on'](_0x555b8b,_0x3fd57e);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 61a44fb..a4c4466 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 _0x82de=['Router','fs-extra','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated','/:id','show','/:id/items','create','/:id/clone','post','addItem','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x82de,0x19d));var _0xe82d=function(_0x4a5fa5,_0x51dadc){_0x4a5fa5=_0x4a5fa5-0x0;var _0x241266=_0x82de[_0x4a5fa5];return _0x241266;};'use strict';var multer=require(_0xe82d('0x0'));var util=require(_0xe82d('0x1'));var path=require(_0xe82d('0x2'));var timeout=require(_0xe82d('0x3'));var express=require(_0xe82d('0x4'));var router=express[_0xe82d('0x5')]();var fs_extra=require(_0xe82d('0x6'));var auth=require(_0xe82d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe82d('0x8'));var controller=require(_0xe82d('0x9'));router[_0xe82d('0xa')]('/',auth[_0xe82d('0xb')](),controller['index']);router[_0xe82d('0xa')](_0xe82d('0xc'),auth[_0xe82d('0xb')](),controller[_0xe82d('0xd')]);router[_0xe82d('0xa')](_0xe82d('0xe'),auth[_0xe82d('0xb')](),controller['getItems']);router['post']('/',auth['isAuthenticated'](),controller[_0xe82d('0xf')]);router['post'](_0xe82d('0x10'),auth[_0xe82d('0xb')](),controller['clone']);router[_0xe82d('0x11')](_0xe82d('0xe'),auth[_0xe82d('0xb')](),controller[_0xe82d('0x12')]);router['put'](_0xe82d('0xc'),auth[_0xe82d('0xb')](),controller[_0xe82d('0x13')]);router['delete'](_0xe82d('0xc'),auth[_0xe82d('0xb')](),controller[_0xe82d('0x14')]);module[_0xe82d('0x15')]=router; \ No newline at end of file +var _0x316c=['/:id/items','getItems','post','create','/:id/clone','clone','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x316c,0x155));var _0xc316=function(_0x4a6e52,_0x1d0089){_0x4a6e52=_0x4a6e52-0x0;var _0x49dc4b=_0x316c[_0x4a6e52];return _0x49dc4b;};'use strict';var multer=require(_0xc316('0x0'));var util=require(_0xc316('0x1'));var path=require(_0xc316('0x2'));var timeout=require(_0xc316('0x3'));var express=require(_0xc316('0x4'));var router=express[_0xc316('0x5')]();var fs_extra=require(_0xc316('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xc316('0x7'));var config=require(_0xc316('0x8'));var controller=require('./dashboard.controller');router['get']('/',auth[_0xc316('0x9')](),controller['index']);router[_0xc316('0xa')]('/:id',auth[_0xc316('0x9')](),controller['show']);router[_0xc316('0xa')](_0xc316('0xb'),auth['isAuthenticated'](),controller[_0xc316('0xc')]);router[_0xc316('0xd')]('/',auth[_0xc316('0x9')](),controller[_0xc316('0xe')]);router['post'](_0xc316('0xf'),auth['isAuthenticated'](),controller[_0xc316('0x10')]);router[_0xc316('0xd')](_0xc316('0xb'),auth[_0xc316('0x9')](),controller['addItem']);router[_0xc316('0x11')](_0xc316('0x12'),auth['isAuthenticated'](),controller[_0xc316('0x13')]);router[_0xc316('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xc316('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index fff6074..606063c 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 _0xb4c7=['TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x384706,_0xd1665b){_0x384706=_0x384706-0x0;var _0x2b67f4=_0xb4c7[_0x384706];return _0x2b67f4;};'use strict';var Sequelize=require(_0x7b4c('0x0'));var squel=require(_0x7b4c('0x1'));var _=require(_0x7b4c('0x2'));module[_0x7b4c('0x3')]={'title':{'type':Sequelize[_0x7b4c('0x4')],'allowNull':![]},'type':{'type':Sequelize['STRING'](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x7b4c('0x5')](_0x7b4c('0x6')),'get':function(){try{return JSON[_0x7b4c('0x7')](this[_0x7b4c('0x8')](_0x7b4c('0x9')));}catch(_0x5adec9){return[];}},'set':function(_0x1b0f57){try{this[_0x7b4c('0xa')](_0x7b4c('0x9'),JSON['stringify'](_0x1b0f57));}catch(_0x2d7b7e){this[_0x7b4c('0xa')]('attrs',JSON[_0x7b4c('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0x7b4c('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x7b4c('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x7b4c('0xc')]},'col':{'type':Sequelize[_0x7b4c('0xc')]},'background':{'type':Sequelize[_0x7b4c('0x4')],'allowNull':![],'defaultValue':_0x7b4c('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x7b4c('0x4')],'allowNull':![],'defaultValue':_0x7b4c('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x7b4c('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0xdbf5=['squel','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify','INTEGER','#ffffff'];(function(_0x186547,_0xad5ab4){var _0xb9e99=function(_0x29404c){while(--_0x29404c){_0x186547['push'](_0x186547['shift']());}};_0xb9e99(++_0xad5ab4);}(_0xdbf5,0x18c));var _0x5dbf=function(_0xec2f4e,_0x153d52){_0xec2f4e=_0xec2f4e-0x0;var _0x1ea6db=_0xdbf5[_0xec2f4e];return _0x1ea6db;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x5dbf('0x0'));var _=require('lodash');module['exports']={'title':{'type':Sequelize[_0x5dbf('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x5dbf('0x1')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x5dbf('0x2')](_0x5dbf('0x3')),'get':function(){try{return JSON[_0x5dbf('0x4')](this[_0x5dbf('0x5')](_0x5dbf('0x6')));}catch(_0x1decd2){return[];}},'set':function(_0x3f8628){try{this[_0x5dbf('0x7')](_0x5dbf('0x6'),JSON[_0x5dbf('0x8')](_0x3f8628));}catch(_0x93e657){this['setDataValue'](_0x5dbf('0x6'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x5dbf('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x5dbf('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5dbf('0x9')]},'col':{'type':Sequelize[_0x5dbf('0x9')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x5dbf('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5dbf('0x1')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index f72f95c..49e1b8d 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 _0x16ce=['intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','params','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrChannel','web-report','reportType','attrRefresh','widgetAttributes:\x20%s','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./dashboardItem.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','name','show','model','keys','DashboardItem','rawAttributes','query','filters'];(function(_0x42fa90,_0x5b8ad7){var _0x3bf801=function(_0x4d645a){while(--_0x4d645a){_0x42fa90['push'](_0x42fa90['shift']());}};_0x3bf801(++_0x5b8ad7);}(_0x16ce,0xfb));var _0xe16c=function(_0x215f6f,_0x233f4e){_0x215f6f=_0x215f6f-0x0;var _0x4250f6=_0x16ce[_0x215f6f];return _0x4250f6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe16c('0x0'));var zipdir=require(_0xe16c('0x1'));var jsonpatch=require(_0xe16c('0x2'));var rp=require(_0xe16c('0x3'));var moment=require(_0xe16c('0x4'));var BPromise=require(_0xe16c('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xe16c('0x6'));var csv=require('to-csv');var ejs=require(_0xe16c('0x7'));var fs=require('fs');var fs_extra=require(_0xe16c('0x8'));var _=require(_0xe16c('0x9'));var squel=require(_0xe16c('0xa'));var crypto=require(_0xe16c('0xb'));var jsforce=require(_0xe16c('0xc'));var deskjs=require(_0xe16c('0xd'));var toCsv=require(_0xe16c('0xe'));var querystring=require('querystring');var Papa=require(_0xe16c('0xf'));var Redis=require(_0xe16c('0x10'));var authService=require(_0xe16c('0x11'));var qs=require(_0xe16c('0x12'));var as=require(_0xe16c('0x13'));var hardwareService=require(_0xe16c('0x14'));var logger=require(_0xe16c('0x15'))(_0xe16c('0x16'));var utils=require(_0xe16c('0x17'));var config=require(_0xe16c('0x18'));var licenseUtil=require(_0xe16c('0x19'));var db=require('../../mysqldb')['db'];config[_0xe16c('0x1a')]=_[_0xe16c('0x1b')](config[_0xe16c('0x1a')],{'host':_0xe16c('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe16c('0x1d'))[_0xe16c('0x1e')](socket);function respondWithStatusCode(_0xb1f263,_0x14fc33){_0x14fc33=_0x14fc33||0xcc;return function(_0x4a4a21){if(_0x4a4a21){return _0xb1f263[_0xe16c('0x1f')](_0x14fc33);}return _0xb1f263['status'](_0x14fc33)[_0xe16c('0x20')]();};}function respondWithResult(_0x7a62b9,_0x353a5b){_0x353a5b=_0x353a5b||0xc8;return function(_0x5b7439){if(_0x5b7439){return _0x7a62b9[_0xe16c('0x21')](_0x353a5b)[_0xe16c('0x22')](_0x5b7439);}};}function respondWithFilteredResult(_0x3a99db,_0x3bb637){return function(_0x2afddf){if(_0x2afddf){var _0x5121f8=typeof _0x3bb637[_0xe16c('0x23')]===_0xe16c('0x24')&&typeof _0x3bb637[_0xe16c('0x25')]==='undefined';var _0x52ef0f=_0x2afddf['count'];var _0x30e657=_0x5121f8?0x0:_0x3bb637[_0xe16c('0x23')];var _0x611939=_0x5121f8?_0x2afddf[_0xe16c('0x26')]:_0x3bb637[_0xe16c('0x23')]+_0x3bb637[_0xe16c('0x25')];var _0x48beef;if(_0x611939>=_0x52ef0f){_0x611939=_0x52ef0f;_0x48beef=0xc8;}else{_0x48beef=0xce;}_0x3a99db[_0xe16c('0x21')](_0x48beef);return _0x3a99db[_0xe16c('0x27')](_0xe16c('0x28'),_0x30e657+'-'+_0x611939+'/'+_0x52ef0f)[_0xe16c('0x22')](_0x2afddf);}return null;};}function patchUpdates(_0x5a88ed){return function(_0x27eb44){try{jsonpatch[_0xe16c('0x29')](_0x27eb44,_0x5a88ed,!![]);}catch(_0x453aed){return BPromise[_0xe16c('0x2a')](_0x453aed);}return _0x27eb44[_0xe16c('0x2b')]();};}function saveUpdates(_0x18669a,_0x1d888d){return function(_0x8a9b36){if(_0x8a9b36){return _0x8a9b36['update'](_0x18669a)[_0xe16c('0x2c')](function(_0x9fd053){return _0x9fd053;});}return null;};}function removeEntity(_0x4fdc91,_0xd0799){return function(_0x5b6ca6){if(_0x5b6ca6){return _0x5b6ca6[_0xe16c('0x2d')]()['then'](function(){_0x4fdc91[_0xe16c('0x21')](0xcc)[_0xe16c('0x20')]();});}};}function handleEntityNotFound(_0x234c26,_0x156de3){return function(_0x473025){if(!_0x473025){_0x234c26[_0xe16c('0x1f')](0x194);}return _0x473025;};}function handleError(_0xfa565a,_0x69cd87){_0x69cd87=_0x69cd87||0x1f4;return function(_0x3472ef){logger[_0xe16c('0x2e')](_0x3472ef['stack']);if(_0x3472ef[_0xe16c('0x2f')]){delete _0x3472ef[_0xe16c('0x2f')];}_0xfa565a[_0xe16c('0x21')](_0x69cd87)['send'](_0x3472ef);};}exports[_0xe16c('0x30')]=function(_0x48d6b3,_0x4a0548){var _0x1ce8f5={'raw':![],'where':{'id':_0x48d6b3['params']['id']}},_0x25ec64={};_0x25ec64[_0xe16c('0x31')]=_[_0xe16c('0x32')](db[_0xe16c('0x33')][_0xe16c('0x34')]);_0x25ec64[_0xe16c('0x35')]=_[_0xe16c('0x32')](_0x48d6b3['query']);_0x25ec64[_0xe16c('0x36')]=_[_0xe16c('0x37')](_0x25ec64['model'],_0x25ec64[_0xe16c('0x35')]);_0x1ce8f5[_0xe16c('0x38')]=_[_0xe16c('0x37')](_0x25ec64[_0xe16c('0x31')],qs[_0xe16c('0x39')](_0x48d6b3[_0xe16c('0x35')][_0xe16c('0x39')]));_0x1ce8f5['attributes']=_0x1ce8f5[_0xe16c('0x38')][_0xe16c('0x3a')]?_0x1ce8f5[_0xe16c('0x38')]:_0x25ec64[_0xe16c('0x31')];if(_0x48d6b3[_0xe16c('0x35')][_0xe16c('0x3b')]){_0x1ce8f5[_0xe16c('0x3c')]=[{'all':!![]}];}_0x1ce8f5=_[_0xe16c('0x3d')]({},_0x1ce8f5,_0x48d6b3[_0xe16c('0x3e')]);return db[_0xe16c('0x33')][_0xe16c('0x3f')](_0x1ce8f5)[_0xe16c('0x2c')](handleEntityNotFound(_0x4a0548,null))[_0xe16c('0x2c')](respondWithResult(_0x4a0548,null))[_0xe16c('0x40')](handleError(_0x4a0548,null));};exports[_0xe16c('0x2d')]=function(_0x46bc4b,_0x5a3351){return db[_0xe16c('0x33')][_0xe16c('0x3f')]({'where':{'id':_0x46bc4b[_0xe16c('0x41')]['id']}})[_0xe16c('0x2c')](handleEntityNotFound(_0x5a3351,null))[_0xe16c('0x2c')](removeEntity(_0x5a3351,null))['catch'](handleError(_0x5a3351,null));};function widgetAttributes(_0x4e9b4a){try{switch(_0x4e9b4a[_0xe16c('0x42')]){case _0xe16c('0x43'):return[{'name':_0xe16c('0x44'),'value':_0x4e9b4a[_0xe16c('0x44')]||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a['attrs'][0x0]?_0x4e9b4a[_0xe16c('0x45')][0x0][_0xe16c('0x46')]:undefined)||_0xe16c('0x47')}];case'custom':return[{'name':_0xe16c('0x48'),'value':_0x4e9b4a[_0xe16c('0x48')]||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a[_0xe16c('0x45')][0x0]?_0x4e9b4a['attrs'][0x0][_0xe16c('0x46')]:undefined)||''}];case _0xe16c('0x49'):return[{'name':_0xe16c('0x4a'),'value':_0x4e9b4a[_0xe16c('0x4a')]||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a[_0xe16c('0x45')][0x0]?_0x4e9b4a['attrs'][0x0][_0xe16c('0x46')]:undefined)||'HH:mm:ss'},{'name':_0xe16c('0x4b'),'value':_0x4e9b4a[_0xe16c('0x4b')]||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a[_0xe16c('0x45')][0x1]?_0x4e9b4a[_0xe16c('0x45')][0x1]['value']:undefined)||_0xe16c('0x4c')},{'name':_0xe16c('0x4d'),'value':_0x4e9b4a[_0xe16c('0x4d')]||(_0x4e9b4a['attrs']&&_0x4e9b4a[_0xe16c('0x45')][0x2]?_0x4e9b4a[_0xe16c('0x45')][0x2][_0xe16c('0x46')]:undefined)||0xc}];case _0xe16c('0x4e'):return[{'name':'attrMetric','value':_0x4e9b4a[_0xe16c('0x4f')]||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a[_0xe16c('0x45')][0x0]?_0x4e9b4a[_0xe16c('0x45')][0x0]['value']:undefined)||_0xe16c('0x50')},{'name':_0xe16c('0x51'),'value':_0x4e9b4a[_0xe16c('0x51')]||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a[_0xe16c('0x45')][0x1]?_0x4e9b4a[_0xe16c('0x45')][0x1][_0xe16c('0x46')]:undefined)||[]},{'name':_0xe16c('0x4d'),'value':_0x4e9b4a[_0xe16c('0x4d')]||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a['attrs'][0x2]?_0x4e9b4a[_0xe16c('0x45')][0x2][_0xe16c('0x46')]:undefined)||0x14},{'name':'attrChannel','value':_0x4e9b4a['attrChannel']||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a[_0xe16c('0x45')][0x3]?_0x4e9b4a[_0xe16c('0x45')][0x3][_0xe16c('0x46')]:undefined)||_0xe16c('0x52')},{'name':_0xe16c('0x53'),'value':_0x4e9b4a[_0xe16c('0x53')]||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a[_0xe16c('0x45')][0x4]?_0x4e9b4a[_0xe16c('0x45')][0x4][_0xe16c('0x46')]:undefined)||''},{'name':_0xe16c('0x54'),'value':_0x4e9b4a[_0xe16c('0x54')]||(_0x4e9b4a['attrs']&&_0x4e9b4a[_0xe16c('0x45')][0x5]?_0x4e9b4a[_0xe16c('0x45')][0x5][_0xe16c('0x46')]:undefined)||''},{'name':_0xe16c('0x55'),'value':_0x4e9b4a[_0xe16c('0x55')]||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a[_0xe16c('0x45')][0x6]?_0x4e9b4a[_0xe16c('0x45')][0x6][_0xe16c('0x46')]:undefined)||''},{'name':_0xe16c('0x56'),'value':_0x4e9b4a[_0xe16c('0x56')]||(_0x4e9b4a['attrs']&&_0x4e9b4a['attrs'][0x7]?_0x4e9b4a['attrs'][0x7][_0xe16c('0x46')]:undefined)||''},{'name':_0xe16c('0x57'),'value':_0x4e9b4a[_0xe16c('0x57')]||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a['attrs'][0x8]?_0x4e9b4a[_0xe16c('0x45')][0x8]['value']:undefined)||''},{'name':_0xe16c('0x58'),'value':_0x4e9b4a[_0xe16c('0x58')]||(_0x4e9b4a['attrs']&&_0x4e9b4a['attrs'][0x9]?_0x4e9b4a['attrs'][0x9]['value']:undefined)||''}];case _0xe16c('0x59'):case _0xe16c('0x5a'):return[{'name':_0xe16c('0x5b'),'value':_0x4e9b4a[_0xe16c('0x5b')]||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a[_0xe16c('0x45')][0x0]?_0x4e9b4a[_0xe16c('0x45')][0x0]['value']:undefined)||'total'},{'name':_0xe16c('0x5c'),'value':_0x4e9b4a[_0xe16c('0x5c')]||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a[_0xe16c('0x45')][0x1]?_0x4e9b4a[_0xe16c('0x45')][0x1]['value']:undefined)||null},{'name':'attrSerie3','value':_0x4e9b4a[_0xe16c('0x5d')]||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a[_0xe16c('0x45')][0x2]?_0x4e9b4a[_0xe16c('0x45')][0x2][_0xe16c('0x46')]:undefined)||null},{'name':_0xe16c('0x51'),'value':_0x4e9b4a[_0xe16c('0x51')]||(_0x4e9b4a['attrs']&&_0x4e9b4a[_0xe16c('0x45')][0x3]?_0x4e9b4a[_0xe16c('0x45')][0x3][_0xe16c('0x46')]:undefined)||[]},{'name':_0xe16c('0x5e'),'value':_0x4e9b4a['attrChannel']||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a['attrs'][0x4]?_0x4e9b4a[_0xe16c('0x45')][0x4][_0xe16c('0x46')]:undefined)||_0xe16c('0x52')},{'name':_0xe16c('0x53'),'value':_0x4e9b4a[_0xe16c('0x53')]||(_0x4e9b4a['attrs']&&_0x4e9b4a[_0xe16c('0x45')][0x5]?_0x4e9b4a[_0xe16c('0x45')][0x5]['value']:undefined)||''},{'name':_0xe16c('0x54'),'value':_0x4e9b4a[_0xe16c('0x54')]||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a[_0xe16c('0x45')][0x6]?_0x4e9b4a[_0xe16c('0x45')][0x6][_0xe16c('0x46')]:undefined)||''},{'name':_0xe16c('0x55'),'value':_0x4e9b4a[_0xe16c('0x55')]||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a[_0xe16c('0x45')][0x7]?_0x4e9b4a['attrs'][0x7][_0xe16c('0x46')]:undefined)||''},{'name':_0xe16c('0x56'),'value':_0x4e9b4a[_0xe16c('0x56')]||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a['attrs'][0x8]?_0x4e9b4a['attrs'][0x8]['value']:undefined)||''},{'name':_0xe16c('0x57'),'value':_0x4e9b4a[_0xe16c('0x57')]||(_0x4e9b4a['attrs']&&_0x4e9b4a['attrs'][0x9]?_0x4e9b4a[_0xe16c('0x45')][0x9][_0xe16c('0x46')]:undefined)||''},{'name':_0xe16c('0x58'),'value':_0x4e9b4a[_0xe16c('0x58')]||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a[_0xe16c('0x45')][0xa]?_0x4e9b4a[_0xe16c('0x45')][0xa][_0xe16c('0x46')]:undefined)||''}];case _0xe16c('0x5f'):return[{'name':'attrReport','type':_0x4e9b4a[_0xe16c('0x60')]||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a[_0xe16c('0x45')][0x0]?_0x4e9b4a['attrs'][0x0]['type']:undefined)||null,'value':_0x4e9b4a['attrReport']||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a['attrs'][0x0]?_0x4e9b4a['attrs'][0x0][_0xe16c('0x46')]:undefined)||null},{'name':_0xe16c('0x61'),'value':_0x4e9b4a[_0xe16c('0x61')]||(_0x4e9b4a[_0xe16c('0x45')]&&_0x4e9b4a['attrs'][0x1]?_0x4e9b4a[_0xe16c('0x45')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1937e3){logger[_0xe16c('0x2e')](_0xe16c('0x62'),JSON['stringify'](_0x1937e3));return[];}}exports[_0xe16c('0x63')]=function(_0x4f8e03,_0x998487){if(_0x4f8e03[_0xe16c('0x64')]){_0x4f8e03[_0xe16c('0x64')][_0xe16c('0x45')]=widgetAttributes(_0x4f8e03['body']);}return db[_0xe16c('0x33')][_0xe16c('0x63')](_0x4f8e03['body'],{})[_0xe16c('0x2c')](respondWithResult(_0x998487,0xc9))['catch'](handleError(_0x998487,null));};exports[_0xe16c('0x65')]=function(_0x18ed00,_0x33b10d){if(_0x18ed00[_0xe16c('0x64')]['id']){delete _0x18ed00['body']['id'];}_0x18ed00['body'][_0xe16c('0x45')]=widgetAttributes(_0x18ed00[_0xe16c('0x64')]);return db['DashboardItem'][_0xe16c('0x3f')]({'where':{'id':_0x18ed00[_0xe16c('0x41')]['id']}})['then'](handleEntityNotFound(_0x33b10d,null))['then'](saveUpdates(_0x18ed00[_0xe16c('0x64')],null))[_0xe16c('0x2c')](respondWithResult(_0x33b10d,null))['catch'](handleError(_0x33b10d,null));}; \ No newline at end of file +var _0x6d19=['error','stack','name','send','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','DashboardItem','find','catch','destroy','iframe','attrUrl','attrs','value','https://','attrPath','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','type','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then'];(function(_0x3246a6,_0x2a685a){var _0x1df64d=function(_0x4868ad){while(--_0x4868ad){_0x3246a6['push'](_0x3246a6['shift']());}};_0x1df64d(++_0x2a685a);}(_0x6d19,0x160));var _0x96d1=function(_0x2b9b7f,_0x4d47df){_0x2b9b7f=_0x2b9b7f-0x0;var _0x4ed19a=_0x6d19[_0x2b9b7f];return _0x4ed19a;};'use strict';var emlformat=require(_0x96d1('0x0'));var rimraf=require(_0x96d1('0x1'));var zipdir=require(_0x96d1('0x2'));var jsonpatch=require(_0x96d1('0x3'));var rp=require(_0x96d1('0x4'));var moment=require(_0x96d1('0x5'));var BPromise=require(_0x96d1('0x6'));var Mustache=require('mustache');var util=require(_0x96d1('0x7'));var path=require(_0x96d1('0x8'));var sox=require(_0x96d1('0x9'));var csv=require(_0x96d1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x96d1('0xb'));var _=require(_0x96d1('0xc'));var squel=require(_0x96d1('0xd'));var crypto=require('crypto');var jsforce=require(_0x96d1('0xe'));var deskjs=require(_0x96d1('0xf'));var toCsv=require(_0x96d1('0xa'));var querystring=require(_0x96d1('0x10'));var Papa=require(_0x96d1('0x11'));var Redis=require(_0x96d1('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x96d1('0x13'));var hardwareService=require(_0x96d1('0x14'));var logger=require('../../config/logger')(_0x96d1('0x15'));var utils=require('../../config/utils');var config=require(_0x96d1('0x16'));var licenseUtil=require(_0x96d1('0x17'));var db=require(_0x96d1('0x18'))['db'];config[_0x96d1('0x19')]=_[_0x96d1('0x1a')](config[_0x96d1('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x96d1('0x1b'))(new Redis(config[_0x96d1('0x19')]));require(_0x96d1('0x1c'))[_0x96d1('0x1d')](socket);function respondWithStatusCode(_0x2fd5c6,_0x5a9e7d){_0x5a9e7d=_0x5a9e7d||0xcc;return function(_0x52e614){if(_0x52e614){return _0x2fd5c6[_0x96d1('0x1e')](_0x5a9e7d);}return _0x2fd5c6[_0x96d1('0x1f')](_0x5a9e7d)[_0x96d1('0x20')]();};}function respondWithResult(_0x9eb2c4,_0x2d521d){_0x2d521d=_0x2d521d||0xc8;return function(_0x3e9a0){if(_0x3e9a0){return _0x9eb2c4[_0x96d1('0x1f')](_0x2d521d)[_0x96d1('0x21')](_0x3e9a0);}};}function respondWithFilteredResult(_0x913482,_0x5853f0){return function(_0x18c73f){if(_0x18c73f){var _0x1c3540=typeof _0x5853f0[_0x96d1('0x22')]===_0x96d1('0x23')&&typeof _0x5853f0[_0x96d1('0x24')]==='undefined';var _0x3c605a=_0x18c73f[_0x96d1('0x25')];var _0x28b2aa=_0x1c3540?0x0:_0x5853f0[_0x96d1('0x22')];var _0x5866e9=_0x1c3540?_0x18c73f[_0x96d1('0x25')]:_0x5853f0[_0x96d1('0x22')]+_0x5853f0[_0x96d1('0x24')];var _0x31a7e5;if(_0x5866e9>=_0x3c605a){_0x5866e9=_0x3c605a;_0x31a7e5=0xc8;}else{_0x31a7e5=0xce;}_0x913482['status'](_0x31a7e5);return _0x913482[_0x96d1('0x26')](_0x96d1('0x27'),_0x28b2aa+'-'+_0x5866e9+'/'+_0x3c605a)[_0x96d1('0x21')](_0x18c73f);}return null;};}function patchUpdates(_0x1390ac){return function(_0x5a0584){try{jsonpatch[_0x96d1('0x28')](_0x5a0584,_0x1390ac,!![]);}catch(_0x38f350){return BPromise['reject'](_0x38f350);}return _0x5a0584[_0x96d1('0x29')]();};}function saveUpdates(_0x29ea83,_0x54c824){return function(_0x1130ba){if(_0x1130ba){return _0x1130ba[_0x96d1('0x2a')](_0x29ea83)[_0x96d1('0x2b')](function(_0x5462ec){return _0x5462ec;});}return null;};}function removeEntity(_0x424d1e,_0x46aa64){return function(_0x7e7006){if(_0x7e7006){return _0x7e7006['destroy']()['then'](function(){_0x424d1e[_0x96d1('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3728c8,_0x274dcd){return function(_0x267efc){if(!_0x267efc){_0x3728c8[_0x96d1('0x1e')](0x194);}return _0x267efc;};}function handleError(_0x3bfde7,_0x4eb09a){_0x4eb09a=_0x4eb09a||0x1f4;return function(_0x1b42a0){logger[_0x96d1('0x2c')](_0x1b42a0[_0x96d1('0x2d')]);if(_0x1b42a0[_0x96d1('0x2e')]){delete _0x1b42a0[_0x96d1('0x2e')];}_0x3bfde7[_0x96d1('0x1f')](_0x4eb09a)[_0x96d1('0x2f')](_0x1b42a0);};}exports['show']=function(_0x59749e,_0x7ee767){var _0x266d2c={'raw':![],'where':{'id':_0x59749e[_0x96d1('0x30')]['id']}},_0x3968f5={};_0x3968f5[_0x96d1('0x31')]=_[_0x96d1('0x32')](db['DashboardItem'][_0x96d1('0x33')]);_0x3968f5[_0x96d1('0x34')]=_[_0x96d1('0x32')](_0x59749e[_0x96d1('0x34')]);_0x3968f5[_0x96d1('0x35')]=_[_0x96d1('0x36')](_0x3968f5['model'],_0x3968f5[_0x96d1('0x34')]);_0x266d2c[_0x96d1('0x37')]=_[_0x96d1('0x36')](_0x3968f5[_0x96d1('0x31')],qs[_0x96d1('0x38')](_0x59749e[_0x96d1('0x34')]['fields']));_0x266d2c[_0x96d1('0x37')]=_0x266d2c['attributes']['length']?_0x266d2c['attributes']:_0x3968f5[_0x96d1('0x31')];if(_0x59749e[_0x96d1('0x34')][_0x96d1('0x39')]){_0x266d2c[_0x96d1('0x3a')]=[{'all':!![]}];}_0x266d2c=_[_0x96d1('0x3b')]({},_0x266d2c,_0x59749e['options']);return db[_0x96d1('0x3c')][_0x96d1('0x3d')](_0x266d2c)[_0x96d1('0x2b')](handleEntityNotFound(_0x7ee767,null))[_0x96d1('0x2b')](respondWithResult(_0x7ee767,null))[_0x96d1('0x3e')](handleError(_0x7ee767,null));};exports[_0x96d1('0x3f')]=function(_0x4b22c1,_0x2b8273){return db[_0x96d1('0x3c')][_0x96d1('0x3d')]({'where':{'id':_0x4b22c1[_0x96d1('0x30')]['id']}})[_0x96d1('0x2b')](handleEntityNotFound(_0x2b8273,null))[_0x96d1('0x2b')](removeEntity(_0x2b8273,null))[_0x96d1('0x3e')](handleError(_0x2b8273,null));};function widgetAttributes(_0x4d70be){try{switch(_0x4d70be['type']){case _0x96d1('0x40'):return[{'name':_0x96d1('0x41'),'value':_0x4d70be[_0x96d1('0x41')]||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be[_0x96d1('0x42')][0x0]?_0x4d70be['attrs'][0x0][_0x96d1('0x43')]:undefined)||_0x96d1('0x44')}];case'custom':return[{'name':_0x96d1('0x45'),'value':_0x4d70be[_0x96d1('0x45')]||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be[_0x96d1('0x42')][0x0]?_0x4d70be['attrs'][0x0][_0x96d1('0x43')]:undefined)||''}];case'clock':return[{'name':'attrHourFormat','value':_0x4d70be[_0x96d1('0x46')]||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be['attrs'][0x0]?_0x4d70be['attrs'][0x0][_0x96d1('0x43')]:undefined)||'HH:mm:ss'},{'name':_0x96d1('0x47'),'value':_0x4d70be['attrTimezone']||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be['attrs'][0x1]?_0x4d70be[_0x96d1('0x42')][0x1]['value']:undefined)||'0.00'},{'name':_0x96d1('0x48'),'value':_0x4d70be['attrFontSize']||(_0x4d70be['attrs']&&_0x4d70be[_0x96d1('0x42')][0x2]?_0x4d70be[_0x96d1('0x42')][0x2][_0x96d1('0x43')]:undefined)||0xc}];case _0x96d1('0x49'):return[{'name':_0x96d1('0x4a'),'value':_0x4d70be['attrMetric']||(_0x4d70be['attrs']&&_0x4d70be['attrs'][0x0]?_0x4d70be[_0x96d1('0x42')][0x0][_0x96d1('0x43')]:undefined)||_0x96d1('0x4b')},{'name':_0x96d1('0x4c'),'value':_0x4d70be[_0x96d1('0x4c')]||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be['attrs'][0x1]?_0x4d70be['attrs'][0x1][_0x96d1('0x43')]:undefined)||[]},{'name':_0x96d1('0x48'),'value':_0x4d70be[_0x96d1('0x48')]||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be[_0x96d1('0x42')][0x2]?_0x4d70be[_0x96d1('0x42')][0x2][_0x96d1('0x43')]:undefined)||0x14},{'name':_0x96d1('0x4d'),'value':_0x4d70be['attrChannel']||(_0x4d70be['attrs']&&_0x4d70be[_0x96d1('0x42')][0x3]?_0x4d70be[_0x96d1('0x42')][0x3]['value']:undefined)||_0x96d1('0x4e')},{'name':'attrEmailAccounts','value':_0x4d70be[_0x96d1('0x4f')]||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be[_0x96d1('0x42')][0x4]?_0x4d70be[_0x96d1('0x42')][0x4][_0x96d1('0x43')]:undefined)||''},{'name':_0x96d1('0x50'),'value':_0x4d70be['attrFaxAccounts']||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be[_0x96d1('0x42')][0x5]?_0x4d70be['attrs'][0x5][_0x96d1('0x43')]:undefined)||''},{'name':_0x96d1('0x51'),'value':_0x4d70be[_0x96d1('0x51')]||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be[_0x96d1('0x42')][0x6]?_0x4d70be[_0x96d1('0x42')][0x6][_0x96d1('0x43')]:undefined)||''},{'name':_0x96d1('0x52'),'value':_0x4d70be[_0x96d1('0x52')]||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be[_0x96d1('0x42')][0x7]?_0x4d70be[_0x96d1('0x42')][0x7][_0x96d1('0x43')]:undefined)||''},{'name':_0x96d1('0x53'),'value':_0x4d70be['attrWhatsappAccounts']||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be[_0x96d1('0x42')][0x8]?_0x4d70be[_0x96d1('0x42')][0x8][_0x96d1('0x43')]:undefined)||''},{'name':_0x96d1('0x54'),'value':_0x4d70be[_0x96d1('0x54')]||(_0x4d70be['attrs']&&_0x4d70be[_0x96d1('0x42')][0x9]?_0x4d70be[_0x96d1('0x42')][0x9]['value']:undefined)||''}];case _0x96d1('0x55'):case _0x96d1('0x56'):return[{'name':_0x96d1('0x57'),'value':_0x4d70be['attrSerie1']||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be['attrs'][0x0]?_0x4d70be[_0x96d1('0x42')][0x0]['value']:undefined)||_0x96d1('0x4b')},{'name':_0x96d1('0x58'),'value':_0x4d70be[_0x96d1('0x58')]||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be[_0x96d1('0x42')][0x1]?_0x4d70be['attrs'][0x1][_0x96d1('0x43')]:undefined)||null},{'name':_0x96d1('0x59'),'value':_0x4d70be[_0x96d1('0x59')]||(_0x4d70be['attrs']&&_0x4d70be[_0x96d1('0x42')][0x2]?_0x4d70be[_0x96d1('0x42')][0x2]['value']:undefined)||null},{'name':'attrVoiceQueues','value':_0x4d70be[_0x96d1('0x4c')]||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be[_0x96d1('0x42')][0x3]?_0x4d70be['attrs'][0x3][_0x96d1('0x43')]:undefined)||[]},{'name':'attrChannel','value':_0x4d70be[_0x96d1('0x4d')]||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be[_0x96d1('0x42')][0x4]?_0x4d70be['attrs'][0x4][_0x96d1('0x43')]:undefined)||_0x96d1('0x4e')},{'name':_0x96d1('0x4f'),'value':_0x4d70be[_0x96d1('0x4f')]||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be[_0x96d1('0x42')][0x5]?_0x4d70be[_0x96d1('0x42')][0x5][_0x96d1('0x43')]:undefined)||''},{'name':_0x96d1('0x50'),'value':_0x4d70be['attrFaxAccounts']||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be[_0x96d1('0x42')][0x6]?_0x4d70be[_0x96d1('0x42')][0x6][_0x96d1('0x43')]:undefined)||''},{'name':_0x96d1('0x51'),'value':_0x4d70be[_0x96d1('0x51')]||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be[_0x96d1('0x42')][0x7]?_0x4d70be[_0x96d1('0x42')][0x7]['value']:undefined)||''},{'name':_0x96d1('0x52'),'value':_0x4d70be[_0x96d1('0x52')]||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be['attrs'][0x8]?_0x4d70be['attrs'][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x4d70be[_0x96d1('0x53')]||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be[_0x96d1('0x42')][0x9]?_0x4d70be[_0x96d1('0x42')][0x9][_0x96d1('0x43')]:undefined)||''},{'name':_0x96d1('0x54'),'value':_0x4d70be['attrChatWebsites']||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be[_0x96d1('0x42')][0xa]?_0x4d70be[_0x96d1('0x42')][0xa][_0x96d1('0x43')]:undefined)||''}];case _0x96d1('0x5a'):return[{'name':_0x96d1('0x5b'),'type':_0x4d70be[_0x96d1('0x5c')]||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be[_0x96d1('0x42')][0x0]?_0x4d70be[_0x96d1('0x42')][0x0][_0x96d1('0x5d')]:undefined)||null,'value':_0x4d70be['attrReport']||(_0x4d70be['attrs']&&_0x4d70be[_0x96d1('0x42')][0x0]?_0x4d70be[_0x96d1('0x42')][0x0][_0x96d1('0x43')]:undefined)||null},{'name':_0x96d1('0x5e'),'value':_0x4d70be[_0x96d1('0x5e')]||(_0x4d70be[_0x96d1('0x42')]&&_0x4d70be[_0x96d1('0x42')][0x1]?_0x4d70be[_0x96d1('0x42')][0x1][_0x96d1('0x43')]:undefined)||0x0}];default:return[];}}catch(_0x54f377){logger['error'](_0x96d1('0x5f'),JSON[_0x96d1('0x60')](_0x54f377));return[];}}exports[_0x96d1('0x61')]=function(_0x34b6db,_0x253dd4){if(_0x34b6db[_0x96d1('0x62')]){_0x34b6db[_0x96d1('0x62')][_0x96d1('0x42')]=widgetAttributes(_0x34b6db[_0x96d1('0x62')]);}return db[_0x96d1('0x3c')][_0x96d1('0x61')](_0x34b6db['body'],{})[_0x96d1('0x2b')](respondWithResult(_0x253dd4,0xc9))[_0x96d1('0x3e')](handleError(_0x253dd4,null));};exports[_0x96d1('0x2a')]=function(_0x67548,_0x1d2d8a){if(_0x67548[_0x96d1('0x62')]['id']){delete _0x67548[_0x96d1('0x62')]['id'];}_0x67548[_0x96d1('0x62')]['attrs']=widgetAttributes(_0x67548['body']);return db[_0x96d1('0x3c')][_0x96d1('0x3d')]({'where':{'id':_0x67548['params']['id']}})[_0x96d1('0x2b')](handleEntityNotFound(_0x1d2d8a,null))[_0x96d1('0x2b')](saveUpdates(_0x67548[_0x96d1('0x62')],null))['then'](respondWithResult(_0x1d2d8a,null))['catch'](handleError(_0x1d2d8a,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 0ac87e6..86a5866 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 _0x6ad6=['hook','events','../../mysqldb','DashboardItem','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x31ea8f,_0x2d1cbe){var _0x3bc2ac=function(_0xb57e34){while(--_0xb57e34){_0x31ea8f['push'](_0x31ea8f['shift']());}};_0x3bc2ac(++_0x2d1cbe);}(_0x6ad6,0x1e7));var _0x66ad=function(_0x3dc7c3,_0x369f51){_0x3dc7c3=_0x3dc7c3-0x0;var _0x147d13=_0x6ad6[_0x3dc7c3];return _0x147d13;};'use strict';var EventEmitter=require(_0x66ad('0x0'));var DashboardItem=require(_0x66ad('0x1'))['db'][_0x66ad('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x66ad('0x3')](0x0);var events={'afterCreate':_0x66ad('0x4'),'afterUpdate':_0x66ad('0x5'),'afterDestroy':'remove'};function emitEvent(_0x25dad2){return function(_0x1b3e06,_0x1ef58f,_0x375e22){DashboardItemEvents[_0x66ad('0x6')](_0x25dad2+':'+_0x1b3e06['id'],_0x1b3e06);DashboardItemEvents[_0x66ad('0x6')](_0x25dad2,_0x1b3e06);_0x375e22(null);};}for(var e in events){if(events[_0x66ad('0x7')](e)){var event=events[e];DashboardItem[_0x66ad('0x8')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x1675=['events','../../mysqldb','update','remove','emit','hasOwnProperty','exports'];(function(_0x50242d,_0x5eac09){var _0x1a26a6=function(_0x46ab24){while(--_0x46ab24){_0x50242d['push'](_0x50242d['shift']());}};_0x1a26a6(++_0x5eac09);}(_0x1675,0x1a4));var _0x5167=function(_0x2a61b0,_0x2c7e84){_0x2a61b0=_0x2a61b0-0x0;var _0x2a8b3a=_0x1675[_0x2a61b0];return _0x2a8b3a;};'use strict';var EventEmitter=require(_0x5167('0x0'));var DashboardItem=require(_0x5167('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5167('0x2'),'afterDestroy':_0x5167('0x3')};function emitEvent(_0x52756a){return function(_0x14858e,_0x215f25,_0x579174){DashboardItemEvents[_0x5167('0x4')](_0x52756a+':'+_0x14858e['id'],_0x14858e);DashboardItemEvents[_0x5167('0x4')](_0x52756a,_0x14858e);_0x579174(null);};}for(var e in events){if(events[_0x5167('0x5')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x5167('0x6')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 8c97227..14663e4 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 _0xb9e1=['./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x27e7c3,_0x4d10cf){var _0x3a866f=function(_0x1848cf){while(--_0x1848cf){_0x27e7c3['push'](_0x27e7c3['shift']());}};_0x3a866f(++_0x4d10cf);}(_0xb9e1,0xad));var _0x1b9e=function(_0x4913a8,_0x5a8cbd){_0x4913a8=_0x4913a8-0x0;var _0x50a4de=_0xb9e1[_0x4913a8];return _0x50a4de;};'use strict';var _=require(_0x1b9e('0x0'));var util=require(_0x1b9e('0x1'));var logger=require(_0x1b9e('0x2'))(_0x1b9e('0x3'));var moment=require(_0x1b9e('0x4'));var BPromise=require(_0x1b9e('0x5'));var rp=require(_0x1b9e('0x6'));var fs=require('fs');var path=require(_0x1b9e('0x7'));var rimraf=require('rimraf');var config=require(_0x1b9e('0x8'));var attributes=require(_0x1b9e('0x9'));module[_0x1b9e('0xa')]=function(_0x1ab7b7,_0xbe882){return _0x1ab7b7[_0x1b9e('0xb')](_0x1b9e('0xc'),attributes,{'tableName':_0x1b9e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6db1=['moment','bluebird','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','util','../../config/logger','api'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6db1,0x13e));var _0x16db=function(_0x77c2bf,_0x3c1a39){_0x77c2bf=_0x77c2bf-0x0;var _0x3a15b0=_0x6db1[_0x77c2bf];return _0x3a15b0;};'use strict';var _=require(_0x16db('0x0'));var util=require(_0x16db('0x1'));var logger=require(_0x16db('0x2'))(_0x16db('0x3'));var moment=require(_0x16db('0x4'));var BPromise=require(_0x16db('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x16db('0x6'));var rimraf=require(_0x16db('0x7'));var config=require(_0x16db('0x8'));var attributes=require(_0x16db('0x9'));module[_0x16db('0xa')]=function(_0x1cf88f,_0x38b8af){return _0x1cf88f[_0x16db('0xb')](_0x16db('0xc'),attributes,{'tableName':_0x16db('0xd'),'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 adb2698..789b2bd 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 _0xa116=['stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','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'];(function(_0x1bca90,_0x5560af){var _0x244736=function(_0x4453b2){while(--_0x4453b2){_0x1bca90['push'](_0x1bca90['shift']());}};_0x244736(++_0x5560af);}(_0xa116,0x1a9));var _0x6a11=function(_0x6987b,_0x5b3226){_0x6987b=_0x6987b-0x0;var _0x29703b=_0xa116[_0x6987b];return _0x29703b;};'use strict';var _=require('lodash');var util=require(_0x6a11('0x0'));var moment=require(_0x6a11('0x1'));var BPromise=require(_0x6a11('0x2'));var rs=require(_0x6a11('0x3'));var fs=require('fs');var Redis=require(_0x6a11('0x4'));var db=require(_0x6a11('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a11('0x6'))(_0x6a11('0x7'));var config=require(_0x6a11('0x8'));var jayson=require(_0x6a11('0x9'));var client=jayson[_0x6a11('0xa')][_0x6a11('0xb')]({'port':0x232a});config[_0x6a11('0xc')]=_[_0x6a11('0xd')](config[_0x6a11('0xc')],{'host':_0x6a11('0xe'),'port':0x18eb});var socket=require(_0x6a11('0xf'))(new Redis(config['redis']));require(_0x6a11('0x10'))[_0x6a11('0x11')](socket);function respondWithRpcPromise(_0x38bba9,_0x50192d,_0x471fb5){return new BPromise(function(_0x5691b1,_0x495f56){return client[_0x6a11('0x12')](_0x38bba9,_0x471fb5)[_0x6a11('0x13')](function(_0x50d2ab){logger[_0x6a11('0x14')](_0x6a11('0x15'),_0x50192d,_0x6a11('0x16'));logger[_0x6a11('0x17')](_0x6a11('0x18'),_0x50192d,_0x6a11('0x16'),JSON[_0x6a11('0x19')](_0x50d2ab));if(_0x50d2ab[_0x6a11('0x1a')]){if(_0x50d2ab[_0x6a11('0x1a')][_0x6a11('0x1b')]===0x1f4){logger[_0x6a11('0x1a')]('DashboardItem,\x20%s,\x20%s',_0x50192d,_0x50d2ab['error']['message']);return _0x495f56(_0x50d2ab['error'][_0x6a11('0x1c')]);}logger[_0x6a11('0x1a')]('DashboardItem,\x20%s,\x20%s',_0x50192d,_0x50d2ab[_0x6a11('0x1a')]['message']);return _0x5691b1(_0x50d2ab[_0x6a11('0x1a')][_0x6a11('0x1c')]);}else{logger['info']('DashboardItem,\x20%s,\x20%s',_0x50192d,'request\x20sent');_0x5691b1(_0x50d2ab[_0x6a11('0x1d')][_0x6a11('0x1c')]);}})['catch'](function(_0x40c1e7){logger[_0x6a11('0x1a')](_0x6a11('0x15'),_0x50192d,_0x40c1e7);_0x495f56(_0x40c1e7);});});} \ No newline at end of file +var _0x67ba=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','util','moment','bluebird','randomstring'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x67ba,0x7e));var _0xa67b=function(_0x1f01bb,_0x2f61e4){_0x1f01bb=_0x1f01bb-0x0;var _0x59d7b4=_0x67ba[_0x1f01bb];return _0x59d7b4;};'use strict';var _=require('lodash');var util=require(_0xa67b('0x0'));var moment=require(_0xa67b('0x1'));var BPromise=require(_0xa67b('0x2'));var rs=require(_0xa67b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa67b('0x4'))['db'];var utils=require(_0xa67b('0x5'));var logger=require(_0xa67b('0x6'))(_0xa67b('0x7'));var config=require(_0xa67b('0x8'));var jayson=require(_0xa67b('0x9'));var client=jayson[_0xa67b('0xa')][_0xa67b('0xb')]({'port':0x232a});config['redis']=_[_0xa67b('0xc')](config[_0xa67b('0xd')],{'host':_0xa67b('0xe'),'port':0x18eb});var socket=require(_0xa67b('0xf'))(new Redis(config[_0xa67b('0xd')]));require('./dashboardItem.socket')[_0xa67b('0x10')](socket);function respondWithRpcPromise(_0x167715,_0x40a8c2,_0x1659ad){return new BPromise(function(_0x1c19ee,_0x2ef9b6){return client[_0xa67b('0x11')](_0x167715,_0x1659ad)['then'](function(_0x455bab){logger['info'](_0xa67b('0x12'),_0x40a8c2,_0xa67b('0x13'));logger[_0xa67b('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x40a8c2,'request\x20sent',JSON['stringify'](_0x455bab));if(_0x455bab[_0xa67b('0x15')]){if(_0x455bab[_0xa67b('0x15')][_0xa67b('0x16')]===0x1f4){logger[_0xa67b('0x15')]('DashboardItem,\x20%s,\x20%s',_0x40a8c2,_0x455bab[_0xa67b('0x15')][_0xa67b('0x17')]);return _0x2ef9b6(_0x455bab[_0xa67b('0x15')][_0xa67b('0x17')]);}logger['error'](_0xa67b('0x12'),_0x40a8c2,_0x455bab[_0xa67b('0x15')][_0xa67b('0x17')]);return _0x1c19ee(_0x455bab[_0xa67b('0x15')]['message']);}else{logger[_0xa67b('0x18')](_0xa67b('0x12'),_0x40a8c2,_0xa67b('0x13'));_0x1c19ee(_0x455bab[_0xa67b('0x19')][_0xa67b('0x17')]);}})['catch'](function(_0x23ace2){logger['error']('DashboardItem,\x20%s,\x20%s',_0x40a8c2,_0x23ace2);_0x2ef9b6(_0x23ace2);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index a47cdcb..6c9aa67 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 _0x2984=['register','length','./dashboardItem.events','remove','update','emit','removeListener'];(function(_0x3c5945,_0x3ff23b){var _0x571d02=function(_0x5972ec){while(--_0x5972ec){_0x3c5945['push'](_0x3c5945['shift']());}};_0x571d02(++_0x3ff23b);}(_0x2984,0x198));var _0x4298=function(_0xf285c1,_0x420382){_0xf285c1=_0xf285c1-0x0;var _0x1598a0=_0x2984[_0xf285c1];return _0x1598a0;};'use strict';var DashboardItemEvents=require(_0x4298('0x0'));var events=['save',_0x4298('0x1'),_0x4298('0x2')];function createListener(_0x3892e7,_0x574652){return function(_0x6f9a07){_0x574652[_0x4298('0x3')](_0x3892e7,_0x6f9a07);};}function removeListener(_0x4dca7d,_0x1ae389){return function(){DashboardItemEvents[_0x4298('0x4')](_0x4dca7d,_0x1ae389);};}exports[_0x4298('0x5')]=function(_0xef3ef4){for(var _0x3d7364=0x0,_0x1ea092=events[_0x4298('0x6')];_0x3d7364<_0x1ea092;_0x3d7364++){var _0x4f7e3d=events[_0x3d7364];var _0x326c52=createListener('dashboardItem:'+_0x4f7e3d,_0xef3ef4);DashboardItemEvents['on'](_0x4f7e3d,_0x326c52);}}; \ No newline at end of file +var _0x8e7d=['save','remove','update','emit','length','dashboardItem:','./dashboardItem.events'];(function(_0x5400b,_0x55943a){var _0x36a39b=function(_0x56963c){while(--_0x56963c){_0x5400b['push'](_0x5400b['shift']());}};_0x36a39b(++_0x55943a);}(_0x8e7d,0xdf));var _0xd8e7=function(_0x48f2b2,_0x424f6a){_0x48f2b2=_0x48f2b2-0x0;var _0x464438=_0x8e7d[_0x48f2b2];return _0x464438;};'use strict';var DashboardItemEvents=require(_0xd8e7('0x0'));var events=[_0xd8e7('0x1'),_0xd8e7('0x2'),_0xd8e7('0x3')];function createListener(_0x486789,_0x421223){return function(_0x597b12){_0x421223[_0xd8e7('0x4')](_0x486789,_0x597b12);};}function removeListener(_0x51ef21,_0x913f06){return function(){DashboardItemEvents['removeListener'](_0x51ef21,_0x913f06);};}exports['register']=function(_0x433ff5){for(var _0x4cf884=0x0,_0x4a04d2=events[_0xd8e7('0x5')];_0x4cf884<_0x4a04d2;_0x4cf884++){var _0x54d234=events[_0x4cf884];var _0x260454=createListener(_0xd8e7('0x6')+_0x54d234,_0x433ff5);DashboardItemEvents['on'](_0x54d234,_0x260454);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index a2ab5f8..b2a358b 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 _0xe58a=['isAuthenticated','create','put','update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','show'];(function(_0x9ee10f,_0xafc95c){var _0x507077=function(_0x227d80){while(--_0x227d80){_0x9ee10f['push'](_0x9ee10f['shift']());}};_0x507077(++_0xafc95c);}(_0xe58a,0x85));var _0xae58=function(_0x542f22,_0x10db96){_0x542f22=_0x542f22-0x0;var _0x52a182=_0xe58a[_0x542f22];return _0x52a182;};'use strict';var multer=require(_0xae58('0x0'));var util=require(_0xae58('0x1'));var path=require('path');var timeout=require(_0xae58('0x2'));var express=require(_0xae58('0x3'));var router=express[_0xae58('0x4')]();var fs_extra=require(_0xae58('0x5'));var auth=require(_0xae58('0x6'));var interaction=require(_0xae58('0x7'));var config=require(_0xae58('0x8'));var controller=require('./dashboardItem.controller');router['get'](_0xae58('0x9'),auth['isAuthenticated'](),controller[_0xae58('0xa')]);router['post']('/',auth[_0xae58('0xb')](),controller[_0xae58('0xc')]);router[_0xae58('0xd')](_0xae58('0x9'),auth['isAuthenticated'](),controller[_0xae58('0xe')]);router['delete'](_0xae58('0x9'),auth[_0xae58('0xb')](),controller['destroy']);module[_0xae58('0xf')]=router; \ No newline at end of file +var _0xf260=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','create','put','update','exports','multer','util','path'];(function(_0x58fe32,_0x165254){var _0x117f21=function(_0x210e6c){while(--_0x210e6c){_0x58fe32['push'](_0x58fe32['shift']());}};_0x117f21(++_0x165254);}(_0xf260,0x11d));var _0x0f26=function(_0x420513,_0x30eae3){_0x420513=_0x420513-0x0;var _0x1b44ec=_0xf260[_0x420513];return _0x1b44ec;};'use strict';var multer=require(_0x0f26('0x0'));var util=require(_0x0f26('0x1'));var path=require(_0x0f26('0x2'));var timeout=require(_0x0f26('0x3'));var express=require(_0x0f26('0x4'));var router=express[_0x0f26('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0f26('0x6'));var interaction=require(_0x0f26('0x7'));var config=require(_0x0f26('0x8'));var controller=require(_0x0f26('0x9'));router[_0x0f26('0xa')](_0x0f26('0xb'),auth[_0x0f26('0xc')](),controller[_0x0f26('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0f26('0xe')]);router[_0x0f26('0xf')](_0x0f26('0xb'),auth['isAuthenticated'](),controller[_0x0f26('0x10')]);router['delete'](_0x0f26('0xb'),auth[_0x0f26('0xc')](),controller['destroy']);module[_0x0f26('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index e5662fd..d02e507 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 _0x6d4f=['first','second','third','sequelize','exports','STRING','ENUM'];(function(_0x26d636,_0x2f9033){var _0x5c2902=function(_0x23c7c3){while(--_0x23c7c3){_0x26d636['push'](_0x26d636['shift']());}};_0x5c2902(++_0x2f9033);}(_0x6d4f,0x15a));var _0xf6d4=function(_0x543bf6,_0x763bd7){_0x543bf6=_0x543bf6-0x0;var _0x4187b3=_0x6d4f[_0x543bf6];return _0x4187b3;};'use strict';var Sequelize=require(_0xf6d4('0x0'));module[_0xf6d4('0x1')]={'name':{'type':Sequelize[_0xf6d4('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0xf6d4('0x3')](_0xf6d4('0x4'),_0xf6d4('0x5'),_0xf6d4('0x6')),'allowNull':![],'defaultValue':_0xf6d4('0x4')},'description':{'type':Sequelize[_0xf6d4('0x2')]}}; \ No newline at end of file +var _0xe0c2=['second','sequelize','STRING','ENUM','first'];(function(_0x4e90f0,_0x3b7e3c){var _0x1a2cee=function(_0xc0c5f5){while(--_0xc0c5f5){_0x4e90f0['push'](_0x4e90f0['shift']());}};_0x1a2cee(++_0x3b7e3c);}(_0xe0c2,0x1eb));var _0x2e0c=function(_0x3bdbad,_0x5cf453){_0x3bdbad=_0x3bdbad-0x0;var _0x9533e0=_0xe0c2[_0x3bdbad];return _0x9533e0;};'use strict';var Sequelize=require(_0x2e0c('0x0'));module['exports']={'name':{'type':Sequelize[_0x2e0c('0x1')],'allowNull':![]},'level':{'type':Sequelize[_0x2e0c('0x2')](_0x2e0c('0x3'),_0x2e0c('0x4'),'third'),'allowNull':![],'defaultValue':_0x2e0c('0x3')},'description':{'type':Sequelize[_0x2e0c('0x1')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index b6c691c..392aa64 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 _0x5941=['name','send','index','map','Disposition','rawAttributes','type','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','findAll','show','includeAll','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Dispositions','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','get','stack'];(function(_0xbc6b83,_0x35652f){var _0x5ef384=function(_0x407f02){while(--_0x407f02){_0xbc6b83['push'](_0xbc6b83['shift']());}};_0x5ef384(++_0x35652f);}(_0x5941,0x74));var _0x1594=function(_0x590f0c,_0x366f61){_0x590f0c=_0x590f0c-0x0;var _0x5dc4b6=_0x5941[_0x590f0c];return _0x5dc4b6;};'use strict';var emlformat=require(_0x1594('0x0'));var rimraf=require(_0x1594('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1594('0x2'));var rp=require(_0x1594('0x3'));var moment=require(_0x1594('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1594('0x5'));var util=require(_0x1594('0x6'));var path=require('path');var sox=require(_0x1594('0x7'));var csv=require(_0x1594('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1594('0x9'));var _=require(_0x1594('0xa'));var squel=require('squel');var crypto=require(_0x1594('0xb'));var jsforce=require(_0x1594('0xc'));var deskjs=require(_0x1594('0xd'));var toCsv=require(_0x1594('0x8'));var querystring=require(_0x1594('0xe'));var Papa=require('papaparse');var Redis=require(_0x1594('0xf'));var authService=require(_0x1594('0x10'));var qs=require(_0x1594('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1594('0x12'));var logger=require(_0x1594('0x13'))('api');var utils=require(_0x1594('0x14'));var config=require(_0x1594('0x15'));var licenseUtil=require(_0x1594('0x16'));var db=require(_0x1594('0x17'))['db'];function respondWithStatusCode(_0x5d7084,_0x40c68f){_0x40c68f=_0x40c68f||0xcc;return function(_0x12de5a){if(_0x12de5a){return _0x5d7084[_0x1594('0x18')](_0x40c68f);}return _0x5d7084['status'](_0x40c68f)[_0x1594('0x19')]();};}function respondWithResult(_0x16953e,_0x13bdee){_0x13bdee=_0x13bdee||0xc8;return function(_0x2e0c58){if(_0x2e0c58){return _0x16953e[_0x1594('0x1a')](_0x13bdee)[_0x1594('0x1b')](_0x2e0c58);}};}function respondWithFilteredResult(_0x1ba0eb,_0x28ee51){return function(_0x5c9587){if(_0x5c9587){var _0x33063e=typeof _0x28ee51[_0x1594('0x1c')]===_0x1594('0x1d')&&typeof _0x28ee51['limit']==='undefined';var _0x328d69=_0x5c9587[_0x1594('0x1e')];var _0x2926bb=_0x33063e?0x0:_0x28ee51[_0x1594('0x1c')];var _0xe1bb78=_0x33063e?_0x5c9587[_0x1594('0x1e')]:_0x28ee51[_0x1594('0x1c')]+_0x28ee51[_0x1594('0x1f')];var _0x3a6cda;if(_0xe1bb78>=_0x328d69){_0xe1bb78=_0x328d69;_0x3a6cda=0xc8;}else{_0x3a6cda=0xce;}_0x1ba0eb[_0x1594('0x1a')](_0x3a6cda);return _0x1ba0eb[_0x1594('0x20')]('Content-Range',_0x2926bb+'-'+_0xe1bb78+'/'+_0x328d69)[_0x1594('0x1b')](_0x5c9587);}return null;};}function patchUpdates(_0x5a5508){return function(_0x179b8e){try{jsonpatch['apply'](_0x179b8e,_0x5a5508,!![]);}catch(_0x22354e){return BPromise[_0x1594('0x21')](_0x22354e);}return _0x179b8e[_0x1594('0x22')]();};}function saveUpdates(_0x1f3531,_0x5ae541){return function(_0x5b46da){if(_0x5b46da){return _0x5b46da[_0x1594('0x23')](_0x1f3531)[_0x1594('0x24')](function(_0x84fec7){return _0x84fec7;});}return null;};}function removeEntity(_0x412a20,_0x4e6a19){return function(_0x5ec175){if(_0x5ec175){return _0x5ec175[_0x1594('0x25')]()[_0x1594('0x24')](function(){var _0x2fc26e=_0x5ec175[_0x1594('0x26')]({'plain':!![]});var _0x2bf790='Dispositions';return db['UserProfileResource'][_0x1594('0x25')]({'where':{'type':_0x2bf790,'resourceId':_0x2fc26e['id']}})[_0x1594('0x24')](function(){return _0x5ec175;});})[_0x1594('0x24')](function(){_0x412a20[_0x1594('0x1a')](0xcc)[_0x1594('0x19')]();});}};}function handleEntityNotFound(_0x11a7a9,_0x557a78){return function(_0x246fe7){if(!_0x246fe7){_0x11a7a9['sendStatus'](0x194);}return _0x246fe7;};}function handleError(_0x4939a6,_0x57197b){_0x57197b=_0x57197b||0x1f4;return function(_0x12b70e){logger['error'](_0x12b70e[_0x1594('0x27')]);if(_0x12b70e[_0x1594('0x28')]){delete _0x12b70e[_0x1594('0x28')];}_0x4939a6[_0x1594('0x1a')](_0x57197b)[_0x1594('0x29')](_0x12b70e);};}exports[_0x1594('0x2a')]=function(_0x43bcc9,_0x4b9f75){var _0x578335={},_0x93dcf3={},_0x530e42={'count':0x0,'rows':[]};var _0x30a7d=_[_0x1594('0x2b')](db[_0x1594('0x2c')][_0x1594('0x2d')],function(_0x18732e){return{'name':_0x18732e['fieldName'],'type':_0x18732e[_0x1594('0x2e')]['key']};});_0x93dcf3['model']=_[_0x1594('0x2b')](_0x30a7d,_0x1594('0x28'));_0x93dcf3[_0x1594('0x2f')]=_[_0x1594('0x30')](_0x43bcc9[_0x1594('0x2f')]);_0x93dcf3['filters']=_['intersection'](_0x93dcf3[_0x1594('0x31')],_0x93dcf3[_0x1594('0x2f')]);_0x578335[_0x1594('0x32')]=_['intersection'](_0x93dcf3['model'],qs[_0x1594('0x33')](_0x43bcc9[_0x1594('0x2f')]['fields']));_0x578335['attributes']=_0x578335[_0x1594('0x32')][_0x1594('0x34')]?_0x578335['attributes']:_0x93dcf3[_0x1594('0x31')];if(!_0x43bcc9['query'][_0x1594('0x35')](_0x1594('0x36'))){_0x578335[_0x1594('0x1f')]=qs[_0x1594('0x1f')](_0x43bcc9[_0x1594('0x2f')][_0x1594('0x1f')]);_0x578335[_0x1594('0x1c')]=qs[_0x1594('0x1c')](_0x43bcc9[_0x1594('0x2f')][_0x1594('0x1c')]);}_0x578335[_0x1594('0x37')]=qs[_0x1594('0x38')](_0x43bcc9[_0x1594('0x2f')][_0x1594('0x38')]);_0x578335[_0x1594('0x39')]=qs['filters'](_[_0x1594('0x3a')](_0x43bcc9['query'],_0x93dcf3[_0x1594('0x3b')]),_0x30a7d);if(_0x43bcc9[_0x1594('0x2f')][_0x1594('0x3c')]){_0x578335['where']=_[_0x1594('0x3d')](_0x578335[_0x1594('0x39')],{'$or':_[_0x1594('0x2b')](_0x30a7d,function(_0x498950){if(_0x498950['type']!==_0x1594('0x3e')){var _0x39df6b={};_0x39df6b[_0x498950[_0x1594('0x28')]]={'$like':'%'+_0x43bcc9['query'][_0x1594('0x3c')]+'%'};return _0x39df6b;}})});}_0x578335=_[_0x1594('0x3d')]({},_0x578335,_0x43bcc9['options']);var _0x1124aa={'where':_0x578335[_0x1594('0x39')]};return db[_0x1594('0x2c')][_0x1594('0x1e')](_0x1124aa)[_0x1594('0x24')](function(_0x591eab){_0x530e42[_0x1594('0x1e')]=_0x591eab;if(_0x43bcc9[_0x1594('0x2f')]['includeAll']){_0x578335['include']=[{'all':!![]}];}return db[_0x1594('0x2c')][_0x1594('0x3f')](_0x578335);})[_0x1594('0x24')](function(_0x5d6abc){_0x530e42['rows']=_0x5d6abc;return _0x530e42;})[_0x1594('0x24')](respondWithFilteredResult(_0x4b9f75,_0x578335))['catch'](handleError(_0x4b9f75,null));};exports[_0x1594('0x40')]=function(_0x14637e,_0x1ef110){var _0x2011c2={'raw':!![],'where':{'id':_0x14637e['params']['id']}},_0x811ade={};_0x811ade['model']=_['keys'](db[_0x1594('0x2c')][_0x1594('0x2d')]);_0x811ade[_0x1594('0x2f')]=_[_0x1594('0x30')](_0x14637e[_0x1594('0x2f')]);_0x811ade[_0x1594('0x3b')]=_['intersection'](_0x811ade[_0x1594('0x31')],_0x811ade['query']);_0x2011c2['attributes']=_['intersection'](_0x811ade[_0x1594('0x31')],qs[_0x1594('0x33')](_0x14637e[_0x1594('0x2f')][_0x1594('0x33')]));_0x2011c2['attributes']=_0x2011c2[_0x1594('0x32')][_0x1594('0x34')]?_0x2011c2['attributes']:_0x811ade[_0x1594('0x31')];if(_0x14637e[_0x1594('0x2f')][_0x1594('0x41')]){_0x2011c2['include']=[{'all':!![]}];}_0x2011c2=_[_0x1594('0x3d')]({},_0x2011c2,_0x14637e[_0x1594('0x42')]);return db[_0x1594('0x2c')]['find'](_0x2011c2)[_0x1594('0x24')](handleEntityNotFound(_0x1ef110,null))[_0x1594('0x24')](respondWithResult(_0x1ef110,null))[_0x1594('0x43')](handleError(_0x1ef110,null));};exports[_0x1594('0x44')]=function(_0x44a5a8,_0x41af24){return db['Disposition'][_0x1594('0x44')](_0x44a5a8[_0x1594('0x45')],{})[_0x1594('0x24')](function(_0x406bbc){var _0x194a3c=_0x44a5a8['user'][_0x1594('0x26')]({'plain':!![]});if(!_0x194a3c)throw new Error(_0x1594('0x46'));if(_0x194a3c['role']===_0x1594('0x47')){var _0x32dd13=_0x406bbc[_0x1594('0x26')]({'plain':!![]});var _0x122f86=_0x1594('0x48');return db[_0x1594('0x49')][_0x1594('0x4a')]({'where':{'name':_0x122f86,'userProfileId':_0x194a3c['userProfileId']},'raw':!![]})[_0x1594('0x24')](function(_0x499b4d){if(_0x499b4d&&_0x499b4d[_0x1594('0x4b')]===0x0){return db['UserProfileResource']['create']({'name':_0x32dd13[_0x1594('0x28')],'resourceId':_0x32dd13['id'],'type':_0x499b4d[_0x1594('0x28')],'sectionId':_0x499b4d['id']},{})[_0x1594('0x24')](function(){return _0x406bbc;});}else{return _0x406bbc;}})[_0x1594('0x43')](function(_0x1b4418){logger['error'](_0x1594('0x4c'),_0x1b4418);throw _0x1b4418;});}return _0x406bbc;})[_0x1594('0x24')](respondWithResult(_0x41af24,0xc9))[_0x1594('0x43')](handleError(_0x41af24,null));};exports[_0x1594('0x23')]=function(_0x2e035d,_0x2fc36d){if(_0x2e035d[_0x1594('0x45')]['id']){delete _0x2e035d[_0x1594('0x45')]['id'];}return db[_0x1594('0x2c')][_0x1594('0x4a')]({'where':{'id':_0x2e035d[_0x1594('0x4d')]['id']}})[_0x1594('0x24')](handleEntityNotFound(_0x2fc36d,null))[_0x1594('0x24')](saveUpdates(_0x2e035d[_0x1594('0x45')],null))[_0x1594('0x24')](respondWithResult(_0x2fc36d,null))['catch'](handleError(_0x2fc36d,null));};exports[_0x1594('0x25')]=function(_0x46aa15,_0x54b23b){return db[_0x1594('0x2c')]['find']({'where':{'id':_0x46aa15[_0x1594('0x4d')]['id']}})[_0x1594('0x24')](handleEntityNotFound(_0x54b23b,null))[_0x1594('0x24')](removeEntity(_0x54b23b,null))[_0x1594('0x43')](handleError(_0x54b23b,null));}; \ No newline at end of file +var _0x8b17=['where','filters','pick','filter','merge','Disposition','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','Content-Range','apply','save','then','destroy','Dispositions','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort'];(function(_0xdb35ea,_0x34fc65){var _0x20fd09=function(_0x27fec1){while(--_0x27fec1){_0xdb35ea['push'](_0xdb35ea['shift']());}};_0x20fd09(++_0x34fc65);}(_0x8b17,0xbe));var _0x78b1=function(_0x32de22,_0x3e3ebf){_0x32de22=_0x32de22-0x0;var _0x343c85=_0x8b17[_0x32de22];return _0x343c85;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x78b1('0x0'));var zipdir=require(_0x78b1('0x1'));var jsonpatch=require(_0x78b1('0x2'));var rp=require(_0x78b1('0x3'));var moment=require('moment');var BPromise=require(_0x78b1('0x4'));var Mustache=require(_0x78b1('0x5'));var util=require(_0x78b1('0x6'));var path=require(_0x78b1('0x7'));var sox=require(_0x78b1('0x8'));var csv=require('to-csv');var ejs=require(_0x78b1('0x9'));var fs=require('fs');var fs_extra=require(_0x78b1('0xa'));var _=require(_0x78b1('0xb'));var squel=require('squel');var crypto=require(_0x78b1('0xc'));var jsforce=require(_0x78b1('0xd'));var deskjs=require(_0x78b1('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x78b1('0xf'));var Redis=require('ioredis');var authService=require(_0x78b1('0x10'));var qs=require(_0x78b1('0x11'));var as=require(_0x78b1('0x12'));var hardwareService=require(_0x78b1('0x13'));var logger=require(_0x78b1('0x14'))('api');var utils=require(_0x78b1('0x15'));var config=require(_0x78b1('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x78b1('0x17'))['db'];function respondWithStatusCode(_0x62f75a,_0x18b9a9){_0x18b9a9=_0x18b9a9||0xcc;return function(_0x1bfdea){if(_0x1bfdea){return _0x62f75a[_0x78b1('0x18')](_0x18b9a9);}return _0x62f75a[_0x78b1('0x19')](_0x18b9a9)[_0x78b1('0x1a')]();};}function respondWithResult(_0x1c0e69,_0x517b3f){_0x517b3f=_0x517b3f||0xc8;return function(_0x2541cb){if(_0x2541cb){return _0x1c0e69[_0x78b1('0x19')](_0x517b3f)[_0x78b1('0x1b')](_0x2541cb);}};}function respondWithFilteredResult(_0x17ec39,_0x9a5408){return function(_0x2947c5){if(_0x2947c5){var _0xf0798a=typeof _0x9a5408['offset']===_0x78b1('0x1c')&&typeof _0x9a5408[_0x78b1('0x1d')]===_0x78b1('0x1c');var _0x10bfc6=_0x2947c5['count'];var _0x89dff6=_0xf0798a?0x0:_0x9a5408[_0x78b1('0x1e')];var _0xcdbb68=_0xf0798a?_0x2947c5[_0x78b1('0x1f')]:_0x9a5408['offset']+_0x9a5408[_0x78b1('0x1d')];var _0x6bea56;if(_0xcdbb68>=_0x10bfc6){_0xcdbb68=_0x10bfc6;_0x6bea56=0xc8;}else{_0x6bea56=0xce;}_0x17ec39[_0x78b1('0x19')](_0x6bea56);return _0x17ec39['set'](_0x78b1('0x20'),_0x89dff6+'-'+_0xcdbb68+'/'+_0x10bfc6)[_0x78b1('0x1b')](_0x2947c5);}return null;};}function patchUpdates(_0x1dd290){return function(_0x31d29e){try{jsonpatch[_0x78b1('0x21')](_0x31d29e,_0x1dd290,!![]);}catch(_0x462770){return BPromise['reject'](_0x462770);}return _0x31d29e[_0x78b1('0x22')]();};}function saveUpdates(_0x450f85,_0x205e48){return function(_0x3b6a9d){if(_0x3b6a9d){return _0x3b6a9d['update'](_0x450f85)[_0x78b1('0x23')](function(_0x2b3bc6){return _0x2b3bc6;});}return null;};}function removeEntity(_0x5b9455,_0x3fc11f){return function(_0x6be320){if(_0x6be320){return _0x6be320[_0x78b1('0x24')]()[_0x78b1('0x23')](function(){var _0x25e3bc=_0x6be320['get']({'plain':!![]});var _0x52d84f=_0x78b1('0x25');return db[_0x78b1('0x26')]['destroy']({'where':{'type':_0x52d84f,'resourceId':_0x25e3bc['id']}})[_0x78b1('0x23')](function(){return _0x6be320;});})[_0x78b1('0x23')](function(){_0x5b9455[_0x78b1('0x19')](0xcc)[_0x78b1('0x1a')]();});}};}function handleEntityNotFound(_0x15f878,_0x535ad2){return function(_0x8f9fcc){if(!_0x8f9fcc){_0x15f878[_0x78b1('0x18')](0x194);}return _0x8f9fcc;};}function handleError(_0x4f2069,_0x56719f){_0x56719f=_0x56719f||0x1f4;return function(_0x324953){logger[_0x78b1('0x27')](_0x324953[_0x78b1('0x28')]);if(_0x324953[_0x78b1('0x29')]){delete _0x324953[_0x78b1('0x29')];}_0x4f2069[_0x78b1('0x19')](_0x56719f)[_0x78b1('0x2a')](_0x324953);};}exports['index']=function(_0x370cd2,_0x34f637){var _0x4551c7={},_0x2306a9={},_0x6ba592={'count':0x0,'rows':[]};var _0x49510c=_[_0x78b1('0x2b')](db['Disposition'][_0x78b1('0x2c')],function(_0x506f45){return{'name':_0x506f45[_0x78b1('0x2d')],'type':_0x506f45[_0x78b1('0x2e')]['key']};});_0x2306a9[_0x78b1('0x2f')]=_[_0x78b1('0x2b')](_0x49510c,_0x78b1('0x29'));_0x2306a9[_0x78b1('0x30')]=_[_0x78b1('0x31')](_0x370cd2[_0x78b1('0x30')]);_0x2306a9['filters']=_[_0x78b1('0x32')](_0x2306a9[_0x78b1('0x2f')],_0x2306a9['query']);_0x4551c7[_0x78b1('0x33')]=_[_0x78b1('0x32')](_0x2306a9['model'],qs[_0x78b1('0x34')](_0x370cd2[_0x78b1('0x30')][_0x78b1('0x34')]));_0x4551c7[_0x78b1('0x33')]=_0x4551c7[_0x78b1('0x33')]['length']?_0x4551c7[_0x78b1('0x33')]:_0x2306a9[_0x78b1('0x2f')];if(!_0x370cd2[_0x78b1('0x30')][_0x78b1('0x35')]('nolimit')){_0x4551c7[_0x78b1('0x1d')]=qs[_0x78b1('0x1d')](_0x370cd2[_0x78b1('0x30')]['limit']);_0x4551c7[_0x78b1('0x1e')]=qs['offset'](_0x370cd2[_0x78b1('0x30')]['offset']);}_0x4551c7[_0x78b1('0x36')]=qs['sort'](_0x370cd2['query'][_0x78b1('0x37')]);_0x4551c7[_0x78b1('0x38')]=qs[_0x78b1('0x39')](_[_0x78b1('0x3a')](_0x370cd2[_0x78b1('0x30')],_0x2306a9[_0x78b1('0x39')]),_0x49510c);if(_0x370cd2[_0x78b1('0x30')][_0x78b1('0x3b')]){_0x4551c7[_0x78b1('0x38')]=_[_0x78b1('0x3c')](_0x4551c7[_0x78b1('0x38')],{'$or':_[_0x78b1('0x2b')](_0x49510c,function(_0x1387eb){if(_0x1387eb[_0x78b1('0x2e')]!=='VIRTUAL'){var _0x456cd1={};_0x456cd1[_0x1387eb[_0x78b1('0x29')]]={'$like':'%'+_0x370cd2[_0x78b1('0x30')][_0x78b1('0x3b')]+'%'};return _0x456cd1;}})});}_0x4551c7=_[_0x78b1('0x3c')]({},_0x4551c7,_0x370cd2['options']);var _0x844404={'where':_0x4551c7['where']};return db[_0x78b1('0x3d')][_0x78b1('0x1f')](_0x844404)[_0x78b1('0x23')](function(_0xa320dd){_0x6ba592[_0x78b1('0x1f')]=_0xa320dd;if(_0x370cd2[_0x78b1('0x30')][_0x78b1('0x3e')]){_0x4551c7[_0x78b1('0x3f')]=[{'all':!![]}];}return db[_0x78b1('0x3d')][_0x78b1('0x40')](_0x4551c7);})[_0x78b1('0x23')](function(_0x4f79f6){_0x6ba592[_0x78b1('0x41')]=_0x4f79f6;return _0x6ba592;})[_0x78b1('0x23')](respondWithFilteredResult(_0x34f637,_0x4551c7))[_0x78b1('0x42')](handleError(_0x34f637,null));};exports[_0x78b1('0x43')]=function(_0x4cd1ae,_0x3b2448){var _0x2fdcd9={'raw':!![],'where':{'id':_0x4cd1ae[_0x78b1('0x44')]['id']}},_0x221640={};_0x221640[_0x78b1('0x2f')]=_[_0x78b1('0x31')](db[_0x78b1('0x3d')][_0x78b1('0x2c')]);_0x221640[_0x78b1('0x30')]=_[_0x78b1('0x31')](_0x4cd1ae['query']);_0x221640[_0x78b1('0x39')]=_[_0x78b1('0x32')](_0x221640['model'],_0x221640['query']);_0x2fdcd9[_0x78b1('0x33')]=_[_0x78b1('0x32')](_0x221640[_0x78b1('0x2f')],qs[_0x78b1('0x34')](_0x4cd1ae[_0x78b1('0x30')][_0x78b1('0x34')]));_0x2fdcd9[_0x78b1('0x33')]=_0x2fdcd9['attributes'][_0x78b1('0x45')]?_0x2fdcd9[_0x78b1('0x33')]:_0x221640[_0x78b1('0x2f')];if(_0x4cd1ae['query'][_0x78b1('0x3e')]){_0x2fdcd9['include']=[{'all':!![]}];}_0x2fdcd9=_[_0x78b1('0x3c')]({},_0x2fdcd9,_0x4cd1ae[_0x78b1('0x46')]);return db[_0x78b1('0x3d')][_0x78b1('0x47')](_0x2fdcd9)['then'](handleEntityNotFound(_0x3b2448,null))[_0x78b1('0x23')](respondWithResult(_0x3b2448,null))[_0x78b1('0x42')](handleError(_0x3b2448,null));};exports[_0x78b1('0x48')]=function(_0x1e17d2,_0x40cecc){return db[_0x78b1('0x3d')][_0x78b1('0x48')](_0x1e17d2['body'],{})['then'](function(_0x370515){var _0x55e3f7=_0x1e17d2[_0x78b1('0x49')]['get']({'plain':!![]});if(!_0x55e3f7)throw new Error(_0x78b1('0x4a'));if(_0x55e3f7['role']===_0x78b1('0x49')){var _0x220e7b=_0x370515[_0x78b1('0x4b')]({'plain':!![]});var _0x449ac1=_0x78b1('0x25');return db[_0x78b1('0x4c')][_0x78b1('0x47')]({'where':{'name':_0x449ac1,'userProfileId':_0x55e3f7[_0x78b1('0x4d')]},'raw':!![]})['then'](function(_0x58113d){if(_0x58113d&&_0x58113d[_0x78b1('0x4e')]===0x0){return db[_0x78b1('0x26')][_0x78b1('0x48')]({'name':_0x220e7b[_0x78b1('0x29')],'resourceId':_0x220e7b['id'],'type':_0x58113d[_0x78b1('0x29')],'sectionId':_0x58113d['id']},{})[_0x78b1('0x23')](function(){return _0x370515;});}else{return _0x370515;}})['catch'](function(_0x2bb150){logger['error'](_0x78b1('0x4f'),_0x2bb150);throw _0x2bb150;});}return _0x370515;})[_0x78b1('0x23')](respondWithResult(_0x40cecc,0xc9))['catch'](handleError(_0x40cecc,null));};exports[_0x78b1('0x50')]=function(_0x4e81fa,_0x57d845){if(_0x4e81fa[_0x78b1('0x51')]['id']){delete _0x4e81fa['body']['id'];}return db[_0x78b1('0x3d')][_0x78b1('0x47')]({'where':{'id':_0x4e81fa[_0x78b1('0x44')]['id']}})[_0x78b1('0x23')](handleEntityNotFound(_0x57d845,null))[_0x78b1('0x23')](saveUpdates(_0x4e81fa[_0x78b1('0x51')],null))[_0x78b1('0x23')](respondWithResult(_0x57d845,null))[_0x78b1('0x42')](handleError(_0x57d845,null));};exports[_0x78b1('0x24')]=function(_0x3df122,_0x47e74a){return db[_0x78b1('0x3d')][_0x78b1('0x47')]({'where':{'id':_0x3df122[_0x78b1('0x44')]['id']}})[_0x78b1('0x23')](handleEntityNotFound(_0x47e74a,null))[_0x78b1('0x23')](removeEntity(_0x47e74a,null))[_0x78b1('0x42')](handleError(_0x47e74a,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 4a7f02f..82928fb 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 _0x8537=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Disposition','name','ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','name_fax','name_openchannel','OpenchannelAccountId','WhatsappAccountId','lodash','../../config/logger','api'];(function(_0x46db90,_0x267ff5){var _0x153352=function(_0x1e9feb){while(--_0x1e9feb){_0x46db90['push'](_0x46db90['shift']());}};_0x153352(++_0x267ff5);}(_0x8537,0xe3));var _0x7853=function(_0x3eff71,_0x37fc3b){_0x3eff71=_0x3eff71-0x0;var _0xe29c5d=_0x8537[_0x3eff71];return _0xe29c5d;};'use strict';var _=require(_0x7853('0x0'));var util=require('util');var logger=require(_0x7853('0x1'))(_0x7853('0x2'));var moment=require(_0x7853('0x3'));var BPromise=require(_0x7853('0x4'));var rp=require(_0x7853('0x5'));var fs=require('fs');var path=require(_0x7853('0x6'));var rimraf=require(_0x7853('0x7'));var config=require(_0x7853('0x8'));var attributes=require('./disposition.attributes');module[_0x7853('0x9')]=function(_0x45f681,_0x59d52d){return _0x45f681[_0x7853('0xa')](_0x7853('0xb'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0x7853('0xc'),_0x7853('0xd')]},{'unique':!![],'name':_0x7853('0xe'),'fields':[_0x7853('0xc'),_0x7853('0xf')]},{'unique':!![],'name':_0x7853('0x10'),'fields':['name',_0x7853('0x11')]},{'unique':!![],'name':_0x7853('0x12'),'fields':[_0x7853('0xc'),'SmsAccountId']},{'unique':!![],'name':_0x7853('0x13'),'fields':[_0x7853('0xc'),'FaxAccountId']},{'unique':!![],'name':_0x7853('0x14'),'fields':[_0x7853('0xc'),_0x7853('0x15')]},{'unique':!![],'name':'name_whatsapp','fields':[_0x7853('0xc'),_0x7853('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x90e6=['name_chat','ChatWebsiteId','name_sms','FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','lodash','util','../../config/logger','moment','request-promise','path','rimraf','exports','define','Disposition','name_voice','name','ListId'];(function(_0x21326c,_0x10b84b){var _0x379fb1=function(_0x182229){while(--_0x182229){_0x21326c['push'](_0x21326c['shift']());}};_0x379fb1(++_0x10b84b);}(_0x90e6,0xe3));var _0x690e=function(_0x4b1032,_0x36952e){_0x4b1032=_0x4b1032-0x0;var _0x5a1d55=_0x90e6[_0x4b1032];return _0x5a1d55;};'use strict';var _=require(_0x690e('0x0'));var util=require(_0x690e('0x1'));var logger=require(_0x690e('0x2'))('api');var moment=require(_0x690e('0x3'));var BPromise=require('bluebird');var rp=require(_0x690e('0x4'));var fs=require('fs');var path=require(_0x690e('0x5'));var rimraf=require(_0x690e('0x6'));var config=require('../../config/environment');var attributes=require('./disposition.attributes');module[_0x690e('0x7')]=function(_0x17b6e5,_0x463059){return _0x17b6e5[_0x690e('0x8')](_0x690e('0x9'),attributes,{'tableName':'tools_dispositions','paranoid':![],'indexes':[{'unique':!![],'name':_0x690e('0xa'),'fields':[_0x690e('0xb'),_0x690e('0xc')]},{'unique':!![],'name':_0x690e('0xd'),'fields':[_0x690e('0xb'),_0x690e('0xe')]},{'unique':!![],'name':'name_mail','fields':[_0x690e('0xb'),'MailAccountId']},{'unique':!![],'name':_0x690e('0xf'),'fields':[_0x690e('0xb'),'SmsAccountId']},{'unique':!![],'name':'name_fax','fields':[_0x690e('0xb'),_0x690e('0x10')]},{'unique':!![],'name':_0x690e('0x11'),'fields':[_0x690e('0xb'),_0x690e('0x12')]},{'unique':!![],'name':_0x690e('0x13'),'fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 2e6ada1..c4a4c33 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 _0xa9e0=['http','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\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(_0x4dd6c8,_0x551d14){var _0x5ce168=function(_0x5614f1){while(--_0x5614f1){_0x4dd6c8['push'](_0x4dd6c8['shift']());}};_0x5ce168(++_0x551d14);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'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','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\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(_0x190566,_0x2cf04f){var _0x2f42db=function(_0x1769d9){while(--_0x1769d9){_0x190566['push'](_0x190566['shift']());}};_0x2f42db(++_0x2cf04f);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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/disposition/index.js b/server/api/disposition/index.js index cf76f1a..aa278f1 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 _0x3788=['connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./disposition.controller','get','index','/:id','isAuthenticated','show','post','create','update','exports','multer','util','path'];(function(_0x570504,_0x13b26a){var _0x48b63e=function(_0x129c8a){while(--_0x129c8a){_0x570504['push'](_0x570504['shift']());}};_0x48b63e(++_0x13b26a);}(_0x3788,0x1a6));var _0x8378=function(_0x37d567,_0xe34ef6){_0x37d567=_0x37d567-0x0;var _0x5d2a27=_0x3788[_0x37d567];return _0x5d2a27;};'use strict';var multer=require(_0x8378('0x0'));var util=require(_0x8378('0x1'));var path=require(_0x8378('0x2'));var timeout=require(_0x8378('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8378('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8378('0x5'));var config=require(_0x8378('0x6'));var controller=require(_0x8378('0x7'));router[_0x8378('0x8')]('/',auth['isAuthenticated'](),controller[_0x8378('0x9')]);router[_0x8378('0x8')](_0x8378('0xa'),auth[_0x8378('0xb')](),controller[_0x8378('0xc')]);router[_0x8378('0xd')]('/',auth['isAuthenticated'](),controller[_0x8378('0xe')]);router['put'](_0x8378('0xa'),auth[_0x8378('0xb')](),controller[_0x8378('0xf')]);router['delete'](_0x8378('0xa'),auth[_0x8378('0xb')](),controller['destroy']);module[_0x8378('0x10')]=router; \ No newline at end of file +var _0xa569=['util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','/:id','show','create','put','update','delete','exports'];(function(_0x3823fe,_0x5052e4){var _0x1bc34b=function(_0x5947b6){while(--_0x5947b6){_0x3823fe['push'](_0x3823fe['shift']());}};_0x1bc34b(++_0x5052e4);}(_0xa569,0xcc));var _0x9a56=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0xa569[_0x365e54];return _0x13317a;};'use strict';var multer=require('multer');var util=require(_0x9a56('0x0'));var path=require('path');var timeout=require(_0x9a56('0x1'));var express=require(_0x9a56('0x2'));var router=express[_0x9a56('0x3')]();var fs_extra=require(_0x9a56('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9a56('0x5'));var config=require(_0x9a56('0x6'));var controller=require(_0x9a56('0x7'));router[_0x9a56('0x8')]('/',auth[_0x9a56('0x9')](),controller['index']);router['get'](_0x9a56('0xa'),auth[_0x9a56('0x9')](),controller[_0x9a56('0xb')]);router['post']('/',auth[_0x9a56('0x9')](),controller[_0x9a56('0xc')]);router[_0x9a56('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x9a56('0xe')]);router[_0x9a56('0xf')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9a56('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index a1863a0..78fe65e 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 _0x8f64=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','2400','4800','9600','12000','14400','7200','v17,v27,v29','INTEGER','SIP','BOOLEAN'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x8f64,0x69));var _0x48f6=function(_0x3bba27,_0x4416d7){_0x3bba27=_0x3bba27-0x0;var _0x20888c=_0x8f64[_0x3bba27];return _0x20888c;};'use strict';var Sequelize=require(_0x48f6('0x0'));module[_0x48f6('0x1')]={'name':{'type':Sequelize[_0x48f6('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x48f6('0x2')]},'ecm':{'type':Sequelize[_0x48f6('0x3')](_0x48f6('0x4'),'no'),'defaultValue':_0x48f6('0x4')},'headerinfo':{'type':Sequelize[_0x48f6('0x2')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x48f6('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x48f6('0x3')](_0x48f6('0x5'),_0x48f6('0x6'),'7200',_0x48f6('0x7'),_0x48f6('0x8'),_0x48f6('0x9')),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM']('2400','4800',_0x48f6('0xa'),_0x48f6('0x7'),_0x48f6('0x8'),_0x48f6('0x9')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x48f6('0x2')],'defaultValue':_0x48f6('0xb')},'gateway':{'type':Sequelize[_0x48f6('0x2')],'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[_0x48f6('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x48f6('0x3')](_0x48f6('0xd'),'IAX','DADHI','KHOMP'),'defaultValue':_0x48f6('0xd')},'key':{'type':Sequelize[_0x48f6('0x2')],'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[_0x48f6('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x48f6('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x48f6('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x48f6('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x48f6('0xf')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x48f6('0x10'),'set':function(_0x56cd78){if(!_0x56cd78)this['setDataValue'](_0x48f6('0x11'),null);this[_0x48f6('0x12')](_0x48f6('0x13'),_0x56cd78);}}}; \ No newline at end of file +var _0x734a=['9600','14400','4800','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','yes','localstationid','2400','7200'];(function(_0xa80011,_0x3ecd39){var _0x4b41b5=function(_0x104b6b){while(--_0x104b6b){_0xa80011['push'](_0xa80011['shift']());}};_0x4b41b5(++_0x3ecd39);}(_0x734a,0x83));var _0xa734=function(_0x42546d,_0x4b060a){_0x42546d=_0x42546d-0x0;var _0x5cac5b=_0x734a[_0x42546d];return _0x5cac5b;};'use strict';var Sequelize=require(_0xa734('0x0'));module['exports']={'name':{'type':Sequelize[_0xa734('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa734('0x1')]},'ecm':{'type':Sequelize[_0xa734('0x2')](_0xa734('0x3'),'no'),'defaultValue':_0xa734('0x3')},'headerinfo':{'type':Sequelize[_0xa734('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize['STRING'],'unique':_0xa734('0x4')},'minrate':{'type':Sequelize['ENUM'](_0xa734('0x5'),'4800',_0xa734('0x6'),_0xa734('0x7'),'12000',_0xa734('0x8')),'defaultValue':_0xa734('0x9')},'maxrate':{'type':Sequelize[_0xa734('0x2')]('2400',_0xa734('0x9'),'7200',_0xa734('0x7'),'12000',_0xa734('0x8')),'defaultValue':'14400'},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xa734('0xa')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0xa734('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xa734('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xa734('0x2')](_0xa734('0xc'),_0xa734('0xd'),_0xa734('0xe'),_0xa734('0xf')),'defaultValue':_0xa734('0xc')},'key':{'type':Sequelize[_0xa734('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xa734('0x10')],'defaultValue':function(){return _0xa734('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa734('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa734('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa734('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa734('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa734('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa734('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa734('0xb')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa734('0x12')],'defaultValue':![],'comment':_0xa734('0x13'),'set':function(_0x3bb5cb){if(!_0x3bb5cb)this[_0xa734('0x14')](_0xa734('0x15'),null);this[_0xa734('0x14')](_0xa734('0x16'),_0x3bb5cb);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 36cde27..352bde8 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 _0xe695=['addAgents','omit','spread','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','User','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','http','client','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','destroy','FaxAccounts','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','key','keys','query','filters','model','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','include','rows','show','params','Pause','attributes','includeAll','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','FaxAccountId','Disposition','getDispositions','findOne','findAll','removeDispositions','addAnswer','CannedAnswer','removeAnswers','ids','FaxInteraction','addInteraction','getInteractions','CmContact','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll','priority','finally','send','getApplications','context','from-voip-provider','exten','localstationid','app','type','system','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','Wait','ReceiveFax','addAccountApplications','updateAccountApplications','VoiceExtension','bulkCreate','tech','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','server/files/attachments','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s'];(function(_0x265517,_0x4e3929){var _0xd024de=function(_0x801724){while(--_0x801724){_0x265517['push'](_0x265517['shift']());}};_0xd024de(++_0x4e3929);}(_0xe695,0xd0));var _0x5e69=function(_0x14f553,_0x2a4c41){_0x14f553=_0x14f553-0x0;var _0x22165f=_0xe695[_0x14f553];return _0x22165f;};'use strict';var emlformat=require(_0x5e69('0x0'));var rimraf=require(_0x5e69('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e69('0x2'));var rp=require('request-promise');var moment=require(_0x5e69('0x3'));var BPromise=require(_0x5e69('0x4'));var Mustache=require(_0x5e69('0x5'));var util=require(_0x5e69('0x6'));var path=require(_0x5e69('0x7'));var sox=require(_0x5e69('0x8'));var csv=require(_0x5e69('0x9'));var ejs=require(_0x5e69('0xa'));var fs=require('fs');var fs_extra=require(_0x5e69('0xb'));var _=require(_0x5e69('0xc'));var squel=require(_0x5e69('0xd'));var crypto=require('crypto');var jsforce=require(_0x5e69('0xe'));var deskjs=require(_0x5e69('0xf'));var toCsv=require(_0x5e69('0x9'));var querystring=require(_0x5e69('0x10'));var Papa=require('papaparse');var Redis=require(_0x5e69('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5e69('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5e69('0x13'));var config=require(_0x5e69('0x14'));var licenseUtil=require(_0x5e69('0x15'));var db=require(_0x5e69('0x16'))['db'];config[_0x5e69('0x17')]=_[_0x5e69('0x18')](config[_0x5e69('0x17')],{'host':_0x5e69('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5e69('0x17')]));require('./faxAccount.socket')[_0x5e69('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x5e69('0x1b')]({'port':0x232c});var client9002=jayson[_0x5e69('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e5c68,_0x207609,_0x25e0dc,_0x54697f){return new BPromise(function(_0x5eba48,_0x22e43f){var _0x1b25ce=_0x54697f||client;return _0x1b25ce[_0x5e69('0x1d')](_0x2e5c68,_0x25e0dc)[_0x5e69('0x1e')](function(_0x38b01a){logger[_0x5e69('0x1f')](_0x5e69('0x20'),_0x207609,_0x5e69('0x21'));logger[_0x5e69('0x22')](_0x5e69('0x23'),_0x207609,_0x5e69('0x21'),JSON[_0x5e69('0x24')](_0x38b01a));if(_0x38b01a[_0x5e69('0x25')]){if(_0x38b01a[_0x5e69('0x25')]['code']===0x1f4){logger[_0x5e69('0x25')](_0x5e69('0x20'),_0x207609,_0x38b01a['error'][_0x5e69('0x26')]);return _0x22e43f(_0x38b01a['error']['message']);}logger[_0x5e69('0x25')](_0x5e69('0x20'),_0x207609,_0x38b01a[_0x5e69('0x25')][_0x5e69('0x26')]);return _0x5eba48(_0x38b01a['error']['message']);}else{logger[_0x5e69('0x1f')](_0x5e69('0x20'),_0x207609,_0x5e69('0x21'));_0x5eba48(_0x38b01a['result']['message']);}})[_0x5e69('0x27')](function(_0x4069ce){logger['error'](_0x5e69('0x20'),_0x207609,_0x4069ce);_0x22e43f(_0x4069ce);});});}function respondWithStatusCode(_0x1be0ed,_0x2a05b3){_0x2a05b3=_0x2a05b3||0xcc;return function(_0x1c1851){if(_0x1c1851){return _0x1be0ed[_0x5e69('0x28')](_0x2a05b3);}return _0x1be0ed[_0x5e69('0x29')](_0x2a05b3)[_0x5e69('0x2a')]();};}function respondWithResult(_0x297fb3,_0x42c4c8){_0x42c4c8=_0x42c4c8||0xc8;return function(_0x12b91a){if(_0x12b91a){return _0x297fb3['status'](_0x42c4c8)[_0x5e69('0x2b')](_0x12b91a);}};}function respondWithFilteredResult(_0x28cda0,_0x516c43){return function(_0x2328f4){if(_0x2328f4){var _0x2ec0b3=typeof _0x516c43['offset']===_0x5e69('0x2c')&&typeof _0x516c43[_0x5e69('0x2d')]===_0x5e69('0x2c');var _0x470928=_0x2328f4[_0x5e69('0x2e')];var _0x368ef2=_0x2ec0b3?0x0:_0x516c43[_0x5e69('0x2f')];var _0x3f506c=_0x2ec0b3?_0x2328f4[_0x5e69('0x2e')]:_0x516c43['offset']+_0x516c43[_0x5e69('0x2d')];var _0x19981a;if(_0x3f506c>=_0x470928){_0x3f506c=_0x470928;_0x19981a=0xc8;}else{_0x19981a=0xce;}_0x28cda0[_0x5e69('0x29')](_0x19981a);return _0x28cda0[_0x5e69('0x30')](_0x5e69('0x31'),_0x368ef2+'-'+_0x3f506c+'/'+_0x470928)['json'](_0x2328f4);}return null;};}function patchUpdates(_0x5cb7ef){return function(_0x41d8ea){try{jsonpatch['apply'](_0x41d8ea,_0x5cb7ef,!![]);}catch(_0x386a58){return BPromise[_0x5e69('0x32')](_0x386a58);}return _0x41d8ea['save']();};}function saveUpdates(_0x2a361d,_0x289026){return function(_0xfb400e){if(_0xfb400e){return _0xfb400e[_0x5e69('0x33')](_0x2a361d)[_0x5e69('0x1e')](function(_0x12c19d){return _0x12c19d;});}return null;};}function removeEntity(_0x6a01b3,_0x57c5aa){return function(_0x18cd15){if(_0x18cd15){return _0x18cd15[_0x5e69('0x34')]()['then'](function(){var _0x382b0=_0x18cd15['get']({'plain':!![]});var _0x27a310=_0x5e69('0x35');return db[_0x5e69('0x36')][_0x5e69('0x34')]({'where':{'type':_0x27a310,'resourceId':_0x382b0['id']}})['then'](function(){return _0x18cd15;});})['then'](function(){_0x6a01b3[_0x5e69('0x29')](0xcc)[_0x5e69('0x2a')]();});}};}function handleEntityNotFound(_0x5a9e6a,_0x284578){return function(_0x529383){if(!_0x529383){_0x5a9e6a[_0x5e69('0x28')](0x194);}return _0x529383;};}function handleError(_0x4743ac,_0x2d09f4){_0x2d09f4=_0x2d09f4||0x1f4;return function(_0x30964e){logger[_0x5e69('0x25')](_0x30964e[_0x5e69('0x37')]);if(_0x30964e[_0x5e69('0x38')]){delete _0x30964e[_0x5e69('0x38')];}_0x4743ac[_0x5e69('0x29')](_0x2d09f4)['send'](_0x30964e);};}exports[_0x5e69('0x39')]=function(_0x41b3f5,_0x4f99a8){var _0x51f6a7={'include':[{'model':db['Pause'],'as':_0x5e69('0x3a')}]},_0x5c0572={},_0x39b28e={'count':0x0,'rows':[]};var _0xcf145c=_[_0x5e69('0x3b')](db[_0x5e69('0x3c')][_0x5e69('0x3d')],function(_0x260695){return{'name':_0x260695[_0x5e69('0x3e')],'type':_0x260695['type'][_0x5e69('0x3f')]};});_0x5c0572['model']=_['map'](_0xcf145c,'name');_0x5c0572['query']=_[_0x5e69('0x40')](_0x41b3f5[_0x5e69('0x41')]);_0x5c0572[_0x5e69('0x42')]=_['intersection'](_0x5c0572[_0x5e69('0x43')],_0x5c0572['query']);_0x51f6a7['attributes']=_[_0x5e69('0x44')](_0x5c0572[_0x5e69('0x43')],qs[_0x5e69('0x45')](_0x41b3f5[_0x5e69('0x41')]['fields']));_0x51f6a7['attributes']=_0x51f6a7['attributes'][_0x5e69('0x46')]?_0x51f6a7['attributes']:_0x5c0572['model'];if(!_0x41b3f5[_0x5e69('0x41')][_0x5e69('0x47')](_0x5e69('0x48'))){_0x51f6a7[_0x5e69('0x2d')]=qs['limit'](_0x41b3f5[_0x5e69('0x41')][_0x5e69('0x2d')]);_0x51f6a7[_0x5e69('0x2f')]=qs[_0x5e69('0x2f')](_0x41b3f5[_0x5e69('0x41')][_0x5e69('0x2f')]);}_0x51f6a7[_0x5e69('0x49')]=qs[_0x5e69('0x4a')](_0x41b3f5['query'][_0x5e69('0x4a')]);_0x51f6a7['where']=qs['filters'](_[_0x5e69('0x4b')](_0x41b3f5[_0x5e69('0x41')],_0x5c0572[_0x5e69('0x42')]),_0xcf145c);if(_0x41b3f5[_0x5e69('0x41')][_0x5e69('0x4c')]){_0x51f6a7[_0x5e69('0x4d')]=_[_0x5e69('0x4e')](_0x51f6a7['where'],{'$or':_[_0x5e69('0x3b')](_0xcf145c,function(_0x2c68f4){if(_0x2c68f4['type']!==_0x5e69('0x4f')){var _0x352eaf={};_0x352eaf[_0x2c68f4[_0x5e69('0x38')]]={'$like':'%'+_0x41b3f5[_0x5e69('0x41')][_0x5e69('0x4c')]+'%'};return _0x352eaf;}})});}_0x51f6a7=_['merge']({},_0x51f6a7,_0x41b3f5['options']);var _0x299b5a={'where':_0x51f6a7['where']};return db[_0x5e69('0x3c')][_0x5e69('0x2e')](_0x299b5a)['then'](function(_0x294ae7){_0x39b28e[_0x5e69('0x2e')]=_0x294ae7;if(_0x41b3f5['query']['includeAll']){_0x51f6a7[_0x5e69('0x50')]=[{'all':!![]}];}return db[_0x5e69('0x3c')]['findAll'](_0x51f6a7);})['then'](function(_0x1c3d81){_0x39b28e[_0x5e69('0x51')]=_0x1c3d81;return _0x39b28e;})['then'](respondWithFilteredResult(_0x4f99a8,_0x51f6a7))['catch'](handleError(_0x4f99a8,null));};exports[_0x5e69('0x52')]=function(_0x4c33df,_0x4609c7){var _0x21831c={'raw':![],'where':{'id':_0x4c33df[_0x5e69('0x53')]['id']},'include':[{'model':db[_0x5e69('0x54')],'as':_0x5e69('0x3a')}]},_0x4f589a={};_0x4f589a['model']=_[_0x5e69('0x40')](db[_0x5e69('0x3c')][_0x5e69('0x3d')]);_0x4f589a['query']=_[_0x5e69('0x40')](_0x4c33df[_0x5e69('0x41')]);_0x4f589a[_0x5e69('0x42')]=_['intersection'](_0x4f589a[_0x5e69('0x43')],_0x4f589a[_0x5e69('0x41')]);_0x21831c[_0x5e69('0x55')]=_[_0x5e69('0x44')](_0x4f589a[_0x5e69('0x43')],qs[_0x5e69('0x45')](_0x4c33df[_0x5e69('0x41')][_0x5e69('0x45')]));_0x21831c[_0x5e69('0x55')]=_0x21831c[_0x5e69('0x55')][_0x5e69('0x46')]?_0x21831c['attributes']:_0x4f589a[_0x5e69('0x43')];if(_0x4c33df[_0x5e69('0x41')][_0x5e69('0x56')]){_0x21831c[_0x5e69('0x50')]=[{'all':!![]}];}_0x21831c=_[_0x5e69('0x4e')]({},_0x21831c,_0x4c33df[_0x5e69('0x57')]);return db[_0x5e69('0x3c')][_0x5e69('0x58')](_0x21831c)[_0x5e69('0x1e')](handleEntityNotFound(_0x4609c7,null))[_0x5e69('0x1e')](respondWithResult(_0x4609c7,null))['catch'](handleError(_0x4609c7,null));};exports[_0x5e69('0x59')]=function(_0x36f8cb,_0x6ad79e){return db[_0x5e69('0x3c')][_0x5e69('0x59')](_0x36f8cb[_0x5e69('0x5a')],{})[_0x5e69('0x1e')](function(_0x5b7bb3){var _0x150c8f=_0x36f8cb[_0x5e69('0x5b')][_0x5e69('0x5c')]({'plain':!![]});if(!_0x150c8f)throw new Error(_0x5e69('0x5d'));if(_0x150c8f[_0x5e69('0x5e')]==='user'){var _0x2d9eaa=_0x5b7bb3[_0x5e69('0x5c')]({'plain':!![]});var _0x37113c=_0x5e69('0x35');return db[_0x5e69('0x5f')][_0x5e69('0x58')]({'where':{'name':_0x37113c,'userProfileId':_0x150c8f[_0x5e69('0x60')]},'raw':!![]})[_0x5e69('0x1e')](function(_0x477742){if(_0x477742&&_0x477742[_0x5e69('0x61')]===0x0){return db[_0x5e69('0x36')][_0x5e69('0x59')]({'name':_0x2d9eaa[_0x5e69('0x38')],'resourceId':_0x2d9eaa['id'],'type':_0x477742[_0x5e69('0x38')],'sectionId':_0x477742['id']},{})[_0x5e69('0x1e')](function(){return _0x5b7bb3;});}else{return _0x5b7bb3;}})[_0x5e69('0x27')](function(_0x45281c){logger[_0x5e69('0x25')](_0x5e69('0x62'),_0x45281c);throw _0x45281c;});}return _0x5b7bb3;})[_0x5e69('0x1e')](respondWithResult(_0x6ad79e,0xc9))['catch'](handleError(_0x6ad79e,null));};exports[_0x5e69('0x33')]=function(_0x307ea7,_0xb3a4f3){if(_0x307ea7[_0x5e69('0x5a')]['id']){delete _0x307ea7[_0x5e69('0x5a')]['id'];}return db[_0x5e69('0x3c')][_0x5e69('0x58')]({'where':{'id':_0x307ea7[_0x5e69('0x53')]['id']},'include':[{'model':db[_0x5e69('0x54')],'as':_0x5e69('0x3a')}]})[_0x5e69('0x1e')](handleEntityNotFound(_0xb3a4f3,null))['then'](saveUpdates(_0x307ea7[_0x5e69('0x5a')],null))['then'](respondWithResult(_0xb3a4f3,null))[_0x5e69('0x27')](handleError(_0xb3a4f3,null));};exports[_0x5e69('0x34')]=function(_0xbe1b32,_0x55ac22){return db[_0x5e69('0x3c')][_0x5e69('0x58')]({'where':{'id':_0xbe1b32[_0x5e69('0x53')]['id']}})[_0x5e69('0x1e')](handleEntityNotFound(_0x55ac22,null))[_0x5e69('0x1e')](removeEntity(_0x55ac22,null))[_0x5e69('0x27')](handleError(_0x55ac22,null));};exports[_0x5e69('0x63')]=function(_0x331a3f,_0x12fd44){return db['FaxAccount'][_0x5e69('0x63')]()[_0x5e69('0x1e')](respondWithResult(_0x12fd44,null))[_0x5e69('0x27')](handleError(_0x12fd44,null));};exports['addDisposition']=function(_0x683aaa,_0x4919db,_0x3ec1e0){if(_0x683aaa['body']['id']){delete _0x683aaa[_0x5e69('0x5a')]['id'];}return db['FaxAccount'][_0x5e69('0x58')]({'where':{'id':_0x683aaa[_0x5e69('0x53')]['id']}})[_0x5e69('0x1e')](handleEntityNotFound(_0x4919db,null))[_0x5e69('0x1e')](function(_0xe1d7b4){if(_0xe1d7b4){_0x683aaa['body'][_0x5e69('0x64')]=_0xe1d7b4['id'];return db[_0x5e69('0x65')][_0x5e69('0x59')](_0x683aaa[_0x5e69('0x5a')]);}})[_0x5e69('0x1e')](respondWithResult(_0x4919db,null))[_0x5e69('0x27')](handleError(_0x4919db,null));};exports[_0x5e69('0x66')]=function(_0x55a97f,_0x2a91ba,_0x42e3d8){var _0x3a040a={'raw':![],'where':{}};var _0x350382={};var _0x124b9b={'count':0x0,'rows':[]};return db[_0x5e69('0x3c')][_0x5e69('0x67')]({'where':{'id':_0x55a97f['params']['id']}})[_0x5e69('0x1e')](handleEntityNotFound(_0x2a91ba,null))[_0x5e69('0x1e')](function(_0x4475ff){if(_0x4475ff){_0x350382[_0x5e69('0x43')]=_[_0x5e69('0x40')](db[_0x5e69('0x65')][_0x5e69('0x3d')]);_0x350382[_0x5e69('0x41')]=_[_0x5e69('0x40')](_0x55a97f[_0x5e69('0x41')]);_0x350382[_0x5e69('0x42')]=_[_0x5e69('0x44')](_0x350382[_0x5e69('0x43')],_0x350382[_0x5e69('0x41')]);_0x3a040a[_0x5e69('0x55')]=_[_0x5e69('0x44')](_0x350382[_0x5e69('0x43')],qs['fields'](_0x55a97f['query']['fields']));_0x3a040a[_0x5e69('0x55')]=_0x3a040a['attributes'][_0x5e69('0x46')]?_0x3a040a[_0x5e69('0x55')]:_0x350382[_0x5e69('0x43')];if(!_0x55a97f['query'][_0x5e69('0x47')](_0x5e69('0x48'))){_0x3a040a[_0x5e69('0x2d')]=qs[_0x5e69('0x2d')](_0x55a97f['query'][_0x5e69('0x2d')]);_0x3a040a[_0x5e69('0x2f')]=qs['offset'](_0x55a97f['query'][_0x5e69('0x2f')]);}_0x3a040a['order']=qs[_0x5e69('0x4a')](_0x55a97f[_0x5e69('0x41')][_0x5e69('0x4a')]);_0x3a040a['where']=qs[_0x5e69('0x42')](_[_0x5e69('0x4b')](_0x55a97f[_0x5e69('0x41')],_0x350382['filters']));_0x3a040a[_0x5e69('0x4d')][_0x5e69('0x64')]=_0x4475ff['id'];if(_0x55a97f['query']['filter']){_0x3a040a[_0x5e69('0x4d')]=_['merge'](_0x3a040a['where'],{'$or':_['map'](_0x3a040a['attributes'],function(_0x3b6c47){var _0x414380={};_0x414380[_0x3b6c47]={'$like':'%'+_0x55a97f[_0x5e69('0x41')][_0x5e69('0x4c')]+'%'};return _0x414380;})});}_0x3a040a=_[_0x5e69('0x4e')]({},_0x3a040a,_0x55a97f[_0x5e69('0x57')]);return db[_0x5e69('0x65')][_0x5e69('0x2e')]({'where':_0x3a040a[_0x5e69('0x4d')]})[_0x5e69('0x1e')](function(_0x4ea1cb){_0x124b9b[_0x5e69('0x2e')]=_0x4ea1cb;if(_0x55a97f[_0x5e69('0x41')][_0x5e69('0x56')]){_0x3a040a['include']=[{'all':!![]}];}return db['Disposition'][_0x5e69('0x68')](_0x3a040a);})[_0x5e69('0x1e')](function(_0x3e5efb){_0x124b9b[_0x5e69('0x51')]=_0x3e5efb;return _0x124b9b;});}})['then'](respondWithFilteredResult(_0x2a91ba,_0x3a040a))[_0x5e69('0x27')](handleError(_0x2a91ba,null));};exports['removeDispositions']=function(_0x411841,_0x17dd1a,_0x52f7bb){return db[_0x5e69('0x3c')][_0x5e69('0x58')]({'where':{'id':_0x411841[_0x5e69('0x53')]['id']}})[_0x5e69('0x1e')](handleEntityNotFound(_0x17dd1a,null))[_0x5e69('0x1e')](function(_0x5bf625){if(_0x5bf625){return _0x5bf625[_0x5e69('0x69')](_0x411841[_0x5e69('0x41')]['ids']);}})['then'](respondWithStatusCode(_0x17dd1a,null))[_0x5e69('0x27')](handleError(_0x17dd1a,null));};exports[_0x5e69('0x6a')]=function(_0x195785,_0x5c1343,_0x24ca37){if(_0x195785[_0x5e69('0x5a')]['id']){delete _0x195785[_0x5e69('0x5a')]['id'];}return db[_0x5e69('0x3c')]['find']({'where':{'id':_0x195785[_0x5e69('0x53')]['id']}})[_0x5e69('0x1e')](handleEntityNotFound(_0x5c1343,null))[_0x5e69('0x1e')](function(_0x2df7e9){if(_0x2df7e9){_0x195785[_0x5e69('0x5a')]['FaxAccountId']=_0x2df7e9['id'];return db[_0x5e69('0x6b')][_0x5e69('0x59')](_0x195785[_0x5e69('0x5a')]);}})[_0x5e69('0x1e')](respondWithResult(_0x5c1343,null))[_0x5e69('0x27')](handleError(_0x5c1343,null));};exports['getAnswers']=function(_0x7e7a99,_0x2d7c9b,_0x1fe5ee){var _0x10ad1f={'raw':![],'where':{}};var _0xc09c={};var _0x2232f2={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x7e7a99[_0x5e69('0x53')]['id']}})[_0x5e69('0x1e')](handleEntityNotFound(_0x2d7c9b,null))[_0x5e69('0x1e')](function(_0xe4fe8){if(_0xe4fe8){_0xc09c['model']=_[_0x5e69('0x40')](db[_0x5e69('0x6b')][_0x5e69('0x3d')]);_0xc09c[_0x5e69('0x41')]=_[_0x5e69('0x40')](_0x7e7a99['query']);_0xc09c[_0x5e69('0x42')]=_[_0x5e69('0x44')](_0xc09c['model'],_0xc09c['query']);_0x10ad1f[_0x5e69('0x55')]=_[_0x5e69('0x44')](_0xc09c[_0x5e69('0x43')],qs[_0x5e69('0x45')](_0x7e7a99[_0x5e69('0x41')][_0x5e69('0x45')]));_0x10ad1f[_0x5e69('0x55')]=_0x10ad1f['attributes']['length']?_0x10ad1f[_0x5e69('0x55')]:_0xc09c[_0x5e69('0x43')];if(!_0x7e7a99['query'][_0x5e69('0x47')](_0x5e69('0x48'))){_0x10ad1f['limit']=qs[_0x5e69('0x2d')](_0x7e7a99[_0x5e69('0x41')]['limit']);_0x10ad1f[_0x5e69('0x2f')]=qs[_0x5e69('0x2f')](_0x7e7a99[_0x5e69('0x41')]['offset']);}_0x10ad1f[_0x5e69('0x49')]=qs['sort'](_0x7e7a99[_0x5e69('0x41')]['sort']);_0x10ad1f[_0x5e69('0x4d')]=qs[_0x5e69('0x42')](_[_0x5e69('0x4b')](_0x7e7a99[_0x5e69('0x41')],_0xc09c['filters']));_0x10ad1f[_0x5e69('0x4d')]['FaxAccountId']=_0xe4fe8['id'];if(_0x7e7a99['query'][_0x5e69('0x4c')]){_0x10ad1f[_0x5e69('0x4d')]=_['merge'](_0x10ad1f[_0x5e69('0x4d')],{'$or':_[_0x5e69('0x3b')](_0x10ad1f[_0x5e69('0x55')],function(_0x5b3aab){var _0x2db7c2={};_0x2db7c2[_0x5b3aab]={'$like':'%'+_0x7e7a99[_0x5e69('0x41')]['filter']+'%'};return _0x2db7c2;})});}_0x10ad1f=_['merge']({},_0x10ad1f,_0x7e7a99[_0x5e69('0x57')]);return db[_0x5e69('0x6b')][_0x5e69('0x2e')]({'where':_0x10ad1f[_0x5e69('0x4d')]})[_0x5e69('0x1e')](function(_0x121774){_0x2232f2[_0x5e69('0x2e')]=_0x121774;if(_0x7e7a99[_0x5e69('0x41')][_0x5e69('0x56')]){_0x10ad1f[_0x5e69('0x50')]=[{'all':!![]}];}return db['CannedAnswer'][_0x5e69('0x68')](_0x10ad1f);})[_0x5e69('0x1e')](function(_0x20c7c5){_0x2232f2[_0x5e69('0x51')]=_0x20c7c5;return _0x2232f2;});}})[_0x5e69('0x1e')](respondWithFilteredResult(_0x2d7c9b,_0x10ad1f))['catch'](handleError(_0x2d7c9b,null));};exports[_0x5e69('0x6c')]=function(_0xe32600,_0x11cd7e,_0x337ad0){return db['FaxAccount'][_0x5e69('0x58')]({'where':{'id':_0xe32600[_0x5e69('0x53')]['id']}})[_0x5e69('0x1e')](handleEntityNotFound(_0x11cd7e,null))[_0x5e69('0x1e')](function(_0x1980af){if(_0x1980af){return _0x1980af[_0x5e69('0x6c')](_0xe32600[_0x5e69('0x41')][_0x5e69('0x6d')]);}})[_0x5e69('0x1e')](respondWithStatusCode(_0x11cd7e,null))['catch'](handleError(_0x11cd7e,null));};exports['addInteraction']=function(_0x331bc3,_0x3db60e,_0x50992e){return db[_0x5e69('0x6e')][_0x5e69('0x58')]({'where':{'id':_0x331bc3['params']['id']}})[_0x5e69('0x1e')](handleEntityNotFound(_0x3db60e,null))[_0x5e69('0x1e')](function(_0x52f7b7){if(_0x52f7b7){return _0x52f7b7[_0x5e69('0x6f')](_0x331bc3[_0x5e69('0x5a')][_0x5e69('0x6d')],_['omit'](_0x331bc3['body'],[_0x5e69('0x6d'),'id'])||{});}})[_0x5e69('0x1e')](respondWithResult(_0x3db60e,null))[_0x5e69('0x27')](handleError(_0x3db60e,null));};exports[_0x5e69('0x70')]=function(_0x13a43e,_0x1c465a,_0x17b393){var _0x46939a={'raw':![],'where':{}};var _0x1f5b3b={};var _0x78ee2f={'count':0x0,'rows':[]};return db[_0x5e69('0x3c')][_0x5e69('0x67')]({'where':{'id':_0x13a43e[_0x5e69('0x53')]['id']}})[_0x5e69('0x1e')](handleEntityNotFound(_0x1c465a,null))[_0x5e69('0x1e')](function(_0x3baf06){if(_0x3baf06){_0x1f5b3b['model']=_[_0x5e69('0x40')](db[_0x5e69('0x6e')]['rawAttributes']);_0x1f5b3b[_0x5e69('0x41')]=_['keys'](_0x13a43e[_0x5e69('0x41')]);_0x1f5b3b[_0x5e69('0x42')]=_[_0x5e69('0x44')](_0x1f5b3b[_0x5e69('0x43')],_0x1f5b3b['query']);_0x46939a['attributes']=_[_0x5e69('0x44')](_0x1f5b3b[_0x5e69('0x43')],qs[_0x5e69('0x45')](_0x13a43e['query'][_0x5e69('0x45')]));_0x46939a[_0x5e69('0x55')]=_0x46939a['attributes'][_0x5e69('0x46')]?_0x46939a['attributes']:_0x1f5b3b[_0x5e69('0x43')];if(!_0x13a43e[_0x5e69('0x41')]['hasOwnProperty'](_0x5e69('0x48'))){_0x46939a[_0x5e69('0x2d')]=qs['limit'](_0x13a43e[_0x5e69('0x41')][_0x5e69('0x2d')]);_0x46939a[_0x5e69('0x2f')]=qs[_0x5e69('0x2f')](_0x13a43e[_0x5e69('0x41')][_0x5e69('0x2f')]);}_0x46939a['order']=qs[_0x5e69('0x4a')](_0x13a43e[_0x5e69('0x41')][_0x5e69('0x4a')]);_0x46939a[_0x5e69('0x4d')]=qs[_0x5e69('0x42')](_[_0x5e69('0x4b')](_0x13a43e[_0x5e69('0x41')],_0x1f5b3b['filters']));_0x46939a[_0x5e69('0x4d')][_0x5e69('0x64')]=_0x3baf06['id'];if(_0x13a43e['query']['filter']){_0x46939a[_0x5e69('0x4d')]=_[_0x5e69('0x4e')](_0x46939a[_0x5e69('0x4d')],{'$or':_[_0x5e69('0x3b')](_0x46939a[_0x5e69('0x55')],function(_0x4ee006){var _0xe4dce9={};_0xe4dce9[_0x4ee006]={'$like':'%'+_0x13a43e[_0x5e69('0x41')][_0x5e69('0x4c')]+'%'};return _0xe4dce9;})});}_0x46939a=_[_0x5e69('0x4e')]({},_0x46939a,_0x13a43e[_0x5e69('0x57')]);return db[_0x5e69('0x6e')][_0x5e69('0x2e')]({'where':_0x46939a['where']})[_0x5e69('0x1e')](function(_0x14943e){_0x78ee2f[_0x5e69('0x2e')]=_0x14943e;if(_0x13a43e[_0x5e69('0x41')]['includeAll']){_0x46939a[_0x5e69('0x50')]=[{'model':db[_0x5e69('0x71')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x5e69('0x72'),'attributes':[_0x5e69('0x38'),_0x5e69('0x73'),_0x5e69('0x74')],'required':![]},{'model':db[_0x5e69('0x75')],'as':_0x5e69('0x76'),'attributes':['id',_0x5e69('0x38'),_0x5e69('0x77')],'where':_0x13a43e['query'][_0x5e69('0x78')]?{'id':_0x13a43e[_0x5e69('0x41')][_0x5e69('0x78')]}:undefined,'required':_0x13a43e[_0x5e69('0x41')][_0x5e69('0x78')]?!![]:![]}];}return db['FaxInteraction'][_0x5e69('0x68')](_0x46939a);})[_0x5e69('0x1e')](function(_0x57ded4){_0x78ee2f[_0x5e69('0x51')]=_0x57ded4;return _0x78ee2f;});}})[_0x5e69('0x1e')](respondWithFilteredResult(_0x1c465a,_0x46939a))[_0x5e69('0x27')](handleError(_0x1c465a,null));};exports[_0x5e69('0x79')]=function(_0x3b7b84,_0x3f5235){var _0x6b6b00=_0x3b7b84[_0x5e69('0x53')]['id'];var _0x5a9068=_0x3b7b84[_0x5e69('0x5a')];var _0x585077=0xc8;var _0x59ae05=null;return db['sequelize'][_0x5e69('0x7a')]({'isolationLevel':db[_0x5e69('0x7b')][_0x5e69('0x7c')][_0x5e69('0x7d')][_0x5e69('0x7e')]},function(_0xc74076){return db['FaxAccount'][_0x5e69('0x67')]({'where':{'id':_0x6b6b00},'transaction':_0xc74076})['then'](function(_0x266201){if(_0x266201){return db[_0x5e69('0x7f')][_0x5e69('0x34')]({'where':{'FaxAccountId':_0x6b6b00},'transaction':_0xc74076})[_0x5e69('0x1e')](function(){var _0x36f0db=_[_0x5e69('0x3b')](_0x5a9068,function(_0x6c8a32){_0x6c8a32['FaxAccountId']=_0x6b6b00;return _0x6c8a32;});return db[_0x5e69('0x7f')]['bulkCreate'](_0x36f0db,{'transaction':_0xc74076});});}else{_0x585077=0x194;_0x59ae05=[];}});})[_0x5e69('0x1e')](function(){if(_0x585077!==0x194){return db[_0x5e69('0x7f')][_0x5e69('0x80')]({'where':{'FaxAccountId':_0x6b6b00},'order':_0x5e69('0x81')})['then'](function(_0x494989){_0x59ae05=_0x494989;});}})[_0x5e69('0x27')](function(_0x2db16a){_0x585077=0x1f4;logger['error'](_0x2db16a[_0x5e69('0x37')]);if(_0x2db16a[_0x5e69('0x38')]){delete _0x2db16a[_0x5e69('0x38')];}_0x59ae05=_0x2db16a;})[_0x5e69('0x82')](function(){if(_0x59ae05===null){_0x3f5235['sendStatus'](_0x585077);}else{if(_0x585077===0x1f4){_0x3f5235[_0x5e69('0x29')](_0x585077)[_0x5e69('0x83')](_0x59ae05);}else{_0x3f5235['status'](_0x585077)[_0x5e69('0x2b')](_0x59ae05);}}});};exports[_0x5e69('0x84')]=function(_0x51a54d,_0x41a006,_0x385398){var _0x3a21ae={};var _0x4eed1c={};var _0x1221ad;var _0x17801f;return db[_0x5e69('0x3c')][_0x5e69('0x67')]({'where':{'id':_0x51a54d[_0x5e69('0x53')]['id']}})['then'](handleEntityNotFound(_0x41a006,null))[_0x5e69('0x1e')](function(_0x5d75e5){if(_0x5d75e5){_0x1221ad=_0x5d75e5;_0x4eed1c[_0x5e69('0x43')]=_['keys'](db[_0x5e69('0x7f')]['rawAttributes']);_0x4eed1c['query']=_[_0x5e69('0x40')](_0x51a54d['query']);_0x4eed1c['filters']=_[_0x5e69('0x44')](_0x4eed1c[_0x5e69('0x43')],_0x4eed1c['query']);_0x3a21ae[_0x5e69('0x55')]=_[_0x5e69('0x44')](_0x4eed1c[_0x5e69('0x43')],qs['fields'](_0x51a54d[_0x5e69('0x41')][_0x5e69('0x45')]));_0x3a21ae[_0x5e69('0x55')]=_0x3a21ae[_0x5e69('0x55')][_0x5e69('0x46')]?_0x3a21ae['attributes']:_0x4eed1c[_0x5e69('0x43')];_0x3a21ae[_0x5e69('0x49')]=qs[_0x5e69('0x4a')](_0x51a54d['query'][_0x5e69('0x4a')]);_0x3a21ae[_0x5e69('0x4d')]=qs[_0x5e69('0x42')](_['pick'](_0x51a54d[_0x5e69('0x41')],_0x4eed1c[_0x5e69('0x42')]));if(_0x51a54d[_0x5e69('0x41')]['filter']){_0x3a21ae[_0x5e69('0x4d')]=_[_0x5e69('0x4e')](_0x3a21ae[_0x5e69('0x4d')],{'$or':_['map'](_0x3a21ae['attributes'],function(_0x3c5f01){var _0xba0dc3={};_0xba0dc3[_0x3c5f01]={'$like':'%'+_0x51a54d[_0x5e69('0x41')][_0x5e69('0x4c')]+'%'};return _0xba0dc3;})});}_0x3a21ae=_['merge']({},_0x3a21ae,_0x51a54d[_0x5e69('0x57')]);return _0x1221ad[_0x5e69('0x84')](_0x3a21ae);}})[_0x5e69('0x1e')](function(_0x2e4fb8){if(_0x2e4fb8){_0x17801f=_0x2e4fb8[_0x5e69('0x46')];if(!_0x51a54d[_0x5e69('0x41')][_0x5e69('0x47')](_0x5e69('0x48'))){_0x3a21ae[_0x5e69('0x2d')]=qs[_0x5e69('0x2d')](_0x51a54d[_0x5e69('0x41')][_0x5e69('0x2d')]);_0x3a21ae[_0x5e69('0x2f')]=qs[_0x5e69('0x2f')](_0x51a54d['query']['offset']);}return _0x1221ad['getApplications'](_0x3a21ae);}})[_0x5e69('0x1e')](function(_0x448a37){if(_0x448a37){return _0x448a37?{'count':_0x17801f,'rows':_0x448a37}:null;}})[_0x5e69('0x1e')](respondWithResult(_0x41a006,null))[_0x5e69('0x27')](handleError(_0x41a006,null));};function Extension(_0x4c8d0d,_0x26b8df,_0x2812cf,_0x40dcca){this[_0x5e69('0x85')]=_0x5e69('0x86');this[_0x5e69('0x87')]=_0x4c8d0d[_0x5e69('0x88')];this[_0x5e69('0x89')]=_0x40dcca;this[_0x5e69('0x8a')]=_0x5e69('0x8b');this['description']=_0x5e69('0x8c');this[_0x5e69('0x64')]=_0x4c8d0d['id'];this['priority']=_0x26b8df;this[_0x5e69('0x8d')]=_0x2812cf;}function createExtensionsReciveFax(_0x350023){var _0x46ae68=0x1;var _0x4b1348=[];_0x4b1348[_0x5e69('0x8e')](new Extension(_0x350023,_0x46ae68,'',_0x5e69('0x8f')));_0x46ae68+=0x1;_0x4b1348[_0x5e69('0x8e')](new Extension(_0x350023,_0x46ae68,_0x5e69('0x90'),_0x5e69('0x91')));_0x46ae68+=0x1;for(var _0x302ade in _0x350023){if(_0x350023[_0x5e69('0x47')](_0x302ade)&&(_0x302ade===_0x5e69('0x92')||_0x302ade===_0x5e69('0x88')||_0x302ade===_0x5e69('0x93')||_0x302ade===_0x5e69('0x94')||_0x302ade===_0x5e69('0x95')||_0x302ade===_0x5e69('0x96')||_0x302ade===_0x5e69('0x97')||_0x302ade===_0x5e69('0x98')||_0x302ade===_0x5e69('0x99'))){_0x4b1348['push'](new Extension(_0x350023,_0x46ae68,'FAXOPT('+_0x302ade+')='+_0x350023[_0x302ade],'Set'));_0x46ae68+=0x1;}}_0x4b1348[_0x5e69('0x8e')](new Extension(_0x350023,_0x46ae68,'6',_0x5e69('0x9a')));_0x46ae68+=0x1;_0x4b1348[_0x5e69('0x8e')](new Extension(_0x350023,_0x46ae68,'/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',_0x5e69('0x9b')));_0x46ae68=0x0;return _0x4b1348;}exports[_0x5e69('0x9c')]=function(_0x474838,_0xa17b28,_0x4e84a0){var _0x1f12db;return db['sequelize'][_0x5e69('0x7a')](function(_0xac6521){return db[_0x5e69('0x3c')]['create'](_0x474838[_0x5e69('0x5a')],{'transaction':_0xac6521})[_0x5e69('0x1e')](function(_0x5dfb51){_0x1f12db=_0x5dfb51['get']({'plain':!![]});return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_0x1f12db),{'transaction':_0xac6521});});})[_0x5e69('0x1e')](function(){return _0x1f12db;})['then'](respondWithResult(_0xa17b28,null))[_0x5e69('0x27')](handleError(_0xa17b28,null));};exports[_0x5e69('0x9d')]=function(_0x1d5c18,_0x4d54ca,_0x22030f){var _0x3550b4;return db[_0x5e69('0x7b')][_0x5e69('0x7a')](function(_0x99157f){return db[_0x5e69('0x3c')][_0x5e69('0x33')](_0x1d5c18[_0x5e69('0x5a')],{'where':{'id':_0x1d5c18[_0x5e69('0x5a')]['id']},'transaction':_0x99157f})[_0x5e69('0x1e')](function(_0x32a384){return db[_0x5e69('0x9e')][_0x5e69('0x34')]({'where':{'FaxAccountId':_0x1d5c18[_0x5e69('0x5a')]['id']},'transaction':_0x99157f})['then'](function(_0x2682a3){return db[_0x5e69('0x9e')][_0x5e69('0x9f')](createExtensionsReciveFax(_['omit'](_0x1d5c18[_0x5e69('0x5a')],[_0x5e69('0xa0'),'key','createdAt',_0x5e69('0xa1'),_0x5e69('0xa2'),_0x5e69('0xa3')])),{'transaction':_0x99157f});});});})['then'](function(){return db[_0x5e69('0x3c')][_0x5e69('0xa4')](_0x1d5c18['body']['id']);})[_0x5e69('0x1e')](respondWithResult(_0x4d54ca,null))[_0x5e69('0x27')](handleError(_0x4d54ca,null));};exports['getMessages']=function(_0x5ea585,_0x247d5a,_0x34c189){var _0x1c4b0c={'raw':!![],'where':{}};var _0x3be393={};var _0x30a259={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x5ea585[_0x5e69('0x53')]['id']}})[_0x5e69('0x1e')](handleEntityNotFound(_0x247d5a,null))[_0x5e69('0x1e')](function(_0x5dd015){if(_0x5dd015){_0x3be393[_0x5e69('0x43')]=_['keys'](db[_0x5e69('0xa5')]['rawAttributes']);_0x3be393[_0x5e69('0x41')]=_['keys'](_0x5ea585[_0x5e69('0x41')]);_0x3be393[_0x5e69('0x42')]=_[_0x5e69('0x44')](_0x3be393['model'],_0x3be393[_0x5e69('0x41')]);_0x1c4b0c['attributes']=_[_0x5e69('0x44')](_0x3be393[_0x5e69('0x43')],qs[_0x5e69('0x45')](_0x5ea585[_0x5e69('0x41')][_0x5e69('0x45')]));_0x1c4b0c[_0x5e69('0x55')]=_0x1c4b0c[_0x5e69('0x55')][_0x5e69('0x46')]?_0x1c4b0c[_0x5e69('0x55')]:_0x3be393[_0x5e69('0x43')];if(!_0x5ea585[_0x5e69('0x41')][_0x5e69('0x47')](_0x5e69('0x48'))){_0x1c4b0c[_0x5e69('0x2d')]=qs[_0x5e69('0x2d')](_0x5ea585[_0x5e69('0x41')][_0x5e69('0x2d')]);_0x1c4b0c[_0x5e69('0x2f')]=qs[_0x5e69('0x2f')](_0x5ea585['query'][_0x5e69('0x2f')]);}_0x1c4b0c[_0x5e69('0x49')]=qs[_0x5e69('0x4a')](_0x5ea585[_0x5e69('0x41')]['sort']);_0x1c4b0c[_0x5e69('0x4d')]=qs[_0x5e69('0x42')](_[_0x5e69('0x4b')](_0x5ea585[_0x5e69('0x41')],_0x3be393['filters']));_0x1c4b0c['where']['FaxAccountId']=_0x5dd015['id'];if(_0x5ea585['query']['filter']){_0x1c4b0c[_0x5e69('0x4d')]=_[_0x5e69('0x4e')](_0x1c4b0c[_0x5e69('0x4d')],{'$or':_['map'](_0x1c4b0c[_0x5e69('0x55')],function(_0x4374f4){var _0x4d39d8={};_0x4d39d8[_0x4374f4]={'$like':'%'+_0x5ea585['query'][_0x5e69('0x4c')]+'%'};return _0x4d39d8;})});}if(_0x5ea585[_0x5e69('0x41')]['$gte']){var _0x226813=_0x5ea585['query'][_0x5e69('0xa6')][_0x5e69('0xa7')](',');var _0x421092={};_0x421092[_0x226813[0x0]]={'$gte':moment(_0x226813[0x1])['format'](_0x5e69('0xa8'))};_0x1c4b0c['where']=_[_0x5e69('0x4e')](_0x1c4b0c[_0x5e69('0x4d')],_0x421092);}_0x1c4b0c=_['merge']({},_0x1c4b0c,_0x5ea585[_0x5e69('0x57')]);return db[_0x5e69('0xa5')]['count']({'where':_0x1c4b0c['where']})[_0x5e69('0x1e')](function(_0x1aaa29){_0x30a259[_0x5e69('0x2e')]=_0x1aaa29;if(_0x5ea585[_0x5e69('0x41')][_0x5e69('0x56')]){_0x1c4b0c[_0x5e69('0x50')]=[{'all':!![]}];}return db[_0x5e69('0xa5')][_0x5e69('0x68')](_0x1c4b0c);})['then'](function(_0x4247f6){_0x30a259[_0x5e69('0x51')]=_0x4247f6;return _0x30a259;});}})['then'](respondWithFilteredResult(_0x247d5a,_0x1c4b0c))[_0x5e69('0x27')](handleError(_0x247d5a,null));};exports[_0x5e69('0x83')]=function(_0x41090d,_0x20770a,_0x32528c){var _0x491175,_0xd4862={},_0x23fcd1;if(_0x41090d[_0x5e69('0x5a')]['to']){_0x23fcd1=_0x41090d[_0x5e69('0x5a')]['to'][0x0];}return db[_0x5e69('0x3c')][_0x5e69('0x58')]({'where':{'id':_0x41090d[_0x5e69('0x53')]['id']},'include':[{'model':db[_0x5e69('0xa9')],'as':_0x5e69('0xaa'),'include':[{'model':db[_0x5e69('0x71')],'as':_0x5e69('0xab'),'where':{'fax':_0x23fcd1},'limit':0x1,'order':[[_0x5e69('0xa1'),_0x5e69('0xac')]]}]}]})[_0x5e69('0x1e')](handleEntityNotFound(_0x20770a,null))[_0x5e69('0x1e')](function(_0x2d051c){_0x491175=_0x2d051c;if(_0x41090d[_0x5e69('0x5a')][_0x5e69('0xad')]&&_0x41090d[_0x5e69('0x5a')][_0x5e69('0xad')][_0x5e69('0x46')]){for(var _0x5a413a=0x0;_0x5a413a<_0x41090d[_0x5e69('0x5a')][_0x5e69('0xad')][_0x5e69('0x46')];_0x5a413a+=0x1){_0x41090d[_0x5e69('0x5a')]['attachments'][_0x5a413a]={'filename':_0x41090d['body'][_0x5e69('0xad')][_0x5a413a]['name'],'id':_0x41090d['body'][_0x5e69('0xad')][_0x5a413a]['id'],'path':path['join'](config['root'],_0x5e69('0xae'),_0x41090d[_0x5e69('0x5a')]['attachments'][_0x5a413a]['basename'])};}}return respondWithRpcPromise(_0x5e69('0xaf'),_0x5e69('0xaf'),{'FaxAccountId':_['isNil'](_0x41090d[_0x5e69('0x53')]['id'])?undefined:_0x41090d[_0x5e69('0x53')]['id'],'path':_[_0x5e69('0xb0')](_0x41090d[_0x5e69('0x5a')][_0x5e69('0xad')][0x0]['path'])?undefined:_0x41090d['body'][_0x5e69('0xad')][0x0][_0x5e69('0x7')],'fax':_[_0x5e69('0xb0')](_0x41090d['body']['to'][0x0])?undefined:_0x41090d[_0x5e69('0x5a')]['to'][0x0]},client9002);})[_0x5e69('0x1e')](function(){if(_0x491175){if(_['isNil'](_0x41090d[_0x5e69('0x5a')][_0x5e69('0xb1')])){_0x41090d[_0x5e69('0x5a')][_0x5e69('0xb1')]=util[_0x5e69('0xb2')](_0x5e69('0xb3'),_0x491175[_0x5e69('0x38')],_0x491175[_0x5e69('0xb4')]);}if(_0x491175[_0x5e69('0xaa')]){if(_0x491175[_0x5e69('0xaa')][_0x5e69('0xab')]['length']){return _0x491175[_0x5e69('0xaa')]['Contacts'][0x0];}else{return db['CmContact'][_0x5e69('0x59')](_['defaults'](_0x41090d[_0x5e69('0x5a')],{'firstName':_0x41090d['body']['to'][0x0],'phone':_0x41090d[_0x5e69('0x5a')]['to'][0x0],'fax':_0x41090d['body']['to'][0x0],'ListId':_0x491175[_0x5e69('0xa3')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x5e69('0xb5'));}})[_0x5e69('0x1e')](function(_0x195980){if(_0x195980){return db['FaxInteraction']['find']({'where':{'ContactId':_0x195980['id'],'closed':![],'FaxAccountId':_0x491175['id']}})['then'](function(_0x40d856){if(_0x40d856){return[_0x40d856,![]];}return db['FaxInteraction'][_0x5e69('0x59')]({'UserId':_0x41090d['user']['id'],'ContactId':_0x195980['id'],'FaxAccountId':_0x491175['id'],'fax':_0x41090d['body']['to'][0x0],'firstMsgDirection':_0x5e69('0xb6'),'Messages':[_['merge'](_0x41090d[_0x5e69('0x5a')],{'read':![],'body':_0x41090d['body'][_0x5e69('0xad')][0x0][_0x5e69('0xb7')],'FaxAccountId':_0x491175['id'],'UserId':_0x41090d[_0x5e69('0x5b')]['id'],'ContactId':_0x195980['id'],'AttachmentId':_0x41090d[_0x5e69('0x5a')][_0x5e69('0xad')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x5e69('0xb8')}]})[_0x5e69('0x1e')](function(_0x866ed7){return[_0x866ed7,!![]];});});}else{throw new Error(_0x5e69('0xb9'));}})['spread'](function(_0x213787,_0x1d774c){if(_0x1d774c){return _0x213787;}return db[_0x5e69('0xa5')][_0x5e69('0x59')]({'direction':_0x5e69('0xb6'),'read':![],'body':_0x41090d[_0x5e69('0x5a')][_0x5e69('0xad')][0x0][_0x5e69('0xb7')],'FaxAccountId':_0x491175['id'],'FaxInteractionId':_0x213787['id'],'UserId':_0x41090d[_0x5e69('0x5b')]['id'],'ContactId':_0x213787[_0x5e69('0xba')],'AttachmentId':_0x41090d[_0x5e69('0x5a')][_0x5e69('0xad')][0x0]['id']})['then'](function(_0x17cabd){_0x213787[_0x5e69('0xbb')][_0x5e69('0xb8')]=[];_0x213787['dataValues'][_0x5e69('0xb8')][_0x5e69('0x8e')](_0x17cabd[_0x5e69('0xbb')]);return _0x213787;});})[_0x5e69('0x1e')](function(_0x1bdd0a){respondWithRpcPromise(_0x5e69('0xbc'),_0x5e69('0xbc'),{'FaxAccountId':_[_0x5e69('0xb0')](_0x41090d[_0x5e69('0x53')]['id'])?undefined:_0x41090d[_0x5e69('0x53')]['id'],'path':_[_0x5e69('0xb0')](_0x41090d[_0x5e69('0x5a')]['attachments'][0x0][_0x5e69('0x7')])?undefined:_0x41090d[_0x5e69('0x5a')]['attachments'][0x0][_0x5e69('0x7')],'fax':_[_0x5e69('0xb0')](_0x41090d[_0x5e69('0x5a')]['to'][0x0])?undefined:_0x41090d[_0x5e69('0x5a')]['to'][0x0],'AttachmentId':_0x41090d[_0x5e69('0x5a')][_0x5e69('0xad')][0x0]['id']},client9002)[_0x5e69('0x1e')](function(_0xf52a40){logger[_0x5e69('0x1f')](_0x5e69('0xbd'),_0xf52a40);})[_0x5e69('0x27')](function(_0x1570b3){logger[_0x5e69('0x1f')](_0x5e69('0xbd'),_0x1570b3);});return _0x1bdd0a;})[_0x5e69('0x1e')](respondWithResult(_0x20770a,null))[_0x5e69('0x27')](handleError(_0x20770a,null));};exports['addAgents']=function(_0x253253,_0x80d7e6,_0xc889d9){return db['FaxAccount']['find']({'where':{'id':_0x253253['params']['id']}})[_0x5e69('0x1e')](handleEntityNotFound(_0x80d7e6,null))[_0x5e69('0x1e')](function(_0x42ba98){if(_0x42ba98){return _0x42ba98[_0x5e69('0xbe')](_0x253253['body']['ids'],_[_0x5e69('0xbf')](_0x253253[_0x5e69('0x5a')],[_0x5e69('0x6d'),'id'])||{})[_0x5e69('0xc0')](function(_0x2d27b2){for(var _0x23d97c=0x0;_0x23d97c<_0x253253[_0x5e69('0x5a')]['ids']['length'];_0x23d97c+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x253253[_0x5e69('0x5a')][_0x5e69('0x6d')][_0x23d97c]),'FaxAccountId':Number(_0x253253[_0x5e69('0x53')]['id'])});}return _0x2d27b2;});}})[_0x5e69('0x1e')](respondWithResult(_0x80d7e6,null))[_0x5e69('0x27')](handleError(_0x80d7e6,null));};exports[_0x5e69('0xc1')]=function(_0x89bebf,_0x408adb,_0x1848b2){return db[_0x5e69('0x3c')][_0x5e69('0x58')]({'where':{'id':_0x89bebf['params']['id']}})[_0x5e69('0x1e')](handleEntityNotFound(_0x408adb,null))[_0x5e69('0x1e')](function(_0x4ec826){if(_0x4ec826){return _0x4ec826['removeAgents'](_0x89bebf['query'][_0x5e69('0x6d')])[_0x5e69('0x1e')](function(){if(_[_0x5e69('0xc2')](_0x89bebf['query']['ids'])){for(var _0x3fbc2c=0x0;_0x3fbc2c<_0x89bebf[_0x5e69('0x41')][_0x5e69('0x6d')][_0x5e69('0x46')];_0x3fbc2c+=0x1){socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x89bebf[_0x5e69('0x41')]['ids'][_0x3fbc2c]),'FaxAccountId':Number(_0x89bebf[_0x5e69('0x53')]['id'])});}}else{socket[_0x5e69('0xc3')](_0x5e69('0xc4'),{'UserId':Number(_0x89bebf[_0x5e69('0x41')][_0x5e69('0x6d')]),'FaxAccountId':Number(_0x89bebf[_0x5e69('0x53')]['id'])});}});}})[_0x5e69('0x1e')](respondWithStatusCode(_0x408adb,null))[_0x5e69('0x27')](handleError(_0x408adb,null));};exports[_0x5e69('0xc5')]=function(_0x4d31f7,_0x35e5d8,_0x2f163f){var _0x54c821={};var _0x3fb082={};var _0x424546;var _0x53c95f;return db[_0x5e69('0x3c')][_0x5e69('0x67')]({'where':{'id':_0x4d31f7[_0x5e69('0x53')]['id']}})[_0x5e69('0x1e')](handleEntityNotFound(_0x35e5d8,null))['then'](function(_0x376882){if(_0x376882){_0x424546=_0x376882;_0x3fb082[_0x5e69('0x43')]=_[_0x5e69('0x40')](db[_0x5e69('0xc6')][_0x5e69('0x3d')]);_0x3fb082[_0x5e69('0x41')]=_[_0x5e69('0x40')](_0x4d31f7[_0x5e69('0x41')]);_0x3fb082[_0x5e69('0x42')]=_[_0x5e69('0x44')](_0x3fb082[_0x5e69('0x43')],_0x3fb082[_0x5e69('0x41')]);_0x54c821['attributes']=_[_0x5e69('0x44')](_0x3fb082[_0x5e69('0x43')],qs[_0x5e69('0x45')](_0x4d31f7['query'][_0x5e69('0x45')]));_0x54c821[_0x5e69('0x55')]=_0x54c821['attributes'][_0x5e69('0x46')]?_0x54c821[_0x5e69('0x55')]:_0x3fb082[_0x5e69('0x43')];_0x54c821[_0x5e69('0x49')]=qs[_0x5e69('0x4a')](_0x4d31f7['query'][_0x5e69('0x4a')]);_0x54c821[_0x5e69('0x4d')]=qs[_0x5e69('0x42')](_[_0x5e69('0x4b')](_0x4d31f7['query'],_0x3fb082[_0x5e69('0x42')]));if(_0x4d31f7[_0x5e69('0x41')][_0x5e69('0x4c')]){_0x54c821[_0x5e69('0x4d')]=_['merge'](_0x54c821[_0x5e69('0x4d')],{'$or':_['map'](_0x54c821[_0x5e69('0x55')],function(_0x16addf){var _0x4844d4={};_0x4844d4[_0x16addf]={'$like':'%'+_0x4d31f7[_0x5e69('0x41')][_0x5e69('0x4c')]+'%'};return _0x4844d4;})});}_0x54c821=_[_0x5e69('0x4e')]({},_0x54c821,_0x4d31f7['options']);return _0x424546['getAgents'](_0x54c821);}})[_0x5e69('0x1e')](function(_0x1d7675){if(_0x1d7675){_0x53c95f=_0x1d7675[_0x5e69('0x46')];if(!_0x4d31f7[_0x5e69('0x41')]['hasOwnProperty']('nolimit')){_0x54c821[_0x5e69('0x2d')]=qs[_0x5e69('0x2d')](_0x4d31f7['query']['limit']);_0x54c821['offset']=qs[_0x5e69('0x2f')](_0x4d31f7[_0x5e69('0x41')][_0x5e69('0x2f')]);}return _0x424546['getAgents'](_0x54c821);}})['then'](function(_0x44f365){if(_0x44f365){return _0x44f365?{'count':_0x53c95f,'rows':_0x44f365}:null;}})[_0x5e69('0x1e')](respondWithResult(_0x35e5d8,null))['catch'](handleError(_0x35e5d8,null));}; \ No newline at end of file +var _0x137f=['priority','send','getApplications','context','exten','localstationid','app','system','description','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','minrate','t38timeout','FAXOPT(','ReceiveFax','addAccountApplications','bulkCreate','updateAccountApplications','VoiceExtension','tech','createdAt','updatedAt','TrunkId','ListId','findById','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','Contacts','DESC','attachments','join','root','basename','isNil','from','\x22%s\x22\x20<%s>','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','filename','Contact\x20not\x20found','spread','out','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','getAgents','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','./faxAccount.socket','jayson/promise','client','http','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','destroy','get','FaxAccounts','UserProfileResource','end','stack','name','Pause','mandatoryDispositionPause','FaxAccount','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','includeAll','include','findAll','rows','show','rawAttributes','intersection','find','create','user','userProfileId','autoAssociation','update','body','params','describe','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','FaxApplication','findAndCountAll'];(function(_0x2a7201,_0x4c0925){var _0x23c86a=function(_0x243338){while(--_0x243338){_0x2a7201['push'](_0x2a7201['shift']());}};_0x23c86a(++_0x4c0925);}(_0x137f,0x105));var _0xf137=function(_0x19454d,_0x568bb2){_0x19454d=_0x19454d-0x0;var _0x4b3f32=_0x137f[_0x19454d];return _0x4b3f32;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf137('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf137('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf137('0x2'));var Mustache=require(_0xf137('0x3'));var util=require('util');var path=require(_0xf137('0x4'));var sox=require(_0xf137('0x5'));var csv=require(_0xf137('0x6'));var ejs=require(_0xf137('0x7'));var fs=require('fs');var fs_extra=require(_0xf137('0x8'));var _=require('lodash');var squel=require(_0xf137('0x9'));var crypto=require(_0xf137('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf137('0xb'));var toCsv=require(_0xf137('0x6'));var querystring=require(_0xf137('0xc'));var Papa=require(_0xf137('0xd'));var Redis=require(_0xf137('0xe'));var authService=require(_0xf137('0xf'));var qs=require(_0xf137('0x10'));var as=require(_0xf137('0x11'));var hardwareService=require(_0xf137('0x12'));var logger=require(_0xf137('0x13'))(_0xf137('0x14'));var utils=require('../../config/utils');var config=require(_0xf137('0x15'));var licenseUtil=require(_0xf137('0x16'));var db=require(_0xf137('0x17'))['db'];config['redis']=_[_0xf137('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf137('0x19'))(new Redis(config['redis']));require(_0xf137('0x1a'))['register'](socket);var jayson=require(_0xf137('0x1b'));var client=jayson[_0xf137('0x1c')][_0xf137('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0xf137('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x4c5deb,_0xc0fbb5,_0x3fcce4,_0x17a026){return new BPromise(function(_0x1768d2,_0x57c7a5){var _0x37c229=_0x17a026||client;return _0x37c229[_0xf137('0x1e')](_0x4c5deb,_0x3fcce4)[_0xf137('0x1f')](function(_0x35db69){logger[_0xf137('0x20')](_0xf137('0x21'),_0xc0fbb5,_0xf137('0x22'));logger[_0xf137('0x23')](_0xf137('0x24'),_0xc0fbb5,_0xf137('0x22'),JSON['stringify'](_0x35db69));if(_0x35db69[_0xf137('0x25')]){if(_0x35db69['error']['code']===0x1f4){logger[_0xf137('0x25')](_0xf137('0x21'),_0xc0fbb5,_0x35db69[_0xf137('0x25')][_0xf137('0x26')]);return _0x57c7a5(_0x35db69[_0xf137('0x25')]['message']);}logger['error']('FaxAccount,\x20%s,\x20%s',_0xc0fbb5,_0x35db69[_0xf137('0x25')][_0xf137('0x26')]);return _0x1768d2(_0x35db69[_0xf137('0x25')]['message']);}else{logger[_0xf137('0x20')](_0xf137('0x21'),_0xc0fbb5,'request\x20sent');_0x1768d2(_0x35db69[_0xf137('0x27')][_0xf137('0x26')]);}})[_0xf137('0x28')](function(_0x5ab391){logger['error'](_0xf137('0x21'),_0xc0fbb5,_0x5ab391);_0x57c7a5(_0x5ab391);});});}function respondWithStatusCode(_0x2b87ac,_0x54ce20){_0x54ce20=_0x54ce20||0xcc;return function(_0x2279fc){if(_0x2279fc){return _0x2b87ac[_0xf137('0x29')](_0x54ce20);}return _0x2b87ac[_0xf137('0x2a')](_0x54ce20)['end']();};}function respondWithResult(_0x541db5,_0x507216){_0x507216=_0x507216||0xc8;return function(_0x25a617){if(_0x25a617){return _0x541db5['status'](_0x507216)['json'](_0x25a617);}};}function respondWithFilteredResult(_0x34f23e,_0x7e046f){return function(_0x1e21fa){if(_0x1e21fa){var _0x33997d=typeof _0x7e046f['offset']===_0xf137('0x2b')&&typeof _0x7e046f[_0xf137('0x2c')]===_0xf137('0x2b');var _0x2b0677=_0x1e21fa[_0xf137('0x2d')];var _0x406295=_0x33997d?0x0:_0x7e046f[_0xf137('0x2e')];var _0x22cb54=_0x33997d?_0x1e21fa[_0xf137('0x2d')]:_0x7e046f['offset']+_0x7e046f['limit'];var _0x2e5f96;if(_0x22cb54>=_0x2b0677){_0x22cb54=_0x2b0677;_0x2e5f96=0xc8;}else{_0x2e5f96=0xce;}_0x34f23e['status'](_0x2e5f96);return _0x34f23e[_0xf137('0x2f')](_0xf137('0x30'),_0x406295+'-'+_0x22cb54+'/'+_0x2b0677)[_0xf137('0x31')](_0x1e21fa);}return null;};}function patchUpdates(_0x115b1c){return function(_0x3d8db4){try{jsonpatch[_0xf137('0x32')](_0x3d8db4,_0x115b1c,!![]);}catch(_0x871ed8){return BPromise[_0xf137('0x33')](_0x871ed8);}return _0x3d8db4[_0xf137('0x34')]();};}function saveUpdates(_0x54f030,_0x223cdc){return function(_0x3d9078){if(_0x3d9078){return _0x3d9078['update'](_0x54f030)[_0xf137('0x1f')](function(_0x238dbd){return _0x238dbd;});}return null;};}function removeEntity(_0xdc30d1,_0x179658){return function(_0x8e83c7){if(_0x8e83c7){return _0x8e83c7[_0xf137('0x35')]()[_0xf137('0x1f')](function(){var _0x5f47a8=_0x8e83c7[_0xf137('0x36')]({'plain':!![]});var _0x3b9668=_0xf137('0x37');return db[_0xf137('0x38')]['destroy']({'where':{'type':_0x3b9668,'resourceId':_0x5f47a8['id']}})[_0xf137('0x1f')](function(){return _0x8e83c7;});})[_0xf137('0x1f')](function(){_0xdc30d1[_0xf137('0x2a')](0xcc)[_0xf137('0x39')]();});}};}function handleEntityNotFound(_0x123356,_0x5d8706){return function(_0x1ac14e){if(!_0x1ac14e){_0x123356['sendStatus'](0x194);}return _0x1ac14e;};}function handleError(_0x39da8f,_0x2cb23e){_0x2cb23e=_0x2cb23e||0x1f4;return function(_0x560f90){logger['error'](_0x560f90[_0xf137('0x3a')]);if(_0x560f90[_0xf137('0x3b')]){delete _0x560f90[_0xf137('0x3b')];}_0x39da8f[_0xf137('0x2a')](_0x2cb23e)['send'](_0x560f90);};}exports['index']=function(_0x53085a,_0x2718de){var _0x353fd5={'include':[{'model':db[_0xf137('0x3c')],'as':_0xf137('0x3d')}]},_0x4b09a4={},_0xb2c9ea={'count':0x0,'rows':[]};var _0x48f2d1=_['map'](db[_0xf137('0x3e')]['rawAttributes'],function(_0x46921e){return{'name':_0x46921e[_0xf137('0x3f')],'type':_0x46921e[_0xf137('0x40')][_0xf137('0x41')]};});_0x4b09a4[_0xf137('0x42')]=_[_0xf137('0x43')](_0x48f2d1,_0xf137('0x3b'));_0x4b09a4[_0xf137('0x44')]=_[_0xf137('0x45')](_0x53085a[_0xf137('0x44')]);_0x4b09a4[_0xf137('0x46')]=_['intersection'](_0x4b09a4['model'],_0x4b09a4['query']);_0x353fd5[_0xf137('0x47')]=_['intersection'](_0x4b09a4[_0xf137('0x42')],qs[_0xf137('0x48')](_0x53085a[_0xf137('0x44')][_0xf137('0x48')]));_0x353fd5[_0xf137('0x47')]=_0x353fd5[_0xf137('0x47')][_0xf137('0x49')]?_0x353fd5[_0xf137('0x47')]:_0x4b09a4[_0xf137('0x42')];if(!_0x53085a[_0xf137('0x44')][_0xf137('0x4a')](_0xf137('0x4b'))){_0x353fd5[_0xf137('0x2c')]=qs[_0xf137('0x2c')](_0x53085a[_0xf137('0x44')]['limit']);_0x353fd5[_0xf137('0x2e')]=qs[_0xf137('0x2e')](_0x53085a['query'][_0xf137('0x2e')]);}_0x353fd5[_0xf137('0x4c')]=qs[_0xf137('0x4d')](_0x53085a[_0xf137('0x44')]['sort']);_0x353fd5['where']=qs[_0xf137('0x46')](_[_0xf137('0x4e')](_0x53085a[_0xf137('0x44')],_0x4b09a4[_0xf137('0x46')]),_0x48f2d1);if(_0x53085a['query']['filter']){_0x353fd5[_0xf137('0x4f')]=_[_0xf137('0x50')](_0x353fd5['where'],{'$or':_[_0xf137('0x43')](_0x48f2d1,function(_0x319f78){if(_0x319f78[_0xf137('0x40')]!=='VIRTUAL'){var _0x381815={};_0x381815[_0x319f78['name']]={'$like':'%'+_0x53085a[_0xf137('0x44')][_0xf137('0x51')]+'%'};return _0x381815;}})});}_0x353fd5=_[_0xf137('0x50')]({},_0x353fd5,_0x53085a[_0xf137('0x52')]);var _0x4aa718={'where':_0x353fd5[_0xf137('0x4f')]};return db[_0xf137('0x3e')][_0xf137('0x2d')](_0x4aa718)[_0xf137('0x1f')](function(_0x1a65b5){_0xb2c9ea[_0xf137('0x2d')]=_0x1a65b5;if(_0x53085a[_0xf137('0x44')][_0xf137('0x53')]){_0x353fd5[_0xf137('0x54')]=[{'all':!![]}];}return db[_0xf137('0x3e')][_0xf137('0x55')](_0x353fd5);})[_0xf137('0x1f')](function(_0x2e1db5){_0xb2c9ea[_0xf137('0x56')]=_0x2e1db5;return _0xb2c9ea;})[_0xf137('0x1f')](respondWithFilteredResult(_0x2718de,_0x353fd5))[_0xf137('0x28')](handleError(_0x2718de,null));};exports[_0xf137('0x57')]=function(_0x11d37d,_0x421f04){var _0x3f90b1={'raw':![],'where':{'id':_0x11d37d['params']['id']},'include':[{'model':db[_0xf137('0x3c')],'as':_0xf137('0x3d')}]},_0x23c543={};_0x23c543[_0xf137('0x42')]=_[_0xf137('0x45')](db['FaxAccount'][_0xf137('0x58')]);_0x23c543[_0xf137('0x44')]=_['keys'](_0x11d37d[_0xf137('0x44')]);_0x23c543['filters']=_['intersection'](_0x23c543[_0xf137('0x42')],_0x23c543[_0xf137('0x44')]);_0x3f90b1[_0xf137('0x47')]=_[_0xf137('0x59')](_0x23c543[_0xf137('0x42')],qs[_0xf137('0x48')](_0x11d37d[_0xf137('0x44')]['fields']));_0x3f90b1[_0xf137('0x47')]=_0x3f90b1['attributes'][_0xf137('0x49')]?_0x3f90b1[_0xf137('0x47')]:_0x23c543[_0xf137('0x42')];if(_0x11d37d[_0xf137('0x44')][_0xf137('0x53')]){_0x3f90b1['include']=[{'all':!![]}];}_0x3f90b1=_['merge']({},_0x3f90b1,_0x11d37d[_0xf137('0x52')]);return db[_0xf137('0x3e')][_0xf137('0x5a')](_0x3f90b1)['then'](handleEntityNotFound(_0x421f04,null))['then'](respondWithResult(_0x421f04,null))[_0xf137('0x28')](handleError(_0x421f04,null));};exports[_0xf137('0x5b')]=function(_0x56602c,_0x33a8f3){return db[_0xf137('0x3e')]['create'](_0x56602c['body'],{})['then'](function(_0x208360){var _0x5c1213=_0x56602c[_0xf137('0x5c')]['get']({'plain':!![]});if(!_0x5c1213)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c1213['role']===_0xf137('0x5c')){var _0x2e5ad9=_0x208360['get']({'plain':!![]});var _0x13ad7d=_0xf137('0x37');return db['UserProfileSection'][_0xf137('0x5a')]({'where':{'name':_0x13ad7d,'userProfileId':_0x5c1213[_0xf137('0x5d')]},'raw':!![]})[_0xf137('0x1f')](function(_0x3e3e17){if(_0x3e3e17&&_0x3e3e17[_0xf137('0x5e')]===0x0){return db[_0xf137('0x38')][_0xf137('0x5b')]({'name':_0x2e5ad9['name'],'resourceId':_0x2e5ad9['id'],'type':_0x3e3e17[_0xf137('0x3b')],'sectionId':_0x3e3e17['id']},{})[_0xf137('0x1f')](function(){return _0x208360;});}else{return _0x208360;}})[_0xf137('0x28')](function(_0xa4b84){logger[_0xf137('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa4b84);throw _0xa4b84;});}return _0x208360;})[_0xf137('0x1f')](respondWithResult(_0x33a8f3,0xc9))[_0xf137('0x28')](handleError(_0x33a8f3,null));};exports[_0xf137('0x5f')]=function(_0x44cfe4,_0x49daf7){if(_0x44cfe4[_0xf137('0x60')]['id']){delete _0x44cfe4[_0xf137('0x60')]['id'];}return db['FaxAccount'][_0xf137('0x5a')]({'where':{'id':_0x44cfe4[_0xf137('0x61')]['id']},'include':[{'model':db[_0xf137('0x3c')],'as':_0xf137('0x3d')}]})[_0xf137('0x1f')](handleEntityNotFound(_0x49daf7,null))[_0xf137('0x1f')](saveUpdates(_0x44cfe4[_0xf137('0x60')],null))[_0xf137('0x1f')](respondWithResult(_0x49daf7,null))[_0xf137('0x28')](handleError(_0x49daf7,null));};exports[_0xf137('0x35')]=function(_0x39d321,_0x3ee06f){return db[_0xf137('0x3e')][_0xf137('0x5a')]({'where':{'id':_0x39d321[_0xf137('0x61')]['id']}})[_0xf137('0x1f')](handleEntityNotFound(_0x3ee06f,null))['then'](removeEntity(_0x3ee06f,null))[_0xf137('0x28')](handleError(_0x3ee06f,null));};exports[_0xf137('0x62')]=function(_0xf870ff,_0x5a745d){return db[_0xf137('0x3e')][_0xf137('0x62')]()[_0xf137('0x1f')](respondWithResult(_0x5a745d,null))[_0xf137('0x28')](handleError(_0x5a745d,null));};exports[_0xf137('0x63')]=function(_0x41f195,_0x39e980,_0x292bb8){if(_0x41f195['body']['id']){delete _0x41f195[_0xf137('0x60')]['id'];}return db[_0xf137('0x3e')][_0xf137('0x5a')]({'where':{'id':_0x41f195['params']['id']}})[_0xf137('0x1f')](handleEntityNotFound(_0x39e980,null))[_0xf137('0x1f')](function(_0x1cd077){if(_0x1cd077){_0x41f195[_0xf137('0x60')][_0xf137('0x64')]=_0x1cd077['id'];return db[_0xf137('0x65')][_0xf137('0x5b')](_0x41f195[_0xf137('0x60')]);}})['then'](respondWithResult(_0x39e980,null))[_0xf137('0x28')](handleError(_0x39e980,null));};exports[_0xf137('0x66')]=function(_0x1d7c45,_0x15cc65,_0x1b4d95){var _0xc3aaa4={'raw':![],'where':{}};var _0xac84e3={};var _0x4ae127={'count':0x0,'rows':[]};return db[_0xf137('0x3e')][_0xf137('0x67')]({'where':{'id':_0x1d7c45[_0xf137('0x61')]['id']}})[_0xf137('0x1f')](handleEntityNotFound(_0x15cc65,null))['then'](function(_0x5898b2){if(_0x5898b2){_0xac84e3[_0xf137('0x42')]=_[_0xf137('0x45')](db[_0xf137('0x65')][_0xf137('0x58')]);_0xac84e3[_0xf137('0x44')]=_[_0xf137('0x45')](_0x1d7c45[_0xf137('0x44')]);_0xac84e3[_0xf137('0x46')]=_['intersection'](_0xac84e3[_0xf137('0x42')],_0xac84e3[_0xf137('0x44')]);_0xc3aaa4[_0xf137('0x47')]=_[_0xf137('0x59')](_0xac84e3[_0xf137('0x42')],qs[_0xf137('0x48')](_0x1d7c45['query']['fields']));_0xc3aaa4[_0xf137('0x47')]=_0xc3aaa4['attributes'][_0xf137('0x49')]?_0xc3aaa4[_0xf137('0x47')]:_0xac84e3[_0xf137('0x42')];if(!_0x1d7c45[_0xf137('0x44')][_0xf137('0x4a')](_0xf137('0x4b'))){_0xc3aaa4[_0xf137('0x2c')]=qs[_0xf137('0x2c')](_0x1d7c45[_0xf137('0x44')]['limit']);_0xc3aaa4['offset']=qs[_0xf137('0x2e')](_0x1d7c45['query'][_0xf137('0x2e')]);}_0xc3aaa4['order']=qs[_0xf137('0x4d')](_0x1d7c45['query'][_0xf137('0x4d')]);_0xc3aaa4[_0xf137('0x4f')]=qs[_0xf137('0x46')](_['pick'](_0x1d7c45['query'],_0xac84e3[_0xf137('0x46')]));_0xc3aaa4[_0xf137('0x4f')]['FaxAccountId']=_0x5898b2['id'];if(_0x1d7c45[_0xf137('0x44')]['filter']){_0xc3aaa4['where']=_[_0xf137('0x50')](_0xc3aaa4['where'],{'$or':_[_0xf137('0x43')](_0xc3aaa4[_0xf137('0x47')],function(_0x35e4b3){var _0x133fb0={};_0x133fb0[_0x35e4b3]={'$like':'%'+_0x1d7c45[_0xf137('0x44')]['filter']+'%'};return _0x133fb0;})});}_0xc3aaa4=_[_0xf137('0x50')]({},_0xc3aaa4,_0x1d7c45[_0xf137('0x52')]);return db[_0xf137('0x65')][_0xf137('0x2d')]({'where':_0xc3aaa4[_0xf137('0x4f')]})['then'](function(_0x4375f1){_0x4ae127[_0xf137('0x2d')]=_0x4375f1;if(_0x1d7c45[_0xf137('0x44')][_0xf137('0x53')]){_0xc3aaa4[_0xf137('0x54')]=[{'all':!![]}];}return db[_0xf137('0x65')][_0xf137('0x55')](_0xc3aaa4);})[_0xf137('0x1f')](function(_0x206ccb){_0x4ae127[_0xf137('0x56')]=_0x206ccb;return _0x4ae127;});}})['then'](respondWithFilteredResult(_0x15cc65,_0xc3aaa4))[_0xf137('0x28')](handleError(_0x15cc65,null));};exports[_0xf137('0x68')]=function(_0x204800,_0x5adb88,_0x512abd){return db['FaxAccount'][_0xf137('0x5a')]({'where':{'id':_0x204800[_0xf137('0x61')]['id']}})[_0xf137('0x1f')](handleEntityNotFound(_0x5adb88,null))[_0xf137('0x1f')](function(_0x2fe35a){if(_0x2fe35a){return _0x2fe35a[_0xf137('0x68')](_0x204800['query'][_0xf137('0x69')]);}})[_0xf137('0x1f')](respondWithStatusCode(_0x5adb88,null))[_0xf137('0x28')](handleError(_0x5adb88,null));};exports[_0xf137('0x6a')]=function(_0x399e1b,_0x4ef637,_0x30b4f5){if(_0x399e1b[_0xf137('0x60')]['id']){delete _0x399e1b[_0xf137('0x60')]['id'];}return db[_0xf137('0x3e')][_0xf137('0x5a')]({'where':{'id':_0x399e1b['params']['id']}})[_0xf137('0x1f')](handleEntityNotFound(_0x4ef637,null))[_0xf137('0x1f')](function(_0x2ac082){if(_0x2ac082){_0x399e1b[_0xf137('0x60')][_0xf137('0x64')]=_0x2ac082['id'];return db[_0xf137('0x6b')][_0xf137('0x5b')](_0x399e1b['body']);}})['then'](respondWithResult(_0x4ef637,null))[_0xf137('0x28')](handleError(_0x4ef637,null));};exports['getAnswers']=function(_0x5a69b2,_0x3bf17e,_0x13dfb2){var _0x1c091c={'raw':![],'where':{}};var _0x4d2b63={};var _0x45cf34={'count':0x0,'rows':[]};return db[_0xf137('0x3e')][_0xf137('0x67')]({'where':{'id':_0x5a69b2['params']['id']}})[_0xf137('0x1f')](handleEntityNotFound(_0x3bf17e,null))['then'](function(_0x379915){if(_0x379915){_0x4d2b63['model']=_[_0xf137('0x45')](db['CannedAnswer']['rawAttributes']);_0x4d2b63[_0xf137('0x44')]=_['keys'](_0x5a69b2[_0xf137('0x44')]);_0x4d2b63[_0xf137('0x46')]=_[_0xf137('0x59')](_0x4d2b63['model'],_0x4d2b63[_0xf137('0x44')]);_0x1c091c[_0xf137('0x47')]=_[_0xf137('0x59')](_0x4d2b63[_0xf137('0x42')],qs[_0xf137('0x48')](_0x5a69b2[_0xf137('0x44')][_0xf137('0x48')]));_0x1c091c[_0xf137('0x47')]=_0x1c091c[_0xf137('0x47')][_0xf137('0x49')]?_0x1c091c[_0xf137('0x47')]:_0x4d2b63[_0xf137('0x42')];if(!_0x5a69b2[_0xf137('0x44')][_0xf137('0x4a')](_0xf137('0x4b'))){_0x1c091c[_0xf137('0x2c')]=qs['limit'](_0x5a69b2['query'][_0xf137('0x2c')]);_0x1c091c[_0xf137('0x2e')]=qs['offset'](_0x5a69b2['query'][_0xf137('0x2e')]);}_0x1c091c[_0xf137('0x4c')]=qs['sort'](_0x5a69b2['query'][_0xf137('0x4d')]);_0x1c091c[_0xf137('0x4f')]=qs['filters'](_['pick'](_0x5a69b2[_0xf137('0x44')],_0x4d2b63[_0xf137('0x46')]));_0x1c091c[_0xf137('0x4f')]['FaxAccountId']=_0x379915['id'];if(_0x5a69b2[_0xf137('0x44')][_0xf137('0x51')]){_0x1c091c[_0xf137('0x4f')]=_['merge'](_0x1c091c[_0xf137('0x4f')],{'$or':_['map'](_0x1c091c['attributes'],function(_0x2ddf69){var _0x35b4f8={};_0x35b4f8[_0x2ddf69]={'$like':'%'+_0x5a69b2[_0xf137('0x44')]['filter']+'%'};return _0x35b4f8;})});}_0x1c091c=_[_0xf137('0x50')]({},_0x1c091c,_0x5a69b2[_0xf137('0x52')]);return db[_0xf137('0x6b')][_0xf137('0x2d')]({'where':_0x1c091c[_0xf137('0x4f')]})[_0xf137('0x1f')](function(_0x3472fe){_0x45cf34[_0xf137('0x2d')]=_0x3472fe;if(_0x5a69b2['query'][_0xf137('0x53')]){_0x1c091c[_0xf137('0x54')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x1c091c);})[_0xf137('0x1f')](function(_0x20d207){_0x45cf34['rows']=_0x20d207;return _0x45cf34;});}})['then'](respondWithFilteredResult(_0x3bf17e,_0x1c091c))[_0xf137('0x28')](handleError(_0x3bf17e,null));};exports[_0xf137('0x6c')]=function(_0x5a8053,_0x1037d3,_0x2c0a30){return db[_0xf137('0x3e')][_0xf137('0x5a')]({'where':{'id':_0x5a8053[_0xf137('0x61')]['id']}})[_0xf137('0x1f')](handleEntityNotFound(_0x1037d3,null))['then'](function(_0x2cc5d1){if(_0x2cc5d1){return _0x2cc5d1[_0xf137('0x6c')](_0x5a8053[_0xf137('0x44')][_0xf137('0x69')]);}})[_0xf137('0x1f')](respondWithStatusCode(_0x1037d3,null))[_0xf137('0x28')](handleError(_0x1037d3,null));};exports[_0xf137('0x6d')]=function(_0x299c03,_0x20431a,_0x366e5a){return db['FaxInteraction']['find']({'where':{'id':_0x299c03[_0xf137('0x61')]['id']}})[_0xf137('0x1f')](handleEntityNotFound(_0x20431a,null))[_0xf137('0x1f')](function(_0x4b5a72){if(_0x4b5a72){return _0x4b5a72[_0xf137('0x6d')](_0x299c03[_0xf137('0x60')]['ids'],_[_0xf137('0x6e')](_0x299c03[_0xf137('0x60')],[_0xf137('0x69'),'id'])||{});}})[_0xf137('0x1f')](respondWithResult(_0x20431a,null))['catch'](handleError(_0x20431a,null));};exports[_0xf137('0x6f')]=function(_0x15cadb,_0x227d09,_0x103e6f){var _0x43e1e9={'raw':![],'where':{}};var _0x1df9ef={};var _0x59c2a9={'count':0x0,'rows':[]};return db[_0xf137('0x3e')][_0xf137('0x67')]({'where':{'id':_0x15cadb[_0xf137('0x61')]['id']}})[_0xf137('0x1f')](handleEntityNotFound(_0x227d09,null))[_0xf137('0x1f')](function(_0x1aca50){if(_0x1aca50){_0x1df9ef[_0xf137('0x42')]=_[_0xf137('0x45')](db[_0xf137('0x70')][_0xf137('0x58')]);_0x1df9ef[_0xf137('0x44')]=_[_0xf137('0x45')](_0x15cadb['query']);_0x1df9ef[_0xf137('0x46')]=_[_0xf137('0x59')](_0x1df9ef[_0xf137('0x42')],_0x1df9ef[_0xf137('0x44')]);_0x43e1e9[_0xf137('0x47')]=_[_0xf137('0x59')](_0x1df9ef[_0xf137('0x42')],qs[_0xf137('0x48')](_0x15cadb[_0xf137('0x44')][_0xf137('0x48')]));_0x43e1e9[_0xf137('0x47')]=_0x43e1e9['attributes'][_0xf137('0x49')]?_0x43e1e9['attributes']:_0x1df9ef[_0xf137('0x42')];if(!_0x15cadb[_0xf137('0x44')]['hasOwnProperty']('nolimit')){_0x43e1e9[_0xf137('0x2c')]=qs[_0xf137('0x2c')](_0x15cadb[_0xf137('0x44')][_0xf137('0x2c')]);_0x43e1e9[_0xf137('0x2e')]=qs[_0xf137('0x2e')](_0x15cadb['query']['offset']);}_0x43e1e9[_0xf137('0x4c')]=qs[_0xf137('0x4d')](_0x15cadb[_0xf137('0x44')][_0xf137('0x4d')]);_0x43e1e9[_0xf137('0x4f')]=qs['filters'](_['pick'](_0x15cadb[_0xf137('0x44')],_0x1df9ef[_0xf137('0x46')]));_0x43e1e9[_0xf137('0x4f')]['FaxAccountId']=_0x1aca50['id'];if(_0x15cadb[_0xf137('0x44')][_0xf137('0x51')]){_0x43e1e9['where']=_['merge'](_0x43e1e9['where'],{'$or':_[_0xf137('0x43')](_0x43e1e9[_0xf137('0x47')],function(_0x4ba89b){var _0x125ee5={};_0x125ee5[_0x4ba89b]={'$like':'%'+_0x15cadb[_0xf137('0x44')]['filter']+'%'};return _0x125ee5;})});}_0x43e1e9=_[_0xf137('0x50')]({},_0x43e1e9,_0x15cadb['options']);return db[_0xf137('0x70')][_0xf137('0x2d')]({'where':_0x43e1e9[_0xf137('0x4f')]})[_0xf137('0x1f')](function(_0x36f900){_0x59c2a9['count']=_0x36f900;if(_0x15cadb[_0xf137('0x44')][_0xf137('0x53')]){_0x43e1e9['include']=[{'model':db[_0xf137('0x71')],'as':_0xf137('0x72'),'required':![]},{'model':db[_0xf137('0x73')],'as':_0xf137('0x74'),'attributes':['name',_0xf137('0x75'),_0xf137('0x76')],'required':![]},{'model':db[_0xf137('0x77')],'as':_0xf137('0x78'),'attributes':['id',_0xf137('0x3b'),_0xf137('0x79')],'where':_0x15cadb['query'][_0xf137('0x7a')]?{'id':_0x15cadb[_0xf137('0x44')]['tag']}:undefined,'required':_0x15cadb[_0xf137('0x44')]['tag']?!![]:![]}];}return db[_0xf137('0x70')]['findAll'](_0x43e1e9);})[_0xf137('0x1f')](function(_0x324273){_0x59c2a9['rows']=_0x324273;return _0x59c2a9;});}})['then'](respondWithFilteredResult(_0x227d09,_0x43e1e9))[_0xf137('0x28')](handleError(_0x227d09,null));};exports[_0xf137('0x7b')]=function(_0x3a6347,_0x39b26e){var _0x188ce1=_0x3a6347[_0xf137('0x61')]['id'];var _0x1d9cac=_0x3a6347[_0xf137('0x60')];var _0x5273a8=0xc8;var _0x42f0e6=null;return db[_0xf137('0x7c')][_0xf137('0x7d')]({'isolationLevel':db['sequelize'][_0xf137('0x7e')][_0xf137('0x7f')][_0xf137('0x80')]},function(_0x52253d){return db[_0xf137('0x3e')]['findOne']({'where':{'id':_0x188ce1},'transaction':_0x52253d})[_0xf137('0x1f')](function(_0x4475a){if(_0x4475a){return db['FaxApplication'][_0xf137('0x35')]({'where':{'FaxAccountId':_0x188ce1},'transaction':_0x52253d})[_0xf137('0x1f')](function(){var _0x259cf4=_[_0xf137('0x43')](_0x1d9cac,function(_0x155c16){_0x155c16[_0xf137('0x64')]=_0x188ce1;return _0x155c16;});return db['FaxApplication']['bulkCreate'](_0x259cf4,{'transaction':_0x52253d});});}else{_0x5273a8=0x194;_0x42f0e6=[];}});})[_0xf137('0x1f')](function(){if(_0x5273a8!==0x194){return db[_0xf137('0x81')][_0xf137('0x82')]({'where':{'FaxAccountId':_0x188ce1},'order':_0xf137('0x83')})['then'](function(_0x2397ac){_0x42f0e6=_0x2397ac;});}})[_0xf137('0x28')](function(_0x4b8371){_0x5273a8=0x1f4;logger[_0xf137('0x25')](_0x4b8371[_0xf137('0x3a')]);if(_0x4b8371[_0xf137('0x3b')]){delete _0x4b8371[_0xf137('0x3b')];}_0x42f0e6=_0x4b8371;})['finally'](function(){if(_0x42f0e6===null){_0x39b26e['sendStatus'](_0x5273a8);}else{if(_0x5273a8===0x1f4){_0x39b26e['status'](_0x5273a8)[_0xf137('0x84')](_0x42f0e6);}else{_0x39b26e[_0xf137('0x2a')](_0x5273a8)[_0xf137('0x31')](_0x42f0e6);}}});};exports[_0xf137('0x85')]=function(_0x5aa43a,_0x2d3b67,_0x50e513){var _0x287014={};var _0x199912={};var _0x1c1b55;var _0x1daa5b;return db[_0xf137('0x3e')][_0xf137('0x67')]({'where':{'id':_0x5aa43a[_0xf137('0x61')]['id']}})[_0xf137('0x1f')](handleEntityNotFound(_0x2d3b67,null))[_0xf137('0x1f')](function(_0x6502cb){if(_0x6502cb){_0x1c1b55=_0x6502cb;_0x199912['model']=_[_0xf137('0x45')](db[_0xf137('0x81')][_0xf137('0x58')]);_0x199912[_0xf137('0x44')]=_['keys'](_0x5aa43a[_0xf137('0x44')]);_0x199912['filters']=_[_0xf137('0x59')](_0x199912[_0xf137('0x42')],_0x199912[_0xf137('0x44')]);_0x287014[_0xf137('0x47')]=_[_0xf137('0x59')](_0x199912[_0xf137('0x42')],qs[_0xf137('0x48')](_0x5aa43a[_0xf137('0x44')][_0xf137('0x48')]));_0x287014[_0xf137('0x47')]=_0x287014[_0xf137('0x47')]['length']?_0x287014['attributes']:_0x199912['model'];_0x287014['order']=qs[_0xf137('0x4d')](_0x5aa43a[_0xf137('0x44')][_0xf137('0x4d')]);_0x287014[_0xf137('0x4f')]=qs['filters'](_[_0xf137('0x4e')](_0x5aa43a['query'],_0x199912[_0xf137('0x46')]));if(_0x5aa43a[_0xf137('0x44')][_0xf137('0x51')]){_0x287014['where']=_[_0xf137('0x50')](_0x287014['where'],{'$or':_['map'](_0x287014['attributes'],function(_0xd55cd){var _0x2eb501={};_0x2eb501[_0xd55cd]={'$like':'%'+_0x5aa43a[_0xf137('0x44')][_0xf137('0x51')]+'%'};return _0x2eb501;})});}_0x287014=_['merge']({},_0x287014,_0x5aa43a[_0xf137('0x52')]);return _0x1c1b55['getApplications'](_0x287014);}})[_0xf137('0x1f')](function(_0x562e0a){if(_0x562e0a){_0x1daa5b=_0x562e0a[_0xf137('0x49')];if(!_0x5aa43a[_0xf137('0x44')][_0xf137('0x4a')](_0xf137('0x4b'))){_0x287014[_0xf137('0x2c')]=qs[_0xf137('0x2c')](_0x5aa43a[_0xf137('0x44')]['limit']);_0x287014['offset']=qs[_0xf137('0x2e')](_0x5aa43a['query'][_0xf137('0x2e')]);}return _0x1c1b55['getApplications'](_0x287014);}})[_0xf137('0x1f')](function(_0x25ad76){if(_0x25ad76){return _0x25ad76?{'count':_0x1daa5b,'rows':_0x25ad76}:null;}})[_0xf137('0x1f')](respondWithResult(_0x2d3b67,null))['catch'](handleError(_0x2d3b67,null));};function Extension(_0x4a48a5,_0x885a2e,_0xd8b87a,_0x292c44){this[_0xf137('0x86')]='from-voip-provider';this[_0xf137('0x87')]=_0x4a48a5[_0xf137('0x88')];this[_0xf137('0x89')]=_0x292c44;this['type']=_0xf137('0x8a');this[_0xf137('0x8b')]='Fax\x20Extension';this[_0xf137('0x64')]=_0x4a48a5['id'];this[_0xf137('0x83')]=_0x885a2e;this[_0xf137('0x8c')]=_0xd8b87a;}function createExtensionsReciveFax(_0x1b68bd){var _0x564f8f=0x1;var _0x114b02=[];_0x114b02[_0xf137('0x8d')](new Extension(_0x1b68bd,_0x564f8f,'',_0xf137('0x8e')));_0x564f8f+=0x1;_0x114b02[_0xf137('0x8d')](new Extension(_0x1b68bd,_0x564f8f,_0xf137('0x8f'),_0xf137('0x90')));_0x564f8f+=0x1;for(var _0x457a21 in _0x1b68bd){if(_0x1b68bd[_0xf137('0x4a')](_0x457a21)&&(_0x457a21===_0xf137('0x91')||_0x457a21===_0xf137('0x88')||_0x457a21===_0xf137('0x92')||_0x457a21===_0xf137('0x93')||_0x457a21===_0xf137('0x94')||_0x457a21===_0xf137('0x95')||_0x457a21===_0xf137('0x96')||_0x457a21==='modem'||_0x457a21===_0xf137('0x97'))){_0x114b02['push'](new Extension(_0x1b68bd,_0x564f8f,_0xf137('0x98')+_0x457a21+')='+_0x1b68bd[_0x457a21],_0xf137('0x90')));_0x564f8f+=0x1;}}_0x114b02[_0xf137('0x8d')](new Extension(_0x1b68bd,_0x564f8f,'6','Wait'));_0x564f8f+=0x1;_0x114b02[_0xf137('0x8d')](new Extension(_0x1b68bd,_0x564f8f,'/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',_0xf137('0x99')));_0x564f8f=0x0;return _0x114b02;}exports[_0xf137('0x9a')]=function(_0x1aa648,_0x2b78e2,_0x254657){var _0x541052;return db[_0xf137('0x7c')]['transaction'](function(_0x3ede59){return db[_0xf137('0x3e')][_0xf137('0x5b')](_0x1aa648[_0xf137('0x60')],{'transaction':_0x3ede59})[_0xf137('0x1f')](function(_0x37fb7d){_0x541052=_0x37fb7d[_0xf137('0x36')]({'plain':!![]});return db['VoiceExtension'][_0xf137('0x9b')](createExtensionsReciveFax(_0x541052),{'transaction':_0x3ede59});});})['then'](function(){return _0x541052;})[_0xf137('0x1f')](respondWithResult(_0x2b78e2,null))[_0xf137('0x28')](handleError(_0x2b78e2,null));};exports[_0xf137('0x9c')]=function(_0x24e36d,_0x5d03fa,_0x1c2d68){var _0x2cccf7;return db['sequelize'][_0xf137('0x7d')](function(_0x46db29){return db[_0xf137('0x3e')][_0xf137('0x5f')](_0x24e36d[_0xf137('0x60')],{'where':{'id':_0x24e36d[_0xf137('0x60')]['id']},'transaction':_0x46db29})[_0xf137('0x1f')](function(_0x618a0d){return db[_0xf137('0x9d')]['destroy']({'where':{'FaxAccountId':_0x24e36d[_0xf137('0x60')]['id']},'transaction':_0x46db29})['then'](function(_0x49b780){return db[_0xf137('0x9d')][_0xf137('0x9b')](createExtensionsReciveFax(_[_0xf137('0x6e')](_0x24e36d[_0xf137('0x60')],[_0xf137('0x9e'),_0xf137('0x41'),_0xf137('0x9f'),_0xf137('0xa0'),_0xf137('0xa1'),_0xf137('0xa2')])),{'transaction':_0x46db29});});});})[_0xf137('0x1f')](function(){return db[_0xf137('0x3e')][_0xf137('0xa3')](_0x24e36d[_0xf137('0x60')]['id']);})[_0xf137('0x1f')](respondWithResult(_0x5d03fa,null))[_0xf137('0x28')](handleError(_0x5d03fa,null));};exports['getMessages']=function(_0x40ab1b,_0x52915c,_0x591695){var _0x27ee2b={'raw':!![],'where':{}};var _0x2a9485={};var _0x60257b={'count':0x0,'rows':[]};return db[_0xf137('0x3e')][_0xf137('0x67')]({'where':{'id':_0x40ab1b[_0xf137('0x61')]['id']}})[_0xf137('0x1f')](handleEntityNotFound(_0x52915c,null))['then'](function(_0x308974){if(_0x308974){_0x2a9485[_0xf137('0x42')]=_[_0xf137('0x45')](db[_0xf137('0xa4')][_0xf137('0x58')]);_0x2a9485[_0xf137('0x44')]=_[_0xf137('0x45')](_0x40ab1b[_0xf137('0x44')]);_0x2a9485[_0xf137('0x46')]=_[_0xf137('0x59')](_0x2a9485[_0xf137('0x42')],_0x2a9485[_0xf137('0x44')]);_0x27ee2b[_0xf137('0x47')]=_['intersection'](_0x2a9485[_0xf137('0x42')],qs[_0xf137('0x48')](_0x40ab1b[_0xf137('0x44')]['fields']));_0x27ee2b[_0xf137('0x47')]=_0x27ee2b[_0xf137('0x47')][_0xf137('0x49')]?_0x27ee2b[_0xf137('0x47')]:_0x2a9485[_0xf137('0x42')];if(!_0x40ab1b[_0xf137('0x44')][_0xf137('0x4a')](_0xf137('0x4b'))){_0x27ee2b['limit']=qs[_0xf137('0x2c')](_0x40ab1b['query'][_0xf137('0x2c')]);_0x27ee2b[_0xf137('0x2e')]=qs[_0xf137('0x2e')](_0x40ab1b[_0xf137('0x44')][_0xf137('0x2e')]);}_0x27ee2b[_0xf137('0x4c')]=qs[_0xf137('0x4d')](_0x40ab1b[_0xf137('0x44')][_0xf137('0x4d')]);_0x27ee2b['where']=qs[_0xf137('0x46')](_['pick'](_0x40ab1b[_0xf137('0x44')],_0x2a9485[_0xf137('0x46')]));_0x27ee2b['where'][_0xf137('0x64')]=_0x308974['id'];if(_0x40ab1b[_0xf137('0x44')][_0xf137('0x51')]){_0x27ee2b['where']=_['merge'](_0x27ee2b[_0xf137('0x4f')],{'$or':_['map'](_0x27ee2b['attributes'],function(_0x82faa){var _0x153ce8={};_0x153ce8[_0x82faa]={'$like':'%'+_0x40ab1b[_0xf137('0x44')]['filter']+'%'};return _0x153ce8;})});}if(_0x40ab1b[_0xf137('0x44')][_0xf137('0xa5')]){var _0x2fb411=_0x40ab1b[_0xf137('0x44')][_0xf137('0xa5')]['split'](',');var _0x3369c3={};_0x3369c3[_0x2fb411[0x0]]={'$gte':moment(_0x2fb411[0x1])[_0xf137('0xa6')](_0xf137('0xa7'))};_0x27ee2b['where']=_[_0xf137('0x50')](_0x27ee2b['where'],_0x3369c3);}_0x27ee2b=_[_0xf137('0x50')]({},_0x27ee2b,_0x40ab1b[_0xf137('0x52')]);return db[_0xf137('0xa4')][_0xf137('0x2d')]({'where':_0x27ee2b[_0xf137('0x4f')]})[_0xf137('0x1f')](function(_0x1c6516){_0x60257b[_0xf137('0x2d')]=_0x1c6516;if(_0x40ab1b[_0xf137('0x44')]['includeAll']){_0x27ee2b['include']=[{'all':!![]}];}return db[_0xf137('0xa4')][_0xf137('0x55')](_0x27ee2b);})['then'](function(_0x1ff345){_0x60257b[_0xf137('0x56')]=_0x1ff345;return _0x60257b;});}})[_0xf137('0x1f')](respondWithFilteredResult(_0x52915c,_0x27ee2b))[_0xf137('0x28')](handleError(_0x52915c,null));};exports[_0xf137('0x84')]=function(_0x2addb7,_0x349392,_0x5208ca){var _0x86bac,_0xa8116f={},_0x540023;if(_0x2addb7[_0xf137('0x60')]['to']){_0x540023=_0x2addb7[_0xf137('0x60')]['to'][0x0];}return db['FaxAccount'][_0xf137('0x5a')]({'where':{'id':_0x2addb7['params']['id']},'include':[{'model':db[_0xf137('0xa8')],'as':'List','include':[{'model':db[_0xf137('0x71')],'as':_0xf137('0xa9'),'where':{'fax':_0x540023},'limit':0x1,'order':[[_0xf137('0xa0'),_0xf137('0xaa')]]}]}]})['then'](handleEntityNotFound(_0x349392,null))['then'](function(_0x343888){_0x86bac=_0x343888;if(_0x2addb7[_0xf137('0x60')][_0xf137('0xab')]&&_0x2addb7[_0xf137('0x60')]['attachments'][_0xf137('0x49')]){for(var _0x53dd08=0x0;_0x53dd08<_0x2addb7[_0xf137('0x60')][_0xf137('0xab')][_0xf137('0x49')];_0x53dd08+=0x1){_0x2addb7[_0xf137('0x60')]['attachments'][_0x53dd08]={'filename':_0x2addb7[_0xf137('0x60')][_0xf137('0xab')][_0x53dd08][_0xf137('0x3b')],'id':_0x2addb7['body'][_0xf137('0xab')][_0x53dd08]['id'],'path':path[_0xf137('0xac')](config[_0xf137('0xad')],'server/files/attachments',_0x2addb7[_0xf137('0x60')][_0xf137('0xab')][_0x53dd08][_0xf137('0xae')])};}}return respondWithRpcPromise('CheckAfterSend','CheckAfterSend',{'FaxAccountId':_[_0xf137('0xaf')](_0x2addb7[_0xf137('0x61')]['id'])?undefined:_0x2addb7[_0xf137('0x61')]['id'],'path':_[_0xf137('0xaf')](_0x2addb7[_0xf137('0x60')]['attachments'][0x0][_0xf137('0x4')])?undefined:_0x2addb7[_0xf137('0x60')]['attachments'][0x0][_0xf137('0x4')],'fax':_[_0xf137('0xaf')](_0x2addb7[_0xf137('0x60')]['to'][0x0])?undefined:_0x2addb7[_0xf137('0x60')]['to'][0x0]},client9002);})['then'](function(){if(_0x86bac){if(_[_0xf137('0xaf')](_0x2addb7['body'][_0xf137('0xb0')])){_0x2addb7[_0xf137('0x60')]['from']=util[_0xf137('0xa6')](_0xf137('0xb1'),_0x86bac['name'],_0x86bac[_0xf137('0xb2')]);}if(_0x86bac[_0xf137('0xb3')]){if(_0x86bac[_0xf137('0xb3')]['Contacts'][_0xf137('0x49')]){return _0x86bac[_0xf137('0xb3')][_0xf137('0xa9')][0x0];}else{return db[_0xf137('0x71')][_0xf137('0x5b')](_[_0xf137('0x18')](_0x2addb7[_0xf137('0x60')],{'firstName':_0x2addb7[_0xf137('0x60')]['to'][0x0],'phone':_0x2addb7[_0xf137('0x60')]['to'][0x0],'fax':_0x2addb7[_0xf137('0x60')]['to'][0x0],'ListId':_0x86bac[_0xf137('0xa2')]}));}}else{throw new Error(_0xf137('0xb4'));}}else{throw new Error(_0xf137('0xb5'));}})[_0xf137('0x1f')](function(_0x2f5dca){if(_0x2f5dca){return db[_0xf137('0x70')][_0xf137('0x5a')]({'where':{'ContactId':_0x2f5dca['id'],'closed':![],'FaxAccountId':_0x86bac['id']}})[_0xf137('0x1f')](function(_0x49544d){if(_0x49544d){return[_0x49544d,![]];}return db[_0xf137('0x70')][_0xf137('0x5b')]({'UserId':_0x2addb7['user']['id'],'ContactId':_0x2f5dca['id'],'FaxAccountId':_0x86bac['id'],'fax':_0x2addb7['body']['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0xf137('0x50')](_0x2addb7[_0xf137('0x60')],{'read':![],'body':_0x2addb7[_0xf137('0x60')][_0xf137('0xab')][0x0][_0xf137('0xb6')],'FaxAccountId':_0x86bac['id'],'UserId':_0x2addb7[_0xf137('0x5c')]['id'],'ContactId':_0x2f5dca['id'],'AttachmentId':_0x2addb7['body'][_0xf137('0xab')][0x0]['id']})]},{'include':[{'model':db[_0xf137('0xa4')],'as':'Messages'}]})[_0xf137('0x1f')](function(_0x5a132d){return[_0x5a132d,!![]];});});}else{throw new Error(_0xf137('0xb7'));}})[_0xf137('0xb8')](function(_0x2cefd7,_0xfb13e9){if(_0xfb13e9){return _0x2cefd7;}return db[_0xf137('0xa4')]['create']({'direction':_0xf137('0xb9'),'read':![],'body':_0x2addb7[_0xf137('0x60')][_0xf137('0xab')][0x0]['filename'],'FaxAccountId':_0x86bac['id'],'FaxInteractionId':_0x2cefd7['id'],'UserId':_0x2addb7['user']['id'],'ContactId':_0x2cefd7['ContactId'],'AttachmentId':_0x2addb7[_0xf137('0x60')][_0xf137('0xab')][0x0]['id']})[_0xf137('0x1f')](function(_0x300a3a){_0x2cefd7[_0xf137('0xba')][_0xf137('0xbb')]=[];_0x2cefd7[_0xf137('0xba')]['Messages'][_0xf137('0x8d')](_0x300a3a[_0xf137('0xba')]);return _0x2cefd7;});})['then'](function(_0x5e82ef){respondWithRpcPromise(_0xf137('0xbc'),_0xf137('0xbc'),{'FaxAccountId':_[_0xf137('0xaf')](_0x2addb7['params']['id'])?undefined:_0x2addb7['params']['id'],'path':_['isNil'](_0x2addb7[_0xf137('0x60')]['attachments'][0x0][_0xf137('0x4')])?undefined:_0x2addb7['body'][_0xf137('0xab')][0x0][_0xf137('0x4')],'fax':_[_0xf137('0xaf')](_0x2addb7[_0xf137('0x60')]['to'][0x0])?undefined:_0x2addb7[_0xf137('0x60')]['to'][0x0],'AttachmentId':_0x2addb7[_0xf137('0x60')][_0xf137('0xab')][0x0]['id']},client9002)[_0xf137('0x1f')](function(_0x7ca804){logger[_0xf137('0x20')]('SendFaxRpc,\x20%s',_0x7ca804);})[_0xf137('0x28')](function(_0x5d3528){logger[_0xf137('0x20')](_0xf137('0xbd'),_0x5d3528);});return _0x5e82ef;})[_0xf137('0x1f')](respondWithResult(_0x349392,null))[_0xf137('0x28')](handleError(_0x349392,null));};exports[_0xf137('0xbe')]=function(_0x18f539,_0x23ade1,_0x4c65a2){return db[_0xf137('0x3e')]['find']({'where':{'id':_0x18f539[_0xf137('0x61')]['id']}})['then'](handleEntityNotFound(_0x23ade1,null))['then'](function(_0x24138d){if(_0x24138d){return _0x24138d[_0xf137('0xbe')](_0x18f539[_0xf137('0x60')][_0xf137('0x69')],_['omit'](_0x18f539[_0xf137('0x60')],[_0xf137('0x69'),'id'])||{})[_0xf137('0xb8')](function(_0xb55d8c){for(var _0x32adaa=0x0;_0x32adaa<_0x18f539[_0xf137('0x60')][_0xf137('0x69')]['length'];_0x32adaa+=0x1){socket[_0xf137('0xbf')](_0xf137('0xc0'),{'UserId':Number(_0x18f539[_0xf137('0x60')][_0xf137('0x69')][_0x32adaa]),'FaxAccountId':Number(_0x18f539[_0xf137('0x61')]['id'])});}return _0xb55d8c;});}})[_0xf137('0x1f')](respondWithResult(_0x23ade1,null))[_0xf137('0x28')](handleError(_0x23ade1,null));};exports[_0xf137('0xc1')]=function(_0x55b7d1,_0x892026,_0x4d7b5d){return db[_0xf137('0x3e')][_0xf137('0x5a')]({'where':{'id':_0x55b7d1[_0xf137('0x61')]['id']}})[_0xf137('0x1f')](handleEntityNotFound(_0x892026,null))[_0xf137('0x1f')](function(_0x3f1018){if(_0x3f1018){return _0x3f1018[_0xf137('0xc1')](_0x55b7d1['query'][_0xf137('0x69')])['then'](function(){if(_['isArray'](_0x55b7d1[_0xf137('0x44')][_0xf137('0x69')])){for(var _0x77514a=0x0;_0x77514a<_0x55b7d1['query']['ids'][_0xf137('0x49')];_0x77514a+=0x1){socket[_0xf137('0xbf')]('userFaxAccount:remove',{'UserId':Number(_0x55b7d1['query'][_0xf137('0x69')][_0x77514a]),'FaxAccountId':Number(_0x55b7d1[_0xf137('0x61')]['id'])});}}else{socket[_0xf137('0xbf')](_0xf137('0xc2'),{'UserId':Number(_0x55b7d1[_0xf137('0x44')][_0xf137('0x69')]),'FaxAccountId':Number(_0x55b7d1[_0xf137('0x61')]['id'])});}});}})[_0xf137('0x1f')](respondWithStatusCode(_0x892026,null))[_0xf137('0x28')](handleError(_0x892026,null));};exports['getAgents']=function(_0x164fd1,_0x393eb8,_0xcea343){var _0x1c16fd={};var _0x54f0a2={};var _0x1c1ebc;var _0x2343f0;return db[_0xf137('0x3e')][_0xf137('0x67')]({'where':{'id':_0x164fd1[_0xf137('0x61')]['id']}})[_0xf137('0x1f')](handleEntityNotFound(_0x393eb8,null))[_0xf137('0x1f')](function(_0x4b0f10){if(_0x4b0f10){_0x1c1ebc=_0x4b0f10;_0x54f0a2[_0xf137('0x42')]=_[_0xf137('0x45')](db[_0xf137('0x73')]['rawAttributes']);_0x54f0a2[_0xf137('0x44')]=_[_0xf137('0x45')](_0x164fd1[_0xf137('0x44')]);_0x54f0a2[_0xf137('0x46')]=_[_0xf137('0x59')](_0x54f0a2[_0xf137('0x42')],_0x54f0a2['query']);_0x1c16fd['attributes']=_[_0xf137('0x59')](_0x54f0a2['model'],qs[_0xf137('0x48')](_0x164fd1[_0xf137('0x44')]['fields']));_0x1c16fd[_0xf137('0x47')]=_0x1c16fd[_0xf137('0x47')][_0xf137('0x49')]?_0x1c16fd[_0xf137('0x47')]:_0x54f0a2[_0xf137('0x42')];_0x1c16fd[_0xf137('0x4c')]=qs[_0xf137('0x4d')](_0x164fd1[_0xf137('0x44')]['sort']);_0x1c16fd[_0xf137('0x4f')]=qs[_0xf137('0x46')](_[_0xf137('0x4e')](_0x164fd1['query'],_0x54f0a2['filters']));if(_0x164fd1[_0xf137('0x44')][_0xf137('0x51')]){_0x1c16fd['where']=_[_0xf137('0x50')](_0x1c16fd[_0xf137('0x4f')],{'$or':_[_0xf137('0x43')](_0x1c16fd[_0xf137('0x47')],function(_0x2507df){var _0x44e5a2={};_0x44e5a2[_0x2507df]={'$like':'%'+_0x164fd1[_0xf137('0x44')][_0xf137('0x51')]+'%'};return _0x44e5a2;})});}_0x1c16fd=_[_0xf137('0x50')]({},_0x1c16fd,_0x164fd1[_0xf137('0x52')]);return _0x1c1ebc[_0xf137('0xc3')](_0x1c16fd);}})[_0xf137('0x1f')](function(_0x406050){if(_0x406050){_0x2343f0=_0x406050[_0xf137('0x49')];if(!_0x164fd1[_0xf137('0x44')][_0xf137('0x4a')]('nolimit')){_0x1c16fd[_0xf137('0x2c')]=qs[_0xf137('0x2c')](_0x164fd1[_0xf137('0x44')][_0xf137('0x2c')]);_0x1c16fd[_0xf137('0x2e')]=qs[_0xf137('0x2e')](_0x164fd1[_0xf137('0x44')][_0xf137('0x2e')]);}return _0x1c1ebc[_0xf137('0xc3')](_0x1c16fd);}})[_0xf137('0x1f')](function(_0x374368){if(_0x374368){return _0x374368?{'count':_0x2343f0,'rows':_0x374368}:null;}})[_0xf137('0x1f')](respondWithResult(_0x393eb8,null))['catch'](handleError(_0x393eb8,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index dc00a52..2cea2aa 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 _0x01dd=['hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','update','remove','emit'];(function(_0x3d6897,_0x49156b){var _0x33a9f9=function(_0x2947e4){while(--_0x2947e4){_0x3d6897['push'](_0x3d6897['shift']());}};_0x33a9f9(++_0x49156b);}(_0x01dd,0x1b0));var _0xd01d=function(_0x238671,_0x34aea0){_0x238671=_0x238671-0x0;var _0x474844=_0x01dd[_0x238671];return _0x474844;};'use strict';var EventEmitter=require(_0xd01d('0x0'));var FaxAccount=require(_0xd01d('0x1'))['db'][_0xd01d('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xd01d('0x3')](0x0);var events={'afterCreate':_0xd01d('0x4'),'afterUpdate':_0xd01d('0x5'),'afterDestroy':_0xd01d('0x6')};function emitEvent(_0x389eff){return function(_0x4fcf16,_0x1eee02,_0x32f59b){FaxAccountEvents[_0xd01d('0x7')](_0x389eff+':'+_0x4fcf16['id'],_0x4fcf16);FaxAccountEvents[_0xd01d('0x7')](_0x389eff,_0x4fcf16);_0x32f59b(null);};}for(var e in events){if(events[_0xd01d('0x8')](e)){var event=events[e];FaxAccount[_0xd01d('0x9')](e,emitEvent(event));}}module[_0xd01d('0xa')]=FaxAccountEvents; \ No newline at end of file +var _0x546f=['setMaxListeners','save','update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','FaxAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x546f,0xf7));var _0xf546=function(_0x311e78,_0xbcf8ca){_0x311e78=_0x311e78-0x0;var _0x44fef6=_0x546f[_0x311e78];return _0x44fef6;};'use strict';var EventEmitter=require(_0xf546('0x0'));var FaxAccount=require(_0xf546('0x1'))['db'][_0xf546('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf546('0x3')](0x0);var events={'afterCreate':_0xf546('0x4'),'afterUpdate':_0xf546('0x5'),'afterDestroy':_0xf546('0x6')};function emitEvent(_0x379a7d){return function(_0x3c3344,_0x354c82,_0x535f2e){FaxAccountEvents['emit'](_0x379a7d+':'+_0x3c3344['id'],_0x3c3344);FaxAccountEvents['emit'](_0x379a7d,_0x3c3344);_0x535f2e(null);};}for(var e in events){if(events[_0xf546('0x7')](e)){var event=events[e];FaxAccount[_0xf546('0x8')](e,emitEvent(event));}}module[_0xf546('0x9')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 727b5d7..1fc695d 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 _0x4415=['bluebird','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','fax_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x141d9d,_0x19f8b2){var _0x5e89e8=function(_0x4df965){while(--_0x4df965){_0x141d9d['push'](_0x141d9d['shift']());}};_0x5e89e8(++_0x19f8b2);}(_0x4415,0x133));var _0x5441=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0x4415[_0x368fb9];return _0x4892fb;};'use strict';var _=require(_0x5441('0x0'));var util=require(_0x5441('0x1'));var logger=require(_0x5441('0x2'))(_0x5441('0x3'));var moment=require(_0x5441('0x4'));var BPromise=require(_0x5441('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5441('0x6'));var rimraf=require(_0x5441('0x7'));var config=require(_0x5441('0x8'));var attributes=require(_0x5441('0x9'));module[_0x5441('0xa')]=function(_0x4466fa,_0x170322){return _0x4466fa[_0x5441('0xb')]('FaxAccount',attributes,{'tableName':_0x5441('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c9c=['../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0xba3943,_0x5bd4d3){var _0x76c933=function(_0x21361f){while(--_0x21361f){_0xba3943['push'](_0xba3943['shift']());}};_0x76c933(++_0x5bd4d3);}(_0x5c9c,0x1c0));var _0xc5c9=function(_0x57fe6c,_0x4e7465){_0x57fe6c=_0x57fe6c-0x0;var _0x5167f6=_0x5c9c[_0x57fe6c];return _0x5167f6;};'use strict';var _=require(_0xc5c9('0x0'));var util=require(_0xc5c9('0x1'));var logger=require(_0xc5c9('0x2'))('api');var moment=require(_0xc5c9('0x3'));var BPromise=require(_0xc5c9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc5c9('0x5'));var rimraf=require(_0xc5c9('0x6'));var config=require(_0xc5c9('0x7'));var attributes=require(_0xc5c9('0x8'));module[_0xc5c9('0x9')]=function(_0x56343d,_0x1b299d){return _0x56343d[_0xc5c9('0xa')](_0xc5c9('0xb'),attributes,{'tableName':_0xc5c9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index 24dd92d..fa00687 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 _0x3d0c=['http','redis','socket.io-emitter','./faxAccount.socket','register','request','then','info','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','catch','FaxAccount','findAll','options','where','attributes','include','map','model','GetFaxAccount','debug','NotifyFaxAccount','body','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','list','orderBy','applications','priority','asc','length','create','contact','fax','FaxInteraction','Contact\x20not\x20found','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x51bbb0,_0xd9ea53){var _0x4afad1=function(_0x25f2a3){while(--_0x25f2a3){_0x51bbb0['push'](_0x51bbb0['shift']());}};_0x4afad1(++_0xd9ea53);}(_0x3d0c,0x1c7));var _0xc3d0=function(_0x290694,_0x281935){_0x290694=_0x290694-0x0;var _0x5a0f2e=_0x3d0c[_0x290694];return _0x5a0f2e;};'use strict';var _=require(_0xc3d0('0x0'));var util=require(_0xc3d0('0x1'));var moment=require(_0xc3d0('0x2'));var BPromise=require(_0xc3d0('0x3'));var rs=require(_0xc3d0('0x4'));var fs=require('fs');var Redis=require(_0xc3d0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc3d0('0x6'))('rpc');var config=require(_0xc3d0('0x7'));var jayson=require(_0xc3d0('0x8'));var client=jayson[_0xc3d0('0x9')][_0xc3d0('0xa')]({'port':0x232c});config[_0xc3d0('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc3d0('0xc'))(new Redis(config[_0xc3d0('0xb')]));require(_0xc3d0('0xd'))[_0xc3d0('0xe')](socket);function respondWithRpcPromise(_0x1051e2,_0x5e8b21,_0x525aa5){return new BPromise(function(_0x35acf9,_0x10b7b0){return client[_0xc3d0('0xf')](_0x1051e2,_0x525aa5)[_0xc3d0('0x10')](function(_0x33c86b){logger[_0xc3d0('0x11')]('FaxAccount,\x20%s,\x20%s',_0x5e8b21,_0xc3d0('0x12'));logger['debug'](_0xc3d0('0x13'),_0x5e8b21,'request\x20sent',JSON[_0xc3d0('0x14')](_0x33c86b));if(_0x33c86b[_0xc3d0('0x15')]){if(_0x33c86b[_0xc3d0('0x15')][_0xc3d0('0x16')]===0x1f4){logger[_0xc3d0('0x15')](_0xc3d0('0x17'),_0x5e8b21,_0x33c86b[_0xc3d0('0x15')]['message']);return _0x10b7b0(_0x33c86b[_0xc3d0('0x15')][_0xc3d0('0x18')]);}logger[_0xc3d0('0x15')](_0xc3d0('0x17'),_0x5e8b21,_0x33c86b[_0xc3d0('0x15')][_0xc3d0('0x18')]);return _0x35acf9(_0x33c86b[_0xc3d0('0x15')][_0xc3d0('0x18')]);}else{logger['info'](_0xc3d0('0x17'),_0x5e8b21,_0xc3d0('0x12'));_0x35acf9(_0x33c86b['result'][_0xc3d0('0x18')]);}})[_0xc3d0('0x19')](function(_0x40eab7){logger[_0xc3d0('0x15')](_0xc3d0('0x17'),_0x5e8b21,_0x40eab7);_0x10b7b0(_0x40eab7);});});}exports['GetFaxAccount']=function(_0x3b87b1){var _0x57e440=this;return new Promise(function(_0x573e13,_0x2b4c17){return db[_0xc3d0('0x1a')][_0xc3d0('0x1b')]({'raw':_0x3b87b1['options']?_0x3b87b1['options']['raw']===undefined?!![]:![]:!![],'where':_0x3b87b1['options']?_0x3b87b1[_0xc3d0('0x1c')][_0xc3d0('0x1d')]||null:null,'attributes':_0x3b87b1['options']?_0x3b87b1[_0xc3d0('0x1c')][_0xc3d0('0x1e')]||null:null,'limit':_0x3b87b1['options']?_0x3b87b1['options']['limit']||null:null,'include':_0x3b87b1[_0xc3d0('0x1c')]?_0x3b87b1[_0xc3d0('0x1c')][_0xc3d0('0x1f')]?_[_0xc3d0('0x20')](_0x3b87b1[_0xc3d0('0x1c')][_0xc3d0('0x1f')],function(_0x152182){return{'model':db[_0x152182[_0xc3d0('0x21')]],'as':_0x152182['as'],'attributes':_0x152182[_0xc3d0('0x1e')],'include':_0x152182[_0xc3d0('0x1f')]?_[_0xc3d0('0x20')](_0x152182[_0xc3d0('0x1f')],function(_0x4f03d8){return{'model':db[_0x4f03d8[_0xc3d0('0x21')]],'as':_0x4f03d8['as'],'attributes':_0x4f03d8[_0xc3d0('0x1e')],'include':_0x4f03d8[_0xc3d0('0x1f')]?_[_0xc3d0('0x20')](_0x4f03d8[_0xc3d0('0x1f')],function(_0x216c11){return{'model':db[_0x216c11[_0xc3d0('0x21')]],'as':_0x216c11['as'],'attributes':_0x216c11[_0xc3d0('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x766cca){logger['info'](_0xc3d0('0x22'),_0x3b87b1);logger[_0xc3d0('0x23')](_0xc3d0('0x22'),_0x3b87b1,JSON['stringify'](_0x766cca));_0x573e13(_0x766cca);})[_0xc3d0('0x19')](function(_0x91ee70){logger[_0xc3d0('0x15')]('GetFaxAccount',_0x91ee70['message'],_0x3b87b1);_0x2b4c17(_0x57e440[_0xc3d0('0x15')](0x1f4,_0x91ee70[_0xc3d0('0x18')]));});});};exports[_0xc3d0('0x24')]=function(_0x4c9540,_0x501d85,_0x31d516){var _0xeb84df=this;return new Promise(function(_0x100ef8,_0xdf95a6){var _0x18735a={'body':_0x4c9540[_0xc3d0('0x25')],'channel':'fax'};var _0x58eb7c=[];var _0x3c4936=[];var _0x14294d={};return db[_0xc3d0('0x26')][_0xc3d0('0x27')]()[_0xc3d0('0x10')](function(_0x14684f){if(!_0x14684f){throw new db[(_0xc3d0('0x28'))][(_0xc3d0('0x29'))](_0xc3d0('0x2a'));}_0x58eb7c=_[_0xc3d0('0x2b')](_[_0xc3d0('0x2c')](_0x14684f),[_0xc3d0('0x2d'),_0xc3d0('0x2e')]);_0x3c4936=_[_0xc3d0('0x2b')](_['keys'](_0x14684f),[_0xc3d0('0x2d'),_0xc3d0('0x2e'),_0xc3d0('0x2f'),_0xc3d0('0x30')]);if(_0x4c9540[_0xc3d0('0x25')]['id']){delete _0x4c9540['body']['id'];}if(_[_0xc3d0('0x31')](_0x4c9540[_0xc3d0('0x25')][_0xc3d0('0x32')])){throw new db[(_0xc3d0('0x28'))][(_0xc3d0('0x29'))](_0xc3d0('0x33'));}if(_[_0xc3d0('0x31')](_0x4c9540['body'][_0xc3d0('0x25')])||_0x4c9540[_0xc3d0('0x25')][_0xc3d0('0x25')]===''){throw new db['Sequelize'][(_0xc3d0('0x29'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xc3d0('0x31')](_0x4c9540[_0xc3d0('0x25')][_0xc3d0('0x34')])){throw new db[(_0xc3d0('0x28'))][(_0xc3d0('0x29'))](_0xc3d0('0x35')+_0x3c4936);}if(!_[_0xc3d0('0x36')](_0x3c4936,_0x4c9540[_0xc3d0('0x25')][_0xc3d0('0x34')])){throw new db[(_0xc3d0('0x28'))]['ValidationError'](_0xc3d0('0x37')+_0x3c4936);}_0x14294d[_0x4c9540['body'][_0xc3d0('0x34')]]=_0x4c9540['body'][_0xc3d0('0x32')];})['then'](function(){return db['FaxAccount'][_0xc3d0('0x38')]({'where':{'id':_0x4c9540[_0xc3d0('0x39')]['id']},'include':[{'model':db[_0xc3d0('0x3a')],'as':_0xc3d0('0x3b'),'include':[{'model':db[_0xc3d0('0x26')],'as':_0xc3d0('0x3c'),'where':_0x14294d,'limit':0x1,'order':[[_0xc3d0('0x2e'),_0xc3d0('0x3d')]]}]},{'model':db[_0xc3d0('0x3e')],'as':_0xc3d0('0x3f')}]});})[_0xc3d0('0x10')](function(_0x3af87d){if(_0x3af87d&&_0x3af87d[_0xc3d0('0x3b')]){var _0x178102=_0x3af87d[_0xc3d0('0x40')]({'plain':!![]});_0x18735a[_0xc3d0('0x39')]=_0x178102;_0x18735a['applications']=_0x178102[_0xc3d0('0x3f')];_0x18735a[_0xc3d0('0x41')]=_0x178102[_0xc3d0('0x3b')];_0x18735a['applications']=_[_0xc3d0('0x42')](_0x18735a[_0xc3d0('0x43')],[_0xc3d0('0x44')],[_0xc3d0('0x45')]);if(_0x18735a[_0xc3d0('0x39')]['Applications']){delete _0x18735a[_0xc3d0('0x39')][_0xc3d0('0x3f')];}if(_0x18735a[_0xc3d0('0x39')][_0xc3d0('0x3b')]&&_0x18735a[_0xc3d0('0x39')][_0xc3d0('0x3b')][_0xc3d0('0x3c')][_0xc3d0('0x46')]){return _0x18735a[_0xc3d0('0x39')]['List']['Contacts'][0x0];}var _0x2d0973=_['defaults'](_0x4c9540[_0xc3d0('0x25')],{'firstName':_0x4c9540['body'][_0xc3d0('0x32')],'ListId':_0x178102[_0xc3d0('0x30')]});_0x2d0973[_0x4c9540[_0xc3d0('0x25')][_0xc3d0('0x34')]]=_0x4c9540[_0xc3d0('0x25')][_0xc3d0('0x32')];return db['CmContact'][_0xc3d0('0x47')](_0x2d0973,{'fields':_0x58eb7c,'raw':!![]});}})[_0xc3d0('0x10')](function(_0x538add){_0x18735a[_0xc3d0('0x48')]=_0x538add;if(_0x538add){var _0x1ec40f={'ContactId':_0x538add['id'],'FaxAccountId':_0x4c9540[_0xc3d0('0x39')]['id'],'fax':_0x538add[_0xc3d0('0x49')]};return db['FaxInteraction'][_0xc3d0('0x38')]({'where':{'ContactId':_0x538add['id'],'closed':![],'FaxAccountId':_0x4c9540['account']['id']}})[_0xc3d0('0x10')](function(_0x43256d){if(_0x43256d){return[_0x43256d,![]];}return db[_0xc3d0('0x4a')][_0xc3d0('0x47')](_0x1ec40f)[_0xc3d0('0x10')](function(_0x4cab94){return[_0x4cab94,!![]];});});}else{throw new Error(_0xc3d0('0x4b'));}})['spread'](function(_0x58bc3c,_0x578a5a){var _0x5da6dd=_0x58bc3c['get']({'plain':!![]});if(_0x578a5a){if(_0x18735a[_0xc3d0('0x39')][_0xc3d0('0x4c')]){_0x18735a[_0xc3d0('0x43')][_0xc3d0('0x4d')]({'id':0x0,'priority':_0x18735a['applications'][_0xc3d0('0x46')]+0x1,'app':_0xc3d0('0x4e'),'appdata':_0xc3d0('0x4f'),'interval':_0xc3d0('0x50')});}_0x5da6dd[_0xc3d0('0x51')]=!![];}else{_0x5da6dd[_0xc3d0('0x51')]=![];}_0x18735a[_0xc3d0('0x52')]=_0x5da6dd;return db[_0xc3d0('0x53')][_0xc3d0('0x47')]({'body':_0x4c9540[_0xc3d0('0x25')][_0xc3d0('0x25')],'FaxAccountId':_0x4c9540[_0xc3d0('0x39')]['id'],'FaxInteractionId':_0x58bc3c['id'],'direction':'in','ContactId':_0x58bc3c[_0xc3d0('0x54')],'AttachmentId':_0x4c9540[_0xc3d0('0x25')]['AttachmentId']});})[_0xc3d0('0x10')](function(_0x418da2){_0x18735a[_0xc3d0('0x18')]=_0x418da2;if(_0x18735a[_0xc3d0('0x52')][_0xc3d0('0x55')]){return db[_0xc3d0('0x56')][_0xc3d0('0x38')]({'attributes':['id',_0xc3d0('0x57')],'where':{'id':_0x18735a[_0xc3d0('0x52')][_0xc3d0('0x55')]}})[_0xc3d0('0x10')](function(_0x584a6b){if(_0x584a6b){_0x18735a[_0xc3d0('0x43')][_0xc3d0('0x58')]({'id':0x0,'priority':0x0,'app':_0xc3d0('0x59'),'appdata':_0x584a6b[_0xc3d0('0x57')]+','+(_0x18735a['account'][_0xc3d0('0x5a')]||0xa),'interval':_0xc3d0('0x50')});}return respondWithRpcPromise(_0xc3d0('0x5b'),_0xc3d0('0x5c'),_0x18735a);});}return respondWithRpcPromise(_0xc3d0('0x5b'),'startRouting',_0x18735a);})[_0xc3d0('0x10')](function(_0x559416){_0x100ef8(_0x559416);})[_0xc3d0('0x19')](function(_0x5de807){_0xdf95a6(_0xeb84df[_0xc3d0('0x15')](0x1f4,_0x5de807[_0xc3d0('0x18')]));});});}; \ No newline at end of file +var _0xffed=['FaxApplication','Applications','list','orderBy','applications','priority','from','create','fax','FaxInteraction','find','Contact\x20not\x20found','get','push','close','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','User','name','waitForTheAssignedAgent','Start','startRouting','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxAccount.socket','request','then','info','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','GetFaxAccount','FaxAccount','options','where','attributes','limit','include','model','map','NotifyFaxAccount','body','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','isNil','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','DESC'];(function(_0x46fe2b,_0x3931b3){var _0x33a923=function(_0x286913){while(--_0x286913){_0x46fe2b['push'](_0x46fe2b['shift']());}};_0x33a923(++_0x3931b3);}(_0xffed,0xc4));var _0xdffe=function(_0x592030,_0x19ca68){_0x592030=_0x592030-0x0;var _0x3ea820=_0xffed[_0x592030];return _0x3ea820;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdffe('0x0'));var BPromise=require(_0xdffe('0x1'));var rs=require(_0xdffe('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdffe('0x3'))['db'];var utils=require(_0xdffe('0x4'));var logger=require('../../config/logger')(_0xdffe('0x5'));var config=require(_0xdffe('0x6'));var jayson=require(_0xdffe('0x7'));var client=jayson[_0xdffe('0x8')][_0xdffe('0x9')]({'port':0x232c});config[_0xdffe('0xa')]=_[_0xdffe('0xb')](config['redis'],{'host':_0xdffe('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdffe('0xa')]));require(_0xdffe('0xd'))['register'](socket);function respondWithRpcPromise(_0xced7f,_0x49dab7,_0x1eb654){return new BPromise(function(_0xd3ad24,_0x14be78){return client[_0xdffe('0xe')](_0xced7f,_0x1eb654)[_0xdffe('0xf')](function(_0x1a1719){logger[_0xdffe('0x10')]('FaxAccount,\x20%s,\x20%s',_0x49dab7,_0xdffe('0x11'));logger[_0xdffe('0x12')](_0xdffe('0x13'),_0x49dab7,_0xdffe('0x11'),JSON[_0xdffe('0x14')](_0x1a1719));if(_0x1a1719['error']){if(_0x1a1719[_0xdffe('0x15')][_0xdffe('0x16')]===0x1f4){logger['error'](_0xdffe('0x17'),_0x49dab7,_0x1a1719['error'][_0xdffe('0x18')]);return _0x14be78(_0x1a1719[_0xdffe('0x15')]['message']);}logger[_0xdffe('0x15')](_0xdffe('0x17'),_0x49dab7,_0x1a1719[_0xdffe('0x15')]['message']);return _0xd3ad24(_0x1a1719[_0xdffe('0x15')][_0xdffe('0x18')]);}else{logger[_0xdffe('0x10')](_0xdffe('0x17'),_0x49dab7,_0xdffe('0x11'));_0xd3ad24(_0x1a1719[_0xdffe('0x19')][_0xdffe('0x18')]);}})['catch'](function(_0x4f1900){logger[_0xdffe('0x15')](_0xdffe('0x17'),_0x49dab7,_0x4f1900);_0x14be78(_0x4f1900);});});}exports[_0xdffe('0x1a')]=function(_0x3a8699){var _0x13aae8=this;return new Promise(function(_0x29e8c5,_0xadbabc){return db[_0xdffe('0x1b')]['findAll']({'raw':_0x3a8699[_0xdffe('0x1c')]?_0x3a8699['options']['raw']===undefined?!![]:![]:!![],'where':_0x3a8699[_0xdffe('0x1c')]?_0x3a8699[_0xdffe('0x1c')][_0xdffe('0x1d')]||null:null,'attributes':_0x3a8699[_0xdffe('0x1c')]?_0x3a8699[_0xdffe('0x1c')][_0xdffe('0x1e')]||null:null,'limit':_0x3a8699[_0xdffe('0x1c')]?_0x3a8699[_0xdffe('0x1c')][_0xdffe('0x1f')]||null:null,'include':_0x3a8699[_0xdffe('0x1c')]?_0x3a8699[_0xdffe('0x1c')]['include']?_['map'](_0x3a8699[_0xdffe('0x1c')][_0xdffe('0x20')],function(_0x5addb2){return{'model':db[_0x5addb2[_0xdffe('0x21')]],'as':_0x5addb2['as'],'attributes':_0x5addb2[_0xdffe('0x1e')],'include':_0x5addb2['include']?_[_0xdffe('0x22')](_0x5addb2['include'],function(_0x207f6d){return{'model':db[_0x207f6d[_0xdffe('0x21')]],'as':_0x207f6d['as'],'attributes':_0x207f6d['attributes'],'include':_0x207f6d[_0xdffe('0x20')]?_[_0xdffe('0x22')](_0x207f6d['include'],function(_0x1b6bde){return{'model':db[_0x1b6bde[_0xdffe('0x21')]],'as':_0x1b6bde['as'],'attributes':_0x1b6bde[_0xdffe('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xdffe('0xf')](function(_0x3e0929){logger['info'](_0xdffe('0x1a'),_0x3a8699);logger[_0xdffe('0x12')](_0xdffe('0x1a'),_0x3a8699,JSON[_0xdffe('0x14')](_0x3e0929));_0x29e8c5(_0x3e0929);})['catch'](function(_0xb14426){logger[_0xdffe('0x15')](_0xdffe('0x1a'),_0xb14426[_0xdffe('0x18')],_0x3a8699);_0xadbabc(_0x13aae8[_0xdffe('0x15')](0x1f4,_0xb14426[_0xdffe('0x18')]));});});};exports[_0xdffe('0x23')]=function(_0x9b48e2,_0x53090d,_0x56b732){var _0x3983e4=this;return new Promise(function(_0x85935f,_0x1cdc74){var _0x3f025c={'body':_0x9b48e2[_0xdffe('0x24')],'channel':'fax'};var _0x32e850=[];var _0x3a39bf=[];var _0x4f75ba={};return db[_0xdffe('0x25')][_0xdffe('0x26')]()['then'](function(_0x327e88){if(!_0x327e88){throw new db[(_0xdffe('0x27'))]['ValidationError'](_0xdffe('0x28'));}_0x32e850=_[_0xdffe('0x29')](_[_0xdffe('0x2a')](_0x327e88),[_0xdffe('0x2b'),_0xdffe('0x2c')]);_0x3a39bf=_[_0xdffe('0x29')](_[_0xdffe('0x2a')](_0x327e88),[_0xdffe('0x2b'),'updatedAt',_0xdffe('0x2d'),_0xdffe('0x2e')]);if(_0x9b48e2[_0xdffe('0x24')]['id']){delete _0x9b48e2[_0xdffe('0x24')]['id'];}if(_['isNil'](_0x9b48e2['body']['from'])){throw new db[(_0xdffe('0x27'))]['ValidationError'](_0xdffe('0x2f'));}if(_[_0xdffe('0x30')](_0x9b48e2[_0xdffe('0x24')][_0xdffe('0x24')])||_0x9b48e2[_0xdffe('0x24')][_0xdffe('0x24')]===''){throw new db[(_0xdffe('0x27'))][(_0xdffe('0x31'))](_0xdffe('0x32'));}if(_['isNil'](_0x9b48e2[_0xdffe('0x24')]['mapKey'])){throw new db[(_0xdffe('0x27'))][(_0xdffe('0x31'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3a39bf);}if(!_[_0xdffe('0x33')](_0x3a39bf,_0x9b48e2[_0xdffe('0x24')][_0xdffe('0x34')])){throw new db[(_0xdffe('0x27'))][(_0xdffe('0x31'))](_0xdffe('0x35')+_0x3a39bf);}_0x4f75ba[_0x9b48e2['body'][_0xdffe('0x34')]]=_0x9b48e2['body']['from'];})['then'](function(){return db[_0xdffe('0x1b')]['find']({'where':{'id':_0x9b48e2[_0xdffe('0x36')]['id']},'include':[{'model':db[_0xdffe('0x37')],'as':_0xdffe('0x38'),'include':[{'model':db['CmContact'],'as':_0xdffe('0x39'),'where':_0x4f75ba,'limit':0x1,'order':[[_0xdffe('0x2c'),_0xdffe('0x3a')]]}]},{'model':db[_0xdffe('0x3b')],'as':_0xdffe('0x3c')}]});})[_0xdffe('0xf')](function(_0x4b1525){if(_0x4b1525&&_0x4b1525['List']){var _0x89d764=_0x4b1525['get']({'plain':!![]});_0x3f025c[_0xdffe('0x36')]=_0x89d764;_0x3f025c['applications']=_0x89d764[_0xdffe('0x3c')];_0x3f025c[_0xdffe('0x3d')]=_0x89d764['List'];_0x3f025c['applications']=_[_0xdffe('0x3e')](_0x3f025c[_0xdffe('0x3f')],[_0xdffe('0x40')],['asc']);if(_0x3f025c[_0xdffe('0x36')]['Applications']){delete _0x3f025c[_0xdffe('0x36')][_0xdffe('0x3c')];}if(_0x3f025c[_0xdffe('0x36')][_0xdffe('0x38')]&&_0x3f025c['account'][_0xdffe('0x38')][_0xdffe('0x39')]['length']){return _0x3f025c[_0xdffe('0x36')][_0xdffe('0x38')][_0xdffe('0x39')][0x0];}var _0x1c99c9=_[_0xdffe('0xb')](_0x9b48e2[_0xdffe('0x24')],{'firstName':_0x9b48e2['body']['from'],'ListId':_0x89d764[_0xdffe('0x2e')]});_0x1c99c9[_0x9b48e2[_0xdffe('0x24')][_0xdffe('0x34')]]=_0x9b48e2[_0xdffe('0x24')][_0xdffe('0x41')];return db[_0xdffe('0x25')][_0xdffe('0x42')](_0x1c99c9,{'fields':_0x32e850,'raw':!![]});}})[_0xdffe('0xf')](function(_0x450b38){_0x3f025c['contact']=_0x450b38;if(_0x450b38){var _0x2ea042={'ContactId':_0x450b38['id'],'FaxAccountId':_0x9b48e2[_0xdffe('0x36')]['id'],'fax':_0x450b38[_0xdffe('0x43')]};return db[_0xdffe('0x44')][_0xdffe('0x45')]({'where':{'ContactId':_0x450b38['id'],'closed':![],'FaxAccountId':_0x9b48e2[_0xdffe('0x36')]['id']}})[_0xdffe('0xf')](function(_0x152cf9){if(_0x152cf9){return[_0x152cf9,![]];}return db[_0xdffe('0x44')][_0xdffe('0x42')](_0x2ea042)[_0xdffe('0xf')](function(_0x21273d){return[_0x21273d,!![]];});});}else{throw new Error(_0xdffe('0x46'));}})['spread'](function(_0x43a083,_0x1dd071){var _0xbd9039=_0x43a083[_0xdffe('0x47')]({'plain':!![]});if(_0x1dd071){if(_0x3f025c[_0xdffe('0x36')]['autoclose']){_0x3f025c[_0xdffe('0x3f')][_0xdffe('0x48')]({'id':0x0,'priority':_0x3f025c[_0xdffe('0x3f')]['length']+0x1,'app':_0xdffe('0x49'),'appdata':'unmanaged','interval':_0xdffe('0x4a')});}_0xbd9039['created']=!![];}else{_0xbd9039[_0xdffe('0x4b')]=![];}_0x3f025c[_0xdffe('0x4c')]=_0xbd9039;return db[_0xdffe('0x4d')][_0xdffe('0x42')]({'body':_0x9b48e2[_0xdffe('0x24')][_0xdffe('0x24')],'FaxAccountId':_0x9b48e2[_0xdffe('0x36')]['id'],'FaxInteractionId':_0x43a083['id'],'direction':'in','ContactId':_0x43a083['ContactId'],'AttachmentId':_0x9b48e2[_0xdffe('0x24')][_0xdffe('0x4e')]});})[_0xdffe('0xf')](function(_0x1339b8){_0x3f025c['message']=_0x1339b8;if(_0x3f025c[_0xdffe('0x4c')][_0xdffe('0x4f')]){return db[_0xdffe('0x50')][_0xdffe('0x45')]({'attributes':['id',_0xdffe('0x51')],'where':{'id':_0x3f025c[_0xdffe('0x4c')][_0xdffe('0x4f')]}})[_0xdffe('0xf')](function(_0x8bdfc9){if(_0x8bdfc9){_0x3f025c['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x8bdfc9[_0xdffe('0x51')]+','+(_0x3f025c[_0xdffe('0x36')][_0xdffe('0x52')]||0xa),'interval':_0xdffe('0x4a')});}return respondWithRpcPromise(_0xdffe('0x53'),_0xdffe('0x54'),_0x3f025c);});}return respondWithRpcPromise(_0xdffe('0x53'),_0xdffe('0x54'),_0x3f025c);})[_0xdffe('0xf')](function(_0x229edf){_0x85935f(_0x229edf);})['catch'](function(_0xffbf4e){_0x1cdc74(_0x3983e4['error'](0x1f4,_0xffbf4e[_0xdffe('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 4b3e1b4..74bef55 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 _0x404e=['save','update','emit','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x21f4e4,_0x326a84){var _0x5d7709=function(_0x572f77){while(--_0x572f77){_0x21f4e4['push'](_0x21f4e4['shift']());}};_0x5d7709(++_0x326a84);}(_0x404e,0x8f));var _0xe404=function(_0x39bc44,_0x1d4373){_0x39bc44=_0x39bc44-0x0;var _0x2916d8=_0x404e[_0x39bc44];return _0x2916d8;};'use strict';var FaxAccountEvents=require(_0xe404('0x0'));var events=[_0xe404('0x1'),'remove',_0xe404('0x2')];function createListener(_0x18249e,_0x31463e){return function(_0x4d0a2f){_0x31463e[_0xe404('0x3')](_0x18249e,_0x4d0a2f);};}function removeListener(_0x1764b0,_0x20ca04){return function(){FaxAccountEvents[_0xe404('0x4')](_0x1764b0,_0x20ca04);};}exports[_0xe404('0x5')]=function(_0xd51058){for(var _0x3f12d8=0x0,_0x39a1ef=events[_0xe404('0x6')];_0x3f12d8<_0x39a1ef;_0x3f12d8++){var _0x1fc0df=events[_0x3f12d8];var _0x535a92=createListener(_0xe404('0x7')+_0x1fc0df,_0xd51058);FaxAccountEvents['on'](_0x1fc0df,_0x535a92);}}; \ No newline at end of file +var _0x1cbd=['save','remove','emit','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x55adfa,_0x493df8){var _0x2bf7a6=function(_0x12e42e){while(--_0x12e42e){_0x55adfa['push'](_0x55adfa['shift']());}};_0x2bf7a6(++_0x493df8);}(_0x1cbd,0x167));var _0xd1cb=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x1cbd[_0x11ce46];return _0x368a1e;};'use strict';var FaxAccountEvents=require(_0xd1cb('0x0'));var events=[_0xd1cb('0x1'),_0xd1cb('0x2'),'update'];function createListener(_0x381629,_0x58e815){return function(_0x322a00){_0x58e815[_0xd1cb('0x3')](_0x381629,_0x322a00);};}function removeListener(_0x2a616f,_0x1313c2){return function(){FaxAccountEvents[_0xd1cb('0x4')](_0x2a616f,_0x1313c2);};}exports[_0xd1cb('0x5')]=function(_0x3ba21b){for(var _0x4bfaee=0x0,_0x321da4=events[_0xd1cb('0x6')];_0x4bfaee<_0x321da4;_0x4bfaee++){var _0x329b8e=events[_0x4bfaee];var _0x22e1c7=createListener(_0xd1cb('0x7')+_0x329b8e,_0x3ba21b);FaxAccountEvents['on'](_0x329b8e,_0x22e1c7);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 072641e..9432c88 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x17a0b0,_0x247cb7){var _0x445ead=function(_0x36dcdc){while(--_0x36dcdc){_0x17a0b0['push'](_0x17a0b0['shift']());}};_0x445ead(++_0x247cb7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xa9e0[_0x49ca18];return _0x145d54;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0xc3b861,_0x4049eb){var _0x241fb6=function(_0x427740){while(--_0x427740){_0xc3b861['push'](_0xc3b861['shift']());}};_0x241fb6(++_0x4049eb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index c945150..b602389 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 _0x4119=['sequelize','exports','STRING','noop'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x4119,0x11c));var _0x9411=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x4119[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0x9411('0x0'));module[_0x9411('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x9411('0x2')],'allowNull':![],'defaultValue':_0x9411('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x9411('0x2')]},'interval':{'type':Sequelize[_0x9411('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xc879=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x3b2b0b,_0x39a465){var _0x2ada99=function(_0x1be941){while(--_0x1be941){_0x3b2b0b['push'](_0x3b2b0b['shift']());}};_0x2ada99(++_0x39a465);}(_0xc879,0x9a));var _0x9c87=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xc879[_0x49b207];return _0x2dc8fa;};'use strict';var Sequelize=require(_0x9c87('0x0'));module['exports']={'priority':{'type':Sequelize[_0x9c87('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x9c87('0x2')],'allowNull':![],'defaultValue':_0x9c87('0x3')},'appdata':{'type':Sequelize[_0x9c87('0x4')]()},'description':{'type':Sequelize[_0x9c87('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x9c87('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 87de51b..410d7c8 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 _0xf57d=['findAll','rows','catch','show','params','merge','find','create','body','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','destroy','then','error','stack','name','index','map','FaxApplication','fieldName','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','options','includeAll','include'];(function(_0x19b834,_0x590212){var _0x43f4f1=function(_0x5a5834){while(--_0x5a5834){_0x19b834['push'](_0x19b834['shift']());}};_0x43f4f1(++_0x590212);}(_0xf57d,0x17b));var _0xdf57=function(_0x583761,_0x119f81){_0x583761=_0x583761-0x0;var _0x4b72f0=_0xf57d[_0x583761];return _0x4b72f0;};'use strict';var emlformat=require(_0xdf57('0x0'));var rimraf=require(_0xdf57('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdf57('0x2'));var moment=require(_0xdf57('0x3'));var BPromise=require(_0xdf57('0x4'));var Mustache=require(_0xdf57('0x5'));var util=require(_0xdf57('0x6'));var path=require('path');var sox=require(_0xdf57('0x7'));var csv=require(_0xdf57('0x8'));var ejs=require(_0xdf57('0x9'));var fs=require('fs');var fs_extra=require(_0xdf57('0xa'));var _=require('lodash');var squel=require(_0xdf57('0xb'));var crypto=require(_0xdf57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdf57('0xd'));var toCsv=require(_0xdf57('0x8'));var querystring=require(_0xdf57('0xe'));var Papa=require(_0xdf57('0xf'));var Redis=require(_0xdf57('0x10'));var authService=require(_0xdf57('0x11'));var qs=require(_0xdf57('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdf57('0x13'));var logger=require(_0xdf57('0x14'))(_0xdf57('0x15'));var utils=require(_0xdf57('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xdf57('0x17'));var db=require(_0xdf57('0x18'))['db'];function respondWithStatusCode(_0x4e90c7,_0x425759){_0x425759=_0x425759||0xcc;return function(_0xee7d62){if(_0xee7d62){return _0x4e90c7[_0xdf57('0x19')](_0x425759);}return _0x4e90c7[_0xdf57('0x1a')](_0x425759)[_0xdf57('0x1b')]();};}function respondWithResult(_0x46a3c2,_0x1aff25){_0x1aff25=_0x1aff25||0xc8;return function(_0x5b54c0){if(_0x5b54c0){return _0x46a3c2[_0xdf57('0x1a')](_0x1aff25)['json'](_0x5b54c0);}};}function respondWithFilteredResult(_0x5b8c49,_0x19a0c2){return function(_0x477e2e){if(_0x477e2e){var _0x2f6f99=typeof _0x19a0c2[_0xdf57('0x1c')]===_0xdf57('0x1d')&&typeof _0x19a0c2[_0xdf57('0x1e')]===_0xdf57('0x1d');var _0x236d83=_0x477e2e[_0xdf57('0x1f')];var _0x3d2dbc=_0x2f6f99?0x0:_0x19a0c2[_0xdf57('0x1c')];var _0x5cc730=_0x2f6f99?_0x477e2e[_0xdf57('0x1f')]:_0x19a0c2[_0xdf57('0x1c')]+_0x19a0c2['limit'];var _0x1e76e3;if(_0x5cc730>=_0x236d83){_0x5cc730=_0x236d83;_0x1e76e3=0xc8;}else{_0x1e76e3=0xce;}_0x5b8c49[_0xdf57('0x1a')](_0x1e76e3);return _0x5b8c49[_0xdf57('0x20')](_0xdf57('0x21'),_0x3d2dbc+'-'+_0x5cc730+'/'+_0x236d83)[_0xdf57('0x22')](_0x477e2e);}return null;};}function patchUpdates(_0x229c80){return function(_0x41d856){try{jsonpatch['apply'](_0x41d856,_0x229c80,!![]);}catch(_0x4347c7){return BPromise[_0xdf57('0x23')](_0x4347c7);}return _0x41d856[_0xdf57('0x24')]();};}function saveUpdates(_0x19b5b3,_0x15f95b){return function(_0x5d2dfa){if(_0x5d2dfa){return _0x5d2dfa['update'](_0x19b5b3)['then'](function(_0x4b63d4){return _0x4b63d4;});}return null;};}function removeEntity(_0x1a00ef,_0x34a5cd){return function(_0x1db38e){if(_0x1db38e){return _0x1db38e[_0xdf57('0x25')]()[_0xdf57('0x26')](function(){_0x1a00ef[_0xdf57('0x1a')](0xcc)[_0xdf57('0x1b')]();});}};}function handleEntityNotFound(_0x251008,_0x49dd57){return function(_0x2720c2){if(!_0x2720c2){_0x251008['sendStatus'](0x194);}return _0x2720c2;};}function handleError(_0x2fe1da,_0x588ff6){_0x588ff6=_0x588ff6||0x1f4;return function(_0x1dd057){logger[_0xdf57('0x27')](_0x1dd057[_0xdf57('0x28')]);if(_0x1dd057[_0xdf57('0x29')]){delete _0x1dd057[_0xdf57('0x29')];}_0x2fe1da[_0xdf57('0x1a')](_0x588ff6)['send'](_0x1dd057);};}exports[_0xdf57('0x2a')]=function(_0x1c232d,_0x4e95ea){var _0x31b11c={},_0x3ffd01={},_0x543537={'count':0x0,'rows':[]};var _0x4c75d6=_[_0xdf57('0x2b')](db[_0xdf57('0x2c')]['rawAttributes'],function(_0x5b2733){return{'name':_0x5b2733[_0xdf57('0x2d')],'type':_0x5b2733['type']['key']};});_0x3ffd01[_0xdf57('0x2e')]=_[_0xdf57('0x2b')](_0x4c75d6,_0xdf57('0x29'));_0x3ffd01[_0xdf57('0x2f')]=_[_0xdf57('0x30')](_0x1c232d[_0xdf57('0x2f')]);_0x3ffd01[_0xdf57('0x31')]=_['intersection'](_0x3ffd01[_0xdf57('0x2e')],_0x3ffd01[_0xdf57('0x2f')]);_0x31b11c['attributes']=_[_0xdf57('0x32')](_0x3ffd01[_0xdf57('0x2e')],qs['fields'](_0x1c232d[_0xdf57('0x2f')][_0xdf57('0x33')]));_0x31b11c['attributes']=_0x31b11c[_0xdf57('0x34')][_0xdf57('0x35')]?_0x31b11c[_0xdf57('0x34')]:_0x3ffd01['model'];if(!_0x1c232d['query'][_0xdf57('0x36')](_0xdf57('0x37'))){_0x31b11c[_0xdf57('0x1e')]=qs['limit'](_0x1c232d[_0xdf57('0x2f')][_0xdf57('0x1e')]);_0x31b11c[_0xdf57('0x1c')]=qs['offset'](_0x1c232d[_0xdf57('0x2f')][_0xdf57('0x1c')]);}_0x31b11c[_0xdf57('0x38')]=qs[_0xdf57('0x39')](_0x1c232d[_0xdf57('0x2f')][_0xdf57('0x39')]);_0x31b11c[_0xdf57('0x3a')]=qs['filters'](_[_0xdf57('0x3b')](_0x1c232d[_0xdf57('0x2f')],_0x3ffd01[_0xdf57('0x31')]),_0x4c75d6);if(_0x1c232d[_0xdf57('0x2f')]['filter']){_0x31b11c[_0xdf57('0x3a')]=_['merge'](_0x31b11c['where'],{'$or':_[_0xdf57('0x2b')](_0x4c75d6,function(_0x49da44){if(_0x49da44[_0xdf57('0x3c')]!==_0xdf57('0x3d')){var _0x197e5e={};_0x197e5e[_0x49da44[_0xdf57('0x29')]]={'$like':'%'+_0x1c232d[_0xdf57('0x2f')]['filter']+'%'};return _0x197e5e;}})});}_0x31b11c=_['merge']({},_0x31b11c,_0x1c232d[_0xdf57('0x3e')]);var _0x5c9789={'where':_0x31b11c[_0xdf57('0x3a')]};return db[_0xdf57('0x2c')]['count'](_0x5c9789)[_0xdf57('0x26')](function(_0x4051dd){_0x543537['count']=_0x4051dd;if(_0x1c232d['query'][_0xdf57('0x3f')]){_0x31b11c[_0xdf57('0x40')]=[{'all':!![]}];}return db['FaxApplication'][_0xdf57('0x41')](_0x31b11c);})[_0xdf57('0x26')](function(_0x39290e){_0x543537[_0xdf57('0x42')]=_0x39290e;return _0x543537;})[_0xdf57('0x26')](respondWithFilteredResult(_0x4e95ea,_0x31b11c))[_0xdf57('0x43')](handleError(_0x4e95ea,null));};exports[_0xdf57('0x44')]=function(_0x40f5da,_0x44fdaf){var _0x166436={'raw':!![],'where':{'id':_0x40f5da[_0xdf57('0x45')]['id']}},_0x1ce387={};_0x1ce387[_0xdf57('0x2e')]=_['keys'](db['FaxApplication']['rawAttributes']);_0x1ce387[_0xdf57('0x2f')]=_['keys'](_0x40f5da[_0xdf57('0x2f')]);_0x1ce387[_0xdf57('0x31')]=_['intersection'](_0x1ce387[_0xdf57('0x2e')],_0x1ce387[_0xdf57('0x2f')]);_0x166436['attributes']=_[_0xdf57('0x32')](_0x1ce387[_0xdf57('0x2e')],qs[_0xdf57('0x33')](_0x40f5da[_0xdf57('0x2f')][_0xdf57('0x33')]));_0x166436['attributes']=_0x166436['attributes'][_0xdf57('0x35')]?_0x166436[_0xdf57('0x34')]:_0x1ce387[_0xdf57('0x2e')];if(_0x40f5da[_0xdf57('0x2f')][_0xdf57('0x3f')]){_0x166436[_0xdf57('0x40')]=[{'all':!![]}];}_0x166436=_[_0xdf57('0x46')]({},_0x166436,_0x40f5da[_0xdf57('0x3e')]);return db['FaxApplication'][_0xdf57('0x47')](_0x166436)[_0xdf57('0x26')](handleEntityNotFound(_0x44fdaf,null))[_0xdf57('0x26')](respondWithResult(_0x44fdaf,null))['catch'](handleError(_0x44fdaf,null));};exports[_0xdf57('0x48')]=function(_0x4859a6,_0x14061e){return db[_0xdf57('0x2c')][_0xdf57('0x48')](_0x4859a6[_0xdf57('0x49')],{})['then'](respondWithResult(_0x14061e,0xc9))[_0xdf57('0x43')](handleError(_0x14061e,null));};exports['update']=function(_0x5696a8,_0x305367){if(_0x5696a8[_0xdf57('0x49')]['id']){delete _0x5696a8[_0xdf57('0x49')]['id'];}return db[_0xdf57('0x2c')][_0xdf57('0x47')]({'where':{'id':_0x5696a8[_0xdf57('0x45')]['id']}})[_0xdf57('0x26')](handleEntityNotFound(_0x305367,null))[_0xdf57('0x26')](saveUpdates(_0x5696a8[_0xdf57('0x49')],null))[_0xdf57('0x26')](respondWithResult(_0x305367,null))['catch'](handleError(_0x305367,null));};exports['destroy']=function(_0x45fab3,_0x4d04e9){return db[_0xdf57('0x2c')][_0xdf57('0x47')]({'where':{'id':_0x45fab3['params']['id']}})[_0xdf57('0x26')](handleEntityNotFound(_0x4d04e9,null))[_0xdf57('0x26')](removeEntity(_0x4d04e9,null))[_0xdf57('0x43')](handleError(_0x4d04e9,null));}; \ No newline at end of file +var _0x922b=['set','Content-Range','apply','reject','update','then','error','stack','name','map','FaxApplication','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit'];(function(_0xa9e76e,_0x572d0c){var _0x53630d=function(_0x3c1871){while(--_0x3c1871){_0xa9e76e['push'](_0xa9e76e['shift']());}};_0x53630d(++_0x572d0c);}(_0x922b,0x7a));var _0xb922=function(_0x27411a,_0x8f6f0f){_0x27411a=_0x27411a-0x0;var _0x4edda2=_0x922b[_0x27411a];return _0x4edda2;};'use strict';var emlformat=require(_0xb922('0x0'));var rimraf=require(_0xb922('0x1'));var zipdir=require(_0xb922('0x2'));var jsonpatch=require(_0xb922('0x3'));var rp=require('request-promise');var moment=require(_0xb922('0x4'));var BPromise=require(_0xb922('0x5'));var Mustache=require(_0xb922('0x6'));var util=require(_0xb922('0x7'));var path=require(_0xb922('0x8'));var sox=require(_0xb922('0x9'));var csv=require('to-csv');var ejs=require(_0xb922('0xa'));var fs=require('fs');var fs_extra=require(_0xb922('0xb'));var _=require('lodash');var squel=require(_0xb922('0xc'));var crypto=require(_0xb922('0xd'));var jsforce=require(_0xb922('0xe'));var deskjs=require(_0xb922('0xf'));var toCsv=require(_0xb922('0x10'));var querystring=require(_0xb922('0x11'));var Papa=require('papaparse');var Redis=require(_0xb922('0x12'));var authService=require(_0xb922('0x13'));var qs=require(_0xb922('0x14'));var as=require(_0xb922('0x15'));var hardwareService=require(_0xb922('0x16'));var logger=require(_0xb922('0x17'))(_0xb922('0x18'));var utils=require(_0xb922('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb922('0x1a'))['db'];function respondWithStatusCode(_0x176355,_0x4c06ea){_0x4c06ea=_0x4c06ea||0xcc;return function(_0x27a41e){if(_0x27a41e){return _0x176355[_0xb922('0x1b')](_0x4c06ea);}return _0x176355[_0xb922('0x1c')](_0x4c06ea)[_0xb922('0x1d')]();};}function respondWithResult(_0x3636cc,_0x4d4053){_0x4d4053=_0x4d4053||0xc8;return function(_0xc413d6){if(_0xc413d6){return _0x3636cc[_0xb922('0x1c')](_0x4d4053)['json'](_0xc413d6);}};}function respondWithFilteredResult(_0x21697a,_0x3af1a1){return function(_0x3cee6c){if(_0x3cee6c){var _0x38432e=typeof _0x3af1a1[_0xb922('0x1e')]===_0xb922('0x1f')&&typeof _0x3af1a1['limit']===_0xb922('0x1f');var _0x30624e=_0x3cee6c[_0xb922('0x20')];var _0x101139=_0x38432e?0x0:_0x3af1a1[_0xb922('0x1e')];var _0x373309=_0x38432e?_0x3cee6c['count']:_0x3af1a1[_0xb922('0x1e')]+_0x3af1a1[_0xb922('0x21')];var _0x3c8672;if(_0x373309>=_0x30624e){_0x373309=_0x30624e;_0x3c8672=0xc8;}else{_0x3c8672=0xce;}_0x21697a[_0xb922('0x1c')](_0x3c8672);return _0x21697a[_0xb922('0x22')](_0xb922('0x23'),_0x101139+'-'+_0x373309+'/'+_0x30624e)['json'](_0x3cee6c);}return null;};}function patchUpdates(_0x561803){return function(_0xe6a6cb){try{jsonpatch[_0xb922('0x24')](_0xe6a6cb,_0x561803,!![]);}catch(_0x1a79ad){return BPromise[_0xb922('0x25')](_0x1a79ad);}return _0xe6a6cb['save']();};}function saveUpdates(_0x29b1a6,_0xaf3e7f){return function(_0x48df0b){if(_0x48df0b){return _0x48df0b[_0xb922('0x26')](_0x29b1a6)['then'](function(_0x229175){return _0x229175;});}return null;};}function removeEntity(_0x42a42c,_0x458ea1){return function(_0x11029c){if(_0x11029c){return _0x11029c['destroy']()[_0xb922('0x27')](function(){_0x42a42c[_0xb922('0x1c')](0xcc)[_0xb922('0x1d')]();});}};}function handleEntityNotFound(_0x47ec07,_0x4665a9){return function(_0x33fe37){if(!_0x33fe37){_0x47ec07[_0xb922('0x1b')](0x194);}return _0x33fe37;};}function handleError(_0x2b180a,_0x251c2d){_0x251c2d=_0x251c2d||0x1f4;return function(_0x16c1db){logger[_0xb922('0x28')](_0x16c1db[_0xb922('0x29')]);if(_0x16c1db['name']){delete _0x16c1db[_0xb922('0x2a')];}_0x2b180a[_0xb922('0x1c')](_0x251c2d)['send'](_0x16c1db);};}exports['index']=function(_0x99e180,_0x22368b){var _0x1940d0={},_0x1fe9ed={},_0xb1ba6f={'count':0x0,'rows':[]};var _0x4d176a=_[_0xb922('0x2b')](db[_0xb922('0x2c')][_0xb922('0x2d')],function(_0x4ddce0){return{'name':_0x4ddce0[_0xb922('0x2e')],'type':_0x4ddce0['type'][_0xb922('0x2f')]};});_0x1fe9ed['model']=_[_0xb922('0x2b')](_0x4d176a,_0xb922('0x2a'));_0x1fe9ed[_0xb922('0x30')]=_[_0xb922('0x31')](_0x99e180[_0xb922('0x30')]);_0x1fe9ed[_0xb922('0x32')]=_[_0xb922('0x33')](_0x1fe9ed[_0xb922('0x34')],_0x1fe9ed['query']);_0x1940d0[_0xb922('0x35')]=_[_0xb922('0x33')](_0x1fe9ed[_0xb922('0x34')],qs[_0xb922('0x36')](_0x99e180[_0xb922('0x30')][_0xb922('0x36')]));_0x1940d0[_0xb922('0x35')]=_0x1940d0[_0xb922('0x35')][_0xb922('0x37')]?_0x1940d0[_0xb922('0x35')]:_0x1fe9ed[_0xb922('0x34')];if(!_0x99e180['query'][_0xb922('0x38')](_0xb922('0x39'))){_0x1940d0['limit']=qs['limit'](_0x99e180[_0xb922('0x30')][_0xb922('0x21')]);_0x1940d0[_0xb922('0x1e')]=qs[_0xb922('0x1e')](_0x99e180[_0xb922('0x30')]['offset']);}_0x1940d0[_0xb922('0x3a')]=qs[_0xb922('0x3b')](_0x99e180[_0xb922('0x30')][_0xb922('0x3b')]);_0x1940d0[_0xb922('0x3c')]=qs[_0xb922('0x32')](_[_0xb922('0x3d')](_0x99e180[_0xb922('0x30')],_0x1fe9ed[_0xb922('0x32')]),_0x4d176a);if(_0x99e180[_0xb922('0x30')][_0xb922('0x3e')]){_0x1940d0[_0xb922('0x3c')]=_[_0xb922('0x3f')](_0x1940d0[_0xb922('0x3c')],{'$or':_['map'](_0x4d176a,function(_0x13a1f1){if(_0x13a1f1[_0xb922('0x40')]!==_0xb922('0x41')){var _0x2adc0f={};_0x2adc0f[_0x13a1f1['name']]={'$like':'%'+_0x99e180[_0xb922('0x30')][_0xb922('0x3e')]+'%'};return _0x2adc0f;}})});}_0x1940d0=_[_0xb922('0x3f')]({},_0x1940d0,_0x99e180[_0xb922('0x42')]);var _0x2449b1={'where':_0x1940d0[_0xb922('0x3c')]};return db['FaxApplication']['count'](_0x2449b1)['then'](function(_0x25cf8b){_0xb1ba6f[_0xb922('0x20')]=_0x25cf8b;if(_0x99e180[_0xb922('0x30')]['includeAll']){_0x1940d0[_0xb922('0x43')]=[{'all':!![]}];}return db[_0xb922('0x2c')][_0xb922('0x44')](_0x1940d0);})[_0xb922('0x27')](function(_0x1b7ca9){_0xb1ba6f[_0xb922('0x45')]=_0x1b7ca9;return _0xb1ba6f;})[_0xb922('0x27')](respondWithFilteredResult(_0x22368b,_0x1940d0))[_0xb922('0x46')](handleError(_0x22368b,null));};exports[_0xb922('0x47')]=function(_0x272ae5,_0x36b415){var _0x2af551={'raw':!![],'where':{'id':_0x272ae5[_0xb922('0x48')]['id']}},_0x3f9524={};_0x3f9524[_0xb922('0x34')]=_[_0xb922('0x31')](db[_0xb922('0x2c')][_0xb922('0x2d')]);_0x3f9524[_0xb922('0x30')]=_[_0xb922('0x31')](_0x272ae5[_0xb922('0x30')]);_0x3f9524[_0xb922('0x32')]=_[_0xb922('0x33')](_0x3f9524[_0xb922('0x34')],_0x3f9524['query']);_0x2af551['attributes']=_[_0xb922('0x33')](_0x3f9524[_0xb922('0x34')],qs[_0xb922('0x36')](_0x272ae5[_0xb922('0x30')][_0xb922('0x36')]));_0x2af551[_0xb922('0x35')]=_0x2af551[_0xb922('0x35')][_0xb922('0x37')]?_0x2af551[_0xb922('0x35')]:_0x3f9524[_0xb922('0x34')];if(_0x272ae5[_0xb922('0x30')][_0xb922('0x49')]){_0x2af551['include']=[{'all':!![]}];}_0x2af551=_[_0xb922('0x3f')]({},_0x2af551,_0x272ae5['options']);return db['FaxApplication'][_0xb922('0x4a')](_0x2af551)[_0xb922('0x27')](handleEntityNotFound(_0x36b415,null))[_0xb922('0x27')](respondWithResult(_0x36b415,null))[_0xb922('0x46')](handleError(_0x36b415,null));};exports[_0xb922('0x4b')]=function(_0x1a786f,_0x5bde48){return db[_0xb922('0x2c')][_0xb922('0x4b')](_0x1a786f[_0xb922('0x4c')],{})[_0xb922('0x27')](respondWithResult(_0x5bde48,0xc9))[_0xb922('0x46')](handleError(_0x5bde48,null));};exports[_0xb922('0x26')]=function(_0x5d4ba3,_0x5cb547){if(_0x5d4ba3['body']['id']){delete _0x5d4ba3[_0xb922('0x4c')]['id'];}return db['FaxApplication'][_0xb922('0x4a')]({'where':{'id':_0x5d4ba3[_0xb922('0x48')]['id']}})[_0xb922('0x27')](handleEntityNotFound(_0x5cb547,null))['then'](saveUpdates(_0x5d4ba3[_0xb922('0x4c')],null))[_0xb922('0x27')](respondWithResult(_0x5cb547,null))['catch'](handleError(_0x5cb547,null));};exports[_0xb922('0x4d')]=function(_0x835270,_0x101c08){return db['FaxApplication']['find']({'where':{'id':_0x835270[_0xb922('0x48')]['id']}})[_0xb922('0x27')](handleEntityNotFound(_0x101c08,null))[_0xb922('0x27')](removeEntity(_0x101c08,null))['catch'](handleError(_0x101c08,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index a2260a2..04cdac0 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 _0xe549=['rimraf','../../config/environment','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x106bfb,_0x28322a){var _0x5696c9=function(_0xd7b678){while(--_0xd7b678){_0x106bfb['push'](_0x106bfb['shift']());}};_0x5696c9(++_0x28322a);}(_0xe549,0xe4));var _0x9e54=function(_0x4a53ad,_0x1c13bd){_0x4a53ad=_0x4a53ad-0x0;var _0x449ced=_0xe549[_0x4a53ad];return _0x449ced;};'use strict';var _=require(_0x9e54('0x0'));var util=require('util');var logger=require(_0x9e54('0x1'))('api');var moment=require(_0x9e54('0x2'));var BPromise=require(_0x9e54('0x3'));var rp=require(_0x9e54('0x4'));var fs=require('fs');var path=require(_0x9e54('0x5'));var rimraf=require(_0x9e54('0x6'));var config=require(_0x9e54('0x7'));var attributes=require(_0x9e54('0x8'));module[_0x9e54('0x9')]=function(_0x15f901,_0x1f83e4){return _0x15f901['define'](_0x9e54('0xa'),attributes,{'tableName':_0x9e54('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9e54('0xc')});}; \ No newline at end of file +var _0x779a=['utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./faxApplication.attributes','exports','define','fax_applications'];(function(_0x359cc2,_0x2f162c){var _0x40a7d7=function(_0x17e3d7){while(--_0x17e3d7){_0x359cc2['push'](_0x359cc2['shift']());}};_0x40a7d7(++_0x2f162c);}(_0x779a,0x105));var _0xa779=function(_0x4a2961,_0x961860){_0x4a2961=_0x4a2961-0x0;var _0x5a13a7=_0x779a[_0x4a2961];return _0x5a13a7;};'use strict';var _=require(_0xa779('0x0'));var util=require(_0xa779('0x1'));var logger=require(_0xa779('0x2'))('api');var moment=require(_0xa779('0x3'));var BPromise=require(_0xa779('0x4'));var rp=require(_0xa779('0x5'));var fs=require('fs');var path=require(_0xa779('0x6'));var rimraf=require(_0xa779('0x7'));var config=require('../../config/environment');var attributes=require(_0xa779('0x8'));module[_0xa779('0x9')]=function(_0x1efd0d,_0x52fd1d){return _0x1efd0d[_0xa779('0xa')]('FaxApplication',attributes,{'tableName':_0xa779('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa779('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 2e6cecb..448b246 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 _0x0bc7=['stringify','error','code','FaxApplication,\x20%s,\x20%s','message','result','catch','UpdateFaxApplication','FaxApplication','options','raw','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s'];(function(_0xb37185,_0x3ec508){var _0x575b45=function(_0x2d9b5a){while(--_0x2d9b5a){_0xb37185['push'](_0xb37185['shift']());}};_0x575b45(++_0x3ec508);}(_0x0bc7,0x1dc));var _0x70bc=function(_0x5d2543,_0xa0a4d6){_0x5d2543=_0x5d2543-0x0;var _0x420a20=_0x0bc7[_0x5d2543];return _0x420a20;};'use strict';var _=require(_0x70bc('0x0'));var util=require(_0x70bc('0x1'));var moment=require(_0x70bc('0x2'));var BPromise=require(_0x70bc('0x3'));var rs=require(_0x70bc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x70bc('0x5'))['db'];var utils=require(_0x70bc('0x6'));var logger=require(_0x70bc('0x7'))(_0x70bc('0x8'));var config=require(_0x70bc('0x9'));var jayson=require(_0x70bc('0xa'));var client=jayson[_0x70bc('0xb')][_0x70bc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c0f09,_0x4855b7,_0x477f3b){return new BPromise(function(_0xe2f258,_0x3bd95a){return client[_0x70bc('0xd')](_0x5c0f09,_0x477f3b)[_0x70bc('0xe')](function(_0x3d1d5e){logger[_0x70bc('0xf')]('FaxApplication,\x20%s,\x20%s',_0x4855b7,_0x70bc('0x10'));logger[_0x70bc('0x11')](_0x70bc('0x12'),_0x4855b7,_0x70bc('0x10'),JSON[_0x70bc('0x13')](_0x3d1d5e));if(_0x3d1d5e['error']){if(_0x3d1d5e[_0x70bc('0x14')][_0x70bc('0x15')]===0x1f4){logger[_0x70bc('0x14')](_0x70bc('0x16'),_0x4855b7,_0x3d1d5e[_0x70bc('0x14')][_0x70bc('0x17')]);return _0x3bd95a(_0x3d1d5e[_0x70bc('0x14')][_0x70bc('0x17')]);}logger['error'](_0x70bc('0x16'),_0x4855b7,_0x3d1d5e[_0x70bc('0x14')][_0x70bc('0x17')]);return _0xe2f258(_0x3d1d5e[_0x70bc('0x14')][_0x70bc('0x17')]);}else{logger[_0x70bc('0xf')](_0x70bc('0x16'),_0x4855b7,_0x70bc('0x10'));_0xe2f258(_0x3d1d5e[_0x70bc('0x18')][_0x70bc('0x17')]);}})[_0x70bc('0x19')](function(_0x553c77){logger['error'](_0x70bc('0x16'),_0x4855b7,_0x553c77);_0x3bd95a(_0x553c77);});});}exports[_0x70bc('0x1a')]=function(_0x40f5ee){var _0x1eb278=this;return new Promise(function(_0x37ee81,_0x1c20f8){return db[_0x70bc('0x1b')]['update'](_0x40f5ee['body'],{'raw':_0x40f5ee[_0x70bc('0x1c')]?_0x40f5ee[_0x70bc('0x1c')][_0x70bc('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40f5ee[_0x70bc('0x1c')]?_0x40f5ee['options'][_0x70bc('0x1e')]||null:null,'attributes':_0x40f5ee[_0x70bc('0x1c')]?_0x40f5ee[_0x70bc('0x1c')][_0x70bc('0x1f')]||null:null,'limit':_0x40f5ee['options']?_0x40f5ee[_0x70bc('0x1c')][_0x70bc('0x20')]||null:null})[_0x70bc('0xe')](function(_0x56efa1){logger[_0x70bc('0xf')]('UpdateFaxApplication',_0x40f5ee);logger[_0x70bc('0x11')](_0x70bc('0x1a'),_0x40f5ee,JSON[_0x70bc('0x13')](_0x56efa1));_0x37ee81(_0x56efa1);})['catch'](function(_0x79a74b){logger[_0x70bc('0x14')]('UpdateFaxApplication',_0x79a74b['message'],_0x40f5ee);_0x1c20f8(_0x1eb278[_0x70bc('0x14')](0x1f4,_0x79a74b['message']));});});}; \ No newline at end of file +var _0x29f9=['UpdateFaxApplication','FaxApplication','raw','options','where','attributes','stringify','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','code','error','message','catch'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x29f9,0x1e2));var _0x929f=function(_0x32cb75,_0x272757){_0x32cb75=_0x32cb75-0x0;var _0x10bf9b=_0x29f9[_0x32cb75];return _0x10bf9b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x929f('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x929f('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x929f('0x2'));var logger=require(_0x929f('0x3'))(_0x929f('0x4'));var config=require(_0x929f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x929f('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcd0115,_0x4b7d13,_0x3f7a7f){return new BPromise(function(_0xf613f5,_0x1ec7ea){return client[_0x929f('0x7')](_0xcd0115,_0x3f7a7f)[_0x929f('0x8')](function(_0x26baeb){logger[_0x929f('0x9')](_0x929f('0xa'),_0x4b7d13,_0x929f('0xb'));logger[_0x929f('0xc')](_0x929f('0xd'),_0x4b7d13,_0x929f('0xb'),JSON['stringify'](_0x26baeb));if(_0x26baeb['error']){if(_0x26baeb['error'][_0x929f('0xe')]===0x1f4){logger[_0x929f('0xf')]('FaxApplication,\x20%s,\x20%s',_0x4b7d13,_0x26baeb[_0x929f('0xf')][_0x929f('0x10')]);return _0x1ec7ea(_0x26baeb[_0x929f('0xf')]['message']);}logger[_0x929f('0xf')](_0x929f('0xa'),_0x4b7d13,_0x26baeb[_0x929f('0xf')][_0x929f('0x10')]);return _0xf613f5(_0x26baeb[_0x929f('0xf')][_0x929f('0x10')]);}else{logger[_0x929f('0x9')]('FaxApplication,\x20%s,\x20%s',_0x4b7d13,'request\x20sent');_0xf613f5(_0x26baeb['result'][_0x929f('0x10')]);}})[_0x929f('0x11')](function(_0x128549){logger[_0x929f('0xf')](_0x929f('0xa'),_0x4b7d13,_0x128549);_0x1ec7ea(_0x128549);});});}exports[_0x929f('0x12')]=function(_0x50db66){var _0xa65c0b=this;return new Promise(function(_0x15dbe3,_0xe12df0){return db[_0x929f('0x13')]['update'](_0x50db66['body'],{'raw':_0x50db66['options']?_0x50db66['options'][_0x929f('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50db66[_0x929f('0x15')]?_0x50db66[_0x929f('0x15')][_0x929f('0x16')]||null:null,'attributes':_0x50db66[_0x929f('0x15')]?_0x50db66[_0x929f('0x15')][_0x929f('0x17')]||null:null,'limit':_0x50db66['options']?_0x50db66['options']['limit']||null:null})['then'](function(_0x4e2166){logger[_0x929f('0x9')](_0x929f('0x12'),_0x50db66);logger['debug']('UpdateFaxApplication',_0x50db66,JSON[_0x929f('0x18')](_0x4e2166));_0x15dbe3(_0x4e2166);})['catch'](function(_0x4f3381){logger[_0x929f('0xf')](_0x929f('0x12'),_0x4f3381[_0x929f('0x10')],_0x50db66);_0xe12df0(_0xa65c0b[_0x929f('0xf')](0x1f4,_0x4f3381[_0x929f('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 4ea6ccd..be70038 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 _0xf4f4=['../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x34efa6,_0x343fe2){var _0x469490=function(_0xc1d725){while(--_0xc1d725){_0x34efa6['push'](_0x34efa6['shift']());}};_0x469490(++_0x343fe2);}(_0xf4f4,0xe3));var _0x4f4f=function(_0x2c24df,_0x2e46a3){_0x2c24df=_0x2c24df-0x0;var _0x309b15=_0xf4f4[_0x2c24df];return _0x309b15;};'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 fs_extra=require(_0x4f4f('0x5'));var auth=require(_0x4f4f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4f4f('0x7'));var controller=require('./faxApplication.controller');router[_0x4f4f('0x8')]('/',auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xa')]);router[_0x4f4f('0x8')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0xc')]);router[_0x4f4f('0xd')]('/',auth['isAuthenticated'](),controller[_0x4f4f('0xe')]);router[_0x4f4f('0xf')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller[_0x4f4f('0x10')]);router[_0x4f4f('0x11')](_0x4f4f('0xb'),auth[_0x4f4f('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xda2d=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../config/environment','./faxApplication.controller','get'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0xda2d,0x102));var _0xdda2=function(_0x59478e,_0x5d98d6){_0x59478e=_0x59478e-0x0;var _0x3c6ea1=_0xda2d[_0x59478e];return _0x3c6ea1;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0xc')]('/',auth['isAuthenticated'](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xf')]);router[_0xdda2('0x10')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x11')]);module[_0xdda2('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index d17ab5a..d91f07d 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 _0x5a2c=['STRING','DATE','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5a2c,0xc1));var _0xc5a2=function(_0x3b1106,_0x4bd523){_0x3b1106=_0x3b1106-0x0;var _0x1fbeef=_0x5a2c[_0x3b1106];return _0x1fbeef;};'use strict';var Sequelize=require(_0xc5a2('0x0'));module[_0xc5a2('0x1')]={'closed':{'type':Sequelize[_0xc5a2('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xc5a2('0x3')]},'secondDisposition':{'type':Sequelize[_0xc5a2('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xc5a2('0x4')]},'fax':{'type':Sequelize[_0xc5a2('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xc5a2('0x5')]('in',_0xc5a2('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xc5a2('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xc5a2('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x6fc0=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize'];(function(_0x4a8bad,_0x4bfb2f){var _0x30cf32=function(_0x557b3a){while(--_0x557b3a){_0x4a8bad['push'](_0x4a8bad['shift']());}};_0x30cf32(++_0x4bfb2f);}(_0x6fc0,0x180));var _0x06fc=function(_0x43228b,_0x2154ed){_0x43228b=_0x43228b-0x0;var _0x1c03bf=_0x6fc0[_0x43228b];return _0x1c03bf;};'use strict';var Sequelize=require(_0x06fc('0x0'));module[_0x06fc('0x1')]={'closed':{'type':Sequelize[_0x06fc('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x06fc('0x3')]},'disposition':{'type':Sequelize[_0x06fc('0x4')]},'secondDisposition':{'type':Sequelize[_0x06fc('0x4')]},'thirdDisposition':{'type':Sequelize[_0x06fc('0x4')]},'note':{'type':Sequelize[_0x06fc('0x4')]},'read1stAt':{'type':Sequelize[_0x06fc('0x3')]},'fax':{'type':Sequelize[_0x06fc('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x06fc('0x5')]('in',_0x06fc('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x06fc('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x06fc('0x5')]('in',_0x06fc('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index f3adb6b..8ebfc74 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 _0x37b3=['toString','join','server','root','files','attachments','Attachment','createdAt','Messages','get','mkdirSync','basename','createReadStream','pipe','resolve','download','err','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','update','then','destroy','error','name','send','index','map','FaxInteraction','rawAttributes','getOptions','findAll','fax','query','user','catch','show','model','keys','filters','attributes','intersection','fields','length','includeAll','include','merge','options','find','create','body','params','describe','addMessage','FaxMessage','ids','omit','getMessages','findOne','nolimit','order','sort','where','pick','FaxInteractionId','filter','$gte','split','format','rows','addTags','setTags','spread','Tag','color','emit','faxInteractionTags:save','unix'];(function(_0x55951f,_0x303696){var _0x497677=function(_0x1ba98f){while(--_0x1ba98f){_0x55951f['push'](_0x55951f['shift']());}};_0x497677(++_0x303696);}(_0x37b3,0xdc));var _0x337b=function(_0x378720,_0xa711f1){_0x378720=_0x378720-0x0;var _0x47920a=_0x37b3[_0x378720];return _0x47920a;};'use strict';var rimraf=require(_0x337b('0x0'));var zipdir=require(_0x337b('0x1'));var moment=require(_0x337b('0x2'));var BPromise=require(_0x337b('0x3'));var util=require(_0x337b('0x4'));var path=require(_0x337b('0x5'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x337b('0x6'));var interaction=require(_0x337b('0x7'));var qs=require(_0x337b('0x8'));var logger=require(_0x337b('0x9'))(_0x337b('0xa'));var config=require('../../config/environment');var db=require(_0x337b('0xb'))['db'];config[_0x337b('0xc')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x337b('0xd'))(new Redis(config[_0x337b('0xc')]));require(_0x337b('0xe'))[_0x337b('0xf')](socket);function respondWithStatusCode(_0x3df8e6,_0x3f1e90){_0x3f1e90=_0x3f1e90||0xcc;return function(_0x22aec6){if(_0x22aec6){return _0x3df8e6[_0x337b('0x10')](_0x3f1e90);}return _0x3df8e6[_0x337b('0x11')](_0x3f1e90)[_0x337b('0x12')]();};}function respondWithResult(_0x2a4f22,_0x751167){_0x751167=_0x751167||0xc8;return function(_0x2f8b64){if(_0x2f8b64){return _0x2a4f22['status'](_0x751167)[_0x337b('0x13')](_0x2f8b64);}};}function respondWithFilteredResult(_0x20c468,_0x15d90b){return function(_0xa80aef){if(_0xa80aef){var _0xc4274e=typeof _0x15d90b[_0x337b('0x14')]===_0x337b('0x15')&&typeof _0x15d90b['limit']===_0x337b('0x15');var _0x278e33=_0xa80aef['count'];var _0x5e679d=_0xc4274e?0x0:_0x15d90b['offset'];var _0x4a0b03=_0xc4274e?_0xa80aef[_0x337b('0x16')]:_0x15d90b[_0x337b('0x14')]+_0x15d90b[_0x337b('0x17')];var _0x1b9d6d;if(_0x4a0b03>=_0x278e33){_0x4a0b03=_0x278e33;_0x1b9d6d=0xc8;}else{_0x1b9d6d=0xce;}_0x20c468['status'](_0x1b9d6d);return _0x20c468['set'](_0x337b('0x18'),_0x5e679d+'-'+_0x4a0b03+'/'+_0x278e33)['json'](_0xa80aef);}return null;};}function saveUpdates(_0x26d323){return function(_0x43fe7c){if(_0x43fe7c){return _0x43fe7c[_0x337b('0x19')](_0x26d323)[_0x337b('0x1a')](function(_0x270998){return _0x270998;});}return null;};}function removeEntity(_0x4028b6){return function(_0x3f849f){if(_0x3f849f){return _0x3f849f[_0x337b('0x1b')]()['then'](function(){_0x4028b6[_0x337b('0x11')](0xcc)['end']();});}};}function handleEntityNotFound(_0x214beb){return function(_0x1ccce0){if(!_0x1ccce0){_0x214beb[_0x337b('0x10')](0x194);}return _0x1ccce0;};}function handleError(_0x5aa089,_0x2aed0e){_0x2aed0e=_0x2aed0e||0x1f4;return function(_0x3b20bd){logger[_0x337b('0x1c')](_0x3b20bd['stack']);if(_0x3b20bd[_0x337b('0x1d')]){delete _0x3b20bd[_0x337b('0x1d')];}_0x5aa089['status'](_0x2aed0e)[_0x337b('0x1e')](_0x3b20bd);};}exports[_0x337b('0x1f')]=function(_0xf506cf,_0x34bad1){var _0x528deb={};var _0xdad715=_[_0x337b('0x20')](db[_0x337b('0x21')][_0x337b('0x22')],function(_0x4e9ee2){return{'name':_0x4e9ee2['fieldName'],'type':_0x4e9ee2['type']['key']};});_0x528deb=qs[_0x337b('0x23')](_0xdad715,_0xf506cf);return interaction[_0x337b('0x24')](_0x337b('0x25'),_0xf506cf[_0x337b('0x26')],_0xf506cf[_0x337b('0x27')],_0x528deb,_0xdad715)['then'](respondWithFilteredResult(_0x34bad1,_0x528deb))[_0x337b('0x28')](handleError(_0x34bad1,null));};exports[_0x337b('0x29')]=function(_0x1ad2b8,_0x27cd84){var _0x24f0c9={'raw':![],'where':{'id':_0x1ad2b8['params']['id']}},_0x4b7e99={};_0x4b7e99[_0x337b('0x2a')]=_[_0x337b('0x2b')](db[_0x337b('0x21')][_0x337b('0x22')]);_0x4b7e99[_0x337b('0x26')]=_[_0x337b('0x2b')](_0x1ad2b8['query']);_0x4b7e99[_0x337b('0x2c')]=_['intersection'](_0x4b7e99[_0x337b('0x2a')],_0x4b7e99[_0x337b('0x26')]);_0x24f0c9[_0x337b('0x2d')]=_[_0x337b('0x2e')](_0x4b7e99[_0x337b('0x2a')],qs[_0x337b('0x2f')](_0x1ad2b8[_0x337b('0x26')]['fields']));_0x24f0c9['attributes']=_0x24f0c9[_0x337b('0x2d')][_0x337b('0x30')]?_0x24f0c9[_0x337b('0x2d')]:_0x4b7e99[_0x337b('0x2a')];if(_0x1ad2b8[_0x337b('0x26')][_0x337b('0x31')]){_0x24f0c9[_0x337b('0x32')]=[{'all':!![]}];}_0x24f0c9=_[_0x337b('0x33')]({},_0x24f0c9,_0x1ad2b8[_0x337b('0x34')]);return db[_0x337b('0x21')][_0x337b('0x35')](_0x24f0c9)[_0x337b('0x1a')](handleEntityNotFound(_0x27cd84,null))[_0x337b('0x1a')](respondWithResult(_0x27cd84,null))[_0x337b('0x28')](handleError(_0x27cd84,null));};exports[_0x337b('0x36')]=function(_0x20cbb9,_0x21e4c6){return db[_0x337b('0x21')]['create'](_0x20cbb9['body'],{})['then'](respondWithResult(_0x21e4c6,0xc9))[_0x337b('0x28')](handleError(_0x21e4c6,null));};exports[_0x337b('0x19')]=function(_0x38b954,_0x1474c6){if(_0x38b954[_0x337b('0x37')]['id']){delete _0x38b954['body']['id'];}return db[_0x337b('0x21')][_0x337b('0x35')]({'where':{'id':_0x38b954[_0x337b('0x38')]['id']}})['then'](handleEntityNotFound(_0x1474c6,null))[_0x337b('0x1a')](saveUpdates(_0x38b954['body'],null))['then'](respondWithResult(_0x1474c6,null))['catch'](handleError(_0x1474c6,null));};exports[_0x337b('0x1b')]=function(_0x5f247c,_0x506ff2){return db[_0x337b('0x21')][_0x337b('0x35')]({'where':{'id':_0x5f247c[_0x337b('0x38')]['id']}})['then'](handleEntityNotFound(_0x506ff2,null))['then'](removeEntity(_0x506ff2,null))[_0x337b('0x28')](handleError(_0x506ff2,null));};exports[_0x337b('0x39')]=function(_0x4f46f5,_0x23e847){return db['FaxInteraction'][_0x337b('0x39')]()[_0x337b('0x1a')](respondWithResult(_0x23e847,null))['catch'](handleError(_0x23e847,null));};exports[_0x337b('0x3a')]=function(_0x2f08f7,_0x2ce239){return db[_0x337b('0x3b')][_0x337b('0x35')]({'where':{'id':_0x2f08f7[_0x337b('0x38')]['id']}})[_0x337b('0x1a')](handleEntityNotFound(_0x2ce239,null))[_0x337b('0x1a')](function(_0x26351d){if(_0x26351d){return _0x26351d['addMessage'](_0x2f08f7['body'][_0x337b('0x3c')],_[_0x337b('0x3d')](_0x2f08f7[_0x337b('0x37')],[_0x337b('0x3c'),'id'])||{});}})['then'](respondWithResult(_0x2ce239,null))[_0x337b('0x28')](handleError(_0x2ce239,null));};exports[_0x337b('0x3e')]=function(_0x57a49d,_0x47387f){var _0xdfc095={'raw':![],'where':{}};var _0x2b93d6={};var _0x3463f0={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x337b('0x3f')]({'where':{'id':_0x57a49d[_0x337b('0x38')]['id']}})[_0x337b('0x1a')](handleEntityNotFound(_0x47387f,null))[_0x337b('0x1a')](function(_0x5b351f){if(_0x5b351f){_0x2b93d6['model']=_[_0x337b('0x2b')](db[_0x337b('0x3b')][_0x337b('0x22')]);_0x2b93d6[_0x337b('0x26')]=_['keys'](_0x57a49d[_0x337b('0x26')]);_0x2b93d6[_0x337b('0x2c')]=_[_0x337b('0x2e')](_0x2b93d6[_0x337b('0x2a')],_0x2b93d6[_0x337b('0x26')]);_0xdfc095[_0x337b('0x2d')]=_[_0x337b('0x2e')](_0x2b93d6[_0x337b('0x2a')],qs[_0x337b('0x2f')](_0x57a49d['query'][_0x337b('0x2f')]));_0xdfc095[_0x337b('0x2d')]=_0xdfc095[_0x337b('0x2d')][_0x337b('0x30')]?_0xdfc095[_0x337b('0x2d')]:_0x2b93d6[_0x337b('0x2a')];if(!_0x57a49d[_0x337b('0x26')]['hasOwnProperty'](_0x337b('0x40'))){_0xdfc095[_0x337b('0x17')]=qs[_0x337b('0x17')](_0x57a49d['query'][_0x337b('0x17')]);_0xdfc095[_0x337b('0x14')]=qs[_0x337b('0x14')](_0x57a49d[_0x337b('0x26')][_0x337b('0x14')]);}_0xdfc095[_0x337b('0x41')]=qs[_0x337b('0x42')](_0x57a49d[_0x337b('0x26')][_0x337b('0x42')]);_0xdfc095[_0x337b('0x43')]=qs[_0x337b('0x2c')](_[_0x337b('0x44')](_0x57a49d[_0x337b('0x26')],_0x2b93d6[_0x337b('0x2c')]));_0xdfc095[_0x337b('0x43')][_0x337b('0x45')]=_0x5b351f['id'];if(_0x57a49d['query'][_0x337b('0x46')]){_0xdfc095[_0x337b('0x43')]=_[_0x337b('0x33')](_0xdfc095['where'],{'$or':_['map'](_0xdfc095[_0x337b('0x2d')],function(_0x1ac42a){var _0x49158f={};_0x49158f[_0x1ac42a]={'$like':'%'+_0x57a49d[_0x337b('0x26')][_0x337b('0x46')]+'%'};return _0x49158f;})});}if(_0x57a49d['query'][_0x337b('0x47')]){var _0x622a97=_0x57a49d['query'][_0x337b('0x47')][_0x337b('0x48')](',');var _0x199adb={};_0x199adb[_0x622a97[0x0]]={'$gte':moment(_0x622a97[0x1])[_0x337b('0x49')]('YYYY-MM-DD\x20HH:mm:ss')};_0xdfc095[_0x337b('0x43')]=_[_0x337b('0x33')](_0xdfc095[_0x337b('0x43')],_0x199adb);}_0xdfc095=_[_0x337b('0x33')]({},_0xdfc095,_0x57a49d['options']);return db['FaxMessage'][_0x337b('0x16')]({'where':_0xdfc095[_0x337b('0x43')]})['then'](function(_0x1c834f){_0x3463f0[_0x337b('0x16')]=_0x1c834f;if(_0x57a49d[_0x337b('0x26')]['includeAll']){_0xdfc095[_0x337b('0x32')]=[{'all':!![]}];}return db[_0x337b('0x3b')][_0x337b('0x24')](_0xdfc095);})[_0x337b('0x1a')](function(_0xacfb48){_0x3463f0[_0x337b('0x4a')]=_0xacfb48;return _0x3463f0;});}})[_0x337b('0x1a')](respondWithFilteredResult(_0x47387f,_0xdfc095))[_0x337b('0x28')](handleError(_0x47387f,null));};exports[_0x337b('0x4b')]=function(_0x490e56,_0x2b3634){return db['FaxInteraction']['find']({'where':{'id':_0x490e56['params']['id']}})['then'](handleEntityNotFound(_0x2b3634,null))[_0x337b('0x1a')](function(_0x3b9b85){if(_0x3b9b85){return _0x3b9b85[_0x337b('0x4c')](_0x490e56[_0x337b('0x37')][_0x337b('0x3c')],_[_0x337b('0x3d')](_0x490e56[_0x337b('0x37')],[_0x337b('0x3c'),'id'])||{})[_0x337b('0x4d')](function(){return db[_0x337b('0x4e')][_0x337b('0x24')]({'attributes':['id','name',_0x337b('0x4f')],'where':{'id':_0x490e56[_0x337b('0x37')][_0x337b('0x3c')]}});})[_0x337b('0x1a')](function(_0x4b94e0){socket[_0x337b('0x50')](_0x337b('0x51'),{'id':Number(_0x490e56[_0x337b('0x38')]['id']),'tags':_0x4b94e0||[]});return{'id':Number(_0x490e56[_0x337b('0x38')]['id']),'tags':_0x4b94e0||[]};});}})[_0x337b('0x1a')](respondWithResult(_0x2b3634,null))[_0x337b('0x28')](handleError(_0x2b3634,null));};exports['removeTags']=function(_0x1434e9,_0x498e45){return db[_0x337b('0x21')][_0x337b('0x35')]({'where':{'id':_0x1434e9[_0x337b('0x38')]['id']}})[_0x337b('0x1a')](handleEntityNotFound(_0x498e45,null))['then'](function(_0x319cc0){if(_0x319cc0){return _0x319cc0['removeTags'](_0x1434e9[_0x337b('0x26')][_0x337b('0x3c')]);}})[_0x337b('0x1a')](respondWithStatusCode(_0x498e45,null))['catch'](handleError(_0x498e45,null));};exports['download']=function(_0x6bcc71,_0x4ae9bd){var _0x1ff56d=moment()[_0x337b('0x52')]()[_0x337b('0x53')]();var _0x5a26b6=path[_0x337b('0x54')](config['root'],_0x337b('0x55'),'files','tmp');var _0x31e554=path[_0x337b('0x54')](config[_0x337b('0x56')],'server',_0x337b('0x57'),_0x337b('0x58'));var _0x46bdb8=path[_0x337b('0x54')](_0x5a26b6,_0x1ff56d);var _0x300163=util[_0x337b('0x49')]('transcript-%d-%s.zip',_0x6bcc71[_0x337b('0x38')]['id'],_0x1ff56d);var _0x4e859f=path[_0x337b('0x54')](_0x5a26b6,_0x300163);var _0x308960=[];_0x308960['push']({'model':db['Attachment'],'as':_0x337b('0x59'),'raw':!![]});var _0x1850bf=[{'model':db[_0x337b('0x3b')],'as':'Messages','attributes':['id',_0x337b('0x37'),_0x337b('0x5a')],'include':_0x308960}];return db[_0x337b('0x21')]['find']({'where':{'id':_0x6bcc71[_0x337b('0x38')]['id']},'include':_0x1850bf})['then'](handleEntityNotFound(_0x4ae9bd,null))[_0x337b('0x1a')](function(_0x30709c){if(_0x30709c&&_0x30709c[_0x337b('0x5b')]){var _0xb4ea6=_0x30709c[_0x337b('0x5c')]({'plain':!![]});fs[_0x337b('0x5d')](_0x46bdb8);for(var _0x377a0d=0x0;_0x377a0d<_0xb4ea6['Messages'][_0x337b('0x30')];_0x377a0d++){var _0x5a628c=_0xb4ea6['Messages'][_0x377a0d][_0x337b('0x59')];if(_0x5a628c){var _0x58d579=path['join'](_0x31e554,_0x5a628c[_0x337b('0x5e')]);if(fs['existsSync'](_0x58d579)){fs[_0x337b('0x5f')](_0x58d579)[_0x337b('0x60')](fs['createWriteStream'](path[_0x337b('0x54')](_0x46bdb8,_0x5a628c[_0x337b('0x5e')])));}}}return BPromise[_0x337b('0x61')]()[_0x337b('0x1a')](function(){return new BPromise(function(_0x1e61fd,_0x9086f7){zipdir(_0x46bdb8,{'saveTo':_0x4e859f},function(_0x4f81d6,_0x15098e){if(_0x4f81d6)return _0x9086f7(_0x4f81d6);return _0x1e61fd(_0x15098e);});})[_0x337b('0x1a')](function(){return new BPromise(function(_0x49338,_0x303196){rimraf(_0x46bdb8,function(_0x45bef6){if(_0x45bef6)_0x303196(_0x45bef6);return _0x49338();});});})[_0x337b('0x1a')](function(){return _0x4ae9bd[_0x337b('0x62')](_0x4e859f,_0x300163,function(_0x4e939c){if(_0x4e939c){console['log'](_0x337b('0x63'),_0x4e939c);}else{fs[_0x337b('0x64')](_0x4e859f);}});});});}else{return _0x4ae9bd['sendStatus'](0xc8);}})[_0x337b('0x28')](handleError(_0x4ae9bd,null));}; \ No newline at end of file +var _0xdaf3=['YYYY-MM-DD\x20HH:mm:ss','FaxMessage','rows','setTags','omit','spread','Tag','color','emit','faxInteractionTags:save','removeTags','download','unix','toString','root','server','files','tmp','join','push','Attachment','createdAt','Messages','get','basename','existsSync','createReadStream','resolve','log','zip-dir','moment','bluebird','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','api','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','then','error','stack','name','send','index','map','FaxInteraction','rawAttributes','type','key','getOptions','findAll','fax','query','catch','show','model','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','update','params','addMessage','ids','getMessages','nolimit','order','sort','where','FaxInteractionId','filter','$gte','format'];(function(_0x5b4ebe,_0x28bedf){var _0x4d080c=function(_0x40472f){while(--_0x40472f){_0x5b4ebe['push'](_0x5b4ebe['shift']());}};_0x4d080c(++_0x28bedf);}(_0xdaf3,0xe3));var _0x3daf=function(_0x4bfc12,_0x142724){_0x4bfc12=_0x4bfc12-0x0;var _0x33b8ee=_0xdaf3[_0x4bfc12];return _0x33b8ee;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x3daf('0x0'));var moment=require(_0x3daf('0x1'));var BPromise=require(_0x3daf('0x2'));var util=require('util');var path=require(_0x3daf('0x3'));var fs=require('fs');var _=require(_0x3daf('0x4'));var Redis=require(_0x3daf('0x5'));var interaction=require(_0x3daf('0x6'));var qs=require(_0x3daf('0x7'));var logger=require('../../config/logger')(_0x3daf('0x8'));var config=require('../../config/environment');var db=require(_0x3daf('0x9'))['db'];config['redis']=_[_0x3daf('0xa')](config[_0x3daf('0xb')],{'host':_0x3daf('0xc'),'port':0x18eb});var socket=require(_0x3daf('0xd'))(new Redis(config[_0x3daf('0xb')]));require(_0x3daf('0xe'))[_0x3daf('0xf')](socket);function respondWithStatusCode(_0x5974f3,_0x1f1642){_0x1f1642=_0x1f1642||0xcc;return function(_0x4043a4){if(_0x4043a4){return _0x5974f3[_0x3daf('0x10')](_0x1f1642);}return _0x5974f3['status'](_0x1f1642)[_0x3daf('0x11')]();};}function respondWithResult(_0x38b846,_0x5cf221){_0x5cf221=_0x5cf221||0xc8;return function(_0x24b7bf){if(_0x24b7bf){return _0x38b846[_0x3daf('0x12')](_0x5cf221)[_0x3daf('0x13')](_0x24b7bf);}};}function respondWithFilteredResult(_0x667588,_0x50ffb9){return function(_0x2535a1){if(_0x2535a1){var _0x2a84b7=typeof _0x50ffb9[_0x3daf('0x14')]===_0x3daf('0x15')&&typeof _0x50ffb9['limit']==='undefined';var _0x33032d=_0x2535a1['count'];var _0x5afd31=_0x2a84b7?0x0:_0x50ffb9[_0x3daf('0x14')];var _0x1230d0=_0x2a84b7?_0x2535a1[_0x3daf('0x16')]:_0x50ffb9['offset']+_0x50ffb9[_0x3daf('0x17')];var _0x352f6d;if(_0x1230d0>=_0x33032d){_0x1230d0=_0x33032d;_0x352f6d=0xc8;}else{_0x352f6d=0xce;}_0x667588[_0x3daf('0x12')](_0x352f6d);return _0x667588[_0x3daf('0x18')](_0x3daf('0x19'),_0x5afd31+'-'+_0x1230d0+'/'+_0x33032d)['json'](_0x2535a1);}return null;};}function saveUpdates(_0x4508ca){return function(_0x2812a4){if(_0x2812a4){return _0x2812a4['update'](_0x4508ca)[_0x3daf('0x1a')](function(_0x4d6b8e){return _0x4d6b8e;});}return null;};}function removeEntity(_0x516b78){return function(_0x2e0c11){if(_0x2e0c11){return _0x2e0c11['destroy']()['then'](function(){_0x516b78[_0x3daf('0x12')](0xcc)[_0x3daf('0x11')]();});}};}function handleEntityNotFound(_0x26d172){return function(_0x2f9c56){if(!_0x2f9c56){_0x26d172[_0x3daf('0x10')](0x194);}return _0x2f9c56;};}function handleError(_0xe1fd24,_0x2c7103){_0x2c7103=_0x2c7103||0x1f4;return function(_0x16d9d0){logger[_0x3daf('0x1b')](_0x16d9d0[_0x3daf('0x1c')]);if(_0x16d9d0['name']){delete _0x16d9d0[_0x3daf('0x1d')];}_0xe1fd24[_0x3daf('0x12')](_0x2c7103)[_0x3daf('0x1e')](_0x16d9d0);};}exports[_0x3daf('0x1f')]=function(_0x10fc83,_0x49dcc1){var _0x2ad006={};var _0x391e76=_[_0x3daf('0x20')](db[_0x3daf('0x21')][_0x3daf('0x22')],function(_0x495ad8){return{'name':_0x495ad8['fieldName'],'type':_0x495ad8[_0x3daf('0x23')][_0x3daf('0x24')]};});_0x2ad006=qs[_0x3daf('0x25')](_0x391e76,_0x10fc83);return interaction[_0x3daf('0x26')](_0x3daf('0x27'),_0x10fc83[_0x3daf('0x28')],_0x10fc83['user'],_0x2ad006,_0x391e76)['then'](respondWithFilteredResult(_0x49dcc1,_0x2ad006))[_0x3daf('0x29')](handleError(_0x49dcc1,null));};exports[_0x3daf('0x2a')]=function(_0x441533,_0x2b69d1){var _0x43b059={'raw':![],'where':{'id':_0x441533['params']['id']}},_0x54a77f={};_0x54a77f[_0x3daf('0x2b')]=_['keys'](db['FaxInteraction']['rawAttributes']);_0x54a77f[_0x3daf('0x28')]=_[_0x3daf('0x2c')](_0x441533[_0x3daf('0x28')]);_0x54a77f[_0x3daf('0x2d')]=_[_0x3daf('0x2e')](_0x54a77f[_0x3daf('0x2b')],_0x54a77f['query']);_0x43b059[_0x3daf('0x2f')]=_[_0x3daf('0x2e')](_0x54a77f[_0x3daf('0x2b')],qs[_0x3daf('0x30')](_0x441533[_0x3daf('0x28')][_0x3daf('0x30')]));_0x43b059['attributes']=_0x43b059['attributes'][_0x3daf('0x31')]?_0x43b059[_0x3daf('0x2f')]:_0x54a77f[_0x3daf('0x2b')];if(_0x441533['query'][_0x3daf('0x32')]){_0x43b059[_0x3daf('0x33')]=[{'all':!![]}];}_0x43b059=_[_0x3daf('0x34')]({},_0x43b059,_0x441533[_0x3daf('0x35')]);return db[_0x3daf('0x21')][_0x3daf('0x36')](_0x43b059)[_0x3daf('0x1a')](handleEntityNotFound(_0x2b69d1,null))[_0x3daf('0x1a')](respondWithResult(_0x2b69d1,null))[_0x3daf('0x29')](handleError(_0x2b69d1,null));};exports[_0x3daf('0x37')]=function(_0x42a558,_0x3ff154){return db['FaxInteraction'][_0x3daf('0x37')](_0x42a558[_0x3daf('0x38')],{})['then'](respondWithResult(_0x3ff154,0xc9))[_0x3daf('0x29')](handleError(_0x3ff154,null));};exports[_0x3daf('0x39')]=function(_0x307947,_0x3dcc7f){if(_0x307947[_0x3daf('0x38')]['id']){delete _0x307947[_0x3daf('0x38')]['id'];}return db[_0x3daf('0x21')]['find']({'where':{'id':_0x307947[_0x3daf('0x3a')]['id']}})[_0x3daf('0x1a')](handleEntityNotFound(_0x3dcc7f,null))['then'](saveUpdates(_0x307947[_0x3daf('0x38')],null))[_0x3daf('0x1a')](respondWithResult(_0x3dcc7f,null))[_0x3daf('0x29')](handleError(_0x3dcc7f,null));};exports['destroy']=function(_0x59a9e7,_0x277811){return db['FaxInteraction'][_0x3daf('0x36')]({'where':{'id':_0x59a9e7[_0x3daf('0x3a')]['id']}})[_0x3daf('0x1a')](handleEntityNotFound(_0x277811,null))[_0x3daf('0x1a')](removeEntity(_0x277811,null))[_0x3daf('0x29')](handleError(_0x277811,null));};exports['describe']=function(_0x1a2f5c,_0x5a0f27){return db['FaxInteraction']['describe']()[_0x3daf('0x1a')](respondWithResult(_0x5a0f27,null))[_0x3daf('0x29')](handleError(_0x5a0f27,null));};exports['addMessage']=function(_0x15e689,_0x4f2b28){return db['FaxMessage'][_0x3daf('0x36')]({'where':{'id':_0x15e689[_0x3daf('0x3a')]['id']}})[_0x3daf('0x1a')](handleEntityNotFound(_0x4f2b28,null))[_0x3daf('0x1a')](function(_0x302737){if(_0x302737){return _0x302737[_0x3daf('0x3b')](_0x15e689[_0x3daf('0x38')][_0x3daf('0x3c')],_['omit'](_0x15e689[_0x3daf('0x38')],['ids','id'])||{});}})[_0x3daf('0x1a')](respondWithResult(_0x4f2b28,null))['catch'](handleError(_0x4f2b28,null));};exports[_0x3daf('0x3d')]=function(_0x1c2044,_0x4e9c18){var _0x11c99c={'raw':![],'where':{}};var _0x52c180={};var _0x1da2c7={'count':0x0,'rows':[]};return db[_0x3daf('0x21')]['findOne']({'where':{'id':_0x1c2044[_0x3daf('0x3a')]['id']}})[_0x3daf('0x1a')](handleEntityNotFound(_0x4e9c18,null))[_0x3daf('0x1a')](function(_0x22c93e){if(_0x22c93e){_0x52c180[_0x3daf('0x2b')]=_['keys'](db['FaxMessage'][_0x3daf('0x22')]);_0x52c180['query']=_[_0x3daf('0x2c')](_0x1c2044[_0x3daf('0x28')]);_0x52c180[_0x3daf('0x2d')]=_[_0x3daf('0x2e')](_0x52c180[_0x3daf('0x2b')],_0x52c180['query']);_0x11c99c[_0x3daf('0x2f')]=_[_0x3daf('0x2e')](_0x52c180['model'],qs[_0x3daf('0x30')](_0x1c2044[_0x3daf('0x28')]['fields']));_0x11c99c['attributes']=_0x11c99c['attributes'][_0x3daf('0x31')]?_0x11c99c[_0x3daf('0x2f')]:_0x52c180['model'];if(!_0x1c2044[_0x3daf('0x28')]['hasOwnProperty'](_0x3daf('0x3e'))){_0x11c99c[_0x3daf('0x17')]=qs[_0x3daf('0x17')](_0x1c2044['query']['limit']);_0x11c99c[_0x3daf('0x14')]=qs['offset'](_0x1c2044[_0x3daf('0x28')][_0x3daf('0x14')]);}_0x11c99c[_0x3daf('0x3f')]=qs[_0x3daf('0x40')](_0x1c2044[_0x3daf('0x28')][_0x3daf('0x40')]);_0x11c99c['where']=qs[_0x3daf('0x2d')](_['pick'](_0x1c2044['query'],_0x52c180['filters']));_0x11c99c[_0x3daf('0x41')][_0x3daf('0x42')]=_0x22c93e['id'];if(_0x1c2044[_0x3daf('0x28')]['filter']){_0x11c99c[_0x3daf('0x41')]=_[_0x3daf('0x34')](_0x11c99c[_0x3daf('0x41')],{'$or':_[_0x3daf('0x20')](_0x11c99c[_0x3daf('0x2f')],function(_0x392992){var _0x2e78f2={};_0x2e78f2[_0x392992]={'$like':'%'+_0x1c2044['query'][_0x3daf('0x43')]+'%'};return _0x2e78f2;})});}if(_0x1c2044['query']['$gte']){var _0x508f7d=_0x1c2044[_0x3daf('0x28')][_0x3daf('0x44')]['split'](',');var _0x4b6e94={};_0x4b6e94[_0x508f7d[0x0]]={'$gte':moment(_0x508f7d[0x1])[_0x3daf('0x45')](_0x3daf('0x46'))};_0x11c99c[_0x3daf('0x41')]=_[_0x3daf('0x34')](_0x11c99c[_0x3daf('0x41')],_0x4b6e94);}_0x11c99c=_[_0x3daf('0x34')]({},_0x11c99c,_0x1c2044[_0x3daf('0x35')]);return db[_0x3daf('0x47')][_0x3daf('0x16')]({'where':_0x11c99c['where']})[_0x3daf('0x1a')](function(_0x26a92f){_0x1da2c7[_0x3daf('0x16')]=_0x26a92f;if(_0x1c2044['query'][_0x3daf('0x32')]){_0x11c99c[_0x3daf('0x33')]=[{'all':!![]}];}return db[_0x3daf('0x47')][_0x3daf('0x26')](_0x11c99c);})[_0x3daf('0x1a')](function(_0x25d1b5){_0x1da2c7[_0x3daf('0x48')]=_0x25d1b5;return _0x1da2c7;});}})['then'](respondWithFilteredResult(_0x4e9c18,_0x11c99c))[_0x3daf('0x29')](handleError(_0x4e9c18,null));};exports['addTags']=function(_0x306992,_0x179963){return db[_0x3daf('0x21')][_0x3daf('0x36')]({'where':{'id':_0x306992['params']['id']}})['then'](handleEntityNotFound(_0x179963,null))[_0x3daf('0x1a')](function(_0x12462d){if(_0x12462d){return _0x12462d[_0x3daf('0x49')](_0x306992['body'][_0x3daf('0x3c')],_[_0x3daf('0x4a')](_0x306992[_0x3daf('0x38')],[_0x3daf('0x3c'),'id'])||{})[_0x3daf('0x4b')](function(){return db[_0x3daf('0x4c')][_0x3daf('0x26')]({'attributes':['id','name',_0x3daf('0x4d')],'where':{'id':_0x306992[_0x3daf('0x38')][_0x3daf('0x3c')]}});})[_0x3daf('0x1a')](function(_0x2bfef0){socket[_0x3daf('0x4e')](_0x3daf('0x4f'),{'id':Number(_0x306992[_0x3daf('0x3a')]['id']),'tags':_0x2bfef0||[]});return{'id':Number(_0x306992['params']['id']),'tags':_0x2bfef0||[]};});}})[_0x3daf('0x1a')](respondWithResult(_0x179963,null))[_0x3daf('0x29')](handleError(_0x179963,null));};exports[_0x3daf('0x50')]=function(_0x4a01e4,_0x1bc7ca){return db[_0x3daf('0x21')][_0x3daf('0x36')]({'where':{'id':_0x4a01e4[_0x3daf('0x3a')]['id']}})[_0x3daf('0x1a')](handleEntityNotFound(_0x1bc7ca,null))['then'](function(_0x3b4290){if(_0x3b4290){return _0x3b4290[_0x3daf('0x50')](_0x4a01e4[_0x3daf('0x28')][_0x3daf('0x3c')]);}})[_0x3daf('0x1a')](respondWithStatusCode(_0x1bc7ca,null))[_0x3daf('0x29')](handleError(_0x1bc7ca,null));};exports[_0x3daf('0x51')]=function(_0x3d380d,_0x1e9e17){var _0x4ea6cb=moment()[_0x3daf('0x52')]()[_0x3daf('0x53')]();var _0x2d5152=path['join'](config[_0x3daf('0x54')],_0x3daf('0x55'),_0x3daf('0x56'),_0x3daf('0x57'));var _0x4eec7b=path[_0x3daf('0x58')](config['root'],_0x3daf('0x55'),_0x3daf('0x56'),'attachments');var _0xf92d3b=path[_0x3daf('0x58')](_0x2d5152,_0x4ea6cb);var _0x4ef692=util[_0x3daf('0x45')]('transcript-%d-%s.zip',_0x3d380d[_0x3daf('0x3a')]['id'],_0x4ea6cb);var _0x19dd53=path[_0x3daf('0x58')](_0x2d5152,_0x4ef692);var _0x4de32a=[];_0x4de32a[_0x3daf('0x59')]({'model':db[_0x3daf('0x5a')],'as':_0x3daf('0x5a'),'raw':!![]});var _0x36a662=[{'model':db[_0x3daf('0x47')],'as':'Messages','attributes':['id',_0x3daf('0x38'),_0x3daf('0x5b')],'include':_0x4de32a}];return db[_0x3daf('0x21')][_0x3daf('0x36')]({'where':{'id':_0x3d380d['params']['id']},'include':_0x36a662})['then'](handleEntityNotFound(_0x1e9e17,null))[_0x3daf('0x1a')](function(_0x3a30af){if(_0x3a30af&&_0x3a30af[_0x3daf('0x5c')]){var _0xef7042=_0x3a30af[_0x3daf('0x5d')]({'plain':!![]});fs['mkdirSync'](_0xf92d3b);for(var _0x3d178e=0x0;_0x3d178e<_0xef7042[_0x3daf('0x5c')]['length'];_0x3d178e++){var _0x74f79d=_0xef7042[_0x3daf('0x5c')][_0x3d178e][_0x3daf('0x5a')];if(_0x74f79d){var _0x59177b=path[_0x3daf('0x58')](_0x4eec7b,_0x74f79d[_0x3daf('0x5e')]);if(fs[_0x3daf('0x5f')](_0x59177b)){fs[_0x3daf('0x60')](_0x59177b)['pipe'](fs['createWriteStream'](path[_0x3daf('0x58')](_0xf92d3b,_0x74f79d[_0x3daf('0x5e')])));}}}return BPromise[_0x3daf('0x61')]()['then'](function(){return new BPromise(function(_0x423613,_0x1a7224){zipdir(_0xf92d3b,{'saveTo':_0x19dd53},function(_0x338154,_0x48d1b3){if(_0x338154)return _0x1a7224(_0x338154);return _0x423613(_0x48d1b3);});})[_0x3daf('0x1a')](function(){return new BPromise(function(_0x357f84,_0x4fb6e8){rimraf(_0xf92d3b,function(_0x3f461f){if(_0x3f461f)_0x4fb6e8(_0x3f461f);return _0x357f84();});});})[_0x3daf('0x1a')](function(){return _0x1e9e17[_0x3daf('0x51')](_0x19dd53,_0x4ef692,function(_0x34ba56){if(_0x34ba56){console[_0x3daf('0x62')]('err',_0x34ba56);}else{fs['unlinkSync'](_0x19dd53);}});});});}else{return _0x1e9e17['sendStatus'](0xc8);}})['catch'](handleError(_0x1e9e17,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index e8abea7..900e4e6 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 _0x9baf=['unreadMessages','emit','catch','hook','exports','events','FaxInteraction','FaxMessage','setMaxListeners','update','remove','then','setDataValue'];(function(_0x32e7bb,_0x1cc16a){var _0x165e4a=function(_0x33ae3e){while(--_0x33ae3e){_0x32e7bb['push'](_0x32e7bb['shift']());}};_0x165e4a(++_0x1cc16a);}(_0x9baf,0x1cc));var _0xf9ba=function(_0x377ad1,_0xa4961b){_0x377ad1=_0x377ad1-0x0;var _0x533aff=_0x9baf[_0x377ad1];return _0x533aff;};'use strict';var EventEmitter=require(_0xf9ba('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0xf9ba('0x1')];var FaxMessage=require('../../mysqldb')['db'][_0xf9ba('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf9ba('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xf9ba('0x4'),'afterDestroy':_0xf9ba('0x5')};function emitEvent(_0x2eb71e){return function(_0x1c3507,_0xf5a13a,_0x1a5493){_0x1c3507['getUsers']({'attributes':['id'],'raw':!![]})[_0xf9ba('0x6')](function(_0x238d7d){_0x1c3507[_0xf9ba('0x7')]('Users',_0x238d7d['map'](function(_0x19805b){return{'id':_0x19805b['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0x1c3507['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x370f4a){_0x1c3507['setDataValue'](_0xf9ba('0x8'),_0x370f4a['length']);FaxInteractionEvents['emit'](_0x2eb71e+':'+_0x1c3507['id'],_0x1c3507);FaxInteractionEvents[_0xf9ba('0x9')](_0x2eb71e,_0x1c3507);_0x1a5493(null);})[_0xf9ba('0xa')](_0x1a5493(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxInteraction[_0xf9ba('0xb')](e,emitEvent(event));}}module[_0xf9ba('0xc')]=FaxInteractionEvents; \ No newline at end of file +var _0x376d=['then','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','getUsers','Users','findAll'];(function(_0x323949,_0x2abdc1){var _0x475daf=function(_0x19dc1){while(--_0x19dc1){_0x323949['push'](_0x323949['shift']());}};_0x475daf(++_0x2abdc1);}(_0x376d,0x107));var _0xd376=function(_0x3d7b3a,_0x2906eb){_0x3d7b3a=_0x3d7b3a-0x0;var _0x469f8e=_0x376d[_0x3d7b3a];return _0x469f8e;};'use strict';var EventEmitter=require(_0xd376('0x0'));var FaxInteraction=require(_0xd376('0x1'))['db']['FaxInteraction'];var FaxMessage=require(_0xd376('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xd376('0x2')](0x0);var events={'afterCreate':_0xd376('0x3'),'afterUpdate':_0xd376('0x4'),'afterDestroy':_0xd376('0x5')};function emitEvent(_0x54d873){return function(_0x366dc2,_0x24c8e2,_0x4fb027){_0x366dc2[_0xd376('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x22875e){_0x366dc2['setDataValue'](_0xd376('0x7'),_0x22875e['map'](function(_0x3d6b14){return{'id':_0x3d6b14['id']};}));return FaxMessage[_0xd376('0x8')]({'where':{'FaxInteractionId':_0x366dc2['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd376('0x9')](function(_0x573bf8){_0x366dc2[_0xd376('0xa')](_0xd376('0xb'),_0x573bf8[_0xd376('0xc')]);FaxInteractionEvents[_0xd376('0xd')](_0x54d873+':'+_0x366dc2['id'],_0x366dc2);FaxInteractionEvents[_0xd376('0xd')](_0x54d873,_0x366dc2);_0x4fb027(null);})['catch'](_0x4fb027(null));};}for(var e in events){if(events[_0xd376('0xe')](e)){var event=events[e];FaxInteraction[_0xd376('0xf')](e,emitEvent(event));}}module[_0xd376('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 43b9157..7ca2e32 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 _0xb032=['bluebird','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb032,0x84));var _0x2b03=function(_0x3c9def,_0x5384ea){_0x3c9def=_0x3c9def-0x0;var _0x591e39=_0xb032[_0x3c9def];return _0x591e39;};'use strict';var _=require(_0x2b03('0x0'));var util=require('util');var logger=require(_0x2b03('0x1'))(_0x2b03('0x2'));var moment=require(_0x2b03('0x3'));var BPromise=require(_0x2b03('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b03('0x5'));var rimraf=require(_0x2b03('0x6'));var config=require(_0x2b03('0x7'));var attributes=require(_0x2b03('0x8'));module[_0x2b03('0x9')]=function(_0x2bad8d,_0x556bda){return _0x2bad8d[_0x2b03('0xa')](_0x2b03('0xb'),attributes,{'tableName':_0x2b03('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x24cc52,_0x4df225,_0xe44606){if(_0x24cc52[_0x2b03('0xd')](_0x2b03('0xe'))){_0x24cc52['closedAt']=moment()[_0x2b03('0xf')](_0x2b03('0x10'));}_0xe44606(null,_0x24cc52);}}});}; \ No newline at end of file +var _0x1d91=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./faxInteraction.attributes','exports','FaxInteraction','fax_interactions','closed','format'];(function(_0x568bd7,_0x23eea6){var _0x203cda=function(_0x26d94f){while(--_0x26d94f){_0x568bd7['push'](_0x568bd7['shift']());}};_0x203cda(++_0x23eea6);}(_0x1d91,0x150));var _0x11d9=function(_0x29deca,_0x241ece){_0x29deca=_0x29deca-0x0;var _0x345fc8=_0x1d91[_0x29deca];return _0x345fc8;};'use strict';var _=require(_0x11d9('0x0'));var util=require(_0x11d9('0x1'));var logger=require(_0x11d9('0x2'))('api');var moment=require(_0x11d9('0x3'));var BPromise=require(_0x11d9('0x4'));var rp=require(_0x11d9('0x5'));var fs=require('fs');var path=require(_0x11d9('0x6'));var rimraf=require('rimraf');var config=require(_0x11d9('0x7'));var attributes=require(_0x11d9('0x8'));module[_0x11d9('0x9')]=function(_0x4b27dd,_0x564b2b){return _0x4b27dd['define'](_0x11d9('0xa'),attributes,{'tableName':_0x11d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x274b17,_0x32a4f7,_0x7a8c60){if(_0x274b17['changed'](_0x11d9('0xc'))){_0x274b17['closedAt']=moment()[_0x11d9('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x7a8c60(null,_0x274b17);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 75a39c3..9b2a9f6 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 _0x6d65=['rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','body','options','raw','limit','where','addTags','ids','AddTags','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x89efd1,_0xe83371){var _0x3af8f=function(_0x50b3f2){while(--_0x50b3f2){_0x89efd1['push'](_0x89efd1['shift']());}};_0x3af8f(++_0xe83371);}(_0x6d65,0x95));var _0x56d6=function(_0x421654,_0x5e8e8b){_0x421654=_0x421654-0x0;var _0x34a250=_0x6d65[_0x421654];return _0x34a250;};'use strict';var _=require(_0x56d6('0x0'));var util=require(_0x56d6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x56d6('0x2'));var fs=require('fs');var Redis=require(_0x56d6('0x3'));var db=require(_0x56d6('0x4'))['db'];var utils=require(_0x56d6('0x5'));var logger=require(_0x56d6('0x6'))(_0x56d6('0x7'));var config=require('../../config/environment');var jayson=require(_0x56d6('0x8'));var client=jayson[_0x56d6('0x9')][_0x56d6('0xa')]({'port':0x232a});config[_0x56d6('0xb')]=_[_0x56d6('0xc')](config[_0x56d6('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x56d6('0xd'))(new Redis(config[_0x56d6('0xb')]));require(_0x56d6('0xe'))[_0x56d6('0xf')](socket);function respondWithRpcPromise(_0x129aee,_0x266f2c,_0x2267f5){return new BPromise(function(_0x54a928,_0x84f41f){return client[_0x56d6('0x10')](_0x129aee,_0x2267f5)[_0x56d6('0x11')](function(_0xe12779){logger[_0x56d6('0x12')](_0x56d6('0x13'),_0x266f2c,_0x56d6('0x14'));logger[_0x56d6('0x15')](_0x56d6('0x16'),_0x266f2c,'request\x20sent',JSON[_0x56d6('0x17')](_0xe12779));if(_0xe12779[_0x56d6('0x18')]){if(_0xe12779[_0x56d6('0x18')][_0x56d6('0x19')]===0x1f4){logger[_0x56d6('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x266f2c,_0xe12779[_0x56d6('0x18')][_0x56d6('0x1a')]);return _0x84f41f(_0xe12779[_0x56d6('0x18')][_0x56d6('0x1a')]);}logger['error']('FaxInteraction,\x20%s,\x20%s',_0x266f2c,_0xe12779[_0x56d6('0x18')][_0x56d6('0x1a')]);return _0x54a928(_0xe12779[_0x56d6('0x18')][_0x56d6('0x1a')]);}else{logger[_0x56d6('0x12')](_0x56d6('0x13'),_0x266f2c,_0x56d6('0x14'));_0x54a928(_0xe12779[_0x56d6('0x1b')][_0x56d6('0x1a')]);}})[_0x56d6('0x1c')](function(_0x545768){logger[_0x56d6('0x18')]('FaxInteraction,\x20%s,\x20%s',_0x266f2c,_0x545768);_0x84f41f(_0x545768);});});}exports[_0x56d6('0x1d')]=function(_0x534563){var _0x4616ab=this;return new Promise(function(_0x3b246c,_0x28dc24){return db[_0x56d6('0x1e')]['update'](_0x534563[_0x56d6('0x1f')],{'raw':_0x534563[_0x56d6('0x20')]?_0x534563[_0x56d6('0x20')][_0x56d6('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x534563[_0x56d6('0x20')]?_0x534563[_0x56d6('0x20')]['where']||null:null,'attributes':_0x534563['options']?_0x534563[_0x56d6('0x20')]['attributes']||null:null,'limit':_0x534563[_0x56d6('0x20')]?_0x534563[_0x56d6('0x20')][_0x56d6('0x22')]||null:null})[_0x56d6('0x11')](function(_0x414665){logger['info']('UpdateFaxInteraction',_0x534563);logger['debug'](_0x56d6('0x1d'),_0x534563,JSON['stringify'](_0x414665));_0x3b246c(_0x414665);})[_0x56d6('0x1c')](function(_0x225b35){logger['error'](_0x56d6('0x1d'),_0x225b35[_0x56d6('0x1a')],_0x534563);_0x28dc24(_0x4616ab[_0x56d6('0x18')](0x1f4,_0x225b35['message']));});});};exports['AddTagsToFaxInteraction']=function(_0x1a32df){return new Promise(function(_0x5d79e0,_0x4abd04){return db[_0x56d6('0x1e')]['find']({'where':_0x1a32df['options']?_0x1a32df['options'][_0x56d6('0x23')]||null:null})['then'](function(_0x3c49ff){if(_0x3c49ff){return _0x3c49ff[_0x56d6('0x24')](_0x1a32df[_0x56d6('0x1f')][_0x56d6('0x25')],_['omit'](_0x1a32df[_0x56d6('0x1f')],[_0x56d6('0x25'),'id'])||{});}})['spread'](function(_0x2dad6c){logger[_0x56d6('0x12')](_0x56d6('0x26'),_0x1a32df);logger[_0x56d6('0x15')]('AddTags',_0x1a32df,JSON[_0x56d6('0x17')](_0x2dad6c));_0x5d79e0(_0x2dad6c);})[_0x56d6('0x1c')](function(_0x2c9c5f){logger[_0x56d6('0x18')](_0x56d6('0x26'),_0x2c9c5f[_0x56d6('0x1a')],_0x1a32df);_0x4abd04(_this['error'](0x1f4,_0x2c9c5f['message']));});});}; \ No newline at end of file +var _0x64ff=['info','result','catch','FaxInteraction','update','options','raw','attributes','UpdateFaxInteraction','stringify','AddTagsToFaxInteraction','find','where','addTags','omit','body','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','debug','request\x20sent','error','code','FaxInteraction,\x20%s,\x20%s','message'];(function(_0x7f14eb,_0x293155){var _0x554bff=function(_0x43ed25){while(--_0x43ed25){_0x7f14eb['push'](_0x7f14eb['shift']());}};_0x554bff(++_0x293155);}(_0x64ff,0x114));var _0xf64f=function(_0x2e7eb3,_0x3c3e04){_0x2e7eb3=_0x2e7eb3-0x0;var _0x11e17a=_0x64ff[_0x2e7eb3];return _0x11e17a;};'use strict';var _=require(_0xf64f('0x0'));var util=require('util');var moment=require(_0xf64f('0x1'));var BPromise=require(_0xf64f('0x2'));var rs=require(_0xf64f('0x3'));var fs=require('fs');var Redis=require(_0xf64f('0x4'));var db=require(_0xf64f('0x5'))['db'];var utils=require(_0xf64f('0x6'));var logger=require(_0xf64f('0x7'))(_0xf64f('0x8'));var config=require(_0xf64f('0x9'));var jayson=require(_0xf64f('0xa'));var client=jayson[_0xf64f('0xb')][_0xf64f('0xc')]({'port':0x232a});config[_0xf64f('0xd')]=_[_0xf64f('0xe')](config[_0xf64f('0xd')],{'host':_0xf64f('0xf'),'port':0x18eb});var socket=require(_0xf64f('0x10'))(new Redis(config[_0xf64f('0xd')]));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x371b42,_0xcdcc9d,_0x32085c){return new BPromise(function(_0x19d19a,_0x38a64c){return client[_0xf64f('0x11')](_0x371b42,_0x32085c)[_0xf64f('0x12')](function(_0x267122){logger['info']('FaxInteraction,\x20%s,\x20%s',_0xcdcc9d,'request\x20sent');logger[_0xf64f('0x13')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0xcdcc9d,_0xf64f('0x14'),JSON['stringify'](_0x267122));if(_0x267122[_0xf64f('0x15')]){if(_0x267122[_0xf64f('0x15')][_0xf64f('0x16')]===0x1f4){logger[_0xf64f('0x15')](_0xf64f('0x17'),_0xcdcc9d,_0x267122[_0xf64f('0x15')]['message']);return _0x38a64c(_0x267122[_0xf64f('0x15')][_0xf64f('0x18')]);}logger[_0xf64f('0x15')](_0xf64f('0x17'),_0xcdcc9d,_0x267122[_0xf64f('0x15')][_0xf64f('0x18')]);return _0x19d19a(_0x267122[_0xf64f('0x15')]['message']);}else{logger[_0xf64f('0x19')](_0xf64f('0x17'),_0xcdcc9d,_0xf64f('0x14'));_0x19d19a(_0x267122[_0xf64f('0x1a')][_0xf64f('0x18')]);}})[_0xf64f('0x1b')](function(_0x2bc952){logger[_0xf64f('0x15')](_0xf64f('0x17'),_0xcdcc9d,_0x2bc952);_0x38a64c(_0x2bc952);});});}exports['UpdateFaxInteraction']=function(_0x2cc8fd){var _0x31eca1=this;return new Promise(function(_0x3c55d1,_0x162c02){return db[_0xf64f('0x1c')][_0xf64f('0x1d')](_0x2cc8fd['body'],{'raw':_0x2cc8fd[_0xf64f('0x1e')]?_0x2cc8fd[_0xf64f('0x1e')][_0xf64f('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2cc8fd[_0xf64f('0x1e')]?_0x2cc8fd['options']['where']||null:null,'attributes':_0x2cc8fd['options']?_0x2cc8fd[_0xf64f('0x1e')][_0xf64f('0x20')]||null:null,'limit':_0x2cc8fd[_0xf64f('0x1e')]?_0x2cc8fd[_0xf64f('0x1e')]['limit']||null:null})[_0xf64f('0x12')](function(_0x98bfca){logger[_0xf64f('0x19')](_0xf64f('0x21'),_0x2cc8fd);logger[_0xf64f('0x13')](_0xf64f('0x21'),_0x2cc8fd,JSON[_0xf64f('0x22')](_0x98bfca));_0x3c55d1(_0x98bfca);})['catch'](function(_0x21c853){logger[_0xf64f('0x15')](_0xf64f('0x21'),_0x21c853[_0xf64f('0x18')],_0x2cc8fd);_0x162c02(_0x31eca1[_0xf64f('0x15')](0x1f4,_0x21c853['message']));});});};exports[_0xf64f('0x23')]=function(_0x96a2b2){return new Promise(function(_0x2044c4,_0x3bb490){return db[_0xf64f('0x1c')][_0xf64f('0x24')]({'where':_0x96a2b2['options']?_0x96a2b2[_0xf64f('0x1e')][_0xf64f('0x25')]||null:null})[_0xf64f('0x12')](function(_0x497039){if(_0x497039){return _0x497039[_0xf64f('0x26')](_0x96a2b2['body']['ids'],_[_0xf64f('0x27')](_0x96a2b2[_0xf64f('0x28')],['ids','id'])||{});}})[_0xf64f('0x29')](function(_0x17239c){logger[_0xf64f('0x19')](_0xf64f('0x2a'),_0x96a2b2);logger[_0xf64f('0x13')]('AddTags',_0x96a2b2,JSON[_0xf64f('0x22')](_0x17239c));_0x2044c4(_0x17239c);})[_0xf64f('0x1b')](function(_0x2f7a03){logger['error'](_0xf64f('0x2a'),_0x2f7a03['message'],_0x96a2b2);_0x3bb490(_this[_0xf64f('0x15')](0x1f4,_0x2f7a03['message']));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 0e5781a..63704d6 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 _0x7e8b=['remove','emit','removeListener','length','./faxInteraction.events'];(function(_0x396fdf,_0x928686){var _0x1c0868=function(_0x35efc9){while(--_0x35efc9){_0x396fdf['push'](_0x396fdf['shift']());}};_0x1c0868(++_0x928686);}(_0x7e8b,0x72));var _0xb7e8=function(_0x2a702f,_0x377aa7){_0x2a702f=_0x2a702f-0x0;var _0x52106f=_0x7e8b[_0x2a702f];return _0x52106f;};'use strict';var FaxInteractionEvents=require(_0xb7e8('0x0'));var events=['save',_0xb7e8('0x1'),'update'];function createListener(_0x5a4da0,_0x22571e){return function(_0x13cbdd){_0x22571e[_0xb7e8('0x2')](_0x5a4da0,_0x13cbdd);};}function removeListener(_0x3b1418,_0x3ef1e1){return function(){FaxInteractionEvents[_0xb7e8('0x3')](_0x3b1418,_0x3ef1e1);};}exports['register']=function(_0x41dbac){for(var _0x56203c=0x0,_0xf36f42=events[_0xb7e8('0x4')];_0x56203c<_0xf36f42;_0x56203c++){var _0x12dd3a=events[_0x56203c];var _0x4348c0=createListener('faxInteraction:'+_0x12dd3a,_0x41dbac);FaxInteractionEvents['on'](_0x12dd3a,_0x4348c0);}}; \ No newline at end of file +var _0x44e7=['removeListener','length','./faxInteraction.events','remove','update','emit'];(function(_0x350269,_0x532e02){var _0x4fcb30=function(_0x3d2b51){while(--_0x3d2b51){_0x350269['push'](_0x350269['shift']());}};_0x4fcb30(++_0x532e02);}(_0x44e7,0x1e2));var _0x744e=function(_0x186d17,_0x9fa8ef){_0x186d17=_0x186d17-0x0;var _0x5d4b89=_0x44e7[_0x186d17];return _0x5d4b89;};'use strict';var FaxInteractionEvents=require(_0x744e('0x0'));var events=['save',_0x744e('0x1'),_0x744e('0x2')];function createListener(_0x371f53,_0x5ad0a7){return function(_0x588ebe){_0x5ad0a7[_0x744e('0x3')](_0x371f53,_0x588ebe);};}function removeListener(_0x5518ae,_0x554a18){return function(){FaxInteractionEvents[_0x744e('0x4')](_0x5518ae,_0x554a18);};}exports['register']=function(_0x18aa7c){for(var _0x19fc17=0x0,_0x47ab84=events[_0x744e('0x5')];_0x19fc17<_0x47ab84;_0x19fc17++){var _0x1de3d2=events[_0x19fc17];var _0x32bade=createListener('faxInteraction:'+_0x1de3d2,_0x18aa7c);FaxInteractionEvents['on'](_0x1de3d2,_0x32bade);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 7b80499..a4f2a68 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 _0x0f50=['/:id/download','create','post','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','delete','faxinteraction:destroy','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/messages'];(function(_0x24c46d,_0x52b2ac){var _0x127ad6=function(_0x16ae2a){while(--_0x16ae2a){_0x24c46d['push'](_0x24c46d['shift']());}};_0x127ad6(++_0x52b2ac);}(_0x0f50,0x6f));var _0x00f5=function(_0x474f01,_0x352417){_0x474f01=_0x474f01-0x0;var _0x15e5f4=_0x0f50[_0x474f01];return _0x15e5f4;};'use strict';var multer=require('multer');var util=require(_0x00f5('0x0'));var path=require(_0x00f5('0x1'));var timeout=require(_0x00f5('0x2'));var express=require(_0x00f5('0x3'));var router=express[_0x00f5('0x4')]();var fs_extra=require(_0x00f5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x00f5('0x6'));var config=require(_0x00f5('0x7'));var controller=require(_0x00f5('0x8'));router[_0x00f5('0x9')]('/',auth['isAuthenticated'](),controller[_0x00f5('0xa')]);router[_0x00f5('0x9')](_0x00f5('0xb'),auth[_0x00f5('0xc')](),controller[_0x00f5('0xd')]);router[_0x00f5('0x9')](_0x00f5('0xe'),auth['isAuthenticated'](),controller[_0x00f5('0xf')]);router[_0x00f5('0x9')](_0x00f5('0x10'),auth[_0x00f5('0xc')](),controller['getMessages']);router[_0x00f5('0x9')](_0x00f5('0x11'),auth[_0x00f5('0xc')](),controller['download']);router['post']('/',auth[_0x00f5('0xc')](),controller[_0x00f5('0x12')]);router[_0x00f5('0x13')](_0x00f5('0x10'),auth[_0x00f5('0xc')](),controller[_0x00f5('0x14')]);router[_0x00f5('0x13')](_0x00f5('0x15'),auth[_0x00f5('0xc')](),interaction[_0x00f5('0x16')](_0x00f5('0x17'),_0x00f5('0x18')),controller[_0x00f5('0x19')]);router[_0x00f5('0x1a')](_0x00f5('0xe'),auth[_0x00f5('0xc')](),interaction['tracked'](_0x00f5('0x17'),_0x00f5('0x1b')),controller['update']);router[_0x00f5('0x1c')](_0x00f5('0xe'),auth[_0x00f5('0xc')](),interaction[_0x00f5('0x16')](_0x00f5('0x17'),_0x00f5('0x1d')),controller[_0x00f5('0x1e')]);router[_0x00f5('0x1c')](_0x00f5('0x15'),auth[_0x00f5('0xc')](),controller['removeTags']);module[_0x00f5('0x1f')]=router; \ No newline at end of file +var _0xf06b=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','post','/:id/messages','addMessage','/:id/tags','fax','addTags','put','tracked','delete','faxinteraction:destroy','removeTags','exports','multer','util'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf06b,0x166));var _0xbf06=function(_0x18abfe,_0x57fd1a){_0x18abfe=_0x18abfe-0x0;var _0x40e0d9=_0xf06b[_0x18abfe];return _0x40e0d9;};'use strict';var multer=require(_0xbf06('0x0'));var util=require(_0xbf06('0x1'));var path=require(_0xbf06('0x2'));var timeout=require(_0xbf06('0x3'));var express=require(_0xbf06('0x4'));var router=express[_0xbf06('0x5')]();var fs_extra=require(_0xbf06('0x6'));var auth=require(_0xbf06('0x7'));var interaction=require(_0xbf06('0x8'));var config=require('../../config/environment');var controller=require(_0xbf06('0x9'));router[_0xbf06('0xa')]('/',auth[_0xbf06('0xb')](),controller[_0xbf06('0xc')]);router[_0xbf06('0xa')](_0xbf06('0xd'),auth[_0xbf06('0xb')](),controller[_0xbf06('0xe')]);router[_0xbf06('0xa')](_0xbf06('0xf'),auth['isAuthenticated'](),controller[_0xbf06('0x10')]);router['get']('/:id/messages',auth[_0xbf06('0xb')](),controller['getMessages']);router[_0xbf06('0xa')]('/:id/download',auth[_0xbf06('0xb')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0xbf06('0x11')]);router[_0xbf06('0x12')](_0xbf06('0x13'),auth[_0xbf06('0xb')](),controller[_0xbf06('0x14')]);router[_0xbf06('0x12')](_0xbf06('0x15'),auth[_0xbf06('0xb')](),interaction['tracked'](_0xbf06('0x16'),'faxinteraction:addtags'),controller[_0xbf06('0x17')]);router[_0xbf06('0x18')](_0xbf06('0xf'),auth[_0xbf06('0xb')](),interaction[_0xbf06('0x19')](_0xbf06('0x16'),'faxinteraction:update'),controller['update']);router[_0xbf06('0x1a')](_0xbf06('0xf'),auth[_0xbf06('0xb')](),interaction[_0xbf06('0x19')](_0xbf06('0x16'),_0xbf06('0x1b')),controller['destroy']);router['delete'](_0xbf06('0x15'),auth[_0xbf06('0xb')](),controller[_0xbf06('0x1c')]);module[_0xbf06('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index ecd1c9d..4843f09 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 _0xe107=['TEXT','medium','BOOLEAN','out','DATE','sequelize'];(function(_0x1c15a4,_0x32948a){var _0x1ae3be=function(_0x459c93){while(--_0x459c93){_0x1c15a4['push'](_0x1c15a4['shift']());}};_0x1ae3be(++_0x32948a);}(_0xe107,0xb3));var _0x7e10=function(_0x48b37a,_0x3e41d2){_0x48b37a=_0x48b37a-0x0;var _0x373c73=_0xe107[_0x48b37a];return _0x373c73;};'use strict';var Sequelize=require(_0x7e10('0x0'));module['exports']={'body':{'type':Sequelize[_0x7e10('0x1')](_0x7e10('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7e10('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x7e10('0x4')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize['TEXT'],'defaultValue':null},'readAt':{'type':Sequelize[_0x7e10('0x5')]}}; \ No newline at end of file +var _0x5645=['DATE','sequelize','exports','TEXT','medium','BOOLEAN','out'];(function(_0x3d46a8,_0x385df8){var _0x521cc8=function(_0x5ab2c4){while(--_0x5ab2c4){_0x3d46a8['push'](_0x3d46a8['shift']());}};_0x521cc8(++_0x385df8);}(_0x5645,0x19e));var _0x5564=function(_0x4ce735,_0x328084){_0x4ce735=_0x4ce735-0x0;var _0x6d7a1=_0x5645[_0x4ce735];return _0x6d7a1;};'use strict';var Sequelize=require(_0x5564('0x0'));module[_0x5564('0x1')]={'body':{'type':Sequelize[_0x5564('0x2')](_0x5564('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x5564('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x5564('0x5')),'defaultValue':_0x5564('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x5564('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x5564('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index f80c2a3..c22cc49 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 _0x4469=['intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','options','includeAll','rows','catch','show','params','rawAttributes','include','merge','find','update','body','describe','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteractionId','isNil','read1stAt','interaction','role','null','AcceptMessage','sequelize','QueryTypes','SELECT','contact','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','User','internal','rejectmessage','create','CmContact','findOne','ContactId','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','root','files','attachments','join','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','localhost','socket.io-emitter','redis','register','jayson/promise','client','http','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxMessage,\x20%s,\x20%s','result','status','end','json','offset','limit','undefined','count','set','apply','reject','save','sendStatus','stack','name','send','index','map','FaxMessage','fieldName','type','key','query','keys','model'];(function(_0x89f8ed,_0x235a5d){var _0x33cdae=function(_0x4eb382){while(--_0x4eb382){_0x89f8ed['push'](_0x89f8ed['shift']());}};_0x33cdae(++_0x235a5d);}(_0x4469,0x1f1));var _0x9446=function(_0x557286,_0x8c1f6f){_0x557286=_0x557286-0x0;var _0x5ec9c4=_0x4469[_0x557286];return _0x5ec9c4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9446('0x0'));var jsonpatch=require(_0x9446('0x1'));var rp=require(_0x9446('0x2'));var moment=require('moment');var BPromise=require(_0x9446('0x3'));var Mustache=require(_0x9446('0x4'));var util=require(_0x9446('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x9446('0x6'));var ejs=require(_0x9446('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9446('0x8'));var squel=require(_0x9446('0x9'));var crypto=require(_0x9446('0xa'));var jsforce=require(_0x9446('0xb'));var deskjs=require(_0x9446('0xc'));var toCsv=require(_0x9446('0x6'));var querystring=require(_0x9446('0xd'));var Papa=require(_0x9446('0xe'));var Redis=require('ioredis');var authService=require(_0x9446('0xf'));var qs=require(_0x9446('0x10'));var as=require(_0x9446('0x11'));var hardwareService=require(_0x9446('0x12'));var logger=require(_0x9446('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9446('0x14'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x9446('0x15'),'port':0x18eb});var socket=require(_0x9446('0x16'))(new Redis(config[_0x9446('0x17')]));require('./faxMessage.socket')[_0x9446('0x18')](socket);var jayson=require(_0x9446('0x19'));var client=jayson[_0x9446('0x1a')][_0x9446('0x1b')]({'port':0x232c});var client9002=jayson[_0x9446('0x1a')][_0x9446('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x4e5d36,_0x570d88,_0x38162f,_0x34ed07){return new BPromise(function(_0x135d7a,_0x2f4a29){var _0x474e93=_0x34ed07||client;return _0x474e93['request'](_0x4e5d36,_0x38162f)[_0x9446('0x1c')](function(_0x2ef100){logger[_0x9446('0x1d')]('FaxMessage,\x20%s,\x20%s',_0x570d88,_0x9446('0x1e'));logger[_0x9446('0x1f')](_0x9446('0x20'),_0x570d88,_0x9446('0x1e'),JSON[_0x9446('0x21')](_0x2ef100));if(_0x2ef100[_0x9446('0x22')]){if(_0x2ef100[_0x9446('0x22')][_0x9446('0x23')]===0x1f4){logger[_0x9446('0x22')]('FaxMessage,\x20%s,\x20%s',_0x570d88,_0x2ef100[_0x9446('0x22')]['message']);return _0x2f4a29(_0x2ef100['error'][_0x9446('0x24')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x570d88,_0x2ef100['error'][_0x9446('0x24')]);return _0x135d7a(_0x2ef100[_0x9446('0x22')][_0x9446('0x24')]);}else{logger[_0x9446('0x1d')](_0x9446('0x25'),_0x570d88,'request\x20sent');_0x135d7a(_0x2ef100[_0x9446('0x26')][_0x9446('0x24')]);}})['catch'](function(_0x3d69b7){logger[_0x9446('0x22')](_0x9446('0x25'),_0x570d88,_0x3d69b7);_0x2f4a29(_0x3d69b7);});});}function respondWithStatusCode(_0x602b3e,_0x237aba){_0x237aba=_0x237aba||0xcc;return function(_0x51cf73){if(_0x51cf73){return _0x602b3e['sendStatus'](_0x237aba);}return _0x602b3e[_0x9446('0x27')](_0x237aba)[_0x9446('0x28')]();};}function respondWithResult(_0x3519bc,_0x538096){_0x538096=_0x538096||0xc8;return function(_0x22ded0){if(_0x22ded0){return _0x3519bc[_0x9446('0x27')](_0x538096)[_0x9446('0x29')](_0x22ded0);}};}function respondWithFilteredResult(_0x51142c,_0x35ac96){return function(_0x355f45){if(_0x355f45){var _0x404c80=typeof _0x35ac96[_0x9446('0x2a')]==='undefined'&&typeof _0x35ac96[_0x9446('0x2b')]===_0x9446('0x2c');var _0x429dec=_0x355f45['count'];var _0x256728=_0x404c80?0x0:_0x35ac96[_0x9446('0x2a')];var _0x5ae619=_0x404c80?_0x355f45[_0x9446('0x2d')]:_0x35ac96[_0x9446('0x2a')]+_0x35ac96[_0x9446('0x2b')];var _0x1c9e7f;if(_0x5ae619>=_0x429dec){_0x5ae619=_0x429dec;_0x1c9e7f=0xc8;}else{_0x1c9e7f=0xce;}_0x51142c[_0x9446('0x27')](_0x1c9e7f);return _0x51142c[_0x9446('0x2e')]('Content-Range',_0x256728+'-'+_0x5ae619+'/'+_0x429dec)['json'](_0x355f45);}return null;};}function patchUpdates(_0x5bbdca){return function(_0x2d721b){try{jsonpatch[_0x9446('0x2f')](_0x2d721b,_0x5bbdca,!![]);}catch(_0x5e9dd5){return BPromise[_0x9446('0x30')](_0x5e9dd5);}return _0x2d721b[_0x9446('0x31')]();};}function saveUpdates(_0x3042ba,_0x4d8830){return function(_0x428509){if(_0x428509){return _0x428509['update'](_0x3042ba)[_0x9446('0x1c')](function(_0x278ebb){return _0x278ebb;});}return null;};}function removeEntity(_0x4f17cf,_0x5f278f){return function(_0x4c1dcb){if(_0x4c1dcb){return _0x4c1dcb['destroy']()[_0x9446('0x1c')](function(){_0x4f17cf[_0x9446('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c62c2,_0x11e648){return function(_0x1b4014){if(!_0x1b4014){_0x5c62c2[_0x9446('0x32')](0x194);}return _0x1b4014;};}function handleError(_0x50ab03,_0x51ac8b){_0x51ac8b=_0x51ac8b||0x1f4;return function(_0x311bbc){logger[_0x9446('0x22')](_0x311bbc[_0x9446('0x33')]);if(_0x311bbc[_0x9446('0x34')]){delete _0x311bbc[_0x9446('0x34')];}_0x50ab03[_0x9446('0x27')](_0x51ac8b)[_0x9446('0x35')](_0x311bbc);};}exports[_0x9446('0x36')]=function(_0x268d9b,_0x54bd49){var _0xe8a8eb={},_0x1dea04={},_0x16546b={'count':0x0,'rows':[]};var _0x420325=_[_0x9446('0x37')](db[_0x9446('0x38')]['rawAttributes'],function(_0x412404){return{'name':_0x412404[_0x9446('0x39')],'type':_0x412404[_0x9446('0x3a')][_0x9446('0x3b')]};});_0x1dea04['model']=_['map'](_0x420325,'name');_0x1dea04[_0x9446('0x3c')]=_[_0x9446('0x3d')](_0x268d9b[_0x9446('0x3c')]);_0x1dea04['filters']=_['intersection'](_0x1dea04[_0x9446('0x3e')],_0x1dea04[_0x9446('0x3c')]);_0xe8a8eb['attributes']=_[_0x9446('0x3f')](_0x1dea04[_0x9446('0x3e')],qs[_0x9446('0x40')](_0x268d9b[_0x9446('0x3c')][_0x9446('0x40')]));_0xe8a8eb[_0x9446('0x41')]=_0xe8a8eb[_0x9446('0x41')][_0x9446('0x42')]?_0xe8a8eb[_0x9446('0x41')]:_0x1dea04[_0x9446('0x3e')];if(!_0x268d9b[_0x9446('0x3c')][_0x9446('0x43')]('nolimit')){_0xe8a8eb[_0x9446('0x2b')]=qs[_0x9446('0x2b')](_0x268d9b[_0x9446('0x3c')][_0x9446('0x2b')]);_0xe8a8eb[_0x9446('0x2a')]=qs[_0x9446('0x2a')](_0x268d9b['query'][_0x9446('0x2a')]);}_0xe8a8eb[_0x9446('0x44')]=qs[_0x9446('0x45')](_0x268d9b['query'][_0x9446('0x45')]);_0xe8a8eb[_0x9446('0x46')]=qs[_0x9446('0x47')](_[_0x9446('0x48')](_0x268d9b[_0x9446('0x3c')],_0x1dea04[_0x9446('0x47')]),_0x420325);if(_0x268d9b[_0x9446('0x3c')][_0x9446('0x49')]){_0xe8a8eb[_0x9446('0x46')]=_['merge'](_0xe8a8eb['where'],{'$or':_[_0x9446('0x37')](_0x420325,function(_0x887035){if(_0x887035[_0x9446('0x3a')]!=='VIRTUAL'){var _0x28b34d={};_0x28b34d[_0x887035['name']]={'$like':'%'+_0x268d9b[_0x9446('0x3c')][_0x9446('0x49')]+'%'};return _0x28b34d;}})});}_0xe8a8eb=_['merge']({},_0xe8a8eb,_0x268d9b[_0x9446('0x4a')]);var _0x250c21={'where':_0xe8a8eb[_0x9446('0x46')]};return db[_0x9446('0x38')][_0x9446('0x2d')](_0x250c21)[_0x9446('0x1c')](function(_0x38dfa2){_0x16546b[_0x9446('0x2d')]=_0x38dfa2;if(_0x268d9b[_0x9446('0x3c')][_0x9446('0x4b')]){_0xe8a8eb['include']=[{'all':!![]}];}return db[_0x9446('0x38')]['findAll'](_0xe8a8eb);})['then'](function(_0x399b00){_0x16546b[_0x9446('0x4c')]=_0x399b00;return _0x16546b;})['then'](respondWithFilteredResult(_0x54bd49,_0xe8a8eb))[_0x9446('0x4d')](handleError(_0x54bd49,null));};exports[_0x9446('0x4e')]=function(_0x1d3f9f,_0x8939e6){var _0x1d3889={'raw':!![],'where':{'id':_0x1d3f9f[_0x9446('0x4f')]['id']}},_0x47c133={};_0x47c133[_0x9446('0x3e')]=_[_0x9446('0x3d')](db['FaxMessage'][_0x9446('0x50')]);_0x47c133[_0x9446('0x3c')]=_[_0x9446('0x3d')](_0x1d3f9f[_0x9446('0x3c')]);_0x47c133[_0x9446('0x47')]=_[_0x9446('0x3f')](_0x47c133[_0x9446('0x3e')],_0x47c133[_0x9446('0x3c')]);_0x1d3889[_0x9446('0x41')]=_[_0x9446('0x3f')](_0x47c133[_0x9446('0x3e')],qs[_0x9446('0x40')](_0x1d3f9f[_0x9446('0x3c')]['fields']));_0x1d3889[_0x9446('0x41')]=_0x1d3889[_0x9446('0x41')][_0x9446('0x42')]?_0x1d3889[_0x9446('0x41')]:_0x47c133[_0x9446('0x3e')];if(_0x1d3f9f[_0x9446('0x3c')][_0x9446('0x4b')]){_0x1d3889[_0x9446('0x51')]=[{'all':!![]}];}_0x1d3889=_[_0x9446('0x52')]({},_0x1d3889,_0x1d3f9f[_0x9446('0x4a')]);return db[_0x9446('0x38')][_0x9446('0x53')](_0x1d3889)[_0x9446('0x1c')](handleEntityNotFound(_0x8939e6,null))[_0x9446('0x1c')](respondWithResult(_0x8939e6,null))[_0x9446('0x4d')](handleError(_0x8939e6,null));};exports[_0x9446('0x54')]=function(_0x53e9d2,_0x2058d8){if(_0x53e9d2[_0x9446('0x55')]['id']){delete _0x53e9d2[_0x9446('0x55')]['id'];}return db[_0x9446('0x38')]['find']({'where':{'id':_0x53e9d2[_0x9446('0x4f')]['id']}})[_0x9446('0x1c')](handleEntityNotFound(_0x2058d8,null))[_0x9446('0x1c')](saveUpdates(_0x53e9d2[_0x9446('0x55')],null))[_0x9446('0x1c')](respondWithResult(_0x2058d8,null))[_0x9446('0x4d')](handleError(_0x2058d8,null));};exports['destroy']=function(_0x152e6e,_0x2b14c8){return db[_0x9446('0x38')][_0x9446('0x53')]({'where':{'id':_0x152e6e['params']['id']}})[_0x9446('0x1c')](handleEntityNotFound(_0x2b14c8,null))[_0x9446('0x1c')](removeEntity(_0x2b14c8,null))[_0x9446('0x4d')](handleError(_0x2b14c8,null));};exports[_0x9446('0x56')]=function(_0x16528c,_0x2b04b4){return db['FaxMessage']['describe']()[_0x9446('0x1c')](respondWithResult(_0x2b04b4,null))[_0x9446('0x4d')](handleError(_0x2b04b4,null));};var interaction_log=require(_0x9446('0x13'))('fax-interactions');exports[_0x9446('0x57')]=function(_0x43f543,_0x597d93,_0x3aae50){var _0x1519ed={'agent':{},'channel':_0x9446('0x58')};if(_0x43f543['body']['id']){delete _0x43f543[_0x9446('0x55')]['id'];}_0x43f543[_0x9446('0x55')][_0x9446('0x59')]=!![];_0x43f543[_0x9446('0x55')][_0x9446('0x5a')]=moment()[_0x9446('0x5b')](_0x9446('0x5c'));_0x43f543['body'][_0x9446('0x5d')]=_0x43f543[_0x9446('0x55')][_0x9446('0x5d')]||_0x43f543[_0x9446('0x5e')]['id'];_0x1519ed[_0x9446('0x5f')]['id']=_0x43f543[_0x9446('0x55')][_0x9446('0x5d')];return db['FaxMessage'][_0x9446('0x53')]({'where':{'id':_0x43f543[_0x9446('0x4f')]['id'],'UserId':null}})[_0x9446('0x1c')](handleEntityNotFound(_0x597d93,null))[_0x9446('0x1c')](saveUpdates(_0x43f543[_0x9446('0x55')],null))[_0x9446('0x1c')](function(_0xe5da15){if(_0xe5da15){_0x1519ed[_0x9446('0x24')]=_0xe5da15[_0x9446('0x60')]({'plain':!![]});return db['FaxInteraction']['find']({'where':{'id':_0xe5da15[_0x9446('0x61')]}});}return null;})[_0x9446('0x1c')](handleEntityNotFound(_0x597d93,null))[_0x9446('0x1c')](function(_0x8c37de){if(_0x8c37de){return _0x8c37de[_0x9446('0x54')]({'UserId':_0x43f543['body'][_0x9446('0x5d')],'read1stAt':_[_0x9446('0x62')](_0x8c37de[_0x9446('0x63')])?moment()[_0x9446('0x5b')](_0x9446('0x5c')):undefined});}return null;})[_0x9446('0x1c')](function(_0x31065c){if(_0x31065c){_0x1519ed[_0x9446('0x64')]=_0x31065c[_0x9446('0x60')]({'plain':!![]});interaction_log[_0x9446('0x1d')]('[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x43f543[_0x9446('0x5e')]['id'],_0x43f543[_0x9446('0x5e')][_0x9446('0x34')],_0x43f543[_0x9446('0x5e')][_0x9446('0x65')],_0x1519ed['interaction']['id'],_0x43f543[_0x9446('0x55')]?JSON['stringify'](_0x43f543[_0x9446('0x55')]):_0x9446('0x66'));return respondWithRpcPromise(_0x9446('0x67'),'acceptMessage',_0x1519ed);}return null;})['then'](function(_0x5b8099){var _0x439b87='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5b8099[_0x9446('0x24')]['ContactId'];return db[_0x9446('0x68')]['query'](_0x439b87,{'type':db['Sequelize'][_0x9446('0x69')][_0x9446('0x6a')],'raw':!![]})['then'](function(_0x54dd41){return _0x54dd41;});})[_0x9446('0x1c')](function(_0x45d5f9){if(_0x45d5f9){_0x1519ed[_0x9446('0x24')][_0x9446('0x6b')]=_0x45d5f9[0x0];if(!_0x43f543['body'][_0x9446('0x5d')])return;return db['User'][_0x9446('0x53')]({'where':{'id':_0x43f543[_0x9446('0x55')][_0x9446('0x5d')],'role':_0x9446('0x5f')},'attributes':['id','name',_0x9446('0x6c'),_0x9446('0x6d'),'internal'],'raw':!![]});}return null;})[_0x9446('0x1c')](function(_0x59b1e9){if(!_0x59b1e9)return null;_0x1519ed['message'][_0x9446('0x5f')]=_0x59b1e9;return _0x1519ed;})['then'](function(_0x1236ce){if(_0x1236ce){if(_0x43f543[_0x9446('0x55')][_0x9446('0x6e')]){_0x1519ed[_0x9446('0x24')][_0x9446('0x6f')]=util[_0x9446('0x5b')](_0x9446('0x70'),_0x43f543[_0x9446('0x5e')][_0x9446('0x34')]);_0x1519ed['message'][_0x9446('0x71')]=_0x1519ed['channel'];_0x1519ed[_0x9446('0x24')][_0x9446('0x72')]=_0x1519ed[_0x9446('0x71')];_0x1519ed['message'][_0x9446('0x73')]=_0x9446('0x57');return respondWithRpcPromise('EventManager',_0x9446('0x74'),{'event':'acceptmessage','message':_0x1519ed['message']},client9002)[_0x9446('0x1c')](function(){return _0x1519ed;});}return _0x1519ed;}return null;})['then'](respondWithResult(_0x597d93,null))[_0x9446('0x4d')](handleError(_0x597d93,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x9446('0x30')]=function(_0x36994b,_0x3af6a3,_0x47d8ea){var _0x29a8bf={'agent':{},'channel':_0x9446('0x58')};if(_0x36994b[_0x9446('0x55')]['id']){delete _0x36994b[_0x9446('0x55')]['id'];}_0x36994b[_0x9446('0x55')][_0x9446('0x5d')]=_0x36994b[_0x9446('0x55')][_0x9446('0x5d')]||_0x36994b['user']['id'];_0x29a8bf['agent']['id']=_0x36994b[_0x9446('0x55')][_0x9446('0x5d')];return db['FaxMessage']['find']({'where':{'id':_0x36994b['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3af6a3,null))['then'](function(_0x3c1221){if(_0x3c1221){_0x29a8bf[_0x9446('0x24')]=_0x3c1221[_0x9446('0x60')]({'plain':!![]});return db[_0x9446('0x75')][_0x9446('0x53')]({'where':{'id':_0x3c1221['FaxInteractionId']}});}return null;})[_0x9446('0x1c')](handleEntityNotFound(_0x3af6a3,null))[_0x9446('0x1c')](function(_0x21c726){if(_0x21c726){_0x29a8bf[_0x9446('0x64')]=_0x21c726[_0x9446('0x60')]({'plain':!![]});interaction_log['info'](_0x9446('0x76'),_0x36994b['user']['id'],_0x36994b[_0x9446('0x5e')][_0x9446('0x34')],_0x36994b['user'][_0x9446('0x65')],_0x29a8bf[_0x9446('0x64')]['id'],_0x36994b[_0x9446('0x55')]?JSON['stringify'](_0x36994b[_0x9446('0x55')]):_0x9446('0x66'));return respondWithRpcPromise(_0x9446('0x77'),'rejectMessage',_0x29a8bf);}return null;})[_0x9446('0x1c')](function(_0x30a15c){var _0x54b916=_0x9446('0x78')+_0x30a15c[_0x9446('0x24')]['ContactId'];return db[_0x9446('0x68')][_0x9446('0x3c')](_0x54b916,{'type':db[_0x9446('0x79')][_0x9446('0x69')][_0x9446('0x6a')],'raw':!![]})[_0x9446('0x1c')](function(_0x290dfd){return _0x290dfd;});})[_0x9446('0x1c')](function(_0xbf849e){if(_0xbf849e){_0x29a8bf[_0x9446('0x24')][_0x9446('0x6b')]=_0xbf849e[0x0];if(!_0x36994b[_0x9446('0x55')][_0x9446('0x5d')])return;return db[_0x9446('0x7a')]['find']({'where':{'id':_0x36994b[_0x9446('0x55')][_0x9446('0x5d')],'role':_0x9446('0x5f')},'attributes':['id',_0x9446('0x34'),_0x9446('0x6c'),'email',_0x9446('0x7b')],'raw':!![]});}return null;})[_0x9446('0x1c')](function(_0x2bfd1d){if(!_0x2bfd1d)return null;_0x29a8bf['message'][_0x9446('0x5f')]=_0x2bfd1d;return _0x29a8bf;})[_0x9446('0x1c')](function(_0x1b0f0d){if(_0x1b0f0d){_0x1b0f0d[_0x9446('0x24')][_0x9446('0x6f')]=util[_0x9446('0x5b')]('SIP/%s',_0x36994b[_0x9446('0x5e')]['name']);_0x1b0f0d[_0x9446('0x24')][_0x9446('0x71')]=_0x29a8bf['channel'];_0x1b0f0d[_0x9446('0x24')][_0x9446('0x72')]=_0x29a8bf[_0x9446('0x71')];_0x1b0f0d[_0x9446('0x24')]['event']=_0x9446('0x30');respondWithRpcPromise(_0x9446('0x74'),'EventManager',{'event':_0x9446('0x7c'),'message':_0x1b0f0d['message']},client9002);return _0x29a8bf;}return null;})['then'](respondWithResult(_0x3af6a3,null))[_0x9446('0x4d')](handleError(_0x3af6a3,null));};exports['create']=function(_0x474506,_0x36e15a){var _0x520a46;return db['FaxMessage'][_0x9446('0x7d')](_0x474506[_0x9446('0x55')],{})[_0x9446('0x1c')](function(_0x16a8e3){_0x520a46=_0x16a8e3;return db[_0x9446('0x7e')][_0x9446('0x7f')]({'where':{'id':_0x520a46[_0x9446('0x80')]}});})[_0x9446('0x1c')](function(_0x341268){if(_[_0x9446('0x62')](_0x341268)){return;}else{_0x520a46[_0x9446('0x58')]=_0x341268[_0x9446('0x58')];return db[_0x9446('0x81')][_0x9446('0x7f')]({'where':{'id':_0x520a46[_0x9446('0x82')]}});}})['then'](function(_0x1c579e){return respondWithRpcPromise('SendFax',_0x9446('0x83'),{'FaxAccountId':_[_0x9446('0x62')](_0x474506['body'])?undefined:_0x474506['body'][_0x9446('0x84')],'path':_['isNil'](_0x1c579e)?undefined:util[_0x9446('0x5b')](_0x9446('0x85'),_0x1c579e[_0x9446('0x86')]),'fax':_[_0x9446('0x62')](_0x520a46[_0x9446('0x58')])?undefined:_0x520a46[_0x9446('0x58')],'AttachmentId':_0x520a46[_0x9446('0x82')]},client9002);})[_0x9446('0x1c')](respondWithResult(_0x36e15a,0xc9))[_0x9446('0x4d')](handleError(_0x36e15a,null));};exports[_0x9446('0x87')]=function(_0x3cb913,_0x1f98fb){var _0x2992b9=path['join'](config[_0x9446('0x88')],'server',_0x9446('0x89'),_0x9446('0x8a'));return db['FaxMessage'][_0x9446('0x53')]({'where':{'id':_0x3cb913[_0x9446('0x4f')]['id']},'include':[{'model':db[_0x9446('0x81')],'as':_0x9446('0x81')}]})[_0x9446('0x1c')](handleEntityNotFound(_0x1f98fb,null))[_0x9446('0x1c')](function(_0x372cf4){if(_0x372cf4){return _0x1f98fb[_0x9446('0x87')](path[_0x9446('0x8b')](_0x2992b9,_0x372cf4[_0x9446('0x81')][_0x9446('0x86')]));}})['catch'](handleError(_0x1f98fb,null));}; \ No newline at end of file +var _0x37e6=['./faxMessage.socket','register','client','http','then','info','debug','request\x20sent','stringify','error','FaxMessage,\x20%s,\x20%s','message','catch','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','sendStatus','stack','name','send','index','map','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','merge','filter','options','FaxMessage','include','findAll','rows','show','includeAll','body','find','params','describe','accept','fax','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteractionId','isNil','read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','contact','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','fax-interactions','FaxInteraction','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','User','fullname','event','create','CmContact','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis'];(function(_0x133277,_0xb1d6b2){var _0x5b4a22=function(_0x484c26){while(--_0x484c26){_0x133277['push'](_0x133277['shift']());}};_0x5b4a22(++_0xb1d6b2);}(_0x37e6,0x75));var _0x637e=function(_0x2d5833,_0x1a5c3b){_0x2d5833=_0x2d5833-0x0;var _0x33bed7=_0x37e6[_0x2d5833];return _0x33bed7;};'use strict';var emlformat=require(_0x637e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x637e('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x637e('0x2'));var Mustache=require(_0x637e('0x3'));var util=require(_0x637e('0x4'));var path=require(_0x637e('0x5'));var sox=require(_0x637e('0x6'));var csv=require('to-csv');var ejs=require(_0x637e('0x7'));var fs=require('fs');var fs_extra=require(_0x637e('0x8'));var _=require(_0x637e('0x9'));var squel=require(_0x637e('0xa'));var crypto=require(_0x637e('0xb'));var jsforce=require(_0x637e('0xc'));var deskjs=require(_0x637e('0xd'));var toCsv=require(_0x637e('0xe'));var querystring=require(_0x637e('0xf'));var Papa=require(_0x637e('0x10'));var Redis=require(_0x637e('0x11'));var authService=require(_0x637e('0x12'));var qs=require(_0x637e('0x13'));var as=require(_0x637e('0x14'));var hardwareService=require(_0x637e('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x637e('0x16'));var licenseUtil=require(_0x637e('0x17'));var db=require(_0x637e('0x18'))['db'];config['redis']=_[_0x637e('0x19')](config['redis'],{'host':_0x637e('0x1a'),'port':0x18eb});var socket=require(_0x637e('0x1b'))(new Redis(config[_0x637e('0x1c')]));require(_0x637e('0x1d'))[_0x637e('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x637e('0x1f')]['http']({'port':0x232c});var client9002=jayson[_0x637e('0x1f')][_0x637e('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x115028,_0x11d4e5,_0x1b8fa1,_0x36cc49){return new BPromise(function(_0x4dc9c4,_0x32e975){var _0x2ebdff=_0x36cc49||client;return _0x2ebdff['request'](_0x115028,_0x1b8fa1)[_0x637e('0x21')](function(_0x318ef9){logger[_0x637e('0x22')]('FaxMessage,\x20%s,\x20%s',_0x11d4e5,'request\x20sent');logger[_0x637e('0x23')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x11d4e5,_0x637e('0x24'),JSON[_0x637e('0x25')](_0x318ef9));if(_0x318ef9[_0x637e('0x26')]){if(_0x318ef9[_0x637e('0x26')]['code']===0x1f4){logger['error'](_0x637e('0x27'),_0x11d4e5,_0x318ef9[_0x637e('0x26')][_0x637e('0x28')]);return _0x32e975(_0x318ef9[_0x637e('0x26')][_0x637e('0x28')]);}logger['error']('FaxMessage,\x20%s,\x20%s',_0x11d4e5,_0x318ef9['error'][_0x637e('0x28')]);return _0x4dc9c4(_0x318ef9[_0x637e('0x26')][_0x637e('0x28')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x11d4e5,_0x637e('0x24'));_0x4dc9c4(_0x318ef9['result']['message']);}})[_0x637e('0x29')](function(_0x1f85ec){logger[_0x637e('0x26')](_0x637e('0x27'),_0x11d4e5,_0x1f85ec);_0x32e975(_0x1f85ec);});});}function respondWithStatusCode(_0x19a978,_0x136074){_0x136074=_0x136074||0xcc;return function(_0x50cb9f){if(_0x50cb9f){return _0x19a978['sendStatus'](_0x136074);}return _0x19a978['status'](_0x136074)[_0x637e('0x2a')]();};}function respondWithResult(_0x45523d,_0x596d2d){_0x596d2d=_0x596d2d||0xc8;return function(_0x3fc083){if(_0x3fc083){return _0x45523d[_0x637e('0x2b')](_0x596d2d)[_0x637e('0x2c')](_0x3fc083);}};}function respondWithFilteredResult(_0x29e58e,_0xc60818){return function(_0x58126a){if(_0x58126a){var _0x2c2efd=typeof _0xc60818[_0x637e('0x2d')]===_0x637e('0x2e')&&typeof _0xc60818[_0x637e('0x2f')]===_0x637e('0x2e');var _0x14a664=_0x58126a[_0x637e('0x30')];var _0x2f15f8=_0x2c2efd?0x0:_0xc60818[_0x637e('0x2d')];var _0x431e7e=_0x2c2efd?_0x58126a[_0x637e('0x30')]:_0xc60818[_0x637e('0x2d')]+_0xc60818[_0x637e('0x2f')];var _0x1cb0c8;if(_0x431e7e>=_0x14a664){_0x431e7e=_0x14a664;_0x1cb0c8=0xc8;}else{_0x1cb0c8=0xce;}_0x29e58e['status'](_0x1cb0c8);return _0x29e58e[_0x637e('0x31')](_0x637e('0x32'),_0x2f15f8+'-'+_0x431e7e+'/'+_0x14a664)[_0x637e('0x2c')](_0x58126a);}return null;};}function patchUpdates(_0x2afd07){return function(_0x316a6c){try{jsonpatch[_0x637e('0x33')](_0x316a6c,_0x2afd07,!![]);}catch(_0x4b4f89){return BPromise[_0x637e('0x34')](_0x4b4f89);}return _0x316a6c[_0x637e('0x35')]();};}function saveUpdates(_0x3d429d,_0x1eff8d){return function(_0x2e87b3){if(_0x2e87b3){return _0x2e87b3['update'](_0x3d429d)['then'](function(_0x2c9017){return _0x2c9017;});}return null;};}function removeEntity(_0x294554,_0x351d6e){return function(_0x3b9c8f){if(_0x3b9c8f){return _0x3b9c8f[_0x637e('0x36')]()[_0x637e('0x21')](function(){_0x294554[_0x637e('0x2b')](0xcc)[_0x637e('0x2a')]();});}};}function handleEntityNotFound(_0x1c3728,_0x2cdc2c){return function(_0x34d2f4){if(!_0x34d2f4){_0x1c3728[_0x637e('0x37')](0x194);}return _0x34d2f4;};}function handleError(_0x1973c6,_0x9907c3){_0x9907c3=_0x9907c3||0x1f4;return function(_0x46c974){logger['error'](_0x46c974[_0x637e('0x38')]);if(_0x46c974[_0x637e('0x39')]){delete _0x46c974[_0x637e('0x39')];}_0x1973c6['status'](_0x9907c3)[_0x637e('0x3a')](_0x46c974);};}exports[_0x637e('0x3b')]=function(_0x2fa0b8,_0x3250c1){var _0x4c3fb1={},_0x46854f={},_0x46a521={'count':0x0,'rows':[]};var _0x114443=_[_0x637e('0x3c')](db['FaxMessage']['rawAttributes'],function(_0x2edb74){return{'name':_0x2edb74[_0x637e('0x3d')],'type':_0x2edb74[_0x637e('0x3e')]['key']};});_0x46854f['model']=_[_0x637e('0x3c')](_0x114443,'name');_0x46854f[_0x637e('0x3f')]=_[_0x637e('0x40')](_0x2fa0b8[_0x637e('0x3f')]);_0x46854f[_0x637e('0x41')]=_[_0x637e('0x42')](_0x46854f['model'],_0x46854f[_0x637e('0x3f')]);_0x4c3fb1[_0x637e('0x43')]=_[_0x637e('0x42')](_0x46854f[_0x637e('0x44')],qs[_0x637e('0x45')](_0x2fa0b8[_0x637e('0x3f')][_0x637e('0x45')]));_0x4c3fb1[_0x637e('0x43')]=_0x4c3fb1[_0x637e('0x43')][_0x637e('0x46')]?_0x4c3fb1[_0x637e('0x43')]:_0x46854f[_0x637e('0x44')];if(!_0x2fa0b8['query']['hasOwnProperty'](_0x637e('0x47'))){_0x4c3fb1[_0x637e('0x2f')]=qs['limit'](_0x2fa0b8[_0x637e('0x3f')]['limit']);_0x4c3fb1['offset']=qs['offset'](_0x2fa0b8[_0x637e('0x3f')][_0x637e('0x2d')]);}_0x4c3fb1[_0x637e('0x48')]=qs[_0x637e('0x49')](_0x2fa0b8[_0x637e('0x3f')][_0x637e('0x49')]);_0x4c3fb1[_0x637e('0x4a')]=qs[_0x637e('0x41')](_[_0x637e('0x4b')](_0x2fa0b8[_0x637e('0x3f')],_0x46854f[_0x637e('0x41')]),_0x114443);if(_0x2fa0b8[_0x637e('0x3f')]['filter']){_0x4c3fb1['where']=_[_0x637e('0x4c')](_0x4c3fb1[_0x637e('0x4a')],{'$or':_['map'](_0x114443,function(_0x5221b3){if(_0x5221b3[_0x637e('0x3e')]!=='VIRTUAL'){var _0x15b62c={};_0x15b62c[_0x5221b3[_0x637e('0x39')]]={'$like':'%'+_0x2fa0b8[_0x637e('0x3f')][_0x637e('0x4d')]+'%'};return _0x15b62c;}})});}_0x4c3fb1=_[_0x637e('0x4c')]({},_0x4c3fb1,_0x2fa0b8[_0x637e('0x4e')]);var _0x2984b6={'where':_0x4c3fb1[_0x637e('0x4a')]};return db[_0x637e('0x4f')][_0x637e('0x30')](_0x2984b6)['then'](function(_0x1d9555){_0x46a521['count']=_0x1d9555;if(_0x2fa0b8[_0x637e('0x3f')]['includeAll']){_0x4c3fb1[_0x637e('0x50')]=[{'all':!![]}];}return db['FaxMessage'][_0x637e('0x51')](_0x4c3fb1);})[_0x637e('0x21')](function(_0x37ed2c){_0x46a521[_0x637e('0x52')]=_0x37ed2c;return _0x46a521;})['then'](respondWithFilteredResult(_0x3250c1,_0x4c3fb1))[_0x637e('0x29')](handleError(_0x3250c1,null));};exports[_0x637e('0x53')]=function(_0x47efb5,_0x408adb){var _0x39498f={'raw':!![],'where':{'id':_0x47efb5['params']['id']}},_0x57394d={};_0x57394d[_0x637e('0x44')]=_[_0x637e('0x40')](db[_0x637e('0x4f')]['rawAttributes']);_0x57394d[_0x637e('0x3f')]=_[_0x637e('0x40')](_0x47efb5[_0x637e('0x3f')]);_0x57394d[_0x637e('0x41')]=_['intersection'](_0x57394d[_0x637e('0x44')],_0x57394d[_0x637e('0x3f')]);_0x39498f[_0x637e('0x43')]=_[_0x637e('0x42')](_0x57394d[_0x637e('0x44')],qs[_0x637e('0x45')](_0x47efb5[_0x637e('0x3f')][_0x637e('0x45')]));_0x39498f[_0x637e('0x43')]=_0x39498f[_0x637e('0x43')][_0x637e('0x46')]?_0x39498f[_0x637e('0x43')]:_0x57394d[_0x637e('0x44')];if(_0x47efb5[_0x637e('0x3f')][_0x637e('0x54')]){_0x39498f[_0x637e('0x50')]=[{'all':!![]}];}_0x39498f=_[_0x637e('0x4c')]({},_0x39498f,_0x47efb5[_0x637e('0x4e')]);return db[_0x637e('0x4f')]['find'](_0x39498f)[_0x637e('0x21')](handleEntityNotFound(_0x408adb,null))[_0x637e('0x21')](respondWithResult(_0x408adb,null))[_0x637e('0x29')](handleError(_0x408adb,null));};exports['update']=function(_0x5b0576,_0x50a6e9){if(_0x5b0576[_0x637e('0x55')]['id']){delete _0x5b0576[_0x637e('0x55')]['id'];}return db[_0x637e('0x4f')][_0x637e('0x56')]({'where':{'id':_0x5b0576[_0x637e('0x57')]['id']}})['then'](handleEntityNotFound(_0x50a6e9,null))[_0x637e('0x21')](saveUpdates(_0x5b0576[_0x637e('0x55')],null))[_0x637e('0x21')](respondWithResult(_0x50a6e9,null))[_0x637e('0x29')](handleError(_0x50a6e9,null));};exports['destroy']=function(_0x297ec1,_0x3a6fdf){return db[_0x637e('0x4f')][_0x637e('0x56')]({'where':{'id':_0x297ec1[_0x637e('0x57')]['id']}})['then'](handleEntityNotFound(_0x3a6fdf,null))[_0x637e('0x21')](removeEntity(_0x3a6fdf,null))['catch'](handleError(_0x3a6fdf,null));};exports[_0x637e('0x58')]=function(_0x48726b,_0x5bc7a9){return db[_0x637e('0x4f')]['describe']()[_0x637e('0x21')](respondWithResult(_0x5bc7a9,null))[_0x637e('0x29')](handleError(_0x5bc7a9,null));};var interaction_log=require('../../config/logger')('fax-interactions');exports[_0x637e('0x59')]=function(_0x585c16,_0x5da093,_0x1ba775){var _0x1a2b5d={'agent':{},'channel':_0x637e('0x5a')};if(_0x585c16[_0x637e('0x55')]['id']){delete _0x585c16['body']['id'];}_0x585c16[_0x637e('0x55')][_0x637e('0x5b')]=!![];_0x585c16[_0x637e('0x55')][_0x637e('0x5c')]=moment()[_0x637e('0x5d')](_0x637e('0x5e'));_0x585c16[_0x637e('0x55')][_0x637e('0x5f')]=_0x585c16[_0x637e('0x55')][_0x637e('0x5f')]||_0x585c16[_0x637e('0x60')]['id'];_0x1a2b5d[_0x637e('0x61')]['id']=_0x585c16[_0x637e('0x55')][_0x637e('0x5f')];return db[_0x637e('0x4f')][_0x637e('0x56')]({'where':{'id':_0x585c16[_0x637e('0x57')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5da093,null))[_0x637e('0x21')](saveUpdates(_0x585c16[_0x637e('0x55')],null))[_0x637e('0x21')](function(_0xf5fe1){if(_0xf5fe1){_0x1a2b5d[_0x637e('0x28')]=_0xf5fe1[_0x637e('0x62')]({'plain':!![]});return db['FaxInteraction'][_0x637e('0x56')]({'where':{'id':_0xf5fe1[_0x637e('0x63')]}});}return null;})[_0x637e('0x21')](handleEntityNotFound(_0x5da093,null))['then'](function(_0x16e629){if(_0x16e629){return _0x16e629['update']({'UserId':_0x585c16[_0x637e('0x55')][_0x637e('0x5f')],'read1stAt':_[_0x637e('0x64')](_0x16e629[_0x637e('0x65')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x637e('0x21')](function(_0x4847e6){if(_0x4847e6){_0x1a2b5d[_0x637e('0x66')]=_0x4847e6[_0x637e('0x62')]({'plain':!![]});interaction_log[_0x637e('0x22')](_0x637e('0x67'),_0x585c16[_0x637e('0x60')]['id'],_0x585c16['user'][_0x637e('0x39')],_0x585c16[_0x637e('0x60')][_0x637e('0x68')],_0x1a2b5d[_0x637e('0x66')]['id'],_0x585c16[_0x637e('0x55')]?JSON['stringify'](_0x585c16[_0x637e('0x55')]):_0x637e('0x69'));return respondWithRpcPromise(_0x637e('0x6a'),_0x637e('0x6b'),_0x1a2b5d);}return null;})[_0x637e('0x21')](function(_0x133147){var _0x537cb3='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x133147[_0x637e('0x28')][_0x637e('0x6c')];return db[_0x637e('0x6d')][_0x637e('0x3f')](_0x537cb3,{'type':db['Sequelize'][_0x637e('0x6e')][_0x637e('0x6f')],'raw':!![]})[_0x637e('0x21')](function(_0x15e22f){return _0x15e22f;});})[_0x637e('0x21')](function(_0x38ba72){if(_0x38ba72){_0x1a2b5d['message'][_0x637e('0x70')]=_0x38ba72[0x0];if(!_0x585c16[_0x637e('0x55')][_0x637e('0x5f')])return;return db['User'][_0x637e('0x56')]({'where':{'id':_0x585c16[_0x637e('0x55')]['UserId'],'role':_0x637e('0x61')},'attributes':['id',_0x637e('0x39'),'fullname',_0x637e('0x71'),_0x637e('0x72')],'raw':!![]});}return null;})[_0x637e('0x21')](function(_0x10180d){if(!_0x10180d)return null;_0x1a2b5d[_0x637e('0x28')][_0x637e('0x61')]=_0x10180d;return _0x1a2b5d;})[_0x637e('0x21')](function(_0x578c7b){if(_0x578c7b){if(_0x585c16['body'][_0x637e('0x73')]){_0x1a2b5d['message'][_0x637e('0x74')]=util[_0x637e('0x5d')](_0x637e('0x75'),_0x585c16[_0x637e('0x60')]['name']);_0x1a2b5d[_0x637e('0x28')]['channel']=_0x1a2b5d[_0x637e('0x76')];_0x1a2b5d[_0x637e('0x28')][_0x637e('0x77')]=_0x1a2b5d[_0x637e('0x76')];_0x1a2b5d[_0x637e('0x28')]['event']=_0x637e('0x59');return respondWithRpcPromise(_0x637e('0x78'),_0x637e('0x78'),{'event':_0x637e('0x79'),'message':_0x1a2b5d[_0x637e('0x28')]},client9002)[_0x637e('0x21')](function(){return _0x1a2b5d;});}return _0x1a2b5d;}return null;})['then'](respondWithResult(_0x5da093,null))['catch'](handleError(_0x5da093,null));};var interaction_log=require('../../config/logger')(_0x637e('0x7a'));exports[_0x637e('0x34')]=function(_0x1a1664,_0x5488ec,_0x3f3cb4){var _0x89aea4={'agent':{},'channel':'fax'};if(_0x1a1664[_0x637e('0x55')]['id']){delete _0x1a1664[_0x637e('0x55')]['id'];}_0x1a1664[_0x637e('0x55')][_0x637e('0x5f')]=_0x1a1664[_0x637e('0x55')][_0x637e('0x5f')]||_0x1a1664[_0x637e('0x60')]['id'];_0x89aea4['agent']['id']=_0x1a1664[_0x637e('0x55')][_0x637e('0x5f')];return db[_0x637e('0x4f')]['find']({'where':{'id':_0x1a1664[_0x637e('0x57')]['id'],'UserId':null}})[_0x637e('0x21')](handleEntityNotFound(_0x5488ec,null))['then'](function(_0x22623d){if(_0x22623d){_0x89aea4['message']=_0x22623d[_0x637e('0x62')]({'plain':!![]});return db[_0x637e('0x7b')][_0x637e('0x56')]({'where':{'id':_0x22623d[_0x637e('0x63')]}});}return null;})[_0x637e('0x21')](handleEntityNotFound(_0x5488ec,null))[_0x637e('0x21')](function(_0x4c8f17){if(_0x4c8f17){_0x89aea4[_0x637e('0x66')]=_0x4c8f17[_0x637e('0x62')]({'plain':!![]});interaction_log['info'](_0x637e('0x7c'),_0x1a1664[_0x637e('0x60')]['id'],_0x1a1664[_0x637e('0x60')][_0x637e('0x39')],_0x1a1664[_0x637e('0x60')]['role'],_0x89aea4[_0x637e('0x66')]['id'],_0x1a1664['body']?JSON['stringify'](_0x1a1664['body']):_0x637e('0x69'));return respondWithRpcPromise(_0x637e('0x7d'),'rejectMessage',_0x89aea4);}return null;})['then'](function(_0xdf9781){var _0x3277d4=_0x637e('0x7e')+_0xdf9781['message'][_0x637e('0x6c')];return db[_0x637e('0x6d')][_0x637e('0x3f')](_0x3277d4,{'type':db[_0x637e('0x7f')]['QueryTypes'][_0x637e('0x6f')],'raw':!![]})['then'](function(_0x57db68){return _0x57db68;});})[_0x637e('0x21')](function(_0x13b515){if(_0x13b515){_0x89aea4[_0x637e('0x28')][_0x637e('0x70')]=_0x13b515[0x0];if(!_0x1a1664[_0x637e('0x55')][_0x637e('0x5f')])return;return db[_0x637e('0x80')][_0x637e('0x56')]({'where':{'id':_0x1a1664[_0x637e('0x55')][_0x637e('0x5f')],'role':'agent'},'attributes':['id','name',_0x637e('0x81'),_0x637e('0x71'),_0x637e('0x72')],'raw':!![]});}return null;})[_0x637e('0x21')](function(_0x580e10){if(!_0x580e10)return null;_0x89aea4[_0x637e('0x28')][_0x637e('0x61')]=_0x580e10;return _0x89aea4;})[_0x637e('0x21')](function(_0x5a947a){if(_0x5a947a){_0x5a947a[_0x637e('0x28')][_0x637e('0x74')]=util[_0x637e('0x5d')]('SIP/%s',_0x1a1664['user'][_0x637e('0x39')]);_0x5a947a[_0x637e('0x28')]['channel']=_0x89aea4[_0x637e('0x76')];_0x5a947a[_0x637e('0x28')][_0x637e('0x77')]=_0x89aea4['channel'];_0x5a947a[_0x637e('0x28')][_0x637e('0x82')]='reject';respondWithRpcPromise(_0x637e('0x78'),_0x637e('0x78'),{'event':'rejectmessage','message':_0x5a947a[_0x637e('0x28')]},client9002);return _0x89aea4;}return null;})[_0x637e('0x21')](respondWithResult(_0x5488ec,null))[_0x637e('0x29')](handleError(_0x5488ec,null));};exports[_0x637e('0x83')]=function(_0x109265,_0x51d1c2){var _0x446f04;return db[_0x637e('0x4f')]['create'](_0x109265[_0x637e('0x55')],{})[_0x637e('0x21')](function(_0xb5833f){_0x446f04=_0xb5833f;return db[_0x637e('0x84')][_0x637e('0x85')]({'where':{'id':_0x446f04[_0x637e('0x6c')]}});})[_0x637e('0x21')](function(_0x26e9b9){if(_['isNil'](_0x26e9b9)){return;}else{_0x446f04[_0x637e('0x5a')]=_0x26e9b9[_0x637e('0x5a')];return db[_0x637e('0x86')]['findOne']({'where':{'id':_0x446f04[_0x637e('0x87')]}});}})[_0x637e('0x21')](function(_0x3aa6f1){return respondWithRpcPromise(_0x637e('0x88'),_0x637e('0x88'),{'FaxAccountId':_[_0x637e('0x64')](_0x109265['body'])?undefined:_0x109265[_0x637e('0x55')][_0x637e('0x89')],'path':_[_0x637e('0x64')](_0x3aa6f1)?undefined:util[_0x637e('0x5d')](_0x637e('0x8a'),_0x3aa6f1[_0x637e('0x8b')]),'fax':_['isNil'](_0x446f04[_0x637e('0x5a')])?undefined:_0x446f04['fax'],'AttachmentId':_0x446f04[_0x637e('0x87')]},client9002);})[_0x637e('0x21')](respondWithResult(_0x51d1c2,0xc9))[_0x637e('0x29')](handleError(_0x51d1c2,null));};exports[_0x637e('0x8c')]=function(_0x4aaba5,_0x14a673){var _0x1dd03c=path[_0x637e('0x8d')](config[_0x637e('0x8e')],_0x637e('0x8f'),_0x637e('0x90'),_0x637e('0x91'));return db[_0x637e('0x4f')][_0x637e('0x56')]({'where':{'id':_0x4aaba5['params']['id']},'include':[{'model':db['Attachment'],'as':'Attachment'}]})['then'](handleEntityNotFound(_0x14a673,null))[_0x637e('0x21')](function(_0x50a394){if(_0x50a394){return _0x14a673[_0x637e('0x8c')](path[_0x637e('0x8d')](_0x1dd03c,_0x50a394[_0x637e('0x86')][_0x637e('0x8b')]));}})[_0x637e('0x29')](handleError(_0x14a673,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index e7ce966..f7bbb14 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 _0x5a99=['emit','hook','exports','events','../../mysqldb','FaxMessage','save','update','remove'];(function(_0x2db3b3,_0x12b434){var _0x3201b0=function(_0x198a1f){while(--_0x198a1f){_0x2db3b3['push'](_0x2db3b3['shift']());}};_0x3201b0(++_0x12b434);}(_0x5a99,0xc9));var _0x95a9=function(_0x106c82,_0x2ea593){_0x106c82=_0x106c82-0x0;var _0x461376=_0x5a99[_0x106c82];return _0x461376;};'use strict';var EventEmitter=require(_0x95a9('0x0'));var FaxMessage=require(_0x95a9('0x1'))['db'][_0x95a9('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x95a9('0x3'),'afterUpdate':_0x95a9('0x4'),'afterDestroy':_0x95a9('0x5')};function emitEvent(_0x475a71){return function(_0x4b30e2,_0x2c8e52,_0x3ff50a){FaxMessageEvents[_0x95a9('0x6')](_0x475a71+':'+_0x4b30e2['id'],_0x4b30e2);FaxMessageEvents[_0x95a9('0x6')](_0x475a71,_0x4b30e2);_0x3ff50a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x95a9('0x7')](e,emitEvent(event));}}module[_0x95a9('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0xfc91=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','save'];(function(_0x1c0001,_0x2c2f01){var _0x56a9ea=function(_0x3059d0){while(--_0x3059d0){_0x1c0001['push'](_0x1c0001['shift']());}};_0x56a9ea(++_0x2c2f01);}(_0xfc91,0xb5));var _0x1fc9=function(_0x3b6548,_0x572009){_0x3b6548=_0x3b6548-0x0;var _0x148940=_0xfc91[_0x3b6548];return _0x148940;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x1fc9('0x0'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x1fc9('0x1')](0x0);var events={'afterCreate':_0x1fc9('0x2'),'afterUpdate':_0x1fc9('0x3'),'afterDestroy':_0x1fc9('0x4')};function emitEvent(_0x2199cd){return function(_0xa16e01,_0x471692,_0x6d3bcc){FaxMessageEvents[_0x1fc9('0x5')](_0x2199cd+':'+_0xa16e01['id'],_0xa16e01);FaxMessageEvents[_0x1fc9('0x5')](_0x2199cd,_0xa16e01);_0x6d3bcc(null);};}for(var e in events){if(events[_0x1fc9('0x6')](e)){var event=events[e];FaxMessage[_0x1fc9('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index ded601c..a596f4b 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 _0x8761=['models','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./faxMessage.attributes','exports','define','fax_messages','fti_fax_messages','body','FULLTEXT'];(function(_0x44cb92,_0x59afa3){var _0x56b9e6=function(_0x2841e0){while(--_0x2841e0){_0x44cb92['push'](_0x44cb92['shift']());}};_0x56b9e6(++_0x59afa3);}(_0x8761,0x166));var _0x1876=function(_0xd4f1ad,_0x4cea69){_0xd4f1ad=_0xd4f1ad-0x0;var _0x116c2f=_0x8761[_0xd4f1ad];return _0x116c2f;};'use strict';var _=require('lodash');var util=require(_0x1876('0x0'));var logger=require(_0x1876('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1876('0x2'));var rp=require(_0x1876('0x3'));var fs=require('fs');var path=require(_0x1876('0x4'));var rimraf=require(_0x1876('0x5'));var config=require(_0x1876('0x6'));var attributes=require(_0x1876('0x7'));module[_0x1876('0x8')]=function(_0x29e74a,_0x2105c0){return _0x29e74a[_0x1876('0x9')]('FaxMessage',attributes,{'tableName':_0x1876('0xa'),'paranoid':![],'indexes':[{'name':_0x1876('0xb'),'fields':[_0x1876('0xc')],'type':_0x1876('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x284243,_0xc197b6,_0x6660a3){var _0x5de806=_0x29e74a[_0x1876('0xe')];var _0x265d4a=_0x284243[_0x1876('0xf')]({'plain':!![]});if(_0x265d4a[_0x1876('0x10')][_0x1876('0x11')]()==='in'||_0x265d4a[_0x1876('0x10')][_0x1876('0x11')]()===_0x1876('0x12')&&!_0x265d4a[_0x1876('0x13')]&&!_[_0x1876('0x14')](_0x265d4a[_0x1876('0x15')])){_0x5de806[_0x1876('0x16')][_0x1876('0x17')]({'where':{'id':_0x265d4a[_0x1876('0x18')]}})['then'](function(_0x3c0fa0){if(_0x3c0fa0){_0x3c0fa0[_0x1876('0x19')]({'lastMsgAt':_0x265d4a[_0x1876('0x1a')],'lastMsgDirection':_0x265d4a['direction'][_0x1876('0x11')]()});}})[_0x1876('0x1b')](function(_0x5d1c88){console[_0x1876('0x1c')](_0x5d1c88);});}_0x6660a3();}},'charset':_0x1876('0x1d'),'collate':_0x1876('0x1e')});}; \ No newline at end of file +var _0x85af=['UserId','findOne','FaxInteractionId','update','createdAt','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./faxMessage.attributes','exports','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','toLowerCase','direction','out','secret'];(function(_0x3e069e,_0x24f8ab){var _0x229985=function(_0x5ca262){while(--_0x5ca262){_0x3e069e['push'](_0x3e069e['shift']());}};_0x229985(++_0x24f8ab);}(_0x85af,0x118));var _0xf85a=function(_0xa58f09,_0xebc49c){_0xa58f09=_0xa58f09-0x0;var _0x3b4977=_0x85af[_0xa58f09];return _0x3b4977;};'use strict';var _=require('lodash');var util=require(_0xf85a('0x0'));var logger=require(_0xf85a('0x1'))(_0xf85a('0x2'));var moment=require(_0xf85a('0x3'));var BPromise=require(_0xf85a('0x4'));var rp=require(_0xf85a('0x5'));var fs=require('fs');var path=require(_0xf85a('0x6'));var rimraf=require('rimraf');var config=require(_0xf85a('0x7'));var attributes=require(_0xf85a('0x8'));module[_0xf85a('0x9')]=function(_0xc76471,_0x4bdeb6){return _0xc76471['define'](_0xf85a('0xa'),attributes,{'tableName':_0xf85a('0xb'),'paranoid':![],'indexes':[{'name':_0xf85a('0xc'),'fields':[_0xf85a('0xd')],'type':_0xf85a('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3acb6a,_0x11c13e,_0x17c6e5){var _0x587cf8=_0xc76471[_0xf85a('0xf')];var _0x4afedc=_0x3acb6a['get']({'plain':!![]});if(_0x4afedc['direction'][_0xf85a('0x10')]()==='in'||_0x4afedc[_0xf85a('0x11')][_0xf85a('0x10')]()===_0xf85a('0x12')&&!_0x4afedc[_0xf85a('0x13')]&&!_['isNil'](_0x4afedc[_0xf85a('0x14')])){_0x587cf8['FaxInteraction'][_0xf85a('0x15')]({'where':{'id':_0x4afedc[_0xf85a('0x16')]}})['then'](function(_0x100b2a){if(_0x100b2a){_0x100b2a[_0xf85a('0x17')]({'lastMsgAt':_0x4afedc[_0xf85a('0x18')],'lastMsgDirection':_0x4afedc[_0xf85a('0x11')][_0xf85a('0x10')]()});}})['catch'](function(_0x521ec8){console['error'](_0x521ec8);});}_0x17c6e5();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index c75b382..8f894fa 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 _0xa8a8=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','FaxMessage','create','body','options','raw','CreateFaxMessage','UpdateFaxMessage','where','attributes','limit','lodash','util','moment','bluebird'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0xa8a8,0xec));var _0x8a8a=function(_0x4ae8cc,_0xf40f50){_0x4ae8cc=_0x4ae8cc-0x0;var _0x59855b=_0xa8a8[_0x4ae8cc];return _0x59855b;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});config[_0x8a8a('0xd')]=_[_0x8a8a('0xe')](config[_0x8a8a('0xd')],{'host':_0x8a8a('0xf'),'port':0x18eb});var socket=require(_0x8a8a('0x10'))(new Redis(config[_0x8a8a('0xd')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x3c01cd,_0x497b8a,_0x11788d){return new BPromise(function(_0x3d3a00,_0x532621){return client[_0x8a8a('0x11')](_0x3c01cd,_0x11788d)[_0x8a8a('0x12')](function(_0xb13fca){logger['info'](_0x8a8a('0x13'),_0x497b8a,_0x8a8a('0x14'));logger[_0x8a8a('0x15')](_0x8a8a('0x16'),_0x497b8a,'request\x20sent',JSON[_0x8a8a('0x17')](_0xb13fca));if(_0xb13fca['error']){if(_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x19')]===0x1f4){logger[_0x8a8a('0x18')](_0x8a8a('0x13'),_0x497b8a,_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x1a')]);return _0x532621(_0xb13fca[_0x8a8a('0x18')]['message']);}logger[_0x8a8a('0x18')]('FaxMessage,\x20%s,\x20%s',_0x497b8a,_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x1a')]);return _0x3d3a00(_0xb13fca[_0x8a8a('0x18')][_0x8a8a('0x1a')]);}else{logger[_0x8a8a('0x1b')]('FaxMessage,\x20%s,\x20%s',_0x497b8a,_0x8a8a('0x14'));_0x3d3a00(_0xb13fca[_0x8a8a('0x1c')][_0x8a8a('0x1a')]);}})[_0x8a8a('0x1d')](function(_0x299827){logger[_0x8a8a('0x18')]('FaxMessage,\x20%s,\x20%s',_0x497b8a,_0x299827);_0x532621(_0x299827);});});}exports['CreateFaxMessage']=function(_0x5181b2){var _0x4e3d0a=this;return new Promise(function(_0x4a6601,_0x3a9b2f){return db[_0x8a8a('0x1e')][_0x8a8a('0x1f')](_0x5181b2[_0x8a8a('0x20')],{'raw':_0x5181b2[_0x8a8a('0x21')]?_0x5181b2[_0x8a8a('0x21')][_0x8a8a('0x22')]===undefined?!![]:![]:!![]})[_0x8a8a('0x12')](function(_0x25d5d4){logger[_0x8a8a('0x1b')](_0x8a8a('0x23'),_0x5181b2);logger[_0x8a8a('0x15')](_0x8a8a('0x23'),_0x5181b2,JSON[_0x8a8a('0x17')](_0x25d5d4));_0x4a6601(_0x25d5d4);})[_0x8a8a('0x1d')](function(_0x545a38){logger[_0x8a8a('0x18')](_0x8a8a('0x23'),_0x545a38[_0x8a8a('0x1a')],_0x5181b2);_0x3a9b2f(_0x4e3d0a[_0x8a8a('0x18')](0x1f4,_0x545a38[_0x8a8a('0x1a')]));});});};exports[_0x8a8a('0x24')]=function(_0x3aa46d){var _0x5f4dcc=this;return new Promise(function(_0x31d21a,_0x38c1e0){return db[_0x8a8a('0x1e')]['update'](_0x3aa46d['body'],{'raw':_0x3aa46d[_0x8a8a('0x21')]?_0x3aa46d[_0x8a8a('0x21')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3aa46d['options']?_0x3aa46d['options'][_0x8a8a('0x25')]||null:null,'attributes':_0x3aa46d['options']?_0x3aa46d[_0x8a8a('0x21')][_0x8a8a('0x26')]||null:null,'limit':_0x3aa46d['options']?_0x3aa46d[_0x8a8a('0x21')][_0x8a8a('0x27')]||null:null})[_0x8a8a('0x12')](function(_0x8df0cb){logger[_0x8a8a('0x1b')](_0x8a8a('0x24'),_0x3aa46d);logger[_0x8a8a('0x15')](_0x8a8a('0x24'),_0x3aa46d,JSON['stringify'](_0x8df0cb));_0x31d21a(_0x8df0cb);})['catch'](function(_0x56e79e){logger[_0x8a8a('0x18')](_0x8a8a('0x24'),_0x56e79e['message'],_0x3aa46d);_0x38c1e0(_0x5f4dcc[_0x8a8a('0x18')](0x1f4,_0x56e79e[_0x8a8a('0x1a')]));});});}; \ No newline at end of file +var _0x55e0=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./faxMessage.socket','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','create','body','options','raw','then','UpdateFaxMessage','update','where','attributes','limit','lodash','util'];(function(_0x581844,_0x1aa88b){var _0x178ddb=function(_0x5695e9){while(--_0x5695e9){_0x581844['push'](_0x581844['shift']());}};_0x178ddb(++_0x1aa88b);}(_0x55e0,0xdc));var _0x055e=function(_0x8b2a7f,_0x5987a7){_0x8b2a7f=_0x8b2a7f-0x0;var _0x2116e4=_0x55e0[_0x8b2a7f];return _0x2116e4;};'use strict';var _=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var moment=require(_0x055e('0x2'));var BPromise=require(_0x055e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x055e('0x4'))['db'];var utils=require(_0x055e('0x5'));var logger=require(_0x055e('0x6'))(_0x055e('0x7'));var config=require(_0x055e('0x8'));var jayson=require(_0x055e('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x055e('0xa')]=_['defaults'](config[_0x055e('0xa')],{'host':_0x055e('0xb'),'port':0x18eb});var socket=require(_0x055e('0xc'))(new Redis(config[_0x055e('0xa')]));require(_0x055e('0xd'))['register'](socket);function respondWithRpcPromise(_0x40779c,_0xd67814,_0xb816c){return new BPromise(function(_0xa0d384,_0x238068){return client['request'](_0x40779c,_0xb816c)['then'](function(_0x187cce){logger['info'](_0x055e('0xe'),_0xd67814,_0x055e('0xf'));logger[_0x055e('0x10')](_0x055e('0x11'),_0xd67814,_0x055e('0xf'),JSON[_0x055e('0x12')](_0x187cce));if(_0x187cce[_0x055e('0x13')]){if(_0x187cce['error'][_0x055e('0x14')]===0x1f4){logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);return _0x238068(_0x187cce['error'][_0x055e('0x15')]);}logger[_0x055e('0x13')](_0x055e('0xe'),_0xd67814,_0x187cce['error'][_0x055e('0x15')]);return _0xa0d384(_0x187cce[_0x055e('0x13')][_0x055e('0x15')]);}else{logger[_0x055e('0x16')](_0x055e('0xe'),_0xd67814,'request\x20sent');_0xa0d384(_0x187cce[_0x055e('0x17')][_0x055e('0x15')]);}})[_0x055e('0x18')](function(_0x2ed6fb){logger['error'](_0x055e('0xe'),_0xd67814,_0x2ed6fb);_0x238068(_0x2ed6fb);});});}exports[_0x055e('0x19')]=function(_0x58e44a){var _0xe2b7b5=this;return new Promise(function(_0x4412f9,_0x10258f){return db[_0x055e('0x1a')][_0x055e('0x1b')](_0x58e44a[_0x055e('0x1c')],{'raw':_0x58e44a['options']?_0x58e44a[_0x055e('0x1d')][_0x055e('0x1e')]===undefined?!![]:![]:!![]})[_0x055e('0x1f')](function(_0x5930ff){logger[_0x055e('0x16')](_0x055e('0x19'),_0x58e44a);logger[_0x055e('0x10')](_0x055e('0x19'),_0x58e44a,JSON['stringify'](_0x5930ff));_0x4412f9(_0x5930ff);})[_0x055e('0x18')](function(_0x56c372){logger[_0x055e('0x13')](_0x055e('0x19'),_0x56c372[_0x055e('0x15')],_0x58e44a);_0x10258f(_0xe2b7b5[_0x055e('0x13')](0x1f4,_0x56c372[_0x055e('0x15')]));});});};exports[_0x055e('0x20')]=function(_0x58caf9){var _0x2fb49b=this;return new Promise(function(_0x1f90a9,_0x2a82f8){return db['FaxMessage'][_0x055e('0x21')](_0x58caf9[_0x055e('0x1c')],{'raw':_0x58caf9[_0x055e('0x1d')]?_0x58caf9[_0x055e('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x58caf9[_0x055e('0x1d')]?_0x58caf9['options'][_0x055e('0x22')]||null:null,'attributes':_0x58caf9[_0x055e('0x1d')]?_0x58caf9[_0x055e('0x1d')][_0x055e('0x23')]||null:null,'limit':_0x58caf9[_0x055e('0x1d')]?_0x58caf9['options'][_0x055e('0x24')]||null:null})[_0x055e('0x1f')](function(_0x293062){logger[_0x055e('0x16')](_0x055e('0x20'),_0x58caf9);logger[_0x055e('0x10')](_0x055e('0x20'),_0x58caf9,JSON[_0x055e('0x12')](_0x293062));_0x1f90a9(_0x293062);})['catch'](function(_0x26d1c2){logger[_0x055e('0x13')]('UpdateFaxMessage',_0x26d1c2[_0x055e('0x15')],_0x58caf9);_0x2a82f8(_0x2fb49b[_0x055e('0x13')](0x1f4,_0x26d1c2[_0x055e('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 1f4bc7f..52472f1 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 _0x7808=['removeListener','register','length','faxMessage:','./faxMessage.events','save','remove','emit'];(function(_0x5b8f6d,_0x15ecd0){var _0x729fba=function(_0xfeecfc){while(--_0xfeecfc){_0x5b8f6d['push'](_0x5b8f6d['shift']());}};_0x729fba(++_0x15ecd0);}(_0x7808,0x14c));var _0x8780=function(_0x1f3782,_0x2f30d3){_0x1f3782=_0x1f3782-0x0;var _0x334338=_0x7808[_0x1f3782];return _0x334338;};'use strict';var FaxMessageEvents=require(_0x8780('0x0'));var events=[_0x8780('0x1'),_0x8780('0x2'),'update'];function createListener(_0x43539d,_0x47aad5){return function(_0x2d5107){_0x47aad5[_0x8780('0x3')](_0x43539d,_0x2d5107);};}function removeListener(_0x25fdc0,_0x2d6c43){return function(){FaxMessageEvents[_0x8780('0x4')](_0x25fdc0,_0x2d6c43);};}exports[_0x8780('0x5')]=function(_0x147818){for(var _0x1ea952=0x0,_0x58f60f=events[_0x8780('0x6')];_0x1ea952<_0x58f60f;_0x1ea952++){var _0x1dfe59=events[_0x1ea952];var _0x5c932d=createListener(_0x8780('0x7')+_0x1dfe59,_0x147818);FaxMessageEvents['on'](_0x1dfe59,_0x5c932d);}}; \ No newline at end of file +var _0xbf5a=['register','length','faxMessage:','./faxMessage.events','save','remove','removeListener'];(function(_0x102e64,_0x5b5b9b){var _0x25956c=function(_0x2622e3){while(--_0x2622e3){_0x102e64['push'](_0x102e64['shift']());}};_0x25956c(++_0x5b5b9b);}(_0xbf5a,0x65));var _0xabf5=function(_0x193f7e,_0xc511dd){_0x193f7e=_0x193f7e-0x0;var _0x591551=_0xbf5a[_0x193f7e];return _0x591551;};'use strict';var FaxMessageEvents=require(_0xabf5('0x0'));var events=[_0xabf5('0x1'),_0xabf5('0x2'),'update'];function createListener(_0x353a27,_0x50b1f8){return function(_0x1de864){_0x50b1f8['emit'](_0x353a27,_0x1de864);};}function removeListener(_0x43bd11,_0x283cb6){return function(){FaxMessageEvents[_0xabf5('0x3')](_0x43bd11,_0x283cb6);};}exports[_0xabf5('0x4')]=function(_0x31fd32){for(var _0x4e557c=0x0,_0x2f5288=events[_0xabf5('0x5')];_0x4e557c<_0x2f5288;_0x4e557c++){var _0xad616e=events[_0x4e557c];var _0x5354f4=createListener(_0xabf5('0x6')+_0xad616e,_0x31fd32);FaxMessageEvents['on'](_0xad616e,_0x5354f4);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 1e1d402..e2df3df 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 _0x1be1=['create','put','update','/:id/accept','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','describe','/:id','/:id/download','download','post','tracked','faxmessage:create'];(function(_0x60286b,_0x3247c1){var _0x5dff69=function(_0x4ecfcf){while(--_0x4ecfcf){_0x60286b['push'](_0x60286b['shift']());}};_0x5dff69(++_0x3247c1);}(_0x1be1,0x192));var _0x11be=function(_0x57722d,_0x4ad65b){_0x57722d=_0x57722d-0x0;var _0x5f5768=_0x1be1[_0x57722d];return _0x5f5768;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x11be('0x0'));var timeout=require(_0x11be('0x1'));var express=require('express');var router=express[_0x11be('0x2')]();var fs_extra=require(_0x11be('0x3'));var auth=require(_0x11be('0x4'));var interaction=require(_0x11be('0x5'));var config=require('../../config/environment');var controller=require(_0x11be('0x6'));router[_0x11be('0x7')]('/',auth[_0x11be('0x8')](),controller['index']);router[_0x11be('0x7')]('/describe',auth[_0x11be('0x8')](),controller[_0x11be('0x9')]);router[_0x11be('0x7')](_0x11be('0xa'),auth[_0x11be('0x8')](),controller['show']);router[_0x11be('0x7')](_0x11be('0xb'),auth['isAuthenticated'](),controller[_0x11be('0xc')]);router[_0x11be('0xd')]('/',auth[_0x11be('0x8')](),interaction[_0x11be('0xe')]('fax',_0x11be('0xf')),controller[_0x11be('0x10')]);router[_0x11be('0x11')]('/:id',auth[_0x11be('0x8')](),controller[_0x11be('0x12')]);router['put'](_0x11be('0x13'),auth['isAuthenticated'](),controller['accept']);router['put']('/:id/reject',auth['isAuthenticated'](),controller['reject']);router['delete'](_0x11be('0xa'),auth['isAuthenticated'](),controller[_0x11be('0x14')]);module[_0x11be('0x15')]=router; \ No newline at end of file +var _0x593e=['../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','show','download','post','fax','faxmessage:create','create','put','/:id','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x407de4,_0x39b031){var _0x49b3a5=function(_0x10ea52){while(--_0x10ea52){_0x407de4['push'](_0x407de4['shift']());}};_0x49b3a5(++_0x39b031);}(_0x593e,0xcb));var _0xe593=function(_0x391cb5,_0x4f8e1c){_0x391cb5=_0x391cb5-0x0;var _0xf96750=_0x593e[_0x391cb5];return _0xf96750;};'use strict';var multer=require(_0xe593('0x0'));var util=require(_0xe593('0x1'));var path=require(_0xe593('0x2'));var timeout=require(_0xe593('0x3'));var express=require(_0xe593('0x4'));var router=express[_0xe593('0x5')]();var fs_extra=require(_0xe593('0x6'));var auth=require(_0xe593('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xe593('0x8'));var controller=require(_0xe593('0x9'));router[_0xe593('0xa')]('/',auth[_0xe593('0xb')](),controller[_0xe593('0xc')]);router[_0xe593('0xa')](_0xe593('0xd'),auth[_0xe593('0xb')](),controller[_0xe593('0xe')]);router[_0xe593('0xa')]('/:id',auth[_0xe593('0xb')](),controller[_0xe593('0xf')]);router[_0xe593('0xa')]('/:id/download',auth['isAuthenticated'](),controller[_0xe593('0x10')]);router[_0xe593('0x11')]('/',auth[_0xe593('0xb')](),interaction['tracked'](_0xe593('0x12'),_0xe593('0x13')),controller[_0xe593('0x14')]);router[_0xe593('0x15')](_0xe593('0x16'),auth[_0xe593('0xb')](),controller[_0xe593('0x17')]);router[_0xe593('0x15')](_0xe593('0x18'),auth[_0xe593('0xb')](),controller['accept']);router[_0xe593('0x15')](_0xe593('0x19'),auth['isAuthenticated'](),controller[_0xe593('0x1a')]);router[_0xe593('0x1b')]('/:id',auth[_0xe593('0xb')](),controller[_0xe593('0x1c')]);module[_0xe593('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 743cce8..05c26b6 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 _0xf6fa=['INTEGER','beepall','roundrobin','exports','name','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf6fa,0x87));var _0xaf6f=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xf6fa[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require('sequelize');module[_0xaf6f('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xaf6f('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xaf6f('0x2')]},'timeout':{'type':Sequelize[_0xaf6f('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xaf6f('0x4'),_0xaf6f('0x5')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xaf6f('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbbaf=['sequelize','exports','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x3ab5f0,_0x4dc8e8){var _0x39d70b=function(_0x1a04f6){while(--_0x1a04f6){_0x3ab5f0['push'](_0x3ab5f0['shift']());}};_0x39d70b(++_0x4dc8e8);}(_0xbbaf,0x158));var _0xfbba=function(_0x472f07,_0x393fe4){_0x472f07=_0x472f07-0x0;var _0x5a6c7a=_0xbbaf[_0x472f07];return _0x5a6c7a;};'use strict';var Sequelize=require(_0xfbba('0x0'));module[_0xfbba('0x1')]={'name':{'type':Sequelize[_0xfbba('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xfbba('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfbba('0x4')](_0xfbba('0x5'),_0xfbba('0x6'),_0xfbba('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xfbba('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 025ba12..6cdac2d 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 _0x0caf=['getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','status','end','undefined','limit','count','offset','set','json','apply','reject','save','update','then','destroy','get','FaxQueues','UserProfileResource','sendStatus','error','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','FaxQueue','includeAll','include','findAll','rows','show','filters','length','find','catch','create','user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','findOne','FaxQueueId','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','UserFaxQueue','findOrCreate','forEach','emit','userFaxQueue:save','select','field','tq.TeamId','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','toString','QueryTypes','every','TeamId','includes','all','compact','removeTeams','isEmpty','userFaxQueue:remove','addAgents','omit','removeAgents'];(function(_0x539df4,_0x33a85e){var _0x283d08=function(_0x112923){while(--_0x112923){_0x539df4['push'](_0x539df4['shift']());}};_0x283d08(++_0x33a85e);}(_0x0caf,0x94));var _0xf0ca=function(_0x1a75e3,_0x38e4f3){_0x1a75e3=_0x1a75e3-0x0;var _0x5b6815=_0x0caf[_0x1a75e3];return _0x5b6815;};'use strict';var emlformat=require(_0xf0ca('0x0'));var rimraf=require(_0xf0ca('0x1'));var zipdir=require(_0xf0ca('0x2'));var jsonpatch=require(_0xf0ca('0x3'));var rp=require(_0xf0ca('0x4'));var moment=require(_0xf0ca('0x5'));var BPromise=require(_0xf0ca('0x6'));var Mustache=require(_0xf0ca('0x7'));var util=require('util');var path=require(_0xf0ca('0x8'));var sox=require(_0xf0ca('0x9'));var csv=require(_0xf0ca('0xa'));var ejs=require(_0xf0ca('0xb'));var fs=require('fs');var fs_extra=require(_0xf0ca('0xc'));var _=require(_0xf0ca('0xd'));var squel=require(_0xf0ca('0xe'));var crypto=require(_0xf0ca('0xf'));var jsforce=require(_0xf0ca('0x10'));var deskjs=require(_0xf0ca('0x11'));var toCsv=require(_0xf0ca('0xa'));var querystring=require(_0xf0ca('0x12'));var Papa=require(_0xf0ca('0x13'));var Redis=require(_0xf0ca('0x14'));var authService=require(_0xf0ca('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0xf0ca('0x16'));var hardwareService=require(_0xf0ca('0x17'));var logger=require(_0xf0ca('0x18'))(_0xf0ca('0x19'));var utils=require(_0xf0ca('0x1a'));var config=require(_0xf0ca('0x1b'));var licenseUtil=require(_0xf0ca('0x1c'));var db=require(_0xf0ca('0x1d'))['db'];config['redis']=_[_0xf0ca('0x1e')](config[_0xf0ca('0x1f')],{'host':_0xf0ca('0x20'),'port':0x18eb});var socket=require(_0xf0ca('0x21'))(new Redis(config[_0xf0ca('0x1f')]));require(_0xf0ca('0x22'))[_0xf0ca('0x23')](socket);function respondWithStatusCode(_0x5a58aa,_0xecf980){_0xecf980=_0xecf980||0xcc;return function(_0x1962db){if(_0x1962db){return _0x5a58aa['sendStatus'](_0xecf980);}return _0x5a58aa[_0xf0ca('0x24')](_0xecf980)[_0xf0ca('0x25')]();};}function respondWithResult(_0x20b49b,_0x5188a0){_0x5188a0=_0x5188a0||0xc8;return function(_0x1e6243){if(_0x1e6243){return _0x20b49b[_0xf0ca('0x24')](_0x5188a0)['json'](_0x1e6243);}};}function respondWithFilteredResult(_0x53e8a5,_0x34ee44){return function(_0x48906d){if(_0x48906d){var _0x4dedae=typeof _0x34ee44['offset']===_0xf0ca('0x26')&&typeof _0x34ee44[_0xf0ca('0x27')]==='undefined';var _0x32d362=_0x48906d[_0xf0ca('0x28')];var _0x155e92=_0x4dedae?0x0:_0x34ee44[_0xf0ca('0x29')];var _0x1f38c6=_0x4dedae?_0x48906d[_0xf0ca('0x28')]:_0x34ee44[_0xf0ca('0x29')]+_0x34ee44[_0xf0ca('0x27')];var _0x54c012;if(_0x1f38c6>=_0x32d362){_0x1f38c6=_0x32d362;_0x54c012=0xc8;}else{_0x54c012=0xce;}_0x53e8a5[_0xf0ca('0x24')](_0x54c012);return _0x53e8a5[_0xf0ca('0x2a')]('Content-Range',_0x155e92+'-'+_0x1f38c6+'/'+_0x32d362)[_0xf0ca('0x2b')](_0x48906d);}return null;};}function patchUpdates(_0x270928){return function(_0x5d1897){try{jsonpatch[_0xf0ca('0x2c')](_0x5d1897,_0x270928,!![]);}catch(_0x855a93){return BPromise[_0xf0ca('0x2d')](_0x855a93);}return _0x5d1897[_0xf0ca('0x2e')]();};}function saveUpdates(_0x9f62ed,_0x3c141e){return function(_0x57c2aa){if(_0x57c2aa){return _0x57c2aa[_0xf0ca('0x2f')](_0x9f62ed)[_0xf0ca('0x30')](function(_0x11e8d6){return _0x11e8d6;});}return null;};}function removeEntity(_0x11d4d6,_0x45cc37){return function(_0x2433a9){if(_0x2433a9){return _0x2433a9[_0xf0ca('0x31')]()[_0xf0ca('0x30')](function(){var _0x2d3399=_0x2433a9[_0xf0ca('0x32')]({'plain':!![]});var _0x4a902c=_0xf0ca('0x33');return db[_0xf0ca('0x34')]['destroy']({'where':{'type':_0x4a902c,'resourceId':_0x2d3399['id']}})[_0xf0ca('0x30')](function(){return _0x2433a9;});})[_0xf0ca('0x30')](function(){_0x11d4d6[_0xf0ca('0x24')](0xcc)[_0xf0ca('0x25')]();});}};}function handleEntityNotFound(_0x24551f,_0x4c8d59){return function(_0x19b1b9){if(!_0x19b1b9){_0x24551f[_0xf0ca('0x35')](0x194);}return _0x19b1b9;};}function handleError(_0x1a8d06,_0x417a68){_0x417a68=_0x417a68||0x1f4;return function(_0x5a6e71){logger[_0xf0ca('0x36')](_0x5a6e71[_0xf0ca('0x37')]);if(_0x5a6e71[_0xf0ca('0x38')]){delete _0x5a6e71[_0xf0ca('0x38')];}_0x1a8d06[_0xf0ca('0x24')](_0x417a68)['send'](_0x5a6e71);};}exports[_0xf0ca('0x39')]=function(_0x28832f,_0xa067f6){var _0x190370={},_0x143173={},_0x219bce={'count':0x0,'rows':[]};var _0x54c391=_[_0xf0ca('0x3a')](db['FaxQueue'][_0xf0ca('0x3b')],function(_0x5cfa7b){return{'name':_0x5cfa7b[_0xf0ca('0x3c')],'type':_0x5cfa7b['type'][_0xf0ca('0x3d')]};});_0x143173[_0xf0ca('0x3e')]=_['map'](_0x54c391,_0xf0ca('0x38'));_0x143173[_0xf0ca('0x3f')]=_[_0xf0ca('0x40')](_0x28832f[_0xf0ca('0x3f')]);_0x143173['filters']=_[_0xf0ca('0x41')](_0x143173[_0xf0ca('0x3e')],_0x143173[_0xf0ca('0x3f')]);_0x190370[_0xf0ca('0x42')]=_[_0xf0ca('0x41')](_0x143173[_0xf0ca('0x3e')],qs[_0xf0ca('0x43')](_0x28832f[_0xf0ca('0x3f')]['fields']));_0x190370['attributes']=_0x190370['attributes']['length']?_0x190370[_0xf0ca('0x42')]:_0x143173[_0xf0ca('0x3e')];if(!_0x28832f[_0xf0ca('0x3f')][_0xf0ca('0x44')](_0xf0ca('0x45'))){_0x190370['limit']=qs[_0xf0ca('0x27')](_0x28832f[_0xf0ca('0x3f')][_0xf0ca('0x27')]);_0x190370[_0xf0ca('0x29')]=qs['offset'](_0x28832f[_0xf0ca('0x3f')]['offset']);}_0x190370[_0xf0ca('0x46')]=qs[_0xf0ca('0x47')](_0x28832f['query']['sort']);_0x190370['where']=qs['filters'](_[_0xf0ca('0x48')](_0x28832f[_0xf0ca('0x3f')],_0x143173['filters']),_0x54c391);if(_0x28832f[_0xf0ca('0x3f')]['filter']){_0x190370[_0xf0ca('0x49')]=_[_0xf0ca('0x4a')](_0x190370[_0xf0ca('0x49')],{'$or':_['map'](_0x54c391,function(_0x11d59b){if(_0x11d59b[_0xf0ca('0x4b')]!==_0xf0ca('0x4c')){var _0x177318={};_0x177318[_0x11d59b[_0xf0ca('0x38')]]={'$like':'%'+_0x28832f[_0xf0ca('0x3f')][_0xf0ca('0x4d')]+'%'};return _0x177318;}})});}_0x190370=_[_0xf0ca('0x4a')]({},_0x190370,_0x28832f[_0xf0ca('0x4e')]);var _0x20243c={'where':_0x190370['where']};return db[_0xf0ca('0x4f')][_0xf0ca('0x28')](_0x20243c)[_0xf0ca('0x30')](function(_0x3eb8d0){_0x219bce[_0xf0ca('0x28')]=_0x3eb8d0;if(_0x28832f['query'][_0xf0ca('0x50')]){_0x190370[_0xf0ca('0x51')]=[{'all':!![]}];}return db[_0xf0ca('0x4f')][_0xf0ca('0x52')](_0x190370);})[_0xf0ca('0x30')](function(_0x59fa3b){_0x219bce[_0xf0ca('0x53')]=_0x59fa3b;return _0x219bce;})['then'](respondWithFilteredResult(_0xa067f6,_0x190370))['catch'](handleError(_0xa067f6,null));};exports[_0xf0ca('0x54')]=function(_0x525404,_0xa19590){var _0x4097ab={'raw':!![],'where':{'id':_0x525404['params']['id']}},_0x26ded9={};_0x26ded9[_0xf0ca('0x3e')]=_[_0xf0ca('0x40')](db[_0xf0ca('0x4f')][_0xf0ca('0x3b')]);_0x26ded9[_0xf0ca('0x3f')]=_[_0xf0ca('0x40')](_0x525404[_0xf0ca('0x3f')]);_0x26ded9[_0xf0ca('0x55')]=_[_0xf0ca('0x41')](_0x26ded9['model'],_0x26ded9[_0xf0ca('0x3f')]);_0x4097ab[_0xf0ca('0x42')]=_[_0xf0ca('0x41')](_0x26ded9['model'],qs[_0xf0ca('0x43')](_0x525404[_0xf0ca('0x3f')][_0xf0ca('0x43')]));_0x4097ab[_0xf0ca('0x42')]=_0x4097ab[_0xf0ca('0x42')][_0xf0ca('0x56')]?_0x4097ab[_0xf0ca('0x42')]:_0x26ded9[_0xf0ca('0x3e')];if(_0x525404[_0xf0ca('0x3f')][_0xf0ca('0x50')]){_0x4097ab['include']=[{'all':!![]}];}_0x4097ab=_[_0xf0ca('0x4a')]({},_0x4097ab,_0x525404[_0xf0ca('0x4e')]);return db[_0xf0ca('0x4f')][_0xf0ca('0x57')](_0x4097ab)[_0xf0ca('0x30')](handleEntityNotFound(_0xa19590,null))[_0xf0ca('0x30')](respondWithResult(_0xa19590,null))[_0xf0ca('0x58')](handleError(_0xa19590,null));};exports[_0xf0ca('0x59')]=function(_0x22a0ba,_0x578c11){return db[_0xf0ca('0x4f')][_0xf0ca('0x59')](_0x22a0ba['body'],{})[_0xf0ca('0x30')](function(_0x56424f){var _0xcbe72c=_0x22a0ba[_0xf0ca('0x5a')][_0xf0ca('0x32')]({'plain':!![]});if(!_0xcbe72c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xcbe72c[_0xf0ca('0x5b')]===_0xf0ca('0x5a')){var _0x3f77c4=_0x56424f['get']({'plain':!![]});var _0x382901='FaxQueues';return db[_0xf0ca('0x5c')]['find']({'where':{'name':_0x382901,'userProfileId':_0xcbe72c['userProfileId']},'raw':!![]})['then'](function(_0x1883a0){if(_0x1883a0&&_0x1883a0[_0xf0ca('0x5d')]===0x0){return db[_0xf0ca('0x34')][_0xf0ca('0x59')]({'name':_0x3f77c4[_0xf0ca('0x38')],'resourceId':_0x3f77c4['id'],'type':_0x1883a0[_0xf0ca('0x38')],'sectionId':_0x1883a0['id']},{})[_0xf0ca('0x30')](function(){return _0x56424f;});}else{return _0x56424f;}})['catch'](function(_0x9ca603){logger[_0xf0ca('0x36')](_0xf0ca('0x5e'),_0x9ca603);throw _0x9ca603;});}return _0x56424f;})[_0xf0ca('0x30')](respondWithResult(_0x578c11,0xc9))[_0xf0ca('0x58')](handleError(_0x578c11,null));};exports[_0xf0ca('0x2f')]=function(_0x3ef354,_0x1749e5){if(_0x3ef354[_0xf0ca('0x5f')]['id']){delete _0x3ef354['body']['id'];}return db['FaxQueue'][_0xf0ca('0x57')]({'where':{'id':_0x3ef354[_0xf0ca('0x60')]['id']}})[_0xf0ca('0x30')](handleEntityNotFound(_0x1749e5,null))[_0xf0ca('0x30')](saveUpdates(_0x3ef354[_0xf0ca('0x5f')],null))[_0xf0ca('0x30')](respondWithResult(_0x1749e5,null))[_0xf0ca('0x58')](handleError(_0x1749e5,null));};exports[_0xf0ca('0x31')]=function(_0x1e4243,_0x36f2c8){return db['FaxQueue']['find']({'where':{'id':_0x1e4243[_0xf0ca('0x60')]['id']}})[_0xf0ca('0x30')](handleEntityNotFound(_0x36f2c8,null))[_0xf0ca('0x30')](removeEntity(_0x36f2c8,null))[_0xf0ca('0x58')](handleError(_0x36f2c8,null));};exports[_0xf0ca('0x61')]=function(_0x3ce1a1,_0x413794){return db[_0xf0ca('0x4f')][_0xf0ca('0x61')]()[_0xf0ca('0x30')](respondWithResult(_0x413794,null))[_0xf0ca('0x58')](handleError(_0x413794,null));};exports['getMembers']=function(_0xfa2436,_0xb6ed34,_0x135aed){var _0x581765={'raw':!![],'where':{}},_0x2cb570={},_0xf4d07;return db[_0xf0ca('0x4f')][_0xf0ca('0x62')]({'where':{'id':_0xfa2436[_0xf0ca('0x60')]['id']}})['then'](handleEntityNotFound(_0xb6ed34,null))[_0xf0ca('0x30')](function(_0x131cba){if(_0x131cba){_0xf4d07=_0x131cba[_0xf0ca('0x32')]({'plain':!![]});_0x2cb570[_0xf0ca('0x3e')]=_[_0xf0ca('0x40')](db['UserFaxQueue'][_0xf0ca('0x3b')]);_0x2cb570[_0xf0ca('0x3f')]=_['keys'](_0xfa2436[_0xf0ca('0x3f')]);_0x2cb570[_0xf0ca('0x55')]=_[_0xf0ca('0x41')](_0x2cb570['model'],_0x2cb570[_0xf0ca('0x3f')]);_0x581765[_0xf0ca('0x42')]=_['intersection'](_0x2cb570[_0xf0ca('0x3e')],qs[_0xf0ca('0x43')](_0xfa2436['query'][_0xf0ca('0x43')]));_0x581765[_0xf0ca('0x42')]=_0x581765['attributes'][_0xf0ca('0x56')]?_0x581765[_0xf0ca('0x42')]:_0x2cb570[_0xf0ca('0x3e')];if(!_0xfa2436[_0xf0ca('0x3f')][_0xf0ca('0x44')](_0xf0ca('0x45'))){_0x581765[_0xf0ca('0x27')]=qs[_0xf0ca('0x27')](_0xfa2436[_0xf0ca('0x3f')]['limit']);_0x581765[_0xf0ca('0x29')]=qs[_0xf0ca('0x29')](_0xfa2436[_0xf0ca('0x3f')]['offset']);}_0x581765[_0xf0ca('0x46')]=qs[_0xf0ca('0x47')](_0xfa2436['query'][_0xf0ca('0x47')]);_0x581765[_0xf0ca('0x49')]=qs[_0xf0ca('0x55')](_[_0xf0ca('0x48')](_0xfa2436['query'],_0x2cb570[_0xf0ca('0x55')]));_0x581765[_0xf0ca('0x49')][_0xf0ca('0x63')]=_0x131cba['id'];if(_0xfa2436[_0xf0ca('0x3f')]['filter']){_0x581765[_0xf0ca('0x49')]=_['merge'](_0x581765[_0xf0ca('0x49')],{'$or':_[_0xf0ca('0x3a')](_0x581765['attributes'],function(_0x33b2f7){var _0xa49432={};_0xa49432[_0x33b2f7]={'$like':'%'+_0xfa2436[_0xf0ca('0x3f')]['filter']+'%'};return _0xa49432;})});}_0x581765=_['merge']({},_0x581765,_0xfa2436[_0xf0ca('0x4e')]);return db['UserFaxQueue']['findAll'](_0x581765);}})['then'](function(_0x3ce7cb){if(_0x3ce7cb){return db['User']['findAndCountAll']({'where':{'id':_[_0xf0ca('0x3a')](_0x3ce7cb,_0xf0ca('0x64')),'role':_0xf0ca('0x65')},'attributes':['id',_0xf0ca('0x38'),_0xf0ca('0x66'),_0xf0ca('0x67'),_0xf0ca('0x68')]});}})[_0xf0ca('0x30')](function(_0x1d839a){if(_0x1d839a){return{'count':_0x1d839a[_0xf0ca('0x28')],'rows':_[_0xf0ca('0x3a')](_0x1d839a[_0xf0ca('0x53')],function(_0x2c1620){return{'membername':_0x2c1620['name'],'UserId':_0x2c1620['id'],'queue_name':_0xf4d07[_0xf0ca('0x38')],'FaxQueueId':_0xf4d07['id'],'interface':util[_0xf0ca('0x69')](_0xf0ca('0x6a'),_0xf0ca('0x6b'),_0x2c1620[_0xf0ca('0x38')]),'penalty':0x0,'paused':_0x2c1620[_0xf0ca('0x66')],'createdAt':_0x2c1620[_0xf0ca('0x68')],'updatedAt':_0x2c1620[_0xf0ca('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xf0ca('0x30')](respondWithFilteredResult(_0xb6ed34,_0x581765))['catch'](handleError(_0xb6ed34,null));};exports[_0xf0ca('0x6c')]=function(_0x855c56,_0xbe38d2,_0x1c34a9){var _0x5c4eec={};var _0x58e36c={};var _0x2e0fcb;var _0x44249c;return db[_0xf0ca('0x4f')][_0xf0ca('0x62')]({'where':{'id':_0x855c56[_0xf0ca('0x60')]['id']}})[_0xf0ca('0x30')](handleEntityNotFound(_0xbe38d2,null))['then'](function(_0x856a31){if(_0x856a31){_0x2e0fcb=_0x856a31;_0x58e36c[_0xf0ca('0x3e')]=_[_0xf0ca('0x40')](db[_0xf0ca('0x6d')][_0xf0ca('0x3b')]);_0x58e36c[_0xf0ca('0x3f')]=_['keys'](_0x855c56[_0xf0ca('0x3f')]);_0x58e36c[_0xf0ca('0x55')]=_['intersection'](_0x58e36c[_0xf0ca('0x3e')],_0x58e36c[_0xf0ca('0x3f')]);_0x5c4eec[_0xf0ca('0x42')]=_['intersection'](_0x58e36c[_0xf0ca('0x3e')],qs[_0xf0ca('0x43')](_0x855c56[_0xf0ca('0x3f')][_0xf0ca('0x43')]));_0x5c4eec[_0xf0ca('0x42')]=_0x5c4eec[_0xf0ca('0x42')][_0xf0ca('0x56')]?_0x5c4eec[_0xf0ca('0x42')]:_0x58e36c[_0xf0ca('0x3e')];_0x5c4eec[_0xf0ca('0x46')]=qs[_0xf0ca('0x47')](_0x855c56['query']['sort']);_0x5c4eec[_0xf0ca('0x49')]=qs[_0xf0ca('0x55')](_['pick'](_0x855c56['query'],_0x58e36c['filters']));if(_0x855c56[_0xf0ca('0x3f')][_0xf0ca('0x4d')]){_0x5c4eec[_0xf0ca('0x49')]=_[_0xf0ca('0x4a')](_0x5c4eec[_0xf0ca('0x49')],{'$or':_[_0xf0ca('0x3a')](_0x5c4eec[_0xf0ca('0x42')],function(_0x1cd571){var _0x2b0128={};_0x2b0128[_0x1cd571]={'$like':'%'+_0x855c56[_0xf0ca('0x3f')][_0xf0ca('0x4d')]+'%'};return _0x2b0128;})});}_0x5c4eec=_[_0xf0ca('0x4a')]({},_0x5c4eec,_0x855c56['options']);return _0x2e0fcb['getTeams'](_0x5c4eec);}})['then'](function(_0x2e93d8){if(_0x2e93d8){_0x44249c=_0x2e93d8[_0xf0ca('0x56')];if(!_0x855c56[_0xf0ca('0x3f')][_0xf0ca('0x44')]('nolimit')){_0x5c4eec['limit']=qs[_0xf0ca('0x27')](_0x855c56['query'][_0xf0ca('0x27')]);_0x5c4eec[_0xf0ca('0x29')]=qs[_0xf0ca('0x29')](_0x855c56[_0xf0ca('0x3f')]['offset']);}return _0x2e0fcb[_0xf0ca('0x6c')](_0x5c4eec);}})['then'](function(_0x3c3952){if(_0x3c3952){return _0x3c3952?{'count':_0x44249c,'rows':_0x3c3952}:null;}})['then'](respondWithResult(_0xbe38d2,null))[_0xf0ca('0x58')](handleError(_0xbe38d2,null));};exports[_0xf0ca('0x6e')]=function(_0x593c42,_0x2733e6,_0x3edacb){var _0x2ecf2d=_0x593c42[_0xf0ca('0x5f')][_0xf0ca('0x6f')];return db[_0xf0ca('0x6d')]['findAll']({'where':{'id':_0x2ecf2d},'attributes':['id'],'include':[{'model':db[_0xf0ca('0x70')],'as':_0xf0ca('0x71'),'attributes':['id',_0xf0ca('0x38'),_0xf0ca('0x72'),_0xf0ca('0x73'),_0xf0ca('0x74')],'raw':!![]}]})[_0xf0ca('0x30')](function(_0x47a4ba){if(_0x47a4ba){var _0xa829f2=_[_0xf0ca('0x75')](_0x47a4ba,function(_0x4d278a){var _0x3ebf1c=_0x4d278a[_0xf0ca('0x32')]({'plain':!![]});return _0x3ebf1c[_0xf0ca('0x71')];});return db[_0xf0ca('0x4f')][_0xf0ca('0x57')]({'where':{'id':_0x593c42[_0xf0ca('0x60')]['id']}})[_0xf0ca('0x30')](function(_0x2ae210){return db[_0xf0ca('0x76')][_0xf0ca('0x77')](function(_0x3b6941){return _0x2ae210[_0xf0ca('0x6e')](_0x2ecf2d,{'transaction':_0x3b6941})['then'](function(){return BPromise[_0xf0ca('0x78')](_0xa829f2,function(_0xd59ba0){return db[_0xf0ca('0x79')][_0xf0ca('0x7a')]({'where':{'UserId':_0xd59ba0['id'],'FaxQueueId':_0x593c42[_0xf0ca('0x60')]['id']},'transaction':_0x3b6941});});})[_0xf0ca('0x30')](function(){_0xa829f2[_0xf0ca('0x7b')](function(_0x1aeddc){socket[_0xf0ca('0x7c')](_0xf0ca('0x7d'),{'UserId':_0x1aeddc['id'],'FaxQueueId':_0x2ae210['id']});});});});});}})['then'](respondWithStatusCode(_0x2733e6,null))[_0xf0ca('0x58')](handleError(_0x2733e6,null));};exports['removeTeams']=function(_0x4e73c5,_0x461207,_0x3fcd9b){return db['Team'][_0xf0ca('0x52')]({'where':{'id':_0x4e73c5[_0xf0ca('0x3f')][_0xf0ca('0x6f')]},'attributes':['id'],'include':[{'model':db[_0xf0ca('0x70')],'as':_0xf0ca('0x71'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x461207,null))[_0xf0ca('0x30')](function(_0x4ec19b){var _0x1e6e9=_[_0xf0ca('0x3a')](_0x4ec19b,'id');var _0x2876e0=[];var _0x73a7f3=[];var _0x5a69d4=squel[_0xf0ca('0x7e')]();_0x5a69d4[_0xf0ca('0x7f')](_0xf0ca('0x80'))['from'](_0xf0ca('0x81'),'tq')['join'](_0xf0ca('0x82'),'ut',_0xf0ca('0x83'))['where']('FaxQueueId\x20=\x20?',_0x4e73c5[_0xf0ca('0x60')]['id']);for(var _0x5c42d4=0x0;_0x5c42d4<_0x4ec19b[_0xf0ca('0x56')];_0x5c42d4+=0x1){let _0x15fa4a=_0x4ec19b[_0x5c42d4];for(var _0xf41037=0x0;_0xf41037<_0x15fa4a[_0xf0ca('0x71')][_0xf0ca('0x56')];_0xf41037+=0x1){let _0x40a0ee=_0x15fa4a[_0xf0ca('0x71')][_0xf41037];var _0x2b7d82=_0x5a69d4[_0xf0ca('0x84')]();_0x2b7d82[_0xf0ca('0x49')]('ut.UserId\x20=\x20?',_0x40a0ee['id']);_0x73a7f3['push'](db[_0xf0ca('0x76')]['query'](_0x2b7d82[_0xf0ca('0x85')](),{'type':db[_0xf0ca('0x76')][_0xf0ca('0x86')]['SELECT']})['then'](function(_0x18f9ac){if(_0x18f9ac[_0xf0ca('0x56')]===0x1){return _0x40a0ee['id'];}else{var _0x2fb457=_[_0xf0ca('0x87')](_[_0xf0ca('0x3a')](_0x18f9ac,_0xf0ca('0x88')),function(_0x23b6d8){return _[_0xf0ca('0x89')](_0x1e6e9,_0x23b6d8);});if(_0x2fb457){return _0x40a0ee['id'];}}}));}}return BPromise[_0xf0ca('0x8a')](_0x73a7f3)[_0xf0ca('0x30')](function(_0x3376c7){_0x2876e0=_(_0x2876e0)['union'](_0x3376c7)[_0xf0ca('0x8b')]()['value']();return db[_0xf0ca('0x4f')][_0xf0ca('0x57')]({'where':{'id':_0x4e73c5[_0xf0ca('0x60')]['id']}})[_0xf0ca('0x30')](function(_0x18f131){return db[_0xf0ca('0x76')]['transaction'](function(_0x39a464){return _0x18f131[_0xf0ca('0x8c')](_0x4e73c5[_0xf0ca('0x3f')][_0xf0ca('0x6f')],{'transaction':_0x39a464})['then'](function(){if(!_[_0xf0ca('0x8d')](_0x2876e0)){return _0x18f131['removeAgents'](_0x2876e0,{'transaction':_0x39a464});}})[_0xf0ca('0x30')](function(){_0x2876e0[_0xf0ca('0x7b')](function(_0x518eaf){socket[_0xf0ca('0x7c')](_0xf0ca('0x8e'),{'UserId':_0x518eaf,'FaxQueueId':_0x18f131['id']});});});});});});})[_0xf0ca('0x30')](respondWithStatusCode(_0x461207,null))['catch'](handleError(_0x461207,null));};exports[_0xf0ca('0x8f')]=function(_0x45d25a,_0x2cd8e5,_0x5aad4c){return db['FaxQueue'][_0xf0ca('0x57')]({'where':{'id':_0x45d25a[_0xf0ca('0x60')]['id']}})['then'](handleEntityNotFound(_0x2cd8e5,null))[_0xf0ca('0x30')](function(_0x5de79e){if(_0x5de79e){return _0x5de79e[_0xf0ca('0x8f')](_0x45d25a[_0xf0ca('0x5f')]['ids'],_[_0xf0ca('0x90')](_0x45d25a[_0xf0ca('0x5f')],[_0xf0ca('0x6f'),'id'])||{})['spread'](function(_0x4ff343){for(var _0x9db3=0x0;_0x9db3<_0x45d25a[_0xf0ca('0x5f')][_0xf0ca('0x6f')]['length'];_0x9db3+=0x1){socket[_0xf0ca('0x7c')]('userFaxQueue:save',{'UserId':Number(_0x45d25a['body'][_0xf0ca('0x6f')][_0x9db3]),'FaxQueueId':Number(_0x45d25a[_0xf0ca('0x60')]['id'])});}return _0x4ff343;});}})[_0xf0ca('0x30')](respondWithResult(_0x2cd8e5,null))['catch'](handleError(_0x2cd8e5,null));};exports[_0xf0ca('0x91')]=function(_0x229b27,_0x545008,_0x2c2fda){return db[_0xf0ca('0x4f')]['find']({'where':{'id':_0x229b27['params']['id']}})['then'](handleEntityNotFound(_0x545008,null))['then'](function(_0x16700b){if(_0x16700b){return _0x16700b[_0xf0ca('0x91')](_0x229b27[_0xf0ca('0x3f')]['ids'])[_0xf0ca('0x30')](function(){if(_['isArray'](_0x229b27[_0xf0ca('0x3f')][_0xf0ca('0x6f')])){for(var _0x53f164=0x0;_0x53f164<_0x229b27[_0xf0ca('0x3f')]['ids']['length'];_0x53f164+=0x1){socket[_0xf0ca('0x7c')](_0xf0ca('0x8e'),{'UserId':Number(_0x229b27[_0xf0ca('0x3f')]['ids'][_0x53f164]),'FaxQueueId':Number(_0x229b27['params']['id'])});}}else{socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x229b27['query'][_0xf0ca('0x6f')]),'FaxQueueId':Number(_0x229b27[_0xf0ca('0x60')]['id'])});}});}})[_0xf0ca('0x30')](respondWithStatusCode(_0x545008,null))[_0xf0ca('0x58')](handleError(_0x545008,null));};exports[_0xf0ca('0x92')]=function(_0x63fecd,_0x2a0c66,_0x56ed8d){var _0x30cc34={};var _0x2115e5={};var _0x20c378;var _0x3432b5;return db[_0xf0ca('0x4f')][_0xf0ca('0x62')]({'where':{'id':_0x63fecd[_0xf0ca('0x60')]['id']}})[_0xf0ca('0x30')](handleEntityNotFound(_0x2a0c66,null))[_0xf0ca('0x30')](function(_0x45bf6b){if(_0x45bf6b){_0x20c378=_0x45bf6b;_0x2115e5[_0xf0ca('0x3e')]=_['keys'](db[_0xf0ca('0x70')][_0xf0ca('0x3b')]);_0x2115e5['query']=_[_0xf0ca('0x40')](_0x63fecd[_0xf0ca('0x3f')]);_0x2115e5[_0xf0ca('0x55')]=_['intersection'](_0x2115e5[_0xf0ca('0x3e')],_0x2115e5[_0xf0ca('0x3f')]);_0x30cc34['attributes']=_['intersection'](_0x2115e5['model'],qs[_0xf0ca('0x43')](_0x63fecd[_0xf0ca('0x3f')]['fields']));_0x30cc34[_0xf0ca('0x42')]=_0x30cc34[_0xf0ca('0x42')][_0xf0ca('0x56')]?_0x30cc34['attributes']:_0x2115e5[_0xf0ca('0x3e')];_0x30cc34['order']=qs[_0xf0ca('0x47')](_0x63fecd[_0xf0ca('0x3f')][_0xf0ca('0x47')]);_0x30cc34[_0xf0ca('0x49')]=qs[_0xf0ca('0x55')](_[_0xf0ca('0x48')](_0x63fecd[_0xf0ca('0x3f')],_0x2115e5[_0xf0ca('0x55')]));if(_0x63fecd[_0xf0ca('0x3f')][_0xf0ca('0x4d')]){_0x30cc34[_0xf0ca('0x49')]=_[_0xf0ca('0x4a')](_0x30cc34[_0xf0ca('0x49')],{'$or':_[_0xf0ca('0x3a')](_0x30cc34['attributes'],function(_0x3ad78c){var _0x5e0b67={};_0x5e0b67[_0x3ad78c]={'$like':'%'+_0x63fecd[_0xf0ca('0x3f')][_0xf0ca('0x4d')]+'%'};return _0x5e0b67;})});}_0x30cc34=_['merge']({},_0x30cc34,_0x63fecd[_0xf0ca('0x4e')]);return _0x20c378[_0xf0ca('0x92')](_0x30cc34);}})['then'](function(_0x50eefb){if(_0x50eefb){_0x3432b5=_0x50eefb[_0xf0ca('0x56')];if(!_0x63fecd[_0xf0ca('0x3f')][_0xf0ca('0x44')](_0xf0ca('0x45'))){_0x30cc34[_0xf0ca('0x27')]=qs['limit'](_0x63fecd[_0xf0ca('0x3f')][_0xf0ca('0x27')]);_0x30cc34[_0xf0ca('0x29')]=qs['offset'](_0x63fecd['query'][_0xf0ca('0x29')]);}return _0x20c378[_0xf0ca('0x92')](_0x30cc34);}})[_0xf0ca('0x30')](function(_0x21e5a3){if(_0x21e5a3){return _0x21e5a3?{'count':_0x3432b5,'rows':_0x21e5a3}:null;}})[_0xf0ca('0x30')](respondWithResult(_0x2a0c66,null))[_0xf0ca('0x58')](handleError(_0x2a0c66,null));}; \ No newline at end of file +var _0x74d7=['userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','isArray','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','save','update','then','destroy','UserProfileResource','error','name','send','index','FaxQueue','fieldName','type','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','rawAttributes','filters','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserFaxQueue','pick','findAndCountAll','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','User','Agents','online','voicePause','sequelize','each','forEach','emit','removeTeams','select','field','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','transaction','removeAgents'];(function(_0x132558,_0x521d93){var _0x34f138=function(_0x3e3541){while(--_0x3e3541){_0x132558['push'](_0x132558['shift']());}};_0x34f138(++_0x521d93);}(_0x74d7,0x113));var _0x774d=function(_0x541ea6,_0x51cab6){_0x541ea6=_0x541ea6-0x0;var _0x3c3e84=_0x74d7[_0x541ea6];return _0x3c3e84;};'use strict';var emlformat=require(_0x774d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x774d('0x1'));var rp=require(_0x774d('0x2'));var moment=require(_0x774d('0x3'));var BPromise=require(_0x774d('0x4'));var Mustache=require(_0x774d('0x5'));var util=require(_0x774d('0x6'));var path=require(_0x774d('0x7'));var sox=require(_0x774d('0x8'));var csv=require(_0x774d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x774d('0xa'));var squel=require('squel');var crypto=require(_0x774d('0xb'));var jsforce=require(_0x774d('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x774d('0xd'));var Redis=require(_0x774d('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x774d('0xf'));var logger=require(_0x774d('0x10'))(_0x774d('0x11'));var utils=require(_0x774d('0x12'));var config=require(_0x774d('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x774d('0x14'))['db'];config[_0x774d('0x15')]=_[_0x774d('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x774d('0x17'))(new Redis(config[_0x774d('0x15')]));require(_0x774d('0x18'))[_0x774d('0x19')](socket);function respondWithStatusCode(_0x5e9646,_0x12db55){_0x12db55=_0x12db55||0xcc;return function(_0x2a18d9){if(_0x2a18d9){return _0x5e9646[_0x774d('0x1a')](_0x12db55);}return _0x5e9646[_0x774d('0x1b')](_0x12db55)['end']();};}function respondWithResult(_0x1344b0,_0x47ac8a){_0x47ac8a=_0x47ac8a||0xc8;return function(_0x4e6e82){if(_0x4e6e82){return _0x1344b0[_0x774d('0x1b')](_0x47ac8a)[_0x774d('0x1c')](_0x4e6e82);}};}function respondWithFilteredResult(_0x33b1c3,_0x41930c){return function(_0xf29a92){if(_0xf29a92){var _0x251e1d=typeof _0x41930c[_0x774d('0x1d')]===_0x774d('0x1e')&&typeof _0x41930c[_0x774d('0x1f')]==='undefined';var _0x5d9087=_0xf29a92['count'];var _0x5ed5db=_0x251e1d?0x0:_0x41930c[_0x774d('0x1d')];var _0x5a8d1d=_0x251e1d?_0xf29a92[_0x774d('0x20')]:_0x41930c[_0x774d('0x1d')]+_0x41930c[_0x774d('0x1f')];var _0x130bf1;if(_0x5a8d1d>=_0x5d9087){_0x5a8d1d=_0x5d9087;_0x130bf1=0xc8;}else{_0x130bf1=0xce;}_0x33b1c3[_0x774d('0x1b')](_0x130bf1);return _0x33b1c3[_0x774d('0x21')]('Content-Range',_0x5ed5db+'-'+_0x5a8d1d+'/'+_0x5d9087)['json'](_0xf29a92);}return null;};}function patchUpdates(_0x325795){return function(_0x1d3572){try{jsonpatch['apply'](_0x1d3572,_0x325795,!![]);}catch(_0x1621c8){return BPromise['reject'](_0x1621c8);}return _0x1d3572[_0x774d('0x22')]();};}function saveUpdates(_0x209bee,_0x288c08){return function(_0x70fb98){if(_0x70fb98){return _0x70fb98[_0x774d('0x23')](_0x209bee)[_0x774d('0x24')](function(_0xbf15df){return _0xbf15df;});}return null;};}function removeEntity(_0x3c941f,_0xb4821d){return function(_0x25b947){if(_0x25b947){return _0x25b947[_0x774d('0x25')]()[_0x774d('0x24')](function(){var _0x3144e5=_0x25b947['get']({'plain':!![]});var _0x53740e='FaxQueues';return db[_0x774d('0x26')][_0x774d('0x25')]({'where':{'type':_0x53740e,'resourceId':_0x3144e5['id']}})[_0x774d('0x24')](function(){return _0x25b947;});})[_0x774d('0x24')](function(){_0x3c941f[_0x774d('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2fceb4,_0x12e749){return function(_0x679586){if(!_0x679586){_0x2fceb4[_0x774d('0x1a')](0x194);}return _0x679586;};}function handleError(_0x54b613,_0x10a435){_0x10a435=_0x10a435||0x1f4;return function(_0x425c54){logger[_0x774d('0x27')](_0x425c54['stack']);if(_0x425c54[_0x774d('0x28')]){delete _0x425c54[_0x774d('0x28')];}_0x54b613['status'](_0x10a435)[_0x774d('0x29')](_0x425c54);};}exports[_0x774d('0x2a')]=function(_0xed8125,_0x3f4fee){var _0x36c507={},_0x5c7594={},_0x57c76c={'count':0x0,'rows':[]};var _0x520fba=_['map'](db[_0x774d('0x2b')]['rawAttributes'],function(_0x132dbd){return{'name':_0x132dbd[_0x774d('0x2c')],'type':_0x132dbd[_0x774d('0x2d')]['key']};});_0x5c7594[_0x774d('0x2e')]=_[_0x774d('0x2f')](_0x520fba,'name');_0x5c7594['query']=_[_0x774d('0x30')](_0xed8125[_0x774d('0x31')]);_0x5c7594['filters']=_[_0x774d('0x32')](_0x5c7594[_0x774d('0x2e')],_0x5c7594['query']);_0x36c507[_0x774d('0x33')]=_[_0x774d('0x32')](_0x5c7594[_0x774d('0x2e')],qs[_0x774d('0x34')](_0xed8125['query'][_0x774d('0x34')]));_0x36c507[_0x774d('0x33')]=_0x36c507[_0x774d('0x33')][_0x774d('0x35')]?_0x36c507['attributes']:_0x5c7594[_0x774d('0x2e')];if(!_0xed8125[_0x774d('0x31')][_0x774d('0x36')](_0x774d('0x37'))){_0x36c507[_0x774d('0x1f')]=qs[_0x774d('0x1f')](_0xed8125['query'][_0x774d('0x1f')]);_0x36c507[_0x774d('0x1d')]=qs[_0x774d('0x1d')](_0xed8125[_0x774d('0x31')]['offset']);}_0x36c507[_0x774d('0x38')]=qs[_0x774d('0x39')](_0xed8125[_0x774d('0x31')]['sort']);_0x36c507[_0x774d('0x3a')]=qs['filters'](_['pick'](_0xed8125[_0x774d('0x31')],_0x5c7594['filters']),_0x520fba);if(_0xed8125['query'][_0x774d('0x3b')]){_0x36c507['where']=_[_0x774d('0x3c')](_0x36c507[_0x774d('0x3a')],{'$or':_[_0x774d('0x2f')](_0x520fba,function(_0x3799ee){if(_0x3799ee[_0x774d('0x2d')]!==_0x774d('0x3d')){var _0x920c2e={};_0x920c2e[_0x3799ee['name']]={'$like':'%'+_0xed8125[_0x774d('0x31')][_0x774d('0x3b')]+'%'};return _0x920c2e;}})});}_0x36c507=_[_0x774d('0x3c')]({},_0x36c507,_0xed8125[_0x774d('0x3e')]);var _0x2d6b5d={'where':_0x36c507[_0x774d('0x3a')]};return db['FaxQueue'][_0x774d('0x20')](_0x2d6b5d)[_0x774d('0x24')](function(_0x468f1a){_0x57c76c[_0x774d('0x20')]=_0x468f1a;if(_0xed8125['query'][_0x774d('0x3f')]){_0x36c507[_0x774d('0x40')]=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x36c507);})[_0x774d('0x24')](function(_0x22f14f){_0x57c76c[_0x774d('0x41')]=_0x22f14f;return _0x57c76c;})[_0x774d('0x24')](respondWithFilteredResult(_0x3f4fee,_0x36c507))[_0x774d('0x42')](handleError(_0x3f4fee,null));};exports[_0x774d('0x43')]=function(_0x57f859,_0xa24b2f){var _0x359e68={'raw':!![],'where':{'id':_0x57f859['params']['id']}},_0x629c37={};_0x629c37[_0x774d('0x2e')]=_[_0x774d('0x30')](db['FaxQueue'][_0x774d('0x44')]);_0x629c37[_0x774d('0x31')]=_[_0x774d('0x30')](_0x57f859[_0x774d('0x31')]);_0x629c37[_0x774d('0x45')]=_[_0x774d('0x32')](_0x629c37['model'],_0x629c37[_0x774d('0x31')]);_0x359e68[_0x774d('0x33')]=_['intersection'](_0x629c37[_0x774d('0x2e')],qs[_0x774d('0x34')](_0x57f859[_0x774d('0x31')]['fields']));_0x359e68['attributes']=_0x359e68[_0x774d('0x33')][_0x774d('0x35')]?_0x359e68[_0x774d('0x33')]:_0x629c37[_0x774d('0x2e')];if(_0x57f859['query'][_0x774d('0x3f')]){_0x359e68[_0x774d('0x40')]=[{'all':!![]}];}_0x359e68=_[_0x774d('0x3c')]({},_0x359e68,_0x57f859[_0x774d('0x3e')]);return db[_0x774d('0x2b')][_0x774d('0x46')](_0x359e68)['then'](handleEntityNotFound(_0xa24b2f,null))['then'](respondWithResult(_0xa24b2f,null))[_0x774d('0x42')](handleError(_0xa24b2f,null));};exports[_0x774d('0x47')]=function(_0x26b7f0,_0x31071b){return db[_0x774d('0x2b')][_0x774d('0x47')](_0x26b7f0[_0x774d('0x48')],{})[_0x774d('0x24')](function(_0xb82c01){var _0x4779cb=_0x26b7f0['user'][_0x774d('0x49')]({'plain':!![]});if(!_0x4779cb)throw new Error(_0x774d('0x4a'));if(_0x4779cb['role']===_0x774d('0x4b')){var _0x5e730a=_0xb82c01[_0x774d('0x49')]({'plain':!![]});var _0x19d557='FaxQueues';return db[_0x774d('0x4c')][_0x774d('0x46')]({'where':{'name':_0x19d557,'userProfileId':_0x4779cb['userProfileId']},'raw':!![]})[_0x774d('0x24')](function(_0x9d4d5a){if(_0x9d4d5a&&_0x9d4d5a[_0x774d('0x4d')]===0x0){return db[_0x774d('0x26')]['create']({'name':_0x5e730a[_0x774d('0x28')],'resourceId':_0x5e730a['id'],'type':_0x9d4d5a['name'],'sectionId':_0x9d4d5a['id']},{})[_0x774d('0x24')](function(){return _0xb82c01;});}else{return _0xb82c01;}})['catch'](function(_0x352553){logger[_0x774d('0x27')](_0x774d('0x4e'),_0x352553);throw _0x352553;});}return _0xb82c01;})[_0x774d('0x24')](respondWithResult(_0x31071b,0xc9))['catch'](handleError(_0x31071b,null));};exports[_0x774d('0x23')]=function(_0x514ac4,_0x13ea20){if(_0x514ac4[_0x774d('0x48')]['id']){delete _0x514ac4[_0x774d('0x48')]['id'];}return db[_0x774d('0x2b')][_0x774d('0x46')]({'where':{'id':_0x514ac4[_0x774d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x13ea20,null))[_0x774d('0x24')](saveUpdates(_0x514ac4[_0x774d('0x48')],null))[_0x774d('0x24')](respondWithResult(_0x13ea20,null))[_0x774d('0x42')](handleError(_0x13ea20,null));};exports[_0x774d('0x25')]=function(_0x458ba4,_0x667d9){return db['FaxQueue'][_0x774d('0x46')]({'where':{'id':_0x458ba4[_0x774d('0x4f')]['id']}})[_0x774d('0x24')](handleEntityNotFound(_0x667d9,null))[_0x774d('0x24')](removeEntity(_0x667d9,null))[_0x774d('0x42')](handleError(_0x667d9,null));};exports[_0x774d('0x50')]=function(_0x127330,_0x24391a){return db[_0x774d('0x2b')]['describe']()[_0x774d('0x24')](respondWithResult(_0x24391a,null))[_0x774d('0x42')](handleError(_0x24391a,null));};exports[_0x774d('0x51')]=function(_0x12fc8d,_0x2c11b4,_0xcaedae){var _0x19e61f={'raw':!![],'where':{}},_0x377fbf={},_0x3cd6f0;return db[_0x774d('0x2b')][_0x774d('0x52')]({'where':{'id':_0x12fc8d[_0x774d('0x4f')]['id']}})[_0x774d('0x24')](handleEntityNotFound(_0x2c11b4,null))[_0x774d('0x24')](function(_0x374b1c){if(_0x374b1c){_0x3cd6f0=_0x374b1c[_0x774d('0x49')]({'plain':!![]});_0x377fbf[_0x774d('0x2e')]=_[_0x774d('0x30')](db[_0x774d('0x53')][_0x774d('0x44')]);_0x377fbf['query']=_[_0x774d('0x30')](_0x12fc8d['query']);_0x377fbf[_0x774d('0x45')]=_['intersection'](_0x377fbf[_0x774d('0x2e')],_0x377fbf[_0x774d('0x31')]);_0x19e61f[_0x774d('0x33')]=_[_0x774d('0x32')](_0x377fbf[_0x774d('0x2e')],qs[_0x774d('0x34')](_0x12fc8d[_0x774d('0x31')][_0x774d('0x34')]));_0x19e61f['attributes']=_0x19e61f[_0x774d('0x33')]['length']?_0x19e61f[_0x774d('0x33')]:_0x377fbf[_0x774d('0x2e')];if(!_0x12fc8d['query'][_0x774d('0x36')](_0x774d('0x37'))){_0x19e61f[_0x774d('0x1f')]=qs[_0x774d('0x1f')](_0x12fc8d[_0x774d('0x31')]['limit']);_0x19e61f[_0x774d('0x1d')]=qs[_0x774d('0x1d')](_0x12fc8d['query']['offset']);}_0x19e61f[_0x774d('0x38')]=qs[_0x774d('0x39')](_0x12fc8d[_0x774d('0x31')][_0x774d('0x39')]);_0x19e61f[_0x774d('0x3a')]=qs[_0x774d('0x45')](_[_0x774d('0x54')](_0x12fc8d[_0x774d('0x31')],_0x377fbf[_0x774d('0x45')]));_0x19e61f[_0x774d('0x3a')]['FaxQueueId']=_0x374b1c['id'];if(_0x12fc8d[_0x774d('0x31')][_0x774d('0x3b')]){_0x19e61f[_0x774d('0x3a')]=_[_0x774d('0x3c')](_0x19e61f['where'],{'$or':_['map'](_0x19e61f[_0x774d('0x33')],function(_0x496a3b){var _0x3d7e8a={};_0x3d7e8a[_0x496a3b]={'$like':'%'+_0x12fc8d['query'][_0x774d('0x3b')]+'%'};return _0x3d7e8a;})});}_0x19e61f=_[_0x774d('0x3c')]({},_0x19e61f,_0x12fc8d['options']);return db[_0x774d('0x53')]['findAll'](_0x19e61f);}})[_0x774d('0x24')](function(_0x5e746d){if(_0x5e746d){return db['User'][_0x774d('0x55')]({'where':{'id':_[_0x774d('0x2f')](_0x5e746d,'UserId'),'role':_0x774d('0x56')},'attributes':['id',_0x774d('0x28'),_0x774d('0x57'),_0x774d('0x58'),_0x774d('0x59')]});}})[_0x774d('0x24')](function(_0x4f0bfb){if(_0x4f0bfb){return{'count':_0x4f0bfb[_0x774d('0x20')],'rows':_['map'](_0x4f0bfb[_0x774d('0x41')],function(_0x2e8f0c){return{'membername':_0x2e8f0c[_0x774d('0x28')],'UserId':_0x2e8f0c['id'],'queue_name':_0x3cd6f0[_0x774d('0x28')],'FaxQueueId':_0x3cd6f0['id'],'interface':util[_0x774d('0x5a')](_0x774d('0x5b'),_0x774d('0x5c'),_0x2e8f0c['name']),'penalty':0x0,'paused':_0x2e8f0c[_0x774d('0x57')],'createdAt':_0x2e8f0c[_0x774d('0x59')],'updatedAt':_0x2e8f0c[_0x774d('0x58')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x774d('0x24')](respondWithFilteredResult(_0x2c11b4,_0x19e61f))[_0x774d('0x42')](handleError(_0x2c11b4,null));};exports[_0x774d('0x5d')]=function(_0x37c760,_0x171910,_0x12eb4a){var _0x38deef={};var _0x4f0092={};var _0x2ffabb;var _0x4afca6;return db[_0x774d('0x2b')][_0x774d('0x52')]({'where':{'id':_0x37c760['params']['id']}})[_0x774d('0x24')](handleEntityNotFound(_0x171910,null))['then'](function(_0x56aa49){if(_0x56aa49){_0x2ffabb=_0x56aa49;_0x4f0092[_0x774d('0x2e')]=_[_0x774d('0x30')](db['Team'][_0x774d('0x44')]);_0x4f0092[_0x774d('0x31')]=_[_0x774d('0x30')](_0x37c760[_0x774d('0x31')]);_0x4f0092[_0x774d('0x45')]=_[_0x774d('0x32')](_0x4f0092[_0x774d('0x2e')],_0x4f0092[_0x774d('0x31')]);_0x38deef[_0x774d('0x33')]=_[_0x774d('0x32')](_0x4f0092[_0x774d('0x2e')],qs[_0x774d('0x34')](_0x37c760[_0x774d('0x31')]['fields']));_0x38deef['attributes']=_0x38deef[_0x774d('0x33')][_0x774d('0x35')]?_0x38deef[_0x774d('0x33')]:_0x4f0092[_0x774d('0x2e')];_0x38deef[_0x774d('0x38')]=qs[_0x774d('0x39')](_0x37c760[_0x774d('0x31')][_0x774d('0x39')]);_0x38deef['where']=qs[_0x774d('0x45')](_[_0x774d('0x54')](_0x37c760[_0x774d('0x31')],_0x4f0092[_0x774d('0x45')]));if(_0x37c760[_0x774d('0x31')][_0x774d('0x3b')]){_0x38deef['where']=_['merge'](_0x38deef[_0x774d('0x3a')],{'$or':_[_0x774d('0x2f')](_0x38deef[_0x774d('0x33')],function(_0x419379){var _0x4b318d={};_0x4b318d[_0x419379]={'$like':'%'+_0x37c760[_0x774d('0x31')][_0x774d('0x3b')]+'%'};return _0x4b318d;})});}_0x38deef=_[_0x774d('0x3c')]({},_0x38deef,_0x37c760[_0x774d('0x3e')]);return _0x2ffabb['getTeams'](_0x38deef);}})[_0x774d('0x24')](function(_0x37dd53){if(_0x37dd53){_0x4afca6=_0x37dd53[_0x774d('0x35')];if(!_0x37c760['query']['hasOwnProperty']('nolimit')){_0x38deef[_0x774d('0x1f')]=qs[_0x774d('0x1f')](_0x37c760[_0x774d('0x31')]['limit']);_0x38deef[_0x774d('0x1d')]=qs[_0x774d('0x1d')](_0x37c760[_0x774d('0x31')][_0x774d('0x1d')]);}return _0x2ffabb[_0x774d('0x5d')](_0x38deef);}})['then'](function(_0x333b7c){if(_0x333b7c){return _0x333b7c?{'count':_0x4afca6,'rows':_0x333b7c}:null;}})['then'](respondWithResult(_0x171910,null))[_0x774d('0x42')](handleError(_0x171910,null));};exports[_0x774d('0x5e')]=function(_0x43de89,_0x126d43,_0xd4529){var _0xd72fff=_0x43de89[_0x774d('0x48')][_0x774d('0x5f')];return db[_0x774d('0x60')]['findAll']({'where':{'id':_0xd72fff},'attributes':['id'],'include':[{'model':db[_0x774d('0x61')],'as':_0x774d('0x62'),'attributes':['id',_0x774d('0x28'),_0x774d('0x63'),_0x774d('0x64'),'interface'],'raw':!![]}]})[_0x774d('0x24')](function(_0x10c90d){if(_0x10c90d){var _0x3bcf5f=_['flatMap'](_0x10c90d,function(_0x10af18){var _0x123e6b=_0x10af18[_0x774d('0x49')]({'plain':!![]});return _0x123e6b['Agents'];});return db['FaxQueue'][_0x774d('0x46')]({'where':{'id':_0x43de89[_0x774d('0x4f')]['id']}})[_0x774d('0x24')](function(_0x56302c){return db[_0x774d('0x65')]['transaction'](function(_0x479226){return _0x56302c[_0x774d('0x5e')](_0xd72fff,{'transaction':_0x479226})['then'](function(){return BPromise[_0x774d('0x66')](_0x3bcf5f,function(_0x17f22d){return db[_0x774d('0x53')]['findOrCreate']({'where':{'UserId':_0x17f22d['id'],'FaxQueueId':_0x43de89[_0x774d('0x4f')]['id']},'transaction':_0x479226});});})[_0x774d('0x24')](function(){_0x3bcf5f[_0x774d('0x67')](function(_0x2b5128){socket[_0x774d('0x68')]('userFaxQueue:save',{'UserId':_0x2b5128['id'],'FaxQueueId':_0x56302c['id']});});});});});}})['then'](respondWithStatusCode(_0x126d43,null))['catch'](handleError(_0x126d43,null));};exports[_0x774d('0x69')]=function(_0x2f72a3,_0x4cc52b,_0x70246f){return db['Team']['findAll']({'where':{'id':_0x2f72a3['query'][_0x774d('0x5f')]},'attributes':['id'],'include':[{'model':db[_0x774d('0x61')],'as':_0x774d('0x62'),'attributes':['id'],'raw':!![]}]})[_0x774d('0x24')](handleEntityNotFound(_0x4cc52b,null))[_0x774d('0x24')](function(_0x11b6ce){var _0x14d889=_[_0x774d('0x2f')](_0x11b6ce,'id');var _0x45a298=[];var _0x39db26=[];var _0x12f002=squel[_0x774d('0x6a')]();_0x12f002[_0x774d('0x6b')]('tq.TeamId')[_0x774d('0x6c')](_0x774d('0x6d'),'tq')[_0x774d('0x6e')]('user_has_teams','ut',_0x774d('0x6f'))[_0x774d('0x3a')](_0x774d('0x70'),_0x2f72a3['params']['id']);for(var _0x185ebf=0x0;_0x185ebf<_0x11b6ce[_0x774d('0x35')];_0x185ebf+=0x1){let _0x1468d9=_0x11b6ce[_0x185ebf];for(var _0x13dfa0=0x0;_0x13dfa0<_0x1468d9[_0x774d('0x62')][_0x774d('0x35')];_0x13dfa0+=0x1){let _0x5bac59=_0x1468d9['Agents'][_0x13dfa0];var _0x5d55da=_0x12f002[_0x774d('0x71')]();_0x5d55da['where'](_0x774d('0x72'),_0x5bac59['id']);_0x39db26[_0x774d('0x73')](db['sequelize'][_0x774d('0x31')](_0x5d55da[_0x774d('0x74')](),{'type':db['sequelize']['QueryTypes'][_0x774d('0x75')]})[_0x774d('0x24')](function(_0x51951b){if(_0x51951b[_0x774d('0x35')]===0x1){return _0x5bac59['id'];}else{var _0x4b23a4=_[_0x774d('0x76')](_[_0x774d('0x2f')](_0x51951b,_0x774d('0x77')),function(_0x258efd){return _[_0x774d('0x78')](_0x14d889,_0x258efd);});if(_0x4b23a4){return _0x5bac59['id'];}}}));}}return BPromise[_0x774d('0x79')](_0x39db26)['then'](function(_0x8d6691){_0x45a298=_(_0x45a298)[_0x774d('0x7a')](_0x8d6691)[_0x774d('0x7b')]()[_0x774d('0x7c')]();return db[_0x774d('0x2b')]['find']({'where':{'id':_0x2f72a3[_0x774d('0x4f')]['id']}})[_0x774d('0x24')](function(_0x49437a){return db[_0x774d('0x65')][_0x774d('0x7d')](function(_0x2afa66){return _0x49437a[_0x774d('0x69')](_0x2f72a3[_0x774d('0x31')][_0x774d('0x5f')],{'transaction':_0x2afa66})[_0x774d('0x24')](function(){if(!_['isEmpty'](_0x45a298)){return _0x49437a[_0x774d('0x7e')](_0x45a298,{'transaction':_0x2afa66});}})[_0x774d('0x24')](function(){_0x45a298[_0x774d('0x67')](function(_0x358eb7){socket[_0x774d('0x68')](_0x774d('0x7f'),{'UserId':_0x358eb7,'FaxQueueId':_0x49437a['id']});});});});});});})[_0x774d('0x24')](respondWithStatusCode(_0x4cc52b,null))['catch'](handleError(_0x4cc52b,null));};exports[_0x774d('0x80')]=function(_0x25ddf2,_0x15bb0f,_0x439ae7){return db[_0x774d('0x2b')][_0x774d('0x46')]({'where':{'id':_0x25ddf2[_0x774d('0x4f')]['id']}})[_0x774d('0x24')](handleEntityNotFound(_0x15bb0f,null))[_0x774d('0x24')](function(_0x1b1770){if(_0x1b1770){return _0x1b1770[_0x774d('0x80')](_0x25ddf2['body'][_0x774d('0x5f')],_[_0x774d('0x81')](_0x25ddf2[_0x774d('0x48')],['ids','id'])||{})[_0x774d('0x82')](function(_0x266453){for(var _0x5a34a6=0x0;_0x5a34a6<_0x25ddf2[_0x774d('0x48')][_0x774d('0x5f')][_0x774d('0x35')];_0x5a34a6+=0x1){socket[_0x774d('0x68')](_0x774d('0x83'),{'UserId':Number(_0x25ddf2[_0x774d('0x48')][_0x774d('0x5f')][_0x5a34a6]),'FaxQueueId':Number(_0x25ddf2['params']['id'])});}return _0x266453;});}})['then'](respondWithResult(_0x15bb0f,null))[_0x774d('0x42')](handleError(_0x15bb0f,null));};exports[_0x774d('0x7e')]=function(_0x4a8265,_0x14d885,_0x5e104d){return db[_0x774d('0x2b')][_0x774d('0x46')]({'where':{'id':_0x4a8265[_0x774d('0x4f')]['id']}})['then'](handleEntityNotFound(_0x14d885,null))['then'](function(_0x49134b){if(_0x49134b){return _0x49134b['removeAgents'](_0x4a8265[_0x774d('0x31')]['ids'])[_0x774d('0x24')](function(){if(_[_0x774d('0x84')](_0x4a8265[_0x774d('0x31')][_0x774d('0x5f')])){for(var _0x3916d6=0x0;_0x3916d6<_0x4a8265[_0x774d('0x31')][_0x774d('0x5f')][_0x774d('0x35')];_0x3916d6+=0x1){socket[_0x774d('0x68')](_0x774d('0x7f'),{'UserId':Number(_0x4a8265[_0x774d('0x31')]['ids'][_0x3916d6]),'FaxQueueId':Number(_0x4a8265[_0x774d('0x4f')]['id'])});}}else{socket[_0x774d('0x68')](_0x774d('0x7f'),{'UserId':Number(_0x4a8265[_0x774d('0x31')][_0x774d('0x5f')]),'FaxQueueId':Number(_0x4a8265[_0x774d('0x4f')]['id'])});}});}})[_0x774d('0x24')](respondWithStatusCode(_0x14d885,null))[_0x774d('0x42')](handleError(_0x14d885,null));};exports[_0x774d('0x85')]=function(_0x135fe7,_0x288847,_0x58f15e){var _0x25f8c8={};var _0x3d5520={};var _0x35f5dc;var _0x582f85;return db['FaxQueue'][_0x774d('0x52')]({'where':{'id':_0x135fe7[_0x774d('0x4f')]['id']}})[_0x774d('0x24')](handleEntityNotFound(_0x288847,null))[_0x774d('0x24')](function(_0x4ffc5f){if(_0x4ffc5f){_0x35f5dc=_0x4ffc5f;_0x3d5520['model']=_[_0x774d('0x30')](db[_0x774d('0x61')][_0x774d('0x44')]);_0x3d5520[_0x774d('0x31')]=_[_0x774d('0x30')](_0x135fe7['query']);_0x3d5520['filters']=_[_0x774d('0x32')](_0x3d5520[_0x774d('0x2e')],_0x3d5520[_0x774d('0x31')]);_0x25f8c8[_0x774d('0x33')]=_['intersection'](_0x3d5520[_0x774d('0x2e')],qs[_0x774d('0x34')](_0x135fe7['query'][_0x774d('0x34')]));_0x25f8c8['attributes']=_0x25f8c8[_0x774d('0x33')]['length']?_0x25f8c8[_0x774d('0x33')]:_0x3d5520['model'];_0x25f8c8[_0x774d('0x38')]=qs['sort'](_0x135fe7[_0x774d('0x31')][_0x774d('0x39')]);_0x25f8c8['where']=qs['filters'](_['pick'](_0x135fe7[_0x774d('0x31')],_0x3d5520[_0x774d('0x45')]));if(_0x135fe7[_0x774d('0x31')][_0x774d('0x3b')]){_0x25f8c8[_0x774d('0x3a')]=_[_0x774d('0x3c')](_0x25f8c8[_0x774d('0x3a')],{'$or':_[_0x774d('0x2f')](_0x25f8c8['attributes'],function(_0x438025){var _0x2df693={};_0x2df693[_0x438025]={'$like':'%'+_0x135fe7[_0x774d('0x31')][_0x774d('0x3b')]+'%'};return _0x2df693;})});}_0x25f8c8=_['merge']({},_0x25f8c8,_0x135fe7[_0x774d('0x3e')]);return _0x35f5dc[_0x774d('0x85')](_0x25f8c8);}})[_0x774d('0x24')](function(_0x4af7a6){if(_0x4af7a6){_0x582f85=_0x4af7a6[_0x774d('0x35')];if(!_0x135fe7[_0x774d('0x31')][_0x774d('0x36')](_0x774d('0x37'))){_0x25f8c8[_0x774d('0x1f')]=qs[_0x774d('0x1f')](_0x135fe7[_0x774d('0x31')][_0x774d('0x1f')]);_0x25f8c8['offset']=qs[_0x774d('0x1d')](_0x135fe7['query'][_0x774d('0x1d')]);}return _0x35f5dc[_0x774d('0x85')](_0x25f8c8);}})[_0x774d('0x24')](function(_0x51787f){if(_0x51787f){return _0x51787f?{'count':_0x582f85,'rows':_0x51787f}:null;}})[_0x774d('0x24')](respondWithResult(_0x288847,null))[_0x774d('0x42')](handleError(_0x288847,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index c6cb750..9c7f1d2 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 _0x7662=['hook','exports','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x3e27c9,_0x405b8e){var _0x190107=function(_0x4ffbb5){while(--_0x4ffbb5){_0x3e27c9['push'](_0x3e27c9['shift']());}};_0x190107(++_0x405b8e);}(_0x7662,0xde));var _0x2766=function(_0x591a2d,_0x29f758){_0x591a2d=_0x591a2d-0x0;var _0x27cd88=_0x7662[_0x591a2d];return _0x27cd88;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x2766('0x0'))['db'][_0x2766('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x2766('0x2')](0x0);var events={'afterCreate':_0x2766('0x3'),'afterUpdate':_0x2766('0x4'),'afterDestroy':_0x2766('0x5')};function emitEvent(_0x542c6e){return function(_0x343af4,_0x7bad87,_0x1bc69e){FaxQueueEvents[_0x2766('0x6')](_0x542c6e+':'+_0x343af4['id'],_0x343af4);FaxQueueEvents['emit'](_0x542c6e,_0x343af4);_0x1bc69e(null);};}for(var e in events){if(events[_0x2766('0x7')](e)){var event=events[e];FaxQueue[_0x2766('0x8')](e,emitEvent(event));}}module[_0x2766('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0x8d6a=['remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','update'];(function(_0x246a3f,_0x5ec46d){var _0x390359=function(_0x53f8a0){while(--_0x53f8a0){_0x246a3f['push'](_0x246a3f['shift']());}};_0x390359(++_0x5ec46d);}(_0x8d6a,0x125));var _0xa8d6=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x8d6a[_0x30ae5e];return _0x1f2e93;};'use strict';var EventEmitter=require(_0xa8d6('0x0'));var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xa8d6('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa8d6('0x2'),'afterDestroy':_0xa8d6('0x3')};function emitEvent(_0xb6ea5){return function(_0x12f999,_0x13eeed,_0x20e4a5){FaxQueueEvents[_0xa8d6('0x4')](_0xb6ea5+':'+_0x12f999['id'],_0x12f999);FaxQueueEvents['emit'](_0xb6ea5,_0x12f999);_0x20e4a5(null);};}for(var e in events){if(events[_0xa8d6('0x5')](e)){var event=events[e];FaxQueue[_0xa8d6('0x6')](e,emitEvent(event));}}module[_0xa8d6('0x7')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 1ebe0bf..bfb1227 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 _0x3f53=['request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports','fax_queues','lodash','util','api','bluebird'];(function(_0x2f42d3,_0x362e7a){var _0x25a67e=function(_0x103ce2){while(--_0x103ce2){_0x2f42d3['push'](_0x2f42d3['shift']());}};_0x25a67e(++_0x362e7a);}(_0x3f53,0x193));var _0x33f5=function(_0x58dce3,_0x50e978){_0x58dce3=_0x58dce3-0x0;var _0x55794f=_0x3f53[_0x58dce3];return _0x55794f;};'use strict';var _=require(_0x33f5('0x0'));var util=require(_0x33f5('0x1'));var logger=require('../../config/logger')(_0x33f5('0x2'));var moment=require('moment');var BPromise=require(_0x33f5('0x3'));var rp=require(_0x33f5('0x4'));var fs=require('fs');var path=require(_0x33f5('0x5'));var rimraf=require(_0x33f5('0x6'));var config=require(_0x33f5('0x7'));var attributes=require(_0x33f5('0x8'));module[_0x33f5('0x9')]=function(_0x1b3a49,_0x371a2a){return _0x1b3a49['define']('FaxQueue',attributes,{'tableName':_0x33f5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa2ea=['../../config/environment','./faxQueue.attributes','define','fax_queues','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x5a7e78,_0x400b57){var _0xa8d4a1=function(_0x486659){while(--_0x486659){_0x5a7e78['push'](_0x5a7e78['shift']());}};_0xa8d4a1(++_0x400b57);}(_0xa2ea,0xe0));var _0xaa2e=function(_0x32e9e9,_0x3df5aa){_0x32e9e9=_0x32e9e9-0x0;var _0x400b63=_0xa2ea[_0x32e9e9];return _0x400b63;};'use strict';var _=require(_0xaa2e('0x0'));var util=require('util');var logger=require(_0xaa2e('0x1'))(_0xaa2e('0x2'));var moment=require('moment');var BPromise=require(_0xaa2e('0x3'));var rp=require(_0xaa2e('0x4'));var fs=require('fs');var path=require(_0xaa2e('0x5'));var rimraf=require(_0xaa2e('0x6'));var config=require(_0xaa2e('0x7'));var attributes=require(_0xaa2e('0x8'));module['exports']=function(_0x878c96,_0x1f042a){return _0x878c96[_0xaa2e('0x9')]('FaxQueue',attributes,{'tableName':_0xaa2e('0xa'),'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 593a62f..22e7e22 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 _0x1af6=['options','raw','where','attributes','limit','include','map','model','then','catch','ShowFaxQueue','FaxQueue','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','http','redis','defaults','./faxQueue.socket','register','request','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','GetFaxQueue','findAll'];(function(_0x1c367a,_0x4f872b){var _0xc3001f=function(_0x3a53a8){while(--_0x3a53a8){_0x1c367a['push'](_0x1c367a['shift']());}};_0xc3001f(++_0x4f872b);}(_0x1af6,0x108));var _0x61af=function(_0x5c5587,_0x367180){_0x5c5587=_0x5c5587-0x0;var _0x41c868=_0x1af6[_0x5c5587];return _0x41c868;};'use strict';var _=require(_0x61af('0x0'));var util=require(_0x61af('0x1'));var moment=require(_0x61af('0x2'));var BPromise=require(_0x61af('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x61af('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x61af('0x5'))(_0x61af('0x6'));var config=require(_0x61af('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x61af('0x8')]({'port':0x232a});config[_0x61af('0x9')]=_[_0x61af('0xa')](config[_0x61af('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x61af('0x9')]));require(_0x61af('0xb'))[_0x61af('0xc')](socket);function respondWithRpcPromise(_0x4ac6d7,_0x32dc37,_0x228eb6){return new BPromise(function(_0xbdb5d6,_0x195ff2){return client[_0x61af('0xd')](_0x4ac6d7,_0x228eb6)['then'](function(_0x51b327){logger[_0x61af('0xe')](_0x61af('0xf'),_0x32dc37,'request\x20sent');logger[_0x61af('0x10')](_0x61af('0x11'),_0x32dc37,'request\x20sent',JSON[_0x61af('0x12')](_0x51b327));if(_0x51b327[_0x61af('0x13')]){if(_0x51b327[_0x61af('0x13')]['code']===0x1f4){logger[_0x61af('0x13')](_0x61af('0xf'),_0x32dc37,_0x51b327[_0x61af('0x13')]['message']);return _0x195ff2(_0x51b327[_0x61af('0x13')][_0x61af('0x14')]);}logger[_0x61af('0x13')](_0x61af('0xf'),_0x32dc37,_0x51b327[_0x61af('0x13')][_0x61af('0x14')]);return _0xbdb5d6(_0x51b327[_0x61af('0x13')][_0x61af('0x14')]);}else{logger[_0x61af('0xe')](_0x61af('0xf'),_0x32dc37,_0x61af('0x15'));_0xbdb5d6(_0x51b327['result'][_0x61af('0x14')]);}})['catch'](function(_0x3f0c97){logger['error'](_0x61af('0xf'),_0x32dc37,_0x3f0c97);_0x195ff2(_0x3f0c97);});});}exports[_0x61af('0x16')]=function(_0x25e41d){var _0x55f394=this;return new Promise(function(_0x9dfff7,_0x3a8dbb){return db['FaxQueue'][_0x61af('0x17')]({'raw':_0x25e41d[_0x61af('0x18')]?_0x25e41d[_0x61af('0x18')][_0x61af('0x19')]===undefined?!![]:![]:!![],'where':_0x25e41d['options']?_0x25e41d['options'][_0x61af('0x1a')]||null:null,'attributes':_0x25e41d['options']?_0x25e41d['options'][_0x61af('0x1b')]||null:null,'limit':_0x25e41d[_0x61af('0x18')]?_0x25e41d[_0x61af('0x18')][_0x61af('0x1c')]||null:null,'include':_0x25e41d[_0x61af('0x18')]?_0x25e41d[_0x61af('0x18')][_0x61af('0x1d')]?_[_0x61af('0x1e')](_0x25e41d[_0x61af('0x18')]['include'],function(_0x40a1b5){return{'model':db[_0x40a1b5[_0x61af('0x1f')]],'as':_0x40a1b5['as'],'attributes':_0x40a1b5[_0x61af('0x1b')],'include':_0x40a1b5['include']?_[_0x61af('0x1e')](_0x40a1b5[_0x61af('0x1d')],function(_0x110873){return{'model':db[_0x110873[_0x61af('0x1f')]],'as':_0x110873['as'],'attributes':_0x110873['attributes'],'include':_0x110873[_0x61af('0x1d')]?_[_0x61af('0x1e')](_0x110873['include'],function(_0xb4c2c5){return{'model':db[_0xb4c2c5[_0x61af('0x1f')]],'as':_0xb4c2c5['as'],'attributes':_0xb4c2c5[_0x61af('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x61af('0x20')](function(_0x473dc1){logger[_0x61af('0xe')](_0x61af('0x16'),_0x25e41d);logger[_0x61af('0x10')]('GetFaxQueue',_0x25e41d,JSON[_0x61af('0x12')](_0x473dc1));_0x9dfff7(_0x473dc1);})[_0x61af('0x21')](function(_0x38d05e){logger[_0x61af('0x13')](_0x61af('0x16'),_0x38d05e[_0x61af('0x14')],_0x25e41d);_0x3a8dbb(_0x55f394[_0x61af('0x13')](0x1f4,_0x38d05e[_0x61af('0x14')]));});});};exports[_0x61af('0x22')]=function(_0x36e68d){var _0x49f8cf=this;return new Promise(function(_0x16410a,_0x105c3e){return db[_0x61af('0x23')]['find']({'raw':_0x36e68d[_0x61af('0x18')]?_0x36e68d['options'][_0x61af('0x19')]===undefined?!![]:![]:!![],'where':_0x36e68d[_0x61af('0x18')]?_0x36e68d[_0x61af('0x18')][_0x61af('0x1a')]||null:null,'attributes':_0x36e68d[_0x61af('0x18')]?_0x36e68d[_0x61af('0x18')]['attributes']||null:null,'include':_0x36e68d[_0x61af('0x18')]?_0x36e68d[_0x61af('0x18')]['include']?_[_0x61af('0x1e')](_0x36e68d[_0x61af('0x18')]['include'],function(_0x10b7bb){return{'model':db[_0x10b7bb['model']],'as':_0x10b7bb['as'],'attributes':_0x10b7bb['attributes'],'include':_0x10b7bb[_0x61af('0x1d')]?_['map'](_0x10b7bb[_0x61af('0x1d')],function(_0xf08351){return{'model':db[_0xf08351[_0x61af('0x1f')]],'as':_0xf08351['as'],'attributes':_0xf08351[_0x61af('0x1b')],'include':_0xf08351['include']?_[_0x61af('0x1e')](_0xf08351['include'],function(_0x1eaae8){return{'model':db[_0x1eaae8[_0x61af('0x1f')]],'as':_0x1eaae8['as'],'attributes':_0x1eaae8[_0x61af('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x29928a){logger[_0x61af('0xe')](_0x61af('0x22'),_0x36e68d);logger[_0x61af('0x10')](_0x61af('0x22'),_0x36e68d,JSON[_0x61af('0x12')](_0x29928a));_0x16410a(_0x29928a);})['catch'](function(_0xc3b7c9){logger['error']('ShowFaxQueue',_0xc3b7c9[_0x61af('0x14')],_0x36e68d);_0x105c3e(_0x49f8cf[_0x61af('0x13')](0x1f4,_0xc3b7c9['message']));});});}; \ No newline at end of file +var _0x36df=['lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','attributes','limit','include','model','map','ShowFaxQueue','find','raw','where'];(function(_0x44a2b0,_0x5b4baf){var _0x540e75=function(_0x5982f6){while(--_0x5982f6){_0x44a2b0['push'](_0x44a2b0['shift']());}};_0x540e75(++_0x5b4baf);}(_0x36df,0x126));var _0xf36d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x36df[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xf36d('0x0'));var util=require(_0xf36d('0x1'));var moment=require(_0xf36d('0x2'));var BPromise=require(_0xf36d('0x3'));var rs=require(_0xf36d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf36d('0x5'));var logger=require(_0xf36d('0x6'))(_0xf36d('0x7'));var config=require(_0xf36d('0x8'));var jayson=require(_0xf36d('0x9'));var client=jayson[_0xf36d('0xa')][_0xf36d('0xb')]({'port':0x232a});config[_0xf36d('0xc')]=_['defaults'](config['redis'],{'host':_0xf36d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf36d('0xc')]));require(_0xf36d('0xe'))[_0xf36d('0xf')](socket);function respondWithRpcPromise(_0x447e50,_0x5d4229,_0x2babe5){return new BPromise(function(_0x3a19e3,_0x2e2ed5){return client[_0xf36d('0x10')](_0x447e50,_0x2babe5)[_0xf36d('0x11')](function(_0x16d9da){logger[_0xf36d('0x12')](_0xf36d('0x13'),_0x5d4229,_0xf36d('0x14'));logger[_0xf36d('0x15')](_0xf36d('0x16'),_0x5d4229,_0xf36d('0x14'),JSON[_0xf36d('0x17')](_0x16d9da));if(_0x16d9da[_0xf36d('0x18')]){if(_0x16d9da[_0xf36d('0x18')][_0xf36d('0x19')]===0x1f4){logger[_0xf36d('0x18')](_0xf36d('0x13'),_0x5d4229,_0x16d9da[_0xf36d('0x18')][_0xf36d('0x1a')]);return _0x2e2ed5(_0x16d9da[_0xf36d('0x18')][_0xf36d('0x1a')]);}logger['error'](_0xf36d('0x13'),_0x5d4229,_0x16d9da['error'][_0xf36d('0x1a')]);return _0x3a19e3(_0x16d9da[_0xf36d('0x18')][_0xf36d('0x1a')]);}else{logger[_0xf36d('0x12')]('FaxQueue,\x20%s,\x20%s',_0x5d4229,_0xf36d('0x14'));_0x3a19e3(_0x16d9da[_0xf36d('0x1b')][_0xf36d('0x1a')]);}})[_0xf36d('0x1c')](function(_0x373ca9){logger[_0xf36d('0x18')]('FaxQueue,\x20%s,\x20%s',_0x5d4229,_0x373ca9);_0x2e2ed5(_0x373ca9);});});}exports[_0xf36d('0x1d')]=function(_0x2a1763){var _0x40c458=this;return new Promise(function(_0x25f857,_0x4cd77b){return db[_0xf36d('0x1e')][_0xf36d('0x1f')]({'raw':_0x2a1763[_0xf36d('0x20')]?_0x2a1763[_0xf36d('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x2a1763[_0xf36d('0x20')]?_0x2a1763[_0xf36d('0x20')]['where']||null:null,'attributes':_0x2a1763[_0xf36d('0x20')]?_0x2a1763['options'][_0xf36d('0x21')]||null:null,'limit':_0x2a1763[_0xf36d('0x20')]?_0x2a1763['options'][_0xf36d('0x22')]||null:null,'include':_0x2a1763[_0xf36d('0x20')]?_0x2a1763['options'][_0xf36d('0x23')]?_['map'](_0x2a1763[_0xf36d('0x20')]['include'],function(_0x26a7ff){return{'model':db[_0x26a7ff[_0xf36d('0x24')]],'as':_0x26a7ff['as'],'attributes':_0x26a7ff['attributes'],'include':_0x26a7ff[_0xf36d('0x23')]?_[_0xf36d('0x25')](_0x26a7ff[_0xf36d('0x23')],function(_0x1e4f64){return{'model':db[_0x1e4f64[_0xf36d('0x24')]],'as':_0x1e4f64['as'],'attributes':_0x1e4f64[_0xf36d('0x21')],'include':_0x1e4f64[_0xf36d('0x23')]?_[_0xf36d('0x25')](_0x1e4f64['include'],function(_0x3c5701){return{'model':db[_0x3c5701[_0xf36d('0x24')]],'as':_0x3c5701['as'],'attributes':_0x3c5701[_0xf36d('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf36d('0x11')](function(_0x4cec33){logger[_0xf36d('0x12')]('GetFaxQueue',_0x2a1763);logger['debug'](_0xf36d('0x1d'),_0x2a1763,JSON['stringify'](_0x4cec33));_0x25f857(_0x4cec33);})[_0xf36d('0x1c')](function(_0x332e81){logger[_0xf36d('0x18')]('GetFaxQueue',_0x332e81['message'],_0x2a1763);_0x4cd77b(_0x40c458[_0xf36d('0x18')](0x1f4,_0x332e81[_0xf36d('0x1a')]));});});};exports[_0xf36d('0x26')]=function(_0x1c546d){var _0x244ee0=this;return new Promise(function(_0x75d2c,_0x539eaa){return db['FaxQueue'][_0xf36d('0x27')]({'raw':_0x1c546d['options']?_0x1c546d[_0xf36d('0x20')][_0xf36d('0x28')]===undefined?!![]:![]:!![],'where':_0x1c546d[_0xf36d('0x20')]?_0x1c546d[_0xf36d('0x20')][_0xf36d('0x29')]||null:null,'attributes':_0x1c546d[_0xf36d('0x20')]?_0x1c546d['options'][_0xf36d('0x21')]||null:null,'include':_0x1c546d[_0xf36d('0x20')]?_0x1c546d[_0xf36d('0x20')]['include']?_[_0xf36d('0x25')](_0x1c546d[_0xf36d('0x20')]['include'],function(_0x2be65b){return{'model':db[_0x2be65b['model']],'as':_0x2be65b['as'],'attributes':_0x2be65b['attributes'],'include':_0x2be65b[_0xf36d('0x23')]?_[_0xf36d('0x25')](_0x2be65b[_0xf36d('0x23')],function(_0x1c13e6){return{'model':db[_0x1c13e6['model']],'as':_0x1c13e6['as'],'attributes':_0x1c13e6[_0xf36d('0x21')],'include':_0x1c13e6['include']?_[_0xf36d('0x25')](_0x1c13e6['include'],function(_0x13d522){return{'model':db[_0x13d522[_0xf36d('0x24')]],'as':_0x13d522['as'],'attributes':_0x13d522[_0xf36d('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf36d('0x11')](function(_0x184bfa){logger[_0xf36d('0x12')](_0xf36d('0x26'),_0x1c546d);logger[_0xf36d('0x15')](_0xf36d('0x26'),_0x1c546d,JSON[_0xf36d('0x17')](_0x184bfa));_0x75d2c(_0x184bfa);})[_0xf36d('0x1c')](function(_0x3ca540){logger['error'](_0xf36d('0x26'),_0x3ca540[_0xf36d('0x1a')],_0x1c546d);_0x539eaa(_0x244ee0[_0xf36d('0x18')](0x1f4,_0x3ca540[_0xf36d('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 1a55f05..a8eaf3c 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 _0xdc12=['remove','update','emit','removeListener','length','./faxQueue.events','save'];(function(_0x4e9f29,_0x1bbcbf){var _0x8e1ab3=function(_0x4a4e6b){while(--_0x4a4e6b){_0x4e9f29['push'](_0x4e9f29['shift']());}};_0x8e1ab3(++_0x1bbcbf);}(_0xdc12,0x10f));var _0x2dc1=function(_0x1e82cb,_0xd849d0){_0x1e82cb=_0x1e82cb-0x0;var _0x57bbda=_0xdc12[_0x1e82cb];return _0x57bbda;};'use strict';var FaxQueueEvents=require(_0x2dc1('0x0'));var events=[_0x2dc1('0x1'),_0x2dc1('0x2'),_0x2dc1('0x3')];function createListener(_0x2c15fd,_0x1e22a8){return function(_0x4f1ca5){_0x1e22a8[_0x2dc1('0x4')](_0x2c15fd,_0x4f1ca5);};}function removeListener(_0x4caa07,_0x5c4b4e){return function(){FaxQueueEvents[_0x2dc1('0x5')](_0x4caa07,_0x5c4b4e);};}exports['register']=function(_0x526f5c){for(var _0x2296a4=0x0,_0x36751e=events[_0x2dc1('0x6')];_0x2296a4<_0x36751e;_0x2296a4++){var _0x1c2b83=events[_0x2296a4];var _0x1aeb2b=createListener('faxQueue:'+_0x1c2b83,_0x526f5c);FaxQueueEvents['on'](_0x1c2b83,_0x1aeb2b);}}; \ No newline at end of file +var _0x8454=['removeListener','register','length','faxQueue:','./faxQueue.events','save','remove','update'];(function(_0x1a89ca,_0x27394b){var _0x29cbb2=function(_0x31e1f4){while(--_0x31e1f4){_0x1a89ca['push'](_0x1a89ca['shift']());}};_0x29cbb2(++_0x27394b);}(_0x8454,0x1a4));var _0x4845=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x8454[_0x5b644e];return _0x49c6bf;};'use strict';var FaxQueueEvents=require(_0x4845('0x0'));var events=[_0x4845('0x1'),_0x4845('0x2'),_0x4845('0x3')];function createListener(_0x4e41d,_0x242ce6){return function(_0x1b363a){_0x242ce6['emit'](_0x4e41d,_0x1b363a);};}function removeListener(_0x3c7534,_0xcd6cd2){return function(){FaxQueueEvents[_0x4845('0x4')](_0x3c7534,_0xcd6cd2);};}exports[_0x4845('0x5')]=function(_0x5304c9){for(var _0x5425f4=0x0,_0xa91c10=events[_0x4845('0x6')];_0x5425f4<_0xa91c10;_0x5425f4++){var _0x5bf5aa=events[_0x5425f4];var _0x3be9e9=createListener(_0x4845('0x7')+_0x5bf5aa,_0x5304c9);FaxQueueEvents['on'](_0x5bf5aa,_0x3be9e9);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 0670114..e7c0866 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 _0x964b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./faxQueue.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x549d30,_0x2e827c){var _0x46b0f2=function(_0x27e331){while(--_0x27e331){_0x549d30['push'](_0x549d30['shift']());}};_0x46b0f2(++_0x2e827c);}(_0x964b,0x112));var _0xb964=function(_0x147975,_0x41fe99){_0x147975=_0x147975-0x0;var _0x1db28a=_0x964b[_0x147975];return _0x1db28a;};'use strict';var multer=require(_0xb964('0x0'));var util=require(_0xb964('0x1'));var path=require('path');var timeout=require(_0xb964('0x2'));var express=require(_0xb964('0x3'));var router=express[_0xb964('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xb964('0x5'));var config=require('../../config/environment');var controller=require(_0xb964('0x6'));router[_0xb964('0x7')]('/',auth[_0xb964('0x8')](),controller[_0xb964('0x9')]);router[_0xb964('0x7')](_0xb964('0xa'),auth[_0xb964('0x8')](),controller['describe']);router['get'](_0xb964('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xb964('0x7')](_0xb964('0xc'),auth[_0xb964('0x8')](),controller[_0xb964('0xd')]);router[_0xb964('0x7')](_0xb964('0xe'),auth['isAuthenticated'](),controller[_0xb964('0xf')]);router[_0xb964('0x7')](_0xb964('0x10'),auth[_0xb964('0x8')](),controller['getAgents']);router[_0xb964('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb964('0x11')](_0xb964('0xe'),auth[_0xb964('0x8')](),controller[_0xb964('0x12')]);router[_0xb964('0x11')](_0xb964('0x10'),auth[_0xb964('0x8')](),controller['addAgents']);router[_0xb964('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xb964('0x14')]);router[_0xb964('0x15')](_0xb964('0xb'),auth[_0xb964('0x8')](),controller[_0xb964('0x16')]);router[_0xb964('0x15')](_0xb964('0xe'),auth[_0xb964('0x8')](),controller[_0xb964('0x17')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb964('0x18')]);module[_0xb964('0x19')]=router; \ No newline at end of file +var _0xfd2e=['removeAgents','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','index','isAuthenticated','get','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','create','addTeams','post','put','update','delete','removeTeams'];(function(_0x5c2f6a,_0x54c8d4){var _0x39324f=function(_0x4cd4ce){while(--_0x4cd4ce){_0x5c2f6a['push'](_0x5c2f6a['shift']());}};_0x39324f(++_0x54c8d4);}(_0xfd2e,0x6e));var _0xefd2=function(_0xc54b25,_0x79a670){_0xc54b25=_0xc54b25-0x0;var _0x671d7e=_0xfd2e[_0xc54b25];return _0x671d7e;};'use strict';var multer=require(_0xefd2('0x0'));var util=require('util');var path=require(_0xefd2('0x1'));var timeout=require('connect-timeout');var express=require(_0xefd2('0x2'));var router=express['Router']();var fs_extra=require(_0xefd2('0x3'));var auth=require(_0xefd2('0x4'));var interaction=require(_0xefd2('0x5'));var config=require(_0xefd2('0x6'));var controller=require(_0xefd2('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xefd2('0x8')]);router['get']('/describe',auth[_0xefd2('0x9')](),controller['describe']);router[_0xefd2('0xa')](_0xefd2('0xb'),auth[_0xefd2('0x9')](),controller[_0xefd2('0xc')]);router[_0xefd2('0xa')](_0xefd2('0xd'),auth[_0xefd2('0x9')](),controller['getMembers']);router[_0xefd2('0xa')](_0xefd2('0xe'),auth[_0xefd2('0x9')](),controller[_0xefd2('0xf')]);router[_0xefd2('0xa')](_0xefd2('0x10'),auth[_0xefd2('0x9')](),controller[_0xefd2('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0xefd2('0x12')]);router['post']('/:id/teams',auth[_0xefd2('0x9')](),controller[_0xefd2('0x13')]);router[_0xefd2('0x14')](_0xefd2('0x10'),auth[_0xefd2('0x9')](),controller['addAgents']);router[_0xefd2('0x15')](_0xefd2('0xb'),auth[_0xefd2('0x9')](),controller[_0xefd2('0x16')]);router[_0xefd2('0x17')](_0xefd2('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xefd2('0x17')](_0xefd2('0xe'),auth[_0xefd2('0x9')](),controller[_0xefd2('0x18')]);router[_0xefd2('0x17')]('/:id/users',auth[_0xefd2('0x9')](),controller[_0xefd2('0x19')]);module[_0xefd2('0x1a')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 13595a8..c56a137 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 _0x4ee6=['exports','STRING','DATE','moment','sequelize'];(function(_0x130705,_0x2d266b){var _0x1fa991=function(_0x395639){while(--_0x395639){_0x130705['push'](_0x130705['shift']());}};_0x1fa991(++_0x2d266b);}(_0x4ee6,0x193));var _0x64ee=function(_0x2422e5,_0x18fbfa){_0x2422e5=_0x2422e5-0x0;var _0x434454=_0x4ee6[_0x2422e5];return _0x434454;};'use strict';var moment=require(_0x64ee('0x0'));var Sequelize=require(_0x64ee('0x1'));module[_0x64ee('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x64ee('0x3')]},'joinAt':{'type':Sequelize[_0x64ee('0x4')]},'leaveAt':{'type':Sequelize[_0x64ee('0x4')]},'acceptAt':{'type':Sequelize[_0x64ee('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x27f8=['sequelize','exports','STRING','DATE'];(function(_0x5aa8da,_0x4c4700){var _0x43df8a=function(_0x57629e){while(--_0x57629e){_0x5aa8da['push'](_0x5aa8da['shift']());}};_0x43df8a(++_0x4c4700);}(_0x27f8,0x180));var _0x827f=function(_0x4c9f6a,_0xcb2cb2){_0x4c9f6a=_0x4c9f6a-0x0;var _0x5df5b9=_0x27f8[_0x4c9f6a];return _0x5df5b9;};'use strict';var moment=require('moment');var Sequelize=require(_0x827f('0x0'));module[_0x827f('0x1')]={'uniqueid':{'type':Sequelize[_0x827f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x827f('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x827f('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x827f('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 1293623..7558243 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 _0x8ebf=['crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','error','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','options','includeAll','include','model','catch','create','body','update','find','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel'];(function(_0x3c643d,_0xff5bf0){var _0x5e93ff=function(_0x5c53ed){while(--_0x5c53ed){_0x3c643d['push'](_0x3c643d['shift']());}};_0x5e93ff(++_0xff5bf0);}(_0x8ebf,0x15c));var _0xf8eb=function(_0x41d432,_0x20e878){_0x41d432=_0x41d432-0x0;var _0x1650f9=_0x8ebf[_0x41d432];return _0x1650f9;};'use strict';var emlformat=require(_0xf8eb('0x0'));var rimraf=require(_0xf8eb('0x1'));var zipdir=require(_0xf8eb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf8eb('0x3'));var moment=require(_0xf8eb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf8eb('0x5'));var util=require(_0xf8eb('0x6'));var path=require(_0xf8eb('0x7'));var sox=require('sox');var csv=require(_0xf8eb('0x8'));var ejs=require(_0xf8eb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf8eb('0xa'));var squel=require(_0xf8eb('0xb'));var crypto=require(_0xf8eb('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf8eb('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf8eb('0xe'));var Papa=require('papaparse');var Redis=require(_0xf8eb('0xf'));var authService=require(_0xf8eb('0x10'));var qs=require(_0xf8eb('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf8eb('0x12'));var logger=require(_0xf8eb('0x13'))(_0xf8eb('0x14'));var utils=require(_0xf8eb('0x15'));var config=require(_0xf8eb('0x16'));var licenseUtil=require(_0xf8eb('0x17'));var db=require(_0xf8eb('0x18'))['db'];function respondWithStatusCode(_0x253455,_0x4c6109){_0x4c6109=_0x4c6109||0xcc;return function(_0x325dcd){if(_0x325dcd){return _0x253455[_0xf8eb('0x19')](_0x4c6109);}return _0x253455[_0xf8eb('0x1a')](_0x4c6109)[_0xf8eb('0x1b')]();};}function respondWithResult(_0x4bed5d,_0x55ee4b){_0x55ee4b=_0x55ee4b||0xc8;return function(_0x5f24bc){if(_0x5f24bc){return _0x4bed5d['status'](_0x55ee4b)[_0xf8eb('0x1c')](_0x5f24bc);}};}function respondWithFilteredResult(_0x22af2e,_0x48e97f){return function(_0x24277e){if(_0x24277e){var _0x10415f=typeof _0x48e97f[_0xf8eb('0x1d')]==='undefined'&&typeof _0x48e97f[_0xf8eb('0x1e')]===_0xf8eb('0x1f');var _0x2f052d=_0x24277e[_0xf8eb('0x20')];var _0x3038b7=_0x10415f?0x0:_0x48e97f[_0xf8eb('0x1d')];var _0x4b6e70=_0x10415f?_0x24277e['count']:_0x48e97f[_0xf8eb('0x1d')]+_0x48e97f[_0xf8eb('0x1e')];var _0xce86f9;if(_0x4b6e70>=_0x2f052d){_0x4b6e70=_0x2f052d;_0xce86f9=0xc8;}else{_0xce86f9=0xce;}_0x22af2e[_0xf8eb('0x1a')](_0xce86f9);return _0x22af2e[_0xf8eb('0x21')](_0xf8eb('0x22'),_0x3038b7+'-'+_0x4b6e70+'/'+_0x2f052d)[_0xf8eb('0x1c')](_0x24277e);}return null;};}function patchUpdates(_0x139b1d){return function(_0x5a577a){try{jsonpatch[_0xf8eb('0x23')](_0x5a577a,_0x139b1d,!![]);}catch(_0x4b7d89){return BPromise['reject'](_0x4b7d89);}return _0x5a577a[_0xf8eb('0x24')]();};}function saveUpdates(_0x1bf4fc,_0xb9ea72){return function(_0x17a27e){if(_0x17a27e){return _0x17a27e['update'](_0x1bf4fc)[_0xf8eb('0x25')](function(_0x301f40){return _0x301f40;});}return null;};}function removeEntity(_0xd71d3a,_0x3f153f){return function(_0x58f0b3){if(_0x58f0b3){return _0x58f0b3[_0xf8eb('0x26')]()[_0xf8eb('0x25')](function(){_0xd71d3a[_0xf8eb('0x1a')](0xcc)[_0xf8eb('0x1b')]();});}};}function handleEntityNotFound(_0xa208f0,_0x3547ee){return function(_0x2aaeaf){if(!_0x2aaeaf){_0xa208f0[_0xf8eb('0x19')](0x194);}return _0x2aaeaf;};}function handleError(_0x674c51,_0x6164d5){_0x6164d5=_0x6164d5||0x1f4;return function(_0x20738e){logger[_0xf8eb('0x27')](_0x20738e['stack']);if(_0x20738e[_0xf8eb('0x28')]){delete _0x20738e['name'];}_0x674c51[_0xf8eb('0x1a')](_0x6164d5)[_0xf8eb('0x29')](_0x20738e);};}exports[_0xf8eb('0x2a')]=function(_0xa39e74,_0x45348a){var _0x1716db={},_0x5bf35a={},_0x3c8448={'count':0x0,'rows':[]};var _0x3618bb=_[_0xf8eb('0x2b')](db[_0xf8eb('0x2c')][_0xf8eb('0x2d')],function(_0x2951cd){return{'name':_0x2951cd[_0xf8eb('0x2e')],'type':_0x2951cd['type']['key']};});_0x5bf35a['model']=_[_0xf8eb('0x2b')](_0x3618bb,_0xf8eb('0x28'));_0x5bf35a[_0xf8eb('0x2f')]=_[_0xf8eb('0x30')](_0xa39e74['query']);_0x5bf35a[_0xf8eb('0x31')]=_['intersection'](_0x5bf35a['model'],_0x5bf35a['query']);_0x1716db['attributes']=_[_0xf8eb('0x32')](_0x5bf35a['model'],qs[_0xf8eb('0x33')](_0xa39e74[_0xf8eb('0x2f')][_0xf8eb('0x33')]));_0x1716db[_0xf8eb('0x34')]=_0x1716db[_0xf8eb('0x34')][_0xf8eb('0x35')]?_0x1716db[_0xf8eb('0x34')]:_0x5bf35a['model'];if(!_0xa39e74[_0xf8eb('0x2f')][_0xf8eb('0x36')]('nolimit')){_0x1716db[_0xf8eb('0x1e')]=qs['limit'](_0xa39e74[_0xf8eb('0x2f')][_0xf8eb('0x1e')]);_0x1716db[_0xf8eb('0x1d')]=qs['offset'](_0xa39e74[_0xf8eb('0x2f')]['offset']);}_0x1716db['order']=qs[_0xf8eb('0x37')](_0xa39e74[_0xf8eb('0x2f')][_0xf8eb('0x37')]);_0x1716db[_0xf8eb('0x38')]=qs[_0xf8eb('0x31')](_[_0xf8eb('0x39')](_0xa39e74['query'],_0x5bf35a[_0xf8eb('0x31')]),_0x3618bb);if(_0xa39e74['query'][_0xf8eb('0x3a')]){_0x1716db[_0xf8eb('0x38')]=_[_0xf8eb('0x3b')](_0x1716db[_0xf8eb('0x38')],{'$or':_[_0xf8eb('0x2b')](_0x3618bb,function(_0x1b9e5f){if(_0x1b9e5f[_0xf8eb('0x3c')]!=='VIRTUAL'){var _0x31ca46={};_0x31ca46[_0x1b9e5f[_0xf8eb('0x28')]]={'$like':'%'+_0xa39e74[_0xf8eb('0x2f')]['filter']+'%'};return _0x31ca46;}})});}_0x1716db=_['merge']({},_0x1716db,_0xa39e74[_0xf8eb('0x3d')]);var _0x597cfc={'where':_0x1716db[_0xf8eb('0x38')]};return db[_0xf8eb('0x2c')][_0xf8eb('0x20')](_0x597cfc)[_0xf8eb('0x25')](function(_0xeae7b8){_0x3c8448[_0xf8eb('0x20')]=_0xeae7b8;if(_0xa39e74[_0xf8eb('0x2f')][_0xf8eb('0x3e')]){_0x1716db[_0xf8eb('0x3f')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0x1716db);})[_0xf8eb('0x25')](function(_0x4cc676){_0x3c8448['rows']=_0x4cc676;return _0x3c8448;})[_0xf8eb('0x25')](respondWithFilteredResult(_0x45348a,_0x1716db))['catch'](handleError(_0x45348a,null));};exports['show']=function(_0x469ec0,_0x418610){var _0xe6d395={'raw':!![],'where':{'id':_0x469ec0['params']['id']}},_0x4abd69={};_0x4abd69['model']=_['keys'](db['FaxQueueReport'][_0xf8eb('0x2d')]);_0x4abd69[_0xf8eb('0x2f')]=_[_0xf8eb('0x30')](_0x469ec0[_0xf8eb('0x2f')]);_0x4abd69[_0xf8eb('0x31')]=_['intersection'](_0x4abd69[_0xf8eb('0x40')],_0x4abd69[_0xf8eb('0x2f')]);_0xe6d395[_0xf8eb('0x34')]=_[_0xf8eb('0x32')](_0x4abd69[_0xf8eb('0x40')],qs[_0xf8eb('0x33')](_0x469ec0[_0xf8eb('0x2f')][_0xf8eb('0x33')]));_0xe6d395[_0xf8eb('0x34')]=_0xe6d395[_0xf8eb('0x34')]['length']?_0xe6d395[_0xf8eb('0x34')]:_0x4abd69['model'];if(_0x469ec0['query'][_0xf8eb('0x3e')]){_0xe6d395[_0xf8eb('0x3f')]=[{'all':!![]}];}_0xe6d395=_[_0xf8eb('0x3b')]({},_0xe6d395,_0x469ec0[_0xf8eb('0x3d')]);return db[_0xf8eb('0x2c')]['find'](_0xe6d395)['then'](handleEntityNotFound(_0x418610,null))[_0xf8eb('0x25')](respondWithResult(_0x418610,null))[_0xf8eb('0x41')](handleError(_0x418610,null));};exports['create']=function(_0x354c2d,_0x1b313b){return db[_0xf8eb('0x2c')][_0xf8eb('0x42')](_0x354c2d[_0xf8eb('0x43')],{})[_0xf8eb('0x25')](respondWithResult(_0x1b313b,0xc9))['catch'](handleError(_0x1b313b,null));};exports[_0xf8eb('0x44')]=function(_0x4023f8,_0x5e9502){if(_0x4023f8[_0xf8eb('0x43')]['id']){delete _0x4023f8[_0xf8eb('0x43')]['id'];}return db[_0xf8eb('0x2c')][_0xf8eb('0x45')]({'where':{'id':_0x4023f8[_0xf8eb('0x46')]['id']}})['then'](handleEntityNotFound(_0x5e9502,null))['then'](saveUpdates(_0x4023f8[_0xf8eb('0x43')],null))[_0xf8eb('0x25')](respondWithResult(_0x5e9502,null))[_0xf8eb('0x41')](handleError(_0x5e9502,null));};exports[_0xf8eb('0x26')]=function(_0x3589e3,_0x1fce7d){return db['FaxQueueReport'][_0xf8eb('0x45')]({'where':{'id':_0x3589e3[_0xf8eb('0x46')]['id']}})[_0xf8eb('0x25')](handleEntityNotFound(_0x1fce7d,null))[_0xf8eb('0x25')](removeEntity(_0x1fce7d,null))[_0xf8eb('0x41')](handleError(_0x1fce7d,null));};exports[_0xf8eb('0x47')]=function(_0x393138,_0x53f0fc){return db[_0xf8eb('0x2c')]['describe']()[_0xf8eb('0x25')](respondWithResult(_0x53f0fc,null))[_0xf8eb('0x41')](handleError(_0x53f0fc,null));}; \ No newline at end of file +var _0x682e=['intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','name','options','includeAll','include','show','params','keys','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','count','offset','apply','reject','save','update','then','error','stack','send','map','FaxQueueReport','rawAttributes','type','key','model','query','filters'];(function(_0x5cc51f,_0x22c480){var _0x315a2f=function(_0x4f93bd){while(--_0x4f93bd){_0x5cc51f['push'](_0x5cc51f['shift']());}};_0x315a2f(++_0x22c480);}(_0x682e,0x1ce));var _0xe682=function(_0x1f704b,_0x21dc03){_0x1f704b=_0x1f704b-0x0;var _0x5560ef=_0x682e[_0x1f704b];return _0x5560ef;};'use strict';var emlformat=require(_0xe682('0x0'));var rimraf=require(_0xe682('0x1'));var zipdir=require(_0xe682('0x2'));var jsonpatch=require(_0xe682('0x3'));var rp=require(_0xe682('0x4'));var moment=require(_0xe682('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe682('0x6'));var util=require(_0xe682('0x7'));var path=require(_0xe682('0x8'));var sox=require(_0xe682('0x9'));var csv=require(_0xe682('0xa'));var ejs=require(_0xe682('0xb'));var fs=require('fs');var fs_extra=require(_0xe682('0xc'));var _=require(_0xe682('0xd'));var squel=require(_0xe682('0xe'));var crypto=require(_0xe682('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xe682('0x10'));var toCsv=require(_0xe682('0xa'));var querystring=require(_0xe682('0x11'));var Papa=require(_0xe682('0x12'));var Redis=require(_0xe682('0x13'));var authService=require(_0xe682('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe682('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe682('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xe682('0x17'));var licenseUtil=require(_0xe682('0x18'));var db=require(_0xe682('0x19'))['db'];function respondWithStatusCode(_0x178861,_0x9d0c78){_0x9d0c78=_0x9d0c78||0xcc;return function(_0x27ead7){if(_0x27ead7){return _0x178861['sendStatus'](_0x9d0c78);}return _0x178861[_0xe682('0x1a')](_0x9d0c78)[_0xe682('0x1b')]();};}function respondWithResult(_0x1e4755,_0x32b45a){_0x32b45a=_0x32b45a||0xc8;return function(_0x29ec5a){if(_0x29ec5a){return _0x1e4755[_0xe682('0x1a')](_0x32b45a)[_0xe682('0x1c')](_0x29ec5a);}};}function respondWithFilteredResult(_0x30da5d,_0x5940b8){return function(_0x2de4e8){if(_0x2de4e8){var _0x5e29bd=typeof _0x5940b8['offset']==='undefined'&&typeof _0x5940b8[_0xe682('0x1d')]===_0xe682('0x1e');var _0xeae968=_0x2de4e8[_0xe682('0x1f')];var _0x51166c=_0x5e29bd?0x0:_0x5940b8[_0xe682('0x20')];var _0x596ca3=_0x5e29bd?_0x2de4e8[_0xe682('0x1f')]:_0x5940b8['offset']+_0x5940b8[_0xe682('0x1d')];var _0x5a2b51;if(_0x596ca3>=_0xeae968){_0x596ca3=_0xeae968;_0x5a2b51=0xc8;}else{_0x5a2b51=0xce;}_0x30da5d[_0xe682('0x1a')](_0x5a2b51);return _0x30da5d['set']('Content-Range',_0x51166c+'-'+_0x596ca3+'/'+_0xeae968)[_0xe682('0x1c')](_0x2de4e8);}return null;};}function patchUpdates(_0x5ebf37){return function(_0x36c7e0){try{jsonpatch[_0xe682('0x21')](_0x36c7e0,_0x5ebf37,!![]);}catch(_0x3c8f12){return BPromise[_0xe682('0x22')](_0x3c8f12);}return _0x36c7e0[_0xe682('0x23')]();};}function saveUpdates(_0x16fbfe,_0x227139){return function(_0x220eb3){if(_0x220eb3){return _0x220eb3[_0xe682('0x24')](_0x16fbfe)[_0xe682('0x25')](function(_0x1f8757){return _0x1f8757;});}return null;};}function removeEntity(_0x3e9018,_0x46402f){return function(_0x5bfb75){if(_0x5bfb75){return _0x5bfb75['destroy']()[_0xe682('0x25')](function(){_0x3e9018[_0xe682('0x1a')](0xcc)[_0xe682('0x1b')]();});}};}function handleEntityNotFound(_0x4d1502,_0xd0e3c0){return function(_0x4a3835){if(!_0x4a3835){_0x4d1502['sendStatus'](0x194);}return _0x4a3835;};}function handleError(_0x2164dc,_0x108a09){_0x108a09=_0x108a09||0x1f4;return function(_0x422539){logger[_0xe682('0x26')](_0x422539[_0xe682('0x27')]);if(_0x422539['name']){delete _0x422539['name'];}_0x2164dc['status'](_0x108a09)[_0xe682('0x28')](_0x422539);};}exports['index']=function(_0x57f872,_0x3bfd56){var _0x5a2a13={},_0x263154={},_0x5d6802={'count':0x0,'rows':[]};var _0x480a3d=_[_0xe682('0x29')](db[_0xe682('0x2a')][_0xe682('0x2b')],function(_0x3d5b9b){return{'name':_0x3d5b9b['fieldName'],'type':_0x3d5b9b[_0xe682('0x2c')][_0xe682('0x2d')]};});_0x263154[_0xe682('0x2e')]=_[_0xe682('0x29')](_0x480a3d,'name');_0x263154[_0xe682('0x2f')]=_['keys'](_0x57f872[_0xe682('0x2f')]);_0x263154[_0xe682('0x30')]=_['intersection'](_0x263154[_0xe682('0x2e')],_0x263154[_0xe682('0x2f')]);_0x5a2a13['attributes']=_[_0xe682('0x31')](_0x263154[_0xe682('0x2e')],qs[_0xe682('0x32')](_0x57f872[_0xe682('0x2f')][_0xe682('0x32')]));_0x5a2a13['attributes']=_0x5a2a13[_0xe682('0x33')][_0xe682('0x34')]?_0x5a2a13[_0xe682('0x33')]:_0x263154['model'];if(!_0x57f872[_0xe682('0x2f')][_0xe682('0x35')]('nolimit')){_0x5a2a13[_0xe682('0x1d')]=qs[_0xe682('0x1d')](_0x57f872['query'][_0xe682('0x1d')]);_0x5a2a13[_0xe682('0x20')]=qs[_0xe682('0x20')](_0x57f872[_0xe682('0x2f')]['offset']);}_0x5a2a13[_0xe682('0x36')]=qs[_0xe682('0x37')](_0x57f872[_0xe682('0x2f')][_0xe682('0x37')]);_0x5a2a13[_0xe682('0x38')]=qs[_0xe682('0x30')](_[_0xe682('0x39')](_0x57f872[_0xe682('0x2f')],_0x263154[_0xe682('0x30')]),_0x480a3d);if(_0x57f872[_0xe682('0x2f')][_0xe682('0x3a')]){_0x5a2a13[_0xe682('0x38')]=_[_0xe682('0x3b')](_0x5a2a13[_0xe682('0x38')],{'$or':_[_0xe682('0x29')](_0x480a3d,function(_0x553999){if(_0x553999['type']!==_0xe682('0x3c')){var _0x36e66f={};_0x36e66f[_0x553999[_0xe682('0x3d')]]={'$like':'%'+_0x57f872[_0xe682('0x2f')][_0xe682('0x3a')]+'%'};return _0x36e66f;}})});}_0x5a2a13=_[_0xe682('0x3b')]({},_0x5a2a13,_0x57f872[_0xe682('0x3e')]);var _0x2d6ae6={'where':_0x5a2a13[_0xe682('0x38')]};return db[_0xe682('0x2a')][_0xe682('0x1f')](_0x2d6ae6)[_0xe682('0x25')](function(_0x541292){_0x5d6802['count']=_0x541292;if(_0x57f872[_0xe682('0x2f')][_0xe682('0x3f')]){_0x5a2a13[_0xe682('0x40')]=[{'all':!![]}];}return db['FaxQueueReport']['findAll'](_0x5a2a13);})[_0xe682('0x25')](function(_0x5aaa0f){_0x5d6802['rows']=_0x5aaa0f;return _0x5d6802;})['then'](respondWithFilteredResult(_0x3bfd56,_0x5a2a13))['catch'](handleError(_0x3bfd56,null));};exports[_0xe682('0x41')]=function(_0x8b03c7,_0x35c4c1){var _0x1cd700={'raw':!![],'where':{'id':_0x8b03c7[_0xe682('0x42')]['id']}},_0xc220b4={};_0xc220b4[_0xe682('0x2e')]=_[_0xe682('0x43')](db[_0xe682('0x2a')][_0xe682('0x2b')]);_0xc220b4['query']=_[_0xe682('0x43')](_0x8b03c7['query']);_0xc220b4[_0xe682('0x30')]=_[_0xe682('0x31')](_0xc220b4[_0xe682('0x2e')],_0xc220b4[_0xe682('0x2f')]);_0x1cd700[_0xe682('0x33')]=_[_0xe682('0x31')](_0xc220b4[_0xe682('0x2e')],qs['fields'](_0x8b03c7['query'][_0xe682('0x32')]));_0x1cd700[_0xe682('0x33')]=_0x1cd700[_0xe682('0x33')]['length']?_0x1cd700[_0xe682('0x33')]:_0xc220b4[_0xe682('0x2e')];if(_0x8b03c7[_0xe682('0x2f')][_0xe682('0x3f')]){_0x1cd700[_0xe682('0x40')]=[{'all':!![]}];}_0x1cd700=_[_0xe682('0x3b')]({},_0x1cd700,_0x8b03c7[_0xe682('0x3e')]);return db[_0xe682('0x2a')][_0xe682('0x44')](_0x1cd700)[_0xe682('0x25')](handleEntityNotFound(_0x35c4c1,null))[_0xe682('0x25')](respondWithResult(_0x35c4c1,null))['catch'](handleError(_0x35c4c1,null));};exports[_0xe682('0x45')]=function(_0x51d6d9,_0x5a2753){return db[_0xe682('0x2a')][_0xe682('0x45')](_0x51d6d9[_0xe682('0x46')],{})[_0xe682('0x25')](respondWithResult(_0x5a2753,0xc9))[_0xe682('0x47')](handleError(_0x5a2753,null));};exports['update']=function(_0x52faa4,_0x254b3d){if(_0x52faa4[_0xe682('0x46')]['id']){delete _0x52faa4[_0xe682('0x46')]['id'];}return db[_0xe682('0x2a')][_0xe682('0x44')]({'where':{'id':_0x52faa4[_0xe682('0x42')]['id']}})[_0xe682('0x25')](handleEntityNotFound(_0x254b3d,null))[_0xe682('0x25')](saveUpdates(_0x52faa4[_0xe682('0x46')],null))['then'](respondWithResult(_0x254b3d,null))['catch'](handleError(_0x254b3d,null));};exports['destroy']=function(_0x50656d,_0x18a55e){return db[_0xe682('0x2a')][_0xe682('0x44')]({'where':{'id':_0x50656d[_0xe682('0x42')]['id']}})[_0xe682('0x25')](handleEntityNotFound(_0x18a55e,null))[_0xe682('0x25')](removeEntity(_0x18a55e,null))[_0xe682('0x47')](handleError(_0x18a55e,null));};exports[_0xe682('0x48')]=function(_0xda6157,_0x6a0848){return db[_0xe682('0x2a')][_0xe682('0x48')]()['then'](respondWithResult(_0x6a0848,null))['catch'](handleError(_0x6a0848,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index e67a132..83c46a1 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 _0xe14b=['bluebird','path','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','moment'];(function(_0x1ec620,_0x4c3cac){var _0x4a8711=function(_0x19a9b0){while(--_0x19a9b0){_0x1ec620['push'](_0x1ec620['shift']());}};_0x4a8711(++_0x4c3cac);}(_0xe14b,0x93));var _0xbe14=function(_0x3c3cfe,_0x3d2e5a){_0x3c3cfe=_0x3c3cfe-0x0;var _0x338384=_0xe14b[_0x3c3cfe];return _0x338384;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x226ec4,_0xb65dfe){var _0x3421e2=function(_0x5edfe8){while(--_0x5edfe8){_0x226ec4['push'](_0x226ec4['shift']());}};_0x3421e2(++_0xb65dfe);}(_0x7a54,0x106));var _0x47a5=function(_0x35be33,_0x5d313c){_0x35be33=_0x35be33-0x0;var _0x1c4a81=_0x7a54[_0x35be33];return _0x1c4a81;};'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':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index f48ab9e..b509549 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 _0x4f98=['debug','FaxQueueReport','update','options','where','attributes','limit','UpdateFaxQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/environment','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','body','raw','CreateFaxQueueReport'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x4f98,0x15d));var _0x84f9=function(_0x3c504b,_0x437693){_0x3c504b=_0x3c504b-0x0;var _0x2e5354=_0x4f98[_0x3c504b];return _0x2e5354;};'use strict';var _=require(_0x84f9('0x0'));var util=require(_0x84f9('0x1'));var moment=require(_0x84f9('0x2'));var BPromise=require('bluebird');var rs=require(_0x84f9('0x3'));var fs=require('fs');var Redis=require(_0x84f9('0x4'));var db=require(_0x84f9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x84f9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x84f9('0x7')][_0x84f9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f50b5,_0x35f042,_0x4e529b){return new BPromise(function(_0x303543,_0x141a7f){return client[_0x84f9('0x9')](_0x1f50b5,_0x4e529b)[_0x84f9('0xa')](function(_0x2eed80){logger[_0x84f9('0xb')](_0x84f9('0xc'),_0x35f042,_0x84f9('0xd'));logger['debug']('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x35f042,_0x84f9('0xd'),JSON[_0x84f9('0xe')](_0x2eed80));if(_0x2eed80['error']){if(_0x2eed80[_0x84f9('0xf')][_0x84f9('0x10')]===0x1f4){logger[_0x84f9('0xf')](_0x84f9('0xc'),_0x35f042,_0x2eed80[_0x84f9('0xf')][_0x84f9('0x11')]);return _0x141a7f(_0x2eed80[_0x84f9('0xf')][_0x84f9('0x11')]);}logger['error'](_0x84f9('0xc'),_0x35f042,_0x2eed80['error'][_0x84f9('0x11')]);return _0x303543(_0x2eed80[_0x84f9('0xf')][_0x84f9('0x11')]);}else{logger[_0x84f9('0xb')](_0x84f9('0xc'),_0x35f042,_0x84f9('0xd'));_0x303543(_0x2eed80[_0x84f9('0x12')]['message']);}})[_0x84f9('0x13')](function(_0x19245e){logger[_0x84f9('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x35f042,_0x19245e);_0x141a7f(_0x19245e);});});}exports['CreateFaxQueueReport']=function(_0x192e94){var _0x37d8ef=this;return new Promise(function(_0x371f1f,_0x4858bb){return db['FaxQueueReport']['create'](_0x192e94[_0x84f9('0x14')],{'raw':_0x192e94['options']?_0x192e94['options'][_0x84f9('0x15')]===undefined?!![]:![]:!![]})[_0x84f9('0xa')](function(_0x4a7627){logger[_0x84f9('0xb')](_0x84f9('0x16'),_0x192e94);logger[_0x84f9('0x17')](_0x84f9('0x16'),_0x192e94,JSON[_0x84f9('0xe')](_0x4a7627));_0x371f1f(_0x4a7627);})[_0x84f9('0x13')](function(_0x419ca2){logger['error']('CreateFaxQueueReport',_0x419ca2[_0x84f9('0x11')],_0x192e94);_0x4858bb(_0x37d8ef[_0x84f9('0xf')](0x1f4,_0x419ca2[_0x84f9('0x11')]));});});};exports['UpdateFaxQueueReport']=function(_0x2c165c){var _0x84783d=this;return new Promise(function(_0x210120,_0x3ea33f){return db[_0x84f9('0x18')][_0x84f9('0x19')](_0x2c165c[_0x84f9('0x14')],{'raw':_0x2c165c[_0x84f9('0x1a')]?_0x2c165c[_0x84f9('0x1a')][_0x84f9('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2c165c[_0x84f9('0x1a')]?_0x2c165c[_0x84f9('0x1a')][_0x84f9('0x1b')]||null:null,'attributes':_0x2c165c['options']?_0x2c165c[_0x84f9('0x1a')][_0x84f9('0x1c')]||null:null,'limit':_0x2c165c['options']?_0x2c165c[_0x84f9('0x1a')][_0x84f9('0x1d')]||null:null})[_0x84f9('0xa')](function(_0x22dcc0){logger[_0x84f9('0xb')](_0x84f9('0x1e'),_0x2c165c);logger[_0x84f9('0x17')](_0x84f9('0x1e'),_0x2c165c,JSON['stringify'](_0x22dcc0));_0x210120(_0x22dcc0);})['catch'](function(_0x1508f4){logger['error']('UpdateFaxQueueReport',_0x1508f4[_0x84f9('0x11')],_0x2c165c);_0x3ea33f(_0x84783d['error'](0x1f4,_0x1508f4['message']));});});}; \ No newline at end of file +var _0xad43=['attributes','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','stringify','catch','UpdateFaxQueueReport','update','where'];(function(_0x2cfbef,_0x2d8e4c){var _0x356ae3=function(_0x258749){while(--_0x258749){_0x2cfbef['push'](_0x2cfbef['shift']());}};_0x356ae3(++_0x2d8e4c);}(_0xad43,0x177));var _0x3ad4=function(_0xf73c93,_0x590a0d){_0xf73c93=_0xf73c93-0x0;var _0x81558f=_0xad43[_0xf73c93];return _0x81558f;};'use strict';var _=require(_0x3ad4('0x0'));var util=require(_0x3ad4('0x1'));var moment=require(_0x3ad4('0x2'));var BPromise=require(_0x3ad4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ad4('0x4'))['db'];var utils=require(_0x3ad4('0x5'));var logger=require('../../config/logger')(_0x3ad4('0x6'));var config=require(_0x3ad4('0x7'));var jayson=require(_0x3ad4('0x8'));var client=jayson[_0x3ad4('0x9')][_0x3ad4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2adf11,_0x492846,_0x8575a1){return new BPromise(function(_0x1ba580,_0xfd53e8){return client[_0x3ad4('0xb')](_0x2adf11,_0x8575a1)[_0x3ad4('0xc')](function(_0x1ca42c){logger[_0x3ad4('0xd')]('FaxQueueReport,\x20%s,\x20%s',_0x492846,_0x3ad4('0xe'));logger[_0x3ad4('0xf')](_0x3ad4('0x10'),_0x492846,_0x3ad4('0xe'),JSON['stringify'](_0x1ca42c));if(_0x1ca42c[_0x3ad4('0x11')]){if(_0x1ca42c['error'][_0x3ad4('0x12')]===0x1f4){logger[_0x3ad4('0x11')](_0x3ad4('0x13'),_0x492846,_0x1ca42c[_0x3ad4('0x11')]['message']);return _0xfd53e8(_0x1ca42c[_0x3ad4('0x11')][_0x3ad4('0x14')]);}logger[_0x3ad4('0x11')](_0x3ad4('0x13'),_0x492846,_0x1ca42c[_0x3ad4('0x11')][_0x3ad4('0x14')]);return _0x1ba580(_0x1ca42c['error'][_0x3ad4('0x14')]);}else{logger[_0x3ad4('0xd')](_0x3ad4('0x13'),_0x492846,_0x3ad4('0xe'));_0x1ba580(_0x1ca42c[_0x3ad4('0x15')][_0x3ad4('0x14')]);}})['catch'](function(_0x4867bd){logger[_0x3ad4('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x492846,_0x4867bd);_0xfd53e8(_0x4867bd);});});}exports[_0x3ad4('0x16')]=function(_0x4cba8d){var _0x3430f3=this;return new Promise(function(_0x4860e9,_0x58ded0){return db[_0x3ad4('0x17')][_0x3ad4('0x18')](_0x4cba8d[_0x3ad4('0x19')],{'raw':_0x4cba8d[_0x3ad4('0x1a')]?_0x4cba8d[_0x3ad4('0x1a')][_0x3ad4('0x1b')]===undefined?!![]:![]:!![]})[_0x3ad4('0xc')](function(_0x44f724){logger['info']('CreateFaxQueueReport',_0x4cba8d);logger[_0x3ad4('0xf')](_0x3ad4('0x16'),_0x4cba8d,JSON[_0x3ad4('0x1c')](_0x44f724));_0x4860e9(_0x44f724);})[_0x3ad4('0x1d')](function(_0x103cf5){logger[_0x3ad4('0x11')](_0x3ad4('0x16'),_0x103cf5[_0x3ad4('0x14')],_0x4cba8d);_0x58ded0(_0x3430f3[_0x3ad4('0x11')](0x1f4,_0x103cf5[_0x3ad4('0x14')]));});});};exports[_0x3ad4('0x1e')]=function(_0x4972c4){var _0x4ae5ff=this;return new Promise(function(_0x3b4f0a,_0x269fc1){return db[_0x3ad4('0x17')][_0x3ad4('0x1f')](_0x4972c4[_0x3ad4('0x19')],{'raw':_0x4972c4[_0x3ad4('0x1a')]?_0x4972c4['options'][_0x3ad4('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4972c4['options']?_0x4972c4[_0x3ad4('0x1a')][_0x3ad4('0x20')]||null:null,'attributes':_0x4972c4[_0x3ad4('0x1a')]?_0x4972c4[_0x3ad4('0x1a')][_0x3ad4('0x21')]||null:null,'limit':_0x4972c4[_0x3ad4('0x1a')]?_0x4972c4['options']['limit']||null:null})['then'](function(_0x2dfe8a){logger[_0x3ad4('0xd')](_0x3ad4('0x1e'),_0x4972c4);logger[_0x3ad4('0xf')](_0x3ad4('0x1e'),_0x4972c4,JSON['stringify'](_0x2dfe8a));_0x3b4f0a(_0x2dfe8a);})[_0x3ad4('0x1d')](function(_0x51e00e){logger[_0x3ad4('0x11')]('UpdateFaxQueueReport',_0x51e00e[_0x3ad4('0x14')],_0x4972c4);_0x269fc1(_0x4ae5ff[_0x3ad4('0x11')](0x1f4,_0x51e00e['message']));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index e1a8f5d..9c5d42a 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 _0xe65a=['get','index','/describe','describe','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller'];(function(_0x289035,_0x76742c){var _0x4c8db5=function(_0x26a333){while(--_0x26a333){_0x289035['push'](_0x289035['shift']());}};_0x4c8db5(++_0x76742c);}(_0xe65a,0x1b1));var _0xae65=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0xe65a[_0x420b24];return _0x4da552;};'use strict';var multer=require('multer');var util=require(_0xae65('0x0'));var path=require(_0xae65('0x1'));var timeout=require('connect-timeout');var express=require(_0xae65('0x2'));var router=express['Router']();var fs_extra=require(_0xae65('0x3'));var auth=require(_0xae65('0x4'));var interaction=require(_0xae65('0x5'));var config=require(_0xae65('0x6'));var controller=require(_0xae65('0x7'));router[_0xae65('0x8')]('/',auth['isAuthenticated'](),controller[_0xae65('0x9')]);router[_0xae65('0x8')](_0xae65('0xa'),auth['isAuthenticated'](),controller[_0xae65('0xb')]);router['get'](_0xae65('0xc'),auth[_0xae65('0xd')](),controller[_0xae65('0xe')]);router[_0xae65('0xf')]('/',auth['isAuthenticated'](),controller[_0xae65('0x10')]);router['put'](_0xae65('0xc'),auth[_0xae65('0xd')](),controller[_0xae65('0x11')]);router[_0xae65('0x12')]('/:id',auth[_0xae65('0xd')](),controller[_0xae65('0x13')]);module[_0xae65('0x14')]=router; \ No newline at end of file +var _0x923c=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','index','describe','show','create','/:id','update','delete','destroy','exports','multer'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x923c,0x92));var _0xc923=function(_0x2003df,_0x50dfba){_0x2003df=_0x2003df-0x0;var _0x32f176=_0x923c[_0x2003df];return _0x32f176;};'use strict';var multer=require(_0xc923('0x0'));var util=require(_0xc923('0x1'));var path=require(_0xc923('0x2'));var timeout=require(_0xc923('0x3'));var express=require(_0xc923('0x4'));var router=express[_0xc923('0x5')]();var fs_extra=require(_0xc923('0x6'));var auth=require(_0xc923('0x7'));var interaction=require(_0xc923('0x8'));var config=require('../../config/environment');var controller=require(_0xc923('0x9'));router[_0xc923('0xa')]('/',auth[_0xc923('0xb')](),controller[_0xc923('0xc')]);router['get']('/describe',auth[_0xc923('0xb')](),controller[_0xc923('0xd')]);router['get']('/:id',auth[_0xc923('0xb')](),controller[_0xc923('0xe')]);router['post']('/',auth[_0xc923('0xb')](),controller[_0xc923('0xf')]);router['put'](_0xc923('0x10'),auth[_0xc923('0xb')](),controller[_0xc923('0x11')]);router[_0xc923('0x12')]('/:id',auth[_0xc923('0xb')](),controller[_0xc923('0x13')]);module[_0xc923('0x14')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index c149cec..af3956b 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0xd549e9,_0x45f009){var _0x4febe4=function(_0x1bcf97){while(--_0x1bcf97){_0xd549e9['push'](_0xd549e9['shift']());}};_0x4febe4(++_0x45f009);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x8bb4c1,_0x2d6e53){_0x8bb4c1=_0x8bb4c1-0x0;var _0x67a6e1=_0xf3cd[_0x8bb4c1];return _0x67a6e1;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x3acdef,_0x3e81b5){var _0x4398a5=function(_0x4def81){while(--_0x4def81){_0x3acdef['push'](_0x3acdef['shift']());}};_0x4398a5(++_0x3e81b5);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x2316b9,_0x87059b){_0x2316b9=_0x2316b9-0x0;var _0x4405a9=_0xf3cd[_0x2316b9];return _0x4405a9;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 2ad7c24..a770e15 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 _0x1650=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','destroy','then','error','name','send','FaxTransferReport','rawAttributes','fieldName','model','map','query','filters','intersection','fields','attributes','nolimit','offset','order','sort','where','pick','merge','type','VIRTUAL','filter','findAll','rows','catch','params','keys','length','includeAll','include','options','find','create','body','describe','rimraf','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0xc36b,_0x1650bd){var _0x44a4b6=function(_0x30cd77){while(--_0x30cd77){_0xc36b['push'](_0xc36b['shift']());}};_0x44a4b6(++_0x1650bd);}(_0x1650,0xd3));var _0x0165=function(_0x403fc7,_0x32931a){_0x403fc7=_0x403fc7-0x0;var _0x5d0827=_0x1650[_0x403fc7];return _0x5d0827;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0165('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0165('0x1'));var moment=require('moment');var BPromise=require(_0x0165('0x2'));var Mustache=require(_0x0165('0x3'));var util=require(_0x0165('0x4'));var path=require(_0x0165('0x5'));var sox=require(_0x0165('0x6'));var csv=require(_0x0165('0x7'));var ejs=require(_0x0165('0x8'));var fs=require('fs');var fs_extra=require(_0x0165('0x9'));var _=require(_0x0165('0xa'));var squel=require('squel');var crypto=require(_0x0165('0xb'));var jsforce=require(_0x0165('0xc'));var deskjs=require(_0x0165('0xd'));var toCsv=require(_0x0165('0x7'));var querystring=require(_0x0165('0xe'));var Papa=require(_0x0165('0xf'));var Redis=require(_0x0165('0x10'));var authService=require(_0x0165('0x11'));var qs=require(_0x0165('0x12'));var as=require(_0x0165('0x13'));var hardwareService=require(_0x0165('0x14'));var logger=require('../../config/logger')(_0x0165('0x15'));var utils=require(_0x0165('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x0165('0x17'));var db=require(_0x0165('0x18'))['db'];function respondWithStatusCode(_0x31ead2,_0x58f962){_0x58f962=_0x58f962||0xcc;return function(_0x1e68f1){if(_0x1e68f1){return _0x31ead2[_0x0165('0x19')](_0x58f962);}return _0x31ead2['status'](_0x58f962)[_0x0165('0x1a')]();};}function respondWithResult(_0x27010d,_0x5bb7c7){_0x5bb7c7=_0x5bb7c7||0xc8;return function(_0x3c5e4e){if(_0x3c5e4e){return _0x27010d['status'](_0x5bb7c7)[_0x0165('0x1b')](_0x3c5e4e);}};}function respondWithFilteredResult(_0x141dd2,_0x4c535d){return function(_0x1c2e86){if(_0x1c2e86){var _0x47ee14=typeof _0x4c535d['offset']===_0x0165('0x1c')&&typeof _0x4c535d[_0x0165('0x1d')]===_0x0165('0x1c');var _0x3697fe=_0x1c2e86['count'];var _0x2853d9=_0x47ee14?0x0:_0x4c535d['offset'];var _0x5a5e0a=_0x47ee14?_0x1c2e86[_0x0165('0x1e')]:_0x4c535d['offset']+_0x4c535d[_0x0165('0x1d')];var _0x211080;if(_0x5a5e0a>=_0x3697fe){_0x5a5e0a=_0x3697fe;_0x211080=0xc8;}else{_0x211080=0xce;}_0x141dd2[_0x0165('0x1f')](_0x211080);return _0x141dd2[_0x0165('0x20')](_0x0165('0x21'),_0x2853d9+'-'+_0x5a5e0a+'/'+_0x3697fe)['json'](_0x1c2e86);}return null;};}function patchUpdates(_0x2d723f){return function(_0x470f34){try{jsonpatch[_0x0165('0x22')](_0x470f34,_0x2d723f,!![]);}catch(_0x277428){return BPromise[_0x0165('0x23')](_0x277428);}return _0x470f34[_0x0165('0x24')]();};}function saveUpdates(_0x19d318,_0x123d04){return function(_0x28210f){if(_0x28210f){return _0x28210f[_0x0165('0x25')](_0x19d318)['then'](function(_0x3d9748){return _0x3d9748;});}return null;};}function removeEntity(_0xb92b75,_0x77ea3c){return function(_0x585db5){if(_0x585db5){return _0x585db5[_0x0165('0x26')]()[_0x0165('0x27')](function(){_0xb92b75[_0x0165('0x1f')](0xcc)[_0x0165('0x1a')]();});}};}function handleEntityNotFound(_0x4ef64b,_0x5a190d){return function(_0x37b0e6){if(!_0x37b0e6){_0x4ef64b[_0x0165('0x19')](0x194);}return _0x37b0e6;};}function handleError(_0x48aa81,_0xd93177){_0xd93177=_0xd93177||0x1f4;return function(_0xeb260a){logger[_0x0165('0x28')](_0xeb260a['stack']);if(_0xeb260a['name']){delete _0xeb260a[_0x0165('0x29')];}_0x48aa81[_0x0165('0x1f')](_0xd93177)[_0x0165('0x2a')](_0xeb260a);};}exports['index']=function(_0x352cd4,_0x2b78a2){var _0x4b1393={},_0x5531fc={},_0x3f3482={'count':0x0,'rows':[]};var _0x1063f6=_['map'](db[_0x0165('0x2b')][_0x0165('0x2c')],function(_0x141427){return{'name':_0x141427[_0x0165('0x2d')],'type':_0x141427['type']['key']};});_0x5531fc[_0x0165('0x2e')]=_[_0x0165('0x2f')](_0x1063f6,_0x0165('0x29'));_0x5531fc['query']=_['keys'](_0x352cd4[_0x0165('0x30')]);_0x5531fc[_0x0165('0x31')]=_[_0x0165('0x32')](_0x5531fc[_0x0165('0x2e')],_0x5531fc[_0x0165('0x30')]);_0x4b1393['attributes']=_['intersection'](_0x5531fc[_0x0165('0x2e')],qs[_0x0165('0x33')](_0x352cd4[_0x0165('0x30')][_0x0165('0x33')]));_0x4b1393['attributes']=_0x4b1393[_0x0165('0x34')]['length']?_0x4b1393['attributes']:_0x5531fc[_0x0165('0x2e')];if(!_0x352cd4[_0x0165('0x30')]['hasOwnProperty'](_0x0165('0x35'))){_0x4b1393[_0x0165('0x1d')]=qs[_0x0165('0x1d')](_0x352cd4['query']['limit']);_0x4b1393[_0x0165('0x36')]=qs[_0x0165('0x36')](_0x352cd4['query'][_0x0165('0x36')]);}_0x4b1393[_0x0165('0x37')]=qs[_0x0165('0x38')](_0x352cd4[_0x0165('0x30')]['sort']);_0x4b1393[_0x0165('0x39')]=qs['filters'](_[_0x0165('0x3a')](_0x352cd4[_0x0165('0x30')],_0x5531fc[_0x0165('0x31')]),_0x1063f6);if(_0x352cd4['query']['filter']){_0x4b1393[_0x0165('0x39')]=_[_0x0165('0x3b')](_0x4b1393[_0x0165('0x39')],{'$or':_[_0x0165('0x2f')](_0x1063f6,function(_0x1f9cc1){if(_0x1f9cc1[_0x0165('0x3c')]!==_0x0165('0x3d')){var _0x41ea9c={};_0x41ea9c[_0x1f9cc1[_0x0165('0x29')]]={'$like':'%'+_0x352cd4[_0x0165('0x30')][_0x0165('0x3e')]+'%'};return _0x41ea9c;}})});}_0x4b1393=_[_0x0165('0x3b')]({},_0x4b1393,_0x352cd4['options']);var _0x57b093={'where':_0x4b1393[_0x0165('0x39')]};return db[_0x0165('0x2b')][_0x0165('0x1e')](_0x57b093)[_0x0165('0x27')](function(_0x4738c0){_0x3f3482[_0x0165('0x1e')]=_0x4738c0;if(_0x352cd4['query']['includeAll']){_0x4b1393['include']=[{'all':!![]}];}return db[_0x0165('0x2b')][_0x0165('0x3f')](_0x4b1393);})[_0x0165('0x27')](function(_0x31833e){_0x3f3482[_0x0165('0x40')]=_0x31833e;return _0x3f3482;})[_0x0165('0x27')](respondWithFilteredResult(_0x2b78a2,_0x4b1393))[_0x0165('0x41')](handleError(_0x2b78a2,null));};exports['show']=function(_0x28cea5,_0xb93535){var _0x317e7e={'raw':!![],'where':{'id':_0x28cea5[_0x0165('0x42')]['id']}},_0x391086={};_0x391086['model']=_[_0x0165('0x43')](db['FaxTransferReport'][_0x0165('0x2c')]);_0x391086['query']=_[_0x0165('0x43')](_0x28cea5['query']);_0x391086[_0x0165('0x31')]=_[_0x0165('0x32')](_0x391086[_0x0165('0x2e')],_0x391086[_0x0165('0x30')]);_0x317e7e[_0x0165('0x34')]=_['intersection'](_0x391086[_0x0165('0x2e')],qs[_0x0165('0x33')](_0x28cea5[_0x0165('0x30')][_0x0165('0x33')]));_0x317e7e[_0x0165('0x34')]=_0x317e7e[_0x0165('0x34')][_0x0165('0x44')]?_0x317e7e[_0x0165('0x34')]:_0x391086[_0x0165('0x2e')];if(_0x28cea5[_0x0165('0x30')][_0x0165('0x45')]){_0x317e7e[_0x0165('0x46')]=[{'all':!![]}];}_0x317e7e=_[_0x0165('0x3b')]({},_0x317e7e,_0x28cea5[_0x0165('0x47')]);return db[_0x0165('0x2b')][_0x0165('0x48')](_0x317e7e)[_0x0165('0x27')](handleEntityNotFound(_0xb93535,null))[_0x0165('0x27')](respondWithResult(_0xb93535,null))[_0x0165('0x41')](handleError(_0xb93535,null));};exports['create']=function(_0x10b9c6,_0x2f8dec){return db['FaxTransferReport'][_0x0165('0x49')](_0x10b9c6[_0x0165('0x4a')],{})['then'](respondWithResult(_0x2f8dec,0xc9))[_0x0165('0x41')](handleError(_0x2f8dec,null));};exports[_0x0165('0x25')]=function(_0x398476,_0x4193f1){if(_0x398476[_0x0165('0x4a')]['id']){delete _0x398476[_0x0165('0x4a')]['id'];}return db[_0x0165('0x2b')][_0x0165('0x48')]({'where':{'id':_0x398476['params']['id']}})[_0x0165('0x27')](handleEntityNotFound(_0x4193f1,null))[_0x0165('0x27')](saveUpdates(_0x398476[_0x0165('0x4a')],null))[_0x0165('0x27')](respondWithResult(_0x4193f1,null))[_0x0165('0x41')](handleError(_0x4193f1,null));};exports[_0x0165('0x26')]=function(_0x222d48,_0x5d6379){return db[_0x0165('0x2b')][_0x0165('0x48')]({'where':{'id':_0x222d48[_0x0165('0x42')]['id']}})['then'](handleEntityNotFound(_0x5d6379,null))[_0x0165('0x27')](removeEntity(_0x5d6379,null))['catch'](handleError(_0x5d6379,null));};exports[_0x0165('0x4b')]=function(_0xd22673,_0xa7ea4e){return db['FaxTransferReport'][_0x0165('0x4b')]()[_0x0165('0x27')](respondWithResult(_0xa7ea4e,null))['catch'](handleError(_0xa7ea4e,null));}; \ No newline at end of file +var _0x5029=['limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','FaxTransferReport','fieldName','key','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','type','merge','include','findAll','show','params','model','rawAttributes','options','catch','create','body','find','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count'];(function(_0x5ccfa9,_0x415e4d){var _0x228ced=function(_0x57750a){while(--_0x57750a){_0x5ccfa9['push'](_0x5ccfa9['shift']());}};_0x228ced(++_0x415e4d);}(_0x5029,0x198));var _0x9502=function(_0x444462,_0x2bf6e){_0x444462=_0x444462-0x0;var _0x3060fa=_0x5029[_0x444462];return _0x3060fa;};'use strict';var emlformat=require(_0x9502('0x0'));var rimraf=require(_0x9502('0x1'));var zipdir=require(_0x9502('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9502('0x3'));var moment=require('moment');var BPromise=require(_0x9502('0x4'));var Mustache=require('mustache');var util=require(_0x9502('0x5'));var path=require('path');var sox=require(_0x9502('0x6'));var csv=require('to-csv');var ejs=require(_0x9502('0x7'));var fs=require('fs');var fs_extra=require(_0x9502('0x8'));var _=require(_0x9502('0x9'));var squel=require(_0x9502('0xa'));var crypto=require('crypto');var jsforce=require(_0x9502('0xb'));var deskjs=require(_0x9502('0xc'));var toCsv=require(_0x9502('0xd'));var querystring=require('querystring');var Papa=require(_0x9502('0xe'));var Redis=require(_0x9502('0xf'));var authService=require(_0x9502('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x9502('0x11'));var hardwareService=require(_0x9502('0x12'));var logger=require(_0x9502('0x13'))(_0x9502('0x14'));var utils=require(_0x9502('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x9502('0x16'));var db=require(_0x9502('0x17'))['db'];function respondWithStatusCode(_0x4dfdcf,_0x18d105){_0x18d105=_0x18d105||0xcc;return function(_0x546dd6){if(_0x546dd6){return _0x4dfdcf[_0x9502('0x18')](_0x18d105);}return _0x4dfdcf[_0x9502('0x19')](_0x18d105)['end']();};}function respondWithResult(_0xa56fc8,_0x5ac790){_0x5ac790=_0x5ac790||0xc8;return function(_0x2fbffe){if(_0x2fbffe){return _0xa56fc8[_0x9502('0x19')](_0x5ac790)[_0x9502('0x1a')](_0x2fbffe);}};}function respondWithFilteredResult(_0x1ef686,_0x3e73fb){return function(_0xe0ecd1){if(_0xe0ecd1){var _0x3c9dfa=typeof _0x3e73fb[_0x9502('0x1b')]===_0x9502('0x1c')&&typeof _0x3e73fb['limit']===_0x9502('0x1c');var _0xb276e=_0xe0ecd1['count'];var _0x2d88d6=_0x3c9dfa?0x0:_0x3e73fb[_0x9502('0x1b')];var _0xc47f3a=_0x3c9dfa?_0xe0ecd1[_0x9502('0x1d')]:_0x3e73fb[_0x9502('0x1b')]+_0x3e73fb[_0x9502('0x1e')];var _0x52aa17;if(_0xc47f3a>=_0xb276e){_0xc47f3a=_0xb276e;_0x52aa17=0xc8;}else{_0x52aa17=0xce;}_0x1ef686[_0x9502('0x19')](_0x52aa17);return _0x1ef686[_0x9502('0x1f')](_0x9502('0x20'),_0x2d88d6+'-'+_0xc47f3a+'/'+_0xb276e)['json'](_0xe0ecd1);}return null;};}function patchUpdates(_0x455c12){return function(_0x5baf5f){try{jsonpatch['apply'](_0x5baf5f,_0x455c12,!![]);}catch(_0x37dd03){return BPromise[_0x9502('0x21')](_0x37dd03);}return _0x5baf5f[_0x9502('0x22')]();};}function saveUpdates(_0x94dbc0,_0x192add){return function(_0x4bada1){if(_0x4bada1){return _0x4bada1[_0x9502('0x23')](_0x94dbc0)[_0x9502('0x24')](function(_0x42216c){return _0x42216c;});}return null;};}function removeEntity(_0x83ef4a,_0x440123){return function(_0x38a4d4){if(_0x38a4d4){return _0x38a4d4[_0x9502('0x25')]()['then'](function(){_0x83ef4a[_0x9502('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c1c80,_0x40cb5e){return function(_0x127dd2){if(!_0x127dd2){_0x4c1c80[_0x9502('0x18')](0x194);}return _0x127dd2;};}function handleError(_0x19cc37,_0x417987){_0x417987=_0x417987||0x1f4;return function(_0x989896){logger[_0x9502('0x26')](_0x989896[_0x9502('0x27')]);if(_0x989896[_0x9502('0x28')]){delete _0x989896[_0x9502('0x28')];}_0x19cc37['status'](_0x417987)[_0x9502('0x29')](_0x989896);};}exports[_0x9502('0x2a')]=function(_0x1f5996,_0x5935be){var _0x36c4f6={},_0x40174a={},_0x592a0b={'count':0x0,'rows':[]};var _0x519e63=_[_0x9502('0x2b')](db[_0x9502('0x2c')]['rawAttributes'],function(_0x3f6fb5){return{'name':_0x3f6fb5[_0x9502('0x2d')],'type':_0x3f6fb5['type'][_0x9502('0x2e')]};});_0x40174a['model']=_[_0x9502('0x2b')](_0x519e63,'name');_0x40174a[_0x9502('0x2f')]=_[_0x9502('0x30')](_0x1f5996[_0x9502('0x2f')]);_0x40174a['filters']=_[_0x9502('0x31')](_0x40174a['model'],_0x40174a[_0x9502('0x2f')]);_0x36c4f6[_0x9502('0x32')]=_['intersection'](_0x40174a['model'],qs[_0x9502('0x33')](_0x1f5996[_0x9502('0x2f')][_0x9502('0x33')]));_0x36c4f6[_0x9502('0x32')]=_0x36c4f6[_0x9502('0x32')]['length']?_0x36c4f6[_0x9502('0x32')]:_0x40174a['model'];if(!_0x1f5996[_0x9502('0x2f')][_0x9502('0x34')](_0x9502('0x35'))){_0x36c4f6[_0x9502('0x1e')]=qs[_0x9502('0x1e')](_0x1f5996['query'][_0x9502('0x1e')]);_0x36c4f6['offset']=qs[_0x9502('0x1b')](_0x1f5996['query']['offset']);}_0x36c4f6[_0x9502('0x36')]=qs[_0x9502('0x37')](_0x1f5996['query'][_0x9502('0x37')]);_0x36c4f6['where']=qs[_0x9502('0x38')](_[_0x9502('0x39')](_0x1f5996[_0x9502('0x2f')],_0x40174a['filters']),_0x519e63);if(_0x1f5996['query'][_0x9502('0x3a')]){_0x36c4f6[_0x9502('0x3b')]=_['merge'](_0x36c4f6[_0x9502('0x3b')],{'$or':_['map'](_0x519e63,function(_0x4bda16){if(_0x4bda16[_0x9502('0x3c')]!=='VIRTUAL'){var _0x47be8c={};_0x47be8c[_0x4bda16[_0x9502('0x28')]]={'$like':'%'+_0x1f5996['query'][_0x9502('0x3a')]+'%'};return _0x47be8c;}})});}_0x36c4f6=_[_0x9502('0x3d')]({},_0x36c4f6,_0x1f5996['options']);var _0xb0a910={'where':_0x36c4f6[_0x9502('0x3b')]};return db[_0x9502('0x2c')][_0x9502('0x1d')](_0xb0a910)[_0x9502('0x24')](function(_0x19068e){_0x592a0b['count']=_0x19068e;if(_0x1f5996[_0x9502('0x2f')]['includeAll']){_0x36c4f6[_0x9502('0x3e')]=[{'all':!![]}];}return db[_0x9502('0x2c')][_0x9502('0x3f')](_0x36c4f6);})[_0x9502('0x24')](function(_0x338f63){_0x592a0b['rows']=_0x338f63;return _0x592a0b;})[_0x9502('0x24')](respondWithFilteredResult(_0x5935be,_0x36c4f6))['catch'](handleError(_0x5935be,null));};exports[_0x9502('0x40')]=function(_0x1127a8,_0x278aef){var _0x21a855={'raw':!![],'where':{'id':_0x1127a8[_0x9502('0x41')]['id']}},_0x10b29f={};_0x10b29f[_0x9502('0x42')]=_['keys'](db[_0x9502('0x2c')][_0x9502('0x43')]);_0x10b29f[_0x9502('0x2f')]=_[_0x9502('0x30')](_0x1127a8['query']);_0x10b29f[_0x9502('0x38')]=_[_0x9502('0x31')](_0x10b29f[_0x9502('0x42')],_0x10b29f[_0x9502('0x2f')]);_0x21a855[_0x9502('0x32')]=_['intersection'](_0x10b29f[_0x9502('0x42')],qs[_0x9502('0x33')](_0x1127a8[_0x9502('0x2f')][_0x9502('0x33')]));_0x21a855['attributes']=_0x21a855['attributes']['length']?_0x21a855[_0x9502('0x32')]:_0x10b29f['model'];if(_0x1127a8['query']['includeAll']){_0x21a855['include']=[{'all':!![]}];}_0x21a855=_[_0x9502('0x3d')]({},_0x21a855,_0x1127a8[_0x9502('0x44')]);return db[_0x9502('0x2c')]['find'](_0x21a855)['then'](handleEntityNotFound(_0x278aef,null))[_0x9502('0x24')](respondWithResult(_0x278aef,null))[_0x9502('0x45')](handleError(_0x278aef,null));};exports['create']=function(_0x29b906,_0x5ce28e){return db[_0x9502('0x2c')][_0x9502('0x46')](_0x29b906['body'],{})['then'](respondWithResult(_0x5ce28e,0xc9))[_0x9502('0x45')](handleError(_0x5ce28e,null));};exports['update']=function(_0x57cf66,_0x5be18b){if(_0x57cf66['body']['id']){delete _0x57cf66[_0x9502('0x47')]['id'];}return db[_0x9502('0x2c')][_0x9502('0x48')]({'where':{'id':_0x57cf66['params']['id']}})['then'](handleEntityNotFound(_0x5be18b,null))[_0x9502('0x24')](saveUpdates(_0x57cf66[_0x9502('0x47')],null))[_0x9502('0x24')](respondWithResult(_0x5be18b,null))[_0x9502('0x45')](handleError(_0x5be18b,null));};exports[_0x9502('0x25')]=function(_0x339836,_0xbcfee6){return db['FaxTransferReport'][_0x9502('0x48')]({'where':{'id':_0x339836[_0x9502('0x41')]['id']}})[_0x9502('0x24')](handleEntityNotFound(_0xbcfee6,null))[_0x9502('0x24')](removeEntity(_0xbcfee6,null))[_0x9502('0x45')](handleError(_0xbcfee6,null));};exports['describe']=function(_0x1adfb6,_0x210221){return db['FaxTransferReport']['describe']()[_0x9502('0x24')](respondWithResult(_0x210221,null))[_0x9502('0x45')](handleError(_0x210221,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 0a5923a..694dbb3 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 _0xf84a=['bluebird','path','rimraf','./faxTransferReport.attributes','exports','FaxTransferReport','report_fax_transfer','uniqueid','../../config/logger','api','moment'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xf84a,0x97));var _0xaf84=function(_0x31fd85,_0x2e7c56){_0x31fd85=_0x31fd85-0x0;var _0x406165=_0xf84a[_0x31fd85];return _0x406165;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaf84('0x0'))(_0xaf84('0x1'));var moment=require(_0xaf84('0x2'));var BPromise=require(_0xaf84('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf84('0x4'));var rimraf=require(_0xaf84('0x5'));var config=require('../../config/environment');var attributes=require(_0xaf84('0x6'));module[_0xaf84('0x7')]=function(_0x246ab7,_0x3db4e9){return _0x246ab7['define'](_0xaf84('0x8'),attributes,{'tableName':_0xaf84('0x9'),'paranoid':![],'indexes':[{'name':_0xaf84('0xa'),'fields':[_0xaf84('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb0f6=['FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','./faxTransferReport.attributes','exports'];(function(_0x39af07,_0x5155a7){var _0x4381fd=function(_0x92c328){while(--_0x92c328){_0x39af07['push'](_0x39af07['shift']());}};_0x4381fd(++_0x5155a7);}(_0xb0f6,0x1bf));var _0x6b0f=function(_0x4cb529,_0x47ba2a){_0x4cb529=_0x4cb529-0x0;var _0x354d96=_0xb0f6[_0x4cb529];return _0x354d96;};'use strict';var _=require(_0x6b0f('0x0'));var util=require(_0x6b0f('0x1'));var logger=require(_0x6b0f('0x2'))(_0x6b0f('0x3'));var moment=require(_0x6b0f('0x4'));var BPromise=require('bluebird');var rp=require(_0x6b0f('0x5'));var fs=require('fs');var path=require(_0x6b0f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6b0f('0x7'));module[_0x6b0f('0x8')]=function(_0x202032,_0x21b7d0){return _0x202032['define'](_0x6b0f('0x9'),attributes,{'tableName':_0x6b0f('0xa'),'paranoid':![],'indexes':[{'name':_0x6b0f('0xb'),'fields':[_0x6b0f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 324f1c6..0678a6a 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 _0x17ee=['client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise'];(function(_0x4c4bd,_0x1cb75a){var _0x59cd87=function(_0x127042){while(--_0x127042){_0x4c4bd['push'](_0x4c4bd['shift']());}};_0x59cd87(++_0x1cb75a);}(_0x17ee,0x1d3));var _0xe17e=function(_0x4ec64d,_0x248423){_0x4ec64d=_0x4ec64d-0x0;var _0x246fc8=_0x17ee[_0x4ec64d];return _0x246fc8;};'use strict';var _=require(_0xe17e('0x0'));var util=require(_0xe17e('0x1'));var moment=require(_0xe17e('0x2'));var BPromise=require('bluebird');var rs=require(_0xe17e('0x3'));var fs=require('fs');var Redis=require(_0xe17e('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe17e('0x5'));var config=require(_0xe17e('0x6'));var jayson=require(_0xe17e('0x7'));var client=jayson[_0xe17e('0x8')][_0xe17e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14a119,_0x2d9f2a,_0xe71e37){return new BPromise(function(_0x4d2744,_0x50ac4d){return client[_0xe17e('0xa')](_0x14a119,_0xe71e37)[_0xe17e('0xb')](function(_0x487e5d){logger[_0xe17e('0xc')](_0xe17e('0xd'),_0x2d9f2a,_0xe17e('0xe'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x2d9f2a,_0xe17e('0xe'),JSON[_0xe17e('0xf')](_0x487e5d));if(_0x487e5d[_0xe17e('0x10')]){if(_0x487e5d[_0xe17e('0x10')]['code']===0x1f4){logger['error'](_0xe17e('0xd'),_0x2d9f2a,_0x487e5d[_0xe17e('0x10')][_0xe17e('0x11')]);return _0x50ac4d(_0x487e5d['error'][_0xe17e('0x11')]);}logger[_0xe17e('0x10')](_0xe17e('0xd'),_0x2d9f2a,_0x487e5d[_0xe17e('0x10')][_0xe17e('0x11')]);return _0x4d2744(_0x487e5d[_0xe17e('0x10')][_0xe17e('0x11')]);}else{logger[_0xe17e('0xc')](_0xe17e('0xd'),_0x2d9f2a,'request\x20sent');_0x4d2744(_0x487e5d[_0xe17e('0x12')][_0xe17e('0x11')]);}})['catch'](function(_0x4d651){logger[_0xe17e('0x10')](_0xe17e('0xd'),_0x2d9f2a,_0x4d651);_0x50ac4d(_0x4d651);});});} \ No newline at end of file +var _0x630f=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxTransferReport,\x20%s,\x20%s','result','lodash','moment','bluebird','ioredis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x630f,0x161));var _0xf630=function(_0x50bf4e,_0x482126){_0x50bf4e=_0x50bf4e-0x0;var _0x478f64=_0x630f[_0x50bf4e];return _0x478f64;};'use strict';var _=require(_0xf630('0x0'));var util=require('util');var moment=require(_0xf630('0x1'));var BPromise=require(_0xf630('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf630('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf630('0x4'));var logger=require('../../config/logger')(_0xf630('0x5'));var config=require(_0xf630('0x6'));var jayson=require(_0xf630('0x7'));var client=jayson[_0xf630('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ec2d4,_0x3cdbfb,_0x43c55f){return new BPromise(function(_0x4c4ade,_0x20d60d){return client[_0xf630('0x9')](_0x5ec2d4,_0x43c55f)[_0xf630('0xa')](function(_0x2fe53d){logger[_0xf630('0xb')]('FaxTransferReport,\x20%s,\x20%s',_0x3cdbfb,_0xf630('0xc'));logger[_0xf630('0xd')](_0xf630('0xe'),_0x3cdbfb,_0xf630('0xc'),JSON[_0xf630('0xf')](_0x2fe53d));if(_0x2fe53d[_0xf630('0x10')]){if(_0x2fe53d[_0xf630('0x10')][_0xf630('0x11')]===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x3cdbfb,_0x2fe53d[_0xf630('0x10')]['message']);return _0x20d60d(_0x2fe53d[_0xf630('0x10')][_0xf630('0x12')]);}logger[_0xf630('0x10')](_0xf630('0x13'),_0x3cdbfb,_0x2fe53d[_0xf630('0x10')]['message']);return _0x4c4ade(_0x2fe53d[_0xf630('0x10')][_0xf630('0x12')]);}else{logger[_0xf630('0xb')](_0xf630('0x13'),_0x3cdbfb,_0xf630('0xc'));_0x4c4ade(_0x2fe53d[_0xf630('0x14')][_0xf630('0x12')]);}})['catch'](function(_0xf0a676){logger['error'](_0xf630('0x13'),_0x3cdbfb,_0xf0a676);_0x20d60d(_0xf0a676);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 4ba5d02..686783a 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 _0x7e7b=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxTransferReport.controller','get','isAuthenticated','/describe','describe','show','post','put','update','/:id','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3b5250,_0x7a0b2c){var _0xc844a1=function(_0x2fbc98){while(--_0x2fbc98){_0x3b5250['push'](_0x3b5250['shift']());}};_0xc844a1(++_0x7a0b2c);}(_0x7e7b,0x8e));var _0xb7e7=function(_0x357681,_0x7447cc){_0x357681=_0x357681-0x0;var _0xa009ba=_0x7e7b[_0x357681];return _0xa009ba;};'use strict';var multer=require(_0xb7e7('0x0'));var util=require(_0xb7e7('0x1'));var path=require(_0xb7e7('0x2'));var timeout=require(_0xb7e7('0x3'));var express=require(_0xb7e7('0x4'));var router=express[_0xb7e7('0x5')]();var fs_extra=require(_0xb7e7('0x6'));var auth=require(_0xb7e7('0x7'));var interaction=require(_0xb7e7('0x8'));var config=require('../../config/environment');var controller=require(_0xb7e7('0x9'));router[_0xb7e7('0xa')]('/',auth[_0xb7e7('0xb')](),controller['index']);router['get'](_0xb7e7('0xc'),auth[_0xb7e7('0xb')](),controller[_0xb7e7('0xd')]);router['get']('/:id',auth[_0xb7e7('0xb')](),controller[_0xb7e7('0xe')]);router[_0xb7e7('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb7e7('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xb7e7('0x11')]);router['delete'](_0xb7e7('0x12'),auth[_0xb7e7('0xb')](),controller[_0xb7e7('0x13')]);module[_0xb7e7('0x14')]=router; \ No newline at end of file +var _0x6d66=['post','put','/:id','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','/describe','isAuthenticated','describe','show'];(function(_0x256130,_0x56ff88){var _0x29839f=function(_0x3dfa22){while(--_0x3dfa22){_0x256130['push'](_0x256130['shift']());}};_0x29839f(++_0x56ff88);}(_0x6d66,0xe9));var _0x66d6=function(_0x10c63a,_0x1284c6){_0x10c63a=_0x10c63a-0x0;var _0xf4a586=_0x6d66[_0x10c63a];return _0xf4a586;};'use strict';var multer=require(_0x66d6('0x0'));var util=require(_0x66d6('0x1'));var path=require(_0x66d6('0x2'));var timeout=require('connect-timeout');var express=require(_0x66d6('0x3'));var router=express[_0x66d6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x66d6('0x5'));var interaction=require(_0x66d6('0x6'));var config=require(_0x66d6('0x7'));var controller=require(_0x66d6('0x8'));router[_0x66d6('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x66d6('0x9')](_0x66d6('0xa'),auth[_0x66d6('0xb')](),controller[_0x66d6('0xc')]);router[_0x66d6('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x66d6('0xd')]);router[_0x66d6('0xe')]('/',auth[_0x66d6('0xb')](),controller['create']);router[_0x66d6('0xf')](_0x66d6('0x10'),auth[_0x66d6('0xb')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x66d6('0x11')]);module[_0x66d6('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index f2a6523..d609400 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 _0x5226=['getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','isAuthenticated','index','get','/:id','show'];(function(_0x3c7350,_0xbff380){var _0x5a0666=function(_0x435607){while(--_0x435607){_0x3c7350['push'](_0x3c7350['shift']());}};_0x5a0666(++_0xbff380);}(_0x5226,0x137));var _0x6522=function(_0x5b6a49,_0x3621d3){_0x5b6a49=_0x5b6a49-0x0;var _0x52cb4d=_0x5226[_0x5b6a49];return _0x52cb4d;};'use strict';var multer=require(_0x6522('0x0'));var util=require(_0x6522('0x1'));var path=require(_0x6522('0x2'));var timeout=require(_0x6522('0x3'));var express=require(_0x6522('0x4'));var router=express['Router']();var fs_extra=require(_0x6522('0x5'));var auth=require(_0x6522('0x6'));var interaction=require(_0x6522('0x7'));var config=require('../../config/environment');var controller=require(_0x6522('0x8'));router['get']('/',auth[_0x6522('0x9')](),controller[_0x6522('0xa')]);router[_0x6522('0xb')](_0x6522('0xc'),auth[_0x6522('0x9')](),controller[_0x6522('0xd')]);router[_0x6522('0xb')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x6522('0xe')]);router[_0x6522('0xb')](_0x6522('0xf'),auth[_0x6522('0x9')](),controller[_0x6522('0x10')]);router[_0x6522('0x11')]('/',auth[_0x6522('0x9')](),controller[_0x6522('0x12')]);router[_0x6522('0x11')](_0x6522('0x13'),auth[_0x6522('0x9')](),controller[_0x6522('0x14')]);router[_0x6522('0x15')]('/:id',auth[_0x6522('0x9')](),controller[_0x6522('0x16')]);router[_0x6522('0x17')](_0x6522('0xc'),auth[_0x6522('0x9')](),controller['destroy']);module[_0x6522('0x18')]=router; \ No newline at end of file +var _0xdde7=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','/:id','update','destroy','exports','multer','util','path','connect-timeout'];(function(_0x10555a,_0x238459){var _0x4a5c41=function(_0x3753ef){while(--_0x3753ef){_0x10555a['push'](_0x10555a['shift']());}};_0x4a5c41(++_0x238459);}(_0xdde7,0x1c4));var _0x7dde=function(_0x393eac,_0x4505f3){_0x393eac=_0x393eac-0x0;var _0x37a891=_0xdde7[_0x393eac];return _0x37a891;};'use strict';var multer=require(_0x7dde('0x0'));var util=require(_0x7dde('0x1'));var path=require(_0x7dde('0x2'));var timeout=require(_0x7dde('0x3'));var express=require('express');var router=express[_0x7dde('0x4')]();var fs_extra=require(_0x7dde('0x5'));var auth=require(_0x7dde('0x6'));var interaction=require(_0x7dde('0x7'));var config=require('../../config/environment');var controller=require(_0x7dde('0x8'));router[_0x7dde('0x9')]('/',auth[_0x7dde('0xa')](),controller[_0x7dde('0xb')]);router[_0x7dde('0x9')]('/:id',auth[_0x7dde('0xa')](),controller[_0x7dde('0xc')]);router[_0x7dde('0x9')](_0x7dde('0xd'),auth[_0x7dde('0xa')](),controller[_0x7dde('0xe')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x7dde('0xf')]);router[_0x7dde('0x10')]('/',auth[_0x7dde('0xa')](),controller[_0x7dde('0x11')]);router[_0x7dde('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x7dde('0x12')]);router[_0x7dde('0x13')](_0x7dde('0x14'),auth[_0x7dde('0xa')](),controller[_0x7dde('0x15')]);router['delete']('/:id',auth[_0x7dde('0xa')](),controller[_0x7dde('0x16')]);module[_0x7dde('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 25e6bc1..a32e2fa 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 _0xae88=['newTab','sequelize','exports','STRING','ENUM','basic','integrationTab'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xae88,0x1a5));var _0x8ae8=function(_0x3fdfff,_0x3a02b6){_0x3fdfff=_0x3fdfff-0x0;var _0x3c7681=_0xae88[_0x3fdfff];return _0x3c7681;};'use strict';var Sequelize=require(_0x8ae8('0x0'));module[_0x8ae8('0x1')]={'name':{'type':Sequelize[_0x8ae8('0x2')]},'description':{'type':Sequelize[_0x8ae8('0x2')]},'username':{'type':Sequelize[_0x8ae8('0x2')]},'remoteUri':{'type':Sequelize[_0x8ae8('0x2')]},'authType':{'type':Sequelize[_0x8ae8('0x3')](_0x8ae8('0x4')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x8ae8('0x2')]},'consumerKey':{'type':Sequelize[_0x8ae8('0x2')]},'consumerSecret':{'type':Sequelize[_0x8ae8('0x2')]},'token':{'type':Sequelize[_0x8ae8('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x8ae8('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8ae8('0x3')](_0x8ae8('0x5'),_0x8ae8('0x6')),'defaultValue':_0x8ae8('0x5')}}; \ No newline at end of file +var _0x07e1=['exports','STRING','ENUM','basic','newTab'];(function(_0x430459,_0x58519c){var _0x3a2439=function(_0x27a0b3){while(--_0x27a0b3){_0x430459['push'](_0x430459['shift']());}};_0x3a2439(++_0x58519c);}(_0x07e1,0x140));var _0x107e=function(_0x4e26d2,_0x21be50){_0x4e26d2=_0x4e26d2-0x0;var _0x17665a=_0x07e1[_0x4e26d2];return _0x17665a;};'use strict';var Sequelize=require('sequelize');module[_0x107e('0x0')]={'name':{'type':Sequelize[_0x107e('0x1')]},'description':{'type':Sequelize[_0x107e('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x107e('0x1')]},'authType':{'type':Sequelize[_0x107e('0x2')](_0x107e('0x3')),'defaultValue':_0x107e('0x3')},'password':{'type':Sequelize[_0x107e('0x1')]},'consumerKey':{'type':Sequelize[_0x107e('0x1')]},'consumerSecret':{'type':Sequelize[_0x107e('0x1')]},'token':{'type':Sequelize[_0x107e('0x1')]},'tokenSecret':{'type':Sequelize[_0x107e('0x1')]},'serverUrl':{'type':Sequelize[_0x107e('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x107e('0x2')]('integrationTab',_0x107e('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index c0d1d5b..1227db8 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 _0xe3b7=['length','Subjects','getSubjects','channel','getDescriptions','DeskField','Descriptions','priority','authType','username','consumerSecret','token','tokenSecret','remoteUri','substring','lastIndexOf','format','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','password','toString','concat','_embedded','active','label','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','reject','save','update','destroy','then','error','name','send','index','map','DeskAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','getConfigurations','findOne','DeskConfiguration'];(function(_0x56fd04,_0x5da37b){var _0x362197=function(_0x491948){while(--_0x491948){_0x56fd04['push'](_0x56fd04['shift']());}};_0x362197(++_0x5da37b);}(_0xe3b7,0x1d0));var _0x7e3b=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xe3b7[_0x40bffc];return _0x3007e9;};'use strict';var emlformat=require(_0x7e3b('0x0'));var rimraf=require(_0x7e3b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7e3b('0x2'));var rp=require(_0x7e3b('0x3'));var moment=require(_0x7e3b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7e3b('0x5'));var util=require('util');var path=require(_0x7e3b('0x6'));var sox=require(_0x7e3b('0x7'));var csv=require('to-csv');var ejs=require(_0x7e3b('0x8'));var fs=require('fs');var fs_extra=require(_0x7e3b('0x9'));var _=require(_0x7e3b('0xa'));var squel=require(_0x7e3b('0xb'));var crypto=require(_0x7e3b('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7e3b('0xd'));var querystring=require(_0x7e3b('0xe'));var Papa=require(_0x7e3b('0xf'));var Redis=require(_0x7e3b('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7e3b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e3b('0x12'))(_0x7e3b('0x13'));var utils=require(_0x7e3b('0x14'));var config=require(_0x7e3b('0x15'));var licenseUtil=require(_0x7e3b('0x16'));var db=require(_0x7e3b('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x28aa72,_0x39628a){_0x39628a=_0x39628a||0xcc;return function(_0x424676){if(_0x424676){return _0x28aa72[_0x7e3b('0x18')](_0x39628a);}return _0x28aa72['status'](_0x39628a)[_0x7e3b('0x19')]();};}function respondWithResult(_0x1f108c,_0x503518){_0x503518=_0x503518||0xc8;return function(_0x532333){if(_0x532333){return _0x1f108c['status'](_0x503518)[_0x7e3b('0x1a')](_0x532333);}};}function respondWithFilteredResult(_0x5324a7,_0x1909ca){return function(_0x4e7967){if(_0x4e7967){var _0x179dc8=typeof _0x1909ca[_0x7e3b('0x1b')]===_0x7e3b('0x1c')&&typeof _0x1909ca[_0x7e3b('0x1d')]===_0x7e3b('0x1c');var _0x1967df=_0x4e7967[_0x7e3b('0x1e')];var _0x15c0e=_0x179dc8?0x0:_0x1909ca[_0x7e3b('0x1b')];var _0x236e6=_0x179dc8?_0x4e7967[_0x7e3b('0x1e')]:_0x1909ca[_0x7e3b('0x1b')]+_0x1909ca[_0x7e3b('0x1d')];var _0x34be79;if(_0x236e6>=_0x1967df){_0x236e6=_0x1967df;_0x34be79=0xc8;}else{_0x34be79=0xce;}_0x5324a7[_0x7e3b('0x1f')](_0x34be79);return _0x5324a7[_0x7e3b('0x20')]('Content-Range',_0x15c0e+'-'+_0x236e6+'/'+_0x1967df)[_0x7e3b('0x1a')](_0x4e7967);}return null;};}function patchUpdates(_0x33393f){return function(_0x11607a){try{jsonpatch['apply'](_0x11607a,_0x33393f,!![]);}catch(_0xf8a244){return BPromise[_0x7e3b('0x21')](_0xf8a244);}return _0x11607a[_0x7e3b('0x22')]();};}function saveUpdates(_0x21f098,_0x356423){return function(_0x1b319d){if(_0x1b319d){return _0x1b319d[_0x7e3b('0x23')](_0x21f098)['then'](function(_0x5b2559){return _0x5b2559;});}return null;};}function removeEntity(_0x9e6ec3,_0x5214c5){return function(_0xf6a900){if(_0xf6a900){return _0xf6a900[_0x7e3b('0x24')]()[_0x7e3b('0x25')](function(){_0x9e6ec3['status'](0xcc)[_0x7e3b('0x19')]();});}};}function handleEntityNotFound(_0x59a92f,_0x12b36b){return function(_0x5d54ba){if(!_0x5d54ba){_0x59a92f[_0x7e3b('0x18')](0x194);}return _0x5d54ba;};}function handleError(_0x3b96d3,_0x60e7c2){_0x60e7c2=_0x60e7c2||0x1f4;return function(_0x1fc199){logger[_0x7e3b('0x26')](_0x1fc199['stack']);if(_0x1fc199['name']){delete _0x1fc199[_0x7e3b('0x27')];}_0x3b96d3[_0x7e3b('0x1f')](_0x60e7c2)[_0x7e3b('0x28')](_0x1fc199);};}exports[_0x7e3b('0x29')]=function(_0x1d7303,_0x1a21ce){var _0xa54046={},_0x1f3d9d={},_0x208992={'count':0x0,'rows':[]};var _0x9ba38c=_[_0x7e3b('0x2a')](db[_0x7e3b('0x2b')][_0x7e3b('0x2c')],function(_0x37ecf8){return{'name':_0x37ecf8['fieldName'],'type':_0x37ecf8['type'][_0x7e3b('0x2d')]};});_0x1f3d9d[_0x7e3b('0x2e')]=_['map'](_0x9ba38c,_0x7e3b('0x27'));_0x1f3d9d[_0x7e3b('0x2f')]=_[_0x7e3b('0x30')](_0x1d7303[_0x7e3b('0x2f')]);_0x1f3d9d[_0x7e3b('0x31')]=_[_0x7e3b('0x32')](_0x1f3d9d[_0x7e3b('0x2e')],_0x1f3d9d[_0x7e3b('0x2f')]);_0xa54046[_0x7e3b('0x33')]=_['intersection'](_0x1f3d9d[_0x7e3b('0x2e')],qs[_0x7e3b('0x34')](_0x1d7303['query'][_0x7e3b('0x34')]));_0xa54046[_0x7e3b('0x33')]=_0xa54046[_0x7e3b('0x33')]['length']?_0xa54046['attributes']:_0x1f3d9d[_0x7e3b('0x2e')];if(!_0x1d7303[_0x7e3b('0x2f')][_0x7e3b('0x35')](_0x7e3b('0x36'))){_0xa54046[_0x7e3b('0x1d')]=qs[_0x7e3b('0x1d')](_0x1d7303[_0x7e3b('0x2f')][_0x7e3b('0x1d')]);_0xa54046['offset']=qs[_0x7e3b('0x1b')](_0x1d7303[_0x7e3b('0x2f')][_0x7e3b('0x1b')]);}_0xa54046[_0x7e3b('0x37')]=qs[_0x7e3b('0x38')](_0x1d7303[_0x7e3b('0x2f')]['sort']);_0xa54046['where']=qs[_0x7e3b('0x31')](_[_0x7e3b('0x39')](_0x1d7303[_0x7e3b('0x2f')],_0x1f3d9d['filters']),_0x9ba38c);if(_0x1d7303['query'][_0x7e3b('0x3a')]){_0xa54046[_0x7e3b('0x3b')]=_[_0x7e3b('0x3c')](_0xa54046[_0x7e3b('0x3b')],{'$or':_[_0x7e3b('0x2a')](_0x9ba38c,function(_0x36f600){if(_0x36f600[_0x7e3b('0x3d')]!=='VIRTUAL'){var _0xeef891={};_0xeef891[_0x36f600[_0x7e3b('0x27')]]={'$like':'%'+_0x1d7303[_0x7e3b('0x2f')][_0x7e3b('0x3a')]+'%'};return _0xeef891;}})});}_0xa54046=_[_0x7e3b('0x3c')]({},_0xa54046,_0x1d7303['options']);var _0x58dc87={'where':_0xa54046[_0x7e3b('0x3b')]};return db[_0x7e3b('0x2b')][_0x7e3b('0x1e')](_0x58dc87)[_0x7e3b('0x25')](function(_0x173827){_0x208992[_0x7e3b('0x1e')]=_0x173827;if(_0x1d7303[_0x7e3b('0x2f')]['includeAll']){_0xa54046[_0x7e3b('0x3e')]=[{'all':!![]}];}return db[_0x7e3b('0x2b')][_0x7e3b('0x3f')](_0xa54046);})[_0x7e3b('0x25')](function(_0x4e6ccf){_0x208992[_0x7e3b('0x40')]=_0x4e6ccf;return _0x208992;})[_0x7e3b('0x25')](respondWithFilteredResult(_0x1a21ce,_0xa54046))[_0x7e3b('0x41')](handleError(_0x1a21ce,null));};exports[_0x7e3b('0x42')]=function(_0x4e8cfb,_0x2e292c){var _0x38ad2a={'raw':![],'where':{'id':_0x4e8cfb[_0x7e3b('0x43')]['id']}},_0x1b4e12={};_0x1b4e12[_0x7e3b('0x2e')]=_[_0x7e3b('0x30')](db[_0x7e3b('0x2b')][_0x7e3b('0x2c')]);_0x1b4e12['query']=_['keys'](_0x4e8cfb[_0x7e3b('0x2f')]);_0x1b4e12[_0x7e3b('0x31')]=_[_0x7e3b('0x32')](_0x1b4e12[_0x7e3b('0x2e')],_0x1b4e12[_0x7e3b('0x2f')]);_0x38ad2a[_0x7e3b('0x33')]=_[_0x7e3b('0x32')](_0x1b4e12[_0x7e3b('0x2e')],qs[_0x7e3b('0x34')](_0x4e8cfb[_0x7e3b('0x2f')][_0x7e3b('0x34')]));_0x38ad2a['attributes']=_0x38ad2a[_0x7e3b('0x33')]['length']?_0x38ad2a[_0x7e3b('0x33')]:_0x1b4e12[_0x7e3b('0x2e')];if(_0x4e8cfb[_0x7e3b('0x2f')][_0x7e3b('0x44')]){_0x38ad2a[_0x7e3b('0x3e')]=[{'all':!![]}];}_0x38ad2a=_['merge']({},_0x38ad2a,_0x4e8cfb[_0x7e3b('0x45')]);return db[_0x7e3b('0x2b')][_0x7e3b('0x46')](_0x38ad2a)[_0x7e3b('0x25')](handleEntityNotFound(_0x2e292c,null))[_0x7e3b('0x25')](respondWithResult(_0x2e292c,null))[_0x7e3b('0x41')](handleError(_0x2e292c,null));};exports[_0x7e3b('0x47')]=function(_0xb4a844,_0x2e5a8d){return db[_0x7e3b('0x2b')][_0x7e3b('0x47')](_0xb4a844[_0x7e3b('0x48')],{})['then'](respondWithResult(_0x2e5a8d,0xc9))[_0x7e3b('0x41')](handleError(_0x2e5a8d,null));};exports[_0x7e3b('0x23')]=function(_0x15c8fb,_0x4f39c5){if(_0x15c8fb[_0x7e3b('0x48')]['id']){delete _0x15c8fb[_0x7e3b('0x48')]['id'];}return db[_0x7e3b('0x2b')][_0x7e3b('0x46')]({'where':{'id':_0x15c8fb[_0x7e3b('0x43')]['id']}})[_0x7e3b('0x25')](handleEntityNotFound(_0x4f39c5,null))[_0x7e3b('0x25')](saveUpdates(_0x15c8fb[_0x7e3b('0x48')],null))[_0x7e3b('0x25')](respondWithResult(_0x4f39c5,null))[_0x7e3b('0x41')](handleError(_0x4f39c5,null));};exports[_0x7e3b('0x24')]=function(_0x116cc2,_0x2ce0fd){return db[_0x7e3b('0x2b')]['find']({'where':{'id':_0x116cc2['params']['id']}})[_0x7e3b('0x25')](handleEntityNotFound(_0x2ce0fd,null))['then'](removeEntity(_0x2ce0fd,null))[_0x7e3b('0x41')](handleError(_0x2ce0fd,null));};exports[_0x7e3b('0x49')]=function(_0x2064c9,_0x3917f2,_0x2b93c5){var _0x527e4b={};var _0x4f6b2d={};var _0x358bf9;var _0x1a48c9;return db[_0x7e3b('0x2b')][_0x7e3b('0x4a')]({'where':{'id':_0x2064c9[_0x7e3b('0x43')]['id']}})['then'](handleEntityNotFound(_0x3917f2,null))[_0x7e3b('0x25')](function(_0x6baaa){if(_0x6baaa){_0x358bf9=_0x6baaa;_0x4f6b2d[_0x7e3b('0x2e')]=_[_0x7e3b('0x30')](db[_0x7e3b('0x4b')]['rawAttributes']);_0x4f6b2d[_0x7e3b('0x2f')]=_[_0x7e3b('0x30')](_0x2064c9[_0x7e3b('0x2f')]);_0x4f6b2d[_0x7e3b('0x31')]=_[_0x7e3b('0x32')](_0x4f6b2d[_0x7e3b('0x2e')],_0x4f6b2d[_0x7e3b('0x2f')]);_0x527e4b[_0x7e3b('0x33')]=_['intersection'](_0x4f6b2d['model'],qs[_0x7e3b('0x34')](_0x2064c9[_0x7e3b('0x2f')][_0x7e3b('0x34')]));_0x527e4b['attributes']=_0x527e4b['attributes'][_0x7e3b('0x4c')]?_0x527e4b[_0x7e3b('0x33')]:_0x4f6b2d['model'];_0x527e4b['order']=qs['sort'](_0x2064c9[_0x7e3b('0x2f')][_0x7e3b('0x38')]);_0x527e4b['where']=qs[_0x7e3b('0x31')](_['pick'](_0x2064c9[_0x7e3b('0x2f')],_0x4f6b2d[_0x7e3b('0x31')]));if(_0x2064c9['query'][_0x7e3b('0x3a')]){_0x527e4b[_0x7e3b('0x3b')]=_[_0x7e3b('0x3c')](_0x527e4b[_0x7e3b('0x3b')],{'$or':_['map'](_0x527e4b[_0x7e3b('0x33')],function(_0x11c29e){var _0x5d7acf={};_0x5d7acf[_0x11c29e]={'$like':'%'+_0x2064c9[_0x7e3b('0x2f')][_0x7e3b('0x3a')]+'%'};return _0x5d7acf;})});}_0x527e4b=_[_0x7e3b('0x3c')]({},_0x527e4b,_0x2064c9[_0x7e3b('0x45')]);return _0x358bf9[_0x7e3b('0x49')](_0x527e4b);}})[_0x7e3b('0x25')](function(_0x44c65b){if(_0x44c65b){_0x1a48c9=_0x44c65b[_0x7e3b('0x4c')];if(!_0x2064c9[_0x7e3b('0x2f')][_0x7e3b('0x35')](_0x7e3b('0x36'))){_0x527e4b['limit']=qs['limit'](_0x2064c9[_0x7e3b('0x2f')][_0x7e3b('0x1d')]);_0x527e4b[_0x7e3b('0x1b')]=qs[_0x7e3b('0x1b')](_0x2064c9[_0x7e3b('0x2f')][_0x7e3b('0x1b')]);}return _0x358bf9[_0x7e3b('0x49')](_0x527e4b);}})['then'](function(_0x412699){if(_0x412699){return _0x412699?{'count':_0x1a48c9,'rows':_0x412699}:null;}})[_0x7e3b('0x25')](respondWithResult(_0x3917f2,null))[_0x7e3b('0x41')](handleError(_0x3917f2,null));};exports['addConfiguration']=function(_0x68a221,_0x323272,_0x5ef0b0){if(_0x68a221[_0x7e3b('0x48')]['id']){delete _0x68a221[_0x7e3b('0x48')]['id'];}return db[_0x7e3b('0x2b')][_0x7e3b('0x4a')]({'where':{'id':_0x68a221['params']['id']}})[_0x7e3b('0x25')](handleEntityNotFound(_0x323272,null))[_0x7e3b('0x25')](function(_0x5566ff){if(_0x5566ff){_0x68a221[_0x7e3b('0x48')]['AccountId']=_0x5566ff['id'];_0x68a221[_0x7e3b('0x48')][_0x7e3b('0x4d')]=integrations[_0x7e3b('0x4e')](_0x68a221[_0x7e3b('0x48')][_0x7e3b('0x4f')],_0x68a221['body']['type']);_0x68a221['body']['Descriptions']=integrations[_0x7e3b('0x50')](_0x68a221[_0x7e3b('0x48')][_0x7e3b('0x4f')],_0x68a221[_0x7e3b('0x48')][_0x7e3b('0x3d')]);return db[_0x7e3b('0x4b')][_0x7e3b('0x47')](_0x68a221[_0x7e3b('0x48')],{'include':[{'model':db[_0x7e3b('0x51')],'as':_0x7e3b('0x4d')},{'model':db[_0x7e3b('0x51')],'as':_0x7e3b('0x52')}]});}return null;})[_0x7e3b('0x25')](respondWithResult(_0x323272,null))[_0x7e3b('0x41')](handleError(_0x323272,null));};exports['getFields']=function(_0x52d727,_0x15534f,_0x2e8af2){var _0x1fbd00=[{'name':_0x7e3b('0x53'),'label':_0x7e3b('0x53'),'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 _0x5e1699='';return db[_0x7e3b('0x2b')][_0x7e3b('0x4a')]({'where':{'id':_0x52d727[_0x7e3b('0x43')]['id']},'attributes':['id','remoteUri',_0x7e3b('0x54'),_0x7e3b('0x55'),'password','consumerKey',_0x7e3b('0x56'),_0x7e3b('0x57'),_0x7e3b('0x58')]})[_0x7e3b('0x25')](handleEntityNotFound(_0x15534f,null))[_0x7e3b('0x25')](function(_0x102814){if(_0x102814){_0x5e1699=_0x102814[_0x7e3b('0x59')];var _0x5b3101=_0x5e1699['slice'](-0x1);if(_0x5b3101==='/'){_0x5e1699=_0x5e1699[_0x7e3b('0x5a')](0x0,_0x5e1699[_0x7e3b('0x5b')](_0x5b3101));}var _0x33cd3e={'method':'GET','uri':util[_0x7e3b('0x5c')]('%s/custom_fields',_0x5e1699),'headers':{'Content-Type':_0x7e3b('0x5d'),'Accept':'application/json'},'json':!![]};if(_0x102814[_0x7e3b('0x54')]===_0x7e3b('0x5e')){_0x33cd3e[_0x7e3b('0x5f')][_0x7e3b('0x60')]=util[_0x7e3b('0x5c')](_0x7e3b('0x61'),new Buffer(util[_0x7e3b('0x5c')](_0x7e3b('0x62'),_0x102814[_0x7e3b('0x55')],_0x102814[_0x7e3b('0x63')]))[_0x7e3b('0x64')]('base64'));}return rp(_0x33cd3e)[_0x7e3b('0x25')](function(_0x318fa0){return _0x1fbd00[_0x7e3b('0x65')](_[_0x7e3b('0x2a')](_0x318fa0[_0x7e3b('0x66')]['entries'],function(_0x2490cf){return{'id':_0x2490cf['name'],'name':_0x2490cf[_0x7e3b('0x27')],'type':_0x2490cf[_0x7e3b('0x3d')],'active':_0x2490cf[_0x7e3b('0x67')],'label':_0x2490cf[_0x7e3b('0x68')],'custom':!![]};}));});}})['then'](function(_0x4f8b56){return{'count':_0x4f8b56[_0x7e3b('0x4c')],'rows':_0x4f8b56};})[_0x7e3b('0x25')](respondWithResult(_0x15534f,null))[_0x7e3b('0x41')](function(_0x337cce){var _0x2d5b49=_0x52d727['query']['test']?0x1f4:_0x337cce['statusCode']||0x1f4;logger[_0x7e3b('0x26')](_0x7e3b('0x69'),'getFields',_0x2d5b49,JSON[_0x7e3b('0x6a')](_0x337cce));delete _0x337cce['name'];if(_0x2d5b49===0x191){_0x2d5b49=0x190;}_0x15534f[_0x7e3b('0x1f')](_0x2d5b49)['send'](_0x52d727[_0x7e3b('0x2f')]['test']?{'message':_0x7e3b('0x6b'),'statusCode':_0x337cce['statusCode']}:_0x337cce);});}; \ No newline at end of file +var _0x628d=['send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','set','json','reject','then','destroy','stack','name','index','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','DeskAccount','findAll','rows','catch','show','params','keys','rawAttributes','find','create','body','update','getConfigurations','findOne','DeskConfiguration','order','hasOwnProperty','AccountId','Subjects','getSubjects','channel','getDescriptions','DeskField','Descriptions','getFields','priority','remoteUri','authType','username','consumerKey','consumerSecret','token','tokenSecret','substring','lastIndexOf','GET','basic','Authorization','format','Basic\x20%s','toString','base64','entries','active','label','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0x628d,0xeb));var _0xd628=function(_0x493477,_0x35aee7){_0x493477=_0x493477-0x0;var _0x296f08=_0x628d[_0x493477];return _0x296f08;};'use strict';var emlformat=require(_0xd628('0x0'));var rimraf=require(_0xd628('0x1'));var zipdir=require(_0xd628('0x2'));var jsonpatch=require(_0xd628('0x3'));var rp=require(_0xd628('0x4'));var moment=require(_0xd628('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd628('0x6'));var util=require(_0xd628('0x7'));var path=require(_0xd628('0x8'));var sox=require(_0xd628('0x9'));var csv=require(_0xd628('0xa'));var ejs=require(_0xd628('0xb'));var fs=require('fs');var fs_extra=require(_0xd628('0xc'));var _=require(_0xd628('0xd'));var squel=require('squel');var crypto=require(_0xd628('0xe'));var jsforce=require(_0xd628('0xf'));var deskjs=require(_0xd628('0x10'));var toCsv=require(_0xd628('0xa'));var querystring=require(_0xd628('0x11'));var Papa=require(_0xd628('0x12'));var Redis=require('ioredis');var authService=require(_0xd628('0x13'));var qs=require(_0xd628('0x14'));var as=require(_0xd628('0x15'));var hardwareService=require(_0xd628('0x16'));var logger=require('../../config/logger')(_0xd628('0x17'));var utils=require(_0xd628('0x18'));var config=require(_0xd628('0x19'));var licenseUtil=require(_0xd628('0x1a'));var db=require(_0xd628('0x1b'))['db'];var integrations=require(_0xd628('0x1c'));function respondWithStatusCode(_0x2e5aa8,_0x5edd43){_0x5edd43=_0x5edd43||0xcc;return function(_0x11f9d9){if(_0x11f9d9){return _0x2e5aa8[_0xd628('0x1d')](_0x5edd43);}return _0x2e5aa8[_0xd628('0x1e')](_0x5edd43)[_0xd628('0x1f')]();};}function respondWithResult(_0xe5cd3d,_0x4b0f5c){_0x4b0f5c=_0x4b0f5c||0xc8;return function(_0x1871d1){if(_0x1871d1){return _0xe5cd3d['status'](_0x4b0f5c)['json'](_0x1871d1);}};}function respondWithFilteredResult(_0x2b0f07,_0x2ed1b0){return function(_0x29e12d){if(_0x29e12d){var _0x23874d=typeof _0x2ed1b0[_0xd628('0x20')]==='undefined'&&typeof _0x2ed1b0['limit']===_0xd628('0x21');var _0x482a88=_0x29e12d[_0xd628('0x22')];var _0x20056f=_0x23874d?0x0:_0x2ed1b0[_0xd628('0x20')];var _0x25cc03=_0x23874d?_0x29e12d[_0xd628('0x22')]:_0x2ed1b0[_0xd628('0x20')]+_0x2ed1b0['limit'];var _0x1aacc2;if(_0x25cc03>=_0x482a88){_0x25cc03=_0x482a88;_0x1aacc2=0xc8;}else{_0x1aacc2=0xce;}_0x2b0f07[_0xd628('0x1e')](_0x1aacc2);return _0x2b0f07[_0xd628('0x23')]('Content-Range',_0x20056f+'-'+_0x25cc03+'/'+_0x482a88)[_0xd628('0x24')](_0x29e12d);}return null;};}function patchUpdates(_0x189a58){return function(_0x287cdb){try{jsonpatch['apply'](_0x287cdb,_0x189a58,!![]);}catch(_0x5653f4){return BPromise[_0xd628('0x25')](_0x5653f4);}return _0x287cdb['save']();};}function saveUpdates(_0x2001b2,_0x2c70a4){return function(_0x2e79f2){if(_0x2e79f2){return _0x2e79f2['update'](_0x2001b2)[_0xd628('0x26')](function(_0xb42b8d){return _0xb42b8d;});}return null;};}function removeEntity(_0x3ad956,_0x59a5e4){return function(_0x5e56ef){if(_0x5e56ef){return _0x5e56ef[_0xd628('0x27')]()[_0xd628('0x26')](function(){_0x3ad956['status'](0xcc)[_0xd628('0x1f')]();});}};}function handleEntityNotFound(_0x5a5cfd,_0x64e95a){return function(_0xc78317){if(!_0xc78317){_0x5a5cfd[_0xd628('0x1d')](0x194);}return _0xc78317;};}function handleError(_0x12ab60,_0x343147){_0x343147=_0x343147||0x1f4;return function(_0x3c42fa){logger['error'](_0x3c42fa[_0xd628('0x28')]);if(_0x3c42fa[_0xd628('0x29')]){delete _0x3c42fa[_0xd628('0x29')];}_0x12ab60[_0xd628('0x1e')](_0x343147)['send'](_0x3c42fa);};}exports[_0xd628('0x2a')]=function(_0x11c957,_0x213747){var _0x4158d1={},_0x1a7c40={},_0x31b0e6={'count':0x0,'rows':[]};var _0x3a48e0=_[_0xd628('0x2b')](db['DeskAccount']['rawAttributes'],function(_0x2bca87){return{'name':_0x2bca87[_0xd628('0x2c')],'type':_0x2bca87[_0xd628('0x2d')][_0xd628('0x2e')]};});_0x1a7c40[_0xd628('0x2f')]=_[_0xd628('0x2b')](_0x3a48e0,'name');_0x1a7c40[_0xd628('0x30')]=_['keys'](_0x11c957[_0xd628('0x30')]);_0x1a7c40[_0xd628('0x31')]=_[_0xd628('0x32')](_0x1a7c40['model'],_0x1a7c40[_0xd628('0x30')]);_0x4158d1[_0xd628('0x33')]=_[_0xd628('0x32')](_0x1a7c40[_0xd628('0x2f')],qs['fields'](_0x11c957['query'][_0xd628('0x34')]));_0x4158d1[_0xd628('0x33')]=_0x4158d1[_0xd628('0x33')][_0xd628('0x35')]?_0x4158d1['attributes']:_0x1a7c40['model'];if(!_0x11c957['query']['hasOwnProperty'](_0xd628('0x36'))){_0x4158d1['limit']=qs[_0xd628('0x37')](_0x11c957[_0xd628('0x30')][_0xd628('0x37')]);_0x4158d1[_0xd628('0x20')]=qs['offset'](_0x11c957[_0xd628('0x30')][_0xd628('0x20')]);}_0x4158d1['order']=qs[_0xd628('0x38')](_0x11c957['query'][_0xd628('0x38')]);_0x4158d1[_0xd628('0x39')]=qs[_0xd628('0x31')](_['pick'](_0x11c957[_0xd628('0x30')],_0x1a7c40[_0xd628('0x31')]),_0x3a48e0);if(_0x11c957[_0xd628('0x30')][_0xd628('0x3a')]){_0x4158d1[_0xd628('0x39')]=_[_0xd628('0x3b')](_0x4158d1['where'],{'$or':_[_0xd628('0x2b')](_0x3a48e0,function(_0x4c4b61){if(_0x4c4b61[_0xd628('0x2d')]!==_0xd628('0x3c')){var _0x582faa={};_0x582faa[_0x4c4b61[_0xd628('0x29')]]={'$like':'%'+_0x11c957[_0xd628('0x30')][_0xd628('0x3a')]+'%'};return _0x582faa;}})});}_0x4158d1=_[_0xd628('0x3b')]({},_0x4158d1,_0x11c957[_0xd628('0x3d')]);var _0x137f43={'where':_0x4158d1[_0xd628('0x39')]};return db['DeskAccount'][_0xd628('0x22')](_0x137f43)[_0xd628('0x26')](function(_0x2bff32){_0x31b0e6[_0xd628('0x22')]=_0x2bff32;if(_0x11c957[_0xd628('0x30')][_0xd628('0x3e')]){_0x4158d1[_0xd628('0x3f')]=[{'all':!![]}];}return db[_0xd628('0x40')][_0xd628('0x41')](_0x4158d1);})[_0xd628('0x26')](function(_0x425cac){_0x31b0e6[_0xd628('0x42')]=_0x425cac;return _0x31b0e6;})['then'](respondWithFilteredResult(_0x213747,_0x4158d1))[_0xd628('0x43')](handleError(_0x213747,null));};exports[_0xd628('0x44')]=function(_0x54a491,_0x4a9c97){var _0x2cc36c={'raw':![],'where':{'id':_0x54a491[_0xd628('0x45')]['id']}},_0x2ecd83={};_0x2ecd83[_0xd628('0x2f')]=_[_0xd628('0x46')](db[_0xd628('0x40')][_0xd628('0x47')]);_0x2ecd83[_0xd628('0x30')]=_[_0xd628('0x46')](_0x54a491['query']);_0x2ecd83['filters']=_['intersection'](_0x2ecd83['model'],_0x2ecd83[_0xd628('0x30')]);_0x2cc36c['attributes']=_[_0xd628('0x32')](_0x2ecd83[_0xd628('0x2f')],qs['fields'](_0x54a491[_0xd628('0x30')][_0xd628('0x34')]));_0x2cc36c[_0xd628('0x33')]=_0x2cc36c[_0xd628('0x33')][_0xd628('0x35')]?_0x2cc36c['attributes']:_0x2ecd83['model'];if(_0x54a491['query'][_0xd628('0x3e')]){_0x2cc36c['include']=[{'all':!![]}];}_0x2cc36c=_[_0xd628('0x3b')]({},_0x2cc36c,_0x54a491[_0xd628('0x3d')]);return db[_0xd628('0x40')][_0xd628('0x48')](_0x2cc36c)['then'](handleEntityNotFound(_0x4a9c97,null))[_0xd628('0x26')](respondWithResult(_0x4a9c97,null))['catch'](handleError(_0x4a9c97,null));};exports['create']=function(_0x5ed823,_0x5a3472){return db[_0xd628('0x40')][_0xd628('0x49')](_0x5ed823[_0xd628('0x4a')],{})['then'](respondWithResult(_0x5a3472,0xc9))['catch'](handleError(_0x5a3472,null));};exports[_0xd628('0x4b')]=function(_0x2ab8ce,_0x598f14){if(_0x2ab8ce['body']['id']){delete _0x2ab8ce[_0xd628('0x4a')]['id'];}return db[_0xd628('0x40')][_0xd628('0x48')]({'where':{'id':_0x2ab8ce[_0xd628('0x45')]['id']}})['then'](handleEntityNotFound(_0x598f14,null))['then'](saveUpdates(_0x2ab8ce[_0xd628('0x4a')],null))[_0xd628('0x26')](respondWithResult(_0x598f14,null))[_0xd628('0x43')](handleError(_0x598f14,null));};exports[_0xd628('0x27')]=function(_0x27ef26,_0x2d7496){return db[_0xd628('0x40')][_0xd628('0x48')]({'where':{'id':_0x27ef26[_0xd628('0x45')]['id']}})[_0xd628('0x26')](handleEntityNotFound(_0x2d7496,null))[_0xd628('0x26')](removeEntity(_0x2d7496,null))[_0xd628('0x43')](handleError(_0x2d7496,null));};exports[_0xd628('0x4c')]=function(_0x32dacd,_0x4462b1,_0xa9dda6){var _0x5b3796={};var _0x49de2a={};var _0x201c5e;var _0x50d3b6;return db[_0xd628('0x40')][_0xd628('0x4d')]({'where':{'id':_0x32dacd[_0xd628('0x45')]['id']}})[_0xd628('0x26')](handleEntityNotFound(_0x4462b1,null))[_0xd628('0x26')](function(_0x51be41){if(_0x51be41){_0x201c5e=_0x51be41;_0x49de2a['model']=_[_0xd628('0x46')](db[_0xd628('0x4e')][_0xd628('0x47')]);_0x49de2a['query']=_[_0xd628('0x46')](_0x32dacd['query']);_0x49de2a[_0xd628('0x31')]=_[_0xd628('0x32')](_0x49de2a[_0xd628('0x2f')],_0x49de2a['query']);_0x5b3796[_0xd628('0x33')]=_[_0xd628('0x32')](_0x49de2a[_0xd628('0x2f')],qs[_0xd628('0x34')](_0x32dacd[_0xd628('0x30')][_0xd628('0x34')]));_0x5b3796['attributes']=_0x5b3796['attributes'][_0xd628('0x35')]?_0x5b3796[_0xd628('0x33')]:_0x49de2a[_0xd628('0x2f')];_0x5b3796[_0xd628('0x4f')]=qs[_0xd628('0x38')](_0x32dacd[_0xd628('0x30')][_0xd628('0x38')]);_0x5b3796[_0xd628('0x39')]=qs['filters'](_['pick'](_0x32dacd[_0xd628('0x30')],_0x49de2a[_0xd628('0x31')]));if(_0x32dacd['query'][_0xd628('0x3a')]){_0x5b3796['where']=_[_0xd628('0x3b')](_0x5b3796[_0xd628('0x39')],{'$or':_[_0xd628('0x2b')](_0x5b3796[_0xd628('0x33')],function(_0x3810f1){var _0x216697={};_0x216697[_0x3810f1]={'$like':'%'+_0x32dacd[_0xd628('0x30')][_0xd628('0x3a')]+'%'};return _0x216697;})});}_0x5b3796=_[_0xd628('0x3b')]({},_0x5b3796,_0x32dacd[_0xd628('0x3d')]);return _0x201c5e[_0xd628('0x4c')](_0x5b3796);}})['then'](function(_0x10f3f7){if(_0x10f3f7){_0x50d3b6=_0x10f3f7[_0xd628('0x35')];if(!_0x32dacd[_0xd628('0x30')][_0xd628('0x50')](_0xd628('0x36'))){_0x5b3796[_0xd628('0x37')]=qs[_0xd628('0x37')](_0x32dacd['query'][_0xd628('0x37')]);_0x5b3796[_0xd628('0x20')]=qs[_0xd628('0x20')](_0x32dacd[_0xd628('0x30')]['offset']);}return _0x201c5e['getConfigurations'](_0x5b3796);}})[_0xd628('0x26')](function(_0x472ef8){if(_0x472ef8){return _0x472ef8?{'count':_0x50d3b6,'rows':_0x472ef8}:null;}})[_0xd628('0x26')](respondWithResult(_0x4462b1,null))[_0xd628('0x43')](handleError(_0x4462b1,null));};exports['addConfiguration']=function(_0x42e140,_0x1cc06c,_0x450b0d){if(_0x42e140[_0xd628('0x4a')]['id']){delete _0x42e140[_0xd628('0x4a')]['id'];}return db[_0xd628('0x40')][_0xd628('0x4d')]({'where':{'id':_0x42e140['params']['id']}})[_0xd628('0x26')](handleEntityNotFound(_0x1cc06c,null))[_0xd628('0x26')](function(_0x317b9a){if(_0x317b9a){_0x42e140[_0xd628('0x4a')][_0xd628('0x51')]=_0x317b9a['id'];_0x42e140[_0xd628('0x4a')][_0xd628('0x52')]=integrations[_0xd628('0x53')](_0x42e140[_0xd628('0x4a')][_0xd628('0x54')],_0x42e140['body'][_0xd628('0x2d')]);_0x42e140[_0xd628('0x4a')]['Descriptions']=integrations[_0xd628('0x55')](_0x42e140[_0xd628('0x4a')][_0xd628('0x54')],_0x42e140[_0xd628('0x4a')][_0xd628('0x2d')]);return db['DeskConfiguration']['create'](_0x42e140['body'],{'include':[{'model':db[_0xd628('0x56')],'as':_0xd628('0x52')},{'model':db[_0xd628('0x56')],'as':_0xd628('0x57')}]});}return null;})[_0xd628('0x26')](respondWithResult(_0x1cc06c,null))[_0xd628('0x43')](handleError(_0x1cc06c,null));};exports[_0xd628('0x58')]=function(_0x5cbf95,_0xcc8d74,_0x25cb43){var _0xdb272c=[{'name':'priority','label':_0xd628('0x59'),'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 _0x58f55f='';return db[_0xd628('0x40')][_0xd628('0x4d')]({'where':{'id':_0x5cbf95[_0xd628('0x45')]['id']},'attributes':['id',_0xd628('0x5a'),_0xd628('0x5b'),_0xd628('0x5c'),'password',_0xd628('0x5d'),_0xd628('0x5e'),_0xd628('0x5f'),_0xd628('0x60')]})[_0xd628('0x26')](handleEntityNotFound(_0xcc8d74,null))[_0xd628('0x26')](function(_0x192775){if(_0x192775){_0x58f55f=_0x192775['remoteUri'];var _0x34ebe9=_0x58f55f['slice'](-0x1);if(_0x34ebe9==='/'){_0x58f55f=_0x58f55f[_0xd628('0x61')](0x0,_0x58f55f[_0xd628('0x62')](_0x34ebe9));}var _0x231a07={'method':_0xd628('0x63'),'uri':util['format']('%s/custom_fields',_0x58f55f),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0x192775[_0xd628('0x5b')]===_0xd628('0x64')){_0x231a07['headers'][_0xd628('0x65')]=util[_0xd628('0x66')](_0xd628('0x67'),new Buffer(util[_0xd628('0x66')]('%s:%s',_0x192775[_0xd628('0x5c')],_0x192775['password']))[_0xd628('0x68')](_0xd628('0x69')));}return rp(_0x231a07)[_0xd628('0x26')](function(_0x524b0c){return _0xdb272c['concat'](_[_0xd628('0x2b')](_0x524b0c['_embedded'][_0xd628('0x6a')],function(_0x3973f9){return{'id':_0x3973f9['name'],'name':_0x3973f9[_0xd628('0x29')],'type':_0x3973f9[_0xd628('0x2d')],'active':_0x3973f9[_0xd628('0x6b')],'label':_0x3973f9[_0xd628('0x6c')],'custom':!![]};}));});}})[_0xd628('0x26')](function(_0x247274){return{'count':_0x247274[_0xd628('0x35')],'rows':_0x247274};})[_0xd628('0x26')](respondWithResult(_0xcc8d74,null))['catch'](function(_0x267071){var _0x446ee7=_0x5cbf95[_0xd628('0x30')]['test']?0x1f4:_0x267071[_0xd628('0x6d')]||0x1f4;logger[_0xd628('0x6e')](_0xd628('0x6f'),_0xd628('0x58'),_0x446ee7,JSON[_0xd628('0x70')](_0x267071));delete _0x267071['name'];if(_0x446ee7===0x191){_0x446ee7=0x190;}_0xcc8d74[_0xd628('0x1e')](_0x446ee7)[_0xd628('0x71')](_0x5cbf95[_0xd628('0x30')][_0xd628('0x72')]?{'message':_0xd628('0x73'),'statusCode':_0x267071[_0xd628('0x6d')]}:_0x267071);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 0f9ba27..9981ef0 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 _0xf839=['../../components/integrations/configuration','define','DeskAccount','int_desk_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intDeskAccount.attributes'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xf839,0x1cb));var _0x9f83=function(_0x4370a3,_0x3adfa3){_0x4370a3=_0x4370a3-0x0;var _0x21fb72=_0xf839[_0x4370a3];return _0x21fb72;};'use strict';var _=require('lodash');var util=require(_0x9f83('0x0'));var logger=require(_0x9f83('0x1'))(_0x9f83('0x2'));var moment=require(_0x9f83('0x3'));var BPromise=require(_0x9f83('0x4'));var rp=require(_0x9f83('0x5'));var fs=require('fs');var path=require(_0x9f83('0x6'));var rimraf=require('rimraf');var config=require(_0x9f83('0x7'));var attributes=require(_0x9f83('0x8'));var integrations=require(_0x9f83('0x9'));module['exports']=function(_0x5560f9,_0x2964e0){return _0x5560f9[_0x9f83('0xa')](_0x9f83('0xb'),attributes,{'tableName':_0x9f83('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe53b=['util','api','bluebird','path','rimraf','../../config/environment','define','lodash'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0xe53b,0x1cf));var _0xbe53=function(_0x2e52f2,_0x2c5f5a){_0x2e52f2=_0x2e52f2-0x0;var _0x2d1802=_0xe53b[_0x2e52f2];return _0x2d1802;};'use strict';var _=require(_0xbe53('0x0'));var util=require(_0xbe53('0x1'));var logger=require('../../config/logger')(_0xbe53('0x2'));var moment=require('moment');var BPromise=require(_0xbe53('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe53('0x4'));var rimraf=require(_0xbe53('0x5'));var config=require(_0xbe53('0x6'));var attributes=require('./intDeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x5ae78b,_0xc435dc){return _0x5ae78b[_0xbe53('0x7')]('DeskAccount',attributes,{'tableName':'int_desk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 4a0af1b..5c84761 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 _0xf9c7=['then','info','DeskAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','GetDeskAccount','findAll','options','raw','attributes','include','model','map','ShowDeskAccount','DeskAccount','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xf9c7,0x1e9));var _0x7f9c=function(_0x49fb35,_0x121edc){_0x49fb35=_0x49fb35-0x0;var _0xd05ed7=_0xf9c7[_0x49fb35];return _0xd05ed7;};'use strict';var _=require(_0x7f9c('0x0'));var util=require(_0x7f9c('0x1'));var moment=require(_0x7f9c('0x2'));var BPromise=require(_0x7f9c('0x3'));var rs=require(_0x7f9c('0x4'));var fs=require('fs');var Redis=require(_0x7f9c('0x5'));var db=require(_0x7f9c('0x6'))['db'];var utils=require(_0x7f9c('0x7'));var logger=require(_0x7f9c('0x8'))(_0x7f9c('0x9'));var config=require(_0x7f9c('0xa'));var jayson=require(_0x7f9c('0xb'));var client=jayson[_0x7f9c('0xc')][_0x7f9c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x130e95,_0x2f6891,_0x47d406){return new BPromise(function(_0x2128e6,_0x2421ea){return client[_0x7f9c('0xe')](_0x130e95,_0x47d406)[_0x7f9c('0xf')](function(_0x2e122d){logger[_0x7f9c('0x10')](_0x7f9c('0x11'),_0x2f6891,'request\x20sent');logger[_0x7f9c('0x12')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x2f6891,'request\x20sent',JSON[_0x7f9c('0x13')](_0x2e122d));if(_0x2e122d[_0x7f9c('0x14')]){if(_0x2e122d[_0x7f9c('0x14')][_0x7f9c('0x15')]===0x1f4){logger[_0x7f9c('0x14')](_0x7f9c('0x11'),_0x2f6891,_0x2e122d[_0x7f9c('0x14')][_0x7f9c('0x16')]);return _0x2421ea(_0x2e122d[_0x7f9c('0x14')][_0x7f9c('0x16')]);}logger[_0x7f9c('0x14')](_0x7f9c('0x11'),_0x2f6891,_0x2e122d[_0x7f9c('0x14')]['message']);return _0x2128e6(_0x2e122d[_0x7f9c('0x14')][_0x7f9c('0x16')]);}else{logger['info'](_0x7f9c('0x11'),_0x2f6891,_0x7f9c('0x17'));_0x2128e6(_0x2e122d['result']['message']);}})[_0x7f9c('0x18')](function(_0x2b74ed){logger['error'](_0x7f9c('0x11'),_0x2f6891,_0x2b74ed);_0x2421ea(_0x2b74ed);});});}exports[_0x7f9c('0x19')]=function(_0x15e08c){var _0x186599=this;return new Promise(function(_0x4fb29c,_0x3113e4){return db['DeskAccount'][_0x7f9c('0x1a')]({'raw':_0x15e08c[_0x7f9c('0x1b')]?_0x15e08c['options'][_0x7f9c('0x1c')]===undefined?!![]:![]:!![],'where':_0x15e08c[_0x7f9c('0x1b')]?_0x15e08c[_0x7f9c('0x1b')]['where']||null:null,'attributes':_0x15e08c[_0x7f9c('0x1b')]?_0x15e08c[_0x7f9c('0x1b')][_0x7f9c('0x1d')]||null:null,'limit':_0x15e08c['options']?_0x15e08c[_0x7f9c('0x1b')]['limit']||null:null,'include':_0x15e08c['options']?_0x15e08c[_0x7f9c('0x1b')]['include']?_['map'](_0x15e08c[_0x7f9c('0x1b')][_0x7f9c('0x1e')],function(_0xf879a6){return{'model':db[_0xf879a6[_0x7f9c('0x1f')]],'as':_0xf879a6['as'],'attributes':_0xf879a6[_0x7f9c('0x1d')],'include':_0xf879a6[_0x7f9c('0x1e')]?_[_0x7f9c('0x20')](_0xf879a6[_0x7f9c('0x1e')],function(_0x181d42){return{'model':db[_0x181d42[_0x7f9c('0x1f')]],'as':_0x181d42['as'],'attributes':_0x181d42['attributes'],'include':_0x181d42[_0x7f9c('0x1e')]?_[_0x7f9c('0x20')](_0x181d42[_0x7f9c('0x1e')],function(_0x2c49d8){return{'model':db[_0x2c49d8[_0x7f9c('0x1f')]],'as':_0x2c49d8['as'],'attributes':_0x2c49d8[_0x7f9c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7f9c('0xf')](function(_0x2787b2){logger[_0x7f9c('0x10')]('GetDeskAccount',_0x15e08c);logger[_0x7f9c('0x12')](_0x7f9c('0x19'),_0x15e08c,JSON[_0x7f9c('0x13')](_0x2787b2));_0x4fb29c(_0x2787b2);})[_0x7f9c('0x18')](function(_0xf43824){logger['error']('GetDeskAccount',_0xf43824[_0x7f9c('0x16')],_0x15e08c);_0x3113e4(_0x186599[_0x7f9c('0x14')](0x1f4,_0xf43824[_0x7f9c('0x16')]));});});};exports[_0x7f9c('0x21')]=function(_0x4d77e8){var _0x13f6bd=this;return new Promise(function(_0x3b5baa,_0x1c67c2){return db[_0x7f9c('0x22')][_0x7f9c('0x23')]({'raw':_0x4d77e8[_0x7f9c('0x1b')]?_0x4d77e8[_0x7f9c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4d77e8['options']?_0x4d77e8[_0x7f9c('0x1b')]['where']||null:null,'attributes':_0x4d77e8[_0x7f9c('0x1b')]?_0x4d77e8[_0x7f9c('0x1b')][_0x7f9c('0x1d')]||null:null,'include':_0x4d77e8[_0x7f9c('0x1b')]?_0x4d77e8['options'][_0x7f9c('0x1e')]?_['map'](_0x4d77e8[_0x7f9c('0x1b')][_0x7f9c('0x1e')],function(_0x1382e6){return{'model':db[_0x1382e6[_0x7f9c('0x1f')]],'as':_0x1382e6['as'],'attributes':_0x1382e6[_0x7f9c('0x1d')],'include':_0x1382e6[_0x7f9c('0x1e')]?_[_0x7f9c('0x20')](_0x1382e6[_0x7f9c('0x1e')],function(_0x267be4){return{'model':db[_0x267be4[_0x7f9c('0x1f')]],'as':_0x267be4['as'],'attributes':_0x267be4[_0x7f9c('0x1d')],'include':_0x267be4[_0x7f9c('0x1e')]?_['map'](_0x267be4[_0x7f9c('0x1e')],function(_0xba2c71){return{'model':db[_0xba2c71['model']],'as':_0xba2c71['as'],'attributes':_0xba2c71[_0x7f9c('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x351ee4){logger['info'](_0x7f9c('0x21'),_0x4d77e8);logger[_0x7f9c('0x12')]('ShowDeskAccount',_0x4d77e8,JSON[_0x7f9c('0x13')](_0x351ee4));_0x3b5baa(_0x351ee4);})['catch'](function(_0x34a733){logger[_0x7f9c('0x14')](_0x7f9c('0x21'),_0x34a733[_0x7f9c('0x16')],_0x4d77e8);_0x1c67c2(_0x13f6bd[_0x7f9c('0x14')](0x1f4,_0x34a733[_0x7f9c('0x16')]));});});}; \ No newline at end of file +var _0x248e=['http','then','info','request\x20sent','stringify','error','code','message','DeskAccount,\x20%s,\x20%s','result','catch','GetDeskAccount','DeskAccount','options','limit','include','model','attributes','map','ShowDeskAccount','find','raw','where','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x509273,_0x13fc9f){var _0x38ef40=function(_0xf8d4c9){while(--_0xf8d4c9){_0x509273['push'](_0x509273['shift']());}};_0x38ef40(++_0x13fc9f);}(_0x248e,0x93));var _0xe248=function(_0x1a7e3c,_0x2f98a1){_0x1a7e3c=_0x1a7e3c-0x0;var _0x4cfea9=_0x248e[_0x1a7e3c];return _0x4cfea9;};'use strict';var _=require(_0xe248('0x0'));var util=require(_0xe248('0x1'));var moment=require(_0xe248('0x2'));var BPromise=require('bluebird');var rs=require(_0xe248('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe248('0x4'));var logger=require(_0xe248('0x5'))(_0xe248('0x6'));var config=require(_0xe248('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xe248('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2e5a61,_0x27a0ba,_0x121577){return new BPromise(function(_0x4bb895,_0x2f99fd){return client['request'](_0x2e5a61,_0x121577)[_0xe248('0x9')](function(_0x20ec29){logger[_0xe248('0xa')]('DeskAccount,\x20%s,\x20%s',_0x27a0ba,_0xe248('0xb'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x27a0ba,'request\x20sent',JSON[_0xe248('0xc')](_0x20ec29));if(_0x20ec29[_0xe248('0xd')]){if(_0x20ec29[_0xe248('0xd')][_0xe248('0xe')]===0x1f4){logger[_0xe248('0xd')]('DeskAccount,\x20%s,\x20%s',_0x27a0ba,_0x20ec29[_0xe248('0xd')]['message']);return _0x2f99fd(_0x20ec29['error'][_0xe248('0xf')]);}logger[_0xe248('0xd')](_0xe248('0x10'),_0x27a0ba,_0x20ec29[_0xe248('0xd')][_0xe248('0xf')]);return _0x4bb895(_0x20ec29[_0xe248('0xd')][_0xe248('0xf')]);}else{logger[_0xe248('0xa')](_0xe248('0x10'),_0x27a0ba,_0xe248('0xb'));_0x4bb895(_0x20ec29[_0xe248('0x11')]['message']);}})[_0xe248('0x12')](function(_0x3a8750){logger[_0xe248('0xd')](_0xe248('0x10'),_0x27a0ba,_0x3a8750);_0x2f99fd(_0x3a8750);});});}exports[_0xe248('0x13')]=function(_0x49ca7c){var _0x59080d=this;return new Promise(function(_0x5ab4a8,_0x414139){return db[_0xe248('0x14')]['findAll']({'raw':_0x49ca7c['options']?_0x49ca7c['options']['raw']===undefined?!![]:![]:!![],'where':_0x49ca7c[_0xe248('0x15')]?_0x49ca7c[_0xe248('0x15')]['where']||null:null,'attributes':_0x49ca7c[_0xe248('0x15')]?_0x49ca7c['options']['attributes']||null:null,'limit':_0x49ca7c[_0xe248('0x15')]?_0x49ca7c['options'][_0xe248('0x16')]||null:null,'include':_0x49ca7c['options']?_0x49ca7c[_0xe248('0x15')][_0xe248('0x17')]?_['map'](_0x49ca7c['options'][_0xe248('0x17')],function(_0x34a864){return{'model':db[_0x34a864[_0xe248('0x18')]],'as':_0x34a864['as'],'attributes':_0x34a864[_0xe248('0x19')],'include':_0x34a864[_0xe248('0x17')]?_['map'](_0x34a864[_0xe248('0x17')],function(_0x4cadca){return{'model':db[_0x4cadca[_0xe248('0x18')]],'as':_0x4cadca['as'],'attributes':_0x4cadca[_0xe248('0x19')],'include':_0x4cadca[_0xe248('0x17')]?_[_0xe248('0x1a')](_0x4cadca[_0xe248('0x17')],function(_0x5e3b15){return{'model':db[_0x5e3b15['model']],'as':_0x5e3b15['as'],'attributes':_0x5e3b15[_0xe248('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe248('0x9')](function(_0x9aa305){logger[_0xe248('0xa')](_0xe248('0x13'),_0x49ca7c);logger['debug'](_0xe248('0x13'),_0x49ca7c,JSON['stringify'](_0x9aa305));_0x5ab4a8(_0x9aa305);})[_0xe248('0x12')](function(_0x496a21){logger[_0xe248('0xd')](_0xe248('0x13'),_0x496a21[_0xe248('0xf')],_0x49ca7c);_0x414139(_0x59080d[_0xe248('0xd')](0x1f4,_0x496a21[_0xe248('0xf')]));});});};exports[_0xe248('0x1b')]=function(_0x169c55){var _0x34a7a0=this;return new Promise(function(_0x372f85,_0x3101f4){return db[_0xe248('0x14')][_0xe248('0x1c')]({'raw':_0x169c55[_0xe248('0x15')]?_0x169c55[_0xe248('0x15')][_0xe248('0x1d')]===undefined?!![]:![]:!![],'where':_0x169c55['options']?_0x169c55[_0xe248('0x15')][_0xe248('0x1e')]||null:null,'attributes':_0x169c55[_0xe248('0x15')]?_0x169c55[_0xe248('0x15')][_0xe248('0x19')]||null:null,'include':_0x169c55['options']?_0x169c55[_0xe248('0x15')][_0xe248('0x17')]?_[_0xe248('0x1a')](_0x169c55[_0xe248('0x15')][_0xe248('0x17')],function(_0x16406c){return{'model':db[_0x16406c[_0xe248('0x18')]],'as':_0x16406c['as'],'attributes':_0x16406c['attributes'],'include':_0x16406c[_0xe248('0x17')]?_[_0xe248('0x1a')](_0x16406c['include'],function(_0x1b7471){return{'model':db[_0x1b7471[_0xe248('0x18')]],'as':_0x1b7471['as'],'attributes':_0x1b7471['attributes'],'include':_0x1b7471['include']?_[_0xe248('0x1a')](_0x1b7471['include'],function(_0x4db475){return{'model':db[_0x4db475[_0xe248('0x18')]],'as':_0x4db475['as'],'attributes':_0x4db475['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3af378){logger[_0xe248('0xa')]('ShowDeskAccount',_0x169c55);logger['debug'](_0xe248('0x1b'),_0x169c55,JSON['stringify'](_0x3af378));_0x372f85(_0x3af378);})[_0xe248('0x12')](function(_0x2e87e4){logger[_0xe248('0xd')]('ShowDeskAccount',_0x2e87e4[_0xe248('0xf')],_0x169c55);_0x3101f4(_0x34a7a0['error'](0x1f4,_0x2e87e4['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 415296f..ee0d9c5 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 _0x9c44=['destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./intDeskConfiguration.controller','isAuthenticated','index','get','/:id','/:id/fields','getFields','getSubjects','/:id/descriptions','/:id/tags','post','setTags','put','update'];(function(_0x3eee0a,_0x915548){var _0x1051b4=function(_0x309bb8){while(--_0x309bb8){_0x3eee0a['push'](_0x3eee0a['shift']());}};_0x1051b4(++_0x915548);}(_0x9c44,0x178));var _0x49c4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x9c44[_0x565c49];return _0x20ca34;};'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 fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/subjects',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['get'](_0x49c4('0xe'),auth[_0x49c4('0x7')](),controller['getDescriptions']);router['get'](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller['getTags']);router[_0x49c4('0x10')]('/',auth[_0x49c4('0x7')](),controller['create']);router[_0x49c4('0x10')](_0x49c4('0xf'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x11')]);router[_0x49c4('0x12')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x13')]);router['delete'](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module[_0x49c4('0x15')]=router; \ No newline at end of file +var _0x9957=['/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields'];(function(_0x2ba1de,_0x957602){var _0x2abdf9=function(_0x37b2ba){while(--_0x37b2ba){_0x2ba1de['push'](_0x2ba1de['shift']());}};_0x2abdf9(++_0x957602);}(_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 fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/fields',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/descriptions',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x17')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x18')]);router[_0x7995('0x19')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller['destroy']);module[_0x7995('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 9c796e3..478d770 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 _0x71f9=['STRING','sequelize'];(function(_0x56d0d0,_0x36961a){var _0x20b608=function(_0x1657c4){while(--_0x1657c4){_0x56d0d0['push'](_0x56d0d0['shift']());}};_0x20b608(++_0x36961a);}(_0x71f9,0xff));var _0x971f=function(_0xed1ba6,_0x23f317){_0xed1ba6=_0xed1ba6-0x0;var _0xd9036b=_0x71f9[_0xed1ba6];return _0xd9036b;};'use strict';var Sequelize=require(_0x971f('0x0'));module['exports']={'name':{'type':Sequelize[_0x971f('0x1')]},'description':{'type':Sequelize[_0x971f('0x1')]}}; \ No newline at end of file +var _0x53fb=['sequelize','exports','STRING'];(function(_0x8aa16c,_0x18db4c){var _0x5910f2=function(_0x1604ec){while(--_0x1604ec){_0x8aa16c['push'](_0x8aa16c['shift']());}};_0x5910f2(++_0x18db4c);}(_0x53fb,0xd8));var _0xb53f=function(_0x2d30b9,_0x32cc73){_0x2d30b9=_0x2d30b9-0x0;var _0x16c52e=_0x53fb[_0x2d30b9];return _0x16c52e;};'use strict';var Sequelize=require(_0xb53f('0x0'));module[_0xb53f('0x1')]={'name':{'type':Sequelize[_0xb53f('0x2')]},'description':{'type':Sequelize[_0xb53f('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 2d214d4..83ee3a9 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 _0x4c5e=['nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','includeAll','include','find','create','body','update','getFields','findOne','params','DeskField','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty'];(function(_0x3542d2,_0x4586bb){var _0x175eac=function(_0x471df9){while(--_0x471df9){_0x3542d2['push'](_0x3542d2['shift']());}};_0x175eac(++_0x4586bb);}(_0x4c5e,0x73));var _0xe4c5=function(_0x367954,_0x54cdcc){_0x367954=_0x367954-0x0;var _0x4268aa=_0x4c5e[_0x367954];return _0x4268aa;};'use strict';var emlformat=require(_0xe4c5('0x0'));var rimraf=require(_0xe4c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe4c5('0x2'));var rp=require(_0xe4c5('0x3'));var moment=require(_0xe4c5('0x4'));var BPromise=require(_0xe4c5('0x5'));var Mustache=require(_0xe4c5('0x6'));var util=require(_0xe4c5('0x7'));var path=require(_0xe4c5('0x8'));var sox=require(_0xe4c5('0x9'));var csv=require(_0xe4c5('0xa'));var ejs=require(_0xe4c5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe4c5('0xc'));var crypto=require(_0xe4c5('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe4c5('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe4c5('0xf'));var Papa=require(_0xe4c5('0x10'));var Redis=require('ioredis');var authService=require(_0xe4c5('0x11'));var qs=require(_0xe4c5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4c5('0x13'));var logger=require(_0xe4c5('0x14'))(_0xe4c5('0x15'));var utils=require('../../config/utils');var config=require(_0xe4c5('0x16'));var licenseUtil=require(_0xe4c5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x253dde,_0x103844){_0x103844=_0x103844||0xcc;return function(_0xe673ed){if(_0xe673ed){return _0x253dde[_0xe4c5('0x18')](_0x103844);}return _0x253dde[_0xe4c5('0x19')](_0x103844)[_0xe4c5('0x1a')]();};}function respondWithResult(_0x5c8819,_0x1e91a7){_0x1e91a7=_0x1e91a7||0xc8;return function(_0x3e98b4){if(_0x3e98b4){return _0x5c8819[_0xe4c5('0x19')](_0x1e91a7)[_0xe4c5('0x1b')](_0x3e98b4);}};}function respondWithFilteredResult(_0x70094d,_0x20a4aa){return function(_0x4d834f){if(_0x4d834f){var _0x2c7e3c=typeof _0x20a4aa['offset']==='undefined'&&typeof _0x20a4aa[_0xe4c5('0x1c')]===_0xe4c5('0x1d');var _0x3ba63c=_0x4d834f[_0xe4c5('0x1e')];var _0x1cbb32=_0x2c7e3c?0x0:_0x20a4aa[_0xe4c5('0x1f')];var _0x2a9178=_0x2c7e3c?_0x4d834f['count']:_0x20a4aa[_0xe4c5('0x1f')]+_0x20a4aa[_0xe4c5('0x1c')];var _0x477a2e;if(_0x2a9178>=_0x3ba63c){_0x2a9178=_0x3ba63c;_0x477a2e=0xc8;}else{_0x477a2e=0xce;}_0x70094d[_0xe4c5('0x19')](_0x477a2e);return _0x70094d[_0xe4c5('0x20')](_0xe4c5('0x21'),_0x1cbb32+'-'+_0x2a9178+'/'+_0x3ba63c)[_0xe4c5('0x1b')](_0x4d834f);}return null;};}function patchUpdates(_0x86454b){return function(_0x59ac74){try{jsonpatch[_0xe4c5('0x22')](_0x59ac74,_0x86454b,!![]);}catch(_0x3b6f68){return BPromise['reject'](_0x3b6f68);}return _0x59ac74[_0xe4c5('0x23')]();};}function saveUpdates(_0x17c980,_0xe0cf68){return function(_0x496540){if(_0x496540){return _0x496540['update'](_0x17c980)[_0xe4c5('0x24')](function(_0xd0669e){return _0xd0669e;});}return null;};}function removeEntity(_0x23c08b,_0x4505d3){return function(_0x4fd9f3){if(_0x4fd9f3){return _0x4fd9f3[_0xe4c5('0x25')]()[_0xe4c5('0x24')](function(){_0x23c08b[_0xe4c5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b516f,_0x4507bf){return function(_0x5c85c8){if(!_0x5c85c8){_0x4b516f['sendStatus'](0x194);}return _0x5c85c8;};}function handleError(_0x5f5d53,_0x366949){_0x366949=_0x366949||0x1f4;return function(_0x47dd35){logger[_0xe4c5('0x26')](_0x47dd35[_0xe4c5('0x27')]);if(_0x47dd35['name']){delete _0x47dd35[_0xe4c5('0x28')];}_0x5f5d53[_0xe4c5('0x19')](_0x366949)[_0xe4c5('0x29')](_0x47dd35);};}exports[_0xe4c5('0x2a')]=function(_0x35ef84,_0x56a802){var _0x44e92b={},_0x450e1f={},_0x4205fc={'count':0x0,'rows':[]};var _0x4179aa=_[_0xe4c5('0x2b')](db[_0xe4c5('0x2c')][_0xe4c5('0x2d')],function(_0x4f2bbf){return{'name':_0x4f2bbf[_0xe4c5('0x2e')],'type':_0x4f2bbf['type'][_0xe4c5('0x2f')]};});_0x450e1f['model']=_[_0xe4c5('0x2b')](_0x4179aa,_0xe4c5('0x28'));_0x450e1f[_0xe4c5('0x30')]=_[_0xe4c5('0x31')](_0x35ef84['query']);_0x450e1f[_0xe4c5('0x32')]=_['intersection'](_0x450e1f[_0xe4c5('0x33')],_0x450e1f[_0xe4c5('0x30')]);_0x44e92b[_0xe4c5('0x34')]=_[_0xe4c5('0x35')](_0x450e1f['model'],qs[_0xe4c5('0x36')](_0x35ef84[_0xe4c5('0x30')][_0xe4c5('0x36')]));_0x44e92b['attributes']=_0x44e92b[_0xe4c5('0x34')][_0xe4c5('0x37')]?_0x44e92b['attributes']:_0x450e1f[_0xe4c5('0x33')];if(!_0x35ef84[_0xe4c5('0x30')][_0xe4c5('0x38')](_0xe4c5('0x39'))){_0x44e92b['limit']=qs[_0xe4c5('0x1c')](_0x35ef84[_0xe4c5('0x30')]['limit']);_0x44e92b[_0xe4c5('0x1f')]=qs[_0xe4c5('0x1f')](_0x35ef84[_0xe4c5('0x30')][_0xe4c5('0x1f')]);}_0x44e92b[_0xe4c5('0x3a')]=qs[_0xe4c5('0x3b')](_0x35ef84['query'][_0xe4c5('0x3b')]);_0x44e92b[_0xe4c5('0x3c')]=qs[_0xe4c5('0x32')](_[_0xe4c5('0x3d')](_0x35ef84[_0xe4c5('0x30')],_0x450e1f[_0xe4c5('0x32')]),_0x4179aa);if(_0x35ef84[_0xe4c5('0x30')][_0xe4c5('0x3e')]){_0x44e92b[_0xe4c5('0x3c')]=_[_0xe4c5('0x3f')](_0x44e92b[_0xe4c5('0x3c')],{'$or':_[_0xe4c5('0x2b')](_0x4179aa,function(_0x58297d){if(_0x58297d['type']!==_0xe4c5('0x40')){var _0x2254a4={};_0x2254a4[_0x58297d['name']]={'$like':'%'+_0x35ef84[_0xe4c5('0x30')][_0xe4c5('0x3e')]+'%'};return _0x2254a4;}})});}_0x44e92b=_[_0xe4c5('0x3f')]({},_0x44e92b,_0x35ef84[_0xe4c5('0x41')]);var _0xd52523={'where':_0x44e92b[_0xe4c5('0x3c')]};return db['DeskConfiguration'][_0xe4c5('0x1e')](_0xd52523)['then'](function(_0x491f60){_0x4205fc['count']=_0x491f60;if(_0x35ef84['query']['includeAll']){_0x44e92b['include']=[{'all':!![]}];}return db['DeskConfiguration'][_0xe4c5('0x42')](_0x44e92b);})['then'](function(_0x7b502c){_0x4205fc[_0xe4c5('0x43')]=_0x7b502c;return _0x4205fc;})[_0xe4c5('0x24')](respondWithFilteredResult(_0x56a802,_0x44e92b))[_0xe4c5('0x44')](handleError(_0x56a802,null));};exports[_0xe4c5('0x45')]=function(_0x33b768,_0x4989d4){var _0x4d2c41={'raw':![],'where':{'id':_0x33b768['params']['id']}},_0x145437={};_0x145437[_0xe4c5('0x33')]=_[_0xe4c5('0x31')](db['DeskConfiguration'][_0xe4c5('0x2d')]);_0x145437[_0xe4c5('0x30')]=_[_0xe4c5('0x31')](_0x33b768[_0xe4c5('0x30')]);_0x145437[_0xe4c5('0x32')]=_['intersection'](_0x145437[_0xe4c5('0x33')],_0x145437['query']);_0x4d2c41['attributes']=_[_0xe4c5('0x35')](_0x145437['model'],qs[_0xe4c5('0x36')](_0x33b768[_0xe4c5('0x30')]['fields']));_0x4d2c41[_0xe4c5('0x34')]=_0x4d2c41[_0xe4c5('0x34')]['length']?_0x4d2c41[_0xe4c5('0x34')]:_0x145437[_0xe4c5('0x33')];if(_0x33b768[_0xe4c5('0x30')][_0xe4c5('0x46')]){_0x4d2c41[_0xe4c5('0x47')]=[{'all':!![]}];}_0x4d2c41=_[_0xe4c5('0x3f')]({},_0x4d2c41,_0x33b768[_0xe4c5('0x41')]);return db[_0xe4c5('0x2c')][_0xe4c5('0x48')](_0x4d2c41)[_0xe4c5('0x24')](handleEntityNotFound(_0x4989d4,null))[_0xe4c5('0x24')](respondWithResult(_0x4989d4,null))['catch'](handleError(_0x4989d4,null));};exports['create']=function(_0x3f0f6c,_0x41f381){return db[_0xe4c5('0x2c')][_0xe4c5('0x49')](_0x3f0f6c[_0xe4c5('0x4a')],{})[_0xe4c5('0x24')](respondWithResult(_0x41f381,0xc9))[_0xe4c5('0x44')](handleError(_0x41f381,null));};exports[_0xe4c5('0x4b')]=function(_0x3c3a93,_0x162fa0){if(_0x3c3a93[_0xe4c5('0x4a')]['id']){delete _0x3c3a93[_0xe4c5('0x4a')]['id'];}return db[_0xe4c5('0x2c')][_0xe4c5('0x48')]({'where':{'id':_0x3c3a93['params']['id']}})['then'](handleEntityNotFound(_0x162fa0,null))[_0xe4c5('0x24')](saveUpdates(_0x3c3a93[_0xe4c5('0x4a')],null))[_0xe4c5('0x24')](respondWithResult(_0x162fa0,null))[_0xe4c5('0x44')](handleError(_0x162fa0,null));};exports[_0xe4c5('0x25')]=function(_0x5c7d7c,_0x3753af){return db[_0xe4c5('0x2c')]['find']({'where':{'id':_0x5c7d7c['params']['id']}})[_0xe4c5('0x24')](handleEntityNotFound(_0x3753af,null))[_0xe4c5('0x24')](removeEntity(_0x3753af,null))[_0xe4c5('0x44')](handleError(_0x3753af,null));};exports[_0xe4c5('0x4c')]=function(_0x10d13c,_0x21292b,_0x22201a){var _0x7860f8={};var _0x55edf9={};var _0x4540b4;var _0x357774;return db[_0xe4c5('0x2c')][_0xe4c5('0x4d')]({'where':{'id':_0x10d13c[_0xe4c5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x21292b,null))[_0xe4c5('0x24')](function(_0x23c6f7){if(_0x23c6f7){_0x4540b4=_0x23c6f7;_0x55edf9['model']=_['keys'](db[_0xe4c5('0x4f')][_0xe4c5('0x2d')]);_0x55edf9[_0xe4c5('0x30')]=_[_0xe4c5('0x31')](_0x10d13c['query']);_0x55edf9[_0xe4c5('0x32')]=_[_0xe4c5('0x35')](_0x55edf9['model'],_0x55edf9[_0xe4c5('0x30')]);_0x7860f8['attributes']=_[_0xe4c5('0x35')](_0x55edf9[_0xe4c5('0x33')],qs[_0xe4c5('0x36')](_0x10d13c[_0xe4c5('0x30')]['fields']));_0x7860f8[_0xe4c5('0x34')]=_0x7860f8[_0xe4c5('0x34')][_0xe4c5('0x37')]?_0x7860f8[_0xe4c5('0x34')]:_0x55edf9['model'];_0x7860f8[_0xe4c5('0x3a')]=qs[_0xe4c5('0x3b')](_0x10d13c['query'][_0xe4c5('0x3b')]);_0x7860f8[_0xe4c5('0x3c')]=qs['filters'](_[_0xe4c5('0x3d')](_0x10d13c['query'],_0x55edf9[_0xe4c5('0x32')]));if(_0x10d13c[_0xe4c5('0x30')][_0xe4c5('0x3e')]){_0x7860f8[_0xe4c5('0x3c')]=_[_0xe4c5('0x3f')](_0x7860f8['where'],{'$or':_[_0xe4c5('0x2b')](_0x7860f8[_0xe4c5('0x34')],function(_0x1270a8){var _0x10e0ee={};_0x10e0ee[_0x1270a8]={'$like':'%'+_0x10d13c['query'][_0xe4c5('0x3e')]+'%'};return _0x10e0ee;})});}_0x7860f8=_[_0xe4c5('0x3f')]({},_0x7860f8,_0x10d13c['options']);return _0x4540b4[_0xe4c5('0x4c')](_0x7860f8);}})['then'](function(_0x12ed92){if(_0x12ed92){_0x357774=_0x12ed92[_0xe4c5('0x37')];if(!_0x10d13c['query'][_0xe4c5('0x38')](_0xe4c5('0x39'))){_0x7860f8[_0xe4c5('0x1c')]=qs[_0xe4c5('0x1c')](_0x10d13c['query'][_0xe4c5('0x1c')]);_0x7860f8['offset']=qs['offset'](_0x10d13c[_0xe4c5('0x30')][_0xe4c5('0x1f')]);}return _0x4540b4[_0xe4c5('0x4c')](_0x7860f8);}})[_0xe4c5('0x24')](function(_0x1df1d0){if(_0x1df1d0){return _0x1df1d0?{'count':_0x357774,'rows':_0x1df1d0}:null;}})[_0xe4c5('0x24')](respondWithResult(_0x21292b,null))[_0xe4c5('0x44')](handleError(_0x21292b,null));};exports[_0xe4c5('0x50')]=function(_0x54ae1f,_0x277c3c,_0x53f346){var _0x137adf={};var _0x54bf20={};var _0x2f3f04;var _0x257cdd;return db[_0xe4c5('0x2c')]['findOne']({'where':{'id':_0x54ae1f[_0xe4c5('0x4e')]['id']}})['then'](handleEntityNotFound(_0x277c3c,null))[_0xe4c5('0x24')](function(_0x4925f0){if(_0x4925f0){_0x2f3f04=_0x4925f0;_0x54bf20[_0xe4c5('0x33')]=_['keys'](db[_0xe4c5('0x4f')][_0xe4c5('0x2d')]);_0x54bf20[_0xe4c5('0x30')]=_[_0xe4c5('0x31')](_0x54ae1f['query']);_0x54bf20[_0xe4c5('0x32')]=_['intersection'](_0x54bf20['model'],_0x54bf20[_0xe4c5('0x30')]);_0x137adf[_0xe4c5('0x34')]=_[_0xe4c5('0x35')](_0x54bf20[_0xe4c5('0x33')],qs[_0xe4c5('0x36')](_0x54ae1f['query'][_0xe4c5('0x36')]));_0x137adf[_0xe4c5('0x34')]=_0x137adf['attributes']['length']?_0x137adf[_0xe4c5('0x34')]:_0x54bf20[_0xe4c5('0x33')];_0x137adf[_0xe4c5('0x3a')]=qs[_0xe4c5('0x3b')](_0x54ae1f[_0xe4c5('0x30')][_0xe4c5('0x3b')]);_0x137adf[_0xe4c5('0x3c')]=qs[_0xe4c5('0x32')](_['pick'](_0x54ae1f[_0xe4c5('0x30')],_0x54bf20[_0xe4c5('0x32')]));if(_0x54ae1f['query'][_0xe4c5('0x3e')]){_0x137adf['where']=_['merge'](_0x137adf[_0xe4c5('0x3c')],{'$or':_['map'](_0x137adf[_0xe4c5('0x34')],function(_0x322ec2){var _0x436ff2={};_0x436ff2[_0x322ec2]={'$like':'%'+_0x54ae1f[_0xe4c5('0x30')][_0xe4c5('0x3e')]+'%'};return _0x436ff2;})});}_0x137adf=_[_0xe4c5('0x3f')]({},_0x137adf,_0x54ae1f[_0xe4c5('0x41')]);return _0x2f3f04['getSubjects'](_0x137adf);}})[_0xe4c5('0x24')](function(_0x3ea1b8){if(_0x3ea1b8){_0x257cdd=_0x3ea1b8[_0xe4c5('0x37')];if(!_0x54ae1f[_0xe4c5('0x30')][_0xe4c5('0x38')]('nolimit')){_0x137adf[_0xe4c5('0x1c')]=qs['limit'](_0x54ae1f[_0xe4c5('0x30')][_0xe4c5('0x1c')]);_0x137adf[_0xe4c5('0x1f')]=qs['offset'](_0x54ae1f[_0xe4c5('0x30')][_0xe4c5('0x1f')]);}return _0x2f3f04['getSubjects'](_0x137adf);}})[_0xe4c5('0x24')](function(_0x17662e){if(_0x17662e){return _0x17662e?{'count':_0x257cdd,'rows':_0x17662e}:null;}})['then'](respondWithResult(_0x277c3c,null))[_0xe4c5('0x44')](handleError(_0x277c3c,null));};exports['getDescriptions']=function(_0x1a0992,_0x4ccee8,_0x12edba){var _0x1e3fab={};var _0x533490={};var _0x287390;var _0x18feea;return db[_0xe4c5('0x2c')][_0xe4c5('0x4d')]({'where':{'id':_0x1a0992[_0xe4c5('0x4e')]['id']}})[_0xe4c5('0x24')](handleEntityNotFound(_0x4ccee8,null))[_0xe4c5('0x24')](function(_0x3952ab){if(_0x3952ab){_0x287390=_0x3952ab;_0x533490[_0xe4c5('0x33')]=_[_0xe4c5('0x31')](db['DeskField'][_0xe4c5('0x2d')]);_0x533490[_0xe4c5('0x30')]=_[_0xe4c5('0x31')](_0x1a0992[_0xe4c5('0x30')]);_0x533490['filters']=_[_0xe4c5('0x35')](_0x533490[_0xe4c5('0x33')],_0x533490[_0xe4c5('0x30')]);_0x1e3fab[_0xe4c5('0x34')]=_['intersection'](_0x533490[_0xe4c5('0x33')],qs[_0xe4c5('0x36')](_0x1a0992[_0xe4c5('0x30')][_0xe4c5('0x36')]));_0x1e3fab['attributes']=_0x1e3fab[_0xe4c5('0x34')]['length']?_0x1e3fab['attributes']:_0x533490[_0xe4c5('0x33')];_0x1e3fab['order']=qs[_0xe4c5('0x3b')](_0x1a0992[_0xe4c5('0x30')]['sort']);_0x1e3fab[_0xe4c5('0x3c')]=qs['filters'](_['pick'](_0x1a0992['query'],_0x533490[_0xe4c5('0x32')]));if(_0x1a0992[_0xe4c5('0x30')][_0xe4c5('0x3e')]){_0x1e3fab[_0xe4c5('0x3c')]=_[_0xe4c5('0x3f')](_0x1e3fab['where'],{'$or':_[_0xe4c5('0x2b')](_0x1e3fab[_0xe4c5('0x34')],function(_0x4babb0){var _0x354c1e={};_0x354c1e[_0x4babb0]={'$like':'%'+_0x1a0992[_0xe4c5('0x30')][_0xe4c5('0x3e')]+'%'};return _0x354c1e;})});}_0x1e3fab=_[_0xe4c5('0x3f')]({},_0x1e3fab,_0x1a0992[_0xe4c5('0x41')]);return _0x287390[_0xe4c5('0x51')](_0x1e3fab);}})[_0xe4c5('0x24')](function(_0x2e27f1){if(_0x2e27f1){_0x18feea=_0x2e27f1[_0xe4c5('0x37')];if(!_0x1a0992[_0xe4c5('0x30')][_0xe4c5('0x38')](_0xe4c5('0x39'))){_0x1e3fab['limit']=qs[_0xe4c5('0x1c')](_0x1a0992[_0xe4c5('0x30')][_0xe4c5('0x1c')]);_0x1e3fab[_0xe4c5('0x1f')]=qs['offset'](_0x1a0992[_0xe4c5('0x30')][_0xe4c5('0x1f')]);}return _0x287390[_0xe4c5('0x51')](_0x1e3fab);}})['then'](function(_0x32dfcc){if(_0x32dfcc){return _0x32dfcc?{'count':_0x18feea,'rows':_0x32dfcc}:null;}})[_0xe4c5('0x24')](respondWithResult(_0x4ccee8,null))[_0xe4c5('0x44')](handleError(_0x4ccee8,null));};exports[_0xe4c5('0x52')]=function(_0x2ad71e,_0x432115,_0xacfba3){var _0x312d0d={};var _0x222c49={};var _0x1cf87c;var _0x32fd7f;return db['DeskConfiguration']['findOne']({'where':{'id':_0x2ad71e[_0xe4c5('0x4e')]['id']}})[_0xe4c5('0x24')](handleEntityNotFound(_0x432115,null))[_0xe4c5('0x24')](function(_0x12fd09){if(_0x12fd09){_0x1cf87c=_0x12fd09;_0x222c49[_0xe4c5('0x33')]=_[_0xe4c5('0x31')](db[_0xe4c5('0x53')][_0xe4c5('0x2d')]);_0x222c49[_0xe4c5('0x30')]=_[_0xe4c5('0x31')](_0x2ad71e[_0xe4c5('0x30')]);_0x222c49['filters']=_[_0xe4c5('0x35')](_0x222c49['model'],_0x222c49[_0xe4c5('0x30')]);_0x312d0d[_0xe4c5('0x34')]=_[_0xe4c5('0x35')](_0x222c49[_0xe4c5('0x33')],qs[_0xe4c5('0x36')](_0x2ad71e['query'][_0xe4c5('0x36')]));_0x312d0d[_0xe4c5('0x34')]=_0x312d0d[_0xe4c5('0x34')][_0xe4c5('0x37')]?_0x312d0d['attributes']:_0x222c49['model'];_0x312d0d[_0xe4c5('0x3a')]=qs['sort'](_0x2ad71e[_0xe4c5('0x30')][_0xe4c5('0x3b')]);_0x312d0d[_0xe4c5('0x3c')]=qs[_0xe4c5('0x32')](_['pick'](_0x2ad71e[_0xe4c5('0x30')],_0x222c49['filters']));if(_0x2ad71e[_0xe4c5('0x30')][_0xe4c5('0x3e')]){_0x312d0d[_0xe4c5('0x3c')]=_[_0xe4c5('0x3f')](_0x312d0d[_0xe4c5('0x3c')],{'$or':_['map'](_0x312d0d[_0xe4c5('0x34')],function(_0x3d358f){var _0xd898f0={};_0xd898f0[_0x3d358f]={'$like':'%'+_0x2ad71e[_0xe4c5('0x30')][_0xe4c5('0x3e')]+'%'};return _0xd898f0;})});}_0x312d0d=_['merge']({},_0x312d0d,_0x2ad71e[_0xe4c5('0x41')]);return _0x1cf87c[_0xe4c5('0x52')](_0x312d0d);}})[_0xe4c5('0x24')](function(_0x4445c3){if(_0x4445c3){_0x32fd7f=_0x4445c3[_0xe4c5('0x37')];if(!_0x2ad71e[_0xe4c5('0x30')][_0xe4c5('0x38')](_0xe4c5('0x39'))){_0x312d0d[_0xe4c5('0x1c')]=qs[_0xe4c5('0x1c')](_0x2ad71e[_0xe4c5('0x30')][_0xe4c5('0x1c')]);_0x312d0d[_0xe4c5('0x1f')]=qs['offset'](_0x2ad71e[_0xe4c5('0x30')][_0xe4c5('0x1f')]);}return _0x1cf87c[_0xe4c5('0x52')](_0x312d0d);}})['then'](function(_0x7038bd){if(_0x7038bd){return _0x7038bd?{'count':_0x32fd7f,'rows':_0x7038bd}:null;}})[_0xe4c5('0x24')](respondWithResult(_0x432115,null))[_0xe4c5('0x44')](handleError(_0x432115,null));};exports[_0xe4c5('0x54')]=function(_0x2a7d28,_0x185c32,_0x1079fc){if(_0x2a7d28['body']['id']){delete _0x2a7d28[_0xe4c5('0x4a')]['id'];}return db[_0xe4c5('0x2c')][_0xe4c5('0x4d')]({'where':{'id':_0x2a7d28['params']['id']}})[_0xe4c5('0x24')](handleEntityNotFound(_0x185c32,null))[_0xe4c5('0x24')](function(_0x47e83a){if(_0x47e83a){return _0x47e83a['setTags'](_0x2a7d28[_0xe4c5('0x4a')][_0xe4c5('0x55')]||[]);}return null;})[_0xe4c5('0x24')](respondWithResult(_0x185c32,null))[_0xe4c5('0x44')](handleError(_0x185c32,null));}; \ No newline at end of file +var _0x0a5d=['intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','catch','show','params','create','body','update','find','getFields','DeskField','getSubjects','hasOwnProperty','getDescriptions','findOne','getTags','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','save','then','destroy','error','stack','name','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0a5d,0xc1));var _0xd0a5=function(_0x2650e9,_0xb91cc){_0x2650e9=_0x2650e9-0x0;var _0x3511c8=_0x0a5d[_0x2650e9];return _0x3511c8;};'use strict';var emlformat=require(_0xd0a5('0x0'));var rimraf=require(_0xd0a5('0x1'));var zipdir=require(_0xd0a5('0x2'));var jsonpatch=require(_0xd0a5('0x3'));var rp=require('request-promise');var moment=require(_0xd0a5('0x4'));var BPromise=require(_0xd0a5('0x5'));var Mustache=require(_0xd0a5('0x6'));var util=require(_0xd0a5('0x7'));var path=require(_0xd0a5('0x8'));var sox=require('sox');var csv=require(_0xd0a5('0x9'));var ejs=require(_0xd0a5('0xa'));var fs=require('fs');var fs_extra=require(_0xd0a5('0xb'));var _=require(_0xd0a5('0xc'));var squel=require('squel');var crypto=require(_0xd0a5('0xd'));var jsforce=require(_0xd0a5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xd0a5('0x9'));var querystring=require(_0xd0a5('0xf'));var Papa=require('papaparse');var Redis=require(_0xd0a5('0x10'));var authService=require(_0xd0a5('0x11'));var qs=require(_0xd0a5('0x12'));var as=require(_0xd0a5('0x13'));var hardwareService=require(_0xd0a5('0x14'));var logger=require(_0xd0a5('0x15'))('api');var utils=require('../../config/utils');var config=require(_0xd0a5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd0a5('0x17'))['db'];function respondWithStatusCode(_0xd46bc0,_0x578373){_0x578373=_0x578373||0xcc;return function(_0x41ff56){if(_0x41ff56){return _0xd46bc0[_0xd0a5('0x18')](_0x578373);}return _0xd46bc0[_0xd0a5('0x19')](_0x578373)[_0xd0a5('0x1a')]();};}function respondWithResult(_0x2bad61,_0x546eca){_0x546eca=_0x546eca||0xc8;return function(_0x293f76){if(_0x293f76){return _0x2bad61['status'](_0x546eca)[_0xd0a5('0x1b')](_0x293f76);}};}function respondWithFilteredResult(_0x15026b,_0x2b55ef){return function(_0x510aca){if(_0x510aca){var _0x3214e7=typeof _0x2b55ef['offset']===_0xd0a5('0x1c')&&typeof _0x2b55ef[_0xd0a5('0x1d')]===_0xd0a5('0x1c');var _0x1c53dd=_0x510aca['count'];var _0x58f3a0=_0x3214e7?0x0:_0x2b55ef[_0xd0a5('0x1e')];var _0x44f319=_0x3214e7?_0x510aca[_0xd0a5('0x1f')]:_0x2b55ef[_0xd0a5('0x1e')]+_0x2b55ef[_0xd0a5('0x1d')];var _0x2774f4;if(_0x44f319>=_0x1c53dd){_0x44f319=_0x1c53dd;_0x2774f4=0xc8;}else{_0x2774f4=0xce;}_0x15026b[_0xd0a5('0x19')](_0x2774f4);return _0x15026b[_0xd0a5('0x20')](_0xd0a5('0x21'),_0x58f3a0+'-'+_0x44f319+'/'+_0x1c53dd)[_0xd0a5('0x1b')](_0x510aca);}return null;};}function patchUpdates(_0x565fe){return function(_0x277c69){try{jsonpatch[_0xd0a5('0x22')](_0x277c69,_0x565fe,!![]);}catch(_0xfe4df8){return BPromise['reject'](_0xfe4df8);}return _0x277c69[_0xd0a5('0x23')]();};}function saveUpdates(_0x3c22a6,_0x320f0e){return function(_0x3368f5){if(_0x3368f5){return _0x3368f5['update'](_0x3c22a6)[_0xd0a5('0x24')](function(_0x2e3675){return _0x2e3675;});}return null;};}function removeEntity(_0x495b45,_0x6734f4){return function(_0x51b628){if(_0x51b628){return _0x51b628[_0xd0a5('0x25')]()[_0xd0a5('0x24')](function(){_0x495b45[_0xd0a5('0x19')](0xcc)[_0xd0a5('0x1a')]();});}};}function handleEntityNotFound(_0x4b9346,_0x5ecd1f){return function(_0x5411cb){if(!_0x5411cb){_0x4b9346[_0xd0a5('0x18')](0x194);}return _0x5411cb;};}function handleError(_0x5441e6,_0x5833c8){_0x5833c8=_0x5833c8||0x1f4;return function(_0x17d484){logger[_0xd0a5('0x26')](_0x17d484[_0xd0a5('0x27')]);if(_0x17d484[_0xd0a5('0x28')]){delete _0x17d484[_0xd0a5('0x28')];}_0x5441e6[_0xd0a5('0x19')](_0x5833c8)['send'](_0x17d484);};}exports[_0xd0a5('0x29')]=function(_0x456236,_0x4f6bb9){var _0x13d4b7={},_0x5a97e4={},_0x51c2ea={'count':0x0,'rows':[]};var _0x19ab70=_[_0xd0a5('0x2a')](db[_0xd0a5('0x2b')][_0xd0a5('0x2c')],function(_0x54b15a){return{'name':_0x54b15a[_0xd0a5('0x2d')],'type':_0x54b15a[_0xd0a5('0x2e')][_0xd0a5('0x2f')]};});_0x5a97e4[_0xd0a5('0x30')]=_[_0xd0a5('0x2a')](_0x19ab70,'name');_0x5a97e4[_0xd0a5('0x31')]=_[_0xd0a5('0x32')](_0x456236['query']);_0x5a97e4[_0xd0a5('0x33')]=_['intersection'](_0x5a97e4[_0xd0a5('0x30')],_0x5a97e4['query']);_0x13d4b7[_0xd0a5('0x34')]=_[_0xd0a5('0x35')](_0x5a97e4['model'],qs[_0xd0a5('0x36')](_0x456236['query'][_0xd0a5('0x36')]));_0x13d4b7[_0xd0a5('0x34')]=_0x13d4b7[_0xd0a5('0x34')][_0xd0a5('0x37')]?_0x13d4b7['attributes']:_0x5a97e4[_0xd0a5('0x30')];if(!_0x456236[_0xd0a5('0x31')]['hasOwnProperty'](_0xd0a5('0x38'))){_0x13d4b7[_0xd0a5('0x1d')]=qs[_0xd0a5('0x1d')](_0x456236[_0xd0a5('0x31')][_0xd0a5('0x1d')]);_0x13d4b7[_0xd0a5('0x1e')]=qs['offset'](_0x456236['query'][_0xd0a5('0x1e')]);}_0x13d4b7[_0xd0a5('0x39')]=qs[_0xd0a5('0x3a')](_0x456236['query'][_0xd0a5('0x3a')]);_0x13d4b7[_0xd0a5('0x3b')]=qs[_0xd0a5('0x33')](_[_0xd0a5('0x3c')](_0x456236[_0xd0a5('0x31')],_0x5a97e4[_0xd0a5('0x33')]),_0x19ab70);if(_0x456236[_0xd0a5('0x31')][_0xd0a5('0x3d')]){_0x13d4b7[_0xd0a5('0x3b')]=_[_0xd0a5('0x3e')](_0x13d4b7[_0xd0a5('0x3b')],{'$or':_[_0xd0a5('0x2a')](_0x19ab70,function(_0x394f66){if(_0x394f66[_0xd0a5('0x2e')]!=='VIRTUAL'){var _0x32d724={};_0x32d724[_0x394f66['name']]={'$like':'%'+_0x456236[_0xd0a5('0x31')][_0xd0a5('0x3d')]+'%'};return _0x32d724;}})});}_0x13d4b7=_[_0xd0a5('0x3e')]({},_0x13d4b7,_0x456236[_0xd0a5('0x3f')]);var _0x324e18={'where':_0x13d4b7[_0xd0a5('0x3b')]};return db[_0xd0a5('0x2b')][_0xd0a5('0x1f')](_0x324e18)['then'](function(_0x3cabc5){_0x51c2ea[_0xd0a5('0x1f')]=_0x3cabc5;if(_0x456236[_0xd0a5('0x31')][_0xd0a5('0x40')]){_0x13d4b7[_0xd0a5('0x41')]=[{'all':!![]}];}return db[_0xd0a5('0x2b')]['findAll'](_0x13d4b7);})['then'](function(_0xab0270){_0x51c2ea['rows']=_0xab0270;return _0x51c2ea;})[_0xd0a5('0x24')](respondWithFilteredResult(_0x4f6bb9,_0x13d4b7))[_0xd0a5('0x42')](handleError(_0x4f6bb9,null));};exports[_0xd0a5('0x43')]=function(_0x5447cc,_0xe9f270){var _0x152709={'raw':![],'where':{'id':_0x5447cc[_0xd0a5('0x44')]['id']}},_0x39af9e={};_0x39af9e[_0xd0a5('0x30')]=_[_0xd0a5('0x32')](db['DeskConfiguration'][_0xd0a5('0x2c')]);_0x39af9e[_0xd0a5('0x31')]=_[_0xd0a5('0x32')](_0x5447cc[_0xd0a5('0x31')]);_0x39af9e[_0xd0a5('0x33')]=_[_0xd0a5('0x35')](_0x39af9e[_0xd0a5('0x30')],_0x39af9e[_0xd0a5('0x31')]);_0x152709['attributes']=_['intersection'](_0x39af9e[_0xd0a5('0x30')],qs[_0xd0a5('0x36')](_0x5447cc['query'][_0xd0a5('0x36')]));_0x152709[_0xd0a5('0x34')]=_0x152709[_0xd0a5('0x34')][_0xd0a5('0x37')]?_0x152709[_0xd0a5('0x34')]:_0x39af9e[_0xd0a5('0x30')];if(_0x5447cc['query']['includeAll']){_0x152709[_0xd0a5('0x41')]=[{'all':!![]}];}_0x152709=_[_0xd0a5('0x3e')]({},_0x152709,_0x5447cc['options']);return db[_0xd0a5('0x2b')]['find'](_0x152709)[_0xd0a5('0x24')](handleEntityNotFound(_0xe9f270,null))['then'](respondWithResult(_0xe9f270,null))[_0xd0a5('0x42')](handleError(_0xe9f270,null));};exports[_0xd0a5('0x45')]=function(_0x4629de,_0x21f81b){return db['DeskConfiguration'][_0xd0a5('0x45')](_0x4629de[_0xd0a5('0x46')],{})[_0xd0a5('0x24')](respondWithResult(_0x21f81b,0xc9))[_0xd0a5('0x42')](handleError(_0x21f81b,null));};exports[_0xd0a5('0x47')]=function(_0x2e3300,_0x11f700){if(_0x2e3300[_0xd0a5('0x46')]['id']){delete _0x2e3300['body']['id'];}return db[_0xd0a5('0x2b')][_0xd0a5('0x48')]({'where':{'id':_0x2e3300['params']['id']}})[_0xd0a5('0x24')](handleEntityNotFound(_0x11f700,null))[_0xd0a5('0x24')](saveUpdates(_0x2e3300[_0xd0a5('0x46')],null))['then'](respondWithResult(_0x11f700,null))['catch'](handleError(_0x11f700,null));};exports['destroy']=function(_0x2b32be,_0x257e3a){return db[_0xd0a5('0x2b')][_0xd0a5('0x48')]({'where':{'id':_0x2b32be[_0xd0a5('0x44')]['id']}})[_0xd0a5('0x24')](handleEntityNotFound(_0x257e3a,null))['then'](removeEntity(_0x257e3a,null))[_0xd0a5('0x42')](handleError(_0x257e3a,null));};exports[_0xd0a5('0x49')]=function(_0x27707a,_0x1981c0,_0x1bbc77){var _0x316dec={};var _0x10bef4={};var _0x276214;var _0x123c61;return db[_0xd0a5('0x2b')]['findOne']({'where':{'id':_0x27707a[_0xd0a5('0x44')]['id']}})['then'](handleEntityNotFound(_0x1981c0,null))[_0xd0a5('0x24')](function(_0x4eb889){if(_0x4eb889){_0x276214=_0x4eb889;_0x10bef4[_0xd0a5('0x30')]=_[_0xd0a5('0x32')](db[_0xd0a5('0x4a')][_0xd0a5('0x2c')]);_0x10bef4[_0xd0a5('0x31')]=_['keys'](_0x27707a[_0xd0a5('0x31')]);_0x10bef4[_0xd0a5('0x33')]=_['intersection'](_0x10bef4['model'],_0x10bef4[_0xd0a5('0x31')]);_0x316dec['attributes']=_[_0xd0a5('0x35')](_0x10bef4[_0xd0a5('0x30')],qs[_0xd0a5('0x36')](_0x27707a[_0xd0a5('0x31')][_0xd0a5('0x36')]));_0x316dec[_0xd0a5('0x34')]=_0x316dec[_0xd0a5('0x34')][_0xd0a5('0x37')]?_0x316dec[_0xd0a5('0x34')]:_0x10bef4['model'];_0x316dec['order']=qs[_0xd0a5('0x3a')](_0x27707a[_0xd0a5('0x31')][_0xd0a5('0x3a')]);_0x316dec[_0xd0a5('0x3b')]=qs[_0xd0a5('0x33')](_['pick'](_0x27707a[_0xd0a5('0x31')],_0x10bef4['filters']));if(_0x27707a[_0xd0a5('0x31')][_0xd0a5('0x3d')]){_0x316dec[_0xd0a5('0x3b')]=_['merge'](_0x316dec[_0xd0a5('0x3b')],{'$or':_['map'](_0x316dec[_0xd0a5('0x34')],function(_0x118432){var _0x7214ef={};_0x7214ef[_0x118432]={'$like':'%'+_0x27707a[_0xd0a5('0x31')][_0xd0a5('0x3d')]+'%'};return _0x7214ef;})});}_0x316dec=_[_0xd0a5('0x3e')]({},_0x316dec,_0x27707a[_0xd0a5('0x3f')]);return _0x276214['getFields'](_0x316dec);}})[_0xd0a5('0x24')](function(_0x2ab02b){if(_0x2ab02b){_0x123c61=_0x2ab02b[_0xd0a5('0x37')];if(!_0x27707a[_0xd0a5('0x31')]['hasOwnProperty'](_0xd0a5('0x38'))){_0x316dec[_0xd0a5('0x1d')]=qs[_0xd0a5('0x1d')](_0x27707a[_0xd0a5('0x31')][_0xd0a5('0x1d')]);_0x316dec[_0xd0a5('0x1e')]=qs[_0xd0a5('0x1e')](_0x27707a[_0xd0a5('0x31')][_0xd0a5('0x1e')]);}return _0x276214[_0xd0a5('0x49')](_0x316dec);}})[_0xd0a5('0x24')](function(_0x2a41cb){if(_0x2a41cb){return _0x2a41cb?{'count':_0x123c61,'rows':_0x2a41cb}:null;}})[_0xd0a5('0x24')](respondWithResult(_0x1981c0,null))[_0xd0a5('0x42')](handleError(_0x1981c0,null));};exports[_0xd0a5('0x4b')]=function(_0x1fd902,_0x3ede7a,_0x2ede7a){var _0x1a51ac={};var _0x313546={};var _0x364483;var _0x450ffe;return db[_0xd0a5('0x2b')]['findOne']({'where':{'id':_0x1fd902[_0xd0a5('0x44')]['id']}})[_0xd0a5('0x24')](handleEntityNotFound(_0x3ede7a,null))['then'](function(_0xc43c81){if(_0xc43c81){_0x364483=_0xc43c81;_0x313546[_0xd0a5('0x30')]=_[_0xd0a5('0x32')](db[_0xd0a5('0x4a')][_0xd0a5('0x2c')]);_0x313546[_0xd0a5('0x31')]=_['keys'](_0x1fd902[_0xd0a5('0x31')]);_0x313546['filters']=_['intersection'](_0x313546[_0xd0a5('0x30')],_0x313546[_0xd0a5('0x31')]);_0x1a51ac['attributes']=_['intersection'](_0x313546[_0xd0a5('0x30')],qs[_0xd0a5('0x36')](_0x1fd902[_0xd0a5('0x31')]['fields']));_0x1a51ac['attributes']=_0x1a51ac[_0xd0a5('0x34')]['length']?_0x1a51ac[_0xd0a5('0x34')]:_0x313546[_0xd0a5('0x30')];_0x1a51ac['order']=qs[_0xd0a5('0x3a')](_0x1fd902[_0xd0a5('0x31')]['sort']);_0x1a51ac[_0xd0a5('0x3b')]=qs[_0xd0a5('0x33')](_[_0xd0a5('0x3c')](_0x1fd902['query'],_0x313546[_0xd0a5('0x33')]));if(_0x1fd902[_0xd0a5('0x31')][_0xd0a5('0x3d')]){_0x1a51ac[_0xd0a5('0x3b')]=_[_0xd0a5('0x3e')](_0x1a51ac[_0xd0a5('0x3b')],{'$or':_[_0xd0a5('0x2a')](_0x1a51ac[_0xd0a5('0x34')],function(_0xb1e55e){var _0x34f764={};_0x34f764[_0xb1e55e]={'$like':'%'+_0x1fd902['query'][_0xd0a5('0x3d')]+'%'};return _0x34f764;})});}_0x1a51ac=_[_0xd0a5('0x3e')]({},_0x1a51ac,_0x1fd902[_0xd0a5('0x3f')]);return _0x364483[_0xd0a5('0x4b')](_0x1a51ac);}})[_0xd0a5('0x24')](function(_0x445288){if(_0x445288){_0x450ffe=_0x445288[_0xd0a5('0x37')];if(!_0x1fd902[_0xd0a5('0x31')][_0xd0a5('0x4c')]('nolimit')){_0x1a51ac[_0xd0a5('0x1d')]=qs[_0xd0a5('0x1d')](_0x1fd902['query'][_0xd0a5('0x1d')]);_0x1a51ac[_0xd0a5('0x1e')]=qs[_0xd0a5('0x1e')](_0x1fd902[_0xd0a5('0x31')][_0xd0a5('0x1e')]);}return _0x364483[_0xd0a5('0x4b')](_0x1a51ac);}})[_0xd0a5('0x24')](function(_0x28fe91){if(_0x28fe91){return _0x28fe91?{'count':_0x450ffe,'rows':_0x28fe91}:null;}})[_0xd0a5('0x24')](respondWithResult(_0x3ede7a,null))[_0xd0a5('0x42')](handleError(_0x3ede7a,null));};exports[_0xd0a5('0x4d')]=function(_0xbe6c2a,_0x53edb7,_0x5dae69){var _0x5681fc={};var _0x570a0c={};var _0x324062;var _0x44a21d;return db['DeskConfiguration'][_0xd0a5('0x4e')]({'where':{'id':_0xbe6c2a['params']['id']}})[_0xd0a5('0x24')](handleEntityNotFound(_0x53edb7,null))[_0xd0a5('0x24')](function(_0x5d354f){if(_0x5d354f){_0x324062=_0x5d354f;_0x570a0c[_0xd0a5('0x30')]=_['keys'](db['DeskField'][_0xd0a5('0x2c')]);_0x570a0c['query']=_['keys'](_0xbe6c2a[_0xd0a5('0x31')]);_0x570a0c[_0xd0a5('0x33')]=_[_0xd0a5('0x35')](_0x570a0c['model'],_0x570a0c['query']);_0x5681fc[_0xd0a5('0x34')]=_[_0xd0a5('0x35')](_0x570a0c[_0xd0a5('0x30')],qs['fields'](_0xbe6c2a['query'][_0xd0a5('0x36')]));_0x5681fc[_0xd0a5('0x34')]=_0x5681fc[_0xd0a5('0x34')]['length']?_0x5681fc[_0xd0a5('0x34')]:_0x570a0c['model'];_0x5681fc['order']=qs[_0xd0a5('0x3a')](_0xbe6c2a[_0xd0a5('0x31')][_0xd0a5('0x3a')]);_0x5681fc[_0xd0a5('0x3b')]=qs['filters'](_['pick'](_0xbe6c2a['query'],_0x570a0c['filters']));if(_0xbe6c2a['query'][_0xd0a5('0x3d')]){_0x5681fc[_0xd0a5('0x3b')]=_['merge'](_0x5681fc[_0xd0a5('0x3b')],{'$or':_[_0xd0a5('0x2a')](_0x5681fc[_0xd0a5('0x34')],function(_0x11a651){var _0x4d062f={};_0x4d062f[_0x11a651]={'$like':'%'+_0xbe6c2a['query']['filter']+'%'};return _0x4d062f;})});}_0x5681fc=_[_0xd0a5('0x3e')]({},_0x5681fc,_0xbe6c2a['options']);return _0x324062[_0xd0a5('0x4d')](_0x5681fc);}})[_0xd0a5('0x24')](function(_0x1a63a6){if(_0x1a63a6){_0x44a21d=_0x1a63a6['length'];if(!_0xbe6c2a[_0xd0a5('0x31')][_0xd0a5('0x4c')](_0xd0a5('0x38'))){_0x5681fc[_0xd0a5('0x1d')]=qs[_0xd0a5('0x1d')](_0xbe6c2a['query']['limit']);_0x5681fc[_0xd0a5('0x1e')]=qs['offset'](_0xbe6c2a['query']['offset']);}return _0x324062[_0xd0a5('0x4d')](_0x5681fc);}})[_0xd0a5('0x24')](function(_0x1df879){if(_0x1df879){return _0x1df879?{'count':_0x44a21d,'rows':_0x1df879}:null;}})[_0xd0a5('0x24')](respondWithResult(_0x53edb7,null))[_0xd0a5('0x42')](handleError(_0x53edb7,null));};exports[_0xd0a5('0x4f')]=function(_0x51a66c,_0x1b1481,_0x501b9d){var _0x581231={};var _0x54e1d3={};var _0x133777;var _0x5be771;return db[_0xd0a5('0x2b')][_0xd0a5('0x4e')]({'where':{'id':_0x51a66c[_0xd0a5('0x44')]['id']}})['then'](handleEntityNotFound(_0x1b1481,null))['then'](function(_0x335e3b){if(_0x335e3b){_0x133777=_0x335e3b;_0x54e1d3['model']=_[_0xd0a5('0x32')](db['Tag'][_0xd0a5('0x2c')]);_0x54e1d3[_0xd0a5('0x31')]=_[_0xd0a5('0x32')](_0x51a66c[_0xd0a5('0x31')]);_0x54e1d3[_0xd0a5('0x33')]=_[_0xd0a5('0x35')](_0x54e1d3['model'],_0x54e1d3['query']);_0x581231[_0xd0a5('0x34')]=_['intersection'](_0x54e1d3[_0xd0a5('0x30')],qs['fields'](_0x51a66c['query'][_0xd0a5('0x36')]));_0x581231[_0xd0a5('0x34')]=_0x581231[_0xd0a5('0x34')][_0xd0a5('0x37')]?_0x581231['attributes']:_0x54e1d3[_0xd0a5('0x30')];_0x581231[_0xd0a5('0x39')]=qs[_0xd0a5('0x3a')](_0x51a66c[_0xd0a5('0x31')][_0xd0a5('0x3a')]);_0x581231[_0xd0a5('0x3b')]=qs[_0xd0a5('0x33')](_[_0xd0a5('0x3c')](_0x51a66c[_0xd0a5('0x31')],_0x54e1d3[_0xd0a5('0x33')]));if(_0x51a66c[_0xd0a5('0x31')]['filter']){_0x581231[_0xd0a5('0x3b')]=_[_0xd0a5('0x3e')](_0x581231[_0xd0a5('0x3b')],{'$or':_[_0xd0a5('0x2a')](_0x581231['attributes'],function(_0x34fed1){var _0x369715={};_0x369715[_0x34fed1]={'$like':'%'+_0x51a66c[_0xd0a5('0x31')][_0xd0a5('0x3d')]+'%'};return _0x369715;})});}_0x581231=_['merge']({},_0x581231,_0x51a66c['options']);return _0x133777[_0xd0a5('0x4f')](_0x581231);}})[_0xd0a5('0x24')](function(_0x52ffad){if(_0x52ffad){_0x5be771=_0x52ffad[_0xd0a5('0x37')];if(!_0x51a66c['query'][_0xd0a5('0x4c')]('nolimit')){_0x581231['limit']=qs['limit'](_0x51a66c[_0xd0a5('0x31')][_0xd0a5('0x1d')]);_0x581231[_0xd0a5('0x1e')]=qs[_0xd0a5('0x1e')](_0x51a66c[_0xd0a5('0x31')][_0xd0a5('0x1e')]);}return _0x133777[_0xd0a5('0x4f')](_0x581231);}})[_0xd0a5('0x24')](function(_0x278436){if(_0x278436){return _0x278436?{'count':_0x5be771,'rows':_0x278436}:null;}})[_0xd0a5('0x24')](respondWithResult(_0x1b1481,null))[_0xd0a5('0x42')](handleError(_0x1b1481,null));};exports['setTags']=function(_0x347658,_0x8ad0e9,_0x2ec780){if(_0x347658[_0xd0a5('0x46')]['id']){delete _0x347658['body']['id'];}return db[_0xd0a5('0x2b')][_0xd0a5('0x4e')]({'where':{'id':_0x347658[_0xd0a5('0x44')]['id']}})[_0xd0a5('0x24')](handleEntityNotFound(_0x8ad0e9,null))[_0xd0a5('0x24')](function(_0x3b4791){if(_0x3b4791){return _0x3b4791[_0xd0a5('0x50')](_0x347658['body'][_0xd0a5('0x51')]||[]);}return null;})[_0xd0a5('0x24')](respondWithResult(_0x8ad0e9,null))[_0xd0a5('0x42')](handleError(_0x8ad0e9,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 7831b23..64a64a1 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 _0x8808=['lodash','util','api','bluebird','request-promise','path','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations'];(function(_0x2ab3d9,_0x50e716){var _0x210a54=function(_0x24c479){while(--_0x24c479){_0x2ab3d9['push'](_0x2ab3d9['shift']());}};_0x210a54(++_0x50e716);}(_0x8808,0x8f));var _0x8880=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x8808[_0x465028];return _0xb783d4;};'use strict';var _=require(_0x8880('0x0'));var util=require(_0x8880('0x1'));var logger=require('../../config/logger')(_0x8880('0x2'));var moment=require('moment');var BPromise=require(_0x8880('0x3'));var rp=require(_0x8880('0x4'));var fs=require('fs');var path=require(_0x8880('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8880('0x6'));module[_0x8880('0x7')]=function(_0x3897fc,_0x5cc732){return _0x3897fc[_0x8880('0x8')](_0x8880('0x9'),attributes,{'tableName':_0x8880('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b23=['bluebird','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x4f8ebf,_0x58760c){var _0x164d9a=function(_0x16bcc6){while(--_0x16bcc6){_0x4f8ebf['push'](_0x4f8ebf['shift']());}};_0x164d9a(++_0x58760c);}(_0x9b23,0x136));var _0x39b2=function(_0x2dc30a,_0x476c1a){_0x2dc30a=_0x2dc30a-0x0;var _0x1f7dfa=_0x9b23[_0x2dc30a];return _0x1f7dfa;};'use strict';var _=require(_0x39b2('0x0'));var util=require(_0x39b2('0x1'));var logger=require(_0x39b2('0x2'))(_0x39b2('0x3'));var moment=require(_0x39b2('0x4'));var BPromise=require(_0x39b2('0x5'));var rp=require(_0x39b2('0x6'));var fs=require('fs');var path=require(_0x39b2('0x7'));var rimraf=require(_0x39b2('0x8'));var config=require(_0x39b2('0x9'));var attributes=require(_0x39b2('0xa'));module[_0x39b2('0xb')]=function(_0x79b188,_0x4db5f2){return _0x79b188[_0x39b2('0xc')](_0x39b2('0xd'),attributes,{'tableName':_0x39b2('0xe'),'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 4a6081b..219829d 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 _0x4d4e=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','ioredis'];(function(_0x602ca8,_0x568e82){var _0x26e8ab=function(_0x3fb700){while(--_0x3fb700){_0x602ca8['push'](_0x602ca8['shift']());}};_0x26e8ab(++_0x568e82);}(_0x4d4e,0xa4));var _0xe4d4=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0x4d4e[_0x1e6db3];return _0x1de886;};'use strict';var _=require(_0xe4d4('0x0'));var util=require('util');var moment=require(_0xe4d4('0x1'));var BPromise=require(_0xe4d4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe4d4('0x3'));var db=require(_0xe4d4('0x4'))['db'];var utils=require(_0xe4d4('0x5'));var logger=require(_0xe4d4('0x6'))(_0xe4d4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe4d4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5b6652,_0x4e9d70,_0xf010c6){return new BPromise(function(_0x3e422b,_0x14ec7a){return client[_0xe4d4('0x9')](_0x5b6652,_0xf010c6)[_0xe4d4('0xa')](function(_0x58cce7){logger['info'](_0xe4d4('0xb'),_0x4e9d70,_0xe4d4('0xc'));logger[_0xe4d4('0xd')](_0xe4d4('0xe'),_0x4e9d70,_0xe4d4('0xc'),JSON[_0xe4d4('0xf')](_0x58cce7));if(_0x58cce7[_0xe4d4('0x10')]){if(_0x58cce7[_0xe4d4('0x10')]['code']===0x1f4){logger[_0xe4d4('0x10')](_0xe4d4('0xb'),_0x4e9d70,_0x58cce7[_0xe4d4('0x10')]['message']);return _0x14ec7a(_0x58cce7[_0xe4d4('0x10')][_0xe4d4('0x11')]);}logger[_0xe4d4('0x10')](_0xe4d4('0xb'),_0x4e9d70,_0x58cce7['error']['message']);return _0x3e422b(_0x58cce7[_0xe4d4('0x10')]['message']);}else{logger[_0xe4d4('0x12')](_0xe4d4('0xb'),_0x4e9d70,'request\x20sent');_0x3e422b(_0x58cce7[_0xe4d4('0x13')][_0xe4d4('0x11')]);}})[_0xe4d4('0x14')](function(_0xad05a7){logger[_0xe4d4('0x10')](_0xe4d4('0xb'),_0x4e9d70,_0xad05a7);_0x14ec7a(_0xad05a7);});});} \ No newline at end of file +var _0xa67e=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','result','util','bluebird','randomstring','ioredis'];(function(_0x5cbaf3,_0x25646a){var _0x29f965=function(_0x2bb5be){while(--_0x2bb5be){_0x5cbaf3['push'](_0x5cbaf3['shift']());}};_0x29f965(++_0x25646a);}(_0xa67e,0xce));var _0xea67=function(_0x132786,_0x83bd2f){_0x132786=_0x132786-0x0;var _0x2f5a2d=_0xa67e[_0x132786];return _0x2f5a2d;};'use strict';var _=require('lodash');var util=require(_0xea67('0x0'));var moment=require('moment');var BPromise=require(_0xea67('0x1'));var rs=require(_0xea67('0x2'));var fs=require('fs');var Redis=require(_0xea67('0x3'));var db=require(_0xea67('0x4'))['db'];var utils=require(_0xea67('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xea67('0x6'));var jayson=require(_0xea67('0x7'));var client=jayson[_0xea67('0x8')][_0xea67('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bb0e2,_0x156416,_0x2fe018){return new BPromise(function(_0x1b932b,_0x3e8174){return client[_0xea67('0xa')](_0x1bb0e2,_0x2fe018)[_0xea67('0xb')](function(_0x5a5d44){logger[_0xea67('0xc')](_0xea67('0xd'),_0x156416,_0xea67('0xe'));logger[_0xea67('0xf')](_0xea67('0x10'),_0x156416,'request\x20sent',JSON['stringify'](_0x5a5d44));if(_0x5a5d44['error']){if(_0x5a5d44['error'][_0xea67('0x11')]===0x1f4){logger[_0xea67('0x12')](_0xea67('0xd'),_0x156416,_0x5a5d44['error'][_0xea67('0x13')]);return _0x3e8174(_0x5a5d44[_0xea67('0x12')]['message']);}logger[_0xea67('0x12')](_0xea67('0xd'),_0x156416,_0x5a5d44['error']['message']);return _0x1b932b(_0x5a5d44[_0xea67('0x12')]['message']);}else{logger[_0xea67('0xc')](_0xea67('0xd'),_0x156416,_0xea67('0xe'));_0x1b932b(_0x5a5d44[_0xea67('0x14')][_0xea67('0x13')]);}})['catch'](function(_0x4b4714){logger['error'](_0xea67('0xd'),_0x156416,_0x4b4714);_0x3e8174(_0x4b4714);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index b61485b..8a38baf 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 _0x5746=['update','destroy','multer','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','post','put'];(function(_0x324a9e,_0x15c28a){var _0x15b6fd=function(_0x45594b){while(--_0x45594b){_0x324a9e['push'](_0x324a9e['shift']());}};_0x15b6fd(++_0x15c28a);}(_0x5746,0x1f2));var _0x6574=function(_0x232162,_0x56a665){_0x232162=_0x232162-0x0;var _0x15b4c5=_0x5746[_0x232162];return _0x15b4c5;};'use strict';var multer=require(_0x6574('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6574('0x1'));var express=require(_0x6574('0x2'));var router=express['Router']();var fs_extra=require(_0x6574('0x3'));var auth=require(_0x6574('0x4'));var interaction=require(_0x6574('0x5'));var config=require(_0x6574('0x6'));var controller=require(_0x6574('0x7'));router[_0x6574('0x8')]('/',auth[_0x6574('0x9')](),controller[_0x6574('0xa')]);router['get'](_0x6574('0xb'),auth[_0x6574('0x9')](),controller['show']);router[_0x6574('0xc')]('/',auth[_0x6574('0x9')](),controller['create']);router[_0x6574('0xd')](_0x6574('0xb'),auth[_0x6574('0x9')](),controller[_0x6574('0xe')]);router['delete']('/:id',auth[_0x6574('0x9')](),controller[_0x6574('0xf')]);module['exports']=router; \ No newline at end of file +var _0x0053=['show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./intDeskField.controller','isAuthenticated','index','get','/:id'];(function(_0x393d69,_0x3a8c83){var _0x3cee37=function(_0x462682){while(--_0x462682){_0x393d69['push'](_0x393d69['shift']());}};_0x3cee37(++_0x3a8c83);}(_0x0053,0x14b));var _0x3005=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0053[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x3005('0x0'));var path=require(_0x3005('0x1'));var timeout=require(_0x3005('0x2'));var express=require(_0x3005('0x3'));var router=express['Router']();var fs_extra=require(_0x3005('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3005('0x5'));var config=require('../../config/environment');var controller=require(_0x3005('0x6'));router['get']('/',auth[_0x3005('0x7')](),controller[_0x3005('0x8')]);router[_0x3005('0x9')](_0x3005('0xa'),auth[_0x3005('0x7')](),controller[_0x3005('0xb')]);router[_0x3005('0xc')]('/',auth[_0x3005('0x7')](),controller[_0x3005('0xd')]);router[_0x3005('0xe')](_0x3005('0xa'),auth[_0x3005('0x7')](),controller[_0x3005('0xf')]);router[_0x3005('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x3005('0x11')]);module[_0x3005('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index a8c236e..465d567 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 _0xc0d4=['variable','keyValue','picklist','string','STRING','customVariable','BOOLEAN','sequelize'];(function(_0xdd42ac,_0x1d31f1){var _0x4ddf3f=function(_0x2b4543){while(--_0x2b4543){_0xdd42ac['push'](_0xdd42ac['shift']());}};_0x4ddf3f(++_0x1d31f1);}(_0xc0d4,0x197));var _0x4c0d=function(_0x189b3b,_0x484de8){_0x189b3b=_0x189b3b-0x0;var _0x7c4721=_0xc0d4[_0x189b3b];return _0x7c4721;};'use strict';var Sequelize=require(_0x4c0d('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x4c0d('0x1'),'customVariable',_0x4c0d('0x2'),_0x4c0d('0x3')),'defaultValue':_0x4c0d('0x4')},'content':{'type':Sequelize[_0x4c0d('0x5')]},'key':{'type':Sequelize[_0x4c0d('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0x4c0d('0x1'),_0x4c0d('0x6'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x4c0d('0x5')]},'nameField':{'type':Sequelize[_0x4c0d('0x5')]},'customField':{'type':Sequelize[_0x4c0d('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4c0d('0x5')]}}; \ No newline at end of file +var _0x3858=['string','STRING','ENUM','BOOLEAN','sequelize','exports','variable','customVariable'];(function(_0x445e22,_0x1c57b8){var _0xc7f4f7=function(_0x48ee20){while(--_0x48ee20){_0x445e22['push'](_0x445e22['shift']());}};_0xc7f4f7(++_0x1c57b8);}(_0x3858,0x10c));var _0x8385=function(_0x3bf5d3,_0x2ca715){_0x3bf5d3=_0x3bf5d3-0x0;var _0x2b81bb=_0x3858[_0x3bf5d3];return _0x2b81bb;};'use strict';var Sequelize=require(_0x8385('0x0'));module[_0x8385('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0x8385('0x2'),_0x8385('0x3'),'keyValue','picklist'),'defaultValue':_0x8385('0x4')},'content':{'type':Sequelize[_0x8385('0x5')]},'key':{'type':Sequelize[_0x8385('0x5')]},'keyType':{'type':Sequelize[_0x8385('0x6')]('string','variable',_0x8385('0x3'))},'keyContent':{'type':Sequelize[_0x8385('0x5')]},'idField':{'type':Sequelize[_0x8385('0x5')]},'nameField':{'type':Sequelize[_0x8385('0x5')]},'customField':{'type':Sequelize[_0x8385('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 3b798b4..fee11d7 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 _0xcd0d=['error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','findAll','rows','show','params','length','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus'];(function(_0x598ad4,_0xce00c){var _0x498436=function(_0x35702e){while(--_0x35702e){_0x598ad4['push'](_0x598ad4['shift']());}};_0x498436(++_0xce00c);}(_0xcd0d,0x10a));var _0xdcd0=function(_0x36bc58,_0x27f03c){_0x36bc58=_0x36bc58-0x0;var _0x4a547e=_0xcd0d[_0x36bc58];return _0x4a547e;};'use strict';var emlformat=require(_0xdcd0('0x0'));var rimraf=require(_0xdcd0('0x1'));var zipdir=require(_0xdcd0('0x2'));var jsonpatch=require(_0xdcd0('0x3'));var rp=require(_0xdcd0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdcd0('0x5'));var path=require('path');var sox=require(_0xdcd0('0x6'));var csv=require(_0xdcd0('0x7'));var ejs=require(_0xdcd0('0x8'));var fs=require('fs');var fs_extra=require(_0xdcd0('0x9'));var _=require(_0xdcd0('0xa'));var squel=require(_0xdcd0('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xdcd0('0x7'));var querystring=require(_0xdcd0('0xc'));var Papa=require(_0xdcd0('0xd'));var Redis=require('ioredis');var authService=require(_0xdcd0('0xe'));var qs=require(_0xdcd0('0xf'));var as=require(_0xdcd0('0x10'));var hardwareService=require(_0xdcd0('0x11'));var logger=require(_0xdcd0('0x12'))(_0xdcd0('0x13'));var utils=require(_0xdcd0('0x14'));var config=require(_0xdcd0('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xdcd0('0x16'))['db'];function respondWithStatusCode(_0x30cbff,_0x25e3db){_0x25e3db=_0x25e3db||0xcc;return function(_0x1a7407){if(_0x1a7407){return _0x30cbff['sendStatus'](_0x25e3db);}return _0x30cbff[_0xdcd0('0x17')](_0x25e3db)['end']();};}function respondWithResult(_0x367d7d,_0x5c1640){_0x5c1640=_0x5c1640||0xc8;return function(_0x2a4bf1){if(_0x2a4bf1){return _0x367d7d['status'](_0x5c1640)[_0xdcd0('0x18')](_0x2a4bf1);}};}function respondWithFilteredResult(_0x3ec4f7,_0x26e8d6){return function(_0x5a4584){if(_0x5a4584){var _0x488387=typeof _0x26e8d6['offset']==='undefined'&&typeof _0x26e8d6['limit']==='undefined';var _0x261c23=_0x5a4584['count'];var _0x3c45f3=_0x488387?0x0:_0x26e8d6[_0xdcd0('0x19')];var _0x10bf00=_0x488387?_0x5a4584[_0xdcd0('0x1a')]:_0x26e8d6[_0xdcd0('0x19')]+_0x26e8d6[_0xdcd0('0x1b')];var _0x53890d;if(_0x10bf00>=_0x261c23){_0x10bf00=_0x261c23;_0x53890d=0xc8;}else{_0x53890d=0xce;}_0x3ec4f7[_0xdcd0('0x17')](_0x53890d);return _0x3ec4f7[_0xdcd0('0x1c')](_0xdcd0('0x1d'),_0x3c45f3+'-'+_0x10bf00+'/'+_0x261c23)[_0xdcd0('0x18')](_0x5a4584);}return null;};}function patchUpdates(_0x10af21){return function(_0x3b2262){try{jsonpatch[_0xdcd0('0x1e')](_0x3b2262,_0x10af21,!![]);}catch(_0x88154a){return BPromise[_0xdcd0('0x1f')](_0x88154a);}return _0x3b2262[_0xdcd0('0x20')]();};}function saveUpdates(_0x394c93,_0x56ebe8){return function(_0x2a9925){if(_0x2a9925){return _0x2a9925[_0xdcd0('0x21')](_0x394c93)[_0xdcd0('0x22')](function(_0x4eca7f){return _0x4eca7f;});}return null;};}function removeEntity(_0x3535ff,_0x5debf0){return function(_0x3f96aa){if(_0x3f96aa){return _0x3f96aa[_0xdcd0('0x23')]()[_0xdcd0('0x22')](function(){_0x3535ff[_0xdcd0('0x17')](0xcc)[_0xdcd0('0x24')]();});}};}function handleEntityNotFound(_0x13697d,_0x2d128d){return function(_0x2810d0){if(!_0x2810d0){_0x13697d[_0xdcd0('0x25')](0x194);}return _0x2810d0;};}function handleError(_0x3f3013,_0x535e9f){_0x535e9f=_0x535e9f||0x1f4;return function(_0x249b5c){logger[_0xdcd0('0x26')](_0x249b5c[_0xdcd0('0x27')]);if(_0x249b5c[_0xdcd0('0x28')]){delete _0x249b5c[_0xdcd0('0x28')];}_0x3f3013[_0xdcd0('0x17')](_0x535e9f)[_0xdcd0('0x29')](_0x249b5c);};}exports[_0xdcd0('0x2a')]=function(_0x4f75f8,_0x4ac778){var _0x6bd7d={},_0x2c5334={},_0x22f04d={'count':0x0,'rows':[]};var _0x1e769a=_[_0xdcd0('0x2b')](db[_0xdcd0('0x2c')][_0xdcd0('0x2d')],function(_0x2ae3ac){return{'name':_0x2ae3ac[_0xdcd0('0x2e')],'type':_0x2ae3ac[_0xdcd0('0x2f')][_0xdcd0('0x30')]};});_0x2c5334[_0xdcd0('0x31')]=_[_0xdcd0('0x2b')](_0x1e769a,_0xdcd0('0x28'));_0x2c5334[_0xdcd0('0x32')]=_[_0xdcd0('0x33')](_0x4f75f8[_0xdcd0('0x32')]);_0x2c5334['filters']=_[_0xdcd0('0x34')](_0x2c5334['model'],_0x2c5334[_0xdcd0('0x32')]);_0x6bd7d[_0xdcd0('0x35')]=_[_0xdcd0('0x34')](_0x2c5334[_0xdcd0('0x31')],qs[_0xdcd0('0x36')](_0x4f75f8['query'][_0xdcd0('0x36')]));_0x6bd7d[_0xdcd0('0x35')]=_0x6bd7d[_0xdcd0('0x35')]['length']?_0x6bd7d[_0xdcd0('0x35')]:_0x2c5334[_0xdcd0('0x31')];if(!_0x4f75f8['query'][_0xdcd0('0x37')](_0xdcd0('0x38'))){_0x6bd7d['limit']=qs[_0xdcd0('0x1b')](_0x4f75f8[_0xdcd0('0x32')]['limit']);_0x6bd7d[_0xdcd0('0x19')]=qs[_0xdcd0('0x19')](_0x4f75f8[_0xdcd0('0x32')][_0xdcd0('0x19')]);}_0x6bd7d[_0xdcd0('0x39')]=qs[_0xdcd0('0x3a')](_0x4f75f8[_0xdcd0('0x32')][_0xdcd0('0x3a')]);_0x6bd7d['where']=qs['filters'](_[_0xdcd0('0x3b')](_0x4f75f8[_0xdcd0('0x32')],_0x2c5334[_0xdcd0('0x3c')]),_0x1e769a);if(_0x4f75f8[_0xdcd0('0x32')][_0xdcd0('0x3d')]){_0x6bd7d[_0xdcd0('0x3e')]=_[_0xdcd0('0x3f')](_0x6bd7d[_0xdcd0('0x3e')],{'$or':_[_0xdcd0('0x2b')](_0x1e769a,function(_0x1da43e){if(_0x1da43e['type']!==_0xdcd0('0x40')){var _0x5476bb={};_0x5476bb[_0x1da43e['name']]={'$like':'%'+_0x4f75f8[_0xdcd0('0x32')][_0xdcd0('0x3d')]+'%'};return _0x5476bb;}})});}_0x6bd7d=_[_0xdcd0('0x3f')]({},_0x6bd7d,_0x4f75f8[_0xdcd0('0x41')]);var _0x1efa35={'where':_0x6bd7d[_0xdcd0('0x3e')]};return db[_0xdcd0('0x2c')]['count'](_0x1efa35)['then'](function(_0xb927ae){_0x22f04d[_0xdcd0('0x1a')]=_0xb927ae;if(_0x4f75f8[_0xdcd0('0x32')]['includeAll']){_0x6bd7d['include']=[{'all':!![]}];}return db[_0xdcd0('0x2c')][_0xdcd0('0x42')](_0x6bd7d);})[_0xdcd0('0x22')](function(_0x5078aa){_0x22f04d[_0xdcd0('0x43')]=_0x5078aa;return _0x22f04d;})[_0xdcd0('0x22')](respondWithFilteredResult(_0x4ac778,_0x6bd7d))['catch'](handleError(_0x4ac778,null));};exports[_0xdcd0('0x44')]=function(_0x4c8049,_0x3910cd){var _0x1bd8af={'raw':!![],'where':{'id':_0x4c8049[_0xdcd0('0x45')]['id']}},_0x3034e0={};_0x3034e0[_0xdcd0('0x31')]=_['keys'](db[_0xdcd0('0x2c')][_0xdcd0('0x2d')]);_0x3034e0[_0xdcd0('0x32')]=_[_0xdcd0('0x33')](_0x4c8049['query']);_0x3034e0[_0xdcd0('0x3c')]=_[_0xdcd0('0x34')](_0x3034e0['model'],_0x3034e0['query']);_0x1bd8af[_0xdcd0('0x35')]=_['intersection'](_0x3034e0['model'],qs['fields'](_0x4c8049['query'][_0xdcd0('0x36')]));_0x1bd8af['attributes']=_0x1bd8af[_0xdcd0('0x35')][_0xdcd0('0x46')]?_0x1bd8af[_0xdcd0('0x35')]:_0x3034e0[_0xdcd0('0x31')];if(_0x4c8049['query'][_0xdcd0('0x47')]){_0x1bd8af['include']=[{'all':!![]}];}_0x1bd8af=_[_0xdcd0('0x3f')]({},_0x1bd8af,_0x4c8049[_0xdcd0('0x41')]);return db[_0xdcd0('0x2c')][_0xdcd0('0x48')](_0x1bd8af)[_0xdcd0('0x22')](handleEntityNotFound(_0x3910cd,null))['then'](respondWithResult(_0x3910cd,null))[_0xdcd0('0x49')](handleError(_0x3910cd,null));};exports[_0xdcd0('0x4a')]=function(_0x2e8e47,_0x383636){return db[_0xdcd0('0x2c')][_0xdcd0('0x4a')](_0x2e8e47['body'],{})['then'](respondWithResult(_0x383636,0xc9))[_0xdcd0('0x49')](handleError(_0x383636,null));};exports[_0xdcd0('0x21')]=function(_0x2e7d4d,_0x4bf058){if(_0x2e7d4d['body']['id']){delete _0x2e7d4d['body']['id'];}return db[_0xdcd0('0x2c')][_0xdcd0('0x48')]({'where':{'id':_0x2e7d4d[_0xdcd0('0x45')]['id']}})['then'](handleEntityNotFound(_0x4bf058,null))[_0xdcd0('0x22')](saveUpdates(_0x2e7d4d[_0xdcd0('0x4b')],null))['then'](respondWithResult(_0x4bf058,null))['catch'](handleError(_0x4bf058,null));};exports[_0xdcd0('0x23')]=function(_0x1dddcd,_0xcc0262){return db[_0xdcd0('0x2c')]['find']({'where':{'id':_0x1dddcd[_0xdcd0('0x45')]['id']}})[_0xdcd0('0x22')](handleEntityNotFound(_0xcc0262,null))[_0xdcd0('0x22')](removeEntity(_0xcc0262,null))[_0xdcd0('0x49')](handleError(_0xcc0262,null));}; \ No newline at end of file +var _0x4d07=['name','send','map','DeskField','fieldName','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','filter','options','includeAll','rows','catch','rawAttributes','find','create','body','params','eml-format','zip-dir','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','destroy','error','stack'];(function(_0x15402a,_0x4fa192){var _0x227919=function(_0x1e28a4){while(--_0x1e28a4){_0x15402a['push'](_0x15402a['shift']());}};_0x227919(++_0x4fa192);}(_0x4d07,0x18e));var _0x74d0=function(_0x5dbb84,_0x1bbce9){_0x5dbb84=_0x5dbb84-0x0;var _0x1d6eae=_0x4d07[_0x5dbb84];return _0x1d6eae;};'use strict';var emlformat=require(_0x74d0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x74d0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x74d0('0x2'));var util=require(_0x74d0('0x3'));var path=require(_0x74d0('0x4'));var sox=require(_0x74d0('0x5'));var csv=require(_0x74d0('0x6'));var ejs=require(_0x74d0('0x7'));var fs=require('fs');var fs_extra=require(_0x74d0('0x8'));var _=require(_0x74d0('0x9'));var squel=require(_0x74d0('0xa'));var crypto=require(_0x74d0('0xb'));var jsforce=require(_0x74d0('0xc'));var deskjs=require(_0x74d0('0xd'));var toCsv=require(_0x74d0('0x6'));var querystring=require('querystring');var Papa=require(_0x74d0('0xe'));var Redis=require(_0x74d0('0xf'));var authService=require(_0x74d0('0x10'));var qs=require(_0x74d0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x74d0('0x12'));var logger=require(_0x74d0('0x13'))(_0x74d0('0x14'));var utils=require(_0x74d0('0x15'));var config=require(_0x74d0('0x16'));var licenseUtil=require(_0x74d0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13c742,_0x5753aa){_0x5753aa=_0x5753aa||0xcc;return function(_0x3ec5d3){if(_0x3ec5d3){return _0x13c742[_0x74d0('0x18')](_0x5753aa);}return _0x13c742[_0x74d0('0x19')](_0x5753aa)[_0x74d0('0x1a')]();};}function respondWithResult(_0x313c53,_0x3b35e5){_0x3b35e5=_0x3b35e5||0xc8;return function(_0x5cd088){if(_0x5cd088){return _0x313c53[_0x74d0('0x19')](_0x3b35e5)[_0x74d0('0x1b')](_0x5cd088);}};}function respondWithFilteredResult(_0x449162,_0x4a2794){return function(_0x1601d5){if(_0x1601d5){var _0x3e3dee=typeof _0x4a2794[_0x74d0('0x1c')]==='undefined'&&typeof _0x4a2794[_0x74d0('0x1d')]===_0x74d0('0x1e');var _0x30f605=_0x1601d5[_0x74d0('0x1f')];var _0x3cd9af=_0x3e3dee?0x0:_0x4a2794['offset'];var _0x1e1f08=_0x3e3dee?_0x1601d5['count']:_0x4a2794[_0x74d0('0x1c')]+_0x4a2794[_0x74d0('0x1d')];var _0x1ff871;if(_0x1e1f08>=_0x30f605){_0x1e1f08=_0x30f605;_0x1ff871=0xc8;}else{_0x1ff871=0xce;}_0x449162[_0x74d0('0x19')](_0x1ff871);return _0x449162[_0x74d0('0x20')](_0x74d0('0x21'),_0x3cd9af+'-'+_0x1e1f08+'/'+_0x30f605)[_0x74d0('0x1b')](_0x1601d5);}return null;};}function patchUpdates(_0x7aaca6){return function(_0x127690){try{jsonpatch['apply'](_0x127690,_0x7aaca6,!![]);}catch(_0x3cc6b5){return BPromise['reject'](_0x3cc6b5);}return _0x127690[_0x74d0('0x22')]();};}function saveUpdates(_0x16084a,_0x4ab837){return function(_0x1062f9){if(_0x1062f9){return _0x1062f9[_0x74d0('0x23')](_0x16084a)[_0x74d0('0x24')](function(_0x3153f0){return _0x3153f0;});}return null;};}function removeEntity(_0x377514,_0x43dc54){return function(_0xae815f){if(_0xae815f){return _0xae815f[_0x74d0('0x25')]()[_0x74d0('0x24')](function(){_0x377514[_0x74d0('0x19')](0xcc)[_0x74d0('0x1a')]();});}};}function handleEntityNotFound(_0x4ed251,_0x35dbe4){return function(_0x27b4dc){if(!_0x27b4dc){_0x4ed251[_0x74d0('0x18')](0x194);}return _0x27b4dc;};}function handleError(_0x319156,_0x6fbcba){_0x6fbcba=_0x6fbcba||0x1f4;return function(_0x6ab99d){logger[_0x74d0('0x26')](_0x6ab99d[_0x74d0('0x27')]);if(_0x6ab99d[_0x74d0('0x28')]){delete _0x6ab99d['name'];}_0x319156['status'](_0x6fbcba)[_0x74d0('0x29')](_0x6ab99d);};}exports['index']=function(_0x18b4fd,_0x261fc6){var _0x2d9880={},_0x4c18d9={},_0x5bc475={'count':0x0,'rows':[]};var _0xbebf6=_[_0x74d0('0x2a')](db[_0x74d0('0x2b')]['rawAttributes'],function(_0x59294b){return{'name':_0x59294b[_0x74d0('0x2c')],'type':_0x59294b[_0x74d0('0x2d')][_0x74d0('0x2e')]};});_0x4c18d9['model']=_[_0x74d0('0x2a')](_0xbebf6,_0x74d0('0x28'));_0x4c18d9[_0x74d0('0x2f')]=_[_0x74d0('0x30')](_0x18b4fd[_0x74d0('0x2f')]);_0x4c18d9['filters']=_['intersection'](_0x4c18d9[_0x74d0('0x31')],_0x4c18d9[_0x74d0('0x2f')]);_0x2d9880[_0x74d0('0x32')]=_[_0x74d0('0x33')](_0x4c18d9['model'],qs[_0x74d0('0x34')](_0x18b4fd[_0x74d0('0x2f')][_0x74d0('0x34')]));_0x2d9880[_0x74d0('0x32')]=_0x2d9880[_0x74d0('0x32')][_0x74d0('0x35')]?_0x2d9880[_0x74d0('0x32')]:_0x4c18d9[_0x74d0('0x31')];if(!_0x18b4fd[_0x74d0('0x2f')][_0x74d0('0x36')](_0x74d0('0x37'))){_0x2d9880[_0x74d0('0x1d')]=qs[_0x74d0('0x1d')](_0x18b4fd['query'][_0x74d0('0x1d')]);_0x2d9880[_0x74d0('0x1c')]=qs[_0x74d0('0x1c')](_0x18b4fd[_0x74d0('0x2f')][_0x74d0('0x1c')]);}_0x2d9880[_0x74d0('0x38')]=qs[_0x74d0('0x39')](_0x18b4fd[_0x74d0('0x2f')][_0x74d0('0x39')]);_0x2d9880[_0x74d0('0x3a')]=qs['filters'](_[_0x74d0('0x3b')](_0x18b4fd[_0x74d0('0x2f')],_0x4c18d9[_0x74d0('0x3c')]),_0xbebf6);if(_0x18b4fd['query']['filter']){_0x2d9880[_0x74d0('0x3a')]=_[_0x74d0('0x3d')](_0x2d9880['where'],{'$or':_[_0x74d0('0x2a')](_0xbebf6,function(_0x4c4cfd){if(_0x4c4cfd[_0x74d0('0x2d')]!==_0x74d0('0x3e')){var _0x43c894={};_0x43c894[_0x4c4cfd[_0x74d0('0x28')]]={'$like':'%'+_0x18b4fd[_0x74d0('0x2f')][_0x74d0('0x3f')]+'%'};return _0x43c894;}})});}_0x2d9880=_[_0x74d0('0x3d')]({},_0x2d9880,_0x18b4fd[_0x74d0('0x40')]);var _0x2dae77={'where':_0x2d9880[_0x74d0('0x3a')]};return db['DeskField'][_0x74d0('0x1f')](_0x2dae77)[_0x74d0('0x24')](function(_0x55935e){_0x5bc475['count']=_0x55935e;if(_0x18b4fd['query'][_0x74d0('0x41')]){_0x2d9880['include']=[{'all':!![]}];}return db[_0x74d0('0x2b')]['findAll'](_0x2d9880);})[_0x74d0('0x24')](function(_0x55d8d3){_0x5bc475[_0x74d0('0x42')]=_0x55d8d3;return _0x5bc475;})['then'](respondWithFilteredResult(_0x261fc6,_0x2d9880))[_0x74d0('0x43')](handleError(_0x261fc6,null));};exports['show']=function(_0x450aec,_0x3d79ed){var _0x2ecd38={'raw':!![],'where':{'id':_0x450aec['params']['id']}},_0x11a24e={};_0x11a24e['model']=_[_0x74d0('0x30')](db['DeskField'][_0x74d0('0x44')]);_0x11a24e[_0x74d0('0x2f')]=_[_0x74d0('0x30')](_0x450aec[_0x74d0('0x2f')]);_0x11a24e[_0x74d0('0x3c')]=_['intersection'](_0x11a24e[_0x74d0('0x31')],_0x11a24e[_0x74d0('0x2f')]);_0x2ecd38['attributes']=_[_0x74d0('0x33')](_0x11a24e[_0x74d0('0x31')],qs[_0x74d0('0x34')](_0x450aec[_0x74d0('0x2f')][_0x74d0('0x34')]));_0x2ecd38['attributes']=_0x2ecd38['attributes']['length']?_0x2ecd38[_0x74d0('0x32')]:_0x11a24e[_0x74d0('0x31')];if(_0x450aec[_0x74d0('0x2f')][_0x74d0('0x41')]){_0x2ecd38['include']=[{'all':!![]}];}_0x2ecd38=_['merge']({},_0x2ecd38,_0x450aec[_0x74d0('0x40')]);return db[_0x74d0('0x2b')][_0x74d0('0x45')](_0x2ecd38)[_0x74d0('0x24')](handleEntityNotFound(_0x3d79ed,null))[_0x74d0('0x24')](respondWithResult(_0x3d79ed,null))[_0x74d0('0x43')](handleError(_0x3d79ed,null));};exports[_0x74d0('0x46')]=function(_0x531db9,_0x3ef3d0){return db['DeskField']['create'](_0x531db9[_0x74d0('0x47')],{})['then'](respondWithResult(_0x3ef3d0,0xc9))[_0x74d0('0x43')](handleError(_0x3ef3d0,null));};exports[_0x74d0('0x23')]=function(_0x3a9cfb,_0x10452b){if(_0x3a9cfb[_0x74d0('0x47')]['id']){delete _0x3a9cfb['body']['id'];}return db['DeskField']['find']({'where':{'id':_0x3a9cfb[_0x74d0('0x48')]['id']}})[_0x74d0('0x24')](handleEntityNotFound(_0x10452b,null))[_0x74d0('0x24')](saveUpdates(_0x3a9cfb[_0x74d0('0x47')],null))['then'](respondWithResult(_0x10452b,null))[_0x74d0('0x43')](handleError(_0x10452b,null));};exports[_0x74d0('0x25')]=function(_0x1bf9cd,_0x41f893){return db[_0x74d0('0x2b')]['find']({'where':{'id':_0x1bf9cd[_0x74d0('0x48')]['id']}})[_0x74d0('0x24')](handleEntityNotFound(_0x41f893,null))['then'](removeEntity(_0x41f893,null))[_0x74d0('0x43')](handleError(_0x41f893,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 820e505..bf1e7d0 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 _0xe48c=['DeskField','desk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDeskField.attributes','exports','define'];(function(_0x455d37,_0x9b1de3){var _0x10d3e1=function(_0x7a6ba2){while(--_0x7a6ba2){_0x455d37['push'](_0x455d37['shift']());}};_0x10d3e1(++_0x9b1de3);}(_0xe48c,0xf4));var _0xce48=function(_0x26df27,_0x163361){_0x26df27=_0x26df27-0x0;var _0x2fa81c=_0xe48c[_0x26df27];return _0x2fa81c;};'use strict';var _=require(_0xce48('0x0'));var util=require('util');var logger=require(_0xce48('0x1'))(_0xce48('0x2'));var moment=require(_0xce48('0x3'));var BPromise=require(_0xce48('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xce48('0x5'));var rimraf=require(_0xce48('0x6'));var config=require(_0xce48('0x7'));var attributes=require(_0xce48('0x8'));module[_0xce48('0x9')]=function(_0x577fd0,_0x3a4856){return _0x577fd0[_0xce48('0xa')](_0xce48('0xb'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0xce48('0xc'),'fields':[_0xce48('0xd'),_0xce48('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3c25=['int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDeskField.attributes','DeskField'];(function(_0x4b0e73,_0x176c80){var _0x1455b0=function(_0x1352c5){while(--_0x1352c5){_0x4b0e73['push'](_0x4b0e73['shift']());}};_0x1455b0(++_0x176c80);}(_0x3c25,0x130));var _0x53c2=function(_0xc1d1d9,_0x33d89b){_0xc1d1d9=_0xc1d1d9-0x0;var _0x5ac72b=_0x3c25[_0xc1d1d9];return _0x5ac72b;};'use strict';var _=require(_0x53c2('0x0'));var util=require(_0x53c2('0x1'));var logger=require(_0x53c2('0x2'))(_0x53c2('0x3'));var moment=require(_0x53c2('0x4'));var BPromise=require(_0x53c2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x53c2('0x6'));var rimraf=require(_0x53c2('0x7'));var config=require(_0x53c2('0x8'));var attributes=require(_0x53c2('0x9'));module['exports']=function(_0x232aa0,_0x38edf4){return _0x232aa0['define'](_0x53c2('0xa'),attributes,{'tableName':_0x53c2('0xb'),'paranoid':![],'indexes':[{'name':_0x53c2('0xc'),'fields':[_0x53c2('0xd'),_0x53c2('0xe')],'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 6928765..6df781b 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 _0xfc8c=['error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xfc8c,0x1a1));var _0xcfc8=function(_0x1ac053,_0x39267a){_0x1ac053=_0x1ac053-0x0;var _0x2d209a=_0xfc8c[_0x1ac053];return _0x2d209a;};'use strict';var _=require(_0xcfc8('0x0'));var util=require(_0xcfc8('0x1'));var moment=require(_0xcfc8('0x2'));var BPromise=require(_0xcfc8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfc8('0x4'));var db=require(_0xcfc8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xcfc8('0x6'))(_0xcfc8('0x7'));var config=require(_0xcfc8('0x8'));var jayson=require(_0xcfc8('0x9'));var client=jayson[_0xcfc8('0xa')][_0xcfc8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x486f64,_0x1a0043,_0x3df924){return new BPromise(function(_0x3cbfe2,_0x53c23f){return client[_0xcfc8('0xc')](_0x486f64,_0x3df924)[_0xcfc8('0xd')](function(_0x3e43bc){logger[_0xcfc8('0xe')](_0xcfc8('0xf'),_0x1a0043,_0xcfc8('0x10'));logger[_0xcfc8('0x11')](_0xcfc8('0x12'),_0x1a0043,_0xcfc8('0x10'),JSON[_0xcfc8('0x13')](_0x3e43bc));if(_0x3e43bc[_0xcfc8('0x14')]){if(_0x3e43bc[_0xcfc8('0x14')][_0xcfc8('0x15')]===0x1f4){logger[_0xcfc8('0x14')](_0xcfc8('0xf'),_0x1a0043,_0x3e43bc[_0xcfc8('0x14')][_0xcfc8('0x16')]);return _0x53c23f(_0x3e43bc['error'][_0xcfc8('0x16')]);}logger['error'](_0xcfc8('0xf'),_0x1a0043,_0x3e43bc[_0xcfc8('0x14')]['message']);return _0x3cbfe2(_0x3e43bc[_0xcfc8('0x14')][_0xcfc8('0x16')]);}else{logger['info']('DeskField,\x20%s,\x20%s',_0x1a0043,'request\x20sent');_0x3cbfe2(_0x3e43bc['result'][_0xcfc8('0x16')]);}})['catch'](function(_0x21cf5d){logger['error'](_0xcfc8('0xf'),_0x1a0043,_0x21cf5d);_0x53c23f(_0x21cf5d);});});} \ No newline at end of file +var _0xdaa7=['randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util'];(function(_0x2980de,_0x1426a4){var _0x81a4ca=function(_0x19040e){while(--_0x19040e){_0x2980de['push'](_0x2980de['shift']());}};_0x81a4ca(++_0x1426a4);}(_0xdaa7,0x19c));var _0x7daa=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xdaa7[_0x51c819];return _0x15c5d2;};'use strict';var _=require(_0x7daa('0x0'));var util=require(_0x7daa('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7daa('0x2'));var fs=require('fs');var Redis=require(_0x7daa('0x3'));var db=require(_0x7daa('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7daa('0x5'));var jayson=require(_0x7daa('0x6'));var client=jayson[_0x7daa('0x7')][_0x7daa('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x917cc7,_0x4111bf,_0x4b670f){return new BPromise(function(_0x2be978,_0x3e2143){return client['request'](_0x917cc7,_0x4b670f)['then'](function(_0x2b1de9){logger[_0x7daa('0x9')](_0x7daa('0xa'),_0x4111bf,_0x7daa('0xb'));logger[_0x7daa('0xc')]('DeskField,\x20%s,\x20%s,\x20%s',_0x4111bf,_0x7daa('0xb'),JSON[_0x7daa('0xd')](_0x2b1de9));if(_0x2b1de9[_0x7daa('0xe')]){if(_0x2b1de9[_0x7daa('0xe')][_0x7daa('0xf')]===0x1f4){logger[_0x7daa('0xe')](_0x7daa('0xa'),_0x4111bf,_0x2b1de9[_0x7daa('0xe')][_0x7daa('0x10')]);return _0x3e2143(_0x2b1de9[_0x7daa('0xe')][_0x7daa('0x10')]);}logger['error'](_0x7daa('0xa'),_0x4111bf,_0x2b1de9[_0x7daa('0xe')]['message']);return _0x2be978(_0x2b1de9[_0x7daa('0xe')][_0x7daa('0x10')]);}else{logger[_0x7daa('0x9')](_0x7daa('0xa'),_0x4111bf,_0x7daa('0xb'));_0x2be978(_0x2b1de9['result'][_0x7daa('0x10')]);}})[_0x7daa('0x11')](function(_0x151502){logger[_0x7daa('0xe')](_0x7daa('0xa'),_0x4111bf,_0x151502);_0x3e2143(_0x151502);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 7139770..5089b17 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 _0xd3b0=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x4f1eb9,_0x27e51d){var _0x5151c5=function(_0xdd7174){while(--_0xdd7174){_0x4f1eb9['push'](_0x4f1eb9['shift']());}};_0x5151c5(++_0x27e51d);}(_0xd3b0,0xa4));var _0x0d3b=function(_0x6b8ca3,_0x18bfa2){_0x6b8ca3=_0x6b8ca3-0x0;var _0x382b4a=_0xd3b0[_0x6b8ca3];return _0x382b4a;};'use strict';var multer=require(_0x0d3b('0x0'));var util=require(_0x0d3b('0x1'));var path=require(_0x0d3b('0x2'));var timeout=require(_0x0d3b('0x3'));var express=require(_0x0d3b('0x4'));var router=express[_0x0d3b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x0d3b('0x6'));var interaction=require(_0x0d3b('0x7'));var config=require(_0x0d3b('0x8'));var controller=require(_0x0d3b('0x9'));router[_0x0d3b('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0d3b('0xb'),auth['isAuthenticated'](),controller[_0x0d3b('0xc')]);router[_0x0d3b('0xa')](_0x0d3b('0xd'),auth[_0x0d3b('0xe')](),controller[_0x0d3b('0xf')]);router[_0x0d3b('0xa')](_0x0d3b('0x10'),auth[_0x0d3b('0xe')](),controller['getFields']);router[_0x0d3b('0x11')]('/',auth[_0x0d3b('0xe')](),controller[_0x0d3b('0x12')]);router[_0x0d3b('0x11')](_0x0d3b('0xd'),auth[_0x0d3b('0xe')](),controller['addConfiguration']);router[_0x0d3b('0x13')](_0x0d3b('0xb'),auth[_0x0d3b('0xe')](),controller[_0x0d3b('0x14')]);router[_0x0d3b('0x15')](_0x0d3b('0xb'),auth['isAuthenticated'](),controller[_0x0d3b('0x16')]);module[_0x0d3b('0x17')]=router; \ No newline at end of file +var _0xa5ac=['/:id/configurations','addConfiguration','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','get','/:id','show','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x43ec5b,_0x156cee){var _0xe01ed=function(_0x5be6ac){while(--_0x5be6ac){_0x43ec5b['push'](_0x43ec5b['shift']());}};_0xe01ed(++_0x156cee);}(_0xa5ac,0xc1));var _0xca5a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5ac[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xca5a('0x0'));var path=require(_0xca5a('0x1'));var timeout=require(_0xca5a('0x2'));var express=require('express');var router=express[_0xca5a('0x3')]();var fs_extra=require(_0xca5a('0x4'));var auth=require(_0xca5a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xca5a('0x6'));var controller=require(_0xca5a('0x7'));router['get']('/',auth[_0xca5a('0x8')](),controller['index']);router[_0xca5a('0x9')](_0xca5a('0xa'),auth[_0xca5a('0x8')](),controller[_0xca5a('0xb')]);router['get']('/:id/configurations',auth[_0xca5a('0x8')](),controller[_0xca5a('0xc')]);router[_0xca5a('0x9')](_0xca5a('0xd'),auth[_0xca5a('0x8')](),controller[_0xca5a('0xe')]);router[_0xca5a('0xf')]('/',auth[_0xca5a('0x8')](),controller[_0xca5a('0x10')]);router[_0xca5a('0xf')](_0xca5a('0x11'),auth['isAuthenticated'](),controller[_0xca5a('0x12')]);router['put'](_0xca5a('0xa'),auth[_0xca5a('0x8')](),controller['update']);router['delete'](_0xca5a('0xa'),auth['isAuthenticated'](),controller[_0xca5a('0x13')]);module[_0xca5a('0x14')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 2720e4c..531932b 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 _0xaa48=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3f0eae,_0x3477b9){var _0x334345=function(_0x6f2cf4){while(--_0x6f2cf4){_0x3f0eae['push'](_0x3f0eae['shift']());}};_0x334345(++_0x3477b9);}(_0xaa48,0x15a));var _0x8aa4=function(_0x3c02a9,_0x3e383b){_0x3c02a9=_0x3c02a9-0x0;var _0x43433f=_0xaa48[_0x3c02a9];return _0x43433f;};'use strict';var Sequelize=require(_0x8aa4('0x0'));module[_0x8aa4('0x1')]={'name':{'type':Sequelize[_0x8aa4('0x2')]},'username':{'type':Sequelize[_0x8aa4('0x2')]},'password':{'type':Sequelize[_0x8aa4('0x2')]},'remoteUri':{'type':Sequelize[_0x8aa4('0x2')]},'tenantId':{'type':Sequelize[_0x8aa4('0x2')]},'clientId':{'type':Sequelize[_0x8aa4('0x2')]},'clientSecret':{'type':Sequelize[_0x8aa4('0x2')]},'serverUrl':{'type':Sequelize[_0x8aa4('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x8aa4('0x2')]},'modernAuthentication':{'type':Sequelize[_0x8aa4('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x744c=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x744c,0xa0));var _0xc744=function(_0xc76644,_0x2c0f9a){_0xc76644=_0xc76644-0x0;var _0x366481=_0x744c[_0xc76644];return _0x366481;};'use strict';var Sequelize=require(_0xc744('0x0'));module[_0xc744('0x1')]={'name':{'type':Sequelize[_0xc744('0x2')]},'username':{'type':Sequelize[_0xc744('0x2')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc744('0x2')]},'tenantId':{'type':Sequelize[_0xc744('0x2')]},'clientId':{'type':Sequelize[_0xc744('0x2')]},'clientSecret':{'type':Sequelize[_0xc744('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0xc744('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 80033a8..7082d5b 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 _0x00d0=['Dynamics365Account','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','destroy','find','getConfigurations','findOne','Dynamics365Configuration','addConfiguration','Subjects','getSubjects','channel','Dynamics365Field','slice','substring','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','incident','title','description','customerid','ownerid','caseorigincode','subject','phonenumber','directioncode','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productidname','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','remoteUri','tenantId','clientId','clientSecret','CloudProvider','data7','access_token','data5','/oauth2/token','password','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','4.0','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','BooleanAttributeMetadata','StringAttributeMetadata','BigIntAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','test','statusCode','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','UserLocalizedLabel','Label','Value','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','../../components/parsers/qs','../../config/logger','../../components/integrations/configuration','status','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','error','stack','name','send','map'];(function(_0x44946b,_0xf874ec){var _0x249bc4=function(_0x40a23e){while(--_0x40a23e){_0x44946b['push'](_0x44946b['shift']());}};_0x249bc4(++_0xf874ec);}(_0x00d0,0x163));var _0x000d=function(_0x4a36b1,_0x3759b6){_0x4a36b1=_0x4a36b1-0x0;var _0x265219=_0x00d0[_0x4a36b1];return _0x265219;};'use strict';var rp=require(_0x000d('0x0'));var util=require(_0x000d('0x1'));var _=require('lodash');var qs=require(_0x000d('0x2'));var logger=require(_0x000d('0x3'))('api');var db=require('../../mysqldb')['db'];var integrations=require(_0x000d('0x4'));function respondWithResult(_0x6d02aa,_0x55cade){_0x55cade=_0x55cade||0xc8;return function(_0x1bd3fc){if(_0x1bd3fc){return _0x6d02aa[_0x000d('0x5')](_0x55cade)[_0x000d('0x6')](_0x1bd3fc);}};}function respondWithFilteredResult(_0x442d81,_0x5a80e3){return function(_0x5af8bf){if(_0x5af8bf){var _0x3da096=typeof _0x5a80e3[_0x000d('0x7')]===_0x000d('0x8')&&typeof _0x5a80e3[_0x000d('0x9')]===_0x000d('0x8');var _0xaeffc=_0x5af8bf['count'];var _0x35ac59=_0x3da096?0x0:_0x5a80e3[_0x000d('0x7')];var _0x5689a4=_0x3da096?_0x5af8bf[_0x000d('0xa')]:_0x5a80e3['offset']+_0x5a80e3[_0x000d('0x9')];var _0x31c8cc;if(_0x5689a4>=_0xaeffc){_0x5689a4=_0xaeffc;_0x31c8cc=0xc8;}else{_0x31c8cc=0xce;}_0x442d81[_0x000d('0x5')](_0x31c8cc);return _0x442d81[_0x000d('0xb')](_0x000d('0xc'),_0x35ac59+'-'+_0x5689a4+'/'+_0xaeffc)[_0x000d('0x6')](_0x5af8bf);}return null;};}function saveUpdates(_0x85debd){return function(_0x5c3ece){if(_0x5c3ece){return _0x5c3ece[_0x000d('0xd')](_0x85debd)[_0x000d('0xe')](function(_0xbe54a9){return _0xbe54a9;});}return null;};}function removeEntity(_0x198089){return function(_0x2616ff){if(_0x2616ff){return _0x2616ff['destroy']()[_0x000d('0xe')](function(){_0x198089[_0x000d('0x5')](0xcc)['end']();});}};}function handleEntityNotFound(_0x457923){return function(_0x336835){if(!_0x336835){_0x457923[_0x000d('0xf')](0x194);}return _0x336835;};}function handleError(_0x3955c3,_0x4091bd){_0x4091bd=_0x4091bd||0x1f4;return function(_0x173d69){logger[_0x000d('0x10')](_0x173d69[_0x000d('0x11')]);if(_0x173d69['name']){delete _0x173d69[_0x000d('0x12')];}_0x3955c3['status'](_0x4091bd)[_0x000d('0x13')](_0x173d69);};}exports['index']=function(_0x5fc197,_0x262d25){var _0x416fd3={},_0x36469a={},_0x322d20={'count':0x0,'rows':[]};var _0x3f36f5=_[_0x000d('0x14')](db[_0x000d('0x15')][_0x000d('0x16')],function(_0x48d5b1){return{'name':_0x48d5b1[_0x000d('0x17')],'type':_0x48d5b1[_0x000d('0x18')][_0x000d('0x19')]};});_0x36469a['model']=_[_0x000d('0x14')](_0x3f36f5,'name');_0x36469a['query']=_[_0x000d('0x1a')](_0x5fc197[_0x000d('0x1b')]);_0x36469a[_0x000d('0x1c')]=_[_0x000d('0x1d')](_0x36469a[_0x000d('0x1e')],_0x36469a[_0x000d('0x1b')]);_0x416fd3[_0x000d('0x1f')]=_[_0x000d('0x1d')](_0x36469a[_0x000d('0x1e')],qs[_0x000d('0x20')](_0x5fc197[_0x000d('0x1b')]['fields']));_0x416fd3[_0x000d('0x1f')]=_0x416fd3['attributes'][_0x000d('0x21')]?_0x416fd3[_0x000d('0x1f')]:_0x36469a[_0x000d('0x1e')];if(!_0x5fc197['query'][_0x000d('0x22')](_0x000d('0x23'))){_0x416fd3[_0x000d('0x9')]=qs[_0x000d('0x9')](_0x5fc197[_0x000d('0x1b')][_0x000d('0x9')]);_0x416fd3['offset']=qs['offset'](_0x5fc197[_0x000d('0x1b')][_0x000d('0x7')]);}_0x416fd3[_0x000d('0x24')]=qs[_0x000d('0x25')](_0x5fc197[_0x000d('0x1b')]['sort']);_0x416fd3[_0x000d('0x26')]=qs[_0x000d('0x1c')](_[_0x000d('0x27')](_0x5fc197['query'],_0x36469a[_0x000d('0x1c')]),_0x3f36f5);if(_0x5fc197['query'][_0x000d('0x28')]){_0x416fd3[_0x000d('0x26')]=_[_0x000d('0x29')](_0x416fd3['where'],{'$or':_[_0x000d('0x14')](_0x3f36f5,function(_0x2e5a02){if(_0x2e5a02[_0x000d('0x18')]!==_0x000d('0x2a')){var _0x395779={};_0x395779[_0x2e5a02[_0x000d('0x12')]]={'$like':'%'+_0x5fc197[_0x000d('0x1b')][_0x000d('0x28')]+'%'};return _0x395779;}})});}_0x416fd3=_['merge']({},_0x416fd3,_0x5fc197[_0x000d('0x2b')]);var _0x48a0d7={'where':_0x416fd3[_0x000d('0x26')]};return db['Dynamics365Account'][_0x000d('0xa')](_0x48a0d7)['then'](function(_0x1c9637){_0x322d20[_0x000d('0xa')]=_0x1c9637;if(_0x5fc197[_0x000d('0x1b')][_0x000d('0x2c')]){_0x416fd3[_0x000d('0x2d')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x000d('0x2e')](_0x416fd3);})[_0x000d('0xe')](function(_0xa9e9dd){_0x322d20[_0x000d('0x2f')]=_0xa9e9dd;return _0x322d20;})['then'](respondWithFilteredResult(_0x262d25,_0x416fd3))[_0x000d('0x30')](handleError(_0x262d25,null));};exports['show']=function(_0x2ac3ac,_0x566fc2){var _0x5cd99b={'raw':![],'where':{'id':_0x2ac3ac[_0x000d('0x31')]['id']}},_0x57594f={};_0x57594f[_0x000d('0x1e')]=_[_0x000d('0x1a')](db[_0x000d('0x15')][_0x000d('0x16')]);_0x57594f[_0x000d('0x1b')]=_[_0x000d('0x1a')](_0x2ac3ac[_0x000d('0x1b')]);_0x57594f[_0x000d('0x1c')]=_['intersection'](_0x57594f['model'],_0x57594f[_0x000d('0x1b')]);_0x5cd99b[_0x000d('0x1f')]=_[_0x000d('0x1d')](_0x57594f[_0x000d('0x1e')],qs[_0x000d('0x20')](_0x2ac3ac['query'][_0x000d('0x20')]));_0x5cd99b['attributes']=_0x5cd99b['attributes'][_0x000d('0x21')]?_0x5cd99b[_0x000d('0x1f')]:_0x57594f['model'];if(_0x2ac3ac['query'][_0x000d('0x2c')]){_0x5cd99b[_0x000d('0x2d')]=[{'all':!![]}];}_0x5cd99b=_[_0x000d('0x29')]({},_0x5cd99b,_0x2ac3ac[_0x000d('0x2b')]);return db[_0x000d('0x15')]['find'](_0x5cd99b)[_0x000d('0xe')](handleEntityNotFound(_0x566fc2,null))[_0x000d('0xe')](respondWithResult(_0x566fc2,null))[_0x000d('0x30')](handleError(_0x566fc2,null));};exports[_0x000d('0x32')]=function(_0x830c67,_0x3c52d6){return db[_0x000d('0x15')][_0x000d('0x32')](_0x830c67['body'],{})[_0x000d('0xe')](respondWithResult(_0x3c52d6,0xc9))[_0x000d('0x30')](handleError(_0x3c52d6,null));};exports[_0x000d('0xd')]=function(_0x4db665,_0x2d3599){if(_0x4db665[_0x000d('0x33')]['id']){delete _0x4db665['body']['id'];}return db[_0x000d('0x15')]['find']({'where':{'id':_0x4db665['params']['id']}})[_0x000d('0xe')](handleEntityNotFound(_0x2d3599,null))[_0x000d('0xe')](saveUpdates(_0x4db665[_0x000d('0x33')],null))[_0x000d('0xe')](respondWithResult(_0x2d3599,null))[_0x000d('0x30')](handleError(_0x2d3599,null));};exports[_0x000d('0x34')]=function(_0x4bdf62,_0x23284b){return db[_0x000d('0x15')][_0x000d('0x35')]({'where':{'id':_0x4bdf62[_0x000d('0x31')]['id']}})[_0x000d('0xe')](handleEntityNotFound(_0x23284b,null))[_0x000d('0xe')](removeEntity(_0x23284b,null))['catch'](handleError(_0x23284b,null));};exports[_0x000d('0x36')]=function(_0x335821,_0x97eb75){var _0x583201={};var _0x542270={};var _0x414b97;var _0x17a968;return db[_0x000d('0x15')][_0x000d('0x37')]({'where':{'id':_0x335821[_0x000d('0x31')]['id']}})[_0x000d('0xe')](handleEntityNotFound(_0x97eb75,null))[_0x000d('0xe')](function(_0x54fd9c){if(_0x54fd9c){_0x414b97=_0x54fd9c;_0x542270[_0x000d('0x1e')]=_['keys'](db[_0x000d('0x38')][_0x000d('0x16')]);_0x542270[_0x000d('0x1b')]=_[_0x000d('0x1a')](_0x335821[_0x000d('0x1b')]);_0x542270[_0x000d('0x1c')]=_[_0x000d('0x1d')](_0x542270[_0x000d('0x1e')],_0x542270[_0x000d('0x1b')]);_0x583201[_0x000d('0x1f')]=_[_0x000d('0x1d')](_0x542270[_0x000d('0x1e')],qs[_0x000d('0x20')](_0x335821[_0x000d('0x1b')][_0x000d('0x20')]));_0x583201['attributes']=_0x583201[_0x000d('0x1f')][_0x000d('0x21')]?_0x583201['attributes']:_0x542270['model'];_0x583201[_0x000d('0x24')]=qs[_0x000d('0x25')](_0x335821[_0x000d('0x1b')][_0x000d('0x25')]);_0x583201['where']=qs[_0x000d('0x1c')](_['pick'](_0x335821[_0x000d('0x1b')],_0x542270[_0x000d('0x1c')]));if(_0x335821[_0x000d('0x1b')][_0x000d('0x28')]){_0x583201[_0x000d('0x26')]=_[_0x000d('0x29')](_0x583201[_0x000d('0x26')],{'$or':_[_0x000d('0x14')](_0x583201['attributes'],function(_0x296de3){var _0x5df25a={};_0x5df25a[_0x296de3]={'$like':'%'+_0x335821[_0x000d('0x1b')][_0x000d('0x28')]+'%'};return _0x5df25a;})});}_0x583201=_[_0x000d('0x29')]({},_0x583201,_0x335821[_0x000d('0x2b')]);return _0x414b97[_0x000d('0x36')](_0x583201);}})[_0x000d('0xe')](function(_0x4c47ef){if(_0x4c47ef){_0x17a968=_0x4c47ef[_0x000d('0x21')];if(!_0x335821[_0x000d('0x1b')][_0x000d('0x22')](_0x000d('0x23'))){_0x583201[_0x000d('0x9')]=qs[_0x000d('0x9')](_0x335821[_0x000d('0x1b')]['limit']);_0x583201[_0x000d('0x7')]=qs[_0x000d('0x7')](_0x335821[_0x000d('0x1b')]['offset']);}return _0x414b97['getConfigurations'](_0x583201);}})['then'](function(_0x4c879b){if(_0x4c879b){return _0x4c879b?{'count':_0x17a968,'rows':_0x4c879b}:null;}})[_0x000d('0xe')](respondWithResult(_0x97eb75,null))[_0x000d('0x30')](handleError(_0x97eb75,null));};exports[_0x000d('0x39')]=function(_0x56d61a,_0x230f57){if(_0x56d61a['body']['id']){delete _0x56d61a[_0x000d('0x33')]['id'];}return db[_0x000d('0x15')][_0x000d('0x37')]({'where':{'id':_0x56d61a[_0x000d('0x31')]['id']}})[_0x000d('0xe')](handleEntityNotFound(_0x230f57,null))[_0x000d('0xe')](function(_0x43b932){if(_0x43b932){_0x56d61a[_0x000d('0x33')]['AccountId']=_0x43b932['id'];_0x56d61a[_0x000d('0x33')][_0x000d('0x3a')]=integrations[_0x000d('0x3b')](_0x56d61a[_0x000d('0x33')][_0x000d('0x3c')],_0x56d61a[_0x000d('0x33')]['type']);_0x56d61a[_0x000d('0x33')]['Descriptions']=integrations['getDescriptions'](_0x56d61a[_0x000d('0x33')][_0x000d('0x3c')],_0x56d61a['body'][_0x000d('0x18')]);return db[_0x000d('0x38')][_0x000d('0x32')](_0x56d61a['body'],{'include':[{'model':db[_0x000d('0x3d')],'as':_0x000d('0x3a')},{'model':db[_0x000d('0x3d')],'as':'Descriptions'}]});}return null;})[_0x000d('0xe')](respondWithResult(_0x230f57,null))[_0x000d('0x30')](handleError(_0x230f57,null));};function sanitizeRemoteUri(_0x325c58){var _0xec7f32=_0x325c58[_0x000d('0x3e')](-0x1);if(_0xec7f32==='/')return _0x325c58[_0x000d('0x3f')](0x0,_0x325c58[_0x000d('0x40')](_0xec7f32));return _0x325c58;}function getWebApiUrl(_0x3853b6){return util['format'](_0x000d('0x41'),_0x3853b6);}exports[_0x000d('0x42')]=function(_0x33918d,_0x3a0960){var _0x2a3921=_0x33918d[_0x000d('0x1b')][_0x000d('0x43')];var _0x35b886=_0x2a3921===_0x000d('0x44')?'Incident':'PhoneCall';var _0x33c6e5='';var _0x135e2e='';var _0x1d25bd='';var _0x59ffc2='';var _0x643b36='';var _0x2414ec='';var _0x5548da='';var _0x583f64='';var _0x22410e=[_0x000d('0x45'),_0x000d('0x46'),_0x000d('0x47'),_0x000d('0x48'),_0x000d('0x49'),_0x000d('0x4a'),_0x000d('0x4b'),'regardingobjectid',_0x000d('0x4c'),'phonecall_activity_parties'];var _0x2c49d1=[_0x000d('0x4d'),_0x000d('0x4e'),_0x000d('0x4f'),_0x000d('0x50'),_0x000d('0x51'),'contactidyominame',_0x000d('0x52'),_0x000d('0x53'),_0x000d('0x54'),'createdbyexternalpartyyominame',_0x000d('0x55'),'createdbyyominame','createdon','createdonbehalfbyname',_0x000d('0x56'),_0x000d('0x57'),_0x000d('0x58'),_0x000d('0x59'),_0x000d('0x5a'),_0x000d('0x5b'),_0x000d('0x5c'),_0x000d('0x5d'),_0x000d('0x5e'),_0x000d('0x5f'),'firstresponsebykpiidname',_0x000d('0x60'),_0x000d('0x61'),_0x000d('0x62'),_0x000d('0x63'),_0x000d('0x64'),_0x000d('0x65'),'modifiedbyexternalpartyname',_0x000d('0x66'),'modifiedbyname',_0x000d('0x67'),_0x000d('0x68'),_0x000d('0x69'),_0x000d('0x6a'),_0x000d('0x6b'),_0x000d('0x6c'),_0x000d('0x6d'),_0x000d('0x6e'),_0x000d('0x6f'),_0x000d('0x70'),_0x000d('0x71'),_0x000d('0x72'),_0x000d('0x73'),_0x000d('0x74'),'primarycontactidyominame',_0x000d('0x75'),_0x000d('0x76'),_0x000d('0x77'),_0x000d('0x78'),'resolvebykpiidname',_0x000d('0x79'),_0x000d('0x7a'),_0x000d('0x7b'),'sentimentvalue',_0x000d('0x7c'),_0x000d('0x7d'),_0x000d('0x7e'),_0x000d('0x7f'),_0x000d('0x80'),'subjectidname',_0x000d('0x81'),_0x000d('0x82'),_0x000d('0x83'),_0x000d('0x84'),_0x000d('0x85'),_0x000d('0x86')];var _0x312283=_0x22410e[_0x000d('0x87')](_0x2c49d1);return db['Dynamics365Account']['findOne']({'where':{'id':_0x33918d[_0x000d('0x31')]['id']},'attributes':['id',_0x000d('0x88'),'password',_0x000d('0x89'),_0x000d('0x8a'),_0x000d('0x8b'),_0x000d('0x8c'),'modernAuthentication'],'include':[{'model':db['CloudProvider'],'as':_0x000d('0x8d'),'attributes':['id','data5',_0x000d('0x8e')]}]})[_0x000d('0xe')](handleEntityNotFound(_0x3a0960,null))['then'](function(_0x3bae4d){if(_0x3bae4d){if(_0x3bae4d['modernAuthentication']){_0x3bae4d[_0x000d('0x8f')]=_0x3bae4d[_0x000d('0x8d')][_0x000d('0x90')];_0x583f64=sanitizeRemoteUri(_0x3bae4d[_0x000d('0x8d')]['data7']);_0x5548da=getWebApiUrl(_0x583f64);return _0x3bae4d;}_0x583f64=sanitizeRemoteUri(_0x3bae4d[_0x000d('0x89')]);_0x5548da=getWebApiUrl(_0x583f64);var _0x25b227={'method':'POST','uri':'https://login.microsoftonline.com/'+_0x3bae4d['tenantId']+_0x000d('0x91'),'form':{'client_id':_0x3bae4d[_0x000d('0x8b')],'resource':_0x583f64,'username':_0x3bae4d['username'],'password':_0x3bae4d[_0x000d('0x92')],'grant_type':_0x000d('0x92'),'client_secret':_0x3bae4d[_0x000d('0x8c')]},'json':!![]};return rp(_0x25b227);}})[_0x000d('0xe')](function(_0x404a1b){_0x2414ec=_0x404a1b[_0x000d('0x8f')];var _0x580979={'method':_0x000d('0x93'),'uri':encodeURI(_0x5548da+_0x000d('0x94')+_0x35b886+'\x27'),'headers':{'Authorization':_0x000d('0x95')+_0x2414ec,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x580979);})[_0x000d('0xe')](function(_0x22c529){var _0x4a3c7d=_0x22c529[_0x000d('0x96')][0x0];var _0x539ee9=_0x4a3c7d[_0x000d('0x97')];var _0x2ce680={'method':'GET','uri':_0x5548da+_0x000d('0x98')+_0x539ee9+_0x000d('0x99'),'headers':{'Authorization':_0x000d('0x95')+_0x2414ec,'If-None-Match':null,'OData-Version':_0x000d('0x9a')},'json':!![]};return rp(_0x2ce680);})['then'](function(_0x5e6b28){_0x33c6e5=_0x5e6b28;_0x135e2e=_0x33c6e5[_0x000d('0x9b')];_0x135e2e=_[_0x000d('0x9c')](_0x135e2e,function(_0x1fe661){return!_0x312283[_0x000d('0x9d')](_0x1fe661[_0x000d('0x9e')]);});var _0x4ff887=[];var _0x36f54e=[];_0x135e2e[_0x000d('0x9f')](function(_0x55c220){if(_0x55c220['@odata.type']){var _0x3a4d07=_0x55c220[_0x000d('0xa0')][_0x000d('0x3f')](_0x55c220[_0x000d('0xa0')][_0x000d('0x40')]('.')+0x1);if(_0x3a4d07===_0x000d('0xa1')){_0x4ff887[_0x000d('0xa2')](getSelectList(_0x5548da,_0x2a3921,_0x36f54e,_0x33c6e5[_0x000d('0x97')],_0x55c220[_0x000d('0x97')],_0x2414ec));}}});return Promise[_0x000d('0xa3')](_0x4ff887);})[_0x000d('0xe')](function(_0x40cf09){_0x1d25bd=_0x40cf09[0x0];var _0x2c8cf8=[];var _0x5bdd14=[];_0x135e2e[_0x000d('0x9f')](function(_0x47455a){if(!_['isNil'](_0x47455a[_0x000d('0xa0')])){var _0xcd54c8=_0x47455a[_0x000d('0xa0')][_0x000d('0x3f')](_0x47455a['@odata.type'][_0x000d('0x40')]('.')+0x1);if(_0xcd54c8===_0x000d('0xa4')){_0x2c8cf8[_0x000d('0xa2')](getBooleanList(_0x5548da,_0x2a3921,_0x5bdd14,_0x33c6e5['MetadataId'],_0x47455a[_0x000d('0x97')],_0x2414ec));}}});return Promise['all'](_0x2c8cf8);})[_0x000d('0xe')](function(_0x3273d3){_0x59ffc2=_0x3273d3[0x0];var _0x41ad5b=[];var _0xab8d3b=[];_0x135e2e[_0x000d('0x9f')](function(_0x4e4854){if(_0x4e4854['@odata.type']){var _0x731476=_0x4e4854[_0x000d('0xa0')][_0x000d('0x3f')](_0x4e4854[_0x000d('0xa0')][_0x000d('0x40')]('.')+0x1);if(_0x731476===_0x000d('0xa5')||_0x731476==='DoubleAttributeMetadata'||_0x731476===_0x000d('0xa6')||_0x731476==='IntegerAttributeMetadata'||_0x731476===_0x000d('0xa7')||_0x731476===_0x000d('0xa8')||_0x731476===_0x000d('0xa9')||_0x731476==='EntityNameAttributeMetadata'||_0x731476===_0x000d('0xaa')||_0x731476==='DecimalAttributeMetadata'){_0x41ad5b[_0x000d('0xa2')](getInputList(_0x5548da,_0x2a3921,_0x731476,_0xab8d3b,_0x33c6e5[_0x000d('0x97')],_0x4e4854[_0x000d('0x97')],_0x2414ec));}}});return Promise[_0x000d('0xa3')](_0x41ad5b);})[_0x000d('0xe')](function(_0x3daaef){_0x643b36=_0x3daaef[0x0];var _0xdb2fb3=_0x1d25bd[_0x000d('0x87')](_0x59ffc2)[_0x000d('0x87')](_0x643b36);var _0x329455={'count':_0xdb2fb3['length'],'rows':_0xdb2fb3};return _0x329455;})[_0x000d('0xe')](respondWithResult(_0x3a0960,null))[_0x000d('0x30')](function(_0xaf0e91){var _0x3c6fc9=_0x33918d['query'][_0x000d('0xab')]?0x1f4:_0xaf0e91[_0x000d('0xac')]||0x1f4;logger[_0x000d('0x10')](_0xaf0e91[_0x000d('0x11')]);delete _0xaf0e91['name'];if(_0x3c6fc9===0x191){_0x3c6fc9=0x190;}_0x3a0960[_0x000d('0x5')](_0x3c6fc9)[_0x000d('0x13')](_0x33918d[_0x000d('0x1b')]['test']?{'message':_0x000d('0xad'),'statusCode':_0xaf0e91['statusCode']}:_0xaf0e91);});};function getSelectList(_0x381028,_0x1844f1,_0x8260c2,_0x7881d2,_0x3fa8d7,_0x5db68a){var _0x5b210e={'method':_0x000d('0x93'),'uri':_0x381028+_0x000d('0x98')+_0x7881d2+_0x000d('0xae')+_0x3fa8d7+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x000d('0xaf'),'headers':{'Authorization':_0x000d('0x95')+_0x5db68a,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x5b210e)['then'](function(_0x2dc352){var _0x4600c9=[];var _0x11d870=_0x2dc352[_0x000d('0xb0')]['Options'];_0x11d870[_0x000d('0x9f')](function(_0x4e1a08){_0x4600c9[_0x000d('0xa2')]({'name':_0x4e1a08['Label'][_0x000d('0xb1')][_0x000d('0xb2')],'value':String(_0x4e1a08[_0x000d('0xb3')])});});var _0x9c993d={'id':_0x1844f1+'_'+_0x2dc352['LogicalName'],'name':_0x2dc352[_0x000d('0xb4')][_0x000d('0xb1')][_0x000d('0xb2')],'custom':![],'options':_0x4600c9};_0x8260c2[_0x000d('0xa2')](_0x9c993d);return _0x8260c2;});}function getBooleanList(_0x33e32b,_0x3ec12b,_0x376ce0,_0x92acf9,_0x35dfaf,_0x2365ef){var _0x2a1a22={'method':_0x000d('0x93'),'uri':_0x33e32b+_0x000d('0x98')+_0x92acf9+_0x000d('0xae')+_0x35dfaf+_0x000d('0xb5'),'headers':{'Authorization':_0x000d('0x95')+_0x2365ef,'If-None-Match':null,'OData-Version':_0x000d('0x9a')},'json':!![]};return rp(_0x2a1a22)[_0x000d('0xe')](function(_0x2d8f54){var _0x58db2d=[];_0x58db2d[_0x000d('0xa2')]({'name':_0x2d8f54['OptionSet'][_0x000d('0xb6')][_0x000d('0xb2')][_0x000d('0xb1')][_0x000d('0xb2')],'value':_0x000d('0xb7')},{'name':_0x2d8f54['OptionSet'][_0x000d('0xb8')][_0x000d('0xb2')][_0x000d('0xb1')][_0x000d('0xb2')],'value':_0x000d('0xb9')});var _0xe73f26={'id':_0x3ec12b+'_'+_0x2d8f54['LogicalName'],'name':_0x2d8f54[_0x000d('0xb4')][_0x000d('0xb1')][_0x000d('0xb2')],'custom':![],'options':_0x58db2d};_0x376ce0[_0x000d('0xa2')](_0xe73f26);return _0x376ce0;});}function getInputList(_0x2c360f,_0x4d1ab3,_0x590f87,_0x1c3291,_0x13aaa1,_0x24f8d6,_0x969d2d){var _0x3d74d6={'method':_0x000d('0x93'),'uri':_0x2c360f+_0x000d('0x98')+_0x13aaa1+')/Attributes('+_0x24f8d6+_0x000d('0xba')+_0x590f87+_0x000d('0xbb'),'headers':{'Authorization':_0x000d('0x95')+_0x969d2d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3d74d6)[_0x000d('0xe')](function(_0x39d1c9){var _0x18a83f={'id':_0x4d1ab3+'_'+_0x39d1c9['LogicalName'],'name':_0x39d1c9[_0x000d('0xb4')][_0x000d('0xb1')]?_0x39d1c9['DisplayName'][_0x000d('0xb1')][_0x000d('0xb2')]:_0x39d1c9['LogicalName'],'custom':![],'options':[]};_0x1c3291[_0x000d('0xa2')](_0x18a83f);return _0x1c3291;});} \ No newline at end of file +var _0x5561=['GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','includes','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','push','MetadataId','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','concat','send','test','Wrong\x20credentials','statusCode','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','FalseOption',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','request-promise','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','json','offset','limit','count','set','Content-Range','update','then','destroy','status','end','sendStatus','error','name','index','map','Dynamics365Account','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','includeAll','options','find','create','body','getConfigurations','findOne','Dynamics365Configuration','hasOwnProperty','AccountId','Descriptions','getDescriptions','channel','Dynamics365Field','Subjects','lastIndexOf','%s/api/data/v9.0/','getFields','ticketType','incident','Incident','title','description','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyyominame','createdonbehalfbyname','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','resolvebykpiidname','responsiblecontactidyominame','slaname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','utcconversiontimezonecode','versionnumber','username','password','remoteUri','clientSecret','CloudProvider','data7','modernAuthentication','access_token','data5','POST','tenantId','/oauth2/token','clientId'];(function(_0x291d19,_0x3cd086){var _0x9afffe=function(_0x5b40d6){while(--_0x5b40d6){_0x291d19['push'](_0x291d19['shift']());}};_0x9afffe(++_0x3cd086);}(_0x5561,0xe0));var _0x1556=function(_0x42ee88,_0x321540){_0x42ee88=_0x42ee88-0x0;var _0x560514=_0x5561[_0x42ee88];return _0x560514;};'use strict';var rp=require(_0x1556('0x0'));var util=require(_0x1556('0x1'));var _=require(_0x1556('0x2'));var qs=require(_0x1556('0x3'));var logger=require(_0x1556('0x4'))(_0x1556('0x5'));var db=require(_0x1556('0x6'))['db'];var integrations=require(_0x1556('0x7'));function respondWithResult(_0x3b4088,_0x137534){_0x137534=_0x137534||0xc8;return function(_0xf97c23){if(_0xf97c23){return _0x3b4088['status'](_0x137534)[_0x1556('0x8')](_0xf97c23);}};}function respondWithFilteredResult(_0x81cb5b,_0xc6c4f3){return function(_0x2569fa){if(_0x2569fa){var _0x34668a=typeof _0xc6c4f3[_0x1556('0x9')]==='undefined'&&typeof _0xc6c4f3[_0x1556('0xa')]==='undefined';var _0x4e938f=_0x2569fa[_0x1556('0xb')];var _0x3ac4a3=_0x34668a?0x0:_0xc6c4f3[_0x1556('0x9')];var _0x33b3fb=_0x34668a?_0x2569fa['count']:_0xc6c4f3['offset']+_0xc6c4f3[_0x1556('0xa')];var _0x2000f;if(_0x33b3fb>=_0x4e938f){_0x33b3fb=_0x4e938f;_0x2000f=0xc8;}else{_0x2000f=0xce;}_0x81cb5b['status'](_0x2000f);return _0x81cb5b[_0x1556('0xc')](_0x1556('0xd'),_0x3ac4a3+'-'+_0x33b3fb+'/'+_0x4e938f)['json'](_0x2569fa);}return null;};}function saveUpdates(_0x4f6935){return function(_0x31c30b){if(_0x31c30b){return _0x31c30b[_0x1556('0xe')](_0x4f6935)[_0x1556('0xf')](function(_0x354035){return _0x354035;});}return null;};}function removeEntity(_0x50079e){return function(_0x157f46){if(_0x157f46){return _0x157f46[_0x1556('0x10')]()[_0x1556('0xf')](function(){_0x50079e[_0x1556('0x11')](0xcc)[_0x1556('0x12')]();});}};}function handleEntityNotFound(_0x4e7745){return function(_0x59e0e7){if(!_0x59e0e7){_0x4e7745[_0x1556('0x13')](0x194);}return _0x59e0e7;};}function handleError(_0x34d49e,_0x18e453){_0x18e453=_0x18e453||0x1f4;return function(_0x13746f){logger[_0x1556('0x14')](_0x13746f['stack']);if(_0x13746f[_0x1556('0x15')]){delete _0x13746f[_0x1556('0x15')];}_0x34d49e['status'](_0x18e453)['send'](_0x13746f);};}exports[_0x1556('0x16')]=function(_0x52869a,_0xa29b68){var _0x510f35={},_0x4e47fc={},_0x502a35={'count':0x0,'rows':[]};var _0x478521=_[_0x1556('0x17')](db[_0x1556('0x18')][_0x1556('0x19')],function(_0x29001b){return{'name':_0x29001b[_0x1556('0x1a')],'type':_0x29001b[_0x1556('0x1b')][_0x1556('0x1c')]};});_0x4e47fc[_0x1556('0x1d')]=_['map'](_0x478521,_0x1556('0x15'));_0x4e47fc[_0x1556('0x1e')]=_[_0x1556('0x1f')](_0x52869a[_0x1556('0x1e')]);_0x4e47fc[_0x1556('0x20')]=_[_0x1556('0x21')](_0x4e47fc[_0x1556('0x1d')],_0x4e47fc[_0x1556('0x1e')]);_0x510f35[_0x1556('0x22')]=_[_0x1556('0x21')](_0x4e47fc[_0x1556('0x1d')],qs[_0x1556('0x23')](_0x52869a[_0x1556('0x1e')][_0x1556('0x23')]));_0x510f35[_0x1556('0x22')]=_0x510f35['attributes'][_0x1556('0x24')]?_0x510f35[_0x1556('0x22')]:_0x4e47fc[_0x1556('0x1d')];if(!_0x52869a[_0x1556('0x1e')]['hasOwnProperty'](_0x1556('0x25'))){_0x510f35[_0x1556('0xa')]=qs[_0x1556('0xa')](_0x52869a[_0x1556('0x1e')][_0x1556('0xa')]);_0x510f35[_0x1556('0x9')]=qs[_0x1556('0x9')](_0x52869a['query'][_0x1556('0x9')]);}_0x510f35[_0x1556('0x26')]=qs[_0x1556('0x27')](_0x52869a[_0x1556('0x1e')][_0x1556('0x27')]);_0x510f35[_0x1556('0x28')]=qs[_0x1556('0x20')](_[_0x1556('0x29')](_0x52869a['query'],_0x4e47fc[_0x1556('0x20')]),_0x478521);if(_0x52869a[_0x1556('0x1e')][_0x1556('0x2a')]){_0x510f35['where']=_[_0x1556('0x2b')](_0x510f35['where'],{'$or':_[_0x1556('0x17')](_0x478521,function(_0x48489f){if(_0x48489f[_0x1556('0x1b')]!==_0x1556('0x2c')){var _0x93d9b3={};_0x93d9b3[_0x48489f[_0x1556('0x15')]]={'$like':'%'+_0x52869a['query'][_0x1556('0x2a')]+'%'};return _0x93d9b3;}})});}_0x510f35=_['merge']({},_0x510f35,_0x52869a['options']);var _0x3bef39={'where':_0x510f35['where']};return db[_0x1556('0x18')]['count'](_0x3bef39)[_0x1556('0xf')](function(_0x504f37){_0x502a35[_0x1556('0xb')]=_0x504f37;if(_0x52869a[_0x1556('0x1e')]['includeAll']){_0x510f35[_0x1556('0x2d')]=[{'all':!![]}];}return db[_0x1556('0x18')][_0x1556('0x2e')](_0x510f35);})[_0x1556('0xf')](function(_0x2bef4d){_0x502a35['rows']=_0x2bef4d;return _0x502a35;})[_0x1556('0xf')](respondWithFilteredResult(_0xa29b68,_0x510f35))[_0x1556('0x2f')](handleError(_0xa29b68,null));};exports[_0x1556('0x30')]=function(_0x501860,_0x35f319){var _0x3eb87e={'raw':![],'where':{'id':_0x501860[_0x1556('0x31')]['id']}},_0x40248b={};_0x40248b[_0x1556('0x1d')]=_['keys'](db['Dynamics365Account'][_0x1556('0x19')]);_0x40248b['query']=_[_0x1556('0x1f')](_0x501860[_0x1556('0x1e')]);_0x40248b[_0x1556('0x20')]=_['intersection'](_0x40248b[_0x1556('0x1d')],_0x40248b[_0x1556('0x1e')]);_0x3eb87e[_0x1556('0x22')]=_[_0x1556('0x21')](_0x40248b[_0x1556('0x1d')],qs['fields'](_0x501860[_0x1556('0x1e')][_0x1556('0x23')]));_0x3eb87e[_0x1556('0x22')]=_0x3eb87e['attributes'][_0x1556('0x24')]?_0x3eb87e['attributes']:_0x40248b[_0x1556('0x1d')];if(_0x501860[_0x1556('0x1e')][_0x1556('0x32')]){_0x3eb87e['include']=[{'all':!![]}];}_0x3eb87e=_[_0x1556('0x2b')]({},_0x3eb87e,_0x501860[_0x1556('0x33')]);return db[_0x1556('0x18')][_0x1556('0x34')](_0x3eb87e)[_0x1556('0xf')](handleEntityNotFound(_0x35f319,null))[_0x1556('0xf')](respondWithResult(_0x35f319,null))['catch'](handleError(_0x35f319,null));};exports[_0x1556('0x35')]=function(_0x248bdf,_0x1f93f6){return db[_0x1556('0x18')][_0x1556('0x35')](_0x248bdf[_0x1556('0x36')],{})[_0x1556('0xf')](respondWithResult(_0x1f93f6,0xc9))[_0x1556('0x2f')](handleError(_0x1f93f6,null));};exports[_0x1556('0xe')]=function(_0xec469a,_0x82e7c){if(_0xec469a[_0x1556('0x36')]['id']){delete _0xec469a[_0x1556('0x36')]['id'];}return db[_0x1556('0x18')][_0x1556('0x34')]({'where':{'id':_0xec469a[_0x1556('0x31')]['id']}})[_0x1556('0xf')](handleEntityNotFound(_0x82e7c,null))[_0x1556('0xf')](saveUpdates(_0xec469a[_0x1556('0x36')],null))['then'](respondWithResult(_0x82e7c,null))['catch'](handleError(_0x82e7c,null));};exports[_0x1556('0x10')]=function(_0x54d25f,_0x5c60d5){return db['Dynamics365Account']['find']({'where':{'id':_0x54d25f['params']['id']}})['then'](handleEntityNotFound(_0x5c60d5,null))[_0x1556('0xf')](removeEntity(_0x5c60d5,null))['catch'](handleError(_0x5c60d5,null));};exports[_0x1556('0x37')]=function(_0x370def,_0x43c2d9){var _0x42e9b1={};var _0x4626d4={};var _0x39e75a;var _0x3201f8;return db[_0x1556('0x18')][_0x1556('0x38')]({'where':{'id':_0x370def[_0x1556('0x31')]['id']}})[_0x1556('0xf')](handleEntityNotFound(_0x43c2d9,null))[_0x1556('0xf')](function(_0x5954c9){if(_0x5954c9){_0x39e75a=_0x5954c9;_0x4626d4['model']=_[_0x1556('0x1f')](db[_0x1556('0x39')][_0x1556('0x19')]);_0x4626d4[_0x1556('0x1e')]=_[_0x1556('0x1f')](_0x370def[_0x1556('0x1e')]);_0x4626d4['filters']=_[_0x1556('0x21')](_0x4626d4[_0x1556('0x1d')],_0x4626d4['query']);_0x42e9b1['attributes']=_[_0x1556('0x21')](_0x4626d4[_0x1556('0x1d')],qs[_0x1556('0x23')](_0x370def[_0x1556('0x1e')][_0x1556('0x23')]));_0x42e9b1[_0x1556('0x22')]=_0x42e9b1[_0x1556('0x22')][_0x1556('0x24')]?_0x42e9b1[_0x1556('0x22')]:_0x4626d4[_0x1556('0x1d')];_0x42e9b1[_0x1556('0x26')]=qs[_0x1556('0x27')](_0x370def[_0x1556('0x1e')][_0x1556('0x27')]);_0x42e9b1[_0x1556('0x28')]=qs[_0x1556('0x20')](_[_0x1556('0x29')](_0x370def[_0x1556('0x1e')],_0x4626d4[_0x1556('0x20')]));if(_0x370def[_0x1556('0x1e')]['filter']){_0x42e9b1['where']=_['merge'](_0x42e9b1['where'],{'$or':_['map'](_0x42e9b1[_0x1556('0x22')],function(_0x11f51d){var _0x37663b={};_0x37663b[_0x11f51d]={'$like':'%'+_0x370def[_0x1556('0x1e')]['filter']+'%'};return _0x37663b;})});}_0x42e9b1=_['merge']({},_0x42e9b1,_0x370def[_0x1556('0x33')]);return _0x39e75a[_0x1556('0x37')](_0x42e9b1);}})[_0x1556('0xf')](function(_0x59fd64){if(_0x59fd64){_0x3201f8=_0x59fd64['length'];if(!_0x370def['query'][_0x1556('0x3a')](_0x1556('0x25'))){_0x42e9b1[_0x1556('0xa')]=qs[_0x1556('0xa')](_0x370def['query'][_0x1556('0xa')]);_0x42e9b1[_0x1556('0x9')]=qs[_0x1556('0x9')](_0x370def[_0x1556('0x1e')]['offset']);}return _0x39e75a['getConfigurations'](_0x42e9b1);}})['then'](function(_0x40f090){if(_0x40f090){return _0x40f090?{'count':_0x3201f8,'rows':_0x40f090}:null;}})['then'](respondWithResult(_0x43c2d9,null))[_0x1556('0x2f')](handleError(_0x43c2d9,null));};exports['addConfiguration']=function(_0x1b9dcd,_0x42012b){if(_0x1b9dcd[_0x1556('0x36')]['id']){delete _0x1b9dcd[_0x1556('0x36')]['id'];}return db[_0x1556('0x18')][_0x1556('0x38')]({'where':{'id':_0x1b9dcd[_0x1556('0x31')]['id']}})['then'](handleEntityNotFound(_0x42012b,null))[_0x1556('0xf')](function(_0x5d4cbe){if(_0x5d4cbe){_0x1b9dcd[_0x1556('0x36')][_0x1556('0x3b')]=_0x5d4cbe['id'];_0x1b9dcd[_0x1556('0x36')]['Subjects']=integrations['getSubjects'](_0x1b9dcd[_0x1556('0x36')]['channel'],_0x1b9dcd[_0x1556('0x36')][_0x1556('0x1b')]);_0x1b9dcd[_0x1556('0x36')][_0x1556('0x3c')]=integrations[_0x1556('0x3d')](_0x1b9dcd[_0x1556('0x36')][_0x1556('0x3e')],_0x1b9dcd[_0x1556('0x36')]['type']);return db[_0x1556('0x39')][_0x1556('0x35')](_0x1b9dcd['body'],{'include':[{'model':db[_0x1556('0x3f')],'as':_0x1556('0x40')},{'model':db[_0x1556('0x3f')],'as':_0x1556('0x3c')}]});}return null;})['then'](respondWithResult(_0x42012b,null))[_0x1556('0x2f')](handleError(_0x42012b,null));};function sanitizeRemoteUri(_0x22b6ec){var _0x419a98=_0x22b6ec['slice'](-0x1);if(_0x419a98==='/')return _0x22b6ec['substring'](0x0,_0x22b6ec[_0x1556('0x41')](_0x419a98));return _0x22b6ec;}function getWebApiUrl(_0x553631){return util['format'](_0x1556('0x42'),_0x553631);}exports[_0x1556('0x43')]=function(_0x110f6c,_0x35139d){var _0x3dbd84=_0x110f6c[_0x1556('0x1e')][_0x1556('0x44')];var _0x1c8013=_0x3dbd84===_0x1556('0x45')?_0x1556('0x46'):'PhoneCall';var _0x24cdc5='';var _0x2c90ea='';var _0x514787='';var _0x310910='';var _0x137418='';var _0x24c515='';var _0x322337='';var _0x1f8538='';var _0xd35397=[_0x1556('0x47'),_0x1556('0x48'),'customerid','ownerid',_0x1556('0x49'),_0x1556('0x4a'),_0x1556('0x4b'),_0x1556('0x4c'),_0x1556('0x4d'),_0x1556('0x4e')];var _0x48be73=[_0x1556('0x4f'),'accountidyominame',_0x1556('0x50'),_0x1556('0x51'),_0x1556('0x52'),_0x1556('0x53'),_0x1556('0x54'),_0x1556('0x55'),_0x1556('0x56'),'createdbyexternalpartyyominame','createdbyname',_0x1556('0x57'),'createdon',_0x1556('0x58'),'createdonbehalfbyyominame',_0x1556('0x59'),_0x1556('0x5a'),_0x1556('0x5b'),_0x1556('0x5c'),_0x1556('0x5d'),_0x1556('0x5e'),_0x1556('0x5f'),_0x1556('0x60'),_0x1556('0x61'),_0x1556('0x62'),'followupby',_0x1556('0x63'),_0x1556('0x64'),_0x1556('0x65'),_0x1556('0x66'),'masteridname','modifiedbyexternalpartyname',_0x1556('0x67'),_0x1556('0x68'),_0x1556('0x69'),_0x1556('0x6a'),_0x1556('0x6b'),_0x1556('0x6c'),'msdyn_incidenttypename',_0x1556('0x6d'),_0x1556('0x6e'),_0x1556('0x6f'),'overriddencreatedon',_0x1556('0x70'),_0x1556('0x71'),_0x1556('0x72'),_0x1556('0x73'),_0x1556('0x74'),'primarycontactidyominame',_0x1556('0x75'),'productidname','productserialnumber','resolveby',_0x1556('0x76'),'responseby','responsiblecontactidname',_0x1556('0x77'),'sentimentvalue','slainvokedidname',_0x1556('0x78'),'socialprofileidname',_0x1556('0x79'),_0x1556('0x7a'),'subjectidname',_0x1556('0x7b'),_0x1556('0x7c'),'transactioncurrencyidname','traversedpath',_0x1556('0x7d'),_0x1556('0x7e')];var _0x504abc=_0xd35397['concat'](_0x48be73);return db[_0x1556('0x18')]['findOne']({'where':{'id':_0x110f6c[_0x1556('0x31')]['id']},'attributes':['id',_0x1556('0x7f'),_0x1556('0x80'),_0x1556('0x81'),'tenantId','clientId',_0x1556('0x82'),'modernAuthentication'],'include':[{'model':db[_0x1556('0x83')],'as':'CloudProvider','attributes':['id','data5',_0x1556('0x84')]}]})[_0x1556('0xf')](handleEntityNotFound(_0x35139d,null))[_0x1556('0xf')](function(_0x170130){if(_0x170130){if(_0x170130[_0x1556('0x85')]){_0x170130[_0x1556('0x86')]=_0x170130[_0x1556('0x83')][_0x1556('0x87')];_0x1f8538=sanitizeRemoteUri(_0x170130['CloudProvider'][_0x1556('0x84')]);_0x322337=getWebApiUrl(_0x1f8538);return _0x170130;}_0x1f8538=sanitizeRemoteUri(_0x170130[_0x1556('0x81')]);_0x322337=getWebApiUrl(_0x1f8538);var _0x15407e={'method':_0x1556('0x88'),'uri':'https://login.microsoftonline.com/'+_0x170130[_0x1556('0x89')]+_0x1556('0x8a'),'form':{'client_id':_0x170130[_0x1556('0x8b')],'resource':_0x1f8538,'username':_0x170130['username'],'password':_0x170130[_0x1556('0x80')],'grant_type':_0x1556('0x80'),'client_secret':_0x170130['clientSecret']},'json':!![]};return rp(_0x15407e);}})[_0x1556('0xf')](function(_0x126ada){_0x24c515=_0x126ada[_0x1556('0x86')];var _0x3cd7b5={'method':_0x1556('0x8c'),'uri':encodeURI(_0x322337+_0x1556('0x8d')+_0x1c8013+'\x27'),'headers':{'Authorization':_0x1556('0x8e')+_0x24c515,'If-None-Match':null,'OData-Version':_0x1556('0x8f')},'json':!![]};return rp(_0x3cd7b5);})['then'](function(_0x517e8e){var _0x29553e=_0x517e8e[_0x1556('0x90')][0x0];var _0x34b9e7=_0x29553e['MetadataId'];var _0x5f36b4={'method':'GET','uri':_0x322337+'EntityDefinitions('+_0x34b9e7+_0x1556('0x91'),'headers':{'Authorization':_0x1556('0x8e')+_0x24c515,'If-None-Match':null,'OData-Version':_0x1556('0x8f')},'json':!![]};return rp(_0x5f36b4);})['then'](function(_0x45ebeb){_0x24cdc5=_0x45ebeb;_0x2c90ea=_0x24cdc5['Attributes'];_0x2c90ea=_['remove'](_0x2c90ea,function(_0x24a459){return!_0x504abc[_0x1556('0x92')](_0x24a459[_0x1556('0x93')]);});var _0x398bcb=[];var _0x9920f5=[];_0x2c90ea[_0x1556('0x94')](function(_0x1ae7a2){if(_0x1ae7a2[_0x1556('0x95')]){var _0x593f03=_0x1ae7a2[_0x1556('0x95')][_0x1556('0x96')](_0x1ae7a2[_0x1556('0x95')]['lastIndexOf']('.')+0x1);if(_0x593f03===_0x1556('0x97')){_0x398bcb[_0x1556('0x98')](getSelectList(_0x322337,_0x3dbd84,_0x9920f5,_0x24cdc5[_0x1556('0x99')],_0x1ae7a2['MetadataId'],_0x24c515));}}});return Promise[_0x1556('0x9a')](_0x398bcb);})[_0x1556('0xf')](function(_0xa1000d){_0x514787=_0xa1000d[0x0];var _0x3799ab=[];var _0x2bc0a2=[];_0x2c90ea[_0x1556('0x94')](function(_0xd4b02f){if(!_[_0x1556('0x9b')](_0xd4b02f['@odata.type'])){var _0x5f2314=_0xd4b02f[_0x1556('0x95')][_0x1556('0x96')](_0xd4b02f['@odata.type'][_0x1556('0x41')]('.')+0x1);if(_0x5f2314==='BooleanAttributeMetadata'){_0x3799ab['push'](getBooleanList(_0x322337,_0x3dbd84,_0x2bc0a2,_0x24cdc5[_0x1556('0x99')],_0xd4b02f[_0x1556('0x99')],_0x24c515));}}});return Promise['all'](_0x3799ab);})[_0x1556('0xf')](function(_0x554484){_0x310910=_0x554484[0x0];var _0x5ca86a=[];var _0x3b5cdd=[];_0x2c90ea[_0x1556('0x94')](function(_0x4bccd7){if(_0x4bccd7[_0x1556('0x95')]){var _0x44fac5=_0x4bccd7['@odata.type']['substring'](_0x4bccd7[_0x1556('0x95')]['lastIndexOf']('.')+0x1);if(_0x44fac5===_0x1556('0x9c')||_0x44fac5===_0x1556('0x9d')||_0x44fac5==='BigIntAttributeMetadata'||_0x44fac5===_0x1556('0x9e')||_0x44fac5===_0x1556('0x9f')||_0x44fac5==='DateTimeAttributeMetadata'||_0x44fac5===_0x1556('0xa0')||_0x44fac5===_0x1556('0xa1')||_0x44fac5==='StateAttributeMetadata'||_0x44fac5===_0x1556('0xa2')){_0x5ca86a[_0x1556('0x98')](getInputList(_0x322337,_0x3dbd84,_0x44fac5,_0x3b5cdd,_0x24cdc5[_0x1556('0x99')],_0x4bccd7['MetadataId'],_0x24c515));}}});return Promise[_0x1556('0x9a')](_0x5ca86a);})[_0x1556('0xf')](function(_0x139386){_0x137418=_0x139386[0x0];var _0x4ddaca=_0x514787[_0x1556('0xa3')](_0x310910)['concat'](_0x137418);var _0x255b30={'count':_0x4ddaca[_0x1556('0x24')],'rows':_0x4ddaca};return _0x255b30;})[_0x1556('0xf')](respondWithResult(_0x35139d,null))[_0x1556('0x2f')](function(_0xcef32c){var _0x3a152e=_0x110f6c[_0x1556('0x1e')]['test']?0x1f4:_0xcef32c['statusCode']||0x1f4;logger[_0x1556('0x14')](_0xcef32c['stack']);delete _0xcef32c[_0x1556('0x15')];if(_0x3a152e===0x191){_0x3a152e=0x190;}_0x35139d['status'](_0x3a152e)[_0x1556('0xa4')](_0x110f6c[_0x1556('0x1e')][_0x1556('0xa5')]?{'message':_0x1556('0xa6'),'statusCode':_0xcef32c[_0x1556('0xa7')]}:_0xcef32c);});};function getSelectList(_0x52f111,_0x492c75,_0x269d22,_0x21af51,_0x4a774f,_0xc383f2){var _0x1890eb={'method':_0x1556('0x8c'),'uri':_0x52f111+_0x1556('0xa8')+_0x21af51+_0x1556('0xa9')+_0x4a774f+_0x1556('0xaa')+_0x1556('0xab'),'headers':{'Authorization':'Bearer\x20'+_0xc383f2,'If-None-Match':null,'OData-Version':_0x1556('0x8f')},'json':!![]};return rp(_0x1890eb)[_0x1556('0xf')](function(_0x4bf954){var _0x2cbfd0=[];var _0x2955c7=_0x4bf954[_0x1556('0xac')][_0x1556('0xad')];_0x2955c7['forEach'](function(_0x42b28b){_0x2cbfd0[_0x1556('0x98')]({'name':_0x42b28b[_0x1556('0xae')][_0x1556('0xaf')][_0x1556('0xae')],'value':String(_0x42b28b['Value'])});});var _0x5b2d6e={'id':_0x492c75+'_'+_0x4bf954[_0x1556('0x93')],'name':_0x4bf954[_0x1556('0xb0')][_0x1556('0xaf')][_0x1556('0xae')],'custom':![],'options':_0x2cbfd0};_0x269d22[_0x1556('0x98')](_0x5b2d6e);return _0x269d22;});}function getBooleanList(_0x37693f,_0x1a6750,_0x14f42e,_0x5a7f84,_0x578193,_0x4a6d47){var _0x5a7b51={'method':_0x1556('0x8c'),'uri':_0x37693f+_0x1556('0xa8')+_0x5a7f84+')/Attributes('+_0x578193+_0x1556('0xb1'),'headers':{'Authorization':_0x1556('0x8e')+_0x4a6d47,'If-None-Match':null,'OData-Version':_0x1556('0x8f')},'json':!![]};return rp(_0x5a7b51)[_0x1556('0xf')](function(_0x41e672){var _0x1ce1ef=[];_0x1ce1ef[_0x1556('0x98')]({'name':_0x41e672[_0x1556('0xac')][_0x1556('0xb2')][_0x1556('0xae')][_0x1556('0xaf')]['Label'],'value':'true'},{'name':_0x41e672[_0x1556('0xac')][_0x1556('0xb3')][_0x1556('0xae')][_0x1556('0xaf')][_0x1556('0xae')],'value':'false'});var _0x2c5d4b={'id':_0x1a6750+'_'+_0x41e672[_0x1556('0x93')],'name':_0x41e672[_0x1556('0xb0')][_0x1556('0xaf')][_0x1556('0xae')],'custom':![],'options':_0x1ce1ef};_0x14f42e[_0x1556('0x98')](_0x2c5d4b);return _0x14f42e;});}function getInputList(_0x393c2e,_0x59ae4c,_0x31743f,_0xc979bc,_0x5c3fa3,_0x46f602,_0x124c5d){var _0x2ac857={'method':_0x1556('0x8c'),'uri':_0x393c2e+'EntityDefinitions('+_0x5c3fa3+')/Attributes('+_0x46f602+_0x1556('0xb4')+_0x31743f+_0x1556('0xb5'),'headers':{'Authorization':_0x1556('0x8e')+_0x124c5d,'If-None-Match':null,'OData-Version':_0x1556('0x8f')},'json':!![]};return rp(_0x2ac857)[_0x1556('0xf')](function(_0x23a5d9){var _0x463295={'id':_0x59ae4c+'_'+_0x23a5d9['LogicalName'],'name':_0x23a5d9[_0x1556('0xb0')]['UserLocalizedLabel']?_0x23a5d9[_0x1556('0xb0')]['UserLocalizedLabel'][_0x1556('0xae')]:_0x23a5d9['LogicalName'],'custom':![],'options':[]};_0xc979bc[_0x1556('0x98')](_0x463295);return _0xc979bc;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 06c207c..796d851 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 _0xb7e7=['int_dynamics365_accounts','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','define'];(function(_0x57143c,_0x576da8){var _0x4d4410=function(_0x332ddd){while(--_0x332ddd){_0x57143c['push'](_0x57143c['shift']());}};_0x4d4410(++_0x576da8);}(_0xb7e7,0x121));var _0x7b7e=function(_0x369151,_0x179f72){_0x369151=_0x369151-0x0;var _0x4292d5=_0xb7e7[_0x369151];return _0x4292d5;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x333fa4,_0x372bde){return _0x333fa4[_0x7b7e('0x7')]('Dynamics365Account',attributes,{'tableName':_0x7b7e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['define','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration'];(function(_0xcc5977,_0x3fa6b){var _0x57c61d=function(_0x5a5185){while(--_0x5a5185){_0xcc5977['push'](_0xcc5977['shift']());}};_0x57c61d(++_0x3fa6b);}(_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'));var integrations=require(_0x0a9e('0x8'));module['exports']=function(_0x219af0,_0x441e3a){return _0x219af0[_0x0a9e('0x9')]('Dynamics365Account',attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 306bc0b..86dcb98 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 _0xbddc=['message','catch','GetDynamics365Account','Dynamics365Account','options','where','attributes','limit','include','map','model','ShowDynamics365Account','find','raw','debug','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4a5ed5,_0x80fce9){var _0x2410de=function(_0x520865){while(--_0x520865){_0x4a5ed5['push'](_0x4a5ed5['shift']());}};_0x2410de(++_0x80fce9);}(_0xbddc,0xfd));var _0xcbdd=function(_0xde81cc,_0x26c733){_0xde81cc=_0xde81cc-0x0;var _0x53a3fc=_0xbddc[_0xde81cc];return _0x53a3fc;};'use strict';var _=require(_0xcbdd('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcbdd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcbdd('0x2'));var db=require(_0xcbdd('0x3'))['db'];var utils=require(_0xcbdd('0x4'));var logger=require(_0xcbdd('0x5'))(_0xcbdd('0x6'));var config=require(_0xcbdd('0x7'));var jayson=require(_0xcbdd('0x8'));var client=jayson[_0xcbdd('0x9')][_0xcbdd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f1dd9,_0x32c764,_0x7b69ad){return new BPromise(function(_0x43c1d6,_0x1560be){return client[_0xcbdd('0xb')](_0x2f1dd9,_0x7b69ad)[_0xcbdd('0xc')](function(_0x55636c){logger[_0xcbdd('0xd')](_0xcbdd('0xe'),_0x32c764,_0xcbdd('0xf'));logger['debug'](_0xcbdd('0x10'),_0x32c764,_0xcbdd('0xf'),JSON[_0xcbdd('0x11')](_0x55636c));if(_0x55636c[_0xcbdd('0x12')]){if(_0x55636c['error']['code']===0x1f4){logger[_0xcbdd('0x12')]('Dynamics365Account,\x20%s,\x20%s',_0x32c764,_0x55636c[_0xcbdd('0x12')][_0xcbdd('0x13')]);return _0x1560be(_0x55636c['error'][_0xcbdd('0x13')]);}logger[_0xcbdd('0x12')](_0xcbdd('0xe'),_0x32c764,_0x55636c[_0xcbdd('0x12')][_0xcbdd('0x13')]);return _0x43c1d6(_0x55636c['error']['message']);}else{logger[_0xcbdd('0xd')](_0xcbdd('0xe'),_0x32c764,_0xcbdd('0xf'));_0x43c1d6(_0x55636c['result'][_0xcbdd('0x13')]);}})[_0xcbdd('0x14')](function(_0x31d976){logger[_0xcbdd('0x12')](_0xcbdd('0xe'),_0x32c764,_0x31d976);_0x1560be(_0x31d976);});});}exports[_0xcbdd('0x15')]=function(_0x5169c7){var _0x335fc9=this;return new Promise(function(_0x4de712,_0x16ac2e){return db[_0xcbdd('0x16')]['findAll']({'raw':_0x5169c7['options']?_0x5169c7[_0xcbdd('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5169c7[_0xcbdd('0x17')]?_0x5169c7['options'][_0xcbdd('0x18')]||null:null,'attributes':_0x5169c7['options']?_0x5169c7[_0xcbdd('0x17')][_0xcbdd('0x19')]||null:null,'limit':_0x5169c7[_0xcbdd('0x17')]?_0x5169c7['options'][_0xcbdd('0x1a')]||null:null,'include':_0x5169c7['options']?_0x5169c7[_0xcbdd('0x17')][_0xcbdd('0x1b')]?_[_0xcbdd('0x1c')](_0x5169c7[_0xcbdd('0x17')][_0xcbdd('0x1b')],function(_0x4b658e){return{'model':db[_0x4b658e[_0xcbdd('0x1d')]],'as':_0x4b658e['as'],'attributes':_0x4b658e[_0xcbdd('0x19')],'include':_0x4b658e['include']?_[_0xcbdd('0x1c')](_0x4b658e[_0xcbdd('0x1b')],function(_0x5e3d59){return{'model':db[_0x5e3d59['model']],'as':_0x5e3d59['as'],'attributes':_0x5e3d59[_0xcbdd('0x19')],'include':_0x5e3d59[_0xcbdd('0x1b')]?_[_0xcbdd('0x1c')](_0x5e3d59[_0xcbdd('0x1b')],function(_0x8547e4){return{'model':db[_0x8547e4[_0xcbdd('0x1d')]],'as':_0x8547e4['as'],'attributes':_0x8547e4[_0xcbdd('0x19')]};}):[]};}):[]};}):[]:[]})[_0xcbdd('0xc')](function(_0xab2eed){logger[_0xcbdd('0xd')]('GetDynamics365Account',_0x5169c7);logger['debug'](_0xcbdd('0x15'),_0x5169c7,JSON['stringify'](_0xab2eed));_0x4de712(_0xab2eed);})[_0xcbdd('0x14')](function(_0x493757){logger[_0xcbdd('0x12')](_0xcbdd('0x15'),_0x493757[_0xcbdd('0x13')],_0x5169c7);_0x16ac2e(_0x335fc9[_0xcbdd('0x12')](0x1f4,_0x493757[_0xcbdd('0x13')]));});});};exports[_0xcbdd('0x1e')]=function(_0x361f3b){var _0x25335e=this;return new Promise(function(_0x5bf494,_0x57c15d){return db[_0xcbdd('0x16')][_0xcbdd('0x1f')]({'raw':_0x361f3b[_0xcbdd('0x17')]?_0x361f3b[_0xcbdd('0x17')][_0xcbdd('0x20')]===undefined?!![]:![]:!![],'where':_0x361f3b[_0xcbdd('0x17')]?_0x361f3b[_0xcbdd('0x17')][_0xcbdd('0x18')]||null:null,'attributes':_0x361f3b[_0xcbdd('0x17')]?_0x361f3b[_0xcbdd('0x17')][_0xcbdd('0x19')]||null:null,'include':_0x361f3b[_0xcbdd('0x17')]?_0x361f3b[_0xcbdd('0x17')][_0xcbdd('0x1b')]?_[_0xcbdd('0x1c')](_0x361f3b['options'][_0xcbdd('0x1b')],function(_0x47dcab){return{'model':db[_0x47dcab['model']],'as':_0x47dcab['as'],'attributes':_0x47dcab[_0xcbdd('0x19')],'include':_0x47dcab[_0xcbdd('0x1b')]?_[_0xcbdd('0x1c')](_0x47dcab['include'],function(_0x949f33){return{'model':db[_0x949f33[_0xcbdd('0x1d')]],'as':_0x949f33['as'],'attributes':_0x949f33[_0xcbdd('0x19')],'include':_0x949f33[_0xcbdd('0x1b')]?_[_0xcbdd('0x1c')](_0x949f33['include'],function(_0x18a99e){return{'model':db[_0x18a99e['model']],'as':_0x18a99e['as'],'attributes':_0x18a99e[_0xcbdd('0x19')]};}):[]};}):[]};}):[]:[]})[_0xcbdd('0xc')](function(_0x3c5a16){logger['info'](_0xcbdd('0x1e'),_0x361f3b);logger[_0xcbdd('0x21')](_0xcbdd('0x1e'),_0x361f3b,JSON[_0xcbdd('0x11')](_0x3c5a16));_0x5bf494(_0x3c5a16);})['catch'](function(_0xa1d4b1){logger[_0xcbdd('0x12')]('ShowDynamics365Account',_0xa1d4b1[_0xcbdd('0x13')],_0x361f3b);_0x57c15d(_0x25335e[_0xcbdd('0x12')](0x1f4,_0xa1d4b1['message']));});});}; \ No newline at end of file +var _0xfc0e=['lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','catch','find','then','ShowDynamics365Account','debug'];(function(_0x50b852,_0x3526c9){var _0x187c65=function(_0x251ed0){while(--_0x251ed0){_0x50b852['push'](_0x50b852['shift']());}};_0x187c65(++_0x3526c9);}(_0xfc0e,0x1d4));var _0xefc0=function(_0x1af05b,_0x5134b5){_0x1af05b=_0x1af05b-0x0;var _0x5be7cc=_0xfc0e[_0x1af05b];return _0x5be7cc;};'use strict';var _=require(_0xefc0('0x0'));var util=require(_0xefc0('0x1'));var moment=require('moment');var BPromise=require(_0xefc0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xefc0('0x3'));var db=require(_0xefc0('0x4'))['db'];var utils=require(_0xefc0('0x5'));var logger=require(_0xefc0('0x6'))(_0xefc0('0x7'));var config=require(_0xefc0('0x8'));var jayson=require(_0xefc0('0x9'));var client=jayson[_0xefc0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1eb62f,_0x3e094c,_0x2a93bf){return new BPromise(function(_0x147b7b,_0x55490a){return client['request'](_0x1eb62f,_0x2a93bf)['then'](function(_0x1e2bac){logger[_0xefc0('0xb')](_0xefc0('0xc'),_0x3e094c,_0xefc0('0xd'));logger['debug'](_0xefc0('0xe'),_0x3e094c,_0xefc0('0xd'),JSON[_0xefc0('0xf')](_0x1e2bac));if(_0x1e2bac[_0xefc0('0x10')]){if(_0x1e2bac[_0xefc0('0x10')][_0xefc0('0x11')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x3e094c,_0x1e2bac['error']['message']);return _0x55490a(_0x1e2bac[_0xefc0('0x10')][_0xefc0('0x12')]);}logger[_0xefc0('0x10')](_0xefc0('0xc'),_0x3e094c,_0x1e2bac[_0xefc0('0x10')][_0xefc0('0x12')]);return _0x147b7b(_0x1e2bac['error']['message']);}else{logger[_0xefc0('0xb')](_0xefc0('0xc'),_0x3e094c,_0xefc0('0xd'));_0x147b7b(_0x1e2bac[_0xefc0('0x13')][_0xefc0('0x12')]);}})['catch'](function(_0x400284){logger['error'](_0xefc0('0xc'),_0x3e094c,_0x400284);_0x55490a(_0x400284);});});}exports[_0xefc0('0x14')]=function(_0x2f9407){var _0x1fb069=this;return new Promise(function(_0x53d8de,_0xbbe648){return db[_0xefc0('0x15')][_0xefc0('0x16')]({'raw':_0x2f9407[_0xefc0('0x17')]?_0x2f9407[_0xefc0('0x17')][_0xefc0('0x18')]===undefined?!![]:![]:!![],'where':_0x2f9407['options']?_0x2f9407[_0xefc0('0x17')][_0xefc0('0x19')]||null:null,'attributes':_0x2f9407['options']?_0x2f9407[_0xefc0('0x17')][_0xefc0('0x1a')]||null:null,'limit':_0x2f9407[_0xefc0('0x17')]?_0x2f9407[_0xefc0('0x17')][_0xefc0('0x1b')]||null:null,'include':_0x2f9407[_0xefc0('0x17')]?_0x2f9407[_0xefc0('0x17')][_0xefc0('0x1c')]?_[_0xefc0('0x1d')](_0x2f9407[_0xefc0('0x17')]['include'],function(_0x4da9c3){return{'model':db[_0x4da9c3[_0xefc0('0x1e')]],'as':_0x4da9c3['as'],'attributes':_0x4da9c3[_0xefc0('0x1a')],'include':_0x4da9c3[_0xefc0('0x1c')]?_[_0xefc0('0x1d')](_0x4da9c3['include'],function(_0x40407f){return{'model':db[_0x40407f[_0xefc0('0x1e')]],'as':_0x40407f['as'],'attributes':_0x40407f[_0xefc0('0x1a')],'include':_0x40407f[_0xefc0('0x1c')]?_[_0xefc0('0x1d')](_0x40407f[_0xefc0('0x1c')],function(_0x37d47d){return{'model':db[_0x37d47d['model']],'as':_0x37d47d['as'],'attributes':_0x37d47d[_0xefc0('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x6605e2){logger['info'](_0xefc0('0x14'),_0x2f9407);logger['debug'](_0xefc0('0x14'),_0x2f9407,JSON[_0xefc0('0xf')](_0x6605e2));_0x53d8de(_0x6605e2);})[_0xefc0('0x1f')](function(_0x29ebf8){logger[_0xefc0('0x10')](_0xefc0('0x14'),_0x29ebf8['message'],_0x2f9407);_0xbbe648(_0x1fb069[_0xefc0('0x10')](0x1f4,_0x29ebf8[_0xefc0('0x12')]));});});};exports['ShowDynamics365Account']=function(_0x19f402){var _0x52bacd=this;return new Promise(function(_0x283f4d,_0x4e08f6){return db[_0xefc0('0x15')][_0xefc0('0x20')]({'raw':_0x19f402[_0xefc0('0x17')]?_0x19f402['options']['raw']===undefined?!![]:![]:!![],'where':_0x19f402[_0xefc0('0x17')]?_0x19f402['options']['where']||null:null,'attributes':_0x19f402[_0xefc0('0x17')]?_0x19f402[_0xefc0('0x17')]['attributes']||null:null,'include':_0x19f402[_0xefc0('0x17')]?_0x19f402['options'][_0xefc0('0x1c')]?_[_0xefc0('0x1d')](_0x19f402['options'][_0xefc0('0x1c')],function(_0xd01a5){return{'model':db[_0xd01a5[_0xefc0('0x1e')]],'as':_0xd01a5['as'],'attributes':_0xd01a5['attributes'],'include':_0xd01a5[_0xefc0('0x1c')]?_[_0xefc0('0x1d')](_0xd01a5[_0xefc0('0x1c')],function(_0x5bb012){return{'model':db[_0x5bb012[_0xefc0('0x1e')]],'as':_0x5bb012['as'],'attributes':_0x5bb012[_0xefc0('0x1a')],'include':_0x5bb012['include']?_[_0xefc0('0x1d')](_0x5bb012['include'],function(_0x2021de){return{'model':db[_0x2021de[_0xefc0('0x1e')]],'as':_0x2021de['as'],'attributes':_0x2021de[_0xefc0('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xefc0('0x21')](function(_0x3207a2){logger[_0xefc0('0xb')](_0xefc0('0x22'),_0x19f402);logger[_0xefc0('0x23')](_0xefc0('0x22'),_0x19f402,JSON[_0xefc0('0xf')](_0x3207a2));_0x283f4d(_0x3207a2);})[_0xefc0('0x1f')](function(_0x3e84fc){logger[_0xefc0('0x10')](_0xefc0('0x22'),_0x3e84fc['message'],_0x19f402);_0x4e08f6(_0x52bacd[_0xefc0('0x10')](0x1f4,_0x3e84fc['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 0ab02ce..e66a81e 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 _0x2143=['create','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','post'];(function(_0xe544e9,_0x101cb6){var _0x567259=function(_0x50705d){while(--_0x50705d){_0xe544e9['push'](_0xe544e9['shift']());}};_0x567259(++_0x101cb6);}(_0x2143,0x114));var _0x3214=function(_0x5cfb92,_0x5797e6){_0x5cfb92=_0x5cfb92-0x0;var _0x1cd7c2=_0x2143[_0x5cfb92];return _0x1cd7c2;};'use strict';var multer=require(_0x3214('0x0'));var util=require(_0x3214('0x1'));var path=require(_0x3214('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3214('0x3')]();var fs_extra=require(_0x3214('0x4'));var auth=require(_0x3214('0x5'));var interaction=require(_0x3214('0x6'));var config=require(_0x3214('0x7'));var controller=require(_0x3214('0x8'));router[_0x3214('0x9')]('/',auth[_0x3214('0xa')](),controller[_0x3214('0xb')]);router[_0x3214('0x9')](_0x3214('0xc'),auth[_0x3214('0xa')](),controller[_0x3214('0xd')]);router[_0x3214('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0x3214('0xe')]);router[_0x3214('0x9')](_0x3214('0xf'),auth[_0x3214('0xa')](),controller[_0x3214('0x10')]);router[_0x3214('0x9')]('/:id/descriptions',auth[_0x3214('0xa')](),controller['getDescriptions']);router[_0x3214('0x11')]('/',auth[_0x3214('0xa')](),controller[_0x3214('0x12')]);router['put'](_0x3214('0xc'),auth[_0x3214('0xa')](),controller['update']);router['delete'](_0x3214('0xc'),auth['isAuthenticated'](),controller[_0x3214('0x13')]);module[_0x3214('0x14')]=router; \ No newline at end of file +var _0xc5b3=['isAuthenticated','get','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Configuration.controller'];(function(_0x37646d,_0x4351b5){var _0x19eb17=function(_0x175882){while(--_0x175882){_0x37646d['push'](_0x37646d['shift']());}};_0x19eb17(++_0x4351b5);}(_0xc5b3,0x1ee));var _0x3c5b=function(_0x2e4cbf,_0x8763d3){_0x2e4cbf=_0x2e4cbf-0x0;var _0x52840f=_0xc5b3[_0x2e4cbf];return _0x52840f;};'use strict';var multer=require(_0x3c5b('0x0'));var util=require(_0x3c5b('0x1'));var path=require(_0x3c5b('0x2'));var timeout=require(_0x3c5b('0x3'));var express=require(_0x3c5b('0x4'));var router=express[_0x3c5b('0x5')]();var fs_extra=require(_0x3c5b('0x6'));var auth=require(_0x3c5b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3c5b('0x8'));var controller=require(_0x3c5b('0x9'));router['get']('/',auth[_0x3c5b('0xa')](),controller['index']);router[_0x3c5b('0xb')](_0x3c5b('0xc'),auth[_0x3c5b('0xa')](),controller[_0x3c5b('0xd')]);router[_0x3c5b('0xb')](_0x3c5b('0xe'),auth[_0x3c5b('0xa')](),controller['getFields']);router[_0x3c5b('0xb')](_0x3c5b('0xf'),auth[_0x3c5b('0xa')](),controller[_0x3c5b('0x10')]);router[_0x3c5b('0xb')]('/:id/descriptions',auth[_0x3c5b('0xa')](),controller[_0x3c5b('0x11')]);router[_0x3c5b('0x12')]('/',auth[_0x3c5b('0xa')](),controller[_0x3c5b('0x13')]);router[_0x3c5b('0x14')](_0x3c5b('0xc'),auth['isAuthenticated'](),controller[_0x3c5b('0x15')]);router[_0x3c5b('0x16')](_0x3c5b('0xc'),auth[_0x3c5b('0xa')](),controller['destroy']);module[_0x3c5b('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 6eb320e..9e2ba07 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 _0x2596=['sequelize','exports','STRING','ENUM','incident','phonecall','contact','BOOLEAN'];(function(_0x5da8a9,_0x26ee48){var _0x26f36f=function(_0x23328d){while(--_0x23328d){_0x5da8a9['push'](_0x5da8a9['shift']());}};_0x26f36f(++_0x26ee48);}(_0x2596,0x70));var _0x6259=function(_0x2edee2,_0x4dd048){_0x2edee2=_0x2edee2-0x0;var _0x5b1d2d=_0x2596[_0x2edee2];return _0x5b1d2d;};'use strict';var Sequelize=require(_0x6259('0x0'));module[_0x6259('0x1')]={'name':{'type':Sequelize[_0x6259('0x2')]},'description':{'type':Sequelize[_0x6259('0x2')]},'ticketType':{'type':Sequelize[_0x6259('0x3')](_0x6259('0x4'),_0x6259('0x5')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x6259('0x3')](_0x6259('0x6'),'nothing'),'defaultValue':_0x6259('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0x6259('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0x6259('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x055a=['sequelize','exports','STRING','incident','ENUM','nothing','contact','BOOLEAN'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0x055a,0x100));var _0xa055=function(_0x291b77,_0x36b1c2){_0x291b77=_0x291b77-0x0;var _0x138495=_0x055a[_0x291b77];return _0x138495;};'use strict';var Sequelize=require(_0xa055('0x0'));module[_0xa055('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa055('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0xa055('0x3'),'phonecall'),'defaultValue':_0xa055('0x3')},'moduleCreate':{'type':Sequelize[_0xa055('0x4')]('contact',_0xa055('0x5')),'defaultValue':_0xa055('0x6'),'allowNull':![]},'additionalSearchContact':{'type':Sequelize[_0xa055('0x2')],'allowNull':!![]},'openNewTab':{'type':Sequelize[_0xa055('0x7')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 029d878..01c41a3 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 _0x9c5a=['merge','where','options','Dynamics365Configuration','includeAll','include','rows','catch','show','params','find','create','body','destroy','getFields','Dynamics365Field','order','getSubjects','findOne','getDescriptions','eml-format','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter'];(function(_0x12b683,_0x124186){var _0xfb150b=function(_0x565ce7){while(--_0x565ce7){_0x12b683['push'](_0x12b683['shift']());}};_0xfb150b(++_0x124186);}(_0x9c5a,0x1dc));var _0xa9c5=function(_0x2b402b,_0x28d77d){_0x2b402b=_0x2b402b-0x0;var _0x286f3c=_0x9c5a[_0x2b402b];return _0x286f3c;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require('request-promise');var moment=require(_0xa9c5('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa9c5('0x4'));var util=require(_0xa9c5('0x5'));var path=require('path');var sox=require(_0xa9c5('0x6'));var csv=require(_0xa9c5('0x7'));var ejs=require(_0xa9c5('0x8'));var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa9c5('0xa'));var jsforce=require(_0xa9c5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa9c5('0x7'));var querystring=require(_0xa9c5('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa9c5('0xd'));var qs=require(_0xa9c5('0xe'));var as=require(_0xa9c5('0xf'));var hardwareService=require(_0xa9c5('0x10'));var logger=require('../../config/logger')(_0xa9c5('0x11'));var utils=require(_0xa9c5('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xa9c5('0x13'))['db'];function respondWithStatusCode(_0x4d670e,_0x1cad4c){_0x1cad4c=_0x1cad4c||0xcc;return function(_0x32ea19){if(_0x32ea19){return _0x4d670e['sendStatus'](_0x1cad4c);}return _0x4d670e[_0xa9c5('0x14')](_0x1cad4c)[_0xa9c5('0x15')]();};}function respondWithResult(_0x2b8202,_0x57b0fb){_0x57b0fb=_0x57b0fb||0xc8;return function(_0x41ac6d){if(_0x41ac6d){return _0x2b8202[_0xa9c5('0x14')](_0x57b0fb)[_0xa9c5('0x16')](_0x41ac6d);}};}function respondWithFilteredResult(_0x21dd33,_0x570781){return function(_0x1bba24){if(_0x1bba24){var _0x167b40=typeof _0x570781['offset']==='undefined'&&typeof _0x570781[_0xa9c5('0x17')]===_0xa9c5('0x18');var _0xd54791=_0x1bba24[_0xa9c5('0x19')];var _0x36e81a=_0x167b40?0x0:_0x570781['offset'];var _0x18ea3b=_0x167b40?_0x1bba24['count']:_0x570781[_0xa9c5('0x1a')]+_0x570781[_0xa9c5('0x17')];var _0x18f3c8;if(_0x18ea3b>=_0xd54791){_0x18ea3b=_0xd54791;_0x18f3c8=0xc8;}else{_0x18f3c8=0xce;}_0x21dd33[_0xa9c5('0x14')](_0x18f3c8);return _0x21dd33[_0xa9c5('0x1b')](_0xa9c5('0x1c'),_0x36e81a+'-'+_0x18ea3b+'/'+_0xd54791)[_0xa9c5('0x16')](_0x1bba24);}return null;};}function patchUpdates(_0x21cd7b){return function(_0x49b335){try{jsonpatch['apply'](_0x49b335,_0x21cd7b,!![]);}catch(_0x4bb3d1){return BPromise[_0xa9c5('0x1d')](_0x4bb3d1);}return _0x49b335['save']();};}function saveUpdates(_0x2663b4,_0x3cafa9){return function(_0x1f754c){if(_0x1f754c){return _0x1f754c[_0xa9c5('0x1e')](_0x2663b4)['then'](function(_0x5c7a26){return _0x5c7a26;});}return null;};}function removeEntity(_0x14f460,_0x6227c9){return function(_0x57616c){if(_0x57616c){return _0x57616c['destroy']()[_0xa9c5('0x1f')](function(){_0x14f460[_0xa9c5('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0xac00c7,_0x3398ca){return function(_0x4acf1a){if(!_0x4acf1a){_0xac00c7[_0xa9c5('0x20')](0x194);}return _0x4acf1a;};}function handleError(_0x1ef516,_0x2d8c44){_0x2d8c44=_0x2d8c44||0x1f4;return function(_0x16fff4){logger[_0xa9c5('0x21')](_0x16fff4[_0xa9c5('0x22')]);if(_0x16fff4[_0xa9c5('0x23')]){delete _0x16fff4[_0xa9c5('0x23')];}_0x1ef516[_0xa9c5('0x14')](_0x2d8c44)[_0xa9c5('0x24')](_0x16fff4);};}exports[_0xa9c5('0x25')]=function(_0x835800,_0x15e275){var _0x4b5a59={},_0x442f6c={},_0x152812={'count':0x0,'rows':[]};var _0x506f82=_[_0xa9c5('0x26')](db['Dynamics365Configuration'][_0xa9c5('0x27')],function(_0x33b7ed){return{'name':_0x33b7ed[_0xa9c5('0x28')],'type':_0x33b7ed[_0xa9c5('0x29')][_0xa9c5('0x2a')]};});_0x442f6c[_0xa9c5('0x2b')]=_[_0xa9c5('0x26')](_0x506f82,'name');_0x442f6c[_0xa9c5('0x2c')]=_[_0xa9c5('0x2d')](_0x835800['query']);_0x442f6c['filters']=_[_0xa9c5('0x2e')](_0x442f6c[_0xa9c5('0x2b')],_0x442f6c[_0xa9c5('0x2c')]);_0x4b5a59['attributes']=_['intersection'](_0x442f6c[_0xa9c5('0x2b')],qs[_0xa9c5('0x2f')](_0x835800[_0xa9c5('0x2c')][_0xa9c5('0x2f')]));_0x4b5a59['attributes']=_0x4b5a59[_0xa9c5('0x30')][_0xa9c5('0x31')]?_0x4b5a59[_0xa9c5('0x30')]:_0x442f6c[_0xa9c5('0x2b')];if(!_0x835800[_0xa9c5('0x2c')][_0xa9c5('0x32')](_0xa9c5('0x33'))){_0x4b5a59[_0xa9c5('0x17')]=qs[_0xa9c5('0x17')](_0x835800[_0xa9c5('0x2c')][_0xa9c5('0x17')]);_0x4b5a59[_0xa9c5('0x1a')]=qs[_0xa9c5('0x1a')](_0x835800['query']['offset']);}_0x4b5a59['order']=qs[_0xa9c5('0x34')](_0x835800[_0xa9c5('0x2c')]['sort']);_0x4b5a59['where']=qs[_0xa9c5('0x35')](_[_0xa9c5('0x36')](_0x835800[_0xa9c5('0x2c')],_0x442f6c[_0xa9c5('0x35')]),_0x506f82);if(_0x835800['query'][_0xa9c5('0x37')]){_0x4b5a59['where']=_[_0xa9c5('0x38')](_0x4b5a59[_0xa9c5('0x39')],{'$or':_[_0xa9c5('0x26')](_0x506f82,function(_0x534b6d){if(_0x534b6d[_0xa9c5('0x29')]!=='VIRTUAL'){var _0x20a8c4={};_0x20a8c4[_0x534b6d[_0xa9c5('0x23')]]={'$like':'%'+_0x835800[_0xa9c5('0x2c')]['filter']+'%'};return _0x20a8c4;}})});}_0x4b5a59=_[_0xa9c5('0x38')]({},_0x4b5a59,_0x835800[_0xa9c5('0x3a')]);var _0x55cd13={'where':_0x4b5a59['where']};return db[_0xa9c5('0x3b')][_0xa9c5('0x19')](_0x55cd13)[_0xa9c5('0x1f')](function(_0x39b043){_0x152812[_0xa9c5('0x19')]=_0x39b043;if(_0x835800[_0xa9c5('0x2c')][_0xa9c5('0x3c')]){_0x4b5a59[_0xa9c5('0x3d')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x4b5a59);})[_0xa9c5('0x1f')](function(_0x1d45df){_0x152812[_0xa9c5('0x3e')]=_0x1d45df;return _0x152812;})[_0xa9c5('0x1f')](respondWithFilteredResult(_0x15e275,_0x4b5a59))[_0xa9c5('0x3f')](handleError(_0x15e275,null));};exports[_0xa9c5('0x40')]=function(_0x1fb259,_0x87b868){var _0x392f84={'raw':![],'where':{'id':_0x1fb259[_0xa9c5('0x41')]['id']}},_0x54b236={};_0x54b236[_0xa9c5('0x2b')]=_[_0xa9c5('0x2d')](db[_0xa9c5('0x3b')][_0xa9c5('0x27')]);_0x54b236[_0xa9c5('0x2c')]=_['keys'](_0x1fb259[_0xa9c5('0x2c')]);_0x54b236[_0xa9c5('0x35')]=_[_0xa9c5('0x2e')](_0x54b236[_0xa9c5('0x2b')],_0x54b236[_0xa9c5('0x2c')]);_0x392f84[_0xa9c5('0x30')]=_['intersection'](_0x54b236['model'],qs[_0xa9c5('0x2f')](_0x1fb259[_0xa9c5('0x2c')]['fields']));_0x392f84['attributes']=_0x392f84[_0xa9c5('0x30')][_0xa9c5('0x31')]?_0x392f84[_0xa9c5('0x30')]:_0x54b236[_0xa9c5('0x2b')];if(_0x1fb259[_0xa9c5('0x2c')]['includeAll']){_0x392f84[_0xa9c5('0x3d')]=[{'all':!![]}];}_0x392f84=_[_0xa9c5('0x38')]({},_0x392f84,_0x1fb259['options']);return db[_0xa9c5('0x3b')][_0xa9c5('0x42')](_0x392f84)['then'](handleEntityNotFound(_0x87b868,null))[_0xa9c5('0x1f')](respondWithResult(_0x87b868,null))[_0xa9c5('0x3f')](handleError(_0x87b868,null));};exports[_0xa9c5('0x43')]=function(_0x18421f,_0x2de938){return db[_0xa9c5('0x3b')][_0xa9c5('0x43')](_0x18421f[_0xa9c5('0x44')],{})[_0xa9c5('0x1f')](respondWithResult(_0x2de938,0xc9))[_0xa9c5('0x3f')](handleError(_0x2de938,null));};exports['update']=function(_0x2234cc,_0x45d5ed){if(_0x2234cc['body']['id']){delete _0x2234cc[_0xa9c5('0x44')]['id'];}return db['Dynamics365Configuration'][_0xa9c5('0x42')]({'where':{'id':_0x2234cc[_0xa9c5('0x41')]['id']}})[_0xa9c5('0x1f')](handleEntityNotFound(_0x45d5ed,null))['then'](saveUpdates(_0x2234cc[_0xa9c5('0x44')],null))[_0xa9c5('0x1f')](respondWithResult(_0x45d5ed,null))[_0xa9c5('0x3f')](handleError(_0x45d5ed,null));};exports[_0xa9c5('0x45')]=function(_0x1346b4,_0x138bcd){return db['Dynamics365Configuration'][_0xa9c5('0x42')]({'where':{'id':_0x1346b4[_0xa9c5('0x41')]['id']}})[_0xa9c5('0x1f')](handleEntityNotFound(_0x138bcd,null))[_0xa9c5('0x1f')](removeEntity(_0x138bcd,null))['catch'](handleError(_0x138bcd,null));};exports[_0xa9c5('0x46')]=function(_0x338d5b,_0x133358,_0x2e058a){var _0x59722a={};var _0x37951a={};var _0x5d68be;var _0x174f71;return db[_0xa9c5('0x3b')]['findOne']({'where':{'id':_0x338d5b['params']['id']}})['then'](handleEntityNotFound(_0x133358,null))[_0xa9c5('0x1f')](function(_0x2bc9f6){if(_0x2bc9f6){_0x5d68be=_0x2bc9f6;_0x37951a[_0xa9c5('0x2b')]=_[_0xa9c5('0x2d')](db[_0xa9c5('0x47')][_0xa9c5('0x27')]);_0x37951a[_0xa9c5('0x2c')]=_[_0xa9c5('0x2d')](_0x338d5b[_0xa9c5('0x2c')]);_0x37951a[_0xa9c5('0x35')]=_['intersection'](_0x37951a[_0xa9c5('0x2b')],_0x37951a[_0xa9c5('0x2c')]);_0x59722a[_0xa9c5('0x30')]=_[_0xa9c5('0x2e')](_0x37951a[_0xa9c5('0x2b')],qs[_0xa9c5('0x2f')](_0x338d5b[_0xa9c5('0x2c')]['fields']));_0x59722a[_0xa9c5('0x30')]=_0x59722a['attributes'][_0xa9c5('0x31')]?_0x59722a[_0xa9c5('0x30')]:_0x37951a['model'];_0x59722a[_0xa9c5('0x48')]=qs[_0xa9c5('0x34')](_0x338d5b['query'][_0xa9c5('0x34')]);_0x59722a[_0xa9c5('0x39')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x36')](_0x338d5b[_0xa9c5('0x2c')],_0x37951a[_0xa9c5('0x35')]));if(_0x338d5b[_0xa9c5('0x2c')]['filter']){_0x59722a[_0xa9c5('0x39')]=_['merge'](_0x59722a[_0xa9c5('0x39')],{'$or':_['map'](_0x59722a['attributes'],function(_0xf62d77){var _0x3413ed={};_0x3413ed[_0xf62d77]={'$like':'%'+_0x338d5b[_0xa9c5('0x2c')][_0xa9c5('0x37')]+'%'};return _0x3413ed;})});}_0x59722a=_['merge']({},_0x59722a,_0x338d5b[_0xa9c5('0x3a')]);return _0x5d68be[_0xa9c5('0x46')](_0x59722a);}})['then'](function(_0x5ef317){if(_0x5ef317){_0x174f71=_0x5ef317[_0xa9c5('0x31')];if(!_0x338d5b['query'][_0xa9c5('0x32')]('nolimit')){_0x59722a[_0xa9c5('0x17')]=qs[_0xa9c5('0x17')](_0x338d5b[_0xa9c5('0x2c')][_0xa9c5('0x17')]);_0x59722a['offset']=qs[_0xa9c5('0x1a')](_0x338d5b['query'][_0xa9c5('0x1a')]);}return _0x5d68be[_0xa9c5('0x46')](_0x59722a);}})[_0xa9c5('0x1f')](function(_0x4a84fc){if(_0x4a84fc){return _0x4a84fc?{'count':_0x174f71,'rows':_0x4a84fc}:null;}})[_0xa9c5('0x1f')](respondWithResult(_0x133358,null))['catch'](handleError(_0x133358,null));};exports[_0xa9c5('0x49')]=function(_0x58bc65,_0x5e3786,_0x20c90c){var _0x594242={};var _0x355137={};var _0x5279c3;var _0x580583;return db['Dynamics365Configuration'][_0xa9c5('0x4a')]({'where':{'id':_0x58bc65[_0xa9c5('0x41')]['id']}})['then'](handleEntityNotFound(_0x5e3786,null))[_0xa9c5('0x1f')](function(_0x3ce43b){if(_0x3ce43b){_0x5279c3=_0x3ce43b;_0x355137['model']=_['keys'](db[_0xa9c5('0x47')][_0xa9c5('0x27')]);_0x355137[_0xa9c5('0x2c')]=_['keys'](_0x58bc65[_0xa9c5('0x2c')]);_0x355137[_0xa9c5('0x35')]=_[_0xa9c5('0x2e')](_0x355137['model'],_0x355137[_0xa9c5('0x2c')]);_0x594242[_0xa9c5('0x30')]=_[_0xa9c5('0x2e')](_0x355137[_0xa9c5('0x2b')],qs['fields'](_0x58bc65[_0xa9c5('0x2c')][_0xa9c5('0x2f')]));_0x594242[_0xa9c5('0x30')]=_0x594242['attributes']['length']?_0x594242[_0xa9c5('0x30')]:_0x355137[_0xa9c5('0x2b')];_0x594242[_0xa9c5('0x48')]=qs[_0xa9c5('0x34')](_0x58bc65[_0xa9c5('0x2c')][_0xa9c5('0x34')]);_0x594242[_0xa9c5('0x39')]=qs[_0xa9c5('0x35')](_[_0xa9c5('0x36')](_0x58bc65['query'],_0x355137[_0xa9c5('0x35')]));if(_0x58bc65[_0xa9c5('0x2c')][_0xa9c5('0x37')]){_0x594242['where']=_[_0xa9c5('0x38')](_0x594242['where'],{'$or':_['map'](_0x594242['attributes'],function(_0x3e167a){var _0x365e02={};_0x365e02[_0x3e167a]={'$like':'%'+_0x58bc65[_0xa9c5('0x2c')]['filter']+'%'};return _0x365e02;})});}_0x594242=_[_0xa9c5('0x38')]({},_0x594242,_0x58bc65['options']);return _0x5279c3[_0xa9c5('0x49')](_0x594242);}})[_0xa9c5('0x1f')](function(_0x2f55c9){if(_0x2f55c9){_0x580583=_0x2f55c9['length'];if(!_0x58bc65[_0xa9c5('0x2c')][_0xa9c5('0x32')](_0xa9c5('0x33'))){_0x594242[_0xa9c5('0x17')]=qs['limit'](_0x58bc65['query'][_0xa9c5('0x17')]);_0x594242[_0xa9c5('0x1a')]=qs[_0xa9c5('0x1a')](_0x58bc65['query'][_0xa9c5('0x1a')]);}return _0x5279c3['getSubjects'](_0x594242);}})['then'](function(_0x192828){if(_0x192828){return _0x192828?{'count':_0x580583,'rows':_0x192828}:null;}})['then'](respondWithResult(_0x5e3786,null))[_0xa9c5('0x3f')](handleError(_0x5e3786,null));};exports['getDescriptions']=function(_0x11f605,_0x8ed5f4,_0xe7b266){var _0x2acd09={};var _0x18551a={};var _0x3f3b08;var _0x49ef2f;return db[_0xa9c5('0x3b')][_0xa9c5('0x4a')]({'where':{'id':_0x11f605[_0xa9c5('0x41')]['id']}})[_0xa9c5('0x1f')](handleEntityNotFound(_0x8ed5f4,null))['then'](function(_0xa17c35){if(_0xa17c35){_0x3f3b08=_0xa17c35;_0x18551a['model']=_[_0xa9c5('0x2d')](db[_0xa9c5('0x47')][_0xa9c5('0x27')]);_0x18551a['query']=_[_0xa9c5('0x2d')](_0x11f605[_0xa9c5('0x2c')]);_0x18551a[_0xa9c5('0x35')]=_[_0xa9c5('0x2e')](_0x18551a[_0xa9c5('0x2b')],_0x18551a[_0xa9c5('0x2c')]);_0x2acd09[_0xa9c5('0x30')]=_[_0xa9c5('0x2e')](_0x18551a[_0xa9c5('0x2b')],qs[_0xa9c5('0x2f')](_0x11f605[_0xa9c5('0x2c')]['fields']));_0x2acd09[_0xa9c5('0x30')]=_0x2acd09['attributes']['length']?_0x2acd09[_0xa9c5('0x30')]:_0x18551a[_0xa9c5('0x2b')];_0x2acd09[_0xa9c5('0x48')]=qs[_0xa9c5('0x34')](_0x11f605['query'][_0xa9c5('0x34')]);_0x2acd09[_0xa9c5('0x39')]=qs['filters'](_['pick'](_0x11f605[_0xa9c5('0x2c')],_0x18551a[_0xa9c5('0x35')]));if(_0x11f605[_0xa9c5('0x2c')][_0xa9c5('0x37')]){_0x2acd09[_0xa9c5('0x39')]=_[_0xa9c5('0x38')](_0x2acd09[_0xa9c5('0x39')],{'$or':_[_0xa9c5('0x26')](_0x2acd09[_0xa9c5('0x30')],function(_0x159dae){var _0x2a5d8d={};_0x2a5d8d[_0x159dae]={'$like':'%'+_0x11f605[_0xa9c5('0x2c')][_0xa9c5('0x37')]+'%'};return _0x2a5d8d;})});}_0x2acd09=_[_0xa9c5('0x38')]({},_0x2acd09,_0x11f605[_0xa9c5('0x3a')]);return _0x3f3b08[_0xa9c5('0x4b')](_0x2acd09);}})['then'](function(_0x3140e6){if(_0x3140e6){_0x49ef2f=_0x3140e6['length'];if(!_0x11f605[_0xa9c5('0x2c')][_0xa9c5('0x32')](_0xa9c5('0x33'))){_0x2acd09[_0xa9c5('0x17')]=qs['limit'](_0x11f605[_0xa9c5('0x2c')][_0xa9c5('0x17')]);_0x2acd09['offset']=qs['offset'](_0x11f605['query'][_0xa9c5('0x1a')]);}return _0x3f3b08['getDescriptions'](_0x2acd09);}})['then'](function(_0x5662ca){if(_0x5662ca){return _0x5662ca?{'count':_0x49ef2f,'rows':_0x5662ca}:null;}})[_0xa9c5('0x1f')](respondWithResult(_0x8ed5f4,null))[_0xa9c5('0x3f')](handleError(_0x8ed5f4,null));}; \ No newline at end of file +var _0x78a8=['crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','Dynamics365Field','getFields','findOne','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash'];(function(_0x469348,_0x39af3d){var _0x5a13a1=function(_0x48324a){while(--_0x48324a){_0x469348['push'](_0x469348['shift']());}};_0x5a13a1(++_0x39af3d);}(_0x78a8,0x12c));var _0x878a=function(_0x381af4,_0x1e2eae){_0x381af4=_0x381af4-0x0;var _0x460ef0=_0x78a8[_0x381af4];return _0x460ef0;};'use strict';var emlformat=require(_0x878a('0x0'));var rimraf=require(_0x878a('0x1'));var zipdir=require(_0x878a('0x2'));var jsonpatch=require(_0x878a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x878a('0x4'));var util=require(_0x878a('0x5'));var path=require(_0x878a('0x6'));var sox=require(_0x878a('0x7'));var csv=require(_0x878a('0x8'));var ejs=require(_0x878a('0x9'));var fs=require('fs');var fs_extra=require(_0x878a('0xa'));var _=require(_0x878a('0xb'));var squel=require('squel');var crypto=require(_0x878a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x878a('0xd'));var toCsv=require(_0x878a('0x8'));var querystring=require('querystring');var Papa=require(_0x878a('0xe'));var Redis=require(_0x878a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x878a('0x10'));var as=require(_0x878a('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x878a('0x12'))(_0x878a('0x13'));var utils=require(_0x878a('0x14'));var config=require(_0x878a('0x15'));var licenseUtil=require(_0x878a('0x16'));var db=require(_0x878a('0x17'))['db'];function respondWithStatusCode(_0x2039be,_0x499132){_0x499132=_0x499132||0xcc;return function(_0x1f8fe3){if(_0x1f8fe3){return _0x2039be[_0x878a('0x18')](_0x499132);}return _0x2039be['status'](_0x499132)[_0x878a('0x19')]();};}function respondWithResult(_0x1eb797,_0x18450c){_0x18450c=_0x18450c||0xc8;return function(_0x4ddace){if(_0x4ddace){return _0x1eb797[_0x878a('0x1a')](_0x18450c)[_0x878a('0x1b')](_0x4ddace);}};}function respondWithFilteredResult(_0x1af740,_0x418bda){return function(_0x59d5aa){if(_0x59d5aa){var _0x2e9a38=typeof _0x418bda['offset']===_0x878a('0x1c')&&typeof _0x418bda[_0x878a('0x1d')]===_0x878a('0x1c');var _0x1b9950=_0x59d5aa[_0x878a('0x1e')];var _0x11963f=_0x2e9a38?0x0:_0x418bda[_0x878a('0x1f')];var _0x4d2cd6=_0x2e9a38?_0x59d5aa['count']:_0x418bda[_0x878a('0x1f')]+_0x418bda['limit'];var _0x449c7f;if(_0x4d2cd6>=_0x1b9950){_0x4d2cd6=_0x1b9950;_0x449c7f=0xc8;}else{_0x449c7f=0xce;}_0x1af740[_0x878a('0x1a')](_0x449c7f);return _0x1af740[_0x878a('0x20')](_0x878a('0x21'),_0x11963f+'-'+_0x4d2cd6+'/'+_0x1b9950)[_0x878a('0x1b')](_0x59d5aa);}return null;};}function patchUpdates(_0x2e9e42){return function(_0x418961){try{jsonpatch[_0x878a('0x22')](_0x418961,_0x2e9e42,!![]);}catch(_0x5f2e8f){return BPromise['reject'](_0x5f2e8f);}return _0x418961['save']();};}function saveUpdates(_0x29fbc0,_0x28f515){return function(_0x2381c2){if(_0x2381c2){return _0x2381c2[_0x878a('0x23')](_0x29fbc0)[_0x878a('0x24')](function(_0x12bd05){return _0x12bd05;});}return null;};}function removeEntity(_0xe58339,_0x43d758){return function(_0x1bf1f0){if(_0x1bf1f0){return _0x1bf1f0[_0x878a('0x25')]()[_0x878a('0x24')](function(){_0xe58339[_0x878a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa249b6,_0xea247b){return function(_0x54e7f8){if(!_0x54e7f8){_0xa249b6['sendStatus'](0x194);}return _0x54e7f8;};}function handleError(_0x4c5b3e,_0x4e3137){_0x4e3137=_0x4e3137||0x1f4;return function(_0x1175e2){logger['error'](_0x1175e2[_0x878a('0x26')]);if(_0x1175e2[_0x878a('0x27')]){delete _0x1175e2[_0x878a('0x27')];}_0x4c5b3e[_0x878a('0x1a')](_0x4e3137)[_0x878a('0x28')](_0x1175e2);};}exports[_0x878a('0x29')]=function(_0x2bd361,_0x41f25c){var _0x27af44={},_0x3c6d4c={},_0x1cff9a={'count':0x0,'rows':[]};var _0x153427=_[_0x878a('0x2a')](db[_0x878a('0x2b')][_0x878a('0x2c')],function(_0x1bb017){return{'name':_0x1bb017['fieldName'],'type':_0x1bb017[_0x878a('0x2d')][_0x878a('0x2e')]};});_0x3c6d4c[_0x878a('0x2f')]=_[_0x878a('0x2a')](_0x153427,'name');_0x3c6d4c['query']=_[_0x878a('0x30')](_0x2bd361[_0x878a('0x31')]);_0x3c6d4c[_0x878a('0x32')]=_[_0x878a('0x33')](_0x3c6d4c[_0x878a('0x2f')],_0x3c6d4c[_0x878a('0x31')]);_0x27af44[_0x878a('0x34')]=_[_0x878a('0x33')](_0x3c6d4c[_0x878a('0x2f')],qs[_0x878a('0x35')](_0x2bd361[_0x878a('0x31')][_0x878a('0x35')]));_0x27af44[_0x878a('0x34')]=_0x27af44[_0x878a('0x34')][_0x878a('0x36')]?_0x27af44['attributes']:_0x3c6d4c[_0x878a('0x2f')];if(!_0x2bd361[_0x878a('0x31')][_0x878a('0x37')](_0x878a('0x38'))){_0x27af44[_0x878a('0x1d')]=qs[_0x878a('0x1d')](_0x2bd361[_0x878a('0x31')][_0x878a('0x1d')]);_0x27af44[_0x878a('0x1f')]=qs['offset'](_0x2bd361[_0x878a('0x31')][_0x878a('0x1f')]);}_0x27af44[_0x878a('0x39')]=qs[_0x878a('0x3a')](_0x2bd361[_0x878a('0x31')]['sort']);_0x27af44[_0x878a('0x3b')]=qs['filters'](_[_0x878a('0x3c')](_0x2bd361[_0x878a('0x31')],_0x3c6d4c['filters']),_0x153427);if(_0x2bd361['query'][_0x878a('0x3d')]){_0x27af44['where']=_[_0x878a('0x3e')](_0x27af44[_0x878a('0x3b')],{'$or':_[_0x878a('0x2a')](_0x153427,function(_0x553056){if(_0x553056['type']!=='VIRTUAL'){var _0x585763={};_0x585763[_0x553056['name']]={'$like':'%'+_0x2bd361['query']['filter']+'%'};return _0x585763;}})});}_0x27af44=_[_0x878a('0x3e')]({},_0x27af44,_0x2bd361['options']);var _0x4bd6a6={'where':_0x27af44[_0x878a('0x3b')]};return db[_0x878a('0x2b')]['count'](_0x4bd6a6)[_0x878a('0x24')](function(_0x3bce07){_0x1cff9a[_0x878a('0x1e')]=_0x3bce07;if(_0x2bd361['query'][_0x878a('0x3f')]){_0x27af44[_0x878a('0x40')]=[{'all':!![]}];}return db[_0x878a('0x2b')][_0x878a('0x41')](_0x27af44);})[_0x878a('0x24')](function(_0x32b6af){_0x1cff9a['rows']=_0x32b6af;return _0x1cff9a;})[_0x878a('0x24')](respondWithFilteredResult(_0x41f25c,_0x27af44))[_0x878a('0x42')](handleError(_0x41f25c,null));};exports[_0x878a('0x43')]=function(_0x186d70,_0x91ce1e){var _0x4071e9={'raw':![],'where':{'id':_0x186d70['params']['id']}},_0x142423={};_0x142423[_0x878a('0x2f')]=_[_0x878a('0x30')](db[_0x878a('0x2b')][_0x878a('0x2c')]);_0x142423['query']=_[_0x878a('0x30')](_0x186d70[_0x878a('0x31')]);_0x142423[_0x878a('0x32')]=_[_0x878a('0x33')](_0x142423['model'],_0x142423[_0x878a('0x31')]);_0x4071e9[_0x878a('0x34')]=_[_0x878a('0x33')](_0x142423['model'],qs['fields'](_0x186d70['query'][_0x878a('0x35')]));_0x4071e9[_0x878a('0x34')]=_0x4071e9['attributes'][_0x878a('0x36')]?_0x4071e9[_0x878a('0x34')]:_0x142423[_0x878a('0x2f')];if(_0x186d70[_0x878a('0x31')][_0x878a('0x3f')]){_0x4071e9['include']=[{'all':!![]}];}_0x4071e9=_[_0x878a('0x3e')]({},_0x4071e9,_0x186d70[_0x878a('0x44')]);return db[_0x878a('0x2b')][_0x878a('0x45')](_0x4071e9)[_0x878a('0x24')](handleEntityNotFound(_0x91ce1e,null))[_0x878a('0x24')](respondWithResult(_0x91ce1e,null))['catch'](handleError(_0x91ce1e,null));};exports['create']=function(_0x49c497,_0xedc9fe){return db['Dynamics365Configuration'][_0x878a('0x46')](_0x49c497[_0x878a('0x47')],{})[_0x878a('0x24')](respondWithResult(_0xedc9fe,0xc9))['catch'](handleError(_0xedc9fe,null));};exports[_0x878a('0x23')]=function(_0x30a31f,_0x4b0f7e){if(_0x30a31f[_0x878a('0x47')]['id']){delete _0x30a31f[_0x878a('0x47')]['id'];}return db[_0x878a('0x2b')][_0x878a('0x45')]({'where':{'id':_0x30a31f[_0x878a('0x48')]['id']}})['then'](handleEntityNotFound(_0x4b0f7e,null))[_0x878a('0x24')](saveUpdates(_0x30a31f[_0x878a('0x47')],null))[_0x878a('0x24')](respondWithResult(_0x4b0f7e,null))[_0x878a('0x42')](handleError(_0x4b0f7e,null));};exports[_0x878a('0x25')]=function(_0x32fe34,_0x4c0d10){return db[_0x878a('0x2b')]['find']({'where':{'id':_0x32fe34['params']['id']}})[_0x878a('0x24')](handleEntityNotFound(_0x4c0d10,null))[_0x878a('0x24')](removeEntity(_0x4c0d10,null))[_0x878a('0x42')](handleError(_0x4c0d10,null));};exports['getFields']=function(_0x143274,_0x383063,_0x6f1a63){var _0x101ff5={};var _0xa393f={};var _0x1fadec;var _0x2b6f7f;return db[_0x878a('0x2b')]['findOne']({'where':{'id':_0x143274['params']['id']}})[_0x878a('0x24')](handleEntityNotFound(_0x383063,null))[_0x878a('0x24')](function(_0x82a895){if(_0x82a895){_0x1fadec=_0x82a895;_0xa393f[_0x878a('0x2f')]=_['keys'](db[_0x878a('0x49')][_0x878a('0x2c')]);_0xa393f['query']=_[_0x878a('0x30')](_0x143274[_0x878a('0x31')]);_0xa393f[_0x878a('0x32')]=_[_0x878a('0x33')](_0xa393f['model'],_0xa393f[_0x878a('0x31')]);_0x101ff5[_0x878a('0x34')]=_[_0x878a('0x33')](_0xa393f['model'],qs['fields'](_0x143274['query'][_0x878a('0x35')]));_0x101ff5[_0x878a('0x34')]=_0x101ff5['attributes'][_0x878a('0x36')]?_0x101ff5[_0x878a('0x34')]:_0xa393f[_0x878a('0x2f')];_0x101ff5[_0x878a('0x39')]=qs[_0x878a('0x3a')](_0x143274['query']['sort']);_0x101ff5[_0x878a('0x3b')]=qs[_0x878a('0x32')](_[_0x878a('0x3c')](_0x143274[_0x878a('0x31')],_0xa393f[_0x878a('0x32')]));if(_0x143274['query'][_0x878a('0x3d')]){_0x101ff5['where']=_[_0x878a('0x3e')](_0x101ff5[_0x878a('0x3b')],{'$or':_[_0x878a('0x2a')](_0x101ff5['attributes'],function(_0x3347b2){var _0x2d8206={};_0x2d8206[_0x3347b2]={'$like':'%'+_0x143274['query']['filter']+'%'};return _0x2d8206;})});}_0x101ff5=_[_0x878a('0x3e')]({},_0x101ff5,_0x143274[_0x878a('0x44')]);return _0x1fadec[_0x878a('0x4a')](_0x101ff5);}})['then'](function(_0x28d6fc){if(_0x28d6fc){_0x2b6f7f=_0x28d6fc['length'];if(!_0x143274['query']['hasOwnProperty']('nolimit')){_0x101ff5['limit']=qs[_0x878a('0x1d')](_0x143274[_0x878a('0x31')][_0x878a('0x1d')]);_0x101ff5['offset']=qs[_0x878a('0x1f')](_0x143274[_0x878a('0x31')][_0x878a('0x1f')]);}return _0x1fadec[_0x878a('0x4a')](_0x101ff5);}})[_0x878a('0x24')](function(_0x31f47a){if(_0x31f47a){return _0x31f47a?{'count':_0x2b6f7f,'rows':_0x31f47a}:null;}})['then'](respondWithResult(_0x383063,null))[_0x878a('0x42')](handleError(_0x383063,null));};exports['getSubjects']=function(_0x54c096,_0x37bb81,_0x3ca01f){var _0x454941={};var _0x311f3d={};var _0x18f4cd;var _0x38c595;return db[_0x878a('0x2b')][_0x878a('0x4b')]({'where':{'id':_0x54c096[_0x878a('0x48')]['id']}})['then'](handleEntityNotFound(_0x37bb81,null))[_0x878a('0x24')](function(_0xecb616){if(_0xecb616){_0x18f4cd=_0xecb616;_0x311f3d[_0x878a('0x2f')]=_[_0x878a('0x30')](db[_0x878a('0x49')][_0x878a('0x2c')]);_0x311f3d[_0x878a('0x31')]=_[_0x878a('0x30')](_0x54c096['query']);_0x311f3d[_0x878a('0x32')]=_['intersection'](_0x311f3d['model'],_0x311f3d[_0x878a('0x31')]);_0x454941[_0x878a('0x34')]=_['intersection'](_0x311f3d[_0x878a('0x2f')],qs[_0x878a('0x35')](_0x54c096[_0x878a('0x31')][_0x878a('0x35')]));_0x454941[_0x878a('0x34')]=_0x454941['attributes'][_0x878a('0x36')]?_0x454941[_0x878a('0x34')]:_0x311f3d[_0x878a('0x2f')];_0x454941['order']=qs[_0x878a('0x3a')](_0x54c096[_0x878a('0x31')][_0x878a('0x3a')]);_0x454941['where']=qs[_0x878a('0x32')](_[_0x878a('0x3c')](_0x54c096[_0x878a('0x31')],_0x311f3d['filters']));if(_0x54c096[_0x878a('0x31')][_0x878a('0x3d')]){_0x454941[_0x878a('0x3b')]=_[_0x878a('0x3e')](_0x454941[_0x878a('0x3b')],{'$or':_[_0x878a('0x2a')](_0x454941[_0x878a('0x34')],function(_0x469901){var _0x13f66d={};_0x13f66d[_0x469901]={'$like':'%'+_0x54c096[_0x878a('0x31')]['filter']+'%'};return _0x13f66d;})});}_0x454941=_[_0x878a('0x3e')]({},_0x454941,_0x54c096['options']);return _0x18f4cd[_0x878a('0x4c')](_0x454941);}})['then'](function(_0x1e58e1){if(_0x1e58e1){_0x38c595=_0x1e58e1[_0x878a('0x36')];if(!_0x54c096['query'][_0x878a('0x37')](_0x878a('0x38'))){_0x454941[_0x878a('0x1d')]=qs[_0x878a('0x1d')](_0x54c096[_0x878a('0x31')]['limit']);_0x454941['offset']=qs[_0x878a('0x1f')](_0x54c096['query']['offset']);}return _0x18f4cd[_0x878a('0x4c')](_0x454941);}})[_0x878a('0x24')](function(_0x2830bf){if(_0x2830bf){return _0x2830bf?{'count':_0x38c595,'rows':_0x2830bf}:null;}})[_0x878a('0x24')](respondWithResult(_0x37bb81,null))[_0x878a('0x42')](handleError(_0x37bb81,null));};exports[_0x878a('0x4d')]=function(_0x172926,_0x3d4e0a,_0x1abca7){var _0x46542d={};var _0x26eb7d={};var _0x2d7d84;var _0x332547;return db[_0x878a('0x2b')][_0x878a('0x4b')]({'where':{'id':_0x172926[_0x878a('0x48')]['id']}})[_0x878a('0x24')](handleEntityNotFound(_0x3d4e0a,null))[_0x878a('0x24')](function(_0x1d50df){if(_0x1d50df){_0x2d7d84=_0x1d50df;_0x26eb7d['model']=_[_0x878a('0x30')](db['Dynamics365Field'][_0x878a('0x2c')]);_0x26eb7d[_0x878a('0x31')]=_[_0x878a('0x30')](_0x172926[_0x878a('0x31')]);_0x26eb7d[_0x878a('0x32')]=_['intersection'](_0x26eb7d[_0x878a('0x2f')],_0x26eb7d[_0x878a('0x31')]);_0x46542d['attributes']=_[_0x878a('0x33')](_0x26eb7d[_0x878a('0x2f')],qs[_0x878a('0x35')](_0x172926['query'][_0x878a('0x35')]));_0x46542d[_0x878a('0x34')]=_0x46542d['attributes'][_0x878a('0x36')]?_0x46542d[_0x878a('0x34')]:_0x26eb7d['model'];_0x46542d[_0x878a('0x39')]=qs[_0x878a('0x3a')](_0x172926['query'][_0x878a('0x3a')]);_0x46542d[_0x878a('0x3b')]=qs[_0x878a('0x32')](_[_0x878a('0x3c')](_0x172926[_0x878a('0x31')],_0x26eb7d[_0x878a('0x32')]));if(_0x172926['query'][_0x878a('0x3d')]){_0x46542d[_0x878a('0x3b')]=_[_0x878a('0x3e')](_0x46542d[_0x878a('0x3b')],{'$or':_['map'](_0x46542d[_0x878a('0x34')],function(_0x247c0d){var _0x1795c2={};_0x1795c2[_0x247c0d]={'$like':'%'+_0x172926['query'][_0x878a('0x3d')]+'%'};return _0x1795c2;})});}_0x46542d=_['merge']({},_0x46542d,_0x172926['options']);return _0x2d7d84[_0x878a('0x4d')](_0x46542d);}})['then'](function(_0xe698a0){if(_0xe698a0){_0x332547=_0xe698a0['length'];if(!_0x172926['query'][_0x878a('0x37')](_0x878a('0x38'))){_0x46542d[_0x878a('0x1d')]=qs[_0x878a('0x1d')](_0x172926[_0x878a('0x31')][_0x878a('0x1d')]);_0x46542d[_0x878a('0x1f')]=qs[_0x878a('0x1f')](_0x172926[_0x878a('0x31')][_0x878a('0x1f')]);}return _0x2d7d84[_0x878a('0x4d')](_0x46542d);}})['then'](function(_0x2bfdc0){if(_0x2bfdc0){return _0x2bfdc0?{'count':_0x332547,'rows':_0x2bfdc0}:null;}})[_0x878a('0x24')](respondWithResult(_0x3d4e0a,null))[_0x878a('0x42')](handleError(_0x3d4e0a,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index af52194..f5440c9 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 _0x9bde=['request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','util','api','bluebird'];(function(_0x50a856,_0x3c02bc){var _0x32d03b=function(_0x1503fb){while(--_0x1503fb){_0x50a856['push'](_0x50a856['shift']());}};_0x32d03b(++_0x3c02bc);}(_0x9bde,0xe1));var _0xe9bd=function(_0x2ee997,_0xb4f79c){_0x2ee997=_0x2ee997-0x0;var _0x2c6aa2=_0x9bde[_0x2ee997];return _0x2c6aa2;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var logger=require('../../config/logger')(_0xe9bd('0x1'));var moment=require('moment');var BPromise=require(_0xe9bd('0x2'));var rp=require(_0xe9bd('0x3'));var fs=require('fs');var path=require(_0xe9bd('0x4'));var rimraf=require(_0xe9bd('0x5'));var config=require(_0xe9bd('0x6'));var attributes=require(_0xe9bd('0x7'));module[_0xe9bd('0x8')]=function(_0x4fd7b8,_0x4763e9){return _0x4fd7b8[_0xe9bd('0x9')](_0xe9bd('0xa'),attributes,{'tableName':_0xe9bd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5b02=['define','Dynamics365Configuration','lodash','util','../../config/logger','api','request-promise','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports'];(function(_0x5d3d76,_0x96f453){var _0x2382f9=function(_0x55cdb8){while(--_0x55cdb8){_0x5d3d76['push'](_0x5d3d76['shift']());}};_0x2382f9(++_0x96f453);}(_0x5b02,0xe9));var _0x25b0=function(_0x39b5d1,_0x56cbcf){_0x39b5d1=_0x39b5d1-0x0;var _0x2643a2=_0x5b02[_0x39b5d1];return _0x2643a2;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var logger=require(_0x25b0('0x2'))(_0x25b0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x25b0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x25b0('0x5'));var config=require(_0x25b0('0x6'));var attributes=require(_0x25b0('0x7'));module[_0x25b0('0x8')]=function(_0x2d84a9,_0x4eea55){return _0x2d84a9[_0x25b0('0x9')](_0x25b0('0xa'),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 a71fb74..a983629 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 _0x3c13=['info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x34d7a9,_0x33017e){var _0x49ae7e=function(_0x3896ac){while(--_0x3896ac){_0x34d7a9['push'](_0x34d7a9['shift']());}};_0x49ae7e(++_0x33017e);}(_0x3c13,0x129));var _0x33c1=function(_0x4a5c80,_0x12678f){_0x4a5c80=_0x4a5c80-0x0;var _0x2f5dcc=_0x3c13[_0x4a5c80];return _0x2f5dcc;};'use strict';var _=require('lodash');var util=require(_0x33c1('0x0'));var moment=require(_0x33c1('0x1'));var BPromise=require(_0x33c1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x33c1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x33c1('0x4'));var logger=require('../../config/logger')(_0x33c1('0x5'));var config=require(_0x33c1('0x6'));var jayson=require(_0x33c1('0x7'));var client=jayson[_0x33c1('0x8')][_0x33c1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f71d0,_0x129be0,_0x374299){return new BPromise(function(_0x20ed02,_0x3d489d){return client[_0x33c1('0xa')](_0x1f71d0,_0x374299)['then'](function(_0xfc080a){logger[_0x33c1('0xb')](_0x33c1('0xc'),_0x129be0,_0x33c1('0xd'));logger[_0x33c1('0xe')](_0x33c1('0xf'),_0x129be0,_0x33c1('0xd'),JSON[_0x33c1('0x10')](_0xfc080a));if(_0xfc080a['error']){if(_0xfc080a[_0x33c1('0x11')][_0x33c1('0x12')]===0x1f4){logger[_0x33c1('0x11')](_0x33c1('0xc'),_0x129be0,_0xfc080a['error'][_0x33c1('0x13')]);return _0x3d489d(_0xfc080a[_0x33c1('0x11')][_0x33c1('0x13')]);}logger['error'](_0x33c1('0xc'),_0x129be0,_0xfc080a[_0x33c1('0x11')]['message']);return _0x20ed02(_0xfc080a[_0x33c1('0x11')][_0x33c1('0x13')]);}else{logger[_0x33c1('0xb')](_0x33c1('0xc'),_0x129be0,_0x33c1('0xd'));_0x20ed02(_0xfc080a[_0x33c1('0x14')][_0x33c1('0x13')]);}})[_0x33c1('0x15')](function(_0x210c82){logger[_0x33c1('0x11')](_0x33c1('0xc'),_0x129be0,_0x210c82);_0x3d489d(_0x210c82);});});} \ No newline at end of file +var _0xae62=['code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error'];(function(_0xf8f833,_0x512053){var _0x1e1dac=function(_0x12d6e9){while(--_0x12d6e9){_0xf8f833['push'](_0xf8f833['shift']());}};_0x1e1dac(++_0x512053);}(_0xae62,0xe0));var _0x2ae6=function(_0x4dcb7b,_0x5374db){_0x4dcb7b=_0x4dcb7b-0x0;var _0x196f73=_0xae62[_0x4dcb7b];return _0x196f73;};'use strict';var _=require('lodash');var util=require(_0x2ae6('0x0'));var moment=require(_0x2ae6('0x1'));var BPromise=require(_0x2ae6('0x2'));var rs=require(_0x2ae6('0x3'));var fs=require('fs');var Redis=require(_0x2ae6('0x4'));var db=require(_0x2ae6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x2ae6('0x6'));var config=require(_0x2ae6('0x7'));var jayson=require(_0x2ae6('0x8'));var client=jayson['client'][_0x2ae6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21e437,_0x177811,_0x57170d){return new BPromise(function(_0x144c0c,_0x50b139){return client['request'](_0x21e437,_0x57170d)[_0x2ae6('0xa')](function(_0x1c3cd5){logger[_0x2ae6('0xb')](_0x2ae6('0xc'),_0x177811,_0x2ae6('0xd'));logger['debug'](_0x2ae6('0xe'),_0x177811,_0x2ae6('0xd'),JSON['stringify'](_0x1c3cd5));if(_0x1c3cd5[_0x2ae6('0xf')]){if(_0x1c3cd5[_0x2ae6('0xf')][_0x2ae6('0x10')]===0x1f4){logger[_0x2ae6('0xf')](_0x2ae6('0xc'),_0x177811,_0x1c3cd5['error'][_0x2ae6('0x11')]);return _0x50b139(_0x1c3cd5['error'][_0x2ae6('0x11')]);}logger[_0x2ae6('0xf')]('Dynamics365Configuration,\x20%s,\x20%s',_0x177811,_0x1c3cd5[_0x2ae6('0xf')]['message']);return _0x144c0c(_0x1c3cd5['error'][_0x2ae6('0x11')]);}else{logger[_0x2ae6('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x177811,_0x2ae6('0xd'));_0x144c0c(_0x1c3cd5[_0x2ae6('0x12')][_0x2ae6('0x11')]);}})[_0x2ae6('0x13')](function(_0x470f71){logger[_0x2ae6('0xf')](_0x2ae6('0xc'),_0x177811,_0x470f71);_0x50b139(_0x470f71);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 7c7780b..5c1af40 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 _0x7e83=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','get','isAuthenticated','/:id','show','post','put','delete','destroy','exports'];(function(_0x578673,_0x1e1792){var _0x4f0782=function(_0x572782){while(--_0x572782){_0x578673['push'](_0x578673['shift']());}};_0x4f0782(++_0x1e1792);}(_0x7e83,0x66));var _0x37e8=function(_0x22dbd1,_0x47e0bb){_0x22dbd1=_0x22dbd1-0x0;var _0x50a4fd=_0x7e83[_0x22dbd1];return _0x50a4fd;};'use strict';var multer=require('multer');var util=require(_0x37e8('0x0'));var path=require(_0x37e8('0x1'));var timeout=require(_0x37e8('0x2'));var express=require('express');var router=express[_0x37e8('0x3')]();var fs_extra=require(_0x37e8('0x4'));var auth=require(_0x37e8('0x5'));var interaction=require(_0x37e8('0x6'));var config=require('../../config/environment');var controller=require(_0x37e8('0x7'));router[_0x37e8('0x8')]('/',auth[_0x37e8('0x9')](),controller['index']);router['get'](_0x37e8('0xa'),auth['isAuthenticated'](),controller[_0x37e8('0xb')]);router[_0x37e8('0xc')]('/',auth[_0x37e8('0x9')](),controller['create']);router[_0x37e8('0xd')](_0x37e8('0xa'),auth[_0x37e8('0x9')](),controller['update']);router[_0x37e8('0xe')]('/:id',auth[_0x37e8('0x9')](),controller[_0x37e8('0xf')]);module[_0x37e8('0x10')]=router; \ No newline at end of file +var _0x39c3=['util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy'];(function(_0x581135,_0x197723){var _0x146ac9=function(_0xbc297){while(--_0xbc297){_0x581135['push'](_0x581135['shift']());}};_0x146ac9(++_0x197723);}(_0x39c3,0xbe));var _0x339c=function(_0x28014d,_0x383e2f){_0x28014d=_0x28014d-0x0;var _0x2572cc=_0x39c3[_0x28014d];return _0x2572cc;};'use strict';var multer=require('multer');var util=require(_0x339c('0x0'));var path=require('path');var timeout=require(_0x339c('0x1'));var express=require(_0x339c('0x2'));var router=express[_0x339c('0x3')]();var fs_extra=require(_0x339c('0x4'));var auth=require(_0x339c('0x5'));var interaction=require(_0x339c('0x6'));var config=require(_0x339c('0x7'));var controller=require(_0x339c('0x8'));router[_0x339c('0x9')]('/',auth[_0x339c('0xa')](),controller[_0x339c('0xb')]);router[_0x339c('0x9')](_0x339c('0xc'),auth['isAuthenticated'](),controller[_0x339c('0xd')]);router[_0x339c('0xe')]('/',auth[_0x339c('0xa')](),controller[_0x339c('0xf')]);router[_0x339c('0x10')](_0x339c('0xc'),auth[_0x339c('0xa')](),controller['update']);router[_0x339c('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x339c('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 3b12112..ac82327 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 _0x8c5e=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x8c5e,0x12f));var _0xe8c5=function(_0x51e321,_0x4b3ed7){_0x51e321=_0x51e321-0x0;var _0x6c3f43=_0x8c5e[_0x51e321];return _0x6c3f43;};'use strict';var Sequelize=require(_0xe8c5('0x0'));module[_0xe8c5('0x1')]={'type':{'type':Sequelize[_0xe8c5('0x2')](_0xe8c5('0x3'),_0xe8c5('0x4'),_0xe8c5('0x5'),_0xe8c5('0x6'),_0xe8c5('0x7')),'defaultValue':_0xe8c5('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xe8c5('0x2')](_0xe8c5('0x3'),_0xe8c5('0x4'),_0xe8c5('0x5'))},'keyContent':{'type':Sequelize[_0xe8c5('0x8')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xe8c5('0x8')]},'customField':{'type':Sequelize[_0xe8c5('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xecb1=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN'];(function(_0x4b8a51,_0x1dcb1f){var _0x6e5efe=function(_0x46182f){while(--_0x46182f){_0x4b8a51['push'](_0x4b8a51['shift']());}};_0x6e5efe(++_0x1dcb1f);}(_0xecb1,0xf3));var _0x1ecb=function(_0x3f83ad,_0x34b731){_0x3f83ad=_0x3f83ad-0x0;var _0x1c5460=_0xecb1[_0x3f83ad];return _0x1c5460;};'use strict';var Sequelize=require(_0x1ecb('0x0'));module[_0x1ecb('0x1')]={'type':{'type':Sequelize[_0x1ecb('0x2')](_0x1ecb('0x3'),_0x1ecb('0x4'),_0x1ecb('0x5'),_0x1ecb('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize[_0x1ecb('0x7')]},'key':{'type':Sequelize[_0x1ecb('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x1ecb('0x3'),_0x1ecb('0x4'),_0x1ecb('0x5'))},'keyContent':{'type':Sequelize[_0x1ecb('0x7')]},'idField':{'type':Sequelize[_0x1ecb('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x1ecb('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1ecb('0x7')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 8ae47a0..c4ef8e7 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 _0x424d=['pick','filters','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','Dynamics365Field','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where'];(function(_0x5bb34e,_0x528c8e){var _0x11cd7f=function(_0x330dca){while(--_0x330dca){_0x5bb34e['push'](_0x5bb34e['shift']());}};_0x11cd7f(++_0x528c8e);}(_0x424d,0x1f2));var _0xd424=function(_0x3b9d79,_0x42f721){_0x3b9d79=_0x3b9d79-0x0;var _0x16d93e=_0x424d[_0x3b9d79];return _0x16d93e;};'use strict';var emlformat=require(_0xd424('0x0'));var rimraf=require(_0xd424('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd424('0x2'));var rp=require(_0xd424('0x3'));var moment=require(_0xd424('0x4'));var BPromise=require(_0xd424('0x5'));var Mustache=require(_0xd424('0x6'));var util=require(_0xd424('0x7'));var path=require(_0xd424('0x8'));var sox=require(_0xd424('0x9'));var csv=require('to-csv');var ejs=require(_0xd424('0xa'));var fs=require('fs');var fs_extra=require(_0xd424('0xb'));var _=require(_0xd424('0xc'));var squel=require(_0xd424('0xd'));var crypto=require(_0xd424('0xe'));var jsforce=require(_0xd424('0xf'));var deskjs=require(_0xd424('0x10'));var toCsv=require(_0xd424('0x11'));var querystring=require('querystring');var Papa=require(_0xd424('0x12'));var Redis=require(_0xd424('0x13'));var authService=require(_0xd424('0x14'));var qs=require(_0xd424('0x15'));var as=require(_0xd424('0x16'));var hardwareService=require(_0xd424('0x17'));var logger=require(_0xd424('0x18'))(_0xd424('0x19'));var utils=require('../../config/utils');var config=require(_0xd424('0x1a'));var licenseUtil=require(_0xd424('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ba46d,_0x44bce7){_0x44bce7=_0x44bce7||0xcc;return function(_0xc43b67){if(_0xc43b67){return _0x3ba46d[_0xd424('0x1c')](_0x44bce7);}return _0x3ba46d[_0xd424('0x1d')](_0x44bce7)[_0xd424('0x1e')]();};}function respondWithResult(_0x4bce33,_0x4dbe4e){_0x4dbe4e=_0x4dbe4e||0xc8;return function(_0x1623b2){if(_0x1623b2){return _0x4bce33['status'](_0x4dbe4e)[_0xd424('0x1f')](_0x1623b2);}};}function respondWithFilteredResult(_0x40d681,_0x5c66f7){return function(_0x17b828){if(_0x17b828){var _0x3b04a5=typeof _0x5c66f7[_0xd424('0x20')]===_0xd424('0x21')&&typeof _0x5c66f7['limit']===_0xd424('0x21');var _0x3ced68=_0x17b828[_0xd424('0x22')];var _0x50a791=_0x3b04a5?0x0:_0x5c66f7[_0xd424('0x20')];var _0x368fd2=_0x3b04a5?_0x17b828[_0xd424('0x22')]:_0x5c66f7[_0xd424('0x20')]+_0x5c66f7[_0xd424('0x23')];var _0x1c53f6;if(_0x368fd2>=_0x3ced68){_0x368fd2=_0x3ced68;_0x1c53f6=0xc8;}else{_0x1c53f6=0xce;}_0x40d681[_0xd424('0x1d')](_0x1c53f6);return _0x40d681[_0xd424('0x24')](_0xd424('0x25'),_0x50a791+'-'+_0x368fd2+'/'+_0x3ced68)[_0xd424('0x1f')](_0x17b828);}return null;};}function patchUpdates(_0x1fc6de){return function(_0x148b78){try{jsonpatch[_0xd424('0x26')](_0x148b78,_0x1fc6de,!![]);}catch(_0x15af4a){return BPromise[_0xd424('0x27')](_0x15af4a);}return _0x148b78['save']();};}function saveUpdates(_0xb197f5,_0x5d0c57){return function(_0x42f250){if(_0x42f250){return _0x42f250[_0xd424('0x28')](_0xb197f5)[_0xd424('0x29')](function(_0x3fe3b0){return _0x3fe3b0;});}return null;};}function removeEntity(_0x8527e8,_0x36cfcb){return function(_0x172cab){if(_0x172cab){return _0x172cab[_0xd424('0x2a')]()[_0xd424('0x29')](function(){_0x8527e8['status'](0xcc)[_0xd424('0x1e')]();});}};}function handleEntityNotFound(_0x293f63,_0x3675c0){return function(_0x3c5a31){if(!_0x3c5a31){_0x293f63[_0xd424('0x1c')](0x194);}return _0x3c5a31;};}function handleError(_0x394d40,_0x199a71){_0x199a71=_0x199a71||0x1f4;return function(_0x32ea28){logger[_0xd424('0x2b')](_0x32ea28['stack']);if(_0x32ea28['name']){delete _0x32ea28[_0xd424('0x2c')];}_0x394d40[_0xd424('0x1d')](_0x199a71)[_0xd424('0x2d')](_0x32ea28);};}exports[_0xd424('0x2e')]=function(_0x9024b5,_0x402e90){var _0xe96684={},_0x29e579={},_0x1c9ead={'count':0x0,'rows':[]};var _0x5534e0=_['map'](db[_0xd424('0x2f')][_0xd424('0x30')],function(_0x3feed5){return{'name':_0x3feed5[_0xd424('0x31')],'type':_0x3feed5['type'][_0xd424('0x32')]};});_0x29e579[_0xd424('0x33')]=_[_0xd424('0x34')](_0x5534e0,'name');_0x29e579[_0xd424('0x35')]=_[_0xd424('0x36')](_0x9024b5['query']);_0x29e579['filters']=_[_0xd424('0x37')](_0x29e579['model'],_0x29e579[_0xd424('0x35')]);_0xe96684[_0xd424('0x38')]=_[_0xd424('0x37')](_0x29e579[_0xd424('0x33')],qs[_0xd424('0x39')](_0x9024b5['query'][_0xd424('0x39')]));_0xe96684[_0xd424('0x38')]=_0xe96684[_0xd424('0x38')]['length']?_0xe96684[_0xd424('0x38')]:_0x29e579[_0xd424('0x33')];if(!_0x9024b5['query'][_0xd424('0x3a')](_0xd424('0x3b'))){_0xe96684[_0xd424('0x23')]=qs[_0xd424('0x23')](_0x9024b5['query'][_0xd424('0x23')]);_0xe96684['offset']=qs[_0xd424('0x20')](_0x9024b5[_0xd424('0x35')][_0xd424('0x20')]);}_0xe96684['order']=qs[_0xd424('0x3c')](_0x9024b5[_0xd424('0x35')]['sort']);_0xe96684[_0xd424('0x3d')]=qs['filters'](_[_0xd424('0x3e')](_0x9024b5[_0xd424('0x35')],_0x29e579[_0xd424('0x3f')]),_0x5534e0);if(_0x9024b5[_0xd424('0x35')][_0xd424('0x40')]){_0xe96684[_0xd424('0x3d')]=_[_0xd424('0x41')](_0xe96684['where'],{'$or':_[_0xd424('0x34')](_0x5534e0,function(_0xaaf6f4){if(_0xaaf6f4[_0xd424('0x42')]!==_0xd424('0x43')){var _0x472716={};_0x472716[_0xaaf6f4[_0xd424('0x2c')]]={'$like':'%'+_0x9024b5[_0xd424('0x35')][_0xd424('0x40')]+'%'};return _0x472716;}})});}_0xe96684=_[_0xd424('0x41')]({},_0xe96684,_0x9024b5['options']);var _0x43f914={'where':_0xe96684['where']};return db[_0xd424('0x2f')][_0xd424('0x22')](_0x43f914)[_0xd424('0x29')](function(_0x945b02){_0x1c9ead[_0xd424('0x22')]=_0x945b02;if(_0x9024b5[_0xd424('0x35')][_0xd424('0x44')]){_0xe96684[_0xd424('0x45')]=[{'all':!![]}];}return db[_0xd424('0x2f')][_0xd424('0x46')](_0xe96684);})[_0xd424('0x29')](function(_0x2d37ed){_0x1c9ead[_0xd424('0x47')]=_0x2d37ed;return _0x1c9ead;})[_0xd424('0x29')](respondWithFilteredResult(_0x402e90,_0xe96684))[_0xd424('0x48')](handleError(_0x402e90,null));};exports[_0xd424('0x49')]=function(_0x5776ae,_0x4425f6){var _0x478fad={'raw':!![],'where':{'id':_0x5776ae[_0xd424('0x4a')]['id']}},_0x16bd3d={};_0x16bd3d[_0xd424('0x33')]=_[_0xd424('0x36')](db[_0xd424('0x2f')][_0xd424('0x30')]);_0x16bd3d['query']=_['keys'](_0x5776ae[_0xd424('0x35')]);_0x16bd3d[_0xd424('0x3f')]=_[_0xd424('0x37')](_0x16bd3d[_0xd424('0x33')],_0x16bd3d[_0xd424('0x35')]);_0x478fad[_0xd424('0x38')]=_['intersection'](_0x16bd3d['model'],qs[_0xd424('0x39')](_0x5776ae[_0xd424('0x35')]['fields']));_0x478fad['attributes']=_0x478fad[_0xd424('0x38')][_0xd424('0x4b')]?_0x478fad[_0xd424('0x38')]:_0x16bd3d[_0xd424('0x33')];if(_0x5776ae[_0xd424('0x35')][_0xd424('0x44')]){_0x478fad[_0xd424('0x45')]=[{'all':!![]}];}_0x478fad=_[_0xd424('0x41')]({},_0x478fad,_0x5776ae[_0xd424('0x4c')]);return db[_0xd424('0x2f')][_0xd424('0x4d')](_0x478fad)[_0xd424('0x29')](handleEntityNotFound(_0x4425f6,null))[_0xd424('0x29')](respondWithResult(_0x4425f6,null))[_0xd424('0x48')](handleError(_0x4425f6,null));};exports[_0xd424('0x4e')]=function(_0x105191,_0x590f58){return db['Dynamics365Field'][_0xd424('0x4e')](_0x105191['body'],{})['then'](respondWithResult(_0x590f58,0xc9))['catch'](handleError(_0x590f58,null));};exports[_0xd424('0x28')]=function(_0x55867f,_0x364d32){if(_0x55867f[_0xd424('0x4f')]['id']){delete _0x55867f[_0xd424('0x4f')]['id'];}return db[_0xd424('0x2f')][_0xd424('0x4d')]({'where':{'id':_0x55867f[_0xd424('0x4a')]['id']}})[_0xd424('0x29')](handleEntityNotFound(_0x364d32,null))[_0xd424('0x29')](saveUpdates(_0x55867f['body'],null))['then'](respondWithResult(_0x364d32,null))[_0xd424('0x48')](handleError(_0x364d32,null));};exports[_0xd424('0x2a')]=function(_0x949ab9,_0x4dd093){return db[_0xd424('0x2f')][_0xd424('0x4d')]({'where':{'id':_0x949ab9[_0xd424('0x4a')]['id']}})[_0xd424('0x29')](handleEntityNotFound(_0x4dd093,null))['then'](removeEntity(_0x4dd093,null))[_0xd424('0x48')](handleError(_0x4dd093,null));}; \ No newline at end of file +var _0xe863=['sort','pick','where','merge','VIRTUAL','filter','options','includeAll','rows','catch','show','params','keys','rawAttributes','length','include','body','find','destroy','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','apply','save','then','error','stack','map','Dynamics365Field','fieldName','type','model','name','query','filters','attributes','intersection','fields','hasOwnProperty'];(function(_0x109946,_0x3494b7){var _0x4ed20b=function(_0x578aa4){while(--_0x578aa4){_0x109946['push'](_0x109946['shift']());}};_0x4ed20b(++_0x3494b7);}(_0xe863,0x171));var _0x3e86=function(_0x49dd7e,_0x48b1e5){_0x49dd7e=_0x49dd7e-0x0;var _0x4c4f6e=_0xe863[_0x49dd7e];return _0x4c4f6e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3e86('0x0'));var jsonpatch=require(_0x3e86('0x1'));var rp=require(_0x3e86('0x2'));var moment=require(_0x3e86('0x3'));var BPromise=require(_0x3e86('0x4'));var Mustache=require(_0x3e86('0x5'));var util=require(_0x3e86('0x6'));var path=require(_0x3e86('0x7'));var sox=require(_0x3e86('0x8'));var csv=require('to-csv');var ejs=require(_0x3e86('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3e86('0xa'));var squel=require(_0x3e86('0xb'));var crypto=require(_0x3e86('0xc'));var jsforce=require(_0x3e86('0xd'));var deskjs=require(_0x3e86('0xe'));var toCsv=require(_0x3e86('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x3e86('0x10'));var authService=require(_0x3e86('0x11'));var qs=require(_0x3e86('0x12'));var as=require(_0x3e86('0x13'));var hardwareService=require(_0x3e86('0x14'));var logger=require(_0x3e86('0x15'))(_0x3e86('0x16'));var utils=require(_0x3e86('0x17'));var config=require(_0x3e86('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3e86('0x19'))['db'];function respondWithStatusCode(_0x2a5b38,_0x35ffa1){_0x35ffa1=_0x35ffa1||0xcc;return function(_0x33f811){if(_0x33f811){return _0x2a5b38[_0x3e86('0x1a')](_0x35ffa1);}return _0x2a5b38['status'](_0x35ffa1)[_0x3e86('0x1b')]();};}function respondWithResult(_0x2a50e0,_0x4c0c7d){_0x4c0c7d=_0x4c0c7d||0xc8;return function(_0x1641ff){if(_0x1641ff){return _0x2a50e0[_0x3e86('0x1c')](_0x4c0c7d)[_0x3e86('0x1d')](_0x1641ff);}};}function respondWithFilteredResult(_0xf71f6e,_0x388b60){return function(_0x57136a){if(_0x57136a){var _0x51012d=typeof _0x388b60['offset']===_0x3e86('0x1e')&&typeof _0x388b60[_0x3e86('0x1f')]===_0x3e86('0x1e');var _0x291e18=_0x57136a[_0x3e86('0x20')];var _0x43aab6=_0x51012d?0x0:_0x388b60[_0x3e86('0x21')];var _0x539019=_0x51012d?_0x57136a[_0x3e86('0x20')]:_0x388b60[_0x3e86('0x21')]+_0x388b60[_0x3e86('0x1f')];var _0x11c990;if(_0x539019>=_0x291e18){_0x539019=_0x291e18;_0x11c990=0xc8;}else{_0x11c990=0xce;}_0xf71f6e[_0x3e86('0x1c')](_0x11c990);return _0xf71f6e['set']('Content-Range',_0x43aab6+'-'+_0x539019+'/'+_0x291e18)['json'](_0x57136a);}return null;};}function patchUpdates(_0x53f7c3){return function(_0x5926db){try{jsonpatch[_0x3e86('0x22')](_0x5926db,_0x53f7c3,!![]);}catch(_0x5961fe){return BPromise['reject'](_0x5961fe);}return _0x5926db[_0x3e86('0x23')]();};}function saveUpdates(_0x93b44d,_0x226ed2){return function(_0x5e8228){if(_0x5e8228){return _0x5e8228['update'](_0x93b44d)[_0x3e86('0x24')](function(_0x15cbea){return _0x15cbea;});}return null;};}function removeEntity(_0x4b0a63,_0x224f3f){return function(_0x9063a9){if(_0x9063a9){return _0x9063a9['destroy']()[_0x3e86('0x24')](function(){_0x4b0a63['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41ba6d,_0x317668){return function(_0x58eabd){if(!_0x58eabd){_0x41ba6d['sendStatus'](0x194);}return _0x58eabd;};}function handleError(_0x34f535,_0x54ef19){_0x54ef19=_0x54ef19||0x1f4;return function(_0x494316){logger[_0x3e86('0x25')](_0x494316[_0x3e86('0x26')]);if(_0x494316['name']){delete _0x494316['name'];}_0x34f535[_0x3e86('0x1c')](_0x54ef19)['send'](_0x494316);};}exports['index']=function(_0x5ad4f2,_0x13d2e5){var _0x2af1e9={},_0x477670={},_0x32e2a6={'count':0x0,'rows':[]};var _0x847836=_[_0x3e86('0x27')](db[_0x3e86('0x28')]['rawAttributes'],function(_0x437708){return{'name':_0x437708[_0x3e86('0x29')],'type':_0x437708[_0x3e86('0x2a')]['key']};});_0x477670[_0x3e86('0x2b')]=_[_0x3e86('0x27')](_0x847836,_0x3e86('0x2c'));_0x477670[_0x3e86('0x2d')]=_['keys'](_0x5ad4f2[_0x3e86('0x2d')]);_0x477670[_0x3e86('0x2e')]=_['intersection'](_0x477670['model'],_0x477670[_0x3e86('0x2d')]);_0x2af1e9[_0x3e86('0x2f')]=_[_0x3e86('0x30')](_0x477670[_0x3e86('0x2b')],qs[_0x3e86('0x31')](_0x5ad4f2[_0x3e86('0x2d')]['fields']));_0x2af1e9[_0x3e86('0x2f')]=_0x2af1e9[_0x3e86('0x2f')]['length']?_0x2af1e9[_0x3e86('0x2f')]:_0x477670[_0x3e86('0x2b')];if(!_0x5ad4f2['query'][_0x3e86('0x32')]('nolimit')){_0x2af1e9[_0x3e86('0x1f')]=qs[_0x3e86('0x1f')](_0x5ad4f2[_0x3e86('0x2d')][_0x3e86('0x1f')]);_0x2af1e9[_0x3e86('0x21')]=qs[_0x3e86('0x21')](_0x5ad4f2[_0x3e86('0x2d')][_0x3e86('0x21')]);}_0x2af1e9['order']=qs[_0x3e86('0x33')](_0x5ad4f2[_0x3e86('0x2d')][_0x3e86('0x33')]);_0x2af1e9['where']=qs[_0x3e86('0x2e')](_[_0x3e86('0x34')](_0x5ad4f2[_0x3e86('0x2d')],_0x477670[_0x3e86('0x2e')]),_0x847836);if(_0x5ad4f2[_0x3e86('0x2d')]['filter']){_0x2af1e9[_0x3e86('0x35')]=_[_0x3e86('0x36')](_0x2af1e9['where'],{'$or':_[_0x3e86('0x27')](_0x847836,function(_0x413f4f){if(_0x413f4f[_0x3e86('0x2a')]!==_0x3e86('0x37')){var _0x3027bd={};_0x3027bd[_0x413f4f[_0x3e86('0x2c')]]={'$like':'%'+_0x5ad4f2[_0x3e86('0x2d')][_0x3e86('0x38')]+'%'};return _0x3027bd;}})});}_0x2af1e9=_['merge']({},_0x2af1e9,_0x5ad4f2[_0x3e86('0x39')]);var _0x21650f={'where':_0x2af1e9['where']};return db[_0x3e86('0x28')]['count'](_0x21650f)['then'](function(_0x2acf92){_0x32e2a6[_0x3e86('0x20')]=_0x2acf92;if(_0x5ad4f2['query'][_0x3e86('0x3a')]){_0x2af1e9['include']=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x2af1e9);})[_0x3e86('0x24')](function(_0x40e28d){_0x32e2a6[_0x3e86('0x3b')]=_0x40e28d;return _0x32e2a6;})[_0x3e86('0x24')](respondWithFilteredResult(_0x13d2e5,_0x2af1e9))[_0x3e86('0x3c')](handleError(_0x13d2e5,null));};exports[_0x3e86('0x3d')]=function(_0x442221,_0x533256){var _0x7e4eb4={'raw':!![],'where':{'id':_0x442221[_0x3e86('0x3e')]['id']}},_0x2703d4={};_0x2703d4['model']=_[_0x3e86('0x3f')](db[_0x3e86('0x28')][_0x3e86('0x40')]);_0x2703d4[_0x3e86('0x2d')]=_[_0x3e86('0x3f')](_0x442221[_0x3e86('0x2d')]);_0x2703d4[_0x3e86('0x2e')]=_[_0x3e86('0x30')](_0x2703d4['model'],_0x2703d4[_0x3e86('0x2d')]);_0x7e4eb4[_0x3e86('0x2f')]=_[_0x3e86('0x30')](_0x2703d4['model'],qs['fields'](_0x442221[_0x3e86('0x2d')][_0x3e86('0x31')]));_0x7e4eb4['attributes']=_0x7e4eb4['attributes'][_0x3e86('0x41')]?_0x7e4eb4[_0x3e86('0x2f')]:_0x2703d4[_0x3e86('0x2b')];if(_0x442221[_0x3e86('0x2d')]['includeAll']){_0x7e4eb4[_0x3e86('0x42')]=[{'all':!![]}];}_0x7e4eb4=_[_0x3e86('0x36')]({},_0x7e4eb4,_0x442221[_0x3e86('0x39')]);return db[_0x3e86('0x28')]['find'](_0x7e4eb4)[_0x3e86('0x24')](handleEntityNotFound(_0x533256,null))[_0x3e86('0x24')](respondWithResult(_0x533256,null))['catch'](handleError(_0x533256,null));};exports['create']=function(_0x3406fa,_0x2e1c0d){return db[_0x3e86('0x28')]['create'](_0x3406fa[_0x3e86('0x43')],{})[_0x3e86('0x24')](respondWithResult(_0x2e1c0d,0xc9))[_0x3e86('0x3c')](handleError(_0x2e1c0d,null));};exports['update']=function(_0x17842a,_0x3fb519){if(_0x17842a['body']['id']){delete _0x17842a[_0x3e86('0x43')]['id'];}return db[_0x3e86('0x28')][_0x3e86('0x44')]({'where':{'id':_0x17842a[_0x3e86('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3fb519,null))[_0x3e86('0x24')](saveUpdates(_0x17842a[_0x3e86('0x43')],null))['then'](respondWithResult(_0x3fb519,null))[_0x3e86('0x3c')](handleError(_0x3fb519,null));};exports[_0x3e86('0x45')]=function(_0x1810c7,_0x429aa9){return db[_0x3e86('0x28')][_0x3e86('0x44')]({'where':{'id':_0x1810c7[_0x3e86('0x3e')]['id']}})[_0x3e86('0x24')](handleEntityNotFound(_0x429aa9,null))[_0x3e86('0x24')](removeEntity(_0x429aa9,null))[_0x3e86('0x3c')](handleError(_0x429aa9,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 299d8b2..5598b7f 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 _0x344a=['request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird'];(function(_0x4103ba,_0x261f7d){var _0x25af60=function(_0x235419){while(--_0x235419){_0x4103ba['push'](_0x4103ba['shift']());}};_0x25af60(++_0x261f7d);}(_0x344a,0xa0));var _0xa344=function(_0xa4aa58,_0x62a66a){_0xa4aa58=_0xa4aa58-0x0;var _0x159c8c=_0x344a[_0xa4aa58];return _0x159c8c;};'use strict';var _=require(_0xa344('0x0'));var util=require(_0xa344('0x1'));var logger=require(_0xa344('0x2'))(_0xa344('0x3'));var moment=require('moment');var BPromise=require(_0xa344('0x4'));var rp=require(_0xa344('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa344('0x6'));var config=require(_0xa344('0x7'));var attributes=require(_0xa344('0x8'));module['exports']=function(_0xcd737d,_0x15cc63){return _0xcd737d[_0xa344('0x9')](_0xa344('0xa'),attributes,{'tableName':_0xa344('0xb'),'paranoid':![],'indexes':[{'name':_0xa344('0xc'),'fields':[_0xa344('0xd'),_0xa344('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x856d=['moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','Dynamics365Field','dynamics365_unique_index','idField','lodash','util','api'];(function(_0x236c67,_0x28b77e){var _0x19e4fb=function(_0x7cffa2){while(--_0x7cffa2){_0x236c67['push'](_0x236c67['shift']());}};_0x19e4fb(++_0x28b77e);}(_0x856d,0x1aa));var _0xd856=function(_0x5d6452,_0x4c72d2){_0x5d6452=_0x5d6452-0x0;var _0x4aff24=_0x856d[_0x5d6452];return _0x4aff24;};'use strict';var _=require(_0xd856('0x0'));var util=require(_0xd856('0x1'));var logger=require('../../config/logger')(_0xd856('0x2'));var moment=require(_0xd856('0x3'));var BPromise=require(_0xd856('0x4'));var rp=require(_0xd856('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd856('0x6'));var config=require(_0xd856('0x7'));var attributes=require(_0xd856('0x8'));module[_0xd856('0x9')]=function(_0x2c923d,_0x4a4e64){return _0x2c923d['define'](_0xd856('0xa'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':_0xd856('0xb'),'fields':[_0xd856('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 9393278..3ace461 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 _0xfdbc=['debug','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent'];(function(_0x56ed28,_0x5bedfe){var _0x1c2f7f=function(_0x27c9bc){while(--_0x27c9bc){_0x56ed28['push'](_0x56ed28['shift']());}};_0x1c2f7f(++_0x5bedfe);}(_0xfdbc,0xba));var _0xcfdb=function(_0x570845,_0x4935ca){_0x570845=_0x570845-0x0;var _0x393e6c=_0xfdbc[_0x570845];return _0x393e6c;};'use strict';var _=require(_0xcfdb('0x0'));var util=require(_0xcfdb('0x1'));var moment=require(_0xcfdb('0x2'));var BPromise=require('bluebird');var rs=require(_0xcfdb('0x3'));var fs=require('fs');var Redis=require(_0xcfdb('0x4'));var db=require(_0xcfdb('0x5'))['db'];var utils=require(_0xcfdb('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xcfdb('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xcfdb('0x8')][_0xcfdb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x318adb,_0x465b6f,_0x514512){return new BPromise(function(_0x37b30a,_0x12ddf6){return client[_0xcfdb('0xa')](_0x318adb,_0x514512)['then'](function(_0x3e9e83){logger[_0xcfdb('0xb')](_0xcfdb('0xc'),_0x465b6f,_0xcfdb('0xd'));logger[_0xcfdb('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x465b6f,'request\x20sent',JSON['stringify'](_0x3e9e83));if(_0x3e9e83[_0xcfdb('0xf')]){if(_0x3e9e83[_0xcfdb('0xf')][_0xcfdb('0x10')]===0x1f4){logger[_0xcfdb('0xf')](_0xcfdb('0xc'),_0x465b6f,_0x3e9e83[_0xcfdb('0xf')][_0xcfdb('0x11')]);return _0x12ddf6(_0x3e9e83[_0xcfdb('0xf')][_0xcfdb('0x11')]);}logger[_0xcfdb('0xf')](_0xcfdb('0xc'),_0x465b6f,_0x3e9e83[_0xcfdb('0xf')][_0xcfdb('0x11')]);return _0x37b30a(_0x3e9e83['error'][_0xcfdb('0x11')]);}else{logger['info'](_0xcfdb('0xc'),_0x465b6f,_0xcfdb('0xd'));_0x37b30a(_0x3e9e83[_0xcfdb('0x12')]['message']);}})[_0xcfdb('0x13')](function(_0x25aece){logger['error'](_0xcfdb('0xc'),_0x465b6f,_0x25aece);_0x12ddf6(_0x25aece);});});} \ No newline at end of file +var _0x7559=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Dynamics365Field,\x20%s,\x20%s','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','lodash','util','moment'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0x7559,0xfa));var _0x9755=function(_0x48d2b5,_0x23f54e){_0x48d2b5=_0x48d2b5-0x0;var _0x1a6dbb=_0x7559[_0x48d2b5];return _0x1a6dbb;};'use strict';var _=require(_0x9755('0x0'));var util=require(_0x9755('0x1'));var moment=require(_0x9755('0x2'));var BPromise=require(_0x9755('0x3'));var rs=require(_0x9755('0x4'));var fs=require('fs');var Redis=require(_0x9755('0x5'));var db=require(_0x9755('0x6'))['db'];var utils=require(_0x9755('0x7'));var logger=require('../../config/logger')(_0x9755('0x8'));var config=require(_0x9755('0x9'));var jayson=require(_0x9755('0xa'));var client=jayson[_0x9755('0xb')][_0x9755('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x235398,_0x3e969a,_0x24f4ea){return new BPromise(function(_0xd3bea8,_0x2ae61c){return client[_0x9755('0xd')](_0x235398,_0x24f4ea)[_0x9755('0xe')](function(_0x1e6b12){logger[_0x9755('0xf')](_0x9755('0x10'),_0x3e969a,'request\x20sent');logger['debug'](_0x9755('0x11'),_0x3e969a,'request\x20sent',JSON[_0x9755('0x12')](_0x1e6b12));if(_0x1e6b12['error']){if(_0x1e6b12['error'][_0x9755('0x13')]===0x1f4){logger['error'](_0x9755('0x10'),_0x3e969a,_0x1e6b12['error']['message']);return _0x2ae61c(_0x1e6b12['error'][_0x9755('0x14')]);}logger[_0x9755('0x15')](_0x9755('0x10'),_0x3e969a,_0x1e6b12[_0x9755('0x15')][_0x9755('0x14')]);return _0xd3bea8(_0x1e6b12['error']['message']);}else{logger[_0x9755('0xf')](_0x9755('0x10'),_0x3e969a,'request\x20sent');_0xd3bea8(_0x1e6b12[_0x9755('0x16')][_0x9755('0x14')]);}})['catch'](function(_0x1a199a){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x3e969a,_0x1a199a);_0x2ae61c(_0x1a199a);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 820681e..97b54f6 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 _0xe4a6=['/:id','show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','index'];(function(_0x79496f,_0x2f9747){var _0x39f0bc=function(_0x368044){while(--_0x368044){_0x79496f['push'](_0x79496f['shift']());}};_0x39f0bc(++_0x2f9747);}(_0xe4a6,0x68));var _0x6e4a=function(_0x16b13d,_0x2faf09){_0x16b13d=_0x16b13d-0x0;var _0x1f1e77=_0xe4a6[_0x16b13d];return _0x1f1e77;};'use strict';var multer=require(_0x6e4a('0x0'));var util=require('util');var path=require(_0x6e4a('0x1'));var timeout=require('connect-timeout');var express=require(_0x6e4a('0x2'));var router=express[_0x6e4a('0x3')]();var fs_extra=require(_0x6e4a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6e4a('0x5'));var config=require(_0x6e4a('0x6'));var controller=require(_0x6e4a('0x7'));router[_0x6e4a('0x8')]('/',auth[_0x6e4a('0x9')](),controller[_0x6e4a('0xa')]);router[_0x6e4a('0x8')](_0x6e4a('0xb'),auth[_0x6e4a('0x9')](),controller[_0x6e4a('0xc')]);router[_0x6e4a('0x8')](_0x6e4a('0xd'),auth[_0x6e4a('0x9')](),controller['getConfigurations']);router['get'](_0x6e4a('0xe'),auth[_0x6e4a('0x9')](),controller[_0x6e4a('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6e4a('0x10')]);router[_0x6e4a('0x11')]('/:id/configurations',auth[_0x6e4a('0x9')](),controller[_0x6e4a('0x12')]);router[_0x6e4a('0x13')](_0x6e4a('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x6e4a('0x14')](_0x6e4a('0xb'),auth[_0x6e4a('0x9')](),controller[_0x6e4a('0x15')]);module[_0x6e4a('0x16')]=router; \ No newline at end of file +var _0xf1b7=['post','create','/:id/configurations','addConfiguration','update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','show'];(function(_0x1aa3fe,_0x27c5fa){var _0x163cee=function(_0x2a1505){while(--_0x2a1505){_0x1aa3fe['push'](_0x1aa3fe['shift']());}};_0x163cee(++_0x27c5fa);}(_0xf1b7,0x196));var _0x7f1b=function(_0x1dbd0b,_0x26e998){_0x1dbd0b=_0x1dbd0b-0x0;var _0x5275fd=_0xf1b7[_0x1dbd0b];return _0x5275fd;};'use strict';var multer=require(_0x7f1b('0x0'));var util=require(_0x7f1b('0x1'));var path=require(_0x7f1b('0x2'));var timeout=require('connect-timeout');var express=require(_0x7f1b('0x3'));var router=express[_0x7f1b('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7f1b('0x5'));var interaction=require(_0x7f1b('0x6'));var config=require('../../config/environment');var controller=require(_0x7f1b('0x7'));router[_0x7f1b('0x8')]('/',auth[_0x7f1b('0x9')](),controller['index']);router[_0x7f1b('0x8')](_0x7f1b('0xa'),auth['isAuthenticated'](),controller[_0x7f1b('0xb')]);router[_0x7f1b('0x8')]('/:id/configurations',auth[_0x7f1b('0x9')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x7f1b('0x9')](),controller['getFields']);router[_0x7f1b('0xc')]('/',auth[_0x7f1b('0x9')](),controller[_0x7f1b('0xd')]);router[_0x7f1b('0xc')](_0x7f1b('0xe'),auth[_0x7f1b('0x9')](),controller[_0x7f1b('0xf')]);router['put']('/:id',auth[_0x7f1b('0x9')](),controller[_0x7f1b('0x10')]);router['delete'](_0x7f1b('0xa'),auth[_0x7f1b('0x9')](),controller[_0x7f1b('0x11')]);module[_0x7f1b('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 28b1651..044137a 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 _0x3423=['username','remoteUri','STRING'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0x3423,0x188));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3342('0x0')]},'description':{'type':Sequelize[_0x3342('0x0')]},'username':{'type':Sequelize[_0x3342('0x0')],'unique':_0x3342('0x1')},'apiKey':{'type':Sequelize[_0x3342('0x0')]},'remoteUri':{'type':Sequelize[_0x3342('0x0')],'unique':_0x3342('0x2')},'serverUrl':{'type':Sequelize[_0x3342('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x9582=['exports','STRING','username','remoteUri','sequelize'];(function(_0x1b4f19,_0x235951){var _0x3b830a=function(_0x1c62f9){while(--_0x1c62f9){_0x1b4f19['push'](_0x1b4f19['shift']());}};_0x3b830a(++_0x235951);}(_0x9582,0x95));var _0x2958=function(_0x107952,_0x1963e9){_0x107952=_0x107952-0x0;var _0x544521=_0x9582[_0x107952];return _0x544521;};'use strict';var Sequelize=require(_0x2958('0x0'));module[_0x2958('0x1')]={'name':{'type':Sequelize[_0x2958('0x2')]},'description':{'type':Sequelize[_0x2958('0x2')]},'username':{'type':Sequelize[_0x2958('0x2')],'unique':_0x2958('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2958('0x2')],'unique':_0x2958('0x4')},'serverUrl':{'type':Sequelize[_0x2958('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 113ee27..4cc5ff3 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 _0x4e5c=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','json','offset','undefined','limit','count','status','apply','reject','save','then','error','stack','name','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','FreshdeskAccount','rows','catch','show','params','include','create','body','update','destroy','find','findOne','FreshdeskConfiguration','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','toString','base64','subject','agent','priority','group','ticket_type','company','remove','default','custom_text','choices','test','statusCode','getFields','stringify','eml-format','zip-dir','request-promise','moment','bluebird','sox','to-csv'];(function(_0x313de9,_0x4ecb09){var _0x3ca6a7=function(_0x23f961){while(--_0x23f961){_0x313de9['push'](_0x313de9['shift']());}};_0x3ca6a7(++_0x4ecb09);}(_0x4e5c,0x149));var _0xc4e5=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x4e5c[_0xaa1b3e];return _0x454d7d;};'use strict';var emlformat=require(_0xc4e5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc4e5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc4e5('0x2'));var moment=require(_0xc4e5('0x3'));var BPromise=require(_0xc4e5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc4e5('0x5'));var csv=require(_0xc4e5('0x6'));var ejs=require(_0xc4e5('0x7'));var fs=require('fs');var fs_extra=require(_0xc4e5('0x8'));var _=require(_0xc4e5('0x9'));var squel=require(_0xc4e5('0xa'));var crypto=require(_0xc4e5('0xb'));var jsforce=require(_0xc4e5('0xc'));var deskjs=require(_0xc4e5('0xd'));var toCsv=require(_0xc4e5('0x6'));var querystring=require(_0xc4e5('0xe'));var Papa=require(_0xc4e5('0xf'));var Redis=require('ioredis');var authService=require(_0xc4e5('0x10'));var qs=require(_0xc4e5('0x11'));var as=require(_0xc4e5('0x12'));var hardwareService=require(_0xc4e5('0x13'));var logger=require('../../config/logger')(_0xc4e5('0x14'));var utils=require(_0xc4e5('0x15'));var config=require(_0xc4e5('0x16'));var licenseUtil=require(_0xc4e5('0x17'));var db=require(_0xc4e5('0x18'))['db'];var integrations=require(_0xc4e5('0x19'));function respondWithStatusCode(_0x3fa318,_0x54c5a7){_0x54c5a7=_0x54c5a7||0xcc;return function(_0x5f00d8){if(_0x5f00d8){return _0x3fa318[_0xc4e5('0x1a')](_0x54c5a7);}return _0x3fa318['status'](_0x54c5a7)[_0xc4e5('0x1b')]();};}function respondWithResult(_0x7cd002,_0x303037){_0x303037=_0x303037||0xc8;return function(_0x2404a7){if(_0x2404a7){return _0x7cd002['status'](_0x303037)[_0xc4e5('0x1c')](_0x2404a7);}};}function respondWithFilteredResult(_0x528de4,_0x338c37){return function(_0x3beb59){if(_0x3beb59){var _0x2937d9=typeof _0x338c37[_0xc4e5('0x1d')]===_0xc4e5('0x1e')&&typeof _0x338c37[_0xc4e5('0x1f')]===_0xc4e5('0x1e');var _0x1156ce=_0x3beb59[_0xc4e5('0x20')];var _0x57042c=_0x2937d9?0x0:_0x338c37[_0xc4e5('0x1d')];var _0x154486=_0x2937d9?_0x3beb59['count']:_0x338c37[_0xc4e5('0x1d')]+_0x338c37[_0xc4e5('0x1f')];var _0x5003e5;if(_0x154486>=_0x1156ce){_0x154486=_0x1156ce;_0x5003e5=0xc8;}else{_0x5003e5=0xce;}_0x528de4[_0xc4e5('0x21')](_0x5003e5);return _0x528de4['set']('Content-Range',_0x57042c+'-'+_0x154486+'/'+_0x1156ce)[_0xc4e5('0x1c')](_0x3beb59);}return null;};}function patchUpdates(_0x7dbe6d){return function(_0x4933b7){try{jsonpatch[_0xc4e5('0x22')](_0x4933b7,_0x7dbe6d,!![]);}catch(_0x5be68b){return BPromise[_0xc4e5('0x23')](_0x5be68b);}return _0x4933b7[_0xc4e5('0x24')]();};}function saveUpdates(_0x505078,_0x546949){return function(_0x45abe3){if(_0x45abe3){return _0x45abe3['update'](_0x505078)[_0xc4e5('0x25')](function(_0x41467f){return _0x41467f;});}return null;};}function removeEntity(_0x4bb973,_0x4ed1ff){return function(_0x44299a){if(_0x44299a){return _0x44299a['destroy']()[_0xc4e5('0x25')](function(){_0x4bb973['status'](0xcc)[_0xc4e5('0x1b')]();});}};}function handleEntityNotFound(_0x234b31,_0x53f7cd){return function(_0x5f48fc){if(!_0x5f48fc){_0x234b31['sendStatus'](0x194);}return _0x5f48fc;};}function handleError(_0x23889c,_0x183ec7){_0x183ec7=_0x183ec7||0x1f4;return function(_0x143e66){logger[_0xc4e5('0x26')](_0x143e66[_0xc4e5('0x27')]);if(_0x143e66[_0xc4e5('0x28')]){delete _0x143e66[_0xc4e5('0x28')];}_0x23889c[_0xc4e5('0x21')](_0x183ec7)['send'](_0x143e66);};}exports[_0xc4e5('0x29')]=function(_0x2ad4be,_0x261b88){var _0x23383b={},_0x94dcd0={},_0x4805b2={'count':0x0,'rows':[]};var _0x205f41=_[_0xc4e5('0x2a')](db['FreshdeskAccount'][_0xc4e5('0x2b')],function(_0x598212){return{'name':_0x598212[_0xc4e5('0x2c')],'type':_0x598212['type'][_0xc4e5('0x2d')]};});_0x94dcd0['model']=_[_0xc4e5('0x2a')](_0x205f41,'name');_0x94dcd0['query']=_[_0xc4e5('0x2e')](_0x2ad4be[_0xc4e5('0x2f')]);_0x94dcd0[_0xc4e5('0x30')]=_[_0xc4e5('0x31')](_0x94dcd0['model'],_0x94dcd0[_0xc4e5('0x2f')]);_0x23383b[_0xc4e5('0x32')]=_[_0xc4e5('0x31')](_0x94dcd0[_0xc4e5('0x33')],qs['fields'](_0x2ad4be[_0xc4e5('0x2f')][_0xc4e5('0x34')]));_0x23383b[_0xc4e5('0x32')]=_0x23383b[_0xc4e5('0x32')][_0xc4e5('0x35')]?_0x23383b['attributes']:_0x94dcd0[_0xc4e5('0x33')];if(!_0x2ad4be[_0xc4e5('0x2f')][_0xc4e5('0x36')]('nolimit')){_0x23383b[_0xc4e5('0x1f')]=qs[_0xc4e5('0x1f')](_0x2ad4be[_0xc4e5('0x2f')][_0xc4e5('0x1f')]);_0x23383b['offset']=qs['offset'](_0x2ad4be[_0xc4e5('0x2f')][_0xc4e5('0x1d')]);}_0x23383b[_0xc4e5('0x37')]=qs[_0xc4e5('0x38')](_0x2ad4be[_0xc4e5('0x2f')][_0xc4e5('0x38')]);_0x23383b[_0xc4e5('0x39')]=qs[_0xc4e5('0x30')](_[_0xc4e5('0x3a')](_0x2ad4be['query'],_0x94dcd0['filters']),_0x205f41);if(_0x2ad4be[_0xc4e5('0x2f')][_0xc4e5('0x3b')]){_0x23383b[_0xc4e5('0x39')]=_[_0xc4e5('0x3c')](_0x23383b[_0xc4e5('0x39')],{'$or':_['map'](_0x205f41,function(_0x2a77dd){if(_0x2a77dd[_0xc4e5('0x3d')]!==_0xc4e5('0x3e')){var _0x2c754b={};_0x2c754b[_0x2a77dd[_0xc4e5('0x28')]]={'$like':'%'+_0x2ad4be['query'][_0xc4e5('0x3b')]+'%'};return _0x2c754b;}})});}_0x23383b=_[_0xc4e5('0x3c')]({},_0x23383b,_0x2ad4be[_0xc4e5('0x3f')]);var _0x35f940={'where':_0x23383b['where']};return db['FreshdeskAccount']['count'](_0x35f940)[_0xc4e5('0x25')](function(_0x5292a4){_0x4805b2[_0xc4e5('0x20')]=_0x5292a4;if(_0x2ad4be[_0xc4e5('0x2f')][_0xc4e5('0x40')]){_0x23383b['include']=[{'all':!![]}];}return db[_0xc4e5('0x41')]['findAll'](_0x23383b);})[_0xc4e5('0x25')](function(_0x46184f){_0x4805b2[_0xc4e5('0x42')]=_0x46184f;return _0x4805b2;})['then'](respondWithFilteredResult(_0x261b88,_0x23383b))[_0xc4e5('0x43')](handleError(_0x261b88,null));};exports[_0xc4e5('0x44')]=function(_0x1117e1,_0xba5c47){var _0x2ea4a8={'raw':![],'where':{'id':_0x1117e1[_0xc4e5('0x45')]['id']}},_0x409a3f={};_0x409a3f[_0xc4e5('0x33')]=_['keys'](db[_0xc4e5('0x41')][_0xc4e5('0x2b')]);_0x409a3f[_0xc4e5('0x2f')]=_[_0xc4e5('0x2e')](_0x1117e1[_0xc4e5('0x2f')]);_0x409a3f[_0xc4e5('0x30')]=_[_0xc4e5('0x31')](_0x409a3f[_0xc4e5('0x33')],_0x409a3f[_0xc4e5('0x2f')]);_0x2ea4a8[_0xc4e5('0x32')]=_[_0xc4e5('0x31')](_0x409a3f[_0xc4e5('0x33')],qs['fields'](_0x1117e1['query'][_0xc4e5('0x34')]));_0x2ea4a8[_0xc4e5('0x32')]=_0x2ea4a8[_0xc4e5('0x32')][_0xc4e5('0x35')]?_0x2ea4a8['attributes']:_0x409a3f[_0xc4e5('0x33')];if(_0x1117e1['query']['includeAll']){_0x2ea4a8[_0xc4e5('0x46')]=[{'all':!![]}];}_0x2ea4a8=_[_0xc4e5('0x3c')]({},_0x2ea4a8,_0x1117e1['options']);return db[_0xc4e5('0x41')]['find'](_0x2ea4a8)[_0xc4e5('0x25')](handleEntityNotFound(_0xba5c47,null))[_0xc4e5('0x25')](respondWithResult(_0xba5c47,null))[_0xc4e5('0x43')](handleError(_0xba5c47,null));};exports[_0xc4e5('0x47')]=function(_0xd73e5c,_0x347d7c){return db[_0xc4e5('0x41')][_0xc4e5('0x47')](_0xd73e5c[_0xc4e5('0x48')],{})['then'](respondWithResult(_0x347d7c,0xc9))[_0xc4e5('0x43')](handleError(_0x347d7c,null));};exports[_0xc4e5('0x49')]=function(_0x452a5e,_0x14614b){if(_0x452a5e[_0xc4e5('0x48')]['id']){delete _0x452a5e[_0xc4e5('0x48')]['id'];}return db[_0xc4e5('0x41')]['find']({'where':{'id':_0x452a5e[_0xc4e5('0x45')]['id']}})['then'](handleEntityNotFound(_0x14614b,null))[_0xc4e5('0x25')](saveUpdates(_0x452a5e[_0xc4e5('0x48')],null))['then'](respondWithResult(_0x14614b,null))[_0xc4e5('0x43')](handleError(_0x14614b,null));};exports[_0xc4e5('0x4a')]=function(_0x5c536c,_0x51e1d6){return db[_0xc4e5('0x41')][_0xc4e5('0x4b')]({'where':{'id':_0x5c536c[_0xc4e5('0x45')]['id']}})[_0xc4e5('0x25')](handleEntityNotFound(_0x51e1d6,null))['then'](removeEntity(_0x51e1d6,null))[_0xc4e5('0x43')](handleError(_0x51e1d6,null));};exports['getConfigurations']=function(_0x15fb9c,_0x466da5,_0x235d25){var _0x37bed4={};var _0x42c752={};var _0x4a7244;var _0x2c067c;return db[_0xc4e5('0x41')][_0xc4e5('0x4c')]({'where':{'id':_0x15fb9c[_0xc4e5('0x45')]['id']}})[_0xc4e5('0x25')](handleEntityNotFound(_0x466da5,null))[_0xc4e5('0x25')](function(_0x465e27){if(_0x465e27){_0x4a7244=_0x465e27;_0x42c752['model']=_[_0xc4e5('0x2e')](db[_0xc4e5('0x4d')][_0xc4e5('0x2b')]);_0x42c752[_0xc4e5('0x2f')]=_[_0xc4e5('0x2e')](_0x15fb9c[_0xc4e5('0x2f')]);_0x42c752[_0xc4e5('0x30')]=_[_0xc4e5('0x31')](_0x42c752[_0xc4e5('0x33')],_0x42c752[_0xc4e5('0x2f')]);_0x37bed4[_0xc4e5('0x32')]=_['intersection'](_0x42c752['model'],qs[_0xc4e5('0x34')](_0x15fb9c['query']['fields']));_0x37bed4[_0xc4e5('0x32')]=_0x37bed4[_0xc4e5('0x32')][_0xc4e5('0x35')]?_0x37bed4['attributes']:_0x42c752[_0xc4e5('0x33')];_0x37bed4[_0xc4e5('0x37')]=qs[_0xc4e5('0x38')](_0x15fb9c[_0xc4e5('0x2f')][_0xc4e5('0x38')]);_0x37bed4['where']=qs[_0xc4e5('0x30')](_[_0xc4e5('0x3a')](_0x15fb9c[_0xc4e5('0x2f')],_0x42c752[_0xc4e5('0x30')]));if(_0x15fb9c[_0xc4e5('0x2f')][_0xc4e5('0x3b')]){_0x37bed4[_0xc4e5('0x39')]=_[_0xc4e5('0x3c')](_0x37bed4[_0xc4e5('0x39')],{'$or':_[_0xc4e5('0x2a')](_0x37bed4[_0xc4e5('0x32')],function(_0x237c7f){var _0x66c974={};_0x66c974[_0x237c7f]={'$like':'%'+_0x15fb9c[_0xc4e5('0x2f')][_0xc4e5('0x3b')]+'%'};return _0x66c974;})});}_0x37bed4=_[_0xc4e5('0x3c')]({},_0x37bed4,_0x15fb9c[_0xc4e5('0x3f')]);return _0x4a7244[_0xc4e5('0x4e')](_0x37bed4);}})[_0xc4e5('0x25')](function(_0x505aae){if(_0x505aae){_0x2c067c=_0x505aae['length'];if(!_0x15fb9c[_0xc4e5('0x2f')]['hasOwnProperty'](_0xc4e5('0x4f'))){_0x37bed4[_0xc4e5('0x1f')]=qs[_0xc4e5('0x1f')](_0x15fb9c[_0xc4e5('0x2f')][_0xc4e5('0x1f')]);_0x37bed4[_0xc4e5('0x1d')]=qs[_0xc4e5('0x1d')](_0x15fb9c['query'][_0xc4e5('0x1d')]);}return _0x4a7244['getConfigurations'](_0x37bed4);}})[_0xc4e5('0x25')](function(_0x5dbeee){if(_0x5dbeee){return _0x5dbeee?{'count':_0x2c067c,'rows':_0x5dbeee}:null;}})[_0xc4e5('0x25')](respondWithResult(_0x466da5,null))['catch'](handleError(_0x466da5,null));};exports[_0xc4e5('0x50')]=function(_0x23a43e,_0xf776e0,_0x4b5a6a){if(_0x23a43e[_0xc4e5('0x48')]['id']){delete _0x23a43e['body']['id'];}return db[_0xc4e5('0x41')][_0xc4e5('0x4c')]({'where':{'id':_0x23a43e[_0xc4e5('0x45')]['id']}})[_0xc4e5('0x25')](handleEntityNotFound(_0xf776e0,null))[_0xc4e5('0x25')](function(_0x2d528b){if(_0x2d528b){_0x23a43e['body'][_0xc4e5('0x51')]=_0x2d528b['id'];_0x23a43e[_0xc4e5('0x48')][_0xc4e5('0x52')]=integrations[_0xc4e5('0x53')](_0x23a43e[_0xc4e5('0x48')][_0xc4e5('0x54')],_0x23a43e[_0xc4e5('0x48')][_0xc4e5('0x3d')]);_0x23a43e[_0xc4e5('0x48')][_0xc4e5('0x55')]=integrations[_0xc4e5('0x56')](_0x23a43e['body'][_0xc4e5('0x54')],_0x23a43e[_0xc4e5('0x48')]['type']);return db[_0xc4e5('0x4d')][_0xc4e5('0x47')](_0x23a43e[_0xc4e5('0x48')],{'include':[{'model':db[_0xc4e5('0x57')],'as':_0xc4e5('0x52')},{'model':db[_0xc4e5('0x57')],'as':'Descriptions'}]});}return null;})[_0xc4e5('0x25')](respondWithResult(_0xf776e0,null))[_0xc4e5('0x43')](handleError(_0xf776e0,null));};exports['getFields']=function(_0x37da48,_0x267886,_0x5d953b){var _0x4bc266='';return db[_0xc4e5('0x41')][_0xc4e5('0x4c')]({'where':{'id':_0x37da48[_0xc4e5('0x45')]['id']},'attributes':['id',_0xc4e5('0x58'),_0xc4e5('0x59')]})[_0xc4e5('0x25')](handleEntityNotFound(_0x267886,null))['then'](function(_0x5ba867){if(_0x5ba867){_0x4bc266=_0x5ba867[_0xc4e5('0x58')];var _0xc14634=_0x4bc266[_0xc4e5('0x5a')](-0x1);if(_0xc14634==='/'){_0x4bc266=_0x4bc266[_0xc4e5('0x5b')](0x0,_0x4bc266[_0xc4e5('0x5c')](_0xc14634));}return rp({'method':'GET','uri':util[_0xc4e5('0x5d')](_0xc4e5('0x5e'),_0x4bc266,_0xc4e5('0x5f')),'headers':{'Authorization':util[_0xc4e5('0x5d')]('Basic\x20%s',new Buffer(util[_0xc4e5('0x5d')]('%s:X',_0x5ba867[_0xc4e5('0x59')]))[_0xc4e5('0x60')](_0xc4e5('0x61')))},'json':!![]});}})['then'](function(_0x52e2e5){if(_0x52e2e5){var _0x5ad018=['requester',_0xc4e5('0x62'),_0xc4e5('0x63'),'description','status',_0xc4e5('0x64'),_0xc4e5('0x65'),'source',_0xc4e5('0x66'),_0xc4e5('0x65'),_0xc4e5('0x67')];_[_0xc4e5('0x68')](_0x52e2e5,function(_0x255e96){return _0x5ad018['includes'](_0x255e96[_0xc4e5('0x28')])||!_0x255e96[_0xc4e5('0x69')]&&_0x255e96[_0xc4e5('0x3d')]!==_0xc4e5('0x6a')&&_0x255e96['type']!=='custom_dropdown';});return{'count':_0x52e2e5[_0xc4e5('0x35')],'rows':_[_0xc4e5('0x2a')](_0x52e2e5,function(_0xec7a48){return{'id':_0xec7a48['name'],'name':_0xec7a48['label'],'custom':!_0xec7a48[_0xc4e5('0x69')],'options':_0xec7a48[_0xc4e5('0x6b')]?_['map'](_0xec7a48[_0xc4e5('0x6b')],function(_0x44367f){return{'name':_['capitalize'](_0x44367f),'value':_0x44367f};}):[]};})};}})['then'](respondWithResult(_0x267886,null))[_0xc4e5('0x43')](function(_0x213aa7){var _0x3492e6=_0x37da48[_0xc4e5('0x2f')][_0xc4e5('0x6c')]?0x1f4:_0x213aa7[_0xc4e5('0x6d')]||0x1f4;logger[_0xc4e5('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0xc4e5('0x6e'),_0x3492e6,JSON[_0xc4e5('0x6f')](_0x213aa7));delete _0x213aa7['name'];if(_0x3492e6===0x191){_0x3492e6=0x190;}_0x267886[_0xc4e5('0x21')](_0x3492e6)['send'](_0x37da48[_0xc4e5('0x2f')][_0xc4e5('0x6c')]?{'message':'Wrong\x20credentials','statusCode':_0x213aa7[_0xc4e5('0x6d')]}:_0x213aa7);});}; \ No newline at end of file +var _0x3ae9=['lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','undefined','count','limit','set','apply','reject','save','destroy','then','sendStatus','error','stack','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','FreshdeskAccount','findAll','rows','catch','show','params','include','options','find','create','body','update','findOne','FreshdeskConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri','slice','substring','lastIndexOf','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','toString','base64','subject','agent','priority','source','ticket_type','group','remove','custom_text','custom_dropdown','label','default','choices','capitalize','test','statusCode','stringify','Wrong\x20credentials','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','fs-extra'];(function(_0x5df10c,_0x5f1e5e){var _0x47228b=function(_0x482964){while(--_0x482964){_0x5df10c['push'](_0x5df10c['shift']());}};_0x47228b(++_0x5f1e5e);}(_0x3ae9,0xdb));var _0x93ae=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x3ae9[_0x297fd3];return _0x2af381;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x93ae('0x0'));var jsonpatch=require(_0x93ae('0x1'));var rp=require(_0x93ae('0x2'));var moment=require('moment');var BPromise=require(_0x93ae('0x3'));var Mustache=require(_0x93ae('0x4'));var util=require(_0x93ae('0x5'));var path=require(_0x93ae('0x6'));var sox=require('sox');var csv=require(_0x93ae('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x93ae('0x8'));var _=require(_0x93ae('0x9'));var squel=require(_0x93ae('0xa'));var crypto=require(_0x93ae('0xb'));var jsforce=require(_0x93ae('0xc'));var deskjs=require(_0x93ae('0xd'));var toCsv=require('to-csv');var querystring=require(_0x93ae('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x93ae('0xf'));var as=require(_0x93ae('0x10'));var hardwareService=require(_0x93ae('0x11'));var logger=require(_0x93ae('0x12'))(_0x93ae('0x13'));var utils=require(_0x93ae('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x93ae('0x15'))['db'];var integrations=require(_0x93ae('0x16'));function respondWithStatusCode(_0x4a9f52,_0x571e5f){_0x571e5f=_0x571e5f||0xcc;return function(_0x36f71a){if(_0x36f71a){return _0x4a9f52['sendStatus'](_0x571e5f);}return _0x4a9f52[_0x93ae('0x17')](_0x571e5f)[_0x93ae('0x18')]();};}function respondWithResult(_0x5b4ea1,_0x392a55){_0x392a55=_0x392a55||0xc8;return function(_0x7f8662){if(_0x7f8662){return _0x5b4ea1[_0x93ae('0x17')](_0x392a55)[_0x93ae('0x19')](_0x7f8662);}};}function respondWithFilteredResult(_0x121937,_0x2d1df5){return function(_0x5ed82a){if(_0x5ed82a){var _0x11a9ce=typeof _0x2d1df5[_0x93ae('0x1a')]===_0x93ae('0x1b')&&typeof _0x2d1df5['limit']===_0x93ae('0x1b');var _0x514a0c=_0x5ed82a['count'];var _0x1002b6=_0x11a9ce?0x0:_0x2d1df5['offset'];var _0x3a92e7=_0x11a9ce?_0x5ed82a[_0x93ae('0x1c')]:_0x2d1df5['offset']+_0x2d1df5[_0x93ae('0x1d')];var _0x31a8da;if(_0x3a92e7>=_0x514a0c){_0x3a92e7=_0x514a0c;_0x31a8da=0xc8;}else{_0x31a8da=0xce;}_0x121937[_0x93ae('0x17')](_0x31a8da);return _0x121937[_0x93ae('0x1e')]('Content-Range',_0x1002b6+'-'+_0x3a92e7+'/'+_0x514a0c)[_0x93ae('0x19')](_0x5ed82a);}return null;};}function patchUpdates(_0x2f4187){return function(_0x4cbf03){try{jsonpatch[_0x93ae('0x1f')](_0x4cbf03,_0x2f4187,!![]);}catch(_0x28d6fa){return BPromise[_0x93ae('0x20')](_0x28d6fa);}return _0x4cbf03[_0x93ae('0x21')]();};}function saveUpdates(_0x26d5ac,_0x468fdf){return function(_0xcdd84f){if(_0xcdd84f){return _0xcdd84f['update'](_0x26d5ac)['then'](function(_0xd33af5){return _0xd33af5;});}return null;};}function removeEntity(_0x283e50,_0x4f9f43){return function(_0x4d0c48){if(_0x4d0c48){return _0x4d0c48[_0x93ae('0x22')]()[_0x93ae('0x23')](function(){_0x283e50[_0x93ae('0x17')](0xcc)[_0x93ae('0x18')]();});}};}function handleEntityNotFound(_0x1abea7,_0xe17086){return function(_0x1970f4){if(!_0x1970f4){_0x1abea7[_0x93ae('0x24')](0x194);}return _0x1970f4;};}function handleError(_0x542656,_0x564c15){_0x564c15=_0x564c15||0x1f4;return function(_0x57dd01){logger[_0x93ae('0x25')](_0x57dd01[_0x93ae('0x26')]);if(_0x57dd01[_0x93ae('0x27')]){delete _0x57dd01[_0x93ae('0x27')];}_0x542656[_0x93ae('0x17')](_0x564c15)[_0x93ae('0x28')](_0x57dd01);};}exports['index']=function(_0x54a37b,_0x223f42){var _0x115ac5={},_0x1aa36c={},_0x3a4393={'count':0x0,'rows':[]};var _0x485622=_['map'](db['FreshdeskAccount'][_0x93ae('0x29')],function(_0x512d8f){return{'name':_0x512d8f[_0x93ae('0x2a')],'type':_0x512d8f[_0x93ae('0x2b')]['key']};});_0x1aa36c[_0x93ae('0x2c')]=_[_0x93ae('0x2d')](_0x485622,_0x93ae('0x27'));_0x1aa36c[_0x93ae('0x2e')]=_[_0x93ae('0x2f')](_0x54a37b[_0x93ae('0x2e')]);_0x1aa36c[_0x93ae('0x30')]=_[_0x93ae('0x31')](_0x1aa36c['model'],_0x1aa36c[_0x93ae('0x2e')]);_0x115ac5[_0x93ae('0x32')]=_[_0x93ae('0x31')](_0x1aa36c[_0x93ae('0x2c')],qs[_0x93ae('0x33')](_0x54a37b[_0x93ae('0x2e')][_0x93ae('0x33')]));_0x115ac5[_0x93ae('0x32')]=_0x115ac5['attributes'][_0x93ae('0x34')]?_0x115ac5['attributes']:_0x1aa36c[_0x93ae('0x2c')];if(!_0x54a37b[_0x93ae('0x2e')][_0x93ae('0x35')](_0x93ae('0x36'))){_0x115ac5[_0x93ae('0x1d')]=qs[_0x93ae('0x1d')](_0x54a37b['query'][_0x93ae('0x1d')]);_0x115ac5[_0x93ae('0x1a')]=qs[_0x93ae('0x1a')](_0x54a37b['query'][_0x93ae('0x1a')]);}_0x115ac5[_0x93ae('0x37')]=qs[_0x93ae('0x38')](_0x54a37b['query']['sort']);_0x115ac5[_0x93ae('0x39')]=qs[_0x93ae('0x30')](_[_0x93ae('0x3a')](_0x54a37b[_0x93ae('0x2e')],_0x1aa36c[_0x93ae('0x30')]),_0x485622);if(_0x54a37b[_0x93ae('0x2e')][_0x93ae('0x3b')]){_0x115ac5[_0x93ae('0x39')]=_[_0x93ae('0x3c')](_0x115ac5[_0x93ae('0x39')],{'$or':_[_0x93ae('0x2d')](_0x485622,function(_0x2650bf){if(_0x2650bf[_0x93ae('0x2b')]!==_0x93ae('0x3d')){var _0x5789e1={};_0x5789e1[_0x2650bf[_0x93ae('0x27')]]={'$like':'%'+_0x54a37b[_0x93ae('0x2e')]['filter']+'%'};return _0x5789e1;}})});}_0x115ac5=_[_0x93ae('0x3c')]({},_0x115ac5,_0x54a37b['options']);var _0x59867a={'where':_0x115ac5[_0x93ae('0x39')]};return db['FreshdeskAccount'][_0x93ae('0x1c')](_0x59867a)[_0x93ae('0x23')](function(_0x10f680){_0x3a4393[_0x93ae('0x1c')]=_0x10f680;if(_0x54a37b[_0x93ae('0x2e')][_0x93ae('0x3e')]){_0x115ac5['include']=[{'all':!![]}];}return db[_0x93ae('0x3f')][_0x93ae('0x40')](_0x115ac5);})[_0x93ae('0x23')](function(_0x1a8bee){_0x3a4393[_0x93ae('0x41')]=_0x1a8bee;return _0x3a4393;})[_0x93ae('0x23')](respondWithFilteredResult(_0x223f42,_0x115ac5))[_0x93ae('0x42')](handleError(_0x223f42,null));};exports[_0x93ae('0x43')]=function(_0x6865d7,_0x3fc8a2){var _0x3ba904={'raw':![],'where':{'id':_0x6865d7[_0x93ae('0x44')]['id']}},_0x4a2ead={};_0x4a2ead[_0x93ae('0x2c')]=_['keys'](db['FreshdeskAccount'][_0x93ae('0x29')]);_0x4a2ead[_0x93ae('0x2e')]=_[_0x93ae('0x2f')](_0x6865d7[_0x93ae('0x2e')]);_0x4a2ead[_0x93ae('0x30')]=_[_0x93ae('0x31')](_0x4a2ead[_0x93ae('0x2c')],_0x4a2ead[_0x93ae('0x2e')]);_0x3ba904['attributes']=_[_0x93ae('0x31')](_0x4a2ead[_0x93ae('0x2c')],qs[_0x93ae('0x33')](_0x6865d7[_0x93ae('0x2e')][_0x93ae('0x33')]));_0x3ba904['attributes']=_0x3ba904['attributes'][_0x93ae('0x34')]?_0x3ba904['attributes']:_0x4a2ead[_0x93ae('0x2c')];if(_0x6865d7['query']['includeAll']){_0x3ba904[_0x93ae('0x45')]=[{'all':!![]}];}_0x3ba904=_[_0x93ae('0x3c')]({},_0x3ba904,_0x6865d7[_0x93ae('0x46')]);return db[_0x93ae('0x3f')][_0x93ae('0x47')](_0x3ba904)[_0x93ae('0x23')](handleEntityNotFound(_0x3fc8a2,null))[_0x93ae('0x23')](respondWithResult(_0x3fc8a2,null))['catch'](handleError(_0x3fc8a2,null));};exports[_0x93ae('0x48')]=function(_0x490ce3,_0x57110d){return db[_0x93ae('0x3f')][_0x93ae('0x48')](_0x490ce3[_0x93ae('0x49')],{})[_0x93ae('0x23')](respondWithResult(_0x57110d,0xc9))['catch'](handleError(_0x57110d,null));};exports[_0x93ae('0x4a')]=function(_0x4e7652,_0x57136a){if(_0x4e7652[_0x93ae('0x49')]['id']){delete _0x4e7652[_0x93ae('0x49')]['id'];}return db[_0x93ae('0x3f')][_0x93ae('0x47')]({'where':{'id':_0x4e7652[_0x93ae('0x44')]['id']}})[_0x93ae('0x23')](handleEntityNotFound(_0x57136a,null))[_0x93ae('0x23')](saveUpdates(_0x4e7652[_0x93ae('0x49')],null))['then'](respondWithResult(_0x57136a,null))['catch'](handleError(_0x57136a,null));};exports['destroy']=function(_0x4ddece,_0x5f11ab){return db[_0x93ae('0x3f')][_0x93ae('0x47')]({'where':{'id':_0x4ddece[_0x93ae('0x44')]['id']}})[_0x93ae('0x23')](handleEntityNotFound(_0x5f11ab,null))['then'](removeEntity(_0x5f11ab,null))[_0x93ae('0x42')](handleError(_0x5f11ab,null));};exports['getConfigurations']=function(_0x283518,_0x2d2089,_0x3553d3){var _0xbe41ce={};var _0x4732bd={};var _0xd4479a;var _0x161f30;return db[_0x93ae('0x3f')][_0x93ae('0x4b')]({'where':{'id':_0x283518['params']['id']}})[_0x93ae('0x23')](handleEntityNotFound(_0x2d2089,null))['then'](function(_0x2b1aa2){if(_0x2b1aa2){_0xd4479a=_0x2b1aa2;_0x4732bd[_0x93ae('0x2c')]=_[_0x93ae('0x2f')](db[_0x93ae('0x4c')][_0x93ae('0x29')]);_0x4732bd[_0x93ae('0x2e')]=_[_0x93ae('0x2f')](_0x283518['query']);_0x4732bd[_0x93ae('0x30')]=_['intersection'](_0x4732bd['model'],_0x4732bd[_0x93ae('0x2e')]);_0xbe41ce[_0x93ae('0x32')]=_['intersection'](_0x4732bd[_0x93ae('0x2c')],qs[_0x93ae('0x33')](_0x283518[_0x93ae('0x2e')][_0x93ae('0x33')]));_0xbe41ce[_0x93ae('0x32')]=_0xbe41ce[_0x93ae('0x32')][_0x93ae('0x34')]?_0xbe41ce[_0x93ae('0x32')]:_0x4732bd[_0x93ae('0x2c')];_0xbe41ce[_0x93ae('0x37')]=qs[_0x93ae('0x38')](_0x283518['query'][_0x93ae('0x38')]);_0xbe41ce[_0x93ae('0x39')]=qs[_0x93ae('0x30')](_[_0x93ae('0x3a')](_0x283518[_0x93ae('0x2e')],_0x4732bd[_0x93ae('0x30')]));if(_0x283518['query'][_0x93ae('0x3b')]){_0xbe41ce[_0x93ae('0x39')]=_[_0x93ae('0x3c')](_0xbe41ce[_0x93ae('0x39')],{'$or':_[_0x93ae('0x2d')](_0xbe41ce['attributes'],function(_0x1a6897){var _0x3ccef1={};_0x3ccef1[_0x1a6897]={'$like':'%'+_0x283518[_0x93ae('0x2e')]['filter']+'%'};return _0x3ccef1;})});}_0xbe41ce=_[_0x93ae('0x3c')]({},_0xbe41ce,_0x283518[_0x93ae('0x46')]);return _0xd4479a['getConfigurations'](_0xbe41ce);}})[_0x93ae('0x23')](function(_0x45ff85){if(_0x45ff85){_0x161f30=_0x45ff85[_0x93ae('0x34')];if(!_0x283518[_0x93ae('0x2e')][_0x93ae('0x35')](_0x93ae('0x36'))){_0xbe41ce[_0x93ae('0x1d')]=qs['limit'](_0x283518[_0x93ae('0x2e')]['limit']);_0xbe41ce['offset']=qs[_0x93ae('0x1a')](_0x283518[_0x93ae('0x2e')]['offset']);}return _0xd4479a[_0x93ae('0x4d')](_0xbe41ce);}})[_0x93ae('0x23')](function(_0x5ffdeb){if(_0x5ffdeb){return _0x5ffdeb?{'count':_0x161f30,'rows':_0x5ffdeb}:null;}})[_0x93ae('0x23')](respondWithResult(_0x2d2089,null))[_0x93ae('0x42')](handleError(_0x2d2089,null));};exports[_0x93ae('0x4e')]=function(_0x3323c5,_0x195e07,_0x204378){if(_0x3323c5['body']['id']){delete _0x3323c5['body']['id'];}return db[_0x93ae('0x3f')][_0x93ae('0x4b')]({'where':{'id':_0x3323c5[_0x93ae('0x44')]['id']}})[_0x93ae('0x23')](handleEntityNotFound(_0x195e07,null))[_0x93ae('0x23')](function(_0x20f2af){if(_0x20f2af){_0x3323c5[_0x93ae('0x49')]['AccountId']=_0x20f2af['id'];_0x3323c5['body'][_0x93ae('0x4f')]=integrations[_0x93ae('0x50')](_0x3323c5[_0x93ae('0x49')][_0x93ae('0x51')],_0x3323c5[_0x93ae('0x49')][_0x93ae('0x2b')]);_0x3323c5[_0x93ae('0x49')][_0x93ae('0x52')]=integrations[_0x93ae('0x53')](_0x3323c5['body'][_0x93ae('0x51')],_0x3323c5['body']['type']);return db[_0x93ae('0x4c')][_0x93ae('0x48')](_0x3323c5[_0x93ae('0x49')],{'include':[{'model':db[_0x93ae('0x54')],'as':_0x93ae('0x4f')},{'model':db[_0x93ae('0x54')],'as':_0x93ae('0x52')}]});}return null;})[_0x93ae('0x23')](respondWithResult(_0x195e07,null))[_0x93ae('0x42')](handleError(_0x195e07,null));};exports[_0x93ae('0x55')]=function(_0x37aab7,_0x24e2d8,_0x540324){var _0x5b5b5a='';return db[_0x93ae('0x3f')][_0x93ae('0x4b')]({'where':{'id':_0x37aab7[_0x93ae('0x44')]['id']},'attributes':['id','remoteUri',_0x93ae('0x56')]})[_0x93ae('0x23')](handleEntityNotFound(_0x24e2d8,null))[_0x93ae('0x23')](function(_0x4d1693){if(_0x4d1693){_0x5b5b5a=_0x4d1693[_0x93ae('0x57')];var _0x3dceb5=_0x5b5b5a[_0x93ae('0x58')](-0x1);if(_0x3dceb5==='/'){_0x5b5b5a=_0x5b5b5a[_0x93ae('0x59')](0x0,_0x5b5b5a[_0x93ae('0x5a')](_0x3dceb5));}return rp({'method':'GET','uri':util[_0x93ae('0x5b')](_0x93ae('0x5c'),_0x5b5b5a,_0x93ae('0x5d')),'headers':{'Authorization':util['format'](_0x93ae('0x5e'),new Buffer(util[_0x93ae('0x5b')]('%s:X',_0x4d1693[_0x93ae('0x56')]))[_0x93ae('0x5f')](_0x93ae('0x60')))},'json':!![]});}})[_0x93ae('0x23')](function(_0x563fe6){if(_0x563fe6){var _0x26fd6e=['requester',_0x93ae('0x61'),_0x93ae('0x62'),'description',_0x93ae('0x17'),_0x93ae('0x63'),'group',_0x93ae('0x64'),_0x93ae('0x65'),_0x93ae('0x66'),'company'];_[_0x93ae('0x67')](_0x563fe6,function(_0x5d8282){return _0x26fd6e['includes'](_0x5d8282[_0x93ae('0x27')])||!_0x5d8282['default']&&_0x5d8282[_0x93ae('0x2b')]!==_0x93ae('0x68')&&_0x5d8282[_0x93ae('0x2b')]!==_0x93ae('0x69');});return{'count':_0x563fe6[_0x93ae('0x34')],'rows':_[_0x93ae('0x2d')](_0x563fe6,function(_0x3db0e7){return{'id':_0x3db0e7[_0x93ae('0x27')],'name':_0x3db0e7[_0x93ae('0x6a')],'custom':!_0x3db0e7[_0x93ae('0x6b')],'options':_0x3db0e7['choices']?_['map'](_0x3db0e7[_0x93ae('0x6c')],function(_0x470662){return{'name':_[_0x93ae('0x6d')](_0x470662),'value':_0x470662};}):[]};})};}})[_0x93ae('0x23')](respondWithResult(_0x24e2d8,null))[_0x93ae('0x42')](function(_0x574c2c){var _0x91668=_0x37aab7[_0x93ae('0x2e')][_0x93ae('0x6e')]?0x1f4:_0x574c2c[_0x93ae('0x6f')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x91668,JSON[_0x93ae('0x70')](_0x574c2c));delete _0x574c2c['name'];if(_0x91668===0x191){_0x91668=0x190;}_0x24e2d8[_0x93ae('0x17')](_0x91668)[_0x93ae('0x28')](_0x37aab7['query'][_0x93ae('0x6e')]?{'message':_0x93ae('0x71'),'statusCode':_0x574c2c[_0x93ae('0x6f')]}:_0x574c2c);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index fc70dea..b15e400 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 _0xad5e=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','int_freshdesk_accounts','lodash','util','../../config/logger','moment'];(function(_0x56fd29,_0x17790b){var _0x2a0bf7=function(_0x568f20){while(--_0x568f20){_0x56fd29['push'](_0x56fd29['shift']());}};_0x2a0bf7(++_0x17790b);}(_0xad5e,0x68));var _0xead5=function(_0x529bde,_0x32d640){_0x529bde=_0x529bde-0x0;var _0xb7109c=_0xad5e[_0x529bde];return _0xb7109c;};'use strict';var _=require(_0xead5('0x0'));var util=require(_0xead5('0x1'));var logger=require(_0xead5('0x2'))('api');var moment=require(_0xead5('0x3'));var BPromise=require(_0xead5('0x4'));var rp=require(_0xead5('0x5'));var fs=require('fs');var path=require(_0xead5('0x6'));var rimraf=require(_0xead5('0x7'));var config=require(_0xead5('0x8'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xead5('0x9')]=function(_0x3dc137,_0x236585){return _0x3dc137[_0xead5('0xa')]('FreshdeskAccount',attributes,{'tableName':_0xead5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x12d0=['request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','FreshdeskAccount','int_freshdesk_accounts','lodash','util','moment','bluebird'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0x12d0,0x188));var _0x012d=function(_0x579d9e,_0x36f172){_0x579d9e=_0x579d9e-0x0;var _0x246ec1=_0x12d0[_0x579d9e];return _0x246ec1;};'use strict';var _=require(_0x012d('0x0'));var util=require(_0x012d('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x012d('0x2'));var BPromise=require(_0x012d('0x3'));var rp=require(_0x012d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x012d('0x5'));var config=require(_0x012d('0x6'));var attributes=require(_0x012d('0x7'));var integrations=require(_0x012d('0x8'));module[_0x012d('0x9')]=function(_0x213c6d,_0x2a0856){return _0x213c6d['define'](_0x012d('0xa'),attributes,{'tableName':_0x012d('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 3565a35..680efde 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 _0x7aa7=['limit','include','map','model','attributes','ShowFreshdeskAccount','find','raw','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where'];(function(_0x4a0355,_0xd5f57){var _0x40727b=function(_0x501ab7){while(--_0x501ab7){_0x4a0355['push'](_0x4a0355['shift']());}};_0x40727b(++_0xd5f57);}(_0x7aa7,0xfd));var _0x77aa=function(_0x56ca45,_0x4b2e91){_0x56ca45=_0x56ca45-0x0;var _0x588fd4=_0x7aa7[_0x56ca45];return _0x588fd4;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x77aa('0x0'));var BPromise=require(_0x77aa('0x1'));var rs=require(_0x77aa('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x77aa('0x3'))['db'];var utils=require(_0x77aa('0x4'));var logger=require(_0x77aa('0x5'))(_0x77aa('0x6'));var config=require(_0x77aa('0x7'));var jayson=require(_0x77aa('0x8'));var client=jayson[_0x77aa('0x9')][_0x77aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x549193,_0x45a4f1,_0x16aae6){return new BPromise(function(_0x4e28b,_0x62d7a7){return client[_0x77aa('0xb')](_0x549193,_0x16aae6)[_0x77aa('0xc')](function(_0x2e837b){logger['info'](_0x77aa('0xd'),_0x45a4f1,'request\x20sent');logger['debug'](_0x77aa('0xe'),_0x45a4f1,_0x77aa('0xf'),JSON[_0x77aa('0x10')](_0x2e837b));if(_0x2e837b[_0x77aa('0x11')]){if(_0x2e837b[_0x77aa('0x11')]['code']===0x1f4){logger[_0x77aa('0x11')](_0x77aa('0xd'),_0x45a4f1,_0x2e837b[_0x77aa('0x11')][_0x77aa('0x12')]);return _0x62d7a7(_0x2e837b['error'][_0x77aa('0x12')]);}logger[_0x77aa('0x11')](_0x77aa('0xd'),_0x45a4f1,_0x2e837b['error'][_0x77aa('0x12')]);return _0x4e28b(_0x2e837b['error'][_0x77aa('0x12')]);}else{logger[_0x77aa('0x13')](_0x77aa('0xd'),_0x45a4f1,_0x77aa('0xf'));_0x4e28b(_0x2e837b[_0x77aa('0x14')][_0x77aa('0x12')]);}})[_0x77aa('0x15')](function(_0x2f8d7d){logger[_0x77aa('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x45a4f1,_0x2f8d7d);_0x62d7a7(_0x2f8d7d);});});}exports[_0x77aa('0x16')]=function(_0x2febb6){var _0x2f51fe=this;return new Promise(function(_0x609e37,_0x56f087){return db[_0x77aa('0x17')][_0x77aa('0x18')]({'raw':_0x2febb6[_0x77aa('0x19')]?_0x2febb6[_0x77aa('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2febb6[_0x77aa('0x19')]?_0x2febb6['options'][_0x77aa('0x1a')]||null:null,'attributes':_0x2febb6[_0x77aa('0x19')]?_0x2febb6['options']['attributes']||null:null,'limit':_0x2febb6[_0x77aa('0x19')]?_0x2febb6[_0x77aa('0x19')][_0x77aa('0x1b')]||null:null,'include':_0x2febb6[_0x77aa('0x19')]?_0x2febb6['options'][_0x77aa('0x1c')]?_[_0x77aa('0x1d')](_0x2febb6[_0x77aa('0x19')]['include'],function(_0x5af6b9){return{'model':db[_0x5af6b9[_0x77aa('0x1e')]],'as':_0x5af6b9['as'],'attributes':_0x5af6b9['attributes'],'include':_0x5af6b9['include']?_['map'](_0x5af6b9[_0x77aa('0x1c')],function(_0x445c45){return{'model':db[_0x445c45[_0x77aa('0x1e')]],'as':_0x445c45['as'],'attributes':_0x445c45[_0x77aa('0x1f')],'include':_0x445c45[_0x77aa('0x1c')]?_[_0x77aa('0x1d')](_0x445c45[_0x77aa('0x1c')],function(_0x286691){return{'model':db[_0x286691['model']],'as':_0x286691['as'],'attributes':_0x286691[_0x77aa('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x77aa('0xc')](function(_0x3eb851){logger['info']('GetFreshdeskAccount',_0x2febb6);logger['debug'](_0x77aa('0x16'),_0x2febb6,JSON['stringify'](_0x3eb851));_0x609e37(_0x3eb851);})['catch'](function(_0x58f427){logger['error'](_0x77aa('0x16'),_0x58f427[_0x77aa('0x12')],_0x2febb6);_0x56f087(_0x2f51fe['error'](0x1f4,_0x58f427['message']));});});};exports[_0x77aa('0x20')]=function(_0x1ec1ab){var _0x5c29b0=this;return new Promise(function(_0xab7732,_0x26e0db){return db['FreshdeskAccount'][_0x77aa('0x21')]({'raw':_0x1ec1ab[_0x77aa('0x19')]?_0x1ec1ab['options'][_0x77aa('0x22')]===undefined?!![]:![]:!![],'where':_0x1ec1ab[_0x77aa('0x19')]?_0x1ec1ab[_0x77aa('0x19')][_0x77aa('0x1a')]||null:null,'attributes':_0x1ec1ab[_0x77aa('0x19')]?_0x1ec1ab[_0x77aa('0x19')][_0x77aa('0x1f')]||null:null,'include':_0x1ec1ab['options']?_0x1ec1ab[_0x77aa('0x19')]['include']?_[_0x77aa('0x1d')](_0x1ec1ab['options']['include'],function(_0x32594f){return{'model':db[_0x32594f[_0x77aa('0x1e')]],'as':_0x32594f['as'],'attributes':_0x32594f['attributes'],'include':_0x32594f[_0x77aa('0x1c')]?_[_0x77aa('0x1d')](_0x32594f[_0x77aa('0x1c')],function(_0x418e04){return{'model':db[_0x418e04[_0x77aa('0x1e')]],'as':_0x418e04['as'],'attributes':_0x418e04[_0x77aa('0x1f')],'include':_0x418e04[_0x77aa('0x1c')]?_[_0x77aa('0x1d')](_0x418e04[_0x77aa('0x1c')],function(_0x32bc30){return{'model':db[_0x32bc30[_0x77aa('0x1e')]],'as':_0x32bc30['as'],'attributes':_0x32bc30['attributes']};}):[]};}):[]};}):[]:[]})[_0x77aa('0xc')](function(_0x46553d){logger[_0x77aa('0x13')](_0x77aa('0x20'),_0x1ec1ab);logger['debug'](_0x77aa('0x20'),_0x1ec1ab,JSON[_0x77aa('0x10')](_0x46553d));_0xab7732(_0x46553d);})['catch'](function(_0x5c5ea3){logger[_0x77aa('0x11')]('ShowFreshdeskAccount',_0x5c5ea3['message'],_0x1ec1ab);_0x26e0db(_0x5c29b0['error'](0x1f4,_0x5c5ea3[_0x77aa('0x12')]));});});}; \ No newline at end of file +var _0x6c70=['find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','info','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','catch','GetFreshdeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','then','ShowFreshdeskAccount','FreshdeskAccount'];(function(_0x2bd88d,_0x2d5dc3){var _0x5516d4=function(_0x1272c8){while(--_0x1272c8){_0x2bd88d['push'](_0x2bd88d['shift']());}};_0x5516d4(++_0x2d5dc3);}(_0x6c70,0x1f0));var _0x06c7=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x6c70[_0x2763f2];return _0x3ef471;};'use strict';var _=require('lodash');var util=require(_0x06c7('0x0'));var moment=require('moment');var BPromise=require(_0x06c7('0x1'));var rs=require(_0x06c7('0x2'));var fs=require('fs');var Redis=require(_0x06c7('0x3'));var db=require(_0x06c7('0x4'))['db'];var utils=require(_0x06c7('0x5'));var logger=require('../../config/logger')(_0x06c7('0x6'));var config=require(_0x06c7('0x7'));var jayson=require(_0x06c7('0x8'));var client=jayson[_0x06c7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e92c0,_0x5ee2bc,_0x1cea79){return new BPromise(function(_0x506364,_0x4fe039){return client['request'](_0x4e92c0,_0x1cea79)['then'](function(_0xfd0a3b){logger[_0x06c7('0xa')]('FreshdeskAccount,\x20%s,\x20%s',_0x5ee2bc,'request\x20sent');logger[_0x06c7('0xb')](_0x06c7('0xc'),_0x5ee2bc,'request\x20sent',JSON[_0x06c7('0xd')](_0xfd0a3b));if(_0xfd0a3b[_0x06c7('0xe')]){if(_0xfd0a3b[_0x06c7('0xe')]['code']===0x1f4){logger[_0x06c7('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x5ee2bc,_0xfd0a3b[_0x06c7('0xe')]['message']);return _0x4fe039(_0xfd0a3b[_0x06c7('0xe')][_0x06c7('0xf')]);}logger[_0x06c7('0xe')](_0x06c7('0x10'),_0x5ee2bc,_0xfd0a3b[_0x06c7('0xe')][_0x06c7('0xf')]);return _0x506364(_0xfd0a3b[_0x06c7('0xe')][_0x06c7('0xf')]);}else{logger[_0x06c7('0xa')](_0x06c7('0x10'),_0x5ee2bc,_0x06c7('0x11'));_0x506364(_0xfd0a3b['result'][_0x06c7('0xf')]);}})[_0x06c7('0x12')](function(_0x51c898){logger['error'](_0x06c7('0x10'),_0x5ee2bc,_0x51c898);_0x4fe039(_0x51c898);});});}exports[_0x06c7('0x13')]=function(_0x96a716){var _0x472607=this;return new Promise(function(_0x158664,_0x2dd2f6){return db['FreshdeskAccount'][_0x06c7('0x14')]({'raw':_0x96a716[_0x06c7('0x15')]?_0x96a716[_0x06c7('0x15')][_0x06c7('0x16')]===undefined?!![]:![]:!![],'where':_0x96a716[_0x06c7('0x15')]?_0x96a716[_0x06c7('0x15')][_0x06c7('0x17')]||null:null,'attributes':_0x96a716['options']?_0x96a716[_0x06c7('0x15')]['attributes']||null:null,'limit':_0x96a716[_0x06c7('0x15')]?_0x96a716['options'][_0x06c7('0x18')]||null:null,'include':_0x96a716[_0x06c7('0x15')]?_0x96a716[_0x06c7('0x15')][_0x06c7('0x19')]?_[_0x06c7('0x1a')](_0x96a716['options'][_0x06c7('0x19')],function(_0x5b2712){return{'model':db[_0x5b2712[_0x06c7('0x1b')]],'as':_0x5b2712['as'],'attributes':_0x5b2712[_0x06c7('0x1c')],'include':_0x5b2712['include']?_['map'](_0x5b2712['include'],function(_0x17dc4b){return{'model':db[_0x17dc4b[_0x06c7('0x1b')]],'as':_0x17dc4b['as'],'attributes':_0x17dc4b[_0x06c7('0x1c')],'include':_0x17dc4b[_0x06c7('0x19')]?_['map'](_0x17dc4b[_0x06c7('0x19')],function(_0x273ce7){return{'model':db[_0x273ce7[_0x06c7('0x1b')]],'as':_0x273ce7['as'],'attributes':_0x273ce7[_0x06c7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x06c7('0x1d')](function(_0x1c1c19){logger[_0x06c7('0xa')](_0x06c7('0x13'),_0x96a716);logger[_0x06c7('0xb')](_0x06c7('0x13'),_0x96a716,JSON[_0x06c7('0xd')](_0x1c1c19));_0x158664(_0x1c1c19);})[_0x06c7('0x12')](function(_0x45aad5){logger['error'](_0x06c7('0x13'),_0x45aad5[_0x06c7('0xf')],_0x96a716);_0x2dd2f6(_0x472607[_0x06c7('0xe')](0x1f4,_0x45aad5[_0x06c7('0xf')]));});});};exports[_0x06c7('0x1e')]=function(_0x1fe4f1){var _0x497131=this;return new Promise(function(_0x59849b,_0x3d0ca7){return db[_0x06c7('0x1f')][_0x06c7('0x20')]({'raw':_0x1fe4f1[_0x06c7('0x15')]?_0x1fe4f1[_0x06c7('0x15')][_0x06c7('0x16')]===undefined?!![]:![]:!![],'where':_0x1fe4f1[_0x06c7('0x15')]?_0x1fe4f1[_0x06c7('0x15')][_0x06c7('0x17')]||null:null,'attributes':_0x1fe4f1[_0x06c7('0x15')]?_0x1fe4f1['options'][_0x06c7('0x1c')]||null:null,'include':_0x1fe4f1[_0x06c7('0x15')]?_0x1fe4f1[_0x06c7('0x15')][_0x06c7('0x19')]?_['map'](_0x1fe4f1[_0x06c7('0x15')][_0x06c7('0x19')],function(_0x5a661d){return{'model':db[_0x5a661d[_0x06c7('0x1b')]],'as':_0x5a661d['as'],'attributes':_0x5a661d[_0x06c7('0x1c')],'include':_0x5a661d[_0x06c7('0x19')]?_['map'](_0x5a661d[_0x06c7('0x19')],function(_0xdb84a5){return{'model':db[_0xdb84a5[_0x06c7('0x1b')]],'as':_0xdb84a5['as'],'attributes':_0xdb84a5[_0x06c7('0x1c')],'include':_0xdb84a5[_0x06c7('0x19')]?_[_0x06c7('0x1a')](_0xdb84a5[_0x06c7('0x19')],function(_0x229745){return{'model':db[_0x229745[_0x06c7('0x1b')]],'as':_0x229745['as'],'attributes':_0x229745[_0x06c7('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x06c7('0x1d')](function(_0x48dbcf){logger[_0x06c7('0xa')]('ShowFreshdeskAccount',_0x1fe4f1);logger[_0x06c7('0xb')](_0x06c7('0x1e'),_0x1fe4f1,JSON[_0x06c7('0xd')](_0x48dbcf));_0x59849b(_0x48dbcf);})['catch'](function(_0x61d0e9){logger['error'](_0x06c7('0x1e'),_0x61d0e9[_0x06c7('0xf')],_0x1fe4f1);_0x3d0ca7(_0x497131[_0x06c7('0xe')](0x1f4,_0x61d0e9[_0x06c7('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 0ececfd..dba408b 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 _0x7c94=['fs-extra','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x24c2e3,_0x988100){var _0xf129fc=function(_0x268069){while(--_0x268069){_0x24c2e3['push'](_0x24c2e3['shift']());}};_0xf129fc(++_0x988100);}(_0x7c94,0x119));var _0x47c9=function(_0x2c66ed,_0x158377){_0x2c66ed=_0x2c66ed-0x0;var _0x2f0974=_0x7c94[_0x2c66ed];return _0x2f0974;};'use strict';var multer=require(_0x47c9('0x0'));var util=require(_0x47c9('0x1'));var path=require(_0x47c9('0x2'));var timeout=require(_0x47c9('0x3'));var express=require(_0x47c9('0x4'));var router=express['Router']();var fs_extra=require(_0x47c9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x47c9('0x6'));var config=require('../../config/environment');var controller=require(_0x47c9('0x7'));router[_0x47c9('0x8')]('/',auth[_0x47c9('0x9')](),controller[_0x47c9('0xa')]);router[_0x47c9('0x8')](_0x47c9('0xb'),auth[_0x47c9('0x9')](),controller[_0x47c9('0xc')]);router[_0x47c9('0x8')](_0x47c9('0xd'),auth[_0x47c9('0x9')](),controller[_0x47c9('0xe')]);router[_0x47c9('0x8')]('/:id/subjects',auth[_0x47c9('0x9')](),controller[_0x47c9('0xf')]);router[_0x47c9('0x8')](_0x47c9('0x10'),auth[_0x47c9('0x9')](),controller[_0x47c9('0x11')]);router['get'](_0x47c9('0x12'),auth[_0x47c9('0x9')](),controller[_0x47c9('0x13')]);router[_0x47c9('0x14')]('/',auth['isAuthenticated'](),controller[_0x47c9('0x15')]);router[_0x47c9('0x14')](_0x47c9('0x12'),auth[_0x47c9('0x9')](),controller['setTags']);router[_0x47c9('0x16')](_0x47c9('0xb'),auth[_0x47c9('0x9')](),controller[_0x47c9('0x17')]);router['delete'](_0x47c9('0xb'),auth[_0x47c9('0x9')](),controller[_0x47c9('0x18')]);module[_0x47c9('0x19')]=router; \ No newline at end of file +var _0x9d09=['multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','setTags','put','/:id','update','delete','destroy','exports'];(function(_0x2e4cbf,_0x8763d3){var _0x52840f=function(_0x31b93f){while(--_0x31b93f){_0x2e4cbf['push'](_0x2e4cbf['shift']());}};_0x52840f(++_0x8763d3);}(_0x9d09,0xb6));var _0x99d0=function(_0x58ba97,_0x4d0187){_0x58ba97=_0x58ba97-0x0;var _0x34110e=_0x9d09[_0x58ba97];return _0x34110e;};'use strict';var multer=require(_0x99d0('0x0'));var util=require(_0x99d0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x99d0('0x2'));var router=express['Router']();var fs_extra=require(_0x99d0('0x3'));var auth=require(_0x99d0('0x4'));var interaction=require(_0x99d0('0x5'));var config=require('../../config/environment');var controller=require(_0x99d0('0x6'));router[_0x99d0('0x7')]('/',auth[_0x99d0('0x8')](),controller[_0x99d0('0x9')]);router[_0x99d0('0x7')]('/:id',auth[_0x99d0('0x8')](),controller[_0x99d0('0xa')]);router[_0x99d0('0x7')](_0x99d0('0xb'),auth['isAuthenticated'](),controller[_0x99d0('0xc')]);router[_0x99d0('0x7')](_0x99d0('0xd'),auth[_0x99d0('0x8')](),controller['getSubjects']);router[_0x99d0('0x7')](_0x99d0('0xe'),auth[_0x99d0('0x8')](),controller[_0x99d0('0xf')]);router[_0x99d0('0x7')](_0x99d0('0x10'),auth['isAuthenticated'](),controller['getTags']);router[_0x99d0('0x11')]('/',auth['isAuthenticated'](),controller[_0x99d0('0x12')]);router[_0x99d0('0x11')](_0x99d0('0x10'),auth['isAuthenticated'](),controller[_0x99d0('0x13')]);router[_0x99d0('0x14')](_0x99d0('0x15'),auth[_0x99d0('0x8')](),controller[_0x99d0('0x16')]);router[_0x99d0('0x17')](_0x99d0('0x15'),auth[_0x99d0('0x8')](),controller[_0x99d0('0x18')]);module[_0x99d0('0x19')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 6f6db7a..f7aff2c 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 _0xb61a=['exports','STRING'];(function(_0x412c8f,_0x11ec94){var _0x27c005=function(_0x127059){while(--_0x127059){_0x412c8f['push'](_0x412c8f['shift']());}};_0x27c005(++_0x11ec94);}(_0xb61a,0xfa));var _0xab61=function(_0x335b86,_0x848570){_0x335b86=_0x335b86-0x0;var _0x47f662=_0xb61a[_0x335b86];return _0x47f662;};'use strict';var Sequelize=require('sequelize');module[_0xab61('0x0')]={'name':{'type':Sequelize[_0xab61('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1801=['sequelize'];(function(_0x24883d,_0x1988b7){var _0x30929c=function(_0x35627c){while(--_0x35627c){_0x24883d['push'](_0x24883d['shift']());}};_0x30929c(++_0x1988b7);}(_0x1801,0x159));var _0x1180=function(_0x1fe0be,_0x4670da){_0x1fe0be=_0x1fe0be-0x0;var _0x2bf403=_0x1801[_0x1fe0be];return _0x2bf403;};'use strict';var Sequelize=require(_0x1180('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index e29e0fb..e45286c 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 _0x9514=['reject','then','error','stack','name','send','index','map','FreshdeskConfiguration','fieldName','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','include','findAll','rows','show','params','rawAttributes','fields','includeAll','options','find','catch','create','body','update','findOne','FreshdeskField','order','pick','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','count','Content-Range','json','apply'];(function(_0x4a7a63,_0x529128){var _0x682e4e=function(_0x2179d5){while(--_0x2179d5){_0x4a7a63['push'](_0x4a7a63['shift']());}};_0x682e4e(++_0x529128);}(_0x9514,0x129));var _0x4951=function(_0x27aa1d,_0x211021){_0x27aa1d=_0x27aa1d-0x0;var _0x46deb2=_0x9514[_0x27aa1d];return _0x46deb2;};'use strict';var emlformat=require(_0x4951('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4951('0x1'));var jsonpatch=require(_0x4951('0x2'));var rp=require(_0x4951('0x3'));var moment=require(_0x4951('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x4951('0x5'));var sox=require(_0x4951('0x6'));var csv=require(_0x4951('0x7'));var ejs=require(_0x4951('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4951('0x9'));var squel=require(_0x4951('0xa'));var crypto=require(_0x4951('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4951('0xc'));var Redis=require(_0x4951('0xd'));var authService=require(_0x4951('0xe'));var qs=require(_0x4951('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4951('0x10'));var logger=require(_0x4951('0x11'))(_0x4951('0x12'));var utils=require(_0x4951('0x13'));var config=require(_0x4951('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x4951('0x15'))['db'];function respondWithStatusCode(_0x31ef65,_0x58f6b6){_0x58f6b6=_0x58f6b6||0xcc;return function(_0x2377e3){if(_0x2377e3){return _0x31ef65[_0x4951('0x16')](_0x58f6b6);}return _0x31ef65[_0x4951('0x17')](_0x58f6b6)[_0x4951('0x18')]();};}function respondWithResult(_0x391e2f,_0x37d9fa){_0x37d9fa=_0x37d9fa||0xc8;return function(_0x5c4009){if(_0x5c4009){return _0x391e2f[_0x4951('0x17')](_0x37d9fa)['json'](_0x5c4009);}};}function respondWithFilteredResult(_0x4bd69e,_0x29a9ea){return function(_0x3ba497){if(_0x3ba497){var _0x18f1a8=typeof _0x29a9ea[_0x4951('0x19')]==='undefined'&&typeof _0x29a9ea[_0x4951('0x1a')]==='undefined';var _0x1474f8=_0x3ba497[_0x4951('0x1b')];var _0x3440a9=_0x18f1a8?0x0:_0x29a9ea['offset'];var _0x3848f7=_0x18f1a8?_0x3ba497['count']:_0x29a9ea[_0x4951('0x19')]+_0x29a9ea['limit'];var _0x55cea5;if(_0x3848f7>=_0x1474f8){_0x3848f7=_0x1474f8;_0x55cea5=0xc8;}else{_0x55cea5=0xce;}_0x4bd69e[_0x4951('0x17')](_0x55cea5);return _0x4bd69e['set'](_0x4951('0x1c'),_0x3440a9+'-'+_0x3848f7+'/'+_0x1474f8)[_0x4951('0x1d')](_0x3ba497);}return null;};}function patchUpdates(_0x4c6155){return function(_0x33cc16){try{jsonpatch[_0x4951('0x1e')](_0x33cc16,_0x4c6155,!![]);}catch(_0x947b29){return BPromise[_0x4951('0x1f')](_0x947b29);}return _0x33cc16['save']();};}function saveUpdates(_0x579a74,_0x21a757){return function(_0x58e1d6){if(_0x58e1d6){return _0x58e1d6['update'](_0x579a74)[_0x4951('0x20')](function(_0xb85998){return _0xb85998;});}return null;};}function removeEntity(_0x4337aa,_0x139238){return function(_0x53e36d){if(_0x53e36d){return _0x53e36d['destroy']()['then'](function(){_0x4337aa[_0x4951('0x17')](0xcc)[_0x4951('0x18')]();});}};}function handleEntityNotFound(_0x4bfba3,_0x48dbb3){return function(_0x1a819a){if(!_0x1a819a){_0x4bfba3[_0x4951('0x16')](0x194);}return _0x1a819a;};}function handleError(_0x19ce64,_0xbdbc95){_0xbdbc95=_0xbdbc95||0x1f4;return function(_0x463c1e){logger[_0x4951('0x21')](_0x463c1e[_0x4951('0x22')]);if(_0x463c1e[_0x4951('0x23')]){delete _0x463c1e['name'];}_0x19ce64[_0x4951('0x17')](_0xbdbc95)[_0x4951('0x24')](_0x463c1e);};}exports[_0x4951('0x25')]=function(_0x58d7ab,_0x1c04a9){var _0x2321c0={},_0x3d915b={},_0x40976c={'count':0x0,'rows':[]};var _0x1582d2=_[_0x4951('0x26')](db[_0x4951('0x27')]['rawAttributes'],function(_0x528043){return{'name':_0x528043[_0x4951('0x28')],'type':_0x528043[_0x4951('0x29')][_0x4951('0x2a')]};});_0x3d915b[_0x4951('0x2b')]=_['map'](_0x1582d2,'name');_0x3d915b[_0x4951('0x2c')]=_[_0x4951('0x2d')](_0x58d7ab['query']);_0x3d915b['filters']=_[_0x4951('0x2e')](_0x3d915b[_0x4951('0x2b')],_0x3d915b[_0x4951('0x2c')]);_0x2321c0[_0x4951('0x2f')]=_['intersection'](_0x3d915b[_0x4951('0x2b')],qs['fields'](_0x58d7ab[_0x4951('0x2c')]['fields']));_0x2321c0[_0x4951('0x2f')]=_0x2321c0[_0x4951('0x2f')][_0x4951('0x30')]?_0x2321c0[_0x4951('0x2f')]:_0x3d915b['model'];if(!_0x58d7ab[_0x4951('0x2c')][_0x4951('0x31')](_0x4951('0x32'))){_0x2321c0[_0x4951('0x1a')]=qs[_0x4951('0x1a')](_0x58d7ab[_0x4951('0x2c')][_0x4951('0x1a')]);_0x2321c0[_0x4951('0x19')]=qs['offset'](_0x58d7ab[_0x4951('0x2c')][_0x4951('0x19')]);}_0x2321c0['order']=qs[_0x4951('0x33')](_0x58d7ab[_0x4951('0x2c')][_0x4951('0x33')]);_0x2321c0[_0x4951('0x34')]=qs[_0x4951('0x35')](_['pick'](_0x58d7ab[_0x4951('0x2c')],_0x3d915b[_0x4951('0x35')]),_0x1582d2);if(_0x58d7ab[_0x4951('0x2c')][_0x4951('0x36')]){_0x2321c0['where']=_[_0x4951('0x37')](_0x2321c0[_0x4951('0x34')],{'$or':_[_0x4951('0x26')](_0x1582d2,function(_0x2ced64){if(_0x2ced64[_0x4951('0x29')]!==_0x4951('0x38')){var _0x129d1a={};_0x129d1a[_0x2ced64[_0x4951('0x23')]]={'$like':'%'+_0x58d7ab[_0x4951('0x2c')][_0x4951('0x36')]+'%'};return _0x129d1a;}})});}_0x2321c0=_['merge']({},_0x2321c0,_0x58d7ab['options']);var _0x47fdb6={'where':_0x2321c0['where']};return db['FreshdeskConfiguration']['count'](_0x47fdb6)['then'](function(_0x48aa43){_0x40976c[_0x4951('0x1b')]=_0x48aa43;if(_0x58d7ab['query']['includeAll']){_0x2321c0[_0x4951('0x39')]=[{'all':!![]}];}return db[_0x4951('0x27')][_0x4951('0x3a')](_0x2321c0);})[_0x4951('0x20')](function(_0xc023ad){_0x40976c[_0x4951('0x3b')]=_0xc023ad;return _0x40976c;})[_0x4951('0x20')](respondWithFilteredResult(_0x1c04a9,_0x2321c0))['catch'](handleError(_0x1c04a9,null));};exports[_0x4951('0x3c')]=function(_0x21af43,_0x38e4b8){var _0x45a15e={'raw':![],'where':{'id':_0x21af43[_0x4951('0x3d')]['id']}},_0x1009e1={};_0x1009e1[_0x4951('0x2b')]=_[_0x4951('0x2d')](db[_0x4951('0x27')][_0x4951('0x3e')]);_0x1009e1[_0x4951('0x2c')]=_['keys'](_0x21af43[_0x4951('0x2c')]);_0x1009e1[_0x4951('0x35')]=_['intersection'](_0x1009e1[_0x4951('0x2b')],_0x1009e1[_0x4951('0x2c')]);_0x45a15e['attributes']=_[_0x4951('0x2e')](_0x1009e1['model'],qs[_0x4951('0x3f')](_0x21af43[_0x4951('0x2c')][_0x4951('0x3f')]));_0x45a15e[_0x4951('0x2f')]=_0x45a15e['attributes'][_0x4951('0x30')]?_0x45a15e[_0x4951('0x2f')]:_0x1009e1[_0x4951('0x2b')];if(_0x21af43[_0x4951('0x2c')][_0x4951('0x40')]){_0x45a15e[_0x4951('0x39')]=[{'all':!![]}];}_0x45a15e=_[_0x4951('0x37')]({},_0x45a15e,_0x21af43[_0x4951('0x41')]);return db['FreshdeskConfiguration'][_0x4951('0x42')](_0x45a15e)[_0x4951('0x20')](handleEntityNotFound(_0x38e4b8,null))[_0x4951('0x20')](respondWithResult(_0x38e4b8,null))[_0x4951('0x43')](handleError(_0x38e4b8,null));};exports[_0x4951('0x44')]=function(_0x186430,_0x154c5c){return db[_0x4951('0x27')][_0x4951('0x44')](_0x186430[_0x4951('0x45')],{})[_0x4951('0x20')](respondWithResult(_0x154c5c,0xc9))[_0x4951('0x43')](handleError(_0x154c5c,null));};exports[_0x4951('0x46')]=function(_0x1019fc,_0x301b18){if(_0x1019fc['body']['id']){delete _0x1019fc['body']['id'];}return db[_0x4951('0x27')][_0x4951('0x42')]({'where':{'id':_0x1019fc[_0x4951('0x3d')]['id']}})[_0x4951('0x20')](handleEntityNotFound(_0x301b18,null))[_0x4951('0x20')](saveUpdates(_0x1019fc['body'],null))[_0x4951('0x20')](respondWithResult(_0x301b18,null))['catch'](handleError(_0x301b18,null));};exports['destroy']=function(_0x2352ad,_0xa0c8ed){return db['FreshdeskConfiguration']['find']({'where':{'id':_0x2352ad[_0x4951('0x3d')]['id']}})['then'](handleEntityNotFound(_0xa0c8ed,null))[_0x4951('0x20')](removeEntity(_0xa0c8ed,null))[_0x4951('0x43')](handleError(_0xa0c8ed,null));};exports['getFields']=function(_0x3cefe4,_0x499776,_0x24f97d){var _0x41e84c={};var _0x4e4ba3={};var _0x3ab91c;var _0x3370e9;return db[_0x4951('0x27')][_0x4951('0x47')]({'where':{'id':_0x3cefe4[_0x4951('0x3d')]['id']}})[_0x4951('0x20')](handleEntityNotFound(_0x499776,null))['then'](function(_0x444ab0){if(_0x444ab0){_0x3ab91c=_0x444ab0;_0x4e4ba3['model']=_[_0x4951('0x2d')](db[_0x4951('0x48')]['rawAttributes']);_0x4e4ba3['query']=_[_0x4951('0x2d')](_0x3cefe4['query']);_0x4e4ba3[_0x4951('0x35')]=_[_0x4951('0x2e')](_0x4e4ba3[_0x4951('0x2b')],_0x4e4ba3['query']);_0x41e84c[_0x4951('0x2f')]=_[_0x4951('0x2e')](_0x4e4ba3[_0x4951('0x2b')],qs[_0x4951('0x3f')](_0x3cefe4[_0x4951('0x2c')][_0x4951('0x3f')]));_0x41e84c[_0x4951('0x2f')]=_0x41e84c['attributes'][_0x4951('0x30')]?_0x41e84c['attributes']:_0x4e4ba3[_0x4951('0x2b')];_0x41e84c[_0x4951('0x49')]=qs[_0x4951('0x33')](_0x3cefe4[_0x4951('0x2c')][_0x4951('0x33')]);_0x41e84c['where']=qs['filters'](_[_0x4951('0x4a')](_0x3cefe4[_0x4951('0x2c')],_0x4e4ba3[_0x4951('0x35')]));if(_0x3cefe4[_0x4951('0x2c')][_0x4951('0x36')]){_0x41e84c[_0x4951('0x34')]=_[_0x4951('0x37')](_0x41e84c[_0x4951('0x34')],{'$or':_[_0x4951('0x26')](_0x41e84c[_0x4951('0x2f')],function(_0x1e1a94){var _0x1c47b7={};_0x1c47b7[_0x1e1a94]={'$like':'%'+_0x3cefe4[_0x4951('0x2c')][_0x4951('0x36')]+'%'};return _0x1c47b7;})});}_0x41e84c=_[_0x4951('0x37')]({},_0x41e84c,_0x3cefe4[_0x4951('0x41')]);return _0x3ab91c[_0x4951('0x4b')](_0x41e84c);}})[_0x4951('0x20')](function(_0x2a685f){if(_0x2a685f){_0x3370e9=_0x2a685f[_0x4951('0x30')];if(!_0x3cefe4[_0x4951('0x2c')]['hasOwnProperty'](_0x4951('0x32'))){_0x41e84c[_0x4951('0x1a')]=qs[_0x4951('0x1a')](_0x3cefe4[_0x4951('0x2c')]['limit']);_0x41e84c[_0x4951('0x19')]=qs[_0x4951('0x19')](_0x3cefe4[_0x4951('0x2c')]['offset']);}return _0x3ab91c[_0x4951('0x4b')](_0x41e84c);}})[_0x4951('0x20')](function(_0x11991d){if(_0x11991d){return _0x11991d?{'count':_0x3370e9,'rows':_0x11991d}:null;}})[_0x4951('0x20')](respondWithResult(_0x499776,null))['catch'](handleError(_0x499776,null));};exports[_0x4951('0x4c')]=function(_0x479337,_0x32dea6,_0x5a6dc2){var _0x59c1fc={};var _0x81d39a={};var _0x22ddcd;var _0x41b19f;return db[_0x4951('0x27')][_0x4951('0x47')]({'where':{'id':_0x479337[_0x4951('0x3d')]['id']}})[_0x4951('0x20')](handleEntityNotFound(_0x32dea6,null))[_0x4951('0x20')](function(_0x3df2da){if(_0x3df2da){_0x22ddcd=_0x3df2da;_0x81d39a['model']=_[_0x4951('0x2d')](db[_0x4951('0x48')][_0x4951('0x3e')]);_0x81d39a[_0x4951('0x2c')]=_[_0x4951('0x2d')](_0x479337[_0x4951('0x2c')]);_0x81d39a['filters']=_[_0x4951('0x2e')](_0x81d39a[_0x4951('0x2b')],_0x81d39a[_0x4951('0x2c')]);_0x59c1fc[_0x4951('0x2f')]=_[_0x4951('0x2e')](_0x81d39a['model'],qs[_0x4951('0x3f')](_0x479337['query']['fields']));_0x59c1fc['attributes']=_0x59c1fc[_0x4951('0x2f')][_0x4951('0x30')]?_0x59c1fc[_0x4951('0x2f')]:_0x81d39a['model'];_0x59c1fc[_0x4951('0x49')]=qs[_0x4951('0x33')](_0x479337[_0x4951('0x2c')][_0x4951('0x33')]);_0x59c1fc[_0x4951('0x34')]=qs[_0x4951('0x35')](_[_0x4951('0x4a')](_0x479337[_0x4951('0x2c')],_0x81d39a[_0x4951('0x35')]));if(_0x479337[_0x4951('0x2c')][_0x4951('0x36')]){_0x59c1fc['where']=_['merge'](_0x59c1fc['where'],{'$or':_[_0x4951('0x26')](_0x59c1fc[_0x4951('0x2f')],function(_0x5dc4a8){var _0x3d8cd7={};_0x3d8cd7[_0x5dc4a8]={'$like':'%'+_0x479337[_0x4951('0x2c')][_0x4951('0x36')]+'%'};return _0x3d8cd7;})});}_0x59c1fc=_[_0x4951('0x37')]({},_0x59c1fc,_0x479337[_0x4951('0x41')]);return _0x22ddcd['getSubjects'](_0x59c1fc);}})[_0x4951('0x20')](function(_0x38c01b){if(_0x38c01b){_0x41b19f=_0x38c01b[_0x4951('0x30')];if(!_0x479337['query'][_0x4951('0x31')](_0x4951('0x32'))){_0x59c1fc['limit']=qs[_0x4951('0x1a')](_0x479337[_0x4951('0x2c')][_0x4951('0x1a')]);_0x59c1fc[_0x4951('0x19')]=qs['offset'](_0x479337['query'][_0x4951('0x19')]);}return _0x22ddcd[_0x4951('0x4c')](_0x59c1fc);}})['then'](function(_0x5dda6a){if(_0x5dda6a){return _0x5dda6a?{'count':_0x41b19f,'rows':_0x5dda6a}:null;}})['then'](respondWithResult(_0x32dea6,null))['catch'](handleError(_0x32dea6,null));};exports[_0x4951('0x4d')]=function(_0x464549,_0x8d6581,_0x336484){var _0x33c3b2={};var _0x4cbeb5={};var _0x4bb39a;var _0x5c7809;return db[_0x4951('0x27')][_0x4951('0x47')]({'where':{'id':_0x464549[_0x4951('0x3d')]['id']}})[_0x4951('0x20')](handleEntityNotFound(_0x8d6581,null))[_0x4951('0x20')](function(_0x4d0f4){if(_0x4d0f4){_0x4bb39a=_0x4d0f4;_0x4cbeb5[_0x4951('0x2b')]=_[_0x4951('0x2d')](db[_0x4951('0x48')]['rawAttributes']);_0x4cbeb5['query']=_['keys'](_0x464549['query']);_0x4cbeb5[_0x4951('0x35')]=_[_0x4951('0x2e')](_0x4cbeb5['model'],_0x4cbeb5[_0x4951('0x2c')]);_0x33c3b2[_0x4951('0x2f')]=_[_0x4951('0x2e')](_0x4cbeb5[_0x4951('0x2b')],qs[_0x4951('0x3f')](_0x464549[_0x4951('0x2c')]['fields']));_0x33c3b2[_0x4951('0x2f')]=_0x33c3b2[_0x4951('0x2f')]['length']?_0x33c3b2[_0x4951('0x2f')]:_0x4cbeb5[_0x4951('0x2b')];_0x33c3b2[_0x4951('0x49')]=qs[_0x4951('0x33')](_0x464549[_0x4951('0x2c')][_0x4951('0x33')]);_0x33c3b2['where']=qs[_0x4951('0x35')](_['pick'](_0x464549[_0x4951('0x2c')],_0x4cbeb5['filters']));if(_0x464549[_0x4951('0x2c')][_0x4951('0x36')]){_0x33c3b2[_0x4951('0x34')]=_[_0x4951('0x37')](_0x33c3b2['where'],{'$or':_['map'](_0x33c3b2[_0x4951('0x2f')],function(_0x48a15f){var _0x1bcd57={};_0x1bcd57[_0x48a15f]={'$like':'%'+_0x464549[_0x4951('0x2c')][_0x4951('0x36')]+'%'};return _0x1bcd57;})});}_0x33c3b2=_[_0x4951('0x37')]({},_0x33c3b2,_0x464549[_0x4951('0x41')]);return _0x4bb39a[_0x4951('0x4d')](_0x33c3b2);}})[_0x4951('0x20')](function(_0x20dea8){if(_0x20dea8){_0x5c7809=_0x20dea8[_0x4951('0x30')];if(!_0x464549[_0x4951('0x2c')]['hasOwnProperty']('nolimit')){_0x33c3b2[_0x4951('0x1a')]=qs[_0x4951('0x1a')](_0x464549[_0x4951('0x2c')]['limit']);_0x33c3b2['offset']=qs['offset'](_0x464549[_0x4951('0x2c')][_0x4951('0x19')]);}return _0x4bb39a['getDescriptions'](_0x33c3b2);}})[_0x4951('0x20')](function(_0x3f991c){if(_0x3f991c){return _0x3f991c?{'count':_0x5c7809,'rows':_0x3f991c}:null;}})[_0x4951('0x20')](respondWithResult(_0x8d6581,null))[_0x4951('0x43')](handleError(_0x8d6581,null));};exports[_0x4951('0x4e')]=function(_0x23e0a8,_0x3b18e9,_0x1a94f4){var _0x482f4f={};var _0x22eebd={};var _0x3e924f;var _0x30b5f1;return db[_0x4951('0x27')][_0x4951('0x47')]({'where':{'id':_0x23e0a8[_0x4951('0x3d')]['id']}})[_0x4951('0x20')](handleEntityNotFound(_0x3b18e9,null))[_0x4951('0x20')](function(_0x3f0b95){if(_0x3f0b95){_0x3e924f=_0x3f0b95;_0x22eebd[_0x4951('0x2b')]=_['keys'](db[_0x4951('0x4f')]['rawAttributes']);_0x22eebd[_0x4951('0x2c')]=_[_0x4951('0x2d')](_0x23e0a8[_0x4951('0x2c')]);_0x22eebd['filters']=_[_0x4951('0x2e')](_0x22eebd['model'],_0x22eebd[_0x4951('0x2c')]);_0x482f4f[_0x4951('0x2f')]=_[_0x4951('0x2e')](_0x22eebd['model'],qs[_0x4951('0x3f')](_0x23e0a8[_0x4951('0x2c')]['fields']));_0x482f4f[_0x4951('0x2f')]=_0x482f4f[_0x4951('0x2f')][_0x4951('0x30')]?_0x482f4f[_0x4951('0x2f')]:_0x22eebd[_0x4951('0x2b')];_0x482f4f['order']=qs['sort'](_0x23e0a8[_0x4951('0x2c')][_0x4951('0x33')]);_0x482f4f[_0x4951('0x34')]=qs['filters'](_[_0x4951('0x4a')](_0x23e0a8[_0x4951('0x2c')],_0x22eebd[_0x4951('0x35')]));if(_0x23e0a8[_0x4951('0x2c')][_0x4951('0x36')]){_0x482f4f['where']=_['merge'](_0x482f4f[_0x4951('0x34')],{'$or':_['map'](_0x482f4f[_0x4951('0x2f')],function(_0x118232){var _0x558a1f={};_0x558a1f[_0x118232]={'$like':'%'+_0x23e0a8[_0x4951('0x2c')]['filter']+'%'};return _0x558a1f;})});}_0x482f4f=_[_0x4951('0x37')]({},_0x482f4f,_0x23e0a8[_0x4951('0x41')]);return _0x3e924f[_0x4951('0x4e')](_0x482f4f);}})['then'](function(_0xe58e89){if(_0xe58e89){_0x30b5f1=_0xe58e89[_0x4951('0x30')];if(!_0x23e0a8[_0x4951('0x2c')][_0x4951('0x31')]('nolimit')){_0x482f4f['limit']=qs[_0x4951('0x1a')](_0x23e0a8[_0x4951('0x2c')]['limit']);_0x482f4f[_0x4951('0x19')]=qs[_0x4951('0x19')](_0x23e0a8['query'][_0x4951('0x19')]);}return _0x3e924f[_0x4951('0x4e')](_0x482f4f);}})[_0x4951('0x20')](function(_0x3402c0){if(_0x3402c0){return _0x3402c0?{'count':_0x30b5f1,'rows':_0x3402c0}:null;}})[_0x4951('0x20')](respondWithResult(_0x3b18e9,null))[_0x4951('0x43')](handleError(_0x3b18e9,null));};exports[_0x4951('0x50')]=function(_0x2d4e18,_0x1d1a12,_0xdc3d8c){if(_0x2d4e18['body']['id']){delete _0x2d4e18[_0x4951('0x45')]['id'];}return db[_0x4951('0x27')]['findOne']({'where':{'id':_0x2d4e18[_0x4951('0x3d')]['id']}})[_0x4951('0x20')](handleEntityNotFound(_0x1d1a12,null))[_0x4951('0x20')](function(_0x4b5cd9){if(_0x4b5cd9){return _0x4b5cd9[_0x4951('0x50')](_0x2d4e18[_0x4951('0x45')][_0x4951('0x51')]||[]);}return null;})[_0x4951('0x20')](respondWithResult(_0x1d1a12,null))[_0x4951('0x43')](handleError(_0x1d1a12,null));}; \ No newline at end of file +var _0xaf83=['sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','error','name','send','map','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','filter','includeAll','include','FreshdeskConfiguration','findAll','rows','catch','show','params','keys','merge','options','find','create','body','getFields','FreshdeskField','pick','nolimit','getSubjects','getDescriptions','Tag','getTags','setTags','findOne','ids','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xaf83,0x1d5));var _0x3af8=function(_0x4e4ad6,_0x3217b6){_0x4e4ad6=_0x4e4ad6-0x0;var _0x3a5b9f=_0xaf83[_0x4e4ad6];return _0x3a5b9f;};'use strict';var emlformat=require(_0x3af8('0x0'));var rimraf=require(_0x3af8('0x1'));var zipdir=require(_0x3af8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3af8('0x3'));var moment=require('moment');var BPromise=require(_0x3af8('0x4'));var Mustache=require(_0x3af8('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x3af8('0x6'));var fs=require('fs');var fs_extra=require(_0x3af8('0x7'));var _=require(_0x3af8('0x8'));var squel=require(_0x3af8('0x9'));var crypto=require(_0x3af8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3af8('0xb'));var toCsv=require(_0x3af8('0xc'));var querystring=require(_0x3af8('0xd'));var Papa=require('papaparse');var Redis=require(_0x3af8('0xe'));var authService=require(_0x3af8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3af8('0x10'));var hardwareService=require(_0x3af8('0x11'));var logger=require(_0x3af8('0x12'))(_0x3af8('0x13'));var utils=require(_0x3af8('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x3af8('0x15'));var db=require(_0x3af8('0x16'))['db'];function respondWithStatusCode(_0x3852d4,_0xba97d9){_0xba97d9=_0xba97d9||0xcc;return function(_0x3d8ea9){if(_0x3d8ea9){return _0x3852d4[_0x3af8('0x17')](_0xba97d9);}return _0x3852d4[_0x3af8('0x18')](_0xba97d9)[_0x3af8('0x19')]();};}function respondWithResult(_0x487432,_0x2899b0){_0x2899b0=_0x2899b0||0xc8;return function(_0x11c6f3){if(_0x11c6f3){return _0x487432[_0x3af8('0x18')](_0x2899b0)[_0x3af8('0x1a')](_0x11c6f3);}};}function respondWithFilteredResult(_0x20af87,_0x5c80b5){return function(_0x1d095e){if(_0x1d095e){var _0x4da5f6=typeof _0x5c80b5[_0x3af8('0x1b')]===_0x3af8('0x1c')&&typeof _0x5c80b5['limit']===_0x3af8('0x1c');var _0x485010=_0x1d095e[_0x3af8('0x1d')];var _0x2b35fb=_0x4da5f6?0x0:_0x5c80b5[_0x3af8('0x1b')];var _0x842bd6=_0x4da5f6?_0x1d095e['count']:_0x5c80b5[_0x3af8('0x1b')]+_0x5c80b5[_0x3af8('0x1e')];var _0x4133a4;if(_0x842bd6>=_0x485010){_0x842bd6=_0x485010;_0x4133a4=0xc8;}else{_0x4133a4=0xce;}_0x20af87['status'](_0x4133a4);return _0x20af87[_0x3af8('0x1f')]('Content-Range',_0x2b35fb+'-'+_0x842bd6+'/'+_0x485010)[_0x3af8('0x1a')](_0x1d095e);}return null;};}function patchUpdates(_0x1c00ce){return function(_0x56ca7c){try{jsonpatch['apply'](_0x56ca7c,_0x1c00ce,!![]);}catch(_0x5aaa76){return BPromise[_0x3af8('0x20')](_0x5aaa76);}return _0x56ca7c[_0x3af8('0x21')]();};}function saveUpdates(_0x4f21ca,_0x4173a3){return function(_0x2bb7e5){if(_0x2bb7e5){return _0x2bb7e5[_0x3af8('0x22')](_0x4f21ca)[_0x3af8('0x23')](function(_0x332112){return _0x332112;});}return null;};}function removeEntity(_0x26cd9b,_0x1433cd){return function(_0x5ed84f){if(_0x5ed84f){return _0x5ed84f[_0x3af8('0x24')]()[_0x3af8('0x23')](function(){_0x26cd9b[_0x3af8('0x18')](0xcc)[_0x3af8('0x19')]();});}};}function handleEntityNotFound(_0x118c4b,_0x27bac4){return function(_0x3e15de){if(!_0x3e15de){_0x118c4b[_0x3af8('0x17')](0x194);}return _0x3e15de;};}function handleError(_0x2e303d,_0x49143f){_0x49143f=_0x49143f||0x1f4;return function(_0xaffac6){logger[_0x3af8('0x25')](_0xaffac6['stack']);if(_0xaffac6[_0x3af8('0x26')]){delete _0xaffac6[_0x3af8('0x26')];}_0x2e303d['status'](_0x49143f)[_0x3af8('0x27')](_0xaffac6);};}exports['index']=function(_0x583ef5,_0x3ac1c8){var _0x1821e0={},_0x59726e={},_0x1863f5={'count':0x0,'rows':[]};var _0x5a9b97=_[_0x3af8('0x28')](db['FreshdeskConfiguration'][_0x3af8('0x29')],function(_0x31f363){return{'name':_0x31f363['fieldName'],'type':_0x31f363[_0x3af8('0x2a')][_0x3af8('0x2b')]};});_0x59726e[_0x3af8('0x2c')]=_[_0x3af8('0x28')](_0x5a9b97,_0x3af8('0x26'));_0x59726e['query']=_['keys'](_0x583ef5[_0x3af8('0x2d')]);_0x59726e[_0x3af8('0x2e')]=_['intersection'](_0x59726e[_0x3af8('0x2c')],_0x59726e[_0x3af8('0x2d')]);_0x1821e0[_0x3af8('0x2f')]=_[_0x3af8('0x30')](_0x59726e[_0x3af8('0x2c')],qs[_0x3af8('0x31')](_0x583ef5['query']['fields']));_0x1821e0['attributes']=_0x1821e0[_0x3af8('0x2f')][_0x3af8('0x32')]?_0x1821e0[_0x3af8('0x2f')]:_0x59726e[_0x3af8('0x2c')];if(!_0x583ef5[_0x3af8('0x2d')][_0x3af8('0x33')]('nolimit')){_0x1821e0[_0x3af8('0x1e')]=qs[_0x3af8('0x1e')](_0x583ef5[_0x3af8('0x2d')]['limit']);_0x1821e0[_0x3af8('0x1b')]=qs[_0x3af8('0x1b')](_0x583ef5[_0x3af8('0x2d')][_0x3af8('0x1b')]);}_0x1821e0[_0x3af8('0x34')]=qs[_0x3af8('0x35')](_0x583ef5['query']['sort']);_0x1821e0['where']=qs[_0x3af8('0x2e')](_['pick'](_0x583ef5[_0x3af8('0x2d')],_0x59726e[_0x3af8('0x2e')]),_0x5a9b97);if(_0x583ef5[_0x3af8('0x2d')]['filter']){_0x1821e0[_0x3af8('0x36')]=_['merge'](_0x1821e0[_0x3af8('0x36')],{'$or':_[_0x3af8('0x28')](_0x5a9b97,function(_0x44f2bf){if(_0x44f2bf['type']!==_0x3af8('0x37')){var _0x4eefac={};_0x4eefac[_0x44f2bf[_0x3af8('0x26')]]={'$like':'%'+_0x583ef5[_0x3af8('0x2d')][_0x3af8('0x38')]+'%'};return _0x4eefac;}})});}_0x1821e0=_['merge']({},_0x1821e0,_0x583ef5['options']);var _0x59c9a4={'where':_0x1821e0[_0x3af8('0x36')]};return db['FreshdeskConfiguration'][_0x3af8('0x1d')](_0x59c9a4)[_0x3af8('0x23')](function(_0x3a6382){_0x1863f5[_0x3af8('0x1d')]=_0x3a6382;if(_0x583ef5[_0x3af8('0x2d')][_0x3af8('0x39')]){_0x1821e0[_0x3af8('0x3a')]=[{'all':!![]}];}return db[_0x3af8('0x3b')][_0x3af8('0x3c')](_0x1821e0);})[_0x3af8('0x23')](function(_0x4809df){_0x1863f5[_0x3af8('0x3d')]=_0x4809df;return _0x1863f5;})[_0x3af8('0x23')](respondWithFilteredResult(_0x3ac1c8,_0x1821e0))[_0x3af8('0x3e')](handleError(_0x3ac1c8,null));};exports[_0x3af8('0x3f')]=function(_0x5b137c,_0x422ed1){var _0x16b2d5={'raw':![],'where':{'id':_0x5b137c[_0x3af8('0x40')]['id']}},_0xc1b209={};_0xc1b209[_0x3af8('0x2c')]=_[_0x3af8('0x41')](db[_0x3af8('0x3b')][_0x3af8('0x29')]);_0xc1b209[_0x3af8('0x2d')]=_['keys'](_0x5b137c[_0x3af8('0x2d')]);_0xc1b209[_0x3af8('0x2e')]=_[_0x3af8('0x30')](_0xc1b209['model'],_0xc1b209[_0x3af8('0x2d')]);_0x16b2d5[_0x3af8('0x2f')]=_[_0x3af8('0x30')](_0xc1b209[_0x3af8('0x2c')],qs[_0x3af8('0x31')](_0x5b137c[_0x3af8('0x2d')]['fields']));_0x16b2d5[_0x3af8('0x2f')]=_0x16b2d5[_0x3af8('0x2f')]['length']?_0x16b2d5[_0x3af8('0x2f')]:_0xc1b209[_0x3af8('0x2c')];if(_0x5b137c['query'][_0x3af8('0x39')]){_0x16b2d5[_0x3af8('0x3a')]=[{'all':!![]}];}_0x16b2d5=_[_0x3af8('0x42')]({},_0x16b2d5,_0x5b137c[_0x3af8('0x43')]);return db[_0x3af8('0x3b')][_0x3af8('0x44')](_0x16b2d5)[_0x3af8('0x23')](handleEntityNotFound(_0x422ed1,null))[_0x3af8('0x23')](respondWithResult(_0x422ed1,null))[_0x3af8('0x3e')](handleError(_0x422ed1,null));};exports[_0x3af8('0x45')]=function(_0x172c27,_0x41111a){return db[_0x3af8('0x3b')]['create'](_0x172c27[_0x3af8('0x46')],{})[_0x3af8('0x23')](respondWithResult(_0x41111a,0xc9))[_0x3af8('0x3e')](handleError(_0x41111a,null));};exports['update']=function(_0x46948e,_0x2d9630){if(_0x46948e[_0x3af8('0x46')]['id']){delete _0x46948e['body']['id'];}return db[_0x3af8('0x3b')]['find']({'where':{'id':_0x46948e[_0x3af8('0x40')]['id']}})[_0x3af8('0x23')](handleEntityNotFound(_0x2d9630,null))[_0x3af8('0x23')](saveUpdates(_0x46948e[_0x3af8('0x46')],null))[_0x3af8('0x23')](respondWithResult(_0x2d9630,null))[_0x3af8('0x3e')](handleError(_0x2d9630,null));};exports['destroy']=function(_0x2ec370,_0x1dfef4){return db[_0x3af8('0x3b')]['find']({'where':{'id':_0x2ec370[_0x3af8('0x40')]['id']}})['then'](handleEntityNotFound(_0x1dfef4,null))[_0x3af8('0x23')](removeEntity(_0x1dfef4,null))['catch'](handleError(_0x1dfef4,null));};exports[_0x3af8('0x47')]=function(_0x2d7db8,_0x5a4409,_0x408a33){var _0x478c65={};var _0x2eff40={};var _0xf09d89;var _0x3a7249;return db[_0x3af8('0x3b')]['findOne']({'where':{'id':_0x2d7db8[_0x3af8('0x40')]['id']}})[_0x3af8('0x23')](handleEntityNotFound(_0x5a4409,null))[_0x3af8('0x23')](function(_0x2d39d0){if(_0x2d39d0){_0xf09d89=_0x2d39d0;_0x2eff40[_0x3af8('0x2c')]=_[_0x3af8('0x41')](db[_0x3af8('0x48')][_0x3af8('0x29')]);_0x2eff40[_0x3af8('0x2d')]=_[_0x3af8('0x41')](_0x2d7db8['query']);_0x2eff40[_0x3af8('0x2e')]=_[_0x3af8('0x30')](_0x2eff40[_0x3af8('0x2c')],_0x2eff40[_0x3af8('0x2d')]);_0x478c65[_0x3af8('0x2f')]=_['intersection'](_0x2eff40[_0x3af8('0x2c')],qs[_0x3af8('0x31')](_0x2d7db8[_0x3af8('0x2d')][_0x3af8('0x31')]));_0x478c65[_0x3af8('0x2f')]=_0x478c65[_0x3af8('0x2f')][_0x3af8('0x32')]?_0x478c65[_0x3af8('0x2f')]:_0x2eff40[_0x3af8('0x2c')];_0x478c65['order']=qs['sort'](_0x2d7db8[_0x3af8('0x2d')][_0x3af8('0x35')]);_0x478c65[_0x3af8('0x36')]=qs[_0x3af8('0x2e')](_[_0x3af8('0x49')](_0x2d7db8[_0x3af8('0x2d')],_0x2eff40[_0x3af8('0x2e')]));if(_0x2d7db8[_0x3af8('0x2d')][_0x3af8('0x38')]){_0x478c65[_0x3af8('0x36')]=_[_0x3af8('0x42')](_0x478c65[_0x3af8('0x36')],{'$or':_[_0x3af8('0x28')](_0x478c65[_0x3af8('0x2f')],function(_0x5ee9ab){var _0x3a260a={};_0x3a260a[_0x5ee9ab]={'$like':'%'+_0x2d7db8[_0x3af8('0x2d')][_0x3af8('0x38')]+'%'};return _0x3a260a;})});}_0x478c65=_['merge']({},_0x478c65,_0x2d7db8['options']);return _0xf09d89['getFields'](_0x478c65);}})['then'](function(_0x36f15b){if(_0x36f15b){_0x3a7249=_0x36f15b[_0x3af8('0x32')];if(!_0x2d7db8['query'][_0x3af8('0x33')](_0x3af8('0x4a'))){_0x478c65[_0x3af8('0x1e')]=qs[_0x3af8('0x1e')](_0x2d7db8[_0x3af8('0x2d')][_0x3af8('0x1e')]);_0x478c65[_0x3af8('0x1b')]=qs[_0x3af8('0x1b')](_0x2d7db8[_0x3af8('0x2d')][_0x3af8('0x1b')]);}return _0xf09d89[_0x3af8('0x47')](_0x478c65);}})[_0x3af8('0x23')](function(_0x374bad){if(_0x374bad){return _0x374bad?{'count':_0x3a7249,'rows':_0x374bad}:null;}})['then'](respondWithResult(_0x5a4409,null))['catch'](handleError(_0x5a4409,null));};exports[_0x3af8('0x4b')]=function(_0xc7b18b,_0x570d8a,_0x1754dc){var _0x5bbb5e={};var _0x2a7ef4={};var _0x2e7ae2;var _0x2e2399;return db[_0x3af8('0x3b')]['findOne']({'where':{'id':_0xc7b18b[_0x3af8('0x40')]['id']}})[_0x3af8('0x23')](handleEntityNotFound(_0x570d8a,null))[_0x3af8('0x23')](function(_0x23f054){if(_0x23f054){_0x2e7ae2=_0x23f054;_0x2a7ef4[_0x3af8('0x2c')]=_[_0x3af8('0x41')](db[_0x3af8('0x48')][_0x3af8('0x29')]);_0x2a7ef4[_0x3af8('0x2d')]=_[_0x3af8('0x41')](_0xc7b18b[_0x3af8('0x2d')]);_0x2a7ef4[_0x3af8('0x2e')]=_[_0x3af8('0x30')](_0x2a7ef4[_0x3af8('0x2c')],_0x2a7ef4[_0x3af8('0x2d')]);_0x5bbb5e[_0x3af8('0x2f')]=_[_0x3af8('0x30')](_0x2a7ef4['model'],qs[_0x3af8('0x31')](_0xc7b18b[_0x3af8('0x2d')][_0x3af8('0x31')]));_0x5bbb5e[_0x3af8('0x2f')]=_0x5bbb5e[_0x3af8('0x2f')][_0x3af8('0x32')]?_0x5bbb5e[_0x3af8('0x2f')]:_0x2a7ef4[_0x3af8('0x2c')];_0x5bbb5e[_0x3af8('0x34')]=qs[_0x3af8('0x35')](_0xc7b18b[_0x3af8('0x2d')]['sort']);_0x5bbb5e[_0x3af8('0x36')]=qs[_0x3af8('0x2e')](_[_0x3af8('0x49')](_0xc7b18b[_0x3af8('0x2d')],_0x2a7ef4[_0x3af8('0x2e')]));if(_0xc7b18b['query'][_0x3af8('0x38')]){_0x5bbb5e[_0x3af8('0x36')]=_[_0x3af8('0x42')](_0x5bbb5e['where'],{'$or':_[_0x3af8('0x28')](_0x5bbb5e[_0x3af8('0x2f')],function(_0x9f5f84){var _0x470793={};_0x470793[_0x9f5f84]={'$like':'%'+_0xc7b18b[_0x3af8('0x2d')]['filter']+'%'};return _0x470793;})});}_0x5bbb5e=_[_0x3af8('0x42')]({},_0x5bbb5e,_0xc7b18b['options']);return _0x2e7ae2['getSubjects'](_0x5bbb5e);}})['then'](function(_0x3a8e46){if(_0x3a8e46){_0x2e2399=_0x3a8e46[_0x3af8('0x32')];if(!_0xc7b18b[_0x3af8('0x2d')][_0x3af8('0x33')](_0x3af8('0x4a'))){_0x5bbb5e[_0x3af8('0x1e')]=qs['limit'](_0xc7b18b[_0x3af8('0x2d')]['limit']);_0x5bbb5e[_0x3af8('0x1b')]=qs[_0x3af8('0x1b')](_0xc7b18b[_0x3af8('0x2d')][_0x3af8('0x1b')]);}return _0x2e7ae2['getSubjects'](_0x5bbb5e);}})['then'](function(_0x2953a8){if(_0x2953a8){return _0x2953a8?{'count':_0x2e2399,'rows':_0x2953a8}:null;}})['then'](respondWithResult(_0x570d8a,null))[_0x3af8('0x3e')](handleError(_0x570d8a,null));};exports[_0x3af8('0x4c')]=function(_0x495d83,_0x1312f1,_0x12263e){var _0x5be166={};var _0x414cdc={};var _0x394756;var _0x1ba6ee;return db[_0x3af8('0x3b')]['findOne']({'where':{'id':_0x495d83[_0x3af8('0x40')]['id']}})[_0x3af8('0x23')](handleEntityNotFound(_0x1312f1,null))[_0x3af8('0x23')](function(_0x48c029){if(_0x48c029){_0x394756=_0x48c029;_0x414cdc[_0x3af8('0x2c')]=_[_0x3af8('0x41')](db['FreshdeskField'][_0x3af8('0x29')]);_0x414cdc[_0x3af8('0x2d')]=_[_0x3af8('0x41')](_0x495d83['query']);_0x414cdc[_0x3af8('0x2e')]=_[_0x3af8('0x30')](_0x414cdc['model'],_0x414cdc[_0x3af8('0x2d')]);_0x5be166[_0x3af8('0x2f')]=_[_0x3af8('0x30')](_0x414cdc[_0x3af8('0x2c')],qs[_0x3af8('0x31')](_0x495d83[_0x3af8('0x2d')][_0x3af8('0x31')]));_0x5be166['attributes']=_0x5be166['attributes'][_0x3af8('0x32')]?_0x5be166[_0x3af8('0x2f')]:_0x414cdc[_0x3af8('0x2c')];_0x5be166['order']=qs[_0x3af8('0x35')](_0x495d83['query'][_0x3af8('0x35')]);_0x5be166[_0x3af8('0x36')]=qs[_0x3af8('0x2e')](_[_0x3af8('0x49')](_0x495d83[_0x3af8('0x2d')],_0x414cdc[_0x3af8('0x2e')]));if(_0x495d83[_0x3af8('0x2d')][_0x3af8('0x38')]){_0x5be166[_0x3af8('0x36')]=_['merge'](_0x5be166[_0x3af8('0x36')],{'$or':_['map'](_0x5be166['attributes'],function(_0x18724a){var _0x5d9586={};_0x5d9586[_0x18724a]={'$like':'%'+_0x495d83[_0x3af8('0x2d')][_0x3af8('0x38')]+'%'};return _0x5d9586;})});}_0x5be166=_[_0x3af8('0x42')]({},_0x5be166,_0x495d83[_0x3af8('0x43')]);return _0x394756['getDescriptions'](_0x5be166);}})[_0x3af8('0x23')](function(_0x196c8c){if(_0x196c8c){_0x1ba6ee=_0x196c8c['length'];if(!_0x495d83['query'][_0x3af8('0x33')](_0x3af8('0x4a'))){_0x5be166[_0x3af8('0x1e')]=qs[_0x3af8('0x1e')](_0x495d83[_0x3af8('0x2d')]['limit']);_0x5be166[_0x3af8('0x1b')]=qs[_0x3af8('0x1b')](_0x495d83['query']['offset']);}return _0x394756[_0x3af8('0x4c')](_0x5be166);}})['then'](function(_0x171cd7){if(_0x171cd7){return _0x171cd7?{'count':_0x1ba6ee,'rows':_0x171cd7}:null;}})[_0x3af8('0x23')](respondWithResult(_0x1312f1,null))['catch'](handleError(_0x1312f1,null));};exports['getTags']=function(_0x4572a4,_0x4945d1,_0x5306ce){var _0x11f09e={};var _0x3e4127={};var _0x3592ba;var _0x40521f;return db[_0x3af8('0x3b')]['findOne']({'where':{'id':_0x4572a4['params']['id']}})['then'](handleEntityNotFound(_0x4945d1,null))[_0x3af8('0x23')](function(_0xde27d5){if(_0xde27d5){_0x3592ba=_0xde27d5;_0x3e4127[_0x3af8('0x2c')]=_['keys'](db[_0x3af8('0x4d')]['rawAttributes']);_0x3e4127[_0x3af8('0x2d')]=_[_0x3af8('0x41')](_0x4572a4[_0x3af8('0x2d')]);_0x3e4127[_0x3af8('0x2e')]=_[_0x3af8('0x30')](_0x3e4127[_0x3af8('0x2c')],_0x3e4127[_0x3af8('0x2d')]);_0x11f09e[_0x3af8('0x2f')]=_[_0x3af8('0x30')](_0x3e4127[_0x3af8('0x2c')],qs[_0x3af8('0x31')](_0x4572a4['query'][_0x3af8('0x31')]));_0x11f09e[_0x3af8('0x2f')]=_0x11f09e[_0x3af8('0x2f')][_0x3af8('0x32')]?_0x11f09e[_0x3af8('0x2f')]:_0x3e4127[_0x3af8('0x2c')];_0x11f09e['order']=qs[_0x3af8('0x35')](_0x4572a4[_0x3af8('0x2d')][_0x3af8('0x35')]);_0x11f09e[_0x3af8('0x36')]=qs[_0x3af8('0x2e')](_['pick'](_0x4572a4[_0x3af8('0x2d')],_0x3e4127[_0x3af8('0x2e')]));if(_0x4572a4[_0x3af8('0x2d')][_0x3af8('0x38')]){_0x11f09e[_0x3af8('0x36')]=_[_0x3af8('0x42')](_0x11f09e[_0x3af8('0x36')],{'$or':_[_0x3af8('0x28')](_0x11f09e[_0x3af8('0x2f')],function(_0x5c34a6){var _0x40f070={};_0x40f070[_0x5c34a6]={'$like':'%'+_0x4572a4[_0x3af8('0x2d')][_0x3af8('0x38')]+'%'};return _0x40f070;})});}_0x11f09e=_[_0x3af8('0x42')]({},_0x11f09e,_0x4572a4[_0x3af8('0x43')]);return _0x3592ba['getTags'](_0x11f09e);}})['then'](function(_0x2ac602){if(_0x2ac602){_0x40521f=_0x2ac602[_0x3af8('0x32')];if(!_0x4572a4[_0x3af8('0x2d')][_0x3af8('0x33')]('nolimit')){_0x11f09e[_0x3af8('0x1e')]=qs[_0x3af8('0x1e')](_0x4572a4[_0x3af8('0x2d')][_0x3af8('0x1e')]);_0x11f09e['offset']=qs[_0x3af8('0x1b')](_0x4572a4[_0x3af8('0x2d')][_0x3af8('0x1b')]);}return _0x3592ba[_0x3af8('0x4e')](_0x11f09e);}})['then'](function(_0x341d35){if(_0x341d35){return _0x341d35?{'count':_0x40521f,'rows':_0x341d35}:null;}})[_0x3af8('0x23')](respondWithResult(_0x4945d1,null))[_0x3af8('0x3e')](handleError(_0x4945d1,null));};exports[_0x3af8('0x4f')]=function(_0x4dbe5d,_0x2a407e,_0x357592){if(_0x4dbe5d['body']['id']){delete _0x4dbe5d[_0x3af8('0x46')]['id'];}return db[_0x3af8('0x3b')][_0x3af8('0x50')]({'where':{'id':_0x4dbe5d[_0x3af8('0x40')]['id']}})[_0x3af8('0x23')](handleEntityNotFound(_0x2a407e,null))['then'](function(_0x44c6e3){if(_0x44c6e3){return _0x44c6e3[_0x3af8('0x4f')](_0x4dbe5d[_0x3af8('0x46')][_0x3af8('0x51')]||[]);}return null;})[_0x3af8('0x23')](respondWithResult(_0x2a407e,null))[_0x3af8('0x3e')](handleError(_0x2a407e,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 9755b24..1366f46 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 _0x5498=['bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x5533bc,_0x259123){var _0x5c0c0e=function(_0x49557a){while(--_0x49557a){_0x5533bc['push'](_0x5533bc['shift']());}};_0x5c0c0e(++_0x259123);}(_0x5498,0x1ad));var _0x8549=function(_0x54482d,_0x48e95d){_0x54482d=_0x54482d-0x0;var _0x610d61=_0x5498[_0x54482d];return _0x610d61;};'use strict';var _=require(_0x8549('0x0'));var util=require(_0x8549('0x1'));var logger=require(_0x8549('0x2'))(_0x8549('0x3'));var moment=require(_0x8549('0x4'));var BPromise=require(_0x8549('0x5'));var rp=require(_0x8549('0x6'));var fs=require('fs');var path=require(_0x8549('0x7'));var rimraf=require(_0x8549('0x8'));var config=require(_0x8549('0x9'));var attributes=require(_0x8549('0xa'));module['exports']=function(_0x531c70,_0x8c61a){return _0x531c70[_0x8549('0xb')](_0x8549('0xc'),attributes,{'tableName':_0x8549('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbde7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','api'];(function(_0x2f243c,_0x33db47){var _0x16f2b4=function(_0x24720f){while(--_0x24720f){_0x2f243c['push'](_0x2f243c['shift']());}};_0x16f2b4(++_0x33db47);}(_0xbde7,0x169));var _0x7bde=function(_0x4685d3,_0x53f994){_0x4685d3=_0x4685d3-0x0;var _0x195d65=_0xbde7[_0x4685d3];return _0x195d65;};'use strict';var _=require(_0x7bde('0x0'));var util=require('util');var logger=require(_0x7bde('0x1'))(_0x7bde('0x2'));var moment=require(_0x7bde('0x3'));var BPromise=require(_0x7bde('0x4'));var rp=require(_0x7bde('0x5'));var fs=require('fs');var path=require(_0x7bde('0x6'));var rimraf=require(_0x7bde('0x7'));var config=require(_0x7bde('0x8'));var attributes=require(_0x7bde('0x9'));module[_0x7bde('0xa')]=function(_0x5b9615,_0x22a8df){return _0x5b9615['define'](_0x7bde('0xb'),attributes,{'tableName':_0x7bde('0xc'),'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 2a11f4d..6d8ecad 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 _0x46ca=['error','code','message','info','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x53f44c,_0x497bdc){var _0x3e8278=function(_0x4d8a93){while(--_0x4d8a93){_0x53f44c['push'](_0x53f44c['shift']());}};_0x3e8278(++_0x497bdc);}(_0x46ca,0x6e));var _0xa46c=function(_0x5c16ad,_0x24312a){_0x5c16ad=_0x5c16ad-0x0;var _0xf9d36e=_0x46ca[_0x5c16ad];return _0xf9d36e;};'use strict';var _=require(_0xa46c('0x0'));var util=require('util');var moment=require(_0xa46c('0x1'));var BPromise=require(_0xa46c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa46c('0x3'));var db=require(_0xa46c('0x4'))['db'];var utils=require(_0xa46c('0x5'));var logger=require(_0xa46c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa46c('0x7'));var client=jayson[_0xa46c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c6438,_0x362940,_0x101215){return new BPromise(function(_0x42c85e,_0x54dff2){return client[_0xa46c('0x9')](_0x5c6438,_0x101215)[_0xa46c('0xa')](function(_0x2f40b3){logger['info'](_0xa46c('0xb'),_0x362940,_0xa46c('0xc'));logger[_0xa46c('0xd')](_0xa46c('0xe'),_0x362940,_0xa46c('0xc'),JSON[_0xa46c('0xf')](_0x2f40b3));if(_0x2f40b3[_0xa46c('0x10')]){if(_0x2f40b3[_0xa46c('0x10')][_0xa46c('0x11')]===0x1f4){logger[_0xa46c('0x10')](_0xa46c('0xb'),_0x362940,_0x2f40b3[_0xa46c('0x10')]['message']);return _0x54dff2(_0x2f40b3[_0xa46c('0x10')][_0xa46c('0x12')]);}logger[_0xa46c('0x10')](_0xa46c('0xb'),_0x362940,_0x2f40b3[_0xa46c('0x10')][_0xa46c('0x12')]);return _0x42c85e(_0x2f40b3[_0xa46c('0x10')]['message']);}else{logger[_0xa46c('0x13')](_0xa46c('0xb'),_0x362940,_0xa46c('0xc'));_0x42c85e(_0x2f40b3[_0xa46c('0x14')][_0xa46c('0x12')]);}})['catch'](function(_0x144961){logger[_0xa46c('0x10')](_0xa46c('0xb'),_0x362940,_0x144961);_0x54dff2(_0x144961);});});} \ No newline at end of file +var _0x1ce9=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','moment'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1ce9,0xe4));var _0x91ce=function(_0x329dc5,_0x42591f){_0x329dc5=_0x329dc5-0x0;var _0x32111d=_0x1ce9[_0x329dc5];return _0x32111d;};'use strict';var _=require(_0x91ce('0x0'));var util=require('util');var moment=require(_0x91ce('0x1'));var BPromise=require(_0x91ce('0x2'));var rs=require(_0x91ce('0x3'));var fs=require('fs');var Redis=require(_0x91ce('0x4'));var db=require(_0x91ce('0x5'))['db'];var utils=require(_0x91ce('0x6'));var logger=require(_0x91ce('0x7'))(_0x91ce('0x8'));var config=require(_0x91ce('0x9'));var jayson=require(_0x91ce('0xa'));var client=jayson[_0x91ce('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xcd9908,_0x15b936,_0x4193b1){return new BPromise(function(_0x1f5995,_0x1ef278){return client[_0x91ce('0xc')](_0xcd9908,_0x4193b1)[_0x91ce('0xd')](function(_0x799682){logger[_0x91ce('0xe')](_0x91ce('0xf'),_0x15b936,'request\x20sent');logger[_0x91ce('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x15b936,_0x91ce('0x11'),JSON[_0x91ce('0x12')](_0x799682));if(_0x799682['error']){if(_0x799682[_0x91ce('0x13')]['code']===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x15b936,_0x799682[_0x91ce('0x13')][_0x91ce('0x14')]);return _0x1ef278(_0x799682[_0x91ce('0x13')][_0x91ce('0x14')]);}logger[_0x91ce('0x13')](_0x91ce('0xf'),_0x15b936,_0x799682['error'][_0x91ce('0x14')]);return _0x1f5995(_0x799682[_0x91ce('0x13')][_0x91ce('0x14')]);}else{logger[_0x91ce('0xe')](_0x91ce('0xf'),_0x15b936,_0x91ce('0x11'));_0x1f5995(_0x799682[_0x91ce('0x15')][_0x91ce('0x14')]);}})[_0x91ce('0x16')](function(_0xfbfb28){logger[_0x91ce('0x13')](_0x91ce('0xf'),_0x15b936,_0xfbfb28);_0x1ef278(_0xfbfb28);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 3ddfbe1..1ee007c 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 _0xde41=['delete','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','create'];(function(_0x196e6b,_0x5cf260){var _0x3b004f=function(_0x4ac09b){while(--_0x4ac09b){_0x196e6b['push'](_0x196e6b['shift']());}};_0x3b004f(++_0x5cf260);}(_0xde41,0xe2));var _0x1de4=function(_0x1af442,_0x578f22){_0x1af442=_0x1af442-0x0;var _0x1e8244=_0xde41[_0x1af442];return _0x1e8244;};'use strict';var multer=require(_0x1de4('0x0'));var util=require('util');var path=require(_0x1de4('0x1'));var timeout=require(_0x1de4('0x2'));var express=require('express');var router=express[_0x1de4('0x3')]();var fs_extra=require(_0x1de4('0x4'));var auth=require(_0x1de4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x1de4('0x6'));router[_0x1de4('0x7')]('/',auth[_0x1de4('0x8')](),controller[_0x1de4('0x9')]);router[_0x1de4('0x7')](_0x1de4('0xa'),auth[_0x1de4('0x8')](),controller['show']);router['post']('/',auth[_0x1de4('0x8')](),controller[_0x1de4('0xb')]);router['put']('/:id',auth[_0x1de4('0x8')](),controller['update']);router[_0x1de4('0xc')](_0x1de4('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1de4('0xd')]=router; \ No newline at end of file +var _0x1556=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x41316a,_0x376fd3){var _0x582d09=function(_0x5e0151){while(--_0x5e0151){_0x41316a['push'](_0x41316a['shift']());}};_0x582d09(++_0x376fd3);}(_0x1556,0x1dc));var _0x6155=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0x1556[_0x178e48];return _0x440d7e;};'use strict';var multer=require(_0x6155('0x0'));var util=require(_0x6155('0x1'));var path=require(_0x6155('0x2'));var timeout=require(_0x6155('0x3'));var express=require(_0x6155('0x4'));var router=express[_0x6155('0x5')]();var fs_extra=require(_0x6155('0x6'));var auth=require(_0x6155('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intFreshdeskField.controller');router[_0x6155('0x8')]('/',auth[_0x6155('0x9')](),controller[_0x6155('0xa')]);router['get'](_0x6155('0xb'),auth[_0x6155('0x9')](),controller[_0x6155('0xc')]);router[_0x6155('0xd')]('/',auth[_0x6155('0x9')](),controller[_0x6155('0xe')]);router[_0x6155('0xf')](_0x6155('0xb'),auth['isAuthenticated'](),controller[_0x6155('0x10')]);router[_0x6155('0x11')]('/:id',auth[_0x6155('0x9')](),controller['destroy']);module[_0x6155('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index bfab2ab..1f8a13a 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 _0x0547=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x0547,0x191));var _0x7054=function(_0x57fc56,_0x2b8490){_0x57fc56=_0x57fc56-0x0;var _0x83205b=_0x0547[_0x57fc56];return _0x83205b;};'use strict';var Sequelize=require(_0x7054('0x0'));module[_0x7054('0x1')]={'type':{'type':Sequelize[_0x7054('0x2')](_0x7054('0x3'),'variable',_0x7054('0x4'),_0x7054('0x5'),_0x7054('0x6')),'defaultValue':_0x7054('0x3')},'content':{'type':Sequelize[_0x7054('0x7')]},'key':{'type':Sequelize[_0x7054('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x7054('0x3'),_0x7054('0x8'),_0x7054('0x4'))},'keyContent':{'type':Sequelize[_0x7054('0x7')]},'idField':{'type':Sequelize[_0x7054('0x7')]},'nameField':{'type':Sequelize[_0x7054('0x7')]},'customField':{'type':Sequelize[_0x7054('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7054('0x7')]}}; \ No newline at end of file +var _0x5adc=['string','customVariable','variable','STRING','ENUM'];(function(_0x50530f,_0x4f5e81){var _0xa6eded=function(_0x419035){while(--_0x419035){_0x50530f['push'](_0x50530f['shift']());}};_0xa6eded(++_0x4f5e81);}(_0x5adc,0x1e9));var _0xc5ad=function(_0x32f9b0,_0x4d9a67){_0x32f9b0=_0x32f9b0-0x0;var _0x3c435b=_0x5adc[_0x32f9b0];return _0x3c435b;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xc5ad('0x0')](_0xc5ad('0x1'),'variable',_0xc5ad('0x2'),'keyValue','picklist'),'defaultValue':_0xc5ad('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0xc5ad('0x3'),_0xc5ad('0x2'))},'keyContent':{'type':Sequelize[_0xc5ad('0x4')]},'idField':{'type':Sequelize[_0xc5ad('0x4')]},'nameField':{'type':Sequelize[_0xc5ad('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc5ad('0x4')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index c3d412e..93d206d 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 _0x04b8=['undefined','count','Content-Range','apply','reject','save','then','destroy','error','name','send','index','map','FreshdeskField','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','update','find','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit'];(function(_0x47745c,_0x1c6c5d){var _0x1ce8cc=function(_0x3e93d5){while(--_0x3e93d5){_0x47745c['push'](_0x47745c['shift']());}};_0x1ce8cc(++_0x1c6c5d);}(_0x04b8,0x159));var _0x804b=function(_0x4ed632,_0x5195a3){_0x4ed632=_0x4ed632-0x0;var _0x3e809e=_0x04b8[_0x4ed632];return _0x3e809e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x804b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x804b('0x1'));var rp=require(_0x804b('0x2'));var moment=require('moment');var BPromise=require(_0x804b('0x3'));var Mustache=require(_0x804b('0x4'));var util=require('util');var path=require(_0x804b('0x5'));var sox=require(_0x804b('0x6'));var csv=require(_0x804b('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x804b('0x8'));var _=require(_0x804b('0x9'));var squel=require(_0x804b('0xa'));var crypto=require('crypto');var jsforce=require(_0x804b('0xb'));var deskjs=require(_0x804b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x804b('0xd'));var Papa=require(_0x804b('0xe'));var Redis=require(_0x804b('0xf'));var authService=require(_0x804b('0x10'));var qs=require(_0x804b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x804b('0x12'));var logger=require(_0x804b('0x13'))(_0x804b('0x14'));var utils=require(_0x804b('0x15'));var config=require(_0x804b('0x16'));var licenseUtil=require(_0x804b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15a4eb,_0x5303cc){_0x5303cc=_0x5303cc||0xcc;return function(_0x23ee57){if(_0x23ee57){return _0x15a4eb[_0x804b('0x18')](_0x5303cc);}return _0x15a4eb[_0x804b('0x19')](_0x5303cc)[_0x804b('0x1a')]();};}function respondWithResult(_0x581fbf,_0x215825){_0x215825=_0x215825||0xc8;return function(_0x1b01a7){if(_0x1b01a7){return _0x581fbf[_0x804b('0x19')](_0x215825)[_0x804b('0x1b')](_0x1b01a7);}};}function respondWithFilteredResult(_0x4ff1be,_0x2fd593){return function(_0x8ccbe0){if(_0x8ccbe0){var _0x5e1cfe=typeof _0x2fd593[_0x804b('0x1c')]==='undefined'&&typeof _0x2fd593[_0x804b('0x1d')]===_0x804b('0x1e');var _0x13662e=_0x8ccbe0[_0x804b('0x1f')];var _0x3a05c0=_0x5e1cfe?0x0:_0x2fd593['offset'];var _0x871d6c=_0x5e1cfe?_0x8ccbe0['count']:_0x2fd593[_0x804b('0x1c')]+_0x2fd593[_0x804b('0x1d')];var _0x42cceb;if(_0x871d6c>=_0x13662e){_0x871d6c=_0x13662e;_0x42cceb=0xc8;}else{_0x42cceb=0xce;}_0x4ff1be[_0x804b('0x19')](_0x42cceb);return _0x4ff1be['set'](_0x804b('0x20'),_0x3a05c0+'-'+_0x871d6c+'/'+_0x13662e)[_0x804b('0x1b')](_0x8ccbe0);}return null;};}function patchUpdates(_0x427166){return function(_0x11eaf6){try{jsonpatch[_0x804b('0x21')](_0x11eaf6,_0x427166,!![]);}catch(_0x267878){return BPromise[_0x804b('0x22')](_0x267878);}return _0x11eaf6[_0x804b('0x23')]();};}function saveUpdates(_0xaa9521,_0x2b7271){return function(_0x1acc48){if(_0x1acc48){return _0x1acc48['update'](_0xaa9521)[_0x804b('0x24')](function(_0x5a77e0){return _0x5a77e0;});}return null;};}function removeEntity(_0x5585f8,_0x44a921){return function(_0x367024){if(_0x367024){return _0x367024[_0x804b('0x25')]()[_0x804b('0x24')](function(){_0x5585f8[_0x804b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2de812,_0x7d9c33){return function(_0x4e7266){if(!_0x4e7266){_0x2de812[_0x804b('0x18')](0x194);}return _0x4e7266;};}function handleError(_0x2366b6,_0x1117a5){_0x1117a5=_0x1117a5||0x1f4;return function(_0x27d5ec){logger[_0x804b('0x26')](_0x27d5ec['stack']);if(_0x27d5ec[_0x804b('0x27')]){delete _0x27d5ec[_0x804b('0x27')];}_0x2366b6[_0x804b('0x19')](_0x1117a5)[_0x804b('0x28')](_0x27d5ec);};}exports[_0x804b('0x29')]=function(_0x4a6079,_0x3eb531){var _0x2931ff={},_0x410871={},_0x5c7026={'count':0x0,'rows':[]};var _0x3dbd41=_[_0x804b('0x2a')](db[_0x804b('0x2b')]['rawAttributes'],function(_0x408857){return{'name':_0x408857[_0x804b('0x2c')],'type':_0x408857['type'][_0x804b('0x2d')]};});_0x410871[_0x804b('0x2e')]=_[_0x804b('0x2a')](_0x3dbd41,_0x804b('0x27'));_0x410871[_0x804b('0x2f')]=_[_0x804b('0x30')](_0x4a6079['query']);_0x410871[_0x804b('0x31')]=_[_0x804b('0x32')](_0x410871[_0x804b('0x2e')],_0x410871[_0x804b('0x2f')]);_0x2931ff[_0x804b('0x33')]=_[_0x804b('0x32')](_0x410871[_0x804b('0x2e')],qs[_0x804b('0x34')](_0x4a6079[_0x804b('0x2f')][_0x804b('0x34')]));_0x2931ff[_0x804b('0x33')]=_0x2931ff[_0x804b('0x33')][_0x804b('0x35')]?_0x2931ff[_0x804b('0x33')]:_0x410871[_0x804b('0x2e')];if(!_0x4a6079[_0x804b('0x2f')][_0x804b('0x36')](_0x804b('0x37'))){_0x2931ff[_0x804b('0x1d')]=qs[_0x804b('0x1d')](_0x4a6079[_0x804b('0x2f')][_0x804b('0x1d')]);_0x2931ff[_0x804b('0x1c')]=qs[_0x804b('0x1c')](_0x4a6079[_0x804b('0x2f')]['offset']);}_0x2931ff['order']=qs['sort'](_0x4a6079[_0x804b('0x2f')][_0x804b('0x38')]);_0x2931ff[_0x804b('0x39')]=qs['filters'](_['pick'](_0x4a6079['query'],_0x410871[_0x804b('0x31')]),_0x3dbd41);if(_0x4a6079[_0x804b('0x2f')][_0x804b('0x3a')]){_0x2931ff[_0x804b('0x39')]=_[_0x804b('0x3b')](_0x2931ff[_0x804b('0x39')],{'$or':_[_0x804b('0x2a')](_0x3dbd41,function(_0xc5eefa){if(_0xc5eefa[_0x804b('0x3c')]!==_0x804b('0x3d')){var _0x878dac={};_0x878dac[_0xc5eefa[_0x804b('0x27')]]={'$like':'%'+_0x4a6079[_0x804b('0x2f')]['filter']+'%'};return _0x878dac;}})});}_0x2931ff=_[_0x804b('0x3b')]({},_0x2931ff,_0x4a6079[_0x804b('0x3e')]);var _0xb877d6={'where':_0x2931ff[_0x804b('0x39')]};return db[_0x804b('0x2b')]['count'](_0xb877d6)['then'](function(_0x203890){_0x5c7026[_0x804b('0x1f')]=_0x203890;if(_0x4a6079[_0x804b('0x2f')]['includeAll']){_0x2931ff[_0x804b('0x3f')]=[{'all':!![]}];}return db['FreshdeskField'][_0x804b('0x40')](_0x2931ff);})[_0x804b('0x24')](function(_0x20ccc7){_0x5c7026[_0x804b('0x41')]=_0x20ccc7;return _0x5c7026;})[_0x804b('0x24')](respondWithFilteredResult(_0x3eb531,_0x2931ff))[_0x804b('0x42')](handleError(_0x3eb531,null));};exports[_0x804b('0x43')]=function(_0x51c8ff,_0x17972a){var _0x1c0363={'raw':!![],'where':{'id':_0x51c8ff[_0x804b('0x44')]['id']}},_0x1dcec8={};_0x1dcec8['model']=_[_0x804b('0x30')](db[_0x804b('0x2b')][_0x804b('0x45')]);_0x1dcec8[_0x804b('0x2f')]=_[_0x804b('0x30')](_0x51c8ff[_0x804b('0x2f')]);_0x1dcec8[_0x804b('0x31')]=_[_0x804b('0x32')](_0x1dcec8['model'],_0x1dcec8[_0x804b('0x2f')]);_0x1c0363['attributes']=_['intersection'](_0x1dcec8['model'],qs[_0x804b('0x34')](_0x51c8ff['query'][_0x804b('0x34')]));_0x1c0363[_0x804b('0x33')]=_0x1c0363[_0x804b('0x33')][_0x804b('0x35')]?_0x1c0363['attributes']:_0x1dcec8[_0x804b('0x2e')];if(_0x51c8ff[_0x804b('0x2f')][_0x804b('0x46')]){_0x1c0363['include']=[{'all':!![]}];}_0x1c0363=_[_0x804b('0x3b')]({},_0x1c0363,_0x51c8ff[_0x804b('0x3e')]);return db[_0x804b('0x2b')]['find'](_0x1c0363)[_0x804b('0x24')](handleEntityNotFound(_0x17972a,null))[_0x804b('0x24')](respondWithResult(_0x17972a,null))[_0x804b('0x42')](handleError(_0x17972a,null));};exports[_0x804b('0x47')]=function(_0x1051e9,_0x3a39f5){return db[_0x804b('0x2b')][_0x804b('0x47')](_0x1051e9[_0x804b('0x48')],{})[_0x804b('0x24')](respondWithResult(_0x3a39f5,0xc9))[_0x804b('0x42')](handleError(_0x3a39f5,null));};exports[_0x804b('0x49')]=function(_0x20862f,_0x2c1796){if(_0x20862f['body']['id']){delete _0x20862f['body']['id'];}return db[_0x804b('0x2b')][_0x804b('0x4a')]({'where':{'id':_0x20862f[_0x804b('0x44')]['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x2c1796,null))[_0x804b('0x24')](saveUpdates(_0x20862f['body'],null))[_0x804b('0x24')](respondWithResult(_0x2c1796,null))[_0x804b('0x42')](handleError(_0x2c1796,null));};exports[_0x804b('0x25')]=function(_0x3ca9ff,_0x47247c){return db[_0x804b('0x2b')]['find']({'where':{'id':_0x3ca9ff['params']['id']}})[_0x804b('0x24')](handleEntityNotFound(_0x47247c,null))[_0x804b('0x24')](removeEntity(_0x47247c,null))['catch'](handleError(_0x47247c,null));}; \ No newline at end of file +var _0xc3fe=['destroy','end','name','status','send','index','map','FreshdeskField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then'];(function(_0xc4577d,_0x44fb35){var _0xfb792e=function(_0x2edb27){while(--_0x2edb27){_0xc4577d['push'](_0xc4577d['shift']());}};_0xfb792e(++_0x44fb35);}(_0xc3fe,0xff));var _0xec3f=function(_0x110b25,_0x4b6124){_0x110b25=_0x110b25-0x0;var _0xe494f5=_0xc3fe[_0x110b25];return _0xe494f5;};'use strict';var emlformat=require(_0xec3f('0x0'));var rimraf=require(_0xec3f('0x1'));var zipdir=require(_0xec3f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xec3f('0x3'));var moment=require(_0xec3f('0x4'));var BPromise=require(_0xec3f('0x5'));var Mustache=require('mustache');var util=require(_0xec3f('0x6'));var path=require(_0xec3f('0x7'));var sox=require(_0xec3f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec3f('0x9'));var _=require(_0xec3f('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xec3f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xec3f('0xc'));var querystring=require(_0xec3f('0xd'));var Papa=require(_0xec3f('0xe'));var Redis=require(_0xec3f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xec3f('0x10'));var as=require(_0xec3f('0x11'));var hardwareService=require(_0xec3f('0x12'));var logger=require(_0xec3f('0x13'))(_0xec3f('0x14'));var utils=require(_0xec3f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xec3f('0x16'));var db=require(_0xec3f('0x17'))['db'];function respondWithStatusCode(_0x367c5e,_0x57891d){_0x57891d=_0x57891d||0xcc;return function(_0x5367df){if(_0x5367df){return _0x367c5e[_0xec3f('0x18')](_0x57891d);}return _0x367c5e['status'](_0x57891d)['end']();};}function respondWithResult(_0x209ffa,_0x4318bd){_0x4318bd=_0x4318bd||0xc8;return function(_0x113d16){if(_0x113d16){return _0x209ffa['status'](_0x4318bd)['json'](_0x113d16);}};}function respondWithFilteredResult(_0x5509ec,_0x5ad65a){return function(_0x37d688){if(_0x37d688){var _0x10ff81=typeof _0x5ad65a['offset']===_0xec3f('0x19')&&typeof _0x5ad65a[_0xec3f('0x1a')]===_0xec3f('0x19');var _0x3b7393=_0x37d688['count'];var _0x7805c=_0x10ff81?0x0:_0x5ad65a[_0xec3f('0x1b')];var _0x2d338=_0x10ff81?_0x37d688[_0xec3f('0x1c')]:_0x5ad65a[_0xec3f('0x1b')]+_0x5ad65a['limit'];var _0x2f8bc8;if(_0x2d338>=_0x3b7393){_0x2d338=_0x3b7393;_0x2f8bc8=0xc8;}else{_0x2f8bc8=0xce;}_0x5509ec['status'](_0x2f8bc8);return _0x5509ec[_0xec3f('0x1d')](_0xec3f('0x1e'),_0x7805c+'-'+_0x2d338+'/'+_0x3b7393)[_0xec3f('0x1f')](_0x37d688);}return null;};}function patchUpdates(_0x47b6f9){return function(_0x526ff){try{jsonpatch[_0xec3f('0x20')](_0x526ff,_0x47b6f9,!![]);}catch(_0x4fdfc3){return BPromise[_0xec3f('0x21')](_0x4fdfc3);}return _0x526ff[_0xec3f('0x22')]();};}function saveUpdates(_0x1f173f,_0x395b9a){return function(_0x4d9598){if(_0x4d9598){return _0x4d9598[_0xec3f('0x23')](_0x1f173f)[_0xec3f('0x24')](function(_0x2f45bb){return _0x2f45bb;});}return null;};}function removeEntity(_0x4e4770,_0xfc9c0d){return function(_0x4b5932){if(_0x4b5932){return _0x4b5932[_0xec3f('0x25')]()['then'](function(){_0x4e4770['status'](0xcc)[_0xec3f('0x26')]();});}};}function handleEntityNotFound(_0x482bf2,_0x217b7d){return function(_0xa12054){if(!_0xa12054){_0x482bf2[_0xec3f('0x18')](0x194);}return _0xa12054;};}function handleError(_0x4df17b,_0x296fc3){_0x296fc3=_0x296fc3||0x1f4;return function(_0x1da532){logger['error'](_0x1da532['stack']);if(_0x1da532[_0xec3f('0x27')]){delete _0x1da532['name'];}_0x4df17b[_0xec3f('0x28')](_0x296fc3)[_0xec3f('0x29')](_0x1da532);};}exports[_0xec3f('0x2a')]=function(_0x2eac8d,_0x4614c9){var _0x19473c={},_0x2f2d15={},_0x237134={'count':0x0,'rows':[]};var _0x56217e=_[_0xec3f('0x2b')](db[_0xec3f('0x2c')]['rawAttributes'],function(_0x91c11a){return{'name':_0x91c11a[_0xec3f('0x2d')],'type':_0x91c11a[_0xec3f('0x2e')][_0xec3f('0x2f')]};});_0x2f2d15[_0xec3f('0x30')]=_[_0xec3f('0x2b')](_0x56217e,_0xec3f('0x27'));_0x2f2d15[_0xec3f('0x31')]=_[_0xec3f('0x32')](_0x2eac8d[_0xec3f('0x31')]);_0x2f2d15[_0xec3f('0x33')]=_[_0xec3f('0x34')](_0x2f2d15[_0xec3f('0x30')],_0x2f2d15[_0xec3f('0x31')]);_0x19473c[_0xec3f('0x35')]=_['intersection'](_0x2f2d15[_0xec3f('0x30')],qs[_0xec3f('0x36')](_0x2eac8d[_0xec3f('0x31')][_0xec3f('0x36')]));_0x19473c[_0xec3f('0x35')]=_0x19473c['attributes'][_0xec3f('0x37')]?_0x19473c[_0xec3f('0x35')]:_0x2f2d15[_0xec3f('0x30')];if(!_0x2eac8d['query']['hasOwnProperty'](_0xec3f('0x38'))){_0x19473c['limit']=qs[_0xec3f('0x1a')](_0x2eac8d['query'][_0xec3f('0x1a')]);_0x19473c['offset']=qs['offset'](_0x2eac8d[_0xec3f('0x31')][_0xec3f('0x1b')]);}_0x19473c[_0xec3f('0x39')]=qs[_0xec3f('0x3a')](_0x2eac8d[_0xec3f('0x31')][_0xec3f('0x3a')]);_0x19473c['where']=qs['filters'](_[_0xec3f('0x3b')](_0x2eac8d[_0xec3f('0x31')],_0x2f2d15[_0xec3f('0x33')]),_0x56217e);if(_0x2eac8d[_0xec3f('0x31')][_0xec3f('0x3c')]){_0x19473c[_0xec3f('0x3d')]=_[_0xec3f('0x3e')](_0x19473c['where'],{'$or':_[_0xec3f('0x2b')](_0x56217e,function(_0x5aadc3){if(_0x5aadc3[_0xec3f('0x2e')]!==_0xec3f('0x3f')){var _0x2c8f59={};_0x2c8f59[_0x5aadc3[_0xec3f('0x27')]]={'$like':'%'+_0x2eac8d[_0xec3f('0x31')][_0xec3f('0x3c')]+'%'};return _0x2c8f59;}})});}_0x19473c=_[_0xec3f('0x3e')]({},_0x19473c,_0x2eac8d[_0xec3f('0x40')]);var _0x35b902={'where':_0x19473c[_0xec3f('0x3d')]};return db[_0xec3f('0x2c')][_0xec3f('0x1c')](_0x35b902)[_0xec3f('0x24')](function(_0x482219){_0x237134[_0xec3f('0x1c')]=_0x482219;if(_0x2eac8d[_0xec3f('0x31')]['includeAll']){_0x19473c[_0xec3f('0x41')]=[{'all':!![]}];}return db[_0xec3f('0x2c')]['findAll'](_0x19473c);})[_0xec3f('0x24')](function(_0xae1b8a){_0x237134[_0xec3f('0x42')]=_0xae1b8a;return _0x237134;})[_0xec3f('0x24')](respondWithFilteredResult(_0x4614c9,_0x19473c))[_0xec3f('0x43')](handleError(_0x4614c9,null));};exports[_0xec3f('0x44')]=function(_0x5e434d,_0x142d85){var _0x386e96={'raw':!![],'where':{'id':_0x5e434d[_0xec3f('0x45')]['id']}},_0x1c6494={};_0x1c6494[_0xec3f('0x30')]=_[_0xec3f('0x32')](db[_0xec3f('0x2c')][_0xec3f('0x46')]);_0x1c6494[_0xec3f('0x31')]=_['keys'](_0x5e434d[_0xec3f('0x31')]);_0x1c6494['filters']=_[_0xec3f('0x34')](_0x1c6494[_0xec3f('0x30')],_0x1c6494[_0xec3f('0x31')]);_0x386e96[_0xec3f('0x35')]=_[_0xec3f('0x34')](_0x1c6494[_0xec3f('0x30')],qs[_0xec3f('0x36')](_0x5e434d[_0xec3f('0x31')][_0xec3f('0x36')]));_0x386e96[_0xec3f('0x35')]=_0x386e96[_0xec3f('0x35')][_0xec3f('0x37')]?_0x386e96['attributes']:_0x1c6494[_0xec3f('0x30')];if(_0x5e434d[_0xec3f('0x31')]['includeAll']){_0x386e96[_0xec3f('0x41')]=[{'all':!![]}];}_0x386e96=_[_0xec3f('0x3e')]({},_0x386e96,_0x5e434d[_0xec3f('0x40')]);return db[_0xec3f('0x2c')]['find'](_0x386e96)['then'](handleEntityNotFound(_0x142d85,null))[_0xec3f('0x24')](respondWithResult(_0x142d85,null))[_0xec3f('0x43')](handleError(_0x142d85,null));};exports['create']=function(_0x2a9fc8,_0x28acd1){return db[_0xec3f('0x2c')]['create'](_0x2a9fc8[_0xec3f('0x47')],{})['then'](respondWithResult(_0x28acd1,0xc9))['catch'](handleError(_0x28acd1,null));};exports['update']=function(_0x97c57d,_0x1b7cf6){if(_0x97c57d[_0xec3f('0x47')]['id']){delete _0x97c57d[_0xec3f('0x47')]['id'];}return db['FreshdeskField'][_0xec3f('0x48')]({'where':{'id':_0x97c57d['params']['id']}})[_0xec3f('0x24')](handleEntityNotFound(_0x1b7cf6,null))[_0xec3f('0x24')](saveUpdates(_0x97c57d[_0xec3f('0x47')],null))[_0xec3f('0x24')](respondWithResult(_0x1b7cf6,null))[_0xec3f('0x43')](handleError(_0x1b7cf6,null));};exports[_0xec3f('0x25')]=function(_0x515bf2,_0x2ab636){return db['FreshdeskField'][_0xec3f('0x48')]({'where':{'id':_0x515bf2['params']['id']}})[_0xec3f('0x24')](handleEntityNotFound(_0x2ab636,null))['then'](removeEntity(_0x2ab636,null))[_0xec3f('0x43')](handleError(_0x2ab636,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index fb7323a..14c6173 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 _0x8d5b=['rimraf','../../config/environment','./intFreshdeskField.attributes','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','api','moment','bluebird','path'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x8d5b,0x19f));var _0xb8d5=function(_0x5311a1,_0x304912){_0x5311a1=_0x5311a1-0x0;var _0x2acb9f=_0x8d5b[_0x5311a1];return _0x2acb9f;};'use strict';var _=require(_0xb8d5('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xb8d5('0x1'));var moment=require(_0xb8d5('0x2'));var BPromise=require(_0xb8d5('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb8d5('0x4'));var rimraf=require(_0xb8d5('0x5'));var config=require(_0xb8d5('0x6'));var attributes=require(_0xb8d5('0x7'));module['exports']=function(_0x5eb975,_0x3a841b){return _0x5eb975['define'](_0xb8d5('0x8'),attributes,{'tableName':_0xb8d5('0x9'),'paranoid':![],'indexes':[{'name':_0xb8d5('0xa'),'fields':['idField',_0xb8d5('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x331c=['bluebird','rimraf','./intFreshdeskField.attributes','exports','define','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','../../config/logger'];(function(_0x294421,_0x17d482){var _0x510cea=function(_0x36ad25){while(--_0x36ad25){_0x294421['push'](_0x294421['shift']());}};_0x510cea(++_0x17d482);}(_0x331c,0xf0));var _0xc331=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0x331c[_0x9df060];return _0x338dfe;};'use strict';var _=require(_0xc331('0x0'));var util=require('util');var logger=require(_0xc331('0x1'))('api');var moment=require('moment');var BPromise=require(_0xc331('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc331('0x3'));var config=require('../../config/environment');var attributes=require(_0xc331('0x4'));module[_0xc331('0x5')]=function(_0x567fe9,_0x14a44f){return _0x567fe9[_0xc331('0x6')]('FreshdeskField',attributes,{'tableName':_0xc331('0x7'),'paranoid':![],'indexes':[{'name':_0xc331('0x8'),'fields':[_0xc331('0x9'),_0xc331('0xa')],'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 6e96a0c..599ae8e 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 _0x6501=['request\x20sent','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info'];(function(_0xb30a60,_0x19580f){var _0x381a7b=function(_0x27f846){while(--_0x27f846){_0xb30a60['push'](_0xb30a60['shift']());}};_0x381a7b(++_0x19580f);}(_0x6501,0x179));var _0x1650=function(_0x2ba540,_0x38dc1f){_0x2ba540=_0x2ba540-0x0;var _0x1d611f=_0x6501[_0x2ba540];return _0x1d611f;};'use strict';var _=require(_0x1650('0x0'));var util=require(_0x1650('0x1'));var moment=require(_0x1650('0x2'));var BPromise=require(_0x1650('0x3'));var rs=require(_0x1650('0x4'));var fs=require('fs');var Redis=require(_0x1650('0x5'));var db=require(_0x1650('0x6'))['db'];var utils=require(_0x1650('0x7'));var logger=require(_0x1650('0x8'))(_0x1650('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1650('0xa')][_0x1650('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4713cc,_0x31f411,_0xa309f2){return new BPromise(function(_0x86612e,_0x4f1505){return client['request'](_0x4713cc,_0xa309f2)[_0x1650('0xc')](function(_0x348397){logger[_0x1650('0xd')]('FreshdeskField,\x20%s,\x20%s',_0x31f411,_0x1650('0xe'));logger['debug'](_0x1650('0xf'),_0x31f411,_0x1650('0xe'),JSON[_0x1650('0x10')](_0x348397));if(_0x348397[_0x1650('0x11')]){if(_0x348397[_0x1650('0x11')][_0x1650('0x12')]===0x1f4){logger['error'](_0x1650('0x13'),_0x31f411,_0x348397['error'][_0x1650('0x14')]);return _0x4f1505(_0x348397[_0x1650('0x11')][_0x1650('0x14')]);}logger['error'](_0x1650('0x13'),_0x31f411,_0x348397[_0x1650('0x11')][_0x1650('0x14')]);return _0x86612e(_0x348397['error']['message']);}else{logger[_0x1650('0xd')](_0x1650('0x13'),_0x31f411,'request\x20sent');_0x86612e(_0x348397[_0x1650('0x15')][_0x1650('0x14')]);}})[_0x1650('0x16')](function(_0x2dbd13){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x31f411,_0x2dbd13);_0x4f1505(_0x2dbd13);});});} \ No newline at end of file +var _0xafe2=['util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshdeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1a0510,_0x107972){var _0x4c7348=function(_0x334fd8){while(--_0x334fd8){_0x1a0510['push'](_0x1a0510['shift']());}};_0x4c7348(++_0x107972);}(_0xafe2,0x1e0));var _0x2afe=function(_0x440153,_0x3c99a4){_0x440153=_0x440153-0x0;var _0x1b2667=_0xafe2[_0x440153];return _0x1b2667;};'use strict';var _=require('lodash');var util=require(_0x2afe('0x0'));var moment=require('moment');var BPromise=require(_0x2afe('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2afe('0x2'));var db=require(_0x2afe('0x3'))['db'];var utils=require(_0x2afe('0x4'));var logger=require(_0x2afe('0x5'))(_0x2afe('0x6'));var config=require(_0x2afe('0x7'));var jayson=require(_0x2afe('0x8'));var client=jayson[_0x2afe('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x250982,_0x18f1db,_0x2226a9){return new BPromise(function(_0xeaab4b,_0x207f34){return client[_0x2afe('0xa')](_0x250982,_0x2226a9)[_0x2afe('0xb')](function(_0x2c9ebf){logger[_0x2afe('0xc')](_0x2afe('0xd'),_0x18f1db,_0x2afe('0xe'));logger[_0x2afe('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x18f1db,_0x2afe('0xe'),JSON[_0x2afe('0x10')](_0x2c9ebf));if(_0x2c9ebf['error']){if(_0x2c9ebf[_0x2afe('0x11')][_0x2afe('0x12')]===0x1f4){logger[_0x2afe('0x11')](_0x2afe('0xd'),_0x18f1db,_0x2c9ebf['error'][_0x2afe('0x13')]);return _0x207f34(_0x2c9ebf['error'][_0x2afe('0x13')]);}logger[_0x2afe('0x11')](_0x2afe('0xd'),_0x18f1db,_0x2c9ebf[_0x2afe('0x11')][_0x2afe('0x13')]);return _0xeaab4b(_0x2c9ebf[_0x2afe('0x11')][_0x2afe('0x13')]);}else{logger['info'](_0x2afe('0xd'),_0x18f1db,'request\x20sent');_0xeaab4b(_0x2c9ebf['result'][_0x2afe('0x13')]);}})['catch'](function(_0x56c1e2){logger[_0x2afe('0x11')](_0x2afe('0xd'),_0x18f1db,_0x56c1e2);_0x207f34(_0x56c1e2);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index be79d4f..36ddf27 100644 --- a/server/api/intFreshsalesAccount/index.js +++ b/server/api/intFreshsalesAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2547=['addConfiguration','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create'];(function(_0x1b4076,_0x48a507){var _0x1458d4=function(_0x4cbf89){while(--_0x4cbf89){_0x1b4076['push'](_0x1b4076['shift']());}};_0x1458d4(++_0x48a507);}(_0x2547,0x1cd));var _0x7254=function(_0x4fec5c,_0x2e3d55){_0x4fec5c=_0x4fec5c-0x0;var _0x336d9c=_0x2547[_0x4fec5c];return _0x336d9c;};'use strict';var multer=require('multer');var util=require(_0x7254('0x0'));var path=require(_0x7254('0x1'));var timeout=require(_0x7254('0x2'));var express=require(_0x7254('0x3'));var router=express[_0x7254('0x4')]();var fs_extra=require(_0x7254('0x5'));var auth=require(_0x7254('0x6'));var interaction=require(_0x7254('0x7'));var config=require('../../config/environment');var controller=require(_0x7254('0x8'));router[_0x7254('0x9')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0xb')]);router['get'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0xd')]);router['get'](_0x7254('0xe'),auth['isAuthenticated'](),controller['getConfigurations']);router['get'](_0x7254('0xf'),auth[_0x7254('0xa')](),controller[_0x7254('0x10')]);router[_0x7254('0x11')]('/',auth[_0x7254('0xa')](),controller[_0x7254('0x12')]);router['post'](_0x7254('0xe'),auth['isAuthenticated'](),controller[_0x7254('0x13')]);router['put'](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0x14')]);router[_0x7254('0x15')](_0x7254('0xc'),auth[_0x7254('0xa')](),controller[_0x7254('0x16')]);module[_0x7254('0x17')]=router; \ No newline at end of file +var _0x4fc2=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','index','/:id','show','get','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','update','delete','exports','multer','util','path'];(function(_0x3c42b2,_0xa54dc6){var _0x54318e=function(_0x1e2e8e){while(--_0x1e2e8e){_0x3c42b2['push'](_0x3c42b2['shift']());}};_0x54318e(++_0xa54dc6);}(_0x4fc2,0x111));var _0x24fc=function(_0x38257d,_0x4aa6da){_0x38257d=_0x38257d-0x0;var _0x1175b3=_0x4fc2[_0x38257d];return _0x1175b3;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')](_0x24fc('0xe'),auth[_0x24fc('0x9')](),controller['getConfigurations']);router[_0x24fc('0xd')](_0x24fc('0xf'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x10')]);router[_0x24fc('0x11')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0x12')]);router[_0x24fc('0x11')]('/:id/configurations',auth[_0x24fc('0x9')](),controller[_0x24fc('0x13')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x14')]);router[_0x24fc('0x15')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller['destroy']);module[_0x24fc('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index b9b89d9..0adabf8 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7096=['exports','STRING','username','remoteUri'];(function(_0xaf3f37,_0x9c7557){var _0x39966a=function(_0x2442fa){while(--_0x2442fa){_0xaf3f37['push'](_0xaf3f37['shift']());}};_0x39966a(++_0x9c7557);}(_0x7096,0x10c));var _0x6709=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x7096[_0x5b561d];return _0x431060;};'use strict';var Sequelize=require('sequelize');module[_0x6709('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6709('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x6709('0x2')},'apiKey':{'type':Sequelize[_0x6709('0x1')]},'remoteUri':{'type':Sequelize[_0x6709('0x1')],'unique':_0x6709('0x3')},'serverUrl':{'type':Sequelize[_0x6709('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xd4a2=['STRING','username','sequelize'];(function(_0x1df691,_0x2605a0){var _0x7ec437=function(_0xd5a3f5){while(--_0xd5a3f5){_0x1df691['push'](_0x1df691['shift']());}};_0x7ec437(++_0x2605a0);}(_0xd4a2,0x173));var _0x2d4a=function(_0x29d3fe,_0x31894c){_0x29d3fe=_0x29d3fe-0x0;var _0xf784ff=_0xd4a2[_0x29d3fe];return _0xf784ff;};'use strict';var Sequelize=require(_0x2d4a('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2d4a('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x2d4a('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x2d4a('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x2d4a('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index f7c38be..ec6022a 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8ea0=['VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','intersection','find','update','body','params','getConfigurations','findOne','FreshsalesConfiguration','filter','addConfiguration','AccountId','getSubjects','Descriptions','channel','FreshsalesField','getFields','username','remoteUri','apiKey','substring','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','then','destroy','error','name','send','index','map','FreshsalesAccount','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge'];(function(_0x2fb25f,_0x19f264){var _0x2a2ccd=function(_0x270ee9){while(--_0x270ee9){_0x2fb25f['push'](_0x2fb25f['shift']());}};_0x2a2ccd(++_0x19f264);}(_0x8ea0,0xf5));var _0x08ea=function(_0x26b947,_0x561f91){_0x26b947=_0x26b947-0x0;var _0x4fb87a=_0x8ea0[_0x26b947];return _0x4fb87a;};'use strict';var emlformat=require(_0x08ea('0x0'));var rimraf=require(_0x08ea('0x1'));var zipdir=require(_0x08ea('0x2'));var jsonpatch=require(_0x08ea('0x3'));var rp=require('request-promise');var moment=require(_0x08ea('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x08ea('0x5'));var util=require(_0x08ea('0x6'));var path=require(_0x08ea('0x7'));var sox=require(_0x08ea('0x8'));var csv=require(_0x08ea('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x08ea('0xa'));var _=require(_0x08ea('0xb'));var squel=require(_0x08ea('0xc'));var crypto=require(_0x08ea('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x08ea('0xe'));var toCsv=require('to-csv');var querystring=require(_0x08ea('0xf'));var Papa=require('papaparse');var Redis=require(_0x08ea('0x10'));var authService=require(_0x08ea('0x11'));var qs=require(_0x08ea('0x12'));var as=require(_0x08ea('0x13'));var hardwareService=require(_0x08ea('0x14'));var logger=require(_0x08ea('0x15'))(_0x08ea('0x16'));var utils=require('../../config/utils');var config=require(_0x08ea('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x08ea('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2b0dd3,_0x4860af){_0x4860af=_0x4860af||0xcc;return function(_0x1d3604){if(_0x1d3604){return _0x2b0dd3[_0x08ea('0x19')](_0x4860af);}return _0x2b0dd3[_0x08ea('0x1a')](_0x4860af)[_0x08ea('0x1b')]();};}function respondWithResult(_0x53453a,_0x178e12){_0x178e12=_0x178e12||0xc8;return function(_0x50c186){if(_0x50c186){return _0x53453a['status'](_0x178e12)[_0x08ea('0x1c')](_0x50c186);}};}function respondWithFilteredResult(_0x43b3d5,_0x70c6d9){return function(_0x5ca343){if(_0x5ca343){var _0x2455bd=typeof _0x70c6d9[_0x08ea('0x1d')]===_0x08ea('0x1e')&&typeof _0x70c6d9['limit']==='undefined';var _0x245022=_0x5ca343[_0x08ea('0x1f')];var _0xff5145=_0x2455bd?0x0:_0x70c6d9[_0x08ea('0x1d')];var _0x1884b5=_0x2455bd?_0x5ca343[_0x08ea('0x1f')]:_0x70c6d9[_0x08ea('0x1d')]+_0x70c6d9[_0x08ea('0x20')];var _0x581caf;if(_0x1884b5>=_0x245022){_0x1884b5=_0x245022;_0x581caf=0xc8;}else{_0x581caf=0xce;}_0x43b3d5['status'](_0x581caf);return _0x43b3d5[_0x08ea('0x21')]('Content-Range',_0xff5145+'-'+_0x1884b5+'/'+_0x245022)[_0x08ea('0x1c')](_0x5ca343);}return null;};}function patchUpdates(_0x383c6b){return function(_0x1fbc74){try{jsonpatch['apply'](_0x1fbc74,_0x383c6b,!![]);}catch(_0x11776e){return BPromise[_0x08ea('0x22')](_0x11776e);}return _0x1fbc74[_0x08ea('0x23')]();};}function saveUpdates(_0x4cf1b8,_0x5b3281){return function(_0x38f762){if(_0x38f762){return _0x38f762['update'](_0x4cf1b8)[_0x08ea('0x24')](function(_0x11f252){return _0x11f252;});}return null;};}function removeEntity(_0x5260bc,_0x23ab6e){return function(_0x37da2a){if(_0x37da2a){return _0x37da2a[_0x08ea('0x25')]()[_0x08ea('0x24')](function(){_0x5260bc['status'](0xcc)[_0x08ea('0x1b')]();});}};}function handleEntityNotFound(_0x8fc50,_0x265187){return function(_0xab63f7){if(!_0xab63f7){_0x8fc50[_0x08ea('0x19')](0x194);}return _0xab63f7;};}function handleError(_0x50bf0d,_0x28d88a){_0x28d88a=_0x28d88a||0x1f4;return function(_0x38871f){logger[_0x08ea('0x26')](_0x38871f['stack']);if(_0x38871f[_0x08ea('0x27')]){delete _0x38871f[_0x08ea('0x27')];}_0x50bf0d[_0x08ea('0x1a')](_0x28d88a)[_0x08ea('0x28')](_0x38871f);};}exports[_0x08ea('0x29')]=function(_0x45a899,_0xb8aab4){var _0x2408a1={},_0x374211={},_0x4d5b1e={'count':0x0,'rows':[]};var _0x174de9=_[_0x08ea('0x2a')](db[_0x08ea('0x2b')][_0x08ea('0x2c')],function(_0x1e450e){return{'name':_0x1e450e[_0x08ea('0x2d')],'type':_0x1e450e[_0x08ea('0x2e')][_0x08ea('0x2f')]};});_0x374211[_0x08ea('0x30')]=_[_0x08ea('0x2a')](_0x174de9,'name');_0x374211[_0x08ea('0x31')]=_['keys'](_0x45a899[_0x08ea('0x31')]);_0x374211[_0x08ea('0x32')]=_['intersection'](_0x374211[_0x08ea('0x30')],_0x374211[_0x08ea('0x31')]);_0x2408a1[_0x08ea('0x33')]=_['intersection'](_0x374211[_0x08ea('0x30')],qs[_0x08ea('0x34')](_0x45a899[_0x08ea('0x31')][_0x08ea('0x34')]));_0x2408a1[_0x08ea('0x33')]=_0x2408a1[_0x08ea('0x33')][_0x08ea('0x35')]?_0x2408a1[_0x08ea('0x33')]:_0x374211['model'];if(!_0x45a899['query'][_0x08ea('0x36')](_0x08ea('0x37'))){_0x2408a1[_0x08ea('0x20')]=qs[_0x08ea('0x20')](_0x45a899[_0x08ea('0x31')][_0x08ea('0x20')]);_0x2408a1['offset']=qs[_0x08ea('0x1d')](_0x45a899['query']['offset']);}_0x2408a1[_0x08ea('0x38')]=qs['sort'](_0x45a899[_0x08ea('0x31')][_0x08ea('0x39')]);_0x2408a1[_0x08ea('0x3a')]=qs[_0x08ea('0x32')](_[_0x08ea('0x3b')](_0x45a899['query'],_0x374211[_0x08ea('0x32')]),_0x174de9);if(_0x45a899[_0x08ea('0x31')]['filter']){_0x2408a1[_0x08ea('0x3a')]=_[_0x08ea('0x3c')](_0x2408a1[_0x08ea('0x3a')],{'$or':_['map'](_0x174de9,function(_0x567831){if(_0x567831[_0x08ea('0x2e')]!==_0x08ea('0x3d')){var _0x28fd67={};_0x28fd67[_0x567831[_0x08ea('0x27')]]={'$like':'%'+_0x45a899[_0x08ea('0x31')]['filter']+'%'};return _0x28fd67;}})});}_0x2408a1=_[_0x08ea('0x3c')]({},_0x2408a1,_0x45a899[_0x08ea('0x3e')]);var _0x129bea={'where':_0x2408a1[_0x08ea('0x3a')]};return db[_0x08ea('0x2b')][_0x08ea('0x1f')](_0x129bea)[_0x08ea('0x24')](function(_0x4f20b7){_0x4d5b1e['count']=_0x4f20b7;if(_0x45a899[_0x08ea('0x31')][_0x08ea('0x3f')]){_0x2408a1[_0x08ea('0x40')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x08ea('0x41')](_0x2408a1);})[_0x08ea('0x24')](function(_0x4e110a){_0x4d5b1e[_0x08ea('0x42')]=_0x4e110a;return _0x4d5b1e;})[_0x08ea('0x24')](respondWithFilteredResult(_0xb8aab4,_0x2408a1))[_0x08ea('0x43')](handleError(_0xb8aab4,null));};exports[_0x08ea('0x44')]=function(_0x546713,_0x13a33e){var _0x2112d3={'raw':![],'where':{'id':_0x546713['params']['id']}},_0x55d687={};_0x55d687[_0x08ea('0x30')]=_[_0x08ea('0x45')](db[_0x08ea('0x2b')]['rawAttributes']);_0x55d687[_0x08ea('0x31')]=_[_0x08ea('0x45')](_0x546713['query']);_0x55d687[_0x08ea('0x32')]=_[_0x08ea('0x46')](_0x55d687[_0x08ea('0x30')],_0x55d687[_0x08ea('0x31')]);_0x2112d3[_0x08ea('0x33')]=_[_0x08ea('0x46')](_0x55d687[_0x08ea('0x30')],qs[_0x08ea('0x34')](_0x546713['query']['fields']));_0x2112d3[_0x08ea('0x33')]=_0x2112d3['attributes']['length']?_0x2112d3[_0x08ea('0x33')]:_0x55d687[_0x08ea('0x30')];if(_0x546713[_0x08ea('0x31')][_0x08ea('0x3f')]){_0x2112d3[_0x08ea('0x40')]=[{'all':!![]}];}_0x2112d3=_[_0x08ea('0x3c')]({},_0x2112d3,_0x546713[_0x08ea('0x3e')]);return db['FreshsalesAccount'][_0x08ea('0x47')](_0x2112d3)[_0x08ea('0x24')](handleEntityNotFound(_0x13a33e,null))[_0x08ea('0x24')](respondWithResult(_0x13a33e,null))[_0x08ea('0x43')](handleError(_0x13a33e,null));};exports['create']=function(_0x514f77,_0xc0d0aa){return db[_0x08ea('0x2b')]['create'](_0x514f77['body'],{})['then'](respondWithResult(_0xc0d0aa,0xc9))[_0x08ea('0x43')](handleError(_0xc0d0aa,null));};exports[_0x08ea('0x48')]=function(_0x20158d,_0x55577e){if(_0x20158d[_0x08ea('0x49')]['id']){delete _0x20158d['body']['id'];}return db[_0x08ea('0x2b')]['find']({'where':{'id':_0x20158d[_0x08ea('0x4a')]['id']}})[_0x08ea('0x24')](handleEntityNotFound(_0x55577e,null))['then'](saveUpdates(_0x20158d[_0x08ea('0x49')],null))[_0x08ea('0x24')](respondWithResult(_0x55577e,null))['catch'](handleError(_0x55577e,null));};exports[_0x08ea('0x25')]=function(_0x5119bc,_0x219c97){return db[_0x08ea('0x2b')]['find']({'where':{'id':_0x5119bc[_0x08ea('0x4a')]['id']}})['then'](handleEntityNotFound(_0x219c97,null))[_0x08ea('0x24')](removeEntity(_0x219c97,null))[_0x08ea('0x43')](handleError(_0x219c97,null));};exports[_0x08ea('0x4b')]=function(_0x237688,_0x55c31c,_0x324cd6){var _0xe322ea={};var _0x420007={};var _0x305442;var _0x3bf410;return db[_0x08ea('0x2b')][_0x08ea('0x4c')]({'where':{'id':_0x237688[_0x08ea('0x4a')]['id']}})[_0x08ea('0x24')](handleEntityNotFound(_0x55c31c,null))[_0x08ea('0x24')](function(_0x4e3099){if(_0x4e3099){_0x305442=_0x4e3099;_0x420007['model']=_[_0x08ea('0x45')](db[_0x08ea('0x4d')][_0x08ea('0x2c')]);_0x420007['query']=_[_0x08ea('0x45')](_0x237688[_0x08ea('0x31')]);_0x420007[_0x08ea('0x32')]=_[_0x08ea('0x46')](_0x420007[_0x08ea('0x30')],_0x420007[_0x08ea('0x31')]);_0xe322ea['attributes']=_['intersection'](_0x420007[_0x08ea('0x30')],qs[_0x08ea('0x34')](_0x237688[_0x08ea('0x31')][_0x08ea('0x34')]));_0xe322ea[_0x08ea('0x33')]=_0xe322ea['attributes'][_0x08ea('0x35')]?_0xe322ea['attributes']:_0x420007[_0x08ea('0x30')];_0xe322ea['order']=qs[_0x08ea('0x39')](_0x237688[_0x08ea('0x31')][_0x08ea('0x39')]);_0xe322ea['where']=qs[_0x08ea('0x32')](_[_0x08ea('0x3b')](_0x237688[_0x08ea('0x31')],_0x420007['filters']));if(_0x237688['query'][_0x08ea('0x4e')]){_0xe322ea[_0x08ea('0x3a')]=_[_0x08ea('0x3c')](_0xe322ea[_0x08ea('0x3a')],{'$or':_['map'](_0xe322ea[_0x08ea('0x33')],function(_0x4ea71f){var _0x401be2={};_0x401be2[_0x4ea71f]={'$like':'%'+_0x237688['query'][_0x08ea('0x4e')]+'%'};return _0x401be2;})});}_0xe322ea=_[_0x08ea('0x3c')]({},_0xe322ea,_0x237688['options']);return _0x305442['getConfigurations'](_0xe322ea);}})['then'](function(_0x5e410f){if(_0x5e410f){_0x3bf410=_0x5e410f[_0x08ea('0x35')];if(!_0x237688[_0x08ea('0x31')][_0x08ea('0x36')](_0x08ea('0x37'))){_0xe322ea['limit']=qs[_0x08ea('0x20')](_0x237688[_0x08ea('0x31')]['limit']);_0xe322ea['offset']=qs[_0x08ea('0x1d')](_0x237688[_0x08ea('0x31')][_0x08ea('0x1d')]);}return _0x305442[_0x08ea('0x4b')](_0xe322ea);}})[_0x08ea('0x24')](function(_0x45508b){if(_0x45508b){return _0x45508b?{'count':_0x3bf410,'rows':_0x45508b}:null;}})[_0x08ea('0x24')](respondWithResult(_0x55c31c,null))[_0x08ea('0x43')](handleError(_0x55c31c,null));};exports[_0x08ea('0x4f')]=function(_0x12c035,_0x262073,_0x29024b){if(_0x12c035[_0x08ea('0x49')]['id']){delete _0x12c035[_0x08ea('0x49')]['id'];}return db[_0x08ea('0x2b')][_0x08ea('0x4c')]({'where':{'id':_0x12c035[_0x08ea('0x4a')]['id']}})[_0x08ea('0x24')](handleEntityNotFound(_0x262073,null))['then'](function(_0x58fb99){if(_0x58fb99){_0x12c035[_0x08ea('0x49')][_0x08ea('0x50')]=_0x58fb99['id'];_0x12c035[_0x08ea('0x49')]['Subjects']=integrations[_0x08ea('0x51')](_0x12c035['body']['channel'],_0x12c035[_0x08ea('0x49')][_0x08ea('0x2e')]);_0x12c035[_0x08ea('0x49')][_0x08ea('0x52')]=integrations['getDescriptions'](_0x12c035['body'][_0x08ea('0x53')],_0x12c035[_0x08ea('0x49')][_0x08ea('0x2e')]);return db[_0x08ea('0x4d')]['create'](_0x12c035[_0x08ea('0x49')],{'include':[{'model':db[_0x08ea('0x54')],'as':'Subjects'},{'model':db[_0x08ea('0x54')],'as':_0x08ea('0x52')}]});}return null;})[_0x08ea('0x24')](respondWithResult(_0x262073,null))[_0x08ea('0x43')](handleError(_0x262073,null));};exports[_0x08ea('0x55')]=function(_0x4d01d9,_0x32f79c,_0x7b63bb){var _0x44f30a='';var _0x3ea6dd='';return db[_0x08ea('0x2b')]['findOne']({'where':{'id':_0x4d01d9[_0x08ea('0x4a')]['id']},'attributes':['id',_0x08ea('0x56'),_0x08ea('0x57'),_0x08ea('0x58')]})[_0x08ea('0x24')](handleEntityNotFound(_0x32f79c,null))[_0x08ea('0x24')](function(_0x4e27d4){if(_0x4e27d4){_0x3ea6dd=_0x4e27d4['username'];_0x44f30a=_0x4e27d4['remoteUri'];var _0x6f8811=_0x4e27d4['remoteUri']['slice'](-0x1);if(_0x6f8811==='/'){_0x44f30a=_0x44f30a[_0x08ea('0x59')](0x0,_0x44f30a[_0x08ea('0x5a')](_0x6f8811));}return rp({'method':'GET','uri':util[_0x08ea('0x5b')](_0x08ea('0x5c'),_0x44f30a,_0x08ea('0x5d')),'headers':{'Authorization':_0x08ea('0x5e')+_0x4e27d4[_0x08ea('0x58')]},'json':!![]});}})[_0x08ea('0x24')](function(_0x286448){if(_0x286448){var _0x1095ed=_0x286448[_0x08ea('0x5f')];var _0x1d8b06=![];var _0x1b26dc=null;for(_0x1b26dc=0x0;_0x1b26dc<_0x1095ed['length'];_0x1b26dc++){if(_0x1095ed[_0x1b26dc][_0x08ea('0x60')]===_0x3ea6dd){_0x1d8b06=!![];}}if(_0x1d8b06){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x08ea('0x61')});}}})[_0x08ea('0x24')](respondWithResult(_0x32f79c,null))[_0x08ea('0x43')](function(_0xd2b61){var _0x526c2d=_0x4d01d9[_0x08ea('0x31')][_0x08ea('0x62')]?0x1f4:_0xd2b61[_0x08ea('0x63')]||0x1f4;logger[_0x08ea('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x08ea('0x55'),_0x526c2d,JSON[_0x08ea('0x64')](_0xd2b61));delete _0xd2b61[_0x08ea('0x27')];if(_0x526c2d===0x191){_0x526c2d=0x190;}_0x32f79c['status'](_0x526c2d)[_0x08ea('0x28')](_0x4d01d9['query'][_0x08ea('0x62')]?{'message':_0x08ea('0x65'),'statusCode':_0xd2b61[_0x08ea('0x63')]}:_0xd2b61);});}; \ No newline at end of file +var _0x5965=['AccountId','Subjects','Descriptions','getDescriptions','channel','FreshsalesField','getFields','username','remoteUri','apiKey','lastIndexOf','GET','format','%s%s','/api/selector/owners','users','email','Requested\x20Resource\x20not\x20Found','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','FreshsalesAccount','rawAttributes','type','key','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','getConfigurations','findOne','FreshsalesConfiguration'];(function(_0x1bf15f,_0x24bb54){var _0x6987c9=function(_0x568650){while(--_0x568650){_0x1bf15f['push'](_0x1bf15f['shift']());}};_0x6987c9(++_0x24bb54);}(_0x5965,0xe4));var _0x5596=function(_0xae21d5,_0x1acf25){_0xae21d5=_0xae21d5-0x0;var _0x5935fb=_0x5965[_0xae21d5];return _0x5935fb;};'use strict';var emlformat=require(_0x5596('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5596('0x1'));var jsonpatch=require(_0x5596('0x2'));var rp=require(_0x5596('0x3'));var moment=require(_0x5596('0x4'));var BPromise=require(_0x5596('0x5'));var Mustache=require(_0x5596('0x6'));var util=require(_0x5596('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x5596('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5596('0x9'));var _=require(_0x5596('0xa'));var squel=require(_0x5596('0xb'));var crypto=require(_0x5596('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x5596('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5596('0xe'));var Papa=require(_0x5596('0xf'));var Redis=require(_0x5596('0x10'));var authService=require(_0x5596('0x11'));var qs=require(_0x5596('0x12'));var as=require(_0x5596('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5596('0x14'))(_0x5596('0x15'));var utils=require(_0x5596('0x16'));var config=require(_0x5596('0x17'));var licenseUtil=require(_0x5596('0x18'));var db=require('../../mysqldb')['db'];var integrations=require(_0x5596('0x19'));function respondWithStatusCode(_0x332fab,_0x1073ae){_0x1073ae=_0x1073ae||0xcc;return function(_0x146bbd){if(_0x146bbd){return _0x332fab[_0x5596('0x1a')](_0x1073ae);}return _0x332fab[_0x5596('0x1b')](_0x1073ae)[_0x5596('0x1c')]();};}function respondWithResult(_0x36f494,_0x41f34b){_0x41f34b=_0x41f34b||0xc8;return function(_0x1290b8){if(_0x1290b8){return _0x36f494[_0x5596('0x1b')](_0x41f34b)[_0x5596('0x1d')](_0x1290b8);}};}function respondWithFilteredResult(_0x34fb19,_0x5d26fe){return function(_0x2772eb){if(_0x2772eb){var _0x35d058=typeof _0x5d26fe[_0x5596('0x1e')]===_0x5596('0x1f')&&typeof _0x5d26fe['limit']===_0x5596('0x1f');var _0x3fe23b=_0x2772eb['count'];var _0x1aa193=_0x35d058?0x0:_0x5d26fe[_0x5596('0x1e')];var _0x1b2573=_0x35d058?_0x2772eb[_0x5596('0x20')]:_0x5d26fe['offset']+_0x5d26fe[_0x5596('0x21')];var _0x45f6e4;if(_0x1b2573>=_0x3fe23b){_0x1b2573=_0x3fe23b;_0x45f6e4=0xc8;}else{_0x45f6e4=0xce;}_0x34fb19[_0x5596('0x1b')](_0x45f6e4);return _0x34fb19[_0x5596('0x22')]('Content-Range',_0x1aa193+'-'+_0x1b2573+'/'+_0x3fe23b)['json'](_0x2772eb);}return null;};}function patchUpdates(_0x895dc5){return function(_0x748b15){try{jsonpatch[_0x5596('0x23')](_0x748b15,_0x895dc5,!![]);}catch(_0x5a6903){return BPromise[_0x5596('0x24')](_0x5a6903);}return _0x748b15[_0x5596('0x25')]();};}function saveUpdates(_0x1a1c32,_0x2c9de0){return function(_0x9f7a45){if(_0x9f7a45){return _0x9f7a45[_0x5596('0x26')](_0x1a1c32)[_0x5596('0x27')](function(_0x3941d3){return _0x3941d3;});}return null;};}function removeEntity(_0x2f1248,_0x49ffb5){return function(_0x138d9c){if(_0x138d9c){return _0x138d9c[_0x5596('0x28')]()[_0x5596('0x27')](function(){_0x2f1248[_0x5596('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a47e6,_0x135e70){return function(_0x1448f3){if(!_0x1448f3){_0x3a47e6[_0x5596('0x1a')](0x194);}return _0x1448f3;};}function handleError(_0x3c1fc6,_0x4e1e1f){_0x4e1e1f=_0x4e1e1f||0x1f4;return function(_0x50f611){logger[_0x5596('0x29')](_0x50f611[_0x5596('0x2a')]);if(_0x50f611['name']){delete _0x50f611[_0x5596('0x2b')];}_0x3c1fc6[_0x5596('0x1b')](_0x4e1e1f)[_0x5596('0x2c')](_0x50f611);};}exports['index']=function(_0x45acbd,_0x1a79f3){var _0x439c91={},_0x12ecf2={},_0xe930c7={'count':0x0,'rows':[]};var _0x1a1726=_[_0x5596('0x2d')](db[_0x5596('0x2e')][_0x5596('0x2f')],function(_0x19bfa1){return{'name':_0x19bfa1['fieldName'],'type':_0x19bfa1[_0x5596('0x30')][_0x5596('0x31')]};});_0x12ecf2['model']=_[_0x5596('0x2d')](_0x1a1726,_0x5596('0x2b'));_0x12ecf2[_0x5596('0x32')]=_[_0x5596('0x33')](_0x45acbd['query']);_0x12ecf2[_0x5596('0x34')]=_['intersection'](_0x12ecf2['model'],_0x12ecf2['query']);_0x439c91[_0x5596('0x35')]=_[_0x5596('0x36')](_0x12ecf2[_0x5596('0x37')],qs[_0x5596('0x38')](_0x45acbd[_0x5596('0x32')]['fields']));_0x439c91[_0x5596('0x35')]=_0x439c91[_0x5596('0x35')][_0x5596('0x39')]?_0x439c91[_0x5596('0x35')]:_0x12ecf2[_0x5596('0x37')];if(!_0x45acbd[_0x5596('0x32')][_0x5596('0x3a')](_0x5596('0x3b'))){_0x439c91[_0x5596('0x21')]=qs[_0x5596('0x21')](_0x45acbd[_0x5596('0x32')][_0x5596('0x21')]);_0x439c91[_0x5596('0x1e')]=qs[_0x5596('0x1e')](_0x45acbd[_0x5596('0x32')][_0x5596('0x1e')]);}_0x439c91[_0x5596('0x3c')]=qs[_0x5596('0x3d')](_0x45acbd['query'][_0x5596('0x3d')]);_0x439c91[_0x5596('0x3e')]=qs[_0x5596('0x34')](_[_0x5596('0x3f')](_0x45acbd['query'],_0x12ecf2[_0x5596('0x34')]),_0x1a1726);if(_0x45acbd[_0x5596('0x32')][_0x5596('0x40')]){_0x439c91[_0x5596('0x3e')]=_[_0x5596('0x41')](_0x439c91[_0x5596('0x3e')],{'$or':_[_0x5596('0x2d')](_0x1a1726,function(_0x55c06c){if(_0x55c06c['type']!==_0x5596('0x42')){var _0x64b612={};_0x64b612[_0x55c06c[_0x5596('0x2b')]]={'$like':'%'+_0x45acbd[_0x5596('0x32')][_0x5596('0x40')]+'%'};return _0x64b612;}})});}_0x439c91=_[_0x5596('0x41')]({},_0x439c91,_0x45acbd['options']);var _0x8d179f={'where':_0x439c91[_0x5596('0x3e')]};return db[_0x5596('0x2e')][_0x5596('0x20')](_0x8d179f)['then'](function(_0x3e1a0e){_0xe930c7[_0x5596('0x20')]=_0x3e1a0e;if(_0x45acbd[_0x5596('0x32')][_0x5596('0x43')]){_0x439c91[_0x5596('0x44')]=[{'all':!![]}];}return db['FreshsalesAccount'][_0x5596('0x45')](_0x439c91);})[_0x5596('0x27')](function(_0x42c90c){_0xe930c7[_0x5596('0x46')]=_0x42c90c;return _0xe930c7;})[_0x5596('0x27')](respondWithFilteredResult(_0x1a79f3,_0x439c91))['catch'](handleError(_0x1a79f3,null));};exports[_0x5596('0x47')]=function(_0x1f8dc3,_0x301561){var _0x52a64e={'raw':![],'where':{'id':_0x1f8dc3[_0x5596('0x48')]['id']}},_0xf1e05a={};_0xf1e05a[_0x5596('0x37')]=_[_0x5596('0x33')](db[_0x5596('0x2e')][_0x5596('0x2f')]);_0xf1e05a[_0x5596('0x32')]=_[_0x5596('0x33')](_0x1f8dc3[_0x5596('0x32')]);_0xf1e05a[_0x5596('0x34')]=_[_0x5596('0x36')](_0xf1e05a[_0x5596('0x37')],_0xf1e05a[_0x5596('0x32')]);_0x52a64e[_0x5596('0x35')]=_[_0x5596('0x36')](_0xf1e05a['model'],qs[_0x5596('0x38')](_0x1f8dc3[_0x5596('0x32')][_0x5596('0x38')]));_0x52a64e[_0x5596('0x35')]=_0x52a64e['attributes'][_0x5596('0x39')]?_0x52a64e[_0x5596('0x35')]:_0xf1e05a[_0x5596('0x37')];if(_0x1f8dc3[_0x5596('0x32')][_0x5596('0x43')]){_0x52a64e[_0x5596('0x44')]=[{'all':!![]}];}_0x52a64e=_['merge']({},_0x52a64e,_0x1f8dc3[_0x5596('0x49')]);return db[_0x5596('0x2e')]['find'](_0x52a64e)[_0x5596('0x27')](handleEntityNotFound(_0x301561,null))[_0x5596('0x27')](respondWithResult(_0x301561,null))[_0x5596('0x4a')](handleError(_0x301561,null));};exports[_0x5596('0x4b')]=function(_0x554885,_0x4df63f){return db[_0x5596('0x2e')][_0x5596('0x4b')](_0x554885['body'],{})[_0x5596('0x27')](respondWithResult(_0x4df63f,0xc9))[_0x5596('0x4a')](handleError(_0x4df63f,null));};exports[_0x5596('0x26')]=function(_0x45b5fd,_0x1e163c){if(_0x45b5fd[_0x5596('0x4c')]['id']){delete _0x45b5fd[_0x5596('0x4c')]['id'];}return db[_0x5596('0x2e')][_0x5596('0x4d')]({'where':{'id':_0x45b5fd[_0x5596('0x48')]['id']}})[_0x5596('0x27')](handleEntityNotFound(_0x1e163c,null))[_0x5596('0x27')](saveUpdates(_0x45b5fd[_0x5596('0x4c')],null))[_0x5596('0x27')](respondWithResult(_0x1e163c,null))[_0x5596('0x4a')](handleError(_0x1e163c,null));};exports['destroy']=function(_0x4badcd,_0x368977){return db[_0x5596('0x2e')][_0x5596('0x4d')]({'where':{'id':_0x4badcd['params']['id']}})['then'](handleEntityNotFound(_0x368977,null))['then'](removeEntity(_0x368977,null))[_0x5596('0x4a')](handleError(_0x368977,null));};exports[_0x5596('0x4e')]=function(_0x4afacf,_0xb2bc13,_0x3329f7){var _0x4d73d5={};var _0x21b429={};var _0x7be316;var _0x4112b2;return db['FreshsalesAccount'][_0x5596('0x4f')]({'where':{'id':_0x4afacf[_0x5596('0x48')]['id']}})[_0x5596('0x27')](handleEntityNotFound(_0xb2bc13,null))[_0x5596('0x27')](function(_0x41bf28){if(_0x41bf28){_0x7be316=_0x41bf28;_0x21b429['model']=_['keys'](db[_0x5596('0x50')]['rawAttributes']);_0x21b429[_0x5596('0x32')]=_[_0x5596('0x33')](_0x4afacf[_0x5596('0x32')]);_0x21b429[_0x5596('0x34')]=_[_0x5596('0x36')](_0x21b429[_0x5596('0x37')],_0x21b429['query']);_0x4d73d5[_0x5596('0x35')]=_[_0x5596('0x36')](_0x21b429[_0x5596('0x37')],qs[_0x5596('0x38')](_0x4afacf[_0x5596('0x32')][_0x5596('0x38')]));_0x4d73d5[_0x5596('0x35')]=_0x4d73d5['attributes'][_0x5596('0x39')]?_0x4d73d5['attributes']:_0x21b429[_0x5596('0x37')];_0x4d73d5[_0x5596('0x3c')]=qs[_0x5596('0x3d')](_0x4afacf[_0x5596('0x32')][_0x5596('0x3d')]);_0x4d73d5[_0x5596('0x3e')]=qs[_0x5596('0x34')](_['pick'](_0x4afacf['query'],_0x21b429['filters']));if(_0x4afacf[_0x5596('0x32')][_0x5596('0x40')]){_0x4d73d5['where']=_[_0x5596('0x41')](_0x4d73d5[_0x5596('0x3e')],{'$or':_[_0x5596('0x2d')](_0x4d73d5[_0x5596('0x35')],function(_0x23c0f7){var _0xb4f786={};_0xb4f786[_0x23c0f7]={'$like':'%'+_0x4afacf[_0x5596('0x32')][_0x5596('0x40')]+'%'};return _0xb4f786;})});}_0x4d73d5=_[_0x5596('0x41')]({},_0x4d73d5,_0x4afacf[_0x5596('0x49')]);return _0x7be316[_0x5596('0x4e')](_0x4d73d5);}})[_0x5596('0x27')](function(_0x253f65){if(_0x253f65){_0x4112b2=_0x253f65['length'];if(!_0x4afacf['query'][_0x5596('0x3a')](_0x5596('0x3b'))){_0x4d73d5[_0x5596('0x21')]=qs[_0x5596('0x21')](_0x4afacf[_0x5596('0x32')]['limit']);_0x4d73d5[_0x5596('0x1e')]=qs[_0x5596('0x1e')](_0x4afacf['query'][_0x5596('0x1e')]);}return _0x7be316['getConfigurations'](_0x4d73d5);}})[_0x5596('0x27')](function(_0x53dec3){if(_0x53dec3){return _0x53dec3?{'count':_0x4112b2,'rows':_0x53dec3}:null;}})[_0x5596('0x27')](respondWithResult(_0xb2bc13,null))['catch'](handleError(_0xb2bc13,null));};exports['addConfiguration']=function(_0x515186,_0x5333a9,_0x1d2aff){if(_0x515186['body']['id']){delete _0x515186[_0x5596('0x4c')]['id'];}return db[_0x5596('0x2e')]['findOne']({'where':{'id':_0x515186[_0x5596('0x48')]['id']}})[_0x5596('0x27')](handleEntityNotFound(_0x5333a9,null))[_0x5596('0x27')](function(_0x2f703d){if(_0x2f703d){_0x515186[_0x5596('0x4c')][_0x5596('0x51')]=_0x2f703d['id'];_0x515186[_0x5596('0x4c')][_0x5596('0x52')]=integrations['getSubjects'](_0x515186['body']['channel'],_0x515186[_0x5596('0x4c')][_0x5596('0x30')]);_0x515186[_0x5596('0x4c')][_0x5596('0x53')]=integrations[_0x5596('0x54')](_0x515186[_0x5596('0x4c')][_0x5596('0x55')],_0x515186['body']['type']);return db['FreshsalesConfiguration']['create'](_0x515186[_0x5596('0x4c')],{'include':[{'model':db[_0x5596('0x56')],'as':_0x5596('0x52')},{'model':db[_0x5596('0x56')],'as':_0x5596('0x53')}]});}return null;})[_0x5596('0x27')](respondWithResult(_0x5333a9,null))[_0x5596('0x4a')](handleError(_0x5333a9,null));};exports[_0x5596('0x57')]=function(_0x379a3a,_0x2fad32,_0x398772){var _0xa92bf1='';var _0x360555='';return db[_0x5596('0x2e')]['findOne']({'where':{'id':_0x379a3a[_0x5596('0x48')]['id']},'attributes':['id',_0x5596('0x58'),_0x5596('0x59'),_0x5596('0x5a')]})['then'](handleEntityNotFound(_0x2fad32,null))['then'](function(_0x365ce6){if(_0x365ce6){_0x360555=_0x365ce6[_0x5596('0x58')];_0xa92bf1=_0x365ce6[_0x5596('0x59')];var _0x1da971=_0x365ce6['remoteUri']['slice'](-0x1);if(_0x1da971==='/'){_0xa92bf1=_0xa92bf1['substring'](0x0,_0xa92bf1[_0x5596('0x5b')](_0x1da971));}return rp({'method':_0x5596('0x5c'),'uri':util[_0x5596('0x5d')](_0x5596('0x5e'),_0xa92bf1,_0x5596('0x5f')),'headers':{'Authorization':'Token\x20token='+_0x365ce6[_0x5596('0x5a')]},'json':!![]});}})[_0x5596('0x27')](function(_0x466250){if(_0x466250){var _0x4d986e=_0x466250[_0x5596('0x60')];var _0x56aef5=![];var _0x41456d=null;for(_0x41456d=0x0;_0x41456d<_0x4d986e[_0x5596('0x39')];_0x41456d++){if(_0x4d986e[_0x41456d][_0x5596('0x61')]===_0x360555){_0x56aef5=!![];}}if(_0x56aef5){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x5596('0x62')});}}})[_0x5596('0x27')](respondWithResult(_0x2fad32,null))['catch'](function(_0xbe48fb){var _0x7be032=_0x379a3a[_0x5596('0x32')][_0x5596('0x63')]?0x1f4:_0xbe48fb[_0x5596('0x64')]||0x1f4;logger['error'](_0x5596('0x65'),_0x5596('0x57'),_0x7be032,JSON['stringify'](_0xbe48fb));delete _0xbe48fb[_0x5596('0x2b')];if(_0x7be032===0x191){_0x7be032=0x190;}_0x2fad32['status'](_0x7be032)['send'](_0x379a3a[_0x5596('0x32')][_0x5596('0x63')]?{'message':_0x5596('0x66'),'statusCode':_0xbe48fb[_0x5596('0x64')]}:_0xbe48fb);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 57e8e8e..6dbe2d5 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0120=['../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x15c550,_0x171e41){var _0x512ab4=function(_0x277ad4){while(--_0x277ad4){_0x15c550['push'](_0x15c550['shift']());}};_0x512ab4(++_0x171e41);}(_0x0120,0x6f));var _0x0012=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x0120[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0012('0x0'));var util=require(_0x0012('0x1'));var logger=require(_0x0012('0x2'))(_0x0012('0x3'));var moment=require(_0x0012('0x4'));var BPromise=require(_0x0012('0x5'));var rp=require(_0x0012('0x6'));var fs=require('fs');var path=require(_0x0012('0x7'));var rimraf=require(_0x0012('0x8'));var config=require(_0x0012('0x9'));var attributes=require(_0x0012('0xa'));var integrations=require(_0x0012('0xb'));module['exports']=function(_0x4b396c,_0x59980a){return _0x4b396c[_0x0012('0xc')](_0x0012('0xd'),attributes,{'tableName':_0x0012('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2fe=['define','int_freshsales_accounts','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0xaded7d,_0x31b658){var _0x417142=function(_0x218f7e){while(--_0x218f7e){_0xaded7d['push'](_0xaded7d['shift']());}};_0x417142(++_0x31b658);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xee2f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2f('0x1'));var moment=require('moment');var BPromise=require(_0xee2f('0x2'));var rp=require(_0xee2f('0x3'));var fs=require('fs');var path=require(_0xee2f('0x4'));var rimraf=require(_0xee2f('0x5'));var config=require(_0xee2f('0x6'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0xee2f('0x7'));module[_0xee2f('0x8')]=function(_0x49926b,_0x1533a0){return _0x49926b[_0xee2f('0x9')]('FreshsalesAccount',attributes,{'tableName':_0xee2f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index a266ebd..0dc3961 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1623=['../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','limit','include','map','model','attributes','find','ShowFreshsalesAccount','lodash','bluebird','randomstring','ioredis'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x1623,0xab));var _0x3162=function(_0x53326c,_0x47cda1){_0x53326c=_0x53326c-0x0;var _0x471fd3=_0x1623[_0x53326c];return _0x471fd3;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('FreshsalesAccount,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('FreshsalesAccount,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});}exports[_0x3162('0x16')]=function(_0x1eed46){var _0x391d97=this;return new Promise(function(_0x4b2bf3,_0x42f283){return db[_0x3162('0x17')][_0x3162('0x18')]({'raw':_0x1eed46[_0x3162('0x19')]?_0x1eed46['options'][_0x3162('0x1a')]===undefined?!![]:![]:!![],'where':_0x1eed46['options']?_0x1eed46['options'][_0x3162('0x1b')]||null:null,'attributes':_0x1eed46[_0x3162('0x19')]?_0x1eed46[_0x3162('0x19')]['attributes']||null:null,'limit':_0x1eed46['options']?_0x1eed46[_0x3162('0x19')][_0x3162('0x1c')]||null:null,'include':_0x1eed46[_0x3162('0x19')]?_0x1eed46[_0x3162('0x19')][_0x3162('0x1d')]?_[_0x3162('0x1e')](_0x1eed46[_0x3162('0x19')][_0x3162('0x1d')],function(_0x5a4994){return{'model':db[_0x5a4994[_0x3162('0x1f')]],'as':_0x5a4994['as'],'attributes':_0x5a4994[_0x3162('0x20')],'include':_0x5a4994[_0x3162('0x1d')]?_[_0x3162('0x1e')](_0x5a4994[_0x3162('0x1d')],function(_0x3c543e){return{'model':db[_0x3c543e[_0x3162('0x1f')]],'as':_0x3c543e['as'],'attributes':_0x3c543e[_0x3162('0x20')],'include':_0x3c543e[_0x3162('0x1d')]?_[_0x3162('0x1e')](_0x3c543e[_0x3162('0x1d')],function(_0x2f62d7){return{'model':db[_0x2f62d7[_0x3162('0x1f')]],'as':_0x2f62d7['as'],'attributes':_0x2f62d7['attributes']};}):[]};}):[]};}):[]:[]})[_0x3162('0xa')](function(_0x552469){logger[_0x3162('0xb')](_0x3162('0x16'),_0x1eed46);logger[_0x3162('0xc')]('GetFreshsalesAccount',_0x1eed46,JSON['stringify'](_0x552469));_0x4b2bf3(_0x552469);})[_0x3162('0x15')](function(_0xaa1f35){logger[_0x3162('0x10')](_0x3162('0x16'),_0xaa1f35[_0x3162('0x13')],_0x1eed46);_0x42f283(_0x391d97['error'](0x1f4,_0xaa1f35[_0x3162('0x13')]));});});};exports['ShowFreshsalesAccount']=function(_0xf11765){var _0x3a188e=this;return new Promise(function(_0x41e933,_0x221b38){return db[_0x3162('0x17')][_0x3162('0x21')]({'raw':_0xf11765[_0x3162('0x19')]?_0xf11765[_0x3162('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xf11765[_0x3162('0x19')]?_0xf11765[_0x3162('0x19')]['where']||null:null,'attributes':_0xf11765[_0x3162('0x19')]?_0xf11765[_0x3162('0x19')]['attributes']||null:null,'include':_0xf11765['options']?_0xf11765[_0x3162('0x19')]['include']?_[_0x3162('0x1e')](_0xf11765[_0x3162('0x19')][_0x3162('0x1d')],function(_0x551442){return{'model':db[_0x551442['model']],'as':_0x551442['as'],'attributes':_0x551442[_0x3162('0x20')],'include':_0x551442[_0x3162('0x1d')]?_['map'](_0x551442[_0x3162('0x1d')],function(_0x4d4f74){return{'model':db[_0x4d4f74[_0x3162('0x1f')]],'as':_0x4d4f74['as'],'attributes':_0x4d4f74[_0x3162('0x20')],'include':_0x4d4f74[_0x3162('0x1d')]?_[_0x3162('0x1e')](_0x4d4f74[_0x3162('0x1d')],function(_0x3b6c91){return{'model':db[_0x3b6c91[_0x3162('0x1f')]],'as':_0x3b6c91['as'],'attributes':_0x3b6c91[_0x3162('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3162('0xa')](function(_0x16c5d6){logger[_0x3162('0xb')]('ShowFreshsalesAccount',_0xf11765);logger[_0x3162('0xc')](_0x3162('0x22'),_0xf11765,JSON[_0x3162('0xf')](_0x16c5d6));_0x41e933(_0x16c5d6);})['catch'](function(_0x59759d){logger[_0x3162('0x10')](_0x3162('0x22'),_0x59759d[_0x3162('0x13')],_0xf11765);_0x221b38(_0x3a188e[_0x3162('0x10')](0x1f4,_0x59759d['message']));});});}; \ No newline at end of file +var _0x3a6d=['client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','attributes','limit','include','model','map','debug','ShowFreshsalesAccount','find','raw','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x1e3f9e,_0x489b75){var _0x553299=function(_0x4a649e){while(--_0x4a649e){_0x1e3f9e['push'](_0x1e3f9e['shift']());}};_0x553299(++_0x489b75);}(_0x3a6d,0x143));var _0xd3a6=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x3a6d[_0x51020b];return _0x371e47;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var moment=require('moment');var BPromise=require(_0xd3a6('0x2'));var rs=require(_0xd3a6('0x3'));var fs=require('fs');var Redis=require(_0xd3a6('0x4'));var db=require(_0xd3a6('0x5'))['db'];var utils=require(_0xd3a6('0x6'));var logger=require('../../config/logger')(_0xd3a6('0x7'));var config=require(_0xd3a6('0x8'));var jayson=require(_0xd3a6('0x9'));var client=jayson[_0xd3a6('0xa')][_0xd3a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x282cb1,_0x58d83a,_0x121bd2){return new BPromise(function(_0x134dd3,_0x16858){return client[_0xd3a6('0xc')](_0x282cb1,_0x121bd2)[_0xd3a6('0xd')](function(_0xa67661){logger[_0xd3a6('0xe')](_0xd3a6('0xf'),_0x58d83a,_0xd3a6('0x10'));logger['debug'](_0xd3a6('0x11'),_0x58d83a,_0xd3a6('0x10'),JSON[_0xd3a6('0x12')](_0xa67661));if(_0xa67661[_0xd3a6('0x13')]){if(_0xa67661[_0xd3a6('0x13')]['code']===0x1f4){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);return _0x16858(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}logger[_0xd3a6('0x13')](_0xd3a6('0xf'),_0x58d83a,_0xa67661[_0xd3a6('0x13')]['message']);return _0x134dd3(_0xa67661[_0xd3a6('0x13')][_0xd3a6('0x14')]);}else{logger[_0xd3a6('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0xd3a6('0x10'));_0x134dd3(_0xa67661[_0xd3a6('0x15')][_0xd3a6('0x14')]);}})['catch'](function(_0x3498d5){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x58d83a,_0x3498d5);_0x16858(_0x3498d5);});});}exports[_0xd3a6('0x16')]=function(_0x8d1286){var _0x32683f=this;return new Promise(function(_0xbe58b4,_0x22fb05){return db[_0xd3a6('0x17')][_0xd3a6('0x18')]({'raw':_0x8d1286['options']?_0x8d1286[_0xd3a6('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1a')]||null:null,'attributes':_0x8d1286[_0xd3a6('0x19')]?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1b')]||null:null,'limit':_0x8d1286['options']?_0x8d1286[_0xd3a6('0x19')][_0xd3a6('0x1c')]||null:null,'include':_0x8d1286['options']?_0x8d1286['options']['include']?_['map'](_0x8d1286['options'][_0xd3a6('0x1d')],function(_0x400982){return{'model':db[_0x400982[_0xd3a6('0x1e')]],'as':_0x400982['as'],'attributes':_0x400982['attributes'],'include':_0x400982[_0xd3a6('0x1d')]?_['map'](_0x400982[_0xd3a6('0x1d')],function(_0x16afc8){return{'model':db[_0x16afc8[_0xd3a6('0x1e')]],'as':_0x16afc8['as'],'attributes':_0x16afc8['attributes'],'include':_0x16afc8[_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0x16afc8[_0xd3a6('0x1d')],function(_0x219e32){return{'model':db[_0x219e32[_0xd3a6('0x1e')]],'as':_0x219e32['as'],'attributes':_0x219e32[_0xd3a6('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x30df90){logger[_0xd3a6('0xe')](_0xd3a6('0x16'),_0x8d1286);logger[_0xd3a6('0x20')](_0xd3a6('0x16'),_0x8d1286,JSON[_0xd3a6('0x12')](_0x30df90));_0xbe58b4(_0x30df90);})['catch'](function(_0x535bd4){logger[_0xd3a6('0x13')](_0xd3a6('0x16'),_0x535bd4[_0xd3a6('0x14')],_0x8d1286);_0x22fb05(_0x32683f[_0xd3a6('0x13')](0x1f4,_0x535bd4['message']));});});};exports[_0xd3a6('0x21')]=function(_0xa4efd){var _0x4d322a=this;return new Promise(function(_0x14381c,_0x5d9867){return db[_0xd3a6('0x17')][_0xd3a6('0x22')]({'raw':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x23')]===undefined?!![]:![]:!![],'where':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd[_0xd3a6('0x19')]['where']||null:null,'attributes':_0xa4efd['options']?_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x1b')]||null:null,'include':_0xa4efd[_0xd3a6('0x19')]?_0xa4efd['options'][_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0xa4efd[_0xd3a6('0x19')][_0xd3a6('0x1d')],function(_0x3ebd0d){return{'model':db[_0x3ebd0d[_0xd3a6('0x1e')]],'as':_0x3ebd0d['as'],'attributes':_0x3ebd0d[_0xd3a6('0x1b')],'include':_0x3ebd0d[_0xd3a6('0x1d')]?_['map'](_0x3ebd0d[_0xd3a6('0x1d')],function(_0x41981c){return{'model':db[_0x41981c[_0xd3a6('0x1e')]],'as':_0x41981c['as'],'attributes':_0x41981c[_0xd3a6('0x1b')],'include':_0x41981c[_0xd3a6('0x1d')]?_[_0xd3a6('0x1f')](_0x41981c['include'],function(_0x16a30a){return{'model':db[_0x16a30a['model']],'as':_0x16a30a['as'],'attributes':_0x16a30a[_0xd3a6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd3a6('0xd')](function(_0x180bb9){logger[_0xd3a6('0xe')]('ShowFreshsalesAccount',_0xa4efd);logger['debug'](_0xd3a6('0x21'),_0xa4efd,JSON[_0xd3a6('0x12')](_0x180bb9));_0x14381c(_0x180bb9);})[_0xd3a6('0x24')](function(_0x5188e1){logger[_0xd3a6('0x13')](_0xd3a6('0x21'),_0x5188e1['message'],_0xa4efd);_0x5d9867(_0x4d322a[_0xd3a6('0x13')](0x1f4,_0x5188e1['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 8f7511e..1967a2e 100644 --- a/server/api/intFreshsalesConfiguration/index.js +++ b/server/api/intFreshsalesConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a3a=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index','get','/:id','show','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','create','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x5418e8,_0xb90ac){var _0x3e3481=function(_0x10deb2){while(--_0x10deb2){_0x5418e8['push'](_0x5418e8['shift']());}};_0x3e3481(++_0xb90ac);}(_0x4a3a,0x1c4));var _0xa4a3=function(_0x345be3,_0x140abd){_0x345be3=_0x345be3-0x0;var _0x43efcb=_0x4a3a[_0x345be3];return _0x43efcb;};'use strict';var multer=require(_0xa4a3('0x0'));var util=require(_0xa4a3('0x1'));var path=require('path');var timeout=require(_0xa4a3('0x2'));var express=require(_0xa4a3('0x3'));var router=express[_0xa4a3('0x4')]();var fs_extra=require(_0xa4a3('0x5'));var auth=require(_0xa4a3('0x6'));var interaction=require(_0xa4a3('0x7'));var config=require(_0xa4a3('0x8'));var controller=require(_0xa4a3('0x9'));router['get']('/',auth[_0xa4a3('0xa')](),controller[_0xa4a3('0xb')]);router[_0xa4a3('0xc')](_0xa4a3('0xd'),auth[_0xa4a3('0xa')](),controller[_0xa4a3('0xe')]);router[_0xa4a3('0xc')]('/:id/subjects',auth[_0xa4a3('0xa')](),controller[_0xa4a3('0xf')]);router['get'](_0xa4a3('0x10'),auth[_0xa4a3('0xa')](),controller[_0xa4a3('0x11')]);router[_0xa4a3('0xc')](_0xa4a3('0x12'),auth['isAuthenticated'](),controller[_0xa4a3('0x13')]);router['post']('/',auth[_0xa4a3('0xa')](),controller[_0xa4a3('0x14')]);router['put'](_0xa4a3('0xd'),auth[_0xa4a3('0xa')](),controller['update']);router[_0xa4a3('0x15')](_0xa4a3('0xd'),auth['isAuthenticated'](),controller[_0xa4a3('0x16')]);module[_0xa4a3('0x17')]=router; \ No newline at end of file +var _0xec0c=['../../components/auth/service','./intFreshsalesConfiguration.controller','get','isAuthenticated','show','/:id/subjects','getDescriptions','/:id/fields','getFields','create','put','/:id','update','delete','multer','util','path','connect-timeout','express'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xec0c,0x80));var _0xcec0=function(_0x47e05f,_0x3f9395){_0x47e05f=_0x47e05f-0x0;var _0x5c5095=_0xec0c[_0x47e05f];return _0x5c5095;};'use strict';var multer=require(_0xcec0('0x0'));var util=require(_0xcec0('0x1'));var path=require(_0xcec0('0x2'));var timeout=require(_0xcec0('0x3'));var express=require(_0xcec0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcec0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xcec0('0x6'));router[_0xcec0('0x7')]('/',auth[_0xcec0('0x8')](),controller['index']);router[_0xcec0('0x7')]('/:id',auth[_0xcec0('0x8')](),controller[_0xcec0('0x9')]);router[_0xcec0('0x7')](_0xcec0('0xa'),auth[_0xcec0('0x8')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0xcec0('0x8')](),controller[_0xcec0('0xb')]);router[_0xcec0('0x7')](_0xcec0('0xc'),auth[_0xcec0('0x8')](),controller[_0xcec0('0xd')]);router['post']('/',auth[_0xcec0('0x8')](),controller[_0xcec0('0xe')]);router[_0xcec0('0xf')](_0xcec0('0x10'),auth[_0xcec0('0x8')](),controller[_0xcec0('0x11')]);router[_0xcec0('0x12')](_0xcec0('0x10'),auth[_0xcec0('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 612b6e6..daa8ffb 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe775=['sequelize','exports','STRING'];(function(_0x1ee119,_0x51fd98){var _0x4c8234=function(_0x20355c){while(--_0x20355c){_0x1ee119['push'](_0x1ee119['shift']());}};_0x4c8234(++_0x51fd98);}(_0xe775,0x17a));var _0x5e77=function(_0x1b1a3b,_0x52a88a){_0x1b1a3b=_0x1b1a3b-0x0;var _0x385347=_0xe775[_0x1b1a3b];return _0x385347;};'use strict';var Sequelize=require(_0x5e77('0x0'));module[_0x5e77('0x1')]={'name':{'type':Sequelize[_0x5e77('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf86e=['exports','STRING','sequelize'];(function(_0x2a720f,_0x14ca9c){var _0x35a853=function(_0xd11eb6){while(--_0xd11eb6){_0x2a720f['push'](_0x2a720f['shift']());}};_0x35a853(++_0x14ca9c);}(_0xf86e,0x65));var _0xef86=function(_0x2212d1,_0x483fc8){_0x2212d1=_0x2212d1-0x0;var _0x15eec5=_0xf86e[_0x2212d1];return _0x15eec5;};'use strict';var Sequelize=require(_0xef86('0x0'));module[_0xef86('0x1')]={'name':{'type':Sequelize[_0xef86('0x2')]},'description':{'type':Sequelize[_0xef86('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 17de4be..bd96e02 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2d8=['where','filter','merge','map','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','getSubjects','FreshsalesField','getDescriptions','findOne','pick','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','save','update','then','destroy','error','stack','name','send','index','FreshsalesConfiguration','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x2421e3,_0x15e64a){var _0x514927=function(_0x3345ff){while(--_0x3345ff){_0x2421e3['push'](_0x2421e3['shift']());}};_0x514927(++_0x15e64a);}(_0xe2d8,0x102));var _0x8e2d=function(_0xf979e6,_0x1cb147){_0xf979e6=_0xf979e6-0x0;var _0x59217d=_0xe2d8[_0xf979e6];return _0x59217d;};'use strict';var emlformat=require(_0x8e2d('0x0'));var rimraf=require(_0x8e2d('0x1'));var zipdir=require(_0x8e2d('0x2'));var jsonpatch=require(_0x8e2d('0x3'));var rp=require(_0x8e2d('0x4'));var moment=require(_0x8e2d('0x5'));var BPromise=require(_0x8e2d('0x6'));var Mustache=require(_0x8e2d('0x7'));var util=require(_0x8e2d('0x8'));var path=require(_0x8e2d('0x9'));var sox=require('sox');var csv=require(_0x8e2d('0xa'));var ejs=require(_0x8e2d('0xb'));var fs=require('fs');var fs_extra=require(_0x8e2d('0xc'));var _=require(_0x8e2d('0xd'));var squel=require(_0x8e2d('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8e2d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8e2d('0x10'));var Papa=require('papaparse');var Redis=require(_0x8e2d('0x11'));var authService=require(_0x8e2d('0x12'));var qs=require(_0x8e2d('0x13'));var as=require(_0x8e2d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8e2d('0x15'))(_0x8e2d('0x16'));var utils=require(_0x8e2d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x8e2d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x104de7,_0x38a6d6){_0x38a6d6=_0x38a6d6||0xcc;return function(_0x58016d){if(_0x58016d){return _0x104de7[_0x8e2d('0x19')](_0x38a6d6);}return _0x104de7[_0x8e2d('0x1a')](_0x38a6d6)[_0x8e2d('0x1b')]();};}function respondWithResult(_0x20e850,_0x99ca8f){_0x99ca8f=_0x99ca8f||0xc8;return function(_0x4cd6b6){if(_0x4cd6b6){return _0x20e850[_0x8e2d('0x1a')](_0x99ca8f)['json'](_0x4cd6b6);}};}function respondWithFilteredResult(_0x5ef38f,_0x19fcfa){return function(_0x1ba081){if(_0x1ba081){var _0x51cbd9=typeof _0x19fcfa['offset']===_0x8e2d('0x1c')&&typeof _0x19fcfa[_0x8e2d('0x1d')]===_0x8e2d('0x1c');var _0x1869e3=_0x1ba081[_0x8e2d('0x1e')];var _0x26007f=_0x51cbd9?0x0:_0x19fcfa[_0x8e2d('0x1f')];var _0x1aeb23=_0x51cbd9?_0x1ba081[_0x8e2d('0x1e')]:_0x19fcfa['offset']+_0x19fcfa['limit'];var _0x448276;if(_0x1aeb23>=_0x1869e3){_0x1aeb23=_0x1869e3;_0x448276=0xc8;}else{_0x448276=0xce;}_0x5ef38f[_0x8e2d('0x1a')](_0x448276);return _0x5ef38f['set'](_0x8e2d('0x20'),_0x26007f+'-'+_0x1aeb23+'/'+_0x1869e3)[_0x8e2d('0x21')](_0x1ba081);}return null;};}function patchUpdates(_0x21dab1){return function(_0x2ff3dd){try{jsonpatch['apply'](_0x2ff3dd,_0x21dab1,!![]);}catch(_0x495c43){return BPromise['reject'](_0x495c43);}return _0x2ff3dd[_0x8e2d('0x22')]();};}function saveUpdates(_0x4fec9f,_0x21a2fe){return function(_0x1a1eaf){if(_0x1a1eaf){return _0x1a1eaf[_0x8e2d('0x23')](_0x4fec9f)[_0x8e2d('0x24')](function(_0xf1f680){return _0xf1f680;});}return null;};}function removeEntity(_0x7cc37b,_0x29111c){return function(_0x106360){if(_0x106360){return _0x106360[_0x8e2d('0x25')]()[_0x8e2d('0x24')](function(){_0x7cc37b[_0x8e2d('0x1a')](0xcc)[_0x8e2d('0x1b')]();});}};}function handleEntityNotFound(_0x99f422,_0x56a513){return function(_0x3540f8){if(!_0x3540f8){_0x99f422['sendStatus'](0x194);}return _0x3540f8;};}function handleError(_0x287b71,_0x265775){_0x265775=_0x265775||0x1f4;return function(_0x526239){logger[_0x8e2d('0x26')](_0x526239[_0x8e2d('0x27')]);if(_0x526239[_0x8e2d('0x28')]){delete _0x526239[_0x8e2d('0x28')];}_0x287b71[_0x8e2d('0x1a')](_0x265775)[_0x8e2d('0x29')](_0x526239);};}exports[_0x8e2d('0x2a')]=function(_0x58ab0a,_0xed8778){var _0x1dc49e={},_0x169023={},_0x6bd692={'count':0x0,'rows':[]};var _0x4f54cf=_['map'](db[_0x8e2d('0x2b')][_0x8e2d('0x2c')],function(_0x57161b){return{'name':_0x57161b['fieldName'],'type':_0x57161b[_0x8e2d('0x2d')][_0x8e2d('0x2e')]};});_0x169023[_0x8e2d('0x2f')]=_['map'](_0x4f54cf,_0x8e2d('0x28'));_0x169023[_0x8e2d('0x30')]=_['keys'](_0x58ab0a['query']);_0x169023[_0x8e2d('0x31')]=_['intersection'](_0x169023[_0x8e2d('0x2f')],_0x169023[_0x8e2d('0x30')]);_0x1dc49e[_0x8e2d('0x32')]=_[_0x8e2d('0x33')](_0x169023[_0x8e2d('0x2f')],qs[_0x8e2d('0x34')](_0x58ab0a['query'][_0x8e2d('0x34')]));_0x1dc49e['attributes']=_0x1dc49e[_0x8e2d('0x32')][_0x8e2d('0x35')]?_0x1dc49e['attributes']:_0x169023[_0x8e2d('0x2f')];if(!_0x58ab0a[_0x8e2d('0x30')][_0x8e2d('0x36')](_0x8e2d('0x37'))){_0x1dc49e['limit']=qs['limit'](_0x58ab0a[_0x8e2d('0x30')]['limit']);_0x1dc49e[_0x8e2d('0x1f')]=qs[_0x8e2d('0x1f')](_0x58ab0a[_0x8e2d('0x30')]['offset']);}_0x1dc49e[_0x8e2d('0x38')]=qs[_0x8e2d('0x39')](_0x58ab0a[_0x8e2d('0x30')][_0x8e2d('0x39')]);_0x1dc49e[_0x8e2d('0x3a')]=qs[_0x8e2d('0x31')](_['pick'](_0x58ab0a[_0x8e2d('0x30')],_0x169023[_0x8e2d('0x31')]),_0x4f54cf);if(_0x58ab0a[_0x8e2d('0x30')][_0x8e2d('0x3b')]){_0x1dc49e['where']=_[_0x8e2d('0x3c')](_0x1dc49e[_0x8e2d('0x3a')],{'$or':_[_0x8e2d('0x3d')](_0x4f54cf,function(_0x71eb3c){if(_0x71eb3c[_0x8e2d('0x2d')]!=='VIRTUAL'){var _0x4187ee={};_0x4187ee[_0x71eb3c[_0x8e2d('0x28')]]={'$like':'%'+_0x58ab0a[_0x8e2d('0x30')][_0x8e2d('0x3b')]+'%'};return _0x4187ee;}})});}_0x1dc49e=_[_0x8e2d('0x3c')]({},_0x1dc49e,_0x58ab0a[_0x8e2d('0x3e')]);var _0x1cef14={'where':_0x1dc49e[_0x8e2d('0x3a')]};return db[_0x8e2d('0x2b')][_0x8e2d('0x1e')](_0x1cef14)[_0x8e2d('0x24')](function(_0x509d62){_0x6bd692[_0x8e2d('0x1e')]=_0x509d62;if(_0x58ab0a[_0x8e2d('0x30')][_0x8e2d('0x3f')]){_0x1dc49e[_0x8e2d('0x40')]=[{'all':!![]}];}return db[_0x8e2d('0x2b')][_0x8e2d('0x41')](_0x1dc49e);})[_0x8e2d('0x24')](function(_0x45cc74){_0x6bd692['rows']=_0x45cc74;return _0x6bd692;})[_0x8e2d('0x24')](respondWithFilteredResult(_0xed8778,_0x1dc49e))[_0x8e2d('0x42')](handleError(_0xed8778,null));};exports[_0x8e2d('0x43')]=function(_0x3c4061,_0x4ffb59){var _0x3ba365={'raw':![],'where':{'id':_0x3c4061[_0x8e2d('0x44')]['id']}},_0x3c9d34={};_0x3c9d34[_0x8e2d('0x2f')]=_['keys'](db[_0x8e2d('0x2b')][_0x8e2d('0x2c')]);_0x3c9d34['query']=_[_0x8e2d('0x45')](_0x3c4061[_0x8e2d('0x30')]);_0x3c9d34[_0x8e2d('0x31')]=_[_0x8e2d('0x33')](_0x3c9d34['model'],_0x3c9d34[_0x8e2d('0x30')]);_0x3ba365[_0x8e2d('0x32')]=_[_0x8e2d('0x33')](_0x3c9d34['model'],qs[_0x8e2d('0x34')](_0x3c4061[_0x8e2d('0x30')][_0x8e2d('0x34')]));_0x3ba365['attributes']=_0x3ba365[_0x8e2d('0x32')][_0x8e2d('0x35')]?_0x3ba365['attributes']:_0x3c9d34[_0x8e2d('0x2f')];if(_0x3c4061[_0x8e2d('0x30')][_0x8e2d('0x3f')]){_0x3ba365[_0x8e2d('0x40')]=[{'all':!![]}];}_0x3ba365=_[_0x8e2d('0x3c')]({},_0x3ba365,_0x3c4061[_0x8e2d('0x3e')]);return db[_0x8e2d('0x2b')][_0x8e2d('0x46')](_0x3ba365)['then'](handleEntityNotFound(_0x4ffb59,null))[_0x8e2d('0x24')](respondWithResult(_0x4ffb59,null))[_0x8e2d('0x42')](handleError(_0x4ffb59,null));};exports['create']=function(_0x1b99ac,_0x1a74be){return db['FreshsalesConfiguration'][_0x8e2d('0x47')](_0x1b99ac[_0x8e2d('0x48')],{})['then'](respondWithResult(_0x1a74be,0xc9))['catch'](handleError(_0x1a74be,null));};exports[_0x8e2d('0x23')]=function(_0x3efb92,_0x12b457){if(_0x3efb92[_0x8e2d('0x48')]['id']){delete _0x3efb92['body']['id'];}return db[_0x8e2d('0x2b')][_0x8e2d('0x46')]({'where':{'id':_0x3efb92['params']['id']}})[_0x8e2d('0x24')](handleEntityNotFound(_0x12b457,null))[_0x8e2d('0x24')](saveUpdates(_0x3efb92[_0x8e2d('0x48')],null))[_0x8e2d('0x24')](respondWithResult(_0x12b457,null))[_0x8e2d('0x42')](handleError(_0x12b457,null));};exports['destroy']=function(_0x5aa057,_0x2d1a13){return db[_0x8e2d('0x2b')][_0x8e2d('0x46')]({'where':{'id':_0x5aa057['params']['id']}})['then'](handleEntityNotFound(_0x2d1a13,null))['then'](removeEntity(_0x2d1a13,null))[_0x8e2d('0x42')](handleError(_0x2d1a13,null));};exports[_0x8e2d('0x49')]=function(_0xcdd6f7,_0x2abb90,_0x19de84){var _0x319695={};var _0x34c26d={};var _0x162e89;var _0x4ae713;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0xcdd6f7[_0x8e2d('0x44')]['id']}})[_0x8e2d('0x24')](handleEntityNotFound(_0x2abb90,null))[_0x8e2d('0x24')](function(_0x5b044b){if(_0x5b044b){_0x162e89=_0x5b044b;_0x34c26d['model']=_[_0x8e2d('0x45')](db[_0x8e2d('0x4a')][_0x8e2d('0x2c')]);_0x34c26d[_0x8e2d('0x30')]=_['keys'](_0xcdd6f7[_0x8e2d('0x30')]);_0x34c26d['filters']=_[_0x8e2d('0x33')](_0x34c26d[_0x8e2d('0x2f')],_0x34c26d['query']);_0x319695[_0x8e2d('0x32')]=_[_0x8e2d('0x33')](_0x34c26d[_0x8e2d('0x2f')],qs[_0x8e2d('0x34')](_0xcdd6f7[_0x8e2d('0x30')][_0x8e2d('0x34')]));_0x319695[_0x8e2d('0x32')]=_0x319695[_0x8e2d('0x32')][_0x8e2d('0x35')]?_0x319695[_0x8e2d('0x32')]:_0x34c26d['model'];_0x319695[_0x8e2d('0x38')]=qs[_0x8e2d('0x39')](_0xcdd6f7[_0x8e2d('0x30')][_0x8e2d('0x39')]);_0x319695['where']=qs['filters'](_['pick'](_0xcdd6f7[_0x8e2d('0x30')],_0x34c26d['filters']));if(_0xcdd6f7['query'][_0x8e2d('0x3b')]){_0x319695[_0x8e2d('0x3a')]=_[_0x8e2d('0x3c')](_0x319695[_0x8e2d('0x3a')],{'$or':_[_0x8e2d('0x3d')](_0x319695['attributes'],function(_0x222428){var _0x59d0d4={};_0x59d0d4[_0x222428]={'$like':'%'+_0xcdd6f7[_0x8e2d('0x30')][_0x8e2d('0x3b')]+'%'};return _0x59d0d4;})});}_0x319695=_['merge']({},_0x319695,_0xcdd6f7[_0x8e2d('0x3e')]);return _0x162e89[_0x8e2d('0x49')](_0x319695);}})[_0x8e2d('0x24')](function(_0x3904a8){if(_0x3904a8){_0x4ae713=_0x3904a8[_0x8e2d('0x35')];if(!_0xcdd6f7[_0x8e2d('0x30')]['hasOwnProperty']('nolimit')){_0x319695[_0x8e2d('0x1d')]=qs[_0x8e2d('0x1d')](_0xcdd6f7[_0x8e2d('0x30')][_0x8e2d('0x1d')]);_0x319695['offset']=qs[_0x8e2d('0x1f')](_0xcdd6f7[_0x8e2d('0x30')]['offset']);}return _0x162e89[_0x8e2d('0x49')](_0x319695);}})[_0x8e2d('0x24')](function(_0x39e544){if(_0x39e544){return _0x39e544?{'count':_0x4ae713,'rows':_0x39e544}:null;}})['then'](respondWithResult(_0x2abb90,null))['catch'](handleError(_0x2abb90,null));};exports[_0x8e2d('0x4b')]=function(_0x4b77d4,_0x2f8520,_0x2eda07){var _0x2a82cd={};var _0x96de45={};var _0xe1690c;var _0x1144a0;return db[_0x8e2d('0x2b')][_0x8e2d('0x4c')]({'where':{'id':_0x4b77d4[_0x8e2d('0x44')]['id']}})[_0x8e2d('0x24')](handleEntityNotFound(_0x2f8520,null))['then'](function(_0x1be1c2){if(_0x1be1c2){_0xe1690c=_0x1be1c2;_0x96de45['model']=_[_0x8e2d('0x45')](db[_0x8e2d('0x4a')][_0x8e2d('0x2c')]);_0x96de45[_0x8e2d('0x30')]=_['keys'](_0x4b77d4[_0x8e2d('0x30')]);_0x96de45[_0x8e2d('0x31')]=_[_0x8e2d('0x33')](_0x96de45[_0x8e2d('0x2f')],_0x96de45['query']);_0x2a82cd[_0x8e2d('0x32')]=_[_0x8e2d('0x33')](_0x96de45[_0x8e2d('0x2f')],qs[_0x8e2d('0x34')](_0x4b77d4[_0x8e2d('0x30')]['fields']));_0x2a82cd[_0x8e2d('0x32')]=_0x2a82cd[_0x8e2d('0x32')][_0x8e2d('0x35')]?_0x2a82cd['attributes']:_0x96de45[_0x8e2d('0x2f')];_0x2a82cd[_0x8e2d('0x38')]=qs['sort'](_0x4b77d4['query']['sort']);_0x2a82cd['where']=qs['filters'](_[_0x8e2d('0x4d')](_0x4b77d4[_0x8e2d('0x30')],_0x96de45['filters']));if(_0x4b77d4[_0x8e2d('0x30')]['filter']){_0x2a82cd[_0x8e2d('0x3a')]=_[_0x8e2d('0x3c')](_0x2a82cd[_0x8e2d('0x3a')],{'$or':_[_0x8e2d('0x3d')](_0x2a82cd[_0x8e2d('0x32')],function(_0x4b95e){var _0x18785a={};_0x18785a[_0x4b95e]={'$like':'%'+_0x4b77d4[_0x8e2d('0x30')]['filter']+'%'};return _0x18785a;})});}_0x2a82cd=_[_0x8e2d('0x3c')]({},_0x2a82cd,_0x4b77d4[_0x8e2d('0x3e')]);return _0xe1690c[_0x8e2d('0x4b')](_0x2a82cd);}})[_0x8e2d('0x24')](function(_0x5223e6){if(_0x5223e6){_0x1144a0=_0x5223e6['length'];if(!_0x4b77d4['query'][_0x8e2d('0x36')](_0x8e2d('0x37'))){_0x2a82cd[_0x8e2d('0x1d')]=qs[_0x8e2d('0x1d')](_0x4b77d4[_0x8e2d('0x30')]['limit']);_0x2a82cd['offset']=qs['offset'](_0x4b77d4['query'][_0x8e2d('0x1f')]);}return _0xe1690c[_0x8e2d('0x4b')](_0x2a82cd);}})[_0x8e2d('0x24')](function(_0x5b1191){if(_0x5b1191){return _0x5b1191?{'count':_0x1144a0,'rows':_0x5b1191}:null;}})[_0x8e2d('0x24')](respondWithResult(_0x2f8520,null))['catch'](handleError(_0x2f8520,null));};exports[_0x8e2d('0x4e')]=function(_0x24d51a,_0x35a0d3,_0x3b81c0){var _0x48254c={};var _0x57a66b={};var _0x1b5967;var _0x218adf;return db['FreshsalesConfiguration'][_0x8e2d('0x4c')]({'where':{'id':_0x24d51a[_0x8e2d('0x44')]['id']}})['then'](handleEntityNotFound(_0x35a0d3,null))[_0x8e2d('0x24')](function(_0x35a683){if(_0x35a683){_0x1b5967=_0x35a683;_0x57a66b['model']=_[_0x8e2d('0x45')](db['FreshsalesField']['rawAttributes']);_0x57a66b[_0x8e2d('0x30')]=_[_0x8e2d('0x45')](_0x24d51a[_0x8e2d('0x30')]);_0x57a66b[_0x8e2d('0x31')]=_[_0x8e2d('0x33')](_0x57a66b[_0x8e2d('0x2f')],_0x57a66b[_0x8e2d('0x30')]);_0x48254c[_0x8e2d('0x32')]=_[_0x8e2d('0x33')](_0x57a66b['model'],qs['fields'](_0x24d51a['query'][_0x8e2d('0x34')]));_0x48254c[_0x8e2d('0x32')]=_0x48254c['attributes'][_0x8e2d('0x35')]?_0x48254c[_0x8e2d('0x32')]:_0x57a66b[_0x8e2d('0x2f')];_0x48254c[_0x8e2d('0x38')]=qs[_0x8e2d('0x39')](_0x24d51a[_0x8e2d('0x30')][_0x8e2d('0x39')]);_0x48254c[_0x8e2d('0x3a')]=qs[_0x8e2d('0x31')](_['pick'](_0x24d51a[_0x8e2d('0x30')],_0x57a66b[_0x8e2d('0x31')]));if(_0x24d51a['query'][_0x8e2d('0x3b')]){_0x48254c[_0x8e2d('0x3a')]=_[_0x8e2d('0x3c')](_0x48254c[_0x8e2d('0x3a')],{'$or':_[_0x8e2d('0x3d')](_0x48254c[_0x8e2d('0x32')],function(_0x42d3bf){var _0x232fb9={};_0x232fb9[_0x42d3bf]={'$like':'%'+_0x24d51a[_0x8e2d('0x30')][_0x8e2d('0x3b')]+'%'};return _0x232fb9;})});}_0x48254c=_[_0x8e2d('0x3c')]({},_0x48254c,_0x24d51a[_0x8e2d('0x3e')]);return _0x1b5967[_0x8e2d('0x4e')](_0x48254c);}})[_0x8e2d('0x24')](function(_0x285399){if(_0x285399){_0x218adf=_0x285399[_0x8e2d('0x35')];if(!_0x24d51a[_0x8e2d('0x30')][_0x8e2d('0x36')]('nolimit')){_0x48254c['limit']=qs[_0x8e2d('0x1d')](_0x24d51a[_0x8e2d('0x30')]['limit']);_0x48254c[_0x8e2d('0x1f')]=qs[_0x8e2d('0x1f')](_0x24d51a[_0x8e2d('0x30')][_0x8e2d('0x1f')]);}return _0x1b5967[_0x8e2d('0x4e')](_0x48254c);}})['then'](function(_0x23bce3){if(_0x23bce3){return _0x23bce3?{'count':_0x218adf,'rows':_0x23bce3}:null;}})[_0x8e2d('0x24')](respondWithResult(_0x35a0d3,null))[_0x8e2d('0x42')](handleError(_0x35a0d3,null));}; \ No newline at end of file +var _0xc062=['query','keys','filters','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','name','options','FreshsalesConfiguration','include','findAll','catch','show','params','attributes','includeAll','create','body','destroy','find','getSubjects','findOne','FreshsalesField','getDescriptions','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','index','map','rawAttributes','type','model'];(function(_0x1c92ff,_0x3dfb69){var _0x2930ee=function(_0x33ea67){while(--_0x33ea67){_0x1c92ff['push'](_0x1c92ff['shift']());}};_0x2930ee(++_0x3dfb69);}(_0xc062,0x10c));var _0x2c06=function(_0x38428e,_0x201da3){_0x38428e=_0x38428e-0x0;var _0x431293=_0xc062[_0x38428e];return _0x431293;};'use strict';var emlformat=require(_0x2c06('0x0'));var rimraf=require(_0x2c06('0x1'));var zipdir=require(_0x2c06('0x2'));var jsonpatch=require(_0x2c06('0x3'));var rp=require(_0x2c06('0x4'));var moment=require('moment');var BPromise=require(_0x2c06('0x5'));var Mustache=require('mustache');var util=require(_0x2c06('0x6'));var path=require('path');var sox=require(_0x2c06('0x7'));var csv=require(_0x2c06('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c06('0x9'));var _=require('lodash');var squel=require(_0x2c06('0xa'));var crypto=require(_0x2c06('0xb'));var jsforce=require(_0x2c06('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x2c06('0x8'));var querystring=require('querystring');var Papa=require(_0x2c06('0xd'));var Redis=require(_0x2c06('0xe'));var authService=require(_0x2c06('0xf'));var qs=require(_0x2c06('0x10'));var as=require(_0x2c06('0x11'));var hardwareService=require(_0x2c06('0x12'));var logger=require(_0x2c06('0x13'))(_0x2c06('0x14'));var utils=require(_0x2c06('0x15'));var config=require(_0x2c06('0x16'));var licenseUtil=require(_0x2c06('0x17'));var db=require(_0x2c06('0x18'))['db'];function respondWithStatusCode(_0x2a2148,_0x74452f){_0x74452f=_0x74452f||0xcc;return function(_0x3232a8){if(_0x3232a8){return _0x2a2148[_0x2c06('0x19')](_0x74452f);}return _0x2a2148[_0x2c06('0x1a')](_0x74452f)['end']();};}function respondWithResult(_0x56ce35,_0x3ec64f){_0x3ec64f=_0x3ec64f||0xc8;return function(_0x55a878){if(_0x55a878){return _0x56ce35[_0x2c06('0x1a')](_0x3ec64f)[_0x2c06('0x1b')](_0x55a878);}};}function respondWithFilteredResult(_0x467651,_0x3a5cb0){return function(_0x5b564a){if(_0x5b564a){var _0x2a034d=typeof _0x3a5cb0[_0x2c06('0x1c')]===_0x2c06('0x1d')&&typeof _0x3a5cb0[_0x2c06('0x1e')]===_0x2c06('0x1d');var _0x372048=_0x5b564a['count'];var _0x164d5c=_0x2a034d?0x0:_0x3a5cb0[_0x2c06('0x1c')];var _0x139045=_0x2a034d?_0x5b564a[_0x2c06('0x1f')]:_0x3a5cb0['offset']+_0x3a5cb0[_0x2c06('0x1e')];var _0x25d226;if(_0x139045>=_0x372048){_0x139045=_0x372048;_0x25d226=0xc8;}else{_0x25d226=0xce;}_0x467651[_0x2c06('0x1a')](_0x25d226);return _0x467651[_0x2c06('0x20')]('Content-Range',_0x164d5c+'-'+_0x139045+'/'+_0x372048)['json'](_0x5b564a);}return null;};}function patchUpdates(_0x5a30ca){return function(_0x1f6417){try{jsonpatch[_0x2c06('0x21')](_0x1f6417,_0x5a30ca,!![]);}catch(_0x49650c){return BPromise['reject'](_0x49650c);}return _0x1f6417[_0x2c06('0x22')]();};}function saveUpdates(_0x273da7,_0x531913){return function(_0x3dcc03){if(_0x3dcc03){return _0x3dcc03[_0x2c06('0x23')](_0x273da7)['then'](function(_0x22b31c){return _0x22b31c;});}return null;};}function removeEntity(_0xf325c0,_0x371c18){return function(_0x1d8838){if(_0x1d8838){return _0x1d8838['destroy']()[_0x2c06('0x24')](function(){_0xf325c0[_0x2c06('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d0bd3,_0x12accb){return function(_0xdbf66c){if(!_0xdbf66c){_0x5d0bd3[_0x2c06('0x19')](0x194);}return _0xdbf66c;};}function handleError(_0x4bf6de,_0x5eda3f){_0x5eda3f=_0x5eda3f||0x1f4;return function(_0x2b4b8f){logger[_0x2c06('0x25')](_0x2b4b8f[_0x2c06('0x26')]);if(_0x2b4b8f['name']){delete _0x2b4b8f['name'];}_0x4bf6de[_0x2c06('0x1a')](_0x5eda3f)['send'](_0x2b4b8f);};}exports[_0x2c06('0x27')]=function(_0x3b77d8,_0x2666b8){var _0x4a5206={},_0x44029a={},_0x1b071d={'count':0x0,'rows':[]};var _0x53d113=_[_0x2c06('0x28')](db['FreshsalesConfiguration'][_0x2c06('0x29')],function(_0x577eff){return{'name':_0x577eff['fieldName'],'type':_0x577eff[_0x2c06('0x2a')]['key']};});_0x44029a[_0x2c06('0x2b')]=_['map'](_0x53d113,'name');_0x44029a[_0x2c06('0x2c')]=_[_0x2c06('0x2d')](_0x3b77d8[_0x2c06('0x2c')]);_0x44029a[_0x2c06('0x2e')]=_['intersection'](_0x44029a[_0x2c06('0x2b')],_0x44029a[_0x2c06('0x2c')]);_0x4a5206['attributes']=_[_0x2c06('0x2f')](_0x44029a['model'],qs[_0x2c06('0x30')](_0x3b77d8[_0x2c06('0x2c')][_0x2c06('0x30')]));_0x4a5206['attributes']=_0x4a5206['attributes'][_0x2c06('0x31')]?_0x4a5206['attributes']:_0x44029a[_0x2c06('0x2b')];if(!_0x3b77d8[_0x2c06('0x2c')][_0x2c06('0x32')](_0x2c06('0x33'))){_0x4a5206[_0x2c06('0x1e')]=qs['limit'](_0x3b77d8['query']['limit']);_0x4a5206['offset']=qs[_0x2c06('0x1c')](_0x3b77d8[_0x2c06('0x2c')][_0x2c06('0x1c')]);}_0x4a5206[_0x2c06('0x34')]=qs[_0x2c06('0x35')](_0x3b77d8[_0x2c06('0x2c')][_0x2c06('0x35')]);_0x4a5206['where']=qs[_0x2c06('0x2e')](_[_0x2c06('0x36')](_0x3b77d8[_0x2c06('0x2c')],_0x44029a[_0x2c06('0x2e')]),_0x53d113);if(_0x3b77d8[_0x2c06('0x2c')][_0x2c06('0x37')]){_0x4a5206['where']=_[_0x2c06('0x38')](_0x4a5206[_0x2c06('0x39')],{'$or':_[_0x2c06('0x28')](_0x53d113,function(_0x1e5ab3){if(_0x1e5ab3['type']!==_0x2c06('0x3a')){var _0x39c32c={};_0x39c32c[_0x1e5ab3[_0x2c06('0x3b')]]={'$like':'%'+_0x3b77d8[_0x2c06('0x2c')][_0x2c06('0x37')]+'%'};return _0x39c32c;}})});}_0x4a5206=_[_0x2c06('0x38')]({},_0x4a5206,_0x3b77d8[_0x2c06('0x3c')]);var _0x5d9a44={'where':_0x4a5206['where']};return db[_0x2c06('0x3d')][_0x2c06('0x1f')](_0x5d9a44)[_0x2c06('0x24')](function(_0x230c09){_0x1b071d['count']=_0x230c09;if(_0x3b77d8['query']['includeAll']){_0x4a5206[_0x2c06('0x3e')]=[{'all':!![]}];}return db[_0x2c06('0x3d')][_0x2c06('0x3f')](_0x4a5206);})['then'](function(_0x8bc85f){_0x1b071d['rows']=_0x8bc85f;return _0x1b071d;})['then'](respondWithFilteredResult(_0x2666b8,_0x4a5206))[_0x2c06('0x40')](handleError(_0x2666b8,null));};exports[_0x2c06('0x41')]=function(_0x58b758,_0x18726a){var _0x1b7438={'raw':![],'where':{'id':_0x58b758[_0x2c06('0x42')]['id']}},_0x57ca34={};_0x57ca34['model']=_[_0x2c06('0x2d')](db[_0x2c06('0x3d')]['rawAttributes']);_0x57ca34[_0x2c06('0x2c')]=_[_0x2c06('0x2d')](_0x58b758[_0x2c06('0x2c')]);_0x57ca34[_0x2c06('0x2e')]=_[_0x2c06('0x2f')](_0x57ca34[_0x2c06('0x2b')],_0x57ca34[_0x2c06('0x2c')]);_0x1b7438[_0x2c06('0x43')]=_[_0x2c06('0x2f')](_0x57ca34[_0x2c06('0x2b')],qs['fields'](_0x58b758[_0x2c06('0x2c')][_0x2c06('0x30')]));_0x1b7438[_0x2c06('0x43')]=_0x1b7438[_0x2c06('0x43')][_0x2c06('0x31')]?_0x1b7438[_0x2c06('0x43')]:_0x57ca34['model'];if(_0x58b758[_0x2c06('0x2c')][_0x2c06('0x44')]){_0x1b7438[_0x2c06('0x3e')]=[{'all':!![]}];}_0x1b7438=_['merge']({},_0x1b7438,_0x58b758['options']);return db[_0x2c06('0x3d')]['find'](_0x1b7438)[_0x2c06('0x24')](handleEntityNotFound(_0x18726a,null))[_0x2c06('0x24')](respondWithResult(_0x18726a,null))[_0x2c06('0x40')](handleError(_0x18726a,null));};exports[_0x2c06('0x45')]=function(_0x476700,_0x4b1230){return db[_0x2c06('0x3d')]['create'](_0x476700[_0x2c06('0x46')],{})[_0x2c06('0x24')](respondWithResult(_0x4b1230,0xc9))['catch'](handleError(_0x4b1230,null));};exports['update']=function(_0x36fb96,_0x450c47){if(_0x36fb96[_0x2c06('0x46')]['id']){delete _0x36fb96[_0x2c06('0x46')]['id'];}return db[_0x2c06('0x3d')]['find']({'where':{'id':_0x36fb96['params']['id']}})[_0x2c06('0x24')](handleEntityNotFound(_0x450c47,null))['then'](saveUpdates(_0x36fb96[_0x2c06('0x46')],null))[_0x2c06('0x24')](respondWithResult(_0x450c47,null))['catch'](handleError(_0x450c47,null));};exports[_0x2c06('0x47')]=function(_0x3724e3,_0x327a71){return db[_0x2c06('0x3d')][_0x2c06('0x48')]({'where':{'id':_0x3724e3['params']['id']}})[_0x2c06('0x24')](handleEntityNotFound(_0x327a71,null))[_0x2c06('0x24')](removeEntity(_0x327a71,null))[_0x2c06('0x40')](handleError(_0x327a71,null));};exports[_0x2c06('0x49')]=function(_0x4848ec,_0x272110,_0x1e90c2){var _0x56faf1={};var _0x303497={};var _0x4a526f;var _0x1277ff;return db[_0x2c06('0x3d')][_0x2c06('0x4a')]({'where':{'id':_0x4848ec[_0x2c06('0x42')]['id']}})['then'](handleEntityNotFound(_0x272110,null))[_0x2c06('0x24')](function(_0x55b499){if(_0x55b499){_0x4a526f=_0x55b499;_0x303497[_0x2c06('0x2b')]=_[_0x2c06('0x2d')](db[_0x2c06('0x4b')][_0x2c06('0x29')]);_0x303497[_0x2c06('0x2c')]=_['keys'](_0x4848ec[_0x2c06('0x2c')]);_0x303497[_0x2c06('0x2e')]=_[_0x2c06('0x2f')](_0x303497[_0x2c06('0x2b')],_0x303497[_0x2c06('0x2c')]);_0x56faf1['attributes']=_['intersection'](_0x303497[_0x2c06('0x2b')],qs[_0x2c06('0x30')](_0x4848ec[_0x2c06('0x2c')]['fields']));_0x56faf1[_0x2c06('0x43')]=_0x56faf1[_0x2c06('0x43')][_0x2c06('0x31')]?_0x56faf1[_0x2c06('0x43')]:_0x303497['model'];_0x56faf1[_0x2c06('0x34')]=qs['sort'](_0x4848ec['query'][_0x2c06('0x35')]);_0x56faf1[_0x2c06('0x39')]=qs['filters'](_[_0x2c06('0x36')](_0x4848ec['query'],_0x303497[_0x2c06('0x2e')]));if(_0x4848ec[_0x2c06('0x2c')][_0x2c06('0x37')]){_0x56faf1[_0x2c06('0x39')]=_['merge'](_0x56faf1['where'],{'$or':_[_0x2c06('0x28')](_0x56faf1[_0x2c06('0x43')],function(_0x374d9d){var _0x4e77cc={};_0x4e77cc[_0x374d9d]={'$like':'%'+_0x4848ec['query'][_0x2c06('0x37')]+'%'};return _0x4e77cc;})});}_0x56faf1=_['merge']({},_0x56faf1,_0x4848ec[_0x2c06('0x3c')]);return _0x4a526f[_0x2c06('0x49')](_0x56faf1);}})['then'](function(_0x518fc8){if(_0x518fc8){_0x1277ff=_0x518fc8[_0x2c06('0x31')];if(!_0x4848ec[_0x2c06('0x2c')][_0x2c06('0x32')](_0x2c06('0x33'))){_0x56faf1[_0x2c06('0x1e')]=qs[_0x2c06('0x1e')](_0x4848ec[_0x2c06('0x2c')]['limit']);_0x56faf1['offset']=qs[_0x2c06('0x1c')](_0x4848ec['query']['offset']);}return _0x4a526f[_0x2c06('0x49')](_0x56faf1);}})[_0x2c06('0x24')](function(_0x3e6be1){if(_0x3e6be1){return _0x3e6be1?{'count':_0x1277ff,'rows':_0x3e6be1}:null;}})['then'](respondWithResult(_0x272110,null))['catch'](handleError(_0x272110,null));};exports[_0x2c06('0x4c')]=function(_0x552e2e,_0x36cdb9,_0x1a3dd6){var _0x37d814={};var _0xaf5df8={};var _0x332354;var _0x797922;return db[_0x2c06('0x3d')][_0x2c06('0x4a')]({'where':{'id':_0x552e2e['params']['id']}})[_0x2c06('0x24')](handleEntityNotFound(_0x36cdb9,null))['then'](function(_0x4a6b0c){if(_0x4a6b0c){_0x332354=_0x4a6b0c;_0xaf5df8[_0x2c06('0x2b')]=_[_0x2c06('0x2d')](db[_0x2c06('0x4b')][_0x2c06('0x29')]);_0xaf5df8[_0x2c06('0x2c')]=_[_0x2c06('0x2d')](_0x552e2e[_0x2c06('0x2c')]);_0xaf5df8['filters']=_[_0x2c06('0x2f')](_0xaf5df8[_0x2c06('0x2b')],_0xaf5df8[_0x2c06('0x2c')]);_0x37d814[_0x2c06('0x43')]=_[_0x2c06('0x2f')](_0xaf5df8[_0x2c06('0x2b')],qs[_0x2c06('0x30')](_0x552e2e[_0x2c06('0x2c')][_0x2c06('0x30')]));_0x37d814['attributes']=_0x37d814['attributes'][_0x2c06('0x31')]?_0x37d814[_0x2c06('0x43')]:_0xaf5df8[_0x2c06('0x2b')];_0x37d814[_0x2c06('0x34')]=qs[_0x2c06('0x35')](_0x552e2e['query'][_0x2c06('0x35')]);_0x37d814[_0x2c06('0x39')]=qs[_0x2c06('0x2e')](_[_0x2c06('0x36')](_0x552e2e[_0x2c06('0x2c')],_0xaf5df8['filters']));if(_0x552e2e[_0x2c06('0x2c')]['filter']){_0x37d814[_0x2c06('0x39')]=_[_0x2c06('0x38')](_0x37d814[_0x2c06('0x39')],{'$or':_[_0x2c06('0x28')](_0x37d814[_0x2c06('0x43')],function(_0x2eceba){var _0x282232={};_0x282232[_0x2eceba]={'$like':'%'+_0x552e2e[_0x2c06('0x2c')]['filter']+'%'};return _0x282232;})});}_0x37d814=_['merge']({},_0x37d814,_0x552e2e[_0x2c06('0x3c')]);return _0x332354[_0x2c06('0x4c')](_0x37d814);}})['then'](function(_0x45411e){if(_0x45411e){_0x797922=_0x45411e[_0x2c06('0x31')];if(!_0x552e2e[_0x2c06('0x2c')][_0x2c06('0x32')]('nolimit')){_0x37d814['limit']=qs[_0x2c06('0x1e')](_0x552e2e[_0x2c06('0x2c')][_0x2c06('0x1e')]);_0x37d814['offset']=qs[_0x2c06('0x1c')](_0x552e2e[_0x2c06('0x2c')][_0x2c06('0x1c')]);}return _0x332354['getDescriptions'](_0x37d814);}})[_0x2c06('0x24')](function(_0x53eb91){if(_0x53eb91){return _0x53eb91?{'count':_0x797922,'rows':_0x53eb91}:null;}})[_0x2c06('0x24')](respondWithResult(_0x36cdb9,null))[_0x2c06('0x40')](handleError(_0x36cdb9,null));};exports['getFields']=function(_0x4e2d94,_0x351186,_0x47ad44){var _0x458024={};var _0x234958={};var _0x55bf9a;var _0x4cd5df;return db['FreshsalesConfiguration']['findOne']({'where':{'id':_0x4e2d94[_0x2c06('0x42')]['id']}})['then'](handleEntityNotFound(_0x351186,null))['then'](function(_0x42d6b0){if(_0x42d6b0){_0x55bf9a=_0x42d6b0;_0x234958[_0x2c06('0x2b')]=_[_0x2c06('0x2d')](db[_0x2c06('0x4b')][_0x2c06('0x29')]);_0x234958[_0x2c06('0x2c')]=_[_0x2c06('0x2d')](_0x4e2d94[_0x2c06('0x2c')]);_0x234958[_0x2c06('0x2e')]=_[_0x2c06('0x2f')](_0x234958[_0x2c06('0x2b')],_0x234958[_0x2c06('0x2c')]);_0x458024['attributes']=_[_0x2c06('0x2f')](_0x234958[_0x2c06('0x2b')],qs[_0x2c06('0x30')](_0x4e2d94[_0x2c06('0x2c')][_0x2c06('0x30')]));_0x458024['attributes']=_0x458024['attributes'][_0x2c06('0x31')]?_0x458024[_0x2c06('0x43')]:_0x234958['model'];_0x458024[_0x2c06('0x34')]=qs[_0x2c06('0x35')](_0x4e2d94['query'][_0x2c06('0x35')]);_0x458024[_0x2c06('0x39')]=qs[_0x2c06('0x2e')](_[_0x2c06('0x36')](_0x4e2d94[_0x2c06('0x2c')],_0x234958[_0x2c06('0x2e')]));if(_0x4e2d94[_0x2c06('0x2c')][_0x2c06('0x37')]){_0x458024[_0x2c06('0x39')]=_[_0x2c06('0x38')](_0x458024[_0x2c06('0x39')],{'$or':_[_0x2c06('0x28')](_0x458024[_0x2c06('0x43')],function(_0x202ade){var _0x2683c2={};_0x2683c2[_0x202ade]={'$like':'%'+_0x4e2d94[_0x2c06('0x2c')][_0x2c06('0x37')]+'%'};return _0x2683c2;})});}_0x458024=_[_0x2c06('0x38')]({},_0x458024,_0x4e2d94[_0x2c06('0x3c')]);return _0x55bf9a[_0x2c06('0x4d')](_0x458024);}})[_0x2c06('0x24')](function(_0xd8d710){if(_0xd8d710){_0x4cd5df=_0xd8d710['length'];if(!_0x4e2d94[_0x2c06('0x2c')][_0x2c06('0x32')]('nolimit')){_0x458024['limit']=qs[_0x2c06('0x1e')](_0x4e2d94[_0x2c06('0x2c')]['limit']);_0x458024['offset']=qs[_0x2c06('0x1c')](_0x4e2d94[_0x2c06('0x2c')][_0x2c06('0x1c')]);}return _0x55bf9a[_0x2c06('0x4d')](_0x458024);}})['then'](function(_0x549a01){if(_0x549a01){return _0x549a01?{'count':_0x4cd5df,'rows':_0x549a01}:null;}})[_0x2c06('0x24')](respondWithResult(_0x351186,null))[_0x2c06('0x40')](handleError(_0x351186,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 96bcfc3..d254aad 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x23f4=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','lodash','util','../../config/logger'];(function(_0x5d886b,_0x20b3c1){var _0x22bc5e=function(_0x300aed){while(--_0x300aed){_0x5d886b['push'](_0x5d886b['shift']());}};_0x22bc5e(++_0x20b3c1);}(_0x23f4,0x97));var _0x423f=function(_0x25a8a5,_0x11eb7a){_0x25a8a5=_0x25a8a5-0x0;var _0x3d2ddc=_0x23f4[_0x25a8a5];return _0x3d2ddc;};'use strict';var _=require(_0x423f('0x0'));var util=require(_0x423f('0x1'));var logger=require(_0x423f('0x2'))(_0x423f('0x3'));var moment=require(_0x423f('0x4'));var BPromise=require(_0x423f('0x5'));var rp=require(_0x423f('0x6'));var fs=require('fs');var path=require(_0x423f('0x7'));var rimraf=require(_0x423f('0x8'));var config=require(_0x423f('0x9'));var attributes=require(_0x423f('0xa'));module[_0x423f('0xb')]=function(_0x338aab,_0x2903d3){return _0x338aab[_0x423f('0xc')](_0x423f('0xd'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e64=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','FreshsalesConfiguration','int_freshsales_configurations','lodash','api'];(function(_0x52f80d,_0x143626){var _0x2a79a0=function(_0x284ed8){while(--_0x284ed8){_0x52f80d['push'](_0x52f80d['shift']());}};_0x2a79a0(++_0x143626);}(_0x8e64,0x15a));var _0x48e6=function(_0x2263e5,_0x524d3b){_0x2263e5=_0x2263e5-0x0;var _0x338442=_0x8e64[_0x2263e5];return _0x338442;};'use strict';var _=require(_0x48e6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x48e6('0x1'));var moment=require(_0x48e6('0x2'));var BPromise=require(_0x48e6('0x3'));var rp=require(_0x48e6('0x4'));var fs=require('fs');var path=require(_0x48e6('0x5'));var rimraf=require(_0x48e6('0x6'));var config=require(_0x48e6('0x7'));var attributes=require(_0x48e6('0x8'));module[_0x48e6('0x9')]=function(_0x210ca8,_0x5e704){return _0x210ca8['define'](_0x48e6('0xa'),attributes,{'tableName':_0x48e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index a5cddd7..fd7b18f 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x929f=['rpc','../../config/environment','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x119cd8,_0x556b73){var _0x7072a3=function(_0x5908d1){while(--_0x5908d1){_0x119cd8['push'](_0x119cd8['shift']());}};_0x7072a3(++_0x556b73);}(_0x929f,0x1b2));var _0xf929=function(_0x5f4800,_0x5d31b4){_0x5f4800=_0x5f4800-0x0;var _0x4069ba=_0x929f[_0x5f4800];return _0x4069ba;};'use strict';var _=require(_0xf929('0x0'));var util=require(_0xf929('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf929('0x2'));var fs=require('fs');var Redis=require(_0xf929('0x3'));var db=require(_0xf929('0x4'))['db'];var utils=require(_0xf929('0x5'));var logger=require(_0xf929('0x6'))(_0xf929('0x7'));var config=require(_0xf929('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf929('0x9')][_0xf929('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x24610c,_0x53c7cb,_0x1397b4){return new BPromise(function(_0x277f56,_0x12a56e){return client['request'](_0x24610c,_0x1397b4)[_0xf929('0xb')](function(_0x2f20d7){logger[_0xf929('0xc')](_0xf929('0xd'),_0x53c7cb,_0xf929('0xe'));logger[_0xf929('0xf')](_0xf929('0x10'),_0x53c7cb,'request\x20sent',JSON[_0xf929('0x11')](_0x2f20d7));if(_0x2f20d7[_0xf929('0x12')]){if(_0x2f20d7[_0xf929('0x12')][_0xf929('0x13')]===0x1f4){logger[_0xf929('0x12')](_0xf929('0xd'),_0x53c7cb,_0x2f20d7[_0xf929('0x12')][_0xf929('0x14')]);return _0x12a56e(_0x2f20d7[_0xf929('0x12')]['message']);}logger[_0xf929('0x12')](_0xf929('0xd'),_0x53c7cb,_0x2f20d7[_0xf929('0x12')][_0xf929('0x14')]);return _0x277f56(_0x2f20d7[_0xf929('0x12')][_0xf929('0x14')]);}else{logger[_0xf929('0xc')](_0xf929('0xd'),_0x53c7cb,'request\x20sent');_0x277f56(_0x2f20d7['result']['message']);}})['catch'](function(_0x597ef9){logger[_0xf929('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x53c7cb,_0x597ef9);_0x12a56e(_0x597ef9);});});} \ No newline at end of file +var _0x0e46=['jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x24a6f4,_0x526878){var _0x5ddaf1=function(_0x46803c){while(--_0x46803c){_0x24a6f4['push'](_0x24a6f4['shift']());}};_0x5ddaf1(++_0x526878);}(_0x0e46,0x151));var _0x60e4=function(_0x365cf4,_0x54cd92){_0x365cf4=_0x365cf4-0x0;var _0x4f5059=_0x0e46[_0x365cf4];return _0x4f5059;};'use strict';var _=require(_0x60e4('0x0'));var util=require(_0x60e4('0x1'));var moment=require(_0x60e4('0x2'));var BPromise=require(_0x60e4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x60e4('0x4'));var db=require(_0x60e4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x60e4('0x6'));var config=require(_0x60e4('0x7'));var jayson=require(_0x60e4('0x8'));var client=jayson[_0x60e4('0x9')][_0x60e4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x43d9c3,_0x46aae3,_0x33930e){return new BPromise(function(_0x370b1a,_0xb59499){return client[_0x60e4('0xb')](_0x43d9c3,_0x33930e)[_0x60e4('0xc')](function(_0x3a7104){logger[_0x60e4('0xd')](_0x60e4('0xe'),_0x46aae3,_0x60e4('0xf'));logger[_0x60e4('0x10')](_0x60e4('0x11'),_0x46aae3,_0x60e4('0xf'),JSON[_0x60e4('0x12')](_0x3a7104));if(_0x3a7104[_0x60e4('0x13')]){if(_0x3a7104[_0x60e4('0x13')][_0x60e4('0x14')]===0x1f4){logger[_0x60e4('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x46aae3,_0x3a7104[_0x60e4('0x13')]['message']);return _0xb59499(_0x3a7104[_0x60e4('0x13')][_0x60e4('0x15')]);}logger[_0x60e4('0x13')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x46aae3,_0x3a7104[_0x60e4('0x13')][_0x60e4('0x15')]);return _0x370b1a(_0x3a7104[_0x60e4('0x13')]['message']);}else{logger['info'](_0x60e4('0xe'),_0x46aae3,_0x60e4('0xf'));_0x370b1a(_0x3a7104[_0x60e4('0x16')]['message']);}})['catch'](function(_0x2b002a){logger[_0x60e4('0x13')](_0x60e4('0xe'),_0x46aae3,_0x2b002a);_0xb59499(_0x2b002a);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 1ad4d01..9beaf53 100644 --- a/server/api/intFreshsalesField/index.js +++ b/server/api/intFreshsalesField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x782e=['/:id','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','index','isAuthenticated','post','create','put'];(function(_0x3ad462,_0x363c0d){var _0x4c721b=function(_0x11a62f){while(--_0x11a62f){_0x3ad462['push'](_0x3ad462['shift']());}};_0x4c721b(++_0x363c0d);}(_0x782e,0xb9));var _0xe782=function(_0x533b69,_0xfb1251){_0x533b69=_0x533b69-0x0;var _0x426829=_0x782e[_0x533b69];return _0x426829;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe782('0x0'));var timeout=require(_0xe782('0x1'));var express=require('express');var router=express[_0xe782('0x2')]();var fs_extra=require(_0xe782('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe782('0x4'));var config=require(_0xe782('0x5'));var controller=require(_0xe782('0x6'));router[_0xe782('0x7')]('/',auth['isAuthenticated'](),controller[_0xe782('0x8')]);router['get']('/:id',auth[_0xe782('0x9')](),controller['show']);router[_0xe782('0xa')]('/',auth[_0xe782('0x9')](),controller[_0xe782('0xb')]);router[_0xe782('0xc')](_0xe782('0xd'),auth[_0xe782('0x9')](),controller[_0xe782('0xe')]);router[_0xe782('0xf')](_0xe782('0xd'),auth[_0xe782('0x9')](),controller[_0xe782('0x10')]);module[_0xe782('0x11')]=router; \ No newline at end of file +var _0x385b=['isAuthenticated','index','/:id','show','post','create','delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get'];(function(_0x36793c,_0x4d5e71){var _0x21ed36=function(_0x56b1b0){while(--_0x56b1b0){_0x36793c['push'](_0x36793c['shift']());}};_0x21ed36(++_0x4d5e71);}(_0x385b,0x1a7));var _0xb385=function(_0x39be73,_0x31a022){_0x39be73=_0x39be73-0x0;var _0x14b572=_0x385b[_0x39be73];return _0x14b572;};'use strict';var multer=require('multer');var util=require(_0xb385('0x0'));var path=require('path');var timeout=require(_0xb385('0x1'));var express=require(_0xb385('0x2'));var router=express[_0xb385('0x3')]();var fs_extra=require(_0xb385('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb385('0x5'));var config=require(_0xb385('0x6'));var controller=require(_0xb385('0x7'));router[_0xb385('0x8')]('/',auth[_0xb385('0x9')](),controller[_0xb385('0xa')]);router[_0xb385('0x8')](_0xb385('0xb'),auth['isAuthenticated'](),controller[_0xb385('0xc')]);router[_0xb385('0xd')]('/',auth[_0xb385('0x9')](),controller[_0xb385('0xe')]);router['put'](_0xb385('0xb'),auth[_0xb385('0x9')](),controller['update']);router[_0xb385('0xf')](_0xb385('0xb'),auth[_0xb385('0x9')](),controller[_0xb385('0x10')]);module[_0xb385('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index f67dddc..8614df4 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.attributes.js +++ b/server/api/intFreshsalesField/intFreshsalesField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xebab=['keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string','variable','customVariable'];(function(_0x3c7810,_0x274437){var _0x2645bc=function(_0x210145){while(--_0x210145){_0x3c7810['push'](_0x3c7810['shift']());}};_0x2645bc(++_0x274437);}(_0xebab,0x1bd));var _0xbeba=function(_0x4b3ce7,_0x2d2650){_0x4b3ce7=_0x4b3ce7-0x0;var _0x124bab=_0xebab[_0x4b3ce7];return _0x124bab;};'use strict';var Sequelize=require('sequelize');module[_0xbeba('0x0')]={'type':{'type':Sequelize[_0xbeba('0x1')](_0xbeba('0x2'),_0xbeba('0x3'),_0xbeba('0x4'),_0xbeba('0x5'),_0xbeba('0x6')),'defaultValue':_0xbeba('0x2')},'content':{'type':Sequelize[_0xbeba('0x7')]},'key':{'type':Sequelize[_0xbeba('0x7')]},'keyType':{'type':Sequelize[_0xbeba('0x1')](_0xbeba('0x2'),_0xbeba('0x3'),_0xbeba('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xbeba('0x7')]},'nameField':{'type':Sequelize[_0xbeba('0x7')]},'customField':{'type':Sequelize[_0xbeba('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbeba('0x7')]}}; \ No newline at end of file +var _0x3894=['exports','ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x345d5,_0x597e45){var _0xcd7211=function(_0x269870){while(--_0x269870){_0x345d5['push'](_0x345d5['shift']());}};_0xcd7211(++_0x597e45);}(_0x3894,0x1ca));var _0x4389=function(_0x3e618a,_0x135251){_0x3e618a=_0x3e618a-0x0;var _0x1f3d61=_0x3894[_0x3e618a];return _0x1f3d61;};'use strict';var Sequelize=require(_0x4389('0x0'));module[_0x4389('0x1')]={'type':{'type':Sequelize[_0x4389('0x2')](_0x4389('0x3'),_0x4389('0x4'),_0x4389('0x5'),_0x4389('0x6'),'picklist'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4389('0x7')]},'keyType':{'type':Sequelize['ENUM']('string',_0x4389('0x4'),_0x4389('0x5'))},'keyContent':{'type':Sequelize[_0x4389('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4389('0x7')]},'customField':{'type':Sequelize[_0x4389('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4389('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 78cea83..4e74ec0 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.controller.js +++ b/server/api/intFreshsalesField/intFreshsalesField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21ee=['../../config/license/util','../../mysqldb','end','status','json','offset','limit','set','Content-Range','reject','save','update','then','sendStatus','error','name','send','index','map','FreshsalesField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','rawAttributes','include','find','create','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x4e1211,_0x1c0e26){var _0x4ae887=function(_0x6e55ff){while(--_0x6e55ff){_0x4e1211['push'](_0x4e1211['shift']());}};_0x4ae887(++_0x1c0e26);}(_0x21ee,0xc8));var _0xe21e=function(_0x5a07cb,_0x18504c){_0x5a07cb=_0x5a07cb-0x0;var _0x34ece1=_0x21ee[_0x5a07cb];return _0x34ece1;};'use strict';var emlformat=require(_0xe21e('0x0'));var rimraf=require(_0xe21e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe21e('0x2'));var rp=require(_0xe21e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe21e('0x4'));var util=require(_0xe21e('0x5'));var path=require(_0xe21e('0x6'));var sox=require(_0xe21e('0x7'));var csv=require(_0xe21e('0x8'));var ejs=require(_0xe21e('0x9'));var fs=require('fs');var fs_extra=require(_0xe21e('0xa'));var _=require(_0xe21e('0xb'));var squel=require(_0xe21e('0xc'));var crypto=require(_0xe21e('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe21e('0x8'));var querystring=require(_0xe21e('0xe'));var Papa=require(_0xe21e('0xf'));var Redis=require(_0xe21e('0x10'));var authService=require(_0xe21e('0x11'));var qs=require(_0xe21e('0x12'));var as=require(_0xe21e('0x13'));var hardwareService=require(_0xe21e('0x14'));var logger=require(_0xe21e('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe21e('0x16'));var db=require(_0xe21e('0x17'))['db'];function respondWithStatusCode(_0xaaf6eb,_0x4e4c8a){_0x4e4c8a=_0x4e4c8a||0xcc;return function(_0x3cf55e){if(_0x3cf55e){return _0xaaf6eb['sendStatus'](_0x4e4c8a);}return _0xaaf6eb['status'](_0x4e4c8a)[_0xe21e('0x18')]();};}function respondWithResult(_0x529e49,_0x371655){_0x371655=_0x371655||0xc8;return function(_0x8cbf89){if(_0x8cbf89){return _0x529e49[_0xe21e('0x19')](_0x371655)[_0xe21e('0x1a')](_0x8cbf89);}};}function respondWithFilteredResult(_0x5e1f49,_0x364859){return function(_0x4dcba8){if(_0x4dcba8){var _0x583bee=typeof _0x364859[_0xe21e('0x1b')]==='undefined'&&typeof _0x364859[_0xe21e('0x1c')]==='undefined';var _0x11bbc5=_0x4dcba8['count'];var _0x42316a=_0x583bee?0x0:_0x364859[_0xe21e('0x1b')];var _0x59f7ba=_0x583bee?_0x4dcba8['count']:_0x364859[_0xe21e('0x1b')]+_0x364859['limit'];var _0x44f086;if(_0x59f7ba>=_0x11bbc5){_0x59f7ba=_0x11bbc5;_0x44f086=0xc8;}else{_0x44f086=0xce;}_0x5e1f49[_0xe21e('0x19')](_0x44f086);return _0x5e1f49[_0xe21e('0x1d')](_0xe21e('0x1e'),_0x42316a+'-'+_0x59f7ba+'/'+_0x11bbc5)[_0xe21e('0x1a')](_0x4dcba8);}return null;};}function patchUpdates(_0x55d690){return function(_0x245001){try{jsonpatch['apply'](_0x245001,_0x55d690,!![]);}catch(_0x1028f9){return BPromise[_0xe21e('0x1f')](_0x1028f9);}return _0x245001[_0xe21e('0x20')]();};}function saveUpdates(_0x451552,_0x13a5a2){return function(_0x4538f8){if(_0x4538f8){return _0x4538f8[_0xe21e('0x21')](_0x451552)[_0xe21e('0x22')](function(_0x4ac013){return _0x4ac013;});}return null;};}function removeEntity(_0x27291c,_0x30727f){return function(_0x371130){if(_0x371130){return _0x371130['destroy']()[_0xe21e('0x22')](function(){_0x27291c[_0xe21e('0x19')](0xcc)[_0xe21e('0x18')]();});}};}function handleEntityNotFound(_0x5e9ab2,_0x149097){return function(_0x113911){if(!_0x113911){_0x5e9ab2[_0xe21e('0x23')](0x194);}return _0x113911;};}function handleError(_0x3d9101,_0x4ee002){_0x4ee002=_0x4ee002||0x1f4;return function(_0x1f0513){logger[_0xe21e('0x24')](_0x1f0513['stack']);if(_0x1f0513[_0xe21e('0x25')]){delete _0x1f0513[_0xe21e('0x25')];}_0x3d9101[_0xe21e('0x19')](_0x4ee002)[_0xe21e('0x26')](_0x1f0513);};}exports[_0xe21e('0x27')]=function(_0x1f0869,_0x4dfa55){var _0x35839b={},_0x2e9a6b={},_0x4a022d={'count':0x0,'rows':[]};var _0x32e950=_[_0xe21e('0x28')](db[_0xe21e('0x29')]['rawAttributes'],function(_0x58c24b){return{'name':_0x58c24b[_0xe21e('0x2a')],'type':_0x58c24b[_0xe21e('0x2b')][_0xe21e('0x2c')]};});_0x2e9a6b[_0xe21e('0x2d')]=_[_0xe21e('0x28')](_0x32e950,'name');_0x2e9a6b[_0xe21e('0x2e')]=_[_0xe21e('0x2f')](_0x1f0869[_0xe21e('0x2e')]);_0x2e9a6b[_0xe21e('0x30')]=_[_0xe21e('0x31')](_0x2e9a6b[_0xe21e('0x2d')],_0x2e9a6b[_0xe21e('0x2e')]);_0x35839b[_0xe21e('0x32')]=_[_0xe21e('0x31')](_0x2e9a6b[_0xe21e('0x2d')],qs[_0xe21e('0x33')](_0x1f0869[_0xe21e('0x2e')][_0xe21e('0x33')]));_0x35839b[_0xe21e('0x32')]=_0x35839b[_0xe21e('0x32')][_0xe21e('0x34')]?_0x35839b[_0xe21e('0x32')]:_0x2e9a6b['model'];if(!_0x1f0869['query']['hasOwnProperty'](_0xe21e('0x35'))){_0x35839b['limit']=qs[_0xe21e('0x1c')](_0x1f0869['query']['limit']);_0x35839b[_0xe21e('0x1b')]=qs[_0xe21e('0x1b')](_0x1f0869[_0xe21e('0x2e')][_0xe21e('0x1b')]);}_0x35839b[_0xe21e('0x36')]=qs['sort'](_0x1f0869[_0xe21e('0x2e')][_0xe21e('0x37')]);_0x35839b[_0xe21e('0x38')]=qs[_0xe21e('0x30')](_[_0xe21e('0x39')](_0x1f0869[_0xe21e('0x2e')],_0x2e9a6b[_0xe21e('0x30')]),_0x32e950);if(_0x1f0869[_0xe21e('0x2e')][_0xe21e('0x3a')]){_0x35839b[_0xe21e('0x38')]=_[_0xe21e('0x3b')](_0x35839b[_0xe21e('0x38')],{'$or':_['map'](_0x32e950,function(_0x337373){if(_0x337373[_0xe21e('0x2b')]!==_0xe21e('0x3c')){var _0x57a819={};_0x57a819[_0x337373[_0xe21e('0x25')]]={'$like':'%'+_0x1f0869[_0xe21e('0x2e')][_0xe21e('0x3a')]+'%'};return _0x57a819;}})});}_0x35839b=_['merge']({},_0x35839b,_0x1f0869[_0xe21e('0x3d')]);var _0x2aa3d0={'where':_0x35839b['where']};return db['FreshsalesField'][_0xe21e('0x3e')](_0x2aa3d0)[_0xe21e('0x22')](function(_0x1f5e0c){_0x4a022d[_0xe21e('0x3e')]=_0x1f5e0c;if(_0x1f0869['query'][_0xe21e('0x3f')]){_0x35839b['include']=[{'all':!![]}];}return db[_0xe21e('0x29')]['findAll'](_0x35839b);})['then'](function(_0x1d62bf){_0x4a022d[_0xe21e('0x40')]=_0x1d62bf;return _0x4a022d;})[_0xe21e('0x22')](respondWithFilteredResult(_0x4dfa55,_0x35839b))[_0xe21e('0x41')](handleError(_0x4dfa55,null));};exports[_0xe21e('0x42')]=function(_0x135523,_0x2783a8){var _0x1227f1={'raw':!![],'where':{'id':_0x135523[_0xe21e('0x43')]['id']}},_0x34c306={};_0x34c306['model']=_[_0xe21e('0x2f')](db[_0xe21e('0x29')][_0xe21e('0x44')]);_0x34c306[_0xe21e('0x2e')]=_[_0xe21e('0x2f')](_0x135523[_0xe21e('0x2e')]);_0x34c306[_0xe21e('0x30')]=_[_0xe21e('0x31')](_0x34c306[_0xe21e('0x2d')],_0x34c306['query']);_0x1227f1[_0xe21e('0x32')]=_[_0xe21e('0x31')](_0x34c306[_0xe21e('0x2d')],qs[_0xe21e('0x33')](_0x135523['query'][_0xe21e('0x33')]));_0x1227f1[_0xe21e('0x32')]=_0x1227f1[_0xe21e('0x32')][_0xe21e('0x34')]?_0x1227f1[_0xe21e('0x32')]:_0x34c306['model'];if(_0x135523['query'][_0xe21e('0x3f')]){_0x1227f1[_0xe21e('0x45')]=[{'all':!![]}];}_0x1227f1=_[_0xe21e('0x3b')]({},_0x1227f1,_0x135523['options']);return db[_0xe21e('0x29')][_0xe21e('0x46')](_0x1227f1)['then'](handleEntityNotFound(_0x2783a8,null))[_0xe21e('0x22')](respondWithResult(_0x2783a8,null))['catch'](handleError(_0x2783a8,null));};exports[_0xe21e('0x47')]=function(_0x232801,_0x2f089e){return db[_0xe21e('0x29')][_0xe21e('0x47')](_0x232801[_0xe21e('0x48')],{})[_0xe21e('0x22')](respondWithResult(_0x2f089e,0xc9))[_0xe21e('0x41')](handleError(_0x2f089e,null));};exports['update']=function(_0x265f2c,_0x53b0f2){if(_0x265f2c['body']['id']){delete _0x265f2c['body']['id'];}return db[_0xe21e('0x29')][_0xe21e('0x46')]({'where':{'id':_0x265f2c[_0xe21e('0x43')]['id']}})[_0xe21e('0x22')](handleEntityNotFound(_0x53b0f2,null))['then'](saveUpdates(_0x265f2c[_0xe21e('0x48')],null))[_0xe21e('0x22')](respondWithResult(_0x53b0f2,null))[_0xe21e('0x41')](handleError(_0x53b0f2,null));};exports[_0xe21e('0x49')]=function(_0x3b67e7,_0x19f611){return db['FreshsalesField']['find']({'where':{'id':_0x3b67e7[_0xe21e('0x43')]['id']}})[_0xe21e('0x22')](handleEntityNotFound(_0x19f611,null))[_0xe21e('0x22')](removeEntity(_0x19f611,null))[_0xe21e('0x41')](handleError(_0x19f611,null));}; \ No newline at end of file +var _0xc4e2=['../../config/environment','../../config/license/util','status','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','FreshsalesField','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','VIRTUAL','filter','options','includeAll','findAll','catch','show','params','include','merge','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x4dd0f4,_0x4afdcf){var _0x572ddd=function(_0x14c783){while(--_0x14c783){_0x4dd0f4['push'](_0x4dd0f4['shift']());}};_0x572ddd(++_0x4afdcf);}(_0xc4e2,0x106));var _0x2c4e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xc4e2[_0x9df060];return _0x338dfe;};'use strict';var emlformat=require(_0x2c4e('0x0'));var rimraf=require(_0x2c4e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c4e('0x2'));var rp=require(_0x2c4e('0x3'));var moment=require(_0x2c4e('0x4'));var BPromise=require(_0x2c4e('0x5'));var Mustache=require(_0x2c4e('0x6'));var util=require('util');var path=require(_0x2c4e('0x7'));var sox=require(_0x2c4e('0x8'));var csv=require(_0x2c4e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c4e('0xa'));var squel=require('squel');var crypto=require(_0x2c4e('0xb'));var jsforce=require(_0x2c4e('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2c4e('0xd'));var Redis=require(_0x2c4e('0xe'));var authService=require(_0x2c4e('0xf'));var qs=require(_0x2c4e('0x10'));var as=require(_0x2c4e('0x11'));var hardwareService=require(_0x2c4e('0x12'));var logger=require(_0x2c4e('0x13'))(_0x2c4e('0x14'));var utils=require(_0x2c4e('0x15'));var config=require(_0x2c4e('0x16'));var licenseUtil=require(_0x2c4e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eff31,_0x335f60){_0x335f60=_0x335f60||0xcc;return function(_0x4bcf4a){if(_0x4bcf4a){return _0x3eff31['sendStatus'](_0x335f60);}return _0x3eff31[_0x2c4e('0x18')](_0x335f60)['end']();};}function respondWithResult(_0x293a47,_0x5a9015){_0x5a9015=_0x5a9015||0xc8;return function(_0x45246a){if(_0x45246a){return _0x293a47[_0x2c4e('0x18')](_0x5a9015)['json'](_0x45246a);}};}function respondWithFilteredResult(_0x4e89e3,_0x458ffa){return function(_0xc3e127){if(_0xc3e127){var _0x5ed298=typeof _0x458ffa[_0x2c4e('0x19')]===_0x2c4e('0x1a')&&typeof _0x458ffa[_0x2c4e('0x1b')]===_0x2c4e('0x1a');var _0x59f3b7=_0xc3e127[_0x2c4e('0x1c')];var _0x2ae511=_0x5ed298?0x0:_0x458ffa['offset'];var _0x15e2f1=_0x5ed298?_0xc3e127[_0x2c4e('0x1c')]:_0x458ffa[_0x2c4e('0x19')]+_0x458ffa[_0x2c4e('0x1b')];var _0x348dc1;if(_0x15e2f1>=_0x59f3b7){_0x15e2f1=_0x59f3b7;_0x348dc1=0xc8;}else{_0x348dc1=0xce;}_0x4e89e3['status'](_0x348dc1);return _0x4e89e3['set'](_0x2c4e('0x1d'),_0x2ae511+'-'+_0x15e2f1+'/'+_0x59f3b7)['json'](_0xc3e127);}return null;};}function patchUpdates(_0xa6d301){return function(_0x18b83b){try{jsonpatch[_0x2c4e('0x1e')](_0x18b83b,_0xa6d301,!![]);}catch(_0x3ec69b){return BPromise['reject'](_0x3ec69b);}return _0x18b83b[_0x2c4e('0x1f')]();};}function saveUpdates(_0x4e7987,_0x330a77){return function(_0x2f2a28){if(_0x2f2a28){return _0x2f2a28[_0x2c4e('0x20')](_0x4e7987)[_0x2c4e('0x21')](function(_0x237541){return _0x237541;});}return null;};}function removeEntity(_0x336229,_0x5b84e6){return function(_0x2ad6d5){if(_0x2ad6d5){return _0x2ad6d5[_0x2c4e('0x22')]()['then'](function(){_0x336229[_0x2c4e('0x18')](0xcc)[_0x2c4e('0x23')]();});}};}function handleEntityNotFound(_0x5ced1a,_0x322b4b){return function(_0x432fa8){if(!_0x432fa8){_0x5ced1a[_0x2c4e('0x24')](0x194);}return _0x432fa8;};}function handleError(_0xcae1d4,_0x322aa0){_0x322aa0=_0x322aa0||0x1f4;return function(_0x4d46ac){logger[_0x2c4e('0x25')](_0x4d46ac[_0x2c4e('0x26')]);if(_0x4d46ac['name']){delete _0x4d46ac[_0x2c4e('0x27')];}_0xcae1d4[_0x2c4e('0x18')](_0x322aa0)[_0x2c4e('0x28')](_0x4d46ac);};}exports[_0x2c4e('0x29')]=function(_0x3f3c44,_0x2abcde){var _0x37e643={},_0x50e490={},_0x2c8408={'count':0x0,'rows':[]};var _0x122e3c=_['map'](db[_0x2c4e('0x2a')][_0x2c4e('0x2b')],function(_0x284d00){return{'name':_0x284d00['fieldName'],'type':_0x284d00[_0x2c4e('0x2c')][_0x2c4e('0x2d')]};});_0x50e490[_0x2c4e('0x2e')]=_[_0x2c4e('0x2f')](_0x122e3c,_0x2c4e('0x27'));_0x50e490[_0x2c4e('0x30')]=_[_0x2c4e('0x31')](_0x3f3c44['query']);_0x50e490[_0x2c4e('0x32')]=_[_0x2c4e('0x33')](_0x50e490[_0x2c4e('0x2e')],_0x50e490[_0x2c4e('0x30')]);_0x37e643[_0x2c4e('0x34')]=_['intersection'](_0x50e490[_0x2c4e('0x2e')],qs[_0x2c4e('0x35')](_0x3f3c44[_0x2c4e('0x30')]['fields']));_0x37e643[_0x2c4e('0x34')]=_0x37e643[_0x2c4e('0x34')][_0x2c4e('0x36')]?_0x37e643['attributes']:_0x50e490['model'];if(!_0x3f3c44[_0x2c4e('0x30')]['hasOwnProperty']('nolimit')){_0x37e643[_0x2c4e('0x1b')]=qs[_0x2c4e('0x1b')](_0x3f3c44[_0x2c4e('0x30')][_0x2c4e('0x1b')]);_0x37e643[_0x2c4e('0x19')]=qs[_0x2c4e('0x19')](_0x3f3c44[_0x2c4e('0x30')]['offset']);}_0x37e643['order']=qs[_0x2c4e('0x37')](_0x3f3c44[_0x2c4e('0x30')]['sort']);_0x37e643[_0x2c4e('0x38')]=qs[_0x2c4e('0x32')](_[_0x2c4e('0x39')](_0x3f3c44['query'],_0x50e490['filters']),_0x122e3c);if(_0x3f3c44['query']['filter']){_0x37e643[_0x2c4e('0x38')]=_['merge'](_0x37e643[_0x2c4e('0x38')],{'$or':_['map'](_0x122e3c,function(_0x5244f2){if(_0x5244f2[_0x2c4e('0x2c')]!==_0x2c4e('0x3a')){var _0x3d42a7={};_0x3d42a7[_0x5244f2[_0x2c4e('0x27')]]={'$like':'%'+_0x3f3c44[_0x2c4e('0x30')][_0x2c4e('0x3b')]+'%'};return _0x3d42a7;}})});}_0x37e643=_['merge']({},_0x37e643,_0x3f3c44[_0x2c4e('0x3c')]);var _0x477499={'where':_0x37e643[_0x2c4e('0x38')]};return db[_0x2c4e('0x2a')][_0x2c4e('0x1c')](_0x477499)[_0x2c4e('0x21')](function(_0x1f2810){_0x2c8408[_0x2c4e('0x1c')]=_0x1f2810;if(_0x3f3c44['query'][_0x2c4e('0x3d')]){_0x37e643['include']=[{'all':!![]}];}return db[_0x2c4e('0x2a')][_0x2c4e('0x3e')](_0x37e643);})['then'](function(_0x3b9e97){_0x2c8408['rows']=_0x3b9e97;return _0x2c8408;})['then'](respondWithFilteredResult(_0x2abcde,_0x37e643))[_0x2c4e('0x3f')](handleError(_0x2abcde,null));};exports[_0x2c4e('0x40')]=function(_0x3c4268,_0x484cdc){var _0x27da23={'raw':!![],'where':{'id':_0x3c4268[_0x2c4e('0x41')]['id']}},_0x24d581={};_0x24d581['model']=_[_0x2c4e('0x31')](db['FreshsalesField'][_0x2c4e('0x2b')]);_0x24d581[_0x2c4e('0x30')]=_['keys'](_0x3c4268[_0x2c4e('0x30')]);_0x24d581[_0x2c4e('0x32')]=_[_0x2c4e('0x33')](_0x24d581[_0x2c4e('0x2e')],_0x24d581[_0x2c4e('0x30')]);_0x27da23[_0x2c4e('0x34')]=_['intersection'](_0x24d581[_0x2c4e('0x2e')],qs[_0x2c4e('0x35')](_0x3c4268[_0x2c4e('0x30')][_0x2c4e('0x35')]));_0x27da23[_0x2c4e('0x34')]=_0x27da23[_0x2c4e('0x34')][_0x2c4e('0x36')]?_0x27da23[_0x2c4e('0x34')]:_0x24d581[_0x2c4e('0x2e')];if(_0x3c4268[_0x2c4e('0x30')]['includeAll']){_0x27da23[_0x2c4e('0x42')]=[{'all':!![]}];}_0x27da23=_[_0x2c4e('0x43')]({},_0x27da23,_0x3c4268[_0x2c4e('0x3c')]);return db[_0x2c4e('0x2a')][_0x2c4e('0x44')](_0x27da23)[_0x2c4e('0x21')](handleEntityNotFound(_0x484cdc,null))[_0x2c4e('0x21')](respondWithResult(_0x484cdc,null))[_0x2c4e('0x3f')](handleError(_0x484cdc,null));};exports[_0x2c4e('0x45')]=function(_0x392be7,_0x692618){return db[_0x2c4e('0x2a')]['create'](_0x392be7[_0x2c4e('0x46')],{})[_0x2c4e('0x21')](respondWithResult(_0x692618,0xc9))[_0x2c4e('0x3f')](handleError(_0x692618,null));};exports[_0x2c4e('0x20')]=function(_0x56d013,_0x31c444){if(_0x56d013['body']['id']){delete _0x56d013[_0x2c4e('0x46')]['id'];}return db[_0x2c4e('0x2a')]['find']({'where':{'id':_0x56d013[_0x2c4e('0x41')]['id']}})[_0x2c4e('0x21')](handleEntityNotFound(_0x31c444,null))['then'](saveUpdates(_0x56d013[_0x2c4e('0x46')],null))[_0x2c4e('0x21')](respondWithResult(_0x31c444,null))[_0x2c4e('0x3f')](handleError(_0x31c444,null));};exports[_0x2c4e('0x22')]=function(_0x45b9b0,_0x4a2f25){return db[_0x2c4e('0x2a')][_0x2c4e('0x44')]({'where':{'id':_0x45b9b0[_0x2c4e('0x41')]['id']}})['then'](handleEntityNotFound(_0x4a2f25,null))[_0x2c4e('0x21')](removeEntity(_0x4a2f25,null))[_0x2c4e('0x3f')](handleError(_0x4a2f25,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 2356d5a..08613b0 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.model.js +++ b/server/api/intFreshsalesField/intFreshsalesField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x19cb=['./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','util','../../config/logger','moment','request-promise'];(function(_0x3e6af8,_0x116679){var _0x6319b1=function(_0x3f079c){while(--_0x3f079c){_0x3e6af8['push'](_0x3e6af8['shift']());}};_0x6319b1(++_0x116679);}(_0x19cb,0x146));var _0xb19c=function(_0x2091bb,_0x43a2e1){_0x2091bb=_0x2091bb-0x0;var _0x12c345=_0x19cb[_0x2091bb];return _0x12c345;};'use strict';var _=require('lodash');var util=require(_0xb19c('0x0'));var logger=require(_0xb19c('0x1'))('api');var moment=require(_0xb19c('0x2'));var BPromise=require('bluebird');var rp=require(_0xb19c('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb19c('0x4'));module[_0xb19c('0x5')]=function(_0x5a145d,_0x551f8d){return _0x5a145d[_0xb19c('0x6')](_0xb19c('0x7'),attributes,{'tableName':_0xb19c('0x8'),'paranoid':![],'indexes':[{'name':_0xb19c('0x9'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7292=['api','moment','bluebird','path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','idField','lodash','util','../../config/logger'];(function(_0x5d1bda,_0x279fbb){var _0x4e4917=function(_0x2ad079){while(--_0x2ad079){_0x5d1bda['push'](_0x5d1bda['shift']());}};_0x4e4917(++_0x279fbb);}(_0x7292,0x6d));var _0x2729=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x7292[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require(_0x2729('0x0'));var util=require(_0x2729('0x1'));var logger=require(_0x2729('0x2'))(_0x2729('0x3'));var moment=require(_0x2729('0x4'));var BPromise=require(_0x2729('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2729('0x6'));var rimraf=require(_0x2729('0x7'));var config=require(_0x2729('0x8'));var attributes=require(_0x2729('0x9'));module[_0x2729('0xa')]=function(_0x4db88a,_0x119935){return _0x4db88a[_0x2729('0xb')](_0x2729('0xc'),attributes,{'tableName':_0x2729('0xd'),'paranoid':![],'indexes':[{'name':_0x2729('0xe'),'fields':[_0x2729('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index d9b81c9..e6b361f 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.rpc.js +++ b/server/api/intFreshsalesField/intFreshsalesField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1d5ba8,_0x412a52){var _0x1022a2=function(_0x187f11){while(--_0x187f11){_0x1d5ba8['push'](_0x1d5ba8['shift']());}};_0x1022a2(++_0x412a52);}(_0xadb5,0xad));var _0x5adb=function(_0x5cb640,_0x5166be){_0x5cb640=_0x5cb640-0x0;var _0x7d44e4=_0xadb5[_0x5cb640];return _0x7d44e4;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});} \ No newline at end of file +var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','FreshsalesField,\x20%s,\x20%s','FreshsalesField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0xd713d,_0x24eb9b){var _0x529488=function(_0x376c87){while(--_0x376c87){_0xd713d['push'](_0xd713d['shift']());}};_0x529488(++_0x24eb9b);}(_0x2ef3,0xba));var _0x32ef=function(_0x3ff0ac,_0x52d0c7){_0x3ff0ac=_0x3ff0ac-0x0;var _0x33014a=_0x2ef3[_0x3ff0ac];return _0x33014a;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('FreshsalesField,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 391b568..81b2168 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x9c3016,_0x2553b7){var _0x858ef3=function(_0x5c57d8){while(--_0x5c57d8){_0x9c3016['push'](_0x9c3016['shift']());}};_0x858ef3(++_0x2553b7);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x4fe4ec,_0x5e4cc5){var _0x176455=function(_0x5e3459){while(--_0x5e3459){_0x4fe4ec['push'](_0x4fe4ec['shift']());}};_0x176455(++_0x5e4cc5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0xa9e0[_0x2f3848];return _0x102668;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index d023b65..78b21ec 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 _0xa3d4=['integrationTab','newTab','sequelize','STRING','ENUM'];(function(_0x295cda,_0x5e8b5e){var _0x5517e0=function(_0x41f885){while(--_0x41f885){_0x295cda['push'](_0x295cda['shift']());}};_0x5517e0(++_0x5e8b5e);}(_0xa3d4,0x151));var _0x4a3d=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xa3d4[_0xb0f7c3];return _0x28ea68;};'use strict';var Sequelize=require(_0x4a3d('0x0'));module['exports']={'name':{'type':Sequelize[_0x4a3d('0x1')]},'description':{'type':Sequelize[_0x4a3d('0x1')]},'username':{'type':Sequelize[_0x4a3d('0x1')],'unique':'username'},'remoteUri':{'type':Sequelize[_0x4a3d('0x1')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4a3d('0x2')](_0x4a3d('0x3'),_0x4a3d('0x4')),'defaultValue':_0x4a3d('0x3')}}; \ No newline at end of file +var _0x020a=['username','ENUM','integrationTab','sequelize','exports','STRING'];(function(_0x281223,_0x1794c3){var _0x424e78=function(_0x504d4f){while(--_0x504d4f){_0x281223['push'](_0x281223['shift']());}};_0x424e78(++_0x1794c3);}(_0x020a,0xc9));var _0xa020=function(_0x1d69e5,_0x2a29af){_0x1d69e5=_0x1d69e5-0x0;var _0x17da11=_0x020a[_0x1d69e5];return _0x17da11;};'use strict';var Sequelize=require(_0xa020('0x0'));module[_0xa020('0x1')]={'name':{'type':Sequelize[_0xa020('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa020('0x2')],'unique':_0xa020('0x3')},'remoteUri':{'type':Sequelize[_0xa020('0x2')]},'password':{'type':Sequelize[_0xa020('0x2')]},'clientId':{'type':Sequelize[_0xa020('0x2')]},'clientSecret':{'type':Sequelize[_0xa020('0x2')]},'securityToken':{'type':Sequelize[_0xa020('0x2')]},'serverUrl':{'type':Sequelize[_0xa020('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa020('0x4')](_0xa020('0x5'),'newTab'),'defaultValue':_0xa020('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 44c39df..ef9b965 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 _0x5fb1=['IsReminderSet','Description','string','int','picklist','boolean','email','phone','remove','includes','label','picklistValues','value','True','False','false','test','statusCode','getFields','stringify','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','length','find','create','body','getConfigurations','findOne','SalesforceConfiguration','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Task','remoteUri','clientId','clientSecret','username','securityToken','slice','substring','lastIndexOf','login','concat','isNil','ticketType','describe','OwnerId','ActivityDate'];(function(_0x4959fd,_0x186515){var _0x97de01=function(_0x29e1d0){while(--_0x29e1d0){_0x4959fd['push'](_0x4959fd['shift']());}};_0x97de01(++_0x186515);}(_0x5fb1,0x10a));var _0x15fb=function(_0x5f46e7,_0x62f9f8){_0x5f46e7=_0x5f46e7-0x0;var _0x567e95=_0x5fb1[_0x5f46e7];return _0x567e95;};'use strict';var emlformat=require(_0x15fb('0x0'));var rimraf=require(_0x15fb('0x1'));var zipdir=require(_0x15fb('0x2'));var jsonpatch=require(_0x15fb('0x3'));var rp=require(_0x15fb('0x4'));var moment=require(_0x15fb('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x15fb('0x6'));var util=require(_0x15fb('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15fb('0x8'));var _=require(_0x15fb('0x9'));var squel=require(_0x15fb('0xa'));var crypto=require(_0x15fb('0xb'));var jsforce=require(_0x15fb('0xc'));var deskjs=require(_0x15fb('0xd'));var toCsv=require(_0x15fb('0xe'));var querystring=require(_0x15fb('0xf'));var Papa=require(_0x15fb('0x10'));var Redis=require(_0x15fb('0x11'));var authService=require(_0x15fb('0x12'));var qs=require(_0x15fb('0x13'));var as=require(_0x15fb('0x14'));var hardwareService=require(_0x15fb('0x15'));var logger=require(_0x15fb('0x16'))(_0x15fb('0x17'));var utils=require(_0x15fb('0x18'));var config=require(_0x15fb('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x15fb('0x1a'))['db'];var integrations=require(_0x15fb('0x1b'));function respondWithStatusCode(_0x3cdd11,_0xb508ee){_0xb508ee=_0xb508ee||0xcc;return function(_0x40f67c){if(_0x40f67c){return _0x3cdd11[_0x15fb('0x1c')](_0xb508ee);}return _0x3cdd11[_0x15fb('0x1d')](_0xb508ee)['end']();};}function respondWithResult(_0x4c58ca,_0x5edb07){_0x5edb07=_0x5edb07||0xc8;return function(_0x1dfbe6){if(_0x1dfbe6){return _0x4c58ca[_0x15fb('0x1d')](_0x5edb07)['json'](_0x1dfbe6);}};}function respondWithFilteredResult(_0x1f12bb,_0x4be145){return function(_0x383f88){if(_0x383f88){var _0x28f5af=typeof _0x4be145[_0x15fb('0x1e')]==='undefined'&&typeof _0x4be145[_0x15fb('0x1f')]===_0x15fb('0x20');var _0x2a7168=_0x383f88[_0x15fb('0x21')];var _0x2b6ec7=_0x28f5af?0x0:_0x4be145[_0x15fb('0x1e')];var _0x258445=_0x28f5af?_0x383f88[_0x15fb('0x21')]:_0x4be145['offset']+_0x4be145[_0x15fb('0x1f')];var _0x324e06;if(_0x258445>=_0x2a7168){_0x258445=_0x2a7168;_0x324e06=0xc8;}else{_0x324e06=0xce;}_0x1f12bb[_0x15fb('0x1d')](_0x324e06);return _0x1f12bb[_0x15fb('0x22')]('Content-Range',_0x2b6ec7+'-'+_0x258445+'/'+_0x2a7168)['json'](_0x383f88);}return null;};}function patchUpdates(_0x3fc12f){return function(_0x3c78d6){try{jsonpatch[_0x15fb('0x23')](_0x3c78d6,_0x3fc12f,!![]);}catch(_0x3e74df){return BPromise[_0x15fb('0x24')](_0x3e74df);}return _0x3c78d6[_0x15fb('0x25')]();};}function saveUpdates(_0x48a2d7,_0x57aad1){return function(_0x446057){if(_0x446057){return _0x446057[_0x15fb('0x26')](_0x48a2d7)[_0x15fb('0x27')](function(_0x35970a){return _0x35970a;});}return null;};}function removeEntity(_0x30cf2f,_0x4adde8){return function(_0x2b7a9a){if(_0x2b7a9a){return _0x2b7a9a[_0x15fb('0x28')]()['then'](function(){_0x30cf2f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4aef94,_0x1242e1){return function(_0x482800){if(!_0x482800){_0x4aef94[_0x15fb('0x1c')](0x194);}return _0x482800;};}function handleError(_0x32a5dc,_0xd5fac3){_0xd5fac3=_0xd5fac3||0x1f4;return function(_0x41c3c3){logger[_0x15fb('0x29')](_0x41c3c3[_0x15fb('0x2a')]);if(_0x41c3c3[_0x15fb('0x2b')]){delete _0x41c3c3[_0x15fb('0x2b')];}_0x32a5dc[_0x15fb('0x1d')](_0xd5fac3)[_0x15fb('0x2c')](_0x41c3c3);};}exports[_0x15fb('0x2d')]=function(_0xdbefdb,_0x556ef6){var _0x430fcc={},_0x509a15={},_0x2db9b3={'count':0x0,'rows':[]};var _0x543cb4=_[_0x15fb('0x2e')](db[_0x15fb('0x2f')][_0x15fb('0x30')],function(_0x166a27){return{'name':_0x166a27[_0x15fb('0x31')],'type':_0x166a27[_0x15fb('0x32')][_0x15fb('0x33')]};});_0x509a15[_0x15fb('0x34')]=_['map'](_0x543cb4,_0x15fb('0x2b'));_0x509a15['query']=_[_0x15fb('0x35')](_0xdbefdb[_0x15fb('0x36')]);_0x509a15[_0x15fb('0x37')]=_[_0x15fb('0x38')](_0x509a15['model'],_0x509a15[_0x15fb('0x36')]);_0x430fcc['attributes']=_[_0x15fb('0x38')](_0x509a15['model'],qs[_0x15fb('0x39')](_0xdbefdb['query']['fields']));_0x430fcc[_0x15fb('0x3a')]=_0x430fcc[_0x15fb('0x3a')]['length']?_0x430fcc[_0x15fb('0x3a')]:_0x509a15[_0x15fb('0x34')];if(!_0xdbefdb[_0x15fb('0x36')][_0x15fb('0x3b')](_0x15fb('0x3c'))){_0x430fcc[_0x15fb('0x1f')]=qs[_0x15fb('0x1f')](_0xdbefdb['query']['limit']);_0x430fcc['offset']=qs[_0x15fb('0x1e')](_0xdbefdb[_0x15fb('0x36')][_0x15fb('0x1e')]);}_0x430fcc[_0x15fb('0x3d')]=qs[_0x15fb('0x3e')](_0xdbefdb[_0x15fb('0x36')][_0x15fb('0x3e')]);_0x430fcc[_0x15fb('0x3f')]=qs[_0x15fb('0x37')](_[_0x15fb('0x40')](_0xdbefdb[_0x15fb('0x36')],_0x509a15[_0x15fb('0x37')]),_0x543cb4);if(_0xdbefdb[_0x15fb('0x36')][_0x15fb('0x41')]){_0x430fcc[_0x15fb('0x3f')]=_['merge'](_0x430fcc[_0x15fb('0x3f')],{'$or':_[_0x15fb('0x2e')](_0x543cb4,function(_0x4492eb){if(_0x4492eb[_0x15fb('0x32')]!==_0x15fb('0x42')){var _0x280489={};_0x280489[_0x4492eb[_0x15fb('0x2b')]]={'$like':'%'+_0xdbefdb[_0x15fb('0x36')][_0x15fb('0x41')]+'%'};return _0x280489;}})});}_0x430fcc=_[_0x15fb('0x43')]({},_0x430fcc,_0xdbefdb[_0x15fb('0x44')]);var _0x227ab2={'where':_0x430fcc['where']};return db[_0x15fb('0x2f')][_0x15fb('0x21')](_0x227ab2)[_0x15fb('0x27')](function(_0x426b68){_0x2db9b3['count']=_0x426b68;if(_0xdbefdb[_0x15fb('0x36')][_0x15fb('0x45')]){_0x430fcc[_0x15fb('0x46')]=[{'all':!![]}];}return db[_0x15fb('0x2f')][_0x15fb('0x47')](_0x430fcc);})[_0x15fb('0x27')](function(_0x114720){_0x2db9b3['rows']=_0x114720;return _0x2db9b3;})['then'](respondWithFilteredResult(_0x556ef6,_0x430fcc))[_0x15fb('0x48')](handleError(_0x556ef6,null));};exports[_0x15fb('0x49')]=function(_0x3ccaa5,_0x2acb42){var _0x21d95c={'raw':![],'where':{'id':_0x3ccaa5[_0x15fb('0x4a')]['id']}},_0x288a0a={};_0x288a0a[_0x15fb('0x34')]=_[_0x15fb('0x35')](db[_0x15fb('0x2f')][_0x15fb('0x30')]);_0x288a0a['query']=_['keys'](_0x3ccaa5[_0x15fb('0x36')]);_0x288a0a[_0x15fb('0x37')]=_[_0x15fb('0x38')](_0x288a0a[_0x15fb('0x34')],_0x288a0a['query']);_0x21d95c['attributes']=_['intersection'](_0x288a0a[_0x15fb('0x34')],qs[_0x15fb('0x39')](_0x3ccaa5['query']['fields']));_0x21d95c[_0x15fb('0x3a')]=_0x21d95c[_0x15fb('0x3a')][_0x15fb('0x4b')]?_0x21d95c['attributes']:_0x288a0a[_0x15fb('0x34')];if(_0x3ccaa5[_0x15fb('0x36')][_0x15fb('0x45')]){_0x21d95c[_0x15fb('0x46')]=[{'all':!![]}];}_0x21d95c=_[_0x15fb('0x43')]({},_0x21d95c,_0x3ccaa5[_0x15fb('0x44')]);return db[_0x15fb('0x2f')][_0x15fb('0x4c')](_0x21d95c)[_0x15fb('0x27')](handleEntityNotFound(_0x2acb42,null))[_0x15fb('0x27')](respondWithResult(_0x2acb42,null))[_0x15fb('0x48')](handleError(_0x2acb42,null));};exports[_0x15fb('0x4d')]=function(_0x1acb32,_0x592f99){return db[_0x15fb('0x2f')][_0x15fb('0x4d')](_0x1acb32['body'],{})[_0x15fb('0x27')](respondWithResult(_0x592f99,0xc9))[_0x15fb('0x48')](handleError(_0x592f99,null));};exports[_0x15fb('0x26')]=function(_0x4fce15,_0x379eb2){if(_0x4fce15[_0x15fb('0x4e')]['id']){delete _0x4fce15[_0x15fb('0x4e')]['id'];}return db[_0x15fb('0x2f')][_0x15fb('0x4c')]({'where':{'id':_0x4fce15[_0x15fb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x379eb2,null))[_0x15fb('0x27')](saveUpdates(_0x4fce15[_0x15fb('0x4e')],null))[_0x15fb('0x27')](respondWithResult(_0x379eb2,null))['catch'](handleError(_0x379eb2,null));};exports[_0x15fb('0x28')]=function(_0x4e56ed,_0x512548){return db[_0x15fb('0x2f')]['find']({'where':{'id':_0x4e56ed['params']['id']}})['then'](handleEntityNotFound(_0x512548,null))[_0x15fb('0x27')](removeEntity(_0x512548,null))[_0x15fb('0x48')](handleError(_0x512548,null));};exports[_0x15fb('0x4f')]=function(_0x413969,_0x233219,_0x2d9cf7){var _0x589180={};var _0x48cc46={};var _0x1ba68f;var _0x48b5b6;return db[_0x15fb('0x2f')][_0x15fb('0x50')]({'where':{'id':_0x413969[_0x15fb('0x4a')]['id']}})[_0x15fb('0x27')](handleEntityNotFound(_0x233219,null))[_0x15fb('0x27')](function(_0x2ca4d7){if(_0x2ca4d7){_0x1ba68f=_0x2ca4d7;_0x48cc46[_0x15fb('0x34')]=_[_0x15fb('0x35')](db[_0x15fb('0x51')]['rawAttributes']);_0x48cc46[_0x15fb('0x36')]=_['keys'](_0x413969[_0x15fb('0x36')]);_0x48cc46['filters']=_['intersection'](_0x48cc46[_0x15fb('0x34')],_0x48cc46['query']);_0x589180[_0x15fb('0x3a')]=_[_0x15fb('0x38')](_0x48cc46[_0x15fb('0x34')],qs[_0x15fb('0x39')](_0x413969[_0x15fb('0x36')]['fields']));_0x589180['attributes']=_0x589180[_0x15fb('0x3a')][_0x15fb('0x4b')]?_0x589180[_0x15fb('0x3a')]:_0x48cc46[_0x15fb('0x34')];_0x589180[_0x15fb('0x3d')]=qs[_0x15fb('0x3e')](_0x413969['query'][_0x15fb('0x3e')]);_0x589180[_0x15fb('0x3f')]=qs[_0x15fb('0x37')](_['pick'](_0x413969[_0x15fb('0x36')],_0x48cc46['filters']));if(_0x413969[_0x15fb('0x36')][_0x15fb('0x41')]){_0x589180[_0x15fb('0x3f')]=_[_0x15fb('0x43')](_0x589180[_0x15fb('0x3f')],{'$or':_[_0x15fb('0x2e')](_0x589180[_0x15fb('0x3a')],function(_0x5063b0){var _0x2f995b={};_0x2f995b[_0x5063b0]={'$like':'%'+_0x413969['query'][_0x15fb('0x41')]+'%'};return _0x2f995b;})});}_0x589180=_['merge']({},_0x589180,_0x413969[_0x15fb('0x44')]);return _0x1ba68f['getConfigurations'](_0x589180);}})[_0x15fb('0x27')](function(_0x227580){if(_0x227580){_0x48b5b6=_0x227580[_0x15fb('0x4b')];if(!_0x413969['query'][_0x15fb('0x3b')](_0x15fb('0x3c'))){_0x589180[_0x15fb('0x1f')]=qs[_0x15fb('0x1f')](_0x413969['query']['limit']);_0x589180[_0x15fb('0x1e')]=qs[_0x15fb('0x1e')](_0x413969[_0x15fb('0x36')][_0x15fb('0x1e')]);}return _0x1ba68f[_0x15fb('0x4f')](_0x589180);}})['then'](function(_0x5500e4){if(_0x5500e4){return _0x5500e4?{'count':_0x48b5b6,'rows':_0x5500e4}:null;}})['then'](respondWithResult(_0x233219,null))['catch'](handleError(_0x233219,null));};exports['addConfiguration']=function(_0x5a771d,_0x3ce022,_0x4fc31a){if(_0x5a771d[_0x15fb('0x4e')]['id']){delete _0x5a771d['body']['id'];}return db[_0x15fb('0x2f')][_0x15fb('0x50')]({'where':{'id':_0x5a771d[_0x15fb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3ce022,null))[_0x15fb('0x27')](function(_0x146eb8){if(_0x146eb8){_0x5a771d[_0x15fb('0x4e')]['AccountId']=_0x146eb8['id'];_0x5a771d[_0x15fb('0x4e')]['Subjects']=integrations[_0x15fb('0x52')](_0x5a771d[_0x15fb('0x4e')][_0x15fb('0x53')],_0x5a771d[_0x15fb('0x4e')]['type']);_0x5a771d['body'][_0x15fb('0x54')]=integrations[_0x15fb('0x55')](_0x5a771d[_0x15fb('0x4e')][_0x15fb('0x53')],_0x5a771d[_0x15fb('0x4e')][_0x15fb('0x32')]);return db[_0x15fb('0x51')][_0x15fb('0x4d')](_0x5a771d['body'],{'include':[{'model':db[_0x15fb('0x56')],'as':'Subjects'},{'model':db[_0x15fb('0x56')],'as':'Descriptions'}]});}return null;})[_0x15fb('0x27')](respondWithResult(_0x3ce022,null))[_0x15fb('0x48')](handleError(_0x3ce022,null));};exports['getFields']=function(_0x24fd2b,_0x1d625a,_0x487e76){var _0x4377c8;var _0xf2c889='';var _0x2de0d8=_0x15fb('0x57');return db[_0x15fb('0x2f')][_0x15fb('0x50')]({'where':{'id':_0x24fd2b[_0x15fb('0x4a')]['id']},'attributes':['id',_0x15fb('0x58'),_0x15fb('0x59'),_0x15fb('0x5a'),_0x15fb('0x5b'),'password',_0x15fb('0x5c')]})[_0x15fb('0x27')](handleEntityNotFound(_0x1d625a,null))[_0x15fb('0x27')](function(_0x36f6d1){if(_0x36f6d1){_0xf2c889=_0x36f6d1[_0x15fb('0x58')];var _0x90a122=_0xf2c889[_0x15fb('0x5d')](-0x1);if(_0x90a122==='/'){_0xf2c889=_0xf2c889[_0x15fb('0x5e')](0x0,_0xf2c889[_0x15fb('0x5f')](_0x90a122));}_0x4377c8=new jsforce['Connection']({'oauth2':{'loginUrl':_0xf2c889,'clientId':_0x36f6d1[_0x15fb('0x59')],'clientSecret':_0x36f6d1[_0x15fb('0x5a')]}});return _0x4377c8[_0x15fb('0x60')](_0x36f6d1[_0x15fb('0x5b')],_0x36f6d1['password'][_0x15fb('0x61')](_0x36f6d1[_0x15fb('0x5c')]));}})['then'](function(_0x106a21){if(_0x106a21){if(!_[_0x15fb('0x62')](_0x24fd2b[_0x15fb('0x36')][_0x15fb('0x63')])){_0x2de0d8=_0x24fd2b[_0x15fb('0x36')]['ticketType'];}return _0x4377c8['sobject'](_0x2de0d8)[_0x15fb('0x64')]();}})[_0x15fb('0x27')](function(_0x198a58){var _0x43167d=[_0x15fb('0x65'),_0x15fb('0x66'),_0x15fb('0x67'),'IsRecurrence','Subject',_0x15fb('0x68')];var _0x51d111=[_0x15fb('0x69'),_0x15fb('0x6a'),_0x15fb('0x6b'),_0x15fb('0x6c'),_0x15fb('0x6d'),'textarea',_0x15fb('0x6e')];if(_0x198a58){_[_0x15fb('0x6f')](_0x198a58[_0x15fb('0x39')],function(_0x55a6a4){return _0x43167d[_0x15fb('0x70')](_0x55a6a4[_0x15fb('0x2b')])||!_0x51d111[_0x15fb('0x70')](_0x55a6a4[_0x15fb('0x32')]);});return{'count':_0x198a58[_0x15fb('0x39')]['length'],'rows':_[_0x15fb('0x2e')](_0x198a58[_0x15fb('0x39')],function(_0x1de833){return{'id':_0x1de833[_0x15fb('0x2b')],'name':_0x1de833[_0x15fb('0x71')],'custom':_0x1de833['custom'],'options':_0x1de833['picklistValues'][_0x15fb('0x4b')]>0x0?_[_0x15fb('0x2e')](_0x1de833[_0x15fb('0x72')],function(_0xb8dab2){return{'name':_0xb8dab2[_0x15fb('0x71')],'value':_0xb8dab2[_0x15fb('0x73')]};}):_0x1de833['type']==_0x15fb('0x6c')?[{'name':_0x15fb('0x74'),'value':'true'},{'name':_0x15fb('0x75'),'value':_0x15fb('0x76')}]:[]};})};}})[_0x15fb('0x27')](respondWithResult(_0x1d625a,null))['catch'](function(_0x162d7e){var _0x5b2fd8=_0x24fd2b['query'][_0x15fb('0x77')]?0x1f4:_0x162d7e[_0x15fb('0x78')]||0x1f4;logger[_0x15fb('0x29')]('getFields,\x20%s,\x20%s,\x20%s',_0x15fb('0x79'),_0x5b2fd8,JSON[_0x15fb('0x7a')](_0x162d7e));delete _0x162d7e[_0x15fb('0x2b')];if(_0x5b2fd8===0x191){_0x5b2fd8=0x190;}_0x1d625a[_0x15fb('0x1d')](_0x5b2fd8)['send'](_0x24fd2b[_0x15fb('0x36')][_0x15fb('0x77')]?{'message':'Wrong\x20credentials','statusCode':_0x162d7e['statusCode']}:_0x162d7e);});}; \ No newline at end of file +var _0x7a4c=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','SalesforceAccount','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','sort','filters','pick','filter','where','merge','options','includeAll','findAll','rows','params','include','find','catch','create','body','getConfigurations','SalesforceConfiguration','order','hasOwnProperty','findOne','AccountId','getSubjects','channel','SalesforceField','Descriptions','getFields','Task','remoteUri','password','securityToken','slice','lastIndexOf','Connection','clientId','clientSecret','login','username','concat','ticketType','describe','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','Description','int','picklist','email','textarea','includes','label','custom','picklistValues','boolean','True','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox'];(function(_0xa738c0,_0x28606d){var _0x594e8b=function(_0x5202ef){while(--_0x5202ef){_0xa738c0['push'](_0xa738c0['shift']());}};_0x594e8b(++_0x28606d);}(_0x7a4c,0x1cf));var _0xc7a4=function(_0x3fd455,_0x1f7c5b){_0x3fd455=_0x3fd455-0x0;var _0x1c259f=_0x7a4c[_0x3fd455];return _0x1c259f;};'use strict';var emlformat=require(_0xc7a4('0x0'));var rimraf=require(_0xc7a4('0x1'));var zipdir=require(_0xc7a4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc7a4('0x3'));var moment=require('moment');var BPromise=require(_0xc7a4('0x4'));var Mustache=require(_0xc7a4('0x5'));var util=require(_0xc7a4('0x6'));var path=require(_0xc7a4('0x7'));var sox=require(_0xc7a4('0x8'));var csv=require(_0xc7a4('0x9'));var ejs=require(_0xc7a4('0xa'));var fs=require('fs');var fs_extra=require(_0xc7a4('0xb'));var _=require(_0xc7a4('0xc'));var squel=require(_0xc7a4('0xd'));var crypto=require(_0xc7a4('0xe'));var jsforce=require(_0xc7a4('0xf'));var deskjs=require(_0xc7a4('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc7a4('0x11'));var Redis=require(_0xc7a4('0x12'));var authService=require(_0xc7a4('0x13'));var qs=require(_0xc7a4('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc7a4('0x15'));var logger=require(_0xc7a4('0x16'))('api');var utils=require(_0xc7a4('0x17'));var config=require(_0xc7a4('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xc7a4('0x19'));function respondWithStatusCode(_0x4ddaff,_0x48576b){_0x48576b=_0x48576b||0xcc;return function(_0x467cc0){if(_0x467cc0){return _0x4ddaff[_0xc7a4('0x1a')](_0x48576b);}return _0x4ddaff[_0xc7a4('0x1b')](_0x48576b)[_0xc7a4('0x1c')]();};}function respondWithResult(_0x5742ff,_0x943355){_0x943355=_0x943355||0xc8;return function(_0x4cabb5){if(_0x4cabb5){return _0x5742ff[_0xc7a4('0x1b')](_0x943355)['json'](_0x4cabb5);}};}function respondWithFilteredResult(_0x1f28a7,_0x4ea745){return function(_0x471d4c){if(_0x471d4c){var _0x13c5f3=typeof _0x4ea745[_0xc7a4('0x1d')]===_0xc7a4('0x1e')&&typeof _0x4ea745[_0xc7a4('0x1f')]===_0xc7a4('0x1e');var _0x47e81d=_0x471d4c[_0xc7a4('0x20')];var _0x3418e7=_0x13c5f3?0x0:_0x4ea745[_0xc7a4('0x1d')];var _0x227ad2=_0x13c5f3?_0x471d4c[_0xc7a4('0x20')]:_0x4ea745[_0xc7a4('0x1d')]+_0x4ea745[_0xc7a4('0x1f')];var _0xfa9345;if(_0x227ad2>=_0x47e81d){_0x227ad2=_0x47e81d;_0xfa9345=0xc8;}else{_0xfa9345=0xce;}_0x1f28a7[_0xc7a4('0x1b')](_0xfa9345);return _0x1f28a7[_0xc7a4('0x21')](_0xc7a4('0x22'),_0x3418e7+'-'+_0x227ad2+'/'+_0x47e81d)['json'](_0x471d4c);}return null;};}function patchUpdates(_0x4a20e9){return function(_0x562fd3){try{jsonpatch[_0xc7a4('0x23')](_0x562fd3,_0x4a20e9,!![]);}catch(_0x520a42){return BPromise[_0xc7a4('0x24')](_0x520a42);}return _0x562fd3[_0xc7a4('0x25')]();};}function saveUpdates(_0x2e61c7,_0x226d93){return function(_0x50ec5c){if(_0x50ec5c){return _0x50ec5c[_0xc7a4('0x26')](_0x2e61c7)[_0xc7a4('0x27')](function(_0xc43f49){return _0xc43f49;});}return null;};}function removeEntity(_0x5900a3,_0xa84c46){return function(_0x23d8b7){if(_0x23d8b7){return _0x23d8b7[_0xc7a4('0x28')]()[_0xc7a4('0x27')](function(){_0x5900a3[_0xc7a4('0x1b')](0xcc)[_0xc7a4('0x1c')]();});}};}function handleEntityNotFound(_0x3859f6,_0x2be7ed){return function(_0x3367be){if(!_0x3367be){_0x3859f6[_0xc7a4('0x1a')](0x194);}return _0x3367be;};}function handleError(_0x345d13,_0x377ada){_0x377ada=_0x377ada||0x1f4;return function(_0x32c6ad){logger['error'](_0x32c6ad[_0xc7a4('0x29')]);if(_0x32c6ad[_0xc7a4('0x2a')]){delete _0x32c6ad['name'];}_0x345d13['status'](_0x377ada)[_0xc7a4('0x2b')](_0x32c6ad);};}exports['index']=function(_0x3a135f,_0x3867ee){var _0x575252={},_0x4648db={},_0xa9ffd1={'count':0x0,'rows':[]};var _0x49ee58=_[_0xc7a4('0x2c')](db[_0xc7a4('0x2d')]['rawAttributes'],function(_0x2ebb9c){return{'name':_0x2ebb9c[_0xc7a4('0x2e')],'type':_0x2ebb9c[_0xc7a4('0x2f')][_0xc7a4('0x30')]};});_0x4648db[_0xc7a4('0x31')]=_[_0xc7a4('0x2c')](_0x49ee58,_0xc7a4('0x2a'));_0x4648db[_0xc7a4('0x32')]=_[_0xc7a4('0x33')](_0x3a135f[_0xc7a4('0x32')]);_0x4648db['filters']=_['intersection'](_0x4648db['model'],_0x4648db[_0xc7a4('0x32')]);_0x575252['attributes']=_[_0xc7a4('0x34')](_0x4648db[_0xc7a4('0x31')],qs[_0xc7a4('0x35')](_0x3a135f[_0xc7a4('0x32')][_0xc7a4('0x35')]));_0x575252[_0xc7a4('0x36')]=_0x575252['attributes'][_0xc7a4('0x37')]?_0x575252[_0xc7a4('0x36')]:_0x4648db[_0xc7a4('0x31')];if(!_0x3a135f[_0xc7a4('0x32')]['hasOwnProperty']('nolimit')){_0x575252[_0xc7a4('0x1f')]=qs[_0xc7a4('0x1f')](_0x3a135f[_0xc7a4('0x32')][_0xc7a4('0x1f')]);_0x575252[_0xc7a4('0x1d')]=qs[_0xc7a4('0x1d')](_0x3a135f[_0xc7a4('0x32')][_0xc7a4('0x1d')]);}_0x575252['order']=qs[_0xc7a4('0x38')](_0x3a135f[_0xc7a4('0x32')]['sort']);_0x575252['where']=qs[_0xc7a4('0x39')](_[_0xc7a4('0x3a')](_0x3a135f[_0xc7a4('0x32')],_0x4648db['filters']),_0x49ee58);if(_0x3a135f[_0xc7a4('0x32')][_0xc7a4('0x3b')]){_0x575252['where']=_['merge'](_0x575252[_0xc7a4('0x3c')],{'$or':_['map'](_0x49ee58,function(_0x49f34b){if(_0x49f34b[_0xc7a4('0x2f')]!=='VIRTUAL'){var _0x23d12e={};_0x23d12e[_0x49f34b[_0xc7a4('0x2a')]]={'$like':'%'+_0x3a135f[_0xc7a4('0x32')][_0xc7a4('0x3b')]+'%'};return _0x23d12e;}})});}_0x575252=_[_0xc7a4('0x3d')]({},_0x575252,_0x3a135f[_0xc7a4('0x3e')]);var _0x3badb6={'where':_0x575252[_0xc7a4('0x3c')]};return db[_0xc7a4('0x2d')][_0xc7a4('0x20')](_0x3badb6)['then'](function(_0x418a8e){_0xa9ffd1[_0xc7a4('0x20')]=_0x418a8e;if(_0x3a135f[_0xc7a4('0x32')][_0xc7a4('0x3f')]){_0x575252['include']=[{'all':!![]}];}return db[_0xc7a4('0x2d')][_0xc7a4('0x40')](_0x575252);})['then'](function(_0x5c9062){_0xa9ffd1[_0xc7a4('0x41')]=_0x5c9062;return _0xa9ffd1;})[_0xc7a4('0x27')](respondWithFilteredResult(_0x3867ee,_0x575252))['catch'](handleError(_0x3867ee,null));};exports['show']=function(_0xdd3686,_0x4478bc){var _0x3e1786={'raw':![],'where':{'id':_0xdd3686[_0xc7a4('0x42')]['id']}},_0x3be311={};_0x3be311[_0xc7a4('0x31')]=_[_0xc7a4('0x33')](db['SalesforceAccount']['rawAttributes']);_0x3be311['query']=_['keys'](_0xdd3686[_0xc7a4('0x32')]);_0x3be311[_0xc7a4('0x39')]=_[_0xc7a4('0x34')](_0x3be311[_0xc7a4('0x31')],_0x3be311[_0xc7a4('0x32')]);_0x3e1786['attributes']=_[_0xc7a4('0x34')](_0x3be311['model'],qs['fields'](_0xdd3686[_0xc7a4('0x32')][_0xc7a4('0x35')]));_0x3e1786[_0xc7a4('0x36')]=_0x3e1786[_0xc7a4('0x36')][_0xc7a4('0x37')]?_0x3e1786[_0xc7a4('0x36')]:_0x3be311['model'];if(_0xdd3686[_0xc7a4('0x32')][_0xc7a4('0x3f')]){_0x3e1786[_0xc7a4('0x43')]=[{'all':!![]}];}_0x3e1786=_['merge']({},_0x3e1786,_0xdd3686[_0xc7a4('0x3e')]);return db[_0xc7a4('0x2d')][_0xc7a4('0x44')](_0x3e1786)[_0xc7a4('0x27')](handleEntityNotFound(_0x4478bc,null))[_0xc7a4('0x27')](respondWithResult(_0x4478bc,null))[_0xc7a4('0x45')](handleError(_0x4478bc,null));};exports['create']=function(_0x1ea3e0,_0x4bdf03){return db[_0xc7a4('0x2d')][_0xc7a4('0x46')](_0x1ea3e0['body'],{})[_0xc7a4('0x27')](respondWithResult(_0x4bdf03,0xc9))['catch'](handleError(_0x4bdf03,null));};exports[_0xc7a4('0x26')]=function(_0x47a545,_0x4a65ff){if(_0x47a545['body']['id']){delete _0x47a545['body']['id'];}return db[_0xc7a4('0x2d')][_0xc7a4('0x44')]({'where':{'id':_0x47a545[_0xc7a4('0x42')]['id']}})[_0xc7a4('0x27')](handleEntityNotFound(_0x4a65ff,null))[_0xc7a4('0x27')](saveUpdates(_0x47a545[_0xc7a4('0x47')],null))[_0xc7a4('0x27')](respondWithResult(_0x4a65ff,null))[_0xc7a4('0x45')](handleError(_0x4a65ff,null));};exports[_0xc7a4('0x28')]=function(_0x3d6b5b,_0x5c39ca){return db[_0xc7a4('0x2d')][_0xc7a4('0x44')]({'where':{'id':_0x3d6b5b['params']['id']}})[_0xc7a4('0x27')](handleEntityNotFound(_0x5c39ca,null))[_0xc7a4('0x27')](removeEntity(_0x5c39ca,null))[_0xc7a4('0x45')](handleError(_0x5c39ca,null));};exports[_0xc7a4('0x48')]=function(_0x442e28,_0x14dbff,_0x5e2473){var _0x273c25={};var _0x114acd={};var _0x535570;var _0x50a4d1;return db['SalesforceAccount']['findOne']({'where':{'id':_0x442e28[_0xc7a4('0x42')]['id']}})[_0xc7a4('0x27')](handleEntityNotFound(_0x14dbff,null))[_0xc7a4('0x27')](function(_0x5e1cbb){if(_0x5e1cbb){_0x535570=_0x5e1cbb;_0x114acd[_0xc7a4('0x31')]=_[_0xc7a4('0x33')](db[_0xc7a4('0x49')]['rawAttributes']);_0x114acd[_0xc7a4('0x32')]=_['keys'](_0x442e28[_0xc7a4('0x32')]);_0x114acd[_0xc7a4('0x39')]=_[_0xc7a4('0x34')](_0x114acd[_0xc7a4('0x31')],_0x114acd[_0xc7a4('0x32')]);_0x273c25[_0xc7a4('0x36')]=_['intersection'](_0x114acd[_0xc7a4('0x31')],qs[_0xc7a4('0x35')](_0x442e28[_0xc7a4('0x32')][_0xc7a4('0x35')]));_0x273c25[_0xc7a4('0x36')]=_0x273c25[_0xc7a4('0x36')][_0xc7a4('0x37')]?_0x273c25[_0xc7a4('0x36')]:_0x114acd[_0xc7a4('0x31')];_0x273c25[_0xc7a4('0x4a')]=qs[_0xc7a4('0x38')](_0x442e28[_0xc7a4('0x32')][_0xc7a4('0x38')]);_0x273c25[_0xc7a4('0x3c')]=qs[_0xc7a4('0x39')](_['pick'](_0x442e28['query'],_0x114acd['filters']));if(_0x442e28['query'][_0xc7a4('0x3b')]){_0x273c25[_0xc7a4('0x3c')]=_[_0xc7a4('0x3d')](_0x273c25[_0xc7a4('0x3c')],{'$or':_[_0xc7a4('0x2c')](_0x273c25['attributes'],function(_0x467761){var _0x190d7c={};_0x190d7c[_0x467761]={'$like':'%'+_0x442e28[_0xc7a4('0x32')][_0xc7a4('0x3b')]+'%'};return _0x190d7c;})});}_0x273c25=_['merge']({},_0x273c25,_0x442e28[_0xc7a4('0x3e')]);return _0x535570[_0xc7a4('0x48')](_0x273c25);}})[_0xc7a4('0x27')](function(_0x24c751){if(_0x24c751){_0x50a4d1=_0x24c751[_0xc7a4('0x37')];if(!_0x442e28[_0xc7a4('0x32')][_0xc7a4('0x4b')]('nolimit')){_0x273c25[_0xc7a4('0x1f')]=qs['limit'](_0x442e28[_0xc7a4('0x32')][_0xc7a4('0x1f')]);_0x273c25['offset']=qs['offset'](_0x442e28['query'][_0xc7a4('0x1d')]);}return _0x535570[_0xc7a4('0x48')](_0x273c25);}})['then'](function(_0x18ec64){if(_0x18ec64){return _0x18ec64?{'count':_0x50a4d1,'rows':_0x18ec64}:null;}})[_0xc7a4('0x27')](respondWithResult(_0x14dbff,null))['catch'](handleError(_0x14dbff,null));};exports['addConfiguration']=function(_0x32fe26,_0x4736e1,_0x4dbc95){if(_0x32fe26['body']['id']){delete _0x32fe26['body']['id'];}return db[_0xc7a4('0x2d')][_0xc7a4('0x4c')]({'where':{'id':_0x32fe26[_0xc7a4('0x42')]['id']}})['then'](handleEntityNotFound(_0x4736e1,null))[_0xc7a4('0x27')](function(_0xafca2a){if(_0xafca2a){_0x32fe26['body'][_0xc7a4('0x4d')]=_0xafca2a['id'];_0x32fe26[_0xc7a4('0x47')]['Subjects']=integrations[_0xc7a4('0x4e')](_0x32fe26[_0xc7a4('0x47')][_0xc7a4('0x4f')],_0x32fe26[_0xc7a4('0x47')][_0xc7a4('0x2f')]);_0x32fe26[_0xc7a4('0x47')]['Descriptions']=integrations['getDescriptions'](_0x32fe26[_0xc7a4('0x47')][_0xc7a4('0x4f')],_0x32fe26[_0xc7a4('0x47')][_0xc7a4('0x2f')]);return db['SalesforceConfiguration'][_0xc7a4('0x46')](_0x32fe26['body'],{'include':[{'model':db[_0xc7a4('0x50')],'as':'Subjects'},{'model':db[_0xc7a4('0x50')],'as':_0xc7a4('0x51')}]});}return null;})['then'](respondWithResult(_0x4736e1,null))[_0xc7a4('0x45')](handleError(_0x4736e1,null));};exports[_0xc7a4('0x52')]=function(_0x14219b,_0x1c0559,_0x512ccd){var _0x19a1ee;var _0x9edd0c='';var _0x5b5e8a=_0xc7a4('0x53');return db[_0xc7a4('0x2d')][_0xc7a4('0x4c')]({'where':{'id':_0x14219b[_0xc7a4('0x42')]['id']},'attributes':['id',_0xc7a4('0x54'),'clientId','clientSecret','username',_0xc7a4('0x55'),_0xc7a4('0x56')]})[_0xc7a4('0x27')](handleEntityNotFound(_0x1c0559,null))[_0xc7a4('0x27')](function(_0x56d587){if(_0x56d587){_0x9edd0c=_0x56d587[_0xc7a4('0x54')];var _0x317531=_0x9edd0c[_0xc7a4('0x57')](-0x1);if(_0x317531==='/'){_0x9edd0c=_0x9edd0c['substring'](0x0,_0x9edd0c[_0xc7a4('0x58')](_0x317531));}_0x19a1ee=new jsforce[(_0xc7a4('0x59'))]({'oauth2':{'loginUrl':_0x9edd0c,'clientId':_0x56d587[_0xc7a4('0x5a')],'clientSecret':_0x56d587[_0xc7a4('0x5b')]}});return _0x19a1ee[_0xc7a4('0x5c')](_0x56d587[_0xc7a4('0x5d')],_0x56d587[_0xc7a4('0x55')][_0xc7a4('0x5e')](_0x56d587[_0xc7a4('0x56')]));}})[_0xc7a4('0x27')](function(_0x280422){if(_0x280422){if(!_['isNil'](_0x14219b[_0xc7a4('0x32')][_0xc7a4('0x5f')])){_0x5b5e8a=_0x14219b['query'][_0xc7a4('0x5f')];}return _0x19a1ee['sobject'](_0x5b5e8a)[_0xc7a4('0x60')]();}})[_0xc7a4('0x27')](function(_0x38acd9){var _0xd041be=[_0xc7a4('0x61'),_0xc7a4('0x62'),_0xc7a4('0x63'),_0xc7a4('0x64'),_0xc7a4('0x65'),_0xc7a4('0x66')];var _0x2e6da2=['string',_0xc7a4('0x67'),_0xc7a4('0x68'),'boolean',_0xc7a4('0x69'),_0xc7a4('0x6a'),'phone'];if(_0x38acd9){_['remove'](_0x38acd9['fields'],function(_0x13435d){return _0xd041be[_0xc7a4('0x6b')](_0x13435d[_0xc7a4('0x2a')])||!_0x2e6da2[_0xc7a4('0x6b')](_0x13435d[_0xc7a4('0x2f')]);});return{'count':_0x38acd9[_0xc7a4('0x35')][_0xc7a4('0x37')],'rows':_['map'](_0x38acd9['fields'],function(_0x1cdf49){return{'id':_0x1cdf49['name'],'name':_0x1cdf49[_0xc7a4('0x6c')],'custom':_0x1cdf49[_0xc7a4('0x6d')],'options':_0x1cdf49[_0xc7a4('0x6e')]['length']>0x0?_['map'](_0x1cdf49[_0xc7a4('0x6e')],function(_0x435af1){return{'name':_0x435af1[_0xc7a4('0x6c')],'value':_0x435af1['value']};}):_0x1cdf49['type']==_0xc7a4('0x6f')?[{'name':_0xc7a4('0x70'),'value':'true'},{'name':'False','value':'false'}]:[]};})};}})[_0xc7a4('0x27')](respondWithResult(_0x1c0559,null))[_0xc7a4('0x45')](function(_0x4223a5){var _0x1178e4=_0x14219b[_0xc7a4('0x32')]['test']?0x1f4:_0x4223a5[_0xc7a4('0x71')]||0x1f4;logger['error'](_0xc7a4('0x72'),_0xc7a4('0x52'),_0x1178e4,JSON[_0xc7a4('0x73')](_0x4223a5));delete _0x4223a5[_0xc7a4('0x2a')];if(_0x1178e4===0x191){_0x1178e4=0x190;}_0x1c0559['status'](_0x1178e4)[_0xc7a4('0x2b')](_0x14219b[_0xc7a4('0x32')][_0xc7a4('0x74')]?{'message':_0xc7a4('0x75'),'statusCode':_0x4223a5['statusCode']}:_0x4223a5);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 1e7b079..4b50a98 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 _0x1d81=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','exports','define','SalesforceAccount','int_salesforce_accounts'];(function(_0x408c68,_0x51f8b4){var _0x3919c9=function(_0xf424b8){while(--_0xf424b8){_0x408c68['push'](_0x408c68['shift']());}};_0x3919c9(++_0x51f8b4);}(_0x1d81,0x155));var _0x11d8=function(_0x3c729b,_0x2a4146){_0x3c729b=_0x3c729b-0x0;var _0x55894c=_0x1d81[_0x3c729b];return _0x55894c;};'use strict';var _=require('lodash');var util=require(_0x11d8('0x0'));var logger=require(_0x11d8('0x1'))(_0x11d8('0x2'));var moment=require('moment');var BPromise=require(_0x11d8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x11d8('0x4'));var rimraf=require(_0x11d8('0x5'));var config=require(_0x11d8('0x6'));var attributes=require('./intSalesforceAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x11d8('0x7')]=function(_0x3e36c6,_0x18276f){return _0x3e36c6[_0x11d8('0x8')](_0x11d8('0x9'),attributes,{'tableName':_0x11d8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x515d=['bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes','define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api','moment'];(function(_0x3b3210,_0x25e8ed){var _0x5b5484=function(_0x417858){while(--_0x417858){_0x3b3210['push'](_0x3b3210['shift']());}};_0x5b5484(++_0x25e8ed);}(_0x515d,0x104));var _0xd515=function(_0x22c58b,_0x1a59c9){_0x22c58b=_0x22c58b-0x0;var _0x1fe680=_0x515d[_0x22c58b];return _0x1fe680;};'use strict';var _=require('lodash');var util=require(_0xd515('0x0'));var logger=require(_0xd515('0x1'))(_0xd515('0x2'));var moment=require(_0xd515('0x3'));var BPromise=require(_0xd515('0x4'));var rp=require(_0xd515('0x5'));var fs=require('fs');var path=require(_0xd515('0x6'));var rimraf=require(_0xd515('0x7'));var config=require('../../config/environment');var attributes=require(_0xd515('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x42daa5,_0x1130fc){return _0x42daa5[_0xd515('0x9')](_0xd515('0xa'),attributes,{'tableName':_0xd515('0xb'),'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 0fd0137..bd5577a 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 _0xf777=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','error','code','message','SalesforceAccount,\x20%s,\x20%s','result','catch','SalesforceAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetSalesforceAccount','stringify','ShowSalesforceAccount','find','lodash'];(function(_0x4578f8,_0x199c11){var _0x1129f1=function(_0x8a4369){while(--_0x8a4369){_0x4578f8['push'](_0x4578f8['shift']());}};_0x1129f1(++_0x199c11);}(_0xf777,0x1a3));var _0x7f77=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf777[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x7f77('0x0'));var util=require(_0x7f77('0x1'));var moment=require(_0x7f77('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f77('0x3'));var db=require(_0x7f77('0x4'))['db'];var utils=require(_0x7f77('0x5'));var logger=require(_0x7f77('0x6'))('rpc');var config=require(_0x7f77('0x7'));var jayson=require(_0x7f77('0x8'));var client=jayson[_0x7f77('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46c80a,_0x5a313d,_0x30edd6){return new BPromise(function(_0x2b4a3f,_0xb95b13){return client[_0x7f77('0xa')](_0x46c80a,_0x30edd6)[_0x7f77('0xb')](function(_0x1ca13a){logger[_0x7f77('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x5a313d,_0x7f77('0xd'));logger[_0x7f77('0xe')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x5a313d,'request\x20sent',JSON['stringify'](_0x1ca13a));if(_0x1ca13a['error']){if(_0x1ca13a[_0x7f77('0xf')][_0x7f77('0x10')]===0x1f4){logger[_0x7f77('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x5a313d,_0x1ca13a[_0x7f77('0xf')]['message']);return _0xb95b13(_0x1ca13a[_0x7f77('0xf')][_0x7f77('0x11')]);}logger[_0x7f77('0xf')](_0x7f77('0x12'),_0x5a313d,_0x1ca13a[_0x7f77('0xf')][_0x7f77('0x11')]);return _0x2b4a3f(_0x1ca13a[_0x7f77('0xf')]['message']);}else{logger['info'](_0x7f77('0x12'),_0x5a313d,_0x7f77('0xd'));_0x2b4a3f(_0x1ca13a[_0x7f77('0x13')][_0x7f77('0x11')]);}})[_0x7f77('0x14')](function(_0x55a04a){logger[_0x7f77('0xf')]('SalesforceAccount,\x20%s,\x20%s',_0x5a313d,_0x55a04a);_0xb95b13(_0x55a04a);});});}exports['GetSalesforceAccount']=function(_0x19f6b6){var _0x28daea=this;return new Promise(function(_0x2a94cc,_0xca9fe6){return db[_0x7f77('0x15')][_0x7f77('0x16')]({'raw':_0x19f6b6[_0x7f77('0x17')]?_0x19f6b6['options'][_0x7f77('0x18')]===undefined?!![]:![]:!![],'where':_0x19f6b6['options']?_0x19f6b6['options'][_0x7f77('0x19')]||null:null,'attributes':_0x19f6b6[_0x7f77('0x17')]?_0x19f6b6[_0x7f77('0x17')][_0x7f77('0x1a')]||null:null,'limit':_0x19f6b6['options']?_0x19f6b6[_0x7f77('0x17')][_0x7f77('0x1b')]||null:null,'include':_0x19f6b6[_0x7f77('0x17')]?_0x19f6b6[_0x7f77('0x17')][_0x7f77('0x1c')]?_[_0x7f77('0x1d')](_0x19f6b6[_0x7f77('0x17')]['include'],function(_0x339d5a){return{'model':db[_0x339d5a[_0x7f77('0x1e')]],'as':_0x339d5a['as'],'attributes':_0x339d5a[_0x7f77('0x1a')],'include':_0x339d5a['include']?_[_0x7f77('0x1d')](_0x339d5a[_0x7f77('0x1c')],function(_0x5dc823){return{'model':db[_0x5dc823['model']],'as':_0x5dc823['as'],'attributes':_0x5dc823['attributes'],'include':_0x5dc823[_0x7f77('0x1c')]?_['map'](_0x5dc823[_0x7f77('0x1c')],function(_0x53ff02){return{'model':db[_0x53ff02[_0x7f77('0x1e')]],'as':_0x53ff02['as'],'attributes':_0x53ff02[_0x7f77('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7f77('0xb')](function(_0x3ca805){logger[_0x7f77('0xc')](_0x7f77('0x1f'),_0x19f6b6);logger[_0x7f77('0xe')]('GetSalesforceAccount',_0x19f6b6,JSON[_0x7f77('0x20')](_0x3ca805));_0x2a94cc(_0x3ca805);})['catch'](function(_0x38be99){logger['error'](_0x7f77('0x1f'),_0x38be99[_0x7f77('0x11')],_0x19f6b6);_0xca9fe6(_0x28daea['error'](0x1f4,_0x38be99[_0x7f77('0x11')]));});});};exports[_0x7f77('0x21')]=function(_0x6f6ff8){var _0x516944=this;return new Promise(function(_0x4ab735,_0x24d1ae){return db[_0x7f77('0x15')][_0x7f77('0x22')]({'raw':_0x6f6ff8['options']?_0x6f6ff8[_0x7f77('0x17')][_0x7f77('0x18')]===undefined?!![]:![]:!![],'where':_0x6f6ff8['options']?_0x6f6ff8['options']['where']||null:null,'attributes':_0x6f6ff8[_0x7f77('0x17')]?_0x6f6ff8[_0x7f77('0x17')][_0x7f77('0x1a')]||null:null,'include':_0x6f6ff8[_0x7f77('0x17')]?_0x6f6ff8[_0x7f77('0x17')][_0x7f77('0x1c')]?_[_0x7f77('0x1d')](_0x6f6ff8[_0x7f77('0x17')][_0x7f77('0x1c')],function(_0x1a09f1){return{'model':db[_0x1a09f1[_0x7f77('0x1e')]],'as':_0x1a09f1['as'],'attributes':_0x1a09f1[_0x7f77('0x1a')],'include':_0x1a09f1[_0x7f77('0x1c')]?_[_0x7f77('0x1d')](_0x1a09f1['include'],function(_0x2cac56){return{'model':db[_0x2cac56[_0x7f77('0x1e')]],'as':_0x2cac56['as'],'attributes':_0x2cac56[_0x7f77('0x1a')],'include':_0x2cac56[_0x7f77('0x1c')]?_[_0x7f77('0x1d')](_0x2cac56[_0x7f77('0x1c')],function(_0x33ccf3){return{'model':db[_0x33ccf3[_0x7f77('0x1e')]],'as':_0x33ccf3['as'],'attributes':_0x33ccf3[_0x7f77('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x52066e){logger[_0x7f77('0xc')](_0x7f77('0x21'),_0x6f6ff8);logger['debug'](_0x7f77('0x21'),_0x6f6ff8,JSON[_0x7f77('0x20')](_0x52066e));_0x4ab735(_0x52066e);})[_0x7f77('0x14')](function(_0x221f6b){logger[_0x7f77('0xf')](_0x7f77('0x21'),_0x221f6b[_0x7f77('0x11')],_0x6f6ff8);_0x24d1ae(_0x516944[_0x7f77('0xf')](0x1f4,_0x221f6b[_0x7f77('0x11')]));});});}; \ No newline at end of file +var _0x36e2=['request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetSalesforceAccount','SalesforceAccount','options','where','model','attributes','include','map','stringify','ShowSalesforceAccount','find','raw','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','SalesforceAccount,\x20%s,\x20%s'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x36e2,0x1f3));var _0x236e=function(_0x488602,_0xd80932){_0x488602=_0x488602-0x0;var _0x484b92=_0x36e2[_0x488602];return _0x484b92;};'use strict';var _=require(_0x236e('0x0'));var util=require('util');var moment=require(_0x236e('0x1'));var BPromise=require(_0x236e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x236e('0x3'))['db'];var utils=require(_0x236e('0x4'));var logger=require(_0x236e('0x5'))(_0x236e('0x6'));var config=require(_0x236e('0x7'));var jayson=require(_0x236e('0x8'));var client=jayson[_0x236e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30a386,_0x58d1df,_0x489f0d){return new BPromise(function(_0x44857f,_0xa6a959){return client['request'](_0x30a386,_0x489f0d)[_0x236e('0xa')](function(_0x196073){logger[_0x236e('0xb')](_0x236e('0xc'),_0x58d1df,_0x236e('0xd'));logger[_0x236e('0xe')](_0x236e('0xf'),_0x58d1df,_0x236e('0xd'),JSON['stringify'](_0x196073));if(_0x196073[_0x236e('0x10')]){if(_0x196073[_0x236e('0x10')][_0x236e('0x11')]===0x1f4){logger[_0x236e('0x10')](_0x236e('0xc'),_0x58d1df,_0x196073[_0x236e('0x10')][_0x236e('0x12')]);return _0xa6a959(_0x196073['error'][_0x236e('0x12')]);}logger['error'](_0x236e('0xc'),_0x58d1df,_0x196073[_0x236e('0x10')]['message']);return _0x44857f(_0x196073[_0x236e('0x10')][_0x236e('0x12')]);}else{logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x58d1df,_0x236e('0xd'));_0x44857f(_0x196073['result'][_0x236e('0x12')]);}})[_0x236e('0x13')](function(_0x47babb){logger[_0x236e('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x58d1df,_0x47babb);_0xa6a959(_0x47babb);});});}exports[_0x236e('0x14')]=function(_0x5c8d07){var _0x453bd0=this;return new Promise(function(_0x27621a,_0x331b43){return db[_0x236e('0x15')]['findAll']({'raw':_0x5c8d07[_0x236e('0x16')]?_0x5c8d07[_0x236e('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5c8d07['options']?_0x5c8d07[_0x236e('0x16')][_0x236e('0x17')]||null:null,'attributes':_0x5c8d07[_0x236e('0x16')]?_0x5c8d07[_0x236e('0x16')]['attributes']||null:null,'limit':_0x5c8d07[_0x236e('0x16')]?_0x5c8d07['options']['limit']||null:null,'include':_0x5c8d07[_0x236e('0x16')]?_0x5c8d07['options']['include']?_['map'](_0x5c8d07[_0x236e('0x16')]['include'],function(_0x46d3fa){return{'model':db[_0x46d3fa[_0x236e('0x18')]],'as':_0x46d3fa['as'],'attributes':_0x46d3fa[_0x236e('0x19')],'include':_0x46d3fa[_0x236e('0x1a')]?_[_0x236e('0x1b')](_0x46d3fa['include'],function(_0x5bd2f0){return{'model':db[_0x5bd2f0[_0x236e('0x18')]],'as':_0x5bd2f0['as'],'attributes':_0x5bd2f0[_0x236e('0x19')],'include':_0x5bd2f0[_0x236e('0x1a')]?_[_0x236e('0x1b')](_0x5bd2f0[_0x236e('0x1a')],function(_0xbd7eba){return{'model':db[_0xbd7eba[_0x236e('0x18')]],'as':_0xbd7eba['as'],'attributes':_0xbd7eba[_0x236e('0x19')]};}):[]};}):[]};}):[]:[]})[_0x236e('0xa')](function(_0x2f279f){logger[_0x236e('0xb')](_0x236e('0x14'),_0x5c8d07);logger[_0x236e('0xe')](_0x236e('0x14'),_0x5c8d07,JSON[_0x236e('0x1c')](_0x2f279f));_0x27621a(_0x2f279f);})[_0x236e('0x13')](function(_0x246d6a){logger[_0x236e('0x10')](_0x236e('0x14'),_0x246d6a[_0x236e('0x12')],_0x5c8d07);_0x331b43(_0x453bd0[_0x236e('0x10')](0x1f4,_0x246d6a[_0x236e('0x12')]));});});};exports[_0x236e('0x1d')]=function(_0x31df4c){var _0x4efc6e=this;return new Promise(function(_0x17395b,_0xaa9b67){return db[_0x236e('0x15')][_0x236e('0x1e')]({'raw':_0x31df4c[_0x236e('0x16')]?_0x31df4c[_0x236e('0x16')][_0x236e('0x1f')]===undefined?!![]:![]:!![],'where':_0x31df4c[_0x236e('0x16')]?_0x31df4c[_0x236e('0x16')][_0x236e('0x17')]||null:null,'attributes':_0x31df4c[_0x236e('0x16')]?_0x31df4c[_0x236e('0x16')]['attributes']||null:null,'include':_0x31df4c[_0x236e('0x16')]?_0x31df4c[_0x236e('0x16')][_0x236e('0x1a')]?_[_0x236e('0x1b')](_0x31df4c[_0x236e('0x16')][_0x236e('0x1a')],function(_0x1e502e){return{'model':db[_0x1e502e[_0x236e('0x18')]],'as':_0x1e502e['as'],'attributes':_0x1e502e[_0x236e('0x19')],'include':_0x1e502e[_0x236e('0x1a')]?_[_0x236e('0x1b')](_0x1e502e[_0x236e('0x1a')],function(_0x38e7c9){return{'model':db[_0x38e7c9[_0x236e('0x18')]],'as':_0x38e7c9['as'],'attributes':_0x38e7c9[_0x236e('0x19')],'include':_0x38e7c9['include']?_[_0x236e('0x1b')](_0x38e7c9[_0x236e('0x1a')],function(_0x5879b2){return{'model':db[_0x5879b2['model']],'as':_0x5879b2['as'],'attributes':_0x5879b2['attributes']};}):[]};}):[]};}):[]:[]})[_0x236e('0xa')](function(_0x552a37){logger[_0x236e('0xb')]('ShowSalesforceAccount',_0x31df4c);logger[_0x236e('0xe')](_0x236e('0x1d'),_0x31df4c,JSON[_0x236e('0x1c')](_0x552a37));_0x17395b(_0x552a37);})[_0x236e('0x13')](function(_0x42867d){logger[_0x236e('0x10')](_0x236e('0x1d'),_0x42867d[_0x236e('0x12')],_0x31df4c);_0xaa9b67(_0x4efc6e[_0x236e('0x10')](0x1f4,_0x42867d[_0x236e('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 663b937..cd9e7b8 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 _0x5f66=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0xd13f1f,_0x4ef287){var _0x7ac4c9=function(_0x171a34){while(--_0x171a34){_0xd13f1f['push'](_0xd13f1f['shift']());}};_0x7ac4c9(++_0x4ef287);}(_0x5f66,0x1a0));var _0x65f6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5f66[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var fs_extra=require(_0x65f6('0x4'));var auth=require(_0x65f6('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x65f6('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x65f6('0x7')]('/',auth[_0x65f6('0x8')](),controller['index']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x7')](_0x65f6('0xb'),auth[_0x65f6('0x8')](),controller['getFields']);router['get'](_0x65f6('0xc'),auth[_0x65f6('0x8')](),controller[_0x65f6('0xd')]);router[_0x65f6('0x7')]('/:id/descriptions',auth[_0x65f6('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0x65f6('0x8')](),controller['create']);router[_0x65f6('0xe')]('/:id',auth[_0x65f6('0x8')](),controller[_0x65f6('0xf')]);router[_0x65f6('0x10')](_0x65f6('0x9'),auth[_0x65f6('0x8')](),controller[_0x65f6('0x11')]);module[_0x65f6('0x12')]=router; \ No newline at end of file +var _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x4e6d45,_0x446828){var _0x264716=function(_0x26785e){while(--_0x26785e){_0x4e6d45['push'](_0x4e6d45['shift']());}};_0x264716(++_0x446828);}(_0xadb5,0xad));var _0x5adb=function(_0x4de94f,_0x2cb97d){_0x4de94f=_0x4de94f-0x0;var _0x1b8578=_0xadb5[_0x4de94f];return _0x1b8578;};'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 fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('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 6c4d7d2..a885e9d 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 _0x19c7=['nothing','account','exports','STRING','ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead'];(function(_0x51c842,_0x2c47a8){var _0x3977a0=function(_0x521917){while(--_0x521917){_0x51c842['push'](_0x51c842['shift']());}};_0x3977a0(++_0x2c47a8);}(_0x19c7,0x16d));var _0x719c=function(_0x550b3e,_0x3b071b){_0x550b3e=_0x550b3e-0x0;var _0x47e01d=_0x19c7[_0x550b3e];return _0x47e01d;};'use strict';var Sequelize=require('sequelize');module[_0x719c('0x0')]={'name':{'type':Sequelize[_0x719c('0x1')]},'description':{'type':Sequelize[_0x719c('0x1')]},'ticketType':{'type':Sequelize[_0x719c('0x2')](_0x719c('0x3'),_0x719c('0x4')),'defaultValue':_0x719c('0x3')},'moduleSearch':{'type':Sequelize[_0x719c('0x2')](_0x719c('0x5'),_0x719c('0x6'),_0x719c('0x7'),_0x719c('0x8'),'account'),'defaultValue':_0x719c('0x5')},'moduleCreate':{'type':Sequelize[_0x719c('0x2')](_0x719c('0x9'),_0x719c('0x6'),_0x719c('0x7'),_0x719c('0xa')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0x719c('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x719c('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x719c('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x719c('0x1')]}}; \ No newline at end of file +var _0x5cba=['exports','STRING','ENUM','Task','Case','contact_lead','contact','lead','account','nothing','sequelize'];(function(_0x1ee6c7,_0x40d252){var _0x3bb46c=function(_0x41bed8){while(--_0x41bed8){_0x1ee6c7['push'](_0x1ee6c7['shift']());}};_0x3bb46c(++_0x40d252);}(_0x5cba,0x1cd));var _0xa5cb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5cba[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xa5cb('0x0'));module[_0xa5cb('0x1')]={'name':{'type':Sequelize[_0xa5cb('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xa5cb('0x3')](_0xa5cb('0x4'),_0xa5cb('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0xa5cb('0x6'),_0xa5cb('0x7'),_0xa5cb('0x8'),'account_contact_lead',_0xa5cb('0x9')),'defaultValue':_0xa5cb('0x6')},'moduleCreate':{'type':Sequelize[_0xa5cb('0x3')](_0xa5cb('0xa'),_0xa5cb('0x7'),_0xa5cb('0x8'),_0xa5cb('0x9')),'defaultValue':'lead'},'leadId':{'type':Sequelize[_0xa5cb('0x2')]},'additionalSearchAccount':{'type':Sequelize['STRING']},'additionalSearchContact':{'type':Sequelize[_0xa5cb('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xa5cb('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 438a239..42a94f6 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 _0xe12c=['key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options','findAll','rows','catch','show','rawAttributes','include','find','create','body','params','getFields','findOne','SalesforceField','order','pick','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','SalesforceConfiguration','fieldName','type'];(function(_0x35e7fb,_0x57b674){var _0x4257e1=function(_0x4a6e04){while(--_0x4a6e04){_0x35e7fb['push'](_0x35e7fb['shift']());}};_0x4257e1(++_0x57b674);}(_0xe12c,0x118));var _0xce12=function(_0x269ee8,_0x477226){_0x269ee8=_0x269ee8-0x0;var _0x4d98bd=_0xe12c[_0x269ee8];return _0x4d98bd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xce12('0x0'));var zipdir=require(_0xce12('0x1'));var jsonpatch=require(_0xce12('0x2'));var rp=require(_0xce12('0x3'));var moment=require(_0xce12('0x4'));var BPromise=require(_0xce12('0x5'));var Mustache=require(_0xce12('0x6'));var util=require(_0xce12('0x7'));var path=require(_0xce12('0x8'));var sox=require(_0xce12('0x9'));var csv=require(_0xce12('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce12('0xb'));var _=require(_0xce12('0xc'));var squel=require(_0xce12('0xd'));var crypto=require(_0xce12('0xe'));var jsforce=require(_0xce12('0xf'));var deskjs=require(_0xce12('0x10'));var toCsv=require(_0xce12('0xa'));var querystring=require(_0xce12('0x11'));var Papa=require(_0xce12('0x12'));var Redis=require('ioredis');var authService=require(_0xce12('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xce12('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xce12('0x15'));var utils=require(_0xce12('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xce12('0x17'));var db=require(_0xce12('0x18'))['db'];function respondWithStatusCode(_0x4fceec,_0x3c593b){_0x3c593b=_0x3c593b||0xcc;return function(_0x6a61c7){if(_0x6a61c7){return _0x4fceec[_0xce12('0x19')](_0x3c593b);}return _0x4fceec['status'](_0x3c593b)[_0xce12('0x1a')]();};}function respondWithResult(_0x59458e,_0x5201cf){_0x5201cf=_0x5201cf||0xc8;return function(_0x34f4dd){if(_0x34f4dd){return _0x59458e[_0xce12('0x1b')](_0x5201cf)['json'](_0x34f4dd);}};}function respondWithFilteredResult(_0xf7d36,_0x43c55b){return function(_0x3d3810){if(_0x3d3810){var _0x4979b6=typeof _0x43c55b[_0xce12('0x1c')]==='undefined'&&typeof _0x43c55b[_0xce12('0x1d')]===_0xce12('0x1e');var _0xb481e1=_0x3d3810[_0xce12('0x1f')];var _0x14b630=_0x4979b6?0x0:_0x43c55b['offset'];var _0xe312d=_0x4979b6?_0x3d3810[_0xce12('0x1f')]:_0x43c55b[_0xce12('0x1c')]+_0x43c55b['limit'];var _0x4a5e57;if(_0xe312d>=_0xb481e1){_0xe312d=_0xb481e1;_0x4a5e57=0xc8;}else{_0x4a5e57=0xce;}_0xf7d36[_0xce12('0x1b')](_0x4a5e57);return _0xf7d36['set'](_0xce12('0x20'),_0x14b630+'-'+_0xe312d+'/'+_0xb481e1)[_0xce12('0x21')](_0x3d3810);}return null;};}function patchUpdates(_0x52d237){return function(_0x59d8c6){try{jsonpatch[_0xce12('0x22')](_0x59d8c6,_0x52d237,!![]);}catch(_0x4cd6fd){return BPromise[_0xce12('0x23')](_0x4cd6fd);}return _0x59d8c6[_0xce12('0x24')]();};}function saveUpdates(_0xc6af05,_0x246744){return function(_0x22bc0a){if(_0x22bc0a){return _0x22bc0a[_0xce12('0x25')](_0xc6af05)[_0xce12('0x26')](function(_0x34c1f6){return _0x34c1f6;});}return null;};}function removeEntity(_0x560710,_0x255a22){return function(_0x140c17){if(_0x140c17){return _0x140c17[_0xce12('0x27')]()[_0xce12('0x26')](function(){_0x560710['status'](0xcc)[_0xce12('0x1a')]();});}};}function handleEntityNotFound(_0x18af83,_0x553459){return function(_0xeea774){if(!_0xeea774){_0x18af83[_0xce12('0x19')](0x194);}return _0xeea774;};}function handleError(_0x1bfb4d,_0x1b75d9){_0x1b75d9=_0x1b75d9||0x1f4;return function(_0x30883b){logger[_0xce12('0x28')](_0x30883b[_0xce12('0x29')]);if(_0x30883b['name']){delete _0x30883b[_0xce12('0x2a')];}_0x1bfb4d['status'](_0x1b75d9)['send'](_0x30883b);};}exports[_0xce12('0x2b')]=function(_0x4b59cd,_0x2cf520){var _0xcb48cd={},_0xb9f705={},_0xd5ea3={'count':0x0,'rows':[]};var _0x402c29=_[_0xce12('0x2c')](db[_0xce12('0x2d')]['rawAttributes'],function(_0x2b9f7d){return{'name':_0x2b9f7d[_0xce12('0x2e')],'type':_0x2b9f7d[_0xce12('0x2f')][_0xce12('0x30')]};});_0xb9f705[_0xce12('0x31')]=_['map'](_0x402c29,_0xce12('0x2a'));_0xb9f705[_0xce12('0x32')]=_[_0xce12('0x33')](_0x4b59cd[_0xce12('0x32')]);_0xb9f705['filters']=_['intersection'](_0xb9f705[_0xce12('0x31')],_0xb9f705[_0xce12('0x32')]);_0xcb48cd[_0xce12('0x34')]=_[_0xce12('0x35')](_0xb9f705[_0xce12('0x31')],qs[_0xce12('0x36')](_0x4b59cd[_0xce12('0x32')][_0xce12('0x36')]));_0xcb48cd['attributes']=_0xcb48cd['attributes'][_0xce12('0x37')]?_0xcb48cd[_0xce12('0x34')]:_0xb9f705[_0xce12('0x31')];if(!_0x4b59cd[_0xce12('0x32')][_0xce12('0x38')](_0xce12('0x39'))){_0xcb48cd[_0xce12('0x1d')]=qs['limit'](_0x4b59cd['query'][_0xce12('0x1d')]);_0xcb48cd['offset']=qs[_0xce12('0x1c')](_0x4b59cd['query'][_0xce12('0x1c')]);}_0xcb48cd['order']=qs[_0xce12('0x3a')](_0x4b59cd['query'][_0xce12('0x3a')]);_0xcb48cd[_0xce12('0x3b')]=qs[_0xce12('0x3c')](_['pick'](_0x4b59cd[_0xce12('0x32')],_0xb9f705[_0xce12('0x3c')]),_0x402c29);if(_0x4b59cd[_0xce12('0x32')][_0xce12('0x3d')]){_0xcb48cd[_0xce12('0x3b')]=_[_0xce12('0x3e')](_0xcb48cd[_0xce12('0x3b')],{'$or':_['map'](_0x402c29,function(_0x1d718a){if(_0x1d718a[_0xce12('0x2f')]!==_0xce12('0x3f')){var _0x283446={};_0x283446[_0x1d718a['name']]={'$like':'%'+_0x4b59cd[_0xce12('0x32')][_0xce12('0x3d')]+'%'};return _0x283446;}})});}_0xcb48cd=_[_0xce12('0x3e')]({},_0xcb48cd,_0x4b59cd[_0xce12('0x40')]);var _0x309b7b={'where':_0xcb48cd[_0xce12('0x3b')]};return db[_0xce12('0x2d')]['count'](_0x309b7b)[_0xce12('0x26')](function(_0x4b48c9){_0xd5ea3[_0xce12('0x1f')]=_0x4b48c9;if(_0x4b59cd[_0xce12('0x32')]['includeAll']){_0xcb48cd['include']=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xce12('0x41')](_0xcb48cd);})[_0xce12('0x26')](function(_0x4e7d37){_0xd5ea3[_0xce12('0x42')]=_0x4e7d37;return _0xd5ea3;})[_0xce12('0x26')](respondWithFilteredResult(_0x2cf520,_0xcb48cd))[_0xce12('0x43')](handleError(_0x2cf520,null));};exports[_0xce12('0x44')]=function(_0x59bfc0,_0x4d189e){var _0x2b8ec4={'raw':![],'where':{'id':_0x59bfc0['params']['id']}},_0xc69056={};_0xc69056[_0xce12('0x31')]=_[_0xce12('0x33')](db[_0xce12('0x2d')][_0xce12('0x45')]);_0xc69056[_0xce12('0x32')]=_[_0xce12('0x33')](_0x59bfc0[_0xce12('0x32')]);_0xc69056[_0xce12('0x3c')]=_[_0xce12('0x35')](_0xc69056[_0xce12('0x31')],_0xc69056[_0xce12('0x32')]);_0x2b8ec4[_0xce12('0x34')]=_['intersection'](_0xc69056[_0xce12('0x31')],qs[_0xce12('0x36')](_0x59bfc0[_0xce12('0x32')]['fields']));_0x2b8ec4['attributes']=_0x2b8ec4[_0xce12('0x34')][_0xce12('0x37')]?_0x2b8ec4['attributes']:_0xc69056[_0xce12('0x31')];if(_0x59bfc0[_0xce12('0x32')]['includeAll']){_0x2b8ec4[_0xce12('0x46')]=[{'all':!![]}];}_0x2b8ec4=_['merge']({},_0x2b8ec4,_0x59bfc0[_0xce12('0x40')]);return db[_0xce12('0x2d')][_0xce12('0x47')](_0x2b8ec4)[_0xce12('0x26')](handleEntityNotFound(_0x4d189e,null))[_0xce12('0x26')](respondWithResult(_0x4d189e,null))['catch'](handleError(_0x4d189e,null));};exports[_0xce12('0x48')]=function(_0x5e6627,_0x2e91af){return db['SalesforceConfiguration'][_0xce12('0x48')](_0x5e6627['body'],{})[_0xce12('0x26')](respondWithResult(_0x2e91af,0xc9))[_0xce12('0x43')](handleError(_0x2e91af,null));};exports[_0xce12('0x25')]=function(_0x16ddd5,_0x483b49){if(_0x16ddd5['body']['id']){delete _0x16ddd5[_0xce12('0x49')]['id'];}return db['SalesforceConfiguration'][_0xce12('0x47')]({'where':{'id':_0x16ddd5[_0xce12('0x4a')]['id']}})[_0xce12('0x26')](handleEntityNotFound(_0x483b49,null))[_0xce12('0x26')](saveUpdates(_0x16ddd5['body'],null))[_0xce12('0x26')](respondWithResult(_0x483b49,null))[_0xce12('0x43')](handleError(_0x483b49,null));};exports[_0xce12('0x27')]=function(_0x338e54,_0x45b8ec){return db[_0xce12('0x2d')][_0xce12('0x47')]({'where':{'id':_0x338e54[_0xce12('0x4a')]['id']}})['then'](handleEntityNotFound(_0x45b8ec,null))[_0xce12('0x26')](removeEntity(_0x45b8ec,null))[_0xce12('0x43')](handleError(_0x45b8ec,null));};exports[_0xce12('0x4b')]=function(_0x327ce2,_0x3e1c97,_0xe6c32c){var _0x34cd16={};var _0x323975={};var _0x2a69a0;var _0x365eb6;return db[_0xce12('0x2d')][_0xce12('0x4c')]({'where':{'id':_0x327ce2[_0xce12('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3e1c97,null))['then'](function(_0x55dee7){if(_0x55dee7){_0x2a69a0=_0x55dee7;_0x323975[_0xce12('0x31')]=_[_0xce12('0x33')](db[_0xce12('0x4d')]['rawAttributes']);_0x323975[_0xce12('0x32')]=_['keys'](_0x327ce2[_0xce12('0x32')]);_0x323975[_0xce12('0x3c')]=_[_0xce12('0x35')](_0x323975[_0xce12('0x31')],_0x323975[_0xce12('0x32')]);_0x34cd16[_0xce12('0x34')]=_['intersection'](_0x323975[_0xce12('0x31')],qs[_0xce12('0x36')](_0x327ce2[_0xce12('0x32')][_0xce12('0x36')]));_0x34cd16['attributes']=_0x34cd16['attributes']['length']?_0x34cd16[_0xce12('0x34')]:_0x323975['model'];_0x34cd16[_0xce12('0x4e')]=qs[_0xce12('0x3a')](_0x327ce2['query'][_0xce12('0x3a')]);_0x34cd16[_0xce12('0x3b')]=qs[_0xce12('0x3c')](_[_0xce12('0x4f')](_0x327ce2[_0xce12('0x32')],_0x323975[_0xce12('0x3c')]));if(_0x327ce2[_0xce12('0x32')][_0xce12('0x3d')]){_0x34cd16[_0xce12('0x3b')]=_[_0xce12('0x3e')](_0x34cd16[_0xce12('0x3b')],{'$or':_[_0xce12('0x2c')](_0x34cd16[_0xce12('0x34')],function(_0x4c6bc5){var _0x501128={};_0x501128[_0x4c6bc5]={'$like':'%'+_0x327ce2['query']['filter']+'%'};return _0x501128;})});}_0x34cd16=_['merge']({},_0x34cd16,_0x327ce2['options']);return _0x2a69a0[_0xce12('0x4b')](_0x34cd16);}})[_0xce12('0x26')](function(_0x5bd824){if(_0x5bd824){_0x365eb6=_0x5bd824['length'];if(!_0x327ce2['query']['hasOwnProperty'](_0xce12('0x39'))){_0x34cd16[_0xce12('0x1d')]=qs['limit'](_0x327ce2[_0xce12('0x32')][_0xce12('0x1d')]);_0x34cd16[_0xce12('0x1c')]=qs[_0xce12('0x1c')](_0x327ce2['query'][_0xce12('0x1c')]);}return _0x2a69a0[_0xce12('0x4b')](_0x34cd16);}})['then'](function(_0x1542c1){if(_0x1542c1){return _0x1542c1?{'count':_0x365eb6,'rows':_0x1542c1}:null;}})[_0xce12('0x26')](respondWithResult(_0x3e1c97,null))[_0xce12('0x43')](handleError(_0x3e1c97,null));};exports[_0xce12('0x50')]=function(_0x1a3e46,_0x594ef9,_0x1c6a05){var _0x50e384={};var _0xe959ef={};var _0xa56d30;var _0x375f34;return db[_0xce12('0x2d')]['findOne']({'where':{'id':_0x1a3e46[_0xce12('0x4a')]['id']}})[_0xce12('0x26')](handleEntityNotFound(_0x594ef9,null))[_0xce12('0x26')](function(_0xab2e2a){if(_0xab2e2a){_0xa56d30=_0xab2e2a;_0xe959ef[_0xce12('0x31')]=_[_0xce12('0x33')](db['SalesforceField'][_0xce12('0x45')]);_0xe959ef[_0xce12('0x32')]=_['keys'](_0x1a3e46[_0xce12('0x32')]);_0xe959ef[_0xce12('0x3c')]=_[_0xce12('0x35')](_0xe959ef[_0xce12('0x31')],_0xe959ef[_0xce12('0x32')]);_0x50e384[_0xce12('0x34')]=_[_0xce12('0x35')](_0xe959ef['model'],qs[_0xce12('0x36')](_0x1a3e46['query'][_0xce12('0x36')]));_0x50e384[_0xce12('0x34')]=_0x50e384[_0xce12('0x34')][_0xce12('0x37')]?_0x50e384[_0xce12('0x34')]:_0xe959ef[_0xce12('0x31')];_0x50e384[_0xce12('0x4e')]=qs['sort'](_0x1a3e46['query']['sort']);_0x50e384[_0xce12('0x3b')]=qs[_0xce12('0x3c')](_[_0xce12('0x4f')](_0x1a3e46['query'],_0xe959ef[_0xce12('0x3c')]));if(_0x1a3e46[_0xce12('0x32')][_0xce12('0x3d')]){_0x50e384[_0xce12('0x3b')]=_['merge'](_0x50e384[_0xce12('0x3b')],{'$or':_[_0xce12('0x2c')](_0x50e384[_0xce12('0x34')],function(_0x2696eb){var _0x591e20={};_0x591e20[_0x2696eb]={'$like':'%'+_0x1a3e46[_0xce12('0x32')]['filter']+'%'};return _0x591e20;})});}_0x50e384=_[_0xce12('0x3e')]({},_0x50e384,_0x1a3e46['options']);return _0xa56d30[_0xce12('0x50')](_0x50e384);}})[_0xce12('0x26')](function(_0x28d3dd){if(_0x28d3dd){_0x375f34=_0x28d3dd[_0xce12('0x37')];if(!_0x1a3e46[_0xce12('0x32')][_0xce12('0x38')](_0xce12('0x39'))){_0x50e384[_0xce12('0x1d')]=qs[_0xce12('0x1d')](_0x1a3e46[_0xce12('0x32')][_0xce12('0x1d')]);_0x50e384[_0xce12('0x1c')]=qs['offset'](_0x1a3e46[_0xce12('0x32')]['offset']);}return _0xa56d30['getSubjects'](_0x50e384);}})[_0xce12('0x26')](function(_0x4d523c){if(_0x4d523c){return _0x4d523c?{'count':_0x375f34,'rows':_0x4d523c}:null;}})[_0xce12('0x26')](respondWithResult(_0x594ef9,null))['catch'](handleError(_0x594ef9,null));};exports[_0xce12('0x51')]=function(_0x528963,_0x401ad7,_0x38c58c){var _0x5afbd3={};var _0x3dec1a={};var _0xd8a9e4;var _0x313b9a;return db[_0xce12('0x2d')][_0xce12('0x4c')]({'where':{'id':_0x528963[_0xce12('0x4a')]['id']}})[_0xce12('0x26')](handleEntityNotFound(_0x401ad7,null))[_0xce12('0x26')](function(_0xd40b90){if(_0xd40b90){_0xd8a9e4=_0xd40b90;_0x3dec1a[_0xce12('0x31')]=_['keys'](db[_0xce12('0x4d')][_0xce12('0x45')]);_0x3dec1a[_0xce12('0x32')]=_[_0xce12('0x33')](_0x528963[_0xce12('0x32')]);_0x3dec1a['filters']=_[_0xce12('0x35')](_0x3dec1a['model'],_0x3dec1a[_0xce12('0x32')]);_0x5afbd3[_0xce12('0x34')]=_[_0xce12('0x35')](_0x3dec1a['model'],qs['fields'](_0x528963[_0xce12('0x32')][_0xce12('0x36')]));_0x5afbd3[_0xce12('0x34')]=_0x5afbd3[_0xce12('0x34')][_0xce12('0x37')]?_0x5afbd3[_0xce12('0x34')]:_0x3dec1a[_0xce12('0x31')];_0x5afbd3[_0xce12('0x4e')]=qs[_0xce12('0x3a')](_0x528963[_0xce12('0x32')][_0xce12('0x3a')]);_0x5afbd3[_0xce12('0x3b')]=qs[_0xce12('0x3c')](_[_0xce12('0x4f')](_0x528963['query'],_0x3dec1a[_0xce12('0x3c')]));if(_0x528963[_0xce12('0x32')][_0xce12('0x3d')]){_0x5afbd3[_0xce12('0x3b')]=_[_0xce12('0x3e')](_0x5afbd3[_0xce12('0x3b')],{'$or':_[_0xce12('0x2c')](_0x5afbd3[_0xce12('0x34')],function(_0x13bc85){var _0x227439={};_0x227439[_0x13bc85]={'$like':'%'+_0x528963[_0xce12('0x32')]['filter']+'%'};return _0x227439;})});}_0x5afbd3=_[_0xce12('0x3e')]({},_0x5afbd3,_0x528963[_0xce12('0x40')]);return _0xd8a9e4[_0xce12('0x51')](_0x5afbd3);}})[_0xce12('0x26')](function(_0x3ec44f){if(_0x3ec44f){_0x313b9a=_0x3ec44f['length'];if(!_0x528963[_0xce12('0x32')][_0xce12('0x38')](_0xce12('0x39'))){_0x5afbd3['limit']=qs['limit'](_0x528963[_0xce12('0x32')][_0xce12('0x1d')]);_0x5afbd3[_0xce12('0x1c')]=qs[_0xce12('0x1c')](_0x528963[_0xce12('0x32')][_0xce12('0x1c')]);}return _0xd8a9e4['getDescriptions'](_0x5afbd3);}})[_0xce12('0x26')](function(_0x442477){if(_0x442477){return _0x442477?{'count':_0x313b9a,'rows':_0x442477}:null;}})[_0xce12('0x26')](respondWithResult(_0x401ad7,null))['catch'](handleError(_0x401ad7,null));}; \ No newline at end of file +var _0x4337=['../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','save','then','destroy','error','name','send','index','map','SalesforceConfiguration','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','update','getFields','findOne','SalesforceField','order','getSubjects','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x4337,0x16e));var _0x7433=function(_0x4d8f29,_0x5ab20){_0x4d8f29=_0x4d8f29-0x0;var _0x35e92a=_0x4337[_0x4d8f29];return _0x35e92a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7433('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7433('0x1'));var rp=require(_0x7433('0x2'));var moment=require(_0x7433('0x3'));var BPromise=require(_0x7433('0x4'));var Mustache=require(_0x7433('0x5'));var util=require(_0x7433('0x6'));var path=require(_0x7433('0x7'));var sox=require(_0x7433('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7433('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7433('0xa'));var toCsv=require(_0x7433('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7433('0xc'));var authService=require(_0x7433('0xd'));var qs=require(_0x7433('0xe'));var as=require(_0x7433('0xf'));var hardwareService=require(_0x7433('0x10'));var logger=require(_0x7433('0x11'))(_0x7433('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7433('0x13'));var db=require(_0x7433('0x14'))['db'];function respondWithStatusCode(_0x41cab9,_0x35a80f){_0x35a80f=_0x35a80f||0xcc;return function(_0x4adce4){if(_0x4adce4){return _0x41cab9[_0x7433('0x15')](_0x35a80f);}return _0x41cab9[_0x7433('0x16')](_0x35a80f)[_0x7433('0x17')]();};}function respondWithResult(_0x2f7b29,_0x3ba86f){_0x3ba86f=_0x3ba86f||0xc8;return function(_0x6cf53c){if(_0x6cf53c){return _0x2f7b29[_0x7433('0x16')](_0x3ba86f)['json'](_0x6cf53c);}};}function respondWithFilteredResult(_0x52cc8d,_0x47f837){return function(_0x5e7d28){if(_0x5e7d28){var _0x18befd=typeof _0x47f837[_0x7433('0x18')]==='undefined'&&typeof _0x47f837[_0x7433('0x19')]===_0x7433('0x1a');var _0x25a0c6=_0x5e7d28[_0x7433('0x1b')];var _0x1b16cf=_0x18befd?0x0:_0x47f837[_0x7433('0x18')];var _0x5bb82b=_0x18befd?_0x5e7d28[_0x7433('0x1b')]:_0x47f837[_0x7433('0x18')]+_0x47f837[_0x7433('0x19')];var _0x2ad5bb;if(_0x5bb82b>=_0x25a0c6){_0x5bb82b=_0x25a0c6;_0x2ad5bb=0xc8;}else{_0x2ad5bb=0xce;}_0x52cc8d[_0x7433('0x16')](_0x2ad5bb);return _0x52cc8d[_0x7433('0x1c')]('Content-Range',_0x1b16cf+'-'+_0x5bb82b+'/'+_0x25a0c6)[_0x7433('0x1d')](_0x5e7d28);}return null;};}function patchUpdates(_0x8daf47){return function(_0x5d4e79){try{jsonpatch[_0x7433('0x1e')](_0x5d4e79,_0x8daf47,!![]);}catch(_0x2aab6e){return BPromise[_0x7433('0x1f')](_0x2aab6e);}return _0x5d4e79[_0x7433('0x20')]();};}function saveUpdates(_0x1a0296,_0x30b766){return function(_0x413eb2){if(_0x413eb2){return _0x413eb2['update'](_0x1a0296)[_0x7433('0x21')](function(_0x2fc981){return _0x2fc981;});}return null;};}function removeEntity(_0x4e3098,_0x1ad479){return function(_0x15b1de){if(_0x15b1de){return _0x15b1de[_0x7433('0x22')]()[_0x7433('0x21')](function(){_0x4e3098['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f13f3,_0x1e6239){return function(_0x2dc404){if(!_0x2dc404){_0x2f13f3[_0x7433('0x15')](0x194);}return _0x2dc404;};}function handleError(_0x387ccb,_0x1f288e){_0x1f288e=_0x1f288e||0x1f4;return function(_0x20340b){logger[_0x7433('0x23')](_0x20340b['stack']);if(_0x20340b[_0x7433('0x24')]){delete _0x20340b[_0x7433('0x24')];}_0x387ccb[_0x7433('0x16')](_0x1f288e)[_0x7433('0x25')](_0x20340b);};}exports[_0x7433('0x26')]=function(_0x2a9e35,_0x4da178){var _0x39a752={},_0x4d03ae={},_0x4d012b={'count':0x0,'rows':[]};var _0x214346=_[_0x7433('0x27')](db[_0x7433('0x28')][_0x7433('0x29')],function(_0x3cad21){return{'name':_0x3cad21['fieldName'],'type':_0x3cad21[_0x7433('0x2a')][_0x7433('0x2b')]};});_0x4d03ae[_0x7433('0x2c')]=_[_0x7433('0x27')](_0x214346,_0x7433('0x24'));_0x4d03ae[_0x7433('0x2d')]=_['keys'](_0x2a9e35[_0x7433('0x2d')]);_0x4d03ae[_0x7433('0x2e')]=_[_0x7433('0x2f')](_0x4d03ae[_0x7433('0x2c')],_0x4d03ae[_0x7433('0x2d')]);_0x39a752[_0x7433('0x30')]=_[_0x7433('0x2f')](_0x4d03ae['model'],qs['fields'](_0x2a9e35[_0x7433('0x2d')]['fields']));_0x39a752[_0x7433('0x30')]=_0x39a752[_0x7433('0x30')][_0x7433('0x31')]?_0x39a752[_0x7433('0x30')]:_0x4d03ae[_0x7433('0x2c')];if(!_0x2a9e35['query'][_0x7433('0x32')](_0x7433('0x33'))){_0x39a752[_0x7433('0x19')]=qs[_0x7433('0x19')](_0x2a9e35[_0x7433('0x2d')]['limit']);_0x39a752['offset']=qs[_0x7433('0x18')](_0x2a9e35[_0x7433('0x2d')]['offset']);}_0x39a752['order']=qs[_0x7433('0x34')](_0x2a9e35[_0x7433('0x2d')][_0x7433('0x34')]);_0x39a752[_0x7433('0x35')]=qs[_0x7433('0x2e')](_[_0x7433('0x36')](_0x2a9e35[_0x7433('0x2d')],_0x4d03ae[_0x7433('0x2e')]),_0x214346);if(_0x2a9e35[_0x7433('0x2d')][_0x7433('0x37')]){_0x39a752['where']=_[_0x7433('0x38')](_0x39a752[_0x7433('0x35')],{'$or':_[_0x7433('0x27')](_0x214346,function(_0x3d675d){if(_0x3d675d[_0x7433('0x2a')]!=='VIRTUAL'){var _0xf16c9f={};_0xf16c9f[_0x3d675d[_0x7433('0x24')]]={'$like':'%'+_0x2a9e35[_0x7433('0x2d')][_0x7433('0x37')]+'%'};return _0xf16c9f;}})});}_0x39a752=_['merge']({},_0x39a752,_0x2a9e35[_0x7433('0x39')]);var _0x4ebc5a={'where':_0x39a752[_0x7433('0x35')]};return db[_0x7433('0x28')]['count'](_0x4ebc5a)['then'](function(_0x3b0d2e){_0x4d012b[_0x7433('0x1b')]=_0x3b0d2e;if(_0x2a9e35['query'][_0x7433('0x3a')]){_0x39a752[_0x7433('0x3b')]=[{'all':!![]}];}return db[_0x7433('0x28')][_0x7433('0x3c')](_0x39a752);})[_0x7433('0x21')](function(_0xe6f01d){_0x4d012b[_0x7433('0x3d')]=_0xe6f01d;return _0x4d012b;})[_0x7433('0x21')](respondWithFilteredResult(_0x4da178,_0x39a752))[_0x7433('0x3e')](handleError(_0x4da178,null));};exports[_0x7433('0x3f')]=function(_0x53a5ef,_0x5ba9f3){var _0x2bd623={'raw':![],'where':{'id':_0x53a5ef[_0x7433('0x40')]['id']}},_0x5e00c7={};_0x5e00c7['model']=_['keys'](db['SalesforceConfiguration'][_0x7433('0x29')]);_0x5e00c7['query']=_[_0x7433('0x41')](_0x53a5ef['query']);_0x5e00c7[_0x7433('0x2e')]=_[_0x7433('0x2f')](_0x5e00c7['model'],_0x5e00c7[_0x7433('0x2d')]);_0x2bd623[_0x7433('0x30')]=_[_0x7433('0x2f')](_0x5e00c7[_0x7433('0x2c')],qs[_0x7433('0x42')](_0x53a5ef['query'][_0x7433('0x42')]));_0x2bd623[_0x7433('0x30')]=_0x2bd623[_0x7433('0x30')]['length']?_0x2bd623[_0x7433('0x30')]:_0x5e00c7[_0x7433('0x2c')];if(_0x53a5ef[_0x7433('0x2d')][_0x7433('0x3a')]){_0x2bd623[_0x7433('0x3b')]=[{'all':!![]}];}_0x2bd623=_[_0x7433('0x38')]({},_0x2bd623,_0x53a5ef['options']);return db['SalesforceConfiguration'][_0x7433('0x43')](_0x2bd623)[_0x7433('0x21')](handleEntityNotFound(_0x5ba9f3,null))[_0x7433('0x21')](respondWithResult(_0x5ba9f3,null))[_0x7433('0x3e')](handleError(_0x5ba9f3,null));};exports['create']=function(_0x30b49e,_0x12f806){return db[_0x7433('0x28')][_0x7433('0x44')](_0x30b49e[_0x7433('0x45')],{})[_0x7433('0x21')](respondWithResult(_0x12f806,0xc9))['catch'](handleError(_0x12f806,null));};exports[_0x7433('0x46')]=function(_0x2df6b2,_0x1edb26){if(_0x2df6b2['body']['id']){delete _0x2df6b2['body']['id'];}return db[_0x7433('0x28')]['find']({'where':{'id':_0x2df6b2['params']['id']}})[_0x7433('0x21')](handleEntityNotFound(_0x1edb26,null))[_0x7433('0x21')](saveUpdates(_0x2df6b2[_0x7433('0x45')],null))[_0x7433('0x21')](respondWithResult(_0x1edb26,null))[_0x7433('0x3e')](handleError(_0x1edb26,null));};exports['destroy']=function(_0x10a5d8,_0x3e7e29){return db[_0x7433('0x28')][_0x7433('0x43')]({'where':{'id':_0x10a5d8[_0x7433('0x40')]['id']}})[_0x7433('0x21')](handleEntityNotFound(_0x3e7e29,null))['then'](removeEntity(_0x3e7e29,null))[_0x7433('0x3e')](handleError(_0x3e7e29,null));};exports[_0x7433('0x47')]=function(_0x532fcc,_0x163277,_0x2e3d9b){var _0x4c7b50={};var _0x460ff0={};var _0x842c77;var _0x32d813;return db[_0x7433('0x28')][_0x7433('0x48')]({'where':{'id':_0x532fcc[_0x7433('0x40')]['id']}})[_0x7433('0x21')](handleEntityNotFound(_0x163277,null))[_0x7433('0x21')](function(_0x3830e2){if(_0x3830e2){_0x842c77=_0x3830e2;_0x460ff0[_0x7433('0x2c')]=_[_0x7433('0x41')](db[_0x7433('0x49')][_0x7433('0x29')]);_0x460ff0[_0x7433('0x2d')]=_[_0x7433('0x41')](_0x532fcc[_0x7433('0x2d')]);_0x460ff0[_0x7433('0x2e')]=_[_0x7433('0x2f')](_0x460ff0[_0x7433('0x2c')],_0x460ff0[_0x7433('0x2d')]);_0x4c7b50[_0x7433('0x30')]=_[_0x7433('0x2f')](_0x460ff0['model'],qs[_0x7433('0x42')](_0x532fcc[_0x7433('0x2d')]['fields']));_0x4c7b50['attributes']=_0x4c7b50[_0x7433('0x30')][_0x7433('0x31')]?_0x4c7b50[_0x7433('0x30')]:_0x460ff0['model'];_0x4c7b50[_0x7433('0x4a')]=qs[_0x7433('0x34')](_0x532fcc[_0x7433('0x2d')][_0x7433('0x34')]);_0x4c7b50[_0x7433('0x35')]=qs[_0x7433('0x2e')](_[_0x7433('0x36')](_0x532fcc['query'],_0x460ff0['filters']));if(_0x532fcc[_0x7433('0x2d')][_0x7433('0x37')]){_0x4c7b50['where']=_[_0x7433('0x38')](_0x4c7b50[_0x7433('0x35')],{'$or':_[_0x7433('0x27')](_0x4c7b50[_0x7433('0x30')],function(_0x492286){var _0x5b0532={};_0x5b0532[_0x492286]={'$like':'%'+_0x532fcc[_0x7433('0x2d')][_0x7433('0x37')]+'%'};return _0x5b0532;})});}_0x4c7b50=_[_0x7433('0x38')]({},_0x4c7b50,_0x532fcc[_0x7433('0x39')]);return _0x842c77[_0x7433('0x47')](_0x4c7b50);}})[_0x7433('0x21')](function(_0xca394b){if(_0xca394b){_0x32d813=_0xca394b['length'];if(!_0x532fcc[_0x7433('0x2d')][_0x7433('0x32')](_0x7433('0x33'))){_0x4c7b50[_0x7433('0x19')]=qs[_0x7433('0x19')](_0x532fcc[_0x7433('0x2d')]['limit']);_0x4c7b50[_0x7433('0x18')]=qs['offset'](_0x532fcc[_0x7433('0x2d')]['offset']);}return _0x842c77[_0x7433('0x47')](_0x4c7b50);}})[_0x7433('0x21')](function(_0x5a1e70){if(_0x5a1e70){return _0x5a1e70?{'count':_0x32d813,'rows':_0x5a1e70}:null;}})[_0x7433('0x21')](respondWithResult(_0x163277,null))[_0x7433('0x3e')](handleError(_0x163277,null));};exports[_0x7433('0x4b')]=function(_0x4f4614,_0x23c3f7,_0x550d27){var _0x536a3d={};var _0x58e3b4={};var _0x3894fa;var _0x1dc712;return db[_0x7433('0x28')]['findOne']({'where':{'id':_0x4f4614[_0x7433('0x40')]['id']}})[_0x7433('0x21')](handleEntityNotFound(_0x23c3f7,null))[_0x7433('0x21')](function(_0x3317bb){if(_0x3317bb){_0x3894fa=_0x3317bb;_0x58e3b4['model']=_[_0x7433('0x41')](db[_0x7433('0x49')][_0x7433('0x29')]);_0x58e3b4['query']=_[_0x7433('0x41')](_0x4f4614[_0x7433('0x2d')]);_0x58e3b4[_0x7433('0x2e')]=_[_0x7433('0x2f')](_0x58e3b4[_0x7433('0x2c')],_0x58e3b4[_0x7433('0x2d')]);_0x536a3d[_0x7433('0x30')]=_[_0x7433('0x2f')](_0x58e3b4['model'],qs['fields'](_0x4f4614[_0x7433('0x2d')][_0x7433('0x42')]));_0x536a3d['attributes']=_0x536a3d['attributes'][_0x7433('0x31')]?_0x536a3d['attributes']:_0x58e3b4['model'];_0x536a3d[_0x7433('0x4a')]=qs['sort'](_0x4f4614['query']['sort']);_0x536a3d['where']=qs[_0x7433('0x2e')](_[_0x7433('0x36')](_0x4f4614[_0x7433('0x2d')],_0x58e3b4['filters']));if(_0x4f4614[_0x7433('0x2d')]['filter']){_0x536a3d[_0x7433('0x35')]=_[_0x7433('0x38')](_0x536a3d[_0x7433('0x35')],{'$or':_['map'](_0x536a3d['attributes'],function(_0x4301d4){var _0x189c64={};_0x189c64[_0x4301d4]={'$like':'%'+_0x4f4614[_0x7433('0x2d')]['filter']+'%'};return _0x189c64;})});}_0x536a3d=_[_0x7433('0x38')]({},_0x536a3d,_0x4f4614[_0x7433('0x39')]);return _0x3894fa['getSubjects'](_0x536a3d);}})[_0x7433('0x21')](function(_0x2d9006){if(_0x2d9006){_0x1dc712=_0x2d9006[_0x7433('0x31')];if(!_0x4f4614[_0x7433('0x2d')][_0x7433('0x32')](_0x7433('0x33'))){_0x536a3d[_0x7433('0x19')]=qs[_0x7433('0x19')](_0x4f4614[_0x7433('0x2d')][_0x7433('0x19')]);_0x536a3d['offset']=qs[_0x7433('0x18')](_0x4f4614[_0x7433('0x2d')]['offset']);}return _0x3894fa[_0x7433('0x4b')](_0x536a3d);}})['then'](function(_0x103ad2){if(_0x103ad2){return _0x103ad2?{'count':_0x1dc712,'rows':_0x103ad2}:null;}})[_0x7433('0x21')](respondWithResult(_0x23c3f7,null))[_0x7433('0x3e')](handleError(_0x23c3f7,null));};exports[_0x7433('0x4c')]=function(_0x1147b0,_0x5edc63,_0x583d09){var _0x4c8efb={};var _0x28939a={};var _0x4b6e6f;var _0x35df15;return db['SalesforceConfiguration'][_0x7433('0x48')]({'where':{'id':_0x1147b0[_0x7433('0x40')]['id']}})[_0x7433('0x21')](handleEntityNotFound(_0x5edc63,null))[_0x7433('0x21')](function(_0x36decf){if(_0x36decf){_0x4b6e6f=_0x36decf;_0x28939a[_0x7433('0x2c')]=_[_0x7433('0x41')](db[_0x7433('0x49')][_0x7433('0x29')]);_0x28939a['query']=_[_0x7433('0x41')](_0x1147b0[_0x7433('0x2d')]);_0x28939a['filters']=_[_0x7433('0x2f')](_0x28939a[_0x7433('0x2c')],_0x28939a[_0x7433('0x2d')]);_0x4c8efb['attributes']=_[_0x7433('0x2f')](_0x28939a['model'],qs[_0x7433('0x42')](_0x1147b0[_0x7433('0x2d')][_0x7433('0x42')]));_0x4c8efb[_0x7433('0x30')]=_0x4c8efb['attributes'][_0x7433('0x31')]?_0x4c8efb[_0x7433('0x30')]:_0x28939a['model'];_0x4c8efb['order']=qs[_0x7433('0x34')](_0x1147b0[_0x7433('0x2d')]['sort']);_0x4c8efb['where']=qs['filters'](_[_0x7433('0x36')](_0x1147b0['query'],_0x28939a[_0x7433('0x2e')]));if(_0x1147b0['query'][_0x7433('0x37')]){_0x4c8efb[_0x7433('0x35')]=_[_0x7433('0x38')](_0x4c8efb[_0x7433('0x35')],{'$or':_[_0x7433('0x27')](_0x4c8efb[_0x7433('0x30')],function(_0x154c63){var _0x53c675={};_0x53c675[_0x154c63]={'$like':'%'+_0x1147b0[_0x7433('0x2d')][_0x7433('0x37')]+'%'};return _0x53c675;})});}_0x4c8efb=_[_0x7433('0x38')]({},_0x4c8efb,_0x1147b0[_0x7433('0x39')]);return _0x4b6e6f[_0x7433('0x4c')](_0x4c8efb);}})[_0x7433('0x21')](function(_0x362067){if(_0x362067){_0x35df15=_0x362067[_0x7433('0x31')];if(!_0x1147b0[_0x7433('0x2d')][_0x7433('0x32')](_0x7433('0x33'))){_0x4c8efb['limit']=qs[_0x7433('0x19')](_0x1147b0[_0x7433('0x2d')][_0x7433('0x19')]);_0x4c8efb['offset']=qs[_0x7433('0x18')](_0x1147b0[_0x7433('0x2d')][_0x7433('0x18')]);}return _0x4b6e6f[_0x7433('0x4c')](_0x4c8efb);}})[_0x7433('0x21')](function(_0x3a5595){if(_0x3a5595){return _0x3a5595?{'count':_0x35df15,'rows':_0x3a5595}:null;}})[_0x7433('0x21')](respondWithResult(_0x5edc63,null))['catch'](handleError(_0x5edc63,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 9b4dee9..9cc3237 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 _0x4232=['int_salesforce_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SalesforceConfiguration'];(function(_0x123cbd,_0x4086b8){var _0x1b7765=function(_0xd9f45c){while(--_0xd9f45c){_0x123cbd['push'](_0x123cbd['shift']());}};_0x1b7765(++_0x4086b8);}(_0x4232,0x15f));var _0x2423=function(_0x3428cd,_0x2e977d){_0x3428cd=_0x3428cd-0x0;var _0x279bde=_0x4232[_0x3428cd];return _0x279bde;};'use strict';var _=require(_0x2423('0x0'));var util=require(_0x2423('0x1'));var logger=require(_0x2423('0x2'))(_0x2423('0x3'));var moment=require(_0x2423('0x4'));var BPromise=require(_0x2423('0x5'));var rp=require(_0x2423('0x6'));var fs=require('fs');var path=require(_0x2423('0x7'));var rimraf=require(_0x2423('0x8'));var config=require(_0x2423('0x9'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x2423('0xa')]=function(_0x2c4523,_0x3b95f3){return _0x2c4523[_0x2423('0xb')](_0x2423('0xc'),attributes,{'tableName':_0x2423('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc481=['define','int_salesforce_configurations','lodash','bluebird','request-promise','path','./intSalesforceConfiguration.attributes','exports'];(function(_0x5a6602,_0x365b9c){var _0x3ed51d=function(_0xfa7770){while(--_0xfa7770){_0x5a6602['push'](_0x5a6602['shift']());}};_0x3ed51d(++_0x365b9c);}(_0xc481,0x152));var _0x1c48=function(_0x64a51,_0x1c61b7){_0x64a51=_0x64a51-0x0;var _0x1eba45=_0xc481[_0x64a51];return _0x1eba45;};'use strict';var _=require(_0x1c48('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1c48('0x1'));var rp=require(_0x1c48('0x2'));var fs=require('fs');var path=require(_0x1c48('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1c48('0x4'));module[_0x1c48('0x5')]=function(_0x57e8cb,_0x13177a){return _0x57e8cb[_0x1c48('0x6')]('SalesforceConfiguration',attributes,{'tableName':_0x1c48('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 896f0ed..87490fb 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 _0xe4dc=['SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug'];(function(_0x2079f9,_0x5ee952){var _0x2bb75a=function(_0x2199b2){while(--_0x2199b2){_0x2079f9['push'](_0x2079f9['shift']());}};_0x2bb75a(++_0x5ee952);}(_0xe4dc,0x167));var _0xce4d=function(_0x5a8e42,_0x1bdf90){_0x5a8e42=_0x5a8e42-0x0;var _0x3939ef=_0xe4dc[_0x5a8e42];return _0x3939ef;};'use strict';var _=require(_0xce4d('0x0'));var util=require(_0xce4d('0x1'));var moment=require(_0xce4d('0x2'));var BPromise=require('bluebird');var rs=require(_0xce4d('0x3'));var fs=require('fs');var Redis=require(_0xce4d('0x4'));var db=require(_0xce4d('0x5'))['db'];var utils=require(_0xce4d('0x6'));var logger=require(_0xce4d('0x7'))('rpc');var config=require(_0xce4d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xce4d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47363f,_0xde308d,_0x3b8504){return new BPromise(function(_0x464019,_0x168c7f){return client[_0xce4d('0xa')](_0x47363f,_0x3b8504)[_0xce4d('0xb')](function(_0x4df6d5){logger[_0xce4d('0xc')](_0xce4d('0xd'),_0xde308d,'request\x20sent');logger[_0xce4d('0xe')](_0xce4d('0xf'),_0xde308d,_0xce4d('0x10'),JSON[_0xce4d('0x11')](_0x4df6d5));if(_0x4df6d5['error']){if(_0x4df6d5[_0xce4d('0x12')][_0xce4d('0x13')]===0x1f4){logger[_0xce4d('0x12')](_0xce4d('0xd'),_0xde308d,_0x4df6d5[_0xce4d('0x12')]['message']);return _0x168c7f(_0x4df6d5[_0xce4d('0x12')][_0xce4d('0x14')]);}logger['error'](_0xce4d('0xd'),_0xde308d,_0x4df6d5['error'][_0xce4d('0x14')]);return _0x464019(_0x4df6d5[_0xce4d('0x12')][_0xce4d('0x14')]);}else{logger[_0xce4d('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0xde308d,'request\x20sent');_0x464019(_0x4df6d5['result'][_0xce4d('0x14')]);}})[_0xce4d('0x15')](function(_0x3a94f8){logger['error'](_0xce4d('0xd'),_0xde308d,_0x3a94f8);_0x168c7f(_0x3a94f8);});});} \ No newline at end of file +var _0x07e0=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird'];(function(_0x2881c5,_0x1aaeec){var _0x4b48a9=function(_0x26e8b4){while(--_0x26e8b4){_0x2881c5['push'](_0x2881c5['shift']());}};_0x4b48a9(++_0x1aaeec);}(_0x07e0,0x153));var _0x007e=function(_0x5dd62d,_0x558773){_0x5dd62d=_0x5dd62d-0x0;var _0x327413=_0x07e0[_0x5dd62d];return _0x327413;};'use strict';var _=require(_0x007e('0x0'));var util=require(_0x007e('0x1'));var moment=require('moment');var BPromise=require(_0x007e('0x2'));var rs=require(_0x007e('0x3'));var fs=require('fs');var Redis=require(_0x007e('0x4'));var db=require(_0x007e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x007e('0x6'))(_0x007e('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x468846,_0x33d873,_0xe5372d){return new BPromise(function(_0x2fbb1c,_0xc1cd47){return client[_0x007e('0x8')](_0x468846,_0xe5372d)[_0x007e('0x9')](function(_0x9293b9){logger[_0x007e('0xa')](_0x007e('0xb'),_0x33d873,'request\x20sent');logger['debug'](_0x007e('0xc'),_0x33d873,_0x007e('0xd'),JSON[_0x007e('0xe')](_0x9293b9));if(_0x9293b9['error']){if(_0x9293b9[_0x007e('0xf')][_0x007e('0x10')]===0x1f4){logger[_0x007e('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x33d873,_0x9293b9[_0x007e('0xf')][_0x007e('0x11')]);return _0xc1cd47(_0x9293b9[_0x007e('0xf')][_0x007e('0x11')]);}logger[_0x007e('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x33d873,_0x9293b9[_0x007e('0xf')][_0x007e('0x11')]);return _0x2fbb1c(_0x9293b9[_0x007e('0xf')][_0x007e('0x11')]);}else{logger[_0x007e('0xa')]('SalesforceConfiguration,\x20%s,\x20%s',_0x33d873,'request\x20sent');_0x2fbb1c(_0x9293b9['result'][_0x007e('0x11')]);}})[_0x007e('0x12')](function(_0x589188){logger[_0x007e('0xf')](_0x007e('0xb'),_0x33d873,_0x589188);_0xc1cd47(_0x589188);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 74a88f2..01ef5db 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 _0xd634=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','index','/:id','isAuthenticated','show','create','put','update','destroy'];(function(_0x5c85ef,_0x151652){var _0x55675a=function(_0x449ad4){while(--_0x449ad4){_0x5c85ef['push'](_0x5c85ef['shift']());}};_0x55675a(++_0x151652);}(_0xd634,0x7f));var _0x4d63=function(_0x3b594b,_0x5835c3){_0x3b594b=_0x3b594b-0x0;var _0x1ea5f8=_0xd634[_0x3b594b];return _0x1ea5f8;};'use strict';var multer=require(_0x4d63('0x0'));var util=require(_0x4d63('0x1'));var path=require(_0x4d63('0x2'));var timeout=require(_0x4d63('0x3'));var express=require(_0x4d63('0x4'));var router=express[_0x4d63('0x5')]();var fs_extra=require(_0x4d63('0x6'));var auth=require(_0x4d63('0x7'));var interaction=require(_0x4d63('0x8'));var config=require(_0x4d63('0x9'));var controller=require(_0x4d63('0xa'));router[_0x4d63('0xb')]('/',auth['isAuthenticated'](),controller[_0x4d63('0xc')]);router[_0x4d63('0xb')](_0x4d63('0xd'),auth[_0x4d63('0xe')](),controller[_0x4d63('0xf')]);router['post']('/',auth[_0x4d63('0xe')](),controller[_0x4d63('0x10')]);router[_0x4d63('0x11')](_0x4d63('0xd'),auth['isAuthenticated'](),controller[_0x4d63('0x12')]);router['delete']('/:id',auth[_0x4d63('0xe')](),controller[_0x4d63('0x13')]);module[_0x4d63('0x14')]=router; \ No newline at end of file +var _0x9f32=['isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','get'];(function(_0x4d3835,_0x4f5f50){var _0x823439=function(_0x25a5c6){while(--_0x25a5c6){_0x4d3835['push'](_0x4d3835['shift']());}};_0x823439(++_0x4f5f50);}(_0x9f32,0x109));var _0x29f3=function(_0x2afe1c,_0x1c454c){_0x2afe1c=_0x2afe1c-0x0;var _0x4ad077=_0x9f32[_0x2afe1c];return _0x4ad077;};'use strict';var multer=require(_0x29f3('0x0'));var util=require(_0x29f3('0x1'));var path=require('path');var timeout=require(_0x29f3('0x2'));var express=require('express');var router=express[_0x29f3('0x3')]();var fs_extra=require(_0x29f3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x29f3('0x5'));var config=require('../../config/environment');var controller=require('./intSalesforceField.controller');router[_0x29f3('0x6')]('/',auth[_0x29f3('0x7')](),controller[_0x29f3('0x8')]);router['get'](_0x29f3('0x9'),auth[_0x29f3('0x7')](),controller[_0x29f3('0xa')]);router[_0x29f3('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x29f3('0xc')]('/:id',auth[_0x29f3('0x7')](),controller[_0x29f3('0xd')]);router[_0x29f3('0xe')](_0x29f3('0x9'),auth[_0x29f3('0x7')](),controller[_0x29f3('0xf')]);module[_0x29f3('0x10')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 9741938..4a35eba 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 _0xad89=['keyValue','picklist','string','STRING','ENUM','variable','customVariable'];(function(_0x6dc86a,_0x2aad2f){var _0x5cb20e=function(_0x46c55f){while(--_0x46c55f){_0x6dc86a['push'](_0x6dc86a['shift']());}};_0x5cb20e(++_0x2aad2f);}(_0xad89,0x11c));var _0x9ad8=function(_0x1ee9a1,_0x5f1434){_0x1ee9a1=_0x1ee9a1-0x0;var _0x21270f=_0xad89[_0x1ee9a1];return _0x21270f;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x9ad8('0x0')]('string',_0x9ad8('0x1'),_0x9ad8('0x2'),_0x9ad8('0x3'),_0x9ad8('0x4')),'defaultValue':_0x9ad8('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9ad8('0x6')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x9ad8('0x2'))},'keyContent':{'type':Sequelize[_0x9ad8('0x6')]},'idField':{'type':Sequelize[_0x9ad8('0x6')]},'variableName':{'type':Sequelize[_0x9ad8('0x6')]}}; \ No newline at end of file +var _0xbfb7=['STRING','variable','exports','ENUM','string','customVariable','keyValue','picklist'];(function(_0x4a8434,_0x2a8e34){var _0x1e5341=function(_0x112ed7){while(--_0x112ed7){_0x4a8434['push'](_0x4a8434['shift']());}};_0x1e5341(++_0x2a8e34);}(_0xbfb7,0x19a));var _0x7bfb=function(_0x171520,_0x1cee8c){_0x171520=_0x171520-0x0;var _0x3cc729=_0xbfb7[_0x171520];return _0x3cc729;};'use strict';var Sequelize=require('sequelize');module[_0x7bfb('0x0')]={'type':{'type':Sequelize[_0x7bfb('0x1')](_0x7bfb('0x2'),'variable',_0x7bfb('0x3'),_0x7bfb('0x4'),_0x7bfb('0x5')),'defaultValue':_0x7bfb('0x2')},'content':{'type':Sequelize[_0x7bfb('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0x7bfb('0x7'),_0x7bfb('0x3'))},'keyContent':{'type':Sequelize[_0x7bfb('0x6')]},'idField':{'type':Sequelize[_0x7bfb('0x6')]},'variableName':{'type':Sequelize[_0x7bfb('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 7b99dcc..eae9938 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 _0x4e1a=['rows','show','include','find','catch','create','body','params','eml-format','zip-dir','fast-json-patch','moment','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','index','map','SalesforceField','rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll'];(function(_0x515ef2,_0x19dfa0){var _0x564aa7=function(_0x1b7fa9){while(--_0x1b7fa9){_0x515ef2['push'](_0x515ef2['shift']());}};_0x564aa7(++_0x19dfa0);}(_0x4e1a,0x1cf));var _0xa4e1=function(_0x427b84,_0xcd6a51){_0x427b84=_0x427b84-0x0;var _0x2b8116=_0x4e1a[_0x427b84];return _0x2b8116;};'use strict';var emlformat=require(_0xa4e1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa4e1('0x1'));var jsonpatch=require(_0xa4e1('0x2'));var rp=require('request-promise');var moment=require(_0xa4e1('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xa4e1('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa4e1('0x5'));var _=require(_0xa4e1('0x6'));var squel=require(_0xa4e1('0x7'));var crypto=require(_0xa4e1('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xa4e1('0x9'));var toCsv=require(_0xa4e1('0x4'));var querystring=require(_0xa4e1('0xa'));var Papa=require(_0xa4e1('0xb'));var Redis=require(_0xa4e1('0xc'));var authService=require(_0xa4e1('0xd'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa4e1('0xe'));var logger=require(_0xa4e1('0xf'))('api');var utils=require('../../config/utils');var config=require(_0xa4e1('0x10'));var licenseUtil=require(_0xa4e1('0x11'));var db=require(_0xa4e1('0x12'))['db'];function respondWithStatusCode(_0x4e147d,_0x311748){_0x311748=_0x311748||0xcc;return function(_0x48cc29){if(_0x48cc29){return _0x4e147d['sendStatus'](_0x311748);}return _0x4e147d[_0xa4e1('0x13')](_0x311748)[_0xa4e1('0x14')]();};}function respondWithResult(_0x5a6d24,_0x41b1fa){_0x41b1fa=_0x41b1fa||0xc8;return function(_0x583fa6){if(_0x583fa6){return _0x5a6d24['status'](_0x41b1fa)[_0xa4e1('0x15')](_0x583fa6);}};}function respondWithFilteredResult(_0x4cf6b7,_0x3d5fd9){return function(_0x5f1c9b){if(_0x5f1c9b){var _0x7e01dd=typeof _0x3d5fd9[_0xa4e1('0x16')]==='undefined'&&typeof _0x3d5fd9['limit']===_0xa4e1('0x17');var _0x41c0da=_0x5f1c9b[_0xa4e1('0x18')];var _0x2c7f28=_0x7e01dd?0x0:_0x3d5fd9[_0xa4e1('0x16')];var _0x3b5bc3=_0x7e01dd?_0x5f1c9b[_0xa4e1('0x18')]:_0x3d5fd9[_0xa4e1('0x16')]+_0x3d5fd9[_0xa4e1('0x19')];var _0x3c0d8a;if(_0x3b5bc3>=_0x41c0da){_0x3b5bc3=_0x41c0da;_0x3c0d8a=0xc8;}else{_0x3c0d8a=0xce;}_0x4cf6b7['status'](_0x3c0d8a);return _0x4cf6b7['set'](_0xa4e1('0x1a'),_0x2c7f28+'-'+_0x3b5bc3+'/'+_0x41c0da)[_0xa4e1('0x15')](_0x5f1c9b);}return null;};}function patchUpdates(_0x5f2146){return function(_0x42be0a){try{jsonpatch['apply'](_0x42be0a,_0x5f2146,!![]);}catch(_0x5bc178){return BPromise['reject'](_0x5bc178);}return _0x42be0a['save']();};}function saveUpdates(_0x2824ab,_0x50ed06){return function(_0x4cd1f3){if(_0x4cd1f3){return _0x4cd1f3[_0xa4e1('0x1b')](_0x2824ab)[_0xa4e1('0x1c')](function(_0x8ef957){return _0x8ef957;});}return null;};}function removeEntity(_0x3cf19d,_0x694866){return function(_0x518d42){if(_0x518d42){return _0x518d42[_0xa4e1('0x1d')]()['then'](function(){_0x3cf19d[_0xa4e1('0x13')](0xcc)[_0xa4e1('0x14')]();});}};}function handleEntityNotFound(_0x38ea67,_0xc5298){return function(_0x30dd93){if(!_0x30dd93){_0x38ea67[_0xa4e1('0x1e')](0x194);}return _0x30dd93;};}function handleError(_0x5340d4,_0x5e3f8e){_0x5e3f8e=_0x5e3f8e||0x1f4;return function(_0x45c28d){logger[_0xa4e1('0x1f')](_0x45c28d[_0xa4e1('0x20')]);if(_0x45c28d[_0xa4e1('0x21')]){delete _0x45c28d[_0xa4e1('0x21')];}_0x5340d4[_0xa4e1('0x13')](_0x5e3f8e)[_0xa4e1('0x22')](_0x45c28d);};}exports[_0xa4e1('0x23')]=function(_0x4cc8cc,_0x47d7f3){var _0x284942={},_0x14dafd={},_0x213b20={'count':0x0,'rows':[]};var _0x4e72bc=_[_0xa4e1('0x24')](db[_0xa4e1('0x25')][_0xa4e1('0x26')],function(_0x486105){return{'name':_0x486105['fieldName'],'type':_0x486105[_0xa4e1('0x27')]['key']};});_0x14dafd['model']=_[_0xa4e1('0x24')](_0x4e72bc,'name');_0x14dafd[_0xa4e1('0x28')]=_[_0xa4e1('0x29')](_0x4cc8cc[_0xa4e1('0x28')]);_0x14dafd[_0xa4e1('0x2a')]=_[_0xa4e1('0x2b')](_0x14dafd[_0xa4e1('0x2c')],_0x14dafd[_0xa4e1('0x28')]);_0x284942['attributes']=_['intersection'](_0x14dafd['model'],qs[_0xa4e1('0x2d')](_0x4cc8cc[_0xa4e1('0x28')][_0xa4e1('0x2d')]));_0x284942[_0xa4e1('0x2e')]=_0x284942['attributes'][_0xa4e1('0x2f')]?_0x284942[_0xa4e1('0x2e')]:_0x14dafd['model'];if(!_0x4cc8cc['query']['hasOwnProperty'](_0xa4e1('0x30'))){_0x284942[_0xa4e1('0x19')]=qs[_0xa4e1('0x19')](_0x4cc8cc[_0xa4e1('0x28')]['limit']);_0x284942['offset']=qs['offset'](_0x4cc8cc[_0xa4e1('0x28')][_0xa4e1('0x16')]);}_0x284942[_0xa4e1('0x31')]=qs['sort'](_0x4cc8cc[_0xa4e1('0x28')][_0xa4e1('0x32')]);_0x284942[_0xa4e1('0x33')]=qs[_0xa4e1('0x2a')](_['pick'](_0x4cc8cc[_0xa4e1('0x28')],_0x14dafd[_0xa4e1('0x2a')]),_0x4e72bc);if(_0x4cc8cc[_0xa4e1('0x28')][_0xa4e1('0x34')]){_0x284942[_0xa4e1('0x33')]=_[_0xa4e1('0x35')](_0x284942[_0xa4e1('0x33')],{'$or':_[_0xa4e1('0x24')](_0x4e72bc,function(_0x585074){if(_0x585074[_0xa4e1('0x27')]!==_0xa4e1('0x36')){var _0x2d0831={};_0x2d0831[_0x585074['name']]={'$like':'%'+_0x4cc8cc[_0xa4e1('0x28')][_0xa4e1('0x34')]+'%'};return _0x2d0831;}})});}_0x284942=_[_0xa4e1('0x35')]({},_0x284942,_0x4cc8cc[_0xa4e1('0x37')]);var _0x3ae20e={'where':_0x284942['where']};return db[_0xa4e1('0x25')][_0xa4e1('0x18')](_0x3ae20e)['then'](function(_0x590a15){_0x213b20[_0xa4e1('0x18')]=_0x590a15;if(_0x4cc8cc[_0xa4e1('0x28')][_0xa4e1('0x38')]){_0x284942['include']=[{'all':!![]}];}return db[_0xa4e1('0x25')]['findAll'](_0x284942);})[_0xa4e1('0x1c')](function(_0x5ea04f){_0x213b20[_0xa4e1('0x39')]=_0x5ea04f;return _0x213b20;})[_0xa4e1('0x1c')](respondWithFilteredResult(_0x47d7f3,_0x284942))['catch'](handleError(_0x47d7f3,null));};exports[_0xa4e1('0x3a')]=function(_0x442919,_0x43d324){var _0xf4336b={'raw':!![],'where':{'id':_0x442919['params']['id']}},_0x5a2a8e={};_0x5a2a8e[_0xa4e1('0x2c')]=_[_0xa4e1('0x29')](db[_0xa4e1('0x25')][_0xa4e1('0x26')]);_0x5a2a8e['query']=_[_0xa4e1('0x29')](_0x442919['query']);_0x5a2a8e[_0xa4e1('0x2a')]=_[_0xa4e1('0x2b')](_0x5a2a8e['model'],_0x5a2a8e[_0xa4e1('0x28')]);_0xf4336b[_0xa4e1('0x2e')]=_[_0xa4e1('0x2b')](_0x5a2a8e[_0xa4e1('0x2c')],qs[_0xa4e1('0x2d')](_0x442919[_0xa4e1('0x28')][_0xa4e1('0x2d')]));_0xf4336b[_0xa4e1('0x2e')]=_0xf4336b[_0xa4e1('0x2e')][_0xa4e1('0x2f')]?_0xf4336b[_0xa4e1('0x2e')]:_0x5a2a8e['model'];if(_0x442919[_0xa4e1('0x28')][_0xa4e1('0x38')]){_0xf4336b[_0xa4e1('0x3b')]=[{'all':!![]}];}_0xf4336b=_['merge']({},_0xf4336b,_0x442919[_0xa4e1('0x37')]);return db[_0xa4e1('0x25')][_0xa4e1('0x3c')](_0xf4336b)[_0xa4e1('0x1c')](handleEntityNotFound(_0x43d324,null))['then'](respondWithResult(_0x43d324,null))[_0xa4e1('0x3d')](handleError(_0x43d324,null));};exports['create']=function(_0x1a9090,_0x4963d9){return db[_0xa4e1('0x25')][_0xa4e1('0x3e')](_0x1a9090['body'],{})['then'](respondWithResult(_0x4963d9,0xc9))[_0xa4e1('0x3d')](handleError(_0x4963d9,null));};exports[_0xa4e1('0x1b')]=function(_0x12757d,_0x4c5cc2){if(_0x12757d[_0xa4e1('0x3f')]['id']){delete _0x12757d[_0xa4e1('0x3f')]['id'];}return db[_0xa4e1('0x25')][_0xa4e1('0x3c')]({'where':{'id':_0x12757d[_0xa4e1('0x40')]['id']}})[_0xa4e1('0x1c')](handleEntityNotFound(_0x4c5cc2,null))['then'](saveUpdates(_0x12757d['body'],null))['then'](respondWithResult(_0x4c5cc2,null))[_0xa4e1('0x3d')](handleError(_0x4c5cc2,null));};exports['destroy']=function(_0x301533,_0x27b2c9){return db[_0xa4e1('0x25')][_0xa4e1('0x3c')]({'where':{'id':_0x301533[_0xa4e1('0x40')]['id']}})[_0xa4e1('0x1c')](handleEntityNotFound(_0x27b2c9,null))[_0xa4e1('0x1c')](removeEntity(_0x27b2c9,null))[_0xa4e1('0x3d')](handleError(_0x27b2c9,null));}; \ No newline at end of file +var _0xa2d1=['reject','update','then','error','stack','name','send','index','map','SalesforceField','fieldName','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','filters','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','params','rawAttributes','find','create','body','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x14e0db,_0x5d8a5c){var _0x166fe3=function(_0x4deda2){while(--_0x4deda2){_0x14e0db['push'](_0x14e0db['shift']());}};_0x166fe3(++_0x5d8a5c);}(_0xa2d1,0x72));var _0x1a2d=function(_0x13844e,_0x14d041){_0x13844e=_0x13844e-0x0;var _0x5183b0=_0xa2d1[_0x13844e];return _0x5183b0;};'use strict';var emlformat=require(_0x1a2d('0x0'));var rimraf=require(_0x1a2d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1a2d('0x2'));var rp=require(_0x1a2d('0x3'));var moment=require(_0x1a2d('0x4'));var BPromise=require(_0x1a2d('0x5'));var Mustache=require('mustache');var util=require(_0x1a2d('0x6'));var path=require(_0x1a2d('0x7'));var sox=require(_0x1a2d('0x8'));var csv=require('to-csv');var ejs=require(_0x1a2d('0x9'));var fs=require('fs');var fs_extra=require(_0x1a2d('0xa'));var _=require(_0x1a2d('0xb'));var squel=require(_0x1a2d('0xc'));var crypto=require(_0x1a2d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1a2d('0xe'));var toCsv=require(_0x1a2d('0xf'));var querystring=require('querystring');var Papa=require(_0x1a2d('0x10'));var Redis=require(_0x1a2d('0x11'));var authService=require(_0x1a2d('0x12'));var qs=require(_0x1a2d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a2d('0x14'))(_0x1a2d('0x15'));var utils=require(_0x1a2d('0x16'));var config=require(_0x1a2d('0x17'));var licenseUtil=require(_0x1a2d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xa97623,_0x202b89){_0x202b89=_0x202b89||0xcc;return function(_0x5c7276){if(_0x5c7276){return _0xa97623[_0x1a2d('0x19')](_0x202b89);}return _0xa97623[_0x1a2d('0x1a')](_0x202b89)[_0x1a2d('0x1b')]();};}function respondWithResult(_0x40acc3,_0x288192){_0x288192=_0x288192||0xc8;return function(_0x5c40ca){if(_0x5c40ca){return _0x40acc3[_0x1a2d('0x1a')](_0x288192)[_0x1a2d('0x1c')](_0x5c40ca);}};}function respondWithFilteredResult(_0x13ea65,_0x4fa06b){return function(_0xb584a1){if(_0xb584a1){var _0x42405b=typeof _0x4fa06b[_0x1a2d('0x1d')]===_0x1a2d('0x1e')&&typeof _0x4fa06b[_0x1a2d('0x1f')]===_0x1a2d('0x1e');var _0x5c4336=_0xb584a1[_0x1a2d('0x20')];var _0x3533e9=_0x42405b?0x0:_0x4fa06b[_0x1a2d('0x1d')];var _0x2fac2d=_0x42405b?_0xb584a1[_0x1a2d('0x20')]:_0x4fa06b[_0x1a2d('0x1d')]+_0x4fa06b[_0x1a2d('0x1f')];var _0x537deb;if(_0x2fac2d>=_0x5c4336){_0x2fac2d=_0x5c4336;_0x537deb=0xc8;}else{_0x537deb=0xce;}_0x13ea65[_0x1a2d('0x1a')](_0x537deb);return _0x13ea65[_0x1a2d('0x21')](_0x1a2d('0x22'),_0x3533e9+'-'+_0x2fac2d+'/'+_0x5c4336)[_0x1a2d('0x1c')](_0xb584a1);}return null;};}function patchUpdates(_0x344ee7){return function(_0x1aefd6){try{jsonpatch[_0x1a2d('0x23')](_0x1aefd6,_0x344ee7,!![]);}catch(_0x2be277){return BPromise[_0x1a2d('0x24')](_0x2be277);}return _0x1aefd6['save']();};}function saveUpdates(_0x4bd86a,_0x2109ec){return function(_0x12a33c){if(_0x12a33c){return _0x12a33c[_0x1a2d('0x25')](_0x4bd86a)[_0x1a2d('0x26')](function(_0x521431){return _0x521431;});}return null;};}function removeEntity(_0x439e39,_0x4a5f9d){return function(_0x317b36){if(_0x317b36){return _0x317b36['destroy']()[_0x1a2d('0x26')](function(){_0x439e39[_0x1a2d('0x1a')](0xcc)[_0x1a2d('0x1b')]();});}};}function handleEntityNotFound(_0x5afb6f,_0x503d){return function(_0x12c419){if(!_0x12c419){_0x5afb6f[_0x1a2d('0x19')](0x194);}return _0x12c419;};}function handleError(_0x4e30bd,_0xd03048){_0xd03048=_0xd03048||0x1f4;return function(_0xdff27e){logger[_0x1a2d('0x27')](_0xdff27e[_0x1a2d('0x28')]);if(_0xdff27e['name']){delete _0xdff27e[_0x1a2d('0x29')];}_0x4e30bd['status'](_0xd03048)[_0x1a2d('0x2a')](_0xdff27e);};}exports[_0x1a2d('0x2b')]=function(_0x1c8857,_0x5bc5fa){var _0x19676f={},_0x591f66={},_0x4b3b09={'count':0x0,'rows':[]};var _0x42f2d4=_[_0x1a2d('0x2c')](db[_0x1a2d('0x2d')]['rawAttributes'],function(_0x21ad83){return{'name':_0x21ad83[_0x1a2d('0x2e')],'type':_0x21ad83['type'][_0x1a2d('0x2f')]};});_0x591f66[_0x1a2d('0x30')]=_[_0x1a2d('0x2c')](_0x42f2d4,_0x1a2d('0x29'));_0x591f66[_0x1a2d('0x31')]=_[_0x1a2d('0x32')](_0x1c8857[_0x1a2d('0x31')]);_0x591f66['filters']=_['intersection'](_0x591f66['model'],_0x591f66[_0x1a2d('0x31')]);_0x19676f[_0x1a2d('0x33')]=_[_0x1a2d('0x34')](_0x591f66[_0x1a2d('0x30')],qs[_0x1a2d('0x35')](_0x1c8857[_0x1a2d('0x31')][_0x1a2d('0x35')]));_0x19676f[_0x1a2d('0x33')]=_0x19676f[_0x1a2d('0x33')][_0x1a2d('0x36')]?_0x19676f[_0x1a2d('0x33')]:_0x591f66[_0x1a2d('0x30')];if(!_0x1c8857[_0x1a2d('0x31')]['hasOwnProperty'](_0x1a2d('0x37'))){_0x19676f[_0x1a2d('0x1f')]=qs[_0x1a2d('0x1f')](_0x1c8857[_0x1a2d('0x31')][_0x1a2d('0x1f')]);_0x19676f[_0x1a2d('0x1d')]=qs[_0x1a2d('0x1d')](_0x1c8857[_0x1a2d('0x31')]['offset']);}_0x19676f[_0x1a2d('0x38')]=qs[_0x1a2d('0x39')](_0x1c8857[_0x1a2d('0x31')][_0x1a2d('0x39')]);_0x19676f['where']=qs[_0x1a2d('0x3a')](_[_0x1a2d('0x3b')](_0x1c8857[_0x1a2d('0x31')],_0x591f66[_0x1a2d('0x3a')]),_0x42f2d4);if(_0x1c8857[_0x1a2d('0x31')][_0x1a2d('0x3c')]){_0x19676f[_0x1a2d('0x3d')]=_['merge'](_0x19676f[_0x1a2d('0x3d')],{'$or':_['map'](_0x42f2d4,function(_0x26f888){if(_0x26f888[_0x1a2d('0x3e')]!==_0x1a2d('0x3f')){var _0x4f3f55={};_0x4f3f55[_0x26f888[_0x1a2d('0x29')]]={'$like':'%'+_0x1c8857['query'][_0x1a2d('0x3c')]+'%'};return _0x4f3f55;}})});}_0x19676f=_[_0x1a2d('0x40')]({},_0x19676f,_0x1c8857[_0x1a2d('0x41')]);var _0x1bf235={'where':_0x19676f[_0x1a2d('0x3d')]};return db[_0x1a2d('0x2d')][_0x1a2d('0x20')](_0x1bf235)[_0x1a2d('0x26')](function(_0x541daf){_0x4b3b09[_0x1a2d('0x20')]=_0x541daf;if(_0x1c8857[_0x1a2d('0x31')][_0x1a2d('0x42')]){_0x19676f[_0x1a2d('0x43')]=[{'all':!![]}];}return db['SalesforceField'][_0x1a2d('0x44')](_0x19676f);})[_0x1a2d('0x26')](function(_0x2c453b){_0x4b3b09['rows']=_0x2c453b;return _0x4b3b09;})['then'](respondWithFilteredResult(_0x5bc5fa,_0x19676f))['catch'](handleError(_0x5bc5fa,null));};exports['show']=function(_0x2eb895,_0x485373){var _0x5666ae={'raw':!![],'where':{'id':_0x2eb895[_0x1a2d('0x45')]['id']}},_0x4aee8e={};_0x4aee8e[_0x1a2d('0x30')]=_['keys'](db[_0x1a2d('0x2d')][_0x1a2d('0x46')]);_0x4aee8e[_0x1a2d('0x31')]=_[_0x1a2d('0x32')](_0x2eb895[_0x1a2d('0x31')]);_0x4aee8e[_0x1a2d('0x3a')]=_[_0x1a2d('0x34')](_0x4aee8e[_0x1a2d('0x30')],_0x4aee8e[_0x1a2d('0x31')]);_0x5666ae[_0x1a2d('0x33')]=_[_0x1a2d('0x34')](_0x4aee8e[_0x1a2d('0x30')],qs[_0x1a2d('0x35')](_0x2eb895['query']['fields']));_0x5666ae[_0x1a2d('0x33')]=_0x5666ae['attributes'][_0x1a2d('0x36')]?_0x5666ae['attributes']:_0x4aee8e[_0x1a2d('0x30')];if(_0x2eb895[_0x1a2d('0x31')][_0x1a2d('0x42')]){_0x5666ae[_0x1a2d('0x43')]=[{'all':!![]}];}_0x5666ae=_[_0x1a2d('0x40')]({},_0x5666ae,_0x2eb895[_0x1a2d('0x41')]);return db['SalesforceField'][_0x1a2d('0x47')](_0x5666ae)[_0x1a2d('0x26')](handleEntityNotFound(_0x485373,null))[_0x1a2d('0x26')](respondWithResult(_0x485373,null))['catch'](handleError(_0x485373,null));};exports[_0x1a2d('0x48')]=function(_0x23bc9e,_0x4e689d){return db[_0x1a2d('0x2d')][_0x1a2d('0x48')](_0x23bc9e[_0x1a2d('0x49')],{})[_0x1a2d('0x26')](respondWithResult(_0x4e689d,0xc9))['catch'](handleError(_0x4e689d,null));};exports[_0x1a2d('0x25')]=function(_0x4bdb2d,_0x36d64f){if(_0x4bdb2d['body']['id']){delete _0x4bdb2d[_0x1a2d('0x49')]['id'];}return db[_0x1a2d('0x2d')][_0x1a2d('0x47')]({'where':{'id':_0x4bdb2d[_0x1a2d('0x45')]['id']}})[_0x1a2d('0x26')](handleEntityNotFound(_0x36d64f,null))['then'](saveUpdates(_0x4bdb2d[_0x1a2d('0x49')],null))[_0x1a2d('0x26')](respondWithResult(_0x36d64f,null))[_0x1a2d('0x4a')](handleError(_0x36d64f,null));};exports['destroy']=function(_0x544d20,_0x3ae653){return db[_0x1a2d('0x2d')][_0x1a2d('0x47')]({'where':{'id':_0x544d20[_0x1a2d('0x45')]['id']}})[_0x1a2d('0x26')](handleEntityNotFound(_0x3ae653,null))[_0x1a2d('0x26')](removeEntity(_0x3ae653,null))['catch'](handleError(_0x3ae653,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 2f9aff7..47f7e2a 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 _0xa305=['../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util','api','moment','request-promise','path','rimraf'];(function(_0xe2c9bc,_0x11817c){var _0x593d41=function(_0x5ac269){while(--_0x5ac269){_0xe2c9bc['push'](_0xe2c9bc['shift']());}};_0x593d41(++_0x11817c);}(_0xa305,0x72));var _0x5a30=function(_0x2acdd5,_0x38cb93){_0x2acdd5=_0x2acdd5-0x0;var _0x279a99=_0xa305[_0x2acdd5];return _0x279a99;};'use strict';var _=require('lodash');var util=require(_0x5a30('0x0'));var logger=require('../../config/logger')(_0x5a30('0x1'));var moment=require(_0x5a30('0x2'));var BPromise=require('bluebird');var rp=require(_0x5a30('0x3'));var fs=require('fs');var path=require(_0x5a30('0x4'));var rimraf=require(_0x5a30('0x5'));var config=require(_0x5a30('0x6'));var attributes=require(_0x5a30('0x7'));module[_0x5a30('0x8')]=function(_0x7d7ff5,_0x3facc5){return _0x7d7ff5[_0x5a30('0x9')](_0x5a30('0xa'),attributes,{'tableName':_0x5a30('0xb'),'paranoid':![],'indexes':[{'name':_0x5a30('0xc'),'fields':[_0x5a30('0xd'),_0x5a30('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7bee=['idField','FieldId','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','define','SalesforceField','int_salesforce_fields','salesforce_unique_index'];(function(_0x4f9c62,_0x27dfa7){var _0x96cf03=function(_0x4f0fe0){while(--_0x4f0fe0){_0x4f9c62['push'](_0x4f9c62['shift']());}};_0x96cf03(++_0x27dfa7);}(_0x7bee,0x1af));var _0xe7be=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x7bee[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var util=require(_0xe7be('0x0'));var logger=require(_0xe7be('0x1'))('api');var moment=require(_0xe7be('0x2'));var BPromise=require(_0xe7be('0x3'));var rp=require(_0xe7be('0x4'));var fs=require('fs');var path=require(_0xe7be('0x5'));var rimraf=require(_0xe7be('0x6'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module['exports']=function(_0x33ebba,_0xb6b788){return _0x33ebba[_0xe7be('0x7')](_0xe7be('0x8'),attributes,{'tableName':_0xe7be('0x9'),'paranoid':![],'indexes':[{'name':_0xe7be('0xa'),'fields':[_0xe7be('0xb'),_0xe7be('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 0804109..ac66fd2 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 _0xf590=['result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x27f7a0,_0x45b025){var _0x3f0496=function(_0x581f7f){while(--_0x581f7f){_0x27f7a0['push'](_0x27f7a0['shift']());}};_0x3f0496(++_0x45b025);}(_0xf590,0x120));var _0x0f59=function(_0xff319d,_0x1dfdc0){_0xff319d=_0xff319d-0x0;var _0x4839c7=_0xf590[_0xff319d];return _0x4839c7;};'use strict';var _=require('lodash');var util=require(_0x0f59('0x0'));var moment=require(_0x0f59('0x1'));var BPromise=require(_0x0f59('0x2'));var rs=require(_0x0f59('0x3'));var fs=require('fs');var Redis=require(_0x0f59('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f59('0x5'));var logger=require('../../config/logger')(_0x0f59('0x6'));var config=require(_0x0f59('0x7'));var jayson=require(_0x0f59('0x8'));var client=jayson[_0x0f59('0x9')][_0x0f59('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51943c,_0x4d4fd0,_0x432a91){return new BPromise(function(_0xa5e9ba,_0x29d1eb){return client[_0x0f59('0xb')](_0x51943c,_0x432a91)['then'](function(_0x4135ba){logger[_0x0f59('0xc')](_0x0f59('0xd'),_0x4d4fd0,_0x0f59('0xe'));logger[_0x0f59('0xf')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x4d4fd0,_0x0f59('0xe'),JSON[_0x0f59('0x10')](_0x4135ba));if(_0x4135ba[_0x0f59('0x11')]){if(_0x4135ba[_0x0f59('0x11')][_0x0f59('0x12')]===0x1f4){logger[_0x0f59('0x11')]('SalesforceField,\x20%s,\x20%s',_0x4d4fd0,_0x4135ba['error'][_0x0f59('0x13')]);return _0x29d1eb(_0x4135ba['error']['message']);}logger['error']('SalesforceField,\x20%s,\x20%s',_0x4d4fd0,_0x4135ba['error']['message']);return _0xa5e9ba(_0x4135ba['error'][_0x0f59('0x13')]);}else{logger[_0x0f59('0xc')](_0x0f59('0xd'),_0x4d4fd0,'request\x20sent');_0xa5e9ba(_0x4135ba[_0x0f59('0x14')]['message']);}})[_0x0f59('0x15')](function(_0x2e0b83){logger['error'](_0x0f59('0xd'),_0x4d4fd0,_0x2e0b83);_0x29d1eb(_0x2e0b83);});});} \ No newline at end of file +var _0xf98f=['request','then','info','SalesforceField,\x20%s,\x20%s','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2a9407,_0x5d18e9){var _0x51f349=function(_0x32cbbb){while(--_0x32cbbb){_0x2a9407['push'](_0x2a9407['shift']());}};_0x51f349(++_0x5d18e9);}(_0xf98f,0x106));var _0xff98=function(_0x4d8f75,_0x15bf3f){_0x4d8f75=_0x4d8f75-0x0;var _0x3f5e61=_0xf98f[_0x4d8f75];return _0x3f5e61;};'use strict';var _=require(_0xff98('0x0'));var util=require(_0xff98('0x1'));var moment=require(_0xff98('0x2'));var BPromise=require(_0xff98('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xff98('0x4'));var db=require(_0xff98('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xff98('0x6'))(_0xff98('0x7'));var config=require(_0xff98('0x8'));var jayson=require(_0xff98('0x9'));var client=jayson[_0xff98('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b5cf9,_0x237be8,_0x194c24){return new BPromise(function(_0x3093c3,_0x30affd){return client[_0xff98('0xb')](_0x3b5cf9,_0x194c24)[_0xff98('0xc')](function(_0x1bbfb2){logger[_0xff98('0xd')](_0xff98('0xe'),_0x237be8,'request\x20sent');logger['debug'](_0xff98('0xf'),_0x237be8,_0xff98('0x10'),JSON[_0xff98('0x11')](_0x1bbfb2));if(_0x1bbfb2['error']){if(_0x1bbfb2[_0xff98('0x12')]['code']===0x1f4){logger['error'](_0xff98('0xe'),_0x237be8,_0x1bbfb2['error'][_0xff98('0x13')]);return _0x30affd(_0x1bbfb2[_0xff98('0x12')][_0xff98('0x13')]);}logger['error'](_0xff98('0xe'),_0x237be8,_0x1bbfb2[_0xff98('0x12')][_0xff98('0x13')]);return _0x3093c3(_0x1bbfb2['error'][_0xff98('0x13')]);}else{logger[_0xff98('0xd')](_0xff98('0xe'),_0x237be8,_0xff98('0x10'));_0x3093c3(_0x1bbfb2[_0xff98('0x14')][_0xff98('0x13')]);}})['catch'](function(_0xef3836){logger[_0xff98('0x12')](_0xff98('0xe'),_0x237be8,_0xef3836);_0x30affd(_0xef3836);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 9a09bfa..55e39f8 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 _0x3b59=['/:id/configurations','getConfigurations','getFields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','/:id'];(function(_0x31c478,_0x44056c){var _0x2a270a=function(_0x5bb5b6){while(--_0x5bb5b6){_0x31c478['push'](_0x31c478['shift']());}};_0x2a270a(++_0x44056c);}(_0x3b59,0x9c));var _0x93b5=function(_0x5b5b5f,_0x1d88f8){_0x5b5b5f=_0x5b5b5f-0x0;var _0x380741=_0x3b59[_0x5b5b5f];return _0x380741;};'use strict';var multer=require(_0x93b5('0x0'));var util=require(_0x93b5('0x1'));var path=require(_0x93b5('0x2'));var timeout=require(_0x93b5('0x3'));var express=require(_0x93b5('0x4'));var router=express[_0x93b5('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x93b5('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x93b5('0x7'));var controller=require(_0x93b5('0x8'));router[_0x93b5('0x9')]('/',auth[_0x93b5('0xa')](),controller['index']);router[_0x93b5('0x9')](_0x93b5('0xb'),auth[_0x93b5('0xa')](),controller['show']);router[_0x93b5('0x9')](_0x93b5('0xc'),auth[_0x93b5('0xa')](),controller[_0x93b5('0xd')]);router[_0x93b5('0x9')]('/:id/fields',auth[_0x93b5('0xa')](),controller[_0x93b5('0xe')]);router[_0x93b5('0xf')]('/',auth[_0x93b5('0xa')](),controller[_0x93b5('0x10')]);router['post'](_0x93b5('0xc'),auth[_0x93b5('0xa')](),controller['addConfiguration']);router[_0x93b5('0x11')](_0x93b5('0xb'),auth[_0x93b5('0xa')](),controller[_0x93b5('0x12')]);router[_0x93b5('0x13')]('/:id',auth[_0x93b5('0xa')](),controller[_0x93b5('0x14')]);module['exports']=router; \ No newline at end of file +var _0xce56=['connect-timeout','Router','../../config/environment','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x58eed6,_0x49a046){var _0x381fa7=function(_0x1ebf98){while(--_0x1ebf98){_0x58eed6['push'](_0x58eed6['shift']());}};_0x381fa7(++_0x49a046);}(_0xce56,0x173));var _0x6ce5=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0xce56[_0x3899d1];return _0xeb4a7d;};'use strict';var multer=require(_0x6ce5('0x0'));var util=require(_0x6ce5('0x1'));var path=require(_0x6ce5('0x2'));var timeout=require(_0x6ce5('0x3'));var express=require('express');var router=express[_0x6ce5('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6ce5('0x5'));var controller=require('./intServicenowAccount.controller');router[_0x6ce5('0x6')]('/',auth[_0x6ce5('0x7')](),controller['index']);router[_0x6ce5('0x6')](_0x6ce5('0x8'),auth['isAuthenticated'](),controller[_0x6ce5('0x9')]);router['get'](_0x6ce5('0xa'),auth[_0x6ce5('0x7')](),controller[_0x6ce5('0xb')]);router[_0x6ce5('0x6')](_0x6ce5('0xc'),auth[_0x6ce5('0x7')](),controller[_0x6ce5('0xd')]);router[_0x6ce5('0xe')]('/',auth['isAuthenticated'](),controller[_0x6ce5('0xf')]);router[_0x6ce5('0xe')](_0x6ce5('0xa'),auth[_0x6ce5('0x7')](),controller[_0x6ce5('0x10')]);router[_0x6ce5('0x11')]('/:id',auth[_0x6ce5('0x7')](),controller[_0x6ce5('0x12')]);router[_0x6ce5('0x13')](_0x6ce5('0x8'),auth[_0x6ce5('0x7')](),controller[_0x6ce5('0x14')]);module[_0x6ce5('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index f43ac13..5c62f19 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 _0xa426=['remoteUri','sequelize','STRING','username'];(function(_0x582bd7,_0xc3c370){var _0x188b98=function(_0x3a861a){while(--_0x3a861a){_0x582bd7['push'](_0x582bd7['shift']());}};_0x188b98(++_0xc3c370);}(_0xa426,0x121));var _0x6a42=function(_0x35885a,_0x42fed7){_0x35885a=_0x35885a-0x0;var _0xe86249=_0xa426[_0x35885a];return _0xe86249;};'use strict';var Sequelize=require(_0x6a42('0x0'));module['exports']={'name':{'type':Sequelize[_0x6a42('0x1')]},'description':{'type':Sequelize[_0x6a42('0x1')]},'username':{'type':Sequelize[_0x6a42('0x1')],'unique':_0x6a42('0x2')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x6a42('0x1')]},'remoteUri':{'type':Sequelize[_0x6a42('0x1')],'unique':_0x6a42('0x3')},'serverUrl':{'type':Sequelize[_0x6a42('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xc337=['exports','STRING','username','remoteUri','sequelize'];(function(_0x45835f,_0x45e562){var _0x437c3d=function(_0x1f0b9c){while(--_0x1f0b9c){_0x45835f['push'](_0x45835f['shift']());}};_0x437c3d(++_0x45e562);}(_0xc337,0xe0));var _0x7c33=function(_0x1d2f1d,_0x449946){_0x1d2f1d=_0x1d2f1d-0x0;var _0xc52508=_0xc337[_0x1d2f1d];return _0xc52508;};'use strict';var Sequelize=require(_0x7c33('0x0'));module[_0x7c33('0x1')]={'name':{'type':Sequelize[_0x7c33('0x2')]},'description':{'type':Sequelize[_0x7c33('0x2')]},'username':{'type':Sequelize[_0x7c33('0x2')],'unique':_0x7c33('0x3')},'password':{'type':Sequelize[_0x7c33('0x2')]},'email':{'type':Sequelize[_0x7c33('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x7c33('0x4')},'serverUrl':{'type':Sequelize[_0x7c33('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index e55b793..0f68cc1 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 _0x315e=['sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','username','email','remoteUri','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','password','incident?sysparm_display_value=all','result','log','incident\x20table\x20objects','assign','remove','includes','internalType','label','push','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','all','concat','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','False','false','GET','sys_choice?sysparm_query=name=incident^element=','inactive','value','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','jsforce','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','index','ServicenowAccount','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','filter','merge','map','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','destroy','getConfigurations','ServicenowConfiguration','length','order','pick','nolimit','findOne','Subjects','getSubjects','channel','getDescriptions','ServicenowField','getFields','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','caused_by','upon_reject','sys_updated_on','hold_reason','approval_history','number','resolved_by','user_input','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','reopened_by','urgency','problem_id','reassignment_count','activity_due','assigned_to'];(function(_0x305016,_0x22a150){var _0x296b99=function(_0x3fa9b8){while(--_0x3fa9b8){_0x305016['push'](_0x305016['shift']());}};_0x296b99(++_0x22a150);}(_0x315e,0xe1));var _0xe315=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x315e[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe315('0x0'));var zipdir=require(_0xe315('0x1'));var jsonpatch=require(_0xe315('0x2'));var rp=require(_0xe315('0x3'));var moment=require(_0xe315('0x4'));var BPromise=require(_0xe315('0x5'));var Mustache=require(_0xe315('0x6'));var util=require(_0xe315('0x7'));var path=require(_0xe315('0x8'));var sox=require(_0xe315('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe315('0xa'));var crypto=require('crypto');var jsforce=require(_0xe315('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe315('0xc'));var Papa=require(_0xe315('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe315('0xe'));var logger=require(_0xe315('0xf'))(_0xe315('0x10'));var utils=require(_0xe315('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xe315('0x12'));var db=require(_0xe315('0x13'))['db'];var integrations=require(_0xe315('0x14'));function respondWithStatusCode(_0x41a596,_0x51cfe4){_0x51cfe4=_0x51cfe4||0xcc;return function(_0x5e7021){if(_0x5e7021){return _0x41a596['sendStatus'](_0x51cfe4);}return _0x41a596['status'](_0x51cfe4)[_0xe315('0x15')]();};}function respondWithResult(_0x5050b8,_0x11998a){_0x11998a=_0x11998a||0xc8;return function(_0x3601a5){if(_0x3601a5){return _0x5050b8[_0xe315('0x16')](_0x11998a)[_0xe315('0x17')](_0x3601a5);}};}function respondWithFilteredResult(_0x56daef,_0x3045ec){return function(_0x52cdb6){if(_0x52cdb6){var _0x24634b=typeof _0x3045ec[_0xe315('0x18')]===_0xe315('0x19')&&typeof _0x3045ec[_0xe315('0x1a')]===_0xe315('0x19');var _0x9e9395=_0x52cdb6[_0xe315('0x1b')];var _0x2be5a2=_0x24634b?0x0:_0x3045ec[_0xe315('0x18')];var _0x156d37=_0x24634b?_0x52cdb6[_0xe315('0x1b')]:_0x3045ec[_0xe315('0x18')]+_0x3045ec[_0xe315('0x1a')];var _0x5e1888;if(_0x156d37>=_0x9e9395){_0x156d37=_0x9e9395;_0x5e1888=0xc8;}else{_0x5e1888=0xce;}_0x56daef[_0xe315('0x16')](_0x5e1888);return _0x56daef[_0xe315('0x1c')](_0xe315('0x1d'),_0x2be5a2+'-'+_0x156d37+'/'+_0x9e9395)[_0xe315('0x17')](_0x52cdb6);}return null;};}function patchUpdates(_0x4ef555){return function(_0x52946f){try{jsonpatch[_0xe315('0x1e')](_0x52946f,_0x4ef555,!![]);}catch(_0x5625e7){return BPromise['reject'](_0x5625e7);}return _0x52946f[_0xe315('0x1f')]();};}function saveUpdates(_0x1b97de,_0x5d8c13){return function(_0x2436ee){if(_0x2436ee){return _0x2436ee[_0xe315('0x20')](_0x1b97de)[_0xe315('0x21')](function(_0x1ed910){return _0x1ed910;});}return null;};}function removeEntity(_0x476290,_0x335897){return function(_0x5bacc3){if(_0x5bacc3){return _0x5bacc3['destroy']()[_0xe315('0x21')](function(){_0x476290['status'](0xcc)[_0xe315('0x15')]();});}};}function handleEntityNotFound(_0x4ec6d9,_0x461a93){return function(_0x1d3aa2){if(!_0x1d3aa2){_0x4ec6d9[_0xe315('0x22')](0x194);}return _0x1d3aa2;};}function handleError(_0x2acd3c,_0x64ad3f){_0x64ad3f=_0x64ad3f||0x1f4;return function(_0x32f36c){logger[_0xe315('0x23')](_0x32f36c[_0xe315('0x24')]);if(_0x32f36c[_0xe315('0x25')]){delete _0x32f36c[_0xe315('0x25')];}_0x2acd3c['status'](_0x64ad3f)[_0xe315('0x26')](_0x32f36c);};}exports[_0xe315('0x27')]=function(_0x43e46e,_0x1f2c7b){var _0x2cf72f={},_0x56fbbb={},_0x53003f={'count':0x0,'rows':[]};var _0x596fde=_['map'](db[_0xe315('0x28')][_0xe315('0x29')],function(_0x10fdce){return{'name':_0x10fdce[_0xe315('0x2a')],'type':_0x10fdce[_0xe315('0x2b')][_0xe315('0x2c')]};});_0x56fbbb['model']=_['map'](_0x596fde,'name');_0x56fbbb[_0xe315('0x2d')]=_['keys'](_0x43e46e[_0xe315('0x2d')]);_0x56fbbb[_0xe315('0x2e')]=_[_0xe315('0x2f')](_0x56fbbb[_0xe315('0x30')],_0x56fbbb[_0xe315('0x2d')]);_0x2cf72f[_0xe315('0x31')]=_[_0xe315('0x2f')](_0x56fbbb[_0xe315('0x30')],qs[_0xe315('0x32')](_0x43e46e[_0xe315('0x2d')][_0xe315('0x32')]));_0x2cf72f[_0xe315('0x31')]=_0x2cf72f[_0xe315('0x31')]['length']?_0x2cf72f['attributes']:_0x56fbbb[_0xe315('0x30')];if(!_0x43e46e['query'][_0xe315('0x33')]('nolimit')){_0x2cf72f[_0xe315('0x1a')]=qs['limit'](_0x43e46e[_0xe315('0x2d')][_0xe315('0x1a')]);_0x2cf72f[_0xe315('0x18')]=qs[_0xe315('0x18')](_0x43e46e[_0xe315('0x2d')][_0xe315('0x18')]);}_0x2cf72f['order']=qs[_0xe315('0x34')](_0x43e46e[_0xe315('0x2d')][_0xe315('0x34')]);_0x2cf72f[_0xe315('0x35')]=qs[_0xe315('0x2e')](_['pick'](_0x43e46e[_0xe315('0x2d')],_0x56fbbb[_0xe315('0x2e')]),_0x596fde);if(_0x43e46e['query'][_0xe315('0x36')]){_0x2cf72f['where']=_[_0xe315('0x37')](_0x2cf72f[_0xe315('0x35')],{'$or':_[_0xe315('0x38')](_0x596fde,function(_0x396823){if(_0x396823[_0xe315('0x2b')]!==_0xe315('0x39')){var _0x153937={};_0x153937[_0x396823[_0xe315('0x25')]]={'$like':'%'+_0x43e46e[_0xe315('0x2d')]['filter']+'%'};return _0x153937;}})});}_0x2cf72f=_[_0xe315('0x37')]({},_0x2cf72f,_0x43e46e['options']);var _0x5175b5={'where':_0x2cf72f[_0xe315('0x35')]};return db['ServicenowAccount'][_0xe315('0x1b')](_0x5175b5)[_0xe315('0x21')](function(_0x131d46){_0x53003f['count']=_0x131d46;if(_0x43e46e['query'][_0xe315('0x3a')]){_0x2cf72f[_0xe315('0x3b')]=[{'all':!![]}];}return db[_0xe315('0x28')][_0xe315('0x3c')](_0x2cf72f);})[_0xe315('0x21')](function(_0x31ac29){_0x53003f[_0xe315('0x3d')]=_0x31ac29;return _0x53003f;})[_0xe315('0x21')](respondWithFilteredResult(_0x1f2c7b,_0x2cf72f))[_0xe315('0x3e')](handleError(_0x1f2c7b,null));};exports[_0xe315('0x3f')]=function(_0x135ef1,_0x41112f){var _0x510a0b={'raw':![],'where':{'id':_0x135ef1[_0xe315('0x40')]['id']}},_0x46eca2={};_0x46eca2['model']=_[_0xe315('0x41')](db[_0xe315('0x28')][_0xe315('0x29')]);_0x46eca2[_0xe315('0x2d')]=_[_0xe315('0x41')](_0x135ef1[_0xe315('0x2d')]);_0x46eca2['filters']=_['intersection'](_0x46eca2[_0xe315('0x30')],_0x46eca2[_0xe315('0x2d')]);_0x510a0b[_0xe315('0x31')]=_[_0xe315('0x2f')](_0x46eca2[_0xe315('0x30')],qs[_0xe315('0x32')](_0x135ef1[_0xe315('0x2d')][_0xe315('0x32')]));_0x510a0b[_0xe315('0x31')]=_0x510a0b['attributes']['length']?_0x510a0b[_0xe315('0x31')]:_0x46eca2[_0xe315('0x30')];if(_0x135ef1[_0xe315('0x2d')][_0xe315('0x3a')]){_0x510a0b[_0xe315('0x3b')]=[{'all':!![]}];}_0x510a0b=_[_0xe315('0x37')]({},_0x510a0b,_0x135ef1[_0xe315('0x42')]);return db[_0xe315('0x28')][_0xe315('0x43')](_0x510a0b)['then'](handleEntityNotFound(_0x41112f,null))['then'](respondWithResult(_0x41112f,null))[_0xe315('0x3e')](handleError(_0x41112f,null));};exports[_0xe315('0x44')]=function(_0x30e1d3,_0x100649){return db[_0xe315('0x28')][_0xe315('0x44')](_0x30e1d3['body'],{})[_0xe315('0x21')](respondWithResult(_0x100649,0xc9))[_0xe315('0x3e')](handleError(_0x100649,null));};exports[_0xe315('0x20')]=function(_0x5b26e9,_0x183d7f){if(_0x5b26e9['body']['id']){delete _0x5b26e9[_0xe315('0x45')]['id'];}return db[_0xe315('0x28')][_0xe315('0x43')]({'where':{'id':_0x5b26e9[_0xe315('0x40')]['id']}})[_0xe315('0x21')](handleEntityNotFound(_0x183d7f,null))['then'](saveUpdates(_0x5b26e9[_0xe315('0x45')],null))[_0xe315('0x21')](respondWithResult(_0x183d7f,null))[_0xe315('0x3e')](handleError(_0x183d7f,null));};exports[_0xe315('0x46')]=function(_0x744d77,_0x1ac5f3){return db[_0xe315('0x28')]['find']({'where':{'id':_0x744d77[_0xe315('0x40')]['id']}})[_0xe315('0x21')](handleEntityNotFound(_0x1ac5f3,null))[_0xe315('0x21')](removeEntity(_0x1ac5f3,null))['catch'](handleError(_0x1ac5f3,null));};exports[_0xe315('0x47')]=function(_0x13c58d,_0x100733,_0x2530f8){var _0x49461f={};var _0x3b6cce={};var _0x416f8d;var _0x33b6a6;return db[_0xe315('0x28')]['findOne']({'where':{'id':_0x13c58d[_0xe315('0x40')]['id']}})[_0xe315('0x21')](handleEntityNotFound(_0x100733,null))['then'](function(_0x33ed75){if(_0x33ed75){_0x416f8d=_0x33ed75;_0x3b6cce[_0xe315('0x30')]=_[_0xe315('0x41')](db[_0xe315('0x48')][_0xe315('0x29')]);_0x3b6cce[_0xe315('0x2d')]=_['keys'](_0x13c58d[_0xe315('0x2d')]);_0x3b6cce[_0xe315('0x2e')]=_[_0xe315('0x2f')](_0x3b6cce[_0xe315('0x30')],_0x3b6cce[_0xe315('0x2d')]);_0x49461f['attributes']=_['intersection'](_0x3b6cce['model'],qs[_0xe315('0x32')](_0x13c58d[_0xe315('0x2d')][_0xe315('0x32')]));_0x49461f[_0xe315('0x31')]=_0x49461f[_0xe315('0x31')][_0xe315('0x49')]?_0x49461f[_0xe315('0x31')]:_0x3b6cce[_0xe315('0x30')];_0x49461f[_0xe315('0x4a')]=qs[_0xe315('0x34')](_0x13c58d[_0xe315('0x2d')]['sort']);_0x49461f[_0xe315('0x35')]=qs['filters'](_[_0xe315('0x4b')](_0x13c58d['query'],_0x3b6cce[_0xe315('0x2e')]));if(_0x13c58d[_0xe315('0x2d')][_0xe315('0x36')]){_0x49461f[_0xe315('0x35')]=_[_0xe315('0x37')](_0x49461f[_0xe315('0x35')],{'$or':_['map'](_0x49461f[_0xe315('0x31')],function(_0x2e4791){var _0x121c9f={};_0x121c9f[_0x2e4791]={'$like':'%'+_0x13c58d[_0xe315('0x2d')][_0xe315('0x36')]+'%'};return _0x121c9f;})});}_0x49461f=_['merge']({},_0x49461f,_0x13c58d[_0xe315('0x42')]);return _0x416f8d[_0xe315('0x47')](_0x49461f);}})['then'](function(_0x9375c8){if(_0x9375c8){_0x33b6a6=_0x9375c8['length'];if(!_0x13c58d[_0xe315('0x2d')][_0xe315('0x33')](_0xe315('0x4c'))){_0x49461f[_0xe315('0x1a')]=qs[_0xe315('0x1a')](_0x13c58d[_0xe315('0x2d')][_0xe315('0x1a')]);_0x49461f[_0xe315('0x18')]=qs[_0xe315('0x18')](_0x13c58d['query'][_0xe315('0x18')]);}return _0x416f8d[_0xe315('0x47')](_0x49461f);}})[_0xe315('0x21')](function(_0x3c19b3){if(_0x3c19b3){return _0x3c19b3?{'count':_0x33b6a6,'rows':_0x3c19b3}:null;}})[_0xe315('0x21')](respondWithResult(_0x100733,null))[_0xe315('0x3e')](handleError(_0x100733,null));};exports['addConfiguration']=function(_0x1f17bb,_0xf3c956,_0x35d5d2){if(_0x1f17bb[_0xe315('0x45')]['id']){delete _0x1f17bb['body']['id'];}return db['ServicenowAccount'][_0xe315('0x4d')]({'where':{'id':_0x1f17bb[_0xe315('0x40')]['id']}})[_0xe315('0x21')](handleEntityNotFound(_0xf3c956,null))['then'](function(_0x263f31){if(_0x263f31){_0x1f17bb[_0xe315('0x45')]['AccountId']=_0x263f31['id'];_0x1f17bb[_0xe315('0x45')][_0xe315('0x4e')]=integrations[_0xe315('0x4f')](_0x1f17bb[_0xe315('0x45')][_0xe315('0x50')],_0x1f17bb['body']['type']);_0x1f17bb[_0xe315('0x45')]['Descriptions']=integrations[_0xe315('0x51')](_0x1f17bb[_0xe315('0x45')][_0xe315('0x50')],_0x1f17bb[_0xe315('0x45')][_0xe315('0x2b')]);return db['ServicenowConfiguration'][_0xe315('0x44')](_0x1f17bb[_0xe315('0x45')],{'include':[{'model':db[_0xe315('0x52')],'as':_0xe315('0x4e')},{'model':db[_0xe315('0x52')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0xf3c956,null))[_0xe315('0x3e')](handleError(_0xf3c956,null));};exports[_0xe315('0x53')]=function(_0x1e1401,_0x1b3363,_0x200919){var _0x59821e=['made_sla','hold_reason',_0xe315('0x54'),_0xe315('0x55'),_0xe315('0x56'),_0xe315('0x57'),_0xe315('0x58'),_0xe315('0x59'),_0xe315('0x5a')];var _0x4ff6bd=[_0xe315('0x5b'),'made_sla',_0xe315('0x5c'),'watch_list',_0xe315('0x5d'),_0xe315('0x5e'),'child_incidents',_0xe315('0x5f'),_0xe315('0x60'),_0xe315('0x61'),_0xe315('0x62'),'sys_updated_by','opened_by',_0xe315('0x63'),'sys_created_on','sys_domain',_0xe315('0x64'),_0xe315('0x65'),'knowledge','order',_0xe315('0x66'),_0xe315('0x67'),_0xe315('0x68'),_0xe315('0x69'),_0xe315('0x6a'),_0xe315('0x6b'),_0xe315('0x6c'),'business_service',_0xe315('0x6d'),_0xe315('0x6e'),_0xe315('0x6f'),_0xe315('0x70'),_0xe315('0x71'),_0xe315('0x72'),_0xe315('0x73'),'group_list',_0xe315('0x74'),_0xe315('0x75'),_0xe315('0x76'),_0xe315('0x77'),_0xe315('0x78'),_0xe315('0x55'),_0xe315('0x79'),_0xe315('0x7a'),_0xe315('0x56'),_0xe315('0x7b'),_0xe315('0x7c'),_0xe315('0x7d'),'assignment_group',_0xe315('0x7e'),_0xe315('0x7f'),_0xe315('0x80'),'calendar_duration','notify',_0xe315('0x81'),_0xe315('0x82'),_0xe315('0x83'),_0xe315('0x84'),_0xe315('0x85'),_0xe315('0x86'),'contact_type',_0xe315('0x87'),_0xe315('0x58'),_0xe315('0x88'),_0xe315('0x89'),'company',_0xe315('0x8a'),_0xe315('0x8b'),_0xe315('0x8c'),_0xe315('0x59'),'comments',_0xe315('0x8d'),_0xe315('0x8e'),_0xe315('0x8f'),'due_date',_0xe315('0x90'),_0xe315('0x91'),_0xe315('0x92'),_0xe315('0x93'),'upon_approval',_0xe315('0x94'),_0xe315('0x95'),'category'];var _0x52794d='';var _0xc7659='';var _0x2c1a61=[];var _0x1dfa31='';var _0x495710='';var _0x4b6462=[];var _0x3b6493='';var _0x1873e3='';var _0x22cd15={};var _0x5d11ab='';return db['ServicenowAccount'][_0xe315('0x4d')]({'where':{'id':_0x1e1401[_0xe315('0x40')]['id']},'attributes':['id',_0xe315('0x96'),'password',_0xe315('0x97'),_0xe315('0x98'),'serverUrl']})['then'](handleEntityNotFound(_0x1b3363,null))['then'](function(_0x36b10a){if(_0x36b10a){_0x5d11ab=_0x36b10a[_0xe315('0x98')];var _0x2fedd0=_0x5d11ab['slice'](-0x1);if(_0x2fedd0==='/'){_0x5d11ab=_0x5d11ab[_0xe315('0x99')](0x0,_0x5d11ab[_0xe315('0x9a')](_0x2fedd0));}_0x1873e3=util['format'](_0xe315('0x9b'),_0x5d11ab);_0x3b6493=util[_0xe315('0x9c')](_0xe315('0x9d'),_0x5d11ab);_0x22cd15={'user':_0x36b10a[_0xe315('0x96')],'pass':_0x36b10a[_0xe315('0x9e')]};var _0x595c9b={'method':'GET','uri':_0x1873e3+_0xe315('0x9f'),'auth':_0x22cd15,'json':!![]};return rp(_0x595c9b);}})[_0xe315('0x21')](function(_0x4026fb){if(_0x4026fb[_0xe315('0xa0')][_0xe315('0x49')]>0x0){_0x52794d=_0x4026fb[_0xe315('0xa0')];}console[_0xe315('0xa1')](_0xe315('0xa2'),_0x52794d);_0x4b6462=[];_0xc7659=Object[_0xe315('0xa3')]([],_0x52794d);_[_0xe315('0xa4')](_0xc7659,function(_0x46b934){return!_0x59821e[_0xe315('0xa5')](_0x46b934['name']);});_0xc7659['forEach'](function(_0x28bc94){var _0x309f2e=createFieldObject(_0x3b6493,_0x22cd15,_0x28bc94[_0xe315('0xa6')],_0x28bc94[_0xe315('0x25')],_0x28bc94[_0xe315('0xa7')],![]);_0x4b6462[_0xe315('0xa8')](_0x309f2e);});return Promise['all'](_0x4b6462);})['then'](function(_0x1c6893){_0x2c1a61=_0x1c6893;_0x1dfa31=Object[_0xe315('0xa3')]([],_0x52794d);console['log']('TCL:\x20_object',_0x52794d);_['remove'](_0x1dfa31,function(_0x51f974){return _0x4ff6bd[_0xe315('0xa5')](_0x51f974[_0xe315('0x25')]);});console[_0xe315('0xa1')](_0xe315('0xa9'),_0x1dfa31);_0x4b6462=[];_0x1dfa31[_0xe315('0xaa')](function(_0x50059f){var _0x194445=createFieldObject(_0x3b6493,_0x22cd15,_0x50059f[_0xe315('0xa6')],_0x50059f[_0xe315('0x25')],_0x50059f[_0xe315('0xa7')],!![]);_0x4b6462[_0xe315('0xa8')](_0x194445);});return Promise[_0xe315('0xab')](_0x4b6462);})[_0xe315('0x21')](function(_0x577288){_0x495710=_0x577288;var _0x120ef2=_0x2c1a61[_0xe315('0xac')](_0x495710);return{'count':_0x120ef2['length'],'rows':_0x120ef2};})[_0xe315('0x21')](respondWithResult(_0x1b3363,null))[_0xe315('0x3e')](function(_0x2b11ec){console[_0xe315('0xa1')](_0xe315('0xad')+_0x2b11ec);var _0x1cdaa3=_0x1e1401[_0xe315('0x2d')][_0xe315('0xae')]?0x1f4:_0x2b11ec[_0xe315('0xaf')]||0x1f4;logger[_0xe315('0x23')](_0x2b11ec[_0xe315('0x24')]);delete _0x2b11ec[_0xe315('0x25')];if(_0x1cdaa3===0x191){_0x1cdaa3=0x190;}_0x1b3363[_0xe315('0x16')](_0x1cdaa3)[_0xe315('0x26')](_0x1e1401['query'][_0xe315('0xae')]?{'message':_0xe315('0xb0'),'statusCode':_0x2b11ec[_0xe315('0xaf')]}:_0x2b11ec);});};function createFieldObject(_0x65189f,_0x38c141,_0x460e2a,_0x1aedff,_0x3f95b4,_0x247a84){return new Promise(function(_0x2374cd,_0x3581b5){var _0x46babf={'id':_0x1aedff,'name':_0x3f95b4,'custom':_0x247a84};if(_0x460e2a==='boolean'){_0x46babf[_0xe315('0x42')]=[{'name':'True','value':'true'},{'name':_0xe315('0xb1'),'value':_0xe315('0xb2')}];_0x2374cd(_0x46babf);}else{var _0x30276b={'method':_0xe315('0xb3'),'uri':_0x65189f+_0xe315('0xb4')+_0x1aedff,'auth':_0x38c141,'json':!![]};return rp(_0x30276b)[_0xe315('0x21')](function(_0x1b8461){var _0x14353c=[];if(_0x1b8461[_0xe315('0xa0')][_0xe315('0x49')]>0x0){_0x1b8461[_0xe315('0xa0')]['forEach'](function(_0x4cd549){if(_0x4cd549[_0xe315('0xb5')]==='false'){var _0x5955bc={'name':_0x4cd549['label'],'value':_0x4cd549[_0xe315('0xb6')]};_0x14353c[_0xe315('0xa8')](_0x5955bc);}});}_0x46babf[_0xe315('0x42')]=_0x14353c;if(_0x46babf['options']['length']>0x0){_0x2374cd(_0x46babf);}else{if(_0x247a84==![]){_0x2374cd();}else{_0x2374cd(_0x46babf);}}});}});} \ No newline at end of file +var _0x30f1=['getDescriptions','ServicenowField','getFields','made_sla','hold_reason','knowledge','notify','incident_state','severity','category','parent','caused_by','watch_list','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','rfc','time_worked','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','approval_set','subcategory','work_notes','close_code','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','parent_incident','reopened_by','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','email','serverUrl','remoteUri','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','includes','forEach','internalType','label','push','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','test','statusCode','stack','Wrong\x20credentials','boolean','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','value','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','then','destroy','error','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','filter','where','merge','VIRTUAL','options','ServicenowAccount','count','includeAll','include','catch','params','find','create','body','update','getConfigurations','findOne','ServicenowConfiguration','order','pick','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions'];(function(_0x45af66,_0x12335b){var _0x56474a=function(_0x510c39){while(--_0x510c39){_0x45af66['push'](_0x45af66['shift']());}};_0x56474a(++_0x12335b);}(_0x30f1,0x6c));var _0x130f=function(_0x282c92,_0x4951b8){_0x282c92=_0x282c92-0x0;var _0x487319=_0x30f1[_0x282c92];return _0x487319;};'use strict';var emlformat=require(_0x130f('0x0'));var rimraf=require(_0x130f('0x1'));var zipdir=require(_0x130f('0x2'));var jsonpatch=require(_0x130f('0x3'));var rp=require('request-promise');var moment=require(_0x130f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x130f('0x5'));var util=require(_0x130f('0x6'));var path=require('path');var sox=require(_0x130f('0x7'));var csv=require('to-csv');var ejs=require(_0x130f('0x8'));var fs=require('fs');var fs_extra=require(_0x130f('0x9'));var _=require(_0x130f('0xa'));var squel=require('squel');var crypto=require(_0x130f('0xb'));var jsforce=require(_0x130f('0xc'));var deskjs=require(_0x130f('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x130f('0xe'));var Redis=require(_0x130f('0xf'));var authService=require(_0x130f('0x10'));var qs=require(_0x130f('0x11'));var as=require(_0x130f('0x12'));var hardwareService=require(_0x130f('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x130f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x130f('0x15'));var db=require(_0x130f('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x281ecd,_0x11e98e){_0x11e98e=_0x11e98e||0xcc;return function(_0x3ce9fd){if(_0x3ce9fd){return _0x281ecd[_0x130f('0x17')](_0x11e98e);}return _0x281ecd[_0x130f('0x18')](_0x11e98e)[_0x130f('0x19')]();};}function respondWithResult(_0x2d64ea,_0x165070){_0x165070=_0x165070||0xc8;return function(_0x3bb282){if(_0x3bb282){return _0x2d64ea['status'](_0x165070)[_0x130f('0x1a')](_0x3bb282);}};}function respondWithFilteredResult(_0x5bf252,_0x5a4b61){return function(_0x3ed43b){if(_0x3ed43b){var _0xbcd58c=typeof _0x5a4b61[_0x130f('0x1b')]===_0x130f('0x1c')&&typeof _0x5a4b61[_0x130f('0x1d')]===_0x130f('0x1c');var _0x489786=_0x3ed43b['count'];var _0x5d6236=_0xbcd58c?0x0:_0x5a4b61['offset'];var _0xa94e5d=_0xbcd58c?_0x3ed43b['count']:_0x5a4b61['offset']+_0x5a4b61['limit'];var _0x547197;if(_0xa94e5d>=_0x489786){_0xa94e5d=_0x489786;_0x547197=0xc8;}else{_0x547197=0xce;}_0x5bf252[_0x130f('0x18')](_0x547197);return _0x5bf252['set'](_0x130f('0x1e'),_0x5d6236+'-'+_0xa94e5d+'/'+_0x489786)[_0x130f('0x1a')](_0x3ed43b);}return null;};}function patchUpdates(_0x1a5170){return function(_0x198bf0){try{jsonpatch[_0x130f('0x1f')](_0x198bf0,_0x1a5170,!![]);}catch(_0x4f7df5){return BPromise[_0x130f('0x20')](_0x4f7df5);}return _0x198bf0['save']();};}function saveUpdates(_0x1d5d12,_0x2dc47f){return function(_0x4e8916){if(_0x4e8916){return _0x4e8916['update'](_0x1d5d12)[_0x130f('0x21')](function(_0x414618){return _0x414618;});}return null;};}function removeEntity(_0x1b4581,_0x3b7e03){return function(_0x8574e1){if(_0x8574e1){return _0x8574e1[_0x130f('0x22')]()[_0x130f('0x21')](function(){_0x1b4581['status'](0xcc)[_0x130f('0x19')]();});}};}function handleEntityNotFound(_0x32d008,_0x2d0baa){return function(_0x3127bf){if(!_0x3127bf){_0x32d008[_0x130f('0x17')](0x194);}return _0x3127bf;};}function handleError(_0x530099,_0x47c3cf){_0x47c3cf=_0x47c3cf||0x1f4;return function(_0x4e414d){logger[_0x130f('0x23')](_0x4e414d['stack']);if(_0x4e414d[_0x130f('0x24')]){delete _0x4e414d[_0x130f('0x24')];}_0x530099['status'](_0x47c3cf)[_0x130f('0x25')](_0x4e414d);};}exports['index']=function(_0xb328c8,_0x230725){var _0x594022={},_0x291671={},_0x483dcf={'count':0x0,'rows':[]};var _0x16d364=_[_0x130f('0x26')](db['ServicenowAccount'][_0x130f('0x27')],function(_0x25ae0c){return{'name':_0x25ae0c[_0x130f('0x28')],'type':_0x25ae0c[_0x130f('0x29')][_0x130f('0x2a')]};});_0x291671[_0x130f('0x2b')]=_[_0x130f('0x26')](_0x16d364,'name');_0x291671[_0x130f('0x2c')]=_[_0x130f('0x2d')](_0xb328c8['query']);_0x291671[_0x130f('0x2e')]=_[_0x130f('0x2f')](_0x291671['model'],_0x291671[_0x130f('0x2c')]);_0x594022[_0x130f('0x30')]=_['intersection'](_0x291671[_0x130f('0x2b')],qs['fields'](_0xb328c8[_0x130f('0x2c')][_0x130f('0x31')]));_0x594022[_0x130f('0x30')]=_0x594022[_0x130f('0x30')][_0x130f('0x32')]?_0x594022[_0x130f('0x30')]:_0x291671['model'];if(!_0xb328c8[_0x130f('0x2c')]['hasOwnProperty']('nolimit')){_0x594022[_0x130f('0x1d')]=qs[_0x130f('0x1d')](_0xb328c8[_0x130f('0x2c')][_0x130f('0x1d')]);_0x594022[_0x130f('0x1b')]=qs[_0x130f('0x1b')](_0xb328c8[_0x130f('0x2c')][_0x130f('0x1b')]);}_0x594022['order']=qs[_0x130f('0x33')](_0xb328c8[_0x130f('0x2c')][_0x130f('0x33')]);_0x594022['where']=qs[_0x130f('0x2e')](_['pick'](_0xb328c8['query'],_0x291671[_0x130f('0x2e')]),_0x16d364);if(_0xb328c8[_0x130f('0x2c')][_0x130f('0x34')]){_0x594022[_0x130f('0x35')]=_[_0x130f('0x36')](_0x594022[_0x130f('0x35')],{'$or':_[_0x130f('0x26')](_0x16d364,function(_0x220ff9){if(_0x220ff9[_0x130f('0x29')]!==_0x130f('0x37')){var _0x2c2620={};_0x2c2620[_0x220ff9[_0x130f('0x24')]]={'$like':'%'+_0xb328c8[_0x130f('0x2c')]['filter']+'%'};return _0x2c2620;}})});}_0x594022=_[_0x130f('0x36')]({},_0x594022,_0xb328c8[_0x130f('0x38')]);var _0x47eb88={'where':_0x594022[_0x130f('0x35')]};return db[_0x130f('0x39')][_0x130f('0x3a')](_0x47eb88)['then'](function(_0x2949ff){_0x483dcf[_0x130f('0x3a')]=_0x2949ff;if(_0xb328c8['query'][_0x130f('0x3b')]){_0x594022[_0x130f('0x3c')]=[{'all':!![]}];}return db['ServicenowAccount']['findAll'](_0x594022);})[_0x130f('0x21')](function(_0x11e6d1){_0x483dcf['rows']=_0x11e6d1;return _0x483dcf;})[_0x130f('0x21')](respondWithFilteredResult(_0x230725,_0x594022))[_0x130f('0x3d')](handleError(_0x230725,null));};exports['show']=function(_0x35a91b,_0x4ba22f){var _0x4c16df={'raw':![],'where':{'id':_0x35a91b[_0x130f('0x3e')]['id']}},_0x3382c9={};_0x3382c9[_0x130f('0x2b')]=_['keys'](db[_0x130f('0x39')][_0x130f('0x27')]);_0x3382c9[_0x130f('0x2c')]=_['keys'](_0x35a91b[_0x130f('0x2c')]);_0x3382c9[_0x130f('0x2e')]=_[_0x130f('0x2f')](_0x3382c9[_0x130f('0x2b')],_0x3382c9['query']);_0x4c16df[_0x130f('0x30')]=_[_0x130f('0x2f')](_0x3382c9[_0x130f('0x2b')],qs[_0x130f('0x31')](_0x35a91b[_0x130f('0x2c')]['fields']));_0x4c16df[_0x130f('0x30')]=_0x4c16df['attributes'][_0x130f('0x32')]?_0x4c16df['attributes']:_0x3382c9['model'];if(_0x35a91b[_0x130f('0x2c')]['includeAll']){_0x4c16df[_0x130f('0x3c')]=[{'all':!![]}];}_0x4c16df=_['merge']({},_0x4c16df,_0x35a91b[_0x130f('0x38')]);return db[_0x130f('0x39')][_0x130f('0x3f')](_0x4c16df)['then'](handleEntityNotFound(_0x4ba22f,null))[_0x130f('0x21')](respondWithResult(_0x4ba22f,null))['catch'](handleError(_0x4ba22f,null));};exports[_0x130f('0x40')]=function(_0x108b20,_0x535d4e){return db[_0x130f('0x39')]['create'](_0x108b20[_0x130f('0x41')],{})[_0x130f('0x21')](respondWithResult(_0x535d4e,0xc9))['catch'](handleError(_0x535d4e,null));};exports[_0x130f('0x42')]=function(_0xe7f3d1,_0x4f8162){if(_0xe7f3d1['body']['id']){delete _0xe7f3d1[_0x130f('0x41')]['id'];}return db[_0x130f('0x39')]['find']({'where':{'id':_0xe7f3d1[_0x130f('0x3e')]['id']}})[_0x130f('0x21')](handleEntityNotFound(_0x4f8162,null))[_0x130f('0x21')](saveUpdates(_0xe7f3d1['body'],null))[_0x130f('0x21')](respondWithResult(_0x4f8162,null))['catch'](handleError(_0x4f8162,null));};exports[_0x130f('0x22')]=function(_0x525bfc,_0x39c231){return db[_0x130f('0x39')][_0x130f('0x3f')]({'where':{'id':_0x525bfc[_0x130f('0x3e')]['id']}})[_0x130f('0x21')](handleEntityNotFound(_0x39c231,null))[_0x130f('0x21')](removeEntity(_0x39c231,null))['catch'](handleError(_0x39c231,null));};exports[_0x130f('0x43')]=function(_0x3520d8,_0x29b813,_0x145193){var _0x466bf3={};var _0x477f1d={};var _0x57edf4;var _0x3b8eec;return db[_0x130f('0x39')][_0x130f('0x44')]({'where':{'id':_0x3520d8[_0x130f('0x3e')]['id']}})[_0x130f('0x21')](handleEntityNotFound(_0x29b813,null))[_0x130f('0x21')](function(_0x5cbdb6){if(_0x5cbdb6){_0x57edf4=_0x5cbdb6;_0x477f1d['model']=_[_0x130f('0x2d')](db[_0x130f('0x45')][_0x130f('0x27')]);_0x477f1d[_0x130f('0x2c')]=_['keys'](_0x3520d8[_0x130f('0x2c')]);_0x477f1d['filters']=_[_0x130f('0x2f')](_0x477f1d[_0x130f('0x2b')],_0x477f1d[_0x130f('0x2c')]);_0x466bf3[_0x130f('0x30')]=_[_0x130f('0x2f')](_0x477f1d['model'],qs[_0x130f('0x31')](_0x3520d8[_0x130f('0x2c')][_0x130f('0x31')]));_0x466bf3['attributes']=_0x466bf3[_0x130f('0x30')][_0x130f('0x32')]?_0x466bf3[_0x130f('0x30')]:_0x477f1d[_0x130f('0x2b')];_0x466bf3[_0x130f('0x46')]=qs[_0x130f('0x33')](_0x3520d8[_0x130f('0x2c')][_0x130f('0x33')]);_0x466bf3['where']=qs[_0x130f('0x2e')](_[_0x130f('0x47')](_0x3520d8[_0x130f('0x2c')],_0x477f1d['filters']));if(_0x3520d8[_0x130f('0x2c')][_0x130f('0x34')]){_0x466bf3['where']=_[_0x130f('0x36')](_0x466bf3[_0x130f('0x35')],{'$or':_[_0x130f('0x26')](_0x466bf3[_0x130f('0x30')],function(_0x17583d){var _0x594600={};_0x594600[_0x17583d]={'$like':'%'+_0x3520d8['query'][_0x130f('0x34')]+'%'};return _0x594600;})});}_0x466bf3=_[_0x130f('0x36')]({},_0x466bf3,_0x3520d8[_0x130f('0x38')]);return _0x57edf4['getConfigurations'](_0x466bf3);}})['then'](function(_0x5ecee6){if(_0x5ecee6){_0x3b8eec=_0x5ecee6[_0x130f('0x32')];if(!_0x3520d8[_0x130f('0x2c')]['hasOwnProperty'](_0x130f('0x48'))){_0x466bf3[_0x130f('0x1d')]=qs[_0x130f('0x1d')](_0x3520d8['query']['limit']);_0x466bf3[_0x130f('0x1b')]=qs['offset'](_0x3520d8[_0x130f('0x2c')]['offset']);}return _0x57edf4[_0x130f('0x43')](_0x466bf3);}})[_0x130f('0x21')](function(_0x2d5f10){if(_0x2d5f10){return _0x2d5f10?{'count':_0x3b8eec,'rows':_0x2d5f10}:null;}})[_0x130f('0x21')](respondWithResult(_0x29b813,null))[_0x130f('0x3d')](handleError(_0x29b813,null));};exports[_0x130f('0x49')]=function(_0xffbfb3,_0x24393a,_0x2c4857){if(_0xffbfb3[_0x130f('0x41')]['id']){delete _0xffbfb3[_0x130f('0x41')]['id'];}return db[_0x130f('0x39')][_0x130f('0x44')]({'where':{'id':_0xffbfb3['params']['id']}})[_0x130f('0x21')](handleEntityNotFound(_0x24393a,null))['then'](function(_0x300be5){if(_0x300be5){_0xffbfb3['body'][_0x130f('0x4a')]=_0x300be5['id'];_0xffbfb3[_0x130f('0x41')][_0x130f('0x4b')]=integrations[_0x130f('0x4c')](_0xffbfb3[_0x130f('0x41')][_0x130f('0x4d')],_0xffbfb3['body'][_0x130f('0x29')]);_0xffbfb3['body'][_0x130f('0x4e')]=integrations[_0x130f('0x4f')](_0xffbfb3['body'][_0x130f('0x4d')],_0xffbfb3[_0x130f('0x41')]['type']);return db[_0x130f('0x45')][_0x130f('0x40')](_0xffbfb3['body'],{'include':[{'model':db[_0x130f('0x50')],'as':'Subjects'},{'model':db[_0x130f('0x50')],'as':_0x130f('0x4e')}]});}return null;})[_0x130f('0x21')](respondWithResult(_0x24393a,null))[_0x130f('0x3d')](handleError(_0x24393a,null));};exports[_0x130f('0x51')]=function(_0x4aed42,_0x4bfe25,_0x59e02f){var _0x24ac03=[_0x130f('0x52'),_0x130f('0x53'),_0x130f('0x54'),'subcategory','close_code',_0x130f('0x55'),_0x130f('0x56'),_0x130f('0x57'),_0x130f('0x58')];var _0x2cb0dd=[_0x130f('0x59'),_0x130f('0x52'),_0x130f('0x5a'),_0x130f('0x5b'),'upon_reject',_0x130f('0x5c'),_0x130f('0x5d'),_0x130f('0x53'),_0x130f('0x5e'),_0x130f('0x5f'),_0x130f('0x60'),_0x130f('0x61'),_0x130f('0x62'),'user_input',_0x130f('0x63'),'sys_domain',_0x130f('0x64'),_0x130f('0x65'),_0x130f('0x54'),_0x130f('0x46'),_0x130f('0x66'),_0x130f('0x67'),_0x130f('0x68'),_0x130f('0x69'),_0x130f('0x6a'),_0x130f('0x6b'),_0x130f('0x6c'),_0x130f('0x6d'),'priority','sys_domain_path',_0x130f('0x6e'),_0x130f('0x6f'),'expected_start',_0x130f('0x70'),_0x130f('0x71'),_0x130f('0x72'),_0x130f('0x73'),'reopened_time',_0x130f('0x74'),_0x130f('0x75'),_0x130f('0x76'),_0x130f('0x77'),_0x130f('0x78'),'short_description',_0x130f('0x79'),_0x130f('0x7a'),_0x130f('0x7b'),_0x130f('0x7c'),_0x130f('0x7d'),_0x130f('0x7e'),_0x130f('0x7f'),_0x130f('0x80'),_0x130f('0x81'),_0x130f('0x55'),_0x130f('0x82'),_0x130f('0x83'),_0x130f('0x84'),_0x130f('0x85'),_0x130f('0x86'),'sys_id','contact_type',_0x130f('0x87'),'incident_state','urgency',_0x130f('0x88'),_0x130f('0x89'),_0x130f('0x8a'),_0x130f('0x8b'),_0x130f('0x8c'),_0x130f('0x57'),'comments',_0x130f('0x8d'),_0x130f('0x8e'),_0x130f('0x8f'),_0x130f('0x90'),_0x130f('0x91'),_0x130f('0x92'),_0x130f('0x93'),_0x130f('0x94'),_0x130f('0x95'),_0x130f('0x96'),_0x130f('0x97'),_0x130f('0x58')];var _0x4656a7='';var _0x2473c8='';var _0xc09b6c=[];var _0xc60ec='';var _0x202978='';var _0x253e65=[];var _0x3941bb='';var _0x167b78='';var _0x3e21f6={};var _0x25e277='';return db[_0x130f('0x39')][_0x130f('0x44')]({'where':{'id':_0x4aed42['params']['id']},'attributes':['id',_0x130f('0x98'),'password',_0x130f('0x99'),'remoteUri',_0x130f('0x9a')]})[_0x130f('0x21')](handleEntityNotFound(_0x4bfe25,null))[_0x130f('0x21')](function(_0x3a9f44){if(_0x3a9f44){_0x25e277=_0x3a9f44[_0x130f('0x9b')];var _0x4f77da=_0x25e277[_0x130f('0x9c')](-0x1);if(_0x4f77da==='/'){_0x25e277=_0x25e277['substring'](0x0,_0x25e277[_0x130f('0x9d')](_0x4f77da));}_0x167b78=util[_0x130f('0x9e')](_0x130f('0x9f'),_0x25e277);_0x3941bb=util[_0x130f('0x9e')](_0x130f('0xa0'),_0x25e277);_0x3e21f6={'user':_0x3a9f44[_0x130f('0x98')],'pass':_0x3a9f44['password']};var _0x4c2a25={'method':_0x130f('0xa1'),'uri':_0x167b78+_0x130f('0xa2'),'auth':_0x3e21f6,'json':!![]};return rp(_0x4c2a25);}})[_0x130f('0x21')](function(_0x5c99b6){if(_0x5c99b6['result'][_0x130f('0x32')]>0x0){_0x4656a7=_0x5c99b6[_0x130f('0xa3')];}console['log'](_0x130f('0xa4'),_0x4656a7);_0x253e65=[];_0x2473c8=Object[_0x130f('0xa5')]([],_0x4656a7);_['remove'](_0x2473c8,function(_0x1d2424){return!_0x24ac03[_0x130f('0xa6')](_0x1d2424['name']);});_0x2473c8[_0x130f('0xa7')](function(_0x4bab4b){var _0x5e9ce6=createFieldObject(_0x3941bb,_0x3e21f6,_0x4bab4b[_0x130f('0xa8')],_0x4bab4b[_0x130f('0x24')],_0x4bab4b[_0x130f('0xa9')],![]);_0x253e65[_0x130f('0xaa')](_0x5e9ce6);});return Promise[_0x130f('0xab')](_0x253e65);})[_0x130f('0x21')](function(_0x5b7efb){_0xc09b6c=_0x5b7efb;_0xc60ec=Object[_0x130f('0xa5')]([],_0x4656a7);console[_0x130f('0xac')](_0x130f('0xad'),_0x4656a7);_['remove'](_0xc60ec,function(_0x1e312d){return _0x2cb0dd['includes'](_0x1e312d[_0x130f('0x24')]);});console[_0x130f('0xac')](_0x130f('0xae'),_0xc60ec);_0x253e65=[];_0xc60ec[_0x130f('0xa7')](function(_0x18a8ab){var _0x44765f=createFieldObject(_0x3941bb,_0x3e21f6,_0x18a8ab[_0x130f('0xa8')],_0x18a8ab[_0x130f('0x24')],_0x18a8ab['label'],!![]);_0x253e65[_0x130f('0xaa')](_0x44765f);});return Promise['all'](_0x253e65);})[_0x130f('0x21')](function(_0x4d5f10){_0x202978=_0x4d5f10;var _0x3f3250=_0xc09b6c[_0x130f('0xaf')](_0x202978);return{'count':_0x3f3250[_0x130f('0x32')],'rows':_0x3f3250};})[_0x130f('0x21')](respondWithResult(_0x4bfe25,null))[_0x130f('0x3d')](function(_0x1ee403){console[_0x130f('0xac')]('ServiceNow\x20error:\x20'+_0x1ee403);var _0x31af51=_0x4aed42['query'][_0x130f('0xb0')]?0x1f4:_0x1ee403[_0x130f('0xb1')]||0x1f4;logger[_0x130f('0x23')](_0x1ee403[_0x130f('0xb2')]);delete _0x1ee403[_0x130f('0x24')];if(_0x31af51===0x191){_0x31af51=0x190;}_0x4bfe25[_0x130f('0x18')](_0x31af51)['send'](_0x4aed42[_0x130f('0x2c')][_0x130f('0xb0')]?{'message':_0x130f('0xb3'),'statusCode':_0x1ee403['statusCode']}:_0x1ee403);});};function createFieldObject(_0x10c67f,_0x2eca97,_0xa64626,_0x32808e,_0x153cce,_0x34f09d){return new Promise(function(_0x4110c9,_0x3286a7){var _0x3eb6f8={'id':_0x32808e,'name':_0x153cce,'custom':_0x34f09d};if(_0xa64626===_0x130f('0xb4')){_0x3eb6f8[_0x130f('0x38')]=[{'name':_0x130f('0xb5'),'value':_0x130f('0xb6')},{'name':_0x130f('0xb7'),'value':_0x130f('0xb8')}];_0x4110c9(_0x3eb6f8);}else{var _0x91a5c8={'method':_0x130f('0xa1'),'uri':_0x10c67f+_0x130f('0xb9')+_0x32808e,'auth':_0x2eca97,'json':!![]};return rp(_0x91a5c8)[_0x130f('0x21')](function(_0x368854){var _0x2e4e0f=[];if(_0x368854[_0x130f('0xa3')]['length']>0x0){_0x368854[_0x130f('0xa3')]['forEach'](function(_0xcc9456){if(_0xcc9456['inactive']==='false'){var _0x3a75f8={'name':_0xcc9456[_0x130f('0xa9')],'value':_0xcc9456[_0x130f('0xba')]};_0x2e4e0f[_0x130f('0xaa')](_0x3a75f8);}});}_0x3eb6f8[_0x130f('0x38')]=_0x2e4e0f;if(_0x3eb6f8[_0x130f('0x38')]['length']>0x0){_0x4110c9(_0x3eb6f8);}else{if(_0x34f09d==![]){_0x4110c9();}else{_0x4110c9(_0x3eb6f8);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 37c7d6f..d4dad31 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 _0xda19=['request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','util','../../config/logger','moment'];(function(_0xb1e92d,_0x202387){var _0x4ad932=function(_0x28e266){while(--_0x28e266){_0xb1e92d['push'](_0xb1e92d['shift']());}};_0x4ad932(++_0x202387);}(_0xda19,0xd5));var _0x9da1=function(_0x56bb01,_0x21ba6d){_0x56bb01=_0x56bb01-0x0;var _0x4c7b46=_0xda19[_0x56bb01];return _0x4c7b46;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));var integrations=require(_0x9da1('0x7'));module[_0x9da1('0x8')]=function(_0x2dcbc6,_0x23e4f7){return _0x2dcbc6[_0x9da1('0x9')](_0x9da1('0xa'),attributes,{'tableName':_0x9da1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','define','ServicenowAccount','lodash','util'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0x7a54,0x106));var _0x47a5=function(_0x3bb181,_0x39c533){_0x3bb181=_0x3bb181-0x0;var _0x1405b1=_0x7a54[_0x3bb181];return _0x1405b1;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));var integrations=require(_0x47a5('0x9'));module['exports']=function(_0x3d5629,_0x59199c){return _0x3d5629[_0x47a5('0xa')](_0x47a5('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 4f6d82c..fa85067 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 _0xdb62=['request\x20sent','catch','GetServicenowAccount','findAll','options','where','attributes','limit','include','map','ShowServicenowAccount','ServicenowAccount','find','raw','model','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x460bf4,_0x9e8009){var _0x4ad8fc=function(_0x456cca){while(--_0x456cca){_0x460bf4['push'](_0x460bf4['shift']());}};_0x4ad8fc(++_0x9e8009);}(_0xdb62,0xb9));var _0x2db6=function(_0x3f2d02,_0x2c7deb){_0x3f2d02=_0x3f2d02-0x0;var _0x54092b=_0xdb62[_0x3f2d02];return _0x54092b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2db6('0x0'));var BPromise=require(_0x2db6('0x1'));var rs=require(_0x2db6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2db6('0x3'));var logger=require(_0x2db6('0x4'))(_0x2db6('0x5'));var config=require(_0x2db6('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2db6('0x7')][_0x2db6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x409c50,_0x197687,_0x885750){return new BPromise(function(_0x22446d,_0x2b5505){return client[_0x2db6('0x9')](_0x409c50,_0x885750)[_0x2db6('0xa')](function(_0x37b04f){logger[_0x2db6('0xb')](_0x2db6('0xc'),_0x197687,'request\x20sent');logger[_0x2db6('0xd')](_0x2db6('0xe'),_0x197687,'request\x20sent',JSON[_0x2db6('0xf')](_0x37b04f));if(_0x37b04f['error']){if(_0x37b04f[_0x2db6('0x10')][_0x2db6('0x11')]===0x1f4){logger[_0x2db6('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x197687,_0x37b04f[_0x2db6('0x10')][_0x2db6('0x12')]);return _0x2b5505(_0x37b04f[_0x2db6('0x10')][_0x2db6('0x12')]);}logger[_0x2db6('0x10')](_0x2db6('0xc'),_0x197687,_0x37b04f['error']['message']);return _0x22446d(_0x37b04f[_0x2db6('0x10')][_0x2db6('0x12')]);}else{logger[_0x2db6('0xb')](_0x2db6('0xc'),_0x197687,_0x2db6('0x13'));_0x22446d(_0x37b04f['result'][_0x2db6('0x12')]);}})[_0x2db6('0x14')](function(_0x4aff36){logger[_0x2db6('0x10')](_0x2db6('0xc'),_0x197687,_0x4aff36);_0x2b5505(_0x4aff36);});});}exports[_0x2db6('0x15')]=function(_0x5698f7){var _0x1c2c20=this;return new Promise(function(_0x194938,_0x2121f3){return db['ServicenowAccount'][_0x2db6('0x16')]({'raw':_0x5698f7[_0x2db6('0x17')]?_0x5698f7['options']['raw']===undefined?!![]:![]:!![],'where':_0x5698f7['options']?_0x5698f7[_0x2db6('0x17')][_0x2db6('0x18')]||null:null,'attributes':_0x5698f7[_0x2db6('0x17')]?_0x5698f7[_0x2db6('0x17')][_0x2db6('0x19')]||null:null,'limit':_0x5698f7['options']?_0x5698f7[_0x2db6('0x17')][_0x2db6('0x1a')]||null:null,'include':_0x5698f7[_0x2db6('0x17')]?_0x5698f7[_0x2db6('0x17')][_0x2db6('0x1b')]?_[_0x2db6('0x1c')](_0x5698f7[_0x2db6('0x17')][_0x2db6('0x1b')],function(_0x2d98fe){return{'model':db[_0x2d98fe['model']],'as':_0x2d98fe['as'],'attributes':_0x2d98fe[_0x2db6('0x19')],'include':_0x2d98fe[_0x2db6('0x1b')]?_[_0x2db6('0x1c')](_0x2d98fe['include'],function(_0x10c4db){return{'model':db[_0x10c4db['model']],'as':_0x10c4db['as'],'attributes':_0x10c4db[_0x2db6('0x19')],'include':_0x10c4db[_0x2db6('0x1b')]?_[_0x2db6('0x1c')](_0x10c4db[_0x2db6('0x1b')],function(_0x11a961){return{'model':db[_0x11a961['model']],'as':_0x11a961['as'],'attributes':_0x11a961[_0x2db6('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x229ce0){logger[_0x2db6('0xb')](_0x2db6('0x15'),_0x5698f7);logger[_0x2db6('0xd')]('GetServicenowAccount',_0x5698f7,JSON[_0x2db6('0xf')](_0x229ce0));_0x194938(_0x229ce0);})[_0x2db6('0x14')](function(_0x29d3db){logger['error'](_0x2db6('0x15'),_0x29d3db['message'],_0x5698f7);_0x2121f3(_0x1c2c20[_0x2db6('0x10')](0x1f4,_0x29d3db[_0x2db6('0x12')]));});});};exports[_0x2db6('0x1d')]=function(_0x1bf5ec){var _0x5b1d15=this;return new Promise(function(_0x50e7e5,_0x9a3ab){return db[_0x2db6('0x1e')][_0x2db6('0x1f')]({'raw':_0x1bf5ec[_0x2db6('0x17')]?_0x1bf5ec[_0x2db6('0x17')][_0x2db6('0x20')]===undefined?!![]:![]:!![],'where':_0x1bf5ec[_0x2db6('0x17')]?_0x1bf5ec[_0x2db6('0x17')][_0x2db6('0x18')]||null:null,'attributes':_0x1bf5ec[_0x2db6('0x17')]?_0x1bf5ec[_0x2db6('0x17')][_0x2db6('0x19')]||null:null,'include':_0x1bf5ec[_0x2db6('0x17')]?_0x1bf5ec[_0x2db6('0x17')]['include']?_[_0x2db6('0x1c')](_0x1bf5ec['options'][_0x2db6('0x1b')],function(_0x562a5b){return{'model':db[_0x562a5b[_0x2db6('0x21')]],'as':_0x562a5b['as'],'attributes':_0x562a5b[_0x2db6('0x19')],'include':_0x562a5b[_0x2db6('0x1b')]?_[_0x2db6('0x1c')](_0x562a5b[_0x2db6('0x1b')],function(_0x58ed41){return{'model':db[_0x58ed41['model']],'as':_0x58ed41['as'],'attributes':_0x58ed41[_0x2db6('0x19')],'include':_0x58ed41['include']?_[_0x2db6('0x1c')](_0x58ed41[_0x2db6('0x1b')],function(_0x418f11){return{'model':db[_0x418f11[_0x2db6('0x21')]],'as':_0x418f11['as'],'attributes':_0x418f11['attributes']};}):[]};}):[]};}):[]:[]})[_0x2db6('0xa')](function(_0x2fb066){logger[_0x2db6('0xb')](_0x2db6('0x1d'),_0x1bf5ec);logger['debug']('ShowServicenowAccount',_0x1bf5ec,JSON[_0x2db6('0xf')](_0x2fb066));_0x50e7e5(_0x2fb066);})['catch'](function(_0x2479c6){logger[_0x2db6('0x10')](_0x2db6('0x1d'),_0x2479c6['message'],_0x1bf5ec);_0x9a3ab(_0x5b1d15[_0x2db6('0x10')](0x1f4,_0x2479c6[_0x2db6('0x12')]));});});}; \ No newline at end of file +var _0x9200=['util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','client','request','then','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','info','request\x20sent','result','catch','GetServicenowAccount','findAll','options','where','attributes','limit','include','model','map','ShowServicenowAccount','ServicenowAccount','find'];(function(_0x4c6144,_0x58925a){var _0xe92275=function(_0x16a90d){while(--_0x16a90d){_0x4c6144['push'](_0x4c6144['shift']());}};_0xe92275(++_0x58925a);}(_0x9200,0x1ce));var _0x0920=function(_0xca485f,_0xfc3a89){_0xca485f=_0xca485f-0x0;var _0x3df755=_0x9200[_0xca485f];return _0x3df755;};'use strict';var _=require('lodash');var util=require(_0x0920('0x0'));var moment=require(_0x0920('0x1'));var BPromise=require(_0x0920('0x2'));var rs=require(_0x0920('0x3'));var fs=require('fs');var Redis=require(_0x0920('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0920('0x5'));var logger=require('../../config/logger')(_0x0920('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0920('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2313a8,_0x45358c,_0xfc5f0a){return new BPromise(function(_0x10481e,_0x2b8326){return client[_0x0920('0x8')](_0x2313a8,_0xfc5f0a)[_0x0920('0x9')](function(_0x39321c){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x45358c,'request\x20sent');logger[_0x0920('0xa')](_0x0920('0xb'),_0x45358c,'request\x20sent',JSON[_0x0920('0xc')](_0x39321c));if(_0x39321c[_0x0920('0xd')]){if(_0x39321c[_0x0920('0xd')][_0x0920('0xe')]===0x1f4){logger[_0x0920('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0x45358c,_0x39321c[_0x0920('0xd')][_0x0920('0xf')]);return _0x2b8326(_0x39321c[_0x0920('0xd')]['message']);}logger[_0x0920('0xd')](_0x0920('0x10'),_0x45358c,_0x39321c['error'][_0x0920('0xf')]);return _0x10481e(_0x39321c[_0x0920('0xd')][_0x0920('0xf')]);}else{logger[_0x0920('0x11')](_0x0920('0x10'),_0x45358c,_0x0920('0x12'));_0x10481e(_0x39321c[_0x0920('0x13')]['message']);}})[_0x0920('0x14')](function(_0x24ad3c){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x45358c,_0x24ad3c);_0x2b8326(_0x24ad3c);});});}exports[_0x0920('0x15')]=function(_0xd8f474){var _0x834d43=this;return new Promise(function(_0x2b148a,_0x1d607a){return db['ServicenowAccount'][_0x0920('0x16')]({'raw':_0xd8f474['options']?_0xd8f474[_0x0920('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0xd8f474[_0x0920('0x17')]?_0xd8f474['options'][_0x0920('0x18')]||null:null,'attributes':_0xd8f474['options']?_0xd8f474['options'][_0x0920('0x19')]||null:null,'limit':_0xd8f474['options']?_0xd8f474[_0x0920('0x17')][_0x0920('0x1a')]||null:null,'include':_0xd8f474['options']?_0xd8f474[_0x0920('0x17')][_0x0920('0x1b')]?_['map'](_0xd8f474[_0x0920('0x17')][_0x0920('0x1b')],function(_0x27a7cc){return{'model':db[_0x27a7cc[_0x0920('0x1c')]],'as':_0x27a7cc['as'],'attributes':_0x27a7cc['attributes'],'include':_0x27a7cc[_0x0920('0x1b')]?_[_0x0920('0x1d')](_0x27a7cc[_0x0920('0x1b')],function(_0x5aa232){return{'model':db[_0x5aa232[_0x0920('0x1c')]],'as':_0x5aa232['as'],'attributes':_0x5aa232['attributes'],'include':_0x5aa232[_0x0920('0x1b')]?_[_0x0920('0x1d')](_0x5aa232[_0x0920('0x1b')],function(_0x252202){return{'model':db[_0x252202[_0x0920('0x1c')]],'as':_0x252202['as'],'attributes':_0x252202[_0x0920('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46061f){logger[_0x0920('0x11')](_0x0920('0x15'),_0xd8f474);logger[_0x0920('0xa')](_0x0920('0x15'),_0xd8f474,JSON[_0x0920('0xc')](_0x46061f));_0x2b148a(_0x46061f);})['catch'](function(_0x254c31){logger['error'](_0x0920('0x15'),_0x254c31['message'],_0xd8f474);_0x1d607a(_0x834d43['error'](0x1f4,_0x254c31[_0x0920('0xf')]));});});};exports[_0x0920('0x1e')]=function(_0x48cc7c){var _0x35da2e=this;return new Promise(function(_0x276d67,_0x5d8316){return db[_0x0920('0x1f')][_0x0920('0x20')]({'raw':_0x48cc7c[_0x0920('0x17')]?_0x48cc7c[_0x0920('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x48cc7c[_0x0920('0x17')]?_0x48cc7c[_0x0920('0x17')][_0x0920('0x18')]||null:null,'attributes':_0x48cc7c[_0x0920('0x17')]?_0x48cc7c['options']['attributes']||null:null,'include':_0x48cc7c[_0x0920('0x17')]?_0x48cc7c[_0x0920('0x17')]['include']?_[_0x0920('0x1d')](_0x48cc7c['options'][_0x0920('0x1b')],function(_0xfaf829){return{'model':db[_0xfaf829[_0x0920('0x1c')]],'as':_0xfaf829['as'],'attributes':_0xfaf829[_0x0920('0x19')],'include':_0xfaf829[_0x0920('0x1b')]?_[_0x0920('0x1d')](_0xfaf829[_0x0920('0x1b')],function(_0x3d77cc){return{'model':db[_0x3d77cc[_0x0920('0x1c')]],'as':_0x3d77cc['as'],'attributes':_0x3d77cc['attributes'],'include':_0x3d77cc[_0x0920('0x1b')]?_[_0x0920('0x1d')](_0x3d77cc[_0x0920('0x1b')],function(_0x319ada){return{'model':db[_0x319ada['model']],'as':_0x319ada['as'],'attributes':_0x319ada['attributes']};}):[]};}):[]};}):[]:[]})[_0x0920('0x9')](function(_0x3ef3d1){logger[_0x0920('0x11')](_0x0920('0x1e'),_0x48cc7c);logger[_0x0920('0xa')](_0x0920('0x1e'),_0x48cc7c,JSON[_0x0920('0xc')](_0x3ef3d1));_0x276d67(_0x3ef3d1);})[_0x0920('0x14')](function(_0x314541){logger[_0x0920('0xd')](_0x0920('0x1e'),_0x314541[_0x0920('0xf')],_0x48cc7c);_0x5d8316(_0x35da2e[_0x0920('0xd')](0x1f4,_0x314541['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 459f2c3..4863968 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 _0xc14d=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/subjects','getSubjects','post','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x3545e2,_0x3c2c69){var _0x218534=function(_0x5e9a14){while(--_0x5e9a14){_0x3545e2['push'](_0x3545e2['shift']());}};_0x218534(++_0x3c2c69);}(_0xc14d,0xed));var _0xdc14=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc14d[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xdc14('0x0'));var util=require(_0xdc14('0x1'));var path=require(_0xdc14('0x2'));var timeout=require(_0xdc14('0x3'));var express=require('express');var router=express[_0xdc14('0x4')]();var fs_extra=require(_0xdc14('0x5'));var auth=require(_0xdc14('0x6'));var interaction=require(_0xdc14('0x7'));var config=require('../../config/environment');var controller=require(_0xdc14('0x8'));router[_0xdc14('0x9')]('/',auth[_0xdc14('0xa')](),controller[_0xdc14('0xb')]);router[_0xdc14('0x9')]('/:id',auth[_0xdc14('0xa')](),controller['show']);router[_0xdc14('0x9')](_0xdc14('0xc'),auth[_0xdc14('0xa')](),controller[_0xdc14('0xd')]);router['get'](_0xdc14('0xe'),auth[_0xdc14('0xa')](),controller[_0xdc14('0xf')]);router['get']('/:id/descriptions',auth[_0xdc14('0xa')](),controller['getDescriptions']);router[_0xdc14('0x10')]('/',auth[_0xdc14('0xa')](),controller[_0xdc14('0x11')]);router[_0xdc14('0x12')](_0xdc14('0x13'),auth[_0xdc14('0xa')](),controller[_0xdc14('0x14')]);router[_0xdc14('0x15')](_0xdc14('0x13'),auth[_0xdc14('0xa')](),controller[_0xdc14('0x16')]);module[_0xdc14('0x17')]=router; \ No newline at end of file +var _0xcd10=['getDescriptions','post','create','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','../../config/environment','./intServicenowConfiguration.controller','isAuthenticated','index','get','show','/:id/fields','getSubjects'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0xcd10,0xe5));var _0x0cd1=function(_0xc7e986,_0x3cc9a0){_0xc7e986=_0xc7e986-0x0;var _0x1b5be7=_0xcd10[_0xc7e986];return _0x1b5be7;};'use strict';var multer=require('multer');var util=require(_0x0cd1('0x0'));var path=require(_0x0cd1('0x1'));var timeout=require(_0x0cd1('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x0cd1('0x3'));var controller=require(_0x0cd1('0x4'));router['get']('/',auth[_0x0cd1('0x5')](),controller[_0x0cd1('0x6')]);router[_0x0cd1('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x0cd1('0x8')]);router[_0x0cd1('0x7')](_0x0cd1('0x9'),auth[_0x0cd1('0x5')](),controller['getFields']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0x0cd1('0xa')]);router[_0x0cd1('0x7')]('/:id/descriptions',auth[_0x0cd1('0x5')](),controller[_0x0cd1('0xb')]);router[_0x0cd1('0xc')]('/',auth[_0x0cd1('0x5')](),controller[_0x0cd1('0xd')]);router[_0x0cd1('0xe')](_0x0cd1('0xf'),auth[_0x0cd1('0x5')](),controller[_0x0cd1('0x10')]);router[_0x0cd1('0x11')](_0x0cd1('0xf'),auth[_0x0cd1('0x5')](),controller[_0x0cd1('0x12')]);module[_0x0cd1('0x13')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 3c069c9..7fe26c4 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 _0xfcb1=['sequelize','exports','STRING'];(function(_0xcb1763,_0x1b9378){var _0x3dab56=function(_0x4ed540){while(--_0x4ed540){_0xcb1763['push'](_0xcb1763['shift']());}};_0x3dab56(++_0x1b9378);}(_0xfcb1,0x1d1));var _0x1fcb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfcb1[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x1fcb('0x0'));module[_0x1fcb('0x1')]={'name':{'type':Sequelize[_0x1fcb('0x2')]},'description':{'type':Sequelize[_0x1fcb('0x2')]}}; \ No newline at end of file +var _0x139a=['sequelize','exports','STRING'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x139a,0x198));var _0xa139=function(_0x1b5e3e,_0x1cd8a4){_0x1b5e3e=_0x1b5e3e-0x0;var _0x48c26f=_0x139a[_0x1b5e3e];return _0x48c26f;};'use strict';var Sequelize=require(_0xa139('0x0'));module[_0xa139('0x1')]={'name':{'type':Sequelize[_0xa139('0x2')]},'description':{'type':Sequelize[_0xa139('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index d3237a3..529adb7 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 _0xda6b=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','options','ServicenowConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','findOne','ServicenowField','hasOwnProperty','getSubjects','getDescriptions'];(function(_0x4c139c,_0x59071a){var _0x3fbb6a=function(_0x23d7d2){while(--_0x23d7d2){_0x4c139c['push'](_0x4c139c['shift']());}};_0x3fbb6a(++_0x59071a);}(_0xda6b,0xf3));var _0xbda6=function(_0x33dffc,_0x2be66e){_0x33dffc=_0x33dffc-0x0;var _0x1f5420=_0xda6b[_0x33dffc];return _0x1f5420;};'use strict';var emlformat=require(_0xbda6('0x0'));var rimraf=require(_0xbda6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbda6('0x2'));var rp=require(_0xbda6('0x3'));var moment=require(_0xbda6('0x4'));var BPromise=require(_0xbda6('0x5'));var Mustache=require('mustache');var util=require(_0xbda6('0x6'));var path=require(_0xbda6('0x7'));var sox=require('sox');var csv=require(_0xbda6('0x8'));var ejs=require(_0xbda6('0x9'));var fs=require('fs');var fs_extra=require(_0xbda6('0xa'));var _=require(_0xbda6('0xb'));var squel=require(_0xbda6('0xc'));var crypto=require('crypto');var jsforce=require(_0xbda6('0xd'));var deskjs=require(_0xbda6('0xe'));var toCsv=require(_0xbda6('0x8'));var querystring=require('querystring');var Papa=require(_0xbda6('0xf'));var Redis=require(_0xbda6('0x10'));var authService=require(_0xbda6('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbda6('0x12'));var hardwareService=require(_0xbda6('0x13'));var logger=require(_0xbda6('0x14'))(_0xbda6('0x15'));var utils=require(_0xbda6('0x16'));var config=require(_0xbda6('0x17'));var licenseUtil=require(_0xbda6('0x18'));var db=require(_0xbda6('0x19'))['db'];function respondWithStatusCode(_0x2eb2d8,_0x5a44cc){_0x5a44cc=_0x5a44cc||0xcc;return function(_0x465b63){if(_0x465b63){return _0x2eb2d8[_0xbda6('0x1a')](_0x5a44cc);}return _0x2eb2d8['status'](_0x5a44cc)[_0xbda6('0x1b')]();};}function respondWithResult(_0x2e1055,_0x4a3b9b){_0x4a3b9b=_0x4a3b9b||0xc8;return function(_0x3508d0){if(_0x3508d0){return _0x2e1055[_0xbda6('0x1c')](_0x4a3b9b)[_0xbda6('0x1d')](_0x3508d0);}};}function respondWithFilteredResult(_0x1aa45b,_0x4d2b75){return function(_0x14a93){if(_0x14a93){var _0x2d6ce5=typeof _0x4d2b75[_0xbda6('0x1e')]===_0xbda6('0x1f')&&typeof _0x4d2b75['limit']==='undefined';var _0x2c7b1f=_0x14a93[_0xbda6('0x20')];var _0x3d38fc=_0x2d6ce5?0x0:_0x4d2b75[_0xbda6('0x1e')];var _0x282f3f=_0x2d6ce5?_0x14a93[_0xbda6('0x20')]:_0x4d2b75[_0xbda6('0x1e')]+_0x4d2b75[_0xbda6('0x21')];var _0x474b79;if(_0x282f3f>=_0x2c7b1f){_0x282f3f=_0x2c7b1f;_0x474b79=0xc8;}else{_0x474b79=0xce;}_0x1aa45b[_0xbda6('0x1c')](_0x474b79);return _0x1aa45b[_0xbda6('0x22')](_0xbda6('0x23'),_0x3d38fc+'-'+_0x282f3f+'/'+_0x2c7b1f)[_0xbda6('0x1d')](_0x14a93);}return null;};}function patchUpdates(_0x401374){return function(_0xf43b53){try{jsonpatch['apply'](_0xf43b53,_0x401374,!![]);}catch(_0x495bf7){return BPromise['reject'](_0x495bf7);}return _0xf43b53['save']();};}function saveUpdates(_0x41c042,_0x4d6edf){return function(_0x432f56){if(_0x432f56){return _0x432f56[_0xbda6('0x24')](_0x41c042)[_0xbda6('0x25')](function(_0x5c9629){return _0x5c9629;});}return null;};}function removeEntity(_0x4c1d8a,_0x20c7ac){return function(_0x45d156){if(_0x45d156){return _0x45d156[_0xbda6('0x26')]()[_0xbda6('0x25')](function(){_0x4c1d8a[_0xbda6('0x1c')](0xcc)[_0xbda6('0x1b')]();});}};}function handleEntityNotFound(_0x5c2507,_0x42af98){return function(_0x51ba8e){if(!_0x51ba8e){_0x5c2507['sendStatus'](0x194);}return _0x51ba8e;};}function handleError(_0x253cf3,_0x461e1f){_0x461e1f=_0x461e1f||0x1f4;return function(_0x4bc38a){logger[_0xbda6('0x27')](_0x4bc38a['stack']);if(_0x4bc38a['name']){delete _0x4bc38a[_0xbda6('0x28')];}_0x253cf3[_0xbda6('0x1c')](_0x461e1f)[_0xbda6('0x29')](_0x4bc38a);};}exports[_0xbda6('0x2a')]=function(_0x5b4e5f,_0x29b0d2){var _0x55e2={},_0x154f2d={},_0x5e3518={'count':0x0,'rows':[]};var _0x1fbaa4=_[_0xbda6('0x2b')](db['ServicenowConfiguration'][_0xbda6('0x2c')],function(_0xf08964){return{'name':_0xf08964[_0xbda6('0x2d')],'type':_0xf08964[_0xbda6('0x2e')][_0xbda6('0x2f')]};});_0x154f2d[_0xbda6('0x30')]=_['map'](_0x1fbaa4,'name');_0x154f2d[_0xbda6('0x31')]=_[_0xbda6('0x32')](_0x5b4e5f[_0xbda6('0x31')]);_0x154f2d['filters']=_[_0xbda6('0x33')](_0x154f2d[_0xbda6('0x30')],_0x154f2d[_0xbda6('0x31')]);_0x55e2[_0xbda6('0x34')]=_[_0xbda6('0x33')](_0x154f2d[_0xbda6('0x30')],qs[_0xbda6('0x35')](_0x5b4e5f[_0xbda6('0x31')][_0xbda6('0x35')]));_0x55e2[_0xbda6('0x34')]=_0x55e2[_0xbda6('0x34')][_0xbda6('0x36')]?_0x55e2[_0xbda6('0x34')]:_0x154f2d['model'];if(!_0x5b4e5f['query']['hasOwnProperty'](_0xbda6('0x37'))){_0x55e2[_0xbda6('0x21')]=qs[_0xbda6('0x21')](_0x5b4e5f[_0xbda6('0x31')][_0xbda6('0x21')]);_0x55e2[_0xbda6('0x1e')]=qs[_0xbda6('0x1e')](_0x5b4e5f[_0xbda6('0x31')]['offset']);}_0x55e2[_0xbda6('0x38')]=qs[_0xbda6('0x39')](_0x5b4e5f[_0xbda6('0x31')][_0xbda6('0x39')]);_0x55e2[_0xbda6('0x3a')]=qs['filters'](_[_0xbda6('0x3b')](_0x5b4e5f['query'],_0x154f2d[_0xbda6('0x3c')]),_0x1fbaa4);if(_0x5b4e5f[_0xbda6('0x31')][_0xbda6('0x3d')]){_0x55e2['where']=_[_0xbda6('0x3e')](_0x55e2[_0xbda6('0x3a')],{'$or':_[_0xbda6('0x2b')](_0x1fbaa4,function(_0x1d4f01){if(_0x1d4f01[_0xbda6('0x2e')]!=='VIRTUAL'){var _0x3b8f83={};_0x3b8f83[_0x1d4f01[_0xbda6('0x28')]]={'$like':'%'+_0x5b4e5f[_0xbda6('0x31')][_0xbda6('0x3d')]+'%'};return _0x3b8f83;}})});}_0x55e2=_['merge']({},_0x55e2,_0x5b4e5f[_0xbda6('0x3f')]);var _0x5709e5={'where':_0x55e2['where']};return db[_0xbda6('0x40')][_0xbda6('0x20')](_0x5709e5)[_0xbda6('0x25')](function(_0x2991b8){_0x5e3518['count']=_0x2991b8;if(_0x5b4e5f[_0xbda6('0x31')][_0xbda6('0x41')]){_0x55e2[_0xbda6('0x42')]=[{'all':!![]}];}return db[_0xbda6('0x40')][_0xbda6('0x43')](_0x55e2);})[_0xbda6('0x25')](function(_0x27ca2b){_0x5e3518[_0xbda6('0x44')]=_0x27ca2b;return _0x5e3518;})[_0xbda6('0x25')](respondWithFilteredResult(_0x29b0d2,_0x55e2))[_0xbda6('0x45')](handleError(_0x29b0d2,null));};exports[_0xbda6('0x46')]=function(_0xb5093,_0x28caac){var _0x5104b4={'raw':![],'where':{'id':_0xb5093[_0xbda6('0x47')]['id']}},_0x483997={};_0x483997[_0xbda6('0x30')]=_['keys'](db[_0xbda6('0x40')][_0xbda6('0x2c')]);_0x483997['query']=_[_0xbda6('0x32')](_0xb5093[_0xbda6('0x31')]);_0x483997[_0xbda6('0x3c')]=_[_0xbda6('0x33')](_0x483997[_0xbda6('0x30')],_0x483997[_0xbda6('0x31')]);_0x5104b4['attributes']=_['intersection'](_0x483997[_0xbda6('0x30')],qs[_0xbda6('0x35')](_0xb5093['query'][_0xbda6('0x35')]));_0x5104b4[_0xbda6('0x34')]=_0x5104b4[_0xbda6('0x34')]['length']?_0x5104b4[_0xbda6('0x34')]:_0x483997[_0xbda6('0x30')];if(_0xb5093[_0xbda6('0x31')][_0xbda6('0x41')]){_0x5104b4[_0xbda6('0x42')]=[{'all':!![]}];}_0x5104b4=_[_0xbda6('0x3e')]({},_0x5104b4,_0xb5093[_0xbda6('0x3f')]);return db[_0xbda6('0x40')][_0xbda6('0x48')](_0x5104b4)[_0xbda6('0x25')](handleEntityNotFound(_0x28caac,null))['then'](respondWithResult(_0x28caac,null))[_0xbda6('0x45')](handleError(_0x28caac,null));};exports['create']=function(_0x152862,_0x6d93f2){return db[_0xbda6('0x40')][_0xbda6('0x49')](_0x152862['body'],{})[_0xbda6('0x25')](respondWithResult(_0x6d93f2,0xc9))[_0xbda6('0x45')](handleError(_0x6d93f2,null));};exports[_0xbda6('0x24')]=function(_0x458f2a,_0x2f7472){if(_0x458f2a['body']['id']){delete _0x458f2a[_0xbda6('0x4a')]['id'];}return db['ServicenowConfiguration'][_0xbda6('0x48')]({'where':{'id':_0x458f2a[_0xbda6('0x47')]['id']}})['then'](handleEntityNotFound(_0x2f7472,null))[_0xbda6('0x25')](saveUpdates(_0x458f2a['body'],null))[_0xbda6('0x25')](respondWithResult(_0x2f7472,null))[_0xbda6('0x45')](handleError(_0x2f7472,null));};exports['destroy']=function(_0x12953e,_0x76efe){return db[_0xbda6('0x40')][_0xbda6('0x48')]({'where':{'id':_0x12953e[_0xbda6('0x47')]['id']}})[_0xbda6('0x25')](handleEntityNotFound(_0x76efe,null))[_0xbda6('0x25')](removeEntity(_0x76efe,null))['catch'](handleError(_0x76efe,null));};exports[_0xbda6('0x4b')]=function(_0x791708,_0x2d2ed0,_0x483ef3){var _0x1cb2b0={};var _0x21a338={};var _0x465bd2;var _0xa8f204;return db[_0xbda6('0x40')][_0xbda6('0x4c')]({'where':{'id':_0x791708[_0xbda6('0x47')]['id']}})[_0xbda6('0x25')](handleEntityNotFound(_0x2d2ed0,null))['then'](function(_0x2f4fc3){if(_0x2f4fc3){_0x465bd2=_0x2f4fc3;_0x21a338['model']=_[_0xbda6('0x32')](db[_0xbda6('0x4d')]['rawAttributes']);_0x21a338[_0xbda6('0x31')]=_[_0xbda6('0x32')](_0x791708[_0xbda6('0x31')]);_0x21a338[_0xbda6('0x3c')]=_[_0xbda6('0x33')](_0x21a338[_0xbda6('0x30')],_0x21a338[_0xbda6('0x31')]);_0x1cb2b0[_0xbda6('0x34')]=_['intersection'](_0x21a338[_0xbda6('0x30')],qs[_0xbda6('0x35')](_0x791708['query'][_0xbda6('0x35')]));_0x1cb2b0[_0xbda6('0x34')]=_0x1cb2b0['attributes'][_0xbda6('0x36')]?_0x1cb2b0[_0xbda6('0x34')]:_0x21a338[_0xbda6('0x30')];_0x1cb2b0[_0xbda6('0x38')]=qs['sort'](_0x791708['query'][_0xbda6('0x39')]);_0x1cb2b0[_0xbda6('0x3a')]=qs['filters'](_['pick'](_0x791708[_0xbda6('0x31')],_0x21a338[_0xbda6('0x3c')]));if(_0x791708[_0xbda6('0x31')]['filter']){_0x1cb2b0[_0xbda6('0x3a')]=_[_0xbda6('0x3e')](_0x1cb2b0[_0xbda6('0x3a')],{'$or':_['map'](_0x1cb2b0[_0xbda6('0x34')],function(_0x5a732c){var _0x440521={};_0x440521[_0x5a732c]={'$like':'%'+_0x791708[_0xbda6('0x31')]['filter']+'%'};return _0x440521;})});}_0x1cb2b0=_[_0xbda6('0x3e')]({},_0x1cb2b0,_0x791708[_0xbda6('0x3f')]);return _0x465bd2[_0xbda6('0x4b')](_0x1cb2b0);}})[_0xbda6('0x25')](function(_0x20c0c2){if(_0x20c0c2){_0xa8f204=_0x20c0c2[_0xbda6('0x36')];if(!_0x791708[_0xbda6('0x31')][_0xbda6('0x4e')](_0xbda6('0x37'))){_0x1cb2b0[_0xbda6('0x21')]=qs[_0xbda6('0x21')](_0x791708[_0xbda6('0x31')]['limit']);_0x1cb2b0[_0xbda6('0x1e')]=qs[_0xbda6('0x1e')](_0x791708[_0xbda6('0x31')]['offset']);}return _0x465bd2['getFields'](_0x1cb2b0);}})['then'](function(_0x10675b){if(_0x10675b){return _0x10675b?{'count':_0xa8f204,'rows':_0x10675b}:null;}})['then'](respondWithResult(_0x2d2ed0,null))[_0xbda6('0x45')](handleError(_0x2d2ed0,null));};exports[_0xbda6('0x4f')]=function(_0x208806,_0x350566,_0x6fc33d){var _0x427365={};var _0x43230a={};var _0x2dea17;var _0x3114cd;return db[_0xbda6('0x40')]['findOne']({'where':{'id':_0x208806['params']['id']}})[_0xbda6('0x25')](handleEntityNotFound(_0x350566,null))[_0xbda6('0x25')](function(_0x54f01d){if(_0x54f01d){_0x2dea17=_0x54f01d;_0x43230a[_0xbda6('0x30')]=_[_0xbda6('0x32')](db['ServicenowField'][_0xbda6('0x2c')]);_0x43230a[_0xbda6('0x31')]=_['keys'](_0x208806['query']);_0x43230a[_0xbda6('0x3c')]=_['intersection'](_0x43230a['model'],_0x43230a[_0xbda6('0x31')]);_0x427365['attributes']=_[_0xbda6('0x33')](_0x43230a[_0xbda6('0x30')],qs['fields'](_0x208806[_0xbda6('0x31')][_0xbda6('0x35')]));_0x427365[_0xbda6('0x34')]=_0x427365[_0xbda6('0x34')]['length']?_0x427365[_0xbda6('0x34')]:_0x43230a[_0xbda6('0x30')];_0x427365[_0xbda6('0x38')]=qs[_0xbda6('0x39')](_0x208806[_0xbda6('0x31')][_0xbda6('0x39')]);_0x427365[_0xbda6('0x3a')]=qs[_0xbda6('0x3c')](_[_0xbda6('0x3b')](_0x208806[_0xbda6('0x31')],_0x43230a[_0xbda6('0x3c')]));if(_0x208806[_0xbda6('0x31')]['filter']){_0x427365[_0xbda6('0x3a')]=_[_0xbda6('0x3e')](_0x427365[_0xbda6('0x3a')],{'$or':_[_0xbda6('0x2b')](_0x427365[_0xbda6('0x34')],function(_0x2e08f0){var _0x6b2c50={};_0x6b2c50[_0x2e08f0]={'$like':'%'+_0x208806[_0xbda6('0x31')][_0xbda6('0x3d')]+'%'};return _0x6b2c50;})});}_0x427365=_[_0xbda6('0x3e')]({},_0x427365,_0x208806['options']);return _0x2dea17['getSubjects'](_0x427365);}})['then'](function(_0x129ddb){if(_0x129ddb){_0x3114cd=_0x129ddb['length'];if(!_0x208806[_0xbda6('0x31')][_0xbda6('0x4e')](_0xbda6('0x37'))){_0x427365[_0xbda6('0x21')]=qs[_0xbda6('0x21')](_0x208806[_0xbda6('0x31')][_0xbda6('0x21')]);_0x427365['offset']=qs[_0xbda6('0x1e')](_0x208806['query']['offset']);}return _0x2dea17[_0xbda6('0x4f')](_0x427365);}})[_0xbda6('0x25')](function(_0x294e08){if(_0x294e08){return _0x294e08?{'count':_0x3114cd,'rows':_0x294e08}:null;}})[_0xbda6('0x25')](respondWithResult(_0x350566,null))[_0xbda6('0x45')](handleError(_0x350566,null));};exports[_0xbda6('0x50')]=function(_0x4571dd,_0x3288b0,_0x13d3a1){var _0x3f8f67={};var _0xfedbb5={};var _0xc50327;var _0xa12b42;return db['ServicenowConfiguration'][_0xbda6('0x4c')]({'where':{'id':_0x4571dd['params']['id']}})['then'](handleEntityNotFound(_0x3288b0,null))[_0xbda6('0x25')](function(_0x2d82a9){if(_0x2d82a9){_0xc50327=_0x2d82a9;_0xfedbb5['model']=_[_0xbda6('0x32')](db[_0xbda6('0x4d')][_0xbda6('0x2c')]);_0xfedbb5[_0xbda6('0x31')]=_[_0xbda6('0x32')](_0x4571dd[_0xbda6('0x31')]);_0xfedbb5[_0xbda6('0x3c')]=_[_0xbda6('0x33')](_0xfedbb5[_0xbda6('0x30')],_0xfedbb5['query']);_0x3f8f67[_0xbda6('0x34')]=_[_0xbda6('0x33')](_0xfedbb5[_0xbda6('0x30')],qs[_0xbda6('0x35')](_0x4571dd[_0xbda6('0x31')][_0xbda6('0x35')]));_0x3f8f67[_0xbda6('0x34')]=_0x3f8f67['attributes'][_0xbda6('0x36')]?_0x3f8f67['attributes']:_0xfedbb5[_0xbda6('0x30')];_0x3f8f67[_0xbda6('0x38')]=qs[_0xbda6('0x39')](_0x4571dd[_0xbda6('0x31')]['sort']);_0x3f8f67['where']=qs[_0xbda6('0x3c')](_[_0xbda6('0x3b')](_0x4571dd[_0xbda6('0x31')],_0xfedbb5[_0xbda6('0x3c')]));if(_0x4571dd[_0xbda6('0x31')][_0xbda6('0x3d')]){_0x3f8f67[_0xbda6('0x3a')]=_[_0xbda6('0x3e')](_0x3f8f67['where'],{'$or':_[_0xbda6('0x2b')](_0x3f8f67[_0xbda6('0x34')],function(_0x3bcb13){var _0x5536a6={};_0x5536a6[_0x3bcb13]={'$like':'%'+_0x4571dd[_0xbda6('0x31')]['filter']+'%'};return _0x5536a6;})});}_0x3f8f67=_['merge']({},_0x3f8f67,_0x4571dd[_0xbda6('0x3f')]);return _0xc50327[_0xbda6('0x50')](_0x3f8f67);}})['then'](function(_0x2920e8){if(_0x2920e8){_0xa12b42=_0x2920e8[_0xbda6('0x36')];if(!_0x4571dd[_0xbda6('0x31')][_0xbda6('0x4e')](_0xbda6('0x37'))){_0x3f8f67[_0xbda6('0x21')]=qs[_0xbda6('0x21')](_0x4571dd['query']['limit']);_0x3f8f67[_0xbda6('0x1e')]=qs[_0xbda6('0x1e')](_0x4571dd[_0xbda6('0x31')][_0xbda6('0x1e')]);}return _0xc50327[_0xbda6('0x50')](_0x3f8f67);}})[_0xbda6('0x25')](function(_0x5b1ac0){if(_0x5b1ac0){return _0x5b1ac0?{'count':_0xa12b42,'rows':_0x5b1ac0}:null;}})['then'](respondWithResult(_0x3288b0,null))[_0xbda6('0x45')](handleError(_0x3288b0,null));}; \ No newline at end of file +var _0xbef8=['nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','find','create','body','params','destroy','findOne','ServicenowField','getFields','getSubjects','getDescriptions','rimraf','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x3160bf,_0x79b197){var _0x12f230=function(_0x2ad85c){while(--_0x2ad85c){_0x3160bf['push'](_0x3160bf['shift']());}};_0x12f230(++_0x79b197);}(_0xbef8,0x69));var _0x8bef=function(_0x1bfc8c,_0x5ea704){_0x1bfc8c=_0x1bfc8c-0x0;var _0x5bc277=_0xbef8[_0x1bfc8c];return _0x5bc277;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8bef('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8bef('0x1'));var moment=require(_0x8bef('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x8bef('0x3'));var util=require(_0x8bef('0x4'));var path=require('path');var sox=require(_0x8bef('0x5'));var csv=require(_0x8bef('0x6'));var ejs=require(_0x8bef('0x7'));var fs=require('fs');var fs_extra=require(_0x8bef('0x8'));var _=require(_0x8bef('0x9'));var squel=require(_0x8bef('0xa'));var crypto=require('crypto');var jsforce=require(_0x8bef('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8bef('0x6'));var querystring=require(_0x8bef('0xc'));var Papa=require(_0x8bef('0xd'));var Redis=require(_0x8bef('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8bef('0xf'));var as=require(_0x8bef('0x10'));var hardwareService=require(_0x8bef('0x11'));var logger=require(_0x8bef('0x12'))('api');var utils=require(_0x8bef('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8bef('0x14'))['db'];function respondWithStatusCode(_0x42111f,_0x3d2736){_0x3d2736=_0x3d2736||0xcc;return function(_0x4f9946){if(_0x4f9946){return _0x42111f['sendStatus'](_0x3d2736);}return _0x42111f[_0x8bef('0x15')](_0x3d2736)[_0x8bef('0x16')]();};}function respondWithResult(_0x56bda1,_0x4497d3){_0x4497d3=_0x4497d3||0xc8;return function(_0xdd02ef){if(_0xdd02ef){return _0x56bda1[_0x8bef('0x15')](_0x4497d3)['json'](_0xdd02ef);}};}function respondWithFilteredResult(_0x43da58,_0x4f7420){return function(_0x351d5c){if(_0x351d5c){var _0x5c8d43=typeof _0x4f7420['offset']===_0x8bef('0x17')&&typeof _0x4f7420[_0x8bef('0x18')]===_0x8bef('0x17');var _0x3f238e=_0x351d5c[_0x8bef('0x19')];var _0x5134c7=_0x5c8d43?0x0:_0x4f7420[_0x8bef('0x1a')];var _0x2154ab=_0x5c8d43?_0x351d5c[_0x8bef('0x19')]:_0x4f7420[_0x8bef('0x1a')]+_0x4f7420[_0x8bef('0x18')];var _0x46d96e;if(_0x2154ab>=_0x3f238e){_0x2154ab=_0x3f238e;_0x46d96e=0xc8;}else{_0x46d96e=0xce;}_0x43da58['status'](_0x46d96e);return _0x43da58[_0x8bef('0x1b')](_0x8bef('0x1c'),_0x5134c7+'-'+_0x2154ab+'/'+_0x3f238e)[_0x8bef('0x1d')](_0x351d5c);}return null;};}function patchUpdates(_0x59e3ae){return function(_0x1e7c07){try{jsonpatch[_0x8bef('0x1e')](_0x1e7c07,_0x59e3ae,!![]);}catch(_0x161e22){return BPromise[_0x8bef('0x1f')](_0x161e22);}return _0x1e7c07[_0x8bef('0x20')]();};}function saveUpdates(_0x20d07e,_0x2602a9){return function(_0x46bc9a){if(_0x46bc9a){return _0x46bc9a[_0x8bef('0x21')](_0x20d07e)[_0x8bef('0x22')](function(_0x58692e){return _0x58692e;});}return null;};}function removeEntity(_0x5575a5,_0x6341a2){return function(_0x144da0){if(_0x144da0){return _0x144da0['destroy']()[_0x8bef('0x22')](function(){_0x5575a5['status'](0xcc)[_0x8bef('0x16')]();});}};}function handleEntityNotFound(_0xfcfeb6,_0x2f365d){return function(_0xc5bc8a){if(!_0xc5bc8a){_0xfcfeb6[_0x8bef('0x23')](0x194);}return _0xc5bc8a;};}function handleError(_0x411969,_0x7698d6){_0x7698d6=_0x7698d6||0x1f4;return function(_0x349c25){logger[_0x8bef('0x24')](_0x349c25[_0x8bef('0x25')]);if(_0x349c25[_0x8bef('0x26')]){delete _0x349c25[_0x8bef('0x26')];}_0x411969[_0x8bef('0x15')](_0x7698d6)[_0x8bef('0x27')](_0x349c25);};}exports[_0x8bef('0x28')]=function(_0x49527c,_0x211d09){var _0x59510a={},_0x13337e={},_0x5d4278={'count':0x0,'rows':[]};var _0x402255=_[_0x8bef('0x29')](db[_0x8bef('0x2a')][_0x8bef('0x2b')],function(_0x1a85cc){return{'name':_0x1a85cc[_0x8bef('0x2c')],'type':_0x1a85cc['type'][_0x8bef('0x2d')]};});_0x13337e[_0x8bef('0x2e')]=_['map'](_0x402255,_0x8bef('0x26'));_0x13337e[_0x8bef('0x2f')]=_[_0x8bef('0x30')](_0x49527c['query']);_0x13337e[_0x8bef('0x31')]=_[_0x8bef('0x32')](_0x13337e[_0x8bef('0x2e')],_0x13337e['query']);_0x59510a[_0x8bef('0x33')]=_[_0x8bef('0x32')](_0x13337e[_0x8bef('0x2e')],qs[_0x8bef('0x34')](_0x49527c['query'][_0x8bef('0x34')]));_0x59510a[_0x8bef('0x33')]=_0x59510a[_0x8bef('0x33')][_0x8bef('0x35')]?_0x59510a['attributes']:_0x13337e[_0x8bef('0x2e')];if(!_0x49527c[_0x8bef('0x2f')][_0x8bef('0x36')](_0x8bef('0x37'))){_0x59510a[_0x8bef('0x18')]=qs[_0x8bef('0x18')](_0x49527c[_0x8bef('0x2f')]['limit']);_0x59510a[_0x8bef('0x1a')]=qs[_0x8bef('0x1a')](_0x49527c[_0x8bef('0x2f')][_0x8bef('0x1a')]);}_0x59510a[_0x8bef('0x38')]=qs[_0x8bef('0x39')](_0x49527c[_0x8bef('0x2f')][_0x8bef('0x39')]);_0x59510a[_0x8bef('0x3a')]=qs[_0x8bef('0x31')](_[_0x8bef('0x3b')](_0x49527c['query'],_0x13337e[_0x8bef('0x31')]),_0x402255);if(_0x49527c[_0x8bef('0x2f')]['filter']){_0x59510a[_0x8bef('0x3a')]=_[_0x8bef('0x3c')](_0x59510a[_0x8bef('0x3a')],{'$or':_[_0x8bef('0x29')](_0x402255,function(_0x563a34){if(_0x563a34[_0x8bef('0x3d')]!==_0x8bef('0x3e')){var _0x9bfb43={};_0x9bfb43[_0x563a34[_0x8bef('0x26')]]={'$like':'%'+_0x49527c[_0x8bef('0x2f')][_0x8bef('0x3f')]+'%'};return _0x9bfb43;}})});}_0x59510a=_[_0x8bef('0x3c')]({},_0x59510a,_0x49527c[_0x8bef('0x40')]);var _0x455980={'where':_0x59510a[_0x8bef('0x3a')]};return db[_0x8bef('0x2a')][_0x8bef('0x19')](_0x455980)[_0x8bef('0x22')](function(_0x2b4bd4){_0x5d4278['count']=_0x2b4bd4;if(_0x49527c['query'][_0x8bef('0x41')]){_0x59510a[_0x8bef('0x42')]=[{'all':!![]}];}return db['ServicenowConfiguration']['findAll'](_0x59510a);})[_0x8bef('0x22')](function(_0x15c0c9){_0x5d4278[_0x8bef('0x43')]=_0x15c0c9;return _0x5d4278;})[_0x8bef('0x22')](respondWithFilteredResult(_0x211d09,_0x59510a))[_0x8bef('0x44')](handleError(_0x211d09,null));};exports[_0x8bef('0x45')]=function(_0x5e69bf,_0x1dc3f2){var _0x1f9d42={'raw':![],'where':{'id':_0x5e69bf['params']['id']}},_0xdcc6fb={};_0xdcc6fb[_0x8bef('0x2e')]=_[_0x8bef('0x30')](db[_0x8bef('0x2a')]['rawAttributes']);_0xdcc6fb[_0x8bef('0x2f')]=_[_0x8bef('0x30')](_0x5e69bf[_0x8bef('0x2f')]);_0xdcc6fb[_0x8bef('0x31')]=_[_0x8bef('0x32')](_0xdcc6fb['model'],_0xdcc6fb[_0x8bef('0x2f')]);_0x1f9d42[_0x8bef('0x33')]=_[_0x8bef('0x32')](_0xdcc6fb['model'],qs[_0x8bef('0x34')](_0x5e69bf[_0x8bef('0x2f')][_0x8bef('0x34')]));_0x1f9d42['attributes']=_0x1f9d42[_0x8bef('0x33')]['length']?_0x1f9d42[_0x8bef('0x33')]:_0xdcc6fb[_0x8bef('0x2e')];if(_0x5e69bf[_0x8bef('0x2f')]['includeAll']){_0x1f9d42['include']=[{'all':!![]}];}_0x1f9d42=_[_0x8bef('0x3c')]({},_0x1f9d42,_0x5e69bf[_0x8bef('0x40')]);return db[_0x8bef('0x2a')][_0x8bef('0x46')](_0x1f9d42)[_0x8bef('0x22')](handleEntityNotFound(_0x1dc3f2,null))[_0x8bef('0x22')](respondWithResult(_0x1dc3f2,null))[_0x8bef('0x44')](handleError(_0x1dc3f2,null));};exports[_0x8bef('0x47')]=function(_0xa545d2,_0x5352b5){return db['ServicenowConfiguration'][_0x8bef('0x47')](_0xa545d2[_0x8bef('0x48')],{})[_0x8bef('0x22')](respondWithResult(_0x5352b5,0xc9))[_0x8bef('0x44')](handleError(_0x5352b5,null));};exports[_0x8bef('0x21')]=function(_0x4d10e9,_0x9064ba){if(_0x4d10e9[_0x8bef('0x48')]['id']){delete _0x4d10e9[_0x8bef('0x48')]['id'];}return db[_0x8bef('0x2a')][_0x8bef('0x46')]({'where':{'id':_0x4d10e9[_0x8bef('0x49')]['id']}})[_0x8bef('0x22')](handleEntityNotFound(_0x9064ba,null))[_0x8bef('0x22')](saveUpdates(_0x4d10e9[_0x8bef('0x48')],null))[_0x8bef('0x22')](respondWithResult(_0x9064ba,null))[_0x8bef('0x44')](handleError(_0x9064ba,null));};exports[_0x8bef('0x4a')]=function(_0x5039c6,_0x3518b5){return db[_0x8bef('0x2a')]['find']({'where':{'id':_0x5039c6[_0x8bef('0x49')]['id']}})['then'](handleEntityNotFound(_0x3518b5,null))['then'](removeEntity(_0x3518b5,null))[_0x8bef('0x44')](handleError(_0x3518b5,null));};exports['getFields']=function(_0x2cbc8d,_0x2161ba,_0x35f25b){var _0x177928={};var _0x5bea34={};var _0x213866;var _0x520c36;return db[_0x8bef('0x2a')][_0x8bef('0x4b')]({'where':{'id':_0x2cbc8d[_0x8bef('0x49')]['id']}})[_0x8bef('0x22')](handleEntityNotFound(_0x2161ba,null))[_0x8bef('0x22')](function(_0x358dd7){if(_0x358dd7){_0x213866=_0x358dd7;_0x5bea34[_0x8bef('0x2e')]=_[_0x8bef('0x30')](db[_0x8bef('0x4c')][_0x8bef('0x2b')]);_0x5bea34['query']=_[_0x8bef('0x30')](_0x2cbc8d['query']);_0x5bea34[_0x8bef('0x31')]=_[_0x8bef('0x32')](_0x5bea34[_0x8bef('0x2e')],_0x5bea34[_0x8bef('0x2f')]);_0x177928[_0x8bef('0x33')]=_[_0x8bef('0x32')](_0x5bea34[_0x8bef('0x2e')],qs[_0x8bef('0x34')](_0x2cbc8d[_0x8bef('0x2f')][_0x8bef('0x34')]));_0x177928[_0x8bef('0x33')]=_0x177928['attributes'][_0x8bef('0x35')]?_0x177928[_0x8bef('0x33')]:_0x5bea34['model'];_0x177928[_0x8bef('0x38')]=qs['sort'](_0x2cbc8d[_0x8bef('0x2f')][_0x8bef('0x39')]);_0x177928['where']=qs[_0x8bef('0x31')](_[_0x8bef('0x3b')](_0x2cbc8d[_0x8bef('0x2f')],_0x5bea34[_0x8bef('0x31')]));if(_0x2cbc8d[_0x8bef('0x2f')][_0x8bef('0x3f')]){_0x177928[_0x8bef('0x3a')]=_[_0x8bef('0x3c')](_0x177928[_0x8bef('0x3a')],{'$or':_[_0x8bef('0x29')](_0x177928[_0x8bef('0x33')],function(_0x15303c){var _0xe8c70e={};_0xe8c70e[_0x15303c]={'$like':'%'+_0x2cbc8d[_0x8bef('0x2f')][_0x8bef('0x3f')]+'%'};return _0xe8c70e;})});}_0x177928=_['merge']({},_0x177928,_0x2cbc8d[_0x8bef('0x40')]);return _0x213866[_0x8bef('0x4d')](_0x177928);}})[_0x8bef('0x22')](function(_0x3b3a19){if(_0x3b3a19){_0x520c36=_0x3b3a19[_0x8bef('0x35')];if(!_0x2cbc8d[_0x8bef('0x2f')]['hasOwnProperty'](_0x8bef('0x37'))){_0x177928['limit']=qs[_0x8bef('0x18')](_0x2cbc8d[_0x8bef('0x2f')][_0x8bef('0x18')]);_0x177928[_0x8bef('0x1a')]=qs[_0x8bef('0x1a')](_0x2cbc8d[_0x8bef('0x2f')][_0x8bef('0x1a')]);}return _0x213866[_0x8bef('0x4d')](_0x177928);}})[_0x8bef('0x22')](function(_0x58a128){if(_0x58a128){return _0x58a128?{'count':_0x520c36,'rows':_0x58a128}:null;}})['then'](respondWithResult(_0x2161ba,null))['catch'](handleError(_0x2161ba,null));};exports[_0x8bef('0x4e')]=function(_0x5ac4a1,_0x2053cd,_0x387158){var _0x535f75={};var _0x365820={};var _0x1553db;var _0x4c5211;return db[_0x8bef('0x2a')][_0x8bef('0x4b')]({'where':{'id':_0x5ac4a1[_0x8bef('0x49')]['id']}})[_0x8bef('0x22')](handleEntityNotFound(_0x2053cd,null))[_0x8bef('0x22')](function(_0x59190d){if(_0x59190d){_0x1553db=_0x59190d;_0x365820['model']=_['keys'](db['ServicenowField'][_0x8bef('0x2b')]);_0x365820['query']=_[_0x8bef('0x30')](_0x5ac4a1[_0x8bef('0x2f')]);_0x365820[_0x8bef('0x31')]=_[_0x8bef('0x32')](_0x365820[_0x8bef('0x2e')],_0x365820[_0x8bef('0x2f')]);_0x535f75['attributes']=_[_0x8bef('0x32')](_0x365820['model'],qs[_0x8bef('0x34')](_0x5ac4a1[_0x8bef('0x2f')][_0x8bef('0x34')]));_0x535f75['attributes']=_0x535f75[_0x8bef('0x33')]['length']?_0x535f75[_0x8bef('0x33')]:_0x365820[_0x8bef('0x2e')];_0x535f75['order']=qs[_0x8bef('0x39')](_0x5ac4a1[_0x8bef('0x2f')][_0x8bef('0x39')]);_0x535f75[_0x8bef('0x3a')]=qs[_0x8bef('0x31')](_[_0x8bef('0x3b')](_0x5ac4a1['query'],_0x365820[_0x8bef('0x31')]));if(_0x5ac4a1[_0x8bef('0x2f')][_0x8bef('0x3f')]){_0x535f75[_0x8bef('0x3a')]=_[_0x8bef('0x3c')](_0x535f75[_0x8bef('0x3a')],{'$or':_[_0x8bef('0x29')](_0x535f75[_0x8bef('0x33')],function(_0x26d33e){var _0x255ec5={};_0x255ec5[_0x26d33e]={'$like':'%'+_0x5ac4a1[_0x8bef('0x2f')][_0x8bef('0x3f')]+'%'};return _0x255ec5;})});}_0x535f75=_[_0x8bef('0x3c')]({},_0x535f75,_0x5ac4a1[_0x8bef('0x40')]);return _0x1553db[_0x8bef('0x4e')](_0x535f75);}})['then'](function(_0x2a0e66){if(_0x2a0e66){_0x4c5211=_0x2a0e66[_0x8bef('0x35')];if(!_0x5ac4a1[_0x8bef('0x2f')][_0x8bef('0x36')](_0x8bef('0x37'))){_0x535f75[_0x8bef('0x18')]=qs[_0x8bef('0x18')](_0x5ac4a1[_0x8bef('0x2f')]['limit']);_0x535f75['offset']=qs[_0x8bef('0x1a')](_0x5ac4a1['query'][_0x8bef('0x1a')]);}return _0x1553db[_0x8bef('0x4e')](_0x535f75);}})[_0x8bef('0x22')](function(_0x1499e6){if(_0x1499e6){return _0x1499e6?{'count':_0x4c5211,'rows':_0x1499e6}:null;}})[_0x8bef('0x22')](respondWithResult(_0x2053cd,null))[_0x8bef('0x44')](handleError(_0x2053cd,null));};exports[_0x8bef('0x4f')]=function(_0x404cee,_0x5722df,_0x2936c8){var _0x2c406c={};var _0x5e1fad={};var _0x2bd711;var _0x593764;return db['ServicenowConfiguration'][_0x8bef('0x4b')]({'where':{'id':_0x404cee[_0x8bef('0x49')]['id']}})[_0x8bef('0x22')](handleEntityNotFound(_0x5722df,null))[_0x8bef('0x22')](function(_0x2553fa){if(_0x2553fa){_0x2bd711=_0x2553fa;_0x5e1fad[_0x8bef('0x2e')]=_[_0x8bef('0x30')](db['ServicenowField']['rawAttributes']);_0x5e1fad['query']=_[_0x8bef('0x30')](_0x404cee[_0x8bef('0x2f')]);_0x5e1fad['filters']=_[_0x8bef('0x32')](_0x5e1fad[_0x8bef('0x2e')],_0x5e1fad[_0x8bef('0x2f')]);_0x2c406c[_0x8bef('0x33')]=_['intersection'](_0x5e1fad[_0x8bef('0x2e')],qs[_0x8bef('0x34')](_0x404cee['query'][_0x8bef('0x34')]));_0x2c406c[_0x8bef('0x33')]=_0x2c406c['attributes'][_0x8bef('0x35')]?_0x2c406c[_0x8bef('0x33')]:_0x5e1fad['model'];_0x2c406c[_0x8bef('0x38')]=qs[_0x8bef('0x39')](_0x404cee[_0x8bef('0x2f')][_0x8bef('0x39')]);_0x2c406c[_0x8bef('0x3a')]=qs['filters'](_[_0x8bef('0x3b')](_0x404cee[_0x8bef('0x2f')],_0x5e1fad[_0x8bef('0x31')]));if(_0x404cee[_0x8bef('0x2f')][_0x8bef('0x3f')]){_0x2c406c[_0x8bef('0x3a')]=_['merge'](_0x2c406c[_0x8bef('0x3a')],{'$or':_[_0x8bef('0x29')](_0x2c406c[_0x8bef('0x33')],function(_0xcc8c8a){var _0x47a7e6={};_0x47a7e6[_0xcc8c8a]={'$like':'%'+_0x404cee[_0x8bef('0x2f')][_0x8bef('0x3f')]+'%'};return _0x47a7e6;})});}_0x2c406c=_[_0x8bef('0x3c')]({},_0x2c406c,_0x404cee[_0x8bef('0x40')]);return _0x2bd711[_0x8bef('0x4f')](_0x2c406c);}})[_0x8bef('0x22')](function(_0x9e46a2){if(_0x9e46a2){_0x593764=_0x9e46a2['length'];if(!_0x404cee[_0x8bef('0x2f')]['hasOwnProperty'](_0x8bef('0x37'))){_0x2c406c[_0x8bef('0x18')]=qs['limit'](_0x404cee[_0x8bef('0x2f')][_0x8bef('0x18')]);_0x2c406c[_0x8bef('0x1a')]=qs['offset'](_0x404cee[_0x8bef('0x2f')][_0x8bef('0x1a')]);}return _0x2bd711['getDescriptions'](_0x2c406c);}})[_0x8bef('0x22')](function(_0x452d07){if(_0x452d07){return _0x452d07?{'count':_0x593764,'rows':_0x452d07}:null;}})[_0x8bef('0x22')](respondWithResult(_0x5722df,null))[_0x8bef('0x44')](handleError(_0x5722df,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index a0794f0..d669e5d 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 _0x3495=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','lodash','util'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x3495,0x1de));var _0x5349=function(_0x525ab5,_0x404107){_0x525ab5=_0x525ab5-0x0;var _0x4a5fed=_0x3495[_0x525ab5];return _0x4a5fed;};'use strict';var _=require(_0x5349('0x0'));var util=require(_0x5349('0x1'));var logger=require(_0x5349('0x2'))(_0x5349('0x3'));var moment=require(_0x5349('0x4'));var BPromise=require(_0x5349('0x5'));var rp=require(_0x5349('0x6'));var fs=require('fs');var path=require(_0x5349('0x7'));var rimraf=require(_0x5349('0x8'));var config=require('../../config/environment');var attributes=require(_0x5349('0x9'));module[_0x5349('0xa')]=function(_0x5ce2cd,_0xcb5a1){return _0x5ce2cd['define'](_0x5349('0xb'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa7fa=['exports','int_servicenow_configurations','lodash','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x10bd3d,_0x478dfb){var _0x48d6fd=function(_0xdf597f){while(--_0xdf597f){_0x10bd3d['push'](_0x10bd3d['shift']());}};_0x48d6fd(++_0x478dfb);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa7fa[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xaa7f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xaa7f('0x1'));var moment=require(_0xaa7f('0x2'));var BPromise=require(_0xaa7f('0x3'));var rp=require(_0xaa7f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa7f('0x5'));var config=require(_0xaa7f('0x6'));var attributes=require(_0xaa7f('0x7'));module[_0xaa7f('0x8')]=function(_0x48e98f,_0xf79d63){return _0x48e98f['define']('ServicenowConfiguration',attributes,{'tableName':_0xaa7f('0x9'),'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 39c1ec1..dcd2f65 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 _0xf576=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash'];(function(_0x5bee28,_0x1dc7e2){var _0x395d1d=function(_0x33af90){while(--_0x33af90){_0x5bee28['push'](_0x5bee28['shift']());}};_0x395d1d(++_0x1dc7e2);}(_0xf576,0xef));var _0x6f57=function(_0x2c1c95,_0x30915b){_0x2c1c95=_0x2c1c95-0x0;var _0x1b60b8=_0xf576[_0x2c1c95];return _0x1b60b8;};'use strict';var _=require(_0x6f57('0x0'));var util=require(_0x6f57('0x1'));var moment=require(_0x6f57('0x2'));var BPromise=require(_0x6f57('0x3'));var rs=require(_0x6f57('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6f57('0x5'));var logger=require(_0x6f57('0x6'))(_0x6f57('0x7'));var config=require('../../config/environment');var jayson=require(_0x6f57('0x8'));var client=jayson[_0x6f57('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8ced,_0x40647a,_0x6edc9d){return new BPromise(function(_0x4292c8,_0x5951fb){return client['request'](_0x5a8ced,_0x6edc9d)[_0x6f57('0xa')](function(_0x4ecc94){logger[_0x6f57('0xb')](_0x6f57('0xc'),_0x40647a,_0x6f57('0xd'));logger[_0x6f57('0xe')](_0x6f57('0xf'),_0x40647a,_0x6f57('0xd'),JSON['stringify'](_0x4ecc94));if(_0x4ecc94[_0x6f57('0x10')]){if(_0x4ecc94[_0x6f57('0x10')]['code']===0x1f4){logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x40647a,_0x4ecc94[_0x6f57('0x10')][_0x6f57('0x11')]);return _0x5951fb(_0x4ecc94[_0x6f57('0x10')][_0x6f57('0x11')]);}logger[_0x6f57('0x10')](_0x6f57('0xc'),_0x40647a,_0x4ecc94[_0x6f57('0x10')]['message']);return _0x4292c8(_0x4ecc94['error'][_0x6f57('0x11')]);}else{logger[_0x6f57('0xb')](_0x6f57('0xc'),_0x40647a,'request\x20sent');_0x4292c8(_0x4ecc94[_0x6f57('0x12')][_0x6f57('0x11')]);}})[_0x6f57('0x13')](function(_0x13565c){logger[_0x6f57('0x10')](_0x6f57('0xc'),_0x40647a,_0x13565c);_0x5951fb(_0x13565c);});});} \ No newline at end of file +var _0xfcf0=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','bluebird'];(function(_0x2a453b,_0x479c50){var _0x132f79=function(_0x5e3d83){while(--_0x5e3d83){_0x2a453b['push'](_0x2a453b['shift']());}};_0x132f79(++_0x479c50);}(_0xfcf0,0x138));var _0x0fcf=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0xfcf0[_0x4d7f3f];return _0x5d67cc;};'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});function respondWithRpcPromise(_0x61bbb9,_0x2dfdf8,_0x50c575){return new BPromise(function(_0x1388d1,_0x6ced94){return client[_0x0fcf('0xc')](_0x61bbb9,_0x50c575)['then'](function(_0x69a840){logger[_0x0fcf('0xd')](_0x0fcf('0xe'),_0x2dfdf8,'request\x20sent');logger[_0x0fcf('0xf')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x2dfdf8,_0x0fcf('0x10'),JSON[_0x0fcf('0x11')](_0x69a840));if(_0x69a840[_0x0fcf('0x12')]){if(_0x69a840['error']['code']===0x1f4){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x6ced94(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x1388d1(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}else{logger['info'](_0x0fcf('0xe'),_0x2dfdf8,_0x0fcf('0x10'));_0x1388d1(_0x69a840[_0x0fcf('0x14')][_0x0fcf('0x13')]);}})['catch'](function(_0x3e78d0){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x3e78d0);_0x6ced94(_0x3e78d0);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index a33292b..22faa5c 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 _0x29b4=['put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x35a686,_0x7167e4){var _0x1ec0e3=function(_0x5db6a4){while(--_0x5db6a4){_0x35a686['push'](_0x35a686['shift']());}};_0x1ec0e3(++_0x7167e4);}(_0x29b4,0x1a5));var _0x429b=function(_0x5130fc,_0x57f935){_0x5130fc=_0x5130fc-0x0;var _0xdde96a=_0x29b4[_0x5130fc];return _0xdde96a;};'use strict';var multer=require(_0x429b('0x0'));var util=require(_0x429b('0x1'));var path=require(_0x429b('0x2'));var timeout=require(_0x429b('0x3'));var express=require(_0x429b('0x4'));var router=express[_0x429b('0x5')]();var fs_extra=require(_0x429b('0x6'));var auth=require(_0x429b('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x429b('0x8'));var controller=require('./intServicenowField.controller');router['get']('/',auth[_0x429b('0x9')](),controller[_0x429b('0xa')]);router[_0x429b('0xb')](_0x429b('0xc'),auth[_0x429b('0x9')](),controller[_0x429b('0xd')]);router[_0x429b('0xe')]('/',auth[_0x429b('0x9')](),controller[_0x429b('0xf')]);router[_0x429b('0x10')](_0x429b('0xc'),auth[_0x429b('0x9')](),controller[_0x429b('0x11')]);router['delete'](_0x429b('0xc'),auth[_0x429b('0x9')](),controller[_0x429b('0x12')]);module['exports']=router; \ No newline at end of file +var _0x4f59=['../../components/interaction/service','isAuthenticated','get','/:id','show','post','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x57474e,_0x4178b8){var _0xfaae8c=function(_0x2e34d1){while(--_0x2e34d1){_0x57474e['push'](_0x57474e['shift']());}};_0xfaae8c(++_0x4178b8);}(_0x4f59,0xd8));var _0x94f5=function(_0x2085f3,_0x50105b){_0x2085f3=_0x2085f3-0x0;var _0x384e3c=_0x4f59[_0x2085f3];return _0x384e3c;};'use strict';var multer=require(_0x94f5('0x0'));var util=require(_0x94f5('0x1'));var path=require(_0x94f5('0x2'));var timeout=require(_0x94f5('0x3'));var express=require(_0x94f5('0x4'));var router=express[_0x94f5('0x5')]();var fs_extra=require(_0x94f5('0x6'));var auth=require(_0x94f5('0x7'));var interaction=require(_0x94f5('0x8'));var config=require('../../config/environment');var controller=require('./intServicenowField.controller');router['get']('/',auth[_0x94f5('0x9')](),controller['index']);router[_0x94f5('0xa')](_0x94f5('0xb'),auth[_0x94f5('0x9')](),controller[_0x94f5('0xc')]);router[_0x94f5('0xd')]('/',auth[_0x94f5('0x9')](),controller['create']);router['put'](_0x94f5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x94f5('0xe')](_0x94f5('0xb'),auth[_0x94f5('0x9')](),controller[_0x94f5('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index dcac4de..e054f57 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 _0xea13=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable'];(function(_0x31a056,_0x39cac3){var _0x5c3717=function(_0x212d17){while(--_0x212d17){_0x31a056['push'](_0x31a056['shift']());}};_0x5c3717(++_0x39cac3);}(_0xea13,0x8d));var _0x3ea1=function(_0x3aa0e0,_0x5cec89){_0x3aa0e0=_0x3aa0e0-0x0;var _0x38dba1=_0xea13[_0x3aa0e0];return _0x38dba1;};'use strict';var Sequelize=require(_0x3ea1('0x0'));module[_0x3ea1('0x1')]={'type':{'type':Sequelize[_0x3ea1('0x2')](_0x3ea1('0x3'),'variable',_0x3ea1('0x4'),_0x3ea1('0x5'),_0x3ea1('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3ea1('0x7')]},'key':{'type':Sequelize[_0x3ea1('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x3ea1('0x3'),_0x3ea1('0x8'),_0x3ea1('0x4'))},'keyContent':{'type':Sequelize[_0x3ea1('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x3ea1('0x7')]},'customField':{'type':Sequelize[_0x3ea1('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9496=['ENUM','string','picklist','STRING','variable','customVariable','BOOLEAN','sequelize','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x9496,0xd6));var _0x6949=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9496[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x6949('0x0'));module[_0x6949('0x1')]={'type':{'type':Sequelize[_0x6949('0x2')](_0x6949('0x3'),'variable','customVariable','keyValue',_0x6949('0x4')),'defaultValue':_0x6949('0x3')},'content':{'type':Sequelize[_0x6949('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6949('0x2')](_0x6949('0x3'),_0x6949('0x6'),_0x6949('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6949('0x5')]},'nameField':{'type':Sequelize[_0x6949('0x5')]},'customField':{'type':Sequelize[_0x6949('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6949('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 402c323..c1ec2de 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 _0x5eac=['../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','ServicenowField','fieldName','type','key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','includeAll','rows','catch','params','keys','rawAttributes','include','options','create','body','find','eml-format','rimraf','zip-dir','request-promise','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x18ac44,_0x5e525e){var _0x521d09=function(_0x512ee4){while(--_0x512ee4){_0x18ac44['push'](_0x18ac44['shift']());}};_0x521d09(++_0x5e525e);}(_0x5eac,0x112));var _0xc5ea=function(_0x29ab17,_0x1003fb){_0x29ab17=_0x29ab17-0x0;var _0x2d60a8=_0x5eac[_0x29ab17];return _0x2d60a8;};'use strict';var emlformat=require(_0xc5ea('0x0'));var rimraf=require(_0xc5ea('0x1'));var zipdir=require(_0xc5ea('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc5ea('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc5ea('0x4'));var util=require(_0xc5ea('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc5ea('0x6'));var _=require(_0xc5ea('0x7'));var squel=require(_0xc5ea('0x8'));var crypto=require(_0xc5ea('0x9'));var jsforce=require(_0xc5ea('0xa'));var deskjs=require(_0xc5ea('0xb'));var toCsv=require(_0xc5ea('0xc'));var querystring=require(_0xc5ea('0xd'));var Papa=require(_0xc5ea('0xe'));var Redis=require(_0xc5ea('0xf'));var authService=require(_0xc5ea('0x10'));var qs=require(_0xc5ea('0x11'));var as=require(_0xc5ea('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc5ea('0x13'))(_0xc5ea('0x14'));var utils=require(_0xc5ea('0x15'));var config=require(_0xc5ea('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc5ea('0x17'))['db'];function respondWithStatusCode(_0x29b32a,_0x292342){_0x292342=_0x292342||0xcc;return function(_0x7a5468){if(_0x7a5468){return _0x29b32a['sendStatus'](_0x292342);}return _0x29b32a['status'](_0x292342)[_0xc5ea('0x18')]();};}function respondWithResult(_0xad3805,_0x33349a){_0x33349a=_0x33349a||0xc8;return function(_0x2a5a51){if(_0x2a5a51){return _0xad3805[_0xc5ea('0x19')](_0x33349a)[_0xc5ea('0x1a')](_0x2a5a51);}};}function respondWithFilteredResult(_0x4ec6a1,_0x537a63){return function(_0x1b1e10){if(_0x1b1e10){var _0x37365a=typeof _0x537a63[_0xc5ea('0x1b')]===_0xc5ea('0x1c')&&typeof _0x537a63[_0xc5ea('0x1d')]===_0xc5ea('0x1c');var _0x5c6f10=_0x1b1e10['count'];var _0x218093=_0x37365a?0x0:_0x537a63[_0xc5ea('0x1b')];var _0x4ac438=_0x37365a?_0x1b1e10[_0xc5ea('0x1e')]:_0x537a63[_0xc5ea('0x1b')]+_0x537a63[_0xc5ea('0x1d')];var _0x5bb638;if(_0x4ac438>=_0x5c6f10){_0x4ac438=_0x5c6f10;_0x5bb638=0xc8;}else{_0x5bb638=0xce;}_0x4ec6a1[_0xc5ea('0x19')](_0x5bb638);return _0x4ec6a1[_0xc5ea('0x1f')](_0xc5ea('0x20'),_0x218093+'-'+_0x4ac438+'/'+_0x5c6f10)['json'](_0x1b1e10);}return null;};}function patchUpdates(_0x3e1dc8){return function(_0x58702a){try{jsonpatch[_0xc5ea('0x21')](_0x58702a,_0x3e1dc8,!![]);}catch(_0x33b7d2){return BPromise[_0xc5ea('0x22')](_0x33b7d2);}return _0x58702a['save']();};}function saveUpdates(_0x50ecfa,_0x3f28d2){return function(_0x19074e){if(_0x19074e){return _0x19074e[_0xc5ea('0x23')](_0x50ecfa)[_0xc5ea('0x24')](function(_0x2f5bb2){return _0x2f5bb2;});}return null;};}function removeEntity(_0x3df497,_0x5f5684){return function(_0x5f3452){if(_0x5f3452){return _0x5f3452[_0xc5ea('0x25')]()[_0xc5ea('0x24')](function(){_0x3df497[_0xc5ea('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x191f1a,_0x249dd5){return function(_0x308311){if(!_0x308311){_0x191f1a[_0xc5ea('0x26')](0x194);}return _0x308311;};}function handleError(_0x25fd20,_0xba4001){_0xba4001=_0xba4001||0x1f4;return function(_0x12f3cf){logger['error'](_0x12f3cf[_0xc5ea('0x27')]);if(_0x12f3cf[_0xc5ea('0x28')]){delete _0x12f3cf[_0xc5ea('0x28')];}_0x25fd20[_0xc5ea('0x19')](_0xba4001)[_0xc5ea('0x29')](_0x12f3cf);};}exports[_0xc5ea('0x2a')]=function(_0x459760,_0x37c673){var _0x219dab={},_0x447919={},_0x23ec46={'count':0x0,'rows':[]};var _0x457fff=_['map'](db[_0xc5ea('0x2b')]['rawAttributes'],function(_0x3dd7fe){return{'name':_0x3dd7fe[_0xc5ea('0x2c')],'type':_0x3dd7fe[_0xc5ea('0x2d')][_0xc5ea('0x2e')]};});_0x447919['model']=_[_0xc5ea('0x2f')](_0x457fff,'name');_0x447919['query']=_['keys'](_0x459760[_0xc5ea('0x30')]);_0x447919['filters']=_[_0xc5ea('0x31')](_0x447919[_0xc5ea('0x32')],_0x447919[_0xc5ea('0x30')]);_0x219dab[_0xc5ea('0x33')]=_['intersection'](_0x447919[_0xc5ea('0x32')],qs[_0xc5ea('0x34')](_0x459760[_0xc5ea('0x30')][_0xc5ea('0x34')]));_0x219dab[_0xc5ea('0x33')]=_0x219dab[_0xc5ea('0x33')][_0xc5ea('0x35')]?_0x219dab[_0xc5ea('0x33')]:_0x447919[_0xc5ea('0x32')];if(!_0x459760[_0xc5ea('0x30')][_0xc5ea('0x36')](_0xc5ea('0x37'))){_0x219dab[_0xc5ea('0x1d')]=qs['limit'](_0x459760[_0xc5ea('0x30')][_0xc5ea('0x1d')]);_0x219dab[_0xc5ea('0x1b')]=qs[_0xc5ea('0x1b')](_0x459760['query'][_0xc5ea('0x1b')]);}_0x219dab[_0xc5ea('0x38')]=qs[_0xc5ea('0x39')](_0x459760[_0xc5ea('0x30')][_0xc5ea('0x39')]);_0x219dab[_0xc5ea('0x3a')]=qs[_0xc5ea('0x3b')](_[_0xc5ea('0x3c')](_0x459760[_0xc5ea('0x30')],_0x447919['filters']),_0x457fff);if(_0x459760['query'][_0xc5ea('0x3d')]){_0x219dab[_0xc5ea('0x3a')]=_[_0xc5ea('0x3e')](_0x219dab[_0xc5ea('0x3a')],{'$or':_[_0xc5ea('0x2f')](_0x457fff,function(_0x1b4002){if(_0x1b4002[_0xc5ea('0x2d')]!=='VIRTUAL'){var _0x34a07c={};_0x34a07c[_0x1b4002[_0xc5ea('0x28')]]={'$like':'%'+_0x459760[_0xc5ea('0x30')][_0xc5ea('0x3d')]+'%'};return _0x34a07c;}})});}_0x219dab=_[_0xc5ea('0x3e')]({},_0x219dab,_0x459760['options']);var _0x1fb66c={'where':_0x219dab[_0xc5ea('0x3a')]};return db[_0xc5ea('0x2b')][_0xc5ea('0x1e')](_0x1fb66c)['then'](function(_0x499c29){_0x23ec46[_0xc5ea('0x1e')]=_0x499c29;if(_0x459760[_0xc5ea('0x30')][_0xc5ea('0x3f')]){_0x219dab['include']=[{'all':!![]}];}return db[_0xc5ea('0x2b')]['findAll'](_0x219dab);})[_0xc5ea('0x24')](function(_0x28aac7){_0x23ec46[_0xc5ea('0x40')]=_0x28aac7;return _0x23ec46;})[_0xc5ea('0x24')](respondWithFilteredResult(_0x37c673,_0x219dab))[_0xc5ea('0x41')](handleError(_0x37c673,null));};exports['show']=function(_0x183694,_0x3c944d){var _0x3cca89={'raw':!![],'where':{'id':_0x183694[_0xc5ea('0x42')]['id']}},_0x3ac27d={};_0x3ac27d['model']=_[_0xc5ea('0x43')](db[_0xc5ea('0x2b')][_0xc5ea('0x44')]);_0x3ac27d[_0xc5ea('0x30')]=_[_0xc5ea('0x43')](_0x183694[_0xc5ea('0x30')]);_0x3ac27d[_0xc5ea('0x3b')]=_[_0xc5ea('0x31')](_0x3ac27d[_0xc5ea('0x32')],_0x3ac27d[_0xc5ea('0x30')]);_0x3cca89[_0xc5ea('0x33')]=_['intersection'](_0x3ac27d['model'],qs[_0xc5ea('0x34')](_0x183694[_0xc5ea('0x30')][_0xc5ea('0x34')]));_0x3cca89[_0xc5ea('0x33')]=_0x3cca89[_0xc5ea('0x33')][_0xc5ea('0x35')]?_0x3cca89['attributes']:_0x3ac27d[_0xc5ea('0x32')];if(_0x183694[_0xc5ea('0x30')][_0xc5ea('0x3f')]){_0x3cca89[_0xc5ea('0x45')]=[{'all':!![]}];}_0x3cca89=_[_0xc5ea('0x3e')]({},_0x3cca89,_0x183694[_0xc5ea('0x46')]);return db[_0xc5ea('0x2b')]['find'](_0x3cca89)[_0xc5ea('0x24')](handleEntityNotFound(_0x3c944d,null))[_0xc5ea('0x24')](respondWithResult(_0x3c944d,null))[_0xc5ea('0x41')](handleError(_0x3c944d,null));};exports[_0xc5ea('0x47')]=function(_0x129789,_0x1459df){return db[_0xc5ea('0x2b')][_0xc5ea('0x47')](_0x129789[_0xc5ea('0x48')],{})[_0xc5ea('0x24')](respondWithResult(_0x1459df,0xc9))[_0xc5ea('0x41')](handleError(_0x1459df,null));};exports['update']=function(_0x561706,_0x48e57e){if(_0x561706[_0xc5ea('0x48')]['id']){delete _0x561706['body']['id'];}return db[_0xc5ea('0x2b')]['find']({'where':{'id':_0x561706[_0xc5ea('0x42')]['id']}})[_0xc5ea('0x24')](handleEntityNotFound(_0x48e57e,null))[_0xc5ea('0x24')](saveUpdates(_0x561706[_0xc5ea('0x48')],null))[_0xc5ea('0x24')](respondWithResult(_0x48e57e,null))[_0xc5ea('0x41')](handleError(_0x48e57e,null));};exports[_0xc5ea('0x25')]=function(_0x54435f,_0xee2c0d){return db[_0xc5ea('0x2b')][_0xc5ea('0x49')]({'where':{'id':_0x54435f['params']['id']}})[_0xc5ea('0x24')](handleEntityNotFound(_0xee2c0d,null))['then'](removeEntity(_0xee2c0d,null))[_0xc5ea('0x41')](handleError(_0xee2c0d,null));}; \ No newline at end of file +var _0x4f39=['order','sort','where','merge','filter','includeAll','include','rows','catch','params','intersection','create','find','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x4f39,0xef));var _0x94f3=function(_0x43a0dc,_0x49402e){_0x43a0dc=_0x43a0dc-0x0;var _0x1ab862=_0x4f39[_0x43a0dc];return _0x1ab862;};'use strict';var emlformat=require(_0x94f3('0x0'));var rimraf=require(_0x94f3('0x1'));var zipdir=require(_0x94f3('0x2'));var jsonpatch=require(_0x94f3('0x3'));var rp=require(_0x94f3('0x4'));var moment=require(_0x94f3('0x5'));var BPromise=require(_0x94f3('0x6'));var Mustache=require(_0x94f3('0x7'));var util=require('util');var path=require(_0x94f3('0x8'));var sox=require(_0x94f3('0x9'));var csv=require(_0x94f3('0xa'));var ejs=require(_0x94f3('0xb'));var fs=require('fs');var fs_extra=require(_0x94f3('0xc'));var _=require(_0x94f3('0xd'));var squel=require(_0x94f3('0xe'));var crypto=require('crypto');var jsforce=require(_0x94f3('0xf'));var deskjs=require(_0x94f3('0x10'));var toCsv=require('to-csv');var querystring=require(_0x94f3('0x11'));var Papa=require('papaparse');var Redis=require(_0x94f3('0x12'));var authService=require(_0x94f3('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x94f3('0x14'));var hardwareService=require(_0x94f3('0x15'));var logger=require(_0x94f3('0x16'))(_0x94f3('0x17'));var utils=require(_0x94f3('0x18'));var config=require(_0x94f3('0x19'));var licenseUtil=require(_0x94f3('0x1a'));var db=require(_0x94f3('0x1b'))['db'];function respondWithStatusCode(_0x48a41f,_0x396b1c){_0x396b1c=_0x396b1c||0xcc;return function(_0x5a94d9){if(_0x5a94d9){return _0x48a41f[_0x94f3('0x1c')](_0x396b1c);}return _0x48a41f[_0x94f3('0x1d')](_0x396b1c)[_0x94f3('0x1e')]();};}function respondWithResult(_0x2435ec,_0x1247e8){_0x1247e8=_0x1247e8||0xc8;return function(_0x382c88){if(_0x382c88){return _0x2435ec[_0x94f3('0x1d')](_0x1247e8)[_0x94f3('0x1f')](_0x382c88);}};}function respondWithFilteredResult(_0x1da928,_0x4c1590){return function(_0x13f0a4){if(_0x13f0a4){var _0x50615b=typeof _0x4c1590[_0x94f3('0x20')]===_0x94f3('0x21')&&typeof _0x4c1590[_0x94f3('0x22')]===_0x94f3('0x21');var _0x6e72db=_0x13f0a4[_0x94f3('0x23')];var _0x431bc9=_0x50615b?0x0:_0x4c1590[_0x94f3('0x20')];var _0x2d3c73=_0x50615b?_0x13f0a4['count']:_0x4c1590[_0x94f3('0x20')]+_0x4c1590[_0x94f3('0x22')];var _0x2808cf;if(_0x2d3c73>=_0x6e72db){_0x2d3c73=_0x6e72db;_0x2808cf=0xc8;}else{_0x2808cf=0xce;}_0x1da928[_0x94f3('0x1d')](_0x2808cf);return _0x1da928[_0x94f3('0x24')]('Content-Range',_0x431bc9+'-'+_0x2d3c73+'/'+_0x6e72db)['json'](_0x13f0a4);}return null;};}function patchUpdates(_0x28604a){return function(_0x227111){try{jsonpatch[_0x94f3('0x25')](_0x227111,_0x28604a,!![]);}catch(_0x503fc3){return BPromise[_0x94f3('0x26')](_0x503fc3);}return _0x227111[_0x94f3('0x27')]();};}function saveUpdates(_0x4d9ef8,_0xe54b0b){return function(_0x1c32d8){if(_0x1c32d8){return _0x1c32d8[_0x94f3('0x28')](_0x4d9ef8)[_0x94f3('0x29')](function(_0xd0eda){return _0xd0eda;});}return null;};}function removeEntity(_0x3edddf,_0x39d3f8){return function(_0x1db93c){if(_0x1db93c){return _0x1db93c[_0x94f3('0x2a')]()[_0x94f3('0x29')](function(){_0x3edddf['status'](0xcc)[_0x94f3('0x1e')]();});}};}function handleEntityNotFound(_0x5010ee,_0x115ffc){return function(_0x79b5e1){if(!_0x79b5e1){_0x5010ee[_0x94f3('0x1c')](0x194);}return _0x79b5e1;};}function handleError(_0x9c8317,_0x11cf68){_0x11cf68=_0x11cf68||0x1f4;return function(_0x5b5fc2){logger[_0x94f3('0x2b')](_0x5b5fc2[_0x94f3('0x2c')]);if(_0x5b5fc2[_0x94f3('0x2d')]){delete _0x5b5fc2[_0x94f3('0x2d')];}_0x9c8317[_0x94f3('0x1d')](_0x11cf68)[_0x94f3('0x2e')](_0x5b5fc2);};}exports[_0x94f3('0x2f')]=function(_0x3e74de,_0x5d2e7d){var _0xd70ec7={},_0x24f9c4={},_0x37ea2a={'count':0x0,'rows':[]};var _0x449c3a=_[_0x94f3('0x30')](db[_0x94f3('0x31')][_0x94f3('0x32')],function(_0x4d8a9a){return{'name':_0x4d8a9a[_0x94f3('0x33')],'type':_0x4d8a9a[_0x94f3('0x34')]['key']};});_0x24f9c4[_0x94f3('0x35')]=_[_0x94f3('0x30')](_0x449c3a,_0x94f3('0x2d'));_0x24f9c4[_0x94f3('0x36')]=_[_0x94f3('0x37')](_0x3e74de[_0x94f3('0x36')]);_0x24f9c4[_0x94f3('0x38')]=_['intersection'](_0x24f9c4['model'],_0x24f9c4[_0x94f3('0x36')]);_0xd70ec7[_0x94f3('0x39')]=_['intersection'](_0x24f9c4[_0x94f3('0x35')],qs[_0x94f3('0x3a')](_0x3e74de[_0x94f3('0x36')][_0x94f3('0x3a')]));_0xd70ec7[_0x94f3('0x39')]=_0xd70ec7[_0x94f3('0x39')][_0x94f3('0x3b')]?_0xd70ec7[_0x94f3('0x39')]:_0x24f9c4[_0x94f3('0x35')];if(!_0x3e74de[_0x94f3('0x36')][_0x94f3('0x3c')]('nolimit')){_0xd70ec7[_0x94f3('0x22')]=qs[_0x94f3('0x22')](_0x3e74de[_0x94f3('0x36')][_0x94f3('0x22')]);_0xd70ec7[_0x94f3('0x20')]=qs[_0x94f3('0x20')](_0x3e74de[_0x94f3('0x36')][_0x94f3('0x20')]);}_0xd70ec7[_0x94f3('0x3d')]=qs[_0x94f3('0x3e')](_0x3e74de['query']['sort']);_0xd70ec7[_0x94f3('0x3f')]=qs[_0x94f3('0x38')](_['pick'](_0x3e74de['query'],_0x24f9c4[_0x94f3('0x38')]),_0x449c3a);if(_0x3e74de['query']['filter']){_0xd70ec7[_0x94f3('0x3f')]=_[_0x94f3('0x40')](_0xd70ec7[_0x94f3('0x3f')],{'$or':_[_0x94f3('0x30')](_0x449c3a,function(_0xab81aa){if(_0xab81aa[_0x94f3('0x34')]!=='VIRTUAL'){var _0x1f90a7={};_0x1f90a7[_0xab81aa[_0x94f3('0x2d')]]={'$like':'%'+_0x3e74de[_0x94f3('0x36')][_0x94f3('0x41')]+'%'};return _0x1f90a7;}})});}_0xd70ec7=_['merge']({},_0xd70ec7,_0x3e74de['options']);var _0x14ed7f={'where':_0xd70ec7[_0x94f3('0x3f')]};return db[_0x94f3('0x31')][_0x94f3('0x23')](_0x14ed7f)[_0x94f3('0x29')](function(_0x2d952a){_0x37ea2a['count']=_0x2d952a;if(_0x3e74de[_0x94f3('0x36')][_0x94f3('0x42')]){_0xd70ec7[_0x94f3('0x43')]=[{'all':!![]}];}return db[_0x94f3('0x31')]['findAll'](_0xd70ec7);})[_0x94f3('0x29')](function(_0xf2fb41){_0x37ea2a[_0x94f3('0x44')]=_0xf2fb41;return _0x37ea2a;})['then'](respondWithFilteredResult(_0x5d2e7d,_0xd70ec7))[_0x94f3('0x45')](handleError(_0x5d2e7d,null));};exports['show']=function(_0x27e93e,_0xe900ba){var _0x5ab461={'raw':!![],'where':{'id':_0x27e93e[_0x94f3('0x46')]['id']}},_0x5c0233={};_0x5c0233[_0x94f3('0x35')]=_[_0x94f3('0x37')](db['ServicenowField']['rawAttributes']);_0x5c0233[_0x94f3('0x36')]=_[_0x94f3('0x37')](_0x27e93e[_0x94f3('0x36')]);_0x5c0233[_0x94f3('0x38')]=_[_0x94f3('0x47')](_0x5c0233[_0x94f3('0x35')],_0x5c0233[_0x94f3('0x36')]);_0x5ab461[_0x94f3('0x39')]=_[_0x94f3('0x47')](_0x5c0233['model'],qs[_0x94f3('0x3a')](_0x27e93e[_0x94f3('0x36')][_0x94f3('0x3a')]));_0x5ab461[_0x94f3('0x39')]=_0x5ab461[_0x94f3('0x39')][_0x94f3('0x3b')]?_0x5ab461[_0x94f3('0x39')]:_0x5c0233['model'];if(_0x27e93e['query'][_0x94f3('0x42')]){_0x5ab461['include']=[{'all':!![]}];}_0x5ab461=_['merge']({},_0x5ab461,_0x27e93e['options']);return db[_0x94f3('0x31')]['find'](_0x5ab461)['then'](handleEntityNotFound(_0xe900ba,null))[_0x94f3('0x29')](respondWithResult(_0xe900ba,null))[_0x94f3('0x45')](handleError(_0xe900ba,null));};exports[_0x94f3('0x48')]=function(_0x2a65ea,_0x510190){return db[_0x94f3('0x31')]['create'](_0x2a65ea['body'],{})[_0x94f3('0x29')](respondWithResult(_0x510190,0xc9))[_0x94f3('0x45')](handleError(_0x510190,null));};exports[_0x94f3('0x28')]=function(_0x288590,_0x258a27){if(_0x288590['body']['id']){delete _0x288590['body']['id'];}return db['ServicenowField'][_0x94f3('0x49')]({'where':{'id':_0x288590[_0x94f3('0x46')]['id']}})[_0x94f3('0x29')](handleEntityNotFound(_0x258a27,null))[_0x94f3('0x29')](saveUpdates(_0x288590[_0x94f3('0x4a')],null))[_0x94f3('0x29')](respondWithResult(_0x258a27,null))['catch'](handleError(_0x258a27,null));};exports[_0x94f3('0x2a')]=function(_0x13cc4f,_0x17eb1f){return db['ServicenowField'][_0x94f3('0x49')]({'where':{'id':_0x13cc4f[_0x94f3('0x46')]['id']}})['then'](handleEntityNotFound(_0x17eb1f,null))[_0x94f3('0x29')](removeEntity(_0x17eb1f,null))[_0x94f3('0x45')](handleError(_0x17eb1f,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 4df4318..2956d90 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 _0xe4c0=['int_servicenow_fields','servicenow_unique_index','idField','FieldId','util','moment','request-promise','path','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField'];(function(_0x222d6e,_0x35dec2){var _0x1208e1=function(_0x4bd22b){while(--_0x4bd22b){_0x222d6e['push'](_0x222d6e['shift']());}};_0x1208e1(++_0x35dec2);}(_0xe4c0,0xe1));var _0x0e4c=function(_0x369a98,_0x32250c){_0x369a98=_0x369a98-0x0;var _0x29565c=_0xe4c0[_0x369a98];return _0x29565c;};'use strict';var _=require('lodash');var util=require(_0x0e4c('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x0e4c('0x1'));var BPromise=require('bluebird');var rp=require(_0x0e4c('0x2'));var fs=require('fs');var path=require(_0x0e4c('0x3'));var rimraf=require('rimraf');var config=require(_0x0e4c('0x4'));var attributes=require(_0x0e4c('0x5'));module[_0x0e4c('0x6')]=function(_0xb998da,_0x572204){return _0xb998da[_0x0e4c('0x7')](_0x0e4c('0x8'),attributes,{'tableName':_0x0e4c('0x9'),'paranoid':![],'indexes':[{'name':_0x0e4c('0xa'),'fields':[_0x0e4c('0xb'),_0x0e4c('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8dd0=['idField','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','servicenow_unique_index'];(function(_0x481ee8,_0x5aa574){var _0x5ad55f=function(_0x81c176){while(--_0x81c176){_0x481ee8['push'](_0x481ee8['shift']());}};_0x5ad55f(++_0x5aa574);}(_0x8dd0,0x71));var _0x08dd=function(_0x1e5570,_0x38bd3d){_0x1e5570=_0x1e5570-0x0;var _0xbfa7c=_0x8dd0[_0x1e5570];return _0xbfa7c;};'use strict';var _=require('lodash');var util=require(_0x08dd('0x0'));var logger=require(_0x08dd('0x1'))(_0x08dd('0x2'));var moment=require(_0x08dd('0x3'));var BPromise=require(_0x08dd('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x08dd('0x5'));var rimraf=require(_0x08dd('0x6'));var config=require(_0x08dd('0x7'));var attributes=require(_0x08dd('0x8'));module[_0x08dd('0x9')]=function(_0x499272,_0x5d5634){return _0x499272[_0x08dd('0xa')](_0x08dd('0xb'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x08dd('0xc'),'fields':[_0x08dd('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index 9d62fc1..35ee5b2 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 _0x9ffd=['ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','debug'];(function(_0x3abde4,_0x5e0d86){var _0x59c745=function(_0x302fb5){while(--_0x302fb5){_0x3abde4['push'](_0x3abde4['shift']());}};_0x59c745(++_0x5e0d86);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x2cddd3,_0x1b6680){_0x2cddd3=_0x2cddd3-0x0;var _0x3501eb=_0x9ffd[_0x2cddd3];return _0x3501eb;};'use strict';var _=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var moment=require(_0xd9ff('0x2'));var BPromise=require('bluebird');var rs=require(_0xd9ff('0x3'));var fs=require('fs');var Redis=require(_0xd9ff('0x4'));var db=require(_0xd9ff('0x5'))['db'];var utils=require(_0xd9ff('0x6'));var logger=require('../../config/logger')(_0xd9ff('0x7'));var config=require(_0xd9ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd9ff('0x9')][_0xd9ff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ea8c,_0x270eb2,_0x45c60a){return new BPromise(function(_0x66282d,_0x13954e){return client[_0xd9ff('0xb')](_0x13ea8c,_0x45c60a)[_0xd9ff('0xc')](function(_0x58e728){logger['info']('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');logger[_0xd9ff('0xd')](_0xd9ff('0xe'),_0x270eb2,_0xd9ff('0xf'),JSON[_0xd9ff('0x10')](_0x58e728));if(_0x58e728[_0xd9ff('0x11')]){if(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x12')]===0x1f4){logger[_0xd9ff('0x11')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x13954e(_0x58e728[_0xd9ff('0x11')][_0xd9ff('0x13')]);}logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x58e728['error'][_0xd9ff('0x13')]);return _0x66282d(_0x58e728[_0xd9ff('0x11')]['message']);}else{logger[_0xd9ff('0x15')]('ServicenowField,\x20%s,\x20%s',_0x270eb2,'request\x20sent');_0x66282d(_0x58e728['result']['message']);}})[_0xd9ff('0x16')](function(_0x4f9d6d){logger[_0xd9ff('0x11')](_0xd9ff('0x14'),_0x270eb2,_0x4f9d6d);_0x13954e(_0x4f9d6d);});});} \ No newline at end of file +var _0xf4eb=['ServicenowField,\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(_0x441038,_0x318ade){var _0x373b31=function(_0x265b32){while(--_0x265b32){_0x441038['push'](_0x441038['shift']());}};_0x373b31(++_0x318ade);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4c5ffa,_0x4267c9){_0x4c5ffa=_0x4c5ffa-0x0;var _0x35cbb8=_0xf4eb[_0x4c5ffa];return _0x35cbb8;};'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')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index f74beab..262eedf 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x31cd79,_0x1a667a){var _0x12d5dd=function(_0x4a60e0){while(--_0x4a60e0){_0x31cd79['push'](_0x31cd79['shift']());}};_0x12d5dd(++_0x1a667a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x555cdb,_0x31568e){var _0x1081bb=function(_0x20d2ce){while(--_0x20d2ce){_0x555cdb['push'](_0x555cdb['shift']());}};_0x1081bb(++_0x31568e);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index e6c258e..e367b33 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 _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x3b04fb,_0x36a420){var _0x159be6=function(_0x5194c7){while(--_0x5194c7){_0x3b04fb['push'](_0x3b04fb['shift']());}};_0x159be6(++_0x36a420);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x5e5981,_0x3aa507){var _0x400163=function(_0x3c4353){while(--_0x3c4353){_0x5e5981['push'](_0x5e5981['shift']());}};_0x400163(++_0x3aa507);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 749aa1b..0431d39 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 _0x8fe0=['index','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','name','merge','options','SugarcrmAccount','includeAll','include','rows','show','params','keys','find','catch','create','body','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','created_by','description','parent_id','parent_type','parent_name','direction','password','remoteUri','substring','lastIndexOf','POST','format','/service/v4_1/rest.php','JSON','stringify','PLAIN','Invalid\x20Login','%s%s','get_module_fields','values','module_fields','remove','includes','label','endsWith','value','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','undefined','limit','count','set','Content-Range','json','save','update','then','sendStatus','error','stack','send'];(function(_0x26eb00,_0x535593){var _0x1b23dc=function(_0x4e531a){while(--_0x4e531a){_0x26eb00['push'](_0x26eb00['shift']());}};_0x1b23dc(++_0x535593);}(_0x8fe0,0x1ab));var _0x08fe=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x8fe0[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x08fe('0x0'));var rimraf=require(_0x08fe('0x1'));var zipdir=require(_0x08fe('0x2'));var jsonpatch=require(_0x08fe('0x3'));var rp=require(_0x08fe('0x4'));var moment=require(_0x08fe('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x08fe('0x6'));var util=require(_0x08fe('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x08fe('0x8'));var ejs=require(_0x08fe('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x08fe('0xa'));var squel=require(_0x08fe('0xb'));var crypto=require(_0x08fe('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x08fe('0xd'));var Redis=require(_0x08fe('0xe'));var authService=require(_0x08fe('0xf'));var qs=require(_0x08fe('0x10'));var as=require(_0x08fe('0x11'));var hardwareService=require(_0x08fe('0x12'));var logger=require('../../config/logger')(_0x08fe('0x13'));var utils=require(_0x08fe('0x14'));var config=require(_0x08fe('0x15'));var licenseUtil=require(_0x08fe('0x16'));var db=require(_0x08fe('0x17'))['db'];var integrations=require(_0x08fe('0x18'));function respondWithStatusCode(_0x44bde4,_0x5094fc){_0x5094fc=_0x5094fc||0xcc;return function(_0x38b8c6){if(_0x38b8c6){return _0x44bde4['sendStatus'](_0x5094fc);}return _0x44bde4[_0x08fe('0x19')](_0x5094fc)[_0x08fe('0x1a')]();};}function respondWithResult(_0x5c8bec,_0x8c2798){_0x8c2798=_0x8c2798||0xc8;return function(_0x32c713){if(_0x32c713){return _0x5c8bec[_0x08fe('0x19')](_0x8c2798)['json'](_0x32c713);}};}function respondWithFilteredResult(_0x361b5b,_0x24fc60){return function(_0x4ac8e8){if(_0x4ac8e8){var _0xb83ed7=typeof _0x24fc60[_0x08fe('0x1b')]===_0x08fe('0x1c')&&typeof _0x24fc60[_0x08fe('0x1d')]===_0x08fe('0x1c');var _0x3e24b8=_0x4ac8e8['count'];var _0x372b68=_0xb83ed7?0x0:_0x24fc60[_0x08fe('0x1b')];var _0x313f02=_0xb83ed7?_0x4ac8e8[_0x08fe('0x1e')]:_0x24fc60[_0x08fe('0x1b')]+_0x24fc60[_0x08fe('0x1d')];var _0x46f752;if(_0x313f02>=_0x3e24b8){_0x313f02=_0x3e24b8;_0x46f752=0xc8;}else{_0x46f752=0xce;}_0x361b5b[_0x08fe('0x19')](_0x46f752);return _0x361b5b[_0x08fe('0x1f')](_0x08fe('0x20'),_0x372b68+'-'+_0x313f02+'/'+_0x3e24b8)[_0x08fe('0x21')](_0x4ac8e8);}return null;};}function patchUpdates(_0x57fe96){return function(_0x31707d){try{jsonpatch['apply'](_0x31707d,_0x57fe96,!![]);}catch(_0x315e7c){return BPromise['reject'](_0x315e7c);}return _0x31707d[_0x08fe('0x22')]();};}function saveUpdates(_0x4f81da,_0x485c40){return function(_0x4e4be3){if(_0x4e4be3){return _0x4e4be3[_0x08fe('0x23')](_0x4f81da)['then'](function(_0x21f32b){return _0x21f32b;});}return null;};}function removeEntity(_0x2d66db,_0x2de9db){return function(_0x397352){if(_0x397352){return _0x397352['destroy']()[_0x08fe('0x24')](function(){_0x2d66db[_0x08fe('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4932f4,_0x392d4e){return function(_0x3b09c5){if(!_0x3b09c5){_0x4932f4[_0x08fe('0x25')](0x194);}return _0x3b09c5;};}function handleError(_0x2b2d68,_0x2a4fca){_0x2a4fca=_0x2a4fca||0x1f4;return function(_0x14b2fb){logger[_0x08fe('0x26')](_0x14b2fb[_0x08fe('0x27')]);if(_0x14b2fb['name']){delete _0x14b2fb['name'];}_0x2b2d68[_0x08fe('0x19')](_0x2a4fca)[_0x08fe('0x28')](_0x14b2fb);};}exports[_0x08fe('0x29')]=function(_0x106b51,_0x4082a1){var _0x2d3a27={},_0x57aca5={},_0x1fded9={'count':0x0,'rows':[]};var _0x1f8c09=_[_0x08fe('0x2a')](db['SugarcrmAccount'][_0x08fe('0x2b')],function(_0x1a34e3){return{'name':_0x1a34e3[_0x08fe('0x2c')],'type':_0x1a34e3['type'][_0x08fe('0x2d')]};});_0x57aca5[_0x08fe('0x2e')]=_[_0x08fe('0x2a')](_0x1f8c09,'name');_0x57aca5[_0x08fe('0x2f')]=_['keys'](_0x106b51['query']);_0x57aca5[_0x08fe('0x30')]=_[_0x08fe('0x31')](_0x57aca5[_0x08fe('0x2e')],_0x57aca5[_0x08fe('0x2f')]);_0x2d3a27[_0x08fe('0x32')]=_[_0x08fe('0x31')](_0x57aca5[_0x08fe('0x2e')],qs[_0x08fe('0x33')](_0x106b51[_0x08fe('0x2f')]['fields']));_0x2d3a27[_0x08fe('0x32')]=_0x2d3a27['attributes'][_0x08fe('0x34')]?_0x2d3a27[_0x08fe('0x32')]:_0x57aca5[_0x08fe('0x2e')];if(!_0x106b51[_0x08fe('0x2f')][_0x08fe('0x35')](_0x08fe('0x36'))){_0x2d3a27[_0x08fe('0x1d')]=qs[_0x08fe('0x1d')](_0x106b51['query'][_0x08fe('0x1d')]);_0x2d3a27[_0x08fe('0x1b')]=qs[_0x08fe('0x1b')](_0x106b51[_0x08fe('0x2f')]['offset']);}_0x2d3a27[_0x08fe('0x37')]=qs[_0x08fe('0x38')](_0x106b51[_0x08fe('0x2f')]['sort']);_0x2d3a27[_0x08fe('0x39')]=qs[_0x08fe('0x30')](_[_0x08fe('0x3a')](_0x106b51['query'],_0x57aca5[_0x08fe('0x30')]),_0x1f8c09);if(_0x106b51[_0x08fe('0x2f')][_0x08fe('0x3b')]){_0x2d3a27[_0x08fe('0x39')]=_['merge'](_0x2d3a27[_0x08fe('0x39')],{'$or':_[_0x08fe('0x2a')](_0x1f8c09,function(_0x35a732){if(_0x35a732[_0x08fe('0x3c')]!==_0x08fe('0x3d')){var _0x1183be={};_0x1183be[_0x35a732[_0x08fe('0x3e')]]={'$like':'%'+_0x106b51[_0x08fe('0x2f')][_0x08fe('0x3b')]+'%'};return _0x1183be;}})});}_0x2d3a27=_[_0x08fe('0x3f')]({},_0x2d3a27,_0x106b51[_0x08fe('0x40')]);var _0x3e0dca={'where':_0x2d3a27[_0x08fe('0x39')]};return db[_0x08fe('0x41')][_0x08fe('0x1e')](_0x3e0dca)[_0x08fe('0x24')](function(_0x151e67){_0x1fded9[_0x08fe('0x1e')]=_0x151e67;if(_0x106b51[_0x08fe('0x2f')][_0x08fe('0x42')]){_0x2d3a27[_0x08fe('0x43')]=[{'all':!![]}];}return db['SugarcrmAccount']['findAll'](_0x2d3a27);})[_0x08fe('0x24')](function(_0x2f064d){_0x1fded9[_0x08fe('0x44')]=_0x2f064d;return _0x1fded9;})[_0x08fe('0x24')](respondWithFilteredResult(_0x4082a1,_0x2d3a27))['catch'](handleError(_0x4082a1,null));};exports[_0x08fe('0x45')]=function(_0x247a5e,_0x322cc0){var _0x5af16e={'raw':![],'where':{'id':_0x247a5e[_0x08fe('0x46')]['id']}},_0x1364c8={};_0x1364c8[_0x08fe('0x2e')]=_[_0x08fe('0x47')](db[_0x08fe('0x41')]['rawAttributes']);_0x1364c8[_0x08fe('0x2f')]=_[_0x08fe('0x47')](_0x247a5e[_0x08fe('0x2f')]);_0x1364c8['filters']=_[_0x08fe('0x31')](_0x1364c8[_0x08fe('0x2e')],_0x1364c8[_0x08fe('0x2f')]);_0x5af16e['attributes']=_[_0x08fe('0x31')](_0x1364c8[_0x08fe('0x2e')],qs[_0x08fe('0x33')](_0x247a5e[_0x08fe('0x2f')]['fields']));_0x5af16e['attributes']=_0x5af16e[_0x08fe('0x32')][_0x08fe('0x34')]?_0x5af16e[_0x08fe('0x32')]:_0x1364c8[_0x08fe('0x2e')];if(_0x247a5e[_0x08fe('0x2f')][_0x08fe('0x42')]){_0x5af16e[_0x08fe('0x43')]=[{'all':!![]}];}_0x5af16e=_['merge']({},_0x5af16e,_0x247a5e[_0x08fe('0x40')]);return db[_0x08fe('0x41')][_0x08fe('0x48')](_0x5af16e)[_0x08fe('0x24')](handleEntityNotFound(_0x322cc0,null))['then'](respondWithResult(_0x322cc0,null))[_0x08fe('0x49')](handleError(_0x322cc0,null));};exports['create']=function(_0x4e92cd,_0x3abf19){return db['SugarcrmAccount'][_0x08fe('0x4a')](_0x4e92cd[_0x08fe('0x4b')],{})[_0x08fe('0x24')](respondWithResult(_0x3abf19,0xc9))[_0x08fe('0x49')](handleError(_0x3abf19,null));};exports[_0x08fe('0x23')]=function(_0x418cdb,_0x393967){if(_0x418cdb[_0x08fe('0x4b')]['id']){delete _0x418cdb[_0x08fe('0x4b')]['id'];}return db[_0x08fe('0x41')]['find']({'where':{'id':_0x418cdb['params']['id']}})[_0x08fe('0x24')](handleEntityNotFound(_0x393967,null))[_0x08fe('0x24')](saveUpdates(_0x418cdb[_0x08fe('0x4b')],null))[_0x08fe('0x24')](respondWithResult(_0x393967,null))[_0x08fe('0x49')](handleError(_0x393967,null));};exports['destroy']=function(_0x4ae4a6,_0x1f2802){return db[_0x08fe('0x41')][_0x08fe('0x48')]({'where':{'id':_0x4ae4a6[_0x08fe('0x46')]['id']}})[_0x08fe('0x24')](handleEntityNotFound(_0x1f2802,null))[_0x08fe('0x24')](removeEntity(_0x1f2802,null))[_0x08fe('0x49')](handleError(_0x1f2802,null));};exports[_0x08fe('0x4c')]=function(_0x3c91f8,_0x14df04,_0x297e8e){var _0xa71b89={};var _0x1c0155={};var _0x2942ef;var _0x207a03;return db[_0x08fe('0x41')][_0x08fe('0x4d')]({'where':{'id':_0x3c91f8[_0x08fe('0x46')]['id']}})[_0x08fe('0x24')](handleEntityNotFound(_0x14df04,null))['then'](function(_0x298470){if(_0x298470){_0x2942ef=_0x298470;_0x1c0155[_0x08fe('0x2e')]=_[_0x08fe('0x47')](db['SugarcrmConfiguration']['rawAttributes']);_0x1c0155[_0x08fe('0x2f')]=_[_0x08fe('0x47')](_0x3c91f8[_0x08fe('0x2f')]);_0x1c0155['filters']=_[_0x08fe('0x31')](_0x1c0155['model'],_0x1c0155[_0x08fe('0x2f')]);_0xa71b89[_0x08fe('0x32')]=_[_0x08fe('0x31')](_0x1c0155[_0x08fe('0x2e')],qs[_0x08fe('0x33')](_0x3c91f8[_0x08fe('0x2f')][_0x08fe('0x33')]));_0xa71b89[_0x08fe('0x32')]=_0xa71b89['attributes']['length']?_0xa71b89[_0x08fe('0x32')]:_0x1c0155[_0x08fe('0x2e')];_0xa71b89[_0x08fe('0x37')]=qs[_0x08fe('0x38')](_0x3c91f8[_0x08fe('0x2f')][_0x08fe('0x38')]);_0xa71b89['where']=qs[_0x08fe('0x30')](_[_0x08fe('0x3a')](_0x3c91f8[_0x08fe('0x2f')],_0x1c0155[_0x08fe('0x30')]));if(_0x3c91f8[_0x08fe('0x2f')][_0x08fe('0x3b')]){_0xa71b89[_0x08fe('0x39')]=_[_0x08fe('0x3f')](_0xa71b89[_0x08fe('0x39')],{'$or':_[_0x08fe('0x2a')](_0xa71b89[_0x08fe('0x32')],function(_0xcc20a9){var _0x131b39={};_0x131b39[_0xcc20a9]={'$like':'%'+_0x3c91f8[_0x08fe('0x2f')]['filter']+'%'};return _0x131b39;})});}_0xa71b89=_[_0x08fe('0x3f')]({},_0xa71b89,_0x3c91f8[_0x08fe('0x40')]);return _0x2942ef[_0x08fe('0x4c')](_0xa71b89);}})[_0x08fe('0x24')](function(_0x4a3764){if(_0x4a3764){_0x207a03=_0x4a3764[_0x08fe('0x34')];if(!_0x3c91f8[_0x08fe('0x2f')][_0x08fe('0x35')](_0x08fe('0x36'))){_0xa71b89['limit']=qs[_0x08fe('0x1d')](_0x3c91f8['query'][_0x08fe('0x1d')]);_0xa71b89[_0x08fe('0x1b')]=qs[_0x08fe('0x1b')](_0x3c91f8[_0x08fe('0x2f')]['offset']);}return _0x2942ef[_0x08fe('0x4c')](_0xa71b89);}})[_0x08fe('0x24')](function(_0x22bc96){if(_0x22bc96){return _0x22bc96?{'count':_0x207a03,'rows':_0x22bc96}:null;}})[_0x08fe('0x24')](respondWithResult(_0x14df04,null))['catch'](handleError(_0x14df04,null));};exports[_0x08fe('0x4e')]=function(_0x1a066b,_0x455e81,_0xb820d){if(_0x1a066b[_0x08fe('0x4b')]['id']){delete _0x1a066b[_0x08fe('0x4b')]['id'];}return db[_0x08fe('0x41')][_0x08fe('0x4d')]({'where':{'id':_0x1a066b[_0x08fe('0x46')]['id']}})[_0x08fe('0x24')](handleEntityNotFound(_0x455e81,null))[_0x08fe('0x24')](function(_0x427f1b){if(_0x427f1b){_0x1a066b[_0x08fe('0x4b')][_0x08fe('0x4f')]=_0x427f1b['id'];_0x1a066b[_0x08fe('0x4b')][_0x08fe('0x50')]=integrations[_0x08fe('0x51')](_0x1a066b['body'][_0x08fe('0x52')],_0x1a066b[_0x08fe('0x4b')]['type']);_0x1a066b['body'][_0x08fe('0x53')]=integrations[_0x08fe('0x54')](_0x1a066b[_0x08fe('0x4b')][_0x08fe('0x52')],_0x1a066b['body'][_0x08fe('0x3c')]);return db[_0x08fe('0x55')][_0x08fe('0x4a')](_0x1a066b[_0x08fe('0x4b')],{'include':[{'model':db[_0x08fe('0x56')],'as':'Subjects'},{'model':db['SugarcrmField'],'as':'Descriptions'}]});}return null;})[_0x08fe('0x24')](respondWithResult(_0x455e81,null))[_0x08fe('0x49')](handleError(_0x455e81,null));};exports[_0x08fe('0x57')]=function(_0x1454e7,_0x32772d,_0x4cc4c1){var _0x13deeb='';var _0x38a0ee=['id','name','assigned_user_id',_0x08fe('0x58'),_0x08fe('0x59'),'date_start','duration_hours','duration_minutes',_0x08fe('0x5a'),_0x08fe('0x5b'),_0x08fe('0x5c'),_0x08fe('0x5d')];return db[_0x08fe('0x41')]['findOne']({'where':{'id':_0x1454e7['params']['id']},'attributes':['id','username',_0x08fe('0x5e'),_0x08fe('0x5f')]})[_0x08fe('0x24')](handleEntityNotFound(_0x32772d,null))['then'](function(_0x49ecfb){if(_0x49ecfb){_0x13deeb=_0x49ecfb[_0x08fe('0x5f')];var _0x4f0c14=_0x13deeb['slice'](-0x1);if(_0x4f0c14==='/'){_0x13deeb=_0x13deeb[_0x08fe('0x60')](0x0,_0x13deeb[_0x08fe('0x61')](_0x4f0c14));}return rp({'method':_0x08fe('0x62'),'uri':util[_0x08fe('0x63')]('%s%s',_0x13deeb,_0x08fe('0x64')),'json':!![],'form':{'method':'login','input_type':_0x08fe('0x65'),'response_type':'JSON','rest_data':JSON[_0x08fe('0x66')]({'user_auth':{'user_name':_0x49ecfb['username'],'password':_0x49ecfb[_0x08fe('0x5e')],'encryption':_0x08fe('0x67')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x08fe('0x24')](function(_0x478849){if(_0x478849&&_0x478849[_0x08fe('0x3e')]!==_0x08fe('0x68')&&_0x478849[_0x08fe('0x3e')]!=='Password\x20Expired'){return rp({'method':'POST','uri':util[_0x08fe('0x63')](_0x08fe('0x69'),_0x13deeb,_0x08fe('0x64')),'json':!![],'form':{'method':_0x08fe('0x6a'),'input_type':'JSON','response_type':_0x08fe('0x65'),'rest_data':JSON[_0x08fe('0x66')]({'session':_0x478849['id'],'module_name':'Calls'})}})[_0x08fe('0x24')](function(_0x19677a){if(_0x19677a){var _0x43695e=_[_0x08fe('0x6b')](_0x19677a[_0x08fe('0x6c')]);_[_0x08fe('0x6d')](_0x43695e,function(_0xbd1d81){return _0x38a0ee[_0x08fe('0x6e')](_0xbd1d81[_0x08fe('0x3e')]);});return{'count':_0x43695e[_0x08fe('0x34')],'rows':_[_0x08fe('0x2a')](_0x43695e,function(_0x18edc0){return{'id':_0x18edc0[_0x08fe('0x3e')],'name':_0x18edc0[_0x08fe('0x6f')],'custom':_[_0x08fe('0x70')](_0x18edc0[_0x08fe('0x3e')],'_c')?!![]:![],'options':_0x18edc0[_0x08fe('0x40')]?_[_0x08fe('0x2a')](_[_0x08fe('0x6b')](_0x18edc0['options']),function(_0x2aeb62){return{'name':_0x2aeb62[_0x08fe('0x71')],'value':_0x2aeb62[_0x08fe('0x3e')]};}):[]};})};}})[_0x08fe('0x24')](respondWithResult(_0x32772d,null))[_0x08fe('0x49')](function(_0x12e474){var _0x37693c=_0x1454e7[_0x08fe('0x2f')]['test']?0x1f4:_0x12e474['statusCode']||0x1f4;logger[_0x08fe('0x26')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x37693c,JSON[_0x08fe('0x66')](_0x12e474));delete _0x12e474[_0x08fe('0x3e')];if(_0x37693c===0x191){_0x37693c=0x190;}_0x32772d['status'](_0x37693c)['send'](_0x1454e7['query'][_0x08fe('0x72')]?{'message':_0x08fe('0x73'),'statusCode':_0x12e474[_0x08fe('0x74')]}:_0x12e474);});}else{var _0x3a712f=0x1f4;_0x32772d[_0x08fe('0x19')](_0x3a712f)[_0x08fe('0x28')]({'message':_0x08fe('0x73'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xbc53=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','end','status','json','limit','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','SugarcrmAccount','findAll','rows','catch','params','includeAll','include','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','order','addConfiguration','Subjects','getSubjects','channel','Descriptions','SugarcrmField','assigned_user_id','created_by','date_start','duration_hours','parent_id','parent_type','parent_name','username','remoteUri','slice','substring','lastIndexOf','POST','format','%s%s','/service/v4_1/rest.php','stringify','password','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','get_module_fields','JSON','Calls','values','module_fields','remove','includes','endsWith','value','test','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','statusCode','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x3da3e0,_0x2193f0){var _0x41ce7d=function(_0x30f88d){while(--_0x30f88d){_0x3da3e0['push'](_0x3da3e0['shift']());}};_0x41ce7d(++_0x2193f0);}(_0xbc53,0x1e9));var _0x3bc5=function(_0x3da33d,_0x3a1ee9){_0x3da33d=_0x3da33d-0x0;var _0x1460ba=_0xbc53[_0x3da33d];return _0x1460ba;};'use strict';var emlformat=require(_0x3bc5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3bc5('0x1'));var jsonpatch=require(_0x3bc5('0x2'));var rp=require('request-promise');var moment=require(_0x3bc5('0x3'));var BPromise=require(_0x3bc5('0x4'));var Mustache=require(_0x3bc5('0x5'));var util=require('util');var path=require(_0x3bc5('0x6'));var sox=require(_0x3bc5('0x7'));var csv=require(_0x3bc5('0x8'));var ejs=require(_0x3bc5('0x9'));var fs=require('fs');var fs_extra=require(_0x3bc5('0xa'));var _=require(_0x3bc5('0xb'));var squel=require(_0x3bc5('0xc'));var crypto=require(_0x3bc5('0xd'));var jsforce=require(_0x3bc5('0xe'));var deskjs=require(_0x3bc5('0xf'));var toCsv=require(_0x3bc5('0x8'));var querystring=require(_0x3bc5('0x10'));var Papa=require(_0x3bc5('0x11'));var Redis=require(_0x3bc5('0x12'));var authService=require(_0x3bc5('0x13'));var qs=require(_0x3bc5('0x14'));var as=require(_0x3bc5('0x15'));var hardwareService=require(_0x3bc5('0x16'));var logger=require(_0x3bc5('0x17'))(_0x3bc5('0x18'));var utils=require(_0x3bc5('0x19'));var config=require(_0x3bc5('0x1a'));var licenseUtil=require(_0x3bc5('0x1b'));var db=require(_0x3bc5('0x1c'))['db'];var integrations=require(_0x3bc5('0x1d'));function respondWithStatusCode(_0x2593a0,_0x577d5b){_0x577d5b=_0x577d5b||0xcc;return function(_0x116970){if(_0x116970){return _0x2593a0[_0x3bc5('0x1e')](_0x577d5b);}return _0x2593a0['status'](_0x577d5b)[_0x3bc5('0x1f')]();};}function respondWithResult(_0x2f1c9a,_0x4138bf){_0x4138bf=_0x4138bf||0xc8;return function(_0x6eb78b){if(_0x6eb78b){return _0x2f1c9a[_0x3bc5('0x20')](_0x4138bf)[_0x3bc5('0x21')](_0x6eb78b);}};}function respondWithFilteredResult(_0x4b217f,_0x4cf590){return function(_0x174778){if(_0x174778){var _0xc337e2=typeof _0x4cf590['offset']==='undefined'&&typeof _0x4cf590[_0x3bc5('0x22')]===_0x3bc5('0x23');var _0x55a474=_0x174778[_0x3bc5('0x24')];var _0x4c4e70=_0xc337e2?0x0:_0x4cf590[_0x3bc5('0x25')];var _0x384fd8=_0xc337e2?_0x174778[_0x3bc5('0x24')]:_0x4cf590[_0x3bc5('0x25')]+_0x4cf590[_0x3bc5('0x22')];var _0x5331a0;if(_0x384fd8>=_0x55a474){_0x384fd8=_0x55a474;_0x5331a0=0xc8;}else{_0x5331a0=0xce;}_0x4b217f[_0x3bc5('0x20')](_0x5331a0);return _0x4b217f['set'](_0x3bc5('0x26'),_0x4c4e70+'-'+_0x384fd8+'/'+_0x55a474)['json'](_0x174778);}return null;};}function patchUpdates(_0x3a98c){return function(_0x2b0342){try{jsonpatch[_0x3bc5('0x27')](_0x2b0342,_0x3a98c,!![]);}catch(_0x39a5cb){return BPromise[_0x3bc5('0x28')](_0x39a5cb);}return _0x2b0342[_0x3bc5('0x29')]();};}function saveUpdates(_0x368ccc,_0x39e713){return function(_0x3c2267){if(_0x3c2267){return _0x3c2267[_0x3bc5('0x2a')](_0x368ccc)[_0x3bc5('0x2b')](function(_0x1ba5f1){return _0x1ba5f1;});}return null;};}function removeEntity(_0xfa21db,_0x22670c){return function(_0x5e7b15){if(_0x5e7b15){return _0x5e7b15[_0x3bc5('0x2c')]()[_0x3bc5('0x2b')](function(){_0xfa21db[_0x3bc5('0x20')](0xcc)[_0x3bc5('0x1f')]();});}};}function handleEntityNotFound(_0x3ffa31,_0x307332){return function(_0xd0ac8e){if(!_0xd0ac8e){_0x3ffa31[_0x3bc5('0x1e')](0x194);}return _0xd0ac8e;};}function handleError(_0x3994e1,_0x4391b4){_0x4391b4=_0x4391b4||0x1f4;return function(_0x47de68){logger[_0x3bc5('0x2d')](_0x47de68[_0x3bc5('0x2e')]);if(_0x47de68[_0x3bc5('0x2f')]){delete _0x47de68[_0x3bc5('0x2f')];}_0x3994e1['status'](_0x4391b4)[_0x3bc5('0x30')](_0x47de68);};}exports[_0x3bc5('0x31')]=function(_0x57292f,_0x2dc359){var _0x3f7c1c={},_0x569b52={},_0x349a06={'count':0x0,'rows':[]};var _0x388e04=_[_0x3bc5('0x32')](db['SugarcrmAccount'][_0x3bc5('0x33')],function(_0x47ee13){return{'name':_0x47ee13[_0x3bc5('0x34')],'type':_0x47ee13[_0x3bc5('0x35')][_0x3bc5('0x36')]};});_0x569b52['model']=_[_0x3bc5('0x32')](_0x388e04,_0x3bc5('0x2f'));_0x569b52[_0x3bc5('0x37')]=_[_0x3bc5('0x38')](_0x57292f[_0x3bc5('0x37')]);_0x569b52[_0x3bc5('0x39')]=_[_0x3bc5('0x3a')](_0x569b52['model'],_0x569b52[_0x3bc5('0x37')]);_0x3f7c1c[_0x3bc5('0x3b')]=_[_0x3bc5('0x3a')](_0x569b52['model'],qs[_0x3bc5('0x3c')](_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x3c')]));_0x3f7c1c[_0x3bc5('0x3b')]=_0x3f7c1c[_0x3bc5('0x3b')][_0x3bc5('0x3d')]?_0x3f7c1c[_0x3bc5('0x3b')]:_0x569b52[_0x3bc5('0x3e')];if(!_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x3f')](_0x3bc5('0x40'))){_0x3f7c1c[_0x3bc5('0x22')]=qs['limit'](_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x22')]);_0x3f7c1c[_0x3bc5('0x25')]=qs[_0x3bc5('0x25')](_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x25')]);}_0x3f7c1c['order']=qs[_0x3bc5('0x41')](_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x41')]);_0x3f7c1c[_0x3bc5('0x42')]=qs[_0x3bc5('0x39')](_[_0x3bc5('0x43')](_0x57292f[_0x3bc5('0x37')],_0x569b52[_0x3bc5('0x39')]),_0x388e04);if(_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x44')]){_0x3f7c1c[_0x3bc5('0x42')]=_['merge'](_0x3f7c1c[_0x3bc5('0x42')],{'$or':_[_0x3bc5('0x32')](_0x388e04,function(_0x375077){if(_0x375077[_0x3bc5('0x35')]!==_0x3bc5('0x45')){var _0x3921bb={};_0x3921bb[_0x375077[_0x3bc5('0x2f')]]={'$like':'%'+_0x57292f[_0x3bc5('0x37')][_0x3bc5('0x44')]+'%'};return _0x3921bb;}})});}_0x3f7c1c=_[_0x3bc5('0x46')]({},_0x3f7c1c,_0x57292f[_0x3bc5('0x47')]);var _0x10646b={'where':_0x3f7c1c[_0x3bc5('0x42')]};return db[_0x3bc5('0x48')]['count'](_0x10646b)['then'](function(_0x17f36c){_0x349a06['count']=_0x17f36c;if(_0x57292f[_0x3bc5('0x37')]['includeAll']){_0x3f7c1c['include']=[{'all':!![]}];}return db[_0x3bc5('0x48')][_0x3bc5('0x49')](_0x3f7c1c);})[_0x3bc5('0x2b')](function(_0x4da526){_0x349a06[_0x3bc5('0x4a')]=_0x4da526;return _0x349a06;})[_0x3bc5('0x2b')](respondWithFilteredResult(_0x2dc359,_0x3f7c1c))[_0x3bc5('0x4b')](handleError(_0x2dc359,null));};exports['show']=function(_0x5697dd,_0x1ddd5c){var _0x3c73fc={'raw':![],'where':{'id':_0x5697dd[_0x3bc5('0x4c')]['id']}},_0x2c5f91={};_0x2c5f91[_0x3bc5('0x3e')]=_[_0x3bc5('0x38')](db[_0x3bc5('0x48')][_0x3bc5('0x33')]);_0x2c5f91[_0x3bc5('0x37')]=_[_0x3bc5('0x38')](_0x5697dd[_0x3bc5('0x37')]);_0x2c5f91['filters']=_['intersection'](_0x2c5f91[_0x3bc5('0x3e')],_0x2c5f91['query']);_0x3c73fc['attributes']=_[_0x3bc5('0x3a')](_0x2c5f91[_0x3bc5('0x3e')],qs[_0x3bc5('0x3c')](_0x5697dd['query'][_0x3bc5('0x3c')]));_0x3c73fc['attributes']=_0x3c73fc[_0x3bc5('0x3b')]['length']?_0x3c73fc['attributes']:_0x2c5f91['model'];if(_0x5697dd['query'][_0x3bc5('0x4d')]){_0x3c73fc[_0x3bc5('0x4e')]=[{'all':!![]}];}_0x3c73fc=_[_0x3bc5('0x46')]({},_0x3c73fc,_0x5697dd[_0x3bc5('0x47')]);return db['SugarcrmAccount'][_0x3bc5('0x4f')](_0x3c73fc)[_0x3bc5('0x2b')](handleEntityNotFound(_0x1ddd5c,null))['then'](respondWithResult(_0x1ddd5c,null))[_0x3bc5('0x4b')](handleError(_0x1ddd5c,null));};exports[_0x3bc5('0x50')]=function(_0x540459,_0x3ba7d7){return db[_0x3bc5('0x48')][_0x3bc5('0x50')](_0x540459[_0x3bc5('0x51')],{})['then'](respondWithResult(_0x3ba7d7,0xc9))[_0x3bc5('0x4b')](handleError(_0x3ba7d7,null));};exports[_0x3bc5('0x2a')]=function(_0x30ec9f,_0x1158c8){if(_0x30ec9f[_0x3bc5('0x51')]['id']){delete _0x30ec9f[_0x3bc5('0x51')]['id'];}return db[_0x3bc5('0x48')][_0x3bc5('0x4f')]({'where':{'id':_0x30ec9f[_0x3bc5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1158c8,null))['then'](saveUpdates(_0x30ec9f[_0x3bc5('0x51')],null))['then'](respondWithResult(_0x1158c8,null))[_0x3bc5('0x4b')](handleError(_0x1158c8,null));};exports[_0x3bc5('0x2c')]=function(_0xcb3ddc,_0x4d224c){return db[_0x3bc5('0x48')]['find']({'where':{'id':_0xcb3ddc['params']['id']}})[_0x3bc5('0x2b')](handleEntityNotFound(_0x4d224c,null))[_0x3bc5('0x2b')](removeEntity(_0x4d224c,null))['catch'](handleError(_0x4d224c,null));};exports[_0x3bc5('0x52')]=function(_0x52a1a7,_0x5c9c33,_0x5dd2fd){var _0x46d531={};var _0x3be12e={};var _0x442cd9;var _0x322c57;return db[_0x3bc5('0x48')][_0x3bc5('0x53')]({'where':{'id':_0x52a1a7['params']['id']}})[_0x3bc5('0x2b')](handleEntityNotFound(_0x5c9c33,null))['then'](function(_0x1019e4){if(_0x1019e4){_0x442cd9=_0x1019e4;_0x3be12e[_0x3bc5('0x3e')]=_[_0x3bc5('0x38')](db[_0x3bc5('0x54')][_0x3bc5('0x33')]);_0x3be12e['query']=_[_0x3bc5('0x38')](_0x52a1a7[_0x3bc5('0x37')]);_0x3be12e['filters']=_[_0x3bc5('0x3a')](_0x3be12e[_0x3bc5('0x3e')],_0x3be12e[_0x3bc5('0x37')]);_0x46d531[_0x3bc5('0x3b')]=_[_0x3bc5('0x3a')](_0x3be12e['model'],qs[_0x3bc5('0x3c')](_0x52a1a7[_0x3bc5('0x37')][_0x3bc5('0x3c')]));_0x46d531['attributes']=_0x46d531[_0x3bc5('0x3b')][_0x3bc5('0x3d')]?_0x46d531[_0x3bc5('0x3b')]:_0x3be12e[_0x3bc5('0x3e')];_0x46d531[_0x3bc5('0x55')]=qs[_0x3bc5('0x41')](_0x52a1a7[_0x3bc5('0x37')]['sort']);_0x46d531['where']=qs[_0x3bc5('0x39')](_[_0x3bc5('0x43')](_0x52a1a7[_0x3bc5('0x37')],_0x3be12e['filters']));if(_0x52a1a7[_0x3bc5('0x37')][_0x3bc5('0x44')]){_0x46d531[_0x3bc5('0x42')]=_[_0x3bc5('0x46')](_0x46d531['where'],{'$or':_[_0x3bc5('0x32')](_0x46d531['attributes'],function(_0x28bf2a){var _0x119f90={};_0x119f90[_0x28bf2a]={'$like':'%'+_0x52a1a7[_0x3bc5('0x37')][_0x3bc5('0x44')]+'%'};return _0x119f90;})});}_0x46d531=_[_0x3bc5('0x46')]({},_0x46d531,_0x52a1a7[_0x3bc5('0x47')]);return _0x442cd9[_0x3bc5('0x52')](_0x46d531);}})[_0x3bc5('0x2b')](function(_0x2e1aae){if(_0x2e1aae){_0x322c57=_0x2e1aae[_0x3bc5('0x3d')];if(!_0x52a1a7[_0x3bc5('0x37')][_0x3bc5('0x3f')](_0x3bc5('0x40'))){_0x46d531[_0x3bc5('0x22')]=qs[_0x3bc5('0x22')](_0x52a1a7[_0x3bc5('0x37')][_0x3bc5('0x22')]);_0x46d531['offset']=qs[_0x3bc5('0x25')](_0x52a1a7[_0x3bc5('0x37')]['offset']);}return _0x442cd9[_0x3bc5('0x52')](_0x46d531);}})[_0x3bc5('0x2b')](function(_0x260607){if(_0x260607){return _0x260607?{'count':_0x322c57,'rows':_0x260607}:null;}})['then'](respondWithResult(_0x5c9c33,null))[_0x3bc5('0x4b')](handleError(_0x5c9c33,null));};exports[_0x3bc5('0x56')]=function(_0x5af418,_0xc49cba,_0x568b94){if(_0x5af418['body']['id']){delete _0x5af418[_0x3bc5('0x51')]['id'];}return db[_0x3bc5('0x48')]['findOne']({'where':{'id':_0x5af418[_0x3bc5('0x4c')]['id']}})[_0x3bc5('0x2b')](handleEntityNotFound(_0xc49cba,null))['then'](function(_0x228199){if(_0x228199){_0x5af418[_0x3bc5('0x51')]['AccountId']=_0x228199['id'];_0x5af418['body'][_0x3bc5('0x57')]=integrations[_0x3bc5('0x58')](_0x5af418[_0x3bc5('0x51')][_0x3bc5('0x59')],_0x5af418[_0x3bc5('0x51')]['type']);_0x5af418['body'][_0x3bc5('0x5a')]=integrations['getDescriptions'](_0x5af418['body']['channel'],_0x5af418[_0x3bc5('0x51')][_0x3bc5('0x35')]);return db[_0x3bc5('0x54')][_0x3bc5('0x50')](_0x5af418['body'],{'include':[{'model':db[_0x3bc5('0x5b')],'as':_0x3bc5('0x57')},{'model':db[_0x3bc5('0x5b')],'as':_0x3bc5('0x5a')}]});}return null;})['then'](respondWithResult(_0xc49cba,null))[_0x3bc5('0x4b')](handleError(_0xc49cba,null));};exports['getFields']=function(_0x1bbaca,_0x4afc42,_0x15d40b){var _0x1372a2='';var _0x26bd08=['id','name',_0x3bc5('0x5c'),_0x3bc5('0x5d'),'description',_0x3bc5('0x5e'),_0x3bc5('0x5f'),'duration_minutes',_0x3bc5('0x60'),_0x3bc5('0x61'),_0x3bc5('0x62'),'direction'];return db[_0x3bc5('0x48')][_0x3bc5('0x53')]({'where':{'id':_0x1bbaca[_0x3bc5('0x4c')]['id']},'attributes':['id',_0x3bc5('0x63'),'password',_0x3bc5('0x64')]})[_0x3bc5('0x2b')](handleEntityNotFound(_0x4afc42,null))[_0x3bc5('0x2b')](function(_0x569cdd){if(_0x569cdd){_0x1372a2=_0x569cdd['remoteUri'];var _0x1d91ab=_0x1372a2[_0x3bc5('0x65')](-0x1);if(_0x1d91ab==='/'){_0x1372a2=_0x1372a2[_0x3bc5('0x66')](0x0,_0x1372a2[_0x3bc5('0x67')](_0x1d91ab));}return rp({'method':_0x3bc5('0x68'),'uri':util[_0x3bc5('0x69')](_0x3bc5('0x6a'),_0x1372a2,_0x3bc5('0x6b')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x3bc5('0x6c')]({'user_auth':{'user_name':_0x569cdd[_0x3bc5('0x63')],'password':_0x569cdd[_0x3bc5('0x6d')],'encryption':_0x3bc5('0x6e')},'application':_0x3bc5('0x6f')})}});}})[_0x3bc5('0x2b')](function(_0x5ae350){if(_0x5ae350&&_0x5ae350[_0x3bc5('0x2f')]!=='Invalid\x20Login'&&_0x5ae350['name']!==_0x3bc5('0x70')){return rp({'method':_0x3bc5('0x68'),'uri':util[_0x3bc5('0x69')](_0x3bc5('0x6a'),_0x1372a2,_0x3bc5('0x6b')),'json':!![],'form':{'method':_0x3bc5('0x71'),'input_type':_0x3bc5('0x72'),'response_type':_0x3bc5('0x72'),'rest_data':JSON[_0x3bc5('0x6c')]({'session':_0x5ae350['id'],'module_name':_0x3bc5('0x73')})}})[_0x3bc5('0x2b')](function(_0x1f728c){if(_0x1f728c){var _0x1e6db7=_[_0x3bc5('0x74')](_0x1f728c[_0x3bc5('0x75')]);_[_0x3bc5('0x76')](_0x1e6db7,function(_0x5a2bf4){return _0x26bd08[_0x3bc5('0x77')](_0x5a2bf4[_0x3bc5('0x2f')]);});return{'count':_0x1e6db7[_0x3bc5('0x3d')],'rows':_[_0x3bc5('0x32')](_0x1e6db7,function(_0x3c3948){return{'id':_0x3c3948['name'],'name':_0x3c3948['label'],'custom':_[_0x3bc5('0x78')](_0x3c3948[_0x3bc5('0x2f')],'_c')?!![]:![],'options':_0x3c3948['options']?_[_0x3bc5('0x32')](_[_0x3bc5('0x74')](_0x3c3948[_0x3bc5('0x47')]),function(_0x4e9995){return{'name':_0x4e9995[_0x3bc5('0x79')],'value':_0x4e9995[_0x3bc5('0x2f')]};}):[]};})};}})[_0x3bc5('0x2b')](respondWithResult(_0x4afc42,null))[_0x3bc5('0x4b')](function(_0x13d701){var _0x340314=_0x1bbaca[_0x3bc5('0x37')][_0x3bc5('0x7a')]?0x1f4:_0x13d701['statusCode']||0x1f4;logger['error'](_0x3bc5('0x7b'),_0x3bc5('0x7c'),_0x340314,JSON[_0x3bc5('0x6c')](_0x13d701));delete _0x13d701['name'];if(_0x340314===0x191){_0x340314=0x190;}_0x4afc42['status'](_0x340314)[_0x3bc5('0x30')](_0x1bbaca[_0x3bc5('0x37')][_0x3bc5('0x7a')]?{'message':_0x3bc5('0x7d'),'statusCode':_0x13d701[_0x3bc5('0x7e')]}:_0x13d701);});}else{var _0x40b3c3=0x1f4;_0x4afc42[_0x3bc5('0x20')](_0x40b3c3)[_0x3bc5('0x30')]({'message':_0x3bc5('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 a687815..fee4889 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 _0xd3ab=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0x4ebabe,_0x10d36d){var _0x37860b=function(_0xd40279){while(--_0xd40279){_0x4ebabe['push'](_0x4ebabe['shift']());}};_0x37860b(++_0x10d36d);}(_0xd3ab,0x149));var _0xbd3a=function(_0x38d6a8,_0x38aa8e){_0x38d6a8=_0x38d6a8-0x0;var _0x2bd252=_0xd3ab[_0x38d6a8];return _0x2bd252;};'use strict';var _=require(_0xbd3a('0x0'));var util=require(_0xbd3a('0x1'));var logger=require(_0xbd3a('0x2'))(_0xbd3a('0x3'));var moment=require(_0xbd3a('0x4'));var BPromise=require(_0xbd3a('0x5'));var rp=require(_0xbd3a('0x6'));var fs=require('fs');var path=require(_0xbd3a('0x7'));var rimraf=require(_0xbd3a('0x8'));var config=require(_0xbd3a('0x9'));var attributes=require(_0xbd3a('0xa'));var integrations=require('../../components/integrations/configuration');module[_0xbd3a('0xb')]=function(_0x49ac7c,_0x19835d){return _0x49ac7c[_0xbd3a('0xc')](_0xbd3a('0xd'),attributes,{'tableName':_0xbd3a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bc8=['api','moment','bluebird','request-promise','path','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','../../config/logger'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x9bc8,0xa6));var _0x89bc=function(_0x155fea,_0x1afd1e){_0x155fea=_0x155fea-0x0;var _0x4394bb=_0x9bc8[_0x155fea];return _0x4394bb;};'use strict';var _=require(_0x89bc('0x0'));var util=require(_0x89bc('0x1'));var logger=require(_0x89bc('0x2'))(_0x89bc('0x3'));var moment=require(_0x89bc('0x4'));var BPromise=require(_0x89bc('0x5'));var rp=require(_0x89bc('0x6'));var fs=require('fs');var path=require(_0x89bc('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSugarcrmAccount.attributes');var integrations=require(_0x89bc('0x8'));module[_0x89bc('0x9')]=function(_0x49c366,_0x24ab05){return _0x49c366[_0x89bc('0xa')](_0x89bc('0xb'),attributes,{'tableName':_0x89bc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 8bee446..6920532 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 _0x61a4=['jayson/promise','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','include','map','model','stringify','ShowSugarcrmAccount','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x58ab41,_0x392cde){var _0x432789=function(_0x3b6982){while(--_0x3b6982){_0x58ab41['push'](_0x58ab41['shift']());}};_0x432789(++_0x392cde);}(_0x61a4,0x87));var _0x461a=function(_0x29c6e4,_0x59396c){_0x29c6e4=_0x29c6e4-0x0;var _0x1d250a=_0x61a4[_0x29c6e4];return _0x1d250a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x461a('0x0'));var BPromise=require(_0x461a('0x1'));var rs=require(_0x461a('0x2'));var fs=require('fs');var Redis=require(_0x461a('0x3'));var db=require(_0x461a('0x4'))['db'];var utils=require(_0x461a('0x5'));var logger=require(_0x461a('0x6'))(_0x461a('0x7'));var config=require(_0x461a('0x8'));var jayson=require(_0x461a('0x9'));var client=jayson[_0x461a('0xa')][_0x461a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3272e9,_0x19e6b7,_0x20b735){return new BPromise(function(_0x90513,_0x4169d1){return client[_0x461a('0xc')](_0x3272e9,_0x20b735)[_0x461a('0xd')](function(_0x55106f){logger[_0x461a('0xe')](_0x461a('0xf'),_0x19e6b7,_0x461a('0x10'));logger[_0x461a('0x11')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x19e6b7,'request\x20sent',JSON['stringify'](_0x55106f));if(_0x55106f[_0x461a('0x12')]){if(_0x55106f[_0x461a('0x12')][_0x461a('0x13')]===0x1f4){logger[_0x461a('0x12')](_0x461a('0xf'),_0x19e6b7,_0x55106f['error'][_0x461a('0x14')]);return _0x4169d1(_0x55106f[_0x461a('0x12')][_0x461a('0x14')]);}logger[_0x461a('0x12')](_0x461a('0xf'),_0x19e6b7,_0x55106f[_0x461a('0x12')][_0x461a('0x14')]);return _0x90513(_0x55106f[_0x461a('0x12')][_0x461a('0x14')]);}else{logger[_0x461a('0xe')](_0x461a('0xf'),_0x19e6b7,'request\x20sent');_0x90513(_0x55106f[_0x461a('0x15')][_0x461a('0x14')]);}})[_0x461a('0x16')](function(_0x3ef470){logger[_0x461a('0x12')](_0x461a('0xf'),_0x19e6b7,_0x3ef470);_0x4169d1(_0x3ef470);});});}exports[_0x461a('0x17')]=function(_0x4f9e07){var _0x3372ca=this;return new Promise(function(_0x277aeb,_0x1f515e){return db[_0x461a('0x18')][_0x461a('0x19')]({'raw':_0x4f9e07[_0x461a('0x1a')]?_0x4f9e07[_0x461a('0x1a')][_0x461a('0x1b')]===undefined?!![]:![]:!![],'where':_0x4f9e07['options']?_0x4f9e07[_0x461a('0x1a')][_0x461a('0x1c')]||null:null,'attributes':_0x4f9e07[_0x461a('0x1a')]?_0x4f9e07[_0x461a('0x1a')][_0x461a('0x1d')]||null:null,'limit':_0x4f9e07[_0x461a('0x1a')]?_0x4f9e07['options']['limit']||null:null,'include':_0x4f9e07[_0x461a('0x1a')]?_0x4f9e07[_0x461a('0x1a')][_0x461a('0x1e')]?_[_0x461a('0x1f')](_0x4f9e07['options']['include'],function(_0x4fe465){return{'model':db[_0x4fe465[_0x461a('0x20')]],'as':_0x4fe465['as'],'attributes':_0x4fe465['attributes'],'include':_0x4fe465['include']?_[_0x461a('0x1f')](_0x4fe465[_0x461a('0x1e')],function(_0x481f03){return{'model':db[_0x481f03[_0x461a('0x20')]],'as':_0x481f03['as'],'attributes':_0x481f03[_0x461a('0x1d')],'include':_0x481f03[_0x461a('0x1e')]?_[_0x461a('0x1f')](_0x481f03[_0x461a('0x1e')],function(_0x470a8a){return{'model':db[_0x470a8a['model']],'as':_0x470a8a['as'],'attributes':_0x470a8a[_0x461a('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x461a('0xd')](function(_0x1b6e0c){logger['info'](_0x461a('0x17'),_0x4f9e07);logger[_0x461a('0x11')](_0x461a('0x17'),_0x4f9e07,JSON[_0x461a('0x21')](_0x1b6e0c));_0x277aeb(_0x1b6e0c);})['catch'](function(_0x4f94ea){logger[_0x461a('0x12')](_0x461a('0x17'),_0x4f94ea[_0x461a('0x14')],_0x4f9e07);_0x1f515e(_0x3372ca[_0x461a('0x12')](0x1f4,_0x4f94ea[_0x461a('0x14')]));});});};exports[_0x461a('0x22')]=function(_0x288e43){var _0x4f73b3=this;return new Promise(function(_0x479896,_0x414726){return db[_0x461a('0x18')][_0x461a('0x23')]({'raw':_0x288e43['options']?_0x288e43[_0x461a('0x1a')][_0x461a('0x1b')]===undefined?!![]:![]:!![],'where':_0x288e43[_0x461a('0x1a')]?_0x288e43[_0x461a('0x1a')][_0x461a('0x1c')]||null:null,'attributes':_0x288e43['options']?_0x288e43[_0x461a('0x1a')][_0x461a('0x1d')]||null:null,'include':_0x288e43[_0x461a('0x1a')]?_0x288e43['options'][_0x461a('0x1e')]?_[_0x461a('0x1f')](_0x288e43['options'][_0x461a('0x1e')],function(_0x6de0c3){return{'model':db[_0x6de0c3[_0x461a('0x20')]],'as':_0x6de0c3['as'],'attributes':_0x6de0c3[_0x461a('0x1d')],'include':_0x6de0c3[_0x461a('0x1e')]?_[_0x461a('0x1f')](_0x6de0c3[_0x461a('0x1e')],function(_0x233060){return{'model':db[_0x233060[_0x461a('0x20')]],'as':_0x233060['as'],'attributes':_0x233060['attributes'],'include':_0x233060[_0x461a('0x1e')]?_[_0x461a('0x1f')](_0x233060[_0x461a('0x1e')],function(_0x5dc668){return{'model':db[_0x5dc668[_0x461a('0x20')]],'as':_0x5dc668['as'],'attributes':_0x5dc668[_0x461a('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x183f31){logger[_0x461a('0xe')](_0x461a('0x22'),_0x288e43);logger[_0x461a('0x11')]('ShowSugarcrmAccount',_0x288e43,JSON[_0x461a('0x21')](_0x183f31));_0x479896(_0x183f31);})[_0x461a('0x16')](function(_0x34428f){logger[_0x461a('0x12')]('ShowSugarcrmAccount',_0x34428f[_0x461a('0x14')],_0x288e43);_0x414726(_0x4f73b3[_0x461a('0x12')](0x1f4,_0x34428f[_0x461a('0x14')]));});});}; \ No newline at end of file +var _0x59c4=['stringify','code','error','message','result','catch','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetSugarcrmAccount','find','ShowSugarcrmAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s'];(function(_0x387f41,_0x3781fd){var _0x394b65=function(_0x3b1010){while(--_0x3b1010){_0x387f41['push'](_0x387f41['shift']());}};_0x394b65(++_0x3781fd);}(_0x59c4,0x1b7));var _0x459c=function(_0x2c6c75,_0x42382a){_0x2c6c75=_0x2c6c75-0x0;var _0x29b79c=_0x59c4[_0x2c6c75];return _0x29b79c;};'use strict';var _=require(_0x459c('0x0'));var util=require(_0x459c('0x1'));var moment=require(_0x459c('0x2'));var BPromise=require(_0x459c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x459c('0x4'));var db=require(_0x459c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x459c('0x6'));var config=require(_0x459c('0x7'));var jayson=require(_0x459c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2fba58,_0x28c424,_0x418ad9){return new BPromise(function(_0x1c9dee,_0x4e62ce){return client[_0x459c('0x9')](_0x2fba58,_0x418ad9)[_0x459c('0xa')](function(_0x4b849e){logger[_0x459c('0xb')](_0x459c('0xc'),_0x28c424,_0x459c('0xd'));logger[_0x459c('0xe')](_0x459c('0xf'),_0x28c424,_0x459c('0xd'),JSON[_0x459c('0x10')](_0x4b849e));if(_0x4b849e['error']){if(_0x4b849e['error'][_0x459c('0x11')]===0x1f4){logger[_0x459c('0x12')](_0x459c('0xc'),_0x28c424,_0x4b849e[_0x459c('0x12')][_0x459c('0x13')]);return _0x4e62ce(_0x4b849e[_0x459c('0x12')][_0x459c('0x13')]);}logger[_0x459c('0x12')](_0x459c('0xc'),_0x28c424,_0x4b849e[_0x459c('0x12')][_0x459c('0x13')]);return _0x1c9dee(_0x4b849e['error']['message']);}else{logger[_0x459c('0xb')](_0x459c('0xc'),_0x28c424,_0x459c('0xd'));_0x1c9dee(_0x4b849e[_0x459c('0x14')][_0x459c('0x13')]);}})[_0x459c('0x15')](function(_0x3c3ab4){logger[_0x459c('0x12')](_0x459c('0xc'),_0x28c424,_0x3c3ab4);_0x4e62ce(_0x3c3ab4);});});}exports['GetSugarcrmAccount']=function(_0xa069cf){var _0x85025d=this;return new Promise(function(_0x2df372,_0x2f3663){return db[_0x459c('0x16')][_0x459c('0x17')]({'raw':_0xa069cf[_0x459c('0x18')]?_0xa069cf[_0x459c('0x18')][_0x459c('0x19')]===undefined?!![]:![]:!![],'where':_0xa069cf[_0x459c('0x18')]?_0xa069cf[_0x459c('0x18')][_0x459c('0x1a')]||null:null,'attributes':_0xa069cf[_0x459c('0x18')]?_0xa069cf[_0x459c('0x18')][_0x459c('0x1b')]||null:null,'limit':_0xa069cf[_0x459c('0x18')]?_0xa069cf[_0x459c('0x18')][_0x459c('0x1c')]||null:null,'include':_0xa069cf['options']?_0xa069cf[_0x459c('0x18')][_0x459c('0x1d')]?_[_0x459c('0x1e')](_0xa069cf[_0x459c('0x18')][_0x459c('0x1d')],function(_0x569139){return{'model':db[_0x569139[_0x459c('0x1f')]],'as':_0x569139['as'],'attributes':_0x569139[_0x459c('0x1b')],'include':_0x569139['include']?_[_0x459c('0x1e')](_0x569139[_0x459c('0x1d')],function(_0x5bf54c){return{'model':db[_0x5bf54c[_0x459c('0x1f')]],'as':_0x5bf54c['as'],'attributes':_0x5bf54c[_0x459c('0x1b')],'include':_0x5bf54c[_0x459c('0x1d')]?_[_0x459c('0x1e')](_0x5bf54c[_0x459c('0x1d')],function(_0x467e4f){return{'model':db[_0x467e4f['model']],'as':_0x467e4f['as'],'attributes':_0x467e4f[_0x459c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x459c('0xa')](function(_0x4e17a4){logger[_0x459c('0xb')]('GetSugarcrmAccount',_0xa069cf);logger[_0x459c('0xe')](_0x459c('0x20'),_0xa069cf,JSON[_0x459c('0x10')](_0x4e17a4));_0x2df372(_0x4e17a4);})[_0x459c('0x15')](function(_0x503499){logger[_0x459c('0x12')](_0x459c('0x20'),_0x503499[_0x459c('0x13')],_0xa069cf);_0x2f3663(_0x85025d['error'](0x1f4,_0x503499['message']));});});};exports['ShowSugarcrmAccount']=function(_0x2e37a0){var _0x22da00=this;return new Promise(function(_0x5393e2,_0x34e8b3){return db[_0x459c('0x16')][_0x459c('0x21')]({'raw':_0x2e37a0['options']?_0x2e37a0[_0x459c('0x18')][_0x459c('0x19')]===undefined?!![]:![]:!![],'where':_0x2e37a0[_0x459c('0x18')]?_0x2e37a0[_0x459c('0x18')][_0x459c('0x1a')]||null:null,'attributes':_0x2e37a0[_0x459c('0x18')]?_0x2e37a0['options'][_0x459c('0x1b')]||null:null,'include':_0x2e37a0[_0x459c('0x18')]?_0x2e37a0['options']['include']?_[_0x459c('0x1e')](_0x2e37a0[_0x459c('0x18')][_0x459c('0x1d')],function(_0xa605ba){return{'model':db[_0xa605ba[_0x459c('0x1f')]],'as':_0xa605ba['as'],'attributes':_0xa605ba[_0x459c('0x1b')],'include':_0xa605ba[_0x459c('0x1d')]?_['map'](_0xa605ba[_0x459c('0x1d')],function(_0x2ee9c5){return{'model':db[_0x2ee9c5['model']],'as':_0x2ee9c5['as'],'attributes':_0x2ee9c5['attributes'],'include':_0x2ee9c5[_0x459c('0x1d')]?_[_0x459c('0x1e')](_0x2ee9c5['include'],function(_0x469a93){return{'model':db[_0x469a93[_0x459c('0x1f')]],'as':_0x469a93['as'],'attributes':_0x469a93[_0x459c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x459c('0xa')](function(_0x3ce02b){logger[_0x459c('0xb')](_0x459c('0x22'),_0x2e37a0);logger[_0x459c('0xe')]('ShowSugarcrmAccount',_0x2e37a0,JSON[_0x459c('0x10')](_0x3ce02b));_0x5393e2(_0x3ce02b);})[_0x459c('0x15')](function(_0x424e34){logger[_0x459c('0x12')](_0x459c('0x22'),_0x424e34[_0x459c('0x13')],_0x2e37a0);_0x34e8b3(_0x22da00['error'](0x1f4,_0x424e34['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 383e2ef..b361d84 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 _0xb873=['create','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x33a65f,_0xa972fa){var _0x251674=function(_0x4ba5d6){while(--_0x4ba5d6){_0x33a65f['push'](_0x33a65f['shift']());}};_0x251674(++_0xa972fa);}(_0xb873,0x13c));var _0x3b87=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0xb873[_0xa6cc5c];return _0x44803d;};'use strict';var multer=require('multer');var util=require(_0x3b87('0x0'));var path=require(_0x3b87('0x1'));var timeout=require(_0x3b87('0x2'));var express=require(_0x3b87('0x3'));var router=express[_0x3b87('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3b87('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3b87('0x6'));var controller=require(_0x3b87('0x7'));router[_0x3b87('0x8')]('/',auth[_0x3b87('0x9')](),controller[_0x3b87('0xa')]);router[_0x3b87('0x8')](_0x3b87('0xb'),auth[_0x3b87('0x9')](),controller[_0x3b87('0xc')]);router[_0x3b87('0x8')](_0x3b87('0xd'),auth[_0x3b87('0x9')](),controller[_0x3b87('0xe')]);router[_0x3b87('0x8')](_0x3b87('0xf'),auth[_0x3b87('0x9')](),controller[_0x3b87('0x10')]);router[_0x3b87('0x8')](_0x3b87('0x11'),auth['isAuthenticated'](),controller[_0x3b87('0x12')]);router[_0x3b87('0x13')]('/',auth[_0x3b87('0x9')](),controller[_0x3b87('0x14')]);router['put'](_0x3b87('0xb'),auth[_0x3b87('0x9')](),controller['update']);router[_0x3b87('0x15')](_0x3b87('0xb'),auth[_0x3b87('0x9')](),controller[_0x3b87('0x16')]);module[_0x3b87('0x17')]=router; \ No newline at end of file +var _0x4af1=['post','update','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4af1,0xc1));var _0x14af=function(_0x403e70,_0x4b4905){_0x403e70=_0x403e70-0x0;var _0x404baa=_0x4af1[_0x403e70];return _0x404baa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x14af('0x0'));var timeout=require(_0x14af('0x1'));var express=require(_0x14af('0x2'));var router=express[_0x14af('0x3')]();var fs_extra=require(_0x14af('0x4'));var auth=require(_0x14af('0x5'));var interaction=require(_0x14af('0x6'));var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router[_0x14af('0x7')]('/',auth['isAuthenticated'](),controller[_0x14af('0x8')]);router[_0x14af('0x7')](_0x14af('0x9'),auth[_0x14af('0xa')](),controller[_0x14af('0xb')]);router[_0x14af('0x7')]('/:id/fields',auth[_0x14af('0xa')](),controller[_0x14af('0xc')]);router[_0x14af('0x7')](_0x14af('0xd'),auth['isAuthenticated'](),controller[_0x14af('0xe')]);router['get'](_0x14af('0xf'),auth[_0x14af('0xa')](),controller[_0x14af('0x10')]);router[_0x14af('0x11')]('/',auth[_0x14af('0xa')](),controller['create']);router['put'](_0x14af('0x9'),auth[_0x14af('0xa')](),controller[_0x14af('0x12')]);router['delete']('/:id',auth[_0x14af('0xa')](),controller[_0x14af('0x13')]);module[_0x14af('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index ed4443c..d81dcce 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 _0xc1c9=['exports','STRING'];(function(_0x1482b0,_0x312f02){var _0x4ad15f=function(_0x2621f9){while(--_0x2621f9){_0x1482b0['push'](_0x1482b0['shift']());}};_0x4ad15f(++_0x312f02);}(_0xc1c9,0x66));var _0x9c1c=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0xc1c9[_0x39096d];return _0x13da4f;};'use strict';var Sequelize=require('sequelize');module[_0x9c1c('0x0')]={'name':{'type':Sequelize[_0x9c1c('0x1')]},'description':{'type':Sequelize[_0x9c1c('0x1')]}}; \ No newline at end of file +var _0xff4b=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xff4b,0xe4));var _0xbff4=function(_0x2607f3,_0x3b951e){_0x2607f3=_0x2607f3-0x0;var _0x51a575=_0xff4b[_0x2607f3];return _0x51a575;};'use strict';var Sequelize=require(_0xbff4('0x0'));module[_0xbff4('0x1')]={'name':{'type':Sequelize[_0xbff4('0x2')]},'description':{'type':Sequelize[_0xbff4('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index afb4cb8..2221781 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 _0xb8f0=['map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','SugarcrmConfiguration','findAll','rows','catch','show','length','find','create','body','params','destroy','findOne','SugarcrmField','getFields','hasOwnProperty','getSubjects','getDescriptions','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','error','stack','name','send','index'];(function(_0x17202e,_0x4c408d){var _0x4dbb09=function(_0x5a7ca8){while(--_0x5a7ca8){_0x17202e['push'](_0x17202e['shift']());}};_0x4dbb09(++_0x4c408d);}(_0xb8f0,0x78));var _0x0b8f=function(_0x231e1f,_0x2ea0d9){_0x231e1f=_0x231e1f-0x0;var _0x5832f3=_0xb8f0[_0x231e1f];return _0x5832f3;};'use strict';var emlformat=require(_0x0b8f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0b8f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0b8f('0x2'));var moment=require(_0x0b8f('0x3'));var BPromise=require(_0x0b8f('0x4'));var Mustache=require(_0x0b8f('0x5'));var util=require(_0x0b8f('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0b8f('0x7'));var ejs=require(_0x0b8f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x0b8f('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0b8f('0xa'));var toCsv=require(_0x0b8f('0x7'));var querystring=require(_0x0b8f('0xb'));var Papa=require('papaparse');var Redis=require(_0x0b8f('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x0b8f('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0b8f('0xe'));var logger=require(_0x0b8f('0xf'))(_0x0b8f('0x10'));var utils=require(_0x0b8f('0x11'));var config=require(_0x0b8f('0x12'));var licenseUtil=require(_0x0b8f('0x13'));var db=require(_0x0b8f('0x14'))['db'];function respondWithStatusCode(_0x4d63d9,_0x5c8e5b){_0x5c8e5b=_0x5c8e5b||0xcc;return function(_0x344e02){if(_0x344e02){return _0x4d63d9[_0x0b8f('0x15')](_0x5c8e5b);}return _0x4d63d9[_0x0b8f('0x16')](_0x5c8e5b)[_0x0b8f('0x17')]();};}function respondWithResult(_0x378d3d,_0x206103){_0x206103=_0x206103||0xc8;return function(_0x4cfdb2){if(_0x4cfdb2){return _0x378d3d[_0x0b8f('0x16')](_0x206103)[_0x0b8f('0x18')](_0x4cfdb2);}};}function respondWithFilteredResult(_0x6be765,_0x4ea060){return function(_0x57cc49){if(_0x57cc49){var _0x4ebceb=typeof _0x4ea060[_0x0b8f('0x19')]==='undefined'&&typeof _0x4ea060[_0x0b8f('0x1a')]===_0x0b8f('0x1b');var _0x5c0fd6=_0x57cc49[_0x0b8f('0x1c')];var _0x66268c=_0x4ebceb?0x0:_0x4ea060[_0x0b8f('0x19')];var _0x73ee1b=_0x4ebceb?_0x57cc49[_0x0b8f('0x1c')]:_0x4ea060[_0x0b8f('0x19')]+_0x4ea060[_0x0b8f('0x1a')];var _0x1a6080;if(_0x73ee1b>=_0x5c0fd6){_0x73ee1b=_0x5c0fd6;_0x1a6080=0xc8;}else{_0x1a6080=0xce;}_0x6be765['status'](_0x1a6080);return _0x6be765['set'](_0x0b8f('0x1d'),_0x66268c+'-'+_0x73ee1b+'/'+_0x5c0fd6)[_0x0b8f('0x18')](_0x57cc49);}return null;};}function patchUpdates(_0x3d76ad){return function(_0x2763db){try{jsonpatch[_0x0b8f('0x1e')](_0x2763db,_0x3d76ad,!![]);}catch(_0x2527ec){return BPromise[_0x0b8f('0x1f')](_0x2527ec);}return _0x2763db[_0x0b8f('0x20')]();};}function saveUpdates(_0x30cd3c,_0x34acdf){return function(_0x184486){if(_0x184486){return _0x184486[_0x0b8f('0x21')](_0x30cd3c)['then'](function(_0x2f4996){return _0x2f4996;});}return null;};}function removeEntity(_0x4a4535,_0xd1c04){return function(_0x37304b){if(_0x37304b){return _0x37304b['destroy']()[_0x0b8f('0x22')](function(){_0x4a4535[_0x0b8f('0x16')](0xcc)[_0x0b8f('0x17')]();});}};}function handleEntityNotFound(_0x7632fb,_0x2e7b0b){return function(_0x2b3993){if(!_0x2b3993){_0x7632fb[_0x0b8f('0x15')](0x194);}return _0x2b3993;};}function handleError(_0xdfb6b0,_0x146d00){_0x146d00=_0x146d00||0x1f4;return function(_0x19ec1f){logger[_0x0b8f('0x23')](_0x19ec1f[_0x0b8f('0x24')]);if(_0x19ec1f[_0x0b8f('0x25')]){delete _0x19ec1f['name'];}_0xdfb6b0['status'](_0x146d00)[_0x0b8f('0x26')](_0x19ec1f);};}exports[_0x0b8f('0x27')]=function(_0x57cce0,_0x2067cd){var _0x26a8ff={},_0x4b4369={},_0x599b77={'count':0x0,'rows':[]};var _0x562fb6=_[_0x0b8f('0x28')](db['SugarcrmConfiguration'][_0x0b8f('0x29')],function(_0x1f181e){return{'name':_0x1f181e[_0x0b8f('0x2a')],'type':_0x1f181e[_0x0b8f('0x2b')][_0x0b8f('0x2c')]};});_0x4b4369[_0x0b8f('0x2d')]=_['map'](_0x562fb6,_0x0b8f('0x25'));_0x4b4369[_0x0b8f('0x2e')]=_[_0x0b8f('0x2f')](_0x57cce0[_0x0b8f('0x2e')]);_0x4b4369[_0x0b8f('0x30')]=_[_0x0b8f('0x31')](_0x4b4369['model'],_0x4b4369[_0x0b8f('0x2e')]);_0x26a8ff['attributes']=_[_0x0b8f('0x31')](_0x4b4369[_0x0b8f('0x2d')],qs[_0x0b8f('0x32')](_0x57cce0[_0x0b8f('0x2e')]['fields']));_0x26a8ff[_0x0b8f('0x33')]=_0x26a8ff['attributes']['length']?_0x26a8ff[_0x0b8f('0x33')]:_0x4b4369[_0x0b8f('0x2d')];if(!_0x57cce0['query']['hasOwnProperty'](_0x0b8f('0x34'))){_0x26a8ff[_0x0b8f('0x1a')]=qs['limit'](_0x57cce0[_0x0b8f('0x2e')][_0x0b8f('0x1a')]);_0x26a8ff[_0x0b8f('0x19')]=qs[_0x0b8f('0x19')](_0x57cce0[_0x0b8f('0x2e')][_0x0b8f('0x19')]);}_0x26a8ff[_0x0b8f('0x35')]=qs[_0x0b8f('0x36')](_0x57cce0[_0x0b8f('0x2e')][_0x0b8f('0x36')]);_0x26a8ff[_0x0b8f('0x37')]=qs[_0x0b8f('0x30')](_[_0x0b8f('0x38')](_0x57cce0[_0x0b8f('0x2e')],_0x4b4369[_0x0b8f('0x30')]),_0x562fb6);if(_0x57cce0[_0x0b8f('0x2e')]['filter']){_0x26a8ff[_0x0b8f('0x37')]=_['merge'](_0x26a8ff[_0x0b8f('0x37')],{'$or':_['map'](_0x562fb6,function(_0x5f09f7){if(_0x5f09f7[_0x0b8f('0x2b')]!==_0x0b8f('0x39')){var _0x4da550={};_0x4da550[_0x5f09f7['name']]={'$like':'%'+_0x57cce0['query'][_0x0b8f('0x3a')]+'%'};return _0x4da550;}})});}_0x26a8ff=_[_0x0b8f('0x3b')]({},_0x26a8ff,_0x57cce0[_0x0b8f('0x3c')]);var _0x1e7f5e={'where':_0x26a8ff[_0x0b8f('0x37')]};return db['SugarcrmConfiguration'][_0x0b8f('0x1c')](_0x1e7f5e)['then'](function(_0xc1ebec){_0x599b77[_0x0b8f('0x1c')]=_0xc1ebec;if(_0x57cce0[_0x0b8f('0x2e')][_0x0b8f('0x3d')]){_0x26a8ff[_0x0b8f('0x3e')]=[{'all':!![]}];}return db[_0x0b8f('0x3f')][_0x0b8f('0x40')](_0x26a8ff);})['then'](function(_0x206afa){_0x599b77[_0x0b8f('0x41')]=_0x206afa;return _0x599b77;})['then'](respondWithFilteredResult(_0x2067cd,_0x26a8ff))[_0x0b8f('0x42')](handleError(_0x2067cd,null));};exports[_0x0b8f('0x43')]=function(_0x516647,_0x40ca03){var _0x39cb75={'raw':![],'where':{'id':_0x516647['params']['id']}},_0x3936a9={};_0x3936a9[_0x0b8f('0x2d')]=_['keys'](db[_0x0b8f('0x3f')]['rawAttributes']);_0x3936a9[_0x0b8f('0x2e')]=_['keys'](_0x516647[_0x0b8f('0x2e')]);_0x3936a9[_0x0b8f('0x30')]=_[_0x0b8f('0x31')](_0x3936a9['model'],_0x3936a9[_0x0b8f('0x2e')]);_0x39cb75[_0x0b8f('0x33')]=_[_0x0b8f('0x31')](_0x3936a9[_0x0b8f('0x2d')],qs[_0x0b8f('0x32')](_0x516647[_0x0b8f('0x2e')][_0x0b8f('0x32')]));_0x39cb75['attributes']=_0x39cb75[_0x0b8f('0x33')][_0x0b8f('0x44')]?_0x39cb75[_0x0b8f('0x33')]:_0x3936a9[_0x0b8f('0x2d')];if(_0x516647[_0x0b8f('0x2e')][_0x0b8f('0x3d')]){_0x39cb75[_0x0b8f('0x3e')]=[{'all':!![]}];}_0x39cb75=_[_0x0b8f('0x3b')]({},_0x39cb75,_0x516647[_0x0b8f('0x3c')]);return db[_0x0b8f('0x3f')][_0x0b8f('0x45')](_0x39cb75)[_0x0b8f('0x22')](handleEntityNotFound(_0x40ca03,null))[_0x0b8f('0x22')](respondWithResult(_0x40ca03,null))[_0x0b8f('0x42')](handleError(_0x40ca03,null));};exports[_0x0b8f('0x46')]=function(_0x391bc2,_0x3e8ae1){return db[_0x0b8f('0x3f')][_0x0b8f('0x46')](_0x391bc2[_0x0b8f('0x47')],{})[_0x0b8f('0x22')](respondWithResult(_0x3e8ae1,0xc9))[_0x0b8f('0x42')](handleError(_0x3e8ae1,null));};exports[_0x0b8f('0x21')]=function(_0x2c00c2,_0x3369e0){if(_0x2c00c2[_0x0b8f('0x47')]['id']){delete _0x2c00c2[_0x0b8f('0x47')]['id'];}return db[_0x0b8f('0x3f')][_0x0b8f('0x45')]({'where':{'id':_0x2c00c2[_0x0b8f('0x48')]['id']}})['then'](handleEntityNotFound(_0x3369e0,null))['then'](saveUpdates(_0x2c00c2[_0x0b8f('0x47')],null))['then'](respondWithResult(_0x3369e0,null))['catch'](handleError(_0x3369e0,null));};exports[_0x0b8f('0x49')]=function(_0x3dd65f,_0x5dd750){return db[_0x0b8f('0x3f')][_0x0b8f('0x45')]({'where':{'id':_0x3dd65f['params']['id']}})['then'](handleEntityNotFound(_0x5dd750,null))['then'](removeEntity(_0x5dd750,null))[_0x0b8f('0x42')](handleError(_0x5dd750,null));};exports['getFields']=function(_0x5399e3,_0x1c011b,_0x28ffa5){var _0x3ef011={};var _0x5b44d8={};var _0x52f997;var _0x2a2126;return db[_0x0b8f('0x3f')][_0x0b8f('0x4a')]({'where':{'id':_0x5399e3['params']['id']}})[_0x0b8f('0x22')](handleEntityNotFound(_0x1c011b,null))[_0x0b8f('0x22')](function(_0x49a0ef){if(_0x49a0ef){_0x52f997=_0x49a0ef;_0x5b44d8[_0x0b8f('0x2d')]=_[_0x0b8f('0x2f')](db[_0x0b8f('0x4b')][_0x0b8f('0x29')]);_0x5b44d8[_0x0b8f('0x2e')]=_['keys'](_0x5399e3['query']);_0x5b44d8[_0x0b8f('0x30')]=_['intersection'](_0x5b44d8['model'],_0x5b44d8[_0x0b8f('0x2e')]);_0x3ef011[_0x0b8f('0x33')]=_[_0x0b8f('0x31')](_0x5b44d8['model'],qs[_0x0b8f('0x32')](_0x5399e3['query'][_0x0b8f('0x32')]));_0x3ef011[_0x0b8f('0x33')]=_0x3ef011[_0x0b8f('0x33')][_0x0b8f('0x44')]?_0x3ef011[_0x0b8f('0x33')]:_0x5b44d8[_0x0b8f('0x2d')];_0x3ef011[_0x0b8f('0x35')]=qs[_0x0b8f('0x36')](_0x5399e3['query'][_0x0b8f('0x36')]);_0x3ef011[_0x0b8f('0x37')]=qs[_0x0b8f('0x30')](_[_0x0b8f('0x38')](_0x5399e3[_0x0b8f('0x2e')],_0x5b44d8[_0x0b8f('0x30')]));if(_0x5399e3[_0x0b8f('0x2e')][_0x0b8f('0x3a')]){_0x3ef011['where']=_[_0x0b8f('0x3b')](_0x3ef011[_0x0b8f('0x37')],{'$or':_['map'](_0x3ef011[_0x0b8f('0x33')],function(_0x1921d1){var _0x89f40d={};_0x89f40d[_0x1921d1]={'$like':'%'+_0x5399e3['query'][_0x0b8f('0x3a')]+'%'};return _0x89f40d;})});}_0x3ef011=_[_0x0b8f('0x3b')]({},_0x3ef011,_0x5399e3[_0x0b8f('0x3c')]);return _0x52f997[_0x0b8f('0x4c')](_0x3ef011);}})[_0x0b8f('0x22')](function(_0x169146){if(_0x169146){_0x2a2126=_0x169146[_0x0b8f('0x44')];if(!_0x5399e3['query'][_0x0b8f('0x4d')](_0x0b8f('0x34'))){_0x3ef011[_0x0b8f('0x1a')]=qs['limit'](_0x5399e3[_0x0b8f('0x2e')][_0x0b8f('0x1a')]);_0x3ef011[_0x0b8f('0x19')]=qs[_0x0b8f('0x19')](_0x5399e3[_0x0b8f('0x2e')]['offset']);}return _0x52f997[_0x0b8f('0x4c')](_0x3ef011);}})[_0x0b8f('0x22')](function(_0x1eb43d){if(_0x1eb43d){return _0x1eb43d?{'count':_0x2a2126,'rows':_0x1eb43d}:null;}})['then'](respondWithResult(_0x1c011b,null))[_0x0b8f('0x42')](handleError(_0x1c011b,null));};exports[_0x0b8f('0x4e')]=function(_0x25c01c,_0x5969e8,_0x5342d5){var _0x4a16d2={};var _0x41c45d={};var _0x5d852a;var _0x34379e;return db[_0x0b8f('0x3f')]['findOne']({'where':{'id':_0x25c01c[_0x0b8f('0x48')]['id']}})[_0x0b8f('0x22')](handleEntityNotFound(_0x5969e8,null))[_0x0b8f('0x22')](function(_0xdef875){if(_0xdef875){_0x5d852a=_0xdef875;_0x41c45d['model']=_[_0x0b8f('0x2f')](db[_0x0b8f('0x4b')][_0x0b8f('0x29')]);_0x41c45d[_0x0b8f('0x2e')]=_[_0x0b8f('0x2f')](_0x25c01c['query']);_0x41c45d[_0x0b8f('0x30')]=_[_0x0b8f('0x31')](_0x41c45d['model'],_0x41c45d[_0x0b8f('0x2e')]);_0x4a16d2[_0x0b8f('0x33')]=_[_0x0b8f('0x31')](_0x41c45d[_0x0b8f('0x2d')],qs[_0x0b8f('0x32')](_0x25c01c[_0x0b8f('0x2e')]['fields']));_0x4a16d2[_0x0b8f('0x33')]=_0x4a16d2['attributes']['length']?_0x4a16d2[_0x0b8f('0x33')]:_0x41c45d[_0x0b8f('0x2d')];_0x4a16d2[_0x0b8f('0x35')]=qs[_0x0b8f('0x36')](_0x25c01c[_0x0b8f('0x2e')][_0x0b8f('0x36')]);_0x4a16d2[_0x0b8f('0x37')]=qs[_0x0b8f('0x30')](_[_0x0b8f('0x38')](_0x25c01c['query'],_0x41c45d[_0x0b8f('0x30')]));if(_0x25c01c[_0x0b8f('0x2e')][_0x0b8f('0x3a')]){_0x4a16d2[_0x0b8f('0x37')]=_[_0x0b8f('0x3b')](_0x4a16d2[_0x0b8f('0x37')],{'$or':_[_0x0b8f('0x28')](_0x4a16d2[_0x0b8f('0x33')],function(_0x36ef97){var _0x2a9c52={};_0x2a9c52[_0x36ef97]={'$like':'%'+_0x25c01c[_0x0b8f('0x2e')][_0x0b8f('0x3a')]+'%'};return _0x2a9c52;})});}_0x4a16d2=_[_0x0b8f('0x3b')]({},_0x4a16d2,_0x25c01c['options']);return _0x5d852a[_0x0b8f('0x4e')](_0x4a16d2);}})['then'](function(_0x4e95e){if(_0x4e95e){_0x34379e=_0x4e95e[_0x0b8f('0x44')];if(!_0x25c01c['query']['hasOwnProperty'](_0x0b8f('0x34'))){_0x4a16d2[_0x0b8f('0x1a')]=qs[_0x0b8f('0x1a')](_0x25c01c[_0x0b8f('0x2e')]['limit']);_0x4a16d2[_0x0b8f('0x19')]=qs['offset'](_0x25c01c[_0x0b8f('0x2e')][_0x0b8f('0x19')]);}return _0x5d852a['getSubjects'](_0x4a16d2);}})[_0x0b8f('0x22')](function(_0x56a572){if(_0x56a572){return _0x56a572?{'count':_0x34379e,'rows':_0x56a572}:null;}})['then'](respondWithResult(_0x5969e8,null))['catch'](handleError(_0x5969e8,null));};exports[_0x0b8f('0x4f')]=function(_0x49ef29,_0x96c2a,_0x594080){var _0x32917a={};var _0x4a7135={};var _0x3e703c;var _0x3bcc64;return db['SugarcrmConfiguration'][_0x0b8f('0x4a')]({'where':{'id':_0x49ef29[_0x0b8f('0x48')]['id']}})[_0x0b8f('0x22')](handleEntityNotFound(_0x96c2a,null))[_0x0b8f('0x22')](function(_0x18bc04){if(_0x18bc04){_0x3e703c=_0x18bc04;_0x4a7135[_0x0b8f('0x2d')]=_[_0x0b8f('0x2f')](db['SugarcrmField'][_0x0b8f('0x29')]);_0x4a7135[_0x0b8f('0x2e')]=_['keys'](_0x49ef29['query']);_0x4a7135[_0x0b8f('0x30')]=_[_0x0b8f('0x31')](_0x4a7135['model'],_0x4a7135['query']);_0x32917a['attributes']=_[_0x0b8f('0x31')](_0x4a7135[_0x0b8f('0x2d')],qs[_0x0b8f('0x32')](_0x49ef29[_0x0b8f('0x2e')][_0x0b8f('0x32')]));_0x32917a['attributes']=_0x32917a['attributes'][_0x0b8f('0x44')]?_0x32917a[_0x0b8f('0x33')]:_0x4a7135[_0x0b8f('0x2d')];_0x32917a['order']=qs[_0x0b8f('0x36')](_0x49ef29[_0x0b8f('0x2e')][_0x0b8f('0x36')]);_0x32917a[_0x0b8f('0x37')]=qs[_0x0b8f('0x30')](_[_0x0b8f('0x38')](_0x49ef29['query'],_0x4a7135[_0x0b8f('0x30')]));if(_0x49ef29[_0x0b8f('0x2e')]['filter']){_0x32917a['where']=_[_0x0b8f('0x3b')](_0x32917a[_0x0b8f('0x37')],{'$or':_[_0x0b8f('0x28')](_0x32917a[_0x0b8f('0x33')],function(_0x59d1d5){var _0x2987ea={};_0x2987ea[_0x59d1d5]={'$like':'%'+_0x49ef29[_0x0b8f('0x2e')][_0x0b8f('0x3a')]+'%'};return _0x2987ea;})});}_0x32917a=_[_0x0b8f('0x3b')]({},_0x32917a,_0x49ef29[_0x0b8f('0x3c')]);return _0x3e703c[_0x0b8f('0x4f')](_0x32917a);}})['then'](function(_0xd7942b){if(_0xd7942b){_0x3bcc64=_0xd7942b['length'];if(!_0x49ef29[_0x0b8f('0x2e')][_0x0b8f('0x4d')](_0x0b8f('0x34'))){_0x32917a[_0x0b8f('0x1a')]=qs[_0x0b8f('0x1a')](_0x49ef29[_0x0b8f('0x2e')][_0x0b8f('0x1a')]);_0x32917a[_0x0b8f('0x19')]=qs[_0x0b8f('0x19')](_0x49ef29['query'][_0x0b8f('0x19')]);}return _0x3e703c['getDescriptions'](_0x32917a);}})['then'](function(_0xee0824){if(_0xee0824){return _0xee0824?{'count':_0x3bcc64,'rows':_0xee0824}:null;}})[_0x0b8f('0x22')](respondWithResult(_0x96c2a,null))[_0x0b8f('0x42')](handleError(_0x96c2a,null));}; \ No newline at end of file +var _0x61e1=['includeAll','include','findAll','rows','show','params','keys','length','find','catch','body','getFields','SugarcrmField','pick','findOne','getSubjects','hasOwnProperty','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','count','limit','Content-Range','update','then','destroy','error','stack','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','nolimit','order','sort','where','merge','filter','options'];(function(_0x248238,_0xe31996){var _0xb93bc4=function(_0xa7489e){while(--_0xa7489e){_0x248238['push'](_0x248238['shift']());}};_0xb93bc4(++_0xe31996);}(_0x61e1,0xae));var _0x161e=function(_0xc9b897,_0x5e2171){_0xc9b897=_0xc9b897-0x0;var _0x44643e=_0x61e1[_0xc9b897];return _0x44643e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x161e('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x161e('0x1'));var rp=require(_0x161e('0x2'));var moment=require(_0x161e('0x3'));var BPromise=require(_0x161e('0x4'));var Mustache=require(_0x161e('0x5'));var util=require(_0x161e('0x6'));var path=require('path');var sox=require(_0x161e('0x7'));var csv=require(_0x161e('0x8'));var ejs=require(_0x161e('0x9'));var fs=require('fs');var fs_extra=require(_0x161e('0xa'));var _=require(_0x161e('0xb'));var squel=require('squel');var crypto=require(_0x161e('0xc'));var jsforce=require(_0x161e('0xd'));var deskjs=require(_0x161e('0xe'));var toCsv=require(_0x161e('0x8'));var querystring=require(_0x161e('0xf'));var Papa=require(_0x161e('0x10'));var Redis=require(_0x161e('0x11'));var authService=require(_0x161e('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x161e('0x13'));var logger=require(_0x161e('0x14'))(_0x161e('0x15'));var utils=require(_0x161e('0x16'));var config=require(_0x161e('0x17'));var licenseUtil=require(_0x161e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf284fd,_0x6bd534){_0x6bd534=_0x6bd534||0xcc;return function(_0x20f718){if(_0x20f718){return _0xf284fd[_0x161e('0x19')](_0x6bd534);}return _0xf284fd[_0x161e('0x1a')](_0x6bd534)[_0x161e('0x1b')]();};}function respondWithResult(_0x3071bf,_0x3039e2){_0x3039e2=_0x3039e2||0xc8;return function(_0x496fe7){if(_0x496fe7){return _0x3071bf[_0x161e('0x1a')](_0x3039e2)['json'](_0x496fe7);}};}function respondWithFilteredResult(_0x325d80,_0x133a60){return function(_0x116a6f){if(_0x116a6f){var _0x334344=typeof _0x133a60[_0x161e('0x1c')]===_0x161e('0x1d')&&typeof _0x133a60['limit']===_0x161e('0x1d');var _0x429594=_0x116a6f[_0x161e('0x1e')];var _0x1d5f31=_0x334344?0x0:_0x133a60[_0x161e('0x1c')];var _0xc55fd1=_0x334344?_0x116a6f[_0x161e('0x1e')]:_0x133a60[_0x161e('0x1c')]+_0x133a60[_0x161e('0x1f')];var _0x4bdb78;if(_0xc55fd1>=_0x429594){_0xc55fd1=_0x429594;_0x4bdb78=0xc8;}else{_0x4bdb78=0xce;}_0x325d80[_0x161e('0x1a')](_0x4bdb78);return _0x325d80['set'](_0x161e('0x20'),_0x1d5f31+'-'+_0xc55fd1+'/'+_0x429594)['json'](_0x116a6f);}return null;};}function patchUpdates(_0x57a29b){return function(_0x35072b){try{jsonpatch['apply'](_0x35072b,_0x57a29b,!![]);}catch(_0x5273f1){return BPromise['reject'](_0x5273f1);}return _0x35072b['save']();};}function saveUpdates(_0x51cca0,_0x33a4be){return function(_0x2a69c4){if(_0x2a69c4){return _0x2a69c4[_0x161e('0x21')](_0x51cca0)[_0x161e('0x22')](function(_0x1ce4d5){return _0x1ce4d5;});}return null;};}function removeEntity(_0x41696d,_0x13b399){return function(_0x259635){if(_0x259635){return _0x259635[_0x161e('0x23')]()[_0x161e('0x22')](function(){_0x41696d[_0x161e('0x1a')](0xcc)[_0x161e('0x1b')]();});}};}function handleEntityNotFound(_0x135dd6,_0x2e8c25){return function(_0x73867f){if(!_0x73867f){_0x135dd6[_0x161e('0x19')](0x194);}return _0x73867f;};}function handleError(_0x2e631e,_0x29f55e){_0x29f55e=_0x29f55e||0x1f4;return function(_0x46a85e){logger[_0x161e('0x24')](_0x46a85e[_0x161e('0x25')]);if(_0x46a85e[_0x161e('0x26')]){delete _0x46a85e[_0x161e('0x26')];}_0x2e631e['status'](_0x29f55e)[_0x161e('0x27')](_0x46a85e);};}exports[_0x161e('0x28')]=function(_0x46e3b0,_0x38a96a){var _0x5d2124={},_0x17421e={},_0x36ae7f={'count':0x0,'rows':[]};var _0x5d070c=_['map'](db[_0x161e('0x29')][_0x161e('0x2a')],function(_0x23e95e){return{'name':_0x23e95e[_0x161e('0x2b')],'type':_0x23e95e[_0x161e('0x2c')][_0x161e('0x2d')]};});_0x17421e[_0x161e('0x2e')]=_[_0x161e('0x2f')](_0x5d070c,_0x161e('0x26'));_0x17421e[_0x161e('0x30')]=_['keys'](_0x46e3b0[_0x161e('0x30')]);_0x17421e[_0x161e('0x31')]=_[_0x161e('0x32')](_0x17421e[_0x161e('0x2e')],_0x17421e[_0x161e('0x30')]);_0x5d2124[_0x161e('0x33')]=_[_0x161e('0x32')](_0x17421e[_0x161e('0x2e')],qs['fields'](_0x46e3b0['query'][_0x161e('0x34')]));_0x5d2124[_0x161e('0x33')]=_0x5d2124[_0x161e('0x33')]['length']?_0x5d2124[_0x161e('0x33')]:_0x17421e[_0x161e('0x2e')];if(!_0x46e3b0[_0x161e('0x30')]['hasOwnProperty'](_0x161e('0x35'))){_0x5d2124[_0x161e('0x1f')]=qs[_0x161e('0x1f')](_0x46e3b0[_0x161e('0x30')][_0x161e('0x1f')]);_0x5d2124[_0x161e('0x1c')]=qs[_0x161e('0x1c')](_0x46e3b0[_0x161e('0x30')][_0x161e('0x1c')]);}_0x5d2124[_0x161e('0x36')]=qs[_0x161e('0x37')](_0x46e3b0[_0x161e('0x30')][_0x161e('0x37')]);_0x5d2124[_0x161e('0x38')]=qs[_0x161e('0x31')](_['pick'](_0x46e3b0['query'],_0x17421e[_0x161e('0x31')]),_0x5d070c);if(_0x46e3b0[_0x161e('0x30')]['filter']){_0x5d2124[_0x161e('0x38')]=_[_0x161e('0x39')](_0x5d2124[_0x161e('0x38')],{'$or':_[_0x161e('0x2f')](_0x5d070c,function(_0x45aa46){if(_0x45aa46[_0x161e('0x2c')]!=='VIRTUAL'){var _0x3ebf9d={};_0x3ebf9d[_0x45aa46[_0x161e('0x26')]]={'$like':'%'+_0x46e3b0[_0x161e('0x30')][_0x161e('0x3a')]+'%'};return _0x3ebf9d;}})});}_0x5d2124=_[_0x161e('0x39')]({},_0x5d2124,_0x46e3b0[_0x161e('0x3b')]);var _0x35cd82={'where':_0x5d2124[_0x161e('0x38')]};return db['SugarcrmConfiguration'][_0x161e('0x1e')](_0x35cd82)[_0x161e('0x22')](function(_0x3ccca9){_0x36ae7f[_0x161e('0x1e')]=_0x3ccca9;if(_0x46e3b0[_0x161e('0x30')][_0x161e('0x3c')]){_0x5d2124[_0x161e('0x3d')]=[{'all':!![]}];}return db[_0x161e('0x29')][_0x161e('0x3e')](_0x5d2124);})[_0x161e('0x22')](function(_0x302463){_0x36ae7f[_0x161e('0x3f')]=_0x302463;return _0x36ae7f;})['then'](respondWithFilteredResult(_0x38a96a,_0x5d2124))['catch'](handleError(_0x38a96a,null));};exports[_0x161e('0x40')]=function(_0xc911d0,_0x5ea5f4){var _0x175c14={'raw':![],'where':{'id':_0xc911d0[_0x161e('0x41')]['id']}},_0xd39ed2={};_0xd39ed2['model']=_[_0x161e('0x42')](db[_0x161e('0x29')][_0x161e('0x2a')]);_0xd39ed2[_0x161e('0x30')]=_[_0x161e('0x42')](_0xc911d0[_0x161e('0x30')]);_0xd39ed2[_0x161e('0x31')]=_[_0x161e('0x32')](_0xd39ed2['model'],_0xd39ed2[_0x161e('0x30')]);_0x175c14[_0x161e('0x33')]=_[_0x161e('0x32')](_0xd39ed2['model'],qs['fields'](_0xc911d0[_0x161e('0x30')][_0x161e('0x34')]));_0x175c14[_0x161e('0x33')]=_0x175c14[_0x161e('0x33')][_0x161e('0x43')]?_0x175c14['attributes']:_0xd39ed2[_0x161e('0x2e')];if(_0xc911d0['query'][_0x161e('0x3c')]){_0x175c14[_0x161e('0x3d')]=[{'all':!![]}];}_0x175c14=_[_0x161e('0x39')]({},_0x175c14,_0xc911d0[_0x161e('0x3b')]);return db[_0x161e('0x29')][_0x161e('0x44')](_0x175c14)[_0x161e('0x22')](handleEntityNotFound(_0x5ea5f4,null))['then'](respondWithResult(_0x5ea5f4,null))[_0x161e('0x45')](handleError(_0x5ea5f4,null));};exports['create']=function(_0x3161d8,_0x557715){return db[_0x161e('0x29')]['create'](_0x3161d8['body'],{})[_0x161e('0x22')](respondWithResult(_0x557715,0xc9))[_0x161e('0x45')](handleError(_0x557715,null));};exports[_0x161e('0x21')]=function(_0x8940c8,_0x198e28){if(_0x8940c8[_0x161e('0x46')]['id']){delete _0x8940c8[_0x161e('0x46')]['id'];}return db['SugarcrmConfiguration'][_0x161e('0x44')]({'where':{'id':_0x8940c8[_0x161e('0x41')]['id']}})[_0x161e('0x22')](handleEntityNotFound(_0x198e28,null))[_0x161e('0x22')](saveUpdates(_0x8940c8[_0x161e('0x46')],null))['then'](respondWithResult(_0x198e28,null))[_0x161e('0x45')](handleError(_0x198e28,null));};exports[_0x161e('0x23')]=function(_0x440c70,_0x1714ad){return db['SugarcrmConfiguration'][_0x161e('0x44')]({'where':{'id':_0x440c70[_0x161e('0x41')]['id']}})[_0x161e('0x22')](handleEntityNotFound(_0x1714ad,null))['then'](removeEntity(_0x1714ad,null))[_0x161e('0x45')](handleError(_0x1714ad,null));};exports[_0x161e('0x47')]=function(_0x518577,_0x250b6f,_0x468c8c){var _0xc9f040={};var _0x26dcaf={};var _0x21cf73;var _0x4f80f0;return db[_0x161e('0x29')]['findOne']({'where':{'id':_0x518577['params']['id']}})['then'](handleEntityNotFound(_0x250b6f,null))[_0x161e('0x22')](function(_0x42ba73){if(_0x42ba73){_0x21cf73=_0x42ba73;_0x26dcaf['model']=_[_0x161e('0x42')](db[_0x161e('0x48')][_0x161e('0x2a')]);_0x26dcaf[_0x161e('0x30')]=_[_0x161e('0x42')](_0x518577[_0x161e('0x30')]);_0x26dcaf[_0x161e('0x31')]=_[_0x161e('0x32')](_0x26dcaf[_0x161e('0x2e')],_0x26dcaf['query']);_0xc9f040[_0x161e('0x33')]=_[_0x161e('0x32')](_0x26dcaf[_0x161e('0x2e')],qs[_0x161e('0x34')](_0x518577[_0x161e('0x30')][_0x161e('0x34')]));_0xc9f040[_0x161e('0x33')]=_0xc9f040[_0x161e('0x33')][_0x161e('0x43')]?_0xc9f040[_0x161e('0x33')]:_0x26dcaf['model'];_0xc9f040['order']=qs[_0x161e('0x37')](_0x518577[_0x161e('0x30')][_0x161e('0x37')]);_0xc9f040['where']=qs['filters'](_[_0x161e('0x49')](_0x518577['query'],_0x26dcaf[_0x161e('0x31')]));if(_0x518577[_0x161e('0x30')][_0x161e('0x3a')]){_0xc9f040[_0x161e('0x38')]=_[_0x161e('0x39')](_0xc9f040['where'],{'$or':_['map'](_0xc9f040['attributes'],function(_0x508074){var _0x1b9865={};_0x1b9865[_0x508074]={'$like':'%'+_0x518577['query'][_0x161e('0x3a')]+'%'};return _0x1b9865;})});}_0xc9f040=_['merge']({},_0xc9f040,_0x518577[_0x161e('0x3b')]);return _0x21cf73['getFields'](_0xc9f040);}})['then'](function(_0x12dd2e){if(_0x12dd2e){_0x4f80f0=_0x12dd2e[_0x161e('0x43')];if(!_0x518577[_0x161e('0x30')]['hasOwnProperty'](_0x161e('0x35'))){_0xc9f040[_0x161e('0x1f')]=qs['limit'](_0x518577['query'][_0x161e('0x1f')]);_0xc9f040[_0x161e('0x1c')]=qs['offset'](_0x518577[_0x161e('0x30')][_0x161e('0x1c')]);}return _0x21cf73['getFields'](_0xc9f040);}})[_0x161e('0x22')](function(_0x51ffed){if(_0x51ffed){return _0x51ffed?{'count':_0x4f80f0,'rows':_0x51ffed}:null;}})['then'](respondWithResult(_0x250b6f,null))[_0x161e('0x45')](handleError(_0x250b6f,null));};exports['getSubjects']=function(_0x17e798,_0x18dc08,_0x23d5d7){var _0x1b1162={};var _0x4a0b53={};var _0x5e6f8a;var _0x7a2e76;return db[_0x161e('0x29')][_0x161e('0x4a')]({'where':{'id':_0x17e798[_0x161e('0x41')]['id']}})[_0x161e('0x22')](handleEntityNotFound(_0x18dc08,null))[_0x161e('0x22')](function(_0x48d455){if(_0x48d455){_0x5e6f8a=_0x48d455;_0x4a0b53[_0x161e('0x2e')]=_[_0x161e('0x42')](db[_0x161e('0x48')][_0x161e('0x2a')]);_0x4a0b53['query']=_[_0x161e('0x42')](_0x17e798[_0x161e('0x30')]);_0x4a0b53[_0x161e('0x31')]=_[_0x161e('0x32')](_0x4a0b53[_0x161e('0x2e')],_0x4a0b53[_0x161e('0x30')]);_0x1b1162[_0x161e('0x33')]=_[_0x161e('0x32')](_0x4a0b53[_0x161e('0x2e')],qs[_0x161e('0x34')](_0x17e798[_0x161e('0x30')][_0x161e('0x34')]));_0x1b1162[_0x161e('0x33')]=_0x1b1162[_0x161e('0x33')][_0x161e('0x43')]?_0x1b1162[_0x161e('0x33')]:_0x4a0b53[_0x161e('0x2e')];_0x1b1162[_0x161e('0x36')]=qs[_0x161e('0x37')](_0x17e798['query']['sort']);_0x1b1162['where']=qs[_0x161e('0x31')](_[_0x161e('0x49')](_0x17e798[_0x161e('0x30')],_0x4a0b53['filters']));if(_0x17e798[_0x161e('0x30')]['filter']){_0x1b1162[_0x161e('0x38')]=_[_0x161e('0x39')](_0x1b1162['where'],{'$or':_[_0x161e('0x2f')](_0x1b1162['attributes'],function(_0x4868d6){var _0x3272ed={};_0x3272ed[_0x4868d6]={'$like':'%'+_0x17e798[_0x161e('0x30')]['filter']+'%'};return _0x3272ed;})});}_0x1b1162=_[_0x161e('0x39')]({},_0x1b1162,_0x17e798[_0x161e('0x3b')]);return _0x5e6f8a[_0x161e('0x4b')](_0x1b1162);}})['then'](function(_0x4d218c){if(_0x4d218c){_0x7a2e76=_0x4d218c[_0x161e('0x43')];if(!_0x17e798[_0x161e('0x30')][_0x161e('0x4c')](_0x161e('0x35'))){_0x1b1162[_0x161e('0x1f')]=qs[_0x161e('0x1f')](_0x17e798[_0x161e('0x30')][_0x161e('0x1f')]);_0x1b1162[_0x161e('0x1c')]=qs[_0x161e('0x1c')](_0x17e798[_0x161e('0x30')][_0x161e('0x1c')]);}return _0x5e6f8a[_0x161e('0x4b')](_0x1b1162);}})['then'](function(_0x54dfb1){if(_0x54dfb1){return _0x54dfb1?{'count':_0x7a2e76,'rows':_0x54dfb1}:null;}})[_0x161e('0x22')](respondWithResult(_0x18dc08,null))[_0x161e('0x45')](handleError(_0x18dc08,null));};exports[_0x161e('0x4d')]=function(_0x10c7de,_0x59bff2,_0x100a3b){var _0x461f43={};var _0x1f9823={};var _0x3c3615;var _0x298225;return db['SugarcrmConfiguration'][_0x161e('0x4a')]({'where':{'id':_0x10c7de[_0x161e('0x41')]['id']}})[_0x161e('0x22')](handleEntityNotFound(_0x59bff2,null))[_0x161e('0x22')](function(_0x2c811c){if(_0x2c811c){_0x3c3615=_0x2c811c;_0x1f9823[_0x161e('0x2e')]=_[_0x161e('0x42')](db[_0x161e('0x48')][_0x161e('0x2a')]);_0x1f9823[_0x161e('0x30')]=_[_0x161e('0x42')](_0x10c7de['query']);_0x1f9823[_0x161e('0x31')]=_[_0x161e('0x32')](_0x1f9823[_0x161e('0x2e')],_0x1f9823[_0x161e('0x30')]);_0x461f43[_0x161e('0x33')]=_[_0x161e('0x32')](_0x1f9823[_0x161e('0x2e')],qs[_0x161e('0x34')](_0x10c7de[_0x161e('0x30')]['fields']));_0x461f43[_0x161e('0x33')]=_0x461f43[_0x161e('0x33')][_0x161e('0x43')]?_0x461f43[_0x161e('0x33')]:_0x1f9823[_0x161e('0x2e')];_0x461f43[_0x161e('0x36')]=qs[_0x161e('0x37')](_0x10c7de[_0x161e('0x30')][_0x161e('0x37')]);_0x461f43[_0x161e('0x38')]=qs[_0x161e('0x31')](_[_0x161e('0x49')](_0x10c7de[_0x161e('0x30')],_0x1f9823[_0x161e('0x31')]));if(_0x10c7de['query'][_0x161e('0x3a')]){_0x461f43[_0x161e('0x38')]=_[_0x161e('0x39')](_0x461f43['where'],{'$or':_['map'](_0x461f43[_0x161e('0x33')],function(_0x2a7e26){var _0x390964={};_0x390964[_0x2a7e26]={'$like':'%'+_0x10c7de[_0x161e('0x30')]['filter']+'%'};return _0x390964;})});}_0x461f43=_['merge']({},_0x461f43,_0x10c7de[_0x161e('0x3b')]);return _0x3c3615[_0x161e('0x4d')](_0x461f43);}})['then'](function(_0x3f56c6){if(_0x3f56c6){_0x298225=_0x3f56c6['length'];if(!_0x10c7de[_0x161e('0x30')][_0x161e('0x4c')]('nolimit')){_0x461f43['limit']=qs[_0x161e('0x1f')](_0x10c7de[_0x161e('0x30')][_0x161e('0x1f')]);_0x461f43['offset']=qs['offset'](_0x10c7de[_0x161e('0x30')][_0x161e('0x1c')]);}return _0x3c3615[_0x161e('0x4d')](_0x461f43);}})[_0x161e('0x22')](function(_0x2dec8c){if(_0x2dec8c){return _0x2dec8c?{'count':_0x298225,'rows':_0x2dec8c}:null;}})[_0x161e('0x22')](respondWithResult(_0x59bff2,null))[_0x161e('0x45')](handleError(_0x59bff2,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 29ab779..9ce3928 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 _0x88de=['../../config/logger','api','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','util'];(function(_0x4bbdf6,_0x11a583){var _0x40b5b8=function(_0x3f6de4){while(--_0x3f6de4){_0x4bbdf6['push'](_0x4bbdf6['shift']());}};_0x40b5b8(++_0x11a583);}(_0x88de,0x6d));var _0xe88d=function(_0x221f38,_0x569fef){_0x221f38=_0x221f38-0x0;var _0x30c462=_0x88de[_0x221f38];return _0x30c462;};'use strict';var _=require('lodash');var util=require(_0xe88d('0x0'));var logger=require(_0xe88d('0x1'))(_0xe88d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe88d('0x3'));var rimraf=require(_0xe88d('0x4'));var config=require(_0xe88d('0x5'));var attributes=require(_0xe88d('0x6'));module[_0xe88d('0x7')]=function(_0x16d77a,_0x309f22){return _0x16d77a[_0xe88d('0x8')](_0xe88d('0x9'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb029=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xb029,0x18c));var _0x9b02=function(_0x39b21d,_0x1baef9){_0x39b21d=_0x39b21d-0x0;var _0x73b4dc=_0xb029[_0x39b21d];return _0x73b4dc;};'use strict';var _=require('lodash');var util=require(_0x9b02('0x0'));var logger=require(_0x9b02('0x1'))(_0x9b02('0x2'));var moment=require(_0x9b02('0x3'));var BPromise=require(_0x9b02('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9b02('0x5'));var rimraf=require(_0x9b02('0x6'));var config=require(_0x9b02('0x7'));var attributes=require(_0x9b02('0x8'));module[_0x9b02('0x9')]=function(_0x50cf24,_0x2e0d7a){return _0x50cf24['define'](_0x9b02('0xa'),attributes,{'tableName':_0x9b02('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 0ba72cf..95e6cea 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 _0xdbbe=['message','result','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','debug','request\x20sent','stringify','error','code','SugarcrmConfiguration,\x20%s,\x20%s'];(function(_0x5a33ff,_0x1304fe){var _0x1b0ded=function(_0x105037){while(--_0x105037){_0x5a33ff['push'](_0x5a33ff['shift']());}};_0x1b0ded(++_0x1304fe);}(_0xdbbe,0xc1));var _0xedbb=function(_0x13ff53,_0x5e1424){_0x13ff53=_0x13ff53-0x0;var _0x290228=_0xdbbe[_0x13ff53];return _0x290228;};'use strict';var _=require(_0xedbb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xedbb('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedbb('0x2'))['db'];var utils=require(_0xedbb('0x3'));var logger=require(_0xedbb('0x4'))('rpc');var config=require(_0xedbb('0x5'));var jayson=require(_0xedbb('0x6'));var client=jayson['client'][_0xedbb('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xc630fb,_0x125a4a,_0x1eb9b5){return new BPromise(function(_0x4c2f4b,_0xbaff7a){return client[_0xedbb('0x8')](_0xc630fb,_0x1eb9b5)['then'](function(_0x1ab74b){logger[_0xedbb('0x9')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x125a4a,'request\x20sent');logger[_0xedbb('0xa')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x125a4a,_0xedbb('0xb'),JSON[_0xedbb('0xc')](_0x1ab74b));if(_0x1ab74b[_0xedbb('0xd')]){if(_0x1ab74b['error'][_0xedbb('0xe')]===0x1f4){logger[_0xedbb('0xd')](_0xedbb('0xf'),_0x125a4a,_0x1ab74b[_0xedbb('0xd')][_0xedbb('0x10')]);return _0xbaff7a(_0x1ab74b[_0xedbb('0xd')]['message']);}logger['error'](_0xedbb('0xf'),_0x125a4a,_0x1ab74b['error']['message']);return _0x4c2f4b(_0x1ab74b['error']['message']);}else{logger[_0xedbb('0x9')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x125a4a,'request\x20sent');_0x4c2f4b(_0x1ab74b[_0xedbb('0x11')][_0xedbb('0x10')]);}})[_0xedbb('0x12')](function(_0x2bf047){logger[_0xedbb('0xd')](_0xedbb('0xf'),_0x125a4a,_0x2bf047);_0xbaff7a(_0x2bf047);});});} \ No newline at end of file +var _0x8ddd=['result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8ddd,0x106));var _0xd8dd=function(_0x109042,_0x413790){_0x109042=_0x109042-0x0;var _0x5afbab=_0x8ddd[_0x109042];return _0x5afbab;};'use strict';var _=require(_0xd8dd('0x0'));var util=require(_0xd8dd('0x1'));var moment=require('moment');var BPromise=require(_0xd8dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8dd('0x3'));var db=require(_0xd8dd('0x4'))['db'];var utils=require(_0xd8dd('0x5'));var logger=require(_0xd8dd('0x6'))('rpc');var config=require(_0xd8dd('0x7'));var jayson=require(_0xd8dd('0x8'));var client=jayson[_0xd8dd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x40bec6,_0x1aad68,_0x252789){return new BPromise(function(_0x5374ef,_0x6fa719){return client[_0xd8dd('0xa')](_0x40bec6,_0x252789)['then'](function(_0x46deb8){logger[_0xd8dd('0xb')](_0xd8dd('0xc'),_0x1aad68,'request\x20sent');logger['debug'](_0xd8dd('0xd'),_0x1aad68,_0xd8dd('0xe'),JSON[_0xd8dd('0xf')](_0x46deb8));if(_0x46deb8[_0xd8dd('0x10')]){if(_0x46deb8['error']['code']===0x1f4){logger[_0xd8dd('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1aad68,_0x46deb8[_0xd8dd('0x10')][_0xd8dd('0x11')]);return _0x6fa719(_0x46deb8['error']['message']);}logger[_0xd8dd('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1aad68,_0x46deb8[_0xd8dd('0x10')]['message']);return _0x5374ef(_0x46deb8['error'][_0xd8dd('0x11')]);}else{logger[_0xd8dd('0xb')](_0xd8dd('0xc'),_0x1aad68,_0xd8dd('0xe'));_0x5374ef(_0x46deb8[_0xd8dd('0x12')][_0xd8dd('0x11')]);}})[_0xd8dd('0x13')](function(_0x211033){logger['error'](_0xd8dd('0xc'),_0x1aad68,_0x211033);_0x6fa719(_0x211033);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 64ba657..e6a1342 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 _0x9c8b=['index','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get','isAuthenticated'];(function(_0x167b19,_0x56081a){var _0x1fcca2=function(_0x544ca4){while(--_0x544ca4){_0x167b19['push'](_0x167b19['shift']());}};_0x1fcca2(++_0x56081a);}(_0x9c8b,0xbc));var _0xb9c8=function(_0x56aca7,_0xba610b){_0x56aca7=_0x56aca7-0x0;var _0x320701=_0x9c8b[_0x56aca7];return _0x320701;};'use strict';var multer=require(_0xb9c8('0x0'));var util=require(_0xb9c8('0x1'));var path=require(_0xb9c8('0x2'));var timeout=require(_0xb9c8('0x3'));var express=require(_0xb9c8('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb9c8('0x5'));var interaction=require(_0xb9c8('0x6'));var config=require('../../config/environment');var controller=require(_0xb9c8('0x7'));router[_0xb9c8('0x8')]('/',auth[_0xb9c8('0x9')](),controller[_0xb9c8('0xa')]);router[_0xb9c8('0x8')](_0xb9c8('0xb'),auth[_0xb9c8('0x9')](),controller['show']);router[_0xb9c8('0xc')]('/',auth[_0xb9c8('0x9')](),controller[_0xb9c8('0xd')]);router[_0xb9c8('0xe')](_0xb9c8('0xb'),auth['isAuthenticated'](),controller[_0xb9c8('0xf')]);router[_0xb9c8('0x10')](_0xb9c8('0xb'),auth[_0xb9c8('0x9')](),controller[_0xb9c8('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe017=['isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get'];(function(_0x43e83e,_0x57bc80){var _0x474911=function(_0x35c6c2){while(--_0x35c6c2){_0x43e83e['push'](_0x43e83e['shift']());}};_0x474911(++_0x57bc80);}(_0xe017,0xaa));var _0x7e01=function(_0x58ef09,_0x5849f7){_0x58ef09=_0x58ef09-0x0;var _0x1795ab=_0xe017[_0x58ef09];return _0x1795ab;};'use strict';var multer=require(_0x7e01('0x0'));var util=require(_0x7e01('0x1'));var path=require(_0x7e01('0x2'));var timeout=require(_0x7e01('0x3'));var express=require('express');var router=express[_0x7e01('0x4')]();var fs_extra=require(_0x7e01('0x5'));var auth=require(_0x7e01('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7e01('0x7'));var controller=require(_0x7e01('0x8'));router[_0x7e01('0x9')]('/',auth[_0x7e01('0xa')](),controller['index']);router[_0x7e01('0x9')](_0x7e01('0xb'),auth[_0x7e01('0xa')](),controller[_0x7e01('0xc')]);router[_0x7e01('0xd')]('/',auth[_0x7e01('0xa')](),controller[_0x7e01('0xe')]);router[_0x7e01('0xf')](_0x7e01('0xb'),auth[_0x7e01('0xa')](),controller[_0x7e01('0x10')]);router[_0x7e01('0x11')](_0x7e01('0xb'),auth[_0x7e01('0xa')](),controller[_0x7e01('0x12')]);module[_0x7e01('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index b202c49..085f630 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 _0xc622=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','exports'];(function(_0x2fc379,_0xd4e15){var _0x91e89d=function(_0xa4c9d1){while(--_0xa4c9d1){_0x2fc379['push'](_0x2fc379['shift']());}};_0x91e89d(++_0xd4e15);}(_0xc622,0x13a));var _0x2c62=function(_0x5ce8b9,_0x5cded8){_0x5ce8b9=_0x5ce8b9-0x0;var _0xe34be0=_0xc622[_0x5ce8b9];return _0xe34be0;};'use strict';var Sequelize=require('sequelize');module[_0x2c62('0x0')]={'type':{'type':Sequelize['ENUM'](_0x2c62('0x1'),_0x2c62('0x2'),_0x2c62('0x3'),_0x2c62('0x4'),_0x2c62('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2c62('0x6')]},'key':{'type':Sequelize[_0x2c62('0x6')]},'keyType':{'type':Sequelize[_0x2c62('0x7')](_0x2c62('0x1'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x2c62('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x2c62('0x6')]},'customField':{'type':Sequelize[_0x2c62('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2c62('0x6')]}}; \ No newline at end of file +var _0x1fc7=['keyValue','STRING','ENUM','BOOLEAN','sequelize','string','variable','customVariable'];(function(_0x46c077,_0xfdb3b8){var _0x3687e1=function(_0x594967){while(--_0x594967){_0x46c077['push'](_0x46c077['shift']());}};_0x3687e1(++_0xfdb3b8);}(_0x1fc7,0x94));var _0x71fc=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x1fc7[_0x2064e5];return _0x21a233;};'use strict';var Sequelize=require(_0x71fc('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x71fc('0x1'),_0x71fc('0x2'),_0x71fc('0x3'),_0x71fc('0x4'),'picklist'),'defaultValue':_0x71fc('0x1')},'content':{'type':Sequelize[_0x71fc('0x5')]},'key':{'type':Sequelize[_0x71fc('0x5')]},'keyType':{'type':Sequelize[_0x71fc('0x6')]('string',_0x71fc('0x2'),_0x71fc('0x3'))},'keyContent':{'type':Sequelize[_0x71fc('0x5')]},'idField':{'type':Sequelize[_0x71fc('0x5')]},'nameField':{'type':Sequelize[_0x71fc('0x5')]},'customField':{'type':Sequelize[_0x71fc('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x71fc('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 104a52c..0fbdf97 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 _0x86ba=['undefined','limit','count','set','apply','reject','update','then','destroy','error','stack','name','index','map','SugarcrmField','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','length','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','fields','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','offset'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0x86ba,0x72));var _0xa86b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x86ba[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0xa86b('0x0'));var rimraf=require(_0xa86b('0x1'));var zipdir=require(_0xa86b('0x2'));var jsonpatch=require(_0xa86b('0x3'));var rp=require('request-promise');var moment=require(_0xa86b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa86b('0x5'));var util=require('util');var path=require(_0xa86b('0x6'));var sox=require(_0xa86b('0x7'));var csv=require(_0xa86b('0x8'));var ejs=require(_0xa86b('0x9'));var fs=require('fs');var fs_extra=require(_0xa86b('0xa'));var _=require('lodash');var squel=require(_0xa86b('0xb'));var crypto=require('crypto');var jsforce=require(_0xa86b('0xc'));var deskjs=require(_0xa86b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xa86b('0xe'));var Papa=require(_0xa86b('0xf'));var Redis=require('ioredis');var authService=require(_0xa86b('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xa86b('0x11'));var hardwareService=require(_0xa86b('0x12'));var logger=require(_0xa86b('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xa86b('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xa86b('0x15'))['db'];function respondWithStatusCode(_0x3fc13f,_0x5831b7){_0x5831b7=_0x5831b7||0xcc;return function(_0x464a8f){if(_0x464a8f){return _0x3fc13f[_0xa86b('0x16')](_0x5831b7);}return _0x3fc13f['status'](_0x5831b7)[_0xa86b('0x17')]();};}function respondWithResult(_0x58d714,_0x24262d){_0x24262d=_0x24262d||0xc8;return function(_0x271a9c){if(_0x271a9c){return _0x58d714[_0xa86b('0x18')](_0x24262d)['json'](_0x271a9c);}};}function respondWithFilteredResult(_0x1865f0,_0xe63961){return function(_0x5824bf){if(_0x5824bf){var _0x490b64=typeof _0xe63961[_0xa86b('0x19')]===_0xa86b('0x1a')&&typeof _0xe63961[_0xa86b('0x1b')]===_0xa86b('0x1a');var _0x49317f=_0x5824bf[_0xa86b('0x1c')];var _0x6ad653=_0x490b64?0x0:_0xe63961[_0xa86b('0x19')];var _0x374db1=_0x490b64?_0x5824bf['count']:_0xe63961[_0xa86b('0x19')]+_0xe63961['limit'];var _0x1a0842;if(_0x374db1>=_0x49317f){_0x374db1=_0x49317f;_0x1a0842=0xc8;}else{_0x1a0842=0xce;}_0x1865f0['status'](_0x1a0842);return _0x1865f0[_0xa86b('0x1d')]('Content-Range',_0x6ad653+'-'+_0x374db1+'/'+_0x49317f)['json'](_0x5824bf);}return null;};}function patchUpdates(_0x4f3188){return function(_0x1769aa){try{jsonpatch[_0xa86b('0x1e')](_0x1769aa,_0x4f3188,!![]);}catch(_0x54df0c){return BPromise[_0xa86b('0x1f')](_0x54df0c);}return _0x1769aa['save']();};}function saveUpdates(_0x2c4a98,_0x2eb8b7){return function(_0x511a96){if(_0x511a96){return _0x511a96[_0xa86b('0x20')](_0x2c4a98)[_0xa86b('0x21')](function(_0x41424f){return _0x41424f;});}return null;};}function removeEntity(_0x506386,_0x1032e9){return function(_0xcf53fb){if(_0xcf53fb){return _0xcf53fb[_0xa86b('0x22')]()[_0xa86b('0x21')](function(){_0x506386['status'](0xcc)[_0xa86b('0x17')]();});}};}function handleEntityNotFound(_0x2b5efe,_0x4f8b62){return function(_0x312900){if(!_0x312900){_0x2b5efe[_0xa86b('0x16')](0x194);}return _0x312900;};}function handleError(_0x1b45a2,_0x46dbf2){_0x46dbf2=_0x46dbf2||0x1f4;return function(_0x1f041d){logger[_0xa86b('0x23')](_0x1f041d[_0xa86b('0x24')]);if(_0x1f041d['name']){delete _0x1f041d[_0xa86b('0x25')];}_0x1b45a2[_0xa86b('0x18')](_0x46dbf2)['send'](_0x1f041d);};}exports[_0xa86b('0x26')]=function(_0xf38139,_0x387d10){var _0x2cc659={},_0x10bc8e={},_0x482dd4={'count':0x0,'rows':[]};var _0x2c4881=_[_0xa86b('0x27')](db[_0xa86b('0x28')][_0xa86b('0x29')],function(_0x3596a0){return{'name':_0x3596a0[_0xa86b('0x2a')],'type':_0x3596a0['type'][_0xa86b('0x2b')]};});_0x10bc8e[_0xa86b('0x2c')]=_[_0xa86b('0x27')](_0x2c4881,_0xa86b('0x25'));_0x10bc8e[_0xa86b('0x2d')]=_[_0xa86b('0x2e')](_0xf38139[_0xa86b('0x2d')]);_0x10bc8e[_0xa86b('0x2f')]=_['intersection'](_0x10bc8e[_0xa86b('0x2c')],_0x10bc8e['query']);_0x2cc659[_0xa86b('0x30')]=_[_0xa86b('0x31')](_0x10bc8e['model'],qs['fields'](_0xf38139[_0xa86b('0x2d')]['fields']));_0x2cc659[_0xa86b('0x30')]=_0x2cc659[_0xa86b('0x30')][_0xa86b('0x32')]?_0x2cc659[_0xa86b('0x30')]:_0x10bc8e[_0xa86b('0x2c')];if(!_0xf38139[_0xa86b('0x2d')]['hasOwnProperty']('nolimit')){_0x2cc659[_0xa86b('0x1b')]=qs['limit'](_0xf38139[_0xa86b('0x2d')][_0xa86b('0x1b')]);_0x2cc659['offset']=qs[_0xa86b('0x19')](_0xf38139[_0xa86b('0x2d')][_0xa86b('0x19')]);}_0x2cc659[_0xa86b('0x33')]=qs[_0xa86b('0x34')](_0xf38139[_0xa86b('0x2d')][_0xa86b('0x34')]);_0x2cc659[_0xa86b('0x35')]=qs['filters'](_[_0xa86b('0x36')](_0xf38139[_0xa86b('0x2d')],_0x10bc8e[_0xa86b('0x2f')]),_0x2c4881);if(_0xf38139[_0xa86b('0x2d')]['filter']){_0x2cc659['where']=_[_0xa86b('0x37')](_0x2cc659[_0xa86b('0x35')],{'$or':_[_0xa86b('0x27')](_0x2c4881,function(_0x91bcfb){if(_0x91bcfb[_0xa86b('0x38')]!==_0xa86b('0x39')){var _0x1236da={};_0x1236da[_0x91bcfb[_0xa86b('0x25')]]={'$like':'%'+_0xf38139[_0xa86b('0x2d')][_0xa86b('0x3a')]+'%'};return _0x1236da;}})});}_0x2cc659=_[_0xa86b('0x37')]({},_0x2cc659,_0xf38139[_0xa86b('0x3b')]);var _0x2b7a30={'where':_0x2cc659[_0xa86b('0x35')]};return db[_0xa86b('0x28')][_0xa86b('0x1c')](_0x2b7a30)[_0xa86b('0x21')](function(_0x42c3ff){_0x482dd4[_0xa86b('0x1c')]=_0x42c3ff;if(_0xf38139['query'][_0xa86b('0x3c')]){_0x2cc659['include']=[{'all':!![]}];}return db['SugarcrmField'][_0xa86b('0x3d')](_0x2cc659);})['then'](function(_0x2cf574){_0x482dd4[_0xa86b('0x3e')]=_0x2cf574;return _0x482dd4;})[_0xa86b('0x21')](respondWithFilteredResult(_0x387d10,_0x2cc659))[_0xa86b('0x3f')](handleError(_0x387d10,null));};exports[_0xa86b('0x40')]=function(_0x3acbe6,_0x2a4676){var _0x17fc4c={'raw':!![],'where':{'id':_0x3acbe6[_0xa86b('0x41')]['id']}},_0x5df4e2={};_0x5df4e2['model']=_[_0xa86b('0x2e')](db[_0xa86b('0x28')]['rawAttributes']);_0x5df4e2[_0xa86b('0x2d')]=_[_0xa86b('0x2e')](_0x3acbe6['query']);_0x5df4e2['filters']=_['intersection'](_0x5df4e2['model'],_0x5df4e2['query']);_0x17fc4c[_0xa86b('0x30')]=_[_0xa86b('0x31')](_0x5df4e2['model'],qs[_0xa86b('0x42')](_0x3acbe6['query']['fields']));_0x17fc4c['attributes']=_0x17fc4c[_0xa86b('0x30')][_0xa86b('0x32')]?_0x17fc4c['attributes']:_0x5df4e2[_0xa86b('0x2c')];if(_0x3acbe6[_0xa86b('0x2d')][_0xa86b('0x3c')]){_0x17fc4c['include']=[{'all':!![]}];}_0x17fc4c=_[_0xa86b('0x37')]({},_0x17fc4c,_0x3acbe6[_0xa86b('0x3b')]);return db[_0xa86b('0x28')][_0xa86b('0x43')](_0x17fc4c)[_0xa86b('0x21')](handleEntityNotFound(_0x2a4676,null))[_0xa86b('0x21')](respondWithResult(_0x2a4676,null))['catch'](handleError(_0x2a4676,null));};exports[_0xa86b('0x44')]=function(_0x42912a,_0x1b404f){return db['SugarcrmField'][_0xa86b('0x44')](_0x42912a[_0xa86b('0x45')],{})[_0xa86b('0x21')](respondWithResult(_0x1b404f,0xc9))[_0xa86b('0x3f')](handleError(_0x1b404f,null));};exports[_0xa86b('0x20')]=function(_0x8b672c,_0x834e34){if(_0x8b672c[_0xa86b('0x45')]['id']){delete _0x8b672c[_0xa86b('0x45')]['id'];}return db[_0xa86b('0x28')][_0xa86b('0x43')]({'where':{'id':_0x8b672c['params']['id']}})[_0xa86b('0x21')](handleEntityNotFound(_0x834e34,null))[_0xa86b('0x21')](saveUpdates(_0x8b672c[_0xa86b('0x45')],null))[_0xa86b('0x21')](respondWithResult(_0x834e34,null))[_0xa86b('0x3f')](handleError(_0x834e34,null));};exports[_0xa86b('0x22')]=function(_0x5d97d4,_0x8e835d){return db[_0xa86b('0x28')][_0xa86b('0x43')]({'where':{'id':_0x5d97d4['params']['id']}})[_0xa86b('0x21')](handleEntityNotFound(_0x8e835d,null))['then'](removeEntity(_0x8e835d,null))[_0xa86b('0x3f')](handleError(_0x8e835d,null));}; \ No newline at end of file +var _0xe36a=['then','destroy','error','stack','name','index','map','SugarcrmField','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x29e267,_0x428955){var _0x3fb655=function(_0x49c599){while(--_0x49c599){_0x29e267['push'](_0x29e267['shift']());}};_0x3fb655(++_0x428955);}(_0xe36a,0x13a));var _0xae36=function(_0x580730,_0x423233){_0x580730=_0x580730-0x0;var _0xf5629a=_0xe36a[_0x580730];return _0xf5629a;};'use strict';var emlformat=require(_0xae36('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xae36('0x1'));var jsonpatch=require(_0xae36('0x2'));var rp=require('request-promise');var moment=require(_0xae36('0x3'));var BPromise=require(_0xae36('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xae36('0x5'));var sox=require(_0xae36('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae36('0x7'));var squel=require(_0xae36('0x8'));var crypto=require(_0xae36('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xae36('0xa'));var toCsv=require(_0xae36('0xb'));var querystring=require(_0xae36('0xc'));var Papa=require(_0xae36('0xd'));var Redis=require(_0xae36('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xae36('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xae36('0x10'));var logger=require(_0xae36('0x11'))(_0xae36('0x12'));var utils=require(_0xae36('0x13'));var config=require(_0xae36('0x14'));var licenseUtil=require(_0xae36('0x15'));var db=require(_0xae36('0x16'))['db'];function respondWithStatusCode(_0x2e1110,_0x218a28){_0x218a28=_0x218a28||0xcc;return function(_0x261a44){if(_0x261a44){return _0x2e1110[_0xae36('0x17')](_0x218a28);}return _0x2e1110['status'](_0x218a28)[_0xae36('0x18')]();};}function respondWithResult(_0x2ee79a,_0x30de1f){_0x30de1f=_0x30de1f||0xc8;return function(_0x4c7e08){if(_0x4c7e08){return _0x2ee79a[_0xae36('0x19')](_0x30de1f)[_0xae36('0x1a')](_0x4c7e08);}};}function respondWithFilteredResult(_0x14e572,_0x4d17b4){return function(_0x5f0611){if(_0x5f0611){var _0x3e4fd8=typeof _0x4d17b4[_0xae36('0x1b')]===_0xae36('0x1c')&&typeof _0x4d17b4[_0xae36('0x1d')]===_0xae36('0x1c');var _0x13dd41=_0x5f0611[_0xae36('0x1e')];var _0x17aca1=_0x3e4fd8?0x0:_0x4d17b4[_0xae36('0x1b')];var _0x4c3fa4=_0x3e4fd8?_0x5f0611[_0xae36('0x1e')]:_0x4d17b4[_0xae36('0x1b')]+_0x4d17b4[_0xae36('0x1d')];var _0x1c2878;if(_0x4c3fa4>=_0x13dd41){_0x4c3fa4=_0x13dd41;_0x1c2878=0xc8;}else{_0x1c2878=0xce;}_0x14e572[_0xae36('0x19')](_0x1c2878);return _0x14e572[_0xae36('0x1f')](_0xae36('0x20'),_0x17aca1+'-'+_0x4c3fa4+'/'+_0x13dd41)[_0xae36('0x1a')](_0x5f0611);}return null;};}function patchUpdates(_0x3425a0){return function(_0x42dd31){try{jsonpatch[_0xae36('0x21')](_0x42dd31,_0x3425a0,!![]);}catch(_0x3554ac){return BPromise[_0xae36('0x22')](_0x3554ac);}return _0x42dd31[_0xae36('0x23')]();};}function saveUpdates(_0x342d21,_0x51f9c3){return function(_0xd934b2){if(_0xd934b2){return _0xd934b2['update'](_0x342d21)[_0xae36('0x24')](function(_0x556f09){return _0x556f09;});}return null;};}function removeEntity(_0x29da0d,_0x3d8265){return function(_0x136280){if(_0x136280){return _0x136280[_0xae36('0x25')]()[_0xae36('0x24')](function(){_0x29da0d[_0xae36('0x19')](0xcc)[_0xae36('0x18')]();});}};}function handleEntityNotFound(_0x38b705,_0x3f280c){return function(_0x363739){if(!_0x363739){_0x38b705['sendStatus'](0x194);}return _0x363739;};}function handleError(_0x425b54,_0x2c7874){_0x2c7874=_0x2c7874||0x1f4;return function(_0x218dea){logger[_0xae36('0x26')](_0x218dea[_0xae36('0x27')]);if(_0x218dea[_0xae36('0x28')]){delete _0x218dea['name'];}_0x425b54[_0xae36('0x19')](_0x2c7874)['send'](_0x218dea);};}exports[_0xae36('0x29')]=function(_0x45d6a8,_0x2bb733){var _0x14db32={},_0x302d14={},_0x13cb1f={'count':0x0,'rows':[]};var _0x580fb4=_[_0xae36('0x2a')](db[_0xae36('0x2b')]['rawAttributes'],function(_0x4c089f){return{'name':_0x4c089f['fieldName'],'type':_0x4c089f[_0xae36('0x2c')][_0xae36('0x2d')]};});_0x302d14[_0xae36('0x2e')]=_[_0xae36('0x2a')](_0x580fb4,_0xae36('0x28'));_0x302d14[_0xae36('0x2f')]=_[_0xae36('0x30')](_0x45d6a8[_0xae36('0x2f')]);_0x302d14[_0xae36('0x31')]=_[_0xae36('0x32')](_0x302d14['model'],_0x302d14[_0xae36('0x2f')]);_0x14db32[_0xae36('0x33')]=_['intersection'](_0x302d14[_0xae36('0x2e')],qs[_0xae36('0x34')](_0x45d6a8['query'][_0xae36('0x34')]));_0x14db32[_0xae36('0x33')]=_0x14db32[_0xae36('0x33')][_0xae36('0x35')]?_0x14db32[_0xae36('0x33')]:_0x302d14[_0xae36('0x2e')];if(!_0x45d6a8[_0xae36('0x2f')][_0xae36('0x36')](_0xae36('0x37'))){_0x14db32[_0xae36('0x1d')]=qs[_0xae36('0x1d')](_0x45d6a8[_0xae36('0x2f')][_0xae36('0x1d')]);_0x14db32[_0xae36('0x1b')]=qs['offset'](_0x45d6a8['query']['offset']);}_0x14db32[_0xae36('0x38')]=qs[_0xae36('0x39')](_0x45d6a8[_0xae36('0x2f')][_0xae36('0x39')]);_0x14db32[_0xae36('0x3a')]=qs[_0xae36('0x31')](_['pick'](_0x45d6a8[_0xae36('0x2f')],_0x302d14[_0xae36('0x31')]),_0x580fb4);if(_0x45d6a8[_0xae36('0x2f')]['filter']){_0x14db32[_0xae36('0x3a')]=_[_0xae36('0x3b')](_0x14db32['where'],{'$or':_[_0xae36('0x2a')](_0x580fb4,function(_0x24ce4b){if(_0x24ce4b[_0xae36('0x2c')]!=='VIRTUAL'){var _0x6e5e7b={};_0x6e5e7b[_0x24ce4b[_0xae36('0x28')]]={'$like':'%'+_0x45d6a8[_0xae36('0x2f')]['filter']+'%'};return _0x6e5e7b;}})});}_0x14db32=_['merge']({},_0x14db32,_0x45d6a8[_0xae36('0x3c')]);var _0x13dd8b={'where':_0x14db32[_0xae36('0x3a')]};return db[_0xae36('0x2b')]['count'](_0x13dd8b)['then'](function(_0xb9bb47){_0x13cb1f[_0xae36('0x1e')]=_0xb9bb47;if(_0x45d6a8[_0xae36('0x2f')][_0xae36('0x3d')]){_0x14db32[_0xae36('0x3e')]=[{'all':!![]}];}return db[_0xae36('0x2b')][_0xae36('0x3f')](_0x14db32);})[_0xae36('0x24')](function(_0x789406){_0x13cb1f[_0xae36('0x40')]=_0x789406;return _0x13cb1f;})[_0xae36('0x24')](respondWithFilteredResult(_0x2bb733,_0x14db32))[_0xae36('0x41')](handleError(_0x2bb733,null));};exports['show']=function(_0x598ffa,_0x2cb946){var _0x2260fa={'raw':!![],'where':{'id':_0x598ffa[_0xae36('0x42')]['id']}},_0x253cfe={};_0x253cfe['model']=_[_0xae36('0x30')](db['SugarcrmField']['rawAttributes']);_0x253cfe[_0xae36('0x2f')]=_['keys'](_0x598ffa[_0xae36('0x2f')]);_0x253cfe[_0xae36('0x31')]=_[_0xae36('0x32')](_0x253cfe[_0xae36('0x2e')],_0x253cfe[_0xae36('0x2f')]);_0x2260fa[_0xae36('0x33')]=_[_0xae36('0x32')](_0x253cfe[_0xae36('0x2e')],qs['fields'](_0x598ffa['query'][_0xae36('0x34')]));_0x2260fa[_0xae36('0x33')]=_0x2260fa['attributes'][_0xae36('0x35')]?_0x2260fa[_0xae36('0x33')]:_0x253cfe[_0xae36('0x2e')];if(_0x598ffa[_0xae36('0x2f')][_0xae36('0x3d')]){_0x2260fa[_0xae36('0x3e')]=[{'all':!![]}];}_0x2260fa=_[_0xae36('0x3b')]({},_0x2260fa,_0x598ffa[_0xae36('0x3c')]);return db[_0xae36('0x2b')][_0xae36('0x43')](_0x2260fa)[_0xae36('0x24')](handleEntityNotFound(_0x2cb946,null))[_0xae36('0x24')](respondWithResult(_0x2cb946,null))['catch'](handleError(_0x2cb946,null));};exports['create']=function(_0x3dfb0a,_0x3b94d7){return db[_0xae36('0x2b')][_0xae36('0x44')](_0x3dfb0a[_0xae36('0x45')],{})[_0xae36('0x24')](respondWithResult(_0x3b94d7,0xc9))['catch'](handleError(_0x3b94d7,null));};exports['update']=function(_0x379951,_0x32dc8f){if(_0x379951[_0xae36('0x45')]['id']){delete _0x379951[_0xae36('0x45')]['id'];}return db['SugarcrmField'][_0xae36('0x43')]({'where':{'id':_0x379951[_0xae36('0x42')]['id']}})[_0xae36('0x24')](handleEntityNotFound(_0x32dc8f,null))[_0xae36('0x24')](saveUpdates(_0x379951['body'],null))[_0xae36('0x24')](respondWithResult(_0x32dc8f,null))['catch'](handleError(_0x32dc8f,null));};exports[_0xae36('0x25')]=function(_0x3c253c,_0x326ede){return db[_0xae36('0x2b')][_0xae36('0x43')]({'where':{'id':_0x3c253c[_0xae36('0x42')]['id']}})[_0xae36('0x24')](handleEntityNotFound(_0x326ede,null))[_0xae36('0x24')](removeEntity(_0x326ede,null))[_0xae36('0x41')](handleError(_0x326ede,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 649233a..74d9b24 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 _0xcd99=['define','SugarcrmField','int_sugarcrm_fields','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports'];(function(_0x22b800,_0x4e6eb3){var _0x2a1810=function(_0x2fa215){while(--_0x2fa215){_0x22b800['push'](_0x22b800['shift']());}};_0x2a1810(++_0x4e6eb3);}(_0xcd99,0x183));var _0x9cd9=function(_0x5d614a,_0x28776f){_0x5d614a=_0x5d614a-0x0;var _0x983985=_0xcd99[_0x5d614a];return _0x983985;};'use strict';var _=require(_0x9cd9('0x0'));var util=require('util');var logger=require(_0x9cd9('0x1'))('api');var moment=require(_0x9cd9('0x2'));var BPromise=require('bluebird');var rp=require(_0x9cd9('0x3'));var fs=require('fs');var path=require(_0x9cd9('0x4'));var rimraf=require(_0x9cd9('0x5'));var config=require(_0x9cd9('0x6'));var attributes=require(_0x9cd9('0x7'));module[_0x9cd9('0x8')]=function(_0x2da9e4,_0x18d903){return _0x2da9e4[_0x9cd9('0x9')](_0x9cd9('0xa'),attributes,{'tableName':_0x9cd9('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4cb8=['api','moment','bluebird','request-promise','./intSugarcrmField.attributes','define','SugarcrmField','int_sugarcrm_fields','idField','FieldId','lodash','util','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4cb8,0xcd));var _0x84cb=function(_0x55ec1e,_0x30c76e){_0x55ec1e=_0x55ec1e-0x0;var _0x21d443=_0x4cb8[_0x55ec1e];return _0x21d443;};'use strict';var _=require(_0x84cb('0x0'));var util=require(_0x84cb('0x1'));var logger=require(_0x84cb('0x2'))(_0x84cb('0x3'));var moment=require(_0x84cb('0x4'));var BPromise=require(_0x84cb('0x5'));var rp=require(_0x84cb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x84cb('0x7'));module['exports']=function(_0x8722b6,_0x1ffb2b){return _0x8722b6[_0x84cb('0x8')](_0x84cb('0x9'),attributes,{'tableName':_0x84cb('0xa'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x84cb('0xb'),_0x84cb('0xc')],'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 31cb671..003f625 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 _0x7b82=['stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug'];(function(_0x16fb0d,_0x2a08cd){var _0x3b041a=function(_0x3ab1d4){while(--_0x3ab1d4){_0x16fb0d['push'](_0x16fb0d['shift']());}};_0x3b041a(++_0x2a08cd);}(_0x7b82,0x13b));var _0x27b8=function(_0x1762b4,_0x33d836){_0x1762b4=_0x1762b4-0x0;var _0x29beda=_0x7b82[_0x1762b4];return _0x29beda;};'use strict';var _=require(_0x27b8('0x0'));var util=require(_0x27b8('0x1'));var moment=require(_0x27b8('0x2'));var BPromise=require(_0x27b8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x27b8('0x4'));var db=require(_0x27b8('0x5'))['db'];var utils=require(_0x27b8('0x6'));var logger=require(_0x27b8('0x7'))('rpc');var config=require(_0x27b8('0x8'));var jayson=require(_0x27b8('0x9'));var client=jayson[_0x27b8('0xa')][_0x27b8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x334191,_0x42be99,_0xde3cfc){return new BPromise(function(_0x1df637,_0x38b043){return client[_0x27b8('0xc')](_0x334191,_0xde3cfc)['then'](function(_0x371d04){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x42be99,_0x27b8('0xd'));logger[_0x27b8('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x42be99,_0x27b8('0xd'),JSON[_0x27b8('0xf')](_0x371d04));if(_0x371d04['error']){if(_0x371d04[_0x27b8('0x10')][_0x27b8('0x11')]===0x1f4){logger[_0x27b8('0x10')](_0x27b8('0x12'),_0x42be99,_0x371d04[_0x27b8('0x10')][_0x27b8('0x13')]);return _0x38b043(_0x371d04['error'][_0x27b8('0x13')]);}logger[_0x27b8('0x10')](_0x27b8('0x12'),_0x42be99,_0x371d04['error']['message']);return _0x1df637(_0x371d04[_0x27b8('0x10')]['message']);}else{logger['info'](_0x27b8('0x12'),_0x42be99,_0x27b8('0xd'));_0x1df637(_0x371d04[_0x27b8('0x14')]['message']);}})[_0x27b8('0x15')](function(_0x3ebb2a){logger['error'](_0x27b8('0x12'),_0x42be99,_0x3ebb2a);_0x38b043(_0x3ebb2a);});});} \ No newline at end of file +var _0x819c=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','code','error','SugarcrmField,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x34bc9f,_0x289840){var _0x170d91=function(_0x51d279){while(--_0x51d279){_0x34bc9f['push'](_0x34bc9f['shift']());}};_0x170d91(++_0x289840);}(_0x819c,0x172));var _0xc819=function(_0x4b3489,_0x23ee4a){_0x4b3489=_0x4b3489-0x0;var _0xa61ed7=_0x819c[_0x4b3489];return _0xa61ed7;};'use strict';var _=require(_0xc819('0x0'));var util=require(_0xc819('0x1'));var moment=require(_0xc819('0x2'));var BPromise=require(_0xc819('0x3'));var rs=require(_0xc819('0x4'));var fs=require('fs');var Redis=require(_0xc819('0x5'));var db=require(_0xc819('0x6'))['db'];var utils=require(_0xc819('0x7'));var logger=require(_0xc819('0x8'))(_0xc819('0x9'));var config=require(_0xc819('0xa'));var jayson=require(_0xc819('0xb'));var client=jayson[_0xc819('0xc')][_0xc819('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x464230,_0xcf0294,_0x59dced){return new BPromise(function(_0x2145ea,_0x11ea71){return client[_0xc819('0xe')](_0x464230,_0x59dced)['then'](function(_0x2b1181){logger[_0xc819('0xf')]('SugarcrmField,\x20%s,\x20%s',_0xcf0294,_0xc819('0x10'));logger[_0xc819('0x11')](_0xc819('0x12'),_0xcf0294,_0xc819('0x10'),JSON[_0xc819('0x13')](_0x2b1181));if(_0x2b1181['error']){if(_0x2b1181['error'][_0xc819('0x14')]===0x1f4){logger[_0xc819('0x15')](_0xc819('0x16'),_0xcf0294,_0x2b1181['error'][_0xc819('0x17')]);return _0x11ea71(_0x2b1181['error'][_0xc819('0x17')]);}logger[_0xc819('0x15')]('SugarcrmField,\x20%s,\x20%s',_0xcf0294,_0x2b1181[_0xc819('0x15')][_0xc819('0x17')]);return _0x2145ea(_0x2b1181[_0xc819('0x15')]['message']);}else{logger[_0xc819('0xf')](_0xc819('0x16'),_0xcf0294,_0xc819('0x10'));_0x2145ea(_0x2b1181[_0xc819('0x18')]['message']);}})['catch'](function(_0x3050d1){logger['error']('SugarcrmField,\x20%s,\x20%s',_0xcf0294,_0x3050d1);_0x11ea71(_0x3050d1);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 9fff009..999540f 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 _0x7531=['../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','get','/:id','show','getConfigurations','/:id/fields','getFields','create','post','/:id/configurations','addConfiguration','put','update','exports','multer','util','path','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7531,0x69));var _0x1753=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x7531[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x1753('0x0'));var util=require(_0x1753('0x1'));var path=require(_0x1753('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x1753('0x3'));var auth=require(_0x1753('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1753('0x5'));var controller=require(_0x1753('0x6'));router['get']('/',auth[_0x1753('0x7')](),controller[_0x1753('0x8')]);router[_0x1753('0x9')](_0x1753('0xa'),auth[_0x1753('0x7')](),controller[_0x1753('0xb')]);router[_0x1753('0x9')]('/:id/configurations',auth[_0x1753('0x7')](),controller[_0x1753('0xc')]);router[_0x1753('0x9')](_0x1753('0xd'),auth[_0x1753('0x7')](),controller[_0x1753('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x1753('0xf')]);router[_0x1753('0x10')](_0x1753('0x11'),auth[_0x1753('0x7')](),controller[_0x1753('0x12')]);router[_0x1753('0x13')](_0x1753('0xa'),auth[_0x1753('0x7')](),controller[_0x1753('0x14')]);router['delete'](_0x1753('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x1753('0x15')]=router; \ No newline at end of file +var _0xbb94=['delete','exports','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','create','post','put','update'];(function(_0x207d2f,_0x44400f){var _0x3c3498=function(_0x57fdfb){while(--_0x57fdfb){_0x207d2f['push'](_0x207d2f['shift']());}};_0x3c3498(++_0x44400f);}(_0xbb94,0xde));var _0x4bb9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb94[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4bb9('0x0'));var timeout=require('connect-timeout');var express=require(_0x4bb9('0x1'));var router=express[_0x4bb9('0x2')]();var fs_extra=require(_0x4bb9('0x3'));var auth=require(_0x4bb9('0x4'));var interaction=require(_0x4bb9('0x5'));var config=require(_0x4bb9('0x6'));var controller=require(_0x4bb9('0x7'));router[_0x4bb9('0x8')]('/',auth[_0x4bb9('0x9')](),controller['index']);router[_0x4bb9('0x8')](_0x4bb9('0xa'),auth[_0x4bb9('0x9')](),controller['show']);router[_0x4bb9('0x8')](_0x4bb9('0xb'),auth['isAuthenticated'](),controller[_0x4bb9('0xc')]);router['get'](_0x4bb9('0xd'),auth[_0x4bb9('0x9')](),controller['getFields']);router['post']('/',auth[_0x4bb9('0x9')](),controller[_0x4bb9('0xe')]);router[_0x4bb9('0xf')](_0x4bb9('0xb'),auth[_0x4bb9('0x9')](),controller['addConfiguration']);router[_0x4bb9('0x10')]('/:id',auth[_0x4bb9('0x9')](),controller[_0x4bb9('0x11')]);router[_0x4bb9('0x12')](_0x4bb9('0xa'),auth[_0x4bb9('0x9')](),controller['destroy']);module[_0x4bb9('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 565daf8..ba96eca 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 _0x6801=['sequelize','exports','STRING','HelpDesk'];(function(_0x322522,_0x4db288){var _0x293bcf=function(_0xf108b8){while(--_0xf108b8){_0x322522['push'](_0x322522['shift']());}};_0x293bcf(++_0x4db288);}(_0x6801,0x17c));var _0x1680=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6801[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1680('0x0'));module[_0x1680('0x1')]={'name':{'type':Sequelize[_0x1680('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x1680('0x2')]},'username':{'type':Sequelize[_0x1680('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x1680('0x2')],'allowNull':![],'defaultValue':_0x1680('0x3')},'remoteUri':{'type':Sequelize[_0x1680('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x1680('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xdd6b=['HelpDesk','sequelize','exports','STRING'];(function(_0x5e0849,_0x36a3f0){var _0x13ccbf=function(_0x10b951){while(--_0x10b951){_0x5e0849['push'](_0x5e0849['shift']());}};_0x13ccbf(++_0x36a3f0);}(_0xdd6b,0x16d));var _0xbdd6=function(_0x3443a9,_0x3aab5e){_0x3443a9=_0x3443a9-0x0;var _0x525265=_0xdd6b[_0x3443a9];return _0x525265;};'use strict';var Sequelize=require(_0xbdd6('0x0'));module[_0xbdd6('0x1')]={'name':{'type':Sequelize[_0xbdd6('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xbdd6('0x2')],'allowNull':![],'defaultValue':_0xbdd6('0x3')},'remoteUri':{'type':Sequelize[_0xbdd6('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xbdd6('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0xbdd6('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 2779ea3..32ce459 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 _0x05d9=['format','%s/webservice.php','GET','username','success','POST','login','result','describe','sessionName','autogenerated','reference','remove','includes','false','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','moment','bluebird','util','path','ejs','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','error','stack','name','send','map','VtigerAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','count','rows','catch','params','includeAll','include','options','find','create','body','destroy','getConfigurations','findOne','VtigerConfiguration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','VtigerField','md5','getFields','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x05d9,0x104));var _0x905d=function(_0x473f38,_0x26d5e4){_0x473f38=_0x473f38-0x0;var _0xcfe52f=_0x05d9[_0x473f38];return _0xcfe52f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x905d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x905d('0x1'));var BPromise=require(_0x905d('0x2'));var Mustache=require('mustache');var util=require(_0x905d('0x3'));var path=require(_0x905d('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x905d('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x905d('0x6'));var squel=require(_0x905d('0x7'));var crypto=require(_0x905d('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x905d('0x9'));var querystring=require(_0x905d('0xa'));var Papa=require('papaparse');var Redis=require(_0x905d('0xb'));var authService=require(_0x905d('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x905d('0xd'))(_0x905d('0xe'));var utils=require(_0x905d('0xf'));var config=require(_0x905d('0x10'));var licenseUtil=require(_0x905d('0x11'));var db=require('../../mysqldb')['db'];var integrations=require(_0x905d('0x12'));function respondWithStatusCode(_0x5796ff,_0x15d3c2){_0x15d3c2=_0x15d3c2||0xcc;return function(_0x2c7db7){if(_0x2c7db7){return _0x5796ff[_0x905d('0x13')](_0x15d3c2);}return _0x5796ff[_0x905d('0x14')](_0x15d3c2)[_0x905d('0x15')]();};}function respondWithResult(_0xd9da95,_0x35b3df){_0x35b3df=_0x35b3df||0xc8;return function(_0x3fefa1){if(_0x3fefa1){return _0xd9da95['status'](_0x35b3df)[_0x905d('0x16')](_0x3fefa1);}};}function respondWithFilteredResult(_0xc67661,_0xfefc4e){return function(_0x512a43){if(_0x512a43){var _0x25e4bf=typeof _0xfefc4e[_0x905d('0x17')]===_0x905d('0x18')&&typeof _0xfefc4e[_0x905d('0x19')]==='undefined';var _0x1e5f39=_0x512a43['count'];var _0x5609a2=_0x25e4bf?0x0:_0xfefc4e[_0x905d('0x17')];var _0xb7c9db=_0x25e4bf?_0x512a43['count']:_0xfefc4e['offset']+_0xfefc4e['limit'];var _0x379b2e;if(_0xb7c9db>=_0x1e5f39){_0xb7c9db=_0x1e5f39;_0x379b2e=0xc8;}else{_0x379b2e=0xce;}_0xc67661['status'](_0x379b2e);return _0xc67661[_0x905d('0x1a')]('Content-Range',_0x5609a2+'-'+_0xb7c9db+'/'+_0x1e5f39)[_0x905d('0x16')](_0x512a43);}return null;};}function patchUpdates(_0x3b0420){return function(_0x331416){try{jsonpatch[_0x905d('0x1b')](_0x331416,_0x3b0420,!![]);}catch(_0x3a4116){return BPromise[_0x905d('0x1c')](_0x3a4116);}return _0x331416[_0x905d('0x1d')]();};}function saveUpdates(_0x23c2ea,_0x1724df){return function(_0x4ca363){if(_0x4ca363){return _0x4ca363[_0x905d('0x1e')](_0x23c2ea)['then'](function(_0x25a43f){return _0x25a43f;});}return null;};}function removeEntity(_0x22a8a2,_0x180f3e){return function(_0x4539d6){if(_0x4539d6){return _0x4539d6['destroy']()[_0x905d('0x1f')](function(){_0x22a8a2[_0x905d('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x528604,_0xf52de5){return function(_0x11239f){if(!_0x11239f){_0x528604[_0x905d('0x13')](0x194);}return _0x11239f;};}function handleError(_0x4c563b,_0x458c9c){_0x458c9c=_0x458c9c||0x1f4;return function(_0x2db691){logger[_0x905d('0x20')](_0x2db691[_0x905d('0x21')]);if(_0x2db691[_0x905d('0x22')]){delete _0x2db691[_0x905d('0x22')];}_0x4c563b[_0x905d('0x14')](_0x458c9c)[_0x905d('0x23')](_0x2db691);};}exports['index']=function(_0x499106,_0x49f7f8){var _0x7c2e54={},_0x48d8dd={},_0x5372d0={'count':0x0,'rows':[]};var _0x4afa1e=_[_0x905d('0x24')](db[_0x905d('0x25')][_0x905d('0x26')],function(_0xe6d80f){return{'name':_0xe6d80f[_0x905d('0x27')],'type':_0xe6d80f['type'][_0x905d('0x28')]};});_0x48d8dd[_0x905d('0x29')]=_[_0x905d('0x24')](_0x4afa1e,_0x905d('0x22'));_0x48d8dd[_0x905d('0x2a')]=_[_0x905d('0x2b')](_0x499106[_0x905d('0x2a')]);_0x48d8dd[_0x905d('0x2c')]=_[_0x905d('0x2d')](_0x48d8dd[_0x905d('0x29')],_0x48d8dd['query']);_0x7c2e54[_0x905d('0x2e')]=_['intersection'](_0x48d8dd[_0x905d('0x29')],qs[_0x905d('0x2f')](_0x499106['query'][_0x905d('0x2f')]));_0x7c2e54[_0x905d('0x2e')]=_0x7c2e54[_0x905d('0x2e')][_0x905d('0x30')]?_0x7c2e54['attributes']:_0x48d8dd[_0x905d('0x29')];if(!_0x499106[_0x905d('0x2a')][_0x905d('0x31')](_0x905d('0x32'))){_0x7c2e54[_0x905d('0x19')]=qs['limit'](_0x499106['query'][_0x905d('0x19')]);_0x7c2e54['offset']=qs[_0x905d('0x17')](_0x499106[_0x905d('0x2a')][_0x905d('0x17')]);}_0x7c2e54[_0x905d('0x33')]=qs[_0x905d('0x34')](_0x499106['query'][_0x905d('0x34')]);_0x7c2e54['where']=qs['filters'](_[_0x905d('0x35')](_0x499106['query'],_0x48d8dd[_0x905d('0x2c')]),_0x4afa1e);if(_0x499106[_0x905d('0x2a')][_0x905d('0x36')]){_0x7c2e54['where']=_[_0x905d('0x37')](_0x7c2e54[_0x905d('0x38')],{'$or':_[_0x905d('0x24')](_0x4afa1e,function(_0x41f5f2){if(_0x41f5f2[_0x905d('0x39')]!==_0x905d('0x3a')){var _0x320a22={};_0x320a22[_0x41f5f2[_0x905d('0x22')]]={'$like':'%'+_0x499106[_0x905d('0x2a')][_0x905d('0x36')]+'%'};return _0x320a22;}})});}_0x7c2e54=_[_0x905d('0x37')]({},_0x7c2e54,_0x499106['options']);var _0x15dada={'where':_0x7c2e54[_0x905d('0x38')]};return db['VtigerAccount']['count'](_0x15dada)[_0x905d('0x1f')](function(_0x4b02d2){_0x5372d0[_0x905d('0x3b')]=_0x4b02d2;if(_0x499106[_0x905d('0x2a')]['includeAll']){_0x7c2e54['include']=[{'all':!![]}];}return db[_0x905d('0x25')]['findAll'](_0x7c2e54);})[_0x905d('0x1f')](function(_0x437829){_0x5372d0[_0x905d('0x3c')]=_0x437829;return _0x5372d0;})[_0x905d('0x1f')](respondWithFilteredResult(_0x49f7f8,_0x7c2e54))[_0x905d('0x3d')](handleError(_0x49f7f8,null));};exports['show']=function(_0x4f560d,_0x20c4be){var _0x1dae0b={'raw':![],'where':{'id':_0x4f560d[_0x905d('0x3e')]['id']}},_0x24d810={};_0x24d810['model']=_['keys'](db[_0x905d('0x25')]['rawAttributes']);_0x24d810[_0x905d('0x2a')]=_[_0x905d('0x2b')](_0x4f560d[_0x905d('0x2a')]);_0x24d810[_0x905d('0x2c')]=_[_0x905d('0x2d')](_0x24d810['model'],_0x24d810[_0x905d('0x2a')]);_0x1dae0b[_0x905d('0x2e')]=_[_0x905d('0x2d')](_0x24d810[_0x905d('0x29')],qs[_0x905d('0x2f')](_0x4f560d[_0x905d('0x2a')][_0x905d('0x2f')]));_0x1dae0b['attributes']=_0x1dae0b[_0x905d('0x2e')][_0x905d('0x30')]?_0x1dae0b[_0x905d('0x2e')]:_0x24d810['model'];if(_0x4f560d[_0x905d('0x2a')][_0x905d('0x3f')]){_0x1dae0b[_0x905d('0x40')]=[{'all':!![]}];}_0x1dae0b=_['merge']({},_0x1dae0b,_0x4f560d[_0x905d('0x41')]);return db['VtigerAccount'][_0x905d('0x42')](_0x1dae0b)['then'](handleEntityNotFound(_0x20c4be,null))[_0x905d('0x1f')](respondWithResult(_0x20c4be,null))[_0x905d('0x3d')](handleError(_0x20c4be,null));};exports['create']=function(_0x44bd79,_0x1f79f5){return db['VtigerAccount'][_0x905d('0x43')](_0x44bd79[_0x905d('0x44')],{})[_0x905d('0x1f')](respondWithResult(_0x1f79f5,0xc9))['catch'](handleError(_0x1f79f5,null));};exports['update']=function(_0x3e4454,_0x3b3b4f){if(_0x3e4454[_0x905d('0x44')]['id']){delete _0x3e4454['body']['id'];}return db['VtigerAccount'][_0x905d('0x42')]({'where':{'id':_0x3e4454[_0x905d('0x3e')]['id']}})[_0x905d('0x1f')](handleEntityNotFound(_0x3b3b4f,null))[_0x905d('0x1f')](saveUpdates(_0x3e4454['body'],null))[_0x905d('0x1f')](respondWithResult(_0x3b3b4f,null))[_0x905d('0x3d')](handleError(_0x3b3b4f,null));};exports[_0x905d('0x45')]=function(_0x3852d4,_0x36d909){return db['VtigerAccount'][_0x905d('0x42')]({'where':{'id':_0x3852d4[_0x905d('0x3e')]['id']}})[_0x905d('0x1f')](handleEntityNotFound(_0x36d909,null))[_0x905d('0x1f')](removeEntity(_0x36d909,null))[_0x905d('0x3d')](handleError(_0x36d909,null));};exports[_0x905d('0x46')]=function(_0xa58de3,_0x57567a,_0x29a396){var _0x4d4ee9={};var _0xf785de={};var _0x4d79a1;var _0x14ff92;return db['VtigerAccount'][_0x905d('0x47')]({'where':{'id':_0xa58de3[_0x905d('0x3e')]['id']}})[_0x905d('0x1f')](handleEntityNotFound(_0x57567a,null))[_0x905d('0x1f')](function(_0x4f0b04){if(_0x4f0b04){_0x4d79a1=_0x4f0b04;_0xf785de['model']=_[_0x905d('0x2b')](db[_0x905d('0x48')][_0x905d('0x26')]);_0xf785de[_0x905d('0x2a')]=_[_0x905d('0x2b')](_0xa58de3[_0x905d('0x2a')]);_0xf785de['filters']=_[_0x905d('0x2d')](_0xf785de['model'],_0xf785de[_0x905d('0x2a')]);_0x4d4ee9['attributes']=_['intersection'](_0xf785de[_0x905d('0x29')],qs[_0x905d('0x2f')](_0xa58de3['query']['fields']));_0x4d4ee9[_0x905d('0x2e')]=_0x4d4ee9['attributes']['length']?_0x4d4ee9[_0x905d('0x2e')]:_0xf785de[_0x905d('0x29')];_0x4d4ee9['order']=qs[_0x905d('0x34')](_0xa58de3[_0x905d('0x2a')]['sort']);_0x4d4ee9[_0x905d('0x38')]=qs['filters'](_[_0x905d('0x35')](_0xa58de3[_0x905d('0x2a')],_0xf785de[_0x905d('0x2c')]));if(_0xa58de3[_0x905d('0x2a')][_0x905d('0x36')]){_0x4d4ee9[_0x905d('0x38')]=_[_0x905d('0x37')](_0x4d4ee9[_0x905d('0x38')],{'$or':_[_0x905d('0x24')](_0x4d4ee9[_0x905d('0x2e')],function(_0x22815a){var _0x4afab8={};_0x4afab8[_0x22815a]={'$like':'%'+_0xa58de3[_0x905d('0x2a')][_0x905d('0x36')]+'%'};return _0x4afab8;})});}_0x4d4ee9=_[_0x905d('0x37')]({},_0x4d4ee9,_0xa58de3[_0x905d('0x41')]);return _0x4d79a1[_0x905d('0x46')](_0x4d4ee9);}})['then'](function(_0x3038bf){if(_0x3038bf){_0x14ff92=_0x3038bf[_0x905d('0x30')];if(!_0xa58de3[_0x905d('0x2a')][_0x905d('0x31')]('nolimit')){_0x4d4ee9[_0x905d('0x19')]=qs[_0x905d('0x19')](_0xa58de3[_0x905d('0x2a')]['limit']);_0x4d4ee9[_0x905d('0x17')]=qs[_0x905d('0x17')](_0xa58de3[_0x905d('0x2a')][_0x905d('0x17')]);}return _0x4d79a1[_0x905d('0x46')](_0x4d4ee9);}})[_0x905d('0x1f')](function(_0x3ca1c5){if(_0x3ca1c5){return _0x3ca1c5?{'count':_0x14ff92,'rows':_0x3ca1c5}:null;}})['then'](respondWithResult(_0x57567a,null))[_0x905d('0x3d')](handleError(_0x57567a,null));};exports[_0x905d('0x49')]=function(_0x592abb,_0x524836,_0x2b55de){if(_0x592abb['body']['id']){delete _0x592abb[_0x905d('0x44')]['id'];}return db[_0x905d('0x25')]['findOne']({'where':{'id':_0x592abb[_0x905d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x524836,null))[_0x905d('0x1f')](function(_0x29d85d){if(_0x29d85d){_0x592abb[_0x905d('0x44')]['AccountId']=_0x29d85d['id'];_0x592abb[_0x905d('0x44')][_0x905d('0x4a')]=integrations[_0x905d('0x4b')](_0x592abb[_0x905d('0x44')][_0x905d('0x4c')],_0x592abb['body']['type']);_0x592abb[_0x905d('0x44')]['Descriptions']=integrations[_0x905d('0x4d')](_0x592abb['body'][_0x905d('0x4c')],_0x592abb['body'][_0x905d('0x39')]);return db[_0x905d('0x48')]['create'](_0x592abb[_0x905d('0x44')],{'include':[{'model':db[_0x905d('0x4e')],'as':_0x905d('0x4a')},{'model':db[_0x905d('0x4e')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x524836,null))[_0x905d('0x3d')](handleError(_0x524836,null));};var md5=require(_0x905d('0x4f'));exports[_0x905d('0x50')]=function(_0x264de0,_0x287442,_0x4524b3){var _0x12d612=null;var _0x5b275e=null;var _0x28930e=null;var _0x2aa525=null;var _0x2cd0ee='';return db['VtigerAccount'][_0x905d('0x47')]({'where':{'id':_0x264de0[_0x905d('0x3e')]['id']},'attributes':['id',_0x905d('0x22'),'username','description',_0x905d('0x51'),_0x905d('0x52'),_0x905d('0x53'),'accessKey']})['then'](handleEntityNotFound(_0x287442,null))[_0x905d('0x1f')](function(_0x1299ad){if(_0x1299ad){_0x12d612=_0x1299ad['username'];_0x5b275e=_0x1299ad[_0x905d('0x54')];_0x28930e=_0x1299ad[_0x905d('0x51')];_0x2cd0ee=_0x1299ad[_0x905d('0x52')];var _0x41593c=_0x2cd0ee[_0x905d('0x55')](-0x1);if(_0x41593c==='/'){_0x2cd0ee=_0x2cd0ee[_0x905d('0x56')](0x0,_0x2cd0ee[_0x905d('0x57')](_0x41593c));}_0x2aa525=util[_0x905d('0x58')](_0x905d('0x59'),_0x2cd0ee);var _0x2dc9c5={'method':_0x905d('0x5a'),'uri':_0x2aa525,'qs':{'operation':'getchallenge','username':_0x1299ad[_0x905d('0x5b')]},'json':!![]};return rp(_0x2dc9c5);}})[_0x905d('0x1f')](function(_0x14c28b){if(_0x14c28b[_0x905d('0x5c')]){var _0x490ff7={'method':_0x905d('0x5d'),'uri':_0x2aa525,'form':{'operation':_0x905d('0x5e'),'username':_0x12d612,'accessKey':md5(_0x14c28b[_0x905d('0x5f')]['token']+_0x5b275e)},'json':!![]};return rp(_0x490ff7);}})[_0x905d('0x1f')](function(_0xc464b8){if(_0xc464b8[_0x905d('0x5c')]){var _0x2a0857={'method':_0x905d('0x5a'),'uri':_0x2aa525,'qs':{'operation':_0x905d('0x60'),'username':_0x12d612,'sessionName':_0xc464b8[_0x905d('0x5f')][_0x905d('0x61')],'elementType':_0x28930e},'json':!![]};return rp(_0x2a0857);}})['then'](function(_0x398f68){if(_0x398f68[_0x905d('0x5c')]){var _0x303fde=[_0x905d('0x62'),_0x905d('0x63'),'owner'];_[_0x905d('0x64')](_0x398f68[_0x905d('0x5f')][_0x905d('0x2f')],function(_0x36ec88){return _0x303fde[_0x905d('0x65')](_0x36ec88[_0x905d('0x39')][_0x905d('0x22')]);});_['remove'](_0x398f68[_0x905d('0x5f')][_0x905d('0x2f')],function(_0x2cbdf9){return _0x2cbdf9['editable']===_0x905d('0x66');});return{'count':_0x398f68[_0x905d('0x5f')]['fields']['length'],'rows':_[_0x905d('0x24')](_0x398f68[_0x905d('0x5f')]['fields'],function(_0x429cab){return{'id':_0x429cab[_0x905d('0x22')],'name':_0x429cab[_0x905d('0x67')],'custom':_[_0x905d('0x68')](_0x429cab[_0x905d('0x22')],_0x905d('0x69'))?!![]:![],'options':_0x429cab[_0x905d('0x39')][_0x905d('0x22')]===_0x905d('0x6a')&&_0x429cab[_0x905d('0x39')]['picklistValues']['length']>0x0?_['map'](_0x429cab['type'][_0x905d('0x6b')],function(_0x295144){return{'name':_0x295144[_0x905d('0x67')],'value':_0x295144[_0x905d('0x6c')]};}):[]};})};}})['then'](respondWithResult(_0x287442,null))['catch'](function(_0x571527){console[_0x905d('0x6d')](_0x905d('0x6e')+_0x571527);var _0x52744e=_0x264de0[_0x905d('0x2a')][_0x905d('0x6f')]?0x1f4:_0x571527[_0x905d('0x70')]||0x1f4;logger[_0x905d('0x20')](_0x905d('0x71'),_0x905d('0x50'),_0x52744e,JSON[_0x905d('0x72')](_0x571527));delete _0x571527[_0x905d('0x22')];if(_0x52744e===0x191){_0x52744e=0x190;}_0x287442['status'](_0x52744e)[_0x905d('0x23')](_0x264de0['query'][_0x905d('0x6f')]?{'message':_0x905d('0x73'),'statusCode':_0x571527['statusCode']}:_0x571527);});}; \ No newline at end of file +var _0x02aa=['rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','limit','count','set','apply','reject','save','then','destroy','end','error','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','options','includeAll','include','rows','show','params','find','catch','create','update','body','getConfigurations','findOne','nolimit','AccountId','getSubjects','channel','getDescriptions','VtigerConfiguration','Subjects','md5','getFields','description','moduleName','remoteUri','serverUrl','username','slice','format','%s/webservice.php','GET','getchallenge','success','POST','login','result','token','describe','sessionName','autogenerated','owner','remove','includes','editable','false','label','startsWith','picklist','picklistValues','value','vTiger\x20error:\x20','statusCode','stringify','test','Wrong\x20credentials'];(function(_0x117f18,_0x43cb2b){var _0x2d04e6=function(_0x15f1f7){while(--_0x15f1f7){_0x117f18['push'](_0x117f18['shift']());}};_0x2d04e6(++_0x43cb2b);}(_0x02aa,0x1cc));var _0xa02a=function(_0xde1b5,_0x291eca){_0xde1b5=_0xde1b5-0x0;var _0x52cd92=_0x02aa[_0xde1b5];return _0x52cd92;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa02a('0x0'));var zipdir=require(_0xa02a('0x1'));var jsonpatch=require(_0xa02a('0x2'));var rp=require('request-promise');var moment=require(_0xa02a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa02a('0x4'));var util=require(_0xa02a('0x5'));var path=require(_0xa02a('0x6'));var sox=require(_0xa02a('0x7'));var csv=require(_0xa02a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xa02a('0x9'));var crypto=require(_0xa02a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xa02a('0xb'));var toCsv=require(_0xa02a('0x8'));var querystring=require('querystring');var Papa=require(_0xa02a('0xc'));var Redis=require(_0xa02a('0xd'));var authService=require(_0xa02a('0xe'));var qs=require(_0xa02a('0xf'));var as=require(_0xa02a('0x10'));var hardwareService=require(_0xa02a('0x11'));var logger=require('../../config/logger')(_0xa02a('0x12'));var utils=require(_0xa02a('0x13'));var config=require(_0xa02a('0x14'));var licenseUtil=require(_0xa02a('0x15'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa02a('0x16'));function respondWithStatusCode(_0x1dc47d,_0x244034){_0x244034=_0x244034||0xcc;return function(_0x2cd1bc){if(_0x2cd1bc){return _0x1dc47d[_0xa02a('0x17')](_0x244034);}return _0x1dc47d[_0xa02a('0x18')](_0x244034)['end']();};}function respondWithResult(_0x5b2979,_0xdd5623){_0xdd5623=_0xdd5623||0xc8;return function(_0x155676){if(_0x155676){return _0x5b2979[_0xa02a('0x18')](_0xdd5623)['json'](_0x155676);}};}function respondWithFilteredResult(_0x5ed773,_0x321c14){return function(_0x1ff189){if(_0x1ff189){var _0x98e2d5=typeof _0x321c14[_0xa02a('0x19')]==='undefined'&&typeof _0x321c14[_0xa02a('0x1a')]==='undefined';var _0x253ff6=_0x1ff189['count'];var _0x581e1d=_0x98e2d5?0x0:_0x321c14[_0xa02a('0x19')];var _0x1db9bc=_0x98e2d5?_0x1ff189[_0xa02a('0x1b')]:_0x321c14[_0xa02a('0x19')]+_0x321c14[_0xa02a('0x1a')];var _0x41f33e;if(_0x1db9bc>=_0x253ff6){_0x1db9bc=_0x253ff6;_0x41f33e=0xc8;}else{_0x41f33e=0xce;}_0x5ed773[_0xa02a('0x18')](_0x41f33e);return _0x5ed773[_0xa02a('0x1c')]('Content-Range',_0x581e1d+'-'+_0x1db9bc+'/'+_0x253ff6)['json'](_0x1ff189);}return null;};}function patchUpdates(_0x1be383){return function(_0x31e570){try{jsonpatch[_0xa02a('0x1d')](_0x31e570,_0x1be383,!![]);}catch(_0x351a09){return BPromise[_0xa02a('0x1e')](_0x351a09);}return _0x31e570[_0xa02a('0x1f')]();};}function saveUpdates(_0x527f74,_0xe7a1d7){return function(_0x5af51a){if(_0x5af51a){return _0x5af51a['update'](_0x527f74)[_0xa02a('0x20')](function(_0x865547){return _0x865547;});}return null;};}function removeEntity(_0x33816b,_0x5a7ebf){return function(_0x1f559b){if(_0x1f559b){return _0x1f559b[_0xa02a('0x21')]()[_0xa02a('0x20')](function(){_0x33816b[_0xa02a('0x18')](0xcc)[_0xa02a('0x22')]();});}};}function handleEntityNotFound(_0x3b1b52,_0x11b1ea){return function(_0x157880){if(!_0x157880){_0x3b1b52[_0xa02a('0x17')](0x194);}return _0x157880;};}function handleError(_0x2282fd,_0x21821a){_0x21821a=_0x21821a||0x1f4;return function(_0x4632db){logger[_0xa02a('0x23')](_0x4632db['stack']);if(_0x4632db[_0xa02a('0x24')]){delete _0x4632db[_0xa02a('0x24')];}_0x2282fd[_0xa02a('0x18')](_0x21821a)[_0xa02a('0x25')](_0x4632db);};}exports[_0xa02a('0x26')]=function(_0x596df8,_0x41c59b){var _0x3ca29e={},_0x47eea1={},_0xfed710={'count':0x0,'rows':[]};var _0x28d334=_[_0xa02a('0x27')](db[_0xa02a('0x28')][_0xa02a('0x29')],function(_0x3ff9ed){return{'name':_0x3ff9ed[_0xa02a('0x2a')],'type':_0x3ff9ed[_0xa02a('0x2b')][_0xa02a('0x2c')]};});_0x47eea1[_0xa02a('0x2d')]=_['map'](_0x28d334,_0xa02a('0x24'));_0x47eea1['query']=_[_0xa02a('0x2e')](_0x596df8['query']);_0x47eea1['filters']=_[_0xa02a('0x2f')](_0x47eea1[_0xa02a('0x2d')],_0x47eea1[_0xa02a('0x30')]);_0x3ca29e[_0xa02a('0x31')]=_[_0xa02a('0x2f')](_0x47eea1['model'],qs[_0xa02a('0x32')](_0x596df8[_0xa02a('0x30')][_0xa02a('0x32')]));_0x3ca29e['attributes']=_0x3ca29e['attributes'][_0xa02a('0x33')]?_0x3ca29e[_0xa02a('0x31')]:_0x47eea1[_0xa02a('0x2d')];if(!_0x596df8['query'][_0xa02a('0x34')]('nolimit')){_0x3ca29e[_0xa02a('0x1a')]=qs[_0xa02a('0x1a')](_0x596df8[_0xa02a('0x30')]['limit']);_0x3ca29e['offset']=qs['offset'](_0x596df8[_0xa02a('0x30')][_0xa02a('0x19')]);}_0x3ca29e[_0xa02a('0x35')]=qs[_0xa02a('0x36')](_0x596df8[_0xa02a('0x30')][_0xa02a('0x36')]);_0x3ca29e[_0xa02a('0x37')]=qs['filters'](_[_0xa02a('0x38')](_0x596df8[_0xa02a('0x30')],_0x47eea1[_0xa02a('0x39')]),_0x28d334);if(_0x596df8[_0xa02a('0x30')][_0xa02a('0x3a')]){_0x3ca29e[_0xa02a('0x37')]=_[_0xa02a('0x3b')](_0x3ca29e[_0xa02a('0x37')],{'$or':_[_0xa02a('0x27')](_0x28d334,function(_0x23d3e8){if(_0x23d3e8[_0xa02a('0x2b')]!=='VIRTUAL'){var _0x8cbfb8={};_0x8cbfb8[_0x23d3e8[_0xa02a('0x24')]]={'$like':'%'+_0x596df8[_0xa02a('0x30')][_0xa02a('0x3a')]+'%'};return _0x8cbfb8;}})});}_0x3ca29e=_[_0xa02a('0x3b')]({},_0x3ca29e,_0x596df8[_0xa02a('0x3c')]);var _0x50e9a8={'where':_0x3ca29e[_0xa02a('0x37')]};return db[_0xa02a('0x28')]['count'](_0x50e9a8)[_0xa02a('0x20')](function(_0x462fdd){_0xfed710[_0xa02a('0x1b')]=_0x462fdd;if(_0x596df8[_0xa02a('0x30')][_0xa02a('0x3d')]){_0x3ca29e[_0xa02a('0x3e')]=[{'all':!![]}];}return db[_0xa02a('0x28')]['findAll'](_0x3ca29e);})[_0xa02a('0x20')](function(_0x18d987){_0xfed710[_0xa02a('0x3f')]=_0x18d987;return _0xfed710;})[_0xa02a('0x20')](respondWithFilteredResult(_0x41c59b,_0x3ca29e))['catch'](handleError(_0x41c59b,null));};exports[_0xa02a('0x40')]=function(_0x590ea0,_0x59a407){var _0x4f9994={'raw':![],'where':{'id':_0x590ea0[_0xa02a('0x41')]['id']}},_0x15324e={};_0x15324e['model']=_[_0xa02a('0x2e')](db[_0xa02a('0x28')]['rawAttributes']);_0x15324e[_0xa02a('0x30')]=_[_0xa02a('0x2e')](_0x590ea0['query']);_0x15324e[_0xa02a('0x39')]=_[_0xa02a('0x2f')](_0x15324e[_0xa02a('0x2d')],_0x15324e[_0xa02a('0x30')]);_0x4f9994[_0xa02a('0x31')]=_[_0xa02a('0x2f')](_0x15324e[_0xa02a('0x2d')],qs[_0xa02a('0x32')](_0x590ea0[_0xa02a('0x30')][_0xa02a('0x32')]));_0x4f9994[_0xa02a('0x31')]=_0x4f9994['attributes'][_0xa02a('0x33')]?_0x4f9994[_0xa02a('0x31')]:_0x15324e[_0xa02a('0x2d')];if(_0x590ea0['query'][_0xa02a('0x3d')]){_0x4f9994['include']=[{'all':!![]}];}_0x4f9994=_[_0xa02a('0x3b')]({},_0x4f9994,_0x590ea0[_0xa02a('0x3c')]);return db[_0xa02a('0x28')][_0xa02a('0x42')](_0x4f9994)[_0xa02a('0x20')](handleEntityNotFound(_0x59a407,null))[_0xa02a('0x20')](respondWithResult(_0x59a407,null))[_0xa02a('0x43')](handleError(_0x59a407,null));};exports[_0xa02a('0x44')]=function(_0x1c8989,_0x108f2f){return db[_0xa02a('0x28')][_0xa02a('0x44')](_0x1c8989['body'],{})['then'](respondWithResult(_0x108f2f,0xc9))[_0xa02a('0x43')](handleError(_0x108f2f,null));};exports[_0xa02a('0x45')]=function(_0x43d834,_0x648b01){if(_0x43d834[_0xa02a('0x46')]['id']){delete _0x43d834[_0xa02a('0x46')]['id'];}return db['VtigerAccount'][_0xa02a('0x42')]({'where':{'id':_0x43d834[_0xa02a('0x41')]['id']}})[_0xa02a('0x20')](handleEntityNotFound(_0x648b01,null))[_0xa02a('0x20')](saveUpdates(_0x43d834[_0xa02a('0x46')],null))[_0xa02a('0x20')](respondWithResult(_0x648b01,null))[_0xa02a('0x43')](handleError(_0x648b01,null));};exports[_0xa02a('0x21')]=function(_0x176ba6,_0x6be99c){return db[_0xa02a('0x28')][_0xa02a('0x42')]({'where':{'id':_0x176ba6[_0xa02a('0x41')]['id']}})['then'](handleEntityNotFound(_0x6be99c,null))[_0xa02a('0x20')](removeEntity(_0x6be99c,null))[_0xa02a('0x43')](handleError(_0x6be99c,null));};exports[_0xa02a('0x47')]=function(_0xa95d1f,_0x4accfe,_0x5d5ebb){var _0x3f6cd6={};var _0x49e2d0={};var _0x37a2c0;var _0x3c30a0;return db[_0xa02a('0x28')][_0xa02a('0x48')]({'where':{'id':_0xa95d1f[_0xa02a('0x41')]['id']}})[_0xa02a('0x20')](handleEntityNotFound(_0x4accfe,null))[_0xa02a('0x20')](function(_0x1a91f8){if(_0x1a91f8){_0x37a2c0=_0x1a91f8;_0x49e2d0['model']=_['keys'](db['VtigerConfiguration'][_0xa02a('0x29')]);_0x49e2d0[_0xa02a('0x30')]=_[_0xa02a('0x2e')](_0xa95d1f[_0xa02a('0x30')]);_0x49e2d0[_0xa02a('0x39')]=_[_0xa02a('0x2f')](_0x49e2d0[_0xa02a('0x2d')],_0x49e2d0[_0xa02a('0x30')]);_0x3f6cd6[_0xa02a('0x31')]=_['intersection'](_0x49e2d0['model'],qs[_0xa02a('0x32')](_0xa95d1f['query'][_0xa02a('0x32')]));_0x3f6cd6['attributes']=_0x3f6cd6[_0xa02a('0x31')][_0xa02a('0x33')]?_0x3f6cd6[_0xa02a('0x31')]:_0x49e2d0[_0xa02a('0x2d')];_0x3f6cd6[_0xa02a('0x35')]=qs[_0xa02a('0x36')](_0xa95d1f[_0xa02a('0x30')]['sort']);_0x3f6cd6[_0xa02a('0x37')]=qs[_0xa02a('0x39')](_['pick'](_0xa95d1f[_0xa02a('0x30')],_0x49e2d0[_0xa02a('0x39')]));if(_0xa95d1f[_0xa02a('0x30')]['filter']){_0x3f6cd6[_0xa02a('0x37')]=_['merge'](_0x3f6cd6[_0xa02a('0x37')],{'$or':_['map'](_0x3f6cd6['attributes'],function(_0x498f13){var _0x4dcf77={};_0x4dcf77[_0x498f13]={'$like':'%'+_0xa95d1f[_0xa02a('0x30')][_0xa02a('0x3a')]+'%'};return _0x4dcf77;})});}_0x3f6cd6=_[_0xa02a('0x3b')]({},_0x3f6cd6,_0xa95d1f['options']);return _0x37a2c0[_0xa02a('0x47')](_0x3f6cd6);}})[_0xa02a('0x20')](function(_0x3c87fc){if(_0x3c87fc){_0x3c30a0=_0x3c87fc[_0xa02a('0x33')];if(!_0xa95d1f[_0xa02a('0x30')]['hasOwnProperty'](_0xa02a('0x49'))){_0x3f6cd6[_0xa02a('0x1a')]=qs[_0xa02a('0x1a')](_0xa95d1f['query']['limit']);_0x3f6cd6[_0xa02a('0x19')]=qs['offset'](_0xa95d1f[_0xa02a('0x30')][_0xa02a('0x19')]);}return _0x37a2c0['getConfigurations'](_0x3f6cd6);}})[_0xa02a('0x20')](function(_0x4afc81){if(_0x4afc81){return _0x4afc81?{'count':_0x3c30a0,'rows':_0x4afc81}:null;}})['then'](respondWithResult(_0x4accfe,null))[_0xa02a('0x43')](handleError(_0x4accfe,null));};exports['addConfiguration']=function(_0x105fc7,_0x5cd788,_0x21bc65){if(_0x105fc7[_0xa02a('0x46')]['id']){delete _0x105fc7[_0xa02a('0x46')]['id'];}return db[_0xa02a('0x28')]['findOne']({'where':{'id':_0x105fc7['params']['id']}})[_0xa02a('0x20')](handleEntityNotFound(_0x5cd788,null))[_0xa02a('0x20')](function(_0x1407cf){if(_0x1407cf){_0x105fc7[_0xa02a('0x46')][_0xa02a('0x4a')]=_0x1407cf['id'];_0x105fc7['body']['Subjects']=integrations[_0xa02a('0x4b')](_0x105fc7[_0xa02a('0x46')][_0xa02a('0x4c')],_0x105fc7['body']['type']);_0x105fc7['body']['Descriptions']=integrations[_0xa02a('0x4d')](_0x105fc7[_0xa02a('0x46')][_0xa02a('0x4c')],_0x105fc7['body'][_0xa02a('0x2b')]);return db[_0xa02a('0x4e')][_0xa02a('0x44')](_0x105fc7[_0xa02a('0x46')],{'include':[{'model':db['VtigerField'],'as':_0xa02a('0x4f')},{'model':db['VtigerField'],'as':'Descriptions'}]});}return null;})[_0xa02a('0x20')](respondWithResult(_0x5cd788,null))[_0xa02a('0x43')](handleError(_0x5cd788,null));};var md5=require(_0xa02a('0x50'));exports[_0xa02a('0x51')]=function(_0x30adfa,_0x30685d,_0x3ebc20){var _0x317e81=null;var _0x57eba6=null;var _0x1f40fc=null;var _0x127ba5=null;var _0x16ece1='';return db[_0xa02a('0x28')]['findOne']({'where':{'id':_0x30adfa[_0xa02a('0x41')]['id']},'attributes':['id','name','username',_0xa02a('0x52'),_0xa02a('0x53'),_0xa02a('0x54'),_0xa02a('0x55'),'accessKey']})['then'](handleEntityNotFound(_0x30685d,null))['then'](function(_0x2080cd){if(_0x2080cd){_0x317e81=_0x2080cd[_0xa02a('0x56')];_0x57eba6=_0x2080cd['accessKey'];_0x1f40fc=_0x2080cd[_0xa02a('0x53')];_0x16ece1=_0x2080cd[_0xa02a('0x54')];var _0x965bef=_0x16ece1[_0xa02a('0x57')](-0x1);if(_0x965bef==='/'){_0x16ece1=_0x16ece1['substring'](0x0,_0x16ece1['lastIndexOf'](_0x965bef));}_0x127ba5=util[_0xa02a('0x58')](_0xa02a('0x59'),_0x16ece1);var _0x4f9838={'method':_0xa02a('0x5a'),'uri':_0x127ba5,'qs':{'operation':_0xa02a('0x5b'),'username':_0x2080cd[_0xa02a('0x56')]},'json':!![]};return rp(_0x4f9838);}})[_0xa02a('0x20')](function(_0x2c407b){if(_0x2c407b[_0xa02a('0x5c')]){var _0x4fb01b={'method':_0xa02a('0x5d'),'uri':_0x127ba5,'form':{'operation':_0xa02a('0x5e'),'username':_0x317e81,'accessKey':md5(_0x2c407b[_0xa02a('0x5f')][_0xa02a('0x60')]+_0x57eba6)},'json':!![]};return rp(_0x4fb01b);}})['then'](function(_0x39c134){if(_0x39c134[_0xa02a('0x5c')]){var _0x3ab0c8={'method':_0xa02a('0x5a'),'uri':_0x127ba5,'qs':{'operation':_0xa02a('0x61'),'username':_0x317e81,'sessionName':_0x39c134[_0xa02a('0x5f')][_0xa02a('0x62')],'elementType':_0x1f40fc},'json':!![]};return rp(_0x3ab0c8);}})[_0xa02a('0x20')](function(_0x87f0b4){if(_0x87f0b4[_0xa02a('0x5c')]){var _0x1ca3eb=[_0xa02a('0x63'),'reference',_0xa02a('0x64')];_[_0xa02a('0x65')](_0x87f0b4['result']['fields'],function(_0x3cd141){return _0x1ca3eb[_0xa02a('0x66')](_0x3cd141[_0xa02a('0x2b')][_0xa02a('0x24')]);});_[_0xa02a('0x65')](_0x87f0b4[_0xa02a('0x5f')][_0xa02a('0x32')],function(_0x1e9872){return _0x1e9872[_0xa02a('0x67')]===_0xa02a('0x68');});return{'count':_0x87f0b4[_0xa02a('0x5f')]['fields'][_0xa02a('0x33')],'rows':_[_0xa02a('0x27')](_0x87f0b4[_0xa02a('0x5f')][_0xa02a('0x32')],function(_0x3d8ae0){return{'id':_0x3d8ae0[_0xa02a('0x24')],'name':_0x3d8ae0[_0xa02a('0x69')],'custom':_[_0xa02a('0x6a')](_0x3d8ae0['name'],'cf_')?!![]:![],'options':_0x3d8ae0[_0xa02a('0x2b')]['name']===_0xa02a('0x6b')&&_0x3d8ae0['type'][_0xa02a('0x6c')][_0xa02a('0x33')]>0x0?_[_0xa02a('0x27')](_0x3d8ae0['type'][_0xa02a('0x6c')],function(_0x53f46b){return{'name':_0x53f46b[_0xa02a('0x69')],'value':_0x53f46b[_0xa02a('0x6d')]};}):[]};})};}})['then'](respondWithResult(_0x30685d,null))[_0xa02a('0x43')](function(_0x4d88db){console['log'](_0xa02a('0x6e')+_0x4d88db);var _0x44a8d8=_0x30adfa['query']['test']?0x1f4:_0x4d88db[_0xa02a('0x6f')]||0x1f4;logger[_0xa02a('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0xa02a('0x51'),_0x44a8d8,JSON[_0xa02a('0x70')](_0x4d88db));delete _0x4d88db['name'];if(_0x44a8d8===0x191){_0x44a8d8=0x190;}_0x30685d[_0xa02a('0x18')](_0x44a8d8)[_0xa02a('0x25')](_0x30adfa[_0xa02a('0x30')][_0xa02a('0x71')]?{'message':_0xa02a('0x72'),'statusCode':_0x4d88db[_0xa02a('0x6f')]}:_0x4d88db);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index e7ddd6a..d588011 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 _0x8371=['moment','path','rimraf','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','util','api'];(function(_0xda3f86,_0x32c86c){var _0x1bcc40=function(_0x47a384){while(--_0x47a384){_0xda3f86['push'](_0xda3f86['shift']());}};_0x1bcc40(++_0x32c86c);}(_0x8371,0x1b5));var _0x1837=function(_0x572c85,_0x4bd93e){_0x572c85=_0x572c85-0x0;var _0x46a4ac=_0x8371[_0x572c85];return _0x46a4ac;};'use strict';var _=require(_0x1837('0x0'));var util=require(_0x1837('0x1'));var logger=require('../../config/logger')(_0x1837('0x2'));var moment=require(_0x1837('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1837('0x4'));var rimraf=require(_0x1837('0x5'));var config=require('../../config/environment');var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x1837('0x6'));module[_0x1837('0x7')]=function(_0x3d31a6,_0x20e28e){return _0x3d31a6[_0x1837('0x8')](_0x1837('0x9'),attributes,{'tableName':_0x1837('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2c78=['../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','VtigerAccount','int_vtiger_accounts','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x50e1aa,_0x15aba8){var _0x8a2196=function(_0x17b7c7){while(--_0x17b7c7){_0x50e1aa['push'](_0x50e1aa['shift']());}};_0x8a2196(++_0x15aba8);}(_0x2c78,0x17f));var _0x82c7=function(_0x12d79d,_0x3c4f12){_0x12d79d=_0x12d79d-0x0;var _0x5cbe01=_0x2c78[_0x12d79d];return _0x5cbe01;};'use strict';var _=require('lodash');var util=require(_0x82c7('0x0'));var logger=require(_0x82c7('0x1'))('api');var moment=require(_0x82c7('0x2'));var BPromise=require(_0x82c7('0x3'));var rp=require(_0x82c7('0x4'));var fs=require('fs');var path=require(_0x82c7('0x5'));var rimraf=require(_0x82c7('0x6'));var config=require(_0x82c7('0x7'));var attributes=require(_0x82c7('0x8'));var integrations=require(_0x82c7('0x9'));module[_0x82c7('0xa')]=function(_0x4057c3,_0xf307d1){return _0x4057c3['define'](_0x82c7('0xb'),attributes,{'tableName':_0x82c7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.rpc.js b/server/api/intVtigerAccount/intVtigerAccount.rpc.js index 4ed4177..a26d740 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 _0xa478=['info','request\x20sent','debug','error','code','message','VtigerAccount,\x20%s,\x20%s','result','catch','GetVtigerAccount','findAll','options','raw','where','attributes','include','map','model','VtigerAccount','find','ShowVtigerAccount','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then'];(function(_0x4cc0bc,_0x5679b5){var _0x2d45f4=function(_0x5398e7){while(--_0x5398e7){_0x4cc0bc['push'](_0x4cc0bc['shift']());}};_0x2d45f4(++_0x5679b5);}(_0xa478,0x136));var _0x8a47=function(_0x3e3221,_0x392851){_0x3e3221=_0x3e3221-0x0;var _0x190da4=_0xa478[_0x3e3221];return _0x190da4;};'use strict';var _=require(_0x8a47('0x0'));var util=require(_0x8a47('0x1'));var moment=require(_0x8a47('0x2'));var BPromise=require(_0x8a47('0x3'));var rs=require(_0x8a47('0x4'));var fs=require('fs');var Redis=require(_0x8a47('0x5'));var db=require(_0x8a47('0x6'))['db'];var utils=require(_0x8a47('0x7'));var logger=require(_0x8a47('0x8'))(_0x8a47('0x9'));var config=require(_0x8a47('0xa'));var jayson=require(_0x8a47('0xb'));var client=jayson['client'][_0x8a47('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d62a6,_0x3de815,_0x3cb340){return new BPromise(function(_0x56884b,_0x384886){return client['request'](_0x2d62a6,_0x3cb340)[_0x8a47('0xd')](function(_0x369fc9){logger[_0x8a47('0xe')]('VtigerAccount,\x20%s,\x20%s',_0x3de815,_0x8a47('0xf'));logger[_0x8a47('0x10')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x3de815,_0x8a47('0xf'),JSON['stringify'](_0x369fc9));if(_0x369fc9[_0x8a47('0x11')]){if(_0x369fc9[_0x8a47('0x11')][_0x8a47('0x12')]===0x1f4){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x3de815,_0x369fc9['error'][_0x8a47('0x13')]);return _0x384886(_0x369fc9[_0x8a47('0x11')]['message']);}logger[_0x8a47('0x11')](_0x8a47('0x14'),_0x3de815,_0x369fc9[_0x8a47('0x11')][_0x8a47('0x13')]);return _0x56884b(_0x369fc9[_0x8a47('0x11')][_0x8a47('0x13')]);}else{logger[_0x8a47('0xe')](_0x8a47('0x14'),_0x3de815,_0x8a47('0xf'));_0x56884b(_0x369fc9[_0x8a47('0x15')][_0x8a47('0x13')]);}})[_0x8a47('0x16')](function(_0x2917d9){logger['error'](_0x8a47('0x14'),_0x3de815,_0x2917d9);_0x384886(_0x2917d9);});});}exports[_0x8a47('0x17')]=function(_0x3f9093){var _0x5f5884=this;return new Promise(function(_0x341089,_0x5c62eb){return db['VtigerAccount'][_0x8a47('0x18')]({'raw':_0x3f9093[_0x8a47('0x19')]?_0x3f9093[_0x8a47('0x19')][_0x8a47('0x1a')]===undefined?!![]:![]:!![],'where':_0x3f9093[_0x8a47('0x19')]?_0x3f9093[_0x8a47('0x19')][_0x8a47('0x1b')]||null:null,'attributes':_0x3f9093[_0x8a47('0x19')]?_0x3f9093[_0x8a47('0x19')][_0x8a47('0x1c')]||null:null,'limit':_0x3f9093['options']?_0x3f9093[_0x8a47('0x19')]['limit']||null:null,'include':_0x3f9093[_0x8a47('0x19')]?_0x3f9093[_0x8a47('0x19')][_0x8a47('0x1d')]?_[_0x8a47('0x1e')](_0x3f9093['options'][_0x8a47('0x1d')],function(_0x5ae186){return{'model':db[_0x5ae186['model']],'as':_0x5ae186['as'],'attributes':_0x5ae186['attributes'],'include':_0x5ae186['include']?_[_0x8a47('0x1e')](_0x5ae186[_0x8a47('0x1d')],function(_0x5bed3e){return{'model':db[_0x5bed3e[_0x8a47('0x1f')]],'as':_0x5bed3e['as'],'attributes':_0x5bed3e[_0x8a47('0x1c')],'include':_0x5bed3e[_0x8a47('0x1d')]?_[_0x8a47('0x1e')](_0x5bed3e[_0x8a47('0x1d')],function(_0xd06be6){return{'model':db[_0xd06be6[_0x8a47('0x1f')]],'as':_0xd06be6['as'],'attributes':_0xd06be6['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a47('0xd')](function(_0x4a10c3){logger[_0x8a47('0xe')](_0x8a47('0x17'),_0x3f9093);logger['debug'](_0x8a47('0x17'),_0x3f9093,JSON['stringify'](_0x4a10c3));_0x341089(_0x4a10c3);})['catch'](function(_0x12470a){logger[_0x8a47('0x11')](_0x8a47('0x17'),_0x12470a[_0x8a47('0x13')],_0x3f9093);_0x5c62eb(_0x5f5884[_0x8a47('0x11')](0x1f4,_0x12470a[_0x8a47('0x13')]));});});};exports['ShowVtigerAccount']=function(_0x353576){var _0x4d78b5=this;return new Promise(function(_0x549913,_0x448459){return db[_0x8a47('0x20')][_0x8a47('0x21')]({'raw':_0x353576[_0x8a47('0x19')]?_0x353576[_0x8a47('0x19')][_0x8a47('0x1a')]===undefined?!![]:![]:!![],'where':_0x353576[_0x8a47('0x19')]?_0x353576[_0x8a47('0x19')][_0x8a47('0x1b')]||null:null,'attributes':_0x353576[_0x8a47('0x19')]?_0x353576['options'][_0x8a47('0x1c')]||null:null,'include':_0x353576[_0x8a47('0x19')]?_0x353576[_0x8a47('0x19')]['include']?_[_0x8a47('0x1e')](_0x353576[_0x8a47('0x19')]['include'],function(_0xa1a852){return{'model':db[_0xa1a852[_0x8a47('0x1f')]],'as':_0xa1a852['as'],'attributes':_0xa1a852[_0x8a47('0x1c')],'include':_0xa1a852[_0x8a47('0x1d')]?_['map'](_0xa1a852['include'],function(_0x145908){return{'model':db[_0x145908[_0x8a47('0x1f')]],'as':_0x145908['as'],'attributes':_0x145908[_0x8a47('0x1c')],'include':_0x145908[_0x8a47('0x1d')]?_[_0x8a47('0x1e')](_0x145908[_0x8a47('0x1d')],function(_0x1819ef){return{'model':db[_0x1819ef['model']],'as':_0x1819ef['as'],'attributes':_0x1819ef['attributes']};}):[]};}):[]};}):[]:[]})[_0x8a47('0xd')](function(_0x3636af){logger[_0x8a47('0xe')](_0x8a47('0x22'),_0x353576);logger[_0x8a47('0x10')](_0x8a47('0x22'),_0x353576,JSON[_0x8a47('0x23')](_0x3636af));_0x549913(_0x3636af);})[_0x8a47('0x16')](function(_0xe178f1){logger[_0x8a47('0x11')](_0x8a47('0x22'),_0xe178f1['message'],_0x353576);_0x448459(_0x4d78b5[_0x8a47('0x11')](0x1f4,_0xe178f1['message']));});});}; \ No newline at end of file +var _0xa74f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetVtigerAccount','VtigerAccount','options','raw','where','limit','attributes','include','map','model','ShowVtigerAccount','find','moment'];(function(_0x52ca59,_0x279dda){var _0x1ab7e5=function(_0x2b8c74){while(--_0x2b8c74){_0x52ca59['push'](_0x52ca59['shift']());}};_0x1ab7e5(++_0x279dda);}(_0xa74f,0x9a));var _0xfa74=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xa74f[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa74('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa74('0x1'));var db=require(_0xfa74('0x2'))['db'];var utils=require(_0xfa74('0x3'));var logger=require(_0xfa74('0x4'))('rpc');var config=require(_0xfa74('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa74('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x9ddbd2,_0x3ac32e,_0x2d9fa9){return new BPromise(function(_0x287921,_0x344e04){return client['request'](_0x9ddbd2,_0x2d9fa9)[_0xfa74('0x7')](function(_0x37d4d8){logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,'request\x20sent');logger[_0xfa74('0xa')](_0xfa74('0xb'),_0x3ac32e,'request\x20sent',JSON[_0xfa74('0xc')](_0x37d4d8));if(_0x37d4d8[_0xfa74('0xd')]){if(_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xe')]===0x1f4){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x344e04(_0x37d4d8[_0xfa74('0xd')]['message']);}logger[_0xfa74('0xd')](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x287921(_0x37d4d8[_0xfa74('0xd')]['message']);}else{logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,_0xfa74('0x10'));_0x287921(_0x37d4d8[_0xfa74('0x11')][_0xfa74('0xf')]);}})[_0xfa74('0x12')](function(_0x3b9e32){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x3b9e32);_0x344e04(_0x3b9e32);});});}exports[_0xfa74('0x13')]=function(_0x51dda1){var _0x4928b6=this;return new Promise(function(_0x31d3c1,_0x25a36b){return db[_0xfa74('0x14')]['findAll']({'raw':_0x51dda1[_0xfa74('0x15')]?_0x51dda1[_0xfa74('0x15')][_0xfa74('0x16')]===undefined?!![]:![]:!![],'where':_0x51dda1['options']?_0x51dda1[_0xfa74('0x15')][_0xfa74('0x17')]||null:null,'attributes':_0x51dda1[_0xfa74('0x15')]?_0x51dda1['options']['attributes']||null:null,'limit':_0x51dda1[_0xfa74('0x15')]?_0x51dda1[_0xfa74('0x15')][_0xfa74('0x18')]||null:null,'include':_0x51dda1[_0xfa74('0x15')]?_0x51dda1[_0xfa74('0x15')]['include']?_['map'](_0x51dda1[_0xfa74('0x15')]['include'],function(_0x48cbd3){return{'model':db[_0x48cbd3['model']],'as':_0x48cbd3['as'],'attributes':_0x48cbd3[_0xfa74('0x19')],'include':_0x48cbd3[_0xfa74('0x1a')]?_[_0xfa74('0x1b')](_0x48cbd3['include'],function(_0x530f99){return{'model':db[_0x530f99[_0xfa74('0x1c')]],'as':_0x530f99['as'],'attributes':_0x530f99[_0xfa74('0x19')],'include':_0x530f99['include']?_[_0xfa74('0x1b')](_0x530f99['include'],function(_0x1a8cf7){return{'model':db[_0x1a8cf7[_0xfa74('0x1c')]],'as':_0x1a8cf7['as'],'attributes':_0x1a8cf7['attributes']};}):[]};}):[]};}):[]:[]})[_0xfa74('0x7')](function(_0x1130de){logger[_0xfa74('0x8')](_0xfa74('0x13'),_0x51dda1);logger['debug'](_0xfa74('0x13'),_0x51dda1,JSON[_0xfa74('0xc')](_0x1130de));_0x31d3c1(_0x1130de);})[_0xfa74('0x12')](function(_0x57d90e){logger['error'](_0xfa74('0x13'),_0x57d90e[_0xfa74('0xf')],_0x51dda1);_0x25a36b(_0x4928b6['error'](0x1f4,_0x57d90e['message']));});});};exports[_0xfa74('0x1d')]=function(_0x564060){var _0x2238d4=this;return new Promise(function(_0x4d6d0a,_0x363173){return db[_0xfa74('0x14')][_0xfa74('0x1e')]({'raw':_0x564060[_0xfa74('0x15')]?_0x564060['options'][_0xfa74('0x16')]===undefined?!![]:![]:!![],'where':_0x564060[_0xfa74('0x15')]?_0x564060[_0xfa74('0x15')][_0xfa74('0x17')]||null:null,'attributes':_0x564060[_0xfa74('0x15')]?_0x564060[_0xfa74('0x15')][_0xfa74('0x19')]||null:null,'include':_0x564060['options']?_0x564060[_0xfa74('0x15')]['include']?_[_0xfa74('0x1b')](_0x564060[_0xfa74('0x15')][_0xfa74('0x1a')],function(_0x1b5ff0){return{'model':db[_0x1b5ff0['model']],'as':_0x1b5ff0['as'],'attributes':_0x1b5ff0['attributes'],'include':_0x1b5ff0[_0xfa74('0x1a')]?_[_0xfa74('0x1b')](_0x1b5ff0[_0xfa74('0x1a')],function(_0x25863f){return{'model':db[_0x25863f['model']],'as':_0x25863f['as'],'attributes':_0x25863f[_0xfa74('0x19')],'include':_0x25863f[_0xfa74('0x1a')]?_['map'](_0x25863f['include'],function(_0x557510){return{'model':db[_0x557510['model']],'as':_0x557510['as'],'attributes':_0x557510['attributes']};}):[]};}):[]};}):[]:[]})[_0xfa74('0x7')](function(_0x1c3b44){logger[_0xfa74('0x8')](_0xfa74('0x1d'),_0x564060);logger[_0xfa74('0xa')](_0xfa74('0x1d'),_0x564060,JSON[_0xfa74('0xc')](_0x1c3b44));_0x4d6d0a(_0x1c3b44);})[_0xfa74('0x12')](function(_0x1a2d52){logger['error'](_0xfa74('0x1d'),_0x1a2d52[_0xfa74('0xf')],_0x564060);_0x363173(_0x2238d4[_0xfa74('0xd')](0x1f4,_0x1a2d52[_0xfa74('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index a58ad6f..e755625 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 _0x1bcd=['update','delete','exports','util','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x5ee748,_0x552a2b){var _0x36da37=function(_0x22cc48){while(--_0x22cc48){_0x5ee748['push'](_0x5ee748['shift']());}};_0x36da37(++_0x552a2b);}(_0x1bcd,0x192));var _0xd1bc=function(_0x50d011,_0x6263b){_0x50d011=_0x50d011-0x0;var _0xd37c2e=_0x1bcd[_0x50d011];return _0xd37c2e;};'use strict';var multer=require('multer');var util=require(_0xd1bc('0x0'));var path=require('path');var timeout=require(_0xd1bc('0x1'));var express=require(_0xd1bc('0x2'));var router=express[_0xd1bc('0x3')]();var fs_extra=require(_0xd1bc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd1bc('0x5'));var controller=require('./intVtigerConfiguration.controller');router[_0xd1bc('0x6')]('/',auth[_0xd1bc('0x7')](),controller['index']);router[_0xd1bc('0x6')](_0xd1bc('0x8'),auth['isAuthenticated'](),controller[_0xd1bc('0x9')]);router[_0xd1bc('0x6')](_0xd1bc('0xa'),auth['isAuthenticated'](),controller['getFields']);router[_0xd1bc('0x6')](_0xd1bc('0xb'),auth[_0xd1bc('0x7')](),controller[_0xd1bc('0xc')]);router[_0xd1bc('0x6')](_0xd1bc('0xd'),auth['isAuthenticated'](),controller[_0xd1bc('0xe')]);router[_0xd1bc('0xf')]('/',auth[_0xd1bc('0x7')](),controller[_0xd1bc('0x10')]);router[_0xd1bc('0x11')](_0xd1bc('0x8'),auth[_0xd1bc('0x7')](),controller[_0xd1bc('0x12')]);router[_0xd1bc('0x13')](_0xd1bc('0x8'),auth[_0xd1bc('0x7')](),controller['destroy']);module[_0xd1bc('0x14')]=router; \ No newline at end of file +var _0x5f8e=['post','create','delete','exports','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x5f8e,0x89));var _0xe5f8=function(_0xed4881,_0x45771c){_0xed4881=_0xed4881-0x0;var _0x7fcbd5=_0x5f8e[_0xed4881];return _0x7fcbd5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe5f8('0x0'));var timeout=require(_0xe5f8('0x1'));var express=require(_0xe5f8('0x2'));var router=express[_0xe5f8('0x3')]();var fs_extra=require(_0xe5f8('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe5f8('0x5'));var controller=require('./intVtigerConfiguration.controller');router[_0xe5f8('0x6')]('/',auth[_0xe5f8('0x7')](),controller[_0xe5f8('0x8')]);router[_0xe5f8('0x6')](_0xe5f8('0x9'),auth[_0xe5f8('0x7')](),controller[_0xe5f8('0xa')]);router[_0xe5f8('0x6')](_0xe5f8('0xb'),auth[_0xe5f8('0x7')](),controller['getFields']);router[_0xe5f8('0x6')](_0xe5f8('0xc'),auth[_0xe5f8('0x7')](),controller[_0xe5f8('0xd')]);router[_0xe5f8('0x6')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xe5f8('0xe')]);router[_0xe5f8('0xf')]('/',auth[_0xe5f8('0x7')](),controller[_0xe5f8('0x10')]);router['put'](_0xe5f8('0x9'),auth[_0xe5f8('0x7')](),controller['update']);router[_0xe5f8('0x11')](_0xe5f8('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xe5f8('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 6052673..6267466 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 _0xd341=['STRING','sequelize','exports'];(function(_0x51fb42,_0x3020d5){var _0x5d767a=function(_0x5a7e20){while(--_0x5a7e20){_0x51fb42['push'](_0x51fb42['shift']());}};_0x5d767a(++_0x3020d5);}(_0xd341,0xbe));var _0x1d34=function(_0x46f2ca,_0xe2161b){_0x46f2ca=_0x46f2ca-0x0;var _0x508fd6=_0xd341[_0x46f2ca];return _0x508fd6;};'use strict';var Sequelize=require(_0x1d34('0x0'));module[_0x1d34('0x1')]={'name':{'type':Sequelize[_0x1d34('0x2')]},'description':{'type':Sequelize[_0x1d34('0x2')]}}; \ No newline at end of file +var _0xa7b6=['STRING','sequelize'];(function(_0x5477a9,_0x2ac104){var _0x2777e6=function(_0x3ad030){while(--_0x3ad030){_0x5477a9['push'](_0x5477a9['shift']());}};_0x2777e6(++_0x2ac104);}(_0xa7b6,0x9f));var _0x6a7b=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa7b6[_0x4709c0];return _0x13348b;};'use strict';var Sequelize=require(_0x6a7b('0x0'));module['exports']={'name':{'type':Sequelize[_0x6a7b('0x1')]},'description':{'type':Sequelize[_0x6a7b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index bbb76d2..4d96c98 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 _0x2c35=['lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','save','update','then','end','sendStatus','error','stack','name','send','map','VtigerConfiguration','fieldName','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','catch','show','params','rawAttributes','include','options','create','body','find','getFields','findOne','VtigerField','length','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x145b3c,_0x31ea4a){var _0x1b6e36=function(_0xfccee6){while(--_0xfccee6){_0x145b3c['push'](_0x145b3c['shift']());}};_0x1b6e36(++_0x31ea4a);}(_0x2c35,0xe5));var _0x52c3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2c35[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x52c3('0x0'));var rimraf=require(_0x52c3('0x1'));var zipdir=require(_0x52c3('0x2'));var jsonpatch=require(_0x52c3('0x3'));var rp=require('request-promise');var moment=require(_0x52c3('0x4'));var BPromise=require(_0x52c3('0x5'));var Mustache=require(_0x52c3('0x6'));var util=require(_0x52c3('0x7'));var path=require(_0x52c3('0x8'));var sox=require('sox');var csv=require(_0x52c3('0x9'));var ejs=require(_0x52c3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x52c3('0xb'));var squel=require(_0x52c3('0xc'));var crypto=require(_0x52c3('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x52c3('0x9'));var querystring=require(_0x52c3('0xe'));var Papa=require(_0x52c3('0xf'));var Redis=require(_0x52c3('0x10'));var authService=require(_0x52c3('0x11'));var qs=require(_0x52c3('0x12'));var as=require(_0x52c3('0x13'));var hardwareService=require(_0x52c3('0x14'));var logger=require(_0x52c3('0x15'))(_0x52c3('0x16'));var utils=require(_0x52c3('0x17'));var config=require(_0x52c3('0x18'));var licenseUtil=require(_0x52c3('0x19'));var db=require(_0x52c3('0x1a'))['db'];function respondWithStatusCode(_0x3379e6,_0x5046e4){_0x5046e4=_0x5046e4||0xcc;return function(_0x3b5974){if(_0x3b5974){return _0x3379e6['sendStatus'](_0x5046e4);}return _0x3379e6[_0x52c3('0x1b')](_0x5046e4)['end']();};}function respondWithResult(_0x570e0f,_0x2fdf61){_0x2fdf61=_0x2fdf61||0xc8;return function(_0x4b3bfb){if(_0x4b3bfb){return _0x570e0f[_0x52c3('0x1b')](_0x2fdf61)[_0x52c3('0x1c')](_0x4b3bfb);}};}function respondWithFilteredResult(_0x170dad,_0x4e6b33){return function(_0x1ae1ba){if(_0x1ae1ba){var _0x24e382=typeof _0x4e6b33[_0x52c3('0x1d')]===_0x52c3('0x1e')&&typeof _0x4e6b33['limit']===_0x52c3('0x1e');var _0x232c24=_0x1ae1ba[_0x52c3('0x1f')];var _0x121ea1=_0x24e382?0x0:_0x4e6b33[_0x52c3('0x1d')];var _0x1f010a=_0x24e382?_0x1ae1ba[_0x52c3('0x1f')]:_0x4e6b33['offset']+_0x4e6b33[_0x52c3('0x20')];var _0x3d5c58;if(_0x1f010a>=_0x232c24){_0x1f010a=_0x232c24;_0x3d5c58=0xc8;}else{_0x3d5c58=0xce;}_0x170dad[_0x52c3('0x1b')](_0x3d5c58);return _0x170dad[_0x52c3('0x21')]('Content-Range',_0x121ea1+'-'+_0x1f010a+'/'+_0x232c24)[_0x52c3('0x1c')](_0x1ae1ba);}return null;};}function patchUpdates(_0x4f0c35){return function(_0x5d8fd1){try{jsonpatch['apply'](_0x5d8fd1,_0x4f0c35,!![]);}catch(_0x38be35){return BPromise['reject'](_0x38be35);}return _0x5d8fd1[_0x52c3('0x22')]();};}function saveUpdates(_0x4a3660,_0x20ae0f){return function(_0x24d20b){if(_0x24d20b){return _0x24d20b[_0x52c3('0x23')](_0x4a3660)[_0x52c3('0x24')](function(_0x41ace3){return _0x41ace3;});}return null;};}function removeEntity(_0x5c1aa8,_0x111bf7){return function(_0x4ef77b){if(_0x4ef77b){return _0x4ef77b['destroy']()[_0x52c3('0x24')](function(){_0x5c1aa8[_0x52c3('0x1b')](0xcc)[_0x52c3('0x25')]();});}};}function handleEntityNotFound(_0xdef651,_0x5db014){return function(_0x186a59){if(!_0x186a59){_0xdef651[_0x52c3('0x26')](0x194);}return _0x186a59;};}function handleError(_0x57afb0,_0xd97ce1){_0xd97ce1=_0xd97ce1||0x1f4;return function(_0x5a77a6){logger[_0x52c3('0x27')](_0x5a77a6[_0x52c3('0x28')]);if(_0x5a77a6[_0x52c3('0x29')]){delete _0x5a77a6[_0x52c3('0x29')];}_0x57afb0[_0x52c3('0x1b')](_0xd97ce1)[_0x52c3('0x2a')](_0x5a77a6);};}exports['index']=function(_0x44afe8,_0x8e3edb){var _0x4bea7a={},_0x3cab7c={},_0xa42faf={'count':0x0,'rows':[]};var _0x4c7d0c=_[_0x52c3('0x2b')](db[_0x52c3('0x2c')]['rawAttributes'],function(_0x54f075){return{'name':_0x54f075[_0x52c3('0x2d')],'type':_0x54f075['type']['key']};});_0x3cab7c[_0x52c3('0x2e')]=_['map'](_0x4c7d0c,_0x52c3('0x29'));_0x3cab7c[_0x52c3('0x2f')]=_[_0x52c3('0x30')](_0x44afe8[_0x52c3('0x2f')]);_0x3cab7c[_0x52c3('0x31')]=_['intersection'](_0x3cab7c[_0x52c3('0x2e')],_0x3cab7c[_0x52c3('0x2f')]);_0x4bea7a[_0x52c3('0x32')]=_[_0x52c3('0x33')](_0x3cab7c[_0x52c3('0x2e')],qs['fields'](_0x44afe8['query'][_0x52c3('0x34')]));_0x4bea7a['attributes']=_0x4bea7a[_0x52c3('0x32')]['length']?_0x4bea7a['attributes']:_0x3cab7c[_0x52c3('0x2e')];if(!_0x44afe8['query'][_0x52c3('0x35')](_0x52c3('0x36'))){_0x4bea7a[_0x52c3('0x20')]=qs['limit'](_0x44afe8['query']['limit']);_0x4bea7a[_0x52c3('0x1d')]=qs['offset'](_0x44afe8[_0x52c3('0x2f')]['offset']);}_0x4bea7a[_0x52c3('0x37')]=qs['sort'](_0x44afe8[_0x52c3('0x2f')][_0x52c3('0x38')]);_0x4bea7a[_0x52c3('0x39')]=qs[_0x52c3('0x31')](_[_0x52c3('0x3a')](_0x44afe8[_0x52c3('0x2f')],_0x3cab7c[_0x52c3('0x31')]),_0x4c7d0c);if(_0x44afe8['query']['filter']){_0x4bea7a[_0x52c3('0x39')]=_[_0x52c3('0x3b')](_0x4bea7a[_0x52c3('0x39')],{'$or':_['map'](_0x4c7d0c,function(_0x803a2d){if(_0x803a2d['type']!==_0x52c3('0x3c')){var _0x2102cf={};_0x2102cf[_0x803a2d[_0x52c3('0x29')]]={'$like':'%'+_0x44afe8[_0x52c3('0x2f')][_0x52c3('0x3d')]+'%'};return _0x2102cf;}})});}_0x4bea7a=_[_0x52c3('0x3b')]({},_0x4bea7a,_0x44afe8['options']);var _0x4d514f={'where':_0x4bea7a[_0x52c3('0x39')]};return db[_0x52c3('0x2c')][_0x52c3('0x1f')](_0x4d514f)[_0x52c3('0x24')](function(_0x5e14c2){_0xa42faf[_0x52c3('0x1f')]=_0x5e14c2;if(_0x44afe8[_0x52c3('0x2f')][_0x52c3('0x3e')]){_0x4bea7a['include']=[{'all':!![]}];}return db[_0x52c3('0x2c')][_0x52c3('0x3f')](_0x4bea7a);})['then'](function(_0x3e2258){_0xa42faf[_0x52c3('0x40')]=_0x3e2258;return _0xa42faf;})[_0x52c3('0x24')](respondWithFilteredResult(_0x8e3edb,_0x4bea7a))[_0x52c3('0x41')](handleError(_0x8e3edb,null));};exports[_0x52c3('0x42')]=function(_0xf0bc0d,_0x33440a){var _0x2dac14={'raw':![],'where':{'id':_0xf0bc0d[_0x52c3('0x43')]['id']}},_0x1c3444={};_0x1c3444[_0x52c3('0x2e')]=_['keys'](db[_0x52c3('0x2c')][_0x52c3('0x44')]);_0x1c3444[_0x52c3('0x2f')]=_['keys'](_0xf0bc0d[_0x52c3('0x2f')]);_0x1c3444[_0x52c3('0x31')]=_['intersection'](_0x1c3444[_0x52c3('0x2e')],_0x1c3444[_0x52c3('0x2f')]);_0x2dac14[_0x52c3('0x32')]=_[_0x52c3('0x33')](_0x1c3444[_0x52c3('0x2e')],qs['fields'](_0xf0bc0d[_0x52c3('0x2f')]['fields']));_0x2dac14['attributes']=_0x2dac14[_0x52c3('0x32')]['length']?_0x2dac14[_0x52c3('0x32')]:_0x1c3444[_0x52c3('0x2e')];if(_0xf0bc0d['query'][_0x52c3('0x3e')]){_0x2dac14[_0x52c3('0x45')]=[{'all':!![]}];}_0x2dac14=_[_0x52c3('0x3b')]({},_0x2dac14,_0xf0bc0d[_0x52c3('0x46')]);return db[_0x52c3('0x2c')]['find'](_0x2dac14)['then'](handleEntityNotFound(_0x33440a,null))['then'](respondWithResult(_0x33440a,null))[_0x52c3('0x41')](handleError(_0x33440a,null));};exports[_0x52c3('0x47')]=function(_0x543824,_0x21a183){return db[_0x52c3('0x2c')]['create'](_0x543824[_0x52c3('0x48')],{})[_0x52c3('0x24')](respondWithResult(_0x21a183,0xc9))[_0x52c3('0x41')](handleError(_0x21a183,null));};exports['update']=function(_0x56d387,_0x521c87){if(_0x56d387['body']['id']){delete _0x56d387['body']['id'];}return db['VtigerConfiguration'][_0x52c3('0x49')]({'where':{'id':_0x56d387[_0x52c3('0x43')]['id']}})[_0x52c3('0x24')](handleEntityNotFound(_0x521c87,null))[_0x52c3('0x24')](saveUpdates(_0x56d387['body'],null))[_0x52c3('0x24')](respondWithResult(_0x521c87,null))[_0x52c3('0x41')](handleError(_0x521c87,null));};exports['destroy']=function(_0x1eee51,_0x3a91c0){return db[_0x52c3('0x2c')][_0x52c3('0x49')]({'where':{'id':_0x1eee51[_0x52c3('0x43')]['id']}})[_0x52c3('0x24')](handleEntityNotFound(_0x3a91c0,null))[_0x52c3('0x24')](removeEntity(_0x3a91c0,null))['catch'](handleError(_0x3a91c0,null));};exports[_0x52c3('0x4a')]=function(_0x32a740,_0x54264f,_0x4185da){var _0x1c434f={};var _0x51f2e5={};var _0x8b16bb;var _0x5a654c;return db[_0x52c3('0x2c')][_0x52c3('0x4b')]({'where':{'id':_0x32a740[_0x52c3('0x43')]['id']}})[_0x52c3('0x24')](handleEntityNotFound(_0x54264f,null))[_0x52c3('0x24')](function(_0xdcd2b6){if(_0xdcd2b6){_0x8b16bb=_0xdcd2b6;_0x51f2e5[_0x52c3('0x2e')]=_[_0x52c3('0x30')](db[_0x52c3('0x4c')][_0x52c3('0x44')]);_0x51f2e5['query']=_[_0x52c3('0x30')](_0x32a740['query']);_0x51f2e5['filters']=_[_0x52c3('0x33')](_0x51f2e5['model'],_0x51f2e5[_0x52c3('0x2f')]);_0x1c434f['attributes']=_[_0x52c3('0x33')](_0x51f2e5[_0x52c3('0x2e')],qs[_0x52c3('0x34')](_0x32a740[_0x52c3('0x2f')][_0x52c3('0x34')]));_0x1c434f['attributes']=_0x1c434f[_0x52c3('0x32')][_0x52c3('0x4d')]?_0x1c434f[_0x52c3('0x32')]:_0x51f2e5[_0x52c3('0x2e')];_0x1c434f[_0x52c3('0x37')]=qs[_0x52c3('0x38')](_0x32a740[_0x52c3('0x2f')][_0x52c3('0x38')]);_0x1c434f[_0x52c3('0x39')]=qs[_0x52c3('0x31')](_['pick'](_0x32a740[_0x52c3('0x2f')],_0x51f2e5[_0x52c3('0x31')]));if(_0x32a740['query']['filter']){_0x1c434f[_0x52c3('0x39')]=_['merge'](_0x1c434f['where'],{'$or':_[_0x52c3('0x2b')](_0x1c434f[_0x52c3('0x32')],function(_0x1d3609){var _0x1adf34={};_0x1adf34[_0x1d3609]={'$like':'%'+_0x32a740['query'][_0x52c3('0x3d')]+'%'};return _0x1adf34;})});}_0x1c434f=_[_0x52c3('0x3b')]({},_0x1c434f,_0x32a740[_0x52c3('0x46')]);return _0x8b16bb[_0x52c3('0x4a')](_0x1c434f);}})[_0x52c3('0x24')](function(_0x4f7c21){if(_0x4f7c21){_0x5a654c=_0x4f7c21['length'];if(!_0x32a740[_0x52c3('0x2f')][_0x52c3('0x35')](_0x52c3('0x36'))){_0x1c434f[_0x52c3('0x20')]=qs[_0x52c3('0x20')](_0x32a740[_0x52c3('0x2f')][_0x52c3('0x20')]);_0x1c434f[_0x52c3('0x1d')]=qs[_0x52c3('0x1d')](_0x32a740[_0x52c3('0x2f')]['offset']);}return _0x8b16bb[_0x52c3('0x4a')](_0x1c434f);}})[_0x52c3('0x24')](function(_0x206b7a){if(_0x206b7a){return _0x206b7a?{'count':_0x5a654c,'rows':_0x206b7a}:null;}})[_0x52c3('0x24')](respondWithResult(_0x54264f,null))['catch'](handleError(_0x54264f,null));};exports['getSubjects']=function(_0x546e1f,_0x1c3b57,_0x5b199d){var _0x259886={};var _0x1cfec3={};var _0x14e153;var _0xc7a292;return db[_0x52c3('0x2c')]['findOne']({'where':{'id':_0x546e1f[_0x52c3('0x43')]['id']}})[_0x52c3('0x24')](handleEntityNotFound(_0x1c3b57,null))[_0x52c3('0x24')](function(_0x4e594a){if(_0x4e594a){_0x14e153=_0x4e594a;_0x1cfec3[_0x52c3('0x2e')]=_['keys'](db['VtigerField'][_0x52c3('0x44')]);_0x1cfec3['query']=_[_0x52c3('0x30')](_0x546e1f[_0x52c3('0x2f')]);_0x1cfec3[_0x52c3('0x31')]=_[_0x52c3('0x33')](_0x1cfec3[_0x52c3('0x2e')],_0x1cfec3['query']);_0x259886[_0x52c3('0x32')]=_[_0x52c3('0x33')](_0x1cfec3[_0x52c3('0x2e')],qs[_0x52c3('0x34')](_0x546e1f[_0x52c3('0x2f')][_0x52c3('0x34')]));_0x259886['attributes']=_0x259886[_0x52c3('0x32')][_0x52c3('0x4d')]?_0x259886[_0x52c3('0x32')]:_0x1cfec3['model'];_0x259886[_0x52c3('0x37')]=qs[_0x52c3('0x38')](_0x546e1f[_0x52c3('0x2f')][_0x52c3('0x38')]);_0x259886[_0x52c3('0x39')]=qs[_0x52c3('0x31')](_[_0x52c3('0x3a')](_0x546e1f[_0x52c3('0x2f')],_0x1cfec3[_0x52c3('0x31')]));if(_0x546e1f[_0x52c3('0x2f')][_0x52c3('0x3d')]){_0x259886[_0x52c3('0x39')]=_[_0x52c3('0x3b')](_0x259886[_0x52c3('0x39')],{'$or':_[_0x52c3('0x2b')](_0x259886['attributes'],function(_0x47eb0f){var _0x1b74c1={};_0x1b74c1[_0x47eb0f]={'$like':'%'+_0x546e1f[_0x52c3('0x2f')][_0x52c3('0x3d')]+'%'};return _0x1b74c1;})});}_0x259886=_[_0x52c3('0x3b')]({},_0x259886,_0x546e1f[_0x52c3('0x46')]);return _0x14e153[_0x52c3('0x4e')](_0x259886);}})['then'](function(_0x1b555d){if(_0x1b555d){_0xc7a292=_0x1b555d[_0x52c3('0x4d')];if(!_0x546e1f[_0x52c3('0x2f')][_0x52c3('0x35')](_0x52c3('0x36'))){_0x259886[_0x52c3('0x20')]=qs[_0x52c3('0x20')](_0x546e1f[_0x52c3('0x2f')][_0x52c3('0x20')]);_0x259886['offset']=qs['offset'](_0x546e1f[_0x52c3('0x2f')]['offset']);}return _0x14e153[_0x52c3('0x4e')](_0x259886);}})[_0x52c3('0x24')](function(_0x1c5692){if(_0x1c5692){return _0x1c5692?{'count':_0xc7a292,'rows':_0x1c5692}:null;}})[_0x52c3('0x24')](respondWithResult(_0x1c3b57,null))[_0x52c3('0x41')](handleError(_0x1c3b57,null));};exports[_0x52c3('0x4f')]=function(_0x4d14de,_0x11dca1,_0x4d071e){var _0x415c27={};var _0x14252a={};var _0x153fd5;var _0x4f28a7;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x4d14de[_0x52c3('0x43')]['id']}})[_0x52c3('0x24')](handleEntityNotFound(_0x11dca1,null))[_0x52c3('0x24')](function(_0x597ae7){if(_0x597ae7){_0x153fd5=_0x597ae7;_0x14252a[_0x52c3('0x2e')]=_[_0x52c3('0x30')](db[_0x52c3('0x4c')][_0x52c3('0x44')]);_0x14252a['query']=_['keys'](_0x4d14de[_0x52c3('0x2f')]);_0x14252a['filters']=_[_0x52c3('0x33')](_0x14252a['model'],_0x14252a[_0x52c3('0x2f')]);_0x415c27[_0x52c3('0x32')]=_[_0x52c3('0x33')](_0x14252a[_0x52c3('0x2e')],qs[_0x52c3('0x34')](_0x4d14de[_0x52c3('0x2f')][_0x52c3('0x34')]));_0x415c27[_0x52c3('0x32')]=_0x415c27[_0x52c3('0x32')][_0x52c3('0x4d')]?_0x415c27['attributes']:_0x14252a[_0x52c3('0x2e')];_0x415c27[_0x52c3('0x37')]=qs[_0x52c3('0x38')](_0x4d14de[_0x52c3('0x2f')][_0x52c3('0x38')]);_0x415c27[_0x52c3('0x39')]=qs[_0x52c3('0x31')](_['pick'](_0x4d14de['query'],_0x14252a[_0x52c3('0x31')]));if(_0x4d14de[_0x52c3('0x2f')][_0x52c3('0x3d')]){_0x415c27[_0x52c3('0x39')]=_['merge'](_0x415c27[_0x52c3('0x39')],{'$or':_['map'](_0x415c27[_0x52c3('0x32')],function(_0x12ba7d){var _0x4d0607={};_0x4d0607[_0x12ba7d]={'$like':'%'+_0x4d14de[_0x52c3('0x2f')][_0x52c3('0x3d')]+'%'};return _0x4d0607;})});}_0x415c27=_[_0x52c3('0x3b')]({},_0x415c27,_0x4d14de['options']);return _0x153fd5[_0x52c3('0x4f')](_0x415c27);}})[_0x52c3('0x24')](function(_0x328312){if(_0x328312){_0x4f28a7=_0x328312[_0x52c3('0x4d')];if(!_0x4d14de[_0x52c3('0x2f')][_0x52c3('0x35')]('nolimit')){_0x415c27[_0x52c3('0x20')]=qs[_0x52c3('0x20')](_0x4d14de[_0x52c3('0x2f')][_0x52c3('0x20')]);_0x415c27[_0x52c3('0x1d')]=qs[_0x52c3('0x1d')](_0x4d14de[_0x52c3('0x2f')][_0x52c3('0x1d')]);}return _0x153fd5[_0x52c3('0x4f')](_0x415c27);}})[_0x52c3('0x24')](function(_0x49e59c){if(_0x49e59c){return _0x49e59c?{'count':_0x4f28a7,'rows':_0x49e59c}:null;}})[_0x52c3('0x24')](respondWithResult(_0x11dca1,null))[_0x52c3('0x41')](handleError(_0x11dca1,null));}; \ No newline at end of file +var _0xa8d7=['save','update','destroy','stack','name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','query','keys','intersection','model','fields','attributes','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','includeAll','findAll','then','rows','show','params','length','include','find','create','body','catch','getFields','findOne','VtigerField','pick','getSubjects','hasOwnProperty','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject'];(function(_0x530871,_0x376dfa){var _0x2f0479=function(_0x521672){while(--_0x521672){_0x530871['push'](_0x530871['shift']());}};_0x2f0479(++_0x376dfa);}(_0xa8d7,0x1b8));var _0x7a8d=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0xa8d7[_0x1602ef];return _0x5870ee;};'use strict';var emlformat=require(_0x7a8d('0x0'));var rimraf=require(_0x7a8d('0x1'));var zipdir=require(_0x7a8d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7a8d('0x3'));var moment=require(_0x7a8d('0x4'));var BPromise=require(_0x7a8d('0x5'));var Mustache=require(_0x7a8d('0x6'));var util=require(_0x7a8d('0x7'));var path=require(_0x7a8d('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7a8d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7a8d('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7a8d('0xb'));var deskjs=require(_0x7a8d('0xc'));var toCsv=require(_0x7a8d('0xd'));var querystring=require('querystring');var Papa=require(_0x7a8d('0xe'));var Redis=require(_0x7a8d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7a8d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7a8d('0x11'));var logger=require(_0x7a8d('0x12'))(_0x7a8d('0x13'));var utils=require('../../config/utils');var config=require(_0x7a8d('0x14'));var licenseUtil=require(_0x7a8d('0x15'));var db=require(_0x7a8d('0x16'))['db'];function respondWithStatusCode(_0x102270,_0x4eda02){_0x4eda02=_0x4eda02||0xcc;return function(_0x1498fd){if(_0x1498fd){return _0x102270[_0x7a8d('0x17')](_0x4eda02);}return _0x102270[_0x7a8d('0x18')](_0x4eda02)[_0x7a8d('0x19')]();};}function respondWithResult(_0x199178,_0x246c3c){_0x246c3c=_0x246c3c||0xc8;return function(_0x52e7d3){if(_0x52e7d3){return _0x199178[_0x7a8d('0x18')](_0x246c3c)['json'](_0x52e7d3);}};}function respondWithFilteredResult(_0x16cae9,_0x385156){return function(_0x22832f){if(_0x22832f){var _0x3b8bd0=typeof _0x385156[_0x7a8d('0x1a')]===_0x7a8d('0x1b')&&typeof _0x385156[_0x7a8d('0x1c')]===_0x7a8d('0x1b');var _0x4d92e0=_0x22832f[_0x7a8d('0x1d')];var _0x2ec784=_0x3b8bd0?0x0:_0x385156[_0x7a8d('0x1a')];var _0x58f6d2=_0x3b8bd0?_0x22832f[_0x7a8d('0x1d')]:_0x385156[_0x7a8d('0x1a')]+_0x385156[_0x7a8d('0x1c')];var _0x589de5;if(_0x58f6d2>=_0x4d92e0){_0x58f6d2=_0x4d92e0;_0x589de5=0xc8;}else{_0x589de5=0xce;}_0x16cae9[_0x7a8d('0x18')](_0x589de5);return _0x16cae9[_0x7a8d('0x1e')]('Content-Range',_0x2ec784+'-'+_0x58f6d2+'/'+_0x4d92e0)[_0x7a8d('0x1f')](_0x22832f);}return null;};}function patchUpdates(_0x42546d){return function(_0x12451c){try{jsonpatch[_0x7a8d('0x20')](_0x12451c,_0x42546d,!![]);}catch(_0x187953){return BPromise[_0x7a8d('0x21')](_0x187953);}return _0x12451c[_0x7a8d('0x22')]();};}function saveUpdates(_0x50bf3c,_0x56efe8){return function(_0xc029a5){if(_0xc029a5){return _0xc029a5[_0x7a8d('0x23')](_0x50bf3c)['then'](function(_0x54dc9e){return _0x54dc9e;});}return null;};}function removeEntity(_0xe9de36,_0x401894){return function(_0x30af97){if(_0x30af97){return _0x30af97[_0x7a8d('0x24')]()['then'](function(){_0xe9de36[_0x7a8d('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14a69d,_0x19e10d){return function(_0x44ebdc){if(!_0x44ebdc){_0x14a69d[_0x7a8d('0x17')](0x194);}return _0x44ebdc;};}function handleError(_0x569a8e,_0x5779a8){_0x5779a8=_0x5779a8||0x1f4;return function(_0x1e7b74){logger['error'](_0x1e7b74[_0x7a8d('0x25')]);if(_0x1e7b74['name']){delete _0x1e7b74[_0x7a8d('0x26')];}_0x569a8e['status'](_0x5779a8)[_0x7a8d('0x27')](_0x1e7b74);};}exports['index']=function(_0x49d6ac,_0x1e78aa){var _0x4dd2e6={},_0x1ae521={},_0x56273e={'count':0x0,'rows':[]};var _0x121214=_[_0x7a8d('0x28')](db[_0x7a8d('0x29')][_0x7a8d('0x2a')],function(_0x22b97e){return{'name':_0x22b97e[_0x7a8d('0x2b')],'type':_0x22b97e[_0x7a8d('0x2c')]['key']};});_0x1ae521['model']=_[_0x7a8d('0x28')](_0x121214,_0x7a8d('0x26'));_0x1ae521[_0x7a8d('0x2d')]=_[_0x7a8d('0x2e')](_0x49d6ac[_0x7a8d('0x2d')]);_0x1ae521['filters']=_[_0x7a8d('0x2f')](_0x1ae521[_0x7a8d('0x30')],_0x1ae521[_0x7a8d('0x2d')]);_0x4dd2e6['attributes']=_['intersection'](_0x1ae521[_0x7a8d('0x30')],qs[_0x7a8d('0x31')](_0x49d6ac[_0x7a8d('0x2d')]['fields']));_0x4dd2e6[_0x7a8d('0x32')]=_0x4dd2e6[_0x7a8d('0x32')]['length']?_0x4dd2e6[_0x7a8d('0x32')]:_0x1ae521['model'];if(!_0x49d6ac['query']['hasOwnProperty'](_0x7a8d('0x33'))){_0x4dd2e6['limit']=qs['limit'](_0x49d6ac[_0x7a8d('0x2d')]['limit']);_0x4dd2e6['offset']=qs['offset'](_0x49d6ac['query'][_0x7a8d('0x1a')]);}_0x4dd2e6[_0x7a8d('0x34')]=qs[_0x7a8d('0x35')](_0x49d6ac[_0x7a8d('0x2d')][_0x7a8d('0x35')]);_0x4dd2e6[_0x7a8d('0x36')]=qs['filters'](_['pick'](_0x49d6ac[_0x7a8d('0x2d')],_0x1ae521[_0x7a8d('0x37')]),_0x121214);if(_0x49d6ac['query'][_0x7a8d('0x38')]){_0x4dd2e6[_0x7a8d('0x36')]=_[_0x7a8d('0x39')](_0x4dd2e6[_0x7a8d('0x36')],{'$or':_[_0x7a8d('0x28')](_0x121214,function(_0x181d16){if(_0x181d16[_0x7a8d('0x2c')]!==_0x7a8d('0x3a')){var _0xb8d453={};_0xb8d453[_0x181d16['name']]={'$like':'%'+_0x49d6ac[_0x7a8d('0x2d')][_0x7a8d('0x38')]+'%'};return _0xb8d453;}})});}_0x4dd2e6=_[_0x7a8d('0x39')]({},_0x4dd2e6,_0x49d6ac[_0x7a8d('0x3b')]);var _0x15d13a={'where':_0x4dd2e6[_0x7a8d('0x36')]};return db['VtigerConfiguration'][_0x7a8d('0x1d')](_0x15d13a)['then'](function(_0x1cff06){_0x56273e[_0x7a8d('0x1d')]=_0x1cff06;if(_0x49d6ac[_0x7a8d('0x2d')][_0x7a8d('0x3c')]){_0x4dd2e6['include']=[{'all':!![]}];}return db[_0x7a8d('0x29')][_0x7a8d('0x3d')](_0x4dd2e6);})[_0x7a8d('0x3e')](function(_0x2e9fe5){_0x56273e[_0x7a8d('0x3f')]=_0x2e9fe5;return _0x56273e;})[_0x7a8d('0x3e')](respondWithFilteredResult(_0x1e78aa,_0x4dd2e6))['catch'](handleError(_0x1e78aa,null));};exports[_0x7a8d('0x40')]=function(_0x42cdf5,_0x58c8ce){var _0xa50f31={'raw':![],'where':{'id':_0x42cdf5[_0x7a8d('0x41')]['id']}},_0xf10e5a={};_0xf10e5a[_0x7a8d('0x30')]=_[_0x7a8d('0x2e')](db[_0x7a8d('0x29')][_0x7a8d('0x2a')]);_0xf10e5a[_0x7a8d('0x2d')]=_[_0x7a8d('0x2e')](_0x42cdf5[_0x7a8d('0x2d')]);_0xf10e5a['filters']=_[_0x7a8d('0x2f')](_0xf10e5a[_0x7a8d('0x30')],_0xf10e5a[_0x7a8d('0x2d')]);_0xa50f31[_0x7a8d('0x32')]=_['intersection'](_0xf10e5a['model'],qs[_0x7a8d('0x31')](_0x42cdf5[_0x7a8d('0x2d')][_0x7a8d('0x31')]));_0xa50f31[_0x7a8d('0x32')]=_0xa50f31['attributes'][_0x7a8d('0x42')]?_0xa50f31[_0x7a8d('0x32')]:_0xf10e5a['model'];if(_0x42cdf5[_0x7a8d('0x2d')][_0x7a8d('0x3c')]){_0xa50f31[_0x7a8d('0x43')]=[{'all':!![]}];}_0xa50f31=_['merge']({},_0xa50f31,_0x42cdf5[_0x7a8d('0x3b')]);return db['VtigerConfiguration'][_0x7a8d('0x44')](_0xa50f31)[_0x7a8d('0x3e')](handleEntityNotFound(_0x58c8ce,null))[_0x7a8d('0x3e')](respondWithResult(_0x58c8ce,null))['catch'](handleError(_0x58c8ce,null));};exports[_0x7a8d('0x45')]=function(_0x41fd7e,_0x382c38){return db[_0x7a8d('0x29')][_0x7a8d('0x45')](_0x41fd7e[_0x7a8d('0x46')],{})[_0x7a8d('0x3e')](respondWithResult(_0x382c38,0xc9))[_0x7a8d('0x47')](handleError(_0x382c38,null));};exports[_0x7a8d('0x23')]=function(_0x2cbb48,_0xaf7c78){if(_0x2cbb48[_0x7a8d('0x46')]['id']){delete _0x2cbb48[_0x7a8d('0x46')]['id'];}return db['VtigerConfiguration'][_0x7a8d('0x44')]({'where':{'id':_0x2cbb48[_0x7a8d('0x41')]['id']}})[_0x7a8d('0x3e')](handleEntityNotFound(_0xaf7c78,null))[_0x7a8d('0x3e')](saveUpdates(_0x2cbb48[_0x7a8d('0x46')],null))[_0x7a8d('0x3e')](respondWithResult(_0xaf7c78,null))[_0x7a8d('0x47')](handleError(_0xaf7c78,null));};exports[_0x7a8d('0x24')]=function(_0x2036ab,_0x4bc6d1){return db[_0x7a8d('0x29')][_0x7a8d('0x44')]({'where':{'id':_0x2036ab[_0x7a8d('0x41')]['id']}})['then'](handleEntityNotFound(_0x4bc6d1,null))[_0x7a8d('0x3e')](removeEntity(_0x4bc6d1,null))[_0x7a8d('0x47')](handleError(_0x4bc6d1,null));};exports[_0x7a8d('0x48')]=function(_0x3e2884,_0x48c537,_0x3a3265){var _0x538707={};var _0x2b728e={};var _0x5499c9;var _0xe0c4e3;return db['VtigerConfiguration'][_0x7a8d('0x49')]({'where':{'id':_0x3e2884[_0x7a8d('0x41')]['id']}})[_0x7a8d('0x3e')](handleEntityNotFound(_0x48c537,null))[_0x7a8d('0x3e')](function(_0x1c6c0b){if(_0x1c6c0b){_0x5499c9=_0x1c6c0b;_0x2b728e[_0x7a8d('0x30')]=_[_0x7a8d('0x2e')](db[_0x7a8d('0x4a')][_0x7a8d('0x2a')]);_0x2b728e[_0x7a8d('0x2d')]=_['keys'](_0x3e2884['query']);_0x2b728e['filters']=_[_0x7a8d('0x2f')](_0x2b728e[_0x7a8d('0x30')],_0x2b728e[_0x7a8d('0x2d')]);_0x538707['attributes']=_[_0x7a8d('0x2f')](_0x2b728e['model'],qs[_0x7a8d('0x31')](_0x3e2884[_0x7a8d('0x2d')][_0x7a8d('0x31')]));_0x538707[_0x7a8d('0x32')]=_0x538707['attributes']['length']?_0x538707[_0x7a8d('0x32')]:_0x2b728e[_0x7a8d('0x30')];_0x538707[_0x7a8d('0x34')]=qs[_0x7a8d('0x35')](_0x3e2884[_0x7a8d('0x2d')][_0x7a8d('0x35')]);_0x538707[_0x7a8d('0x36')]=qs[_0x7a8d('0x37')](_[_0x7a8d('0x4b')](_0x3e2884['query'],_0x2b728e['filters']));if(_0x3e2884[_0x7a8d('0x2d')][_0x7a8d('0x38')]){_0x538707[_0x7a8d('0x36')]=_['merge'](_0x538707[_0x7a8d('0x36')],{'$or':_[_0x7a8d('0x28')](_0x538707[_0x7a8d('0x32')],function(_0xedb3d7){var _0x35f46d={};_0x35f46d[_0xedb3d7]={'$like':'%'+_0x3e2884[_0x7a8d('0x2d')]['filter']+'%'};return _0x35f46d;})});}_0x538707=_[_0x7a8d('0x39')]({},_0x538707,_0x3e2884['options']);return _0x5499c9[_0x7a8d('0x48')](_0x538707);}})['then'](function(_0x21d36d){if(_0x21d36d){_0xe0c4e3=_0x21d36d[_0x7a8d('0x42')];if(!_0x3e2884[_0x7a8d('0x2d')]['hasOwnProperty'](_0x7a8d('0x33'))){_0x538707['limit']=qs[_0x7a8d('0x1c')](_0x3e2884[_0x7a8d('0x2d')][_0x7a8d('0x1c')]);_0x538707[_0x7a8d('0x1a')]=qs[_0x7a8d('0x1a')](_0x3e2884[_0x7a8d('0x2d')][_0x7a8d('0x1a')]);}return _0x5499c9[_0x7a8d('0x48')](_0x538707);}})[_0x7a8d('0x3e')](function(_0x49dcd0){if(_0x49dcd0){return _0x49dcd0?{'count':_0xe0c4e3,'rows':_0x49dcd0}:null;}})[_0x7a8d('0x3e')](respondWithResult(_0x48c537,null))[_0x7a8d('0x47')](handleError(_0x48c537,null));};exports[_0x7a8d('0x4c')]=function(_0x369c13,_0xa9574d,_0x28c386){var _0x48e1d3={};var _0x51d3cc={};var _0x345093;var _0x5c5272;return db[_0x7a8d('0x29')][_0x7a8d('0x49')]({'where':{'id':_0x369c13[_0x7a8d('0x41')]['id']}})[_0x7a8d('0x3e')](handleEntityNotFound(_0xa9574d,null))[_0x7a8d('0x3e')](function(_0x195282){if(_0x195282){_0x345093=_0x195282;_0x51d3cc[_0x7a8d('0x30')]=_['keys'](db[_0x7a8d('0x4a')][_0x7a8d('0x2a')]);_0x51d3cc[_0x7a8d('0x2d')]=_[_0x7a8d('0x2e')](_0x369c13[_0x7a8d('0x2d')]);_0x51d3cc[_0x7a8d('0x37')]=_[_0x7a8d('0x2f')](_0x51d3cc[_0x7a8d('0x30')],_0x51d3cc['query']);_0x48e1d3[_0x7a8d('0x32')]=_[_0x7a8d('0x2f')](_0x51d3cc[_0x7a8d('0x30')],qs[_0x7a8d('0x31')](_0x369c13[_0x7a8d('0x2d')][_0x7a8d('0x31')]));_0x48e1d3['attributes']=_0x48e1d3[_0x7a8d('0x32')][_0x7a8d('0x42')]?_0x48e1d3['attributes']:_0x51d3cc[_0x7a8d('0x30')];_0x48e1d3['order']=qs[_0x7a8d('0x35')](_0x369c13[_0x7a8d('0x2d')][_0x7a8d('0x35')]);_0x48e1d3['where']=qs[_0x7a8d('0x37')](_[_0x7a8d('0x4b')](_0x369c13[_0x7a8d('0x2d')],_0x51d3cc[_0x7a8d('0x37')]));if(_0x369c13[_0x7a8d('0x2d')][_0x7a8d('0x38')]){_0x48e1d3[_0x7a8d('0x36')]=_[_0x7a8d('0x39')](_0x48e1d3[_0x7a8d('0x36')],{'$or':_[_0x7a8d('0x28')](_0x48e1d3['attributes'],function(_0x50e885){var _0x271843={};_0x271843[_0x50e885]={'$like':'%'+_0x369c13[_0x7a8d('0x2d')]['filter']+'%'};return _0x271843;})});}_0x48e1d3=_[_0x7a8d('0x39')]({},_0x48e1d3,_0x369c13[_0x7a8d('0x3b')]);return _0x345093[_0x7a8d('0x4c')](_0x48e1d3);}})[_0x7a8d('0x3e')](function(_0xaf0cc9){if(_0xaf0cc9){_0x5c5272=_0xaf0cc9[_0x7a8d('0x42')];if(!_0x369c13[_0x7a8d('0x2d')][_0x7a8d('0x4d')](_0x7a8d('0x33'))){_0x48e1d3[_0x7a8d('0x1c')]=qs[_0x7a8d('0x1c')](_0x369c13['query'][_0x7a8d('0x1c')]);_0x48e1d3[_0x7a8d('0x1a')]=qs[_0x7a8d('0x1a')](_0x369c13['query'][_0x7a8d('0x1a')]);}return _0x345093[_0x7a8d('0x4c')](_0x48e1d3);}})['then'](function(_0x5ea7b5){if(_0x5ea7b5){return _0x5ea7b5?{'count':_0x5c5272,'rows':_0x5ea7b5}:null;}})['then'](respondWithResult(_0xa9574d,null))[_0x7a8d('0x47')](handleError(_0xa9574d,null));};exports[_0x7a8d('0x4e')]=function(_0x50252e,_0x3b5d1a,_0x52b1eb){var _0x181b53={};var _0x5cb0b0={};var _0x1d687a;var _0x2881dc;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x50252e[_0x7a8d('0x41')]['id']}})[_0x7a8d('0x3e')](handleEntityNotFound(_0x3b5d1a,null))[_0x7a8d('0x3e')](function(_0x3dddc8){if(_0x3dddc8){_0x1d687a=_0x3dddc8;_0x5cb0b0[_0x7a8d('0x30')]=_[_0x7a8d('0x2e')](db['VtigerField'][_0x7a8d('0x2a')]);_0x5cb0b0[_0x7a8d('0x2d')]=_[_0x7a8d('0x2e')](_0x50252e[_0x7a8d('0x2d')]);_0x5cb0b0[_0x7a8d('0x37')]=_['intersection'](_0x5cb0b0['model'],_0x5cb0b0[_0x7a8d('0x2d')]);_0x181b53[_0x7a8d('0x32')]=_['intersection'](_0x5cb0b0['model'],qs[_0x7a8d('0x31')](_0x50252e[_0x7a8d('0x2d')]['fields']));_0x181b53['attributes']=_0x181b53[_0x7a8d('0x32')][_0x7a8d('0x42')]?_0x181b53[_0x7a8d('0x32')]:_0x5cb0b0[_0x7a8d('0x30')];_0x181b53[_0x7a8d('0x34')]=qs[_0x7a8d('0x35')](_0x50252e['query'][_0x7a8d('0x35')]);_0x181b53['where']=qs[_0x7a8d('0x37')](_['pick'](_0x50252e[_0x7a8d('0x2d')],_0x5cb0b0[_0x7a8d('0x37')]));if(_0x50252e[_0x7a8d('0x2d')][_0x7a8d('0x38')]){_0x181b53['where']=_['merge'](_0x181b53[_0x7a8d('0x36')],{'$or':_[_0x7a8d('0x28')](_0x181b53[_0x7a8d('0x32')],function(_0x4818bb){var _0x48b0a3={};_0x48b0a3[_0x4818bb]={'$like':'%'+_0x50252e[_0x7a8d('0x2d')][_0x7a8d('0x38')]+'%'};return _0x48b0a3;})});}_0x181b53=_[_0x7a8d('0x39')]({},_0x181b53,_0x50252e[_0x7a8d('0x3b')]);return _0x1d687a[_0x7a8d('0x4e')](_0x181b53);}})[_0x7a8d('0x3e')](function(_0xb4ee1){if(_0xb4ee1){_0x2881dc=_0xb4ee1[_0x7a8d('0x42')];if(!_0x50252e[_0x7a8d('0x2d')][_0x7a8d('0x4d')]('nolimit')){_0x181b53[_0x7a8d('0x1c')]=qs[_0x7a8d('0x1c')](_0x50252e[_0x7a8d('0x2d')][_0x7a8d('0x1c')]);_0x181b53[_0x7a8d('0x1a')]=qs[_0x7a8d('0x1a')](_0x50252e['query'][_0x7a8d('0x1a')]);}return _0x1d687a['getDescriptions'](_0x181b53);}})['then'](function(_0xe24303){if(_0xe24303){return _0xe24303?{'count':_0x2881dc,'rows':_0xe24303}:null;}})[_0x7a8d('0x3e')](respondWithResult(_0x3b5d1a,null))[_0x7a8d('0x47')](handleError(_0x3b5d1a,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index aa103dd..f08b3a3 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 _0x251f=['exports','define','int_vtiger_configurations','lodash','util','api','request-promise','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x130d82,_0x25f49b){var _0x112070=function(_0x5795ee){while(--_0x5795ee){_0x130d82['push'](_0x130d82['shift']());}};_0x112070(++_0x25f49b);}(_0x251f,0x7c));var _0xf251=function(_0x4a96d2,_0x689504){_0x4a96d2=_0x4a96d2-0x0;var _0x38af04=_0x251f[_0x4a96d2];return _0x38af04;};'use strict';var _=require(_0xf251('0x0'));var util=require(_0xf251('0x1'));var logger=require('../../config/logger')(_0xf251('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf251('0x3'));var fs=require('fs');var path=require(_0xf251('0x4'));var rimraf=require(_0xf251('0x5'));var config=require(_0xf251('0x6'));var attributes=require(_0xf251('0x7'));module[_0xf251('0x8')]=function(_0x36f94d,_0xe93080){return _0x36f94d[_0xf251('0x9')]('VtigerConfiguration',attributes,{'tableName':_0xf251('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0e88=['bluebird','path','rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','util','moment'];(function(_0xd4c417,_0x3ea1a6){var _0x2111b4=function(_0x244462){while(--_0x244462){_0xd4c417['push'](_0xd4c417['shift']());}};_0x2111b4(++_0x3ea1a6);}(_0x0e88,0x105));var _0x80e8=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x0e88[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x80e8('0x0'));var util=require(_0x80e8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x80e8('0x2'));var BPromise=require(_0x80e8('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x80e8('0x4'));var rimraf=require(_0x80e8('0x5'));var config=require(_0x80e8('0x6'));var attributes=require(_0x80e8('0x7'));module[_0x80e8('0x8')]=function(_0x41c59c,_0x57e9ea){return _0x41c59c[_0x80e8('0x9')](_0x80e8('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 e5f4a8b..11328d7 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 _0xbb2a=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','VtigerConfiguration,\x20%s,\x20%s','message','info','result','catch','lodash','moment'];(function(_0x177b6e,_0x2c35c5){var _0x58c7cc=function(_0xff798c){while(--_0xff798c){_0x177b6e['push'](_0x177b6e['shift']());}};_0x58c7cc(++_0x2c35c5);}(_0xbb2a,0x82));var _0xabb2=function(_0x1f54ce,_0x17b1ca){_0x1f54ce=_0x1f54ce-0x0;var _0x594827=_0xbb2a[_0x1f54ce];return _0x594827;};'use strict';var _=require(_0xabb2('0x0'));var util=require('util');var moment=require(_0xabb2('0x1'));var BPromise=require(_0xabb2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xabb2('0x3'));var db=require(_0xabb2('0x4'))['db'];var utils=require(_0xabb2('0x5'));var logger=require(_0xabb2('0x6'))(_0xabb2('0x7'));var config=require(_0xabb2('0x8'));var jayson=require(_0xabb2('0x9'));var client=jayson['client'][_0xabb2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3de9fc,_0x8659df,_0x2904b3){return new BPromise(function(_0x38fa76,_0x4fd3ae){return client['request'](_0x3de9fc,_0x2904b3)[_0xabb2('0xb')](function(_0x1970c3){logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x8659df,_0xabb2('0xc'));logger[_0xabb2('0xd')](_0xabb2('0xe'),_0x8659df,_0xabb2('0xc'),JSON['stringify'](_0x1970c3));if(_0x1970c3[_0xabb2('0xf')]){if(_0x1970c3[_0xabb2('0xf')][_0xabb2('0x10')]===0x1f4){logger[_0xabb2('0xf')](_0xabb2('0x11'),_0x8659df,_0x1970c3[_0xabb2('0xf')]['message']);return _0x4fd3ae(_0x1970c3[_0xabb2('0xf')][_0xabb2('0x12')]);}logger[_0xabb2('0xf')](_0xabb2('0x11'),_0x8659df,_0x1970c3[_0xabb2('0xf')][_0xabb2('0x12')]);return _0x38fa76(_0x1970c3['error'][_0xabb2('0x12')]);}else{logger[_0xabb2('0x13')](_0xabb2('0x11'),_0x8659df,'request\x20sent');_0x38fa76(_0x1970c3[_0xabb2('0x14')]['message']);}})[_0xabb2('0x15')](function(_0x300406){logger[_0xabb2('0xf')](_0xabb2('0x11'),_0x8659df,_0x300406);_0x4fd3ae(_0x300406);});});} \ No newline at end of file +var _0x1c21=['request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x45004f,_0x488dc8){var _0x53b0c9=function(_0x42caf8){while(--_0x42caf8){_0x45004f['push'](_0x45004f['shift']());}};_0x53b0c9(++_0x488dc8);}(_0x1c21,0xdd));var _0x11c2=function(_0x5ee929,_0x3ea8f){_0x5ee929=_0x5ee929-0x0;var _0x4881d0=_0x1c21[_0x5ee929];return _0x4881d0;};'use strict';var _=require(_0x11c2('0x0'));var util=require(_0x11c2('0x1'));var moment=require(_0x11c2('0x2'));var BPromise=require(_0x11c2('0x3'));var rs=require(_0x11c2('0x4'));var fs=require('fs');var Redis=require(_0x11c2('0x5'));var db=require(_0x11c2('0x6'))['db'];var utils=require(_0x11c2('0x7'));var logger=require(_0x11c2('0x8'))('rpc');var config=require(_0x11c2('0x9'));var jayson=require(_0x11c2('0xa'));var client=jayson[_0x11c2('0xb')][_0x11c2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c772f,_0x593d0d,_0x51e937){return new BPromise(function(_0x9cbef1,_0xd9a11d){return client[_0x11c2('0xd')](_0x5c772f,_0x51e937)[_0x11c2('0xe')](function(_0x4f7d79){logger[_0x11c2('0xf')](_0x11c2('0x10'),_0x593d0d,_0x11c2('0x11'));logger[_0x11c2('0x12')](_0x11c2('0x13'),_0x593d0d,'request\x20sent',JSON[_0x11c2('0x14')](_0x4f7d79));if(_0x4f7d79[_0x11c2('0x15')]){if(_0x4f7d79['error'][_0x11c2('0x16')]===0x1f4){logger[_0x11c2('0x15')](_0x11c2('0x10'),_0x593d0d,_0x4f7d79[_0x11c2('0x15')]['message']);return _0xd9a11d(_0x4f7d79[_0x11c2('0x15')][_0x11c2('0x17')]);}logger[_0x11c2('0x15')]('VtigerConfiguration,\x20%s,\x20%s',_0x593d0d,_0x4f7d79[_0x11c2('0x15')][_0x11c2('0x17')]);return _0x9cbef1(_0x4f7d79[_0x11c2('0x15')]['message']);}else{logger[_0x11c2('0xf')](_0x11c2('0x10'),_0x593d0d,_0x11c2('0x11'));_0x9cbef1(_0x4f7d79[_0x11c2('0x18')][_0x11c2('0x17')]);}})[_0x11c2('0x19')](function(_0x4994d0){logger[_0x11c2('0x15')](_0x11c2('0x10'),_0x593d0d,_0x4994d0);_0xd9a11d(_0x4994d0);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index ef4ed9c..2ea922d 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 _0x4d22=['exports','express','fs-extra','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy'];(function(_0x33667c,_0xda7ae2){var _0x3dada6=function(_0x2f6b12){while(--_0x2f6b12){_0x33667c['push'](_0x33667c['shift']());}};_0x3dada6(++_0xda7ae2);}(_0x4d22,0x10f));var _0x24d2=function(_0xfa5032,_0x5be306){_0xfa5032=_0xfa5032-0x0;var _0x41f425=_0x4d22[_0xfa5032];return _0x41f425;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x24d2('0x0'));var router=express['Router']();var fs_extra=require(_0x24d2('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x24d2('0x2'));var config=require('../../config/environment');var controller=require(_0x24d2('0x3'));router[_0x24d2('0x4')]('/',auth[_0x24d2('0x5')](),controller[_0x24d2('0x6')]);router['get'](_0x24d2('0x7'),auth['isAuthenticated'](),controller[_0x24d2('0x8')]);router[_0x24d2('0x9')]('/',auth['isAuthenticated'](),controller['create']);router[_0x24d2('0xa')](_0x24d2('0x7'),auth['isAuthenticated'](),controller[_0x24d2('0xb')]);router[_0x24d2('0xc')]('/:id',auth[_0x24d2('0x5')](),controller[_0x24d2('0xd')]);module[_0x24d2('0xe')]=router; \ No newline at end of file +var _0x5273=['delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','index','/:id','isAuthenticated','show','post','create','put'];(function(_0x4fe4d2,_0x7995c4){var _0x56541d=function(_0x3542f5){while(--_0x3542f5){_0x4fe4d2['push'](_0x4fe4d2['shift']());}};_0x56541d(++_0x7995c4);}(_0x5273,0x1f0));var _0x3527=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5273[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x3527('0x0'));var path=require(_0x3527('0x1'));var timeout=require(_0x3527('0x2'));var express=require(_0x3527('0x3'));var router=express[_0x3527('0x4')]();var fs_extra=require(_0x3527('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3527('0x6'));var config=require(_0x3527('0x7'));var controller=require(_0x3527('0x8'));router[_0x3527('0x9')]('/',auth['isAuthenticated'](),controller[_0x3527('0xa')]);router['get'](_0x3527('0xb'),auth[_0x3527('0xc')](),controller[_0x3527('0xd')]);router[_0x3527('0xe')]('/',auth[_0x3527('0xc')](),controller[_0x3527('0xf')]);router[_0x3527('0x10')](_0x3527('0xb'),auth[_0x3527('0xc')](),controller['update']);router[_0x3527('0x11')](_0x3527('0xb'),auth[_0x3527('0xc')](),controller[_0x3527('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index ab82fd0..98ebd1e 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 _0xd799=['customVariable','picklist','string','STRING','exports','ENUM','variable'];(function(_0x14a067,_0x3bc444){var _0x418dc3=function(_0x5736e0){while(--_0x5736e0){_0x14a067['push'](_0x14a067['shift']());}};_0x418dc3(++_0x3bc444);}(_0xd799,0x82));var _0x9d79=function(_0x487244,_0x1e6e88){_0x487244=_0x487244-0x0;var _0x86035c=_0xd799[_0x487244];return _0x86035c;};'use strict';var Sequelize=require('sequelize');module[_0x9d79('0x0')]={'type':{'type':Sequelize[_0x9d79('0x1')]('string',_0x9d79('0x2'),_0x9d79('0x3'),'keyValue',_0x9d79('0x4')),'defaultValue':_0x9d79('0x5')},'content':{'type':Sequelize[_0x9d79('0x6')]},'key':{'type':Sequelize[_0x9d79('0x6')]},'keyType':{'type':Sequelize[_0x9d79('0x1')](_0x9d79('0x5'),_0x9d79('0x2'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9d79('0x6')]},'nameField':{'type':Sequelize[_0x9d79('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x13bf=['BOOLEAN','exports','string','variable','customVariable','keyValue','STRING'];(function(_0x1c0fd0,_0x231306){var _0x5ac6b2=function(_0x2c03fb){while(--_0x2c03fb){_0x1c0fd0['push'](_0x1c0fd0['shift']());}};_0x5ac6b2(++_0x231306);}(_0x13bf,0x1ba));var _0xf13b=function(_0x44820d,_0x5d3bb0){_0x44820d=_0x44820d-0x0;var _0x46367d=_0x13bf[_0x44820d];return _0x46367d;};'use strict';var Sequelize=require('sequelize');module[_0xf13b('0x0')]={'type':{'type':Sequelize['ENUM'](_0xf13b('0x1'),_0xf13b('0x2'),_0xf13b('0x3'),_0xf13b('0x4'),'picklist'),'defaultValue':_0xf13b('0x1')},'content':{'type':Sequelize[_0xf13b('0x5')]},'key':{'type':Sequelize[_0xf13b('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xf13b('0x1'),_0xf13b('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0xf13b('0x5')]},'idField':{'type':Sequelize[_0xf13b('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf13b('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 1302f38..1fd5c67 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 _0x79f4=['desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','error','name','send','index','map','VtigerField','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','findAll','rows','catch','show','params','includeAll','find','body','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce'];(function(_0x2327be,_0x769e7){var _0x469e6c=function(_0x45eadc){while(--_0x45eadc){_0x2327be['push'](_0x2327be['shift']());}};_0x469e6c(++_0x769e7);}(_0x79f4,0x113));var _0x479f=function(_0x2babb3,_0x2640eb){_0x2babb3=_0x2babb3-0x0;var _0x333670=_0x79f4[_0x2babb3];return _0x333670;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x479f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x479f('0x1'));var rp=require('request-promise');var moment=require(_0x479f('0x2'));var BPromise=require(_0x479f('0x3'));var Mustache=require(_0x479f('0x4'));var util=require(_0x479f('0x5'));var path=require(_0x479f('0x6'));var sox=require(_0x479f('0x7'));var csv=require(_0x479f('0x8'));var ejs=require(_0x479f('0x9'));var fs=require('fs');var fs_extra=require(_0x479f('0xa'));var _=require('lodash');var squel=require(_0x479f('0xb'));var crypto=require('crypto');var jsforce=require(_0x479f('0xc'));var deskjs=require(_0x479f('0xd'));var toCsv=require(_0x479f('0x8'));var querystring=require(_0x479f('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x479f('0xf'));var qs=require(_0x479f('0x10'));var as=require(_0x479f('0x11'));var hardwareService=require(_0x479f('0x12'));var logger=require(_0x479f('0x13'))(_0x479f('0x14'));var utils=require('../../config/utils');var config=require(_0x479f('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e3ee7,_0x1b9d90){_0x1b9d90=_0x1b9d90||0xcc;return function(_0x2fc280){if(_0x2fc280){return _0x1e3ee7[_0x479f('0x16')](_0x1b9d90);}return _0x1e3ee7['status'](_0x1b9d90)[_0x479f('0x17')]();};}function respondWithResult(_0x34b764,_0x3fa0a0){_0x3fa0a0=_0x3fa0a0||0xc8;return function(_0x56906f){if(_0x56906f){return _0x34b764[_0x479f('0x18')](_0x3fa0a0)[_0x479f('0x19')](_0x56906f);}};}function respondWithFilteredResult(_0x10f51f,_0x40f4f0){return function(_0x2ffc39){if(_0x2ffc39){var _0xe7633f=typeof _0x40f4f0[_0x479f('0x1a')]===_0x479f('0x1b')&&typeof _0x40f4f0[_0x479f('0x1c')]==='undefined';var _0x2f1e8d=_0x2ffc39[_0x479f('0x1d')];var _0xce6e86=_0xe7633f?0x0:_0x40f4f0[_0x479f('0x1a')];var _0x3e6555=_0xe7633f?_0x2ffc39[_0x479f('0x1d')]:_0x40f4f0[_0x479f('0x1a')]+_0x40f4f0['limit'];var _0x1a52af;if(_0x3e6555>=_0x2f1e8d){_0x3e6555=_0x2f1e8d;_0x1a52af=0xc8;}else{_0x1a52af=0xce;}_0x10f51f[_0x479f('0x18')](_0x1a52af);return _0x10f51f[_0x479f('0x1e')]('Content-Range',_0xce6e86+'-'+_0x3e6555+'/'+_0x2f1e8d)[_0x479f('0x19')](_0x2ffc39);}return null;};}function patchUpdates(_0x3440f2){return function(_0x4646ff){try{jsonpatch[_0x479f('0x1f')](_0x4646ff,_0x3440f2,!![]);}catch(_0x500268){return BPromise[_0x479f('0x20')](_0x500268);}return _0x4646ff[_0x479f('0x21')]();};}function saveUpdates(_0x4219dc,_0x5e5dfe){return function(_0x5986b5){if(_0x5986b5){return _0x5986b5[_0x479f('0x22')](_0x4219dc)['then'](function(_0x27b71b){return _0x27b71b;});}return null;};}function removeEntity(_0x58267e,_0x5546b7){return function(_0x3bac9a){if(_0x3bac9a){return _0x3bac9a[_0x479f('0x23')]()['then'](function(){_0x58267e[_0x479f('0x18')](0xcc)[_0x479f('0x17')]();});}};}function handleEntityNotFound(_0x10ad9a,_0x5949f7){return function(_0x18edb7){if(!_0x18edb7){_0x10ad9a[_0x479f('0x16')](0x194);}return _0x18edb7;};}function handleError(_0x337212,_0x2d297b){_0x2d297b=_0x2d297b||0x1f4;return function(_0xdbe137){logger[_0x479f('0x24')](_0xdbe137['stack']);if(_0xdbe137[_0x479f('0x25')]){delete _0xdbe137[_0x479f('0x25')];}_0x337212[_0x479f('0x18')](_0x2d297b)[_0x479f('0x26')](_0xdbe137);};}exports[_0x479f('0x27')]=function(_0x5cc486,_0x17f806){var _0x5cad57={},_0x52b939={},_0x3cbc56={'count':0x0,'rows':[]};var _0x21704d=_[_0x479f('0x28')](db[_0x479f('0x29')][_0x479f('0x2a')],function(_0x9b21b3){return{'name':_0x9b21b3[_0x479f('0x2b')],'type':_0x9b21b3[_0x479f('0x2c')][_0x479f('0x2d')]};});_0x52b939[_0x479f('0x2e')]=_[_0x479f('0x28')](_0x21704d,_0x479f('0x25'));_0x52b939[_0x479f('0x2f')]=_[_0x479f('0x30')](_0x5cc486[_0x479f('0x2f')]);_0x52b939[_0x479f('0x31')]=_[_0x479f('0x32')](_0x52b939[_0x479f('0x2e')],_0x52b939[_0x479f('0x2f')]);_0x5cad57[_0x479f('0x33')]=_[_0x479f('0x32')](_0x52b939[_0x479f('0x2e')],qs[_0x479f('0x34')](_0x5cc486[_0x479f('0x2f')][_0x479f('0x34')]));_0x5cad57[_0x479f('0x33')]=_0x5cad57['attributes'][_0x479f('0x35')]?_0x5cad57[_0x479f('0x33')]:_0x52b939['model'];if(!_0x5cc486[_0x479f('0x2f')]['hasOwnProperty'](_0x479f('0x36'))){_0x5cad57[_0x479f('0x1c')]=qs[_0x479f('0x1c')](_0x5cc486[_0x479f('0x2f')][_0x479f('0x1c')]);_0x5cad57[_0x479f('0x1a')]=qs[_0x479f('0x1a')](_0x5cc486[_0x479f('0x2f')][_0x479f('0x1a')]);}_0x5cad57[_0x479f('0x37')]=qs['sort'](_0x5cc486[_0x479f('0x2f')][_0x479f('0x38')]);_0x5cad57[_0x479f('0x39')]=qs[_0x479f('0x31')](_[_0x479f('0x3a')](_0x5cc486[_0x479f('0x2f')],_0x52b939['filters']),_0x21704d);if(_0x5cc486[_0x479f('0x2f')][_0x479f('0x3b')]){_0x5cad57[_0x479f('0x39')]=_[_0x479f('0x3c')](_0x5cad57[_0x479f('0x39')],{'$or':_['map'](_0x21704d,function(_0x5eb44a){if(_0x5eb44a[_0x479f('0x2c')]!==_0x479f('0x3d')){var _0x27add6={};_0x27add6[_0x5eb44a['name']]={'$like':'%'+_0x5cc486['query'][_0x479f('0x3b')]+'%'};return _0x27add6;}})});}_0x5cad57=_['merge']({},_0x5cad57,_0x5cc486[_0x479f('0x3e')]);var _0x152097={'where':_0x5cad57[_0x479f('0x39')]};return db[_0x479f('0x29')]['count'](_0x152097)[_0x479f('0x3f')](function(_0x6bdbac){_0x3cbc56[_0x479f('0x1d')]=_0x6bdbac;if(_0x5cc486[_0x479f('0x2f')]['includeAll']){_0x5cad57['include']=[{'all':!![]}];}return db['VtigerField'][_0x479f('0x40')](_0x5cad57);})[_0x479f('0x3f')](function(_0x57f6a8){_0x3cbc56[_0x479f('0x41')]=_0x57f6a8;return _0x3cbc56;})[_0x479f('0x3f')](respondWithFilteredResult(_0x17f806,_0x5cad57))[_0x479f('0x42')](handleError(_0x17f806,null));};exports[_0x479f('0x43')]=function(_0xd62bb,_0x40bc55){var _0x33b7f6={'raw':!![],'where':{'id':_0xd62bb[_0x479f('0x44')]['id']}},_0x53b10d={};_0x53b10d[_0x479f('0x2e')]=_[_0x479f('0x30')](db[_0x479f('0x29')][_0x479f('0x2a')]);_0x53b10d[_0x479f('0x2f')]=_[_0x479f('0x30')](_0xd62bb[_0x479f('0x2f')]);_0x53b10d[_0x479f('0x31')]=_['intersection'](_0x53b10d['model'],_0x53b10d['query']);_0x33b7f6[_0x479f('0x33')]=_[_0x479f('0x32')](_0x53b10d[_0x479f('0x2e')],qs[_0x479f('0x34')](_0xd62bb['query'][_0x479f('0x34')]));_0x33b7f6[_0x479f('0x33')]=_0x33b7f6[_0x479f('0x33')]['length']?_0x33b7f6[_0x479f('0x33')]:_0x53b10d['model'];if(_0xd62bb[_0x479f('0x2f')][_0x479f('0x45')]){_0x33b7f6['include']=[{'all':!![]}];}_0x33b7f6=_[_0x479f('0x3c')]({},_0x33b7f6,_0xd62bb['options']);return db['VtigerField'][_0x479f('0x46')](_0x33b7f6)[_0x479f('0x3f')](handleEntityNotFound(_0x40bc55,null))[_0x479f('0x3f')](respondWithResult(_0x40bc55,null))[_0x479f('0x42')](handleError(_0x40bc55,null));};exports['create']=function(_0x5f5abe,_0x23c3ec){return db['VtigerField']['create'](_0x5f5abe['body'],{})[_0x479f('0x3f')](respondWithResult(_0x23c3ec,0xc9))[_0x479f('0x42')](handleError(_0x23c3ec,null));};exports['update']=function(_0x335894,_0x497d47){if(_0x335894[_0x479f('0x47')]['id']){delete _0x335894[_0x479f('0x47')]['id'];}return db[_0x479f('0x29')][_0x479f('0x46')]({'where':{'id':_0x335894['params']['id']}})[_0x479f('0x3f')](handleEntityNotFound(_0x497d47,null))[_0x479f('0x3f')](saveUpdates(_0x335894[_0x479f('0x47')],null))[_0x479f('0x3f')](respondWithResult(_0x497d47,null))[_0x479f('0x42')](handleError(_0x497d47,null));};exports[_0x479f('0x23')]=function(_0x78fcc7,_0x4c9a3b){return db[_0x479f('0x29')][_0x479f('0x46')]({'where':{'id':_0x78fcc7[_0x479f('0x44')]['id']}})[_0x479f('0x3f')](handleEntityNotFound(_0x4c9a3b,null))[_0x479f('0x3f')](removeEntity(_0x4c9a3b,null))[_0x479f('0x42')](handleError(_0x4c9a3b,null));}; \ No newline at end of file +var _0x08a3=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','save','update','destroy','then','error','stack','name','send','index','VtigerField','fieldName','type','key','map','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','options','create','body','find'];(function(_0x3866ef,_0x2102a1){var _0xfdd865=function(_0x46fae5){while(--_0x46fae5){_0x3866ef['push'](_0x3866ef['shift']());}};_0xfdd865(++_0x2102a1);}(_0x08a3,0x12c));var _0x308a=function(_0x2651c9,_0x29e244){_0x2651c9=_0x2651c9-0x0;var _0x588e8a=_0x08a3[_0x2651c9];return _0x588e8a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x308a('0x0'));var jsonpatch=require(_0x308a('0x1'));var rp=require(_0x308a('0x2'));var moment=require('moment');var BPromise=require(_0x308a('0x3'));var Mustache=require(_0x308a('0x4'));var util=require(_0x308a('0x5'));var path=require(_0x308a('0x6'));var sox=require(_0x308a('0x7'));var csv=require('to-csv');var ejs=require(_0x308a('0x8'));var fs=require('fs');var fs_extra=require(_0x308a('0x9'));var _=require(_0x308a('0xa'));var squel=require(_0x308a('0xb'));var crypto=require(_0x308a('0xc'));var jsforce=require(_0x308a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x308a('0xe'));var querystring=require(_0x308a('0xf'));var Papa=require(_0x308a('0x10'));var Redis=require(_0x308a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x308a('0x12'));var as=require(_0x308a('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x308a('0x14'));var utils=require(_0x308a('0x15'));var config=require(_0x308a('0x16'));var licenseUtil=require(_0x308a('0x17'));var db=require(_0x308a('0x18'))['db'];function respondWithStatusCode(_0x43e959,_0x4dd42a){_0x4dd42a=_0x4dd42a||0xcc;return function(_0x490217){if(_0x490217){return _0x43e959[_0x308a('0x19')](_0x4dd42a);}return _0x43e959[_0x308a('0x1a')](_0x4dd42a)[_0x308a('0x1b')]();};}function respondWithResult(_0x48378e,_0x2d83b7){_0x2d83b7=_0x2d83b7||0xc8;return function(_0x338453){if(_0x338453){return _0x48378e[_0x308a('0x1a')](_0x2d83b7)[_0x308a('0x1c')](_0x338453);}};}function respondWithFilteredResult(_0xf1dc76,_0x18526a){return function(_0x1d1aa1){if(_0x1d1aa1){var _0x48ee18=typeof _0x18526a[_0x308a('0x1d')]==='undefined'&&typeof _0x18526a[_0x308a('0x1e')]===_0x308a('0x1f');var _0x504b34=_0x1d1aa1[_0x308a('0x20')];var _0x4e6b06=_0x48ee18?0x0:_0x18526a[_0x308a('0x1d')];var _0x36814e=_0x48ee18?_0x1d1aa1['count']:_0x18526a[_0x308a('0x1d')]+_0x18526a[_0x308a('0x1e')];var _0x47e466;if(_0x36814e>=_0x504b34){_0x36814e=_0x504b34;_0x47e466=0xc8;}else{_0x47e466=0xce;}_0xf1dc76[_0x308a('0x1a')](_0x47e466);return _0xf1dc76[_0x308a('0x21')]('Content-Range',_0x4e6b06+'-'+_0x36814e+'/'+_0x504b34)[_0x308a('0x1c')](_0x1d1aa1);}return null;};}function patchUpdates(_0x18145b){return function(_0x1d1e9b){try{jsonpatch['apply'](_0x1d1e9b,_0x18145b,!![]);}catch(_0x451ce3){return BPromise['reject'](_0x451ce3);}return _0x1d1e9b[_0x308a('0x22')]();};}function saveUpdates(_0x50f5ae,_0x515003){return function(_0x1f59ed){if(_0x1f59ed){return _0x1f59ed[_0x308a('0x23')](_0x50f5ae)['then'](function(_0x23d036){return _0x23d036;});}return null;};}function removeEntity(_0x2bae1a,_0x301e90){return function(_0x44a349){if(_0x44a349){return _0x44a349[_0x308a('0x24')]()[_0x308a('0x25')](function(){_0x2bae1a[_0x308a('0x1a')](0xcc)[_0x308a('0x1b')]();});}};}function handleEntityNotFound(_0x43169f,_0x2bcaee){return function(_0x365b95){if(!_0x365b95){_0x43169f['sendStatus'](0x194);}return _0x365b95;};}function handleError(_0x3803dd,_0x567c35){_0x567c35=_0x567c35||0x1f4;return function(_0x1e06af){logger[_0x308a('0x26')](_0x1e06af[_0x308a('0x27')]);if(_0x1e06af['name']){delete _0x1e06af[_0x308a('0x28')];}_0x3803dd[_0x308a('0x1a')](_0x567c35)[_0x308a('0x29')](_0x1e06af);};}exports[_0x308a('0x2a')]=function(_0x428478,_0x3be30c){var _0x9e7182={},_0x358bc9={},_0x3df3bd={'count':0x0,'rows':[]};var _0x11390b=_['map'](db[_0x308a('0x2b')]['rawAttributes'],function(_0x3303e4){return{'name':_0x3303e4[_0x308a('0x2c')],'type':_0x3303e4[_0x308a('0x2d')][_0x308a('0x2e')]};});_0x358bc9['model']=_[_0x308a('0x2f')](_0x11390b,_0x308a('0x28'));_0x358bc9[_0x308a('0x30')]=_['keys'](_0x428478['query']);_0x358bc9[_0x308a('0x31')]=_[_0x308a('0x32')](_0x358bc9[_0x308a('0x33')],_0x358bc9[_0x308a('0x30')]);_0x9e7182[_0x308a('0x34')]=_['intersection'](_0x358bc9[_0x308a('0x33')],qs[_0x308a('0x35')](_0x428478[_0x308a('0x30')][_0x308a('0x35')]));_0x9e7182[_0x308a('0x34')]=_0x9e7182[_0x308a('0x34')][_0x308a('0x36')]?_0x9e7182[_0x308a('0x34')]:_0x358bc9[_0x308a('0x33')];if(!_0x428478['query'][_0x308a('0x37')](_0x308a('0x38'))){_0x9e7182[_0x308a('0x1e')]=qs[_0x308a('0x1e')](_0x428478[_0x308a('0x30')][_0x308a('0x1e')]);_0x9e7182[_0x308a('0x1d')]=qs[_0x308a('0x1d')](_0x428478[_0x308a('0x30')][_0x308a('0x1d')]);}_0x9e7182[_0x308a('0x39')]=qs[_0x308a('0x3a')](_0x428478[_0x308a('0x30')]['sort']);_0x9e7182[_0x308a('0x3b')]=qs[_0x308a('0x31')](_[_0x308a('0x3c')](_0x428478[_0x308a('0x30')],_0x358bc9[_0x308a('0x31')]),_0x11390b);if(_0x428478['query'][_0x308a('0x3d')]){_0x9e7182[_0x308a('0x3b')]=_['merge'](_0x9e7182[_0x308a('0x3b')],{'$or':_[_0x308a('0x2f')](_0x11390b,function(_0x40b60d){if(_0x40b60d[_0x308a('0x2d')]!=='VIRTUAL'){var _0x500c06={};_0x500c06[_0x40b60d[_0x308a('0x28')]]={'$like':'%'+_0x428478[_0x308a('0x30')][_0x308a('0x3d')]+'%'};return _0x500c06;}})});}_0x9e7182=_[_0x308a('0x3e')]({},_0x9e7182,_0x428478['options']);var _0x5377bb={'where':_0x9e7182['where']};return db['VtigerField'][_0x308a('0x20')](_0x5377bb)[_0x308a('0x25')](function(_0x29e6f7){_0x3df3bd[_0x308a('0x20')]=_0x29e6f7;if(_0x428478[_0x308a('0x30')][_0x308a('0x3f')]){_0x9e7182[_0x308a('0x40')]=[{'all':!![]}];}return db[_0x308a('0x2b')][_0x308a('0x41')](_0x9e7182);})[_0x308a('0x25')](function(_0x1ffa66){_0x3df3bd[_0x308a('0x42')]=_0x1ffa66;return _0x3df3bd;})[_0x308a('0x25')](respondWithFilteredResult(_0x3be30c,_0x9e7182))[_0x308a('0x43')](handleError(_0x3be30c,null));};exports['show']=function(_0x588c91,_0x14936e){var _0x5057a={'raw':!![],'where':{'id':_0x588c91[_0x308a('0x44')]['id']}},_0x5de3fe={};_0x5de3fe[_0x308a('0x33')]=_[_0x308a('0x45')](db[_0x308a('0x2b')][_0x308a('0x46')]);_0x5de3fe[_0x308a('0x30')]=_[_0x308a('0x45')](_0x588c91[_0x308a('0x30')]);_0x5de3fe[_0x308a('0x31')]=_[_0x308a('0x32')](_0x5de3fe[_0x308a('0x33')],_0x5de3fe[_0x308a('0x30')]);_0x5057a['attributes']=_[_0x308a('0x32')](_0x5de3fe[_0x308a('0x33')],qs[_0x308a('0x35')](_0x588c91[_0x308a('0x30')][_0x308a('0x35')]));_0x5057a['attributes']=_0x5057a[_0x308a('0x34')][_0x308a('0x36')]?_0x5057a[_0x308a('0x34')]:_0x5de3fe['model'];if(_0x588c91['query'][_0x308a('0x3f')]){_0x5057a[_0x308a('0x40')]=[{'all':!![]}];}_0x5057a=_[_0x308a('0x3e')]({},_0x5057a,_0x588c91[_0x308a('0x47')]);return db[_0x308a('0x2b')]['find'](_0x5057a)[_0x308a('0x25')](handleEntityNotFound(_0x14936e,null))['then'](respondWithResult(_0x14936e,null))[_0x308a('0x43')](handleError(_0x14936e,null));};exports[_0x308a('0x48')]=function(_0x39bd56,_0x2958bf){return db[_0x308a('0x2b')][_0x308a('0x48')](_0x39bd56['body'],{})[_0x308a('0x25')](respondWithResult(_0x2958bf,0xc9))[_0x308a('0x43')](handleError(_0x2958bf,null));};exports[_0x308a('0x23')]=function(_0x2193ed,_0x218e23){if(_0x2193ed['body']['id']){delete _0x2193ed[_0x308a('0x49')]['id'];}return db[_0x308a('0x2b')][_0x308a('0x4a')]({'where':{'id':_0x2193ed['params']['id']}})[_0x308a('0x25')](handleEntityNotFound(_0x218e23,null))[_0x308a('0x25')](saveUpdates(_0x2193ed[_0x308a('0x49')],null))[_0x308a('0x25')](respondWithResult(_0x218e23,null))[_0x308a('0x43')](handleError(_0x218e23,null));};exports['destroy']=function(_0x11eb65,_0x3d198e){return db[_0x308a('0x2b')][_0x308a('0x4a')]({'where':{'id':_0x11eb65[_0x308a('0x44')]['id']}})[_0x308a('0x25')](handleEntityNotFound(_0x3d198e,null))[_0x308a('0x25')](removeEntity(_0x3d198e,null))[_0x308a('0x43')](handleError(_0x3d198e,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 757e260..cfe18bb 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 _0xa439=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','VtigerField','int_vtiger_fields','vtiger_unique_index','FieldId','lodash'];(function(_0x4a63fc,_0x167a02){var _0x30d4c3=function(_0x3eecb2){while(--_0x3eecb2){_0x4a63fc['push'](_0x4a63fc['shift']());}};_0x30d4c3(++_0x167a02);}(_0xa439,0x137));var _0x9a43=function(_0x5b6f19,_0x3dcb2d){_0x5b6f19=_0x5b6f19-0x0;var _0x5d02e5=_0xa439[_0x5b6f19];return _0x5d02e5;};'use strict';var _=require(_0x9a43('0x0'));var util=require(_0x9a43('0x1'));var logger=require(_0x9a43('0x2'))('api');var moment=require(_0x9a43('0x3'));var BPromise=require(_0x9a43('0x4'));var rp=require(_0x9a43('0x5'));var fs=require('fs');var path=require(_0x9a43('0x6'));var rimraf=require(_0x9a43('0x7'));var config=require(_0x9a43('0x8'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x1d2359,_0x12590c){return _0x1d2359['define'](_0x9a43('0x9'),attributes,{'tableName':_0x9a43('0xa'),'paranoid':![],'indexes':[{'name':_0x9a43('0xb'),'fields':['idField',_0x9a43('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcdfa=['lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./intVtigerField.attributes','exports','define','VtigerField','vtiger_unique_index','idField','FieldId'];(function(_0x2a0377,_0x44da1c){var _0x1f1762=function(_0x4499d1){while(--_0x4499d1){_0x2a0377['push'](_0x2a0377['shift']());}};_0x1f1762(++_0x44da1c);}(_0xcdfa,0xfc));var _0xacdf=function(_0x2d949d,_0x52ef4b){_0x2d949d=_0x2d949d-0x0;var _0x57e835=_0xcdfa[_0x2d949d];return _0x57e835;};'use strict';var _=require(_0xacdf('0x0'));var util=require('util');var logger=require(_0xacdf('0x1'))(_0xacdf('0x2'));var moment=require(_0xacdf('0x3'));var BPromise=require('bluebird');var rp=require(_0xacdf('0x4'));var fs=require('fs');var path=require(_0xacdf('0x5'));var rimraf=require('rimraf');var config=require(_0xacdf('0x6'));var attributes=require(_0xacdf('0x7'));module[_0xacdf('0x8')]=function(_0x26db93,_0x228174){return _0x26db93[_0xacdf('0x9')](_0xacdf('0xa'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0xacdf('0xb'),'fields':[_0xacdf('0xc'),_0xacdf('0xd')],'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 fc19aaa..cb7e5c6 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 _0xfc0d=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','client','http','request','then','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x484e25,_0x3724f0){var _0x25806=function(_0x4d71c3){while(--_0x4d71c3){_0x484e25['push'](_0x484e25['shift']());}};_0x25806(++_0x3724f0);}(_0xfc0d,0x17b));var _0xdfc0=function(_0x4cdf2d,_0x228549){_0x4cdf2d=_0x4cdf2d-0x0;var _0xfb36d5=_0xfc0d[_0x4cdf2d];return _0xfb36d5;};'use strict';var _=require(_0xdfc0('0x0'));var util=require('util');var moment=require(_0xdfc0('0x1'));var BPromise=require(_0xdfc0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdfc0('0x3'));var db=require(_0xdfc0('0x4'))['db'];var utils=require(_0xdfc0('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdfc0('0x6')][_0xdfc0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1da9cb,_0x3a883b,_0x5b45c9){return new BPromise(function(_0x2f4a04,_0x534910){return client[_0xdfc0('0x8')](_0x1da9cb,_0x5b45c9)[_0xdfc0('0x9')](function(_0x434f80){logger['info'](_0xdfc0('0xa'),_0x3a883b,_0xdfc0('0xb'));logger[_0xdfc0('0xc')](_0xdfc0('0xd'),_0x3a883b,_0xdfc0('0xb'),JSON[_0xdfc0('0xe')](_0x434f80));if(_0x434f80[_0xdfc0('0xf')]){if(_0x434f80[_0xdfc0('0xf')][_0xdfc0('0x10')]===0x1f4){logger[_0xdfc0('0xf')](_0xdfc0('0xa'),_0x3a883b,_0x434f80[_0xdfc0('0xf')]['message']);return _0x534910(_0x434f80[_0xdfc0('0xf')][_0xdfc0('0x11')]);}logger['error']('VtigerField,\x20%s,\x20%s',_0x3a883b,_0x434f80[_0xdfc0('0xf')][_0xdfc0('0x11')]);return _0x2f4a04(_0x434f80[_0xdfc0('0xf')]['message']);}else{logger[_0xdfc0('0x12')](_0xdfc0('0xa'),_0x3a883b,_0xdfc0('0xb'));_0x2f4a04(_0x434f80[_0xdfc0('0x13')][_0xdfc0('0x11')]);}})[_0xdfc0('0x14')](function(_0x3dc645){logger[_0xdfc0('0xf')](_0xdfc0('0xa'),_0x3a883b,_0x3dc645);_0x534910(_0x3dc645);});});} \ No newline at end of file +var _0x690a=['randomstring','rpc','../../config/environment','jayson/promise','client','request','then','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util','moment'];(function(_0x57edf0,_0x2848f3){var _0x1711dc=function(_0xf6ad88){while(--_0xf6ad88){_0x57edf0['push'](_0x57edf0['shift']());}};_0x1711dc(++_0x2848f3);}(_0x690a,0x165));var _0xa690=function(_0x4af491,_0x42e746){_0x4af491=_0x4af491-0x0;var _0x2a4cf6=_0x690a[_0x4af491];return _0x2a4cf6;};'use strict';var _=require(_0xa690('0x0'));var util=require(_0xa690('0x1'));var moment=require(_0xa690('0x2'));var BPromise=require('bluebird');var rs=require(_0xa690('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa690('0x4'));var config=require(_0xa690('0x5'));var jayson=require(_0xa690('0x6'));var client=jayson[_0xa690('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e6c36,_0x40dc9a,_0xcee6cc){return new BPromise(function(_0x88ad5b,_0x3b4682){return client[_0xa690('0x8')](_0x5e6c36,_0xcee6cc)[_0xa690('0x9')](function(_0x12b5b0){logger['info'](_0xa690('0xa'),_0x40dc9a,'request\x20sent');logger[_0xa690('0xb')](_0xa690('0xc'),_0x40dc9a,_0xa690('0xd'),JSON['stringify'](_0x12b5b0));if(_0x12b5b0[_0xa690('0xe')]){if(_0x12b5b0[_0xa690('0xe')][_0xa690('0xf')]===0x1f4){logger['error']('VtigerField,\x20%s,\x20%s',_0x40dc9a,_0x12b5b0[_0xa690('0xe')][_0xa690('0x10')]);return _0x3b4682(_0x12b5b0[_0xa690('0xe')][_0xa690('0x10')]);}logger[_0xa690('0xe')](_0xa690('0xa'),_0x40dc9a,_0x12b5b0[_0xa690('0xe')][_0xa690('0x10')]);return _0x88ad5b(_0x12b5b0[_0xa690('0xe')][_0xa690('0x10')]);}else{logger['info'](_0xa690('0xa'),_0x40dc9a,'request\x20sent');_0x88ad5b(_0x12b5b0['result'][_0xa690('0x10')]);}})[_0xa690('0x11')](function(_0x5947eb){logger[_0xa690('0xe')]('VtigerField,\x20%s,\x20%s',_0x40dc9a,_0x5947eb);_0x3b4682(_0x5947eb);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 342dc3f..aa4c3b3 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 _0x21ff=['/:id','show','/:id/configurations','post','addConfiguration','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index'];(function(_0x44e8fb,_0x23e56a){var _0x1d5476=function(_0x26779b){while(--_0x26779b){_0x44e8fb['push'](_0x44e8fb['shift']());}};_0x1d5476(++_0x23e56a);}(_0x21ff,0x8c));var _0xf21f=function(_0x5bf2b3,_0xfcd364){_0x5bf2b3=_0x5bf2b3-0x0;var _0x5e8a9b=_0x21ff[_0x5bf2b3];return _0x5e8a9b;};'use strict';var multer=require(_0xf21f('0x0'));var util=require(_0xf21f('0x1'));var path=require(_0xf21f('0x2'));var timeout=require(_0xf21f('0x3'));var express=require(_0xf21f('0x4'));var router=express[_0xf21f('0x5')]();var fs_extra=require(_0xf21f('0x6'));var auth=require(_0xf21f('0x7'));var interaction=require(_0xf21f('0x8'));var config=require(_0xf21f('0x9'));var controller=require(_0xf21f('0xa'));router[_0xf21f('0xb')]('/',auth[_0xf21f('0xc')](),controller[_0xf21f('0xd')]);router['get'](_0xf21f('0xe'),auth[_0xf21f('0xc')](),controller[_0xf21f('0xf')]);router[_0xf21f('0xb')](_0xf21f('0x10'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xf21f('0xb')]('/:id/fields',auth[_0xf21f('0xc')](),controller['getFields']);router['post']('/',auth[_0xf21f('0xc')](),controller['create']);router[_0xf21f('0x11')](_0xf21f('0x10'),auth[_0xf21f('0xc')](),controller[_0xf21f('0x12')]);router[_0xf21f('0x13')](_0xf21f('0xe'),auth[_0xf21f('0xc')](),controller[_0xf21f('0x14')]);router['delete'](_0xf21f('0xe'),auth[_0xf21f('0xc')](),controller[_0xf21f('0x15')]);module['exports']=router; \ No newline at end of file +var _0x081c=['getFields','post','create','addConfiguration','update','delete','exports','multer','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x2b9ac8,_0xf820cb){var _0x3ceea9=function(_0x407d34){while(--_0x407d34){_0x2b9ac8['push'](_0x2b9ac8['shift']());}};_0x3ceea9(++_0xf820cb);}(_0x081c,0xeb));var _0xc081=function(_0x39fcd5,_0x474d5a){_0x39fcd5=_0x39fcd5-0x0;var _0xeb5477=_0x081c[_0x39fcd5];return _0xeb5477;};'use strict';var multer=require(_0xc081('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc081('0x1')]();var fs_extra=require(_0xc081('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xc081('0x3'));var config=require('../../config/environment');var controller=require('./intZendeskAccount.controller');router[_0xc081('0x4')]('/',auth[_0xc081('0x5')](),controller[_0xc081('0x6')]);router['get'](_0xc081('0x7'),auth['isAuthenticated'](),controller[_0xc081('0x8')]);router['get'](_0xc081('0x9'),auth[_0xc081('0x5')](),controller[_0xc081('0xa')]);router['get'](_0xc081('0xb'),auth[_0xc081('0x5')](),controller[_0xc081('0xc')]);router[_0xc081('0xd')]('/',auth['isAuthenticated'](),controller[_0xc081('0xe')]);router[_0xc081('0xd')](_0xc081('0x9'),auth[_0xc081('0x5')](),controller[_0xc081('0xf')]);router['put'](_0xc081('0x7'),auth[_0xc081('0x5')](),controller[_0xc081('0x10')]);router[_0xc081('0x11')](_0xc081('0x7'),auth[_0xc081('0x5')](),controller['destroy']);module[_0xc081('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index f31fcd3..ed2ff8d 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 _0xa6ce=['STRING','username','remoteUri','ENUM','password','token','integrationTab','newTab','sequelize'];(function(_0x163a9f,_0xf9b87){var _0xe0fb8b=function(_0x218a08){while(--_0x218a08){_0x163a9f['push'](_0x163a9f['shift']());}};_0xe0fb8b(++_0xf9b87);}(_0xa6ce,0x15e));var _0xea6c=function(_0x5ac1e5,_0x4b5012){_0x5ac1e5=_0x5ac1e5-0x0;var _0x1bccc6=_0xa6ce[_0x5ac1e5];return _0x1bccc6;};'use strict';var Sequelize=require(_0xea6c('0x0'));module['exports']={'name':{'type':Sequelize[_0xea6c('0x1')]},'description':{'type':Sequelize[_0xea6c('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0xea6c('0x2')},'password':{'type':Sequelize[_0xea6c('0x1')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xea6c('0x3')},'authType':{'type':Sequelize[_0xea6c('0x4')](_0xea6c('0x5'),_0xea6c('0x6')),'defaultValue':_0xea6c('0x5')},'serverUrl':{'type':Sequelize[_0xea6c('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xea6c('0x7'),_0xea6c('0x8')),'defaultValue':_0xea6c('0x7')}}; \ No newline at end of file +var _0xc4aa=['STRING','username','remoteUri','ENUM','password','token','integrationTab','sequelize','exports'];(function(_0x14e3ec,_0xa155db){var _0x12f1fe=function(_0x4c0d06){while(--_0x4c0d06){_0x14e3ec['push'](_0x14e3ec['shift']());}};_0x12f1fe(++_0xa155db);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xc4aa[_0x88cd7b];return _0x56fcc8;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')]},'description':{'type':Sequelize[_0xac4a('0x2')]},'username':{'type':Sequelize[_0xac4a('0x2')],'unique':_0xac4a('0x3')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xac4a('0x4')},'authType':{'type':Sequelize[_0xac4a('0x5')](_0xac4a('0x6'),_0xac4a('0x7')),'defaultValue':_0xac4a('0x6')},'serverUrl':{'type':Sequelize[_0xac4a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xac4a('0x5')](_0xac4a('0x8'),'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 990f1a9..ac65bac 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 _0x9ffd=['catch','show','params','rawAttributes','find','create','body','destroy','getConfigurations','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZendeskField','findOne','username','password','token','authType','substring','lastIndexOf','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','base64','%s/token:%s','toString','Sequelize','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','update','then','stack','name','index','map','ZendeskAccount','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x3e0767,_0x48c9c8){var _0x1a453b=function(_0x4c78d7){while(--_0x4c78d7){_0x3e0767['push'](_0x3e0767['shift']());}};_0x1a453b(++_0x48c9c8);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x17d2f5,_0x2ce8b5){_0x17d2f5=_0x17d2f5-0x0;var _0x470d7d=_0x9ffd[_0x17d2f5];return _0x470d7d;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var hardwareService=require(_0xd9ff('0x13'));var logger=require(_0xd9ff('0x14'))(_0xd9ff('0x15'));var utils=require(_0xd9ff('0x16'));var config=require(_0xd9ff('0x17'));var licenseUtil=require(_0xd9ff('0x18'));var db=require(_0xd9ff('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x47b0d7,_0xaaf7af){_0xaaf7af=_0xaaf7af||0xcc;return function(_0x16a0d9){if(_0x16a0d9){return _0x47b0d7[_0xd9ff('0x1a')](_0xaaf7af);}return _0x47b0d7[_0xd9ff('0x1b')](_0xaaf7af)[_0xd9ff('0x1c')]();};}function respondWithResult(_0x556aa4,_0x2f78c1){_0x2f78c1=_0x2f78c1||0xc8;return function(_0x3c9ace){if(_0x3c9ace){return _0x556aa4['status'](_0x2f78c1)[_0xd9ff('0x1d')](_0x3c9ace);}};}function respondWithFilteredResult(_0x5db010,_0x4ffe54){return function(_0x547e28){if(_0x547e28){var _0x4c5718=typeof _0x4ffe54[_0xd9ff('0x1e')]==='undefined'&&typeof _0x4ffe54[_0xd9ff('0x1f')]===_0xd9ff('0x20');var _0x39c6ce=_0x547e28[_0xd9ff('0x21')];var _0x5f45c4=_0x4c5718?0x0:_0x4ffe54[_0xd9ff('0x1e')];var _0x3ccf15=_0x4c5718?_0x547e28[_0xd9ff('0x21')]:_0x4ffe54[_0xd9ff('0x1e')]+_0x4ffe54[_0xd9ff('0x1f')];var _0x3ea97d;if(_0x3ccf15>=_0x39c6ce){_0x3ccf15=_0x39c6ce;_0x3ea97d=0xc8;}else{_0x3ea97d=0xce;}_0x5db010[_0xd9ff('0x1b')](_0x3ea97d);return _0x5db010[_0xd9ff('0x22')]('Content-Range',_0x5f45c4+'-'+_0x3ccf15+'/'+_0x39c6ce)['json'](_0x547e28);}return null;};}function patchUpdates(_0x264a3d){return function(_0x3eed13){try{jsonpatch['apply'](_0x3eed13,_0x264a3d,!![]);}catch(_0x588151){return BPromise['reject'](_0x588151);}return _0x3eed13['save']();};}function saveUpdates(_0x1f4d9e,_0x58eb5f){return function(_0x4c486a){if(_0x4c486a){return _0x4c486a[_0xd9ff('0x23')](_0x1f4d9e)[_0xd9ff('0x24')](function(_0x9f074e){return _0x9f074e;});}return null;};}function removeEntity(_0x278b66,_0x42a828){return function(_0x4b058a){if(_0x4b058a){return _0x4b058a['destroy']()[_0xd9ff('0x24')](function(){_0x278b66['status'](0xcc)[_0xd9ff('0x1c')]();});}};}function handleEntityNotFound(_0x4d86fe,_0x285002){return function(_0x5d45b3){if(!_0x5d45b3){_0x4d86fe[_0xd9ff('0x1a')](0x194);}return _0x5d45b3;};}function handleError(_0x159e56,_0x2138b4){_0x2138b4=_0x2138b4||0x1f4;return function(_0x2970e8){logger['error'](_0x2970e8[_0xd9ff('0x25')]);if(_0x2970e8[_0xd9ff('0x26')]){delete _0x2970e8[_0xd9ff('0x26')];}_0x159e56[_0xd9ff('0x1b')](_0x2138b4)['send'](_0x2970e8);};}exports[_0xd9ff('0x27')]=function(_0x3792d9,_0x44b5a7){var _0x45fb63={},_0x263d3a={},_0xe516e2={'count':0x0,'rows':[]};var _0x420ffa=_[_0xd9ff('0x28')](db[_0xd9ff('0x29')]['rawAttributes'],function(_0xcea5db){return{'name':_0xcea5db['fieldName'],'type':_0xcea5db[_0xd9ff('0x2a')][_0xd9ff('0x2b')]};});_0x263d3a[_0xd9ff('0x2c')]=_['map'](_0x420ffa,_0xd9ff('0x26'));_0x263d3a[_0xd9ff('0x2d')]=_[_0xd9ff('0x2e')](_0x3792d9[_0xd9ff('0x2d')]);_0x263d3a['filters']=_[_0xd9ff('0x2f')](_0x263d3a['model'],_0x263d3a[_0xd9ff('0x2d')]);_0x45fb63[_0xd9ff('0x30')]=_[_0xd9ff('0x2f')](_0x263d3a[_0xd9ff('0x2c')],qs[_0xd9ff('0x31')](_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x31')]));_0x45fb63[_0xd9ff('0x30')]=_0x45fb63[_0xd9ff('0x30')][_0xd9ff('0x32')]?_0x45fb63[_0xd9ff('0x30')]:_0x263d3a[_0xd9ff('0x2c')];if(!_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x33')]('nolimit')){_0x45fb63[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x3792d9[_0xd9ff('0x2d')]['limit']);_0x45fb63[_0xd9ff('0x1e')]=qs['offset'](_0x3792d9[_0xd9ff('0x2d')]['offset']);}_0x45fb63[_0xd9ff('0x34')]=qs['sort'](_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x35')]);_0x45fb63[_0xd9ff('0x36')]=qs['filters'](_['pick'](_0x3792d9['query'],_0x263d3a[_0xd9ff('0x37')]),_0x420ffa);if(_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x38')]){_0x45fb63[_0xd9ff('0x36')]=_[_0xd9ff('0x39')](_0x45fb63[_0xd9ff('0x36')],{'$or':_['map'](_0x420ffa,function(_0x4c00c2){if(_0x4c00c2['type']!==_0xd9ff('0x3a')){var _0x252edc={};_0x252edc[_0x4c00c2[_0xd9ff('0x26')]]={'$like':'%'+_0x3792d9[_0xd9ff('0x2d')]['filter']+'%'};return _0x252edc;}})});}_0x45fb63=_[_0xd9ff('0x39')]({},_0x45fb63,_0x3792d9['options']);var _0x3cff52={'where':_0x45fb63[_0xd9ff('0x36')]};return db[_0xd9ff('0x29')][_0xd9ff('0x21')](_0x3cff52)['then'](function(_0x1e34da){_0xe516e2[_0xd9ff('0x21')]=_0x1e34da;if(_0x3792d9['query'][_0xd9ff('0x3b')]){_0x45fb63[_0xd9ff('0x3c')]=[{'all':!![]}];}return db[_0xd9ff('0x29')][_0xd9ff('0x3d')](_0x45fb63);})[_0xd9ff('0x24')](function(_0x1cc848){_0xe516e2['rows']=_0x1cc848;return _0xe516e2;})[_0xd9ff('0x24')](respondWithFilteredResult(_0x44b5a7,_0x45fb63))[_0xd9ff('0x3e')](handleError(_0x44b5a7,null));};exports[_0xd9ff('0x3f')]=function(_0x39fbbb,_0x472724){var _0x52aab8={'raw':![],'where':{'id':_0x39fbbb[_0xd9ff('0x40')]['id']}},_0x3178cd={};_0x3178cd[_0xd9ff('0x2c')]=_['keys'](db['ZendeskAccount'][_0xd9ff('0x41')]);_0x3178cd[_0xd9ff('0x2d')]=_[_0xd9ff('0x2e')](_0x39fbbb[_0xd9ff('0x2d')]);_0x3178cd[_0xd9ff('0x37')]=_[_0xd9ff('0x2f')](_0x3178cd['model'],_0x3178cd[_0xd9ff('0x2d')]);_0x52aab8[_0xd9ff('0x30')]=_['intersection'](_0x3178cd[_0xd9ff('0x2c')],qs[_0xd9ff('0x31')](_0x39fbbb[_0xd9ff('0x2d')][_0xd9ff('0x31')]));_0x52aab8[_0xd9ff('0x30')]=_0x52aab8['attributes']['length']?_0x52aab8['attributes']:_0x3178cd[_0xd9ff('0x2c')];if(_0x39fbbb['query'][_0xd9ff('0x3b')]){_0x52aab8[_0xd9ff('0x3c')]=[{'all':!![]}];}_0x52aab8=_[_0xd9ff('0x39')]({},_0x52aab8,_0x39fbbb['options']);return db[_0xd9ff('0x29')][_0xd9ff('0x42')](_0x52aab8)['then'](handleEntityNotFound(_0x472724,null))[_0xd9ff('0x24')](respondWithResult(_0x472724,null))[_0xd9ff('0x3e')](handleError(_0x472724,null));};exports[_0xd9ff('0x43')]=function(_0x316854,_0x559101){return db[_0xd9ff('0x29')]['create'](_0x316854[_0xd9ff('0x44')],{})['then'](respondWithResult(_0x559101,0xc9))[_0xd9ff('0x3e')](handleError(_0x559101,null));};exports[_0xd9ff('0x23')]=function(_0x2bf37a,_0x1760c3){if(_0x2bf37a[_0xd9ff('0x44')]['id']){delete _0x2bf37a['body']['id'];}return db[_0xd9ff('0x29')][_0xd9ff('0x42')]({'where':{'id':_0x2bf37a[_0xd9ff('0x40')]['id']}})[_0xd9ff('0x24')](handleEntityNotFound(_0x1760c3,null))['then'](saveUpdates(_0x2bf37a['body'],null))['then'](respondWithResult(_0x1760c3,null))[_0xd9ff('0x3e')](handleError(_0x1760c3,null));};exports[_0xd9ff('0x45')]=function(_0x29c6bd,_0x572618){return db[_0xd9ff('0x29')][_0xd9ff('0x42')]({'where':{'id':_0x29c6bd[_0xd9ff('0x40')]['id']}})[_0xd9ff('0x24')](handleEntityNotFound(_0x572618,null))[_0xd9ff('0x24')](removeEntity(_0x572618,null))[_0xd9ff('0x3e')](handleError(_0x572618,null));};exports[_0xd9ff('0x46')]=function(_0x1e1364,_0x1ad160,_0x10d9d0){var _0x5dcb5={};var _0x3d6143={};var _0x2533d7;var _0x487b07;return db[_0xd9ff('0x29')]['findOne']({'where':{'id':_0x1e1364[_0xd9ff('0x40')]['id']}})['then'](handleEntityNotFound(_0x1ad160,null))[_0xd9ff('0x24')](function(_0x49623d){if(_0x49623d){_0x2533d7=_0x49623d;_0x3d6143[_0xd9ff('0x2c')]=_['keys'](db[_0xd9ff('0x47')]['rawAttributes']);_0x3d6143[_0xd9ff('0x2d')]=_['keys'](_0x1e1364[_0xd9ff('0x2d')]);_0x3d6143['filters']=_[_0xd9ff('0x2f')](_0x3d6143[_0xd9ff('0x2c')],_0x3d6143[_0xd9ff('0x2d')]);_0x5dcb5[_0xd9ff('0x30')]=_['intersection'](_0x3d6143[_0xd9ff('0x2c')],qs[_0xd9ff('0x31')](_0x1e1364[_0xd9ff('0x2d')]['fields']));_0x5dcb5[_0xd9ff('0x30')]=_0x5dcb5[_0xd9ff('0x30')][_0xd9ff('0x32')]?_0x5dcb5[_0xd9ff('0x30')]:_0x3d6143[_0xd9ff('0x2c')];_0x5dcb5['order']=qs[_0xd9ff('0x35')](_0x1e1364[_0xd9ff('0x2d')][_0xd9ff('0x35')]);_0x5dcb5[_0xd9ff('0x36')]=qs[_0xd9ff('0x37')](_[_0xd9ff('0x48')](_0x1e1364[_0xd9ff('0x2d')],_0x3d6143['filters']));if(_0x1e1364[_0xd9ff('0x2d')][_0xd9ff('0x38')]){_0x5dcb5['where']=_[_0xd9ff('0x39')](_0x5dcb5[_0xd9ff('0x36')],{'$or':_['map'](_0x5dcb5[_0xd9ff('0x30')],function(_0x36d5c2){var _0x25d8d1={};_0x25d8d1[_0x36d5c2]={'$like':'%'+_0x1e1364['query']['filter']+'%'};return _0x25d8d1;})});}_0x5dcb5=_[_0xd9ff('0x39')]({},_0x5dcb5,_0x1e1364['options']);return _0x2533d7[_0xd9ff('0x46')](_0x5dcb5);}})[_0xd9ff('0x24')](function(_0x31907e){if(_0x31907e){_0x487b07=_0x31907e[_0xd9ff('0x32')];if(!_0x1e1364['query']['hasOwnProperty']('nolimit')){_0x5dcb5[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x1e1364[_0xd9ff('0x2d')][_0xd9ff('0x1f')]);_0x5dcb5[_0xd9ff('0x1e')]=qs['offset'](_0x1e1364[_0xd9ff('0x2d')]['offset']);}return _0x2533d7[_0xd9ff('0x46')](_0x5dcb5);}})[_0xd9ff('0x24')](function(_0x3f92c3){if(_0x3f92c3){return _0x3f92c3?{'count':_0x487b07,'rows':_0x3f92c3}:null;}})[_0xd9ff('0x24')](respondWithResult(_0x1ad160,null))[_0xd9ff('0x3e')](handleError(_0x1ad160,null));};exports[_0xd9ff('0x49')]=function(_0xed12df,_0xfcafbe,_0x5d633b){if(_0xed12df[_0xd9ff('0x44')]['id']){delete _0xed12df[_0xd9ff('0x44')]['id'];}return db['ZendeskAccount']['findOne']({'where':{'id':_0xed12df[_0xd9ff('0x40')]['id']}})['then'](handleEntityNotFound(_0xfcafbe,null))[_0xd9ff('0x24')](function(_0x34fca4){if(_0x34fca4){_0xed12df['body'][_0xd9ff('0x4a')]=_0x34fca4['id'];_0xed12df[_0xd9ff('0x44')][_0xd9ff('0x4b')]=integrations[_0xd9ff('0x4c')](_0xed12df[_0xd9ff('0x44')]['channel'],_0xed12df[_0xd9ff('0x44')]['type']);_0xed12df['body'][_0xd9ff('0x4d')]=integrations[_0xd9ff('0x4e')](_0xed12df[_0xd9ff('0x44')][_0xd9ff('0x4f')],_0xed12df['body'][_0xd9ff('0x2a')]);return db[_0xd9ff('0x47')][_0xd9ff('0x43')](_0xed12df[_0xd9ff('0x44')],{'include':[{'model':db[_0xd9ff('0x50')],'as':_0xd9ff('0x4b')},{'model':db[_0xd9ff('0x50')],'as':_0xd9ff('0x4d')}]});}return null;})['then'](respondWithResult(_0xfcafbe,null))['catch'](handleError(_0xfcafbe,null));};exports['getFields']=function(_0x275fb9,_0x31db27,_0x514d59){var _0x196670='';return db[_0xd9ff('0x29')][_0xd9ff('0x51')]({'where':{'id':_0x275fb9[_0xd9ff('0x40')]['id']},'attributes':['id',_0xd9ff('0x52'),_0xd9ff('0x53'),_0xd9ff('0x54'),_0xd9ff('0x55'),'remoteUri']})[_0xd9ff('0x24')](handleEntityNotFound(_0x31db27,null))[_0xd9ff('0x24')](function(_0x228413){if(_0x228413){_0x196670=_0x228413['remoteUri'];var _0x14e936=_0x196670['slice'](-0x1);if(_0x14e936==='/'){_0x196670=_0x196670[_0xd9ff('0x56')](0x0,_0x196670[_0xd9ff('0x57')](_0x14e936));}var _0x25ee82={'method':'GET','uri':util[_0xd9ff('0x58')](_0xd9ff('0x59'),_0x196670,_0xd9ff('0x5a')),'json':!![]};switch(_0x228413[_0xd9ff('0x55')]){case'password':_0x25ee82[_0xd9ff('0x5b')]={'Authorization':util[_0xd9ff('0x58')](_0xd9ff('0x5c'),new Buffer(util['format'](_0xd9ff('0x5d'),_0x228413[_0xd9ff('0x52')],_0x228413[_0xd9ff('0x53')]))['toString'](_0xd9ff('0x5e')))};break;case _0xd9ff('0x54'):_0x25ee82[_0xd9ff('0x5b')]={'Authorization':util[_0xd9ff('0x58')](_0xd9ff('0x5c'),new Buffer(util['format'](_0xd9ff('0x5f'),_0x228413[_0xd9ff('0x52')],_0x228413['token']))[_0xd9ff('0x60')](_0xd9ff('0x5e')))};break;default:throw new db[(_0xd9ff('0x61'))]['ValidationError'](_0xd9ff('0x62'));}return rp(_0x25ee82);}})['then'](function(_0x1e46fc){if(_0x1e46fc){var _0x478e0d=[_0xd9ff('0x63'),_0xd9ff('0x64'),_0xd9ff('0x65'),_0xd9ff('0x66')];_[_0xd9ff('0x67')](_0x1e46fc[_0xd9ff('0x5a')],function(_0xda0003){return _0x478e0d[_0xd9ff('0x68')](_0xda0003[_0xd9ff('0x2a')]);});return{'count':_0x1e46fc[_0xd9ff('0x5a')]['length'],'rows':_[_0xd9ff('0x28')](_0x1e46fc[_0xd9ff('0x5a')],function(_0x1f6cb9){return{'id':_0x1f6cb9['id'],'name':_0x1f6cb9[_0xd9ff('0x69')]>0x7?_0x1f6cb9[_0xd9ff('0x6a')]:_0x1f6cb9[_0xd9ff('0x2a')],'custom':_0x1f6cb9['position']>0x7?!![]:![],'options':_0x1f6cb9['system_field_options']?_0x1f6cb9[_0xd9ff('0x6b')]:_0x1f6cb9[_0xd9ff('0x6c')]?_0x1f6cb9[_0xd9ff('0x6c')]:[]};})};}})[_0xd9ff('0x24')](respondWithResult(_0x31db27,null))[_0xd9ff('0x3e')](function(_0x183199){var _0x5b234c=_0x275fb9[_0xd9ff('0x2d')][_0xd9ff('0x6d')]?0x1f4:_0x183199[_0xd9ff('0x6e')]||0x1f4;logger[_0xd9ff('0x6f')](_0xd9ff('0x70'),_0xd9ff('0x71'),_0x5b234c,JSON['stringify'](_0x183199));delete _0x183199[_0xd9ff('0x26')];if(_0x5b234c===0x191){_0x5b234c=0x190;}_0x31db27[_0xd9ff('0x1b')](_0x5b234c)[_0xd9ff('0x72')](_0x275fb9[_0xd9ff('0x2d')][_0xd9ff('0x6d')]?{'message':_0xd9ff('0x73'),'statusCode':_0x183199[_0xd9ff('0x6e')]}:_0x183199);});}; \ No newline at end of file +var _0x4fc2=['addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','token','authType','remoteUri','slice','substring','lastIndexOf','format','ticket_fields','password','headers','Basic\x20%s','%s:%s','toString','base64','Sequelize','Unknown\x20authentication\x20type','subject','description','remove','position','title','system_field_options','statusCode','error','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','name','send','index','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ZendeskAccount','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','create','body','update','getConfigurations','findOne','ZendeskConfiguration'];(function(_0x518849,_0x2a7ff3){var _0xc676=function(_0x32b8b9){while(--_0x32b8b9){_0x518849['push'](_0x518849['shift']());}};_0xc676(++_0x2a7ff3);}(_0x4fc2,0x111));var _0x24fc=function(_0x24ec40,_0x375368){_0x24ec40=_0x24ec40-0x0;var _0x517d60=_0x4fc2[_0x24ec40];return _0x517d60;};'use strict';var emlformat=require(_0x24fc('0x0'));var rimraf=require(_0x24fc('0x1'));var zipdir=require(_0x24fc('0x2'));var jsonpatch=require(_0x24fc('0x3'));var rp=require('request-promise');var moment=require(_0x24fc('0x4'));var BPromise=require(_0x24fc('0x5'));var Mustache=require(_0x24fc('0x6'));var util=require('util');var path=require(_0x24fc('0x7'));var sox=require(_0x24fc('0x8'));var csv=require('to-csv');var ejs=require(_0x24fc('0x9'));var fs=require('fs');var fs_extra=require(_0x24fc('0xa'));var _=require('lodash');var squel=require(_0x24fc('0xb'));var crypto=require(_0x24fc('0xc'));var jsforce=require(_0x24fc('0xd'));var deskjs=require(_0x24fc('0xe'));var toCsv=require(_0x24fc('0xf'));var querystring=require(_0x24fc('0x10'));var Papa=require('papaparse');var Redis=require(_0x24fc('0x11'));var authService=require(_0x24fc('0x12'));var qs=require(_0x24fc('0x13'));var as=require(_0x24fc('0x14'));var hardwareService=require(_0x24fc('0x15'));var logger=require(_0x24fc('0x16'))(_0x24fc('0x17'));var utils=require(_0x24fc('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x24fc('0x19'));var db=require(_0x24fc('0x1a'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x306873,_0x76cb25){_0x76cb25=_0x76cb25||0xcc;return function(_0x3f6d8b){if(_0x3f6d8b){return _0x306873[_0x24fc('0x1b')](_0x76cb25);}return _0x306873[_0x24fc('0x1c')](_0x76cb25)[_0x24fc('0x1d')]();};}function respondWithResult(_0x537b5c,_0x2a0971){_0x2a0971=_0x2a0971||0xc8;return function(_0x18c0a7){if(_0x18c0a7){return _0x537b5c[_0x24fc('0x1c')](_0x2a0971)[_0x24fc('0x1e')](_0x18c0a7);}};}function respondWithFilteredResult(_0x4acd36,_0x2ac989){return function(_0x588543){if(_0x588543){var _0x4af098=typeof _0x2ac989[_0x24fc('0x1f')]===_0x24fc('0x20')&&typeof _0x2ac989[_0x24fc('0x21')]===_0x24fc('0x20');var _0x52a884=_0x588543[_0x24fc('0x22')];var _0x1cb3d0=_0x4af098?0x0:_0x2ac989[_0x24fc('0x1f')];var _0x8ac114=_0x4af098?_0x588543['count']:_0x2ac989[_0x24fc('0x1f')]+_0x2ac989[_0x24fc('0x21')];var _0x304881;if(_0x8ac114>=_0x52a884){_0x8ac114=_0x52a884;_0x304881=0xc8;}else{_0x304881=0xce;}_0x4acd36['status'](_0x304881);return _0x4acd36[_0x24fc('0x23')](_0x24fc('0x24'),_0x1cb3d0+'-'+_0x8ac114+'/'+_0x52a884)[_0x24fc('0x1e')](_0x588543);}return null;};}function patchUpdates(_0x2d0e3d){return function(_0x49a0ba){try{jsonpatch[_0x24fc('0x25')](_0x49a0ba,_0x2d0e3d,!![]);}catch(_0x545939){return BPromise[_0x24fc('0x26')](_0x545939);}return _0x49a0ba['save']();};}function saveUpdates(_0x3ed464,_0x44c121){return function(_0x2ffade){if(_0x2ffade){return _0x2ffade['update'](_0x3ed464)[_0x24fc('0x27')](function(_0x552035){return _0x552035;});}return null;};}function removeEntity(_0x35a9c7,_0x2bb93a){return function(_0x36a9b4){if(_0x36a9b4){return _0x36a9b4[_0x24fc('0x28')]()[_0x24fc('0x27')](function(){_0x35a9c7[_0x24fc('0x1c')](0xcc)[_0x24fc('0x1d')]();});}};}function handleEntityNotFound(_0x20192b,_0x168d98){return function(_0x2a5c4b){if(!_0x2a5c4b){_0x20192b['sendStatus'](0x194);}return _0x2a5c4b;};}function handleError(_0x11c913,_0x16f27f){_0x16f27f=_0x16f27f||0x1f4;return function(_0x3ee302){logger['error'](_0x3ee302[_0x24fc('0x29')]);if(_0x3ee302[_0x24fc('0x2a')]){delete _0x3ee302[_0x24fc('0x2a')];}_0x11c913[_0x24fc('0x1c')](_0x16f27f)[_0x24fc('0x2b')](_0x3ee302);};}exports[_0x24fc('0x2c')]=function(_0x5ac1f2,_0x240ae7){var _0x29a461={},_0x3c99ed={},_0x1c5146={'count':0x0,'rows':[]};var _0x9f7bbc=_['map'](db['ZendeskAccount']['rawAttributes'],function(_0x3df6f4){return{'name':_0x3df6f4['fieldName'],'type':_0x3df6f4[_0x24fc('0x2d')][_0x24fc('0x2e')]};});_0x3c99ed[_0x24fc('0x2f')]=_[_0x24fc('0x30')](_0x9f7bbc,'name');_0x3c99ed[_0x24fc('0x31')]=_[_0x24fc('0x32')](_0x5ac1f2['query']);_0x3c99ed[_0x24fc('0x33')]=_[_0x24fc('0x34')](_0x3c99ed['model'],_0x3c99ed['query']);_0x29a461[_0x24fc('0x35')]=_['intersection'](_0x3c99ed[_0x24fc('0x2f')],qs[_0x24fc('0x36')](_0x5ac1f2['query'][_0x24fc('0x36')]));_0x29a461[_0x24fc('0x35')]=_0x29a461[_0x24fc('0x35')][_0x24fc('0x37')]?_0x29a461[_0x24fc('0x35')]:_0x3c99ed[_0x24fc('0x2f')];if(!_0x5ac1f2[_0x24fc('0x31')][_0x24fc('0x38')](_0x24fc('0x39'))){_0x29a461['limit']=qs[_0x24fc('0x21')](_0x5ac1f2[_0x24fc('0x31')][_0x24fc('0x21')]);_0x29a461[_0x24fc('0x1f')]=qs[_0x24fc('0x1f')](_0x5ac1f2['query']['offset']);}_0x29a461[_0x24fc('0x3a')]=qs['sort'](_0x5ac1f2[_0x24fc('0x31')][_0x24fc('0x3b')]);_0x29a461[_0x24fc('0x3c')]=qs[_0x24fc('0x33')](_['pick'](_0x5ac1f2[_0x24fc('0x31')],_0x3c99ed['filters']),_0x9f7bbc);if(_0x5ac1f2[_0x24fc('0x31')][_0x24fc('0x3d')]){_0x29a461[_0x24fc('0x3c')]=_[_0x24fc('0x3e')](_0x29a461[_0x24fc('0x3c')],{'$or':_['map'](_0x9f7bbc,function(_0xadedb4){if(_0xadedb4[_0x24fc('0x2d')]!==_0x24fc('0x3f')){var _0x22a75c={};_0x22a75c[_0xadedb4['name']]={'$like':'%'+_0x5ac1f2[_0x24fc('0x31')][_0x24fc('0x3d')]+'%'};return _0x22a75c;}})});}_0x29a461=_['merge']({},_0x29a461,_0x5ac1f2[_0x24fc('0x40')]);var _0x52df2e={'where':_0x29a461[_0x24fc('0x3c')]};return db[_0x24fc('0x41')][_0x24fc('0x22')](_0x52df2e)[_0x24fc('0x27')](function(_0x431189){_0x1c5146[_0x24fc('0x22')]=_0x431189;if(_0x5ac1f2[_0x24fc('0x31')][_0x24fc('0x42')]){_0x29a461['include']=[{'all':!![]}];}return db[_0x24fc('0x41')][_0x24fc('0x43')](_0x29a461);})[_0x24fc('0x27')](function(_0x4fee9f){_0x1c5146[_0x24fc('0x44')]=_0x4fee9f;return _0x1c5146;})[_0x24fc('0x27')](respondWithFilteredResult(_0x240ae7,_0x29a461))['catch'](handleError(_0x240ae7,null));};exports[_0x24fc('0x45')]=function(_0x22f30b,_0x2c598c){var _0x5e4e9b={'raw':![],'where':{'id':_0x22f30b[_0x24fc('0x46')]['id']}},_0x31ddd0={};_0x31ddd0['model']=_[_0x24fc('0x32')](db[_0x24fc('0x41')][_0x24fc('0x47')]);_0x31ddd0[_0x24fc('0x31')]=_['keys'](_0x22f30b[_0x24fc('0x31')]);_0x31ddd0[_0x24fc('0x33')]=_[_0x24fc('0x34')](_0x31ddd0[_0x24fc('0x2f')],_0x31ddd0[_0x24fc('0x31')]);_0x5e4e9b['attributes']=_[_0x24fc('0x34')](_0x31ddd0[_0x24fc('0x2f')],qs[_0x24fc('0x36')](_0x22f30b[_0x24fc('0x31')]['fields']));_0x5e4e9b[_0x24fc('0x35')]=_0x5e4e9b[_0x24fc('0x35')]['length']?_0x5e4e9b['attributes']:_0x31ddd0[_0x24fc('0x2f')];if(_0x22f30b['query']['includeAll']){_0x5e4e9b[_0x24fc('0x48')]=[{'all':!![]}];}_0x5e4e9b=_['merge']({},_0x5e4e9b,_0x22f30b[_0x24fc('0x40')]);return db[_0x24fc('0x41')][_0x24fc('0x49')](_0x5e4e9b)['then'](handleEntityNotFound(_0x2c598c,null))[_0x24fc('0x27')](respondWithResult(_0x2c598c,null))[_0x24fc('0x4a')](handleError(_0x2c598c,null));};exports[_0x24fc('0x4b')]=function(_0x1ad8d6,_0x39873d){return db[_0x24fc('0x41')][_0x24fc('0x4b')](_0x1ad8d6[_0x24fc('0x4c')],{})['then'](respondWithResult(_0x39873d,0xc9))['catch'](handleError(_0x39873d,null));};exports[_0x24fc('0x4d')]=function(_0x2f1a99,_0x12e9f7){if(_0x2f1a99['body']['id']){delete _0x2f1a99['body']['id'];}return db[_0x24fc('0x41')][_0x24fc('0x49')]({'where':{'id':_0x2f1a99[_0x24fc('0x46')]['id']}})[_0x24fc('0x27')](handleEntityNotFound(_0x12e9f7,null))[_0x24fc('0x27')](saveUpdates(_0x2f1a99[_0x24fc('0x4c')],null))[_0x24fc('0x27')](respondWithResult(_0x12e9f7,null))[_0x24fc('0x4a')](handleError(_0x12e9f7,null));};exports[_0x24fc('0x28')]=function(_0x4574d3,_0x434700){return db[_0x24fc('0x41')]['find']({'where':{'id':_0x4574d3[_0x24fc('0x46')]['id']}})[_0x24fc('0x27')](handleEntityNotFound(_0x434700,null))[_0x24fc('0x27')](removeEntity(_0x434700,null))[_0x24fc('0x4a')](handleError(_0x434700,null));};exports[_0x24fc('0x4e')]=function(_0x5bdc4d,_0x428012,_0x4bf3a8){var _0x2c8f74={};var _0x2ee445={};var _0x446c14;var _0x41ddfb;return db[_0x24fc('0x41')][_0x24fc('0x4f')]({'where':{'id':_0x5bdc4d['params']['id']}})[_0x24fc('0x27')](handleEntityNotFound(_0x428012,null))[_0x24fc('0x27')](function(_0xc49d9f){if(_0xc49d9f){_0x446c14=_0xc49d9f;_0x2ee445[_0x24fc('0x2f')]=_[_0x24fc('0x32')](db[_0x24fc('0x50')]['rawAttributes']);_0x2ee445[_0x24fc('0x31')]=_[_0x24fc('0x32')](_0x5bdc4d[_0x24fc('0x31')]);_0x2ee445[_0x24fc('0x33')]=_[_0x24fc('0x34')](_0x2ee445[_0x24fc('0x2f')],_0x2ee445[_0x24fc('0x31')]);_0x2c8f74['attributes']=_[_0x24fc('0x34')](_0x2ee445[_0x24fc('0x2f')],qs['fields'](_0x5bdc4d[_0x24fc('0x31')][_0x24fc('0x36')]));_0x2c8f74[_0x24fc('0x35')]=_0x2c8f74[_0x24fc('0x35')][_0x24fc('0x37')]?_0x2c8f74[_0x24fc('0x35')]:_0x2ee445['model'];_0x2c8f74[_0x24fc('0x3a')]=qs['sort'](_0x5bdc4d[_0x24fc('0x31')][_0x24fc('0x3b')]);_0x2c8f74['where']=qs[_0x24fc('0x33')](_['pick'](_0x5bdc4d[_0x24fc('0x31')],_0x2ee445['filters']));if(_0x5bdc4d[_0x24fc('0x31')][_0x24fc('0x3d')]){_0x2c8f74['where']=_[_0x24fc('0x3e')](_0x2c8f74['where'],{'$or':_[_0x24fc('0x30')](_0x2c8f74[_0x24fc('0x35')],function(_0x59e46e){var _0xd1638f={};_0xd1638f[_0x59e46e]={'$like':'%'+_0x5bdc4d[_0x24fc('0x31')][_0x24fc('0x3d')]+'%'};return _0xd1638f;})});}_0x2c8f74=_[_0x24fc('0x3e')]({},_0x2c8f74,_0x5bdc4d[_0x24fc('0x40')]);return _0x446c14['getConfigurations'](_0x2c8f74);}})[_0x24fc('0x27')](function(_0x2f62b0){if(_0x2f62b0){_0x41ddfb=_0x2f62b0[_0x24fc('0x37')];if(!_0x5bdc4d[_0x24fc('0x31')][_0x24fc('0x38')]('nolimit')){_0x2c8f74['limit']=qs[_0x24fc('0x21')](_0x5bdc4d[_0x24fc('0x31')]['limit']);_0x2c8f74['offset']=qs[_0x24fc('0x1f')](_0x5bdc4d[_0x24fc('0x31')][_0x24fc('0x1f')]);}return _0x446c14[_0x24fc('0x4e')](_0x2c8f74);}})['then'](function(_0x20973d){if(_0x20973d){return _0x20973d?{'count':_0x41ddfb,'rows':_0x20973d}:null;}})[_0x24fc('0x27')](respondWithResult(_0x428012,null))[_0x24fc('0x4a')](handleError(_0x428012,null));};exports[_0x24fc('0x51')]=function(_0x1df0c4,_0x3e896f,_0x26ac2e){if(_0x1df0c4[_0x24fc('0x4c')]['id']){delete _0x1df0c4[_0x24fc('0x4c')]['id'];}return db[_0x24fc('0x41')][_0x24fc('0x4f')]({'where':{'id':_0x1df0c4[_0x24fc('0x46')]['id']}})[_0x24fc('0x27')](handleEntityNotFound(_0x3e896f,null))[_0x24fc('0x27')](function(_0x354fc6){if(_0x354fc6){_0x1df0c4['body'][_0x24fc('0x52')]=_0x354fc6['id'];_0x1df0c4[_0x24fc('0x4c')][_0x24fc('0x53')]=integrations[_0x24fc('0x54')](_0x1df0c4[_0x24fc('0x4c')][_0x24fc('0x55')],_0x1df0c4[_0x24fc('0x4c')][_0x24fc('0x2d')]);_0x1df0c4['body'][_0x24fc('0x56')]=integrations[_0x24fc('0x57')](_0x1df0c4[_0x24fc('0x4c')][_0x24fc('0x55')],_0x1df0c4['body'][_0x24fc('0x2d')]);return db[_0x24fc('0x50')]['create'](_0x1df0c4['body'],{'include':[{'model':db['ZendeskField'],'as':_0x24fc('0x53')},{'model':db[_0x24fc('0x58')],'as':_0x24fc('0x56')}]});}return null;})[_0x24fc('0x27')](respondWithResult(_0x3e896f,null))[_0x24fc('0x4a')](handleError(_0x3e896f,null));};exports[_0x24fc('0x59')]=function(_0x52e1aa,_0x11bafd,_0x15e8a3){var _0x5a2c09='';return db['ZendeskAccount'][_0x24fc('0x4f')]({'where':{'id':_0x52e1aa[_0x24fc('0x46')]['id']},'attributes':['id',_0x24fc('0x5a'),'password',_0x24fc('0x5b'),_0x24fc('0x5c'),_0x24fc('0x5d')]})['then'](handleEntityNotFound(_0x11bafd,null))['then'](function(_0x4c286d){if(_0x4c286d){_0x5a2c09=_0x4c286d['remoteUri'];var _0x4a1b8e=_0x5a2c09[_0x24fc('0x5e')](-0x1);if(_0x4a1b8e==='/'){_0x5a2c09=_0x5a2c09[_0x24fc('0x5f')](0x0,_0x5a2c09[_0x24fc('0x60')](_0x4a1b8e));}var _0x2a1236={'method':'GET','uri':util[_0x24fc('0x61')]('%s/%s',_0x5a2c09,_0x24fc('0x62')),'json':!![]};switch(_0x4c286d['authType']){case _0x24fc('0x63'):_0x2a1236[_0x24fc('0x64')]={'Authorization':util[_0x24fc('0x61')](_0x24fc('0x65'),new Buffer(util[_0x24fc('0x61')](_0x24fc('0x66'),_0x4c286d[_0x24fc('0x5a')],_0x4c286d['password']))[_0x24fc('0x67')](_0x24fc('0x68')))};break;case _0x24fc('0x5b'):_0x2a1236['headers']={'Authorization':util['format'](_0x24fc('0x65'),new Buffer(util[_0x24fc('0x61')]('%s/token:%s',_0x4c286d[_0x24fc('0x5a')],_0x4c286d[_0x24fc('0x5b')]))['toString'](_0x24fc('0x68')))};break;default:throw new db[(_0x24fc('0x69'))]['ValidationError'](_0x24fc('0x6a'));}return rp(_0x2a1236);}})[_0x24fc('0x27')](function(_0x24e717){if(_0x24e717){var _0x1efe4e=[_0x24fc('0x6b'),_0x24fc('0x6c'),'group','assignee'];_[_0x24fc('0x6d')](_0x24e717['ticket_fields'],function(_0x29bd9f){return _0x1efe4e['includes'](_0x29bd9f['type']);});return{'count':_0x24e717[_0x24fc('0x62')][_0x24fc('0x37')],'rows':_[_0x24fc('0x30')](_0x24e717[_0x24fc('0x62')],function(_0x66de4f){return{'id':_0x66de4f['id'],'name':_0x66de4f[_0x24fc('0x6e')]>0x7?_0x66de4f[_0x24fc('0x6f')]:_0x66de4f[_0x24fc('0x2d')],'custom':_0x66de4f['position']>0x7?!![]:![],'options':_0x66de4f[_0x24fc('0x70')]?_0x66de4f[_0x24fc('0x70')]:_0x66de4f['custom_field_options']?_0x66de4f['custom_field_options']:[]};})};}})[_0x24fc('0x27')](respondWithResult(_0x11bafd,null))[_0x24fc('0x4a')](function(_0x938dcf){var _0x1b2a97=_0x52e1aa[_0x24fc('0x31')]['test']?0x1f4:_0x938dcf[_0x24fc('0x71')]||0x1f4;logger[_0x24fc('0x72')]('getFields,\x20%s,\x20%s,\x20%s',_0x24fc('0x59'),_0x1b2a97,JSON[_0x24fc('0x73')](_0x938dcf));delete _0x938dcf[_0x24fc('0x2a')];if(_0x1b2a97===0x191){_0x1b2a97=0x190;}_0x11bafd['status'](_0x1b2a97)[_0x24fc('0x2b')](_0x52e1aa[_0x24fc('0x31')][_0x24fc('0x74')]?{'message':_0x24fc('0x75'),'statusCode':_0x938dcf[_0x24fc('0x71')]}:_0x938dcf);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 68af3a4..66f43ee 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 _0xca68=['../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','util','api','moment','bluebird','request-promise','path','../../config/environment','./intZendeskAccount.attributes'];(function(_0x2181b1,_0x569637){var _0x530548=function(_0x4b31f1){while(--_0x4b31f1){_0x2181b1['push'](_0x2181b1['shift']());}};_0x530548(++_0x569637);}(_0xca68,0x18b));var _0x8ca6=function(_0x1fa4ca,_0x117360){_0x1fa4ca=_0x1fa4ca-0x0;var _0xb0338c=_0xca68[_0x1fa4ca];return _0xb0338c;};'use strict';var _=require('lodash');var util=require(_0x8ca6('0x0'));var logger=require('../../config/logger')(_0x8ca6('0x1'));var moment=require(_0x8ca6('0x2'));var BPromise=require(_0x8ca6('0x3'));var rp=require(_0x8ca6('0x4'));var fs=require('fs');var path=require(_0x8ca6('0x5'));var rimraf=require('rimraf');var config=require(_0x8ca6('0x6'));var attributes=require(_0x8ca6('0x7'));var integrations=require(_0x8ca6('0x8'));module[_0x8ca6('0x9')]=function(_0x21f5bb,_0x441914){return _0x21f5bb[_0x8ca6('0xa')](_0x8ca6('0xb'),attributes,{'tableName':_0x8ca6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16a7=['request-promise','path','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0x16a7,0xa5));var _0x716a=function(_0x4ce984,_0x1c0de6){_0x4ce984=_0x4ce984-0x0;var _0x53b1a2=_0x16a7[_0x4ce984];return _0x53b1a2;};'use strict';var _=require(_0x716a('0x0'));var util=require(_0x716a('0x1'));var logger=require(_0x716a('0x2'))(_0x716a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x716a('0x4'));var fs=require('fs');var path=require(_0x716a('0x5'));var rimraf=require('rimraf');var config=require(_0x716a('0x6'));var attributes=require(_0x716a('0x7'));var integrations=require(_0x716a('0x8'));module[_0x716a('0x9')]=function(_0x22b026,_0x557d05){return _0x22b026[_0x716a('0xa')](_0x716a('0xb'),attributes,{'tableName':_0x716a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index ac2041c..f45c082 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 _0x13c9=['model','attributes','ShowZendeskAccount','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','limit','include','map'];(function(_0x2b2396,_0x1efdc5){var _0x3a9147=function(_0x574808){while(--_0x574808){_0x2b2396['push'](_0x2b2396['shift']());}};_0x3a9147(++_0x1efdc5);}(_0x13c9,0x71));var _0x913c=function(_0x2f482b,_0x544217){_0x2f482b=_0x2f482b-0x0;var _0xb32299=_0x13c9[_0x2f482b];return _0xb32299;};'use strict';var _=require(_0x913c('0x0'));var util=require(_0x913c('0x1'));var moment=require(_0x913c('0x2'));var BPromise=require(_0x913c('0x3'));var rs=require(_0x913c('0x4'));var fs=require('fs');var Redis=require(_0x913c('0x5'));var db=require(_0x913c('0x6'))['db'];var utils=require(_0x913c('0x7'));var logger=require(_0x913c('0x8'))(_0x913c('0x9'));var config=require('../../config/environment');var jayson=require(_0x913c('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x38ae69,_0x312bf4,_0x53f08b){return new BPromise(function(_0x4bd33c,_0xd4c0b4){return client[_0x913c('0xb')](_0x38ae69,_0x53f08b)[_0x913c('0xc')](function(_0x1042a7){logger[_0x913c('0xd')](_0x913c('0xe'),_0x312bf4,_0x913c('0xf'));logger[_0x913c('0x10')](_0x913c('0x11'),_0x312bf4,_0x913c('0xf'),JSON['stringify'](_0x1042a7));if(_0x1042a7[_0x913c('0x12')]){if(_0x1042a7['error'][_0x913c('0x13')]===0x1f4){logger[_0x913c('0x12')](_0x913c('0xe'),_0x312bf4,_0x1042a7[_0x913c('0x12')][_0x913c('0x14')]);return _0xd4c0b4(_0x1042a7[_0x913c('0x12')][_0x913c('0x14')]);}logger['error'](_0x913c('0xe'),_0x312bf4,_0x1042a7[_0x913c('0x12')][_0x913c('0x14')]);return _0x4bd33c(_0x1042a7[_0x913c('0x12')][_0x913c('0x14')]);}else{logger[_0x913c('0xd')]('ZendeskAccount,\x20%s,\x20%s',_0x312bf4,'request\x20sent');_0x4bd33c(_0x1042a7['result']['message']);}})[_0x913c('0x15')](function(_0x94c424){logger[_0x913c('0x12')](_0x913c('0xe'),_0x312bf4,_0x94c424);_0xd4c0b4(_0x94c424);});});}exports[_0x913c('0x16')]=function(_0x4cb094){var _0x371772=this;return new Promise(function(_0xdf96fb,_0x33affd){return db[_0x913c('0x17')][_0x913c('0x18')]({'raw':_0x4cb094[_0x913c('0x19')]?_0x4cb094[_0x913c('0x19')][_0x913c('0x1a')]===undefined?!![]:![]:!![],'where':_0x4cb094['options']?_0x4cb094[_0x913c('0x19')][_0x913c('0x1b')]||null:null,'attributes':_0x4cb094[_0x913c('0x19')]?_0x4cb094[_0x913c('0x19')]['attributes']||null:null,'limit':_0x4cb094[_0x913c('0x19')]?_0x4cb094[_0x913c('0x19')][_0x913c('0x1c')]||null:null,'include':_0x4cb094['options']?_0x4cb094[_0x913c('0x19')][_0x913c('0x1d')]?_[_0x913c('0x1e')](_0x4cb094['options'][_0x913c('0x1d')],function(_0xa88930){return{'model':db[_0xa88930[_0x913c('0x1f')]],'as':_0xa88930['as'],'attributes':_0xa88930[_0x913c('0x20')],'include':_0xa88930[_0x913c('0x1d')]?_[_0x913c('0x1e')](_0xa88930[_0x913c('0x1d')],function(_0x4a0b04){return{'model':db[_0x4a0b04['model']],'as':_0x4a0b04['as'],'attributes':_0x4a0b04[_0x913c('0x20')],'include':_0x4a0b04[_0x913c('0x1d')]?_[_0x913c('0x1e')](_0x4a0b04['include'],function(_0x54c524){return{'model':db[_0x54c524[_0x913c('0x1f')]],'as':_0x54c524['as'],'attributes':_0x54c524[_0x913c('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b8a75){logger[_0x913c('0xd')](_0x913c('0x16'),_0x4cb094);logger[_0x913c('0x10')]('GetZendeskAccount',_0x4cb094,JSON['stringify'](_0x5b8a75));_0xdf96fb(_0x5b8a75);})[_0x913c('0x15')](function(_0x48062d){logger[_0x913c('0x12')](_0x913c('0x16'),_0x48062d[_0x913c('0x14')],_0x4cb094);_0x33affd(_0x371772['error'](0x1f4,_0x48062d['message']));});});};exports[_0x913c('0x21')]=function(_0x57be59){var _0x387d71=this;return new Promise(function(_0x3b9542,_0x42d7cd){return db[_0x913c('0x17')][_0x913c('0x22')]({'raw':_0x57be59['options']?_0x57be59[_0x913c('0x19')][_0x913c('0x1a')]===undefined?!![]:![]:!![],'where':_0x57be59[_0x913c('0x19')]?_0x57be59[_0x913c('0x19')]['where']||null:null,'attributes':_0x57be59['options']?_0x57be59['options']['attributes']||null:null,'include':_0x57be59['options']?_0x57be59[_0x913c('0x19')][_0x913c('0x1d')]?_[_0x913c('0x1e')](_0x57be59[_0x913c('0x19')]['include'],function(_0x133c97){return{'model':db[_0x133c97[_0x913c('0x1f')]],'as':_0x133c97['as'],'attributes':_0x133c97[_0x913c('0x20')],'include':_0x133c97['include']?_['map'](_0x133c97['include'],function(_0x56fddc){return{'model':db[_0x56fddc[_0x913c('0x1f')]],'as':_0x56fddc['as'],'attributes':_0x56fddc[_0x913c('0x20')],'include':_0x56fddc[_0x913c('0x1d')]?_[_0x913c('0x1e')](_0x56fddc[_0x913c('0x1d')],function(_0x1f98ed){return{'model':db[_0x1f98ed[_0x913c('0x1f')]],'as':_0x1f98ed['as'],'attributes':_0x1f98ed[_0x913c('0x20')]};}):[]};}):[]};}):[]:[]})[_0x913c('0xc')](function(_0xb87d32){logger[_0x913c('0xd')](_0x913c('0x21'),_0x57be59);logger[_0x913c('0x10')]('ShowZendeskAccount',_0x57be59,JSON[_0x913c('0x23')](_0xb87d32));_0x3b9542(_0xb87d32);})[_0x913c('0x15')](function(_0x34ebf6){logger[_0x913c('0x12')](_0x913c('0x21'),_0x34ebf6[_0x913c('0x14')],_0x57be59);_0x42d7cd(_0x387d71[_0x913c('0x12')](0x1f4,_0x34ebf6[_0x913c('0x14')]));});});}; \ No newline at end of file +var _0x9b70=['then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','find','ShowZendeskAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x314a8c,_0x1c2e8d){var _0x1d4607=function(_0x3df20c){while(--_0x3df20c){_0x314a8c['push'](_0x314a8c['shift']());}};_0x1d4607(++_0x1c2e8d);}(_0x9b70,0x8b));var _0x09b7=function(_0xcdf809,_0x2881f0){_0xcdf809=_0xcdf809-0x0;var _0x4d4d70=_0x9b70[_0xcdf809];return _0x4d4d70;};'use strict';var _=require(_0x09b7('0x0'));var util=require(_0x09b7('0x1'));var moment=require(_0x09b7('0x2'));var BPromise=require(_0x09b7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x09b7('0x4'));var db=require(_0x09b7('0x5'))['db'];var utils=require(_0x09b7('0x6'));var logger=require('../../config/logger')(_0x09b7('0x7'));var config=require(_0x09b7('0x8'));var jayson=require(_0x09b7('0x9'));var client=jayson[_0x09b7('0xa')][_0x09b7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52ceeb,_0x53b182,_0x213ed8){return new BPromise(function(_0x17b2ec,_0x10922d){return client[_0x09b7('0xc')](_0x52ceeb,_0x213ed8)[_0x09b7('0xd')](function(_0x2e8ee5){logger[_0x09b7('0xe')](_0x09b7('0xf'),_0x53b182,_0x09b7('0x10'));logger['debug'](_0x09b7('0x11'),_0x53b182,_0x09b7('0x10'),JSON[_0x09b7('0x12')](_0x2e8ee5));if(_0x2e8ee5[_0x09b7('0x13')]){if(_0x2e8ee5[_0x09b7('0x13')][_0x09b7('0x14')]===0x1f4){logger[_0x09b7('0x13')](_0x09b7('0xf'),_0x53b182,_0x2e8ee5[_0x09b7('0x13')][_0x09b7('0x15')]);return _0x10922d(_0x2e8ee5[_0x09b7('0x13')]['message']);}logger[_0x09b7('0x13')](_0x09b7('0xf'),_0x53b182,_0x2e8ee5[_0x09b7('0x13')]['message']);return _0x17b2ec(_0x2e8ee5[_0x09b7('0x13')][_0x09b7('0x15')]);}else{logger['info'](_0x09b7('0xf'),_0x53b182,_0x09b7('0x10'));_0x17b2ec(_0x2e8ee5[_0x09b7('0x16')][_0x09b7('0x15')]);}})[_0x09b7('0x17')](function(_0x1482ce){logger[_0x09b7('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x53b182,_0x1482ce);_0x10922d(_0x1482ce);});});}exports[_0x09b7('0x18')]=function(_0x5bcf39){var _0x4097b1=this;return new Promise(function(_0xe6b7ef,_0x8e65d0){return db[_0x09b7('0x19')][_0x09b7('0x1a')]({'raw':_0x5bcf39[_0x09b7('0x1b')]?_0x5bcf39[_0x09b7('0x1b')][_0x09b7('0x1c')]===undefined?!![]:![]:!![],'where':_0x5bcf39[_0x09b7('0x1b')]?_0x5bcf39['options'][_0x09b7('0x1d')]||null:null,'attributes':_0x5bcf39[_0x09b7('0x1b')]?_0x5bcf39['options'][_0x09b7('0x1e')]||null:null,'limit':_0x5bcf39['options']?_0x5bcf39['options'][_0x09b7('0x1f')]||null:null,'include':_0x5bcf39[_0x09b7('0x1b')]?_0x5bcf39['options'][_0x09b7('0x20')]?_[_0x09b7('0x21')](_0x5bcf39[_0x09b7('0x1b')]['include'],function(_0x15d063){return{'model':db[_0x15d063[_0x09b7('0x22')]],'as':_0x15d063['as'],'attributes':_0x15d063[_0x09b7('0x1e')],'include':_0x15d063[_0x09b7('0x20')]?_[_0x09b7('0x21')](_0x15d063[_0x09b7('0x20')],function(_0x57283d){return{'model':db[_0x57283d[_0x09b7('0x22')]],'as':_0x57283d['as'],'attributes':_0x57283d['attributes'],'include':_0x57283d[_0x09b7('0x20')]?_[_0x09b7('0x21')](_0x57283d[_0x09b7('0x20')],function(_0x3a06c8){return{'model':db[_0x3a06c8[_0x09b7('0x22')]],'as':_0x3a06c8['as'],'attributes':_0x3a06c8[_0x09b7('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x22731d){logger[_0x09b7('0xe')]('GetZendeskAccount',_0x5bcf39);logger[_0x09b7('0x23')](_0x09b7('0x18'),_0x5bcf39,JSON['stringify'](_0x22731d));_0xe6b7ef(_0x22731d);})[_0x09b7('0x17')](function(_0x329422){logger[_0x09b7('0x13')](_0x09b7('0x18'),_0x329422[_0x09b7('0x15')],_0x5bcf39);_0x8e65d0(_0x4097b1[_0x09b7('0x13')](0x1f4,_0x329422[_0x09b7('0x15')]));});});};exports['ShowZendeskAccount']=function(_0x37f1ca){var _0xd294ea=this;return new Promise(function(_0x26dcc4,_0x14f3b0){return db[_0x09b7('0x19')][_0x09b7('0x24')]({'raw':_0x37f1ca[_0x09b7('0x1b')]?_0x37f1ca[_0x09b7('0x1b')][_0x09b7('0x1c')]===undefined?!![]:![]:!![],'where':_0x37f1ca[_0x09b7('0x1b')]?_0x37f1ca[_0x09b7('0x1b')]['where']||null:null,'attributes':_0x37f1ca['options']?_0x37f1ca[_0x09b7('0x1b')][_0x09b7('0x1e')]||null:null,'include':_0x37f1ca[_0x09b7('0x1b')]?_0x37f1ca[_0x09b7('0x1b')][_0x09b7('0x20')]?_[_0x09b7('0x21')](_0x37f1ca[_0x09b7('0x1b')][_0x09b7('0x20')],function(_0x433592){return{'model':db[_0x433592[_0x09b7('0x22')]],'as':_0x433592['as'],'attributes':_0x433592[_0x09b7('0x1e')],'include':_0x433592[_0x09b7('0x20')]?_[_0x09b7('0x21')](_0x433592[_0x09b7('0x20')],function(_0x55f24e){return{'model':db[_0x55f24e[_0x09b7('0x22')]],'as':_0x55f24e['as'],'attributes':_0x55f24e[_0x09b7('0x1e')],'include':_0x55f24e['include']?_['map'](_0x55f24e[_0x09b7('0x20')],function(_0xa26e72){return{'model':db[_0xa26e72[_0x09b7('0x22')]],'as':_0xa26e72['as'],'attributes':_0xa26e72[_0x09b7('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x09b7('0xd')](function(_0x4f90fc){logger['info']('ShowZendeskAccount',_0x37f1ca);logger[_0x09b7('0x23')](_0x09b7('0x25'),_0x37f1ca,JSON['stringify'](_0x4f90fc));_0x26dcc4(_0x4f90fc);})[_0x09b7('0x17')](function(_0x1e18ed){logger[_0x09b7('0x13')]('ShowZendeskAccount',_0x1e18ed[_0x09b7('0x15')],_0x37f1ca);_0x14f3b0(_0xd294ea[_0x09b7('0x13')](0x1f4,_0x1e18ed[_0x09b7('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 3f0c0a8..97e7ff5 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','post','create','setTags','put','/:id','delete','destroy','exports','multer','util'];(function(_0x4de1c3,_0xbe77b9){var _0x26acfe=function(_0x2c9df4){while(--_0x2c9df4){_0x4de1c3['push'](_0x4de1c3['shift']());}};_0x26acfe(++_0xbe77b9);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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 fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./intZendeskConfiguration.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/:id',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x9')](_0x0d8b('0xd'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x9')]('/:id/descriptions',auth[_0x0d8b('0x7')](),controller['getDescriptions']);router[_0x0d8b('0x9')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x10')]);router[_0x0d8b('0x11')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x12')]);router[_0x0d8b('0x11')](_0x0d8b('0xf'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller['update']);router[_0x0d8b('0x16')](_0x0d8b('0x15'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x17')]);module[_0x0d8b('0x18')]=router; \ No newline at end of file +var _0x757a=['index','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','post','setTags','put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get'];(function(_0x308fa3,_0x35f77a){var _0x5640fc=function(_0x61faa8){while(--_0x61faa8){_0x308fa3['push'](_0x308fa3['shift']());}};_0x5640fc(++_0x35f77a);}(_0x757a,0xde));var _0xa757=function(_0x36fd1b,_0x45bda1){_0x36fd1b=_0x36fd1b-0x0;var _0x32b8d4=_0x757a[_0x36fd1b];return _0x32b8d4;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['getFields']);router[_0xa757('0x7')](_0xa757('0xc'),auth[_0xa757('0x9')](),controller[_0xa757('0xd')]);router[_0xa757('0x7')](_0xa757('0xe'),auth[_0xa757('0x9')](),controller['getDescriptions']);router['get']('/:id/tags',auth['isAuthenticated'](),controller['getTags']);router[_0xa757('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa757('0xf')]('/:id/tags',auth['isAuthenticated'](),controller[_0xa757('0x10')]);router[_0xa757('0x11')](_0xa757('0x12'),auth[_0xa757('0x9')](),controller[_0xa757('0x13')]);router[_0xa757('0x14')](_0xa757('0x12'),auth[_0xa757('0x9')](),controller[_0xa757('0x15')]);module[_0xa757('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 9fc0fb0..75d71ab 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 _0x4e37=['exports','STRING','sequelize'];(function(_0x379809,_0x2a8f32){var _0xb64de7=function(_0x7fd2fe){while(--_0x7fd2fe){_0x379809['push'](_0x379809['shift']());}};_0xb64de7(++_0x2a8f32);}(_0x4e37,0x15e));var _0x74e3=function(_0x4b4844,_0x2f0dfb){_0x4b4844=_0x4b4844-0x0;var _0x575192=_0x4e37[_0x4b4844];return _0x575192;};'use strict';var Sequelize=require(_0x74e3('0x0'));module[_0x74e3('0x1')]={'name':{'type':Sequelize[_0x74e3('0x2')]},'description':{'type':Sequelize[_0x74e3('0x2')]}}; \ No newline at end of file +var _0xa3e6=['exports','STRING','sequelize'];(function(_0x150498,_0x4e4bd6){var _0x1bf8b4=function(_0x523b70){while(--_0x523b70){_0x150498['push'](_0x150498['shift']());}};_0x1bf8b4(++_0x4e4bd6);}(_0xa3e6,0x65));var _0x6a3e=function(_0x15e575,_0x2ddb64){_0x15e575=_0x15e575-0x0;var _0x1d31ef=_0xa3e6[_0x15e575];return _0x1d31ef;};'use strict';var Sequelize=require(_0x6a3e('0x0'));module[_0x6a3e('0x1')]={'name':{'type':Sequelize[_0x6a3e('0x2')]},'description':{'type':Sequelize[_0x6a3e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index ab076c9..3b69fa9 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 _0xdc5e=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','ZendeskConfiguration','includeAll','findAll','catch','show','params','length','include','find','create','findOne','ZendeskField','getFields','getSubjects','getDescriptions','getTags','Tag','body','setTags','ids','eml-format','rimraf','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js'];(function(_0x30af30,_0xee8b76){var _0x1077c2=function(_0x2637d8){while(--_0x2637d8){_0x30af30['push'](_0x30af30['shift']());}};_0x1077c2(++_0xee8b76);}(_0xdc5e,0xec));var _0xedc5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xdc5e[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xedc5('0x0'));var rimraf=require(_0xedc5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xedc5('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xedc5('0x3'));var util=require(_0xedc5('0x4'));var path=require('path');var sox=require(_0xedc5('0x5'));var csv=require(_0xedc5('0x6'));var ejs=require(_0xedc5('0x7'));var fs=require('fs');var fs_extra=require(_0xedc5('0x8'));var _=require(_0xedc5('0x9'));var squel=require(_0xedc5('0xa'));var crypto=require('crypto');var jsforce=require(_0xedc5('0xb'));var deskjs=require(_0xedc5('0xc'));var toCsv=require(_0xedc5('0x6'));var querystring=require(_0xedc5('0xd'));var Papa=require(_0xedc5('0xe'));var Redis=require('ioredis');var authService=require(_0xedc5('0xf'));var qs=require(_0xedc5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xedc5('0x11'));var logger=require(_0xedc5('0x12'))(_0xedc5('0x13'));var utils=require(_0xedc5('0x14'));var config=require(_0xedc5('0x15'));var licenseUtil=require(_0xedc5('0x16'));var db=require(_0xedc5('0x17'))['db'];function respondWithStatusCode(_0x4eee7f,_0x135191){_0x135191=_0x135191||0xcc;return function(_0x5dc66c){if(_0x5dc66c){return _0x4eee7f[_0xedc5('0x18')](_0x135191);}return _0x4eee7f[_0xedc5('0x19')](_0x135191)[_0xedc5('0x1a')]();};}function respondWithResult(_0x1a87c3,_0x16eb50){_0x16eb50=_0x16eb50||0xc8;return function(_0x481b48){if(_0x481b48){return _0x1a87c3[_0xedc5('0x19')](_0x16eb50)[_0xedc5('0x1b')](_0x481b48);}};}function respondWithFilteredResult(_0x2e564c,_0xe3d602){return function(_0x34ab52){if(_0x34ab52){var _0x35b71d=typeof _0xe3d602[_0xedc5('0x1c')]==='undefined'&&typeof _0xe3d602[_0xedc5('0x1d')]===_0xedc5('0x1e');var _0x1205de=_0x34ab52[_0xedc5('0x1f')];var _0x44e9a8=_0x35b71d?0x0:_0xe3d602[_0xedc5('0x1c')];var _0x2f9b1f=_0x35b71d?_0x34ab52['count']:_0xe3d602['offset']+_0xe3d602['limit'];var _0x3556d7;if(_0x2f9b1f>=_0x1205de){_0x2f9b1f=_0x1205de;_0x3556d7=0xc8;}else{_0x3556d7=0xce;}_0x2e564c[_0xedc5('0x19')](_0x3556d7);return _0x2e564c[_0xedc5('0x20')]('Content-Range',_0x44e9a8+'-'+_0x2f9b1f+'/'+_0x1205de)[_0xedc5('0x1b')](_0x34ab52);}return null;};}function patchUpdates(_0x213265){return function(_0x33af62){try{jsonpatch['apply'](_0x33af62,_0x213265,!![]);}catch(_0x450895){return BPromise['reject'](_0x450895);}return _0x33af62[_0xedc5('0x21')]();};}function saveUpdates(_0x686772,_0x1cab30){return function(_0x1a2086){if(_0x1a2086){return _0x1a2086[_0xedc5('0x22')](_0x686772)[_0xedc5('0x23')](function(_0xf21074){return _0xf21074;});}return null;};}function removeEntity(_0x5ec021,_0x2af323){return function(_0x4e609e){if(_0x4e609e){return _0x4e609e[_0xedc5('0x24')]()[_0xedc5('0x23')](function(){_0x5ec021[_0xedc5('0x19')](0xcc)[_0xedc5('0x1a')]();});}};}function handleEntityNotFound(_0x530445,_0x3f793d){return function(_0x2a548f){if(!_0x2a548f){_0x530445[_0xedc5('0x18')](0x194);}return _0x2a548f;};}function handleError(_0x95a6c7,_0x49dec1){_0x49dec1=_0x49dec1||0x1f4;return function(_0x4b33a4){logger['error'](_0x4b33a4[_0xedc5('0x25')]);if(_0x4b33a4[_0xedc5('0x26')]){delete _0x4b33a4[_0xedc5('0x26')];}_0x95a6c7[_0xedc5('0x19')](_0x49dec1)[_0xedc5('0x27')](_0x4b33a4);};}exports[_0xedc5('0x28')]=function(_0x403064,_0x589605){var _0x5ea3cd={},_0x45e266={},_0x4c2a6a={'count':0x0,'rows':[]};var _0xb9434a=_[_0xedc5('0x29')](db['ZendeskConfiguration'][_0xedc5('0x2a')],function(_0x154197){return{'name':_0x154197[_0xedc5('0x2b')],'type':_0x154197[_0xedc5('0x2c')][_0xedc5('0x2d')]};});_0x45e266[_0xedc5('0x2e')]=_['map'](_0xb9434a,_0xedc5('0x26'));_0x45e266[_0xedc5('0x2f')]=_[_0xedc5('0x30')](_0x403064[_0xedc5('0x2f')]);_0x45e266[_0xedc5('0x31')]=_[_0xedc5('0x32')](_0x45e266[_0xedc5('0x2e')],_0x45e266[_0xedc5('0x2f')]);_0x5ea3cd[_0xedc5('0x33')]=_[_0xedc5('0x32')](_0x45e266['model'],qs['fields'](_0x403064[_0xedc5('0x2f')][_0xedc5('0x34')]));_0x5ea3cd[_0xedc5('0x33')]=_0x5ea3cd['attributes']['length']?_0x5ea3cd[_0xedc5('0x33')]:_0x45e266[_0xedc5('0x2e')];if(!_0x403064[_0xedc5('0x2f')][_0xedc5('0x35')](_0xedc5('0x36'))){_0x5ea3cd[_0xedc5('0x1d')]=qs['limit'](_0x403064[_0xedc5('0x2f')][_0xedc5('0x1d')]);_0x5ea3cd['offset']=qs['offset'](_0x403064['query'][_0xedc5('0x1c')]);}_0x5ea3cd[_0xedc5('0x37')]=qs['sort'](_0x403064[_0xedc5('0x2f')][_0xedc5('0x38')]);_0x5ea3cd['where']=qs[_0xedc5('0x31')](_[_0xedc5('0x39')](_0x403064[_0xedc5('0x2f')],_0x45e266[_0xedc5('0x31')]),_0xb9434a);if(_0x403064['query']['filter']){_0x5ea3cd[_0xedc5('0x3a')]=_[_0xedc5('0x3b')](_0x5ea3cd[_0xedc5('0x3a')],{'$or':_[_0xedc5('0x29')](_0xb9434a,function(_0x9028d9){if(_0x9028d9[_0xedc5('0x2c')]!==_0xedc5('0x3c')){var _0x33d2cc={};_0x33d2cc[_0x9028d9['name']]={'$like':'%'+_0x403064[_0xedc5('0x2f')][_0xedc5('0x3d')]+'%'};return _0x33d2cc;}})});}_0x5ea3cd=_[_0xedc5('0x3b')]({},_0x5ea3cd,_0x403064[_0xedc5('0x3e')]);var _0x73d1d2={'where':_0x5ea3cd['where']};return db[_0xedc5('0x3f')][_0xedc5('0x1f')](_0x73d1d2)['then'](function(_0x8eba9){_0x4c2a6a[_0xedc5('0x1f')]=_0x8eba9;if(_0x403064[_0xedc5('0x2f')][_0xedc5('0x40')]){_0x5ea3cd['include']=[{'all':!![]}];}return db[_0xedc5('0x3f')][_0xedc5('0x41')](_0x5ea3cd);})[_0xedc5('0x23')](function(_0x1246b9){_0x4c2a6a['rows']=_0x1246b9;return _0x4c2a6a;})[_0xedc5('0x23')](respondWithFilteredResult(_0x589605,_0x5ea3cd))[_0xedc5('0x42')](handleError(_0x589605,null));};exports[_0xedc5('0x43')]=function(_0x15a92e,_0x307af1){var _0x578c56={'raw':![],'where':{'id':_0x15a92e[_0xedc5('0x44')]['id']}},_0x5d19e5={};_0x5d19e5[_0xedc5('0x2e')]=_[_0xedc5('0x30')](db[_0xedc5('0x3f')][_0xedc5('0x2a')]);_0x5d19e5['query']=_[_0xedc5('0x30')](_0x15a92e[_0xedc5('0x2f')]);_0x5d19e5['filters']=_['intersection'](_0x5d19e5[_0xedc5('0x2e')],_0x5d19e5[_0xedc5('0x2f')]);_0x578c56[_0xedc5('0x33')]=_['intersection'](_0x5d19e5['model'],qs['fields'](_0x15a92e['query'][_0xedc5('0x34')]));_0x578c56['attributes']=_0x578c56[_0xedc5('0x33')][_0xedc5('0x45')]?_0x578c56[_0xedc5('0x33')]:_0x5d19e5[_0xedc5('0x2e')];if(_0x15a92e[_0xedc5('0x2f')][_0xedc5('0x40')]){_0x578c56[_0xedc5('0x46')]=[{'all':!![]}];}_0x578c56=_[_0xedc5('0x3b')]({},_0x578c56,_0x15a92e[_0xedc5('0x3e')]);return db[_0xedc5('0x3f')][_0xedc5('0x47')](_0x578c56)['then'](handleEntityNotFound(_0x307af1,null))[_0xedc5('0x23')](respondWithResult(_0x307af1,null))[_0xedc5('0x42')](handleError(_0x307af1,null));};exports['create']=function(_0x4b8743,_0x3256a5){return db[_0xedc5('0x3f')][_0xedc5('0x48')](_0x4b8743['body'],{})[_0xedc5('0x23')](respondWithResult(_0x3256a5,0xc9))[_0xedc5('0x42')](handleError(_0x3256a5,null));};exports['update']=function(_0x2269d3,_0x5ba94d){if(_0x2269d3['body']['id']){delete _0x2269d3['body']['id'];}return db[_0xedc5('0x3f')][_0xedc5('0x47')]({'where':{'id':_0x2269d3[_0xedc5('0x44')]['id']}})[_0xedc5('0x23')](handleEntityNotFound(_0x5ba94d,null))[_0xedc5('0x23')](saveUpdates(_0x2269d3['body'],null))['then'](respondWithResult(_0x5ba94d,null))['catch'](handleError(_0x5ba94d,null));};exports[_0xedc5('0x24')]=function(_0x711912,_0x1860ca){return db[_0xedc5('0x3f')][_0xedc5('0x47')]({'where':{'id':_0x711912[_0xedc5('0x44')]['id']}})[_0xedc5('0x23')](handleEntityNotFound(_0x1860ca,null))[_0xedc5('0x23')](removeEntity(_0x1860ca,null))[_0xedc5('0x42')](handleError(_0x1860ca,null));};exports['getFields']=function(_0x532e6f,_0x5a8d5b,_0x31468f){var _0xd0f069={};var _0x4be761={};var _0x452d1d;var _0x1819b4;return db[_0xedc5('0x3f')][_0xedc5('0x49')]({'where':{'id':_0x532e6f[_0xedc5('0x44')]['id']}})['then'](handleEntityNotFound(_0x5a8d5b,null))[_0xedc5('0x23')](function(_0x5dcc69){if(_0x5dcc69){_0x452d1d=_0x5dcc69;_0x4be761[_0xedc5('0x2e')]=_[_0xedc5('0x30')](db[_0xedc5('0x4a')][_0xedc5('0x2a')]);_0x4be761[_0xedc5('0x2f')]=_['keys'](_0x532e6f[_0xedc5('0x2f')]);_0x4be761[_0xedc5('0x31')]=_['intersection'](_0x4be761[_0xedc5('0x2e')],_0x4be761[_0xedc5('0x2f')]);_0xd0f069[_0xedc5('0x33')]=_[_0xedc5('0x32')](_0x4be761[_0xedc5('0x2e')],qs[_0xedc5('0x34')](_0x532e6f[_0xedc5('0x2f')][_0xedc5('0x34')]));_0xd0f069[_0xedc5('0x33')]=_0xd0f069[_0xedc5('0x33')]['length']?_0xd0f069[_0xedc5('0x33')]:_0x4be761[_0xedc5('0x2e')];_0xd0f069[_0xedc5('0x37')]=qs[_0xedc5('0x38')](_0x532e6f[_0xedc5('0x2f')]['sort']);_0xd0f069[_0xedc5('0x3a')]=qs['filters'](_[_0xedc5('0x39')](_0x532e6f[_0xedc5('0x2f')],_0x4be761[_0xedc5('0x31')]));if(_0x532e6f[_0xedc5('0x2f')][_0xedc5('0x3d')]){_0xd0f069[_0xedc5('0x3a')]=_['merge'](_0xd0f069[_0xedc5('0x3a')],{'$or':_[_0xedc5('0x29')](_0xd0f069[_0xedc5('0x33')],function(_0x3a149e){var _0x5cb71d={};_0x5cb71d[_0x3a149e]={'$like':'%'+_0x532e6f[_0xedc5('0x2f')]['filter']+'%'};return _0x5cb71d;})});}_0xd0f069=_['merge']({},_0xd0f069,_0x532e6f['options']);return _0x452d1d['getFields'](_0xd0f069);}})['then'](function(_0x483ea5){if(_0x483ea5){_0x1819b4=_0x483ea5['length'];if(!_0x532e6f[_0xedc5('0x2f')][_0xedc5('0x35')](_0xedc5('0x36'))){_0xd0f069[_0xedc5('0x1d')]=qs[_0xedc5('0x1d')](_0x532e6f['query'][_0xedc5('0x1d')]);_0xd0f069[_0xedc5('0x1c')]=qs[_0xedc5('0x1c')](_0x532e6f['query'][_0xedc5('0x1c')]);}return _0x452d1d[_0xedc5('0x4b')](_0xd0f069);}})[_0xedc5('0x23')](function(_0x533912){if(_0x533912){return _0x533912?{'count':_0x1819b4,'rows':_0x533912}:null;}})['then'](respondWithResult(_0x5a8d5b,null))[_0xedc5('0x42')](handleError(_0x5a8d5b,null));};exports[_0xedc5('0x4c')]=function(_0x3f6779,_0x412647,_0x3c9b7c){var _0x31f125={};var _0x1b7723={};var _0x5b3932;var _0x3fd8f8;return db['ZendeskConfiguration'][_0xedc5('0x49')]({'where':{'id':_0x3f6779[_0xedc5('0x44')]['id']}})[_0xedc5('0x23')](handleEntityNotFound(_0x412647,null))['then'](function(_0x588ed6){if(_0x588ed6){_0x5b3932=_0x588ed6;_0x1b7723['model']=_[_0xedc5('0x30')](db[_0xedc5('0x4a')][_0xedc5('0x2a')]);_0x1b7723[_0xedc5('0x2f')]=_[_0xedc5('0x30')](_0x3f6779[_0xedc5('0x2f')]);_0x1b7723[_0xedc5('0x31')]=_['intersection'](_0x1b7723['model'],_0x1b7723[_0xedc5('0x2f')]);_0x31f125[_0xedc5('0x33')]=_[_0xedc5('0x32')](_0x1b7723[_0xedc5('0x2e')],qs[_0xedc5('0x34')](_0x3f6779[_0xedc5('0x2f')]['fields']));_0x31f125[_0xedc5('0x33')]=_0x31f125[_0xedc5('0x33')][_0xedc5('0x45')]?_0x31f125[_0xedc5('0x33')]:_0x1b7723['model'];_0x31f125['order']=qs[_0xedc5('0x38')](_0x3f6779['query'][_0xedc5('0x38')]);_0x31f125[_0xedc5('0x3a')]=qs['filters'](_[_0xedc5('0x39')](_0x3f6779[_0xedc5('0x2f')],_0x1b7723[_0xedc5('0x31')]));if(_0x3f6779[_0xedc5('0x2f')][_0xedc5('0x3d')]){_0x31f125[_0xedc5('0x3a')]=_[_0xedc5('0x3b')](_0x31f125[_0xedc5('0x3a')],{'$or':_[_0xedc5('0x29')](_0x31f125['attributes'],function(_0x941f52){var _0x239966={};_0x239966[_0x941f52]={'$like':'%'+_0x3f6779[_0xedc5('0x2f')][_0xedc5('0x3d')]+'%'};return _0x239966;})});}_0x31f125=_[_0xedc5('0x3b')]({},_0x31f125,_0x3f6779[_0xedc5('0x3e')]);return _0x5b3932[_0xedc5('0x4c')](_0x31f125);}})[_0xedc5('0x23')](function(_0x55f7d5){if(_0x55f7d5){_0x3fd8f8=_0x55f7d5[_0xedc5('0x45')];if(!_0x3f6779['query'][_0xedc5('0x35')](_0xedc5('0x36'))){_0x31f125[_0xedc5('0x1d')]=qs[_0xedc5('0x1d')](_0x3f6779[_0xedc5('0x2f')][_0xedc5('0x1d')]);_0x31f125[_0xedc5('0x1c')]=qs['offset'](_0x3f6779[_0xedc5('0x2f')][_0xedc5('0x1c')]);}return _0x5b3932[_0xedc5('0x4c')](_0x31f125);}})[_0xedc5('0x23')](function(_0x4546e7){if(_0x4546e7){return _0x4546e7?{'count':_0x3fd8f8,'rows':_0x4546e7}:null;}})[_0xedc5('0x23')](respondWithResult(_0x412647,null))[_0xedc5('0x42')](handleError(_0x412647,null));};exports['getDescriptions']=function(_0x158037,_0x41820d,_0x71ba3b){var _0x249510={};var _0x12b805={};var _0x435ee4;var _0x56f586;return db[_0xedc5('0x3f')]['findOne']({'where':{'id':_0x158037[_0xedc5('0x44')]['id']}})['then'](handleEntityNotFound(_0x41820d,null))[_0xedc5('0x23')](function(_0x3dfcd9){if(_0x3dfcd9){_0x435ee4=_0x3dfcd9;_0x12b805[_0xedc5('0x2e')]=_[_0xedc5('0x30')](db[_0xedc5('0x4a')][_0xedc5('0x2a')]);_0x12b805[_0xedc5('0x2f')]=_[_0xedc5('0x30')](_0x158037['query']);_0x12b805['filters']=_[_0xedc5('0x32')](_0x12b805[_0xedc5('0x2e')],_0x12b805[_0xedc5('0x2f')]);_0x249510[_0xedc5('0x33')]=_[_0xedc5('0x32')](_0x12b805[_0xedc5('0x2e')],qs[_0xedc5('0x34')](_0x158037[_0xedc5('0x2f')][_0xedc5('0x34')]));_0x249510['attributes']=_0x249510[_0xedc5('0x33')][_0xedc5('0x45')]?_0x249510[_0xedc5('0x33')]:_0x12b805[_0xedc5('0x2e')];_0x249510[_0xedc5('0x37')]=qs['sort'](_0x158037['query'][_0xedc5('0x38')]);_0x249510['where']=qs[_0xedc5('0x31')](_['pick'](_0x158037[_0xedc5('0x2f')],_0x12b805['filters']));if(_0x158037['query']['filter']){_0x249510[_0xedc5('0x3a')]=_['merge'](_0x249510[_0xedc5('0x3a')],{'$or':_[_0xedc5('0x29')](_0x249510[_0xedc5('0x33')],function(_0x136f93){var _0x499596={};_0x499596[_0x136f93]={'$like':'%'+_0x158037[_0xedc5('0x2f')][_0xedc5('0x3d')]+'%'};return _0x499596;})});}_0x249510=_[_0xedc5('0x3b')]({},_0x249510,_0x158037[_0xedc5('0x3e')]);return _0x435ee4[_0xedc5('0x4d')](_0x249510);}})[_0xedc5('0x23')](function(_0x47c343){if(_0x47c343){_0x56f586=_0x47c343[_0xedc5('0x45')];if(!_0x158037[_0xedc5('0x2f')][_0xedc5('0x35')](_0xedc5('0x36'))){_0x249510['limit']=qs[_0xedc5('0x1d')](_0x158037[_0xedc5('0x2f')][_0xedc5('0x1d')]);_0x249510['offset']=qs[_0xedc5('0x1c')](_0x158037[_0xedc5('0x2f')][_0xedc5('0x1c')]);}return _0x435ee4['getDescriptions'](_0x249510);}})['then'](function(_0x11e97f){if(_0x11e97f){return _0x11e97f?{'count':_0x56f586,'rows':_0x11e97f}:null;}})[_0xedc5('0x23')](respondWithResult(_0x41820d,null))[_0xedc5('0x42')](handleError(_0x41820d,null));};exports[_0xedc5('0x4e')]=function(_0x2d1009,_0x497156,_0x47b591){var _0x52c898={};var _0x41a9a9={};var _0xafc75e;var _0x55fa8d;return db[_0xedc5('0x3f')][_0xedc5('0x49')]({'where':{'id':_0x2d1009['params']['id']}})[_0xedc5('0x23')](handleEntityNotFound(_0x497156,null))['then'](function(_0x343a3a){if(_0x343a3a){_0xafc75e=_0x343a3a;_0x41a9a9[_0xedc5('0x2e')]=_['keys'](db[_0xedc5('0x4f')]['rawAttributes']);_0x41a9a9['query']=_[_0xedc5('0x30')](_0x2d1009['query']);_0x41a9a9[_0xedc5('0x31')]=_[_0xedc5('0x32')](_0x41a9a9[_0xedc5('0x2e')],_0x41a9a9[_0xedc5('0x2f')]);_0x52c898[_0xedc5('0x33')]=_[_0xedc5('0x32')](_0x41a9a9[_0xedc5('0x2e')],qs[_0xedc5('0x34')](_0x2d1009[_0xedc5('0x2f')]['fields']));_0x52c898['attributes']=_0x52c898[_0xedc5('0x33')][_0xedc5('0x45')]?_0x52c898[_0xedc5('0x33')]:_0x41a9a9['model'];_0x52c898[_0xedc5('0x37')]=qs['sort'](_0x2d1009[_0xedc5('0x2f')][_0xedc5('0x38')]);_0x52c898[_0xedc5('0x3a')]=qs['filters'](_[_0xedc5('0x39')](_0x2d1009[_0xedc5('0x2f')],_0x41a9a9['filters']));if(_0x2d1009[_0xedc5('0x2f')]['filter']){_0x52c898[_0xedc5('0x3a')]=_[_0xedc5('0x3b')](_0x52c898[_0xedc5('0x3a')],{'$or':_['map'](_0x52c898[_0xedc5('0x33')],function(_0x3c0c74){var _0xcfe232={};_0xcfe232[_0x3c0c74]={'$like':'%'+_0x2d1009[_0xedc5('0x2f')][_0xedc5('0x3d')]+'%'};return _0xcfe232;})});}_0x52c898=_['merge']({},_0x52c898,_0x2d1009[_0xedc5('0x3e')]);return _0xafc75e[_0xedc5('0x4e')](_0x52c898);}})[_0xedc5('0x23')](function(_0x4ee244){if(_0x4ee244){_0x55fa8d=_0x4ee244[_0xedc5('0x45')];if(!_0x2d1009['query'][_0xedc5('0x35')](_0xedc5('0x36'))){_0x52c898[_0xedc5('0x1d')]=qs[_0xedc5('0x1d')](_0x2d1009['query']['limit']);_0x52c898[_0xedc5('0x1c')]=qs['offset'](_0x2d1009[_0xedc5('0x2f')][_0xedc5('0x1c')]);}return _0xafc75e['getTags'](_0x52c898);}})['then'](function(_0x3b2930){if(_0x3b2930){return _0x3b2930?{'count':_0x55fa8d,'rows':_0x3b2930}:null;}})['then'](respondWithResult(_0x497156,null))[_0xedc5('0x42')](handleError(_0x497156,null));};exports['setTags']=function(_0x5a01c6,_0xcbaa79,_0xd9b8ef){if(_0x5a01c6[_0xedc5('0x50')]['id']){delete _0x5a01c6[_0xedc5('0x50')]['id'];}return db[_0xedc5('0x3f')][_0xedc5('0x49')]({'where':{'id':_0x5a01c6[_0xedc5('0x44')]['id']}})[_0xedc5('0x23')](handleEntityNotFound(_0xcbaa79,null))[_0xedc5('0x23')](function(_0x59691a){if(_0x59691a){return _0x59691a[_0xedc5('0x51')](_0x5a01c6[_0xedc5('0x50')][_0xedc5('0x52')]||[]);}return null;})[_0xedc5('0x23')](respondWithResult(_0xcbaa79,null))[_0xedc5('0x42')](handleError(_0xcbaa79,null));}; \ No newline at end of file +var _0xf8f2=['fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','include','findAll','rows','catch','show','params','includeAll','create','body','find','getFields','findOne','ZendeskField','length','getSubjects','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','Content-Range','json','reject','save','update','destroy','then','error','stack','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0xd9ce1f,_0x481e34){var _0x5c9e3a=function(_0x1801f3){while(--_0x1801f3){_0xd9ce1f['push'](_0xd9ce1f['shift']());}};_0x5c9e3a(++_0x481e34);}(_0xf8f2,0x74));var _0x2f8f=function(_0x9731fe,_0x3116cf){_0x9731fe=_0x9731fe-0x0;var _0x45adea=_0xf8f2[_0x9731fe];return _0x45adea;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f8f('0x0'));var zipdir=require(_0x2f8f('0x1'));var jsonpatch=require(_0x2f8f('0x2'));var rp=require('request-promise');var moment=require(_0x2f8f('0x3'));var BPromise=require(_0x2f8f('0x4'));var Mustache=require(_0x2f8f('0x5'));var util=require(_0x2f8f('0x6'));var path=require(_0x2f8f('0x7'));var sox=require(_0x2f8f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f8f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2f8f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2f8f('0xb'));var toCsv=require(_0x2f8f('0xc'));var querystring=require('querystring');var Papa=require(_0x2f8f('0xd'));var Redis=require('ioredis');var authService=require(_0x2f8f('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2f8f('0xf'));var hardwareService=require(_0x2f8f('0x10'));var logger=require(_0x2f8f('0x11'))(_0x2f8f('0x12'));var utils=require(_0x2f8f('0x13'));var config=require(_0x2f8f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x2f8f('0x15'))['db'];function respondWithStatusCode(_0x41a999,_0x20e656){_0x20e656=_0x20e656||0xcc;return function(_0x4f98e7){if(_0x4f98e7){return _0x41a999[_0x2f8f('0x16')](_0x20e656);}return _0x41a999[_0x2f8f('0x17')](_0x20e656)[_0x2f8f('0x18')]();};}function respondWithResult(_0x2e2cc6,_0x44415c){_0x44415c=_0x44415c||0xc8;return function(_0x24f3b0){if(_0x24f3b0){return _0x2e2cc6[_0x2f8f('0x17')](_0x44415c)['json'](_0x24f3b0);}};}function respondWithFilteredResult(_0x4bf327,_0x36712a){return function(_0x5c4e72){if(_0x5c4e72){var _0x479134=typeof _0x36712a[_0x2f8f('0x19')]==='undefined'&&typeof _0x36712a[_0x2f8f('0x1a')]===_0x2f8f('0x1b');var _0x14b893=_0x5c4e72['count'];var _0x4ae709=_0x479134?0x0:_0x36712a[_0x2f8f('0x19')];var _0x24839d=_0x479134?_0x5c4e72['count']:_0x36712a[_0x2f8f('0x19')]+_0x36712a[_0x2f8f('0x1a')];var _0x1f1947;if(_0x24839d>=_0x14b893){_0x24839d=_0x14b893;_0x1f1947=0xc8;}else{_0x1f1947=0xce;}_0x4bf327[_0x2f8f('0x17')](_0x1f1947);return _0x4bf327['set'](_0x2f8f('0x1c'),_0x4ae709+'-'+_0x24839d+'/'+_0x14b893)[_0x2f8f('0x1d')](_0x5c4e72);}return null;};}function patchUpdates(_0x42356e){return function(_0x2c5f7d){try{jsonpatch['apply'](_0x2c5f7d,_0x42356e,!![]);}catch(_0x1fdf30){return BPromise[_0x2f8f('0x1e')](_0x1fdf30);}return _0x2c5f7d[_0x2f8f('0x1f')]();};}function saveUpdates(_0x441226,_0x357fa7){return function(_0x201a1f){if(_0x201a1f){return _0x201a1f[_0x2f8f('0x20')](_0x441226)['then'](function(_0x54ffcd){return _0x54ffcd;});}return null;};}function removeEntity(_0x323917,_0x1facf4){return function(_0xbb2093){if(_0xbb2093){return _0xbb2093[_0x2f8f('0x21')]()[_0x2f8f('0x22')](function(){_0x323917[_0x2f8f('0x17')](0xcc)[_0x2f8f('0x18')]();});}};}function handleEntityNotFound(_0x68ee7,_0x464810){return function(_0x7399ab){if(!_0x7399ab){_0x68ee7[_0x2f8f('0x16')](0x194);}return _0x7399ab;};}function handleError(_0x3c45a1,_0x405baa){_0x405baa=_0x405baa||0x1f4;return function(_0x15bc95){logger[_0x2f8f('0x23')](_0x15bc95[_0x2f8f('0x24')]);if(_0x15bc95[_0x2f8f('0x25')]){delete _0x15bc95[_0x2f8f('0x25')];}_0x3c45a1[_0x2f8f('0x17')](_0x405baa)['send'](_0x15bc95);};}exports[_0x2f8f('0x26')]=function(_0x319dec,_0x7f9b8){var _0x2179fb={},_0x2aaa95={},_0x5835cb={'count':0x0,'rows':[]};var _0x276026=_[_0x2f8f('0x27')](db[_0x2f8f('0x28')][_0x2f8f('0x29')],function(_0x4b6d3d){return{'name':_0x4b6d3d[_0x2f8f('0x2a')],'type':_0x4b6d3d[_0x2f8f('0x2b')][_0x2f8f('0x2c')]};});_0x2aaa95[_0x2f8f('0x2d')]=_[_0x2f8f('0x27')](_0x276026,_0x2f8f('0x25'));_0x2aaa95[_0x2f8f('0x2e')]=_[_0x2f8f('0x2f')](_0x319dec[_0x2f8f('0x2e')]);_0x2aaa95[_0x2f8f('0x30')]=_[_0x2f8f('0x31')](_0x2aaa95['model'],_0x2aaa95['query']);_0x2179fb['attributes']=_['intersection'](_0x2aaa95[_0x2f8f('0x2d')],qs[_0x2f8f('0x32')](_0x319dec[_0x2f8f('0x2e')][_0x2f8f('0x32')]));_0x2179fb[_0x2f8f('0x33')]=_0x2179fb[_0x2f8f('0x33')]['length']?_0x2179fb[_0x2f8f('0x33')]:_0x2aaa95[_0x2f8f('0x2d')];if(!_0x319dec[_0x2f8f('0x2e')][_0x2f8f('0x34')](_0x2f8f('0x35'))){_0x2179fb[_0x2f8f('0x1a')]=qs['limit'](_0x319dec[_0x2f8f('0x2e')]['limit']);_0x2179fb[_0x2f8f('0x19')]=qs['offset'](_0x319dec['query'][_0x2f8f('0x19')]);}_0x2179fb[_0x2f8f('0x36')]=qs[_0x2f8f('0x37')](_0x319dec[_0x2f8f('0x2e')][_0x2f8f('0x37')]);_0x2179fb[_0x2f8f('0x38')]=qs[_0x2f8f('0x30')](_[_0x2f8f('0x39')](_0x319dec[_0x2f8f('0x2e')],_0x2aaa95[_0x2f8f('0x30')]),_0x276026);if(_0x319dec['query'][_0x2f8f('0x3a')]){_0x2179fb[_0x2f8f('0x38')]=_['merge'](_0x2179fb[_0x2f8f('0x38')],{'$or':_[_0x2f8f('0x27')](_0x276026,function(_0x27820c){if(_0x27820c[_0x2f8f('0x2b')]!==_0x2f8f('0x3b')){var _0x2bd071={};_0x2bd071[_0x27820c[_0x2f8f('0x25')]]={'$like':'%'+_0x319dec[_0x2f8f('0x2e')][_0x2f8f('0x3a')]+'%'};return _0x2bd071;}})});}_0x2179fb=_[_0x2f8f('0x3c')]({},_0x2179fb,_0x319dec[_0x2f8f('0x3d')]);var _0x430162={'where':_0x2179fb['where']};return db[_0x2f8f('0x28')][_0x2f8f('0x3e')](_0x430162)[_0x2f8f('0x22')](function(_0x169bfb){_0x5835cb['count']=_0x169bfb;if(_0x319dec['query']['includeAll']){_0x2179fb[_0x2f8f('0x3f')]=[{'all':!![]}];}return db[_0x2f8f('0x28')][_0x2f8f('0x40')](_0x2179fb);})[_0x2f8f('0x22')](function(_0x22c021){_0x5835cb[_0x2f8f('0x41')]=_0x22c021;return _0x5835cb;})['then'](respondWithFilteredResult(_0x7f9b8,_0x2179fb))[_0x2f8f('0x42')](handleError(_0x7f9b8,null));};exports[_0x2f8f('0x43')]=function(_0x16d085,_0x54b432){var _0x2be72c={'raw':![],'where':{'id':_0x16d085[_0x2f8f('0x44')]['id']}},_0x5db61b={};_0x5db61b['model']=_[_0x2f8f('0x2f')](db[_0x2f8f('0x28')][_0x2f8f('0x29')]);_0x5db61b[_0x2f8f('0x2e')]=_[_0x2f8f('0x2f')](_0x16d085[_0x2f8f('0x2e')]);_0x5db61b[_0x2f8f('0x30')]=_[_0x2f8f('0x31')](_0x5db61b['model'],_0x5db61b[_0x2f8f('0x2e')]);_0x2be72c[_0x2f8f('0x33')]=_[_0x2f8f('0x31')](_0x5db61b['model'],qs[_0x2f8f('0x32')](_0x16d085[_0x2f8f('0x2e')]['fields']));_0x2be72c['attributes']=_0x2be72c[_0x2f8f('0x33')]['length']?_0x2be72c[_0x2f8f('0x33')]:_0x5db61b[_0x2f8f('0x2d')];if(_0x16d085[_0x2f8f('0x2e')][_0x2f8f('0x45')]){_0x2be72c[_0x2f8f('0x3f')]=[{'all':!![]}];}_0x2be72c=_[_0x2f8f('0x3c')]({},_0x2be72c,_0x16d085['options']);return db[_0x2f8f('0x28')]['find'](_0x2be72c)[_0x2f8f('0x22')](handleEntityNotFound(_0x54b432,null))[_0x2f8f('0x22')](respondWithResult(_0x54b432,null))[_0x2f8f('0x42')](handleError(_0x54b432,null));};exports[_0x2f8f('0x46')]=function(_0x475ff9,_0xdcedea){return db[_0x2f8f('0x28')][_0x2f8f('0x46')](_0x475ff9[_0x2f8f('0x47')],{})['then'](respondWithResult(_0xdcedea,0xc9))[_0x2f8f('0x42')](handleError(_0xdcedea,null));};exports['update']=function(_0x11ae9f,_0x51d253){if(_0x11ae9f[_0x2f8f('0x47')]['id']){delete _0x11ae9f[_0x2f8f('0x47')]['id'];}return db[_0x2f8f('0x28')][_0x2f8f('0x48')]({'where':{'id':_0x11ae9f[_0x2f8f('0x44')]['id']}})['then'](handleEntityNotFound(_0x51d253,null))[_0x2f8f('0x22')](saveUpdates(_0x11ae9f[_0x2f8f('0x47')],null))[_0x2f8f('0x22')](respondWithResult(_0x51d253,null))[_0x2f8f('0x42')](handleError(_0x51d253,null));};exports['destroy']=function(_0x32438b,_0x2b04b2){return db[_0x2f8f('0x28')]['find']({'where':{'id':_0x32438b['params']['id']}})['then'](handleEntityNotFound(_0x2b04b2,null))['then'](removeEntity(_0x2b04b2,null))[_0x2f8f('0x42')](handleError(_0x2b04b2,null));};exports[_0x2f8f('0x49')]=function(_0x475d0c,_0x32dc31,_0x1b3f01){var _0x4ce74e={};var _0x2e9d7c={};var _0x4b2f58;var _0x51795e;return db['ZendeskConfiguration'][_0x2f8f('0x4a')]({'where':{'id':_0x475d0c[_0x2f8f('0x44')]['id']}})[_0x2f8f('0x22')](handleEntityNotFound(_0x32dc31,null))[_0x2f8f('0x22')](function(_0x279c4e){if(_0x279c4e){_0x4b2f58=_0x279c4e;_0x2e9d7c[_0x2f8f('0x2d')]=_[_0x2f8f('0x2f')](db[_0x2f8f('0x4b')][_0x2f8f('0x29')]);_0x2e9d7c[_0x2f8f('0x2e')]=_['keys'](_0x475d0c['query']);_0x2e9d7c[_0x2f8f('0x30')]=_[_0x2f8f('0x31')](_0x2e9d7c[_0x2f8f('0x2d')],_0x2e9d7c[_0x2f8f('0x2e')]);_0x4ce74e[_0x2f8f('0x33')]=_[_0x2f8f('0x31')](_0x2e9d7c[_0x2f8f('0x2d')],qs['fields'](_0x475d0c[_0x2f8f('0x2e')][_0x2f8f('0x32')]));_0x4ce74e['attributes']=_0x4ce74e[_0x2f8f('0x33')][_0x2f8f('0x4c')]?_0x4ce74e[_0x2f8f('0x33')]:_0x2e9d7c[_0x2f8f('0x2d')];_0x4ce74e['order']=qs['sort'](_0x475d0c[_0x2f8f('0x2e')]['sort']);_0x4ce74e[_0x2f8f('0x38')]=qs[_0x2f8f('0x30')](_[_0x2f8f('0x39')](_0x475d0c[_0x2f8f('0x2e')],_0x2e9d7c[_0x2f8f('0x30')]));if(_0x475d0c[_0x2f8f('0x2e')][_0x2f8f('0x3a')]){_0x4ce74e['where']=_[_0x2f8f('0x3c')](_0x4ce74e[_0x2f8f('0x38')],{'$or':_['map'](_0x4ce74e[_0x2f8f('0x33')],function(_0x1f800c){var _0x6aa39b={};_0x6aa39b[_0x1f800c]={'$like':'%'+_0x475d0c['query']['filter']+'%'};return _0x6aa39b;})});}_0x4ce74e=_[_0x2f8f('0x3c')]({},_0x4ce74e,_0x475d0c[_0x2f8f('0x3d')]);return _0x4b2f58[_0x2f8f('0x49')](_0x4ce74e);}})[_0x2f8f('0x22')](function(_0x28c844){if(_0x28c844){_0x51795e=_0x28c844[_0x2f8f('0x4c')];if(!_0x475d0c['query']['hasOwnProperty'](_0x2f8f('0x35'))){_0x4ce74e[_0x2f8f('0x1a')]=qs['limit'](_0x475d0c['query'][_0x2f8f('0x1a')]);_0x4ce74e['offset']=qs[_0x2f8f('0x19')](_0x475d0c['query'][_0x2f8f('0x19')]);}return _0x4b2f58[_0x2f8f('0x49')](_0x4ce74e);}})[_0x2f8f('0x22')](function(_0x384369){if(_0x384369){return _0x384369?{'count':_0x51795e,'rows':_0x384369}:null;}})[_0x2f8f('0x22')](respondWithResult(_0x32dc31,null))[_0x2f8f('0x42')](handleError(_0x32dc31,null));};exports[_0x2f8f('0x4d')]=function(_0x4c92d5,_0x48d67b,_0x245a62){var _0x55a966={};var _0x5880c1={};var _0x309256;var _0x469cda;return db[_0x2f8f('0x28')][_0x2f8f('0x4a')]({'where':{'id':_0x4c92d5[_0x2f8f('0x44')]['id']}})[_0x2f8f('0x22')](handleEntityNotFound(_0x48d67b,null))[_0x2f8f('0x22')](function(_0x5aabcd){if(_0x5aabcd){_0x309256=_0x5aabcd;_0x5880c1['model']=_[_0x2f8f('0x2f')](db[_0x2f8f('0x4b')][_0x2f8f('0x29')]);_0x5880c1[_0x2f8f('0x2e')]=_[_0x2f8f('0x2f')](_0x4c92d5[_0x2f8f('0x2e')]);_0x5880c1['filters']=_[_0x2f8f('0x31')](_0x5880c1[_0x2f8f('0x2d')],_0x5880c1[_0x2f8f('0x2e')]);_0x55a966[_0x2f8f('0x33')]=_[_0x2f8f('0x31')](_0x5880c1[_0x2f8f('0x2d')],qs[_0x2f8f('0x32')](_0x4c92d5[_0x2f8f('0x2e')][_0x2f8f('0x32')]));_0x55a966['attributes']=_0x55a966['attributes'][_0x2f8f('0x4c')]?_0x55a966['attributes']:_0x5880c1['model'];_0x55a966['order']=qs['sort'](_0x4c92d5[_0x2f8f('0x2e')]['sort']);_0x55a966[_0x2f8f('0x38')]=qs[_0x2f8f('0x30')](_[_0x2f8f('0x39')](_0x4c92d5[_0x2f8f('0x2e')],_0x5880c1['filters']));if(_0x4c92d5[_0x2f8f('0x2e')][_0x2f8f('0x3a')]){_0x55a966[_0x2f8f('0x38')]=_[_0x2f8f('0x3c')](_0x55a966[_0x2f8f('0x38')],{'$or':_[_0x2f8f('0x27')](_0x55a966[_0x2f8f('0x33')],function(_0x42ca2b){var _0x192f7d={};_0x192f7d[_0x42ca2b]={'$like':'%'+_0x4c92d5['query']['filter']+'%'};return _0x192f7d;})});}_0x55a966=_[_0x2f8f('0x3c')]({},_0x55a966,_0x4c92d5[_0x2f8f('0x3d')]);return _0x309256[_0x2f8f('0x4d')](_0x55a966);}})[_0x2f8f('0x22')](function(_0x12190a){if(_0x12190a){_0x469cda=_0x12190a[_0x2f8f('0x4c')];if(!_0x4c92d5[_0x2f8f('0x2e')][_0x2f8f('0x34')](_0x2f8f('0x35'))){_0x55a966[_0x2f8f('0x1a')]=qs[_0x2f8f('0x1a')](_0x4c92d5['query'][_0x2f8f('0x1a')]);_0x55a966[_0x2f8f('0x19')]=qs[_0x2f8f('0x19')](_0x4c92d5[_0x2f8f('0x2e')][_0x2f8f('0x19')]);}return _0x309256[_0x2f8f('0x4d')](_0x55a966);}})[_0x2f8f('0x22')](function(_0x32bfd7){if(_0x32bfd7){return _0x32bfd7?{'count':_0x469cda,'rows':_0x32bfd7}:null;}})[_0x2f8f('0x22')](respondWithResult(_0x48d67b,null))[_0x2f8f('0x42')](handleError(_0x48d67b,null));};exports[_0x2f8f('0x4e')]=function(_0x30945e,_0xa28e5,_0x4b7d9e){var _0x31cb2a={};var _0x3c4cfa={};var _0x11a97f;var _0x3111df;return db['ZendeskConfiguration'][_0x2f8f('0x4a')]({'where':{'id':_0x30945e[_0x2f8f('0x44')]['id']}})['then'](handleEntityNotFound(_0xa28e5,null))[_0x2f8f('0x22')](function(_0x558bbc){if(_0x558bbc){_0x11a97f=_0x558bbc;_0x3c4cfa[_0x2f8f('0x2d')]=_[_0x2f8f('0x2f')](db[_0x2f8f('0x4b')][_0x2f8f('0x29')]);_0x3c4cfa['query']=_[_0x2f8f('0x2f')](_0x30945e[_0x2f8f('0x2e')]);_0x3c4cfa[_0x2f8f('0x30')]=_[_0x2f8f('0x31')](_0x3c4cfa[_0x2f8f('0x2d')],_0x3c4cfa['query']);_0x31cb2a[_0x2f8f('0x33')]=_[_0x2f8f('0x31')](_0x3c4cfa[_0x2f8f('0x2d')],qs[_0x2f8f('0x32')](_0x30945e[_0x2f8f('0x2e')][_0x2f8f('0x32')]));_0x31cb2a[_0x2f8f('0x33')]=_0x31cb2a['attributes'][_0x2f8f('0x4c')]?_0x31cb2a[_0x2f8f('0x33')]:_0x3c4cfa[_0x2f8f('0x2d')];_0x31cb2a[_0x2f8f('0x36')]=qs['sort'](_0x30945e[_0x2f8f('0x2e')][_0x2f8f('0x37')]);_0x31cb2a[_0x2f8f('0x38')]=qs[_0x2f8f('0x30')](_['pick'](_0x30945e[_0x2f8f('0x2e')],_0x3c4cfa[_0x2f8f('0x30')]));if(_0x30945e['query'][_0x2f8f('0x3a')]){_0x31cb2a[_0x2f8f('0x38')]=_['merge'](_0x31cb2a[_0x2f8f('0x38')],{'$or':_['map'](_0x31cb2a[_0x2f8f('0x33')],function(_0x389fb7){var _0x4310ca={};_0x4310ca[_0x389fb7]={'$like':'%'+_0x30945e[_0x2f8f('0x2e')][_0x2f8f('0x3a')]+'%'};return _0x4310ca;})});}_0x31cb2a=_['merge']({},_0x31cb2a,_0x30945e[_0x2f8f('0x3d')]);return _0x11a97f[_0x2f8f('0x4e')](_0x31cb2a);}})[_0x2f8f('0x22')](function(_0x335023){if(_0x335023){_0x3111df=_0x335023[_0x2f8f('0x4c')];if(!_0x30945e[_0x2f8f('0x2e')]['hasOwnProperty']('nolimit')){_0x31cb2a[_0x2f8f('0x1a')]=qs['limit'](_0x30945e[_0x2f8f('0x2e')][_0x2f8f('0x1a')]);_0x31cb2a[_0x2f8f('0x19')]=qs[_0x2f8f('0x19')](_0x30945e[_0x2f8f('0x2e')][_0x2f8f('0x19')]);}return _0x11a97f[_0x2f8f('0x4e')](_0x31cb2a);}})[_0x2f8f('0x22')](function(_0x50235b){if(_0x50235b){return _0x50235b?{'count':_0x3111df,'rows':_0x50235b}:null;}})['then'](respondWithResult(_0xa28e5,null))['catch'](handleError(_0xa28e5,null));};exports[_0x2f8f('0x4f')]=function(_0x4816f8,_0x254db6,_0x2e4a69){var _0x5c892a={};var _0x2b5364={};var _0x36bc44;var _0x331d43;return db[_0x2f8f('0x28')]['findOne']({'where':{'id':_0x4816f8[_0x2f8f('0x44')]['id']}})[_0x2f8f('0x22')](handleEntityNotFound(_0x254db6,null))[_0x2f8f('0x22')](function(_0x311c85){if(_0x311c85){_0x36bc44=_0x311c85;_0x2b5364[_0x2f8f('0x2d')]=_[_0x2f8f('0x2f')](db[_0x2f8f('0x50')][_0x2f8f('0x29')]);_0x2b5364[_0x2f8f('0x2e')]=_[_0x2f8f('0x2f')](_0x4816f8[_0x2f8f('0x2e')]);_0x2b5364[_0x2f8f('0x30')]=_[_0x2f8f('0x31')](_0x2b5364[_0x2f8f('0x2d')],_0x2b5364[_0x2f8f('0x2e')]);_0x5c892a[_0x2f8f('0x33')]=_['intersection'](_0x2b5364[_0x2f8f('0x2d')],qs['fields'](_0x4816f8[_0x2f8f('0x2e')][_0x2f8f('0x32')]));_0x5c892a[_0x2f8f('0x33')]=_0x5c892a['attributes'][_0x2f8f('0x4c')]?_0x5c892a['attributes']:_0x2b5364['model'];_0x5c892a[_0x2f8f('0x36')]=qs[_0x2f8f('0x37')](_0x4816f8['query'][_0x2f8f('0x37')]);_0x5c892a[_0x2f8f('0x38')]=qs[_0x2f8f('0x30')](_[_0x2f8f('0x39')](_0x4816f8[_0x2f8f('0x2e')],_0x2b5364['filters']));if(_0x4816f8[_0x2f8f('0x2e')][_0x2f8f('0x3a')]){_0x5c892a[_0x2f8f('0x38')]=_['merge'](_0x5c892a[_0x2f8f('0x38')],{'$or':_['map'](_0x5c892a[_0x2f8f('0x33')],function(_0x26183b){var _0x1c6b54={};_0x1c6b54[_0x26183b]={'$like':'%'+_0x4816f8[_0x2f8f('0x2e')][_0x2f8f('0x3a')]+'%'};return _0x1c6b54;})});}_0x5c892a=_['merge']({},_0x5c892a,_0x4816f8[_0x2f8f('0x3d')]);return _0x36bc44['getTags'](_0x5c892a);}})[_0x2f8f('0x22')](function(_0xd92c44){if(_0xd92c44){_0x331d43=_0xd92c44[_0x2f8f('0x4c')];if(!_0x4816f8[_0x2f8f('0x2e')][_0x2f8f('0x34')]('nolimit')){_0x5c892a[_0x2f8f('0x1a')]=qs['limit'](_0x4816f8[_0x2f8f('0x2e')]['limit']);_0x5c892a['offset']=qs[_0x2f8f('0x19')](_0x4816f8[_0x2f8f('0x2e')][_0x2f8f('0x19')]);}return _0x36bc44[_0x2f8f('0x4f')](_0x5c892a);}})[_0x2f8f('0x22')](function(_0x2830cc){if(_0x2830cc){return _0x2830cc?{'count':_0x331d43,'rows':_0x2830cc}:null;}})[_0x2f8f('0x22')](respondWithResult(_0x254db6,null))['catch'](handleError(_0x254db6,null));};exports[_0x2f8f('0x51')]=function(_0x143803,_0x309785,_0xd3127c){if(_0x143803['body']['id']){delete _0x143803['body']['id'];}return db[_0x2f8f('0x28')]['findOne']({'where':{'id':_0x143803[_0x2f8f('0x44')]['id']}})[_0x2f8f('0x22')](handleEntityNotFound(_0x309785,null))[_0x2f8f('0x22')](function(_0x345471){if(_0x345471){return _0x345471['setTags'](_0x143803[_0x2f8f('0x47')][_0x2f8f('0x52')]||[]);}return null;})[_0x2f8f('0x22')](respondWithResult(_0x309785,null))[_0x2f8f('0x42')](handleError(_0x309785,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index c17fad3..a8e6f6a 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 _0xfcbb=['rimraf','../../config/environment','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','bluebird','request-promise','path'];(function(_0x565a5f,_0x53eb6a){var _0x103eee=function(_0x260ee1){while(--_0x260ee1){_0x565a5f['push'](_0x565a5f['shift']());}};_0x103eee(++_0x53eb6a);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x312f5a,_0x30bef1){_0x312f5a=_0x312f5a-0x0;var _0x9b06d8=_0xfcbb[_0x312f5a];return _0x9b06d8;};'use strict';var _=require(_0xbfcb('0x0'));var util=require(_0xbfcb('0x1'));var logger=require(_0xbfcb('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbfcb('0x3'));var rp=require(_0xbfcb('0x4'));var fs=require('fs');var path=require(_0xbfcb('0x5'));var rimraf=require(_0xbfcb('0x6'));var config=require(_0xbfcb('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x32c2aa,_0x4990c){return _0x32c2aa[_0xbfcb('0x8')](_0xbfcb('0x9'),attributes,{'tableName':_0xbfcb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util'];(function(_0x514ab1,_0x2cf359){var _0x3a96a6=function(_0x14eb02){while(--_0x14eb02){_0x514ab1['push'](_0x514ab1['shift']());}};_0x3a96a6(++_0x2cf359);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'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/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 0fc94c6..3ef2f14 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 _0x4ed4=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../mysqldb'];(function(_0x1b976b,_0x1e8f55){var _0x1b0b87=function(_0x27612a){while(--_0x27612a){_0x1b976b['push'](_0x1b976b['shift']());}};_0x1b0b87(++_0x1e8f55);}(_0x4ed4,0x155));var _0x44ed=function(_0x907d59,_0x2a23fa){_0x907d59=_0x907d59-0x0;var _0x51355d=_0x4ed4[_0x907d59];return _0x51355d;};'use strict';var _=require(_0x44ed('0x0'));var util=require('util');var moment=require(_0x44ed('0x1'));var BPromise=require(_0x44ed('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x44ed('0x3'))['db'];var utils=require(_0x44ed('0x4'));var logger=require(_0x44ed('0x5'))(_0x44ed('0x6'));var config=require(_0x44ed('0x7'));var jayson=require(_0x44ed('0x8'));var client=jayson[_0x44ed('0x9')][_0x44ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25b809,_0x33e208,_0x8deedd){return new BPromise(function(_0x54e89c,_0x3ad815){return client[_0x44ed('0xb')](_0x25b809,_0x8deedd)[_0x44ed('0xc')](function(_0x29a875){logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x33e208,_0x44ed('0xd'));logger[_0x44ed('0xe')](_0x44ed('0xf'),_0x33e208,_0x44ed('0xd'),JSON[_0x44ed('0x10')](_0x29a875));if(_0x29a875[_0x44ed('0x11')]){if(_0x29a875[_0x44ed('0x11')][_0x44ed('0x12')]===0x1f4){logger['error'](_0x44ed('0x13'),_0x33e208,_0x29a875[_0x44ed('0x11')][_0x44ed('0x14')]);return _0x3ad815(_0x29a875[_0x44ed('0x11')]['message']);}logger[_0x44ed('0x11')](_0x44ed('0x13'),_0x33e208,_0x29a875[_0x44ed('0x11')][_0x44ed('0x14')]);return _0x54e89c(_0x29a875[_0x44ed('0x11')][_0x44ed('0x14')]);}else{logger['info'](_0x44ed('0x13'),_0x33e208,_0x44ed('0xd'));_0x54e89c(_0x29a875[_0x44ed('0x15')][_0x44ed('0x14')]);}})[_0x44ed('0x16')](function(_0x80683d){logger['error'](_0x44ed('0x13'),_0x33e208,_0x80683d);_0x3ad815(_0x80683d);});});} \ No newline at end of file +var _0x6318=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','util','moment'];(function(_0x2ddea4,_0x3b4d83){var _0xb3eb2=function(_0x11ab0a){while(--_0x11ab0a){_0x2ddea4['push'](_0x2ddea4['shift']());}};_0xb3eb2(++_0x3b4d83);}(_0x6318,0xf0));var _0x8631=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x6318[_0x1d24eb];return _0x1dc576;};'use strict';var _=require('lodash');var util=require(_0x8631('0x0'));var moment=require(_0x8631('0x1'));var BPromise=require('bluebird');var rs=require(_0x8631('0x2'));var fs=require('fs');var Redis=require(_0x8631('0x3'));var db=require(_0x8631('0x4'))['db'];var utils=require(_0x8631('0x5'));var logger=require(_0x8631('0x6'))(_0x8631('0x7'));var config=require(_0x8631('0x8'));var jayson=require(_0x8631('0x9'));var client=jayson[_0x8631('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1350b7,_0x5d4620,_0x23f7b5){return new BPromise(function(_0x3d1a0c,_0xf9fe3){return client[_0x8631('0xb')](_0x1350b7,_0x23f7b5)[_0x8631('0xc')](function(_0x126a5e){logger['info'](_0x8631('0xd'),_0x5d4620,_0x8631('0xe'));logger[_0x8631('0xf')](_0x8631('0x10'),_0x5d4620,_0x8631('0xe'),JSON['stringify'](_0x126a5e));if(_0x126a5e[_0x8631('0x11')]){if(_0x126a5e['error'][_0x8631('0x12')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x5d4620,_0x126a5e['error'][_0x8631('0x13')]);return _0xf9fe3(_0x126a5e[_0x8631('0x11')][_0x8631('0x13')]);}logger[_0x8631('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5d4620,_0x126a5e[_0x8631('0x11')][_0x8631('0x13')]);return _0x3d1a0c(_0x126a5e['error']['message']);}else{logger[_0x8631('0x14')](_0x8631('0xd'),_0x5d4620,_0x8631('0xe'));_0x3d1a0c(_0x126a5e[_0x8631('0x15')][_0x8631('0x13')]);}})['catch'](function(_0x3a6b92){logger[_0x8631('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5d4620,_0x3a6b92);_0xf9fe3(_0x3a6b92);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 2d000ee..6be79f2 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 _0xb78e=['index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated'];(function(_0x43eec,_0x5878eb){var _0x94b62b=function(_0x4c878f){while(--_0x4c878f){_0x43eec['push'](_0x43eec['shift']());}};_0x94b62b(++_0x5878eb);}(_0xb78e,0xd9));var _0xeb78=function(_0x4ddc33,_0x48a1ce){_0x4ddc33=_0x4ddc33-0x0;var _0x52a177=_0xb78e[_0x4ddc33];return _0x52a177;};'use strict';var multer=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var path=require(_0xeb78('0x2'));var timeout=require(_0xeb78('0x3'));var express=require(_0xeb78('0x4'));var router=express[_0xeb78('0x5')]();var fs_extra=require(_0xeb78('0x6'));var auth=require(_0xeb78('0x7'));var interaction=require(_0xeb78('0x8'));var config=require(_0xeb78('0x9'));var controller=require(_0xeb78('0xa'));router[_0xeb78('0xb')]('/',auth[_0xeb78('0xc')](),controller[_0xeb78('0xd')]);router[_0xeb78('0xb')](_0xeb78('0xe'),auth[_0xeb78('0xc')](),controller[_0xeb78('0xf')]);router[_0xeb78('0x10')]('/',auth['isAuthenticated'](),controller[_0xeb78('0x11')]);router[_0xeb78('0x12')](_0xeb78('0xe'),auth[_0xeb78('0xc')](),controller[_0xeb78('0x13')]);router[_0xeb78('0x14')](_0xeb78('0xe'),auth[_0xeb78('0xc')](),controller[_0xeb78('0x15')]);module[_0xeb78('0x16')]=router; \ No newline at end of file +var _0xb5df=['index','post','isAuthenticated','create','put','update','delete','/:id','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZendeskField.controller','get'];(function(_0x1d3791,_0x51c613){var _0x40fbf5=function(_0xe5d147){while(--_0xe5d147){_0x1d3791['push'](_0x1d3791['shift']());}};_0x40fbf5(++_0x51c613);}(_0xb5df,0x196));var _0xfb5d=function(_0x55b22a,_0x41445f){_0x55b22a=_0x55b22a-0x0;var _0x52c56f=_0xb5df[_0x55b22a];return _0x52c56f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfb5d('0x0'));var timeout=require(_0xfb5d('0x1'));var express=require(_0xfb5d('0x2'));var router=express[_0xfb5d('0x3')]();var fs_extra=require(_0xfb5d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xfb5d('0x5'));var config=require('../../config/environment');var controller=require(_0xfb5d('0x6'));router[_0xfb5d('0x7')]('/',auth['isAuthenticated'](),controller[_0xfb5d('0x8')]);router[_0xfb5d('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xfb5d('0x9')]('/',auth[_0xfb5d('0xa')](),controller[_0xfb5d('0xb')]);router[_0xfb5d('0xc')]('/:id',auth[_0xfb5d('0xa')](),controller[_0xfb5d('0xd')]);router[_0xfb5d('0xe')](_0xfb5d('0xf'),auth['isAuthenticated'](),controller[_0xfb5d('0x10')]);module[_0xfb5d('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 6893520..b7eeb99 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 _0x23a5=['customVariable','keyValue','picklist','STRING','ENUM','variable','BOOLEAN','exports','string'];(function(_0x41ef02,_0x101e1a){var _0x5e6995=function(_0x124fdd){while(--_0x124fdd){_0x41ef02['push'](_0x41ef02['shift']());}};_0x5e6995(++_0x101e1a);}(_0x23a5,0x181));var _0x523a=function(_0x3e7f40,_0x49389b){_0x3e7f40=_0x3e7f40-0x0;var _0x9a9a1f=_0x23a5[_0x3e7f40];return _0x9a9a1f;};'use strict';var Sequelize=require('sequelize');module[_0x523a('0x0')]={'type':{'type':Sequelize['ENUM'](_0x523a('0x1'),'variable',_0x523a('0x2'),_0x523a('0x3'),_0x523a('0x4')),'defaultValue':_0x523a('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x523a('0x5')]},'keyType':{'type':Sequelize[_0x523a('0x6')](_0x523a('0x1'),_0x523a('0x7'),_0x523a('0x2'))},'keyContent':{'type':Sequelize[_0x523a('0x5')]},'idField':{'type':Sequelize[_0x523a('0x5')]},'nameField':{'type':Sequelize[_0x523a('0x5')]},'customField':{'type':Sequelize[_0x523a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x523a('0x5')]}}; \ No newline at end of file +var _0x8e28=['keyValue','picklist','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x4c3851,_0xbebbfd){var _0x43a1e2=function(_0x271b9f){while(--_0x271b9f){_0x4c3851['push'](_0x4c3851['shift']());}};_0x43a1e2(++_0xbebbfd);}(_0x8e28,0xa4));var _0x88e2=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x8e28[_0x47aa64];return _0x549c7a;};'use strict';var Sequelize=require(_0x88e2('0x0'));module[_0x88e2('0x1')]={'type':{'type':Sequelize[_0x88e2('0x2')](_0x88e2('0x3'),_0x88e2('0x4'),_0x88e2('0x5'),_0x88e2('0x6'),_0x88e2('0x7')),'defaultValue':_0x88e2('0x3')},'content':{'type':Sequelize[_0x88e2('0x8')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x88e2('0x2')](_0x88e2('0x3'),_0x88e2('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x88e2('0x8')]},'idField':{'type':Sequelize[_0x88e2('0x8')]},'nameField':{'type':Sequelize[_0x88e2('0x8')]},'customField':{'type':Sequelize[_0x88e2('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x88e2('0x8')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 9b5f748..81d40c1 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 _0x4e4d=['../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ZendeskField','findAll','params','keys','length','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x4b38b7,_0x50afcd){var _0x115c6b=function(_0x52cfa5){while(--_0x52cfa5){_0x4b38b7['push'](_0x4b38b7['shift']());}};_0x115c6b(++_0x50afcd);}(_0x4e4d,0xd7));var _0xd4e4=function(_0x5416db,_0x55683a){_0x5416db=_0x5416db-0x0;var _0x243e35=_0x4e4d[_0x5416db];return _0x243e35;};'use strict';var emlformat=require(_0xd4e4('0x0'));var rimraf=require(_0xd4e4('0x1'));var zipdir=require(_0xd4e4('0x2'));var jsonpatch=require(_0xd4e4('0x3'));var rp=require(_0xd4e4('0x4'));var moment=require(_0xd4e4('0x5'));var BPromise=require(_0xd4e4('0x6'));var Mustache=require(_0xd4e4('0x7'));var util=require(_0xd4e4('0x8'));var path=require(_0xd4e4('0x9'));var sox=require(_0xd4e4('0xa'));var csv=require('to-csv');var ejs=require(_0xd4e4('0xb'));var fs=require('fs');var fs_extra=require(_0xd4e4('0xc'));var _=require('lodash');var squel=require(_0xd4e4('0xd'));var crypto=require(_0xd4e4('0xe'));var jsforce=require(_0xd4e4('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd4e4('0x10'));var Papa=require(_0xd4e4('0x11'));var Redis=require(_0xd4e4('0x12'));var authService=require(_0xd4e4('0x13'));var qs=require(_0xd4e4('0x14'));var as=require(_0xd4e4('0x15'));var hardwareService=require(_0xd4e4('0x16'));var logger=require(_0xd4e4('0x17'))(_0xd4e4('0x18'));var utils=require(_0xd4e4('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xd4e4('0x1a'));var db=require(_0xd4e4('0x1b'))['db'];function respondWithStatusCode(_0x1f6c99,_0x3961b7){_0x3961b7=_0x3961b7||0xcc;return function(_0x4de538){if(_0x4de538){return _0x1f6c99['sendStatus'](_0x3961b7);}return _0x1f6c99[_0xd4e4('0x1c')](_0x3961b7)[_0xd4e4('0x1d')]();};}function respondWithResult(_0x594124,_0x504038){_0x504038=_0x504038||0xc8;return function(_0x5761c2){if(_0x5761c2){return _0x594124[_0xd4e4('0x1c')](_0x504038)[_0xd4e4('0x1e')](_0x5761c2);}};}function respondWithFilteredResult(_0x5097d9,_0x1efac0){return function(_0x232b38){if(_0x232b38){var _0x2af259=typeof _0x1efac0[_0xd4e4('0x1f')]===_0xd4e4('0x20')&&typeof _0x1efac0['limit']===_0xd4e4('0x20');var _0x57a242=_0x232b38[_0xd4e4('0x21')];var _0x4ed0e4=_0x2af259?0x0:_0x1efac0[_0xd4e4('0x1f')];var _0x1413fc=_0x2af259?_0x232b38[_0xd4e4('0x21')]:_0x1efac0[_0xd4e4('0x1f')]+_0x1efac0[_0xd4e4('0x22')];var _0x4a52f9;if(_0x1413fc>=_0x57a242){_0x1413fc=_0x57a242;_0x4a52f9=0xc8;}else{_0x4a52f9=0xce;}_0x5097d9[_0xd4e4('0x1c')](_0x4a52f9);return _0x5097d9[_0xd4e4('0x23')](_0xd4e4('0x24'),_0x4ed0e4+'-'+_0x1413fc+'/'+_0x57a242)[_0xd4e4('0x1e')](_0x232b38);}return null;};}function patchUpdates(_0x55b327){return function(_0x591be6){try{jsonpatch[_0xd4e4('0x25')](_0x591be6,_0x55b327,!![]);}catch(_0x35bafb){return BPromise[_0xd4e4('0x26')](_0x35bafb);}return _0x591be6[_0xd4e4('0x27')]();};}function saveUpdates(_0x5edcf9,_0x4cc0ff){return function(_0xd3560d){if(_0xd3560d){return _0xd3560d[_0xd4e4('0x28')](_0x5edcf9)[_0xd4e4('0x29')](function(_0x4ebb0d){return _0x4ebb0d;});}return null;};}function removeEntity(_0x245879,_0x2ecaf9){return function(_0x51672d){if(_0x51672d){return _0x51672d[_0xd4e4('0x2a')]()[_0xd4e4('0x29')](function(){_0x245879[_0xd4e4('0x1c')](0xcc)[_0xd4e4('0x1d')]();});}};}function handleEntityNotFound(_0x436d20,_0x47914a){return function(_0x2a1ab0){if(!_0x2a1ab0){_0x436d20[_0xd4e4('0x2b')](0x194);}return _0x2a1ab0;};}function handleError(_0x34abbc,_0x155444){_0x155444=_0x155444||0x1f4;return function(_0x31cca7){logger['error'](_0x31cca7[_0xd4e4('0x2c')]);if(_0x31cca7['name']){delete _0x31cca7[_0xd4e4('0x2d')];}_0x34abbc[_0xd4e4('0x1c')](_0x155444)[_0xd4e4('0x2e')](_0x31cca7);};}exports[_0xd4e4('0x2f')]=function(_0x21acab,_0x1bf9e5){var _0xc59ca7={},_0x318f0b={},_0x147f9a={'count':0x0,'rows':[]};var _0x54e45d=_[_0xd4e4('0x30')](db['ZendeskField'][_0xd4e4('0x31')],function(_0x529886){return{'name':_0x529886[_0xd4e4('0x32')],'type':_0x529886[_0xd4e4('0x33')][_0xd4e4('0x34')]};});_0x318f0b[_0xd4e4('0x35')]=_[_0xd4e4('0x30')](_0x54e45d,_0xd4e4('0x2d'));_0x318f0b[_0xd4e4('0x36')]=_['keys'](_0x21acab['query']);_0x318f0b[_0xd4e4('0x37')]=_[_0xd4e4('0x38')](_0x318f0b['model'],_0x318f0b[_0xd4e4('0x36')]);_0xc59ca7[_0xd4e4('0x39')]=_[_0xd4e4('0x38')](_0x318f0b['model'],qs[_0xd4e4('0x3a')](_0x21acab[_0xd4e4('0x36')]['fields']));_0xc59ca7[_0xd4e4('0x39')]=_0xc59ca7[_0xd4e4('0x39')]['length']?_0xc59ca7[_0xd4e4('0x39')]:_0x318f0b[_0xd4e4('0x35')];if(!_0x21acab['query'][_0xd4e4('0x3b')](_0xd4e4('0x3c'))){_0xc59ca7[_0xd4e4('0x22')]=qs[_0xd4e4('0x22')](_0x21acab['query'][_0xd4e4('0x22')]);_0xc59ca7[_0xd4e4('0x1f')]=qs[_0xd4e4('0x1f')](_0x21acab[_0xd4e4('0x36')][_0xd4e4('0x1f')]);}_0xc59ca7[_0xd4e4('0x3d')]=qs[_0xd4e4('0x3e')](_0x21acab[_0xd4e4('0x36')][_0xd4e4('0x3e')]);_0xc59ca7[_0xd4e4('0x3f')]=qs['filters'](_[_0xd4e4('0x40')](_0x21acab[_0xd4e4('0x36')],_0x318f0b[_0xd4e4('0x37')]),_0x54e45d);if(_0x21acab[_0xd4e4('0x36')][_0xd4e4('0x41')]){_0xc59ca7[_0xd4e4('0x3f')]=_[_0xd4e4('0x42')](_0xc59ca7[_0xd4e4('0x3f')],{'$or':_[_0xd4e4('0x30')](_0x54e45d,function(_0x17243a){if(_0x17243a['type']!==_0xd4e4('0x43')){var _0x51bbc5={};_0x51bbc5[_0x17243a[_0xd4e4('0x2d')]]={'$like':'%'+_0x21acab[_0xd4e4('0x36')][_0xd4e4('0x41')]+'%'};return _0x51bbc5;}})});}_0xc59ca7=_[_0xd4e4('0x42')]({},_0xc59ca7,_0x21acab[_0xd4e4('0x44')]);var _0x111728={'where':_0xc59ca7[_0xd4e4('0x3f')]};return db['ZendeskField'][_0xd4e4('0x21')](_0x111728)[_0xd4e4('0x29')](function(_0x33df69){_0x147f9a['count']=_0x33df69;if(_0x21acab[_0xd4e4('0x36')][_0xd4e4('0x45')]){_0xc59ca7[_0xd4e4('0x46')]=[{'all':!![]}];}return db[_0xd4e4('0x47')][_0xd4e4('0x48')](_0xc59ca7);})[_0xd4e4('0x29')](function(_0x473fcf){_0x147f9a['rows']=_0x473fcf;return _0x147f9a;})[_0xd4e4('0x29')](respondWithFilteredResult(_0x1bf9e5,_0xc59ca7))['catch'](handleError(_0x1bf9e5,null));};exports['show']=function(_0x24276e,_0x430813){var _0x3ca37b={'raw':!![],'where':{'id':_0x24276e[_0xd4e4('0x49')]['id']}},_0x25dbf5={};_0x25dbf5[_0xd4e4('0x35')]=_[_0xd4e4('0x4a')](db[_0xd4e4('0x47')]['rawAttributes']);_0x25dbf5['query']=_[_0xd4e4('0x4a')](_0x24276e[_0xd4e4('0x36')]);_0x25dbf5[_0xd4e4('0x37')]=_['intersection'](_0x25dbf5['model'],_0x25dbf5[_0xd4e4('0x36')]);_0x3ca37b[_0xd4e4('0x39')]=_[_0xd4e4('0x38')](_0x25dbf5[_0xd4e4('0x35')],qs[_0xd4e4('0x3a')](_0x24276e[_0xd4e4('0x36')]['fields']));_0x3ca37b[_0xd4e4('0x39')]=_0x3ca37b[_0xd4e4('0x39')][_0xd4e4('0x4b')]?_0x3ca37b[_0xd4e4('0x39')]:_0x25dbf5[_0xd4e4('0x35')];if(_0x24276e[_0xd4e4('0x36')][_0xd4e4('0x45')]){_0x3ca37b[_0xd4e4('0x46')]=[{'all':!![]}];}_0x3ca37b=_['merge']({},_0x3ca37b,_0x24276e['options']);return db['ZendeskField'][_0xd4e4('0x4c')](_0x3ca37b)['then'](handleEntityNotFound(_0x430813,null))[_0xd4e4('0x29')](respondWithResult(_0x430813,null))[_0xd4e4('0x4d')](handleError(_0x430813,null));};exports[_0xd4e4('0x4e')]=function(_0xa0c7b3,_0x48abb0){return db['ZendeskField']['create'](_0xa0c7b3['body'],{})[_0xd4e4('0x29')](respondWithResult(_0x48abb0,0xc9))[_0xd4e4('0x4d')](handleError(_0x48abb0,null));};exports[_0xd4e4('0x28')]=function(_0x26fe76,_0x37440a){if(_0x26fe76[_0xd4e4('0x4f')]['id']){delete _0x26fe76['body']['id'];}return db[_0xd4e4('0x47')][_0xd4e4('0x4c')]({'where':{'id':_0x26fe76[_0xd4e4('0x49')]['id']}})['then'](handleEntityNotFound(_0x37440a,null))[_0xd4e4('0x29')](saveUpdates(_0x26fe76[_0xd4e4('0x4f')],null))[_0xd4e4('0x29')](respondWithResult(_0x37440a,null))[_0xd4e4('0x4d')](handleError(_0x37440a,null));};exports[_0xd4e4('0x2a')]=function(_0x30822e,_0x56eb5f){return db[_0xd4e4('0x47')]['find']({'where':{'id':_0x30822e[_0xd4e4('0x49')]['id']}})[_0xd4e4('0x29')](handleEntityNotFound(_0x56eb5f,null))[_0xd4e4('0x29')](removeEntity(_0x56eb5f,null))[_0xd4e4('0x4d')](handleError(_0x56eb5f,null));}; \ No newline at end of file +var _0xb75c=['sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','ZendeskField','rawAttributes','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','catch','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','fs-extra','lodash','squel','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x549f20,_0x23e210){var _0x56cbe0=function(_0x5a92f5){while(--_0x5a92f5){_0x549f20['push'](_0x549f20['shift']());}};_0x56cbe0(++_0x23e210);}(_0xb75c,0x1ce));var _0xcb75=function(_0x4e3a92,_0x35f2f7){_0x4e3a92=_0x4e3a92-0x0;var _0x24e926=_0xb75c[_0x4e3a92];return _0x24e926;};'use strict';var emlformat=require(_0xcb75('0x0'));var rimraf=require(_0xcb75('0x1'));var zipdir=require(_0xcb75('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcb75('0x3'));var moment=require('moment');var BPromise=require(_0xcb75('0x4'));var Mustache=require(_0xcb75('0x5'));var util=require(_0xcb75('0x6'));var path=require('path');var sox=require(_0xcb75('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcb75('0x8'));var _=require(_0xcb75('0x9'));var squel=require(_0xcb75('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xcb75('0xb'));var querystring=require(_0xcb75('0xc'));var Papa=require(_0xcb75('0xd'));var Redis=require('ioredis');var authService=require(_0xcb75('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xcb75('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb75('0x10'))('api');var utils=require(_0xcb75('0x11'));var config=require(_0xcb75('0x12'));var licenseUtil=require(_0xcb75('0x13'));var db=require(_0xcb75('0x14'))['db'];function respondWithStatusCode(_0x526c03,_0x1e0bba){_0x1e0bba=_0x1e0bba||0xcc;return function(_0x13c953){if(_0x13c953){return _0x526c03[_0xcb75('0x15')](_0x1e0bba);}return _0x526c03[_0xcb75('0x16')](_0x1e0bba)[_0xcb75('0x17')]();};}function respondWithResult(_0x3ae629,_0x23c719){_0x23c719=_0x23c719||0xc8;return function(_0x2c14a1){if(_0x2c14a1){return _0x3ae629['status'](_0x23c719)['json'](_0x2c14a1);}};}function respondWithFilteredResult(_0xa0ce25,_0x1af8c1){return function(_0x589afc){if(_0x589afc){var _0x1b9765=typeof _0x1af8c1[_0xcb75('0x18')]==='undefined'&&typeof _0x1af8c1[_0xcb75('0x19')]===_0xcb75('0x1a');var _0x1a0413=_0x589afc[_0xcb75('0x1b')];var _0x57ad84=_0x1b9765?0x0:_0x1af8c1[_0xcb75('0x18')];var _0x32a66f=_0x1b9765?_0x589afc['count']:_0x1af8c1[_0xcb75('0x18')]+_0x1af8c1[_0xcb75('0x19')];var _0x6be8f0;if(_0x32a66f>=_0x1a0413){_0x32a66f=_0x1a0413;_0x6be8f0=0xc8;}else{_0x6be8f0=0xce;}_0xa0ce25[_0xcb75('0x16')](_0x6be8f0);return _0xa0ce25['set'](_0xcb75('0x1c'),_0x57ad84+'-'+_0x32a66f+'/'+_0x1a0413)[_0xcb75('0x1d')](_0x589afc);}return null;};}function patchUpdates(_0x14bba7){return function(_0x2489e9){try{jsonpatch[_0xcb75('0x1e')](_0x2489e9,_0x14bba7,!![]);}catch(_0x232c57){return BPromise['reject'](_0x232c57);}return _0x2489e9[_0xcb75('0x1f')]();};}function saveUpdates(_0x4ca28b,_0x265cf2){return function(_0x78e743){if(_0x78e743){return _0x78e743['update'](_0x4ca28b)[_0xcb75('0x20')](function(_0x1a7154){return _0x1a7154;});}return null;};}function removeEntity(_0x5b0874,_0x29a56e){return function(_0x338222){if(_0x338222){return _0x338222[_0xcb75('0x21')]()[_0xcb75('0x20')](function(){_0x5b0874[_0xcb75('0x16')](0xcc)[_0xcb75('0x17')]();});}};}function handleEntityNotFound(_0x1f6df6,_0x5a61dd){return function(_0x263d46){if(!_0x263d46){_0x1f6df6[_0xcb75('0x15')](0x194);}return _0x263d46;};}function handleError(_0x501dcf,_0x417342){_0x417342=_0x417342||0x1f4;return function(_0x37928b){logger[_0xcb75('0x22')](_0x37928b[_0xcb75('0x23')]);if(_0x37928b[_0xcb75('0x24')]){delete _0x37928b[_0xcb75('0x24')];}_0x501dcf[_0xcb75('0x16')](_0x417342)[_0xcb75('0x25')](_0x37928b);};}exports[_0xcb75('0x26')]=function(_0x54d718,_0x1bcf39){var _0x41e5fe={},_0x567087={},_0x153370={'count':0x0,'rows':[]};var _0x1b5c0d=_[_0xcb75('0x27')](db[_0xcb75('0x28')][_0xcb75('0x29')],function(_0x4bd240){return{'name':_0x4bd240['fieldName'],'type':_0x4bd240['type']['key']};});_0x567087[_0xcb75('0x2a')]=_['map'](_0x1b5c0d,_0xcb75('0x24'));_0x567087['query']=_[_0xcb75('0x2b')](_0x54d718[_0xcb75('0x2c')]);_0x567087[_0xcb75('0x2d')]=_['intersection'](_0x567087['model'],_0x567087[_0xcb75('0x2c')]);_0x41e5fe[_0xcb75('0x2e')]=_[_0xcb75('0x2f')](_0x567087[_0xcb75('0x2a')],qs[_0xcb75('0x30')](_0x54d718[_0xcb75('0x2c')][_0xcb75('0x30')]));_0x41e5fe[_0xcb75('0x2e')]=_0x41e5fe[_0xcb75('0x2e')][_0xcb75('0x31')]?_0x41e5fe[_0xcb75('0x2e')]:_0x567087[_0xcb75('0x2a')];if(!_0x54d718['query'][_0xcb75('0x32')](_0xcb75('0x33'))){_0x41e5fe['limit']=qs[_0xcb75('0x19')](_0x54d718[_0xcb75('0x2c')][_0xcb75('0x19')]);_0x41e5fe['offset']=qs['offset'](_0x54d718[_0xcb75('0x2c')][_0xcb75('0x18')]);}_0x41e5fe['order']=qs[_0xcb75('0x34')](_0x54d718['query'][_0xcb75('0x34')]);_0x41e5fe[_0xcb75('0x35')]=qs[_0xcb75('0x2d')](_['pick'](_0x54d718[_0xcb75('0x2c')],_0x567087[_0xcb75('0x2d')]),_0x1b5c0d);if(_0x54d718[_0xcb75('0x2c')][_0xcb75('0x36')]){_0x41e5fe[_0xcb75('0x35')]=_[_0xcb75('0x37')](_0x41e5fe[_0xcb75('0x35')],{'$or':_[_0xcb75('0x27')](_0x1b5c0d,function(_0x117bbd){if(_0x117bbd[_0xcb75('0x38')]!==_0xcb75('0x39')){var _0x4b1dbb={};_0x4b1dbb[_0x117bbd['name']]={'$like':'%'+_0x54d718['query'][_0xcb75('0x36')]+'%'};return _0x4b1dbb;}})});}_0x41e5fe=_[_0xcb75('0x37')]({},_0x41e5fe,_0x54d718[_0xcb75('0x3a')]);var _0x409ac9={'where':_0x41e5fe['where']};return db[_0xcb75('0x28')][_0xcb75('0x1b')](_0x409ac9)[_0xcb75('0x20')](function(_0x401a61){_0x153370[_0xcb75('0x1b')]=_0x401a61;if(_0x54d718['query'][_0xcb75('0x3b')]){_0x41e5fe[_0xcb75('0x3c')]=[{'all':!![]}];}return db[_0xcb75('0x28')][_0xcb75('0x3d')](_0x41e5fe);})[_0xcb75('0x20')](function(_0x53db83){_0x153370[_0xcb75('0x3e')]=_0x53db83;return _0x153370;})[_0xcb75('0x20')](respondWithFilteredResult(_0x1bcf39,_0x41e5fe))['catch'](handleError(_0x1bcf39,null));};exports[_0xcb75('0x3f')]=function(_0x53a1d8,_0xba1470){var _0x3be469={'raw':!![],'where':{'id':_0x53a1d8[_0xcb75('0x40')]['id']}},_0x20996a={};_0x20996a[_0xcb75('0x2a')]=_[_0xcb75('0x2b')](db[_0xcb75('0x28')][_0xcb75('0x29')]);_0x20996a[_0xcb75('0x2c')]=_['keys'](_0x53a1d8[_0xcb75('0x2c')]);_0x20996a[_0xcb75('0x2d')]=_[_0xcb75('0x2f')](_0x20996a[_0xcb75('0x2a')],_0x20996a[_0xcb75('0x2c')]);_0x3be469[_0xcb75('0x2e')]=_[_0xcb75('0x2f')](_0x20996a[_0xcb75('0x2a')],qs[_0xcb75('0x30')](_0x53a1d8[_0xcb75('0x2c')][_0xcb75('0x30')]));_0x3be469[_0xcb75('0x2e')]=_0x3be469[_0xcb75('0x2e')][_0xcb75('0x31')]?_0x3be469[_0xcb75('0x2e')]:_0x20996a[_0xcb75('0x2a')];if(_0x53a1d8['query']['includeAll']){_0x3be469[_0xcb75('0x3c')]=[{'all':!![]}];}_0x3be469=_[_0xcb75('0x37')]({},_0x3be469,_0x53a1d8[_0xcb75('0x3a')]);return db[_0xcb75('0x28')]['find'](_0x3be469)[_0xcb75('0x20')](handleEntityNotFound(_0xba1470,null))[_0xcb75('0x20')](respondWithResult(_0xba1470,null))['catch'](handleError(_0xba1470,null));};exports[_0xcb75('0x41')]=function(_0x2bd64b,_0x44273a){return db[_0xcb75('0x28')][_0xcb75('0x41')](_0x2bd64b[_0xcb75('0x42')],{})[_0xcb75('0x20')](respondWithResult(_0x44273a,0xc9))[_0xcb75('0x43')](handleError(_0x44273a,null));};exports['update']=function(_0x1fb0a3,_0x122f3e){if(_0x1fb0a3['body']['id']){delete _0x1fb0a3[_0xcb75('0x42')]['id'];}return db['ZendeskField']['find']({'where':{'id':_0x1fb0a3[_0xcb75('0x40')]['id']}})[_0xcb75('0x20')](handleEntityNotFound(_0x122f3e,null))[_0xcb75('0x20')](saveUpdates(_0x1fb0a3[_0xcb75('0x42')],null))[_0xcb75('0x20')](respondWithResult(_0x122f3e,null))[_0xcb75('0x43')](handleError(_0x122f3e,null));};exports[_0xcb75('0x21')]=function(_0x12fa20,_0x19f174){return db[_0xcb75('0x28')][_0xcb75('0x44')]({'where':{'id':_0x12fa20[_0xcb75('0x40')]['id']}})[_0xcb75('0x20')](handleEntityNotFound(_0x19f174,null))[_0xcb75('0x20')](removeEntity(_0x19f174,null))[_0xcb75('0x43')](handleError(_0x19f174,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 123bcb0..2effa3a 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 _0xf548=['define','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./intZendeskField.attributes'];(function(_0xa2f3a7,_0x2ee243){var _0x10d91f=function(_0x405a00){while(--_0x405a00){_0xa2f3a7['push'](_0xa2f3a7['shift']());}};_0x10d91f(++_0x2ee243);}(_0xf548,0x116));var _0x8f54=function(_0x1fd675,_0x165dfe){_0x1fd675=_0x1fd675-0x0;var _0x16b554=_0xf548[_0x1fd675];return _0x16b554;};'use strict';var _=require(_0x8f54('0x0'));var util=require(_0x8f54('0x1'));var logger=require('../../config/logger')(_0x8f54('0x2'));var moment=require(_0x8f54('0x3'));var BPromise=require(_0x8f54('0x4'));var rp=require(_0x8f54('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8f54('0x6'));var attributes=require(_0x8f54('0x7'));module['exports']=function(_0x195b8c,_0x51bfeb){return _0x195b8c[_0x8f54('0x8')]('ZendeskField',attributes,{'tableName':_0x8f54('0x9'),'paranoid':![],'indexes':[{'name':_0x8f54('0xa'),'fields':[_0x8f54('0xb'),_0x8f54('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4d5e=['define','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZendeskField.attributes','exports'];(function(_0x4db22f,_0x1ceff1){var _0x5aa6d6=function(_0x1e2026){while(--_0x1e2026){_0x4db22f['push'](_0x4db22f['shift']());}};_0x5aa6d6(++_0x1ceff1);}(_0x4d5e,0x17c));var _0xe4d5=function(_0x5549e7,_0x36dc5){_0x5549e7=_0x5549e7-0x0;var _0x449127=_0x4d5e[_0x5549e7];return _0x449127;};'use strict';var _=require(_0xe4d5('0x0'));var util=require('util');var logger=require(_0xe4d5('0x1'))(_0xe4d5('0x2'));var moment=require(_0xe4d5('0x3'));var BPromise=require(_0xe4d5('0x4'));var rp=require(_0xe4d5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe4d5('0x6'));var config=require(_0xe4d5('0x7'));var attributes=require(_0xe4d5('0x8'));module[_0xe4d5('0x9')]=function(_0x4c167c,_0x3a531c){return _0x4c167c[_0xe4d5('0xa')]('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0xe4d5('0xb'),_0xe4d5('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 220f813..8c3c95b 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 _0x8f65=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x4b99f0,_0x419040){var _0x29d886=function(_0x398626){while(--_0x398626){_0x4b99f0['push'](_0x4b99f0['shift']());}};_0x29d886(++_0x419040);}(_0x8f65,0x77));var _0x58f6=function(_0x1cbce7,_0x3e67f5){_0x1cbce7=_0x1cbce7-0x0;var _0x18aaae=_0x8f65[_0x1cbce7];return _0x18aaae;};'use strict';var _=require(_0x58f6('0x0'));var util=require('util');var moment=require(_0x58f6('0x1'));var BPromise=require(_0x58f6('0x2'));var rs=require(_0x58f6('0x3'));var fs=require('fs');var Redis=require(_0x58f6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x58f6('0x5'));var logger=require(_0x58f6('0x6'))(_0x58f6('0x7'));var config=require(_0x58f6('0x8'));var jayson=require(_0x58f6('0x9'));var client=jayson[_0x58f6('0xa')][_0x58f6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c83c1,_0x56a836,_0x4590d7){return new BPromise(function(_0x257c2f,_0x351e4e){return client[_0x58f6('0xc')](_0x3c83c1,_0x4590d7)[_0x58f6('0xd')](function(_0x4fc129){logger[_0x58f6('0xe')](_0x58f6('0xf'),_0x56a836,_0x58f6('0x10'));logger[_0x58f6('0x11')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x56a836,_0x58f6('0x10'),JSON[_0x58f6('0x12')](_0x4fc129));if(_0x4fc129[_0x58f6('0x13')]){if(_0x4fc129[_0x58f6('0x13')]['code']===0x1f4){logger['error'](_0x58f6('0xf'),_0x56a836,_0x4fc129[_0x58f6('0x13')][_0x58f6('0x14')]);return _0x351e4e(_0x4fc129[_0x58f6('0x13')]['message']);}logger[_0x58f6('0x13')](_0x58f6('0xf'),_0x56a836,_0x4fc129[_0x58f6('0x13')]['message']);return _0x257c2f(_0x4fc129[_0x58f6('0x13')][_0x58f6('0x14')]);}else{logger[_0x58f6('0xe')](_0x58f6('0xf'),_0x56a836,_0x58f6('0x10'));_0x257c2f(_0x4fc129[_0x58f6('0x15')][_0x58f6('0x14')]);}})[_0x58f6('0x16')](function(_0x5c98bb){logger[_0x58f6('0x13')](_0x58f6('0xf'),_0x56a836,_0x5c98bb);_0x351e4e(_0x5c98bb);});});} \ No newline at end of file +var _0x491a=['result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x3e2436,_0x3dcac3){var _0x16d72a=function(_0x2a88fe){while(--_0x2a88fe){_0x3e2436['push'](_0x3e2436['shift']());}};_0x16d72a(++_0x3dcac3);}(_0x491a,0x6f));var _0xa491=function(_0x53d0f2,_0x461fff){_0x53d0f2=_0x53d0f2-0x0;var _0x4039fe=_0x491a[_0x53d0f2];return _0x4039fe;};'use strict';var _=require(_0xa491('0x0'));var util=require(_0xa491('0x1'));var moment=require(_0xa491('0x2'));var BPromise=require(_0xa491('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa491('0x4'));var db=require(_0xa491('0x5'))['db'];var utils=require(_0xa491('0x6'));var logger=require(_0xa491('0x7'))(_0xa491('0x8'));var config=require(_0xa491('0x9'));var jayson=require(_0xa491('0xa'));var client=jayson[_0xa491('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfa311,_0x3ea5e4,_0x7857ff){return new BPromise(function(_0x47ffbf,_0x45d954){return client['request'](_0xfa311,_0x7857ff)[_0xa491('0xc')](function(_0x412f19){logger[_0xa491('0xd')](_0xa491('0xe'),_0x3ea5e4,_0xa491('0xf'));logger['debug'](_0xa491('0x10'),_0x3ea5e4,_0xa491('0xf'),JSON[_0xa491('0x11')](_0x412f19));if(_0x412f19[_0xa491('0x12')]){if(_0x412f19[_0xa491('0x12')][_0xa491('0x13')]===0x1f4){logger[_0xa491('0x12')](_0xa491('0xe'),_0x3ea5e4,_0x412f19[_0xa491('0x12')]['message']);return _0x45d954(_0x412f19[_0xa491('0x12')][_0xa491('0x14')]);}logger[_0xa491('0x12')](_0xa491('0xe'),_0x3ea5e4,_0x412f19['error'][_0xa491('0x14')]);return _0x47ffbf(_0x412f19[_0xa491('0x12')][_0xa491('0x14')]);}else{logger[_0xa491('0xd')](_0xa491('0xe'),_0x3ea5e4,_0xa491('0xf'));_0x47ffbf(_0x412f19[_0xa491('0x15')]['message']);}})['catch'](function(_0x2dec2a){logger[_0xa491('0x12')](_0xa491('0xe'),_0x3ea5e4,_0x2dec2a);_0x45d954(_0x2dec2a);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 6de76f2..a5e036c 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 _0x4550=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','getFields','post','create','/:id/configurations','addConfiguration','put','update','delete','util'];(function(_0x22ee0f,_0x22e6d2){var _0x204696=function(_0x4cab38){while(--_0x4cab38){_0x22ee0f['push'](_0x22ee0f['shift']());}};_0x204696(++_0x22e6d2);}(_0x4550,0x92));var _0x0455=function(_0x5a15b1,_0x202388){_0x5a15b1=_0x5a15b1-0x0;var _0x4c2df7=_0x4550[_0x5a15b1];return _0x4c2df7;};'use strict';var multer=require('multer');var util=require(_0x0455('0x0'));var path=require(_0x0455('0x1'));var timeout=require(_0x0455('0x2'));var express=require('express');var router=express[_0x0455('0x3')]();var fs_extra=require(_0x0455('0x4'));var auth=require(_0x0455('0x5'));var interaction=require(_0x0455('0x6'));var config=require(_0x0455('0x7'));var controller=require('./intZohoAccount.controller');router[_0x0455('0x8')]('/',auth['isAuthenticated'](),controller[_0x0455('0x9')]);router[_0x0455('0x8')](_0x0455('0xa'),auth[_0x0455('0xb')](),controller[_0x0455('0xc')]);router[_0x0455('0x8')]('/:id/configurations',auth[_0x0455('0xb')](),controller['getConfigurations']);router[_0x0455('0x8')]('/:id/fields',auth[_0x0455('0xb')](),controller[_0x0455('0xd')]);router[_0x0455('0xe')]('/',auth[_0x0455('0xb')](),controller[_0x0455('0xf')]);router[_0x0455('0xe')](_0x0455('0x10'),auth['isAuthenticated'](),controller[_0x0455('0x11')]);router[_0x0455('0x12')](_0x0455('0xa'),auth['isAuthenticated'](),controller[_0x0455('0x13')]);router[_0x0455('0x14')]('/:id',auth[_0x0455('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xef29=['destroy','exports','multer','path','connect-timeout','../../config/environment','isAuthenticated','index','get','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','/:id','delete'];(function(_0x19c7a8,_0x10508d){var _0x1462ce=function(_0x33f2c8){while(--_0x33f2c8){_0x19c7a8['push'](_0x19c7a8['shift']());}};_0x1462ce(++_0x10508d);}(_0xef29,0xd3));var _0x9ef2=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xef29[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x9ef2('0x0'));var util=require('util');var path=require(_0x9ef2('0x1'));var timeout=require(_0x9ef2('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9ef2('0x3'));var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0x9ef2('0x4')](),controller[_0x9ef2('0x5')]);router[_0x9ef2('0x6')]('/:id',auth[_0x9ef2('0x4')](),controller[_0x9ef2('0x7')]);router['get'](_0x9ef2('0x8'),auth[_0x9ef2('0x4')](),controller[_0x9ef2('0x9')]);router[_0x9ef2('0x6')]('/:id/fields',auth[_0x9ef2('0x4')](),controller[_0x9ef2('0xa')]);router[_0x9ef2('0xb')]('/',auth[_0x9ef2('0x4')](),controller[_0x9ef2('0xc')]);router[_0x9ef2('0xb')](_0x9ef2('0x8'),auth[_0x9ef2('0x4')](),controller[_0x9ef2('0xd')]);router[_0x9ef2('0xe')](_0x9ef2('0xf'),auth[_0x9ef2('0x4')](),controller['update']);router[_0x9ef2('0x10')](_0x9ef2('0xf'),auth[_0x9ef2('0x4')](),controller[_0x9ef2('0x11')]);module[_0x9ef2('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index d9b3b5e..c020280 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 _0xd64b=['STRING','sequelize'];(function(_0x354fa4,_0x30e267){var _0x1aa414=function(_0xb38eaa){while(--_0xb38eaa){_0x354fa4['push'](_0x354fa4['shift']());}};_0x1aa414(++_0x30e267);}(_0xd64b,0xc1));var _0xbd64=function(_0x323021,_0x30f030){_0x323021=_0x323021-0x0;var _0x52cb3e=_0xd64b[_0x323021];return _0x52cb3e;};'use strict';var Sequelize=require(_0xbd64('0x0'));module['exports']={'name':{'type':Sequelize[_0xbd64('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xbd64('0x1')]},'zone':{'type':Sequelize[_0xbd64('0x1')]},'clientId':{'type':Sequelize[_0xbd64('0x1')]},'clientSecret':{'type':Sequelize[_0xbd64('0x1')]},'serverUrl':{'type':Sequelize[_0xbd64('0x1')],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xbec5=['STRING','sequelize','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbec5,0xe5));var _0x5bec=function(_0x485f35,_0x45a0fc){_0x485f35=_0x485f35-0x0;var _0x2ad118=_0xbec5[_0x485f35];return _0x2ad118;};'use strict';var Sequelize=require(_0x5bec('0x0'));module[_0x5bec('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5bec('0x2')]},'host':{'type':Sequelize[_0x5bec('0x2')]},'zone':{'type':Sequelize[_0x5bec('0x2')]},'clientId':{'type':Sequelize[_0x5bec('0x2')]},'clientSecret':{'type':Sequelize[_0x5bec('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize[_0x5bec('0x2')]},'refreshToken':{'type':Sequelize[_0x5bec('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 68d0c93..c16cc30 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 _0xf2e4=['Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','error','send','map','ZohoAccount','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','type','name','merge','rows','catch','show','keys','includeAll','options','find','create','body','params','findOne','ZohoConfiguration','getConfigurations','nolimit','addConfiguration','AccountId','Subjects','channel','getDescriptions','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','refreshToken','zoho.eu','com','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Calls','Zoho-oauthtoken\x20','response','message','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Type','remove','includes','api_name','system_mandatory','display_label','data_type','pick_list_values','stringify','test'];(function(_0x4ee2de,_0x4374d5){var _0x4148f5=function(_0x60b9ba){while(--_0x60b9ba){_0x4ee2de['push'](_0x4ee2de['shift']());}};_0x4148f5(++_0x4374d5);}(_0xf2e4,0x10c));var _0x4f2e=function(_0x4d2eb7,_0x45e672){_0x4d2eb7=_0x4d2eb7-0x0;var _0x56b032=_0xf2e4[_0x4d2eb7];return _0x56b032;};'use strict';var emlformat=require(_0x4f2e('0x0'));var rimraf=require(_0x4f2e('0x1'));var zipdir=require(_0x4f2e('0x2'));var jsonpatch=require(_0x4f2e('0x3'));var rp=require(_0x4f2e('0x4'));var moment=require(_0x4f2e('0x5'));var BPromise=require(_0x4f2e('0x6'));var Mustache=require(_0x4f2e('0x7'));var util=require(_0x4f2e('0x8'));var path=require(_0x4f2e('0x9'));var sox=require('sox');var csv=require(_0x4f2e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4f2e('0xb'));var _=require('lodash');var squel=require(_0x4f2e('0xc'));var crypto=require('crypto');var jsforce=require(_0x4f2e('0xd'));var deskjs=require(_0x4f2e('0xe'));var toCsv=require(_0x4f2e('0xa'));var querystring=require(_0x4f2e('0xf'));var Papa=require(_0x4f2e('0x10'));var Redis=require('ioredis');var authService=require(_0x4f2e('0x11'));var qs=require(_0x4f2e('0x12'));var as=require(_0x4f2e('0x13'));var hardwareService=require(_0x4f2e('0x14'));var logger=require(_0x4f2e('0x15'))(_0x4f2e('0x16'));var utils=require(_0x4f2e('0x17'));var config=require(_0x4f2e('0x18'));var licenseUtil=require(_0x4f2e('0x19'));var db=require(_0x4f2e('0x1a'))['db'];var integrations=require(_0x4f2e('0x1b'));function respondWithStatusCode(_0x279b9d,_0x32388a){_0x32388a=_0x32388a||0xcc;return function(_0x64f1e1){if(_0x64f1e1){return _0x279b9d[_0x4f2e('0x1c')](_0x32388a);}return _0x279b9d[_0x4f2e('0x1d')](_0x32388a)[_0x4f2e('0x1e')]();};}function respondWithResult(_0x2ff6e1,_0x511452){_0x511452=_0x511452||0xc8;return function(_0x37b172){if(_0x37b172){return _0x2ff6e1[_0x4f2e('0x1d')](_0x511452)[_0x4f2e('0x1f')](_0x37b172);}};}function respondWithFilteredResult(_0x217c8a,_0x2c3e95){return function(_0x3d9976){if(_0x3d9976){var _0x424078=typeof _0x2c3e95[_0x4f2e('0x20')]===_0x4f2e('0x21')&&typeof _0x2c3e95[_0x4f2e('0x22')]===_0x4f2e('0x21');var _0x5d24ac=_0x3d9976[_0x4f2e('0x23')];var _0x15f1ba=_0x424078?0x0:_0x2c3e95[_0x4f2e('0x20')];var _0x39708f=_0x424078?_0x3d9976['count']:_0x2c3e95[_0x4f2e('0x20')]+_0x2c3e95[_0x4f2e('0x22')];var _0xd2bc0;if(_0x39708f>=_0x5d24ac){_0x39708f=_0x5d24ac;_0xd2bc0=0xc8;}else{_0xd2bc0=0xce;}_0x217c8a[_0x4f2e('0x1d')](_0xd2bc0);return _0x217c8a[_0x4f2e('0x24')](_0x4f2e('0x25'),_0x15f1ba+'-'+_0x39708f+'/'+_0x5d24ac)['json'](_0x3d9976);}return null;};}function patchUpdates(_0x5c1b77){return function(_0x5301c7){try{jsonpatch[_0x4f2e('0x26')](_0x5301c7,_0x5c1b77,!![]);}catch(_0x823b04){return BPromise['reject'](_0x823b04);}return _0x5301c7[_0x4f2e('0x27')]();};}function saveUpdates(_0x175afb,_0x55ade4){return function(_0x40b701){if(_0x40b701){return _0x40b701[_0x4f2e('0x28')](_0x175afb)['then'](function(_0x40d868){return _0x40d868;});}return null;};}function removeEntity(_0x21f6f2,_0x3107ca){return function(_0x48d5f7){if(_0x48d5f7){return _0x48d5f7[_0x4f2e('0x29')]()[_0x4f2e('0x2a')](function(){_0x21f6f2[_0x4f2e('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9a726f,_0x50bd38){return function(_0x10e05e){if(!_0x10e05e){_0x9a726f[_0x4f2e('0x1c')](0x194);}return _0x10e05e;};}function handleError(_0x1bbc05,_0x28a41a){_0x28a41a=_0x28a41a||0x1f4;return function(_0x30de6f){logger[_0x4f2e('0x2b')](_0x30de6f['stack']);if(_0x30de6f['name']){delete _0x30de6f['name'];}_0x1bbc05[_0x4f2e('0x1d')](_0x28a41a)[_0x4f2e('0x2c')](_0x30de6f);};}exports['index']=function(_0x6a358b,_0x481621){var _0x53866d={},_0x38eb15={},_0x48cfb7={'count':0x0,'rows':[]};var _0x1593e6=_[_0x4f2e('0x2d')](db[_0x4f2e('0x2e')][_0x4f2e('0x2f')],function(_0x1902dd){return{'name':_0x1902dd['fieldName'],'type':_0x1902dd['type'][_0x4f2e('0x30')]};});_0x38eb15[_0x4f2e('0x31')]=_[_0x4f2e('0x2d')](_0x1593e6,'name');_0x38eb15['query']=_['keys'](_0x6a358b[_0x4f2e('0x32')]);_0x38eb15[_0x4f2e('0x33')]=_[_0x4f2e('0x34')](_0x38eb15[_0x4f2e('0x31')],_0x38eb15['query']);_0x53866d[_0x4f2e('0x35')]=_['intersection'](_0x38eb15[_0x4f2e('0x31')],qs[_0x4f2e('0x36')](_0x6a358b['query']['fields']));_0x53866d[_0x4f2e('0x35')]=_0x53866d[_0x4f2e('0x35')][_0x4f2e('0x37')]?_0x53866d['attributes']:_0x38eb15[_0x4f2e('0x31')];if(!_0x6a358b['query'][_0x4f2e('0x38')]('nolimit')){_0x53866d['limit']=qs[_0x4f2e('0x22')](_0x6a358b['query'][_0x4f2e('0x22')]);_0x53866d[_0x4f2e('0x20')]=qs[_0x4f2e('0x20')](_0x6a358b[_0x4f2e('0x32')][_0x4f2e('0x20')]);}_0x53866d[_0x4f2e('0x39')]=qs[_0x4f2e('0x3a')](_0x6a358b['query'][_0x4f2e('0x3a')]);_0x53866d[_0x4f2e('0x3b')]=qs[_0x4f2e('0x33')](_[_0x4f2e('0x3c')](_0x6a358b[_0x4f2e('0x32')],_0x38eb15['filters']),_0x1593e6);if(_0x6a358b[_0x4f2e('0x32')][_0x4f2e('0x3d')]){_0x53866d[_0x4f2e('0x3b')]=_['merge'](_0x53866d['where'],{'$or':_['map'](_0x1593e6,function(_0x159103){if(_0x159103[_0x4f2e('0x3e')]!=='VIRTUAL'){var _0x40aeff={};_0x40aeff[_0x159103[_0x4f2e('0x3f')]]={'$like':'%'+_0x6a358b[_0x4f2e('0x32')]['filter']+'%'};return _0x40aeff;}})});}_0x53866d=_[_0x4f2e('0x40')]({},_0x53866d,_0x6a358b['options']);var _0x1b88e9={'where':_0x53866d[_0x4f2e('0x3b')]};return db['ZohoAccount'][_0x4f2e('0x23')](_0x1b88e9)['then'](function(_0x362259){_0x48cfb7[_0x4f2e('0x23')]=_0x362259;if(_0x6a358b[_0x4f2e('0x32')]['includeAll']){_0x53866d['include']=[{'all':!![]}];}return db[_0x4f2e('0x2e')]['findAll'](_0x53866d);})[_0x4f2e('0x2a')](function(_0x2aa9c7){_0x48cfb7[_0x4f2e('0x41')]=_0x2aa9c7;return _0x48cfb7;})['then'](respondWithFilteredResult(_0x481621,_0x53866d))[_0x4f2e('0x42')](handleError(_0x481621,null));};exports[_0x4f2e('0x43')]=function(_0x515e43,_0x1a0dca){var _0x2ce446={'raw':![],'where':{'id':_0x515e43['params']['id']}},_0x1836a9={};_0x1836a9['model']=_[_0x4f2e('0x44')](db[_0x4f2e('0x2e')][_0x4f2e('0x2f')]);_0x1836a9[_0x4f2e('0x32')]=_[_0x4f2e('0x44')](_0x515e43[_0x4f2e('0x32')]);_0x1836a9[_0x4f2e('0x33')]=_[_0x4f2e('0x34')](_0x1836a9[_0x4f2e('0x31')],_0x1836a9[_0x4f2e('0x32')]);_0x2ce446[_0x4f2e('0x35')]=_[_0x4f2e('0x34')](_0x1836a9['model'],qs[_0x4f2e('0x36')](_0x515e43[_0x4f2e('0x32')][_0x4f2e('0x36')]));_0x2ce446['attributes']=_0x2ce446[_0x4f2e('0x35')]['length']?_0x2ce446[_0x4f2e('0x35')]:_0x1836a9[_0x4f2e('0x31')];if(_0x515e43['query'][_0x4f2e('0x45')]){_0x2ce446['include']=[{'all':!![]}];}_0x2ce446=_[_0x4f2e('0x40')]({},_0x2ce446,_0x515e43[_0x4f2e('0x46')]);return db['ZohoAccount'][_0x4f2e('0x47')](_0x2ce446)['then'](handleEntityNotFound(_0x1a0dca,null))['then'](respondWithResult(_0x1a0dca,null))[_0x4f2e('0x42')](handleError(_0x1a0dca,null));};exports['create']=function(_0x3656b3,_0x904f88){return db['ZohoAccount'][_0x4f2e('0x48')](_0x3656b3[_0x4f2e('0x49')],{})[_0x4f2e('0x2a')](respondWithResult(_0x904f88,0xc9))[_0x4f2e('0x42')](handleError(_0x904f88,null));};exports[_0x4f2e('0x28')]=function(_0x3c610d,_0x96caed){if(_0x3c610d[_0x4f2e('0x49')]['id']){delete _0x3c610d[_0x4f2e('0x49')]['id'];}return db[_0x4f2e('0x2e')]['find']({'where':{'id':_0x3c610d[_0x4f2e('0x4a')]['id']}})[_0x4f2e('0x2a')](handleEntityNotFound(_0x96caed,null))['then'](saveUpdates(_0x3c610d[_0x4f2e('0x49')],null))['then'](respondWithResult(_0x96caed,null))[_0x4f2e('0x42')](handleError(_0x96caed,null));};exports[_0x4f2e('0x29')]=function(_0x33b8c5,_0x2954ef){return db['ZohoAccount'][_0x4f2e('0x47')]({'where':{'id':_0x33b8c5[_0x4f2e('0x4a')]['id']}})[_0x4f2e('0x2a')](handleEntityNotFound(_0x2954ef,null))[_0x4f2e('0x2a')](removeEntity(_0x2954ef,null))['catch'](handleError(_0x2954ef,null));};exports['getConfigurations']=function(_0x43e84e,_0x31a269,_0x229151){var _0x15aece={};var _0x1281be={};var _0x2e1c0f;var _0x3b3b5e;return db[_0x4f2e('0x2e')][_0x4f2e('0x4b')]({'where':{'id':_0x43e84e['params']['id']}})[_0x4f2e('0x2a')](handleEntityNotFound(_0x31a269,null))['then'](function(_0x3b51f7){if(_0x3b51f7){_0x2e1c0f=_0x3b51f7;_0x1281be['model']=_['keys'](db[_0x4f2e('0x4c')][_0x4f2e('0x2f')]);_0x1281be[_0x4f2e('0x32')]=_[_0x4f2e('0x44')](_0x43e84e[_0x4f2e('0x32')]);_0x1281be['filters']=_['intersection'](_0x1281be['model'],_0x1281be[_0x4f2e('0x32')]);_0x15aece[_0x4f2e('0x35')]=_[_0x4f2e('0x34')](_0x1281be[_0x4f2e('0x31')],qs[_0x4f2e('0x36')](_0x43e84e[_0x4f2e('0x32')]['fields']));_0x15aece[_0x4f2e('0x35')]=_0x15aece[_0x4f2e('0x35')][_0x4f2e('0x37')]?_0x15aece[_0x4f2e('0x35')]:_0x1281be[_0x4f2e('0x31')];_0x15aece[_0x4f2e('0x39')]=qs[_0x4f2e('0x3a')](_0x43e84e[_0x4f2e('0x32')][_0x4f2e('0x3a')]);_0x15aece[_0x4f2e('0x3b')]=qs[_0x4f2e('0x33')](_[_0x4f2e('0x3c')](_0x43e84e[_0x4f2e('0x32')],_0x1281be[_0x4f2e('0x33')]));if(_0x43e84e['query'][_0x4f2e('0x3d')]){_0x15aece['where']=_['merge'](_0x15aece[_0x4f2e('0x3b')],{'$or':_[_0x4f2e('0x2d')](_0x15aece[_0x4f2e('0x35')],function(_0x165892){var _0x2fb643={};_0x2fb643[_0x165892]={'$like':'%'+_0x43e84e[_0x4f2e('0x32')]['filter']+'%'};return _0x2fb643;})});}_0x15aece=_[_0x4f2e('0x40')]({},_0x15aece,_0x43e84e['options']);return _0x2e1c0f[_0x4f2e('0x4d')](_0x15aece);}})[_0x4f2e('0x2a')](function(_0x423e2d){if(_0x423e2d){_0x3b3b5e=_0x423e2d['length'];if(!_0x43e84e[_0x4f2e('0x32')]['hasOwnProperty'](_0x4f2e('0x4e'))){_0x15aece[_0x4f2e('0x22')]=qs['limit'](_0x43e84e[_0x4f2e('0x32')][_0x4f2e('0x22')]);_0x15aece['offset']=qs['offset'](_0x43e84e[_0x4f2e('0x32')]['offset']);}return _0x2e1c0f[_0x4f2e('0x4d')](_0x15aece);}})[_0x4f2e('0x2a')](function(_0x280195){if(_0x280195){return _0x280195?{'count':_0x3b3b5e,'rows':_0x280195}:null;}})[_0x4f2e('0x2a')](respondWithResult(_0x31a269,null))['catch'](handleError(_0x31a269,null));};exports[_0x4f2e('0x4f')]=function(_0x4c7017,_0x3fac2b,_0x2c6bbb){if(_0x4c7017[_0x4f2e('0x49')]['id']){delete _0x4c7017[_0x4f2e('0x49')]['id'];}return db[_0x4f2e('0x2e')]['findOne']({'where':{'id':_0x4c7017['params']['id']}})[_0x4f2e('0x2a')](handleEntityNotFound(_0x3fac2b,null))[_0x4f2e('0x2a')](function(_0x18a82c){if(_0x18a82c){_0x4c7017['body'][_0x4f2e('0x50')]=_0x18a82c['id'];_0x4c7017[_0x4f2e('0x49')][_0x4f2e('0x51')]=integrations['getSubjects'](_0x4c7017[_0x4f2e('0x49')][_0x4f2e('0x52')],_0x4c7017['body'][_0x4f2e('0x3e')]);_0x4c7017['body']['Descriptions']=integrations[_0x4f2e('0x53')](_0x4c7017[_0x4f2e('0x49')][_0x4f2e('0x52')],_0x4c7017['body'][_0x4f2e('0x3e')]);return db[_0x4f2e('0x4c')][_0x4f2e('0x48')](_0x4c7017[_0x4f2e('0x49')],{'include':[{'model':db['ZohoField'],'as':_0x4f2e('0x51')},{'model':db[_0x4f2e('0x54')],'as':_0x4f2e('0x55')}]});}return null;})[_0x4f2e('0x2a')](respondWithResult(_0x3fac2b,null))['catch'](handleError(_0x3fac2b,null));};function getAccessToken(_0x3c510f){return new Promise(function(_0x37c043,_0x59adc7){var _0x29012c;switch(_0x3c510f[_0x4f2e('0x56')]){case'US':_0x29012c=_0x4f2e('0x57');break;case'AU':_0x29012c=_0x4f2e('0x58');break;case'EU':_0x29012c=_0x4f2e('0x59');break;case'IN':_0x29012c=_0x4f2e('0x5a');break;case'CN':_0x29012c=_0x4f2e('0x5b');break;default:_0x29012c=_0x4f2e('0x59');break;}var _0x1e079b={'method':_0x4f2e('0x5c'),'uri':_0x29012c+_0x4f2e('0x5d'),'qs':{'refresh_token':_0x3c510f['refreshToken'],'client_id':_0x3c510f[_0x4f2e('0x5e')],'client_secret':_0x3c510f[_0x4f2e('0x5f')],'grant_type':_0x4f2e('0x60')},'json':!![]};return rp(_0x1e079b)[_0x4f2e('0x2a')](function(_0x376140){if(_0x376140[_0x4f2e('0x61')]){_0x37c043(_0x376140[_0x4f2e('0x61')]);}else{_0x59adc7(_0x4f2e('0x62'));}})[_0x4f2e('0x42')](function(_0x4b32e6){_0x59adc7(_0x4b32e6);});});}exports[_0x4f2e('0x63')]=function(_0x578289,_0x38fd20,_0x57dd05){var _0x3acf53,_0x4fab21,_0x3a15a1,_0x5963b8,_0x3f3a81;return db[_0x4f2e('0x2e')][_0x4f2e('0x4b')]({'where':{'id':_0x578289[_0x4f2e('0x4a')]['id']},'attributes':['id',_0x4f2e('0x64'),'zone',_0x4f2e('0x5e'),_0x4f2e('0x5f'),_0x4f2e('0x65'),_0x4f2e('0x66'),_0x4f2e('0x67')]})[_0x4f2e('0x2a')](handleEntityNotFound(_0x38fd20,null))[_0x4f2e('0x2a')](function(_0x33b5ae){_0x3f3a81=_0x33b5ae;_0x3acf53=_0x3f3a81['host'];_0x4fab21=_0x3acf53===_0x4f2e('0x68')?'eu':_0x4f2e('0x69');_0x3a15a1=_0x3f3a81[_0x4f2e('0x65')];var _0x240889=_0x3a15a1['slice'](-0x1);if(_0x240889==='/'||_0x240889==='\x5c'||_0x240889===':'){_0x3a15a1=_0x3a15a1[_0x4f2e('0x6a')](0x0,_0x3a15a1[_0x4f2e('0x6b')](_0x240889));}if(!_0x3f3a81[_0x4f2e('0x67')]){throw new Error(_0x4f2e('0x6c'));}return getAccessToken(_0x3f3a81);})[_0x4f2e('0x2a')](function(_0x34d9f2){if(_0x34d9f2){return rp({'method':_0x4f2e('0x6d'),'uri':util[_0x4f2e('0x6e')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x4fab21),'qs':{'module':_0x4f2e('0x6f')},'headers':{'Authorization':_0x4f2e('0x70')+_0x34d9f2},'json':!![]});}})['then'](function(_0x505c4a){if(_0x505c4a){if(_0x505c4a[_0x4f2e('0x71')]&&_0x505c4a[_0x4f2e('0x71')][_0x4f2e('0x2b')]){throw new Error(_0x505c4a['response']['error'][_0x4f2e('0x72')]);}var _0x23efcc=[];var _0x3b5ff5=[];var _0x28895f=[_0x4f2e('0x73'),_0x4f2e('0x74'),_0x4f2e('0x75'),_0x4f2e('0x76'),_0x4f2e('0x77'),_0x4f2e('0x78'),'Call_Start_Time',_0x4f2e('0x79')];_0x3b5ff5=_[_0x4f2e('0x7a')](_0x505c4a[_0x4f2e('0x36')],function(_0x547954){return _0x28895f[_0x4f2e('0x7b')](_0x547954[_0x4f2e('0x7c')]);});for(var _0x51e61a=0x0;_0x51e61a<_0x3b5ff5[_0x4f2e('0x37')];_0x51e61a++){if(_0x3b5ff5[_0x51e61a][_0x4f2e('0x7d')]===![]){_0x23efcc['push']({'id':_0x3b5ff5[_0x51e61a]['id'],'name':_0x3b5ff5[_0x51e61a][_0x4f2e('0x7e')],'custom':_0x3b5ff5[_0x51e61a]['custom_field'],'options':_0x3b5ff5[_0x51e61a][_0x4f2e('0x7f')]==='picklist'&&_0x3b5ff5[_0x51e61a][_0x4f2e('0x80')][_0x4f2e('0x37')]>-0x1?_['map'](_0x3b5ff5[_0x51e61a]['pick_list_values'],function(_0x33cb83){return{'name':_0x33cb83,'value':_0x33cb83};}):[]});}}return{'count':_0x23efcc[_0x4f2e('0x37')],'rows':_0x23efcc};}else{return{'count':0x0,'rows':[]};}})[_0x4f2e('0x2a')](respondWithResult(_0x38fd20,null))['catch'](function(_0x3b4828){var _0x7b3ca7=_0x578289[_0x4f2e('0x32')]['test']?0x1f4:_0x3b4828['statusCode']||0x1f4;logger[_0x4f2e('0x2b')]('getFields,\x20%s,\x20%s,\x20%s',_0x4f2e('0x63'),_0x7b3ca7,JSON[_0x4f2e('0x81')](_0x3b4828));delete _0x3b4828[_0x4f2e('0x3f')];if(_0x7b3ca7===0x191){_0x7b3ca7=0x190;}_0x38fd20[_0x4f2e('0x1d')](_0x7b3ca7)[_0x4f2e('0x2c')](_0x578289[_0x4f2e('0x32')][_0x4f2e('0x82')]?{'message':_0x4f2e('0x83'),'statusCode':_0x3b4828[_0x4f2e('0x84')]}:_0x3b4828);});}; \ No newline at end of file +var _0x9145=['name','send','index','map','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','filters','pick','filter','merge','VIRTUAL','options','ZohoAccount','includeAll','findAll','rows','show','params','include','find','catch','create','body','update','destroy','getConfigurations','findOne','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refresh_token','access_token','getFields','zone','clientSecret','serverUrl','code','host','zoho.eu','com','slice','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Zoho-oauthtoken\x20','response','Owner','Subject','Description','Call_Duration','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory','push','custom_field','data_type','picklist','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','then','error','stack'];(function(_0x47d5dc,_0x89f6a9){var _0x1fa10a=function(_0x2e7729){while(--_0x2e7729){_0x47d5dc['push'](_0x47d5dc['shift']());}};_0x1fa10a(++_0x89f6a9);}(_0x9145,0x158));var _0x5914=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9145[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x5914('0x0'));var rimraf=require(_0x5914('0x1'));var zipdir=require(_0x5914('0x2'));var jsonpatch=require(_0x5914('0x3'));var rp=require(_0x5914('0x4'));var moment=require(_0x5914('0x5'));var BPromise=require(_0x5914('0x6'));var Mustache=require(_0x5914('0x7'));var util=require(_0x5914('0x8'));var path=require('path');var sox=require(_0x5914('0x9'));var csv=require(_0x5914('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5914('0xb'));var _=require('lodash');var squel=require(_0x5914('0xc'));var crypto=require(_0x5914('0xd'));var jsforce=require(_0x5914('0xe'));var deskjs=require(_0x5914('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5914('0x10'));var Papa=require(_0x5914('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5914('0x12'));var hardwareService=require(_0x5914('0x13'));var logger=require(_0x5914('0x14'))('api');var utils=require(_0x5914('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x5914('0x16'));var db=require(_0x5914('0x17'))['db'];var integrations=require(_0x5914('0x18'));function respondWithStatusCode(_0x441ecc,_0x55ea05){_0x55ea05=_0x55ea05||0xcc;return function(_0x4f95d){if(_0x4f95d){return _0x441ecc[_0x5914('0x19')](_0x55ea05);}return _0x441ecc[_0x5914('0x1a')](_0x55ea05)[_0x5914('0x1b')]();};}function respondWithResult(_0x4a9116,_0x327393){_0x327393=_0x327393||0xc8;return function(_0x458952){if(_0x458952){return _0x4a9116[_0x5914('0x1a')](_0x327393)[_0x5914('0x1c')](_0x458952);}};}function respondWithFilteredResult(_0x12f715,_0x52c3a7){return function(_0x163f3b){if(_0x163f3b){var _0x4c0df6=typeof _0x52c3a7[_0x5914('0x1d')]===_0x5914('0x1e')&&typeof _0x52c3a7['limit']===_0x5914('0x1e');var _0x49df2f=_0x163f3b[_0x5914('0x1f')];var _0x16a628=_0x4c0df6?0x0:_0x52c3a7[_0x5914('0x1d')];var _0x2aeb31=_0x4c0df6?_0x163f3b[_0x5914('0x1f')]:_0x52c3a7['offset']+_0x52c3a7['limit'];var _0x5df32e;if(_0x2aeb31>=_0x49df2f){_0x2aeb31=_0x49df2f;_0x5df32e=0xc8;}else{_0x5df32e=0xce;}_0x12f715[_0x5914('0x1a')](_0x5df32e);return _0x12f715[_0x5914('0x20')](_0x5914('0x21'),_0x16a628+'-'+_0x2aeb31+'/'+_0x49df2f)[_0x5914('0x1c')](_0x163f3b);}return null;};}function patchUpdates(_0x4e3c3f){return function(_0x3a03d0){try{jsonpatch[_0x5914('0x22')](_0x3a03d0,_0x4e3c3f,!![]);}catch(_0x1a43a4){return BPromise[_0x5914('0x23')](_0x1a43a4);}return _0x3a03d0[_0x5914('0x24')]();};}function saveUpdates(_0x4c572d,_0x4043fe){return function(_0xc35583){if(_0xc35583){return _0xc35583['update'](_0x4c572d)['then'](function(_0x26efff){return _0x26efff;});}return null;};}function removeEntity(_0x5dac8f,_0x50eb81){return function(_0xecba9e){if(_0xecba9e){return _0xecba9e['destroy']()[_0x5914('0x25')](function(){_0x5dac8f[_0x5914('0x1a')](0xcc)[_0x5914('0x1b')]();});}};}function handleEntityNotFound(_0x567bb8,_0x479615){return function(_0x140179){if(!_0x140179){_0x567bb8[_0x5914('0x19')](0x194);}return _0x140179;};}function handleError(_0x302e8c,_0x589707){_0x589707=_0x589707||0x1f4;return function(_0x89581d){logger[_0x5914('0x26')](_0x89581d[_0x5914('0x27')]);if(_0x89581d[_0x5914('0x28')]){delete _0x89581d[_0x5914('0x28')];}_0x302e8c[_0x5914('0x1a')](_0x589707)[_0x5914('0x29')](_0x89581d);};}exports[_0x5914('0x2a')]=function(_0x243ac0,_0x312669){var _0x5c72a0={},_0x58973e={},_0x488a0b={'count':0x0,'rows':[]};var _0x4b77bf=_[_0x5914('0x2b')](db['ZohoAccount'][_0x5914('0x2c')],function(_0x60d573){return{'name':_0x60d573['fieldName'],'type':_0x60d573[_0x5914('0x2d')]['key']};});_0x58973e[_0x5914('0x2e')]=_[_0x5914('0x2b')](_0x4b77bf,_0x5914('0x28'));_0x58973e[_0x5914('0x2f')]=_[_0x5914('0x30')](_0x243ac0['query']);_0x58973e['filters']=_[_0x5914('0x31')](_0x58973e[_0x5914('0x2e')],_0x58973e[_0x5914('0x2f')]);_0x5c72a0[_0x5914('0x32')]=_[_0x5914('0x31')](_0x58973e[_0x5914('0x2e')],qs[_0x5914('0x33')](_0x243ac0[_0x5914('0x2f')][_0x5914('0x33')]));_0x5c72a0[_0x5914('0x32')]=_0x5c72a0['attributes'][_0x5914('0x34')]?_0x5c72a0[_0x5914('0x32')]:_0x58973e[_0x5914('0x2e')];if(!_0x243ac0[_0x5914('0x2f')][_0x5914('0x35')]('nolimit')){_0x5c72a0[_0x5914('0x36')]=qs[_0x5914('0x36')](_0x243ac0[_0x5914('0x2f')][_0x5914('0x36')]);_0x5c72a0[_0x5914('0x1d')]=qs['offset'](_0x243ac0['query'][_0x5914('0x1d')]);}_0x5c72a0['order']=qs[_0x5914('0x37')](_0x243ac0['query'][_0x5914('0x37')]);_0x5c72a0[_0x5914('0x38')]=qs[_0x5914('0x39')](_[_0x5914('0x3a')](_0x243ac0[_0x5914('0x2f')],_0x58973e[_0x5914('0x39')]),_0x4b77bf);if(_0x243ac0[_0x5914('0x2f')][_0x5914('0x3b')]){_0x5c72a0[_0x5914('0x38')]=_[_0x5914('0x3c')](_0x5c72a0[_0x5914('0x38')],{'$or':_['map'](_0x4b77bf,function(_0x52ba0e){if(_0x52ba0e['type']!==_0x5914('0x3d')){var _0x49101b={};_0x49101b[_0x52ba0e[_0x5914('0x28')]]={'$like':'%'+_0x243ac0[_0x5914('0x2f')][_0x5914('0x3b')]+'%'};return _0x49101b;}})});}_0x5c72a0=_[_0x5914('0x3c')]({},_0x5c72a0,_0x243ac0[_0x5914('0x3e')]);var _0x1ceafb={'where':_0x5c72a0[_0x5914('0x38')]};return db[_0x5914('0x3f')]['count'](_0x1ceafb)[_0x5914('0x25')](function(_0x112d7c){_0x488a0b[_0x5914('0x1f')]=_0x112d7c;if(_0x243ac0[_0x5914('0x2f')][_0x5914('0x40')]){_0x5c72a0['include']=[{'all':!![]}];}return db[_0x5914('0x3f')][_0x5914('0x41')](_0x5c72a0);})[_0x5914('0x25')](function(_0xb1eabf){_0x488a0b[_0x5914('0x42')]=_0xb1eabf;return _0x488a0b;})[_0x5914('0x25')](respondWithFilteredResult(_0x312669,_0x5c72a0))['catch'](handleError(_0x312669,null));};exports[_0x5914('0x43')]=function(_0x35ea30,_0x530463){var _0x1efcf7={'raw':![],'where':{'id':_0x35ea30[_0x5914('0x44')]['id']}},_0x49c98e={};_0x49c98e[_0x5914('0x2e')]=_[_0x5914('0x30')](db[_0x5914('0x3f')][_0x5914('0x2c')]);_0x49c98e[_0x5914('0x2f')]=_[_0x5914('0x30')](_0x35ea30[_0x5914('0x2f')]);_0x49c98e[_0x5914('0x39')]=_[_0x5914('0x31')](_0x49c98e['model'],_0x49c98e[_0x5914('0x2f')]);_0x1efcf7[_0x5914('0x32')]=_[_0x5914('0x31')](_0x49c98e[_0x5914('0x2e')],qs['fields'](_0x35ea30[_0x5914('0x2f')]['fields']));_0x1efcf7[_0x5914('0x32')]=_0x1efcf7[_0x5914('0x32')][_0x5914('0x34')]?_0x1efcf7[_0x5914('0x32')]:_0x49c98e[_0x5914('0x2e')];if(_0x35ea30['query'][_0x5914('0x40')]){_0x1efcf7[_0x5914('0x45')]=[{'all':!![]}];}_0x1efcf7=_[_0x5914('0x3c')]({},_0x1efcf7,_0x35ea30[_0x5914('0x3e')]);return db['ZohoAccount'][_0x5914('0x46')](_0x1efcf7)[_0x5914('0x25')](handleEntityNotFound(_0x530463,null))['then'](respondWithResult(_0x530463,null))[_0x5914('0x47')](handleError(_0x530463,null));};exports[_0x5914('0x48')]=function(_0x5118ae,_0x447b8c){return db[_0x5914('0x3f')][_0x5914('0x48')](_0x5118ae[_0x5914('0x49')],{})['then'](respondWithResult(_0x447b8c,0xc9))[_0x5914('0x47')](handleError(_0x447b8c,null));};exports[_0x5914('0x4a')]=function(_0x8c4910,_0x45fd51){if(_0x8c4910[_0x5914('0x49')]['id']){delete _0x8c4910[_0x5914('0x49')]['id'];}return db[_0x5914('0x3f')][_0x5914('0x46')]({'where':{'id':_0x8c4910['params']['id']}})['then'](handleEntityNotFound(_0x45fd51,null))[_0x5914('0x25')](saveUpdates(_0x8c4910[_0x5914('0x49')],null))[_0x5914('0x25')](respondWithResult(_0x45fd51,null))['catch'](handleError(_0x45fd51,null));};exports[_0x5914('0x4b')]=function(_0x2fa98a,_0x3fcde2){return db[_0x5914('0x3f')]['find']({'where':{'id':_0x2fa98a['params']['id']}})[_0x5914('0x25')](handleEntityNotFound(_0x3fcde2,null))[_0x5914('0x25')](removeEntity(_0x3fcde2,null))[_0x5914('0x47')](handleError(_0x3fcde2,null));};exports[_0x5914('0x4c')]=function(_0x45eae7,_0x41978b,_0x2f3282){var _0x3025c1={};var _0x94e0e0={};var _0x4085f1;var _0x29f7db;return db[_0x5914('0x3f')][_0x5914('0x4d')]({'where':{'id':_0x45eae7[_0x5914('0x44')]['id']}})['then'](handleEntityNotFound(_0x41978b,null))[_0x5914('0x25')](function(_0x5662be){if(_0x5662be){_0x4085f1=_0x5662be;_0x94e0e0[_0x5914('0x2e')]=_[_0x5914('0x30')](db['ZohoConfiguration'][_0x5914('0x2c')]);_0x94e0e0['query']=_[_0x5914('0x30')](_0x45eae7[_0x5914('0x2f')]);_0x94e0e0['filters']=_[_0x5914('0x31')](_0x94e0e0[_0x5914('0x2e')],_0x94e0e0[_0x5914('0x2f')]);_0x3025c1[_0x5914('0x32')]=_[_0x5914('0x31')](_0x94e0e0[_0x5914('0x2e')],qs[_0x5914('0x33')](_0x45eae7['query']['fields']));_0x3025c1[_0x5914('0x32')]=_0x3025c1[_0x5914('0x32')][_0x5914('0x34')]?_0x3025c1[_0x5914('0x32')]:_0x94e0e0[_0x5914('0x2e')];_0x3025c1['order']=qs[_0x5914('0x37')](_0x45eae7[_0x5914('0x2f')][_0x5914('0x37')]);_0x3025c1['where']=qs[_0x5914('0x39')](_['pick'](_0x45eae7[_0x5914('0x2f')],_0x94e0e0[_0x5914('0x39')]));if(_0x45eae7['query'][_0x5914('0x3b')]){_0x3025c1['where']=_[_0x5914('0x3c')](_0x3025c1[_0x5914('0x38')],{'$or':_[_0x5914('0x2b')](_0x3025c1[_0x5914('0x32')],function(_0x536370){var _0x18dcd3={};_0x18dcd3[_0x536370]={'$like':'%'+_0x45eae7['query'][_0x5914('0x3b')]+'%'};return _0x18dcd3;})});}_0x3025c1=_[_0x5914('0x3c')]({},_0x3025c1,_0x45eae7['options']);return _0x4085f1[_0x5914('0x4c')](_0x3025c1);}})['then'](function(_0x1914d2){if(_0x1914d2){_0x29f7db=_0x1914d2[_0x5914('0x34')];if(!_0x45eae7[_0x5914('0x2f')][_0x5914('0x35')](_0x5914('0x4e'))){_0x3025c1[_0x5914('0x36')]=qs['limit'](_0x45eae7['query']['limit']);_0x3025c1['offset']=qs[_0x5914('0x1d')](_0x45eae7['query'][_0x5914('0x1d')]);}return _0x4085f1[_0x5914('0x4c')](_0x3025c1);}})[_0x5914('0x25')](function(_0x5b88e8){if(_0x5b88e8){return _0x5b88e8?{'count':_0x29f7db,'rows':_0x5b88e8}:null;}})[_0x5914('0x25')](respondWithResult(_0x41978b,null))[_0x5914('0x47')](handleError(_0x41978b,null));};exports[_0x5914('0x4f')]=function(_0xdfef51,_0x308eed,_0x251829){if(_0xdfef51[_0x5914('0x49')]['id']){delete _0xdfef51[_0x5914('0x49')]['id'];}return db[_0x5914('0x3f')][_0x5914('0x4d')]({'where':{'id':_0xdfef51[_0x5914('0x44')]['id']}})[_0x5914('0x25')](handleEntityNotFound(_0x308eed,null))['then'](function(_0x545268){if(_0x545268){_0xdfef51['body'][_0x5914('0x50')]=_0x545268['id'];_0xdfef51[_0x5914('0x49')][_0x5914('0x51')]=integrations[_0x5914('0x52')](_0xdfef51[_0x5914('0x49')][_0x5914('0x53')],_0xdfef51[_0x5914('0x49')][_0x5914('0x2d')]);_0xdfef51[_0x5914('0x49')][_0x5914('0x54')]=integrations[_0x5914('0x55')](_0xdfef51[_0x5914('0x49')][_0x5914('0x53')],_0xdfef51[_0x5914('0x49')]['type']);return db['ZohoConfiguration'][_0x5914('0x48')](_0xdfef51['body'],{'include':[{'model':db['ZohoField'],'as':_0x5914('0x51')},{'model':db[_0x5914('0x56')],'as':_0x5914('0x54')}]});}return null;})[_0x5914('0x25')](respondWithResult(_0x308eed,null))[_0x5914('0x47')](handleError(_0x308eed,null));};function getAccessToken(_0x4bb7ef){return new Promise(function(_0x1c7dfd,_0xe28c57){var _0xd2a171;switch(_0x4bb7ef['zone']){case'US':_0xd2a171='https://accounts.zoho.com';break;case'AU':_0xd2a171=_0x5914('0x57');break;case'EU':_0xd2a171=_0x5914('0x58');break;case'IN':_0xd2a171=_0x5914('0x59');break;case'CN':_0xd2a171=_0x5914('0x5a');break;default:_0xd2a171=_0x5914('0x58');break;}var _0x2b9d4a={'method':_0x5914('0x5b'),'uri':_0xd2a171+_0x5914('0x5c'),'qs':{'refresh_token':_0x4bb7ef['refreshToken'],'client_id':_0x4bb7ef['clientId'],'client_secret':_0x4bb7ef['clientSecret'],'grant_type':_0x5914('0x5d')},'json':!![]};return rp(_0x2b9d4a)[_0x5914('0x25')](function(_0x26d82f){if(_0x26d82f[_0x5914('0x5e')]){_0x1c7dfd(_0x26d82f[_0x5914('0x5e')]);}else{_0xe28c57('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x5914('0x47')](function(_0x2a5e98){_0xe28c57(_0x2a5e98);});});}exports[_0x5914('0x5f')]=function(_0x5a0fb1,_0x45190e,_0xae9b80){var _0x24843d,_0x1ff9eb,_0x881bac,_0x1224fb,_0x24a925;return db[_0x5914('0x3f')][_0x5914('0x4d')]({'where':{'id':_0x5a0fb1[_0x5914('0x44')]['id']},'attributes':['id','host',_0x5914('0x60'),'clientId',_0x5914('0x61'),_0x5914('0x62'),_0x5914('0x63'),'refreshToken']})[_0x5914('0x25')](handleEntityNotFound(_0x45190e,null))['then'](function(_0x531bb6){_0x24a925=_0x531bb6;_0x24843d=_0x24a925[_0x5914('0x64')];_0x1ff9eb=_0x24843d===_0x5914('0x65')?'eu':_0x5914('0x66');_0x881bac=_0x24a925[_0x5914('0x62')];var _0x58c4f8=_0x881bac[_0x5914('0x67')](-0x1);if(_0x58c4f8==='/'||_0x58c4f8==='\x5c'||_0x58c4f8===':'){_0x881bac=_0x881bac['substring'](0x0,_0x881bac['lastIndexOf'](_0x58c4f8));}if(!_0x24a925['refreshToken']){throw new Error(_0x5914('0x68'));}return getAccessToken(_0x24a925);})[_0x5914('0x25')](function(_0x522d90){if(_0x522d90){return rp({'method':_0x5914('0x69'),'uri':util[_0x5914('0x6a')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x1ff9eb),'qs':{'module':'Calls'},'headers':{'Authorization':_0x5914('0x6b')+_0x522d90},'json':!![]});}})[_0x5914('0x25')](function(_0x5cae10){if(_0x5cae10){if(_0x5cae10[_0x5914('0x6c')]&&_0x5cae10[_0x5914('0x6c')]['error']){throw new Error(_0x5cae10['response']['error']['message']);}var _0x2af85c=[];var _0x103199=[];var _0x484fce=[_0x5914('0x6d'),_0x5914('0x6e'),_0x5914('0x6f'),'WhoId',_0x5914('0x70'),_0x5914('0x71'),_0x5914('0x72'),'Call_Type'];_0x103199=_[_0x5914('0x73')](_0x5cae10[_0x5914('0x33')],function(_0x79d406){return _0x484fce[_0x5914('0x74')](_0x79d406[_0x5914('0x75')]);});for(var _0x4749f3=0x0;_0x4749f3<_0x103199['length'];_0x4749f3++){if(_0x103199[_0x4749f3][_0x5914('0x76')]===![]){_0x2af85c[_0x5914('0x77')]({'id':_0x103199[_0x4749f3]['id'],'name':_0x103199[_0x4749f3]['display_label'],'custom':_0x103199[_0x4749f3][_0x5914('0x78')],'options':_0x103199[_0x4749f3][_0x5914('0x79')]===_0x5914('0x7a')&&_0x103199[_0x4749f3][_0x5914('0x7b')][_0x5914('0x34')]>-0x1?_[_0x5914('0x2b')](_0x103199[_0x4749f3]['pick_list_values'],function(_0x59f262){return{'name':_0x59f262,'value':_0x59f262};}):[]});}}return{'count':_0x2af85c['length'],'rows':_0x2af85c};}else{return{'count':0x0,'rows':[]};}})[_0x5914('0x25')](respondWithResult(_0x45190e,null))['catch'](function(_0x4d9847){var _0x19c54f=_0x5a0fb1['query']['test']?0x1f4:_0x4d9847['statusCode']||0x1f4;logger[_0x5914('0x26')](_0x5914('0x7c'),_0x5914('0x5f'),_0x19c54f,JSON[_0x5914('0x7d')](_0x4d9847));delete _0x4d9847[_0x5914('0x28')];if(_0x19c54f===0x191){_0x19c54f=0x190;}_0x45190e[_0x5914('0x1a')](_0x19c54f)['send'](_0x5a0fb1[_0x5914('0x2f')][_0x5914('0x7e')]?{'message':_0x5914('0x7f'),'statusCode':_0x4d9847['statusCode']}:_0x4d9847);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 6959f98..3677aa4 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 _0xf278=['serverUrl','clientSecret','code','host','substring','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','/oauth/v2/token','clientId','parse','refresh_token','refreshToken','format','name','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','error','slice','lastIndexOf','https://accounts.zoho.com.au','https://accounts.zoho.com.cn','POST','authorization_code','application/x-www-form-urlencoded','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','int_zoho_accounts','changed','zone'];(function(_0x54768b,_0x471822){var _0x587cbf=function(_0x413639){while(--_0x413639){_0x54768b['push'](_0x54768b['shift']());}};_0x587cbf(++_0x471822);}(_0xf278,0x13b));var _0x8f27=function(_0x2a83af,_0x4fa9ed){_0x2a83af=_0x2a83af-0x0;var _0x2e1648=_0xf278[_0x2a83af];return _0x2e1648;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8f27('0x0'))(_0x8f27('0x1'));var moment=require(_0x8f27('0x2'));var BPromise=require('bluebird');var rp=require(_0x8f27('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8f27('0x4'));var config=require(_0x8f27('0x5'));var attributes=require(_0x8f27('0x6'));var integrations=require(_0x8f27('0x7'));module[_0x8f27('0x8')]=function(_0x4780df,_0x56e54a){return _0x4780df[_0x8f27('0x9')]('ZohoAccount',attributes,{'tableName':_0x8f27('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5e2d98,_0x1294f8,_0x4b9ebb){if(_0x5e2d98[_0x8f27('0xb')](_0x8f27('0xc'))||_0x5e2d98[_0x8f27('0xb')](_0x8f27('0xd'))||_0x5e2d98[_0x8f27('0xb')]('clientId')||_0x5e2d98[_0x8f27('0xb')](_0x8f27('0xe'))||_0x5e2d98[_0x8f27('0xb')](_0x8f27('0xf'))||_0x5e2d98['changed'](_0x8f27('0x10'))){var _0x34f7ba,_0x344775;_0x34f7ba=_0x5e2d98[_0x8f27('0xd')];var _0x598ee6=_0x34f7ba['slice'](-0x1);if(_0x598ee6==='/'||_0x598ee6==='\x5c'||_0x598ee6===':'){_0x34f7ba=_0x34f7ba[_0x8f27('0x11')](0x0,_0x34f7ba['lastIndexOf'](_0x598ee6));}switch(_0x5e2d98[_0x8f27('0xc')]){case'US':_0x344775=_0x8f27('0x12');break;case'AU':_0x344775='https://accounts.zoho.com.au';break;case'IN':_0x344775=_0x8f27('0x13');break;case'CN':_0x344775='https://accounts.zoho.com.cn';break;default:_0x344775=_0x8f27('0x14');break;}var _0x3ea2aa={'method':'POST','uri':_0x344775+_0x8f27('0x15'),'form':{'grant_type':'authorization_code','client_id':_0x5e2d98[_0x8f27('0x16')],'client_secret':_0x5e2d98['clientSecret'],'redirect_uri':_0x5e2d98[_0x8f27('0xd')],'code':_0x5e2d98[_0x8f27('0xf')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x3ea2aa)['then'](function(_0x27e365){var _0xa304d=JSON[_0x8f27('0x17')](_0x27e365);if(_0xa304d[_0x8f27('0x18')]){_0x5e2d98[_0x8f27('0x19')]=_0xa304d['refresh_token'];logger['info'](util[_0x8f27('0x1a')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x5e2d98[_0x8f27('0x1b')],_0x5e2d98['id']));}else{logger['error'](util[_0x8f27('0x1a')](_0x8f27('0x1c'),_0x5e2d98['name'],_0x5e2d98['id']),util[_0x8f27('0x1d')](_0xa304d,{'showHidden':![],'depth':null}));}return _0x4b9ebb(null,_0x1294f8);})[_0x8f27('0x1e')](function(_0x7a32d7){logger[_0x8f27('0x1f')](util[_0x8f27('0x1a')](_0x8f27('0x1c'),_0x5e2d98[_0x8f27('0x1b')],_0x5e2d98['id']),util[_0x8f27('0x1d')](parsedResult,{'showHidden':![],'depth':null}));return _0x4b9ebb(_0x7a32d7);});}else{return _0x4b9ebb(null,_0x1294f8);}},'beforeUpdate':function(_0x945bcf,_0x464c23,_0x2588e7){if(_0x945bcf[_0x8f27('0xb')]('zone')||_0x945bcf['changed'](_0x8f27('0xd'))||_0x945bcf['changed'](_0x8f27('0x16'))||_0x945bcf['changed']('clientSecret')||_0x945bcf['changed'](_0x8f27('0xf'))||_0x945bcf[_0x8f27('0xb')]('host')){var _0x54e2a7,_0x17ab30;_0x54e2a7=_0x945bcf['serverUrl'];var _0x1b9609=_0x54e2a7[_0x8f27('0x20')](-0x1);if(_0x1b9609==='/'||_0x1b9609==='\x5c'||_0x1b9609===':'){_0x54e2a7=_0x54e2a7['substring'](0x0,_0x54e2a7[_0x8f27('0x21')](_0x1b9609));}switch(_0x945bcf[_0x8f27('0xc')]){case'US':_0x17ab30=_0x8f27('0x12');break;case'AU':_0x17ab30=_0x8f27('0x22');break;case'IN':_0x17ab30=_0x8f27('0x13');break;case'CN':_0x17ab30=_0x8f27('0x23');break;default:_0x17ab30='https://accounts.zoho.eu';break;}var _0x503a2a={'method':_0x8f27('0x24'),'uri':_0x17ab30+_0x8f27('0x15'),'form':{'grant_type':_0x8f27('0x25'),'client_id':_0x945bcf['clientId'],'client_secret':_0x945bcf['clientSecret'],'redirect_uri':_0x945bcf['serverUrl'],'code':_0x945bcf[_0x8f27('0xf')]},'headers':{'Content-Type':_0x8f27('0x26')}};return rp(_0x503a2a)['then'](function(_0x322b92){var _0x559cc2=JSON['parse'](_0x322b92);if(_0x559cc2[_0x8f27('0x18')]){_0x945bcf['refreshToken']=_0x559cc2[_0x8f27('0x18')];logger[_0x8f27('0x27')](util['format'](_0x8f27('0x28'),_0x945bcf[_0x8f27('0x1b')],_0x945bcf['id']));}else{logger[_0x8f27('0x1f')](util[_0x8f27('0x1a')](_0x8f27('0x1c'),_0x945bcf[_0x8f27('0x1b')],_0x945bcf['id']),util[_0x8f27('0x1d')](_0x559cc2,{'showHidden':![],'depth':null}));}return _0x2588e7(null,_0x464c23);})[_0x8f27('0x1e')](function(_0x337f9f){logger[_0x8f27('0x1f')](util[_0x8f27('0x1a')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x945bcf[_0x8f27('0x1b')],_0x945bcf['id']),util[_0x8f27('0x1d')](parsedResult,{'showHidden':![],'depth':null}));return _0x2588e7(_0x337f9f);});}else{return _0x2588e7(null,_0x464c23);}}}});}; \ No newline at end of file +var _0xb03c=['request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientSecret','code','host','slice','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','application/x-www-form-urlencoded','refresh_token','refreshToken','info','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','substring','lastIndexOf','authorization_code','then','parse','format','util','../../config/logger'];(function(_0x54ffd9,_0x253d65){var _0x1f0ec1=function(_0x2e04ba){while(--_0x2e04ba){_0x54ffd9['push'](_0x54ffd9['shift']());}};_0x1f0ec1(++_0x253d65);}(_0xb03c,0x198));var _0xcb03=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0xb03c[_0x2261ce];return _0x524640;};'use strict';var _=require('lodash');var util=require(_0xcb03('0x0'));var logger=require(_0xcb03('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcb03('0x2'));var fs=require('fs');var path=require(_0xcb03('0x3'));var rimraf=require(_0xcb03('0x4'));var config=require(_0xcb03('0x5'));var attributes=require(_0xcb03('0x6'));var integrations=require(_0xcb03('0x7'));module['exports']=function(_0x327a07,_0x465b20){return _0x327a07['define'](_0xcb03('0x8'),attributes,{'tableName':_0xcb03('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5d5e48,_0x2d6ceb,_0x2288eb){if(_0x5d5e48[_0xcb03('0xa')](_0xcb03('0xb'))||_0x5d5e48['changed'](_0xcb03('0xc'))||_0x5d5e48[_0xcb03('0xa')]('clientId')||_0x5d5e48[_0xcb03('0xa')](_0xcb03('0xd'))||_0x5d5e48[_0xcb03('0xa')](_0xcb03('0xe'))||_0x5d5e48['changed'](_0xcb03('0xf'))){var _0x3febf7,_0xa44f00;_0x3febf7=_0x5d5e48[_0xcb03('0xc')];var _0x275a31=_0x3febf7[_0xcb03('0x10')](-0x1);if(_0x275a31==='/'||_0x275a31==='\x5c'||_0x275a31===':'){_0x3febf7=_0x3febf7['substring'](0x0,_0x3febf7['lastIndexOf'](_0x275a31));}switch(_0x5d5e48[_0xcb03('0xb')]){case'US':_0xa44f00=_0xcb03('0x11');break;case'AU':_0xa44f00=_0xcb03('0x12');break;case'IN':_0xa44f00=_0xcb03('0x13');break;case'CN':_0xa44f00=_0xcb03('0x14');break;default:_0xa44f00=_0xcb03('0x15');break;}var _0xdadc0e={'method':_0xcb03('0x16'),'uri':_0xa44f00+_0xcb03('0x17'),'form':{'grant_type':'authorization_code','client_id':_0x5d5e48[_0xcb03('0x18')],'client_secret':_0x5d5e48[_0xcb03('0xd')],'redirect_uri':_0x5d5e48[_0xcb03('0xc')],'code':_0x5d5e48[_0xcb03('0xe')]},'headers':{'Content-Type':_0xcb03('0x19')}};return rp(_0xdadc0e)['then'](function(_0x2e055d){var _0x19cf0f=JSON['parse'](_0x2e055d);if(_0x19cf0f[_0xcb03('0x1a')]){_0x5d5e48[_0xcb03('0x1b')]=_0x19cf0f[_0xcb03('0x1a')];logger[_0xcb03('0x1c')](util['format'](_0xcb03('0x1d'),_0x5d5e48[_0xcb03('0x1e')],_0x5d5e48['id']));}else{logger[_0xcb03('0x1f')](util['format'](_0xcb03('0x20'),_0x5d5e48[_0xcb03('0x1e')],_0x5d5e48['id']),util[_0xcb03('0x21')](_0x19cf0f,{'showHidden':![],'depth':null}));}return _0x2288eb(null,_0x2d6ceb);})[_0xcb03('0x22')](function(_0x7f58e7){logger['error'](util['format'](_0xcb03('0x20'),_0x5d5e48[_0xcb03('0x1e')],_0x5d5e48['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x2288eb(_0x7f58e7);});}else{return _0x2288eb(null,_0x2d6ceb);}},'beforeUpdate':function(_0x38d8d9,_0x564743,_0x2e6adb){if(_0x38d8d9[_0xcb03('0xa')](_0xcb03('0xb'))||_0x38d8d9[_0xcb03('0xa')](_0xcb03('0xc'))||_0x38d8d9[_0xcb03('0xa')](_0xcb03('0x18'))||_0x38d8d9[_0xcb03('0xa')](_0xcb03('0xd'))||_0x38d8d9[_0xcb03('0xa')]('code')||_0x38d8d9[_0xcb03('0xa')](_0xcb03('0xf'))){var _0xb1b489,_0x9e34ec;_0xb1b489=_0x38d8d9['serverUrl'];var _0x5c71a6=_0xb1b489[_0xcb03('0x10')](-0x1);if(_0x5c71a6==='/'||_0x5c71a6==='\x5c'||_0x5c71a6===':'){_0xb1b489=_0xb1b489[_0xcb03('0x23')](0x0,_0xb1b489[_0xcb03('0x24')](_0x5c71a6));}switch(_0x38d8d9[_0xcb03('0xb')]){case'US':_0x9e34ec=_0xcb03('0x11');break;case'AU':_0x9e34ec=_0xcb03('0x12');break;case'IN':_0x9e34ec=_0xcb03('0x13');break;case'CN':_0x9e34ec=_0xcb03('0x14');break;default:_0x9e34ec=_0xcb03('0x15');break;}var _0x29fb7a={'method':_0xcb03('0x16'),'uri':_0x9e34ec+_0xcb03('0x17'),'form':{'grant_type':_0xcb03('0x25'),'client_id':_0x38d8d9[_0xcb03('0x18')],'client_secret':_0x38d8d9['clientSecret'],'redirect_uri':_0x38d8d9[_0xcb03('0xc')],'code':_0x38d8d9[_0xcb03('0xe')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x29fb7a)[_0xcb03('0x26')](function(_0x39d777){var _0x23e484=JSON[_0xcb03('0x27')](_0x39d777);if(_0x23e484['refresh_token']){_0x38d8d9[_0xcb03('0x1b')]=_0x23e484[_0xcb03('0x1a')];logger[_0xcb03('0x1c')](util[_0xcb03('0x28')](_0xcb03('0x1d'),_0x38d8d9[_0xcb03('0x1e')],_0x38d8d9['id']));}else{logger['error'](util[_0xcb03('0x28')](_0xcb03('0x20'),_0x38d8d9[_0xcb03('0x1e')],_0x38d8d9['id']),util['inspect'](_0x23e484,{'showHidden':![],'depth':null}));}return _0x2e6adb(null,_0x564743);})[_0xcb03('0x22')](function(_0x9fa2c8){logger[_0xcb03('0x1f')](util[_0xcb03('0x28')](_0xcb03('0x20'),_0x38d8d9['name'],_0x38d8d9['id']),util[_0xcb03('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x2e6adb(_0x9fa2c8);});}else{return _0x2e6adb(null,_0x564743);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 5cfcdbe..65867c7 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 _0xe1c4=['result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','limit','include','map','model','attributes','debug','stringify','ShowZohoAccount','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x445098,_0x2408f5){var _0xe7a955=function(_0x167e4e){while(--_0x167e4e){_0x445098['push'](_0x445098['shift']());}};_0xe7a955(++_0x2408f5);}(_0xe1c4,0x1ec));var _0x4e1c=function(_0x29b84a,_0x11c563){_0x29b84a=_0x29b84a-0x0;var _0x4ad70b=_0xe1c4[_0x29b84a];return _0x4ad70b;};'use strict';var _=require(_0x4e1c('0x0'));var util=require(_0x4e1c('0x1'));var moment=require(_0x4e1c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e1c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e1c('0x4'));var logger=require(_0x4e1c('0x5'))(_0x4e1c('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4e1c('0x7')][_0x4e1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x44db21,_0x1c7e52,_0x460295){return new BPromise(function(_0x108830,_0x2622b4){return client[_0x4e1c('0x9')](_0x44db21,_0x460295)[_0x4e1c('0xa')](function(_0x60e98c){logger[_0x4e1c('0xb')](_0x4e1c('0xc'),_0x1c7e52,_0x4e1c('0xd'));logger['debug'](_0x4e1c('0xe'),_0x1c7e52,_0x4e1c('0xd'),JSON['stringify'](_0x60e98c));if(_0x60e98c[_0x4e1c('0xf')]){if(_0x60e98c[_0x4e1c('0xf')][_0x4e1c('0x10')]===0x1f4){logger[_0x4e1c('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x1c7e52,_0x60e98c[_0x4e1c('0xf')][_0x4e1c('0x11')]);return _0x2622b4(_0x60e98c[_0x4e1c('0xf')][_0x4e1c('0x11')]);}logger['error']('ZohoAccount,\x20%s,\x20%s',_0x1c7e52,_0x60e98c['error'][_0x4e1c('0x11')]);return _0x108830(_0x60e98c[_0x4e1c('0xf')][_0x4e1c('0x11')]);}else{logger[_0x4e1c('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x1c7e52,_0x4e1c('0xd'));_0x108830(_0x60e98c[_0x4e1c('0x12')][_0x4e1c('0x11')]);}})[_0x4e1c('0x13')](function(_0x44a842){logger[_0x4e1c('0xf')]('ZohoAccount,\x20%s,\x20%s',_0x1c7e52,_0x44a842);_0x2622b4(_0x44a842);});});}exports[_0x4e1c('0x14')]=function(_0x399bcc){var _0x2af3db=this;return new Promise(function(_0x46a887,_0x116a01){return db[_0x4e1c('0x15')][_0x4e1c('0x16')]({'raw':_0x399bcc['options']?_0x399bcc[_0x4e1c('0x17')][_0x4e1c('0x18')]===undefined?!![]:![]:!![],'where':_0x399bcc[_0x4e1c('0x17')]?_0x399bcc[_0x4e1c('0x17')][_0x4e1c('0x19')]||null:null,'attributes':_0x399bcc[_0x4e1c('0x17')]?_0x399bcc[_0x4e1c('0x17')]['attributes']||null:null,'limit':_0x399bcc[_0x4e1c('0x17')]?_0x399bcc[_0x4e1c('0x17')][_0x4e1c('0x1a')]||null:null,'include':_0x399bcc[_0x4e1c('0x17')]?_0x399bcc[_0x4e1c('0x17')][_0x4e1c('0x1b')]?_[_0x4e1c('0x1c')](_0x399bcc[_0x4e1c('0x17')][_0x4e1c('0x1b')],function(_0x5ada14){return{'model':db[_0x5ada14[_0x4e1c('0x1d')]],'as':_0x5ada14['as'],'attributes':_0x5ada14[_0x4e1c('0x1e')],'include':_0x5ada14[_0x4e1c('0x1b')]?_['map'](_0x5ada14['include'],function(_0x17f5a5){return{'model':db[_0x17f5a5['model']],'as':_0x17f5a5['as'],'attributes':_0x17f5a5[_0x4e1c('0x1e')],'include':_0x17f5a5[_0x4e1c('0x1b')]?_[_0x4e1c('0x1c')](_0x17f5a5[_0x4e1c('0x1b')],function(_0x12364d){return{'model':db[_0x12364d[_0x4e1c('0x1d')]],'as':_0x12364d['as'],'attributes':_0x12364d['attributes']};}):[]};}):[]};}):[]:[]})[_0x4e1c('0xa')](function(_0x2526a6){logger[_0x4e1c('0xb')](_0x4e1c('0x14'),_0x399bcc);logger[_0x4e1c('0x1f')]('GetZohoAccount',_0x399bcc,JSON[_0x4e1c('0x20')](_0x2526a6));_0x46a887(_0x2526a6);})[_0x4e1c('0x13')](function(_0x1b5ba8){logger[_0x4e1c('0xf')]('GetZohoAccount',_0x1b5ba8[_0x4e1c('0x11')],_0x399bcc);_0x116a01(_0x2af3db[_0x4e1c('0xf')](0x1f4,_0x1b5ba8['message']));});});};exports[_0x4e1c('0x21')]=function(_0x5ae521){var _0x88df92=this;return new Promise(function(_0x3c007f,_0x39f8fc){return db[_0x4e1c('0x15')]['find']({'raw':_0x5ae521[_0x4e1c('0x17')]?_0x5ae521['options'][_0x4e1c('0x18')]===undefined?!![]:![]:!![],'where':_0x5ae521['options']?_0x5ae521[_0x4e1c('0x17')][_0x4e1c('0x19')]||null:null,'attributes':_0x5ae521['options']?_0x5ae521[_0x4e1c('0x17')]['attributes']||null:null,'include':_0x5ae521[_0x4e1c('0x17')]?_0x5ae521[_0x4e1c('0x17')][_0x4e1c('0x1b')]?_[_0x4e1c('0x1c')](_0x5ae521[_0x4e1c('0x17')][_0x4e1c('0x1b')],function(_0x44477f){return{'model':db[_0x44477f[_0x4e1c('0x1d')]],'as':_0x44477f['as'],'attributes':_0x44477f[_0x4e1c('0x1e')],'include':_0x44477f[_0x4e1c('0x1b')]?_['map'](_0x44477f[_0x4e1c('0x1b')],function(_0x35763f){return{'model':db[_0x35763f[_0x4e1c('0x1d')]],'as':_0x35763f['as'],'attributes':_0x35763f[_0x4e1c('0x1e')],'include':_0x35763f[_0x4e1c('0x1b')]?_[_0x4e1c('0x1c')](_0x35763f['include'],function(_0x545d6b){return{'model':db[_0x545d6b[_0x4e1c('0x1d')]],'as':_0x545d6b['as'],'attributes':_0x545d6b[_0x4e1c('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4e1c('0xa')](function(_0x4365eb){logger['info'](_0x4e1c('0x21'),_0x5ae521);logger[_0x4e1c('0x1f')]('ShowZohoAccount',_0x5ae521,JSON[_0x4e1c('0x20')](_0x4365eb));_0x3c007f(_0x4365eb);})[_0x4e1c('0x13')](function(_0x729915){logger['error'](_0x4e1c('0x21'),_0x729915[_0x4e1c('0x11')],_0x5ae521);_0x39f8fc(_0x88df92['error'](0x1f4,_0x729915[_0x4e1c('0x11')]));});});}; \ No newline at end of file +var _0x6b19=['options','where','attributes','limit','include','map','model','debug','ShowZohoAccount','ZohoAccount','find','raw','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','GetZohoAccount'];(function(_0x25eb43,_0x402961){var _0x1ce0fe=function(_0x4734f2){while(--_0x4734f2){_0x25eb43['push'](_0x25eb43['shift']());}};_0x1ce0fe(++_0x402961);}(_0x6b19,0xf4));var _0x96b1=function(_0x1bfc5c,_0x55bd5e){_0x1bfc5c=_0x1bfc5c-0x0;var _0x25a605=_0x6b19[_0x1bfc5c];return _0x25a605;};'use strict';var _=require(_0x96b1('0x0'));var util=require('util');var moment=require(_0x96b1('0x1'));var BPromise=require(_0x96b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96b1('0x3'));var db=require(_0x96b1('0x4'))['db'];var utils=require(_0x96b1('0x5'));var logger=require(_0x96b1('0x6'))('rpc');var config=require(_0x96b1('0x7'));var jayson=require(_0x96b1('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x288d77,_0x2347c5,_0x519fbe){return new BPromise(function(_0x280b00,_0x2300ad){return client['request'](_0x288d77,_0x519fbe)[_0x96b1('0x9')](function(_0x6323a6){logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x2347c5,_0x96b1('0xc'));logger['debug'](_0x96b1('0xd'),_0x2347c5,'request\x20sent',JSON['stringify'](_0x6323a6));if(_0x6323a6['error']){if(_0x6323a6['error'][_0x96b1('0xe')]===0x1f4){logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x2347c5,_0x6323a6[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x2300ad(_0x6323a6['error'][_0x96b1('0x10')]);}logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x2347c5,_0x6323a6[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x280b00(_0x6323a6[_0x96b1('0xf')][_0x96b1('0x10')]);}else{logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x2347c5,'request\x20sent');_0x280b00(_0x6323a6[_0x96b1('0x11')][_0x96b1('0x10')]);}})[_0x96b1('0x12')](function(_0x350b2c){logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x2347c5,_0x350b2c);_0x2300ad(_0x350b2c);});});}exports[_0x96b1('0x13')]=function(_0x41227b){var _0x1749a7=this;return new Promise(function(_0x44cc44,_0xd1eebb){return db['ZohoAccount']['findAll']({'raw':_0x41227b[_0x96b1('0x14')]?_0x41227b['options']['raw']===undefined?!![]:![]:!![],'where':_0x41227b[_0x96b1('0x14')]?_0x41227b[_0x96b1('0x14')][_0x96b1('0x15')]||null:null,'attributes':_0x41227b['options']?_0x41227b[_0x96b1('0x14')][_0x96b1('0x16')]||null:null,'limit':_0x41227b[_0x96b1('0x14')]?_0x41227b[_0x96b1('0x14')][_0x96b1('0x17')]||null:null,'include':_0x41227b[_0x96b1('0x14')]?_0x41227b[_0x96b1('0x14')][_0x96b1('0x18')]?_[_0x96b1('0x19')](_0x41227b[_0x96b1('0x14')][_0x96b1('0x18')],function(_0x1b0f88){return{'model':db[_0x1b0f88[_0x96b1('0x1a')]],'as':_0x1b0f88['as'],'attributes':_0x1b0f88[_0x96b1('0x16')],'include':_0x1b0f88[_0x96b1('0x18')]?_[_0x96b1('0x19')](_0x1b0f88[_0x96b1('0x18')],function(_0x5b19b6){return{'model':db[_0x5b19b6[_0x96b1('0x1a')]],'as':_0x5b19b6['as'],'attributes':_0x5b19b6[_0x96b1('0x16')],'include':_0x5b19b6[_0x96b1('0x18')]?_[_0x96b1('0x19')](_0x5b19b6[_0x96b1('0x18')],function(_0x2ad760){return{'model':db[_0x2ad760['model']],'as':_0x2ad760['as'],'attributes':_0x2ad760['attributes']};}):[]};}):[]};}):[]:[]})[_0x96b1('0x9')](function(_0x4bc715){logger[_0x96b1('0xa')](_0x96b1('0x13'),_0x41227b);logger[_0x96b1('0x1b')](_0x96b1('0x13'),_0x41227b,JSON['stringify'](_0x4bc715));_0x44cc44(_0x4bc715);})['catch'](function(_0x45c20e){logger[_0x96b1('0xf')]('GetZohoAccount',_0x45c20e[_0x96b1('0x10')],_0x41227b);_0xd1eebb(_0x1749a7[_0x96b1('0xf')](0x1f4,_0x45c20e[_0x96b1('0x10')]));});});};exports[_0x96b1('0x1c')]=function(_0x378e04){var _0x5caa74=this;return new Promise(function(_0x5ac63c,_0x4716a4){return db[_0x96b1('0x1d')][_0x96b1('0x1e')]({'raw':_0x378e04[_0x96b1('0x14')]?_0x378e04[_0x96b1('0x14')][_0x96b1('0x1f')]===undefined?!![]:![]:!![],'where':_0x378e04[_0x96b1('0x14')]?_0x378e04[_0x96b1('0x14')]['where']||null:null,'attributes':_0x378e04[_0x96b1('0x14')]?_0x378e04[_0x96b1('0x14')][_0x96b1('0x16')]||null:null,'include':_0x378e04[_0x96b1('0x14')]?_0x378e04[_0x96b1('0x14')][_0x96b1('0x18')]?_[_0x96b1('0x19')](_0x378e04[_0x96b1('0x14')]['include'],function(_0x1ff61a){return{'model':db[_0x1ff61a[_0x96b1('0x1a')]],'as':_0x1ff61a['as'],'attributes':_0x1ff61a[_0x96b1('0x16')],'include':_0x1ff61a['include']?_['map'](_0x1ff61a[_0x96b1('0x18')],function(_0x3638e6){return{'model':db[_0x3638e6['model']],'as':_0x3638e6['as'],'attributes':_0x3638e6['attributes'],'include':_0x3638e6['include']?_[_0x96b1('0x19')](_0x3638e6[_0x96b1('0x18')],function(_0x3cc6e1){return{'model':db[_0x3cc6e1[_0x96b1('0x1a')]],'as':_0x3cc6e1['as'],'attributes':_0x3cc6e1[_0x96b1('0x16')]};}):[]};}):[]};}):[]:[]})[_0x96b1('0x9')](function(_0x39a97a){logger['info'](_0x96b1('0x1c'),_0x378e04);logger['debug']('ShowZohoAccount',_0x378e04,JSON[_0x96b1('0x20')](_0x39a97a));_0x5ac63c(_0x39a97a);})[_0x96b1('0x12')](function(_0x482e37){logger[_0x96b1('0xf')](_0x96b1('0x1c'),_0x482e37[_0x96b1('0x10')],_0x378e04);_0x4716a4(_0x5caa74[_0x96b1('0xf')](0x1f4,_0x482e37[_0x96b1('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 88b8323..01e8c76 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 _0x0d79=['/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x0d79,0x1ed));var _0x90d7=function(_0x227bfa,_0x51bedc){_0x227bfa=_0x227bfa-0x0;var _0x331aba=_0x0d79[_0x227bfa];return _0x331aba;};'use strict';var multer=require(_0x90d7('0x0'));var util=require(_0x90d7('0x1'));var path=require('path');var timeout=require(_0x90d7('0x2'));var express=require(_0x90d7('0x3'));var router=express['Router']();var fs_extra=require(_0x90d7('0x4'));var auth=require(_0x90d7('0x5'));var interaction=require(_0x90d7('0x6'));var config=require('../../config/environment');var controller=require(_0x90d7('0x7'));router[_0x90d7('0x8')]('/',auth[_0x90d7('0x9')](),controller[_0x90d7('0xa')]);router[_0x90d7('0x8')](_0x90d7('0xb'),auth[_0x90d7('0x9')](),controller[_0x90d7('0xc')]);router[_0x90d7('0x8')](_0x90d7('0xd'),auth[_0x90d7('0x9')](),controller[_0x90d7('0xe')]);router['get']('/:id/subjects',auth[_0x90d7('0x9')](),controller[_0x90d7('0xf')]);router[_0x90d7('0x8')](_0x90d7('0x10'),auth[_0x90d7('0x9')](),controller[_0x90d7('0x11')]);router['post']('/',auth[_0x90d7('0x9')](),controller[_0x90d7('0x12')]);router[_0x90d7('0x13')](_0x90d7('0xb'),auth[_0x90d7('0x9')](),controller[_0x90d7('0x14')]);router[_0x90d7('0x15')]('/:id',auth[_0x90d7('0x9')](),controller[_0x90d7('0x16')]);module[_0x90d7('0x17')]=router; \ No newline at end of file +var _0x6779=['index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','delete','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated'];(function(_0x2676cf,_0x509894){var _0x5263b6=function(_0x1a516b){while(--_0x1a516b){_0x2676cf['push'](_0x2676cf['shift']());}};_0x5263b6(++_0x509894);}(_0x6779,0x140));var _0x9677=function(_0x2e190e,_0x36d7e8){_0x2e190e=_0x2e190e-0x0;var _0xe0bed=_0x6779[_0x2e190e];return _0xe0bed;};'use strict';var multer=require(_0x9677('0x0'));var util=require(_0x9677('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9677('0x2'));var router=express[_0x9677('0x3')]();var fs_extra=require(_0x9677('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x9677('0x5'));var config=require(_0x9677('0x6'));var controller=require(_0x9677('0x7'));router[_0x9677('0x8')]('/',auth[_0x9677('0x9')](),controller[_0x9677('0xa')]);router[_0x9677('0x8')](_0x9677('0xb'),auth[_0x9677('0x9')](),controller[_0x9677('0xc')]);router[_0x9677('0x8')](_0x9677('0xd'),auth[_0x9677('0x9')](),controller[_0x9677('0xe')]);router[_0x9677('0x8')](_0x9677('0xf'),auth[_0x9677('0x9')](),controller[_0x9677('0x10')]);router[_0x9677('0x8')](_0x9677('0x11'),auth[_0x9677('0x9')](),controller[_0x9677('0x12')]);router['post']('/',auth[_0x9677('0x9')](),controller[_0x9677('0x13')]);router['put']('/:id',auth[_0x9677('0x9')](),controller['update']);router[_0x9677('0x14')]('/:id',auth[_0x9677('0x9')](),controller['destroy']);module[_0x9677('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 07def24..97cd1fc 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 _0xa81a=['contact','STRING','sequelize','exports','ENUM','lead','contact_lead'];(function(_0x405c7e,_0x264502){var _0x3fa7d9=function(_0x514ee3){while(--_0x514ee3){_0x405c7e['push'](_0x405c7e['shift']());}};_0x3fa7d9(++_0x264502);}(_0xa81a,0xbf));var _0xaa81=function(_0x499140,_0x4c602c){_0x499140=_0x499140-0x0;var _0x4db9ec=_0xa81a[_0x499140];return _0x4db9ec;};'use strict';var Sequelize=require(_0xaa81('0x0'));module[_0xaa81('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0xaa81('0x2')](_0xaa81('0x3'),'contact','nothing'),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0xaa81('0x2')](_0xaa81('0x4'),_0xaa81('0x5'),_0xaa81('0x3')),'defaultValue':_0xaa81('0x4')},'description':{'type':Sequelize[_0xaa81('0x6')]}}; \ No newline at end of file +var _0x9fc5=['exports','STRING','lead','contact','nothing','ENUM','contact_lead'];(function(_0x4459b8,_0x3271b8){var _0x4a4b07=function(_0x3075f8){while(--_0x3075f8){_0x4459b8['push'](_0x4459b8['shift']());}};_0x4a4b07(++_0x3271b8);}(_0x9fc5,0xb6));var _0x59fc=function(_0x7275e9,_0x321fa5){_0x7275e9=_0x7275e9-0x0;var _0x17b99d=_0x9fc5[_0x7275e9];return _0x17b99d;};'use strict';var Sequelize=require('sequelize');module[_0x59fc('0x0')]={'name':{'type':Sequelize[_0x59fc('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x59fc('0x2'),_0x59fc('0x3'),_0x59fc('0x4')),'defaultValue':_0x59fc('0x2')},'moduleSearch':{'type':Sequelize[_0x59fc('0x5')](_0x59fc('0x6'),_0x59fc('0x3'),_0x59fc('0x2')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x59fc('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 547e95c..131d0d9 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 _0x968f=['catch','show','params','keys','length','merge','find','create','body','findOne','ZohoField','order','pick','nolimit','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ZohoConfiguration','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','filter','type','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x3ff4c5,_0x588233){var _0x27904=function(_0x38f02c){while(--_0x38f02c){_0x3ff4c5['push'](_0x3ff4c5['shift']());}};_0x27904(++_0x588233);}(_0x968f,0x15c));var _0xf968=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x968f[_0x2641f9];return _0x585741;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf968('0x0'));var jsonpatch=require(_0xf968('0x1'));var rp=require(_0xf968('0x2'));var moment=require(_0xf968('0x3'));var BPromise=require(_0xf968('0x4'));var Mustache=require(_0xf968('0x5'));var util=require('util');var path=require('path');var sox=require(_0xf968('0x6'));var csv=require(_0xf968('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf968('0x8'));var _=require(_0xf968('0x9'));var squel=require(_0xf968('0xa'));var crypto=require(_0xf968('0xb'));var jsforce=require(_0xf968('0xc'));var deskjs=require(_0xf968('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf968('0xe'));var Papa=require(_0xf968('0xf'));var Redis=require(_0xf968('0x10'));var authService=require(_0xf968('0x11'));var qs=require(_0xf968('0x12'));var as=require(_0xf968('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf968('0x14'))('api');var utils=require(_0xf968('0x15'));var config=require(_0xf968('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf968('0x17'))['db'];function respondWithStatusCode(_0x42d86f,_0x574e8a){_0x574e8a=_0x574e8a||0xcc;return function(_0x1f7af0){if(_0x1f7af0){return _0x42d86f[_0xf968('0x18')](_0x574e8a);}return _0x42d86f['status'](_0x574e8a)[_0xf968('0x19')]();};}function respondWithResult(_0x515bb9,_0x3e2154){_0x3e2154=_0x3e2154||0xc8;return function(_0x24a50f){if(_0x24a50f){return _0x515bb9[_0xf968('0x1a')](_0x3e2154)[_0xf968('0x1b')](_0x24a50f);}};}function respondWithFilteredResult(_0xca960d,_0x1ea7b4){return function(_0xe5cc0c){if(_0xe5cc0c){var _0x331795=typeof _0x1ea7b4[_0xf968('0x1c')]===_0xf968('0x1d')&&typeof _0x1ea7b4[_0xf968('0x1e')]===_0xf968('0x1d');var _0x371d50=_0xe5cc0c[_0xf968('0x1f')];var _0x5ebe2e=_0x331795?0x0:_0x1ea7b4['offset'];var _0x5556fc=_0x331795?_0xe5cc0c[_0xf968('0x1f')]:_0x1ea7b4[_0xf968('0x1c')]+_0x1ea7b4[_0xf968('0x1e')];var _0x575d81;if(_0x5556fc>=_0x371d50){_0x5556fc=_0x371d50;_0x575d81=0xc8;}else{_0x575d81=0xce;}_0xca960d[_0xf968('0x1a')](_0x575d81);return _0xca960d[_0xf968('0x20')](_0xf968('0x21'),_0x5ebe2e+'-'+_0x5556fc+'/'+_0x371d50)[_0xf968('0x1b')](_0xe5cc0c);}return null;};}function patchUpdates(_0x4f0412){return function(_0x21fb00){try{jsonpatch[_0xf968('0x22')](_0x21fb00,_0x4f0412,!![]);}catch(_0x4792be){return BPromise[_0xf968('0x23')](_0x4792be);}return _0x21fb00[_0xf968('0x24')]();};}function saveUpdates(_0x2b232e,_0x40c524){return function(_0x600a40){if(_0x600a40){return _0x600a40[_0xf968('0x25')](_0x2b232e)[_0xf968('0x26')](function(_0x5efcd8){return _0x5efcd8;});}return null;};}function removeEntity(_0xfedddf,_0x28679b){return function(_0x39f5b3){if(_0x39f5b3){return _0x39f5b3[_0xf968('0x27')]()[_0xf968('0x26')](function(){_0xfedddf[_0xf968('0x1a')](0xcc)[_0xf968('0x19')]();});}};}function handleEntityNotFound(_0x3e3b37,_0x41a33b){return function(_0x1c21bc){if(!_0x1c21bc){_0x3e3b37['sendStatus'](0x194);}return _0x1c21bc;};}function handleError(_0x370fe0,_0x5887c2){_0x5887c2=_0x5887c2||0x1f4;return function(_0x1763db){logger[_0xf968('0x28')](_0x1763db[_0xf968('0x29')]);if(_0x1763db[_0xf968('0x2a')]){delete _0x1763db[_0xf968('0x2a')];}_0x370fe0[_0xf968('0x1a')](_0x5887c2)[_0xf968('0x2b')](_0x1763db);};}exports[_0xf968('0x2c')]=function(_0x373520,_0x331474){var _0x1af266={},_0x4b16f5={},_0x24a2f5={'count':0x0,'rows':[]};var _0x4e82a0=_[_0xf968('0x2d')](db[_0xf968('0x2e')][_0xf968('0x2f')],function(_0xeede48){return{'name':_0xeede48[_0xf968('0x30')],'type':_0xeede48['type'][_0xf968('0x31')]};});_0x4b16f5[_0xf968('0x32')]=_['map'](_0x4e82a0,_0xf968('0x2a'));_0x4b16f5[_0xf968('0x33')]=_['keys'](_0x373520[_0xf968('0x33')]);_0x4b16f5[_0xf968('0x34')]=_[_0xf968('0x35')](_0x4b16f5['model'],_0x4b16f5[_0xf968('0x33')]);_0x1af266[_0xf968('0x36')]=_['intersection'](_0x4b16f5[_0xf968('0x32')],qs[_0xf968('0x37')](_0x373520['query']['fields']));_0x1af266[_0xf968('0x36')]=_0x1af266[_0xf968('0x36')]['length']?_0x1af266[_0xf968('0x36')]:_0x4b16f5[_0xf968('0x32')];if(!_0x373520[_0xf968('0x33')][_0xf968('0x38')]('nolimit')){_0x1af266[_0xf968('0x1e')]=qs[_0xf968('0x1e')](_0x373520[_0xf968('0x33')][_0xf968('0x1e')]);_0x1af266[_0xf968('0x1c')]=qs[_0xf968('0x1c')](_0x373520[_0xf968('0x33')]['offset']);}_0x1af266['order']=qs['sort'](_0x373520['query'][_0xf968('0x39')]);_0x1af266[_0xf968('0x3a')]=qs[_0xf968('0x34')](_['pick'](_0x373520[_0xf968('0x33')],_0x4b16f5[_0xf968('0x34')]),_0x4e82a0);if(_0x373520[_0xf968('0x33')][_0xf968('0x3b')]){_0x1af266['where']=_['merge'](_0x1af266[_0xf968('0x3a')],{'$or':_['map'](_0x4e82a0,function(_0x4022ca){if(_0x4022ca[_0xf968('0x3c')]!==_0xf968('0x3d')){var _0x10c9de={};_0x10c9de[_0x4022ca[_0xf968('0x2a')]]={'$like':'%'+_0x373520[_0xf968('0x33')][_0xf968('0x3b')]+'%'};return _0x10c9de;}})});}_0x1af266=_['merge']({},_0x1af266,_0x373520[_0xf968('0x3e')]);var _0x1a1f59={'where':_0x1af266[_0xf968('0x3a')]};return db[_0xf968('0x2e')]['count'](_0x1a1f59)[_0xf968('0x26')](function(_0x53a379){_0x24a2f5[_0xf968('0x1f')]=_0x53a379;if(_0x373520[_0xf968('0x33')][_0xf968('0x3f')]){_0x1af266[_0xf968('0x40')]=[{'all':!![]}];}return db[_0xf968('0x2e')][_0xf968('0x41')](_0x1af266);})['then'](function(_0x5cad4c){_0x24a2f5[_0xf968('0x42')]=_0x5cad4c;return _0x24a2f5;})['then'](respondWithFilteredResult(_0x331474,_0x1af266))[_0xf968('0x43')](handleError(_0x331474,null));};exports[_0xf968('0x44')]=function(_0x34a4cc,_0x5b1e2b){var _0x278a48={'raw':![],'where':{'id':_0x34a4cc[_0xf968('0x45')]['id']}},_0x47c1dd={};_0x47c1dd[_0xf968('0x32')]=_[_0xf968('0x46')](db[_0xf968('0x2e')][_0xf968('0x2f')]);_0x47c1dd[_0xf968('0x33')]=_['keys'](_0x34a4cc[_0xf968('0x33')]);_0x47c1dd[_0xf968('0x34')]=_['intersection'](_0x47c1dd[_0xf968('0x32')],_0x47c1dd[_0xf968('0x33')]);_0x278a48[_0xf968('0x36')]=_[_0xf968('0x35')](_0x47c1dd[_0xf968('0x32')],qs[_0xf968('0x37')](_0x34a4cc[_0xf968('0x33')][_0xf968('0x37')]));_0x278a48[_0xf968('0x36')]=_0x278a48[_0xf968('0x36')][_0xf968('0x47')]?_0x278a48[_0xf968('0x36')]:_0x47c1dd[_0xf968('0x32')];if(_0x34a4cc[_0xf968('0x33')]['includeAll']){_0x278a48[_0xf968('0x40')]=[{'all':!![]}];}_0x278a48=_[_0xf968('0x48')]({},_0x278a48,_0x34a4cc[_0xf968('0x3e')]);return db[_0xf968('0x2e')][_0xf968('0x49')](_0x278a48)[_0xf968('0x26')](handleEntityNotFound(_0x5b1e2b,null))[_0xf968('0x26')](respondWithResult(_0x5b1e2b,null))['catch'](handleError(_0x5b1e2b,null));};exports['create']=function(_0x402034,_0x250cfc){return db['ZohoConfiguration'][_0xf968('0x4a')](_0x402034[_0xf968('0x4b')],{})[_0xf968('0x26')](respondWithResult(_0x250cfc,0xc9))['catch'](handleError(_0x250cfc,null));};exports['update']=function(_0x2bac49,_0x3ae505){if(_0x2bac49[_0xf968('0x4b')]['id']){delete _0x2bac49[_0xf968('0x4b')]['id'];}return db[_0xf968('0x2e')][_0xf968('0x49')]({'where':{'id':_0x2bac49[_0xf968('0x45')]['id']}})[_0xf968('0x26')](handleEntityNotFound(_0x3ae505,null))[_0xf968('0x26')](saveUpdates(_0x2bac49[_0xf968('0x4b')],null))['then'](respondWithResult(_0x3ae505,null))[_0xf968('0x43')](handleError(_0x3ae505,null));};exports[_0xf968('0x27')]=function(_0x247372,_0x24e93e){return db[_0xf968('0x2e')]['find']({'where':{'id':_0x247372[_0xf968('0x45')]['id']}})[_0xf968('0x26')](handleEntityNotFound(_0x24e93e,null))['then'](removeEntity(_0x24e93e,null))[_0xf968('0x43')](handleError(_0x24e93e,null));};exports['getFields']=function(_0x5a3650,_0x2d171c,_0x4382a0){var _0x4c9c84={};var _0x4eac98={};var _0x842d78;var _0x2cc0b0;return db[_0xf968('0x2e')][_0xf968('0x4c')]({'where':{'id':_0x5a3650[_0xf968('0x45')]['id']}})['then'](handleEntityNotFound(_0x2d171c,null))['then'](function(_0x53e31b){if(_0x53e31b){_0x842d78=_0x53e31b;_0x4eac98[_0xf968('0x32')]=_[_0xf968('0x46')](db[_0xf968('0x4d')][_0xf968('0x2f')]);_0x4eac98[_0xf968('0x33')]=_[_0xf968('0x46')](_0x5a3650['query']);_0x4eac98['filters']=_[_0xf968('0x35')](_0x4eac98['model'],_0x4eac98[_0xf968('0x33')]);_0x4c9c84['attributes']=_['intersection'](_0x4eac98[_0xf968('0x32')],qs[_0xf968('0x37')](_0x5a3650[_0xf968('0x33')][_0xf968('0x37')]));_0x4c9c84[_0xf968('0x36')]=_0x4c9c84[_0xf968('0x36')][_0xf968('0x47')]?_0x4c9c84['attributes']:_0x4eac98[_0xf968('0x32')];_0x4c9c84[_0xf968('0x4e')]=qs['sort'](_0x5a3650[_0xf968('0x33')][_0xf968('0x39')]);_0x4c9c84[_0xf968('0x3a')]=qs[_0xf968('0x34')](_[_0xf968('0x4f')](_0x5a3650[_0xf968('0x33')],_0x4eac98[_0xf968('0x34')]));if(_0x5a3650[_0xf968('0x33')][_0xf968('0x3b')]){_0x4c9c84[_0xf968('0x3a')]=_[_0xf968('0x48')](_0x4c9c84[_0xf968('0x3a')],{'$or':_[_0xf968('0x2d')](_0x4c9c84['attributes'],function(_0x37c283){var _0x2cbca2={};_0x2cbca2[_0x37c283]={'$like':'%'+_0x5a3650[_0xf968('0x33')][_0xf968('0x3b')]+'%'};return _0x2cbca2;})});}_0x4c9c84=_[_0xf968('0x48')]({},_0x4c9c84,_0x5a3650[_0xf968('0x3e')]);return _0x842d78['getFields'](_0x4c9c84);}})[_0xf968('0x26')](function(_0x2e5edc){if(_0x2e5edc){_0x2cc0b0=_0x2e5edc[_0xf968('0x47')];if(!_0x5a3650[_0xf968('0x33')][_0xf968('0x38')](_0xf968('0x50'))){_0x4c9c84['limit']=qs[_0xf968('0x1e')](_0x5a3650[_0xf968('0x33')]['limit']);_0x4c9c84[_0xf968('0x1c')]=qs[_0xf968('0x1c')](_0x5a3650['query']['offset']);}return _0x842d78['getFields'](_0x4c9c84);}})['then'](function(_0x572a51){if(_0x572a51){return _0x572a51?{'count':_0x2cc0b0,'rows':_0x572a51}:null;}})['then'](respondWithResult(_0x2d171c,null))['catch'](handleError(_0x2d171c,null));};exports[_0xf968('0x51')]=function(_0x1e9d8e,_0x3b21a5,_0x2c8d07){var _0x1c72c1={};var _0x7ce80d={};var _0x59b0ab;var _0x1ad45a;return db['ZohoConfiguration'][_0xf968('0x4c')]({'where':{'id':_0x1e9d8e[_0xf968('0x45')]['id']}})[_0xf968('0x26')](handleEntityNotFound(_0x3b21a5,null))['then'](function(_0x940840){if(_0x940840){_0x59b0ab=_0x940840;_0x7ce80d[_0xf968('0x32')]=_[_0xf968('0x46')](db[_0xf968('0x4d')]['rawAttributes']);_0x7ce80d[_0xf968('0x33')]=_[_0xf968('0x46')](_0x1e9d8e[_0xf968('0x33')]);_0x7ce80d[_0xf968('0x34')]=_[_0xf968('0x35')](_0x7ce80d['model'],_0x7ce80d[_0xf968('0x33')]);_0x1c72c1[_0xf968('0x36')]=_['intersection'](_0x7ce80d['model'],qs[_0xf968('0x37')](_0x1e9d8e['query'][_0xf968('0x37')]));_0x1c72c1[_0xf968('0x36')]=_0x1c72c1['attributes']['length']?_0x1c72c1[_0xf968('0x36')]:_0x7ce80d[_0xf968('0x32')];_0x1c72c1[_0xf968('0x4e')]=qs['sort'](_0x1e9d8e['query'][_0xf968('0x39')]);_0x1c72c1['where']=qs[_0xf968('0x34')](_[_0xf968('0x4f')](_0x1e9d8e['query'],_0x7ce80d[_0xf968('0x34')]));if(_0x1e9d8e['query'][_0xf968('0x3b')]){_0x1c72c1[_0xf968('0x3a')]=_['merge'](_0x1c72c1['where'],{'$or':_[_0xf968('0x2d')](_0x1c72c1['attributes'],function(_0x198be0){var _0x46e1f3={};_0x46e1f3[_0x198be0]={'$like':'%'+_0x1e9d8e[_0xf968('0x33')][_0xf968('0x3b')]+'%'};return _0x46e1f3;})});}_0x1c72c1=_['merge']({},_0x1c72c1,_0x1e9d8e[_0xf968('0x3e')]);return _0x59b0ab['getSubjects'](_0x1c72c1);}})['then'](function(_0x4020b7){if(_0x4020b7){_0x1ad45a=_0x4020b7[_0xf968('0x47')];if(!_0x1e9d8e[_0xf968('0x33')]['hasOwnProperty']('nolimit')){_0x1c72c1['limit']=qs['limit'](_0x1e9d8e[_0xf968('0x33')][_0xf968('0x1e')]);_0x1c72c1['offset']=qs['offset'](_0x1e9d8e[_0xf968('0x33')][_0xf968('0x1c')]);}return _0x59b0ab[_0xf968('0x51')](_0x1c72c1);}})[_0xf968('0x26')](function(_0x26ad71){if(_0x26ad71){return _0x26ad71?{'count':_0x1ad45a,'rows':_0x26ad71}:null;}})[_0xf968('0x26')](respondWithResult(_0x3b21a5,null))[_0xf968('0x43')](handleError(_0x3b21a5,null));};exports[_0xf968('0x52')]=function(_0x4d8eb1,_0x2135dd,_0x10652d){var _0x22be87={};var _0x4624ca={};var _0x4fef6b;var _0x3c9bcd;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x4d8eb1[_0xf968('0x45')]['id']}})[_0xf968('0x26')](handleEntityNotFound(_0x2135dd,null))[_0xf968('0x26')](function(_0x5170db){if(_0x5170db){_0x4fef6b=_0x5170db;_0x4624ca['model']=_[_0xf968('0x46')](db[_0xf968('0x4d')][_0xf968('0x2f')]);_0x4624ca[_0xf968('0x33')]=_[_0xf968('0x46')](_0x4d8eb1[_0xf968('0x33')]);_0x4624ca[_0xf968('0x34')]=_[_0xf968('0x35')](_0x4624ca[_0xf968('0x32')],_0x4624ca['query']);_0x22be87[_0xf968('0x36')]=_['intersection'](_0x4624ca['model'],qs['fields'](_0x4d8eb1[_0xf968('0x33')][_0xf968('0x37')]));_0x22be87[_0xf968('0x36')]=_0x22be87[_0xf968('0x36')][_0xf968('0x47')]?_0x22be87[_0xf968('0x36')]:_0x4624ca['model'];_0x22be87['order']=qs['sort'](_0x4d8eb1[_0xf968('0x33')][_0xf968('0x39')]);_0x22be87[_0xf968('0x3a')]=qs[_0xf968('0x34')](_[_0xf968('0x4f')](_0x4d8eb1['query'],_0x4624ca[_0xf968('0x34')]));if(_0x4d8eb1[_0xf968('0x33')][_0xf968('0x3b')]){_0x22be87[_0xf968('0x3a')]=_['merge'](_0x22be87['where'],{'$or':_['map'](_0x22be87[_0xf968('0x36')],function(_0x40810d){var _0x16cd25={};_0x16cd25[_0x40810d]={'$like':'%'+_0x4d8eb1['query'][_0xf968('0x3b')]+'%'};return _0x16cd25;})});}_0x22be87=_[_0xf968('0x48')]({},_0x22be87,_0x4d8eb1['options']);return _0x4fef6b[_0xf968('0x52')](_0x22be87);}})[_0xf968('0x26')](function(_0x92807a){if(_0x92807a){_0x3c9bcd=_0x92807a['length'];if(!_0x4d8eb1[_0xf968('0x33')][_0xf968('0x38')]('nolimit')){_0x22be87['limit']=qs[_0xf968('0x1e')](_0x4d8eb1[_0xf968('0x33')][_0xf968('0x1e')]);_0x22be87['offset']=qs[_0xf968('0x1c')](_0x4d8eb1[_0xf968('0x33')]['offset']);}return _0x4fef6b[_0xf968('0x52')](_0x22be87);}})[_0xf968('0x26')](function(_0x276d78){if(_0x276d78){return _0x276d78?{'count':_0x3c9bcd,'rows':_0x276d78}:null;}})[_0xf968('0x26')](respondWithResult(_0x2135dd,null))['catch'](handleError(_0x2135dd,null));}; \ No newline at end of file +var _0xc6a7=['../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','name','map','ZohoConfiguration','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','merge','where','VIRTUAL','include','findAll','rows','catch','includeAll','options','create','body','find','params','getFields','findOne','filter','nolimit','ZohoField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis'];(function(_0x5d9437,_0x1e992f){var _0x4038d8=function(_0x1f8500){while(--_0x1f8500){_0x5d9437['push'](_0x5d9437['shift']());}};_0x4038d8(++_0x1e992f);}(_0xc6a7,0x124));var _0x7c6a=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0xc6a7[_0x45b034];return _0x509cb0;};'use strict';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(_0x7c6a('0x6'));var Mustache=require('mustache');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 fs_extra=require(_0x7c6a('0x8'));var _=require(_0x7c6a('0x9'));var squel=require(_0x7c6a('0xa'));var crypto=require(_0x7c6a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x7c6a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7c6a('0xd'));var Papa=require(_0x7c6a('0xe'));var Redis=require(_0x7c6a('0xf'));var authService=require(_0x7c6a('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7c6a('0x11'));var logger=require(_0x7c6a('0x12'))(_0x7c6a('0x13'));var utils=require(_0x7c6a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x7c6a('0x15'));var db=require(_0x7c6a('0x16'))['db'];function respondWithStatusCode(_0x374f89,_0x2e7891){_0x2e7891=_0x2e7891||0xcc;return function(_0x1ac0f){if(_0x1ac0f){return _0x374f89[_0x7c6a('0x17')](_0x2e7891);}return _0x374f89[_0x7c6a('0x18')](_0x2e7891)[_0x7c6a('0x19')]();};}function respondWithResult(_0x5a2fd7,_0x508154){_0x508154=_0x508154||0xc8;return function(_0x3eeb70){if(_0x3eeb70){return _0x5a2fd7[_0x7c6a('0x18')](_0x508154)[_0x7c6a('0x1a')](_0x3eeb70);}};}function respondWithFilteredResult(_0x591d00,_0x2c64f0){return function(_0x463027){if(_0x463027){var _0x3d779e=typeof _0x2c64f0[_0x7c6a('0x1b')]===_0x7c6a('0x1c')&&typeof _0x2c64f0[_0x7c6a('0x1d')]===_0x7c6a('0x1c');var _0x45e559=_0x463027[_0x7c6a('0x1e')];var _0x1daed1=_0x3d779e?0x0:_0x2c64f0[_0x7c6a('0x1b')];var _0x32fc6e=_0x3d779e?_0x463027[_0x7c6a('0x1e')]:_0x2c64f0[_0x7c6a('0x1b')]+_0x2c64f0[_0x7c6a('0x1d')];var _0x12d8dd;if(_0x32fc6e>=_0x45e559){_0x32fc6e=_0x45e559;_0x12d8dd=0xc8;}else{_0x12d8dd=0xce;}_0x591d00[_0x7c6a('0x18')](_0x12d8dd);return _0x591d00[_0x7c6a('0x1f')]('Content-Range',_0x1daed1+'-'+_0x32fc6e+'/'+_0x45e559)[_0x7c6a('0x1a')](_0x463027);}return null;};}function patchUpdates(_0x3a769d){return function(_0x4c38ed){try{jsonpatch[_0x7c6a('0x20')](_0x4c38ed,_0x3a769d,!![]);}catch(_0x2cd889){return BPromise[_0x7c6a('0x21')](_0x2cd889);}return _0x4c38ed[_0x7c6a('0x22')]();};}function saveUpdates(_0x3e3374,_0x9704f5){return function(_0x3a5751){if(_0x3a5751){return _0x3a5751[_0x7c6a('0x23')](_0x3e3374)[_0x7c6a('0x24')](function(_0x2dc6b4){return _0x2dc6b4;});}return null;};}function removeEntity(_0x2ae853,_0x198744){return function(_0x393ce1){if(_0x393ce1){return _0x393ce1[_0x7c6a('0x25')]()[_0x7c6a('0x24')](function(){_0x2ae853[_0x7c6a('0x18')](0xcc)[_0x7c6a('0x19')]();});}};}function handleEntityNotFound(_0x442872,_0x31cb40){return function(_0x3df220){if(!_0x3df220){_0x442872[_0x7c6a('0x17')](0x194);}return _0x3df220;};}function handleError(_0x5c00e8,_0x51fe6d){_0x51fe6d=_0x51fe6d||0x1f4;return function(_0x215d34){logger[_0x7c6a('0x26')](_0x215d34['stack']);if(_0x215d34[_0x7c6a('0x27')]){delete _0x215d34['name'];}_0x5c00e8[_0x7c6a('0x18')](_0x51fe6d)['send'](_0x215d34);};}exports['index']=function(_0x42b279,_0xb6e73d){var _0x3ee567={},_0xde69f3={},_0x323311={'count':0x0,'rows':[]};var _0x599479=_[_0x7c6a('0x28')](db[_0x7c6a('0x29')][_0x7c6a('0x2a')],function(_0x3656d5){return{'name':_0x3656d5[_0x7c6a('0x2b')],'type':_0x3656d5[_0x7c6a('0x2c')]['key']};});_0xde69f3[_0x7c6a('0x2d')]=_[_0x7c6a('0x28')](_0x599479,_0x7c6a('0x27'));_0xde69f3[_0x7c6a('0x2e')]=_[_0x7c6a('0x2f')](_0x42b279[_0x7c6a('0x2e')]);_0xde69f3['filters']=_[_0x7c6a('0x30')](_0xde69f3[_0x7c6a('0x2d')],_0xde69f3['query']);_0x3ee567[_0x7c6a('0x31')]=_[_0x7c6a('0x30')](_0xde69f3[_0x7c6a('0x2d')],qs[_0x7c6a('0x32')](_0x42b279[_0x7c6a('0x2e')][_0x7c6a('0x32')]));_0x3ee567[_0x7c6a('0x31')]=_0x3ee567['attributes'][_0x7c6a('0x33')]?_0x3ee567[_0x7c6a('0x31')]:_0xde69f3['model'];if(!_0x42b279[_0x7c6a('0x2e')][_0x7c6a('0x34')]('nolimit')){_0x3ee567['limit']=qs[_0x7c6a('0x1d')](_0x42b279[_0x7c6a('0x2e')][_0x7c6a('0x1d')]);_0x3ee567[_0x7c6a('0x1b')]=qs[_0x7c6a('0x1b')](_0x42b279['query'][_0x7c6a('0x1b')]);}_0x3ee567[_0x7c6a('0x35')]=qs[_0x7c6a('0x36')](_0x42b279[_0x7c6a('0x2e')][_0x7c6a('0x36')]);_0x3ee567['where']=qs[_0x7c6a('0x37')](_[_0x7c6a('0x38')](_0x42b279[_0x7c6a('0x2e')],_0xde69f3[_0x7c6a('0x37')]),_0x599479);if(_0x42b279[_0x7c6a('0x2e')]['filter']){_0x3ee567['where']=_[_0x7c6a('0x39')](_0x3ee567[_0x7c6a('0x3a')],{'$or':_[_0x7c6a('0x28')](_0x599479,function(_0x555909){if(_0x555909[_0x7c6a('0x2c')]!==_0x7c6a('0x3b')){var _0xaf6870={};_0xaf6870[_0x555909[_0x7c6a('0x27')]]={'$like':'%'+_0x42b279[_0x7c6a('0x2e')]['filter']+'%'};return _0xaf6870;}})});}_0x3ee567=_[_0x7c6a('0x39')]({},_0x3ee567,_0x42b279['options']);var _0x4d6a72={'where':_0x3ee567[_0x7c6a('0x3a')]};return db[_0x7c6a('0x29')][_0x7c6a('0x1e')](_0x4d6a72)['then'](function(_0x6c7674){_0x323311['count']=_0x6c7674;if(_0x42b279[_0x7c6a('0x2e')]['includeAll']){_0x3ee567[_0x7c6a('0x3c')]=[{'all':!![]}];}return db[_0x7c6a('0x29')][_0x7c6a('0x3d')](_0x3ee567);})[_0x7c6a('0x24')](function(_0x39e087){_0x323311[_0x7c6a('0x3e')]=_0x39e087;return _0x323311;})[_0x7c6a('0x24')](respondWithFilteredResult(_0xb6e73d,_0x3ee567))[_0x7c6a('0x3f')](handleError(_0xb6e73d,null));};exports['show']=function(_0x278551,_0xee2849){var _0x7db150={'raw':![],'where':{'id':_0x278551['params']['id']}},_0x414c2e={};_0x414c2e[_0x7c6a('0x2d')]=_[_0x7c6a('0x2f')](db[_0x7c6a('0x29')][_0x7c6a('0x2a')]);_0x414c2e[_0x7c6a('0x2e')]=_[_0x7c6a('0x2f')](_0x278551[_0x7c6a('0x2e')]);_0x414c2e[_0x7c6a('0x37')]=_[_0x7c6a('0x30')](_0x414c2e[_0x7c6a('0x2d')],_0x414c2e[_0x7c6a('0x2e')]);_0x7db150['attributes']=_[_0x7c6a('0x30')](_0x414c2e[_0x7c6a('0x2d')],qs['fields'](_0x278551['query'][_0x7c6a('0x32')]));_0x7db150['attributes']=_0x7db150['attributes'][_0x7c6a('0x33')]?_0x7db150[_0x7c6a('0x31')]:_0x414c2e[_0x7c6a('0x2d')];if(_0x278551['query'][_0x7c6a('0x40')]){_0x7db150[_0x7c6a('0x3c')]=[{'all':!![]}];}_0x7db150=_[_0x7c6a('0x39')]({},_0x7db150,_0x278551[_0x7c6a('0x41')]);return db[_0x7c6a('0x29')]['find'](_0x7db150)[_0x7c6a('0x24')](handleEntityNotFound(_0xee2849,null))[_0x7c6a('0x24')](respondWithResult(_0xee2849,null))[_0x7c6a('0x3f')](handleError(_0xee2849,null));};exports[_0x7c6a('0x42')]=function(_0x336f9a,_0x1811b4){return db[_0x7c6a('0x29')][_0x7c6a('0x42')](_0x336f9a[_0x7c6a('0x43')],{})['then'](respondWithResult(_0x1811b4,0xc9))['catch'](handleError(_0x1811b4,null));};exports[_0x7c6a('0x23')]=function(_0x5c930f,_0x314d01){if(_0x5c930f[_0x7c6a('0x43')]['id']){delete _0x5c930f[_0x7c6a('0x43')]['id'];}return db['ZohoConfiguration'][_0x7c6a('0x44')]({'where':{'id':_0x5c930f[_0x7c6a('0x45')]['id']}})['then'](handleEntityNotFound(_0x314d01,null))['then'](saveUpdates(_0x5c930f[_0x7c6a('0x43')],null))[_0x7c6a('0x24')](respondWithResult(_0x314d01,null))[_0x7c6a('0x3f')](handleError(_0x314d01,null));};exports[_0x7c6a('0x25')]=function(_0x6b301a,_0x440378){return db['ZohoConfiguration']['find']({'where':{'id':_0x6b301a[_0x7c6a('0x45')]['id']}})[_0x7c6a('0x24')](handleEntityNotFound(_0x440378,null))['then'](removeEntity(_0x440378,null))[_0x7c6a('0x3f')](handleError(_0x440378,null));};exports[_0x7c6a('0x46')]=function(_0x40b616,_0x1afdd0,_0x138789){var _0x3dc2a5={};var _0x3e0820={};var _0x482a8f;var _0x485715;return db['ZohoConfiguration'][_0x7c6a('0x47')]({'where':{'id':_0x40b616['params']['id']}})[_0x7c6a('0x24')](handleEntityNotFound(_0x1afdd0,null))[_0x7c6a('0x24')](function(_0xb156eb){if(_0xb156eb){_0x482a8f=_0xb156eb;_0x3e0820[_0x7c6a('0x2d')]=_[_0x7c6a('0x2f')](db['ZohoField'][_0x7c6a('0x2a')]);_0x3e0820[_0x7c6a('0x2e')]=_[_0x7c6a('0x2f')](_0x40b616[_0x7c6a('0x2e')]);_0x3e0820['filters']=_[_0x7c6a('0x30')](_0x3e0820[_0x7c6a('0x2d')],_0x3e0820[_0x7c6a('0x2e')]);_0x3dc2a5['attributes']=_[_0x7c6a('0x30')](_0x3e0820[_0x7c6a('0x2d')],qs[_0x7c6a('0x32')](_0x40b616[_0x7c6a('0x2e')][_0x7c6a('0x32')]));_0x3dc2a5[_0x7c6a('0x31')]=_0x3dc2a5[_0x7c6a('0x31')][_0x7c6a('0x33')]?_0x3dc2a5[_0x7c6a('0x31')]:_0x3e0820[_0x7c6a('0x2d')];_0x3dc2a5['order']=qs[_0x7c6a('0x36')](_0x40b616[_0x7c6a('0x2e')][_0x7c6a('0x36')]);_0x3dc2a5[_0x7c6a('0x3a')]=qs[_0x7c6a('0x37')](_[_0x7c6a('0x38')](_0x40b616['query'],_0x3e0820['filters']));if(_0x40b616['query'][_0x7c6a('0x48')]){_0x3dc2a5['where']=_[_0x7c6a('0x39')](_0x3dc2a5[_0x7c6a('0x3a')],{'$or':_[_0x7c6a('0x28')](_0x3dc2a5[_0x7c6a('0x31')],function(_0x544a96){var _0x18622c={};_0x18622c[_0x544a96]={'$like':'%'+_0x40b616[_0x7c6a('0x2e')]['filter']+'%'};return _0x18622c;})});}_0x3dc2a5=_[_0x7c6a('0x39')]({},_0x3dc2a5,_0x40b616[_0x7c6a('0x41')]);return _0x482a8f['getFields'](_0x3dc2a5);}})[_0x7c6a('0x24')](function(_0x2f3b85){if(_0x2f3b85){_0x485715=_0x2f3b85[_0x7c6a('0x33')];if(!_0x40b616['query'][_0x7c6a('0x34')](_0x7c6a('0x49'))){_0x3dc2a5['limit']=qs[_0x7c6a('0x1d')](_0x40b616[_0x7c6a('0x2e')]['limit']);_0x3dc2a5[_0x7c6a('0x1b')]=qs[_0x7c6a('0x1b')](_0x40b616['query'][_0x7c6a('0x1b')]);}return _0x482a8f[_0x7c6a('0x46')](_0x3dc2a5);}})[_0x7c6a('0x24')](function(_0x259839){if(_0x259839){return _0x259839?{'count':_0x485715,'rows':_0x259839}:null;}})[_0x7c6a('0x24')](respondWithResult(_0x1afdd0,null))[_0x7c6a('0x3f')](handleError(_0x1afdd0,null));};exports['getSubjects']=function(_0x2a120d,_0x13f7d5,_0x271115){var _0x41ecaf={};var _0x45782f={};var _0x2b3e7f;var _0x4d74a2;return db[_0x7c6a('0x29')][_0x7c6a('0x47')]({'where':{'id':_0x2a120d[_0x7c6a('0x45')]['id']}})[_0x7c6a('0x24')](handleEntityNotFound(_0x13f7d5,null))[_0x7c6a('0x24')](function(_0xe8d360){if(_0xe8d360){_0x2b3e7f=_0xe8d360;_0x45782f[_0x7c6a('0x2d')]=_[_0x7c6a('0x2f')](db[_0x7c6a('0x4a')][_0x7c6a('0x2a')]);_0x45782f[_0x7c6a('0x2e')]=_[_0x7c6a('0x2f')](_0x2a120d[_0x7c6a('0x2e')]);_0x45782f[_0x7c6a('0x37')]=_[_0x7c6a('0x30')](_0x45782f['model'],_0x45782f['query']);_0x41ecaf[_0x7c6a('0x31')]=_['intersection'](_0x45782f[_0x7c6a('0x2d')],qs['fields'](_0x2a120d[_0x7c6a('0x2e')][_0x7c6a('0x32')]));_0x41ecaf[_0x7c6a('0x31')]=_0x41ecaf[_0x7c6a('0x31')][_0x7c6a('0x33')]?_0x41ecaf['attributes']:_0x45782f[_0x7c6a('0x2d')];_0x41ecaf[_0x7c6a('0x35')]=qs[_0x7c6a('0x36')](_0x2a120d[_0x7c6a('0x2e')][_0x7c6a('0x36')]);_0x41ecaf[_0x7c6a('0x3a')]=qs['filters'](_[_0x7c6a('0x38')](_0x2a120d['query'],_0x45782f[_0x7c6a('0x37')]));if(_0x2a120d['query']['filter']){_0x41ecaf['where']=_[_0x7c6a('0x39')](_0x41ecaf[_0x7c6a('0x3a')],{'$or':_[_0x7c6a('0x28')](_0x41ecaf[_0x7c6a('0x31')],function(_0x1948f2){var _0x1f6b6c={};_0x1f6b6c[_0x1948f2]={'$like':'%'+_0x2a120d[_0x7c6a('0x2e')][_0x7c6a('0x48')]+'%'};return _0x1f6b6c;})});}_0x41ecaf=_[_0x7c6a('0x39')]({},_0x41ecaf,_0x2a120d[_0x7c6a('0x41')]);return _0x2b3e7f['getSubjects'](_0x41ecaf);}})['then'](function(_0xebf228){if(_0xebf228){_0x4d74a2=_0xebf228[_0x7c6a('0x33')];if(!_0x2a120d[_0x7c6a('0x2e')][_0x7c6a('0x34')](_0x7c6a('0x49'))){_0x41ecaf['limit']=qs[_0x7c6a('0x1d')](_0x2a120d['query']['limit']);_0x41ecaf[_0x7c6a('0x1b')]=qs[_0x7c6a('0x1b')](_0x2a120d['query']['offset']);}return _0x2b3e7f[_0x7c6a('0x4b')](_0x41ecaf);}})[_0x7c6a('0x24')](function(_0x136483){if(_0x136483){return _0x136483?{'count':_0x4d74a2,'rows':_0x136483}:null;}})[_0x7c6a('0x24')](respondWithResult(_0x13f7d5,null))[_0x7c6a('0x3f')](handleError(_0x13f7d5,null));};exports[_0x7c6a('0x4c')]=function(_0x5e1654,_0x3b2104,_0x287e29){var _0x34498b={};var _0xfcc7c2={};var _0x36cb1e;var _0x349bc0;return db[_0x7c6a('0x29')][_0x7c6a('0x47')]({'where':{'id':_0x5e1654['params']['id']}})['then'](handleEntityNotFound(_0x3b2104,null))[_0x7c6a('0x24')](function(_0xa19554){if(_0xa19554){_0x36cb1e=_0xa19554;_0xfcc7c2[_0x7c6a('0x2d')]=_[_0x7c6a('0x2f')](db['ZohoField']['rawAttributes']);_0xfcc7c2[_0x7c6a('0x2e')]=_[_0x7c6a('0x2f')](_0x5e1654[_0x7c6a('0x2e')]);_0xfcc7c2[_0x7c6a('0x37')]=_[_0x7c6a('0x30')](_0xfcc7c2[_0x7c6a('0x2d')],_0xfcc7c2[_0x7c6a('0x2e')]);_0x34498b[_0x7c6a('0x31')]=_['intersection'](_0xfcc7c2[_0x7c6a('0x2d')],qs['fields'](_0x5e1654[_0x7c6a('0x2e')][_0x7c6a('0x32')]));_0x34498b[_0x7c6a('0x31')]=_0x34498b['attributes']['length']?_0x34498b['attributes']:_0xfcc7c2['model'];_0x34498b[_0x7c6a('0x35')]=qs[_0x7c6a('0x36')](_0x5e1654[_0x7c6a('0x2e')][_0x7c6a('0x36')]);_0x34498b[_0x7c6a('0x3a')]=qs[_0x7c6a('0x37')](_['pick'](_0x5e1654[_0x7c6a('0x2e')],_0xfcc7c2['filters']));if(_0x5e1654['query'][_0x7c6a('0x48')]){_0x34498b[_0x7c6a('0x3a')]=_[_0x7c6a('0x39')](_0x34498b[_0x7c6a('0x3a')],{'$or':_[_0x7c6a('0x28')](_0x34498b['attributes'],function(_0x45cbac){var _0x1b84f0={};_0x1b84f0[_0x45cbac]={'$like':'%'+_0x5e1654[_0x7c6a('0x2e')][_0x7c6a('0x48')]+'%'};return _0x1b84f0;})});}_0x34498b=_['merge']({},_0x34498b,_0x5e1654[_0x7c6a('0x41')]);return _0x36cb1e[_0x7c6a('0x4c')](_0x34498b);}})[_0x7c6a('0x24')](function(_0x5bb7c9){if(_0x5bb7c9){_0x349bc0=_0x5bb7c9['length'];if(!_0x5e1654[_0x7c6a('0x2e')][_0x7c6a('0x34')]('nolimit')){_0x34498b['limit']=qs[_0x7c6a('0x1d')](_0x5e1654[_0x7c6a('0x2e')][_0x7c6a('0x1d')]);_0x34498b[_0x7c6a('0x1b')]=qs['offset'](_0x5e1654[_0x7c6a('0x2e')][_0x7c6a('0x1b')]);}return _0x36cb1e['getDescriptions'](_0x34498b);}})[_0x7c6a('0x24')](function(_0x432eff){if(_0x432eff){return _0x432eff?{'count':_0x349bc0,'rows':_0x432eff}:null;}})[_0x7c6a('0x24')](respondWithResult(_0x3b2104,null))[_0x7c6a('0x3f')](handleError(_0x3b2104,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 6d7bc46..b7700ec 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 _0x74c0=['exports','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','moment','request-promise','path','rimraf','./intZohoConfiguration.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x74c0,0x1ed));var _0x074c=function(_0x38e870,_0x3d2e6a){_0x38e870=_0x38e870-0x0;var _0x2dabbe=_0x74c0[_0x38e870];return _0x2dabbe;};'use strict';var _=require(_0x074c('0x0'));var util=require('util');var logger=require(_0x074c('0x1'))('api');var moment=require(_0x074c('0x2'));var BPromise=require('bluebird');var rp=require(_0x074c('0x3'));var fs=require('fs');var path=require(_0x074c('0x4'));var rimraf=require(_0x074c('0x5'));var config=require('../../config/environment');var attributes=require(_0x074c('0x6'));module[_0x074c('0x7')]=function(_0x186363,_0x2d3073){return _0x186363['define'](_0x074c('0x8'),attributes,{'tableName':_0x074c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4a81=['../../config/environment','exports','ZohoConfiguration','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0x4a81,0x137));var _0x14a8=function(_0xa99e39,_0x56c5e5){_0xa99e39=_0xa99e39-0x0;var _0x12400b=_0x4a81[_0xa99e39];return _0x12400b;};'use strict';var _=require(_0x14a8('0x0'));var util=require('util');var logger=require(_0x14a8('0x1'))(_0x14a8('0x2'));var moment=require(_0x14a8('0x3'));var BPromise=require(_0x14a8('0x4'));var rp=require(_0x14a8('0x5'));var fs=require('fs');var path=require(_0x14a8('0x6'));var rimraf=require(_0x14a8('0x7'));var config=require(_0x14a8('0x8'));var attributes=require('./intZohoConfiguration.attributes');module[_0x14a8('0x9')]=function(_0x7ed6b,_0x5377b8){return _0x7ed6b['define'](_0x14a8('0xa'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 56bb626..a538739 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 _0xf35d=['lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch'];(function(_0xc71aad,_0x3b6646){var _0x183565=function(_0x3a56d0){while(--_0x3a56d0){_0xc71aad['push'](_0xc71aad['shift']());}};_0x183565(++_0x3b6646);}(_0xf35d,0xfd));var _0xdf35=function(_0x5df893,_0x224811){_0x5df893=_0x5df893-0x0;var _0x4f6a21=_0xf35d[_0x5df893];return _0x4f6a21;};'use strict';var _=require(_0xdf35('0x0'));var util=require('util');var moment=require(_0xdf35('0x1'));var BPromise=require(_0xdf35('0x2'));var rs=require(_0xdf35('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdf35('0x4'))['db'];var utils=require(_0xdf35('0x5'));var logger=require(_0xdf35('0x6'))(_0xdf35('0x7'));var config=require('../../config/environment');var jayson=require(_0xdf35('0x8'));var client=jayson[_0xdf35('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b797e,_0x101c3c,_0x2a07ab){return new BPromise(function(_0x41d9d3,_0x43a70e){return client[_0xdf35('0xa')](_0x1b797e,_0x2a07ab)[_0xdf35('0xb')](function(_0x3a37ed){logger['info'](_0xdf35('0xc'),_0x101c3c,'request\x20sent');logger[_0xdf35('0xd')](_0xdf35('0xe'),_0x101c3c,'request\x20sent',JSON[_0xdf35('0xf')](_0x3a37ed));if(_0x3a37ed['error']){if(_0x3a37ed[_0xdf35('0x10')][_0xdf35('0x11')]===0x1f4){logger[_0xdf35('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x101c3c,_0x3a37ed[_0xdf35('0x10')]['message']);return _0x43a70e(_0x3a37ed[_0xdf35('0x10')][_0xdf35('0x12')]);}logger[_0xdf35('0x10')](_0xdf35('0xc'),_0x101c3c,_0x3a37ed[_0xdf35('0x10')][_0xdf35('0x12')]);return _0x41d9d3(_0x3a37ed['error']['message']);}else{logger[_0xdf35('0x13')](_0xdf35('0xc'),_0x101c3c,_0xdf35('0x14'));_0x41d9d3(_0x3a37ed[_0xdf35('0x15')][_0xdf35('0x12')]);}})[_0xdf35('0x16')](function(_0x4363a5){logger[_0xdf35('0x10')]('ZohoConfiguration,\x20%s,\x20%s',_0x101c3c,_0x4363a5);_0x43a70e(_0x4363a5);});});} \ No newline at end of file +var _0x40b9=['http','request','info','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','ZohoConfiguration,\x20%s,\x20%s','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x1b85d7,_0x50e142){var _0x1c8a12=function(_0x216237){while(--_0x216237){_0x1b85d7['push'](_0x1b85d7['shift']());}};_0x1c8a12(++_0x50e142);}(_0x40b9,0xdc));var _0x940b=function(_0x10230f,_0xcaecbe){_0x10230f=_0x10230f-0x0;var _0x4a5d3e=_0x40b9[_0x10230f];return _0x4a5d3e;};'use strict';var _=require('lodash');var util=require(_0x940b('0x0'));var moment=require('moment');var BPromise=require(_0x940b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x940b('0x2'));var db=require(_0x940b('0x3'))['db'];var utils=require(_0x940b('0x4'));var logger=require(_0x940b('0x5'))('rpc');var config=require(_0x940b('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x940b('0x7')][_0x940b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x52672c,_0x40d3f2,_0xeca919){return new BPromise(function(_0x32bed8,_0x2fa12b){return client[_0x940b('0x9')](_0x52672c,_0xeca919)['then'](function(_0x229510){logger[_0x940b('0xa')]('ZohoConfiguration,\x20%s,\x20%s',_0x40d3f2,_0x940b('0xb'));logger[_0x940b('0xc')](_0x940b('0xd'),_0x40d3f2,'request\x20sent',JSON['stringify'](_0x229510));if(_0x229510[_0x940b('0xe')]){if(_0x229510[_0x940b('0xe')]['code']===0x1f4){logger['error'](_0x940b('0xf'),_0x40d3f2,_0x229510['error'][_0x940b('0x10')]);return _0x2fa12b(_0x229510[_0x940b('0xe')][_0x940b('0x10')]);}logger[_0x940b('0xe')](_0x940b('0xf'),_0x40d3f2,_0x229510[_0x940b('0xe')]['message']);return _0x32bed8(_0x229510[_0x940b('0xe')][_0x940b('0x10')]);}else{logger['info'](_0x940b('0xf'),_0x40d3f2,_0x940b('0xb'));_0x32bed8(_0x229510[_0x940b('0x11')][_0x940b('0x10')]);}})[_0x940b('0x12')](function(_0x483963){logger[_0x940b('0xe')](_0x940b('0xf'),_0x40d3f2,_0x483963);_0x2fa12b(_0x483963);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 0d5b91e..9933ba2 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 _0xf6f4=['./intZohoField.controller','isAuthenticated','index','get','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x4f8e27,_0xc63503){var _0x34f479=function(_0x3ff982){while(--_0x3ff982){_0x4f8e27['push'](_0x4f8e27['shift']());}};_0x34f479(++_0xc63503);}(_0xf6f4,0x16e));var _0x4f6f=function(_0x5d5c9f,_0x816f20){_0x5d5c9f=_0x5d5c9f-0x0;var _0xc43d43=_0xf6f4[_0x5d5c9f];return _0xc43d43;};'use strict';var multer=require(_0x4f6f('0x0'));var util=require(_0x4f6f('0x1'));var path=require(_0x4f6f('0x2'));var timeout=require(_0x4f6f('0x3'));var express=require(_0x4f6f('0x4'));var router=express[_0x4f6f('0x5')]();var fs_extra=require(_0x4f6f('0x6'));var auth=require(_0x4f6f('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4f6f('0x8'));router['get']('/',auth[_0x4f6f('0x9')](),controller[_0x4f6f('0xa')]);router[_0x4f6f('0xb')](_0x4f6f('0xc'),auth[_0x4f6f('0x9')](),controller['show']);router['post']('/',auth[_0x4f6f('0x9')](),controller['create']);router['put']('/:id',auth[_0x4f6f('0x9')](),controller[_0x4f6f('0xd')]);router[_0x4f6f('0xe')](_0x4f6f('0xc'),auth[_0x4f6f('0x9')](),controller[_0x4f6f('0xf')]);module[_0x4f6f('0x10')]=router; \ No newline at end of file +var _0xa4e7=['isAuthenticated','index','get','/:id','post','create','put','delete','destroy','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoField.controller'];(function(_0x586e77,_0x48a175){var _0x1a752b=function(_0x3ecb53){while(--_0x3ecb53){_0x586e77['push'](_0x586e77['shift']());}};_0x1a752b(++_0x48a175);}(_0xa4e7,0x17f));var _0x7a4e=function(_0x1d5c4e,_0x1fdb36){_0x1d5c4e=_0x1d5c4e-0x0;var _0x2b3631=_0xa4e7[_0x1d5c4e];return _0x2b3631;};'use strict';var multer=require(_0x7a4e('0x0'));var util=require(_0x7a4e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7a4e('0x2'));var router=express[_0x7a4e('0x3')]();var fs_extra=require(_0x7a4e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7a4e('0x5'));var config=require(_0x7a4e('0x6'));var controller=require(_0x7a4e('0x7'));router['get']('/',auth[_0x7a4e('0x8')](),controller[_0x7a4e('0x9')]);router[_0x7a4e('0xa')](_0x7a4e('0xb'),auth[_0x7a4e('0x8')](),controller['show']);router[_0x7a4e('0xc')]('/',auth[_0x7a4e('0x8')](),controller[_0x7a4e('0xd')]);router[_0x7a4e('0xe')](_0x7a4e('0xb'),auth[_0x7a4e('0x8')](),controller['update']);router[_0x7a4e('0xf')]('/:id',auth[_0x7a4e('0x8')](),controller[_0x7a4e('0x10')]);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 4b86905..6e1b3d1 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 _0x3242=['string','variable','customVariable','keyValue','STRING','sequelize','ENUM'];(function(_0x40cfda,_0x22266e){var _0x2c840e=function(_0x25f8bf){while(--_0x25f8bf){_0x40cfda['push'](_0x40cfda['shift']());}};_0x2c840e(++_0x22266e);}(_0x3242,0x1b0));var _0x2324=function(_0x3a88a2,_0x4d1357){_0x3a88a2=_0x3a88a2-0x0;var _0x10fb3b=_0x3242[_0x3a88a2];return _0x10fb3b;};'use strict';var Sequelize=require(_0x2324('0x0'));module['exports']={'type':{'type':Sequelize[_0x2324('0x1')](_0x2324('0x2'),_0x2324('0x3'),_0x2324('0x4'),_0x2324('0x5'),'picklist'),'defaultValue':_0x2324('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x2324('0x1')](_0x2324('0x2'),'variable',_0x2324('0x4'))},'keyContent':{'type':Sequelize[_0x2324('0x6')]},'idField':{'type':Sequelize[_0x2324('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2324('0x6')]}}; \ No newline at end of file +var _0x9408=['BOOLEAN','sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable'];(function(_0x422b75,_0x598da1){var _0x3e6194=function(_0xa4daad){while(--_0xa4daad){_0x422b75['push'](_0x422b75['shift']());}};_0x3e6194(++_0x598da1);}(_0x9408,0x1eb));var _0x8940=function(_0xd41070,_0x32229d){_0xd41070=_0xd41070-0x0;var _0xbd475=_0x9408[_0xd41070];return _0xbd475;};'use strict';var Sequelize=require(_0x8940('0x0'));module[_0x8940('0x1')]={'type':{'type':Sequelize[_0x8940('0x2')](_0x8940('0x3'),'variable',_0x8940('0x4'),_0x8940('0x5'),_0x8940('0x6')),'defaultValue':_0x8940('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8940('0x7')]},'keyType':{'type':Sequelize[_0x8940('0x2')](_0x8940('0x3'),_0x8940('0x8'),_0x8940('0x4'))},'keyContent':{'type':Sequelize[_0x8940('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x8940('0x7')]},'customField':{'type':Sequelize[_0x8940('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index f6b22ab..b2b18f6 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 _0x9ff8=['count','set','reject','update','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','order','pick','where','VIRTUAL','filter','merge','options','ZohoField','then','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined'];(function(_0x1a6da6,_0x5cc397){var _0x56ed97=function(_0x237167){while(--_0x237167){_0x1a6da6['push'](_0x1a6da6['shift']());}};_0x56ed97(++_0x5cc397);}(_0x9ff8,0x74));var _0x89ff=function(_0x345ddb,_0x4f3689){_0x345ddb=_0x345ddb-0x0;var _0x2d3bc8=_0x9ff8[_0x345ddb];return _0x2d3bc8;};'use strict';var emlformat=require(_0x89ff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x89ff('0x1'));var jsonpatch=require(_0x89ff('0x2'));var rp=require(_0x89ff('0x3'));var moment=require(_0x89ff('0x4'));var BPromise=require(_0x89ff('0x5'));var Mustache=require('mustache');var util=require(_0x89ff('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x89ff('0x7'));var fs=require('fs');var fs_extra=require(_0x89ff('0x8'));var _=require('lodash');var squel=require(_0x89ff('0x9'));var crypto=require(_0x89ff('0xa'));var jsforce=require(_0x89ff('0xb'));var deskjs=require(_0x89ff('0xc'));var toCsv=require(_0x89ff('0xd'));var querystring=require(_0x89ff('0xe'));var Papa=require(_0x89ff('0xf'));var Redis=require(_0x89ff('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x89ff('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x89ff('0x12'));var logger=require('../../config/logger')(_0x89ff('0x13'));var utils=require(_0x89ff('0x14'));var config=require(_0x89ff('0x15'));var licenseUtil=require(_0x89ff('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bff5e,_0x129685){_0x129685=_0x129685||0xcc;return function(_0x54a456){if(_0x54a456){return _0x1bff5e[_0x89ff('0x17')](_0x129685);}return _0x1bff5e[_0x89ff('0x18')](_0x129685)[_0x89ff('0x19')]();};}function respondWithResult(_0x1aa2ad,_0x3867f8){_0x3867f8=_0x3867f8||0xc8;return function(_0x52b1c6){if(_0x52b1c6){return _0x1aa2ad[_0x89ff('0x18')](_0x3867f8)[_0x89ff('0x1a')](_0x52b1c6);}};}function respondWithFilteredResult(_0x50a7ae,_0x58fe06){return function(_0x107424){if(_0x107424){var _0x23d0e8=typeof _0x58fe06[_0x89ff('0x1b')]==='undefined'&&typeof _0x58fe06[_0x89ff('0x1c')]===_0x89ff('0x1d');var _0x1e8602=_0x107424[_0x89ff('0x1e')];var _0x2a21cb=_0x23d0e8?0x0:_0x58fe06[_0x89ff('0x1b')];var _0x6c747c=_0x23d0e8?_0x107424[_0x89ff('0x1e')]:_0x58fe06[_0x89ff('0x1b')]+_0x58fe06['limit'];var _0x5de24f;if(_0x6c747c>=_0x1e8602){_0x6c747c=_0x1e8602;_0x5de24f=0xc8;}else{_0x5de24f=0xce;}_0x50a7ae[_0x89ff('0x18')](_0x5de24f);return _0x50a7ae[_0x89ff('0x1f')]('Content-Range',_0x2a21cb+'-'+_0x6c747c+'/'+_0x1e8602)[_0x89ff('0x1a')](_0x107424);}return null;};}function patchUpdates(_0x3f0767){return function(_0x48f4c9){try{jsonpatch['apply'](_0x48f4c9,_0x3f0767,!![]);}catch(_0x1513c7){return BPromise[_0x89ff('0x20')](_0x1513c7);}return _0x48f4c9['save']();};}function saveUpdates(_0x4caae0,_0x452ca2){return function(_0x151153){if(_0x151153){return _0x151153[_0x89ff('0x21')](_0x4caae0)['then'](function(_0x822ba2){return _0x822ba2;});}return null;};}function removeEntity(_0x25d343,_0x1925df){return function(_0x5160fe){if(_0x5160fe){return _0x5160fe[_0x89ff('0x22')]()['then'](function(){_0x25d343[_0x89ff('0x18')](0xcc)[_0x89ff('0x19')]();});}};}function handleEntityNotFound(_0x1c5474,_0x3e2a11){return function(_0x55e103){if(!_0x55e103){_0x1c5474[_0x89ff('0x17')](0x194);}return _0x55e103;};}function handleError(_0x382fcf,_0xf2b7ba){_0xf2b7ba=_0xf2b7ba||0x1f4;return function(_0x326746){logger[_0x89ff('0x23')](_0x326746[_0x89ff('0x24')]);if(_0x326746[_0x89ff('0x25')]){delete _0x326746[_0x89ff('0x25')];}_0x382fcf[_0x89ff('0x18')](_0xf2b7ba)[_0x89ff('0x26')](_0x326746);};}exports[_0x89ff('0x27')]=function(_0x4a8ca3,_0x2d8238){var _0x234a37={},_0x57c86f={},_0x10c4fa={'count':0x0,'rows':[]};var _0x38eeef=_[_0x89ff('0x28')](db['ZohoField']['rawAttributes'],function(_0x2131fd){return{'name':_0x2131fd[_0x89ff('0x29')],'type':_0x2131fd[_0x89ff('0x2a')][_0x89ff('0x2b')]};});_0x57c86f[_0x89ff('0x2c')]=_[_0x89ff('0x28')](_0x38eeef,'name');_0x57c86f[_0x89ff('0x2d')]=_[_0x89ff('0x2e')](_0x4a8ca3[_0x89ff('0x2d')]);_0x57c86f[_0x89ff('0x2f')]=_['intersection'](_0x57c86f[_0x89ff('0x2c')],_0x57c86f['query']);_0x234a37['attributes']=_['intersection'](_0x57c86f[_0x89ff('0x2c')],qs[_0x89ff('0x30')](_0x4a8ca3['query'][_0x89ff('0x30')]));_0x234a37[_0x89ff('0x31')]=_0x234a37[_0x89ff('0x31')][_0x89ff('0x32')]?_0x234a37['attributes']:_0x57c86f[_0x89ff('0x2c')];if(!_0x4a8ca3[_0x89ff('0x2d')][_0x89ff('0x33')]('nolimit')){_0x234a37['limit']=qs[_0x89ff('0x1c')](_0x4a8ca3[_0x89ff('0x2d')][_0x89ff('0x1c')]);_0x234a37[_0x89ff('0x1b')]=qs[_0x89ff('0x1b')](_0x4a8ca3[_0x89ff('0x2d')][_0x89ff('0x1b')]);}_0x234a37[_0x89ff('0x34')]=qs['sort'](_0x4a8ca3['query']['sort']);_0x234a37['where']=qs[_0x89ff('0x2f')](_[_0x89ff('0x35')](_0x4a8ca3[_0x89ff('0x2d')],_0x57c86f[_0x89ff('0x2f')]),_0x38eeef);if(_0x4a8ca3[_0x89ff('0x2d')]['filter']){_0x234a37[_0x89ff('0x36')]=_['merge'](_0x234a37[_0x89ff('0x36')],{'$or':_['map'](_0x38eeef,function(_0xff709e){if(_0xff709e[_0x89ff('0x2a')]!==_0x89ff('0x37')){var _0x1c5b20={};_0x1c5b20[_0xff709e['name']]={'$like':'%'+_0x4a8ca3[_0x89ff('0x2d')][_0x89ff('0x38')]+'%'};return _0x1c5b20;}})});}_0x234a37=_[_0x89ff('0x39')]({},_0x234a37,_0x4a8ca3[_0x89ff('0x3a')]);var _0x2ec472={'where':_0x234a37[_0x89ff('0x36')]};return db[_0x89ff('0x3b')]['count'](_0x2ec472)[_0x89ff('0x3c')](function(_0x203d71){_0x10c4fa[_0x89ff('0x1e')]=_0x203d71;if(_0x4a8ca3[_0x89ff('0x2d')][_0x89ff('0x3d')]){_0x234a37[_0x89ff('0x3e')]=[{'all':!![]}];}return db[_0x89ff('0x3b')][_0x89ff('0x3f')](_0x234a37);})['then'](function(_0x546c20){_0x10c4fa[_0x89ff('0x40')]=_0x546c20;return _0x10c4fa;})[_0x89ff('0x3c')](respondWithFilteredResult(_0x2d8238,_0x234a37))[_0x89ff('0x41')](handleError(_0x2d8238,null));};exports[_0x89ff('0x42')]=function(_0x20399d,_0x555cd7){var _0xc0f1e2={'raw':!![],'where':{'id':_0x20399d[_0x89ff('0x43')]['id']}},_0x2f403e={};_0x2f403e['model']=_[_0x89ff('0x2e')](db[_0x89ff('0x3b')][_0x89ff('0x44')]);_0x2f403e[_0x89ff('0x2d')]=_['keys'](_0x20399d[_0x89ff('0x2d')]);_0x2f403e[_0x89ff('0x2f')]=_[_0x89ff('0x45')](_0x2f403e['model'],_0x2f403e[_0x89ff('0x2d')]);_0xc0f1e2[_0x89ff('0x31')]=_[_0x89ff('0x45')](_0x2f403e[_0x89ff('0x2c')],qs[_0x89ff('0x30')](_0x20399d[_0x89ff('0x2d')][_0x89ff('0x30')]));_0xc0f1e2[_0x89ff('0x31')]=_0xc0f1e2[_0x89ff('0x31')][_0x89ff('0x32')]?_0xc0f1e2[_0x89ff('0x31')]:_0x2f403e[_0x89ff('0x2c')];if(_0x20399d[_0x89ff('0x2d')]['includeAll']){_0xc0f1e2[_0x89ff('0x3e')]=[{'all':!![]}];}_0xc0f1e2=_[_0x89ff('0x39')]({},_0xc0f1e2,_0x20399d[_0x89ff('0x3a')]);return db[_0x89ff('0x3b')][_0x89ff('0x46')](_0xc0f1e2)[_0x89ff('0x3c')](handleEntityNotFound(_0x555cd7,null))[_0x89ff('0x3c')](respondWithResult(_0x555cd7,null))[_0x89ff('0x41')](handleError(_0x555cd7,null));};exports[_0x89ff('0x47')]=function(_0x571e85,_0x46e258){return db[_0x89ff('0x3b')][_0x89ff('0x47')](_0x571e85[_0x89ff('0x48')],{})[_0x89ff('0x3c')](respondWithResult(_0x46e258,0xc9))[_0x89ff('0x41')](handleError(_0x46e258,null));};exports[_0x89ff('0x21')]=function(_0x27fb1a,_0x3848c9){if(_0x27fb1a['body']['id']){delete _0x27fb1a['body']['id'];}return db[_0x89ff('0x3b')][_0x89ff('0x46')]({'where':{'id':_0x27fb1a[_0x89ff('0x43')]['id']}})[_0x89ff('0x3c')](handleEntityNotFound(_0x3848c9,null))[_0x89ff('0x3c')](saveUpdates(_0x27fb1a[_0x89ff('0x48')],null))['then'](respondWithResult(_0x3848c9,null))[_0x89ff('0x41')](handleError(_0x3848c9,null));};exports[_0x89ff('0x22')]=function(_0x5ba55a,_0x155442){return db[_0x89ff('0x3b')][_0x89ff('0x46')]({'where':{'id':_0x5ba55a['params']['id']}})[_0x89ff('0x3c')](handleEntityNotFound(_0x155442,null))[_0x89ff('0x3c')](removeEntity(_0x155442,null))[_0x89ff('0x41')](handleError(_0x155442,null));}; \ No newline at end of file +var _0x9bd1=['ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','reject','save','then','destroy','stack','name','send','index','map','fieldName','type','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','ZohoField','findAll','rows','catch','params','rawAttributes','keys','include','find','create','body','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv'];(function(_0x17367c,_0x55ee6a){var _0x4b36b1=function(_0x153ff4){while(--_0x153ff4){_0x17367c['push'](_0x17367c['shift']());}};_0x4b36b1(++_0x55ee6a);}(_0x9bd1,0x155));var _0x19bd=function(_0x4e3100,_0x17a186){_0x4e3100=_0x4e3100-0x0;var _0x108467=_0x9bd1[_0x4e3100];return _0x108467;};'use strict';var emlformat=require(_0x19bd('0x0'));var rimraf=require(_0x19bd('0x1'));var zipdir=require(_0x19bd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x19bd('0x3'));var moment=require(_0x19bd('0x4'));var BPromise=require(_0x19bd('0x5'));var Mustache=require('mustache');var util=require(_0x19bd('0x6'));var path=require('path');var sox=require(_0x19bd('0x7'));var csv=require(_0x19bd('0x8'));var ejs=require(_0x19bd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x19bd('0xa'));var crypto=require('crypto');var jsforce=require(_0x19bd('0xb'));var deskjs=require(_0x19bd('0xc'));var toCsv=require(_0x19bd('0x8'));var querystring=require(_0x19bd('0xd'));var Papa=require(_0x19bd('0xe'));var Redis=require(_0x19bd('0xf'));var authService=require(_0x19bd('0x10'));var qs=require(_0x19bd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x19bd('0x12'));var logger=require('../../config/logger')(_0x19bd('0x13'));var utils=require(_0x19bd('0x14'));var config=require(_0x19bd('0x15'));var licenseUtil=require(_0x19bd('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1721de,_0x28313b){_0x28313b=_0x28313b||0xcc;return function(_0x3f12f3){if(_0x3f12f3){return _0x1721de[_0x19bd('0x17')](_0x28313b);}return _0x1721de[_0x19bd('0x18')](_0x28313b)[_0x19bd('0x19')]();};}function respondWithResult(_0x58db89,_0x6466ec){_0x6466ec=_0x6466ec||0xc8;return function(_0x5e03c5){if(_0x5e03c5){return _0x58db89[_0x19bd('0x18')](_0x6466ec)[_0x19bd('0x1a')](_0x5e03c5);}};}function respondWithFilteredResult(_0x4ab30d,_0x578de7){return function(_0x130163){if(_0x130163){var _0x507e53=typeof _0x578de7[_0x19bd('0x1b')]===_0x19bd('0x1c')&&typeof _0x578de7[_0x19bd('0x1d')]===_0x19bd('0x1c');var _0x3b9483=_0x130163[_0x19bd('0x1e')];var _0x3708fa=_0x507e53?0x0:_0x578de7[_0x19bd('0x1b')];var _0x49b3a8=_0x507e53?_0x130163[_0x19bd('0x1e')]:_0x578de7[_0x19bd('0x1b')]+_0x578de7[_0x19bd('0x1d')];var _0x402c7d;if(_0x49b3a8>=_0x3b9483){_0x49b3a8=_0x3b9483;_0x402c7d=0xc8;}else{_0x402c7d=0xce;}_0x4ab30d[_0x19bd('0x18')](_0x402c7d);return _0x4ab30d['set']('Content-Range',_0x3708fa+'-'+_0x49b3a8+'/'+_0x3b9483)[_0x19bd('0x1a')](_0x130163);}return null;};}function patchUpdates(_0x4c87dd){return function(_0x256210){try{jsonpatch['apply'](_0x256210,_0x4c87dd,!![]);}catch(_0x3d6535){return BPromise[_0x19bd('0x1f')](_0x3d6535);}return _0x256210[_0x19bd('0x20')]();};}function saveUpdates(_0x396afa,_0x323f4a){return function(_0x3d26b0){if(_0x3d26b0){return _0x3d26b0['update'](_0x396afa)[_0x19bd('0x21')](function(_0x33141e){return _0x33141e;});}return null;};}function removeEntity(_0x1779e5,_0x30034a){return function(_0x49afb2){if(_0x49afb2){return _0x49afb2[_0x19bd('0x22')]()[_0x19bd('0x21')](function(){_0x1779e5[_0x19bd('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x32748b,_0x40de24){return function(_0x3732b0){if(!_0x3732b0){_0x32748b['sendStatus'](0x194);}return _0x3732b0;};}function handleError(_0x2f55b6,_0x101f38){_0x101f38=_0x101f38||0x1f4;return function(_0x2bbed6){logger['error'](_0x2bbed6[_0x19bd('0x23')]);if(_0x2bbed6[_0x19bd('0x24')]){delete _0x2bbed6[_0x19bd('0x24')];}_0x2f55b6[_0x19bd('0x18')](_0x101f38)[_0x19bd('0x25')](_0x2bbed6);};}exports[_0x19bd('0x26')]=function(_0x4081b1,_0x20040e){var _0x543713={},_0x51a7fe={},_0x281bd1={'count':0x0,'rows':[]};var _0x4dc238=_[_0x19bd('0x27')](db['ZohoField']['rawAttributes'],function(_0x4f5adb){return{'name':_0x4f5adb[_0x19bd('0x28')],'type':_0x4f5adb[_0x19bd('0x29')][_0x19bd('0x2a')]};});_0x51a7fe['model']=_['map'](_0x4dc238,_0x19bd('0x24'));_0x51a7fe['query']=_['keys'](_0x4081b1[_0x19bd('0x2b')]);_0x51a7fe[_0x19bd('0x2c')]=_[_0x19bd('0x2d')](_0x51a7fe['model'],_0x51a7fe[_0x19bd('0x2b')]);_0x543713[_0x19bd('0x2e')]=_[_0x19bd('0x2d')](_0x51a7fe[_0x19bd('0x2f')],qs['fields'](_0x4081b1['query'][_0x19bd('0x30')]));_0x543713[_0x19bd('0x2e')]=_0x543713['attributes']['length']?_0x543713[_0x19bd('0x2e')]:_0x51a7fe[_0x19bd('0x2f')];if(!_0x4081b1['query'][_0x19bd('0x31')](_0x19bd('0x32'))){_0x543713['limit']=qs['limit'](_0x4081b1[_0x19bd('0x2b')][_0x19bd('0x1d')]);_0x543713[_0x19bd('0x1b')]=qs['offset'](_0x4081b1['query']['offset']);}_0x543713[_0x19bd('0x33')]=qs['sort'](_0x4081b1[_0x19bd('0x2b')][_0x19bd('0x34')]);_0x543713[_0x19bd('0x35')]=qs[_0x19bd('0x2c')](_[_0x19bd('0x36')](_0x4081b1['query'],_0x51a7fe['filters']),_0x4dc238);if(_0x4081b1[_0x19bd('0x2b')][_0x19bd('0x37')]){_0x543713[_0x19bd('0x35')]=_['merge'](_0x543713['where'],{'$or':_[_0x19bd('0x27')](_0x4dc238,function(_0x4544f8){if(_0x4544f8[_0x19bd('0x29')]!=='VIRTUAL'){var _0x5935ec={};_0x5935ec[_0x4544f8[_0x19bd('0x24')]]={'$like':'%'+_0x4081b1[_0x19bd('0x2b')][_0x19bd('0x37')]+'%'};return _0x5935ec;}})});}_0x543713=_[_0x19bd('0x38')]({},_0x543713,_0x4081b1[_0x19bd('0x39')]);var _0xf534fb={'where':_0x543713['where']};return db[_0x19bd('0x3a')][_0x19bd('0x1e')](_0xf534fb)[_0x19bd('0x21')](function(_0x2089c3){_0x281bd1[_0x19bd('0x1e')]=_0x2089c3;if(_0x4081b1[_0x19bd('0x2b')]['includeAll']){_0x543713['include']=[{'all':!![]}];}return db[_0x19bd('0x3a')][_0x19bd('0x3b')](_0x543713);})['then'](function(_0x6e3e4c){_0x281bd1[_0x19bd('0x3c')]=_0x6e3e4c;return _0x281bd1;})[_0x19bd('0x21')](respondWithFilteredResult(_0x20040e,_0x543713))[_0x19bd('0x3d')](handleError(_0x20040e,null));};exports['show']=function(_0x192136,_0x2a21a5){var _0x2e2e82={'raw':!![],'where':{'id':_0x192136[_0x19bd('0x3e')]['id']}},_0x40ad93={};_0x40ad93['model']=_['keys'](db[_0x19bd('0x3a')][_0x19bd('0x3f')]);_0x40ad93['query']=_[_0x19bd('0x40')](_0x192136[_0x19bd('0x2b')]);_0x40ad93[_0x19bd('0x2c')]=_['intersection'](_0x40ad93['model'],_0x40ad93[_0x19bd('0x2b')]);_0x2e2e82[_0x19bd('0x2e')]=_['intersection'](_0x40ad93[_0x19bd('0x2f')],qs['fields'](_0x192136[_0x19bd('0x2b')][_0x19bd('0x30')]));_0x2e2e82['attributes']=_0x2e2e82[_0x19bd('0x2e')]['length']?_0x2e2e82[_0x19bd('0x2e')]:_0x40ad93[_0x19bd('0x2f')];if(_0x192136[_0x19bd('0x2b')]['includeAll']){_0x2e2e82[_0x19bd('0x41')]=[{'all':!![]}];}_0x2e2e82=_[_0x19bd('0x38')]({},_0x2e2e82,_0x192136[_0x19bd('0x39')]);return db[_0x19bd('0x3a')][_0x19bd('0x42')](_0x2e2e82)[_0x19bd('0x21')](handleEntityNotFound(_0x2a21a5,null))['then'](respondWithResult(_0x2a21a5,null))[_0x19bd('0x3d')](handleError(_0x2a21a5,null));};exports['create']=function(_0x410121,_0x8fff12){return db[_0x19bd('0x3a')][_0x19bd('0x43')](_0x410121[_0x19bd('0x44')],{})[_0x19bd('0x21')](respondWithResult(_0x8fff12,0xc9))['catch'](handleError(_0x8fff12,null));};exports[_0x19bd('0x45')]=function(_0x25a1cb,_0x1cbc30){if(_0x25a1cb[_0x19bd('0x44')]['id']){delete _0x25a1cb['body']['id'];}return db[_0x19bd('0x3a')][_0x19bd('0x42')]({'where':{'id':_0x25a1cb[_0x19bd('0x3e')]['id']}})[_0x19bd('0x21')](handleEntityNotFound(_0x1cbc30,null))[_0x19bd('0x21')](saveUpdates(_0x25a1cb['body'],null))[_0x19bd('0x21')](respondWithResult(_0x1cbc30,null))[_0x19bd('0x3d')](handleError(_0x1cbc30,null));};exports[_0x19bd('0x22')]=function(_0x10eaea,_0x4cd62e){return db[_0x19bd('0x3a')][_0x19bd('0x42')]({'where':{'id':_0x10eaea[_0x19bd('0x3e')]['id']}})[_0x19bd('0x21')](handleEntityNotFound(_0x4cd62e,null))[_0x19bd('0x21')](removeEntity(_0x4cd62e,null))[_0x19bd('0x3d')](handleError(_0x4cd62e,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 442bbad..838af4d 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 _0x4745=['../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x513d65,_0x156ef6){var _0x307aa9=function(_0x3885d3){while(--_0x3885d3){_0x513d65['push'](_0x513d65['shift']());}};_0x307aa9(++_0x156ef6);}(_0x4745,0x1e7));var _0x5474=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x4745[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var logger=require(_0x5474('0x2'))(_0x5474('0x3'));var moment=require(_0x5474('0x4'));var BPromise=require(_0x5474('0x5'));var rp=require(_0x5474('0x6'));var fs=require('fs');var path=require(_0x5474('0x7'));var rimraf=require(_0x5474('0x8'));var config=require(_0x5474('0x9'));var attributes=require(_0x5474('0xa'));module[_0x5474('0xb')]=function(_0x4e7ce7,_0x3d1e1){return _0x4e7ce7[_0x5474('0xc')]('ZohoField',attributes,{'tableName':_0x5474('0xd'),'paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x5474('0xe'),_0x5474('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd943=['api','bluebird','request-promise','path','rimraf','../../config/environment','int_zoho_fields','zoho_unique_index','lodash','util','../../config/logger'];(function(_0x40497b,_0x6be374){var _0x140ad6=function(_0x357485){while(--_0x357485){_0x40497b['push'](_0x40497b['shift']());}};_0x140ad6(++_0x6be374);}(_0xd943,0x15d));var _0x3d94=function(_0x48863d,_0x33ffbb){_0x48863d=_0x48863d-0x0;var _0x27dabe=_0xd943[_0x48863d];return _0x27dabe;};'use strict';var _=require(_0x3d94('0x0'));var util=require(_0x3d94('0x1'));var logger=require(_0x3d94('0x2'))(_0x3d94('0x3'));var moment=require('moment');var BPromise=require(_0x3d94('0x4'));var rp=require(_0x3d94('0x5'));var fs=require('fs');var path=require(_0x3d94('0x6'));var rimraf=require(_0x3d94('0x7'));var config=require(_0x3d94('0x8'));var attributes=require('./intZohoField.attributes');module['exports']=function(_0x34c9c3,_0x51cf1f){return _0x34c9c3['define']('ZohoField',attributes,{'tableName':_0x3d94('0x9'),'paranoid':![],'indexes':[{'name':_0x3d94('0xa'),'fields':['idField','FieldId'],'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 2fd3d05..c0f7814 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 _0x7349=['request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x349a8d,_0x2616e3){var _0x50f593=function(_0x3c4f1a){while(--_0x3c4f1a){_0x349a8d['push'](_0x349a8d['shift']());}};_0x50f593(++_0x2616e3);}(_0x7349,0x79));var _0x9734=function(_0x5ae9fd,_0x466d96){_0x5ae9fd=_0x5ae9fd-0x0;var _0x1009a2=_0x7349[_0x5ae9fd];return _0x1009a2;};'use strict';var _=require(_0x9734('0x0'));var util=require(_0x9734('0x1'));var moment=require(_0x9734('0x2'));var BPromise=require(_0x9734('0x3'));var rs=require(_0x9734('0x4'));var fs=require('fs');var Redis=require(_0x9734('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9734('0x6'));var logger=require(_0x9734('0x7'))(_0x9734('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9734('0x9')][_0x9734('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x16d4a9,_0xd9f4e4,_0x87923c){return new BPromise(function(_0x127813,_0x36a547){return client[_0x9734('0xb')](_0x16d4a9,_0x87923c)[_0x9734('0xc')](function(_0x350a1c){logger['info'](_0x9734('0xd'),_0xd9f4e4,_0x9734('0xe'));logger[_0x9734('0xf')](_0x9734('0x10'),_0xd9f4e4,_0x9734('0xe'),JSON[_0x9734('0x11')](_0x350a1c));if(_0x350a1c[_0x9734('0x12')]){if(_0x350a1c[_0x9734('0x12')][_0x9734('0x13')]===0x1f4){logger[_0x9734('0x12')](_0x9734('0xd'),_0xd9f4e4,_0x350a1c['error'][_0x9734('0x14')]);return _0x36a547(_0x350a1c[_0x9734('0x12')][_0x9734('0x14')]);}logger['error'](_0x9734('0xd'),_0xd9f4e4,_0x350a1c[_0x9734('0x12')][_0x9734('0x14')]);return _0x127813(_0x350a1c[_0x9734('0x12')][_0x9734('0x14')]);}else{logger['info']('ZohoField,\x20%s,\x20%s',_0xd9f4e4,_0x9734('0xe'));_0x127813(_0x350a1c['result'][_0x9734('0x14')]);}})[_0x9734('0x15')](function(_0x6d560c){logger['error'](_0x9734('0xd'),_0xd9f4e4,_0x6d560c);_0x36a547(_0x6d560c);});});} \ No newline at end of file +var _0x6b16=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x3c0dbb,_0x6242df){var _0x5d2263=function(_0x1ef006){while(--_0x1ef006){_0x3c0dbb['push'](_0x3c0dbb['shift']());}};_0x5d2263(++_0x6242df);}(_0x6b16,0xd1));var _0x66b1=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0x6b16[_0x4c440b];return _0x2d48cf;};'use strict';var _=require(_0x66b1('0x0'));var util=require('util');var moment=require(_0x66b1('0x1'));var BPromise=require(_0x66b1('0x2'));var rs=require(_0x66b1('0x3'));var fs=require('fs');var Redis=require(_0x66b1('0x4'));var db=require(_0x66b1('0x5'))['db'];var utils=require(_0x66b1('0x6'));var logger=require('../../config/logger')(_0x66b1('0x7'));var config=require(_0x66b1('0x8'));var jayson=require(_0x66b1('0x9'));var client=jayson[_0x66b1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25d1e0,_0x31bf44,_0x52a1ae){return new BPromise(function(_0x298251,_0x30cfb2){return client[_0x66b1('0xb')](_0x25d1e0,_0x52a1ae)['then'](function(_0x1514c1){logger['info'](_0x66b1('0xc'),_0x31bf44,_0x66b1('0xd'));logger['debug'](_0x66b1('0xe'),_0x31bf44,_0x66b1('0xd'),JSON[_0x66b1('0xf')](_0x1514c1));if(_0x1514c1[_0x66b1('0x10')]){if(_0x1514c1[_0x66b1('0x10')][_0x66b1('0x11')]===0x1f4){logger[_0x66b1('0x10')](_0x66b1('0xc'),_0x31bf44,_0x1514c1[_0x66b1('0x10')][_0x66b1('0x12')]);return _0x30cfb2(_0x1514c1[_0x66b1('0x10')][_0x66b1('0x12')]);}logger[_0x66b1('0x10')]('ZohoField,\x20%s,\x20%s',_0x31bf44,_0x1514c1[_0x66b1('0x10')]['message']);return _0x298251(_0x1514c1['error'][_0x66b1('0x12')]);}else{logger['info'](_0x66b1('0xc'),_0x31bf44,_0x66b1('0xd'));_0x298251(_0x1514c1[_0x66b1('0x13')]['message']);}})[_0x66b1('0x14')](function(_0x109afc){logger[_0x66b1('0x10')](_0x66b1('0xc'),_0x31bf44,_0x109afc);_0x30cfb2(_0x109afc);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index dabec33..8277bfa 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2cc0c9,_0x1600f1){var _0x673533=function(_0x322f11){while(--_0x322f11){_0x2cc0c9['push'](_0x2cc0c9['shift']());}};_0x673533(++_0x1600f1);}(_0xe706,0xa3));var _0x6e70=function(_0x38136b,_0x35c34e){_0x38136b=_0x38136b-0x0;var _0x3b10b9=_0xe706[_0x38136b];return _0x3b10b9;};'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 fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2755a2,_0x2a1197){var _0x719d22=function(_0x2083f3){while(--_0x2083f3){_0x2755a2['push'](_0x2755a2['shift']());}};_0x719d22(++_0x2a1197);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('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 8895713..6a69f64 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 _0x2cb5=['BOOLEAN','state','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x2cb5,0x176));var _0x52cb=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0x2cb5[_0x5ce15c];return _0x36e4f5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x52cb('0x0')],'allowNull':![],'unique':_0x52cb('0x1')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x52cb('0x1')},'main':{'type':Sequelize[_0x52cb('0x0')],'defaultValue':_0x52cb('0x2')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x52cb('0x0')]},'type':{'type':Sequelize[_0x52cb('0x0')]},'size':{'type':Sequelize[_0x52cb('0x3')]},'active':{'type':Sequelize[_0x52cb('0x4')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x52cb('0x0')]},'state':{'type':Sequelize[_0x52cb('0x0')],'unique':_0x52cb('0x5')},'description':{'type':Sequelize[_0x52cb('0x0')]},'title':{'type':Sequelize[_0x52cb('0x0')]},'remoteUri':{'type':Sequelize[_0x52cb('0x0')]},'link':{'type':Sequelize[_0x52cb('0x0')],'defaultValue':'#'}}; \ No newline at end of file +var _0xcf35=['state','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN'];(function(_0x1f1f42,_0x168733){var _0x481157=function(_0x5e7628){while(--_0x5e7628){_0x1f1f42['push'](_0x1f1f42['shift']());}};_0x481157(++_0x168733);}(_0xcf35,0x1a9));var _0x5cf3=function(_0x4ab7af,_0x38eb6b){_0x4ab7af=_0x4ab7af-0x0;var _0x22746c=_0xcf35[_0x4ab7af];return _0x22746c;};'use strict';var Sequelize=require(_0x5cf3('0x0'));module[_0x5cf3('0x1')]={'name':{'type':Sequelize[_0x5cf3('0x2')],'allowNull':![],'unique':_0x5cf3('0x3')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5cf3('0x3')},'main':{'type':Sequelize[_0x5cf3('0x2')],'defaultValue':_0x5cf3('0x4')},'filename':{'type':Sequelize[_0x5cf3('0x2')]},'path':{'type':Sequelize[_0x5cf3('0x2')]},'type':{'type':Sequelize[_0x5cf3('0x2')]},'size':{'type':Sequelize[_0x5cf3('0x5')]},'active':{'type':Sequelize[_0x5cf3('0x6')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0x5cf3('0x2')]},'state':{'type':Sequelize[_0x5cf3('0x2')],'unique':_0x5cf3('0x7')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x5cf3('0x2')]},'remoteUri':{'type':Sequelize[_0x5cf3('0x2')]},'link':{'type':Sequelize[_0x5cf3('0x2')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 0562e87..cfbf9d9 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 _0xc2c7=['nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','Integration','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc2c7,0x134));var _0x7c2c=function(_0x44638a,_0x4fc76b){_0x44638a=_0x44638a-0x0;var _0x4ab003=_0xc2c7[_0x44638a];return _0x4ab003;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['Integration'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['Integration'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['create']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['create'](_0xeb067b['body'],{})[_0x7c2c('0x26')](respondWithResult(_0x3091bd,0xc9))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x2b79d5,_0x5f3de8){if(_0x2b79d5['body']['id']){delete _0x2b79d5['body']['id'];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x2b79d5[_0x7c2c('0x48')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x5f3de8,null))[_0x7c2c('0x26')](saveUpdates(_0x2b79d5['body'],null))[_0x7c2c('0x26')](respondWithResult(_0x5f3de8,null))[_0x7c2c('0x45')](handleError(_0x5f3de8,null));};exports['destroy']=function(_0x19621a,_0x56e09d){return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x19621a[_0x7c2c('0x48')]['id']}})['then'](handleEntityNotFound(_0x56e09d,null))['then'](removeEntity(_0x56e09d,null))[_0x7c2c('0x45')](handleError(_0x56e09d,null));}; \ No newline at end of file +var _0xe2fe=['include','catch','show','find','body','params','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','api','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','reject','save','update','then','destroy','end','name','send','index','map','Integration','rawAttributes','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0xee2f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xee2f('0x1'));var rp=require('request-promise');var moment=require(_0xee2f('0x2'));var BPromise=require(_0xee2f('0x3'));var Mustache=require(_0xee2f('0x4'));var util=require(_0xee2f('0x5'));var path=require(_0xee2f('0x6'));var sox=require('sox');var csv=require(_0xee2f('0x7'));var ejs=require(_0xee2f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xee2f('0x9'));var squel=require(_0xee2f('0xa'));var crypto=require('crypto');var jsforce=require(_0xee2f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xee2f('0x7'));var querystring=require(_0xee2f('0xc'));var Papa=require('papaparse');var Redis=require(_0xee2f('0xd'));var authService=require(_0xee2f('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xee2f('0xf'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xee2f('0x10'))['db'];function respondWithStatusCode(_0x346dbc,_0xa13e7b){_0xa13e7b=_0xa13e7b||0xcc;return function(_0x100449){if(_0x100449){return _0x346dbc[_0xee2f('0x11')](_0xa13e7b);}return _0x346dbc[_0xee2f('0x12')](_0xa13e7b)['end']();};}function respondWithResult(_0x3861e6,_0x531c3a){_0x531c3a=_0x531c3a||0xc8;return function(_0x36db10){if(_0x36db10){return _0x3861e6[_0xee2f('0x12')](_0x531c3a)['json'](_0x36db10);}};}function respondWithFilteredResult(_0x445ba8,_0x145241){return function(_0x28b614){if(_0x28b614){var _0x1bbf7d=typeof _0x145241[_0xee2f('0x13')]==='undefined'&&typeof _0x145241[_0xee2f('0x14')]==='undefined';var _0x17d288=_0x28b614[_0xee2f('0x15')];var _0x502eb6=_0x1bbf7d?0x0:_0x145241['offset'];var _0x40b5bc=_0x1bbf7d?_0x28b614['count']:_0x145241[_0xee2f('0x13')]+_0x145241[_0xee2f('0x14')];var _0x28549d;if(_0x40b5bc>=_0x17d288){_0x40b5bc=_0x17d288;_0x28549d=0xc8;}else{_0x28549d=0xce;}_0x445ba8['status'](_0x28549d);return _0x445ba8[_0xee2f('0x16')](_0xee2f('0x17'),_0x502eb6+'-'+_0x40b5bc+'/'+_0x17d288)[_0xee2f('0x18')](_0x28b614);}return null;};}function patchUpdates(_0x21fdf4){return function(_0x3d892d){try{jsonpatch['apply'](_0x3d892d,_0x21fdf4,!![]);}catch(_0x5e73ad){return BPromise[_0xee2f('0x19')](_0x5e73ad);}return _0x3d892d[_0xee2f('0x1a')]();};}function saveUpdates(_0x1ea808,_0x203b2f){return function(_0x472e3b){if(_0x472e3b){return _0x472e3b[_0xee2f('0x1b')](_0x1ea808)[_0xee2f('0x1c')](function(_0x4d68d3){return _0x4d68d3;});}return null;};}function removeEntity(_0x250399,_0x2c47c5){return function(_0x15ceda){if(_0x15ceda){return _0x15ceda[_0xee2f('0x1d')]()[_0xee2f('0x1c')](function(){_0x250399[_0xee2f('0x12')](0xcc)[_0xee2f('0x1e')]();});}};}function handleEntityNotFound(_0x13013f,_0x382174){return function(_0x1e394f){if(!_0x1e394f){_0x13013f[_0xee2f('0x11')](0x194);}return _0x1e394f;};}function handleError(_0x168adc,_0x1c8454){_0x1c8454=_0x1c8454||0x1f4;return function(_0x45c4a0){logger['error'](_0x45c4a0['stack']);if(_0x45c4a0['name']){delete _0x45c4a0[_0xee2f('0x1f')];}_0x168adc[_0xee2f('0x12')](_0x1c8454)[_0xee2f('0x20')](_0x45c4a0);};}exports[_0xee2f('0x21')]=function(_0x892a4e,_0x3737fd){var _0x4d8398={},_0x3d3806={},_0x52e1fa={'count':0x0,'rows':[]};var _0x235697=_[_0xee2f('0x22')](db[_0xee2f('0x23')][_0xee2f('0x24')],function(_0x3ddbe3){return{'name':_0x3ddbe3['fieldName'],'type':_0x3ddbe3[_0xee2f('0x25')][_0xee2f('0x26')]};});_0x3d3806['model']=_['map'](_0x235697,_0xee2f('0x1f'));_0x3d3806['query']=_[_0xee2f('0x27')](_0x892a4e[_0xee2f('0x28')]);_0x3d3806['filters']=_[_0xee2f('0x29')](_0x3d3806['model'],_0x3d3806['query']);_0x4d8398['attributes']=_[_0xee2f('0x29')](_0x3d3806[_0xee2f('0x2a')],qs['fields'](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x2b')]));_0x4d8398[_0xee2f('0x2c')]=_0x4d8398[_0xee2f('0x2c')][_0xee2f('0x2d')]?_0x4d8398['attributes']:_0x3d3806[_0xee2f('0x2a')];if(!_0x892a4e['query'][_0xee2f('0x2e')](_0xee2f('0x2f'))){_0x4d8398[_0xee2f('0x14')]=qs['limit'](_0x892a4e[_0xee2f('0x28')]['limit']);_0x4d8398[_0xee2f('0x13')]=qs['offset'](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x13')]);}_0x4d8398[_0xee2f('0x30')]=qs[_0xee2f('0x31')](_0x892a4e[_0xee2f('0x28')][_0xee2f('0x31')]);_0x4d8398[_0xee2f('0x32')]=qs[_0xee2f('0x33')](_[_0xee2f('0x34')](_0x892a4e[_0xee2f('0x28')],_0x3d3806[_0xee2f('0x33')]),_0x235697);if(_0x892a4e['query'][_0xee2f('0x35')]){_0x4d8398['where']=_[_0xee2f('0x36')](_0x4d8398[_0xee2f('0x32')],{'$or':_[_0xee2f('0x22')](_0x235697,function(_0x2cbb89){if(_0x2cbb89[_0xee2f('0x25')]!==_0xee2f('0x37')){var _0x694950={};_0x694950[_0x2cbb89[_0xee2f('0x1f')]]={'$like':'%'+_0x892a4e['query']['filter']+'%'};return _0x694950;}})});}_0x4d8398=_['merge']({},_0x4d8398,_0x892a4e[_0xee2f('0x38')]);var _0x5483ae={'where':_0x4d8398[_0xee2f('0x32')]};return db['Integration']['count'](_0x5483ae)['then'](function(_0x58e361){_0x52e1fa[_0xee2f('0x15')]=_0x58e361;if(_0x892a4e[_0xee2f('0x28')][_0xee2f('0x39')]){_0x4d8398[_0xee2f('0x3a')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x4d8398);})[_0xee2f('0x1c')](function(_0x5e12b7){_0x52e1fa['rows']=_0x5e12b7;return _0x52e1fa;})[_0xee2f('0x1c')](respondWithFilteredResult(_0x3737fd,_0x4d8398))[_0xee2f('0x3b')](handleError(_0x3737fd,null));};exports[_0xee2f('0x3c')]=function(_0x54130b,_0x3bc173){var _0x27c447={'raw':![],'where':{'id':_0x54130b['params']['id']}},_0x19bd4d={};_0x19bd4d['model']=_[_0xee2f('0x27')](db[_0xee2f('0x23')][_0xee2f('0x24')]);_0x19bd4d[_0xee2f('0x28')]=_['keys'](_0x54130b[_0xee2f('0x28')]);_0x19bd4d[_0xee2f('0x33')]=_[_0xee2f('0x29')](_0x19bd4d[_0xee2f('0x2a')],_0x19bd4d[_0xee2f('0x28')]);_0x27c447[_0xee2f('0x2c')]=_[_0xee2f('0x29')](_0x19bd4d[_0xee2f('0x2a')],qs[_0xee2f('0x2b')](_0x54130b[_0xee2f('0x28')]['fields']));_0x27c447['attributes']=_0x27c447['attributes']['length']?_0x27c447[_0xee2f('0x2c')]:_0x19bd4d[_0xee2f('0x2a')];if(_0x54130b[_0xee2f('0x28')][_0xee2f('0x39')]){_0x27c447[_0xee2f('0x3a')]=[{'all':!![]}];}_0x27c447=_['merge']({},_0x27c447,_0x54130b[_0xee2f('0x38')]);return db[_0xee2f('0x23')][_0xee2f('0x3d')](_0x27c447)[_0xee2f('0x1c')](handleEntityNotFound(_0x3bc173,null))['then'](respondWithResult(_0x3bc173,null))['catch'](handleError(_0x3bc173,null));};exports['create']=function(_0x1609f0,_0x54cc44){return db['Integration']['create'](_0x1609f0['body'],{})[_0xee2f('0x1c')](respondWithResult(_0x54cc44,0xc9))[_0xee2f('0x3b')](handleError(_0x54cc44,null));};exports[_0xee2f('0x1b')]=function(_0x584383,_0x22506e){if(_0x584383['body']['id']){delete _0x584383[_0xee2f('0x3e')]['id'];}return db[_0xee2f('0x23')][_0xee2f('0x3d')]({'where':{'id':_0x584383[_0xee2f('0x3f')]['id']}})[_0xee2f('0x1c')](handleEntityNotFound(_0x22506e,null))['then'](saveUpdates(_0x584383['body'],null))[_0xee2f('0x1c')](respondWithResult(_0x22506e,null))['catch'](handleError(_0x22506e,null));};exports[_0xee2f('0x1d')]=function(_0x282e89,_0x1928f8){return db[_0xee2f('0x23')]['find']({'where':{'id':_0x282e89['params']['id']}})[_0xee2f('0x1c')](handleEntityNotFound(_0x1928f8,null))[_0xee2f('0x1c')](removeEntity(_0x1928f8,null))[_0xee2f('0x3b')](handleError(_0x1928f8,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 67a0a15..6e924d0 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 _0x76c3=['../../config/environment','exports','Integration','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x76c3,0xb7));var _0x376c=function(_0x5410f4,_0x560cb2){_0x5410f4=_0x5410f4-0x0;var _0x2fe39e=_0x76c3[_0x5410f4];return _0x2fe39e;};'use strict';var _=require(_0x376c('0x0'));var util=require(_0x376c('0x1'));var logger=require(_0x376c('0x2'))(_0x376c('0x3'));var moment=require(_0x376c('0x4'));var BPromise=require('bluebird');var rp=require(_0x376c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x376c('0x6'));var attributes=require('./integration.attributes');module[_0x376c('0x7')]=function(_0x37f3ca,_0x451783){return _0x37f3ca['define'](_0x376c('0x8'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ca7=['rimraf','./integration.attributes','exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5b142f,_0x10815a){var _0x327bbd=function(_0x56806f){while(--_0x56806f){_0x5b142f['push'](_0x5b142f['shift']());}};_0x327bbd(++_0x10815a);}(_0x5ca7,0x19c));var _0x75ca=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x5ca7[_0x21549c];return _0x426cbd;};'use strict';var _=require(_0x75ca('0x0'));var util=require(_0x75ca('0x1'));var logger=require(_0x75ca('0x2'))(_0x75ca('0x3'));var moment=require(_0x75ca('0x4'));var BPromise=require(_0x75ca('0x5'));var rp=require(_0x75ca('0x6'));var fs=require('fs');var path=require(_0x75ca('0x7'));var rimraf=require(_0x75ca('0x8'));var config=require('../../config/environment');var attributes=require(_0x75ca('0x9'));module[_0x75ca('0xa')]=function(_0x5c1d38,_0x3f3688){return _0x5c1d38[_0x75ca('0xb')](_0x75ca('0xc'),attributes,{'tableName':_0x75ca('0xd'),'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 786bef5..04c6a1f 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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0xdb631a,_0x5a2173){var _0x1c85f0=function(_0x2a3c4d){while(--_0x2a3c4d){_0xdb631a['push'](_0xdb631a['shift']());}};_0x1c85f0(++_0x5a2173);}(_0xdb28,0x106));var _0x8db2=function(_0x117787,_0x4e871f){_0x117787=_0x117787-0x0;var _0xb5a78=_0xdb28[_0x117787];return _0xb5a78;};'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')]('Integration,\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 _0xc6ac=['http','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x35d4fd,_0x11a7e2){var _0x4235f4=function(_0x36de2b){while(--_0x36de2b){_0x35d4fd['push'](_0x35d4fd['shift']());}};_0x4235f4(++_0x11a7e2);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x57abb5,_0x3248bd){_0x57abb5=_0x57abb5-0x0;var _0x426712=_0xc6ac[_0x57abb5];return _0x426712;};'use strict';var _=require(_0xcc6a('0x0'));var util=require(_0xcc6a('0x1'));var moment=require(_0xcc6a('0x2'));var BPromise=require(_0xcc6a('0x3'));var rs=require(_0xcc6a('0x4'));var fs=require('fs');var Redis=require(_0xcc6a('0x5'));var db=require(_0xcc6a('0x6'))['db'];var utils=require(_0xcc6a('0x7'));var logger=require(_0xcc6a('0x8'))(_0xcc6a('0x9'));var config=require(_0xcc6a('0xa'));var jayson=require(_0xcc6a('0xb'));var client=jayson[_0xcc6a('0xc')][_0xcc6a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5f3887,_0x3dd497,_0x11b919){return new BPromise(function(_0xf02261,_0x560cc4){return client[_0xcc6a('0xe')](_0x5f3887,_0x11b919)[_0xcc6a('0xf')](function(_0x7806a0){logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,'request\x20sent');logger[_0xcc6a('0x12')](_0xcc6a('0x13'),_0x3dd497,_0xcc6a('0x14'),JSON['stringify'](_0x7806a0));if(_0x7806a0[_0xcc6a('0x15')]){if(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x16')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0x560cc4(_0x7806a0[_0xcc6a('0x15')]['message']);}logger['error'](_0xcc6a('0x11'),_0x3dd497,_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);return _0xf02261(_0x7806a0[_0xcc6a('0x15')][_0xcc6a('0x17')]);}else{logger[_0xcc6a('0x10')](_0xcc6a('0x11'),_0x3dd497,_0xcc6a('0x14'));_0xf02261(_0x7806a0['result']['message']);}})['catch'](function(_0x395a55){logger[_0xcc6a('0x15')](_0xcc6a('0x11'),_0x3dd497,_0x395a55);_0x560cc4(_0x395a55);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 28c8ebf..17a30f6 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 _0x0295=['isAuthenticated','index','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x0295,0x1f0));var _0x5029=function(_0x2cf818,_0x1cd613){_0x2cf818=_0x2cf818-0x0;var _0x4c1fc7=_0x0295[_0x2cf818];return _0x4c1fc7;};'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 fs_extra=require(_0x5029('0x2'));var auth=require(_0x5029('0x3'));var interaction=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var controller=require(_0x5029('0x6'));router[_0x5029('0x7')]('/',auth[_0x5029('0x8')](),controller[_0x5029('0x9')]);router[_0x5029('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x5029('0x7')]('/:id',auth[_0x5029('0x8')](),controller['show']);router[_0x5029('0xa')]('/',auth['isAuthenticated'](),controller[_0x5029('0xb')]);router[_0x5029('0xc')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0xe')]);router[_0x5029('0xf')](_0x5029('0xd'),auth['isAuthenticated'](),controller[_0x5029('0x10')]);module[_0x5029('0x11')]=router; \ No newline at end of file +var _0x7880=['Router','fs-extra','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','delete','destroy','exports','util','path','connect-timeout','express'];(function(_0x1dca1c,_0x446582){var _0xb2b284=function(_0x48550b){while(--_0x48550b){_0x1dca1c['push'](_0x1dca1c['shift']());}};_0xb2b284(++_0x446582);}(_0x7880,0x1f4));var _0x0788=function(_0x149cf0,_0x3746f2){_0x149cf0=_0x149cf0-0x0;var _0x2ee2c8=_0x7880[_0x149cf0];return _0x2ee2c8;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var fs_extra=require(_0x0788('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0788('0x6'));var config=require(_0x0788('0x7'));var controller=require(_0x0788('0x8'));router[_0x0788('0x9')]('/',auth[_0x0788('0xa')](),controller[_0x0788('0xb')]);router[_0x0788('0x9')](_0x0788('0xc'),auth[_0x0788('0xa')](),controller[_0x0788('0xd')]);router['get'](_0x0788('0xe'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router['post']('/',auth[_0x0788('0xa')](),controller[_0x0788('0x10')]);router[_0x0788('0x11')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller['update']);router[_0x0788('0x12')](_0x0788('0xe'),auth[_0x0788('0xa')](),controller[_0x0788('0x13')]);module[_0x0788('0x14')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index a097220..7f78fe5 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 _0x6752=['exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','RECEIVED','FAILED','sequelize'];(function(_0xb30d1d,_0x138303){var _0x177c6b=function(_0x3527e3){while(--_0x3527e3){_0xb30d1d['push'](_0xb30d1d['shift']());}};_0x177c6b(++_0x138303);}(_0x6752,0x1af));var _0x2675=function(_0x54cd21,_0x2b5c7b){_0x54cd21=_0x54cd21-0x0;var _0x151a55=_0x6752[_0x54cd21];return _0x151a55;};'use strict';var Sequelize=require(_0x2675('0x0'));module[_0x2675('0x1')]={'integration':{'type':Sequelize[_0x2675('0x2')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0x2675('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x2675('0x2')]},'calleridname':{'type':Sequelize[_0x2675('0x2')]},'queue':{'type':Sequelize[_0x2675('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x2675('0x4')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x2675('0x3')]},'agentcomplete':{'type':Sequelize[_0x2675('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x2675('0x4')]},'talktime':{'type':Sequelize[_0x2675('0x3')]},'agentacw':{'type':Sequelize[_0x2675('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x2675('0x3')]},'reason':{'type':Sequelize[_0x2675('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x2675('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x2675('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x2675('0x4')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x2675('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x2675('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x2675('0x2')]},'accountcode':{'type':Sequelize[_0x2675('0x2')]},'context':{'type':Sequelize[_0x2675('0x2')]},'exten':{'type':Sequelize[_0x2675('0x2')]},'priority':{'type':Sequelize[_0x2675('0x2')]},'destchannel':{'type':Sequelize[_0x2675('0x2')]},'destchannelstate':{'type':Sequelize[_0x2675('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x2675('0x2')]},'destcalleridnum':{'type':Sequelize[_0x2675('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x2675('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x2675('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x2675('0x2')]},'destcontext':{'type':Sequelize[_0x2675('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x2675('0x2')]},'destuniqueid':{'type':Sequelize[_0x2675('0x2')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x2675('0x2')]},'subject':{'type':Sequelize[_0x2675('0x2')]},'from':{'type':Sequelize[_0x2675('0x2')]},'to':{'type':Sequelize[_0x2675('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x2675('0x6')]},'html':{'type':Sequelize[_0x2675('0x6')]},'text':{'type':Sequelize[_0x2675('0x6')]},'status':{'type':Sequelize[_0x2675('0x7')](_0x2675('0x8'),_0x2675('0x9'),_0x2675('0xa'),_0x2675('0xb'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x2675('0x2')]},'appdata':{'type':Sequelize[_0x2675('0x2')]},'projectId':{'type':Sequelize[_0x2675('0x3')]}}; \ No newline at end of file +var _0x7ece=['SENT','RECEIVED','FAILED','sequelize','exports','STRING','DATE','BOOLEAN','INTEGER','TEXT'];(function(_0x59b146,_0x8a74fe){var _0x5e7c4c=function(_0x12e3fd){while(--_0x12e3fd){_0x59b146['push'](_0x59b146['shift']());}};_0x5e7c4c(++_0x8a74fe);}(_0x7ece,0x1e3));var _0xe7ec=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x7ece[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require(_0xe7ec('0x0'));module[_0xe7ec('0x1')]={'integration':{'type':Sequelize[_0xe7ec('0x2')]},'eventChannel':{'type':Sequelize[_0xe7ec('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0xe7ec('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0xe7ec('0x2')]},'uniqueid':{'type':Sequelize[_0xe7ec('0x2')]},'calleridnum':{'type':Sequelize[_0xe7ec('0x2')]},'calleridname':{'type':Sequelize[_0xe7ec('0x2')]},'queue':{'type':Sequelize[_0xe7ec('0x2')]},'interface':{'type':Sequelize[_0xe7ec('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xe7ec('0x3')]},'agentconnectAt':{'type':Sequelize[_0xe7ec('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xe7ec('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xe7ec('0x5')]},'agentacw':{'type':Sequelize[_0xe7ec('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xe7ec('0x5')]},'reason':{'type':Sequelize[_0xe7ec('0x2')]},'agentringnoanswer':{'type':Sequelize[_0xe7ec('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xe7ec('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe7ec('0x2')]},'channelstate':{'type':Sequelize[_0xe7ec('0x5')]},'channelstatedesc':{'type':Sequelize[_0xe7ec('0x2')]},'connectedlinenum':{'type':Sequelize[_0xe7ec('0x2')]},'connectedlinename':{'type':Sequelize[_0xe7ec('0x2')]},'language':{'type':Sequelize[_0xe7ec('0x2')]},'accountcode':{'type':Sequelize[_0xe7ec('0x2')]},'context':{'type':Sequelize[_0xe7ec('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xe7ec('0x2')]},'destchannel':{'type':Sequelize[_0xe7ec('0x2')]},'destchannelstate':{'type':Sequelize[_0xe7ec('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0xe7ec('0x2')]},'destcalleridnum':{'type':Sequelize[_0xe7ec('0x2')]},'destcalleridname':{'type':Sequelize[_0xe7ec('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xe7ec('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xe7ec('0x2')]},'destaccountcode':{'type':Sequelize[_0xe7ec('0x2')]},'destcontext':{'type':Sequelize[_0xe7ec('0x2')]},'destexten':{'type':Sequelize[_0xe7ec('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xe7ec('0x2')]},'messageId':{'type':Sequelize[_0xe7ec('0x2')]},'inReplyTo':{'type':Sequelize[_0xe7ec('0x2')]},'subject':{'type':Sequelize[_0xe7ec('0x2')]},'from':{'type':Sequelize[_0xe7ec('0x2')]},'to':{'type':Sequelize[_0xe7ec('0x2')]},'cc':{'type':Sequelize[_0xe7ec('0x2')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xe7ec('0x6')]},'status':{'type':Sequelize['ENUM'](_0xe7ec('0x7'),'SENDING',_0xe7ec('0x8'),_0xe7ec('0x9'))},'url':{'type':Sequelize[_0xe7ec('0x2')]},'app':{'type':Sequelize[_0xe7ec('0x2')]},'appdata':{'type':Sequelize[_0xe7ec('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 1081ae7..679eeb0 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 _0x7b19=['save','then','destroy','sendStatus','name','send','map','IntegrationReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','find','body','update','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','limit','count','Content-Range','apply'];(function(_0x4fc421,_0x94e88){var _0x8c6d63=function(_0x5b8b42){while(--_0x5b8b42){_0x4fc421['push'](_0x4fc421['shift']());}};_0x8c6d63(++_0x94e88);}(_0x7b19,0x139));var _0x97b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7b19[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x97b1('0x0'));var zipdir=require(_0x97b1('0x1'));var jsonpatch=require(_0x97b1('0x2'));var rp=require('request-promise');var moment=require(_0x97b1('0x3'));var BPromise=require(_0x97b1('0x4'));var Mustache=require(_0x97b1('0x5'));var util=require('util');var path=require(_0x97b1('0x6'));var sox=require(_0x97b1('0x7'));var csv=require(_0x97b1('0x8'));var ejs=require(_0x97b1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x97b1('0xa'));var crypto=require(_0x97b1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x97b1('0xc'));var toCsv=require(_0x97b1('0x8'));var querystring=require(_0x97b1('0xd'));var Papa=require(_0x97b1('0xe'));var Redis=require(_0x97b1('0xf'));var authService=require(_0x97b1('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x97b1('0x11'));var hardwareService=require(_0x97b1('0x12'));var logger=require(_0x97b1('0x13'))(_0x97b1('0x14'));var utils=require(_0x97b1('0x15'));var config=require(_0x97b1('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4dd6a6,_0x38672e){_0x38672e=_0x38672e||0xcc;return function(_0x1af1ba){if(_0x1af1ba){return _0x4dd6a6['sendStatus'](_0x38672e);}return _0x4dd6a6[_0x97b1('0x17')](_0x38672e)[_0x97b1('0x18')]();};}function respondWithResult(_0x17539f,_0x1512a6){_0x1512a6=_0x1512a6||0xc8;return function(_0x16089b){if(_0x16089b){return _0x17539f[_0x97b1('0x17')](_0x1512a6)[_0x97b1('0x19')](_0x16089b);}};}function respondWithFilteredResult(_0x2d6344,_0x140210){return function(_0x12c32f){if(_0x12c32f){var _0x52c91a=typeof _0x140210[_0x97b1('0x1a')]===_0x97b1('0x1b')&&typeof _0x140210[_0x97b1('0x1c')]===_0x97b1('0x1b');var _0x5ac532=_0x12c32f[_0x97b1('0x1d')];var _0x5884fd=_0x52c91a?0x0:_0x140210['offset'];var _0x3480e1=_0x52c91a?_0x12c32f[_0x97b1('0x1d')]:_0x140210['offset']+_0x140210[_0x97b1('0x1c')];var _0x555ac8;if(_0x3480e1>=_0x5ac532){_0x3480e1=_0x5ac532;_0x555ac8=0xc8;}else{_0x555ac8=0xce;}_0x2d6344[_0x97b1('0x17')](_0x555ac8);return _0x2d6344['set'](_0x97b1('0x1e'),_0x5884fd+'-'+_0x3480e1+'/'+_0x5ac532)[_0x97b1('0x19')](_0x12c32f);}return null;};}function patchUpdates(_0x1a6385){return function(_0x50ea64){try{jsonpatch[_0x97b1('0x1f')](_0x50ea64,_0x1a6385,!![]);}catch(_0x1e636f){return BPromise['reject'](_0x1e636f);}return _0x50ea64[_0x97b1('0x20')]();};}function saveUpdates(_0x1b0544,_0x201da2){return function(_0x193807){if(_0x193807){return _0x193807['update'](_0x1b0544)[_0x97b1('0x21')](function(_0xd4f1c9){return _0xd4f1c9;});}return null;};}function removeEntity(_0x1a8a28,_0x4cdfd8){return function(_0x3d7192){if(_0x3d7192){return _0x3d7192[_0x97b1('0x22')]()[_0x97b1('0x21')](function(){_0x1a8a28[_0x97b1('0x17')](0xcc)[_0x97b1('0x18')]();});}};}function handleEntityNotFound(_0x1d9690,_0x9d9e24){return function(_0x16f096){if(!_0x16f096){_0x1d9690[_0x97b1('0x23')](0x194);}return _0x16f096;};}function handleError(_0xe340ab,_0x1dbd0c){_0x1dbd0c=_0x1dbd0c||0x1f4;return function(_0x394841){logger['error'](_0x394841['stack']);if(_0x394841[_0x97b1('0x24')]){delete _0x394841[_0x97b1('0x24')];}_0xe340ab[_0x97b1('0x17')](_0x1dbd0c)[_0x97b1('0x25')](_0x394841);};}exports['index']=function(_0x5e43df,_0x28edd2){var _0x4a055e={},_0x15185a={},_0x46e6de={'count':0x0,'rows':[]};var _0x2523d5=_[_0x97b1('0x26')](db[_0x97b1('0x27')][_0x97b1('0x28')],function(_0x782036){return{'name':_0x782036[_0x97b1('0x29')],'type':_0x782036[_0x97b1('0x2a')]['key']};});_0x15185a[_0x97b1('0x2b')]=_[_0x97b1('0x26')](_0x2523d5,_0x97b1('0x24'));_0x15185a[_0x97b1('0x2c')]=_[_0x97b1('0x2d')](_0x5e43df['query']);_0x15185a['filters']=_[_0x97b1('0x2e')](_0x15185a['model'],_0x15185a['query']);_0x4a055e[_0x97b1('0x2f')]=_[_0x97b1('0x2e')](_0x15185a[_0x97b1('0x2b')],qs[_0x97b1('0x30')](_0x5e43df[_0x97b1('0x2c')][_0x97b1('0x30')]));_0x4a055e['attributes']=_0x4a055e[_0x97b1('0x2f')]['length']?_0x4a055e['attributes']:_0x15185a[_0x97b1('0x2b')];if(!_0x5e43df[_0x97b1('0x2c')][_0x97b1('0x31')](_0x97b1('0x32'))){_0x4a055e[_0x97b1('0x1c')]=qs['limit'](_0x5e43df[_0x97b1('0x2c')]['limit']);_0x4a055e[_0x97b1('0x1a')]=qs[_0x97b1('0x1a')](_0x5e43df[_0x97b1('0x2c')][_0x97b1('0x1a')]);}_0x4a055e[_0x97b1('0x33')]=qs[_0x97b1('0x34')](_0x5e43df[_0x97b1('0x2c')][_0x97b1('0x34')]);_0x4a055e[_0x97b1('0x35')]=qs[_0x97b1('0x36')](_[_0x97b1('0x37')](_0x5e43df[_0x97b1('0x2c')],_0x15185a[_0x97b1('0x36')]),_0x2523d5);if(_0x5e43df['query'][_0x97b1('0x38')]){_0x4a055e['where']=_[_0x97b1('0x39')](_0x4a055e[_0x97b1('0x35')],{'$or':_['map'](_0x2523d5,function(_0xf17c01){if(_0xf17c01['type']!==_0x97b1('0x3a')){var _0x19dedb={};_0x19dedb[_0xf17c01['name']]={'$like':'%'+_0x5e43df['query'][_0x97b1('0x38')]+'%'};return _0x19dedb;}})});}_0x4a055e=_[_0x97b1('0x39')]({},_0x4a055e,_0x5e43df['options']);var _0x4684d0={'where':_0x4a055e[_0x97b1('0x35')]};return db[_0x97b1('0x27')][_0x97b1('0x1d')](_0x4684d0)['then'](function(_0x118bf7){_0x46e6de[_0x97b1('0x1d')]=_0x118bf7;if(_0x5e43df[_0x97b1('0x2c')][_0x97b1('0x3b')]){_0x4a055e[_0x97b1('0x3c')]=[{'all':!![]}];}return db[_0x97b1('0x27')][_0x97b1('0x3d')](_0x4a055e);})[_0x97b1('0x21')](function(_0x5c6a76){_0x46e6de[_0x97b1('0x3e')]=_0x5c6a76;return _0x46e6de;})['then'](respondWithFilteredResult(_0x28edd2,_0x4a055e))[_0x97b1('0x3f')](handleError(_0x28edd2,null));};exports['show']=function(_0x266f36,_0x1cda34){var _0x26048c={'raw':![],'where':{'id':_0x266f36[_0x97b1('0x40')]['id']}},_0x2b6ba3={};_0x2b6ba3[_0x97b1('0x2b')]=_[_0x97b1('0x2d')](db['IntegrationReport'][_0x97b1('0x28')]);_0x2b6ba3[_0x97b1('0x2c')]=_[_0x97b1('0x2d')](_0x266f36[_0x97b1('0x2c')]);_0x2b6ba3[_0x97b1('0x36')]=_[_0x97b1('0x2e')](_0x2b6ba3['model'],_0x2b6ba3[_0x97b1('0x2c')]);_0x26048c[_0x97b1('0x2f')]=_[_0x97b1('0x2e')](_0x2b6ba3[_0x97b1('0x2b')],qs[_0x97b1('0x30')](_0x266f36[_0x97b1('0x2c')][_0x97b1('0x30')]));_0x26048c[_0x97b1('0x2f')]=_0x26048c[_0x97b1('0x2f')]['length']?_0x26048c['attributes']:_0x2b6ba3[_0x97b1('0x2b')];if(_0x266f36[_0x97b1('0x2c')][_0x97b1('0x3b')]){_0x26048c[_0x97b1('0x3c')]=[{'all':!![]}];}_0x26048c=_[_0x97b1('0x39')]({},_0x26048c,_0x266f36['options']);return db['IntegrationReport'][_0x97b1('0x41')](_0x26048c)[_0x97b1('0x21')](handleEntityNotFound(_0x1cda34,null))[_0x97b1('0x21')](respondWithResult(_0x1cda34,null))[_0x97b1('0x3f')](handleError(_0x1cda34,null));};exports['create']=function(_0x459297,_0x3e2428){return db[_0x97b1('0x27')]['create'](_0x459297[_0x97b1('0x42')],{})[_0x97b1('0x21')](respondWithResult(_0x3e2428,0xc9))[_0x97b1('0x3f')](handleError(_0x3e2428,null));};exports[_0x97b1('0x43')]=function(_0x4e3405,_0x202183){if(_0x4e3405[_0x97b1('0x42')]['id']){delete _0x4e3405[_0x97b1('0x42')]['id'];}return db['IntegrationReport'][_0x97b1('0x41')]({'where':{'id':_0x4e3405[_0x97b1('0x40')]['id']}})[_0x97b1('0x21')](handleEntityNotFound(_0x202183,null))['then'](saveUpdates(_0x4e3405[_0x97b1('0x42')],null))[_0x97b1('0x21')](respondWithResult(_0x202183,null))[_0x97b1('0x3f')](handleError(_0x202183,null));};exports['destroy']=function(_0x2dc47c,_0x42b78f){return db[_0x97b1('0x27')][_0x97b1('0x41')]({'where':{'id':_0x2dc47c[_0x97b1('0x40')]['id']}})['then'](handleEntityNotFound(_0x42b78f,null))['then'](removeEntity(_0x42b78f,null))[_0x97b1('0x3f')](handleError(_0x42b78f,null));};exports['describe']=function(_0x5b24de,_0xa7a25b){return db[_0x97b1('0x27')][_0x97b1('0x44')]()['then'](respondWithResult(_0xa7a25b,null))['catch'](handleError(_0xa7a25b,null));}; \ No newline at end of file +var _0x473e=['../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','offset','count','set','reject','save','update','then','destroy','error','stack','name','map','rawAttributes','fieldName','query','intersection','model','fields','attributes','length','order','where','filters','filter','merge','type','VIRTUAL','IntegrationReport','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x8ada36,_0x28eca6){var _0x24f2d9=function(_0x486d13){while(--_0x486d13){_0x8ada36['push'](_0x8ada36['shift']());}};_0x24f2d9(++_0x28eca6);}(_0x473e,0xbc));var _0xe473=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x473e[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xe473('0x0'));var rimraf=require(_0xe473('0x1'));var zipdir=require(_0xe473('0x2'));var jsonpatch=require(_0xe473('0x3'));var rp=require(_0xe473('0x4'));var moment=require('moment');var BPromise=require(_0xe473('0x5'));var Mustache=require(_0xe473('0x6'));var util=require(_0xe473('0x7'));var path=require('path');var sox=require(_0xe473('0x8'));var csv=require(_0xe473('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe473('0xa'));var jsforce=require(_0xe473('0xb'));var deskjs=require(_0xe473('0xc'));var toCsv=require(_0xe473('0x9'));var querystring=require(_0xe473('0xd'));var Papa=require(_0xe473('0xe'));var Redis=require(_0xe473('0xf'));var authService=require(_0xe473('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe473('0x11'));var hardwareService=require(_0xe473('0x12'));var logger=require(_0xe473('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe473('0x14'));var db=require(_0xe473('0x15'))['db'];function respondWithStatusCode(_0x1f1113,_0x267acf){_0x267acf=_0x267acf||0xcc;return function(_0x3bd210){if(_0x3bd210){return _0x1f1113[_0xe473('0x16')](_0x267acf);}return _0x1f1113[_0xe473('0x17')](_0x267acf)[_0xe473('0x18')]();};}function respondWithResult(_0x229bfb,_0x9ff3a1){_0x9ff3a1=_0x9ff3a1||0xc8;return function(_0xe69c85){if(_0xe69c85){return _0x229bfb[_0xe473('0x17')](_0x9ff3a1)[_0xe473('0x19')](_0xe69c85);}};}function respondWithFilteredResult(_0x59627a,_0x9dd8a2){return function(_0xc4043c){if(_0xc4043c){var _0x310e79=typeof _0x9dd8a2['offset']==='undefined'&&typeof _0x9dd8a2[_0xe473('0x1a')]===_0xe473('0x1b');var _0x22da71=_0xc4043c['count'];var _0x3462e8=_0x310e79?0x0:_0x9dd8a2[_0xe473('0x1c')];var _0x5912d7=_0x310e79?_0xc4043c[_0xe473('0x1d')]:_0x9dd8a2[_0xe473('0x1c')]+_0x9dd8a2[_0xe473('0x1a')];var _0x33c712;if(_0x5912d7>=_0x22da71){_0x5912d7=_0x22da71;_0x33c712=0xc8;}else{_0x33c712=0xce;}_0x59627a[_0xe473('0x17')](_0x33c712);return _0x59627a[_0xe473('0x1e')]('Content-Range',_0x3462e8+'-'+_0x5912d7+'/'+_0x22da71)[_0xe473('0x19')](_0xc4043c);}return null;};}function patchUpdates(_0x8b11fd){return function(_0x2878e7){try{jsonpatch['apply'](_0x2878e7,_0x8b11fd,!![]);}catch(_0x277445){return BPromise[_0xe473('0x1f')](_0x277445);}return _0x2878e7[_0xe473('0x20')]();};}function saveUpdates(_0x10bb0f,_0x2ef7ed){return function(_0x434145){if(_0x434145){return _0x434145[_0xe473('0x21')](_0x10bb0f)[_0xe473('0x22')](function(_0x1b8703){return _0x1b8703;});}return null;};}function removeEntity(_0x4c6076,_0x97da0f){return function(_0x5db6fb){if(_0x5db6fb){return _0x5db6fb[_0xe473('0x23')]()[_0xe473('0x22')](function(){_0x4c6076['status'](0xcc)[_0xe473('0x18')]();});}};}function handleEntityNotFound(_0x160815,_0x2ddb7c){return function(_0x7aed71){if(!_0x7aed71){_0x160815[_0xe473('0x16')](0x194);}return _0x7aed71;};}function handleError(_0x3a54d4,_0x413ca9){_0x413ca9=_0x413ca9||0x1f4;return function(_0x53f039){logger[_0xe473('0x24')](_0x53f039[_0xe473('0x25')]);if(_0x53f039['name']){delete _0x53f039[_0xe473('0x26')];}_0x3a54d4[_0xe473('0x17')](_0x413ca9)['send'](_0x53f039);};}exports['index']=function(_0x51d896,_0x28d647){var _0x257817={},_0x2aa02b={},_0x515e9c={'count':0x0,'rows':[]};var _0x484f19=_[_0xe473('0x27')](db['IntegrationReport'][_0xe473('0x28')],function(_0xd6780b){return{'name':_0xd6780b[_0xe473('0x29')],'type':_0xd6780b['type']['key']};});_0x2aa02b['model']=_[_0xe473('0x27')](_0x484f19,'name');_0x2aa02b['query']=_['keys'](_0x51d896[_0xe473('0x2a')]);_0x2aa02b['filters']=_[_0xe473('0x2b')](_0x2aa02b[_0xe473('0x2c')],_0x2aa02b[_0xe473('0x2a')]);_0x257817['attributes']=_[_0xe473('0x2b')](_0x2aa02b[_0xe473('0x2c')],qs[_0xe473('0x2d')](_0x51d896[_0xe473('0x2a')][_0xe473('0x2d')]));_0x257817[_0xe473('0x2e')]=_0x257817[_0xe473('0x2e')][_0xe473('0x2f')]?_0x257817[_0xe473('0x2e')]:_0x2aa02b['model'];if(!_0x51d896[_0xe473('0x2a')]['hasOwnProperty']('nolimit')){_0x257817['limit']=qs['limit'](_0x51d896[_0xe473('0x2a')]['limit']);_0x257817[_0xe473('0x1c')]=qs[_0xe473('0x1c')](_0x51d896[_0xe473('0x2a')]['offset']);}_0x257817[_0xe473('0x30')]=qs['sort'](_0x51d896[_0xe473('0x2a')]['sort']);_0x257817[_0xe473('0x31')]=qs[_0xe473('0x32')](_['pick'](_0x51d896[_0xe473('0x2a')],_0x2aa02b[_0xe473('0x32')]),_0x484f19);if(_0x51d896[_0xe473('0x2a')][_0xe473('0x33')]){_0x257817[_0xe473('0x31')]=_[_0xe473('0x34')](_0x257817[_0xe473('0x31')],{'$or':_[_0xe473('0x27')](_0x484f19,function(_0x63340){if(_0x63340[_0xe473('0x35')]!==_0xe473('0x36')){var _0x3897a4={};_0x3897a4[_0x63340[_0xe473('0x26')]]={'$like':'%'+_0x51d896[_0xe473('0x2a')][_0xe473('0x33')]+'%'};return _0x3897a4;}})});}_0x257817=_['merge']({},_0x257817,_0x51d896['options']);var _0xfd1d67={'where':_0x257817[_0xe473('0x31')]};return db[_0xe473('0x37')]['count'](_0xfd1d67)[_0xe473('0x22')](function(_0x5e0247){_0x515e9c[_0xe473('0x1d')]=_0x5e0247;if(_0x51d896[_0xe473('0x2a')][_0xe473('0x38')]){_0x257817[_0xe473('0x39')]=[{'all':!![]}];}return db[_0xe473('0x37')][_0xe473('0x3a')](_0x257817);})['then'](function(_0x5d31f7){_0x515e9c[_0xe473('0x3b')]=_0x5d31f7;return _0x515e9c;})[_0xe473('0x22')](respondWithFilteredResult(_0x28d647,_0x257817))[_0xe473('0x3c')](handleError(_0x28d647,null));};exports[_0xe473('0x3d')]=function(_0x388f11,_0x2d73e0){var _0x2ed81e={'raw':![],'where':{'id':_0x388f11[_0xe473('0x3e')]['id']}},_0x3f326f={};_0x3f326f[_0xe473('0x2c')]=_[_0xe473('0x3f')](db[_0xe473('0x37')]['rawAttributes']);_0x3f326f[_0xe473('0x2a')]=_[_0xe473('0x3f')](_0x388f11[_0xe473('0x2a')]);_0x3f326f[_0xe473('0x32')]=_['intersection'](_0x3f326f[_0xe473('0x2c')],_0x3f326f[_0xe473('0x2a')]);_0x2ed81e[_0xe473('0x2e')]=_['intersection'](_0x3f326f[_0xe473('0x2c')],qs['fields'](_0x388f11[_0xe473('0x2a')][_0xe473('0x2d')]));_0x2ed81e[_0xe473('0x2e')]=_0x2ed81e[_0xe473('0x2e')][_0xe473('0x2f')]?_0x2ed81e['attributes']:_0x3f326f['model'];if(_0x388f11['query'][_0xe473('0x38')]){_0x2ed81e[_0xe473('0x39')]=[{'all':!![]}];}_0x2ed81e=_['merge']({},_0x2ed81e,_0x388f11[_0xe473('0x40')]);return db[_0xe473('0x37')][_0xe473('0x41')](_0x2ed81e)[_0xe473('0x22')](handleEntityNotFound(_0x2d73e0,null))['then'](respondWithResult(_0x2d73e0,null))[_0xe473('0x3c')](handleError(_0x2d73e0,null));};exports[_0xe473('0x42')]=function(_0x504357,_0x3aa6e7){return db[_0xe473('0x37')]['create'](_0x504357[_0xe473('0x43')],{})[_0xe473('0x22')](respondWithResult(_0x3aa6e7,0xc9))[_0xe473('0x3c')](handleError(_0x3aa6e7,null));};exports[_0xe473('0x21')]=function(_0x3ec89a,_0x5cbffa){if(_0x3ec89a[_0xe473('0x43')]['id']){delete _0x3ec89a[_0xe473('0x43')]['id'];}return db[_0xe473('0x37')]['find']({'where':{'id':_0x3ec89a[_0xe473('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5cbffa,null))[_0xe473('0x22')](saveUpdates(_0x3ec89a['body'],null))[_0xe473('0x22')](respondWithResult(_0x5cbffa,null))[_0xe473('0x3c')](handleError(_0x5cbffa,null));};exports[_0xe473('0x23')]=function(_0x10509a,_0x352d8e){return db['IntegrationReport'][_0xe473('0x41')]({'where':{'id':_0x10509a[_0xe473('0x3e')]['id']}})[_0xe473('0x22')](handleEntityNotFound(_0x352d8e,null))['then'](removeEntity(_0x352d8e,null))['catch'](handleError(_0x352d8e,null));};exports[_0xe473('0x44')]=function(_0x1d11de,_0x302d6f){return db[_0xe473('0x37')][_0xe473('0x44')]()[_0xe473('0x22')](respondWithResult(_0x302d6f,null))[_0xe473('0x3c')](handleError(_0x302d6f,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 11a38da..29e60f4 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 _0x1c78=['exports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./integrationReport.attributes'];(function(_0x515d16,_0x4dc95e){var _0x789eff=function(_0x5badd1){while(--_0x5badd1){_0x515d16['push'](_0x515d16['shift']());}};_0x789eff(++_0x4dc95e);}(_0x1c78,0x1eb));var _0x81c7=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x1c78[_0x16d10f];return _0x50c823;};'use strict';var _=require(_0x81c7('0x0'));var util=require('util');var logger=require(_0x81c7('0x1'))(_0x81c7('0x2'));var moment=require(_0x81c7('0x3'));var BPromise=require(_0x81c7('0x4'));var rp=require(_0x81c7('0x5'));var fs=require('fs');var path=require(_0x81c7('0x6'));var rimraf=require(_0x81c7('0x7'));var config=require('../../config/environment');var attributes=require(_0x81c7('0x8'));module[_0x81c7('0x9')]=function(_0x4799c7,_0x53dcc4){return _0x4799c7['define']('IntegrationReport',attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x691c=['define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','exports'];(function(_0xe3cdae,_0x152d75){var _0x427679=function(_0x58539b){while(--_0x58539b){_0xe3cdae['push'](_0xe3cdae['shift']());}};_0x427679(++_0x152d75);}(_0x691c,0xf3));var _0xc691=function(_0x950c48,_0x3acdaf){_0x950c48=_0x950c48-0x0;var _0x20398c=_0x691c[_0x950c48];return _0x20398c;};'use strict';var _=require(_0xc691('0x0'));var util=require(_0xc691('0x1'));var logger=require(_0xc691('0x2'))(_0xc691('0x3'));var moment=require(_0xc691('0x4'));var BPromise=require(_0xc691('0x5'));var rp=require(_0xc691('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc691('0x7'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0xc691('0x8')]=function(_0x18c8fc,_0x32683f){return _0x18c8fc[_0xc691('0x9')](_0xc691('0xa'),attributes,{'tableName':_0xc691('0xb'),'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 ccfe95d..f9bfb3c 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 _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0x53ec,0x192));var _0xc53e=function(_0x2781b0,_0x4ec0d2){_0x2781b0=_0x2781b0-0x0;var _0xb532ba=_0x53ec[_0x2781b0];return _0xb532ba;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('IntegrationReport,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file +var _0x4819=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','util','moment'];(function(_0x56fecd,_0x5350f0){var _0x53d636=function(_0xd697ef){while(--_0xd697ef){_0x56fecd['push'](_0x56fecd['shift']());}};_0x53d636(++_0x5350f0);}(_0x4819,0xcd));var _0x9481=function(_0xabca41,_0xbfdf4a){_0xabca41=_0xabca41-0x0;var _0x404ccb=_0x4819[_0xabca41];return _0x404ccb;};'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/interval/index.js b/server/api/interval/index.js index a389fdc..58fc72e 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 _0xcf8c=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','update','delete','exports','multer','util'];(function(_0x416412,_0x23d936){var _0x43473f=function(_0x295f91){while(--_0x295f91){_0x416412['push'](_0x416412['shift']());}};_0x43473f(++_0x23d936);}(_0xcf8c,0xf0));var _0xccf8=function(_0x22fdfd,_0x5304da){_0x22fdfd=_0x22fdfd-0x0;var _0x1385b3=_0xcf8c[_0x22fdfd];return _0x1385b3;};'use strict';var multer=require(_0xccf8('0x0'));var util=require(_0xccf8('0x1'));var path=require(_0xccf8('0x2'));var timeout=require(_0xccf8('0x3'));var express=require(_0xccf8('0x4'));var router=express[_0xccf8('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xccf8('0x6'));var config=require(_0xccf8('0x7'));var controller=require(_0xccf8('0x8'));router[_0xccf8('0x9')]('/',auth[_0xccf8('0xa')](),controller[_0xccf8('0xb')]);router[_0xccf8('0x9')](_0xccf8('0xc'),auth[_0xccf8('0xa')](),controller['show']);router['get'](_0xccf8('0xd'),auth[_0xccf8('0xa')](),controller[_0xccf8('0xe')]);router[_0xccf8('0xf')]('/',auth[_0xccf8('0xa')](),controller[_0xccf8('0x10')]);router['post']('/:id/sub_intervals',auth[_0xccf8('0xa')](),controller['addInterval']);router[_0xccf8('0xf')](_0xccf8('0x11'),auth['isAuthenticated'](),controller[_0xccf8('0x12')]);router['put']('/:id',auth[_0xccf8('0xa')](),controller[_0xccf8('0x13')]);router[_0xccf8('0x14')](_0xccf8('0xc'),auth[_0xccf8('0xa')](),controller['destroy']);module[_0xccf8('0x15')]=router; \ No newline at end of file +var _0x2ba6=['/:id/sub_intervals','isAuthenticated','getIntervals','post','create','/:id/sub_intervals/create_many','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','index','/:id','show'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x2ba6,0x1ea));var _0x62ba=function(_0x3ea415,_0x33e421){_0x3ea415=_0x3ea415-0x0;var _0x1a6dde=_0x2ba6[_0x3ea415];return _0x1a6dde;};'use strict';var multer=require(_0x62ba('0x0'));var util=require(_0x62ba('0x1'));var path=require(_0x62ba('0x2'));var timeout=require(_0x62ba('0x3'));var express=require(_0x62ba('0x4'));var router=express['Router']();var fs_extra=require(_0x62ba('0x5'));var auth=require(_0x62ba('0x6'));var interaction=require(_0x62ba('0x7'));var config=require(_0x62ba('0x8'));var controller=require(_0x62ba('0x9'));router[_0x62ba('0xa')]('/',auth['isAuthenticated'](),controller[_0x62ba('0xb')]);router[_0x62ba('0xa')](_0x62ba('0xc'),auth['isAuthenticated'](),controller[_0x62ba('0xd')]);router['get'](_0x62ba('0xe'),auth[_0x62ba('0xf')](),controller[_0x62ba('0x10')]);router[_0x62ba('0x11')]('/',auth[_0x62ba('0xf')](),controller[_0x62ba('0x12')]);router[_0x62ba('0x11')](_0x62ba('0xe'),auth[_0x62ba('0xf')](),controller['addInterval']);router[_0x62ba('0x11')](_0x62ba('0x13'),auth[_0x62ba('0xf')](),controller['addIntervals']);router['put'](_0x62ba('0xc'),auth[_0x62ba('0xf')](),controller[_0x62ba('0x14')]);router[_0x62ba('0x15')](_0x62ba('0xc'),auth[_0x62ba('0xf')](),controller[_0x62ba('0x16')]);module[_0x62ba('0x17')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 9968a79..629742a 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 _0x8258=['sequelize','exports','STRING'];(function(_0x1f66fe,_0x54993d){var _0x1a6e3a=function(_0x2ca73d){while(--_0x2ca73d){_0x1f66fe['push'](_0x1f66fe['shift']());}};_0x1a6e3a(++_0x54993d);}(_0x8258,0x14a));var _0x8825=function(_0xb1110,_0x3bec00){_0xb1110=_0xb1110-0x0;var _0xacd8ba=_0x8258[_0xb1110];return _0xacd8ba;};'use strict';var Sequelize=require(_0x8825('0x0'));module[_0x8825('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x8825('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x55a1=['STRING','sequelize','exports'];(function(_0x4ab32c,_0x44ab5e){var _0x2b9644=function(_0x498479){while(--_0x498479){_0x4ab32c['push'](_0x4ab32c['shift']());}};_0x2b9644(++_0x44ab5e);}(_0x55a1,0x169));var _0x155a=function(_0x127c30,_0x45dcef){_0x127c30=_0x127c30-0x0;var _0x172f51=_0x55a1[_0x127c30];return _0x172f51;};'use strict';var Sequelize=require(_0x155a('0x0'));module[_0x155a('0x1')]={'name':{'type':Sequelize[_0x155a('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x155a('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 f4e878d..1fc8dbb 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 _0xfc0b=['moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../components/extensions/rewrite','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','Intervals','UserProfileResource','destroy','sendStatus','stack','name','send','index','Interval','rawAttributes','fieldName','key','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','intersection','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','sequelize','transaction','rimraf','zip-dir','request-promise'];(function(_0x4b793c,_0x4bc7f9){var _0x4c79c9=function(_0x121a5d){while(--_0x121a5d){_0x4b793c['push'](_0x4b793c['shift']());}};_0x4c79c9(++_0x4bc7f9);}(_0xfc0b,0x16d));var _0xbfc0=function(_0x3ac8a4,_0x10bc3d){_0x3ac8a4=_0x3ac8a4-0x0;var _0x49105f=_0xfc0b[_0x3ac8a4];return _0x49105f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbfc0('0x0'));var zipdir=require(_0xbfc0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbfc0('0x2'));var moment=require(_0xbfc0('0x3'));var BPromise=require(_0xbfc0('0x4'));var Mustache=require(_0xbfc0('0x5'));var util=require(_0xbfc0('0x6'));var path=require('path');var sox=require(_0xbfc0('0x7'));var csv=require(_0xbfc0('0x8'));var ejs=require(_0xbfc0('0x9'));var fs=require('fs');var fs_extra=require(_0xbfc0('0xa'));var _=require(_0xbfc0('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbfc0('0xc'));var deskjs=require(_0xbfc0('0xd'));var toCsv=require(_0xbfc0('0x8'));var querystring=require(_0xbfc0('0xe'));var Papa=require(_0xbfc0('0xf'));var Redis=require(_0xbfc0('0x10'));var authService=require(_0xbfc0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbfc0('0x12'));var hardwareService=require(_0xbfc0('0x13'));var logger=require(_0xbfc0('0x14'))(_0xbfc0('0x15'));var utils=require(_0xbfc0('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var extensions=require(_0xbfc0('0x17'));function respondWithStatusCode(_0x2db607,_0x55d619){_0x55d619=_0x55d619||0xcc;return function(_0x174c95){if(_0x174c95){return _0x2db607['sendStatus'](_0x55d619);}return _0x2db607[_0xbfc0('0x18')](_0x55d619)[_0xbfc0('0x19')]();};}function respondWithResult(_0x2f1c19,_0x229695){_0x229695=_0x229695||0xc8;return function(_0x342509){if(_0x342509){return _0x2f1c19[_0xbfc0('0x18')](_0x229695)[_0xbfc0('0x1a')](_0x342509);}};}function respondWithFilteredResult(_0x4c2de5,_0x36069a){return function(_0x31df80){if(_0x31df80){var _0x1d049d=typeof _0x36069a[_0xbfc0('0x1b')]==='undefined'&&typeof _0x36069a[_0xbfc0('0x1c')]==='undefined';var _0x3ec402=_0x31df80[_0xbfc0('0x1d')];var _0x25a3bb=_0x1d049d?0x0:_0x36069a[_0xbfc0('0x1b')];var _0x1374e9=_0x1d049d?_0x31df80[_0xbfc0('0x1d')]:_0x36069a['offset']+_0x36069a[_0xbfc0('0x1c')];var _0x55ab57;if(_0x1374e9>=_0x3ec402){_0x1374e9=_0x3ec402;_0x55ab57=0xc8;}else{_0x55ab57=0xce;}_0x4c2de5[_0xbfc0('0x18')](_0x55ab57);return _0x4c2de5['set'](_0xbfc0('0x1e'),_0x25a3bb+'-'+_0x1374e9+'/'+_0x3ec402)['json'](_0x31df80);}return null;};}function patchUpdates(_0x4a94be){return function(_0x2019ea){try{jsonpatch[_0xbfc0('0x1f')](_0x2019ea,_0x4a94be,!![]);}catch(_0x3a58aa){return BPromise[_0xbfc0('0x20')](_0x3a58aa);}return _0x2019ea[_0xbfc0('0x21')]();};}function saveUpdates(_0xf6a9e8,_0x232165){return function(_0xba8842){if(_0xba8842){return _0xba8842[_0xbfc0('0x22')](_0xf6a9e8)[_0xbfc0('0x23')](function(_0x2d10a1){return _0x2d10a1;});}return null;};}function removeEntity(_0x11b171,_0x3084da){return function(_0xd1af1){if(_0xd1af1){return _0xd1af1['destroy']()[_0xbfc0('0x23')](function(){var _0xc5e464=_0xd1af1['get']({'plain':!![]});var _0x46b720=_0xbfc0('0x24');return db[_0xbfc0('0x25')][_0xbfc0('0x26')]({'where':{'type':_0x46b720,'resourceId':_0xc5e464['id']}})[_0xbfc0('0x23')](function(){return _0xd1af1;});})['then'](function(){_0x11b171[_0xbfc0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x339f59,_0x2f53fd){return function(_0x471cfa){if(!_0x471cfa){_0x339f59[_0xbfc0('0x27')](0x194);}return _0x471cfa;};}function handleError(_0x12a002,_0x70f97d){_0x70f97d=_0x70f97d||0x1f4;return function(_0x58b3d2){logger['error'](_0x58b3d2[_0xbfc0('0x28')]);if(_0x58b3d2[_0xbfc0('0x29')]){delete _0x58b3d2[_0xbfc0('0x29')];}_0x12a002['status'](_0x70f97d)[_0xbfc0('0x2a')](_0x58b3d2);};}exports[_0xbfc0('0x2b')]=function(_0x3da836,_0x403b23){var _0xb8cb15={},_0x85d443={},_0x3638d4={'count':0x0,'rows':[]};var _0x42fed5=_['map'](db[_0xbfc0('0x2c')][_0xbfc0('0x2d')],function(_0x3aa58b){return{'name':_0x3aa58b[_0xbfc0('0x2e')],'type':_0x3aa58b['type'][_0xbfc0('0x2f')]};});_0x85d443[_0xbfc0('0x30')]=_[_0xbfc0('0x31')](_0x42fed5,_0xbfc0('0x29'));_0x85d443[_0xbfc0('0x32')]=_[_0xbfc0('0x33')](_0x3da836[_0xbfc0('0x32')]);_0x85d443['filters']=_['intersection'](_0x85d443[_0xbfc0('0x30')],_0x85d443[_0xbfc0('0x32')]);_0xb8cb15[_0xbfc0('0x34')]=_['intersection'](_0x85d443[_0xbfc0('0x30')],qs[_0xbfc0('0x35')](_0x3da836[_0xbfc0('0x32')][_0xbfc0('0x35')]));_0xb8cb15['attributes']=_0xb8cb15[_0xbfc0('0x34')][_0xbfc0('0x36')]?_0xb8cb15[_0xbfc0('0x34')]:_0x85d443['model'];if(!_0x3da836['query'][_0xbfc0('0x37')](_0xbfc0('0x38'))){_0xb8cb15[_0xbfc0('0x1c')]=qs[_0xbfc0('0x1c')](_0x3da836[_0xbfc0('0x32')][_0xbfc0('0x1c')]);_0xb8cb15[_0xbfc0('0x1b')]=qs[_0xbfc0('0x1b')](_0x3da836[_0xbfc0('0x32')][_0xbfc0('0x1b')]);}_0xb8cb15[_0xbfc0('0x39')]=qs[_0xbfc0('0x3a')](_0x3da836['query'][_0xbfc0('0x3a')]);_0xb8cb15[_0xbfc0('0x3b')]=qs[_0xbfc0('0x3c')](_[_0xbfc0('0x3d')](_0x3da836[_0xbfc0('0x32')],_0x85d443['filters']),_0x42fed5);if(_0x3da836['query'][_0xbfc0('0x3e')]){_0xb8cb15[_0xbfc0('0x3b')]=_[_0xbfc0('0x3f')](_0xb8cb15[_0xbfc0('0x3b')],{'$or':_[_0xbfc0('0x31')](_0x42fed5,function(_0x3b62c0){if(_0x3b62c0['type']!==_0xbfc0('0x40')){var _0x144690={};_0x144690[_0x3b62c0[_0xbfc0('0x29')]]={'$like':'%'+_0x3da836[_0xbfc0('0x32')]['filter']+'%'};return _0x144690;}})});}_0xb8cb15=_[_0xbfc0('0x3f')]({},_0xb8cb15,_0x3da836['options']);var _0x6f1194={'where':_0xb8cb15['where']};return db['Interval'][_0xbfc0('0x1d')](_0x6f1194)[_0xbfc0('0x23')](function(_0x3c6203){_0x3638d4[_0xbfc0('0x1d')]=_0x3c6203;if(_0x3da836[_0xbfc0('0x32')][_0xbfc0('0x41')]){_0xb8cb15[_0xbfc0('0x42')]=[{'all':!![]}];}return db[_0xbfc0('0x2c')][_0xbfc0('0x43')](_0xb8cb15);})[_0xbfc0('0x23')](function(_0xe6dbd5){_0x3638d4[_0xbfc0('0x44')]=_0xe6dbd5;return _0x3638d4;})[_0xbfc0('0x23')](respondWithFilteredResult(_0x403b23,_0xb8cb15))[_0xbfc0('0x45')](handleError(_0x403b23,null));};exports[_0xbfc0('0x46')]=function(_0x550ed8,_0xe1fcdd){var _0x3bb706={'raw':!![],'where':{'id':_0x550ed8[_0xbfc0('0x47')]['id']}},_0x21421d={};_0x21421d[_0xbfc0('0x30')]=_['keys'](db['Interval'][_0xbfc0('0x2d')]);_0x21421d['query']=_[_0xbfc0('0x33')](_0x550ed8[_0xbfc0('0x32')]);_0x21421d[_0xbfc0('0x3c')]=_[_0xbfc0('0x48')](_0x21421d[_0xbfc0('0x30')],_0x21421d[_0xbfc0('0x32')]);_0x3bb706[_0xbfc0('0x34')]=_[_0xbfc0('0x48')](_0x21421d[_0xbfc0('0x30')],qs[_0xbfc0('0x35')](_0x550ed8[_0xbfc0('0x32')]['fields']));_0x3bb706[_0xbfc0('0x34')]=_0x3bb706[_0xbfc0('0x34')][_0xbfc0('0x36')]?_0x3bb706[_0xbfc0('0x34')]:_0x21421d['model'];if(_0x550ed8[_0xbfc0('0x32')][_0xbfc0('0x41')]){_0x3bb706['include']=[{'all':!![]}];}_0x3bb706=_[_0xbfc0('0x3f')]({},_0x3bb706,_0x550ed8[_0xbfc0('0x49')]);return db['Interval'][_0xbfc0('0x4a')](_0x3bb706)['then'](handleEntityNotFound(_0xe1fcdd,null))[_0xbfc0('0x23')](respondWithResult(_0xe1fcdd,null))['catch'](handleError(_0xe1fcdd,null));};exports['create']=function(_0x5b52db,_0x22e6c8){return db[_0xbfc0('0x2c')][_0xbfc0('0x4b')](_0x5b52db[_0xbfc0('0x4c')],{})[_0xbfc0('0x23')](function(_0x485187){var _0x1f8d1f=_0x5b52db[_0xbfc0('0x4d')]['get']({'plain':!![]});if(!_0x1f8d1f)throw new Error(_0xbfc0('0x4e'));if(_0x1f8d1f[_0xbfc0('0x4f')]===_0xbfc0('0x4d')){var _0x2ef0cd=_0x485187[_0xbfc0('0x50')]({'plain':!![]});var _0x48118a=_0xbfc0('0x24');return db[_0xbfc0('0x51')]['find']({'where':{'name':_0x48118a,'userProfileId':_0x1f8d1f[_0xbfc0('0x52')]},'raw':!![]})['then'](function(_0x437b4e){if(_0x437b4e&&_0x437b4e[_0xbfc0('0x53')]===0x0){return db[_0xbfc0('0x25')][_0xbfc0('0x4b')]({'name':_0x2ef0cd[_0xbfc0('0x29')],'resourceId':_0x2ef0cd['id'],'type':_0x437b4e[_0xbfc0('0x29')],'sectionId':_0x437b4e['id']},{})['then'](function(){return _0x485187;});}else{return _0x485187;}})[_0xbfc0('0x45')](function(_0x13a3b5){logger[_0xbfc0('0x54')](_0xbfc0('0x55'),_0x13a3b5);throw _0x13a3b5;});}return _0x485187;})[_0xbfc0('0x23')](respondWithResult(_0x22e6c8,0xc9))['catch'](handleError(_0x22e6c8,null));};exports[_0xbfc0('0x22')]=function(_0x1c8c51,_0x343c95){if(_0x1c8c51[_0xbfc0('0x4c')]['id']){delete _0x1c8c51[_0xbfc0('0x4c')]['id'];}return db[_0xbfc0('0x2c')][_0xbfc0('0x4a')]({'where':{'id':_0x1c8c51[_0xbfc0('0x47')]['id']}})[_0xbfc0('0x23')](handleEntityNotFound(_0x343c95,null))[_0xbfc0('0x23')](saveUpdates(_0x1c8c51['body'],null))[_0xbfc0('0x23')](respondWithResult(_0x343c95,null))['catch'](handleError(_0x343c95,null));};exports[_0xbfc0('0x26')]=function(_0x16229d,_0xe54b93){return db['Interval']['find']({'where':{'id':_0x16229d[_0xbfc0('0x47')]['id']}})[_0xbfc0('0x23')](handleEntityNotFound(_0xe54b93,null))[_0xbfc0('0x23')](removeEntity(_0xe54b93,null))[_0xbfc0('0x45')](handleError(_0xe54b93,null));};exports[_0xbfc0('0x56')]=function(_0x2f4641,_0x12779c,_0x1589a6){if(_0x2f4641[_0xbfc0('0x4c')]['id']){delete _0x2f4641[_0xbfc0('0x4c')]['id'];}return db[_0xbfc0('0x2c')][_0xbfc0('0x4a')]({'where':{'id':_0x2f4641['params']['id']}})[_0xbfc0('0x23')](handleEntityNotFound(_0x12779c,null))[_0xbfc0('0x23')](function(_0x5d7c2f){if(_0x5d7c2f){_0x2f4641['body'][_0xbfc0('0x57')]=_0x5d7c2f['id'];return db['Interval'][_0xbfc0('0x4b')](_0x2f4641[_0xbfc0('0x4c')]);}})[_0xbfc0('0x23')](respondWithResult(_0x12779c,null))[_0xbfc0('0x45')](handleError(_0x12779c,null));};exports[_0xbfc0('0x58')]=function(_0x26b7a5,_0x388ed1,_0x51102d){var _0x71094d={};var _0x513f12={};var _0x3593e5;var _0xa5f64b;return db[_0xbfc0('0x2c')][_0xbfc0('0x59')]({'where':{'id':_0x26b7a5[_0xbfc0('0x47')]['id']}})[_0xbfc0('0x23')](handleEntityNotFound(_0x388ed1,null))[_0xbfc0('0x23')](function(_0xcbff49){if(_0xcbff49){_0x3593e5=_0xcbff49;_0x513f12[_0xbfc0('0x30')]=_[_0xbfc0('0x33')](db[_0xbfc0('0x2c')]['rawAttributes']);_0x513f12['query']=_['keys'](_0x26b7a5[_0xbfc0('0x32')]);_0x513f12[_0xbfc0('0x3c')]=_[_0xbfc0('0x48')](_0x513f12[_0xbfc0('0x30')],_0x513f12[_0xbfc0('0x32')]);_0x71094d['attributes']=_[_0xbfc0('0x48')](_0x513f12[_0xbfc0('0x30')],qs[_0xbfc0('0x35')](_0x26b7a5[_0xbfc0('0x32')][_0xbfc0('0x35')]));_0x71094d[_0xbfc0('0x34')]=_0x71094d[_0xbfc0('0x34')][_0xbfc0('0x36')]?_0x71094d['attributes']:_0x513f12[_0xbfc0('0x30')];_0x71094d['order']=qs['sort'](_0x26b7a5[_0xbfc0('0x32')][_0xbfc0('0x3a')]);_0x71094d[_0xbfc0('0x3b')]=qs['filters'](_[_0xbfc0('0x3d')](_0x26b7a5[_0xbfc0('0x32')],_0x513f12['filters']));if(_0x26b7a5[_0xbfc0('0x32')]['filter']){_0x71094d[_0xbfc0('0x3b')]=_['merge'](_0x71094d[_0xbfc0('0x3b')],{'$or':_[_0xbfc0('0x31')](_0x71094d[_0xbfc0('0x34')],function(_0xc75c65){var _0xa56e84={};_0xa56e84[_0xc75c65]={'$like':'%'+_0x26b7a5['query']['filter']+'%'};return _0xa56e84;})});}_0x71094d=_[_0xbfc0('0x3f')]({},_0x71094d,_0x26b7a5[_0xbfc0('0x49')]);return _0x3593e5[_0xbfc0('0x58')](_0x71094d);}})[_0xbfc0('0x23')](function(_0x446e8d){if(_0x446e8d){_0xa5f64b=_0x446e8d[_0xbfc0('0x36')];if(!_0x26b7a5[_0xbfc0('0x32')][_0xbfc0('0x37')](_0xbfc0('0x38'))){_0x71094d['limit']=qs['limit'](_0x26b7a5[_0xbfc0('0x32')]['limit']);_0x71094d[_0xbfc0('0x1b')]=qs[_0xbfc0('0x1b')](_0x26b7a5[_0xbfc0('0x32')][_0xbfc0('0x1b')]);}return _0x3593e5['getIntervals'](_0x71094d);}})[_0xbfc0('0x23')](function(_0x43ca3c){if(_0x43ca3c){return _0x43ca3c?{'count':_0xa5f64b,'rows':_0x43ca3c}:null;}})[_0xbfc0('0x23')](respondWithResult(_0x388ed1,null))[_0xbfc0('0x45')](handleError(_0x388ed1,null));};exports['addIntervals']=function(_0x13aceb,_0x518853,_0x665247){return db[_0xbfc0('0x2c')][_0xbfc0('0x59')]({'where':{'id':_0x13aceb['params']['id']}})[_0xbfc0('0x23')](handleEntityNotFound(_0x518853,null))['then'](function(_0x522cdc){if(_0x522cdc){return db[_0xbfc0('0x5a')][_0xbfc0('0x5b')](function(_0x511f98){return db[_0xbfc0('0x2c')][_0xbfc0('0x26')]({'where':{'IntervalId':_0x13aceb['params']['id']},'transaction':_0x511f98})[_0xbfc0('0x23')](function(_0x3ecaa4){var _0x419160=_[_0xbfc0('0x31')](_0x13aceb[_0xbfc0('0x4c')],function(_0x3b00c8){delete _0x3b00c8['id'];_0x3b00c8['IntervalId']=_0x13aceb[_0xbfc0('0x47')]['id'];return _0x3b00c8;});return db[_0xbfc0('0x2c')]['bulkCreate'](_0x419160,{'transaction':_0x511f98});});})[_0xbfc0('0x23')](function(){return db[_0xbfc0('0x2c')]['findAll']({'where':{'IntervalId':_0x13aceb[_0xbfc0('0x47')]['id']}});});}})[_0xbfc0('0x23')](respondWithResult(_0x518853,null))[_0xbfc0('0x45')](handleError(_0x518853,null));}; \ No newline at end of file +var _0x1964=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','findOne','pick','options','sequelize','transaction','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','get','Intervals','UserProfileResource','error','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','includeAll','include','findAll','rows','catch','params','find','create','body','user'];(function(_0x53e19f,_0x32f8bd){var _0x2e41eb=function(_0x514275){while(--_0x514275){_0x53e19f['push'](_0x53e19f['shift']());}};_0x2e41eb(++_0x32f8bd);}(_0x1964,0x185));var _0x4196=function(_0x2e4adb,_0x56688b){_0x2e4adb=_0x2e4adb-0x0;var _0x404de5=_0x1964[_0x2e4adb];return _0x404de5;};'use strict';var emlformat=require(_0x4196('0x0'));var rimraf=require(_0x4196('0x1'));var zipdir=require(_0x4196('0x2'));var jsonpatch=require(_0x4196('0x3'));var rp=require('request-promise');var moment=require(_0x4196('0x4'));var BPromise=require(_0x4196('0x5'));var Mustache=require(_0x4196('0x6'));var util=require(_0x4196('0x7'));var path=require(_0x4196('0x8'));var sox=require(_0x4196('0x9'));var csv=require(_0x4196('0xa'));var ejs=require(_0x4196('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4196('0xc'));var squel=require('squel');var crypto=require(_0x4196('0xd'));var jsforce=require(_0x4196('0xe'));var deskjs=require(_0x4196('0xf'));var toCsv=require(_0x4196('0xa'));var querystring=require(_0x4196('0x10'));var Papa=require(_0x4196('0x11'));var Redis=require(_0x4196('0x12'));var authService=require(_0x4196('0x13'));var qs=require(_0x4196('0x14'));var as=require(_0x4196('0x15'));var hardwareService=require(_0x4196('0x16'));var logger=require(_0x4196('0x17'))(_0x4196('0x18'));var utils=require(_0x4196('0x19'));var config=require(_0x4196('0x1a'));var licenseUtil=require(_0x4196('0x1b'));var db=require(_0x4196('0x1c'))['db'];var extensions=require('../../components/extensions/rewrite');function respondWithStatusCode(_0x44c084,_0x1de7d7){_0x1de7d7=_0x1de7d7||0xcc;return function(_0x5a4ea1){if(_0x5a4ea1){return _0x44c084[_0x4196('0x1d')](_0x1de7d7);}return _0x44c084['status'](_0x1de7d7)[_0x4196('0x1e')]();};}function respondWithResult(_0x4130df,_0x207b1f){_0x207b1f=_0x207b1f||0xc8;return function(_0x1505c7){if(_0x1505c7){return _0x4130df[_0x4196('0x1f')](_0x207b1f)[_0x4196('0x20')](_0x1505c7);}};}function respondWithFilteredResult(_0x65e6d8,_0x1d5497){return function(_0x4004ba){if(_0x4004ba){var _0x312103=typeof _0x1d5497['offset']===_0x4196('0x21')&&typeof _0x1d5497[_0x4196('0x22')]===_0x4196('0x21');var _0x1a1fe9=_0x4004ba[_0x4196('0x23')];var _0xc8421a=_0x312103?0x0:_0x1d5497[_0x4196('0x24')];var _0x328ade=_0x312103?_0x4004ba[_0x4196('0x23')]:_0x1d5497['offset']+_0x1d5497[_0x4196('0x22')];var _0x6c580b;if(_0x328ade>=_0x1a1fe9){_0x328ade=_0x1a1fe9;_0x6c580b=0xc8;}else{_0x6c580b=0xce;}_0x65e6d8[_0x4196('0x1f')](_0x6c580b);return _0x65e6d8[_0x4196('0x25')](_0x4196('0x26'),_0xc8421a+'-'+_0x328ade+'/'+_0x1a1fe9)['json'](_0x4004ba);}return null;};}function patchUpdates(_0x472c52){return function(_0x1c3201){try{jsonpatch['apply'](_0x1c3201,_0x472c52,!![]);}catch(_0xd25f27){return BPromise[_0x4196('0x27')](_0xd25f27);}return _0x1c3201[_0x4196('0x28')]();};}function saveUpdates(_0x55df89,_0x57ad28){return function(_0x1f6b10){if(_0x1f6b10){return _0x1f6b10[_0x4196('0x29')](_0x55df89)[_0x4196('0x2a')](function(_0x2d965e){return _0x2d965e;});}return null;};}function removeEntity(_0x33c120,_0x2f4df9){return function(_0x258cb7){if(_0x258cb7){return _0x258cb7[_0x4196('0x2b')]()[_0x4196('0x2a')](function(){var _0x282fd6=_0x258cb7[_0x4196('0x2c')]({'plain':!![]});var _0x5e67d5=_0x4196('0x2d');return db[_0x4196('0x2e')][_0x4196('0x2b')]({'where':{'type':_0x5e67d5,'resourceId':_0x282fd6['id']}})['then'](function(){return _0x258cb7;});})[_0x4196('0x2a')](function(){_0x33c120[_0x4196('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15090c,_0x246ecc){return function(_0x397b8d){if(!_0x397b8d){_0x15090c[_0x4196('0x1d')](0x194);}return _0x397b8d;};}function handleError(_0x325ee9,_0x315740){_0x315740=_0x315740||0x1f4;return function(_0x5966ca){logger[_0x4196('0x2f')](_0x5966ca['stack']);if(_0x5966ca['name']){delete _0x5966ca[_0x4196('0x30')];}_0x325ee9[_0x4196('0x1f')](_0x315740)[_0x4196('0x31')](_0x5966ca);};}exports[_0x4196('0x32')]=function(_0x49a59c,_0x5b61ff){var _0x3d9554={},_0x1b4e99={},_0x15a69e={'count':0x0,'rows':[]};var _0x29becb=_[_0x4196('0x33')](db[_0x4196('0x34')][_0x4196('0x35')],function(_0x5a363b){return{'name':_0x5a363b[_0x4196('0x36')],'type':_0x5a363b[_0x4196('0x37')][_0x4196('0x38')]};});_0x1b4e99[_0x4196('0x39')]=_[_0x4196('0x33')](_0x29becb,_0x4196('0x30'));_0x1b4e99[_0x4196('0x3a')]=_[_0x4196('0x3b')](_0x49a59c[_0x4196('0x3a')]);_0x1b4e99[_0x4196('0x3c')]=_[_0x4196('0x3d')](_0x1b4e99[_0x4196('0x39')],_0x1b4e99['query']);_0x3d9554[_0x4196('0x3e')]=_[_0x4196('0x3d')](_0x1b4e99[_0x4196('0x39')],qs[_0x4196('0x3f')](_0x49a59c[_0x4196('0x3a')]['fields']));_0x3d9554['attributes']=_0x3d9554['attributes'][_0x4196('0x40')]?_0x3d9554['attributes']:_0x1b4e99[_0x4196('0x39')];if(!_0x49a59c[_0x4196('0x3a')]['hasOwnProperty'](_0x4196('0x41'))){_0x3d9554[_0x4196('0x22')]=qs[_0x4196('0x22')](_0x49a59c[_0x4196('0x3a')][_0x4196('0x22')]);_0x3d9554[_0x4196('0x24')]=qs['offset'](_0x49a59c[_0x4196('0x3a')][_0x4196('0x24')]);}_0x3d9554[_0x4196('0x42')]=qs[_0x4196('0x43')](_0x49a59c[_0x4196('0x3a')][_0x4196('0x43')]);_0x3d9554[_0x4196('0x44')]=qs[_0x4196('0x3c')](_['pick'](_0x49a59c[_0x4196('0x3a')],_0x1b4e99[_0x4196('0x3c')]),_0x29becb);if(_0x49a59c['query'][_0x4196('0x45')]){_0x3d9554[_0x4196('0x44')]=_['merge'](_0x3d9554[_0x4196('0x44')],{'$or':_['map'](_0x29becb,function(_0x1a3a6c){if(_0x1a3a6c[_0x4196('0x37')]!=='VIRTUAL'){var _0x2148f0={};_0x2148f0[_0x1a3a6c[_0x4196('0x30')]]={'$like':'%'+_0x49a59c[_0x4196('0x3a')][_0x4196('0x45')]+'%'};return _0x2148f0;}})});}_0x3d9554=_[_0x4196('0x46')]({},_0x3d9554,_0x49a59c['options']);var _0x108dc0={'where':_0x3d9554[_0x4196('0x44')]};return db[_0x4196('0x34')][_0x4196('0x23')](_0x108dc0)[_0x4196('0x2a')](function(_0x30fb4c){_0x15a69e[_0x4196('0x23')]=_0x30fb4c;if(_0x49a59c[_0x4196('0x3a')][_0x4196('0x47')]){_0x3d9554[_0x4196('0x48')]=[{'all':!![]}];}return db[_0x4196('0x34')][_0x4196('0x49')](_0x3d9554);})['then'](function(_0x2e7976){_0x15a69e[_0x4196('0x4a')]=_0x2e7976;return _0x15a69e;})[_0x4196('0x2a')](respondWithFilteredResult(_0x5b61ff,_0x3d9554))[_0x4196('0x4b')](handleError(_0x5b61ff,null));};exports['show']=function(_0x54a7ca,_0x5e55e5){var _0x2bd6bb={'raw':!![],'where':{'id':_0x54a7ca[_0x4196('0x4c')]['id']}},_0x5807b0={};_0x5807b0[_0x4196('0x39')]=_[_0x4196('0x3b')](db[_0x4196('0x34')][_0x4196('0x35')]);_0x5807b0[_0x4196('0x3a')]=_[_0x4196('0x3b')](_0x54a7ca[_0x4196('0x3a')]);_0x5807b0['filters']=_[_0x4196('0x3d')](_0x5807b0[_0x4196('0x39')],_0x5807b0['query']);_0x2bd6bb[_0x4196('0x3e')]=_[_0x4196('0x3d')](_0x5807b0[_0x4196('0x39')],qs['fields'](_0x54a7ca['query'][_0x4196('0x3f')]));_0x2bd6bb[_0x4196('0x3e')]=_0x2bd6bb['attributes'][_0x4196('0x40')]?_0x2bd6bb[_0x4196('0x3e')]:_0x5807b0[_0x4196('0x39')];if(_0x54a7ca[_0x4196('0x3a')][_0x4196('0x47')]){_0x2bd6bb['include']=[{'all':!![]}];}_0x2bd6bb=_[_0x4196('0x46')]({},_0x2bd6bb,_0x54a7ca['options']);return db[_0x4196('0x34')][_0x4196('0x4d')](_0x2bd6bb)['then'](handleEntityNotFound(_0x5e55e5,null))[_0x4196('0x2a')](respondWithResult(_0x5e55e5,null))[_0x4196('0x4b')](handleError(_0x5e55e5,null));};exports[_0x4196('0x4e')]=function(_0x2f9325,_0x191c21){return db[_0x4196('0x34')][_0x4196('0x4e')](_0x2f9325[_0x4196('0x4f')],{})[_0x4196('0x2a')](function(_0xb28b75){var _0x58fabd=_0x2f9325[_0x4196('0x50')][_0x4196('0x2c')]({'plain':!![]});if(!_0x58fabd)throw new Error(_0x4196('0x51'));if(_0x58fabd[_0x4196('0x52')]===_0x4196('0x50')){var _0x321941=_0xb28b75[_0x4196('0x2c')]({'plain':!![]});var _0x37c1ba=_0x4196('0x2d');return db['UserProfileSection']['find']({'where':{'name':_0x37c1ba,'userProfileId':_0x58fabd[_0x4196('0x53')]},'raw':!![]})['then'](function(_0x98a81){if(_0x98a81&&_0x98a81[_0x4196('0x54')]===0x0){return db['UserProfileResource'][_0x4196('0x4e')]({'name':_0x321941[_0x4196('0x30')],'resourceId':_0x321941['id'],'type':_0x98a81[_0x4196('0x30')],'sectionId':_0x98a81['id']},{})[_0x4196('0x2a')](function(){return _0xb28b75;});}else{return _0xb28b75;}})[_0x4196('0x4b')](function(_0x596620){logger[_0x4196('0x2f')](_0x4196('0x55'),_0x596620);throw _0x596620;});}return _0xb28b75;})[_0x4196('0x2a')](respondWithResult(_0x191c21,0xc9))[_0x4196('0x4b')](handleError(_0x191c21,null));};exports[_0x4196('0x29')]=function(_0xa29139,_0x7e8d5f){if(_0xa29139['body']['id']){delete _0xa29139[_0x4196('0x4f')]['id'];}return db['Interval']['find']({'where':{'id':_0xa29139[_0x4196('0x4c')]['id']}})[_0x4196('0x2a')](handleEntityNotFound(_0x7e8d5f,null))['then'](saveUpdates(_0xa29139['body'],null))[_0x4196('0x2a')](respondWithResult(_0x7e8d5f,null))['catch'](handleError(_0x7e8d5f,null));};exports[_0x4196('0x2b')]=function(_0x1c0092,_0x165132){return db[_0x4196('0x34')][_0x4196('0x4d')]({'where':{'id':_0x1c0092[_0x4196('0x4c')]['id']}})[_0x4196('0x2a')](handleEntityNotFound(_0x165132,null))[_0x4196('0x2a')](removeEntity(_0x165132,null))[_0x4196('0x4b')](handleError(_0x165132,null));};exports[_0x4196('0x56')]=function(_0x3e3b14,_0x20bfac,_0x2a9e9d){if(_0x3e3b14[_0x4196('0x4f')]['id']){delete _0x3e3b14[_0x4196('0x4f')]['id'];}return db[_0x4196('0x34')][_0x4196('0x4d')]({'where':{'id':_0x3e3b14[_0x4196('0x4c')]['id']}})['then'](handleEntityNotFound(_0x20bfac,null))[_0x4196('0x2a')](function(_0x3b6ffc){if(_0x3b6ffc){_0x3e3b14[_0x4196('0x4f')][_0x4196('0x57')]=_0x3b6ffc['id'];return db['Interval'][_0x4196('0x4e')](_0x3e3b14[_0x4196('0x4f')]);}})[_0x4196('0x2a')](respondWithResult(_0x20bfac,null))[_0x4196('0x4b')](handleError(_0x20bfac,null));};exports[_0x4196('0x58')]=function(_0x1bb73c,_0x4e3c3d,_0x53f923){var _0x4da1a0={};var _0x57eecf={};var _0x36f81a;var _0x4806bd;return db[_0x4196('0x34')][_0x4196('0x59')]({'where':{'id':_0x1bb73c['params']['id']}})[_0x4196('0x2a')](handleEntityNotFound(_0x4e3c3d,null))[_0x4196('0x2a')](function(_0x35146a){if(_0x35146a){_0x36f81a=_0x35146a;_0x57eecf[_0x4196('0x39')]=_[_0x4196('0x3b')](db[_0x4196('0x34')][_0x4196('0x35')]);_0x57eecf['query']=_[_0x4196('0x3b')](_0x1bb73c[_0x4196('0x3a')]);_0x57eecf['filters']=_[_0x4196('0x3d')](_0x57eecf['model'],_0x57eecf[_0x4196('0x3a')]);_0x4da1a0[_0x4196('0x3e')]=_['intersection'](_0x57eecf[_0x4196('0x39')],qs[_0x4196('0x3f')](_0x1bb73c[_0x4196('0x3a')][_0x4196('0x3f')]));_0x4da1a0['attributes']=_0x4da1a0[_0x4196('0x3e')][_0x4196('0x40')]?_0x4da1a0[_0x4196('0x3e')]:_0x57eecf['model'];_0x4da1a0[_0x4196('0x42')]=qs[_0x4196('0x43')](_0x1bb73c['query'][_0x4196('0x43')]);_0x4da1a0[_0x4196('0x44')]=qs[_0x4196('0x3c')](_[_0x4196('0x5a')](_0x1bb73c[_0x4196('0x3a')],_0x57eecf[_0x4196('0x3c')]));if(_0x1bb73c['query'][_0x4196('0x45')]){_0x4da1a0[_0x4196('0x44')]=_[_0x4196('0x46')](_0x4da1a0[_0x4196('0x44')],{'$or':_[_0x4196('0x33')](_0x4da1a0[_0x4196('0x3e')],function(_0x53fa3a){var _0x4406ef={};_0x4406ef[_0x53fa3a]={'$like':'%'+_0x1bb73c[_0x4196('0x3a')]['filter']+'%'};return _0x4406ef;})});}_0x4da1a0=_[_0x4196('0x46')]({},_0x4da1a0,_0x1bb73c[_0x4196('0x5b')]);return _0x36f81a[_0x4196('0x58')](_0x4da1a0);}})['then'](function(_0x193104){if(_0x193104){_0x4806bd=_0x193104[_0x4196('0x40')];if(!_0x1bb73c[_0x4196('0x3a')]['hasOwnProperty']('nolimit')){_0x4da1a0[_0x4196('0x22')]=qs[_0x4196('0x22')](_0x1bb73c['query'][_0x4196('0x22')]);_0x4da1a0[_0x4196('0x24')]=qs[_0x4196('0x24')](_0x1bb73c[_0x4196('0x3a')][_0x4196('0x24')]);}return _0x36f81a[_0x4196('0x58')](_0x4da1a0);}})[_0x4196('0x2a')](function(_0xea93){if(_0xea93){return _0xea93?{'count':_0x4806bd,'rows':_0xea93}:null;}})[_0x4196('0x2a')](respondWithResult(_0x4e3c3d,null))[_0x4196('0x4b')](handleError(_0x4e3c3d,null));};exports['addIntervals']=function(_0x2098f4,_0x14e1ad,_0x20bf3a){return db[_0x4196('0x34')][_0x4196('0x59')]({'where':{'id':_0x2098f4[_0x4196('0x4c')]['id']}})[_0x4196('0x2a')](handleEntityNotFound(_0x14e1ad,null))[_0x4196('0x2a')](function(_0x1af4f){if(_0x1af4f){return db[_0x4196('0x5c')][_0x4196('0x5d')](function(_0x45a893){return db[_0x4196('0x34')][_0x4196('0x2b')]({'where':{'IntervalId':_0x2098f4[_0x4196('0x4c')]['id']},'transaction':_0x45a893})[_0x4196('0x2a')](function(_0xe4a6d6){var _0x3b8d7a=_['map'](_0x2098f4[_0x4196('0x4f')],function(_0x45b903){delete _0x45b903['id'];_0x45b903['IntervalId']=_0x2098f4['params']['id'];return _0x45b903;});return db[_0x4196('0x34')]['bulkCreate'](_0x3b8d7a,{'transaction':_0x45a893});});})['then'](function(){return db[_0x4196('0x34')]['findAll']({'where':{'IntervalId':_0x2098f4[_0x4196('0x4c')]['id']}});});}})[_0x4196('0x2a')](respondWithResult(_0x14e1ad,null))['catch'](handleError(_0x14e1ad,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 6a1831d..a36cae2 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 _0x95ff=['define','Interval','tools_intervals','rewrite','string','interval','getIntervals','then','map','ifTime','reduce','./interval.attributes','../../utils/iftime','exports'];(function(_0x1fee7a,_0x100dfc){var _0x50d8f0=function(_0x129307){while(--_0x129307){_0x1fee7a['push'](_0x1fee7a['shift']());}};_0x50d8f0(++_0x100dfc);}(_0x95ff,0x1d9));var _0xf95f=function(_0x2c4a42,_0x41e2b9){_0x2c4a42=_0x2c4a42-0x0;var _0x2302a2=_0x95ff[_0x2c4a42];return _0x2302a2;};'use strict';var attributes=require(_0xf95f('0x0'));var extensions=require('../../components/extensions/rewrite');var iftime=require(_0xf95f('0x1'))['iftime'];module[_0xf95f('0x2')]=function(_0x5b900b){return _0x5b900b[_0xf95f('0x3')](_0xf95f('0x4'),attributes,{'tableName':_0xf95f('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x27710d){extensions[_0xf95f('0x6')](_0x5b900b,_0x27710d);},'afterBulkCreate':function(_0x43787c,_0x229c4d,_0x4c023e){_0x4c023e();extensions[_0xf95f('0x6')](_0x5b900b,_0x43787c[0x0]);},'afterUpdate':function(_0x8918fc){extensions[_0xf95f('0x6')](_0x5b900b,_0x8918fc);},'afterDestroy':function(_0x3cc821){extensions[_0xf95f('0x6')](_0x5b900b,_0x3cc821);}},'instanceMethods':{'ifTime':function(_0x598e76=undefined,_0x22f093=new Date()){if(typeof this['interval']===_0xf95f('0x7')){return iftime(this[_0xf95f('0x8')],_0x598e76,_0x22f093);}else{return this[_0xf95f('0x9')]()[_0xf95f('0xa')](function(_0x108525){return Promise['all'](_0x108525[_0xf95f('0xb')](function(_0x1aa960){return _0x1aa960[_0xf95f('0xc')](_0x598e76,_0x22f093);}));})[_0xf95f('0xa')](function(_0x35200c){return _0x35200c[_0xf95f('0xd')](function(_0x38e73b,_0x30b78c){return _0x38e73b||_0x30b78c;},![]);});}}}});}; \ No newline at end of file +var _0xfde7=['then','all','map','ifTime','./interval.attributes','../../components/extensions/rewrite','../../utils/iftime','exports','define','Interval','tools_intervals','rewrite','string','interval'];(function(_0x25900b,_0x8d8ce7){var _0x29ba0d=function(_0x126070){while(--_0x126070){_0x25900b['push'](_0x25900b['shift']());}};_0x29ba0d(++_0x8d8ce7);}(_0xfde7,0x18c));var _0x7fde=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xfde7[_0x3b380d];return _0x54502b;};'use strict';var attributes=require(_0x7fde('0x0'));var extensions=require(_0x7fde('0x1'));var iftime=require(_0x7fde('0x2'))['iftime'];module[_0x7fde('0x3')]=function(_0x12a42b){return _0x12a42b[_0x7fde('0x4')](_0x7fde('0x5'),attributes,{'tableName':_0x7fde('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4c6b38){extensions[_0x7fde('0x7')](_0x12a42b,_0x4c6b38);},'afterBulkCreate':function(_0x3fb2d0,_0x35be39,_0x611b3a){_0x611b3a();extensions[_0x7fde('0x7')](_0x12a42b,_0x3fb2d0[0x0]);},'afterUpdate':function(_0x3e393e){extensions['rewrite'](_0x12a42b,_0x3e393e);},'afterDestroy':function(_0xee98e4){extensions['rewrite'](_0x12a42b,_0xee98e4);}},'instanceMethods':{'ifTime':function(_0x129a6c=undefined,_0x55a66d=new Date()){if(typeof this['interval']===_0x7fde('0x8')){return iftime(this[_0x7fde('0x9')],_0x129a6c,_0x55a66d);}else{return this['getIntervals']()[_0x7fde('0xa')](function(_0xfdee53){return Promise[_0x7fde('0xb')](_0xfdee53[_0x7fde('0xc')](function(_0x569809){return _0x569809[_0x7fde('0xd')](_0x129a6c,_0x55a66d);}));})[_0x7fde('0xa')](function(_0x4e46ff){return _0x4e46ff['reduce'](function(_0x5cdf98,_0x1caa4a){return _0x5cdf98||_0x1caa4a;},![]);});}}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 6f93bc2..46056df 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 _0x2664=['findAll','options','where','attributes','limit','include','model','map','then','info','debug','stringify','catch','error','message','ShowInterval','find','ifTime','reduce','format','name','join','findById','IntervalIftime','isArray','intervals','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','Iftime','silly','lodash','util','../../mysqldb','iftime','../../config/logger','GetInterval','Interval'];(function(_0x5e804b,_0x242732){var _0x116e07=function(_0x550e22){while(--_0x550e22){_0x5e804b['push'](_0x5e804b['shift']());}};_0x116e07(++_0x242732);}(_0x2664,0x103));var _0x4266=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2664[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4266('0x0'));var util=require(_0x4266('0x1'));var db=require(_0x4266('0x2'))['db'];var iftime=require('../../utils/iftime')[_0x4266('0x3')];var logger=require(_0x4266('0x4'))('rpc');exports[_0x4266('0x5')]=function(_0x35ead5){var _0xf8af53=this;return new Promise(function(_0x37691a,_0x2f6386){return db[_0x4266('0x6')][_0x4266('0x7')]({'raw':_0x35ead5['options']?_0x35ead5[_0x4266('0x8')]['raw']===undefined?!![]:![]:!![],'where':_0x35ead5['options']?_0x35ead5[_0x4266('0x8')][_0x4266('0x9')]||null:null,'attributes':_0x35ead5[_0x4266('0x8')]?_0x35ead5['options'][_0x4266('0xa')]||null:null,'limit':_0x35ead5[_0x4266('0x8')]?_0x35ead5['options'][_0x4266('0xb')]||null:null,'include':_0x35ead5[_0x4266('0x8')]?_0x35ead5[_0x4266('0x8')]['include']?_['map'](_0x35ead5[_0x4266('0x8')][_0x4266('0xc')],function(_0x2a3810){return{'model':db[_0x2a3810[_0x4266('0xd')]],'as':_0x2a3810['as'],'attributes':_0x2a3810[_0x4266('0xa')],'include':_0x2a3810[_0x4266('0xc')]?_['map'](_0x2a3810['include'],function(_0x51615c){return{'model':db[_0x51615c[_0x4266('0xd')]],'as':_0x51615c['as'],'attributes':_0x51615c[_0x4266('0xa')],'include':_0x51615c[_0x4266('0xc')]?_[_0x4266('0xe')](_0x51615c[_0x4266('0xc')],function(_0x2b7d50){return{'model':db[_0x2b7d50[_0x4266('0xd')]],'as':_0x2b7d50['as'],'attributes':_0x2b7d50[_0x4266('0xa')]};}):[]};}):[]};}):[]:[]})[_0x4266('0xf')](function(_0x456855){logger[_0x4266('0x10')](_0x4266('0x5'),_0x35ead5);logger[_0x4266('0x11')](_0x4266('0x5'),_0x35ead5,JSON[_0x4266('0x12')](_0x456855));_0x37691a(_0x456855);})[_0x4266('0x13')](function(_0x30d3bd){logger[_0x4266('0x14')](_0x4266('0x5'),_0x30d3bd[_0x4266('0x15')],_0x35ead5);_0x2f6386(_0xf8af53['error'](0x1f4,_0x30d3bd[_0x4266('0x15')]));});});};exports[_0x4266('0x16')]=function(_0x9c002d){var _0x1ee184=this;return new Promise(function(_0x94f5c7,_0x535671){return db['Interval'][_0x4266('0x17')]({'raw':_0x9c002d[_0x4266('0x8')]?_0x9c002d['options']['raw']===undefined?!![]:![]:!![],'where':_0x9c002d[_0x4266('0x8')]?_0x9c002d[_0x4266('0x8')][_0x4266('0x9')]||null:null,'attributes':_0x9c002d[_0x4266('0x8')]?_0x9c002d[_0x4266('0x8')][_0x4266('0xa')]||null:null,'include':_0x9c002d[_0x4266('0x8')]?_0x9c002d['options'][_0x4266('0xc')]?_[_0x4266('0xe')](_0x9c002d[_0x4266('0x8')][_0x4266('0xc')],function(_0x11e090){return{'model':db[_0x11e090['model']],'as':_0x11e090['as'],'attributes':_0x11e090[_0x4266('0xa')],'include':_0x11e090[_0x4266('0xc')]?_[_0x4266('0xe')](_0x11e090[_0x4266('0xc')],function(_0x584aad){return{'model':db[_0x584aad['model']],'as':_0x584aad['as'],'attributes':_0x584aad[_0x4266('0xa')],'include':_0x584aad[_0x4266('0xc')]?_['map'](_0x584aad[_0x4266('0xc')],function(_0x5a8dd5){return{'model':db[_0x5a8dd5[_0x4266('0xd')]],'as':_0x5a8dd5['as'],'attributes':_0x5a8dd5['attributes']};}):[]};}):[]};}):[]:[]})[_0x4266('0xf')](function(_0x56f9b7){logger['info'](_0x4266('0x16'),_0x9c002d);logger['debug'](_0x4266('0x16'),_0x9c002d,JSON[_0x4266('0x12')](_0x56f9b7));_0x94f5c7(_0x56f9b7);})[_0x4266('0x13')](function(_0x2ca2ca){logger['error'](_0x4266('0x16'),_0x2ca2ca[_0x4266('0x15')],_0x9c002d);_0x535671(_0x1ee184[_0x4266('0x14')](0x1f4,_0x2ca2ca[_0x4266('0x15')]));});});};function checkArrayOfIntervals(_0x452921,_0x3b4ef1){var _0x5b9039=[];return db[_0x4266('0x6')][_0x4266('0x7')]({'where':{'id':_0x452921}})['then'](function(_0x4282a9){_0x5b9039=_0x4282a9;return Promise['all'](_0x5b9039[_0x4266('0xe')](function(_0x4cfb22){return _0x4cfb22[_0x4266('0x18')](_0x3b4ef1);}));})['then'](function(_0x5e6046){var _0x3adb05=_0x5e6046[_0x4266('0x19')](function(_0x58a79a,_0x1a4eac){return _0x58a79a||_0x1a4eac;},![]);logger[_0x4266('0x10')](util[_0x4266('0x1a')]('IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)',_0x5b9039[_0x4266('0xe')](function(_0x5c5bf6){return _0x5c5bf6[_0x4266('0x1b')];})[_0x4266('0x1c')](',\x20'),_0x5b9039[_0x4266('0xe')](function(_0x55756c){return _0x55756c['id'];})[_0x4266('0x1c')](',\x20')));return _0x3adb05;});}function checkSingleInterval(_0x5937f6,_0x332212){return db[_0x4266('0x6')][_0x4266('0x1d')](_0x5937f6)[_0x4266('0xf')](function(_0x55d244){if(_0x55d244){logger[_0x4266('0x10')](util[_0x4266('0x1a')]('IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)',_0x55d244[_0x4266('0x1b')],_0x55d244['id']));return _0x55d244[_0x4266('0x18')](_0x332212);}});}exports[_0x4266('0x1e')]=function(_0x44defa){var _0x2b2b48=_0x44defa['intervalIds'];var _0x2519c6=Array[_0x4266('0x1f')](_0x44defa['intervals'])?_0x44defa[_0x4266('0x20')]:typeof _0x44defa['intervals']==='string'?[_0x44defa[_0x4266('0x20')]]:[];var _0x5d9fb1=_0x44defa[_0x4266('0x21')]||undefined;var _0x3266ea=![];if(_0x2519c6[_0x4266('0x22')]){logger[_0x4266('0x10')](util['format'](_0x4266('0x23'),_0x2519c6[_0x4266('0x1c')](';\x20')));}if(_0x5d9fb1){logger[_0x4266('0x10')](util[_0x4266('0x1a')]('IntervalIftime:\x20timezone\x20=\x20%s',_0x5d9fb1));}logger[_0x4266('0x11')](_0x4266('0x24'),_0x3266ea);logger[_0x4266('0x25')](_0x4266('0x1e'),_0x44defa);return Promise['resolve']()[_0x4266('0xf')](function(){if(Array['isArray'](_0x2b2b48)){return checkArrayOfIntervals(_0x2b2b48,_0x5d9fb1);}else if(_0x2b2b48){return checkSingleInterval(_0x2b2b48,_0x5d9fb1);}})[_0x4266('0xf')](function(_0x4f13fe){var _0x450f6d=_0x2519c6[_0x4266('0x19')](function(_0x59eae0,_0x243b5c){return _0x59eae0||iftime(_0x243b5c,_0x5d9fb1);},![]);_0x3266ea=_0x4f13fe||_0x450f6d;return _0x3266ea;})['catch'](function(_0x461473){logger[_0x4266('0x14')](_0x4266('0x1e'),_0x44defa,_0x461473);throw this[_0x4266('0x14')](0x1f4,_0x461473[_0x4266('0x15')]);});}; \ No newline at end of file +var _0xfdf1=['findAll','options','raw','limit','include','model','attributes','map','then','info','debug','stringify','catch','error','message','ShowInterval','find','where','all','ifTime','reduce','format','IntervalIftime:\x20intervals\x20=\x20%s\x20(ids\x20=\x20%s)','name','join','findById','IntervalIftime:\x20interval\x20=\x20%s\x20(id\x20=\x20%s)','IntervalIftime','intervals','string','timezone','length','IntervalIftime:\x20interval\x20strings\x20=\x20%s','IntervalIftime:\x20timezone\x20=\x20%s','Iftime','silly','isArray','lodash','util','../../mysqldb','../../utils/iftime','iftime','../../config/logger','rpc','GetInterval','Interval'];(function(_0x437e12,_0x2ed185){var _0x13c0bc=function(_0x29948f){while(--_0x29948f){_0x437e12['push'](_0x437e12['shift']());}};_0x13c0bc(++_0x2ed185);}(_0xfdf1,0xdd));var _0x1fdf=function(_0xa5c4c2,_0x59f7f4){_0xa5c4c2=_0xa5c4c2-0x0;var _0x2aa977=_0xfdf1[_0xa5c4c2];return _0x2aa977;};'use strict';var _=require(_0x1fdf('0x0'));var util=require(_0x1fdf('0x1'));var db=require(_0x1fdf('0x2'))['db'];var iftime=require(_0x1fdf('0x3'))[_0x1fdf('0x4')];var logger=require(_0x1fdf('0x5'))(_0x1fdf('0x6'));exports[_0x1fdf('0x7')]=function(_0x58d5db){var _0x483965=this;return new Promise(function(_0xf4da61,_0x3be3fd){return db[_0x1fdf('0x8')][_0x1fdf('0x9')]({'raw':_0x58d5db[_0x1fdf('0xa')]?_0x58d5db[_0x1fdf('0xa')][_0x1fdf('0xb')]===undefined?!![]:![]:!![],'where':_0x58d5db[_0x1fdf('0xa')]?_0x58d5db[_0x1fdf('0xa')]['where']||null:null,'attributes':_0x58d5db[_0x1fdf('0xa')]?_0x58d5db[_0x1fdf('0xa')]['attributes']||null:null,'limit':_0x58d5db[_0x1fdf('0xa')]?_0x58d5db['options'][_0x1fdf('0xc')]||null:null,'include':_0x58d5db[_0x1fdf('0xa')]?_0x58d5db[_0x1fdf('0xa')][_0x1fdf('0xd')]?_['map'](_0x58d5db[_0x1fdf('0xa')][_0x1fdf('0xd')],function(_0x12f7ff){return{'model':db[_0x12f7ff[_0x1fdf('0xe')]],'as':_0x12f7ff['as'],'attributes':_0x12f7ff[_0x1fdf('0xf')],'include':_0x12f7ff[_0x1fdf('0xd')]?_[_0x1fdf('0x10')](_0x12f7ff[_0x1fdf('0xd')],function(_0x511fa4){return{'model':db[_0x511fa4['model']],'as':_0x511fa4['as'],'attributes':_0x511fa4['attributes'],'include':_0x511fa4[_0x1fdf('0xd')]?_[_0x1fdf('0x10')](_0x511fa4[_0x1fdf('0xd')],function(_0xb12cfc){return{'model':db[_0xb12cfc[_0x1fdf('0xe')]],'as':_0xb12cfc['as'],'attributes':_0xb12cfc[_0x1fdf('0xf')]};}):[]};}):[]};}):[]:[]})[_0x1fdf('0x11')](function(_0x22483f){logger[_0x1fdf('0x12')](_0x1fdf('0x7'),_0x58d5db);logger[_0x1fdf('0x13')](_0x1fdf('0x7'),_0x58d5db,JSON[_0x1fdf('0x14')](_0x22483f));_0xf4da61(_0x22483f);})[_0x1fdf('0x15')](function(_0x3573ef){logger[_0x1fdf('0x16')]('GetInterval',_0x3573ef[_0x1fdf('0x17')],_0x58d5db);_0x3be3fd(_0x483965[_0x1fdf('0x16')](0x1f4,_0x3573ef[_0x1fdf('0x17')]));});});};exports[_0x1fdf('0x18')]=function(_0x141036){var _0x3aea3c=this;return new Promise(function(_0x5e0900,_0x222349){return db[_0x1fdf('0x8')][_0x1fdf('0x19')]({'raw':_0x141036[_0x1fdf('0xa')]?_0x141036[_0x1fdf('0xa')]['raw']===undefined?!![]:![]:!![],'where':_0x141036[_0x1fdf('0xa')]?_0x141036['options'][_0x1fdf('0x1a')]||null:null,'attributes':_0x141036['options']?_0x141036[_0x1fdf('0xa')][_0x1fdf('0xf')]||null:null,'include':_0x141036[_0x1fdf('0xa')]?_0x141036['options'][_0x1fdf('0xd')]?_['map'](_0x141036[_0x1fdf('0xa')][_0x1fdf('0xd')],function(_0x5c6bb6){return{'model':db[_0x5c6bb6[_0x1fdf('0xe')]],'as':_0x5c6bb6['as'],'attributes':_0x5c6bb6['attributes'],'include':_0x5c6bb6[_0x1fdf('0xd')]?_[_0x1fdf('0x10')](_0x5c6bb6['include'],function(_0x34946e){return{'model':db[_0x34946e['model']],'as':_0x34946e['as'],'attributes':_0x34946e[_0x1fdf('0xf')],'include':_0x34946e['include']?_['map'](_0x34946e[_0x1fdf('0xd')],function(_0x38180b){return{'model':db[_0x38180b[_0x1fdf('0xe')]],'as':_0x38180b['as'],'attributes':_0x38180b[_0x1fdf('0xf')]};}):[]};}):[]};}):[]:[]})[_0x1fdf('0x11')](function(_0x2548ee){logger[_0x1fdf('0x12')]('ShowInterval',_0x141036);logger[_0x1fdf('0x13')](_0x1fdf('0x18'),_0x141036,JSON[_0x1fdf('0x14')](_0x2548ee));_0x5e0900(_0x2548ee);})[_0x1fdf('0x15')](function(_0x49dab7){logger[_0x1fdf('0x16')](_0x1fdf('0x18'),_0x49dab7[_0x1fdf('0x17')],_0x141036);_0x222349(_0x3aea3c[_0x1fdf('0x16')](0x1f4,_0x49dab7['message']));});});};function checkArrayOfIntervals(_0x5ed1fe,_0x1b1df7){var _0x25484d=[];return db['Interval']['findAll']({'where':{'id':_0x5ed1fe}})[_0x1fdf('0x11')](function(_0x54adaf){_0x25484d=_0x54adaf;return Promise[_0x1fdf('0x1b')](_0x25484d[_0x1fdf('0x10')](function(_0x4c33ed){return _0x4c33ed[_0x1fdf('0x1c')](_0x1b1df7);}));})[_0x1fdf('0x11')](function(_0x5e822a){var _0x413450=_0x5e822a[_0x1fdf('0x1d')](function(_0x20376d,_0x2d3d6f){return _0x20376d||_0x2d3d6f;},![]);logger[_0x1fdf('0x12')](util[_0x1fdf('0x1e')](_0x1fdf('0x1f'),_0x25484d[_0x1fdf('0x10')](function(_0x295245){return _0x295245[_0x1fdf('0x20')];})[_0x1fdf('0x21')](',\x20'),_0x25484d[_0x1fdf('0x10')](function(_0x449dc3){return _0x449dc3['id'];})[_0x1fdf('0x21')](',\x20')));return _0x413450;});}function checkSingleInterval(_0x15142f,_0x54d6c3){return db[_0x1fdf('0x8')][_0x1fdf('0x22')](_0x15142f)[_0x1fdf('0x11')](function(_0x204e22){if(_0x204e22){logger[_0x1fdf('0x12')](util[_0x1fdf('0x1e')](_0x1fdf('0x23'),_0x204e22[_0x1fdf('0x20')],_0x204e22['id']));return _0x204e22[_0x1fdf('0x1c')](_0x54d6c3);}});}exports[_0x1fdf('0x24')]=function(_0x293cc3){var _0x2197b9=_0x293cc3['intervalIds'];var _0x1121cf=Array['isArray'](_0x293cc3[_0x1fdf('0x25')])?_0x293cc3['intervals']:typeof _0x293cc3['intervals']===_0x1fdf('0x26')?[_0x293cc3[_0x1fdf('0x25')]]:[];var _0x10ce78=_0x293cc3[_0x1fdf('0x27')]||undefined;var _0x35f5bc=![];if(_0x1121cf[_0x1fdf('0x28')]){logger[_0x1fdf('0x12')](util['format'](_0x1fdf('0x29'),_0x1121cf[_0x1fdf('0x21')](';\x20')));}if(_0x10ce78){logger[_0x1fdf('0x12')](util[_0x1fdf('0x1e')](_0x1fdf('0x2a'),_0x10ce78));}logger[_0x1fdf('0x13')](_0x1fdf('0x2b'),_0x35f5bc);logger[_0x1fdf('0x2c')](_0x1fdf('0x24'),_0x293cc3);return Promise['resolve']()[_0x1fdf('0x11')](function(){if(Array[_0x1fdf('0x2d')](_0x2197b9)){return checkArrayOfIntervals(_0x2197b9,_0x10ce78);}else if(_0x2197b9){return checkSingleInterval(_0x2197b9,_0x10ce78);}})[_0x1fdf('0x11')](function(_0x4e6953){var _0x300ee2=_0x1121cf[_0x1fdf('0x1d')](function(_0x277213,_0x3c088a){return _0x277213||iftime(_0x3c088a,_0x10ce78);},![]);_0x35f5bc=_0x4e6953||_0x300ee2;return _0x35f5bc;})[_0x1fdf('0x15')](function(_0x40516d){logger[_0x1fdf('0x16')](_0x1fdf('0x24'),_0x293cc3,_0x40516d);throw this['error'](0x1f4,_0x40516d[_0x1fdf('0x17')]);});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 79a600d..435181e 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 _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x38987f,_0xc79720){var _0x4cb697=function(_0x1af5ae){while(--_0x1af5ae){_0x38987f['push'](_0x38987f['shift']());}};_0x4cb697(++_0xc79720);}(_0x5f66,0x1a0));var _0x65f6=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x5f66[_0x126558];return _0x1f6d14;};'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 +var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x3435e7,_0xf8e628){var _0x26cdd7=function(_0x2d46d7){while(--_0x2d46d7){_0x3435e7['push'](_0x3435e7['shift']());}};_0x26cdd7(++_0xf8e628);}(_0xadb5,0xad));var _0x5adb=function(_0x267b6c,_0x4e76ea){_0x267b6c=_0x267b6c-0x0;var _0x3283b9=_0xadb5[_0x267b6c];return _0x3283b9;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 0829613..63efd6a 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 _0xaf75=['Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','send','body','headers','connection','remoteAddress','socket','bluebird','../../config/logger','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','Bug','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','name','customfield_11504','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20','request','utf8','data','end','status','json','error'];(function(_0x280f8b,_0x56922a){var _0x4d1f79=function(_0x17a33c){while(--_0x17a33c){_0x280f8b['push'](_0x280f8b['shift']());}};_0x4d1f79(++_0x56922a);}(_0xaf75,0x1d6));var _0x5af7=function(_0x25b508,_0x366b39){_0x25b508=_0x25b508-0x0;var _0x264927=_0xaf75[_0x25b508];return _0x264927;};'use strict';var BPromise=require(_0x5af7('0x0'));var https=require('https');var logger=require(_0x5af7('0x1'))('api');var USERNAME=_0x5af7('0x2');var PASSWORD=_0x5af7('0x3');function openIssue(_0x1c187d,_0x72719d){var _0x18fbaf={'fields':{'project':{'key':_0x1c187d[_0x5af7('0x4')]||_0x5af7('0x5')},'summary':(_0x1c187d[_0x5af7('0x6')]||_0x5af7('0x7'))+_0x5af7('0x8')+_0x1c187d['ip'],'description':_0x1c187d[_0x5af7('0x9')]||JSON[_0x5af7('0xa')](_0x1c187d),'issuetype':{'name':_0x1c187d[_0x5af7('0xb')]||_0x5af7('0xc')}}};_0x18fbaf[_0x5af7('0xd')][_0x5af7('0xe')]=_0x1c187d[_0x5af7('0xf')];_0x18fbaf['fields'][_0x5af7('0x10')]=_0x1c187d[_0x5af7('0x11')];_0x18fbaf[_0x5af7('0xd')][_0x5af7('0x12')]=_0x1c187d[_0x5af7('0x13')];_0x18fbaf['fields']['customfield_11503']=_0x1c187d[_0x5af7('0x14')];_0x18fbaf[_0x5af7('0xd')][_0x5af7('0x15')]=_0x1c187d['reason'];_0x18fbaf[_0x5af7('0xd')]['customfield_10102']=_0x1c187d['ip'];var _0xeabf01={'host':_0x5af7('0x16'),'port':0x1bb,'path':_0x5af7('0x17'),'method':_0x5af7('0x18'),'timeout':0x4e20,'headers':{'Content-Type':_0x5af7('0x19'),'Authorization':_0x5af7('0x1a')+new Buffer(USERNAME+':'+PASSWORD)['toString']('base64')}};var _0x2acb9e=JSON[_0x5af7('0xa')](_0x18fbaf);var _0x582040=https[_0x5af7('0x1b')](_0xeabf01,function(_0x274870){_0x274870['setEncoding'](_0x5af7('0x1c'));var _0x138b31='';_0x274870['on'](_0x5af7('0x1d'),function(_0x12f8f1){_0x138b31+=_0x12f8f1;});_0x274870['on'](_0x5af7('0x1e'),function(){if(_0x72719d){return _0x72719d[_0x5af7('0x1f')](_0x274870['statusCode'])[_0x5af7('0x20')](JSON['parse'](_0x138b31));}});});_0x582040['on'](_0x5af7('0x21'),function(_0x1f295b){if(_0x72719d){return _0x72719d[_0x5af7('0x1f')](0x1f4)[_0x5af7('0x20')]({'errors':[{'message':_0x5af7('0x22'),'type':_0x5af7('0x23')}]});}});_0x582040['write'](_0x2acb9e);_0x582040[_0x5af7('0x1e')]();}exports['openIssue']=openIssue;exports[_0x5af7('0x24')]=function(_0x314d2b,_0x4f4235){_0x314d2b[_0x5af7('0x25')]['ip']=_0x314d2b[_0x5af7('0x26')]['x-forwarded-for']||_0x314d2b[_0x5af7('0x27')][_0x5af7('0x28')]||_0x314d2b[_0x5af7('0x29')][_0x5af7('0x28')]||_0x314d2b[_0x5af7('0x27')][_0x5af7('0x29')][_0x5af7('0x28')];return openIssue(_0x314d2b[_0x5af7('0x25')],_0x4f4235);}; \ No newline at end of file +var _0xb573=['description','stringify','issuetype','Bug','fields','customfield_11500','customfield_11501','oldToken','customfield_11503','name','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','base64','request','end','status','statusCode','parse','error','json','api.jira','send','body','headers','x-forwarded-for','remoteAddress','socket','connection','bluebird','https','../../config/logger','api','3eAmWpBVP0','MOTGUI','summary','Report','\x20from\x20'];(function(_0x44cfc7,_0x566868){var _0x114d02=function(_0xd8d9c0){while(--_0xd8d9c0){_0x44cfc7['push'](_0x44cfc7['shift']());}};_0x114d02(++_0x566868);}(_0xb573,0x11d));var _0x3b57=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb573[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x3b57('0x0'));var https=require(_0x3b57('0x1'));var logger=require(_0x3b57('0x2'))(_0x3b57('0x3'));var USERNAME='support';var PASSWORD=_0x3b57('0x4');function openIssue(_0x5e021,_0x5e22c6){var _0x5e37ab={'fields':{'project':{'key':_0x5e021['key']||_0x3b57('0x5')},'summary':(_0x5e021[_0x3b57('0x6')]||_0x3b57('0x7'))+_0x3b57('0x8')+_0x5e021['ip'],'description':_0x5e021[_0x3b57('0x9')]||JSON[_0x3b57('0xa')](_0x5e021),'issuetype':{'name':_0x5e021[_0x3b57('0xb')]||_0x3b57('0xc')}}};_0x5e37ab[_0x3b57('0xd')][_0x3b57('0xe')]=_0x5e021['email'];_0x5e37ab[_0x3b57('0xd')][_0x3b57('0xf')]=_0x5e021[_0x3b57('0x10')];_0x5e37ab[_0x3b57('0xd')]['customfield_11502']=_0x5e021['newToken'];_0x5e37ab['fields'][_0x3b57('0x11')]=_0x5e021[_0x3b57('0x12')];_0x5e37ab[_0x3b57('0xd')][_0x3b57('0x13')]=_0x5e021[_0x3b57('0x14')];_0x5e37ab[_0x3b57('0xd')][_0x3b57('0x15')]=_0x5e021['ip'];var _0x63f290={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x3b57('0x16'),'method':_0x3b57('0x17'),'timeout':0x4e20,'headers':{'Content-Type':_0x3b57('0x18'),'Authorization':_0x3b57('0x19')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x3b57('0x1a'))}};var _0x39948a=JSON[_0x3b57('0xa')](_0x5e37ab);var _0x43165f=https[_0x3b57('0x1b')](_0x63f290,function(_0x1044fe){_0x1044fe['setEncoding']('utf8');var _0x51496b='';_0x1044fe['on']('data',function(_0x123c4e){_0x51496b+=_0x123c4e;});_0x1044fe['on'](_0x3b57('0x1c'),function(){if(_0x5e22c6){return _0x5e22c6[_0x3b57('0x1d')](_0x1044fe[_0x3b57('0x1e')])['json'](JSON[_0x3b57('0x1f')](_0x51496b));}});});_0x43165f['on'](_0x3b57('0x20'),function(_0x3c44db){if(_0x5e22c6){return _0x5e22c6[_0x3b57('0x1d')](0x1f4)[_0x3b57('0x21')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x3b57('0x22')}]});}});_0x43165f['write'](_0x39948a);_0x43165f['end']();}exports['openIssue']=openIssue;exports[_0x3b57('0x23')]=function(_0x5758ca,_0x5d670b){_0x5758ca[_0x3b57('0x24')]['ip']=_0x5758ca[_0x3b57('0x25')][_0x3b57('0x26')]||_0x5758ca['connection'][_0x3b57('0x27')]||_0x5758ca[_0x3b57('0x28')]['remoteAddress']||_0x5758ca[_0x3b57('0x29')]['socket']['remoteAddress'];return openIssue(_0x5758ca[_0x3b57('0x24')],_0x5d670b);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 12d69cc..8249da9 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 _0x17ba=['/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x17ba,0xab));var _0xa17b=function(_0x4fadd4,_0x3c1cb9){_0x4fadd4=_0x4fadd4-0x0;var _0x4b8120=_0x17ba[_0x4fadd4];return _0x4b8120;};'use strict';var multer=require(_0xa17b('0x0'));var util=require(_0xa17b('0x1'));var path=require('path');var timeout=require(_0xa17b('0x2'));var express=require(_0xa17b('0x3'));var router=express[_0xa17b('0x4')]();var fs_extra=require(_0xa17b('0x5'));var auth=require(_0xa17b('0x6'));var interaction=require(_0xa17b('0x7'));var config=require(_0xa17b('0x8'));var controller=require(_0xa17b('0x9'));router[_0xa17b('0xa')]('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0xc')]);router[_0xa17b('0xa')](_0xa17b('0xd'),auth[_0xa17b('0xb')](),controller[_0xa17b('0xe')]);router[_0xa17b('0xa')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x10')]);router['post']('/',auth[_0xa17b('0xb')](),controller[_0xa17b('0x11')]);router[_0xa17b('0x12')](_0xa17b('0xf'),auth[_0xa17b('0xb')](),controller[_0xa17b('0x13')]);router[_0xa17b('0x14')]('/:id',auth[_0xa17b('0xb')](),controller[_0xa17b('0x15')]);module[_0xa17b('0x16')]=router; \ No newline at end of file +var _0x1339=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5d0430,_0x15cc32){var _0x4d964c=function(_0x392cbf){while(--_0x392cbf){_0x5d0430['push'](_0x5d0430['shift']());}};_0x4d964c(++_0x15cc32);}(_0x1339,0x1ed));var _0x9133=function(_0x21fda9,_0x3551cb){_0x21fda9=_0x21fda9-0x0;var _0x4566b4=_0x1339[_0x21fda9];return _0x4566b4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9133('0x0'));var timeout=require(_0x9133('0x1'));var express=require(_0x9133('0x2'));var router=express[_0x9133('0x3')]();var fs_extra=require(_0x9133('0x4'));var auth=require(_0x9133('0x5'));var interaction=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var controller=require('./jscriptyAnswerReport.controller');router[_0x9133('0x8')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0xa')]);router['get'](_0x9133('0xb'),auth[_0x9133('0x9')](),controller[_0x9133('0xc')]);router[_0x9133('0x8')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller[_0x9133('0xe')]);router[_0x9133('0xf')]('/',auth[_0x9133('0x9')](),controller[_0x9133('0x10')]);router['put'](_0x9133('0xd'),auth[_0x9133('0x9')](),controller[_0x9133('0x11')]);router[_0x9133('0x12')](_0x9133('0xd'),auth[_0x9133('0x9')](),controller['destroy']);module[_0x9133('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index aec2717..5755286 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 _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x7a54,0x106));var _0x47a5=function(_0x3cccf7,_0x22235b){_0x3cccf7=_0x3cccf7-0x0;var _0x11a3c8=_0x7a54[_0x3cccf7];return _0x11a3c8;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x7a54,0x106));var _0x47a5=function(_0x5586ef,_0x47cb18){_0x5586ef=_0x5586ef-0x0;var _0x506153=_0x7a54[_0x5586ef];return _0x506153;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 1f6a0fe..0991b98 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 _0x236d=['undefined','limit','count','set','apply','save','update','then','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body','catch','destroy','params','describe','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x236d,0x7e));var _0xd236=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x236d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd236('0x0'));var rimraf=require(_0xd236('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd236('0x2'));var rp=require('request-promise');var moment=require(_0xd236('0x3'));var BPromise=require(_0xd236('0x4'));var Mustache=require(_0xd236('0x5'));var util=require(_0xd236('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd236('0x7'));var ejs=require(_0xd236('0x8'));var fs=require('fs');var fs_extra=require(_0xd236('0x9'));var _=require(_0xd236('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd236('0xb'));var deskjs=require(_0xd236('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd236('0xd'));var Papa=require(_0xd236('0xe'));var Redis=require('ioredis');var authService=require(_0xd236('0xf'));var qs=require(_0xd236('0x10'));var as=require(_0xd236('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd236('0x12'))(_0xd236('0x13'));var utils=require(_0xd236('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xd236('0x15'));var db=require(_0xd236('0x16'))['db'];function respondWithStatusCode(_0x3d1076,_0x160cb1){_0x160cb1=_0x160cb1||0xcc;return function(_0x21f27b){if(_0x21f27b){return _0x3d1076[_0xd236('0x17')](_0x160cb1);}return _0x3d1076[_0xd236('0x18')](_0x160cb1)[_0xd236('0x19')]();};}function respondWithResult(_0x22435c,_0x3d7465){_0x3d7465=_0x3d7465||0xc8;return function(_0x348734){if(_0x348734){return _0x22435c[_0xd236('0x18')](_0x3d7465)[_0xd236('0x1a')](_0x348734);}};}function respondWithFilteredResult(_0x3b60a7,_0xd851b5){return function(_0x3b2535){if(_0x3b2535){var _0x2a076d=typeof _0xd851b5[_0xd236('0x1b')]===_0xd236('0x1c')&&typeof _0xd851b5[_0xd236('0x1d')]==='undefined';var _0x4f06c6=_0x3b2535[_0xd236('0x1e')];var _0x1b02a5=_0x2a076d?0x0:_0xd851b5['offset'];var _0x11c6ec=_0x2a076d?_0x3b2535[_0xd236('0x1e')]:_0xd851b5[_0xd236('0x1b')]+_0xd851b5['limit'];var _0x355b65;if(_0x11c6ec>=_0x4f06c6){_0x11c6ec=_0x4f06c6;_0x355b65=0xc8;}else{_0x355b65=0xce;}_0x3b60a7[_0xd236('0x18')](_0x355b65);return _0x3b60a7[_0xd236('0x1f')]('Content-Range',_0x1b02a5+'-'+_0x11c6ec+'/'+_0x4f06c6)[_0xd236('0x1a')](_0x3b2535);}return null;};}function patchUpdates(_0x3b0a27){return function(_0x26c758){try{jsonpatch[_0xd236('0x20')](_0x26c758,_0x3b0a27,!![]);}catch(_0x2f512d){return BPromise['reject'](_0x2f512d);}return _0x26c758[_0xd236('0x21')]();};}function saveUpdates(_0x30e7aa,_0x1e4ddb){return function(_0x3d1e4e){if(_0x3d1e4e){return _0x3d1e4e[_0xd236('0x22')](_0x30e7aa)['then'](function(_0x4a35d0){return _0x4a35d0;});}return null;};}function removeEntity(_0x257f27,_0x4be5ac){return function(_0x22924d){if(_0x22924d){return _0x22924d['destroy']()[_0xd236('0x23')](function(){_0x257f27[_0xd236('0x18')](0xcc)[_0xd236('0x19')]();});}};}function handleEntityNotFound(_0x49d822,_0x41049a){return function(_0x339b08){if(!_0x339b08){_0x49d822[_0xd236('0x17')](0x194);}return _0x339b08;};}function handleError(_0x13ba7a,_0x3a30d8){_0x3a30d8=_0x3a30d8||0x1f4;return function(_0x17f927){logger[_0xd236('0x24')](_0x17f927[_0xd236('0x25')]);if(_0x17f927[_0xd236('0x26')]){delete _0x17f927[_0xd236('0x26')];}_0x13ba7a[_0xd236('0x18')](_0x3a30d8)[_0xd236('0x27')](_0x17f927);};}exports[_0xd236('0x28')]=function(_0x23714d,_0x3108f4){var _0x28175d={},_0x436a19={},_0x471ed6={'count':0x0,'rows':[]};var _0x463fc8=_[_0xd236('0x29')](db[_0xd236('0x2a')][_0xd236('0x2b')],function(_0x3c1617){return{'name':_0x3c1617[_0xd236('0x2c')],'type':_0x3c1617[_0xd236('0x2d')][_0xd236('0x2e')]};});_0x436a19[_0xd236('0x2f')]=_[_0xd236('0x29')](_0x463fc8,_0xd236('0x26'));_0x436a19['query']=_[_0xd236('0x30')](_0x23714d['query']);_0x436a19[_0xd236('0x31')]=_[_0xd236('0x32')](_0x436a19[_0xd236('0x2f')],_0x436a19['query']);_0x28175d[_0xd236('0x33')]=_[_0xd236('0x32')](_0x436a19[_0xd236('0x2f')],qs[_0xd236('0x34')](_0x23714d[_0xd236('0x35')][_0xd236('0x34')]));_0x28175d[_0xd236('0x33')]=_0x28175d['attributes'][_0xd236('0x36')]?_0x28175d['attributes']:_0x436a19[_0xd236('0x2f')];if(!_0x23714d['query'][_0xd236('0x37')](_0xd236('0x38'))){_0x28175d[_0xd236('0x1d')]=qs[_0xd236('0x1d')](_0x23714d[_0xd236('0x35')][_0xd236('0x1d')]);_0x28175d[_0xd236('0x1b')]=qs[_0xd236('0x1b')](_0x23714d[_0xd236('0x35')][_0xd236('0x1b')]);}_0x28175d[_0xd236('0x39')]=qs[_0xd236('0x3a')](_0x23714d[_0xd236('0x35')]['sort']);_0x28175d[_0xd236('0x3b')]=qs[_0xd236('0x31')](_[_0xd236('0x3c')](_0x23714d['query'],_0x436a19[_0xd236('0x31')]),_0x463fc8);if(_0x23714d[_0xd236('0x35')][_0xd236('0x3d')]){_0x28175d[_0xd236('0x3b')]=_[_0xd236('0x3e')](_0x28175d[_0xd236('0x3b')],{'$or':_['map'](_0x463fc8,function(_0x696bed){if(_0x696bed[_0xd236('0x2d')]!==_0xd236('0x3f')){var _0x3c798f={};_0x3c798f[_0x696bed[_0xd236('0x26')]]={'$like':'%'+_0x23714d[_0xd236('0x35')]['filter']+'%'};return _0x3c798f;}})});}_0x28175d=_[_0xd236('0x3e')]({},_0x28175d,_0x23714d[_0xd236('0x40')]);var _0x2ba3ae={'where':_0x28175d['where']};return db[_0xd236('0x2a')]['count'](_0x2ba3ae)[_0xd236('0x23')](function(_0x5793bf){_0x471ed6['count']=_0x5793bf;if(_0x23714d[_0xd236('0x35')][_0xd236('0x41')]){_0x28175d[_0xd236('0x42')]=[{'all':!![]}];}return db[_0xd236('0x2a')][_0xd236('0x43')](_0x28175d);})['then'](function(_0x4d0d65){_0x471ed6[_0xd236('0x44')]=_0x4d0d65;return _0x471ed6;})[_0xd236('0x23')](respondWithFilteredResult(_0x3108f4,_0x28175d))['catch'](handleError(_0x3108f4,null));};exports[_0xd236('0x45')]=function(_0x342fd5,_0x2d815b){var _0x55007d={'raw':!![],'where':{'id':_0x342fd5['params']['id']}},_0x58a93a={};_0x58a93a[_0xd236('0x2f')]=_['keys'](db['JscriptyAnswerReport'][_0xd236('0x2b')]);_0x58a93a[_0xd236('0x35')]=_[_0xd236('0x30')](_0x342fd5[_0xd236('0x35')]);_0x58a93a[_0xd236('0x31')]=_['intersection'](_0x58a93a['model'],_0x58a93a[_0xd236('0x35')]);_0x55007d[_0xd236('0x33')]=_[_0xd236('0x32')](_0x58a93a[_0xd236('0x2f')],qs[_0xd236('0x34')](_0x342fd5[_0xd236('0x35')]['fields']));_0x55007d[_0xd236('0x33')]=_0x55007d['attributes'][_0xd236('0x36')]?_0x55007d[_0xd236('0x33')]:_0x58a93a['model'];if(_0x342fd5['query']['includeAll']){_0x55007d['include']=[{'all':!![]}];}_0x55007d=_[_0xd236('0x3e')]({},_0x55007d,_0x342fd5[_0xd236('0x40')]);return db[_0xd236('0x2a')][_0xd236('0x46')](_0x55007d)[_0xd236('0x23')](handleEntityNotFound(_0x2d815b,null))['then'](respondWithResult(_0x2d815b,null))['catch'](handleError(_0x2d815b,null));};exports[_0xd236('0x47')]=function(_0x7c0650,_0xbf4ba9){return db[_0xd236('0x2a')][_0xd236('0x47')](_0x7c0650[_0xd236('0x48')],{})['then'](respondWithResult(_0xbf4ba9,0xc9))[_0xd236('0x49')](handleError(_0xbf4ba9,null));};exports['update']=function(_0x223a14,_0x2c8861){if(_0x223a14['body']['id']){delete _0x223a14[_0xd236('0x48')]['id'];}return db[_0xd236('0x2a')]['find']({'where':{'id':_0x223a14['params']['id']}})[_0xd236('0x23')](handleEntityNotFound(_0x2c8861,null))[_0xd236('0x23')](saveUpdates(_0x223a14[_0xd236('0x48')],null))[_0xd236('0x23')](respondWithResult(_0x2c8861,null))['catch'](handleError(_0x2c8861,null));};exports[_0xd236('0x4a')]=function(_0x43c12b,_0x3d8ca6){return db[_0xd236('0x2a')][_0xd236('0x46')]({'where':{'id':_0x43c12b[_0xd236('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d8ca6,null))['then'](removeEntity(_0x3d8ca6,null))[_0xd236('0x49')](handleError(_0x3d8ca6,null));};exports['describe']=function(_0xa39da6,_0x30c336){return db['JscriptyAnswerReport'][_0xd236('0x4c')]()[_0xd236('0x23')](respondWithResult(_0x30c336,null))['catch'](handleError(_0x30c336,null));}; \ No newline at end of file +var _0x7278=['stack','name','send','JscriptyAnswerReport','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','rawAttributes','length','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','error'];(function(_0x1ca9e9,_0x1c4391){var _0x309f3c=function(_0x5ab318){while(--_0x5ab318){_0x1ca9e9['push'](_0x1ca9e9['shift']());}};_0x309f3c(++_0x1c4391);}(_0x7278,0x161));var _0x8727=function(_0x2e0bb7,_0x55f60f){_0x2e0bb7=_0x2e0bb7-0x0;var _0x4e8fc2=_0x7278[_0x2e0bb7];return _0x4e8fc2;};'use strict';var emlformat=require(_0x8727('0x0'));var rimraf=require(_0x8727('0x1'));var zipdir=require(_0x8727('0x2'));var jsonpatch=require(_0x8727('0x3'));var rp=require(_0x8727('0x4'));var moment=require('moment');var BPromise=require(_0x8727('0x5'));var Mustache=require(_0x8727('0x6'));var util=require(_0x8727('0x7'));var path=require(_0x8727('0x8'));var sox=require(_0x8727('0x9'));var csv=require(_0x8727('0xa'));var ejs=require(_0x8727('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8727('0xc'));var squel=require(_0x8727('0xd'));var crypto=require(_0x8727('0xe'));var jsforce=require(_0x8727('0xf'));var deskjs=require(_0x8727('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8727('0x11'));var authService=require(_0x8727('0x12'));var qs=require(_0x8727('0x13'));var as=require(_0x8727('0x14'));var hardwareService=require(_0x8727('0x15'));var logger=require(_0x8727('0x16'))(_0x8727('0x17'));var utils=require(_0x8727('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x8727('0x19'));var db=require(_0x8727('0x1a'))['db'];function respondWithStatusCode(_0x176389,_0x518e56){_0x518e56=_0x518e56||0xcc;return function(_0x22d03d){if(_0x22d03d){return _0x176389[_0x8727('0x1b')](_0x518e56);}return _0x176389['status'](_0x518e56)[_0x8727('0x1c')]();};}function respondWithResult(_0x3aa1b,_0x47c29d){_0x47c29d=_0x47c29d||0xc8;return function(_0x2185e5){if(_0x2185e5){return _0x3aa1b[_0x8727('0x1d')](_0x47c29d)[_0x8727('0x1e')](_0x2185e5);}};}function respondWithFilteredResult(_0x3865e9,_0x1916f7){return function(_0x11c828){if(_0x11c828){var _0x88857c=typeof _0x1916f7['offset']===_0x8727('0x1f')&&typeof _0x1916f7[_0x8727('0x20')]===_0x8727('0x1f');var _0x2f6e1d=_0x11c828[_0x8727('0x21')];var _0xba0af5=_0x88857c?0x0:_0x1916f7['offset'];var _0x575d29=_0x88857c?_0x11c828[_0x8727('0x21')]:_0x1916f7['offset']+_0x1916f7[_0x8727('0x20')];var _0xfd266f;if(_0x575d29>=_0x2f6e1d){_0x575d29=_0x2f6e1d;_0xfd266f=0xc8;}else{_0xfd266f=0xce;}_0x3865e9[_0x8727('0x1d')](_0xfd266f);return _0x3865e9[_0x8727('0x22')](_0x8727('0x23'),_0xba0af5+'-'+_0x575d29+'/'+_0x2f6e1d)['json'](_0x11c828);}return null;};}function patchUpdates(_0x6e552f){return function(_0x286856){try{jsonpatch[_0x8727('0x24')](_0x286856,_0x6e552f,!![]);}catch(_0x1d78df){return BPromise[_0x8727('0x25')](_0x1d78df);}return _0x286856[_0x8727('0x26')]();};}function saveUpdates(_0x46d43e,_0x441cc0){return function(_0x117f58){if(_0x117f58){return _0x117f58[_0x8727('0x27')](_0x46d43e)[_0x8727('0x28')](function(_0x1a69d5){return _0x1a69d5;});}return null;};}function removeEntity(_0x4c699b,_0x464a32){return function(_0x3d3592){if(_0x3d3592){return _0x3d3592['destroy']()['then'](function(){_0x4c699b[_0x8727('0x1d')](0xcc)[_0x8727('0x1c')]();});}};}function handleEntityNotFound(_0x15e8bf,_0x5de6fa){return function(_0x98261b){if(!_0x98261b){_0x15e8bf[_0x8727('0x1b')](0x194);}return _0x98261b;};}function handleError(_0x267008,_0x440ff5){_0x440ff5=_0x440ff5||0x1f4;return function(_0x2c8cd5){logger[_0x8727('0x29')](_0x2c8cd5[_0x8727('0x2a')]);if(_0x2c8cd5[_0x8727('0x2b')]){delete _0x2c8cd5['name'];}_0x267008[_0x8727('0x1d')](_0x440ff5)[_0x8727('0x2c')](_0x2c8cd5);};}exports['index']=function(_0x23325f,_0x163989){var _0x3ecd6a={},_0x228ca9={},_0x416da8={'count':0x0,'rows':[]};var _0x1e21b9=_['map'](db[_0x8727('0x2d')]['rawAttributes'],function(_0x34c58e){return{'name':_0x34c58e['fieldName'],'type':_0x34c58e[_0x8727('0x2e')][_0x8727('0x2f')]};});_0x228ca9[_0x8727('0x30')]=_[_0x8727('0x31')](_0x1e21b9,_0x8727('0x2b'));_0x228ca9[_0x8727('0x32')]=_[_0x8727('0x33')](_0x23325f['query']);_0x228ca9[_0x8727('0x34')]=_[_0x8727('0x35')](_0x228ca9[_0x8727('0x30')],_0x228ca9[_0x8727('0x32')]);_0x3ecd6a[_0x8727('0x36')]=_[_0x8727('0x35')](_0x228ca9[_0x8727('0x30')],qs[_0x8727('0x37')](_0x23325f[_0x8727('0x32')][_0x8727('0x37')]));_0x3ecd6a[_0x8727('0x36')]=_0x3ecd6a[_0x8727('0x36')]['length']?_0x3ecd6a['attributes']:_0x228ca9[_0x8727('0x30')];if(!_0x23325f[_0x8727('0x32')][_0x8727('0x38')](_0x8727('0x39'))){_0x3ecd6a['limit']=qs[_0x8727('0x20')](_0x23325f[_0x8727('0x32')][_0x8727('0x20')]);_0x3ecd6a[_0x8727('0x3a')]=qs[_0x8727('0x3a')](_0x23325f['query'][_0x8727('0x3a')]);}_0x3ecd6a[_0x8727('0x3b')]=qs[_0x8727('0x3c')](_0x23325f[_0x8727('0x32')][_0x8727('0x3c')]);_0x3ecd6a[_0x8727('0x3d')]=qs[_0x8727('0x34')](_[_0x8727('0x3e')](_0x23325f[_0x8727('0x32')],_0x228ca9[_0x8727('0x34')]),_0x1e21b9);if(_0x23325f[_0x8727('0x32')][_0x8727('0x3f')]){_0x3ecd6a['where']=_[_0x8727('0x40')](_0x3ecd6a[_0x8727('0x3d')],{'$or':_[_0x8727('0x31')](_0x1e21b9,function(_0x403d90){if(_0x403d90[_0x8727('0x2e')]!==_0x8727('0x41')){var _0x308035={};_0x308035[_0x403d90[_0x8727('0x2b')]]={'$like':'%'+_0x23325f[_0x8727('0x32')][_0x8727('0x3f')]+'%'};return _0x308035;}})});}_0x3ecd6a=_[_0x8727('0x40')]({},_0x3ecd6a,_0x23325f[_0x8727('0x42')]);var _0x2a1063={'where':_0x3ecd6a[_0x8727('0x3d')]};return db['JscriptyAnswerReport'][_0x8727('0x21')](_0x2a1063)[_0x8727('0x28')](function(_0x19d08a){_0x416da8['count']=_0x19d08a;if(_0x23325f[_0x8727('0x32')][_0x8727('0x43')]){_0x3ecd6a[_0x8727('0x44')]=[{'all':!![]}];}return db[_0x8727('0x2d')]['findAll'](_0x3ecd6a);})[_0x8727('0x28')](function(_0x37e87c){_0x416da8[_0x8727('0x45')]=_0x37e87c;return _0x416da8;})[_0x8727('0x28')](respondWithFilteredResult(_0x163989,_0x3ecd6a))[_0x8727('0x46')](handleError(_0x163989,null));};exports[_0x8727('0x47')]=function(_0x2fe40d,_0x15b764){var _0x3aac97={'raw':!![],'where':{'id':_0x2fe40d['params']['id']}},_0x2b5ba7={};_0x2b5ba7[_0x8727('0x30')]=_[_0x8727('0x33')](db[_0x8727('0x2d')][_0x8727('0x48')]);_0x2b5ba7[_0x8727('0x32')]=_['keys'](_0x2fe40d[_0x8727('0x32')]);_0x2b5ba7[_0x8727('0x34')]=_[_0x8727('0x35')](_0x2b5ba7['model'],_0x2b5ba7[_0x8727('0x32')]);_0x3aac97[_0x8727('0x36')]=_[_0x8727('0x35')](_0x2b5ba7[_0x8727('0x30')],qs[_0x8727('0x37')](_0x2fe40d[_0x8727('0x32')]['fields']));_0x3aac97[_0x8727('0x36')]=_0x3aac97[_0x8727('0x36')][_0x8727('0x49')]?_0x3aac97['attributes']:_0x2b5ba7[_0x8727('0x30')];if(_0x2fe40d[_0x8727('0x32')][_0x8727('0x43')]){_0x3aac97[_0x8727('0x44')]=[{'all':!![]}];}_0x3aac97=_[_0x8727('0x40')]({},_0x3aac97,_0x2fe40d[_0x8727('0x42')]);return db[_0x8727('0x2d')]['find'](_0x3aac97)[_0x8727('0x28')](handleEntityNotFound(_0x15b764,null))[_0x8727('0x28')](respondWithResult(_0x15b764,null))[_0x8727('0x46')](handleError(_0x15b764,null));};exports[_0x8727('0x4a')]=function(_0x152de6,_0x426727){return db[_0x8727('0x2d')]['create'](_0x152de6[_0x8727('0x4b')],{})[_0x8727('0x28')](respondWithResult(_0x426727,0xc9))[_0x8727('0x46')](handleError(_0x426727,null));};exports['update']=function(_0x30e656,_0x22cd31){if(_0x30e656[_0x8727('0x4b')]['id']){delete _0x30e656[_0x8727('0x4b')]['id'];}return db[_0x8727('0x2d')][_0x8727('0x4c')]({'where':{'id':_0x30e656[_0x8727('0x4d')]['id']}})['then'](handleEntityNotFound(_0x22cd31,null))[_0x8727('0x28')](saveUpdates(_0x30e656['body'],null))[_0x8727('0x28')](respondWithResult(_0x22cd31,null))[_0x8727('0x46')](handleError(_0x22cd31,null));};exports['destroy']=function(_0x133973,_0x3bb732){return db[_0x8727('0x2d')]['find']({'where':{'id':_0x133973['params']['id']}})[_0x8727('0x28')](handleEntityNotFound(_0x3bb732,null))[_0x8727('0x28')](removeEntity(_0x3bb732,null))[_0x8727('0x46')](handleError(_0x3bb732,null));};exports['describe']=function(_0x102daf,_0x3945c4){return db[_0x8727('0x2d')][_0x8727('0x4e')]()[_0x8727('0x28')](respondWithResult(_0x3945c4,null))[_0x8727('0x46')](handleError(_0x3945c4,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 246a742..336a8e1 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 _0xdfc0=['report_jscripty_answers','lodash','../../config/logger','api','bluebird','../../config/environment','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport'];(function(_0x479f93,_0x5d9ba0){var _0x33afbc=function(_0x4ff7c2){while(--_0x4ff7c2){_0x479f93['push'](_0x479f93['shift']());}};_0x33afbc(++_0x5d9ba0);}(_0xdfc0,0x1d5));var _0x0dfc=function(_0x1abcb6,_0x1ef8b0){_0x1abcb6=_0x1abcb6-0x0;var _0x40a2e9=_0xdfc0[_0x1abcb6];return _0x40a2e9;};'use strict';var _=require(_0x0dfc('0x0'));var util=require('util');var logger=require(_0x0dfc('0x1'))(_0x0dfc('0x2'));var moment=require('moment');var BPromise=require(_0x0dfc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0dfc('0x4'));var attributes=require(_0x0dfc('0x5'));module[_0x0dfc('0x6')]=function(_0xfd345c,_0x5e3295){return _0xfd345c['define'](_0x0dfc('0x7'),attributes,{'tableName':_0x0dfc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x127a=['rimraf','exports','JscriptyAnswerReport','report_jscripty_answers','lodash','util','api','bluebird','request-promise','path'];(function(_0x1742a8,_0x27d999){var _0x1f4088=function(_0x3fd46d){while(--_0x3fd46d){_0x1742a8['push'](_0x1742a8['shift']());}};_0x1f4088(++_0x27d999);}(_0x127a,0x11c));var _0xa127=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x127a[_0x174ef5];return _0x1cc379;};'use strict';var _=require(_0xa127('0x0'));var util=require(_0xa127('0x1'));var logger=require('../../config/logger')(_0xa127('0x2'));var moment=require('moment');var BPromise=require(_0xa127('0x3'));var rp=require(_0xa127('0x4'));var fs=require('fs');var path=require(_0xa127('0x5'));var rimraf=require(_0xa127('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptyAnswerReport.attributes');module[_0xa127('0x7')]=function(_0xd1b0f4,_0x4db6a6){return _0xd1b0f4['define'](_0xa127('0x8'),attributes,{'tableName':_0xa127('0x9'),'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 b085d56..bff9027 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 _0xe0ff=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x1bd2a6,_0x45f0fc){var _0x525206=function(_0x3ae097){while(--_0x3ae097){_0x1bd2a6['push'](_0x1bd2a6['shift']());}};_0x525206(++_0x45f0fc);}(_0xe0ff,0x1d9));var _0xfe0f=function(_0x53dc68,_0x2602ad){_0x53dc68=_0x53dc68-0x0;var _0x286063=_0xe0ff[_0x53dc68];return _0x286063;};'use strict';var _=require(_0xfe0f('0x0'));var util=require(_0xfe0f('0x1'));var moment=require(_0xfe0f('0x2'));var BPromise=require(_0xfe0f('0x3'));var rs=require(_0xfe0f('0x4'));var fs=require('fs');var Redis=require(_0xfe0f('0x5'));var db=require(_0xfe0f('0x6'))['db'];var utils=require(_0xfe0f('0x7'));var logger=require(_0xfe0f('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfe0f('0x9'));var client=jayson[_0xfe0f('0xa')][_0xfe0f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2671fa,_0x49ad0e,_0x45cdb6){return new BPromise(function(_0xda08fc,_0x172159){return client[_0xfe0f('0xc')](_0x2671fa,_0x45cdb6)[_0xfe0f('0xd')](function(_0x1187e8){logger[_0xfe0f('0xe')](_0xfe0f('0xf'),_0x49ad0e,_0xfe0f('0x10'));logger[_0xfe0f('0x11')](_0xfe0f('0x12'),_0x49ad0e,'request\x20sent',JSON[_0xfe0f('0x13')](_0x1187e8));if(_0x1187e8[_0xfe0f('0x14')]){if(_0x1187e8[_0xfe0f('0x14')][_0xfe0f('0x15')]===0x1f4){logger['error']('JscriptyAnswerReport,\x20%s,\x20%s',_0x49ad0e,_0x1187e8[_0xfe0f('0x14')][_0xfe0f('0x16')]);return _0x172159(_0x1187e8[_0xfe0f('0x14')][_0xfe0f('0x16')]);}logger[_0xfe0f('0x14')](_0xfe0f('0xf'),_0x49ad0e,_0x1187e8[_0xfe0f('0x14')][_0xfe0f('0x16')]);return _0xda08fc(_0x1187e8[_0xfe0f('0x14')][_0xfe0f('0x16')]);}else{logger[_0xfe0f('0xe')](_0xfe0f('0xf'),_0x49ad0e,_0xfe0f('0x10'));_0xda08fc(_0x1187e8[_0xfe0f('0x17')][_0xfe0f('0x16')]);}})[_0xfe0f('0x18')](function(_0x1d2616){logger['error'](_0xfe0f('0xf'),_0x49ad0e,_0x1d2616);_0x172159(_0x1d2616);});});} \ No newline at end of file +var _0xd313=['randomstring','rpc','jayson/promise','client','request','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x201f73,_0x17489c){var _0x24516d=function(_0x347913){while(--_0x347913){_0x201f73['push'](_0x201f73['shift']());}};_0x24516d(++_0x17489c);}(_0xd313,0x106));var _0x3d31=function(_0x4936ca,_0x409aba){_0x4936ca=_0x4936ca-0x0;var _0x33d6a9=_0xd313[_0x4936ca];return _0x33d6a9;};'use strict';var _=require(_0x3d31('0x0'));var util=require(_0x3d31('0x1'));var moment=require(_0x3d31('0x2'));var BPromise=require(_0x3d31('0x3'));var rs=require(_0x3d31('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3d31('0x5'));var config=require('../../config/environment');var jayson=require(_0x3d31('0x6'));var client=jayson[_0x3d31('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x311706,_0x15ed14,_0x2204da){return new BPromise(function(_0x4271df,_0xd1bae1){return client[_0x3d31('0x8')](_0x311706,_0x2204da)[_0x3d31('0x9')](function(_0x21733b){logger['info'](_0x3d31('0xa'),_0x15ed14,_0x3d31('0xb'));logger[_0x3d31('0xc')](_0x3d31('0xd'),_0x15ed14,_0x3d31('0xb'),JSON[_0x3d31('0xe')](_0x21733b));if(_0x21733b[_0x3d31('0xf')]){if(_0x21733b[_0x3d31('0xf')]['code']===0x1f4){logger['error'](_0x3d31('0xa'),_0x15ed14,_0x21733b['error']['message']);return _0xd1bae1(_0x21733b[_0x3d31('0xf')][_0x3d31('0x10')]);}logger[_0x3d31('0xf')](_0x3d31('0xa'),_0x15ed14,_0x21733b['error']['message']);return _0x4271df(_0x21733b[_0x3d31('0xf')][_0x3d31('0x10')]);}else{logger['info'](_0x3d31('0xa'),_0x15ed14,_0x3d31('0xb'));_0x4271df(_0x21733b[_0x3d31('0x11')]['message']);}})[_0x3d31('0x12')](function(_0x332e67){logger['error'](_0x3d31('0xa'),_0x15ed14,_0x332e67);_0xd1bae1(_0x332e67);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 24bd237..541d81d 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 _0x377a=['30s','getSummary','create','post','/:id/clone','clone','put','/:id','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','index','show','get','getSessions','/:id/answers','getAnswers','/:id/summary'];(function(_0x445f11,_0x275ef5){var _0x44f25f=function(_0xaeaedb){while(--_0xaeaedb){_0x445f11['push'](_0x445f11['shift']());}};_0x44f25f(++_0x275ef5);}(_0x377a,0xe1));var _0xa377=function(_0x331615,_0x13aebd){_0x331615=_0x331615-0x0;var _0x4ba773=_0x377a[_0x331615];return _0x4ba773;};'use strict';var multer=require('multer');var util=require(_0xa377('0x0'));var path=require(_0xa377('0x1'));var timeout=require(_0xa377('0x2'));var express=require(_0xa377('0x3'));var router=express[_0xa377('0x4')]();var fs_extra=require(_0xa377('0x5'));var auth=require(_0xa377('0x6'));var interaction=require(_0xa377('0x7'));var config=require(_0xa377('0x8'));var controller=require(_0xa377('0x9'));router['get']('/',auth[_0xa377('0xa')](),controller[_0xa377('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xa377('0xc')]);router[_0xa377('0xd')]('/:id/sessions',auth[_0xa377('0xa')](),controller[_0xa377('0xe')]);router[_0xa377('0xd')](_0xa377('0xf'),auth[_0xa377('0xa')](),controller[_0xa377('0x10')]);router[_0xa377('0xd')](_0xa377('0x11'),auth[_0xa377('0xa')](),timeout(_0xa377('0x12')),controller[_0xa377('0x13')]);router['post']('/',auth[_0xa377('0xa')](),controller[_0xa377('0x14')]);router[_0xa377('0x15')](_0xa377('0x16'),auth['isAuthenticated'](),controller[_0xa377('0x17')]);router[_0xa377('0x18')](_0xa377('0x19'),auth[_0xa377('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xa377('0x1a')]=router; \ No newline at end of file +var _0xd6da=['getSummary','post','create','/:id/clone','put','update','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','/:id','isAuthenticated','show','getSessions','/:id/answers','get','/:id/summary','30s'];(function(_0x18b400,_0xe3dc0d){var _0x20bf66=function(_0x2a8420){while(--_0x2a8420){_0x18b400['push'](_0x18b400['shift']());}};_0x20bf66(++_0xe3dc0d);}(_0xd6da,0x13f));var _0xad6d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd6da[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xad6d('0x0'));var path=require(_0xad6d('0x1'));var timeout=require('connect-timeout');var express=require(_0xad6d('0x2'));var router=express[_0xad6d('0x3')]();var fs_extra=require(_0xad6d('0x4'));var auth=require(_0xad6d('0x5'));var interaction=require(_0xad6d('0x6'));var config=require(_0xad6d('0x7'));var controller=require(_0xad6d('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xad6d('0x9'),auth[_0xad6d('0xa')](),controller[_0xad6d('0xb')]);router['get']('/:id/sessions',auth['isAuthenticated'](),controller[_0xad6d('0xc')]);router['get'](_0xad6d('0xd'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xad6d('0xe')](_0xad6d('0xf'),auth['isAuthenticated'](),timeout(_0xad6d('0x10')),controller[_0xad6d('0x11')]);router[_0xad6d('0x12')]('/',auth[_0xad6d('0xa')](),controller[_0xad6d('0x13')]);router[_0xad6d('0x12')](_0xad6d('0x14'),auth[_0xad6d('0xa')](),controller['clone']);router[_0xad6d('0x15')](_0xad6d('0x9'),auth[_0xad6d('0xa')](),controller[_0xad6d('0x16')]);router['delete']('/:id',auth[_0xad6d('0xa')](),controller[_0xad6d('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index cf00d79..9bf4060 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 _0x9b1a=['description','BOOLEAN','lodash','util','exports','name','STRING','isObjectLike','formData','setDataValue','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue'];(function(_0x5b6064,_0x376df5){var _0x1f5b14=function(_0x361967){while(--_0x361967){_0x5b6064['push'](_0x5b6064['shift']());}};_0x1f5b14(++_0x376df5);}(_0x9b1a,0x13a));var _0xa9b1=function(_0x211632,_0x378e2e){_0x211632=_0x211632-0x0;var _0x5a1da1=_0x9b1a[_0x211632];return _0x5a1da1;};'use strict';var Sequelize=require('sequelize');var _=require(_0xa9b1('0x0'));var util=require(_0xa9b1('0x1'));module[_0xa9b1('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xa9b1('0x3')},'description':{'type':Sequelize[_0xa9b1('0x4')]},'formData':{'type':Sequelize['TEXT']('long'),'set':function(_0x592bac){if(_[_0xa9b1('0x5')](_0x592bac)){this['setDataValue'](_0xa9b1('0x6'),JSON['stringify'](_0x592bac));}else if(_['isString'](_0x592bac)){this[_0xa9b1('0x7')](_0xa9b1('0x6'),_0x592bac);}else{this['setDataValue'](_0xa9b1('0x6'),util[_0xa9b1('0x8')](_0xa9b1('0x9'),this['getDataValue']('name')||'',this[_0xa9b1('0xa')](_0xa9b1('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xa9b1('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xa9b1('0xc')],'defaultValue':![]}}; \ No newline at end of file +var _0x124d=['BOOLEAN','sequelize','lodash','exports','STRING','TEXT','long','setDataValue','formData','stringify','isString','format','getDataValue','name'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x124d,0xe1));var _0xd124=function(_0x43f695,_0x19b28a){_0x43f695=_0x43f695-0x0;var _0x5ad061=_0x124d[_0x43f695];return _0x5ad061;};'use strict';var Sequelize=require(_0xd124('0x0'));var _=require(_0xd124('0x1'));var util=require('util');module[_0xd124('0x2')]={'name':{'type':Sequelize[_0xd124('0x3')],'unique':'name'},'description':{'type':Sequelize[_0xd124('0x3')]},'formData':{'type':Sequelize[_0xd124('0x4')](_0xd124('0x5')),'set':function(_0xa6ded7){if(_['isObjectLike'](_0xa6ded7)){this[_0xd124('0x6')](_0xd124('0x7'),JSON[_0xd124('0x8')](_0xa6ded7));}else if(_[_0xd124('0x9')](_0xa6ded7)){this['setDataValue'](_0xd124('0x7'),_0xa6ded7);}else{this[_0xd124('0x6')](_0xd124('0x7'),util[_0xd124('0xa')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0xd124('0xb')](_0xd124('0xc'))||'',this[_0xd124('0xb')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xd124('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0xd124('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 4352d48..0a89052 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 _0x6215=['query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','omit','updatedAt','body','getSessions','findOne','JscriptySessionReport','hasOwnProperty','ProjectId','findAll','getAnswers','JscriptyAnswerReport','fromCharCode','toString','indexOf','getSummary','startTime','parse','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','now','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','Projects','UserProfileResource','name','send','index','map','JscriptyProject','fieldName','type','key','model','keys'];(function(_0x40ca65,_0x42956d){var _0x59da60=function(_0x17fb85){while(--_0x17fb85){_0x40ca65['push'](_0x40ca65['shift']());}};_0x59da60(++_0x42956d);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x5621('0x0'));var rimraf=require(_0x5621('0x1'));var zipdir=require(_0x5621('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5621('0x3'));var moment=require(_0x5621('0x4'));var BPromise=require(_0x5621('0x5'));var Mustache=require(_0x5621('0x6'));var util=require(_0x5621('0x7'));var path=require(_0x5621('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5621('0x9'));var squel=require(_0x5621('0xa'));var crypto=require(_0x5621('0xb'));var jsforce=require(_0x5621('0xc'));var deskjs=require(_0x5621('0xd'));var toCsv=require('to-csv');var querystring=require(_0x5621('0xe'));var Papa=require(_0x5621('0xf'));var Redis=require(_0x5621('0x10'));var authService=require(_0x5621('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5621('0x12'));var hardwareService=require(_0x5621('0x13'));var logger=require(_0x5621('0x14'))('api');var utils=require(_0x5621('0x15'));var config=require(_0x5621('0x16'));var licenseUtil=require(_0x5621('0x17'));var db=require(_0x5621('0x18'))['db'];function respondWithStatusCode(_0x38d23d,_0x30e179){_0x30e179=_0x30e179||0xcc;return function(_0xac5caf){if(_0xac5caf){return _0x38d23d[_0x5621('0x19')](_0x30e179);}return _0x38d23d[_0x5621('0x1a')](_0x30e179)[_0x5621('0x1b')]();};}function respondWithResult(_0x532564,_0x32f3fc){_0x32f3fc=_0x32f3fc||0xc8;return function(_0x1067c0){if(_0x1067c0){return _0x532564[_0x5621('0x1a')](_0x32f3fc)['json'](_0x1067c0);}};}function respondWithFilteredResult(_0x35f0df,_0x2a4cbc){return function(_0x555e21){if(_0x555e21){var _0x55ca9c=typeof _0x2a4cbc[_0x5621('0x1c')]===_0x5621('0x1d')&&typeof _0x2a4cbc[_0x5621('0x1e')]===_0x5621('0x1d');var _0x2f3289=_0x555e21[_0x5621('0x1f')];var _0x374f44=_0x55ca9c?0x0:_0x2a4cbc[_0x5621('0x1c')];var _0x2baba3=_0x55ca9c?_0x555e21['count']:_0x2a4cbc[_0x5621('0x1c')]+_0x2a4cbc[_0x5621('0x1e')];var _0x5a9667;if(_0x2baba3>=_0x2f3289){_0x2baba3=_0x2f3289;_0x5a9667=0xc8;}else{_0x5a9667=0xce;}_0x35f0df[_0x5621('0x1a')](_0x5a9667);return _0x35f0df['set'](_0x5621('0x20'),_0x374f44+'-'+_0x2baba3+'/'+_0x2f3289)[_0x5621('0x21')](_0x555e21);}return null;};}function patchUpdates(_0x179830){return function(_0x3f6791){try{jsonpatch[_0x5621('0x22')](_0x3f6791,_0x179830,!![]);}catch(_0x5bbabe){return BPromise[_0x5621('0x23')](_0x5bbabe);}return _0x3f6791[_0x5621('0x24')]();};}function saveUpdates(_0x16cb32,_0x3eaa1a){return function(_0x52a148){if(_0x52a148){return _0x52a148[_0x5621('0x25')](_0x16cb32)[_0x5621('0x26')](function(_0x3527e0){return _0x3527e0;});}return null;};}function removeEntity(_0x168e5a,_0x1a3ee6){return function(_0x2af50a){if(_0x2af50a){return _0x2af50a[_0x5621('0x27')]()['then'](function(){var _0x23ba00=_0x2af50a['get']({'plain':!![]});var _0xb6800=_0x5621('0x28');return db[_0x5621('0x29')][_0x5621('0x27')]({'where':{'type':_0xb6800,'resourceId':_0x23ba00['id']}})[_0x5621('0x26')](function(){return _0x2af50a;});})[_0x5621('0x26')](function(){_0x168e5a[_0x5621('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x226d73,_0x250f65){return function(_0x1c8e5a){if(!_0x1c8e5a){_0x226d73[_0x5621('0x19')](0x194);}return _0x1c8e5a;};}function handleError(_0x5b17dd,_0x161c93){_0x161c93=_0x161c93||0x1f4;return function(_0x2f0600){logger['error'](_0x2f0600['stack']);if(_0x2f0600[_0x5621('0x2a')]){delete _0x2f0600[_0x5621('0x2a')];}_0x5b17dd[_0x5621('0x1a')](_0x161c93)[_0x5621('0x2b')](_0x2f0600);};}exports[_0x5621('0x2c')]=function(_0xc1af98,_0x280974){var _0x5b138f={},_0x1cc873={},_0x45a33d={'count':0x0,'rows':[]};var _0x45313e=_[_0x5621('0x2d')](db[_0x5621('0x2e')]['rawAttributes'],function(_0x311060){return{'name':_0x311060[_0x5621('0x2f')],'type':_0x311060[_0x5621('0x30')][_0x5621('0x31')]};});_0x1cc873[_0x5621('0x32')]=_['map'](_0x45313e,_0x5621('0x2a'));_0x1cc873['query']=_[_0x5621('0x33')](_0xc1af98[_0x5621('0x34')]);_0x1cc873[_0x5621('0x35')]=_[_0x5621('0x36')](_0x1cc873[_0x5621('0x32')],_0x1cc873['query']);_0x5b138f[_0x5621('0x37')]=_[_0x5621('0x36')](_0x1cc873[_0x5621('0x32')],qs[_0x5621('0x38')](_0xc1af98[_0x5621('0x34')]['fields']));_0x5b138f[_0x5621('0x37')]=_0x5b138f[_0x5621('0x37')][_0x5621('0x39')]?_0x5b138f['attributes']:_0x1cc873[_0x5621('0x32')];if(!_0xc1af98[_0x5621('0x34')]['hasOwnProperty'](_0x5621('0x3a'))){_0x5b138f[_0x5621('0x1e')]=qs[_0x5621('0x1e')](_0xc1af98[_0x5621('0x34')][_0x5621('0x1e')]);_0x5b138f[_0x5621('0x1c')]=qs[_0x5621('0x1c')](_0xc1af98['query'][_0x5621('0x1c')]);}_0x5b138f[_0x5621('0x3b')]=qs[_0x5621('0x3c')](_0xc1af98[_0x5621('0x34')][_0x5621('0x3c')]);_0x5b138f[_0x5621('0x3d')]=qs['filters'](_[_0x5621('0x3e')](_0xc1af98[_0x5621('0x34')],_0x1cc873[_0x5621('0x35')]),_0x45313e);if(_0xc1af98['query']['filter']){_0x5b138f[_0x5621('0x3d')]=_['merge'](_0x5b138f['where'],{'$or':_[_0x5621('0x2d')](_0x45313e,function(_0x65f703){if(_0x65f703[_0x5621('0x30')]!=='VIRTUAL'){var _0x460262={};_0x460262[_0x65f703[_0x5621('0x2a')]]={'$like':'%'+_0xc1af98['query'][_0x5621('0x3f')]+'%'};return _0x460262;}})});}_0x5b138f=_[_0x5621('0x40')]({},_0x5b138f,_0xc1af98[_0x5621('0x41')]);var _0x3574c2={'where':_0x5b138f[_0x5621('0x3d')]};return db[_0x5621('0x2e')][_0x5621('0x1f')](_0x3574c2)[_0x5621('0x26')](function(_0x5e3c29){_0x45a33d[_0x5621('0x1f')]=_0x5e3c29;if(_0xc1af98['query'][_0x5621('0x42')]){_0x5b138f[_0x5621('0x43')]=[{'all':!![]}];}return db[_0x5621('0x2e')]['findAll'](_0x5b138f);})[_0x5621('0x26')](function(_0x21a006){_0x45a33d[_0x5621('0x44')]=_0x21a006;return _0x45a33d;})[_0x5621('0x26')](respondWithFilteredResult(_0x280974,_0x5b138f))[_0x5621('0x45')](handleError(_0x280974,null));};exports[_0x5621('0x46')]=function(_0x3bb41f,_0x483c1f){var _0xf36e3={'raw':![],'where':{'id':_0x3bb41f[_0x5621('0x47')]['id']}},_0x2154c8={};_0x2154c8[_0x5621('0x32')]=_[_0x5621('0x33')](db[_0x5621('0x2e')]['rawAttributes']);_0x2154c8[_0x5621('0x34')]=_['keys'](_0x3bb41f[_0x5621('0x34')]);_0x2154c8['filters']=_[_0x5621('0x36')](_0x2154c8[_0x5621('0x32')],_0x2154c8[_0x5621('0x34')]);_0xf36e3[_0x5621('0x37')]=_[_0x5621('0x36')](_0x2154c8[_0x5621('0x32')],qs[_0x5621('0x38')](_0x3bb41f['query'][_0x5621('0x38')]));_0xf36e3[_0x5621('0x37')]=_0xf36e3[_0x5621('0x37')]['length']?_0xf36e3[_0x5621('0x37')]:_0x2154c8[_0x5621('0x32')];if(_0x3bb41f[_0x5621('0x34')][_0x5621('0x42')]){_0xf36e3[_0x5621('0x43')]=[{'all':!![]}];}_0xf36e3=_[_0x5621('0x40')]({},_0xf36e3,_0x3bb41f[_0x5621('0x41')]);return db[_0x5621('0x2e')][_0x5621('0x48')](_0xf36e3)[_0x5621('0x26')](handleEntityNotFound(_0x483c1f,null))[_0x5621('0x26')](respondWithResult(_0x483c1f,null))['catch'](handleError(_0x483c1f,null));};exports[_0x5621('0x49')]=function(_0x3cb2d9,_0x5b2607){return db[_0x5621('0x2e')][_0x5621('0x49')](_0x3cb2d9['body'],{})['then'](function(_0x248cff){var _0x3f25e2=_0x3cb2d9['user']['get']({'plain':!![]});if(!_0x3f25e2)throw new Error(_0x5621('0x4a'));if(_0x3f25e2[_0x5621('0x4b')]===_0x5621('0x4c')){var _0x35205c=_0x248cff[_0x5621('0x4d')]({'plain':!![]});var _0xccab9b='Projects';return db[_0x5621('0x4e')]['find']({'where':{'name':_0xccab9b,'userProfileId':_0x3f25e2[_0x5621('0x4f')]},'raw':!![]})['then'](function(_0x51e65d){if(_0x51e65d&&_0x51e65d[_0x5621('0x50')]===0x0){return db[_0x5621('0x29')][_0x5621('0x49')]({'name':_0x35205c['name'],'resourceId':_0x35205c['id'],'type':_0x51e65d[_0x5621('0x2a')],'sectionId':_0x51e65d['id']},{})['then'](function(){return _0x248cff;});}else{return _0x248cff;}})[_0x5621('0x45')](function(_0x45e0c1){logger[_0x5621('0x51')](_0x5621('0x52'),_0x45e0c1);throw _0x45e0c1;});}return _0x248cff;})[_0x5621('0x26')](respondWithResult(_0x5b2607,0xc9))[_0x5621('0x45')](handleError(_0x5b2607,null));};exports['clone']=function(_0xfc075f,_0x205829){var _0xaaac2d={'where':{'id':_0xfc075f[_0x5621('0x47')]['id']}},_0x2d4375={};_0x2d4375[_0x5621('0x32')]=_[_0x5621('0x33')](db[_0x5621('0x2e')][_0x5621('0x53')]);_0xaaac2d['attributes']=_[_0x5621('0x36')](_0x2d4375[_0x5621('0x32')],qs[_0x5621('0x38')](_0xfc075f[_0x5621('0x34')][_0x5621('0x38')]));_0xaaac2d['attributes']=_0xaaac2d['attributes'][_0x5621('0x39')]?_0xaaac2d[_0x5621('0x37')]:_0x2d4375['model'];if(_0xfc075f[_0x5621('0x34')][_0x5621('0x42')]){_0xaaac2d[_0x5621('0x43')]=[{'all':!![]}];}_0xaaac2d=_['merge']({},_0xaaac2d,_0xfc075f[_0x5621('0x41')]);return db[_0x5621('0x2e')][_0x5621('0x48')](_0xaaac2d)[_0x5621('0x26')](handleEntityNotFound(_0x205829,null))[_0x5621('0x26')](function(_0x4f9e73){if(_0x4f9e73){var _0x1fd36d=_0x4f9e73[_0x5621('0x4d')]({'plain':!![]});_0x1fd36d=qs[_0x5621('0x54')](_0x1fd36d,['id','createdAt',_0x5621('0x55')]);_0xfc075f[_0x5621('0x56')]=_[_0x5621('0x54')](_0xfc075f[_0x5621('0x56')],['id','createdAt',_0x5621('0x55')]);return db[_0x5621('0x2e')][_0x5621('0x49')](_[_0x5621('0x40')](_0x1fd36d,_0xfc075f[_0x5621('0x56')]),{'include':_0xfc075f['query']['includeAll']?[{'all':!![]}]:undefined})[_0x5621('0x26')](function(_0x2305ae){var _0x17728b=_0xfc075f['user']['get']({'plain':!![]});if(!_0x17728b)throw new Error(_0x5621('0x4a'));if(_0x17728b['role']===_0x5621('0x4c')){var _0x2231ae=_0x2305ae[_0x5621('0x4d')]({'plain':!![]});var _0x3409c4=_0x5621('0x28');return db[_0x5621('0x4e')][_0x5621('0x48')]({'where':{'name':_0x3409c4,'userProfileId':_0x17728b['userProfileId']},'raw':!![]})[_0x5621('0x26')](function(_0x874baa){if(_0x874baa&&_0x874baa[_0x5621('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0x2231ae[_0x5621('0x2a')],'resourceId':_0x2231ae['id'],'type':_0x874baa[_0x5621('0x2a')],'sectionId':_0x874baa['id']},{})['then'](function(){return _0x2305ae;});}else{return _0x2305ae;}})[_0x5621('0x45')](function(_0x9c9fc7){logger[_0x5621('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9c9fc7);throw _0x9c9fc7;});}return _0x2305ae;});}})['then'](respondWithResult(_0x205829,0xc9))[_0x5621('0x45')](handleError(_0x205829,null));};exports[_0x5621('0x25')]=function(_0x488e40,_0x3a9769){if(_0x488e40[_0x5621('0x56')]['id']){delete _0x488e40['body']['id'];}return db[_0x5621('0x2e')][_0x5621('0x48')]({'where':{'id':_0x488e40['params']['id']}})[_0x5621('0x26')](handleEntityNotFound(_0x3a9769,null))[_0x5621('0x26')](saveUpdates(_0x488e40[_0x5621('0x56')],null))[_0x5621('0x26')](respondWithResult(_0x3a9769,null))[_0x5621('0x45')](handleError(_0x3a9769,null));};exports[_0x5621('0x27')]=function(_0x10b630,_0x583644){return db[_0x5621('0x2e')][_0x5621('0x48')]({'where':{'id':_0x10b630[_0x5621('0x47')]['id']}})['then'](handleEntityNotFound(_0x583644,null))['then'](removeEntity(_0x583644,null))[_0x5621('0x45')](handleError(_0x583644,null));};exports[_0x5621('0x57')]=function(_0x32839c,_0x54a6a5,_0x540616){var _0x2cc10d={'raw':!![],'where':{}};var _0x3a578b={};var _0x23136e={'count':0x0,'rows':[]};return db[_0x5621('0x2e')][_0x5621('0x58')]({'where':{'id':_0x32839c[_0x5621('0x47')]['id']}})['then'](handleEntityNotFound(_0x54a6a5,null))[_0x5621('0x26')](function(_0x3852e0){if(_0x3852e0){_0x3a578b[_0x5621('0x32')]=_[_0x5621('0x33')](db[_0x5621('0x59')][_0x5621('0x53')]);_0x3a578b[_0x5621('0x34')]=_[_0x5621('0x33')](_0x32839c[_0x5621('0x34')]);_0x3a578b[_0x5621('0x35')]=_[_0x5621('0x36')](_0x3a578b[_0x5621('0x32')],_0x3a578b[_0x5621('0x34')]);_0x2cc10d[_0x5621('0x37')]=_[_0x5621('0x36')](_0x3a578b[_0x5621('0x32')],qs[_0x5621('0x38')](_0x32839c['query']['fields']));_0x2cc10d[_0x5621('0x37')]=_0x2cc10d[_0x5621('0x37')][_0x5621('0x39')]?_0x2cc10d[_0x5621('0x37')]:_0x3a578b['model'];if(!_0x32839c[_0x5621('0x34')][_0x5621('0x5a')](_0x5621('0x3a'))){_0x2cc10d[_0x5621('0x1e')]=qs['limit'](_0x32839c[_0x5621('0x34')][_0x5621('0x1e')]);_0x2cc10d[_0x5621('0x1c')]=qs['offset'](_0x32839c[_0x5621('0x34')]['offset']);}_0x2cc10d[_0x5621('0x3b')]=qs[_0x5621('0x3c')](_0x32839c['query'][_0x5621('0x3c')]);_0x2cc10d['where']=qs['filters'](_[_0x5621('0x3e')](_0x32839c[_0x5621('0x34')],_0x3a578b[_0x5621('0x35')]));_0x2cc10d[_0x5621('0x3d')][_0x5621('0x5b')]=_0x3852e0['id'];if(_0x32839c[_0x5621('0x34')][_0x5621('0x3f')]){_0x2cc10d['where']=_[_0x5621('0x40')](_0x2cc10d[_0x5621('0x3d')],{'$or':_[_0x5621('0x2d')](_0x2cc10d[_0x5621('0x37')],function(_0x327945){var _0x3f7b89={};_0x3f7b89[_0x327945]={'$like':'%'+_0x32839c['query'][_0x5621('0x3f')]+'%'};return _0x3f7b89;})});}_0x2cc10d=_['merge']({},_0x2cc10d,_0x32839c[_0x5621('0x41')]);return db[_0x5621('0x59')][_0x5621('0x1f')]({'where':_0x2cc10d[_0x5621('0x3d')]})['then'](function(_0x187d2d){_0x23136e['count']=_0x187d2d;if(_0x32839c[_0x5621('0x34')]['includeAll']){_0x2cc10d[_0x5621('0x43')]=[{'all':!![]}];}return db[_0x5621('0x59')][_0x5621('0x5c')](_0x2cc10d);})[_0x5621('0x26')](function(_0x15d56){_0x23136e[_0x5621('0x44')]=_0x15d56;return _0x23136e;});}})[_0x5621('0x26')](respondWithFilteredResult(_0x54a6a5,_0x2cc10d))[_0x5621('0x45')](handleError(_0x54a6a5,null));};exports[_0x5621('0x5d')]=function(_0x30fba0,_0x3b8188,_0x3ffc31){var _0x105ddb={'raw':!![],'where':{}};var _0x434ba2={};var _0xfbcdaf={'count':0x0,'rows':[]};return db[_0x5621('0x2e')][_0x5621('0x58')]({'where':{'id':_0x30fba0[_0x5621('0x47')]['id']}})['then'](handleEntityNotFound(_0x3b8188,null))[_0x5621('0x26')](function(_0x53a40c){if(_0x53a40c){_0x434ba2[_0x5621('0x32')]=_[_0x5621('0x33')](db[_0x5621('0x5e')]['rawAttributes']);_0x434ba2[_0x5621('0x34')]=_[_0x5621('0x33')](_0x30fba0[_0x5621('0x34')]);_0x434ba2[_0x5621('0x35')]=_[_0x5621('0x36')](_0x434ba2[_0x5621('0x32')],_0x434ba2[_0x5621('0x34')]);_0x105ddb['attributes']=_[_0x5621('0x36')](_0x434ba2[_0x5621('0x32')],qs[_0x5621('0x38')](_0x30fba0[_0x5621('0x34')]['fields']));_0x105ddb[_0x5621('0x37')]=_0x105ddb[_0x5621('0x37')][_0x5621('0x39')]?_0x105ddb[_0x5621('0x37')]:_0x434ba2[_0x5621('0x32')];if(!_0x30fba0[_0x5621('0x34')][_0x5621('0x5a')](_0x5621('0x3a'))){_0x105ddb[_0x5621('0x1e')]=qs[_0x5621('0x1e')](_0x30fba0['query'][_0x5621('0x1e')]);_0x105ddb[_0x5621('0x1c')]=qs[_0x5621('0x1c')](_0x30fba0[_0x5621('0x34')]['offset']);}_0x105ddb[_0x5621('0x3b')]=qs[_0x5621('0x3c')](_0x30fba0['query'][_0x5621('0x3c')]);_0x105ddb[_0x5621('0x3d')]=qs[_0x5621('0x35')](_[_0x5621('0x3e')](_0x30fba0[_0x5621('0x34')],_0x434ba2[_0x5621('0x35')]));_0x105ddb[_0x5621('0x3d')][_0x5621('0x5b')]=_0x53a40c['id'];if(_0x30fba0[_0x5621('0x34')]['filter']){_0x105ddb[_0x5621('0x3d')]=_[_0x5621('0x40')](_0x105ddb[_0x5621('0x3d')],{'$or':_[_0x5621('0x2d')](_0x105ddb[_0x5621('0x37')],function(_0x205c89){var _0x2270f4={};_0x2270f4[_0x205c89]={'$like':'%'+_0x30fba0['query'][_0x5621('0x3f')]+'%'};return _0x2270f4;})});}_0x105ddb=_[_0x5621('0x40')]({},_0x105ddb,_0x30fba0[_0x5621('0x41')]);return db[_0x5621('0x5e')][_0x5621('0x1f')]({'where':_0x105ddb[_0x5621('0x3d')]})[_0x5621('0x26')](function(_0x8b5d09){_0xfbcdaf[_0x5621('0x1f')]=_0x8b5d09;if(_0x30fba0[_0x5621('0x34')][_0x5621('0x42')]){_0x105ddb[_0x5621('0x43')]=[{'all':!![]}];}return db[_0x5621('0x5e')][_0x5621('0x5c')](_0x105ddb);})['then'](function(_0x29cd8f){_0xfbcdaf[_0x5621('0x44')]=_0x29cd8f;return _0xfbcdaf;});}})[_0x5621('0x26')](respondWithFilteredResult(_0x3b8188,_0x105ddb))[_0x5621('0x45')](handleError(_0x3b8188,null));};function char(_0x472686){return'number'===typeof _0x472686?String[_0x5621('0x5f')][_0x5621('0x22')](null,arguments):_0x472686;}function needsEncapsulation(_0x564052){return!!_0x564052&&(_0x564052[_0x5621('0x60')]()['indexOf'](char(0xd))>=0x0||_0x564052['toString']()[_0x5621('0x61')](char(0xa))>=0x0||_0x564052['toString']()['indexOf'](char(0x2c))>=0x0||_0x564052[_0x5621('0x60')]()[_0x5621('0x61')](char(0x22))>=0x0);}function encapsulate(_0xb8c3a2){var _0x2d100d=char(0x22),_0x5d3c91='\x5c'+char(0x22),_0x27bfa6=_0xb8c3a2['toString']()['replace'](new RegExp(_0x2d100d,'g'),_0x5d3c91);return _0x2d100d+_0x27bfa6+_0x2d100d;}exports[_0x5621('0x62')]=function(_0x6c313e,_0x5799f6,_0x28cbd7){var _0x295e02,_0x23eeeb;var _0x24d6c4={'where':{'ProjectId':_0x6c313e['params']['id']}};if(_0x6c313e['query'][_0x5621('0x63')]){_0x24d6c4[_0x5621('0x3d')]['starttime']=JSON[_0x5621('0x64')](_0x6c313e[_0x5621('0x34')][_0x5621('0x63')]);}return db[_0x5621('0x59')]['findAll'](_0x24d6c4)[_0x5621('0x26')](handleEntityNotFound(_0x5799f6,null))[_0x5621('0x26')](function(_0x49f57e){if(_0x49f57e){_0x295e02=_0x49f57e;return db['JscriptyQuestionReport'][_0x5621('0x5c')]({'where':{'SessionId':{'$in':_[_0x5621('0x2d')](_0x295e02,'id')},'ProjectId':_0x6c313e['params']['id']},'order':_0x5621('0x65')});}})[_0x5621('0x26')](handleEntityNotFound(_0x5799f6,null))[_0x5621('0x26')](function(_0x4fab76){if(_0x4fab76){_0x23eeeb=_0x4fab76;var _0x315675={};for(var _0x278da0=0x0,_0x4e5f8b=_0x23eeeb[_0x5621('0x39')];_0x278da0<_0x4e5f8b;_0x278da0++){if(!_0x315675[_0x5621('0x5a')](_0x23eeeb[_0x278da0][_0x5621('0x66')])){_0x315675[_0x23eeeb[_0x278da0][_0x5621('0x66')]]=needsEncapsulation(_0x23eeeb[_0x278da0][_0x5621('0x67')])?encapsulate(_0x23eeeb[_0x278da0][_0x5621('0x67')]):_0x23eeeb[_0x278da0][_0x5621('0x67')];}}var _0x34f64b=[],_0x5d8d4f={};for(var _0x1b1f9d=0x0,_0x5da953=_0x295e02['length'];_0x1b1f9d<_0x5da953;_0x1b1f9d++){_0x5d8d4f={'ProjectId':_0x6c313e['params']['id'],'SessionId':_0x295e02[_0x1b1f9d]['id'],'StartTime':moment(_0x295e02[_0x1b1f9d]['starttime'])[_0x5621('0x68')](_0x5621('0x69'))};for(var _0x492e8c=0x0,_0x167105=_0x23eeeb[_0x5621('0x39')];_0x492e8c<_0x167105;_0x492e8c++){if(_0x23eeeb[_0x492e8c][_0x5621('0x6a')]==_0x295e02[_0x1b1f9d]['id']&&_0x315675[_0x5621('0x5a')](_0x23eeeb[_0x492e8c]['questionId'])){_0x5d8d4f[_0x315675[_0x23eeeb[_0x492e8c]['questionId']]]=_0x23eeeb[_0x492e8c]['answer'];}}for(var _0xd0afbd in _0x315675){if(!_0x5d8d4f[_0x5621('0x5a')](_0x315675[_0xd0afbd])){_0x5d8d4f[_0x315675[_0xd0afbd]]=null;}}_0x34f64b[_0x5621('0x6b')](_0x5d8d4f);}return _0x34f64b;}})[_0x5621('0x26')](function(_0x111a4a){if(!_[_0x5621('0x6c')](_0x111a4a)){var _0x20631b=toCsv(_0x111a4a);var _0x420abc=Date[_0x5621('0x6d')]();fs['writeFileSync'](util[_0x5621('0x68')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x6c313e[_0x5621('0x47')]['id'],_0x420abc),_0x20631b);_0x5799f6[_0x5621('0x6e')](_0x5621('0x6f'),_0x5621('0x70')+util[_0x5621('0x68')](_0x5621('0x71'),_0x6c313e[_0x5621('0x47')]['id'],_0x420abc));_0x5799f6[_0x5621('0x6e')](_0x5621('0x72'),'text/csv');return _0x5799f6['download'](util['format']('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x6c313e[_0x5621('0x47')]['id'],_0x420abc));}else{return _0x5799f6[_0x5621('0x19')](0xcc);}})[_0x5621('0x45')](handleError(_0x5799f6,null));}; \ No newline at end of file +var _0x2d93=['/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','then','get','UserProfileResource','destroy','name','send','map','JscriptyProject','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','omit','role','error','update','JscriptySessionReport','nolimit','pick','getAnswers','JscriptyAnswerReport','ProjectId','number','fromCharCode','indexOf','toString','replace','getSummary','startTime','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','now'];(function(_0x269e38,_0x394c8d){var _0x56a85a=function(_0x264e99){while(--_0x264e99){_0x269e38['push'](_0x269e38['shift']());}};_0x56a85a(++_0x394c8d);}(_0x2d93,0xf3));var _0x32d9=function(_0x3a0c4f,_0x5dd1a3){_0x3a0c4f=_0x3a0c4f-0x0;var _0x247049=_0x2d93[_0x3a0c4f];return _0x247049;};'use strict';var emlformat=require(_0x32d9('0x0'));var rimraf=require(_0x32d9('0x1'));var zipdir=require(_0x32d9('0x2'));var jsonpatch=require(_0x32d9('0x3'));var rp=require(_0x32d9('0x4'));var moment=require(_0x32d9('0x5'));var BPromise=require(_0x32d9('0x6'));var Mustache=require(_0x32d9('0x7'));var util=require(_0x32d9('0x8'));var path=require(_0x32d9('0x9'));var sox=require(_0x32d9('0xa'));var csv=require(_0x32d9('0xb'));var ejs=require(_0x32d9('0xc'));var fs=require('fs');var fs_extra=require(_0x32d9('0xd'));var _=require('lodash');var squel=require(_0x32d9('0xe'));var crypto=require(_0x32d9('0xf'));var jsforce=require(_0x32d9('0x10'));var deskjs=require(_0x32d9('0x11'));var toCsv=require(_0x32d9('0xb'));var querystring=require('querystring');var Papa=require(_0x32d9('0x12'));var Redis=require(_0x32d9('0x13'));var authService=require(_0x32d9('0x14'));var qs=require(_0x32d9('0x15'));var as=require(_0x32d9('0x16'));var hardwareService=require(_0x32d9('0x17'));var logger=require(_0x32d9('0x18'))(_0x32d9('0x19'));var utils=require(_0x32d9('0x1a'));var config=require(_0x32d9('0x1b'));var licenseUtil=require(_0x32d9('0x1c'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5afced,_0x16e983){_0x16e983=_0x16e983||0xcc;return function(_0x3ae057){if(_0x3ae057){return _0x5afced[_0x32d9('0x1d')](_0x16e983);}return _0x5afced[_0x32d9('0x1e')](_0x16e983)[_0x32d9('0x1f')]();};}function respondWithResult(_0x3b1d99,_0x9a0f21){_0x9a0f21=_0x9a0f21||0xc8;return function(_0x209a5c){if(_0x209a5c){return _0x3b1d99[_0x32d9('0x1e')](_0x9a0f21)[_0x32d9('0x20')](_0x209a5c);}};}function respondWithFilteredResult(_0x427433,_0x428821){return function(_0x5ebcab){if(_0x5ebcab){var _0x251b58=typeof _0x428821[_0x32d9('0x21')]==='undefined'&&typeof _0x428821[_0x32d9('0x22')]===_0x32d9('0x23');var _0x25fe2c=_0x5ebcab[_0x32d9('0x24')];var _0xd3e7a3=_0x251b58?0x0:_0x428821[_0x32d9('0x21')];var _0x33bb0b=_0x251b58?_0x5ebcab[_0x32d9('0x24')]:_0x428821[_0x32d9('0x21')]+_0x428821[_0x32d9('0x22')];var _0x543607;if(_0x33bb0b>=_0x25fe2c){_0x33bb0b=_0x25fe2c;_0x543607=0xc8;}else{_0x543607=0xce;}_0x427433['status'](_0x543607);return _0x427433[_0x32d9('0x25')](_0x32d9('0x26'),_0xd3e7a3+'-'+_0x33bb0b+'/'+_0x25fe2c)['json'](_0x5ebcab);}return null;};}function patchUpdates(_0x13f8b0){return function(_0x55b7a8){try{jsonpatch[_0x32d9('0x27')](_0x55b7a8,_0x13f8b0,!![]);}catch(_0x298cb6){return BPromise['reject'](_0x298cb6);}return _0x55b7a8['save']();};}function saveUpdates(_0x3e2ef3,_0xcd2cec){return function(_0x56b703){if(_0x56b703){return _0x56b703['update'](_0x3e2ef3)[_0x32d9('0x28')](function(_0x4162bc){return _0x4162bc;});}return null;};}function removeEntity(_0x339697,_0x37a0ce){return function(_0x3cb824){if(_0x3cb824){return _0x3cb824['destroy']()[_0x32d9('0x28')](function(){var _0x1c51a8=_0x3cb824[_0x32d9('0x29')]({'plain':!![]});var _0x215440='Projects';return db[_0x32d9('0x2a')][_0x32d9('0x2b')]({'where':{'type':_0x215440,'resourceId':_0x1c51a8['id']}})[_0x32d9('0x28')](function(){return _0x3cb824;});})['then'](function(){_0x339697[_0x32d9('0x1e')](0xcc)[_0x32d9('0x1f')]();});}};}function handleEntityNotFound(_0x2dbc8c,_0xca2f14){return function(_0x5bd3f3){if(!_0x5bd3f3){_0x2dbc8c[_0x32d9('0x1d')](0x194);}return _0x5bd3f3;};}function handleError(_0x3cf5f2,_0x3d4258){_0x3d4258=_0x3d4258||0x1f4;return function(_0x7e7582){logger['error'](_0x7e7582['stack']);if(_0x7e7582['name']){delete _0x7e7582[_0x32d9('0x2c')];}_0x3cf5f2[_0x32d9('0x1e')](_0x3d4258)[_0x32d9('0x2d')](_0x7e7582);};}exports['index']=function(_0x272449,_0xda0f8f){var _0x56a7ab={},_0x28dc4={},_0x11909b={'count':0x0,'rows':[]};var _0x1b0dfb=_[_0x32d9('0x2e')](db[_0x32d9('0x2f')]['rawAttributes'],function(_0x28165e){return{'name':_0x28165e[_0x32d9('0x30')],'type':_0x28165e[_0x32d9('0x31')][_0x32d9('0x32')]};});_0x28dc4['model']=_[_0x32d9('0x2e')](_0x1b0dfb,'name');_0x28dc4[_0x32d9('0x33')]=_[_0x32d9('0x34')](_0x272449[_0x32d9('0x33')]);_0x28dc4[_0x32d9('0x35')]=_[_0x32d9('0x36')](_0x28dc4[_0x32d9('0x37')],_0x28dc4[_0x32d9('0x33')]);_0x56a7ab[_0x32d9('0x38')]=_[_0x32d9('0x36')](_0x28dc4['model'],qs[_0x32d9('0x39')](_0x272449[_0x32d9('0x33')][_0x32d9('0x39')]));_0x56a7ab[_0x32d9('0x38')]=_0x56a7ab[_0x32d9('0x38')][_0x32d9('0x3a')]?_0x56a7ab[_0x32d9('0x38')]:_0x28dc4[_0x32d9('0x37')];if(!_0x272449[_0x32d9('0x33')][_0x32d9('0x3b')]('nolimit')){_0x56a7ab['limit']=qs[_0x32d9('0x22')](_0x272449[_0x32d9('0x33')][_0x32d9('0x22')]);_0x56a7ab[_0x32d9('0x21')]=qs[_0x32d9('0x21')](_0x272449[_0x32d9('0x33')][_0x32d9('0x21')]);}_0x56a7ab[_0x32d9('0x3c')]=qs[_0x32d9('0x3d')](_0x272449[_0x32d9('0x33')]['sort']);_0x56a7ab[_0x32d9('0x3e')]=qs['filters'](_['pick'](_0x272449[_0x32d9('0x33')],_0x28dc4[_0x32d9('0x35')]),_0x1b0dfb);if(_0x272449['query'][_0x32d9('0x3f')]){_0x56a7ab['where']=_[_0x32d9('0x40')](_0x56a7ab[_0x32d9('0x3e')],{'$or':_[_0x32d9('0x2e')](_0x1b0dfb,function(_0x4a15af){if(_0x4a15af[_0x32d9('0x31')]!==_0x32d9('0x41')){var _0x2649d8={};_0x2649d8[_0x4a15af[_0x32d9('0x2c')]]={'$like':'%'+_0x272449[_0x32d9('0x33')][_0x32d9('0x3f')]+'%'};return _0x2649d8;}})});}_0x56a7ab=_[_0x32d9('0x40')]({},_0x56a7ab,_0x272449[_0x32d9('0x42')]);var _0x5eabdb={'where':_0x56a7ab['where']};return db[_0x32d9('0x2f')][_0x32d9('0x24')](_0x5eabdb)['then'](function(_0x2eeb32){_0x11909b[_0x32d9('0x24')]=_0x2eeb32;if(_0x272449[_0x32d9('0x33')][_0x32d9('0x43')]){_0x56a7ab['include']=[{'all':!![]}];}return db['JscriptyProject'][_0x32d9('0x44')](_0x56a7ab);})[_0x32d9('0x28')](function(_0x12c469){_0x11909b[_0x32d9('0x45')]=_0x12c469;return _0x11909b;})[_0x32d9('0x28')](respondWithFilteredResult(_0xda0f8f,_0x56a7ab))[_0x32d9('0x46')](handleError(_0xda0f8f,null));};exports[_0x32d9('0x47')]=function(_0x15f42f,_0x2edc21){var _0x4344dc={'raw':![],'where':{'id':_0x15f42f[_0x32d9('0x48')]['id']}},_0x56c419={};_0x56c419['model']=_[_0x32d9('0x34')](db[_0x32d9('0x2f')][_0x32d9('0x49')]);_0x56c419['query']=_['keys'](_0x15f42f['query']);_0x56c419[_0x32d9('0x35')]=_[_0x32d9('0x36')](_0x56c419['model'],_0x56c419[_0x32d9('0x33')]);_0x4344dc['attributes']=_[_0x32d9('0x36')](_0x56c419['model'],qs[_0x32d9('0x39')](_0x15f42f[_0x32d9('0x33')][_0x32d9('0x39')]));_0x4344dc[_0x32d9('0x38')]=_0x4344dc[_0x32d9('0x38')]['length']?_0x4344dc[_0x32d9('0x38')]:_0x56c419[_0x32d9('0x37')];if(_0x15f42f[_0x32d9('0x33')]['includeAll']){_0x4344dc[_0x32d9('0x4a')]=[{'all':!![]}];}_0x4344dc=_[_0x32d9('0x40')]({},_0x4344dc,_0x15f42f[_0x32d9('0x42')]);return db[_0x32d9('0x2f')][_0x32d9('0x4b')](_0x4344dc)['then'](handleEntityNotFound(_0x2edc21,null))[_0x32d9('0x28')](respondWithResult(_0x2edc21,null))[_0x32d9('0x46')](handleError(_0x2edc21,null));};exports[_0x32d9('0x4c')]=function(_0x433d90,_0x4f0df5){return db['JscriptyProject'][_0x32d9('0x4c')](_0x433d90[_0x32d9('0x4d')],{})[_0x32d9('0x28')](function(_0x39eee9){var _0x26959d=_0x433d90[_0x32d9('0x4e')][_0x32d9('0x29')]({'plain':!![]});if(!_0x26959d)throw new Error(_0x32d9('0x4f'));if(_0x26959d['role']===_0x32d9('0x4e')){var _0x1d7425=_0x39eee9[_0x32d9('0x29')]({'plain':!![]});var _0x4d1197='Projects';return db[_0x32d9('0x50')][_0x32d9('0x4b')]({'where':{'name':_0x4d1197,'userProfileId':_0x26959d[_0x32d9('0x51')]},'raw':!![]})[_0x32d9('0x28')](function(_0x144dac){if(_0x144dac&&_0x144dac[_0x32d9('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x1d7425[_0x32d9('0x2c')],'resourceId':_0x1d7425['id'],'type':_0x144dac[_0x32d9('0x2c')],'sectionId':_0x144dac['id']},{})['then'](function(){return _0x39eee9;});}else{return _0x39eee9;}})[_0x32d9('0x46')](function(_0x284127){logger['error'](_0x32d9('0x53'),_0x284127);throw _0x284127;});}return _0x39eee9;})[_0x32d9('0x28')](respondWithResult(_0x4f0df5,0xc9))[_0x32d9('0x46')](handleError(_0x4f0df5,null));};exports[_0x32d9('0x54')]=function(_0x1900da,_0xc3b38d){var _0x5a88a2={'where':{'id':_0x1900da[_0x32d9('0x48')]['id']}},_0x25d06b={};_0x25d06b[_0x32d9('0x37')]=_[_0x32d9('0x34')](db[_0x32d9('0x2f')]['rawAttributes']);_0x5a88a2[_0x32d9('0x38')]=_[_0x32d9('0x36')](_0x25d06b[_0x32d9('0x37')],qs[_0x32d9('0x39')](_0x1900da[_0x32d9('0x33')][_0x32d9('0x39')]));_0x5a88a2[_0x32d9('0x38')]=_0x5a88a2['attributes'][_0x32d9('0x3a')]?_0x5a88a2[_0x32d9('0x38')]:_0x25d06b[_0x32d9('0x37')];if(_0x1900da[_0x32d9('0x33')]['includeAll']){_0x5a88a2['include']=[{'all':!![]}];}_0x5a88a2=_[_0x32d9('0x40')]({},_0x5a88a2,_0x1900da[_0x32d9('0x42')]);return db[_0x32d9('0x2f')][_0x32d9('0x4b')](_0x5a88a2)['then'](handleEntityNotFound(_0xc3b38d,null))[_0x32d9('0x28')](function(_0x26e5bb){if(_0x26e5bb){var _0x5930dd=_0x26e5bb[_0x32d9('0x29')]({'plain':!![]});_0x5930dd=qs['omit'](_0x5930dd,['id','createdAt',_0x32d9('0x55')]);_0x1900da[_0x32d9('0x4d')]=_[_0x32d9('0x56')](_0x1900da[_0x32d9('0x4d')],['id','createdAt',_0x32d9('0x55')]);return db[_0x32d9('0x2f')]['create'](_['merge'](_0x5930dd,_0x1900da[_0x32d9('0x4d')]),{'include':_0x1900da[_0x32d9('0x33')][_0x32d9('0x43')]?[{'all':!![]}]:undefined})['then'](function(_0x29f194){var _0x144d16=_0x1900da[_0x32d9('0x4e')][_0x32d9('0x29')]({'plain':!![]});if(!_0x144d16)throw new Error(_0x32d9('0x4f'));if(_0x144d16[_0x32d9('0x57')]==='user'){var _0x371922=_0x29f194[_0x32d9('0x29')]({'plain':!![]});var _0x5127d8='Projects';return db[_0x32d9('0x50')][_0x32d9('0x4b')]({'where':{'name':_0x5127d8,'userProfileId':_0x144d16[_0x32d9('0x51')]},'raw':!![]})[_0x32d9('0x28')](function(_0x2f3f19){if(_0x2f3f19&&_0x2f3f19[_0x32d9('0x52')]===0x0){return db['UserProfileResource'][_0x32d9('0x4c')]({'name':_0x371922[_0x32d9('0x2c')],'resourceId':_0x371922['id'],'type':_0x2f3f19[_0x32d9('0x2c')],'sectionId':_0x2f3f19['id']},{})[_0x32d9('0x28')](function(){return _0x29f194;});}else{return _0x29f194;}})['catch'](function(_0x38a176){logger[_0x32d9('0x58')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38a176);throw _0x38a176;});}return _0x29f194;});}})['then'](respondWithResult(_0xc3b38d,0xc9))[_0x32d9('0x46')](handleError(_0xc3b38d,null));};exports[_0x32d9('0x59')]=function(_0x2e0601,_0x17f450){if(_0x2e0601['body']['id']){delete _0x2e0601['body']['id'];}return db[_0x32d9('0x2f')][_0x32d9('0x4b')]({'where':{'id':_0x2e0601[_0x32d9('0x48')]['id']}})[_0x32d9('0x28')](handleEntityNotFound(_0x17f450,null))[_0x32d9('0x28')](saveUpdates(_0x2e0601[_0x32d9('0x4d')],null))[_0x32d9('0x28')](respondWithResult(_0x17f450,null))['catch'](handleError(_0x17f450,null));};exports[_0x32d9('0x2b')]=function(_0x4a2dfe,_0x1aab0d){return db[_0x32d9('0x2f')][_0x32d9('0x4b')]({'where':{'id':_0x4a2dfe['params']['id']}})['then'](handleEntityNotFound(_0x1aab0d,null))[_0x32d9('0x28')](removeEntity(_0x1aab0d,null))[_0x32d9('0x46')](handleError(_0x1aab0d,null));};exports['getSessions']=function(_0x12fbc3,_0x5331c7,_0x17e95e){var _0x4d854d={'raw':!![],'where':{}};var _0x12bd39={};var _0x50f93f={'count':0x0,'rows':[]};return db[_0x32d9('0x2f')]['findOne']({'where':{'id':_0x12fbc3[_0x32d9('0x48')]['id']}})[_0x32d9('0x28')](handleEntityNotFound(_0x5331c7,null))['then'](function(_0x510ffc){if(_0x510ffc){_0x12bd39[_0x32d9('0x37')]=_[_0x32d9('0x34')](db[_0x32d9('0x5a')][_0x32d9('0x49')]);_0x12bd39[_0x32d9('0x33')]=_[_0x32d9('0x34')](_0x12fbc3[_0x32d9('0x33')]);_0x12bd39[_0x32d9('0x35')]=_[_0x32d9('0x36')](_0x12bd39['model'],_0x12bd39['query']);_0x4d854d[_0x32d9('0x38')]=_[_0x32d9('0x36')](_0x12bd39[_0x32d9('0x37')],qs[_0x32d9('0x39')](_0x12fbc3[_0x32d9('0x33')][_0x32d9('0x39')]));_0x4d854d[_0x32d9('0x38')]=_0x4d854d['attributes'][_0x32d9('0x3a')]?_0x4d854d[_0x32d9('0x38')]:_0x12bd39[_0x32d9('0x37')];if(!_0x12fbc3[_0x32d9('0x33')][_0x32d9('0x3b')](_0x32d9('0x5b'))){_0x4d854d[_0x32d9('0x22')]=qs[_0x32d9('0x22')](_0x12fbc3['query'][_0x32d9('0x22')]);_0x4d854d['offset']=qs['offset'](_0x12fbc3[_0x32d9('0x33')]['offset']);}_0x4d854d[_0x32d9('0x3c')]=qs[_0x32d9('0x3d')](_0x12fbc3[_0x32d9('0x33')][_0x32d9('0x3d')]);_0x4d854d[_0x32d9('0x3e')]=qs[_0x32d9('0x35')](_[_0x32d9('0x5c')](_0x12fbc3[_0x32d9('0x33')],_0x12bd39['filters']));_0x4d854d[_0x32d9('0x3e')]['ProjectId']=_0x510ffc['id'];if(_0x12fbc3[_0x32d9('0x33')][_0x32d9('0x3f')]){_0x4d854d['where']=_['merge'](_0x4d854d['where'],{'$or':_[_0x32d9('0x2e')](_0x4d854d['attributes'],function(_0x41bc2b){var _0x554a36={};_0x554a36[_0x41bc2b]={'$like':'%'+_0x12fbc3[_0x32d9('0x33')]['filter']+'%'};return _0x554a36;})});}_0x4d854d=_['merge']({},_0x4d854d,_0x12fbc3['options']);return db[_0x32d9('0x5a')][_0x32d9('0x24')]({'where':_0x4d854d['where']})[_0x32d9('0x28')](function(_0xd3fd19){_0x50f93f['count']=_0xd3fd19;if(_0x12fbc3[_0x32d9('0x33')][_0x32d9('0x43')]){_0x4d854d[_0x32d9('0x4a')]=[{'all':!![]}];}return db[_0x32d9('0x5a')]['findAll'](_0x4d854d);})[_0x32d9('0x28')](function(_0x874bb0){_0x50f93f[_0x32d9('0x45')]=_0x874bb0;return _0x50f93f;});}})[_0x32d9('0x28')](respondWithFilteredResult(_0x5331c7,_0x4d854d))[_0x32d9('0x46')](handleError(_0x5331c7,null));};exports[_0x32d9('0x5d')]=function(_0x13aff0,_0x157cbf,_0x4d916e){var _0x72cdce={'raw':!![],'where':{}};var _0x4bdb42={};var _0x5d6ddf={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x13aff0[_0x32d9('0x48')]['id']}})['then'](handleEntityNotFound(_0x157cbf,null))[_0x32d9('0x28')](function(_0x12b96a){if(_0x12b96a){_0x4bdb42[_0x32d9('0x37')]=_[_0x32d9('0x34')](db[_0x32d9('0x5e')][_0x32d9('0x49')]);_0x4bdb42[_0x32d9('0x33')]=_[_0x32d9('0x34')](_0x13aff0['query']);_0x4bdb42[_0x32d9('0x35')]=_['intersection'](_0x4bdb42[_0x32d9('0x37')],_0x4bdb42[_0x32d9('0x33')]);_0x72cdce[_0x32d9('0x38')]=_[_0x32d9('0x36')](_0x4bdb42[_0x32d9('0x37')],qs['fields'](_0x13aff0[_0x32d9('0x33')][_0x32d9('0x39')]));_0x72cdce[_0x32d9('0x38')]=_0x72cdce[_0x32d9('0x38')][_0x32d9('0x3a')]?_0x72cdce[_0x32d9('0x38')]:_0x4bdb42[_0x32d9('0x37')];if(!_0x13aff0['query'][_0x32d9('0x3b')](_0x32d9('0x5b'))){_0x72cdce[_0x32d9('0x22')]=qs[_0x32d9('0x22')](_0x13aff0[_0x32d9('0x33')][_0x32d9('0x22')]);_0x72cdce[_0x32d9('0x21')]=qs[_0x32d9('0x21')](_0x13aff0[_0x32d9('0x33')][_0x32d9('0x21')]);}_0x72cdce[_0x32d9('0x3c')]=qs[_0x32d9('0x3d')](_0x13aff0[_0x32d9('0x33')][_0x32d9('0x3d')]);_0x72cdce[_0x32d9('0x3e')]=qs[_0x32d9('0x35')](_[_0x32d9('0x5c')](_0x13aff0['query'],_0x4bdb42[_0x32d9('0x35')]));_0x72cdce[_0x32d9('0x3e')][_0x32d9('0x5f')]=_0x12b96a['id'];if(_0x13aff0[_0x32d9('0x33')][_0x32d9('0x3f')]){_0x72cdce[_0x32d9('0x3e')]=_[_0x32d9('0x40')](_0x72cdce['where'],{'$or':_[_0x32d9('0x2e')](_0x72cdce['attributes'],function(_0x28dffd){var _0x78fcbf={};_0x78fcbf[_0x28dffd]={'$like':'%'+_0x13aff0[_0x32d9('0x33')]['filter']+'%'};return _0x78fcbf;})});}_0x72cdce=_[_0x32d9('0x40')]({},_0x72cdce,_0x13aff0[_0x32d9('0x42')]);return db['JscriptyAnswerReport'][_0x32d9('0x24')]({'where':_0x72cdce[_0x32d9('0x3e')]})[_0x32d9('0x28')](function(_0x38ac3e){_0x5d6ddf[_0x32d9('0x24')]=_0x38ac3e;if(_0x13aff0[_0x32d9('0x33')][_0x32d9('0x43')]){_0x72cdce[_0x32d9('0x4a')]=[{'all':!![]}];}return db[_0x32d9('0x5e')][_0x32d9('0x44')](_0x72cdce);})[_0x32d9('0x28')](function(_0x44ef70){_0x5d6ddf[_0x32d9('0x45')]=_0x44ef70;return _0x5d6ddf;});}})[_0x32d9('0x28')](respondWithFilteredResult(_0x157cbf,_0x72cdce))[_0x32d9('0x46')](handleError(_0x157cbf,null));};function char(_0x529c1a){return _0x32d9('0x60')===typeof _0x529c1a?String[_0x32d9('0x61')][_0x32d9('0x27')](null,arguments):_0x529c1a;}function needsEncapsulation(_0x3c4d00){return!!_0x3c4d00&&(_0x3c4d00['toString']()[_0x32d9('0x62')](char(0xd))>=0x0||_0x3c4d00[_0x32d9('0x63')]()[_0x32d9('0x62')](char(0xa))>=0x0||_0x3c4d00[_0x32d9('0x63')]()[_0x32d9('0x62')](char(0x2c))>=0x0||_0x3c4d00[_0x32d9('0x63')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x11dbab){var _0x15ef59=char(0x22),_0x5bdb90='\x5c'+char(0x22),_0x4df99d=_0x11dbab[_0x32d9('0x63')]()[_0x32d9('0x64')](new RegExp(_0x15ef59,'g'),_0x5bdb90);return _0x15ef59+_0x4df99d+_0x15ef59;}exports[_0x32d9('0x65')]=function(_0x4c9fc1,_0x2cc671,_0xc40116){var _0xaaf11b,_0x3d38e1;var _0x1e2483={'where':{'ProjectId':_0x4c9fc1[_0x32d9('0x48')]['id']}};if(_0x4c9fc1[_0x32d9('0x33')]['startTime']){_0x1e2483[_0x32d9('0x3e')]['starttime']=JSON['parse'](_0x4c9fc1[_0x32d9('0x33')][_0x32d9('0x66')]);}return db['JscriptySessionReport']['findAll'](_0x1e2483)[_0x32d9('0x28')](handleEntityNotFound(_0x2cc671,null))[_0x32d9('0x28')](function(_0x77a931){if(_0x77a931){_0xaaf11b=_0x77a931;return db['JscriptyQuestionReport'][_0x32d9('0x44')]({'where':{'SessionId':{'$in':_[_0x32d9('0x2e')](_0xaaf11b,'id')},'ProjectId':_0x4c9fc1[_0x32d9('0x48')]['id']},'order':_0x32d9('0x67')});}})[_0x32d9('0x28')](handleEntityNotFound(_0x2cc671,null))[_0x32d9('0x28')](function(_0x4bb137){if(_0x4bb137){_0x3d38e1=_0x4bb137;var _0xaa266f={};for(var _0x443a16=0x0,_0x1fa63b=_0x3d38e1['length'];_0x443a16<_0x1fa63b;_0x443a16++){if(!_0xaa266f[_0x32d9('0x3b')](_0x3d38e1[_0x443a16][_0x32d9('0x68')])){_0xaa266f[_0x3d38e1[_0x443a16]['questionId']]=needsEncapsulation(_0x3d38e1[_0x443a16]['question'])?encapsulate(_0x3d38e1[_0x443a16][_0x32d9('0x69')]):_0x3d38e1[_0x443a16][_0x32d9('0x69')];}}var _0x2940bf=[],_0x2a1de0={};for(var _0x3e9f50=0x0,_0x461071=_0xaaf11b[_0x32d9('0x3a')];_0x3e9f50<_0x461071;_0x3e9f50++){_0x2a1de0={'ProjectId':_0x4c9fc1[_0x32d9('0x48')]['id'],'SessionId':_0xaaf11b[_0x3e9f50]['id'],'StartTime':moment(_0xaaf11b[_0x3e9f50][_0x32d9('0x6a')])[_0x32d9('0x6b')](_0x32d9('0x6c'))};for(var _0x1f5b62=0x0,_0x19720a=_0x3d38e1[_0x32d9('0x3a')];_0x1f5b62<_0x19720a;_0x1f5b62++){if(_0x3d38e1[_0x1f5b62][_0x32d9('0x6d')]==_0xaaf11b[_0x3e9f50]['id']&&_0xaa266f[_0x32d9('0x3b')](_0x3d38e1[_0x1f5b62][_0x32d9('0x68')])){_0x2a1de0[_0xaa266f[_0x3d38e1[_0x1f5b62][_0x32d9('0x68')]]]=_0x3d38e1[_0x1f5b62][_0x32d9('0x6e')];}}for(var _0x3add4b in _0xaa266f){if(!_0x2a1de0[_0x32d9('0x3b')](_0xaa266f[_0x3add4b])){_0x2a1de0[_0xaa266f[_0x3add4b]]=null;}}_0x2940bf[_0x32d9('0x6f')](_0x2a1de0);}return _0x2940bf;}})['then'](function(_0x460e82){if(!_[_0x32d9('0x70')](_0x460e82)){var _0x560e62=toCsv(_0x460e82);var _0x29dc11=Date[_0x32d9('0x71')]();fs['writeFileSync'](util['format'](_0x32d9('0x72'),_0x4c9fc1[_0x32d9('0x48')]['id'],_0x29dc11),_0x560e62);_0x2cc671[_0x32d9('0x73')](_0x32d9('0x74'),'attachment;\x20filename='+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x4c9fc1[_0x32d9('0x48')]['id'],_0x29dc11));_0x2cc671[_0x32d9('0x73')]('Content-type',_0x32d9('0x75'));return _0x2cc671[_0x32d9('0x76')](util[_0x32d9('0x6b')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x4c9fc1[_0x32d9('0x48')]['id'],_0x29dc11));}else{return _0x2cc671['sendStatus'](0xcc);}})[_0x32d9('0x46')](handleError(_0x2cc671,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 2ff744b..06d3453 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 _0x6334=['rimraf','../../config/environment','./jscriptyProject.attributes','exports','JscriptyProject','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x393730,_0x2bfe34){var _0x3323f3=function(_0x1b8faf){while(--_0x1b8faf){_0x393730['push'](_0x393730['shift']());}};_0x3323f3(++_0x2bfe34);}(_0x6334,0x119));var _0x4633=function(_0x252805,_0x1d1e8e){_0x252805=_0x252805-0x0;var _0x3e74b9=_0x6334[_0x252805];return _0x3e74b9;};'use strict';var _=require(_0x4633('0x0'));var util=require(_0x4633('0x1'));var logger=require(_0x4633('0x2'))(_0x4633('0x3'));var moment=require(_0x4633('0x4'));var BPromise=require(_0x4633('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4633('0x6'));var rimraf=require(_0x4633('0x7'));var config=require(_0x4633('0x8'));var attributes=require(_0x4633('0x9'));module[_0x4633('0xa')]=function(_0x6493dc,_0x175e14){return _0x6493dc['define'](_0x4633('0xb'),attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x777f=['define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptyProject.attributes'];(function(_0x2064e5,_0x4f6fa2){var _0x21a233=function(_0x1b2491){while(--_0x1b2491){_0x2064e5['push'](_0x2064e5['shift']());}};_0x21a233(++_0x4f6fa2);}(_0x777f,0x9f));var _0xf777=function(_0x3cfb0d,_0x4df584){_0x3cfb0d=_0x3cfb0d-0x0;var _0x3486b4=_0x777f[_0x3cfb0d];return _0x3486b4;};'use strict';var _=require(_0xf777('0x0'));var util=require(_0xf777('0x1'));var logger=require(_0xf777('0x2'))(_0xf777('0x3'));var moment=require(_0xf777('0x4'));var BPromise=require(_0xf777('0x5'));var rp=require(_0xf777('0x6'));var fs=require('fs');var path=require(_0xf777('0x7'));var rimraf=require('rimraf');var config=require(_0xf777('0x8'));var attributes=require(_0xf777('0x9'));module['exports']=function(_0x5b7903,_0x5df5dc){return _0x5b7903[_0xf777('0xa')](_0xf777('0xb'),attributes,{'tableName':_0xf777('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index badf828..7a6f0cc 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 _0xda3f=['rpc','jayson/promise','client','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/logger'];(function(_0x47408e,_0x481428){var _0x1636bc=function(_0x2fe7a6){while(--_0x2fe7a6){_0x47408e['push'](_0x47408e['shift']());}};_0x1636bc(++_0x481428);}(_0xda3f,0xec));var _0xfda3=function(_0x32f3f7,_0x1d8aa2){_0x32f3f7=_0x32f3f7-0x0;var _0x50e6c7=_0xda3f[_0x32f3f7];return _0x50e6c7;};'use strict';var _=require('lodash');var util=require(_0xfda3('0x0'));var moment=require(_0xfda3('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfda3('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xfda3('0x3'))(_0xfda3('0x4'));var config=require('../../config/environment');var jayson=require(_0xfda3('0x5'));var client=jayson[_0xfda3('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e72d1,_0x316792,_0x42476a){return new BPromise(function(_0x125e2a,_0x4018c0){return client[_0xfda3('0x7')](_0x4e72d1,_0x42476a)[_0xfda3('0x8')](function(_0x46655c){logger[_0xfda3('0x9')](_0xfda3('0xa'),_0x316792,_0xfda3('0xb'));logger[_0xfda3('0xc')](_0xfda3('0xd'),_0x316792,'request\x20sent',JSON[_0xfda3('0xe')](_0x46655c));if(_0x46655c[_0xfda3('0xf')]){if(_0x46655c[_0xfda3('0xf')][_0xfda3('0x10')]===0x1f4){logger[_0xfda3('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c[_0xfda3('0xf')]['message']);return _0x4018c0(_0x46655c[_0xfda3('0xf')][_0xfda3('0x11')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0x46655c['error'][_0xfda3('0x11')]);return _0x125e2a(_0x46655c[_0xfda3('0xf')]['message']);}else{logger['info']('JscriptyProject,\x20%s,\x20%s',_0x316792,_0xfda3('0xb'));_0x125e2a(_0x46655c[_0xfda3('0x12')][_0xfda3('0x11')]);}})[_0xfda3('0x13')](function(_0x34900d){logger[_0xfda3('0xf')](_0xfda3('0xa'),_0x316792,_0x34900d);_0x4018c0(_0x34900d);});});} \ No newline at end of file +var _0x70e0=['code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2accbe,_0x5580a5){var _0x5ecbd4=function(_0x1a7098){while(--_0x1a7098){_0x2accbe['push'](_0x2accbe['shift']());}};_0x5ecbd4(++_0x5580a5);}(_0x70e0,0x17b));var _0x070e=function(_0x430977,_0x4b2573){_0x430977=_0x430977-0x0;var _0x2544e4=_0x70e0[_0x430977];return _0x2544e4;};'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')]('JscriptyProject,\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')]('JscriptyProject,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('JscriptyProject,\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);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index cebf513..57592ed 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 _0xdb47=['show','post','create','put','update','destroy','exports','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0xb6acc,_0x324909){var _0x37c846=function(_0x3295f3){while(--_0x3295f3){_0xb6acc['push'](_0xb6acc['shift']());}};_0x37c846(++_0x324909);}(_0xdb47,0x9f));var _0x7db4=function(_0x56d487,_0x34012d){_0x56d487=_0x56d487-0x0;var _0x43c2f6=_0xdb47[_0x56d487];return _0x43c2f6;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x7db4('0x0'));var express=require('express');var router=express[_0x7db4('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x7db4('0x2'));var interaction=require(_0x7db4('0x3'));var config=require(_0x7db4('0x4'));var controller=require(_0x7db4('0x5'));router[_0x7db4('0x6')]('/',auth[_0x7db4('0x7')](),controller[_0x7db4('0x8')]);router[_0x7db4('0x6')](_0x7db4('0x9'),auth['isAuthenticated'](),controller[_0x7db4('0xa')]);router['get'](_0x7db4('0xb'),auth[_0x7db4('0x7')](),controller[_0x7db4('0xc')]);router[_0x7db4('0xd')]('/',auth[_0x7db4('0x7')](),controller[_0x7db4('0xe')]);router[_0x7db4('0xf')](_0x7db4('0xb'),auth[_0x7db4('0x7')](),controller[_0x7db4('0x10')]);router['delete'](_0x7db4('0xb'),auth[_0x7db4('0x7')](),controller[_0x7db4('0x11')]);module[_0x7db4('0x12')]=router; \ No newline at end of file +var _0x708d=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','/describe','isAuthenticated','/:id','show','create','put','update'];(function(_0x4bd06e,_0x593701){var _0x85ebb=function(_0x26a7f2){while(--_0x26a7f2){_0x4bd06e['push'](_0x4bd06e['shift']());}};_0x85ebb(++_0x593701);}(_0x708d,0x1e6));var _0xd708=function(_0x9e689c,_0x2600d8){_0x9e689c=_0x9e689c-0x0;var _0x13ee00=_0x708d[_0x9e689c];return _0x13ee00;};'use strict';var multer=require(_0xd708('0x0'));var util=require(_0xd708('0x1'));var path=require(_0xd708('0x2'));var timeout=require(_0xd708('0x3'));var express=require(_0xd708('0x4'));var router=express[_0xd708('0x5')]();var fs_extra=require(_0xd708('0x6'));var auth=require(_0xd708('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd708('0x8'));var controller=require(_0xd708('0x9'));router[_0xd708('0xa')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd708('0xb'),auth[_0xd708('0xc')](),controller['describe']);router[_0xd708('0xa')](_0xd708('0xd'),auth[_0xd708('0xc')](),controller[_0xd708('0xe')]);router['post']('/',auth[_0xd708('0xc')](),controller[_0xd708('0xf')]);router[_0xd708('0x10')](_0xd708('0xd'),auth['isAuthenticated'](),controller[_0xd708('0x11')]);router[_0xd708('0x12')](_0xd708('0xd'),auth['isAuthenticated'](),controller[_0xd708('0x13')]);module[_0xd708('0x14')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index ec1e575..0194bd1 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 _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x7a54,0x106));var _0x47a5=function(_0x4d4e7b,_0xa9d9e5){_0x4d4e7b=_0x4d4e7b-0x0;var _0x360b66=_0x7a54[_0x4d4e7b];return _0x360b66;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file +var _0x7a54=['long','STRING','sequelize','exports','TEXT'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x264f91,_0x5257f4){_0x264f91=_0x264f91-0x0;var _0x2f0a79=_0x7a54[_0x264f91];return _0x2f0a79;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'question':{'type':Sequelize[_0x47a5('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x47a5('0x3'))},'membername':{'type':Sequelize[_0x47a5('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x47a5('0x4')]},'uniqueid':{'type':Sequelize[_0x47a5('0x4')]},'calleridname':{'type':Sequelize[_0x47a5('0x4')]},'calleridnum':{'type':Sequelize[_0x47a5('0x4')]},'questionId':{'type':Sequelize[_0x47a5('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 68cc1b2..b29636c 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 _0x4dec=['../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','name','options','includeAll','include','findAll','rows','catch','show','find','create','update','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch'];(function(_0x16be88,_0x4f1df2){var _0xa22080=function(_0x3de901){while(--_0x3de901){_0x16be88['push'](_0x16be88['shift']());}};_0xa22080(++_0x4f1df2);}(_0x4dec,0xd9));var _0xc4de=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4dec[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xc4de('0x0'));var rimraf=require(_0xc4de('0x1'));var zipdir=require(_0xc4de('0x2'));var jsonpatch=require(_0xc4de('0x3'));var rp=require(_0xc4de('0x4'));var moment=require(_0xc4de('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc4de('0x6'));var util=require(_0xc4de('0x7'));var path=require(_0xc4de('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc4de('0x9'));var fs=require('fs');var fs_extra=require(_0xc4de('0xa'));var _=require(_0xc4de('0xb'));var squel=require(_0xc4de('0xc'));var crypto=require(_0xc4de('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc4de('0xe'));var toCsv=require(_0xc4de('0xf'));var querystring=require(_0xc4de('0x10'));var Papa=require(_0xc4de('0x11'));var Redis=require(_0xc4de('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc4de('0x13'));var hardwareService=require(_0xc4de('0x14'));var logger=require(_0xc4de('0x15'))(_0xc4de('0x16'));var utils=require('../../config/utils');var config=require(_0xc4de('0x17'));var licenseUtil=require(_0xc4de('0x18'));var db=require(_0xc4de('0x19'))['db'];function respondWithStatusCode(_0x43dd7b,_0x41f3a1){_0x41f3a1=_0x41f3a1||0xcc;return function(_0x4cc05d){if(_0x4cc05d){return _0x43dd7b[_0xc4de('0x1a')](_0x41f3a1);}return _0x43dd7b['status'](_0x41f3a1)[_0xc4de('0x1b')]();};}function respondWithResult(_0x191ff1,_0x294e50){_0x294e50=_0x294e50||0xc8;return function(_0x1328bc){if(_0x1328bc){return _0x191ff1[_0xc4de('0x1c')](_0x294e50)[_0xc4de('0x1d')](_0x1328bc);}};}function respondWithFilteredResult(_0x5a60f9,_0x227b95){return function(_0x3dd4db){if(_0x3dd4db){var _0x4fe54b=typeof _0x227b95[_0xc4de('0x1e')]===_0xc4de('0x1f')&&typeof _0x227b95[_0xc4de('0x20')]===_0xc4de('0x1f');var _0x5bbf22=_0x3dd4db['count'];var _0x1ee08e=_0x4fe54b?0x0:_0x227b95[_0xc4de('0x1e')];var _0x37ab51=_0x4fe54b?_0x3dd4db[_0xc4de('0x21')]:_0x227b95[_0xc4de('0x1e')]+_0x227b95[_0xc4de('0x20')];var _0x4c3b69;if(_0x37ab51>=_0x5bbf22){_0x37ab51=_0x5bbf22;_0x4c3b69=0xc8;}else{_0x4c3b69=0xce;}_0x5a60f9[_0xc4de('0x1c')](_0x4c3b69);return _0x5a60f9[_0xc4de('0x22')](_0xc4de('0x23'),_0x1ee08e+'-'+_0x37ab51+'/'+_0x5bbf22)[_0xc4de('0x1d')](_0x3dd4db);}return null;};}function patchUpdates(_0x590fd9){return function(_0x49f879){try{jsonpatch[_0xc4de('0x24')](_0x49f879,_0x590fd9,!![]);}catch(_0x5084c9){return BPromise[_0xc4de('0x25')](_0x5084c9);}return _0x49f879[_0xc4de('0x26')]();};}function saveUpdates(_0x160580,_0x490a0c){return function(_0x4f65d0){if(_0x4f65d0){return _0x4f65d0['update'](_0x160580)['then'](function(_0x435b2b){return _0x435b2b;});}return null;};}function removeEntity(_0xcadfe2,_0x419588){return function(_0x51e046){if(_0x51e046){return _0x51e046[_0xc4de('0x27')]()[_0xc4de('0x28')](function(){_0xcadfe2['status'](0xcc)[_0xc4de('0x1b')]();});}};}function handleEntityNotFound(_0x3b2adc,_0x2869f1){return function(_0x3725b7){if(!_0x3725b7){_0x3b2adc[_0xc4de('0x1a')](0x194);}return _0x3725b7;};}function handleError(_0x2a25cd,_0x2d75cd){_0x2d75cd=_0x2d75cd||0x1f4;return function(_0x4cb1f1){logger[_0xc4de('0x29')](_0x4cb1f1['stack']);if(_0x4cb1f1['name']){delete _0x4cb1f1['name'];}_0x2a25cd[_0xc4de('0x1c')](_0x2d75cd)[_0xc4de('0x2a')](_0x4cb1f1);};}exports[_0xc4de('0x2b')]=function(_0x15ec5b,_0x305c6a){var _0x145d23={},_0x406322={},_0x3a4467={'count':0x0,'rows':[]};var _0x1a149e=_[_0xc4de('0x2c')](db[_0xc4de('0x2d')][_0xc4de('0x2e')],function(_0x1f9192){return{'name':_0x1f9192[_0xc4de('0x2f')],'type':_0x1f9192[_0xc4de('0x30')]['key']};});_0x406322[_0xc4de('0x31')]=_['map'](_0x1a149e,'name');_0x406322[_0xc4de('0x32')]=_[_0xc4de('0x33')](_0x15ec5b['query']);_0x406322[_0xc4de('0x34')]=_[_0xc4de('0x35')](_0x406322['model'],_0x406322['query']);_0x145d23['attributes']=_['intersection'](_0x406322[_0xc4de('0x31')],qs[_0xc4de('0x36')](_0x15ec5b['query'][_0xc4de('0x36')]));_0x145d23[_0xc4de('0x37')]=_0x145d23[_0xc4de('0x37')][_0xc4de('0x38')]?_0x145d23[_0xc4de('0x37')]:_0x406322['model'];if(!_0x15ec5b[_0xc4de('0x32')][_0xc4de('0x39')](_0xc4de('0x3a'))){_0x145d23['limit']=qs[_0xc4de('0x20')](_0x15ec5b[_0xc4de('0x32')][_0xc4de('0x20')]);_0x145d23[_0xc4de('0x1e')]=qs[_0xc4de('0x1e')](_0x15ec5b[_0xc4de('0x32')][_0xc4de('0x1e')]);}_0x145d23[_0xc4de('0x3b')]=qs['sort'](_0x15ec5b[_0xc4de('0x32')][_0xc4de('0x3c')]);_0x145d23[_0xc4de('0x3d')]=qs['filters'](_[_0xc4de('0x3e')](_0x15ec5b['query'],_0x406322[_0xc4de('0x34')]),_0x1a149e);if(_0x15ec5b['query']['filter']){_0x145d23[_0xc4de('0x3d')]=_[_0xc4de('0x3f')](_0x145d23['where'],{'$or':_[_0xc4de('0x2c')](_0x1a149e,function(_0x38a273){if(_0x38a273[_0xc4de('0x30')]!==_0xc4de('0x40')){var _0x4f0c5c={};_0x4f0c5c[_0x38a273[_0xc4de('0x41')]]={'$like':'%'+_0x15ec5b[_0xc4de('0x32')]['filter']+'%'};return _0x4f0c5c;}})});}_0x145d23=_[_0xc4de('0x3f')]({},_0x145d23,_0x15ec5b[_0xc4de('0x42')]);var _0x220f46={'where':_0x145d23[_0xc4de('0x3d')]};return db[_0xc4de('0x2d')][_0xc4de('0x21')](_0x220f46)[_0xc4de('0x28')](function(_0x4b2d00){_0x3a4467[_0xc4de('0x21')]=_0x4b2d00;if(_0x15ec5b[_0xc4de('0x32')][_0xc4de('0x43')]){_0x145d23[_0xc4de('0x44')]=[{'all':!![]}];}return db[_0xc4de('0x2d')][_0xc4de('0x45')](_0x145d23);})[_0xc4de('0x28')](function(_0x4e30d2){_0x3a4467[_0xc4de('0x46')]=_0x4e30d2;return _0x3a4467;})[_0xc4de('0x28')](respondWithFilteredResult(_0x305c6a,_0x145d23))[_0xc4de('0x47')](handleError(_0x305c6a,null));};exports[_0xc4de('0x48')]=function(_0x8bf7a,_0x398eb7){var _0x45259b={'raw':!![],'where':{'id':_0x8bf7a['params']['id']}},_0x42f8b5={};_0x42f8b5[_0xc4de('0x31')]=_[_0xc4de('0x33')](db['JscriptyQuestionReport'][_0xc4de('0x2e')]);_0x42f8b5['query']=_[_0xc4de('0x33')](_0x8bf7a['query']);_0x42f8b5[_0xc4de('0x34')]=_[_0xc4de('0x35')](_0x42f8b5[_0xc4de('0x31')],_0x42f8b5[_0xc4de('0x32')]);_0x45259b[_0xc4de('0x37')]=_[_0xc4de('0x35')](_0x42f8b5[_0xc4de('0x31')],qs[_0xc4de('0x36')](_0x8bf7a[_0xc4de('0x32')]['fields']));_0x45259b['attributes']=_0x45259b[_0xc4de('0x37')][_0xc4de('0x38')]?_0x45259b['attributes']:_0x42f8b5['model'];if(_0x8bf7a[_0xc4de('0x32')][_0xc4de('0x43')]){_0x45259b['include']=[{'all':!![]}];}_0x45259b=_[_0xc4de('0x3f')]({},_0x45259b,_0x8bf7a[_0xc4de('0x42')]);return db['JscriptyQuestionReport'][_0xc4de('0x49')](_0x45259b)[_0xc4de('0x28')](handleEntityNotFound(_0x398eb7,null))['then'](respondWithResult(_0x398eb7,null))['catch'](handleError(_0x398eb7,null));};exports['create']=function(_0x3a2ae0,_0x49f257){return db[_0xc4de('0x2d')][_0xc4de('0x4a')](_0x3a2ae0['body'],{})[_0xc4de('0x28')](respondWithResult(_0x49f257,0xc9))[_0xc4de('0x47')](handleError(_0x49f257,null));};exports[_0xc4de('0x4b')]=function(_0x5c736e,_0x260d47){if(_0x5c736e[_0xc4de('0x4c')]['id']){delete _0x5c736e['body']['id'];}return db[_0xc4de('0x2d')]['find']({'where':{'id':_0x5c736e[_0xc4de('0x4d')]['id']}})[_0xc4de('0x28')](handleEntityNotFound(_0x260d47,null))[_0xc4de('0x28')](saveUpdates(_0x5c736e[_0xc4de('0x4c')],null))[_0xc4de('0x28')](respondWithResult(_0x260d47,null))[_0xc4de('0x47')](handleError(_0x260d47,null));};exports[_0xc4de('0x27')]=function(_0x4af726,_0x25fc25){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x4af726[_0xc4de('0x4d')]['id']}})[_0xc4de('0x28')](handleEntityNotFound(_0x25fc25,null))[_0xc4de('0x28')](removeEntity(_0x25fc25,null))['catch'](handleError(_0x25fc25,null));};exports[_0xc4de('0x4e')]=function(_0x155957,_0x2ed677){return db['JscriptyQuestionReport']['describe']()[_0xc4de('0x28')](respondWithResult(_0x2ed677,null))['catch'](handleError(_0x2ed677,null));}; \ No newline at end of file +var _0xfa21=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','JscriptyQuestionReport','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','map','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x2e81f4,_0x44f46a){var _0x198f70=function(_0x3d41b4){while(--_0x3d41b4){_0x2e81f4['push'](_0x2e81f4['shift']());}};_0x198f70(++_0x44f46a);}(_0xfa21,0x127));var _0x1fa2=function(_0x113b35,_0x22a043){_0x113b35=_0x113b35-0x0;var _0x405ee4=_0xfa21[_0x113b35];return _0x405ee4;};'use strict';var emlformat=require(_0x1fa2('0x0'));var rimraf=require(_0x1fa2('0x1'));var zipdir=require(_0x1fa2('0x2'));var jsonpatch=require(_0x1fa2('0x3'));var rp=require('request-promise');var moment=require(_0x1fa2('0x4'));var BPromise=require(_0x1fa2('0x5'));var Mustache=require(_0x1fa2('0x6'));var util=require(_0x1fa2('0x7'));var path=require(_0x1fa2('0x8'));var sox=require(_0x1fa2('0x9'));var csv=require(_0x1fa2('0xa'));var ejs=require(_0x1fa2('0xb'));var fs=require('fs');var fs_extra=require(_0x1fa2('0xc'));var _=require(_0x1fa2('0xd'));var squel=require(_0x1fa2('0xe'));var crypto=require(_0x1fa2('0xf'));var jsforce=require(_0x1fa2('0x10'));var deskjs=require(_0x1fa2('0x11'));var toCsv=require(_0x1fa2('0xa'));var querystring=require(_0x1fa2('0x12'));var Papa=require(_0x1fa2('0x13'));var Redis=require(_0x1fa2('0x14'));var authService=require(_0x1fa2('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1fa2('0x16'))('api');var utils=require(_0x1fa2('0x17'));var config=require(_0x1fa2('0x18'));var licenseUtil=require(_0x1fa2('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41561e,_0x424d5e){_0x424d5e=_0x424d5e||0xcc;return function(_0x177acd){if(_0x177acd){return _0x41561e['sendStatus'](_0x424d5e);}return _0x41561e[_0x1fa2('0x1a')](_0x424d5e)[_0x1fa2('0x1b')]();};}function respondWithResult(_0x139670,_0x4423e9){_0x4423e9=_0x4423e9||0xc8;return function(_0x2c675f){if(_0x2c675f){return _0x139670['status'](_0x4423e9)[_0x1fa2('0x1c')](_0x2c675f);}};}function respondWithFilteredResult(_0x2990b9,_0x12631f){return function(_0x3e9392){if(_0x3e9392){var _0xb44052=typeof _0x12631f[_0x1fa2('0x1d')]==='undefined'&&typeof _0x12631f['limit']===_0x1fa2('0x1e');var _0x3e9541=_0x3e9392[_0x1fa2('0x1f')];var _0x433f28=_0xb44052?0x0:_0x12631f[_0x1fa2('0x1d')];var _0x4bd086=_0xb44052?_0x3e9392['count']:_0x12631f[_0x1fa2('0x1d')]+_0x12631f[_0x1fa2('0x20')];var _0x577e7c;if(_0x4bd086>=_0x3e9541){_0x4bd086=_0x3e9541;_0x577e7c=0xc8;}else{_0x577e7c=0xce;}_0x2990b9[_0x1fa2('0x1a')](_0x577e7c);return _0x2990b9[_0x1fa2('0x21')](_0x1fa2('0x22'),_0x433f28+'-'+_0x4bd086+'/'+_0x3e9541)['json'](_0x3e9392);}return null;};}function patchUpdates(_0x5d63a3){return function(_0x571b97){try{jsonpatch[_0x1fa2('0x23')](_0x571b97,_0x5d63a3,!![]);}catch(_0x5431e2){return BPromise[_0x1fa2('0x24')](_0x5431e2);}return _0x571b97[_0x1fa2('0x25')]();};}function saveUpdates(_0x195fa3,_0x2df072){return function(_0x6821a){if(_0x6821a){return _0x6821a[_0x1fa2('0x26')](_0x195fa3)['then'](function(_0x3056df){return _0x3056df;});}return null;};}function removeEntity(_0x56b8f6,_0x88d6dd){return function(_0x9d0a7c){if(_0x9d0a7c){return _0x9d0a7c[_0x1fa2('0x27')]()[_0x1fa2('0x28')](function(){_0x56b8f6[_0x1fa2('0x1a')](0xcc)[_0x1fa2('0x1b')]();});}};}function handleEntityNotFound(_0x72be9a,_0x4c520e){return function(_0x2c5327){if(!_0x2c5327){_0x72be9a['sendStatus'](0x194);}return _0x2c5327;};}function handleError(_0x14a725,_0x1cbd70){_0x1cbd70=_0x1cbd70||0x1f4;return function(_0x51d8fe){logger[_0x1fa2('0x29')](_0x51d8fe[_0x1fa2('0x2a')]);if(_0x51d8fe[_0x1fa2('0x2b')]){delete _0x51d8fe['name'];}_0x14a725[_0x1fa2('0x1a')](_0x1cbd70)[_0x1fa2('0x2c')](_0x51d8fe);};}exports[_0x1fa2('0x2d')]=function(_0x4739f3,_0x4c481d){var _0x28bf49={},_0x36ea51={},_0x5627f3={'count':0x0,'rows':[]};var _0x543a96=_['map'](db[_0x1fa2('0x2e')][_0x1fa2('0x2f')],function(_0x5b2667){return{'name':_0x5b2667[_0x1fa2('0x30')],'type':_0x5b2667['type']['key']};});_0x36ea51[_0x1fa2('0x31')]=_['map'](_0x543a96,_0x1fa2('0x2b'));_0x36ea51[_0x1fa2('0x32')]=_['keys'](_0x4739f3['query']);_0x36ea51[_0x1fa2('0x33')]=_[_0x1fa2('0x34')](_0x36ea51[_0x1fa2('0x31')],_0x36ea51[_0x1fa2('0x32')]);_0x28bf49[_0x1fa2('0x35')]=_[_0x1fa2('0x34')](_0x36ea51[_0x1fa2('0x31')],qs[_0x1fa2('0x36')](_0x4739f3[_0x1fa2('0x32')][_0x1fa2('0x36')]));_0x28bf49[_0x1fa2('0x35')]=_0x28bf49['attributes'][_0x1fa2('0x37')]?_0x28bf49['attributes']:_0x36ea51[_0x1fa2('0x31')];if(!_0x4739f3[_0x1fa2('0x32')]['hasOwnProperty'](_0x1fa2('0x38'))){_0x28bf49[_0x1fa2('0x20')]=qs['limit'](_0x4739f3[_0x1fa2('0x32')]['limit']);_0x28bf49[_0x1fa2('0x1d')]=qs[_0x1fa2('0x1d')](_0x4739f3[_0x1fa2('0x32')][_0x1fa2('0x1d')]);}_0x28bf49[_0x1fa2('0x39')]=qs['sort'](_0x4739f3[_0x1fa2('0x32')][_0x1fa2('0x3a')]);_0x28bf49[_0x1fa2('0x3b')]=qs['filters'](_['pick'](_0x4739f3['query'],_0x36ea51[_0x1fa2('0x33')]),_0x543a96);if(_0x4739f3[_0x1fa2('0x32')][_0x1fa2('0x3c')]){_0x28bf49['where']=_[_0x1fa2('0x3d')](_0x28bf49[_0x1fa2('0x3b')],{'$or':_[_0x1fa2('0x3e')](_0x543a96,function(_0x3c3657){if(_0x3c3657[_0x1fa2('0x3f')]!==_0x1fa2('0x40')){var _0x15b1ec={};_0x15b1ec[_0x3c3657[_0x1fa2('0x2b')]]={'$like':'%'+_0x4739f3[_0x1fa2('0x32')][_0x1fa2('0x3c')]+'%'};return _0x15b1ec;}})});}_0x28bf49=_[_0x1fa2('0x3d')]({},_0x28bf49,_0x4739f3[_0x1fa2('0x41')]);var _0x318e7={'where':_0x28bf49[_0x1fa2('0x3b')]};return db[_0x1fa2('0x2e')]['count'](_0x318e7)[_0x1fa2('0x28')](function(_0x39e3b4){_0x5627f3[_0x1fa2('0x1f')]=_0x39e3b4;if(_0x4739f3[_0x1fa2('0x32')][_0x1fa2('0x42')]){_0x28bf49[_0x1fa2('0x43')]=[{'all':!![]}];}return db[_0x1fa2('0x2e')]['findAll'](_0x28bf49);})['then'](function(_0x365f2b){_0x5627f3[_0x1fa2('0x44')]=_0x365f2b;return _0x5627f3;})[_0x1fa2('0x28')](respondWithFilteredResult(_0x4c481d,_0x28bf49))[_0x1fa2('0x45')](handleError(_0x4c481d,null));};exports[_0x1fa2('0x46')]=function(_0x301c0b,_0x41222f){var _0x2d4a54={'raw':!![],'where':{'id':_0x301c0b[_0x1fa2('0x47')]['id']}},_0x40f863={};_0x40f863[_0x1fa2('0x31')]=_['keys'](db[_0x1fa2('0x2e')][_0x1fa2('0x2f')]);_0x40f863[_0x1fa2('0x32')]=_[_0x1fa2('0x48')](_0x301c0b[_0x1fa2('0x32')]);_0x40f863[_0x1fa2('0x33')]=_[_0x1fa2('0x34')](_0x40f863['model'],_0x40f863['query']);_0x2d4a54[_0x1fa2('0x35')]=_[_0x1fa2('0x34')](_0x40f863[_0x1fa2('0x31')],qs['fields'](_0x301c0b[_0x1fa2('0x32')][_0x1fa2('0x36')]));_0x2d4a54[_0x1fa2('0x35')]=_0x2d4a54[_0x1fa2('0x35')][_0x1fa2('0x37')]?_0x2d4a54[_0x1fa2('0x35')]:_0x40f863[_0x1fa2('0x31')];if(_0x301c0b[_0x1fa2('0x32')]['includeAll']){_0x2d4a54['include']=[{'all':!![]}];}_0x2d4a54=_[_0x1fa2('0x3d')]({},_0x2d4a54,_0x301c0b['options']);return db[_0x1fa2('0x2e')]['find'](_0x2d4a54)['then'](handleEntityNotFound(_0x41222f,null))[_0x1fa2('0x28')](respondWithResult(_0x41222f,null))['catch'](handleError(_0x41222f,null));};exports[_0x1fa2('0x49')]=function(_0x4b5798,_0x2b82d2){return db['JscriptyQuestionReport'][_0x1fa2('0x49')](_0x4b5798[_0x1fa2('0x4a')],{})['then'](respondWithResult(_0x2b82d2,0xc9))[_0x1fa2('0x45')](handleError(_0x2b82d2,null));};exports[_0x1fa2('0x26')]=function(_0x1932f8,_0x210409){if(_0x1932f8['body']['id']){delete _0x1932f8[_0x1fa2('0x4a')]['id'];}return db['JscriptyQuestionReport']['find']({'where':{'id':_0x1932f8[_0x1fa2('0x47')]['id']}})[_0x1fa2('0x28')](handleEntityNotFound(_0x210409,null))['then'](saveUpdates(_0x1932f8[_0x1fa2('0x4a')],null))['then'](respondWithResult(_0x210409,null))[_0x1fa2('0x45')](handleError(_0x210409,null));};exports[_0x1fa2('0x27')]=function(_0x29db58,_0x2a9989){return db[_0x1fa2('0x2e')][_0x1fa2('0x4b')]({'where':{'id':_0x29db58[_0x1fa2('0x47')]['id']}})['then'](handleEntityNotFound(_0x2a9989,null))['then'](removeEntity(_0x2a9989,null))['catch'](handleError(_0x2a9989,null));};exports[_0x1fa2('0x4c')]=function(_0x2f58a9,_0x2a7bcf){return db[_0x1fa2('0x2e')][_0x1fa2('0x4c')]()[_0x1fa2('0x28')](respondWithResult(_0x2a7bcf,null))['catch'](handleError(_0x2a7bcf,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 5fdb9bc..9a98b14 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 _0x9a67=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','JscriptyQuestionReport','report_jscripty_questions','util','../../config/logger'];(function(_0x131065,_0x3f030d){var _0x2a79e7=function(_0xff87d9){while(--_0xff87d9){_0x131065['push'](_0x131065['shift']());}};_0x2a79e7(++_0x3f030d);}(_0x9a67,0x18a));var _0x79a6=function(_0x33532f,_0x16d0ec){_0x33532f=_0x33532f-0x0;var _0x2b93aa=_0x9a67[_0x33532f];return _0x2b93aa;};'use strict';var _=require('lodash');var util=require(_0x79a6('0x0'));var logger=require(_0x79a6('0x1'))(_0x79a6('0x2'));var moment=require(_0x79a6('0x3'));var BPromise=require(_0x79a6('0x4'));var rp=require(_0x79a6('0x5'));var fs=require('fs');var path=require(_0x79a6('0x6'));var rimraf=require(_0x79a6('0x7'));var config=require(_0x79a6('0x8'));var attributes=require('./jscriptyQuestionReport.attributes');module['exports']=function(_0x51a680,_0x20a7d9){return _0x51a680[_0x79a6('0x9')](_0x79a6('0xa'),attributes,{'tableName':_0x79a6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec79=['define','report_jscripty_questions','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0x258200,_0x59dabe){var _0x214d0f=function(_0x35fea1){while(--_0x35fea1){_0x258200['push'](_0x258200['shift']());}};_0x214d0f(++_0x59dabe);}(_0xec79,0x1a6));var _0x9ec7=function(_0x37cbeb,_0x5662bb){_0x37cbeb=_0x37cbeb-0x0;var _0x17155f=_0xec79[_0x37cbeb];return _0x17155f;};'use strict';var _=require(_0x9ec7('0x0'));var util=require(_0x9ec7('0x1'));var logger=require('../../config/logger')(_0x9ec7('0x2'));var moment=require(_0x9ec7('0x3'));var BPromise=require(_0x9ec7('0x4'));var rp=require(_0x9ec7('0x5'));var fs=require('fs');var path=require(_0x9ec7('0x6'));var rimraf=require('rimraf');var config=require(_0x9ec7('0x7'));var attributes=require(_0x9ec7('0x8'));module[_0x9ec7('0x9')]=function(_0x2aff6c,_0x575876){return _0x2aff6c[_0x9ec7('0xa')]('JscriptyQuestionReport',attributes,{'tableName':_0x9ec7('0xb'),'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 3418887..dd3dd5f 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 _0x94ee=['message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x4179cf,_0x3885da){var _0x33d325=function(_0x55d35f){while(--_0x55d35f){_0x4179cf['push'](_0x4179cf['shift']());}};_0x33d325(++_0x3885da);}(_0x94ee,0x1e5));var _0xe94e=function(_0x32f962,_0x1d2037){_0x32f962=_0x32f962-0x0;var _0x3aee1e=_0x94ee[_0x32f962];return _0x3aee1e;};'use strict';var _=require(_0xe94e('0x0'));var util=require(_0xe94e('0x1'));var moment=require(_0xe94e('0x2'));var BPromise=require(_0xe94e('0x3'));var rs=require(_0xe94e('0x4'));var fs=require('fs');var Redis=require(_0xe94e('0x5'));var db=require(_0xe94e('0x6'))['db'];var utils=require(_0xe94e('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xe94e('0x8'));var jayson=require(_0xe94e('0x9'));var client=jayson[_0xe94e('0xa')][_0xe94e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48dddc,_0x189db2,_0x48d4e5){return new BPromise(function(_0x1b0bd5,_0x2f9b98){return client['request'](_0x48dddc,_0x48d4e5)[_0xe94e('0xc')](function(_0x3e1936){logger[_0xe94e('0xd')](_0xe94e('0xe'),_0x189db2,_0xe94e('0xf'));logger['debug'](_0xe94e('0x10'),_0x189db2,'request\x20sent',JSON['stringify'](_0x3e1936));if(_0x3e1936[_0xe94e('0x11')]){if(_0x3e1936[_0xe94e('0x11')][_0xe94e('0x12')]===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x189db2,_0x3e1936['error']['message']);return _0x2f9b98(_0x3e1936[_0xe94e('0x11')][_0xe94e('0x13')]);}logger[_0xe94e('0x11')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x189db2,_0x3e1936[_0xe94e('0x11')][_0xe94e('0x13')]);return _0x1b0bd5(_0x3e1936[_0xe94e('0x11')]['message']);}else{logger[_0xe94e('0xd')](_0xe94e('0xe'),_0x189db2,_0xe94e('0xf'));_0x1b0bd5(_0x3e1936['result'][_0xe94e('0x13')]);}})[_0xe94e('0x14')](function(_0x167418){logger['error'](_0xe94e('0xe'),_0x189db2,_0x167418);_0x2f9b98(_0x167418);});});} \ No newline at end of file +var _0x98fb=['catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyQuestionReport,\x20%s,\x20%s','result'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x98fb,0x6a));var _0xb98f=function(_0x58ca7d,_0x27f5ea){_0x58ca7d=_0x58ca7d-0x0;var _0x152c4c=_0x98fb[_0x58ca7d];return _0x152c4c;};'use strict';var _=require('lodash');var util=require(_0xb98f('0x0'));var moment=require('moment');var BPromise=require(_0xb98f('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb98f('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xb98f('0x3'));var logger=require(_0xb98f('0x4'))(_0xb98f('0x5'));var config=require(_0xb98f('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb98f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x472f87,_0x37e68e,_0x263fad){return new BPromise(function(_0x3a20d1,_0x40bf97){return client[_0xb98f('0x8')](_0x472f87,_0x263fad)[_0xb98f('0x9')](function(_0x267835){logger[_0xb98f('0xa')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x37e68e,_0xb98f('0xb'));logger[_0xb98f('0xc')](_0xb98f('0xd'),_0x37e68e,_0xb98f('0xb'),JSON[_0xb98f('0xe')](_0x267835));if(_0x267835[_0xb98f('0xf')]){if(_0x267835[_0xb98f('0xf')][_0xb98f('0x10')]===0x1f4){logger[_0xb98f('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x37e68e,_0x267835[_0xb98f('0xf')][_0xb98f('0x11')]);return _0x40bf97(_0x267835[_0xb98f('0xf')][_0xb98f('0x11')]);}logger[_0xb98f('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x37e68e,_0x267835['error'][_0xb98f('0x11')]);return _0x3a20d1(_0x267835['error']['message']);}else{logger[_0xb98f('0xa')](_0xb98f('0x12'),_0x37e68e,_0xb98f('0xb'));_0x3a20d1(_0x267835[_0xb98f('0x13')]['message']);}})[_0xb98f('0x14')](function(_0x465849){logger[_0xb98f('0xf')](_0xb98f('0x12'),_0x37e68e,_0x465849);_0x40bf97(_0x465849);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index c9351e6..e2ca3df 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 _0xfca0=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','describe','isAuthenticated','show','getQuestions','put','/:id','update','delete'];(function(_0x7f2df0,_0x2aa6df){var _0x1bb042=function(_0x38b02f){while(--_0x38b02f){_0x7f2df0['push'](_0x7f2df0['shift']());}};_0x1bb042(++_0x2aa6df);}(_0xfca0,0x190));var _0x0fca=function(_0x24259f,_0x102a0d){_0x24259f=_0x24259f-0x0;var _0x4e98e=_0xfca0[_0x24259f];return _0x4e98e;};'use strict';var multer=require(_0x0fca('0x0'));var util=require(_0x0fca('0x1'));var path=require('path');var timeout=require(_0x0fca('0x2'));var express=require(_0x0fca('0x3'));var router=express[_0x0fca('0x4')]();var fs_extra=require(_0x0fca('0x5'));var auth=require(_0x0fca('0x6'));var interaction=require(_0x0fca('0x7'));var config=require(_0x0fca('0x8'));var controller=require('./jscriptySessionReport.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0fca('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x0fca('0xa')]);router['get']('/:id',auth[_0x0fca('0xb')](),controller[_0x0fca('0xc')]);router[_0x0fca('0x9')]('/:id/questions',auth[_0x0fca('0xb')](),controller[_0x0fca('0xd')]);router['post']('/',auth[_0x0fca('0xb')](),controller['create']);router[_0x0fca('0xe')](_0x0fca('0xf'),auth[_0x0fca('0xb')](),controller[_0x0fca('0x10')]);router[_0x0fca('0x11')](_0x0fca('0xf'),auth[_0x0fca('0xb')](),controller['destroy']);module[_0x0fca('0x12')]=router; \ No newline at end of file +var _0x47c6=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','isAuthenticated','index','/describe','describe','get','show','/:id/questions','post','create','delete','/:id'];(function(_0x26d9ae,_0x416a73){var _0x3f46ab=function(_0x1b62f0){while(--_0x1b62f0){_0x26d9ae['push'](_0x26d9ae['shift']());}};_0x3f46ab(++_0x416a73);}(_0x47c6,0x1a4));var _0x647c=function(_0x51b52e,_0x3c2506){_0x51b52e=_0x51b52e-0x0;var _0x59a011=_0x47c6[_0x51b52e];return _0x59a011;};'use strict';var multer=require(_0x647c('0x0'));var util=require(_0x647c('0x1'));var path=require('path');var timeout=require(_0x647c('0x2'));var express=require(_0x647c('0x3'));var router=express[_0x647c('0x4')]();var fs_extra=require(_0x647c('0x5'));var auth=require(_0x647c('0x6'));var interaction=require(_0x647c('0x7'));var config=require(_0x647c('0x8'));var controller=require(_0x647c('0x9'));router['get']('/',auth[_0x647c('0xa')](),controller[_0x647c('0xb')]);router['get'](_0x647c('0xc'),auth[_0x647c('0xa')](),controller[_0x647c('0xd')]);router[_0x647c('0xe')]('/:id',auth[_0x647c('0xa')](),controller[_0x647c('0xf')]);router['get'](_0x647c('0x10'),auth[_0x647c('0xa')](),controller['getQuestions']);router[_0x647c('0x11')]('/',auth[_0x647c('0xa')](),controller[_0x647c('0x12')]);router['put']('/:id',auth[_0x647c('0xa')](),controller['update']);router[_0x647c('0x13')](_0x647c('0x14'),auth[_0x647c('0xa')](),controller['destroy']);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 38427e3..3139806 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 _0xa64d=['BOOLEAN','moment','exports','setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xa64d,0x13c));var _0xda64=function(_0x172bac,_0xe60dbf){_0x172bac=_0x172bac-0x0;var _0x3a11ed=_0xa64d[_0x172bac];return _0x3a11ed;};'use strict';var moment=require(_0xda64('0x0'));var Sequelize=require('sequelize');module[_0xda64('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x1b4e0d){this[_0xda64('0x2')](_0xda64('0x3'),_0x1b4e0d);this[_0xda64('0x2')](_0xda64('0x4'),moment()[_0xda64('0x5')](_0xda64('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xda64('0x7')]},'projectname':{'type':Sequelize[_0xda64('0x7')]},'queue':{'type':Sequelize[_0xda64('0x7')]},'uniqueid':{'type':Sequelize[_0xda64('0x7')]},'calleridname':{'type':Sequelize[_0xda64('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xda64('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x31dc=['setDataValue','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','sequelize','exports','DATE'];(function(_0x330e29,_0x22f050){var _0x5d9492=function(_0x4183f2){while(--_0x4183f2){_0x330e29['push'](_0x330e29['shift']());}};_0x5d9492(++_0x22f050);}(_0x31dc,0x1ab));var _0xc31d=function(_0x24ec0b,_0x5303ad){_0x24ec0b=_0x24ec0b-0x0;var _0x12acc6=_0x31dc[_0x24ec0b];return _0x12acc6;};'use strict';var moment=require('moment');var Sequelize=require(_0xc31d('0x0'));module[_0xc31d('0x1')]={'starttime':{'type':Sequelize[_0xc31d('0x2')],'set':function(_0x191423){this[_0xc31d('0x3')](_0xc31d('0x4'),_0x191423);this[_0xc31d('0x3')](_0xc31d('0x5'),moment()[_0xc31d('0x6')](_0xc31d('0x7')));}},'endtime':{'type':Sequelize[_0xc31d('0x2')]},'membername':{'type':Sequelize[_0xc31d('0x8')]},'projectname':{'type':Sequelize[_0xc31d('0x8')]},'queue':{'type':Sequelize[_0xc31d('0x8')]},'uniqueid':{'type':Sequelize[_0xc31d('0x8')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xc31d('0x8')]},'completed':{'type':Sequelize[_0xc31d('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 06622bd..3fbc64c 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 _0x1cef=['rows','catch','params','length','options','create','body','find','findOne','JscriptyQuestionReport','hasOwnProperty','SessionId','findAll','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','type','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','where','pick','filter','merge','JscriptySessionReport','includeAll','include'];(function(_0x263ca7,_0x20b967){var _0x2d19fb=function(_0x3b6080){while(--_0x3b6080){_0x263ca7['push'](_0x263ca7['shift']());}};_0x2d19fb(++_0x20b967);}(_0x1cef,0x1e7));var _0xf1ce=function(_0x3df223,_0x1740fc){_0x3df223=_0x3df223-0x0;var _0x562d11=_0x1cef[_0x3df223];return _0x562d11;};'use strict';var emlformat=require(_0xf1ce('0x0'));var rimraf=require(_0xf1ce('0x1'));var zipdir=require(_0xf1ce('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf1ce('0x3'));var moment=require(_0xf1ce('0x4'));var BPromise=require(_0xf1ce('0x5'));var Mustache=require('mustache');var util=require(_0xf1ce('0x6'));var path=require(_0xf1ce('0x7'));var sox=require(_0xf1ce('0x8'));var csv=require('to-csv');var ejs=require(_0xf1ce('0x9'));var fs=require('fs');var fs_extra=require(_0xf1ce('0xa'));var _=require(_0xf1ce('0xb'));var squel=require(_0xf1ce('0xc'));var crypto=require(_0xf1ce('0xd'));var jsforce=require(_0xf1ce('0xe'));var deskjs=require(_0xf1ce('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf1ce('0x10'));var Papa=require(_0xf1ce('0x11'));var Redis=require(_0xf1ce('0x12'));var authService=require(_0xf1ce('0x13'));var qs=require(_0xf1ce('0x14'));var as=require(_0xf1ce('0x15'));var hardwareService=require(_0xf1ce('0x16'));var logger=require(_0xf1ce('0x17'))('api');var utils=require(_0xf1ce('0x18'));var config=require(_0xf1ce('0x19'));var licenseUtil=require(_0xf1ce('0x1a'));var db=require(_0xf1ce('0x1b'))['db'];function respondWithStatusCode(_0x348cbe,_0x2e6070){_0x2e6070=_0x2e6070||0xcc;return function(_0x28b27c){if(_0x28b27c){return _0x348cbe[_0xf1ce('0x1c')](_0x2e6070);}return _0x348cbe['status'](_0x2e6070)[_0xf1ce('0x1d')]();};}function respondWithResult(_0x361551,_0xd47f88){_0xd47f88=_0xd47f88||0xc8;return function(_0x4471ac){if(_0x4471ac){return _0x361551[_0xf1ce('0x1e')](_0xd47f88)[_0xf1ce('0x1f')](_0x4471ac);}};}function respondWithFilteredResult(_0x267442,_0x5bded6){return function(_0x10cc06){if(_0x10cc06){var _0x446a4c=typeof _0x5bded6[_0xf1ce('0x20')]===_0xf1ce('0x21')&&typeof _0x5bded6['limit']==='undefined';var _0x52cd6d=_0x10cc06[_0xf1ce('0x22')];var _0x2b55a0=_0x446a4c?0x0:_0x5bded6[_0xf1ce('0x20')];var _0xccba31=_0x446a4c?_0x10cc06['count']:_0x5bded6[_0xf1ce('0x20')]+_0x5bded6[_0xf1ce('0x23')];var _0x482a37;if(_0xccba31>=_0x52cd6d){_0xccba31=_0x52cd6d;_0x482a37=0xc8;}else{_0x482a37=0xce;}_0x267442[_0xf1ce('0x1e')](_0x482a37);return _0x267442[_0xf1ce('0x24')]('Content-Range',_0x2b55a0+'-'+_0xccba31+'/'+_0x52cd6d)['json'](_0x10cc06);}return null;};}function patchUpdates(_0x548f53){return function(_0x41f059){try{jsonpatch['apply'](_0x41f059,_0x548f53,!![]);}catch(_0x42fec4){return BPromise[_0xf1ce('0x25')](_0x42fec4);}return _0x41f059[_0xf1ce('0x26')]();};}function saveUpdates(_0x58f11f,_0x31e162){return function(_0x58bf33){if(_0x58bf33){return _0x58bf33[_0xf1ce('0x27')](_0x58f11f)[_0xf1ce('0x28')](function(_0x348736){return _0x348736;});}return null;};}function removeEntity(_0x2598db,_0x39f72e){return function(_0x379ec2){if(_0x379ec2){return _0x379ec2[_0xf1ce('0x29')]()[_0xf1ce('0x28')](function(){_0x2598db[_0xf1ce('0x1e')](0xcc)[_0xf1ce('0x1d')]();});}};}function handleEntityNotFound(_0x197199,_0x4e79e0){return function(_0x433683){if(!_0x433683){_0x197199[_0xf1ce('0x1c')](0x194);}return _0x433683;};}function handleError(_0x1a8556,_0x4e2a74){_0x4e2a74=_0x4e2a74||0x1f4;return function(_0x19e5b4){logger[_0xf1ce('0x2a')](_0x19e5b4[_0xf1ce('0x2b')]);if(_0x19e5b4[_0xf1ce('0x2c')]){delete _0x19e5b4[_0xf1ce('0x2c')];}_0x1a8556[_0xf1ce('0x1e')](_0x4e2a74)[_0xf1ce('0x2d')](_0x19e5b4);};}exports['index']=function(_0x3e2dd0,_0x34e465){var _0x18a6d9={},_0x1f849f={},_0x55d3dc={'count':0x0,'rows':[]};var _0x172633=_[_0xf1ce('0x2e')](db['JscriptySessionReport'][_0xf1ce('0x2f')],function(_0x58f6ec){return{'name':_0x58f6ec['fieldName'],'type':_0x58f6ec[_0xf1ce('0x30')]['key']};});_0x1f849f['model']=_[_0xf1ce('0x2e')](_0x172633,_0xf1ce('0x2c'));_0x1f849f[_0xf1ce('0x31')]=_[_0xf1ce('0x32')](_0x3e2dd0[_0xf1ce('0x31')]);_0x1f849f[_0xf1ce('0x33')]=_[_0xf1ce('0x34')](_0x1f849f['model'],_0x1f849f[_0xf1ce('0x31')]);_0x18a6d9[_0xf1ce('0x35')]=_['intersection'](_0x1f849f[_0xf1ce('0x36')],qs['fields'](_0x3e2dd0[_0xf1ce('0x31')][_0xf1ce('0x37')]));_0x18a6d9[_0xf1ce('0x35')]=_0x18a6d9[_0xf1ce('0x35')]['length']?_0x18a6d9[_0xf1ce('0x35')]:_0x1f849f[_0xf1ce('0x36')];if(!_0x3e2dd0[_0xf1ce('0x31')]['hasOwnProperty'](_0xf1ce('0x38'))){_0x18a6d9['limit']=qs[_0xf1ce('0x23')](_0x3e2dd0[_0xf1ce('0x31')][_0xf1ce('0x23')]);_0x18a6d9['offset']=qs['offset'](_0x3e2dd0[_0xf1ce('0x31')][_0xf1ce('0x20')]);}_0x18a6d9[_0xf1ce('0x39')]=qs[_0xf1ce('0x3a')](_0x3e2dd0[_0xf1ce('0x31')][_0xf1ce('0x3a')]);_0x18a6d9[_0xf1ce('0x3b')]=qs[_0xf1ce('0x33')](_[_0xf1ce('0x3c')](_0x3e2dd0[_0xf1ce('0x31')],_0x1f849f[_0xf1ce('0x33')]),_0x172633);if(_0x3e2dd0[_0xf1ce('0x31')][_0xf1ce('0x3d')]){_0x18a6d9['where']=_[_0xf1ce('0x3e')](_0x18a6d9[_0xf1ce('0x3b')],{'$or':_[_0xf1ce('0x2e')](_0x172633,function(_0x2613b8){if(_0x2613b8[_0xf1ce('0x30')]!=='VIRTUAL'){var _0x196907={};_0x196907[_0x2613b8[_0xf1ce('0x2c')]]={'$like':'%'+_0x3e2dd0[_0xf1ce('0x31')][_0xf1ce('0x3d')]+'%'};return _0x196907;}})});}_0x18a6d9=_[_0xf1ce('0x3e')]({},_0x18a6d9,_0x3e2dd0['options']);var _0x5ae3cd={'where':_0x18a6d9[_0xf1ce('0x3b')]};return db[_0xf1ce('0x3f')][_0xf1ce('0x22')](_0x5ae3cd)[_0xf1ce('0x28')](function(_0x13a598){_0x55d3dc[_0xf1ce('0x22')]=_0x13a598;if(_0x3e2dd0[_0xf1ce('0x31')][_0xf1ce('0x40')]){_0x18a6d9[_0xf1ce('0x41')]=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x18a6d9);})[_0xf1ce('0x28')](function(_0x166ff9){_0x55d3dc[_0xf1ce('0x42')]=_0x166ff9;return _0x55d3dc;})['then'](respondWithFilteredResult(_0x34e465,_0x18a6d9))[_0xf1ce('0x43')](handleError(_0x34e465,null));};exports['show']=function(_0x380a4a,_0x5c058f){var _0x31b432={'raw':!![],'where':{'id':_0x380a4a[_0xf1ce('0x44')]['id']}},_0x52bc82={};_0x52bc82[_0xf1ce('0x36')]=_[_0xf1ce('0x32')](db[_0xf1ce('0x3f')]['rawAttributes']);_0x52bc82[_0xf1ce('0x31')]=_['keys'](_0x380a4a['query']);_0x52bc82[_0xf1ce('0x33')]=_[_0xf1ce('0x34')](_0x52bc82[_0xf1ce('0x36')],_0x52bc82[_0xf1ce('0x31')]);_0x31b432[_0xf1ce('0x35')]=_['intersection'](_0x52bc82[_0xf1ce('0x36')],qs[_0xf1ce('0x37')](_0x380a4a['query'][_0xf1ce('0x37')]));_0x31b432[_0xf1ce('0x35')]=_0x31b432[_0xf1ce('0x35')][_0xf1ce('0x45')]?_0x31b432[_0xf1ce('0x35')]:_0x52bc82['model'];if(_0x380a4a['query'][_0xf1ce('0x40')]){_0x31b432['include']=[{'all':!![]}];}_0x31b432=_['merge']({},_0x31b432,_0x380a4a[_0xf1ce('0x46')]);return db[_0xf1ce('0x3f')]['find'](_0x31b432)['then'](handleEntityNotFound(_0x5c058f,null))[_0xf1ce('0x28')](respondWithResult(_0x5c058f,null))[_0xf1ce('0x43')](handleError(_0x5c058f,null));};exports[_0xf1ce('0x47')]=function(_0x5d3fea,_0x465692){return db['JscriptySessionReport'][_0xf1ce('0x47')](_0x5d3fea['body'],{})['then'](respondWithResult(_0x465692,0xc9))[_0xf1ce('0x43')](handleError(_0x465692,null));};exports[_0xf1ce('0x27')]=function(_0x1e0189,_0x2a0a7c){if(_0x1e0189[_0xf1ce('0x48')]['id']){delete _0x1e0189['body']['id'];}return db['JscriptySessionReport'][_0xf1ce('0x49')]({'where':{'id':_0x1e0189[_0xf1ce('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a0a7c,null))['then'](saveUpdates(_0x1e0189['body'],null))[_0xf1ce('0x28')](respondWithResult(_0x2a0a7c,null))['catch'](handleError(_0x2a0a7c,null));};exports[_0xf1ce('0x29')]=function(_0x2f3efa,_0x478a06){return db[_0xf1ce('0x3f')][_0xf1ce('0x49')]({'where':{'id':_0x2f3efa[_0xf1ce('0x44')]['id']}})['then'](handleEntityNotFound(_0x478a06,null))['then'](removeEntity(_0x478a06,null))[_0xf1ce('0x43')](handleError(_0x478a06,null));};exports['describe']=function(_0x460286,_0x135a9b){return db[_0xf1ce('0x3f')]['describe']()[_0xf1ce('0x28')](respondWithResult(_0x135a9b,null))['catch'](handleError(_0x135a9b,null));};exports['getQuestions']=function(_0x53462f,_0x28421a,_0x9d40f0){var _0x308745={'raw':!![],'where':{}};var _0x3cfc1c={};var _0x128114={'count':0x0,'rows':[]};return db[_0xf1ce('0x3f')][_0xf1ce('0x4a')]({'where':{'id':_0x53462f['params']['id']}})[_0xf1ce('0x28')](handleEntityNotFound(_0x28421a,null))[_0xf1ce('0x28')](function(_0x5d8a43){if(_0x5d8a43){_0x3cfc1c[_0xf1ce('0x36')]=_[_0xf1ce('0x32')](db[_0xf1ce('0x4b')][_0xf1ce('0x2f')]);_0x3cfc1c[_0xf1ce('0x31')]=_['keys'](_0x53462f[_0xf1ce('0x31')]);_0x3cfc1c[_0xf1ce('0x33')]=_['intersection'](_0x3cfc1c[_0xf1ce('0x36')],_0x3cfc1c['query']);_0x308745[_0xf1ce('0x35')]=_['intersection'](_0x3cfc1c[_0xf1ce('0x36')],qs[_0xf1ce('0x37')](_0x53462f[_0xf1ce('0x31')]['fields']));_0x308745[_0xf1ce('0x35')]=_0x308745[_0xf1ce('0x35')][_0xf1ce('0x45')]?_0x308745['attributes']:_0x3cfc1c[_0xf1ce('0x36')];if(!_0x53462f[_0xf1ce('0x31')][_0xf1ce('0x4c')](_0xf1ce('0x38'))){_0x308745[_0xf1ce('0x23')]=qs[_0xf1ce('0x23')](_0x53462f['query'][_0xf1ce('0x23')]);_0x308745[_0xf1ce('0x20')]=qs[_0xf1ce('0x20')](_0x53462f[_0xf1ce('0x31')]['offset']);}_0x308745[_0xf1ce('0x39')]=qs[_0xf1ce('0x3a')](_0x53462f[_0xf1ce('0x31')]['sort']);_0x308745[_0xf1ce('0x3b')]=qs['filters'](_[_0xf1ce('0x3c')](_0x53462f[_0xf1ce('0x31')],_0x3cfc1c[_0xf1ce('0x33')]));_0x308745[_0xf1ce('0x3b')][_0xf1ce('0x4d')]=_0x5d8a43['id'];if(_0x53462f['query'][_0xf1ce('0x3d')]){_0x308745[_0xf1ce('0x3b')]=_[_0xf1ce('0x3e')](_0x308745[_0xf1ce('0x3b')],{'$or':_['map'](_0x308745['attributes'],function(_0x25ae2b){var _0x38ae33={};_0x38ae33[_0x25ae2b]={'$like':'%'+_0x53462f[_0xf1ce('0x31')][_0xf1ce('0x3d')]+'%'};return _0x38ae33;})});}_0x308745=_[_0xf1ce('0x3e')]({},_0x308745,_0x53462f[_0xf1ce('0x46')]);return db[_0xf1ce('0x4b')][_0xf1ce('0x22')]({'where':_0x308745[_0xf1ce('0x3b')]})[_0xf1ce('0x28')](function(_0x5791d2){_0x128114[_0xf1ce('0x22')]=_0x5791d2;if(_0x53462f['query'][_0xf1ce('0x40')]){_0x308745[_0xf1ce('0x41')]=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xf1ce('0x4e')](_0x308745);})[_0xf1ce('0x28')](function(_0x5ed132){_0x128114['rows']=_0x5ed132;return _0x128114;});}})['then'](respondWithFilteredResult(_0x28421a,_0x308745))[_0xf1ce('0x43')](handleError(_0x28421a,null));}; \ No newline at end of file +var _0x89d6=['to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','apply','update','then','destroy','end','stack','name','send','index','JscriptySessionReport','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','length','find','create','body','describe','getQuestions','findOne','SessionId','includeAll','JscriptyQuestionReport','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox'];(function(_0x2e2568,_0x3f4818){var _0x58c455=function(_0x272a58){while(--_0x272a58){_0x2e2568['push'](_0x2e2568['shift']());}};_0x58c455(++_0x3f4818);}(_0x89d6,0x1de));var _0x689d=function(_0x47d2d8,_0x4aed38){_0x47d2d8=_0x47d2d8-0x0;var _0x1dabe5=_0x89d6[_0x47d2d8];return _0x1dabe5;};'use strict';var emlformat=require(_0x689d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x689d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x689d('0x2'));var moment=require(_0x689d('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x689d('0x4'));var util=require(_0x689d('0x5'));var path=require(_0x689d('0x6'));var sox=require(_0x689d('0x7'));var csv=require(_0x689d('0x8'));var ejs=require(_0x689d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x689d('0xa'));var squel=require(_0x689d('0xb'));var crypto=require('crypto');var jsforce=require(_0x689d('0xc'));var deskjs=require(_0x689d('0xd'));var toCsv=require(_0x689d('0x8'));var querystring=require(_0x689d('0xe'));var Papa=require(_0x689d('0xf'));var Redis=require(_0x689d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x689d('0x11'));var as=require(_0x689d('0x12'));var hardwareService=require(_0x689d('0x13'));var logger=require(_0x689d('0x14'))('api');var utils=require(_0x689d('0x15'));var config=require(_0x689d('0x16'));var licenseUtil=require(_0x689d('0x17'));var db=require(_0x689d('0x18'))['db'];function respondWithStatusCode(_0x1ba6cd,_0x42c475){_0x42c475=_0x42c475||0xcc;return function(_0x197eb2){if(_0x197eb2){return _0x1ba6cd[_0x689d('0x19')](_0x42c475);}return _0x1ba6cd[_0x689d('0x1a')](_0x42c475)['end']();};}function respondWithResult(_0x20bfed,_0xb305c5){_0xb305c5=_0xb305c5||0xc8;return function(_0x2ccc55){if(_0x2ccc55){return _0x20bfed[_0x689d('0x1a')](_0xb305c5)['json'](_0x2ccc55);}};}function respondWithFilteredResult(_0x45ccfb,_0x1f5211){return function(_0x232876){if(_0x232876){var _0x29d8c0=typeof _0x1f5211['offset']==='undefined'&&typeof _0x1f5211[_0x689d('0x1b')]===_0x689d('0x1c');var _0x5830c3=_0x232876[_0x689d('0x1d')];var _0x362366=_0x29d8c0?0x0:_0x1f5211[_0x689d('0x1e')];var _0x141300=_0x29d8c0?_0x232876[_0x689d('0x1d')]:_0x1f5211['offset']+_0x1f5211[_0x689d('0x1b')];var _0x3dc4de;if(_0x141300>=_0x5830c3){_0x141300=_0x5830c3;_0x3dc4de=0xc8;}else{_0x3dc4de=0xce;}_0x45ccfb[_0x689d('0x1a')](_0x3dc4de);return _0x45ccfb[_0x689d('0x1f')](_0x689d('0x20'),_0x362366+'-'+_0x141300+'/'+_0x5830c3)[_0x689d('0x21')](_0x232876);}return null;};}function patchUpdates(_0x36fc4b){return function(_0x1fa788){try{jsonpatch[_0x689d('0x22')](_0x1fa788,_0x36fc4b,!![]);}catch(_0x3f18cf){return BPromise['reject'](_0x3f18cf);}return _0x1fa788['save']();};}function saveUpdates(_0x122105,_0x464101){return function(_0x180da3){if(_0x180da3){return _0x180da3[_0x689d('0x23')](_0x122105)[_0x689d('0x24')](function(_0x3b56f2){return _0x3b56f2;});}return null;};}function removeEntity(_0x3063ec,_0x338a47){return function(_0x5277b9){if(_0x5277b9){return _0x5277b9[_0x689d('0x25')]()[_0x689d('0x24')](function(){_0x3063ec[_0x689d('0x1a')](0xcc)[_0x689d('0x26')]();});}};}function handleEntityNotFound(_0x29bee0,_0x2f58da){return function(_0x1a0418){if(!_0x1a0418){_0x29bee0[_0x689d('0x19')](0x194);}return _0x1a0418;};}function handleError(_0x4126c4,_0x22467a){_0x22467a=_0x22467a||0x1f4;return function(_0x6d9daa){logger['error'](_0x6d9daa[_0x689d('0x27')]);if(_0x6d9daa['name']){delete _0x6d9daa[_0x689d('0x28')];}_0x4126c4['status'](_0x22467a)[_0x689d('0x29')](_0x6d9daa);};}exports[_0x689d('0x2a')]=function(_0x5eff41,_0x345212){var _0x57ecff={},_0x42b092={},_0x944481={'count':0x0,'rows':[]};var _0x5c52b2=_['map'](db[_0x689d('0x2b')][_0x689d('0x2c')],function(_0x21b2c5){return{'name':_0x21b2c5[_0x689d('0x2d')],'type':_0x21b2c5[_0x689d('0x2e')][_0x689d('0x2f')]};});_0x42b092[_0x689d('0x30')]=_[_0x689d('0x31')](_0x5c52b2,_0x689d('0x28'));_0x42b092['query']=_[_0x689d('0x32')](_0x5eff41[_0x689d('0x33')]);_0x42b092['filters']=_[_0x689d('0x34')](_0x42b092[_0x689d('0x30')],_0x42b092[_0x689d('0x33')]);_0x57ecff[_0x689d('0x35')]=_[_0x689d('0x34')](_0x42b092[_0x689d('0x30')],qs['fields'](_0x5eff41[_0x689d('0x33')][_0x689d('0x36')]));_0x57ecff[_0x689d('0x35')]=_0x57ecff[_0x689d('0x35')]['length']?_0x57ecff[_0x689d('0x35')]:_0x42b092[_0x689d('0x30')];if(!_0x5eff41[_0x689d('0x33')][_0x689d('0x37')]('nolimit')){_0x57ecff[_0x689d('0x1b')]=qs[_0x689d('0x1b')](_0x5eff41[_0x689d('0x33')][_0x689d('0x1b')]);_0x57ecff[_0x689d('0x1e')]=qs['offset'](_0x5eff41['query'][_0x689d('0x1e')]);}_0x57ecff[_0x689d('0x38')]=qs[_0x689d('0x39')](_0x5eff41[_0x689d('0x33')][_0x689d('0x39')]);_0x57ecff['where']=qs[_0x689d('0x3a')](_[_0x689d('0x3b')](_0x5eff41[_0x689d('0x33')],_0x42b092[_0x689d('0x3a')]),_0x5c52b2);if(_0x5eff41[_0x689d('0x33')]['filter']){_0x57ecff[_0x689d('0x3c')]=_[_0x689d('0x3d')](_0x57ecff['where'],{'$or':_[_0x689d('0x31')](_0x5c52b2,function(_0xdd1e10){if(_0xdd1e10['type']!==_0x689d('0x3e')){var _0x2ea7d6={};_0x2ea7d6[_0xdd1e10[_0x689d('0x28')]]={'$like':'%'+_0x5eff41[_0x689d('0x33')][_0x689d('0x3f')]+'%'};return _0x2ea7d6;}})});}_0x57ecff=_[_0x689d('0x3d')]({},_0x57ecff,_0x5eff41[_0x689d('0x40')]);var _0x25893e={'where':_0x57ecff[_0x689d('0x3c')]};return db['JscriptySessionReport']['count'](_0x25893e)['then'](function(_0xaf5982){_0x944481[_0x689d('0x1d')]=_0xaf5982;if(_0x5eff41['query']['includeAll']){_0x57ecff[_0x689d('0x41')]=[{'all':!![]}];}return db[_0x689d('0x2b')][_0x689d('0x42')](_0x57ecff);})[_0x689d('0x24')](function(_0x110bd8){_0x944481[_0x689d('0x43')]=_0x110bd8;return _0x944481;})['then'](respondWithFilteredResult(_0x345212,_0x57ecff))[_0x689d('0x44')](handleError(_0x345212,null));};exports[_0x689d('0x45')]=function(_0x957bea,_0x4d027e){var _0x315586={'raw':!![],'where':{'id':_0x957bea[_0x689d('0x46')]['id']}},_0x2dfc42={};_0x2dfc42[_0x689d('0x30')]=_[_0x689d('0x32')](db[_0x689d('0x2b')][_0x689d('0x2c')]);_0x2dfc42[_0x689d('0x33')]=_[_0x689d('0x32')](_0x957bea[_0x689d('0x33')]);_0x2dfc42['filters']=_['intersection'](_0x2dfc42['model'],_0x2dfc42[_0x689d('0x33')]);_0x315586[_0x689d('0x35')]=_[_0x689d('0x34')](_0x2dfc42[_0x689d('0x30')],qs['fields'](_0x957bea[_0x689d('0x33')]['fields']));_0x315586[_0x689d('0x35')]=_0x315586['attributes'][_0x689d('0x47')]?_0x315586[_0x689d('0x35')]:_0x2dfc42[_0x689d('0x30')];if(_0x957bea['query']['includeAll']){_0x315586[_0x689d('0x41')]=[{'all':!![]}];}_0x315586=_[_0x689d('0x3d')]({},_0x315586,_0x957bea['options']);return db[_0x689d('0x2b')][_0x689d('0x48')](_0x315586)[_0x689d('0x24')](handleEntityNotFound(_0x4d027e,null))['then'](respondWithResult(_0x4d027e,null))[_0x689d('0x44')](handleError(_0x4d027e,null));};exports[_0x689d('0x49')]=function(_0x3a64c4,_0x41a833){return db['JscriptySessionReport']['create'](_0x3a64c4['body'],{})[_0x689d('0x24')](respondWithResult(_0x41a833,0xc9))[_0x689d('0x44')](handleError(_0x41a833,null));};exports[_0x689d('0x23')]=function(_0x490b4e,_0x45e77c){if(_0x490b4e['body']['id']){delete _0x490b4e['body']['id'];}return db[_0x689d('0x2b')]['find']({'where':{'id':_0x490b4e['params']['id']}})[_0x689d('0x24')](handleEntityNotFound(_0x45e77c,null))[_0x689d('0x24')](saveUpdates(_0x490b4e[_0x689d('0x4a')],null))[_0x689d('0x24')](respondWithResult(_0x45e77c,null))[_0x689d('0x44')](handleError(_0x45e77c,null));};exports[_0x689d('0x25')]=function(_0x40368a,_0x1749fe){return db['JscriptySessionReport'][_0x689d('0x48')]({'where':{'id':_0x40368a[_0x689d('0x46')]['id']}})[_0x689d('0x24')](handleEntityNotFound(_0x1749fe,null))[_0x689d('0x24')](removeEntity(_0x1749fe,null))['catch'](handleError(_0x1749fe,null));};exports['describe']=function(_0x8d8752,_0x2b0f54){return db[_0x689d('0x2b')][_0x689d('0x4b')]()[_0x689d('0x24')](respondWithResult(_0x2b0f54,null))[_0x689d('0x44')](handleError(_0x2b0f54,null));};exports[_0x689d('0x4c')]=function(_0x3e10cf,_0x5e6e9c,_0x44d79e){var _0x2e657e={'raw':!![],'where':{}};var _0x5771bf={};var _0x3e7f82={'count':0x0,'rows':[]};return db[_0x689d('0x2b')][_0x689d('0x4d')]({'where':{'id':_0x3e10cf['params']['id']}})[_0x689d('0x24')](handleEntityNotFound(_0x5e6e9c,null))[_0x689d('0x24')](function(_0x28662f){if(_0x28662f){_0x5771bf[_0x689d('0x30')]=_[_0x689d('0x32')](db['JscriptyQuestionReport'][_0x689d('0x2c')]);_0x5771bf[_0x689d('0x33')]=_[_0x689d('0x32')](_0x3e10cf[_0x689d('0x33')]);_0x5771bf[_0x689d('0x3a')]=_[_0x689d('0x34')](_0x5771bf['model'],_0x5771bf[_0x689d('0x33')]);_0x2e657e[_0x689d('0x35')]=_[_0x689d('0x34')](_0x5771bf[_0x689d('0x30')],qs[_0x689d('0x36')](_0x3e10cf['query']['fields']));_0x2e657e['attributes']=_0x2e657e[_0x689d('0x35')][_0x689d('0x47')]?_0x2e657e['attributes']:_0x5771bf[_0x689d('0x30')];if(!_0x3e10cf[_0x689d('0x33')]['hasOwnProperty']('nolimit')){_0x2e657e[_0x689d('0x1b')]=qs[_0x689d('0x1b')](_0x3e10cf[_0x689d('0x33')][_0x689d('0x1b')]);_0x2e657e[_0x689d('0x1e')]=qs[_0x689d('0x1e')](_0x3e10cf[_0x689d('0x33')][_0x689d('0x1e')]);}_0x2e657e[_0x689d('0x38')]=qs[_0x689d('0x39')](_0x3e10cf['query'][_0x689d('0x39')]);_0x2e657e[_0x689d('0x3c')]=qs[_0x689d('0x3a')](_[_0x689d('0x3b')](_0x3e10cf[_0x689d('0x33')],_0x5771bf[_0x689d('0x3a')]));_0x2e657e[_0x689d('0x3c')][_0x689d('0x4e')]=_0x28662f['id'];if(_0x3e10cf[_0x689d('0x33')][_0x689d('0x3f')]){_0x2e657e[_0x689d('0x3c')]=_[_0x689d('0x3d')](_0x2e657e['where'],{'$or':_[_0x689d('0x31')](_0x2e657e[_0x689d('0x35')],function(_0x529851){var _0x4e9350={};_0x4e9350[_0x529851]={'$like':'%'+_0x3e10cf['query'][_0x689d('0x3f')]+'%'};return _0x4e9350;})});}_0x2e657e=_[_0x689d('0x3d')]({},_0x2e657e,_0x3e10cf['options']);return db['JscriptyQuestionReport']['count']({'where':_0x2e657e[_0x689d('0x3c')]})[_0x689d('0x24')](function(_0x119d70){_0x3e7f82[_0x689d('0x1d')]=_0x119d70;if(_0x3e10cf[_0x689d('0x33')][_0x689d('0x4f')]){_0x2e657e[_0x689d('0x41')]=[{'all':!![]}];}return db[_0x689d('0x50')][_0x689d('0x42')](_0x2e657e);})[_0x689d('0x24')](function(_0x5c486d){_0x3e7f82[_0x689d('0x43')]=_0x5c486d;return _0x3e7f82;});}})[_0x689d('0x24')](respondWithFilteredResult(_0x5e6e9c,_0x2e657e))[_0x689d('0x44')](handleError(_0x5e6e9c,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 02333cf..54e3bdd 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 _0x5d17=['lodash','util','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x16f37d,_0x52b81b){var _0x36d50d=function(_0x144cac){while(--_0x144cac){_0x16f37d['push'](_0x16f37d['shift']());}};_0x36d50d(++_0x52b81b);}(_0x5d17,0x114));var _0x75d1=function(_0x23ca4d,_0x5c2a32){_0x23ca4d=_0x23ca4d-0x0;var _0x435432=_0x5d17[_0x23ca4d];return _0x435432;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x75d1('0x2'));var BPromise=require(_0x75d1('0x3'));var rp=require(_0x75d1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x75d1('0x5'));var config=require(_0x75d1('0x6'));var attributes=require(_0x75d1('0x7'));module[_0x75d1('0x8')]=function(_0x56ac0a,_0x458681){return _0x56ac0a[_0x75d1('0x9')](_0x75d1('0xa'),attributes,{'tableName':_0x75d1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2eb2=['moment','bluebird','request-promise','rimraf','exports','define','JscriptySessionReport','report_jscripty_sessions','util','../../config/logger','api'];(function(_0xf89304,_0x5b65a7){var _0x50298f=function(_0x1b95c6){while(--_0x1b95c6){_0xf89304['push'](_0xf89304['shift']());}};_0x50298f(++_0x5b65a7);}(_0x2eb2,0x19f));var _0x22eb=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x2eb2[_0x110c3d];return _0x226d67;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var logger=require(_0x22eb('0x1'))(_0x22eb('0x2'));var moment=require(_0x22eb('0x3'));var BPromise=require(_0x22eb('0x4'));var rp=require(_0x22eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22eb('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptySessionReport.attributes');module[_0x22eb('0x7')]=function(_0x10e116,_0x35dd5b){return _0x10e116[_0x22eb('0x8')](_0x22eb('0x9'),attributes,{'tableName':_0x22eb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 1a87dc8..6daa8e5 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 _0x7ee1=['request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptySessionReport,\x20%s,\x20%s','message','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x505439,_0x5a4a50){var _0x54267a=function(_0x5e635f){while(--_0x5e635f){_0x505439['push'](_0x505439['shift']());}};_0x54267a(++_0x5a4a50);}(_0x7ee1,0x8d));var _0x17ee=function(_0x12db7b,_0x3f710e){_0x12db7b=_0x12db7b-0x0;var _0x1df082=_0x7ee1[_0x12db7b];return _0x1df082;};'use strict';var _=require(_0x17ee('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x17ee('0x1'));var fs=require('fs');var Redis=require(_0x17ee('0x2'));var db=require(_0x17ee('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x17ee('0x4'))(_0x17ee('0x5'));var config=require(_0x17ee('0x6'));var jayson=require(_0x17ee('0x7'));var client=jayson['client'][_0x17ee('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29b9eb,_0x54b4f6,_0x3f61af){return new BPromise(function(_0x57e1d1,_0x3d767b){return client[_0x17ee('0x9')](_0x29b9eb,_0x3f61af)[_0x17ee('0xa')](function(_0x4af369){logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x54b4f6,_0x17ee('0xb'));logger['debug'](_0x17ee('0xc'),_0x54b4f6,_0x17ee('0xb'),JSON[_0x17ee('0xd')](_0x4af369));if(_0x4af369[_0x17ee('0xe')]){if(_0x4af369['error'][_0x17ee('0xf')]===0x1f4){logger['error'](_0x17ee('0x10'),_0x54b4f6,_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);return _0x3d767b(_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);}logger[_0x17ee('0xe')](_0x17ee('0x10'),_0x54b4f6,_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);return _0x57e1d1(_0x4af369[_0x17ee('0xe')][_0x17ee('0x11')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x54b4f6,'request\x20sent');_0x57e1d1(_0x4af369['result'][_0x17ee('0x11')]);}})[_0x17ee('0x12')](function(_0x1b87c3){logger[_0x17ee('0xe')](_0x17ee('0x10'),_0x54b4f6,_0x1b87c3);_0x3d767b(_0x1b87c3);});});} \ No newline at end of file +var _0x896e=['JscriptySessionReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x48f1db,_0x554c57){var _0x27de48=function(_0x3cd347){while(--_0x3cd347){_0x48f1db['push'](_0x48f1db['shift']());}};_0x27de48(++_0x554c57);}(_0x896e,0x1e9));var _0xe896=function(_0xd6382e,_0x3823fe){_0xd6382e=_0xd6382e-0x0;var _0x361f37=_0x896e[_0xd6382e];return _0x361f37;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var moment=require(_0xe896('0x2'));var BPromise=require(_0xe896('0x3'));var rs=require(_0xe896('0x4'));var fs=require('fs');var Redis=require(_0xe896('0x5'));var db=require(_0xe896('0x6'))['db'];var utils=require(_0xe896('0x7'));var logger=require(_0xe896('0x8'))(_0xe896('0x9'));var config=require(_0xe896('0xa'));var jayson=require(_0xe896('0xb'));var client=jayson['client'][_0xe896('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7a0721,_0x3b902c,_0x264eeb){return new BPromise(function(_0x43c619,_0x5a1909){return client[_0xe896('0xd')](_0x7a0721,_0x264eeb)[_0xe896('0xe')](function(_0x37a90d){logger['info'](_0xe896('0xf'),_0x3b902c,'request\x20sent');logger[_0xe896('0x10')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x3b902c,_0xe896('0x11'),JSON[_0xe896('0x12')](_0x37a90d));if(_0x37a90d[_0xe896('0x13')]){if(_0x37a90d['error'][_0xe896('0x14')]===0x1f4){logger[_0xe896('0x13')](_0xe896('0xf'),_0x3b902c,_0x37a90d['error'][_0xe896('0x15')]);return _0x5a1909(_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);}logger['error'](_0xe896('0xf'),_0x3b902c,_0x37a90d[_0xe896('0x13')][_0xe896('0x15')]);return _0x43c619(_0x37a90d['error']['message']);}else{logger[_0xe896('0x16')](_0xe896('0xf'),_0x3b902c,'request\x20sent');_0x43c619(_0x37a90d['result'][_0xe896('0x15')]);}})[_0xe896('0x17')](function(_0x57f04b){logger[_0xe896('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x3b902c,_0x57f04b);_0x5a1909(_0x57f04b);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index f8f3a33..b91da36 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 _0x0951=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./license.controller','get','put','/:id','update','/download_log_file','isAuthenticated','downloadLogFile'];(function(_0x232190,_0x5cdabd){var _0x31d160=function(_0x34d20d){while(--_0x34d20d){_0x232190['push'](_0x232190['shift']());}};_0x31d160(++_0x5cdabd);}(_0x0951,0x1bb));var _0x1095=function(_0x205085,_0x1492cf){_0x205085=_0x205085-0x0;var _0x131b01=_0x0951[_0x205085];return _0x131b01;};'use strict';var multer=require(_0x1095('0x0'));var util=require('util');var path=require(_0x1095('0x1'));var timeout=require(_0x1095('0x2'));var express=require(_0x1095('0x3'));var router=express[_0x1095('0x4')]();var fs_extra=require(_0x1095('0x5'));var auth=require(_0x1095('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1095('0x7'));var controller=require(_0x1095('0x8'));router[_0x1095('0x9')]('/',controller['index']);router[_0x1095('0xa')](_0x1095('0xb'),auth['isAuthenticated'](),controller[_0x1095('0xc')]);router[_0x1095('0x9')](_0x1095('0xd'),auth[_0x1095('0xe')](),controller[_0x1095('0xf')]);module[_0x1095('0x10')]=router; \ No newline at end of file +var _0xd7d6=['/:id','isAuthenticated','update','downloadLogFile','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./license.controller','get'];(function(_0x3b0e74,_0x295ca1){var _0x2ebdc1=function(_0x4cd489){while(--_0x4cd489){_0x3b0e74['push'](_0x3b0e74['shift']());}};_0x2ebdc1(++_0x295ca1);}(_0xd7d6,0x83));var _0x6d7d=function(_0x20aadb,_0x5a607a){_0x20aadb=_0x20aadb-0x0;var _0x520018=_0xd7d6[_0x20aadb];return _0x520018;};'use strict';var multer=require('multer');var util=require(_0x6d7d('0x0'));var path=require(_0x6d7d('0x1'));var timeout=require(_0x6d7d('0x2'));var express=require(_0x6d7d('0x3'));var router=express[_0x6d7d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6d7d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6d7d('0x6'));var controller=require(_0x6d7d('0x7'));router[_0x6d7d('0x8')]('/',controller['index']);router['put'](_0x6d7d('0x9'),auth[_0x6d7d('0xa')](),controller[_0x6d7d('0xb')]);router[_0x6d7d('0x8')]('/download_log_file',auth[_0x6d7d('0xa')](),controller[_0x6d7d('0xc')]);module[_0x6d7d('0xd')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index b1ca3ae..9f59dbf 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 _0x1c3f=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x4fd9be,_0x3df4e8){var _0xe57499=function(_0x3b0a23){while(--_0x3b0a23){_0x4fd9be['push'](_0x4fd9be['shift']());}};_0xe57499(++_0x3df4e8);}(_0x1c3f,0x13a));var _0xf1c3=function(_0x2426c8,_0x9668d3){_0x2426c8=_0x2426c8-0x0;var _0x56f51e=_0x1c3f[_0x2426c8];return _0x56f51e;};'use strict';var Sequelize=require(_0xf1c3('0x0'));module[_0xf1c3('0x1')]={'license':{'type':Sequelize[_0xf1c3('0x2')]},'data1':{'type':Sequelize[_0xf1c3('0x3')]},'data2':{'type':Sequelize[_0xf1c3('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xf1c3('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb041=['sequelize','exports','TEXT','STRING','INTEGER'];(function(_0x1c1b4d,_0x1dc649){var _0x1bbe55=function(_0x2f617a){while(--_0x2f617a){_0x1c1b4d['push'](_0x1c1b4d['shift']());}};_0x1bbe55(++_0x1dc649);}(_0xb041,0xe6));var _0x1b04=function(_0x43778d,_0x5f37a9){_0x43778d=_0x43778d-0x0;var _0x49312a=_0xb041[_0x43778d];return _0x49312a;};'use strict';var Sequelize=require(_0x1b04('0x0'));module[_0x1b04('0x1')]={'license':{'type':Sequelize[_0x1b04('0x2')]},'data1':{'type':Sequelize[_0x1b04('0x3')]},'data2':{'type':Sequelize[_0x1b04('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0x1b04('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index c6c3074..8162669 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 _0x57b6=['set','save','update','destroy','then','stack','name','send','index','keys','License','rawAttributes','query','filters','intersection','model','attributes','merge','body','find','params','get','key','catch','license-info.log','join','/var','log','xcally','setHeader','Content-disposition','attachment;\x20filename=','Content-Type','text/plain','download','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','end','json','offset','undefined','limit','count','status'];(function(_0xaf7ed1,_0xd5813c){var _0x39ee1f=function(_0x505ef0){while(--_0x505ef0){_0xaf7ed1['push'](_0xaf7ed1['shift']());}};_0x39ee1f(++_0xd5813c);}(_0x57b6,0xdd));var _0x657b=function(_0x488bae,_0x30caf7){_0x488bae=_0x488bae-0x0;var _0x5ce921=_0x57b6[_0x488bae];return _0x5ce921;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x657b('0x0'));var zipdir=require(_0x657b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x657b('0x2'));var moment=require('moment');var BPromise=require(_0x657b('0x3'));var Mustache=require(_0x657b('0x4'));var util=require('util');var path=require(_0x657b('0x5'));var sox=require(_0x657b('0x6'));var csv=require(_0x657b('0x7'));var ejs=require(_0x657b('0x8'));var fs=require('fs');var fs_extra=require(_0x657b('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x657b('0xa'));var deskjs=require(_0x657b('0xb'));var toCsv=require(_0x657b('0x7'));var querystring=require(_0x657b('0xc'));var Papa=require(_0x657b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x657b('0xe'));var as=require(_0x657b('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x657b('0x10'));var utils=require(_0x657b('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x657b('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3eed05,_0x19edaf){_0x19edaf=_0x19edaf||0xcc;return function(_0x2b6035){if(_0x2b6035){return _0x3eed05[_0x657b('0x13')](_0x19edaf);}return _0x3eed05['status'](_0x19edaf)[_0x657b('0x14')]();};}function respondWithResult(_0x299ef1,_0xf9dd39){_0xf9dd39=_0xf9dd39||0xc8;return function(_0x944206){if(_0x944206){return _0x299ef1['status'](_0xf9dd39)[_0x657b('0x15')](_0x944206);}};}function respondWithFilteredResult(_0x435f1c,_0x550128){return function(_0x3ad556){if(_0x3ad556){var _0x2390ae=typeof _0x550128[_0x657b('0x16')]===_0x657b('0x17')&&typeof _0x550128[_0x657b('0x18')]===_0x657b('0x17');var _0xea9c92=_0x3ad556[_0x657b('0x19')];var _0x168647=_0x2390ae?0x0:_0x550128['offset'];var _0x4d1e60=_0x2390ae?_0x3ad556[_0x657b('0x19')]:_0x550128[_0x657b('0x16')]+_0x550128[_0x657b('0x18')];var _0x30502b;if(_0x4d1e60>=_0xea9c92){_0x4d1e60=_0xea9c92;_0x30502b=0xc8;}else{_0x30502b=0xce;}_0x435f1c[_0x657b('0x1a')](_0x30502b);return _0x435f1c[_0x657b('0x1b')]('Content-Range',_0x168647+'-'+_0x4d1e60+'/'+_0xea9c92)[_0x657b('0x15')](_0x3ad556);}return null;};}function patchUpdates(_0x40853b){return function(_0x3f0420){try{jsonpatch['apply'](_0x3f0420,_0x40853b,!![]);}catch(_0x3039b5){return BPromise['reject'](_0x3039b5);}return _0x3f0420[_0x657b('0x1c')]();};}function saveUpdates(_0x50ea86,_0x51f018){return function(_0x5f051f){if(_0x5f051f){return _0x5f051f[_0x657b('0x1d')](_0x50ea86)['then'](function(_0x3e3e6){return _0x3e3e6;});}return null;};}function removeEntity(_0x28215b,_0x328b07){return function(_0x563c74){if(_0x563c74){return _0x563c74[_0x657b('0x1e')]()[_0x657b('0x1f')](function(){_0x28215b[_0x657b('0x1a')](0xcc)[_0x657b('0x14')]();});}};}function handleEntityNotFound(_0x158ba6,_0xc2ddae){return function(_0x221eed){if(!_0x221eed){_0x158ba6[_0x657b('0x13')](0x194);}return _0x221eed;};}function handleError(_0x4e9ae9,_0xe4fd23){_0xe4fd23=_0xe4fd23||0x1f4;return function(_0x1d71fa){logger['error'](_0x1d71fa[_0x657b('0x20')]);if(_0x1d71fa[_0x657b('0x21')]){delete _0x1d71fa[_0x657b('0x21')];}_0x4e9ae9['status'](_0xe4fd23)[_0x657b('0x22')](_0x1d71fa);};}var utilLicense=require(_0x657b('0x12'));exports[_0x657b('0x23')]=function(_0x41cbb1,_0x4fb069){var _0x4d6b69={'raw':!![],'where':{'id':0x1}},_0x5a605d={};_0x5a605d['model']=_[_0x657b('0x24')](db[_0x657b('0x25')][_0x657b('0x26')]);_0x5a605d[_0x657b('0x27')]=_[_0x657b('0x24')](_0x41cbb1[_0x657b('0x27')]);_0x5a605d[_0x657b('0x28')]=_[_0x657b('0x29')](_0x5a605d[_0x657b('0x2a')],_0x5a605d[_0x657b('0x27')]);_0x4d6b69[_0x657b('0x2b')]=_[_0x657b('0x29')](_0x5a605d[_0x657b('0x2a')],qs['fields'](_0x41cbb1[_0x657b('0x27')]['fields']));_0x4d6b69['attributes']=_0x4d6b69[_0x657b('0x2b')]['length']?_0x4d6b69[_0x657b('0x2b')]:_0x5a605d[_0x657b('0x2a')];_0x4d6b69=_[_0x657b('0x2c')]({},_0x4d6b69,_0x41cbb1['options']);return utilLicense['getLicense'](_0x4d6b69)[_0x657b('0x1f')](respondWithResult(_0x4fb069,null))['catch'](handleError(_0x4fb069,null));};exports[_0x657b('0x1d')]=function(_0x33d93b,_0x403f34){if(_0x33d93b[_0x657b('0x2d')]['id']){delete _0x33d93b[_0x657b('0x2d')]['id'];}return db['License'][_0x657b('0x2e')]({'where':{'id':_0x33d93b[_0x657b('0x2f')]['id']}})[_0x657b('0x1f')](handleEntityNotFound(_0x403f34,null))['then'](function(_0x585e1a){var _0x25003e=_0x585e1a[_0x657b('0x30')]({'plain':!![]});return utilLicense['checkLicense'](_0x25003e,_0x33d93b[_0x657b('0x2d')][_0x657b('0x31')]);})[_0x657b('0x1f')](function(_0x5afcda){if(!_0x5afcda['demo']){return saveUpdates(_0x33d93b[_0x657b('0x2d')],null);}return _0x5afcda;})[_0x657b('0x1f')](respondWithResult(_0x403f34,null))[_0x657b('0x32')](handleError(_0x403f34,null));};exports['downloadLogFile']=function(_0x29c003,_0x27bc50){var _0x325ac5=_0x657b('0x33');var _0x17e852=path[_0x657b('0x34')](_0x657b('0x35'),_0x657b('0x36'),_0x657b('0x37'),_0x325ac5);_0x27bc50[_0x657b('0x38')](_0x657b('0x39'),_0x657b('0x3a')+_0x325ac5);_0x27bc50[_0x657b('0x1b')](_0x657b('0x3b'),_0x657b('0x3c'));_0x27bc50[_0x657b('0x3d')](_0x17e852);}; \ No newline at end of file +var _0x6ab2=['params','get','key','demo','catch','join','/var','log','xcally','setHeader','attachment;\x20filename=','Content-Type','text/plain','eml-format','fast-json-patch','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','error','stack','name','model','keys','License','rawAttributes','query','intersection','attributes','length','getLicense','body','find'];(function(_0x4dc935,_0x205fa6){var _0x518b0e=function(_0x47572b){while(--_0x47572b){_0x4dc935['push'](_0x4dc935['shift']());}};_0x518b0e(++_0x205fa6);}(_0x6ab2,0x193));var _0x26ab=function(_0x5d923b,_0x3b7834){_0x5d923b=_0x5d923b-0x0;var _0x50ff88=_0x6ab2[_0x5d923b];return _0x50ff88;};'use strict';var emlformat=require(_0x26ab('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x26ab('0x1'));var rp=require('request-promise');var moment=require(_0x26ab('0x2'));var BPromise=require(_0x26ab('0x3'));var Mustache=require('mustache');var util=require(_0x26ab('0x4'));var path=require(_0x26ab('0x5'));var sox=require(_0x26ab('0x6'));var csv=require('to-csv');var ejs=require(_0x26ab('0x7'));var fs=require('fs');var fs_extra=require(_0x26ab('0x8'));var _=require(_0x26ab('0x9'));var squel=require('squel');var crypto=require(_0x26ab('0xa'));var jsforce=require(_0x26ab('0xb'));var deskjs=require(_0x26ab('0xc'));var toCsv=require(_0x26ab('0xd'));var querystring=require(_0x26ab('0xe'));var Papa=require(_0x26ab('0xf'));var Redis=require(_0x26ab('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x26ab('0x11'));var as=require(_0x26ab('0x12'));var hardwareService=require(_0x26ab('0x13'));var logger=require(_0x26ab('0x14'))(_0x26ab('0x15'));var utils=require(_0x26ab('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x26ab('0x17'));var db=require(_0x26ab('0x18'))['db'];function respondWithStatusCode(_0xe56f5c,_0x2714d2){_0x2714d2=_0x2714d2||0xcc;return function(_0x235c24){if(_0x235c24){return _0xe56f5c[_0x26ab('0x19')](_0x2714d2);}return _0xe56f5c[_0x26ab('0x1a')](_0x2714d2)[_0x26ab('0x1b')]();};}function respondWithResult(_0x50daf3,_0x5399f5){_0x5399f5=_0x5399f5||0xc8;return function(_0x18a0b4){if(_0x18a0b4){return _0x50daf3[_0x26ab('0x1a')](_0x5399f5)[_0x26ab('0x1c')](_0x18a0b4);}};}function respondWithFilteredResult(_0x3055ae,_0x26774c){return function(_0x445be5){if(_0x445be5){var _0x4fcc87=typeof _0x26774c['offset']===_0x26ab('0x1d')&&typeof _0x26774c[_0x26ab('0x1e')]==='undefined';var _0x180e21=_0x445be5[_0x26ab('0x1f')];var _0x31e868=_0x4fcc87?0x0:_0x26774c['offset'];var _0x4fe8ea=_0x4fcc87?_0x445be5['count']:_0x26774c[_0x26ab('0x20')]+_0x26774c[_0x26ab('0x1e')];var _0x5663b4;if(_0x4fe8ea>=_0x180e21){_0x4fe8ea=_0x180e21;_0x5663b4=0xc8;}else{_0x5663b4=0xce;}_0x3055ae[_0x26ab('0x1a')](_0x5663b4);return _0x3055ae[_0x26ab('0x21')](_0x26ab('0x22'),_0x31e868+'-'+_0x4fe8ea+'/'+_0x180e21)['json'](_0x445be5);}return null;};}function patchUpdates(_0x68e065){return function(_0x2250bf){try{jsonpatch[_0x26ab('0x23')](_0x2250bf,_0x68e065,!![]);}catch(_0x2bb33e){return BPromise['reject'](_0x2bb33e);}return _0x2250bf['save']();};}function saveUpdates(_0x2197cd,_0x259f55){return function(_0x5ab8b2){if(_0x5ab8b2){return _0x5ab8b2[_0x26ab('0x24')](_0x2197cd)[_0x26ab('0x25')](function(_0x4c4a3c){return _0x4c4a3c;});}return null;};}function removeEntity(_0x5f0b93,_0x1254d4){return function(_0x11a549){if(_0x11a549){return _0x11a549['destroy']()[_0x26ab('0x25')](function(){_0x5f0b93[_0x26ab('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x100d7d,_0x400d86){return function(_0x977b53){if(!_0x977b53){_0x100d7d[_0x26ab('0x19')](0x194);}return _0x977b53;};}function handleError(_0x25d217,_0x59114b){_0x59114b=_0x59114b||0x1f4;return function(_0x3765d9){logger[_0x26ab('0x26')](_0x3765d9[_0x26ab('0x27')]);if(_0x3765d9[_0x26ab('0x28')]){delete _0x3765d9['name'];}_0x25d217[_0x26ab('0x1a')](_0x59114b)['send'](_0x3765d9);};}var utilLicense=require(_0x26ab('0x17'));exports['index']=function(_0x530944,_0x4ad777){var _0x433c79={'raw':!![],'where':{'id':0x1}},_0x802cee={};_0x802cee[_0x26ab('0x29')]=_[_0x26ab('0x2a')](db[_0x26ab('0x2b')][_0x26ab('0x2c')]);_0x802cee[_0x26ab('0x2d')]=_[_0x26ab('0x2a')](_0x530944['query']);_0x802cee['filters']=_[_0x26ab('0x2e')](_0x802cee[_0x26ab('0x29')],_0x802cee[_0x26ab('0x2d')]);_0x433c79[_0x26ab('0x2f')]=_['intersection'](_0x802cee['model'],qs['fields'](_0x530944[_0x26ab('0x2d')]['fields']));_0x433c79[_0x26ab('0x2f')]=_0x433c79[_0x26ab('0x2f')][_0x26ab('0x30')]?_0x433c79[_0x26ab('0x2f')]:_0x802cee[_0x26ab('0x29')];_0x433c79=_['merge']({},_0x433c79,_0x530944['options']);return utilLicense[_0x26ab('0x31')](_0x433c79)[_0x26ab('0x25')](respondWithResult(_0x4ad777,null))['catch'](handleError(_0x4ad777,null));};exports[_0x26ab('0x24')]=function(_0x271d58,_0x29ee53){if(_0x271d58['body']['id']){delete _0x271d58[_0x26ab('0x32')]['id'];}return db[_0x26ab('0x2b')][_0x26ab('0x33')]({'where':{'id':_0x271d58[_0x26ab('0x34')]['id']}})[_0x26ab('0x25')](handleEntityNotFound(_0x29ee53,null))['then'](function(_0xf51732){var _0x10f62a=_0xf51732[_0x26ab('0x35')]({'plain':!![]});return utilLicense['checkLicense'](_0x10f62a,_0x271d58[_0x26ab('0x32')][_0x26ab('0x36')]);})[_0x26ab('0x25')](function(_0x22e1fd){if(!_0x22e1fd[_0x26ab('0x37')]){return saveUpdates(_0x271d58[_0x26ab('0x32')],null);}return _0x22e1fd;})[_0x26ab('0x25')](respondWithResult(_0x29ee53,null))[_0x26ab('0x38')](handleError(_0x29ee53,null));};exports['downloadLogFile']=function(_0x534ef3,_0x8b94a8){var _0x4aba0a='license-info.log';var _0x46474c=path[_0x26ab('0x39')](_0x26ab('0x3a'),_0x26ab('0x3b'),_0x26ab('0x3c'),_0x4aba0a);_0x8b94a8[_0x26ab('0x3d')]('Content-disposition',_0x26ab('0x3e')+_0x4aba0a);_0x8b94a8['set'](_0x26ab('0x3f'),_0x26ab('0x40'));_0x8b94a8['download'](_0x46474c);}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 61c1180..915ac3f 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 _0xe93e=['exports','define','license','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x451f88,_0x5c061a){var _0x2cc2b7=function(_0x5bb6ce){while(--_0x5bb6ce){_0x451f88['push'](_0x451f88['shift']());}};_0x2cc2b7(++_0x5c061a);}(_0xe93e,0x148));var _0xee93=function(_0xa41df9,_0x20fed0){_0xa41df9=_0xa41df9-0x0;var _0x342a45=_0xe93e[_0xa41df9];return _0x342a45;};'use strict';var _=require(_0xee93('0x0'));var util=require(_0xee93('0x1'));var logger=require(_0xee93('0x2'))(_0xee93('0x3'));var moment=require(_0xee93('0x4'));var BPromise=require(_0xee93('0x5'));var rp=require(_0xee93('0x6'));var fs=require('fs');var path=require(_0xee93('0x7'));var rimraf=require(_0xee93('0x8'));var config=require(_0xee93('0x9'));var attributes=require('./license.attributes');module[_0xee93('0xa')]=function(_0x5ac859,_0x5c1ae9){return _0x5ac859[_0xee93('0xb')]('License',attributes,{'tableName':_0xee93('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1be8=['request-promise','path','../../config/environment','./license.attributes','define','License','license','../../config/logger','api'];(function(_0x14082b,_0x3672d6){var _0x53a93d=function(_0x514882){while(--_0x514882){_0x14082b['push'](_0x14082b['shift']());}};_0x53a93d(++_0x3672d6);}(_0x1be8,0xc4));var _0x81be=function(_0x52c651,_0x4c1f4e){_0x52c651=_0x52c651-0x0;var _0x525ceb=_0x1be8[_0x52c651];return _0x525ceb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x81be('0x0'))(_0x81be('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x81be('0x2'));var fs=require('fs');var path=require(_0x81be('0x3'));var rimraf=require('rimraf');var config=require(_0x81be('0x4'));var attributes=require(_0x81be('0x5'));module['exports']=function(_0x382286,_0x81c913){return _0x382286[_0x81be('0x6')](_0x81be('0x7'),attributes,{'tableName':_0x81be('0x8'),'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 c0da594..aff91b1 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 _0x7342=['jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment'];(function(_0x9727d6,_0x28d540){var _0x53834a=function(_0x3bc024){while(--_0x3bc024){_0x9727d6['push'](_0x9727d6['shift']());}};_0x53834a(++_0x28d540);}(_0x7342,0x1dc));var _0x2734=function(_0x902fc7,_0x42d685){_0x902fc7=_0x902fc7-0x0;var _0x5a5a98=_0x7342[_0x902fc7];return _0x5a5a98;};'use strict';var _=require(_0x2734('0x0'));var util=require(_0x2734('0x1'));var moment=require(_0x2734('0x2'));var BPromise=require('bluebird');var rs=require(_0x2734('0x3'));var fs=require('fs');var Redis=require(_0x2734('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2734('0x5'));var logger=require('../../config/logger')(_0x2734('0x6'));var config=require(_0x2734('0x7'));var jayson=require(_0x2734('0x8'));var client=jayson[_0x2734('0x9')][_0x2734('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1582ab,_0x1db7fb,_0x5a884a){return new BPromise(function(_0x233ec5,_0x432e9c){return client[_0x2734('0xb')](_0x1582ab,_0x5a884a)[_0x2734('0xc')](function(_0x5f3026){logger[_0x2734('0xd')](_0x2734('0xe'),_0x1db7fb,_0x2734('0xf'));logger[_0x2734('0x10')](_0x2734('0x11'),_0x1db7fb,_0x2734('0xf'),JSON[_0x2734('0x12')](_0x5f3026));if(_0x5f3026['error']){if(_0x5f3026[_0x2734('0x13')]['code']===0x1f4){logger['error']('License,\x20%s,\x20%s',_0x1db7fb,_0x5f3026['error']['message']);return _0x432e9c(_0x5f3026['error']['message']);}logger[_0x2734('0x13')](_0x2734('0xe'),_0x1db7fb,_0x5f3026['error'][_0x2734('0x14')]);return _0x233ec5(_0x5f3026['error'][_0x2734('0x14')]);}else{logger[_0x2734('0xd')]('License,\x20%s,\x20%s',_0x1db7fb,_0x2734('0xf'));_0x233ec5(_0x5f3026['result'][_0x2734('0x14')]);}})[_0x2734('0x15')](function(_0x4d6def){logger[_0x2734('0x13')](_0x2734('0xe'),_0x1db7fb,_0x4d6def);_0x432e9c(_0x4d6def);});});} \ No newline at end of file +var _0xebf7=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x10eb11,_0x1c2aaa){var _0x1aad42=function(_0x2192f6){while(--_0x2192f6){_0x10eb11['push'](_0x10eb11['shift']());}};_0x1aad42(++_0x1c2aaa);}(_0xebf7,0x11b));var _0x7ebf=function(_0xadee3,_0xfcc973){_0xadee3=_0xadee3-0x0;var _0x444f43=_0xebf7[_0xadee3];return _0x444f43;};'use strict';var _=require(_0x7ebf('0x0'));var util=require(_0x7ebf('0x1'));var moment=require(_0x7ebf('0x2'));var BPromise=require(_0x7ebf('0x3'));var rs=require(_0x7ebf('0x4'));var fs=require('fs');var Redis=require(_0x7ebf('0x5'));var db=require(_0x7ebf('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x7ebf('0x7'))(_0x7ebf('0x8'));var config=require(_0x7ebf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7ebf('0xa')][_0x7ebf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf878c5,_0x43e17b,_0x25c181){return new BPromise(function(_0x29f7d5,_0x2a6b1c){return client[_0x7ebf('0xc')](_0xf878c5,_0x25c181)['then'](function(_0x2a576f){logger[_0x7ebf('0xd')](_0x7ebf('0xe'),_0x43e17b,_0x7ebf('0xf'));logger[_0x7ebf('0x10')](_0x7ebf('0x11'),_0x43e17b,'request\x20sent',JSON[_0x7ebf('0x12')](_0x2a576f));if(_0x2a576f[_0x7ebf('0x13')]){if(_0x2a576f[_0x7ebf('0x13')][_0x7ebf('0x14')]===0x1f4){logger[_0x7ebf('0x13')]('License,\x20%s,\x20%s',_0x43e17b,_0x2a576f[_0x7ebf('0x13')][_0x7ebf('0x15')]);return _0x2a6b1c(_0x2a576f['error'][_0x7ebf('0x15')]);}logger['error'](_0x7ebf('0xe'),_0x43e17b,_0x2a576f[_0x7ebf('0x13')][_0x7ebf('0x15')]);return _0x29f7d5(_0x2a576f[_0x7ebf('0x13')][_0x7ebf('0x15')]);}else{logger[_0x7ebf('0xd')]('License,\x20%s,\x20%s',_0x43e17b,_0x7ebf('0xf'));_0x29f7d5(_0x2a576f[_0x7ebf('0x16')]['message']);}})[_0x7ebf('0x17')](function(_0x237fe3){logger[_0x7ebf('0x13')](_0x7ebf('0xe'),_0x43e17b,_0x237fe3);_0x2a6b1c(_0x237fe3);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index cf6d926..4bbaaf3 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 _0x9c07=['addImap','addSmtp','/:id/send','send','put','delete','removeAnswers','removeImap','/:id','destroy','removeAgents','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','./mailAccount.controller','isAuthenticated','index','get','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','addDisposition','post','addAnswer','create'];(function(_0x323430,_0x3d2b6d){var _0x9eecd1=function(_0xab855a){while(--_0xab855a){_0x323430['push'](_0x323430['shift']());}};_0x9eecd1(++_0x3d2b6d);}(_0x9c07,0xe8));var _0x79c0=function(_0x46bf6c,_0x365b09){_0x46bf6c=_0x46bf6c-0x0;var _0xf024ce=_0x9c07[_0x46bf6c];return _0xf024ce;};'use strict';var multer=require(_0x79c0('0x0'));var util=require(_0x79c0('0x1'));var path=require(_0x79c0('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x79c0('0x3'));var auth=require(_0x79c0('0x4'));var interaction=require(_0x79c0('0x5'));var config=require('../../config/environment');var controller=require(_0x79c0('0x6'));router['get']('/',auth[_0x79c0('0x7')](),controller[_0x79c0('0x8')]);router[_0x79c0('0x9')]('/describe',auth[_0x79c0('0x7')](),controller[_0x79c0('0xa')]);router[_0x79c0('0x9')]('/:id',auth[_0x79c0('0x7')](),controller[_0x79c0('0xb')]);router[_0x79c0('0x9')](_0x79c0('0xc'),auth[_0x79c0('0x7')](),controller[_0x79c0('0xd')]);router[_0x79c0('0x9')](_0x79c0('0xe'),auth[_0x79c0('0x7')](),controller[_0x79c0('0xf')]);router[_0x79c0('0x9')](_0x79c0('0x10'),auth['isAuthenticated'](),controller['getImap']);router[_0x79c0('0x9')](_0x79c0('0x11'),auth[_0x79c0('0x7')](),controller[_0x79c0('0x12')]);router['get'](_0x79c0('0x13'),auth[_0x79c0('0x7')](),controller['getInteractions']);router[_0x79c0('0x9')](_0x79c0('0x14'),auth[_0x79c0('0x7')](),controller[_0x79c0('0x15')]);router[_0x79c0('0x9')](_0x79c0('0x16'),auth[_0x79c0('0x7')](),controller[_0x79c0('0x17')]);router['get'](_0x79c0('0x18'),auth['isAuthenticated'](),controller[_0x79c0('0x19')]);router[_0x79c0('0x9')](_0x79c0('0x1a'),auth[_0x79c0('0x7')](),controller[_0x79c0('0x1b')]);router['post']('/:id/dispositions',auth[_0x79c0('0x7')](),controller[_0x79c0('0x1c')]);router[_0x79c0('0x1d')](_0x79c0('0xe'),auth[_0x79c0('0x7')](),controller[_0x79c0('0x1e')]);router[_0x79c0('0x1d')]('/',auth[_0x79c0('0x7')](),controller[_0x79c0('0x1f')]);router[_0x79c0('0x1d')](_0x79c0('0x10'),auth['isAuthenticated'](),controller[_0x79c0('0x20')]);router['post'](_0x79c0('0x11'),auth[_0x79c0('0x7')](),controller[_0x79c0('0x21')]);router[_0x79c0('0x1d')](_0x79c0('0x13'),auth[_0x79c0('0x7')](),controller['addInteraction']);router['post'](_0x79c0('0x14'),auth['isAuthenticated'](),controller['addApplications']);router[_0x79c0('0x1d')](_0x79c0('0x22'),auth[_0x79c0('0x7')](),controller[_0x79c0('0x23')]);router[_0x79c0('0x1d')](_0x79c0('0x1a'),auth[_0x79c0('0x7')](),controller['addAgents']);router[_0x79c0('0x24')]('/:id',auth[_0x79c0('0x7')](),controller['update']);router['delete'](_0x79c0('0xc'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x79c0('0x25')]('/:id/canned_answers',auth[_0x79c0('0x7')](),controller[_0x79c0('0x26')]);router['delete']('/:id/in_servers',auth[_0x79c0('0x7')](),controller[_0x79c0('0x27')]);router[_0x79c0('0x25')]('/:id/out_servers',auth[_0x79c0('0x7')](),controller['removeSmtp']);router[_0x79c0('0x25')](_0x79c0('0x28'),auth[_0x79c0('0x7')](),controller[_0x79c0('0x29')]);router[_0x79c0('0x25')](_0x79c0('0x1a'),auth['isAuthenticated'](),controller[_0x79c0('0x2a')]);module[_0x79c0('0x2b')]=router; \ No newline at end of file +var _0x6199=['getAgents','addDisposition','addAnswer','post','addSmtp','addInteraction','/:id/applications','addApplications','/:id/send','send','/:id/users','addAgents','update','delete','removeDispositions','removeImap','removeSmtp','destroy','removeAgents','util','path','express','Router','fs-extra','../../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','getImap','/:id/out_servers','/:id/interactions','/:id/messages','getMessages','/:id/verify','verifySmtp'];(function(_0x5e2199,_0x1c6504){var _0x31e252=function(_0x54ce64){while(--_0x54ce64){_0x5e2199['push'](_0x5e2199['shift']());}};_0x31e252(++_0x1c6504);}(_0x6199,0xfe));var _0x9619=function(_0x2b0f6f,_0x21651a){_0x2b0f6f=_0x2b0f6f-0x0;var _0x54903c=_0x6199[_0x2b0f6f];return _0x54903c;};'use strict';var multer=require('multer');var util=require(_0x9619('0x0'));var path=require(_0x9619('0x1'));var timeout=require('connect-timeout');var express=require(_0x9619('0x2'));var router=express[_0x9619('0x3')]();var fs_extra=require(_0x9619('0x4'));var auth=require(_0x9619('0x5'));var interaction=require(_0x9619('0x6'));var config=require(_0x9619('0x7'));var controller=require(_0x9619('0x8'));router[_0x9619('0x9')]('/',auth[_0x9619('0xa')](),controller[_0x9619('0xb')]);router['get'](_0x9619('0xc'),auth['isAuthenticated'](),controller[_0x9619('0xd')]);router[_0x9619('0x9')](_0x9619('0xe'),auth[_0x9619('0xa')](),controller[_0x9619('0xf')]);router[_0x9619('0x9')](_0x9619('0x10'),auth[_0x9619('0xa')](),controller[_0x9619('0x11')]);router[_0x9619('0x9')](_0x9619('0x12'),auth[_0x9619('0xa')](),controller[_0x9619('0x13')]);router['get'](_0x9619('0x14'),auth[_0x9619('0xa')](),controller[_0x9619('0x15')]);router[_0x9619('0x9')](_0x9619('0x16'),auth[_0x9619('0xa')](),controller['getSmtp']);router['get'](_0x9619('0x17'),auth['isAuthenticated'](),controller['getInteractions']);router[_0x9619('0x9')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x9619('0x9')](_0x9619('0x18'),auth['isAuthenticated'](),controller[_0x9619('0x19')]);router[_0x9619('0x9')](_0x9619('0x1a'),auth['isAuthenticated'](),controller[_0x9619('0x1b')]);router[_0x9619('0x9')]('/:id/users',auth[_0x9619('0xa')](),controller[_0x9619('0x1c')]);router['post'](_0x9619('0x10'),auth['isAuthenticated'](),controller[_0x9619('0x1d')]);router['post'](_0x9619('0x12'),auth[_0x9619('0xa')](),controller[_0x9619('0x1e')]);router[_0x9619('0x1f')]('/',auth[_0x9619('0xa')](),controller['create']);router[_0x9619('0x1f')]('/:id/in_servers',auth['isAuthenticated'](),controller['addImap']);router['post'](_0x9619('0x16'),auth[_0x9619('0xa')](),controller[_0x9619('0x20')]);router[_0x9619('0x1f')](_0x9619('0x17'),auth['isAuthenticated'](),controller[_0x9619('0x21')]);router[_0x9619('0x1f')](_0x9619('0x22'),auth[_0x9619('0xa')](),controller[_0x9619('0x23')]);router[_0x9619('0x1f')](_0x9619('0x24'),auth[_0x9619('0xa')](),controller[_0x9619('0x25')]);router[_0x9619('0x1f')](_0x9619('0x26'),auth[_0x9619('0xa')](),controller[_0x9619('0x27')]);router['put'](_0x9619('0xe'),auth['isAuthenticated'](),controller[_0x9619('0x28')]);router[_0x9619('0x29')](_0x9619('0x10'),auth[_0x9619('0xa')](),controller[_0x9619('0x2a')]);router[_0x9619('0x29')](_0x9619('0x12'),auth[_0x9619('0xa')](),controller['removeAnswers']);router[_0x9619('0x29')](_0x9619('0x14'),auth[_0x9619('0xa')](),controller[_0x9619('0x2b')]);router[_0x9619('0x29')](_0x9619('0x16'),auth[_0x9619('0xa')](),controller[_0x9619('0x2c')]);router[_0x9619('0x29')]('/:id',auth['isAuthenticated'](),controller[_0x9619('0x2d')]);router[_0x9619('0x29')](_0x9619('0x26'),auth[_0x9619('0xa')](),controller[_0x9619('0x2e')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 7f147c0..11b8adb 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 _0x5ed9=['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','mandatoryDisposition','ENUM','gmail','hotmail','outlook365','getDataValue','provider','custom','sequelize','STRING','BOOLEAN','Arial,Helvetica,sans-serif','INTEGER'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x5ed9,0x14b));var _0x95ed=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5ed9[_0x5f0089];return _0x193892;};'use strict';var Sequelize=require(_0x95ed('0x0'));module['exports']={'description':{'type':Sequelize[_0x95ed('0x1')]},'name':{'type':Sequelize[_0x95ed('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x95ed('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x95ed('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x95ed('0x1')],'allowNull':![],'defaultValue':_0x95ed('0x3')},'fontSize':{'type':Sequelize[_0x95ed('0x4')](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x95ed('0x5');}},'notificationSound':{'type':Sequelize[_0x95ed('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x95ed('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x95ed('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x95ed('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x95ed('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x95ed('0x4')],'allowNull':!![],'defaultValue':null,'comment':_0x95ed('0x6')},'mandatoryDisposition':{'type':Sequelize[_0x95ed('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3f97c4){if(!_0x3f97c4)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x95ed('0x7')](_0x95ed('0x8'),_0x3f97c4);}},'provider':{'type':Sequelize[_0x95ed('0x9')](_0x95ed('0xa'),_0x95ed('0xb'),'yahoo',_0x95ed('0xc')),'defaultValue':null,'get':function(){if(!this[_0x95ed('0xd')](_0x95ed('0xe')))return _0x95ed('0xf');return this[_0x95ed('0xd')](_0x95ed('0xe'));},'set':function(_0x46e111){if(_0x46e111===_0x95ed('0xf'))_0x46e111=null;return this[_0x95ed('0x7')](_0x95ed('0xe'),_0x46e111);}}}; \ No newline at end of file +var _0x29d7=['mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','ENUM','gmail','yahoo','outlook365','provider','custom','getDataValue','sequelize','exports','BOOLEAN','STRING','TEXT','Arial,Helvetica,sans-serif','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x2afb44,_0x249a57){var _0x15ccc2=function(_0x180748){while(--_0x180748){_0x2afb44['push'](_0x2afb44['shift']());}};_0x15ccc2(++_0x249a57);}(_0x29d7,0xdc));var _0x729d=function(_0x3855bc,_0x67095b){_0x3855bc=_0x3855bc-0x0;var _0x11501e=_0x29d7[_0x3855bc];return _0x11501e;};'use strict';var Sequelize=require(_0x729d('0x0'));module[_0x729d('0x1')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x729d('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x729d('0x3')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0x729d('0x3')],'allowNull':![]},'template':{'type':Sequelize[_0x729d('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x729d('0x3')],'allowNull':![],'defaultValue':_0x729d('0x5')},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0x729d('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x729d('0x7');}},'notificationSound':{'type':Sequelize[_0x729d('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x729d('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x729d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x729d('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x729d('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x729d('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x729d('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x729d('0x2')],'defaultValue':![],'comment':_0x729d('0xa'),'set':function(_0x459190){if(!_0x459190)this['setDataValue'](_0x729d('0xb'),null);this[_0x729d('0xc')](_0x729d('0xd'),_0x459190);}},'provider':{'type':Sequelize[_0x729d('0xe')](_0x729d('0xf'),'hotmail',_0x729d('0x10'),_0x729d('0x11')),'defaultValue':null,'get':function(){if(!this['getDataValue'](_0x729d('0x12')))return _0x729d('0x13');return this[_0x729d('0x14')](_0x729d('0x12'));},'set':function(_0x18612b){if(_0x18612b===_0x729d('0x13'))_0x18612b=null;return this['setDataValue'](_0x729d('0x12'),_0x18612b);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index e2e6315..255768e 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 _0x63c9=['key','provider','email','ListId','isNil','active','description','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','getImap','addImap','removeImap','getSmtp','addSmtp','removeSmtp','addInteraction','MailInteraction','CmContact','Contact','Owner','internal','Tag','Tags','tag','rows','addApplications','transaction','sequelize','ISOLATION_LEVELS','MailApplication','findAndCountAll','finally','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','true','CmList','List','updatedAt','CloudProvider','Smtp\x20configuration\x20not\x20found','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','SendMail','Contacts','messageId','subject','attach','out','format','Interaction','Messages','getSmtpOptions','verifySmtp','Sequelize','ValidationError','omit','spread','emit','removeAgents','isArray','userMailAccount:remove','getAgents','User','moment','bluebird','util','lodash','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','sendStatus','end','json','offset','undefined','count','status','update','get','MailAccounts','UserProfileResource','destroy','stack','name','send','gmail','imap.gmail.com','imap.mail.yahoo.com','imap-mail.outlook.com','outlook365','outlook.office365.com','Unknown\x20email\x20service\x20provider','yahoo','smtp.mail.yahoo.com','hotmail','smtp-mail.outlook.com','smtp.office365.com','user','pass','password','modernAuthentication','CloudProviderId','host','port','service','authentication','username','Imap','Smtp','index','MailServerIn','mandatoryDispositionPause','map','MailAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','includeAll','include','findAll','show','params','MailServerOut','Pause','body','custom','secure','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','pick','removeDispositions','find','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers'];(function(_0x2b27ac,_0x36af86){var _0x14d6c6=function(_0x11f85a){while(--_0x11f85a){_0x2b27ac['push'](_0x2b27ac['shift']());}};_0x14d6c6(++_0x36af86);}(_0x63c9,0x10d));var _0x963c=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x63c9[_0x2c7618];return _0x5ce3f0;};'use strict';var moment=require(_0x963c('0x0'));var BPromise=require(_0x963c('0x1'));var util=require(_0x963c('0x2'));var path=require('path');var _=require(_0x963c('0x3'));var juice=require(_0x963c('0x4'));var Redis=require(_0x963c('0x5'));var qs=require(_0x963c('0x6'));var logger=require(_0x963c('0x7'))(_0x963c('0x8'));var config=require(_0x963c('0x9'));var db=require('../../mysqldb')['db'];config[_0x963c('0xa')]=_[_0x963c('0xb')](config[_0x963c('0xa')],{'host':_0x963c('0xc'),'port':0x18eb});var socket=require(_0x963c('0xd'))(new Redis(config[_0x963c('0xa')]));require(_0x963c('0xe'))[_0x963c('0xf')](socket);var jayson=require(_0x963c('0x10'));var client=jayson[_0x963c('0x11')][_0x963c('0x12')]({'port':0x232b});function respondWithRpcPromise(_0x39dd22,_0x4d3e91,_0x52fc0c,_0x4131ff){return new BPromise(function(_0x6a9b3c,_0x134045){var _0x1b89cf=_0x4131ff||client;return _0x1b89cf[_0x963c('0x13')](_0x39dd22,_0x52fc0c)[_0x963c('0x14')](function(_0x868054){logger[_0x963c('0x15')](_0x963c('0x16'),_0x4d3e91,'request\x20sent');logger[_0x963c('0x17')](_0x963c('0x18'),_0x4d3e91,'request\x20sent',JSON[_0x963c('0x19')](_0x868054));if(_0x868054['error']){if(_0x868054['error'][_0x963c('0x1a')]===0x1f4){logger['error'](_0x963c('0x16'),_0x4d3e91,_0x868054[_0x963c('0x1b')]['message']);return _0x134045(_0x868054[_0x963c('0x1b')][_0x963c('0x1c')]);}logger[_0x963c('0x1b')](_0x963c('0x16'),_0x4d3e91,_0x868054[_0x963c('0x1b')][_0x963c('0x1c')]);return _0x6a9b3c(_0x868054['error'][_0x963c('0x1c')]);}else{logger[_0x963c('0x15')](_0x963c('0x16'),_0x4d3e91,_0x963c('0x1d'));_0x6a9b3c(_0x868054[_0x963c('0x1e')][_0x963c('0x1c')]);}})[_0x963c('0x1f')](function(_0x11d411){logger[_0x963c('0x1b')](_0x963c('0x16'),_0x4d3e91,_0x11d411);_0x134045(_0x11d411);});});}function respondWithStatusCode(_0x595ea2,_0x5bd720){_0x5bd720=_0x5bd720||0xcc;return function(_0xc56881){if(_0xc56881){return _0x595ea2[_0x963c('0x20')](_0x5bd720);}return _0x595ea2['status'](_0x5bd720)[_0x963c('0x21')]();};}function respondWithResult(_0x2341e2,_0x36c76f){_0x36c76f=_0x36c76f||0xc8;return function(_0x12f103){if(_0x12f103){return _0x2341e2['status'](_0x36c76f)[_0x963c('0x22')](_0x12f103);}};}function respondWithFilteredResult(_0x137de3,_0x5f4ba8){return function(_0x715a5d){if(_0x715a5d){var _0x42a3a7=typeof _0x5f4ba8[_0x963c('0x23')]===_0x963c('0x24')&&typeof _0x5f4ba8['limit']===_0x963c('0x24');var _0x3a4e2d=_0x715a5d[_0x963c('0x25')];var _0x2d64f7=_0x42a3a7?0x0:_0x5f4ba8[_0x963c('0x23')];var _0x464d2f=_0x42a3a7?_0x715a5d['count']:_0x5f4ba8[_0x963c('0x23')]+_0x5f4ba8['limit'];var _0x1f0cde;if(_0x464d2f>=_0x3a4e2d){_0x464d2f=_0x3a4e2d;_0x1f0cde=0xc8;}else{_0x1f0cde=0xce;}_0x137de3[_0x963c('0x26')](_0x1f0cde);return _0x137de3['set']('Content-Range',_0x2d64f7+'-'+_0x464d2f+'/'+_0x3a4e2d)[_0x963c('0x22')](_0x715a5d);}return null;};}function saveUpdates(_0x10db2e){return function(_0x175543){if(_0x175543){return _0x175543[_0x963c('0x27')](_0x10db2e)[_0x963c('0x14')](function(_0x494615){return _0x494615;});}return null;};}function removeEntity(_0x431d17){return function(_0x36bad1){if(_0x36bad1){return _0x36bad1['destroy']()[_0x963c('0x14')](function(){var _0xb3cb02=_0x36bad1[_0x963c('0x28')]({'plain':!![]});var _0x1ad80c=_0x963c('0x29');return db[_0x963c('0x2a')][_0x963c('0x2b')]({'where':{'type':_0x1ad80c,'resourceId':_0xb3cb02['id']}})['then'](function(){return _0x36bad1;});})[_0x963c('0x14')](function(){_0x431d17[_0x963c('0x26')](0xcc)[_0x963c('0x21')]();});}};}function handleEntityNotFound(_0x560740){return function(_0x16a243){if(!_0x16a243){_0x560740['sendStatus'](0x194);}return _0x16a243;};}function handleError(_0x1d4b1c,_0x5e08b3){_0x5e08b3=_0x5e08b3||0x1f4;return function(_0x1ad09e){logger[_0x963c('0x1b')](_0x1ad09e[_0x963c('0x2c')]);if(_0x1ad09e['name']){delete _0x1ad09e[_0x963c('0x2d')];}_0x1d4b1c[_0x963c('0x26')](_0x5e08b3)[_0x963c('0x2e')](_0x1ad09e);};}function getImapHost(_0x57b0f1){switch(_0x57b0f1){case _0x963c('0x2f'):return _0x963c('0x30');case'yahoo':return _0x963c('0x31');case'hotmail':return _0x963c('0x32');case _0x963c('0x33'):return _0x963c('0x34');}throw new Error(_0x963c('0x35'),_0x57b0f1);}function getSmtpHost(_0x3cc400){switch(_0x3cc400){case _0x963c('0x2f'):return'smtp.gmail.com';case _0x963c('0x36'):return _0x963c('0x37');case _0x963c('0x38'):return _0x963c('0x39');case _0x963c('0x33'):return _0x963c('0x3a');}throw new Error('Unknown\x20email\x20service\x20provider',_0x3cc400);}function getAuthenticationOptions(_0x3a2d9e,_0x51643d){var _0xc2c799={};var _0x2dce41={};if(_0x3a2d9e){_0xc2c799[_0x963c('0x3b')]=_0x2dce41['user']=_0x51643d['username'];_0xc2c799['password']=_0x2dce41[_0x963c('0x3c')]=_0x51643d[_0x963c('0x3d')];if(_0x51643d[_0x963c('0x3e')]){_0xc2c799[_0x963c('0x3e')]=_0x2dce41['modernAuthentication']=!![];_0xc2c799['CloudProviderId']=_0x2dce41[_0x963c('0x3f')]=_0x51643d[_0x963c('0x3f')];_0xc2c799[_0x963c('0x3d')]=_0x2dce41['pass']=null;}else{_0xc2c799['CloudProviderId']=_0x2dce41[_0x963c('0x3f')]=null;}_0xc2c799[_0x963c('0x40')]=getImapHost(_0x3a2d9e);_0xc2c799[_0x963c('0x41')]=0x3e1;_0x2dce41[_0x963c('0x40')]=getSmtpHost(_0x3a2d9e);_0x2dce41[_0x963c('0x41')]=0x24b;_0x2dce41['secure']=![];_0xc2c799[_0x963c('0x42')]=_0x2dce41[_0x963c('0x42')]=null;}else{if(_0x51643d[_0x963c('0x43')]){_0xc2c799[_0x963c('0x3b')]=_0x2dce41['user']=_0x51643d[_0x963c('0x44')];_0xc2c799[_0x963c('0x3d')]=_0x2dce41['pass']=_0x51643d[_0x963c('0x3d')];}else{_0xc2c799[_0x963c('0x43')]=_0x2dce41[_0x963c('0x43')]=![];_0xc2c799[_0x963c('0x3b')]=_0x2dce41['user']=null;_0xc2c799[_0x963c('0x3d')]=_0x2dce41['pass']=null;}_0xc2c799[_0x963c('0x40')]=_0x51643d[_0x963c('0x45')][_0x963c('0x40')];_0xc2c799[_0x963c('0x41')]=_0x51643d[_0x963c('0x45')][_0x963c('0x41')];_0x2dce41[_0x963c('0x40')]=_0x51643d[_0x963c('0x46')]['host'];_0x2dce41['port']=_0x51643d['Smtp'][_0x963c('0x41')];}return{'Imap':_0xc2c799,'Smtp':_0x2dce41};}exports[_0x963c('0x47')]=function(_0x546ef7,_0x43d6c7){var _0x4679a2={'include':[{'model':db[_0x963c('0x48')],'as':_0x963c('0x45')},{'model':db['MailServerOut'],'as':_0x963c('0x46')},{'model':db['Pause'],'as':_0x963c('0x49')}]},_0x40bdf3={},_0x287ed6={'count':0x0,'rows':[]};var _0x2e7041=_[_0x963c('0x4a')](db[_0x963c('0x4b')][_0x963c('0x4c')],function(_0x388822){return{'name':_0x388822[_0x963c('0x4d')],'type':_0x388822[_0x963c('0x4e')]['key']};});_0x40bdf3[_0x963c('0x4f')]=_[_0x963c('0x4a')](_0x2e7041,'name');_0x40bdf3[_0x963c('0x50')]=_[_0x963c('0x51')](_0x546ef7[_0x963c('0x50')]);_0x40bdf3[_0x963c('0x52')]=_[_0x963c('0x53')](_0x40bdf3[_0x963c('0x4f')],_0x40bdf3[_0x963c('0x50')]);_0x4679a2[_0x963c('0x54')]=_[_0x963c('0x53')](_0x40bdf3[_0x963c('0x4f')],qs[_0x963c('0x55')](_0x546ef7[_0x963c('0x50')]['fields']));_0x4679a2[_0x963c('0x54')]=_0x4679a2[_0x963c('0x54')][_0x963c('0x56')]?_0x4679a2[_0x963c('0x54')]:_0x40bdf3['model'];if(!_0x546ef7['query'][_0x963c('0x57')](_0x963c('0x58'))){_0x4679a2['limit']=qs[_0x963c('0x59')](_0x546ef7[_0x963c('0x50')][_0x963c('0x59')]);_0x4679a2[_0x963c('0x23')]=qs[_0x963c('0x23')](_0x546ef7[_0x963c('0x50')][_0x963c('0x23')]);}_0x4679a2[_0x963c('0x5a')]=qs[_0x963c('0x5b')](_0x546ef7[_0x963c('0x50')][_0x963c('0x5b')]);_0x4679a2[_0x963c('0x5c')]=qs[_0x963c('0x52')](_['pick'](_0x546ef7[_0x963c('0x50')],_0x40bdf3[_0x963c('0x52')]),_0x2e7041);if(_0x546ef7[_0x963c('0x50')][_0x963c('0x5d')]){_0x4679a2[_0x963c('0x5c')]=_[_0x963c('0x5e')](_0x4679a2['where'],{'$or':_['map'](_0x2e7041,function(_0x2776c7){if(_0x2776c7['type']!=='VIRTUAL'){var _0x4d9970={};_0x4d9970[_0x2776c7[_0x963c('0x2d')]]={'$like':'%'+_0x546ef7[_0x963c('0x50')][_0x963c('0x5d')]+'%'};return _0x4d9970;}})});}_0x4679a2=_[_0x963c('0x5e')]({},_0x4679a2,_0x546ef7[_0x963c('0x5f')]);var _0xab0de7={'where':_0x4679a2['where']};return db[_0x963c('0x4b')][_0x963c('0x25')](_0xab0de7)['then'](function(_0x56367c){_0x287ed6[_0x963c('0x25')]=_0x56367c;if(_0x546ef7[_0x963c('0x50')][_0x963c('0x60')]){_0x4679a2[_0x963c('0x61')]=[{'all':!![]}];}return db[_0x963c('0x4b')][_0x963c('0x62')](_0x4679a2);})['then'](function(_0x1cfdc5){_0x287ed6['rows']=_0x1cfdc5;return _0x287ed6;})['then'](respondWithFilteredResult(_0x43d6c7,_0x4679a2))[_0x963c('0x1f')](handleError(_0x43d6c7,null));};exports[_0x963c('0x63')]=function(_0x273445,_0x233345){var _0x55de0c={'raw':![],'where':{'id':_0x273445[_0x963c('0x64')]['id']},'include':[{'model':db[_0x963c('0x48')],'as':_0x963c('0x45')},{'model':db[_0x963c('0x65')],'as':_0x963c('0x46')},{'model':db[_0x963c('0x66')],'as':_0x963c('0x49')}]},_0x208027={};_0x208027[_0x963c('0x4f')]=_[_0x963c('0x51')](db[_0x963c('0x4b')][_0x963c('0x4c')]);_0x208027[_0x963c('0x50')]=_['keys'](_0x273445['query']);_0x208027[_0x963c('0x52')]=_[_0x963c('0x53')](_0x208027[_0x963c('0x4f')],_0x208027[_0x963c('0x50')]);_0x55de0c[_0x963c('0x54')]=_['intersection'](_0x208027[_0x963c('0x4f')],qs[_0x963c('0x55')](_0x273445[_0x963c('0x50')][_0x963c('0x55')]));_0x55de0c['attributes']=_0x55de0c[_0x963c('0x54')]['length']?_0x55de0c['attributes']:_0x208027[_0x963c('0x4f')];if(_0x273445[_0x963c('0x50')][_0x963c('0x60')]){_0x55de0c[_0x963c('0x61')]=[{'all':!![]}];}_0x55de0c=_[_0x963c('0x5e')]({},_0x55de0c,_0x273445[_0x963c('0x5f')]);return db['MailAccount']['find'](_0x55de0c)['then'](handleEntityNotFound(_0x233345,null))['then'](respondWithResult(_0x233345,null))['catch'](handleError(_0x233345,null));};exports[_0x963c('0x27')]=function(_0x257021,_0x1eb38d){if(_0x257021[_0x963c('0x67')]['id']){delete _0x257021['body']['id'];}var _0x4cc562=_0x257021[_0x963c('0x67')]['provider']===_0x963c('0x68')?null:_0x257021['body']['provider'];var _0x22a189=_0x257021[_0x963c('0x67')][_0x963c('0x45')]||{};var _0x5ec086=_0x257021['body'][_0x963c('0x46')]||{};if(_0x4cc562){_0x22a189['host']=getImapHost(_0x4cc562);_0x22a189['port']=0x3e1;_0x5ec086[_0x963c('0x40')]=getSmtpHost(_0x4cc562);_0x5ec086['port']=0x24b;_0x5ec086[_0x963c('0x69')]=![];}if(_0x5ec086[_0x963c('0x3e')]){_0x5ec086[_0x963c('0x69')]=![];}else{_0x5ec086[_0x963c('0x3f')]=null;}if(!_0x22a189[_0x963c('0x3e')])_0x22a189[_0x963c('0x3f')]=null;_0x257021[_0x963c('0x67')][_0x963c('0x45')]=_0x22a189;_0x257021[_0x963c('0x67')]['Smtp']=_0x5ec086;return db['MailAccount']['find']({'where':{'id':_0x257021[_0x963c('0x64')]['id']},'include':[{'model':db[_0x963c('0x48')],'as':'Imap'},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db['Pause'],'as':_0x963c('0x49')}]})[_0x963c('0x14')](handleEntityNotFound(_0x1eb38d,null))[_0x963c('0x14')](function(_0x511a91){if(!_0x511a91)throw new Error('Mail\x20Account\x20not\x20found');if(_0x511a91[_0x963c('0x42')])delete _0x257021['body']['Imap'];return _0x511a91;})[_0x963c('0x14')](saveUpdates(_0x257021[_0x963c('0x67')],null))[_0x963c('0x14')](function(_0x2dd65a){if(!_0x257021[_0x963c('0x67')][_0x963c('0x45')])return _0x2dd65a;return db[_0x963c('0x48')][_0x963c('0x27')](_0x257021[_0x963c('0x67')][_0x963c('0x45')],{'where':{'MailAccountId':_0x2dd65a['id']}})[_0x963c('0x14')](function(){return _0x2dd65a;});})['then'](function(_0x18d53f){if(!_0x257021[_0x963c('0x67')][_0x963c('0x46')])return _0x18d53f;return db[_0x963c('0x65')][_0x963c('0x27')](_0x257021[_0x963c('0x67')][_0x963c('0x46')],{'where':{'MailAccountId':_0x18d53f['id']}})[_0x963c('0x14')](function(){return _0x18d53f;});})[_0x963c('0x14')](respondWithResult(_0x1eb38d,null))[_0x963c('0x1f')](handleError(_0x1eb38d,null));};exports[_0x963c('0x6a')]=function(_0x6002f9,_0x412541){return db['MailAccount'][_0x963c('0x6a')]()[_0x963c('0x14')](respondWithResult(_0x412541,null))[_0x963c('0x1f')](handleError(_0x412541,null));};exports[_0x963c('0x6b')]=function(_0x4cfe03,_0x5c51b8){if(_0x4cfe03[_0x963c('0x67')]['id']){delete _0x4cfe03[_0x963c('0x67')]['id'];}return db[_0x963c('0x4b')]['find']({'where':{'id':_0x4cfe03['params']['id']}})['then'](handleEntityNotFound(_0x5c51b8,null))[_0x963c('0x14')](function(_0x3a0131){if(_0x3a0131){_0x4cfe03[_0x963c('0x67')][_0x963c('0x6c')]=_0x3a0131['id'];return db[_0x963c('0x6d')][_0x963c('0x6e')](_0x4cfe03[_0x963c('0x67')]);}})[_0x963c('0x14')](respondWithResult(_0x5c51b8,null))[_0x963c('0x1f')](handleError(_0x5c51b8,null));};exports[_0x963c('0x6f')]=function(_0x31b7fb,_0x1b5dd9){var _0x54813c={'raw':![],'where':{}};var _0x9cf4b0={};var _0xa87ed8={'count':0x0,'rows':[]};return db[_0x963c('0x4b')]['findOne']({'where':{'id':_0x31b7fb['params']['id']}})['then'](handleEntityNotFound(_0x1b5dd9,null))['then'](function(_0x296658){if(_0x296658){_0x9cf4b0[_0x963c('0x4f')]=_[_0x963c('0x51')](db[_0x963c('0x6d')]['rawAttributes']);_0x9cf4b0['query']=_[_0x963c('0x51')](_0x31b7fb['query']);_0x9cf4b0[_0x963c('0x52')]=_[_0x963c('0x53')](_0x9cf4b0[_0x963c('0x4f')],_0x9cf4b0[_0x963c('0x50')]);_0x54813c[_0x963c('0x54')]=_['intersection'](_0x9cf4b0[_0x963c('0x4f')],qs[_0x963c('0x55')](_0x31b7fb[_0x963c('0x50')][_0x963c('0x55')]));_0x54813c['attributes']=_0x54813c[_0x963c('0x54')]['length']?_0x54813c[_0x963c('0x54')]:_0x9cf4b0[_0x963c('0x4f')];if(!_0x31b7fb['query'][_0x963c('0x57')](_0x963c('0x58'))){_0x54813c[_0x963c('0x59')]=qs[_0x963c('0x59')](_0x31b7fb[_0x963c('0x50')][_0x963c('0x59')]);_0x54813c[_0x963c('0x23')]=qs[_0x963c('0x23')](_0x31b7fb[_0x963c('0x50')]['offset']);}_0x54813c['order']=qs[_0x963c('0x5b')](_0x31b7fb[_0x963c('0x50')]['sort']);_0x54813c['where']=qs[_0x963c('0x52')](_[_0x963c('0x70')](_0x31b7fb[_0x963c('0x50')],_0x9cf4b0['filters']));_0x54813c['where'][_0x963c('0x6c')]=_0x296658['id'];if(_0x31b7fb[_0x963c('0x50')][_0x963c('0x5d')]){_0x54813c[_0x963c('0x5c')]=_[_0x963c('0x5e')](_0x54813c[_0x963c('0x5c')],{'$or':_['map'](_0x54813c[_0x963c('0x54')],function(_0x37916e){var _0x510637={};_0x510637[_0x37916e]={'$like':'%'+_0x31b7fb['query'][_0x963c('0x5d')]+'%'};return _0x510637;})});}_0x54813c=_[_0x963c('0x5e')]({},_0x54813c,_0x31b7fb[_0x963c('0x5f')]);return db[_0x963c('0x6d')]['count']({'where':_0x54813c['where']})[_0x963c('0x14')](function(_0x34547b){_0xa87ed8[_0x963c('0x25')]=_0x34547b;if(_0x31b7fb['query'][_0x963c('0x60')]){_0x54813c[_0x963c('0x61')]=[{'all':!![]}];}return db[_0x963c('0x6d')][_0x963c('0x62')](_0x54813c);})[_0x963c('0x14')](function(_0x511ddb){_0xa87ed8['rows']=_0x511ddb;return _0xa87ed8;});}})[_0x963c('0x14')](respondWithFilteredResult(_0x1b5dd9,_0x54813c))[_0x963c('0x1f')](handleError(_0x1b5dd9,null));};exports[_0x963c('0x71')]=function(_0x1bf6f8,_0x12ae32){return db[_0x963c('0x4b')][_0x963c('0x72')]({'where':{'id':_0x1bf6f8[_0x963c('0x64')]['id']}})[_0x963c('0x14')](handleEntityNotFound(_0x12ae32,null))[_0x963c('0x14')](function(_0x5b7c37){if(_0x5b7c37){return _0x5b7c37[_0x963c('0x71')](_0x1bf6f8[_0x963c('0x50')][_0x963c('0x73')]);}})[_0x963c('0x14')](respondWithStatusCode(_0x12ae32,null))[_0x963c('0x1f')](handleError(_0x12ae32,null));};exports[_0x963c('0x74')]=function(_0x39a35a,_0x210504){if(_0x39a35a[_0x963c('0x67')]['id']){delete _0x39a35a[_0x963c('0x67')]['id'];}return db[_0x963c('0x4b')]['find']({'where':{'id':_0x39a35a[_0x963c('0x64')]['id']}})[_0x963c('0x14')](handleEntityNotFound(_0x210504,null))['then'](function(_0x3e1e80){if(_0x3e1e80){_0x39a35a[_0x963c('0x67')]['MailAccountId']=_0x3e1e80['id'];return db[_0x963c('0x75')][_0x963c('0x6e')](_0x39a35a[_0x963c('0x67')]);}})[_0x963c('0x14')](respondWithResult(_0x210504,null))[_0x963c('0x1f')](handleError(_0x210504,null));};exports[_0x963c('0x76')]=function(_0x3427e0,_0x3d1bc6){var _0x285ac6={'raw':![],'where':{}};var _0x5cf8cd={};var _0x32ef50={'count':0x0,'rows':[]};return db['MailAccount'][_0x963c('0x77')]({'where':{'id':_0x3427e0['params']['id']}})['then'](handleEntityNotFound(_0x3d1bc6,null))[_0x963c('0x14')](function(_0x3b7f46){if(_0x3b7f46){_0x5cf8cd['model']=_[_0x963c('0x51')](db['CannedAnswer'][_0x963c('0x4c')]);_0x5cf8cd[_0x963c('0x50')]=_[_0x963c('0x51')](_0x3427e0[_0x963c('0x50')]);_0x5cf8cd[_0x963c('0x52')]=_['intersection'](_0x5cf8cd[_0x963c('0x4f')],_0x5cf8cd[_0x963c('0x50')]);_0x285ac6[_0x963c('0x54')]=_[_0x963c('0x53')](_0x5cf8cd[_0x963c('0x4f')],qs['fields'](_0x3427e0['query'][_0x963c('0x55')]));_0x285ac6[_0x963c('0x54')]=_0x285ac6['attributes'][_0x963c('0x56')]?_0x285ac6[_0x963c('0x54')]:_0x5cf8cd[_0x963c('0x4f')];if(!_0x3427e0[_0x963c('0x50')][_0x963c('0x57')](_0x963c('0x58'))){_0x285ac6[_0x963c('0x59')]=qs['limit'](_0x3427e0[_0x963c('0x50')]['limit']);_0x285ac6['offset']=qs[_0x963c('0x23')](_0x3427e0[_0x963c('0x50')]['offset']);}_0x285ac6[_0x963c('0x5a')]=qs[_0x963c('0x5b')](_0x3427e0['query'][_0x963c('0x5b')]);_0x285ac6[_0x963c('0x5c')]=qs[_0x963c('0x52')](_['pick'](_0x3427e0['query'],_0x5cf8cd[_0x963c('0x52')]));_0x285ac6['where'][_0x963c('0x6c')]=_0x3b7f46['id'];if(_0x3427e0[_0x963c('0x50')][_0x963c('0x5d')]){_0x285ac6[_0x963c('0x5c')]=_[_0x963c('0x5e')](_0x285ac6[_0x963c('0x5c')],{'$or':_[_0x963c('0x4a')](_0x285ac6[_0x963c('0x54')],function(_0x1709ee){var _0x92dfdc={};_0x92dfdc[_0x1709ee]={'$like':'%'+_0x3427e0['query'][_0x963c('0x5d')]+'%'};return _0x92dfdc;})});}_0x285ac6=_[_0x963c('0x5e')]({},_0x285ac6,_0x3427e0[_0x963c('0x5f')]);return db[_0x963c('0x75')]['count']({'where':_0x285ac6['where']})[_0x963c('0x14')](function(_0x4da1a0){_0x32ef50[_0x963c('0x25')]=_0x4da1a0;if(_0x3427e0['query'][_0x963c('0x60')]){_0x285ac6[_0x963c('0x61')]=[{'all':!![]}];}return db['CannedAnswer'][_0x963c('0x62')](_0x285ac6);})[_0x963c('0x14')](function(_0x3b49d8){_0x32ef50['rows']=_0x3b49d8;return _0x32ef50;});}})[_0x963c('0x14')](respondWithFilteredResult(_0x3d1bc6,_0x285ac6))['catch'](handleError(_0x3d1bc6,null));};exports[_0x963c('0x78')]=function(_0x380347,_0x42a110){return db[_0x963c('0x4b')][_0x963c('0x72')]({'where':{'id':_0x380347[_0x963c('0x64')]['id']}})['then'](handleEntityNotFound(_0x42a110,null))[_0x963c('0x14')](function(_0x3c2427){if(_0x3c2427){return _0x3c2427[_0x963c('0x78')](_0x380347[_0x963c('0x50')][_0x963c('0x73')]);}})[_0x963c('0x14')](respondWithStatusCode(_0x42a110,null))[_0x963c('0x1f')](handleError(_0x42a110,null));};exports[_0x963c('0x6e')]=function(_0x2b3bf3,_0x2105ca){var _0x2ac40f={'name':_0x2b3bf3[_0x963c('0x67')][_0x963c('0x2d')],'key':_0x2b3bf3[_0x963c('0x67')][_0x963c('0x79')],'provider':_0x2b3bf3[_0x963c('0x67')][_0x963c('0x7a')]===_0x963c('0x68')?null:_0x2b3bf3[_0x963c('0x67')][_0x963c('0x7a')],'email':_0x2b3bf3[_0x963c('0x67')][_0x963c('0x7b')],'ListId':_0x2b3bf3[_0x963c('0x67')][_0x963c('0x7c')],'active':!_[_0x963c('0x7d')](_0x2b3bf3[_0x963c('0x67')][_0x963c('0x7e')])?_0x2b3bf3[_0x963c('0x67')][_0x963c('0x7e')]:!![],'description':_0x2b3bf3[_0x963c('0x67')][_0x963c('0x7f')]||null};var _0x3ce0c9=getAuthenticationOptions(_0x2ac40f[_0x963c('0x7a')],_0x2b3bf3[_0x963c('0x67')]);_0x2ac40f[_0x963c('0x45')]=_0x3ce0c9['Imap'];_0x2ac40f[_0x963c('0x46')]=_0x3ce0c9['Smtp'];return db['MailAccount'][_0x963c('0x6e')](_0x2ac40f,{'include':[{'model':db[_0x963c('0x65')],'as':_0x963c('0x46')},{'model':db[_0x963c('0x48')],'as':_0x963c('0x45')}]})[_0x963c('0x14')](function(_0x3849d5){var _0x24b3f9=_0x2b3bf3['user']['get']({'plain':!![]});if(!_0x24b3f9)throw new Error(_0x963c('0x80'));if(_0x24b3f9[_0x963c('0x81')]===_0x963c('0x3b')){var _0x46e3f1=_0x3849d5[_0x963c('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x963c('0x72')]({'where':{'name':_0x963c('0x29'),'userProfileId':_0x24b3f9[_0x963c('0x82')]},'raw':!![]})['then'](function(_0x2765e6){if(_0x2765e6&&_0x2765e6[_0x963c('0x83')]===0x0){return db[_0x963c('0x2a')][_0x963c('0x6e')]({'name':_0x46e3f1[_0x963c('0x2d')],'resourceId':_0x46e3f1['id'],'type':_0x2765e6[_0x963c('0x2d')],'sectionId':_0x2765e6['id']},{})[_0x963c('0x14')](function(){return _0x3849d5;});}else{return _0x3849d5;}})[_0x963c('0x1f')](function(_0x42f94a){logger[_0x963c('0x1b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x42f94a);throw _0x42f94a;});}return _0x3849d5;})[_0x963c('0x14')](respondWithResult(_0x2105ca,0xc9))[_0x963c('0x1f')](handleError(_0x2105ca,null));};exports[_0x963c('0x84')]=function(_0x9a3d69,_0x5e88bc){return db[_0x963c('0x4b')][_0x963c('0x77')]({'where':{'id':_0x9a3d69[_0x963c('0x64')]['id']}})[_0x963c('0x14')](handleEntityNotFound(_0x5e88bc,null))[_0x963c('0x14')](function(_0x3c2871){if(_0x3c2871){return _0x3c2871[_0x963c('0x84')]();}return null;})[_0x963c('0x14')](respondWithResult(_0x5e88bc,null))[_0x963c('0x1f')](handleError(_0x5e88bc,null));};exports[_0x963c('0x85')]=function(_0x37c2bf,_0x5440f0){if(_0x37c2bf[_0x963c('0x67')]['id']){delete _0x37c2bf['body']['id'];}return db[_0x963c('0x4b')][_0x963c('0x72')]({'where':{'id':_0x37c2bf['params']['id']}})[_0x963c('0x14')](handleEntityNotFound(_0x5440f0,null))[_0x963c('0x14')](function(_0x12fe27){if(_0x12fe27){_0x37c2bf[_0x963c('0x67')][_0x963c('0x6c')]=_0x12fe27['id'];return db[_0x963c('0x48')]['create'](_0x37c2bf[_0x963c('0x67')]);}})[_0x963c('0x14')](respondWithResult(_0x5440f0,null))[_0x963c('0x1f')](handleError(_0x5440f0,null));};exports[_0x963c('0x86')]=function(_0x34a2fd,_0x244b82){return db[_0x963c('0x4b')][_0x963c('0x77')]({'where':{'id':_0x34a2fd[_0x963c('0x64')]['id']}})['then'](handleEntityNotFound(_0x244b82,null))[_0x963c('0x14')](function(_0xfd661c){if(_0xfd661c){return _0xfd661c['setImap'](null);}return null;})[_0x963c('0x14')](respondWithStatusCode(_0x244b82,null))['catch'](handleError(_0x244b82,null));};exports[_0x963c('0x87')]=function(_0x48e05f,_0x2af19c){return db[_0x963c('0x4b')]['findOne']({'where':{'id':_0x48e05f[_0x963c('0x64')]['id']}})[_0x963c('0x14')](handleEntityNotFound(_0x2af19c,null))['then'](function(_0x3ccc1b){if(_0x3ccc1b){return _0x3ccc1b[_0x963c('0x87')]();}return null;})['then'](respondWithResult(_0x2af19c,null))[_0x963c('0x1f')](handleError(_0x2af19c,null));};exports[_0x963c('0x88')]=function(_0x48badf,_0xfd9716){if(_0x48badf[_0x963c('0x67')]['id']){delete _0x48badf[_0x963c('0x67')]['id'];}return db[_0x963c('0x4b')][_0x963c('0x72')]({'where':{'id':_0x48badf[_0x963c('0x64')]['id']}})[_0x963c('0x14')](handleEntityNotFound(_0xfd9716,null))[_0x963c('0x14')](function(_0x3fd9c4){if(_0x3fd9c4){_0x48badf[_0x963c('0x67')][_0x963c('0x6c')]=_0x3fd9c4['id'];return db[_0x963c('0x65')]['create'](_0x48badf[_0x963c('0x67')]);}})[_0x963c('0x14')](respondWithResult(_0xfd9716,null))[_0x963c('0x1f')](handleError(_0xfd9716,null));};exports[_0x963c('0x89')]=function(_0x4d3a7c,_0x25ea26){return db[_0x963c('0x4b')][_0x963c('0x77')]({'where':{'id':_0x4d3a7c['params']['id']}})['then'](handleEntityNotFound(_0x25ea26,null))[_0x963c('0x14')](function(_0x360762){if(_0x360762){return _0x360762['setSmtp'](null);}return null;})[_0x963c('0x14')](respondWithStatusCode(_0x25ea26,null))[_0x963c('0x1f')](handleError(_0x25ea26,null));};exports[_0x963c('0x8a')]=function(_0x301ded,_0x525be8){return db[_0x963c('0x8b')][_0x963c('0x72')]({'where':{'id':_0x301ded[_0x963c('0x64')]['id']}})[_0x963c('0x14')](handleEntityNotFound(_0x525be8,null))[_0x963c('0x14')](function(_0x273d78){if(_0x273d78){return _0x273d78['addInteraction'](_0x301ded['body'][_0x963c('0x73')],_['omit'](_0x301ded[_0x963c('0x67')],[_0x963c('0x73'),'id'])||{});}})[_0x963c('0x14')](respondWithResult(_0x525be8,null))[_0x963c('0x1f')](handleError(_0x525be8,null));};exports['getInteractions']=function(_0xa1ec74,_0x1395ff){var _0x444947={'raw':![],'where':{}};var _0x125a86={};var _0x3ae1b6={'count':0x0,'rows':[]};return db[_0x963c('0x4b')][_0x963c('0x77')]({'where':{'id':_0xa1ec74[_0x963c('0x64')]['id']}})[_0x963c('0x14')](handleEntityNotFound(_0x1395ff,null))['then'](function(_0x4b06d5){if(_0x4b06d5){_0x125a86[_0x963c('0x4f')]=_[_0x963c('0x51')](db[_0x963c('0x8b')][_0x963c('0x4c')]);_0x125a86[_0x963c('0x50')]=_['keys'](_0xa1ec74[_0x963c('0x50')]);_0x125a86[_0x963c('0x52')]=_[_0x963c('0x53')](_0x125a86[_0x963c('0x4f')],_0x125a86[_0x963c('0x50')]);_0x444947['attributes']=_[_0x963c('0x53')](_0x125a86[_0x963c('0x4f')],qs[_0x963c('0x55')](_0xa1ec74[_0x963c('0x50')][_0x963c('0x55')]));_0x444947['attributes']=_0x444947['attributes'][_0x963c('0x56')]?_0x444947[_0x963c('0x54')]:_0x125a86[_0x963c('0x4f')];if(!_0xa1ec74[_0x963c('0x50')][_0x963c('0x57')](_0x963c('0x58'))){_0x444947[_0x963c('0x59')]=qs[_0x963c('0x59')](_0xa1ec74['query']['limit']);_0x444947[_0x963c('0x23')]=qs[_0x963c('0x23')](_0xa1ec74[_0x963c('0x50')][_0x963c('0x23')]);}_0x444947[_0x963c('0x5a')]=qs['sort'](_0xa1ec74[_0x963c('0x50')]['sort']);_0x444947[_0x963c('0x5c')]=qs['filters'](_[_0x963c('0x70')](_0xa1ec74[_0x963c('0x50')],_0x125a86['filters']));_0x444947[_0x963c('0x5c')][_0x963c('0x6c')]=_0x4b06d5['id'];if(_0xa1ec74[_0x963c('0x50')]['filter']){_0x444947[_0x963c('0x5c')]=_['merge'](_0x444947[_0x963c('0x5c')],{'$or':_['map'](_0x444947['attributes'],function(_0xa6cf91){var _0x545592={};_0x545592[_0xa6cf91]={'$like':'%'+_0xa1ec74['query'][_0x963c('0x5d')]+'%'};return _0x545592;})});}_0x444947=_[_0x963c('0x5e')]({},_0x444947,_0xa1ec74[_0x963c('0x5f')]);return db[_0x963c('0x8b')][_0x963c('0x25')]({'where':_0x444947[_0x963c('0x5c')]})[_0x963c('0x14')](function(_0x1bf8d9){_0x3ae1b6[_0x963c('0x25')]=_0x1bf8d9;if(_0xa1ec74[_0x963c('0x50')]['includeAll']){_0x444947['include']=[{'model':db[_0x963c('0x8c')],'as':_0x963c('0x8d'),'required':![]},{'model':db['User'],'as':_0x963c('0x8e'),'attributes':[_0x963c('0x2d'),'fullname',_0x963c('0x8f')],'required':![]},{'model':db[_0x963c('0x90')],'as':_0x963c('0x91'),'attributes':['id',_0x963c('0x2d'),'color'],'where':_0xa1ec74['query'][_0x963c('0x92')]?{'id':_0xa1ec74[_0x963c('0x50')]['tag']}:undefined,'required':_0xa1ec74[_0x963c('0x50')][_0x963c('0x92')]?!![]:![]}];}return db[_0x963c('0x8b')][_0x963c('0x62')](_0x444947);})['then'](function(_0x37881f){_0x3ae1b6[_0x963c('0x93')]=_0x37881f;return _0x3ae1b6;});}})[_0x963c('0x14')](respondWithFilteredResult(_0x1395ff,_0x444947))['catch'](handleError(_0x1395ff,null));};exports[_0x963c('0x94')]=function addApplications(_0xe04de6,_0x43acd0){var _0x396803=_0xe04de6[_0x963c('0x64')]['id'];var _0x96f964=_0xe04de6['body'];var _0x4c5024=0xc8;var _0x389ed4=null;return db['sequelize'][_0x963c('0x95')]({'isolationLevel':db[_0x963c('0x96')]['Transaction'][_0x963c('0x97')]['READ_COMMITTED']},function(_0x21c5ec){return db['MailAccount'][_0x963c('0x77')]({'where':{'id':_0x396803},'transaction':_0x21c5ec})['then'](function(_0x33a32c){if(_0x33a32c){return db['MailApplication'][_0x963c('0x2b')]({'where':{'MailAccountId':_0x396803},'transaction':_0x21c5ec})[_0x963c('0x14')](function(){var _0x3bf09b=_[_0x963c('0x4a')](_0x96f964,function(_0x47d78d){_0x47d78d[_0x963c('0x6c')]=_0x396803;return _0x47d78d;});return db[_0x963c('0x98')]['bulkCreate'](_0x3bf09b,{'transaction':_0x21c5ec});});}else{_0x4c5024=0x194;_0x389ed4=[];}});})[_0x963c('0x14')](function(){if(_0x4c5024!==0x194){return db['MailApplication'][_0x963c('0x99')]({'where':{'MailAccountId':_0x396803},'order':'priority'})['then'](function(_0x45e731){_0x389ed4=_0x45e731;});}})['catch'](function(_0x422886){_0x4c5024=0x1f4;logger[_0x963c('0x1b')](_0x422886[_0x963c('0x2c')]);if(_0x422886[_0x963c('0x2d')]){delete _0x422886[_0x963c('0x2d')];}_0x389ed4=_0x422886;})[_0x963c('0x9a')](function(){if(_0x389ed4===null){_0x43acd0[_0x963c('0x20')](_0x4c5024);}else{if(_0x4c5024===0x1f4){_0x43acd0[_0x963c('0x26')](_0x4c5024)[_0x963c('0x2e')](_0x389ed4);}else{_0x43acd0[_0x963c('0x26')](_0x4c5024)['json'](_0x389ed4);}}});};exports[_0x963c('0x9b')]=function(_0x12df54,_0x1b5a25){var _0x3482d2={};var _0xc50a46={};var _0x2d35a4;var _0xe97370;return db[_0x963c('0x4b')][_0x963c('0x77')]({'where':{'id':_0x12df54[_0x963c('0x64')]['id']}})[_0x963c('0x14')](handleEntityNotFound(_0x1b5a25,null))['then'](function(_0x3e3279){if(_0x3e3279){_0x2d35a4=_0x3e3279;_0xc50a46[_0x963c('0x4f')]=_[_0x963c('0x51')](db[_0x963c('0x98')][_0x963c('0x4c')]);_0xc50a46[_0x963c('0x50')]=_[_0x963c('0x51')](_0x12df54[_0x963c('0x50')]);_0xc50a46[_0x963c('0x52')]=_['intersection'](_0xc50a46['model'],_0xc50a46[_0x963c('0x50')]);_0x3482d2['attributes']=_['intersection'](_0xc50a46[_0x963c('0x4f')],qs[_0x963c('0x55')](_0x12df54[_0x963c('0x50')]['fields']));_0x3482d2[_0x963c('0x54')]=_0x3482d2[_0x963c('0x54')][_0x963c('0x56')]?_0x3482d2['attributes']:_0xc50a46['model'];_0x3482d2['order']=qs[_0x963c('0x5b')](_0x12df54[_0x963c('0x50')][_0x963c('0x5b')]);_0x3482d2[_0x963c('0x5c')]=qs['filters'](_[_0x963c('0x70')](_0x12df54[_0x963c('0x50')],_0xc50a46[_0x963c('0x52')]));if(_0x12df54['query']['filter']){_0x3482d2[_0x963c('0x5c')]=_[_0x963c('0x5e')](_0x3482d2[_0x963c('0x5c')],{'$or':_['map'](_0x3482d2[_0x963c('0x54')],function(_0x2b949b){var _0x7a5da8={};_0x7a5da8[_0x2b949b]={'$like':'%'+_0x12df54['query'][_0x963c('0x5d')]+'%'};return _0x7a5da8;})});}_0x3482d2=_[_0x963c('0x5e')]({},_0x3482d2,_0x12df54['options']);return _0x2d35a4[_0x963c('0x9b')](_0x3482d2);}})[_0x963c('0x14')](function(_0x151da5){if(_0x151da5){_0xe97370=_0x151da5[_0x963c('0x56')];if(!_0x12df54[_0x963c('0x50')][_0x963c('0x57')](_0x963c('0x58'))){_0x3482d2[_0x963c('0x59')]=qs[_0x963c('0x59')](_0x12df54[_0x963c('0x50')][_0x963c('0x59')]);_0x3482d2['offset']=qs[_0x963c('0x23')](_0x12df54[_0x963c('0x50')][_0x963c('0x23')]);}return _0x2d35a4[_0x963c('0x9b')](_0x3482d2);}})['then'](function(_0xb6bd36){if(_0xb6bd36){return _0xb6bd36?{'count':_0xe97370,'rows':_0xb6bd36}:null;}})[_0x963c('0x14')](respondWithResult(_0x1b5a25,null))[_0x963c('0x1f')](handleError(_0x1b5a25,null));};exports[_0x963c('0x9c')]=function(_0x4cd6c2,_0x5a568b){var _0x4ae76f={'raw':!![],'where':{}};var _0x1cb90e={};var _0x8b6176={'count':0x0,'rows':[]};return db[_0x963c('0x4b')][_0x963c('0x77')]({'where':{'id':_0x4cd6c2[_0x963c('0x64')]['id']}})[_0x963c('0x14')](handleEntityNotFound(_0x5a568b,null))['then'](function(_0x168e7b){if(_0x168e7b){_0x1cb90e[_0x963c('0x4f')]=_[_0x963c('0x51')](db[_0x963c('0x9d')][_0x963c('0x4c')]);_0x1cb90e[_0x963c('0x50')]=_[_0x963c('0x51')](_0x4cd6c2[_0x963c('0x50')]);_0x1cb90e['filters']=_[_0x963c('0x53')](_0x1cb90e[_0x963c('0x4f')],_0x1cb90e[_0x963c('0x50')]);_0x4ae76f[_0x963c('0x54')]=_[_0x963c('0x53')](_0x1cb90e['model'],qs[_0x963c('0x55')](_0x4cd6c2['query'][_0x963c('0x55')]));_0x4ae76f[_0x963c('0x54')]=_0x4ae76f['attributes'][_0x963c('0x56')]?_0x4ae76f[_0x963c('0x54')]:_0x1cb90e['model'];if(!_0x4cd6c2['query'][_0x963c('0x57')]('nolimit')){_0x4ae76f[_0x963c('0x59')]=qs[_0x963c('0x59')](_0x4cd6c2[_0x963c('0x50')][_0x963c('0x59')]);_0x4ae76f[_0x963c('0x23')]=qs[_0x963c('0x23')](_0x4cd6c2[_0x963c('0x50')][_0x963c('0x23')]);}_0x4ae76f['order']=qs['sort'](_0x4cd6c2[_0x963c('0x50')][_0x963c('0x5b')]);_0x4ae76f['where']=qs['filters'](_[_0x963c('0x70')](_0x4cd6c2[_0x963c('0x50')],_0x1cb90e[_0x963c('0x52')]));_0x4ae76f['where'][_0x963c('0x6c')]=_0x168e7b['id'];if(_0x4cd6c2[_0x963c('0x50')][_0x963c('0x5d')]){_0x4ae76f[_0x963c('0x5c')]=_['merge'](_0x4ae76f[_0x963c('0x5c')],{'$or':_[_0x963c('0x4a')](_0x4ae76f[_0x963c('0x54')],function(_0x5c9ad3){var _0x14e786={};_0x14e786[_0x5c9ad3]={'$like':'%'+_0x4cd6c2[_0x963c('0x50')]['filter']+'%'};return _0x14e786;})});}if(_0x4cd6c2[_0x963c('0x50')][_0x963c('0x9e')]){var _0x290615=_0x4cd6c2[_0x963c('0x50')][_0x963c('0x9e')][_0x963c('0x9f')](',');var _0x2a200d={};_0x2a200d[_0x290615[0x0]]={'$gte':moment(_0x290615[0x1])['format'](_0x963c('0xa0'))};_0x4ae76f[_0x963c('0x5c')]=_['merge'](_0x4ae76f[_0x963c('0x5c')],_0x2a200d);}_0x4ae76f=_[_0x963c('0x5e')]({},_0x4ae76f,_0x4cd6c2[_0x963c('0x5f')]);return db[_0x963c('0x9d')][_0x963c('0x25')]({'where':_0x4ae76f[_0x963c('0x5c')]})['then'](function(_0x2c5609){_0x8b6176[_0x963c('0x25')]=_0x2c5609;if(_0x4cd6c2['query'][_0x963c('0x60')]){_0x4ae76f[_0x963c('0x61')]=[{'all':!![]}];}return db['MailMessage'][_0x963c('0x62')](_0x4ae76f);})['then'](function(_0x4b2656){if(_0x4cd6c2['query']['inlineCss']===_0x963c('0xa1')){for(var _0x173d92=0x0;_0x173d92<_0x4b2656[_0x963c('0x56')];_0x173d92++){_0x4b2656[_0x173d92][_0x963c('0x67')]=juice(_0x4b2656[_0x173d92]['body']);}}_0x8b6176[_0x963c('0x93')]=_0x4b2656;return _0x8b6176;});}})[_0x963c('0x14')](respondWithFilteredResult(_0x5a568b,_0x4ae76f))['catch'](handleError(_0x5a568b,null));};exports[_0x963c('0x2e')]=function(_0x135f9e,_0x1517c3){var _0x3d28b3,_0x435c7={},_0x51072e;if(_0x135f9e['body']['to']){_0x51072e=_0x135f9e['body']['to'][_0x963c('0x9f')](',')[0x0];}return db[_0x963c('0x4b')][_0x963c('0x72')]({'where':{'id':_0x135f9e[_0x963c('0x64')]['id']},'include':[{'model':db[_0x963c('0xa2')],'as':_0x963c('0xa3'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x51072e},'limit':0x1,'order':[[_0x963c('0xa4'),'DESC']]}]},{'model':db['MailServerOut'],'as':_0x963c('0x46'),'raw':!![],'include':[{'model':db[_0x963c('0xa5')],'as':'CloudProvider','raw':!![]}]}]})[_0x963c('0x14')](handleEntityNotFound(_0x1517c3,null))['then'](function(_0x5454c0){if(!_0x5454c0)return;_0x3d28b3=_0x5454c0;if(!_0x5454c0[_0x963c('0x46')])throw new Error(_0x963c('0xa6'));if(_[_0x963c('0x7d')](_0x135f9e[_0x963c('0x67')][_0x963c('0xa7')])){_0x135f9e['body'][_0x963c('0xa7')]=util['format'](_0x963c('0xa8'),_0x5454c0[_0x963c('0x2d')],_0x5454c0[_0x963c('0x7b')]||_0x5454c0['Smtp'][_0x963c('0x3b')]);}if(_0x135f9e[_0x963c('0x67')][_0x963c('0xa9')]&&_0x135f9e['body']['attachments'][_0x963c('0x56')]){for(var _0x349675=0x0;_0x349675<_0x135f9e[_0x963c('0x67')][_0x963c('0xa9')][_0x963c('0x56')];_0x349675+=0x1){_0x135f9e[_0x963c('0x67')]['attachments'][_0x349675]={'filename':_0x135f9e[_0x963c('0x67')]['attachments'][_0x349675][_0x963c('0x2d')],'path':path[_0x963c('0xaa')](config[_0x963c('0xab')],_0x963c('0xac'),_0x135f9e[_0x963c('0x67')][_0x963c('0xa9')][_0x349675][_0x963c('0xad')])};}}var _0x555ee2=_0x5454c0['getSmtpOptions']();return respondWithRpcPromise(_0x963c('0xae'),'sendMail',{'account':_0x555ee2,'message':_0x135f9e[_0x963c('0x67')]});})[_0x963c('0x14')](function(_0x5aac44){if(!_0x5aac44)return;_0x435c7=_0x5aac44;if(!_0x3d28b3['List'])throw new Error('List\x20not\x20found');if(_0x3d28b3[_0x963c('0xa3')][_0x963c('0xaf')]['length'])return _0x3d28b3[_0x963c('0xa3')][_0x963c('0xaf')][0x0];return db[_0x963c('0x8c')][_0x963c('0x6e')](_[_0x963c('0xb')](_0x135f9e['body'],{'firstName':_0x135f9e['body']['to'],'email':_0x135f9e[_0x963c('0x67')]['to'],'phone':_0x135f9e[_0x963c('0x67')]['to'],'ListId':_0x3d28b3[_0x963c('0x7c')]}));})[_0x963c('0x14')](function(_0x574116){if(!_0x574116)return;var _0x5138e0={'UserId':_0x135f9e[_0x963c('0x3b')]['id'],'ContactId':_0x574116['id'],'MailAccountId':_0x3d28b3['id'],'inReplyTo':_0x435c7[_0x963c('0xb0')],'to':_0x135f9e[_0x963c('0x67')][_0x963c('0xa7')],'cc':_0x135f9e['body']['cc'],'subject':_0x135f9e[_0x963c('0x67')][_0x963c('0xb1')],'attach':_0x135f9e[_0x963c('0x67')][_0x963c('0xb2')],'firstMsgDirection':_0x963c('0xb3'),'lastMsgAt':moment()[_0x963c('0xb4')](_0x963c('0xa0')),'lastMsgDirection':_0x963c('0xb3'),'Messages':[_['merge'](_0x135f9e[_0x963c('0x67')],{'messageId':_0x435c7[_0x963c('0xb0')],'sentAt':moment()[_0x963c('0xb4')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x3d28b3['id'],'UserId':_0x135f9e[_0x963c('0x3b')]['id'],'ContactId':_0x574116['id']})]};if(_0x135f9e[_0x963c('0x67')][_0x963c('0xb5')]){_0x5138e0=_[_0x963c('0x5e')](_0x5138e0,_0x135f9e['body'][_0x963c('0xb5')]);}return db['MailInteraction'][_0x963c('0x6e')](_0x5138e0,{'include':[{'model':db[_0x963c('0x9d')],'as':_0x963c('0xb6')}]});})[_0x963c('0x14')](respondWithResult(_0x1517c3,null))[_0x963c('0x1f')](handleError(_0x1517c3,null));};exports['verifySmtp']=function(_0x521e9b,_0x36070f){return db[_0x963c('0x4b')][_0x963c('0x72')]({'where':{'id':_0x521e9b['params']['id']},'include':[{'model':db[_0x963c('0x65')],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x963c('0xa5'),'raw':!![]}]}]})[_0x963c('0x14')](handleEntityNotFound(_0x36070f,null))[_0x963c('0x14')](function(_0x48d0e4){if(!_0x48d0e4[_0x963c('0x46')])return;var _0x229e6c=_0x48d0e4[_0x963c('0xb7')]();return respondWithRpcPromise('VerifySmtp',_0x963c('0xb8'),{'account':_0x229e6c});})[_0x963c('0x14')](respondWithResult(_0x36070f,null))[_0x963c('0x1f')](handleError(_0x36070f,null));};exports['destroy']=function(_0x547d20,_0x24ec3f){return db[_0x963c('0x4b')][_0x963c('0x72')]({'where':{'id':_0x547d20[_0x963c('0x64')]['id']}})[_0x963c('0x14')](handleEntityNotFound(_0x24ec3f,null))[_0x963c('0x14')](function(_0x59e178){if(_0x59e178&&_0x59e178['service']){throw new db[(_0x963c('0xb9'))][(_0x963c('0xba'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x59e178;})[_0x963c('0x14')](removeEntity(_0x24ec3f,null))[_0x963c('0x1f')](handleError(_0x24ec3f,null));};exports['addAgents']=function(_0x1f953a,_0x3df71e){return db[_0x963c('0x4b')][_0x963c('0x72')]({'where':{'id':_0x1f953a[_0x963c('0x64')]['id']}})['then'](handleEntityNotFound(_0x3df71e,null))['then'](function(_0x19ec16){if(_0x19ec16){return _0x19ec16['addAgents'](_0x1f953a[_0x963c('0x67')]['ids'],_[_0x963c('0xbb')](_0x1f953a[_0x963c('0x67')],[_0x963c('0x73'),'id'])||{})[_0x963c('0xbc')](function(_0x20cbfa){for(var _0x3a23fe=0x0;_0x3a23fe<_0x1f953a[_0x963c('0x67')][_0x963c('0x73')][_0x963c('0x56')];_0x3a23fe+=0x1){socket[_0x963c('0xbd')]('userMailAccount:save',{'UserId':Number(_0x1f953a[_0x963c('0x67')][_0x963c('0x73')][_0x3a23fe]),'MailAccountId':Number(_0x1f953a[_0x963c('0x64')]['id'])});}return _0x20cbfa;});}})[_0x963c('0x14')](respondWithResult(_0x3df71e,null))[_0x963c('0x1f')](handleError(_0x3df71e,null));};exports['removeAgents']=function(_0x4c4764,_0x1b89e3){return db['MailAccount']['find']({'where':{'id':_0x4c4764[_0x963c('0x64')]['id']}})['then'](handleEntityNotFound(_0x1b89e3,null))['then'](function(_0x19949f){if(_0x19949f){return _0x19949f[_0x963c('0xbe')](_0x4c4764[_0x963c('0x50')][_0x963c('0x73')])[_0x963c('0x14')](function(){if(_[_0x963c('0xbf')](_0x4c4764[_0x963c('0x50')][_0x963c('0x73')])){for(var _0x4f40c6=0x0;_0x4f40c6<_0x4c4764['query'][_0x963c('0x73')]['length'];_0x4f40c6+=0x1){socket[_0x963c('0xbd')](_0x963c('0xc0'),{'UserId':Number(_0x4c4764['query']['ids'][_0x4f40c6]),'MailAccountId':Number(_0x4c4764[_0x963c('0x64')]['id'])});}}else{socket['emit'](_0x963c('0xc0'),{'UserId':Number(_0x4c4764[_0x963c('0x50')][_0x963c('0x73')]),'MailAccountId':Number(_0x4c4764['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1b89e3,null))[_0x963c('0x1f')](handleError(_0x1b89e3,null));};exports[_0x963c('0xc1')]=function(_0x20ed5c,_0x325346){var _0x520de2={};var _0xfec01a={};var _0x416af0;var _0x363218;return db['MailAccount'][_0x963c('0x77')]({'where':{'id':_0x20ed5c[_0x963c('0x64')]['id']}})['then'](handleEntityNotFound(_0x325346,null))[_0x963c('0x14')](function(_0x437bcc){if(_0x437bcc){_0x416af0=_0x437bcc;_0xfec01a[_0x963c('0x4f')]=_['keys'](db[_0x963c('0xc2')][_0x963c('0x4c')]);_0xfec01a[_0x963c('0x50')]=_[_0x963c('0x51')](_0x20ed5c[_0x963c('0x50')]);_0xfec01a['filters']=_[_0x963c('0x53')](_0xfec01a[_0x963c('0x4f')],_0xfec01a[_0x963c('0x50')]);_0x520de2[_0x963c('0x54')]=_['intersection'](_0xfec01a[_0x963c('0x4f')],qs[_0x963c('0x55')](_0x20ed5c[_0x963c('0x50')]['fields']));_0x520de2[_0x963c('0x54')]=_0x520de2[_0x963c('0x54')][_0x963c('0x56')]?_0x520de2[_0x963c('0x54')]:_0xfec01a['model'];_0x520de2[_0x963c('0x5a')]=qs[_0x963c('0x5b')](_0x20ed5c[_0x963c('0x50')]['sort']);_0x520de2['where']=qs[_0x963c('0x52')](_[_0x963c('0x70')](_0x20ed5c[_0x963c('0x50')],_0xfec01a[_0x963c('0x52')]));if(_0x20ed5c[_0x963c('0x50')][_0x963c('0x5d')]){_0x520de2[_0x963c('0x5c')]=_[_0x963c('0x5e')](_0x520de2[_0x963c('0x5c')],{'$or':_['map'](_0x520de2[_0x963c('0x54')],function(_0x41ab03){var _0x107128={};_0x107128[_0x41ab03]={'$like':'%'+_0x20ed5c[_0x963c('0x50')][_0x963c('0x5d')]+'%'};return _0x107128;})});}_0x520de2=_['merge']({},_0x520de2,_0x20ed5c[_0x963c('0x5f')]);return _0x416af0[_0x963c('0xc1')](_0x520de2);}})[_0x963c('0x14')](function(_0x1aaf18){if(_0x1aaf18){_0x363218=_0x1aaf18[_0x963c('0x56')];if(!_0x20ed5c[_0x963c('0x50')][_0x963c('0x57')](_0x963c('0x58'))){_0x520de2['limit']=qs[_0x963c('0x59')](_0x20ed5c[_0x963c('0x50')][_0x963c('0x59')]);_0x520de2[_0x963c('0x23')]=qs[_0x963c('0x23')](_0x20ed5c[_0x963c('0x50')][_0x963c('0x23')]);}return _0x416af0[_0x963c('0xc1')](_0x520de2);}})[_0x963c('0x14')](function(_0xdde057){if(_0xdde057){return _0xdde057?{'count':_0x363218,'rows':_0xdde057}:null;}})[_0x963c('0x14')](respondWithResult(_0x325346,null))['catch'](handleError(_0x325346,null));}; \ No newline at end of file +var _0x167a=['getImap','addImap','setImap','getSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','Tag','color','tag','addApplications','sequelize','transaction','MailApplication','priority','finally','getApplications','getMessages','MailMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','CloudProvider','Smtp\x20configuration\x20not\x20found','from','format','attachments','join','root','server/files/attachments','getSmtpOptions','SendMail','sendMail','List\x20not\x20found','defaults','ListId','messageId','subject','attach','out','Interaction','Messages','verifySmtp','VerifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','userMailAccount:save','removeAgents','isArray','emit','userMailAccount:remove','getAgents','moment','bluebird','util','path','juice','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./mailAccount.socket','register','client','request','then','info','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','update','destroy','get','MailAccounts','stack','name','send','gmail','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook.office365.com','Unknown\x20email\x20service\x20provider','smtp.mail.yahoo.com','smtp-mail.outlook.com','outlook365','smtp.office365.com','user','password','pass','modernAuthentication','CloudProviderId','port','host','secure','service','username','authentication','Imap','Smtp','MailServerIn','MailServerOut','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','rows','show','params','includeAll','find','body','provider','custom','Mail\x20Account\x20not\x20found','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','isNil','active','description','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x1a1e00,_0x7464ca){var _0x4b44ae=function(_0x4f72f0){while(--_0x4f72f0){_0x1a1e00['push'](_0x1a1e00['shift']());}};_0x4b44ae(++_0x7464ca);}(_0x167a,0x1c7));var _0xa167=function(_0x4ac6c5,_0x232988){_0x4ac6c5=_0x4ac6c5-0x0;var _0x410f9c=_0x167a[_0x4ac6c5];return _0x410f9c;};'use strict';var moment=require(_0xa167('0x0'));var BPromise=require(_0xa167('0x1'));var util=require(_0xa167('0x2'));var path=require(_0xa167('0x3'));var _=require('lodash');var juice=require(_0xa167('0x4'));var Redis=require('ioredis');var qs=require('../../components/parsers/qs');var logger=require(_0xa167('0x5'))(_0xa167('0x6'));var config=require(_0xa167('0x7'));var db=require('../../mysqldb')['db'];config[_0xa167('0x8')]=_['defaults'](config['redis'],{'host':_0xa167('0x9'),'port':0x18eb});var socket=require(_0xa167('0xa'))(new Redis(config['redis']));require(_0xa167('0xb'))[_0xa167('0xc')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa167('0xd')]['http']({'port':0x232b});function respondWithRpcPromise(_0x452f17,_0x4a7a70,_0xf31bb0,_0x5656df){return new BPromise(function(_0x1c7c8d,_0x44693c){var _0x367a6b=_0x5656df||client;return _0x367a6b[_0xa167('0xe')](_0x452f17,_0xf31bb0)[_0xa167('0xf')](function(_0x3de3ff){logger[_0xa167('0x10')]('MailAccount,\x20%s,\x20%s',_0x4a7a70,'request\x20sent');logger[_0xa167('0x11')](_0xa167('0x12'),_0x4a7a70,_0xa167('0x13'),JSON[_0xa167('0x14')](_0x3de3ff));if(_0x3de3ff[_0xa167('0x15')]){if(_0x3de3ff[_0xa167('0x15')][_0xa167('0x16')]===0x1f4){logger[_0xa167('0x15')](_0xa167('0x17'),_0x4a7a70,_0x3de3ff[_0xa167('0x15')][_0xa167('0x18')]);return _0x44693c(_0x3de3ff[_0xa167('0x15')][_0xa167('0x18')]);}logger['error'](_0xa167('0x17'),_0x4a7a70,_0x3de3ff[_0xa167('0x15')][_0xa167('0x18')]);return _0x1c7c8d(_0x3de3ff[_0xa167('0x15')][_0xa167('0x18')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x4a7a70,_0xa167('0x13'));_0x1c7c8d(_0x3de3ff[_0xa167('0x19')][_0xa167('0x18')]);}})[_0xa167('0x1a')](function(_0x585622){logger[_0xa167('0x15')](_0xa167('0x17'),_0x4a7a70,_0x585622);_0x44693c(_0x585622);});});}function respondWithStatusCode(_0x332005,_0x32f693){_0x32f693=_0x32f693||0xcc;return function(_0x5f1525){if(_0x5f1525){return _0x332005[_0xa167('0x1b')](_0x32f693);}return _0x332005['status'](_0x32f693)[_0xa167('0x1c')]();};}function respondWithResult(_0x42bcf3,_0x531086){_0x531086=_0x531086||0xc8;return function(_0x395158){if(_0x395158){return _0x42bcf3['status'](_0x531086)[_0xa167('0x1d')](_0x395158);}};}function respondWithFilteredResult(_0x156ce4,_0x583c76){return function(_0x58b675){if(_0x58b675){var _0x38d927=typeof _0x583c76[_0xa167('0x1e')]===_0xa167('0x1f')&&typeof _0x583c76[_0xa167('0x20')]===_0xa167('0x1f');var _0x25c681=_0x58b675[_0xa167('0x21')];var _0x54dde3=_0x38d927?0x0:_0x583c76[_0xa167('0x1e')];var _0x594f1f=_0x38d927?_0x58b675[_0xa167('0x21')]:_0x583c76[_0xa167('0x1e')]+_0x583c76[_0xa167('0x20')];var _0x25bb34;if(_0x594f1f>=_0x25c681){_0x594f1f=_0x25c681;_0x25bb34=0xc8;}else{_0x25bb34=0xce;}_0x156ce4[_0xa167('0x22')](_0x25bb34);return _0x156ce4[_0xa167('0x23')](_0xa167('0x24'),_0x54dde3+'-'+_0x594f1f+'/'+_0x25c681)[_0xa167('0x1d')](_0x58b675);}return null;};}function saveUpdates(_0x5a45a3){return function(_0x390526){if(_0x390526){return _0x390526[_0xa167('0x25')](_0x5a45a3)[_0xa167('0xf')](function(_0x54f7e2){return _0x54f7e2;});}return null;};}function removeEntity(_0x50aaac){return function(_0x4e13ea){if(_0x4e13ea){return _0x4e13ea[_0xa167('0x26')]()[_0xa167('0xf')](function(){var _0x26896b=_0x4e13ea[_0xa167('0x27')]({'plain':!![]});var _0x20be6e=_0xa167('0x28');return db['UserProfileResource'][_0xa167('0x26')]({'where':{'type':_0x20be6e,'resourceId':_0x26896b['id']}})[_0xa167('0xf')](function(){return _0x4e13ea;});})[_0xa167('0xf')](function(){_0x50aaac[_0xa167('0x22')](0xcc)[_0xa167('0x1c')]();});}};}function handleEntityNotFound(_0x507574){return function(_0x3d8044){if(!_0x3d8044){_0x507574['sendStatus'](0x194);}return _0x3d8044;};}function handleError(_0x14d0b7,_0x300030){_0x300030=_0x300030||0x1f4;return function(_0x31e17a){logger['error'](_0x31e17a[_0xa167('0x29')]);if(_0x31e17a['name']){delete _0x31e17a[_0xa167('0x2a')];}_0x14d0b7[_0xa167('0x22')](_0x300030)[_0xa167('0x2b')](_0x31e17a);};}function getImapHost(_0x41dd79){switch(_0x41dd79){case _0xa167('0x2c'):return _0xa167('0x2d');case _0xa167('0x2e'):return _0xa167('0x2f');case _0xa167('0x30'):return'imap-mail.outlook.com';case'outlook365':return _0xa167('0x31');}throw new Error(_0xa167('0x32'),_0x41dd79);}function getSmtpHost(_0x2cdfed){switch(_0x2cdfed){case _0xa167('0x2c'):return'smtp.gmail.com';case _0xa167('0x2e'):return _0xa167('0x33');case _0xa167('0x30'):return _0xa167('0x34');case _0xa167('0x35'):return _0xa167('0x36');}throw new Error(_0xa167('0x32'),_0x2cdfed);}function getAuthenticationOptions(_0x565550,_0x203c0a){var _0x5a6a29={};var _0x24a70f={};if(_0x565550){_0x5a6a29[_0xa167('0x37')]=_0x24a70f[_0xa167('0x37')]=_0x203c0a['username'];_0x5a6a29[_0xa167('0x38')]=_0x24a70f[_0xa167('0x39')]=_0x203c0a['password'];if(_0x203c0a[_0xa167('0x3a')]){_0x5a6a29[_0xa167('0x3a')]=_0x24a70f['modernAuthentication']=!![];_0x5a6a29[_0xa167('0x3b')]=_0x24a70f['CloudProviderId']=_0x203c0a[_0xa167('0x3b')];_0x5a6a29['password']=_0x24a70f[_0xa167('0x39')]=null;}else{_0x5a6a29[_0xa167('0x3b')]=_0x24a70f[_0xa167('0x3b')]=null;}_0x5a6a29['host']=getImapHost(_0x565550);_0x5a6a29[_0xa167('0x3c')]=0x3e1;_0x24a70f[_0xa167('0x3d')]=getSmtpHost(_0x565550);_0x24a70f[_0xa167('0x3c')]=0x24b;_0x24a70f[_0xa167('0x3e')]=![];_0x5a6a29[_0xa167('0x3f')]=_0x24a70f[_0xa167('0x3f')]=null;}else{if(_0x203c0a['authentication']){_0x5a6a29[_0xa167('0x37')]=_0x24a70f[_0xa167('0x37')]=_0x203c0a[_0xa167('0x40')];_0x5a6a29[_0xa167('0x38')]=_0x24a70f[_0xa167('0x39')]=_0x203c0a[_0xa167('0x38')];}else{_0x5a6a29[_0xa167('0x41')]=_0x24a70f[_0xa167('0x41')]=![];_0x5a6a29[_0xa167('0x37')]=_0x24a70f[_0xa167('0x37')]=null;_0x5a6a29[_0xa167('0x38')]=_0x24a70f[_0xa167('0x39')]=null;}_0x5a6a29[_0xa167('0x3d')]=_0x203c0a[_0xa167('0x42')][_0xa167('0x3d')];_0x5a6a29['port']=_0x203c0a['Imap'][_0xa167('0x3c')];_0x24a70f[_0xa167('0x3d')]=_0x203c0a[_0xa167('0x43')][_0xa167('0x3d')];_0x24a70f['port']=_0x203c0a[_0xa167('0x43')][_0xa167('0x3c')];}return{'Imap':_0x5a6a29,'Smtp':_0x24a70f};}exports['index']=function(_0x214384,_0x32d7a2){var _0x31f060={'include':[{'model':db[_0xa167('0x44')],'as':'Imap'},{'model':db[_0xa167('0x45')],'as':_0xa167('0x43')},{'model':db[_0xa167('0x46')],'as':_0xa167('0x47')}]},_0x59a81d={},_0xdd1b07={'count':0x0,'rows':[]};var _0x5c07f1=_[_0xa167('0x48')](db[_0xa167('0x49')][_0xa167('0x4a')],function(_0x551605){return{'name':_0x551605['fieldName'],'type':_0x551605['type'][_0xa167('0x4b')]};});_0x59a81d[_0xa167('0x4c')]=_[_0xa167('0x48')](_0x5c07f1,'name');_0x59a81d[_0xa167('0x4d')]=_[_0xa167('0x4e')](_0x214384[_0xa167('0x4d')]);_0x59a81d[_0xa167('0x4f')]=_['intersection'](_0x59a81d['model'],_0x59a81d[_0xa167('0x4d')]);_0x31f060[_0xa167('0x50')]=_[_0xa167('0x51')](_0x59a81d[_0xa167('0x4c')],qs[_0xa167('0x52')](_0x214384[_0xa167('0x4d')]['fields']));_0x31f060['attributes']=_0x31f060[_0xa167('0x50')][_0xa167('0x53')]?_0x31f060['attributes']:_0x59a81d[_0xa167('0x4c')];if(!_0x214384[_0xa167('0x4d')][_0xa167('0x54')](_0xa167('0x55'))){_0x31f060[_0xa167('0x20')]=qs[_0xa167('0x20')](_0x214384[_0xa167('0x4d')][_0xa167('0x20')]);_0x31f060[_0xa167('0x1e')]=qs[_0xa167('0x1e')](_0x214384['query'][_0xa167('0x1e')]);}_0x31f060[_0xa167('0x56')]=qs[_0xa167('0x57')](_0x214384[_0xa167('0x4d')][_0xa167('0x57')]);_0x31f060[_0xa167('0x58')]=qs[_0xa167('0x4f')](_['pick'](_0x214384[_0xa167('0x4d')],_0x59a81d[_0xa167('0x4f')]),_0x5c07f1);if(_0x214384[_0xa167('0x4d')][_0xa167('0x59')]){_0x31f060[_0xa167('0x58')]=_['merge'](_0x31f060[_0xa167('0x58')],{'$or':_[_0xa167('0x48')](_0x5c07f1,function(_0x202667){if(_0x202667['type']!==_0xa167('0x5a')){var _0x11e88b={};_0x11e88b[_0x202667[_0xa167('0x2a')]]={'$like':'%'+_0x214384[_0xa167('0x4d')][_0xa167('0x59')]+'%'};return _0x11e88b;}})});}_0x31f060=_[_0xa167('0x5b')]({},_0x31f060,_0x214384[_0xa167('0x5c')]);var _0x208904={'where':_0x31f060[_0xa167('0x58')]};return db[_0xa167('0x49')][_0xa167('0x21')](_0x208904)[_0xa167('0xf')](function(_0x1862a7){_0xdd1b07[_0xa167('0x21')]=_0x1862a7;if(_0x214384[_0xa167('0x4d')]['includeAll']){_0x31f060[_0xa167('0x5d')]=[{'all':!![]}];}return db['MailAccount'][_0xa167('0x5e')](_0x31f060);})[_0xa167('0xf')](function(_0x5c9773){_0xdd1b07[_0xa167('0x5f')]=_0x5c9773;return _0xdd1b07;})[_0xa167('0xf')](respondWithFilteredResult(_0x32d7a2,_0x31f060))['catch'](handleError(_0x32d7a2,null));};exports[_0xa167('0x60')]=function(_0x4c00b7,_0x39229c){var _0x17cf01={'raw':![],'where':{'id':_0x4c00b7[_0xa167('0x61')]['id']},'include':[{'model':db[_0xa167('0x44')],'as':_0xa167('0x42')},{'model':db[_0xa167('0x45')],'as':_0xa167('0x43')},{'model':db[_0xa167('0x46')],'as':_0xa167('0x47')}]},_0x20e9df={};_0x20e9df['model']=_['keys'](db[_0xa167('0x49')][_0xa167('0x4a')]);_0x20e9df[_0xa167('0x4d')]=_[_0xa167('0x4e')](_0x4c00b7[_0xa167('0x4d')]);_0x20e9df['filters']=_[_0xa167('0x51')](_0x20e9df[_0xa167('0x4c')],_0x20e9df[_0xa167('0x4d')]);_0x17cf01[_0xa167('0x50')]=_[_0xa167('0x51')](_0x20e9df['model'],qs['fields'](_0x4c00b7[_0xa167('0x4d')][_0xa167('0x52')]));_0x17cf01['attributes']=_0x17cf01[_0xa167('0x50')]['length']?_0x17cf01[_0xa167('0x50')]:_0x20e9df['model'];if(_0x4c00b7['query'][_0xa167('0x62')]){_0x17cf01[_0xa167('0x5d')]=[{'all':!![]}];}_0x17cf01=_[_0xa167('0x5b')]({},_0x17cf01,_0x4c00b7['options']);return db[_0xa167('0x49')][_0xa167('0x63')](_0x17cf01)[_0xa167('0xf')](handleEntityNotFound(_0x39229c,null))[_0xa167('0xf')](respondWithResult(_0x39229c,null))[_0xa167('0x1a')](handleError(_0x39229c,null));};exports[_0xa167('0x25')]=function(_0x2730ea,_0x511daa){if(_0x2730ea[_0xa167('0x64')]['id']){delete _0x2730ea[_0xa167('0x64')]['id'];}var _0x59b134=_0x2730ea[_0xa167('0x64')][_0xa167('0x65')]===_0xa167('0x66')?null:_0x2730ea[_0xa167('0x64')]['provider'];var _0x3c2c15=_0x2730ea['body'][_0xa167('0x42')]||{};var _0x562164=_0x2730ea[_0xa167('0x64')]['Smtp']||{};if(_0x59b134){_0x3c2c15[_0xa167('0x3d')]=getImapHost(_0x59b134);_0x3c2c15['port']=0x3e1;_0x562164[_0xa167('0x3d')]=getSmtpHost(_0x59b134);_0x562164[_0xa167('0x3c')]=0x24b;_0x562164['secure']=![];}if(_0x562164[_0xa167('0x3a')]){_0x562164[_0xa167('0x3e')]=![];}else{_0x562164[_0xa167('0x3b')]=null;}if(!_0x3c2c15[_0xa167('0x3a')])_0x3c2c15['CloudProviderId']=null;_0x2730ea[_0xa167('0x64')][_0xa167('0x42')]=_0x3c2c15;_0x2730ea[_0xa167('0x64')][_0xa167('0x43')]=_0x562164;return db[_0xa167('0x49')][_0xa167('0x63')]({'where':{'id':_0x2730ea[_0xa167('0x61')]['id']},'include':[{'model':db[_0xa167('0x44')],'as':'Imap'},{'model':db[_0xa167('0x45')],'as':_0xa167('0x43')},{'model':db[_0xa167('0x46')],'as':_0xa167('0x47')}]})[_0xa167('0xf')](handleEntityNotFound(_0x511daa,null))[_0xa167('0xf')](function(_0x4bd08e){if(!_0x4bd08e)throw new Error(_0xa167('0x67'));if(_0x4bd08e[_0xa167('0x3f')])delete _0x2730ea[_0xa167('0x64')]['Imap'];return _0x4bd08e;})[_0xa167('0xf')](saveUpdates(_0x2730ea[_0xa167('0x64')],null))[_0xa167('0xf')](function(_0x27cd0f){if(!_0x2730ea[_0xa167('0x64')][_0xa167('0x42')])return _0x27cd0f;return db[_0xa167('0x44')]['update'](_0x2730ea[_0xa167('0x64')][_0xa167('0x42')],{'where':{'MailAccountId':_0x27cd0f['id']}})[_0xa167('0xf')](function(){return _0x27cd0f;});})[_0xa167('0xf')](function(_0x4779cf){if(!_0x2730ea[_0xa167('0x64')]['Smtp'])return _0x4779cf;return db[_0xa167('0x45')][_0xa167('0x25')](_0x2730ea[_0xa167('0x64')][_0xa167('0x43')],{'where':{'MailAccountId':_0x4779cf['id']}})[_0xa167('0xf')](function(){return _0x4779cf;});})[_0xa167('0xf')](respondWithResult(_0x511daa,null))['catch'](handleError(_0x511daa,null));};exports[_0xa167('0x68')]=function(_0x2611ad,_0x4056a8){return db[_0xa167('0x49')][_0xa167('0x68')]()[_0xa167('0xf')](respondWithResult(_0x4056a8,null))[_0xa167('0x1a')](handleError(_0x4056a8,null));};exports[_0xa167('0x69')]=function(_0x9c0d1,_0x4c0178){if(_0x9c0d1[_0xa167('0x64')]['id']){delete _0x9c0d1['body']['id'];}return db['MailAccount'][_0xa167('0x63')]({'where':{'id':_0x9c0d1['params']['id']}})['then'](handleEntityNotFound(_0x4c0178,null))[_0xa167('0xf')](function(_0x1b8a72){if(_0x1b8a72){_0x9c0d1[_0xa167('0x64')][_0xa167('0x6a')]=_0x1b8a72['id'];return db[_0xa167('0x6b')][_0xa167('0x6c')](_0x9c0d1[_0xa167('0x64')]);}})[_0xa167('0xf')](respondWithResult(_0x4c0178,null))[_0xa167('0x1a')](handleError(_0x4c0178,null));};exports[_0xa167('0x6d')]=function(_0x4d8578,_0x198517){var _0x50a9b8={'raw':![],'where':{}};var _0x45b020={};var _0x8bc052={'count':0x0,'rows':[]};return db[_0xa167('0x49')][_0xa167('0x6e')]({'where':{'id':_0x4d8578[_0xa167('0x61')]['id']}})[_0xa167('0xf')](handleEntityNotFound(_0x198517,null))[_0xa167('0xf')](function(_0x182abb){if(_0x182abb){_0x45b020[_0xa167('0x4c')]=_['keys'](db['Disposition'][_0xa167('0x4a')]);_0x45b020[_0xa167('0x4d')]=_[_0xa167('0x4e')](_0x4d8578[_0xa167('0x4d')]);_0x45b020[_0xa167('0x4f')]=_[_0xa167('0x51')](_0x45b020[_0xa167('0x4c')],_0x45b020[_0xa167('0x4d')]);_0x50a9b8[_0xa167('0x50')]=_[_0xa167('0x51')](_0x45b020[_0xa167('0x4c')],qs[_0xa167('0x52')](_0x4d8578[_0xa167('0x4d')][_0xa167('0x52')]));_0x50a9b8[_0xa167('0x50')]=_0x50a9b8['attributes'][_0xa167('0x53')]?_0x50a9b8['attributes']:_0x45b020[_0xa167('0x4c')];if(!_0x4d8578[_0xa167('0x4d')]['hasOwnProperty'](_0xa167('0x55'))){_0x50a9b8[_0xa167('0x20')]=qs[_0xa167('0x20')](_0x4d8578[_0xa167('0x4d')][_0xa167('0x20')]);_0x50a9b8[_0xa167('0x1e')]=qs[_0xa167('0x1e')](_0x4d8578['query'][_0xa167('0x1e')]);}_0x50a9b8[_0xa167('0x56')]=qs[_0xa167('0x57')](_0x4d8578[_0xa167('0x4d')]['sort']);_0x50a9b8[_0xa167('0x58')]=qs[_0xa167('0x4f')](_[_0xa167('0x6f')](_0x4d8578[_0xa167('0x4d')],_0x45b020['filters']));_0x50a9b8[_0xa167('0x58')][_0xa167('0x6a')]=_0x182abb['id'];if(_0x4d8578[_0xa167('0x4d')][_0xa167('0x59')]){_0x50a9b8[_0xa167('0x58')]=_[_0xa167('0x5b')](_0x50a9b8[_0xa167('0x58')],{'$or':_[_0xa167('0x48')](_0x50a9b8['attributes'],function(_0x234b18){var _0x450203={};_0x450203[_0x234b18]={'$like':'%'+_0x4d8578[_0xa167('0x4d')]['filter']+'%'};return _0x450203;})});}_0x50a9b8=_[_0xa167('0x5b')]({},_0x50a9b8,_0x4d8578[_0xa167('0x5c')]);return db[_0xa167('0x6b')][_0xa167('0x21')]({'where':_0x50a9b8[_0xa167('0x58')]})[_0xa167('0xf')](function(_0x364358){_0x8bc052[_0xa167('0x21')]=_0x364358;if(_0x4d8578[_0xa167('0x4d')][_0xa167('0x62')]){_0x50a9b8['include']=[{'all':!![]}];}return db[_0xa167('0x6b')][_0xa167('0x5e')](_0x50a9b8);})[_0xa167('0xf')](function(_0x56ad59){_0x8bc052[_0xa167('0x5f')]=_0x56ad59;return _0x8bc052;});}})[_0xa167('0xf')](respondWithFilteredResult(_0x198517,_0x50a9b8))['catch'](handleError(_0x198517,null));};exports[_0xa167('0x70')]=function(_0x156b1b,_0x5dd8ea){return db[_0xa167('0x49')]['find']({'where':{'id':_0x156b1b['params']['id']}})['then'](handleEntityNotFound(_0x5dd8ea,null))[_0xa167('0xf')](function(_0x265556){if(_0x265556){return _0x265556[_0xa167('0x70')](_0x156b1b[_0xa167('0x4d')][_0xa167('0x71')]);}})['then'](respondWithStatusCode(_0x5dd8ea,null))[_0xa167('0x1a')](handleError(_0x5dd8ea,null));};exports[_0xa167('0x72')]=function(_0x436c08,_0x2184e7){if(_0x436c08[_0xa167('0x64')]['id']){delete _0x436c08[_0xa167('0x64')]['id'];}return db['MailAccount'][_0xa167('0x63')]({'where':{'id':_0x436c08[_0xa167('0x61')]['id']}})[_0xa167('0xf')](handleEntityNotFound(_0x2184e7,null))['then'](function(_0x1aef4f){if(_0x1aef4f){_0x436c08[_0xa167('0x64')]['MailAccountId']=_0x1aef4f['id'];return db[_0xa167('0x73')][_0xa167('0x6c')](_0x436c08[_0xa167('0x64')]);}})['then'](respondWithResult(_0x2184e7,null))[_0xa167('0x1a')](handleError(_0x2184e7,null));};exports[_0xa167('0x74')]=function(_0x524089,_0x1b4ce2){var _0x42dfb9={'raw':![],'where':{}};var _0x486ac0={};var _0x4f78b9={'count':0x0,'rows':[]};return db[_0xa167('0x49')]['findOne']({'where':{'id':_0x524089['params']['id']}})[_0xa167('0xf')](handleEntityNotFound(_0x1b4ce2,null))['then'](function(_0x2851ad){if(_0x2851ad){_0x486ac0[_0xa167('0x4c')]=_[_0xa167('0x4e')](db[_0xa167('0x73')]['rawAttributes']);_0x486ac0[_0xa167('0x4d')]=_[_0xa167('0x4e')](_0x524089[_0xa167('0x4d')]);_0x486ac0[_0xa167('0x4f')]=_[_0xa167('0x51')](_0x486ac0['model'],_0x486ac0[_0xa167('0x4d')]);_0x42dfb9[_0xa167('0x50')]=_[_0xa167('0x51')](_0x486ac0[_0xa167('0x4c')],qs[_0xa167('0x52')](_0x524089[_0xa167('0x4d')][_0xa167('0x52')]));_0x42dfb9[_0xa167('0x50')]=_0x42dfb9[_0xa167('0x50')][_0xa167('0x53')]?_0x42dfb9[_0xa167('0x50')]:_0x486ac0[_0xa167('0x4c')];if(!_0x524089[_0xa167('0x4d')]['hasOwnProperty'](_0xa167('0x55'))){_0x42dfb9[_0xa167('0x20')]=qs['limit'](_0x524089[_0xa167('0x4d')]['limit']);_0x42dfb9['offset']=qs['offset'](_0x524089[_0xa167('0x4d')][_0xa167('0x1e')]);}_0x42dfb9['order']=qs[_0xa167('0x57')](_0x524089[_0xa167('0x4d')][_0xa167('0x57')]);_0x42dfb9[_0xa167('0x58')]=qs[_0xa167('0x4f')](_[_0xa167('0x6f')](_0x524089['query'],_0x486ac0['filters']));_0x42dfb9[_0xa167('0x58')][_0xa167('0x6a')]=_0x2851ad['id'];if(_0x524089['query'][_0xa167('0x59')]){_0x42dfb9[_0xa167('0x58')]=_['merge'](_0x42dfb9['where'],{'$or':_[_0xa167('0x48')](_0x42dfb9[_0xa167('0x50')],function(_0x2d943d){var _0x143672={};_0x143672[_0x2d943d]={'$like':'%'+_0x524089['query'][_0xa167('0x59')]+'%'};return _0x143672;})});}_0x42dfb9=_[_0xa167('0x5b')]({},_0x42dfb9,_0x524089[_0xa167('0x5c')]);return db[_0xa167('0x73')][_0xa167('0x21')]({'where':_0x42dfb9['where']})[_0xa167('0xf')](function(_0x1bdef7){_0x4f78b9['count']=_0x1bdef7;if(_0x524089[_0xa167('0x4d')]['includeAll']){_0x42dfb9['include']=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x42dfb9);})[_0xa167('0xf')](function(_0x178383){_0x4f78b9[_0xa167('0x5f')]=_0x178383;return _0x4f78b9;});}})[_0xa167('0xf')](respondWithFilteredResult(_0x1b4ce2,_0x42dfb9))[_0xa167('0x1a')](handleError(_0x1b4ce2,null));};exports[_0xa167('0x75')]=function(_0x16f34b,_0x592f90){return db[_0xa167('0x49')][_0xa167('0x63')]({'where':{'id':_0x16f34b[_0xa167('0x61')]['id']}})[_0xa167('0xf')](handleEntityNotFound(_0x592f90,null))[_0xa167('0xf')](function(_0xc2b7e1){if(_0xc2b7e1){return _0xc2b7e1[_0xa167('0x75')](_0x16f34b[_0xa167('0x4d')][_0xa167('0x71')]);}})[_0xa167('0xf')](respondWithStatusCode(_0x592f90,null))[_0xa167('0x1a')](handleError(_0x592f90,null));};exports[_0xa167('0x6c')]=function(_0x28d91a,_0x3dc9ad){var _0x3acc2e={'name':_0x28d91a['body'][_0xa167('0x2a')],'key':_0x28d91a['body'][_0xa167('0x4b')],'provider':_0x28d91a[_0xa167('0x64')][_0xa167('0x65')]===_0xa167('0x66')?null:_0x28d91a[_0xa167('0x64')][_0xa167('0x65')],'email':_0x28d91a[_0xa167('0x64')][_0xa167('0x76')],'ListId':_0x28d91a[_0xa167('0x64')]['ListId'],'active':!_[_0xa167('0x77')](_0x28d91a[_0xa167('0x64')]['active'])?_0x28d91a[_0xa167('0x64')][_0xa167('0x78')]:!![],'description':_0x28d91a[_0xa167('0x64')][_0xa167('0x79')]||null};var _0x29db7f=getAuthenticationOptions(_0x3acc2e['provider'],_0x28d91a[_0xa167('0x64')]);_0x3acc2e['Imap']=_0x29db7f[_0xa167('0x42')];_0x3acc2e['Smtp']=_0x29db7f[_0xa167('0x43')];return db[_0xa167('0x49')]['create'](_0x3acc2e,{'include':[{'model':db[_0xa167('0x45')],'as':'Smtp'},{'model':db[_0xa167('0x44')],'as':_0xa167('0x42')}]})[_0xa167('0xf')](function(_0x30287c){var _0x1e6a95=_0x28d91a[_0xa167('0x37')]['get']({'plain':!![]});if(!_0x1e6a95)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e6a95[_0xa167('0x7a')]===_0xa167('0x37')){var _0x1ccfd2=_0x30287c[_0xa167('0x27')]({'plain':!![]});return db[_0xa167('0x7b')][_0xa167('0x63')]({'where':{'name':'MailAccounts','userProfileId':_0x1e6a95[_0xa167('0x7c')]},'raw':!![]})[_0xa167('0xf')](function(_0x462672){if(_0x462672&&_0x462672['autoAssociation']===0x0){return db[_0xa167('0x7d')][_0xa167('0x6c')]({'name':_0x1ccfd2[_0xa167('0x2a')],'resourceId':_0x1ccfd2['id'],'type':_0x462672[_0xa167('0x2a')],'sectionId':_0x462672['id']},{})[_0xa167('0xf')](function(){return _0x30287c;});}else{return _0x30287c;}})[_0xa167('0x1a')](function(_0x1adf7c){logger[_0xa167('0x15')](_0xa167('0x7e'),_0x1adf7c);throw _0x1adf7c;});}return _0x30287c;})['then'](respondWithResult(_0x3dc9ad,0xc9))[_0xa167('0x1a')](handleError(_0x3dc9ad,null));};exports[_0xa167('0x7f')]=function(_0xbf894,_0x2458fa){return db['MailAccount'][_0xa167('0x6e')]({'where':{'id':_0xbf894['params']['id']}})[_0xa167('0xf')](handleEntityNotFound(_0x2458fa,null))[_0xa167('0xf')](function(_0xc9244d){if(_0xc9244d){return _0xc9244d[_0xa167('0x7f')]();}return null;})[_0xa167('0xf')](respondWithResult(_0x2458fa,null))[_0xa167('0x1a')](handleError(_0x2458fa,null));};exports[_0xa167('0x80')]=function(_0x48e8a6,_0x16dcb4){if(_0x48e8a6[_0xa167('0x64')]['id']){delete _0x48e8a6[_0xa167('0x64')]['id'];}return db[_0xa167('0x49')][_0xa167('0x63')]({'where':{'id':_0x48e8a6['params']['id']}})[_0xa167('0xf')](handleEntityNotFound(_0x16dcb4,null))[_0xa167('0xf')](function(_0x1be0bf){if(_0x1be0bf){_0x48e8a6[_0xa167('0x64')][_0xa167('0x6a')]=_0x1be0bf['id'];return db[_0xa167('0x44')][_0xa167('0x6c')](_0x48e8a6[_0xa167('0x64')]);}})['then'](respondWithResult(_0x16dcb4,null))[_0xa167('0x1a')](handleError(_0x16dcb4,null));};exports['removeImap']=function(_0x580d53,_0x567f54){return db[_0xa167('0x49')]['findOne']({'where':{'id':_0x580d53[_0xa167('0x61')]['id']}})[_0xa167('0xf')](handleEntityNotFound(_0x567f54,null))['then'](function(_0xc1b05f){if(_0xc1b05f){return _0xc1b05f[_0xa167('0x81')](null);}return null;})[_0xa167('0xf')](respondWithStatusCode(_0x567f54,null))[_0xa167('0x1a')](handleError(_0x567f54,null));};exports[_0xa167('0x82')]=function(_0x199211,_0x5e63e0){return db['MailAccount'][_0xa167('0x6e')]({'where':{'id':_0x199211[_0xa167('0x61')]['id']}})['then'](handleEntityNotFound(_0x5e63e0,null))[_0xa167('0xf')](function(_0x168d46){if(_0x168d46){return _0x168d46[_0xa167('0x82')]();}return null;})['then'](respondWithResult(_0x5e63e0,null))[_0xa167('0x1a')](handleError(_0x5e63e0,null));};exports['addSmtp']=function(_0x506bea,_0x1072f8){if(_0x506bea[_0xa167('0x64')]['id']){delete _0x506bea[_0xa167('0x64')]['id'];}return db[_0xa167('0x49')][_0xa167('0x63')]({'where':{'id':_0x506bea[_0xa167('0x61')]['id']}})[_0xa167('0xf')](handleEntityNotFound(_0x1072f8,null))['then'](function(_0x246515){if(_0x246515){_0x506bea[_0xa167('0x64')][_0xa167('0x6a')]=_0x246515['id'];return db['MailServerOut'][_0xa167('0x6c')](_0x506bea['body']);}})[_0xa167('0xf')](respondWithResult(_0x1072f8,null))[_0xa167('0x1a')](handleError(_0x1072f8,null));};exports['removeSmtp']=function(_0x288255,_0x163a73){return db[_0xa167('0x49')][_0xa167('0x6e')]({'where':{'id':_0x288255['params']['id']}})['then'](handleEntityNotFound(_0x163a73,null))[_0xa167('0xf')](function(_0x211864){if(_0x211864){return _0x211864[_0xa167('0x83')](null);}return null;})[_0xa167('0xf')](respondWithStatusCode(_0x163a73,null))[_0xa167('0x1a')](handleError(_0x163a73,null));};exports[_0xa167('0x84')]=function(_0x2b1b05,_0x2dee3d){return db[_0xa167('0x85')][_0xa167('0x63')]({'where':{'id':_0x2b1b05[_0xa167('0x61')]['id']}})['then'](handleEntityNotFound(_0x2dee3d,null))[_0xa167('0xf')](function(_0x100913){if(_0x100913){return _0x100913[_0xa167('0x84')](_0x2b1b05['body'][_0xa167('0x71')],_[_0xa167('0x86')](_0x2b1b05['body'],[_0xa167('0x71'),'id'])||{});}})[_0xa167('0xf')](respondWithResult(_0x2dee3d,null))[_0xa167('0x1a')](handleError(_0x2dee3d,null));};exports[_0xa167('0x87')]=function(_0x59a0a2,_0x2447f0){var _0x5a8919={'raw':![],'where':{}};var _0x156a5f={};var _0x4ebf90={'count':0x0,'rows':[]};return db[_0xa167('0x49')][_0xa167('0x6e')]({'where':{'id':_0x59a0a2[_0xa167('0x61')]['id']}})[_0xa167('0xf')](handleEntityNotFound(_0x2447f0,null))[_0xa167('0xf')](function(_0x5e3f84){if(_0x5e3f84){_0x156a5f[_0xa167('0x4c')]=_[_0xa167('0x4e')](db['MailInteraction']['rawAttributes']);_0x156a5f[_0xa167('0x4d')]=_['keys'](_0x59a0a2[_0xa167('0x4d')]);_0x156a5f[_0xa167('0x4f')]=_[_0xa167('0x51')](_0x156a5f[_0xa167('0x4c')],_0x156a5f[_0xa167('0x4d')]);_0x5a8919['attributes']=_[_0xa167('0x51')](_0x156a5f['model'],qs['fields'](_0x59a0a2[_0xa167('0x4d')][_0xa167('0x52')]));_0x5a8919[_0xa167('0x50')]=_0x5a8919[_0xa167('0x50')]['length']?_0x5a8919[_0xa167('0x50')]:_0x156a5f['model'];if(!_0x59a0a2[_0xa167('0x4d')][_0xa167('0x54')](_0xa167('0x55'))){_0x5a8919[_0xa167('0x20')]=qs['limit'](_0x59a0a2['query'][_0xa167('0x20')]);_0x5a8919[_0xa167('0x1e')]=qs[_0xa167('0x1e')](_0x59a0a2[_0xa167('0x4d')]['offset']);}_0x5a8919[_0xa167('0x56')]=qs['sort'](_0x59a0a2[_0xa167('0x4d')][_0xa167('0x57')]);_0x5a8919[_0xa167('0x58')]=qs['filters'](_[_0xa167('0x6f')](_0x59a0a2[_0xa167('0x4d')],_0x156a5f[_0xa167('0x4f')]));_0x5a8919[_0xa167('0x58')][_0xa167('0x6a')]=_0x5e3f84['id'];if(_0x59a0a2[_0xa167('0x4d')][_0xa167('0x59')]){_0x5a8919[_0xa167('0x58')]=_[_0xa167('0x5b')](_0x5a8919['where'],{'$or':_['map'](_0x5a8919[_0xa167('0x50')],function(_0xcbedad){var _0x2ab52c={};_0x2ab52c[_0xcbedad]={'$like':'%'+_0x59a0a2['query'][_0xa167('0x59')]+'%'};return _0x2ab52c;})});}_0x5a8919=_[_0xa167('0x5b')]({},_0x5a8919,_0x59a0a2[_0xa167('0x5c')]);return db[_0xa167('0x85')]['count']({'where':_0x5a8919[_0xa167('0x58')]})[_0xa167('0xf')](function(_0xc36f41){_0x4ebf90[_0xa167('0x21')]=_0xc36f41;if(_0x59a0a2[_0xa167('0x4d')][_0xa167('0x62')]){_0x5a8919[_0xa167('0x5d')]=[{'model':db[_0xa167('0x88')],'as':_0xa167('0x89'),'required':![]},{'model':db[_0xa167('0x8a')],'as':_0xa167('0x8b'),'attributes':[_0xa167('0x2a'),_0xa167('0x8c'),'internal'],'required':![]},{'model':db[_0xa167('0x8d')],'as':'Tags','attributes':['id','name',_0xa167('0x8e')],'where':_0x59a0a2[_0xa167('0x4d')]['tag']?{'id':_0x59a0a2[_0xa167('0x4d')][_0xa167('0x8f')]}:undefined,'required':_0x59a0a2[_0xa167('0x4d')][_0xa167('0x8f')]?!![]:![]}];}return db[_0xa167('0x85')]['findAll'](_0x5a8919);})['then'](function(_0x2490b6){_0x4ebf90['rows']=_0x2490b6;return _0x4ebf90;});}})[_0xa167('0xf')](respondWithFilteredResult(_0x2447f0,_0x5a8919))['catch'](handleError(_0x2447f0,null));};exports[_0xa167('0x90')]=function addApplications(_0x3d436f,_0x333c93){var _0x1fd1d4=_0x3d436f[_0xa167('0x61')]['id'];var _0x4d6a5b=_0x3d436f[_0xa167('0x64')];var _0x3894e0=0xc8;var _0x3d5ec0=null;return db[_0xa167('0x91')][_0xa167('0x92')]({'isolationLevel':db[_0xa167('0x91')]['Transaction']['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x3022cc){return db[_0xa167('0x49')][_0xa167('0x6e')]({'where':{'id':_0x1fd1d4},'transaction':_0x3022cc})['then'](function(_0x4b9d45){if(_0x4b9d45){return db[_0xa167('0x93')]['destroy']({'where':{'MailAccountId':_0x1fd1d4},'transaction':_0x3022cc})[_0xa167('0xf')](function(){var _0x599158=_[_0xa167('0x48')](_0x4d6a5b,function(_0x2626ad){_0x2626ad[_0xa167('0x6a')]=_0x1fd1d4;return _0x2626ad;});return db[_0xa167('0x93')]['bulkCreate'](_0x599158,{'transaction':_0x3022cc});});}else{_0x3894e0=0x194;_0x3d5ec0=[];}});})[_0xa167('0xf')](function(){if(_0x3894e0!==0x194){return db[_0xa167('0x93')]['findAndCountAll']({'where':{'MailAccountId':_0x1fd1d4},'order':_0xa167('0x94')})['then'](function(_0x44a2d9){_0x3d5ec0=_0x44a2d9;});}})[_0xa167('0x1a')](function(_0x341d46){_0x3894e0=0x1f4;logger[_0xa167('0x15')](_0x341d46[_0xa167('0x29')]);if(_0x341d46[_0xa167('0x2a')]){delete _0x341d46[_0xa167('0x2a')];}_0x3d5ec0=_0x341d46;})[_0xa167('0x95')](function(){if(_0x3d5ec0===null){_0x333c93['sendStatus'](_0x3894e0);}else{if(_0x3894e0===0x1f4){_0x333c93[_0xa167('0x22')](_0x3894e0)[_0xa167('0x2b')](_0x3d5ec0);}else{_0x333c93[_0xa167('0x22')](_0x3894e0)['json'](_0x3d5ec0);}}});};exports[_0xa167('0x96')]=function(_0x572869,_0x1e1ffc){var _0x2992a1={};var _0x5886b8={};var _0x6bb2e0;var _0x1d654e;return db[_0xa167('0x49')][_0xa167('0x6e')]({'where':{'id':_0x572869[_0xa167('0x61')]['id']}})[_0xa167('0xf')](handleEntityNotFound(_0x1e1ffc,null))[_0xa167('0xf')](function(_0x15a88b){if(_0x15a88b){_0x6bb2e0=_0x15a88b;_0x5886b8['model']=_[_0xa167('0x4e')](db['MailApplication']['rawAttributes']);_0x5886b8[_0xa167('0x4d')]=_[_0xa167('0x4e')](_0x572869[_0xa167('0x4d')]);_0x5886b8['filters']=_[_0xa167('0x51')](_0x5886b8[_0xa167('0x4c')],_0x5886b8[_0xa167('0x4d')]);_0x2992a1[_0xa167('0x50')]=_[_0xa167('0x51')](_0x5886b8[_0xa167('0x4c')],qs[_0xa167('0x52')](_0x572869[_0xa167('0x4d')][_0xa167('0x52')]));_0x2992a1[_0xa167('0x50')]=_0x2992a1[_0xa167('0x50')][_0xa167('0x53')]?_0x2992a1['attributes']:_0x5886b8[_0xa167('0x4c')];_0x2992a1[_0xa167('0x56')]=qs[_0xa167('0x57')](_0x572869[_0xa167('0x4d')]['sort']);_0x2992a1[_0xa167('0x58')]=qs[_0xa167('0x4f')](_['pick'](_0x572869[_0xa167('0x4d')],_0x5886b8['filters']));if(_0x572869[_0xa167('0x4d')][_0xa167('0x59')]){_0x2992a1[_0xa167('0x58')]=_[_0xa167('0x5b')](_0x2992a1[_0xa167('0x58')],{'$or':_[_0xa167('0x48')](_0x2992a1[_0xa167('0x50')],function(_0x1911d1){var _0x39c7dc={};_0x39c7dc[_0x1911d1]={'$like':'%'+_0x572869[_0xa167('0x4d')]['filter']+'%'};return _0x39c7dc;})});}_0x2992a1=_[_0xa167('0x5b')]({},_0x2992a1,_0x572869[_0xa167('0x5c')]);return _0x6bb2e0[_0xa167('0x96')](_0x2992a1);}})[_0xa167('0xf')](function(_0x9b1476){if(_0x9b1476){_0x1d654e=_0x9b1476['length'];if(!_0x572869['query'][_0xa167('0x54')](_0xa167('0x55'))){_0x2992a1[_0xa167('0x20')]=qs[_0xa167('0x20')](_0x572869['query'][_0xa167('0x20')]);_0x2992a1['offset']=qs['offset'](_0x572869[_0xa167('0x4d')][_0xa167('0x1e')]);}return _0x6bb2e0['getApplications'](_0x2992a1);}})['then'](function(_0x1993c1){if(_0x1993c1){return _0x1993c1?{'count':_0x1d654e,'rows':_0x1993c1}:null;}})[_0xa167('0xf')](respondWithResult(_0x1e1ffc,null))[_0xa167('0x1a')](handleError(_0x1e1ffc,null));};exports[_0xa167('0x97')]=function(_0x5254f8,_0x44168d){var _0x13d6ae={'raw':!![],'where':{}};var _0x3bfaaf={};var _0xab0f1d={'count':0x0,'rows':[]};return db[_0xa167('0x49')][_0xa167('0x6e')]({'where':{'id':_0x5254f8['params']['id']}})['then'](handleEntityNotFound(_0x44168d,null))[_0xa167('0xf')](function(_0x24f679){if(_0x24f679){_0x3bfaaf[_0xa167('0x4c')]=_[_0xa167('0x4e')](db[_0xa167('0x98')]['rawAttributes']);_0x3bfaaf[_0xa167('0x4d')]=_[_0xa167('0x4e')](_0x5254f8[_0xa167('0x4d')]);_0x3bfaaf[_0xa167('0x4f')]=_[_0xa167('0x51')](_0x3bfaaf['model'],_0x3bfaaf[_0xa167('0x4d')]);_0x13d6ae[_0xa167('0x50')]=_['intersection'](_0x3bfaaf[_0xa167('0x4c')],qs[_0xa167('0x52')](_0x5254f8[_0xa167('0x4d')][_0xa167('0x52')]));_0x13d6ae[_0xa167('0x50')]=_0x13d6ae[_0xa167('0x50')]['length']?_0x13d6ae['attributes']:_0x3bfaaf[_0xa167('0x4c')];if(!_0x5254f8[_0xa167('0x4d')][_0xa167('0x54')](_0xa167('0x55'))){_0x13d6ae['limit']=qs[_0xa167('0x20')](_0x5254f8[_0xa167('0x4d')][_0xa167('0x20')]);_0x13d6ae['offset']=qs[_0xa167('0x1e')](_0x5254f8[_0xa167('0x4d')][_0xa167('0x1e')]);}_0x13d6ae[_0xa167('0x56')]=qs['sort'](_0x5254f8[_0xa167('0x4d')]['sort']);_0x13d6ae[_0xa167('0x58')]=qs['filters'](_[_0xa167('0x6f')](_0x5254f8[_0xa167('0x4d')],_0x3bfaaf[_0xa167('0x4f')]));_0x13d6ae[_0xa167('0x58')]['MailAccountId']=_0x24f679['id'];if(_0x5254f8[_0xa167('0x4d')][_0xa167('0x59')]){_0x13d6ae[_0xa167('0x58')]=_['merge'](_0x13d6ae[_0xa167('0x58')],{'$or':_[_0xa167('0x48')](_0x13d6ae['attributes'],function(_0x5a76a0){var _0x4d6f1f={};_0x4d6f1f[_0x5a76a0]={'$like':'%'+_0x5254f8[_0xa167('0x4d')][_0xa167('0x59')]+'%'};return _0x4d6f1f;})});}if(_0x5254f8[_0xa167('0x4d')][_0xa167('0x99')]){var _0x5a564f=_0x5254f8['query'][_0xa167('0x99')][_0xa167('0x9a')](',');var _0x2bc3c2={};_0x2bc3c2[_0x5a564f[0x0]]={'$gte':moment(_0x5a564f[0x1])['format'](_0xa167('0x9b'))};_0x13d6ae[_0xa167('0x58')]=_[_0xa167('0x5b')](_0x13d6ae[_0xa167('0x58')],_0x2bc3c2);}_0x13d6ae=_[_0xa167('0x5b')]({},_0x13d6ae,_0x5254f8[_0xa167('0x5c')]);return db[_0xa167('0x98')][_0xa167('0x21')]({'where':_0x13d6ae['where']})[_0xa167('0xf')](function(_0x321f58){_0xab0f1d['count']=_0x321f58;if(_0x5254f8[_0xa167('0x4d')][_0xa167('0x62')]){_0x13d6ae[_0xa167('0x5d')]=[{'all':!![]}];}return db['MailMessage'][_0xa167('0x5e')](_0x13d6ae);})[_0xa167('0xf')](function(_0x1a39be){if(_0x5254f8[_0xa167('0x4d')][_0xa167('0x9c')]===_0xa167('0x9d')){for(var _0x19d2a5=0x0;_0x19d2a5<_0x1a39be['length'];_0x19d2a5++){_0x1a39be[_0x19d2a5][_0xa167('0x64')]=juice(_0x1a39be[_0x19d2a5][_0xa167('0x64')]);}}_0xab0f1d[_0xa167('0x5f')]=_0x1a39be;return _0xab0f1d;});}})[_0xa167('0xf')](respondWithFilteredResult(_0x44168d,_0x13d6ae))['catch'](handleError(_0x44168d,null));};exports['send']=function(_0x3264cc,_0x54e389){var _0x555e70,_0x35f0c5={},_0x2e8b65;if(_0x3264cc[_0xa167('0x64')]['to']){_0x2e8b65=_0x3264cc[_0xa167('0x64')]['to'][_0xa167('0x9a')](',')[0x0];}return db[_0xa167('0x49')][_0xa167('0x63')]({'where':{'id':_0x3264cc['params']['id']},'include':[{'model':db[_0xa167('0x9e')],'as':_0xa167('0x9f'),'include':[{'model':db['CmContact'],'as':_0xa167('0xa0'),'where':{'email':_0x2e8b65},'limit':0x1,'order':[[_0xa167('0xa1'),_0xa167('0xa2')]]}]},{'model':db[_0xa167('0x45')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xa167('0xa3')],'as':'CloudProvider','raw':!![]}]}]})[_0xa167('0xf')](handleEntityNotFound(_0x54e389,null))['then'](function(_0x40dbaf){if(!_0x40dbaf)return;_0x555e70=_0x40dbaf;if(!_0x40dbaf[_0xa167('0x43')])throw new Error(_0xa167('0xa4'));if(_[_0xa167('0x77')](_0x3264cc[_0xa167('0x64')][_0xa167('0xa5')])){_0x3264cc['body'][_0xa167('0xa5')]=util[_0xa167('0xa6')]('%s\x20<%s>',_0x40dbaf['name'],_0x40dbaf['email']||_0x40dbaf[_0xa167('0x43')]['user']);}if(_0x3264cc['body'][_0xa167('0xa7')]&&_0x3264cc['body']['attachments']['length']){for(var _0xfe10c2=0x0;_0xfe10c2<_0x3264cc[_0xa167('0x64')][_0xa167('0xa7')][_0xa167('0x53')];_0xfe10c2+=0x1){_0x3264cc['body'][_0xa167('0xa7')][_0xfe10c2]={'filename':_0x3264cc[_0xa167('0x64')][_0xa167('0xa7')][_0xfe10c2][_0xa167('0x2a')],'path':path[_0xa167('0xa8')](config[_0xa167('0xa9')],_0xa167('0xaa'),_0x3264cc['body'][_0xa167('0xa7')][_0xfe10c2]['basename'])};}}var _0x2cfaff=_0x40dbaf[_0xa167('0xab')]();return respondWithRpcPromise(_0xa167('0xac'),_0xa167('0xad'),{'account':_0x2cfaff,'message':_0x3264cc[_0xa167('0x64')]});})[_0xa167('0xf')](function(_0x303576){if(!_0x303576)return;_0x35f0c5=_0x303576;if(!_0x555e70['List'])throw new Error(_0xa167('0xae'));if(_0x555e70[_0xa167('0x9f')]['Contacts'][_0xa167('0x53')])return _0x555e70['List'][_0xa167('0xa0')][0x0];return db[_0xa167('0x88')][_0xa167('0x6c')](_[_0xa167('0xaf')](_0x3264cc['body'],{'firstName':_0x3264cc['body']['to'],'email':_0x3264cc['body']['to'],'phone':_0x3264cc['body']['to'],'ListId':_0x555e70[_0xa167('0xb0')]}));})[_0xa167('0xf')](function(_0x4d94b2){if(!_0x4d94b2)return;var _0x316317={'UserId':_0x3264cc[_0xa167('0x37')]['id'],'ContactId':_0x4d94b2['id'],'MailAccountId':_0x555e70['id'],'inReplyTo':_0x35f0c5[_0xa167('0xb1')],'to':_0x3264cc[_0xa167('0x64')]['from'],'cc':_0x3264cc[_0xa167('0x64')]['cc'],'subject':_0x3264cc[_0xa167('0x64')][_0xa167('0xb2')],'attach':_0x3264cc[_0xa167('0x64')][_0xa167('0xb3')],'firstMsgDirection':_0xa167('0xb4'),'lastMsgAt':moment()[_0xa167('0xa6')](_0xa167('0x9b')),'lastMsgDirection':_0xa167('0xb4'),'Messages':[_[_0xa167('0x5b')](_0x3264cc[_0xa167('0x64')],{'messageId':_0x35f0c5['messageId'],'sentAt':moment()[_0xa167('0xa6')](_0xa167('0x9b')),'read':!![],'MailAccountId':_0x555e70['id'],'UserId':_0x3264cc[_0xa167('0x37')]['id'],'ContactId':_0x4d94b2['id']})]};if(_0x3264cc[_0xa167('0x64')][_0xa167('0xb5')]){_0x316317=_[_0xa167('0x5b')](_0x316317,_0x3264cc['body'][_0xa167('0xb5')]);}return db[_0xa167('0x85')][_0xa167('0x6c')](_0x316317,{'include':[{'model':db[_0xa167('0x98')],'as':_0xa167('0xb6')}]});})[_0xa167('0xf')](respondWithResult(_0x54e389,null))[_0xa167('0x1a')](handleError(_0x54e389,null));};exports[_0xa167('0xb7')]=function(_0x433ed6,_0x41005b){return db[_0xa167('0x49')][_0xa167('0x63')]({'where':{'id':_0x433ed6[_0xa167('0x61')]['id']},'include':[{'model':db[_0xa167('0x45')],'as':_0xa167('0x43'),'raw':!![],'include':[{'model':db[_0xa167('0xa3')],'as':_0xa167('0xa3'),'raw':!![]}]}]})[_0xa167('0xf')](handleEntityNotFound(_0x41005b,null))[_0xa167('0xf')](function(_0x453c1a){if(!_0x453c1a[_0xa167('0x43')])return;var _0x4d54eb=_0x453c1a[_0xa167('0xab')]();return respondWithRpcPromise(_0xa167('0xb8'),_0xa167('0xb7'),{'account':_0x4d54eb});})[_0xa167('0xf')](respondWithResult(_0x41005b,null))[_0xa167('0x1a')](handleError(_0x41005b,null));};exports['destroy']=function(_0x12ac22,_0xa72ff0){return db['MailAccount'][_0xa167('0x63')]({'where':{'id':_0x12ac22[_0xa167('0x61')]['id']}})['then'](handleEntityNotFound(_0xa72ff0,null))[_0xa167('0xf')](function(_0x3aa9bf){if(_0x3aa9bf&&_0x3aa9bf[_0xa167('0x3f')]){throw new db['Sequelize']['ValidationError'](_0xa167('0xb9'));}return _0x3aa9bf;})[_0xa167('0xf')](removeEntity(_0xa72ff0,null))[_0xa167('0x1a')](handleError(_0xa72ff0,null));};exports['addAgents']=function(_0x130ec6,_0x540c74){return db[_0xa167('0x49')][_0xa167('0x63')]({'where':{'id':_0x130ec6[_0xa167('0x61')]['id']}})[_0xa167('0xf')](handleEntityNotFound(_0x540c74,null))[_0xa167('0xf')](function(_0x478b20){if(_0x478b20){return _0x478b20[_0xa167('0xba')](_0x130ec6[_0xa167('0x64')][_0xa167('0x71')],_[_0xa167('0x86')](_0x130ec6[_0xa167('0x64')],[_0xa167('0x71'),'id'])||{})[_0xa167('0xbb')](function(_0xf3bba7){for(var _0x19d162=0x0;_0x19d162<_0x130ec6[_0xa167('0x64')]['ids'][_0xa167('0x53')];_0x19d162+=0x1){socket['emit'](_0xa167('0xbc'),{'UserId':Number(_0x130ec6[_0xa167('0x64')][_0xa167('0x71')][_0x19d162]),'MailAccountId':Number(_0x130ec6[_0xa167('0x61')]['id'])});}return _0xf3bba7;});}})[_0xa167('0xf')](respondWithResult(_0x540c74,null))['catch'](handleError(_0x540c74,null));};exports[_0xa167('0xbd')]=function(_0x22a7de,_0x137d16){return db[_0xa167('0x49')]['find']({'where':{'id':_0x22a7de[_0xa167('0x61')]['id']}})[_0xa167('0xf')](handleEntityNotFound(_0x137d16,null))[_0xa167('0xf')](function(_0x503263){if(_0x503263){return _0x503263[_0xa167('0xbd')](_0x22a7de[_0xa167('0x4d')]['ids'])['then'](function(){if(_[_0xa167('0xbe')](_0x22a7de[_0xa167('0x4d')]['ids'])){for(var _0x1058a4=0x0;_0x1058a4<_0x22a7de[_0xa167('0x4d')][_0xa167('0x71')][_0xa167('0x53')];_0x1058a4+=0x1){socket[_0xa167('0xbf')]('userMailAccount:remove',{'UserId':Number(_0x22a7de[_0xa167('0x4d')][_0xa167('0x71')][_0x1058a4]),'MailAccountId':Number(_0x22a7de[_0xa167('0x61')]['id'])});}}else{socket[_0xa167('0xbf')](_0xa167('0xc0'),{'UserId':Number(_0x22a7de[_0xa167('0x4d')]['ids']),'MailAccountId':Number(_0x22a7de[_0xa167('0x61')]['id'])});}});}})['then'](respondWithStatusCode(_0x137d16,null))[_0xa167('0x1a')](handleError(_0x137d16,null));};exports[_0xa167('0xc1')]=function(_0x3f48e0,_0x3947e0){var _0x4c89f={};var _0x3a7d55={};var _0x3f1c84;var _0xf1f93d;return db[_0xa167('0x49')][_0xa167('0x6e')]({'where':{'id':_0x3f48e0[_0xa167('0x61')]['id']}})[_0xa167('0xf')](handleEntityNotFound(_0x3947e0,null))[_0xa167('0xf')](function(_0x28da15){if(_0x28da15){_0x3f1c84=_0x28da15;_0x3a7d55['model']=_[_0xa167('0x4e')](db[_0xa167('0x8a')][_0xa167('0x4a')]);_0x3a7d55[_0xa167('0x4d')]=_[_0xa167('0x4e')](_0x3f48e0[_0xa167('0x4d')]);_0x3a7d55[_0xa167('0x4f')]=_[_0xa167('0x51')](_0x3a7d55[_0xa167('0x4c')],_0x3a7d55[_0xa167('0x4d')]);_0x4c89f['attributes']=_['intersection'](_0x3a7d55[_0xa167('0x4c')],qs[_0xa167('0x52')](_0x3f48e0[_0xa167('0x4d')]['fields']));_0x4c89f[_0xa167('0x50')]=_0x4c89f[_0xa167('0x50')]['length']?_0x4c89f[_0xa167('0x50')]:_0x3a7d55[_0xa167('0x4c')];_0x4c89f[_0xa167('0x56')]=qs[_0xa167('0x57')](_0x3f48e0[_0xa167('0x4d')]['sort']);_0x4c89f[_0xa167('0x58')]=qs[_0xa167('0x4f')](_[_0xa167('0x6f')](_0x3f48e0['query'],_0x3a7d55[_0xa167('0x4f')]));if(_0x3f48e0['query']['filter']){_0x4c89f[_0xa167('0x58')]=_[_0xa167('0x5b')](_0x4c89f[_0xa167('0x58')],{'$or':_[_0xa167('0x48')](_0x4c89f['attributes'],function(_0x26f7ee){var _0x1c84b0={};_0x1c84b0[_0x26f7ee]={'$like':'%'+_0x3f48e0['query'][_0xa167('0x59')]+'%'};return _0x1c84b0;})});}_0x4c89f=_[_0xa167('0x5b')]({},_0x4c89f,_0x3f48e0[_0xa167('0x5c')]);return _0x3f1c84[_0xa167('0xc1')](_0x4c89f);}})[_0xa167('0xf')](function(_0x22ac2e){if(_0x22ac2e){_0xf1f93d=_0x22ac2e[_0xa167('0x53')];if(!_0x3f48e0[_0xa167('0x4d')]['hasOwnProperty'](_0xa167('0x55'))){_0x4c89f['limit']=qs[_0xa167('0x20')](_0x3f48e0[_0xa167('0x4d')][_0xa167('0x20')]);_0x4c89f[_0xa167('0x1e')]=qs['offset'](_0x3f48e0['query']['offset']);}return _0x3f1c84['getAgents'](_0x4c89f);}})['then'](function(_0x17d9dc){if(_0x17d9dc){return _0x17d9dc?{'count':_0xf1f93d,'rows':_0x17d9dc}:null;}})[_0xa167('0xf')](respondWithResult(_0x3947e0,null))[_0xa167('0x1a')](handleError(_0x3947e0,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 6d35f95..65b4798 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 _0xd9b4=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount'];(function(_0x4ec520,_0x15fee2){var _0xed49d7=function(_0x3031f2){while(--_0x3031f2){_0x4ec520['push'](_0x4ec520['shift']());}};_0xed49d7(++_0x15fee2);}(_0xd9b4,0x1c0));var _0x4d9b=function(_0x105e5c,_0x2a1c3a){_0x105e5c=_0x105e5c-0x0;var _0x4426f8=_0xd9b4[_0x105e5c];return _0x4426f8;};'use strict';var EventEmitter=require(_0x4d9b('0x0'));var MailAccount=require(_0x4d9b('0x1'))['db'][_0x4d9b('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x4d9b('0x3')](0x0);var events={'afterCreate':_0x4d9b('0x4'),'afterUpdate':_0x4d9b('0x5'),'afterDestroy':_0x4d9b('0x6')};function emitEvent(_0x19b4cb){return function(_0x493238,_0x598beb,_0xa5ee50){MailAccountEvents['emit'](_0x19b4cb+':'+_0x493238['id'],_0x493238);MailAccountEvents[_0x4d9b('0x7')](_0x19b4cb,_0x493238);_0xa5ee50(null);};}for(var e in events){if(events[_0x4d9b('0x8')](e)){var event=events[e];MailAccount[_0x4d9b('0x9')](e,emitEvent(event));}}module[_0x4d9b('0xa')]=MailAccountEvents; \ No newline at end of file +var _0xa282=['hook','exports','events','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x4f4a22,_0x11c7e6){var _0x31e962=function(_0x2ed38e){while(--_0x2ed38e){_0x4f4a22['push'](_0x4f4a22['shift']());}};_0x31e962(++_0x11c7e6);}(_0xa282,0x1f3));var _0x2a28=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0xa282[_0x4792c8];return _0x35edb1;};'use strict';var EventEmitter=require(_0x2a28('0x0'));var MailAccount=require('../../mysqldb')['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x2a28('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2a28('0x2'),'afterDestroy':'remove'};function emitEvent(_0xe7cd2e){return function(_0x1aec55,_0x2e12ef,_0x194226){MailAccountEvents[_0x2a28('0x3')](_0xe7cd2e+':'+_0x1aec55['id'],_0x1aec55);MailAccountEvents[_0x2a28('0x3')](_0xe7cd2e,_0x1aec55);_0x194226(null);};}for(var e in events){if(events[_0x2a28('0x4')](e)){var event=events[e];MailAccount[_0x2a28('0x5')](e,emitEvent(event));}}module[_0x2a28('0x6')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index e1c6fe7..fc6ad5d 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 _0x7812=['pass','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','provider','custom','host','port','Smtp','secure','authentication','modernAuthentication','Cloud\x20Provider\x20configuration\x20not\x20found','auth','OAuth2','user','data5'];(function(_0x298152,_0x2bab07){var _0x58117d=function(_0x12ff68){while(--_0x12ff68){_0x298152['push'](_0x298152['shift']());}};_0x58117d(++_0x2bab07);}(_0x7812,0x17d));var _0x2781=function(_0x377d7d,_0x5d8eb2){_0x377d7d=_0x377d7d-0x0;var _0x59d647=_0x7812[_0x377d7d];return _0x59d647;};'use strict';var attributes=require(_0x2781('0x0'));module[_0x2781('0x1')]=function(_0x18e5be){return _0x18e5be[_0x2781('0x2')](_0x2781('0x3'),attributes,{'tableName':_0x2781('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x1f4ec8=this;var _0x3b4076={'id':_0x1f4ec8['id'],'tls':{'rejectUnauthorized':![]}};if(_0x1f4ec8[_0x2781('0x5')]!==_0x2781('0x6')){_0x3b4076['service']=_0x1f4ec8['provider'];}else{_0x3b4076[_0x2781('0x7')]=_0x1f4ec8['Smtp'][_0x2781('0x7')];_0x3b4076[_0x2781('0x8')]=_0x1f4ec8[_0x2781('0x9')][_0x2781('0x8')];_0x3b4076[_0x2781('0xa')]=_0x1f4ec8['Smtp'][_0x2781('0xa')];}if(_0x1f4ec8['Smtp'][_0x2781('0xb')]){if(_0x1f4ec8[_0x2781('0x9')][_0x2781('0xc')]){if(!_0x1f4ec8['Smtp']['CloudProvider'])throw new Error(_0x2781('0xd'));_0x3b4076[_0x2781('0xe')]={'type':_0x2781('0xf'),'user':_0x1f4ec8['Smtp'][_0x2781('0x10')],'accessToken':_0x1f4ec8[_0x2781('0x9')]['CloudProvider'][_0x2781('0x11')]};}else{_0x3b4076['auth']={'user':_0x1f4ec8[_0x2781('0x9')][_0x2781('0x10')],'pass':_0x1f4ec8[_0x2781('0x9')][_0x2781('0x12')]};}}return _0x3b4076;}}});}; \ No newline at end of file +var _0xf43a=['CloudProvider','Cloud\x20Provider\x20configuration\x20not\x20found','OAuth2','user','auth','pass','exports','define','MailAccount','custom','host','Smtp','port','secure','authentication'];(function(_0x466fb9,_0x190fa6){var _0x56e3bd=function(_0x3a3445){while(--_0x3a3445){_0x466fb9['push'](_0x466fb9['shift']());}};_0x56e3bd(++_0x190fa6);}(_0xf43a,0xf6));var _0xaf43=function(_0x101cfc,_0x25ea9e){_0x101cfc=_0x101cfc-0x0;var _0xceeecf=_0xf43a[_0x101cfc];return _0xceeecf;};'use strict';var attributes=require('./mailAccount.attributes');module[_0xaf43('0x0')]=function(_0x245524){return _0x245524[_0xaf43('0x1')](_0xaf43('0x2'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getSmtpOptions':function(){var _0x23a2d7=this;var _0x9aaec3={'id':_0x23a2d7['id'],'tls':{'rejectUnauthorized':![]}};if(_0x23a2d7['provider']!==_0xaf43('0x3')){_0x9aaec3['service']=_0x23a2d7['provider'];}else{_0x9aaec3[_0xaf43('0x4')]=_0x23a2d7[_0xaf43('0x5')][_0xaf43('0x4')];_0x9aaec3['port']=_0x23a2d7['Smtp'][_0xaf43('0x6')];_0x9aaec3[_0xaf43('0x7')]=_0x23a2d7[_0xaf43('0x5')]['secure'];}if(_0x23a2d7[_0xaf43('0x5')][_0xaf43('0x8')]){if(_0x23a2d7[_0xaf43('0x5')]['modernAuthentication']){if(!_0x23a2d7[_0xaf43('0x5')][_0xaf43('0x9')])throw new Error(_0xaf43('0xa'));_0x9aaec3['auth']={'type':_0xaf43('0xb'),'user':_0x23a2d7['Smtp'][_0xaf43('0xc')],'accessToken':_0x23a2d7[_0xaf43('0x5')][_0xaf43('0x9')]['data5']};}else{_0x9aaec3[_0xaf43('0xd')]={'user':_0x23a2d7[_0xaf43('0x5')][_0xaf43('0xc')],'pass':_0x23a2d7[_0xaf43('0x5')][_0xaf43('0xe')]};}}return _0x9aaec3;}}});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index a61ea1d..6871c82 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 _0xd943=['MailServerOut','Smtp','CloudProvider','get','account','omit','smtpOptions','applications','list','asc','autoclose','close','Contacts','length','defaults','ListId','List\x20not\x20found','contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','create','spread','attach','interaction','created','attachments','originTo','originCc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','socket.io-emitter','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','MailAccount','findAll','options','where','attributes','limit','include','map','model','stringify','GetMailAccount','ShowMailAccount','smtp','setDataValue','getSmtpOptions','NotifyMailAccount','body','mail','difference','keys','CmContact','updatedAt','CompanyId','isNil','from','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','List','DESC','MailApplication','Applications'];(function(_0x4b07eb,_0x4284fb){var _0x3ed187=function(_0x4728aa){while(--_0x4728aa){_0x4b07eb['push'](_0x4b07eb['shift']());}};_0x3ed187(++_0x4284fb);}(_0xd943,0x15d));var _0x3d94=function(_0x43750b,_0x5b6b4f){_0x43750b=_0x43750b-0x0;var _0x6ca08=_0xd943[_0x43750b];return _0x6ca08;};'use strict';var _=require(_0x3d94('0x0'));var moment=require(_0x3d94('0x1'));var BPromise=require(_0x3d94('0x2'));var rs=require(_0x3d94('0x3'));var Redis=require('ioredis');var db=require(_0x3d94('0x4'))['db'];var logger=require(_0x3d94('0x5'))(_0x3d94('0x6'));var config=require(_0x3d94('0x7'));var jayson=require(_0x3d94('0x8'));var client=jayson['client']['http']({'port':0x232c});config[_0x3d94('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3d94('0xa'))(new Redis(config[_0x3d94('0x9')]));require('./mailAccount.socket')['register'](socket);function respondWithRpcPromise(_0x3984a3,_0x27e381,_0x1cc58c){return new BPromise(function(_0x5908a7,_0x182066){return client['request'](_0x3984a3,_0x1cc58c)[_0x3d94('0xb')](function(_0x301536){logger['info'](_0x3d94('0xc'),_0x27e381,_0x3d94('0xd'));logger[_0x3d94('0xe')](_0x3d94('0xf'),_0x27e381,_0x3d94('0xd'),JSON['stringify'](_0x301536));if(_0x301536[_0x3d94('0x10')]){if(_0x301536[_0x3d94('0x10')][_0x3d94('0x11')]===0x1f4){logger['error'](_0x3d94('0xc'),_0x27e381,_0x301536[_0x3d94('0x10')][_0x3d94('0x12')]);return _0x182066(_0x301536['error'][_0x3d94('0x12')]);}logger[_0x3d94('0x10')](_0x3d94('0xc'),_0x27e381,_0x301536[_0x3d94('0x10')][_0x3d94('0x12')]);return _0x5908a7(_0x301536[_0x3d94('0x10')][_0x3d94('0x12')]);}else{logger[_0x3d94('0x13')]('MailAccount,\x20%s,\x20%s',_0x27e381,_0x3d94('0xd'));_0x5908a7(_0x301536[_0x3d94('0x14')][_0x3d94('0x12')]);}})[_0x3d94('0x15')](function(_0x4afc92){logger[_0x3d94('0x10')](_0x3d94('0xc'),_0x27e381,_0x4afc92);_0x182066(_0x4afc92);});});}exports['GetMailAccount']=function(_0x9bca24){var _0x59b741=this;return new Promise(function(_0x28bead,_0x193934){return db[_0x3d94('0x16')][_0x3d94('0x17')]({'raw':_0x9bca24[_0x3d94('0x18')]?_0x9bca24['options']['raw']===undefined?!![]:![]:!![],'where':_0x9bca24[_0x3d94('0x18')]?_0x9bca24[_0x3d94('0x18')][_0x3d94('0x19')]||null:null,'attributes':_0x9bca24['options']?_0x9bca24[_0x3d94('0x18')][_0x3d94('0x1a')]||null:null,'limit':_0x9bca24[_0x3d94('0x18')]?_0x9bca24[_0x3d94('0x18')][_0x3d94('0x1b')]||null:null,'include':_0x9bca24[_0x3d94('0x18')]?_0x9bca24[_0x3d94('0x18')][_0x3d94('0x1c')]?_[_0x3d94('0x1d')](_0x9bca24[_0x3d94('0x18')][_0x3d94('0x1c')],function(_0x192839){return{'model':db[_0x192839[_0x3d94('0x1e')]],'as':_0x192839['as'],'attributes':_0x192839[_0x3d94('0x1a')],'include':_0x192839[_0x3d94('0x1c')]?_['map'](_0x192839[_0x3d94('0x1c')],function(_0x558fd2){return{'model':db[_0x558fd2[_0x3d94('0x1e')]],'as':_0x558fd2['as'],'attributes':_0x558fd2[_0x3d94('0x1a')],'include':_0x558fd2[_0x3d94('0x1c')]?_[_0x3d94('0x1d')](_0x558fd2[_0x3d94('0x1c')],function(_0x82b568){return{'model':db[_0x82b568[_0x3d94('0x1e')]],'as':_0x82b568['as'],'attributes':_0x82b568['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x362642){logger['info']('GetMailAccount',_0x9bca24);logger[_0x3d94('0xe')]('GetMailAccount',_0x9bca24,JSON[_0x3d94('0x1f')](_0x362642));_0x28bead(_0x362642);})[_0x3d94('0x15')](function(_0x32403a){logger['error'](_0x3d94('0x20'),_0x32403a['message'],_0x9bca24);_0x193934(_0x59b741[_0x3d94('0x10')](0x1f4,_0x32403a['message']));});});};exports[_0x3d94('0x21')]=function(_0x215ad7){var _0x29b1ff=this;return new Promise(function(_0x246f88,_0x50560c){return db[_0x3d94('0x16')]['find']({'raw':_0x215ad7[_0x3d94('0x18')]?_0x215ad7[_0x3d94('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x215ad7['options']?_0x215ad7[_0x3d94('0x18')][_0x3d94('0x19')]||null:null,'attributes':_0x215ad7[_0x3d94('0x18')]?_0x215ad7['options'][_0x3d94('0x1a')]||null:null,'include':_0x215ad7[_0x3d94('0x18')]?_0x215ad7['options'][_0x3d94('0x1c')]?_[_0x3d94('0x1d')](_0x215ad7[_0x3d94('0x18')][_0x3d94('0x1c')],function(_0x782c1){return{'model':db[_0x782c1['model']],'as':_0x782c1['as'],'attributes':_0x782c1[_0x3d94('0x1a')],'include':_0x782c1[_0x3d94('0x1c')]?_[_0x3d94('0x1d')](_0x782c1[_0x3d94('0x1c')],function(_0xb493f1){return{'model':db[_0xb493f1[_0x3d94('0x1e')]],'as':_0xb493f1['as'],'attributes':_0xb493f1['attributes'],'include':_0xb493f1['include']?_[_0x3d94('0x1d')](_0xb493f1[_0x3d94('0x1c')],function(_0x1c1b25){return{'model':db[_0x1c1b25[_0x3d94('0x1e')]],'as':_0x1c1b25['as'],'attributes':_0x1c1b25[_0x3d94('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x3d94('0xb')](function(_0x2ef743){if(_0x215ad7[_0x3d94('0x18')][_0x3d94('0x22')]===!![])_0x2ef743[_0x3d94('0x23')]('smtpOptions',_0x2ef743[_0x3d94('0x24')]());logger[_0x3d94('0x13')](_0x3d94('0x21'),_0x215ad7);logger[_0x3d94('0xe')]('ShowMailAccount',_0x215ad7,JSON[_0x3d94('0x1f')](_0x2ef743));_0x246f88(_0x2ef743);})[_0x3d94('0x15')](function(_0x35e0e6){logger[_0x3d94('0x10')](_0x3d94('0x21'),_0x35e0e6['message'],_0x215ad7);_0x50560c(_0x29b1ff[_0x3d94('0x10')](0x1f4,_0x35e0e6[_0x3d94('0x12')]));});});};exports[_0x3d94('0x25')]=function(_0x485066){var _0x4eee4d=this;return new Promise(function(_0x4d8a8f,_0x47905e){var _0x3b3550={'body':_0x485066[_0x3d94('0x26')],'channel':_0x3d94('0x27')};var _0x146ccb=_[_0x3d94('0x28')](_[_0x3d94('0x29')](db[_0x3d94('0x2a')]['rawAttributes']),['createdAt',_0x3d94('0x2b'),_0x3d94('0x2c'),'ListId']);var _0x2d0aa2=![];if(_0x485066['body']['id']){delete _0x485066[_0x3d94('0x26')]['id'];}if(_[_0x3d94('0x2d')](_0x485066[_0x3d94('0x26')][_0x3d94('0x2e')])){return _0x47905e(_0x4eee4d[_0x3d94('0x10')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x3d94('0x2d')](_0x485066[_0x3d94('0x26')][_0x3d94('0x26')])||_0x485066['body'][_0x3d94('0x26')]===''){return _0x47905e(_0x4eee4d['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x3d94('0x2d')](_0x485066[_0x3d94('0x26')][_0x3d94('0x2f')])){return _0x47905e(_0x4eee4d[_0x3d94('0x10')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x146ccb));}if(!_[_0x3d94('0x30')](_0x146ccb,_0x485066['body'][_0x3d94('0x2f')])){return _0x47905e(_0x4eee4d[_0x3d94('0x10')](0x1f4,_0x3d94('0x31')+_0x146ccb));}var _0x15c8e7={};_0x15c8e7[_0x485066[_0x3d94('0x26')][_0x3d94('0x2f')]]=_0x485066[_0x3d94('0x26')]['from'];return db[_0x3d94('0x16')][_0x3d94('0x32')]({'where':{'id':_0x485066['account']['id']},'include':[{'model':db['CmList'],'as':_0x3d94('0x33'),'include':[{'model':db[_0x3d94('0x2a')],'as':'Contacts','where':_0x15c8e7,'limit':0x1,'order':[[_0x3d94('0x2b'),_0x3d94('0x34')]]}]},{'model':db[_0x3d94('0x35')],'as':_0x3d94('0x36')},{'model':db[_0x3d94('0x37')],'as':_0x3d94('0x38'),'include':[{'model':db[_0x3d94('0x39')],'as':_0x3d94('0x39')}]}]})[_0x3d94('0xb')](function(_0x2429bc){if(_0x2429bc&&_0x2429bc[_0x3d94('0x33')]){var _0x29682b=_0x2429bc[_0x3d94('0x3a')]({'plain':!![]});_0x3b3550[_0x3d94('0x3b')]=_[_0x3d94('0x3c')](_0x29682b,['Applications',_0x3d94('0x33')]);_0x3b3550[_0x3d94('0x3b')][_0x3d94('0x3d')]=_0x2429bc[_0x3d94('0x24')]();_0x3b3550[_0x3d94('0x3e')]=_0x29682b[_0x3d94('0x36')];_0x3b3550[_0x3d94('0x3f')]=_0x29682b[_0x3d94('0x33')];_0x3b3550[_0x3d94('0x3e')]=_['orderBy'](_0x3b3550[_0x3d94('0x3e')],['priority'],[_0x3d94('0x40')]);if(_0x3b3550[_0x3d94('0x3b')]&&_0x3b3550['account'][_0x3d94('0x41')]){_0x3b3550['applications']['push']({'id':0x0,'priority':_0x3b3550[_0x3d94('0x3e')]['length']+0x1,'app':_0x3d94('0x42'),'appdata':_0x3d94('0x41'),'interval':'*,*,*,*'});}if(_0x3b3550[_0x3d94('0x3b')]['Applications']){delete _0x3b3550['account'][_0x3d94('0x36')];}if(_0x3b3550[_0x3d94('0x3b')][_0x3d94('0x33')]){delete _0x3b3550[_0x3d94('0x3b')][_0x3d94('0x33')];}if(_0x29682b[_0x3d94('0x33')][_0x3d94('0x43')][_0x3d94('0x44')]){return _0x29682b[_0x3d94('0x33')]['Contacts'][0x0];}var _0x28cfbb=_[_0x3d94('0x45')](_0x485066[_0x3d94('0x26')],{'firstName':_0x485066[_0x3d94('0x26')][_0x3d94('0x2e')],'ListId':_0x29682b[_0x3d94('0x46')]});_0x28cfbb[_0x485066[_0x3d94('0x26')][_0x3d94('0x2f')]]=_0x485066[_0x3d94('0x26')][_0x3d94('0x2e')];return db[_0x3d94('0x2a')]['create'](_0x28cfbb);}else{throw new Error(_0x3d94('0x47'));}})['then'](function(_0x709841){_0x3b3550[_0x3d94('0x48')]=_0x709841;if(_0x709841){if(!_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x49')]){_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x49')]=rs[_0x3d94('0x4a')]()+'\x20'+_0x485066['body']['message'][_0x3d94('0x2e')];}var _0x4bd97c={'ContactId':_0x709841['id'],'MailAccountId':_0x485066[_0x3d94('0x3b')]['id'],'inReplyTo':_0x485066[_0x3d94('0x26')]['message'][_0x3d94('0x49')],'to':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x2e')],'cc':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['cc'],'subject':_0x485066[_0x3d94('0x26')]['message'][_0x3d94('0x4b')],'attach':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['attach'],'lastMsgAt':moment()[_0x3d94('0x4c')](_0x3d94('0x4d')),'lastMsgDirection':'in'};return db[_0x3d94('0x4e')][_0x3d94('0x32')]({'where':{'closed':![],'MailAccountId':_0x485066['account']['id']},'include':[{'model':db['MailMessage'],'as':_0x3d94('0x4f'),'attributes':[_0x3d94('0x49')],'where':{'messageId':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['inReplyTo']}}]})[_0x3d94('0xb')](function(_0x1c99d1){if(_0x1c99d1){return[_0x1c99d1,![]];}return db['MailInteraction'][_0x3d94('0x50')](_0x4bd97c)[_0x3d94('0xb')](function(_0x336e36){return[_0x336e36,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x3d94('0x51')](function(_0x227372,_0x585531){if(_0x227372){_0x2d0aa2=_0x585531;if(!_0x585531){return _0x227372['update']({'inReplyTo':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['messageId'],'to':_0x485066['body']['message'][_0x3d94('0x2e')],'cc':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['cc'],'subject':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['subject'],'attach':_0x227372[_0x3d94('0x52')]?_0x227372[_0x3d94('0x52')]:_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x52')],'substatus':null,'substatusAt':moment()[_0x3d94('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()[_0x3d94('0x4c')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x227372;}}})[_0x3d94('0xb')](function(_0x41d561){_0x3b3550[_0x3d94('0x53')]=_0x41d561[_0x3d94('0x3a')]({'plain':!![]});_0x3b3550[_0x3d94('0x53')][_0x3d94('0x54')]=_0x2d0aa2;return db['MailMessage']['create']({'body':_0x485066[_0x3d94('0x26')]['body'],'MailAccountId':_0x485066['account']['id'],'MailInteractionId':_0x41d561['id'],'direction':'in','ContactId':_0x3b3550['contact']['id'],'messageId':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x49')],'from':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x2e')],'to':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['to'],'cc':_0x485066['body'][_0x3d94('0x12')]['cc'],'subject':_0x485066['body'][_0x3d94('0x12')][_0x3d94('0x4b')],'attach':_0x485066[_0x3d94('0x26')]['message']['attach'],'Attachments':_0x485066['body'][_0x3d94('0x12')][_0x3d94('0x55')],'originTo':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x56')],'originCc':_0x485066['body']['message'][_0x3d94('0x57')],'bcc':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')]['bcc'],'ChatWebsiteId':_0x485066[_0x3d94('0x26')]['message'][_0x3d94('0x58')]||null,'originChannel':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x59')]||_0x3d94('0x5a'),'ChatOfflineMessageId':_0x485066[_0x3d94('0x26')][_0x3d94('0x12')][_0x3d94('0x5b')]||null},{'include':[{'model':db[_0x3d94('0x5c')],'as':_0x3d94('0x5d')}]});})[_0x3d94('0xb')](function(_0xe6cfd1){_0x3b3550[_0x3d94('0x12')]=_0xe6cfd1;if(_0x3b3550['interaction'][_0x3d94('0x5e')]){return db[_0x3d94('0x5f')][_0x3d94('0x32')]({'attributes':['id',_0x3d94('0x60')],'where':{'id':_0x3b3550['interaction'][_0x3d94('0x5e')]}})['then'](function(_0x4f217f){if(_0x4f217f){_0x3b3550[_0x3d94('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x3d94('0x61'),'appdata':_0x4f217f[_0x3d94('0x60')]+','+(_0x3b3550['account'][_0x3d94('0x62')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x3d94('0x63'),_0x3d94('0x64'),_0x3b3550);});}return respondWithRpcPromise('Start','startRouting',_0x3b3550);})['then'](function(_0x833d96){_0x4d8a8f(_0x833d96);})['catch'](function(_0x5a8114){_0x47905e(_0x4eee4d[_0x3d94('0x10')](0x1f4,_0x5a8114[_0x3d94('0x12')]));});});}; \ No newline at end of file +var _0x2542=['MailServerOut','Smtp','CloudProvider','get','omit','getSmtpOptions','applications','list','orderBy','priority','asc','push','length','*,*,*,*','Contacts','contact','messageId','generate','attach','format','MailMessage','Messages','inReplyTo','create','Contact\x20not\x20found','subject','YYYY-MM-DD\x20HH:mm:ss','interaction','created','originCc','ChatWebsiteId','originChannel','Email','Attachment','UserId','User','name','waitForTheAssignedAgent','Start','startRouting','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','options','raw','attributes','map','include','model','ShowMailAccount','find','where','smtp','setDataValue','smtpOptions','NotifyMailAccount','body','mail','difference','keys','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','CmContact','DESC','MailApplication','Applications'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0x2542,0x169));var _0x2254=function(_0x254fff,_0x392720){_0x254fff=_0x254fff-0x0;var _0x2dce44=_0x2542[_0x254fff];return _0x2dce44;};'use strict';var _=require(_0x2254('0x0'));var moment=require(_0x2254('0x1'));var BPromise=require(_0x2254('0x2'));var rs=require(_0x2254('0x3'));var Redis=require('ioredis');var db=require(_0x2254('0x4'))['db'];var logger=require('../../config/logger')(_0x2254('0x5'));var config=require(_0x2254('0x6'));var jayson=require(_0x2254('0x7'));var client=jayson[_0x2254('0x8')][_0x2254('0x9')]({'port':0x232c});config['redis']=_[_0x2254('0xa')](config[_0x2254('0xb')],{'host':_0x2254('0xc'),'port':0x18eb});var socket=require(_0x2254('0xd'))(new Redis(config[_0x2254('0xb')]));require(_0x2254('0xe'))[_0x2254('0xf')](socket);function respondWithRpcPromise(_0xbf1c18,_0xb395da,_0x1ae415){return new BPromise(function(_0x38fb2b,_0x5b1ab9){return client[_0x2254('0x10')](_0xbf1c18,_0x1ae415)[_0x2254('0x11')](function(_0x506abe){logger[_0x2254('0x12')]('MailAccount,\x20%s,\x20%s',_0xb395da,'request\x20sent');logger[_0x2254('0x13')](_0x2254('0x14'),_0xb395da,_0x2254('0x15'),JSON[_0x2254('0x16')](_0x506abe));if(_0x506abe[_0x2254('0x17')]){if(_0x506abe[_0x2254('0x17')]['code']===0x1f4){logger[_0x2254('0x17')](_0x2254('0x18'),_0xb395da,_0x506abe['error'][_0x2254('0x19')]);return _0x5b1ab9(_0x506abe[_0x2254('0x17')][_0x2254('0x19')]);}logger[_0x2254('0x17')](_0x2254('0x18'),_0xb395da,_0x506abe[_0x2254('0x17')]['message']);return _0x38fb2b(_0x506abe[_0x2254('0x17')]['message']);}else{logger[_0x2254('0x12')](_0x2254('0x18'),_0xb395da,_0x2254('0x15'));_0x38fb2b(_0x506abe[_0x2254('0x1a')][_0x2254('0x19')]);}})[_0x2254('0x1b')](function(_0x497724){logger['error']('MailAccount,\x20%s,\x20%s',_0xb395da,_0x497724);_0x5b1ab9(_0x497724);});});}exports[_0x2254('0x1c')]=function(_0x3a79f8){var _0x3c3a98=this;return new Promise(function(_0x1f1163,_0x2801d9){return db[_0x2254('0x1d')]['findAll']({'raw':_0x3a79f8[_0x2254('0x1e')]?_0x3a79f8[_0x2254('0x1e')][_0x2254('0x1f')]===undefined?!![]:![]:!![],'where':_0x3a79f8['options']?_0x3a79f8['options']['where']||null:null,'attributes':_0x3a79f8[_0x2254('0x1e')]?_0x3a79f8[_0x2254('0x1e')][_0x2254('0x20')]||null:null,'limit':_0x3a79f8['options']?_0x3a79f8['options']['limit']||null:null,'include':_0x3a79f8['options']?_0x3a79f8['options']['include']?_[_0x2254('0x21')](_0x3a79f8[_0x2254('0x1e')][_0x2254('0x22')],function(_0x265467){return{'model':db[_0x265467[_0x2254('0x23')]],'as':_0x265467['as'],'attributes':_0x265467[_0x2254('0x20')],'include':_0x265467['include']?_['map'](_0x265467[_0x2254('0x22')],function(_0x4f6877){return{'model':db[_0x4f6877[_0x2254('0x23')]],'as':_0x4f6877['as'],'attributes':_0x4f6877[_0x2254('0x20')],'include':_0x4f6877[_0x2254('0x22')]?_[_0x2254('0x21')](_0x4f6877[_0x2254('0x22')],function(_0x482688){return{'model':db[_0x482688[_0x2254('0x23')]],'as':_0x482688['as'],'attributes':_0x482688[_0x2254('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2254('0x11')](function(_0x37af8b){logger[_0x2254('0x12')](_0x2254('0x1c'),_0x3a79f8);logger[_0x2254('0x13')](_0x2254('0x1c'),_0x3a79f8,JSON[_0x2254('0x16')](_0x37af8b));_0x1f1163(_0x37af8b);})[_0x2254('0x1b')](function(_0x21c641){logger[_0x2254('0x17')](_0x2254('0x1c'),_0x21c641[_0x2254('0x19')],_0x3a79f8);_0x2801d9(_0x3c3a98[_0x2254('0x17')](0x1f4,_0x21c641[_0x2254('0x19')]));});});};exports[_0x2254('0x24')]=function(_0x291894){var _0x2f32f8=this;return new Promise(function(_0x4e3658,_0xe29526){return db[_0x2254('0x1d')][_0x2254('0x25')]({'raw':_0x291894[_0x2254('0x1e')]?_0x291894[_0x2254('0x1e')][_0x2254('0x1f')]===undefined?!![]:![]:!![],'where':_0x291894[_0x2254('0x1e')]?_0x291894[_0x2254('0x1e')][_0x2254('0x26')]||null:null,'attributes':_0x291894['options']?_0x291894[_0x2254('0x1e')][_0x2254('0x20')]||null:null,'include':_0x291894['options']?_0x291894[_0x2254('0x1e')][_0x2254('0x22')]?_[_0x2254('0x21')](_0x291894[_0x2254('0x1e')]['include'],function(_0x4a2df0){return{'model':db[_0x4a2df0[_0x2254('0x23')]],'as':_0x4a2df0['as'],'attributes':_0x4a2df0['attributes'],'include':_0x4a2df0[_0x2254('0x22')]?_[_0x2254('0x21')](_0x4a2df0[_0x2254('0x22')],function(_0x141ddc){return{'model':db[_0x141ddc[_0x2254('0x23')]],'as':_0x141ddc['as'],'attributes':_0x141ddc[_0x2254('0x20')],'include':_0x141ddc[_0x2254('0x22')]?_['map'](_0x141ddc[_0x2254('0x22')],function(_0x192e9f){return{'model':db[_0x192e9f[_0x2254('0x23')]],'as':_0x192e9f['as'],'attributes':_0x192e9f[_0x2254('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2254('0x11')](function(_0x3f6007){if(_0x291894[_0x2254('0x1e')][_0x2254('0x27')]===!![])_0x3f6007[_0x2254('0x28')](_0x2254('0x29'),_0x3f6007['getSmtpOptions']());logger[_0x2254('0x12')](_0x2254('0x24'),_0x291894);logger[_0x2254('0x13')](_0x2254('0x24'),_0x291894,JSON['stringify'](_0x3f6007));_0x4e3658(_0x3f6007);})[_0x2254('0x1b')](function(_0x160fec){logger[_0x2254('0x17')](_0x2254('0x24'),_0x160fec[_0x2254('0x19')],_0x291894);_0xe29526(_0x2f32f8[_0x2254('0x17')](0x1f4,_0x160fec[_0x2254('0x19')]));});});};exports[_0x2254('0x2a')]=function(_0x4db9a8){var _0x362ad1=this;return new Promise(function(_0x5c15d7,_0x1df9c3){var _0x19b580={'body':_0x4db9a8[_0x2254('0x2b')],'channel':_0x2254('0x2c')};var _0x460bb3=_[_0x2254('0x2d')](_[_0x2254('0x2e')](db['CmContact'][_0x2254('0x2f')]),[_0x2254('0x30'),_0x2254('0x31'),_0x2254('0x32'),_0x2254('0x33')]);var _0x57cda2=![];if(_0x4db9a8[_0x2254('0x2b')]['id']){delete _0x4db9a8[_0x2254('0x2b')]['id'];}if(_[_0x2254('0x34')](_0x4db9a8[_0x2254('0x2b')][_0x2254('0x35')])){return _0x1df9c3(_0x362ad1['error'](0x1f4,_0x2254('0x36')));}if(_['isNil'](_0x4db9a8[_0x2254('0x2b')][_0x2254('0x2b')])||_0x4db9a8[_0x2254('0x2b')][_0x2254('0x2b')]===''){return _0x1df9c3(_0x362ad1[_0x2254('0x17')](0x1f4,_0x2254('0x37')));}if(_[_0x2254('0x34')](_0x4db9a8[_0x2254('0x2b')][_0x2254('0x38')])){return _0x1df9c3(_0x362ad1[_0x2254('0x17')](0x1f4,_0x2254('0x39')+_0x460bb3));}if(!_[_0x2254('0x3a')](_0x460bb3,_0x4db9a8[_0x2254('0x2b')]['mapKey'])){return _0x1df9c3(_0x362ad1[_0x2254('0x17')](0x1f4,_0x2254('0x3b')+_0x460bb3));}var _0x2c5609={};_0x2c5609[_0x4db9a8['body'][_0x2254('0x38')]]=_0x4db9a8[_0x2254('0x2b')][_0x2254('0x35')];return db[_0x2254('0x1d')][_0x2254('0x25')]({'where':{'id':_0x4db9a8[_0x2254('0x3c')]['id']},'include':[{'model':db[_0x2254('0x3d')],'as':_0x2254('0x3e'),'include':[{'model':db[_0x2254('0x3f')],'as':'Contacts','where':_0x2c5609,'limit':0x1,'order':[[_0x2254('0x31'),_0x2254('0x40')]]}]},{'model':db[_0x2254('0x41')],'as':_0x2254('0x42')},{'model':db[_0x2254('0x43')],'as':_0x2254('0x44'),'include':[{'model':db[_0x2254('0x45')],'as':_0x2254('0x45')}]}]})[_0x2254('0x11')](function(_0xa103ea){if(_0xa103ea&&_0xa103ea['List']){var _0x36b977=_0xa103ea[_0x2254('0x46')]({'plain':!![]});_0x19b580['account']=_[_0x2254('0x47')](_0x36b977,[_0x2254('0x42'),_0x2254('0x3e')]);_0x19b580[_0x2254('0x3c')]['smtpOptions']=_0xa103ea[_0x2254('0x48')]();_0x19b580[_0x2254('0x49')]=_0x36b977['Applications'];_0x19b580[_0x2254('0x4a')]=_0x36b977[_0x2254('0x3e')];_0x19b580[_0x2254('0x49')]=_[_0x2254('0x4b')](_0x19b580['applications'],[_0x2254('0x4c')],[_0x2254('0x4d')]);if(_0x19b580[_0x2254('0x3c')]&&_0x19b580['account']['autoclose']){_0x19b580[_0x2254('0x49')][_0x2254('0x4e')]({'id':0x0,'priority':_0x19b580['applications'][_0x2254('0x4f')]+0x1,'app':'close','appdata':'autoclose','interval':_0x2254('0x50')});}if(_0x19b580[_0x2254('0x3c')][_0x2254('0x42')]){delete _0x19b580[_0x2254('0x3c')][_0x2254('0x42')];}if(_0x19b580['account']['List']){delete _0x19b580[_0x2254('0x3c')]['List'];}if(_0x36b977[_0x2254('0x3e')][_0x2254('0x51')][_0x2254('0x4f')]){return _0x36b977[_0x2254('0x3e')]['Contacts'][0x0];}var _0xd5fb20=_[_0x2254('0xa')](_0x4db9a8['body'],{'firstName':_0x4db9a8['body'][_0x2254('0x35')],'ListId':_0x36b977['ListId']});_0xd5fb20[_0x4db9a8[_0x2254('0x2b')][_0x2254('0x38')]]=_0x4db9a8[_0x2254('0x2b')][_0x2254('0x35')];return db[_0x2254('0x3f')]['create'](_0xd5fb20);}else{throw new Error('List\x20not\x20found');}})[_0x2254('0x11')](function(_0x5b1bd8){_0x19b580[_0x2254('0x52')]=_0x5b1bd8;if(_0x5b1bd8){if(!_0x4db9a8['body']['message']['messageId']){_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x53')]=rs[_0x2254('0x54')]()+'\x20'+_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x35')];}var _0x25137c={'ContactId':_0x5b1bd8['id'],'MailAccountId':_0x4db9a8[_0x2254('0x3c')]['id'],'inReplyTo':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x53')],'to':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x35')],'cc':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')]['cc'],'subject':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')]['subject'],'attach':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x55')],'lastMsgAt':moment()[_0x2254('0x56')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'};return db['MailInteraction'][_0x2254('0x25')]({'where':{'closed':![],'MailAccountId':_0x4db9a8[_0x2254('0x3c')]['id']},'include':[{'model':db[_0x2254('0x57')],'as':_0x2254('0x58'),'attributes':[_0x2254('0x53')],'where':{'messageId':_0x4db9a8['body'][_0x2254('0x19')][_0x2254('0x59')]}}]})[_0x2254('0x11')](function(_0x4a7d36){if(_0x4a7d36){return[_0x4a7d36,![]];}return db['MailInteraction'][_0x2254('0x5a')](_0x25137c)['then'](function(_0x294931){return[_0x294931,!![]];});});}else{throw new Error(_0x2254('0x5b'));}})['spread'](function(_0x3c091e,_0x1b154f){if(_0x3c091e){_0x57cda2=_0x1b154f;if(!_0x1b154f){return _0x3c091e['update']({'inReplyTo':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')]['messageId'],'to':_0x4db9a8['body'][_0x2254('0x19')][_0x2254('0x35')],'cc':_0x4db9a8['body']['message']['cc'],'subject':_0x4db9a8[_0x2254('0x2b')]['message'][_0x2254('0x5c')],'attach':_0x3c091e['attach']?_0x3c091e[_0x2254('0x55')]:_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x55')],'substatus':null,'substatusAt':moment()['format'](_0x2254('0x5d')),'lastMsgAt':moment()['format'](_0x2254('0x5d')),'lastMsgDirection':'in'});}else{return _0x3c091e;}}})[_0x2254('0x11')](function(_0x5ed07f){_0x19b580[_0x2254('0x5e')]=_0x5ed07f[_0x2254('0x46')]({'plain':!![]});_0x19b580['interaction'][_0x2254('0x5f')]=_0x57cda2;return db[_0x2254('0x57')][_0x2254('0x5a')]({'body':_0x4db9a8[_0x2254('0x2b')]['body'],'MailAccountId':_0x4db9a8[_0x2254('0x3c')]['id'],'MailInteractionId':_0x5ed07f['id'],'direction':'in','ContactId':_0x19b580[_0x2254('0x52')]['id'],'messageId':_0x4db9a8['body'][_0x2254('0x19')][_0x2254('0x53')],'from':_0x4db9a8['body'][_0x2254('0x19')]['from'],'to':_0x4db9a8[_0x2254('0x2b')]['message']['to'],'cc':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')]['cc'],'subject':_0x4db9a8['body'][_0x2254('0x19')]['subject'],'attach':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x55')],'Attachments':_0x4db9a8['body'][_0x2254('0x19')]['attachments'],'originTo':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')]['originTo'],'originCc':_0x4db9a8['body'][_0x2254('0x19')][_0x2254('0x60')],'bcc':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')]['bcc'],'ChatWebsiteId':_0x4db9a8[_0x2254('0x2b')][_0x2254('0x19')][_0x2254('0x61')]||null,'originChannel':_0x4db9a8[_0x2254('0x2b')]['message'][_0x2254('0x62')]||_0x2254('0x63'),'ChatOfflineMessageId':_0x4db9a8['body'][_0x2254('0x19')]['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x2254('0x64')],'as':'Attachments'}]});})['then'](function(_0x4efb07){_0x19b580[_0x2254('0x19')]=_0x4efb07;if(_0x19b580['interaction'][_0x2254('0x65')]){return db[_0x2254('0x66')]['find']({'attributes':['id',_0x2254('0x67')],'where':{'id':_0x19b580[_0x2254('0x5e')][_0x2254('0x65')]}})[_0x2254('0x11')](function(_0x259e10){if(_0x259e10){_0x19b580[_0x2254('0x49')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x259e10[_0x2254('0x67')]+','+(_0x19b580[_0x2254('0x3c')][_0x2254('0x68')]||0xa),'interval':_0x2254('0x50')});}return respondWithRpcPromise(_0x2254('0x69'),_0x2254('0x6a'),_0x19b580);});}return respondWithRpcPromise(_0x2254('0x69'),_0x2254('0x6a'),_0x19b580);})[_0x2254('0x11')](function(_0x39b95b){_0x5c15d7(_0x39b95b);})['catch'](function(_0x25eb17){_0x1df9c3(_0x362ad1[_0x2254('0x17')](0x1f4,_0x25eb17['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 394bc1e..b8f882a 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 _0xbb72=['register','length','mailAccount:','remove','update','emit','removeListener'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbb72,0xce));var _0x2bb7=function(_0x489fe7,_0xe66878){_0x489fe7=_0x489fe7-0x0;var _0x35c203=_0xbb72[_0x489fe7];return _0x35c203;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0x2bb7('0x0'),_0x2bb7('0x1')];function createListener(_0x4d77a9,_0x3cc783){return function(_0x5dffa9){_0x3cc783[_0x2bb7('0x2')](_0x4d77a9,_0x5dffa9);};}function removeListener(_0x5c9ebd,_0x4975da){return function(){MailAccountEvents[_0x2bb7('0x3')](_0x5c9ebd,_0x4975da);};}exports[_0x2bb7('0x4')]=function(_0x186762){for(var _0x28445a=0x0,_0x4e512d=events[_0x2bb7('0x5')];_0x28445a<_0x4e512d;_0x28445a++){var _0x41669b=events[_0x28445a];var _0x2c57d2=createListener(_0x2bb7('0x6')+_0x41669b,_0x186762);MailAccountEvents['on'](_0x41669b,_0x2c57d2);}}; \ No newline at end of file +var _0xe206=['update','emit','removeListener','register','length','save','remove'];(function(_0x5b673f,_0x4e69a8){var _0x5d6898=function(_0x273437){while(--_0x273437){_0x5b673f['push'](_0x5b673f['shift']());}};_0x5d6898(++_0x4e69a8);}(_0xe206,0x101));var _0x6e20=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xe206[_0x4c12ec];return _0x3ae42c;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=[_0x6e20('0x0'),_0x6e20('0x1'),_0x6e20('0x2')];function createListener(_0x44161a,_0x5de7ff){return function(_0x4ae79c){_0x5de7ff[_0x6e20('0x3')](_0x44161a,_0x4ae79c);};}function removeListener(_0x4083fe,_0x4c0282){return function(){MailAccountEvents[_0x6e20('0x4')](_0x4083fe,_0x4c0282);};}exports[_0x6e20('0x5')]=function(_0x4dd6ba){for(var _0x196f64=0x0,_0x28ae32=events[_0x6e20('0x6')];_0x196f64<_0x28ae32;_0x196f64++){var _0x31176c=events[_0x196f64];var _0x50e088=createListener('mailAccount:'+_0x31176c,_0x4dd6ba);MailAccountEvents['on'](_0x31176c,_0x50e088);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 97512b9..a6fb4ed 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 _0x02fc=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put'];(function(_0x36594d,_0x5aaa06){var _0x1b8802=function(_0x578cc9){while(--_0x578cc9){_0x36594d['push'](_0x36594d['shift']());}};_0x1b8802(++_0x5aaa06);}(_0x02fc,0x89));var _0xc02f=function(_0x5a5fa4,_0x111420){_0x5a5fa4=_0x5a5fa4-0x0;var _0x4606dd=_0x02fc[_0x5a5fa4];return _0x4606dd;};'use strict';var multer=require(_0xc02f('0x0'));var util=require(_0xc02f('0x1'));var path=require(_0xc02f('0x2'));var timeout=require(_0xc02f('0x3'));var express=require('express');var router=express[_0xc02f('0x4')]();var fs_extra=require(_0xc02f('0x5'));var auth=require(_0xc02f('0x6'));var interaction=require(_0xc02f('0x7'));var config=require(_0xc02f('0x8'));var controller=require(_0xc02f('0x9'));router[_0xc02f('0xa')](_0xc02f('0xb'),auth[_0xc02f('0xc')](),controller[_0xc02f('0xd')]);router[_0xc02f('0xe')](_0xc02f('0xb'),auth[_0xc02f('0xc')](),controller[_0xc02f('0xf')]);router[_0xc02f('0x10')](_0xc02f('0xb'),auth['isAuthenticated'](),controller[_0xc02f('0x11')]);module[_0xc02f('0x12')]=router; \ No newline at end of file +var _0x3823=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x39dd7e,_0x2cfad4){var _0x5c64f5=function(_0x20a462){while(--_0x20a462){_0x39dd7e['push'](_0x39dd7e['shift']());}};_0x5c64f5(++_0x2cfad4);}(_0x3823,0xf2));var _0x3382=function(_0x9d742e,_0x362c0e){_0x9d742e=_0x9d742e-0x0;var _0x4b8142=_0x3823[_0x9d742e];return _0x4b8142;};'use strict';var multer=require('multer');var util=require(_0x3382('0x0'));var path=require(_0x3382('0x1'));var timeout=require(_0x3382('0x2'));var express=require(_0x3382('0x3'));var router=express[_0x3382('0x4')]();var fs_extra=require(_0x3382('0x5'));var auth=require(_0x3382('0x6'));var interaction=require(_0x3382('0x7'));var config=require(_0x3382('0x8'));var controller=require(_0x3382('0x9'));router[_0x3382('0xa')](_0x3382('0xb'),auth[_0x3382('0xc')](),controller[_0x3382('0xd')]);router[_0x3382('0xe')](_0x3382('0xb'),auth[_0x3382('0xc')](),controller[_0x3382('0xf')]);router[_0x3382('0x10')](_0x3382('0xb'),auth[_0x3382('0xc')](),controller[_0x3382('0x11')]);module[_0x3382('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 3270f08..b73282d 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 _0x816c=['INTEGER','noop','STRING','*,*,*,*','sequelize'];(function(_0x25e7ee,_0x4d8966){var _0x1251f2=function(_0x165472){while(--_0x165472){_0x25e7ee['push'](_0x25e7ee['shift']());}};_0x1251f2(++_0x4d8966);}(_0x816c,0xc7));var _0xc816=function(_0x2e1051,_0x58b01d){_0x2e1051=_0x2e1051-0x0;var _0x5aa734=_0x816c[_0x2e1051];return _0x5aa734;};'use strict';var Sequelize=require(_0xc816('0x0'));module['exports']={'priority':{'type':Sequelize[_0xc816('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc816('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xc816('0x3')]},'interval':{'type':Sequelize[_0xc816('0x3')],'defaultValue':_0xc816('0x4')}}; \ No newline at end of file +var _0x83bb=['*,*,*,*','sequelize','exports','INTEGER','STRING','TEXT'];(function(_0x42fba6,_0x6d76b7){var _0x3a3312=function(_0x24fdc1){while(--_0x24fdc1){_0x42fba6['push'](_0x42fba6['shift']());}};_0x3a3312(++_0x6d76b7);}(_0x83bb,0x1b7));var _0xb83b=function(_0x43bdb2,_0x446e5b){_0x43bdb2=_0x43bdb2-0x0;var _0xc817e1=_0x83bb[_0x43bdb2];return _0xc817e1;};'use strict';var Sequelize=require(_0xb83b('0x0'));module[_0xb83b('0x1')]={'priority':{'type':Sequelize[_0xb83b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb83b('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xb83b('0x4')]()},'description':{'type':Sequelize[_0xb83b('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb83b('0x5')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index a66fb0b..eeef936 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 _0xbdb7=['update','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','attributes','length','includeAll','merge','find','then','body','catch','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','save'];(function(_0x30f030,_0xd03b7a){var _0xf7614f=function(_0x261cac){while(--_0x261cac){_0x30f030['push'](_0x30f030['shift']());}};_0xf7614f(++_0xd03b7a);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x871ef5,_0x58880b){_0x871ef5=_0x871ef5-0x0;var _0x1f62ea=_0xbdb7[_0x871ef5];return _0x1f62ea;};'use strict';var emlformat=require(_0x7bdb('0x0'));var rimraf=require(_0x7bdb('0x1'));var zipdir=require(_0x7bdb('0x2'));var jsonpatch=require(_0x7bdb('0x3'));var rp=require(_0x7bdb('0x4'));var moment=require(_0x7bdb('0x5'));var BPromise=require(_0x7bdb('0x6'));var Mustache=require(_0x7bdb('0x7'));var util=require(_0x7bdb('0x8'));var path=require('path');var sox=require(_0x7bdb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bdb('0xa'));var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x7bdb('0x16'))['db'];function respondWithStatusCode(_0x25e3cb,_0x496613){_0x496613=_0x496613||0xcc;return function(_0x8d74ff){if(_0x8d74ff){return _0x25e3cb['sendStatus'](_0x496613);}return _0x25e3cb['status'](_0x496613)[_0x7bdb('0x17')]();};}function respondWithResult(_0x46dd4a,_0x4fd91a){_0x4fd91a=_0x4fd91a||0xc8;return function(_0x50eeca){if(_0x50eeca){return _0x46dd4a['status'](_0x4fd91a)[_0x7bdb('0x18')](_0x50eeca);}};}function respondWithFilteredResult(_0x195b2e,_0xe9919f){return function(_0x25d417){if(_0x25d417){var _0x31c909=typeof _0xe9919f[_0x7bdb('0x19')]===_0x7bdb('0x1a')&&typeof _0xe9919f[_0x7bdb('0x1b')]==='undefined';var _0x1c5750=_0x25d417[_0x7bdb('0x1c')];var _0x5723f4=_0x31c909?0x0:_0xe9919f[_0x7bdb('0x19')];var _0x4ffd4b=_0x31c909?_0x25d417[_0x7bdb('0x1c')]:_0xe9919f[_0x7bdb('0x19')]+_0xe9919f['limit'];var _0x3e5f8e;if(_0x4ffd4b>=_0x1c5750){_0x4ffd4b=_0x1c5750;_0x3e5f8e=0xc8;}else{_0x3e5f8e=0xce;}_0x195b2e[_0x7bdb('0x1d')](_0x3e5f8e);return _0x195b2e[_0x7bdb('0x1e')](_0x7bdb('0x1f'),_0x5723f4+'-'+_0x4ffd4b+'/'+_0x1c5750)[_0x7bdb('0x18')](_0x25d417);}return null;};}function patchUpdates(_0x5bfc35){return function(_0x49f353){try{jsonpatch[_0x7bdb('0x20')](_0x49f353,_0x5bfc35,!![]);}catch(_0xcb25f2){return BPromise['reject'](_0xcb25f2);}return _0x49f353[_0x7bdb('0x21')]();};}function saveUpdates(_0x118ea1,_0x346c72){return function(_0x3f53e7){if(_0x3f53e7){return _0x3f53e7[_0x7bdb('0x22')](_0x118ea1)['then'](function(_0x1d37ac){return _0x1d37ac;});}return null;};}function removeEntity(_0xdad53d,_0x40c447){return function(_0x3a456f){if(_0x3a456f){return _0x3a456f['destroy']()['then'](function(){_0xdad53d[_0x7bdb('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47abaf,_0x4a9e02){return function(_0x2abef6){if(!_0x2abef6){_0x47abaf['sendStatus'](0x194);}return _0x2abef6;};}function handleError(_0x2b14bc,_0x72ba69){_0x72ba69=_0x72ba69||0x1f4;return function(_0x3ec129){logger[_0x7bdb('0x23')](_0x3ec129[_0x7bdb('0x24')]);if(_0x3ec129['name']){delete _0x3ec129[_0x7bdb('0x25')];}_0x2b14bc[_0x7bdb('0x1d')](_0x72ba69)[_0x7bdb('0x26')](_0x3ec129);};}exports[_0x7bdb('0x27')]=function(_0x371e8a,_0x2e8e65){var _0x1e9996={'raw':!![],'where':{'id':_0x371e8a[_0x7bdb('0x28')]['id']}},_0xd2d7be={};_0xd2d7be[_0x7bdb('0x29')]=_[_0x7bdb('0x2a')](db[_0x7bdb('0x2b')]['rawAttributes']);_0xd2d7be[_0x7bdb('0x2c')]=_[_0x7bdb('0x2a')](_0x371e8a[_0x7bdb('0x2c')]);_0xd2d7be[_0x7bdb('0x2d')]=_[_0x7bdb('0x2e')](_0xd2d7be['model'],_0xd2d7be[_0x7bdb('0x2c')]);_0x1e9996[_0x7bdb('0x2f')]=_[_0x7bdb('0x2e')](_0xd2d7be[_0x7bdb('0x29')],qs['fields'](_0x371e8a['query']['fields']));_0x1e9996[_0x7bdb('0x2f')]=_0x1e9996['attributes'][_0x7bdb('0x30')]?_0x1e9996['attributes']:_0xd2d7be[_0x7bdb('0x29')];if(_0x371e8a[_0x7bdb('0x2c')][_0x7bdb('0x31')]){_0x1e9996['include']=[{'all':!![]}];}_0x1e9996=_[_0x7bdb('0x32')]({},_0x1e9996,_0x371e8a['options']);return db['MailApplication'][_0x7bdb('0x33')](_0x1e9996)['then'](handleEntityNotFound(_0x2e8e65,null))[_0x7bdb('0x34')](respondWithResult(_0x2e8e65,null))['catch'](handleError(_0x2e8e65,null));};exports['update']=function(_0x206c26,_0x353b26){if(_0x206c26[_0x7bdb('0x35')]['id']){delete _0x206c26[_0x7bdb('0x35')]['id'];}return db[_0x7bdb('0x2b')][_0x7bdb('0x33')]({'where':{'id':_0x206c26['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x353b26,null))[_0x7bdb('0x34')](saveUpdates(_0x206c26[_0x7bdb('0x35')],null))[_0x7bdb('0x34')](respondWithResult(_0x353b26,null))[_0x7bdb('0x36')](handleError(_0x353b26,null));};exports[_0x7bdb('0x37')]=function(_0x228340,_0x2587af){return db[_0x7bdb('0x2b')]['find']({'where':{'id':_0x228340['params']['id']}})[_0x7bdb('0x34')](handleEntityNotFound(_0x2587af,null))[_0x7bdb('0x34')](removeEntity(_0x2587af,null))[_0x7bdb('0x36')](handleError(_0x2587af,null));}; \ No newline at end of file +var _0xda3f=['includeAll','include','merge','find','catch','body','MailApplication','destroy','rimraf','zip-dir','bluebird','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','end','stack','name','send','params','model','keys','query','filters','intersection','attributes','fields','length'];(function(_0xba359c,_0x155327){var _0x5a8b09=function(_0x597295){while(--_0x597295){_0xba359c['push'](_0xba359c['shift']());}};_0x5a8b09(++_0x155327);}(_0xda3f,0xec));var _0xfda3=function(_0x57b9a0,_0x330506){_0x57b9a0=_0x57b9a0-0x0;var _0x4092a1=_0xda3f[_0x57b9a0];return _0x4092a1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfda3('0x0'));var zipdir=require(_0xfda3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xfda3('0x2'));var Mustache=require('mustache');var util=require(_0xfda3('0x3'));var path=require(_0xfda3('0x4'));var sox=require('sox');var csv=require(_0xfda3('0x5'));var ejs=require(_0xfda3('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfda3('0x7'));var crypto=require(_0xfda3('0x8'));var jsforce=require(_0xfda3('0x9'));var deskjs=require(_0xfda3('0xa'));var toCsv=require(_0xfda3('0x5'));var querystring=require(_0xfda3('0xb'));var Papa=require(_0xfda3('0xc'));var Redis=require(_0xfda3('0xd'));var authService=require(_0xfda3('0xe'));var qs=require(_0xfda3('0xf'));var as=require(_0xfda3('0x10'));var hardwareService=require(_0xfda3('0x11'));var logger=require('../../config/logger')(_0xfda3('0x12'));var utils=require(_0xfda3('0x13'));var config=require(_0xfda3('0x14'));var licenseUtil=require(_0xfda3('0x15'));var db=require(_0xfda3('0x16'))['db'];function respondWithStatusCode(_0x4b77ea,_0x583125){_0x583125=_0x583125||0xcc;return function(_0x5d7d5b){if(_0x5d7d5b){return _0x4b77ea[_0xfda3('0x17')](_0x583125);}return _0x4b77ea[_0xfda3('0x18')](_0x583125)['end']();};}function respondWithResult(_0x501588,_0x587e9b){_0x587e9b=_0x587e9b||0xc8;return function(_0x227d72){if(_0x227d72){return _0x501588[_0xfda3('0x18')](_0x587e9b)['json'](_0x227d72);}};}function respondWithFilteredResult(_0x57a229,_0x533365){return function(_0x80ea80){if(_0x80ea80){var _0x474707=typeof _0x533365[_0xfda3('0x19')]===_0xfda3('0x1a')&&typeof _0x533365[_0xfda3('0x1b')]===_0xfda3('0x1a');var _0x2aadcb=_0x80ea80[_0xfda3('0x1c')];var _0x4680bf=_0x474707?0x0:_0x533365[_0xfda3('0x19')];var _0x54a7c6=_0x474707?_0x80ea80[_0xfda3('0x1c')]:_0x533365[_0xfda3('0x19')]+_0x533365[_0xfda3('0x1b')];var _0x32855a;if(_0x54a7c6>=_0x2aadcb){_0x54a7c6=_0x2aadcb;_0x32855a=0xc8;}else{_0x32855a=0xce;}_0x57a229['status'](_0x32855a);return _0x57a229[_0xfda3('0x1d')](_0xfda3('0x1e'),_0x4680bf+'-'+_0x54a7c6+'/'+_0x2aadcb)[_0xfda3('0x1f')](_0x80ea80);}return null;};}function patchUpdates(_0x51e731){return function(_0x5ad52a){try{jsonpatch[_0xfda3('0x20')](_0x5ad52a,_0x51e731,!![]);}catch(_0x38d428){return BPromise[_0xfda3('0x21')](_0x38d428);}return _0x5ad52a['save']();};}function saveUpdates(_0x3cf5a9,_0xef2535){return function(_0x1e15a8){if(_0x1e15a8){return _0x1e15a8[_0xfda3('0x22')](_0x3cf5a9)[_0xfda3('0x23')](function(_0x2b84b7){return _0x2b84b7;});}return null;};}function removeEntity(_0x2677f6,_0xc6fb9a){return function(_0x16eaa6){if(_0x16eaa6){return _0x16eaa6['destroy']()[_0xfda3('0x23')](function(){_0x2677f6[_0xfda3('0x18')](0xcc)[_0xfda3('0x24')]();});}};}function handleEntityNotFound(_0x4ae9b9,_0x45a977){return function(_0x39e246){if(!_0x39e246){_0x4ae9b9[_0xfda3('0x17')](0x194);}return _0x39e246;};}function handleError(_0x38946d,_0x1cb831){_0x1cb831=_0x1cb831||0x1f4;return function(_0xad9f7b){logger['error'](_0xad9f7b[_0xfda3('0x25')]);if(_0xad9f7b[_0xfda3('0x26')]){delete _0xad9f7b[_0xfda3('0x26')];}_0x38946d[_0xfda3('0x18')](_0x1cb831)[_0xfda3('0x27')](_0xad9f7b);};}exports['show']=function(_0x3c1549,_0x4101b1){var _0x301509={'raw':!![],'where':{'id':_0x3c1549[_0xfda3('0x28')]['id']}},_0x474992={};_0x474992[_0xfda3('0x29')]=_[_0xfda3('0x2a')](db['MailApplication']['rawAttributes']);_0x474992[_0xfda3('0x2b')]=_['keys'](_0x3c1549['query']);_0x474992[_0xfda3('0x2c')]=_[_0xfda3('0x2d')](_0x474992[_0xfda3('0x29')],_0x474992[_0xfda3('0x2b')]);_0x301509[_0xfda3('0x2e')]=_[_0xfda3('0x2d')](_0x474992[_0xfda3('0x29')],qs[_0xfda3('0x2f')](_0x3c1549[_0xfda3('0x2b')]['fields']));_0x301509[_0xfda3('0x2e')]=_0x301509[_0xfda3('0x2e')][_0xfda3('0x30')]?_0x301509[_0xfda3('0x2e')]:_0x474992[_0xfda3('0x29')];if(_0x3c1549[_0xfda3('0x2b')][_0xfda3('0x31')]){_0x301509[_0xfda3('0x32')]=[{'all':!![]}];}_0x301509=_[_0xfda3('0x33')]({},_0x301509,_0x3c1549['options']);return db['MailApplication'][_0xfda3('0x34')](_0x301509)[_0xfda3('0x23')](handleEntityNotFound(_0x4101b1,null))['then'](respondWithResult(_0x4101b1,null))[_0xfda3('0x35')](handleError(_0x4101b1,null));};exports[_0xfda3('0x22')]=function(_0x28ca96,_0x52ee98){if(_0x28ca96[_0xfda3('0x36')]['id']){delete _0x28ca96[_0xfda3('0x36')]['id'];}return db[_0xfda3('0x37')][_0xfda3('0x34')]({'where':{'id':_0x28ca96[_0xfda3('0x28')]['id']}})['then'](handleEntityNotFound(_0x52ee98,null))[_0xfda3('0x23')](saveUpdates(_0x28ca96[_0xfda3('0x36')],null))[_0xfda3('0x23')](respondWithResult(_0x52ee98,null))['catch'](handleError(_0x52ee98,null));};exports[_0xfda3('0x38')]=function(_0x4854b1,_0x2d9a3f){return db[_0xfda3('0x37')][_0xfda3('0x34')]({'where':{'id':_0x4854b1[_0xfda3('0x28')]['id']}})[_0xfda3('0x23')](handleEntityNotFound(_0x2d9a3f,null))[_0xfda3('0x23')](removeEntity(_0x2d9a3f,null))[_0xfda3('0x35')](handleError(_0x2d9a3f,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 2c607cc..eb1fc5f 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 _0xb16c=['bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x28652b,_0x1456c0){var _0x909610=function(_0x36064a){while(--_0x36064a){_0x28652b['push'](_0x28652b['shift']());}};_0x909610(++_0x1456c0);}(_0xb16c,0xc0));var _0xcb16=function(_0x58f904,_0x4d2646){_0x58f904=_0x58f904-0x0;var _0x3e35ef=_0xb16c[_0x58f904];return _0x3e35ef;};'use strict';var _=require(_0xcb16('0x0'));var util=require(_0xcb16('0x1'));var logger=require(_0xcb16('0x2'))('api');var moment=require('moment');var BPromise=require(_0xcb16('0x3'));var rp=require(_0xcb16('0x4'));var fs=require('fs');var path=require(_0xcb16('0x5'));var rimraf=require(_0xcb16('0x6'));var config=require(_0xcb16('0x7'));var attributes=require(_0xcb16('0x8'));module[_0xcb16('0x9')]=function(_0x3b2036,_0x1a4db5){return _0x3b2036[_0xcb16('0xa')](_0xcb16('0xb'),attributes,{'tableName':_0xcb16('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcb16('0xd'),'collate':_0xcb16('0xe')});}; \ No newline at end of file +var _0xa64d=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x333151,_0x347994){var _0x52ead1=function(_0x1d018e){while(--_0x1d018e){_0x333151['push'](_0x333151['shift']());}};_0x52ead1(++_0x347994);}(_0xa64d,0x140));var _0xda64=function(_0x42f16e,_0x365ebd){_0x42f16e=_0x42f16e-0x0;var _0x4e25fe=_0xa64d[_0x42f16e];return _0x4e25fe;};'use strict';var _=require(_0xda64('0x0'));var util=require(_0xda64('0x1'));var logger=require(_0xda64('0x2'))(_0xda64('0x3'));var moment=require(_0xda64('0x4'));var BPromise=require(_0xda64('0x5'));var rp=require(_0xda64('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xda64('0x7'));var config=require(_0xda64('0x8'));var attributes=require(_0xda64('0x9'));module[_0xda64('0xa')]=function(_0x848789,_0xe364b6){return _0x848789[_0xda64('0xb')](_0xda64('0xc'),attributes,{'tableName':_0xda64('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xda64('0xe'),'collate':_0xda64('0xf')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index d48e3a6..acebf07 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 _0x3ba7=['jayson/promise','client','http','request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x1ee15d,_0x51813e){var _0xef4846=function(_0x3abc0f){while(--_0x3abc0f){_0x1ee15d['push'](_0x1ee15d['shift']());}};_0xef4846(++_0x51813e);}(_0x3ba7,0x16c));var _0x73ba=function(_0x276ca2,_0x95cdee){_0x276ca2=_0x276ca2-0x0;var _0x1ca2c9=_0x3ba7[_0x276ca2];return _0x1ca2c9;};'use strict';var _=require(_0x73ba('0x0'));var util=require(_0x73ba('0x1'));var moment=require(_0x73ba('0x2'));var BPromise=require(_0x73ba('0x3'));var rs=require(_0x73ba('0x4'));var fs=require('fs');var Redis=require(_0x73ba('0x5'));var db=require(_0x73ba('0x6'))['db'];var utils=require(_0x73ba('0x7'));var logger=require(_0x73ba('0x8'))('rpc');var config=require(_0x73ba('0x9'));var jayson=require(_0x73ba('0xa'));var client=jayson[_0x73ba('0xb')][_0x73ba('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x376f8a,_0x3437b3,_0x28ac82){return new BPromise(function(_0x543d2a,_0x169e36){return client[_0x73ba('0xd')](_0x376f8a,_0x28ac82)[_0x73ba('0xe')](function(_0x29033f){logger[_0x73ba('0xf')](_0x73ba('0x10'),_0x3437b3,'request\x20sent');logger[_0x73ba('0x11')](_0x73ba('0x12'),_0x3437b3,_0x73ba('0x13'),JSON[_0x73ba('0x14')](_0x29033f));if(_0x29033f[_0x73ba('0x15')]){if(_0x29033f[_0x73ba('0x15')][_0x73ba('0x16')]===0x1f4){logger[_0x73ba('0x15')]('MailApplication,\x20%s,\x20%s',_0x3437b3,_0x29033f['error'][_0x73ba('0x17')]);return _0x169e36(_0x29033f['error'][_0x73ba('0x17')]);}logger[_0x73ba('0x15')](_0x73ba('0x10'),_0x3437b3,_0x29033f[_0x73ba('0x15')][_0x73ba('0x17')]);return _0x543d2a(_0x29033f[_0x73ba('0x15')][_0x73ba('0x17')]);}else{logger[_0x73ba('0xf')](_0x73ba('0x10'),_0x3437b3,'request\x20sent');_0x543d2a(_0x29033f[_0x73ba('0x18')][_0x73ba('0x17')]);}})[_0x73ba('0x19')](function(_0xf6cfaf){logger['error'](_0x73ba('0x10'),_0x3437b3,_0xf6cfaf);_0x169e36(_0xf6cfaf);});});}exports[_0x73ba('0x1a')]=function(_0xefeb93){var _0x411c0e=this;return new Promise(function(_0x4cebc6,_0x4aef21){return db[_0x73ba('0x1b')][_0x73ba('0x1c')](_0xefeb93[_0x73ba('0x1d')],{'raw':_0xefeb93['options']?_0xefeb93['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xefeb93[_0x73ba('0x1e')]?_0xefeb93[_0x73ba('0x1e')][_0x73ba('0x1f')]||null:null,'attributes':_0xefeb93['options']?_0xefeb93[_0x73ba('0x1e')][_0x73ba('0x20')]||null:null,'limit':_0xefeb93[_0x73ba('0x1e')]?_0xefeb93[_0x73ba('0x1e')][_0x73ba('0x21')]||null:null})[_0x73ba('0xe')](function(_0x3023aa){logger['info']('UpdateMailApplication',_0xefeb93);logger['debug']('UpdateMailApplication',_0xefeb93,JSON[_0x73ba('0x14')](_0x3023aa));_0x4cebc6(_0x3023aa);})[_0x73ba('0x19')](function(_0x79d923){logger[_0x73ba('0x15')](_0x73ba('0x1a'),_0x79d923[_0x73ba('0x17')],_0xefeb93);_0x4aef21(_0x411c0e[_0x73ba('0x15')](0x1f4,_0x79d923['message']));});});}; \ No newline at end of file +var _0x2752=['then','info','MailApplication,\x20%s,\x20%s','request\x20sent','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x39ed9c,_0x58277d){var _0x30d1e7=function(_0x992b42){while(--_0x992b42){_0x39ed9c['push'](_0x39ed9c['shift']());}};_0x30d1e7(++_0x58277d);}(_0x2752,0x12b));var _0x2275=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2752[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2275('0x0'));var util=require('util');var moment=require(_0x2275('0x1'));var BPromise=require('bluebird');var rs=require(_0x2275('0x2'));var fs=require('fs');var Redis=require(_0x2275('0x3'));var db=require(_0x2275('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2275('0x5'))(_0x2275('0x6'));var config=require(_0x2275('0x7'));var jayson=require(_0x2275('0x8'));var client=jayson[_0x2275('0x9')][_0x2275('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48e596,_0x1ef09f,_0x4ec32f){return new BPromise(function(_0x565af8,_0x275bdf){return client['request'](_0x48e596,_0x4ec32f)[_0x2275('0xb')](function(_0x8e8c7f){logger[_0x2275('0xc')](_0x2275('0xd'),_0x1ef09f,_0x2275('0xe'));logger['debug'](_0x2275('0xf'),_0x1ef09f,_0x2275('0xe'),JSON[_0x2275('0x10')](_0x8e8c7f));if(_0x8e8c7f[_0x2275('0x11')]){if(_0x8e8c7f[_0x2275('0x11')][_0x2275('0x12')]===0x1f4){logger['error'](_0x2275('0xd'),_0x1ef09f,_0x8e8c7f[_0x2275('0x11')][_0x2275('0x13')]);return _0x275bdf(_0x8e8c7f[_0x2275('0x11')][_0x2275('0x13')]);}logger[_0x2275('0x11')](_0x2275('0xd'),_0x1ef09f,_0x8e8c7f[_0x2275('0x11')][_0x2275('0x13')]);return _0x565af8(_0x8e8c7f[_0x2275('0x11')]['message']);}else{logger[_0x2275('0xc')]('MailApplication,\x20%s,\x20%s',_0x1ef09f,_0x2275('0xe'));_0x565af8(_0x8e8c7f[_0x2275('0x14')][_0x2275('0x13')]);}})[_0x2275('0x15')](function(_0x27248f){logger[_0x2275('0x11')]('MailApplication,\x20%s,\x20%s',_0x1ef09f,_0x27248f);_0x275bdf(_0x27248f);});});}exports[_0x2275('0x16')]=function(_0x1e1171){var _0x14b6bb=this;return new Promise(function(_0x30e1ad,_0x4f722d){return db[_0x2275('0x17')][_0x2275('0x18')](_0x1e1171[_0x2275('0x19')],{'raw':_0x1e1171[_0x2275('0x1a')]?_0x1e1171['options'][_0x2275('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e1171[_0x2275('0x1a')]?_0x1e1171[_0x2275('0x1a')][_0x2275('0x1c')]||null:null,'attributes':_0x1e1171['options']?_0x1e1171[_0x2275('0x1a')][_0x2275('0x1d')]||null:null,'limit':_0x1e1171['options']?_0x1e1171[_0x2275('0x1a')][_0x2275('0x1e')]||null:null})['then'](function(_0x151b84){logger['info']('UpdateMailApplication',_0x1e1171);logger['debug'](_0x2275('0x16'),_0x1e1171,JSON[_0x2275('0x10')](_0x151b84));_0x30e1ad(_0x151b84);})[_0x2275('0x15')](function(_0x2166ce){logger[_0x2275('0x11')](_0x2275('0x16'),_0x2166ce[_0x2275('0x13')],_0x1e1171);_0x4f722d(_0x14b6bb[_0x2275('0x11')](0x1f4,_0x2166ce['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index fc5b4d4..e48f73d 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 _0x2432=['get','isAuthenticated','index','show','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','mail','mailinteraction:addtags','addTags','put','tracked','mailinteraction:update','update','delete','/:id','mailinteraction:destroy','destroy','exports','express','Router','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller'];(function(_0x7ac046,_0x3a1e11){var _0x4b6cc6=function(_0x1eb088){while(--_0x1eb088){_0x7ac046['push'](_0x7ac046['shift']());}};_0x4b6cc6(++_0x3a1e11);}(_0x2432,0x100));var _0x2243=function(_0x4debf3,_0x3abfaf){_0x4debf3=_0x4debf3-0x0;var _0x5a4b30=_0x2432[_0x4debf3];return _0x5a4b30;};'use strict';var express=require(_0x2243('0x0'));var router=express[_0x2243('0x1')]();var auth=require(_0x2243('0x2'));var interaction=require(_0x2243('0x3'));var controller=require(_0x2243('0x4'));router[_0x2243('0x5')]('/',auth[_0x2243('0x6')](),controller[_0x2243('0x7')]);router[_0x2243('0x5')]('/describe',auth[_0x2243('0x6')](),controller['describe']);router[_0x2243('0x5')]('/:id',auth[_0x2243('0x6')](),controller[_0x2243('0x8')]);router[_0x2243('0x5')]('/:id/messages',auth['isAuthenticated'](),controller[_0x2243('0x9')]);router[_0x2243('0x5')](_0x2243('0xa'),auth[_0x2243('0x6')](),controller[_0x2243('0xb')]);router[_0x2243('0xc')]('/',auth[_0x2243('0x6')](),controller[_0x2243('0xd')]);router[_0x2243('0xc')](_0x2243('0xe'),auth[_0x2243('0x6')](),controller[_0x2243('0xf')]);router[_0x2243('0xc')](_0x2243('0x10'),auth[_0x2243('0x6')](),interaction['tracked'](_0x2243('0x11'),_0x2243('0x12')),controller[_0x2243('0x13')]);router[_0x2243('0x14')]('/:id',auth['isAuthenticated'](),interaction[_0x2243('0x15')](_0x2243('0x11'),_0x2243('0x16')),controller[_0x2243('0x17')]);router[_0x2243('0x18')](_0x2243('0x19'),auth[_0x2243('0x6')](),interaction[_0x2243('0x15')](_0x2243('0x11'),_0x2243('0x1a')),controller[_0x2243('0x1b')]);router[_0x2243('0x18')](_0x2243('0x10'),auth['isAuthenticated'](),controller['removeTags']);module[_0x2243('0x1c')]=router; \ No newline at end of file +var _0x4d50=['getMessages','download','post','create','/:id/tags','tracked','mail','addTags','put','mailinteraction:update','update','delete','mailinteraction:destroy','removeTags','exports','express','Router','../../components/interaction/service','index','get','/describe','isAuthenticated','/:id','show','/:id/messages'];(function(_0x3d745c,_0x46e9b4){var _0x4827d4=function(_0x37d38e){while(--_0x37d38e){_0x3d745c['push'](_0x3d745c['shift']());}};_0x4827d4(++_0x46e9b4);}(_0x4d50,0x122));var _0x04d5=function(_0x5822e9,_0x2fed10){_0x5822e9=_0x5822e9-0x0;var _0x47a447=_0x4d50[_0x5822e9];return _0x47a447;};'use strict';var express=require(_0x04d5('0x0'));var router=express[_0x04d5('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x04d5('0x2'));var controller=require('./mailInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x04d5('0x3')]);router[_0x04d5('0x4')](_0x04d5('0x5'),auth[_0x04d5('0x6')](),controller['describe']);router[_0x04d5('0x4')](_0x04d5('0x7'),auth[_0x04d5('0x6')](),controller[_0x04d5('0x8')]);router[_0x04d5('0x4')](_0x04d5('0x9'),auth[_0x04d5('0x6')](),controller[_0x04d5('0xa')]);router['get']('/:id/download',auth[_0x04d5('0x6')](),controller[_0x04d5('0xb')]);router[_0x04d5('0xc')]('/',auth[_0x04d5('0x6')](),controller[_0x04d5('0xd')]);router['post'](_0x04d5('0x9'),auth[_0x04d5('0x6')](),controller['addMessage']);router[_0x04d5('0xc')](_0x04d5('0xe'),auth['isAuthenticated'](),interaction[_0x04d5('0xf')](_0x04d5('0x10'),'mailinteraction:addtags'),controller[_0x04d5('0x11')]);router[_0x04d5('0x12')](_0x04d5('0x7'),auth[_0x04d5('0x6')](),interaction[_0x04d5('0xf')](_0x04d5('0x10'),_0x04d5('0x13')),controller[_0x04d5('0x14')]);router[_0x04d5('0x15')](_0x04d5('0x7'),auth[_0x04d5('0x6')](),interaction[_0x04d5('0xf')](_0x04d5('0x10'),_0x04d5('0x16')),controller['destroy']);router['delete'](_0x04d5('0xe'),auth[_0x04d5('0x6')](),controller[_0x04d5('0x17')]);module[_0x04d5('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 152f199..512e3eb 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 _0x4c61=['TEXT','long','ENUM','out','sequelize','iconv','BOOLEAN','DATE','STRING'];(function(_0x3108d8,_0x5162a8){var _0xdecb89=function(_0x359900){while(--_0x359900){_0x3108d8['push'](_0x3108d8['shift']());}};_0xdecb89(++_0x5162a8);}(_0x4c61,0xca));var _0x14c6=function(_0x2d5643,_0x2d13f2){_0x2d5643=_0x2d5643-0x0;var _0x2e42cf=_0x4c61[_0x2d5643];return _0x2e42cf;};'use strict';var Sequelize=require(_0x14c6('0x0'));var iconv=require(_0x14c6('0x1'));module['exports']={'closed':{'type':Sequelize[_0x14c6('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x14c6('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x14c6('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x14c6('0x5')](_0x14c6('0x6'))},'subject':{'type':Sequelize[_0x14c6('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x14c6('0x3')]},'substatus':{'type':Sequelize[_0x14c6('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x14c6('0x7')]('in',_0x14c6('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x14c6('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x14c6('0x7')]('in',_0x14c6('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x14c6('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xb50c=['out','sequelize','iconv','BOOLEAN','DATE','STRING','long','TEXT','ENUM'];(function(_0x3d3509,_0x3596c4){var _0x35e18b=function(_0x5ced62){while(--_0x5ced62){_0x3d3509['push'](_0x3d3509['shift']());}};_0x35e18b(++_0x3596c4);}(_0xb50c,0x1e7));var _0xcb50=function(_0x555cd9,_0x3c89a9){_0x555cd9=_0x555cd9-0x0;var _0x40bb82=_0xb50c[_0x555cd9];return _0x40bb82;};'use strict';var Sequelize=require(_0xcb50('0x0'));var iconv=require(_0xcb50('0x1'));module['exports']={'closed':{'type':Sequelize[_0xcb50('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcb50('0x3')]},'disposition':{'type':Sequelize[_0xcb50('0x4')]},'secondDisposition':{'type':Sequelize[_0xcb50('0x4')]},'thirdDisposition':{'type':Sequelize[_0xcb50('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0xcb50('0x4')](0x1fe)},'to':{'type':Sequelize[_0xcb50('0x4')]},'cc':{'type':Sequelize['TEXT'](_0xcb50('0x5'))},'subject':{'type':Sequelize[_0xcb50('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xcb50('0x3')]},'substatus':{'type':Sequelize[_0xcb50('0x4')](0x3c)},'substatusAt':{'type':Sequelize[_0xcb50('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xcb50('0x7')]('in',_0xcb50('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xcb50('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xcb50('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 8aa2882..d0d4054 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 _0xecc5=['join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','createdAt','get','mkdirSync','each','missing.recipient@your.company.com','decode','headers','Bcc','basename','existsSync','readFileSync','writeFileSync','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','html-entities','redis','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','then','destroy','stack','name','send','map','rawAttributes','type','key','findAll','mail','query','user','catch','params','model','MailInteraction','keys','filters','intersection','attributes','fields','length','includeAll','include','merge','options','create','body','update','find','describe','addMessage','MailMessage','ids','omit','findOne','hasOwnProperty','nolimit','order','sort','pick','MailInteractionId','where','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','setTags','spread','Tag','color','emit','removeTags','download','unix'];(function(_0x2822f6,_0x484293){var _0x3ff9d2=function(_0x5893ab){while(--_0x5893ab){_0x2822f6['push'](_0x2822f6['shift']());}};_0x3ff9d2(++_0x484293);}(_0xecc5,0xf4));var _0x5ecc=function(_0x18fb96,_0x37ca7e){_0x18fb96=_0x18fb96-0x0;var _0x59f3b2=_0xecc5[_0x18fb96];return _0x59f3b2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5ecc('0x0'));var zipdir=require(_0x5ecc('0x1'));var moment=require(_0x5ecc('0x2'));var BPromise=require(_0x5ecc('0x3'));var util=require(_0x5ecc('0x4'));var path=require(_0x5ecc('0x5'));var fs=require('fs');var _=require('lodash');var juice=require(_0x5ecc('0x6'));var Redis=require(_0x5ecc('0x7'));var interaction=require(_0x5ecc('0x8'));var qs=require(_0x5ecc('0x9'));var logger=require(_0x5ecc('0xa'))(_0x5ecc('0xb'));var config=require(_0x5ecc('0xc'));var db=require('../../mysqldb')['db'];var htmlEntities=require(_0x5ecc('0xd'));config[_0x5ecc('0xe')]=_['defaults'](config[_0x5ecc('0xe')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5ecc('0xe')]));require('./mailInteraction.socket')[_0x5ecc('0xf')](socket);function respondWithStatusCode(_0x47375f,_0x29fcd7){_0x29fcd7=_0x29fcd7||0xcc;return function(_0x1f3185){if(_0x1f3185){return _0x47375f[_0x5ecc('0x10')](_0x29fcd7);}return _0x47375f[_0x5ecc('0x11')](_0x29fcd7)[_0x5ecc('0x12')]();};}function respondWithResult(_0x30e498,_0x86c25d){_0x86c25d=_0x86c25d||0xc8;return function(_0x355cbe){if(_0x355cbe){return _0x30e498[_0x5ecc('0x11')](_0x86c25d)['json'](_0x355cbe);}};}function respondWithFilteredResult(_0x4ee809,_0x48bee8){return function(_0x3b783e){if(_0x3b783e){var _0x261210=typeof _0x48bee8[_0x5ecc('0x13')]===_0x5ecc('0x14')&&typeof _0x48bee8['limit']===_0x5ecc('0x14');var _0x482504=_0x3b783e[_0x5ecc('0x15')];var _0x5630c4=_0x261210?0x0:_0x48bee8[_0x5ecc('0x13')];var _0x1f5e31=_0x261210?_0x3b783e[_0x5ecc('0x15')]:_0x48bee8[_0x5ecc('0x13')]+_0x48bee8[_0x5ecc('0x16')];var _0x4a1d17;if(_0x1f5e31>=_0x482504){_0x1f5e31=_0x482504;_0x4a1d17=0xc8;}else{_0x4a1d17=0xce;}_0x4ee809[_0x5ecc('0x11')](_0x4a1d17);return _0x4ee809[_0x5ecc('0x17')](_0x5ecc('0x18'),_0x5630c4+'-'+_0x1f5e31+'/'+_0x482504)[_0x5ecc('0x19')](_0x3b783e);}return null;};}function saveUpdates(_0x39f850){return function(_0x26a77b){if(_0x26a77b){return _0x26a77b['update'](_0x39f850)[_0x5ecc('0x1a')](function(_0x1462ec){return _0x1462ec;});}return null;};}function removeEntity(_0x483b45){return function(_0x81fe18){if(_0x81fe18){return _0x81fe18[_0x5ecc('0x1b')]()['then'](function(){_0x483b45[_0x5ecc('0x11')](0xcc)[_0x5ecc('0x12')]();});}};}function handleEntityNotFound(_0x21520e){return function(_0x11a4ca){if(!_0x11a4ca){_0x21520e['sendStatus'](0x194);}return _0x11a4ca;};}function handleError(_0x35b042,_0xb85e65){_0xb85e65=_0xb85e65||0x1f4;return function(_0x4d1fe5){logger['error'](_0x4d1fe5[_0x5ecc('0x1c')]);if(_0x4d1fe5[_0x5ecc('0x1d')]){delete _0x4d1fe5[_0x5ecc('0x1d')];}_0x35b042['status'](_0xb85e65)[_0x5ecc('0x1e')](_0x4d1fe5);};}exports['index']=function(_0x1cf45d,_0x136329){var _0x5f0013={};var _0x4f2655=_[_0x5ecc('0x1f')](db['MailInteraction'][_0x5ecc('0x20')],function(_0x2db954){return{'name':_0x2db954['fieldName'],'type':_0x2db954[_0x5ecc('0x21')][_0x5ecc('0x22')]};});_0x5f0013=qs['getOptions'](_0x4f2655,_0x1cf45d);return interaction[_0x5ecc('0x23')](_0x5ecc('0x24'),_0x1cf45d[_0x5ecc('0x25')],_0x1cf45d[_0x5ecc('0x26')],_0x5f0013,_0x4f2655)['then'](respondWithFilteredResult(_0x136329,_0x5f0013))[_0x5ecc('0x27')](handleError(_0x136329,null));};exports['show']=function(_0x44665d,_0x1e301c){var _0xb740df={'raw':![],'where':{'id':_0x44665d[_0x5ecc('0x28')]['id']}},_0x2bfd24={};_0x2bfd24[_0x5ecc('0x29')]=_['keys'](db[_0x5ecc('0x2a')][_0x5ecc('0x20')]);_0x2bfd24[_0x5ecc('0x25')]=_[_0x5ecc('0x2b')](_0x44665d[_0x5ecc('0x25')]);_0x2bfd24[_0x5ecc('0x2c')]=_[_0x5ecc('0x2d')](_0x2bfd24[_0x5ecc('0x29')],_0x2bfd24[_0x5ecc('0x25')]);_0xb740df[_0x5ecc('0x2e')]=_[_0x5ecc('0x2d')](_0x2bfd24[_0x5ecc('0x29')],qs[_0x5ecc('0x2f')](_0x44665d['query'][_0x5ecc('0x2f')]));_0xb740df[_0x5ecc('0x2e')]=_0xb740df[_0x5ecc('0x2e')][_0x5ecc('0x30')]?_0xb740df['attributes']:_0x2bfd24['model'];if(_0x44665d['query'][_0x5ecc('0x31')]){_0xb740df[_0x5ecc('0x32')]=[{'all':!![]}];}_0xb740df=_[_0x5ecc('0x33')]({},_0xb740df,_0x44665d[_0x5ecc('0x34')]);return db['MailInteraction']['find'](_0xb740df)[_0x5ecc('0x1a')](handleEntityNotFound(_0x1e301c,null))[_0x5ecc('0x1a')](respondWithResult(_0x1e301c,null))[_0x5ecc('0x27')](handleError(_0x1e301c,null));};exports[_0x5ecc('0x35')]=function(_0x1224ff,_0x2221f6){return db[_0x5ecc('0x2a')][_0x5ecc('0x35')](_0x1224ff[_0x5ecc('0x36')],{})['then'](respondWithResult(_0x2221f6,0xc9))['catch'](handleError(_0x2221f6,null));};exports[_0x5ecc('0x37')]=function(_0x4de4f1,_0x2f139b){if(_0x4de4f1['body']['id']){delete _0x4de4f1[_0x5ecc('0x36')]['id'];}return db[_0x5ecc('0x2a')][_0x5ecc('0x38')]({'where':{'id':_0x4de4f1[_0x5ecc('0x28')]['id']}})[_0x5ecc('0x1a')](handleEntityNotFound(_0x2f139b,null))[_0x5ecc('0x1a')](saveUpdates(_0x4de4f1[_0x5ecc('0x36')],null))[_0x5ecc('0x1a')](respondWithResult(_0x2f139b,null))[_0x5ecc('0x27')](handleError(_0x2f139b,null));};exports[_0x5ecc('0x1b')]=function(_0x12d760,_0x4907bd){return db[_0x5ecc('0x2a')]['find']({'where':{'id':_0x12d760[_0x5ecc('0x28')]['id']}})[_0x5ecc('0x1a')](handleEntityNotFound(_0x4907bd,null))[_0x5ecc('0x1a')](removeEntity(_0x4907bd,null))['catch'](handleError(_0x4907bd,null));};exports['describe']=function(_0x3579f7,_0x5f47c9){return db[_0x5ecc('0x2a')][_0x5ecc('0x39')]()[_0x5ecc('0x1a')](respondWithResult(_0x5f47c9,null))['catch'](handleError(_0x5f47c9,null));};exports[_0x5ecc('0x3a')]=function(_0x1fa73a,_0x3a4afd){return db[_0x5ecc('0x3b')][_0x5ecc('0x38')]({'where':{'id':_0x1fa73a[_0x5ecc('0x28')]['id']}})[_0x5ecc('0x1a')](handleEntityNotFound(_0x3a4afd,null))[_0x5ecc('0x1a')](function(_0x424fcb){if(_0x424fcb){return _0x424fcb[_0x5ecc('0x3a')](_0x1fa73a[_0x5ecc('0x36')][_0x5ecc('0x3c')],_[_0x5ecc('0x3d')](_0x1fa73a[_0x5ecc('0x36')],[_0x5ecc('0x3c'),'id'])||{});}})[_0x5ecc('0x1a')](respondWithResult(_0x3a4afd,null))[_0x5ecc('0x27')](handleError(_0x3a4afd,null));};exports['getMessages']=function(_0x2c933b,_0x42a6f5){var _0x16d903={'raw':![],'where':{}};var _0x57dc08={};var _0x550b3f={'count':0x0,'rows':[]};return db['MailInteraction'][_0x5ecc('0x3e')]({'where':{'id':_0x2c933b[_0x5ecc('0x28')]['id']}})['then'](handleEntityNotFound(_0x42a6f5,null))[_0x5ecc('0x1a')](function(_0x4f3059){if(_0x4f3059){_0x57dc08[_0x5ecc('0x29')]=_[_0x5ecc('0x2b')](db[_0x5ecc('0x3b')][_0x5ecc('0x20')]);_0x57dc08[_0x5ecc('0x25')]=_[_0x5ecc('0x2b')](_0x2c933b[_0x5ecc('0x25')]);_0x57dc08[_0x5ecc('0x2c')]=_['intersection'](_0x57dc08['model'],_0x57dc08[_0x5ecc('0x25')]);_0x16d903['attributes']=_[_0x5ecc('0x2d')](_0x57dc08[_0x5ecc('0x29')],qs[_0x5ecc('0x2f')](_0x2c933b[_0x5ecc('0x25')][_0x5ecc('0x2f')]));_0x16d903[_0x5ecc('0x2e')]=_0x16d903['attributes'][_0x5ecc('0x30')]?_0x16d903[_0x5ecc('0x2e')]:_0x57dc08['model'];if(!_0x2c933b[_0x5ecc('0x25')][_0x5ecc('0x3f')](_0x5ecc('0x40'))){_0x16d903[_0x5ecc('0x16')]=qs[_0x5ecc('0x16')](_0x2c933b[_0x5ecc('0x25')]['limit']);_0x16d903[_0x5ecc('0x13')]=qs[_0x5ecc('0x13')](_0x2c933b[_0x5ecc('0x25')]['offset']);}_0x16d903[_0x5ecc('0x41')]=qs[_0x5ecc('0x42')](_0x2c933b[_0x5ecc('0x25')][_0x5ecc('0x42')]);_0x16d903['where']=qs[_0x5ecc('0x2c')](_[_0x5ecc('0x43')](_0x2c933b[_0x5ecc('0x25')],_0x57dc08[_0x5ecc('0x2c')]));_0x16d903['where'][_0x5ecc('0x44')]=_0x4f3059['id'];if(_0x2c933b[_0x5ecc('0x25')]['filter']){_0x16d903[_0x5ecc('0x45')]=_[_0x5ecc('0x33')](_0x16d903[_0x5ecc('0x45')],{'$or':_[_0x5ecc('0x1f')](_0x16d903[_0x5ecc('0x2e')],function(_0x53e160){var _0x10f3f7={};_0x10f3f7[_0x53e160]={'$like':'%'+_0x2c933b[_0x5ecc('0x25')][_0x5ecc('0x46')]+'%'};return _0x10f3f7;})});}if(_0x2c933b['query'][_0x5ecc('0x47')]){var _0x16d7e0=_0x2c933b[_0x5ecc('0x25')][_0x5ecc('0x47')][_0x5ecc('0x48')](',');var _0x5e12be={};_0x5e12be[_0x16d7e0[0x0]]={'$gte':moment(_0x16d7e0[0x1])[_0x5ecc('0x49')](_0x5ecc('0x4a'))};_0x16d903[_0x5ecc('0x45')]=_['merge'](_0x16d903['where'],_0x5e12be);}_0x16d903=_[_0x5ecc('0x33')]({},_0x16d903,_0x2c933b['options']);return db['MailMessage'][_0x5ecc('0x15')]({'where':_0x16d903['where']})[_0x5ecc('0x1a')](function(_0x257681){_0x550b3f['count']=_0x257681;if(_0x2c933b[_0x5ecc('0x25')][_0x5ecc('0x31')]){_0x16d903[_0x5ecc('0x32')]=[{'all':!![]}];}return db[_0x5ecc('0x3b')][_0x5ecc('0x23')](_0x16d903);})[_0x5ecc('0x1a')](function(_0xb268b1){if(_0x2c933b[_0x5ecc('0x25')][_0x5ecc('0x4b')]===_0x5ecc('0x4c')){for(var _0x3fe276=0x0;_0x3fe276<_0xb268b1[_0x5ecc('0x30')];_0x3fe276++){_0xb268b1[_0x3fe276][_0x5ecc('0x36')]=juice(_0xb268b1[_0x3fe276][_0x5ecc('0x36')]);}}_0x550b3f[_0x5ecc('0x4d')]=_0xb268b1;return _0x550b3f;});}})[_0x5ecc('0x1a')](respondWithFilteredResult(_0x42a6f5,_0x16d903))['catch'](handleError(_0x42a6f5,null));};exports['addTags']=function(_0x47dce2,_0x1c0338){return db[_0x5ecc('0x2a')][_0x5ecc('0x38')]({'where':{'id':_0x47dce2[_0x5ecc('0x28')]['id']}})[_0x5ecc('0x1a')](handleEntityNotFound(_0x1c0338,null))[_0x5ecc('0x1a')](function(_0x15f383){if(_0x15f383){return _0x15f383[_0x5ecc('0x4e')](_0x47dce2[_0x5ecc('0x36')][_0x5ecc('0x3c')],_['omit'](_0x47dce2[_0x5ecc('0x36')],[_0x5ecc('0x3c'),'id'])||{})[_0x5ecc('0x4f')](function(){return db[_0x5ecc('0x50')][_0x5ecc('0x23')]({'attributes':['id',_0x5ecc('0x1d'),_0x5ecc('0x51')],'where':{'id':_0x47dce2[_0x5ecc('0x36')][_0x5ecc('0x3c')]}});})[_0x5ecc('0x1a')](function(_0x270049){socket[_0x5ecc('0x52')]('mailInteractionTags:save',{'id':Number(_0x47dce2['params']['id']),'tags':_0x270049||[]});return{'id':Number(_0x47dce2[_0x5ecc('0x28')]['id']),'tags':_0x270049||[]};});}})['then'](respondWithResult(_0x1c0338,null))[_0x5ecc('0x27')](handleError(_0x1c0338,null));};exports[_0x5ecc('0x53')]=function(_0x2c6f8f,_0x1396cc){return db[_0x5ecc('0x2a')][_0x5ecc('0x38')]({'where':{'id':_0x2c6f8f[_0x5ecc('0x28')]['id']}})[_0x5ecc('0x1a')](handleEntityNotFound(_0x1396cc,null))[_0x5ecc('0x1a')](function(_0x3baa64){if(_0x3baa64){return _0x3baa64[_0x5ecc('0x53')](_0x2c6f8f[_0x5ecc('0x25')][_0x5ecc('0x3c')]);}})[_0x5ecc('0x1a')](respondWithStatusCode(_0x1396cc,null))[_0x5ecc('0x27')](handleError(_0x1396cc,null));};exports[_0x5ecc('0x54')]=function(_0x81741d,_0x31022c){var _0x52e5b5=moment()[_0x5ecc('0x55')]()['toString']();var _0x519396=path[_0x5ecc('0x56')](config[_0x5ecc('0x57')],_0x5ecc('0x58'),_0x5ecc('0x59'),'tmp');var _0x435020=path['join'](config['root'],_0x5ecc('0x58'),_0x5ecc('0x59'),_0x5ecc('0x5a'));var _0x2f623b=path[_0x5ecc('0x56')](_0x519396,_0x52e5b5);var _0x2fa2ad=util['format'](_0x5ecc('0x5b'),_0x81741d['params']['id'],_0x52e5b5);var _0x55038b=path[_0x5ecc('0x56')](_0x519396,_0x2fa2ad);var _0x67f422=[];if(_0x81741d['query']['attachments']){_0x67f422['push']({'model':db[_0x5ecc('0x5c')],'as':_0x5ecc('0x5d'),'raw':!![]});}var _0x31d251=[{'model':db[_0x5ecc('0x3b')],'as':_0x5ecc('0x5e'),'attributes':['id','body','from','to','cc',_0x5ecc('0x5f'),_0x5ecc('0x60'),_0x5ecc('0x61')],'where':{'secret':![]},'order':qs[_0x5ecc('0x42')]('id'),'include':_0x67f422}];return db[_0x5ecc('0x2a')][_0x5ecc('0x38')]({'where':{'id':_0x81741d[_0x5ecc('0x28')]['id']},'include':_0x31d251})['then'](handleEntityNotFound(_0x31022c,null))[_0x5ecc('0x1a')](function(_0x380919){if(_0x380919&&_0x380919[_0x5ecc('0x5e')]){var _0x363eea=_0x380919[_0x5ecc('0x62')]({'plain':!![]});fs[_0x5ecc('0x63')](_0x2f623b);return BPromise[_0x5ecc('0x64')](_0x363eea[_0x5ecc('0x5e')],function(_0x3eadef,_0x21cfa8){var _0xf47aea={'from':_0x3eadef['from'],'to':_0x3eadef['to']||_0x5ecc('0x65'),'subject':_0x3eadef[_0x5ecc('0x60')],'html':htmlEntities[_0x5ecc('0x66')](_0x3eadef['body']),'headers':{'Date':moment(_0x3eadef['createdAt'])[_0x5ecc('0x49')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x3eadef['cc']){_0xf47aea[_0x5ecc('0x67')]['Cc']=_0x3eadef['cc'];}if(_0x3eadef['bcc']){_0xf47aea[_0x5ecc('0x67')][_0x5ecc('0x68')]=_0x3eadef[_0x5ecc('0x5f')];}return new BPromise(function(_0x3f94f5,_0x203edd){if(_0x3eadef[_0x5ecc('0x5d')]){for(var _0xe1e8fb=0x0;_0xe1e8fb<_0x3eadef[_0x5ecc('0x5d')][_0x5ecc('0x30')];_0xe1e8fb++){var _0x408935=_0x3eadef['Attachments'][_0xe1e8fb];var _0x82e1fc=path['join'](_0x435020,_0x408935[_0x5ecc('0x69')]);if(fs[_0x5ecc('0x6a')](_0x82e1fc)){_0xf47aea[_0x5ecc('0x5a')]['push']({'name':_0x408935['name'],'contentType':_0x408935[_0x5ecc('0x21')],'data':fs[_0x5ecc('0x6b')](_0x82e1fc)});}}}emlformat['build'](_0xf47aea,function(_0x12c428,_0x43bcd5){if(_0x12c428)return _0x203edd(_0x12c428);fs[_0x5ecc('0x6c')](path[_0x5ecc('0x56')](_0x2f623b,util['format']('message%d.eml',_0x21cfa8)),_0x43bcd5);return _0x3f94f5(_0x43bcd5);});});})['then'](function(){return new BPromise(function(_0x15c562,_0x4c33f2){zipdir(_0x2f623b,{'saveTo':_0x55038b},function(_0x4ac132,_0x2a076e){if(_0x4ac132)return _0x4c33f2(_0x4ac132);return _0x15c562(_0x2a076e);});})[_0x5ecc('0x1a')](function(){return new BPromise(function(_0x16ef07,_0x28da1e){rimraf(_0x2f623b,function(_0x10e816){if(_0x10e816)_0x28da1e(_0x10e816);return _0x16ef07();});});})[_0x5ecc('0x1a')](function(){return _0x31022c[_0x5ecc('0x54')](_0x55038b,_0x2fa2ad,function(_0x4296da){if(!_0x4296da)fs[_0x5ecc('0x6d')](_0x55038b);});});});}else{return _0x31022c[_0x5ecc('0x10')](0xc8);}})[_0x5ecc('0x27')](handleError(_0x31022c,null));}; \ No newline at end of file +var _0x70ed=['omit','findOne','sort','pick','filters','where','MailInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','rows','addTags','setTags','spread','Tag','emit','removeTags','download','unix','toString','root','server','files','tmp','join','attachments','Attachment','Attachments','from','bcc','createdAt','Messages','mkdirSync','each','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','push','build','writeFileSync','message%d.eml','eml-format','rimraf','zip-dir','moment','bluebird','util','juice','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','offset','limit','count','set','Content-Range','update','then','destroy','end','error','name','send','index','map','MailInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','mail','query','catch','model','keys','intersection','attributes','fields','length','include','merge','options','create','body','find','params','describe','MailMessage','ids'];(function(_0x3a83ed,_0x3eb477){var _0x2453e8=function(_0x15318f){while(--_0x15318f){_0x3a83ed['push'](_0x3a83ed['shift']());}};_0x2453e8(++_0x3eb477);}(_0x70ed,0x1e8));var _0xd70e=function(_0x28b0a4,_0x2ea758){_0x28b0a4=_0x28b0a4-0x0;var _0x105ce6=_0x70ed[_0x28b0a4];return _0x105ce6;};'use strict';var emlformat=require(_0xd70e('0x0'));var rimraf=require(_0xd70e('0x1'));var zipdir=require(_0xd70e('0x2'));var moment=require(_0xd70e('0x3'));var BPromise=require(_0xd70e('0x4'));var util=require(_0xd70e('0x5'));var path=require('path');var fs=require('fs');var _=require('lodash');var juice=require(_0xd70e('0x6'));var Redis=require(_0xd70e('0x7'));var interaction=require(_0xd70e('0x8'));var qs=require(_0xd70e('0x9'));var logger=require(_0xd70e('0xa'))('api');var config=require(_0xd70e('0xb'));var db=require(_0xd70e('0xc'))['db'];var htmlEntities=require(_0xd70e('0xd'));config[_0xd70e('0xe')]=_[_0xd70e('0xf')](config['redis'],{'host':_0xd70e('0x10'),'port':0x18eb});var socket=require(_0xd70e('0x11'))(new Redis(config[_0xd70e('0xe')]));require(_0xd70e('0x12'))[_0xd70e('0x13')](socket);function respondWithStatusCode(_0x491d21,_0x3f84b6){_0x3f84b6=_0x3f84b6||0xcc;return function(_0x527070){if(_0x527070){return _0x491d21[_0xd70e('0x14')](_0x3f84b6);}return _0x491d21[_0xd70e('0x15')](_0x3f84b6)['end']();};}function respondWithResult(_0x3b1444,_0x398d97){_0x398d97=_0x398d97||0xc8;return function(_0x4de898){if(_0x4de898){return _0x3b1444[_0xd70e('0x15')](_0x398d97)['json'](_0x4de898);}};}function respondWithFilteredResult(_0x257e48,_0x30cfde){return function(_0x2fc3d2){if(_0x2fc3d2){var _0x408cf6=typeof _0x30cfde[_0xd70e('0x16')]==='undefined'&&typeof _0x30cfde[_0xd70e('0x17')]==='undefined';var _0x2e2c80=_0x2fc3d2[_0xd70e('0x18')];var _0x234501=_0x408cf6?0x0:_0x30cfde[_0xd70e('0x16')];var _0x2978f6=_0x408cf6?_0x2fc3d2[_0xd70e('0x18')]:_0x30cfde[_0xd70e('0x16')]+_0x30cfde[_0xd70e('0x17')];var _0x20782c;if(_0x2978f6>=_0x2e2c80){_0x2978f6=_0x2e2c80;_0x20782c=0xc8;}else{_0x20782c=0xce;}_0x257e48[_0xd70e('0x15')](_0x20782c);return _0x257e48[_0xd70e('0x19')](_0xd70e('0x1a'),_0x234501+'-'+_0x2978f6+'/'+_0x2e2c80)['json'](_0x2fc3d2);}return null;};}function saveUpdates(_0x434698){return function(_0x165f6c){if(_0x165f6c){return _0x165f6c[_0xd70e('0x1b')](_0x434698)[_0xd70e('0x1c')](function(_0x557eea){return _0x557eea;});}return null;};}function removeEntity(_0x27dea1){return function(_0x3618da){if(_0x3618da){return _0x3618da[_0xd70e('0x1d')]()[_0xd70e('0x1c')](function(){_0x27dea1['status'](0xcc)[_0xd70e('0x1e')]();});}};}function handleEntityNotFound(_0x1c8ca3){return function(_0x52a45e){if(!_0x52a45e){_0x1c8ca3[_0xd70e('0x14')](0x194);}return _0x52a45e;};}function handleError(_0x48711c,_0x53ccc1){_0x53ccc1=_0x53ccc1||0x1f4;return function(_0x3419b5){logger[_0xd70e('0x1f')](_0x3419b5['stack']);if(_0x3419b5[_0xd70e('0x20')]){delete _0x3419b5[_0xd70e('0x20')];}_0x48711c['status'](_0x53ccc1)[_0xd70e('0x21')](_0x3419b5);};}exports[_0xd70e('0x22')]=function(_0x2eccb3,_0x69ce84){var _0x5ae433={};var _0x223329=_[_0xd70e('0x23')](db[_0xd70e('0x24')][_0xd70e('0x25')],function(_0x491184){return{'name':_0x491184[_0xd70e('0x26')],'type':_0x491184[_0xd70e('0x27')][_0xd70e('0x28')]};});_0x5ae433=qs[_0xd70e('0x29')](_0x223329,_0x2eccb3);return interaction[_0xd70e('0x2a')](_0xd70e('0x2b'),_0x2eccb3[_0xd70e('0x2c')],_0x2eccb3['user'],_0x5ae433,_0x223329)[_0xd70e('0x1c')](respondWithFilteredResult(_0x69ce84,_0x5ae433))[_0xd70e('0x2d')](handleError(_0x69ce84,null));};exports['show']=function(_0x57d3f8,_0x5f2fb7){var _0x35cefc={'raw':![],'where':{'id':_0x57d3f8['params']['id']}},_0x1eb9b5={};_0x1eb9b5[_0xd70e('0x2e')]=_[_0xd70e('0x2f')](db[_0xd70e('0x24')][_0xd70e('0x25')]);_0x1eb9b5[_0xd70e('0x2c')]=_['keys'](_0x57d3f8['query']);_0x1eb9b5['filters']=_[_0xd70e('0x30')](_0x1eb9b5['model'],_0x1eb9b5[_0xd70e('0x2c')]);_0x35cefc[_0xd70e('0x31')]=_[_0xd70e('0x30')](_0x1eb9b5[_0xd70e('0x2e')],qs['fields'](_0x57d3f8[_0xd70e('0x2c')][_0xd70e('0x32')]));_0x35cefc[_0xd70e('0x31')]=_0x35cefc[_0xd70e('0x31')][_0xd70e('0x33')]?_0x35cefc[_0xd70e('0x31')]:_0x1eb9b5[_0xd70e('0x2e')];if(_0x57d3f8[_0xd70e('0x2c')]['includeAll']){_0x35cefc[_0xd70e('0x34')]=[{'all':!![]}];}_0x35cefc=_[_0xd70e('0x35')]({},_0x35cefc,_0x57d3f8[_0xd70e('0x36')]);return db[_0xd70e('0x24')]['find'](_0x35cefc)[_0xd70e('0x1c')](handleEntityNotFound(_0x5f2fb7,null))[_0xd70e('0x1c')](respondWithResult(_0x5f2fb7,null))[_0xd70e('0x2d')](handleError(_0x5f2fb7,null));};exports['create']=function(_0x351e18,_0x2073f1){return db[_0xd70e('0x24')][_0xd70e('0x37')](_0x351e18['body'],{})[_0xd70e('0x1c')](respondWithResult(_0x2073f1,0xc9))[_0xd70e('0x2d')](handleError(_0x2073f1,null));};exports[_0xd70e('0x1b')]=function(_0x3cb28a,_0x51025f){if(_0x3cb28a[_0xd70e('0x38')]['id']){delete _0x3cb28a[_0xd70e('0x38')]['id'];}return db[_0xd70e('0x24')][_0xd70e('0x39')]({'where':{'id':_0x3cb28a[_0xd70e('0x3a')]['id']}})[_0xd70e('0x1c')](handleEntityNotFound(_0x51025f,null))['then'](saveUpdates(_0x3cb28a[_0xd70e('0x38')],null))[_0xd70e('0x1c')](respondWithResult(_0x51025f,null))[_0xd70e('0x2d')](handleError(_0x51025f,null));};exports[_0xd70e('0x1d')]=function(_0x1a2dc1,_0x505a97){return db[_0xd70e('0x24')]['find']({'where':{'id':_0x1a2dc1[_0xd70e('0x3a')]['id']}})[_0xd70e('0x1c')](handleEntityNotFound(_0x505a97,null))['then'](removeEntity(_0x505a97,null))[_0xd70e('0x2d')](handleError(_0x505a97,null));};exports['describe']=function(_0x262777,_0xf12c84){return db['MailInteraction'][_0xd70e('0x3b')]()[_0xd70e('0x1c')](respondWithResult(_0xf12c84,null))['catch'](handleError(_0xf12c84,null));};exports['addMessage']=function(_0x3bf488,_0x43df11){return db[_0xd70e('0x3c')][_0xd70e('0x39')]({'where':{'id':_0x3bf488[_0xd70e('0x3a')]['id']}})[_0xd70e('0x1c')](handleEntityNotFound(_0x43df11,null))[_0xd70e('0x1c')](function(_0x476344){if(_0x476344){return _0x476344['addMessage'](_0x3bf488[_0xd70e('0x38')][_0xd70e('0x3d')],_[_0xd70e('0x3e')](_0x3bf488[_0xd70e('0x38')],[_0xd70e('0x3d'),'id'])||{});}})[_0xd70e('0x1c')](respondWithResult(_0x43df11,null))[_0xd70e('0x2d')](handleError(_0x43df11,null));};exports['getMessages']=function(_0xad2f12,_0x2bc12a){var _0xa549a2={'raw':![],'where':{}};var _0x1ebb4d={};var _0x42221d={'count':0x0,'rows':[]};return db[_0xd70e('0x24')][_0xd70e('0x3f')]({'where':{'id':_0xad2f12[_0xd70e('0x3a')]['id']}})[_0xd70e('0x1c')](handleEntityNotFound(_0x2bc12a,null))[_0xd70e('0x1c')](function(_0x5f00c8){if(_0x5f00c8){_0x1ebb4d[_0xd70e('0x2e')]=_[_0xd70e('0x2f')](db[_0xd70e('0x3c')][_0xd70e('0x25')]);_0x1ebb4d[_0xd70e('0x2c')]=_[_0xd70e('0x2f')](_0xad2f12[_0xd70e('0x2c')]);_0x1ebb4d['filters']=_[_0xd70e('0x30')](_0x1ebb4d['model'],_0x1ebb4d['query']);_0xa549a2[_0xd70e('0x31')]=_[_0xd70e('0x30')](_0x1ebb4d['model'],qs[_0xd70e('0x32')](_0xad2f12['query'][_0xd70e('0x32')]));_0xa549a2[_0xd70e('0x31')]=_0xa549a2['attributes']['length']?_0xa549a2[_0xd70e('0x31')]:_0x1ebb4d[_0xd70e('0x2e')];if(!_0xad2f12[_0xd70e('0x2c')]['hasOwnProperty']('nolimit')){_0xa549a2[_0xd70e('0x17')]=qs[_0xd70e('0x17')](_0xad2f12[_0xd70e('0x2c')][_0xd70e('0x17')]);_0xa549a2[_0xd70e('0x16')]=qs[_0xd70e('0x16')](_0xad2f12[_0xd70e('0x2c')][_0xd70e('0x16')]);}_0xa549a2['order']=qs[_0xd70e('0x40')](_0xad2f12['query'][_0xd70e('0x40')]);_0xa549a2['where']=qs['filters'](_[_0xd70e('0x41')](_0xad2f12[_0xd70e('0x2c')],_0x1ebb4d[_0xd70e('0x42')]));_0xa549a2[_0xd70e('0x43')][_0xd70e('0x44')]=_0x5f00c8['id'];if(_0xad2f12[_0xd70e('0x2c')][_0xd70e('0x45')]){_0xa549a2[_0xd70e('0x43')]=_['merge'](_0xa549a2[_0xd70e('0x43')],{'$or':_[_0xd70e('0x23')](_0xa549a2[_0xd70e('0x31')],function(_0x3cad09){var _0x48c49c={};_0x48c49c[_0x3cad09]={'$like':'%'+_0xad2f12['query'][_0xd70e('0x45')]+'%'};return _0x48c49c;})});}if(_0xad2f12[_0xd70e('0x2c')]['$gte']){var _0x330b6e=_0xad2f12[_0xd70e('0x2c')][_0xd70e('0x46')]['split'](',');var _0x1a5b41={};_0x1a5b41[_0x330b6e[0x0]]={'$gte':moment(_0x330b6e[0x1])[_0xd70e('0x47')](_0xd70e('0x48'))};_0xa549a2[_0xd70e('0x43')]=_[_0xd70e('0x35')](_0xa549a2[_0xd70e('0x43')],_0x1a5b41);}_0xa549a2=_['merge']({},_0xa549a2,_0xad2f12[_0xd70e('0x36')]);return db[_0xd70e('0x3c')][_0xd70e('0x18')]({'where':_0xa549a2[_0xd70e('0x43')]})[_0xd70e('0x1c')](function(_0x1198c0){_0x42221d['count']=_0x1198c0;if(_0xad2f12[_0xd70e('0x2c')]['includeAll']){_0xa549a2[_0xd70e('0x34')]=[{'all':!![]}];}return db['MailMessage'][_0xd70e('0x2a')](_0xa549a2);})['then'](function(_0x2351f4){if(_0xad2f12[_0xd70e('0x2c')][_0xd70e('0x49')]===_0xd70e('0x4a')){for(var _0x31ac1e=0x0;_0x31ac1e<_0x2351f4[_0xd70e('0x33')];_0x31ac1e++){_0x2351f4[_0x31ac1e][_0xd70e('0x38')]=juice(_0x2351f4[_0x31ac1e]['body']);}}_0x42221d[_0xd70e('0x4b')]=_0x2351f4;return _0x42221d;});}})['then'](respondWithFilteredResult(_0x2bc12a,_0xa549a2))[_0xd70e('0x2d')](handleError(_0x2bc12a,null));};exports[_0xd70e('0x4c')]=function(_0x58f835,_0x146a14){return db[_0xd70e('0x24')][_0xd70e('0x39')]({'where':{'id':_0x58f835[_0xd70e('0x3a')]['id']}})[_0xd70e('0x1c')](handleEntityNotFound(_0x146a14,null))['then'](function(_0x2d9af2){if(_0x2d9af2){return _0x2d9af2[_0xd70e('0x4d')](_0x58f835['body'][_0xd70e('0x3d')],_[_0xd70e('0x3e')](_0x58f835[_0xd70e('0x38')],[_0xd70e('0x3d'),'id'])||{})[_0xd70e('0x4e')](function(){return db[_0xd70e('0x4f')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x58f835[_0xd70e('0x38')][_0xd70e('0x3d')]}});})[_0xd70e('0x1c')](function(_0x11e5c4){socket[_0xd70e('0x50')]('mailInteractionTags:save',{'id':Number(_0x58f835[_0xd70e('0x3a')]['id']),'tags':_0x11e5c4||[]});return{'id':Number(_0x58f835[_0xd70e('0x3a')]['id']),'tags':_0x11e5c4||[]};});}})[_0xd70e('0x1c')](respondWithResult(_0x146a14,null))[_0xd70e('0x2d')](handleError(_0x146a14,null));};exports[_0xd70e('0x51')]=function(_0x57b60a,_0x5eb6be){return db[_0xd70e('0x24')][_0xd70e('0x39')]({'where':{'id':_0x57b60a['params']['id']}})[_0xd70e('0x1c')](handleEntityNotFound(_0x5eb6be,null))[_0xd70e('0x1c')](function(_0x14f58c){if(_0x14f58c){return _0x14f58c[_0xd70e('0x51')](_0x57b60a['query'][_0xd70e('0x3d')]);}})[_0xd70e('0x1c')](respondWithStatusCode(_0x5eb6be,null))[_0xd70e('0x2d')](handleError(_0x5eb6be,null));};exports[_0xd70e('0x52')]=function(_0x30965c,_0x5c5d80){var _0xa3989b=moment()[_0xd70e('0x53')]()[_0xd70e('0x54')]();var _0x206124=path['join'](config[_0xd70e('0x55')],_0xd70e('0x56'),_0xd70e('0x57'),_0xd70e('0x58'));var _0x2d8506=path[_0xd70e('0x59')](config['root'],_0xd70e('0x56'),_0xd70e('0x57'),'attachments');var _0x3c1887=path['join'](_0x206124,_0xa3989b);var _0x3ff4e1=util[_0xd70e('0x47')]('transcript-%d-%s.zip',_0x30965c['params']['id'],_0xa3989b);var _0x31faab=path['join'](_0x206124,_0x3ff4e1);var _0x14108c=[];if(_0x30965c[_0xd70e('0x2c')][_0xd70e('0x5a')]){_0x14108c['push']({'model':db[_0xd70e('0x5b')],'as':_0xd70e('0x5c'),'raw':!![]});}var _0x2cf9fc=[{'model':db[_0xd70e('0x3c')],'as':'Messages','attributes':['id','body',_0xd70e('0x5d'),'to','cc',_0xd70e('0x5e'),'subject',_0xd70e('0x5f')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x14108c}];return db['MailInteraction'][_0xd70e('0x39')]({'where':{'id':_0x30965c[_0xd70e('0x3a')]['id']},'include':_0x2cf9fc})['then'](handleEntityNotFound(_0x5c5d80,null))[_0xd70e('0x1c')](function(_0x55dbd8){if(_0x55dbd8&&_0x55dbd8[_0xd70e('0x60')]){var _0x1bdbfa=_0x55dbd8['get']({'plain':!![]});fs[_0xd70e('0x61')](_0x3c1887);return BPromise[_0xd70e('0x62')](_0x1bdbfa[_0xd70e('0x60')],function(_0x17a611,_0x1df741){var _0x1a6a94={'from':_0x17a611[_0xd70e('0x5d')],'to':_0x17a611['to']||'missing.recipient@your.company.com','subject':_0x17a611[_0xd70e('0x63')],'html':htmlEntities[_0xd70e('0x64')](_0x17a611[_0xd70e('0x38')]),'headers':{'Date':moment(_0x17a611[_0xd70e('0x5f')])[_0xd70e('0x47')](_0xd70e('0x65'))},'attachments':[]};if(_0x17a611['cc']){_0x1a6a94[_0xd70e('0x66')]['Cc']=_0x17a611['cc'];}if(_0x17a611[_0xd70e('0x5e')]){_0x1a6a94[_0xd70e('0x66')][_0xd70e('0x67')]=_0x17a611[_0xd70e('0x5e')];}return new BPromise(function(_0x58fa41,_0x4ea4de){if(_0x17a611[_0xd70e('0x5c')]){for(var _0x27c6fd=0x0;_0x27c6fd<_0x17a611[_0xd70e('0x5c')]['length'];_0x27c6fd++){var _0x510935=_0x17a611[_0xd70e('0x5c')][_0x27c6fd];var _0x2d848f=path[_0xd70e('0x59')](_0x2d8506,_0x510935[_0xd70e('0x68')]);if(fs[_0xd70e('0x69')](_0x2d848f)){_0x1a6a94['attachments'][_0xd70e('0x6a')]({'name':_0x510935[_0xd70e('0x20')],'contentType':_0x510935[_0xd70e('0x27')],'data':fs['readFileSync'](_0x2d848f)});}}}emlformat[_0xd70e('0x6b')](_0x1a6a94,function(_0x1d5c67,_0x17de01){if(_0x1d5c67)return _0x4ea4de(_0x1d5c67);fs[_0xd70e('0x6c')](path[_0xd70e('0x59')](_0x3c1887,util[_0xd70e('0x47')](_0xd70e('0x6d'),_0x1df741)),_0x17de01);return _0x58fa41(_0x17de01);});});})[_0xd70e('0x1c')](function(){return new BPromise(function(_0x5784df,_0x196864){zipdir(_0x3c1887,{'saveTo':_0x31faab},function(_0x276da7,_0x30dca1){if(_0x276da7)return _0x196864(_0x276da7);return _0x5784df(_0x30dca1);});})[_0xd70e('0x1c')](function(){return new BPromise(function(_0x1d2a5d,_0x2b243e){rimraf(_0x3c1887,function(_0x50ba33){if(_0x50ba33)_0x2b243e(_0x50ba33);return _0x1d2a5d();});});})[_0xd70e('0x1c')](function(){return _0x5c5d80[_0xd70e('0x52')](_0x31faab,_0x3ff4e1,function(_0x430978){if(!_0x430978)fs['unlinkSync'](_0x31faab);});});});}else{return _0x5c5d80[_0xd70e('0x14')](0xc8);}})[_0xd70e('0x2d')](handleError(_0x5c5d80,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 62ea5de..a116afc 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 _0x3ce4=['MailInteraction','MailMessage','save','update','setDataValue','Users','map','findAll','then','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x1b0011,_0x403cc8){var _0x29b74c=function(_0x1edb84){while(--_0x1edb84){_0x1b0011['push'](_0x1b0011['shift']());}};_0x29b74c(++_0x403cc8);}(_0x3ce4,0x1a7));var _0x43ce=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x3ce4[_0x20ef64];return _0x3707d8;};'use strict';var EventEmitter=require(_0x43ce('0x0'));var MailInteraction=require(_0x43ce('0x1'))['db'][_0x43ce('0x2')];var MailMessage=require(_0x43ce('0x1'))['db'][_0x43ce('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x43ce('0x4'),'afterUpdate':_0x43ce('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2882f6){return function(_0x180047,_0x48c397,_0x55e487){_0x180047['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x53615f){_0x180047[_0x43ce('0x6')](_0x43ce('0x7'),_0x53615f[_0x43ce('0x8')](function(_0x4d10fb){return{'id':_0x4d10fb['id']};}));return MailMessage[_0x43ce('0x9')]({'where':{'MailInteractionId':_0x180047['id'],'direction':'in','read':![]},'raw':!![]});})[_0x43ce('0xa')](function(_0x5d2f60){_0x180047['setDataValue']('unreadMessages',_0x5d2f60[_0x43ce('0xb')]);MailInteractionEvents[_0x43ce('0xc')](_0x2882f6+':'+_0x180047['id'],_0x180047);MailInteractionEvents['emit'](_0x2882f6,_0x180047);_0x55e487(null);})[_0x43ce('0xd')](_0x55e487(null));};}for(var e in events){if(events[_0x43ce('0xe')](e)){var event=events[e];MailInteraction[_0x43ce('0xf')](e,emitEvent(event));}}module[_0x43ce('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x1976=['findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','../../mysqldb','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x1976,0x1e3));var _0x6197=function(_0x4801c3,_0x5e2411){_0x4801c3=_0x4801c3-0x0;var _0x279ab3=_0x1976[_0x4801c3];return _0x279ab3;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0x6197('0x0'))['db']['MailInteraction'];var MailMessage=require(_0x6197('0x0'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x6197('0x1')](0x0);var events={'afterCreate':_0x6197('0x2'),'afterUpdate':_0x6197('0x3'),'afterDestroy':_0x6197('0x4')};function emitEvent(_0x21518d){return function(_0x4dd34b,_0x26d53f,_0x399ab4){_0x4dd34b[_0x6197('0x5')]({'attributes':['id'],'raw':!![]})[_0x6197('0x6')](function(_0x15462b){_0x4dd34b[_0x6197('0x7')](_0x6197('0x8'),_0x15462b[_0x6197('0x9')](function(_0x2aa276){return{'id':_0x2aa276['id']};}));return MailMessage[_0x6197('0xa')]({'where':{'MailInteractionId':_0x4dd34b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6197('0x6')](function(_0x3d34a2){_0x4dd34b[_0x6197('0x7')](_0x6197('0xb'),_0x3d34a2[_0x6197('0xc')]);MailInteractionEvents[_0x6197('0xd')](_0x21518d+':'+_0x4dd34b['id'],_0x4dd34b);MailInteractionEvents['emit'](_0x21518d,_0x4dd34b);_0x399ab4(null);})[_0x6197('0xe')](_0x399ab4(null));};}for(var e in events){if(events[_0x6197('0xf')](e)){var event=events[e];MailInteraction[_0x6197('0x10')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index ae5ff55..c750489 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 _0x9b30=['then','catch','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','update'];(function(_0x565de0,_0x48c769){var _0xfe99c8=function(_0x8a8e){while(--_0x8a8e){_0x565de0['push'](_0x565de0['shift']());}};_0xfe99c8(++_0x48c769);}(_0x9b30,0x19a));var _0x09b3=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x9b30[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require(_0x09b3('0x0'));var logger=require(_0x09b3('0x1'))(_0x09b3('0x2'));var moment=require(_0x09b3('0x3'));var BPromise=require(_0x09b3('0x4'));var rp=require(_0x09b3('0x5'));var fs=require('fs');var path=require(_0x09b3('0x6'));var rimraf=require(_0x09b3('0x7'));var config=require('../../config/environment');var attributes=require(_0x09b3('0x8'));module[_0x09b3('0x9')]=function(_0x5bec09,_0x2f2e1a){return _0x5bec09[_0x09b3('0xa')]('MailInteraction',attributes,{'tableName':_0x09b3('0xb'),'paranoid':![],'indexes':[{'name':_0x09b3('0xc'),'fields':[_0x09b3('0xd'),'to'],'type':_0x09b3('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x8828ea,_0x4fd28d,_0x2b7f00){if(_0x8828ea[_0x09b3('0xf')]){_0x8828ea[_0x09b3('0x10')]=moment()[_0x09b3('0x11')](_0x09b3('0x12'));}if(_0x8828ea[_0x09b3('0x13')]){_0x8828ea[_0x09b3('0x14')]=moment()['format'](_0x09b3('0x12'));}_0x2b7f00(null,_0x4fd28d);},'beforeUpdate':function(_0x390821,_0xa9f179,_0x3d0cf8){if(_0x390821[_0x09b3('0x15')](_0x09b3('0xf'))){_0x390821[_0x09b3('0x10')]=_0x390821[_0x09b3('0xf')]?moment()[_0x09b3('0x11')](_0x09b3('0x12')):null;}if(_0x390821[_0x09b3('0x15')](_0x09b3('0x13'))){_0x390821['closedAt']=moment()[_0x09b3('0x11')](_0x09b3('0x12'));_0x390821['substatus']=null;_0x390821[_0x09b3('0x10')]=null;}_0x3d0cf8(null,_0x390821);},'afterUpdate':function(_0x22411e,_0x626b07,_0x4ad2b2){var _0x8432e2=_0x5bec09[_0x09b3('0x16')];var _0x1f4802=_0x22411e[_0x09b3('0x17')]({'plain':!![]});if(_0x1f4802['closed']){return _0x8432e2['MailMessage'][_0x09b3('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x1f4802['id']}})[_0x09b3('0x19')](function(){_0x4ad2b2();})[_0x09b3('0x1a')](function(_0x499d78){_0x4ad2b2(_0x499d78);});}else{_0x4ad2b2();}}},'charset':_0x09b3('0x1b'),'collate':_0x09b3('0x1c')});}; \ No newline at end of file +var _0x0c32=['util','api','moment','bluebird','request-promise','../../config/environment','./mailInteraction.attributes','define','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','substatus','substatusAt','changed','models','get','MailMessage','then','catch','utf8mb4','utf8mb4_unicode_ci'];(function(_0x302f4e,_0x399ac7){var _0x887dc5=function(_0x5f2e78){while(--_0x5f2e78){_0x302f4e['push'](_0x302f4e['shift']());}};_0x887dc5(++_0x399ac7);}(_0x0c32,0xd0));var _0x20c3=function(_0x5a1de6,_0x23c407){_0x5a1de6=_0x5a1de6-0x0;var _0x514b95=_0x0c32[_0x5a1de6];return _0x514b95;};'use strict';var _=require('lodash');var util=require(_0x20c3('0x0'));var logger=require('../../config/logger')(_0x20c3('0x1'));var moment=require(_0x20c3('0x2'));var BPromise=require(_0x20c3('0x3'));var rp=require(_0x20c3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x20c3('0x5'));var attributes=require(_0x20c3('0x6'));module['exports']=function(_0x1630fc,_0x1826a1){return _0x1630fc[_0x20c3('0x7')](_0x20c3('0x8'),attributes,{'tableName':_0x20c3('0x9'),'paranoid':![],'indexes':[{'name':_0x20c3('0xa'),'fields':['subject','to'],'type':_0x20c3('0xb')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x25f20c,_0x396697,_0x39a689){if(_0x25f20c['substatus']){_0x25f20c['substatusAt']=moment()[_0x20c3('0xc')](_0x20c3('0xd'));}if(_0x25f20c[_0x20c3('0xe')]){_0x25f20c[_0x20c3('0xf')]=moment()['format'](_0x20c3('0xd'));}_0x39a689(null,_0x396697);},'beforeUpdate':function(_0x43fac9,_0x18cc9d,_0x3ba16c){if(_0x43fac9['changed'](_0x20c3('0x10'))){_0x43fac9[_0x20c3('0x11')]=_0x43fac9[_0x20c3('0x10')]?moment()[_0x20c3('0xc')](_0x20c3('0xd')):null;}if(_0x43fac9[_0x20c3('0x12')](_0x20c3('0xe'))){_0x43fac9['closedAt']=moment()[_0x20c3('0xc')](_0x20c3('0xd'));_0x43fac9['substatus']=null;_0x43fac9[_0x20c3('0x11')]=null;}_0x3ba16c(null,_0x43fac9);},'afterUpdate':function(_0x5c7424,_0x3ec091,_0x506d86){var _0x486e62=_0x1630fc[_0x20c3('0x13')];var _0x228f13=_0x5c7424[_0x20c3('0x14')]({'plain':!![]});if(_0x228f13[_0x20c3('0xe')]){return _0x486e62[_0x20c3('0x15')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x228f13['id']}})[_0x20c3('0x16')](function(){_0x506d86();})[_0x20c3('0x17')](function(_0x41e7b7){_0x506d86(_0x41e7b7);});}else{_0x506d86();}}},'charset':_0x20c3('0x18'),'collate':_0x20c3('0x19')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index af938dc..bbfec61 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 _0x2f70=['limit','AddTagsToMailInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','body','options','raw','where'];(function(_0x2566d2,_0x86e7d4){var _0x10d583=function(_0x4bee7b){while(--_0x4bee7b){_0x2566d2['push'](_0x2566d2['shift']());}};_0x10d583(++_0x86e7d4);}(_0x2f70,0xb8));var _0x02f7=function(_0x59a638,_0x2639ec){_0x59a638=_0x59a638-0x0;var _0x554ff4=_0x2f70[_0x59a638];return _0x554ff4;};'use strict';var _=require(_0x02f7('0x0'));var util=require(_0x02f7('0x1'));var moment=require(_0x02f7('0x2'));var BPromise=require(_0x02f7('0x3'));var rs=require(_0x02f7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x02f7('0x5'))['db'];var utils=require(_0x02f7('0x6'));var logger=require(_0x02f7('0x7'))(_0x02f7('0x8'));var config=require(_0x02f7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x02f7('0xa')][_0x02f7('0xb')]({'port':0x232a});config[_0x02f7('0xc')]=_[_0x02f7('0xd')](config[_0x02f7('0xc')],{'host':_0x02f7('0xe'),'port':0x18eb});var socket=require(_0x02f7('0xf'))(new Redis(config[_0x02f7('0xc')]));require(_0x02f7('0x10'))['register'](socket);function respondWithRpcPromise(_0x22916a,_0x1469ae,_0x52f505){return new BPromise(function(_0x112155,_0x131a6f){return client[_0x02f7('0x11')](_0x22916a,_0x52f505)[_0x02f7('0x12')](function(_0x241e1f){logger[_0x02f7('0x13')](_0x02f7('0x14'),_0x1469ae,'request\x20sent');logger[_0x02f7('0x15')](_0x02f7('0x16'),_0x1469ae,_0x02f7('0x17'),JSON[_0x02f7('0x18')](_0x241e1f));if(_0x241e1f[_0x02f7('0x19')]){if(_0x241e1f[_0x02f7('0x19')][_0x02f7('0x1a')]===0x1f4){logger[_0x02f7('0x19')]('MailInteraction,\x20%s,\x20%s',_0x1469ae,_0x241e1f[_0x02f7('0x19')][_0x02f7('0x1b')]);return _0x131a6f(_0x241e1f[_0x02f7('0x19')][_0x02f7('0x1b')]);}logger[_0x02f7('0x19')](_0x02f7('0x14'),_0x1469ae,_0x241e1f[_0x02f7('0x19')][_0x02f7('0x1b')]);return _0x112155(_0x241e1f[_0x02f7('0x19')][_0x02f7('0x1b')]);}else{logger[_0x02f7('0x13')]('MailInteraction,\x20%s,\x20%s',_0x1469ae,'request\x20sent');_0x112155(_0x241e1f[_0x02f7('0x1c')][_0x02f7('0x1b')]);}})[_0x02f7('0x1d')](function(_0x1034a8){logger[_0x02f7('0x19')](_0x02f7('0x14'),_0x1469ae,_0x1034a8);_0x131a6f(_0x1034a8);});});}exports[_0x02f7('0x1e')]=function(_0x53e26d){var _0xd2505f=this;return new Promise(function(_0x3dd659,_0x28d92e){return db[_0x02f7('0x1f')]['update'](_0x53e26d[_0x02f7('0x20')],{'raw':_0x53e26d[_0x02f7('0x21')]?_0x53e26d[_0x02f7('0x21')][_0x02f7('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53e26d[_0x02f7('0x21')]?_0x53e26d[_0x02f7('0x21')][_0x02f7('0x23')]||null:null,'attributes':_0x53e26d[_0x02f7('0x21')]?_0x53e26d['options']['attributes']||null:null,'limit':_0x53e26d['options']?_0x53e26d[_0x02f7('0x21')][_0x02f7('0x24')]||null:null})[_0x02f7('0x12')](function(_0x511ad9){logger[_0x02f7('0x13')](_0x02f7('0x1e'),_0x53e26d);logger[_0x02f7('0x15')]('UpdateMailInteraction',_0x53e26d,JSON['stringify'](_0x511ad9));_0x3dd659(_0x511ad9);})['catch'](function(_0x514680){logger[_0x02f7('0x19')]('UpdateMailInteraction',_0x514680[_0x02f7('0x1b')],_0x53e26d);_0x28d92e(_0xd2505f[_0x02f7('0x19')](0x1f4,_0x514680[_0x02f7('0x1b')]));});});};exports[_0x02f7('0x25')]=function(_0x18517f){return new Promise(function(_0x12dc30,_0x2da29e){return db[_0x02f7('0x1f')][_0x02f7('0x26')]({'where':_0x18517f[_0x02f7('0x21')]?_0x18517f[_0x02f7('0x21')]['where']||null:null})[_0x02f7('0x12')](function(_0x375bb5){if(_0x375bb5){return _0x375bb5[_0x02f7('0x27')](_0x18517f[_0x02f7('0x20')][_0x02f7('0x28')],_[_0x02f7('0x29')](_0x18517f['body'],[_0x02f7('0x28'),'id'])||{});}})[_0x02f7('0x2a')](function(_0x1c6409){logger[_0x02f7('0x13')](_0x02f7('0x2b'),_0x18517f);logger[_0x02f7('0x15')](_0x02f7('0x2b'),_0x18517f,JSON[_0x02f7('0x18')](_0x1c6409));_0x12dc30(_0x1c6409);})[_0x02f7('0x1d')](function(_0x2d9192){logger[_0x02f7('0x19')]('AddTags',_0x2d9192[_0x02f7('0x1b')],_0x18517f);_0x2da29e(_this['error'](0x1f4,_0x2d9192[_0x02f7('0x1b')]));});});}; \ No newline at end of file +var _0xd064=['options','raw','where','limit','info','UpdateMailInteraction','AddTagsToMailInteraction','addTags','omit','ids','spread','AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailInteraction','update','body'];(function(_0x1d714a,_0xc80c5e){var _0x802682=function(_0x42956a){while(--_0x42956a){_0x1d714a['push'](_0x1d714a['shift']());}};_0x802682(++_0xc80c5e);}(_0xd064,0xe8));var _0x4d06=function(_0xe84805,_0x2702d9){_0xe84805=_0xe84805-0x0;var _0x398efd=_0xd064[_0xe84805];return _0x398efd;};'use strict';var _=require(_0x4d06('0x0'));var util=require(_0x4d06('0x1'));var moment=require('moment');var BPromise=require(_0x4d06('0x2'));var rs=require(_0x4d06('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4d06('0x4'))['db'];var utils=require(_0x4d06('0x5'));var logger=require(_0x4d06('0x6'))(_0x4d06('0x7'));var config=require(_0x4d06('0x8'));var jayson=require(_0x4d06('0x9'));var client=jayson[_0x4d06('0xa')][_0x4d06('0xb')]({'port':0x232a});config[_0x4d06('0xc')]=_['defaults'](config[_0x4d06('0xc')],{'host':_0x4d06('0xd'),'port':0x18eb});var socket=require(_0x4d06('0xe'))(new Redis(config[_0x4d06('0xc')]));require(_0x4d06('0xf'))[_0x4d06('0x10')](socket);function respondWithRpcPromise(_0xbfc5d3,_0x987806,_0x380be5){return new BPromise(function(_0x54a5e5,_0x3e9392){return client[_0x4d06('0x11')](_0xbfc5d3,_0x380be5)[_0x4d06('0x12')](function(_0x9c44b7){logger['info'](_0x4d06('0x13'),_0x987806,_0x4d06('0x14'));logger[_0x4d06('0x15')](_0x4d06('0x16'),_0x987806,_0x4d06('0x14'),JSON[_0x4d06('0x17')](_0x9c44b7));if(_0x9c44b7[_0x4d06('0x18')]){if(_0x9c44b7[_0x4d06('0x18')][_0x4d06('0x19')]===0x1f4){logger[_0x4d06('0x18')](_0x4d06('0x13'),_0x987806,_0x9c44b7['error'][_0x4d06('0x1a')]);return _0x3e9392(_0x9c44b7[_0x4d06('0x18')]['message']);}logger[_0x4d06('0x18')]('MailInteraction,\x20%s,\x20%s',_0x987806,_0x9c44b7[_0x4d06('0x18')][_0x4d06('0x1a')]);return _0x54a5e5(_0x9c44b7['error'][_0x4d06('0x1a')]);}else{logger['info'](_0x4d06('0x13'),_0x987806,_0x4d06('0x14'));_0x54a5e5(_0x9c44b7[_0x4d06('0x1b')][_0x4d06('0x1a')]);}})[_0x4d06('0x1c')](function(_0x4069be){logger['error'](_0x4d06('0x13'),_0x987806,_0x4069be);_0x3e9392(_0x4069be);});});}exports['UpdateMailInteraction']=function(_0x1dc45e){var _0x117af6=this;return new Promise(function(_0x1e71c8,_0x33dee9){return db[_0x4d06('0x1d')][_0x4d06('0x1e')](_0x1dc45e[_0x4d06('0x1f')],{'raw':_0x1dc45e[_0x4d06('0x20')]?_0x1dc45e[_0x4d06('0x20')][_0x4d06('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1dc45e['options']?_0x1dc45e[_0x4d06('0x20')][_0x4d06('0x22')]||null:null,'attributes':_0x1dc45e[_0x4d06('0x20')]?_0x1dc45e[_0x4d06('0x20')]['attributes']||null:null,'limit':_0x1dc45e['options']?_0x1dc45e[_0x4d06('0x20')][_0x4d06('0x23')]||null:null})[_0x4d06('0x12')](function(_0x353839){logger[_0x4d06('0x24')]('UpdateMailInteraction',_0x1dc45e);logger[_0x4d06('0x15')](_0x4d06('0x25'),_0x1dc45e,JSON[_0x4d06('0x17')](_0x353839));_0x1e71c8(_0x353839);})[_0x4d06('0x1c')](function(_0x5ec688){logger[_0x4d06('0x18')]('UpdateMailInteraction',_0x5ec688[_0x4d06('0x1a')],_0x1dc45e);_0x33dee9(_0x117af6['error'](0x1f4,_0x5ec688[_0x4d06('0x1a')]));});});};exports[_0x4d06('0x26')]=function(_0x399e87){return new Promise(function(_0x5c7dca,_0x3d892f){return db['MailInteraction']['find']({'where':_0x399e87[_0x4d06('0x20')]?_0x399e87['options']['where']||null:null})[_0x4d06('0x12')](function(_0x53a8fa){if(_0x53a8fa){return _0x53a8fa[_0x4d06('0x27')](_0x399e87['body']['ids'],_[_0x4d06('0x28')](_0x399e87['body'],[_0x4d06('0x29'),'id'])||{});}})[_0x4d06('0x2a')](function(_0x2ea2bd){logger['info'](_0x4d06('0x2b'),_0x399e87);logger[_0x4d06('0x15')](_0x4d06('0x2b'),_0x399e87,JSON[_0x4d06('0x17')](_0x2ea2bd));_0x5c7dca(_0x2ea2bd);})[_0x4d06('0x1c')](function(_0x4bfd35){logger[_0x4d06('0x18')](_0x4d06('0x2b'),_0x4bfd35['message'],_0x399e87);_0x3d892f(_this[_0x4d06('0x18')](0x1f4,_0x4bfd35[_0x4d06('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 5c4fbe5..fdae94d 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 _0xa080=['removeListener','mailInteraction:','remove','update','emit'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xa080,0x1c9));var _0x0a08=function(_0x5642a4,_0x3b3752){_0x5642a4=_0x5642a4-0x0;var _0x20b040=_0xa080[_0x5642a4];return _0x20b040;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save',_0x0a08('0x0'),_0x0a08('0x1')];function createListener(_0x4c0432,_0x5a6dc2){return function(_0x15609b){_0x5a6dc2[_0x0a08('0x2')](_0x4c0432,_0x15609b);};}function removeListener(_0xa5feb6,_0x100cae){return function(){MailInteractionEvents[_0x0a08('0x3')](_0xa5feb6,_0x100cae);};}exports['register']=function(_0x49c6be){for(var _0x4ff097=0x0,_0x2a59a7=events['length'];_0x4ff097<_0x2a59a7;_0x4ff097++){var _0xc81820=events[_0x4ff097];var _0x514155=createListener(_0x0a08('0x4')+_0xc81820,_0x49c6be);MailInteractionEvents['on'](_0xc81820,_0x514155);}}; \ No newline at end of file +var _0x7ab4=['update','emit','removeListener','register','mailInteraction:'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7ab4,0x140));var _0x47ab=function(_0x35a9fd,_0x540c82){_0x35a9fd=_0x35a9fd-0x0;var _0x26242e=_0x7ab4[_0x35a9fd];return _0x26242e;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=['save','remove',_0x47ab('0x0')];function createListener(_0x21b8ac,_0x56780b){return function(_0x3a563d){_0x56780b[_0x47ab('0x1')](_0x21b8ac,_0x3a563d);};}function removeListener(_0x25c8cf,_0x35da5f){return function(){MailInteractionEvents[_0x47ab('0x2')](_0x25c8cf,_0x35da5f);};}exports[_0x47ab('0x3')]=function(_0x253a9a){for(var _0x2981c1=0x0,_0x2926dd=events['length'];_0x2981c1<_0x2926dd;_0x2981c1++){var _0x2aa52e=events[_0x2981c1];var _0x509d53=createListener(_0x47ab('0x4')+_0x2aa52e,_0x253a9a);MailInteractionEvents['on'](_0x2aa52e,_0x509d53);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index b3c2750..a02aae1 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 _0xd909=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','post','mail','put','update','accept','/:id/reject','reject','destroy','exports','util'];(function(_0x4bba85,_0x4c3e39){var _0x17e4d2=function(_0x57ce98){while(--_0x57ce98){_0x4bba85['push'](_0x4bba85['shift']());}};_0x17e4d2(++_0x4c3e39);}(_0xd909,0x1c1));var _0x9d90=function(_0x11f8f8,_0x3b1d76){_0x11f8f8=_0x11f8f8-0x0;var _0x13914a=_0xd909[_0x11f8f8];return _0x13914a;};'use strict';var multer=require('multer');var util=require(_0x9d90('0x0'));var path=require(_0x9d90('0x1'));var timeout=require(_0x9d90('0x2'));var express=require(_0x9d90('0x3'));var router=express['Router']();var fs_extra=require(_0x9d90('0x4'));var auth=require(_0x9d90('0x5'));var interaction=require(_0x9d90('0x6'));var config=require(_0x9d90('0x7'));var controller=require(_0x9d90('0x8'));router[_0x9d90('0x9')]('/',auth[_0x9d90('0xa')](),controller['index']);router[_0x9d90('0x9')](_0x9d90('0xb'),auth[_0x9d90('0xa')](),controller[_0x9d90('0xc')]);router[_0x9d90('0x9')](_0x9d90('0xd'),auth[_0x9d90('0xa')](),controller[_0x9d90('0xe')]);router[_0x9d90('0x9')](_0x9d90('0xf'),auth[_0x9d90('0xa')](),controller['download']);router[_0x9d90('0x10')]('/',auth[_0x9d90('0xa')](),interaction['tracked'](_0x9d90('0x11'),'mailmessage:create'),controller['create']);router[_0x9d90('0x12')](_0x9d90('0xd'),auth[_0x9d90('0xa')](),controller[_0x9d90('0x13')]);router[_0x9d90('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0x9d90('0x14')]);router[_0x9d90('0x12')](_0x9d90('0x15'),auth[_0x9d90('0xa')](),controller[_0x9d90('0x16')]);router['delete'](_0x9d90('0xd'),auth[_0x9d90('0xa')](),controller[_0x9d90('0x17')]);module[_0x9d90('0x18')]=router; \ No newline at end of file +var _0x3715=['/:id','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','index','isAuthenticated','describe','/:id/download','download','tracked','mail','create','put'];(function(_0x29d4b5,_0x1913e2){var _0x3fbb01=function(_0x8b0a41){while(--_0x8b0a41){_0x29d4b5['push'](_0x29d4b5['shift']());}};_0x3fbb01(++_0x1913e2);}(_0x3715,0xc3));var _0x5371=function(_0x50acf3,_0xe2c988){_0x50acf3=_0x50acf3-0x0;var _0x20248f=_0x3715[_0x50acf3];return _0x20248f;};'use strict';var multer=require(_0x5371('0x0'));var util=require(_0x5371('0x1'));var path=require(_0x5371('0x2'));var timeout=require(_0x5371('0x3'));var express=require(_0x5371('0x4'));var router=express[_0x5371('0x5')]();var fs_extra=require(_0x5371('0x6'));var auth=require(_0x5371('0x7'));var interaction=require(_0x5371('0x8'));var config=require(_0x5371('0x9'));var controller=require(_0x5371('0xa'));router[_0x5371('0xb')]('/',auth['isAuthenticated'](),controller[_0x5371('0xc')]);router[_0x5371('0xb')]('/describe',auth[_0x5371('0xd')](),controller[_0x5371('0xe')]);router[_0x5371('0xb')]('/:id',auth[_0x5371('0xd')](),controller['show']);router['get'](_0x5371('0xf'),auth[_0x5371('0xd')](),controller[_0x5371('0x10')]);router['post']('/',auth[_0x5371('0xd')](),interaction[_0x5371('0x11')](_0x5371('0x12'),'mailmessage:create'),controller[_0x5371('0x13')]);router[_0x5371('0x14')](_0x5371('0x15'),auth[_0x5371('0xd')](),controller['update']);router[_0x5371('0x14')]('/:id/accept',auth[_0x5371('0xd')](),controller[_0x5371('0x16')]);router['put'](_0x5371('0x17'),auth[_0x5371('0xd')](),controller[_0x5371('0x18')]);router[_0x5371('0x19')](_0x5371('0x15'),auth[_0x5371('0xd')](),controller[_0x5371('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 7e524cb..40a027d 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 _0xeeaf=['TEXT','long','medium','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','Email','Chat','sequelize','exports'];(function(_0x7dd4b,_0x4ce376){var _0x30bad3=function(_0x17eaef){while(--_0x17eaef){_0x7dd4b['push'](_0x7dd4b['shift']());}};_0x30bad3(++_0x4ce376);}(_0xeeaf,0x150));var _0xfeea=function(_0x5150f5,_0x3b4d7b){_0x5150f5=_0x5150f5-0x0;var _0x4f7c53=_0xeeaf[_0x5150f5];return _0x4f7c53;};'use strict';var Sequelize=require(_0xfeea('0x0'));var _=require('lodash');module[_0xfeea('0x1')]={'body':{'type':Sequelize[_0xfeea('0x2')](_0xfeea('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xfeea('0x2')](_0xfeea('0x4'))},'read':{'type':Sequelize[_0xfeea('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0xfeea('0x6')]('in',_0xfeea('0x7')),'defaultValue':_0xfeea('0x7'),'allowNull':![]},'messageId':{'type':Sequelize[_0xfeea('0x8')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['TEXT'](_0xfeea('0x3'))},'cc':{'type':Sequelize[_0xfeea('0x2')](_0xfeea('0x3'))},'bcc':{'type':Sequelize[_0xfeea('0x2')](_0xfeea('0x3'))},'subject':{'type':Sequelize[_0xfeea('0x2')]},'sentAt':{'type':Sequelize[_0xfeea('0x9')]},'attach':{'type':Sequelize[_0xfeea('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xfeea('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xfeea('0x9')]},'originTo':{'type':Sequelize[_0xfeea('0x2')]('long')},'originCc':{'type':Sequelize[_0xfeea('0x2')]('long')},'originChannel':{'type':Sequelize[_0xfeea('0x6')](_0xfeea('0xb'),_0xfeea('0xc')),'defaultValue':_0xfeea('0xb'),'allowNull':![]}}; \ No newline at end of file +var _0xb9b4=['lodash','exports','TEXT','medium','BOOLEAN','ENUM','STRING','long','DATE','Email','Chat','sequelize'];(function(_0x907137,_0x48f077){var _0xd242b7=function(_0xd38959){while(--_0xd38959){_0x907137['push'](_0x907137['shift']());}};_0xd242b7(++_0x48f077);}(_0xb9b4,0x137));var _0x4b9b=function(_0x25360e,_0x434a92){_0x25360e=_0x25360e-0x0;var _0x247642=_0xb9b4[_0x25360e];return _0x247642;};'use strict';var Sequelize=require(_0x4b9b('0x0'));var _=require(_0x4b9b('0x1'));module[_0x4b9b('0x2')]={'body':{'type':Sequelize['TEXT']('long'),'allowNull':![]},'plainBody':{'type':Sequelize[_0x4b9b('0x3')](_0x4b9b('0x4'))},'read':{'type':Sequelize[_0x4b9b('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4b9b('0x6')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x4b9b('0x7')](0x1fe)},'from':{'type':Sequelize[_0x4b9b('0x7')]},'to':{'type':Sequelize[_0x4b9b('0x3')]('long')},'cc':{'type':Sequelize['TEXT'](_0x4b9b('0x8'))},'bcc':{'type':Sequelize[_0x4b9b('0x3')](_0x4b9b('0x8'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x4b9b('0x9')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x4b9b('0x3')](_0x4b9b('0x8'))},'originCc':{'type':Sequelize['TEXT']('long')},'originChannel':{'type':Sequelize[_0x4b9b('0x6')](_0x4b9b('0xa'),_0x4b9b('0xb')),'defaultValue':_0x4b9b('0xa'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 84ed085..a8cb5be 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 _0x242a=['split','MailAccount','MailAccountId','List','CmContact','Contacts','updatedAt','DESC','CloudProvider','Smtp','getSmtpOptions','attachments','join','root','basename','ListId','messageId','YYYY-MM-DD\x20HH:mm:ss','mail','read','format','UserId','user','agent','get','MailInteraction','MailInteractionId','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','fullname','email','internal','interface','channel','motionChannel','event','fromString','EventManager','acceptmessage','reject','interaction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','QueryTypes','download','unix','toString','server','files','tmp','from','Attachment','decode','createdAt','bcc','Bcc','Attachments','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','jayson/promise','http','client','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','json','offset','limit','undefined','count','set','Content-Range','update','stack','name','map','MailMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','includeAll','include','rows','params','body','find','destroy','describe','create','out','secret'];(function(_0x2543d6,_0x3a5e78){var _0x55213c=function(_0x292768){while(--_0x292768){_0x2543d6['push'](_0x2543d6['shift']());}};_0x55213c(++_0x3a5e78);}(_0x242a,0xe1));var _0xa242=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x242a[_0xa148b7];return _0x51efd3;};'use strict';var emlformat=require(_0xa242('0x0'));var moment=require(_0xa242('0x1'));var BPromise=require(_0xa242('0x2'));var util=require('util');var path=require(_0xa242('0x3'));var fs=require('fs');var _=require(_0xa242('0x4'));var Redis=require(_0xa242('0x5'));var htmlToText=require(_0xa242('0x6'));var qs=require(_0xa242('0x7'));var logger=require(_0xa242('0x8'))('api');var interaction_log=require(_0xa242('0x8'))('mail-interactions');var config=require(_0xa242('0x9'));var db=require(_0xa242('0xa'))['db'];config[_0xa242('0xb')]=_[_0xa242('0xc')](config['redis'],{'host':_0xa242('0xd'),'port':0x18eb});var socket=require(_0xa242('0xe'))(new Redis(config['redis']));var htmlEntities=require('html-entities');require(_0xa242('0xf'))['register'](socket);var jayson=require(_0xa242('0x10'));var client=jayson['client'][_0xa242('0x11')]({'port':0x232c});var client9003=jayson[_0xa242('0x12')][_0xa242('0x11')]({'port':0x232b});var client9002=jayson['client'][_0xa242('0x11')]({'port':0x232a});function respondWithRpcPromise(_0x3c0e44,_0x2a1b27,_0x4d117e,_0x286121){return new BPromise(function(_0x4d5cf6,_0x227c05){var _0x108d14=_0x286121||client;return _0x108d14['request'](_0x3c0e44,_0x4d117e)[_0xa242('0x13')](function(_0x258b84){logger['info'](_0xa242('0x14'),_0x2a1b27,_0xa242('0x15'));logger[_0xa242('0x16')](_0xa242('0x17'),_0x2a1b27,_0xa242('0x15'),JSON[_0xa242('0x18')](_0x258b84));if(_0x258b84[_0xa242('0x19')]){if(_0x258b84[_0xa242('0x19')][_0xa242('0x1a')]===0x1f4){logger[_0xa242('0x19')](_0xa242('0x14'),_0x2a1b27,_0x258b84['error'][_0xa242('0x1b')]);return _0x227c05(_0x258b84[_0xa242('0x19')][_0xa242('0x1b')]);}logger[_0xa242('0x19')](_0xa242('0x14'),_0x2a1b27,_0x258b84[_0xa242('0x19')][_0xa242('0x1b')]);return _0x4d5cf6(_0x258b84['error'][_0xa242('0x1b')]);}else{logger[_0xa242('0x1c')](_0xa242('0x14'),_0x2a1b27,_0xa242('0x15'));_0x4d5cf6(_0x258b84[_0xa242('0x1d')]['message']);}})[_0xa242('0x1e')](function(_0x1da694){logger[_0xa242('0x19')](_0xa242('0x14'),_0x2a1b27,_0x1da694);_0x227c05(_0x1da694);});});}function respondWithResult(_0x44674f,_0x56f13f){_0x56f13f=_0x56f13f||0xc8;return function(_0x1de4d3){if(_0x1de4d3){return _0x44674f[_0xa242('0x1f')](_0x56f13f)[_0xa242('0x20')](_0x1de4d3);}};}function respondWithFilteredResult(_0x4ef5db,_0x22b6ed){return function(_0x1df8bd){if(_0x1df8bd){var _0x5f05a7=typeof _0x22b6ed[_0xa242('0x21')]==='undefined'&&typeof _0x22b6ed[_0xa242('0x22')]===_0xa242('0x23');var _0x13955d=_0x1df8bd[_0xa242('0x24')];var _0x49000f=_0x5f05a7?0x0:_0x22b6ed[_0xa242('0x21')];var _0x2649a9=_0x5f05a7?_0x1df8bd[_0xa242('0x24')]:_0x22b6ed['offset']+_0x22b6ed['limit'];var _0x448d91;if(_0x2649a9>=_0x13955d){_0x2649a9=_0x13955d;_0x448d91=0xc8;}else{_0x448d91=0xce;}_0x4ef5db[_0xa242('0x1f')](_0x448d91);return _0x4ef5db[_0xa242('0x25')](_0xa242('0x26'),_0x49000f+'-'+_0x2649a9+'/'+_0x13955d)[_0xa242('0x20')](_0x1df8bd);}return null;};}function saveUpdates(_0x4a1b82){return function(_0xb94688){if(_0xb94688){return _0xb94688[_0xa242('0x27')](_0x4a1b82)[_0xa242('0x13')](function(_0x41d3bf){return _0x41d3bf;});}return null;};}function removeEntity(_0x2391de){return function(_0x29df2f){if(_0x29df2f){return _0x29df2f['destroy']()['then'](function(){_0x2391de[_0xa242('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x244b85){return function(_0x4cfb61){if(!_0x4cfb61){_0x244b85['sendStatus'](0x194);}return _0x4cfb61;};}function handleError(_0x5b117e,_0x4e5a69){_0x4e5a69=_0x4e5a69||0x1f4;return function(_0x27f38b){logger['error'](_0x27f38b[_0xa242('0x28')]);if(_0x27f38b['name']){delete _0x27f38b[_0xa242('0x29')];}_0x5b117e['status'](_0x4e5a69)['send'](_0x27f38b);};}exports['index']=function(_0x36ab38,_0x285615){var _0x52f020={},_0xe8b0ba={},_0x54de2d={'count':0x0,'rows':[]};var _0x4f134d=_[_0xa242('0x2a')](db[_0xa242('0x2b')][_0xa242('0x2c')],function(_0x491c82){return{'name':_0x491c82[_0xa242('0x2d')],'type':_0x491c82[_0xa242('0x2e')][_0xa242('0x2f')]};});_0xe8b0ba['model']=_[_0xa242('0x2a')](_0x4f134d,_0xa242('0x29'));_0xe8b0ba[_0xa242('0x30')]=_[_0xa242('0x31')](_0x36ab38['query']);_0xe8b0ba[_0xa242('0x32')]=_[_0xa242('0x33')](_0xe8b0ba[_0xa242('0x34')],_0xe8b0ba[_0xa242('0x30')]);_0x52f020[_0xa242('0x35')]=_[_0xa242('0x33')](_0xe8b0ba[_0xa242('0x34')],qs[_0xa242('0x36')](_0x36ab38[_0xa242('0x30')][_0xa242('0x36')]));_0x52f020[_0xa242('0x35')]=_0x52f020[_0xa242('0x35')][_0xa242('0x37')]?_0x52f020[_0xa242('0x35')]:_0xe8b0ba[_0xa242('0x34')];if(!_0x36ab38[_0xa242('0x30')]['hasOwnProperty'](_0xa242('0x38'))){_0x52f020[_0xa242('0x22')]=qs[_0xa242('0x22')](_0x36ab38[_0xa242('0x30')]['limit']);_0x52f020[_0xa242('0x21')]=qs[_0xa242('0x21')](_0x36ab38['query'][_0xa242('0x21')]);}_0x52f020[_0xa242('0x39')]=qs[_0xa242('0x3a')](_0x36ab38['query'][_0xa242('0x3a')]);_0x52f020[_0xa242('0x3b')]=qs[_0xa242('0x32')](_[_0xa242('0x3c')](_0x36ab38['query'],_0xe8b0ba[_0xa242('0x32')]),_0x4f134d);if(_0x36ab38[_0xa242('0x30')]['filter']){_0x52f020[_0xa242('0x3b')]=_['merge'](_0x52f020[_0xa242('0x3b')],{'$or':_[_0xa242('0x2a')](_0x4f134d,function(_0x27cc29){if(_0x27cc29[_0xa242('0x2e')]!==_0xa242('0x3d')){var _0x13768a={};_0x13768a[_0x27cc29[_0xa242('0x29')]]={'$like':'%'+_0x36ab38[_0xa242('0x30')][_0xa242('0x3e')]+'%'};return _0x13768a;}})});}_0x52f020=_[_0xa242('0x3f')]({},_0x52f020,_0x36ab38['options']);var _0x23c6d2={'where':_0x52f020[_0xa242('0x3b')]};return db[_0xa242('0x2b')]['count'](_0x23c6d2)[_0xa242('0x13')](function(_0x33df0e){_0x54de2d['count']=_0x33df0e;if(_0x36ab38[_0xa242('0x30')][_0xa242('0x40')]){_0x52f020[_0xa242('0x41')]=[{'all':!![]}];}return db[_0xa242('0x2b')]['findAll'](_0x52f020);})['then'](function(_0x2ccb8c){_0x54de2d[_0xa242('0x42')]=_0x2ccb8c;return _0x54de2d;})[_0xa242('0x13')](respondWithFilteredResult(_0x285615,_0x52f020))[_0xa242('0x1e')](handleError(_0x285615,null));};exports['show']=function(_0x37961,_0x4cdd58){var _0x5a0cef={'raw':!![],'where':{'id':_0x37961[_0xa242('0x43')]['id']}},_0xee085d={};_0xee085d[_0xa242('0x34')]=_[_0xa242('0x31')](db[_0xa242('0x2b')][_0xa242('0x2c')]);_0xee085d[_0xa242('0x30')]=_[_0xa242('0x31')](_0x37961[_0xa242('0x30')]);_0xee085d['filters']=_[_0xa242('0x33')](_0xee085d[_0xa242('0x34')],_0xee085d['query']);_0x5a0cef[_0xa242('0x35')]=_['intersection'](_0xee085d['model'],qs[_0xa242('0x36')](_0x37961[_0xa242('0x30')][_0xa242('0x36')]));_0x5a0cef[_0xa242('0x35')]=_0x5a0cef['attributes']['length']?_0x5a0cef[_0xa242('0x35')]:_0xee085d[_0xa242('0x34')];if(_0x37961[_0xa242('0x30')]['includeAll']){_0x5a0cef[_0xa242('0x41')]=[{'all':!![]}];}_0x5a0cef=_[_0xa242('0x3f')]({},_0x5a0cef,_0x37961['options']);return db[_0xa242('0x2b')]['find'](_0x5a0cef)['then'](handleEntityNotFound(_0x4cdd58,null))[_0xa242('0x13')](respondWithResult(_0x4cdd58,null))[_0xa242('0x1e')](handleError(_0x4cdd58,null));};exports[_0xa242('0x27')]=function(_0x1054ca,_0x1b8356){if(_0x1054ca[_0xa242('0x44')]['id']){delete _0x1054ca['body']['id'];}return db[_0xa242('0x2b')][_0xa242('0x45')]({'where':{'id':_0x1054ca[_0xa242('0x43')]['id']}})[_0xa242('0x13')](handleEntityNotFound(_0x1b8356,null))[_0xa242('0x13')](saveUpdates(_0x1054ca[_0xa242('0x44')],null))['then'](respondWithResult(_0x1b8356,null))[_0xa242('0x1e')](handleError(_0x1b8356,null));};exports[_0xa242('0x46')]=function(_0x2caa9e,_0x1ee8d6){return db[_0xa242('0x2b')][_0xa242('0x45')]({'where':{'id':_0x2caa9e[_0xa242('0x43')]['id']}})[_0xa242('0x13')](handleEntityNotFound(_0x1ee8d6,null))[_0xa242('0x13')](removeEntity(_0x1ee8d6,null))[_0xa242('0x1e')](handleError(_0x1ee8d6,null));};exports[_0xa242('0x47')]=function(_0xf33572,_0x4c3133){return db[_0xa242('0x2b')][_0xa242('0x47')]()[_0xa242('0x13')](respondWithResult(_0x4c3133,null))[_0xa242('0x1e')](handleError(_0x4c3133,null));};exports[_0xa242('0x48')]=function(_0x546d25,_0x397fca){return db[_0xa242('0x2b')][_0xa242('0x48')](_0x546d25[_0xa242('0x44')])[_0xa242('0x13')](function(_0x4d23af){if(_0x4d23af){if(_0x4d23af['direction']===_0xa242('0x49')&&!_0x4d23af[_0xa242('0x4a')]){var _0x1f96cd,_0x29f47e,_0x17ef0e;if(_0x546d25['body']['to']){_0x29f47e=_0x546d25[_0xa242('0x44')]['to'][_0xa242('0x4b')](',')[0x0];}return db[_0xa242('0x4c')]['findOne']({'where':{'id':_0x4d23af[_0xa242('0x4d')]},'include':[{'model':db['CmList'],'as':_0xa242('0x4e'),'include':[{'model':db[_0xa242('0x4f')],'as':_0xa242('0x50'),'where':{'email':_0x29f47e},'limit':0x1,'order':[[_0xa242('0x51'),_0xa242('0x52')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0xa242('0x53')],'as':_0xa242('0x53'),'raw':!![]}]}]})[_0xa242('0x13')](function(_0x5db8e8){_0x1f96cd=_0x5db8e8;if(!_0x1f96cd||!_0x1f96cd[_0xa242('0x54')])return;var _0x355a91=_0x1f96cd[_0xa242('0x55')]();if(_0x546d25[_0xa242('0x44')][_0xa242('0x56')]&&_0x546d25[_0xa242('0x44')][_0xa242('0x56')][_0xa242('0x37')]){for(var _0x432f73=0x0;_0x432f73<_0x546d25[_0xa242('0x44')][_0xa242('0x56')][_0xa242('0x37')];_0x432f73+=0x1){_0x546d25['body'][_0xa242('0x56')][_0x432f73]={'filename':_0x546d25[_0xa242('0x44')][_0xa242('0x56')][_0x432f73][_0xa242('0x29')],'path':path[_0xa242('0x57')](config[_0xa242('0x58')],'server/files/attachments',_0x546d25[_0xa242('0x44')][_0xa242('0x56')][_0x432f73][_0xa242('0x59')])};}}_0x17ef0e={'account':_0x355a91,'message':_0x546d25[_0xa242('0x44')]};return;})[_0xa242('0x13')](function(){if(_0x1f96cd[_0xa242('0x4e')]){if(_0x1f96cd[_0xa242('0x4e')][_0xa242('0x50')]['length']){return _0x1f96cd[_0xa242('0x4e')][_0xa242('0x50')][0x0];}else{return db[_0xa242('0x4f')][_0xa242('0x48')](_['defaults'](_0x546d25['body'],{'firstName':_0x546d25[_0xa242('0x44')]['to'],'email':_0x546d25[_0xa242('0x44')]['to'],'phone':_0x546d25[_0xa242('0x44')]['to'],'ListId':_0x1f96cd[_0xa242('0x5a')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xa242('0x13')](function(){if(_0x17ef0e){return respondWithRpcPromise('SendMail','sendMail',_0x17ef0e,client9003)['then'](function(_0x1a21d7){return _0x4d23af[_0xa242('0x27')]({'read':!![],'messageId':_0x1a21d7[_0xa242('0x5b')],'sentAt':moment()['format'](_0xa242('0x5c'))});})['catch'](function(_0x107203){logger[_0xa242('0x19')]('%s',JSON[_0xa242('0x18')](_0x107203));return _0x4d23af;});}return _0x4d23af;});}return _0x4d23af;}})[_0xa242('0x13')](respondWithResult(_0x397fca,0xc9))['catch'](handleError(_0x397fca,null));};exports['accept']=function(_0x261174,_0x12399d){var _0x1bea1c={'agent':{},'channel':_0xa242('0x5d')};if(_0x261174[_0xa242('0x44')]['id']){delete _0x261174[_0xa242('0x44')]['id'];}_0x261174['body'][_0xa242('0x5e')]=!![];_0x261174[_0xa242('0x44')]['readAt']=moment()[_0xa242('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x261174[_0xa242('0x44')]['UserId']=_0x261174[_0xa242('0x44')][_0xa242('0x60')]||_0x261174[_0xa242('0x61')]['id'];_0x1bea1c[_0xa242('0x62')]['id']=_0x261174[_0xa242('0x44')][_0xa242('0x60')];return db[_0xa242('0x2b')][_0xa242('0x45')]({'where':{'id':_0x261174[_0xa242('0x43')]['id'],'UserId':null}})[_0xa242('0x13')](handleEntityNotFound(_0x12399d,null))['then'](saveUpdates(_0x261174[_0xa242('0x44')],null))[_0xa242('0x13')](function(_0x2e6e61){if(_0x2e6e61){_0x1bea1c[_0xa242('0x1b')]=_0x2e6e61[_0xa242('0x63')]({'plain':!![]});return db[_0xa242('0x64')][_0xa242('0x45')]({'where':{'id':_0x2e6e61[_0xa242('0x65')]}});}return null;})[_0xa242('0x13')](handleEntityNotFound(_0x12399d,null))[_0xa242('0x13')](function(_0x367aaf){if(_0x367aaf){return _0x367aaf['update']({'UserId':_0x261174[_0xa242('0x44')][_0xa242('0x60')],'read1stAt':_[_0xa242('0x66')](_0x367aaf[_0xa242('0x67')])?moment()[_0xa242('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xa242('0x13')](function(_0x79a564){if(_0x79a564){_0x1bea1c['interaction']=_0x79a564['get']({'plain':!![]});interaction_log[_0xa242('0x1c')](_0xa242('0x68'),_0x261174[_0xa242('0x61')]['id'],_0x261174[_0xa242('0x61')][_0xa242('0x29')],_0x261174[_0xa242('0x61')][_0xa242('0x69')],_0x1bea1c['interaction']['id'],_0x261174[_0xa242('0x44')]?JSON[_0xa242('0x18')](_0x261174[_0xa242('0x44')]):_0xa242('0x6a'));return respondWithRpcPromise(_0xa242('0x6b'),_0xa242('0x6c'),_0x1bea1c);}return null;})[_0xa242('0x13')](function(_0x43c381){var _0x11baa0=_0xa242('0x6d')+_0x43c381[_0xa242('0x1b')][_0xa242('0x6e')];return db['sequelize']['query'](_0x11baa0,{'type':db[_0xa242('0x6f')]['QueryTypes'][_0xa242('0x70')],'raw':!![]})[_0xa242('0x13')](function(_0x2f360d){return _0x2f360d;});})[_0xa242('0x13')](function(_0x423587){if(_0x423587){_0x1bea1c[_0xa242('0x1b')][_0xa242('0x71')]=_0x423587[0x0];if(!_0x261174[_0xa242('0x44')]['UserId'])return;return db[_0xa242('0x72')][_0xa242('0x45')]({'where':{'id':_0x261174['body'][_0xa242('0x60')],'role':_0xa242('0x62')},'attributes':['id',_0xa242('0x29'),_0xa242('0x73'),_0xa242('0x74'),_0xa242('0x75')],'raw':!![]});}return null;})['then'](function(_0x5bc597){if(!_0x5bc597)return null;_0x1bea1c['message']['agent']=_0x5bc597;return _0x1bea1c;})[_0xa242('0x13')](function(_0x5d6799){if(_0x5d6799){if(_0x261174[_0xa242('0x44')]['manual']){_0x1bea1c['message'][_0xa242('0x76')]=util[_0xa242('0x5f')]('SIP/%s',_0x261174[_0xa242('0x61')][_0xa242('0x29')]);_0x1bea1c[_0xa242('0x1b')][_0xa242('0x77')]=_0x1bea1c['channel'];_0x1bea1c['message'][_0xa242('0x78')]=_0x1bea1c['channel'];_0x1bea1c[_0xa242('0x1b')][_0xa242('0x79')]='accept';_0x1bea1c['message']['body']=htmlToText[_0xa242('0x7a')](_0x1bea1c[_0xa242('0x1b')][_0xa242('0x44')]);return respondWithRpcPromise('EventManager',_0xa242('0x7b'),{'event':_0xa242('0x7c'),'message':_0x1bea1c[_0xa242('0x1b')]},client9002)[_0xa242('0x13')](function(){return _0x1bea1c;});}return _0x1bea1c;}return null;})[_0xa242('0x13')](respondWithResult(_0x12399d,null))[_0xa242('0x1e')](handleError(_0x12399d,null));};exports[_0xa242('0x7d')]=function(_0x2d3e23,_0x358491){var _0x55c6fb={'agent':{},'channel':'mail'};if(_0x2d3e23[_0xa242('0x44')]['id']){delete _0x2d3e23['body']['id'];}_0x2d3e23['body'][_0xa242('0x60')]=_0x2d3e23[_0xa242('0x44')][_0xa242('0x60')]||_0x2d3e23['user']['id'];_0x55c6fb[_0xa242('0x62')]['id']=_0x2d3e23[_0xa242('0x44')][_0xa242('0x60')];return db[_0xa242('0x2b')][_0xa242('0x45')]({'where':{'id':_0x2d3e23[_0xa242('0x43')]['id'],'UserId':null}})[_0xa242('0x13')](handleEntityNotFound(_0x358491,null))[_0xa242('0x13')](function(_0x8b2fbb){if(_0x8b2fbb){_0x55c6fb[_0xa242('0x1b')]=_0x8b2fbb['get']({'plain':!![]});return db[_0xa242('0x64')][_0xa242('0x45')]({'where':{'id':_0x8b2fbb[_0xa242('0x65')]}});}return null;})[_0xa242('0x13')](handleEntityNotFound(_0x358491,null))[_0xa242('0x13')](function(_0x1c3d3b){if(_0x1c3d3b){_0x55c6fb[_0xa242('0x7e')]=_0x1c3d3b['get']({'plain':!![]});interaction_log[_0xa242('0x1c')](_0xa242('0x7f'),_0x2d3e23[_0xa242('0x61')]['id'],_0x2d3e23[_0xa242('0x61')][_0xa242('0x29')],_0x2d3e23['user'][_0xa242('0x69')],_0x55c6fb[_0xa242('0x7e')]['id'],_0x2d3e23[_0xa242('0x44')]?JSON['stringify'](_0x2d3e23[_0xa242('0x44')]):_0xa242('0x6a'));return respondWithRpcPromise(_0xa242('0x80'),_0xa242('0x81'),_0x55c6fb);}return null;})[_0xa242('0x13')](function(_0x4e6607){var _0x445276=_0xa242('0x6d')+_0x4e6607[_0xa242('0x1b')][_0xa242('0x6e')];return db['sequelize'][_0xa242('0x30')](_0x445276,{'type':db['Sequelize'][_0xa242('0x82')][_0xa242('0x70')],'raw':!![]})[_0xa242('0x13')](function(_0x5c89e7){return _0x5c89e7;});})['then'](function(_0x1e6596){if(_0x1e6596){_0x55c6fb[_0xa242('0x1b')][_0xa242('0x71')]=_0x1e6596[0x0];if(!_0x2d3e23[_0xa242('0x44')][_0xa242('0x60')])return;return db[_0xa242('0x72')][_0xa242('0x45')]({'where':{'id':_0x2d3e23[_0xa242('0x44')][_0xa242('0x60')],'role':'agent'},'attributes':['id',_0xa242('0x29'),'fullname',_0xa242('0x74'),'internal'],'raw':!![]});}return null;})['then'](function(_0x27647c){if(!_0x27647c)return null;_0x55c6fb['message'][_0xa242('0x62')]=_0x27647c;return _0x55c6fb;})['then'](function(_0x56a79a){if(_0x56a79a){_0x56a79a['message'][_0xa242('0x76')]=util[_0xa242('0x5f')]('SIP/%s',_0x2d3e23[_0xa242('0x61')][_0xa242('0x29')]);_0x56a79a['message'][_0xa242('0x77')]=_0x55c6fb['channel'];_0x56a79a[_0xa242('0x1b')][_0xa242('0x78')]=_0x55c6fb[_0xa242('0x77')];_0x56a79a[_0xa242('0x1b')]['event']=_0xa242('0x7d');_0x56a79a[_0xa242('0x1b')][_0xa242('0x44')]=htmlToText['fromString'](_0x55c6fb[_0xa242('0x1b')]['body']);respondWithRpcPromise(_0xa242('0x7b'),_0xa242('0x7b'),{'event':'rejectmessage','message':_0x56a79a[_0xa242('0x1b')]},client9002);return _0x55c6fb;}return null;})[_0xa242('0x13')](respondWithResult(_0x358491,null))['catch'](handleError(_0x358491,null));};exports[_0xa242('0x83')]=function(_0x4ad3b5,_0x62eea0){var _0x588379=moment()[_0xa242('0x84')]()[_0xa242('0x85')]();var _0x40adcd=path[_0xa242('0x57')](config[_0xa242('0x58')],_0xa242('0x86'),_0xa242('0x87'),_0xa242('0x88'));var _0x36ab43=path[_0xa242('0x57')](config['root'],_0xa242('0x86'),'files',_0xa242('0x56'));var _0x7f1d10=util[_0xa242('0x5f')]('message-%s.eml',_0x588379);return db[_0xa242('0x2b')]['find']({'where':{'id':_0x4ad3b5[_0xa242('0x43')]['id']},'attributes':['id',_0xa242('0x44'),_0xa242('0x89'),'to','cc','bcc','subject','createdAt'],'include':_0x4ad3b5[_0xa242('0x30')][_0xa242('0x56')]?[{'model':db[_0xa242('0x8a')],'as':'Attachments'}]:undefined})[_0xa242('0x13')](handleEntityNotFound(_0x62eea0,null))[_0xa242('0x13')](function(_0x1d51e6){if(_0x1d51e6){var _0x45fd0a=_0x1d51e6;var _0x1c550d={'from':_0x45fd0a['from'],'to':_0x45fd0a['to'],'subject':_0x45fd0a['subject'],'html':htmlEntities[_0xa242('0x8b')](_0x45fd0a[_0xa242('0x44')]),'headers':{'Date':moment(_0x45fd0a[_0xa242('0x8c')])[_0xa242('0x5f')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x1d51e6['cc']){_0x1c550d['headers']['Cc']=_0x1d51e6['cc'];}if(_0x1d51e6[_0xa242('0x8d')]){_0x1c550d['headers'][_0xa242('0x8e')]=_0x1d51e6[_0xa242('0x8d')];}return new BPromise(function(_0x1ef0fe,_0x5addc8){if(_0x1d51e6['Attachments']){for(var _0x1b1bea=0x0;_0x1b1bea<_0x1d51e6[_0xa242('0x8f')]['length'];_0x1b1bea++){var _0x1d7239=_0x1d51e6[_0xa242('0x8f')][_0x1b1bea];var _0x113eff=path[_0xa242('0x57')](_0x36ab43,_0x1d7239[_0xa242('0x59')]);if(fs[_0xa242('0x90')](_0x113eff)){_0x1c550d[_0xa242('0x56')][_0xa242('0x91')]({'name':_0x1d7239[_0xa242('0x29')],'contentType':_0x1d7239[_0xa242('0x2e')],'data':fs[_0xa242('0x92')](_0x113eff)});}}}emlformat[_0xa242('0x93')](_0x1c550d,function(_0x32c14c,_0xbf7b5){if(_0x32c14c)return _0x5addc8(_0x32c14c);fs[_0xa242('0x94')](path[_0xa242('0x57')](_0x40adcd,_0x7f1d10),_0xbf7b5);return _0x1ef0fe(_0xbf7b5);});});}})[_0xa242('0x13')](function(_0x3a86d8){if(_0x3a86d8){return _0x62eea0[_0xa242('0x83')](path[_0xa242('0x57')](_0x40adcd,_0x7f1d10),_0x7f1d10,function(_0x412abe){if(!_0x412abe)fs[_0xa242('0x95')](path[_0xa242('0x57')](_0x40adcd,_0x7f1d10));});}})['catch'](handleError(_0x62eea0,null));}; \ No newline at end of file +var _0x9391=['getSmtpOptions','attachments','join','root','server/files/attachments','Contacts','ListId','List\x20not\x20found','SendMail','sendMail','messageId','format','accept','mail','read','readAt','UserId','user','get','MailInteraction','MailInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','contact','User','agent','fullname','internal','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','reject','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','sequelize','SELECT','email','event','fromString','download','unix','toString','files','tmp','server','bcc','subject','createdAt','from','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','basename','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','util','path','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','localhost','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','undefined','limit','count','offset','set','Content-Range','update','then','end','sendStatus','stack','name','MailMessage','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','findAll','rows','show','params','rawAttributes','include','find','body','destroy','describe','create','direction','secret','split','MailAccount','findOne','CmList','List','CmContact','updatedAt','DESC','MailServerOut','CloudProvider','Smtp'];(function(_0x108273,_0x3ff045){var _0x4d201a=function(_0x54f9de){while(--_0x54f9de){_0x108273['push'](_0x108273['shift']());}};_0x4d201a(++_0x3ff045);}(_0x9391,0x18d));var _0x1939=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9391[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x1939('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x1939('0x1'));var path=require(_0x1939('0x2'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x1939('0x3'));var htmlToText=require(_0x1939('0x4'));var qs=require(_0x1939('0x5'));var logger=require(_0x1939('0x6'))(_0x1939('0x7'));var interaction_log=require(_0x1939('0x6'))(_0x1939('0x8'));var config=require(_0x1939('0x9'));var db=require(_0x1939('0xa'))['db'];config[_0x1939('0xb')]=_['defaults'](config[_0x1939('0xb')],{'host':_0x1939('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1939('0xb')]));var htmlEntities=require(_0x1939('0xd'));require(_0x1939('0xe'))[_0x1939('0xf')](socket);var jayson=require(_0x1939('0x10'));var client=jayson[_0x1939('0x11')]['http']({'port':0x232c});var client9003=jayson['client'][_0x1939('0x12')]({'port':0x232b});var client9002=jayson[_0x1939('0x11')][_0x1939('0x12')]({'port':0x232a});function respondWithRpcPromise(_0x100b94,_0xeaba66,_0x16f798,_0x2a57e5){return new BPromise(function(_0x4d9851,_0x18986a){var _0x5e961e=_0x2a57e5||client;return _0x5e961e[_0x1939('0x13')](_0x100b94,_0x16f798)['then'](function(_0x1c788d){logger[_0x1939('0x14')](_0x1939('0x15'),_0xeaba66,_0x1939('0x16'));logger[_0x1939('0x17')](_0x1939('0x18'),_0xeaba66,_0x1939('0x16'),JSON[_0x1939('0x19')](_0x1c788d));if(_0x1c788d['error']){if(_0x1c788d[_0x1939('0x1a')]['code']===0x1f4){logger['error'](_0x1939('0x15'),_0xeaba66,_0x1c788d[_0x1939('0x1a')][_0x1939('0x1b')]);return _0x18986a(_0x1c788d['error'][_0x1939('0x1b')]);}logger[_0x1939('0x1a')]('MailMessage,\x20%s,\x20%s',_0xeaba66,_0x1c788d[_0x1939('0x1a')][_0x1939('0x1b')]);return _0x4d9851(_0x1c788d['error'][_0x1939('0x1b')]);}else{logger[_0x1939('0x14')](_0x1939('0x15'),_0xeaba66,'request\x20sent');_0x4d9851(_0x1c788d[_0x1939('0x1c')][_0x1939('0x1b')]);}})[_0x1939('0x1d')](function(_0x48f34e){logger['error']('MailMessage,\x20%s,\x20%s',_0xeaba66,_0x48f34e);_0x18986a(_0x48f34e);});});}function respondWithResult(_0x20fdb6,_0xa83132){_0xa83132=_0xa83132||0xc8;return function(_0x3188b5){if(_0x3188b5){return _0x20fdb6[_0x1939('0x1e')](_0xa83132)[_0x1939('0x1f')](_0x3188b5);}};}function respondWithFilteredResult(_0x4670e3,_0x249f6d){return function(_0x1167a9){if(_0x1167a9){var _0x9329a2=typeof _0x249f6d['offset']===_0x1939('0x20')&&typeof _0x249f6d[_0x1939('0x21')]===_0x1939('0x20');var _0x20762e=_0x1167a9[_0x1939('0x22')];var _0x592725=_0x9329a2?0x0:_0x249f6d['offset'];var _0x3c993b=_0x9329a2?_0x1167a9['count']:_0x249f6d[_0x1939('0x23')]+_0x249f6d['limit'];var _0x10fef4;if(_0x3c993b>=_0x20762e){_0x3c993b=_0x20762e;_0x10fef4=0xc8;}else{_0x10fef4=0xce;}_0x4670e3[_0x1939('0x1e')](_0x10fef4);return _0x4670e3[_0x1939('0x24')](_0x1939('0x25'),_0x592725+'-'+_0x3c993b+'/'+_0x20762e)['json'](_0x1167a9);}return null;};}function saveUpdates(_0x6db6c6){return function(_0xbc8b55){if(_0xbc8b55){return _0xbc8b55[_0x1939('0x26')](_0x6db6c6)['then'](function(_0x4dcb62){return _0x4dcb62;});}return null;};}function removeEntity(_0x2af370){return function(_0x4cb53d){if(_0x4cb53d){return _0x4cb53d['destroy']()[_0x1939('0x27')](function(){_0x2af370['status'](0xcc)[_0x1939('0x28')]();});}};}function handleEntityNotFound(_0x35b965){return function(_0x45dd62){if(!_0x45dd62){_0x35b965[_0x1939('0x29')](0x194);}return _0x45dd62;};}function handleError(_0x5c0843,_0x3d6d66){_0x3d6d66=_0x3d6d66||0x1f4;return function(_0x2ca488){logger[_0x1939('0x1a')](_0x2ca488[_0x1939('0x2a')]);if(_0x2ca488[_0x1939('0x2b')]){delete _0x2ca488[_0x1939('0x2b')];}_0x5c0843[_0x1939('0x1e')](_0x3d6d66)['send'](_0x2ca488);};}exports['index']=function(_0x2b5a3b,_0xf1cb13){var _0x27ad81={},_0xbd3b59={},_0xe710f4={'count':0x0,'rows':[]};var _0x33e769=_['map'](db[_0x1939('0x2c')]['rawAttributes'],function(_0x5b34a3){return{'name':_0x5b34a3[_0x1939('0x2d')],'type':_0x5b34a3[_0x1939('0x2e')]['key']};});_0xbd3b59[_0x1939('0x2f')]=_[_0x1939('0x30')](_0x33e769,_0x1939('0x2b'));_0xbd3b59[_0x1939('0x31')]=_[_0x1939('0x32')](_0x2b5a3b['query']);_0xbd3b59[_0x1939('0x33')]=_['intersection'](_0xbd3b59[_0x1939('0x2f')],_0xbd3b59[_0x1939('0x31')]);_0x27ad81[_0x1939('0x34')]=_[_0x1939('0x35')](_0xbd3b59[_0x1939('0x2f')],qs[_0x1939('0x36')](_0x2b5a3b[_0x1939('0x31')][_0x1939('0x36')]));_0x27ad81[_0x1939('0x34')]=_0x27ad81[_0x1939('0x34')][_0x1939('0x37')]?_0x27ad81[_0x1939('0x34')]:_0xbd3b59['model'];if(!_0x2b5a3b[_0x1939('0x31')][_0x1939('0x38')](_0x1939('0x39'))){_0x27ad81['limit']=qs[_0x1939('0x21')](_0x2b5a3b[_0x1939('0x31')][_0x1939('0x21')]);_0x27ad81[_0x1939('0x23')]=qs['offset'](_0x2b5a3b[_0x1939('0x31')][_0x1939('0x23')]);}_0x27ad81['order']=qs[_0x1939('0x3a')](_0x2b5a3b[_0x1939('0x31')][_0x1939('0x3a')]);_0x27ad81['where']=qs[_0x1939('0x33')](_[_0x1939('0x3b')](_0x2b5a3b[_0x1939('0x31')],_0xbd3b59[_0x1939('0x33')]),_0x33e769);if(_0x2b5a3b[_0x1939('0x31')][_0x1939('0x3c')]){_0x27ad81[_0x1939('0x3d')]=_[_0x1939('0x3e')](_0x27ad81[_0x1939('0x3d')],{'$or':_[_0x1939('0x30')](_0x33e769,function(_0x4aae77){if(_0x4aae77[_0x1939('0x2e')]!==_0x1939('0x3f')){var _0x11e171={};_0x11e171[_0x4aae77['name']]={'$like':'%'+_0x2b5a3b['query'][_0x1939('0x3c')]+'%'};return _0x11e171;}})});}_0x27ad81=_[_0x1939('0x3e')]({},_0x27ad81,_0x2b5a3b[_0x1939('0x40')]);var _0x4fbff6={'where':_0x27ad81[_0x1939('0x3d')]};return db[_0x1939('0x2c')][_0x1939('0x22')](_0x4fbff6)[_0x1939('0x27')](function(_0x3d5316){_0xe710f4['count']=_0x3d5316;if(_0x2b5a3b[_0x1939('0x31')]['includeAll']){_0x27ad81['include']=[{'all':!![]}];}return db[_0x1939('0x2c')][_0x1939('0x41')](_0x27ad81);})[_0x1939('0x27')](function(_0x459281){_0xe710f4[_0x1939('0x42')]=_0x459281;return _0xe710f4;})[_0x1939('0x27')](respondWithFilteredResult(_0xf1cb13,_0x27ad81))[_0x1939('0x1d')](handleError(_0xf1cb13,null));};exports[_0x1939('0x43')]=function(_0xec77f8,_0x4de783){var _0x4138eb={'raw':!![],'where':{'id':_0xec77f8[_0x1939('0x44')]['id']}},_0x3c2a9b={};_0x3c2a9b[_0x1939('0x2f')]=_['keys'](db['MailMessage'][_0x1939('0x45')]);_0x3c2a9b[_0x1939('0x31')]=_['keys'](_0xec77f8['query']);_0x3c2a9b[_0x1939('0x33')]=_[_0x1939('0x35')](_0x3c2a9b[_0x1939('0x2f')],_0x3c2a9b[_0x1939('0x31')]);_0x4138eb[_0x1939('0x34')]=_[_0x1939('0x35')](_0x3c2a9b['model'],qs[_0x1939('0x36')](_0xec77f8['query'][_0x1939('0x36')]));_0x4138eb[_0x1939('0x34')]=_0x4138eb['attributes'][_0x1939('0x37')]?_0x4138eb[_0x1939('0x34')]:_0x3c2a9b[_0x1939('0x2f')];if(_0xec77f8[_0x1939('0x31')]['includeAll']){_0x4138eb[_0x1939('0x46')]=[{'all':!![]}];}_0x4138eb=_[_0x1939('0x3e')]({},_0x4138eb,_0xec77f8[_0x1939('0x40')]);return db['MailMessage'][_0x1939('0x47')](_0x4138eb)[_0x1939('0x27')](handleEntityNotFound(_0x4de783,null))['then'](respondWithResult(_0x4de783,null))[_0x1939('0x1d')](handleError(_0x4de783,null));};exports['update']=function(_0xce74c5,_0x3944de){if(_0xce74c5[_0x1939('0x48')]['id']){delete _0xce74c5['body']['id'];}return db[_0x1939('0x2c')][_0x1939('0x47')]({'where':{'id':_0xce74c5[_0x1939('0x44')]['id']}})[_0x1939('0x27')](handleEntityNotFound(_0x3944de,null))[_0x1939('0x27')](saveUpdates(_0xce74c5[_0x1939('0x48')],null))['then'](respondWithResult(_0x3944de,null))[_0x1939('0x1d')](handleError(_0x3944de,null));};exports[_0x1939('0x49')]=function(_0xe56522,_0x21964e){return db[_0x1939('0x2c')][_0x1939('0x47')]({'where':{'id':_0xe56522['params']['id']}})[_0x1939('0x27')](handleEntityNotFound(_0x21964e,null))['then'](removeEntity(_0x21964e,null))[_0x1939('0x1d')](handleError(_0x21964e,null));};exports['describe']=function(_0x5d7a31,_0x128a78){return db[_0x1939('0x2c')][_0x1939('0x4a')]()[_0x1939('0x27')](respondWithResult(_0x128a78,null))[_0x1939('0x1d')](handleError(_0x128a78,null));};exports[_0x1939('0x4b')]=function(_0x1bd262,_0x52f459){return db['MailMessage'][_0x1939('0x4b')](_0x1bd262[_0x1939('0x48')])['then'](function(_0xa38711){if(_0xa38711){if(_0xa38711[_0x1939('0x4c')]==='out'&&!_0xa38711[_0x1939('0x4d')]){var _0x346bb6,_0x40d357,_0x36449a;if(_0x1bd262[_0x1939('0x48')]['to']){_0x40d357=_0x1bd262[_0x1939('0x48')]['to'][_0x1939('0x4e')](',')[0x0];}return db[_0x1939('0x4f')][_0x1939('0x50')]({'where':{'id':_0xa38711['MailAccountId']},'include':[{'model':db[_0x1939('0x51')],'as':_0x1939('0x52'),'include':[{'model':db[_0x1939('0x53')],'as':'Contacts','where':{'email':_0x40d357},'limit':0x1,'order':[[_0x1939('0x54'),_0x1939('0x55')]]}]},{'model':db[_0x1939('0x56')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x1939('0x57')],'as':_0x1939('0x57'),'raw':!![]}]}]})[_0x1939('0x27')](function(_0x4fa654){_0x346bb6=_0x4fa654;if(!_0x346bb6||!_0x346bb6[_0x1939('0x58')])return;var _0x4b735a=_0x346bb6[_0x1939('0x59')]();if(_0x1bd262[_0x1939('0x48')][_0x1939('0x5a')]&&_0x1bd262[_0x1939('0x48')]['attachments'][_0x1939('0x37')]){for(var _0x1c433d=0x0;_0x1c433d<_0x1bd262[_0x1939('0x48')][_0x1939('0x5a')][_0x1939('0x37')];_0x1c433d+=0x1){_0x1bd262[_0x1939('0x48')]['attachments'][_0x1c433d]={'filename':_0x1bd262[_0x1939('0x48')][_0x1939('0x5a')][_0x1c433d][_0x1939('0x2b')],'path':path[_0x1939('0x5b')](config[_0x1939('0x5c')],_0x1939('0x5d'),_0x1bd262[_0x1939('0x48')]['attachments'][_0x1c433d]['basename'])};}}_0x36449a={'account':_0x4b735a,'message':_0x1bd262[_0x1939('0x48')]};return;})['then'](function(){if(_0x346bb6[_0x1939('0x52')]){if(_0x346bb6['List'][_0x1939('0x5e')][_0x1939('0x37')]){return _0x346bb6['List'][_0x1939('0x5e')][0x0];}else{return db[_0x1939('0x53')][_0x1939('0x4b')](_['defaults'](_0x1bd262[_0x1939('0x48')],{'firstName':_0x1bd262[_0x1939('0x48')]['to'],'email':_0x1bd262[_0x1939('0x48')]['to'],'phone':_0x1bd262[_0x1939('0x48')]['to'],'ListId':_0x346bb6[_0x1939('0x5f')]}));}}else{throw new Error(_0x1939('0x60'));}})[_0x1939('0x27')](function(){if(_0x36449a){return respondWithRpcPromise(_0x1939('0x61'),_0x1939('0x62'),_0x36449a,client9003)['then'](function(_0x2bd89b){return _0xa38711[_0x1939('0x26')]({'read':!![],'messageId':_0x2bd89b[_0x1939('0x63')],'sentAt':moment()[_0x1939('0x64')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x1b965f){logger['error']('%s',JSON[_0x1939('0x19')](_0x1b965f));return _0xa38711;});}return _0xa38711;});}return _0xa38711;}})['then'](respondWithResult(_0x52f459,0xc9))[_0x1939('0x1d')](handleError(_0x52f459,null));};exports[_0x1939('0x65')]=function(_0x2e6310,_0x2eae4f){var _0x566446={'agent':{},'channel':_0x1939('0x66')};if(_0x2e6310['body']['id']){delete _0x2e6310[_0x1939('0x48')]['id'];}_0x2e6310[_0x1939('0x48')][_0x1939('0x67')]=!![];_0x2e6310['body'][_0x1939('0x68')]=moment()[_0x1939('0x64')]('YYYY-MM-DD\x20HH:mm:ss');_0x2e6310['body'][_0x1939('0x69')]=_0x2e6310[_0x1939('0x48')]['UserId']||_0x2e6310[_0x1939('0x6a')]['id'];_0x566446['agent']['id']=_0x2e6310['body']['UserId'];return db[_0x1939('0x2c')]['find']({'where':{'id':_0x2e6310['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2eae4f,null))['then'](saveUpdates(_0x2e6310[_0x1939('0x48')],null))[_0x1939('0x27')](function(_0x194140){if(_0x194140){_0x566446['message']=_0x194140[_0x1939('0x6b')]({'plain':!![]});return db[_0x1939('0x6c')]['find']({'where':{'id':_0x194140[_0x1939('0x6d')]}});}return null;})['then'](handleEntityNotFound(_0x2eae4f,null))['then'](function(_0x150634){if(_0x150634){return _0x150634[_0x1939('0x26')]({'UserId':_0x2e6310['body'][_0x1939('0x69')],'read1stAt':_[_0x1939('0x6e')](_0x150634['read1stAt'])?moment()[_0x1939('0x64')](_0x1939('0x6f')):undefined});}return null;})[_0x1939('0x27')](function(_0x5780f5){if(_0x5780f5){_0x566446[_0x1939('0x70')]=_0x5780f5[_0x1939('0x6b')]({'plain':!![]});interaction_log['info'](_0x1939('0x71'),_0x2e6310['user']['id'],_0x2e6310['user']['name'],_0x2e6310[_0x1939('0x6a')][_0x1939('0x72')],_0x566446[_0x1939('0x70')]['id'],_0x2e6310[_0x1939('0x48')]?JSON['stringify'](_0x2e6310[_0x1939('0x48')]):'null');return respondWithRpcPromise(_0x1939('0x73'),'acceptMessage',_0x566446);}return null;})[_0x1939('0x27')](function(_0x4cb516){var _0x1c14b9=_0x1939('0x74')+_0x4cb516[_0x1939('0x1b')][_0x1939('0x75')];return db['sequelize']['query'](_0x1c14b9,{'type':db[_0x1939('0x76')][_0x1939('0x77')]['SELECT'],'raw':!![]})['then'](function(_0x14c9f6){return _0x14c9f6;});})['then'](function(_0x31c92b){if(_0x31c92b){_0x566446[_0x1939('0x1b')][_0x1939('0x78')]=_0x31c92b[0x0];if(!_0x2e6310[_0x1939('0x48')]['UserId'])return;return db[_0x1939('0x79')][_0x1939('0x47')]({'where':{'id':_0x2e6310[_0x1939('0x48')]['UserId'],'role':_0x1939('0x7a')},'attributes':['id',_0x1939('0x2b'),_0x1939('0x7b'),'email',_0x1939('0x7c')],'raw':!![]});}return null;})['then'](function(_0x146d34){if(!_0x146d34)return null;_0x566446[_0x1939('0x1b')][_0x1939('0x7a')]=_0x146d34;return _0x566446;})[_0x1939('0x27')](function(_0x38539d){if(_0x38539d){if(_0x2e6310[_0x1939('0x48')]['manual']){_0x566446[_0x1939('0x1b')][_0x1939('0x7d')]=util[_0x1939('0x64')](_0x1939('0x7e'),_0x2e6310[_0x1939('0x6a')][_0x1939('0x2b')]);_0x566446[_0x1939('0x1b')]['channel']=_0x566446[_0x1939('0x7f')];_0x566446[_0x1939('0x1b')][_0x1939('0x80')]=_0x566446[_0x1939('0x7f')];_0x566446[_0x1939('0x1b')]['event']=_0x1939('0x65');_0x566446[_0x1939('0x1b')]['body']=htmlToText['fromString'](_0x566446[_0x1939('0x1b')][_0x1939('0x48')]);return respondWithRpcPromise('EventManager',_0x1939('0x81'),{'event':_0x1939('0x82'),'message':_0x566446[_0x1939('0x1b')]},client9002)['then'](function(){return _0x566446;});}return _0x566446;}return null;})[_0x1939('0x27')](respondWithResult(_0x2eae4f,null))[_0x1939('0x1d')](handleError(_0x2eae4f,null));};exports[_0x1939('0x83')]=function(_0x429182,_0x550a99){var _0x12d20f={'agent':{},'channel':_0x1939('0x66')};if(_0x429182[_0x1939('0x48')]['id']){delete _0x429182['body']['id'];}_0x429182[_0x1939('0x48')][_0x1939('0x69')]=_0x429182['body']['UserId']||_0x429182[_0x1939('0x6a')]['id'];_0x12d20f['agent']['id']=_0x429182[_0x1939('0x48')]['UserId'];return db[_0x1939('0x2c')][_0x1939('0x47')]({'where':{'id':_0x429182[_0x1939('0x44')]['id'],'UserId':null}})[_0x1939('0x27')](handleEntityNotFound(_0x550a99,null))[_0x1939('0x27')](function(_0x33458b){if(_0x33458b){_0x12d20f[_0x1939('0x1b')]=_0x33458b[_0x1939('0x6b')]({'plain':!![]});return db[_0x1939('0x6c')][_0x1939('0x47')]({'where':{'id':_0x33458b[_0x1939('0x6d')]}});}return null;})['then'](handleEntityNotFound(_0x550a99,null))[_0x1939('0x27')](function(_0x27eee9){if(_0x27eee9){_0x12d20f[_0x1939('0x70')]=_0x27eee9[_0x1939('0x6b')]({'plain':!![]});interaction_log[_0x1939('0x14')](_0x1939('0x84'),_0x429182[_0x1939('0x6a')]['id'],_0x429182[_0x1939('0x6a')][_0x1939('0x2b')],_0x429182['user'][_0x1939('0x72')],_0x12d20f[_0x1939('0x70')]['id'],_0x429182[_0x1939('0x48')]?JSON[_0x1939('0x19')](_0x429182['body']):_0x1939('0x85'));return respondWithRpcPromise(_0x1939('0x86'),_0x1939('0x87'),_0x12d20f);}return null;})[_0x1939('0x27')](function(_0x45f7af){var _0x335ab6='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x45f7af[_0x1939('0x1b')][_0x1939('0x75')];return db[_0x1939('0x88')][_0x1939('0x31')](_0x335ab6,{'type':db[_0x1939('0x76')][_0x1939('0x77')][_0x1939('0x89')],'raw':!![]})[_0x1939('0x27')](function(_0x164d37){return _0x164d37;});})['then'](function(_0x3f9ce1){if(_0x3f9ce1){_0x12d20f[_0x1939('0x1b')][_0x1939('0x78')]=_0x3f9ce1[0x0];if(!_0x429182[_0x1939('0x48')][_0x1939('0x69')])return;return db['User']['find']({'where':{'id':_0x429182[_0x1939('0x48')][_0x1939('0x69')],'role':_0x1939('0x7a')},'attributes':['id',_0x1939('0x2b'),_0x1939('0x7b'),_0x1939('0x8a'),_0x1939('0x7c')],'raw':!![]});}return null;})[_0x1939('0x27')](function(_0x3eae44){if(!_0x3eae44)return null;_0x12d20f[_0x1939('0x1b')]['agent']=_0x3eae44;return _0x12d20f;})[_0x1939('0x27')](function(_0xb7b586){if(_0xb7b586){_0xb7b586[_0x1939('0x1b')][_0x1939('0x7d')]=util[_0x1939('0x64')](_0x1939('0x7e'),_0x429182[_0x1939('0x6a')][_0x1939('0x2b')]);_0xb7b586[_0x1939('0x1b')]['channel']=_0x12d20f[_0x1939('0x7f')];_0xb7b586['message'][_0x1939('0x80')]=_0x12d20f['channel'];_0xb7b586[_0x1939('0x1b')][_0x1939('0x8b')]=_0x1939('0x83');_0xb7b586[_0x1939('0x1b')][_0x1939('0x48')]=htmlToText[_0x1939('0x8c')](_0x12d20f[_0x1939('0x1b')][_0x1939('0x48')]);respondWithRpcPromise(_0x1939('0x81'),_0x1939('0x81'),{'event':'rejectmessage','message':_0xb7b586[_0x1939('0x1b')]},client9002);return _0x12d20f;}return null;})['then'](respondWithResult(_0x550a99,null))[_0x1939('0x1d')](handleError(_0x550a99,null));};exports[_0x1939('0x8d')]=function(_0x34d2ba,_0x482888){var _0x500ddc=moment()[_0x1939('0x8e')]()[_0x1939('0x8f')]();var _0x1e5008=path[_0x1939('0x5b')](config[_0x1939('0x5c')],'server',_0x1939('0x90'),_0x1939('0x91'));var _0x4be3a8=path[_0x1939('0x5b')](config['root'],_0x1939('0x92'),_0x1939('0x90'),_0x1939('0x5a'));var _0x4e0065=util[_0x1939('0x64')]('message-%s.eml',_0x500ddc);return db[_0x1939('0x2c')][_0x1939('0x47')]({'where':{'id':_0x34d2ba[_0x1939('0x44')]['id']},'attributes':['id',_0x1939('0x48'),'from','to','cc',_0x1939('0x93'),_0x1939('0x94'),_0x1939('0x95')],'include':_0x34d2ba[_0x1939('0x31')][_0x1939('0x5a')]?[{'model':db['Attachment'],'as':'Attachments'}]:undefined})[_0x1939('0x27')](handleEntityNotFound(_0x482888,null))[_0x1939('0x27')](function(_0x2e09bc){if(_0x2e09bc){var _0x43086d=_0x2e09bc;var _0x2743cc={'from':_0x43086d[_0x1939('0x96')],'to':_0x43086d['to'],'subject':_0x43086d[_0x1939('0x94')],'html':htmlEntities[_0x1939('0x97')](_0x43086d[_0x1939('0x48')]),'headers':{'Date':moment(_0x43086d[_0x1939('0x95')])[_0x1939('0x64')](_0x1939('0x98'))},'attachments':[]};if(_0x2e09bc['cc']){_0x2743cc[_0x1939('0x99')]['Cc']=_0x2e09bc['cc'];}if(_0x2e09bc[_0x1939('0x93')]){_0x2743cc[_0x1939('0x99')][_0x1939('0x9a')]=_0x2e09bc[_0x1939('0x93')];}return new BPromise(function(_0x1ec219,_0x4bf2b0){if(_0x2e09bc['Attachments']){for(var _0xc4cec0=0x0;_0xc4cec0<_0x2e09bc[_0x1939('0x9b')][_0x1939('0x37')];_0xc4cec0++){var _0x241230=_0x2e09bc[_0x1939('0x9b')][_0xc4cec0];var _0x436c5f=path[_0x1939('0x5b')](_0x4be3a8,_0x241230[_0x1939('0x9c')]);if(fs['existsSync'](_0x436c5f)){_0x2743cc[_0x1939('0x5a')][_0x1939('0x9d')]({'name':_0x241230[_0x1939('0x2b')],'contentType':_0x241230[_0x1939('0x2e')],'data':fs[_0x1939('0x9e')](_0x436c5f)});}}}emlformat[_0x1939('0x9f')](_0x2743cc,function(_0x4c757f,_0x69eb08){if(_0x4c757f)return _0x4bf2b0(_0x4c757f);fs[_0x1939('0xa0')](path[_0x1939('0x5b')](_0x1e5008,_0x4e0065),_0x69eb08);return _0x1ec219(_0x69eb08);});});}})[_0x1939('0x27')](function(_0x2cd0a6){if(_0x2cd0a6){return _0x482888['download'](path[_0x1939('0x5b')](_0x1e5008,_0x4e0065),_0x4e0065,function(_0x20c530){if(!_0x20c530)fs[_0x1939('0xa1')](path['join'](_0x1e5008,_0x4e0065));});}})[_0x1939('0x1d')](handleError(_0x482888,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index e5363a3..5e5a0dc 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 _0x4f48=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage'];(function(_0x1177d5,_0x22b649){var _0xc3ddc2=function(_0x43ff95){while(--_0x43ff95){_0x1177d5['push'](_0x1177d5['shift']());}};_0xc3ddc2(++_0x22b649);}(_0x4f48,0x9e));var _0x84f4=function(_0x4eacc6,_0x2e8373){_0x4eacc6=_0x4eacc6-0x0;var _0x41deb6=_0x4f48[_0x4eacc6];return _0x41deb6;};'use strict';var EventEmitter=require(_0x84f4('0x0'));var MailMessage=require(_0x84f4('0x1'))['db'][_0x84f4('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x464075){return function(_0x2ec552,_0x42f64f,_0x5d711f){MailMessageEvents[_0x84f4('0x3')](_0x464075+':'+_0x2ec552['id'],_0x2ec552);MailMessageEvents[_0x84f4('0x3')](_0x464075,_0x2ec552);_0x5d711f(null);};}for(var e in events){if(events[_0x84f4('0x4')](e)){var event=events[e];MailMessage[_0x84f4('0x5')](e,emitEvent(event));}}module[_0x84f4('0x6')]=MailMessageEvents; \ No newline at end of file +var _0x39b4=['exports','MailMessage','setMaxListeners','save','remove','emit','hook'];(function(_0xc31be,_0x212ee6){var _0x409550=function(_0x2a0bb8){while(--_0x2a0bb8){_0xc31be['push'](_0xc31be['shift']());}};_0x409550(++_0x212ee6);}(_0x39b4,0xa2));var _0x439b=function(_0x2365dd,_0x5a04ad){_0x2365dd=_0x2365dd-0x0;var _0x247a1d=_0x39b4[_0x2365dd];return _0x247a1d;};'use strict';var EventEmitter=require('events');var MailMessage=require('../../mysqldb')['db'][_0x439b('0x0')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x439b('0x1')](0x0);var events={'afterCreate':_0x439b('0x2'),'afterUpdate':'update','afterDestroy':_0x439b('0x3')};function emitEvent(_0x4ee5cf){return function(_0x2b1699,_0x42e285,_0x2c8d01){MailMessageEvents[_0x439b('0x4')](_0x4ee5cf+':'+_0x2b1699['id'],_0x2b1699);MailMessageEvents['emit'](_0x4ee5cf,_0x2b1699);_0x2c8d01(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x439b('0x5')](e,emitEvent(event));}}module[_0x439b('0x6')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 664e08c..6ab5ab6 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 _0x37e8=['path','rimraf','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','fti_mail_messages','subject','FULLTEXT','body','plainBody','fromString','models','get','direction','secret','UserId','MailInteraction','findOne','MailInteractionId','then','update','toLowerCase','error','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','html-to-text'];(function(_0x2e1af3,_0x2a077b){var _0x4150cd=function(_0x1e08f3){while(--_0x1e08f3){_0x2e1af3['push'](_0x2e1af3['shift']());}};_0x4150cd(++_0x2a077b);}(_0x37e8,0x10a));var _0x837e=function(_0x4141ac,_0x3ba6b5){_0x4141ac=_0x4141ac-0x0;var _0x2bd174=_0x37e8[_0x4141ac];return _0x2bd174;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x837e('0x0'))(_0x837e('0x1'));var moment=require(_0x837e('0x2'));var BPromise=require(_0x837e('0x3'));var rp=require(_0x837e('0x4'));var htmlToText=require(_0x837e('0x5'));var fs=require('fs');var path=require(_0x837e('0x6'));var rimraf=require(_0x837e('0x7'));var config=require(_0x837e('0x8'));var attributes=require(_0x837e('0x9'));module[_0x837e('0xa')]=function(_0x454c8d,_0x2e09d4){return _0x454c8d['define'](_0x837e('0xb'),attributes,{'tableName':_0x837e('0xc'),'paranoid':![],'indexes':[{'name':_0x837e('0xd'),'fields':['messageId']},{'name':_0x837e('0xe'),'fields':['plainBody',_0x837e('0xf')],'type':_0x837e('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xf2aa43,_0x181eea,_0x3e7ba1){if(_0xf2aa43[_0x837e('0x11')]){_0xf2aa43[_0x837e('0x12')]=htmlToText[_0x837e('0x13')](_0xf2aa43[_0x837e('0x11')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3e7ba1(null,_0x181eea);},'afterCreate':function(_0x5ee2c6,_0x2e779b,_0x5eadeb){var _0x29a176=_0x454c8d[_0x837e('0x14')];var _0x59244b=_0x5ee2c6[_0x837e('0x15')]({'plain':!![]});if(_0x59244b[_0x837e('0x16')]['toLowerCase']()==='in'||_0x59244b[_0x837e('0x16')]['toLowerCase']()==='out'&&!_0x59244b[_0x837e('0x17')]&&!_['isNil'](_0x59244b[_0x837e('0x18')])){_0x29a176[_0x837e('0x19')][_0x837e('0x1a')]({'where':{'id':_0x59244b[_0x837e('0x1b')]}})[_0x837e('0x1c')](function(_0x1c713f){if(_0x1c713f){_0x1c713f[_0x837e('0x1d')]({'lastMsgAt':_0x59244b['createdAt'],'lastMsgDirection':_0x59244b[_0x837e('0x16')][_0x837e('0x1e')]()});}})['catch'](function(_0xb56c04){console[_0x837e('0x1f')](_0xb56c04);});}_0x5eadeb();}},'charset':_0x837e('0x20'),'collate':_0x837e('0x21')});}; \ No newline at end of file +var _0x7e65=['models','get','toLowerCase','direction','out','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','html-to-text','path','rimraf','./mailMessage.attributes','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString'];(function(_0x2b869b,_0x81ce74){var _0x494958=function(_0x240fd9){while(--_0x240fd9){_0x2b869b['push'](_0x2b869b['shift']());}};_0x494958(++_0x81ce74);}(_0x7e65,0xff));var _0x57e6=function(_0x10e983,_0x2f4eda){_0x10e983=_0x10e983-0x0;var _0x324138=_0x7e65[_0x10e983];return _0x324138;};'use strict';var _=require(_0x57e6('0x0'));var util=require(_0x57e6('0x1'));var logger=require(_0x57e6('0x2'))(_0x57e6('0x3'));var moment=require('moment');var BPromise=require(_0x57e6('0x4'));var rp=require('request-promise');var htmlToText=require(_0x57e6('0x5'));var fs=require('fs');var path=require(_0x57e6('0x6'));var rimraf=require(_0x57e6('0x7'));var config=require('../../config/environment');var attributes=require(_0x57e6('0x8'));module['exports']=function(_0x58852a,_0x12997f){return _0x58852a['define']('MailMessage',attributes,{'tableName':_0x57e6('0x9'),'paranoid':![],'indexes':[{'name':_0x57e6('0xa'),'fields':[_0x57e6('0xa')]},{'name':_0x57e6('0xb'),'fields':[_0x57e6('0xc'),_0x57e6('0xd')],'type':_0x57e6('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2dfbf3,_0xa47d08,_0x5945f9){if(_0x2dfbf3[_0x57e6('0xf')]){_0x2dfbf3['plainBody']=htmlToText[_0x57e6('0x10')](_0x2dfbf3[_0x57e6('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5945f9(null,_0xa47d08);},'afterCreate':function(_0x35e308,_0xf9d832,_0x2ed4f4){var _0x366e72=_0x58852a[_0x57e6('0x11')];var _0x43fad1=_0x35e308[_0x57e6('0x12')]({'plain':!![]});if(_0x43fad1['direction'][_0x57e6('0x13')]()==='in'||_0x43fad1[_0x57e6('0x14')][_0x57e6('0x13')]()===_0x57e6('0x15')&&!_0x43fad1['secret']&&!_[_0x57e6('0x16')](_0x43fad1[_0x57e6('0x17')])){_0x366e72[_0x57e6('0x18')][_0x57e6('0x19')]({'where':{'id':_0x43fad1[_0x57e6('0x1a')]}})[_0x57e6('0x1b')](function(_0xa09e1f){if(_0xa09e1f){_0xa09e1f[_0x57e6('0x1c')]({'lastMsgAt':_0x43fad1[_0x57e6('0x1d')],'lastMsgDirection':_0x43fad1[_0x57e6('0x14')][_0x57e6('0x13')]()});}})[_0x57e6('0x1e')](function(_0x4098c5){console[_0x57e6('0x1f')](_0x4098c5);});}_0x2ed4f4();}},'charset':_0x57e6('0x20'),'collate':_0x57e6('0x21')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 5e37d6d..abce51e 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 _0xea28=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','CreateMailMessage','MailMessage','body','options','raw','stringify','lodash'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0xea28,0x13a));var _0x8ea2=function(_0x3c2a50,_0xc728e7){_0x3c2a50=_0x3c2a50-0x0;var _0x4a0e7f=_0xea28[_0x3c2a50];return _0x4a0e7f;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var moment=require(_0x8ea2('0x2'));var BPromise=require(_0x8ea2('0x3'));var rs=require(_0x8ea2('0x4'));var fs=require('fs');var Redis=require(_0x8ea2('0x5'));var db=require(_0x8ea2('0x6'))['db'];var utils=require(_0x8ea2('0x7'));var logger=require('../../config/logger')(_0x8ea2('0x8'));var config=require(_0x8ea2('0x9'));var jayson=require(_0x8ea2('0xa'));var client=jayson['client'][_0x8ea2('0xb')]({'port':0x232a});config[_0x8ea2('0xc')]=_[_0x8ea2('0xd')](config[_0x8ea2('0xc')],{'host':_0x8ea2('0xe'),'port':0x18eb});var socket=require(_0x8ea2('0xf'))(new Redis(config[_0x8ea2('0xc')]));require(_0x8ea2('0x10'))[_0x8ea2('0x11')](socket);function respondWithRpcPromise(_0x3000f9,_0x3d0b35,_0x21ae3d){return new BPromise(function(_0x500b82,_0x4da3b1){return client[_0x8ea2('0x12')](_0x3000f9,_0x21ae3d)[_0x8ea2('0x13')](function(_0x374973){logger['info'](_0x8ea2('0x14'),_0x3d0b35,_0x8ea2('0x15'));logger[_0x8ea2('0x16')](_0x8ea2('0x17'),_0x3d0b35,_0x8ea2('0x15'),JSON['stringify'](_0x374973));if(_0x374973[_0x8ea2('0x18')]){if(_0x374973['error']['code']===0x1f4){logger[_0x8ea2('0x18')](_0x8ea2('0x14'),_0x3d0b35,_0x374973[_0x8ea2('0x18')][_0x8ea2('0x19')]);return _0x4da3b1(_0x374973[_0x8ea2('0x18')][_0x8ea2('0x19')]);}logger[_0x8ea2('0x18')](_0x8ea2('0x14'),_0x3d0b35,_0x374973[_0x8ea2('0x18')][_0x8ea2('0x19')]);return _0x500b82(_0x374973[_0x8ea2('0x18')][_0x8ea2('0x19')]);}else{logger[_0x8ea2('0x1a')](_0x8ea2('0x14'),_0x3d0b35,_0x8ea2('0x15'));_0x500b82(_0x374973[_0x8ea2('0x1b')][_0x8ea2('0x19')]);}})[_0x8ea2('0x1c')](function(_0x1068b6){logger[_0x8ea2('0x18')](_0x8ea2('0x14'),_0x3d0b35,_0x1068b6);_0x4da3b1(_0x1068b6);});});}exports[_0x8ea2('0x1d')]=function(_0x52b58c){var _0x4be7c9=this;return new Promise(function(_0x3790e9,_0x248c18){return db[_0x8ea2('0x1e')]['create'](_0x52b58c[_0x8ea2('0x1f')],{'raw':_0x52b58c[_0x8ea2('0x20')]?_0x52b58c['options'][_0x8ea2('0x21')]===undefined?!![]:![]:!![]})[_0x8ea2('0x13')](function(_0x37229a){logger[_0x8ea2('0x1a')](_0x8ea2('0x1d'),_0x52b58c);logger[_0x8ea2('0x16')](_0x8ea2('0x1d'),_0x52b58c,JSON[_0x8ea2('0x22')](_0x37229a));_0x3790e9(_0x37229a);})[_0x8ea2('0x1c')](function(_0x4d5030){logger[_0x8ea2('0x18')]('CreateMailMessage',_0x4d5030[_0x8ea2('0x19')],_0x52b58c);_0x248c18(_0x4be7c9[_0x8ea2('0x18')](0x1f4,_0x4d5030[_0x8ea2('0x19')]));});});}; \ No newline at end of file +var _0xcf2f=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','error','MailMessage,\x20%s,\x20%s','message','info','result','catch','CreateMailMessage','MailMessage','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x52e751,_0x1334f6){var _0x428b75=function(_0x5e3fb1){while(--_0x5e3fb1){_0x52e751['push'](_0x52e751['shift']());}};_0x428b75(++_0x1334f6);}(_0xcf2f,0xa7));var _0xfcf2=function(_0xa5c6f7,_0x281e3f){_0xa5c6f7=_0xa5c6f7-0x0;var _0x25aa41=_0xcf2f[_0xa5c6f7];return _0x25aa41;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var moment=require(_0xfcf2('0x2'));var BPromise=require(_0xfcf2('0x3'));var rs=require(_0xfcf2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfcf2('0x5'))['db'];var utils=require(_0xfcf2('0x6'));var logger=require(_0xfcf2('0x7'))(_0xfcf2('0x8'));var config=require(_0xfcf2('0x9'));var jayson=require(_0xfcf2('0xa'));var client=jayson[_0xfcf2('0xb')][_0xfcf2('0xc')]({'port':0x232a});config[_0xfcf2('0xd')]=_[_0xfcf2('0xe')](config[_0xfcf2('0xd')],{'host':_0xfcf2('0xf'),'port':0x18eb});var socket=require(_0xfcf2('0x10'))(new Redis(config[_0xfcf2('0xd')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x4d6fc9,_0x91b579,_0x2a9ecb){return new BPromise(function(_0x481e38,_0xf38eab){return client[_0xfcf2('0x11')](_0x4d6fc9,_0x2a9ecb)[_0xfcf2('0x12')](function(_0x29e649){logger['info']('MailMessage,\x20%s,\x20%s',_0x91b579,_0xfcf2('0x13'));logger[_0xfcf2('0x14')](_0xfcf2('0x15'),_0x91b579,_0xfcf2('0x13'),JSON['stringify'](_0x29e649));if(_0x29e649[_0xfcf2('0x16')]){if(_0x29e649['error']['code']===0x1f4){logger['error'](_0xfcf2('0x17'),_0x91b579,_0x29e649['error'][_0xfcf2('0x18')]);return _0xf38eab(_0x29e649[_0xfcf2('0x16')][_0xfcf2('0x18')]);}logger[_0xfcf2('0x16')](_0xfcf2('0x17'),_0x91b579,_0x29e649[_0xfcf2('0x16')][_0xfcf2('0x18')]);return _0x481e38(_0x29e649['error'][_0xfcf2('0x18')]);}else{logger[_0xfcf2('0x19')](_0xfcf2('0x17'),_0x91b579,'request\x20sent');_0x481e38(_0x29e649[_0xfcf2('0x1a')][_0xfcf2('0x18')]);}})[_0xfcf2('0x1b')](function(_0x1cc67e){logger[_0xfcf2('0x16')]('MailMessage,\x20%s,\x20%s',_0x91b579,_0x1cc67e);_0xf38eab(_0x1cc67e);});});}exports[_0xfcf2('0x1c')]=function(_0x11c34f){var _0x4939e4=this;return new Promise(function(_0x9a1d9f,_0x23c079){return db[_0xfcf2('0x1d')][_0xfcf2('0x1e')](_0x11c34f[_0xfcf2('0x1f')],{'raw':_0x11c34f[_0xfcf2('0x20')]?_0x11c34f[_0xfcf2('0x20')][_0xfcf2('0x21')]===undefined?!![]:![]:!![]})[_0xfcf2('0x12')](function(_0x5afab5){logger[_0xfcf2('0x19')](_0xfcf2('0x1c'),_0x11c34f);logger[_0xfcf2('0x14')]('CreateMailMessage',_0x11c34f,JSON[_0xfcf2('0x22')](_0x5afab5));_0x9a1d9f(_0x5afab5);})[_0xfcf2('0x1b')](function(_0x5ddea1){logger[_0xfcf2('0x16')](_0xfcf2('0x1c'),_0x5ddea1['message'],_0x11c34f);_0x23c079(_0x4939e4[_0xfcf2('0x16')](0x1f4,_0x5ddea1[_0xfcf2('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index a9fe0bf..2be8bbd 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 _0x9f3a=['save','remove','update','removeListener','register','length'];(function(_0x39eba2,_0x5a5ad8){var _0x20b9ed=function(_0x5b86e1){while(--_0x5b86e1){_0x39eba2['push'](_0x39eba2['shift']());}};_0x20b9ed(++_0x5a5ad8);}(_0x9f3a,0xcc));var _0xa9f3=function(_0x2cfb48,_0x24b83b){_0x2cfb48=_0x2cfb48-0x0;var _0xc4594f=_0x9f3a[_0x2cfb48];return _0xc4594f;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0xa9f3('0x0'),_0xa9f3('0x1'),_0xa9f3('0x2')];function createListener(_0xced7a2,_0x507760){return function(_0x4858e9){_0x507760['emit'](_0xced7a2,_0x4858e9);};}function removeListener(_0x53c3cf,_0x4f8ca0){return function(){MailMessageEvents[_0xa9f3('0x3')](_0x53c3cf,_0x4f8ca0);};}exports[_0xa9f3('0x4')]=function(_0xf60fba){for(var _0x369e43=0x0,_0x36f757=events[_0xa9f3('0x5')];_0x369e43<_0x36f757;_0x369e43++){var _0x5c772b=events[_0x369e43];var _0x51e8a6=createListener('mailMessage:'+_0x5c772b,_0xf60fba);MailMessageEvents['on'](_0x5c772b,_0x51e8a6);}}; \ No newline at end of file +var _0x1502=['emit','removeListener','length','./mailMessage.events','save','remove','update'];(function(_0x1b64dd,_0x2cf769){var _0xeb464c=function(_0x38272c){while(--_0x38272c){_0x1b64dd['push'](_0x1b64dd['shift']());}};_0xeb464c(++_0x2cf769);}(_0x1502,0x1c3));var _0x2150=function(_0x5a1ed5,_0x537d93){_0x5a1ed5=_0x5a1ed5-0x0;var _0x17b727=_0x1502[_0x5a1ed5];return _0x17b727;};'use strict';var MailMessageEvents=require(_0x2150('0x0'));var events=[_0x2150('0x1'),_0x2150('0x2'),_0x2150('0x3')];function createListener(_0x2af2e1,_0x208af9){return function(_0x5901c5){_0x208af9[_0x2150('0x4')](_0x2af2e1,_0x5901c5);};}function removeListener(_0x36d4c1,_0x42536d){return function(){MailMessageEvents[_0x2150('0x5')](_0x36d4c1,_0x42536d);};}exports['register']=function(_0x2e34e9){for(var _0x38dbdf=0x0,_0x4fd1ed=events[_0x2150('0x6')];_0x38dbdf<_0x4fd1ed;_0x38dbdf++){var _0x23985a=events[_0x38dbdf];var _0x467a0d=createListener('mailMessage:'+_0x23985a,_0x2e34e9);MailMessageEvents['on'](_0x23985a,_0x467a0d);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 44543e3..67abfe3 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 _0x80ee=['index','/describe','isAuthenticated','/:id','getMembers','/:id/teams','/:id/users','post','create','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get'];(function(_0xd7f732,_0x1ba856){var _0x26fd49=function(_0x18fc7d){while(--_0x18fc7d){_0xd7f732['push'](_0xd7f732['shift']());}};_0x26fd49(++_0x1ba856);}(_0x80ee,0x13d));var _0xe80e=function(_0x2aaeac,_0x30bda5){_0x2aaeac=_0x2aaeac-0x0;var _0x757741=_0x80ee[_0x2aaeac];return _0x757741;};'use strict';var multer=require(_0xe80e('0x0'));var util=require(_0xe80e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe80e('0x2'));var router=express[_0xe80e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xe80e('0x4'));var interaction=require(_0xe80e('0x5'));var config=require('../../config/environment');var controller=require(_0xe80e('0x6'));router[_0xe80e('0x7')]('/',auth['isAuthenticated'](),controller[_0xe80e('0x8')]);router[_0xe80e('0x7')](_0xe80e('0x9'),auth[_0xe80e('0xa')](),controller['describe']);router[_0xe80e('0x7')](_0xe80e('0xb'),auth[_0xe80e('0xa')](),controller['show']);router[_0xe80e('0x7')]('/:id/members',auth[_0xe80e('0xa')](),controller[_0xe80e('0xc')]);router[_0xe80e('0x7')](_0xe80e('0xd'),auth[_0xe80e('0xa')](),controller['getTeams']);router[_0xe80e('0x7')](_0xe80e('0xe'),auth[_0xe80e('0xa')](),controller['getAgents']);router[_0xe80e('0xf')]('/',auth['isAuthenticated'](),controller[_0xe80e('0x10')]);router[_0xe80e('0xf')](_0xe80e('0xd'),auth[_0xe80e('0xa')](),controller[_0xe80e('0x11')]);router[_0xe80e('0xf')](_0xe80e('0xe'),auth[_0xe80e('0xa')](),controller[_0xe80e('0x12')]);router['put'](_0xe80e('0xb'),auth['isAuthenticated'](),controller[_0xe80e('0x13')]);router[_0xe80e('0x14')]('/:id',auth[_0xe80e('0xa')](),controller[_0xe80e('0x15')]);router['delete'](_0xe80e('0xd'),auth[_0xe80e('0xa')](),controller[_0xe80e('0x16')]);router['delete'](_0xe80e('0xe'),auth[_0xe80e('0xa')](),controller[_0xe80e('0x17')]);module[_0xe80e('0x18')]=router; \ No newline at end of file +var _0x90aa=['getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','multer','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/members'];(function(_0x2e5d19,_0x23cf52){var _0x27088c=function(_0x126ace){while(--_0x126ace){_0x2e5d19['push'](_0x2e5d19['shift']());}};_0x27088c(++_0x23cf52);}(_0x90aa,0x139));var _0xa90a=function(_0x5c8d28,_0xefa5f0){_0x5c8d28=_0x5c8d28-0x0;var _0xbd42e9=_0x90aa[_0x5c8d28];return _0xbd42e9;};'use strict';var multer=require(_0xa90a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa90a('0x1'));var router=express[_0xa90a('0x2')]();var fs_extra=require(_0xa90a('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa90a('0x4'));var config=require('../../config/environment');var controller=require('./mailQueue.controller');router[_0xa90a('0x5')]('/',auth[_0xa90a('0x6')](),controller[_0xa90a('0x7')]);router[_0xa90a('0x5')](_0xa90a('0x8'),auth[_0xa90a('0x6')](),controller[_0xa90a('0x9')]);router[_0xa90a('0x5')](_0xa90a('0xa'),auth[_0xa90a('0x6')](),controller['show']);router[_0xa90a('0x5')](_0xa90a('0xb'),auth[_0xa90a('0x6')](),controller[_0xa90a('0xc')]);router[_0xa90a('0x5')]('/:id/teams',auth[_0xa90a('0x6')](),controller[_0xa90a('0xd')]);router[_0xa90a('0x5')](_0xa90a('0xe'),auth[_0xa90a('0x6')](),controller[_0xa90a('0xf')]);router[_0xa90a('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa90a('0x10')](_0xa90a('0x11'),auth[_0xa90a('0x6')](),controller['addTeams']);router[_0xa90a('0x10')](_0xa90a('0xe'),auth[_0xa90a('0x6')](),controller[_0xa90a('0x12')]);router[_0xa90a('0x13')](_0xa90a('0xa'),auth[_0xa90a('0x6')](),controller[_0xa90a('0x14')]);router[_0xa90a('0x15')](_0xa90a('0xa'),auth[_0xa90a('0x6')](),controller[_0xa90a('0x16')]);router['delete'](_0xa90a('0x11'),auth[_0xa90a('0x6')](),controller[_0xa90a('0x17')]);router[_0xa90a('0x15')]('/:id/users',auth[_0xa90a('0x6')](),controller[_0xa90a('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 454d74d..6c12698 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 _0x3024=['exports','name','STRING','rrmemory','beepall','roundrobin'];(function(_0x445c98,_0x132bf7){var _0x2fe913=function(_0x32e864){while(--_0x32e864){_0x445c98['push'](_0x445c98['shift']());}};_0x2fe913(++_0x132bf7);}(_0x3024,0x198));var _0x4302=function(_0x1464c2,_0x5551d2){_0x1464c2=_0x1464c2-0x0;var _0x3bfb77=_0x3024[_0x1464c2];return _0x3bfb77;};'use strict';var Sequelize=require('sequelize');module[_0x4302('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x4302('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4302('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x4302('0x3'),_0x4302('0x4'),_0x4302('0x5'))}}; \ No newline at end of file +var _0x2ff0=['ENUM','rrmemory','beepall','roundrobin','sequelize','STRING'];(function(_0x1e85d5,_0x14081f){var _0x70301a=function(_0x588125){while(--_0x588125){_0x1e85d5['push'](_0x1e85d5['shift']());}};_0x70301a(++_0x14081f);}(_0x2ff0,0x1ea));var _0x02ff=function(_0x1519bf,_0x3ea7e4){_0x1519bf=_0x1519bf-0x0;var _0x4b9cc5=_0x2ff0[_0x1519bf];return _0x4b9cc5;};'use strict';var Sequelize=require(_0x02ff('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x02ff('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x02ff('0x2')](_0x02ff('0x3'),_0x02ff('0x4'),_0x02ff('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index f372958..62c6c83 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 _0x7cc4=['userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','register','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','send','index','map','MailQueue','key','query','keys','filters','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','length','MailQueueId','User','UserId','mailPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','ids','voicePause','interface','flatMap','Agents','sequelize','transaction','addTeams','findOrCreate','forEach','userMailQueue:save','removeTeams','select','field','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','union','compact','value','isEmpty','emit'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x7cc4,0x1a8));var _0x47cc=function(_0x4d67b8,_0x565134){_0x4d67b8=_0x4d67b8-0x0;var _0x55af3b=_0x7cc4[_0x4d67b8];return _0x55af3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x47cc('0x0'));var zipdir=require(_0x47cc('0x1'));var jsonpatch=require(_0x47cc('0x2'));var rp=require(_0x47cc('0x3'));var moment=require(_0x47cc('0x4'));var BPromise=require(_0x47cc('0x5'));var Mustache=require(_0x47cc('0x6'));var util=require('util');var path=require(_0x47cc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x47cc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x47cc('0x9'));var squel=require(_0x47cc('0xa'));var crypto=require(_0x47cc('0xb'));var jsforce=require(_0x47cc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x47cc('0xd'));var querystring=require(_0x47cc('0xe'));var Papa=require('papaparse');var Redis=require(_0x47cc('0xf'));var authService=require(_0x47cc('0x10'));var qs=require(_0x47cc('0x11'));var as=require(_0x47cc('0x12'));var hardwareService=require(_0x47cc('0x13'));var logger=require(_0x47cc('0x14'))(_0x47cc('0x15'));var utils=require(_0x47cc('0x16'));var config=require(_0x47cc('0x17'));var licenseUtil=require(_0x47cc('0x18'));var db=require('../../mysqldb')['db'];config[_0x47cc('0x19')]=_[_0x47cc('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x47cc('0x19')]));require('./mailQueue.socket')[_0x47cc('0x1b')](socket);function respondWithStatusCode(_0x4d2229,_0x2a4e8e){_0x2a4e8e=_0x2a4e8e||0xcc;return function(_0x10f843){if(_0x10f843){return _0x4d2229[_0x47cc('0x1c')](_0x2a4e8e);}return _0x4d2229['status'](_0x2a4e8e)[_0x47cc('0x1d')]();};}function respondWithResult(_0x58320b,_0x282a70){_0x282a70=_0x282a70||0xc8;return function(_0x26ff5b){if(_0x26ff5b){return _0x58320b[_0x47cc('0x1e')](_0x282a70)[_0x47cc('0x1f')](_0x26ff5b);}};}function respondWithFilteredResult(_0x5042ec,_0x34af0c){return function(_0x5eab65){if(_0x5eab65){var _0xc839d0=typeof _0x34af0c['offset']===_0x47cc('0x20')&&typeof _0x34af0c[_0x47cc('0x21')]===_0x47cc('0x20');var _0x1d81da=_0x5eab65[_0x47cc('0x22')];var _0x5aee09=_0xc839d0?0x0:_0x34af0c[_0x47cc('0x23')];var _0x10f4d1=_0xc839d0?_0x5eab65[_0x47cc('0x22')]:_0x34af0c[_0x47cc('0x23')]+_0x34af0c['limit'];var _0x5819bf;if(_0x10f4d1>=_0x1d81da){_0x10f4d1=_0x1d81da;_0x5819bf=0xc8;}else{_0x5819bf=0xce;}_0x5042ec[_0x47cc('0x1e')](_0x5819bf);return _0x5042ec[_0x47cc('0x24')](_0x47cc('0x25'),_0x5aee09+'-'+_0x10f4d1+'/'+_0x1d81da)[_0x47cc('0x1f')](_0x5eab65);}return null;};}function patchUpdates(_0x2753fe){return function(_0x56bb41){try{jsonpatch[_0x47cc('0x26')](_0x56bb41,_0x2753fe,!![]);}catch(_0x3355c1){return BPromise[_0x47cc('0x27')](_0x3355c1);}return _0x56bb41[_0x47cc('0x28')]();};}function saveUpdates(_0x25f4d9,_0x4eb4d6){return function(_0x3e8fc9){if(_0x3e8fc9){return _0x3e8fc9[_0x47cc('0x29')](_0x25f4d9)[_0x47cc('0x2a')](function(_0x2670de){return _0x2670de;});}return null;};}function removeEntity(_0x4bf3f1,_0x577e70){return function(_0x181985){if(_0x181985){return _0x181985[_0x47cc('0x2b')]()['then'](function(){var _0x80bf23=_0x181985[_0x47cc('0x2c')]({'plain':!![]});var _0x46288b='MailQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x46288b,'resourceId':_0x80bf23['id']}})[_0x47cc('0x2a')](function(){return _0x181985;});})[_0x47cc('0x2a')](function(){_0x4bf3f1['status'](0xcc)[_0x47cc('0x1d')]();});}};}function handleEntityNotFound(_0xaa5846,_0x3b0168){return function(_0x1c287b){if(!_0x1c287b){_0xaa5846['sendStatus'](0x194);}return _0x1c287b;};}function handleError(_0x282368,_0x145f83){_0x145f83=_0x145f83||0x1f4;return function(_0x2f91db){logger[_0x47cc('0x2d')](_0x2f91db[_0x47cc('0x2e')]);if(_0x2f91db[_0x47cc('0x2f')]){delete _0x2f91db[_0x47cc('0x2f')];}_0x282368['status'](_0x145f83)[_0x47cc('0x30')](_0x2f91db);};}exports[_0x47cc('0x31')]=function(_0x914811,_0x27f16c){var _0x476103={},_0x5ae153={},_0x3adbda={'count':0x0,'rows':[]};var _0x141fad=_[_0x47cc('0x32')](db[_0x47cc('0x33')]['rawAttributes'],function(_0x439e05){return{'name':_0x439e05['fieldName'],'type':_0x439e05['type'][_0x47cc('0x34')]};});_0x5ae153['model']=_[_0x47cc('0x32')](_0x141fad,_0x47cc('0x2f'));_0x5ae153[_0x47cc('0x35')]=_[_0x47cc('0x36')](_0x914811[_0x47cc('0x35')]);_0x5ae153[_0x47cc('0x37')]=_['intersection'](_0x5ae153[_0x47cc('0x38')],_0x5ae153[_0x47cc('0x35')]);_0x476103['attributes']=_['intersection'](_0x5ae153[_0x47cc('0x38')],qs[_0x47cc('0x39')](_0x914811[_0x47cc('0x35')][_0x47cc('0x39')]));_0x476103[_0x47cc('0x3a')]=_0x476103[_0x47cc('0x3a')]['length']?_0x476103[_0x47cc('0x3a')]:_0x5ae153[_0x47cc('0x38')];if(!_0x914811[_0x47cc('0x35')][_0x47cc('0x3b')](_0x47cc('0x3c'))){_0x476103[_0x47cc('0x21')]=qs['limit'](_0x914811[_0x47cc('0x35')][_0x47cc('0x21')]);_0x476103['offset']=qs[_0x47cc('0x23')](_0x914811[_0x47cc('0x35')][_0x47cc('0x23')]);}_0x476103[_0x47cc('0x3d')]=qs['sort'](_0x914811['query'][_0x47cc('0x3e')]);_0x476103['where']=qs[_0x47cc('0x37')](_[_0x47cc('0x3f')](_0x914811[_0x47cc('0x35')],_0x5ae153[_0x47cc('0x37')]),_0x141fad);if(_0x914811[_0x47cc('0x35')][_0x47cc('0x40')]){_0x476103[_0x47cc('0x41')]=_['merge'](_0x476103[_0x47cc('0x41')],{'$or':_[_0x47cc('0x32')](_0x141fad,function(_0x21fb9a){if(_0x21fb9a[_0x47cc('0x42')]!=='VIRTUAL'){var _0x777081={};_0x777081[_0x21fb9a[_0x47cc('0x2f')]]={'$like':'%'+_0x914811[_0x47cc('0x35')][_0x47cc('0x40')]+'%'};return _0x777081;}})});}_0x476103=_['merge']({},_0x476103,_0x914811[_0x47cc('0x43')]);var _0x32a28b={'where':_0x476103[_0x47cc('0x41')]};return db[_0x47cc('0x33')][_0x47cc('0x22')](_0x32a28b)[_0x47cc('0x2a')](function(_0x2bed9a){_0x3adbda['count']=_0x2bed9a;if(_0x914811[_0x47cc('0x35')][_0x47cc('0x44')]){_0x476103[_0x47cc('0x45')]=[{'all':!![]}];}return db['MailQueue'][_0x47cc('0x46')](_0x476103);})[_0x47cc('0x2a')](function(_0x563a7f){_0x3adbda[_0x47cc('0x47')]=_0x563a7f;return _0x3adbda;})[_0x47cc('0x2a')](respondWithFilteredResult(_0x27f16c,_0x476103))[_0x47cc('0x48')](handleError(_0x27f16c,null));};exports[_0x47cc('0x49')]=function(_0x424d78,_0x11c242){var _0x5a343b={'raw':!![],'where':{'id':_0x424d78[_0x47cc('0x4a')]['id']}},_0x532e7c={};_0x532e7c['model']=_['keys'](db[_0x47cc('0x33')][_0x47cc('0x4b')]);_0x532e7c[_0x47cc('0x35')]=_[_0x47cc('0x36')](_0x424d78[_0x47cc('0x35')]);_0x532e7c[_0x47cc('0x37')]=_['intersection'](_0x532e7c[_0x47cc('0x38')],_0x532e7c[_0x47cc('0x35')]);_0x5a343b[_0x47cc('0x3a')]=_[_0x47cc('0x4c')](_0x532e7c['model'],qs['fields'](_0x424d78[_0x47cc('0x35')][_0x47cc('0x39')]));_0x5a343b[_0x47cc('0x3a')]=_0x5a343b[_0x47cc('0x3a')]['length']?_0x5a343b[_0x47cc('0x3a')]:_0x532e7c[_0x47cc('0x38')];if(_0x424d78[_0x47cc('0x35')][_0x47cc('0x44')]){_0x5a343b[_0x47cc('0x45')]=[{'all':!![]}];}_0x5a343b=_[_0x47cc('0x4d')]({},_0x5a343b,_0x424d78['options']);return db['MailQueue'][_0x47cc('0x4e')](_0x5a343b)[_0x47cc('0x2a')](handleEntityNotFound(_0x11c242,null))['then'](respondWithResult(_0x11c242,null))['catch'](handleError(_0x11c242,null));};exports[_0x47cc('0x4f')]=function(_0x35ab10,_0x4fa2ef){return db[_0x47cc('0x33')][_0x47cc('0x4f')](_0x35ab10[_0x47cc('0x50')],{})['then'](function(_0x13188f){var _0x158889=_0x35ab10[_0x47cc('0x51')][_0x47cc('0x2c')]({'plain':!![]});if(!_0x158889)throw new Error(_0x47cc('0x52'));if(_0x158889[_0x47cc('0x53')]===_0x47cc('0x51')){var _0x3f6e22=_0x13188f['get']({'plain':!![]});var _0x3bcccd=_0x47cc('0x54');return db['UserProfileSection'][_0x47cc('0x4e')]({'where':{'name':_0x3bcccd,'userProfileId':_0x158889['userProfileId']},'raw':!![]})[_0x47cc('0x2a')](function(_0x536a2a){if(_0x536a2a&&_0x536a2a[_0x47cc('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x3f6e22[_0x47cc('0x2f')],'resourceId':_0x3f6e22['id'],'type':_0x536a2a[_0x47cc('0x2f')],'sectionId':_0x536a2a['id']},{})[_0x47cc('0x2a')](function(){return _0x13188f;});}else{return _0x13188f;}})[_0x47cc('0x48')](function(_0x127a77){logger[_0x47cc('0x2d')](_0x47cc('0x56'),_0x127a77);throw _0x127a77;});}return _0x13188f;})[_0x47cc('0x2a')](respondWithResult(_0x4fa2ef,0xc9))[_0x47cc('0x48')](handleError(_0x4fa2ef,null));};exports[_0x47cc('0x29')]=function(_0x350526,_0x3ff615){if(_0x350526[_0x47cc('0x50')]['id']){delete _0x350526['body']['id'];}return db[_0x47cc('0x33')]['find']({'where':{'id':_0x350526[_0x47cc('0x4a')]['id']}})[_0x47cc('0x2a')](handleEntityNotFound(_0x3ff615,null))[_0x47cc('0x2a')](saveUpdates(_0x350526['body'],null))[_0x47cc('0x2a')](respondWithResult(_0x3ff615,null))[_0x47cc('0x48')](handleError(_0x3ff615,null));};exports['destroy']=function(_0x5a7bd2,_0x931641){return db[_0x47cc('0x33')][_0x47cc('0x4e')]({'where':{'id':_0x5a7bd2['params']['id']}})[_0x47cc('0x2a')](handleEntityNotFound(_0x931641,null))[_0x47cc('0x2a')](removeEntity(_0x931641,null))[_0x47cc('0x48')](handleError(_0x931641,null));};exports[_0x47cc('0x57')]=function(_0x16edb7,_0x5a4b82){return db['MailQueue'][_0x47cc('0x57')]()[_0x47cc('0x2a')](respondWithResult(_0x5a4b82,null))['catch'](handleError(_0x5a4b82,null));};exports[_0x47cc('0x58')]=function(_0x26f753,_0x5042f1,_0x134423){var _0x3b9205={'raw':!![],'where':{}},_0x204f8c={},_0x13fcda;return db[_0x47cc('0x33')][_0x47cc('0x59')]({'where':{'id':_0x26f753[_0x47cc('0x4a')]['id']}})[_0x47cc('0x2a')](handleEntityNotFound(_0x5042f1,null))['then'](function(_0x4a8d42){if(_0x4a8d42){_0x13fcda=_0x4a8d42[_0x47cc('0x2c')]({'plain':!![]});_0x204f8c[_0x47cc('0x38')]=_[_0x47cc('0x36')](db[_0x47cc('0x5a')]['rawAttributes']);_0x204f8c[_0x47cc('0x35')]=_[_0x47cc('0x36')](_0x26f753[_0x47cc('0x35')]);_0x204f8c[_0x47cc('0x37')]=_['intersection'](_0x204f8c[_0x47cc('0x38')],_0x204f8c[_0x47cc('0x35')]);_0x3b9205[_0x47cc('0x3a')]=_[_0x47cc('0x4c')](_0x204f8c[_0x47cc('0x38')],qs[_0x47cc('0x39')](_0x26f753[_0x47cc('0x35')][_0x47cc('0x39')]));_0x3b9205[_0x47cc('0x3a')]=_0x3b9205[_0x47cc('0x3a')][_0x47cc('0x5b')]?_0x3b9205['attributes']:_0x204f8c[_0x47cc('0x38')];if(!_0x26f753[_0x47cc('0x35')][_0x47cc('0x3b')](_0x47cc('0x3c'))){_0x3b9205[_0x47cc('0x21')]=qs[_0x47cc('0x21')](_0x26f753['query'][_0x47cc('0x21')]);_0x3b9205[_0x47cc('0x23')]=qs[_0x47cc('0x23')](_0x26f753[_0x47cc('0x35')][_0x47cc('0x23')]);}_0x3b9205['order']=qs[_0x47cc('0x3e')](_0x26f753[_0x47cc('0x35')][_0x47cc('0x3e')]);_0x3b9205['where']=qs[_0x47cc('0x37')](_[_0x47cc('0x3f')](_0x26f753[_0x47cc('0x35')],_0x204f8c[_0x47cc('0x37')]));_0x3b9205[_0x47cc('0x41')][_0x47cc('0x5c')]=_0x4a8d42['id'];if(_0x26f753['query'][_0x47cc('0x40')]){_0x3b9205['where']=_[_0x47cc('0x4d')](_0x3b9205['where'],{'$or':_[_0x47cc('0x32')](_0x3b9205[_0x47cc('0x3a')],function(_0x2e2d7c){var _0x3b445f={};_0x3b445f[_0x2e2d7c]={'$like':'%'+_0x26f753[_0x47cc('0x35')][_0x47cc('0x40')]+'%'};return _0x3b445f;})});}_0x3b9205=_[_0x47cc('0x4d')]({},_0x3b9205,_0x26f753[_0x47cc('0x43')]);return db[_0x47cc('0x5a')][_0x47cc('0x46')](_0x3b9205);}})['then'](function(_0x5be946){if(_0x5be946){return db[_0x47cc('0x5d')]['findAndCountAll']({'where':{'id':_[_0x47cc('0x32')](_0x5be946,_0x47cc('0x5e')),'role':'agent'},'attributes':['id',_0x47cc('0x2f'),_0x47cc('0x5f'),_0x47cc('0x60'),_0x47cc('0x61')]});}})[_0x47cc('0x2a')](function(_0x3e6d2c){if(_0x3e6d2c){return{'count':_0x3e6d2c[_0x47cc('0x22')],'rows':_[_0x47cc('0x32')](_0x3e6d2c[_0x47cc('0x47')],function(_0x3a4cce){return{'membername':_0x3a4cce[_0x47cc('0x2f')],'UserId':_0x3a4cce['id'],'queue_name':_0x13fcda[_0x47cc('0x2f')],'MailQueueId':_0x13fcda['id'],'interface':util[_0x47cc('0x62')](_0x47cc('0x63'),'SIP',_0x3a4cce[_0x47cc('0x2f')]),'penalty':0x0,'paused':_0x3a4cce[_0x47cc('0x5f')],'createdAt':_0x3a4cce['createdAt'],'updatedAt':_0x3a4cce['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x5042f1,_0x3b9205))['catch'](handleError(_0x5042f1,null));};exports[_0x47cc('0x64')]=function(_0x3033e1,_0x5eb3a2,_0x2d23c7){var _0x3ccfb8={};var _0x1c7352={};var _0xaf09cc;var _0x11d787;return db[_0x47cc('0x33')][_0x47cc('0x59')]({'where':{'id':_0x3033e1[_0x47cc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5eb3a2,null))[_0x47cc('0x2a')](function(_0x521df8){if(_0x521df8){_0xaf09cc=_0x521df8;_0x1c7352[_0x47cc('0x38')]=_[_0x47cc('0x36')](db[_0x47cc('0x65')][_0x47cc('0x4b')]);_0x1c7352[_0x47cc('0x35')]=_[_0x47cc('0x36')](_0x3033e1[_0x47cc('0x35')]);_0x1c7352[_0x47cc('0x37')]=_[_0x47cc('0x4c')](_0x1c7352['model'],_0x1c7352[_0x47cc('0x35')]);_0x3ccfb8[_0x47cc('0x3a')]=_[_0x47cc('0x4c')](_0x1c7352[_0x47cc('0x38')],qs[_0x47cc('0x39')](_0x3033e1['query'][_0x47cc('0x39')]));_0x3ccfb8['attributes']=_0x3ccfb8[_0x47cc('0x3a')][_0x47cc('0x5b')]?_0x3ccfb8[_0x47cc('0x3a')]:_0x1c7352[_0x47cc('0x38')];_0x3ccfb8['order']=qs[_0x47cc('0x3e')](_0x3033e1[_0x47cc('0x35')][_0x47cc('0x3e')]);_0x3ccfb8[_0x47cc('0x41')]=qs[_0x47cc('0x37')](_['pick'](_0x3033e1['query'],_0x1c7352[_0x47cc('0x37')]));if(_0x3033e1[_0x47cc('0x35')][_0x47cc('0x40')]){_0x3ccfb8[_0x47cc('0x41')]=_[_0x47cc('0x4d')](_0x3ccfb8[_0x47cc('0x41')],{'$or':_[_0x47cc('0x32')](_0x3ccfb8[_0x47cc('0x3a')],function(_0xaa0701){var _0x549b99={};_0x549b99[_0xaa0701]={'$like':'%'+_0x3033e1[_0x47cc('0x35')][_0x47cc('0x40')]+'%'};return _0x549b99;})});}_0x3ccfb8=_[_0x47cc('0x4d')]({},_0x3ccfb8,_0x3033e1[_0x47cc('0x43')]);return _0xaf09cc[_0x47cc('0x64')](_0x3ccfb8);}})[_0x47cc('0x2a')](function(_0x1dbdb4){if(_0x1dbdb4){_0x11d787=_0x1dbdb4['length'];if(!_0x3033e1[_0x47cc('0x35')][_0x47cc('0x3b')](_0x47cc('0x3c'))){_0x3ccfb8[_0x47cc('0x21')]=qs['limit'](_0x3033e1['query'][_0x47cc('0x21')]);_0x3ccfb8[_0x47cc('0x23')]=qs[_0x47cc('0x23')](_0x3033e1[_0x47cc('0x35')]['offset']);}return _0xaf09cc[_0x47cc('0x64')](_0x3ccfb8);}})['then'](function(_0x2a443d){if(_0x2a443d){return _0x2a443d?{'count':_0x11d787,'rows':_0x2a443d}:null;}})[_0x47cc('0x2a')](respondWithResult(_0x5eb3a2,null))[_0x47cc('0x48')](handleError(_0x5eb3a2,null));};exports['addTeams']=function(_0x948c5b,_0x366498,_0x45b8af){var _0x116aac=_0x948c5b[_0x47cc('0x50')][_0x47cc('0x66')];return db[_0x47cc('0x65')][_0x47cc('0x46')]({'where':{'id':_0x116aac},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name','online',_0x47cc('0x67'),_0x47cc('0x68')],'raw':!![]}]})['then'](function(_0x4524a1){if(_0x4524a1){var _0x369f00=_[_0x47cc('0x69')](_0x4524a1,function(_0x3ed36a){var _0x191fc1=_0x3ed36a[_0x47cc('0x2c')]({'plain':!![]});return _0x191fc1[_0x47cc('0x6a')];});return db['MailQueue'][_0x47cc('0x4e')]({'where':{'id':_0x948c5b[_0x47cc('0x4a')]['id']}})[_0x47cc('0x2a')](function(_0x4626a3){return db[_0x47cc('0x6b')][_0x47cc('0x6c')](function(_0x593a93){return _0x4626a3[_0x47cc('0x6d')](_0x116aac,{'transaction':_0x593a93})[_0x47cc('0x2a')](function(){return BPromise['each'](_0x369f00,function(_0xb3b53e){return db[_0x47cc('0x5a')][_0x47cc('0x6e')]({'where':{'UserId':_0xb3b53e['id'],'MailQueueId':_0x948c5b[_0x47cc('0x4a')]['id']},'transaction':_0x593a93});});})[_0x47cc('0x2a')](function(){_0x369f00[_0x47cc('0x6f')](function(_0x14d6ac){socket['emit'](_0x47cc('0x70'),{'UserId':_0x14d6ac['id'],'MailQueueId':_0x4626a3['id']});});});});});}})['then'](respondWithStatusCode(_0x366498,null))[_0x47cc('0x48')](handleError(_0x366498,null));};exports[_0x47cc('0x71')]=function(_0x20bbb6,_0x20332c,_0x18cbaa){return db[_0x47cc('0x65')][_0x47cc('0x46')]({'where':{'id':_0x20bbb6[_0x47cc('0x35')][_0x47cc('0x66')]},'attributes':['id'],'include':[{'model':db[_0x47cc('0x5d')],'as':_0x47cc('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x20332c,null))[_0x47cc('0x2a')](function(_0x46b3d1){var _0x21f341=_[_0x47cc('0x32')](_0x46b3d1,'id');var _0x4a1850=[];var _0x590e28=[];var _0x5a283c=squel[_0x47cc('0x72')]();_0x5a283c[_0x47cc('0x73')]('tq.TeamId')[_0x47cc('0x74')](_0x47cc('0x75'),'tq')[_0x47cc('0x76')]('user_has_teams','ut',_0x47cc('0x77'))[_0x47cc('0x41')]('MailQueueId\x20=\x20?',_0x20bbb6[_0x47cc('0x4a')]['id']);for(var _0x5a91f8=0x0;_0x5a91f8<_0x46b3d1[_0x47cc('0x5b')];_0x5a91f8+=0x1){let _0x4eee17=_0x46b3d1[_0x5a91f8];for(var _0x14fba1=0x0;_0x14fba1<_0x4eee17[_0x47cc('0x6a')]['length'];_0x14fba1+=0x1){let _0x498fcb=_0x4eee17['Agents'][_0x14fba1];var _0x50554d=_0x5a283c['clone']();_0x50554d['where'](_0x47cc('0x78'),_0x498fcb['id']);_0x590e28[_0x47cc('0x79')](db[_0x47cc('0x6b')][_0x47cc('0x35')](_0x50554d[_0x47cc('0x7a')](),{'type':db['sequelize'][_0x47cc('0x7b')][_0x47cc('0x7c')]})[_0x47cc('0x2a')](function(_0x40dcc9){if(_0x40dcc9[_0x47cc('0x5b')]===0x1){return _0x498fcb['id'];}else{var _0x10f76a=_['every'](_[_0x47cc('0x32')](_0x40dcc9,_0x47cc('0x7d')),function(_0x4af1d8){return _[_0x47cc('0x7e')](_0x21f341,_0x4af1d8);});if(_0x10f76a){return _0x498fcb['id'];}}}));}}return BPromise['all'](_0x590e28)[_0x47cc('0x2a')](function(_0x120ae1){_0x4a1850=_(_0x4a1850)[_0x47cc('0x7f')](_0x120ae1)[_0x47cc('0x80')]()[_0x47cc('0x81')]();return db[_0x47cc('0x33')][_0x47cc('0x4e')]({'where':{'id':_0x20bbb6['params']['id']}})[_0x47cc('0x2a')](function(_0x5034cd){return db[_0x47cc('0x6b')][_0x47cc('0x6c')](function(_0xbce338){return _0x5034cd['removeTeams'](_0x20bbb6[_0x47cc('0x35')][_0x47cc('0x66')],{'transaction':_0xbce338})['then'](function(){if(!_[_0x47cc('0x82')](_0x4a1850)){return _0x5034cd['removeAgents'](_0x4a1850,{'transaction':_0xbce338});}})[_0x47cc('0x2a')](function(){_0x4a1850[_0x47cc('0x6f')](function(_0x5a7b9b){socket[_0x47cc('0x83')](_0x47cc('0x84'),{'UserId':_0x5a7b9b,'MailQueueId':_0x5034cd['id']});});});});});});})[_0x47cc('0x2a')](respondWithStatusCode(_0x20332c,null))['catch'](handleError(_0x20332c,null));};exports['addAgents']=function(_0x40706c,_0x5e0cf2,_0x30c92c){return db['MailQueue'][_0x47cc('0x4e')]({'where':{'id':_0x40706c['params']['id']}})[_0x47cc('0x2a')](handleEntityNotFound(_0x5e0cf2,null))[_0x47cc('0x2a')](function(_0x9f05e1){if(_0x9f05e1){return _0x9f05e1[_0x47cc('0x85')](_0x40706c[_0x47cc('0x50')][_0x47cc('0x66')],_[_0x47cc('0x86')](_0x40706c[_0x47cc('0x50')],[_0x47cc('0x66'),'id'])||{})[_0x47cc('0x87')](function(_0x1ec552){for(var _0x48d360=0x0;_0x48d360<_0x40706c['body']['ids'][_0x47cc('0x5b')];_0x48d360+=0x1){socket['emit'](_0x47cc('0x70'),{'UserId':Number(_0x40706c['body']['ids'][_0x48d360]),'MailQueueId':Number(_0x40706c[_0x47cc('0x4a')]['id'])});}return _0x1ec552;});}})[_0x47cc('0x2a')](respondWithResult(_0x5e0cf2,null))['catch'](handleError(_0x5e0cf2,null));};exports[_0x47cc('0x88')]=function(_0x53026e,_0x599f6c,_0x2979ce){return db[_0x47cc('0x33')][_0x47cc('0x4e')]({'where':{'id':_0x53026e[_0x47cc('0x4a')]['id']}})[_0x47cc('0x2a')](handleEntityNotFound(_0x599f6c,null))[_0x47cc('0x2a')](function(_0x2178f7){if(_0x2178f7){return _0x2178f7[_0x47cc('0x88')](_0x53026e[_0x47cc('0x35')][_0x47cc('0x66')])[_0x47cc('0x2a')](function(){if(_[_0x47cc('0x89')](_0x53026e['query'][_0x47cc('0x66')])){for(var _0x3455ef=0x0;_0x3455ef<_0x53026e[_0x47cc('0x35')][_0x47cc('0x66')][_0x47cc('0x5b')];_0x3455ef+=0x1){socket[_0x47cc('0x83')](_0x47cc('0x84'),{'UserId':Number(_0x53026e[_0x47cc('0x35')][_0x47cc('0x66')][_0x3455ef]),'MailQueueId':Number(_0x53026e[_0x47cc('0x4a')]['id'])});}}else{socket[_0x47cc('0x83')](_0x47cc('0x84'),{'UserId':Number(_0x53026e['query'][_0x47cc('0x66')]),'MailQueueId':Number(_0x53026e['params']['id'])});}});}})[_0x47cc('0x2a')](respondWithStatusCode(_0x599f6c,null))[_0x47cc('0x48')](handleError(_0x599f6c,null));};exports[_0x47cc('0x8a')]=function(_0x2c6247,_0x5e145e,_0x58ee40){var _0x1dddb2={};var _0x964827={};var _0x180ba6;var _0x45fe30;return db[_0x47cc('0x33')][_0x47cc('0x59')]({'where':{'id':_0x2c6247['params']['id']}})[_0x47cc('0x2a')](handleEntityNotFound(_0x5e145e,null))[_0x47cc('0x2a')](function(_0x5d94d9){if(_0x5d94d9){_0x180ba6=_0x5d94d9;_0x964827['model']=_['keys'](db['User']['rawAttributes']);_0x964827['query']=_[_0x47cc('0x36')](_0x2c6247[_0x47cc('0x35')]);_0x964827[_0x47cc('0x37')]=_[_0x47cc('0x4c')](_0x964827[_0x47cc('0x38')],_0x964827[_0x47cc('0x35')]);_0x1dddb2[_0x47cc('0x3a')]=_[_0x47cc('0x4c')](_0x964827['model'],qs[_0x47cc('0x39')](_0x2c6247[_0x47cc('0x35')][_0x47cc('0x39')]));_0x1dddb2[_0x47cc('0x3a')]=_0x1dddb2['attributes'][_0x47cc('0x5b')]?_0x1dddb2[_0x47cc('0x3a')]:_0x964827[_0x47cc('0x38')];_0x1dddb2['order']=qs[_0x47cc('0x3e')](_0x2c6247[_0x47cc('0x35')]['sort']);_0x1dddb2[_0x47cc('0x41')]=qs[_0x47cc('0x37')](_[_0x47cc('0x3f')](_0x2c6247[_0x47cc('0x35')],_0x964827[_0x47cc('0x37')]));if(_0x2c6247[_0x47cc('0x35')][_0x47cc('0x40')]){_0x1dddb2[_0x47cc('0x41')]=_[_0x47cc('0x4d')](_0x1dddb2[_0x47cc('0x41')],{'$or':_['map'](_0x1dddb2['attributes'],function(_0x1680a7){var _0x649941={};_0x649941[_0x1680a7]={'$like':'%'+_0x2c6247['query']['filter']+'%'};return _0x649941;})});}_0x1dddb2=_['merge']({},_0x1dddb2,_0x2c6247[_0x47cc('0x43')]);return _0x180ba6[_0x47cc('0x8a')](_0x1dddb2);}})[_0x47cc('0x2a')](function(_0x340018){if(_0x340018){_0x45fe30=_0x340018[_0x47cc('0x5b')];if(!_0x2c6247[_0x47cc('0x35')][_0x47cc('0x3b')](_0x47cc('0x3c'))){_0x1dddb2[_0x47cc('0x21')]=qs[_0x47cc('0x21')](_0x2c6247[_0x47cc('0x35')][_0x47cc('0x21')]);_0x1dddb2[_0x47cc('0x23')]=qs['offset'](_0x2c6247['query'][_0x47cc('0x23')]);}return _0x180ba6['getAgents'](_0x1dddb2);}})[_0x47cc('0x2a')](function(_0x4c7def){if(_0x4c7def){return _0x4c7def?{'count':_0x45fe30,'rows':_0x4c7def}:null;}})[_0x47cc('0x2a')](respondWithResult(_0x5e145e,null))[_0x47cc('0x48')](handleError(_0x5e145e,null));}; \ No newline at end of file +var _0xd810=['catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','get','UserMailQueue','nolimit','MailQueueId','findAll','User','findAndCountAll','UserId','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','Agents','online','interface','flatMap','transaction','each','emit','removeTeams','ids','select','from','team_has_mail_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','compact','value','sequelize','isEmpty','removeAgents','forEach','addAgents','spread','userMailQueue:save','isArray','userMailQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','then','MailQueues','UserProfileResource','destroy','error','stack','name','send','index','MailQueue','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows'];(function(_0x179b9c,_0x2da181){var _0x460e79=function(_0x337b42){while(--_0x337b42){_0x179b9c['push'](_0x179b9c['shift']());}};_0x460e79(++_0x2da181);}(_0xd810,0x1dd));var _0x0d81=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xd810[_0x1ae5ab];return _0x1ce001;};'use strict';var emlformat=require(_0x0d81('0x0'));var rimraf=require(_0x0d81('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0d81('0x2'));var rp=require(_0x0d81('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0d81('0x4'));var util=require('util');var path=require(_0x0d81('0x5'));var sox=require('sox');var csv=require(_0x0d81('0x6'));var ejs=require(_0x0d81('0x7'));var fs=require('fs');var fs_extra=require(_0x0d81('0x8'));var _=require(_0x0d81('0x9'));var squel=require(_0x0d81('0xa'));var crypto=require(_0x0d81('0xb'));var jsforce=require(_0x0d81('0xc'));var deskjs=require(_0x0d81('0xd'));var toCsv=require(_0x0d81('0x6'));var querystring=require('querystring');var Papa=require(_0x0d81('0xe'));var Redis=require('ioredis');var authService=require(_0x0d81('0xf'));var qs=require(_0x0d81('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d81('0x11'));var logger=require(_0x0d81('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x0d81('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x0d81('0x14')]=_['defaults'](config[_0x0d81('0x14')],{'host':_0x0d81('0x15'),'port':0x18eb});var socket=require(_0x0d81('0x16'))(new Redis(config['redis']));require(_0x0d81('0x17'))[_0x0d81('0x18')](socket);function respondWithStatusCode(_0x328221,_0x5ed805){_0x5ed805=_0x5ed805||0xcc;return function(_0x3d0f74){if(_0x3d0f74){return _0x328221[_0x0d81('0x19')](_0x5ed805);}return _0x328221[_0x0d81('0x1a')](_0x5ed805)[_0x0d81('0x1b')]();};}function respondWithResult(_0x237e95,_0x27c279){_0x27c279=_0x27c279||0xc8;return function(_0x5dfe2c){if(_0x5dfe2c){return _0x237e95[_0x0d81('0x1a')](_0x27c279)[_0x0d81('0x1c')](_0x5dfe2c);}};}function respondWithFilteredResult(_0x15b797,_0x220bd4){return function(_0x58d9c7){if(_0x58d9c7){var _0x1b095d=typeof _0x220bd4['offset']===_0x0d81('0x1d')&&typeof _0x220bd4[_0x0d81('0x1e')]===_0x0d81('0x1d');var _0x37e74c=_0x58d9c7[_0x0d81('0x1f')];var _0x285868=_0x1b095d?0x0:_0x220bd4[_0x0d81('0x20')];var _0x29a9e2=_0x1b095d?_0x58d9c7[_0x0d81('0x1f')]:_0x220bd4[_0x0d81('0x20')]+_0x220bd4[_0x0d81('0x1e')];var _0x5ec324;if(_0x29a9e2>=_0x37e74c){_0x29a9e2=_0x37e74c;_0x5ec324=0xc8;}else{_0x5ec324=0xce;}_0x15b797[_0x0d81('0x1a')](_0x5ec324);return _0x15b797[_0x0d81('0x21')]('Content-Range',_0x285868+'-'+_0x29a9e2+'/'+_0x37e74c)['json'](_0x58d9c7);}return null;};}function patchUpdates(_0x1c2035){return function(_0x40d50f){try{jsonpatch[_0x0d81('0x22')](_0x40d50f,_0x1c2035,!![]);}catch(_0x96ffe8){return BPromise[_0x0d81('0x23')](_0x96ffe8);}return _0x40d50f[_0x0d81('0x24')]();};}function saveUpdates(_0x26536d,_0x3a3843){return function(_0x580970){if(_0x580970){return _0x580970['update'](_0x26536d)[_0x0d81('0x25')](function(_0x235353){return _0x235353;});}return null;};}function removeEntity(_0x47c326,_0x23cada){return function(_0x27861e){if(_0x27861e){return _0x27861e['destroy']()[_0x0d81('0x25')](function(){var _0x20bbeb=_0x27861e['get']({'plain':!![]});var _0x293d12=_0x0d81('0x26');return db[_0x0d81('0x27')][_0x0d81('0x28')]({'where':{'type':_0x293d12,'resourceId':_0x20bbeb['id']}})[_0x0d81('0x25')](function(){return _0x27861e;});})[_0x0d81('0x25')](function(){_0x47c326[_0x0d81('0x1a')](0xcc)[_0x0d81('0x1b')]();});}};}function handleEntityNotFound(_0x38b140,_0x238da2){return function(_0x4f3d6f){if(!_0x4f3d6f){_0x38b140[_0x0d81('0x19')](0x194);}return _0x4f3d6f;};}function handleError(_0x5a1466,_0x2a5a2d){_0x2a5a2d=_0x2a5a2d||0x1f4;return function(_0x5945b1){logger[_0x0d81('0x29')](_0x5945b1[_0x0d81('0x2a')]);if(_0x5945b1[_0x0d81('0x2b')]){delete _0x5945b1[_0x0d81('0x2b')];}_0x5a1466[_0x0d81('0x1a')](_0x2a5a2d)[_0x0d81('0x2c')](_0x5945b1);};}exports[_0x0d81('0x2d')]=function(_0x54363e,_0x32f707){var _0x16d795={},_0x2d02eb={},_0x3a8118={'count':0x0,'rows':[]};var _0x4428c2=_['map'](db[_0x0d81('0x2e')][_0x0d81('0x2f')],function(_0x4ae0a1){return{'name':_0x4ae0a1[_0x0d81('0x30')],'type':_0x4ae0a1[_0x0d81('0x31')]['key']};});_0x2d02eb[_0x0d81('0x32')]=_[_0x0d81('0x33')](_0x4428c2,_0x0d81('0x2b'));_0x2d02eb[_0x0d81('0x34')]=_[_0x0d81('0x35')](_0x54363e[_0x0d81('0x34')]);_0x2d02eb[_0x0d81('0x36')]=_[_0x0d81('0x37')](_0x2d02eb[_0x0d81('0x32')],_0x2d02eb[_0x0d81('0x34')]);_0x16d795[_0x0d81('0x38')]=_[_0x0d81('0x37')](_0x2d02eb['model'],qs[_0x0d81('0x39')](_0x54363e[_0x0d81('0x34')][_0x0d81('0x39')]));_0x16d795[_0x0d81('0x38')]=_0x16d795[_0x0d81('0x38')][_0x0d81('0x3a')]?_0x16d795[_0x0d81('0x38')]:_0x2d02eb[_0x0d81('0x32')];if(!_0x54363e['query'][_0x0d81('0x3b')]('nolimit')){_0x16d795[_0x0d81('0x1e')]=qs[_0x0d81('0x1e')](_0x54363e['query'][_0x0d81('0x1e')]);_0x16d795[_0x0d81('0x20')]=qs[_0x0d81('0x20')](_0x54363e[_0x0d81('0x34')][_0x0d81('0x20')]);}_0x16d795[_0x0d81('0x3c')]=qs[_0x0d81('0x3d')](_0x54363e[_0x0d81('0x34')][_0x0d81('0x3d')]);_0x16d795[_0x0d81('0x3e')]=qs[_0x0d81('0x36')](_[_0x0d81('0x3f')](_0x54363e['query'],_0x2d02eb['filters']),_0x4428c2);if(_0x54363e[_0x0d81('0x34')]['filter']){_0x16d795[_0x0d81('0x3e')]=_[_0x0d81('0x40')](_0x16d795['where'],{'$or':_[_0x0d81('0x33')](_0x4428c2,function(_0x12fbaa){if(_0x12fbaa[_0x0d81('0x31')]!==_0x0d81('0x41')){var _0x187098={};_0x187098[_0x12fbaa[_0x0d81('0x2b')]]={'$like':'%'+_0x54363e[_0x0d81('0x34')][_0x0d81('0x42')]+'%'};return _0x187098;}})});}_0x16d795=_['merge']({},_0x16d795,_0x54363e[_0x0d81('0x43')]);var _0x1ae092={'where':_0x16d795[_0x0d81('0x3e')]};return db[_0x0d81('0x2e')][_0x0d81('0x1f')](_0x1ae092)[_0x0d81('0x25')](function(_0x331b5c){_0x3a8118[_0x0d81('0x1f')]=_0x331b5c;if(_0x54363e[_0x0d81('0x34')][_0x0d81('0x44')]){_0x16d795[_0x0d81('0x45')]=[{'all':!![]}];}return db[_0x0d81('0x2e')]['findAll'](_0x16d795);})['then'](function(_0x38d0f0){_0x3a8118[_0x0d81('0x46')]=_0x38d0f0;return _0x3a8118;})[_0x0d81('0x25')](respondWithFilteredResult(_0x32f707,_0x16d795))[_0x0d81('0x47')](handleError(_0x32f707,null));};exports[_0x0d81('0x48')]=function(_0x19aba2,_0x11e3b8){var _0x57ed50={'raw':!![],'where':{'id':_0x19aba2[_0x0d81('0x49')]['id']}},_0x2da263={};_0x2da263[_0x0d81('0x32')]=_[_0x0d81('0x35')](db['MailQueue'][_0x0d81('0x2f')]);_0x2da263['query']=_[_0x0d81('0x35')](_0x19aba2['query']);_0x2da263[_0x0d81('0x36')]=_['intersection'](_0x2da263[_0x0d81('0x32')],_0x2da263[_0x0d81('0x34')]);_0x57ed50[_0x0d81('0x38')]=_['intersection'](_0x2da263['model'],qs[_0x0d81('0x39')](_0x19aba2[_0x0d81('0x34')][_0x0d81('0x39')]));_0x57ed50['attributes']=_0x57ed50[_0x0d81('0x38')]['length']?_0x57ed50[_0x0d81('0x38')]:_0x2da263[_0x0d81('0x32')];if(_0x19aba2['query'][_0x0d81('0x44')]){_0x57ed50['include']=[{'all':!![]}];}_0x57ed50=_[_0x0d81('0x40')]({},_0x57ed50,_0x19aba2['options']);return db[_0x0d81('0x2e')][_0x0d81('0x4a')](_0x57ed50)[_0x0d81('0x25')](handleEntityNotFound(_0x11e3b8,null))[_0x0d81('0x25')](respondWithResult(_0x11e3b8,null))[_0x0d81('0x47')](handleError(_0x11e3b8,null));};exports[_0x0d81('0x4b')]=function(_0x5c36c8,_0x477e49){return db[_0x0d81('0x2e')][_0x0d81('0x4b')](_0x5c36c8[_0x0d81('0x4c')],{})[_0x0d81('0x25')](function(_0xe598a9){var _0x2ac41a=_0x5c36c8[_0x0d81('0x4d')]['get']({'plain':!![]});if(!_0x2ac41a)throw new Error(_0x0d81('0x4e'));if(_0x2ac41a[_0x0d81('0x4f')]===_0x0d81('0x4d')){var _0x55822a=_0xe598a9['get']({'plain':!![]});var _0x388b59=_0x0d81('0x26');return db['UserProfileSection'][_0x0d81('0x4a')]({'where':{'name':_0x388b59,'userProfileId':_0x2ac41a[_0x0d81('0x50')]},'raw':!![]})[_0x0d81('0x25')](function(_0x393750){if(_0x393750&&_0x393750[_0x0d81('0x51')]===0x0){return db['UserProfileResource'][_0x0d81('0x4b')]({'name':_0x55822a[_0x0d81('0x2b')],'resourceId':_0x55822a['id'],'type':_0x393750['name'],'sectionId':_0x393750['id']},{})['then'](function(){return _0xe598a9;});}else{return _0xe598a9;}})[_0x0d81('0x47')](function(_0x184e58){logger[_0x0d81('0x29')](_0x0d81('0x52'),_0x184e58);throw _0x184e58;});}return _0xe598a9;})[_0x0d81('0x25')](respondWithResult(_0x477e49,0xc9))[_0x0d81('0x47')](handleError(_0x477e49,null));};exports[_0x0d81('0x53')]=function(_0x4aee18,_0x31653a){if(_0x4aee18[_0x0d81('0x4c')]['id']){delete _0x4aee18[_0x0d81('0x4c')]['id'];}return db[_0x0d81('0x2e')][_0x0d81('0x4a')]({'where':{'id':_0x4aee18[_0x0d81('0x49')]['id']}})['then'](handleEntityNotFound(_0x31653a,null))[_0x0d81('0x25')](saveUpdates(_0x4aee18[_0x0d81('0x4c')],null))[_0x0d81('0x25')](respondWithResult(_0x31653a,null))[_0x0d81('0x47')](handleError(_0x31653a,null));};exports[_0x0d81('0x28')]=function(_0x51162f,_0x44044a){return db[_0x0d81('0x2e')][_0x0d81('0x4a')]({'where':{'id':_0x51162f[_0x0d81('0x49')]['id']}})[_0x0d81('0x25')](handleEntityNotFound(_0x44044a,null))[_0x0d81('0x25')](removeEntity(_0x44044a,null))[_0x0d81('0x47')](handleError(_0x44044a,null));};exports[_0x0d81('0x54')]=function(_0x18dd3e,_0x4cf9e4){return db['MailQueue'][_0x0d81('0x54')]()['then'](respondWithResult(_0x4cf9e4,null))[_0x0d81('0x47')](handleError(_0x4cf9e4,null));};exports['getMembers']=function(_0x12906d,_0x2c86ef,_0x4f0689){var _0x5e9f46={'raw':!![],'where':{}},_0x34bc85={},_0x553734;return db[_0x0d81('0x2e')][_0x0d81('0x55')]({'where':{'id':_0x12906d[_0x0d81('0x49')]['id']}})[_0x0d81('0x25')](handleEntityNotFound(_0x2c86ef,null))['then'](function(_0x596746){if(_0x596746){_0x553734=_0x596746[_0x0d81('0x56')]({'plain':!![]});_0x34bc85['model']=_[_0x0d81('0x35')](db[_0x0d81('0x57')][_0x0d81('0x2f')]);_0x34bc85[_0x0d81('0x34')]=_[_0x0d81('0x35')](_0x12906d[_0x0d81('0x34')]);_0x34bc85['filters']=_[_0x0d81('0x37')](_0x34bc85[_0x0d81('0x32')],_0x34bc85[_0x0d81('0x34')]);_0x5e9f46[_0x0d81('0x38')]=_[_0x0d81('0x37')](_0x34bc85['model'],qs[_0x0d81('0x39')](_0x12906d[_0x0d81('0x34')][_0x0d81('0x39')]));_0x5e9f46[_0x0d81('0x38')]=_0x5e9f46[_0x0d81('0x38')]['length']?_0x5e9f46[_0x0d81('0x38')]:_0x34bc85[_0x0d81('0x32')];if(!_0x12906d[_0x0d81('0x34')]['hasOwnProperty'](_0x0d81('0x58'))){_0x5e9f46['limit']=qs[_0x0d81('0x1e')](_0x12906d[_0x0d81('0x34')][_0x0d81('0x1e')]);_0x5e9f46[_0x0d81('0x20')]=qs[_0x0d81('0x20')](_0x12906d[_0x0d81('0x34')]['offset']);}_0x5e9f46['order']=qs[_0x0d81('0x3d')](_0x12906d[_0x0d81('0x34')][_0x0d81('0x3d')]);_0x5e9f46[_0x0d81('0x3e')]=qs[_0x0d81('0x36')](_[_0x0d81('0x3f')](_0x12906d[_0x0d81('0x34')],_0x34bc85[_0x0d81('0x36')]));_0x5e9f46[_0x0d81('0x3e')][_0x0d81('0x59')]=_0x596746['id'];if(_0x12906d['query'][_0x0d81('0x42')]){_0x5e9f46[_0x0d81('0x3e')]=_[_0x0d81('0x40')](_0x5e9f46[_0x0d81('0x3e')],{'$or':_[_0x0d81('0x33')](_0x5e9f46[_0x0d81('0x38')],function(_0x2239b2){var _0x4ad412={};_0x4ad412[_0x2239b2]={'$like':'%'+_0x12906d[_0x0d81('0x34')]['filter']+'%'};return _0x4ad412;})});}_0x5e9f46=_[_0x0d81('0x40')]({},_0x5e9f46,_0x12906d[_0x0d81('0x43')]);return db[_0x0d81('0x57')][_0x0d81('0x5a')](_0x5e9f46);}})[_0x0d81('0x25')](function(_0x22579d){if(_0x22579d){return db[_0x0d81('0x5b')][_0x0d81('0x5c')]({'where':{'id':_[_0x0d81('0x33')](_0x22579d,_0x0d81('0x5d')),'role':'agent'},'attributes':['id',_0x0d81('0x2b'),_0x0d81('0x5e'),_0x0d81('0x5f'),_0x0d81('0x60')]});}})[_0x0d81('0x25')](function(_0xe1f5f8){if(_0xe1f5f8){return{'count':_0xe1f5f8[_0x0d81('0x1f')],'rows':_[_0x0d81('0x33')](_0xe1f5f8['rows'],function(_0x47cfbf){return{'membername':_0x47cfbf[_0x0d81('0x2b')],'UserId':_0x47cfbf['id'],'queue_name':_0x553734[_0x0d81('0x2b')],'MailQueueId':_0x553734['id'],'interface':util[_0x0d81('0x61')](_0x0d81('0x62'),_0x0d81('0x63'),_0x47cfbf[_0x0d81('0x2b')]),'penalty':0x0,'paused':_0x47cfbf['mailPause'],'createdAt':_0x47cfbf[_0x0d81('0x60')],'updatedAt':_0x47cfbf[_0x0d81('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2c86ef,_0x5e9f46))['catch'](handleError(_0x2c86ef,null));};exports[_0x0d81('0x64')]=function(_0x11b14b,_0x3a8134,_0x57b9ba){var _0x40faf3={};var _0x23e396={};var _0x1cdd71;var _0x1585ff;return db['MailQueue'][_0x0d81('0x55')]({'where':{'id':_0x11b14b['params']['id']}})[_0x0d81('0x25')](handleEntityNotFound(_0x3a8134,null))[_0x0d81('0x25')](function(_0x389225){if(_0x389225){_0x1cdd71=_0x389225;_0x23e396[_0x0d81('0x32')]=_[_0x0d81('0x35')](db[_0x0d81('0x65')]['rawAttributes']);_0x23e396[_0x0d81('0x34')]=_[_0x0d81('0x35')](_0x11b14b['query']);_0x23e396[_0x0d81('0x36')]=_[_0x0d81('0x37')](_0x23e396[_0x0d81('0x32')],_0x23e396[_0x0d81('0x34')]);_0x40faf3['attributes']=_['intersection'](_0x23e396['model'],qs[_0x0d81('0x39')](_0x11b14b[_0x0d81('0x34')][_0x0d81('0x39')]));_0x40faf3[_0x0d81('0x38')]=_0x40faf3[_0x0d81('0x38')][_0x0d81('0x3a')]?_0x40faf3['attributes']:_0x23e396[_0x0d81('0x32')];_0x40faf3[_0x0d81('0x3c')]=qs[_0x0d81('0x3d')](_0x11b14b[_0x0d81('0x34')][_0x0d81('0x3d')]);_0x40faf3[_0x0d81('0x3e')]=qs[_0x0d81('0x36')](_[_0x0d81('0x3f')](_0x11b14b[_0x0d81('0x34')],_0x23e396['filters']));if(_0x11b14b[_0x0d81('0x34')][_0x0d81('0x42')]){_0x40faf3[_0x0d81('0x3e')]=_[_0x0d81('0x40')](_0x40faf3[_0x0d81('0x3e')],{'$or':_[_0x0d81('0x33')](_0x40faf3['attributes'],function(_0xdef769){var _0x282ab4={};_0x282ab4[_0xdef769]={'$like':'%'+_0x11b14b[_0x0d81('0x34')]['filter']+'%'};return _0x282ab4;})});}_0x40faf3=_['merge']({},_0x40faf3,_0x11b14b['options']);return _0x1cdd71[_0x0d81('0x64')](_0x40faf3);}})['then'](function(_0x26c873){if(_0x26c873){_0x1585ff=_0x26c873[_0x0d81('0x3a')];if(!_0x11b14b[_0x0d81('0x34')][_0x0d81('0x3b')]('nolimit')){_0x40faf3[_0x0d81('0x1e')]=qs[_0x0d81('0x1e')](_0x11b14b[_0x0d81('0x34')][_0x0d81('0x1e')]);_0x40faf3[_0x0d81('0x20')]=qs['offset'](_0x11b14b['query']['offset']);}return _0x1cdd71[_0x0d81('0x64')](_0x40faf3);}})[_0x0d81('0x25')](function(_0x3ff60c){if(_0x3ff60c){return _0x3ff60c?{'count':_0x1585ff,'rows':_0x3ff60c}:null;}})[_0x0d81('0x25')](respondWithResult(_0x3a8134,null))[_0x0d81('0x47')](handleError(_0x3a8134,null));};exports[_0x0d81('0x66')]=function(_0x2e6820,_0x4bdd1c,_0x65af9d){var _0x15223a=_0x2e6820[_0x0d81('0x4c')]['ids'];return db[_0x0d81('0x65')][_0x0d81('0x5a')]({'where':{'id':_0x15223a},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0d81('0x67'),'attributes':['id',_0x0d81('0x2b'),_0x0d81('0x68'),'voicePause',_0x0d81('0x69')],'raw':!![]}]})[_0x0d81('0x25')](function(_0x5e62cb){if(_0x5e62cb){var _0x2d98b8=_[_0x0d81('0x6a')](_0x5e62cb,function(_0xba4ff0){var _0x3dfdc0=_0xba4ff0['get']({'plain':!![]});return _0x3dfdc0[_0x0d81('0x67')];});return db['MailQueue'][_0x0d81('0x4a')]({'where':{'id':_0x2e6820[_0x0d81('0x49')]['id']}})['then'](function(_0x14062b){return db['sequelize'][_0x0d81('0x6b')](function(_0x2a4f1c){return _0x14062b[_0x0d81('0x66')](_0x15223a,{'transaction':_0x2a4f1c})['then'](function(){return BPromise[_0x0d81('0x6c')](_0x2d98b8,function(_0x11b833){return db[_0x0d81('0x57')]['findOrCreate']({'where':{'UserId':_0x11b833['id'],'MailQueueId':_0x2e6820[_0x0d81('0x49')]['id']},'transaction':_0x2a4f1c});});})[_0x0d81('0x25')](function(){_0x2d98b8['forEach'](function(_0x1379f1){socket[_0x0d81('0x6d')]('userMailQueue:save',{'UserId':_0x1379f1['id'],'MailQueueId':_0x14062b['id']});});});});});}})['then'](respondWithStatusCode(_0x4bdd1c,null))[_0x0d81('0x47')](handleError(_0x4bdd1c,null));};exports[_0x0d81('0x6e')]=function(_0x57f9fb,_0x1263be,_0x24cdc2){return db['Team']['findAll']({'where':{'id':_0x57f9fb[_0x0d81('0x34')][_0x0d81('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x0d81('0x5b')],'as':_0x0d81('0x67'),'attributes':['id'],'raw':!![]}]})[_0x0d81('0x25')](handleEntityNotFound(_0x1263be,null))[_0x0d81('0x25')](function(_0x53e340){var _0x2b2ca4=_[_0x0d81('0x33')](_0x53e340,'id');var _0x9f6ed2=[];var _0x2fad24=[];var _0x7cda27=squel[_0x0d81('0x70')]();_0x7cda27['field']('tq.TeamId')[_0x0d81('0x71')](_0x0d81('0x72'),'tq')['join'](_0x0d81('0x73'),'ut',_0x0d81('0x74'))[_0x0d81('0x3e')]('MailQueueId\x20=\x20?',_0x57f9fb[_0x0d81('0x49')]['id']);for(var _0x386268=0x0;_0x386268<_0x53e340['length'];_0x386268+=0x1){let _0x2b42fa=_0x53e340[_0x386268];for(var _0x3ba011=0x0;_0x3ba011<_0x2b42fa['Agents'][_0x0d81('0x3a')];_0x3ba011+=0x1){let _0x318bee=_0x2b42fa[_0x0d81('0x67')][_0x3ba011];var _0x208e3e=_0x7cda27[_0x0d81('0x75')]();_0x208e3e['where'](_0x0d81('0x76'),_0x318bee['id']);_0x2fad24[_0x0d81('0x77')](db['sequelize']['query'](_0x208e3e[_0x0d81('0x78')](),{'type':db['sequelize'][_0x0d81('0x79')][_0x0d81('0x7a')]})[_0x0d81('0x25')](function(_0x3373a4){if(_0x3373a4[_0x0d81('0x3a')]===0x1){return _0x318bee['id'];}else{var _0x2b5951=_['every'](_[_0x0d81('0x33')](_0x3373a4,_0x0d81('0x7b')),function(_0x451e1f){return _[_0x0d81('0x7c')](_0x2b2ca4,_0x451e1f);});if(_0x2b5951){return _0x318bee['id'];}}}));}}return BPromise['all'](_0x2fad24)['then'](function(_0x194f03){_0x9f6ed2=_(_0x9f6ed2)['union'](_0x194f03)[_0x0d81('0x7d')]()[_0x0d81('0x7e')]();return db[_0x0d81('0x2e')]['find']({'where':{'id':_0x57f9fb[_0x0d81('0x49')]['id']}})[_0x0d81('0x25')](function(_0x125205){return db[_0x0d81('0x7f')][_0x0d81('0x6b')](function(_0x555bcb){return _0x125205[_0x0d81('0x6e')](_0x57f9fb[_0x0d81('0x34')][_0x0d81('0x6f')],{'transaction':_0x555bcb})[_0x0d81('0x25')](function(){if(!_[_0x0d81('0x80')](_0x9f6ed2)){return _0x125205[_0x0d81('0x81')](_0x9f6ed2,{'transaction':_0x555bcb});}})[_0x0d81('0x25')](function(){_0x9f6ed2[_0x0d81('0x82')](function(_0x3fccb0){socket[_0x0d81('0x6d')]('userMailQueue:remove',{'UserId':_0x3fccb0,'MailQueueId':_0x125205['id']});});});});});});})[_0x0d81('0x25')](respondWithStatusCode(_0x1263be,null))[_0x0d81('0x47')](handleError(_0x1263be,null));};exports[_0x0d81('0x83')]=function(_0x251373,_0x11c0c1,_0x3dfcbc){return db[_0x0d81('0x2e')][_0x0d81('0x4a')]({'where':{'id':_0x251373['params']['id']}})[_0x0d81('0x25')](handleEntityNotFound(_0x11c0c1,null))[_0x0d81('0x25')](function(_0x55a7c2){if(_0x55a7c2){return _0x55a7c2[_0x0d81('0x83')](_0x251373[_0x0d81('0x4c')][_0x0d81('0x6f')],_['omit'](_0x251373[_0x0d81('0x4c')],[_0x0d81('0x6f'),'id'])||{})[_0x0d81('0x84')](function(_0x538297){for(var _0x3ce99d=0x0;_0x3ce99d<_0x251373[_0x0d81('0x4c')]['ids'][_0x0d81('0x3a')];_0x3ce99d+=0x1){socket[_0x0d81('0x6d')](_0x0d81('0x85'),{'UserId':Number(_0x251373[_0x0d81('0x4c')][_0x0d81('0x6f')][_0x3ce99d]),'MailQueueId':Number(_0x251373[_0x0d81('0x49')]['id'])});}return _0x538297;});}})['then'](respondWithResult(_0x11c0c1,null))[_0x0d81('0x47')](handleError(_0x11c0c1,null));};exports[_0x0d81('0x81')]=function(_0x4f10be,_0x2b2247,_0x5b7d43){return db['MailQueue'][_0x0d81('0x4a')]({'where':{'id':_0x4f10be['params']['id']}})[_0x0d81('0x25')](handleEntityNotFound(_0x2b2247,null))[_0x0d81('0x25')](function(_0x44f51a){if(_0x44f51a){return _0x44f51a['removeAgents'](_0x4f10be[_0x0d81('0x34')]['ids'])[_0x0d81('0x25')](function(){if(_[_0x0d81('0x86')](_0x4f10be[_0x0d81('0x34')][_0x0d81('0x6f')])){for(var _0x365599=0x0;_0x365599<_0x4f10be[_0x0d81('0x34')][_0x0d81('0x6f')][_0x0d81('0x3a')];_0x365599+=0x1){socket['emit'](_0x0d81('0x87'),{'UserId':Number(_0x4f10be['query'][_0x0d81('0x6f')][_0x365599]),'MailQueueId':Number(_0x4f10be[_0x0d81('0x49')]['id'])});}}else{socket[_0x0d81('0x6d')](_0x0d81('0x87'),{'UserId':Number(_0x4f10be[_0x0d81('0x34')]['ids']),'MailQueueId':Number(_0x4f10be[_0x0d81('0x49')]['id'])});}});}})[_0x0d81('0x25')](respondWithStatusCode(_0x2b2247,null))[_0x0d81('0x47')](handleError(_0x2b2247,null));};exports['getAgents']=function(_0x45460c,_0x5c1a7a,_0x4e6205){var _0x517df2={};var _0xe3c4f1={};var _0x2fa142;var _0x4a34e0;return db[_0x0d81('0x2e')][_0x0d81('0x55')]({'where':{'id':_0x45460c['params']['id']}})[_0x0d81('0x25')](handleEntityNotFound(_0x5c1a7a,null))[_0x0d81('0x25')](function(_0x37b87f){if(_0x37b87f){_0x2fa142=_0x37b87f;_0xe3c4f1[_0x0d81('0x32')]=_[_0x0d81('0x35')](db[_0x0d81('0x5b')][_0x0d81('0x2f')]);_0xe3c4f1[_0x0d81('0x34')]=_[_0x0d81('0x35')](_0x45460c['query']);_0xe3c4f1[_0x0d81('0x36')]=_['intersection'](_0xe3c4f1['model'],_0xe3c4f1['query']);_0x517df2['attributes']=_[_0x0d81('0x37')](_0xe3c4f1[_0x0d81('0x32')],qs[_0x0d81('0x39')](_0x45460c[_0x0d81('0x34')][_0x0d81('0x39')]));_0x517df2['attributes']=_0x517df2[_0x0d81('0x38')][_0x0d81('0x3a')]?_0x517df2[_0x0d81('0x38')]:_0xe3c4f1['model'];_0x517df2[_0x0d81('0x3c')]=qs[_0x0d81('0x3d')](_0x45460c[_0x0d81('0x34')][_0x0d81('0x3d')]);_0x517df2[_0x0d81('0x3e')]=qs['filters'](_['pick'](_0x45460c[_0x0d81('0x34')],_0xe3c4f1['filters']));if(_0x45460c[_0x0d81('0x34')][_0x0d81('0x42')]){_0x517df2[_0x0d81('0x3e')]=_['merge'](_0x517df2[_0x0d81('0x3e')],{'$or':_[_0x0d81('0x33')](_0x517df2[_0x0d81('0x38')],function(_0x1734a4){var _0x5d33df={};_0x5d33df[_0x1734a4]={'$like':'%'+_0x45460c['query'][_0x0d81('0x42')]+'%'};return _0x5d33df;})});}_0x517df2=_[_0x0d81('0x40')]({},_0x517df2,_0x45460c['options']);return _0x2fa142[_0x0d81('0x88')](_0x517df2);}})['then'](function(_0x2dd778){if(_0x2dd778){_0x4a34e0=_0x2dd778['length'];if(!_0x45460c[_0x0d81('0x34')][_0x0d81('0x3b')](_0x0d81('0x58'))){_0x517df2[_0x0d81('0x1e')]=qs['limit'](_0x45460c[_0x0d81('0x34')][_0x0d81('0x1e')]);_0x517df2[_0x0d81('0x20')]=qs['offset'](_0x45460c[_0x0d81('0x34')][_0x0d81('0x20')]);}return _0x2fa142[_0x0d81('0x88')](_0x517df2);}})['then'](function(_0x3d7619){if(_0x3d7619){return _0x3d7619?{'count':_0x4a34e0,'rows':_0x3d7619}:null;}})['then'](respondWithResult(_0x5c1a7a,null))[_0x0d81('0x47')](handleError(_0x5c1a7a,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 0da4b80..386dc93 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 _0x666a=['save','update','remove','emit','hook','setMaxListeners'];(function(_0x6767c6,_0xbae02){var _0x30cc74=function(_0x3cc837){while(--_0x3cc837){_0x6767c6['push'](_0x6767c6['shift']());}};_0x30cc74(++_0xbae02);}(_0x666a,0xbf));var _0xa666=function(_0x1ceca7,_0x3f3754){_0x1ceca7=_0x1ceca7-0x0;var _0x1654d9=_0x666a[_0x1ceca7];return _0x1654d9;};'use strict';var EventEmitter=require('events');var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xa666('0x0')](0x0);var events={'afterCreate':_0xa666('0x1'),'afterUpdate':_0xa666('0x2'),'afterDestroy':_0xa666('0x3')};function emitEvent(_0x3141c3){return function(_0x236c57,_0x7d142d,_0x17d7d1){MailQueueEvents['emit'](_0x3141c3+':'+_0x236c57['id'],_0x236c57);MailQueueEvents[_0xa666('0x4')](_0x3141c3,_0x236c57);_0x17d7d1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0xa666('0x5')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0x86e7=['MailQueue','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x86e7,0x10f));var _0x786e=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x86e7[_0x209941];return _0x1e8729;};'use strict';var EventEmitter=require(_0x786e('0x0'));var MailQueue=require('../../mysqldb')['db'][_0x786e('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x786e('0x2'),'afterUpdate':_0x786e('0x3'),'afterDestroy':_0x786e('0x4')};function emitEvent(_0x5759df){return function(_0x4c35e3,_0x15fd1c,_0x344fa8){MailQueueEvents[_0x786e('0x5')](_0x5759df+':'+_0x4c35e3['id'],_0x4c35e3);MailQueueEvents['emit'](_0x5759df,_0x4c35e3);_0x344fa8(null);};}for(var e in events){if(events[_0x786e('0x6')](e)){var event=events[e];MailQueue[_0x786e('0x7')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 4e08208..24b74ca 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 _0x940f=['request-promise','path','rimraf','./mailQueue.attributes','exports','MailQueue','lodash','../../config/logger','moment','bluebird'];(function(_0x4df06f,_0x468fb0){var _0x2fa5cb=function(_0x222a4f){while(--_0x222a4f){_0x4df06f['push'](_0x4df06f['shift']());}};_0x2fa5cb(++_0x468fb0);}(_0x940f,0x1c8));var _0xf940=function(_0x590feb,_0x3055d9){_0x590feb=_0x590feb-0x0;var _0x3901bb=_0x940f[_0x590feb];return _0x3901bb;};'use strict';var _=require(_0xf940('0x0'));var util=require('util');var logger=require(_0xf940('0x1'))('api');var moment=require(_0xf940('0x2'));var BPromise=require(_0xf940('0x3'));var rp=require(_0xf940('0x4'));var fs=require('fs');var path=require(_0xf940('0x5'));var rimraf=require(_0xf940('0x6'));var config=require('../../config/environment');var attributes=require(_0xf940('0x7'));module[_0xf940('0x8')]=function(_0x2fb0fe,_0x41c12a){return _0x2fb0fe['define'](_0xf940('0x9'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x959a=['define','MailQueue','mail_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueue.attributes'];(function(_0x40ced5,_0x2b8fe9){var _0x51024e=function(_0xa97f42){while(--_0xa97f42){_0x40ced5['push'](_0x40ced5['shift']());}};_0x51024e(++_0x2b8fe9);}(_0x959a,0x13b));var _0xa959=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x959a[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xa959('0x0'));var util=require(_0xa959('0x1'));var logger=require('../../config/logger')(_0xa959('0x2'));var moment=require(_0xa959('0x3'));var BPromise=require(_0xa959('0x4'));var rp=require(_0xa959('0x5'));var fs=require('fs');var path=require(_0xa959('0x6'));var rimraf=require(_0xa959('0x7'));var config=require(_0xa959('0x8'));var attributes=require(_0xa959('0x9'));module['exports']=function(_0x4485d4,_0x23c21d){return _0x4485d4[_0xa959('0xa')](_0xa959('0xb'),attributes,{'tableName':_0xa959('0xc'),'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 d7f2f0b..1343844 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 _0x5e4b=['where','attributes','include','map','model','ShowMailQueue','MailQueue','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./mailQueue.socket','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','catch','GetMailQueue','findAll','options','raw'];(function(_0x3b93ef,_0x5b9eac){var _0x3cef85=function(_0x8bb24f){while(--_0x8bb24f){_0x3b93ef['push'](_0x3b93ef['shift']());}};_0x3cef85(++_0x5b9eac);}(_0x5e4b,0x7a));var _0xb5e4=function(_0xd1d19a,_0x1933f0){_0xd1d19a=_0xd1d19a-0x0;var _0x52a79d=_0x5e4b[_0xd1d19a];return _0x52a79d;};'use strict';var _=require('lodash');var util=require(_0xb5e4('0x0'));var moment=require(_0xb5e4('0x1'));var BPromise=require('bluebird');var rs=require(_0xb5e4('0x2'));var fs=require('fs');var Redis=require(_0xb5e4('0x3'));var db=require(_0xb5e4('0x4'))['db'];var utils=require(_0xb5e4('0x5'));var logger=require(_0xb5e4('0x6'))(_0xb5e4('0x7'));var config=require(_0xb5e4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb5e4('0x9')]['http']({'port':0x232a});config[_0xb5e4('0xa')]=_['defaults'](config['redis'],{'host':_0xb5e4('0xb'),'port':0x18eb});var socket=require(_0xb5e4('0xc'))(new Redis(config[_0xb5e4('0xa')]));require(_0xb5e4('0xd'))[_0xb5e4('0xe')](socket);function respondWithRpcPromise(_0x5c8bc3,_0x35e23e,_0x504118){return new BPromise(function(_0x1ca950,_0xa0902f){return client[_0xb5e4('0xf')](_0x5c8bc3,_0x504118)[_0xb5e4('0x10')](function(_0x47bf1d){logger['info'](_0xb5e4('0x11'),_0x35e23e,_0xb5e4('0x12'));logger[_0xb5e4('0x13')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x35e23e,_0xb5e4('0x12'),JSON[_0xb5e4('0x14')](_0x47bf1d));if(_0x47bf1d['error']){if(_0x47bf1d['error'][_0xb5e4('0x15')]===0x1f4){logger[_0xb5e4('0x16')]('MailQueue,\x20%s,\x20%s',_0x35e23e,_0x47bf1d[_0xb5e4('0x16')][_0xb5e4('0x17')]);return _0xa0902f(_0x47bf1d[_0xb5e4('0x16')][_0xb5e4('0x17')]);}logger[_0xb5e4('0x16')](_0xb5e4('0x11'),_0x35e23e,_0x47bf1d[_0xb5e4('0x16')][_0xb5e4('0x17')]);return _0x1ca950(_0x47bf1d[_0xb5e4('0x16')][_0xb5e4('0x17')]);}else{logger[_0xb5e4('0x18')](_0xb5e4('0x11'),_0x35e23e,_0xb5e4('0x12'));_0x1ca950(_0x47bf1d['result']['message']);}})[_0xb5e4('0x19')](function(_0x2d119a){logger[_0xb5e4('0x16')](_0xb5e4('0x11'),_0x35e23e,_0x2d119a);_0xa0902f(_0x2d119a);});});}exports[_0xb5e4('0x1a')]=function(_0x1bcd21){var _0x147cd3=this;return new Promise(function(_0x2597f9,_0x206be5){return db['MailQueue'][_0xb5e4('0x1b')]({'raw':_0x1bcd21['options']?_0x1bcd21[_0xb5e4('0x1c')][_0xb5e4('0x1d')]===undefined?!![]:![]:!![],'where':_0x1bcd21[_0xb5e4('0x1c')]?_0x1bcd21[_0xb5e4('0x1c')][_0xb5e4('0x1e')]||null:null,'attributes':_0x1bcd21[_0xb5e4('0x1c')]?_0x1bcd21[_0xb5e4('0x1c')][_0xb5e4('0x1f')]||null:null,'limit':_0x1bcd21[_0xb5e4('0x1c')]?_0x1bcd21['options']['limit']||null:null,'include':_0x1bcd21['options']?_0x1bcd21[_0xb5e4('0x1c')][_0xb5e4('0x20')]?_[_0xb5e4('0x21')](_0x1bcd21['options'][_0xb5e4('0x20')],function(_0x2414b4){return{'model':db[_0x2414b4[_0xb5e4('0x22')]],'as':_0x2414b4['as'],'attributes':_0x2414b4[_0xb5e4('0x1f')],'include':_0x2414b4[_0xb5e4('0x20')]?_['map'](_0x2414b4[_0xb5e4('0x20')],function(_0x2311c7){return{'model':db[_0x2311c7['model']],'as':_0x2311c7['as'],'attributes':_0x2311c7[_0xb5e4('0x1f')],'include':_0x2311c7[_0xb5e4('0x20')]?_[_0xb5e4('0x21')](_0x2311c7[_0xb5e4('0x20')],function(_0xffcb75){return{'model':db[_0xffcb75[_0xb5e4('0x22')]],'as':_0xffcb75['as'],'attributes':_0xffcb75[_0xb5e4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xb5e4('0x10')](function(_0x2691b3){logger[_0xb5e4('0x18')](_0xb5e4('0x1a'),_0x1bcd21);logger[_0xb5e4('0x13')](_0xb5e4('0x1a'),_0x1bcd21,JSON['stringify'](_0x2691b3));_0x2597f9(_0x2691b3);})[_0xb5e4('0x19')](function(_0x26f6f7){logger[_0xb5e4('0x16')](_0xb5e4('0x1a'),_0x26f6f7['message'],_0x1bcd21);_0x206be5(_0x147cd3[_0xb5e4('0x16')](0x1f4,_0x26f6f7['message']));});});};exports[_0xb5e4('0x23')]=function(_0xdf6a19){var _0x205d02=this;return new Promise(function(_0x8c8835,_0x47106d){return db[_0xb5e4('0x24')][_0xb5e4('0x25')]({'raw':_0xdf6a19['options']?_0xdf6a19[_0xb5e4('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xdf6a19[_0xb5e4('0x1c')]?_0xdf6a19[_0xb5e4('0x1c')][_0xb5e4('0x1e')]||null:null,'attributes':_0xdf6a19[_0xb5e4('0x1c')]?_0xdf6a19[_0xb5e4('0x1c')][_0xb5e4('0x1f')]||null:null,'include':_0xdf6a19[_0xb5e4('0x1c')]?_0xdf6a19['options']['include']?_[_0xb5e4('0x21')](_0xdf6a19['options']['include'],function(_0x594fd3){return{'model':db[_0x594fd3[_0xb5e4('0x22')]],'as':_0x594fd3['as'],'attributes':_0x594fd3[_0xb5e4('0x1f')],'include':_0x594fd3[_0xb5e4('0x20')]?_['map'](_0x594fd3[_0xb5e4('0x20')],function(_0x5920fb){return{'model':db[_0x5920fb[_0xb5e4('0x22')]],'as':_0x5920fb['as'],'attributes':_0x5920fb[_0xb5e4('0x1f')],'include':_0x5920fb[_0xb5e4('0x20')]?_['map'](_0x5920fb['include'],function(_0x1b7866){return{'model':db[_0x1b7866['model']],'as':_0x1b7866['as'],'attributes':_0x1b7866['attributes']};}):[]};}):[]};}):[]:[]})[_0xb5e4('0x10')](function(_0x1435b3){logger[_0xb5e4('0x18')](_0xb5e4('0x23'),_0xdf6a19);logger['debug'](_0xb5e4('0x23'),_0xdf6a19,JSON['stringify'](_0x1435b3));_0x8c8835(_0x1435b3);})[_0xb5e4('0x19')](function(_0x3e405a){logger['error'](_0xb5e4('0x23'),_0x3e405a[_0xb5e4('0x17')],_0xdf6a19);_0x47106d(_0x205d02[_0xb5e4('0x16')](0x1f4,_0x3e405a['message']));});});}; \ No newline at end of file +var _0xd5fe=['MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetMailQueue','findAll','raw','options','where','limit','map','include','model','attributes','catch','ShowMailQueue','find','lodash','util','bluebird','ioredis','../../config/logger','rpc','client','http','redis','defaults','localhost','register','request','then','MailQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1c95ab,_0x40197d){var _0x2fc8db=function(_0x220b17){while(--_0x220b17){_0x1c95ab['push'](_0x1c95ab['shift']());}};_0x2fc8db(++_0x40197d);}(_0xd5fe,0x1ab));var _0xed5f=function(_0x2e6dbf,_0x57dd06){_0x2e6dbf=_0x2e6dbf-0x0;var _0x2680e5=_0xd5fe[_0x2e6dbf];return _0x2680e5;};'use strict';var _=require(_0xed5f('0x0'));var util=require(_0xed5f('0x1'));var moment=require('moment');var BPromise=require(_0xed5f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xed5f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xed5f('0x4'))(_0xed5f('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xed5f('0x6')][_0xed5f('0x7')]({'port':0x232a});config[_0xed5f('0x8')]=_[_0xed5f('0x9')](config[_0xed5f('0x8')],{'host':_0xed5f('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xed5f('0x8')]));require('./mailQueue.socket')[_0xed5f('0xb')](socket);function respondWithRpcPromise(_0x580e2e,_0x1910ee,_0x34806f){return new BPromise(function(_0x4ae013,_0x2b5155){return client[_0xed5f('0xc')](_0x580e2e,_0x34806f)[_0xed5f('0xd')](function(_0x17ed13){logger['info'](_0xed5f('0xe'),_0x1910ee,_0xed5f('0xf'));logger[_0xed5f('0x10')](_0xed5f('0x11'),_0x1910ee,'request\x20sent',JSON[_0xed5f('0x12')](_0x17ed13));if(_0x17ed13[_0xed5f('0x13')]){if(_0x17ed13[_0xed5f('0x13')][_0xed5f('0x14')]===0x1f4){logger[_0xed5f('0x13')](_0xed5f('0xe'),_0x1910ee,_0x17ed13[_0xed5f('0x13')][_0xed5f('0x15')]);return _0x2b5155(_0x17ed13[_0xed5f('0x13')][_0xed5f('0x15')]);}logger[_0xed5f('0x13')](_0xed5f('0xe'),_0x1910ee,_0x17ed13[_0xed5f('0x13')]['message']);return _0x4ae013(_0x17ed13[_0xed5f('0x13')][_0xed5f('0x15')]);}else{logger[_0xed5f('0x16')]('MailQueue,\x20%s,\x20%s',_0x1910ee,_0xed5f('0xf'));_0x4ae013(_0x17ed13[_0xed5f('0x17')][_0xed5f('0x15')]);}})['catch'](function(_0x464fb4){logger[_0xed5f('0x13')](_0xed5f('0xe'),_0x1910ee,_0x464fb4);_0x2b5155(_0x464fb4);});});}exports[_0xed5f('0x18')]=function(_0x2750fc){var _0xd3ca42=this;return new Promise(function(_0x56657c,_0x304bd9){return db['MailQueue'][_0xed5f('0x19')]({'raw':_0x2750fc['options']?_0x2750fc['options'][_0xed5f('0x1a')]===undefined?!![]:![]:!![],'where':_0x2750fc[_0xed5f('0x1b')]?_0x2750fc['options'][_0xed5f('0x1c')]||null:null,'attributes':_0x2750fc['options']?_0x2750fc['options']['attributes']||null:null,'limit':_0x2750fc[_0xed5f('0x1b')]?_0x2750fc[_0xed5f('0x1b')][_0xed5f('0x1d')]||null:null,'include':_0x2750fc[_0xed5f('0x1b')]?_0x2750fc[_0xed5f('0x1b')]['include']?_[_0xed5f('0x1e')](_0x2750fc[_0xed5f('0x1b')][_0xed5f('0x1f')],function(_0x151037){return{'model':db[_0x151037[_0xed5f('0x20')]],'as':_0x151037['as'],'attributes':_0x151037[_0xed5f('0x21')],'include':_0x151037[_0xed5f('0x1f')]?_[_0xed5f('0x1e')](_0x151037[_0xed5f('0x1f')],function(_0x2980f6){return{'model':db[_0x2980f6[_0xed5f('0x20')]],'as':_0x2980f6['as'],'attributes':_0x2980f6['attributes'],'include':_0x2980f6[_0xed5f('0x1f')]?_[_0xed5f('0x1e')](_0x2980f6[_0xed5f('0x1f')],function(_0x3c7906){return{'model':db[_0x3c7906['model']],'as':_0x3c7906['as'],'attributes':_0x3c7906['attributes']};}):[]};}):[]};}):[]:[]})[_0xed5f('0xd')](function(_0x2883db){logger[_0xed5f('0x16')](_0xed5f('0x18'),_0x2750fc);logger[_0xed5f('0x10')](_0xed5f('0x18'),_0x2750fc,JSON[_0xed5f('0x12')](_0x2883db));_0x56657c(_0x2883db);})[_0xed5f('0x22')](function(_0x218831){logger[_0xed5f('0x13')](_0xed5f('0x18'),_0x218831['message'],_0x2750fc);_0x304bd9(_0xd3ca42[_0xed5f('0x13')](0x1f4,_0x218831[_0xed5f('0x15')]));});});};exports[_0xed5f('0x23')]=function(_0x466b25){var _0x5d2227=this;return new Promise(function(_0x43e845,_0x28c1d8){return db['MailQueue'][_0xed5f('0x24')]({'raw':_0x466b25['options']?_0x466b25[_0xed5f('0x1b')][_0xed5f('0x1a')]===undefined?!![]:![]:!![],'where':_0x466b25[_0xed5f('0x1b')]?_0x466b25['options']['where']||null:null,'attributes':_0x466b25[_0xed5f('0x1b')]?_0x466b25['options'][_0xed5f('0x21')]||null:null,'include':_0x466b25[_0xed5f('0x1b')]?_0x466b25[_0xed5f('0x1b')]['include']?_[_0xed5f('0x1e')](_0x466b25[_0xed5f('0x1b')]['include'],function(_0x1101fe){return{'model':db[_0x1101fe['model']],'as':_0x1101fe['as'],'attributes':_0x1101fe[_0xed5f('0x21')],'include':_0x1101fe[_0xed5f('0x1f')]?_['map'](_0x1101fe['include'],function(_0x52d6f9){return{'model':db[_0x52d6f9[_0xed5f('0x20')]],'as':_0x52d6f9['as'],'attributes':_0x52d6f9[_0xed5f('0x21')],'include':_0x52d6f9['include']?_[_0xed5f('0x1e')](_0x52d6f9[_0xed5f('0x1f')],function(_0x52be9c){return{'model':db[_0x52be9c[_0xed5f('0x20')]],'as':_0x52be9c['as'],'attributes':_0x52be9c['attributes']};}):[]};}):[]};}):[]:[]})[_0xed5f('0xd')](function(_0x3b8d10){logger[_0xed5f('0x16')](_0xed5f('0x23'),_0x466b25);logger[_0xed5f('0x10')](_0xed5f('0x23'),_0x466b25,JSON[_0xed5f('0x12')](_0x3b8d10));_0x43e845(_0x3b8d10);})[_0xed5f('0x22')](function(_0x2f97b9){logger['error']('ShowMailQueue',_0x2f97b9[_0xed5f('0x15')],_0x466b25);_0x28c1d8(_0x5d2227[_0xed5f('0x13')](0x1f4,_0x2f97b9[_0xed5f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 58c836c..7f587fb 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 _0xf929=['removeListener','register','length','mailQueue:','./mailQueue.events','remove','update','emit'];(function(_0x5e9e30,_0x55b114){var _0x493af5=function(_0x2eb96b){while(--_0x2eb96b){_0x5e9e30['push'](_0x5e9e30['shift']());}};_0x493af5(++_0x55b114);}(_0xf929,0x164));var _0x9f92=function(_0x23b110,_0x1173ba){_0x23b110=_0x23b110-0x0;var _0x39d441=_0xf929[_0x23b110];return _0x39d441;};'use strict';var MailQueueEvents=require(_0x9f92('0x0'));var events=['save',_0x9f92('0x1'),_0x9f92('0x2')];function createListener(_0x55d60d,_0x451ded){return function(_0x366b0d){_0x451ded[_0x9f92('0x3')](_0x55d60d,_0x366b0d);};}function removeListener(_0x5840d9,_0x3aca39){return function(){MailQueueEvents[_0x9f92('0x4')](_0x5840d9,_0x3aca39);};}exports[_0x9f92('0x5')]=function(_0x2fbe4d){for(var _0x396372=0x0,_0x29a770=events[_0x9f92('0x6')];_0x396372<_0x29a770;_0x396372++){var _0x5f343f=events[_0x396372];var _0x98a2f5=createListener(_0x9f92('0x7')+_0x5f343f,_0x2fbe4d);MailQueueEvents['on'](_0x5f343f,_0x98a2f5);}}; \ No newline at end of file +var _0xa810=['remove','update','emit','removeListener','length','./mailQueue.events'];(function(_0x2c98db,_0x19a9e6){var _0x1b2142=function(_0xbea8d7){while(--_0xbea8d7){_0x2c98db['push'](_0x2c98db['shift']());}};_0x1b2142(++_0x19a9e6);}(_0xa810,0x101));var _0x0a81=function(_0x460358,_0x45d45e){_0x460358=_0x460358-0x0;var _0x2e6a60=_0xa810[_0x460358];return _0x2e6a60;};'use strict';var MailQueueEvents=require(_0x0a81('0x0'));var events=['save',_0x0a81('0x1'),_0x0a81('0x2')];function createListener(_0x33b312,_0xbef888){return function(_0x4465c6){_0xbef888[_0x0a81('0x3')](_0x33b312,_0x4465c6);};}function removeListener(_0x16f901,_0xbd6ce){return function(){MailQueueEvents[_0x0a81('0x4')](_0x16f901,_0xbd6ce);};}exports['register']=function(_0x10bce9){for(var _0x1cf7d1=0x0,_0x3d51d9=events[_0x0a81('0x5')];_0x1cf7d1<_0x3d51d9;_0x1cf7d1++){var _0x19f96a=events[_0x1cf7d1];var _0x5f040f=createListener('mailQueue:'+_0x19f96a,_0x10bce9);MailQueueEvents['on'](_0x19f96a,_0x5f040f);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 7afcb21..b71f740 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 _0xddeb=['put','/:id','update','delete','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x459a97,_0x3d2ece){var _0x56bb18=function(_0x2375d9){while(--_0x2375d9){_0x459a97['push'](_0x459a97['shift']());}};_0x56bb18(++_0x3d2ece);}(_0xddeb,0x10f));var _0xbdde=function(_0x38854e,_0x23cbc9){_0x38854e=_0x38854e-0x0;var _0x3f8415=_0xddeb[_0x38854e];return _0x3f8415;};'use strict';var multer=require('multer');var util=require(_0xbdde('0x0'));var path=require(_0xbdde('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbdde('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xbdde('0x3'));var interaction=require(_0xbdde('0x4'));var config=require(_0xbdde('0x5'));var controller=require('./mailQueueReport.controller');router[_0xbdde('0x6')]('/',auth[_0xbdde('0x7')](),controller[_0xbdde('0x8')]);router[_0xbdde('0x6')](_0xbdde('0x9'),auth[_0xbdde('0x7')](),controller[_0xbdde('0xa')]);router[_0xbdde('0x6')]('/:id',auth[_0xbdde('0x7')](),controller[_0xbdde('0xb')]);router[_0xbdde('0xc')]('/',auth[_0xbdde('0x7')](),controller[_0xbdde('0xd')]);router[_0xbdde('0xe')](_0xbdde('0xf'),auth[_0xbdde('0x7')](),controller[_0xbdde('0x10')]);router[_0xbdde('0x11')]('/:id',auth[_0xbdde('0x7')](),controller['destroy']);module[_0xbdde('0x12')]=router; \ No newline at end of file +var _0x869d=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','Router','fs-extra','../../config/environment','./mailQueueReport.controller','isAuthenticated','get','/describe','describe','show'];(function(_0x107ce5,_0x3978f2){var _0x15bf71=function(_0x3ea69e){while(--_0x3ea69e){_0x107ce5['push'](_0x107ce5['shift']());}};_0x15bf71(++_0x3978f2);}(_0x869d,0x6c));var _0xd869=function(_0x4de1a4,_0x3d21d7){_0x4de1a4=_0x4de1a4-0x0;var _0x2be3fb=_0x869d[_0x4de1a4];return _0x2be3fb;};'use strict';var multer=require(_0xd869('0x0'));var util=require(_0xd869('0x1'));var path=require(_0xd869('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd869('0x3')]();var fs_extra=require(_0xd869('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd869('0x5'));var controller=require(_0xd869('0x6'));router['get']('/',auth[_0xd869('0x7')](),controller['index']);router[_0xd869('0x8')](_0xd869('0x9'),auth[_0xd869('0x7')](),controller[_0xd869('0xa')]);router[_0xd869('0x8')]('/:id',auth[_0xd869('0x7')](),controller[_0xd869('0xb')]);router[_0xd869('0xc')]('/',auth[_0xd869('0x7')](),controller[_0xd869('0xd')]);router[_0xd869('0xe')](_0xd869('0xf'),auth[_0xd869('0x7')](),controller[_0xd869('0x10')]);router[_0xd869('0x11')]('/:id',auth[_0xd869('0x7')](),controller[_0xd869('0x12')]);module[_0xd869('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index ea317ed..712f667 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 _0x7f90=['sequelize','STRING','DATE'];(function(_0x434b31,_0x1cc3f3){var _0x49dee7=function(_0x857d0e){while(--_0x857d0e){_0x434b31['push'](_0x434b31['shift']());}};_0x49dee7(++_0x1cc3f3);}(_0x7f90,0x1c5));var _0x07f9=function(_0x53f5bb,_0x5d45ce){_0x53f5bb=_0x53f5bb-0x0;var _0x4de461=_0x7f90[_0x53f5bb];return _0x4de461;};'use strict';var moment=require('moment');var Sequelize=require(_0x07f9('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x07f9('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x07f9('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x07f9('0x2')]},'reason':{'type':Sequelize[_0x07f9('0x1')]}}; \ No newline at end of file +var _0x7e88=['STRING','DATE','moment'];(function(_0x5a65c4,_0xecc8ed){var _0x2d5a3c=function(_0x33416d){while(--_0x33416d){_0x5a65c4['push'](_0x5a65c4['shift']());}};_0x2d5a3c(++_0xecc8ed);}(_0x7e88,0x149));var _0x87e8=function(_0x5908f7,_0x1c8a3b){_0x5908f7=_0x5908f7-0x0;var _0x453fc8=_0x7e88[_0x5908f7];return _0x453fc8;};'use strict';var moment=require(_0x87e8('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x87e8('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x87e8('0x1')]},'joinAt':{'type':Sequelize[_0x87e8('0x2')]},'leaveAt':{'type':Sequelize[_0x87e8('0x2')]},'acceptAt':{'type':Sequelize[_0x87e8('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x87e8('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index 7077f12..f9a432d 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 _0x1a37=['index','map','MailQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','show','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1a37,0xb4));var _0x71a3=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x1a37[_0x53ccf2];return _0x5a2964;};'use strict';var emlformat=require(_0x71a3('0x0'));var rimraf=require(_0x71a3('0x1'));var zipdir=require(_0x71a3('0x2'));var jsonpatch=require(_0x71a3('0x3'));var rp=require(_0x71a3('0x4'));var moment=require(_0x71a3('0x5'));var BPromise=require(_0x71a3('0x6'));var Mustache=require(_0x71a3('0x7'));var util=require(_0x71a3('0x8'));var path=require(_0x71a3('0x9'));var sox=require('sox');var csv=require(_0x71a3('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x71a3('0xb'));var _=require(_0x71a3('0xc'));var squel=require(_0x71a3('0xd'));var crypto=require(_0x71a3('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x71a3('0xf'));var Redis=require(_0x71a3('0x10'));var authService=require(_0x71a3('0x11'));var qs=require(_0x71a3('0x12'));var as=require(_0x71a3('0x13'));var hardwareService=require(_0x71a3('0x14'));var logger=require(_0x71a3('0x15'))(_0x71a3('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x71a3('0x17'))['db'];function respondWithStatusCode(_0x3830cb,_0x27e46d){_0x27e46d=_0x27e46d||0xcc;return function(_0x229134){if(_0x229134){return _0x3830cb[_0x71a3('0x18')](_0x27e46d);}return _0x3830cb[_0x71a3('0x19')](_0x27e46d)[_0x71a3('0x1a')]();};}function respondWithResult(_0x3b256c,_0x4dc4ed){_0x4dc4ed=_0x4dc4ed||0xc8;return function(_0x203ee1){if(_0x203ee1){return _0x3b256c[_0x71a3('0x19')](_0x4dc4ed)['json'](_0x203ee1);}};}function respondWithFilteredResult(_0x1743d7,_0x32591a){return function(_0x59021f){if(_0x59021f){var _0x4aa918=typeof _0x32591a[_0x71a3('0x1b')]===_0x71a3('0x1c')&&typeof _0x32591a[_0x71a3('0x1d')]===_0x71a3('0x1c');var _0x1af1bc=_0x59021f[_0x71a3('0x1e')];var _0x5d4dee=_0x4aa918?0x0:_0x32591a[_0x71a3('0x1b')];var _0x27bfb4=_0x4aa918?_0x59021f['count']:_0x32591a['offset']+_0x32591a[_0x71a3('0x1d')];var _0x250db3;if(_0x27bfb4>=_0x1af1bc){_0x27bfb4=_0x1af1bc;_0x250db3=0xc8;}else{_0x250db3=0xce;}_0x1743d7[_0x71a3('0x19')](_0x250db3);return _0x1743d7[_0x71a3('0x1f')](_0x71a3('0x20'),_0x5d4dee+'-'+_0x27bfb4+'/'+_0x1af1bc)['json'](_0x59021f);}return null;};}function patchUpdates(_0x1ab947){return function(_0x4156e1){try{jsonpatch[_0x71a3('0x21')](_0x4156e1,_0x1ab947,!![]);}catch(_0x3ea036){return BPromise[_0x71a3('0x22')](_0x3ea036);}return _0x4156e1['save']();};}function saveUpdates(_0x1af24b,_0x5bbaee){return function(_0x3bf78e){if(_0x3bf78e){return _0x3bf78e[_0x71a3('0x23')](_0x1af24b)[_0x71a3('0x24')](function(_0x21899d){return _0x21899d;});}return null;};}function removeEntity(_0x452bc4,_0x2847b4){return function(_0x5f33c5){if(_0x5f33c5){return _0x5f33c5[_0x71a3('0x25')]()[_0x71a3('0x24')](function(){_0x452bc4[_0x71a3('0x19')](0xcc)[_0x71a3('0x1a')]();});}};}function handleEntityNotFound(_0xb0f3aa,_0x4fd214){return function(_0x107fbd){if(!_0x107fbd){_0xb0f3aa[_0x71a3('0x18')](0x194);}return _0x107fbd;};}function handleError(_0x4c1a3d,_0x412746){_0x412746=_0x412746||0x1f4;return function(_0x515519){logger[_0x71a3('0x26')](_0x515519[_0x71a3('0x27')]);if(_0x515519[_0x71a3('0x28')]){delete _0x515519[_0x71a3('0x28')];}_0x4c1a3d[_0x71a3('0x19')](_0x412746)[_0x71a3('0x29')](_0x515519);};}exports[_0x71a3('0x2a')]=function(_0x242b85,_0x305eb1){var _0x3fc578={},_0x3ea7aa={},_0x228afa={'count':0x0,'rows':[]};var _0x51cde3=_[_0x71a3('0x2b')](db[_0x71a3('0x2c')][_0x71a3('0x2d')],function(_0x23ae85){return{'name':_0x23ae85['fieldName'],'type':_0x23ae85[_0x71a3('0x2e')][_0x71a3('0x2f')]};});_0x3ea7aa[_0x71a3('0x30')]=_[_0x71a3('0x2b')](_0x51cde3,_0x71a3('0x28'));_0x3ea7aa[_0x71a3('0x31')]=_[_0x71a3('0x32')](_0x242b85['query']);_0x3ea7aa[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],_0x3ea7aa[_0x71a3('0x31')]);_0x3fc578[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x3ea7aa[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x36')]));_0x3fc578[_0x71a3('0x35')]=_0x3fc578[_0x71a3('0x35')][_0x71a3('0x37')]?_0x3fc578['attributes']:_0x3ea7aa['model'];if(!_0x242b85[_0x71a3('0x31')][_0x71a3('0x38')]('nolimit')){_0x3fc578[_0x71a3('0x1d')]=qs[_0x71a3('0x1d')](_0x242b85['query'][_0x71a3('0x1d')]);_0x3fc578[_0x71a3('0x1b')]=qs[_0x71a3('0x1b')](_0x242b85[_0x71a3('0x31')][_0x71a3('0x1b')]);}_0x3fc578[_0x71a3('0x39')]=qs[_0x71a3('0x3a')](_0x242b85['query'][_0x71a3('0x3a')]);_0x3fc578[_0x71a3('0x3b')]=qs[_0x71a3('0x33')](_['pick'](_0x242b85[_0x71a3('0x31')],_0x3ea7aa[_0x71a3('0x33')]),_0x51cde3);if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]){_0x3fc578[_0x71a3('0x3b')]=_['merge'](_0x3fc578['where'],{'$or':_[_0x71a3('0x2b')](_0x51cde3,function(_0x2b3197){if(_0x2b3197[_0x71a3('0x2e')]!==_0x71a3('0x3d')){var _0x36ed2e={};_0x36ed2e[_0x2b3197['name']]={'$like':'%'+_0x242b85[_0x71a3('0x31')][_0x71a3('0x3c')]+'%'};return _0x36ed2e;}})});}_0x3fc578=_[_0x71a3('0x3e')]({},_0x3fc578,_0x242b85['options']);var _0x17c467={'where':_0x3fc578['where']};return db[_0x71a3('0x2c')][_0x71a3('0x1e')](_0x17c467)[_0x71a3('0x24')](function(_0x43c6d1){_0x228afa[_0x71a3('0x1e')]=_0x43c6d1;if(_0x242b85[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x3fc578[_0x71a3('0x40')]=[{'all':!![]}];}return db[_0x71a3('0x2c')][_0x71a3('0x41')](_0x3fc578);})['then'](function(_0xa49846){_0x228afa['rows']=_0xa49846;return _0x228afa;})[_0x71a3('0x24')](respondWithFilteredResult(_0x305eb1,_0x3fc578))[_0x71a3('0x42')](handleError(_0x305eb1,null));};exports[_0x71a3('0x43')]=function(_0x18974c,_0x59c7c9){var _0x412bce={'raw':!![],'where':{'id':_0x18974c['params']['id']}},_0x4b4fde={};_0x4b4fde[_0x71a3('0x30')]=_[_0x71a3('0x32')](db[_0x71a3('0x2c')][_0x71a3('0x2d')]);_0x4b4fde['query']=_[_0x71a3('0x32')](_0x18974c[_0x71a3('0x31')]);_0x4b4fde[_0x71a3('0x33')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],_0x4b4fde[_0x71a3('0x31')]);_0x412bce[_0x71a3('0x35')]=_[_0x71a3('0x34')](_0x4b4fde[_0x71a3('0x30')],qs[_0x71a3('0x36')](_0x18974c[_0x71a3('0x31')][_0x71a3('0x36')]));_0x412bce[_0x71a3('0x35')]=_0x412bce[_0x71a3('0x35')][_0x71a3('0x37')]?_0x412bce[_0x71a3('0x35')]:_0x4b4fde['model'];if(_0x18974c[_0x71a3('0x31')][_0x71a3('0x3f')]){_0x412bce['include']=[{'all':!![]}];}_0x412bce=_[_0x71a3('0x3e')]({},_0x412bce,_0x18974c[_0x71a3('0x44')]);return db[_0x71a3('0x2c')][_0x71a3('0x45')](_0x412bce)[_0x71a3('0x24')](handleEntityNotFound(_0x59c7c9,null))['then'](respondWithResult(_0x59c7c9,null))['catch'](handleError(_0x59c7c9,null));};exports[_0x71a3('0x46')]=function(_0x4305ee,_0x51d20d){return db[_0x71a3('0x2c')][_0x71a3('0x46')](_0x4305ee[_0x71a3('0x47')],{})[_0x71a3('0x24')](respondWithResult(_0x51d20d,0xc9))[_0x71a3('0x42')](handleError(_0x51d20d,null));};exports[_0x71a3('0x23')]=function(_0x501a62,_0x1c9ba6){if(_0x501a62['body']['id']){delete _0x501a62[_0x71a3('0x47')]['id'];}return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x501a62[_0x71a3('0x48')]['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x1c9ba6,null))['then'](saveUpdates(_0x501a62[_0x71a3('0x47')],null))[_0x71a3('0x24')](respondWithResult(_0x1c9ba6,null))[_0x71a3('0x42')](handleError(_0x1c9ba6,null));};exports['destroy']=function(_0x6c34,_0x4e6423){return db[_0x71a3('0x2c')][_0x71a3('0x45')]({'where':{'id':_0x6c34['params']['id']}})[_0x71a3('0x24')](handleEntityNotFound(_0x4e6423,null))[_0x71a3('0x24')](removeEntity(_0x4e6423,null))[_0x71a3('0x42')](handleError(_0x4e6423,null));};exports[_0x71a3('0x49')]=function(_0x11391d,_0x3952c0){return db[_0x71a3('0x2c')]['describe']()[_0x71a3('0x24')](respondWithResult(_0x3952c0,null))['catch'](handleError(_0x3952c0,null));}; \ No newline at end of file +var _0x8f4c=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','index','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','type','VIRTUAL','filter','merge','options','MailQueueReport','includeAll','include','findAll','catch','show','params','find','create','update','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x1cdabe,_0x286194){var _0x3dcc9c=function(_0x5aa9c7){while(--_0x5aa9c7){_0x1cdabe['push'](_0x1cdabe['shift']());}};_0x3dcc9c(++_0x286194);}(_0x8f4c,0x113));var _0xc8f4=function(_0x5aa18b,_0x20743b){_0x5aa18b=_0x5aa18b-0x0;var _0x157187=_0x8f4c[_0x5aa18b];return _0x157187;};'use strict';var emlformat=require(_0xc8f4('0x0'));var rimraf=require(_0xc8f4('0x1'));var zipdir=require(_0xc8f4('0x2'));var jsonpatch=require(_0xc8f4('0x3'));var rp=require(_0xc8f4('0x4'));var moment=require(_0xc8f4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc8f4('0x6'));var util=require(_0xc8f4('0x7'));var path=require(_0xc8f4('0x8'));var sox=require('sox');var csv=require(_0xc8f4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc8f4('0xa'));var crypto=require('crypto');var jsforce=require(_0xc8f4('0xb'));var deskjs=require(_0xc8f4('0xc'));var toCsv=require(_0xc8f4('0x9'));var querystring=require(_0xc8f4('0xd'));var Papa=require(_0xc8f4('0xe'));var Redis=require('ioredis');var authService=require(_0xc8f4('0xf'));var qs=require(_0xc8f4('0x10'));var as=require(_0xc8f4('0x11'));var hardwareService=require(_0xc8f4('0x12'));var logger=require('../../config/logger')(_0xc8f4('0x13'));var utils=require('../../config/utils');var config=require(_0xc8f4('0x14'));var licenseUtil=require(_0xc8f4('0x15'));var db=require(_0xc8f4('0x16'))['db'];function respondWithStatusCode(_0x729f8f,_0x39b785){_0x39b785=_0x39b785||0xcc;return function(_0x4e31cf){if(_0x4e31cf){return _0x729f8f[_0xc8f4('0x17')](_0x39b785);}return _0x729f8f[_0xc8f4('0x18')](_0x39b785)[_0xc8f4('0x19')]();};}function respondWithResult(_0x14bc11,_0x1dcee5){_0x1dcee5=_0x1dcee5||0xc8;return function(_0x411c5c){if(_0x411c5c){return _0x14bc11['status'](_0x1dcee5)[_0xc8f4('0x1a')](_0x411c5c);}};}function respondWithFilteredResult(_0x2c7bc1,_0x1518a6){return function(_0x46ac15){if(_0x46ac15){var _0x22c08a=typeof _0x1518a6['offset']===_0xc8f4('0x1b')&&typeof _0x1518a6['limit']==='undefined';var _0x14bc02=_0x46ac15[_0xc8f4('0x1c')];var _0x108076=_0x22c08a?0x0:_0x1518a6[_0xc8f4('0x1d')];var _0x4763c1=_0x22c08a?_0x46ac15[_0xc8f4('0x1c')]:_0x1518a6[_0xc8f4('0x1d')]+_0x1518a6[_0xc8f4('0x1e')];var _0x1982bb;if(_0x4763c1>=_0x14bc02){_0x4763c1=_0x14bc02;_0x1982bb=0xc8;}else{_0x1982bb=0xce;}_0x2c7bc1[_0xc8f4('0x18')](_0x1982bb);return _0x2c7bc1[_0xc8f4('0x1f')](_0xc8f4('0x20'),_0x108076+'-'+_0x4763c1+'/'+_0x14bc02)[_0xc8f4('0x1a')](_0x46ac15);}return null;};}function patchUpdates(_0x5f3264){return function(_0x378f56){try{jsonpatch[_0xc8f4('0x21')](_0x378f56,_0x5f3264,!![]);}catch(_0x29e52d){return BPromise[_0xc8f4('0x22')](_0x29e52d);}return _0x378f56[_0xc8f4('0x23')]();};}function saveUpdates(_0x3b42ee,_0xaeee7d){return function(_0x43eb57){if(_0x43eb57){return _0x43eb57['update'](_0x3b42ee)[_0xc8f4('0x24')](function(_0x205c41){return _0x205c41;});}return null;};}function removeEntity(_0x3195ff,_0x1d159e){return function(_0x5d54a9){if(_0x5d54a9){return _0x5d54a9[_0xc8f4('0x25')]()['then'](function(){_0x3195ff[_0xc8f4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x177a44,_0x3dd717){return function(_0x5c94c6){if(!_0x5c94c6){_0x177a44[_0xc8f4('0x17')](0x194);}return _0x5c94c6;};}function handleError(_0x21062f,_0x11f766){_0x11f766=_0x11f766||0x1f4;return function(_0x2fa052){logger['error'](_0x2fa052[_0xc8f4('0x26')]);if(_0x2fa052[_0xc8f4('0x27')]){delete _0x2fa052['name'];}_0x21062f[_0xc8f4('0x18')](_0x11f766)[_0xc8f4('0x28')](_0x2fa052);};}exports[_0xc8f4('0x29')]=function(_0x1b70bc,_0x24bef0){var _0x385e41={},_0x4a25da={},_0x45f972={'count':0x0,'rows':[]};var _0x24bb78=_[_0xc8f4('0x2a')](db['MailQueueReport'][_0xc8f4('0x2b')],function(_0x3a4b1b){return{'name':_0x3a4b1b['fieldName'],'type':_0x3a4b1b['type']['key']};});_0x4a25da[_0xc8f4('0x2c')]=_[_0xc8f4('0x2a')](_0x24bb78,_0xc8f4('0x27'));_0x4a25da[_0xc8f4('0x2d')]=_[_0xc8f4('0x2e')](_0x1b70bc[_0xc8f4('0x2d')]);_0x4a25da[_0xc8f4('0x2f')]=_[_0xc8f4('0x30')](_0x4a25da['model'],_0x4a25da[_0xc8f4('0x2d')]);_0x385e41[_0xc8f4('0x31')]=_[_0xc8f4('0x30')](_0x4a25da['model'],qs[_0xc8f4('0x32')](_0x1b70bc[_0xc8f4('0x2d')]['fields']));_0x385e41[_0xc8f4('0x31')]=_0x385e41[_0xc8f4('0x31')][_0xc8f4('0x33')]?_0x385e41['attributes']:_0x4a25da[_0xc8f4('0x2c')];if(!_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x34')]('nolimit')){_0x385e41[_0xc8f4('0x1e')]=qs[_0xc8f4('0x1e')](_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x1e')]);_0x385e41[_0xc8f4('0x1d')]=qs[_0xc8f4('0x1d')](_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x1d')]);}_0x385e41[_0xc8f4('0x35')]=qs[_0xc8f4('0x36')](_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x36')]);_0x385e41[_0xc8f4('0x37')]=qs[_0xc8f4('0x2f')](_[_0xc8f4('0x38')](_0x1b70bc[_0xc8f4('0x2d')],_0x4a25da['filters']),_0x24bb78);if(_0x1b70bc[_0xc8f4('0x2d')]['filter']){_0x385e41[_0xc8f4('0x37')]=_['merge'](_0x385e41[_0xc8f4('0x37')],{'$or':_[_0xc8f4('0x2a')](_0x24bb78,function(_0x7ef69a){if(_0x7ef69a[_0xc8f4('0x39')]!==_0xc8f4('0x3a')){var _0x724060={};_0x724060[_0x7ef69a[_0xc8f4('0x27')]]={'$like':'%'+_0x1b70bc['query'][_0xc8f4('0x3b')]+'%'};return _0x724060;}})});}_0x385e41=_[_0xc8f4('0x3c')]({},_0x385e41,_0x1b70bc[_0xc8f4('0x3d')]);var _0x14ce2e={'where':_0x385e41['where']};return db[_0xc8f4('0x3e')][_0xc8f4('0x1c')](_0x14ce2e)[_0xc8f4('0x24')](function(_0x1d0b2d){_0x45f972[_0xc8f4('0x1c')]=_0x1d0b2d;if(_0x1b70bc[_0xc8f4('0x2d')][_0xc8f4('0x3f')]){_0x385e41[_0xc8f4('0x40')]=[{'all':!![]}];}return db[_0xc8f4('0x3e')][_0xc8f4('0x41')](_0x385e41);})[_0xc8f4('0x24')](function(_0xd56415){_0x45f972['rows']=_0xd56415;return _0x45f972;})[_0xc8f4('0x24')](respondWithFilteredResult(_0x24bef0,_0x385e41))[_0xc8f4('0x42')](handleError(_0x24bef0,null));};exports[_0xc8f4('0x43')]=function(_0x275f4a,_0x588ff9){var _0x49da16={'raw':!![],'where':{'id':_0x275f4a[_0xc8f4('0x44')]['id']}},_0x413a55={};_0x413a55['model']=_[_0xc8f4('0x2e')](db[_0xc8f4('0x3e')]['rawAttributes']);_0x413a55['query']=_[_0xc8f4('0x2e')](_0x275f4a[_0xc8f4('0x2d')]);_0x413a55[_0xc8f4('0x2f')]=_[_0xc8f4('0x30')](_0x413a55[_0xc8f4('0x2c')],_0x413a55[_0xc8f4('0x2d')]);_0x49da16['attributes']=_['intersection'](_0x413a55[_0xc8f4('0x2c')],qs[_0xc8f4('0x32')](_0x275f4a[_0xc8f4('0x2d')]['fields']));_0x49da16['attributes']=_0x49da16['attributes']['length']?_0x49da16['attributes']:_0x413a55[_0xc8f4('0x2c')];if(_0x275f4a[_0xc8f4('0x2d')][_0xc8f4('0x3f')]){_0x49da16[_0xc8f4('0x40')]=[{'all':!![]}];}_0x49da16=_[_0xc8f4('0x3c')]({},_0x49da16,_0x275f4a[_0xc8f4('0x3d')]);return db['MailQueueReport'][_0xc8f4('0x45')](_0x49da16)[_0xc8f4('0x24')](handleEntityNotFound(_0x588ff9,null))['then'](respondWithResult(_0x588ff9,null))['catch'](handleError(_0x588ff9,null));};exports[_0xc8f4('0x46')]=function(_0x82a5e,_0x3ca0d6){return db[_0xc8f4('0x3e')]['create'](_0x82a5e['body'],{})[_0xc8f4('0x24')](respondWithResult(_0x3ca0d6,0xc9))[_0xc8f4('0x42')](handleError(_0x3ca0d6,null));};exports[_0xc8f4('0x47')]=function(_0x2bc4db,_0x141f81){if(_0x2bc4db[_0xc8f4('0x48')]['id']){delete _0x2bc4db['body']['id'];}return db['MailQueueReport'][_0xc8f4('0x45')]({'where':{'id':_0x2bc4db[_0xc8f4('0x44')]['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x141f81,null))[_0xc8f4('0x24')](saveUpdates(_0x2bc4db[_0xc8f4('0x48')],null))[_0xc8f4('0x24')](respondWithResult(_0x141f81,null))[_0xc8f4('0x42')](handleError(_0x141f81,null));};exports[_0xc8f4('0x25')]=function(_0x3d9d67,_0x5b4035){return db['MailQueueReport'][_0xc8f4('0x45')]({'where':{'id':_0x3d9d67[_0xc8f4('0x44')]['id']}})[_0xc8f4('0x24')](handleEntityNotFound(_0x5b4035,null))[_0xc8f4('0x24')](removeEntity(_0x5b4035,null))[_0xc8f4('0x42')](handleError(_0x5b4035,null));};exports[_0xc8f4('0x49')]=function(_0x4715f3,_0x36c304){return db[_0xc8f4('0x3e')][_0xc8f4('0x49')]()[_0xc8f4('0x24')](respondWithResult(_0x36c304,null))[_0xc8f4('0x42')](handleError(_0x36c304,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 3b6dc20..e483656 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 _0x74b0=['path','../../config/environment','exports','define','report_mail_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird'];(function(_0x592e20,_0x51cc4e){var _0x3db268=function(_0x5867d8){while(--_0x5867d8){_0x592e20['push'](_0x592e20['shift']());}};_0x3db268(++_0x51cc4e);}(_0x74b0,0x171));var _0x074b=function(_0x4f7e4b,_0x5bbdb2){_0x4f7e4b=_0x4f7e4b-0x0;var _0x55a507=_0x74b0[_0x4f7e4b];return _0x55a507;};'use strict';var _=require(_0x074b('0x0'));var util=require('util');var logger=require(_0x074b('0x1'))(_0x074b('0x2'));var moment=require(_0x074b('0x3'));var BPromise=require(_0x074b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x074b('0x5'));var rimraf=require('rimraf');var config=require(_0x074b('0x6'));var attributes=require('./mailQueueReport.attributes');module[_0x074b('0x7')]=function(_0x5e0782,_0x3b9b7a){return _0x5e0782[_0x074b('0x8')]('MailQueueReport',attributes,{'tableName':_0x074b('0x9'),'paranoid':![],'indexes':[{'name':_0x074b('0xa'),'fields':[_0x074b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1b6e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','define','report_mail_queue','uniqueid','lodash'];(function(_0x142524,_0x482cc3){var _0x52c966=function(_0x229afd){while(--_0x229afd){_0x142524['push'](_0x142524['shift']());}};_0x52c966(++_0x482cc3);}(_0x1b6e,0x1d8));var _0xe1b6=function(_0xbfb8af,_0x8caee5){_0xbfb8af=_0xbfb8af-0x0;var _0x38fc6e=_0x1b6e[_0xbfb8af];return _0x38fc6e;};'use strict';var _=require(_0xe1b6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe1b6('0x1'));var BPromise=require(_0xe1b6('0x2'));var rp=require(_0xe1b6('0x3'));var fs=require('fs');var path=require(_0xe1b6('0x4'));var rimraf=require(_0xe1b6('0x5'));var config=require(_0xe1b6('0x6'));var attributes=require(_0xe1b6('0x7'));module['exports']=function(_0x21af11,_0x33df65){return _0x21af11[_0xe1b6('0x8')]('MailQueueReport',attributes,{'tableName':_0xe1b6('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe1b6('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 2b77bde..054a5cd 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 _0xadb5=['MailQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateMailQueueReport','create','options','raw','debug','MailQueueReport','body','attributes','limit','UpdateMailQueueReport','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x28f474,_0x5535e4){var _0x45fddc=function(_0x9b0cc6){while(--_0x9b0cc6){_0x28f474['push'](_0x28f474['shift']());}};_0x45fddc(++_0x5535e4);}(_0xadb5,0xad));var _0x5adb=function(_0x40dda4,_0x2de28b){_0x40dda4=_0x40dda4-0x0;var _0x58c1cb=_0xadb5[_0x40dda4];return _0x58c1cb;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('MailQueueReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}exports[_0x5adb('0x15')]=function(_0x529b65){var _0x3fff62=this;return new Promise(function(_0x5de028,_0x1d9e86){return db['MailQueueReport'][_0x5adb('0x16')](_0x529b65['body'],{'raw':_0x529b65['options']?_0x529b65[_0x5adb('0x17')][_0x5adb('0x18')]===undefined?!![]:![]:!![]})[_0x5adb('0xb')](function(_0x1fd4a7){logger[_0x5adb('0xc')]('CreateMailQueueReport',_0x529b65);logger[_0x5adb('0x19')]('CreateMailQueueReport',_0x529b65,JSON['stringify'](_0x1fd4a7));_0x5de028(_0x1fd4a7);})[_0x5adb('0x14')](function(_0x379b33){logger[_0x5adb('0x10')](_0x5adb('0x15'),_0x379b33[_0x5adb('0x12')],_0x529b65);_0x1d9e86(_0x3fff62[_0x5adb('0x10')](0x1f4,_0x379b33[_0x5adb('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x4b1957){var _0x373cc3=this;return new Promise(function(_0x3220cd,_0x3839fb){return db[_0x5adb('0x1a')]['update'](_0x4b1957[_0x5adb('0x1b')],{'raw':_0x4b1957[_0x5adb('0x17')]?_0x4b1957['options'][_0x5adb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')]['where']||null:null,'attributes':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1c')]||null:null,'limit':_0x4b1957[_0x5adb('0x17')]?_0x4b1957[_0x5adb('0x17')][_0x5adb('0x1d')]||null:null})['then'](function(_0x49992e){logger['info'](_0x5adb('0x1e'),_0x4b1957);logger[_0x5adb('0x19')](_0x5adb('0x1e'),_0x4b1957,JSON[_0x5adb('0xf')](_0x49992e));_0x3220cd(_0x49992e);})[_0x5adb('0x14')](function(_0x4de310){logger[_0x5adb('0x10')](_0x5adb('0x1e'),_0x4de310[_0x5adb('0x12')],_0x4b1957);_0x3839fb(_0x373cc3[_0x5adb('0x10')](0x1f4,_0x4de310[_0x5adb('0x12')]));});});}; \ No newline at end of file +var _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x16889f,_0x1fc476){var _0x3a5ff3=function(_0x5c8a4d){while(--_0x5c8a4d){_0x16889f['push'](_0x16889f['shift']());}};_0x3a5ff3(++_0x1fc476);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xc4aa[_0x1caf6a];return _0x1bf493;};'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});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index ede39ed..c6e2ac1 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x18aa27,_0x21720f){var _0x87bd76=function(_0x4cbc74){while(--_0x4cbc74){_0x18aa27['push'](_0x18aa27['shift']());}};_0x87bd76(++_0x21720f);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xcb91[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x5aec09,_0x3e7e00){var _0x49e4e3=function(_0x463dac){while(--_0x463dac){_0x5aec09['push'](_0x5aec09['shift']());}};_0x49e4e3(++_0x3e7e00);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0xcb91[_0x3e2fcf];return _0x497db7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index c5bb563..42beb78 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 _0xcc90=['BOOLEAN','INTEGER','INBOX','sequelize','STRING'];(function(_0x5e5882,_0x699de4){var _0x3ea2dc=function(_0x185fb4){while(--_0x185fb4){_0x5e5882['push'](_0x5e5882['shift']());}};_0x3ea2dc(++_0x699de4);}(_0xcc90,0x148));var _0x0cc9=function(_0xcfc19c,_0x1d4e22){_0xcfc19c=_0xcfc19c-0x0;var _0x37cf4a=_0xcc90[_0xcfc19c];return _0x37cf4a;};'use strict';var Sequelize=require(_0x0cc9('0x0'));module['exports']={'description':{'type':Sequelize[_0x0cc9('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x0cc9('0x2')],'defaultValue':!![]},'user':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x0cc9('0x3')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x0cc9('0x1')],'defaultValue':_0x0cc9('0x4')},'connTimeout':{'type':Sequelize[_0x0cc9('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x0cc9('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0x0cc9('0x1')]},'modernAuthentication':{'type':Sequelize[_0x0cc9('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x89f5=['INBOX','STRING','INTEGER','BOOLEAN'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0x89f5,0x1d5));var _0x589f=function(_0x24909e,_0x1f5f6b){_0x24909e=_0x24909e-0x0;var _0x4bef1c=_0x89f5[_0x24909e];return _0x4bef1c;};'use strict';var Sequelize=require('sequelize');module['exports']={'description':{'type':Sequelize[_0x589f('0x0')]},'host':{'type':Sequelize[_0x589f('0x0')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0x589f('0x0')]},'password':{'type':Sequelize[_0x589f('0x0')]},'port':{'type':Sequelize[_0x589f('0x1')]},'tls':{'type':Sequelize[_0x589f('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x589f('0x0')],'defaultValue':_0x589f('0x3')},'connTimeout':{'type':Sequelize[_0x589f('0x1')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x589f('0x1')],'defaultValue':0x5},'service':{'type':Sequelize[_0x589f('0x0')]},'modernAuthentication':{'type':Sequelize[_0x589f('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 7bf3d8a..6e6d599 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 _0xeb9e=['exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes'];(function(_0x41579c,_0x471380){var _0x1c744c=function(_0xf5eb29){while(--_0xf5eb29){_0x41579c['push'](_0x41579c['shift']());}};_0x1c744c(++_0x471380);}(_0xeb9e,0x122));var _0xeeb9=function(_0x45175c,_0x27f36c){_0x45175c=_0x45175c-0x0;var _0x203bd5=_0xeb9e[_0x45175c];return _0x203bd5;};'use strict';var _=require(_0xeeb9('0x0'));var util=require(_0xeeb9('0x1'));var logger=require(_0xeeb9('0x2'))('api');var moment=require(_0xeeb9('0x3'));var BPromise=require('bluebird');var rp=require(_0xeeb9('0x4'));var fs=require('fs');var path=require(_0xeeb9('0x5'));var rimraf=require(_0xeeb9('0x6'));var config=require(_0xeeb9('0x7'));var attributes=require(_0xeeb9('0x8'));module[_0xeeb9('0x9')]=function(_0x4094fd,_0xdda1ba){return _0x4094fd[_0xeeb9('0xa')](_0xeeb9('0xb'),attributes,{'tableName':_0xeeb9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0151=['mail_servers_in','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','MailServerIn'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0x0151,0x1ef));var _0x1015=function(_0x10f9e1,_0x4c7e0b){_0x10f9e1=_0x10f9e1-0x0;var _0x371f06=_0x0151[_0x10f9e1];return _0x371f06;};'use strict';var _=require(_0x1015('0x0'));var util=require(_0x1015('0x1'));var logger=require(_0x1015('0x2'))('api');var moment=require(_0x1015('0x3'));var BPromise=require(_0x1015('0x4'));var rp=require(_0x1015('0x5'));var fs=require('fs');var path=require(_0x1015('0x6'));var rimraf=require(_0x1015('0x7'));var config=require(_0x1015('0x8'));var attributes=require(_0x1015('0x9'));module[_0x1015('0xa')]=function(_0x24c8b6,_0x1eccdd){return _0x24c8b6['define'](_0x1015('0xb'),attributes,{'tableName':_0x1015('0xc'),'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 732c34d..68c8cff 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 _0x1bdd=['error','code','message','result','catch','GetMailServerIn','findAll','options','raw','attributes','include','model','map','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1bdd,0x143));var _0xd1bd=function(_0x15193d,_0x13ba1f){_0x15193d=_0x15193d-0x0;var _0xfa2c0=_0x1bdd[_0x15193d];return _0xfa2c0;};'use strict';var _=require(_0xd1bd('0x0'));var util=require(_0xd1bd('0x1'));var moment=require(_0xd1bd('0x2'));var BPromise=require(_0xd1bd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd1bd('0x4'))['db'];var utils=require(_0xd1bd('0x5'));var logger=require(_0xd1bd('0x6'))(_0xd1bd('0x7'));var config=require(_0xd1bd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd1bd('0x9')][_0xd1bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x35231d,_0x128479,_0x15b6de){return new BPromise(function(_0x45cccc,_0x225277){return client[_0xd1bd('0xb')](_0x35231d,_0x15b6de)[_0xd1bd('0xc')](function(_0x523146){logger[_0xd1bd('0xd')](_0xd1bd('0xe'),_0x128479,_0xd1bd('0xf'));logger[_0xd1bd('0x10')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0x128479,_0xd1bd('0xf'),JSON[_0xd1bd('0x11')](_0x523146));if(_0x523146[_0xd1bd('0x12')]){if(_0x523146['error'][_0xd1bd('0x13')]===0x1f4){logger[_0xd1bd('0x12')](_0xd1bd('0xe'),_0x128479,_0x523146['error'][_0xd1bd('0x14')]);return _0x225277(_0x523146[_0xd1bd('0x12')][_0xd1bd('0x14')]);}logger[_0xd1bd('0x12')](_0xd1bd('0xe'),_0x128479,_0x523146[_0xd1bd('0x12')][_0xd1bd('0x14')]);return _0x45cccc(_0x523146[_0xd1bd('0x12')][_0xd1bd('0x14')]);}else{logger[_0xd1bd('0xd')](_0xd1bd('0xe'),_0x128479,'request\x20sent');_0x45cccc(_0x523146[_0xd1bd('0x15')]['message']);}})[_0xd1bd('0x16')](function(_0x321a30){logger[_0xd1bd('0x12')]('MailServerIn,\x20%s,\x20%s',_0x128479,_0x321a30);_0x225277(_0x321a30);});});}exports[_0xd1bd('0x17')]=function(_0x169554){var _0x3cb2d6=this;return new Promise(function(_0x1d54ab,_0x556e46){return db['MailServerIn'][_0xd1bd('0x18')]({'raw':_0x169554[_0xd1bd('0x19')]?_0x169554[_0xd1bd('0x19')][_0xd1bd('0x1a')]===undefined?!![]:![]:!![],'where':_0x169554[_0xd1bd('0x19')]?_0x169554[_0xd1bd('0x19')]['where']||null:null,'attributes':_0x169554[_0xd1bd('0x19')]?_0x169554[_0xd1bd('0x19')][_0xd1bd('0x1b')]||null:null,'limit':_0x169554[_0xd1bd('0x19')]?_0x169554[_0xd1bd('0x19')]['limit']||null:null,'include':_0x169554[_0xd1bd('0x19')]?_0x169554['options'][_0xd1bd('0x1c')]?_['map'](_0x169554[_0xd1bd('0x19')][_0xd1bd('0x1c')],function(_0x491289){return{'model':db[_0x491289[_0xd1bd('0x1d')]],'as':_0x491289['as'],'attributes':_0x491289[_0xd1bd('0x1b')],'include':_0x491289[_0xd1bd('0x1c')]?_[_0xd1bd('0x1e')](_0x491289[_0xd1bd('0x1c')],function(_0x21cc93){return{'model':db[_0x21cc93[_0xd1bd('0x1d')]],'as':_0x21cc93['as'],'attributes':_0x21cc93[_0xd1bd('0x1b')],'include':_0x21cc93[_0xd1bd('0x1c')]?_[_0xd1bd('0x1e')](_0x21cc93['include'],function(_0x551ba4){return{'model':db[_0x551ba4[_0xd1bd('0x1d')]],'as':_0x551ba4['as'],'attributes':_0x551ba4[_0xd1bd('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd1bd('0xc')](function(_0x5c7c7b){logger[_0xd1bd('0xd')](_0xd1bd('0x17'),_0x169554);logger[_0xd1bd('0x10')](_0xd1bd('0x17'),_0x169554,JSON[_0xd1bd('0x11')](_0x5c7c7b));_0x1d54ab(_0x5c7c7b);})[_0xd1bd('0x16')](function(_0x230990){logger['error'](_0xd1bd('0x17'),_0x230990[_0xd1bd('0x14')],_0x169554);_0x556e46(_0x3cb2d6['error'](0x1f4,_0x230990['message']));});});}; \ No newline at end of file +var _0xa7b5=['then','info','MailServerIn,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','findAll','options','where','attributes','limit','include','model','map','GetMailServerIn','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x9fafa0,_0x10f969){var _0x5b4fff=function(_0x4acf55){while(--_0x4acf55){_0x9fafa0['push'](_0x9fafa0['shift']());}};_0x5b4fff(++_0x10f969);}(_0xa7b5,0x162));var _0x5a7b=function(_0x20591f,_0x343a0c){_0x20591f=_0x20591f-0x0;var _0x1d6813=_0xa7b5[_0x20591f];return _0x1d6813;};'use strict';var _=require(_0x5a7b('0x0'));var util=require(_0x5a7b('0x1'));var moment=require(_0x5a7b('0x2'));var BPromise=require(_0x5a7b('0x3'));var rs=require(_0x5a7b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a7b('0x5'))['db'];var utils=require(_0x5a7b('0x6'));var logger=require(_0x5a7b('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x5a7b('0x8'));var client=jayson[_0x5a7b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x38dac6,_0xe45788,_0x390a68){return new BPromise(function(_0x265597,_0x14c477){return client['request'](_0x38dac6,_0x390a68)[_0x5a7b('0xa')](function(_0x59b6df){logger[_0x5a7b('0xb')](_0x5a7b('0xc'),_0xe45788,'request\x20sent');logger[_0x5a7b('0xd')]('MailServerIn,\x20%s,\x20%s,\x20%s',_0xe45788,_0x5a7b('0xe'),JSON[_0x5a7b('0xf')](_0x59b6df));if(_0x59b6df[_0x5a7b('0x10')]){if(_0x59b6df[_0x5a7b('0x10')]['code']===0x1f4){logger['error'](_0x5a7b('0xc'),_0xe45788,_0x59b6df['error']['message']);return _0x14c477(_0x59b6df[_0x5a7b('0x10')][_0x5a7b('0x11')]);}logger['error'](_0x5a7b('0xc'),_0xe45788,_0x59b6df[_0x5a7b('0x10')][_0x5a7b('0x11')]);return _0x265597(_0x59b6df['error'][_0x5a7b('0x11')]);}else{logger[_0x5a7b('0xb')]('MailServerIn,\x20%s,\x20%s',_0xe45788,_0x5a7b('0xe'));_0x265597(_0x59b6df['result'][_0x5a7b('0x11')]);}})['catch'](function(_0x34804c){logger[_0x5a7b('0x10')](_0x5a7b('0xc'),_0xe45788,_0x34804c);_0x14c477(_0x34804c);});});}exports['GetMailServerIn']=function(_0xe59f65){var _0x2dd166=this;return new Promise(function(_0x466758,_0x47ce0f){return db['MailServerIn'][_0x5a7b('0x12')]({'raw':_0xe59f65['options']?_0xe59f65[_0x5a7b('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0xe59f65[_0x5a7b('0x13')]?_0xe59f65[_0x5a7b('0x13')][_0x5a7b('0x14')]||null:null,'attributes':_0xe59f65['options']?_0xe59f65[_0x5a7b('0x13')][_0x5a7b('0x15')]||null:null,'limit':_0xe59f65['options']?_0xe59f65[_0x5a7b('0x13')][_0x5a7b('0x16')]||null:null,'include':_0xe59f65['options']?_0xe59f65[_0x5a7b('0x13')][_0x5a7b('0x17')]?_['map'](_0xe59f65['options'][_0x5a7b('0x17')],function(_0x32cc44){return{'model':db[_0x32cc44[_0x5a7b('0x18')]],'as':_0x32cc44['as'],'attributes':_0x32cc44[_0x5a7b('0x15')],'include':_0x32cc44[_0x5a7b('0x17')]?_[_0x5a7b('0x19')](_0x32cc44[_0x5a7b('0x17')],function(_0x4f204d){return{'model':db[_0x4f204d['model']],'as':_0x4f204d['as'],'attributes':_0x4f204d[_0x5a7b('0x15')],'include':_0x4f204d[_0x5a7b('0x17')]?_[_0x5a7b('0x19')](_0x4f204d[_0x5a7b('0x17')],function(_0x48ee7e){return{'model':db[_0x48ee7e[_0x5a7b('0x18')]],'as':_0x48ee7e['as'],'attributes':_0x48ee7e['attributes']};}):[]};}):[]};}):[]:[]})[_0x5a7b('0xa')](function(_0x3531cf){logger[_0x5a7b('0xb')](_0x5a7b('0x1a'),_0xe59f65);logger['debug'](_0x5a7b('0x1a'),_0xe59f65,JSON[_0x5a7b('0xf')](_0x3531cf));_0x466758(_0x3531cf);})[_0x5a7b('0x1b')](function(_0x1ad5da){logger[_0x5a7b('0x10')]('GetMailServerIn',_0x1ad5da[_0x5a7b('0x11')],_0xe59f65);_0x47ce0f(_0x2dd166['error'](0x1f4,_0x1ad5da['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 4365eb4..d8640f6 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 _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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 fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailServerOut.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x4e1d03,_0x786f3a){var _0x362d4b=function(_0x1924d2){while(--_0x1924d2){_0x4e1d03['push'](_0x4e1d03['shift']());}};_0x362d4b(++_0x786f3a);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 29a4217..fbb55b8 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 _0x7334=['sequelize','exports','STRING','BOOLEAN'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x7334,0x184));var _0x4733=function(_0x244538,_0x33bd34){_0x244538=_0x244538-0x0;var _0xde1f7=_0x7334[_0x244538];return _0xde1f7;};'use strict';var Sequelize=require(_0x4733('0x0'));module[_0x4733('0x1')]={'description':{'type':Sequelize[_0x4733('0x2')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x4733('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x4733('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x4733('0x2')]},'authentication':{'type':Sequelize[_0x4733('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x4733('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x351d=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x5047ac,_0x1c8f81){var _0x3cdee5=function(_0x2e1426){while(--_0x2e1426){_0x5047ac['push'](_0x5047ac['shift']());}};_0x3cdee5(++_0x1c8f81);}(_0x351d,0x90));var _0xd351=function(_0x44f55b,_0x47734c){_0x44f55b=_0x44f55b-0x0;var _0x1e8183=_0x351d[_0x44f55b];return _0x1e8183;};'use strict';var Sequelize=require(_0xd351('0x0'));module['exports']={'description':{'type':Sequelize[_0xd351('0x1')]},'host':{'type':Sequelize[_0xd351('0x1')]},'user':{'type':Sequelize[_0xd351('0x1')]},'pass':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xd351('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xd351('0x1')]},'authentication':{'type':Sequelize[_0xd351('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index bdf5179..9ff0b0a 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 _0x51d1=['undefined','limit','offset','count','set','Content-Range','reject','save','then','destroy','error','name','send','index','MailServerOut','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','where','pick','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','keys','create','body','update','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x29a3cf,_0x2d787a){var _0x3dca8f=function(_0x4942d7){while(--_0x4942d7){_0x29a3cf['push'](_0x29a3cf['shift']());}};_0x3dca8f(++_0x2d787a);}(_0x51d1,0x7a));var _0x151d=function(_0xc81f5f,_0x181205){_0xc81f5f=_0xc81f5f-0x0;var _0x4410dc=_0x51d1[_0xc81f5f];return _0x4410dc;};'use strict';var emlformat=require(_0x151d('0x0'));var rimraf=require(_0x151d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x151d('0x2'));var rp=require(_0x151d('0x3'));var moment=require(_0x151d('0x4'));var BPromise=require(_0x151d('0x5'));var Mustache=require('mustache');var util=require(_0x151d('0x6'));var path=require(_0x151d('0x7'));var sox=require('sox');var csv=require(_0x151d('0x8'));var ejs=require(_0x151d('0x9'));var fs=require('fs');var fs_extra=require(_0x151d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x151d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x151d('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x151d('0xd'));var Redis=require(_0x151d('0xe'));var authService=require(_0x151d('0xf'));var qs=require(_0x151d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x151d('0x11'));var logger=require(_0x151d('0x12'))(_0x151d('0x13'));var utils=require(_0x151d('0x14'));var config=require(_0x151d('0x15'));var licenseUtil=require(_0x151d('0x16'));var db=require(_0x151d('0x17'))['db'];function respondWithStatusCode(_0x580f64,_0x197449){_0x197449=_0x197449||0xcc;return function(_0x3cdbe0){if(_0x3cdbe0){return _0x580f64[_0x151d('0x18')](_0x197449);}return _0x580f64[_0x151d('0x19')](_0x197449)[_0x151d('0x1a')]();};}function respondWithResult(_0x54f283,_0x32aea1){_0x32aea1=_0x32aea1||0xc8;return function(_0x59264b){if(_0x59264b){return _0x54f283[_0x151d('0x19')](_0x32aea1)[_0x151d('0x1b')](_0x59264b);}};}function respondWithFilteredResult(_0x152b74,_0x2bfffc){return function(_0x185c1a){if(_0x185c1a){var _0x14bceb=typeof _0x2bfffc['offset']===_0x151d('0x1c')&&typeof _0x2bfffc[_0x151d('0x1d')]===_0x151d('0x1c');var _0x1494c9=_0x185c1a['count'];var _0x49a660=_0x14bceb?0x0:_0x2bfffc[_0x151d('0x1e')];var _0x5d83d1=_0x14bceb?_0x185c1a[_0x151d('0x1f')]:_0x2bfffc['offset']+_0x2bfffc['limit'];var _0x48fd0c;if(_0x5d83d1>=_0x1494c9){_0x5d83d1=_0x1494c9;_0x48fd0c=0xc8;}else{_0x48fd0c=0xce;}_0x152b74[_0x151d('0x19')](_0x48fd0c);return _0x152b74[_0x151d('0x20')](_0x151d('0x21'),_0x49a660+'-'+_0x5d83d1+'/'+_0x1494c9)[_0x151d('0x1b')](_0x185c1a);}return null;};}function patchUpdates(_0xcd6a7c){return function(_0x4e7640){try{jsonpatch['apply'](_0x4e7640,_0xcd6a7c,!![]);}catch(_0x55fed8){return BPromise[_0x151d('0x22')](_0x55fed8);}return _0x4e7640[_0x151d('0x23')]();};}function saveUpdates(_0x5ccf65,_0x2c27d9){return function(_0x327530){if(_0x327530){return _0x327530['update'](_0x5ccf65)[_0x151d('0x24')](function(_0x4ee3e8){return _0x4ee3e8;});}return null;};}function removeEntity(_0x81cd7c,_0x3bb3b1){return function(_0x52d1c1){if(_0x52d1c1){return _0x52d1c1[_0x151d('0x25')]()[_0x151d('0x24')](function(){_0x81cd7c[_0x151d('0x19')](0xcc)[_0x151d('0x1a')]();});}};}function handleEntityNotFound(_0x471e4a,_0x2a6210){return function(_0x117a59){if(!_0x117a59){_0x471e4a['sendStatus'](0x194);}return _0x117a59;};}function handleError(_0x3202da,_0x63e95a){_0x63e95a=_0x63e95a||0x1f4;return function(_0x58f7d6){logger[_0x151d('0x26')](_0x58f7d6['stack']);if(_0x58f7d6[_0x151d('0x27')]){delete _0x58f7d6['name'];}_0x3202da['status'](_0x63e95a)[_0x151d('0x28')](_0x58f7d6);};}exports[_0x151d('0x29')]=function(_0x2d008b,_0x26393c){var _0x792945={},_0xac42a0={},_0x12625d={'count':0x0,'rows':[]};var _0x37d574=_['map'](db[_0x151d('0x2a')][_0x151d('0x2b')],function(_0x3271c4){return{'name':_0x3271c4[_0x151d('0x2c')],'type':_0x3271c4[_0x151d('0x2d')][_0x151d('0x2e')]};});_0xac42a0['model']=_['map'](_0x37d574,_0x151d('0x27'));_0xac42a0[_0x151d('0x2f')]=_['keys'](_0x2d008b[_0x151d('0x2f')]);_0xac42a0[_0x151d('0x30')]=_[_0x151d('0x31')](_0xac42a0[_0x151d('0x32')],_0xac42a0['query']);_0x792945['attributes']=_[_0x151d('0x31')](_0xac42a0[_0x151d('0x32')],qs[_0x151d('0x33')](_0x2d008b[_0x151d('0x2f')][_0x151d('0x33')]));_0x792945[_0x151d('0x34')]=_0x792945[_0x151d('0x34')][_0x151d('0x35')]?_0x792945[_0x151d('0x34')]:_0xac42a0['model'];if(!_0x2d008b[_0x151d('0x2f')][_0x151d('0x36')](_0x151d('0x37'))){_0x792945[_0x151d('0x1d')]=qs['limit'](_0x2d008b['query'][_0x151d('0x1d')]);_0x792945[_0x151d('0x1e')]=qs[_0x151d('0x1e')](_0x2d008b[_0x151d('0x2f')][_0x151d('0x1e')]);}_0x792945[_0x151d('0x38')]=qs['sort'](_0x2d008b[_0x151d('0x2f')]['sort']);_0x792945[_0x151d('0x39')]=qs[_0x151d('0x30')](_[_0x151d('0x3a')](_0x2d008b[_0x151d('0x2f')],_0xac42a0[_0x151d('0x30')]),_0x37d574);if(_0x2d008b[_0x151d('0x2f')]['filter']){_0x792945[_0x151d('0x39')]=_[_0x151d('0x3b')](_0x792945['where'],{'$or':_[_0x151d('0x3c')](_0x37d574,function(_0x204566){if(_0x204566['type']!==_0x151d('0x3d')){var _0x393f9a={};_0x393f9a[_0x204566[_0x151d('0x27')]]={'$like':'%'+_0x2d008b[_0x151d('0x2f')][_0x151d('0x3e')]+'%'};return _0x393f9a;}})});}_0x792945=_[_0x151d('0x3b')]({},_0x792945,_0x2d008b[_0x151d('0x3f')]);var _0x324c87={'where':_0x792945[_0x151d('0x39')]};return db['MailServerOut'][_0x151d('0x1f')](_0x324c87)[_0x151d('0x24')](function(_0x15840a){_0x12625d[_0x151d('0x1f')]=_0x15840a;if(_0x2d008b[_0x151d('0x2f')][_0x151d('0x40')]){_0x792945[_0x151d('0x41')]=[{'all':!![]}];}return db['MailServerOut'][_0x151d('0x42')](_0x792945);})[_0x151d('0x24')](function(_0x2c63c2){_0x12625d[_0x151d('0x43')]=_0x2c63c2;return _0x12625d;})[_0x151d('0x24')](respondWithFilteredResult(_0x26393c,_0x792945))[_0x151d('0x44')](handleError(_0x26393c,null));};exports['show']=function(_0x53f672,_0x50bdcc){var _0x2968ce={'raw':!![],'where':{'id':_0x53f672['params']['id']}},_0x1f9158={};_0x1f9158['model']=_[_0x151d('0x45')](db[_0x151d('0x2a')][_0x151d('0x2b')]);_0x1f9158[_0x151d('0x2f')]=_[_0x151d('0x45')](_0x53f672[_0x151d('0x2f')]);_0x1f9158['filters']=_['intersection'](_0x1f9158[_0x151d('0x32')],_0x1f9158[_0x151d('0x2f')]);_0x2968ce[_0x151d('0x34')]=_[_0x151d('0x31')](_0x1f9158['model'],qs[_0x151d('0x33')](_0x53f672[_0x151d('0x2f')][_0x151d('0x33')]));_0x2968ce[_0x151d('0x34')]=_0x2968ce[_0x151d('0x34')][_0x151d('0x35')]?_0x2968ce[_0x151d('0x34')]:_0x1f9158[_0x151d('0x32')];if(_0x53f672[_0x151d('0x2f')][_0x151d('0x40')]){_0x2968ce[_0x151d('0x41')]=[{'all':!![]}];}_0x2968ce=_['merge']({},_0x2968ce,_0x53f672[_0x151d('0x3f')]);return db['MailServerOut']['find'](_0x2968ce)[_0x151d('0x24')](handleEntityNotFound(_0x50bdcc,null))[_0x151d('0x24')](respondWithResult(_0x50bdcc,null))['catch'](handleError(_0x50bdcc,null));};exports['create']=function(_0x548ec0,_0x25cb88){return db[_0x151d('0x2a')][_0x151d('0x46')](_0x548ec0[_0x151d('0x47')],{})[_0x151d('0x24')](respondWithResult(_0x25cb88,0xc9))['catch'](handleError(_0x25cb88,null));};exports[_0x151d('0x48')]=function(_0x2fb6f8,_0x11c670){if(_0x2fb6f8['body']['id']){delete _0x2fb6f8[_0x151d('0x47')]['id'];}return db[_0x151d('0x2a')][_0x151d('0x49')]({'where':{'id':_0x2fb6f8[_0x151d('0x4a')]['id']}})[_0x151d('0x24')](handleEntityNotFound(_0x11c670,null))['then'](saveUpdates(_0x2fb6f8[_0x151d('0x47')],null))['then'](respondWithResult(_0x11c670,null))[_0x151d('0x44')](handleError(_0x11c670,null));};exports[_0x151d('0x25')]=function(_0x5d2e0f,_0x329787){return db[_0x151d('0x2a')][_0x151d('0x49')]({'where':{'id':_0x5d2e0f[_0x151d('0x4a')]['id']}})[_0x151d('0x24')](handleEntityNotFound(_0x329787,null))[_0x151d('0x24')](removeEntity(_0x329787,null))[_0x151d('0x44')](handleError(_0x329787,null));}; \ No newline at end of file +var _0xbb8e=['VIRTUAL','options','includeAll','findAll','rows','catch','show','params','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','map','MailServerOut','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbb8e,0x17d));var _0xebb8=function(_0x1e3827,_0x926bcf){_0x1e3827=_0x1e3827-0x0;var _0x2d1497=_0xbb8e[_0x1e3827];return _0x2d1497;};'use strict';var emlformat=require(_0xebb8('0x0'));var rimraf=require(_0xebb8('0x1'));var zipdir=require(_0xebb8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xebb8('0x3'));var moment=require(_0xebb8('0x4'));var BPromise=require(_0xebb8('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xebb8('0x6'));var sox=require(_0xebb8('0x7'));var csv=require(_0xebb8('0x8'));var ejs=require(_0xebb8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xebb8('0xa'));var squel=require(_0xebb8('0xb'));var crypto=require('crypto');var jsforce=require(_0xebb8('0xc'));var deskjs=require(_0xebb8('0xd'));var toCsv=require(_0xebb8('0x8'));var querystring=require(_0xebb8('0xe'));var Papa=require('papaparse');var Redis=require(_0xebb8('0xf'));var authService=require(_0xebb8('0x10'));var qs=require(_0xebb8('0x11'));var as=require(_0xebb8('0x12'));var hardwareService=require(_0xebb8('0x13'));var logger=require('../../config/logger')(_0xebb8('0x14'));var utils=require(_0xebb8('0x15'));var config=require(_0xebb8('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x35f82b,_0x48ba88){_0x48ba88=_0x48ba88||0xcc;return function(_0x127364){if(_0x127364){return _0x35f82b[_0xebb8('0x17')](_0x48ba88);}return _0x35f82b[_0xebb8('0x18')](_0x48ba88)['end']();};}function respondWithResult(_0x1a6c36,_0x45e326){_0x45e326=_0x45e326||0xc8;return function(_0x325b65){if(_0x325b65){return _0x1a6c36[_0xebb8('0x18')](_0x45e326)[_0xebb8('0x19')](_0x325b65);}};}function respondWithFilteredResult(_0x544073,_0x5d1659){return function(_0x4de058){if(_0x4de058){var _0x4bd394=typeof _0x5d1659['offset']===_0xebb8('0x1a')&&typeof _0x5d1659[_0xebb8('0x1b')]===_0xebb8('0x1a');var _0x4a809a=_0x4de058[_0xebb8('0x1c')];var _0x1eb38e=_0x4bd394?0x0:_0x5d1659['offset'];var _0x46da8f=_0x4bd394?_0x4de058[_0xebb8('0x1c')]:_0x5d1659[_0xebb8('0x1d')]+_0x5d1659[_0xebb8('0x1b')];var _0x491aec;if(_0x46da8f>=_0x4a809a){_0x46da8f=_0x4a809a;_0x491aec=0xc8;}else{_0x491aec=0xce;}_0x544073[_0xebb8('0x18')](_0x491aec);return _0x544073[_0xebb8('0x1e')](_0xebb8('0x1f'),_0x1eb38e+'-'+_0x46da8f+'/'+_0x4a809a)[_0xebb8('0x19')](_0x4de058);}return null;};}function patchUpdates(_0x25e652){return function(_0x396ea3){try{jsonpatch[_0xebb8('0x20')](_0x396ea3,_0x25e652,!![]);}catch(_0x2d0df2){return BPromise[_0xebb8('0x21')](_0x2d0df2);}return _0x396ea3['save']();};}function saveUpdates(_0x5c42e3,_0x45d5cc){return function(_0x2ded09){if(_0x2ded09){return _0x2ded09[_0xebb8('0x22')](_0x5c42e3)[_0xebb8('0x23')](function(_0x5949ab){return _0x5949ab;});}return null;};}function removeEntity(_0x254ed2,_0xc4e771){return function(_0x4fd921){if(_0x4fd921){return _0x4fd921[_0xebb8('0x24')]()[_0xebb8('0x23')](function(){_0x254ed2['status'](0xcc)[_0xebb8('0x25')]();});}};}function handleEntityNotFound(_0x4d3b64,_0x5549d4){return function(_0x1efd38){if(!_0x1efd38){_0x4d3b64[_0xebb8('0x17')](0x194);}return _0x1efd38;};}function handleError(_0x395678,_0x29f172){_0x29f172=_0x29f172||0x1f4;return function(_0x522248){logger[_0xebb8('0x26')](_0x522248[_0xebb8('0x27')]);if(_0x522248[_0xebb8('0x28')]){delete _0x522248[_0xebb8('0x28')];}_0x395678[_0xebb8('0x18')](_0x29f172)[_0xebb8('0x29')](_0x522248);};}exports['index']=function(_0x44c41d,_0x2c1c48){var _0x253cb2={},_0x515f69={},_0x54d0e4={'count':0x0,'rows':[]};var _0x5b8584=_[_0xebb8('0x2a')](db[_0xebb8('0x2b')][_0xebb8('0x2c')],function(_0x4422dd){return{'name':_0x4422dd['fieldName'],'type':_0x4422dd[_0xebb8('0x2d')][_0xebb8('0x2e')]};});_0x515f69[_0xebb8('0x2f')]=_['map'](_0x5b8584,_0xebb8('0x28'));_0x515f69[_0xebb8('0x30')]=_[_0xebb8('0x31')](_0x44c41d[_0xebb8('0x30')]);_0x515f69[_0xebb8('0x32')]=_[_0xebb8('0x33')](_0x515f69[_0xebb8('0x2f')],_0x515f69['query']);_0x253cb2[_0xebb8('0x34')]=_[_0xebb8('0x33')](_0x515f69['model'],qs[_0xebb8('0x35')](_0x44c41d[_0xebb8('0x30')][_0xebb8('0x35')]));_0x253cb2[_0xebb8('0x34')]=_0x253cb2['attributes'][_0xebb8('0x36')]?_0x253cb2['attributes']:_0x515f69['model'];if(!_0x44c41d[_0xebb8('0x30')][_0xebb8('0x37')](_0xebb8('0x38'))){_0x253cb2[_0xebb8('0x1b')]=qs['limit'](_0x44c41d[_0xebb8('0x30')][_0xebb8('0x1b')]);_0x253cb2[_0xebb8('0x1d')]=qs[_0xebb8('0x1d')](_0x44c41d[_0xebb8('0x30')]['offset']);}_0x253cb2[_0xebb8('0x39')]=qs[_0xebb8('0x3a')](_0x44c41d['query'][_0xebb8('0x3a')]);_0x253cb2[_0xebb8('0x3b')]=qs['filters'](_[_0xebb8('0x3c')](_0x44c41d[_0xebb8('0x30')],_0x515f69[_0xebb8('0x32')]),_0x5b8584);if(_0x44c41d['query'][_0xebb8('0x3d')]){_0x253cb2[_0xebb8('0x3b')]=_[_0xebb8('0x3e')](_0x253cb2[_0xebb8('0x3b')],{'$or':_['map'](_0x5b8584,function(_0x115772){if(_0x115772['type']!==_0xebb8('0x3f')){var _0x44d8d5={};_0x44d8d5[_0x115772['name']]={'$like':'%'+_0x44c41d[_0xebb8('0x30')][_0xebb8('0x3d')]+'%'};return _0x44d8d5;}})});}_0x253cb2=_['merge']({},_0x253cb2,_0x44c41d[_0xebb8('0x40')]);var _0x515a88={'where':_0x253cb2['where']};return db[_0xebb8('0x2b')][_0xebb8('0x1c')](_0x515a88)[_0xebb8('0x23')](function(_0x2d332a){_0x54d0e4[_0xebb8('0x1c')]=_0x2d332a;if(_0x44c41d[_0xebb8('0x30')][_0xebb8('0x41')]){_0x253cb2['include']=[{'all':!![]}];}return db['MailServerOut'][_0xebb8('0x42')](_0x253cb2);})[_0xebb8('0x23')](function(_0x5f24a7){_0x54d0e4[_0xebb8('0x43')]=_0x5f24a7;return _0x54d0e4;})[_0xebb8('0x23')](respondWithFilteredResult(_0x2c1c48,_0x253cb2))[_0xebb8('0x44')](handleError(_0x2c1c48,null));};exports[_0xebb8('0x45')]=function(_0x49a057,_0x1f8ad1){var _0x4f35ee={'raw':!![],'where':{'id':_0x49a057[_0xebb8('0x46')]['id']}},_0x11a97a={};_0x11a97a['model']=_[_0xebb8('0x31')](db[_0xebb8('0x2b')][_0xebb8('0x2c')]);_0x11a97a['query']=_[_0xebb8('0x31')](_0x49a057[_0xebb8('0x30')]);_0x11a97a[_0xebb8('0x32')]=_['intersection'](_0x11a97a['model'],_0x11a97a[_0xebb8('0x30')]);_0x4f35ee[_0xebb8('0x34')]=_[_0xebb8('0x33')](_0x11a97a[_0xebb8('0x2f')],qs[_0xebb8('0x35')](_0x49a057[_0xebb8('0x30')]['fields']));_0x4f35ee['attributes']=_0x4f35ee[_0xebb8('0x34')][_0xebb8('0x36')]?_0x4f35ee[_0xebb8('0x34')]:_0x11a97a[_0xebb8('0x2f')];if(_0x49a057[_0xebb8('0x30')]['includeAll']){_0x4f35ee['include']=[{'all':!![]}];}_0x4f35ee=_[_0xebb8('0x3e')]({},_0x4f35ee,_0x49a057[_0xebb8('0x40')]);return db[_0xebb8('0x2b')]['find'](_0x4f35ee)[_0xebb8('0x23')](handleEntityNotFound(_0x1f8ad1,null))[_0xebb8('0x23')](respondWithResult(_0x1f8ad1,null))[_0xebb8('0x44')](handleError(_0x1f8ad1,null));};exports[_0xebb8('0x47')]=function(_0x38f7e2,_0x2ccc64){return db[_0xebb8('0x2b')][_0xebb8('0x47')](_0x38f7e2[_0xebb8('0x48')],{})[_0xebb8('0x23')](respondWithResult(_0x2ccc64,0xc9))['catch'](handleError(_0x2ccc64,null));};exports[_0xebb8('0x22')]=function(_0x56f9c3,_0x3f4a49){if(_0x56f9c3[_0xebb8('0x48')]['id']){delete _0x56f9c3[_0xebb8('0x48')]['id'];}return db['MailServerOut'][_0xebb8('0x49')]({'where':{'id':_0x56f9c3[_0xebb8('0x46')]['id']}})[_0xebb8('0x23')](handleEntityNotFound(_0x3f4a49,null))[_0xebb8('0x23')](saveUpdates(_0x56f9c3[_0xebb8('0x48')],null))['then'](respondWithResult(_0x3f4a49,null))[_0xebb8('0x44')](handleError(_0x3f4a49,null));};exports[_0xebb8('0x24')]=function(_0x2f1219,_0x5680fd){return db[_0xebb8('0x2b')][_0xebb8('0x49')]({'where':{'id':_0x2f1219[_0xebb8('0x46')]['id']}})[_0xebb8('0x23')](handleEntityNotFound(_0x5680fd,null))[_0xebb8('0x23')](removeEntity(_0x5680fd,null))[_0xebb8('0x44')](handleError(_0x5680fd,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index a817d52..1e733c9 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 _0x6fcc=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports','define','MailServerOut','mail_servers_out'];(function(_0x513231,_0x1359e6){var _0x2e563e=function(_0x33572a){while(--_0x33572a){_0x513231['push'](_0x513231['shift']());}};_0x2e563e(++_0x1359e6);}(_0x6fcc,0x176));var _0xc6fc=function(_0x48360f,_0x4fefcf){_0x48360f=_0x48360f-0x0;var _0x6bd90d=_0x6fcc[_0x48360f];return _0x6bd90d;};'use strict';var _=require(_0xc6fc('0x0'));var util=require('util');var logger=require(_0xc6fc('0x1'))('api');var moment=require(_0xc6fc('0x2'));var BPromise=require(_0xc6fc('0x3'));var rp=require(_0xc6fc('0x4'));var fs=require('fs');var path=require(_0xc6fc('0x5'));var rimraf=require(_0xc6fc('0x6'));var config=require('../../config/environment');var attributes=require('./mailServerOut.attributes');module[_0xc6fc('0x7')]=function(_0x10c08e,_0x4d631f){return _0x10c08e[_0xc6fc('0x8')](_0xc6fc('0x9'),attributes,{'tableName':_0xc6fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1729=['api','moment','bluebird','rimraf','../../config/environment','./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','lodash','util'];(function(_0x4830fa,_0x6bc819){var _0x2f8d5b=function(_0x17704d){while(--_0x17704d){_0x4830fa['push'](_0x4830fa['shift']());}};_0x2f8d5b(++_0x6bc819);}(_0x1729,0xf0));var _0x9172=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x1729[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x9172('0x0'));var util=require(_0x9172('0x1'));var logger=require('../../config/logger')(_0x9172('0x2'));var moment=require(_0x9172('0x3'));var BPromise=require(_0x9172('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9172('0x5'));var config=require(_0x9172('0x6'));var attributes=require(_0x9172('0x7'));module[_0x9172('0x8')]=function(_0x29a0b9,_0x932d7f){return _0x29a0b9['define'](_0x9172('0x9'),attributes,{'tableName':_0x9172('0xa'),'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 1ad449d..46bc131 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 _0x1261=['then','info','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\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(_0x4d9255,_0x374413){var _0x19442c=function(_0x10ed9b){while(--_0x10ed9b){_0x4d9255['push'](_0x4d9255['shift']());}};_0x19442c(++_0x374413);}(_0x1261,0x144));var _0x1126=function(_0x310eb9,_0x1aed15){_0x310eb9=_0x310eb9-0x0;var _0x28915c=_0x1261[_0x310eb9];return _0x28915c;};'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')]('MailServerOut,\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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x2cda48,_0x49b254){var _0x2fb41e=function(_0x5b9731){while(--_0x5b9731){_0x2cda48['push'](_0x2cda48['shift']());}};_0x2fb41e(++_0x49b254);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xc4aa[_0x1caf6a];return _0x1bf493;};'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});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index a3be599..af66bd6 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 _0xf413=['../../config/environment','./mailSubstatus.controller','isAuthenticated','index','get','/describe','describe','/:id','show','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x311be9,_0x12b742){var _0x27f742=function(_0x42282e){while(--_0x42282e){_0x311be9['push'](_0x311be9['shift']());}};_0x27f742(++_0x12b742);}(_0xf413,0x66));var _0x3f41=function(_0x584233,_0x5cf2cf){_0x584233=_0x584233-0x0;var _0x465b30=_0xf413[_0x584233];return _0x465b30;};'use strict';var multer=require(_0x3f41('0x0'));var util=require(_0x3f41('0x1'));var path=require(_0x3f41('0x2'));var timeout=require(_0x3f41('0x3'));var express=require(_0x3f41('0x4'));var router=express[_0x3f41('0x5')]();var fs_extra=require(_0x3f41('0x6'));var auth=require(_0x3f41('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x3f41('0x8'));var controller=require(_0x3f41('0x9'));router['get']('/',auth[_0x3f41('0xa')](),controller[_0x3f41('0xb')]);router[_0x3f41('0xc')](_0x3f41('0xd'),auth['isAuthenticated'](),controller[_0x3f41('0xe')]);router[_0x3f41('0xc')](_0x3f41('0xf'),auth[_0x3f41('0xa')](),controller[_0x3f41('0x10')]);router['post']('/',auth[_0x3f41('0xa')](),controller[_0x3f41('0x11')]);router['put'](_0x3f41('0xf'),auth[_0x3f41('0xa')](),controller[_0x3f41('0x12')]);router[_0x3f41('0x13')](_0x3f41('0xf'),auth[_0x3f41('0xa')](),controller[_0x3f41('0x14')]);module[_0x3f41('0x15')]=router; \ No newline at end of file +var _0xc297=['show','post','put','update','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./mailSubstatus.controller','get','isAuthenticated','index','/describe'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xc297,0x16a));var _0x7c29=function(_0x1a8bbc,_0x17a086){_0x1a8bbc=_0x1a8bbc-0x0;var _0x212fc2=_0xc297[_0x1a8bbc];return _0x212fc2;};'use strict';var multer=require('multer');var util=require(_0x7c29('0x0'));var path=require(_0x7c29('0x1'));var timeout=require(_0x7c29('0x2'));var express=require(_0x7c29('0x3'));var router=express[_0x7c29('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7c29('0x5'));var interaction=require(_0x7c29('0x6'));var config=require('../../config/environment');var controller=require(_0x7c29('0x7'));router[_0x7c29('0x8')]('/',auth[_0x7c29('0x9')](),controller[_0x7c29('0xa')]);router['get'](_0x7c29('0xb'),auth[_0x7c29('0x9')](),controller['describe']);router[_0x7c29('0x8')]('/:id',auth[_0x7c29('0x9')](),controller[_0x7c29('0xc')]);router[_0x7c29('0xd')]('/',auth[_0x7c29('0x9')](),controller['create']);router[_0x7c29('0xe')]('/:id',auth[_0x7c29('0x9')](),controller[_0x7c29('0xf')]);router['delete']('/:id',auth[_0x7c29('0x9')](),controller['destroy']);module[_0x7c29('0x10')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 92721f9..e8fc7f3 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 _0xdfa0=['sequelize','STRING','name'];(function(_0x4b3e49,_0x9e566c){var _0x57e339=function(_0x1430e9){while(--_0x1430e9){_0x4b3e49['push'](_0x4b3e49['shift']());}};_0x57e339(++_0x9e566c);}(_0xdfa0,0x69));var _0x0dfa=function(_0x14c868,_0x15b75a){_0x14c868=_0x14c868-0x0;var _0x18e7cd=_0xdfa0[_0x14c868];return _0x18e7cd;};'use strict';var Sequelize=require(_0x0dfa('0x0'));module['exports']={'name':{'type':Sequelize[_0x0dfa('0x1')],'unique':_0x0dfa('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4317=['name','exports','STRING'];(function(_0x3d8c29,_0x11b887){var _0x31a1c3=function(_0x5dff10){while(--_0x5dff10){_0x3d8c29['push'](_0x3d8c29['shift']());}};_0x31a1c3(++_0x11b887);}(_0x4317,0x7c));var _0x7431=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x4317[_0x2b4411];return _0x8e41ef;};'use strict';var Sequelize=require('sequelize');module[_0x7431('0x0')]={'name':{'type':Sequelize[_0x7431('0x1')],'unique':_0x7431('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index d1e4c30..33f7db3 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 _0x0105=['update','then','destroy','error','stack','name','send','index','map','MailSubstatus','rawAttributes','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','describe','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','json','save'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x0105,0x1dc));var _0x5010=function(_0x5ee973,_0x5bc5c0){_0x5ee973=_0x5ee973-0x0;var _0x311971=_0x0105[_0x5ee973];return _0x311971;};'use strict';var emlformat=require(_0x5010('0x0'));var rimraf=require(_0x5010('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5010('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5010('0x3'));var Mustache=require(_0x5010('0x4'));var util=require(_0x5010('0x5'));var path=require(_0x5010('0x6'));var sox=require(_0x5010('0x7'));var csv=require(_0x5010('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5010('0x9'));var _=require(_0x5010('0xa'));var squel=require(_0x5010('0xb'));var crypto=require(_0x5010('0xc'));var jsforce=require(_0x5010('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5010('0x8'));var querystring=require(_0x5010('0xe'));var Papa=require(_0x5010('0xf'));var Redis=require(_0x5010('0x10'));var authService=require(_0x5010('0x11'));var qs=require(_0x5010('0x12'));var as=require(_0x5010('0x13'));var hardwareService=require(_0x5010('0x14'));var logger=require(_0x5010('0x15'))(_0x5010('0x16'));var utils=require('../../config/utils');var config=require(_0x5010('0x17'));var licenseUtil=require(_0x5010('0x18'));var db=require(_0x5010('0x19'))['db'];function respondWithStatusCode(_0x2d392c,_0x2be8ad){_0x2be8ad=_0x2be8ad||0xcc;return function(_0x1438b7){if(_0x1438b7){return _0x2d392c['sendStatus'](_0x2be8ad);}return _0x2d392c[_0x5010('0x1a')](_0x2be8ad)[_0x5010('0x1b')]();};}function respondWithResult(_0x2f1d22,_0x59ae74){_0x59ae74=_0x59ae74||0xc8;return function(_0x59a5e5){if(_0x59a5e5){return _0x2f1d22[_0x5010('0x1a')](_0x59ae74)['json'](_0x59a5e5);}};}function respondWithFilteredResult(_0x26b1a0,_0x3216a1){return function(_0x71b4b6){if(_0x71b4b6){var _0x21254=typeof _0x3216a1[_0x5010('0x1c')]===_0x5010('0x1d')&&typeof _0x3216a1[_0x5010('0x1e')]===_0x5010('0x1d');var _0x333f3b=_0x71b4b6[_0x5010('0x1f')];var _0x32bc28=_0x21254?0x0:_0x3216a1[_0x5010('0x1c')];var _0x22c494=_0x21254?_0x71b4b6[_0x5010('0x1f')]:_0x3216a1[_0x5010('0x1c')]+_0x3216a1[_0x5010('0x1e')];var _0x24f16a;if(_0x22c494>=_0x333f3b){_0x22c494=_0x333f3b;_0x24f16a=0xc8;}else{_0x24f16a=0xce;}_0x26b1a0[_0x5010('0x1a')](_0x24f16a);return _0x26b1a0['set'](_0x5010('0x20'),_0x32bc28+'-'+_0x22c494+'/'+_0x333f3b)[_0x5010('0x21')](_0x71b4b6);}return null;};}function patchUpdates(_0x520583){return function(_0x4e4fed){try{jsonpatch['apply'](_0x4e4fed,_0x520583,!![]);}catch(_0x4e5957){return BPromise['reject'](_0x4e5957);}return _0x4e4fed[_0x5010('0x22')]();};}function saveUpdates(_0x4968fe,_0x18fa23){return function(_0x2fe8dc){if(_0x2fe8dc){return _0x2fe8dc[_0x5010('0x23')](_0x4968fe)[_0x5010('0x24')](function(_0x4522d1){return _0x4522d1;});}return null;};}function removeEntity(_0x2cc4cb,_0x2fb790){return function(_0x34cc36){if(_0x34cc36){return _0x34cc36[_0x5010('0x25')]()[_0x5010('0x24')](function(){_0x2cc4cb[_0x5010('0x1a')](0xcc)[_0x5010('0x1b')]();});}};}function handleEntityNotFound(_0x375d26,_0x57a93d){return function(_0x7151a){if(!_0x7151a){_0x375d26['sendStatus'](0x194);}return _0x7151a;};}function handleError(_0x4bbcb0,_0x2ca1c7){_0x2ca1c7=_0x2ca1c7||0x1f4;return function(_0x12e620){logger[_0x5010('0x26')](_0x12e620[_0x5010('0x27')]);if(_0x12e620[_0x5010('0x28')]){delete _0x12e620['name'];}_0x4bbcb0[_0x5010('0x1a')](_0x2ca1c7)[_0x5010('0x29')](_0x12e620);};}exports[_0x5010('0x2a')]=function(_0x14e185,_0x1d6432){var _0x11bc56={},_0x2e73d4={},_0x37f426={'count':0x0,'rows':[]};var _0x2219be=_[_0x5010('0x2b')](db[_0x5010('0x2c')][_0x5010('0x2d')],function(_0x33305e){return{'name':_0x33305e['fieldName'],'type':_0x33305e['type']['key']};});_0x2e73d4[_0x5010('0x2e')]=_[_0x5010('0x2b')](_0x2219be,_0x5010('0x28'));_0x2e73d4[_0x5010('0x2f')]=_[_0x5010('0x30')](_0x14e185[_0x5010('0x2f')]);_0x2e73d4[_0x5010('0x31')]=_['intersection'](_0x2e73d4[_0x5010('0x2e')],_0x2e73d4[_0x5010('0x2f')]);_0x11bc56[_0x5010('0x32')]=_[_0x5010('0x33')](_0x2e73d4[_0x5010('0x2e')],qs[_0x5010('0x34')](_0x14e185[_0x5010('0x2f')]['fields']));_0x11bc56[_0x5010('0x32')]=_0x11bc56[_0x5010('0x32')]['length']?_0x11bc56[_0x5010('0x32')]:_0x2e73d4[_0x5010('0x2e')];if(!_0x14e185[_0x5010('0x2f')][_0x5010('0x35')]('nolimit')){_0x11bc56[_0x5010('0x1e')]=qs['limit'](_0x14e185[_0x5010('0x2f')][_0x5010('0x1e')]);_0x11bc56['offset']=qs[_0x5010('0x1c')](_0x14e185['query'][_0x5010('0x1c')]);}_0x11bc56[_0x5010('0x36')]=qs[_0x5010('0x37')](_0x14e185['query']['sort']);_0x11bc56[_0x5010('0x38')]=qs['filters'](_[_0x5010('0x39')](_0x14e185[_0x5010('0x2f')],_0x2e73d4[_0x5010('0x31')]),_0x2219be);if(_0x14e185[_0x5010('0x2f')][_0x5010('0x3a')]){_0x11bc56[_0x5010('0x38')]=_[_0x5010('0x3b')](_0x11bc56['where'],{'$or':_[_0x5010('0x2b')](_0x2219be,function(_0x25523e){if(_0x25523e[_0x5010('0x3c')]!=='VIRTUAL'){var _0x9c5d80={};_0x9c5d80[_0x25523e[_0x5010('0x28')]]={'$like':'%'+_0x14e185[_0x5010('0x2f')][_0x5010('0x3a')]+'%'};return _0x9c5d80;}})});}_0x11bc56=_[_0x5010('0x3b')]({},_0x11bc56,_0x14e185[_0x5010('0x3d')]);var _0x38639b={'where':_0x11bc56[_0x5010('0x38')]};return db['MailSubstatus'][_0x5010('0x1f')](_0x38639b)[_0x5010('0x24')](function(_0x55785d){_0x37f426[_0x5010('0x1f')]=_0x55785d;if(_0x14e185['query'][_0x5010('0x3e')]){_0x11bc56[_0x5010('0x3f')]=[{'all':!![]}];}return db[_0x5010('0x2c')][_0x5010('0x40')](_0x11bc56);})[_0x5010('0x24')](function(_0x27ef48){_0x37f426[_0x5010('0x41')]=_0x27ef48;return _0x37f426;})[_0x5010('0x24')](respondWithFilteredResult(_0x1d6432,_0x11bc56))[_0x5010('0x42')](handleError(_0x1d6432,null));};exports['show']=function(_0x2b0fe4,_0x27e4ca){var _0x239564={'raw':!![],'where':{'id':_0x2b0fe4[_0x5010('0x43')]['id']}},_0x18a468={};_0x18a468[_0x5010('0x2e')]=_['keys'](db['MailSubstatus']['rawAttributes']);_0x18a468[_0x5010('0x2f')]=_['keys'](_0x2b0fe4[_0x5010('0x2f')]);_0x18a468['filters']=_[_0x5010('0x33')](_0x18a468['model'],_0x18a468[_0x5010('0x2f')]);_0x239564[_0x5010('0x32')]=_[_0x5010('0x33')](_0x18a468[_0x5010('0x2e')],qs[_0x5010('0x34')](_0x2b0fe4[_0x5010('0x2f')][_0x5010('0x34')]));_0x239564[_0x5010('0x32')]=_0x239564['attributes'][_0x5010('0x44')]?_0x239564['attributes']:_0x18a468['model'];if(_0x2b0fe4['query'][_0x5010('0x3e')]){_0x239564[_0x5010('0x3f')]=[{'all':!![]}];}_0x239564=_[_0x5010('0x3b')]({},_0x239564,_0x2b0fe4[_0x5010('0x3d')]);return db[_0x5010('0x2c')][_0x5010('0x45')](_0x239564)[_0x5010('0x24')](handleEntityNotFound(_0x27e4ca,null))[_0x5010('0x24')](respondWithResult(_0x27e4ca,null))[_0x5010('0x42')](handleError(_0x27e4ca,null));};exports[_0x5010('0x46')]=function(_0x66bbbb,_0xbcdb10){return db[_0x5010('0x2c')][_0x5010('0x46')](_0x66bbbb['body'],{})[_0x5010('0x24')](respondWithResult(_0xbcdb10,0xc9))[_0x5010('0x42')](handleError(_0xbcdb10,null));};exports[_0x5010('0x23')]=function(_0x4af82e,_0x2fbed5){if(_0x4af82e[_0x5010('0x47')]['id']){delete _0x4af82e[_0x5010('0x47')]['id'];}return db[_0x5010('0x2c')][_0x5010('0x45')]({'where':{'id':_0x4af82e['params']['id']}})['then'](handleEntityNotFound(_0x2fbed5,null))['then'](saveUpdates(_0x4af82e[_0x5010('0x47')],null))['then'](respondWithResult(_0x2fbed5,null))['catch'](handleError(_0x2fbed5,null));};exports[_0x5010('0x25')]=function(_0x48ce68,_0x4e7c15){return db['MailSubstatus'][_0x5010('0x45')]({'where':{'id':_0x48ce68[_0x5010('0x43')]['id']}})[_0x5010('0x24')](handleEntityNotFound(_0x4e7c15,null))[_0x5010('0x24')](removeEntity(_0x4e7c15,null))[_0x5010('0x42')](handleError(_0x4e7c15,null));};exports['describe']=function(_0x4e17a8,_0x382cbb){return db[_0x5010('0x2c')][_0x5010('0x48')]()[_0x5010('0x24')](respondWithResult(_0x382cbb,null))[_0x5010('0x42')](handleError(_0x382cbb,null));}; \ No newline at end of file +var _0xafab=['order','sort','where','filter','merge','includeAll','include','findAll','catch','params','fields','options','find','create','body','update','describe','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','MailSubstatus','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit'];(function(_0x38abbd,_0x547fa3){var _0x330555=function(_0x16355c){while(--_0x16355c){_0x38abbd['push'](_0x38abbd['shift']());}};_0x330555(++_0x547fa3);}(_0xafab,0x13d));var _0xbafa=function(_0x510886,_0x1f9fe3){_0x510886=_0x510886-0x0;var _0x5e776d=_0xafab[_0x510886];return _0x5e776d;};'use strict';var emlformat=require(_0xbafa('0x0'));var rimraf=require(_0xbafa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbafa('0x2'));var moment=require(_0xbafa('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbafa('0x4'));var util=require(_0xbafa('0x5'));var path=require(_0xbafa('0x6'));var sox=require(_0xbafa('0x7'));var csv=require(_0xbafa('0x8'));var ejs=require(_0xbafa('0x9'));var fs=require('fs');var fs_extra=require(_0xbafa('0xa'));var _=require(_0xbafa('0xb'));var squel=require(_0xbafa('0xc'));var crypto=require(_0xbafa('0xd'));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(_0xbafa('0xe'));var authService=require(_0xbafa('0xf'));var qs=require(_0xbafa('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbafa('0x11'));var logger=require(_0xbafa('0x12'))(_0xbafa('0x13'));var utils=require(_0xbafa('0x14'));var config=require(_0xbafa('0x15'));var licenseUtil=require(_0xbafa('0x16'));var db=require(_0xbafa('0x17'))['db'];function respondWithStatusCode(_0x519d99,_0x1d7db7){_0x1d7db7=_0x1d7db7||0xcc;return function(_0x53237c){if(_0x53237c){return _0x519d99[_0xbafa('0x18')](_0x1d7db7);}return _0x519d99[_0xbafa('0x19')](_0x1d7db7)[_0xbafa('0x1a')]();};}function respondWithResult(_0x5b6fb5,_0x11e999){_0x11e999=_0x11e999||0xc8;return function(_0xe15b11){if(_0xe15b11){return _0x5b6fb5[_0xbafa('0x19')](_0x11e999)[_0xbafa('0x1b')](_0xe15b11);}};}function respondWithFilteredResult(_0x4d4b1f,_0x4951e0){return function(_0x19799c){if(_0x19799c){var _0x31f4a3=typeof _0x4951e0[_0xbafa('0x1c')]===_0xbafa('0x1d')&&typeof _0x4951e0['limit']===_0xbafa('0x1d');var _0x8575cc=_0x19799c[_0xbafa('0x1e')];var _0x5f3caf=_0x31f4a3?0x0:_0x4951e0[_0xbafa('0x1c')];var _0x87e1a1=_0x31f4a3?_0x19799c['count']:_0x4951e0[_0xbafa('0x1c')]+_0x4951e0[_0xbafa('0x1f')];var _0x17581d;if(_0x87e1a1>=_0x8575cc){_0x87e1a1=_0x8575cc;_0x17581d=0xc8;}else{_0x17581d=0xce;}_0x4d4b1f[_0xbafa('0x19')](_0x17581d);return _0x4d4b1f[_0xbafa('0x20')](_0xbafa('0x21'),_0x5f3caf+'-'+_0x87e1a1+'/'+_0x8575cc)[_0xbafa('0x1b')](_0x19799c);}return null;};}function patchUpdates(_0x11a5aa){return function(_0x482083){try{jsonpatch[_0xbafa('0x22')](_0x482083,_0x11a5aa,!![]);}catch(_0x13785c){return BPromise[_0xbafa('0x23')](_0x13785c);}return _0x482083[_0xbafa('0x24')]();};}function saveUpdates(_0x283704,_0x91051b){return function(_0x3efd4c){if(_0x3efd4c){return _0x3efd4c['update'](_0x283704)[_0xbafa('0x25')](function(_0x469f35){return _0x469f35;});}return null;};}function removeEntity(_0x4398cc,_0x14b74e){return function(_0x4089b1){if(_0x4089b1){return _0x4089b1[_0xbafa('0x26')]()[_0xbafa('0x25')](function(){_0x4398cc[_0xbafa('0x19')](0xcc)[_0xbafa('0x1a')]();});}};}function handleEntityNotFound(_0x44988f,_0x1584a8){return function(_0x56be10){if(!_0x56be10){_0x44988f[_0xbafa('0x18')](0x194);}return _0x56be10;};}function handleError(_0x40487d,_0x444ec5){_0x444ec5=_0x444ec5||0x1f4;return function(_0x37b2bf){logger[_0xbafa('0x27')](_0x37b2bf[_0xbafa('0x28')]);if(_0x37b2bf[_0xbafa('0x29')]){delete _0x37b2bf[_0xbafa('0x29')];}_0x40487d['status'](_0x444ec5)[_0xbafa('0x2a')](_0x37b2bf);};}exports[_0xbafa('0x2b')]=function(_0x7bd027,_0x587bf8){var _0xfcec8e={},_0x51deff={},_0x55ef6f={'count':0x0,'rows':[]};var _0x55f4db=_[_0xbafa('0x2c')](db[_0xbafa('0x2d')][_0xbafa('0x2e')],function(_0x813a92){return{'name':_0x813a92['fieldName'],'type':_0x813a92[_0xbafa('0x2f')][_0xbafa('0x30')]};});_0x51deff[_0xbafa('0x31')]=_[_0xbafa('0x2c')](_0x55f4db,_0xbafa('0x29'));_0x51deff[_0xbafa('0x32')]=_[_0xbafa('0x33')](_0x7bd027[_0xbafa('0x32')]);_0x51deff[_0xbafa('0x34')]=_[_0xbafa('0x35')](_0x51deff['model'],_0x51deff[_0xbafa('0x32')]);_0xfcec8e[_0xbafa('0x36')]=_[_0xbafa('0x35')](_0x51deff['model'],qs['fields'](_0x7bd027[_0xbafa('0x32')]['fields']));_0xfcec8e[_0xbafa('0x36')]=_0xfcec8e[_0xbafa('0x36')][_0xbafa('0x37')]?_0xfcec8e[_0xbafa('0x36')]:_0x51deff['model'];if(!_0x7bd027[_0xbafa('0x32')][_0xbafa('0x38')](_0xbafa('0x39'))){_0xfcec8e['limit']=qs[_0xbafa('0x1f')](_0x7bd027[_0xbafa('0x32')][_0xbafa('0x1f')]);_0xfcec8e[_0xbafa('0x1c')]=qs[_0xbafa('0x1c')](_0x7bd027[_0xbafa('0x32')]['offset']);}_0xfcec8e[_0xbafa('0x3a')]=qs['sort'](_0x7bd027[_0xbafa('0x32')][_0xbafa('0x3b')]);_0xfcec8e[_0xbafa('0x3c')]=qs['filters'](_['pick'](_0x7bd027[_0xbafa('0x32')],_0x51deff['filters']),_0x55f4db);if(_0x7bd027['query'][_0xbafa('0x3d')]){_0xfcec8e[_0xbafa('0x3c')]=_[_0xbafa('0x3e')](_0xfcec8e[_0xbafa('0x3c')],{'$or':_[_0xbafa('0x2c')](_0x55f4db,function(_0x240e5b){if(_0x240e5b[_0xbafa('0x2f')]!=='VIRTUAL'){var _0x46f583={};_0x46f583[_0x240e5b[_0xbafa('0x29')]]={'$like':'%'+_0x7bd027[_0xbafa('0x32')][_0xbafa('0x3d')]+'%'};return _0x46f583;}})});}_0xfcec8e=_[_0xbafa('0x3e')]({},_0xfcec8e,_0x7bd027['options']);var _0x47f05f={'where':_0xfcec8e[_0xbafa('0x3c')]};return db[_0xbafa('0x2d')][_0xbafa('0x1e')](_0x47f05f)[_0xbafa('0x25')](function(_0x237ffe){_0x55ef6f[_0xbafa('0x1e')]=_0x237ffe;if(_0x7bd027[_0xbafa('0x32')][_0xbafa('0x3f')]){_0xfcec8e[_0xbafa('0x40')]=[{'all':!![]}];}return db[_0xbafa('0x2d')][_0xbafa('0x41')](_0xfcec8e);})[_0xbafa('0x25')](function(_0x544e07){_0x55ef6f['rows']=_0x544e07;return _0x55ef6f;})[_0xbafa('0x25')](respondWithFilteredResult(_0x587bf8,_0xfcec8e))[_0xbafa('0x42')](handleError(_0x587bf8,null));};exports['show']=function(_0x142b33,_0x117186){var _0x5ce16a={'raw':!![],'where':{'id':_0x142b33[_0xbafa('0x43')]['id']}},_0x45e09b={};_0x45e09b[_0xbafa('0x31')]=_[_0xbafa('0x33')](db['MailSubstatus'][_0xbafa('0x2e')]);_0x45e09b[_0xbafa('0x32')]=_[_0xbafa('0x33')](_0x142b33[_0xbafa('0x32')]);_0x45e09b['filters']=_[_0xbafa('0x35')](_0x45e09b['model'],_0x45e09b[_0xbafa('0x32')]);_0x5ce16a[_0xbafa('0x36')]=_[_0xbafa('0x35')](_0x45e09b[_0xbafa('0x31')],qs['fields'](_0x142b33[_0xbafa('0x32')][_0xbafa('0x44')]));_0x5ce16a[_0xbafa('0x36')]=_0x5ce16a['attributes']['length']?_0x5ce16a[_0xbafa('0x36')]:_0x45e09b[_0xbafa('0x31')];if(_0x142b33[_0xbafa('0x32')]['includeAll']){_0x5ce16a[_0xbafa('0x40')]=[{'all':!![]}];}_0x5ce16a=_['merge']({},_0x5ce16a,_0x142b33[_0xbafa('0x45')]);return db[_0xbafa('0x2d')][_0xbafa('0x46')](_0x5ce16a)[_0xbafa('0x25')](handleEntityNotFound(_0x117186,null))[_0xbafa('0x25')](respondWithResult(_0x117186,null))[_0xbafa('0x42')](handleError(_0x117186,null));};exports[_0xbafa('0x47')]=function(_0x1e29b8,_0x2cb5ac){return db[_0xbafa('0x2d')][_0xbafa('0x47')](_0x1e29b8[_0xbafa('0x48')],{})[_0xbafa('0x25')](respondWithResult(_0x2cb5ac,0xc9))['catch'](handleError(_0x2cb5ac,null));};exports[_0xbafa('0x49')]=function(_0x29fc99,_0x5d7d8a){if(_0x29fc99[_0xbafa('0x48')]['id']){delete _0x29fc99[_0xbafa('0x48')]['id'];}return db[_0xbafa('0x2d')]['find']({'where':{'id':_0x29fc99[_0xbafa('0x43')]['id']}})[_0xbafa('0x25')](handleEntityNotFound(_0x5d7d8a,null))[_0xbafa('0x25')](saveUpdates(_0x29fc99['body'],null))[_0xbafa('0x25')](respondWithResult(_0x5d7d8a,null))[_0xbafa('0x42')](handleError(_0x5d7d8a,null));};exports[_0xbafa('0x26')]=function(_0x24b6e8,_0x43baac){return db['MailSubstatus']['find']({'where':{'id':_0x24b6e8[_0xbafa('0x43')]['id']}})['then'](handleEntityNotFound(_0x43baac,null))['then'](removeEntity(_0x43baac,null))[_0xbafa('0x42')](handleError(_0x43baac,null));};exports['describe']=function(_0x3da7d2,_0x2795a0){return db[_0xbafa('0x2d')][_0xbafa('0x4a')]()[_0xbafa('0x25')](respondWithResult(_0x2795a0,null))[_0xbafa('0x42')](handleError(_0x2795a0,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index a380c43..c3763de 100644 --- a/server/api/mailSubstatus/mailSubstatus.events.js +++ b/server/api/mailSubstatus/mailSubstatus.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa930=['exports','events','MailSubstatus','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x418fa3,_0x464468){var _0x845083=function(_0x12b8ae){while(--_0x12b8ae){_0x418fa3['push'](_0x418fa3['shift']());}};_0x845083(++_0x464468);}(_0xa930,0xb1));var _0x0a93=function(_0x4f8d05,_0x3c7053){_0x4f8d05=_0x4f8d05-0x0;var _0x2087d9=_0xa930[_0x4f8d05];return _0x2087d9;};'use strict';var EventEmitter=require(_0x0a93('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0x0a93('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0x0a93('0x2')](0x0);var events={'afterUpdate':_0x0a93('0x3')};function emitEvent(_0x4235a4){return function(_0x170f0a,_0x3c003e,_0x3a1e24){MailSubstatusEvents[_0x0a93('0x4')](_0x4235a4+':'+_0x170f0a['id'],_0x170f0a);MailSubstatusEvents[_0x0a93('0x4')](_0x4235a4,_0x170f0a);_0x3a1e24(null);};}for(var e in events){if(events[_0x0a93('0x5')](e)){var event=events[e];MailSubstatus[_0x0a93('0x6')](e,emitEvent(event));}}module[_0x0a93('0x7')]=MailSubstatusEvents; \ No newline at end of file +var _0xa93d=['hasOwnProperty','hook','exports','events','MailSubstatus','setMaxListeners','update','emit'];(function(_0x4389d6,_0x58768d){var _0x3f279b=function(_0x1a4764){while(--_0x1a4764){_0x4389d6['push'](_0x4389d6['shift']());}};_0x3f279b(++_0x58768d);}(_0xa93d,0x18b));var _0xda93=function(_0x136032,_0xe0aa1e){_0x136032=_0x136032-0x0;var _0x109a79=_0xa93d[_0x136032];return _0x109a79;};'use strict';var EventEmitter=require(_0xda93('0x0'));var MailSubstatus=require('../../mysqldb')['db'][_0xda93('0x1')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xda93('0x2')](0x0);var events={'afterUpdate':_0xda93('0x3')};function emitEvent(_0x5e7889){return function(_0x3ce5b2,_0x565990,_0x3e885b){MailSubstatusEvents['emit'](_0x5e7889+':'+_0x3ce5b2['id'],_0x3ce5b2);MailSubstatusEvents[_0xda93('0x4')](_0x5e7889,_0x3ce5b2);_0x3e885b(null);};}for(var e in events){if(events[_0xda93('0x5')](e)){var event=events[e];MailSubstatus[_0xda93('0x6')](e,emitEvent(event));}}module[_0xda93('0x7')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 1f8c88f..80d0d15 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 _0xf0ae=['mailSubstatus','_previousDataValues','then','catch','exports','models','define','MailSubstatus','update','name'];(function(_0x3aa0c7,_0x4c6217){var _0x1b9df3=function(_0xc9fcf9){while(--_0xc9fcf9){_0x3aa0c7['push'](_0x3aa0c7['shift']());}};_0x1b9df3(++_0x4c6217);}(_0xf0ae,0x14e));var _0xef0a=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xf0ae[_0x1d24eb];return _0x1dc576;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0xef0a('0x0')]=function(_0xf4c9d2){var _0x4b540d=_0xf4c9d2[_0xef0a('0x1')];return _0xf4c9d2[_0xef0a('0x2')](_0xef0a('0x3'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x204a3b,_0x1e8fdd,_0xc8ed19){return _0x4b540d['Condition'][_0xef0a('0x4')]({'value':_0x204a3b[_0xef0a('0x5')]},{'where':{'field':_0xef0a('0x6'),'value':_0x204a3b[_0xef0a('0x7')]['name']}})[_0xef0a('0x8')](function(){_0xc8ed19();})[_0xef0a('0x9')](function(_0x33abe4){_0xc8ed19(_0x33abe4);});}}});}; \ No newline at end of file +var _0xa122=['name','mailSubstatus','_previousDataValues','then','catch','MailSubstatus','mail_substatuses'];(function(_0x1c1589,_0x44d1fd){var _0x17792d=function(_0x2e9ed1){while(--_0x2e9ed1){_0x1c1589['push'](_0x1c1589['shift']());}};_0x17792d(++_0x44d1fd);}(_0xa122,0x116));var _0x2a12=function(_0x4e9e2b,_0x337519){_0x4e9e2b=_0x4e9e2b-0x0;var _0x1c1965=_0xa122[_0x4e9e2b];return _0x1c1965;};'use strict';var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x5577f1){var _0x44ca26=_0x5577f1['models'];return _0x5577f1['define'](_0x2a12('0x0'),attributes,{'tableName':_0x2a12('0x1'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x4e4ed7,_0x4c9eed,_0x10a731){return _0x44ca26['Condition']['update']({'value':_0x4e4ed7[_0x2a12('0x2')]},{'where':{'field':_0x2a12('0x3'),'value':_0x4e4ed7[_0x2a12('0x4')][_0x2a12('0x2')]}})[_0x2a12('0x5')](function(){_0x10a731();})[_0x2a12('0x6')](function(_0x54b660){_0x10a731(_0x54b660);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 22c6bdd..8078251 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 _0x0eab=['http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x16db8b,_0xca7d28){var _0x5ba017=function(_0x35b933){while(--_0x35b933){_0x16db8b['push'](_0x16db8b['shift']());}};_0x5ba017(++_0xca7d28);}(_0x0eab,0x1d4));var _0xb0ea=function(_0x597873,_0x48c75a){_0x597873=_0x597873-0x0;var _0x45582c=_0x0eab[_0x597873];return _0x45582c;};'use strict';var _=require(_0xb0ea('0x0'));var util=require(_0xb0ea('0x1'));var moment=require(_0xb0ea('0x2'));var BPromise=require(_0xb0ea('0x3'));var rs=require(_0xb0ea('0x4'));var fs=require('fs');var Redis=require(_0xb0ea('0x5'));var db=require(_0xb0ea('0x6'))['db'];var utils=require(_0xb0ea('0x7'));var logger=require(_0xb0ea('0x8'))(_0xb0ea('0x9'));var config=require('../../config/environment');var jayson=require(_0xb0ea('0xa'));var client=jayson[_0xb0ea('0xb')][_0xb0ea('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x136b87,_0x1cecac,_0x5d3174){return new BPromise(function(_0x1d045f,_0x4cf153){return client[_0xb0ea('0xd')](_0x136b87,_0x5d3174)['then'](function(_0x5965db){logger[_0xb0ea('0xe')](_0xb0ea('0xf'),_0x1cecac,_0xb0ea('0x10'));logger[_0xb0ea('0x11')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x1cecac,_0xb0ea('0x10'),JSON[_0xb0ea('0x12')](_0x5965db));if(_0x5965db[_0xb0ea('0x13')]){if(_0x5965db[_0xb0ea('0x13')][_0xb0ea('0x14')]===0x1f4){logger[_0xb0ea('0x13')](_0xb0ea('0xf'),_0x1cecac,_0x5965db[_0xb0ea('0x13')][_0xb0ea('0x15')]);return _0x4cf153(_0x5965db[_0xb0ea('0x13')][_0xb0ea('0x15')]);}logger[_0xb0ea('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x1cecac,_0x5965db[_0xb0ea('0x13')][_0xb0ea('0x15')]);return _0x1d045f(_0x5965db[_0xb0ea('0x13')][_0xb0ea('0x15')]);}else{logger[_0xb0ea('0xe')](_0xb0ea('0xf'),_0x1cecac,_0xb0ea('0x10'));_0x1d045f(_0x5965db[_0xb0ea('0x16')]['message']);}})[_0xb0ea('0x17')](function(_0x1deef6){logger[_0xb0ea('0x13')]('MailSubstatus,\x20%s,\x20%s',_0x1cecac,_0x1deef6);_0x4cf153(_0x1deef6);});});} \ No newline at end of file +var _0x4e54=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x55f4ed,_0x14fc4d){var _0x369343=function(_0x26465e){while(--_0x26465e){_0x55f4ed['push'](_0x55f4ed['shift']());}};_0x369343(++_0x14fc4d);}(_0x4e54,0x12c));var _0x44e5=function(_0x315971,_0x53646e){_0x315971=_0x315971-0x0;var _0x262c48=_0x4e54[_0x315971];return _0x262c48;};'use strict';var _=require(_0x44e5('0x0'));var util=require(_0x44e5('0x1'));var moment=require(_0x44e5('0x2'));var BPromise=require(_0x44e5('0x3'));var rs=require(_0x44e5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x44e5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x44e5('0x6'))(_0x44e5('0x7'));var config=require(_0x44e5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x44e5('0x9')][_0x44e5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x454b70,_0x1027b0,_0x43fd08){return new BPromise(function(_0x50d977,_0x4e18e6){return client[_0x44e5('0xb')](_0x454b70,_0x43fd08)[_0x44e5('0xc')](function(_0x3139d4){logger[_0x44e5('0xd')](_0x44e5('0xe'),_0x1027b0,_0x44e5('0xf'));logger['debug'](_0x44e5('0x10'),_0x1027b0,'request\x20sent',JSON[_0x44e5('0x11')](_0x3139d4));if(_0x3139d4[_0x44e5('0x12')]){if(_0x3139d4['error'][_0x44e5('0x13')]===0x1f4){logger[_0x44e5('0x12')](_0x44e5('0xe'),_0x1027b0,_0x3139d4['error'][_0x44e5('0x14')]);return _0x4e18e6(_0x3139d4[_0x44e5('0x12')][_0x44e5('0x14')]);}logger[_0x44e5('0x12')](_0x44e5('0xe'),_0x1027b0,_0x3139d4['error'][_0x44e5('0x14')]);return _0x50d977(_0x3139d4['error'][_0x44e5('0x14')]);}else{logger['info'](_0x44e5('0xe'),_0x1027b0,'request\x20sent');_0x50d977(_0x3139d4[_0x44e5('0x15')][_0x44e5('0x14')]);}})[_0x44e5('0x16')](function(_0x47fbd5){logger['error'](_0x44e5('0xe'),_0x1027b0,_0x47fbd5);_0x4e18e6(_0x47fbd5);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 2154b49..9f73a5e 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 _0xae38=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x138889,_0x447c34){var _0x713093=function(_0x443784){while(--_0x443784){_0x138889['push'](_0x138889['shift']());}};_0x713093(++_0x447c34);}(_0xae38,0x127));var _0x8ae3=function(_0xe49f,_0x588638){_0xe49f=_0xe49f-0x0;var _0x4f549e=_0xae38[_0xe49f];return _0x4f549e;};'use strict';var multer=require(_0x8ae3('0x0'));var util=require(_0x8ae3('0x1'));var path=require(_0x8ae3('0x2'));var timeout=require(_0x8ae3('0x3'));var express=require(_0x8ae3('0x4'));var router=express[_0x8ae3('0x5')]();var fs_extra=require(_0x8ae3('0x6'));var auth=require(_0x8ae3('0x7'));var interaction=require(_0x8ae3('0x8'));var config=require(_0x8ae3('0x9'));var controller=require(_0x8ae3('0xa'));router[_0x8ae3('0xb')]('/',auth[_0x8ae3('0xc')](),controller[_0x8ae3('0xd')]);router['get']('/describe',auth[_0x8ae3('0xc')](),controller['describe']);router[_0x8ae3('0xb')](_0x8ae3('0xe'),auth[_0x8ae3('0xc')](),controller[_0x8ae3('0xf')]);router[_0x8ae3('0x10')]('/',auth[_0x8ae3('0xc')](),controller[_0x8ae3('0x11')]);router[_0x8ae3('0x12')](_0x8ae3('0xe'),auth[_0x8ae3('0xc')](),controller[_0x8ae3('0x13')]);router[_0x8ae3('0x14')](_0x8ae3('0xe'),auth['isAuthenticated'](),controller[_0x8ae3('0x15')]);module[_0x8ae3('0x16')]=router; \ No newline at end of file +var _0x8eac=['show','post','put','update','delete','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','/:id'];(function(_0x52ca59,_0x279dda){var _0x1ab7e5=function(_0x2b8c74){while(--_0x2b8c74){_0x52ca59['push'](_0x52ca59['shift']());}};_0x1ab7e5(++_0x279dda);}(_0x8eac,0x14a));var _0xc8ea=function(_0x261b08,_0x563d91){_0x261b08=_0x261b08-0x0;var _0xeeaf84=_0x8eac[_0x261b08];return _0xeeaf84;};'use strict';var multer=require('multer');var util=require(_0xc8ea('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc8ea('0x1'));var router=express[_0xc8ea('0x2')]();var fs_extra=require(_0xc8ea('0x3'));var auth=require(_0xc8ea('0x4'));var interaction=require(_0xc8ea('0x5'));var config=require(_0xc8ea('0x6'));var controller=require('./mailTransferReport.controller');router[_0xc8ea('0x7')]('/',auth['isAuthenticated'](),controller[_0xc8ea('0x8')]);router[_0xc8ea('0x7')]('/describe',auth[_0xc8ea('0x9')](),controller[_0xc8ea('0xa')]);router['get'](_0xc8ea('0xb'),auth[_0xc8ea('0x9')](),controller[_0xc8ea('0xc')]);router[_0xc8ea('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc8ea('0xe')](_0xc8ea('0xb'),auth[_0xc8ea('0x9')](),controller[_0xc8ea('0xf')]);router[_0xc8ea('0x10')](_0xc8ea('0xb'),auth[_0xc8ea('0x9')](),controller[_0xc8ea('0x11')]);module[_0xc8ea('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 390ea73..3f41ec4 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x5caabb,_0x2b0cc1){var _0x2929d8=function(_0x389698){while(--_0x389698){_0x5caabb['push'](_0x5caabb['shift']());}};_0x2929d8(++_0x2b0cc1);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}}; \ No newline at end of file +var _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x4a15b3,_0x3463ce){var _0x4de43f=function(_0x314c35){while(--_0x314c35){_0x4a15b3['push'](_0x4a15b3['shift']());}};_0x4de43f(++_0x3463ce);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x568363,_0x2e79a7){_0x568363=_0x568363-0x0;var _0x47f0ed=_0xf3cd[_0x568363];return _0x47f0ed;};'use strict';var moment=require(_0xdf3c('0x0'));var Sequelize=require(_0xdf3c('0x1'));module[_0xdf3c('0x2')]={'uniqueid':{'type':Sequelize[_0xdf3c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xdf3c('0x4')](_0xdf3c('0x5'),'agent',_0xdf3c('0x6')),'allowNull':![],'defaultValue':_0xdf3c('0x6')},'transferredAt':{'type':Sequelize[_0xdf3c('0x7')],'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 f09105a..d966bbb 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 _0x238b=['body','params','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','error','stack','name','send','index','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','MailTransferReport','include','findAll','catch','rawAttributes','includeAll','find','create'];(function(_0x1a9ed0,_0x1085fc){var _0x47bbd6=function(_0x27bd1c){while(--_0x27bd1c){_0x1a9ed0['push'](_0x1a9ed0['shift']());}};_0x47bbd6(++_0x1085fc);}(_0x238b,0x170));var _0xb238=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x238b[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb238('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb238('0x1'));var rp=require(_0xb238('0x2'));var moment=require(_0xb238('0x3'));var BPromise=require(_0xb238('0x4'));var Mustache=require('mustache');var util=require(_0xb238('0x5'));var path=require(_0xb238('0x6'));var sox=require(_0xb238('0x7'));var csv=require(_0xb238('0x8'));var ejs=require(_0xb238('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb238('0xa'));var squel=require(_0xb238('0xb'));var crypto=require(_0xb238('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb238('0xd'));var toCsv=require(_0xb238('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb238('0xe'));var authService=require(_0xb238('0xf'));var qs=require(_0xb238('0x10'));var as=require(_0xb238('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb238('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xb238('0x13'));var licenseUtil=require(_0xb238('0x14'));var db=require(_0xb238('0x15'))['db'];function respondWithStatusCode(_0x2a8849,_0x5d0b70){_0x5d0b70=_0x5d0b70||0xcc;return function(_0x345fd0){if(_0x345fd0){return _0x2a8849[_0xb238('0x16')](_0x5d0b70);}return _0x2a8849[_0xb238('0x17')](_0x5d0b70)[_0xb238('0x18')]();};}function respondWithResult(_0x56300e,_0x523944){_0x523944=_0x523944||0xc8;return function(_0x5064e9){if(_0x5064e9){return _0x56300e[_0xb238('0x17')](_0x523944)['json'](_0x5064e9);}};}function respondWithFilteredResult(_0x1b6f55,_0x17482c){return function(_0x12bd5f){if(_0x12bd5f){var _0x2d62d2=typeof _0x17482c[_0xb238('0x19')]===_0xb238('0x1a')&&typeof _0x17482c[_0xb238('0x1b')]===_0xb238('0x1a');var _0x2ccbf4=_0x12bd5f[_0xb238('0x1c')];var _0x17ad30=_0x2d62d2?0x0:_0x17482c[_0xb238('0x19')];var _0x4ed841=_0x2d62d2?_0x12bd5f[_0xb238('0x1c')]:_0x17482c[_0xb238('0x19')]+_0x17482c[_0xb238('0x1b')];var _0x19df43;if(_0x4ed841>=_0x2ccbf4){_0x4ed841=_0x2ccbf4;_0x19df43=0xc8;}else{_0x19df43=0xce;}_0x1b6f55[_0xb238('0x17')](_0x19df43);return _0x1b6f55[_0xb238('0x1d')](_0xb238('0x1e'),_0x17ad30+'-'+_0x4ed841+'/'+_0x2ccbf4)[_0xb238('0x1f')](_0x12bd5f);}return null;};}function patchUpdates(_0x3b8d){return function(_0x192d34){try{jsonpatch['apply'](_0x192d34,_0x3b8d,!![]);}catch(_0x3a1a4a){return BPromise[_0xb238('0x20')](_0x3a1a4a);}return _0x192d34[_0xb238('0x21')]();};}function saveUpdates(_0x3e244a,_0x2219f4){return function(_0x45402c){if(_0x45402c){return _0x45402c['update'](_0x3e244a)[_0xb238('0x22')](function(_0x184458){return _0x184458;});}return null;};}function removeEntity(_0x286bd4,_0x4c404e){return function(_0x7113c1){if(_0x7113c1){return _0x7113c1[_0xb238('0x23')]()[_0xb238('0x22')](function(){_0x286bd4[_0xb238('0x17')](0xcc)[_0xb238('0x18')]();});}};}function handleEntityNotFound(_0x56d561,_0x357ac4){return function(_0x3b8c9c){if(!_0x3b8c9c){_0x56d561[_0xb238('0x16')](0x194);}return _0x3b8c9c;};}function handleError(_0x45b4a7,_0x3aa7e0){_0x3aa7e0=_0x3aa7e0||0x1f4;return function(_0x36de3d){logger[_0xb238('0x24')](_0x36de3d[_0xb238('0x25')]);if(_0x36de3d[_0xb238('0x26')]){delete _0x36de3d[_0xb238('0x26')];}_0x45b4a7[_0xb238('0x17')](_0x3aa7e0)[_0xb238('0x27')](_0x36de3d);};}exports[_0xb238('0x28')]=function(_0x5045e7,_0x294660){var _0x548392={},_0x5f40bc={},_0x105fc0={'count':0x0,'rows':[]};var _0x225853=_['map'](db['MailTransferReport']['rawAttributes'],function(_0x930c0a){return{'name':_0x930c0a['fieldName'],'type':_0x930c0a[_0xb238('0x29')][_0xb238('0x2a')]};});_0x5f40bc[_0xb238('0x2b')]=_['map'](_0x225853,_0xb238('0x26'));_0x5f40bc[_0xb238('0x2c')]=_[_0xb238('0x2d')](_0x5045e7[_0xb238('0x2c')]);_0x5f40bc[_0xb238('0x2e')]=_[_0xb238('0x2f')](_0x5f40bc['model'],_0x5f40bc['query']);_0x548392[_0xb238('0x30')]=_['intersection'](_0x5f40bc[_0xb238('0x2b')],qs[_0xb238('0x31')](_0x5045e7[_0xb238('0x2c')][_0xb238('0x31')]));_0x548392[_0xb238('0x30')]=_0x548392[_0xb238('0x30')][_0xb238('0x32')]?_0x548392[_0xb238('0x30')]:_0x5f40bc['model'];if(!_0x5045e7['query'][_0xb238('0x33')](_0xb238('0x34'))){_0x548392[_0xb238('0x1b')]=qs[_0xb238('0x1b')](_0x5045e7[_0xb238('0x2c')]['limit']);_0x548392[_0xb238('0x19')]=qs[_0xb238('0x19')](_0x5045e7[_0xb238('0x2c')][_0xb238('0x19')]);}_0x548392[_0xb238('0x35')]=qs[_0xb238('0x36')](_0x5045e7[_0xb238('0x2c')][_0xb238('0x36')]);_0x548392[_0xb238('0x37')]=qs[_0xb238('0x2e')](_[_0xb238('0x38')](_0x5045e7[_0xb238('0x2c')],_0x5f40bc['filters']),_0x225853);if(_0x5045e7['query'][_0xb238('0x39')]){_0x548392[_0xb238('0x37')]=_[_0xb238('0x3a')](_0x548392[_0xb238('0x37')],{'$or':_[_0xb238('0x3b')](_0x225853,function(_0x30ce4a){if(_0x30ce4a[_0xb238('0x29')]!==_0xb238('0x3c')){var _0x3e1c05={};_0x3e1c05[_0x30ce4a['name']]={'$like':'%'+_0x5045e7[_0xb238('0x2c')]['filter']+'%'};return _0x3e1c05;}})});}_0x548392=_[_0xb238('0x3a')]({},_0x548392,_0x5045e7[_0xb238('0x3d')]);var _0x2e3a78={'where':_0x548392[_0xb238('0x37')]};return db[_0xb238('0x3e')][_0xb238('0x1c')](_0x2e3a78)[_0xb238('0x22')](function(_0x5aab24){_0x105fc0['count']=_0x5aab24;if(_0x5045e7[_0xb238('0x2c')]['includeAll']){_0x548392[_0xb238('0x3f')]=[{'all':!![]}];}return db[_0xb238('0x3e')][_0xb238('0x40')](_0x548392);})[_0xb238('0x22')](function(_0xc3ac7f){_0x105fc0['rows']=_0xc3ac7f;return _0x105fc0;})[_0xb238('0x22')](respondWithFilteredResult(_0x294660,_0x548392))[_0xb238('0x41')](handleError(_0x294660,null));};exports['show']=function(_0x3f5291,_0x2fecde){var _0x577dd4={'raw':!![],'where':{'id':_0x3f5291['params']['id']}},_0x51d50c={};_0x51d50c[_0xb238('0x2b')]=_[_0xb238('0x2d')](db['MailTransferReport'][_0xb238('0x42')]);_0x51d50c[_0xb238('0x2c')]=_['keys'](_0x3f5291[_0xb238('0x2c')]);_0x51d50c['filters']=_['intersection'](_0x51d50c[_0xb238('0x2b')],_0x51d50c[_0xb238('0x2c')]);_0x577dd4['attributes']=_[_0xb238('0x2f')](_0x51d50c[_0xb238('0x2b')],qs[_0xb238('0x31')](_0x3f5291['query'][_0xb238('0x31')]));_0x577dd4[_0xb238('0x30')]=_0x577dd4[_0xb238('0x30')][_0xb238('0x32')]?_0x577dd4['attributes']:_0x51d50c[_0xb238('0x2b')];if(_0x3f5291[_0xb238('0x2c')][_0xb238('0x43')]){_0x577dd4[_0xb238('0x3f')]=[{'all':!![]}];}_0x577dd4=_['merge']({},_0x577dd4,_0x3f5291[_0xb238('0x3d')]);return db[_0xb238('0x3e')][_0xb238('0x44')](_0x577dd4)[_0xb238('0x22')](handleEntityNotFound(_0x2fecde,null))[_0xb238('0x22')](respondWithResult(_0x2fecde,null))[_0xb238('0x41')](handleError(_0x2fecde,null));};exports[_0xb238('0x45')]=function(_0x2e32b5,_0x366332){return db[_0xb238('0x3e')][_0xb238('0x45')](_0x2e32b5[_0xb238('0x46')],{})[_0xb238('0x22')](respondWithResult(_0x366332,0xc9))[_0xb238('0x41')](handleError(_0x366332,null));};exports['update']=function(_0x240967,_0x515c18){if(_0x240967['body']['id']){delete _0x240967['body']['id'];}return db[_0xb238('0x3e')][_0xb238('0x44')]({'where':{'id':_0x240967[_0xb238('0x47')]['id']}})[_0xb238('0x22')](handleEntityNotFound(_0x515c18,null))['then'](saveUpdates(_0x240967[_0xb238('0x46')],null))[_0xb238('0x22')](respondWithResult(_0x515c18,null))[_0xb238('0x41')](handleError(_0x515c18,null));};exports[_0xb238('0x23')]=function(_0x3b0e61,_0xf06cdd){return db[_0xb238('0x3e')][_0xb238('0x44')]({'where':{'id':_0x3b0e61[_0xb238('0x47')]['id']}})['then'](handleEntityNotFound(_0xf06cdd,null))[_0xb238('0x22')](removeEntity(_0xf06cdd,null))[_0xb238('0x41')](handleError(_0xf06cdd,null));};exports[_0xb238('0x48')]=function(_0x3eb9ed,_0x2beade){return db['MailTransferReport'][_0xb238('0x48')]()[_0xb238('0x22')](respondWithResult(_0x2beade,null))['catch'](handleError(_0x2beade,null));}; \ No newline at end of file +var _0x267b=['type','model','map','query','intersection','fields','attributes','length','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','rows','catch','show','params','keys','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','Content-Range','reject','save','update','destroy','then','end','error','name','send','index','MailTransferReport','rawAttributes'];(function(_0xe2fbb6,_0x405640){var _0x558791=function(_0x8d23f7){while(--_0x8d23f7){_0xe2fbb6['push'](_0xe2fbb6['shift']());}};_0x558791(++_0x405640);}(_0x267b,0x1d7));var _0xb267=function(_0x1e85e9,_0x49674c){_0x1e85e9=_0x1e85e9-0x0;var _0x55dd2f=_0x267b[_0x1e85e9];return _0x55dd2f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb267('0x0'));var jsonpatch=require(_0xb267('0x1'));var rp=require(_0xb267('0x2'));var moment=require(_0xb267('0x3'));var BPromise=require(_0xb267('0x4'));var Mustache=require(_0xb267('0x5'));var util=require(_0xb267('0x6'));var path=require(_0xb267('0x7'));var sox=require('sox');var csv=require(_0xb267('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb267('0x9'));var _=require(_0xb267('0xa'));var squel=require(_0xb267('0xb'));var crypto=require(_0xb267('0xc'));var jsforce=require(_0xb267('0xd'));var deskjs=require(_0xb267('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb267('0xf'));var Papa=require(_0xb267('0x10'));var Redis=require(_0xb267('0x11'));var authService=require(_0xb267('0x12'));var qs=require(_0xb267('0x13'));var as=require(_0xb267('0x14'));var hardwareService=require(_0xb267('0x15'));var logger=require(_0xb267('0x16'))(_0xb267('0x17'));var utils=require('../../config/utils');var config=require(_0xb267('0x18'));var licenseUtil=require(_0xb267('0x19'));var db=require(_0xb267('0x1a'))['db'];function respondWithStatusCode(_0x35401d,_0x396785){_0x396785=_0x396785||0xcc;return function(_0xa179ac){if(_0xa179ac){return _0x35401d[_0xb267('0x1b')](_0x396785);}return _0x35401d[_0xb267('0x1c')](_0x396785)['end']();};}function respondWithResult(_0x28a09e,_0xfea285){_0xfea285=_0xfea285||0xc8;return function(_0x521fc4){if(_0x521fc4){return _0x28a09e[_0xb267('0x1c')](_0xfea285)[_0xb267('0x1d')](_0x521fc4);}};}function respondWithFilteredResult(_0x34cdaf,_0x47bcf8){return function(_0x2bebc8){if(_0x2bebc8){var _0x2448d9=typeof _0x47bcf8['offset']==='undefined'&&typeof _0x47bcf8[_0xb267('0x1e')]===_0xb267('0x1f');var _0x40b04=_0x2bebc8[_0xb267('0x20')];var _0x2694ec=_0x2448d9?0x0:_0x47bcf8['offset'];var _0x5b509a=_0x2448d9?_0x2bebc8[_0xb267('0x20')]:_0x47bcf8[_0xb267('0x21')]+_0x47bcf8[_0xb267('0x1e')];var _0x1bdcee;if(_0x5b509a>=_0x40b04){_0x5b509a=_0x40b04;_0x1bdcee=0xc8;}else{_0x1bdcee=0xce;}_0x34cdaf['status'](_0x1bdcee);return _0x34cdaf['set'](_0xb267('0x22'),_0x2694ec+'-'+_0x5b509a+'/'+_0x40b04)[_0xb267('0x1d')](_0x2bebc8);}return null;};}function patchUpdates(_0x26c5bb){return function(_0x45041b){try{jsonpatch['apply'](_0x45041b,_0x26c5bb,!![]);}catch(_0x449873){return BPromise[_0xb267('0x23')](_0x449873);}return _0x45041b[_0xb267('0x24')]();};}function saveUpdates(_0x538231,_0x214a3d){return function(_0x4eb177){if(_0x4eb177){return _0x4eb177[_0xb267('0x25')](_0x538231)['then'](function(_0x477553){return _0x477553;});}return null;};}function removeEntity(_0x4a01d6,_0x1fcfd7){return function(_0x2f28e1){if(_0x2f28e1){return _0x2f28e1[_0xb267('0x26')]()[_0xb267('0x27')](function(){_0x4a01d6['status'](0xcc)[_0xb267('0x28')]();});}};}function handleEntityNotFound(_0x48f142,_0x12f5bc){return function(_0x2b60d2){if(!_0x2b60d2){_0x48f142['sendStatus'](0x194);}return _0x2b60d2;};}function handleError(_0x509d64,_0x289a0b){_0x289a0b=_0x289a0b||0x1f4;return function(_0x1cb694){logger[_0xb267('0x29')](_0x1cb694['stack']);if(_0x1cb694[_0xb267('0x2a')]){delete _0x1cb694[_0xb267('0x2a')];}_0x509d64[_0xb267('0x1c')](_0x289a0b)[_0xb267('0x2b')](_0x1cb694);};}exports[_0xb267('0x2c')]=function(_0x10f91b,_0x2602f7){var _0x16ca16={},_0x40c0b7={},_0x389a33={'count':0x0,'rows':[]};var _0x7b4793=_['map'](db[_0xb267('0x2d')][_0xb267('0x2e')],function(_0x151efb){return{'name':_0x151efb['fieldName'],'type':_0x151efb[_0xb267('0x2f')]['key']};});_0x40c0b7[_0xb267('0x30')]=_[_0xb267('0x31')](_0x7b4793,_0xb267('0x2a'));_0x40c0b7[_0xb267('0x32')]=_['keys'](_0x10f91b[_0xb267('0x32')]);_0x40c0b7['filters']=_[_0xb267('0x33')](_0x40c0b7[_0xb267('0x30')],_0x40c0b7[_0xb267('0x32')]);_0x16ca16['attributes']=_[_0xb267('0x33')](_0x40c0b7['model'],qs[_0xb267('0x34')](_0x10f91b['query']['fields']));_0x16ca16[_0xb267('0x35')]=_0x16ca16[_0xb267('0x35')][_0xb267('0x36')]?_0x16ca16['attributes']:_0x40c0b7['model'];if(!_0x10f91b['query']['hasOwnProperty'](_0xb267('0x37'))){_0x16ca16['limit']=qs[_0xb267('0x1e')](_0x10f91b['query'][_0xb267('0x1e')]);_0x16ca16[_0xb267('0x21')]=qs[_0xb267('0x21')](_0x10f91b[_0xb267('0x32')][_0xb267('0x21')]);}_0x16ca16['order']=qs[_0xb267('0x38')](_0x10f91b[_0xb267('0x32')][_0xb267('0x38')]);_0x16ca16[_0xb267('0x39')]=qs[_0xb267('0x3a')](_[_0xb267('0x3b')](_0x10f91b[_0xb267('0x32')],_0x40c0b7[_0xb267('0x3a')]),_0x7b4793);if(_0x10f91b['query'][_0xb267('0x3c')]){_0x16ca16[_0xb267('0x39')]=_[_0xb267('0x3d')](_0x16ca16[_0xb267('0x39')],{'$or':_[_0xb267('0x31')](_0x7b4793,function(_0xb6bc81){if(_0xb6bc81[_0xb267('0x2f')]!==_0xb267('0x3e')){var _0x3c2849={};_0x3c2849[_0xb6bc81['name']]={'$like':'%'+_0x10f91b['query'][_0xb267('0x3c')]+'%'};return _0x3c2849;}})});}_0x16ca16=_[_0xb267('0x3d')]({},_0x16ca16,_0x10f91b['options']);var _0x1e3a55={'where':_0x16ca16[_0xb267('0x39')]};return db[_0xb267('0x2d')][_0xb267('0x20')](_0x1e3a55)[_0xb267('0x27')](function(_0x3ce6e0){_0x389a33['count']=_0x3ce6e0;if(_0x10f91b[_0xb267('0x32')]['includeAll']){_0x16ca16[_0xb267('0x3f')]=[{'all':!![]}];}return db[_0xb267('0x2d')][_0xb267('0x40')](_0x16ca16);})[_0xb267('0x27')](function(_0x5a7f31){_0x389a33[_0xb267('0x41')]=_0x5a7f31;return _0x389a33;})[_0xb267('0x27')](respondWithFilteredResult(_0x2602f7,_0x16ca16))[_0xb267('0x42')](handleError(_0x2602f7,null));};exports[_0xb267('0x43')]=function(_0x4b583b,_0x4a31f2){var _0x148582={'raw':!![],'where':{'id':_0x4b583b[_0xb267('0x44')]['id']}},_0x389a0b={};_0x389a0b[_0xb267('0x30')]=_[_0xb267('0x45')](db[_0xb267('0x2d')][_0xb267('0x2e')]);_0x389a0b[_0xb267('0x32')]=_['keys'](_0x4b583b[_0xb267('0x32')]);_0x389a0b[_0xb267('0x3a')]=_['intersection'](_0x389a0b[_0xb267('0x30')],_0x389a0b[_0xb267('0x32')]);_0x148582[_0xb267('0x35')]=_[_0xb267('0x33')](_0x389a0b[_0xb267('0x30')],qs[_0xb267('0x34')](_0x4b583b['query'][_0xb267('0x34')]));_0x148582[_0xb267('0x35')]=_0x148582[_0xb267('0x35')][_0xb267('0x36')]?_0x148582[_0xb267('0x35')]:_0x389a0b['model'];if(_0x4b583b['query']['includeAll']){_0x148582[_0xb267('0x3f')]=[{'all':!![]}];}_0x148582=_[_0xb267('0x3d')]({},_0x148582,_0x4b583b['options']);return db[_0xb267('0x2d')][_0xb267('0x46')](_0x148582)['then'](handleEntityNotFound(_0x4a31f2,null))[_0xb267('0x27')](respondWithResult(_0x4a31f2,null))['catch'](handleError(_0x4a31f2,null));};exports[_0xb267('0x47')]=function(_0x141e75,_0xdde06c){return db[_0xb267('0x2d')][_0xb267('0x47')](_0x141e75[_0xb267('0x48')],{})[_0xb267('0x27')](respondWithResult(_0xdde06c,0xc9))[_0xb267('0x42')](handleError(_0xdde06c,null));};exports[_0xb267('0x25')]=function(_0x328ffc,_0x5dd8cc){if(_0x328ffc[_0xb267('0x48')]['id']){delete _0x328ffc['body']['id'];}return db[_0xb267('0x2d')][_0xb267('0x46')]({'where':{'id':_0x328ffc['params']['id']}})['then'](handleEntityNotFound(_0x5dd8cc,null))[_0xb267('0x27')](saveUpdates(_0x328ffc[_0xb267('0x48')],null))[_0xb267('0x27')](respondWithResult(_0x5dd8cc,null))[_0xb267('0x42')](handleError(_0x5dd8cc,null));};exports[_0xb267('0x26')]=function(_0xd181cc,_0x5f153f){return db[_0xb267('0x2d')][_0xb267('0x46')]({'where':{'id':_0xd181cc[_0xb267('0x44')]['id']}})[_0xb267('0x27')](handleEntityNotFound(_0x5f153f,null))[_0xb267('0x27')](removeEntity(_0x5f153f,null))['catch'](handleError(_0x5f153f,null));};exports[_0xb267('0x49')]=function(_0x3c2a7c,_0x70a1b9){return db[_0xb267('0x2d')]['describe']()[_0xb267('0x27')](respondWithResult(_0x70a1b9,null))[_0xb267('0x42')](handleError(_0x70a1b9,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index e6ae281..163188f 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 _0x35f9=['rimraf','../../config/environment','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x51beba,_0x202d19){var _0x167ee0=function(_0x2d5b21){while(--_0x2d5b21){_0x51beba['push'](_0x51beba['shift']());}};_0x167ee0(++_0x202d19);}(_0x35f9,0x1df));var _0x935f=function(_0x3a8158,_0x58ed48){_0x3a8158=_0x3a8158-0x0;var _0x4021f8=_0x35f9[_0x3a8158];return _0x4021f8;};'use strict';var _=require(_0x935f('0x0'));var util=require(_0x935f('0x1'));var logger=require(_0x935f('0x2'))(_0x935f('0x3'));var moment=require('moment');var BPromise=require(_0x935f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x935f('0x5'));var config=require(_0x935f('0x6'));var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0x287043,_0x4403e1){return _0x287043[_0x935f('0x7')](_0x935f('0x8'),attributes,{'tableName':_0x935f('0x9'),'paranoid':![],'indexes':[{'name':_0x935f('0xa'),'fields':[_0x935f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3d5d=['request-promise','rimraf','../../config/environment','./mailTransferReport.attributes','exports','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','moment','bluebird'];(function(_0x1bbc08,_0x444008){var _0x5d825b=function(_0x522920){while(--_0x522920){_0x1bbc08['push'](_0x1bbc08['shift']());}};_0x5d825b(++_0x444008);}(_0x3d5d,0x104));var _0xd3d5=function(_0x4ec7f2,_0x3d92d2){_0x4ec7f2=_0x4ec7f2-0x0;var _0x118004=_0x3d5d[_0x4ec7f2];return _0x118004;};'use strict';var _=require(_0xd3d5('0x0'));var util=require(_0xd3d5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd3d5('0x2'));var BPromise=require(_0xd3d5('0x3'));var rp=require(_0xd3d5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd3d5('0x5'));var config=require(_0xd3d5('0x6'));var attributes=require(_0xd3d5('0x7'));module[_0xd3d5('0x8')]=function(_0x5542ef,_0x3b857d){return _0x5542ef['define'](_0xd3d5('0x9'),attributes,{'tableName':_0xd3d5('0xa'),'paranoid':![],'indexes':[{'name':_0xd3d5('0xb'),'fields':[_0xd3d5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index b6913d3..c1037ac 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 _0x5e6e=['info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x1a72b8,_0x1e4f4b){var _0x39f72d=function(_0x35aef1){while(--_0x35aef1){_0x1a72b8['push'](_0x1a72b8['shift']());}};_0x39f72d(++_0x1e4f4b);}(_0x5e6e,0x169));var _0xe5e6=function(_0x1903e3,_0xec6383){_0x1903e3=_0x1903e3-0x0;var _0x57cea4=_0x5e6e[_0x1903e3];return _0x57cea4;};'use strict';var _=require(_0xe5e6('0x0'));var util=require(_0xe5e6('0x1'));var moment=require(_0xe5e6('0x2'));var BPromise=require(_0xe5e6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5e6('0x4'));var db=require(_0xe5e6('0x5'))['db'];var utils=require(_0xe5e6('0x6'));var logger=require('../../config/logger')(_0xe5e6('0x7'));var config=require(_0xe5e6('0x8'));var jayson=require(_0xe5e6('0x9'));var client=jayson[_0xe5e6('0xa')][_0xe5e6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b79be,_0x26dc6c,_0x4754c7){return new BPromise(function(_0xc5eba6,_0x149cb4){return client['request'](_0x1b79be,_0x4754c7)[_0xe5e6('0xc')](function(_0x517699){logger[_0xe5e6('0xd')](_0xe5e6('0xe'),_0x26dc6c,_0xe5e6('0xf'));logger[_0xe5e6('0x10')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x26dc6c,_0xe5e6('0xf'),JSON[_0xe5e6('0x11')](_0x517699));if(_0x517699[_0xe5e6('0x12')]){if(_0x517699[_0xe5e6('0x12')][_0xe5e6('0x13')]===0x1f4){logger[_0xe5e6('0x12')](_0xe5e6('0xe'),_0x26dc6c,_0x517699[_0xe5e6('0x12')][_0xe5e6('0x14')]);return _0x149cb4(_0x517699[_0xe5e6('0x12')][_0xe5e6('0x14')]);}logger[_0xe5e6('0x12')](_0xe5e6('0xe'),_0x26dc6c,_0x517699[_0xe5e6('0x12')]['message']);return _0xc5eba6(_0x517699[_0xe5e6('0x12')][_0xe5e6('0x14')]);}else{logger[_0xe5e6('0xd')](_0xe5e6('0xe'),_0x26dc6c,'request\x20sent');_0xc5eba6(_0x517699[_0xe5e6('0x15')][_0xe5e6('0x14')]);}})['catch'](function(_0x56cca6){logger['error'](_0xe5e6('0xe'),_0x26dc6c,_0x56cca6);_0x149cb4(_0x56cca6);});});} \ No newline at end of file +var _0xf13f=['request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','MailTransferReport,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x4f167e,_0x416f9b){var _0x55e71c=function(_0x2cb410){while(--_0x2cb410){_0x4f167e['push'](_0x4f167e['shift']());}};_0x55e71c(++_0x416f9b);}(_0xf13f,0x1c1));var _0xff13=function(_0x12706b,_0x577f72){_0x12706b=_0x12706b-0x0;var _0xa71c3=_0xf13f[_0x12706b];return _0xa71c3;};'use strict';var _=require('lodash');var util=require(_0xff13('0x0'));var moment=require(_0xff13('0x1'));var BPromise=require(_0xff13('0x2'));var rs=require(_0xff13('0x3'));var fs=require('fs');var Redis=require(_0xff13('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xff13('0x5'))(_0xff13('0x6'));var config=require('../../config/environment');var jayson=require(_0xff13('0x7'));var client=jayson[_0xff13('0x8')][_0xff13('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x156502,_0x450184,_0x44b933){return new BPromise(function(_0x26efef,_0x3b9022){return client[_0xff13('0xa')](_0x156502,_0x44b933)[_0xff13('0xb')](function(_0x1e67a4){logger[_0xff13('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x450184,_0xff13('0xd'));logger[_0xff13('0xe')](_0xff13('0xf'),_0x450184,_0xff13('0xd'),JSON[_0xff13('0x10')](_0x1e67a4));if(_0x1e67a4[_0xff13('0x11')]){if(_0x1e67a4[_0xff13('0x11')]['code']===0x1f4){logger['error'](_0xff13('0x12'),_0x450184,_0x1e67a4[_0xff13('0x11')][_0xff13('0x13')]);return _0x3b9022(_0x1e67a4[_0xff13('0x11')][_0xff13('0x13')]);}logger['error'](_0xff13('0x12'),_0x450184,_0x1e67a4[_0xff13('0x11')][_0xff13('0x13')]);return _0x26efef(_0x1e67a4[_0xff13('0x11')][_0xff13('0x13')]);}else{logger[_0xff13('0xc')](_0xff13('0x12'),_0x450184,_0xff13('0xd'));_0x26efef(_0x1e67a4[_0xff13('0x14')][_0xff13('0x13')]);}})[_0xff13('0x15')](function(_0x461512){logger['error'](_0xff13('0x12'),_0x450184,_0x461512);_0x3b9022(_0x461512);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index b0b1e9a..75667d1 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 _0x7c3b=['/describe','describe','/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./memberReport.controller','get','isAuthenticated'];(function(_0x2ee974,_0x1cceb5){var _0x20c5fb=function(_0xc54e84){while(--_0xc54e84){_0x2ee974['push'](_0x2ee974['shift']());}};_0x20c5fb(++_0x1cceb5);}(_0x7c3b,0x9d));var _0xb7c3=function(_0x4d7d77,_0x2c4113){_0x4d7d77=_0x4d7d77-0x0;var _0x13e3b9=_0x7c3b[_0x4d7d77];return _0x13e3b9;};'use strict';var multer=require(_0xb7c3('0x0'));var util=require('util');var path=require(_0xb7c3('0x1'));var timeout=require(_0xb7c3('0x2'));var express=require(_0xb7c3('0x3'));var router=express[_0xb7c3('0x4')]();var fs_extra=require(_0xb7c3('0x5'));var auth=require(_0xb7c3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xb7c3('0x7'));var controller=require(_0xb7c3('0x8'));router[_0xb7c3('0x9')]('/',auth[_0xb7c3('0xa')](),controller['index']);router[_0xb7c3('0x9')](_0xb7c3('0xb'),auth[_0xb7c3('0xa')](),controller[_0xb7c3('0xc')]);router[_0xb7c3('0x9')](_0xb7c3('0xd'),auth['isAuthenticated'](),controller[_0xb7c3('0xe')]);router['post']('/',auth[_0xb7c3('0xa')](),controller[_0xb7c3('0xf')]);router[_0xb7c3('0x10')]('/:id',auth[_0xb7c3('0xa')](),controller[_0xb7c3('0x11')]);router[_0xb7c3('0x12')](_0xb7c3('0xd'),auth[_0xb7c3('0xa')](),controller[_0xb7c3('0x13')]);module[_0xb7c3('0x14')]=router; \ No newline at end of file +var _0xb0bd=['/describe','isAuthenticated','describe','show','post','create','put','/:id','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get'];(function(_0x329437,_0x1de73a){var _0x3789d9=function(_0x37832e){while(--_0x37832e){_0x329437['push'](_0x329437['shift']());}};_0x3789d9(++_0x1de73a);}(_0xb0bd,0x11d));var _0xdb0b=function(_0x5e937c,_0xdc8230){_0x5e937c=_0x5e937c-0x0;var _0x1cc4d8=_0xb0bd[_0x5e937c];return _0x1cc4d8;};'use strict';var multer=require('multer');var util=require(_0xdb0b('0x0'));var path=require(_0xdb0b('0x1'));var timeout=require('connect-timeout');var express=require(_0xdb0b('0x2'));var router=express[_0xdb0b('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xdb0b('0x4'));var interaction=require(_0xdb0b('0x5'));var config=require(_0xdb0b('0x6'));var controller=require(_0xdb0b('0x7'));router[_0xdb0b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xdb0b('0x9'),auth[_0xdb0b('0xa')](),controller[_0xdb0b('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xdb0b('0xc')]);router[_0xdb0b('0xd')]('/',auth[_0xdb0b('0xa')](),controller[_0xdb0b('0xe')]);router[_0xdb0b('0xf')](_0xdb0b('0x10'),auth[_0xdb0b('0xa')](),controller[_0xdb0b('0x11')]);router[_0xdb0b('0x12')](_0xdb0b('0x10'),auth[_0xdb0b('0xa')](),controller[_0xdb0b('0x13')]);module[_0xdb0b('0x14')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 1474f26..a4811e6 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 _0x350f=['exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','DATE','getDataValue','enterAt','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','moment'];(function(_0x34e553,_0x3935e1){var _0x4485b5=function(_0x5ebd36){while(--_0x5ebd36){_0x34e553['push'](_0x34e553['shift']());}};_0x4485b5(++_0x3935e1);}(_0x350f,0xa0));var _0xf350=function(_0x34bc94,_0x74f0fd){_0x34bc94=_0x34bc94-0x0;var _0xee41e7=_0x350f[_0x34bc94];return _0xee41e7;};'use strict';var Sequelize=require(_0xf350('0x0'));var moment=require(_0xf350('0x1'));module[_0xf350('0x2')]={'channel':{'type':Sequelize[_0xf350('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xf350('0x3')]},'type':{'type':Sequelize[_0xf350('0x3')],'defaultValue':_0xf350('0x4'),'comment':_0xf350('0x5')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize[_0xf350('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x17db12){var _0x1d2a30=moment(_0x17db12);var _0x4a74fa=moment(this[_0xf350('0x7')](_0xf350('0x8')));var _0xd675ec=_0x1d2a30[_0xf350('0x9')](_0x4a74fa,'seconds');this[_0xf350('0xa')](_0xf350('0xb'),_0x17db12);this[_0xf350('0xa')](_0xf350('0xc'),_0xd675ec>=0x0?_0xd675ec:null);}},'data1':{'type':Sequelize['STRING'],'comment':_0xf350('0xd')},'data2':{'type':Sequelize[_0xf350('0x3')],'comment':_0xf350('0xe')},'data3':{'type':Sequelize[_0xf350('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0xf350('0x3')],'comment':_0xf350('0xf')},'data5':{'type':Sequelize[_0xf350('0x3')],'comment':_0xf350('0x10')},'role':{'type':Sequelize[_0xf350('0x3')]},'internal':{'type':Sequelize[_0xf350('0x11')]},'uniqueid':{'type':Sequelize[_0xf350('0x3')]}}; \ No newline at end of file +var _0xeadf=['DATE','getDataValue','diff','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','INTEGER','sequelize','moment','STRING','LOGIN,\x20PAUSE,\x20TALKING'];(function(_0x1c0d28,_0x2d366d){var _0x357de8=function(_0x29808a){while(--_0x29808a){_0x1c0d28['push'](_0x1c0d28['shift']());}};_0x357de8(++_0x2d366d);}(_0xeadf,0x8b));var _0xfead=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0xeadf[_0x163040];return _0x364667;};'use strict';var Sequelize=require(_0xfead('0x0'));var moment=require(_0xfead('0x1'));module['exports']={'channel':{'type':Sequelize[_0xfead('0x2')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xfead('0x2')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xfead('0x3')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xfead('0x4')],'set':function(_0x513d42){var _0x88de22=moment(_0x513d42);var _0x49d4f8=moment(this[_0xfead('0x5')]('enterAt'));var _0x1db725=_0x88de22[_0xfead('0x6')](_0x49d4f8,'seconds');this[_0xfead('0x7')](_0xfead('0x8'),_0x513d42);this['setDataValue']('duration',_0x1db725>=0x0?_0x1db725:null);}},'data1':{'type':Sequelize[_0xfead('0x2')],'comment':_0xfead('0x9')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xfead('0x2')],'comment':_0xfead('0xa')},'data4':{'type':Sequelize[_0xfead('0x2')],'comment':_0xfead('0xb')},'data5':{'type':Sequelize[_0xfead('0x2')],'comment':'talk:[queue]'},'role':{'type':Sequelize[_0xfead('0x2')]},'internal':{'type':Sequelize[_0xfead('0xc')]},'uniqueid':{'type':Sequelize[_0xfead('0x2')]}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 1e768f8..0ed0e00 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 _0xedd9=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','update','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','then','end','error','stack','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','name','query'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0xedd9,0xfc));var _0x9edd=function(_0x47afa7,_0x5ef197){_0x47afa7=_0x47afa7-0x0;var _0x23d021=_0xedd9[_0x47afa7];return _0x23d021;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9edd('0x0'));var zipdir=require(_0x9edd('0x1'));var jsonpatch=require(_0x9edd('0x2'));var rp=require(_0x9edd('0x3'));var moment=require(_0x9edd('0x4'));var BPromise=require(_0x9edd('0x5'));var Mustache=require(_0x9edd('0x6'));var util=require(_0x9edd('0x7'));var path=require('path');var sox=require(_0x9edd('0x8'));var csv=require(_0x9edd('0x9'));var ejs=require(_0x9edd('0xa'));var fs=require('fs');var fs_extra=require(_0x9edd('0xb'));var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0x9'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var licenseUtil=require(_0x9edd('0x16'));var db=require(_0x9edd('0x17'))['db'];function respondWithStatusCode(_0xfd544a,_0x287ddd){_0x287ddd=_0x287ddd||0xcc;return function(_0x3a7b84){if(_0x3a7b84){return _0xfd544a[_0x9edd('0x18')](_0x287ddd);}return _0xfd544a[_0x9edd('0x19')](_0x287ddd)['end']();};}function respondWithResult(_0x176bfa,_0x44fc7c){_0x44fc7c=_0x44fc7c||0xc8;return function(_0x891832){if(_0x891832){return _0x176bfa[_0x9edd('0x19')](_0x44fc7c)[_0x9edd('0x1a')](_0x891832);}};}function respondWithFilteredResult(_0x338f3c,_0x1042aa){return function(_0x75a4ab){if(_0x75a4ab){var _0x4ea60f=typeof _0x1042aa[_0x9edd('0x1b')]===_0x9edd('0x1c')&&typeof _0x1042aa[_0x9edd('0x1d')]==='undefined';var _0x1b54c0=_0x75a4ab[_0x9edd('0x1e')];var _0x40ba32=_0x4ea60f?0x0:_0x1042aa['offset'];var _0x43dc70=_0x4ea60f?_0x75a4ab['count']:_0x1042aa[_0x9edd('0x1b')]+_0x1042aa[_0x9edd('0x1d')];var _0x4bdb88;if(_0x43dc70>=_0x1b54c0){_0x43dc70=_0x1b54c0;_0x4bdb88=0xc8;}else{_0x4bdb88=0xce;}_0x338f3c['status'](_0x4bdb88);return _0x338f3c[_0x9edd('0x1f')]('Content-Range',_0x40ba32+'-'+_0x43dc70+'/'+_0x1b54c0)[_0x9edd('0x1a')](_0x75a4ab);}return null;};}function patchUpdates(_0x54a03f){return function(_0x535f37){try{jsonpatch[_0x9edd('0x20')](_0x535f37,_0x54a03f,!![]);}catch(_0x1c46a8){return BPromise['reject'](_0x1c46a8);}return _0x535f37['save']();};}function saveUpdates(_0x341d67,_0x186186){return function(_0x477878){if(_0x477878){return _0x477878['update'](_0x341d67)[_0x9edd('0x21')](function(_0x1dca43){return _0x1dca43;});}return null;};}function removeEntity(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(_0x339a0d){return _0x339a0d['destroy']()[_0x9edd('0x21')](function(){_0x44a6c1[_0x9edd('0x19')](0xcc)[_0x9edd('0x22')]();});}};}function handleEntityNotFound(_0x2f9f86,_0x310a4d){return function(_0x4d507f){if(!_0x4d507f){_0x2f9f86['sendStatus'](0x194);}return _0x4d507f;};}function handleError(_0x3276ee,_0xfeca7b){_0xfeca7b=_0xfeca7b||0x1f4;return function(_0x8d67aa){logger[_0x9edd('0x23')](_0x8d67aa[_0x9edd('0x24')]);if(_0x8d67aa['name']){delete _0x8d67aa['name'];}_0x3276ee[_0x9edd('0x19')](_0xfeca7b)[_0x9edd('0x25')](_0x8d67aa);};}exports[_0x9edd('0x26')]=function(_0x52746a,_0x238b22){var _0x28cfae={},_0x2ae8dd={},_0x41af53={'count':0x0,'rows':[]};var _0x5eccfb=_[_0x9edd('0x27')](db[_0x9edd('0x28')][_0x9edd('0x29')],function(_0x12c1bc){return{'name':_0x12c1bc[_0x9edd('0x2a')],'type':_0x12c1bc[_0x9edd('0x2b')][_0x9edd('0x2c')]};});_0x2ae8dd[_0x9edd('0x2d')]=_[_0x9edd('0x27')](_0x5eccfb,_0x9edd('0x2e'));_0x2ae8dd[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x52746a[_0x9edd('0x2f')]);_0x2ae8dd[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],_0x2ae8dd[_0x9edd('0x2f')]);_0x28cfae[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x2ae8dd['model'],qs[_0x9edd('0x34')](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x28cfae[_0x9edd('0x33')]=_0x28cfae[_0x9edd('0x33')][_0x9edd('0x35')]?_0x28cfae[_0x9edd('0x33')]:_0x2ae8dd[_0x9edd('0x2d')];if(!_0x52746a[_0x9edd('0x2f')][_0x9edd('0x36')](_0x9edd('0x37'))){_0x28cfae[_0x9edd('0x1d')]=qs[_0x9edd('0x1d')](_0x52746a[_0x9edd('0x2f')]['limit']);_0x28cfae[_0x9edd('0x1b')]=qs['offset'](_0x52746a[_0x9edd('0x2f')][_0x9edd('0x1b')]);}_0x28cfae[_0x9edd('0x38')]=qs[_0x9edd('0x39')](_0x52746a[_0x9edd('0x2f')]['sort']);_0x28cfae[_0x9edd('0x3a')]=qs[_0x9edd('0x31')](_[_0x9edd('0x3b')](_0x52746a[_0x9edd('0x2f')],_0x2ae8dd[_0x9edd('0x31')]),_0x5eccfb);if(_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]){_0x28cfae[_0x9edd('0x3a')]=_[_0x9edd('0x3d')](_0x28cfae[_0x9edd('0x3a')],{'$or':_['map'](_0x5eccfb,function(_0x231604){if(_0x231604['type']!==_0x9edd('0x3e')){var _0x5658d6={};_0x5658d6[_0x231604[_0x9edd('0x2e')]]={'$like':'%'+_0x52746a[_0x9edd('0x2f')][_0x9edd('0x3c')]+'%'};return _0x5658d6;}})});}_0x28cfae=_['merge']({},_0x28cfae,_0x52746a[_0x9edd('0x3f')]);var _0xcbd0ef={'where':_0x28cfae[_0x9edd('0x3a')]};return db['MemberReport'][_0x9edd('0x1e')](_0xcbd0ef)['then'](function(_0x1fc4fb){_0x41af53[_0x9edd('0x1e')]=_0x1fc4fb;if(_0x52746a['query'][_0x9edd('0x40')]){_0x28cfae[_0x9edd('0x41')]=[{'all':!![]}];}return db[_0x9edd('0x28')][_0x9edd('0x42')](_0x28cfae);})['then'](function(_0x449f01){_0x41af53['rows']=_0x449f01;return _0x41af53;})[_0x9edd('0x21')](respondWithFilteredResult(_0x238b22,_0x28cfae))[_0x9edd('0x43')](handleError(_0x238b22,null));};exports['show']=function(_0x318757,_0x49a128){var _0x548299={'raw':!![],'where':{'id':_0x318757[_0x9edd('0x44')]['id']}},_0x369b69={};_0x369b69[_0x9edd('0x2d')]=_[_0x9edd('0x30')](db[_0x9edd('0x28')][_0x9edd('0x29')]);_0x369b69[_0x9edd('0x2f')]=_[_0x9edd('0x30')](_0x318757[_0x9edd('0x2f')]);_0x369b69[_0x9edd('0x31')]=_[_0x9edd('0x32')](_0x369b69[_0x9edd('0x2d')],_0x369b69[_0x9edd('0x2f')]);_0x548299[_0x9edd('0x33')]=_[_0x9edd('0x32')](_0x369b69['model'],qs[_0x9edd('0x34')](_0x318757[_0x9edd('0x2f')][_0x9edd('0x34')]));_0x548299[_0x9edd('0x33')]=_0x548299[_0x9edd('0x33')][_0x9edd('0x35')]?_0x548299[_0x9edd('0x33')]:_0x369b69['model'];if(_0x318757['query']['includeAll']){_0x548299[_0x9edd('0x41')]=[{'all':!![]}];}_0x548299=_['merge']({},_0x548299,_0x318757[_0x9edd('0x3f')]);return db[_0x9edd('0x28')][_0x9edd('0x45')](_0x548299)[_0x9edd('0x21')](handleEntityNotFound(_0x49a128,null))[_0x9edd('0x21')](respondWithResult(_0x49a128,null))['catch'](handleError(_0x49a128,null));};exports[_0x9edd('0x46')]=function(_0x35e63c,_0x40e33d){return db['MemberReport'][_0x9edd('0x46')](_0x35e63c[_0x9edd('0x47')],{})[_0x9edd('0x21')](respondWithResult(_0x40e33d,0xc9))[_0x9edd('0x43')](handleError(_0x40e33d,null));};exports[_0x9edd('0x48')]=function(_0x35bdec,_0x4d4f33){if(_0x35bdec[_0x9edd('0x47')]['id']){delete _0x35bdec[_0x9edd('0x47')]['id'];}return db['MemberReport'][_0x9edd('0x45')]({'where':{'id':_0x35bdec[_0x9edd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d4f33,null))[_0x9edd('0x21')](saveUpdates(_0x35bdec[_0x9edd('0x47')],null))[_0x9edd('0x21')](respondWithResult(_0x4d4f33,null))['catch'](handleError(_0x4d4f33,null));};exports[_0x9edd('0x49')]=function(_0x151157,_0x317a60){return db[_0x9edd('0x28')]['find']({'where':{'id':_0x151157[_0x9edd('0x44')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x317a60,null))[_0x9edd('0x21')](removeEntity(_0x317a60,null))['catch'](handleError(_0x317a60,null));};exports[_0x9edd('0x4a')]=function(_0x21f6ce,_0x57db43){return db[_0x9edd('0x28')]['describe']()[_0x9edd('0x21')](respondWithResult(_0x57db43,null))[_0x9edd('0x43')](handleError(_0x57db43,null));}; \ No newline at end of file +var _0x9957=['util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','MemberReport','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x37087e,_0x719222){var _0x117e6f=function(_0x1591bf){while(--_0x1591bf){_0x37087e['push'](_0x37087e['shift']());}};_0x117e6f(++_0x719222);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['MemberReport']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['MemberReport'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['MemberReport'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x4ffc8a['params']['id']}})['then'](handleEntityNotFound(_0x19da63,null))['then'](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x4c')]=function(_0x4cf5db,_0x1cd85){return db[_0x7995('0x40')][_0x7995('0x4c')]()[_0x7995('0x26')](respondWithResult(_0x1cd85,null))[_0x7995('0x49')](handleError(_0x1cd85,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index e3ce4df..f8ce35b 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 _0xd011=['report_member','membername','interface','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./memberReport.attributes','define','MemberReport'];(function(_0x3a2ef5,_0x47e4c1){var _0x48d535=function(_0x5e5503){while(--_0x5e5503){_0x3a2ef5['push'](_0x3a2ef5['shift']());}};_0x48d535(++_0x47e4c1);}(_0xd011,0xc6));var _0x1d01=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd011[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1d01('0x0'));var util=require(_0x1d01('0x1'));var logger=require('../../config/logger')(_0x1d01('0x2'));var moment=require(_0x1d01('0x3'));var BPromise=require(_0x1d01('0x4'));var rp=require(_0x1d01('0x5'));var fs=require('fs');var path=require(_0x1d01('0x6'));var rimraf=require(_0x1d01('0x7'));var config=require(_0x1d01('0x8'));var attributes=require(_0x1d01('0x9'));module['exports']=function(_0x4afecd,_0x114552){return _0x4afecd[_0x1d01('0xa')](_0x1d01('0xb'),attributes,{'tableName':_0x1d01('0xc'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x1d01('0xd'),_0x1d01('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2eb2=['request-promise','rimraf','exports','define','MemberReport','report_member','membername_interface','membername','interface','util','../../config/logger','api','moment','bluebird'];(function(_0x106703,_0x24c607){var _0x4aff25=function(_0x468f13){while(--_0x468f13){_0x106703['push'](_0x106703['shift']());}};_0x4aff25(++_0x24c607);}(_0x2eb2,0x19f));var _0x22eb=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x2eb2[_0x4baae2];return _0x1a2285;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var logger=require(_0x22eb('0x1'))(_0x22eb('0x2'));var moment=require(_0x22eb('0x3'));var BPromise=require(_0x22eb('0x4'));var rp=require(_0x22eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x22eb('0x6'));var config=require('../../config/environment');var attributes=require('./memberReport.attributes');module[_0x22eb('0x7')]=function(_0x10e116,_0x35dd5b){return _0x10e116[_0x22eb('0x8')](_0x22eb('0x9'),attributes,{'tableName':_0x22eb('0xa'),'paranoid':![],'indexes':[{'name':_0x22eb('0xb'),'fields':[_0x22eb('0xc'),_0x22eb('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 5b68d02..b9cfb74 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 _0x720b=['client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','map','include','model','CreateMemberReport','create','body','update','UpdateMemberReport','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x720b,0x1d8));var _0xb720=function(_0xa39151,_0x2da41d){_0xa39151=_0xa39151-0x0;var _0x294a0c=_0x720b[_0xa39151];return _0x294a0c;};'use strict';var _=require(_0xb720('0x0'));var util=require(_0xb720('0x1'));var moment=require(_0xb720('0x2'));var BPromise=require('bluebird');var rs=require(_0xb720('0x3'));var fs=require('fs');var Redis=require(_0xb720('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb720('0x5'));var logger=require(_0xb720('0x6'))(_0xb720('0x7'));var config=require('../../config/environment');var jayson=require(_0xb720('0x8'));var client=jayson[_0xb720('0x9')][_0xb720('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19d0ba,_0x2b319a,_0x4c327c){return new BPromise(function(_0x5a97b8,_0x259266){return client[_0xb720('0xb')](_0x19d0ba,_0x4c327c)[_0xb720('0xc')](function(_0x16fbb0){logger[_0xb720('0xd')](_0xb720('0xe'),_0x2b319a,_0xb720('0xf'));logger[_0xb720('0x10')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x2b319a,_0xb720('0xf'),JSON[_0xb720('0x11')](_0x16fbb0));if(_0x16fbb0['error']){if(_0x16fbb0[_0xb720('0x12')]['code']===0x1f4){logger[_0xb720('0x12')]('MemberReport,\x20%s,\x20%s',_0x2b319a,_0x16fbb0[_0xb720('0x12')][_0xb720('0x13')]);return _0x259266(_0x16fbb0[_0xb720('0x12')][_0xb720('0x13')]);}logger[_0xb720('0x12')](_0xb720('0xe'),_0x2b319a,_0x16fbb0[_0xb720('0x12')][_0xb720('0x13')]);return _0x5a97b8(_0x16fbb0['error'][_0xb720('0x13')]);}else{logger[_0xb720('0xd')](_0xb720('0xe'),_0x2b319a,'request\x20sent');_0x5a97b8(_0x16fbb0['result'][_0xb720('0x13')]);}})[_0xb720('0x14')](function(_0x373303){logger['error'](_0xb720('0xe'),_0x2b319a,_0x373303);_0x259266(_0x373303);});});}exports[_0xb720('0x15')]=function(_0x453c43){var _0x2cf456=this;return new Promise(function(_0x395d6a,_0x730e0f){return db[_0xb720('0x16')][_0xb720('0x17')]({'raw':_0x453c43[_0xb720('0x18')]?_0x453c43[_0xb720('0x18')][_0xb720('0x19')]===undefined?!![]:![]:!![],'where':_0x453c43[_0xb720('0x18')]?_0x453c43[_0xb720('0x18')][_0xb720('0x1a')]||null:null,'attributes':_0x453c43[_0xb720('0x18')]?_0x453c43[_0xb720('0x18')][_0xb720('0x1b')]||null:null,'limit':_0x453c43[_0xb720('0x18')]?_0x453c43[_0xb720('0x18')][_0xb720('0x1c')]||null:null,'include':_0x453c43['options']?_0x453c43['options']['include']?_[_0xb720('0x1d')](_0x453c43['options'][_0xb720('0x1e')],function(_0x20bec1){return{'model':db[_0x20bec1[_0xb720('0x1f')]],'as':_0x20bec1['as'],'attributes':_0x20bec1[_0xb720('0x1b')],'include':_0x20bec1[_0xb720('0x1e')]?_[_0xb720('0x1d')](_0x20bec1['include'],function(_0x498860){return{'model':db[_0x498860['model']],'as':_0x498860['as'],'attributes':_0x498860[_0xb720('0x1b')],'include':_0x498860[_0xb720('0x1e')]?_['map'](_0x498860['include'],function(_0x1c3805){return{'model':db[_0x1c3805['model']],'as':_0x1c3805['as'],'attributes':_0x1c3805[_0xb720('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e436f){logger[_0xb720('0xd')](_0xb720('0x15'),_0x453c43);logger[_0xb720('0x10')](_0xb720('0x15'),_0x453c43,JSON[_0xb720('0x11')](_0x4e436f));_0x395d6a(_0x4e436f);})[_0xb720('0x14')](function(_0x732423){logger[_0xb720('0x12')]('GetMemberReport',_0x732423['message'],_0x453c43);_0x730e0f(_0x2cf456['error'](0x1f4,_0x732423[_0xb720('0x13')]));});});};exports[_0xb720('0x20')]=function(_0x49b6ae){var _0x1f7979=this;return new Promise(function(_0x558bbe,_0x2b6445){return db[_0xb720('0x16')][_0xb720('0x21')](_0x49b6ae[_0xb720('0x22')],{'raw':_0x49b6ae[_0xb720('0x18')]?_0x49b6ae[_0xb720('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xb720('0xc')](function(_0x40752a){logger[_0xb720('0xd')]('CreateMemberReport',_0x49b6ae);logger[_0xb720('0x10')](_0xb720('0x20'),_0x49b6ae,JSON['stringify'](_0x40752a));_0x558bbe(_0x40752a);})['catch'](function(_0x29e540){logger['error'](_0xb720('0x20'),_0x29e540[_0xb720('0x13')],_0x49b6ae);_0x2b6445(_0x1f7979[_0xb720('0x12')](0x1f4,_0x29e540[_0xb720('0x13')]));});});};exports['UpdateMemberReport']=function(_0x591b0e){var _0x259a71=this;return new Promise(function(_0x9d5954,_0x21e561){return db[_0xb720('0x16')][_0xb720('0x23')](_0x591b0e['body'],{'raw':_0x591b0e['options']?_0x591b0e[_0xb720('0x18')][_0xb720('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x591b0e[_0xb720('0x18')]?_0x591b0e[_0xb720('0x18')][_0xb720('0x1a')]||null:null,'attributes':_0x591b0e[_0xb720('0x18')]?_0x591b0e[_0xb720('0x18')][_0xb720('0x1b')]||null:null,'limit':_0x591b0e[_0xb720('0x18')]?_0x591b0e['options']['limit']||null:null})[_0xb720('0xc')](function(_0x221d39){logger[_0xb720('0xd')](_0xb720('0x24'),_0x591b0e);logger[_0xb720('0x10')](_0xb720('0x24'),_0x591b0e,JSON[_0xb720('0x11')](_0x221d39));_0x9d5954(_0x221d39);})[_0xb720('0x14')](function(_0xad5038){logger[_0xb720('0x12')](_0xb720('0x24'),_0xad5038[_0xb720('0x13')],_0x591b0e);_0x21e561(_0x259a71[_0xb720('0x12')](0x1f4,_0xad5038[_0xb720('0x13')]));});});}; \ No newline at end of file +var _0x4cff=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','result','catch','MemberReport','options','raw','attributes','limit','include','map','model','GetMemberReport','CreateMemberReport','create','body','update','UpdateMemberReport','lodash','util','bluebird'];(function(_0x145848,_0x5ccb90){var _0x2bcf67=function(_0x223745){while(--_0x223745){_0x145848['push'](_0x145848['shift']());}};_0x2bcf67(++_0x5ccb90);}(_0x4cff,0x14a));var _0xf4cf=function(_0x50ca98,_0x21cc09){_0x50ca98=_0x50ca98-0x0;var _0x4ec576=_0x4cff[_0x50ca98];return _0x4ec576;};'use strict';var _=require(_0xf4cf('0x0'));var util=require(_0xf4cf('0x1'));var moment=require('moment');var BPromise=require(_0xf4cf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf4cf('0x3'));var db=require(_0xf4cf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf4cf('0x5'))(_0xf4cf('0x6'));var config=require(_0xf4cf('0x7'));var jayson=require(_0xf4cf('0x8'));var client=jayson[_0xf4cf('0x9')][_0xf4cf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53a3e6,_0x25d0cf,_0x125a37){return new BPromise(function(_0x1f06c6,_0x3882b2){return client['request'](_0x53a3e6,_0x125a37)[_0xf4cf('0xb')](function(_0x36b238){logger[_0xf4cf('0xc')](_0xf4cf('0xd'),_0x25d0cf,'request\x20sent');logger[_0xf4cf('0xe')](_0xf4cf('0xf'),_0x25d0cf,_0xf4cf('0x10'),JSON[_0xf4cf('0x11')](_0x36b238));if(_0x36b238['error']){if(_0x36b238['error'][_0xf4cf('0x12')]===0x1f4){logger['error']('MemberReport,\x20%s,\x20%s',_0x25d0cf,_0x36b238['error'][_0xf4cf('0x13')]);return _0x3882b2(_0x36b238[_0xf4cf('0x14')][_0xf4cf('0x13')]);}logger[_0xf4cf('0x14')](_0xf4cf('0xd'),_0x25d0cf,_0x36b238[_0xf4cf('0x14')][_0xf4cf('0x13')]);return _0x1f06c6(_0x36b238[_0xf4cf('0x14')][_0xf4cf('0x13')]);}else{logger[_0xf4cf('0xc')]('MemberReport,\x20%s,\x20%s',_0x25d0cf,_0xf4cf('0x10'));_0x1f06c6(_0x36b238[_0xf4cf('0x15')][_0xf4cf('0x13')]);}})[_0xf4cf('0x16')](function(_0x5260aa){logger[_0xf4cf('0x14')](_0xf4cf('0xd'),_0x25d0cf,_0x5260aa);_0x3882b2(_0x5260aa);});});}exports['GetMemberReport']=function(_0x3999e7){var _0x2aa048=this;return new Promise(function(_0x329347,_0x5469e2){return db[_0xf4cf('0x17')]['findAll']({'raw':_0x3999e7[_0xf4cf('0x18')]?_0x3999e7['options'][_0xf4cf('0x19')]===undefined?!![]:![]:!![],'where':_0x3999e7['options']?_0x3999e7['options']['where']||null:null,'attributes':_0x3999e7[_0xf4cf('0x18')]?_0x3999e7[_0xf4cf('0x18')][_0xf4cf('0x1a')]||null:null,'limit':_0x3999e7[_0xf4cf('0x18')]?_0x3999e7[_0xf4cf('0x18')][_0xf4cf('0x1b')]||null:null,'include':_0x3999e7[_0xf4cf('0x18')]?_0x3999e7['options'][_0xf4cf('0x1c')]?_[_0xf4cf('0x1d')](_0x3999e7[_0xf4cf('0x18')][_0xf4cf('0x1c')],function(_0xba64fe){return{'model':db[_0xba64fe[_0xf4cf('0x1e')]],'as':_0xba64fe['as'],'attributes':_0xba64fe['attributes'],'include':_0xba64fe[_0xf4cf('0x1c')]?_[_0xf4cf('0x1d')](_0xba64fe['include'],function(_0x1d26b0){return{'model':db[_0x1d26b0['model']],'as':_0x1d26b0['as'],'attributes':_0x1d26b0['attributes'],'include':_0x1d26b0[_0xf4cf('0x1c')]?_[_0xf4cf('0x1d')](_0x1d26b0['include'],function(_0x230a18){return{'model':db[_0x230a18['model']],'as':_0x230a18['as'],'attributes':_0x230a18[_0xf4cf('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf4cf('0xb')](function(_0x97e3e4){logger['info']('GetMemberReport',_0x3999e7);logger[_0xf4cf('0xe')](_0xf4cf('0x1f'),_0x3999e7,JSON[_0xf4cf('0x11')](_0x97e3e4));_0x329347(_0x97e3e4);})[_0xf4cf('0x16')](function(_0x164ee8){logger[_0xf4cf('0x14')](_0xf4cf('0x1f'),_0x164ee8['message'],_0x3999e7);_0x5469e2(_0x2aa048[_0xf4cf('0x14')](0x1f4,_0x164ee8[_0xf4cf('0x13')]));});});};exports[_0xf4cf('0x20')]=function(_0x471a0f){var _0x33b5c2=this;return new Promise(function(_0x47de20,_0x5d1dc0){return db[_0xf4cf('0x17')][_0xf4cf('0x21')](_0x471a0f[_0xf4cf('0x22')],{'raw':_0x471a0f[_0xf4cf('0x18')]?_0x471a0f[_0xf4cf('0x18')][_0xf4cf('0x19')]===undefined?!![]:![]:!![]})[_0xf4cf('0xb')](function(_0xe3524d){logger[_0xf4cf('0xc')]('CreateMemberReport',_0x471a0f);logger['debug'](_0xf4cf('0x20'),_0x471a0f,JSON[_0xf4cf('0x11')](_0xe3524d));_0x47de20(_0xe3524d);})[_0xf4cf('0x16')](function(_0x23ca65){logger[_0xf4cf('0x14')]('CreateMemberReport',_0x23ca65[_0xf4cf('0x13')],_0x471a0f);_0x5d1dc0(_0x33b5c2['error'](0x1f4,_0x23ca65[_0xf4cf('0x13')]));});});};exports['UpdateMemberReport']=function(_0x2ef5fe){var _0x22de0d=this;return new Promise(function(_0x28b524,_0x4590ec){return db['MemberReport'][_0xf4cf('0x23')](_0x2ef5fe['body'],{'raw':_0x2ef5fe[_0xf4cf('0x18')]?_0x2ef5fe['options'][_0xf4cf('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ef5fe[_0xf4cf('0x18')]?_0x2ef5fe['options']['where']||null:null,'attributes':_0x2ef5fe[_0xf4cf('0x18')]?_0x2ef5fe[_0xf4cf('0x18')]['attributes']||null:null,'limit':_0x2ef5fe[_0xf4cf('0x18')]?_0x2ef5fe[_0xf4cf('0x18')]['limit']||null:null})['then'](function(_0x33fe63){logger['info'](_0xf4cf('0x24'),_0x2ef5fe);logger[_0xf4cf('0xe')](_0xf4cf('0x24'),_0x2ef5fe,JSON[_0xf4cf('0x11')](_0x33fe63));_0x28b524(_0x33fe63);})[_0xf4cf('0x16')](function(_0xbf80dc){logger[_0xf4cf('0x14')](_0xf4cf('0x24'),_0xbf80dc[_0xf4cf('0x13')],_0x2ef5fe);_0x4590ec(_0x22de0d[_0xf4cf('0x14')](0x1f4,_0xbf80dc[_0xf4cf('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 7c7bd99..470f227 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 _0x170d=['express','Router','../../components/interaction/service','./migration.controller','get','index','exports','multer','util','path','connect-timeout'];(function(_0x5c9c54,_0x5a5d39){var _0x51da8b=function(_0x153241){while(--_0x153241){_0x5c9c54['push'](_0x5c9c54['shift']());}};_0x51da8b(++_0x5a5d39);}(_0x170d,0x13b));var _0xd170=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x170d[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0xd170('0x0'));var util=require(_0xd170('0x1'));var path=require(_0xd170('0x2'));var timeout=require(_0xd170('0x3'));var express=require(_0xd170('0x4'));var router=express[_0xd170('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd170('0x6'));var config=require('../../config/environment');var controller=require(_0xd170('0x7'));router[_0xd170('0x8')]('/',controller[_0xd170('0x9')]);module[_0xd170('0xa')]=router; \ No newline at end of file +var _0x6170=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./migration.controller','get','index'];(function(_0x5126dc,_0xcb914){var _0x31fc0c=function(_0x178d47){while(--_0x178d47){_0x5126dc['push'](_0x5126dc['shift']());}};_0x31fc0c(++_0xcb914);}(_0x6170,0x1d5));var _0x0617=function(_0x3427ef,_0x513bb3){_0x3427ef=_0x3427ef-0x0;var _0x443ed2=_0x6170[_0x3427ef];return _0x443ed2;};'use strict';var multer=require(_0x0617('0x0'));var util=require('util');var path=require(_0x0617('0x1'));var timeout=require(_0x0617('0x2'));var express=require(_0x0617('0x3'));var router=express[_0x0617('0x4')]();var fs_extra=require(_0x0617('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0617('0x6'));var config=require(_0x0617('0x7'));var controller=require(_0x0617('0x8'));router[_0x0617('0x9')]('/',controller[_0x0617('0xa')]);module[_0x0617('0xb')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index f18f551..e72905f 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 _0xc760=['version','exports','STRING'];(function(_0x1026d2,_0x42fe66){var _0x4a6773=function(_0x1a295f){while(--_0x1a295f){_0x1026d2['push'](_0x1026d2['shift']());}};_0x4a6773(++_0x42fe66);}(_0xc760,0x7f));var _0x0c76=function(_0x4e4bf8,_0x65dcf3){_0x4e4bf8=_0x4e4bf8-0x0;var _0x39171c=_0xc760[_0x4e4bf8];return _0x39171c;};'use strict';var Sequelize=require('sequelize');module[_0x0c76('0x0')]={'version':{'type':Sequelize[_0x0c76('0x1')],'unique':_0x0c76('0x2')}}; \ No newline at end of file +var _0xef94=['exports'];(function(_0x2fcd90,_0x4780cc){var _0x55b596=function(_0xe475f6){while(--_0xe475f6){_0x2fcd90['push'](_0x2fcd90['shift']());}};_0x55b596(++_0x4780cc);}(_0xef94,0x13e));var _0x4ef9=function(_0x50917f,_0x446aa8){_0x50917f=_0x50917f-0x0;var _0x37c7bb=_0xef94[_0x50917f];return _0x37c7bb;};'use strict';var Sequelize=require('sequelize');module[_0x4ef9('0x0')]={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 3938488..a93a9fc 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 _0x088d=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','order','sort','filters','pick','filter','merge','where','VIRTUAL','Migration','includeAll','findAll','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x25566d,_0x478964){var _0x27f3a8=function(_0x172aa3){while(--_0x172aa3){_0x25566d['push'](_0x25566d['shift']());}};_0x27f3a8(++_0x478964);}(_0x088d,0x7b));var _0xd088=function(_0x3ed888,_0x1e4779){_0x3ed888=_0x3ed888-0x0;var _0x4b1254=_0x088d[_0x3ed888];return _0x4b1254;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd088('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd088('0x1'));var rp=require(_0xd088('0x2'));var moment=require(_0xd088('0x3'));var BPromise=require(_0xd088('0x4'));var Mustache=require(_0xd088('0x5'));var util=require(_0xd088('0x6'));var path=require('path');var sox=require(_0xd088('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd088('0x8'));var _=require(_0xd088('0x9'));var squel=require(_0xd088('0xa'));var crypto=require(_0xd088('0xb'));var jsforce=require(_0xd088('0xc'));var deskjs=require(_0xd088('0xd'));var toCsv=require(_0xd088('0xe'));var querystring=require(_0xd088('0xf'));var Papa=require(_0xd088('0x10'));var Redis=require(_0xd088('0x11'));var authService=require(_0xd088('0x12'));var qs=require(_0xd088('0x13'));var as=require(_0xd088('0x14'));var hardwareService=require(_0xd088('0x15'));var logger=require(_0xd088('0x16'))(_0xd088('0x17'));var utils=require(_0xd088('0x18'));var config=require(_0xd088('0x19'));var licenseUtil=require(_0xd088('0x1a'));var db=require(_0xd088('0x1b'))['db'];function respondWithStatusCode(_0x431e3d,_0x25c84c){_0x25c84c=_0x25c84c||0xcc;return function(_0x4f1b6e){if(_0x4f1b6e){return _0x431e3d[_0xd088('0x1c')](_0x25c84c);}return _0x431e3d[_0xd088('0x1d')](_0x25c84c)[_0xd088('0x1e')]();};}function respondWithResult(_0x5e6b03,_0x52ec3f){_0x52ec3f=_0x52ec3f||0xc8;return function(_0x3a8f09){if(_0x3a8f09){return _0x5e6b03['status'](_0x52ec3f)['json'](_0x3a8f09);}};}function respondWithFilteredResult(_0x2ec961,_0x41c94d){return function(_0x5eaf3e){if(_0x5eaf3e){var _0x456382=typeof _0x41c94d[_0xd088('0x1f')]==='undefined'&&typeof _0x41c94d[_0xd088('0x20')]===_0xd088('0x21');var _0x5cf192=_0x5eaf3e[_0xd088('0x22')];var _0xdfa1ef=_0x456382?0x0:_0x41c94d[_0xd088('0x1f')];var _0x2fcebb=_0x456382?_0x5eaf3e[_0xd088('0x22')]:_0x41c94d[_0xd088('0x1f')]+_0x41c94d[_0xd088('0x20')];var _0xe334cf;if(_0x2fcebb>=_0x5cf192){_0x2fcebb=_0x5cf192;_0xe334cf=0xc8;}else{_0xe334cf=0xce;}_0x2ec961['status'](_0xe334cf);return _0x2ec961[_0xd088('0x23')](_0xd088('0x24'),_0xdfa1ef+'-'+_0x2fcebb+'/'+_0x5cf192)[_0xd088('0x25')](_0x5eaf3e);}return null;};}function patchUpdates(_0x36528d){return function(_0x9a17c4){try{jsonpatch[_0xd088('0x26')](_0x9a17c4,_0x36528d,!![]);}catch(_0x398e12){return BPromise[_0xd088('0x27')](_0x398e12);}return _0x9a17c4[_0xd088('0x28')]();};}function saveUpdates(_0x345581,_0x33edcf){return function(_0x4da08e){if(_0x4da08e){return _0x4da08e['update'](_0x345581)[_0xd088('0x29')](function(_0x45276d){return _0x45276d;});}return null;};}function removeEntity(_0x55aa2c,_0x4be45a){return function(_0x328a17){if(_0x328a17){return _0x328a17[_0xd088('0x2a')]()['then'](function(){_0x55aa2c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x578a6e,_0x3030c0){return function(_0x34b1e4){if(!_0x34b1e4){_0x578a6e['sendStatus'](0x194);}return _0x34b1e4;};}function handleError(_0x10f3cc,_0x163665){_0x163665=_0x163665||0x1f4;return function(_0x67d004){logger[_0xd088('0x2b')](_0x67d004['stack']);if(_0x67d004[_0xd088('0x2c')]){delete _0x67d004['name'];}_0x10f3cc[_0xd088('0x1d')](_0x163665)[_0xd088('0x2d')](_0x67d004);};}exports[_0xd088('0x2e')]=function(_0x591857,_0x910efe){var _0x5b9529={},_0x1afdce={},_0x7e9e44={'count':0x0,'rows':[]};var _0x3feb3e=_['map'](db['Migration'][_0xd088('0x2f')],function(_0xd1b147){return{'name':_0xd1b147[_0xd088('0x30')],'type':_0xd1b147[_0xd088('0x31')][_0xd088('0x32')]};});_0x1afdce[_0xd088('0x33')]=_[_0xd088('0x34')](_0x3feb3e,_0xd088('0x2c'));_0x1afdce[_0xd088('0x35')]=_[_0xd088('0x36')](_0x591857['query']);_0x1afdce['filters']=_[_0xd088('0x37')](_0x1afdce[_0xd088('0x33')],_0x1afdce[_0xd088('0x35')]);_0x5b9529[_0xd088('0x38')]=_[_0xd088('0x37')](_0x1afdce[_0xd088('0x33')],qs[_0xd088('0x39')](_0x591857[_0xd088('0x35')]['fields']));_0x5b9529[_0xd088('0x38')]=_0x5b9529[_0xd088('0x38')][_0xd088('0x3a')]?_0x5b9529['attributes']:_0x1afdce[_0xd088('0x33')];if(!_0x591857[_0xd088('0x35')]['hasOwnProperty']('nolimit')){_0x5b9529[_0xd088('0x20')]=qs[_0xd088('0x20')](_0x591857['query'][_0xd088('0x20')]);_0x5b9529['offset']=qs[_0xd088('0x1f')](_0x591857[_0xd088('0x35')][_0xd088('0x1f')]);}_0x5b9529[_0xd088('0x3b')]=qs[_0xd088('0x3c')](_0x591857[_0xd088('0x35')]['sort']);_0x5b9529['where']=qs[_0xd088('0x3d')](_[_0xd088('0x3e')](_0x591857[_0xd088('0x35')],_0x1afdce[_0xd088('0x3d')]),_0x3feb3e);if(_0x591857[_0xd088('0x35')][_0xd088('0x3f')]){_0x5b9529['where']=_[_0xd088('0x40')](_0x5b9529[_0xd088('0x41')],{'$or':_[_0xd088('0x34')](_0x3feb3e,function(_0x289476){if(_0x289476['type']!==_0xd088('0x42')){var _0x51491f={};_0x51491f[_0x289476['name']]={'$like':'%'+_0x591857[_0xd088('0x35')][_0xd088('0x3f')]+'%'};return _0x51491f;}})});}_0x5b9529=_[_0xd088('0x40')]({},_0x5b9529,_0x591857['options']);var _0x3bcfdb={'where':_0x5b9529[_0xd088('0x41')]};return db[_0xd088('0x43')]['count'](_0x3bcfdb)[_0xd088('0x29')](function(_0x1057fb){_0x7e9e44[_0xd088('0x22')]=_0x1057fb;if(_0x591857[_0xd088('0x35')][_0xd088('0x44')]){_0x5b9529['include']=[{'all':!![]}];}return db[_0xd088('0x43')][_0xd088('0x45')](_0x5b9529);})[_0xd088('0x29')](function(_0x304905){_0x7e9e44['rows']=_0x304905;return _0x7e9e44;})['then'](respondWithFilteredResult(_0x910efe,_0x5b9529))['catch'](handleError(_0x910efe,null));}; \ No newline at end of file +var _0x2af6=['squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','save','update','then','destroy','error','stack','index','map','Migration','rawAttributes','fieldName','key','name','query','keys','filters','model','attributes','intersection','hasOwnProperty','nolimit','order','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash'];(function(_0x5ee0ee,_0x3ce413){var _0x198093=function(_0x29dcc9){while(--_0x29dcc9){_0x5ee0ee['push'](_0x5ee0ee['shift']());}};_0x198093(++_0x3ce413);}(_0x2af6,0x170));var _0x62af=function(_0x12b753,_0x1f6e5d){_0x12b753=_0x12b753-0x0;var _0x50dbe4=_0x2af6[_0x12b753];return _0x50dbe4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x62af('0x0'));var jsonpatch=require(_0x62af('0x1'));var rp=require('request-promise');var moment=require(_0x62af('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x62af('0x3'));var util=require(_0x62af('0x4'));var path=require(_0x62af('0x5'));var sox=require('sox');var csv=require(_0x62af('0x6'));var ejs=require(_0x62af('0x7'));var fs=require('fs');var fs_extra=require(_0x62af('0x8'));var _=require(_0x62af('0x9'));var squel=require(_0x62af('0xa'));var crypto=require('crypto');var jsforce=require(_0x62af('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x62af('0x6'));var querystring=require(_0x62af('0xc'));var Papa=require(_0x62af('0xd'));var Redis=require('ioredis');var authService=require(_0x62af('0xe'));var qs=require(_0x62af('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x62af('0x10'))(_0x62af('0x11'));var utils=require(_0x62af('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x62af('0x13'));var db=require(_0x62af('0x14'))['db'];function respondWithStatusCode(_0x16b6f4,_0x18ae90){_0x18ae90=_0x18ae90||0xcc;return function(_0x41b0b3){if(_0x41b0b3){return _0x16b6f4[_0x62af('0x15')](_0x18ae90);}return _0x16b6f4[_0x62af('0x16')](_0x18ae90)['end']();};}function respondWithResult(_0x2b93d8,_0x353d59){_0x353d59=_0x353d59||0xc8;return function(_0x3e52b3){if(_0x3e52b3){return _0x2b93d8[_0x62af('0x16')](_0x353d59)[_0x62af('0x17')](_0x3e52b3);}};}function respondWithFilteredResult(_0x460ba7,_0x4db9c8){return function(_0x515cfe){if(_0x515cfe){var _0x15adac=typeof _0x4db9c8[_0x62af('0x18')]===_0x62af('0x19')&&typeof _0x4db9c8['limit']===_0x62af('0x19');var _0x19da98=_0x515cfe[_0x62af('0x1a')];var _0x119c2d=_0x15adac?0x0:_0x4db9c8[_0x62af('0x18')];var _0x3af8ba=_0x15adac?_0x515cfe[_0x62af('0x1a')]:_0x4db9c8[_0x62af('0x18')]+_0x4db9c8[_0x62af('0x1b')];var _0x372abd;if(_0x3af8ba>=_0x19da98){_0x3af8ba=_0x19da98;_0x372abd=0xc8;}else{_0x372abd=0xce;}_0x460ba7[_0x62af('0x16')](_0x372abd);return _0x460ba7['set'](_0x62af('0x1c'),_0x119c2d+'-'+_0x3af8ba+'/'+_0x19da98)[_0x62af('0x17')](_0x515cfe);}return null;};}function patchUpdates(_0x5efb67){return function(_0x172bca){try{jsonpatch['apply'](_0x172bca,_0x5efb67,!![]);}catch(_0x464cd4){return BPromise['reject'](_0x464cd4);}return _0x172bca[_0x62af('0x1d')]();};}function saveUpdates(_0x7c79fc,_0x47ecf1){return function(_0x1e30fe){if(_0x1e30fe){return _0x1e30fe[_0x62af('0x1e')](_0x7c79fc)[_0x62af('0x1f')](function(_0xbd1a28){return _0xbd1a28;});}return null;};}function removeEntity(_0x1c489d,_0x2d9f1b){return function(_0x3b9f82){if(_0x3b9f82){return _0x3b9f82[_0x62af('0x20')]()[_0x62af('0x1f')](function(){_0x1c489d[_0x62af('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3efd31,_0x51a607){return function(_0x480f67){if(!_0x480f67){_0x3efd31[_0x62af('0x15')](0x194);}return _0x480f67;};}function handleError(_0x6ab911,_0x57e3c4){_0x57e3c4=_0x57e3c4||0x1f4;return function(_0x396623){logger[_0x62af('0x21')](_0x396623[_0x62af('0x22')]);if(_0x396623['name']){delete _0x396623['name'];}_0x6ab911[_0x62af('0x16')](_0x57e3c4)['send'](_0x396623);};}exports[_0x62af('0x23')]=function(_0x4c27de,_0x122c77){var _0x21f781={},_0x76f43a={},_0xd9f1ed={'count':0x0,'rows':[]};var _0x461519=_[_0x62af('0x24')](db[_0x62af('0x25')][_0x62af('0x26')],function(_0x46ef5b){return{'name':_0x46ef5b[_0x62af('0x27')],'type':_0x46ef5b['type'][_0x62af('0x28')]};});_0x76f43a['model']=_[_0x62af('0x24')](_0x461519,_0x62af('0x29'));_0x76f43a[_0x62af('0x2a')]=_[_0x62af('0x2b')](_0x4c27de['query']);_0x76f43a[_0x62af('0x2c')]=_['intersection'](_0x76f43a[_0x62af('0x2d')],_0x76f43a[_0x62af('0x2a')]);_0x21f781[_0x62af('0x2e')]=_[_0x62af('0x2f')](_0x76f43a['model'],qs['fields'](_0x4c27de['query']['fields']));_0x21f781[_0x62af('0x2e')]=_0x21f781[_0x62af('0x2e')]['length']?_0x21f781[_0x62af('0x2e')]:_0x76f43a[_0x62af('0x2d')];if(!_0x4c27de[_0x62af('0x2a')][_0x62af('0x30')](_0x62af('0x31'))){_0x21f781[_0x62af('0x1b')]=qs[_0x62af('0x1b')](_0x4c27de[_0x62af('0x2a')]['limit']);_0x21f781[_0x62af('0x18')]=qs[_0x62af('0x18')](_0x4c27de[_0x62af('0x2a')][_0x62af('0x18')]);}_0x21f781[_0x62af('0x32')]=qs['sort'](_0x4c27de[_0x62af('0x2a')]['sort']);_0x21f781[_0x62af('0x33')]=qs[_0x62af('0x2c')](_[_0x62af('0x34')](_0x4c27de[_0x62af('0x2a')],_0x76f43a[_0x62af('0x2c')]),_0x461519);if(_0x4c27de[_0x62af('0x2a')][_0x62af('0x35')]){_0x21f781[_0x62af('0x33')]=_['merge'](_0x21f781[_0x62af('0x33')],{'$or':_[_0x62af('0x24')](_0x461519,function(_0x144624){if(_0x144624[_0x62af('0x36')]!==_0x62af('0x37')){var _0x1c7d11={};_0x1c7d11[_0x144624[_0x62af('0x29')]]={'$like':'%'+_0x4c27de[_0x62af('0x2a')][_0x62af('0x35')]+'%'};return _0x1c7d11;}})});}_0x21f781=_[_0x62af('0x38')]({},_0x21f781,_0x4c27de[_0x62af('0x39')]);var _0x57a84d={'where':_0x21f781['where']};return db[_0x62af('0x25')][_0x62af('0x1a')](_0x57a84d)[_0x62af('0x1f')](function(_0x2be81d){_0xd9f1ed['count']=_0x2be81d;if(_0x4c27de['query'][_0x62af('0x3a')]){_0x21f781[_0x62af('0x3b')]=[{'all':!![]}];}return db[_0x62af('0x25')][_0x62af('0x3c')](_0x21f781);})[_0x62af('0x1f')](function(_0x629b53){_0xd9f1ed[_0x62af('0x3d')]=_0x629b53;return _0xd9f1ed;})[_0x62af('0x1f')](respondWithFilteredResult(_0x122c77,_0x21f781))[_0x62af('0x3e')](handleError(_0x122c77,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index a479907..05a201c 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 _0xaa21=['migrations','util','bluebird','request-promise','rimraf','../../config/environment','./migration.attributes','exports','define','Migration'];(function(_0x5d816a,_0x48b3f7){var _0x445415=function(_0x394276){while(--_0x394276){_0x5d816a['push'](_0x5d816a['shift']());}};_0x445415(++_0x48b3f7);}(_0xaa21,0x119));var _0x1aa2=function(_0x487524,_0x292ba6){_0x487524=_0x487524-0x0;var _0x3f3543=_0xaa21[_0x487524];return _0x3f3543;};'use strict';var _=require('lodash');var util=require(_0x1aa2('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1aa2('0x1'));var rp=require(_0x1aa2('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1aa2('0x3'));var config=require(_0x1aa2('0x4'));var attributes=require(_0x1aa2('0x5'));module[_0x1aa2('0x6')]=function(_0x4d1937,_0xdbc990){return _0x4d1937[_0x1aa2('0x7')](_0x1aa2('0x8'),attributes,{'tableName':_0x1aa2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3453=['request-promise','path','./migration.attributes','exports','Migration','migrations','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x3453,0x1a8));var _0x3345=function(_0x49c663,_0x37d7a3){_0x49c663=_0x49c663-0x0;var _0x5a3e7e=_0x3453[_0x49c663];return _0x5a3e7e;};'use strict';var _=require(_0x3345('0x0'));var util=require('util');var logger=require(_0x3345('0x1'))(_0x3345('0x2'));var moment=require(_0x3345('0x3'));var BPromise=require(_0x3345('0x4'));var rp=require(_0x3345('0x5'));var fs=require('fs');var path=require(_0x3345('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3345('0x7'));module[_0x3345('0x8')]=function(_0x4178fa,_0x95f410){return _0x4178fa['define'](_0x3345('0x9'),attributes,{'tableName':_0x3345('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index d451f04..af420d5 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 _0xd139=['../../config/logger','rpc','../../config/environment','client','http','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2f437b,_0x2499b5){var _0x3b53fc=function(_0x5ddf8f){while(--_0x5ddf8f){_0x2f437b['push'](_0x2f437b['shift']());}};_0x3b53fc(++_0x2499b5);}(_0xd139,0x14e));var _0x9d13=function(_0x7b024e,_0x30fc22){_0x7b024e=_0x7b024e-0x0;var _0xd73520=_0xd139[_0x7b024e];return _0xd73520;};'use strict';var _=require(_0x9d13('0x0'));var util=require(_0x9d13('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9d13('0x2'));var fs=require('fs');var Redis=require(_0x9d13('0x3'));var db=require(_0x9d13('0x4'))['db'];var utils=require(_0x9d13('0x5'));var logger=require(_0x9d13('0x6'))(_0x9d13('0x7'));var config=require(_0x9d13('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9d13('0x9')][_0x9d13('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50294b,_0x198d7d,_0x4b3db0){return new BPromise(function(_0x434ef6,_0x524947){return client['request'](_0x50294b,_0x4b3db0)['then'](function(_0x3ccdf9){logger[_0x9d13('0xb')](_0x9d13('0xc'),_0x198d7d,_0x9d13('0xd'));logger[_0x9d13('0xe')]('Migration,\x20%s,\x20%s,\x20%s',_0x198d7d,_0x9d13('0xd'),JSON[_0x9d13('0xf')](_0x3ccdf9));if(_0x3ccdf9[_0x9d13('0x10')]){if(_0x3ccdf9['error']['code']===0x1f4){logger[_0x9d13('0x10')](_0x9d13('0xc'),_0x198d7d,_0x3ccdf9[_0x9d13('0x10')][_0x9d13('0x11')]);return _0x524947(_0x3ccdf9[_0x9d13('0x10')]['message']);}logger['error'](_0x9d13('0xc'),_0x198d7d,_0x3ccdf9[_0x9d13('0x10')][_0x9d13('0x11')]);return _0x434ef6(_0x3ccdf9[_0x9d13('0x10')][_0x9d13('0x11')]);}else{logger[_0x9d13('0xb')](_0x9d13('0xc'),_0x198d7d,'request\x20sent');_0x434ef6(_0x3ccdf9[_0x9d13('0x12')][_0x9d13('0x11')]);}})[_0x9d13('0x13')](function(_0x250234){logger[_0x9d13('0x10')](_0x9d13('0xc'),_0x198d7d,_0x250234);_0x524947(_0x250234);});});} \ No newline at end of file +var _0x4a3c=['info','Migration,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x3d8130,_0x2d75d9){var _0x5c0013=function(_0x3d0bc){while(--_0x3d0bc){_0x3d8130['push'](_0x3d8130['shift']());}};_0x5c0013(++_0x2d75d9);}(_0x4a3c,0x13c));var _0xc4a3=function(_0x5937fa,_0x2fcb44){_0x5937fa=_0x5937fa-0x0;var _0x67edcb=_0x4a3c[_0x5937fa];return _0x67edcb;};'use strict';var _=require(_0xc4a3('0x0'));var util=require('util');var moment=require(_0xc4a3('0x1'));var BPromise=require(_0xc4a3('0x2'));var rs=require(_0xc4a3('0x3'));var fs=require('fs');var Redis=require(_0xc4a3('0x4'));var db=require(_0xc4a3('0x5'))['db'];var utils=require(_0xc4a3('0x6'));var logger=require(_0xc4a3('0x7'))('rpc');var config=require(_0xc4a3('0x8'));var jayson=require(_0xc4a3('0x9'));var client=jayson[_0xc4a3('0xa')][_0xc4a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b1c84,_0x49fa26,_0x596b01){return new BPromise(function(_0xc11c29,_0x58bdcd){return client[_0xc4a3('0xc')](_0x4b1c84,_0x596b01)[_0xc4a3('0xd')](function(_0x1e7f27){logger[_0xc4a3('0xe')](_0xc4a3('0xf'),_0x49fa26,_0xc4a3('0x10'));logger[_0xc4a3('0x11')]('Migration,\x20%s,\x20%s,\x20%s',_0x49fa26,'request\x20sent',JSON['stringify'](_0x1e7f27));if(_0x1e7f27['error']){if(_0x1e7f27['error']['code']===0x1f4){logger['error'](_0xc4a3('0xf'),_0x49fa26,_0x1e7f27[_0xc4a3('0x12')][_0xc4a3('0x13')]);return _0x58bdcd(_0x1e7f27[_0xc4a3('0x12')]['message']);}logger[_0xc4a3('0x12')](_0xc4a3('0xf'),_0x49fa26,_0x1e7f27['error'][_0xc4a3('0x13')]);return _0xc11c29(_0x1e7f27[_0xc4a3('0x12')][_0xc4a3('0x13')]);}else{logger[_0xc4a3('0xe')](_0xc4a3('0xf'),_0x49fa26,_0xc4a3('0x10'));_0xc11c29(_0x1e7f27[_0xc4a3('0x14')][_0xc4a3('0x13')]);}})[_0xc4a3('0x15')](function(_0x584b6d){logger[_0xc4a3('0x12')](_0xc4a3('0xf'),_0x49fa26,_0x584b6d);_0x58bdcd(_0x584b6d);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index c6bb18b..fcb24af 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 _0x6f7c=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','put'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6f7c,0x137));var _0xc6f7=function(_0x46698a,_0x431d21){_0x46698a=_0x46698a-0x0;var _0x420318=_0x6f7c[_0x46698a];return _0x420318;};'use strict';var multer=require(_0xc6f7('0x0'));var util=require(_0xc6f7('0x1'));var path=require(_0xc6f7('0x2'));var timeout=require(_0xc6f7('0x3'));var express=require(_0xc6f7('0x4'));var router=express[_0xc6f7('0x5')]();var fs_extra=require(_0xc6f7('0x6'));var auth=require(_0xc6f7('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc6f7('0x8'));var controller=require(_0xc6f7('0x9'));router[_0xc6f7('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc6f7('0xa')]('/:id',auth[_0xc6f7('0xb')](),controller['show']);router['post']('/',auth[_0xc6f7('0xb')](),controller['create']);router[_0xc6f7('0xc')](_0xc6f7('0xd'),auth[_0xc6f7('0xb')](),controller[_0xc6f7('0xe')]);router[_0xc6f7('0xf')](_0xc6f7('0xd'),auth[_0xc6f7('0xb')](),controller[_0xc6f7('0x10')]);module[_0xc6f7('0x11')]=router; \ No newline at end of file +var _0xd98a=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x41d931,_0x556666){var _0x3d5592=function(_0x161993){while(--_0x161993){_0x41d931['push'](_0x41d931['shift']());}};_0x3d5592(++_0x556666);}(_0xd98a,0xfc));var _0xad98=function(_0x922df1,_0x28f053){_0x922df1=_0x922df1-0x0;var _0x3291dc=_0xd98a[_0x922df1];return _0x3291dc;};'use strict';var multer=require(_0xad98('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xad98('0x1'));var express=require(_0xad98('0x2'));var router=express[_0xad98('0x3')]();var fs_extra=require(_0xad98('0x4'));var auth=require(_0xad98('0x5'));var interaction=require(_0xad98('0x6'));var config=require('../../config/environment');var controller=require('./network.controller');router[_0xad98('0x7')]('/',auth[_0xad98('0x8')](),controller[_0xad98('0x9')]);router[_0xad98('0x7')](_0xad98('0xa'),auth['isAuthenticated'](),controller[_0xad98('0xb')]);router[_0xad98('0xc')]('/',auth['isAuthenticated'](),controller[_0xad98('0xd')]);router['put'](_0xad98('0xa'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xad98('0xa'),auth[_0xad98('0x8')](),controller[_0xad98('0xe')]);module[_0xad98('0xf')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 0579edf..898ccc2 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 _0xc597=['stun','turn','STRING','sequelize','exports','ENUM','externip'];(function(_0x57f7ea,_0x54da6b){var _0x54a7e4=function(_0x2c9d4f){while(--_0x2c9d4f){_0x57f7ea['push'](_0x57f7ea['shift']());}};_0x54a7e4(++_0x54da6b);}(_0xc597,0x1a0));var _0x7c59=function(_0xc4376d,_0x2e6841){_0xc4376d=_0xc4376d-0x0;var _0x291524=_0xc597[_0xc4376d];return _0x291524;};'use strict';var Sequelize=require(_0x7c59('0x0'));module[_0x7c59('0x1')]={'type':{'type':Sequelize[_0x7c59('0x2')]('localnet',_0x7c59('0x3'),_0x7c59('0x4'),_0x7c59('0x5'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x7c59('0x6')]},'password':{'type':Sequelize[_0x7c59('0x6')]}}; \ No newline at end of file +var _0x91f6=['ENUM','localnet','externip','stun','turn','STRING','sequelize','exports'];(function(_0x4f3c9b,_0x28e078){var _0x84e58a=function(_0x37bf49){while(--_0x37bf49){_0x4f3c9b['push'](_0x4f3c9b['shift']());}};_0x84e58a(++_0x28e078);}(_0x91f6,0x17e));var _0x691f=function(_0x4bbd64,_0x120e52){_0x4bbd64=_0x4bbd64-0x0;var _0x31b17a=_0x91f6[_0x4bbd64];return _0x31b17a;};'use strict';var Sequelize=require(_0x691f('0x0'));module[_0x691f('0x1')]={'type':{'type':Sequelize[_0x691f('0x2')](_0x691f('0x3'),_0x691f('0x4'),_0x691f('0x5'),_0x691f('0x6'))},'value':{'type':Sequelize[_0x691f('0x7')]},'username':{'type':Sequelize[_0x691f('0x7')]},'password':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 0ed13fd..0704716 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 _0x95b0=['update','sendStatus','name','send','map','Network','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params','rawAttributes','find','create','body','type','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','Reload','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','format','toLowerCase','chan_sip.so','TURN','/etc/asterisk/sip_xcally_%s.conf','destroy','util','ejs','lodash','../../config/logger','api','../../mysqldb','jayson/promise','client','then','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','Network,\x20%s,\x20%s','message','info','result','catch','status','offset','undefined','count','limit','set','Content-Range'];(function(_0x49b339,_0x4055e6){var _0x1ca51f=function(_0xe6353e){while(--_0xe6353e){_0x49b339['push'](_0x49b339['shift']());}};_0x1ca51f(++_0x4055e6);}(_0x95b0,0x171));var _0x095b=function(_0x318504,_0x258421){_0x318504=_0x318504-0x0;var _0x3459ab=_0x95b0[_0x318504];return _0x3459ab;};'use strict';var util=require(_0x095b('0x0'));var path=require('path');var ejs=require(_0x095b('0x1'));var fs=require('fs');var _=require(_0x095b('0x2'));var qs=require('../../components/parsers/qs');var logger=require(_0x095b('0x3'))(_0x095b('0x4'));var config=require('../../config/environment');var db=require(_0x095b('0x5'))['db'];var jayson=require(_0x095b('0x6'));var client=jayson[_0x095b('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27df9b,_0x27c671,_0x4566e1,_0x5b9a8f){return new Promise(function(_0x42a275,_0xbf12a2){var _0x12765a=_0x5b9a8f||client;return _0x12765a['request'](_0x27df9b,_0x4566e1)[_0x095b('0x8')](function(_0x3f253d){logger['info']('Network,\x20%s,\x20%s',_0x27c671,_0x095b('0x9'));logger[_0x095b('0xa')](_0x095b('0xb'),_0x27c671,'request\x20sent',JSON[_0x095b('0xc')](_0x3f253d));if(_0x3f253d[_0x095b('0xd')]){if(_0x3f253d[_0x095b('0xd')]['code']===0x1f4){logger[_0x095b('0xd')](_0x095b('0xe'),_0x27c671,_0x3f253d[_0x095b('0xd')][_0x095b('0xf')]);return _0xbf12a2(_0x3f253d['error'][_0x095b('0xf')]);}logger[_0x095b('0xd')](_0x095b('0xe'),_0x27c671,_0x3f253d['error'][_0x095b('0xf')]);return _0x42a275(_0x3f253d[_0x095b('0xd')][_0x095b('0xf')]);}else{logger[_0x095b('0x10')](_0x095b('0xe'),_0x27c671,_0x095b('0x9'));_0x42a275(_0x3f253d[_0x095b('0x11')][_0x095b('0xf')]);}})[_0x095b('0x12')](function(_0x59ea6a){logger[_0x095b('0xd')](_0x095b('0xe'),_0x27c671,_0x59ea6a);_0xbf12a2(_0x59ea6a);});});}function respondWithResult(_0x11a36a,_0x404bb8){_0x404bb8=_0x404bb8||0xc8;return function(_0x1aacbd){if(_0x1aacbd){return _0x11a36a[_0x095b('0x13')](_0x404bb8)['json'](_0x1aacbd);}};}function respondWithFilteredResult(_0x36fa83,_0x4636d3){return function(_0x17a366){if(_0x17a366){var _0x284bcd=typeof _0x4636d3[_0x095b('0x14')]===_0x095b('0x15')&&typeof _0x4636d3['limit']==='undefined';var _0x63919a=_0x17a366['count'];var _0x9461d5=_0x284bcd?0x0:_0x4636d3['offset'];var _0x49ea17=_0x284bcd?_0x17a366[_0x095b('0x16')]:_0x4636d3['offset']+_0x4636d3[_0x095b('0x17')];var _0x3dab4e;if(_0x49ea17>=_0x63919a){_0x49ea17=_0x63919a;_0x3dab4e=0xc8;}else{_0x3dab4e=0xce;}_0x36fa83[_0x095b('0x13')](_0x3dab4e);return _0x36fa83[_0x095b('0x18')](_0x095b('0x19'),_0x9461d5+'-'+_0x49ea17+'/'+_0x63919a)['json'](_0x17a366);}return null;};}function saveUpdates(_0x7e204c){return function(_0x26c9bc){if(_0x26c9bc){return _0x26c9bc[_0x095b('0x1a')](_0x7e204c)['then'](function(_0x3f3950){return _0x3f3950;});}return null;};}function removeEntity(_0x207cd1){return function(_0x36f51c){if(_0x36f51c){return _0x36f51c['destroy']()[_0x095b('0x8')](function(){_0x207cd1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x180eb3){return function(_0x2f4429){if(!_0x2f4429){_0x180eb3[_0x095b('0x1b')](0x194);}return _0x2f4429;};}function handleError(_0x152104,_0x485d2d){_0x485d2d=_0x485d2d||0x1f4;return function(_0x409de8){logger[_0x095b('0xd')](_0x409de8['stack']);if(_0x409de8['name']){delete _0x409de8[_0x095b('0x1c')];}_0x152104[_0x095b('0x13')](_0x485d2d)[_0x095b('0x1d')](_0x409de8);};}exports['index']=function(_0x5018b7,_0x2ca5aa){var _0x4745f={},_0x1283c2={},_0xc416f4={'count':0x0,'rows':[]};var _0x55dce1=_[_0x095b('0x1e')](db[_0x095b('0x1f')]['rawAttributes'],function(_0x444a66){return{'name':_0x444a66['fieldName'],'type':_0x444a66['type'][_0x095b('0x20')]};});_0x1283c2[_0x095b('0x21')]=_[_0x095b('0x1e')](_0x55dce1,'name');_0x1283c2[_0x095b('0x22')]=_[_0x095b('0x23')](_0x5018b7[_0x095b('0x22')]);_0x1283c2[_0x095b('0x24')]=_[_0x095b('0x25')](_0x1283c2[_0x095b('0x21')],_0x1283c2[_0x095b('0x22')]);_0x4745f[_0x095b('0x26')]=_[_0x095b('0x25')](_0x1283c2[_0x095b('0x21')],qs[_0x095b('0x27')](_0x5018b7[_0x095b('0x22')][_0x095b('0x27')]));_0x4745f[_0x095b('0x26')]=_0x4745f[_0x095b('0x26')][_0x095b('0x28')]?_0x4745f[_0x095b('0x26')]:_0x1283c2['model'];if(!_0x5018b7[_0x095b('0x22')][_0x095b('0x29')](_0x095b('0x2a'))){_0x4745f['limit']=qs[_0x095b('0x17')](_0x5018b7[_0x095b('0x22')][_0x095b('0x17')]);_0x4745f[_0x095b('0x14')]=qs[_0x095b('0x14')](_0x5018b7[_0x095b('0x22')][_0x095b('0x14')]);}_0x4745f[_0x095b('0x2b')]=qs[_0x095b('0x2c')](_0x5018b7[_0x095b('0x22')][_0x095b('0x2c')]);_0x4745f[_0x095b('0x2d')]=qs[_0x095b('0x24')](_[_0x095b('0x2e')](_0x5018b7[_0x095b('0x22')],_0x1283c2['filters']),_0x55dce1);if(_0x5018b7[_0x095b('0x22')][_0x095b('0x2f')]){_0x4745f[_0x095b('0x2d')]=_['merge'](_0x4745f['where'],{'$or':_[_0x095b('0x1e')](_0x55dce1,function(_0x438530){if(_0x438530['type']!=='VIRTUAL'){var _0x1723a8={};_0x1723a8[_0x438530['name']]={'$like':'%'+_0x5018b7[_0x095b('0x22')][_0x095b('0x2f')]+'%'};return _0x1723a8;}})});}_0x4745f=_[_0x095b('0x30')]({},_0x4745f,_0x5018b7[_0x095b('0x31')]);var _0x31f329={'where':_0x4745f[_0x095b('0x2d')]};return db[_0x095b('0x1f')]['count'](_0x31f329)[_0x095b('0x8')](function(_0x494e83){_0xc416f4[_0x095b('0x16')]=_0x494e83;if(_0x5018b7[_0x095b('0x22')][_0x095b('0x32')]){_0x4745f[_0x095b('0x33')]=[{'all':!![]}];}return db['Network'][_0x095b('0x34')](_0x4745f);})['then'](function(_0x3945c7){_0xc416f4[_0x095b('0x35')]=_0x3945c7;return _0xc416f4;})[_0x095b('0x8')](respondWithFilteredResult(_0x2ca5aa,_0x4745f))[_0x095b('0x12')](handleError(_0x2ca5aa,null));};exports['show']=function(_0x392ad4,_0x477238){var _0x45d363={'raw':!![],'where':{'id':_0x392ad4[_0x095b('0x36')]['id']}},_0x400bb6={};_0x400bb6[_0x095b('0x21')]=_[_0x095b('0x23')](db[_0x095b('0x1f')][_0x095b('0x37')]);_0x400bb6[_0x095b('0x22')]=_[_0x095b('0x23')](_0x392ad4[_0x095b('0x22')]);_0x400bb6[_0x095b('0x24')]=_[_0x095b('0x25')](_0x400bb6[_0x095b('0x21')],_0x400bb6[_0x095b('0x22')]);_0x45d363['attributes']=_['intersection'](_0x400bb6['model'],qs[_0x095b('0x27')](_0x392ad4[_0x095b('0x22')][_0x095b('0x27')]));_0x45d363['attributes']=_0x45d363[_0x095b('0x26')][_0x095b('0x28')]?_0x45d363[_0x095b('0x26')]:_0x400bb6[_0x095b('0x21')];if(_0x392ad4[_0x095b('0x22')][_0x095b('0x32')]){_0x45d363[_0x095b('0x33')]=[{'all':!![]}];}_0x45d363=_['merge']({},_0x45d363,_0x392ad4['options']);return db[_0x095b('0x1f')][_0x095b('0x38')](_0x45d363)[_0x095b('0x8')](handleEntityNotFound(_0x477238,null))[_0x095b('0x8')](respondWithResult(_0x477238,null))['catch'](handleError(_0x477238,null));};exports[_0x095b('0x39')]=function(_0x43b345,_0x15ee34){var _0xa9c7b2;return db[_0x095b('0x1f')]['create'](_0x43b345['body'],{'raw':!![]})['then'](function(_0x51110c){_0xa9c7b2=_0x51110c;return db['Network'][_0x095b('0x34')]({'where':{'type':_0x43b345[_0x095b('0x3a')][_0x095b('0x3b')]},'raw':!![]});})['then'](function(_0x557e7e){if(_0xa9c7b2[_0x095b('0x3b')][_0x095b('0x3c')]()==_0x095b('0x3d')){var _0x285bbb=fs[_0x095b('0x3e')](path[_0x095b('0x3f')](config[_0x095b('0x40')],_0x095b('0x41')),_0x095b('0x42'));var _0x117a25=ejs[_0x095b('0x43')](_0x285bbb,{'networks':_0x557e7e||[]});fs[_0x095b('0x44')]('/etc/asterisk/stun_xcally.conf',_0x117a25);return respondWithRpcPromise(_0x095b('0x45'),_0x095b('0x39'),{'module':_0x095b('0x46')});}else if(_0xa9c7b2[_0x095b('0x3b')][_0x095b('0x3c')]()=='TURN'){var _0x1cebca=fs[_0x095b('0x3e')](path[_0x095b('0x3f')](config[_0x095b('0x40')],_0x095b('0x47')),_0x095b('0x42'));var _0x2762c7=ejs[_0x095b('0x43')](_0x1cebca,{'networks':_0x557e7e||[]});fs[_0x095b('0x44')](_0x095b('0x48'),_0x2762c7);return respondWithRpcPromise(_0x095b('0x45'),_0x095b('0x39'),{'module':_0x095b('0x46')});}else{var _0x478130=fs[_0x095b('0x3e')](path[_0x095b('0x3f')](config[_0x095b('0x40')],'server/files/templates/network.ejs'),_0x095b('0x42'));var _0x3621f3=ejs[_0x095b('0x43')](_0x478130,{'networks':_0x557e7e||[]});fs['writeFileSync'](util[_0x095b('0x49')]('/etc/asterisk/sip_xcally_%s.conf',_0x43b345[_0x095b('0x3a')]['type'][_0x095b('0x4a')]()),_0x3621f3);return respondWithRpcPromise(_0x095b('0x45'),_0x095b('0x39'),{'module':_0x095b('0x4b')});}})[_0x095b('0x8')](function(){return _0xa9c7b2;})['then'](respondWithResult(_0x15ee34,0xc9))[_0x095b('0x12')](handleError(_0x15ee34,null));};exports[_0x095b('0x1a')]=function(_0x29994f,_0x5004a1){var _0x44c4f9;return db[_0x095b('0x1f')][_0x095b('0x38')]({'where':{'id':_0x29994f[_0x095b('0x36')]['id']}})['then'](handleEntityNotFound(_0x5004a1,null))['then'](saveUpdates(_0x29994f[_0x095b('0x3a')],null))[_0x095b('0x8')](function(_0x2c66ef){if(_0x2c66ef){_0x44c4f9=_0x2c66ef;return db[_0x095b('0x1f')][_0x095b('0x34')]({'where':{'type':_0x44c4f9['type']},'raw':!![]});}return null;})[_0x095b('0x8')](function(_0x396880){if(_0x44c4f9[_0x095b('0x3b')][_0x095b('0x3c')]()==_0x095b('0x3d')){var _0x2a825f=fs[_0x095b('0x3e')](path['join'](config[_0x095b('0x40')],_0x095b('0x41')),_0x095b('0x42'));var _0x1e2a57=ejs[_0x095b('0x43')](_0x2a825f,{'networks':_0x396880||[]});fs[_0x095b('0x44')]('/etc/asterisk/stun_xcally.conf',_0x1e2a57);return respondWithRpcPromise('Reload',_0x095b('0x1a'),{'module':_0x095b('0x46')});}else if(_0x44c4f9['type'][_0x095b('0x3c')]()==_0x095b('0x4c')){var _0x4c1aba=fs[_0x095b('0x3e')](path[_0x095b('0x3f')](config[_0x095b('0x40')],'server/files/templates/turn_multiple.ejs'),_0x095b('0x42'));var _0x55a956=ejs['render'](_0x4c1aba,{'networks':_0x396880||[]});fs[_0x095b('0x44')]('/etc/asterisk/turn_xcally.conf',_0x55a956);return respondWithRpcPromise(_0x095b('0x45'),_0x095b('0x1a'),{'module':_0x095b('0x46')});}else{var _0x1edad1=fs['readFileSync'](path[_0x095b('0x3f')](config[_0x095b('0x40')],'server/files/templates/network.ejs'),_0x095b('0x42'));var _0x16fb1d=ejs[_0x095b('0x43')](_0x1edad1,{'networks':_0x396880||[]});fs['writeFileSync'](util[_0x095b('0x49')](_0x095b('0x4d'),_0x29994f['body'][_0x095b('0x3b')][_0x095b('0x4a')]()),_0x16fb1d);return respondWithRpcPromise(_0x095b('0x45'),_0x095b('0x1a'),{'module':'chan_sip.so'});}})[_0x095b('0x8')](function(_0x5d94ec){if(_0x5d94ec){return _0x44c4f9;}return null;})[_0x095b('0x8')](respondWithResult(_0x5004a1,null))['catch'](handleError(_0x5004a1,null));};exports[_0x095b('0x4e')]=function(_0x4810fc,_0x276e1c){var _0x272ff3;return db[_0x095b('0x1f')][_0x095b('0x38')]({'where':{'id':_0x4810fc['params']['id']}})['then'](function(_0xaf0beb){_0x272ff3=_0xaf0beb;return _0xaf0beb;})[_0x095b('0x8')](handleEntityNotFound(_0x276e1c,null))[_0x095b('0x8')](removeEntity(_0x276e1c,null))[_0x095b('0x8')](function(){if(_0x272ff3){return db[_0x095b('0x1f')][_0x095b('0x34')]({'where':{'type':_0x272ff3[_0x095b('0x3b')]},'raw':!![]});}})['then'](function(_0x5d6116){if(_0x272ff3[_0x095b('0x3b')]['toUpperCase']()==_0x095b('0x3d')){var _0x5edf86=fs[_0x095b('0x3e')](path[_0x095b('0x3f')](config[_0x095b('0x40')],_0x095b('0x41')),'utf8');var _0x31af04=ejs[_0x095b('0x43')](_0x5edf86,{'networks':_0x5d6116||[]});fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x31af04);return respondWithRpcPromise(_0x095b('0x45'),_0x095b('0x4e'),{'module':_0x095b('0x46')});}else if(_0x272ff3[_0x095b('0x3b')]['toUpperCase']()=='TURN'){var _0x20a932=fs['readFileSync'](path[_0x095b('0x3f')](config[_0x095b('0x40')],_0x095b('0x47')),_0x095b('0x42'));var _0x1ae6b3=ejs[_0x095b('0x43')](_0x20a932,{'networks':_0x5d6116||[]});fs['writeFileSync'](_0x095b('0x48'),_0x1ae6b3);return respondWithRpcPromise(_0x095b('0x45'),'destroy',{'module':'res_stun_monitor.so'});}else{var _0x150848=fs[_0x095b('0x3e')](path[_0x095b('0x3f')](config[_0x095b('0x40')],'server/files/templates/network.ejs'),_0x095b('0x42'));var _0x5ba7ce=ejs['render'](_0x150848,{'networks':_0x5d6116||[]});fs[_0x095b('0x44')](util[_0x095b('0x49')](_0x095b('0x4d'),_0x272ff3['type'][_0x095b('0x4a')]()),_0x5ba7ce);return respondWithRpcPromise(_0x095b('0x45'),_0x095b('0x4e'),{'module':'chan_sip.so'});}})['catch'](handleError(_0x276e1c,null));}; \ No newline at end of file +var _0xe92d=['then','sendStatus','stack','name','send','index','map','Network','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','nolimit','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','rows','params','length','options','create','body','findAll','toUpperCase','readFileSync','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','join','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','format','toLowerCase','chan_sip.so','find','STUN','update','TURN','server/files/templates/network.ejs','/etc/asterisk/sip_xcally_%s.conf','destroy','path','ejs','lodash','../../components/parsers/qs','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','json','offset','undefined','limit','count'];(function(_0x5a4ca9,_0x38478f){var _0x300e8b=function(_0x3f6dc4){while(--_0x3f6dc4){_0x5a4ca9['push'](_0x5a4ca9['shift']());}};_0x300e8b(++_0x38478f);}(_0xe92d,0x8d));var _0xde92=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xe92d[_0x126558];return _0x1f6d14;};'use strict';var util=require('util');var path=require(_0xde92('0x0'));var ejs=require(_0xde92('0x1'));var fs=require('fs');var _=require(_0xde92('0x2'));var qs=require(_0xde92('0x3'));var logger=require('../../config/logger')(_0xde92('0x4'));var config=require(_0xde92('0x5'));var db=require(_0xde92('0x6'))['db'];var jayson=require(_0xde92('0x7'));var client=jayson[_0xde92('0x8')][_0xde92('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x24249f,_0x149f1b,_0x49edd3,_0x396259){return new Promise(function(_0x381abe,_0x1a726b){var _0x4d6fd1=_0x396259||client;return _0x4d6fd1[_0xde92('0xa')](_0x24249f,_0x49edd3)['then'](function(_0x1cab13){logger[_0xde92('0xb')](_0xde92('0xc'),_0x149f1b,_0xde92('0xd'));logger['debug'](_0xde92('0xe'),_0x149f1b,'request\x20sent',JSON[_0xde92('0xf')](_0x1cab13));if(_0x1cab13[_0xde92('0x10')]){if(_0x1cab13[_0xde92('0x10')][_0xde92('0x11')]===0x1f4){logger[_0xde92('0x10')]('Network,\x20%s,\x20%s',_0x149f1b,_0x1cab13[_0xde92('0x10')][_0xde92('0x12')]);return _0x1a726b(_0x1cab13[_0xde92('0x10')][_0xde92('0x12')]);}logger['error'](_0xde92('0xc'),_0x149f1b,_0x1cab13[_0xde92('0x10')][_0xde92('0x12')]);return _0x381abe(_0x1cab13[_0xde92('0x10')][_0xde92('0x12')]);}else{logger[_0xde92('0xb')](_0xde92('0xc'),_0x149f1b,_0xde92('0xd'));_0x381abe(_0x1cab13[_0xde92('0x13')][_0xde92('0x12')]);}})[_0xde92('0x14')](function(_0x37ced3){logger[_0xde92('0x10')](_0xde92('0xc'),_0x149f1b,_0x37ced3);_0x1a726b(_0x37ced3);});});}function respondWithResult(_0x13742c,_0x2eef51){_0x2eef51=_0x2eef51||0xc8;return function(_0x5dcb05){if(_0x5dcb05){return _0x13742c[_0xde92('0x15')](_0x2eef51)[_0xde92('0x16')](_0x5dcb05);}};}function respondWithFilteredResult(_0x6ed195,_0x10391a){return function(_0xac9401){if(_0xac9401){var _0x3b19e9=typeof _0x10391a[_0xde92('0x17')]===_0xde92('0x18')&&typeof _0x10391a[_0xde92('0x19')]===_0xde92('0x18');var _0x38084c=_0xac9401[_0xde92('0x1a')];var _0xa2b5f5=_0x3b19e9?0x0:_0x10391a['offset'];var _0x2c4c78=_0x3b19e9?_0xac9401['count']:_0x10391a[_0xde92('0x17')]+_0x10391a['limit'];var _0x21f6f7;if(_0x2c4c78>=_0x38084c){_0x2c4c78=_0x38084c;_0x21f6f7=0xc8;}else{_0x21f6f7=0xce;}_0x6ed195[_0xde92('0x15')](_0x21f6f7);return _0x6ed195['set']('Content-Range',_0xa2b5f5+'-'+_0x2c4c78+'/'+_0x38084c)[_0xde92('0x16')](_0xac9401);}return null;};}function saveUpdates(_0xd95ad6){return function(_0x4163a9){if(_0x4163a9){return _0x4163a9['update'](_0xd95ad6)[_0xde92('0x1b')](function(_0x41492a){return _0x41492a;});}return null;};}function removeEntity(_0x1d5e6d){return function(_0x4551c9){if(_0x4551c9){return _0x4551c9['destroy']()[_0xde92('0x1b')](function(){_0x1d5e6d[_0xde92('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b3646){return function(_0x420bff){if(!_0x420bff){_0x2b3646[_0xde92('0x1c')](0x194);}return _0x420bff;};}function handleError(_0x4a6b6f,_0x5cf27b){_0x5cf27b=_0x5cf27b||0x1f4;return function(_0x305e13){logger[_0xde92('0x10')](_0x305e13[_0xde92('0x1d')]);if(_0x305e13['name']){delete _0x305e13[_0xde92('0x1e')];}_0x4a6b6f[_0xde92('0x15')](_0x5cf27b)[_0xde92('0x1f')](_0x305e13);};}exports[_0xde92('0x20')]=function(_0x421d06,_0x2cf706){var _0x235955={},_0x1a51c2={},_0x308aa8={'count':0x0,'rows':[]};var _0x28f1a4=_[_0xde92('0x21')](db[_0xde92('0x22')][_0xde92('0x23')],function(_0x3b88f4){return{'name':_0x3b88f4[_0xde92('0x24')],'type':_0x3b88f4[_0xde92('0x25')][_0xde92('0x26')]};});_0x1a51c2[_0xde92('0x27')]=_[_0xde92('0x21')](_0x28f1a4,'name');_0x1a51c2['query']=_[_0xde92('0x28')](_0x421d06[_0xde92('0x29')]);_0x1a51c2['filters']=_[_0xde92('0x2a')](_0x1a51c2[_0xde92('0x27')],_0x1a51c2[_0xde92('0x29')]);_0x235955[_0xde92('0x2b')]=_['intersection'](_0x1a51c2['model'],qs[_0xde92('0x2c')](_0x421d06[_0xde92('0x29')][_0xde92('0x2c')]));_0x235955['attributes']=_0x235955[_0xde92('0x2b')]['length']?_0x235955['attributes']:_0x1a51c2[_0xde92('0x27')];if(!_0x421d06[_0xde92('0x29')]['hasOwnProperty'](_0xde92('0x2d'))){_0x235955[_0xde92('0x19')]=qs[_0xde92('0x19')](_0x421d06['query'][_0xde92('0x19')]);_0x235955[_0xde92('0x17')]=qs[_0xde92('0x17')](_0x421d06['query'][_0xde92('0x17')]);}_0x235955['order']=qs['sort'](_0x421d06[_0xde92('0x29')][_0xde92('0x2e')]);_0x235955[_0xde92('0x2f')]=qs[_0xde92('0x30')](_['pick'](_0x421d06[_0xde92('0x29')],_0x1a51c2[_0xde92('0x30')]),_0x28f1a4);if(_0x421d06['query'][_0xde92('0x31')]){_0x235955['where']=_[_0xde92('0x32')](_0x235955[_0xde92('0x2f')],{'$or':_[_0xde92('0x21')](_0x28f1a4,function(_0x2f9d4a){if(_0x2f9d4a[_0xde92('0x25')]!==_0xde92('0x33')){var _0x8e90a1={};_0x8e90a1[_0x2f9d4a[_0xde92('0x1e')]]={'$like':'%'+_0x421d06[_0xde92('0x29')][_0xde92('0x31')]+'%'};return _0x8e90a1;}})});}_0x235955=_[_0xde92('0x32')]({},_0x235955,_0x421d06['options']);var _0x471f83={'where':_0x235955[_0xde92('0x2f')]};return db[_0xde92('0x22')][_0xde92('0x1a')](_0x471f83)[_0xde92('0x1b')](function(_0x5f4dcb){_0x308aa8[_0xde92('0x1a')]=_0x5f4dcb;if(_0x421d06[_0xde92('0x29')][_0xde92('0x34')]){_0x235955[_0xde92('0x35')]=[{'all':!![]}];}return db[_0xde92('0x22')]['findAll'](_0x235955);})[_0xde92('0x1b')](function(_0x47f94e){_0x308aa8[_0xde92('0x36')]=_0x47f94e;return _0x308aa8;})[_0xde92('0x1b')](respondWithFilteredResult(_0x2cf706,_0x235955))[_0xde92('0x14')](handleError(_0x2cf706,null));};exports['show']=function(_0x5d0f03,_0x1dea4d){var _0x199ace={'raw':!![],'where':{'id':_0x5d0f03[_0xde92('0x37')]['id']}},_0x351a71={};_0x351a71[_0xde92('0x27')]=_[_0xde92('0x28')](db[_0xde92('0x22')][_0xde92('0x23')]);_0x351a71[_0xde92('0x29')]=_[_0xde92('0x28')](_0x5d0f03[_0xde92('0x29')]);_0x351a71[_0xde92('0x30')]=_[_0xde92('0x2a')](_0x351a71[_0xde92('0x27')],_0x351a71[_0xde92('0x29')]);_0x199ace[_0xde92('0x2b')]=_[_0xde92('0x2a')](_0x351a71[_0xde92('0x27')],qs[_0xde92('0x2c')](_0x5d0f03[_0xde92('0x29')][_0xde92('0x2c')]));_0x199ace[_0xde92('0x2b')]=_0x199ace[_0xde92('0x2b')][_0xde92('0x38')]?_0x199ace[_0xde92('0x2b')]:_0x351a71[_0xde92('0x27')];if(_0x5d0f03[_0xde92('0x29')]['includeAll']){_0x199ace['include']=[{'all':!![]}];}_0x199ace=_[_0xde92('0x32')]({},_0x199ace,_0x5d0f03[_0xde92('0x39')]);return db[_0xde92('0x22')]['find'](_0x199ace)[_0xde92('0x1b')](handleEntityNotFound(_0x1dea4d,null))[_0xde92('0x1b')](respondWithResult(_0x1dea4d,null))['catch'](handleError(_0x1dea4d,null));};exports[_0xde92('0x3a')]=function(_0x425abd,_0x2feeff){var _0x383771;return db[_0xde92('0x22')][_0xde92('0x3a')](_0x425abd[_0xde92('0x3b')],{'raw':!![]})[_0xde92('0x1b')](function(_0x5042be){_0x383771=_0x5042be;return db['Network'][_0xde92('0x3c')]({'where':{'type':_0x425abd['body']['type']},'raw':!![]});})['then'](function(_0x356be0){if(_0x383771[_0xde92('0x25')][_0xde92('0x3d')]()=='STUN'){var _0xe22895=fs[_0xde92('0x3e')](path['join'](config[_0xde92('0x3f')],_0xde92('0x40')),_0xde92('0x41'));var _0x92987f=ejs[_0xde92('0x42')](_0xe22895,{'networks':_0x356be0||[]});fs[_0xde92('0x43')](_0xde92('0x44'),_0x92987f);return respondWithRpcPromise(_0xde92('0x45'),_0xde92('0x3a'),{'module':_0xde92('0x46')});}else if(_0x383771['type'][_0xde92('0x3d')]()=='TURN'){var _0x5d3a58=fs[_0xde92('0x3e')](path[_0xde92('0x47')](config[_0xde92('0x3f')],_0xde92('0x48')),_0xde92('0x41'));var _0x554fef=ejs[_0xde92('0x42')](_0x5d3a58,{'networks':_0x356be0||[]});fs[_0xde92('0x43')](_0xde92('0x49'),_0x554fef);return respondWithRpcPromise(_0xde92('0x45'),_0xde92('0x3a'),{'module':'res_stun_monitor.so'});}else{var _0x3fac88=fs[_0xde92('0x3e')](path[_0xde92('0x47')](config[_0xde92('0x3f')],'server/files/templates/network.ejs'),'utf8');var _0x165238=ejs[_0xde92('0x42')](_0x3fac88,{'networks':_0x356be0||[]});fs[_0xde92('0x43')](util[_0xde92('0x4a')]('/etc/asterisk/sip_xcally_%s.conf',_0x425abd[_0xde92('0x3b')]['type'][_0xde92('0x4b')]()),_0x165238);return respondWithRpcPromise('Reload',_0xde92('0x3a'),{'module':_0xde92('0x4c')});}})[_0xde92('0x1b')](function(){return _0x383771;})[_0xde92('0x1b')](respondWithResult(_0x2feeff,0xc9))[_0xde92('0x14')](handleError(_0x2feeff,null));};exports['update']=function(_0x422621,_0x268556){var _0x5d6308;return db['Network'][_0xde92('0x4d')]({'where':{'id':_0x422621[_0xde92('0x37')]['id']}})[_0xde92('0x1b')](handleEntityNotFound(_0x268556,null))['then'](saveUpdates(_0x422621[_0xde92('0x3b')],null))['then'](function(_0x3e5e29){if(_0x3e5e29){_0x5d6308=_0x3e5e29;return db['Network'][_0xde92('0x3c')]({'where':{'type':_0x5d6308[_0xde92('0x25')]},'raw':!![]});}return null;})[_0xde92('0x1b')](function(_0x224ce9){if(_0x5d6308[_0xde92('0x25')][_0xde92('0x3d')]()==_0xde92('0x4e')){var _0x132eec=fs[_0xde92('0x3e')](path[_0xde92('0x47')](config['root'],_0xde92('0x40')),'utf8');var _0x42f393=ejs[_0xde92('0x42')](_0x132eec,{'networks':_0x224ce9||[]});fs[_0xde92('0x43')](_0xde92('0x44'),_0x42f393);return respondWithRpcPromise(_0xde92('0x45'),_0xde92('0x4f'),{'module':_0xde92('0x46')});}else if(_0x5d6308['type'][_0xde92('0x3d')]()==_0xde92('0x50')){var _0x37820b=fs[_0xde92('0x3e')](path[_0xde92('0x47')](config[_0xde92('0x3f')],_0xde92('0x48')),'utf8');var _0x88d668=ejs[_0xde92('0x42')](_0x37820b,{'networks':_0x224ce9||[]});fs[_0xde92('0x43')](_0xde92('0x49'),_0x88d668);return respondWithRpcPromise(_0xde92('0x45'),_0xde92('0x4f'),{'module':_0xde92('0x46')});}else{var _0x1078e5=fs[_0xde92('0x3e')](path['join'](config[_0xde92('0x3f')],_0xde92('0x51')),_0xde92('0x41'));var _0x566d99=ejs[_0xde92('0x42')](_0x1078e5,{'networks':_0x224ce9||[]});fs[_0xde92('0x43')](util[_0xde92('0x4a')](_0xde92('0x52'),_0x422621['body']['type']['toLowerCase']()),_0x566d99);return respondWithRpcPromise(_0xde92('0x45'),_0xde92('0x4f'),{'module':_0xde92('0x4c')});}})[_0xde92('0x1b')](function(_0x46988d){if(_0x46988d){return _0x5d6308;}return null;})['then'](respondWithResult(_0x268556,null))[_0xde92('0x14')](handleError(_0x268556,null));};exports[_0xde92('0x53')]=function(_0x316060,_0x5a2bbe){var _0x2ba36d;return db[_0xde92('0x22')]['find']({'where':{'id':_0x316060['params']['id']}})[_0xde92('0x1b')](function(_0x1cc661){_0x2ba36d=_0x1cc661;return _0x1cc661;})[_0xde92('0x1b')](handleEntityNotFound(_0x5a2bbe,null))['then'](removeEntity(_0x5a2bbe,null))[_0xde92('0x1b')](function(){if(_0x2ba36d){return db[_0xde92('0x22')][_0xde92('0x3c')]({'where':{'type':_0x2ba36d[_0xde92('0x25')]},'raw':!![]});}})[_0xde92('0x1b')](function(_0x281f4e){if(_0x2ba36d[_0xde92('0x25')][_0xde92('0x3d')]()==_0xde92('0x4e')){var _0x529682=fs[_0xde92('0x3e')](path[_0xde92('0x47')](config['root'],_0xde92('0x40')),_0xde92('0x41'));var _0x3d3272=ejs[_0xde92('0x42')](_0x529682,{'networks':_0x281f4e||[]});fs['writeFileSync'](_0xde92('0x44'),_0x3d3272);return respondWithRpcPromise(_0xde92('0x45'),_0xde92('0x53'),{'module':_0xde92('0x46')});}else if(_0x2ba36d['type'][_0xde92('0x3d')]()==_0xde92('0x50')){var _0x39637d=fs[_0xde92('0x3e')](path[_0xde92('0x47')](config[_0xde92('0x3f')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0xb23945=ejs[_0xde92('0x42')](_0x39637d,{'networks':_0x281f4e||[]});fs[_0xde92('0x43')](_0xde92('0x49'),_0xb23945);return respondWithRpcPromise(_0xde92('0x45'),_0xde92('0x53'),{'module':'res_stun_monitor.so'});}else{var _0x56427b=fs[_0xde92('0x3e')](path['join'](config[_0xde92('0x3f')],_0xde92('0x51')),_0xde92('0x41'));var _0x3b4158=ejs[_0xde92('0x42')](_0x56427b,{'networks':_0x281f4e||[]});fs[_0xde92('0x43')](util[_0xde92('0x4a')](_0xde92('0x52'),_0x2ba36d['type'][_0xde92('0x4b')]()),_0x3b4158);return respondWithRpcPromise('Reload',_0xde92('0x53'),{'module':'chan_sip.so'});}})['catch'](handleError(_0x5a2bbe,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 9bae747..49c0b98 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 _0xc6d8=['../../config/logger','moment','request-promise','../../config/environment','./network.attributes','exports','define','Network','lodash'];(function(_0x1a020c,_0x3246f3){var _0x17c650=function(_0xa6cbc8){while(--_0xa6cbc8){_0x1a020c['push'](_0x1a020c['shift']());}};_0x17c650(++_0x3246f3);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x172660,_0x260d9b){_0x172660=_0x172660-0x0;var _0x83204f=_0xc6d8[_0x172660];return _0x83204f;};'use strict';var _=require(_0x8c6d('0x0'));var util=require('util');var logger=require(_0x8c6d('0x1'))('api');var moment=require(_0x8c6d('0x2'));var BPromise=require('bluebird');var rp=require(_0x8c6d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x8c6d('0x4'));var attributes=require(_0x8c6d('0x5'));module[_0x8c6d('0x6')]=function(_0x4f5e8f,_0x3c265c){return _0x4f5e8f[_0x8c6d('0x7')](_0x8c6d('0x8'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x99e9=['util','../../config/logger','api','moment','request-promise','path','rimraf','./network.attributes','define','Network'];(function(_0x37362e,_0x3c1b38){var _0x485ee5=function(_0x5edf03){while(--_0x5edf03){_0x37362e['push'](_0x37362e['shift']());}};_0x485ee5(++_0x3c1b38);}(_0x99e9,0xb4));var _0x999e=function(_0x4695e2,_0x3d5f15){_0x4695e2=_0x4695e2-0x0;var _0x160563=_0x99e9[_0x4695e2];return _0x160563;};'use strict';var _=require('lodash');var util=require(_0x999e('0x0'));var logger=require(_0x999e('0x1'))(_0x999e('0x2'));var moment=require(_0x999e('0x3'));var BPromise=require('bluebird');var rp=require(_0x999e('0x4'));var fs=require('fs');var path=require(_0x999e('0x5'));var rimraf=require(_0x999e('0x6'));var config=require('../../config/environment');var attributes=require(_0x999e('0x7'));module['exports']=function(_0x25421f,_0x1bda0a){return _0x25421f[_0x999e('0x8')](_0x999e('0x9'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 364e0ae..adeb97a 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 _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x1fe37d,_0x2fe53b){_0x1fe37d=_0x1fe37d-0x0;var _0x1baa4b=_0x7a54[_0x1fe37d];return _0x1baa4b;};'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')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x9957=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2e2630,_0x40cd39){var _0x1e6e23=function(_0x172984){while(--_0x172984){_0x2e2630['push'](_0x2e2630['shift']());}};_0x1e6e23(++_0x40cd39);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'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']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 761d1c4..e1f2fd1 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 _0xcd93=['isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','/:id/interactions','getInteractions','/:id/users','post','/:id/dispositions','addDisposition','addAnswer','/:id/notify','notify','send','put','update','destroy','delete','removeDispositions','removeAnswers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x4f0ac0,_0x25e418){var _0x2971bb=function(_0x50a31e){while(--_0x50a31e){_0x4f0ac0['push'](_0x4f0ac0['shift']());}};_0x2971bb(++_0x25e418);}(_0xcd93,0x168));var _0x3cd9=function(_0x124714,_0x2a9bed){_0x124714=_0x124714-0x0;var _0x551bd7=_0xcd93[_0x124714];return _0x551bd7;};'use strict';var multer=require('multer');var util=require(_0x3cd9('0x0'));var path=require(_0x3cd9('0x1'));var timeout=require(_0x3cd9('0x2'));var express=require(_0x3cd9('0x3'));var router=express[_0x3cd9('0x4')]();var fs_extra=require(_0x3cd9('0x5'));var auth=require(_0x3cd9('0x6'));var interaction=require(_0x3cd9('0x7'));var config=require(_0x3cd9('0x8'));var controller=require('./openchannelAccount.controller');router[_0x3cd9('0x9')]('/',auth[_0x3cd9('0xa')](),controller[_0x3cd9('0xb')]);router[_0x3cd9('0x9')](_0x3cd9('0xc'),auth[_0x3cd9('0xa')](),controller[_0x3cd9('0xd')]);router[_0x3cd9('0x9')](_0x3cd9('0xe'),auth[_0x3cd9('0xa')](),controller[_0x3cd9('0xf')]);router[_0x3cd9('0x9')]('/:id/dispositions',auth[_0x3cd9('0xa')](),controller[_0x3cd9('0x10')]);router[_0x3cd9('0x9')](_0x3cd9('0x11'),auth[_0x3cd9('0xa')](),controller[_0x3cd9('0x12')]);router[_0x3cd9('0x9')](_0x3cd9('0x13'),auth[_0x3cd9('0xa')](),controller['getApplications']);router[_0x3cd9('0x9')](_0x3cd9('0x14'),auth[_0x3cd9('0xa')](),controller[_0x3cd9('0x15')]);router[_0x3cd9('0x9')](_0x3cd9('0x16'),auth[_0x3cd9('0xa')](),controller['getAgents']);router[_0x3cd9('0x17')]('/',auth[_0x3cd9('0xa')](),controller['create']);router[_0x3cd9('0x17')](_0x3cd9('0x18'),auth[_0x3cd9('0xa')](),controller[_0x3cd9('0x19')]);router[_0x3cd9('0x17')]('/:id/canned_answers',auth[_0x3cd9('0xa')](),controller[_0x3cd9('0x1a')]);router[_0x3cd9('0x17')](_0x3cd9('0x1b'),controller[_0x3cd9('0x1c')]);router['post'](_0x3cd9('0x13'),auth[_0x3cd9('0xa')](),controller['addApplications']);router[_0x3cd9('0x17')](_0x3cd9('0x16'),auth['isAuthenticated'](),controller['addAgents']);router[_0x3cd9('0x17')]('/:id/send',auth[_0x3cd9('0xa')](),controller[_0x3cd9('0x1d')]);router[_0x3cd9('0x1e')](_0x3cd9('0xe'),auth['isAuthenticated'](),controller[_0x3cd9('0x1f')]);router['delete']('/:id',auth[_0x3cd9('0xa')](),controller[_0x3cd9('0x20')]);router[_0x3cd9('0x21')]('/:id/dispositions',auth[_0x3cd9('0xa')](),controller[_0x3cd9('0x22')]);router[_0x3cd9('0x21')](_0x3cd9('0x11'),auth[_0x3cd9('0xa')](),controller[_0x3cd9('0x23')]);router[_0x3cd9('0x21')](_0x3cd9('0x16'),auth[_0x3cd9('0xa')](),controller['removeAgents']);module[_0x3cd9('0x24')]=router; \ No newline at end of file +var _0xe928=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','getAgents','create','post','/:id/dispositions','addDisposition','addAnswer','/:id/notify','/:id/applications','addApplications','/:id/users','addAgents','put','destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','connect-timeout','express'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0xe928,0x133));var _0x8e92=function(_0xb95a73,_0x5c7951){_0xb95a73=_0xb95a73-0x0;var _0x51b118=_0xe928[_0xb95a73];return _0x51b118;};'use strict';var multer=require(_0x8e92('0x0'));var util=require(_0x8e92('0x1'));var path=require(_0x8e92('0x2'));var timeout=require(_0x8e92('0x3'));var express=require(_0x8e92('0x4'));var router=express[_0x8e92('0x5')]();var fs_extra=require(_0x8e92('0x6'));var auth=require(_0x8e92('0x7'));var interaction=require(_0x8e92('0x8'));var config=require(_0x8e92('0x9'));var controller=require(_0x8e92('0xa'));router[_0x8e92('0xb')]('/',auth[_0x8e92('0xc')](),controller[_0x8e92('0xd')]);router['get'](_0x8e92('0xe'),auth[_0x8e92('0xc')](),controller[_0x8e92('0xf')]);router['get'](_0x8e92('0x10'),auth[_0x8e92('0xc')](),controller[_0x8e92('0x11')]);router[_0x8e92('0xb')]('/:id/dispositions',auth[_0x8e92('0xc')](),controller['getDispositions']);router[_0x8e92('0xb')](_0x8e92('0x12'),auth[_0x8e92('0xc')](),controller[_0x8e92('0x13')]);router[_0x8e92('0xb')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0x8e92('0xb')](_0x8e92('0x14'),auth[_0x8e92('0xc')](),controller[_0x8e92('0x15')]);router[_0x8e92('0xb')]('/:id/users',auth[_0x8e92('0xc')](),controller[_0x8e92('0x16')]);router['post']('/',auth['isAuthenticated'](),controller[_0x8e92('0x17')]);router[_0x8e92('0x18')](_0x8e92('0x19'),auth['isAuthenticated'](),controller[_0x8e92('0x1a')]);router[_0x8e92('0x18')](_0x8e92('0x12'),auth[_0x8e92('0xc')](),controller[_0x8e92('0x1b')]);router[_0x8e92('0x18')](_0x8e92('0x1c'),controller['notify']);router[_0x8e92('0x18')](_0x8e92('0x1d'),auth['isAuthenticated'](),controller[_0x8e92('0x1e')]);router[_0x8e92('0x18')](_0x8e92('0x1f'),auth['isAuthenticated'](),controller[_0x8e92('0x20')]);router[_0x8e92('0x18')]('/:id/send',auth['isAuthenticated'](),controller['send']);router[_0x8e92('0x21')](_0x8e92('0x10'),auth[_0x8e92('0xc')](),controller['update']);router['delete'](_0x8e92('0x10'),auth[_0x8e92('0xc')](),controller[_0x8e92('0x22')]);router[_0x8e92('0x23')](_0x8e92('0x19'),auth[_0x8e92('0xc')](),controller[_0x8e92('0x24')]);router['delete'](_0x8e92('0x12'),auth[_0x8e92('0xc')](),controller[_0x8e92('0x25')]);router[_0x8e92('0x23')](_0x8e92('0x1f'),auth[_0x8e92('0xc')](),controller[_0x8e92('0x26')]);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 aaade9d..137130d 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 _0x7299=['mandatoryDisposition','randomstring','exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId'];(function(_0x51b538,_0x3ec1a6){var _0x3b92b7=function(_0x44dadb){while(--_0x44dadb){_0x51b538['push'](_0x51b538['shift']());}};_0x3b92b7(++_0x3ec1a6);}(_0x7299,0x139));var _0x9729=function(_0x433df9,_0x5808c7){_0x433df9=_0x433df9-0x0;var _0x2574cf=_0x7299[_0x433df9];return _0x2574cf;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x9729('0x0'));module[_0x9729('0x1')]={'name':{'type':Sequelize[_0x9729('0x2')],'unique':_0x9729('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x9729('0x2')]},'token':{'type':Sequelize[_0x9729('0x2')],'defaultValue':function(){return rs[_0x9729('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x9729('0x5')],'defaultValue':function(){return _0x9729('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9729('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9729('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9729('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9729('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9729('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9729('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x9729('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x9729('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x34aab9){if(!_0x34aab9)this[_0x9729('0xa')](_0x9729('0xb'),null);this[_0x9729('0xa')](_0x9729('0xc'),_0x34aab9);}}}; \ No newline at end of file +var _0x1a38=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','name','generate','TEXT'];(function(_0x1099d4,_0x38ca0a){var _0x3d51f3=function(_0x16673b){while(--_0x16673b){_0x1099d4['push'](_0x1099d4['shift']());}};_0x3d51f3(++_0x38ca0a);}(_0x1a38,0x14b));var _0x81a3=function(_0x44d869,_0x49425f){_0x44d869=_0x44d869-0x0;var _0x1ed521=_0x1a38[_0x44d869];return _0x1ed521;};'use strict';var Sequelize=require(_0x81a3('0x0'));var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0x81a3('0x1')],'unique':_0x81a3('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x81a3('0x1')]},'token':{'type':Sequelize[_0x81a3('0x1')],'defaultValue':function(){return rs[_0x81a3('0x3')]();}},'replyUri':{'type':Sequelize[_0x81a3('0x1')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x81a3('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x81a3('0x4')],'defaultValue':function(){return _0x81a3('0x5');}},'notificationSound':{'type':Sequelize[_0x81a3('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x81a3('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x81a3('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x81a3('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x81a3('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x81a3('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x81a3('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x81a3('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x5dfc5a){if(!_0x5dfc5a)this[_0x81a3('0x9')](_0x81a3('0xa'),null);this[_0x81a3('0x9')](_0x81a3('0xb'),_0x5dfc5a);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 608a568..d54c4e4 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 _0x5826=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','Pause','describe','Disposition','getDispositions','findOne','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','order','removeAnswers','notify','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','CompanyId','ListId','isNil','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','List','Contacts','updatedAt','OpenchannelApplication','Applications','account','list','applications','orderBy','priority','asc','defaults','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','push','close','*,*,*,*','OpenchannelMessage','contact','User','UserId','unshift','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','getApplications','getInteractions','Owner','fullname','internal','Tag','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','DESC','out','Messages','dataValues','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','request','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','get','OpenchannelAccounts','destroy','name','send','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','show','params','include','options','find','create','body'];(function(_0x149c7c,_0x6f4ba2){var _0x2814cc=function(_0x5e2333){while(--_0x5e2333){_0x149c7c['push'](_0x149c7c['shift']());}};_0x2814cc(++_0x6f4ba2);}(_0x5826,0x1ea));var _0x6582=function(_0x4bdfbf,_0x32c35b){_0x4bdfbf=_0x4bdfbf-0x0;var _0x4ff968=_0x5826[_0x4bdfbf];return _0x4ff968;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6582('0x0'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6582('0x1'));var BPromise=require(_0x6582('0x2'));var Mustache=require(_0x6582('0x3'));var util=require(_0x6582('0x4'));var path=require(_0x6582('0x5'));var sox=require(_0x6582('0x6'));var csv=require(_0x6582('0x7'));var ejs=require(_0x6582('0x8'));var fs=require('fs');var fs_extra=require(_0x6582('0x9'));var _=require(_0x6582('0xa'));var squel=require(_0x6582('0xb'));var crypto=require(_0x6582('0xc'));var jsforce=require(_0x6582('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6582('0x7'));var querystring=require(_0x6582('0xe'));var Papa=require(_0x6582('0xf'));var Redis=require(_0x6582('0x10'));var authService=require(_0x6582('0x11'));var qs=require(_0x6582('0x12'));var as=require(_0x6582('0x13'));var hardwareService=require(_0x6582('0x14'));var logger=require(_0x6582('0x15'))(_0x6582('0x16'));var utils=require(_0x6582('0x17'));var config=require(_0x6582('0x18'));var licenseUtil=require(_0x6582('0x19'));var db=require(_0x6582('0x1a'))['db'];config[_0x6582('0x1b')]=_['defaults'](config['redis'],{'host':_0x6582('0x1c'),'port':0x18eb});var socket=require(_0x6582('0x1d'))(new Redis(config[_0x6582('0x1b')]));require(_0x6582('0x1e'))['register'](socket);var jayson=require(_0x6582('0x1f'));var client=jayson[_0x6582('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x6582('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d030b,_0x2507db,_0x463128,_0x4c4514){return new BPromise(function(_0x27349e,_0x287bc3){var _0xc3983=_0x4c4514||client;return _0xc3983[_0x6582('0x21')](_0x4d030b,_0x463128)[_0x6582('0x22')](function(_0x48c3d6){logger['info'](_0x6582('0x23'),_0x2507db,_0x6582('0x24'));logger['debug'](_0x6582('0x25'),_0x2507db,_0x6582('0x24'),JSON[_0x6582('0x26')](_0x48c3d6));if(_0x48c3d6[_0x6582('0x27')]){if(_0x48c3d6[_0x6582('0x27')][_0x6582('0x28')]===0x1f4){logger[_0x6582('0x27')](_0x6582('0x23'),_0x2507db,_0x48c3d6['error'][_0x6582('0x29')]);return _0x287bc3(_0x48c3d6[_0x6582('0x27')][_0x6582('0x29')]);}logger[_0x6582('0x27')]('OpenchannelAccount,\x20%s,\x20%s',_0x2507db,_0x48c3d6[_0x6582('0x27')][_0x6582('0x29')]);return _0x27349e(_0x48c3d6[_0x6582('0x27')][_0x6582('0x29')]);}else{logger[_0x6582('0x2a')](_0x6582('0x23'),_0x2507db,'request\x20sent');_0x27349e(_0x48c3d6[_0x6582('0x2b')]['message']);}})[_0x6582('0x2c')](function(_0x335522){logger[_0x6582('0x27')](_0x6582('0x23'),_0x2507db,_0x335522);_0x287bc3(_0x335522);});});}function respondWithStatusCode(_0x18c8fe,_0x10bf92){_0x10bf92=_0x10bf92||0xcc;return function(_0x4c543){if(_0x4c543){return _0x18c8fe[_0x6582('0x2d')](_0x10bf92);}return _0x18c8fe[_0x6582('0x2e')](_0x10bf92)[_0x6582('0x2f')]();};}function respondWithResult(_0x545316,_0x511381){_0x511381=_0x511381||0xc8;return function(_0x15b2b0){if(_0x15b2b0){return _0x545316[_0x6582('0x2e')](_0x511381)['json'](_0x15b2b0);}};}function respondWithFilteredResult(_0x2add50,_0x4fcab1){return function(_0x4f1f1c){if(_0x4f1f1c){var _0x37e996=typeof _0x4fcab1[_0x6582('0x30')]===_0x6582('0x31')&&typeof _0x4fcab1[_0x6582('0x32')]===_0x6582('0x31');var _0xa899b2=_0x4f1f1c['count'];var _0x4dd143=_0x37e996?0x0:_0x4fcab1[_0x6582('0x30')];var _0x54170e=_0x37e996?_0x4f1f1c[_0x6582('0x33')]:_0x4fcab1['offset']+_0x4fcab1[_0x6582('0x32')];var _0x18e84e;if(_0x54170e>=_0xa899b2){_0x54170e=_0xa899b2;_0x18e84e=0xc8;}else{_0x18e84e=0xce;}_0x2add50['status'](_0x18e84e);return _0x2add50[_0x6582('0x34')](_0x6582('0x35'),_0x4dd143+'-'+_0x54170e+'/'+_0xa899b2)[_0x6582('0x36')](_0x4f1f1c);}return null;};}function patchUpdates(_0x1fa3a8){return function(_0x5ce119){try{jsonpatch[_0x6582('0x37')](_0x5ce119,_0x1fa3a8,!![]);}catch(_0x1dbf65){return BPromise['reject'](_0x1dbf65);}return _0x5ce119[_0x6582('0x38')]();};}function saveUpdates(_0x2ed3a3,_0x37aaca){return function(_0x435cf8){if(_0x435cf8){return _0x435cf8['update'](_0x2ed3a3)['then'](function(_0x51d291){return _0x51d291;});}return null;};}function removeEntity(_0x1363bf,_0x559c73){return function(_0x12d566){if(_0x12d566){return _0x12d566['destroy']()[_0x6582('0x22')](function(){var _0xfee013=_0x12d566[_0x6582('0x39')]({'plain':!![]});var _0xc28341=_0x6582('0x3a');return db['UserProfileResource'][_0x6582('0x3b')]({'where':{'type':_0xc28341,'resourceId':_0xfee013['id']}})[_0x6582('0x22')](function(){return _0x12d566;});})[_0x6582('0x22')](function(){_0x1363bf[_0x6582('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41334b,_0x55009c){return function(_0xec6e3f){if(!_0xec6e3f){_0x41334b['sendStatus'](0x194);}return _0xec6e3f;};}function handleError(_0x450760,_0x4f7671){_0x4f7671=_0x4f7671||0x1f4;return function(_0x3d5b00){logger[_0x6582('0x27')](_0x3d5b00['stack']);if(_0x3d5b00[_0x6582('0x3c')]){delete _0x3d5b00['name'];}_0x450760[_0x6582('0x2e')](_0x4f7671)[_0x6582('0x3d')](_0x3d5b00);};}exports['index']=function(_0x53931b,_0x13cb42){var _0x6faeb1={'include':[{'model':db['Pause'],'as':_0x6582('0x3e')}]},_0x26ec8a={},_0x1216ef={'count':0x0,'rows':[]};var _0x1ab40f=_['map'](db[_0x6582('0x3f')][_0x6582('0x40')],function(_0x414ab1){return{'name':_0x414ab1[_0x6582('0x41')],'type':_0x414ab1[_0x6582('0x42')][_0x6582('0x43')]};});_0x26ec8a[_0x6582('0x44')]=_[_0x6582('0x45')](_0x1ab40f,_0x6582('0x3c'));_0x26ec8a[_0x6582('0x46')]=_[_0x6582('0x47')](_0x53931b['query']);_0x26ec8a[_0x6582('0x48')]=_[_0x6582('0x49')](_0x26ec8a['model'],_0x26ec8a[_0x6582('0x46')]);_0x6faeb1[_0x6582('0x4a')]=_[_0x6582('0x49')](_0x26ec8a['model'],qs[_0x6582('0x4b')](_0x53931b[_0x6582('0x46')][_0x6582('0x4b')]));_0x6faeb1[_0x6582('0x4a')]=_0x6faeb1[_0x6582('0x4a')][_0x6582('0x4c')]?_0x6faeb1[_0x6582('0x4a')]:_0x26ec8a[_0x6582('0x44')];if(!_0x53931b['query'][_0x6582('0x4d')](_0x6582('0x4e'))){_0x6faeb1[_0x6582('0x32')]=qs[_0x6582('0x32')](_0x53931b['query']['limit']);_0x6faeb1['offset']=qs[_0x6582('0x30')](_0x53931b['query'][_0x6582('0x30')]);}_0x6faeb1['order']=qs[_0x6582('0x4f')](_0x53931b[_0x6582('0x46')][_0x6582('0x4f')]);_0x6faeb1[_0x6582('0x50')]=qs[_0x6582('0x48')](_[_0x6582('0x51')](_0x53931b[_0x6582('0x46')],_0x26ec8a[_0x6582('0x48')]),_0x1ab40f);if(_0x53931b[_0x6582('0x46')]['filter']){_0x6faeb1[_0x6582('0x50')]=_[_0x6582('0x52')](_0x6faeb1['where'],{'$or':_['map'](_0x1ab40f,function(_0x1dd719){if(_0x1dd719[_0x6582('0x42')]!==_0x6582('0x53')){var _0x34c238={};_0x34c238[_0x1dd719[_0x6582('0x3c')]]={'$like':'%'+_0x53931b[_0x6582('0x46')][_0x6582('0x54')]+'%'};return _0x34c238;}})});}_0x6faeb1=_[_0x6582('0x52')]({},_0x6faeb1,_0x53931b['options']);var _0xd0586={'where':_0x6faeb1[_0x6582('0x50')]};return db[_0x6582('0x3f')]['count'](_0xd0586)['then'](function(_0x197d44){_0x1216ef[_0x6582('0x33')]=_0x197d44;if(_0x53931b[_0x6582('0x46')][_0x6582('0x55')]){_0x6faeb1['include']=[{'all':!![]}];}return db[_0x6582('0x3f')][_0x6582('0x56')](_0x6faeb1);})[_0x6582('0x22')](function(_0x5244da){_0x1216ef[_0x6582('0x57')]=_0x5244da;return _0x1216ef;})[_0x6582('0x22')](respondWithFilteredResult(_0x13cb42,_0x6faeb1))['catch'](handleError(_0x13cb42,null));};exports[_0x6582('0x58')]=function(_0x189639,_0x22d913){var _0xdc6d8e={'raw':![],'where':{'id':_0x189639[_0x6582('0x59')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x4d3804={};_0x4d3804[_0x6582('0x44')]=_[_0x6582('0x47')](db[_0x6582('0x3f')][_0x6582('0x40')]);_0x4d3804['query']=_[_0x6582('0x47')](_0x189639[_0x6582('0x46')]);_0x4d3804[_0x6582('0x48')]=_[_0x6582('0x49')](_0x4d3804[_0x6582('0x44')],_0x4d3804[_0x6582('0x46')]);_0xdc6d8e[_0x6582('0x4a')]=_['intersection'](_0x4d3804[_0x6582('0x44')],qs[_0x6582('0x4b')](_0x189639[_0x6582('0x46')][_0x6582('0x4b')]));_0xdc6d8e[_0x6582('0x4a')]=_0xdc6d8e[_0x6582('0x4a')][_0x6582('0x4c')]?_0xdc6d8e[_0x6582('0x4a')]:_0x4d3804['model'];if(_0x189639[_0x6582('0x46')][_0x6582('0x55')]){_0xdc6d8e[_0x6582('0x5a')]=[{'all':!![]}];}_0xdc6d8e=_[_0x6582('0x52')]({},_0xdc6d8e,_0x189639[_0x6582('0x5b')]);return db['OpenchannelAccount'][_0x6582('0x5c')](_0xdc6d8e)[_0x6582('0x22')](handleEntityNotFound(_0x22d913,null))[_0x6582('0x22')](respondWithResult(_0x22d913,null))[_0x6582('0x2c')](handleError(_0x22d913,null));};exports[_0x6582('0x5d')]=function(_0x43d8ce,_0x402121){return db[_0x6582('0x3f')]['create'](_0x43d8ce[_0x6582('0x5e')],{})[_0x6582('0x22')](function(_0xd0be89){var _0x451e8f=_0x43d8ce[_0x6582('0x5f')][_0x6582('0x39')]({'plain':!![]});if(!_0x451e8f)throw new Error(_0x6582('0x60'));if(_0x451e8f[_0x6582('0x61')]===_0x6582('0x5f')){var _0x326a2a=_0xd0be89[_0x6582('0x39')]({'plain':!![]});var _0x25370c=_0x6582('0x3a');return db['UserProfileSection'][_0x6582('0x5c')]({'where':{'name':_0x25370c,'userProfileId':_0x451e8f['userProfileId']},'raw':!![]})[_0x6582('0x22')](function(_0x4c6e55){if(_0x4c6e55&&_0x4c6e55[_0x6582('0x62')]===0x0){return db[_0x6582('0x63')][_0x6582('0x5d')]({'name':_0x326a2a[_0x6582('0x3c')],'resourceId':_0x326a2a['id'],'type':_0x4c6e55[_0x6582('0x3c')],'sectionId':_0x4c6e55['id']},{})[_0x6582('0x22')](function(){return _0xd0be89;});}else{return _0xd0be89;}})[_0x6582('0x2c')](function(_0x45c1ea){logger['error'](_0x6582('0x64'),_0x45c1ea);throw _0x45c1ea;});}return _0xd0be89;})[_0x6582('0x22')](respondWithResult(_0x402121,0xc9))[_0x6582('0x2c')](handleError(_0x402121,null));};exports[_0x6582('0x65')]=function(_0x58c796,_0x556989){if(_0x58c796['body']['id']){delete _0x58c796[_0x6582('0x5e')]['id'];}return db[_0x6582('0x3f')][_0x6582('0x5c')]({'where':{'id':_0x58c796[_0x6582('0x59')]['id']},'include':[{'model':db[_0x6582('0x66')],'as':_0x6582('0x3e')}]})[_0x6582('0x22')](handleEntityNotFound(_0x556989,null))[_0x6582('0x22')](saveUpdates(_0x58c796[_0x6582('0x5e')],null))[_0x6582('0x22')](respondWithResult(_0x556989,null))[_0x6582('0x2c')](handleError(_0x556989,null));};exports[_0x6582('0x3b')]=function(_0x2cb018,_0x4325a3){return db[_0x6582('0x3f')][_0x6582('0x5c')]({'where':{'id':_0x2cb018[_0x6582('0x59')]['id']}})[_0x6582('0x22')](handleEntityNotFound(_0x4325a3,null))[_0x6582('0x22')](removeEntity(_0x4325a3,null))['catch'](handleError(_0x4325a3,null));};exports[_0x6582('0x67')]=function(_0x1f624f,_0x46b526){return db[_0x6582('0x3f')]['describe']()[_0x6582('0x22')](respondWithResult(_0x46b526,null))[_0x6582('0x2c')](handleError(_0x46b526,null));};exports['addDisposition']=function(_0x4ecf73,_0x3af1ce,_0x1123db){if(_0x4ecf73['body']['id']){delete _0x4ecf73[_0x6582('0x5e')]['id'];}return db['OpenchannelAccount'][_0x6582('0x5c')]({'where':{'id':_0x4ecf73[_0x6582('0x59')]['id']}})['then'](handleEntityNotFound(_0x3af1ce,null))[_0x6582('0x22')](function(_0x3814b2){if(_0x3814b2){_0x4ecf73[_0x6582('0x5e')]['OpenchannelAccountId']=_0x3814b2['id'];return db[_0x6582('0x68')][_0x6582('0x5d')](_0x4ecf73[_0x6582('0x5e')]);}})[_0x6582('0x22')](respondWithResult(_0x3af1ce,null))[_0x6582('0x2c')](handleError(_0x3af1ce,null));};exports[_0x6582('0x69')]=function(_0x1a9d24,_0x35ad1f,_0x4742ea){var _0x553234={'raw':![],'where':{}};var _0x20467e={};var _0x4b5e27={'count':0x0,'rows':[]};return db[_0x6582('0x3f')][_0x6582('0x6a')]({'where':{'id':_0x1a9d24[_0x6582('0x59')]['id']}})['then'](handleEntityNotFound(_0x35ad1f,null))[_0x6582('0x22')](function(_0x296fdc){if(_0x296fdc){_0x20467e[_0x6582('0x44')]=_[_0x6582('0x47')](db[_0x6582('0x68')][_0x6582('0x40')]);_0x20467e[_0x6582('0x46')]=_['keys'](_0x1a9d24['query']);_0x20467e['filters']=_[_0x6582('0x49')](_0x20467e['model'],_0x20467e[_0x6582('0x46')]);_0x553234['attributes']=_['intersection'](_0x20467e[_0x6582('0x44')],qs[_0x6582('0x4b')](_0x1a9d24[_0x6582('0x46')][_0x6582('0x4b')]));_0x553234[_0x6582('0x4a')]=_0x553234[_0x6582('0x4a')][_0x6582('0x4c')]?_0x553234[_0x6582('0x4a')]:_0x20467e[_0x6582('0x44')];if(!_0x1a9d24[_0x6582('0x46')]['hasOwnProperty']('nolimit')){_0x553234[_0x6582('0x32')]=qs[_0x6582('0x32')](_0x1a9d24['query']['limit']);_0x553234['offset']=qs['offset'](_0x1a9d24[_0x6582('0x46')][_0x6582('0x30')]);}_0x553234['order']=qs[_0x6582('0x4f')](_0x1a9d24[_0x6582('0x46')][_0x6582('0x4f')]);_0x553234['where']=qs['filters'](_[_0x6582('0x51')](_0x1a9d24[_0x6582('0x46')],_0x20467e[_0x6582('0x48')]));_0x553234[_0x6582('0x50')][_0x6582('0x6b')]=_0x296fdc['id'];if(_0x1a9d24[_0x6582('0x46')][_0x6582('0x54')]){_0x553234[_0x6582('0x50')]=_[_0x6582('0x52')](_0x553234[_0x6582('0x50')],{'$or':_[_0x6582('0x45')](_0x553234[_0x6582('0x4a')],function(_0x4a1c52){var _0x37ddb7={};_0x37ddb7[_0x4a1c52]={'$like':'%'+_0x1a9d24[_0x6582('0x46')]['filter']+'%'};return _0x37ddb7;})});}_0x553234=_[_0x6582('0x52')]({},_0x553234,_0x1a9d24[_0x6582('0x5b')]);return db['Disposition'][_0x6582('0x33')]({'where':_0x553234['where']})[_0x6582('0x22')](function(_0xed20b2){_0x4b5e27[_0x6582('0x33')]=_0xed20b2;if(_0x1a9d24[_0x6582('0x46')][_0x6582('0x55')]){_0x553234[_0x6582('0x5a')]=[{'all':!![]}];}return db[_0x6582('0x68')][_0x6582('0x56')](_0x553234);})[_0x6582('0x22')](function(_0x1e484d){_0x4b5e27[_0x6582('0x57')]=_0x1e484d;return _0x4b5e27;});}})[_0x6582('0x22')](respondWithFilteredResult(_0x35ad1f,_0x553234))['catch'](handleError(_0x35ad1f,null));};exports[_0x6582('0x6c')]=function(_0x4eb1c8,_0x5661ea,_0x155e7c){return db['OpenchannelAccount'][_0x6582('0x5c')]({'where':{'id':_0x4eb1c8['params']['id']}})[_0x6582('0x22')](handleEntityNotFound(_0x5661ea,null))['then'](function(_0x509b05){if(_0x509b05){return _0x509b05[_0x6582('0x6c')](_0x4eb1c8[_0x6582('0x46')][_0x6582('0x6d')]);}})[_0x6582('0x22')](respondWithStatusCode(_0x5661ea,null))[_0x6582('0x2c')](handleError(_0x5661ea,null));};exports[_0x6582('0x6e')]=function(_0x18797e,_0x35e523,_0x550008){if(_0x18797e[_0x6582('0x5e')]['id']){delete _0x18797e[_0x6582('0x5e')]['id'];}return db[_0x6582('0x3f')][_0x6582('0x5c')]({'where':{'id':_0x18797e[_0x6582('0x59')]['id']}})[_0x6582('0x22')](handleEntityNotFound(_0x35e523,null))[_0x6582('0x22')](function(_0xc47ab6){if(_0xc47ab6){_0x18797e['body'][_0x6582('0x6b')]=_0xc47ab6['id'];return db[_0x6582('0x6f')][_0x6582('0x5d')](_0x18797e[_0x6582('0x5e')]);}})['then'](respondWithResult(_0x35e523,null))[_0x6582('0x2c')](handleError(_0x35e523,null));};exports[_0x6582('0x70')]=function(_0x137dec,_0x3caa71,_0x419ab7){var _0x1fde18={'raw':![],'where':{}};var _0x37e2c7={};var _0x527c33={'count':0x0,'rows':[]};return db[_0x6582('0x3f')]['findOne']({'where':{'id':_0x137dec[_0x6582('0x59')]['id']}})[_0x6582('0x22')](handleEntityNotFound(_0x3caa71,null))[_0x6582('0x22')](function(_0x58f90a){if(_0x58f90a){_0x37e2c7['model']=_['keys'](db[_0x6582('0x6f')][_0x6582('0x40')]);_0x37e2c7[_0x6582('0x46')]=_[_0x6582('0x47')](_0x137dec[_0x6582('0x46')]);_0x37e2c7['filters']=_[_0x6582('0x49')](_0x37e2c7['model'],_0x37e2c7[_0x6582('0x46')]);_0x1fde18[_0x6582('0x4a')]=_[_0x6582('0x49')](_0x37e2c7['model'],qs['fields'](_0x137dec[_0x6582('0x46')][_0x6582('0x4b')]));_0x1fde18[_0x6582('0x4a')]=_0x1fde18[_0x6582('0x4a')][_0x6582('0x4c')]?_0x1fde18[_0x6582('0x4a')]:_0x37e2c7[_0x6582('0x44')];if(!_0x137dec[_0x6582('0x46')]['hasOwnProperty'](_0x6582('0x4e'))){_0x1fde18[_0x6582('0x32')]=qs[_0x6582('0x32')](_0x137dec[_0x6582('0x46')]['limit']);_0x1fde18[_0x6582('0x30')]=qs[_0x6582('0x30')](_0x137dec[_0x6582('0x46')][_0x6582('0x30')]);}_0x1fde18[_0x6582('0x71')]=qs[_0x6582('0x4f')](_0x137dec[_0x6582('0x46')]['sort']);_0x1fde18[_0x6582('0x50')]=qs[_0x6582('0x48')](_['pick'](_0x137dec[_0x6582('0x46')],_0x37e2c7[_0x6582('0x48')]));_0x1fde18[_0x6582('0x50')][_0x6582('0x6b')]=_0x58f90a['id'];if(_0x137dec['query'][_0x6582('0x54')]){_0x1fde18[_0x6582('0x50')]=_['merge'](_0x1fde18[_0x6582('0x50')],{'$or':_['map'](_0x1fde18[_0x6582('0x4a')],function(_0x299939){var _0x150742={};_0x150742[_0x299939]={'$like':'%'+_0x137dec[_0x6582('0x46')][_0x6582('0x54')]+'%'};return _0x150742;})});}_0x1fde18=_[_0x6582('0x52')]({},_0x1fde18,_0x137dec['options']);return db['CannedAnswer'][_0x6582('0x33')]({'where':_0x1fde18[_0x6582('0x50')]})[_0x6582('0x22')](function(_0x17b5b8){_0x527c33[_0x6582('0x33')]=_0x17b5b8;if(_0x137dec[_0x6582('0x46')][_0x6582('0x55')]){_0x1fde18[_0x6582('0x5a')]=[{'all':!![]}];}return db[_0x6582('0x6f')][_0x6582('0x56')](_0x1fde18);})[_0x6582('0x22')](function(_0x402c9a){_0x527c33[_0x6582('0x57')]=_0x402c9a;return _0x527c33;});}})['then'](respondWithFilteredResult(_0x3caa71,_0x1fde18))[_0x6582('0x2c')](handleError(_0x3caa71,null));};exports['removeAnswers']=function(_0x57fabe,_0x222fa8,_0x1c282d){return db['OpenchannelAccount'][_0x6582('0x5c')]({'where':{'id':_0x57fabe['params']['id']}})[_0x6582('0x22')](handleEntityNotFound(_0x222fa8,null))[_0x6582('0x22')](function(_0x2f3df4){if(_0x2f3df4){return _0x2f3df4[_0x6582('0x72')](_0x57fabe['query'][_0x6582('0x6d')]);}})[_0x6582('0x22')](respondWithStatusCode(_0x222fa8,null))[_0x6582('0x2c')](handleError(_0x222fa8,null));};exports[_0x6582('0x73')]=function(_0x2d3d3f,_0x21f4d8,_0x17af3a){var _0x10634d={'body':_0x2d3d3f[_0x6582('0x5e')],'channel':'openchannel'};var _0x22071f=[];var _0x261045=[];var _0x218375={};var _0x148218=![];return db[_0x6582('0x74')]['describe']()[_0x6582('0x22')](function(_0x36630f){if(!_0x36630f){throw new db[(_0x6582('0x75'))]['ValidationError'](_0x6582('0x76'));}_0x22071f=_[_0x6582('0x77')](_[_0x6582('0x47')](_0x36630f),[_0x6582('0x78'),'updatedAt']);_0x261045=_[_0x6582('0x77')](_['keys'](_0x36630f),['createdAt','updatedAt',_0x6582('0x79'),_0x6582('0x7a')]);if(_0x2d3d3f[_0x6582('0x5e')]['id']){delete _0x2d3d3f[_0x6582('0x5e')]['id'];}if(_[_0x6582('0x7b')](_0x2d3d3f[_0x6582('0x5e')][_0x6582('0x7c')])){throw new db['Sequelize'][(_0x6582('0x7d'))](_0x6582('0x7e'));}if(_[_0x6582('0x7b')](_0x2d3d3f['body'][_0x6582('0x5e')])||_0x2d3d3f[_0x6582('0x5e')][_0x6582('0x5e')]===''){throw new db[(_0x6582('0x75'))][(_0x6582('0x7d'))](_0x6582('0x7f'));}if(_[_0x6582('0x7b')](_0x2d3d3f['body'][_0x6582('0x80')])){throw new db['Sequelize']['ValidationError'](_0x6582('0x81')+_0x261045);}if(!_[_0x6582('0x82')](_0x261045,_0x2d3d3f[_0x6582('0x5e')]['mapKey'])){throw new db[(_0x6582('0x75'))][(_0x6582('0x7d'))](_0x6582('0x83')+_0x261045);}_0x218375[_0x2d3d3f[_0x6582('0x5e')][_0x6582('0x80')]]=_0x2d3d3f[_0x6582('0x5e')]['from'];})['then'](function(){return db[_0x6582('0x3f')][_0x6582('0x5c')]({'where':{'id':_0x2d3d3f['params']['id']},'include':[{'model':db['CmList'],'as':_0x6582('0x84'),'include':[{'model':db[_0x6582('0x74')],'as':_0x6582('0x85'),'where':_0x218375,'limit':0x1,'order':[[_0x6582('0x86'),'DESC']]}]},{'model':db[_0x6582('0x87')],'as':_0x6582('0x88')}]});})['then'](handleEntityNotFound(_0x21f4d8,null))[_0x6582('0x22')](function(_0x1d7584){if(_0x1d7584&&_0x1d7584[_0x6582('0x84')]){_0x10634d[_0x6582('0x89')]=_0x1d7584;_0x10634d['applications']=_0x1d7584['Applications'];_0x10634d[_0x6582('0x8a')]=_0x1d7584['List'];_0x10634d[_0x6582('0x8b')]=_[_0x6582('0x8c')](_0x10634d[_0x6582('0x8b')],[_0x6582('0x8d')],[_0x6582('0x8e')]);if(_0x10634d[_0x6582('0x89')][_0x6582('0x88')]){delete _0x10634d[_0x6582('0x89')][_0x6582('0x88')];}if(_0x10634d['account'][_0x6582('0x84')]&&_0x10634d['account']['List'][_0x6582('0x85')][_0x6582('0x4c')]){return _0x10634d[_0x6582('0x89')][_0x6582('0x84')]['Contacts'][0x0];}var _0x36ae3c=_[_0x6582('0x8f')](_0x2d3d3f[_0x6582('0x5e')],{'firstName':_0x2d3d3f['body'][_0x6582('0x7c')],'ListId':_0x1d7584['ListId']});_0x36ae3c[_0x2d3d3f['body'][_0x6582('0x80')]]=_0x2d3d3f[_0x6582('0x5e')][_0x6582('0x7c')];return db[_0x6582('0x74')][_0x6582('0x5d')](_0x36ae3c,{'fields':_0x22071f,'raw':!![]});}})['then'](handleEntityNotFound(_0x21f4d8,null))[_0x6582('0x22')](function(_0x437c3a){_0x10634d['contact']=_0x437c3a;if(_0x437c3a){var _0x574558={'ContactId':_0x437c3a['id'],'OpenchannelAccountId':_0x2d3d3f[_0x6582('0x59')]['id'],'from':(_0x437c3a[_0x6582('0x90')]||'')+'\x20'+(_0x437c3a[_0x6582('0x91')]||'')};var _0x45fcbc={'OpenchannelAccountId':_0x2d3d3f['params']['id'],'closed':![]};if(_0x2d3d3f['body']['threadId']){_0x45fcbc['threadId']=_0x2d3d3f['body'][_0x6582('0x92')];return db[_0x6582('0x93')][_0x6582('0x5c')]({'where':_0x45fcbc})[_0x6582('0x22')](function(_0x55a384){if(_0x55a384){return[_0x55a384,![]];}_0x574558[_0x6582('0x92')]=_0x2d3d3f[_0x6582('0x5e')][_0x6582('0x92')];_0x574558[_0x6582('0x94')]=_0x2d3d3f[_0x6582('0x5e')][_0x6582('0x94')];return db['OpenchannelInteraction'][_0x6582('0x5d')](_0x574558)[_0x6582('0x22')](function(_0x18ed40){return[_0x18ed40,!![]];});});}else{_0x45fcbc['threadId']=null;}_0x45fcbc[_0x6582('0x95')]=_0x437c3a['id'];return db[_0x6582('0x93')][_0x6582('0x5c')]({'where':_0x45fcbc})['then'](function(_0x237f79){if(_0x237f79){return[_0x237f79,![]];}return db[_0x6582('0x93')][_0x6582('0x5d')](_0x574558)['then'](function(_0xcf0873){return[_0xcf0873,!![]];});});}})[_0x6582('0x96')](function(_0x13d260,_0x4ded2f){if(_0x13d260){_0x148218=_0x4ded2f;if(!_0x4ded2f){var _0xdb83a={'from':(_0x10634d['contact'][_0x6582('0x90')]||'')+'\x20'+(_0x10634d['contact']['lastName']||'')};if(_0x2d3d3f['body'][_0x6582('0x92')]&&_0x2d3d3f[_0x6582('0x5e')][_0x6582('0x97')]&&_0x2d3d3f[_0x6582('0x5e')][_0x6582('0x92')]!=_0x2d3d3f[_0x6582('0x5e')][_0x6582('0x97')]){_0xdb83a[_0x6582('0x92')]=_0x2d3d3f[_0x6582('0x5e')][_0x6582('0x97')];}return _0x13d260[_0x6582('0x65')](_0xdb83a);}else{return _0x13d260;}}})[_0x6582('0x22')](function(_0xdb9c3a){_0x10634d['interaction']=_0xdb9c3a[_0x6582('0x39')]({'plain':!![]});_0x10634d[_0x6582('0x98')][_0x6582('0x99')]=_0x148218;if(_0x10634d['interaction'][_0x6582('0x99')]){if(_0x10634d[_0x6582('0x89')]['autoclose']){_0x10634d[_0x6582('0x8b')][_0x6582('0x9a')]({'id':0x0,'priority':_0x10634d['applications'][_0x6582('0x4c')]+0x1,'app':_0x6582('0x9b'),'appdata':'unmanaged','interval':_0x6582('0x9c')});}}return db[_0x6582('0x9d')]['create']({'body':_0x2d3d3f['body'][_0x6582('0x5e')],'OpenchannelAccountId':_0x2d3d3f['params']['id'],'OpenchannelInteractionId':_0xdb9c3a['id'],'direction':'in','ContactId':_0x10634d[_0x6582('0x9e')]['id'],'AttachmentId':_0x2d3d3f[_0x6582('0x5e')]['AttachmentId']});})[_0x6582('0x22')](function(_0x456e4e){_0x10634d[_0x6582('0x29')]=_0x456e4e;if(_0x10634d[_0x6582('0x98')]['UserId']){return db[_0x6582('0x9f')][_0x6582('0x5c')]({'attributes':['id',_0x6582('0x3c')],'where':{'id':_0x10634d[_0x6582('0x98')][_0x6582('0xa0')]}})[_0x6582('0x22')](function(_0x3e28b8){if(_0x3e28b8){_0x10634d[_0x6582('0x8b')][_0x6582('0xa1')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3e28b8[_0x6582('0x3c')]+','+(_0x10634d['account']['waitForTheAssignedAgent']||0xa),'interval':_0x6582('0x9c')});_0x10634d[_0x6582('0xa2')]=![];}return respondWithRpcPromise(_0x6582('0xa3'),_0x6582('0xa4'),_0x10634d);});}return respondWithRpcPromise(_0x6582('0xa3'),_0x6582('0xa4'),_0x10634d);})[_0x6582('0x22')](function(_0x49235e){respondWithRpcPromise('EventManager',_0x6582('0xa5'),{'event':_0x6582('0x73'),'message':_0x49235e},client9002);return _0x49235e;})['then'](respondWithResult(_0x21f4d8,null))[_0x6582('0x2c')](handleError(_0x21f4d8,null));};exports[_0x6582('0xa6')]=function(_0x292ede,_0x86ce07){var _0x158019=_0x292ede['params']['id'];var _0x4d5960=_0x292ede[_0x6582('0x5e')];var _0x5dd303=0xc8;var _0x196bb9=null;return db[_0x6582('0xa7')][_0x6582('0xa8')]({'isolationLevel':db[_0x6582('0xa7')]['Transaction']['ISOLATION_LEVELS'][_0x6582('0xa9')]},function(_0x21c26f){return db[_0x6582('0x3f')]['findOne']({'where':{'id':_0x158019},'transaction':_0x21c26f})[_0x6582('0x22')](function(_0x387cc0){if(_0x387cc0){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x158019},'transaction':_0x21c26f})['then'](function(){var _0x35f63a=_[_0x6582('0x45')](_0x4d5960,function(_0x4925f3){_0x4925f3[_0x6582('0x6b')]=_0x158019;return _0x4925f3;});return db['OpenchannelApplication'][_0x6582('0xaa')](_0x35f63a,{'transaction':_0x21c26f});});}else{_0x5dd303=0x194;_0x196bb9=[];}});})[_0x6582('0x22')](function(){if(_0x5dd303!==0x194){return db[_0x6582('0x87')][_0x6582('0xab')]({'where':{'OpenchannelAccountId':_0x158019},'order':_0x6582('0x8d')})[_0x6582('0x22')](function(_0x53d855){_0x196bb9=_0x53d855;});}})['catch'](function(_0x3e13f8){_0x5dd303=0x1f4;logger[_0x6582('0x27')](_0x3e13f8[_0x6582('0xac')]);if(_0x3e13f8[_0x6582('0x3c')]){delete _0x3e13f8[_0x6582('0x3c')];}_0x196bb9=_0x3e13f8;})[_0x6582('0xad')](function(){if(_0x196bb9===null){_0x86ce07['sendStatus'](_0x5dd303);}else{if(_0x5dd303===0x1f4){_0x86ce07[_0x6582('0x2e')](_0x5dd303)[_0x6582('0x3d')](_0x196bb9);}else{_0x86ce07[_0x6582('0x2e')](_0x5dd303)[_0x6582('0x36')](_0x196bb9);}}});};exports[_0x6582('0xae')]=function(_0x4bb330,_0x94cd6c,_0x45d586){var _0x2597e6={};var _0x361983={};var _0x482d01;var _0x15e4a1;return db[_0x6582('0x3f')]['findOne']({'where':{'id':_0x4bb330['params']['id']}})[_0x6582('0x22')](handleEntityNotFound(_0x94cd6c,null))[_0x6582('0x22')](function(_0xe12585){if(_0xe12585){_0x482d01=_0xe12585;_0x361983[_0x6582('0x44')]=_[_0x6582('0x47')](db[_0x6582('0x87')][_0x6582('0x40')]);_0x361983[_0x6582('0x46')]=_[_0x6582('0x47')](_0x4bb330['query']);_0x361983[_0x6582('0x48')]=_['intersection'](_0x361983[_0x6582('0x44')],_0x361983['query']);_0x2597e6['attributes']=_[_0x6582('0x49')](_0x361983[_0x6582('0x44')],qs[_0x6582('0x4b')](_0x4bb330[_0x6582('0x46')][_0x6582('0x4b')]));_0x2597e6[_0x6582('0x4a')]=_0x2597e6[_0x6582('0x4a')]['length']?_0x2597e6[_0x6582('0x4a')]:_0x361983['model'];_0x2597e6['order']=qs[_0x6582('0x4f')](_0x4bb330[_0x6582('0x46')]['sort']);_0x2597e6[_0x6582('0x50')]=qs['filters'](_[_0x6582('0x51')](_0x4bb330[_0x6582('0x46')],_0x361983['filters']));if(_0x4bb330[_0x6582('0x46')][_0x6582('0x54')]){_0x2597e6['where']=_[_0x6582('0x52')](_0x2597e6[_0x6582('0x50')],{'$or':_['map'](_0x2597e6['attributes'],function(_0x248e8c){var _0x1ccd4c={};_0x1ccd4c[_0x248e8c]={'$like':'%'+_0x4bb330['query'][_0x6582('0x54')]+'%'};return _0x1ccd4c;})});}_0x2597e6=_['merge']({},_0x2597e6,_0x4bb330[_0x6582('0x5b')]);return _0x482d01[_0x6582('0xae')](_0x2597e6);}})[_0x6582('0x22')](function(_0x33e32f){if(_0x33e32f){_0x15e4a1=_0x33e32f[_0x6582('0x4c')];if(!_0x4bb330[_0x6582('0x46')]['hasOwnProperty'](_0x6582('0x4e'))){_0x2597e6['limit']=qs[_0x6582('0x32')](_0x4bb330[_0x6582('0x46')][_0x6582('0x32')]);_0x2597e6['offset']=qs[_0x6582('0x30')](_0x4bb330[_0x6582('0x46')][_0x6582('0x30')]);}return _0x482d01[_0x6582('0xae')](_0x2597e6);}})[_0x6582('0x22')](function(_0x481334){if(_0x481334){return _0x481334?{'count':_0x15e4a1,'rows':_0x481334}:null;}})['then'](respondWithResult(_0x94cd6c,null))[_0x6582('0x2c')](handleError(_0x94cd6c,null));};exports[_0x6582('0xaf')]=function(_0x368567,_0x9b08bb,_0x3ee750){var _0x32293c={'raw':![],'where':{}};var _0xe1c75e={};var _0x42ee00={'count':0x0,'rows':[]};return db[_0x6582('0x3f')][_0x6582('0x6a')]({'where':{'id':_0x368567[_0x6582('0x59')]['id']}})['then'](handleEntityNotFound(_0x9b08bb,null))[_0x6582('0x22')](function(_0x3d6c19){if(_0x3d6c19){_0xe1c75e[_0x6582('0x44')]=_[_0x6582('0x47')](db[_0x6582('0x93')][_0x6582('0x40')]);_0xe1c75e[_0x6582('0x46')]=_[_0x6582('0x47')](_0x368567[_0x6582('0x46')]);_0xe1c75e[_0x6582('0x48')]=_[_0x6582('0x49')](_0xe1c75e['model'],_0xe1c75e[_0x6582('0x46')]);_0x32293c['attributes']=_['intersection'](_0xe1c75e[_0x6582('0x44')],qs[_0x6582('0x4b')](_0x368567[_0x6582('0x46')][_0x6582('0x4b')]));_0x32293c[_0x6582('0x4a')]=_0x32293c[_0x6582('0x4a')][_0x6582('0x4c')]?_0x32293c[_0x6582('0x4a')]:_0xe1c75e[_0x6582('0x44')];if(!_0x368567[_0x6582('0x46')][_0x6582('0x4d')](_0x6582('0x4e'))){_0x32293c[_0x6582('0x32')]=qs[_0x6582('0x32')](_0x368567[_0x6582('0x46')][_0x6582('0x32')]);_0x32293c['offset']=qs[_0x6582('0x30')](_0x368567[_0x6582('0x46')][_0x6582('0x30')]);}_0x32293c[_0x6582('0x71')]=qs[_0x6582('0x4f')](_0x368567[_0x6582('0x46')]['sort']);_0x32293c[_0x6582('0x50')]=qs['filters'](_[_0x6582('0x51')](_0x368567[_0x6582('0x46')],_0xe1c75e[_0x6582('0x48')]));_0x32293c[_0x6582('0x50')][_0x6582('0x6b')]=_0x3d6c19['id'];if(_0x368567['query'][_0x6582('0x54')]){_0x32293c[_0x6582('0x50')]=_['merge'](_0x32293c[_0x6582('0x50')],{'$or':_[_0x6582('0x45')](_0x32293c['attributes'],function(_0x55ff5b){var _0x4644b1={};_0x4644b1[_0x55ff5b]={'$like':'%'+_0x368567[_0x6582('0x46')][_0x6582('0x54')]+'%'};return _0x4644b1;})});}_0x32293c=_[_0x6582('0x52')]({},_0x32293c,_0x368567[_0x6582('0x5b')]);return db[_0x6582('0x93')]['count']({'where':_0x32293c[_0x6582('0x50')]})['then'](function(_0x228187){_0x42ee00['count']=_0x228187;if(_0x368567[_0x6582('0x46')]['includeAll']){_0x32293c[_0x6582('0x5a')]=[{'model':db[_0x6582('0x74')],'as':'Contact','required':![]},{'model':db[_0x6582('0x9f')],'as':_0x6582('0xb0'),'attributes':[_0x6582('0x3c'),_0x6582('0xb1'),_0x6582('0xb2')],'required':![]},{'model':db[_0x6582('0xb3')],'as':'Tags','attributes':['id',_0x6582('0x3c'),_0x6582('0xb4')],'where':_0x368567[_0x6582('0x46')][_0x6582('0xb5')]?{'id':_0x368567[_0x6582('0x46')][_0x6582('0xb5')]}:undefined,'required':_0x368567[_0x6582('0x46')]['tag']?!![]:![]}];}return db[_0x6582('0x93')][_0x6582('0x56')](_0x32293c);})['then'](function(_0x45a494){_0x42ee00[_0x6582('0x57')]=_0x45a494;return _0x42ee00;});}})['then'](respondWithFilteredResult(_0x9b08bb,_0x32293c))['catch'](handleError(_0x9b08bb,null));};exports[_0x6582('0xb6')]=function(_0x421f5c,_0x3b57c8,_0x3c739b){return db[_0x6582('0x3f')][_0x6582('0x5c')]({'where':{'id':_0x421f5c[_0x6582('0x59')]['id']}})[_0x6582('0x22')](handleEntityNotFound(_0x3b57c8,null))[_0x6582('0x22')](function(_0x44d955){if(_0x44d955){return _0x44d955[_0x6582('0xb6')](_0x421f5c[_0x6582('0x5e')][_0x6582('0x6d')],_[_0x6582('0xb7')](_0x421f5c[_0x6582('0x5e')],[_0x6582('0x6d'),'id'])||{})[_0x6582('0x96')](function(_0x37f628){for(var _0x5f290b=0x0;_0x5f290b<_0x421f5c[_0x6582('0x5e')][_0x6582('0x6d')][_0x6582('0x4c')];_0x5f290b+=0x1){socket[_0x6582('0xb8')](_0x6582('0xb9'),{'UserId':Number(_0x421f5c[_0x6582('0x5e')][_0x6582('0x6d')][_0x5f290b]),'OpenchannelAccountId':Number(_0x421f5c[_0x6582('0x59')]['id'])});}return _0x37f628;});}})[_0x6582('0x22')](respondWithResult(_0x3b57c8,null))['catch'](handleError(_0x3b57c8,null));};exports['removeAgents']=function(_0x3c0aca,_0x1c69e1,_0x5de3ae){return db[_0x6582('0x3f')][_0x6582('0x5c')]({'where':{'id':_0x3c0aca[_0x6582('0x59')]['id']}})['then'](handleEntityNotFound(_0x1c69e1,null))['then'](function(_0x2405d9){if(_0x2405d9){return _0x2405d9[_0x6582('0xba')](_0x3c0aca[_0x6582('0x46')]['ids'])[_0x6582('0x22')](function(){if(_[_0x6582('0xbb')](_0x3c0aca['query'][_0x6582('0x6d')])){for(var _0x21d560=0x0;_0x21d560<_0x3c0aca[_0x6582('0x46')][_0x6582('0x6d')][_0x6582('0x4c')];_0x21d560+=0x1){socket[_0x6582('0xb8')](_0x6582('0xbc'),{'UserId':Number(_0x3c0aca[_0x6582('0x46')]['ids'][_0x21d560]),'OpenchannelAccountId':Number(_0x3c0aca[_0x6582('0x59')]['id'])});}}else{socket['emit']('userOpenchannelAccount:remove',{'UserId':Number(_0x3c0aca[_0x6582('0x46')][_0x6582('0x6d')]),'OpenchannelAccountId':Number(_0x3c0aca['params']['id'])});}});}})[_0x6582('0x22')](respondWithStatusCode(_0x1c69e1,null))[_0x6582('0x2c')](handleError(_0x1c69e1,null));};exports[_0x6582('0xbd')]=function(_0xdf97ef,_0xa80b9a,_0x4ab969){var _0x1403ac={};var _0x306dbe={};var _0x459fcb;var _0x4c304a;return db[_0x6582('0x3f')]['findOne']({'where':{'id':_0xdf97ef[_0x6582('0x59')]['id']}})['then'](handleEntityNotFound(_0xa80b9a,null))[_0x6582('0x22')](function(_0x40bcae){if(_0x40bcae){_0x459fcb=_0x40bcae;_0x306dbe['model']=_[_0x6582('0x47')](db[_0x6582('0x9f')][_0x6582('0x40')]);_0x306dbe[_0x6582('0x46')]=_['keys'](_0xdf97ef[_0x6582('0x46')]);_0x306dbe[_0x6582('0x48')]=_[_0x6582('0x49')](_0x306dbe[_0x6582('0x44')],_0x306dbe[_0x6582('0x46')]);_0x1403ac['attributes']=_['intersection'](_0x306dbe['model'],qs[_0x6582('0x4b')](_0xdf97ef[_0x6582('0x46')][_0x6582('0x4b')]));_0x1403ac['attributes']=_0x1403ac['attributes']['length']?_0x1403ac[_0x6582('0x4a')]:_0x306dbe[_0x6582('0x44')];_0x1403ac['order']=qs[_0x6582('0x4f')](_0xdf97ef['query'][_0x6582('0x4f')]);_0x1403ac[_0x6582('0x50')]=qs[_0x6582('0x48')](_[_0x6582('0x51')](_0xdf97ef[_0x6582('0x46')],_0x306dbe[_0x6582('0x48')]));if(_0xdf97ef[_0x6582('0x46')][_0x6582('0x54')]){_0x1403ac[_0x6582('0x50')]=_['merge'](_0x1403ac['where'],{'$or':_[_0x6582('0x45')](_0x1403ac[_0x6582('0x4a')],function(_0x2b7189){var _0x33c44b={};_0x33c44b[_0x2b7189]={'$like':'%'+_0xdf97ef[_0x6582('0x46')][_0x6582('0x54')]+'%'};return _0x33c44b;})});}_0x1403ac=_['merge']({},_0x1403ac,_0xdf97ef['options']);return _0x459fcb[_0x6582('0xbd')](_0x1403ac);}})[_0x6582('0x22')](function(_0x450e84){if(_0x450e84){_0x4c304a=_0x450e84[_0x6582('0x4c')];if(!_0xdf97ef[_0x6582('0x46')][_0x6582('0x4d')]('nolimit')){_0x1403ac[_0x6582('0x32')]=qs[_0x6582('0x32')](_0xdf97ef[_0x6582('0x46')]['limit']);_0x1403ac[_0x6582('0x30')]=qs[_0x6582('0x30')](_0xdf97ef['query']['offset']);}return _0x459fcb['getAgents'](_0x1403ac);}})['then'](function(_0x61dcfc){if(_0x61dcfc){return _0x61dcfc?{'count':_0x4c304a,'rows':_0x61dcfc}:null;}})[_0x6582('0x22')](respondWithResult(_0xa80b9a,null))['catch'](handleError(_0xa80b9a,null));};exports['send']=function(_0x3cbb65,_0x16a431,_0x503741){var _0x5a5be3,_0x712caa,_0x28110f;if(_[_0x6582('0x7b')](_0x3cbb65['body'][_0x6582('0x5e')])||_0x3cbb65[_0x6582('0x5e')][_0x6582('0x5e')]===''){throw new db['Sequelize'][(_0x6582('0x7d'))](_0x6582('0x7f'));}if(_['isNil'](_0x3cbb65['body']['to'])){}_0x5a5be3=_0x3cbb65[_0x6582('0x5e')]['to'];return db['OpenchannelAccount'][_0x6582('0x6a')]({'where':{'id':_0x3cbb65[_0x6582('0x59')]['id']}})[_0x6582('0x22')](handleEntityNotFound(_0x16a431,null))[_0x6582('0x22')](function(_0x3ac2b0){if(_0x3ac2b0){return db['OpenchannelAccount']['find']({'where':{'id':_0x3ac2b0['id']},'include':[{'model':db[_0x6582('0xbe')],'as':_0x6582('0x84'),'include':[{'model':db[_0x6582('0x74')],'as':_0x6582('0x85'),'where':{[_0x3ac2b0[_0x6582('0x80')]]:_0x5a5be3},'limit':0x1,'order':[['updatedAt',_0x6582('0xbf')]]}]}]})[_0x6582('0x22')](handleEntityNotFound(_0x16a431,null))[_0x6582('0x22')](function(_0x30c987){if(_0x30c987&&_0x30c987['List']){_0x712caa=_0x30c987[_0x6582('0x39')]({'plain':!![]});if(_0x712caa['List']&&_0x712caa[_0x6582('0x84')][_0x6582('0x85')][_0x6582('0x4c')]){return _0x712caa[_0x6582('0x84')][_0x6582('0x85')][0x0];}return db[_0x6582('0x74')]['create'](_[_0x6582('0x8f')](_0x3cbb65[_0x6582('0x5e')],{'firstName':_0x5a5be3,[_0x30c987['mapKey']]:_0x5a5be3,'phone':_0x5a5be3,'ListId':_0x712caa[_0x6582('0x7a')]}));}})[_0x6582('0x22')](handleEntityNotFound(_0x16a431,null))[_0x6582('0x22')](function(_0x55eead){if(_0x55eead){_0x28110f=_0x55eead;return db[_0x6582('0x93')][_0x6582('0x5c')]({'where':{'ContactId':_0x28110f['id'],'closed':![],'OpenchannelAccountId':_0x712caa['id']}})[_0x6582('0x22')](function(_0x234653){if(_0x234653){return[_0x234653,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x3cbb65[_0x6582('0x5f')]['id'],'ContactId':_0x28110f['id'],'OpenchannelAccountId':_0x712caa['id'],'lastMsgDirection':'out','firstMsgDirection':_0x6582('0xc0'),'Messages':[_['merge'](_0x3cbb65[_0x6582('0x5e')],{'read':![],'body':_0x3cbb65[_0x6582('0x5e')]['body'],'OpenchannelAccountId':_0x712caa['id'],'UserId':_0x3cbb65[_0x6582('0x5f')]['id'],'ContactId':_0x28110f['id']})]},{'include':[{'model':db[_0x6582('0x9d')],'as':_0x6582('0xc1')}]})[_0x6582('0x22')](function(_0x27478a){return[_0x27478a,!![]];});});}})[_0x6582('0x96')](function(_0x47a179,_0xaa5085){if(_0xaa5085){return _0x47a179;}return db[_0x6582('0x9d')][_0x6582('0x5d')](_[_0x6582('0x52')](_0x3cbb65[_0x6582('0x5e')],{'read':![],'body':_0x3cbb65[_0x6582('0x5e')][_0x6582('0x5e')],'OpenchannelAccountId':_0x712caa['id'],'OpenchannelInteractionId':_0x47a179['id'],'UserId':_0x3cbb65[_0x6582('0x5f')]['id'],'ContactId':_0x28110f['id']}))[_0x6582('0x22')](function(_0x168c75){_0x47a179[_0x6582('0xc2')][_0x6582('0xc1')]=[];_0x47a179[_0x6582('0xc2')][_0x6582('0xc1')][_0x6582('0x9a')](_0x168c75[_0x6582('0xc2')]);return _0x47a179;});});}})[_0x6582('0x22')](respondWithResult(_0x16a431,null))[_0x6582('0x2c')](handleError(_0x16a431,null));}; \ No newline at end of file +var _0x27bf=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','findOne','order','OpenchannelAccountId','removeDispositions','ids','CannedAnswer','removeAnswers','notify','openchannel','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','isNil','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','DESC','OpenchannelApplication','Applications','account','applications','list','priority','asc','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','push','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','User','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','jayson/promise','client','http','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','save','update','then','destroy','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','OpenchannelAccount','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId'];(function(_0x4b8c02,_0x1a889d){var _0x551cec=function(_0x2a371a){while(--_0x2a371a){_0x4b8c02['push'](_0x4b8c02['shift']());}};_0x551cec(++_0x1a889d);}(_0x27bf,0x117));var _0xf27b=function(_0x56f143,_0x420212){_0x56f143=_0x56f143-0x0;var _0x2e552b=_0x27bf[_0x56f143];return _0x2e552b;};'use strict';var emlformat=require(_0xf27b('0x0'));var rimraf=require(_0xf27b('0x1'));var zipdir=require(_0xf27b('0x2'));var jsonpatch=require(_0xf27b('0x3'));var rp=require(_0xf27b('0x4'));var moment=require(_0xf27b('0x5'));var BPromise=require(_0xf27b('0x6'));var Mustache=require(_0xf27b('0x7'));var util=require(_0xf27b('0x8'));var path=require(_0xf27b('0x9'));var sox=require(_0xf27b('0xa'));var csv=require('to-csv');var ejs=require(_0xf27b('0xb'));var fs=require('fs');var fs_extra=require(_0xf27b('0xc'));var _=require(_0xf27b('0xd'));var squel=require(_0xf27b('0xe'));var crypto=require(_0xf27b('0xf'));var jsforce=require(_0xf27b('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xf27b('0x11'));var querystring=require(_0xf27b('0x12'));var Papa=require(_0xf27b('0x13'));var Redis=require(_0xf27b('0x14'));var authService=require(_0xf27b('0x15'));var qs=require(_0xf27b('0x16'));var as=require(_0xf27b('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xf27b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xf27b('0x19'));var db=require(_0xf27b('0x1a'))['db'];config[_0xf27b('0x1b')]=_[_0xf27b('0x1c')](config['redis'],{'host':_0xf27b('0x1d'),'port':0x18eb});var socket=require(_0xf27b('0x1e'))(new Redis(config[_0xf27b('0x1b')]));require(_0xf27b('0x1f'))['register'](socket);var jayson=require(_0xf27b('0x20'));var client=jayson[_0xf27b('0x21')]['http']({'port':0x232c});var client9002=jayson['client'][_0xf27b('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x589455,_0x24f610,_0x12db19,_0x1fc319){return new BPromise(function(_0x5305d9,_0x42f512){var _0x216423=_0x1fc319||client;return _0x216423[_0xf27b('0x23')](_0x589455,_0x12db19)['then'](function(_0x472f1a){logger[_0xf27b('0x24')](_0xf27b('0x25'),_0x24f610,_0xf27b('0x26'));logger[_0xf27b('0x27')](_0xf27b('0x28'),_0x24f610,_0xf27b('0x26'),JSON[_0xf27b('0x29')](_0x472f1a));if(_0x472f1a[_0xf27b('0x2a')]){if(_0x472f1a['error'][_0xf27b('0x2b')]===0x1f4){logger['error'](_0xf27b('0x25'),_0x24f610,_0x472f1a[_0xf27b('0x2a')][_0xf27b('0x2c')]);return _0x42f512(_0x472f1a[_0xf27b('0x2a')]['message']);}logger[_0xf27b('0x2a')](_0xf27b('0x25'),_0x24f610,_0x472f1a[_0xf27b('0x2a')][_0xf27b('0x2c')]);return _0x5305d9(_0x472f1a['error'][_0xf27b('0x2c')]);}else{logger[_0xf27b('0x24')](_0xf27b('0x25'),_0x24f610,_0xf27b('0x26'));_0x5305d9(_0x472f1a[_0xf27b('0x2d')][_0xf27b('0x2c')]);}})['catch'](function(_0x4d9e29){logger['error'](_0xf27b('0x25'),_0x24f610,_0x4d9e29);_0x42f512(_0x4d9e29);});});}function respondWithStatusCode(_0x3e26c9,_0x1166db){_0x1166db=_0x1166db||0xcc;return function(_0x4b8e93){if(_0x4b8e93){return _0x3e26c9[_0xf27b('0x2e')](_0x1166db);}return _0x3e26c9['status'](_0x1166db)[_0xf27b('0x2f')]();};}function respondWithResult(_0x190729,_0x2817cd){_0x2817cd=_0x2817cd||0xc8;return function(_0x1502ad){if(_0x1502ad){return _0x190729['status'](_0x2817cd)[_0xf27b('0x30')](_0x1502ad);}};}function respondWithFilteredResult(_0x280246,_0x564943){return function(_0x3ead4d){if(_0x3ead4d){var _0x409df3=typeof _0x564943[_0xf27b('0x31')]===_0xf27b('0x32')&&typeof _0x564943[_0xf27b('0x33')]===_0xf27b('0x32');var _0x5eddd6=_0x3ead4d[_0xf27b('0x34')];var _0x780e4=_0x409df3?0x0:_0x564943[_0xf27b('0x31')];var _0x364691=_0x409df3?_0x3ead4d[_0xf27b('0x34')]:_0x564943[_0xf27b('0x31')]+_0x564943[_0xf27b('0x33')];var _0x9b7f;if(_0x364691>=_0x5eddd6){_0x364691=_0x5eddd6;_0x9b7f=0xc8;}else{_0x9b7f=0xce;}_0x280246[_0xf27b('0x35')](_0x9b7f);return _0x280246[_0xf27b('0x36')]('Content-Range',_0x780e4+'-'+_0x364691+'/'+_0x5eddd6)[_0xf27b('0x30')](_0x3ead4d);}return null;};}function patchUpdates(_0x616d93){return function(_0x442597){try{jsonpatch[_0xf27b('0x37')](_0x442597,_0x616d93,!![]);}catch(_0x1a0067){return BPromise['reject'](_0x1a0067);}return _0x442597[_0xf27b('0x38')]();};}function saveUpdates(_0x65c659,_0x4c1a55){return function(_0x5f3356){if(_0x5f3356){return _0x5f3356[_0xf27b('0x39')](_0x65c659)[_0xf27b('0x3a')](function(_0x3afeca){return _0x3afeca;});}return null;};}function removeEntity(_0x457291,_0x4ce989){return function(_0x5dacdb){if(_0x5dacdb){return _0x5dacdb[_0xf27b('0x3b')]()[_0xf27b('0x3a')](function(){var _0x48f8fc=_0x5dacdb['get']({'plain':!![]});var _0xbeec8b=_0xf27b('0x3c');return db[_0xf27b('0x3d')][_0xf27b('0x3b')]({'where':{'type':_0xbeec8b,'resourceId':_0x48f8fc['id']}})[_0xf27b('0x3a')](function(){return _0x5dacdb;});})['then'](function(){_0x457291['status'](0xcc)[_0xf27b('0x2f')]();});}};}function handleEntityNotFound(_0x210ae4,_0x18f143){return function(_0x105ea7){if(!_0x105ea7){_0x210ae4['sendStatus'](0x194);}return _0x105ea7;};}function handleError(_0x2272a4,_0x29d26a){_0x29d26a=_0x29d26a||0x1f4;return function(_0x37d21e){logger[_0xf27b('0x2a')](_0x37d21e[_0xf27b('0x3e')]);if(_0x37d21e['name']){delete _0x37d21e[_0xf27b('0x3f')];}_0x2272a4[_0xf27b('0x35')](_0x29d26a)[_0xf27b('0x40')](_0x37d21e);};}exports[_0xf27b('0x41')]=function(_0x2a185e,_0x1e0eb5){var _0x54faa2={'include':[{'model':db[_0xf27b('0x42')],'as':_0xf27b('0x43')}]},_0x2cc34f={},_0x577123={'count':0x0,'rows':[]};var _0xb0efd0=_['map'](db[_0xf27b('0x44')][_0xf27b('0x45')],function(_0x38e208){return{'name':_0x38e208['fieldName'],'type':_0x38e208[_0xf27b('0x46')][_0xf27b('0x47')]};});_0x2cc34f[_0xf27b('0x48')]=_[_0xf27b('0x49')](_0xb0efd0,'name');_0x2cc34f['query']=_['keys'](_0x2a185e[_0xf27b('0x4a')]);_0x2cc34f[_0xf27b('0x4b')]=_[_0xf27b('0x4c')](_0x2cc34f[_0xf27b('0x48')],_0x2cc34f['query']);_0x54faa2[_0xf27b('0x4d')]=_['intersection'](_0x2cc34f[_0xf27b('0x48')],qs[_0xf27b('0x4e')](_0x2a185e[_0xf27b('0x4a')][_0xf27b('0x4e')]));_0x54faa2[_0xf27b('0x4d')]=_0x54faa2[_0xf27b('0x4d')][_0xf27b('0x4f')]?_0x54faa2[_0xf27b('0x4d')]:_0x2cc34f[_0xf27b('0x48')];if(!_0x2a185e[_0xf27b('0x4a')][_0xf27b('0x50')](_0xf27b('0x51'))){_0x54faa2[_0xf27b('0x33')]=qs[_0xf27b('0x33')](_0x2a185e[_0xf27b('0x4a')][_0xf27b('0x33')]);_0x54faa2['offset']=qs[_0xf27b('0x31')](_0x2a185e[_0xf27b('0x4a')][_0xf27b('0x31')]);}_0x54faa2['order']=qs[_0xf27b('0x52')](_0x2a185e[_0xf27b('0x4a')][_0xf27b('0x52')]);_0x54faa2[_0xf27b('0x53')]=qs[_0xf27b('0x4b')](_[_0xf27b('0x54')](_0x2a185e[_0xf27b('0x4a')],_0x2cc34f[_0xf27b('0x4b')]),_0xb0efd0);if(_0x2a185e[_0xf27b('0x4a')][_0xf27b('0x55')]){_0x54faa2['where']=_[_0xf27b('0x56')](_0x54faa2[_0xf27b('0x53')],{'$or':_[_0xf27b('0x49')](_0xb0efd0,function(_0xbac06e){if(_0xbac06e[_0xf27b('0x46')]!==_0xf27b('0x57')){var _0x4ec502={};_0x4ec502[_0xbac06e['name']]={'$like':'%'+_0x2a185e[_0xf27b('0x4a')][_0xf27b('0x55')]+'%'};return _0x4ec502;}})});}_0x54faa2=_[_0xf27b('0x56')]({},_0x54faa2,_0x2a185e[_0xf27b('0x58')]);var _0x1abb9e={'where':_0x54faa2[_0xf27b('0x53')]};return db['OpenchannelAccount'][_0xf27b('0x34')](_0x1abb9e)['then'](function(_0x2bd074){_0x577123[_0xf27b('0x34')]=_0x2bd074;if(_0x2a185e[_0xf27b('0x4a')][_0xf27b('0x59')]){_0x54faa2['include']=[{'all':!![]}];}return db['OpenchannelAccount'][_0xf27b('0x5a')](_0x54faa2);})[_0xf27b('0x3a')](function(_0x458583){_0x577123[_0xf27b('0x5b')]=_0x458583;return _0x577123;})['then'](respondWithFilteredResult(_0x1e0eb5,_0x54faa2))['catch'](handleError(_0x1e0eb5,null));};exports[_0xf27b('0x5c')]=function(_0x19e9dd,_0x54bd0a){var _0xe4ea01={'raw':![],'where':{'id':_0x19e9dd[_0xf27b('0x5d')]['id']},'include':[{'model':db['Pause'],'as':_0xf27b('0x43')}]},_0x2bc83c={};_0x2bc83c['model']=_[_0xf27b('0x5e')](db['OpenchannelAccount'][_0xf27b('0x45')]);_0x2bc83c[_0xf27b('0x4a')]=_['keys'](_0x19e9dd[_0xf27b('0x4a')]);_0x2bc83c['filters']=_['intersection'](_0x2bc83c[_0xf27b('0x48')],_0x2bc83c[_0xf27b('0x4a')]);_0xe4ea01['attributes']=_['intersection'](_0x2bc83c['model'],qs[_0xf27b('0x4e')](_0x19e9dd[_0xf27b('0x4a')][_0xf27b('0x4e')]));_0xe4ea01[_0xf27b('0x4d')]=_0xe4ea01[_0xf27b('0x4d')][_0xf27b('0x4f')]?_0xe4ea01[_0xf27b('0x4d')]:_0x2bc83c[_0xf27b('0x48')];if(_0x19e9dd[_0xf27b('0x4a')]['includeAll']){_0xe4ea01[_0xf27b('0x5f')]=[{'all':!![]}];}_0xe4ea01=_[_0xf27b('0x56')]({},_0xe4ea01,_0x19e9dd['options']);return db['OpenchannelAccount']['find'](_0xe4ea01)[_0xf27b('0x3a')](handleEntityNotFound(_0x54bd0a,null))['then'](respondWithResult(_0x54bd0a,null))[_0xf27b('0x60')](handleError(_0x54bd0a,null));};exports[_0xf27b('0x61')]=function(_0xdd9506,_0x161fd5){return db[_0xf27b('0x44')][_0xf27b('0x61')](_0xdd9506[_0xf27b('0x62')],{})[_0xf27b('0x3a')](function(_0x578c4d){var _0x479a0a=_0xdd9506[_0xf27b('0x63')][_0xf27b('0x64')]({'plain':!![]});if(!_0x479a0a)throw new Error(_0xf27b('0x65'));if(_0x479a0a[_0xf27b('0x66')]===_0xf27b('0x63')){var _0x417b4d=_0x578c4d[_0xf27b('0x64')]({'plain':!![]});var _0x234040=_0xf27b('0x3c');return db['UserProfileSection'][_0xf27b('0x67')]({'where':{'name':_0x234040,'userProfileId':_0x479a0a[_0xf27b('0x68')]},'raw':!![]})[_0xf27b('0x3a')](function(_0x575664){if(_0x575664&&_0x575664[_0xf27b('0x69')]===0x0){return db['UserProfileResource'][_0xf27b('0x61')]({'name':_0x417b4d[_0xf27b('0x3f')],'resourceId':_0x417b4d['id'],'type':_0x575664[_0xf27b('0x3f')],'sectionId':_0x575664['id']},{})['then'](function(){return _0x578c4d;});}else{return _0x578c4d;}})[_0xf27b('0x60')](function(_0x397532){logger[_0xf27b('0x2a')](_0xf27b('0x6a'),_0x397532);throw _0x397532;});}return _0x578c4d;})[_0xf27b('0x3a')](respondWithResult(_0x161fd5,0xc9))[_0xf27b('0x60')](handleError(_0x161fd5,null));};exports[_0xf27b('0x39')]=function(_0x1aa28b,_0x3ba538){if(_0x1aa28b[_0xf27b('0x62')]['id']){delete _0x1aa28b[_0xf27b('0x62')]['id'];}return db[_0xf27b('0x44')][_0xf27b('0x67')]({'where':{'id':_0x1aa28b[_0xf27b('0x5d')]['id']},'include':[{'model':db[_0xf27b('0x42')],'as':_0xf27b('0x43')}]})[_0xf27b('0x3a')](handleEntityNotFound(_0x3ba538,null))['then'](saveUpdates(_0x1aa28b[_0xf27b('0x62')],null))[_0xf27b('0x3a')](respondWithResult(_0x3ba538,null))[_0xf27b('0x60')](handleError(_0x3ba538,null));};exports[_0xf27b('0x3b')]=function(_0x4d5652,_0x5f4298){return db['OpenchannelAccount'][_0xf27b('0x67')]({'where':{'id':_0x4d5652[_0xf27b('0x5d')]['id']}})[_0xf27b('0x3a')](handleEntityNotFound(_0x5f4298,null))[_0xf27b('0x3a')](removeEntity(_0x5f4298,null))['catch'](handleError(_0x5f4298,null));};exports[_0xf27b('0x6b')]=function(_0x254fd6,_0x4482ef){return db[_0xf27b('0x44')][_0xf27b('0x6b')]()[_0xf27b('0x3a')](respondWithResult(_0x4482ef,null))[_0xf27b('0x60')](handleError(_0x4482ef,null));};exports[_0xf27b('0x6c')]=function(_0x314681,_0x581926,_0x133e97){if(_0x314681[_0xf27b('0x62')]['id']){delete _0x314681['body']['id'];}return db[_0xf27b('0x44')]['find']({'where':{'id':_0x314681[_0xf27b('0x5d')]['id']}})['then'](handleEntityNotFound(_0x581926,null))[_0xf27b('0x3a')](function(_0x18cff4){if(_0x18cff4){_0x314681[_0xf27b('0x62')]['OpenchannelAccountId']=_0x18cff4['id'];return db[_0xf27b('0x6d')][_0xf27b('0x61')](_0x314681[_0xf27b('0x62')]);}})[_0xf27b('0x3a')](respondWithResult(_0x581926,null))[_0xf27b('0x60')](handleError(_0x581926,null));};exports['getDispositions']=function(_0x906b83,_0x2e6ab8,_0xeba5ca){var _0x26da8c={'raw':![],'where':{}};var _0x2b9165={};var _0xc89047={'count':0x0,'rows':[]};return db[_0xf27b('0x44')][_0xf27b('0x6e')]({'where':{'id':_0x906b83[_0xf27b('0x5d')]['id']}})[_0xf27b('0x3a')](handleEntityNotFound(_0x2e6ab8,null))[_0xf27b('0x3a')](function(_0x4468f9){if(_0x4468f9){_0x2b9165['model']=_['keys'](db[_0xf27b('0x6d')][_0xf27b('0x45')]);_0x2b9165[_0xf27b('0x4a')]=_[_0xf27b('0x5e')](_0x906b83['query']);_0x2b9165[_0xf27b('0x4b')]=_[_0xf27b('0x4c')](_0x2b9165[_0xf27b('0x48')],_0x2b9165[_0xf27b('0x4a')]);_0x26da8c[_0xf27b('0x4d')]=_[_0xf27b('0x4c')](_0x2b9165[_0xf27b('0x48')],qs[_0xf27b('0x4e')](_0x906b83[_0xf27b('0x4a')]['fields']));_0x26da8c[_0xf27b('0x4d')]=_0x26da8c[_0xf27b('0x4d')][_0xf27b('0x4f')]?_0x26da8c[_0xf27b('0x4d')]:_0x2b9165[_0xf27b('0x48')];if(!_0x906b83[_0xf27b('0x4a')]['hasOwnProperty'](_0xf27b('0x51'))){_0x26da8c[_0xf27b('0x33')]=qs[_0xf27b('0x33')](_0x906b83['query'][_0xf27b('0x33')]);_0x26da8c[_0xf27b('0x31')]=qs[_0xf27b('0x31')](_0x906b83['query']['offset']);}_0x26da8c[_0xf27b('0x6f')]=qs['sort'](_0x906b83[_0xf27b('0x4a')]['sort']);_0x26da8c[_0xf27b('0x53')]=qs[_0xf27b('0x4b')](_[_0xf27b('0x54')](_0x906b83[_0xf27b('0x4a')],_0x2b9165[_0xf27b('0x4b')]));_0x26da8c[_0xf27b('0x53')][_0xf27b('0x70')]=_0x4468f9['id'];if(_0x906b83[_0xf27b('0x4a')][_0xf27b('0x55')]){_0x26da8c[_0xf27b('0x53')]=_['merge'](_0x26da8c[_0xf27b('0x53')],{'$or':_[_0xf27b('0x49')](_0x26da8c[_0xf27b('0x4d')],function(_0x3e2cb5){var _0x78efc7={};_0x78efc7[_0x3e2cb5]={'$like':'%'+_0x906b83[_0xf27b('0x4a')][_0xf27b('0x55')]+'%'};return _0x78efc7;})});}_0x26da8c=_[_0xf27b('0x56')]({},_0x26da8c,_0x906b83[_0xf27b('0x58')]);return db[_0xf27b('0x6d')]['count']({'where':_0x26da8c[_0xf27b('0x53')]})[_0xf27b('0x3a')](function(_0x4eaa6b){_0xc89047[_0xf27b('0x34')]=_0x4eaa6b;if(_0x906b83[_0xf27b('0x4a')][_0xf27b('0x59')]){_0x26da8c['include']=[{'all':!![]}];}return db[_0xf27b('0x6d')][_0xf27b('0x5a')](_0x26da8c);})[_0xf27b('0x3a')](function(_0x4de258){_0xc89047[_0xf27b('0x5b')]=_0x4de258;return _0xc89047;});}})[_0xf27b('0x3a')](respondWithFilteredResult(_0x2e6ab8,_0x26da8c))[_0xf27b('0x60')](handleError(_0x2e6ab8,null));};exports[_0xf27b('0x71')]=function(_0x554d97,_0x5caf45,_0x11a101){return db[_0xf27b('0x44')][_0xf27b('0x67')]({'where':{'id':_0x554d97[_0xf27b('0x5d')]['id']}})[_0xf27b('0x3a')](handleEntityNotFound(_0x5caf45,null))['then'](function(_0x20c747){if(_0x20c747){return _0x20c747[_0xf27b('0x71')](_0x554d97['query'][_0xf27b('0x72')]);}})[_0xf27b('0x3a')](respondWithStatusCode(_0x5caf45,null))['catch'](handleError(_0x5caf45,null));};exports['addAnswer']=function(_0x591db4,_0x17f3a4,_0x4fc5bc){if(_0x591db4[_0xf27b('0x62')]['id']){delete _0x591db4['body']['id'];}return db[_0xf27b('0x44')]['find']({'where':{'id':_0x591db4[_0xf27b('0x5d')]['id']}})[_0xf27b('0x3a')](handleEntityNotFound(_0x17f3a4,null))['then'](function(_0x5da1c2){if(_0x5da1c2){_0x591db4['body'][_0xf27b('0x70')]=_0x5da1c2['id'];return db['CannedAnswer'][_0xf27b('0x61')](_0x591db4[_0xf27b('0x62')]);}})[_0xf27b('0x3a')](respondWithResult(_0x17f3a4,null))['catch'](handleError(_0x17f3a4,null));};exports['getAnswers']=function(_0x593508,_0x468c78,_0x4ad94a){var _0x11be44={'raw':![],'where':{}};var _0x3b1543={};var _0x191a01={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xf27b('0x6e')]({'where':{'id':_0x593508[_0xf27b('0x5d')]['id']}})['then'](handleEntityNotFound(_0x468c78,null))['then'](function(_0x4f3e85){if(_0x4f3e85){_0x3b1543[_0xf27b('0x48')]=_[_0xf27b('0x5e')](db[_0xf27b('0x73')]['rawAttributes']);_0x3b1543[_0xf27b('0x4a')]=_[_0xf27b('0x5e')](_0x593508[_0xf27b('0x4a')]);_0x3b1543['filters']=_[_0xf27b('0x4c')](_0x3b1543[_0xf27b('0x48')],_0x3b1543['query']);_0x11be44['attributes']=_['intersection'](_0x3b1543[_0xf27b('0x48')],qs['fields'](_0x593508[_0xf27b('0x4a')]['fields']));_0x11be44['attributes']=_0x11be44[_0xf27b('0x4d')]['length']?_0x11be44[_0xf27b('0x4d')]:_0x3b1543[_0xf27b('0x48')];if(!_0x593508[_0xf27b('0x4a')][_0xf27b('0x50')](_0xf27b('0x51'))){_0x11be44[_0xf27b('0x33')]=qs[_0xf27b('0x33')](_0x593508[_0xf27b('0x4a')][_0xf27b('0x33')]);_0x11be44[_0xf27b('0x31')]=qs[_0xf27b('0x31')](_0x593508[_0xf27b('0x4a')][_0xf27b('0x31')]);}_0x11be44[_0xf27b('0x6f')]=qs['sort'](_0x593508[_0xf27b('0x4a')]['sort']);_0x11be44[_0xf27b('0x53')]=qs[_0xf27b('0x4b')](_[_0xf27b('0x54')](_0x593508[_0xf27b('0x4a')],_0x3b1543['filters']));_0x11be44[_0xf27b('0x53')][_0xf27b('0x70')]=_0x4f3e85['id'];if(_0x593508['query'][_0xf27b('0x55')]){_0x11be44['where']=_[_0xf27b('0x56')](_0x11be44[_0xf27b('0x53')],{'$or':_['map'](_0x11be44[_0xf27b('0x4d')],function(_0x248619){var _0x14cb71={};_0x14cb71[_0x248619]={'$like':'%'+_0x593508[_0xf27b('0x4a')][_0xf27b('0x55')]+'%'};return _0x14cb71;})});}_0x11be44=_['merge']({},_0x11be44,_0x593508[_0xf27b('0x58')]);return db[_0xf27b('0x73')][_0xf27b('0x34')]({'where':_0x11be44['where']})[_0xf27b('0x3a')](function(_0x1c57a8){_0x191a01['count']=_0x1c57a8;if(_0x593508[_0xf27b('0x4a')][_0xf27b('0x59')]){_0x11be44['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xf27b('0x5a')](_0x11be44);})['then'](function(_0x5e48d2){_0x191a01['rows']=_0x5e48d2;return _0x191a01;});}})['then'](respondWithFilteredResult(_0x468c78,_0x11be44))[_0xf27b('0x60')](handleError(_0x468c78,null));};exports[_0xf27b('0x74')]=function(_0x5ed024,_0x4bc73d,_0x1f4aaf){return db['OpenchannelAccount'][_0xf27b('0x67')]({'where':{'id':_0x5ed024[_0xf27b('0x5d')]['id']}})[_0xf27b('0x3a')](handleEntityNotFound(_0x4bc73d,null))[_0xf27b('0x3a')](function(_0x494b81){if(_0x494b81){return _0x494b81['removeAnswers'](_0x5ed024[_0xf27b('0x4a')][_0xf27b('0x72')]);}})[_0xf27b('0x3a')](respondWithStatusCode(_0x4bc73d,null))['catch'](handleError(_0x4bc73d,null));};exports[_0xf27b('0x75')]=function(_0x496298,_0x47c2b8,_0x30b892){var _0x20bcc7={'body':_0x496298['body'],'channel':_0xf27b('0x76')};var _0x222a8b=[];var _0x509fb2=[];var _0x5d269e={};var _0xb191b7=![];return db['CmContact']['describe']()[_0xf27b('0x3a')](function(_0x25d710){if(!_0x25d710){throw new db['Sequelize'][(_0xf27b('0x77'))](_0xf27b('0x78'));}_0x222a8b=_['difference'](_[_0xf27b('0x5e')](_0x25d710),['createdAt','updatedAt']);_0x509fb2=_[_0xf27b('0x79')](_[_0xf27b('0x5e')](_0x25d710),['createdAt',_0xf27b('0x7a'),_0xf27b('0x7b'),_0xf27b('0x7c')]);if(_0x496298[_0xf27b('0x62')]['id']){delete _0x496298['body']['id'];}if(_[_0xf27b('0x7d')](_0x496298['body'][_0xf27b('0x7e')])){throw new db[(_0xf27b('0x7f'))][(_0xf27b('0x77'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x496298[_0xf27b('0x62')][_0xf27b('0x62')])||_0x496298[_0xf27b('0x62')]['body']===''){throw new db[(_0xf27b('0x7f'))][(_0xf27b('0x77'))](_0xf27b('0x80'));}if(_['isNil'](_0x496298[_0xf27b('0x62')][_0xf27b('0x81')])){throw new db[(_0xf27b('0x7f'))][(_0xf27b('0x77'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x509fb2);}if(!_['includes'](_0x509fb2,_0x496298['body']['mapKey'])){throw new db[(_0xf27b('0x7f'))][(_0xf27b('0x77'))](_0xf27b('0x82')+_0x509fb2);}_0x5d269e[_0x496298[_0xf27b('0x62')][_0xf27b('0x81')]]=_0x496298[_0xf27b('0x62')][_0xf27b('0x7e')];})[_0xf27b('0x3a')](function(){return db[_0xf27b('0x44')][_0xf27b('0x67')]({'where':{'id':_0x496298[_0xf27b('0x5d')]['id']},'include':[{'model':db[_0xf27b('0x83')],'as':_0xf27b('0x84'),'include':[{'model':db[_0xf27b('0x85')],'as':_0xf27b('0x86'),'where':_0x5d269e,'limit':0x1,'order':[[_0xf27b('0x7a'),_0xf27b('0x87')]]}]},{'model':db[_0xf27b('0x88')],'as':_0xf27b('0x89')}]});})['then'](handleEntityNotFound(_0x47c2b8,null))['then'](function(_0x69aab6){if(_0x69aab6&&_0x69aab6[_0xf27b('0x84')]){_0x20bcc7[_0xf27b('0x8a')]=_0x69aab6;_0x20bcc7[_0xf27b('0x8b')]=_0x69aab6[_0xf27b('0x89')];_0x20bcc7[_0xf27b('0x8c')]=_0x69aab6[_0xf27b('0x84')];_0x20bcc7[_0xf27b('0x8b')]=_['orderBy'](_0x20bcc7['applications'],[_0xf27b('0x8d')],[_0xf27b('0x8e')]);if(_0x20bcc7[_0xf27b('0x8a')][_0xf27b('0x89')]){delete _0x20bcc7[_0xf27b('0x8a')][_0xf27b('0x89')];}if(_0x20bcc7[_0xf27b('0x8a')][_0xf27b('0x84')]&&_0x20bcc7['account'][_0xf27b('0x84')][_0xf27b('0x86')]['length']){return _0x20bcc7[_0xf27b('0x8a')]['List'][_0xf27b('0x86')][0x0];}var _0x5eacca=_[_0xf27b('0x1c')](_0x496298[_0xf27b('0x62')],{'firstName':_0x496298[_0xf27b('0x62')][_0xf27b('0x7e')],'ListId':_0x69aab6[_0xf27b('0x7c')]});_0x5eacca[_0x496298[_0xf27b('0x62')]['mapKey']]=_0x496298[_0xf27b('0x62')][_0xf27b('0x7e')];return db[_0xf27b('0x85')][_0xf27b('0x61')](_0x5eacca,{'fields':_0x222a8b,'raw':!![]});}})[_0xf27b('0x3a')](handleEntityNotFound(_0x47c2b8,null))['then'](function(_0x486573){_0x20bcc7[_0xf27b('0x8f')]=_0x486573;if(_0x486573){var _0x277297={'ContactId':_0x486573['id'],'OpenchannelAccountId':_0x496298[_0xf27b('0x5d')]['id'],'from':(_0x486573[_0xf27b('0x90')]||'')+'\x20'+(_0x486573[_0xf27b('0x91')]||'')};var _0x3298a4={'OpenchannelAccountId':_0x496298[_0xf27b('0x5d')]['id'],'closed':![]};if(_0x496298[_0xf27b('0x62')][_0xf27b('0x92')]){_0x3298a4[_0xf27b('0x92')]=_0x496298[_0xf27b('0x62')]['threadId'];return db[_0xf27b('0x93')][_0xf27b('0x67')]({'where':_0x3298a4})[_0xf27b('0x3a')](function(_0x3fa476){if(_0x3fa476){return[_0x3fa476,![]];}_0x277297[_0xf27b('0x92')]=_0x496298['body']['threadId'];_0x277297[_0xf27b('0x94')]=_0x496298['body']['externalUrl'];return db[_0xf27b('0x93')][_0xf27b('0x61')](_0x277297)[_0xf27b('0x3a')](function(_0x590177){return[_0x590177,!![]];});});}else{_0x3298a4[_0xf27b('0x92')]=null;}_0x3298a4[_0xf27b('0x95')]=_0x486573['id'];return db[_0xf27b('0x93')][_0xf27b('0x67')]({'where':_0x3298a4})[_0xf27b('0x3a')](function(_0x6c21e6){if(_0x6c21e6){return[_0x6c21e6,![]];}return db[_0xf27b('0x93')][_0xf27b('0x61')](_0x277297)[_0xf27b('0x3a')](function(_0x7937eb){return[_0x7937eb,!![]];});});}})[_0xf27b('0x96')](function(_0xab169d,_0x285d34){if(_0xab169d){_0xb191b7=_0x285d34;if(!_0x285d34){var _0x40f489={'from':(_0x20bcc7['contact'][_0xf27b('0x90')]||'')+'\x20'+(_0x20bcc7[_0xf27b('0x8f')]['lastName']||'')};if(_0x496298[_0xf27b('0x62')][_0xf27b('0x92')]&&_0x496298[_0xf27b('0x62')]['messageId']&&_0x496298['body'][_0xf27b('0x92')]!=_0x496298['body'][_0xf27b('0x97')]){_0x40f489['threadId']=_0x496298[_0xf27b('0x62')][_0xf27b('0x97')];}return _0xab169d[_0xf27b('0x39')](_0x40f489);}else{return _0xab169d;}}})[_0xf27b('0x3a')](function(_0x1acfeb){_0x20bcc7[_0xf27b('0x98')]=_0x1acfeb[_0xf27b('0x64')]({'plain':!![]});_0x20bcc7[_0xf27b('0x98')][_0xf27b('0x99')]=_0xb191b7;if(_0x20bcc7[_0xf27b('0x98')][_0xf27b('0x99')]){if(_0x20bcc7[_0xf27b('0x8a')]['autoclose']){_0x20bcc7[_0xf27b('0x8b')][_0xf27b('0x9a')]({'id':0x0,'priority':_0x20bcc7['applications']['length']+0x1,'app':'close','appdata':_0xf27b('0x9b'),'interval':_0xf27b('0x9c')});}}return db['OpenchannelMessage'][_0xf27b('0x61')]({'body':_0x496298['body'][_0xf27b('0x62')],'OpenchannelAccountId':_0x496298[_0xf27b('0x5d')]['id'],'OpenchannelInteractionId':_0x1acfeb['id'],'direction':'in','ContactId':_0x20bcc7[_0xf27b('0x8f')]['id'],'AttachmentId':_0x496298[_0xf27b('0x62')][_0xf27b('0x9d')]});})[_0xf27b('0x3a')](function(_0x54026f){_0x20bcc7[_0xf27b('0x2c')]=_0x54026f;if(_0x20bcc7[_0xf27b('0x98')][_0xf27b('0x9e')]){return db['User']['find']({'attributes':['id',_0xf27b('0x3f')],'where':{'id':_0x20bcc7[_0xf27b('0x98')][_0xf27b('0x9e')]}})[_0xf27b('0x3a')](function(_0x1e16ac){if(_0x1e16ac){_0x20bcc7[_0xf27b('0x8b')][_0xf27b('0x9f')]({'id':0x0,'priority':0x0,'app':_0xf27b('0xa0'),'appdata':_0x1e16ac[_0xf27b('0x3f')]+','+(_0x20bcc7['account']['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x20bcc7[_0xf27b('0xa1')]=![];}return respondWithRpcPromise(_0xf27b('0xa2'),_0xf27b('0xa3'),_0x20bcc7);});}return respondWithRpcPromise(_0xf27b('0xa2'),_0xf27b('0xa3'),_0x20bcc7);})['then'](function(_0x48e0ad){respondWithRpcPromise(_0xf27b('0xa4'),_0xf27b('0xa4'),{'event':_0xf27b('0x75'),'message':_0x48e0ad},client9002);return _0x48e0ad;})[_0xf27b('0x3a')](respondWithResult(_0x47c2b8,null))[_0xf27b('0x60')](handleError(_0x47c2b8,null));};exports[_0xf27b('0xa5')]=function(_0x12cdee,_0x39053f){var _0x83dd3a=_0x12cdee['params']['id'];var _0x5da548=_0x12cdee[_0xf27b('0x62')];var _0x46ffb3=0xc8;var _0x577394=null;return db[_0xf27b('0xa6')][_0xf27b('0xa7')]({'isolationLevel':db['sequelize'][_0xf27b('0xa8')][_0xf27b('0xa9')]['READ_COMMITTED']},function(_0x544cd4){return db[_0xf27b('0x44')]['findOne']({'where':{'id':_0x83dd3a},'transaction':_0x544cd4})['then'](function(_0x137156){if(_0x137156){return db[_0xf27b('0x88')][_0xf27b('0x3b')]({'where':{'OpenchannelAccountId':_0x83dd3a},'transaction':_0x544cd4})[_0xf27b('0x3a')](function(){var _0xf6dcd9=_[_0xf27b('0x49')](_0x5da548,function(_0x3cccd7){_0x3cccd7['OpenchannelAccountId']=_0x83dd3a;return _0x3cccd7;});return db[_0xf27b('0x88')][_0xf27b('0xaa')](_0xf6dcd9,{'transaction':_0x544cd4});});}else{_0x46ffb3=0x194;_0x577394=[];}});})[_0xf27b('0x3a')](function(){if(_0x46ffb3!==0x194){return db[_0xf27b('0x88')][_0xf27b('0xab')]({'where':{'OpenchannelAccountId':_0x83dd3a},'order':_0xf27b('0x8d')})[_0xf27b('0x3a')](function(_0x698412){_0x577394=_0x698412;});}})[_0xf27b('0x60')](function(_0x40be7e){_0x46ffb3=0x1f4;logger[_0xf27b('0x2a')](_0x40be7e[_0xf27b('0x3e')]);if(_0x40be7e[_0xf27b('0x3f')]){delete _0x40be7e[_0xf27b('0x3f')];}_0x577394=_0x40be7e;})[_0xf27b('0xac')](function(){if(_0x577394===null){_0x39053f[_0xf27b('0x2e')](_0x46ffb3);}else{if(_0x46ffb3===0x1f4){_0x39053f['status'](_0x46ffb3)[_0xf27b('0x40')](_0x577394);}else{_0x39053f['status'](_0x46ffb3)[_0xf27b('0x30')](_0x577394);}}});};exports[_0xf27b('0xad')]=function(_0x52abb6,_0x1bdf9c,_0x35cd99){var _0x38153c={};var _0x27f3de={};var _0x29e5b1;var _0x18683b;return db[_0xf27b('0x44')][_0xf27b('0x6e')]({'where':{'id':_0x52abb6[_0xf27b('0x5d')]['id']}})[_0xf27b('0x3a')](handleEntityNotFound(_0x1bdf9c,null))[_0xf27b('0x3a')](function(_0x583737){if(_0x583737){_0x29e5b1=_0x583737;_0x27f3de['model']=_['keys'](db[_0xf27b('0x88')][_0xf27b('0x45')]);_0x27f3de[_0xf27b('0x4a')]=_[_0xf27b('0x5e')](_0x52abb6[_0xf27b('0x4a')]);_0x27f3de[_0xf27b('0x4b')]=_[_0xf27b('0x4c')](_0x27f3de[_0xf27b('0x48')],_0x27f3de[_0xf27b('0x4a')]);_0x38153c[_0xf27b('0x4d')]=_['intersection'](_0x27f3de[_0xf27b('0x48')],qs[_0xf27b('0x4e')](_0x52abb6[_0xf27b('0x4a')]['fields']));_0x38153c[_0xf27b('0x4d')]=_0x38153c['attributes'][_0xf27b('0x4f')]?_0x38153c[_0xf27b('0x4d')]:_0x27f3de[_0xf27b('0x48')];_0x38153c[_0xf27b('0x6f')]=qs['sort'](_0x52abb6['query'][_0xf27b('0x52')]);_0x38153c[_0xf27b('0x53')]=qs['filters'](_['pick'](_0x52abb6[_0xf27b('0x4a')],_0x27f3de['filters']));if(_0x52abb6[_0xf27b('0x4a')][_0xf27b('0x55')]){_0x38153c[_0xf27b('0x53')]=_[_0xf27b('0x56')](_0x38153c[_0xf27b('0x53')],{'$or':_[_0xf27b('0x49')](_0x38153c['attributes'],function(_0x482d63){var _0x505a6d={};_0x505a6d[_0x482d63]={'$like':'%'+_0x52abb6['query']['filter']+'%'};return _0x505a6d;})});}_0x38153c=_[_0xf27b('0x56')]({},_0x38153c,_0x52abb6['options']);return _0x29e5b1['getApplications'](_0x38153c);}})[_0xf27b('0x3a')](function(_0x19e0cc){if(_0x19e0cc){_0x18683b=_0x19e0cc[_0xf27b('0x4f')];if(!_0x52abb6[_0xf27b('0x4a')][_0xf27b('0x50')](_0xf27b('0x51'))){_0x38153c['limit']=qs[_0xf27b('0x33')](_0x52abb6[_0xf27b('0x4a')][_0xf27b('0x33')]);_0x38153c[_0xf27b('0x31')]=qs[_0xf27b('0x31')](_0x52abb6[_0xf27b('0x4a')][_0xf27b('0x31')]);}return _0x29e5b1[_0xf27b('0xad')](_0x38153c);}})[_0xf27b('0x3a')](function(_0x23584d){if(_0x23584d){return _0x23584d?{'count':_0x18683b,'rows':_0x23584d}:null;}})[_0xf27b('0x3a')](respondWithResult(_0x1bdf9c,null))[_0xf27b('0x60')](handleError(_0x1bdf9c,null));};exports['getInteractions']=function(_0x376ea6,_0x2d10f1,_0x2a8e09){var _0x50228f={'raw':![],'where':{}};var _0x185e61={};var _0x1d8a04={'count':0x0,'rows':[]};return db[_0xf27b('0x44')][_0xf27b('0x6e')]({'where':{'id':_0x376ea6[_0xf27b('0x5d')]['id']}})[_0xf27b('0x3a')](handleEntityNotFound(_0x2d10f1,null))[_0xf27b('0x3a')](function(_0x2e0466){if(_0x2e0466){_0x185e61[_0xf27b('0x48')]=_[_0xf27b('0x5e')](db['OpenchannelInteraction'][_0xf27b('0x45')]);_0x185e61[_0xf27b('0x4a')]=_[_0xf27b('0x5e')](_0x376ea6[_0xf27b('0x4a')]);_0x185e61['filters']=_['intersection'](_0x185e61[_0xf27b('0x48')],_0x185e61[_0xf27b('0x4a')]);_0x50228f[_0xf27b('0x4d')]=_[_0xf27b('0x4c')](_0x185e61[_0xf27b('0x48')],qs[_0xf27b('0x4e')](_0x376ea6[_0xf27b('0x4a')]['fields']));_0x50228f[_0xf27b('0x4d')]=_0x50228f[_0xf27b('0x4d')][_0xf27b('0x4f')]?_0x50228f[_0xf27b('0x4d')]:_0x185e61[_0xf27b('0x48')];if(!_0x376ea6[_0xf27b('0x4a')][_0xf27b('0x50')](_0xf27b('0x51'))){_0x50228f[_0xf27b('0x33')]=qs[_0xf27b('0x33')](_0x376ea6[_0xf27b('0x4a')][_0xf27b('0x33')]);_0x50228f[_0xf27b('0x31')]=qs[_0xf27b('0x31')](_0x376ea6[_0xf27b('0x4a')]['offset']);}_0x50228f[_0xf27b('0x6f')]=qs[_0xf27b('0x52')](_0x376ea6[_0xf27b('0x4a')][_0xf27b('0x52')]);_0x50228f['where']=qs['filters'](_[_0xf27b('0x54')](_0x376ea6[_0xf27b('0x4a')],_0x185e61[_0xf27b('0x4b')]));_0x50228f['where']['OpenchannelAccountId']=_0x2e0466['id'];if(_0x376ea6[_0xf27b('0x4a')]['filter']){_0x50228f[_0xf27b('0x53')]=_[_0xf27b('0x56')](_0x50228f['where'],{'$or':_['map'](_0x50228f[_0xf27b('0x4d')],function(_0x1670a2){var _0x3f93c1={};_0x3f93c1[_0x1670a2]={'$like':'%'+_0x376ea6[_0xf27b('0x4a')][_0xf27b('0x55')]+'%'};return _0x3f93c1;})});}_0x50228f=_['merge']({},_0x50228f,_0x376ea6[_0xf27b('0x58')]);return db[_0xf27b('0x93')][_0xf27b('0x34')]({'where':_0x50228f[_0xf27b('0x53')]})[_0xf27b('0x3a')](function(_0x398f09){_0x1d8a04['count']=_0x398f09;if(_0x376ea6[_0xf27b('0x4a')]['includeAll']){_0x50228f['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xf27b('0xae')],'as':'Owner','attributes':[_0xf27b('0x3f'),'fullname',_0xf27b('0xaf')],'required':![]},{'model':db[_0xf27b('0xb0')],'as':_0xf27b('0xb1'),'attributes':['id','name',_0xf27b('0xb2')],'where':_0x376ea6[_0xf27b('0x4a')]['tag']?{'id':_0x376ea6[_0xf27b('0x4a')][_0xf27b('0xb3')]}:undefined,'required':_0x376ea6[_0xf27b('0x4a')][_0xf27b('0xb3')]?!![]:![]}];}return db[_0xf27b('0x93')]['findAll'](_0x50228f);})[_0xf27b('0x3a')](function(_0x3fd4f9){_0x1d8a04[_0xf27b('0x5b')]=_0x3fd4f9;return _0x1d8a04;});}})['then'](respondWithFilteredResult(_0x2d10f1,_0x50228f))[_0xf27b('0x60')](handleError(_0x2d10f1,null));};exports[_0xf27b('0xb4')]=function(_0xda56b5,_0x36b8ce,_0x42f0b3){return db['OpenchannelAccount'][_0xf27b('0x67')]({'where':{'id':_0xda56b5[_0xf27b('0x5d')]['id']}})[_0xf27b('0x3a')](handleEntityNotFound(_0x36b8ce,null))[_0xf27b('0x3a')](function(_0x4d8663){if(_0x4d8663){return _0x4d8663[_0xf27b('0xb4')](_0xda56b5[_0xf27b('0x62')][_0xf27b('0x72')],_[_0xf27b('0xb5')](_0xda56b5[_0xf27b('0x62')],[_0xf27b('0x72'),'id'])||{})['spread'](function(_0x5ed9ee){for(var _0x5cfae5=0x0;_0x5cfae5<_0xda56b5['body'][_0xf27b('0x72')][_0xf27b('0x4f')];_0x5cfae5+=0x1){socket[_0xf27b('0xb6')](_0xf27b('0xb7'),{'UserId':Number(_0xda56b5[_0xf27b('0x62')][_0xf27b('0x72')][_0x5cfae5]),'OpenchannelAccountId':Number(_0xda56b5[_0xf27b('0x5d')]['id'])});}return _0x5ed9ee;});}})[_0xf27b('0x3a')](respondWithResult(_0x36b8ce,null))[_0xf27b('0x60')](handleError(_0x36b8ce,null));};exports[_0xf27b('0xb8')]=function(_0x5eec84,_0x52ea0d,_0x414a99){return db[_0xf27b('0x44')][_0xf27b('0x67')]({'where':{'id':_0x5eec84[_0xf27b('0x5d')]['id']}})['then'](handleEntityNotFound(_0x52ea0d,null))['then'](function(_0x545be9){if(_0x545be9){return _0x545be9[_0xf27b('0xb8')](_0x5eec84[_0xf27b('0x4a')]['ids'])['then'](function(){if(_[_0xf27b('0xb9')](_0x5eec84['query'][_0xf27b('0x72')])){for(var _0x19621f=0x0;_0x19621f<_0x5eec84['query']['ids']['length'];_0x19621f+=0x1){socket[_0xf27b('0xb6')]('userOpenchannelAccount:remove',{'UserId':Number(_0x5eec84[_0xf27b('0x4a')][_0xf27b('0x72')][_0x19621f]),'OpenchannelAccountId':Number(_0x5eec84[_0xf27b('0x5d')]['id'])});}}else{socket[_0xf27b('0xb6')](_0xf27b('0xba'),{'UserId':Number(_0x5eec84[_0xf27b('0x4a')][_0xf27b('0x72')]),'OpenchannelAccountId':Number(_0x5eec84['params']['id'])});}});}})[_0xf27b('0x3a')](respondWithStatusCode(_0x52ea0d,null))[_0xf27b('0x60')](handleError(_0x52ea0d,null));};exports['getAgents']=function(_0x4c452,_0xa5cbf2,_0x2a24ae){var _0x1ca0e2={};var _0x526cc5={};var _0x26c923;var _0x195f15;return db[_0xf27b('0x44')][_0xf27b('0x6e')]({'where':{'id':_0x4c452[_0xf27b('0x5d')]['id']}})[_0xf27b('0x3a')](handleEntityNotFound(_0xa5cbf2,null))['then'](function(_0x46b416){if(_0x46b416){_0x26c923=_0x46b416;_0x526cc5[_0xf27b('0x48')]=_[_0xf27b('0x5e')](db['User'][_0xf27b('0x45')]);_0x526cc5['query']=_[_0xf27b('0x5e')](_0x4c452[_0xf27b('0x4a')]);_0x526cc5[_0xf27b('0x4b')]=_[_0xf27b('0x4c')](_0x526cc5['model'],_0x526cc5['query']);_0x1ca0e2[_0xf27b('0x4d')]=_[_0xf27b('0x4c')](_0x526cc5[_0xf27b('0x48')],qs['fields'](_0x4c452[_0xf27b('0x4a')][_0xf27b('0x4e')]));_0x1ca0e2['attributes']=_0x1ca0e2['attributes'][_0xf27b('0x4f')]?_0x1ca0e2[_0xf27b('0x4d')]:_0x526cc5[_0xf27b('0x48')];_0x1ca0e2[_0xf27b('0x6f')]=qs[_0xf27b('0x52')](_0x4c452[_0xf27b('0x4a')]['sort']);_0x1ca0e2['where']=qs[_0xf27b('0x4b')](_[_0xf27b('0x54')](_0x4c452['query'],_0x526cc5[_0xf27b('0x4b')]));if(_0x4c452['query'][_0xf27b('0x55')]){_0x1ca0e2[_0xf27b('0x53')]=_[_0xf27b('0x56')](_0x1ca0e2[_0xf27b('0x53')],{'$or':_[_0xf27b('0x49')](_0x1ca0e2['attributes'],function(_0x423344){var _0x180bba={};_0x180bba[_0x423344]={'$like':'%'+_0x4c452[_0xf27b('0x4a')][_0xf27b('0x55')]+'%'};return _0x180bba;})});}_0x1ca0e2=_[_0xf27b('0x56')]({},_0x1ca0e2,_0x4c452[_0xf27b('0x58')]);return _0x26c923[_0xf27b('0xbb')](_0x1ca0e2);}})['then'](function(_0x37de80){if(_0x37de80){_0x195f15=_0x37de80[_0xf27b('0x4f')];if(!_0x4c452[_0xf27b('0x4a')][_0xf27b('0x50')](_0xf27b('0x51'))){_0x1ca0e2['limit']=qs['limit'](_0x4c452['query'][_0xf27b('0x33')]);_0x1ca0e2['offset']=qs['offset'](_0x4c452[_0xf27b('0x4a')][_0xf27b('0x31')]);}return _0x26c923[_0xf27b('0xbb')](_0x1ca0e2);}})[_0xf27b('0x3a')](function(_0x504a36){if(_0x504a36){return _0x504a36?{'count':_0x195f15,'rows':_0x504a36}:null;}})[_0xf27b('0x3a')](respondWithResult(_0xa5cbf2,null))[_0xf27b('0x60')](handleError(_0xa5cbf2,null));};exports[_0xf27b('0x40')]=function(_0x45b0f4,_0x44dd2f,_0x4df56e){var _0x5288d7,_0x287d1f,_0x5ea651;if(_[_0xf27b('0x7d')](_0x45b0f4[_0xf27b('0x62')]['body'])||_0x45b0f4[_0xf27b('0x62')]['body']===''){throw new db[(_0xf27b('0x7f'))][(_0xf27b('0x77'))](_0xf27b('0x80'));}if(_[_0xf27b('0x7d')](_0x45b0f4[_0xf27b('0x62')]['to'])){}_0x5288d7=_0x45b0f4[_0xf27b('0x62')]['to'];return db[_0xf27b('0x44')][_0xf27b('0x6e')]({'where':{'id':_0x45b0f4['params']['id']}})[_0xf27b('0x3a')](handleEntityNotFound(_0x44dd2f,null))[_0xf27b('0x3a')](function(_0x37b2cb){if(_0x37b2cb){return db[_0xf27b('0x44')][_0xf27b('0x67')]({'where':{'id':_0x37b2cb['id']},'include':[{'model':db['CmList'],'as':_0xf27b('0x84'),'include':[{'model':db[_0xf27b('0x85')],'as':_0xf27b('0x86'),'where':{[_0x37b2cb[_0xf27b('0x81')]]:_0x5288d7},'limit':0x1,'order':[[_0xf27b('0x7a'),'DESC']]}]}]})[_0xf27b('0x3a')](handleEntityNotFound(_0x44dd2f,null))[_0xf27b('0x3a')](function(_0x377f66){if(_0x377f66&&_0x377f66[_0xf27b('0x84')]){_0x287d1f=_0x377f66[_0xf27b('0x64')]({'plain':!![]});if(_0x287d1f['List']&&_0x287d1f['List'][_0xf27b('0x86')][_0xf27b('0x4f')]){return _0x287d1f[_0xf27b('0x84')][_0xf27b('0x86')][0x0];}return db[_0xf27b('0x85')][_0xf27b('0x61')](_['defaults'](_0x45b0f4[_0xf27b('0x62')],{'firstName':_0x5288d7,[_0x377f66['mapKey']]:_0x5288d7,'phone':_0x5288d7,'ListId':_0x287d1f[_0xf27b('0x7c')]}));}})['then'](handleEntityNotFound(_0x44dd2f,null))[_0xf27b('0x3a')](function(_0x576eef){if(_0x576eef){_0x5ea651=_0x576eef;return db['OpenchannelInteraction'][_0xf27b('0x67')]({'where':{'ContactId':_0x5ea651['id'],'closed':![],'OpenchannelAccountId':_0x287d1f['id']}})[_0xf27b('0x3a')](function(_0x244e1c){if(_0x244e1c){return[_0x244e1c,![]];}return db[_0xf27b('0x93')][_0xf27b('0x61')]({'UserId':_0x45b0f4[_0xf27b('0x63')]['id'],'ContactId':_0x5ea651['id'],'OpenchannelAccountId':_0x287d1f['id'],'lastMsgDirection':_0xf27b('0xbc'),'firstMsgDirection':_0xf27b('0xbc'),'Messages':[_['merge'](_0x45b0f4['body'],{'read':![],'body':_0x45b0f4[_0xf27b('0x62')][_0xf27b('0x62')],'OpenchannelAccountId':_0x287d1f['id'],'UserId':_0x45b0f4[_0xf27b('0x63')]['id'],'ContactId':_0x5ea651['id']})]},{'include':[{'model':db[_0xf27b('0xbd')],'as':_0xf27b('0xbe')}]})['then'](function(_0x3f4c2c){return[_0x3f4c2c,!![]];});});}})[_0xf27b('0x96')](function(_0x182e03,_0x5bbecb){if(_0x5bbecb){return _0x182e03;}return db['OpenchannelMessage']['create'](_[_0xf27b('0x56')](_0x45b0f4[_0xf27b('0x62')],{'read':![],'body':_0x45b0f4['body']['body'],'OpenchannelAccountId':_0x287d1f['id'],'OpenchannelInteractionId':_0x182e03['id'],'UserId':_0x45b0f4[_0xf27b('0x63')]['id'],'ContactId':_0x5ea651['id']}))['then'](function(_0x11b51d){_0x182e03['dataValues'][_0xf27b('0xbe')]=[];_0x182e03['dataValues'][_0xf27b('0xbe')][_0xf27b('0x9a')](_0x11b51d[_0xf27b('0xbf')]);return _0x182e03;});});}})[_0xf27b('0x3a')](respondWithResult(_0x44dd2f,null))[_0xf27b('0x60')](handleError(_0x44dd2f,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 674f67c..be88163 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 _0xa74f=['remove','hasOwnProperty','hook','exports','OpenchannelAccount','update'];(function(_0xba274,_0x20a193){var _0x2e7efc=function(_0x570e59){while(--_0x570e59){_0xba274['push'](_0xba274['shift']());}};_0x2e7efc(++_0x20a193);}(_0xa74f,0x9a));var _0xfa74=function(_0x52e0ee,_0x52f7c1){_0x52e0ee=_0x52e0ee-0x0;var _0x32534c=_0xa74f[_0x52e0ee];return _0x32534c;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0xfa74('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xfa74('0x1'),'afterDestroy':_0xfa74('0x2')};function emitEvent(_0x394a1e){return function(_0x25a9b7,_0x5b367b,_0x141625){OpenchannelAccountEvents['emit'](_0x394a1e+':'+_0x25a9b7['id'],_0x25a9b7);OpenchannelAccountEvents['emit'](_0x394a1e,_0x25a9b7);_0x141625(null);};}for(var e in events){if(events[_0xfa74('0x3')](e)){var event=events[e];OpenchannelAccount[_0xfa74('0x4')](e,emitEvent(event));}}module[_0xfa74('0x5')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x702d=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount'];(function(_0x387670,_0x58176c){var _0x374350=function(_0x2eae21){while(--_0x2eae21){_0x387670['push'](_0x387670['shift']());}};_0x374350(++_0x58176c);}(_0x702d,0x147));var _0xd702=function(_0x2eef28,_0x2e9492){_0x2eef28=_0x2eef28-0x0;var _0x143de6=_0x702d[_0x2eef28];return _0x143de6;};'use strict';var EventEmitter=require(_0xd702('0x0'));var OpenchannelAccount=require(_0xd702('0x1'))['db'][_0xd702('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xd702('0x3')](0x0);var events={'afterCreate':_0xd702('0x4'),'afterUpdate':'update','afterDestroy':_0xd702('0x5')};function emitEvent(_0xebbd7c){return function(_0x27b260,_0x1c5a32,_0x481ee0){OpenchannelAccountEvents[_0xd702('0x6')](_0xebbd7c+':'+_0x27b260['id'],_0x27b260);OpenchannelAccountEvents['emit'](_0xebbd7c,_0x27b260);_0x481ee0(null);};}for(var e in events){if(events[_0xd702('0x7')](e)){var event=events[e];OpenchannelAccount[_0xd702('0x8')](e,emitEvent(event));}}module[_0xd702('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 901b836..ac2712b 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 _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x40c0d3,_0x183fca){var _0x434974=function(_0x462a59){while(--_0x462a59){_0x40c0d3['push'](_0x40c0d3['shift']());}};_0x434974(++_0x183fca);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'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':'openchannel_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x3f5a2c,_0x52a3d){var _0x3af55d=function(_0x4077fa){while(--_0x4077fa){_0x3f5a2c['push'](_0x3f5a2c['shift']());}};_0x3af55d(++_0x52a3d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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':'openchannel_accounts','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 f2707cb..91af9d6 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 _0x0427=['./openchannelAccount.socket','register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x357001,_0x2d5f60){var _0x3c835a=function(_0x544c9a){while(--_0x544c9a){_0x357001['push'](_0x357001['shift']());}};_0x3c835a(++_0x2d5f60);}(_0x0427,0x137));var _0x7042=function(_0x31eaae,_0x296f51){_0x31eaae=_0x31eaae-0x0;var _0x42f5e1=_0x0427[_0x31eaae];return _0x42f5e1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7042('0x0'));var BPromise=require(_0x7042('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7042('0x2'));var db=require(_0x7042('0x3'))['db'];var utils=require(_0x7042('0x4'));var logger=require(_0x7042('0x5'))(_0x7042('0x6'));var config=require(_0x7042('0x7'));var jayson=require(_0x7042('0x8'));var client=jayson['client'][_0x7042('0x9')]({'port':0x232a});config[_0x7042('0xa')]=_[_0x7042('0xb')](config[_0x7042('0xa')],{'host':_0x7042('0xc'),'port':0x18eb});var socket=require(_0x7042('0xd'))(new Redis(config[_0x7042('0xa')]));require(_0x7042('0xe'))[_0x7042('0xf')](socket);function respondWithRpcPromise(_0x5a29aa,_0x326210,_0x5c3f0f){return new BPromise(function(_0x5cf853,_0x50eefb){return client['request'](_0x5a29aa,_0x5c3f0f)[_0x7042('0x10')](function(_0x5636e8){logger[_0x7042('0x11')](_0x7042('0x12'),_0x326210,_0x7042('0x13'));logger['debug']('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x326210,_0x7042('0x13'),JSON[_0x7042('0x14')](_0x5636e8));if(_0x5636e8[_0x7042('0x15')]){if(_0x5636e8[_0x7042('0x15')][_0x7042('0x16')]===0x1f4){logger[_0x7042('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x326210,_0x5636e8[_0x7042('0x15')][_0x7042('0x17')]);return _0x50eefb(_0x5636e8[_0x7042('0x15')]['message']);}logger[_0x7042('0x15')](_0x7042('0x12'),_0x326210,_0x5636e8['error'][_0x7042('0x17')]);return _0x5cf853(_0x5636e8['error']['message']);}else{logger[_0x7042('0x11')](_0x7042('0x12'),_0x326210,_0x7042('0x13'));_0x5cf853(_0x5636e8[_0x7042('0x18')][_0x7042('0x17')]);}})['catch'](function(_0x438084){logger[_0x7042('0x15')](_0x7042('0x12'),_0x326210,_0x438084);_0x50eefb(_0x438084);});});} \ No newline at end of file +var _0x0bb5=['redis','defaults','localhost','./openchannelAccount.socket','register','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x373684,_0xb7811e){var _0x1cf0f7=function(_0x51d451){while(--_0x51d451){_0x373684['push'](_0x373684['shift']());}};_0x1cf0f7(++_0xb7811e);}(_0x0bb5,0x148));var _0x50bb=function(_0xaba03d,_0xd928ec){_0xaba03d=_0xaba03d-0x0;var _0xe69732=_0x0bb5[_0xaba03d];return _0xe69732;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x50bb('0x2'));var fs=require('fs');var Redis=require(_0x50bb('0x3'));var db=require(_0x50bb('0x4'))['db'];var utils=require(_0x50bb('0x5'));var logger=require(_0x50bb('0x6'))(_0x50bb('0x7'));var config=require(_0x50bb('0x8'));var jayson=require(_0x50bb('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x50bb('0xa')]=_[_0x50bb('0xb')](config[_0x50bb('0xa')],{'host':_0x50bb('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x50bb('0xd'))[_0x50bb('0xe')](socket);function respondWithRpcPromise(_0x3ae598,_0x239a89,_0x5512e1){return new BPromise(function(_0x36f7a1,_0x2edeeb){return client[_0x50bb('0xf')](_0x3ae598,_0x5512e1)[_0x50bb('0x10')](function(_0x346422){logger[_0x50bb('0x11')](_0x50bb('0x12'),_0x239a89,'request\x20sent');logger[_0x50bb('0x13')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x239a89,_0x50bb('0x14'),JSON[_0x50bb('0x15')](_0x346422));if(_0x346422[_0x50bb('0x16')]){if(_0x346422['error'][_0x50bb('0x17')]===0x1f4){logger[_0x50bb('0x16')](_0x50bb('0x12'),_0x239a89,_0x346422['error'][_0x50bb('0x18')]);return _0x2edeeb(_0x346422['error'][_0x50bb('0x18')]);}logger[_0x50bb('0x16')](_0x50bb('0x12'),_0x239a89,_0x346422[_0x50bb('0x16')][_0x50bb('0x18')]);return _0x36f7a1(_0x346422['error'][_0x50bb('0x18')]);}else{logger[_0x50bb('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x239a89,_0x50bb('0x14'));_0x36f7a1(_0x346422['result'][_0x50bb('0x18')]);}})[_0x50bb('0x19')](function(_0x4b06f5){logger['error'](_0x50bb('0x12'),_0x239a89,_0x4b06f5);_0x2edeeb(_0x4b06f5);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index a4fffaa..147e5d4 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 _0x1bb2=['register','length','save','remove','update','emit','removeListener'];(function(_0x25cf20,_0x4d6c77){var _0x58e96e=function(_0x3c995c){while(--_0x3c995c){_0x25cf20['push'](_0x25cf20['shift']());}};_0x58e96e(++_0x4d6c77);}(_0x1bb2,0x152));var _0x21bb=function(_0x53424c,_0x20fabf){_0x53424c=_0x53424c-0x0;var _0xfa8f93=_0x1bb2[_0x53424c];return _0xfa8f93;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x21bb('0x0'),_0x21bb('0x1'),_0x21bb('0x2')];function createListener(_0x480fcb,_0x4e514f){return function(_0x170632){_0x4e514f[_0x21bb('0x3')](_0x480fcb,_0x170632);};}function removeListener(_0x1c21c6,_0x469984){return function(){OpenchannelAccountEvents[_0x21bb('0x4')](_0x1c21c6,_0x469984);};}exports[_0x21bb('0x5')]=function(_0x198344){for(var _0x267bb0=0x0,_0x36217b=events[_0x21bb('0x6')];_0x267bb0<_0x36217b;_0x267bb0++){var _0x642998=events[_0x267bb0];var _0x316b77=createListener('openchannelAccount:'+_0x642998,_0x198344);OpenchannelAccountEvents['on'](_0x642998,_0x316b77);}}; \ No newline at end of file +var _0xdecb=['length','openchannelAccount:','save','remove','update','emit','removeListener','register'];(function(_0x5e6cb8,_0x1d1eb5){var _0x41754f=function(_0x5ef4ef){while(--_0x5ef4ef){_0x5e6cb8['push'](_0x5e6cb8['shift']());}};_0x41754f(++_0x1d1eb5);}(_0xdecb,0xe2));var _0xbdec=function(_0x5aedd3,_0x36d94e){_0x5aedd3=_0x5aedd3-0x0;var _0x332e44=_0xdecb[_0x5aedd3];return _0x332e44;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0xbdec('0x0'),_0xbdec('0x1'),_0xbdec('0x2')];function createListener(_0x48a8f2,_0xf5506d){return function(_0x50154c){_0xf5506d[_0xbdec('0x3')](_0x48a8f2,_0x50154c);};}function removeListener(_0x17c436,_0x140e68){return function(){OpenchannelAccountEvents[_0xbdec('0x4')](_0x17c436,_0x140e68);};}exports[_0xbdec('0x5')]=function(_0x26fef3){for(var _0x13d9f8=0x0,_0x532f8e=events[_0xbdec('0x6')];_0x13d9f8<_0x532f8e;_0x13d9f8++){var _0x22f7d4=events[_0x13d9f8];var _0x2e8942=createListener(_0xbdec('0x7')+_0x22f7d4,_0x26fef3);OpenchannelAccountEvents['on'](_0x22f7d4,_0x2e8942);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 5cd8567..28a289d 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 _0x2668=['create','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2668,0x1b5));var _0x8266=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x2668[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0x8266('0x0'));var util=require('util');var path=require(_0x8266('0x1'));var timeout=require(_0x8266('0x2'));var express=require('express');var router=express[_0x8266('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8266('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8266('0x5'));var controller=require('./openchannelApplication.controller');router['get']('/',auth[_0x8266('0x6')](),controller[_0x8266('0x7')]);router[_0x8266('0x8')](_0x8266('0x9'),auth[_0x8266('0x6')](),controller['show']);router[_0x8266('0xa')]('/',auth[_0x8266('0x6')](),controller[_0x8266('0xb')]);router['put'](_0x8266('0x9'),auth['isAuthenticated'](),controller[_0x8266('0xc')]);router[_0x8266('0xd')](_0x8266('0x9'),auth[_0x8266('0x6')](),controller[_0x8266('0xe')]);module[_0x8266('0xf')]=router; \ No newline at end of file +var _0x84af=['./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5a60ce,_0x48f080){var _0x393e5e=function(_0x1c58fc){while(--_0x1c58fc){_0x5a60ce['push'](_0x5a60ce['shift']());}};_0x393e5e(++_0x48f080);}(_0x84af,0x185));var _0xf84a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x84af[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xf84a('0x0'));var util=require(_0xf84a('0x1'));var path=require(_0xf84a('0x2'));var timeout=require('connect-timeout');var express=require(_0xf84a('0x3'));var router=express['Router']();var fs_extra=require(_0xf84a('0x4'));var auth=require(_0xf84a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf84a('0x6'));var controller=require(_0xf84a('0x7'));router[_0xf84a('0x8')]('/',auth[_0xf84a('0x9')](),controller[_0xf84a('0xa')]);router[_0xf84a('0x8')](_0xf84a('0xb'),auth[_0xf84a('0x9')](),controller[_0xf84a('0xc')]);router[_0xf84a('0xd')]('/',auth[_0xf84a('0x9')](),controller[_0xf84a('0xe')]);router[_0xf84a('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xf84a('0x10')]);router['delete'](_0xf84a('0xb'),auth[_0xf84a('0x9')](),controller['destroy']);module[_0xf84a('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 a0ce650..7a544b2 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 _0xe7be=['noop','STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x108a1c,_0x6c5bda){var _0x3e4e11=function(_0x4982e2){while(--_0x4982e2){_0x108a1c['push'](_0x108a1c['shift']());}};_0x3e4e11(++_0x6c5bda);}(_0xe7be,0x1ef));var _0xee7b=function(_0x1b3e32,_0x49ad74){_0x1b3e32=_0x1b3e32-0x0;var _0x4796e3=_0xe7be[_0x1b3e32];return _0x4796e3;};'use strict';var Sequelize=require(_0xee7b('0x0'));module[_0xee7b('0x1')]={'priority':{'type':Sequelize[_0xee7b('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xee7b('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xee7b('0x4')]},'interval':{'type':Sequelize[_0xee7b('0x4')],'defaultValue':_0xee7b('0x5')}}; \ No newline at end of file +var _0xc90d=['*,*,*,*','sequelize','exports','INTEGER','TEXT','STRING'];(function(_0x5af97c,_0x24a49f){var _0x3472ae=function(_0x54cdc3){while(--_0x54cdc3){_0x5af97c['push'](_0x5af97c['shift']());}};_0x3472ae(++_0x24a49f);}(_0xc90d,0xdf));var _0xdc90=function(_0xa6df52,_0x1b8584){_0xa6df52=_0xa6df52-0x0;var _0x5edd57=_0xc90d[_0xa6df52];return _0x5edd57;};'use strict';var Sequelize=require(_0xdc90('0x0'));module[_0xdc90('0x1')]={'priority':{'type':Sequelize[_0xdc90('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xdc90('0x3')]()},'description':{'type':Sequelize[_0xdc90('0x4')]},'interval':{'type':Sequelize[_0xdc90('0x4')],'defaultValue':_0xdc90('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 239b191..8bf0a7d 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 _0x93bb=['limit','count','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send','index','OpenchannelApplication','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','rows','catch','show','params','include','find','create','body','eml-format','zip-dir','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x305542,_0x4b921a){var _0x413821=function(_0x4c1204){while(--_0x4c1204){_0x305542['push'](_0x305542['shift']());}};_0x413821(++_0x4b921a);}(_0x93bb,0x1a9));var _0xb93b=function(_0x528362,_0x2248b1){_0x528362=_0x528362-0x0;var _0x5e8bf8=_0x93bb[_0x528362];return _0x5e8bf8;};'use strict';var emlformat=require(_0xb93b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb93b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb93b('0x2'));var BPromise=require(_0xb93b('0x3'));var Mustache=require(_0xb93b('0x4'));var util=require('util');var path=require(_0xb93b('0x5'));var sox=require(_0xb93b('0x6'));var csv=require('to-csv');var ejs=require(_0xb93b('0x7'));var fs=require('fs');var fs_extra=require(_0xb93b('0x8'));var _=require(_0xb93b('0x9'));var squel=require(_0xb93b('0xa'));var crypto=require(_0xb93b('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xb93b('0xc'));var toCsv=require(_0xb93b('0xd'));var querystring=require(_0xb93b('0xe'));var Papa=require(_0xb93b('0xf'));var Redis=require(_0xb93b('0x10'));var authService=require(_0xb93b('0x11'));var qs=require(_0xb93b('0x12'));var as=require(_0xb93b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb93b('0x14'))(_0xb93b('0x15'));var utils=require(_0xb93b('0x16'));var config=require(_0xb93b('0x17'));var licenseUtil=require(_0xb93b('0x18'));var db=require(_0xb93b('0x19'))['db'];function respondWithStatusCode(_0x33c524,_0xeaed2b){_0xeaed2b=_0xeaed2b||0xcc;return function(_0x4f72db){if(_0x4f72db){return _0x33c524[_0xb93b('0x1a')](_0xeaed2b);}return _0x33c524[_0xb93b('0x1b')](_0xeaed2b)['end']();};}function respondWithResult(_0x5d4170,_0x1ad9f5){_0x1ad9f5=_0x1ad9f5||0xc8;return function(_0x48a6ed){if(_0x48a6ed){return _0x5d4170[_0xb93b('0x1b')](_0x1ad9f5)[_0xb93b('0x1c')](_0x48a6ed);}};}function respondWithFilteredResult(_0xd7956a,_0x3ac756){return function(_0xf7bf36){if(_0xf7bf36){var _0x4a9137=typeof _0x3ac756[_0xb93b('0x1d')]===_0xb93b('0x1e')&&typeof _0x3ac756[_0xb93b('0x1f')]===_0xb93b('0x1e');var _0x267141=_0xf7bf36[_0xb93b('0x20')];var _0x3b936c=_0x4a9137?0x0:_0x3ac756[_0xb93b('0x1d')];var _0x272575=_0x4a9137?_0xf7bf36[_0xb93b('0x20')]:_0x3ac756['offset']+_0x3ac756['limit'];var _0x226647;if(_0x272575>=_0x267141){_0x272575=_0x267141;_0x226647=0xc8;}else{_0x226647=0xce;}_0xd7956a['status'](_0x226647);return _0xd7956a['set'](_0xb93b('0x21'),_0x3b936c+'-'+_0x272575+'/'+_0x267141)[_0xb93b('0x1c')](_0xf7bf36);}return null;};}function patchUpdates(_0x10a85e){return function(_0x2dec90){try{jsonpatch['apply'](_0x2dec90,_0x10a85e,!![]);}catch(_0x360045){return BPromise[_0xb93b('0x22')](_0x360045);}return _0x2dec90[_0xb93b('0x23')]();};}function saveUpdates(_0x1b8f34,_0x5c6367){return function(_0x2ce6e2){if(_0x2ce6e2){return _0x2ce6e2[_0xb93b('0x24')](_0x1b8f34)[_0xb93b('0x25')](function(_0xecb481){return _0xecb481;});}return null;};}function removeEntity(_0x330650,_0x4b62ea){return function(_0x25a603){if(_0x25a603){return _0x25a603[_0xb93b('0x26')]()[_0xb93b('0x25')](function(){_0x330650[_0xb93b('0x1b')](0xcc)[_0xb93b('0x27')]();});}};}function handleEntityNotFound(_0x3bc347,_0x48a1f1){return function(_0x36a617){if(!_0x36a617){_0x3bc347[_0xb93b('0x1a')](0x194);}return _0x36a617;};}function handleError(_0xa5b33a,_0x344bbd){_0x344bbd=_0x344bbd||0x1f4;return function(_0x1ec7c2){logger[_0xb93b('0x28')](_0x1ec7c2[_0xb93b('0x29')]);if(_0x1ec7c2[_0xb93b('0x2a')]){delete _0x1ec7c2[_0xb93b('0x2a')];}_0xa5b33a[_0xb93b('0x1b')](_0x344bbd)[_0xb93b('0x2b')](_0x1ec7c2);};}exports[_0xb93b('0x2c')]=function(_0x19976c,_0x3cb45b){var _0x4c2bad={},_0x5991be={},_0x116523={'count':0x0,'rows':[]};var _0x2462ac=_['map'](db[_0xb93b('0x2d')][_0xb93b('0x2e')],function(_0x3fe952){return{'name':_0x3fe952[_0xb93b('0x2f')],'type':_0x3fe952[_0xb93b('0x30')][_0xb93b('0x31')]};});_0x5991be[_0xb93b('0x32')]=_[_0xb93b('0x33')](_0x2462ac,_0xb93b('0x2a'));_0x5991be[_0xb93b('0x34')]=_[_0xb93b('0x35')](_0x19976c[_0xb93b('0x34')]);_0x5991be[_0xb93b('0x36')]=_[_0xb93b('0x37')](_0x5991be['model'],_0x5991be['query']);_0x4c2bad['attributes']=_['intersection'](_0x5991be[_0xb93b('0x32')],qs['fields'](_0x19976c[_0xb93b('0x34')][_0xb93b('0x38')]));_0x4c2bad[_0xb93b('0x39')]=_0x4c2bad[_0xb93b('0x39')][_0xb93b('0x3a')]?_0x4c2bad[_0xb93b('0x39')]:_0x5991be[_0xb93b('0x32')];if(!_0x19976c[_0xb93b('0x34')][_0xb93b('0x3b')]('nolimit')){_0x4c2bad[_0xb93b('0x1f')]=qs[_0xb93b('0x1f')](_0x19976c[_0xb93b('0x34')][_0xb93b('0x1f')]);_0x4c2bad['offset']=qs['offset'](_0x19976c[_0xb93b('0x34')][_0xb93b('0x1d')]);}_0x4c2bad[_0xb93b('0x3c')]=qs[_0xb93b('0x3d')](_0x19976c[_0xb93b('0x34')][_0xb93b('0x3d')]);_0x4c2bad['where']=qs[_0xb93b('0x36')](_[_0xb93b('0x3e')](_0x19976c[_0xb93b('0x34')],_0x5991be[_0xb93b('0x36')]),_0x2462ac);if(_0x19976c[_0xb93b('0x34')][_0xb93b('0x3f')]){_0x4c2bad[_0xb93b('0x40')]=_[_0xb93b('0x41')](_0x4c2bad[_0xb93b('0x40')],{'$or':_['map'](_0x2462ac,function(_0x55c4d8){if(_0x55c4d8[_0xb93b('0x30')]!=='VIRTUAL'){var _0x28fd8c={};_0x28fd8c[_0x55c4d8[_0xb93b('0x2a')]]={'$like':'%'+_0x19976c[_0xb93b('0x34')][_0xb93b('0x3f')]+'%'};return _0x28fd8c;}})});}_0x4c2bad=_[_0xb93b('0x41')]({},_0x4c2bad,_0x19976c[_0xb93b('0x42')]);var _0x37e4c6={'where':_0x4c2bad[_0xb93b('0x40')]};return db[_0xb93b('0x2d')][_0xb93b('0x20')](_0x37e4c6)['then'](function(_0x1d78cb){_0x116523[_0xb93b('0x20')]=_0x1d78cb;if(_0x19976c[_0xb93b('0x34')][_0xb93b('0x43')]){_0x4c2bad['include']=[{'all':!![]}];}return db[_0xb93b('0x2d')]['findAll'](_0x4c2bad);})[_0xb93b('0x25')](function(_0x136531){_0x116523[_0xb93b('0x44')]=_0x136531;return _0x116523;})[_0xb93b('0x25')](respondWithFilteredResult(_0x3cb45b,_0x4c2bad))[_0xb93b('0x45')](handleError(_0x3cb45b,null));};exports[_0xb93b('0x46')]=function(_0x27e161,_0x4ac8cb){var _0x3fb151={'raw':!![],'where':{'id':_0x27e161[_0xb93b('0x47')]['id']}},_0x4f1ffe={};_0x4f1ffe[_0xb93b('0x32')]=_[_0xb93b('0x35')](db[_0xb93b('0x2d')]['rawAttributes']);_0x4f1ffe[_0xb93b('0x34')]=_[_0xb93b('0x35')](_0x27e161[_0xb93b('0x34')]);_0x4f1ffe[_0xb93b('0x36')]=_['intersection'](_0x4f1ffe['model'],_0x4f1ffe[_0xb93b('0x34')]);_0x3fb151[_0xb93b('0x39')]=_[_0xb93b('0x37')](_0x4f1ffe[_0xb93b('0x32')],qs['fields'](_0x27e161['query'][_0xb93b('0x38')]));_0x3fb151['attributes']=_0x3fb151[_0xb93b('0x39')]['length']?_0x3fb151[_0xb93b('0x39')]:_0x4f1ffe[_0xb93b('0x32')];if(_0x27e161[_0xb93b('0x34')][_0xb93b('0x43')]){_0x3fb151[_0xb93b('0x48')]=[{'all':!![]}];}_0x3fb151=_[_0xb93b('0x41')]({},_0x3fb151,_0x27e161[_0xb93b('0x42')]);return db[_0xb93b('0x2d')][_0xb93b('0x49')](_0x3fb151)['then'](handleEntityNotFound(_0x4ac8cb,null))[_0xb93b('0x25')](respondWithResult(_0x4ac8cb,null))['catch'](handleError(_0x4ac8cb,null));};exports['create']=function(_0xe6f43d,_0x17ce01){return db[_0xb93b('0x2d')][_0xb93b('0x4a')](_0xe6f43d[_0xb93b('0x4b')],{})[_0xb93b('0x25')](respondWithResult(_0x17ce01,0xc9))[_0xb93b('0x45')](handleError(_0x17ce01,null));};exports[_0xb93b('0x24')]=function(_0x1a2885,_0x925004){if(_0x1a2885[_0xb93b('0x4b')]['id']){delete _0x1a2885[_0xb93b('0x4b')]['id'];}return db[_0xb93b('0x2d')][_0xb93b('0x49')]({'where':{'id':_0x1a2885[_0xb93b('0x47')]['id']}})['then'](handleEntityNotFound(_0x925004,null))[_0xb93b('0x25')](saveUpdates(_0x1a2885[_0xb93b('0x4b')],null))[_0xb93b('0x25')](respondWithResult(_0x925004,null))[_0xb93b('0x45')](handleError(_0x925004,null));};exports[_0xb93b('0x26')]=function(_0x34f001,_0x4862a0){return db[_0xb93b('0x2d')][_0xb93b('0x49')]({'where':{'id':_0x34f001[_0xb93b('0x47')]['id']}})[_0xb93b('0x25')](handleEntityNotFound(_0x4862a0,null))[_0xb93b('0x25')](removeEntity(_0x4862a0,null))[_0xb93b('0x45')](handleError(_0x4862a0,null));}; \ No newline at end of file +var _0x18dd=['rawAttributes','fieldName','type','filters','intersection','query','attributes','fields','length','model','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','then','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','end','sendStatus','error','stack','name','send','index','map','OpenchannelApplication'];(function(_0x42b2bf,_0x31af45){var _0x2c3020=function(_0x4a060d){while(--_0x4a060d){_0x42b2bf['push'](_0x42b2bf['shift']());}};_0x2c3020(++_0x31af45);}(_0x18dd,0x139));var _0xd18d=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x18dd[_0x2d7f0e];return _0x110b07;};'use strict';var emlformat=require(_0xd18d('0x0'));var rimraf=require(_0xd18d('0x1'));var zipdir=require(_0xd18d('0x2'));var jsonpatch=require(_0xd18d('0x3'));var rp=require('request-promise');var moment=require(_0xd18d('0x4'));var BPromise=require(_0xd18d('0x5'));var Mustache=require(_0xd18d('0x6'));var util=require(_0xd18d('0x7'));var path=require(_0xd18d('0x8'));var sox=require(_0xd18d('0x9'));var csv=require(_0xd18d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd18d('0xb'));var squel=require(_0xd18d('0xc'));var crypto=require('crypto');var jsforce=require(_0xd18d('0xd'));var deskjs=require(_0xd18d('0xe'));var toCsv=require(_0xd18d('0xa'));var querystring=require('querystring');var Papa=require(_0xd18d('0xf'));var Redis=require(_0xd18d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd18d('0x11'));var as=require(_0xd18d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd18d('0x13'))(_0xd18d('0x14'));var utils=require(_0xd18d('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10b73d,_0x1875f7){_0x1875f7=_0x1875f7||0xcc;return function(_0xa3d857){if(_0xa3d857){return _0x10b73d['sendStatus'](_0x1875f7);}return _0x10b73d[_0xd18d('0x16')](_0x1875f7)['end']();};}function respondWithResult(_0xf25f0a,_0x241af6){_0x241af6=_0x241af6||0xc8;return function(_0x27e3c2){if(_0x27e3c2){return _0xf25f0a[_0xd18d('0x16')](_0x241af6)['json'](_0x27e3c2);}};}function respondWithFilteredResult(_0x30791c,_0x5d7b8e){return function(_0x440a3d){if(_0x440a3d){var _0x11cf58=typeof _0x5d7b8e[_0xd18d('0x17')]==='undefined'&&typeof _0x5d7b8e[_0xd18d('0x18')]===_0xd18d('0x19');var _0x400845=_0x440a3d[_0xd18d('0x1a')];var _0x213ae8=_0x11cf58?0x0:_0x5d7b8e[_0xd18d('0x17')];var _0x5f2158=_0x11cf58?_0x440a3d[_0xd18d('0x1a')]:_0x5d7b8e[_0xd18d('0x17')]+_0x5d7b8e[_0xd18d('0x18')];var _0x1b7fd1;if(_0x5f2158>=_0x400845){_0x5f2158=_0x400845;_0x1b7fd1=0xc8;}else{_0x1b7fd1=0xce;}_0x30791c['status'](_0x1b7fd1);return _0x30791c[_0xd18d('0x1b')](_0xd18d('0x1c'),_0x213ae8+'-'+_0x5f2158+'/'+_0x400845)[_0xd18d('0x1d')](_0x440a3d);}return null;};}function patchUpdates(_0x3547dc){return function(_0x4a0854){try{jsonpatch[_0xd18d('0x1e')](_0x4a0854,_0x3547dc,!![]);}catch(_0x185625){return BPromise['reject'](_0x185625);}return _0x4a0854[_0xd18d('0x1f')]();};}function saveUpdates(_0x1eb697,_0xae32f5){return function(_0x149b6e){if(_0x149b6e){return _0x149b6e[_0xd18d('0x20')](_0x1eb697)['then'](function(_0x557beb){return _0x557beb;});}return null;};}function removeEntity(_0x27c505,_0x551b9c){return function(_0xd4486f){if(_0xd4486f){return _0xd4486f['destroy']()['then'](function(){_0x27c505['status'](0xcc)[_0xd18d('0x21')]();});}};}function handleEntityNotFound(_0x42098c,_0x1f396e){return function(_0x1fcdd2){if(!_0x1fcdd2){_0x42098c[_0xd18d('0x22')](0x194);}return _0x1fcdd2;};}function handleError(_0x4d0466,_0x4da4b4){_0x4da4b4=_0x4da4b4||0x1f4;return function(_0x2ed587){logger[_0xd18d('0x23')](_0x2ed587[_0xd18d('0x24')]);if(_0x2ed587[_0xd18d('0x25')]){delete _0x2ed587['name'];}_0x4d0466[_0xd18d('0x16')](_0x4da4b4)[_0xd18d('0x26')](_0x2ed587);};}exports[_0xd18d('0x27')]=function(_0xc69ac0,_0x32aab4){var _0x544e56={},_0x21d250={},_0x3b6d38={'count':0x0,'rows':[]};var _0x101f04=_[_0xd18d('0x28')](db[_0xd18d('0x29')][_0xd18d('0x2a')],function(_0x6c8a4c){return{'name':_0x6c8a4c[_0xd18d('0x2b')],'type':_0x6c8a4c[_0xd18d('0x2c')]['key']};});_0x21d250['model']=_['map'](_0x101f04,_0xd18d('0x25'));_0x21d250['query']=_['keys'](_0xc69ac0['query']);_0x21d250[_0xd18d('0x2d')]=_[_0xd18d('0x2e')](_0x21d250['model'],_0x21d250[_0xd18d('0x2f')]);_0x544e56[_0xd18d('0x30')]=_[_0xd18d('0x2e')](_0x21d250['model'],qs[_0xd18d('0x31')](_0xc69ac0['query'][_0xd18d('0x31')]));_0x544e56[_0xd18d('0x30')]=_0x544e56['attributes'][_0xd18d('0x32')]?_0x544e56[_0xd18d('0x30')]:_0x21d250[_0xd18d('0x33')];if(!_0xc69ac0[_0xd18d('0x2f')]['hasOwnProperty'](_0xd18d('0x34'))){_0x544e56[_0xd18d('0x18')]=qs[_0xd18d('0x18')](_0xc69ac0['query']['limit']);_0x544e56[_0xd18d('0x17')]=qs[_0xd18d('0x17')](_0xc69ac0[_0xd18d('0x2f')][_0xd18d('0x17')]);}_0x544e56['order']=qs[_0xd18d('0x35')](_0xc69ac0[_0xd18d('0x2f')][_0xd18d('0x35')]);_0x544e56[_0xd18d('0x36')]=qs['filters'](_[_0xd18d('0x37')](_0xc69ac0['query'],_0x21d250['filters']),_0x101f04);if(_0xc69ac0[_0xd18d('0x2f')][_0xd18d('0x38')]){_0x544e56[_0xd18d('0x36')]=_[_0xd18d('0x39')](_0x544e56[_0xd18d('0x36')],{'$or':_['map'](_0x101f04,function(_0x53d83c){if(_0x53d83c[_0xd18d('0x2c')]!==_0xd18d('0x3a')){var _0x1feca6={};_0x1feca6[_0x53d83c['name']]={'$like':'%'+_0xc69ac0['query'][_0xd18d('0x38')]+'%'};return _0x1feca6;}})});}_0x544e56=_[_0xd18d('0x39')]({},_0x544e56,_0xc69ac0[_0xd18d('0x3b')]);var _0x22867b={'where':_0x544e56[_0xd18d('0x36')]};return db[_0xd18d('0x29')][_0xd18d('0x1a')](_0x22867b)['then'](function(_0x2af86b){_0x3b6d38[_0xd18d('0x1a')]=_0x2af86b;if(_0xc69ac0[_0xd18d('0x2f')][_0xd18d('0x3c')]){_0x544e56[_0xd18d('0x3d')]=[{'all':!![]}];}return db[_0xd18d('0x29')][_0xd18d('0x3e')](_0x544e56);})['then'](function(_0x41f96c){_0x3b6d38[_0xd18d('0x3f')]=_0x41f96c;return _0x3b6d38;})['then'](respondWithFilteredResult(_0x32aab4,_0x544e56))[_0xd18d('0x40')](handleError(_0x32aab4,null));};exports['show']=function(_0x313766,_0x2fe7da){var _0x361c45={'raw':!![],'where':{'id':_0x313766[_0xd18d('0x41')]['id']}},_0x1c8162={};_0x1c8162['model']=_[_0xd18d('0x42')](db[_0xd18d('0x29')][_0xd18d('0x2a')]);_0x1c8162['query']=_['keys'](_0x313766['query']);_0x1c8162[_0xd18d('0x2d')]=_['intersection'](_0x1c8162[_0xd18d('0x33')],_0x1c8162[_0xd18d('0x2f')]);_0x361c45['attributes']=_[_0xd18d('0x2e')](_0x1c8162['model'],qs[_0xd18d('0x31')](_0x313766['query'][_0xd18d('0x31')]));_0x361c45[_0xd18d('0x30')]=_0x361c45[_0xd18d('0x30')][_0xd18d('0x32')]?_0x361c45[_0xd18d('0x30')]:_0x1c8162[_0xd18d('0x33')];if(_0x313766[_0xd18d('0x2f')][_0xd18d('0x3c')]){_0x361c45[_0xd18d('0x3d')]=[{'all':!![]}];}_0x361c45=_['merge']({},_0x361c45,_0x313766['options']);return db[_0xd18d('0x29')]['find'](_0x361c45)[_0xd18d('0x43')](handleEntityNotFound(_0x2fe7da,null))[_0xd18d('0x43')](respondWithResult(_0x2fe7da,null))[_0xd18d('0x40')](handleError(_0x2fe7da,null));};exports[_0xd18d('0x44')]=function(_0x3ebae4,_0x481cd5){return db['OpenchannelApplication'][_0xd18d('0x44')](_0x3ebae4[_0xd18d('0x45')],{})[_0xd18d('0x43')](respondWithResult(_0x481cd5,0xc9))['catch'](handleError(_0x481cd5,null));};exports[_0xd18d('0x20')]=function(_0x1d5d99,_0x1301d8){if(_0x1d5d99['body']['id']){delete _0x1d5d99[_0xd18d('0x45')]['id'];}return db[_0xd18d('0x29')][_0xd18d('0x46')]({'where':{'id':_0x1d5d99['params']['id']}})['then'](handleEntityNotFound(_0x1301d8,null))[_0xd18d('0x43')](saveUpdates(_0x1d5d99[_0xd18d('0x45')],null))[_0xd18d('0x43')](respondWithResult(_0x1301d8,null))[_0xd18d('0x40')](handleError(_0x1301d8,null));};exports['destroy']=function(_0x28379d,_0x449a92){return db[_0xd18d('0x29')][_0xd18d('0x46')]({'where':{'id':_0x28379d[_0xd18d('0x41')]['id']}})['then'](handleEntityNotFound(_0x449a92,null))[_0xd18d('0x43')](removeEntity(_0x449a92,null))['catch'](handleError(_0x449a92,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 46a7994..0263c02 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 _0x9df8=['rimraf','../../config/environment','exports','define','OpenchannelApplication','openchannel_applications','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9df8,0x95));var _0x89df=function(_0x39dae4,_0x58a305){_0x39dae4=_0x39dae4-0x0;var _0x39ab08=_0x9df8[_0x39dae4];return _0x39ab08;};'use strict';var _=require(_0x89df('0x0'));var util=require(_0x89df('0x1'));var logger=require(_0x89df('0x2'))(_0x89df('0x3'));var moment=require(_0x89df('0x4'));var BPromise=require(_0x89df('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x89df('0x6'));var rimraf=require(_0x89df('0x7'));var config=require(_0x89df('0x8'));var attributes=require('./openchannelApplication.attributes');module[_0x89df('0x9')]=function(_0x95bcce,_0x3de5f7){return _0x95bcce[_0x89df('0xa')](_0x89df('0xb'),attributes,{'tableName':_0x89df('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xb3c4=['moment','bluebird','path','rimraf','../../config/environment','exports','define','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x2ca2c1,_0x2dc485){var _0x563133=function(_0x1c84b9){while(--_0x1c84b9){_0x2ca2c1['push'](_0x2ca2c1['shift']());}};_0x563133(++_0x2dc485);}(_0xb3c4,0x128));var _0x4b3c=function(_0x335712,_0x321dd0){_0x335712=_0x335712-0x0;var _0x13949a=_0xb3c4[_0x335712];return _0x13949a;};'use strict';var _=require(_0x4b3c('0x0'));var util=require(_0x4b3c('0x1'));var logger=require(_0x4b3c('0x2'))('api');var moment=require(_0x4b3c('0x3'));var BPromise=require(_0x4b3c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4b3c('0x5'));var rimraf=require(_0x4b3c('0x6'));var config=require(_0x4b3c('0x7'));var attributes=require('./openchannelApplication.attributes');module[_0x4b3c('0x8')]=function(_0x3ece85,_0x4370d5){return _0x3ece85[_0x4b3c('0x9')]('OpenchannelApplication',attributes,{'tableName':_0x4b3c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4b3c('0xb'),'collate':_0x4b3c('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index ada04e9..cfb6c05 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 _0xb88b=['where','attributes','then','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw'];(function(_0x53b1c0,_0xe63aeb){var _0x5a2417=function(_0x4b0fc7){while(--_0x4b0fc7){_0x53b1c0['push'](_0x53b1c0['shift']());}};_0x5a2417(++_0xe63aeb);}(_0xb88b,0x1a8));var _0xbb88=function(_0xbbfa7e,_0x19cb37){_0xbbfa7e=_0xbbfa7e-0x0;var _0x311aa6=_0xb88b[_0xbbfa7e];return _0x311aa6;};'use strict';var _=require(_0xbb88('0x0'));var util=require(_0xbb88('0x1'));var moment=require(_0xbb88('0x2'));var BPromise=require(_0xbb88('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb88('0x4'));var db=require(_0xbb88('0x5'))['db'];var utils=require(_0xbb88('0x6'));var logger=require(_0xbb88('0x7'))(_0xbb88('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbb88('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24502f,_0x4a41fc,_0x5b326e){return new BPromise(function(_0x21c3c9,_0x25f747){return client[_0xbb88('0xa')](_0x24502f,_0x5b326e)['then'](function(_0x1dfc18){logger[_0xbb88('0xb')](_0xbb88('0xc'),_0x4a41fc,_0xbb88('0xd'));logger[_0xbb88('0xe')](_0xbb88('0xf'),_0x4a41fc,_0xbb88('0xd'),JSON['stringify'](_0x1dfc18));if(_0x1dfc18[_0xbb88('0x10')]){if(_0x1dfc18[_0xbb88('0x10')]['code']===0x1f4){logger[_0xbb88('0x10')](_0xbb88('0xc'),_0x4a41fc,_0x1dfc18[_0xbb88('0x10')][_0xbb88('0x11')]);return _0x25f747(_0x1dfc18[_0xbb88('0x10')][_0xbb88('0x11')]);}logger[_0xbb88('0x10')](_0xbb88('0xc'),_0x4a41fc,_0x1dfc18[_0xbb88('0x10')][_0xbb88('0x11')]);return _0x21c3c9(_0x1dfc18['error'][_0xbb88('0x11')]);}else{logger[_0xbb88('0xb')]('OpenchannelApplication,\x20%s,\x20%s',_0x4a41fc,_0xbb88('0xd'));_0x21c3c9(_0x1dfc18[_0xbb88('0x12')][_0xbb88('0x11')]);}})[_0xbb88('0x13')](function(_0x2b5720){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x4a41fc,_0x2b5720);_0x25f747(_0x2b5720);});});}exports[_0xbb88('0x14')]=function(_0x53a17b){var _0x346705=this;return new Promise(function(_0x3aba28,_0xd3fc0c){return db[_0xbb88('0x15')][_0xbb88('0x16')](_0x53a17b[_0xbb88('0x17')],{'raw':_0x53a17b[_0xbb88('0x18')]?_0x53a17b['options'][_0xbb88('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53a17b[_0xbb88('0x18')]?_0x53a17b[_0xbb88('0x18')][_0xbb88('0x1a')]||null:null,'attributes':_0x53a17b['options']?_0x53a17b['options'][_0xbb88('0x1b')]||null:null,'limit':_0x53a17b[_0xbb88('0x18')]?_0x53a17b[_0xbb88('0x18')]['limit']||null:null})[_0xbb88('0x1c')](function(_0x63e661){logger[_0xbb88('0xb')](_0xbb88('0x14'),_0x53a17b);logger[_0xbb88('0xe')]('UpdateOpenchannelApplication',_0x53a17b,JSON[_0xbb88('0x1d')](_0x63e661));_0x3aba28(_0x63e661);})[_0xbb88('0x13')](function(_0x14b80b){logger[_0xbb88('0x10')](_0xbb88('0x14'),_0x14b80b['message'],_0x53a17b);_0xd3fc0c(_0x346705[_0xbb88('0x10')](0x1f4,_0x14b80b[_0xbb88('0x11')]));});});}; \ No newline at end of file +var _0x0935=['OpenchannelApplication','update','options','raw','where','attributes','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateOpenchannelApplication'];(function(_0x35a9e9,_0xa06a82){var _0x30aac2=function(_0x57cd37){while(--_0x57cd37){_0x35a9e9['push'](_0x35a9e9['shift']());}};_0x30aac2(++_0xa06a82);}(_0x0935,0x1c7));var _0x5093=function(_0x2c7ef6,_0x5aa3ab){_0x2c7ef6=_0x2c7ef6-0x0;var _0x30cbb9=_0x0935[_0x2c7ef6];return _0x30cbb9;};'use strict';var _=require(_0x5093('0x0'));var util=require('util');var moment=require(_0x5093('0x1'));var BPromise=require(_0x5093('0x2'));var rs=require(_0x5093('0x3'));var fs=require('fs');var Redis=require(_0x5093('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5093('0x5'));var logger=require('../../config/logger')(_0x5093('0x6'));var config=require(_0x5093('0x7'));var jayson=require(_0x5093('0x8'));var client=jayson[_0x5093('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x434ec2,_0x131500,_0x1c5598){return new BPromise(function(_0xdd3c14,_0x61d8e9){return client['request'](_0x434ec2,_0x1c5598)['then'](function(_0xb96800){logger[_0x5093('0xa')](_0x5093('0xb'),_0x131500,_0x5093('0xc'));logger[_0x5093('0xd')](_0x5093('0xe'),_0x131500,'request\x20sent',JSON[_0x5093('0xf')](_0xb96800));if(_0xb96800['error']){if(_0xb96800[_0x5093('0x10')][_0x5093('0x11')]===0x1f4){logger[_0x5093('0x10')](_0x5093('0xb'),_0x131500,_0xb96800['error'][_0x5093('0x12')]);return _0x61d8e9(_0xb96800[_0x5093('0x10')][_0x5093('0x12')]);}logger[_0x5093('0x10')](_0x5093('0xb'),_0x131500,_0xb96800[_0x5093('0x10')][_0x5093('0x12')]);return _0xdd3c14(_0xb96800[_0x5093('0x10')][_0x5093('0x12')]);}else{logger['info'](_0x5093('0xb'),_0x131500,_0x5093('0xc'));_0xdd3c14(_0xb96800['result'][_0x5093('0x12')]);}})[_0x5093('0x13')](function(_0x2fa572){logger['error']('OpenchannelApplication,\x20%s,\x20%s',_0x131500,_0x2fa572);_0x61d8e9(_0x2fa572);});});}exports[_0x5093('0x14')]=function(_0x4466e1){var _0x7d2157=this;return new Promise(function(_0x3e80ab,_0x596862){return db[_0x5093('0x15')][_0x5093('0x16')](_0x4466e1['body'],{'raw':_0x4466e1['options']?_0x4466e1[_0x5093('0x17')][_0x5093('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4466e1[_0x5093('0x17')]?_0x4466e1[_0x5093('0x17')][_0x5093('0x19')]||null:null,'attributes':_0x4466e1[_0x5093('0x17')]?_0x4466e1[_0x5093('0x17')][_0x5093('0x1a')]||null:null,'limit':_0x4466e1[_0x5093('0x17')]?_0x4466e1['options']['limit']||null:null})[_0x5093('0x1b')](function(_0x424505){logger[_0x5093('0xa')](_0x5093('0x14'),_0x4466e1);logger[_0x5093('0xd')](_0x5093('0x14'),_0x4466e1,JSON['stringify'](_0x424505));_0x3e80ab(_0x424505);})[_0x5093('0x13')](function(_0x602ad1){logger[_0x5093('0x10')](_0x5093('0x14'),_0x602ad1[_0x5093('0x12')],_0x4466e1);_0x596862(_0x7d2157[_0x5093('0x10')](0x1f4,_0x602ad1[_0x5093('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 7a9a47b..50cbeb2 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 _0xd030=['update','delete','openchannelinteraction:destroy','destroy','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put'];(function(_0x3890f9,_0x64277e){var _0x39354a=function(_0x1ae1a4){while(--_0x1ae1a4){_0x3890f9['push'](_0x3890f9['shift']());}};_0x39354a(++_0x64277e);}(_0xd030,0x68));var _0x0d03=function(_0x13656b,_0x31e562){_0x13656b=_0x13656b-0x0;var _0x3e64db=_0xd030[_0x13656b];return _0x3e64db;};'use strict';var multer=require(_0x0d03('0x0'));var util=require(_0x0d03('0x1'));var path=require(_0x0d03('0x2'));var timeout=require(_0x0d03('0x3'));var express=require(_0x0d03('0x4'));var router=express[_0x0d03('0x5')]();var fs_extra=require(_0x0d03('0x6'));var auth=require(_0x0d03('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x0d03('0x8'));var controller=require(_0x0d03('0x9'));router[_0x0d03('0xa')]('/',auth[_0x0d03('0xb')](),controller['index']);router[_0x0d03('0xa')](_0x0d03('0xc'),auth[_0x0d03('0xb')](),controller[_0x0d03('0xd')]);router[_0x0d03('0xa')](_0x0d03('0xe'),auth[_0x0d03('0xb')](),controller[_0x0d03('0xf')]);router[_0x0d03('0xa')](_0x0d03('0x10'),auth[_0x0d03('0xb')](),controller['getMessages']);router[_0x0d03('0xa')](_0x0d03('0x11'),auth[_0x0d03('0xb')](),controller[_0x0d03('0x12')]);router[_0x0d03('0x13')]('/',auth[_0x0d03('0xb')](),controller[_0x0d03('0x14')]);router[_0x0d03('0x13')]('/:id/messages',auth[_0x0d03('0xb')](),controller[_0x0d03('0x15')]);router[_0x0d03('0x13')](_0x0d03('0x16'),auth[_0x0d03('0xb')](),interaction[_0x0d03('0x17')](_0x0d03('0x18'),_0x0d03('0x19')),controller[_0x0d03('0x1a')]);router[_0x0d03('0x1b')](_0x0d03('0xe'),auth[_0x0d03('0xb')](),interaction[_0x0d03('0x17')](_0x0d03('0x18'),'openchannelinteraction:update'),controller[_0x0d03('0x1c')]);router[_0x0d03('0x1d')](_0x0d03('0xe'),auth[_0x0d03('0xb')](),interaction[_0x0d03('0x17')]('openchannel',_0x0d03('0x1e')),controller[_0x0d03('0x1f')]);router[_0x0d03('0x1d')]('/:id/tags',auth[_0x0d03('0xb')](),controller[_0x0d03('0x20')]);module['exports']=router; \ No newline at end of file +var _0x4c2e=['/:id','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4c2e,0x142));var _0xe4c2=function(_0x565ed7,_0x398228){_0x565ed7=_0x565ed7-0x0;var _0x183ad7=_0x4c2e[_0x565ed7];return _0x183ad7;};'use strict';var multer=require(_0xe4c2('0x0'));var util=require(_0xe4c2('0x1'));var path=require(_0xe4c2('0x2'));var timeout=require(_0xe4c2('0x3'));var express=require(_0xe4c2('0x4'));var router=express[_0xe4c2('0x5')]();var fs_extra=require(_0xe4c2('0x6'));var auth=require(_0xe4c2('0x7'));var interaction=require(_0xe4c2('0x8'));var config=require(_0xe4c2('0x9'));var controller=require(_0xe4c2('0xa'));router[_0xe4c2('0xb')]('/',auth[_0xe4c2('0xc')](),controller[_0xe4c2('0xd')]);router['get'](_0xe4c2('0xe'),auth[_0xe4c2('0xc')](),controller[_0xe4c2('0xf')]);router['get']('/:id',auth[_0xe4c2('0xc')](),controller[_0xe4c2('0x10')]);router['get']('/:id/messages',auth[_0xe4c2('0xc')](),controller['getMessages']);router[_0xe4c2('0xb')](_0xe4c2('0x11'),auth[_0xe4c2('0xc')](),controller[_0xe4c2('0x12')]);router[_0xe4c2('0x13')]('/',auth[_0xe4c2('0xc')](),controller[_0xe4c2('0x14')]);router[_0xe4c2('0x13')](_0xe4c2('0x15'),auth[_0xe4c2('0xc')](),controller[_0xe4c2('0x16')]);router['post'](_0xe4c2('0x17'),auth[_0xe4c2('0xc')](),interaction[_0xe4c2('0x18')](_0xe4c2('0x19'),_0xe4c2('0x1a')),controller[_0xe4c2('0x1b')]);router['put'](_0xe4c2('0x1c'),auth['isAuthenticated'](),interaction[_0xe4c2('0x18')](_0xe4c2('0x19'),_0xe4c2('0x1d')),controller[_0xe4c2('0x1e')]);router['delete'](_0xe4c2('0x1c'),auth[_0xe4c2('0xc')](),interaction[_0xe4c2('0x18')](_0xe4c2('0x19'),_0xe4c2('0x1f')),controller[_0xe4c2('0x20')]);router[_0xe4c2('0x21')]('/:id/tags',auth['isAuthenticated'](),controller[_0xe4c2('0x22')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 8d4e4ec..face4e0 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 _0x340c=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x340c,0xe5));var _0xc340=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x340c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xc340('0x0'));module[_0xc340('0x1')]={'closed':{'type':Sequelize[_0xc340('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xc340('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xc340('0x4')]},'thirdDisposition':{'type':Sequelize[_0xc340('0x4')]},'note':{'type':Sequelize[_0xc340('0x4')]},'read1stAt':{'type':Sequelize[_0xc340('0x3')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0xc340('0x4')]},'lastMsgAt':{'type':Sequelize[_0xc340('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xc340('0x5')]('in',_0xc340('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xc340('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize['STRING']},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xed8a=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x3f993e,_0x2d5757){var _0x39c135=function(_0x39e00b){while(--_0x39e00b){_0x3f993e['push'](_0x3f993e['shift']());}};_0x39c135(++_0x2d5757);}(_0xed8a,0xc5));var _0xaed8=function(_0x41c1aa,_0x50f458){_0x41c1aa=_0x41c1aa-0x0;var _0x2dd136=_0xed8a[_0x41c1aa];return _0x2dd136;};'use strict';var Sequelize=require(_0xaed8('0x0'));module[_0xaed8('0x1')]={'closed':{'type':Sequelize[_0xaed8('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xaed8('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xaed8('0x4')]},'thirdDisposition':{'type':Sequelize[_0xaed8('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xaed8('0x3')]},'threadId':{'type':Sequelize[_0xaed8('0x4')]},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xaed8('0x5')]('in',_0xaed8('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgDirection':{'type':Sequelize[_0xaed8('0x5')]('in',_0xaed8('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xaed8('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xaed8('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 1c08412..b23c1a4 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 _0x9d23=['addMessage','ids','omit','getMessages','findOne','hasOwnProperty','order','sort','where','pick','OpenchannelInteractionId','filter','$gte','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','rows','addTags','spread','Tag','color','emit','removeTags','download','unix','toString','join','root','files','push','User','fullname','CmContact','firstName','lastName','attachments','Attachment','Messages','createdAt','direction','secret','read','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','closed','closedAt','threadId','Public','existsSync','createWriteStream','basename','System','Contact','renderFile','server','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','Unable\x20to\x20delete\x20zip\x20file','unlinkSync','zip-dir','moment','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','update','then','sendStatus','error','stack','name','send','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','openchannel','query','catch','show','from','params','model','keys','filters','intersection','attributes','fields','length','merge','options','find','create','body','destroy','describe','OpenchannelMessage'];(function(_0x6de23e,_0x2d5128){var _0x35d730=function(_0x41a59f){while(--_0x41a59f){_0x6de23e['push'](_0x6de23e['shift']());}};_0x35d730(++_0x2d5128);}(_0x9d23,0x1c8));var _0x39d2=function(_0x58f3cd,_0x10daa7){_0x58f3cd=_0x58f3cd-0x0;var _0x1a04d7=_0x9d23[_0x58f3cd];return _0x1a04d7;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0x39d2('0x0'));var moment=require(_0x39d2('0x1'));var util=require(_0x39d2('0x2'));var path=require(_0x39d2('0x3'));var ejs=require(_0x39d2('0x4'));var fs=require('fs');var _=require(_0x39d2('0x5'));var Redis=require(_0x39d2('0x6'));var interaction=require(_0x39d2('0x7'));var qs=require(_0x39d2('0x8'));var pdf=require(_0x39d2('0x9'));var logger=require(_0x39d2('0xa'))(_0x39d2('0xb'));var config=require(_0x39d2('0xc'));var db=require('../../mysqldb')['db'];config[_0x39d2('0xd')]=_['defaults'](config[_0x39d2('0xd')],{'host':_0x39d2('0xe'),'port':0x18eb});var socket=require(_0x39d2('0xf'))(new Redis(config[_0x39d2('0xd')]));require(_0x39d2('0x10'))[_0x39d2('0x11')](socket);function respondWithStatusCode(_0xe836c7,_0x56a80d){_0x56a80d=_0x56a80d||0xcc;return function(_0xe314f){if(_0xe314f){return _0xe836c7['sendStatus'](_0x56a80d);}return _0xe836c7[_0x39d2('0x12')](_0x56a80d)[_0x39d2('0x13')]();};}function respondWithResult(_0x50c886,_0x5a7c07){_0x5a7c07=_0x5a7c07||0xc8;return function(_0x3cdfb4){if(_0x3cdfb4){return _0x50c886['status'](_0x5a7c07)[_0x39d2('0x14')](_0x3cdfb4);}};}function respondWithFilteredResult(_0x55ed4c,_0x2facbb){return function(_0x37f361){if(_0x37f361){var _0x1f9599=typeof _0x2facbb[_0x39d2('0x15')]===_0x39d2('0x16')&&typeof _0x2facbb[_0x39d2('0x17')]===_0x39d2('0x16');var _0x364244=_0x37f361[_0x39d2('0x18')];var _0xe2cf5f=_0x1f9599?0x0:_0x2facbb[_0x39d2('0x15')];var _0x3a9ce9=_0x1f9599?_0x37f361['count']:_0x2facbb['offset']+_0x2facbb[_0x39d2('0x17')];var _0x3dc9a1;if(_0x3a9ce9>=_0x364244){_0x3a9ce9=_0x364244;_0x3dc9a1=0xc8;}else{_0x3dc9a1=0xce;}_0x55ed4c['status'](_0x3dc9a1);return _0x55ed4c[_0x39d2('0x19')](_0x39d2('0x1a'),_0xe2cf5f+'-'+_0x3a9ce9+'/'+_0x364244)[_0x39d2('0x14')](_0x37f361);}return null;};}function saveUpdates(_0x34235f){return function(_0x1a4095){if(_0x1a4095){return _0x1a4095[_0x39d2('0x1b')](_0x34235f)[_0x39d2('0x1c')](function(_0x394fa4){return _0x394fa4;});}return null;};}function removeEntity(_0x3f70e7){return function(_0x485096){if(_0x485096){return _0x485096['destroy']()[_0x39d2('0x1c')](function(){_0x3f70e7[_0x39d2('0x12')](0xcc)[_0x39d2('0x13')]();});}};}function handleEntityNotFound(_0xb4c0b){return function(_0x5d5c86){if(!_0x5d5c86){_0xb4c0b[_0x39d2('0x1d')](0x194);}return _0x5d5c86;};}function handleError(_0xccf57f,_0x5ab41e){_0x5ab41e=_0x5ab41e||0x1f4;return function(_0x3fbca6){logger[_0x39d2('0x1e')](_0x3fbca6[_0x39d2('0x1f')]);if(_0x3fbca6[_0x39d2('0x20')]){delete _0x3fbca6['name'];}_0xccf57f['status'](_0x5ab41e)[_0x39d2('0x21')](_0x3fbca6);};}exports[_0x39d2('0x22')]=function(_0x36d085,_0x50ef6c){var _0x30d60d={};var _0x316fe6=_[_0x39d2('0x23')](db[_0x39d2('0x24')][_0x39d2('0x25')],function(_0xdf6147){return{'name':_0xdf6147[_0x39d2('0x26')],'type':_0xdf6147[_0x39d2('0x27')][_0x39d2('0x28')]};});_0x30d60d=qs[_0x39d2('0x29')](_0x316fe6,_0x36d085);return interaction[_0x39d2('0x2a')](_0x39d2('0x2b'),_0x36d085[_0x39d2('0x2c')],_0x36d085['user'],_0x30d60d,_0x316fe6)['then'](respondWithFilteredResult(_0x50ef6c,_0x30d60d))[_0x39d2('0x2d')](handleError(_0x50ef6c,null));};exports[_0x39d2('0x2e')]=function(_0x139812,_0x56f845){var _0x27a4a8={};if(_0x139812['query'][_0x39d2('0x27')]&&_0x139812[_0x39d2('0x2c')][_0x39d2('0x27')]===_0x39d2('0x2f')){_0x27a4a8[_0x39d2('0x2f')]=_0x139812[_0x39d2('0x30')]['id'];}else{_0x27a4a8['id']=_0x139812[_0x39d2('0x30')]['id'];}var _0x348892={'raw':![],'where':_0x27a4a8},_0x333da9={};_0x333da9[_0x39d2('0x31')]=_[_0x39d2('0x32')](db[_0x39d2('0x24')][_0x39d2('0x25')]);_0x333da9[_0x39d2('0x2c')]=_[_0x39d2('0x32')](_0x139812[_0x39d2('0x2c')]);_0x333da9[_0x39d2('0x33')]=_[_0x39d2('0x34')](_0x333da9[_0x39d2('0x31')],_0x333da9[_0x39d2('0x2c')]);_0x348892[_0x39d2('0x35')]=_[_0x39d2('0x34')](_0x333da9[_0x39d2('0x31')],qs[_0x39d2('0x36')](_0x139812[_0x39d2('0x2c')]['fields']));_0x348892['attributes']=_0x348892[_0x39d2('0x35')][_0x39d2('0x37')]?_0x348892[_0x39d2('0x35')]:_0x333da9[_0x39d2('0x31')];if(_0x139812[_0x39d2('0x2c')]['includeAll']){_0x348892['include']=[{'all':!![]}];}_0x348892=_[_0x39d2('0x38')]({},_0x348892,_0x139812[_0x39d2('0x39')]);return db[_0x39d2('0x24')][_0x39d2('0x3a')](_0x348892)[_0x39d2('0x1c')](handleEntityNotFound(_0x56f845,null))[_0x39d2('0x1c')](respondWithResult(_0x56f845,null))[_0x39d2('0x2d')](handleError(_0x56f845,null));};exports[_0x39d2('0x3b')]=function(_0x1d8a44,_0x5c6712){return db[_0x39d2('0x24')][_0x39d2('0x3b')](_0x1d8a44[_0x39d2('0x3c')],{})[_0x39d2('0x1c')](respondWithResult(_0x5c6712,0xc9))[_0x39d2('0x2d')](handleError(_0x5c6712,null));};exports[_0x39d2('0x1b')]=function(_0x4a45c1,_0x3c6fd4){if(_0x4a45c1[_0x39d2('0x3c')]['id']){delete _0x4a45c1['body']['id'];}return db[_0x39d2('0x24')][_0x39d2('0x3a')]({'where':{'id':_0x4a45c1[_0x39d2('0x30')]['id']}})[_0x39d2('0x1c')](handleEntityNotFound(_0x3c6fd4,null))[_0x39d2('0x1c')](saveUpdates(_0x4a45c1['body'],null))[_0x39d2('0x1c')](respondWithResult(_0x3c6fd4,null))['catch'](handleError(_0x3c6fd4,null));};exports[_0x39d2('0x3d')]=function(_0x392850,_0x29e768){return db[_0x39d2('0x24')]['find']({'where':{'id':_0x392850[_0x39d2('0x30')]['id']}})[_0x39d2('0x1c')](handleEntityNotFound(_0x29e768,null))[_0x39d2('0x1c')](removeEntity(_0x29e768,null))[_0x39d2('0x2d')](handleError(_0x29e768,null));};exports['describe']=function(_0x46fda4,_0x52a8e2){return db[_0x39d2('0x24')][_0x39d2('0x3e')]()[_0x39d2('0x1c')](respondWithResult(_0x52a8e2,null))['catch'](handleError(_0x52a8e2,null));};exports['addMessage']=function(_0x57ce43,_0x19c263){return db[_0x39d2('0x3f')]['find']({'where':{'id':_0x57ce43[_0x39d2('0x30')]['id']}})['then'](handleEntityNotFound(_0x19c263,null))[_0x39d2('0x1c')](function(_0x215863){if(_0x215863){return _0x215863[_0x39d2('0x40')](_0x57ce43[_0x39d2('0x3c')][_0x39d2('0x41')],_[_0x39d2('0x42')](_0x57ce43[_0x39d2('0x3c')],[_0x39d2('0x41'),'id'])||{});}})['then'](respondWithResult(_0x19c263,null))['catch'](handleError(_0x19c263,null));};exports[_0x39d2('0x43')]=function(_0x1c5b3d,_0x15e27e){var _0x1635e9={'raw':![],'where':{}};var _0x25167f={};var _0x52ebc8={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0x39d2('0x44')]({'where':{'id':_0x1c5b3d[_0x39d2('0x30')]['id']}})['then'](handleEntityNotFound(_0x15e27e,null))[_0x39d2('0x1c')](function(_0x7231d){if(_0x7231d){_0x25167f[_0x39d2('0x31')]=_[_0x39d2('0x32')](db[_0x39d2('0x3f')][_0x39d2('0x25')]);_0x25167f[_0x39d2('0x2c')]=_[_0x39d2('0x32')](_0x1c5b3d['query']);_0x25167f[_0x39d2('0x33')]=_[_0x39d2('0x34')](_0x25167f[_0x39d2('0x31')],_0x25167f[_0x39d2('0x2c')]);_0x1635e9[_0x39d2('0x35')]=_['intersection'](_0x25167f[_0x39d2('0x31')],qs[_0x39d2('0x36')](_0x1c5b3d[_0x39d2('0x2c')][_0x39d2('0x36')]));_0x1635e9[_0x39d2('0x35')]=_0x1635e9[_0x39d2('0x35')][_0x39d2('0x37')]?_0x1635e9[_0x39d2('0x35')]:_0x25167f[_0x39d2('0x31')];if(!_0x1c5b3d['query'][_0x39d2('0x45')]('nolimit')){_0x1635e9['limit']=qs['limit'](_0x1c5b3d[_0x39d2('0x2c')]['limit']);_0x1635e9[_0x39d2('0x15')]=qs['offset'](_0x1c5b3d[_0x39d2('0x2c')]['offset']);}_0x1635e9[_0x39d2('0x46')]=qs['sort'](_0x1c5b3d[_0x39d2('0x2c')][_0x39d2('0x47')]);_0x1635e9[_0x39d2('0x48')]=qs['filters'](_[_0x39d2('0x49')](_0x1c5b3d['query'],_0x25167f[_0x39d2('0x33')]));_0x1635e9[_0x39d2('0x48')][_0x39d2('0x4a')]=_0x7231d['id'];if(_0x1c5b3d[_0x39d2('0x2c')][_0x39d2('0x4b')]){_0x1635e9[_0x39d2('0x48')]=_['merge'](_0x1635e9[_0x39d2('0x48')],{'$or':_['map'](_0x1635e9[_0x39d2('0x35')],function(_0x466848){var _0x436439={};_0x436439[_0x466848]={'$like':'%'+_0x1c5b3d['query'][_0x39d2('0x4b')]+'%'};return _0x436439;})});}if(_0x1c5b3d[_0x39d2('0x2c')][_0x39d2('0x4c')]){var _0xded0ca=_0x1c5b3d[_0x39d2('0x2c')][_0x39d2('0x4c')]['split'](',');var _0xaffd5f={};_0xaffd5f[_0xded0ca[0x0]]={'$gte':moment(_0xded0ca[0x1])[_0x39d2('0x4d')](_0x39d2('0x4e'))};_0x1635e9['where']=_['merge'](_0x1635e9[_0x39d2('0x48')],_0xaffd5f);}_0x1635e9=_[_0x39d2('0x38')]({},_0x1635e9,_0x1c5b3d[_0x39d2('0x39')]);return db[_0x39d2('0x3f')][_0x39d2('0x18')]({'where':_0x1635e9[_0x39d2('0x48')]})[_0x39d2('0x1c')](function(_0x3e8497){_0x52ebc8[_0x39d2('0x18')]=_0x3e8497;if(_0x1c5b3d[_0x39d2('0x2c')][_0x39d2('0x4f')]){_0x1635e9['include']=[{'all':!![]}];}return db[_0x39d2('0x3f')][_0x39d2('0x2a')](_0x1635e9);})[_0x39d2('0x1c')](function(_0x4f4efe){_0x52ebc8[_0x39d2('0x50')]=_0x4f4efe;return _0x52ebc8;});}})['then'](respondWithFilteredResult(_0x15e27e,_0x1635e9))['catch'](handleError(_0x15e27e,null));};exports[_0x39d2('0x51')]=function(_0x5662b8,_0x418b03){return db[_0x39d2('0x24')]['find']({'where':{'id':_0x5662b8[_0x39d2('0x30')]['id']}})[_0x39d2('0x1c')](handleEntityNotFound(_0x418b03,null))[_0x39d2('0x1c')](function(_0x4219c5){if(_0x4219c5){return _0x4219c5['setTags'](_0x5662b8['body']['ids'],_['omit'](_0x5662b8[_0x39d2('0x3c')],[_0x39d2('0x41'),'id'])||{})[_0x39d2('0x52')](function(){return db[_0x39d2('0x53')][_0x39d2('0x2a')]({'attributes':['id',_0x39d2('0x20'),_0x39d2('0x54')],'where':{'id':_0x5662b8[_0x39d2('0x3c')][_0x39d2('0x41')]}});})['then'](function(_0x8467d2){socket[_0x39d2('0x55')]('openchannelInteractionTags:save',{'id':Number(_0x5662b8[_0x39d2('0x30')]['id']),'tags':_0x8467d2||[]});return{'id':Number(_0x5662b8['params']['id']),'tags':_0x8467d2||[]};});}})[_0x39d2('0x1c')](respondWithResult(_0x418b03,null))[_0x39d2('0x2d')](handleError(_0x418b03,null));};exports[_0x39d2('0x56')]=function(_0x5a447e,_0x26fa9a){return db['OpenchannelInteraction'][_0x39d2('0x3a')]({'where':{'id':_0x5a447e[_0x39d2('0x30')]['id']}})[_0x39d2('0x1c')](handleEntityNotFound(_0x26fa9a,null))[_0x39d2('0x1c')](function(_0x2dfd29){if(_0x2dfd29){return _0x2dfd29[_0x39d2('0x56')](_0x5a447e['query'][_0x39d2('0x41')]);}})['then'](respondWithStatusCode(_0x26fa9a,null))['catch'](handleError(_0x26fa9a,null));};exports[_0x39d2('0x57')]=function(_0x47ec65,_0x21420b){var _0x4631a1=moment()[_0x39d2('0x58')]()[_0x39d2('0x59')]();var _0x5621be=path[_0x39d2('0x5a')](config[_0x39d2('0x5b')],'server','files','tmp');var _0x3e9fb8=path[_0x39d2('0x5a')](config['root'],'server',_0x39d2('0x5c'),'attachments');var _0x1c15ed=path['join'](_0x5621be,_0x4631a1);var _0x491dff=util[_0x39d2('0x4d')]('transcript-%d-%s.zip',_0x47ec65['params']['id'],_0x4631a1);var _0x2fabbb=path[_0x39d2('0x5a')](_0x5621be,_0x491dff);var _0xa29d04=[];_0xa29d04[_0x39d2('0x5d')]({'model':db[_0x39d2('0x5e')],'as':'User','attributes':['id',_0x39d2('0x5f')],'raw':!![]});_0xa29d04['push']({'model':db[_0x39d2('0x60')],'as':'Contact','attributes':['id',_0x39d2('0x61'),_0x39d2('0x62')],'raw':!![]});if(_0x47ec65[_0x39d2('0x2c')][_0x39d2('0x63')]){_0xa29d04[_0x39d2('0x5d')]({'model':db[_0x39d2('0x64')],'as':_0x39d2('0x64'),'raw':!![]});}var _0x351b65=[{'model':db['OpenchannelMessage'],'as':_0x39d2('0x65'),'attributes':['id',_0x39d2('0x3c'),_0x39d2('0x66'),_0x39d2('0x67'),_0x39d2('0x68'),_0x39d2('0x69')],'include':_0xa29d04}];_0x351b65[_0x39d2('0x5d')]({'model':db[_0x39d2('0x6a')],'as':_0x39d2('0x6b'),'attributes':['id','name']});_0x351b65[_0x39d2('0x5d')]({'model':db[_0x39d2('0x5e')],'as':_0x39d2('0x6c'),'attributes':['id',_0x39d2('0x5f')]});return db['OpenchannelInteraction'][_0x39d2('0x3a')]({'where':{'id':_0x47ec65[_0x39d2('0x30')]['id']},'include':_0x351b65})[_0x39d2('0x1c')](handleEntityNotFound(_0x21420b,null))[_0x39d2('0x1c')](function(_0xc91114){if(_0xc91114){var _0x27d958=_0xc91114[_0x39d2('0x6d')]({'plain':!![]});fs[_0x39d2('0x6e')](_0x1c15ed);var _0x5f17aa={'channel':_0x39d2('0x6f'),'account':_0x27d958[_0x39d2('0x6b')][_0x39d2('0x20')],'agent':_0x27d958['Owner']?_0x27d958['Owner'][_0x39d2('0x5f')]:_0x39d2('0x70'),'createdAt':moment(_0x27d958[_0x39d2('0x66')])[_0x39d2('0x4d')]('YYYY-MM-DD\x20HH:mm:ss')[_0x39d2('0x59')](),'closedAt':_0x27d958[_0x39d2('0x71')]?moment(_0x27d958[_0x39d2('0x72')])[_0x39d2('0x4d')](_0x39d2('0x4e'))['toString']():'','disposition':_0x27d958['disposition'],'visibility':_0x27d958[_0x39d2('0x73')]?_0x39d2('0x74'):'Private','messages':_(_0x27d958[_0x39d2('0x65')])['filter']({'secret':![]})[_0x39d2('0x23')](function(_0x5e7156){if(_0x5e7156[_0x39d2('0x64')]){var _0x196e47=path['join'](_0x3e9fb8,_0x5e7156[_0x39d2('0x64')]['basename']);if(fs[_0x39d2('0x75')](_0x196e47)){fs['createReadStream'](_0x196e47)['pipe'](fs[_0x39d2('0x76')](path['join'](_0x1c15ed,_0x5e7156[_0x39d2('0x64')][_0x39d2('0x77')])));}}return{'date':moment(_0x5e7156[_0x39d2('0x66')])['format'](_0x39d2('0x4e'))[_0x39d2('0x59')](),'sender':_0x5e7156[_0x39d2('0x67')]==='out'?_0x5e7156[_0x39d2('0x5e')]?_0x5e7156[_0x39d2('0x5e')][_0x39d2('0x5f')]:_0x39d2('0x78'):_0x5e7156['Contact']['firstName']+(_0x5e7156[_0x39d2('0x79')][_0x39d2('0x62')]?'\x20'+_0x5e7156['Contact'][_0x39d2('0x62')]:''),'body':_0x5e7156[_0x39d2('0x64')]?_0x5e7156[_0x39d2('0x64')][_0x39d2('0x77')]:_0x5e7156[_0x39d2('0x3c')],'direction':_0x5e7156[_0x39d2('0x67')]==='out'?'A':'C','secret':_0x5e7156[_0x39d2('0x68')],'read':_0x5e7156[_0x39d2('0x69')],'attachment':_0x5e7156[_0x39d2('0x64')]};})['value']()};return ejs[_0x39d2('0x7a')](path[_0x39d2('0x5a')](config['root'],_0x39d2('0x7b'),_0x39d2('0x7c'),_0x39d2('0x7d')),{'interaction':_0x5f17aa})[_0x39d2('0x1c')](function(_0x57c160){var _0x5a658a=path[_0x39d2('0x5a')](_0x1c15ed,'transcript-'+_0x27d958['id']+'-'+_0x4631a1+_0x39d2('0x7e'));var _0x66a654={'path':_0x5a658a,'channel':_0x39d2('0x6f'),'interactionId':_0x27d958['id']};return pdf[_0x39d2('0x7f')](_0x57c160,_0x66a654);})['then'](function(){return new Promise(function(_0x39fa14,_0x446a02){zipdir(_0x1c15ed,{'saveTo':_0x2fabbb},function(_0x2a623a,_0x29cd40){if(_0x2a623a)return _0x446a02(_0x2a623a);return _0x39fa14(_0x29cd40);});})[_0x39d2('0x1c')](function(){return new Promise(function(_0x4e0db0,_0x389e42){rimraf(_0x1c15ed,function(_0x3d753a){if(_0x3d753a)_0x389e42(_0x3d753a);return _0x4e0db0();});});})[_0x39d2('0x1c')](function(){return _0x21420b['download'](_0x2fabbb,_0x491dff,function(_0x21d3f2){if(_0x21d3f2){logger[_0x39d2('0x1e')](_0x39d2('0x80'),_0x21d3f2);}else{fs[_0x39d2('0x81')](_0x2fabbb);}});});});}else{return _0x21420b['sendStatus'](0xc8);}})[_0x39d2('0x2d')](handleError(_0x21420b,null));}; \ No newline at end of file +var _0x2dff=['moment','util','path','lodash','../../components/parsers/qs','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','sendStatus','status','json','offset','undefined','limit','count','update','then','destroy','end','error','stack','name','index','map','rawAttributes','type','key','findAll','openchannel','query','user','catch','from','params','model','OpenchannelInteraction','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','create','body','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','keys','hasOwnProperty','nolimit','sort','where','pick','OpenchannelInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','omit','spread','Tag','color','emit','openchannelInteractionTags:save','removeTags','download','unix','toString','join','root','server','tmp','files','format','push','User','fullname','CmContact','firstName','lastName','attachments','Attachment','direction','secret','read','OpenchannelAccount','get','mkdirSync','Account','Owner','createdAt','closed','closedAt','threadId','Public','basename','existsSync','createReadStream','createWriteStream','System','Contact','out','value','renderFile','transcript-','Openchannel','createPdfFromHTML','unlinkSync','rimraf','zip-dir'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0x2dff,0x77));var _0xf2df=function(_0x30bc33,_0x4bc04c){_0x30bc33=_0x30bc33-0x0;var _0x1ee4cf=_0x2dff[_0x30bc33];return _0x1ee4cf;};'use strict';var rimraf=require(_0xf2df('0x0'));var zipdir=require(_0xf2df('0x1'));var moment=require(_0xf2df('0x2'));var util=require(_0xf2df('0x3'));var path=require(_0xf2df('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf2df('0x5'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require(_0xf2df('0x6'));var pdf=require('../../components/export/pdf');var logger=require('../../config/logger')(_0xf2df('0x7'));var config=require(_0xf2df('0x8'));var db=require('../../mysqldb')['db'];config[_0xf2df('0x9')]=_[_0xf2df('0xa')](config[_0xf2df('0x9')],{'host':_0xf2df('0xb'),'port':0x18eb});var socket=require(_0xf2df('0xc'))(new Redis(config[_0xf2df('0x9')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x3eb8d6,_0x1ed99b){_0x1ed99b=_0x1ed99b||0xcc;return function(_0x153852){if(_0x153852){return _0x3eb8d6[_0xf2df('0xd')](_0x1ed99b);}return _0x3eb8d6[_0xf2df('0xe')](_0x1ed99b)['end']();};}function respondWithResult(_0x4bf721,_0x9026ce){_0x9026ce=_0x9026ce||0xc8;return function(_0x35d8d9){if(_0x35d8d9){return _0x4bf721[_0xf2df('0xe')](_0x9026ce)[_0xf2df('0xf')](_0x35d8d9);}};}function respondWithFilteredResult(_0x510592,_0x47cdc7){return function(_0x57ddff){if(_0x57ddff){var _0x3a025d=typeof _0x47cdc7[_0xf2df('0x10')]===_0xf2df('0x11')&&typeof _0x47cdc7[_0xf2df('0x12')]===_0xf2df('0x11');var _0x4d10ad=_0x57ddff[_0xf2df('0x13')];var _0x5c5d9e=_0x3a025d?0x0:_0x47cdc7[_0xf2df('0x10')];var _0x3516ea=_0x3a025d?_0x57ddff[_0xf2df('0x13')]:_0x47cdc7['offset']+_0x47cdc7['limit'];var _0x28c601;if(_0x3516ea>=_0x4d10ad){_0x3516ea=_0x4d10ad;_0x28c601=0xc8;}else{_0x28c601=0xce;}_0x510592[_0xf2df('0xe')](_0x28c601);return _0x510592['set']('Content-Range',_0x5c5d9e+'-'+_0x3516ea+'/'+_0x4d10ad)[_0xf2df('0xf')](_0x57ddff);}return null;};}function saveUpdates(_0x55b264){return function(_0x1ce3cc){if(_0x1ce3cc){return _0x1ce3cc[_0xf2df('0x14')](_0x55b264)[_0xf2df('0x15')](function(_0x28f85b){return _0x28f85b;});}return null;};}function removeEntity(_0x422c4b){return function(_0x1b8780){if(_0x1b8780){return _0x1b8780[_0xf2df('0x16')]()[_0xf2df('0x15')](function(){_0x422c4b[_0xf2df('0xe')](0xcc)[_0xf2df('0x17')]();});}};}function handleEntityNotFound(_0x3e6947){return function(_0x5e4c53){if(!_0x5e4c53){_0x3e6947[_0xf2df('0xd')](0x194);}return _0x5e4c53;};}function handleError(_0x25e247,_0x5455f7){_0x5455f7=_0x5455f7||0x1f4;return function(_0x2db353){logger[_0xf2df('0x18')](_0x2db353[_0xf2df('0x19')]);if(_0x2db353[_0xf2df('0x1a')]){delete _0x2db353[_0xf2df('0x1a')];}_0x25e247['status'](_0x5455f7)['send'](_0x2db353);};}exports[_0xf2df('0x1b')]=function(_0x597a6,_0x3b0fb3){var _0x330613={};var _0x3b3e48=_[_0xf2df('0x1c')](db['OpenchannelInteraction'][_0xf2df('0x1d')],function(_0x5916ba){return{'name':_0x5916ba['fieldName'],'type':_0x5916ba[_0xf2df('0x1e')][_0xf2df('0x1f')]};});_0x330613=qs['getOptions'](_0x3b3e48,_0x597a6);return interaction[_0xf2df('0x20')](_0xf2df('0x21'),_0x597a6[_0xf2df('0x22')],_0x597a6[_0xf2df('0x23')],_0x330613,_0x3b3e48)[_0xf2df('0x15')](respondWithFilteredResult(_0x3b0fb3,_0x330613))[_0xf2df('0x24')](handleError(_0x3b0fb3,null));};exports['show']=function(_0x44f075,_0x59f077){var _0x2c9915={};if(_0x44f075[_0xf2df('0x22')][_0xf2df('0x1e')]&&_0x44f075['query'][_0xf2df('0x1e')]===_0xf2df('0x25')){_0x2c9915['from']=_0x44f075[_0xf2df('0x26')]['id'];}else{_0x2c9915['id']=_0x44f075[_0xf2df('0x26')]['id'];}var _0x4f0c5e={'raw':![],'where':_0x2c9915},_0x478a02={};_0x478a02[_0xf2df('0x27')]=_['keys'](db[_0xf2df('0x28')][_0xf2df('0x1d')]);_0x478a02[_0xf2df('0x22')]=_['keys'](_0x44f075['query']);_0x478a02[_0xf2df('0x29')]=_[_0xf2df('0x2a')](_0x478a02[_0xf2df('0x27')],_0x478a02[_0xf2df('0x22')]);_0x4f0c5e['attributes']=_[_0xf2df('0x2a')](_0x478a02[_0xf2df('0x27')],qs[_0xf2df('0x2b')](_0x44f075['query'][_0xf2df('0x2b')]));_0x4f0c5e['attributes']=_0x4f0c5e[_0xf2df('0x2c')][_0xf2df('0x2d')]?_0x4f0c5e[_0xf2df('0x2c')]:_0x478a02[_0xf2df('0x27')];if(_0x44f075[_0xf2df('0x22')][_0xf2df('0x2e')]){_0x4f0c5e[_0xf2df('0x2f')]=[{'all':!![]}];}_0x4f0c5e=_[_0xf2df('0x30')]({},_0x4f0c5e,_0x44f075[_0xf2df('0x31')]);return db[_0xf2df('0x28')][_0xf2df('0x32')](_0x4f0c5e)[_0xf2df('0x15')](handleEntityNotFound(_0x59f077,null))[_0xf2df('0x15')](respondWithResult(_0x59f077,null))[_0xf2df('0x24')](handleError(_0x59f077,null));};exports[_0xf2df('0x33')]=function(_0x4d4b3b,_0x408259){return db[_0xf2df('0x28')][_0xf2df('0x33')](_0x4d4b3b[_0xf2df('0x34')],{})[_0xf2df('0x15')](respondWithResult(_0x408259,0xc9))['catch'](handleError(_0x408259,null));};exports[_0xf2df('0x14')]=function(_0x2a3da8,_0x58a48e){if(_0x2a3da8[_0xf2df('0x34')]['id']){delete _0x2a3da8[_0xf2df('0x34')]['id'];}return db[_0xf2df('0x28')][_0xf2df('0x32')]({'where':{'id':_0x2a3da8[_0xf2df('0x26')]['id']}})['then'](handleEntityNotFound(_0x58a48e,null))[_0xf2df('0x15')](saveUpdates(_0x2a3da8[_0xf2df('0x34')],null))[_0xf2df('0x15')](respondWithResult(_0x58a48e,null))[_0xf2df('0x24')](handleError(_0x58a48e,null));};exports['destroy']=function(_0x3ef605,_0x12a3fb){return db[_0xf2df('0x28')]['find']({'where':{'id':_0x3ef605[_0xf2df('0x26')]['id']}})['then'](handleEntityNotFound(_0x12a3fb,null))[_0xf2df('0x15')](removeEntity(_0x12a3fb,null))['catch'](handleError(_0x12a3fb,null));};exports['describe']=function(_0x511197,_0x318b04){return db[_0xf2df('0x28')][_0xf2df('0x35')]()[_0xf2df('0x15')](respondWithResult(_0x318b04,null))[_0xf2df('0x24')](handleError(_0x318b04,null));};exports[_0xf2df('0x36')]=function(_0x139e42,_0x1eeb13){return db[_0xf2df('0x37')]['find']({'where':{'id':_0x139e42['params']['id']}})[_0xf2df('0x15')](handleEntityNotFound(_0x1eeb13,null))['then'](function(_0x5a689b){if(_0x5a689b){return _0x5a689b[_0xf2df('0x36')](_0x139e42[_0xf2df('0x34')][_0xf2df('0x38')],_['omit'](_0x139e42['body'],[_0xf2df('0x38'),'id'])||{});}})[_0xf2df('0x15')](respondWithResult(_0x1eeb13,null))[_0xf2df('0x24')](handleError(_0x1eeb13,null));};exports[_0xf2df('0x39')]=function(_0x4cbf04,_0x134442){var _0x3575f8={'raw':![],'where':{}};var _0x51f743={};var _0x474ece={'count':0x0,'rows':[]};return db['OpenchannelInteraction'][_0xf2df('0x3a')]({'where':{'id':_0x4cbf04[_0xf2df('0x26')]['id']}})[_0xf2df('0x15')](handleEntityNotFound(_0x134442,null))[_0xf2df('0x15')](function(_0x26e7dd){if(_0x26e7dd){_0x51f743[_0xf2df('0x27')]=_[_0xf2df('0x3b')](db[_0xf2df('0x37')][_0xf2df('0x1d')]);_0x51f743['query']=_[_0xf2df('0x3b')](_0x4cbf04[_0xf2df('0x22')]);_0x51f743[_0xf2df('0x29')]=_[_0xf2df('0x2a')](_0x51f743[_0xf2df('0x27')],_0x51f743[_0xf2df('0x22')]);_0x3575f8[_0xf2df('0x2c')]=_[_0xf2df('0x2a')](_0x51f743[_0xf2df('0x27')],qs[_0xf2df('0x2b')](_0x4cbf04[_0xf2df('0x22')]['fields']));_0x3575f8['attributes']=_0x3575f8[_0xf2df('0x2c')][_0xf2df('0x2d')]?_0x3575f8[_0xf2df('0x2c')]:_0x51f743[_0xf2df('0x27')];if(!_0x4cbf04[_0xf2df('0x22')][_0xf2df('0x3c')](_0xf2df('0x3d'))){_0x3575f8['limit']=qs[_0xf2df('0x12')](_0x4cbf04['query'][_0xf2df('0x12')]);_0x3575f8[_0xf2df('0x10')]=qs['offset'](_0x4cbf04[_0xf2df('0x22')][_0xf2df('0x10')]);}_0x3575f8['order']=qs[_0xf2df('0x3e')](_0x4cbf04[_0xf2df('0x22')]['sort']);_0x3575f8[_0xf2df('0x3f')]=qs[_0xf2df('0x29')](_[_0xf2df('0x40')](_0x4cbf04[_0xf2df('0x22')],_0x51f743['filters']));_0x3575f8[_0xf2df('0x3f')][_0xf2df('0x41')]=_0x26e7dd['id'];if(_0x4cbf04[_0xf2df('0x22')]['filter']){_0x3575f8[_0xf2df('0x3f')]=_[_0xf2df('0x30')](_0x3575f8[_0xf2df('0x3f')],{'$or':_[_0xf2df('0x1c')](_0x3575f8[_0xf2df('0x2c')],function(_0x22e060){var _0xc76f19={};_0xc76f19[_0x22e060]={'$like':'%'+_0x4cbf04['query'][_0xf2df('0x42')]+'%'};return _0xc76f19;})});}if(_0x4cbf04[_0xf2df('0x22')][_0xf2df('0x43')]){var _0x54881b=_0x4cbf04['query'][_0xf2df('0x43')][_0xf2df('0x44')](',');var _0x5099c8={};_0x5099c8[_0x54881b[0x0]]={'$gte':moment(_0x54881b[0x1])['format'](_0xf2df('0x45'))};_0x3575f8['where']=_['merge'](_0x3575f8[_0xf2df('0x3f')],_0x5099c8);}_0x3575f8=_['merge']({},_0x3575f8,_0x4cbf04[_0xf2df('0x31')]);return db[_0xf2df('0x37')][_0xf2df('0x13')]({'where':_0x3575f8[_0xf2df('0x3f')]})[_0xf2df('0x15')](function(_0x485fdb){_0x474ece[_0xf2df('0x13')]=_0x485fdb;if(_0x4cbf04[_0xf2df('0x22')]['includeAll']){_0x3575f8[_0xf2df('0x2f')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x3575f8);})[_0xf2df('0x15')](function(_0x362425){_0x474ece[_0xf2df('0x46')]=_0x362425;return _0x474ece;});}})[_0xf2df('0x15')](respondWithFilteredResult(_0x134442,_0x3575f8))['catch'](handleError(_0x134442,null));};exports['addTags']=function(_0x306415,_0x5c4968){return db['OpenchannelInteraction'][_0xf2df('0x32')]({'where':{'id':_0x306415[_0xf2df('0x26')]['id']}})['then'](handleEntityNotFound(_0x5c4968,null))['then'](function(_0x135b90){if(_0x135b90){return _0x135b90['setTags'](_0x306415['body'][_0xf2df('0x38')],_[_0xf2df('0x47')](_0x306415[_0xf2df('0x34')],[_0xf2df('0x38'),'id'])||{})[_0xf2df('0x48')](function(){return db[_0xf2df('0x49')][_0xf2df('0x20')]({'attributes':['id',_0xf2df('0x1a'),_0xf2df('0x4a')],'where':{'id':_0x306415['body'][_0xf2df('0x38')]}});})[_0xf2df('0x15')](function(_0x3d1b2b){socket[_0xf2df('0x4b')](_0xf2df('0x4c'),{'id':Number(_0x306415[_0xf2df('0x26')]['id']),'tags':_0x3d1b2b||[]});return{'id':Number(_0x306415[_0xf2df('0x26')]['id']),'tags':_0x3d1b2b||[]};});}})[_0xf2df('0x15')](respondWithResult(_0x5c4968,null))[_0xf2df('0x24')](handleError(_0x5c4968,null));};exports[_0xf2df('0x4d')]=function(_0x553463,_0x4a0b12){return db[_0xf2df('0x28')][_0xf2df('0x32')]({'where':{'id':_0x553463[_0xf2df('0x26')]['id']}})[_0xf2df('0x15')](handleEntityNotFound(_0x4a0b12,null))[_0xf2df('0x15')](function(_0x3e5dbf){if(_0x3e5dbf){return _0x3e5dbf[_0xf2df('0x4d')](_0x553463['query'][_0xf2df('0x38')]);}})[_0xf2df('0x15')](respondWithStatusCode(_0x4a0b12,null))[_0xf2df('0x24')](handleError(_0x4a0b12,null));};exports[_0xf2df('0x4e')]=function(_0x213723,_0x3bf4b2){var _0x5f2240=moment()[_0xf2df('0x4f')]()[_0xf2df('0x50')]();var _0x65a910=path[_0xf2df('0x51')](config[_0xf2df('0x52')],_0xf2df('0x53'),'files',_0xf2df('0x54'));var _0x520dc1=path[_0xf2df('0x51')](config[_0xf2df('0x52')],_0xf2df('0x53'),_0xf2df('0x55'),'attachments');var _0x159c7b=path[_0xf2df('0x51')](_0x65a910,_0x5f2240);var _0xee57fb=util[_0xf2df('0x56')]('transcript-%d-%s.zip',_0x213723['params']['id'],_0x5f2240);var _0x5603bd=path[_0xf2df('0x51')](_0x65a910,_0xee57fb);var _0x48bae5=[];_0x48bae5[_0xf2df('0x57')]({'model':db[_0xf2df('0x58')],'as':_0xf2df('0x58'),'attributes':['id',_0xf2df('0x59')],'raw':!![]});_0x48bae5[_0xf2df('0x57')]({'model':db[_0xf2df('0x5a')],'as':'Contact','attributes':['id',_0xf2df('0x5b'),_0xf2df('0x5c')],'raw':!![]});if(_0x213723[_0xf2df('0x22')][_0xf2df('0x5d')]){_0x48bae5[_0xf2df('0x57')]({'model':db[_0xf2df('0x5e')],'as':_0xf2df('0x5e'),'raw':!![]});}var _0xb9ca8d=[{'model':db[_0xf2df('0x37')],'as':'Messages','attributes':['id',_0xf2df('0x34'),'createdAt',_0xf2df('0x5f'),_0xf2df('0x60'),_0xf2df('0x61')],'include':_0x48bae5}];_0xb9ca8d[_0xf2df('0x57')]({'model':db[_0xf2df('0x62')],'as':'Account','attributes':['id',_0xf2df('0x1a')]});_0xb9ca8d['push']({'model':db[_0xf2df('0x58')],'as':'Owner','attributes':['id',_0xf2df('0x59')]});return db['OpenchannelInteraction'][_0xf2df('0x32')]({'where':{'id':_0x213723['params']['id']},'include':_0xb9ca8d})[_0xf2df('0x15')](handleEntityNotFound(_0x3bf4b2,null))[_0xf2df('0x15')](function(_0x588f21){if(_0x588f21){var _0x50e892=_0x588f21[_0xf2df('0x63')]({'plain':!![]});fs[_0xf2df('0x64')](_0x159c7b);var _0x429e43={'channel':'Openchannel','account':_0x50e892[_0xf2df('0x65')]['name'],'agent':_0x50e892[_0xf2df('0x66')]?_0x50e892[_0xf2df('0x66')][_0xf2df('0x59')]:'N.A.','createdAt':moment(_0x50e892[_0xf2df('0x67')])[_0xf2df('0x56')](_0xf2df('0x45'))[_0xf2df('0x50')](),'closedAt':_0x50e892[_0xf2df('0x68')]?moment(_0x50e892[_0xf2df('0x69')])[_0xf2df('0x56')](_0xf2df('0x45'))[_0xf2df('0x50')]():'','disposition':_0x50e892['disposition'],'visibility':_0x50e892[_0xf2df('0x6a')]?_0xf2df('0x6b'):'Private','messages':_(_0x50e892['Messages'])[_0xf2df('0x42')]({'secret':![]})[_0xf2df('0x1c')](function(_0x4aab55){if(_0x4aab55[_0xf2df('0x5e')]){var _0x45d005=path[_0xf2df('0x51')](_0x520dc1,_0x4aab55[_0xf2df('0x5e')][_0xf2df('0x6c')]);if(fs[_0xf2df('0x6d')](_0x45d005)){fs[_0xf2df('0x6e')](_0x45d005)['pipe'](fs[_0xf2df('0x6f')](path[_0xf2df('0x51')](_0x159c7b,_0x4aab55[_0xf2df('0x5e')][_0xf2df('0x6c')])));}}return{'date':moment(_0x4aab55[_0xf2df('0x67')])['format'](_0xf2df('0x45'))[_0xf2df('0x50')](),'sender':_0x4aab55['direction']==='out'?_0x4aab55[_0xf2df('0x58')]?_0x4aab55[_0xf2df('0x58')][_0xf2df('0x59')]:_0xf2df('0x70'):_0x4aab55[_0xf2df('0x71')]['firstName']+(_0x4aab55[_0xf2df('0x71')][_0xf2df('0x5c')]?'\x20'+_0x4aab55[_0xf2df('0x71')][_0xf2df('0x5c')]:''),'body':_0x4aab55['Attachment']?_0x4aab55[_0xf2df('0x5e')][_0xf2df('0x6c')]:_0x4aab55['body'],'direction':_0x4aab55[_0xf2df('0x5f')]===_0xf2df('0x72')?'A':'C','secret':_0x4aab55[_0xf2df('0x60')],'read':_0x4aab55[_0xf2df('0x61')],'attachment':_0x4aab55[_0xf2df('0x5e')]};})[_0xf2df('0x73')]()};return ejs[_0xf2df('0x74')](path['join'](config[_0xf2df('0x52')],_0xf2df('0x53'),'views','downloadInteraction.ejs'),{'interaction':_0x429e43})[_0xf2df('0x15')](function(_0x2e2288){var _0xf5a7ad=path['join'](_0x159c7b,_0xf2df('0x75')+_0x50e892['id']+'-'+_0x5f2240+'.pdf');var _0x348e0c={'path':_0xf5a7ad,'channel':_0xf2df('0x76'),'interactionId':_0x50e892['id']};return pdf[_0xf2df('0x77')](_0x2e2288,_0x348e0c);})[_0xf2df('0x15')](function(){return new Promise(function(_0x1d0007,_0x19bf18){zipdir(_0x159c7b,{'saveTo':_0x5603bd},function(_0x4b6200,_0x4d8ff1){if(_0x4b6200)return _0x19bf18(_0x4b6200);return _0x1d0007(_0x4d8ff1);});})[_0xf2df('0x15')](function(){return new Promise(function(_0xd2dcd,_0x4af641){rimraf(_0x159c7b,function(_0x1ea946){if(_0x1ea946)_0x4af641(_0x1ea946);return _0xd2dcd();});});})[_0xf2df('0x15')](function(){return _0x3bf4b2[_0xf2df('0x4e')](_0x5603bd,_0xee57fb,function(_0x10b6fa){if(_0x10b6fa){logger[_0xf2df('0x18')]('Unable\x20to\x20delete\x20zip\x20file',_0x10b6fa);}else{fs[_0xf2df('0x78')](_0x5603bd);}});});});}else{return _0x3bf4b2[_0xf2df('0xd')](0xc8);}})[_0xf2df('0x24')](handleError(_0x3bf4b2,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 0f3754e..2404b4d 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 _0x775a=['OpenchannelMessage','setMaxListeners','update','getUsers','then','Users','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook','../../mysqldb','OpenchannelInteraction'];(function(_0x2840a3,_0x3a64b3){var _0x2c4d2d=function(_0x3dce27){while(--_0x3dce27){_0x2840a3['push'](_0x2840a3['shift']());}};_0x2c4d2d(++_0x3a64b3);}(_0x775a,0x132));var _0xa775=function(_0x4d80cc,_0x770848){_0x4d80cc=_0x4d80cc-0x0;var _0x6f1103=_0x775a[_0x4d80cc];return _0x6f1103;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0xa775('0x0'))['db'][_0xa775('0x1')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xa775('0x2')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xa775('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa775('0x4'),'afterDestroy':'remove'};function emitEvent(_0x74aec6){return function(_0x5c94c6,_0x519f20,_0x4c8286){_0x5c94c6[_0xa775('0x5')]({'attributes':['id'],'raw':!![]})[_0xa775('0x6')](function(_0x3c3d76){_0x5c94c6['setDataValue'](_0xa775('0x7'),_0x3c3d76['map'](function(_0x3134c1){return{'id':_0x3134c1['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x5c94c6['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa775('0x6')](function(_0x57aee1){_0x5c94c6[_0xa775('0x8')](_0xa775('0x9'),_0x57aee1['length']);OpenchannelInteractionEvents[_0xa775('0xa')](_0x74aec6+':'+_0x5c94c6['id'],_0x5c94c6);OpenchannelInteractionEvents[_0xa775('0xa')](_0x74aec6,_0x5c94c6);_0x4c8286(null);})[_0xa775('0xb')](_0x4c8286(null));};}for(var e in events){if(events[_0xa775('0xc')](e)){var event=events[e];OpenchannelInteraction[_0xa775('0xd')](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x0684=['getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x293067,_0x15c85c){var _0x3ab198=function(_0x3f52c8){while(--_0x3f52c8){_0x293067['push'](_0x293067['shift']());}};_0x3ab198(++_0x15c85c);}(_0x0684,0xbc));var _0x4068=function(_0x473b9d,_0x471734){_0x473b9d=_0x473b9d-0x0;var _0x37a0fe=_0x0684[_0x473b9d];return _0x37a0fe;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x4068('0x0'))['db']['OpenchannelInteraction'];var OpenchannelMessage=require(_0x4068('0x0'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x4068('0x1')](0x0);var events={'afterCreate':_0x4068('0x2'),'afterUpdate':_0x4068('0x3'),'afterDestroy':'remove'};function emitEvent(_0x238447){return function(_0xf2ec0f,_0x28d3f0,_0x2429d3){_0xf2ec0f[_0x4068('0x4')]({'attributes':['id'],'raw':!![]})[_0x4068('0x5')](function(_0x1fb0b8){_0xf2ec0f[_0x4068('0x6')]('Users',_0x1fb0b8[_0x4068('0x7')](function(_0x493487){return{'id':_0x493487['id']};}));return OpenchannelMessage[_0x4068('0x8')]({'where':{'OpenchannelInteractionId':_0xf2ec0f['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4068('0x5')](function(_0x156b8b){_0xf2ec0f[_0x4068('0x6')](_0x4068('0x9'),_0x156b8b[_0x4068('0xa')]);OpenchannelInteractionEvents[_0x4068('0xb')](_0x238447+':'+_0xf2ec0f['id'],_0xf2ec0f);OpenchannelInteractionEvents[_0x4068('0xb')](_0x238447,_0xf2ec0f);_0x2429d3(null);})[_0x4068('0xc')](_0x2429d3(null));};}for(var e in events){if(events[_0x4068('0xd')](e)){var event=events[e];OpenchannelInteraction[_0x4068('0xe')](e,emitEvent(event));}}module[_0x4068('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 def4579..714432a 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 _0x1448=['utf8mb4','utf8mb4_unicode_ci','changed','closed','format','lodash','../../config/logger','moment','bluebird','path','../../config/environment','./openchannelInteraction.attributes','exports','define'];(function(_0xc6800a,_0x4eac70){var _0x4919d3=function(_0x1ccfa6){while(--_0x1ccfa6){_0xc6800a['push'](_0xc6800a['shift']());}};_0x4919d3(++_0x4eac70);}(_0x1448,0x18d));var _0x8144=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1448[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8144('0x0'));var util=require('util');var logger=require(_0x8144('0x1'))('api');var moment=require(_0x8144('0x2'));var BPromise=require(_0x8144('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8144('0x4'));var rimraf=require('rimraf');var config=require(_0x8144('0x5'));var attributes=require(_0x8144('0x6'));module[_0x8144('0x7')]=function(_0xd83cde,_0x2ff848){return _0xd83cde[_0x8144('0x8')]('OpenchannelInteraction',attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8144('0x9'),'collate':_0x8144('0xa'),'hooks':{'beforeUpdate':function(_0x4a5035,_0x448c24,_0x44fe62){if(_0x4a5035[_0x8144('0xb')](_0x8144('0xc'))){_0x4a5035['closedAt']=moment()[_0x8144('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x44fe62(null,_0x4a5035);}}});}; \ No newline at end of file +var _0x5041=['../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util','api','moment','request-promise','path','rimraf'];(function(_0x32652e,_0x57bac1){var _0xc0c13d=function(_0x484399){while(--_0x484399){_0x32652e['push'](_0x32652e['shift']());}};_0xc0c13d(++_0x57bac1);}(_0x5041,0x1ce));var _0x1504=function(_0x4ea6b7,_0x51567e){_0x4ea6b7=_0x4ea6b7-0x0;var _0x3aaca2=_0x5041[_0x4ea6b7];return _0x3aaca2;};'use strict';var _=require('lodash');var util=require(_0x1504('0x0'));var logger=require('../../config/logger')(_0x1504('0x1'));var moment=require(_0x1504('0x2'));var BPromise=require('bluebird');var rp=require(_0x1504('0x3'));var fs=require('fs');var path=require(_0x1504('0x4'));var rimraf=require(_0x1504('0x5'));var config=require(_0x1504('0x6'));var attributes=require(_0x1504('0x7'));module[_0x1504('0x8')]=function(_0x40bf61,_0x2f689d){return _0x40bf61[_0x1504('0x9')](_0x1504('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1504('0xb'),'collate':_0x1504('0xc'),'hooks':{'beforeUpdate':function(_0x339b9a,_0x326205,_0x4e1dc7){if(_0x339b9a[_0x1504('0xd')](_0x1504('0xe'))){_0x339b9a[_0x1504('0xf')]=moment()[_0x1504('0x10')](_0x1504('0x11'));}_0x4e1dc7(null,_0x339b9a);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 18c7c65..926a229 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 _0xa1a4=['result','UpdateOpenchannelInteraction','update','body','options','raw','attributes','stringify','catch','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','where','addTags','ids','omit','AddTags','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','socket.io-emitter','./openchannelInteraction.socket','request','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x5bbcb5,_0x58e5e2){var _0x5a375f=function(_0x100e32){while(--_0x100e32){_0x5bbcb5['push'](_0x5bbcb5['shift']());}};_0x5a375f(++_0x58e5e2);}(_0xa1a4,0x122));var _0x4a1a=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xa1a4[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4a1a('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4a1a('0x1'))['db'];var utils=require(_0x4a1a('0x2'));var logger=require(_0x4a1a('0x3'))(_0x4a1a('0x4'));var config=require(_0x4a1a('0x5'));var jayson=require(_0x4a1a('0x6'));var client=jayson[_0x4a1a('0x7')][_0x4a1a('0x8')]({'port':0x232a});config[_0x4a1a('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4a1a('0xa'))(new Redis(config[_0x4a1a('0x9')]));require(_0x4a1a('0xb'))['register'](socket);function respondWithRpcPromise(_0xd3d61a,_0x629232,_0x1d5fae){return new BPromise(function(_0x151961,_0x3b8c23){return client[_0x4a1a('0xc')](_0xd3d61a,_0x1d5fae)[_0x4a1a('0xd')](function(_0x7d299c){logger[_0x4a1a('0xe')](_0x4a1a('0xf'),_0x629232,'request\x20sent');logger[_0x4a1a('0x10')](_0x4a1a('0x11'),_0x629232,_0x4a1a('0x12'),JSON['stringify'](_0x7d299c));if(_0x7d299c[_0x4a1a('0x13')]){if(_0x7d299c['error'][_0x4a1a('0x14')]===0x1f4){logger[_0x4a1a('0x13')](_0x4a1a('0xf'),_0x629232,_0x7d299c[_0x4a1a('0x13')][_0x4a1a('0x15')]);return _0x3b8c23(_0x7d299c[_0x4a1a('0x13')][_0x4a1a('0x15')]);}logger[_0x4a1a('0x13')](_0x4a1a('0xf'),_0x629232,_0x7d299c[_0x4a1a('0x13')]['message']);return _0x151961(_0x7d299c[_0x4a1a('0x13')][_0x4a1a('0x15')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x629232,'request\x20sent');_0x151961(_0x7d299c[_0x4a1a('0x16')][_0x4a1a('0x15')]);}})['catch'](function(_0x496704){logger[_0x4a1a('0x13')](_0x4a1a('0xf'),_0x629232,_0x496704);_0x3b8c23(_0x496704);});});}exports[_0x4a1a('0x17')]=function(_0x298729){var _0x23d9f3=this;return new Promise(function(_0x427c52,_0x5f2cb9){return db['OpenchannelInteraction'][_0x4a1a('0x18')](_0x298729[_0x4a1a('0x19')],{'raw':_0x298729[_0x4a1a('0x1a')]?_0x298729['options'][_0x4a1a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x298729[_0x4a1a('0x1a')]?_0x298729[_0x4a1a('0x1a')]['where']||null:null,'attributes':_0x298729[_0x4a1a('0x1a')]?_0x298729[_0x4a1a('0x1a')][_0x4a1a('0x1c')]||null:null,'limit':_0x298729[_0x4a1a('0x1a')]?_0x298729['options']['limit']||null:null})['then'](function(_0x49e078){logger['info']('UpdateOpenchannelInteraction',_0x298729);logger['debug'](_0x4a1a('0x17'),_0x298729,JSON[_0x4a1a('0x1d')](_0x49e078));_0x427c52(_0x49e078);})[_0x4a1a('0x1e')](function(_0x6db945){logger[_0x4a1a('0x13')](_0x4a1a('0x17'),_0x6db945[_0x4a1a('0x15')],_0x298729);_0x5f2cb9(_0x23d9f3['error'](0x1f4,_0x6db945[_0x4a1a('0x15')]));});});};exports[_0x4a1a('0x1f')]=function(_0x5d9403){return new Promise(function(_0x44f44c,_0x342b22){return db[_0x4a1a('0x20')][_0x4a1a('0x21')]({'where':_0x5d9403[_0x4a1a('0x1a')]?_0x5d9403[_0x4a1a('0x1a')][_0x4a1a('0x22')]||null:null})[_0x4a1a('0xd')](function(_0x4ae9a7){if(_0x4ae9a7){return _0x4ae9a7[_0x4a1a('0x23')](_0x5d9403[_0x4a1a('0x19')][_0x4a1a('0x24')],_[_0x4a1a('0x25')](_0x5d9403[_0x4a1a('0x19')],[_0x4a1a('0x24'),'id'])||{});}})['spread'](function(_0x54fcec){logger[_0x4a1a('0xe')](_0x4a1a('0x26'),_0x5d9403);logger[_0x4a1a('0x10')]('AddTags',_0x5d9403,JSON['stringify'](_0x54fcec));_0x44f44c(_0x54fcec);})[_0x4a1a('0x1e')](function(_0x28aff6){logger[_0x4a1a('0x13')]('AddTags',_0x28aff6[_0x4a1a('0x15')],_0x5d9403);_0x342b22(_this[_0x4a1a('0x13')](0x1f4,_0x28aff6[_0x4a1a('0x15')]));});});}; \ No newline at end of file +var _0xd4eb=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','UpdateOpenchannelInteraction','update','body','options','raw','where','attributes','limit','stringify','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment'];(function(_0x2f7f6f,_0xc9e54d){var _0x52aca6=function(_0x1ec821){while(--_0x1ec821){_0x2f7f6f['push'](_0x2f7f6f['shift']());}};_0x52aca6(++_0xc9e54d);}(_0xd4eb,0x7e));var _0xbd4e=function(_0x45259b,_0x37f635){_0x45259b=_0x45259b-0x0;var _0x42db02=_0xd4eb[_0x45259b];return _0x42db02;};'use strict';var _=require(_0xbd4e('0x0'));var util=require(_0xbd4e('0x1'));var moment=require(_0xbd4e('0x2'));var BPromise=require(_0xbd4e('0x3'));var rs=require(_0xbd4e('0x4'));var fs=require('fs');var Redis=require(_0xbd4e('0x5'));var db=require(_0xbd4e('0x6'))['db'];var utils=require(_0xbd4e('0x7'));var logger=require('../../config/logger')(_0xbd4e('0x8'));var config=require(_0xbd4e('0x9'));var jayson=require(_0xbd4e('0xa'));var client=jayson['client'][_0xbd4e('0xb')]({'port':0x232a});config[_0xbd4e('0xc')]=_['defaults'](config[_0xbd4e('0xc')],{'host':_0xbd4e('0xd'),'port':0x18eb});var socket=require(_0xbd4e('0xe'))(new Redis(config[_0xbd4e('0xc')]));require('./openchannelInteraction.socket')[_0xbd4e('0xf')](socket);function respondWithRpcPromise(_0x5000ad,_0x4ca0e3,_0x2ded07){return new BPromise(function(_0x44d602,_0x327fb8){return client['request'](_0x5000ad,_0x2ded07)[_0xbd4e('0x10')](function(_0x427ca){logger[_0xbd4e('0x11')](_0xbd4e('0x12'),_0x4ca0e3,'request\x20sent');logger[_0xbd4e('0x13')](_0xbd4e('0x14'),_0x4ca0e3,_0xbd4e('0x15'),JSON['stringify'](_0x427ca));if(_0x427ca[_0xbd4e('0x16')]){if(_0x427ca['error']['code']===0x1f4){logger['error'](_0xbd4e('0x12'),_0x4ca0e3,_0x427ca[_0xbd4e('0x16')][_0xbd4e('0x17')]);return _0x327fb8(_0x427ca[_0xbd4e('0x16')][_0xbd4e('0x17')]);}logger[_0xbd4e('0x16')](_0xbd4e('0x12'),_0x4ca0e3,_0x427ca[_0xbd4e('0x16')][_0xbd4e('0x17')]);return _0x44d602(_0x427ca[_0xbd4e('0x16')][_0xbd4e('0x17')]);}else{logger['info']('OpenchannelInteraction,\x20%s,\x20%s',_0x4ca0e3,_0xbd4e('0x15'));_0x44d602(_0x427ca[_0xbd4e('0x18')]['message']);}})[_0xbd4e('0x19')](function(_0x38bc87){logger[_0xbd4e('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4ca0e3,_0x38bc87);_0x327fb8(_0x38bc87);});});}exports[_0xbd4e('0x1a')]=function(_0x490466){var _0x62b9f0=this;return new Promise(function(_0x21aa3b,_0xa1a6d7){return db['OpenchannelInteraction'][_0xbd4e('0x1b')](_0x490466[_0xbd4e('0x1c')],{'raw':_0x490466[_0xbd4e('0x1d')]?_0x490466[_0xbd4e('0x1d')][_0xbd4e('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x490466[_0xbd4e('0x1d')]?_0x490466[_0xbd4e('0x1d')][_0xbd4e('0x1f')]||null:null,'attributes':_0x490466[_0xbd4e('0x1d')]?_0x490466[_0xbd4e('0x1d')][_0xbd4e('0x20')]||null:null,'limit':_0x490466['options']?_0x490466[_0xbd4e('0x1d')][_0xbd4e('0x21')]||null:null})[_0xbd4e('0x10')](function(_0x5862ee){logger['info'](_0xbd4e('0x1a'),_0x490466);logger['debug'](_0xbd4e('0x1a'),_0x490466,JSON[_0xbd4e('0x22')](_0x5862ee));_0x21aa3b(_0x5862ee);})[_0xbd4e('0x19')](function(_0x570651){logger[_0xbd4e('0x16')]('UpdateOpenchannelInteraction',_0x570651[_0xbd4e('0x17')],_0x490466);_0xa1a6d7(_0x62b9f0[_0xbd4e('0x16')](0x1f4,_0x570651[_0xbd4e('0x17')]));});});};exports[_0xbd4e('0x23')]=function(_0x3fa541){return new Promise(function(_0x35eac4,_0x193724){return db[_0xbd4e('0x24')][_0xbd4e('0x25')]({'where':_0x3fa541[_0xbd4e('0x1d')]?_0x3fa541['options']['where']||null:null})[_0xbd4e('0x10')](function(_0x31f861){if(_0x31f861){return _0x31f861[_0xbd4e('0x26')](_0x3fa541['body'][_0xbd4e('0x27')],_[_0xbd4e('0x28')](_0x3fa541[_0xbd4e('0x1c')],['ids','id'])||{});}})[_0xbd4e('0x29')](function(_0x7f52f3){logger[_0xbd4e('0x11')](_0xbd4e('0x2a'),_0x3fa541);logger[_0xbd4e('0x13')]('AddTags',_0x3fa541,JSON['stringify'](_0x7f52f3));_0x35eac4(_0x7f52f3);})[_0xbd4e('0x19')](function(_0x1a1703){logger[_0xbd4e('0x16')](_0xbd4e('0x2a'),_0x1a1703[_0xbd4e('0x17')],_0x3fa541);_0x193724(_this[_0xbd4e('0x16')](0x1f4,_0x1a1703[_0xbd4e('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index c1b8640..5d3b8d8 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 _0x46dd=['length','openchannelInteraction:','remove','emit','removeListener','register'];(function(_0x34232c,_0x18e61d){var _0x4d4f4e=function(_0x1aeb3d){while(--_0x1aeb3d){_0x34232c['push'](_0x34232c['shift']());}};_0x4d4f4e(++_0x18e61d);}(_0x46dd,0xe0));var _0xd46d=function(_0x9df3d8,_0x4074e3){_0x9df3d8=_0x9df3d8-0x0;var _0x366da1=_0x46dd[_0x9df3d8];return _0x366da1;};'use strict';var OpenchannelInteractionEvents=require('./openchannelInteraction.events');var events=['save',_0xd46d('0x0'),'update'];function createListener(_0x5309a1,_0x119d70){return function(_0x9e648a){_0x119d70[_0xd46d('0x1')](_0x5309a1,_0x9e648a);};}function removeListener(_0x2221c2,_0x171c65){return function(){OpenchannelInteractionEvents[_0xd46d('0x2')](_0x2221c2,_0x171c65);};}exports[_0xd46d('0x3')]=function(_0x4f9336){for(var _0x424872=0x0,_0x2ace3e=events[_0xd46d('0x4')];_0x424872<_0x2ace3e;_0x424872++){var _0x3a4c10=events[_0x424872];var _0x166b70=createListener(_0xd46d('0x5')+_0x3a4c10,_0x4f9336);OpenchannelInteractionEvents['on'](_0x3a4c10,_0x166b70);}}; \ No newline at end of file +var _0x7b54=['openchannelInteraction:','./openchannelInteraction.events','save','update','emit','removeListener','length'];(function(_0x11f895,_0x584c30){var _0x5ee01e=function(_0x351dae){while(--_0x351dae){_0x11f895['push'](_0x11f895['shift']());}};_0x5ee01e(++_0x584c30);}(_0x7b54,0xfd));var _0x47b5=function(_0x312abc,_0x17f25c){_0x312abc=_0x312abc-0x0;var _0x314298=_0x7b54[_0x312abc];return _0x314298;};'use strict';var OpenchannelInteractionEvents=require(_0x47b5('0x0'));var events=[_0x47b5('0x1'),'remove',_0x47b5('0x2')];function createListener(_0x776030,_0x435b4f){return function(_0x83f5af){_0x435b4f[_0x47b5('0x3')](_0x776030,_0x83f5af);};}function removeListener(_0x449eda,_0x32a6f8){return function(){OpenchannelInteractionEvents[_0x47b5('0x4')](_0x449eda,_0x32a6f8);};}exports['register']=function(_0x32d9c9){for(var _0x2ba08d=0x0,_0x5d910d=events[_0x47b5('0x5')];_0x2ba08d<_0x5d910d;_0x2ba08d++){var _0x1938ba=events[_0x2ba08d];var _0x24c29f=createListener(_0x47b5('0x6')+_0x1938ba,_0x32d9c9);OpenchannelInteractionEvents['on'](_0x1938ba,_0x24c29f);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index d5dbda4..b7f0e18 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 _0x9c44=['index','get','/describe','/:id','show','tracked','openchannel','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./openchannelMessage.controller','isAuthenticated'];(function(_0xc988e4,_0x4e3b13){var _0x2c9d58=function(_0x516967){while(--_0x516967){_0xc988e4['push'](_0xc988e4['shift']());}};_0x2c9d58(++_0x4e3b13);}(_0x9c44,0x178));var _0x49c4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x9c44[_0xfae23b];return _0x200640;};'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 fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['describe']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x49c4('0xd')](_0x49c4('0xe'),'openchannelmessage:create'),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0x11')]);router[_0x49c4('0x10')]('/:id/accept',auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router['put'](_0x49c4('0x13'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);router[_0x49c4('0x15')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x16')]);module[_0x49c4('0x17')]=router; \ No newline at end of file +var _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x518af1,_0x3d017a){var _0x1677d7=function(_0x39e68b){while(--_0x39e68b){_0x518af1['push'](_0x518af1['shift']());}};_0x1677d7(++_0x3d017a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 94f59b1..3b3d9ab 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 _0x6599=['out','DATE','exports','TEXT','medium','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6599,0xb0));var _0x9659=function(_0xcf5436,_0x4632c3){_0xcf5436=_0xcf5436-0x0;var _0xc4f5c8=_0x6599[_0xcf5436];return _0xc4f5c8;};'use strict';var Sequelize=require('sequelize');module[_0x9659('0x0')]={'body':{'type':Sequelize[_0x9659('0x1')](_0x9659('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x9659('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9659('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x9659('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x9659('0x5')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x9659('0x1')]}}; \ No newline at end of file +var _0x282b=['BOOLEAN','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x4068f3,_0x42afad){var _0x1c60fd=function(_0x466c74){while(--_0x466c74){_0x4068f3['push'](_0x4068f3['shift']());}};_0x1c60fd(++_0x42afad);}(_0x282b,0xec));var _0xb282=function(_0x1d834f,_0x161441){_0x1d834f=_0x1d834f-0x0;var _0x25a8dd=_0x282b[_0x1d834f];return _0x25a8dd;};'use strict';var Sequelize=require(_0xb282('0x0'));module[_0xb282('0x1')]={'body':{'type':Sequelize[_0xb282('0x2')](_0xb282('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb282('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb282('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xb282('0x6')]},'providerName':{'type':Sequelize[_0xb282('0x7')]},'providerResponse':{'type':Sequelize[_0xb282('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index b8e6000..fcee8ac 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 _0xa9e4=['null','RejectMessage','rejectMessage','ContactId','QueryTypes','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/license/util','redis','defaults','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','stack','name','send','index','map','OpenchannelMessage','rawAttributes','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','keys','find','create','body','describe','openchannel-interactions','accept','openchannel','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','motionChannel','channel','EventManager','acceptmessage','reject','agent'];(function(_0x3f98d8,_0x1a5355){var _0x10e3ef=function(_0x4fe601){while(--_0x4fe601){_0x3f98d8['push'](_0x3f98d8['shift']());}};_0x10e3ef(++_0x1a5355);}(_0xa9e4,0x89));var _0x4a9e=function(_0x1fce3,_0x1de8c8){_0x1fce3=_0x1fce3-0x0;var _0x4538d7=_0xa9e4[_0x1fce3];return _0x4538d7;};'use strict';var emlformat=require(_0x4a9e('0x0'));var rimraf=require(_0x4a9e('0x1'));var zipdir=require(_0x4a9e('0x2'));var jsonpatch=require(_0x4a9e('0x3'));var rp=require(_0x4a9e('0x4'));var moment=require(_0x4a9e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4a9e('0x6'));var util=require(_0x4a9e('0x7'));var path=require(_0x4a9e('0x8'));var sox=require('sox');var csv=require(_0x4a9e('0x9'));var ejs=require(_0x4a9e('0xa'));var fs=require('fs');var fs_extra=require(_0x4a9e('0xb'));var _=require(_0x4a9e('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4a9e('0xd'));var toCsv=require(_0x4a9e('0x9'));var querystring=require(_0x4a9e('0xe'));var Papa=require(_0x4a9e('0xf'));var Redis=require(_0x4a9e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4a9e('0x11'));var as=require(_0x4a9e('0x12'));var hardwareService=require(_0x4a9e('0x13'));var logger=require(_0x4a9e('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4a9e('0x15'));var db=require('../../mysqldb')['db'];config[_0x4a9e('0x16')]=_[_0x4a9e('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a9e('0x16')]));require(_0x4a9e('0x18'))[_0x4a9e('0x19')](socket);var jayson=require(_0x4a9e('0x1a'));var client=jayson[_0x4a9e('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x4a9e('0x1b')][_0x4a9e('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x242009,_0x44c541,_0x5ce430,_0x118eb9){return new BPromise(function(_0xb9b919,_0x278efc){var _0x5d6bf2=_0x118eb9||client;return _0x5d6bf2[_0x4a9e('0x1d')](_0x242009,_0x5ce430)[_0x4a9e('0x1e')](function(_0x460222){logger[_0x4a9e('0x1f')](_0x4a9e('0x20'),_0x44c541,_0x4a9e('0x21'));logger[_0x4a9e('0x22')](_0x4a9e('0x23'),_0x44c541,_0x4a9e('0x21'),JSON['stringify'](_0x460222));if(_0x460222[_0x4a9e('0x24')]){if(_0x460222[_0x4a9e('0x24')][_0x4a9e('0x25')]===0x1f4){logger[_0x4a9e('0x24')](_0x4a9e('0x20'),_0x44c541,_0x460222[_0x4a9e('0x24')][_0x4a9e('0x26')]);return _0x278efc(_0x460222[_0x4a9e('0x24')][_0x4a9e('0x26')]);}logger[_0x4a9e('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x44c541,_0x460222[_0x4a9e('0x24')][_0x4a9e('0x26')]);return _0xb9b919(_0x460222[_0x4a9e('0x24')]['message']);}else{logger[_0x4a9e('0x1f')]('OpenchannelMessage,\x20%s,\x20%s',_0x44c541,'request\x20sent');_0xb9b919(_0x460222[_0x4a9e('0x27')]['message']);}})['catch'](function(_0x36f5ff){logger[_0x4a9e('0x24')](_0x4a9e('0x20'),_0x44c541,_0x36f5ff);_0x278efc(_0x36f5ff);});});}function respondWithStatusCode(_0x5d0835,_0x4304ff){_0x4304ff=_0x4304ff||0xcc;return function(_0x50e032){if(_0x50e032){return _0x5d0835[_0x4a9e('0x28')](_0x4304ff);}return _0x5d0835[_0x4a9e('0x29')](_0x4304ff)[_0x4a9e('0x2a')]();};}function respondWithResult(_0x392802,_0xd4a13f){_0xd4a13f=_0xd4a13f||0xc8;return function(_0x33def4){if(_0x33def4){return _0x392802['status'](_0xd4a13f)[_0x4a9e('0x2b')](_0x33def4);}};}function respondWithFilteredResult(_0xf8e888,_0x335b0c){return function(_0x23e068){if(_0x23e068){var _0x4670bb=typeof _0x335b0c['offset']===_0x4a9e('0x2c')&&typeof _0x335b0c[_0x4a9e('0x2d')]===_0x4a9e('0x2c');var _0x2aa8c4=_0x23e068[_0x4a9e('0x2e')];var _0xfbab36=_0x4670bb?0x0:_0x335b0c['offset'];var _0x34fb76=_0x4670bb?_0x23e068[_0x4a9e('0x2e')]:_0x335b0c[_0x4a9e('0x2f')]+_0x335b0c[_0x4a9e('0x2d')];var _0x2b838d;if(_0x34fb76>=_0x2aa8c4){_0x34fb76=_0x2aa8c4;_0x2b838d=0xc8;}else{_0x2b838d=0xce;}_0xf8e888[_0x4a9e('0x29')](_0x2b838d);return _0xf8e888[_0x4a9e('0x30')](_0x4a9e('0x31'),_0xfbab36+'-'+_0x34fb76+'/'+_0x2aa8c4)[_0x4a9e('0x2b')](_0x23e068);}return null;};}function patchUpdates(_0x18753d){return function(_0x46124f){try{jsonpatch[_0x4a9e('0x32')](_0x46124f,_0x18753d,!![]);}catch(_0x4f414f){return BPromise['reject'](_0x4f414f);}return _0x46124f[_0x4a9e('0x33')]();};}function saveUpdates(_0x101be3,_0x20bb6a){return function(_0x5cb6a3){if(_0x5cb6a3){return _0x5cb6a3[_0x4a9e('0x34')](_0x101be3)[_0x4a9e('0x1e')](function(_0x262ac7){return _0x262ac7;});}return null;};}function removeEntity(_0x5a853e,_0x175bd0){return function(_0x43c104){if(_0x43c104){return _0x43c104[_0x4a9e('0x35')]()[_0x4a9e('0x1e')](function(){_0x5a853e[_0x4a9e('0x29')](0xcc)[_0x4a9e('0x2a')]();});}};}function handleEntityNotFound(_0x30c9c0,_0x257eb0){return function(_0x1a152d){if(!_0x1a152d){_0x30c9c0[_0x4a9e('0x28')](0x194);}return _0x1a152d;};}function handleError(_0x104053,_0x496aaf){_0x496aaf=_0x496aaf||0x1f4;return function(_0x5df7aa){logger[_0x4a9e('0x24')](_0x5df7aa[_0x4a9e('0x36')]);if(_0x5df7aa[_0x4a9e('0x37')]){delete _0x5df7aa[_0x4a9e('0x37')];}_0x104053[_0x4a9e('0x29')](_0x496aaf)[_0x4a9e('0x38')](_0x5df7aa);};}exports[_0x4a9e('0x39')]=function(_0x569443,_0x2ee8b9){var _0x3e2ac6={},_0x5156fd={},_0x1c5faf={'count':0x0,'rows':[]};var _0x598351=_[_0x4a9e('0x3a')](db[_0x4a9e('0x3b')][_0x4a9e('0x3c')],function(_0x38f886){return{'name':_0x38f886['fieldName'],'type':_0x38f886[_0x4a9e('0x3d')]['key']};});_0x5156fd[_0x4a9e('0x3e')]=_[_0x4a9e('0x3a')](_0x598351,'name');_0x5156fd[_0x4a9e('0x3f')]=_['keys'](_0x569443[_0x4a9e('0x3f')]);_0x5156fd[_0x4a9e('0x40')]=_[_0x4a9e('0x41')](_0x5156fd[_0x4a9e('0x3e')],_0x5156fd[_0x4a9e('0x3f')]);_0x3e2ac6['attributes']=_[_0x4a9e('0x41')](_0x5156fd[_0x4a9e('0x3e')],qs[_0x4a9e('0x42')](_0x569443[_0x4a9e('0x3f')]['fields']));_0x3e2ac6[_0x4a9e('0x43')]=_0x3e2ac6[_0x4a9e('0x43')][_0x4a9e('0x44')]?_0x3e2ac6['attributes']:_0x5156fd[_0x4a9e('0x3e')];if(!_0x569443[_0x4a9e('0x3f')][_0x4a9e('0x45')](_0x4a9e('0x46'))){_0x3e2ac6['limit']=qs[_0x4a9e('0x2d')](_0x569443[_0x4a9e('0x3f')][_0x4a9e('0x2d')]);_0x3e2ac6[_0x4a9e('0x2f')]=qs['offset'](_0x569443['query'][_0x4a9e('0x2f')]);}_0x3e2ac6[_0x4a9e('0x47')]=qs[_0x4a9e('0x48')](_0x569443[_0x4a9e('0x3f')][_0x4a9e('0x48')]);_0x3e2ac6[_0x4a9e('0x49')]=qs[_0x4a9e('0x40')](_[_0x4a9e('0x4a')](_0x569443[_0x4a9e('0x3f')],_0x5156fd['filters']),_0x598351);if(_0x569443[_0x4a9e('0x3f')][_0x4a9e('0x4b')]){_0x3e2ac6['where']=_[_0x4a9e('0x4c')](_0x3e2ac6[_0x4a9e('0x49')],{'$or':_['map'](_0x598351,function(_0x4aaa4d){if(_0x4aaa4d['type']!==_0x4a9e('0x4d')){var _0x43c0af={};_0x43c0af[_0x4aaa4d['name']]={'$like':'%'+_0x569443[_0x4a9e('0x3f')][_0x4a9e('0x4b')]+'%'};return _0x43c0af;}})});}_0x3e2ac6=_[_0x4a9e('0x4c')]({},_0x3e2ac6,_0x569443[_0x4a9e('0x4e')]);var _0x5d27eb={'where':_0x3e2ac6[_0x4a9e('0x49')]};return db[_0x4a9e('0x3b')][_0x4a9e('0x2e')](_0x5d27eb)['then'](function(_0x4baea5){_0x1c5faf['count']=_0x4baea5;if(_0x569443['query']['includeAll']){_0x3e2ac6[_0x4a9e('0x4f')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x3e2ac6);})[_0x4a9e('0x1e')](function(_0x5763d7){_0x1c5faf[_0x4a9e('0x50')]=_0x5763d7;return _0x1c5faf;})[_0x4a9e('0x1e')](respondWithFilteredResult(_0x2ee8b9,_0x3e2ac6))[_0x4a9e('0x51')](handleError(_0x2ee8b9,null));};exports[_0x4a9e('0x52')]=function(_0x1e3bbe,_0x556146){var _0x298e36={'raw':!![],'where':{'id':_0x1e3bbe[_0x4a9e('0x53')]['id']}},_0x4261a6={};_0x4261a6[_0x4a9e('0x3e')]=_[_0x4a9e('0x54')](db[_0x4a9e('0x3b')][_0x4a9e('0x3c')]);_0x4261a6[_0x4a9e('0x3f')]=_[_0x4a9e('0x54')](_0x1e3bbe[_0x4a9e('0x3f')]);_0x4261a6['filters']=_[_0x4a9e('0x41')](_0x4261a6[_0x4a9e('0x3e')],_0x4261a6[_0x4a9e('0x3f')]);_0x298e36[_0x4a9e('0x43')]=_['intersection'](_0x4261a6[_0x4a9e('0x3e')],qs[_0x4a9e('0x42')](_0x1e3bbe[_0x4a9e('0x3f')][_0x4a9e('0x42')]));_0x298e36[_0x4a9e('0x43')]=_0x298e36[_0x4a9e('0x43')][_0x4a9e('0x44')]?_0x298e36[_0x4a9e('0x43')]:_0x4261a6[_0x4a9e('0x3e')];if(_0x1e3bbe[_0x4a9e('0x3f')]['includeAll']){_0x298e36['include']=[{'all':!![]}];}_0x298e36=_['merge']({},_0x298e36,_0x1e3bbe[_0x4a9e('0x4e')]);return db[_0x4a9e('0x3b')][_0x4a9e('0x55')](_0x298e36)['then'](handleEntityNotFound(_0x556146,null))[_0x4a9e('0x1e')](respondWithResult(_0x556146,null))['catch'](handleError(_0x556146,null));};exports[_0x4a9e('0x56')]=function(_0x4fa9b0,_0x539774){return db['OpenchannelMessage'][_0x4a9e('0x56')](_0x4fa9b0['body'],{})[_0x4a9e('0x1e')](respondWithResult(_0x539774,0xc9))[_0x4a9e('0x51')](handleError(_0x539774,null));};exports['update']=function(_0x458623,_0x4b4c0e){if(_0x458623[_0x4a9e('0x57')]['id']){delete _0x458623['body']['id'];}return db[_0x4a9e('0x3b')][_0x4a9e('0x55')]({'where':{'id':_0x458623[_0x4a9e('0x53')]['id']}})[_0x4a9e('0x1e')](handleEntityNotFound(_0x4b4c0e,null))['then'](saveUpdates(_0x458623[_0x4a9e('0x57')],null))[_0x4a9e('0x1e')](respondWithResult(_0x4b4c0e,null))[_0x4a9e('0x51')](handleError(_0x4b4c0e,null));};exports[_0x4a9e('0x35')]=function(_0x3e73b7,_0x1b97b5){return db['OpenchannelMessage'][_0x4a9e('0x55')]({'where':{'id':_0x3e73b7['params']['id']}})[_0x4a9e('0x1e')](handleEntityNotFound(_0x1b97b5,null))[_0x4a9e('0x1e')](removeEntity(_0x1b97b5,null))[_0x4a9e('0x51')](handleError(_0x1b97b5,null));};exports[_0x4a9e('0x58')]=function(_0x3ab665,_0x402ae2){return db[_0x4a9e('0x3b')][_0x4a9e('0x58')]()['then'](respondWithResult(_0x402ae2,null))[_0x4a9e('0x51')](handleError(_0x402ae2,null));};var interaction_log=require(_0x4a9e('0x14'))(_0x4a9e('0x59'));exports[_0x4a9e('0x5a')]=function(_0x378c49,_0x32c8ad,_0x4950da){var _0x1d0c62={'agent':{},'channel':_0x4a9e('0x5b')};if(_0x378c49['body']['id']){delete _0x378c49[_0x4a9e('0x57')]['id'];}_0x378c49['body']['read']=!![];_0x378c49[_0x4a9e('0x57')]['readAt']=moment()[_0x4a9e('0x5c')](_0x4a9e('0x5d'));_0x378c49[_0x4a9e('0x57')][_0x4a9e('0x5e')]=_0x378c49[_0x4a9e('0x57')]['UserId']||_0x378c49[_0x4a9e('0x5f')]['id'];_0x1d0c62['agent']['id']=_0x378c49[_0x4a9e('0x57')]['UserId'];return db[_0x4a9e('0x3b')]['find']({'where':{'id':_0x378c49[_0x4a9e('0x53')]['id'],'UserId':null}})[_0x4a9e('0x1e')](handleEntityNotFound(_0x32c8ad,null))[_0x4a9e('0x1e')](saveUpdates(_0x378c49[_0x4a9e('0x57')],null))[_0x4a9e('0x1e')](function(_0x262cf6){if(_0x262cf6){_0x1d0c62[_0x4a9e('0x26')]=_0x262cf6['get']({'plain':!![]});return db[_0x4a9e('0x60')]['find']({'where':{'id':_0x262cf6[_0x4a9e('0x61')]}});}return null;})['then'](handleEntityNotFound(_0x32c8ad,null))['then'](function(_0x3bcce1){if(_0x3bcce1){return _0x3bcce1[_0x4a9e('0x34')]({'UserId':_0x378c49[_0x4a9e('0x57')][_0x4a9e('0x5e')],'read1stAt':_[_0x4a9e('0x62')](_0x3bcce1[_0x4a9e('0x63')])?moment()[_0x4a9e('0x5c')](_0x4a9e('0x5d')):undefined});}return null;})['then'](function(_0x1853a5){if(_0x1853a5){_0x1d0c62[_0x4a9e('0x64')]=_0x1853a5[_0x4a9e('0x65')]({'plain':!![]});interaction_log[_0x4a9e('0x1f')](_0x4a9e('0x66'),_0x378c49[_0x4a9e('0x5f')]['id'],_0x378c49[_0x4a9e('0x5f')]['name'],_0x378c49['user'][_0x4a9e('0x67')],_0x1d0c62[_0x4a9e('0x64')]['id'],_0x378c49[_0x4a9e('0x57')]?JSON['stringify'](_0x378c49[_0x4a9e('0x57')]):'null');return respondWithRpcPromise(_0x4a9e('0x68'),_0x4a9e('0x69'),_0x1d0c62);}return null;})['then'](function(_0x21d657){var _0x385db4=_0x4a9e('0x6a')+_0x21d657[_0x4a9e('0x26')]['ContactId'];return db[_0x4a9e('0x6b')]['query'](_0x385db4,{'type':db['Sequelize']['QueryTypes'][_0x4a9e('0x6c')],'raw':!![]})[_0x4a9e('0x1e')](function(_0x57731e){return _0x57731e;});})[_0x4a9e('0x1e')](function(_0x4fb346){if(_0x4fb346){_0x1d0c62[_0x4a9e('0x26')][_0x4a9e('0x6d')]=_0x4fb346[0x0];if(!_0x378c49[_0x4a9e('0x57')][_0x4a9e('0x5e')])return;return db[_0x4a9e('0x6e')][_0x4a9e('0x55')]({'where':{'id':_0x378c49[_0x4a9e('0x57')][_0x4a9e('0x5e')],'role':'agent'},'attributes':['id','name',_0x4a9e('0x6f'),_0x4a9e('0x70'),_0x4a9e('0x71')],'raw':!![]});}return null;})[_0x4a9e('0x1e')](function(_0x345565){if(!_0x345565)return null;_0x1d0c62['message']['agent']=_0x345565;return _0x1d0c62;})[_0x4a9e('0x1e')](function(_0x115907){if(_0x115907){if(_0x378c49['body'][_0x4a9e('0x72')]){_0x1d0c62[_0x4a9e('0x26')][_0x4a9e('0x73')]=util[_0x4a9e('0x5c')](_0x4a9e('0x74'),_0x378c49[_0x4a9e('0x5f')]['name']);_0x1d0c62['message']['channel']=_0x1d0c62['channel'];_0x1d0c62['message'][_0x4a9e('0x75')]=_0x1d0c62[_0x4a9e('0x76')];_0x1d0c62[_0x4a9e('0x26')]['event']=_0x4a9e('0x5a');return respondWithRpcPromise(_0x4a9e('0x77'),_0x4a9e('0x77'),{'event':_0x4a9e('0x78'),'message':_0x1d0c62[_0x4a9e('0x26')]},client9002)[_0x4a9e('0x1e')](function(){return _0x1d0c62;});}return _0x1d0c62;}return null;})['then'](respondWithResult(_0x32c8ad,null))['catch'](handleError(_0x32c8ad,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0x4a9e('0x79')]=function(_0x259526,_0x4a4ea5,_0x481013){var _0x1f6d6d={'agent':{},'channel':'openchannel'};if(_0x259526[_0x4a9e('0x57')]['id']){delete _0x259526[_0x4a9e('0x57')]['id'];}_0x259526['body'][_0x4a9e('0x5e')]=_0x259526[_0x4a9e('0x57')]['UserId']||_0x259526[_0x4a9e('0x5f')]['id'];_0x1f6d6d[_0x4a9e('0x7a')]['id']=_0x259526['body'][_0x4a9e('0x5e')];return db[_0x4a9e('0x3b')]['find']({'where':{'id':_0x259526[_0x4a9e('0x53')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4a4ea5,null))[_0x4a9e('0x1e')](function(_0x532c19){if(_0x532c19){_0x1f6d6d[_0x4a9e('0x26')]=_0x532c19[_0x4a9e('0x65')]({'plain':!![]});return db['OpenchannelInteraction'][_0x4a9e('0x55')]({'where':{'id':_0x532c19[_0x4a9e('0x61')]}});}return null;})[_0x4a9e('0x1e')](handleEntityNotFound(_0x4a4ea5,null))['then'](function(_0x3278c3){if(_0x3278c3){_0x1f6d6d[_0x4a9e('0x64')]=_0x3278c3[_0x4a9e('0x65')]({'plain':!![]});interaction_log[_0x4a9e('0x1f')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x259526[_0x4a9e('0x5f')]['id'],_0x259526['user']['name'],_0x259526[_0x4a9e('0x5f')][_0x4a9e('0x67')],_0x1f6d6d[_0x4a9e('0x64')]['id'],_0x259526[_0x4a9e('0x57')]?JSON['stringify'](_0x259526[_0x4a9e('0x57')]):_0x4a9e('0x7b'));return respondWithRpcPromise(_0x4a9e('0x7c'),_0x4a9e('0x7d'),_0x1f6d6d);}return null;})[_0x4a9e('0x1e')](function(_0x2a2531){var _0xb9d170='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2a2531['message'][_0x4a9e('0x7e')];return db[_0x4a9e('0x6b')][_0x4a9e('0x3f')](_0xb9d170,{'type':db['Sequelize'][_0x4a9e('0x7f')][_0x4a9e('0x6c')],'raw':!![]})[_0x4a9e('0x1e')](function(_0x3d6488){return _0x3d6488;});})[_0x4a9e('0x1e')](function(_0x5946a6){if(_0x5946a6){_0x1f6d6d[_0x4a9e('0x26')][_0x4a9e('0x6d')]=_0x5946a6[0x0];if(!_0x259526[_0x4a9e('0x57')]['UserId'])return;return db['User'][_0x4a9e('0x55')]({'where':{'id':_0x259526[_0x4a9e('0x57')][_0x4a9e('0x5e')],'role':'agent'},'attributes':['id','name',_0x4a9e('0x6f'),'email',_0x4a9e('0x71')],'raw':!![]});}return null;})[_0x4a9e('0x1e')](function(_0x5b94ce){if(!_0x5b94ce)return null;_0x1f6d6d['message'][_0x4a9e('0x7a')]=_0x5b94ce;return _0x1f6d6d;})['then'](function(_0xf0c854){if(_0xf0c854){_0xf0c854['message'][_0x4a9e('0x73')]=util[_0x4a9e('0x5c')](_0x4a9e('0x74'),_0x259526[_0x4a9e('0x5f')][_0x4a9e('0x37')]);_0xf0c854[_0x4a9e('0x26')][_0x4a9e('0x76')]=_0x1f6d6d['channel'];_0xf0c854[_0x4a9e('0x26')][_0x4a9e('0x75')]=_0x1f6d6d[_0x4a9e('0x76')];_0xf0c854[_0x4a9e('0x26')][_0x4a9e('0x80')]='reject';respondWithRpcPromise(_0x4a9e('0x77'),_0x4a9e('0x77'),{'event':_0x4a9e('0x81'),'message':_0xf0c854[_0x4a9e('0x26')]},client9002);return _0x1f6d6d;}return null;})[_0x4a9e('0x1e')](respondWithResult(_0x4a4ea5,null))[_0x4a9e('0x51')](handleError(_0x4a4ea5,null));}; \ No newline at end of file +var _0x2bd4=['moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','undefined','limit','offset','set','Content-Range','json','reject','save','update','destroy','stack','name','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','pick','filter','where','merge','options','OpenchannelMessage','count','includeAll','include','findAll','rows','params','keys','length','create','body','find','describe','../../config/logger','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','OpenchannelInteraction','OpenchannelInteractionId','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','rejectMessage','contact','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x13908d,_0x5c8872){var _0x137b76=function(_0x418e00){while(--_0x418e00){_0x13908d['push'](_0x13908d['shift']());}};_0x137b76(++_0x5c8872);}(_0x2bd4,0x103));var _0x42bd=function(_0x3748d9,_0x1e4862){_0x3748d9=_0x3748d9-0x0;var _0x4c5423=_0x2bd4[_0x3748d9];return _0x4c5423;};'use strict';var emlformat=require(_0x42bd('0x0'));var rimraf=require(_0x42bd('0x1'));var zipdir=require(_0x42bd('0x2'));var jsonpatch=require(_0x42bd('0x3'));var rp=require(_0x42bd('0x4'));var moment=require(_0x42bd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x42bd('0x6'));var util=require(_0x42bd('0x7'));var path=require(_0x42bd('0x8'));var sox=require(_0x42bd('0x9'));var csv=require(_0x42bd('0xa'));var ejs=require(_0x42bd('0xb'));var fs=require('fs');var fs_extra=require(_0x42bd('0xc'));var _=require('lodash');var squel=require(_0x42bd('0xd'));var crypto=require(_0x42bd('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x42bd('0xf'));var toCsv=require('to-csv');var querystring=require(_0x42bd('0x10'));var Papa=require('papaparse');var Redis=require(_0x42bd('0x11'));var authService=require(_0x42bd('0x12'));var qs=require(_0x42bd('0x13'));var as=require(_0x42bd('0x14'));var hardwareService=require(_0x42bd('0x15'));var logger=require('../../config/logger')(_0x42bd('0x16'));var utils=require(_0x42bd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x42bd('0x18'));var db=require(_0x42bd('0x19'))['db'];config['redis']=_[_0x42bd('0x1a')](config[_0x42bd('0x1b')],{'host':_0x42bd('0x1c'),'port':0x18eb});var socket=require(_0x42bd('0x1d'))(new Redis(config[_0x42bd('0x1b')]));require('./openchannelMessage.socket')[_0x42bd('0x1e')](socket);var jayson=require(_0x42bd('0x1f'));var client=jayson[_0x42bd('0x20')][_0x42bd('0x21')]({'port':0x232c});var client9002=jayson[_0x42bd('0x20')][_0x42bd('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x477aa6,_0x3e8501,_0x4c64a4,_0x44a155){return new BPromise(function(_0x5c8a8a,_0x10e6ba){var _0x9321d4=_0x44a155||client;return _0x9321d4[_0x42bd('0x22')](_0x477aa6,_0x4c64a4)[_0x42bd('0x23')](function(_0x28b13f){logger[_0x42bd('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x3e8501,_0x42bd('0x25'));logger[_0x42bd('0x26')](_0x42bd('0x27'),_0x3e8501,_0x42bd('0x25'),JSON[_0x42bd('0x28')](_0x28b13f));if(_0x28b13f[_0x42bd('0x29')]){if(_0x28b13f[_0x42bd('0x29')][_0x42bd('0x2a')]===0x1f4){logger[_0x42bd('0x29')](_0x42bd('0x2b'),_0x3e8501,_0x28b13f['error'][_0x42bd('0x2c')]);return _0x10e6ba(_0x28b13f[_0x42bd('0x29')][_0x42bd('0x2c')]);}logger[_0x42bd('0x29')]('OpenchannelMessage,\x20%s,\x20%s',_0x3e8501,_0x28b13f[_0x42bd('0x29')]['message']);return _0x5c8a8a(_0x28b13f['error'][_0x42bd('0x2c')]);}else{logger[_0x42bd('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x3e8501,_0x42bd('0x25'));_0x5c8a8a(_0x28b13f[_0x42bd('0x2d')][_0x42bd('0x2c')]);}})[_0x42bd('0x2e')](function(_0x40b0c0){logger[_0x42bd('0x29')](_0x42bd('0x2b'),_0x3e8501,_0x40b0c0);_0x10e6ba(_0x40b0c0);});});}function respondWithStatusCode(_0xb174ec,_0x2be60d){_0x2be60d=_0x2be60d||0xcc;return function(_0x59f1b0){if(_0x59f1b0){return _0xb174ec[_0x42bd('0x2f')](_0x2be60d);}return _0xb174ec['status'](_0x2be60d)[_0x42bd('0x30')]();};}function respondWithResult(_0x3111d1,_0x4de071){_0x4de071=_0x4de071||0xc8;return function(_0x3b3520){if(_0x3b3520){return _0x3111d1[_0x42bd('0x31')](_0x4de071)['json'](_0x3b3520);}};}function respondWithFilteredResult(_0x58d57b,_0x49984e){return function(_0x2d281f){if(_0x2d281f){var _0xa9e4ce=typeof _0x49984e['offset']===_0x42bd('0x32')&&typeof _0x49984e[_0x42bd('0x33')]==='undefined';var _0x38a0a1=_0x2d281f['count'];var _0x328025=_0xa9e4ce?0x0:_0x49984e[_0x42bd('0x34')];var _0x149f18=_0xa9e4ce?_0x2d281f['count']:_0x49984e[_0x42bd('0x34')]+_0x49984e['limit'];var _0x159b4a;if(_0x149f18>=_0x38a0a1){_0x149f18=_0x38a0a1;_0x159b4a=0xc8;}else{_0x159b4a=0xce;}_0x58d57b[_0x42bd('0x31')](_0x159b4a);return _0x58d57b[_0x42bd('0x35')](_0x42bd('0x36'),_0x328025+'-'+_0x149f18+'/'+_0x38a0a1)[_0x42bd('0x37')](_0x2d281f);}return null;};}function patchUpdates(_0xc4fdb0){return function(_0x20488b){try{jsonpatch['apply'](_0x20488b,_0xc4fdb0,!![]);}catch(_0x3ca4cd){return BPromise[_0x42bd('0x38')](_0x3ca4cd);}return _0x20488b[_0x42bd('0x39')]();};}function saveUpdates(_0x15f360,_0x49b1f0){return function(_0x536bcc){if(_0x536bcc){return _0x536bcc[_0x42bd('0x3a')](_0x15f360)[_0x42bd('0x23')](function(_0x34b836){return _0x34b836;});}return null;};}function removeEntity(_0x242e97,_0x50fdd8){return function(_0x5c9dc0){if(_0x5c9dc0){return _0x5c9dc0[_0x42bd('0x3b')]()[_0x42bd('0x23')](function(){_0x242e97['status'](0xcc)[_0x42bd('0x30')]();});}};}function handleEntityNotFound(_0x462275,_0x10b1d2){return function(_0x4cbbe2){if(!_0x4cbbe2){_0x462275[_0x42bd('0x2f')](0x194);}return _0x4cbbe2;};}function handleError(_0x5243b1,_0x35aa48){_0x35aa48=_0x35aa48||0x1f4;return function(_0x56d0e1){logger[_0x42bd('0x29')](_0x56d0e1[_0x42bd('0x3c')]);if(_0x56d0e1[_0x42bd('0x3d')]){delete _0x56d0e1['name'];}_0x5243b1[_0x42bd('0x31')](_0x35aa48)['send'](_0x56d0e1);};}exports[_0x42bd('0x3e')]=function(_0x38f622,_0x46a163){var _0x29465f={},_0x1d9d50={},_0x27033b={'count':0x0,'rows':[]};var _0x1c5a9f=_[_0x42bd('0x3f')](db['OpenchannelMessage'][_0x42bd('0x40')],function(_0x593ab5){return{'name':_0x593ab5['fieldName'],'type':_0x593ab5[_0x42bd('0x41')][_0x42bd('0x42')]};});_0x1d9d50[_0x42bd('0x43')]=_['map'](_0x1c5a9f,_0x42bd('0x3d'));_0x1d9d50['query']=_['keys'](_0x38f622[_0x42bd('0x44')]);_0x1d9d50[_0x42bd('0x45')]=_[_0x42bd('0x46')](_0x1d9d50[_0x42bd('0x43')],_0x1d9d50[_0x42bd('0x44')]);_0x29465f[_0x42bd('0x47')]=_[_0x42bd('0x46')](_0x1d9d50[_0x42bd('0x43')],qs[_0x42bd('0x48')](_0x38f622[_0x42bd('0x44')][_0x42bd('0x48')]));_0x29465f[_0x42bd('0x47')]=_0x29465f[_0x42bd('0x47')]['length']?_0x29465f['attributes']:_0x1d9d50[_0x42bd('0x43')];if(!_0x38f622[_0x42bd('0x44')][_0x42bd('0x49')](_0x42bd('0x4a'))){_0x29465f[_0x42bd('0x33')]=qs['limit'](_0x38f622['query']['limit']);_0x29465f[_0x42bd('0x34')]=qs[_0x42bd('0x34')](_0x38f622[_0x42bd('0x44')][_0x42bd('0x34')]);}_0x29465f['order']=qs['sort'](_0x38f622['query']['sort']);_0x29465f['where']=qs['filters'](_[_0x42bd('0x4b')](_0x38f622[_0x42bd('0x44')],_0x1d9d50['filters']),_0x1c5a9f);if(_0x38f622[_0x42bd('0x44')][_0x42bd('0x4c')]){_0x29465f[_0x42bd('0x4d')]=_[_0x42bd('0x4e')](_0x29465f[_0x42bd('0x4d')],{'$or':_[_0x42bd('0x3f')](_0x1c5a9f,function(_0x1f0e0e){if(_0x1f0e0e[_0x42bd('0x41')]!=='VIRTUAL'){var _0x261d08={};_0x261d08[_0x1f0e0e[_0x42bd('0x3d')]]={'$like':'%'+_0x38f622['query'][_0x42bd('0x4c')]+'%'};return _0x261d08;}})});}_0x29465f=_['merge']({},_0x29465f,_0x38f622[_0x42bd('0x4f')]);var _0x1aca88={'where':_0x29465f[_0x42bd('0x4d')]};return db[_0x42bd('0x50')]['count'](_0x1aca88)[_0x42bd('0x23')](function(_0x5b2072){_0x27033b[_0x42bd('0x51')]=_0x5b2072;if(_0x38f622[_0x42bd('0x44')][_0x42bd('0x52')]){_0x29465f[_0x42bd('0x53')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x42bd('0x54')](_0x29465f);})['then'](function(_0x3774db){_0x27033b[_0x42bd('0x55')]=_0x3774db;return _0x27033b;})[_0x42bd('0x23')](respondWithFilteredResult(_0x46a163,_0x29465f))[_0x42bd('0x2e')](handleError(_0x46a163,null));};exports['show']=function(_0x170b3a,_0x496adb){var _0x5e8b35={'raw':!![],'where':{'id':_0x170b3a[_0x42bd('0x56')]['id']}},_0x5872da={};_0x5872da[_0x42bd('0x43')]=_[_0x42bd('0x57')](db[_0x42bd('0x50')][_0x42bd('0x40')]);_0x5872da['query']=_[_0x42bd('0x57')](_0x170b3a['query']);_0x5872da[_0x42bd('0x45')]=_[_0x42bd('0x46')](_0x5872da['model'],_0x5872da[_0x42bd('0x44')]);_0x5e8b35['attributes']=_['intersection'](_0x5872da['model'],qs[_0x42bd('0x48')](_0x170b3a[_0x42bd('0x44')][_0x42bd('0x48')]));_0x5e8b35[_0x42bd('0x47')]=_0x5e8b35[_0x42bd('0x47')][_0x42bd('0x58')]?_0x5e8b35['attributes']:_0x5872da[_0x42bd('0x43')];if(_0x170b3a[_0x42bd('0x44')][_0x42bd('0x52')]){_0x5e8b35[_0x42bd('0x53')]=[{'all':!![]}];}_0x5e8b35=_['merge']({},_0x5e8b35,_0x170b3a['options']);return db[_0x42bd('0x50')]['find'](_0x5e8b35)[_0x42bd('0x23')](handleEntityNotFound(_0x496adb,null))[_0x42bd('0x23')](respondWithResult(_0x496adb,null))[_0x42bd('0x2e')](handleError(_0x496adb,null));};exports[_0x42bd('0x59')]=function(_0x536f9f,_0xf6de42){return db[_0x42bd('0x50')][_0x42bd('0x59')](_0x536f9f['body'],{})[_0x42bd('0x23')](respondWithResult(_0xf6de42,0xc9))[_0x42bd('0x2e')](handleError(_0xf6de42,null));};exports[_0x42bd('0x3a')]=function(_0x102b3e,_0x36830c){if(_0x102b3e[_0x42bd('0x5a')]['id']){delete _0x102b3e[_0x42bd('0x5a')]['id'];}return db[_0x42bd('0x50')][_0x42bd('0x5b')]({'where':{'id':_0x102b3e['params']['id']}})[_0x42bd('0x23')](handleEntityNotFound(_0x36830c,null))[_0x42bd('0x23')](saveUpdates(_0x102b3e[_0x42bd('0x5a')],null))[_0x42bd('0x23')](respondWithResult(_0x36830c,null))[_0x42bd('0x2e')](handleError(_0x36830c,null));};exports[_0x42bd('0x3b')]=function(_0x104b88,_0x26154c){return db[_0x42bd('0x50')][_0x42bd('0x5b')]({'where':{'id':_0x104b88[_0x42bd('0x56')]['id']}})[_0x42bd('0x23')](handleEntityNotFound(_0x26154c,null))['then'](removeEntity(_0x26154c,null))[_0x42bd('0x2e')](handleError(_0x26154c,null));};exports[_0x42bd('0x5c')]=function(_0x98e54e,_0x3d1726){return db[_0x42bd('0x50')][_0x42bd('0x5c')]()[_0x42bd('0x23')](respondWithResult(_0x3d1726,null))[_0x42bd('0x2e')](handleError(_0x3d1726,null));};var interaction_log=require(_0x42bd('0x5d'))(_0x42bd('0x5e'));exports[_0x42bd('0x5f')]=function(_0xa95b41,_0x577479,_0x8d4e13){var _0x459d06={'agent':{},'channel':_0x42bd('0x60')};if(_0xa95b41[_0x42bd('0x5a')]['id']){delete _0xa95b41[_0x42bd('0x5a')]['id'];}_0xa95b41[_0x42bd('0x5a')][_0x42bd('0x61')]=!![];_0xa95b41['body']['readAt']=moment()[_0x42bd('0x62')](_0x42bd('0x63'));_0xa95b41[_0x42bd('0x5a')][_0x42bd('0x64')]=_0xa95b41[_0x42bd('0x5a')]['UserId']||_0xa95b41[_0x42bd('0x65')]['id'];_0x459d06[_0x42bd('0x66')]['id']=_0xa95b41[_0x42bd('0x5a')][_0x42bd('0x64')];return db['OpenchannelMessage'][_0x42bd('0x5b')]({'where':{'id':_0xa95b41['params']['id'],'UserId':null}})[_0x42bd('0x23')](handleEntityNotFound(_0x577479,null))['then'](saveUpdates(_0xa95b41[_0x42bd('0x5a')],null))[_0x42bd('0x23')](function(_0x87508f){if(_0x87508f){_0x459d06['message']=_0x87508f['get']({'plain':!![]});return db[_0x42bd('0x67')][_0x42bd('0x5b')]({'where':{'id':_0x87508f[_0x42bd('0x68')]}});}return null;})[_0x42bd('0x23')](handleEntityNotFound(_0x577479,null))[_0x42bd('0x23')](function(_0x5c0cfe){if(_0x5c0cfe){return _0x5c0cfe[_0x42bd('0x3a')]({'UserId':_0xa95b41[_0x42bd('0x5a')][_0x42bd('0x64')],'read1stAt':_['isNil'](_0x5c0cfe['read1stAt'])?moment()[_0x42bd('0x62')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x42bd('0x23')](function(_0x3b6104){if(_0x3b6104){_0x459d06[_0x42bd('0x69')]=_0x3b6104[_0x42bd('0x6a')]({'plain':!![]});interaction_log[_0x42bd('0x24')](_0x42bd('0x6b'),_0xa95b41[_0x42bd('0x65')]['id'],_0xa95b41[_0x42bd('0x65')]['name'],_0xa95b41[_0x42bd('0x65')]['role'],_0x459d06[_0x42bd('0x69')]['id'],_0xa95b41[_0x42bd('0x5a')]?JSON[_0x42bd('0x28')](_0xa95b41['body']):'null');return respondWithRpcPromise(_0x42bd('0x6c'),_0x42bd('0x6d'),_0x459d06);}return null;})[_0x42bd('0x23')](function(_0xc8c3a1){var _0x33a16b=_0x42bd('0x6e')+_0xc8c3a1[_0x42bd('0x2c')][_0x42bd('0x6f')];return db[_0x42bd('0x70')][_0x42bd('0x44')](_0x33a16b,{'type':db[_0x42bd('0x71')][_0x42bd('0x72')][_0x42bd('0x73')],'raw':!![]})[_0x42bd('0x23')](function(_0x2d7f18){return _0x2d7f18;});})[_0x42bd('0x23')](function(_0x43ba38){if(_0x43ba38){_0x459d06['message']['contact']=_0x43ba38[0x0];if(!_0xa95b41[_0x42bd('0x5a')][_0x42bd('0x64')])return;return db[_0x42bd('0x74')][_0x42bd('0x5b')]({'where':{'id':_0xa95b41[_0x42bd('0x5a')][_0x42bd('0x64')],'role':_0x42bd('0x66')},'attributes':['id',_0x42bd('0x3d'),_0x42bd('0x75'),'email',_0x42bd('0x76')],'raw':!![]});}return null;})[_0x42bd('0x23')](function(_0x45391d){if(!_0x45391d)return null;_0x459d06['message'][_0x42bd('0x66')]=_0x45391d;return _0x459d06;})['then'](function(_0x33206d){if(_0x33206d){if(_0xa95b41[_0x42bd('0x5a')]['manual']){_0x459d06[_0x42bd('0x2c')][_0x42bd('0x77')]=util[_0x42bd('0x62')](_0x42bd('0x78'),_0xa95b41['user']['name']);_0x459d06['message'][_0x42bd('0x79')]=_0x459d06[_0x42bd('0x79')];_0x459d06[_0x42bd('0x2c')][_0x42bd('0x7a')]=_0x459d06[_0x42bd('0x79')];_0x459d06[_0x42bd('0x2c')][_0x42bd('0x7b')]='accept';return respondWithRpcPromise(_0x42bd('0x7c'),_0x42bd('0x7c'),{'event':_0x42bd('0x7d'),'message':_0x459d06[_0x42bd('0x2c')]},client9002)[_0x42bd('0x23')](function(){return _0x459d06;});}return _0x459d06;}return null;})['then'](respondWithResult(_0x577479,null))[_0x42bd('0x2e')](handleError(_0x577479,null));};var interaction_log=require(_0x42bd('0x5d'))(_0x42bd('0x5e'));exports[_0x42bd('0x38')]=function(_0x18481d,_0x1540e0,_0x54adf5){var _0x52c3ea={'agent':{},'channel':_0x42bd('0x60')};if(_0x18481d[_0x42bd('0x5a')]['id']){delete _0x18481d[_0x42bd('0x5a')]['id'];}_0x18481d['body']['UserId']=_0x18481d[_0x42bd('0x5a')][_0x42bd('0x64')]||_0x18481d[_0x42bd('0x65')]['id'];_0x52c3ea['agent']['id']=_0x18481d[_0x42bd('0x5a')]['UserId'];return db[_0x42bd('0x50')][_0x42bd('0x5b')]({'where':{'id':_0x18481d[_0x42bd('0x56')]['id'],'UserId':null}})[_0x42bd('0x23')](handleEntityNotFound(_0x1540e0,null))['then'](function(_0xad9477){if(_0xad9477){_0x52c3ea[_0x42bd('0x2c')]=_0xad9477['get']({'plain':!![]});return db[_0x42bd('0x67')][_0x42bd('0x5b')]({'where':{'id':_0xad9477[_0x42bd('0x68')]}});}return null;})['then'](handleEntityNotFound(_0x1540e0,null))['then'](function(_0x712fa9){if(_0x712fa9){_0x52c3ea[_0x42bd('0x69')]=_0x712fa9['get']({'plain':!![]});interaction_log[_0x42bd('0x24')](_0x42bd('0x7e'),_0x18481d[_0x42bd('0x65')]['id'],_0x18481d[_0x42bd('0x65')]['name'],_0x18481d[_0x42bd('0x65')][_0x42bd('0x7f')],_0x52c3ea[_0x42bd('0x69')]['id'],_0x18481d['body']?JSON[_0x42bd('0x28')](_0x18481d[_0x42bd('0x5a')]):_0x42bd('0x80'));return respondWithRpcPromise('RejectMessage',_0x42bd('0x81'),_0x52c3ea);}return null;})['then'](function(_0x30ddae){var _0x31f653=_0x42bd('0x6e')+_0x30ddae[_0x42bd('0x2c')][_0x42bd('0x6f')];return db[_0x42bd('0x70')][_0x42bd('0x44')](_0x31f653,{'type':db['Sequelize']['QueryTypes'][_0x42bd('0x73')],'raw':!![]})[_0x42bd('0x23')](function(_0xfa1c68){return _0xfa1c68;});})[_0x42bd('0x23')](function(_0x21c55c){if(_0x21c55c){_0x52c3ea[_0x42bd('0x2c')][_0x42bd('0x82')]=_0x21c55c[0x0];if(!_0x18481d[_0x42bd('0x5a')][_0x42bd('0x64')])return;return db[_0x42bd('0x74')][_0x42bd('0x5b')]({'where':{'id':_0x18481d[_0x42bd('0x5a')][_0x42bd('0x64')],'role':_0x42bd('0x66')},'attributes':['id',_0x42bd('0x3d'),_0x42bd('0x75'),'email',_0x42bd('0x76')],'raw':!![]});}return null;})[_0x42bd('0x23')](function(_0x4f501c){if(!_0x4f501c)return null;_0x52c3ea['message'][_0x42bd('0x66')]=_0x4f501c;return _0x52c3ea;})[_0x42bd('0x23')](function(_0x5d7d97){if(_0x5d7d97){_0x5d7d97['message']['interface']=util[_0x42bd('0x62')](_0x42bd('0x78'),_0x18481d[_0x42bd('0x65')][_0x42bd('0x3d')]);_0x5d7d97['message'][_0x42bd('0x79')]=_0x52c3ea[_0x42bd('0x79')];_0x5d7d97[_0x42bd('0x2c')][_0x42bd('0x7a')]=_0x52c3ea['channel'];_0x5d7d97[_0x42bd('0x2c')][_0x42bd('0x7b')]=_0x42bd('0x38');respondWithRpcPromise(_0x42bd('0x7c'),_0x42bd('0x7c'),{'event':_0x42bd('0x83'),'message':_0x5d7d97[_0x42bd('0x2c')]},client9002);return _0x52c3ea;}return null;})['then'](respondWithResult(_0x1540e0,null))[_0x42bd('0x2e')](handleError(_0x1540e0,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 920fd65..725a5ff 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 _0xe926=['save','update','remove','emit','hook','exports','events','OpenchannelMessage'];(function(_0xa8e041,_0x1348af){var _0x330b32=function(_0x31f4ef){while(--_0x31f4ef){_0xa8e041['push'](_0xa8e041['shift']());}};_0x330b32(++_0x1348af);}(_0xe926,0x15e));var _0x6e92=function(_0x1d0499,_0x23e22f){_0x1d0499=_0x1d0499-0x0;var _0x153fb3=_0xe926[_0x1d0499];return _0x153fb3;};'use strict';var EventEmitter=require(_0x6e92('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x6e92('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6e92('0x2'),'afterUpdate':_0x6e92('0x3'),'afterDestroy':_0x6e92('0x4')};function emitEvent(_0x3ae01e){return function(_0x1f3638,_0x438867,_0x6478c8){OpenchannelMessageEvents[_0x6e92('0x5')](_0x3ae01e+':'+_0x1f3638['id'],_0x1f3638);OpenchannelMessageEvents[_0x6e92('0x5')](_0x3ae01e,_0x1f3638);_0x6478c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x6e92('0x6')](e,emitEvent(event));}}module[_0x6e92('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x7618=['hook','exports','events','OpenchannelMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x2b1beb,_0x545b08){var _0x4b2332=function(_0x37228a){while(--_0x37228a){_0x2b1beb['push'](_0x2b1beb['shift']());}};_0x4b2332(++_0x545b08);}(_0x7618,0x17c));var _0x8761=function(_0x4eae7b,_0x1cb78e){_0x4eae7b=_0x4eae7b-0x0;var _0x332913=_0x7618[_0x4eae7b];return _0x332913;};'use strict';var EventEmitter=require(_0x8761('0x0'));var OpenchannelMessage=require('../../mysqldb')['db'][_0x8761('0x1')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x8761('0x2')](0x0);var events={'afterCreate':_0x8761('0x3'),'afterUpdate':'update','afterDestroy':_0x8761('0x4')};function emitEvent(_0x511ba1){return function(_0x18521c,_0x289231,_0x1b5408){OpenchannelMessageEvents[_0x8761('0x5')](_0x511ba1+':'+_0x18521c['id'],_0x18521c);OpenchannelMessageEvents['emit'](_0x511ba1,_0x18521c);_0x1b5408(null);};}for(var e in events){if(events[_0x8761('0x6')](e)){var event=events[e];OpenchannelMessage[_0x8761('0x7')](e,emitEvent(event));}}module[_0x8761('0x8')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index e45fe80..a768792 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 _0xfff3=['format','Forwarding\x20message\x20%d\x20to\x20%s','length','POST','method','GET','body','Message\x20%d\x20forwarded\x20to\x20%s','threadId','Interaction','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','rimraf','./openchannelMessage.attributes','exports','define','openchannel_messages','FULLTEXT','direction','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','Contact','keys','get','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate'];(function(_0x2c3255,_0x4e00ae){var _0x282aba=function(_0x5721d5){while(--_0x5721d5){_0x2c3255['push'](_0x2c3255['shift']());}};_0x282aba(++_0x4e00ae);}(_0xfff3,0x1d9));var _0x3fff=function(_0x5b8fa5,_0x35f163){_0x5b8fa5=_0x5b8fa5-0x0;var _0x504056=_0xfff3[_0x5b8fa5];return _0x504056;};'use strict';var _=require(_0x3fff('0x0'));var util=require(_0x3fff('0x1'));var logger=require(_0x3fff('0x2'))(_0x3fff('0x3'));var moment=require(_0x3fff('0x4'));var BPromise=require(_0x3fff('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3fff('0x6'));var config=require('../../config/environment');var attributes=require(_0x3fff('0x7'));module[_0x3fff('0x8')]=function(_0x46e26f,_0x118904){return _0x46e26f[_0x3fff('0x9')]('OpenchannelMessage',attributes,{'tableName':_0x3fff('0xa'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':['body'],'type':_0x3fff('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x35d8bd,_0x4872b0,_0x589401){var _0x49b269=_0x46e26f['models'];var _0x36dc47=_0x35d8bd['get']({'plain':!![]});if(_0x36dc47[_0x3fff('0xc')][_0x3fff('0xd')]()==='in'||_0x36dc47[_0x3fff('0xc')][_0x3fff('0xd')]()===_0x3fff('0xe')&&!_0x36dc47[_0x3fff('0xf')]&&!_[_0x3fff('0x10')](_0x36dc47[_0x3fff('0x11')])){_0x49b269['OpenchannelInteraction'][_0x3fff('0x12')]({'where':{'id':_0x36dc47[_0x3fff('0x13')]}})[_0x3fff('0x14')](function(_0x4be5cb){if(_0x4be5cb){_0x4be5cb[_0x3fff('0x15')]({'lastMsgAt':_0x36dc47[_0x3fff('0x16')],'lastMsgDirection':_0x36dc47[_0x3fff('0xc')]['toLowerCase']()});}})[_0x3fff('0x17')](function(_0x53cf9c){console[_0x3fff('0x18')](_0x53cf9c);});}if(_0x36dc47['direction']===_0x3fff('0xe')&&!_0x36dc47[_0x3fff('0xf')]){var _0x33bf18;_0x49b269[_0x3fff('0x19')][_0x3fff('0x1a')]()[_0x3fff('0x14')](function(_0xb303e1){return _0x49b269['OpenchannelAccount'][_0x3fff('0x1b')]({'where':{'id':_0x36dc47[_0x3fff('0x1c')]},'include':[{'model':_0x49b269[_0x3fff('0x1d')],'as':_0x3fff('0x1e'),'where':{'id':_0x36dc47[_0x3fff('0x13')]},'limit':0x1,'include':[{'model':_0x49b269[_0x3fff('0x19')],'as':_0x3fff('0x1f'),'attributes':_[_0x3fff('0x20')](_0xb303e1)}]}]});})[_0x3fff('0x14')](function(_0x246a34){_0x33bf18=_0x246a34[_0x3fff('0x21')]({'plain':!![]});if(_0x33bf18&&_0x33bf18[_0x3fff('0x22')]){logger['info'](_0x3fff('0x23'),_0x3fff('0x24'),util[_0x3fff('0x25')](_0x3fff('0x26'),_0x36dc47['id'],_0x33bf18['replyUri']));if(_0x33bf18[_0x3fff('0x1e')]&&_0x33bf18['Interactions'][_0x3fff('0x27')]){_0x36dc47['Interaction']=_['omit'](_0x33bf18[_0x3fff('0x1e')][0x0],_0x3fff('0x1f'));_0x36dc47[_0x3fff('0x1f')]=_0x33bf18[_0x3fff('0x1e')][0x0][_0x3fff('0x1f')];}var _0x4872b0={'method':_0x3fff('0x28'),'uri':encodeURI(_0x33bf18[_0x3fff('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4872b0[_0x3fff('0x29')]){case _0x3fff('0x2a'):_0x4872b0['qs']=_0x36dc47;break;case _0x3fff('0x28'):_0x4872b0[_0x3fff('0x2b')]=_0x36dc47;break;}return rp(_0x4872b0)[_0x3fff('0x14')](function(_0x28852e){logger['info'](_0x3fff('0x23'),_0x3fff('0x24'),util[_0x3fff('0x25')](_0x3fff('0x2c'),_0x36dc47['id'],_0x33bf18[_0x3fff('0x22')]));if(_0x28852e[_0x3fff('0x2b')][_0x3fff('0x2d')]&&_0x28852e[_0x3fff('0x2b')][_0x3fff('0x2d')]!=_0x36dc47['Interaction'][_0x3fff('0x2d')]){return _0x49b269['OpenchannelInteraction'][_0x3fff('0x15')]({'threadId':_0x28852e[_0x3fff('0x2b')][_0x3fff('0x2d')]},{'where':{'id':_0x36dc47[_0x3fff('0x2e')]['id']}});}else{return;}})['then'](function(){return _0x35d8bd[_0x3fff('0x15')]({'read':!![]});})[_0x3fff('0x17')](function(_0x46b4f8){logger[_0x3fff('0x18')]('OpenchannelMessage,\x20%s,\x20%s',_0x3fff('0x24'),util[_0x3fff('0x2f')](_0x46b4f8,{'showHidden':![],'depth':null}));_0x589401();});}else{_0x589401();}})[_0x3fff('0x30')](function(){_0x589401();});}else{_0x589401();}}},'charset':_0x3fff('0x31'),'collate':_0x3fff('0x32')});}; \ No newline at end of file +var _0x52c7=['info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','CmContact','describe','OpenchannelAccount','find','Interactions','Contact','keys','replyUri'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x52c7,0x1d9));var _0x752c=function(_0x343e70,_0xe5f373){_0x343e70=_0x343e70-0x0;var _0x2742fd=_0x52c7[_0x343e70];return _0x2742fd;};'use strict';var _=require(_0x752c('0x0'));var util=require(_0x752c('0x1'));var logger=require(_0x752c('0x2'))(_0x752c('0x3'));var moment=require(_0x752c('0x4'));var BPromise=require('bluebird');var rp=require(_0x752c('0x5'));var fs=require('fs');var path=require(_0x752c('0x6'));var rimraf=require(_0x752c('0x7'));var config=require(_0x752c('0x8'));var attributes=require(_0x752c('0x9'));module[_0x752c('0xa')]=function(_0x2031ae,_0x40bad8){return _0x2031ae[_0x752c('0xb')]('OpenchannelMessage',attributes,{'tableName':_0x752c('0xc'),'paranoid':![],'indexes':[{'name':_0x752c('0xd'),'fields':[_0x752c('0xe')],'type':_0x752c('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x119c3e,_0x5549ba,_0x44d045){var _0x35430d=_0x2031ae[_0x752c('0x10')];var _0x360ec8=_0x119c3e[_0x752c('0x11')]({'plain':!![]});if(_0x360ec8['direction'][_0x752c('0x12')]()==='in'||_0x360ec8[_0x752c('0x13')][_0x752c('0x12')]()===_0x752c('0x14')&&!_0x360ec8[_0x752c('0x15')]&&!_[_0x752c('0x16')](_0x360ec8[_0x752c('0x17')])){_0x35430d[_0x752c('0x18')][_0x752c('0x19')]({'where':{'id':_0x360ec8[_0x752c('0x1a')]}})[_0x752c('0x1b')](function(_0x280a4e){if(_0x280a4e){_0x280a4e[_0x752c('0x1c')]({'lastMsgAt':_0x360ec8[_0x752c('0x1d')],'lastMsgDirection':_0x360ec8['direction']['toLowerCase']()});}})[_0x752c('0x1e')](function(_0x506df6){console[_0x752c('0x1f')](_0x506df6);});}if(_0x360ec8[_0x752c('0x13')]==='out'&&!_0x360ec8[_0x752c('0x15')]){var _0x3a88fe;_0x35430d[_0x752c('0x20')][_0x752c('0x21')]()['then'](function(_0x327aac){return _0x35430d[_0x752c('0x22')][_0x752c('0x23')]({'where':{'id':_0x360ec8['OpenchannelAccountId']},'include':[{'model':_0x35430d['OpenchannelInteraction'],'as':_0x752c('0x24'),'where':{'id':_0x360ec8[_0x752c('0x1a')]},'limit':0x1,'include':[{'model':_0x35430d[_0x752c('0x20')],'as':_0x752c('0x25'),'attributes':_[_0x752c('0x26')](_0x327aac)}]}]});})[_0x752c('0x1b')](function(_0x52d45f){_0x3a88fe=_0x52d45f[_0x752c('0x11')]({'plain':!![]});if(_0x3a88fe&&_0x3a88fe[_0x752c('0x27')]){logger[_0x752c('0x28')](_0x752c('0x29'),_0x752c('0x2a'),util[_0x752c('0x2b')](_0x752c('0x2c'),_0x360ec8['id'],_0x3a88fe[_0x752c('0x27')]));if(_0x3a88fe['Interactions']&&_0x3a88fe[_0x752c('0x24')][_0x752c('0x2d')]){_0x360ec8[_0x752c('0x2e')]=_[_0x752c('0x2f')](_0x3a88fe[_0x752c('0x24')][0x0],'Contact');_0x360ec8['Contact']=_0x3a88fe[_0x752c('0x24')][0x0][_0x752c('0x25')];}var _0x5549ba={'method':_0x752c('0x30'),'uri':encodeURI(_0x3a88fe[_0x752c('0x27')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5549ba[_0x752c('0x31')]){case _0x752c('0x32'):_0x5549ba['qs']=_0x360ec8;break;case _0x752c('0x30'):_0x5549ba['body']=_0x360ec8;break;}return rp(_0x5549ba)[_0x752c('0x1b')](function(_0x431959){logger[_0x752c('0x28')](_0x752c('0x29'),_0x752c('0x2a'),util[_0x752c('0x2b')](_0x752c('0x33'),_0x360ec8['id'],_0x3a88fe[_0x752c('0x27')]));if(_0x431959[_0x752c('0xe')][_0x752c('0x34')]&&_0x431959[_0x752c('0xe')]['threadId']!=_0x360ec8[_0x752c('0x2e')][_0x752c('0x34')]){return _0x35430d[_0x752c('0x18')][_0x752c('0x1c')]({'threadId':_0x431959['body'][_0x752c('0x34')]},{'where':{'id':_0x360ec8['Interaction']['id']}});}else{return;}})[_0x752c('0x1b')](function(){return _0x119c3e[_0x752c('0x1c')]({'read':!![]});})['catch'](function(_0x20efc3){logger['error']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0x752c('0x35')](_0x20efc3,{'showHidden':![],'depth':null}));_0x44d045();});}else{_0x44d045();}})[_0x752c('0x36')](function(){_0x44d045();});}else{_0x44d045();}}},'charset':_0x752c('0x37'),'collate':_0x752c('0x38')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 56d688c..702226e 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 _0x1261=['../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','OpenchannelMessage','options','raw','then','CreateOpenchannelMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3fc807,_0x16ee12){var _0x2a4b4d=function(_0x2101f4){while(--_0x2101f4){_0x3fc807['push'](_0x3fc807['shift']());}};_0x2a4b4d(++_0x16ee12);}(_0x1261,0x144));var _0x1126=function(_0x411b14,_0x3f9e36){_0x411b14=_0x411b14-0x0;var _0x402736=_0x1261[_0x411b14];return _0x402736;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});config[_0x1126('0xb')]=_['defaults'](config[_0x1126('0xb')],{'host':_0x1126('0xc'),'port':0x18eb});var socket=require(_0x1126('0xd'))(new Redis(config[_0x1126('0xb')]));require(_0x1126('0xe'))['register'](socket);function respondWithRpcPromise(_0x3f09ac,_0x18dbe6,_0x167ef1){return new BPromise(function(_0x5e72e2,_0x34571c){return client['request'](_0x3f09ac,_0x167ef1)['then'](function(_0x15c071){logger['info'](_0x1126('0xf'),_0x18dbe6,_0x1126('0x10'));logger[_0x1126('0x11')](_0x1126('0x12'),_0x18dbe6,_0x1126('0x10'),JSON[_0x1126('0x13')](_0x15c071));if(_0x15c071[_0x1126('0x14')]){if(_0x15c071[_0x1126('0x14')][_0x1126('0x15')]===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x34571c(_0x15c071[_0x1126('0x14')]['message']);}logger[_0x1126('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x18dbe6,_0x15c071[_0x1126('0x14')][_0x1126('0x16')]);return _0x5e72e2(_0x15c071[_0x1126('0x14')]['message']);}else{logger[_0x1126('0x17')](_0x1126('0xf'),_0x18dbe6,'request\x20sent');_0x5e72e2(_0x15c071['result'][_0x1126('0x16')]);}})[_0x1126('0x18')](function(_0x58d11a){logger['error'](_0x1126('0xf'),_0x18dbe6,_0x58d11a);_0x34571c(_0x58d11a);});});}exports['CreateOpenchannelMessage']=function(_0x22ed37){var _0x1d6d19=this;return new Promise(function(_0x2f70ac,_0x54400a){return db[_0x1126('0x19')]['create'](_0x22ed37['body'],{'raw':_0x22ed37[_0x1126('0x1a')]?_0x22ed37[_0x1126('0x1a')][_0x1126('0x1b')]===undefined?!![]:![]:!![]})[_0x1126('0x1c')](function(_0x526ca1){logger[_0x1126('0x17')](_0x1126('0x1d'),_0x22ed37);logger['debug'](_0x1126('0x1d'),_0x22ed37,JSON['stringify'](_0x526ca1));_0x2f70ac(_0x526ca1);})['catch'](function(_0x4b57ab){logger[_0x1126('0x14')](_0x1126('0x1d'),_0x4b57ab[_0x1126('0x16')],_0x22ed37);_0x54400a(_0x1d6d19[_0x1126('0x14')](0x1f4,_0x4b57ab[_0x1126('0x16')]));});});}; \ No newline at end of file +var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x227bd0,_0x29e109){var _0x1d48c0=function(_0x53e0c6){while(--_0x53e0c6){_0x227bd0['push'](_0x227bd0['shift']());}};_0x1d48c0(++_0x29e109);}(_0x2ef3,0xba));var _0x32ef=function(_0xf3d19,_0x368fec){_0xf3d19=_0xf3d19-0x0;var _0x6c500a=_0x2ef3[_0xf3d19];return _0x6c500a;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 350fd0b..7863444 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 _0x757a=['update','emit','removeListener','length','openchannelMessage:','save'];(function(_0x8dbc64,_0x17362d){var _0x2645ca=function(_0x24f6fc){while(--_0x24f6fc){_0x8dbc64['push'](_0x8dbc64['shift']());}};_0x2645ca(++_0x17362d);}(_0x757a,0x1af));var _0xa757=function(_0x2d2237,_0x5bd828){_0x2d2237=_0x2d2237-0x0;var _0x115f10=_0x757a[_0x2d2237];return _0x115f10;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xa757('0x0'),'remove',_0xa757('0x1')];function createListener(_0x53364d,_0x53eaeb){return function(_0x919482){_0x53eaeb[_0xa757('0x2')](_0x53364d,_0x919482);};}function removeListener(_0x468559,_0x339299){return function(){OpenchannelMessageEvents[_0xa757('0x3')](_0x468559,_0x339299);};}exports['register']=function(_0x410ed1){for(var _0x2e804c=0x0,_0x155b42=events[_0xa757('0x4')];_0x2e804c<_0x155b42;_0x2e804c++){var _0x186a9b=events[_0x2e804c];var _0x3fd774=createListener(_0xa757('0x5')+_0x186a9b,_0x410ed1);OpenchannelMessageEvents['on'](_0x186a9b,_0x3fd774);}}; \ No newline at end of file +var _0xf015=['remove','emit','removeListener','register','length'];(function(_0x1037c6,_0xeef231){var _0x505213=function(_0x17be84){while(--_0x17be84){_0x1037c6['push'](_0x1037c6['shift']());}};_0x505213(++_0xeef231);}(_0xf015,0x13b));var _0x5f01=function(_0x2e79da,_0xada0bf){_0x2e79da=_0x2e79da-0x0;var _0x83e84d=_0xf015[_0x2e79da];return _0x83e84d;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0x5f01('0x0'),'update'];function createListener(_0x4ee3fd,_0x36cf4c){return function(_0x484077){_0x36cf4c[_0x5f01('0x1')](_0x4ee3fd,_0x484077);};}function removeListener(_0x524009,_0x33fd75){return function(){OpenchannelMessageEvents[_0x5f01('0x2')](_0x524009,_0x33fd75);};}exports[_0x5f01('0x3')]=function(_0x454de5){for(var _0x122dd0=0x0,_0x5bc7a3=events[_0x5f01('0x4')];_0x122dd0<_0x5bc7a3;_0x122dd0++){var _0x3d35da=events[_0x122dd0];var _0xb5cfef=createListener('openchannelMessage:'+_0x3d35da,_0x454de5);OpenchannelMessageEvents['on'](_0x3d35da,_0xb5cfef);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index ab2f422..f1e2ef5 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 _0xec82=['show','/:id/members','/:id/teams','/:id/users','create','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x50ce16,_0x59e64b){var _0x30f4d7=function(_0x1cd2ee){while(--_0x1cd2ee){_0x50ce16['push'](_0x50ce16['shift']());}};_0x30f4d7(++_0x59e64b);}(_0xec82,0xcf));var _0x2ec8=function(_0xa92b87,_0x260182){_0xa92b87=_0xa92b87-0x0;var _0x261faf=_0xec82[_0xa92b87];return _0x261faf;};'use strict';var multer=require(_0x2ec8('0x0'));var util=require(_0x2ec8('0x1'));var path=require(_0x2ec8('0x2'));var timeout=require(_0x2ec8('0x3'));var express=require(_0x2ec8('0x4'));var router=express[_0x2ec8('0x5')]();var fs_extra=require(_0x2ec8('0x6'));var auth=require(_0x2ec8('0x7'));var interaction=require(_0x2ec8('0x8'));var config=require(_0x2ec8('0x9'));var controller=require(_0x2ec8('0xa'));router[_0x2ec8('0xb')]('/',auth[_0x2ec8('0xc')](),controller[_0x2ec8('0xd')]);router[_0x2ec8('0xb')](_0x2ec8('0xe'),auth[_0x2ec8('0xc')](),controller[_0x2ec8('0xf')]);router[_0x2ec8('0xb')](_0x2ec8('0x10'),auth[_0x2ec8('0xc')](),controller[_0x2ec8('0x11')]);router['get'](_0x2ec8('0x12'),auth['isAuthenticated'](),controller['getMembers']);router[_0x2ec8('0xb')](_0x2ec8('0x13'),auth['isAuthenticated'](),controller['getTeams']);router[_0x2ec8('0xb')](_0x2ec8('0x14'),auth[_0x2ec8('0xc')](),controller['getAgents']);router['post']('/',auth[_0x2ec8('0xc')](),controller[_0x2ec8('0x15')]);router[_0x2ec8('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0x2ec8('0x17')]);router[_0x2ec8('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0x2ec8('0x18')]);router[_0x2ec8('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x2ec8('0x1a')]);router[_0x2ec8('0x1b')](_0x2ec8('0x10'),auth[_0x2ec8('0xc')](),controller[_0x2ec8('0x1c')]);router[_0x2ec8('0x1b')](_0x2ec8('0x13'),auth[_0x2ec8('0xc')](),controller[_0x2ec8('0x1d')]);router[_0x2ec8('0x1b')](_0x2ec8('0x14'),auth['isAuthenticated'](),controller[_0x2ec8('0x1e')]);module[_0x2ec8('0x1f')]=router; \ No newline at end of file +var _0x3e59=['/:id','show','/:id/members','getMembers','getTeams','post','create','/:id/teams','addTeams','/:id/users','put','update','delete','destroy','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x3c6a65,_0x56fb98){var _0x48df1e=function(_0x567402){while(--_0x567402){_0x3c6a65['push'](_0x3c6a65['shift']());}};_0x48df1e(++_0x56fb98);}(_0x3e59,0x1f0));var _0x93e5=function(_0x2e04ef,_0x31a596){_0x2e04ef=_0x2e04ef-0x0;var _0x5722b0=_0x3e59[_0x2e04ef];return _0x5722b0;};'use strict';var multer=require(_0x93e5('0x0'));var util=require(_0x93e5('0x1'));var path=require(_0x93e5('0x2'));var timeout=require(_0x93e5('0x3'));var express=require(_0x93e5('0x4'));var router=express[_0x93e5('0x5')]();var fs_extra=require(_0x93e5('0x6'));var auth=require(_0x93e5('0x7'));var interaction=require(_0x93e5('0x8'));var config=require(_0x93e5('0x9'));var controller=require(_0x93e5('0xa'));router[_0x93e5('0xb')]('/',auth[_0x93e5('0xc')](),controller[_0x93e5('0xd')]);router[_0x93e5('0xb')](_0x93e5('0xe'),auth['isAuthenticated'](),controller[_0x93e5('0xf')]);router['get'](_0x93e5('0x10'),auth[_0x93e5('0xc')](),controller[_0x93e5('0x11')]);router[_0x93e5('0xb')](_0x93e5('0x12'),auth[_0x93e5('0xc')](),controller[_0x93e5('0x13')]);router[_0x93e5('0xb')]('/:id/teams',auth[_0x93e5('0xc')](),controller[_0x93e5('0x14')]);router[_0x93e5('0xb')]('/:id/users',auth[_0x93e5('0xc')](),controller['getAgents']);router[_0x93e5('0x15')]('/',auth[_0x93e5('0xc')](),controller[_0x93e5('0x16')]);router['post'](_0x93e5('0x17'),auth['isAuthenticated'](),controller[_0x93e5('0x18')]);router['post'](_0x93e5('0x19'),auth['isAuthenticated'](),controller['addAgents']);router[_0x93e5('0x1a')](_0x93e5('0x10'),auth['isAuthenticated'](),controller[_0x93e5('0x1b')]);router[_0x93e5('0x1c')](_0x93e5('0x10'),auth[_0x93e5('0xc')](),controller[_0x93e5('0x1d')]);router[_0x93e5('0x1c')](_0x93e5('0x17'),auth['isAuthenticated'](),controller[_0x93e5('0x1e')]);router['delete'](_0x93e5('0x19'),auth[_0x93e5('0xc')](),controller[_0x93e5('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 4f3761a..5d9848c 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 _0x3f30=['STRING','INTEGER','ENUM','rrmemory','beepall','sequelize','exports','name'];(function(_0x47e69e,_0x398963){var _0x302e7f=function(_0x3ca5b1){while(--_0x3ca5b1){_0x47e69e['push'](_0x47e69e['shift']());}};_0x302e7f(++_0x398963);}(_0x3f30,0xfd));var _0x03f3=function(_0x12c705,_0x56b9b3){_0x12c705=_0x12c705-0x0;var _0x4c826f=_0x3f30[_0x12c705];return _0x4c826f;};'use strict';var Sequelize=require(_0x03f3('0x0'));module[_0x03f3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x03f3('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x03f3('0x3')]},'timeout':{'type':Sequelize[_0x03f3('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x03f3('0x5')](_0x03f3('0x6'),_0x03f3('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x3bc3=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','name'];(function(_0x308bb2,_0x28ba87){var _0x2a67ea=function(_0x3dfe33){while(--_0x3dfe33){_0x308bb2['push'](_0x308bb2['shift']());}};_0x2a67ea(++_0x28ba87);}(_0x3bc3,0x15c));var _0x33bc=function(_0x8ac776,_0x3d4684){_0x8ac776=_0x8ac776-0x0;var _0x49a75d=_0x3bc3[_0x8ac776];return _0x49a75d;};'use strict';var Sequelize=require(_0x33bc('0x0'));module[_0x33bc('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x33bc('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x33bc('0x3')]},'timeout':{'type':Sequelize[_0x33bc('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x33bc('0x5')](_0x33bc('0x6'),_0x33bc('0x7'),_0x33bc('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 2b24048..1239cce 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 _0x911d=['find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','UserId','openchannelPause','createdAt','format','%s/%s','SIP','getTeams','addTeams','Team','Agents','online','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','select','field','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','toString','QueryTypes','SELECT','all','union','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','sort','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','limit','undefined','count','set','json','apply','reject','update','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','OpenchannelQueue','rawAttributes','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','map','type','options','includeAll','findAll','rows','catch','show','params','keys','include','create','body','user','UserProfileSection'];(function(_0x2f2ed0,_0x1c6435){var _0x250b0d=function(_0x1909c1){while(--_0x1909c1){_0x2f2ed0['push'](_0x2f2ed0['shift']());}};_0x250b0d(++_0x1c6435);}(_0x911d,0xc5));var _0xd911=function(_0x25948f,_0x4ac7e4){_0x25948f=_0x25948f-0x0;var _0x2b1976=_0x911d[_0x25948f];return _0x2b1976;};'use strict';var emlformat=require(_0xd911('0x0'));var rimraf=require(_0xd911('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd911('0x2'));var rp=require(_0xd911('0x3'));var moment=require(_0xd911('0x4'));var BPromise=require(_0xd911('0x5'));var Mustache=require('mustache');var util=require(_0xd911('0x6'));var path=require(_0xd911('0x7'));var sox=require(_0xd911('0x8'));var csv=require(_0xd911('0x9'));var ejs=require(_0xd911('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd911('0xb'));var crypto=require(_0xd911('0xc'));var jsforce=require(_0xd911('0xd'));var deskjs=require(_0xd911('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd911('0xf'));var Papa=require(_0xd911('0x10'));var Redis=require(_0xd911('0x11'));var authService=require(_0xd911('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd911('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd911('0x14'))(_0xd911('0x15'));var utils=require(_0xd911('0x16'));var config=require(_0xd911('0x17'));var licenseUtil=require(_0xd911('0x18'));var db=require(_0xd911('0x19'))['db'];config[_0xd911('0x1a')]=_[_0xd911('0x1b')](config['redis'],{'host':_0xd911('0x1c'),'port':0x18eb});var socket=require(_0xd911('0x1d'))(new Redis(config[_0xd911('0x1a')]));require('./openchannelQueue.socket')[_0xd911('0x1e')](socket);function respondWithStatusCode(_0x3be208,_0x51e439){_0x51e439=_0x51e439||0xcc;return function(_0x440300){if(_0x440300){return _0x3be208[_0xd911('0x1f')](_0x51e439);}return _0x3be208[_0xd911('0x20')](_0x51e439)[_0xd911('0x21')]();};}function respondWithResult(_0x436477,_0x58cd61){_0x58cd61=_0x58cd61||0xc8;return function(_0x41355f){if(_0x41355f){return _0x436477[_0xd911('0x20')](_0x58cd61)['json'](_0x41355f);}};}function respondWithFilteredResult(_0x6e944c,_0xc3ba60){return function(_0x4d6e88){if(_0x4d6e88){var _0x984d57=typeof _0xc3ba60[_0xd911('0x22')]==='undefined'&&typeof _0xc3ba60[_0xd911('0x23')]===_0xd911('0x24');var _0x14d175=_0x4d6e88[_0xd911('0x25')];var _0x3b642c=_0x984d57?0x0:_0xc3ba60[_0xd911('0x22')];var _0x21cde8=_0x984d57?_0x4d6e88[_0xd911('0x25')]:_0xc3ba60[_0xd911('0x22')]+_0xc3ba60[_0xd911('0x23')];var _0x43a20b;if(_0x21cde8>=_0x14d175){_0x21cde8=_0x14d175;_0x43a20b=0xc8;}else{_0x43a20b=0xce;}_0x6e944c['status'](_0x43a20b);return _0x6e944c[_0xd911('0x26')]('Content-Range',_0x3b642c+'-'+_0x21cde8+'/'+_0x14d175)[_0xd911('0x27')](_0x4d6e88);}return null;};}function patchUpdates(_0x20e29b){return function(_0x3dab20){try{jsonpatch[_0xd911('0x28')](_0x3dab20,_0x20e29b,!![]);}catch(_0x1f1e91){return BPromise[_0xd911('0x29')](_0x1f1e91);}return _0x3dab20['save']();};}function saveUpdates(_0x5e69ca,_0x58ba95){return function(_0x410fc9){if(_0x410fc9){return _0x410fc9[_0xd911('0x2a')](_0x5e69ca)[_0xd911('0x2b')](function(_0x30b5e6){return _0x30b5e6;});}return null;};}function removeEntity(_0x21a816,_0x34554b){return function(_0x20cab6){if(_0x20cab6){return _0x20cab6[_0xd911('0x2c')]()[_0xd911('0x2b')](function(){var _0x43e5ed=_0x20cab6[_0xd911('0x2d')]({'plain':!![]});var _0x14daed=_0xd911('0x2e');return db[_0xd911('0x2f')]['destroy']({'where':{'type':_0x14daed,'resourceId':_0x43e5ed['id']}})[_0xd911('0x2b')](function(){return _0x20cab6;});})[_0xd911('0x2b')](function(){_0x21a816[_0xd911('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x112d4f,_0x3b3e31){return function(_0x362c13){if(!_0x362c13){_0x112d4f[_0xd911('0x1f')](0x194);}return _0x362c13;};}function handleError(_0x56a75c,_0xd61db9){_0xd61db9=_0xd61db9||0x1f4;return function(_0x3517eb){logger[_0xd911('0x30')](_0x3517eb[_0xd911('0x31')]);if(_0x3517eb['name']){delete _0x3517eb[_0xd911('0x32')];}_0x56a75c[_0xd911('0x20')](_0xd61db9)[_0xd911('0x33')](_0x3517eb);};}exports['index']=function(_0x50e380,_0x3aeae7){var _0x4fccbd={},_0x5bef65={},_0x375099={'count':0x0,'rows':[]};var _0x3a7acf=_['map'](db[_0xd911('0x34')][_0xd911('0x35')],function(_0x594848){return{'name':_0x594848['fieldName'],'type':_0x594848['type']['key']};});_0x5bef65[_0xd911('0x36')]=_['map'](_0x3a7acf,'name');_0x5bef65[_0xd911('0x37')]=_['keys'](_0x50e380[_0xd911('0x37')]);_0x5bef65[_0xd911('0x38')]=_[_0xd911('0x39')](_0x5bef65[_0xd911('0x36')],_0x5bef65[_0xd911('0x37')]);_0x4fccbd[_0xd911('0x3a')]=_[_0xd911('0x39')](_0x5bef65[_0xd911('0x36')],qs[_0xd911('0x3b')](_0x50e380['query']['fields']));_0x4fccbd['attributes']=_0x4fccbd['attributes'][_0xd911('0x3c')]?_0x4fccbd['attributes']:_0x5bef65[_0xd911('0x36')];if(!_0x50e380['query'][_0xd911('0x3d')](_0xd911('0x3e'))){_0x4fccbd[_0xd911('0x23')]=qs[_0xd911('0x23')](_0x50e380['query'][_0xd911('0x23')]);_0x4fccbd[_0xd911('0x22')]=qs[_0xd911('0x22')](_0x50e380[_0xd911('0x37')]['offset']);}_0x4fccbd[_0xd911('0x3f')]=qs['sort'](_0x50e380['query']['sort']);_0x4fccbd[_0xd911('0x40')]=qs[_0xd911('0x38')](_[_0xd911('0x41')](_0x50e380[_0xd911('0x37')],_0x5bef65[_0xd911('0x38')]),_0x3a7acf);if(_0x50e380['query'][_0xd911('0x42')]){_0x4fccbd[_0xd911('0x40')]=_[_0xd911('0x43')](_0x4fccbd[_0xd911('0x40')],{'$or':_[_0xd911('0x44')](_0x3a7acf,function(_0x2db627){if(_0x2db627[_0xd911('0x45')]!=='VIRTUAL'){var _0x6c2f5d={};_0x6c2f5d[_0x2db627[_0xd911('0x32')]]={'$like':'%'+_0x50e380[_0xd911('0x37')][_0xd911('0x42')]+'%'};return _0x6c2f5d;}})});}_0x4fccbd=_['merge']({},_0x4fccbd,_0x50e380[_0xd911('0x46')]);var _0x4f5f62={'where':_0x4fccbd[_0xd911('0x40')]};return db[_0xd911('0x34')][_0xd911('0x25')](_0x4f5f62)[_0xd911('0x2b')](function(_0x59f687){_0x375099[_0xd911('0x25')]=_0x59f687;if(_0x50e380['query'][_0xd911('0x47')]){_0x4fccbd['include']=[{'all':!![]}];}return db[_0xd911('0x34')][_0xd911('0x48')](_0x4fccbd);})['then'](function(_0x5a1df3){_0x375099[_0xd911('0x49')]=_0x5a1df3;return _0x375099;})[_0xd911('0x2b')](respondWithFilteredResult(_0x3aeae7,_0x4fccbd))[_0xd911('0x4a')](handleError(_0x3aeae7,null));};exports[_0xd911('0x4b')]=function(_0x5ecb2b,_0x157e39){var _0x4d1dad={'raw':!![],'where':{'id':_0x5ecb2b[_0xd911('0x4c')]['id']}},_0xc7f12a={};_0xc7f12a['model']=_[_0xd911('0x4d')](db['OpenchannelQueue'][_0xd911('0x35')]);_0xc7f12a[_0xd911('0x37')]=_['keys'](_0x5ecb2b['query']);_0xc7f12a['filters']=_['intersection'](_0xc7f12a[_0xd911('0x36')],_0xc7f12a[_0xd911('0x37')]);_0x4d1dad[_0xd911('0x3a')]=_[_0xd911('0x39')](_0xc7f12a[_0xd911('0x36')],qs[_0xd911('0x3b')](_0x5ecb2b['query'][_0xd911('0x3b')]));_0x4d1dad['attributes']=_0x4d1dad[_0xd911('0x3a')]['length']?_0x4d1dad[_0xd911('0x3a')]:_0xc7f12a[_0xd911('0x36')];if(_0x5ecb2b[_0xd911('0x37')][_0xd911('0x47')]){_0x4d1dad[_0xd911('0x4e')]=[{'all':!![]}];}_0x4d1dad=_[_0xd911('0x43')]({},_0x4d1dad,_0x5ecb2b[_0xd911('0x46')]);return db[_0xd911('0x34')]['find'](_0x4d1dad)[_0xd911('0x2b')](handleEntityNotFound(_0x157e39,null))[_0xd911('0x2b')](respondWithResult(_0x157e39,null))[_0xd911('0x4a')](handleError(_0x157e39,null));};exports['create']=function(_0x47df60,_0x15f2e8){return db[_0xd911('0x34')][_0xd911('0x4f')](_0x47df60[_0xd911('0x50')],{})[_0xd911('0x2b')](function(_0x662949){var _0x5def76=_0x47df60['user'][_0xd911('0x2d')]({'plain':!![]});if(!_0x5def76)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5def76['role']===_0xd911('0x51')){var _0x474500=_0x662949[_0xd911('0x2d')]({'plain':!![]});var _0x2ea18d='OpenchannelQueues';return db[_0xd911('0x52')][_0xd911('0x53')]({'where':{'name':_0x2ea18d,'userProfileId':_0x5def76[_0xd911('0x54')]},'raw':!![]})['then'](function(_0x32f5a4){if(_0x32f5a4&&_0x32f5a4[_0xd911('0x55')]===0x0){return db['UserProfileResource'][_0xd911('0x4f')]({'name':_0x474500[_0xd911('0x32')],'resourceId':_0x474500['id'],'type':_0x32f5a4[_0xd911('0x32')],'sectionId':_0x32f5a4['id']},{})[_0xd911('0x2b')](function(){return _0x662949;});}else{return _0x662949;}})[_0xd911('0x4a')](function(_0x332429){logger['error'](_0xd911('0x56'),_0x332429);throw _0x332429;});}return _0x662949;})[_0xd911('0x2b')](respondWithResult(_0x15f2e8,0xc9))[_0xd911('0x4a')](handleError(_0x15f2e8,null));};exports[_0xd911('0x2a')]=function(_0x1b4ea7,_0x3f67e1){if(_0x1b4ea7['body']['id']){delete _0x1b4ea7[_0xd911('0x50')]['id'];}return db[_0xd911('0x34')][_0xd911('0x53')]({'where':{'id':_0x1b4ea7[_0xd911('0x4c')]['id']}})[_0xd911('0x2b')](handleEntityNotFound(_0x3f67e1,null))[_0xd911('0x2b')](saveUpdates(_0x1b4ea7[_0xd911('0x50')],null))['then'](respondWithResult(_0x3f67e1,null))[_0xd911('0x4a')](handleError(_0x3f67e1,null));};exports[_0xd911('0x2c')]=function(_0x4dddf7,_0x3158b2){return db['OpenchannelQueue'][_0xd911('0x53')]({'where':{'id':_0x4dddf7[_0xd911('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3158b2,null))[_0xd911('0x2b')](removeEntity(_0x3158b2,null))[_0xd911('0x4a')](handleError(_0x3158b2,null));};exports[_0xd911('0x57')]=function(_0x48d149,_0x572f15){return db['OpenchannelQueue'][_0xd911('0x57')]()['then'](respondWithResult(_0x572f15,null))[_0xd911('0x4a')](handleError(_0x572f15,null));};exports[_0xd911('0x58')]=function(_0x26f5c2,_0x48b275,_0x30d803){var _0x5809d2={'raw':!![],'where':{}},_0x5bad14={},_0x51627d;return db[_0xd911('0x34')][_0xd911('0x59')]({'where':{'id':_0x26f5c2[_0xd911('0x4c')]['id']}})['then'](handleEntityNotFound(_0x48b275,null))['then'](function(_0x5b7adb){if(_0x5b7adb){_0x51627d=_0x5b7adb[_0xd911('0x2d')]({'plain':!![]});_0x5bad14[_0xd911('0x36')]=_['keys'](db[_0xd911('0x5a')][_0xd911('0x35')]);_0x5bad14['query']=_[_0xd911('0x4d')](_0x26f5c2[_0xd911('0x37')]);_0x5bad14[_0xd911('0x38')]=_['intersection'](_0x5bad14[_0xd911('0x36')],_0x5bad14['query']);_0x5809d2[_0xd911('0x3a')]=_[_0xd911('0x39')](_0x5bad14[_0xd911('0x36')],qs[_0xd911('0x3b')](_0x26f5c2[_0xd911('0x37')]['fields']));_0x5809d2[_0xd911('0x3a')]=_0x5809d2[_0xd911('0x3a')][_0xd911('0x3c')]?_0x5809d2['attributes']:_0x5bad14['model'];if(!_0x26f5c2[_0xd911('0x37')][_0xd911('0x3d')](_0xd911('0x3e'))){_0x5809d2[_0xd911('0x23')]=qs['limit'](_0x26f5c2[_0xd911('0x37')][_0xd911('0x23')]);_0x5809d2[_0xd911('0x22')]=qs[_0xd911('0x22')](_0x26f5c2['query'][_0xd911('0x22')]);}_0x5809d2[_0xd911('0x3f')]=qs['sort'](_0x26f5c2[_0xd911('0x37')]['sort']);_0x5809d2[_0xd911('0x40')]=qs['filters'](_['pick'](_0x26f5c2[_0xd911('0x37')],_0x5bad14[_0xd911('0x38')]));_0x5809d2[_0xd911('0x40')][_0xd911('0x5b')]=_0x5b7adb['id'];if(_0x26f5c2[_0xd911('0x37')][_0xd911('0x42')]){_0x5809d2[_0xd911('0x40')]=_['merge'](_0x5809d2['where'],{'$or':_[_0xd911('0x44')](_0x5809d2[_0xd911('0x3a')],function(_0x4cf967){var _0x2d8735={};_0x2d8735[_0x4cf967]={'$like':'%'+_0x26f5c2[_0xd911('0x37')][_0xd911('0x42')]+'%'};return _0x2d8735;})});}_0x5809d2=_['merge']({},_0x5809d2,_0x26f5c2[_0xd911('0x46')]);return db['UserOpenchannelQueue']['findAll'](_0x5809d2);}})['then'](function(_0x3e9918){if(_0x3e9918){return db[_0xd911('0x5c')][_0xd911('0x5d')]({'where':{'id':_[_0xd911('0x44')](_0x3e9918,_0xd911('0x5e')),'role':'agent'},'attributes':['id',_0xd911('0x32'),_0xd911('0x5f'),'updatedAt',_0xd911('0x60')]});}})[_0xd911('0x2b')](function(_0x161d9a){if(_0x161d9a){return{'count':_0x161d9a[_0xd911('0x25')],'rows':_[_0xd911('0x44')](_0x161d9a[_0xd911('0x49')],function(_0xfd5618){return{'membername':_0xfd5618[_0xd911('0x32')],'UserId':_0xfd5618['id'],'queue_name':_0x51627d[_0xd911('0x32')],'OpenchannelQueueId':_0x51627d['id'],'interface':util[_0xd911('0x61')](_0xd911('0x62'),_0xd911('0x63'),_0xfd5618[_0xd911('0x32')]),'penalty':0x0,'paused':_0xfd5618['openchannelPause'],'createdAt':_0xfd5618[_0xd911('0x60')],'updatedAt':_0xfd5618['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xd911('0x2b')](respondWithFilteredResult(_0x48b275,_0x5809d2))[_0xd911('0x4a')](handleError(_0x48b275,null));};exports[_0xd911('0x64')]=function(_0x981bab,_0x3e8404,_0x8f9a3c){var _0x111269={};var _0x345230={};var _0x1a1b58;var _0x9ca659;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x981bab[_0xd911('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3e8404,null))[_0xd911('0x2b')](function(_0x3ccfe6){if(_0x3ccfe6){_0x1a1b58=_0x3ccfe6;_0x345230[_0xd911('0x36')]=_[_0xd911('0x4d')](db['Team'][_0xd911('0x35')]);_0x345230[_0xd911('0x37')]=_[_0xd911('0x4d')](_0x981bab[_0xd911('0x37')]);_0x345230[_0xd911('0x38')]=_[_0xd911('0x39')](_0x345230['model'],_0x345230[_0xd911('0x37')]);_0x111269['attributes']=_[_0xd911('0x39')](_0x345230[_0xd911('0x36')],qs[_0xd911('0x3b')](_0x981bab[_0xd911('0x37')][_0xd911('0x3b')]));_0x111269[_0xd911('0x3a')]=_0x111269['attributes'][_0xd911('0x3c')]?_0x111269[_0xd911('0x3a')]:_0x345230[_0xd911('0x36')];_0x111269[_0xd911('0x3f')]=qs['sort'](_0x981bab[_0xd911('0x37')]['sort']);_0x111269[_0xd911('0x40')]=qs['filters'](_[_0xd911('0x41')](_0x981bab[_0xd911('0x37')],_0x345230['filters']));if(_0x981bab[_0xd911('0x37')][_0xd911('0x42')]){_0x111269[_0xd911('0x40')]=_[_0xd911('0x43')](_0x111269[_0xd911('0x40')],{'$or':_['map'](_0x111269[_0xd911('0x3a')],function(_0x4533f9){var _0x464523={};_0x464523[_0x4533f9]={'$like':'%'+_0x981bab[_0xd911('0x37')][_0xd911('0x42')]+'%'};return _0x464523;})});}_0x111269=_['merge']({},_0x111269,_0x981bab[_0xd911('0x46')]);return _0x1a1b58['getTeams'](_0x111269);}})[_0xd911('0x2b')](function(_0x382ed4){if(_0x382ed4){_0x9ca659=_0x382ed4[_0xd911('0x3c')];if(!_0x981bab[_0xd911('0x37')][_0xd911('0x3d')](_0xd911('0x3e'))){_0x111269[_0xd911('0x23')]=qs['limit'](_0x981bab[_0xd911('0x37')][_0xd911('0x23')]);_0x111269[_0xd911('0x22')]=qs[_0xd911('0x22')](_0x981bab[_0xd911('0x37')]['offset']);}return _0x1a1b58[_0xd911('0x64')](_0x111269);}})[_0xd911('0x2b')](function(_0x1ea0e4){if(_0x1ea0e4){return _0x1ea0e4?{'count':_0x9ca659,'rows':_0x1ea0e4}:null;}})[_0xd911('0x2b')](respondWithResult(_0x3e8404,null))['catch'](handleError(_0x3e8404,null));};exports[_0xd911('0x65')]=function(_0x10676f,_0x5dc153,_0x524ef5){var _0xd2a741=_0x10676f['body']['ids'];return db[_0xd911('0x66')][_0xd911('0x48')]({'where':{'id':_0xd2a741},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd911('0x67'),'attributes':['id',_0xd911('0x32'),_0xd911('0x68'),_0xd911('0x69'),_0xd911('0x6a')],'raw':!![]}]})[_0xd911('0x2b')](function(_0xe41482){if(_0xe41482){var _0x217e44=_[_0xd911('0x6b')](_0xe41482,function(_0x300a8){var _0xa2eb51=_0x300a8[_0xd911('0x2d')]({'plain':!![]});return _0xa2eb51[_0xd911('0x67')];});return db[_0xd911('0x34')][_0xd911('0x53')]({'where':{'id':_0x10676f['params']['id']}})[_0xd911('0x2b')](function(_0x27dfcf){return db['sequelize'][_0xd911('0x6c')](function(_0x34b92b){return _0x27dfcf['addTeams'](_0xd2a741,{'transaction':_0x34b92b})[_0xd911('0x2b')](function(){return BPromise[_0xd911('0x6d')](_0x217e44,function(_0x3ed3f0){return db[_0xd911('0x5a')][_0xd911('0x6e')]({'where':{'UserId':_0x3ed3f0['id'],'OpenchannelQueueId':_0x10676f[_0xd911('0x4c')]['id']},'transaction':_0x34b92b});});})[_0xd911('0x2b')](function(){_0x217e44[_0xd911('0x6f')](function(_0x44115a){socket[_0xd911('0x70')](_0xd911('0x71'),{'UserId':_0x44115a['id'],'OpenchannelQueueId':_0x27dfcf['id']});});});});});}})[_0xd911('0x2b')](respondWithStatusCode(_0x5dc153,null))['catch'](handleError(_0x5dc153,null));};exports[_0xd911('0x72')]=function(_0x38ab5d,_0x3bd235,_0x47721c){return db[_0xd911('0x66')][_0xd911('0x48')]({'where':{'id':_0x38ab5d['query'][_0xd911('0x73')]},'attributes':['id'],'include':[{'model':db[_0xd911('0x5c')],'as':_0xd911('0x67'),'attributes':['id'],'raw':!![]}]})[_0xd911('0x2b')](handleEntityNotFound(_0x3bd235,null))[_0xd911('0x2b')](function(_0x5ee8d0){var _0x17931a=_[_0xd911('0x44')](_0x5ee8d0,'id');var _0x3d47e8=[];var _0xf6baad=[];var _0x301425=squel[_0xd911('0x74')]();_0x301425[_0xd911('0x75')]('tq.TeamId')[_0xd911('0x76')](_0xd911('0x77'),'tq')[_0xd911('0x78')]('user_has_teams','ut',_0xd911('0x79'))[_0xd911('0x40')](_0xd911('0x7a'),_0x38ab5d['params']['id']);for(var _0x2ee7b4=0x0;_0x2ee7b4<_0x5ee8d0['length'];_0x2ee7b4+=0x1){let _0x50b475=_0x5ee8d0[_0x2ee7b4];for(var _0x232d15=0x0;_0x232d15<_0x50b475[_0xd911('0x67')]['length'];_0x232d15+=0x1){let _0xb5c023=_0x50b475[_0xd911('0x67')][_0x232d15];var _0x474383=_0x301425['clone']();_0x474383[_0xd911('0x40')](_0xd911('0x7b'),_0xb5c023['id']);_0xf6baad['push'](db[_0xd911('0x7c')][_0xd911('0x37')](_0x474383[_0xd911('0x7d')](),{'type':db[_0xd911('0x7c')][_0xd911('0x7e')][_0xd911('0x7f')]})['then'](function(_0x4786ad){if(_0x4786ad[_0xd911('0x3c')]===0x1){return _0xb5c023['id'];}else{var _0xdff188=_['every'](_[_0xd911('0x44')](_0x4786ad,'TeamId'),function(_0x59f801){return _['includes'](_0x17931a,_0x59f801);});if(_0xdff188){return _0xb5c023['id'];}}}));}}return BPromise[_0xd911('0x80')](_0xf6baad)[_0xd911('0x2b')](function(_0x1f3550){_0x3d47e8=_(_0x3d47e8)[_0xd911('0x81')](_0x1f3550)['compact']()[_0xd911('0x82')]();return db['OpenchannelQueue'][_0xd911('0x53')]({'where':{'id':_0x38ab5d['params']['id']}})[_0xd911('0x2b')](function(_0x8cdb9){return db[_0xd911('0x7c')][_0xd911('0x6c')](function(_0x31cb0e){return _0x8cdb9['removeTeams'](_0x38ab5d[_0xd911('0x37')]['ids'],{'transaction':_0x31cb0e})[_0xd911('0x2b')](function(){if(!_[_0xd911('0x83')](_0x3d47e8)){return _0x8cdb9[_0xd911('0x84')](_0x3d47e8,{'transaction':_0x31cb0e});}})['then'](function(){_0x3d47e8['forEach'](function(_0x340a00){socket[_0xd911('0x70')](_0xd911('0x85'),{'UserId':_0x340a00,'OpenchannelQueueId':_0x8cdb9['id']});});});});});});})[_0xd911('0x2b')](respondWithStatusCode(_0x3bd235,null))[_0xd911('0x4a')](handleError(_0x3bd235,null));};exports[_0xd911('0x86')]=function(_0x5b7892,_0x1877bb,_0x43081b){return db[_0xd911('0x34')][_0xd911('0x53')]({'where':{'id':_0x5b7892['params']['id']}})[_0xd911('0x2b')](handleEntityNotFound(_0x1877bb,null))[_0xd911('0x2b')](function(_0x23de81){if(_0x23de81){return _0x23de81[_0xd911('0x86')](_0x5b7892[_0xd911('0x50')][_0xd911('0x73')],_[_0xd911('0x87')](_0x5b7892[_0xd911('0x50')],[_0xd911('0x73'),'id'])||{})[_0xd911('0x88')](function(_0x7fbd68){for(var _0x3aa1e3=0x0;_0x3aa1e3<_0x5b7892[_0xd911('0x50')][_0xd911('0x73')]['length'];_0x3aa1e3+=0x1){socket[_0xd911('0x70')]('userOpenchannelQueue:save',{'UserId':Number(_0x5b7892['body'][_0xd911('0x73')][_0x3aa1e3]),'OpenchannelQueueId':Number(_0x5b7892['params']['id'])});}return _0x7fbd68;});}})[_0xd911('0x2b')](respondWithResult(_0x1877bb,null))[_0xd911('0x4a')](handleError(_0x1877bb,null));};exports['removeAgents']=function(_0x28b333,_0x4dbf1a,_0x3084c2){return db[_0xd911('0x34')]['find']({'where':{'id':_0x28b333[_0xd911('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4dbf1a,null))[_0xd911('0x2b')](function(_0x12356e){if(_0x12356e){return _0x12356e['removeAgents'](_0x28b333[_0xd911('0x37')][_0xd911('0x73')])[_0xd911('0x2b')](function(){if(_[_0xd911('0x89')](_0x28b333['query'][_0xd911('0x73')])){for(var _0x52aff3=0x0;_0x52aff3<_0x28b333['query']['ids'][_0xd911('0x3c')];_0x52aff3+=0x1){socket[_0xd911('0x70')](_0xd911('0x85'),{'UserId':Number(_0x28b333[_0xd911('0x37')]['ids'][_0x52aff3]),'OpenchannelQueueId':Number(_0x28b333[_0xd911('0x4c')]['id'])});}}else{socket['emit'](_0xd911('0x85'),{'UserId':Number(_0x28b333[_0xd911('0x37')]['ids']),'OpenchannelQueueId':Number(_0x28b333[_0xd911('0x4c')]['id'])});}});}})[_0xd911('0x2b')](respondWithStatusCode(_0x4dbf1a,null))['catch'](handleError(_0x4dbf1a,null));};exports[_0xd911('0x8a')]=function(_0x29784d,_0x1c463c,_0x259d07){var _0x6cff1e={};var _0x34cb6c={};var _0x567ff7;var _0x3939fb;return db['OpenchannelQueue'][_0xd911('0x59')]({'where':{'id':_0x29784d[_0xd911('0x4c')]['id']}})[_0xd911('0x2b')](handleEntityNotFound(_0x1c463c,null))[_0xd911('0x2b')](function(_0x2ec660){if(_0x2ec660){_0x567ff7=_0x2ec660;_0x34cb6c[_0xd911('0x36')]=_[_0xd911('0x4d')](db[_0xd911('0x5c')]['rawAttributes']);_0x34cb6c[_0xd911('0x37')]=_[_0xd911('0x4d')](_0x29784d[_0xd911('0x37')]);_0x34cb6c[_0xd911('0x38')]=_[_0xd911('0x39')](_0x34cb6c[_0xd911('0x36')],_0x34cb6c[_0xd911('0x37')]);_0x6cff1e['attributes']=_[_0xd911('0x39')](_0x34cb6c[_0xd911('0x36')],qs[_0xd911('0x3b')](_0x29784d[_0xd911('0x37')][_0xd911('0x3b')]));_0x6cff1e['attributes']=_0x6cff1e['attributes'][_0xd911('0x3c')]?_0x6cff1e['attributes']:_0x34cb6c['model'];_0x6cff1e[_0xd911('0x3f')]=qs['sort'](_0x29784d[_0xd911('0x37')][_0xd911('0x8b')]);_0x6cff1e[_0xd911('0x40')]=qs[_0xd911('0x38')](_['pick'](_0x29784d[_0xd911('0x37')],_0x34cb6c['filters']));if(_0x29784d['query'][_0xd911('0x42')]){_0x6cff1e['where']=_['merge'](_0x6cff1e[_0xd911('0x40')],{'$or':_[_0xd911('0x44')](_0x6cff1e[_0xd911('0x3a')],function(_0x47ec07){var _0x5315fe={};_0x5315fe[_0x47ec07]={'$like':'%'+_0x29784d[_0xd911('0x37')][_0xd911('0x42')]+'%'};return _0x5315fe;})});}_0x6cff1e=_[_0xd911('0x43')]({},_0x6cff1e,_0x29784d[_0xd911('0x46')]);return _0x567ff7[_0xd911('0x8a')](_0x6cff1e);}})['then'](function(_0x242d35){if(_0x242d35){_0x3939fb=_0x242d35['length'];if(!_0x29784d[_0xd911('0x37')]['hasOwnProperty'](_0xd911('0x3e'))){_0x6cff1e[_0xd911('0x23')]=qs[_0xd911('0x23')](_0x29784d[_0xd911('0x37')][_0xd911('0x23')]);_0x6cff1e['offset']=qs[_0xd911('0x22')](_0x29784d[_0xd911('0x37')][_0xd911('0x22')]);}return _0x567ff7[_0xd911('0x8a')](_0x6cff1e);}})['then'](function(_0x49fb91){if(_0x49fb91){return _0x49fb91?{'count':_0x3939fb,'rows':_0x49fb91}:null;}})['then'](respondWithResult(_0x1c463c,null))[_0xd911('0x4a')](handleError(_0x1c463c,null));}; \ No newline at end of file +var _0xa5aa=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','OpenchannelQueue','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','body','describe','findOne','UserOpenchannelQueue','OpenchannelQueueId','findAll','User','findAndCountAll','openchannelPause','updatedAt','createdAt','getTeams','addTeams','ids','Team','Agents','voicePause','flatMap','transaction','findOrCreate','forEach','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','sequelize','toString','SELECT','every','TeamId','all','union','compact','value','removeAgents','emit','userOpenchannelQueue:remove','spread','isArray','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x4a4bde,_0x3fcd53){var _0x7532f1=function(_0x36746f){while(--_0x36746f){_0x4a4bde['push'](_0x4a4bde['shift']());}};_0x7532f1(++_0x3fcd53);}(_0xa5aa,0x192));var _0xaa5a=function(_0x33d00e,_0x39914d){_0x33d00e=_0x33d00e-0x0;var _0x3886f3=_0xa5aa[_0x33d00e];return _0x3886f3;};'use strict';var emlformat=require(_0xaa5a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaa5a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaa5a('0x2'));var moment=require(_0xaa5a('0x3'));var BPromise=require(_0xaa5a('0x4'));var Mustache=require('mustache');var util=require(_0xaa5a('0x5'));var path=require('path');var sox=require(_0xaa5a('0x6'));var csv=require(_0xaa5a('0x7'));var ejs=require(_0xaa5a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaa5a('0x9'));var squel=require(_0xaa5a('0xa'));var crypto=require(_0xaa5a('0xb'));var jsforce=require(_0xaa5a('0xc'));var deskjs=require(_0xaa5a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xaa5a('0xe'));var Papa=require(_0xaa5a('0xf'));var Redis=require(_0xaa5a('0x10'));var authService=require(_0xaa5a('0x11'));var qs=require(_0xaa5a('0x12'));var as=require(_0xaa5a('0x13'));var hardwareService=require(_0xaa5a('0x14'));var logger=require(_0xaa5a('0x15'))(_0xaa5a('0x16'));var utils=require(_0xaa5a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xaa5a('0x18'));var db=require(_0xaa5a('0x19'))['db'];config[_0xaa5a('0x1a')]=_['defaults'](config[_0xaa5a('0x1a')],{'host':_0xaa5a('0x1b'),'port':0x18eb});var socket=require(_0xaa5a('0x1c'))(new Redis(config[_0xaa5a('0x1a')]));require(_0xaa5a('0x1d'))[_0xaa5a('0x1e')](socket);function respondWithStatusCode(_0x1e78bf,_0x44c1b8){_0x44c1b8=_0x44c1b8||0xcc;return function(_0xaf8ab8){if(_0xaf8ab8){return _0x1e78bf[_0xaa5a('0x1f')](_0x44c1b8);}return _0x1e78bf[_0xaa5a('0x20')](_0x44c1b8)[_0xaa5a('0x21')]();};}function respondWithResult(_0x577b3a,_0x11bb01){_0x11bb01=_0x11bb01||0xc8;return function(_0x1150ab){if(_0x1150ab){return _0x577b3a[_0xaa5a('0x20')](_0x11bb01)['json'](_0x1150ab);}};}function respondWithFilteredResult(_0x3996ae,_0x589240){return function(_0x3f648d){if(_0x3f648d){var _0x1ddc77=typeof _0x589240[_0xaa5a('0x22')]===_0xaa5a('0x23')&&typeof _0x589240[_0xaa5a('0x24')]===_0xaa5a('0x23');var _0x3e94a8=_0x3f648d['count'];var _0x7d1a5b=_0x1ddc77?0x0:_0x589240['offset'];var _0x24a4f0=_0x1ddc77?_0x3f648d[_0xaa5a('0x25')]:_0x589240[_0xaa5a('0x22')]+_0x589240[_0xaa5a('0x24')];var _0x5a57a9;if(_0x24a4f0>=_0x3e94a8){_0x24a4f0=_0x3e94a8;_0x5a57a9=0xc8;}else{_0x5a57a9=0xce;}_0x3996ae[_0xaa5a('0x20')](_0x5a57a9);return _0x3996ae[_0xaa5a('0x26')](_0xaa5a('0x27'),_0x7d1a5b+'-'+_0x24a4f0+'/'+_0x3e94a8)[_0xaa5a('0x28')](_0x3f648d);}return null;};}function patchUpdates(_0x9771b6){return function(_0x3b2e53){try{jsonpatch['apply'](_0x3b2e53,_0x9771b6,!![]);}catch(_0x5ad460){return BPromise[_0xaa5a('0x29')](_0x5ad460);}return _0x3b2e53[_0xaa5a('0x2a')]();};}function saveUpdates(_0x31ad20,_0x3d49b1){return function(_0x185774){if(_0x185774){return _0x185774[_0xaa5a('0x2b')](_0x31ad20)[_0xaa5a('0x2c')](function(_0x1e45e9){return _0x1e45e9;});}return null;};}function removeEntity(_0x43fc39,_0x34f216){return function(_0x47ba58){if(_0x47ba58){return _0x47ba58[_0xaa5a('0x2d')]()[_0xaa5a('0x2c')](function(){var _0x4f6ff2=_0x47ba58['get']({'plain':!![]});var _0x26fa5b=_0xaa5a('0x2e');return db[_0xaa5a('0x2f')][_0xaa5a('0x2d')]({'where':{'type':_0x26fa5b,'resourceId':_0x4f6ff2['id']}})[_0xaa5a('0x2c')](function(){return _0x47ba58;});})[_0xaa5a('0x2c')](function(){_0x43fc39[_0xaa5a('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d0457,_0x426940){return function(_0x4dfa87){if(!_0x4dfa87){_0x4d0457[_0xaa5a('0x1f')](0x194);}return _0x4dfa87;};}function handleError(_0x84afe1,_0x8250a6){_0x8250a6=_0x8250a6||0x1f4;return function(_0x11c448){logger[_0xaa5a('0x30')](_0x11c448[_0xaa5a('0x31')]);if(_0x11c448[_0xaa5a('0x32')]){delete _0x11c448['name'];}_0x84afe1[_0xaa5a('0x20')](_0x8250a6)[_0xaa5a('0x33')](_0x11c448);};}exports[_0xaa5a('0x34')]=function(_0x5320f0,_0x5e8c3b){var _0x49ef00={},_0x115259={},_0x16b4c9={'count':0x0,'rows':[]};var _0x16f3b2=_[_0xaa5a('0x35')](db['OpenchannelQueue'][_0xaa5a('0x36')],function(_0x403620){return{'name':_0x403620[_0xaa5a('0x37')],'type':_0x403620['type'][_0xaa5a('0x38')]};});_0x115259[_0xaa5a('0x39')]=_[_0xaa5a('0x35')](_0x16f3b2,_0xaa5a('0x32'));_0x115259[_0xaa5a('0x3a')]=_[_0xaa5a('0x3b')](_0x5320f0[_0xaa5a('0x3a')]);_0x115259[_0xaa5a('0x3c')]=_['intersection'](_0x115259['model'],_0x115259[_0xaa5a('0x3a')]);_0x49ef00[_0xaa5a('0x3d')]=_[_0xaa5a('0x3e')](_0x115259[_0xaa5a('0x39')],qs[_0xaa5a('0x3f')](_0x5320f0['query'][_0xaa5a('0x3f')]));_0x49ef00[_0xaa5a('0x3d')]=_0x49ef00[_0xaa5a('0x3d')][_0xaa5a('0x40')]?_0x49ef00[_0xaa5a('0x3d')]:_0x115259[_0xaa5a('0x39')];if(!_0x5320f0['query'][_0xaa5a('0x41')](_0xaa5a('0x42'))){_0x49ef00[_0xaa5a('0x24')]=qs[_0xaa5a('0x24')](_0x5320f0['query'][_0xaa5a('0x24')]);_0x49ef00['offset']=qs[_0xaa5a('0x22')](_0x5320f0[_0xaa5a('0x3a')]['offset']);}_0x49ef00[_0xaa5a('0x43')]=qs['sort'](_0x5320f0[_0xaa5a('0x3a')][_0xaa5a('0x44')]);_0x49ef00[_0xaa5a('0x45')]=qs[_0xaa5a('0x3c')](_[_0xaa5a('0x46')](_0x5320f0[_0xaa5a('0x3a')],_0x115259[_0xaa5a('0x3c')]),_0x16f3b2);if(_0x5320f0[_0xaa5a('0x3a')][_0xaa5a('0x47')]){_0x49ef00['where']=_[_0xaa5a('0x48')](_0x49ef00[_0xaa5a('0x45')],{'$or':_['map'](_0x16f3b2,function(_0x43ea04){if(_0x43ea04[_0xaa5a('0x49')]!==_0xaa5a('0x4a')){var _0x569d62={};_0x569d62[_0x43ea04[_0xaa5a('0x32')]]={'$like':'%'+_0x5320f0[_0xaa5a('0x3a')][_0xaa5a('0x47')]+'%'};return _0x569d62;}})});}_0x49ef00=_[_0xaa5a('0x48')]({},_0x49ef00,_0x5320f0[_0xaa5a('0x4b')]);var _0xaded7={'where':_0x49ef00[_0xaa5a('0x45')]};return db['OpenchannelQueue'][_0xaa5a('0x25')](_0xaded7)[_0xaa5a('0x2c')](function(_0x2b607f){_0x16b4c9[_0xaa5a('0x25')]=_0x2b607f;if(_0x5320f0[_0xaa5a('0x3a')][_0xaa5a('0x4c')]){_0x49ef00[_0xaa5a('0x4d')]=[{'all':!![]}];}return db['OpenchannelQueue']['findAll'](_0x49ef00);})[_0xaa5a('0x2c')](function(_0x374650){_0x16b4c9[_0xaa5a('0x4e')]=_0x374650;return _0x16b4c9;})[_0xaa5a('0x2c')](respondWithFilteredResult(_0x5e8c3b,_0x49ef00))[_0xaa5a('0x4f')](handleError(_0x5e8c3b,null));};exports[_0xaa5a('0x50')]=function(_0x2685a4,_0x32d3c6){var _0x5c342b={'raw':!![],'where':{'id':_0x2685a4[_0xaa5a('0x51')]['id']}},_0x4c6717={};_0x4c6717[_0xaa5a('0x39')]=_[_0xaa5a('0x3b')](db[_0xaa5a('0x52')]['rawAttributes']);_0x4c6717[_0xaa5a('0x3a')]=_[_0xaa5a('0x3b')](_0x2685a4[_0xaa5a('0x3a')]);_0x4c6717['filters']=_[_0xaa5a('0x3e')](_0x4c6717[_0xaa5a('0x39')],_0x4c6717['query']);_0x5c342b['attributes']=_['intersection'](_0x4c6717['model'],qs['fields'](_0x2685a4[_0xaa5a('0x3a')][_0xaa5a('0x3f')]));_0x5c342b['attributes']=_0x5c342b[_0xaa5a('0x3d')][_0xaa5a('0x40')]?_0x5c342b[_0xaa5a('0x3d')]:_0x4c6717[_0xaa5a('0x39')];if(_0x2685a4[_0xaa5a('0x3a')][_0xaa5a('0x4c')]){_0x5c342b[_0xaa5a('0x4d')]=[{'all':!![]}];}_0x5c342b=_['merge']({},_0x5c342b,_0x2685a4['options']);return db[_0xaa5a('0x52')][_0xaa5a('0x53')](_0x5c342b)[_0xaa5a('0x2c')](handleEntityNotFound(_0x32d3c6,null))[_0xaa5a('0x2c')](respondWithResult(_0x32d3c6,null))['catch'](handleError(_0x32d3c6,null));};exports[_0xaa5a('0x54')]=function(_0x213c03,_0x1ae2f9){return db['OpenchannelQueue'][_0xaa5a('0x54')](_0x213c03['body'],{})[_0xaa5a('0x2c')](function(_0xb28542){var _0x127022=_0x213c03['user'][_0xaa5a('0x55')]({'plain':!![]});if(!_0x127022)throw new Error(_0xaa5a('0x56'));if(_0x127022[_0xaa5a('0x57')]===_0xaa5a('0x58')){var _0x22d965=_0xb28542[_0xaa5a('0x55')]({'plain':!![]});var _0x2d83da=_0xaa5a('0x2e');return db[_0xaa5a('0x59')][_0xaa5a('0x53')]({'where':{'name':_0x2d83da,'userProfileId':_0x127022[_0xaa5a('0x5a')]},'raw':!![]})[_0xaa5a('0x2c')](function(_0x71ddbe){if(_0x71ddbe&&_0x71ddbe[_0xaa5a('0x5b')]===0x0){return db['UserProfileResource']['create']({'name':_0x22d965[_0xaa5a('0x32')],'resourceId':_0x22d965['id'],'type':_0x71ddbe[_0xaa5a('0x32')],'sectionId':_0x71ddbe['id']},{})[_0xaa5a('0x2c')](function(){return _0xb28542;});}else{return _0xb28542;}})[_0xaa5a('0x4f')](function(_0xf08e95){logger[_0xaa5a('0x30')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf08e95);throw _0xf08e95;});}return _0xb28542;})['then'](respondWithResult(_0x1ae2f9,0xc9))[_0xaa5a('0x4f')](handleError(_0x1ae2f9,null));};exports[_0xaa5a('0x2b')]=function(_0x45299c,_0x59755d){if(_0x45299c[_0xaa5a('0x5c')]['id']){delete _0x45299c[_0xaa5a('0x5c')]['id'];}return db[_0xaa5a('0x52')][_0xaa5a('0x53')]({'where':{'id':_0x45299c[_0xaa5a('0x51')]['id']}})[_0xaa5a('0x2c')](handleEntityNotFound(_0x59755d,null))[_0xaa5a('0x2c')](saveUpdates(_0x45299c['body'],null))[_0xaa5a('0x2c')](respondWithResult(_0x59755d,null))[_0xaa5a('0x4f')](handleError(_0x59755d,null));};exports[_0xaa5a('0x2d')]=function(_0x13a5e0,_0x31e3b3){return db[_0xaa5a('0x52')]['find']({'where':{'id':_0x13a5e0['params']['id']}})[_0xaa5a('0x2c')](handleEntityNotFound(_0x31e3b3,null))[_0xaa5a('0x2c')](removeEntity(_0x31e3b3,null))[_0xaa5a('0x4f')](handleError(_0x31e3b3,null));};exports['describe']=function(_0x9970c8,_0x1cf1ab){return db[_0xaa5a('0x52')][_0xaa5a('0x5d')]()['then'](respondWithResult(_0x1cf1ab,null))[_0xaa5a('0x4f')](handleError(_0x1cf1ab,null));};exports['getMembers']=function(_0x31e2f5,_0x2ecaab,_0x127f42){var _0x1cf402={'raw':!![],'where':{}},_0x3880bf={},_0x1f3519;return db[_0xaa5a('0x52')][_0xaa5a('0x5e')]({'where':{'id':_0x31e2f5[_0xaa5a('0x51')]['id']}})['then'](handleEntityNotFound(_0x2ecaab,null))[_0xaa5a('0x2c')](function(_0x11ec7e){if(_0x11ec7e){_0x1f3519=_0x11ec7e[_0xaa5a('0x55')]({'plain':!![]});_0x3880bf[_0xaa5a('0x39')]=_[_0xaa5a('0x3b')](db[_0xaa5a('0x5f')][_0xaa5a('0x36')]);_0x3880bf[_0xaa5a('0x3a')]=_['keys'](_0x31e2f5[_0xaa5a('0x3a')]);_0x3880bf['filters']=_['intersection'](_0x3880bf[_0xaa5a('0x39')],_0x3880bf['query']);_0x1cf402['attributes']=_[_0xaa5a('0x3e')](_0x3880bf[_0xaa5a('0x39')],qs[_0xaa5a('0x3f')](_0x31e2f5['query'][_0xaa5a('0x3f')]));_0x1cf402[_0xaa5a('0x3d')]=_0x1cf402[_0xaa5a('0x3d')][_0xaa5a('0x40')]?_0x1cf402[_0xaa5a('0x3d')]:_0x3880bf[_0xaa5a('0x39')];if(!_0x31e2f5['query'][_0xaa5a('0x41')]('nolimit')){_0x1cf402[_0xaa5a('0x24')]=qs[_0xaa5a('0x24')](_0x31e2f5['query']['limit']);_0x1cf402[_0xaa5a('0x22')]=qs['offset'](_0x31e2f5[_0xaa5a('0x3a')][_0xaa5a('0x22')]);}_0x1cf402[_0xaa5a('0x43')]=qs[_0xaa5a('0x44')](_0x31e2f5[_0xaa5a('0x3a')][_0xaa5a('0x44')]);_0x1cf402[_0xaa5a('0x45')]=qs[_0xaa5a('0x3c')](_[_0xaa5a('0x46')](_0x31e2f5[_0xaa5a('0x3a')],_0x3880bf[_0xaa5a('0x3c')]));_0x1cf402['where'][_0xaa5a('0x60')]=_0x11ec7e['id'];if(_0x31e2f5[_0xaa5a('0x3a')][_0xaa5a('0x47')]){_0x1cf402[_0xaa5a('0x45')]=_[_0xaa5a('0x48')](_0x1cf402['where'],{'$or':_[_0xaa5a('0x35')](_0x1cf402[_0xaa5a('0x3d')],function(_0x56160e){var _0x8fb1e2={};_0x8fb1e2[_0x56160e]={'$like':'%'+_0x31e2f5['query'][_0xaa5a('0x47')]+'%'};return _0x8fb1e2;})});}_0x1cf402=_[_0xaa5a('0x48')]({},_0x1cf402,_0x31e2f5[_0xaa5a('0x4b')]);return db[_0xaa5a('0x5f')][_0xaa5a('0x61')](_0x1cf402);}})[_0xaa5a('0x2c')](function(_0x1b9462){if(_0x1b9462){return db[_0xaa5a('0x62')][_0xaa5a('0x63')]({'where':{'id':_[_0xaa5a('0x35')](_0x1b9462,'UserId'),'role':'agent'},'attributes':['id',_0xaa5a('0x32'),_0xaa5a('0x64'),_0xaa5a('0x65'),_0xaa5a('0x66')]});}})[_0xaa5a('0x2c')](function(_0x4e291e){if(_0x4e291e){return{'count':_0x4e291e['count'],'rows':_[_0xaa5a('0x35')](_0x4e291e['rows'],function(_0x5c01d0){return{'membername':_0x5c01d0[_0xaa5a('0x32')],'UserId':_0x5c01d0['id'],'queue_name':_0x1f3519[_0xaa5a('0x32')],'OpenchannelQueueId':_0x1f3519['id'],'interface':util['format']('%s/%s','SIP',_0x5c01d0['name']),'penalty':0x0,'paused':_0x5c01d0[_0xaa5a('0x64')],'createdAt':_0x5c01d0[_0xaa5a('0x66')],'updatedAt':_0x5c01d0[_0xaa5a('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xaa5a('0x2c')](respondWithFilteredResult(_0x2ecaab,_0x1cf402))[_0xaa5a('0x4f')](handleError(_0x2ecaab,null));};exports[_0xaa5a('0x67')]=function(_0x5e713e,_0x187d71,_0x580836){var _0x398b81={};var _0x4cb0af={};var _0x2a7912;var _0x31ae00;return db[_0xaa5a('0x52')]['findOne']({'where':{'id':_0x5e713e[_0xaa5a('0x51')]['id']}})[_0xaa5a('0x2c')](handleEntityNotFound(_0x187d71,null))[_0xaa5a('0x2c')](function(_0x51d2f3){if(_0x51d2f3){_0x2a7912=_0x51d2f3;_0x4cb0af[_0xaa5a('0x39')]=_[_0xaa5a('0x3b')](db['Team'][_0xaa5a('0x36')]);_0x4cb0af[_0xaa5a('0x3a')]=_[_0xaa5a('0x3b')](_0x5e713e['query']);_0x4cb0af['filters']=_[_0xaa5a('0x3e')](_0x4cb0af[_0xaa5a('0x39')],_0x4cb0af[_0xaa5a('0x3a')]);_0x398b81[_0xaa5a('0x3d')]=_[_0xaa5a('0x3e')](_0x4cb0af[_0xaa5a('0x39')],qs[_0xaa5a('0x3f')](_0x5e713e['query']['fields']));_0x398b81[_0xaa5a('0x3d')]=_0x398b81[_0xaa5a('0x3d')][_0xaa5a('0x40')]?_0x398b81['attributes']:_0x4cb0af['model'];_0x398b81[_0xaa5a('0x43')]=qs[_0xaa5a('0x44')](_0x5e713e[_0xaa5a('0x3a')][_0xaa5a('0x44')]);_0x398b81[_0xaa5a('0x45')]=qs[_0xaa5a('0x3c')](_[_0xaa5a('0x46')](_0x5e713e[_0xaa5a('0x3a')],_0x4cb0af[_0xaa5a('0x3c')]));if(_0x5e713e[_0xaa5a('0x3a')][_0xaa5a('0x47')]){_0x398b81[_0xaa5a('0x45')]=_[_0xaa5a('0x48')](_0x398b81[_0xaa5a('0x45')],{'$or':_['map'](_0x398b81[_0xaa5a('0x3d')],function(_0x54b81c){var _0x1a11b5={};_0x1a11b5[_0x54b81c]={'$like':'%'+_0x5e713e[_0xaa5a('0x3a')][_0xaa5a('0x47')]+'%'};return _0x1a11b5;})});}_0x398b81=_['merge']({},_0x398b81,_0x5e713e[_0xaa5a('0x4b')]);return _0x2a7912[_0xaa5a('0x67')](_0x398b81);}})[_0xaa5a('0x2c')](function(_0x4927d3){if(_0x4927d3){_0x31ae00=_0x4927d3[_0xaa5a('0x40')];if(!_0x5e713e[_0xaa5a('0x3a')][_0xaa5a('0x41')](_0xaa5a('0x42'))){_0x398b81[_0xaa5a('0x24')]=qs[_0xaa5a('0x24')](_0x5e713e[_0xaa5a('0x3a')][_0xaa5a('0x24')]);_0x398b81[_0xaa5a('0x22')]=qs['offset'](_0x5e713e[_0xaa5a('0x3a')]['offset']);}return _0x2a7912[_0xaa5a('0x67')](_0x398b81);}})[_0xaa5a('0x2c')](function(_0x49153f){if(_0x49153f){return _0x49153f?{'count':_0x31ae00,'rows':_0x49153f}:null;}})[_0xaa5a('0x2c')](respondWithResult(_0x187d71,null))[_0xaa5a('0x4f')](handleError(_0x187d71,null));};exports[_0xaa5a('0x68')]=function(_0x2239d3,_0x374eda,_0x2bcad4){var _0x4592f7=_0x2239d3['body'][_0xaa5a('0x69')];return db[_0xaa5a('0x6a')][_0xaa5a('0x61')]({'where':{'id':_0x4592f7},'attributes':['id'],'include':[{'model':db[_0xaa5a('0x62')],'as':_0xaa5a('0x6b'),'attributes':['id',_0xaa5a('0x32'),'online',_0xaa5a('0x6c'),'interface'],'raw':!![]}]})[_0xaa5a('0x2c')](function(_0x57a941){if(_0x57a941){var _0x47d90c=_[_0xaa5a('0x6d')](_0x57a941,function(_0x33c5d4){var _0x311548=_0x33c5d4[_0xaa5a('0x55')]({'plain':!![]});return _0x311548[_0xaa5a('0x6b')];});return db[_0xaa5a('0x52')][_0xaa5a('0x53')]({'where':{'id':_0x2239d3[_0xaa5a('0x51')]['id']}})['then'](function(_0x591d66){return db['sequelize'][_0xaa5a('0x6e')](function(_0x3187d2){return _0x591d66[_0xaa5a('0x68')](_0x4592f7,{'transaction':_0x3187d2})['then'](function(){return BPromise['each'](_0x47d90c,function(_0x60f6e6){return db['UserOpenchannelQueue'][_0xaa5a('0x6f')]({'where':{'UserId':_0x60f6e6['id'],'OpenchannelQueueId':_0x2239d3['params']['id']},'transaction':_0x3187d2});});})[_0xaa5a('0x2c')](function(){_0x47d90c[_0xaa5a('0x70')](function(_0x18693b){socket['emit'](_0xaa5a('0x71'),{'UserId':_0x18693b['id'],'OpenchannelQueueId':_0x591d66['id']});});});});});}})[_0xaa5a('0x2c')](respondWithStatusCode(_0x374eda,null))['catch'](handleError(_0x374eda,null));};exports[_0xaa5a('0x72')]=function(_0x56db3e,_0x120479,_0x3187c3){return db['Team'][_0xaa5a('0x61')]({'where':{'id':_0x56db3e[_0xaa5a('0x3a')][_0xaa5a('0x69')]},'attributes':['id'],'include':[{'model':db[_0xaa5a('0x62')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xaa5a('0x2c')](handleEntityNotFound(_0x120479,null))['then'](function(_0xd694fb){var _0x234b8b=_['map'](_0xd694fb,'id');var _0x308ba3=[];var _0x188dd1=[];var _0x19c7ac=squel[_0xaa5a('0x73')]();_0x19c7ac[_0xaa5a('0x74')](_0xaa5a('0x75'))[_0xaa5a('0x76')](_0xaa5a('0x77'),'tq')['join'](_0xaa5a('0x78'),'ut',_0xaa5a('0x79'))[_0xaa5a('0x45')](_0xaa5a('0x7a'),_0x56db3e[_0xaa5a('0x51')]['id']);for(var _0xb0ae41=0x0;_0xb0ae41<_0xd694fb['length'];_0xb0ae41+=0x1){let _0x30de0a=_0xd694fb[_0xb0ae41];for(var _0x2b8999=0x0;_0x2b8999<_0x30de0a[_0xaa5a('0x6b')][_0xaa5a('0x40')];_0x2b8999+=0x1){let _0x15db0d=_0x30de0a[_0xaa5a('0x6b')][_0x2b8999];var _0x230f75=_0x19c7ac[_0xaa5a('0x7b')]();_0x230f75[_0xaa5a('0x45')]('ut.UserId\x20=\x20?',_0x15db0d['id']);_0x188dd1[_0xaa5a('0x7c')](db[_0xaa5a('0x7d')]['query'](_0x230f75[_0xaa5a('0x7e')](),{'type':db['sequelize']['QueryTypes'][_0xaa5a('0x7f')]})[_0xaa5a('0x2c')](function(_0x345d91){if(_0x345d91[_0xaa5a('0x40')]===0x1){return _0x15db0d['id'];}else{var _0x1a2374=_[_0xaa5a('0x80')](_[_0xaa5a('0x35')](_0x345d91,_0xaa5a('0x81')),function(_0xf031b2){return _['includes'](_0x234b8b,_0xf031b2);});if(_0x1a2374){return _0x15db0d['id'];}}}));}}return BPromise[_0xaa5a('0x82')](_0x188dd1)[_0xaa5a('0x2c')](function(_0x5ee603){_0x308ba3=_(_0x308ba3)[_0xaa5a('0x83')](_0x5ee603)[_0xaa5a('0x84')]()[_0xaa5a('0x85')]();return db[_0xaa5a('0x52')][_0xaa5a('0x53')]({'where':{'id':_0x56db3e[_0xaa5a('0x51')]['id']}})['then'](function(_0x25ba6f){return db['sequelize'][_0xaa5a('0x6e')](function(_0x2b6209){return _0x25ba6f[_0xaa5a('0x72')](_0x56db3e[_0xaa5a('0x3a')][_0xaa5a('0x69')],{'transaction':_0x2b6209})['then'](function(){if(!_['isEmpty'](_0x308ba3)){return _0x25ba6f[_0xaa5a('0x86')](_0x308ba3,{'transaction':_0x2b6209});}})[_0xaa5a('0x2c')](function(){_0x308ba3[_0xaa5a('0x70')](function(_0x5d8d99){socket[_0xaa5a('0x87')](_0xaa5a('0x88'),{'UserId':_0x5d8d99,'OpenchannelQueueId':_0x25ba6f['id']});});});});});});})['then'](respondWithStatusCode(_0x120479,null))[_0xaa5a('0x4f')](handleError(_0x120479,null));};exports['addAgents']=function(_0x1eefea,_0x388915,_0x32ec16){return db[_0xaa5a('0x52')]['find']({'where':{'id':_0x1eefea['params']['id']}})[_0xaa5a('0x2c')](handleEntityNotFound(_0x388915,null))[_0xaa5a('0x2c')](function(_0x473b25){if(_0x473b25){return _0x473b25['addAgents'](_0x1eefea[_0xaa5a('0x5c')]['ids'],_['omit'](_0x1eefea[_0xaa5a('0x5c')],[_0xaa5a('0x69'),'id'])||{})[_0xaa5a('0x89')](function(_0x1865e8){for(var _0x1d60b2=0x0;_0x1d60b2<_0x1eefea['body'][_0xaa5a('0x69')][_0xaa5a('0x40')];_0x1d60b2+=0x1){socket[_0xaa5a('0x87')](_0xaa5a('0x71'),{'UserId':Number(_0x1eefea[_0xaa5a('0x5c')]['ids'][_0x1d60b2]),'OpenchannelQueueId':Number(_0x1eefea[_0xaa5a('0x51')]['id'])});}return _0x1865e8;});}})[_0xaa5a('0x2c')](respondWithResult(_0x388915,null))[_0xaa5a('0x4f')](handleError(_0x388915,null));};exports[_0xaa5a('0x86')]=function(_0x3f8e42,_0x1bb044,_0x20db15){return db[_0xaa5a('0x52')][_0xaa5a('0x53')]({'where':{'id':_0x3f8e42[_0xaa5a('0x51')]['id']}})[_0xaa5a('0x2c')](handleEntityNotFound(_0x1bb044,null))['then'](function(_0x5696b5){if(_0x5696b5){return _0x5696b5[_0xaa5a('0x86')](_0x3f8e42[_0xaa5a('0x3a')][_0xaa5a('0x69')])['then'](function(){if(_[_0xaa5a('0x8a')](_0x3f8e42[_0xaa5a('0x3a')][_0xaa5a('0x69')])){for(var _0x1a0d0e=0x0;_0x1a0d0e<_0x3f8e42[_0xaa5a('0x3a')][_0xaa5a('0x69')]['length'];_0x1a0d0e+=0x1){socket[_0xaa5a('0x87')](_0xaa5a('0x88'),{'UserId':Number(_0x3f8e42['query'][_0xaa5a('0x69')][_0x1a0d0e]),'OpenchannelQueueId':Number(_0x3f8e42[_0xaa5a('0x51')]['id'])});}}else{socket[_0xaa5a('0x87')](_0xaa5a('0x88'),{'UserId':Number(_0x3f8e42[_0xaa5a('0x3a')][_0xaa5a('0x69')]),'OpenchannelQueueId':Number(_0x3f8e42['params']['id'])});}});}})[_0xaa5a('0x2c')](respondWithStatusCode(_0x1bb044,null))[_0xaa5a('0x4f')](handleError(_0x1bb044,null));};exports[_0xaa5a('0x8b')]=function(_0x3d408c,_0x11bf5e,_0x2e12a4){var _0x3b6081={};var _0x494b42={};var _0x3ba75a;var _0x1002d0;return db[_0xaa5a('0x52')][_0xaa5a('0x5e')]({'where':{'id':_0x3d408c[_0xaa5a('0x51')]['id']}})[_0xaa5a('0x2c')](handleEntityNotFound(_0x11bf5e,null))[_0xaa5a('0x2c')](function(_0x1453c0){if(_0x1453c0){_0x3ba75a=_0x1453c0;_0x494b42[_0xaa5a('0x39')]=_['keys'](db[_0xaa5a('0x62')][_0xaa5a('0x36')]);_0x494b42['query']=_[_0xaa5a('0x3b')](_0x3d408c[_0xaa5a('0x3a')]);_0x494b42[_0xaa5a('0x3c')]=_[_0xaa5a('0x3e')](_0x494b42['model'],_0x494b42[_0xaa5a('0x3a')]);_0x3b6081[_0xaa5a('0x3d')]=_[_0xaa5a('0x3e')](_0x494b42['model'],qs[_0xaa5a('0x3f')](_0x3d408c[_0xaa5a('0x3a')][_0xaa5a('0x3f')]));_0x3b6081[_0xaa5a('0x3d')]=_0x3b6081[_0xaa5a('0x3d')][_0xaa5a('0x40')]?_0x3b6081[_0xaa5a('0x3d')]:_0x494b42['model'];_0x3b6081[_0xaa5a('0x43')]=qs[_0xaa5a('0x44')](_0x3d408c['query'][_0xaa5a('0x44')]);_0x3b6081['where']=qs[_0xaa5a('0x3c')](_[_0xaa5a('0x46')](_0x3d408c[_0xaa5a('0x3a')],_0x494b42[_0xaa5a('0x3c')]));if(_0x3d408c[_0xaa5a('0x3a')][_0xaa5a('0x47')]){_0x3b6081[_0xaa5a('0x45')]=_['merge'](_0x3b6081[_0xaa5a('0x45')],{'$or':_[_0xaa5a('0x35')](_0x3b6081[_0xaa5a('0x3d')],function(_0x303a4d){var _0x24d093={};_0x24d093[_0x303a4d]={'$like':'%'+_0x3d408c[_0xaa5a('0x3a')][_0xaa5a('0x47')]+'%'};return _0x24d093;})});}_0x3b6081=_[_0xaa5a('0x48')]({},_0x3b6081,_0x3d408c[_0xaa5a('0x4b')]);return _0x3ba75a['getAgents'](_0x3b6081);}})['then'](function(_0x2e6b32){if(_0x2e6b32){_0x1002d0=_0x2e6b32[_0xaa5a('0x40')];if(!_0x3d408c['query'][_0xaa5a('0x41')]('nolimit')){_0x3b6081['limit']=qs[_0xaa5a('0x24')](_0x3d408c[_0xaa5a('0x3a')][_0xaa5a('0x24')]);_0x3b6081[_0xaa5a('0x22')]=qs[_0xaa5a('0x22')](_0x3d408c[_0xaa5a('0x3a')][_0xaa5a('0x22')]);}return _0x3ba75a[_0xaa5a('0x8b')](_0x3b6081);}})[_0xaa5a('0x2c')](function(_0x1c6e6a){if(_0x1c6e6a){return _0x1c6e6a?{'count':_0x1002d0,'rows':_0x1c6e6a}:null;}})[_0xaa5a('0x2c')](respondWithResult(_0x11bf5e,null))[_0xaa5a('0x4f')](handleError(_0x11bf5e,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 8228f86..1bf1282 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 _0x9321=['exports','events','../../mysqldb','OpenchannelQueue','save','update','remove','emit','hasOwnProperty'];(function(_0x1c6b2c,_0x33636d){var _0x49b175=function(_0x434b23){while(--_0x434b23){_0x1c6b2c['push'](_0x1c6b2c['shift']());}};_0x49b175(++_0x33636d);}(_0x9321,0x17b));var _0x1932=function(_0x590651,_0x29dcf5){_0x590651=_0x590651-0x0;var _0xa4cee=_0x9321[_0x590651];return _0xa4cee;};'use strict';var EventEmitter=require(_0x1932('0x0'));var OpenchannelQueue=require(_0x1932('0x1'))['db'][_0x1932('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1932('0x3'),'afterUpdate':_0x1932('0x4'),'afterDestroy':_0x1932('0x5')};function emitEvent(_0x3cc138){return function(_0x4a3da8,_0xb299ea,_0x19d095){OpenchannelQueueEvents[_0x1932('0x6')](_0x3cc138+':'+_0x4a3da8['id'],_0x4a3da8);OpenchannelQueueEvents[_0x1932('0x6')](_0x3cc138,_0x4a3da8);_0x19d095(null);};}for(var e in events){if(events[_0x1932('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x1932('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xccbd=['OpenchannelQueue','setMaxListeners','remove','emit','hook','exports','events'];(function(_0x5678ec,_0x4ea246){var _0x188d2f=function(_0x2585ac){while(--_0x2585ac){_0x5678ec['push'](_0x5678ec['shift']());}};_0x188d2f(++_0x4ea246);}(_0xccbd,0x1aa));var _0xdccb=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xccbd[_0x465a0c];return _0x1e202e;};'use strict';var EventEmitter=require(_0xdccb('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xdccb('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xdccb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xdccb('0x3')};function emitEvent(_0x586ab9){return function(_0x2f15c1,_0x512522,_0x2c683a){OpenchannelQueueEvents[_0xdccb('0x4')](_0x586ab9+':'+_0x2f15c1['id'],_0x2f15c1);OpenchannelQueueEvents[_0xdccb('0x4')](_0x586ab9,_0x2f15c1);_0x2c683a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0xdccb('0x5')](e,emitEvent(event));}}module[_0xdccb('0x6')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index d3adcf3..940c69a 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 _0x488c=['openchannel_queues','util','../../config/logger','moment','bluebird','request-promise','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x488c,0x17b));var _0xc488=function(_0x2cc437,_0x1b4c3f){_0x2cc437=_0x2cc437-0x0;var _0x2e163a=_0x488c[_0x2cc437];return _0x2e163a;};'use strict';var _=require('lodash');var util=require(_0xc488('0x0'));var logger=require(_0xc488('0x1'))('api');var moment=require(_0xc488('0x2'));var BPromise=require(_0xc488('0x3'));var rp=require(_0xc488('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./openchannelQueue.attributes');module[_0xc488('0x5')]=function(_0xd216fa,_0x3db0fe){return _0xd216fa['define']('OpenchannelQueue',attributes,{'tableName':_0xc488('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c4b=['request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','openchannel_queues','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2423d7,_0xe6ec57){var _0x151d17=function(_0x559e15){while(--_0x559e15){_0x2423d7['push'](_0x2423d7['shift']());}};_0x151d17(++_0xe6ec57);}(_0x5c4b,0x1b5));var _0xb5c4=function(_0x59672c,_0x2bf7b2){_0x59672c=_0x59672c-0x0;var _0x1a4998=_0x5c4b[_0x59672c];return _0x1a4998;};'use strict';var _=require(_0xb5c4('0x0'));var util=require(_0xb5c4('0x1'));var logger=require(_0xb5c4('0x2'))('api');var moment=require(_0xb5c4('0x3'));var BPromise=require(_0xb5c4('0x4'));var rp=require(_0xb5c4('0x5'));var fs=require('fs');var path=require(_0xb5c4('0x6'));var rimraf=require(_0xb5c4('0x7'));var config=require(_0xb5c4('0x8'));var attributes=require(_0xb5c4('0x9'));module[_0xb5c4('0xa')]=function(_0x770060,_0xd6f8a9){return _0x770060[_0xb5c4('0xb')]('OpenchannelQueue',attributes,{'tableName':_0xb5c4('0xc'),'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 b89e73e..1484db3 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 _0xbd6e=['rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','then','info','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','attributes','limit','include','map','model','ShowOpenchannelQueue','find','raw','where','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x29a535,_0x227a89){var _0x1b3d33=function(_0x56e502){while(--_0x56e502){_0x29a535['push'](_0x29a535['shift']());}};_0x1b3d33(++_0x227a89);}(_0xbd6e,0x71));var _0xebd6=function(_0x4228d0,_0x1ab712){_0x4228d0=_0x4228d0-0x0;var _0x38435c=_0xbd6e[_0x4228d0];return _0x38435c;};'use strict';var _=require('lodash');var util=require(_0xebd6('0x0'));var moment=require(_0xebd6('0x1'));var BPromise=require(_0xebd6('0x2'));var rs=require(_0xebd6('0x3'));var fs=require('fs');var Redis=require(_0xebd6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xebd6('0x5'));var logger=require(_0xebd6('0x6'))(_0xebd6('0x7'));var config=require('../../config/environment');var jayson=require(_0xebd6('0x8'));var client=jayson[_0xebd6('0x9')][_0xebd6('0xa')]({'port':0x232a});config['redis']=_[_0xebd6('0xb')](config[_0xebd6('0xc')],{'host':_0xebd6('0xd'),'port':0x18eb});var socket=require(_0xebd6('0xe'))(new Redis(config[_0xebd6('0xc')]));require('./openchannelQueue.socket')[_0xebd6('0xf')](socket);function respondWithRpcPromise(_0x12abc4,_0x5a6ffd,_0x2f241b){return new BPromise(function(_0x4f554b,_0x61e494){return client['request'](_0x12abc4,_0x2f241b)[_0xebd6('0x10')](function(_0x36c631){logger[_0xebd6('0x11')](_0xebd6('0x12'),_0x5a6ffd,'request\x20sent');logger[_0xebd6('0x13')](_0xebd6('0x14'),_0x5a6ffd,'request\x20sent',JSON[_0xebd6('0x15')](_0x36c631));if(_0x36c631[_0xebd6('0x16')]){if(_0x36c631['error'][_0xebd6('0x17')]===0x1f4){logger[_0xebd6('0x16')](_0xebd6('0x12'),_0x5a6ffd,_0x36c631[_0xebd6('0x16')]['message']);return _0x61e494(_0x36c631['error'][_0xebd6('0x18')]);}logger[_0xebd6('0x16')](_0xebd6('0x12'),_0x5a6ffd,_0x36c631[_0xebd6('0x16')][_0xebd6('0x18')]);return _0x4f554b(_0x36c631[_0xebd6('0x16')][_0xebd6('0x18')]);}else{logger[_0xebd6('0x11')](_0xebd6('0x12'),_0x5a6ffd,'request\x20sent');_0x4f554b(_0x36c631[_0xebd6('0x19')][_0xebd6('0x18')]);}})[_0xebd6('0x1a')](function(_0xd29d8c){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x5a6ffd,_0xd29d8c);_0x61e494(_0xd29d8c);});});}exports[_0xebd6('0x1b')]=function(_0x1b5de2){var _0x348824=this;return new Promise(function(_0x1f12da,_0x5a11b7){return db[_0xebd6('0x1c')][_0xebd6('0x1d')]({'raw':_0x1b5de2['options']?_0x1b5de2['options']['raw']===undefined?!![]:![]:!![],'where':_0x1b5de2[_0xebd6('0x1e')]?_0x1b5de2[_0xebd6('0x1e')]['where']||null:null,'attributes':_0x1b5de2[_0xebd6('0x1e')]?_0x1b5de2[_0xebd6('0x1e')][_0xebd6('0x1f')]||null:null,'limit':_0x1b5de2[_0xebd6('0x1e')]?_0x1b5de2['options'][_0xebd6('0x20')]||null:null,'include':_0x1b5de2[_0xebd6('0x1e')]?_0x1b5de2[_0xebd6('0x1e')][_0xebd6('0x21')]?_[_0xebd6('0x22')](_0x1b5de2[_0xebd6('0x1e')][_0xebd6('0x21')],function(_0x13c6b2){return{'model':db[_0x13c6b2['model']],'as':_0x13c6b2['as'],'attributes':_0x13c6b2[_0xebd6('0x1f')],'include':_0x13c6b2[_0xebd6('0x21')]?_[_0xebd6('0x22')](_0x13c6b2[_0xebd6('0x21')],function(_0x295bba){return{'model':db[_0x295bba[_0xebd6('0x23')]],'as':_0x295bba['as'],'attributes':_0x295bba[_0xebd6('0x1f')],'include':_0x295bba[_0xebd6('0x21')]?_[_0xebd6('0x22')](_0x295bba[_0xebd6('0x21')],function(_0x32f459){return{'model':db[_0x32f459[_0xebd6('0x23')]],'as':_0x32f459['as'],'attributes':_0x32f459[_0xebd6('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x325aab){logger[_0xebd6('0x11')](_0xebd6('0x1b'),_0x1b5de2);logger[_0xebd6('0x13')](_0xebd6('0x1b'),_0x1b5de2,JSON[_0xebd6('0x15')](_0x325aab));_0x1f12da(_0x325aab);})[_0xebd6('0x1a')](function(_0x49917d){logger[_0xebd6('0x16')](_0xebd6('0x1b'),_0x49917d[_0xebd6('0x18')],_0x1b5de2);_0x5a11b7(_0x348824[_0xebd6('0x16')](0x1f4,_0x49917d['message']));});});};exports[_0xebd6('0x24')]=function(_0x1ca99f){var _0x447499=this;return new Promise(function(_0x236042,_0x57b61e){return db[_0xebd6('0x1c')][_0xebd6('0x25')]({'raw':_0x1ca99f[_0xebd6('0x1e')]?_0x1ca99f['options'][_0xebd6('0x26')]===undefined?!![]:![]:!![],'where':_0x1ca99f[_0xebd6('0x1e')]?_0x1ca99f['options'][_0xebd6('0x27')]||null:null,'attributes':_0x1ca99f[_0xebd6('0x1e')]?_0x1ca99f[_0xebd6('0x1e')][_0xebd6('0x1f')]||null:null,'include':_0x1ca99f[_0xebd6('0x1e')]?_0x1ca99f[_0xebd6('0x1e')][_0xebd6('0x21')]?_['map'](_0x1ca99f['options']['include'],function(_0x48f77f){return{'model':db[_0x48f77f[_0xebd6('0x23')]],'as':_0x48f77f['as'],'attributes':_0x48f77f[_0xebd6('0x1f')],'include':_0x48f77f[_0xebd6('0x21')]?_['map'](_0x48f77f[_0xebd6('0x21')],function(_0x2c75c0){return{'model':db[_0x2c75c0[_0xebd6('0x23')]],'as':_0x2c75c0['as'],'attributes':_0x2c75c0[_0xebd6('0x1f')],'include':_0x2c75c0['include']?_[_0xebd6('0x22')](_0x2c75c0[_0xebd6('0x21')],function(_0x287ae7){return{'model':db[_0x287ae7[_0xebd6('0x23')]],'as':_0x287ae7['as'],'attributes':_0x287ae7[_0xebd6('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1bc45e){logger[_0xebd6('0x11')]('ShowOpenchannelQueue',_0x1ca99f);logger[_0xebd6('0x13')]('ShowOpenchannelQueue',_0x1ca99f,JSON[_0xebd6('0x15')](_0x1bc45e));_0x236042(_0x1bc45e);})['catch'](function(_0x137864){logger[_0xebd6('0x16')](_0xebd6('0x24'),_0x137864[_0xebd6('0x18')],_0x1ca99f);_0x57b61e(_0x447499['error'](0x1f4,_0x137864[_0xebd6('0x18')]));});});}; \ No newline at end of file +var _0x7bf4=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','OpenchannelQueue','options','where','attributes','limit','include','map','model','GetOpenchannelQueue','stringify','ShowOpenchannelQueue','find','raw','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xa1c1e7,_0x32d897){var _0x1e7dbd=function(_0x456c0c){while(--_0x456c0c){_0xa1c1e7['push'](_0xa1c1e7['shift']());}};_0x1e7dbd(++_0x32d897);}(_0x7bf4,0x9b));var _0x47bf=function(_0x3d33e3,_0x3d3ad9){_0x3d33e3=_0x3d33e3-0x0;var _0x4566e0=_0x7bf4[_0x3d33e3];return _0x4566e0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x47bf('0x0'));var BPromise=require(_0x47bf('0x1'));var rs=require(_0x47bf('0x2'));var fs=require('fs');var Redis=require(_0x47bf('0x3'));var db=require(_0x47bf('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x47bf('0x5'))(_0x47bf('0x6'));var config=require(_0x47bf('0x7'));var jayson=require(_0x47bf('0x8'));var client=jayson[_0x47bf('0x9')]['http']({'port':0x232a});config[_0x47bf('0xa')]=_['defaults'](config['redis'],{'host':_0x47bf('0xb'),'port':0x18eb});var socket=require(_0x47bf('0xc'))(new Redis(config[_0x47bf('0xa')]));require(_0x47bf('0xd'))[_0x47bf('0xe')](socket);function respondWithRpcPromise(_0x5d0083,_0x4a6f13,_0x4b5438){return new BPromise(function(_0x1ef1ab,_0x24090c){return client[_0x47bf('0xf')](_0x5d0083,_0x4b5438)[_0x47bf('0x10')](function(_0x4888d6){logger[_0x47bf('0x11')](_0x47bf('0x12'),_0x4a6f13,_0x47bf('0x13'));logger[_0x47bf('0x14')](_0x47bf('0x15'),_0x4a6f13,_0x47bf('0x13'),JSON['stringify'](_0x4888d6));if(_0x4888d6[_0x47bf('0x16')]){if(_0x4888d6['error'][_0x47bf('0x17')]===0x1f4){logger[_0x47bf('0x16')](_0x47bf('0x12'),_0x4a6f13,_0x4888d6[_0x47bf('0x16')]['message']);return _0x24090c(_0x4888d6[_0x47bf('0x16')]['message']);}logger['error'](_0x47bf('0x12'),_0x4a6f13,_0x4888d6[_0x47bf('0x16')][_0x47bf('0x18')]);return _0x1ef1ab(_0x4888d6[_0x47bf('0x16')][_0x47bf('0x18')]);}else{logger[_0x47bf('0x11')](_0x47bf('0x12'),_0x4a6f13,_0x47bf('0x13'));_0x1ef1ab(_0x4888d6[_0x47bf('0x19')]['message']);}})[_0x47bf('0x1a')](function(_0x4b1388){logger[_0x47bf('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x4a6f13,_0x4b1388);_0x24090c(_0x4b1388);});});}exports['GetOpenchannelQueue']=function(_0x19e22e){var _0x41624f=this;return new Promise(function(_0x1edf11,_0x58d5dd){return db[_0x47bf('0x1b')]['findAll']({'raw':_0x19e22e[_0x47bf('0x1c')]?_0x19e22e[_0x47bf('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x19e22e['options']?_0x19e22e[_0x47bf('0x1c')][_0x47bf('0x1d')]||null:null,'attributes':_0x19e22e[_0x47bf('0x1c')]?_0x19e22e[_0x47bf('0x1c')][_0x47bf('0x1e')]||null:null,'limit':_0x19e22e[_0x47bf('0x1c')]?_0x19e22e[_0x47bf('0x1c')][_0x47bf('0x1f')]||null:null,'include':_0x19e22e['options']?_0x19e22e[_0x47bf('0x1c')][_0x47bf('0x20')]?_[_0x47bf('0x21')](_0x19e22e['options'][_0x47bf('0x20')],function(_0x4a1595){return{'model':db[_0x4a1595[_0x47bf('0x22')]],'as':_0x4a1595['as'],'attributes':_0x4a1595[_0x47bf('0x1e')],'include':_0x4a1595['include']?_['map'](_0x4a1595[_0x47bf('0x20')],function(_0x371d61){return{'model':db[_0x371d61[_0x47bf('0x22')]],'as':_0x371d61['as'],'attributes':_0x371d61[_0x47bf('0x1e')],'include':_0x371d61['include']?_[_0x47bf('0x21')](_0x371d61['include'],function(_0x5556dd){return{'model':db[_0x5556dd[_0x47bf('0x22')]],'as':_0x5556dd['as'],'attributes':_0x5556dd[_0x47bf('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5d3da0){logger[_0x47bf('0x11')](_0x47bf('0x23'),_0x19e22e);logger[_0x47bf('0x14')](_0x47bf('0x23'),_0x19e22e,JSON[_0x47bf('0x24')](_0x5d3da0));_0x1edf11(_0x5d3da0);})[_0x47bf('0x1a')](function(_0x3c92ca){logger[_0x47bf('0x16')]('GetOpenchannelQueue',_0x3c92ca[_0x47bf('0x18')],_0x19e22e);_0x58d5dd(_0x41624f[_0x47bf('0x16')](0x1f4,_0x3c92ca[_0x47bf('0x18')]));});});};exports[_0x47bf('0x25')]=function(_0x44b580){var _0x4f871f=this;return new Promise(function(_0x15c0ca,_0x4b03e7){return db['OpenchannelQueue'][_0x47bf('0x26')]({'raw':_0x44b580[_0x47bf('0x1c')]?_0x44b580[_0x47bf('0x1c')][_0x47bf('0x27')]===undefined?!![]:![]:!![],'where':_0x44b580[_0x47bf('0x1c')]?_0x44b580['options']['where']||null:null,'attributes':_0x44b580[_0x47bf('0x1c')]?_0x44b580[_0x47bf('0x1c')][_0x47bf('0x1e')]||null:null,'include':_0x44b580['options']?_0x44b580[_0x47bf('0x1c')]['include']?_[_0x47bf('0x21')](_0x44b580[_0x47bf('0x1c')][_0x47bf('0x20')],function(_0x323b25){return{'model':db[_0x323b25[_0x47bf('0x22')]],'as':_0x323b25['as'],'attributes':_0x323b25[_0x47bf('0x1e')],'include':_0x323b25['include']?_[_0x47bf('0x21')](_0x323b25[_0x47bf('0x20')],function(_0x72533d){return{'model':db[_0x72533d[_0x47bf('0x22')]],'as':_0x72533d['as'],'attributes':_0x72533d[_0x47bf('0x1e')],'include':_0x72533d['include']?_[_0x47bf('0x21')](_0x72533d[_0x47bf('0x20')],function(_0x459dd1){return{'model':db[_0x459dd1['model']],'as':_0x459dd1['as'],'attributes':_0x459dd1[_0x47bf('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x47bf('0x10')](function(_0x3af3fa){logger[_0x47bf('0x11')]('ShowOpenchannelQueue',_0x44b580);logger['debug'](_0x47bf('0x25'),_0x44b580,JSON[_0x47bf('0x24')](_0x3af3fa));_0x15c0ca(_0x3af3fa);})[_0x47bf('0x1a')](function(_0x37f377){logger['error'](_0x47bf('0x25'),_0x37f377[_0x47bf('0x18')],_0x44b580);_0x4b03e7(_0x4f871f['error'](0x1f4,_0x37f377[_0x47bf('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index ad9f9a0..379e797 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 _0x7b0a=['openchannelQueue:','./openchannelQueue.events','save','update','emit','removeListener','length'];(function(_0x6b8e6,_0x5b5b8d){var _0x11e8d9=function(_0x27609b){while(--_0x27609b){_0x6b8e6['push'](_0x6b8e6['shift']());}};_0x11e8d9(++_0x5b5b8d);}(_0x7b0a,0x143));var _0xa7b0=function(_0x561074,_0x4c03f4){_0x561074=_0x561074-0x0;var _0x5103d7=_0x7b0a[_0x561074];return _0x5103d7;};'use strict';var OpenchannelQueueEvents=require(_0xa7b0('0x0'));var events=[_0xa7b0('0x1'),'remove',_0xa7b0('0x2')];function createListener(_0x49074e,_0x370475){return function(_0x520f99){_0x370475[_0xa7b0('0x3')](_0x49074e,_0x520f99);};}function removeListener(_0x155de3,_0x6ea282){return function(){OpenchannelQueueEvents[_0xa7b0('0x4')](_0x155de3,_0x6ea282);};}exports['register']=function(_0x411f23){for(var _0xce91a1=0x0,_0x455631=events[_0xa7b0('0x5')];_0xce91a1<_0x455631;_0xce91a1++){var _0x2b6f25=events[_0xce91a1];var _0x59a921=createListener(_0xa7b0('0x6')+_0x2b6f25,_0x411f23);OpenchannelQueueEvents['on'](_0x2b6f25,_0x59a921);}}; \ No newline at end of file +var _0xd539=['save','update','emit','removeListener','length','openchannelQueue:'];(function(_0x1bfe2b,_0x34856e){var _0x1477d4=function(_0x1d558c){while(--_0x1d558c){_0x1bfe2b['push'](_0x1bfe2b['shift']());}};_0x1477d4(++_0x34856e);}(_0xd539,0xc0));var _0x9d53=function(_0x424fca,_0x1f2869){_0x424fca=_0x424fca-0x0;var _0x58b858=_0xd539[_0x424fca];return _0x58b858;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x9d53('0x0'),'remove',_0x9d53('0x1')];function createListener(_0x3f0e21,_0x460926){return function(_0xff54b4){_0x460926[_0x9d53('0x2')](_0x3f0e21,_0xff54b4);};}function removeListener(_0x4428f3,_0x4e6cff){return function(){OpenchannelQueueEvents[_0x9d53('0x3')](_0x4428f3,_0x4e6cff);};}exports['register']=function(_0x2f5e5b){for(var _0x4a0484=0x0,_0x20ce7d=events[_0x9d53('0x4')];_0x4a0484<_0x20ce7d;_0x4a0484++){var _0x2b90e4=events[_0x4a0484];var _0x5be4ec=createListener(_0x9d53('0x5')+_0x2b90e4,_0x2f5e5b);OpenchannelQueueEvents['on'](_0x2b90e4,_0x5be4ec);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 422d40d..f383a3c 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 _0x02b3=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller','get','index','isAuthenticated','describe','/:id','show','post','create','update','destroy','exports','multer','util','path'];(function(_0x3cc16d,_0x2a569c){var _0x13c29c=function(_0x32e098){while(--_0x32e098){_0x3cc16d['push'](_0x3cc16d['shift']());}};_0x13c29c(++_0x2a569c);}(_0x02b3,0x115));var _0x302b=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x02b3[_0x5d2803];return _0xdcad2c;};'use strict';var multer=require(_0x302b('0x0'));var util=require(_0x302b('0x1'));var path=require(_0x302b('0x2'));var timeout=require(_0x302b('0x3'));var express=require('express');var router=express[_0x302b('0x4')]();var fs_extra=require(_0x302b('0x5'));var auth=require(_0x302b('0x6'));var interaction=require(_0x302b('0x7'));var config=require('../../config/environment');var controller=require(_0x302b('0x8'));router[_0x302b('0x9')]('/',auth['isAuthenticated'](),controller[_0x302b('0xa')]);router[_0x302b('0x9')]('/describe',auth[_0x302b('0xb')](),controller[_0x302b('0xc')]);router[_0x302b('0x9')](_0x302b('0xd'),auth['isAuthenticated'](),controller[_0x302b('0xe')]);router[_0x302b('0xf')]('/',auth['isAuthenticated'](),controller[_0x302b('0x10')]);router['put'](_0x302b('0xd'),auth[_0x302b('0xb')](),controller[_0x302b('0x11')]);router['delete']('/:id',auth[_0x302b('0xb')](),controller[_0x302b('0x12')]);module[_0x302b('0x13')]=router; \ No newline at end of file +var _0xf1a6=['get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueueReport.controller'];(function(_0xb2300f,_0x3e1e5a){var _0x521388=function(_0x2be30d){while(--_0x2be30d){_0xb2300f['push'](_0xb2300f['shift']());}};_0x521388(++_0x3e1e5a);}(_0xf1a6,0xca));var _0x6f1a=function(_0x583f45,_0x28aeea){_0x583f45=_0x583f45-0x0;var _0x3753b9=_0xf1a6[_0x583f45];return _0x3753b9;};'use strict';var multer=require(_0x6f1a('0x0'));var util=require(_0x6f1a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6f1a('0x2'));var router=express[_0x6f1a('0x3')]();var fs_extra=require(_0x6f1a('0x4'));var auth=require(_0x6f1a('0x5'));var interaction=require(_0x6f1a('0x6'));var config=require('../../config/environment');var controller=require(_0x6f1a('0x7'));router[_0x6f1a('0x8')]('/',auth[_0x6f1a('0x9')](),controller[_0x6f1a('0xa')]);router[_0x6f1a('0x8')](_0x6f1a('0xb'),auth['isAuthenticated'](),controller[_0x6f1a('0xc')]);router['get'](_0x6f1a('0xd'),auth[_0x6f1a('0x9')](),controller[_0x6f1a('0xe')]);router[_0x6f1a('0xf')]('/',auth[_0x6f1a('0x9')](),controller[_0x6f1a('0x10')]);router['put'](_0x6f1a('0xd'),auth['isAuthenticated'](),controller[_0x6f1a('0x11')]);router[_0x6f1a('0x12')](_0x6f1a('0xd'),auth[_0x6f1a('0x9')](),controller[_0x6f1a('0x13')]);module[_0x6f1a('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 3c1af20..10dd778 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 _0x7579=['STRING','DATE','moment','sequelize','exports'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x7579,0x1e2));var _0x9757=function(_0x5d3ba7,_0x451333){_0x5d3ba7=_0x5d3ba7-0x0;var _0xe9fb2=_0x7579[_0x5d3ba7];return _0xe9fb2;};'use strict';var moment=require(_0x9757('0x0'));var Sequelize=require(_0x9757('0x1'));module[_0x9757('0x2')]={'uniqueid':{'type':Sequelize[_0x9757('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x9757('0x3')]},'joinAt':{'type':Sequelize[_0x9757('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x9757('0x4')]},'exitAt':{'type':Sequelize[_0x9757('0x4')]},'reason':{'type':Sequelize[_0x9757('0x3')]}}; \ No newline at end of file +var _0x951e=['DATE','moment','sequelize','exports','STRING'];(function(_0x355ce8,_0x5f1d0a){var _0x1db8b8=function(_0x277eb2){while(--_0x277eb2){_0x355ce8['push'](_0x355ce8['shift']());}};_0x1db8b8(++_0x5f1d0a);}(_0x951e,0xc9));var _0xe951=function(_0x25e655,_0x35246b){_0x25e655=_0x25e655-0x0;var _0x48da6b=_0x951e[_0x25e655];return _0x48da6b;};'use strict';var moment=require(_0xe951('0x0'));var Sequelize=require(_0xe951('0x1'));module[_0xe951('0x2')]={'uniqueid':{'type':Sequelize[_0xe951('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xe951('0x3')]},'joinAt':{'type':Sequelize[_0xe951('0x4')]},'leaveAt':{'type':Sequelize[_0xe951('0x4')]},'acceptAt':{'type':Sequelize[_0xe951('0x4')]},'exitAt':{'type':Sequelize[_0xe951('0x4')]},'reason':{'type':Sequelize[_0xe951('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 83508b5..1192da4 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 _0x58f3=['attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','OpenchannelQueueReport','include','rows','show','params','rawAttributes','length','includeAll','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','fieldName','type','key','query','keys','filters','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x58f3,0x103));var _0x358f=function(_0x47a14e,_0x4701d1){_0x47a14e=_0x47a14e-0x0;var _0x3499e1=_0x58f3[_0x47a14e];return _0x3499e1;};'use strict';var emlformat=require(_0x358f('0x0'));var rimraf=require(_0x358f('0x1'));var zipdir=require(_0x358f('0x2'));var jsonpatch=require(_0x358f('0x3'));var rp=require(_0x358f('0x4'));var moment=require(_0x358f('0x5'));var BPromise=require(_0x358f('0x6'));var Mustache=require(_0x358f('0x7'));var util=require(_0x358f('0x8'));var path=require(_0x358f('0x9'));var sox=require(_0x358f('0xa'));var csv=require(_0x358f('0xb'));var ejs=require(_0x358f('0xc'));var fs=require('fs');var fs_extra=require(_0x358f('0xd'));var _=require(_0x358f('0xe'));var squel=require(_0x358f('0xf'));var crypto=require(_0x358f('0x10'));var jsforce=require(_0x358f('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x358f('0xb'));var querystring=require(_0x358f('0x12'));var Papa=require(_0x358f('0x13'));var Redis=require(_0x358f('0x14'));var authService=require(_0x358f('0x15'));var qs=require(_0x358f('0x16'));var as=require(_0x358f('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x358f('0x18'))('api');var utils=require('../../config/utils');var config=require(_0x358f('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x358f('0x1a'))['db'];function respondWithStatusCode(_0x13605d,_0x14bceb){_0x14bceb=_0x14bceb||0xcc;return function(_0x29bf5a){if(_0x29bf5a){return _0x13605d[_0x358f('0x1b')](_0x14bceb);}return _0x13605d[_0x358f('0x1c')](_0x14bceb)[_0x358f('0x1d')]();};}function respondWithResult(_0x368ab5,_0x57c005){_0x57c005=_0x57c005||0xc8;return function(_0x4632ae){if(_0x4632ae){return _0x368ab5['status'](_0x57c005)[_0x358f('0x1e')](_0x4632ae);}};}function respondWithFilteredResult(_0x404567,_0x1f554d){return function(_0x549a6d){if(_0x549a6d){var _0x14d4f9=typeof _0x1f554d[_0x358f('0x1f')]==='undefined'&&typeof _0x1f554d[_0x358f('0x20')]==='undefined';var _0x7978ba=_0x549a6d[_0x358f('0x21')];var _0x893b4d=_0x14d4f9?0x0:_0x1f554d[_0x358f('0x1f')];var _0x36dd0a=_0x14d4f9?_0x549a6d[_0x358f('0x21')]:_0x1f554d[_0x358f('0x1f')]+_0x1f554d[_0x358f('0x20')];var _0x250867;if(_0x36dd0a>=_0x7978ba){_0x36dd0a=_0x7978ba;_0x250867=0xc8;}else{_0x250867=0xce;}_0x404567[_0x358f('0x1c')](_0x250867);return _0x404567[_0x358f('0x22')]('Content-Range',_0x893b4d+'-'+_0x36dd0a+'/'+_0x7978ba)[_0x358f('0x1e')](_0x549a6d);}return null;};}function patchUpdates(_0x455033){return function(_0x104bf6){try{jsonpatch[_0x358f('0x23')](_0x104bf6,_0x455033,!![]);}catch(_0x2b5d04){return BPromise[_0x358f('0x24')](_0x2b5d04);}return _0x104bf6[_0x358f('0x25')]();};}function saveUpdates(_0x40a717,_0x2e4868){return function(_0x2e346a){if(_0x2e346a){return _0x2e346a[_0x358f('0x26')](_0x40a717)[_0x358f('0x27')](function(_0x57f043){return _0x57f043;});}return null;};}function removeEntity(_0x1fc19e,_0x4f2282){return function(_0x4a9035){if(_0x4a9035){return _0x4a9035[_0x358f('0x28')]()[_0x358f('0x27')](function(){_0x1fc19e[_0x358f('0x1c')](0xcc)[_0x358f('0x1d')]();});}};}function handleEntityNotFound(_0x1ee5ab,_0x3698a2){return function(_0x33798e){if(!_0x33798e){_0x1ee5ab['sendStatus'](0x194);}return _0x33798e;};}function handleError(_0x212cfd,_0x195a8d){_0x195a8d=_0x195a8d||0x1f4;return function(_0x56ad41){logger[_0x358f('0x29')](_0x56ad41[_0x358f('0x2a')]);if(_0x56ad41[_0x358f('0x2b')]){delete _0x56ad41[_0x358f('0x2b')];}_0x212cfd['status'](_0x195a8d)[_0x358f('0x2c')](_0x56ad41);};}exports['index']=function(_0x378367,_0x299500){var _0x22c40b={},_0x3a123a={},_0x4dcdf5={'count':0x0,'rows':[]};var _0x225d1c=_[_0x358f('0x2d')](db['OpenchannelQueueReport']['rawAttributes'],function(_0x8d9766){return{'name':_0x8d9766[_0x358f('0x2e')],'type':_0x8d9766[_0x358f('0x2f')][_0x358f('0x30')]};});_0x3a123a['model']=_[_0x358f('0x2d')](_0x225d1c,'name');_0x3a123a[_0x358f('0x31')]=_[_0x358f('0x32')](_0x378367[_0x358f('0x31')]);_0x3a123a[_0x358f('0x33')]=_['intersection'](_0x3a123a[_0x358f('0x34')],_0x3a123a[_0x358f('0x31')]);_0x22c40b[_0x358f('0x35')]=_[_0x358f('0x36')](_0x3a123a['model'],qs[_0x358f('0x37')](_0x378367[_0x358f('0x31')][_0x358f('0x37')]));_0x22c40b[_0x358f('0x35')]=_0x22c40b[_0x358f('0x35')]['length']?_0x22c40b[_0x358f('0x35')]:_0x3a123a[_0x358f('0x34')];if(!_0x378367[_0x358f('0x31')][_0x358f('0x38')](_0x358f('0x39'))){_0x22c40b['limit']=qs[_0x358f('0x20')](_0x378367[_0x358f('0x31')][_0x358f('0x20')]);_0x22c40b[_0x358f('0x1f')]=qs[_0x358f('0x1f')](_0x378367[_0x358f('0x31')]['offset']);}_0x22c40b[_0x358f('0x3a')]=qs[_0x358f('0x3b')](_0x378367['query']['sort']);_0x22c40b[_0x358f('0x3c')]=qs[_0x358f('0x33')](_[_0x358f('0x3d')](_0x378367[_0x358f('0x31')],_0x3a123a['filters']),_0x225d1c);if(_0x378367['query'][_0x358f('0x3e')]){_0x22c40b[_0x358f('0x3c')]=_[_0x358f('0x3f')](_0x22c40b[_0x358f('0x3c')],{'$or':_[_0x358f('0x2d')](_0x225d1c,function(_0x4d9291){if(_0x4d9291[_0x358f('0x2f')]!=='VIRTUAL'){var _0x45d975={};_0x45d975[_0x4d9291[_0x358f('0x2b')]]={'$like':'%'+_0x378367[_0x358f('0x31')][_0x358f('0x3e')]+'%'};return _0x45d975;}})});}_0x22c40b=_[_0x358f('0x3f')]({},_0x22c40b,_0x378367['options']);var _0x34bf93={'where':_0x22c40b[_0x358f('0x3c')]};return db[_0x358f('0x40')][_0x358f('0x21')](_0x34bf93)['then'](function(_0x3c282a){_0x4dcdf5[_0x358f('0x21')]=_0x3c282a;if(_0x378367[_0x358f('0x31')]['includeAll']){_0x22c40b[_0x358f('0x41')]=[{'all':!![]}];}return db[_0x358f('0x40')]['findAll'](_0x22c40b);})[_0x358f('0x27')](function(_0x2525c7){_0x4dcdf5[_0x358f('0x42')]=_0x2525c7;return _0x4dcdf5;})[_0x358f('0x27')](respondWithFilteredResult(_0x299500,_0x22c40b))['catch'](handleError(_0x299500,null));};exports[_0x358f('0x43')]=function(_0x18b2a3,_0x1bebd5){var _0x2deeed={'raw':!![],'where':{'id':_0x18b2a3[_0x358f('0x44')]['id']}},_0x40fb18={};_0x40fb18[_0x358f('0x34')]=_['keys'](db[_0x358f('0x40')][_0x358f('0x45')]);_0x40fb18[_0x358f('0x31')]=_[_0x358f('0x32')](_0x18b2a3[_0x358f('0x31')]);_0x40fb18[_0x358f('0x33')]=_[_0x358f('0x36')](_0x40fb18[_0x358f('0x34')],_0x40fb18['query']);_0x2deeed[_0x358f('0x35')]=_['intersection'](_0x40fb18[_0x358f('0x34')],qs['fields'](_0x18b2a3[_0x358f('0x31')][_0x358f('0x37')]));_0x2deeed['attributes']=_0x2deeed[_0x358f('0x35')][_0x358f('0x46')]?_0x2deeed[_0x358f('0x35')]:_0x40fb18[_0x358f('0x34')];if(_0x18b2a3[_0x358f('0x31')][_0x358f('0x47')]){_0x2deeed[_0x358f('0x41')]=[{'all':!![]}];}_0x2deeed=_[_0x358f('0x3f')]({},_0x2deeed,_0x18b2a3[_0x358f('0x48')]);return db['OpenchannelQueueReport'][_0x358f('0x49')](_0x2deeed)['then'](handleEntityNotFound(_0x1bebd5,null))[_0x358f('0x27')](respondWithResult(_0x1bebd5,null))[_0x358f('0x4a')](handleError(_0x1bebd5,null));};exports[_0x358f('0x4b')]=function(_0x41761e,_0x4a2b5e){return db[_0x358f('0x40')][_0x358f('0x4b')](_0x41761e[_0x358f('0x4c')],{})[_0x358f('0x27')](respondWithResult(_0x4a2b5e,0xc9))[_0x358f('0x4a')](handleError(_0x4a2b5e,null));};exports['update']=function(_0x54010c,_0x2d4656){if(_0x54010c[_0x358f('0x4c')]['id']){delete _0x54010c['body']['id'];}return db[_0x358f('0x40')][_0x358f('0x49')]({'where':{'id':_0x54010c['params']['id']}})[_0x358f('0x27')](handleEntityNotFound(_0x2d4656,null))[_0x358f('0x27')](saveUpdates(_0x54010c[_0x358f('0x4c')],null))['then'](respondWithResult(_0x2d4656,null))['catch'](handleError(_0x2d4656,null));};exports[_0x358f('0x28')]=function(_0x50fa8e,_0x30b54e){return db[_0x358f('0x40')]['find']({'where':{'id':_0x50fa8e[_0x358f('0x44')]['id']}})[_0x358f('0x27')](handleEntityNotFound(_0x30b54e,null))[_0x358f('0x27')](removeEntity(_0x30b54e,null))[_0x358f('0x4a')](handleError(_0x30b54e,null));};exports[_0x358f('0x4d')]=function(_0x42eba8,_0x3f218b){return db[_0x358f('0x40')][_0x358f('0x4d')]()['then'](respondWithResult(_0x3f218b,null))[_0x358f('0x4a')](handleError(_0x3f218b,null));}; \ No newline at end of file +var _0x6686=['sendStatus','status','end','offset','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','model','map','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','merge','where','type','VIRTUAL','filter','options','OpenchannelQueueReport','includeAll','findAll','rows','catch','keys','include','find','create','body','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x55ef8b,_0x5deb5e){var _0x359c84=function(_0x437673){while(--_0x437673){_0x55ef8b['push'](_0x55ef8b['shift']());}};_0x359c84(++_0x5deb5e);}(_0x6686,0x7d));var _0x6668=function(_0x5a0b38,_0x222085){_0x5a0b38=_0x5a0b38-0x0;var _0x3b7b8f=_0x6686[_0x5a0b38];return _0x3b7b8f;};'use strict';var emlformat=require(_0x6668('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6668('0x1'));var jsonpatch=require(_0x6668('0x2'));var rp=require(_0x6668('0x3'));var moment=require('moment');var BPromise=require(_0x6668('0x4'));var Mustache=require(_0x6668('0x5'));var util=require('util');var path=require(_0x6668('0x6'));var sox=require(_0x6668('0x7'));var csv=require(_0x6668('0x8'));var ejs=require(_0x6668('0x9'));var fs=require('fs');var fs_extra=require(_0x6668('0xa'));var _=require(_0x6668('0xb'));var squel=require(_0x6668('0xc'));var crypto=require(_0x6668('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6668('0xe'));var toCsv=require(_0x6668('0x8'));var querystring=require(_0x6668('0xf'));var Papa=require(_0x6668('0x10'));var Redis=require(_0x6668('0x11'));var authService=require(_0x6668('0x12'));var qs=require(_0x6668('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6668('0x14'));var logger=require(_0x6668('0x15'))(_0x6668('0x16'));var utils=require(_0x6668('0x17'));var config=require(_0x6668('0x18'));var licenseUtil=require(_0x6668('0x19'));var db=require(_0x6668('0x1a'))['db'];function respondWithStatusCode(_0x22adcf,_0x24a7f8){_0x24a7f8=_0x24a7f8||0xcc;return function(_0x9b4f75){if(_0x9b4f75){return _0x22adcf[_0x6668('0x1b')](_0x24a7f8);}return _0x22adcf[_0x6668('0x1c')](_0x24a7f8)[_0x6668('0x1d')]();};}function respondWithResult(_0x13718c,_0x5b7ca3){_0x5b7ca3=_0x5b7ca3||0xc8;return function(_0x3bfc75){if(_0x3bfc75){return _0x13718c[_0x6668('0x1c')](_0x5b7ca3)['json'](_0x3bfc75);}};}function respondWithFilteredResult(_0x360ed8,_0x55c230){return function(_0x39ce9b){if(_0x39ce9b){var _0xf30ed9=typeof _0x55c230['offset']==='undefined'&&typeof _0x55c230['limit']==='undefined';var _0x547be2=_0x39ce9b['count'];var _0x100b37=_0xf30ed9?0x0:_0x55c230[_0x6668('0x1e')];var _0x4c8d98=_0xf30ed9?_0x39ce9b[_0x6668('0x1f')]:_0x55c230[_0x6668('0x1e')]+_0x55c230['limit'];var _0x17db72;if(_0x4c8d98>=_0x547be2){_0x4c8d98=_0x547be2;_0x17db72=0xc8;}else{_0x17db72=0xce;}_0x360ed8[_0x6668('0x1c')](_0x17db72);return _0x360ed8[_0x6668('0x20')](_0x6668('0x21'),_0x100b37+'-'+_0x4c8d98+'/'+_0x547be2)[_0x6668('0x22')](_0x39ce9b);}return null;};}function patchUpdates(_0x51c199){return function(_0xdb2a7){try{jsonpatch[_0x6668('0x23')](_0xdb2a7,_0x51c199,!![]);}catch(_0x10d19b){return BPromise['reject'](_0x10d19b);}return _0xdb2a7[_0x6668('0x24')]();};}function saveUpdates(_0x349bce,_0x2c3c08){return function(_0x403f02){if(_0x403f02){return _0x403f02[_0x6668('0x25')](_0x349bce)[_0x6668('0x26')](function(_0x2bb4f5){return _0x2bb4f5;});}return null;};}function removeEntity(_0x1dd8c3,_0x2c8556){return function(_0x39ef0e){if(_0x39ef0e){return _0x39ef0e[_0x6668('0x27')]()['then'](function(){_0x1dd8c3['status'](0xcc)[_0x6668('0x1d')]();});}};}function handleEntityNotFound(_0x2f2a54,_0x515c8d){return function(_0x5c1c5b){if(!_0x5c1c5b){_0x2f2a54[_0x6668('0x1b')](0x194);}return _0x5c1c5b;};}function handleError(_0x4017ed,_0x3482f1){_0x3482f1=_0x3482f1||0x1f4;return function(_0x551975){logger[_0x6668('0x28')](_0x551975[_0x6668('0x29')]);if(_0x551975[_0x6668('0x2a')]){delete _0x551975['name'];}_0x4017ed[_0x6668('0x1c')](_0x3482f1)['send'](_0x551975);};}exports[_0x6668('0x2b')]=function(_0x4db573,_0x5e82c9){var _0x50c729={},_0x4f6b56={},_0x229f26={'count':0x0,'rows':[]};var _0x95c58d=_['map'](db['OpenchannelQueueReport'][_0x6668('0x2c')],function(_0x14ba25){return{'name':_0x14ba25[_0x6668('0x2d')],'type':_0x14ba25['type']['key']};});_0x4f6b56[_0x6668('0x2e')]=_[_0x6668('0x2f')](_0x95c58d,_0x6668('0x2a'));_0x4f6b56[_0x6668('0x30')]=_['keys'](_0x4db573[_0x6668('0x30')]);_0x4f6b56[_0x6668('0x31')]=_[_0x6668('0x32')](_0x4f6b56[_0x6668('0x2e')],_0x4f6b56[_0x6668('0x30')]);_0x50c729[_0x6668('0x33')]=_['intersection'](_0x4f6b56[_0x6668('0x2e')],qs[_0x6668('0x34')](_0x4db573['query'][_0x6668('0x34')]));_0x50c729[_0x6668('0x33')]=_0x50c729[_0x6668('0x33')][_0x6668('0x35')]?_0x50c729[_0x6668('0x33')]:_0x4f6b56['model'];if(!_0x4db573[_0x6668('0x30')]['hasOwnProperty'](_0x6668('0x36'))){_0x50c729[_0x6668('0x37')]=qs[_0x6668('0x37')](_0x4db573[_0x6668('0x30')][_0x6668('0x37')]);_0x50c729[_0x6668('0x1e')]=qs['offset'](_0x4db573[_0x6668('0x30')]['offset']);}_0x50c729[_0x6668('0x38')]=qs[_0x6668('0x39')](_0x4db573[_0x6668('0x30')][_0x6668('0x39')]);_0x50c729['where']=qs['filters'](_['pick'](_0x4db573[_0x6668('0x30')],_0x4f6b56[_0x6668('0x31')]),_0x95c58d);if(_0x4db573['query']['filter']){_0x50c729['where']=_[_0x6668('0x3a')](_0x50c729[_0x6668('0x3b')],{'$or':_[_0x6668('0x2f')](_0x95c58d,function(_0x6a6bf5){if(_0x6a6bf5[_0x6668('0x3c')]!==_0x6668('0x3d')){var _0x77ed49={};_0x77ed49[_0x6a6bf5[_0x6668('0x2a')]]={'$like':'%'+_0x4db573[_0x6668('0x30')][_0x6668('0x3e')]+'%'};return _0x77ed49;}})});}_0x50c729=_[_0x6668('0x3a')]({},_0x50c729,_0x4db573[_0x6668('0x3f')]);var _0x2e6ffa={'where':_0x50c729[_0x6668('0x3b')]};return db[_0x6668('0x40')][_0x6668('0x1f')](_0x2e6ffa)['then'](function(_0x415a1f){_0x229f26[_0x6668('0x1f')]=_0x415a1f;if(_0x4db573[_0x6668('0x30')][_0x6668('0x41')]){_0x50c729['include']=[{'all':!![]}];}return db[_0x6668('0x40')][_0x6668('0x42')](_0x50c729);})[_0x6668('0x26')](function(_0x179d75){_0x229f26[_0x6668('0x43')]=_0x179d75;return _0x229f26;})[_0x6668('0x26')](respondWithFilteredResult(_0x5e82c9,_0x50c729))[_0x6668('0x44')](handleError(_0x5e82c9,null));};exports['show']=function(_0xf1147f,_0x3a6fbe){var _0x5d40d6={'raw':!![],'where':{'id':_0xf1147f['params']['id']}},_0x1e3b6b={};_0x1e3b6b['model']=_['keys'](db[_0x6668('0x40')][_0x6668('0x2c')]);_0x1e3b6b['query']=_[_0x6668('0x45')](_0xf1147f[_0x6668('0x30')]);_0x1e3b6b[_0x6668('0x31')]=_[_0x6668('0x32')](_0x1e3b6b[_0x6668('0x2e')],_0x1e3b6b[_0x6668('0x30')]);_0x5d40d6[_0x6668('0x33')]=_[_0x6668('0x32')](_0x1e3b6b[_0x6668('0x2e')],qs[_0x6668('0x34')](_0xf1147f[_0x6668('0x30')]['fields']));_0x5d40d6[_0x6668('0x33')]=_0x5d40d6[_0x6668('0x33')][_0x6668('0x35')]?_0x5d40d6[_0x6668('0x33')]:_0x1e3b6b['model'];if(_0xf1147f['query'][_0x6668('0x41')]){_0x5d40d6[_0x6668('0x46')]=[{'all':!![]}];}_0x5d40d6=_['merge']({},_0x5d40d6,_0xf1147f['options']);return db[_0x6668('0x40')][_0x6668('0x47')](_0x5d40d6)[_0x6668('0x26')](handleEntityNotFound(_0x3a6fbe,null))[_0x6668('0x26')](respondWithResult(_0x3a6fbe,null))[_0x6668('0x44')](handleError(_0x3a6fbe,null));};exports[_0x6668('0x48')]=function(_0x4a09f8,_0x18d8d4){return db[_0x6668('0x40')][_0x6668('0x48')](_0x4a09f8[_0x6668('0x49')],{})[_0x6668('0x26')](respondWithResult(_0x18d8d4,0xc9))['catch'](handleError(_0x18d8d4,null));};exports[_0x6668('0x25')]=function(_0x3275c8,_0x7019e6){if(_0x3275c8[_0x6668('0x49')]['id']){delete _0x3275c8['body']['id'];}return db[_0x6668('0x40')][_0x6668('0x47')]({'where':{'id':_0x3275c8[_0x6668('0x4a')]['id']}})[_0x6668('0x26')](handleEntityNotFound(_0x7019e6,null))[_0x6668('0x26')](saveUpdates(_0x3275c8[_0x6668('0x49')],null))[_0x6668('0x26')](respondWithResult(_0x7019e6,null))[_0x6668('0x44')](handleError(_0x7019e6,null));};exports[_0x6668('0x27')]=function(_0x25c36c,_0x1aa350){return db['OpenchannelQueueReport'][_0x6668('0x47')]({'where':{'id':_0x25c36c[_0x6668('0x4a')]['id']}})[_0x6668('0x26')](handleEntityNotFound(_0x1aa350,null))['then'](removeEntity(_0x1aa350,null))['catch'](handleError(_0x1aa350,null));};exports[_0x6668('0x4b')]=function(_0x163085,_0xea767e){return db[_0x6668('0x40')]['describe']()[_0x6668('0x26')](respondWithResult(_0xea767e,null))[_0x6668('0x44')](handleError(_0xea767e,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 479338f..9fd6146 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 _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','define','report_openchannel_queue','uniqueid','util'];(function(_0x121ca9,_0x32bc76){var _0xbf761b=function(_0x292204){while(--_0x292204){_0x121ca9['push'](_0x121ca9['shift']());}};_0xbf761b(++_0x32bc76);}(_0x1261,0x144));var _0x1126=function(_0x51df00,_0x4ac573){_0x51df00=_0x51df00-0x0;var _0x198328=_0x1261[_0x51df00];return _0x198328;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x4d7aaf,_0xb955da){var _0x33fb7b=function(_0x59ce86){while(--_0x59ce86){_0x4d7aaf['push'](_0x4d7aaf['shift']());}};_0x33fb7b(++_0xb955da);}(_0xe14b,0x93));var _0xbe14=function(_0x11df3a,_0x244119){_0x11df3a=_0x11df3a-0x0;var _0x3dc03c=_0xe14b[_0x11df3a];return _0x3dc03c;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 5e40d8c..385b3ee 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 _0x84a0=['OpenchannelQueueReport','create','body','options','raw','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch'];(function(_0x34e4a0,_0x1fd446){var _0x3ead3e=function(_0x47adec){while(--_0x47adec){_0x34e4a0['push'](_0x34e4a0['shift']());}};_0x3ead3e(++_0x1fd446);}(_0x84a0,0x66));var _0x084a=function(_0x5b67be,_0x59f4c5){_0x5b67be=_0x5b67be-0x0;var _0x383225=_0x84a0[_0x5b67be];return _0x383225;};'use strict';var _=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var moment=require(_0x084a('0x2'));var BPromise=require(_0x084a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x084a('0x4'));var db=require(_0x084a('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x084a('0x6'));var config=require(_0x084a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x084a('0x8')][_0x084a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2e6810,_0x373d2,_0x2b30bc){return new BPromise(function(_0x58d419,_0x1051a9){return client[_0x084a('0xa')](_0x2e6810,_0x2b30bc)[_0x084a('0xb')](function(_0x2888e3){logger[_0x084a('0xc')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x373d2,'request\x20sent');logger[_0x084a('0xd')](_0x084a('0xe'),_0x373d2,_0x084a('0xf'),JSON[_0x084a('0x10')](_0x2888e3));if(_0x2888e3[_0x084a('0x11')]){if(_0x2888e3['error']['code']===0x1f4){logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x2888e3[_0x084a('0x11')][_0x084a('0x13')]);return _0x1051a9(_0x2888e3[_0x084a('0x11')][_0x084a('0x13')]);}logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x2888e3['error'][_0x084a('0x13')]);return _0x58d419(_0x2888e3['error'][_0x084a('0x13')]);}else{logger[_0x084a('0xc')](_0x084a('0x12'),_0x373d2,_0x084a('0xf'));_0x58d419(_0x2888e3[_0x084a('0x14')]['message']);}})[_0x084a('0x15')](function(_0x4abd81){logger[_0x084a('0x11')](_0x084a('0x12'),_0x373d2,_0x4abd81);_0x1051a9(_0x4abd81);});});}exports['CreateOpenchannelQueueReport']=function(_0xf2c333){var _0x32c729=this;return new Promise(function(_0x4134b9,_0x14bb19){return db[_0x084a('0x16')][_0x084a('0x17')](_0xf2c333[_0x084a('0x18')],{'raw':_0xf2c333[_0x084a('0x19')]?_0xf2c333[_0x084a('0x19')][_0x084a('0x1a')]===undefined?!![]:![]:!![]})[_0x084a('0xb')](function(_0x279e25){logger[_0x084a('0xc')](_0x084a('0x1b'),_0xf2c333);logger[_0x084a('0xd')]('CreateOpenchannelQueueReport',_0xf2c333,JSON[_0x084a('0x10')](_0x279e25));_0x4134b9(_0x279e25);})[_0x084a('0x15')](function(_0x41a90f){logger[_0x084a('0x11')](_0x084a('0x1b'),_0x41a90f['message'],_0xf2c333);_0x14bb19(_0x32c729[_0x084a('0x11')](0x1f4,_0x41a90f[_0x084a('0x13')]));});});};exports[_0x084a('0x1c')]=function(_0x1f2c9f){var _0x18b43d=this;return new Promise(function(_0x3cdc1e,_0x5be167){return db[_0x084a('0x16')][_0x084a('0x1d')](_0x1f2c9f[_0x084a('0x18')],{'raw':_0x1f2c9f['options']?_0x1f2c9f[_0x084a('0x19')][_0x084a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1f2c9f[_0x084a('0x19')]?_0x1f2c9f['options']['where']||null:null,'attributes':_0x1f2c9f['options']?_0x1f2c9f['options'][_0x084a('0x1e')]||null:null,'limit':_0x1f2c9f['options']?_0x1f2c9f['options']['limit']||null:null})[_0x084a('0xb')](function(_0x4651e6){logger[_0x084a('0xc')](_0x084a('0x1c'),_0x1f2c9f);logger[_0x084a('0xd')](_0x084a('0x1c'),_0x1f2c9f,JSON[_0x084a('0x10')](_0x4651e6));_0x3cdc1e(_0x4651e6);})[_0x084a('0x15')](function(_0x5e6ea8){logger[_0x084a('0x11')](_0x084a('0x1c'),_0x5e6ea8['message'],_0x1f2c9f);_0x5be167(_0x18b43d[_0x084a('0x11')](0x1f4,_0x5e6ea8[_0x084a('0x13')]));});});}; \ No newline at end of file +var _0x236c=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','body','options','raw','UpdateOpenchannelQueueReport','update','attributes'];(function(_0x33ed44,_0x541d70){var _0x275f40=function(_0xcf367b){while(--_0xcf367b){_0x33ed44['push'](_0x33ed44['shift']());}};_0x275f40(++_0x541d70);}(_0x236c,0x155));var _0xc236=function(_0xe7366b,_0xeedc32){_0xe7366b=_0xe7366b-0x0;var _0x43e4a8=_0x236c[_0xe7366b];return _0x43e4a8;};'use strict';var _=require(_0xc236('0x0'));var util=require('util');var moment=require(_0xc236('0x1'));var BPromise=require(_0xc236('0x2'));var rs=require(_0xc236('0x3'));var fs=require('fs');var Redis=require(_0xc236('0x4'));var db=require(_0xc236('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc236('0x6'))(_0xc236('0x7'));var config=require(_0xc236('0x8'));var jayson=require(_0xc236('0x9'));var client=jayson[_0xc236('0xa')][_0xc236('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5abd65,_0xd612c6,_0x4d349b){return new BPromise(function(_0x51a13b,_0x5bc6a2){return client['request'](_0x5abd65,_0x4d349b)[_0xc236('0xc')](function(_0x4b8dc6){logger[_0xc236('0xd')](_0xc236('0xe'),_0xd612c6,_0xc236('0xf'));logger[_0xc236('0x10')](_0xc236('0x11'),_0xd612c6,'request\x20sent',JSON[_0xc236('0x12')](_0x4b8dc6));if(_0x4b8dc6[_0xc236('0x13')]){if(_0x4b8dc6['error'][_0xc236('0x14')]===0x1f4){logger[_0xc236('0x13')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xd612c6,_0x4b8dc6[_0xc236('0x13')]['message']);return _0x5bc6a2(_0x4b8dc6['error'][_0xc236('0x15')]);}logger[_0xc236('0x13')](_0xc236('0xe'),_0xd612c6,_0x4b8dc6[_0xc236('0x13')]['message']);return _0x51a13b(_0x4b8dc6[_0xc236('0x13')]['message']);}else{logger['info'](_0xc236('0xe'),_0xd612c6,_0xc236('0xf'));_0x51a13b(_0x4b8dc6[_0xc236('0x16')][_0xc236('0x15')]);}})[_0xc236('0x17')](function(_0x5ac3ed){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0xd612c6,_0x5ac3ed);_0x5bc6a2(_0x5ac3ed);});});}exports[_0xc236('0x18')]=function(_0x76f45){var _0x11ec65=this;return new Promise(function(_0x541a20,_0x13b432){return db['OpenchannelQueueReport']['create'](_0x76f45[_0xc236('0x19')],{'raw':_0x76f45[_0xc236('0x1a')]?_0x76f45[_0xc236('0x1a')][_0xc236('0x1b')]===undefined?!![]:![]:!![]})[_0xc236('0xc')](function(_0x27c6ab){logger[_0xc236('0xd')](_0xc236('0x18'),_0x76f45);logger[_0xc236('0x10')](_0xc236('0x18'),_0x76f45,JSON[_0xc236('0x12')](_0x27c6ab));_0x541a20(_0x27c6ab);})['catch'](function(_0x208c3f){logger[_0xc236('0x13')](_0xc236('0x18'),_0x208c3f[_0xc236('0x15')],_0x76f45);_0x13b432(_0x11ec65[_0xc236('0x13')](0x1f4,_0x208c3f[_0xc236('0x15')]));});});};exports[_0xc236('0x1c')]=function(_0xf921e6){var _0x1d65e2=this;return new Promise(function(_0x3b4059,_0x17cb3b){return db['OpenchannelQueueReport'][_0xc236('0x1d')](_0xf921e6[_0xc236('0x19')],{'raw':_0xf921e6[_0xc236('0x1a')]?_0xf921e6[_0xc236('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf921e6[_0xc236('0x1a')]?_0xf921e6['options']['where']||null:null,'attributes':_0xf921e6[_0xc236('0x1a')]?_0xf921e6['options'][_0xc236('0x1e')]||null:null,'limit':_0xf921e6['options']?_0xf921e6[_0xc236('0x1a')]['limit']||null:null})[_0xc236('0xc')](function(_0x1d144b){logger['info']('UpdateOpenchannelQueueReport',_0xf921e6);logger[_0xc236('0x10')](_0xc236('0x1c'),_0xf921e6,JSON[_0xc236('0x12')](_0x1d144b));_0x3b4059(_0x1d144b);})[_0xc236('0x17')](function(_0x5f3891){logger['error'](_0xc236('0x1c'),_0x5f3891['message'],_0xf921e6);_0x17cb3b(_0x1d65e2[_0xc236('0x13')](0x1f4,_0x5f3891['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 5f3557a..c827618 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 _0x9dcc=['delete','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','index','/describe','isAuthenticated','describe','get','/:id','show','post','put','update'];(function(_0x436ddb,_0x25443d){var _0x40a778=function(_0x18a2aa){while(--_0x18a2aa){_0x436ddb['push'](_0x436ddb['shift']());}};_0x40a778(++_0x25443d);}(_0x9dcc,0x1d0));var _0xc9dc=function(_0x58a18a,_0x1d948a){_0x58a18a=_0x58a18a-0x0;var _0x504330=_0x9dcc[_0x58a18a];return _0x504330;};'use strict';var multer=require(_0xc9dc('0x0'));var util=require(_0xc9dc('0x1'));var path=require(_0xc9dc('0x2'));var timeout=require('connect-timeout');var express=require(_0xc9dc('0x3'));var router=express[_0xc9dc('0x4')]();var fs_extra=require(_0xc9dc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc9dc('0x6'));var config=require(_0xc9dc('0x7'));var controller=require(_0xc9dc('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xc9dc('0x9')]);router['get'](_0xc9dc('0xa'),auth[_0xc9dc('0xb')](),controller[_0xc9dc('0xc')]);router[_0xc9dc('0xd')](_0xc9dc('0xe'),auth[_0xc9dc('0xb')](),controller[_0xc9dc('0xf')]);router[_0xc9dc('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc9dc('0x11')]('/:id',auth[_0xc9dc('0xb')](),controller[_0xc9dc('0x12')]);router[_0xc9dc('0x13')](_0xc9dc('0xe'),auth[_0xc9dc('0xb')](),controller['destroy']);module[_0xc9dc('0x14')]=router; \ No newline at end of file +var _0x0f61=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2298f0,_0x3bbf4f){var _0x39b136=function(_0xc2cd6e){while(--_0xc2cd6e){_0x2298f0['push'](_0x2298f0['shift']());}};_0x39b136(++_0x3bbf4f);}(_0x0f61,0x1ba));var _0x10f6=function(_0x422424,_0x2f3913){_0x422424=_0x422424-0x0;var _0x419af4=_0x0f61[_0x422424];return _0x419af4;};'use strict';var multer=require(_0x10f6('0x0'));var util=require('util');var path=require(_0x10f6('0x1'));var timeout=require(_0x10f6('0x2'));var express=require(_0x10f6('0x3'));var router=express[_0x10f6('0x4')]();var fs_extra=require(_0x10f6('0x5'));var auth=require(_0x10f6('0x6'));var interaction=require(_0x10f6('0x7'));var config=require(_0x10f6('0x8'));var controller=require('./openchannelTransferReport.controller');router[_0x10f6('0x9')]('/',auth[_0x10f6('0xa')](),controller['index']);router[_0x10f6('0x9')]('/describe',auth[_0x10f6('0xa')](),controller['describe']);router[_0x10f6('0x9')](_0x10f6('0xb'),auth[_0x10f6('0xa')](),controller[_0x10f6('0xc')]);router[_0x10f6('0xd')]('/',auth[_0x10f6('0xa')](),controller[_0x10f6('0xe')]);router[_0x10f6('0xf')](_0x10f6('0xb'),auth[_0x10f6('0xa')](),controller[_0x10f6('0x10')]);router[_0x10f6('0x11')](_0x10f6('0xb'),auth[_0x10f6('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 151250d..c565649 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x1da515,_0x56f169){var _0x1feff4=function(_0x580abe){while(--_0x580abe){_0x1da515['push'](_0x1da515['shift']());}};_0x1feff4(++_0x56f169);}(_0xf4eb,0xec));var _0xbf4e=function(_0x592cdd,_0x421fd2){_0x592cdd=_0x592cdd-0x0;var _0x36db80=_0xf4eb[_0x592cdd];return _0x36db80;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}}; \ No newline at end of file +var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x357461,_0x43e0fe){var _0x7960f=function(_0x3d57ae){while(--_0x3d57ae){_0x357461['push'](_0x357461['shift']());}};_0x7960f(++_0x43e0fe);}(_0xedd9,0xfc));var _0x9edd=function(_0x1d9ec8,_0x210c79){_0x1d9ec8=_0x1d9ec8-0x0;var _0x5a2a9c=_0xedd9[_0x1d9ec8];return _0x5a2a9c;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 4dfd4ee..bd48c95 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 _0x81dc=['bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','stack','name','send','index','map','OpenchannelTransferReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','findAll','then','catch','show','params','find','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x541260,_0x4c7f2e){var _0x1dd2b5=function(_0x4140de){while(--_0x4140de){_0x541260['push'](_0x541260['shift']());}};_0x1dd2b5(++_0x4c7f2e);}(_0x81dc,0xdc));var _0xc81d=function(_0x5ce15c,_0x19c917){_0x5ce15c=_0x5ce15c-0x0;var _0x36e4f5=_0x81dc[_0x5ce15c];return _0x36e4f5;};'use strict';var emlformat=require(_0xc81d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc81d('0x1'));var jsonpatch=require(_0xc81d('0x2'));var rp=require(_0xc81d('0x3'));var moment=require(_0xc81d('0x4'));var BPromise=require(_0xc81d('0x5'));var Mustache=require(_0xc81d('0x6'));var util=require(_0xc81d('0x7'));var path=require(_0xc81d('0x8'));var sox=require(_0xc81d('0x9'));var csv=require(_0xc81d('0xa'));var ejs=require(_0xc81d('0xb'));var fs=require('fs');var fs_extra=require(_0xc81d('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc81d('0xd'));var jsforce=require(_0xc81d('0xe'));var deskjs=require(_0xc81d('0xf'));var toCsv=require(_0xc81d('0xa'));var querystring=require('querystring');var Papa=require(_0xc81d('0x10'));var Redis=require(_0xc81d('0x11'));var authService=require(_0xc81d('0x12'));var qs=require(_0xc81d('0x13'));var as=require(_0xc81d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc81d('0x15'))(_0xc81d('0x16'));var utils=require('../../config/utils');var config=require(_0xc81d('0x17'));var licenseUtil=require(_0xc81d('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b90a3,_0x165d6d){_0x165d6d=_0x165d6d||0xcc;return function(_0x548fab){if(_0x548fab){return _0x4b90a3[_0xc81d('0x19')](_0x165d6d);}return _0x4b90a3[_0xc81d('0x1a')](_0x165d6d)[_0xc81d('0x1b')]();};}function respondWithResult(_0x446e16,_0x16dcb5){_0x16dcb5=_0x16dcb5||0xc8;return function(_0x30a14a){if(_0x30a14a){return _0x446e16[_0xc81d('0x1a')](_0x16dcb5)[_0xc81d('0x1c')](_0x30a14a);}};}function respondWithFilteredResult(_0x1b8e60,_0x41fc2a){return function(_0x3db0c9){if(_0x3db0c9){var _0xdcd131=typeof _0x41fc2a[_0xc81d('0x1d')]==='undefined'&&typeof _0x41fc2a['limit']===_0xc81d('0x1e');var _0x552aef=_0x3db0c9[_0xc81d('0x1f')];var _0x305e04=_0xdcd131?0x0:_0x41fc2a[_0xc81d('0x1d')];var _0x48da17=_0xdcd131?_0x3db0c9[_0xc81d('0x1f')]:_0x41fc2a[_0xc81d('0x1d')]+_0x41fc2a[_0xc81d('0x20')];var _0x328590;if(_0x48da17>=_0x552aef){_0x48da17=_0x552aef;_0x328590=0xc8;}else{_0x328590=0xce;}_0x1b8e60[_0xc81d('0x1a')](_0x328590);return _0x1b8e60['set']('Content-Range',_0x305e04+'-'+_0x48da17+'/'+_0x552aef)[_0xc81d('0x1c')](_0x3db0c9);}return null;};}function patchUpdates(_0x339b9c){return function(_0x5e53f1){try{jsonpatch[_0xc81d('0x21')](_0x5e53f1,_0x339b9c,!![]);}catch(_0x4f0d1b){return BPromise[_0xc81d('0x22')](_0x4f0d1b);}return _0x5e53f1[_0xc81d('0x23')]();};}function saveUpdates(_0x300ff1,_0x490dc8){return function(_0x16aabe){if(_0x16aabe){return _0x16aabe[_0xc81d('0x24')](_0x300ff1)['then'](function(_0x3b0a19){return _0x3b0a19;});}return null;};}function removeEntity(_0x1944a3,_0xda326c){return function(_0x3392a8){if(_0x3392a8){return _0x3392a8['destroy']()['then'](function(){_0x1944a3[_0xc81d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c347d,_0x1572e4){return function(_0x68ded3){if(!_0x68ded3){_0x2c347d[_0xc81d('0x19')](0x194);}return _0x68ded3;};}function handleError(_0x19861c,_0xbba2d4){_0xbba2d4=_0xbba2d4||0x1f4;return function(_0x363e20){logger['error'](_0x363e20[_0xc81d('0x25')]);if(_0x363e20[_0xc81d('0x26')]){delete _0x363e20[_0xc81d('0x26')];}_0x19861c[_0xc81d('0x1a')](_0xbba2d4)[_0xc81d('0x27')](_0x363e20);};}exports[_0xc81d('0x28')]=function(_0x458665,_0x57bce7){var _0x566918={},_0x2b0f70={},_0x5a2408={'count':0x0,'rows':[]};var _0x57703a=_[_0xc81d('0x29')](db[_0xc81d('0x2a')]['rawAttributes'],function(_0x31dcf6){return{'name':_0x31dcf6[_0xc81d('0x2b')],'type':_0x31dcf6[_0xc81d('0x2c')][_0xc81d('0x2d')]};});_0x2b0f70[_0xc81d('0x2e')]=_[_0xc81d('0x29')](_0x57703a,_0xc81d('0x26'));_0x2b0f70[_0xc81d('0x2f')]=_[_0xc81d('0x30')](_0x458665[_0xc81d('0x2f')]);_0x2b0f70[_0xc81d('0x31')]=_[_0xc81d('0x32')](_0x2b0f70[_0xc81d('0x2e')],_0x2b0f70[_0xc81d('0x2f')]);_0x566918['attributes']=_['intersection'](_0x2b0f70[_0xc81d('0x2e')],qs[_0xc81d('0x33')](_0x458665[_0xc81d('0x2f')][_0xc81d('0x33')]));_0x566918[_0xc81d('0x34')]=_0x566918['attributes'][_0xc81d('0x35')]?_0x566918[_0xc81d('0x34')]:_0x2b0f70[_0xc81d('0x2e')];if(!_0x458665[_0xc81d('0x2f')][_0xc81d('0x36')](_0xc81d('0x37'))){_0x566918[_0xc81d('0x20')]=qs[_0xc81d('0x20')](_0x458665[_0xc81d('0x2f')][_0xc81d('0x20')]);_0x566918[_0xc81d('0x1d')]=qs[_0xc81d('0x1d')](_0x458665[_0xc81d('0x2f')]['offset']);}_0x566918[_0xc81d('0x38')]=qs[_0xc81d('0x39')](_0x458665[_0xc81d('0x2f')]['sort']);_0x566918[_0xc81d('0x3a')]=qs[_0xc81d('0x31')](_[_0xc81d('0x3b')](_0x458665[_0xc81d('0x2f')],_0x2b0f70[_0xc81d('0x31')]),_0x57703a);if(_0x458665['query']['filter']){_0x566918['where']=_['merge'](_0x566918[_0xc81d('0x3a')],{'$or':_[_0xc81d('0x29')](_0x57703a,function(_0x58468b){if(_0x58468b[_0xc81d('0x2c')]!==_0xc81d('0x3c')){var _0x16133b={};_0x16133b[_0x58468b[_0xc81d('0x26')]]={'$like':'%'+_0x458665[_0xc81d('0x2f')]['filter']+'%'};return _0x16133b;}})});}_0x566918=_[_0xc81d('0x3d')]({},_0x566918,_0x458665[_0xc81d('0x3e')]);var _0x25f964={'where':_0x566918[_0xc81d('0x3a')]};return db[_0xc81d('0x2a')]['count'](_0x25f964)['then'](function(_0x3ce888){_0x5a2408[_0xc81d('0x1f')]=_0x3ce888;if(_0x458665[_0xc81d('0x2f')][_0xc81d('0x3f')]){_0x566918[_0xc81d('0x40')]=[{'all':!![]}];}return db[_0xc81d('0x2a')][_0xc81d('0x41')](_0x566918);})[_0xc81d('0x42')](function(_0x49b3fa){_0x5a2408['rows']=_0x49b3fa;return _0x5a2408;})[_0xc81d('0x42')](respondWithFilteredResult(_0x57bce7,_0x566918))[_0xc81d('0x43')](handleError(_0x57bce7,null));};exports[_0xc81d('0x44')]=function(_0x45ff3f,_0x90f7e7){var _0x43b2ea={'raw':!![],'where':{'id':_0x45ff3f[_0xc81d('0x45')]['id']}},_0x33b603={};_0x33b603['model']=_[_0xc81d('0x30')](db['OpenchannelTransferReport']['rawAttributes']);_0x33b603[_0xc81d('0x2f')]=_[_0xc81d('0x30')](_0x45ff3f[_0xc81d('0x2f')]);_0x33b603[_0xc81d('0x31')]=_[_0xc81d('0x32')](_0x33b603[_0xc81d('0x2e')],_0x33b603[_0xc81d('0x2f')]);_0x43b2ea[_0xc81d('0x34')]=_['intersection'](_0x33b603[_0xc81d('0x2e')],qs[_0xc81d('0x33')](_0x45ff3f['query'][_0xc81d('0x33')]));_0x43b2ea[_0xc81d('0x34')]=_0x43b2ea[_0xc81d('0x34')]['length']?_0x43b2ea[_0xc81d('0x34')]:_0x33b603[_0xc81d('0x2e')];if(_0x45ff3f['query']['includeAll']){_0x43b2ea[_0xc81d('0x40')]=[{'all':!![]}];}_0x43b2ea=_['merge']({},_0x43b2ea,_0x45ff3f[_0xc81d('0x3e')]);return db[_0xc81d('0x2a')][_0xc81d('0x46')](_0x43b2ea)[_0xc81d('0x42')](handleEntityNotFound(_0x90f7e7,null))['then'](respondWithResult(_0x90f7e7,null))['catch'](handleError(_0x90f7e7,null));};exports[_0xc81d('0x47')]=function(_0x5c0260,_0x1bd23c){return db[_0xc81d('0x2a')]['create'](_0x5c0260['body'],{})['then'](respondWithResult(_0x1bd23c,0xc9))[_0xc81d('0x43')](handleError(_0x1bd23c,null));};exports[_0xc81d('0x24')]=function(_0x2f4c0d,_0x396ff6){if(_0x2f4c0d[_0xc81d('0x48')]['id']){delete _0x2f4c0d['body']['id'];}return db[_0xc81d('0x2a')]['find']({'where':{'id':_0x2f4c0d['params']['id']}})[_0xc81d('0x42')](handleEntityNotFound(_0x396ff6,null))[_0xc81d('0x42')](saveUpdates(_0x2f4c0d['body'],null))['then'](respondWithResult(_0x396ff6,null))['catch'](handleError(_0x396ff6,null));};exports[_0xc81d('0x49')]=function(_0x204d78,_0x34668e){return db[_0xc81d('0x2a')][_0xc81d('0x46')]({'where':{'id':_0x204d78['params']['id']}})[_0xc81d('0x42')](handleEntityNotFound(_0x34668e,null))['then'](removeEntity(_0x34668e,null))[_0xc81d('0x43')](handleError(_0x34668e,null));};exports['describe']=function(_0x3066da,_0xefd06a){return db[_0xc81d('0x2a')][_0xc81d('0x4a')]()[_0xc81d('0x42')](respondWithResult(_0xefd06a,null))[_0xc81d('0x43')](handleError(_0xefd06a,null));}; \ No newline at end of file +var _0xea69=['pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','body','find','describe','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','json','apply','reject','update','then','destroy','sendStatus','error','name','send','index','map','OpenchannelTransferReport','rawAttributes','type','query','keys','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where'];(function(_0x3a94e8,_0x3b271a){var _0x16069d=function(_0x2809b9){while(--_0x2809b9){_0x3a94e8['push'](_0x3a94e8['shift']());}};_0x16069d(++_0x3b271a);}(_0xea69,0xd8));var _0x9ea6=function(_0xb4c7b,_0x56dcfb){_0xb4c7b=_0xb4c7b-0x0;var _0x11f0ab=_0xea69[_0xb4c7b];return _0x11f0ab;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9ea6('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ea6('0x1'));var moment=require('moment');var BPromise=require(_0x9ea6('0x2'));var Mustache=require(_0x9ea6('0x3'));var util=require('util');var path=require(_0x9ea6('0x4'));var sox=require(_0x9ea6('0x5'));var csv=require('to-csv');var ejs=require(_0x9ea6('0x6'));var fs=require('fs');var fs_extra=require(_0x9ea6('0x7'));var _=require(_0x9ea6('0x8'));var squel=require(_0x9ea6('0x9'));var crypto=require(_0x9ea6('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9ea6('0xb'));var querystring=require('querystring');var Papa=require(_0x9ea6('0xc'));var Redis=require('ioredis');var authService=require(_0x9ea6('0xd'));var qs=require(_0x9ea6('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9ea6('0xf'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9ea6('0x10'));var licenseUtil=require(_0x9ea6('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x444036,_0x55b8dc){_0x55b8dc=_0x55b8dc||0xcc;return function(_0x11e79c){if(_0x11e79c){return _0x444036['sendStatus'](_0x55b8dc);}return _0x444036[_0x9ea6('0x12')](_0x55b8dc)[_0x9ea6('0x13')]();};}function respondWithResult(_0x3b329c,_0x3ffb45){_0x3ffb45=_0x3ffb45||0xc8;return function(_0x52c5d7){if(_0x52c5d7){return _0x3b329c['status'](_0x3ffb45)['json'](_0x52c5d7);}};}function respondWithFilteredResult(_0xa63fe9,_0x4a9dab){return function(_0x412c89){if(_0x412c89){var _0x10c8b9=typeof _0x4a9dab[_0x9ea6('0x14')]===_0x9ea6('0x15')&&typeof _0x4a9dab[_0x9ea6('0x16')]==='undefined';var _0x5b642d=_0x412c89[_0x9ea6('0x17')];var _0x16a51a=_0x10c8b9?0x0:_0x4a9dab[_0x9ea6('0x14')];var _0x1fba6d=_0x10c8b9?_0x412c89[_0x9ea6('0x17')]:_0x4a9dab['offset']+_0x4a9dab[_0x9ea6('0x16')];var _0x254ccd;if(_0x1fba6d>=_0x5b642d){_0x1fba6d=_0x5b642d;_0x254ccd=0xc8;}else{_0x254ccd=0xce;}_0xa63fe9['status'](_0x254ccd);return _0xa63fe9[_0x9ea6('0x18')]('Content-Range',_0x16a51a+'-'+_0x1fba6d+'/'+_0x5b642d)[_0x9ea6('0x19')](_0x412c89);}return null;};}function patchUpdates(_0xd57783){return function(_0x27fb37){try{jsonpatch[_0x9ea6('0x1a')](_0x27fb37,_0xd57783,!![]);}catch(_0x50c81f){return BPromise[_0x9ea6('0x1b')](_0x50c81f);}return _0x27fb37['save']();};}function saveUpdates(_0xa83f46,_0x471d99){return function(_0x4344f5){if(_0x4344f5){return _0x4344f5[_0x9ea6('0x1c')](_0xa83f46)[_0x9ea6('0x1d')](function(_0x55d803){return _0x55d803;});}return null;};}function removeEntity(_0x566487,_0x3f3364){return function(_0x4d3308){if(_0x4d3308){return _0x4d3308[_0x9ea6('0x1e')]()[_0x9ea6('0x1d')](function(){_0x566487[_0x9ea6('0x12')](0xcc)[_0x9ea6('0x13')]();});}};}function handleEntityNotFound(_0x4de924,_0x4f405f){return function(_0x1573c3){if(!_0x1573c3){_0x4de924[_0x9ea6('0x1f')](0x194);}return _0x1573c3;};}function handleError(_0x356f95,_0x1a757c){_0x1a757c=_0x1a757c||0x1f4;return function(_0x5b9e38){logger[_0x9ea6('0x20')](_0x5b9e38['stack']);if(_0x5b9e38[_0x9ea6('0x21')]){delete _0x5b9e38[_0x9ea6('0x21')];}_0x356f95[_0x9ea6('0x12')](_0x1a757c)[_0x9ea6('0x22')](_0x5b9e38);};}exports[_0x9ea6('0x23')]=function(_0xf600f8,_0x224674){var _0x5aef27={},_0x443a97={},_0x3d7b42={'count':0x0,'rows':[]};var _0x3c965e=_[_0x9ea6('0x24')](db[_0x9ea6('0x25')][_0x9ea6('0x26')],function(_0x23c7cc){return{'name':_0x23c7cc['fieldName'],'type':_0x23c7cc[_0x9ea6('0x27')]['key']};});_0x443a97['model']=_[_0x9ea6('0x24')](_0x3c965e,_0x9ea6('0x21'));_0x443a97[_0x9ea6('0x28')]=_[_0x9ea6('0x29')](_0xf600f8[_0x9ea6('0x28')]);_0x443a97[_0x9ea6('0x2a')]=_[_0x9ea6('0x2b')](_0x443a97['model'],_0x443a97['query']);_0x5aef27['attributes']=_[_0x9ea6('0x2b')](_0x443a97[_0x9ea6('0x2c')],qs[_0x9ea6('0x2d')](_0xf600f8['query'][_0x9ea6('0x2d')]));_0x5aef27[_0x9ea6('0x2e')]=_0x5aef27[_0x9ea6('0x2e')][_0x9ea6('0x2f')]?_0x5aef27[_0x9ea6('0x2e')]:_0x443a97[_0x9ea6('0x2c')];if(!_0xf600f8[_0x9ea6('0x28')]['hasOwnProperty'](_0x9ea6('0x30'))){_0x5aef27[_0x9ea6('0x16')]=qs['limit'](_0xf600f8[_0x9ea6('0x28')]['limit']);_0x5aef27[_0x9ea6('0x14')]=qs[_0x9ea6('0x14')](_0xf600f8[_0x9ea6('0x28')][_0x9ea6('0x14')]);}_0x5aef27[_0x9ea6('0x31')]=qs[_0x9ea6('0x32')](_0xf600f8[_0x9ea6('0x28')]['sort']);_0x5aef27[_0x9ea6('0x33')]=qs[_0x9ea6('0x2a')](_[_0x9ea6('0x34')](_0xf600f8[_0x9ea6('0x28')],_0x443a97[_0x9ea6('0x2a')]),_0x3c965e);if(_0xf600f8['query'][_0x9ea6('0x35')]){_0x5aef27['where']=_['merge'](_0x5aef27['where'],{'$or':_[_0x9ea6('0x24')](_0x3c965e,function(_0x4969e8){if(_0x4969e8['type']!==_0x9ea6('0x36')){var _0x2f7f3e={};_0x2f7f3e[_0x4969e8[_0x9ea6('0x21')]]={'$like':'%'+_0xf600f8[_0x9ea6('0x28')]['filter']+'%'};return _0x2f7f3e;}})});}_0x5aef27=_[_0x9ea6('0x37')]({},_0x5aef27,_0xf600f8[_0x9ea6('0x38')]);var _0x57ea47={'where':_0x5aef27[_0x9ea6('0x33')]};return db['OpenchannelTransferReport']['count'](_0x57ea47)[_0x9ea6('0x1d')](function(_0xb681df){_0x3d7b42[_0x9ea6('0x17')]=_0xb681df;if(_0xf600f8[_0x9ea6('0x28')]['includeAll']){_0x5aef27[_0x9ea6('0x39')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x9ea6('0x3a')](_0x5aef27);})[_0x9ea6('0x1d')](function(_0x37f078){_0x3d7b42[_0x9ea6('0x3b')]=_0x37f078;return _0x3d7b42;})['then'](respondWithFilteredResult(_0x224674,_0x5aef27))[_0x9ea6('0x3c')](handleError(_0x224674,null));};exports[_0x9ea6('0x3d')]=function(_0x4f1ff0,_0x1b935e){var _0x2f3fb4={'raw':!![],'where':{'id':_0x4f1ff0[_0x9ea6('0x3e')]['id']}},_0x339016={};_0x339016[_0x9ea6('0x2c')]=_['keys'](db[_0x9ea6('0x25')]['rawAttributes']);_0x339016[_0x9ea6('0x28')]=_[_0x9ea6('0x29')](_0x4f1ff0[_0x9ea6('0x28')]);_0x339016['filters']=_[_0x9ea6('0x2b')](_0x339016[_0x9ea6('0x2c')],_0x339016['query']);_0x2f3fb4['attributes']=_['intersection'](_0x339016[_0x9ea6('0x2c')],qs[_0x9ea6('0x2d')](_0x4f1ff0['query'][_0x9ea6('0x2d')]));_0x2f3fb4[_0x9ea6('0x2e')]=_0x2f3fb4[_0x9ea6('0x2e')]['length']?_0x2f3fb4[_0x9ea6('0x2e')]:_0x339016['model'];if(_0x4f1ff0['query'][_0x9ea6('0x3f')]){_0x2f3fb4['include']=[{'all':!![]}];}_0x2f3fb4=_[_0x9ea6('0x37')]({},_0x2f3fb4,_0x4f1ff0['options']);return db[_0x9ea6('0x25')]['find'](_0x2f3fb4)[_0x9ea6('0x1d')](handleEntityNotFound(_0x1b935e,null))['then'](respondWithResult(_0x1b935e,null))[_0x9ea6('0x3c')](handleError(_0x1b935e,null));};exports['create']=function(_0x5608a8,_0x46e9b9){return db['OpenchannelTransferReport']['create'](_0x5608a8[_0x9ea6('0x40')],{})[_0x9ea6('0x1d')](respondWithResult(_0x46e9b9,0xc9))['catch'](handleError(_0x46e9b9,null));};exports[_0x9ea6('0x1c')]=function(_0x448844,_0x5c1860){if(_0x448844[_0x9ea6('0x40')]['id']){delete _0x448844[_0x9ea6('0x40')]['id'];}return db[_0x9ea6('0x25')][_0x9ea6('0x41')]({'where':{'id':_0x448844[_0x9ea6('0x3e')]['id']}})[_0x9ea6('0x1d')](handleEntityNotFound(_0x5c1860,null))['then'](saveUpdates(_0x448844[_0x9ea6('0x40')],null))['then'](respondWithResult(_0x5c1860,null))[_0x9ea6('0x3c')](handleError(_0x5c1860,null));};exports[_0x9ea6('0x1e')]=function(_0x48e6ad,_0xaa4604){return db[_0x9ea6('0x25')]['find']({'where':{'id':_0x48e6ad[_0x9ea6('0x3e')]['id']}})[_0x9ea6('0x1d')](handleEntityNotFound(_0xaa4604,null))[_0x9ea6('0x1d')](removeEntity(_0xaa4604,null))['catch'](handleError(_0xaa4604,null));};exports[_0x9ea6('0x42')]=function(_0x2580f0,_0xfb3bdb){return db[_0x9ea6('0x25')]['describe']()[_0x9ea6('0x1d')](respondWithResult(_0xfb3bdb,null))[_0x9ea6('0x3c')](handleError(_0xfb3bdb,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index a44fab9..9401deb 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 _0xb5fd=['request-promise','rimraf','../../config/environment','./openchannelTransferReport.attributes','define','report_openchannel_transfer','uniqueid','../../config/logger','api','bluebird'];(function(_0x3e6c7a,_0x36746a){var _0xa990bb=function(_0x50c3e5){while(--_0x50c3e5){_0x3e6c7a['push'](_0x3e6c7a['shift']());}};_0xa990bb(++_0x36746a);}(_0xb5fd,0x1c9));var _0xdb5f=function(_0x4f139f,_0x150de5){_0x4f139f=_0x4f139f-0x0;var _0x24a88b=_0xb5fd[_0x4f139f];return _0x24a88b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xdb5f('0x0'))(_0xdb5f('0x1'));var moment=require('moment');var BPromise=require(_0xdb5f('0x2'));var rp=require(_0xdb5f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb5f('0x4'));var config=require(_0xdb5f('0x5'));var attributes=require(_0xdb5f('0x6'));module['exports']=function(_0x6d762,_0x5731a2){return _0x6d762[_0xdb5f('0x7')]('OpenchannelTransferReport',attributes,{'tableName':_0xdb5f('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xdb5f('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3c6f=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash'];(function(_0x54bdde,_0x2db916){var _0x445ecc=function(_0x2ed731){while(--_0x2ed731){_0x54bdde['push'](_0x54bdde['shift']());}};_0x445ecc(++_0x2db916);}(_0x3c6f,0x1e0));var _0xf3c6=function(_0x4665f3,_0x1a84a3){_0x4665f3=_0x4665f3-0x0;var _0x1fd002=_0x3c6f[_0x4665f3];return _0x1fd002;};'use strict';var _=require(_0xf3c6('0x0'));var util=require('util');var logger=require(_0xf3c6('0x1'))(_0xf3c6('0x2'));var moment=require(_0xf3c6('0x3'));var BPromise=require(_0xf3c6('0x4'));var rp=require(_0xf3c6('0x5'));var fs=require('fs');var path=require(_0xf3c6('0x6'));var rimraf=require(_0xf3c6('0x7'));var config=require(_0xf3c6('0x8'));var attributes=require('./openchannelTransferReport.attributes');module[_0xf3c6('0x9')]=function(_0xd8f858,_0x2f9fe8){return _0xd8f858['define'](_0xf3c6('0xa'),attributes,{'tableName':_0xf3c6('0xb'),'paranoid':![],'indexes':[{'name':_0xf3c6('0xc'),'fields':[_0xf3c6('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 9b79cad..e7a66b1 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 _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','OpenchannelTransferReport,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4085b1,_0x515b5e){var _0x218dc5=function(_0x70bd3b){while(--_0x70bd3b){_0x4085b1['push'](_0x4085b1['shift']());}};_0x218dc5(++_0x515b5e);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2a0183,_0x3fc93c){_0x2a0183=_0x2a0183-0x0;var _0x158c3a=_0x5fc3[_0x2a0183];return _0x158c3a;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});} \ No newline at end of file +var _0x814b=['info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x1ddedd,_0x485606){var _0xa3e1ac=function(_0x580444){while(--_0x580444){_0x1ddedd['push'](_0x1ddedd['shift']());}};_0xa3e1ac(++_0x485606);}(_0x814b,0x1a2));var _0xb814=function(_0x31a37b,_0x826249){_0x31a37b=_0x31a37b-0x0;var _0x49ae16=_0x814b[_0x31a37b];return _0x49ae16;};'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')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 199ce4d..672b7e9 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 _0xdeab=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x40f142,_0x57d68a){var _0x1b2292=function(_0x228c74){while(--_0x228c74){_0x40f142['push'](_0x40f142['shift']());}};_0x1b2292(++_0x57d68a);}(_0xdeab,0xc0));var _0xbdea=function(_0xc62435,_0x3584e0){_0xc62435=_0xc62435-0x0;var _0x56b63c=_0xdeab[_0xc62435];return _0x56b63c;};'use strict';var multer=require('multer');var util=require(_0xbdea('0x0'));var path=require(_0xbdea('0x1'));var timeout=require('connect-timeout');var express=require(_0xbdea('0x2'));var router=express[_0xbdea('0x3')]();var fs_extra=require(_0xbdea('0x4'));var auth=require(_0xbdea('0x5'));var interaction=require(_0xbdea('0x6'));var config=require(_0xbdea('0x7'));var controller=require('./pause.controller');router[_0xbdea('0x8')]('/',auth[_0xbdea('0x9')](),controller[_0xbdea('0xa')]);router[_0xbdea('0x8')](_0xbdea('0xb'),auth[_0xbdea('0x9')](),controller[_0xbdea('0xc')]);router[_0xbdea('0xd')]('/',auth[_0xbdea('0x9')](),controller[_0xbdea('0xe')]);router[_0xbdea('0xf')]('/:id',auth[_0xbdea('0x9')](),controller[_0xbdea('0x10')]);router['delete'](_0xbdea('0xb'),auth[_0xbdea('0x9')](),controller[_0xbdea('0x11')]);module['exports']=router; \ No newline at end of file +var _0x2fe6=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy','multer','util','path'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0x2fe6,0x1cb));var _0x62fe=function(_0x130b0a,_0x320d01){_0x130b0a=_0x130b0a-0x0;var _0x495e55=_0x2fe6[_0x130b0a];return _0x495e55;};'use strict';var multer=require(_0x62fe('0x0'));var util=require(_0x62fe('0x1'));var path=require(_0x62fe('0x2'));var timeout=require(_0x62fe('0x3'));var express=require(_0x62fe('0x4'));var router=express[_0x62fe('0x5')]();var fs_extra=require(_0x62fe('0x6'));var auth=require(_0x62fe('0x7'));var interaction=require(_0x62fe('0x8'));var config=require(_0x62fe('0x9'));var controller=require(_0x62fe('0xa'));router['get']('/',auth[_0x62fe('0xb')](),controller[_0x62fe('0xc')]);router[_0x62fe('0xd')](_0x62fe('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x62fe('0xf')]('/',auth[_0x62fe('0xb')](),controller[_0x62fe('0x10')]);router[_0x62fe('0x11')]('/:id',auth[_0x62fe('0xb')](),controller[_0x62fe('0x12')]);router[_0x62fe('0x13')](_0x62fe('0xe'),auth[_0x62fe('0xb')](),controller[_0x62fe('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 5862ebf..11da38f 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 _0x3be9=['exports','name','STRING','sequelize'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3be9,0xc3));var _0x93be=function(_0x2f6541,_0x363cba){_0x2f6541=_0x2f6541-0x0;var _0x4d76d8=_0x3be9[_0x2f6541];return _0x4d76d8;};'use strict';var Sequelize=require(_0x93be('0x0'));module[_0x93be('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x93be('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x93be('0x3')]}}; \ No newline at end of file +var _0xc38c=['name','exports','STRING'];(function(_0x18f2bd,_0x431ec2){var _0x1247f4=function(_0x4ae0d9){while(--_0x4ae0d9){_0x18f2bd['push'](_0x18f2bd['shift']());}};_0x1247f4(++_0x431ec2);}(_0xc38c,0x16c));var _0xcc38=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc38c[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xcc38('0x0')]={'name':{'type':Sequelize[_0xcc38('0x1')],'unique':_0xcc38('0x2'),'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 5d69a51..230cea0 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 _0xd7ca=['reject','save','update','then','destroy','Pauses','UserProfileResource','end','error','name','send','index','map','rawAttributes','fieldName','type','keys','filters','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','Pause','findAll','rows','catch','params','length','include','find','create','user','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7ca,0x171));var _0xad7c=function(_0x3db375,_0x5099d3){_0x3db375=_0x3db375-0x0;var _0x490cb9=_0xd7ca[_0x3db375];return _0x490cb9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xad7c('0x0'));var moment=require(_0xad7c('0x1'));var BPromise=require(_0xad7c('0x2'));var Mustache=require(_0xad7c('0x3'));var util=require(_0xad7c('0x4'));var path=require(_0xad7c('0x5'));var sox=require('sox');var csv=require(_0xad7c('0x6'));var ejs=require(_0xad7c('0x7'));var fs=require('fs');var fs_extra=require(_0xad7c('0x8'));var _=require(_0xad7c('0x9'));var squel=require(_0xad7c('0xa'));var crypto=require(_0xad7c('0xb'));var jsforce=require(_0xad7c('0xc'));var deskjs=require(_0xad7c('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xad7c('0xe'));var Redis=require(_0xad7c('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xad7c('0x10'));var logger=require(_0xad7c('0x11'))(_0xad7c('0x12'));var utils=require(_0xad7c('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xad7c('0x14'))['db'];function respondWithStatusCode(_0x9f6693,_0x39df21){_0x39df21=_0x39df21||0xcc;return function(_0x2684c8){if(_0x2684c8){return _0x9f6693[_0xad7c('0x15')](_0x39df21);}return _0x9f6693[_0xad7c('0x16')](_0x39df21)['end']();};}function respondWithResult(_0x35ba8d,_0xd81547){_0xd81547=_0xd81547||0xc8;return function(_0x23247f){if(_0x23247f){return _0x35ba8d[_0xad7c('0x16')](_0xd81547)[_0xad7c('0x17')](_0x23247f);}};}function respondWithFilteredResult(_0x5cc05d,_0x518bab){return function(_0x4ce323){if(_0x4ce323){var _0x48ec67=typeof _0x518bab[_0xad7c('0x18')]===_0xad7c('0x19')&&typeof _0x518bab[_0xad7c('0x1a')]===_0xad7c('0x19');var _0x29080e=_0x4ce323[_0xad7c('0x1b')];var _0x2fdf62=_0x48ec67?0x0:_0x518bab[_0xad7c('0x18')];var _0xaada7b=_0x48ec67?_0x4ce323[_0xad7c('0x1b')]:_0x518bab[_0xad7c('0x18')]+_0x518bab[_0xad7c('0x1a')];var _0x55b12c;if(_0xaada7b>=_0x29080e){_0xaada7b=_0x29080e;_0x55b12c=0xc8;}else{_0x55b12c=0xce;}_0x5cc05d[_0xad7c('0x16')](_0x55b12c);return _0x5cc05d[_0xad7c('0x1c')](_0xad7c('0x1d'),_0x2fdf62+'-'+_0xaada7b+'/'+_0x29080e)['json'](_0x4ce323);}return null;};}function patchUpdates(_0x1ae1ee){return function(_0x2c4289){try{jsonpatch[_0xad7c('0x1e')](_0x2c4289,_0x1ae1ee,!![]);}catch(_0x3a4d80){return BPromise[_0xad7c('0x1f')](_0x3a4d80);}return _0x2c4289[_0xad7c('0x20')]();};}function saveUpdates(_0xac064e,_0x1b4ef0){return function(_0x3f3620){if(_0x3f3620){return _0x3f3620[_0xad7c('0x21')](_0xac064e)[_0xad7c('0x22')](function(_0x40e6e2){return _0x40e6e2;});}return null;};}function removeEntity(_0x394507,_0x2e8598){return function(_0x365ac0){if(_0x365ac0){return _0x365ac0[_0xad7c('0x23')]()[_0xad7c('0x22')](function(){var _0x110d59=_0x365ac0['get']({'plain':!![]});var _0x201591=_0xad7c('0x24');return db[_0xad7c('0x25')]['destroy']({'where':{'type':_0x201591,'resourceId':_0x110d59['id']}})[_0xad7c('0x22')](function(){return _0x365ac0;});})[_0xad7c('0x22')](function(){_0x394507['status'](0xcc)[_0xad7c('0x26')]();});}};}function handleEntityNotFound(_0x7cfcfd,_0x5105d8){return function(_0x452398){if(!_0x452398){_0x7cfcfd[_0xad7c('0x15')](0x194);}return _0x452398;};}function handleError(_0x4e12a5,_0x25acc3){_0x25acc3=_0x25acc3||0x1f4;return function(_0x503594){logger[_0xad7c('0x27')](_0x503594['stack']);if(_0x503594[_0xad7c('0x28')]){delete _0x503594[_0xad7c('0x28')];}_0x4e12a5[_0xad7c('0x16')](_0x25acc3)[_0xad7c('0x29')](_0x503594);};}exports[_0xad7c('0x2a')]=function(_0x267c54,_0xb0c771){var _0x4aa24c={},_0x3e3ead={},_0x35354d={'count':0x0,'rows':[]};var _0x32761e=_[_0xad7c('0x2b')](db['Pause'][_0xad7c('0x2c')],function(_0x5673a0){return{'name':_0x5673a0[_0xad7c('0x2d')],'type':_0x5673a0[_0xad7c('0x2e')]['key']};});_0x3e3ead['model']=_[_0xad7c('0x2b')](_0x32761e,_0xad7c('0x28'));_0x3e3ead['query']=_[_0xad7c('0x2f')](_0x267c54['query']);_0x3e3ead[_0xad7c('0x30')]=_['intersection'](_0x3e3ead[_0xad7c('0x31')],_0x3e3ead[_0xad7c('0x32')]);_0x4aa24c[_0xad7c('0x33')]=_[_0xad7c('0x34')](_0x3e3ead[_0xad7c('0x31')],qs[_0xad7c('0x35')](_0x267c54[_0xad7c('0x32')][_0xad7c('0x35')]));_0x4aa24c['attributes']=_0x4aa24c[_0xad7c('0x33')]['length']?_0x4aa24c[_0xad7c('0x33')]:_0x3e3ead[_0xad7c('0x31')];if(!_0x267c54['query'][_0xad7c('0x36')](_0xad7c('0x37'))){_0x4aa24c[_0xad7c('0x1a')]=qs[_0xad7c('0x1a')](_0x267c54[_0xad7c('0x32')][_0xad7c('0x1a')]);_0x4aa24c[_0xad7c('0x18')]=qs['offset'](_0x267c54[_0xad7c('0x32')][_0xad7c('0x18')]);}_0x4aa24c[_0xad7c('0x38')]=qs[_0xad7c('0x39')](_0x267c54[_0xad7c('0x32')][_0xad7c('0x39')]);_0x4aa24c[_0xad7c('0x3a')]=qs[_0xad7c('0x30')](_[_0xad7c('0x3b')](_0x267c54[_0xad7c('0x32')],_0x3e3ead[_0xad7c('0x30')]),_0x32761e);if(_0x267c54[_0xad7c('0x32')][_0xad7c('0x3c')]){_0x4aa24c[_0xad7c('0x3a')]=_['merge'](_0x4aa24c[_0xad7c('0x3a')],{'$or':_['map'](_0x32761e,function(_0xdb2d3e){if(_0xdb2d3e[_0xad7c('0x2e')]!==_0xad7c('0x3d')){var _0x47426d={};_0x47426d[_0xdb2d3e[_0xad7c('0x28')]]={'$like':'%'+_0x267c54[_0xad7c('0x32')][_0xad7c('0x3c')]+'%'};return _0x47426d;}})});}_0x4aa24c=_[_0xad7c('0x3e')]({},_0x4aa24c,_0x267c54[_0xad7c('0x3f')]);var _0x1e37f9={'where':_0x4aa24c[_0xad7c('0x3a')]};return db['Pause'][_0xad7c('0x1b')](_0x1e37f9)[_0xad7c('0x22')](function(_0x2ad8d4){_0x35354d[_0xad7c('0x1b')]=_0x2ad8d4;if(_0x267c54[_0xad7c('0x32')][_0xad7c('0x40')]){_0x4aa24c['include']=[{'all':!![]}];}return db[_0xad7c('0x41')][_0xad7c('0x42')](_0x4aa24c);})[_0xad7c('0x22')](function(_0x2b86d1){_0x35354d[_0xad7c('0x43')]=_0x2b86d1;return _0x35354d;})[_0xad7c('0x22')](respondWithFilteredResult(_0xb0c771,_0x4aa24c))[_0xad7c('0x44')](handleError(_0xb0c771,null));};exports['show']=function(_0xd7af88,_0x141249){var _0x3984b7={'raw':!![],'where':{'id':_0xd7af88[_0xad7c('0x45')]['id']}},_0x5bc83b={};_0x5bc83b[_0xad7c('0x31')]=_[_0xad7c('0x2f')](db[_0xad7c('0x41')][_0xad7c('0x2c')]);_0x5bc83b[_0xad7c('0x32')]=_[_0xad7c('0x2f')](_0xd7af88[_0xad7c('0x32')]);_0x5bc83b[_0xad7c('0x30')]=_[_0xad7c('0x34')](_0x5bc83b[_0xad7c('0x31')],_0x5bc83b[_0xad7c('0x32')]);_0x3984b7[_0xad7c('0x33')]=_[_0xad7c('0x34')](_0x5bc83b[_0xad7c('0x31')],qs[_0xad7c('0x35')](_0xd7af88[_0xad7c('0x32')][_0xad7c('0x35')]));_0x3984b7['attributes']=_0x3984b7[_0xad7c('0x33')][_0xad7c('0x46')]?_0x3984b7['attributes']:_0x5bc83b['model'];if(_0xd7af88[_0xad7c('0x32')]['includeAll']){_0x3984b7[_0xad7c('0x47')]=[{'all':!![]}];}_0x3984b7=_[_0xad7c('0x3e')]({},_0x3984b7,_0xd7af88[_0xad7c('0x3f')]);return db[_0xad7c('0x41')][_0xad7c('0x48')](_0x3984b7)[_0xad7c('0x22')](handleEntityNotFound(_0x141249,null))['then'](respondWithResult(_0x141249,null))['catch'](handleError(_0x141249,null));};exports[_0xad7c('0x49')]=function(_0x1dd875,_0xd3a6e3){return db[_0xad7c('0x41')][_0xad7c('0x49')](_0x1dd875['body'],{})[_0xad7c('0x22')](function(_0x421a11){var _0x6ed308=_0x1dd875[_0xad7c('0x4a')][_0xad7c('0x4b')]({'plain':!![]});if(!_0x6ed308)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x6ed308['role']===_0xad7c('0x4a')){var _0x4bcdc5=_0x421a11[_0xad7c('0x4b')]({'plain':!![]});var _0x5a5219=_0xad7c('0x24');return db['UserProfileSection'][_0xad7c('0x48')]({'where':{'name':_0x5a5219,'userProfileId':_0x6ed308[_0xad7c('0x4c')]},'raw':!![]})[_0xad7c('0x22')](function(_0x4b6082){if(_0x4b6082&&_0x4b6082[_0xad7c('0x4d')]===0x0){return db['UserProfileResource'][_0xad7c('0x49')]({'name':_0x4bcdc5[_0xad7c('0x28')],'resourceId':_0x4bcdc5['id'],'type':_0x4b6082[_0xad7c('0x28')],'sectionId':_0x4b6082['id']},{})[_0xad7c('0x22')](function(){return _0x421a11;});}else{return _0x421a11;}})['catch'](function(_0x526828){logger[_0xad7c('0x27')](_0xad7c('0x4e'),_0x526828);throw _0x526828;});}return _0x421a11;})[_0xad7c('0x22')](respondWithResult(_0xd3a6e3,0xc9))[_0xad7c('0x44')](handleError(_0xd3a6e3,null));};exports['update']=function(_0x497955,_0x308140){if(_0x497955[_0xad7c('0x4f')]['id']){delete _0x497955[_0xad7c('0x4f')]['id'];}return db[_0xad7c('0x41')]['find']({'where':{'id':_0x497955[_0xad7c('0x45')]['id']}})[_0xad7c('0x22')](handleEntityNotFound(_0x308140,null))[_0xad7c('0x22')](saveUpdates(_0x497955[_0xad7c('0x4f')],null))['then'](respondWithResult(_0x308140,null))[_0xad7c('0x44')](handleError(_0x308140,null));};exports[_0xad7c('0x23')]=function(_0x267ffd,_0x4bd15a){return db['Pause'][_0xad7c('0x48')]({'where':{'id':_0x267ffd['params']['id']}})[_0xad7c('0x22')](handleEntityNotFound(_0x4bd15a,null))[_0xad7c('0x22')](removeEntity(_0x4bd15a,null))[_0xad7c('0x44')](handleError(_0x4bd15a,null));}; \ No newline at end of file +var _0xf7ce=['Pauses','error','stack','send','index','Pause','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','VIRTUAL','name','filter','options','includeAll','include','findAll','rows','catch','params','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x11817f,_0x2c37ef){var _0x4f444b=function(_0x970a5b){while(--_0x970a5b){_0x11817f['push'](_0x11817f['shift']());}};_0x4f444b(++_0x2c37ef);}(_0xf7ce,0x1d6));var _0xef7c=function(_0x1d4923,_0x4e222f){_0x1d4923=_0x1d4923-0x0;var _0x14ea9a=_0xf7ce[_0x1d4923];return _0x14ea9a;};'use strict';var emlformat=require(_0xef7c('0x0'));var rimraf=require(_0xef7c('0x1'));var zipdir=require(_0xef7c('0x2'));var jsonpatch=require(_0xef7c('0x3'));var rp=require(_0xef7c('0x4'));var moment=require(_0xef7c('0x5'));var BPromise=require(_0xef7c('0x6'));var Mustache=require(_0xef7c('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xef7c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xef7c('0x9'));var _=require(_0xef7c('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xef7c('0xb'));var deskjs=require(_0xef7c('0xc'));var toCsv=require(_0xef7c('0x8'));var querystring=require(_0xef7c('0xd'));var Papa=require(_0xef7c('0xe'));var Redis=require(_0xef7c('0xf'));var authService=require(_0xef7c('0x10'));var qs=require(_0xef7c('0x11'));var as=require(_0xef7c('0x12'));var hardwareService=require(_0xef7c('0x13'));var logger=require(_0xef7c('0x14'))(_0xef7c('0x15'));var utils=require(_0xef7c('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xef7c('0x17'));var db=require(_0xef7c('0x18'))['db'];function respondWithStatusCode(_0x1b2737,_0x203f8d){_0x203f8d=_0x203f8d||0xcc;return function(_0xdac3db){if(_0xdac3db){return _0x1b2737[_0xef7c('0x19')](_0x203f8d);}return _0x1b2737[_0xef7c('0x1a')](_0x203f8d)[_0xef7c('0x1b')]();};}function respondWithResult(_0x43cbe3,_0x115e23){_0x115e23=_0x115e23||0xc8;return function(_0x4552e0){if(_0x4552e0){return _0x43cbe3[_0xef7c('0x1a')](_0x115e23)[_0xef7c('0x1c')](_0x4552e0);}};}function respondWithFilteredResult(_0x153135,_0x222cff){return function(_0x14071){if(_0x14071){var _0x43c749=typeof _0x222cff['offset']==='undefined'&&typeof _0x222cff[_0xef7c('0x1d')]==='undefined';var _0x283d6a=_0x14071[_0xef7c('0x1e')];var _0x31f9c4=_0x43c749?0x0:_0x222cff[_0xef7c('0x1f')];var _0x381dff=_0x43c749?_0x14071[_0xef7c('0x1e')]:_0x222cff[_0xef7c('0x1f')]+_0x222cff[_0xef7c('0x1d')];var _0x290330;if(_0x381dff>=_0x283d6a){_0x381dff=_0x283d6a;_0x290330=0xc8;}else{_0x290330=0xce;}_0x153135[_0xef7c('0x1a')](_0x290330);return _0x153135[_0xef7c('0x20')](_0xef7c('0x21'),_0x31f9c4+'-'+_0x381dff+'/'+_0x283d6a)[_0xef7c('0x1c')](_0x14071);}return null;};}function patchUpdates(_0x347dc0){return function(_0x1366bd){try{jsonpatch[_0xef7c('0x22')](_0x1366bd,_0x347dc0,!![]);}catch(_0x5f2fdd){return BPromise[_0xef7c('0x23')](_0x5f2fdd);}return _0x1366bd[_0xef7c('0x24')]();};}function saveUpdates(_0xc697f9,_0x115a36){return function(_0x108eed){if(_0x108eed){return _0x108eed[_0xef7c('0x25')](_0xc697f9)[_0xef7c('0x26')](function(_0x4acdc5){return _0x4acdc5;});}return null;};}function removeEntity(_0x6f0835,_0x25e516){return function(_0x1f0d87){if(_0x1f0d87){return _0x1f0d87[_0xef7c('0x27')]()['then'](function(){var _0x35b1c3=_0x1f0d87['get']({'plain':!![]});var _0x27691c=_0xef7c('0x28');return db['UserProfileResource'][_0xef7c('0x27')]({'where':{'type':_0x27691c,'resourceId':_0x35b1c3['id']}})['then'](function(){return _0x1f0d87;});})[_0xef7c('0x26')](function(){_0x6f0835[_0xef7c('0x1a')](0xcc)[_0xef7c('0x1b')]();});}};}function handleEntityNotFound(_0x286826,_0x4daa1f){return function(_0x1081b1){if(!_0x1081b1){_0x286826[_0xef7c('0x19')](0x194);}return _0x1081b1;};}function handleError(_0x57aca7,_0x163382){_0x163382=_0x163382||0x1f4;return function(_0x450368){logger[_0xef7c('0x29')](_0x450368[_0xef7c('0x2a')]);if(_0x450368['name']){delete _0x450368['name'];}_0x57aca7[_0xef7c('0x1a')](_0x163382)[_0xef7c('0x2b')](_0x450368);};}exports[_0xef7c('0x2c')]=function(_0x523aef,_0x2695b9){var _0x102a6e={},_0x1c009e={},_0x5416fe={'count':0x0,'rows':[]};var _0x5cc6da=_['map'](db[_0xef7c('0x2d')][_0xef7c('0x2e')],function(_0x281d7c){return{'name':_0x281d7c[_0xef7c('0x2f')],'type':_0x281d7c[_0xef7c('0x30')][_0xef7c('0x31')]};});_0x1c009e[_0xef7c('0x32')]=_[_0xef7c('0x33')](_0x5cc6da,'name');_0x1c009e[_0xef7c('0x34')]=_[_0xef7c('0x35')](_0x523aef[_0xef7c('0x34')]);_0x1c009e['filters']=_[_0xef7c('0x36')](_0x1c009e['model'],_0x1c009e[_0xef7c('0x34')]);_0x102a6e[_0xef7c('0x37')]=_['intersection'](_0x1c009e[_0xef7c('0x32')],qs[_0xef7c('0x38')](_0x523aef[_0xef7c('0x34')]['fields']));_0x102a6e['attributes']=_0x102a6e[_0xef7c('0x37')][_0xef7c('0x39')]?_0x102a6e[_0xef7c('0x37')]:_0x1c009e['model'];if(!_0x523aef[_0xef7c('0x34')][_0xef7c('0x3a')]('nolimit')){_0x102a6e[_0xef7c('0x1d')]=qs['limit'](_0x523aef[_0xef7c('0x34')][_0xef7c('0x1d')]);_0x102a6e[_0xef7c('0x1f')]=qs['offset'](_0x523aef[_0xef7c('0x34')][_0xef7c('0x1f')]);}_0x102a6e[_0xef7c('0x3b')]=qs[_0xef7c('0x3c')](_0x523aef[_0xef7c('0x34')][_0xef7c('0x3c')]);_0x102a6e[_0xef7c('0x3d')]=qs[_0xef7c('0x3e')](_[_0xef7c('0x3f')](_0x523aef['query'],_0x1c009e[_0xef7c('0x3e')]),_0x5cc6da);if(_0x523aef[_0xef7c('0x34')]['filter']){_0x102a6e[_0xef7c('0x3d')]=_['merge'](_0x102a6e['where'],{'$or':_[_0xef7c('0x33')](_0x5cc6da,function(_0x21edd6){if(_0x21edd6[_0xef7c('0x30')]!==_0xef7c('0x40')){var _0x495839={};_0x495839[_0x21edd6[_0xef7c('0x41')]]={'$like':'%'+_0x523aef[_0xef7c('0x34')][_0xef7c('0x42')]+'%'};return _0x495839;}})});}_0x102a6e=_['merge']({},_0x102a6e,_0x523aef[_0xef7c('0x43')]);var _0x3d4f28={'where':_0x102a6e[_0xef7c('0x3d')]};return db[_0xef7c('0x2d')][_0xef7c('0x1e')](_0x3d4f28)[_0xef7c('0x26')](function(_0x473a52){_0x5416fe[_0xef7c('0x1e')]=_0x473a52;if(_0x523aef[_0xef7c('0x34')][_0xef7c('0x44')]){_0x102a6e[_0xef7c('0x45')]=[{'all':!![]}];}return db[_0xef7c('0x2d')][_0xef7c('0x46')](_0x102a6e);})['then'](function(_0x27b829){_0x5416fe[_0xef7c('0x47')]=_0x27b829;return _0x5416fe;})[_0xef7c('0x26')](respondWithFilteredResult(_0x2695b9,_0x102a6e))[_0xef7c('0x48')](handleError(_0x2695b9,null));};exports['show']=function(_0x3d2d96,_0x39acce){var _0x5d7761={'raw':!![],'where':{'id':_0x3d2d96[_0xef7c('0x49')]['id']}},_0x447d47={};_0x447d47[_0xef7c('0x32')]=_[_0xef7c('0x35')](db[_0xef7c('0x2d')][_0xef7c('0x2e')]);_0x447d47[_0xef7c('0x34')]=_[_0xef7c('0x35')](_0x3d2d96[_0xef7c('0x34')]);_0x447d47[_0xef7c('0x3e')]=_[_0xef7c('0x36')](_0x447d47[_0xef7c('0x32')],_0x447d47[_0xef7c('0x34')]);_0x5d7761[_0xef7c('0x37')]=_['intersection'](_0x447d47[_0xef7c('0x32')],qs[_0xef7c('0x38')](_0x3d2d96['query'][_0xef7c('0x38')]));_0x5d7761['attributes']=_0x5d7761['attributes'][_0xef7c('0x39')]?_0x5d7761['attributes']:_0x447d47[_0xef7c('0x32')];if(_0x3d2d96['query']['includeAll']){_0x5d7761[_0xef7c('0x45')]=[{'all':!![]}];}_0x5d7761=_[_0xef7c('0x4a')]({},_0x5d7761,_0x3d2d96[_0xef7c('0x43')]);return db[_0xef7c('0x2d')]['find'](_0x5d7761)[_0xef7c('0x26')](handleEntityNotFound(_0x39acce,null))[_0xef7c('0x26')](respondWithResult(_0x39acce,null))[_0xef7c('0x48')](handleError(_0x39acce,null));};exports[_0xef7c('0x4b')]=function(_0x51939a,_0x5259a1){return db[_0xef7c('0x2d')][_0xef7c('0x4b')](_0x51939a[_0xef7c('0x4c')],{})[_0xef7c('0x26')](function(_0x5f23a3){var _0x3f6eaa=_0x51939a[_0xef7c('0x4d')]['get']({'plain':!![]});if(!_0x3f6eaa)throw new Error(_0xef7c('0x4e'));if(_0x3f6eaa['role']===_0xef7c('0x4d')){var _0x2f25a2=_0x5f23a3['get']({'plain':!![]});var _0x2ec430=_0xef7c('0x28');return db[_0xef7c('0x4f')][_0xef7c('0x50')]({'where':{'name':_0x2ec430,'userProfileId':_0x3f6eaa[_0xef7c('0x51')]},'raw':!![]})[_0xef7c('0x26')](function(_0x462fb7){if(_0x462fb7&&_0x462fb7[_0xef7c('0x52')]===0x0){return db[_0xef7c('0x53')][_0xef7c('0x4b')]({'name':_0x2f25a2[_0xef7c('0x41')],'resourceId':_0x2f25a2['id'],'type':_0x462fb7[_0xef7c('0x41')],'sectionId':_0x462fb7['id']},{})[_0xef7c('0x26')](function(){return _0x5f23a3;});}else{return _0x5f23a3;}})['catch'](function(_0x99679c){logger[_0xef7c('0x29')](_0xef7c('0x54'),_0x99679c);throw _0x99679c;});}return _0x5f23a3;})['then'](respondWithResult(_0x5259a1,0xc9))[_0xef7c('0x48')](handleError(_0x5259a1,null));};exports['update']=function(_0x57ffb2,_0x109a20){if(_0x57ffb2['body']['id']){delete _0x57ffb2['body']['id'];}return db[_0xef7c('0x2d')][_0xef7c('0x50')]({'where':{'id':_0x57ffb2[_0xef7c('0x49')]['id']}})[_0xef7c('0x26')](handleEntityNotFound(_0x109a20,null))[_0xef7c('0x26')](saveUpdates(_0x57ffb2[_0xef7c('0x4c')],null))['then'](respondWithResult(_0x109a20,null))[_0xef7c('0x48')](handleError(_0x109a20,null));};exports[_0xef7c('0x27')]=function(_0x25f6bd,_0x1dcbbe){return db[_0xef7c('0x2d')][_0xef7c('0x50')]({'where':{'id':_0x25f6bd[_0xef7c('0x49')]['id']}})[_0xef7c('0x26')](handleEntityNotFound(_0x1dcbbe,null))['then'](removeEntity(_0x1dcbbe,null))['catch'](handleError(_0x1dcbbe,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 4ff0f32..8e30aa5 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 _0x7217=['../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x28394f,_0x5ebdd2){var _0x2618d2=function(_0x2ffed6){while(--_0x2ffed6){_0x28394f['push'](_0x28394f['shift']());}};_0x2618d2(++_0x5ebdd2);}(_0x7217,0x19e));var _0x7721=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x7217[_0x32d457];return _0x338386;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var 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':'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 27b8014..4f0762b 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 _0x7a54=['message','request\x20sent','result','catch','Pause','find','options','raw','where','attributes','map','include','model','ShowPause','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Pause,\x20%s,\x20%s','debug','stringify','error','code'];(function(_0x4d5aa3,_0x13433b){var _0x3440fe=function(_0x2cc05){while(--_0x2cc05){_0x4d5aa3['push'](_0x4d5aa3['shift']());}};_0x3440fe(++_0x13433b);}(_0x7a54,0x106));var _0x47a5=function(_0x16c76e,_0x554243){_0x16c76e=_0x16c76e-0x0;var _0x3942eb=_0x7a54[_0x16c76e];return _0x3942eb;};'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')]('Pause,\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['ShowPause']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['include']?_[_0x47a5('0x1b')](_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1c')],function(_0x7a9f9e){return{'model':db[_0x7a9f9e['model']],'as':_0x7a9f9e['as'],'attributes':_0x7a9f9e[_0x47a5('0x1a')],'include':_0x7a9f9e[_0x47a5('0x1c')]?_['map'](_0x7a9f9e[_0x47a5('0x1c')],function(_0xc4cd63){return{'model':db[_0xc4cd63[_0x47a5('0x1d')]],'as':_0xc4cd63['as'],'attributes':_0xc4cd63[_0x47a5('0x1a')],'include':_0xc4cd63[_0x47a5('0x1c')]?_['map'](_0xc4cd63['include'],function(_0x136745){return{'model':db[_0x136745['model']],'as':_0x136745['as'],'attributes':_0x136745[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x23cb77){logger[_0x47a5('0xb')](_0x47a5('0x1e'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1e'),_0x5247fd,JSON[_0x47a5('0xe')](_0x23cb77));_0xaf70a6(_0x23cb77);})[_0x47a5('0x14')](function(_0x136b14){logger[_0x47a5('0xf')](_0x47a5('0x1e'),_0x136b14[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x136b14[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x4275d7,_0x3b0d23){var _0x3196af=function(_0x525f1c){while(--_0x525f1c){_0x4275d7['push'](_0x4275d7['shift']());}};_0x3196af(++_0x3b0d23);}(_0xb10b,0x12a));var _0xbb10=function(_0x18d710,_0x153c7c){_0x18d710=_0x18d710-0x0;var _0x54f4eb=_0xb10b[_0x18d710];return _0x54f4eb;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 803a2d0..f8a6d9c 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 _0xda55=['diskStorage','join','server/files/plugins','originalname','replace','format','%s-%s%s','now','extname','post','single','file','webhookPost','put','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','isAuthenticated','get','/webhook','webhookGet','/:id','show','download'];(function(_0x414b48,_0x27550e){var _0x4c2226=function(_0x21afc3){while(--_0x21afc3){_0x414b48['push'](_0x414b48['shift']());}};_0x4c2226(++_0x27550e);}(_0xda55,0x6d));var _0x5da5=function(_0x28e74e,_0x53fdf1){_0x28e74e=_0x28e74e-0x0;var _0xb45ac1=_0xda55[_0x28e74e];return _0xb45ac1;};'use strict';var multer=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5da5('0x2'));var router=express[_0x5da5('0x3')]();var fs_extra=require(_0x5da5('0x4'));var auth=require(_0x5da5('0x5'));var interaction=require(_0x5da5('0x6'));var config=require('../../config/environment');var controller=require(_0x5da5('0x7'));router['get']('/',auth[_0x5da5('0x8')](),controller['index']);router[_0x5da5('0x9')](_0x5da5('0xa'),controller[_0x5da5('0xb')]);router[_0x5da5('0x9')](_0x5da5('0xc'),auth[_0x5da5('0x8')](),controller[_0x5da5('0xd')]);router[_0x5da5('0x9')]('/:id/download',auth[_0x5da5('0x8')](),controller[_0x5da5('0xe')]);var upload=multer({'storage':multer[_0x5da5('0xf')]({'destination':function(_0x26fbe3,_0x1a047e,_0x2a361c){_0x2a361c(null,path[_0x5da5('0x10')](config['root'],_0x5da5('0x11')));},'filename':function(_0x3b5ff9,_0x4f813b,_0x37aeb0){_0x4f813b[_0x5da5('0x12')]=_0x4f813b[_0x5da5('0x12')][_0x5da5('0x13')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x37aeb0(null,util[_0x5da5('0x14')](_0x5da5('0x15'),path['basename'](_0x4f813b['originalname'],path['extname'](_0x4f813b[_0x5da5('0x12')])),Date[_0x5da5('0x16')](),path[_0x5da5('0x17')](_0x4f813b[_0x5da5('0x12')])));}})});router[_0x5da5('0x18')]('/',upload[_0x5da5('0x19')](_0x5da5('0x1a')),controller['upload']);router[_0x5da5('0x18')](_0x5da5('0xa'),controller[_0x5da5('0x1b')]);router[_0x5da5('0x1c')](_0x5da5('0xc'),auth[_0x5da5('0x8')](),controller['update']);router[_0x5da5('0x1d')](_0x5da5('0xc'),auth[_0x5da5('0x8')](),controller[_0x5da5('0x1d')]);module[_0x5da5('0x1e')]=router; \ No newline at end of file +var _0x8d0e=['basename','extname','now','post','file','upload','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','index','get','/webhook','webhookGet','/:id','isAuthenticated','show','/:id/download','download','join','root','server/files/plugins','originalname','replace'];(function(_0x4d52a3,_0x427a08){var _0x48915e=function(_0x5ee62e){while(--_0x5ee62e){_0x4d52a3['push'](_0x4d52a3['shift']());}};_0x48915e(++_0x427a08);}(_0x8d0e,0x1d7));var _0xe8d0=function(_0x5a497b,_0x5518e3){_0x5a497b=_0x5a497b-0x0;var _0x87db6=_0x8d0e[_0x5a497b];return _0x87db6;};'use strict';var multer=require(_0xe8d0('0x0'));var util=require(_0xe8d0('0x1'));var path=require(_0xe8d0('0x2'));var timeout=require(_0xe8d0('0x3'));var express=require(_0xe8d0('0x4'));var router=express[_0xe8d0('0x5')]();var fs_extra=require(_0xe8d0('0x6'));var auth=require(_0xe8d0('0x7'));var interaction=require(_0xe8d0('0x8'));var config=require('../../config/environment');var controller=require(_0xe8d0('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xe8d0('0xa')]);router[_0xe8d0('0xb')](_0xe8d0('0xc'),controller[_0xe8d0('0xd')]);router[_0xe8d0('0xb')](_0xe8d0('0xe'),auth[_0xe8d0('0xf')](),controller[_0xe8d0('0x10')]);router['get'](_0xe8d0('0x11'),auth[_0xe8d0('0xf')](),controller[_0xe8d0('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x580aab,_0x42e0c2,_0x25e6b8){_0x25e6b8(null,path[_0xe8d0('0x13')](config[_0xe8d0('0x14')],_0xe8d0('0x15')));},'filename':function(_0x41de69,_0x5934b2,_0x38fac0){_0x5934b2[_0xe8d0('0x16')]=_0x5934b2['originalname'][_0xe8d0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x38fac0(null,util['format']('%s-%s%s',path[_0xe8d0('0x18')](_0x5934b2[_0xe8d0('0x16')],path[_0xe8d0('0x19')](_0x5934b2[_0xe8d0('0x16')])),Date[_0xe8d0('0x1a')](),path[_0xe8d0('0x19')](_0x5934b2['originalname'])));}})});router[_0xe8d0('0x1b')]('/',upload['single'](_0xe8d0('0x1c')),controller[_0xe8d0('0x1d')]);router[_0xe8d0('0x1b')]('/webhook',controller['webhookPost']);router['put'](_0xe8d0('0xe'),auth[_0xe8d0('0xf')](),controller[_0xe8d0('0x1e')]);router[_0xe8d0('0x1f')](_0xe8d0('0xe'),auth['isAuthenticated'](),controller[_0xe8d0('0x1f')]);module[_0xe8d0('0x20')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index fe1f4fb..80d37eb 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 _0x48bf=['never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','agentOnly'];(function(_0x5d3f22,_0x1064bf){var _0x3d3a25=function(_0x3e4b63){while(--_0x3e4b63){_0x5d3f22['push'](_0x5d3f22['shift']());}};_0x3d3a25(++_0x1064bf);}(_0x48bf,0x92));var _0xf48b=function(_0x3a7fe5,_0x371426){_0x3a7fe5=_0x3a7fe5-0x0;var _0x18ed66=_0x48bf[_0x3a7fe5];return _0x18ed66;};'use strict';var Sequelize=require(_0xf48b('0x0'));module[_0xf48b('0x1')]={'name':{'type':Sequelize[_0xf48b('0x2')]},'type':{'type':Sequelize[_0xf48b('0x3')](_0xf48b('0x4'),_0xf48b('0x5'))},'description':{'type':Sequelize[_0xf48b('0x6')]},'version':{'type':Sequelize[_0xf48b('0x6')]},'path':{'type':Sequelize[_0xf48b('0x2')],'comment':_0xf48b('0x7')},'active':{'type':Sequelize[_0xf48b('0x8')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xf48b('0x3')]('adminOnly',_0xf48b('0x9'),'always',_0xf48b('0xa')),'defaultValue':_0xf48b('0xb'),'comment':_0xf48b('0xc')},'icon':{'type':Sequelize[_0xf48b('0x2')]},'adminUrl':{'type':Sequelize[_0xf48b('0x2')]},'agentUrl':{'type':Sequelize[_0xf48b('0x2')]},'scriptName':{'type':Sequelize[_0xf48b('0x2')]},'scriptPath':{'type':Sequelize[_0xf48b('0x2')]}}; \ No newline at end of file +var _0xb86c=['STRING','ENUM','html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','sequelize','exports'];(function(_0x1e993d,_0x1c7fc8){var _0x14db39=function(_0xd89cb9){while(--_0xd89cb9){_0x1e993d['push'](_0x1e993d['shift']());}};_0x14db39(++_0x1c7fc8);}(_0xb86c,0x1c5));var _0xcb86=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xb86c[_0x59c301];return _0x3866b9;};'use strict';var Sequelize=require(_0xcb86('0x0'));module[_0xcb86('0x1')]={'name':{'type':Sequelize[_0xcb86('0x2')]},'type':{'type':Sequelize[_0xcb86('0x3')](_0xcb86('0x4'),'script')},'description':{'type':Sequelize[_0xcb86('0x5')]},'version':{'type':Sequelize[_0xcb86('0x5')]},'path':{'type':Sequelize[_0xcb86('0x2')],'comment':_0xcb86('0x6')},'active':{'type':Sequelize[_0xcb86('0x7')],'defaultValue':0x0,'comment':_0xcb86('0x8')},'sidebar':{'type':Sequelize[_0xcb86('0x3')](_0xcb86('0x9'),_0xcb86('0xa'),_0xcb86('0xb'),_0xcb86('0xc')),'defaultValue':_0xcb86('0xb'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0xcb86('0x2')]},'adminUrl':{'type':Sequelize[_0xcb86('0x2')]},'agentUrl':{'type':Sequelize[_0xcb86('0x2')]},'scriptName':{'type':Sequelize[_0xcb86('0x2')]},'scriptPath':{'type':Sequelize[_0xcb86('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index ce541a0..6eab5f2 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 _0x0d07=['scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','html','plugins','test','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','encoding','method','%s%s','headers','content-length','endsWith','statusCode','webhookPost','http://localhost:','content-type','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','papaparse','extract-zip','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','./plugin.socket','register','sendStatus','json','offset','undefined','count','limit','status','set','Content-Range','reject','destroy','get','Plugins','UserProfileResource','then','end','error','stack','name','index','map','Plugin','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','show','find','catch','download','params','join','root','server/files/plugins','%s.zip','basename','createWriteStream','zip','warning','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','dirname','attachments/**/*','Sequelize','Plugin\x20not\x20found','format','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','info','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','lstatSync','isFile','Invalid\x20plugin\x20structure','isDirectory','some','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing'];(function(_0x2791aa,_0x26a4c0){var _0x43b95a=function(_0x18b43b){while(--_0x18b43b){_0x2791aa['push'](_0x2791aa['shift']());}};_0x43b95a(++_0x26a4c0);}(_0x0d07,0x16f));var _0x70d0=function(_0x41aed2,_0x5320c3){_0x41aed2=_0x41aed2-0x0;var _0x114230=_0x0d07[_0x41aed2];return _0x114230;};'use strict';var emlformat=require(_0x70d0('0x0'));var rimraf=require(_0x70d0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x70d0('0x2'));var rp=require(_0x70d0('0x3'));var moment=require(_0x70d0('0x4'));var BPromise=require(_0x70d0('0x5'));var Mustache=require(_0x70d0('0x6'));var util=require(_0x70d0('0x7'));var path=require(_0x70d0('0x8'));var sox=require(_0x70d0('0x9'));var csv=require(_0x70d0('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x70d0('0xb'));var squel=require(_0x70d0('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x70d0('0xa'));var querystring=require('querystring');var Papa=require(_0x70d0('0xd'));var extract=require(_0x70d0('0xe'));var rimraf=require(_0x70d0('0x1'));var archiver=require('archiver');var Redis=require(_0x70d0('0xf'));var authService=require(_0x70d0('0x10'));var qs=require(_0x70d0('0x11'));var as=require(_0x70d0('0x12'));var hardwareService=require(_0x70d0('0x13'));var logger=require(_0x70d0('0x14'))('api');var utils=require(_0x70d0('0x15'));var config=require(_0x70d0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x70d0('0x17'))['db'];config['redis']=_[_0x70d0('0x18')](config[_0x70d0('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x70d0('0x19')]));require(_0x70d0('0x1a'))[_0x70d0('0x1b')](socket);function respondWithStatusCode(_0x56f276,_0x15f1c4){_0x15f1c4=_0x15f1c4||0xcc;return function(_0x2a4365){if(_0x2a4365){return _0x56f276[_0x70d0('0x1c')](_0x15f1c4);}return _0x56f276['status'](_0x15f1c4)['end']();};}function respondWithResult(_0x10412a,_0x2ed680){_0x2ed680=_0x2ed680||0xc8;return function(_0x47bf8d){if(_0x47bf8d){return _0x10412a['status'](_0x2ed680)[_0x70d0('0x1d')](_0x47bf8d);}};}function respondWithFilteredResult(_0x2336ee,_0x581077){return function(_0x1cb94b){if(_0x1cb94b){var _0x1e2897=typeof _0x581077[_0x70d0('0x1e')]==='undefined'&&typeof _0x581077['limit']===_0x70d0('0x1f');var _0x53eb9e=_0x1cb94b['count'];var _0x25d4f8=_0x1e2897?0x0:_0x581077['offset'];var _0x53f4c1=_0x1e2897?_0x1cb94b[_0x70d0('0x20')]:_0x581077[_0x70d0('0x1e')]+_0x581077[_0x70d0('0x21')];var _0x598637;if(_0x53f4c1>=_0x53eb9e){_0x53f4c1=_0x53eb9e;_0x598637=0xc8;}else{_0x598637=0xce;}_0x2336ee[_0x70d0('0x22')](_0x598637);return _0x2336ee[_0x70d0('0x23')](_0x70d0('0x24'),_0x25d4f8+'-'+_0x53f4c1+'/'+_0x53eb9e)['json'](_0x1cb94b);}return null;};}function patchUpdates(_0x47c5cb){return function(_0x23bd80){try{jsonpatch['apply'](_0x23bd80,_0x47c5cb,!![]);}catch(_0x3e9302){return BPromise[_0x70d0('0x25')](_0x3e9302);}return _0x23bd80['save']();};}function saveUpdates(_0x325cbf,_0x1add75){return function(_0x462ddd){if(_0x462ddd){return _0x462ddd['update'](_0x325cbf)['then'](function(_0x3d7ab6){return _0x3d7ab6;});}return null;};}function removeEntity(_0x5842ee,_0x206e70){return function(_0x3fe136){if(_0x3fe136){return _0x3fe136[_0x70d0('0x26')]()['then'](function(){var _0x124918=_0x3fe136[_0x70d0('0x27')]({'plain':!![]});var _0x513a7e=_0x70d0('0x28');return db[_0x70d0('0x29')][_0x70d0('0x26')]({'where':{'type':_0x513a7e,'resourceId':_0x124918['id']}})['then'](function(){return _0x3fe136;});})[_0x70d0('0x2a')](function(){_0x5842ee[_0x70d0('0x22')](0xcc)[_0x70d0('0x2b')]();});}};}function handleEntityNotFound(_0x44b16d,_0x3e3747){return function(_0x19a83f){if(!_0x19a83f){_0x44b16d[_0x70d0('0x1c')](0x194);}return _0x19a83f;};}function handleError(_0x16d0d9,_0x5e6ccc){_0x5e6ccc=_0x5e6ccc||0x1f4;return function(_0xb39b36){logger[_0x70d0('0x2c')](_0xb39b36[_0x70d0('0x2d')]);if(_0xb39b36[_0x70d0('0x2e')]){delete _0xb39b36['name'];}_0x16d0d9['status'](_0x5e6ccc)['send'](_0xb39b36);};}exports[_0x70d0('0x2f')]=function(_0x27f64d,_0x58bd0d){var _0x321422={},_0x3b86ec={},_0xbd6736={'count':0x0,'rows':[]};var _0x5d0ab1=_[_0x70d0('0x30')](db[_0x70d0('0x31')][_0x70d0('0x32')],function(_0x23bd00){return{'name':_0x23bd00[_0x70d0('0x33')],'type':_0x23bd00[_0x70d0('0x34')]['key']};});_0x3b86ec[_0x70d0('0x35')]=_[_0x70d0('0x30')](_0x5d0ab1,_0x70d0('0x2e'));_0x3b86ec[_0x70d0('0x36')]=_[_0x70d0('0x37')](_0x27f64d[_0x70d0('0x36')]);_0x3b86ec['filters']=_[_0x70d0('0x38')](_0x3b86ec[_0x70d0('0x35')],_0x3b86ec[_0x70d0('0x36')]);_0x321422[_0x70d0('0x39')]=_[_0x70d0('0x38')](_0x3b86ec[_0x70d0('0x35')],qs[_0x70d0('0x3a')](_0x27f64d[_0x70d0('0x36')][_0x70d0('0x3a')]));_0x321422[_0x70d0('0x39')]=_0x321422[_0x70d0('0x39')][_0x70d0('0x3b')]?_0x321422[_0x70d0('0x39')]:_0x3b86ec[_0x70d0('0x35')];if(!_0x27f64d['query']['hasOwnProperty'](_0x70d0('0x3c'))){_0x321422['limit']=qs[_0x70d0('0x21')](_0x27f64d['query'][_0x70d0('0x21')]);_0x321422[_0x70d0('0x1e')]=qs[_0x70d0('0x1e')](_0x27f64d[_0x70d0('0x36')][_0x70d0('0x1e')]);}_0x321422[_0x70d0('0x3d')]=qs[_0x70d0('0x3e')](_0x27f64d['query'][_0x70d0('0x3e')]);_0x321422['where']=qs[_0x70d0('0x3f')](_[_0x70d0('0x40')](_0x27f64d[_0x70d0('0x36')],_0x3b86ec[_0x70d0('0x3f')]),_0x5d0ab1);if(_0x27f64d[_0x70d0('0x36')][_0x70d0('0x41')]){_0x321422[_0x70d0('0x42')]=_[_0x70d0('0x43')](_0x321422[_0x70d0('0x42')],{'$or':_[_0x70d0('0x30')](_0x5d0ab1,function(_0x59c511){if(_0x59c511[_0x70d0('0x34')]!=='VIRTUAL'){var _0x1daa07={};_0x1daa07[_0x59c511[_0x70d0('0x2e')]]={'$like':'%'+_0x27f64d[_0x70d0('0x36')][_0x70d0('0x41')]+'%'};return _0x1daa07;}})});}_0x321422=_[_0x70d0('0x43')]({},_0x321422,_0x27f64d[_0x70d0('0x44')]);var _0x5825bd={'where':_0x321422[_0x70d0('0x42')]};return db['Plugin'][_0x70d0('0x20')](_0x5825bd)[_0x70d0('0x2a')](function(_0x19f6d7){_0xbd6736[_0x70d0('0x20')]=_0x19f6d7;if(_0x27f64d[_0x70d0('0x36')][_0x70d0('0x45')]){_0x321422[_0x70d0('0x46')]=[{'all':!![]}];}return db[_0x70d0('0x31')]['findAll'](_0x321422);})[_0x70d0('0x2a')](function(_0x9d6ab0){_0xbd6736['rows']=_0x9d6ab0;return _0xbd6736;})[_0x70d0('0x2a')](respondWithFilteredResult(_0x58bd0d,_0x321422))['catch'](handleError(_0x58bd0d,null));};exports[_0x70d0('0x47')]=function(_0x15a9a0,_0x1ffdd5){var _0x4f79a5={'raw':!![],'where':{'id':_0x15a9a0['params']['id']}},_0x3ee973={};_0x3ee973['model']=_['keys'](db[_0x70d0('0x31')][_0x70d0('0x32')]);_0x3ee973[_0x70d0('0x36')]=_[_0x70d0('0x37')](_0x15a9a0[_0x70d0('0x36')]);_0x3ee973[_0x70d0('0x3f')]=_[_0x70d0('0x38')](_0x3ee973[_0x70d0('0x35')],_0x3ee973[_0x70d0('0x36')]);_0x4f79a5[_0x70d0('0x39')]=_[_0x70d0('0x38')](_0x3ee973[_0x70d0('0x35')],qs[_0x70d0('0x3a')](_0x15a9a0[_0x70d0('0x36')][_0x70d0('0x3a')]));_0x4f79a5[_0x70d0('0x39')]=_0x4f79a5[_0x70d0('0x39')]['length']?_0x4f79a5[_0x70d0('0x39')]:_0x3ee973[_0x70d0('0x35')];if(_0x15a9a0[_0x70d0('0x36')][_0x70d0('0x45')]){_0x4f79a5[_0x70d0('0x46')]=[{'all':!![]}];}_0x4f79a5=_[_0x70d0('0x43')]({},_0x4f79a5,_0x15a9a0['options']);return db['Plugin'][_0x70d0('0x48')](_0x4f79a5)['then'](handleEntityNotFound(_0x1ffdd5,null))[_0x70d0('0x2a')](respondWithResult(_0x1ffdd5,null))[_0x70d0('0x49')](handleError(_0x1ffdd5,null));};exports[_0x70d0('0x4a')]=function(_0x2cc95b,_0x440bfb,_0x1f9688){return db[_0x70d0('0x31')][_0x70d0('0x48')]({'where':{'id':_0x2cc95b[_0x70d0('0x4b')]['id']},'attributes':[_0x70d0('0x2e'),_0x70d0('0x8')],'raw':!![]})[_0x70d0('0x2a')](handleEntityNotFound(_0x440bfb,null))['then'](function(_0x558bb1){if(_0x558bb1){var _0x3a83f6=path[_0x70d0('0x4c')](config[_0x70d0('0x4d')],_0x70d0('0x4e'),util['format'](_0x70d0('0x4f'),path[_0x70d0('0x50')](_0x558bb1[_0x70d0('0x8')])));var _0x348626=fs[_0x70d0('0x51')](_0x3a83f6);var _0x430947=archiver(_0x70d0('0x52'),{'zlib':{'level':0x9}});_0x430947['on'](_0x70d0('0x53'),function(_0x554c18){if(_0x554c18['code']===_0x70d0('0x54')){logger[_0x70d0('0x2c')](_0x554c18);}else{throw new db['Sequelize'][(_0x70d0('0x55'))](_0x70d0('0x56'));}});_0x430947['on'](_0x70d0('0x2c'),function(_0x789993){throw new db['Sequelize'][(_0x70d0('0x55'))](_0x70d0('0x56'));});_0x430947['pipe'](_0x348626);_0x430947[_0x70d0('0x57')]('**/*',{'cwd':path[_0x70d0('0x4c')](config[_0x70d0('0x4d')],_0x70d0('0x4e'),path[_0x70d0('0x58')](_0x558bb1[_0x70d0('0x8')])),'ignore':[path['join'](path['basename'](_0x558bb1['path']),'node_modules/**/*'),path[_0x70d0('0x4c')](path['basename'](_0x558bb1[_0x70d0('0x8')]),_0x70d0('0x59'))],'nodir':!![]})['finalize']();_0x348626['on']('close',function(){if(!fs['existsSync'](_0x3a83f6)){throw new db[(_0x70d0('0x5a'))]['Error'](_0x70d0('0x5b'));}return _0x440bfb[_0x70d0('0x4a')](_0x3a83f6,util[_0x70d0('0x5c')](_0x70d0('0x4f'),path[_0x70d0('0x50')](_0x558bb1[_0x70d0('0x8')])),function(_0x3ecbb4){if(_0x3ecbb4){throw new db[(_0x70d0('0x5a'))][(_0x70d0('0x55'))](_0x70d0('0x5d'));}fs[_0x70d0('0x5e')](_0x3a83f6);logger['info'](_0x70d0('0x5f'));logger[_0x70d0('0x60')]('Temporary\x20file\x20removed');});});}return null;})['catch'](handleError(_0x440bfb,null));};exports['upload']=function(_0x1913d5,_0x1e130f,_0x1de3c7){var _0x222708=path[_0x70d0('0x50')](_0x1913d5[_0x70d0('0x61')][_0x70d0('0x62')],path['extname'](_0x1913d5[_0x70d0('0x61')][_0x70d0('0x62')]));var _0x416c59=path[_0x70d0('0x4c')](config[_0x70d0('0x4d')],_0x70d0('0x4e'),_0x1913d5[_0x70d0('0x61')][_0x70d0('0x62')]);var _0x27f9f9=path[_0x70d0('0x4c')](config[_0x70d0('0x4d')],_0x70d0('0x4e'),_0x222708);logger[_0x70d0('0x60')](_0x70d0('0x63'),_0x416c59);logger[_0x70d0('0x60')](_0x70d0('0x64'),_0x27f9f9);try{fs[_0x70d0('0x65')](_0x416c59,parseInt(_0x70d0('0x66'),0x8));extract(_0x416c59,{'dir':_0x27f9f9},function(_0x42b0cb){if(_0x42b0cb){logger['error'](_0x42b0cb);handleError(_0x42b0cb,!![]);};var _0x1e771b=fs[_0x70d0('0x67')](_0x27f9f9);if(_0x1e771b[_0x70d0('0x3b')]>0x1){removeReferences(_0x416c59,_0x27f9f9);logger[_0x70d0('0x2c')]('Invalid\x20plugin\x20structure');return _0x1de3c7(new Error('Invalid\x20plugin\x20structure'));}var _0x1d1b75=fs[_0x70d0('0x68')](path['join'](_0x27f9f9,_0x1e771b[0x0]));if(_0x1d1b75[_0x70d0('0x69')]()){removeReferences(_0x416c59,_0x27f9f9);logger[_0x70d0('0x2c')](_0x70d0('0x6a'));return _0x1de3c7(new Error(_0x70d0('0x6a')));}if(_0x1d1b75[_0x70d0('0x6b')]()){var _0x4c9d00=fs['readdirSync'](path[_0x70d0('0x4c')](_0x27f9f9,_0x1e771b[0x0]));if(_0x4c9d00[_0x70d0('0x3b')]===0x0){removeReferences(_0x416c59,_0x27f9f9);logger[_0x70d0('0x2c')]('Invalid\x20plugin\x20structure');return _0x1de3c7(new Error(_0x70d0('0x6a')));}var _0x3c296a=_0x4c9d00[_0x70d0('0x6c')](function(_0x23302e){return _0x23302e==='manifest.json';});if(!_0x3c296a){return _0x1de3c7(new Error(_0x70d0('0x6d')));}var _0x4e4758=fs[_0x70d0('0x6e')](path['join'](_0x27f9f9,_0x1e771b[0x0],_0x70d0('0x6f')));var _0x5ec13b=JSON[_0x70d0('0x70')](_0x4e4758);if(_0x70d0('0x1f')==typeof _0x5ec13b['name']){return _0x1de3c7(new Error(_0x70d0('0x71')));}if(_0x70d0('0x1f')==typeof _0x5ec13b['type']){return _0x1de3c7(new Error(_0x70d0('0x72')));}if(_0x70d0('0x1f')==typeof _0x5ec13b['version']){return _0x1de3c7(new Error(_0x70d0('0x73')));}if(_0x70d0('0x1f')==typeof _0x5ec13b['parameters']){return _0x1de3c7(new Error(_0x70d0('0x74')));}if(_0x5ec13b[_0x70d0('0x34')]==='html'){if(_0x70d0('0x1f')==typeof _0x5ec13b[_0x70d0('0x75')][_0x70d0('0x76')]){return _0x1de3c7(new Error(_0x70d0('0x77')));}if(_0x70d0('0x1f')==typeof _0x5ec13b[_0x70d0('0x75')]['views'][_0x70d0('0x78')]&&_0x70d0('0x1f')==typeof _0x5ec13b[_0x70d0('0x75')]['views'][_0x70d0('0x79')]){return _0x1de3c7(new Error(_0x70d0('0x7a')));}}else if(_0x5ec13b[_0x70d0('0x34')]===_0x70d0('0x7b')){if(_0x70d0('0x1f')==typeof _0x5ec13b[_0x70d0('0x75')]['scriptName']){return _0x1de3c7(new Error(_0x70d0('0x7c')));}if(_0x70d0('0x1f')==typeof _0x5ec13b[_0x70d0('0x75')][_0x70d0('0x7d')]){return _0x1de3c7(new Error(_0x70d0('0x7e')));}}else{return _0x1de3c7(new Error(_0x70d0('0x7f')));}var _0x4bbb8f=_0x5ec13b[_0x70d0('0x2e')];var _0x219eaf=_0x5ec13b['description'];var _0x747b9f=_0x5ec13b['type'];var _0x492dc1=_0x5ec13b[_0x70d0('0x80')]?_0x5ec13b[_0x70d0('0x80')]:_0x70d0('0x81');var _0x35cd86=_0x5ec13b[_0x70d0('0x82')]?_0x5ec13b['icon']:'icon-apps';var _0x45fe68='';var _0x445ebc='';var _0x31af1c='';var _0x4a41cb='';var _0x5b9273=_0x5ec13b['version'];if(_0x747b9f===_0x70d0('0x83')){if(_0x70d0('0x1f')!=typeof _0x5ec13b[_0x70d0('0x75')][_0x70d0('0x76')][_0x70d0('0x78')]){var _0x43ced8=_0x5ec13b[_0x70d0('0x75')][_0x70d0('0x76')][_0x70d0('0x78')];if(!/^(f|ht)tps?:\/\//i['test'](_0x43ced8)){_0x45fe68=path[_0x70d0('0x4c')](_0x70d0('0x84'),_0x222708,_0x1e771b[0x0],_0x43ced8);}else{_0x45fe68=_0x43ced8;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x70d0('0x1f')!=typeof _0x5ec13b[_0x70d0('0x75')][_0x70d0('0x76')][_0x70d0('0x79')]){var _0x26eb97=_0x5ec13b[_0x70d0('0x75')][_0x70d0('0x76')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x70d0('0x85')](_0x26eb97)){_0x445ebc=path[_0x70d0('0x4c')](_0x70d0('0x84'),_0x222708,_0x1e771b[0x0],_0x26eb97);}else{_0x445ebc=_0x26eb97;}}else{logger[_0x70d0('0x60')](_0x70d0('0x86'));}}else if(_0x747b9f===_0x70d0('0x7b')){_0x31af1c=_0x5ec13b[_0x70d0('0x75')][_0x70d0('0x87')];_0x4a41cb=_0x5ec13b[_0x70d0('0x75')][_0x70d0('0x7d')];if(_0x70d0('0x1f')!=typeof _0x5ec13b[_0x70d0('0x75')][_0x70d0('0x76')]){if(_0x70d0('0x1f')!=typeof _0x5ec13b['parameters'][_0x70d0('0x76')][_0x70d0('0x78')]){var _0x43ced8=_0x5ec13b['parameters']['views']['admin'];if(!/^(f|ht)tps?:\/\//i[_0x70d0('0x85')](_0x43ced8)){_0x45fe68=path[_0x70d0('0x4c')](_0x70d0('0x84'),_0x222708,_0x1e771b[0x0],_0x43ced8);}else{_0x45fe68=_0x43ced8;}}if(_0x70d0('0x1f')!=typeof _0x5ec13b[_0x70d0('0x75')][_0x70d0('0x76')][_0x70d0('0x79')]){var _0x26eb97=_0x5ec13b[_0x70d0('0x75')][_0x70d0('0x76')][_0x70d0('0x79')];if(!/^(f|ht)tps?:\/\//i['test'](_0x26eb97)){_0x445ebc=path[_0x70d0('0x4c')](_0x70d0('0x84'),_0x222708,_0x1e771b[0x0],_0x26eb97);}else{_0x445ebc=_0x26eb97;}}}}var _0x13cbe8={'name':_0x4bbb8f,'description':_0x219eaf,'path':path[_0x70d0('0x4c')](_0x222708,_0x1e771b[0x0]),'type':_0x747b9f,'sidebar':_0x492dc1,'icon':_0x35cd86,'adminUrl':_0x45fe68,'agentUrl':_0x445ebc,'scriptName':_0x31af1c,'scriptPath':_0x4a41cb,'version':_0x5b9273};removeReferences(_0x416c59,null);return db[_0x70d0('0x31')][_0x70d0('0x88')](_0x13cbe8)['then'](function(_0x4edab6){var _0x50bc9d={'role':_0x1913d5[_0x70d0('0x89')][_0x70d0('0x8a')],'userProfileId':_0x1913d5[_0x70d0('0x89')][_0x70d0('0x8b')]};if(!_0x50bc9d)throw new Error(_0x70d0('0x8c'));if(_0x50bc9d['role']===_0x70d0('0x8d')){var _0x390810=_0x4edab6[_0x70d0('0x27')]({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x70d0('0x28'),'userProfileId':_0x50bc9d[_0x70d0('0x8b')]},'raw':!![]})[_0x70d0('0x2a')](function(_0x33798e){if(_0x33798e&&_0x33798e[_0x70d0('0x8e')]===0x0){return db['UserProfileResource'][_0x70d0('0x88')]({'name':_0x390810[_0x70d0('0x2e')],'resourceId':_0x390810['id'],'type':_0x33798e[_0x70d0('0x2e')],'sectionId':_0x33798e['id']},{})['then'](function(){return _0x4edab6;});}else{return _0x4edab6;}})[_0x70d0('0x49')](function(_0x1851df){logger[_0x70d0('0x2c')](_0x70d0('0x8f'),_0x1851df);throw _0x1851df;});}return _0x4edab6;})['then'](respondWithResult(_0x1e130f,null))[_0x70d0('0x49')](handleError(_0x1e130f,null));}});}catch(_0x4a07f5){_0x1e130f[_0x70d0('0x22')](0x1f4)[_0x70d0('0x90')](_0x4a07f5);}};function removeReferences(_0x47a6e9,_0x278c27){try{if(_0x47a6e9){fs['unlinkSync'](_0x47a6e9);logger[_0x70d0('0x60')](_0x70d0('0x91'));}if(_0x278c27){rimraf(_0x278c27,function(){});logger[_0x70d0('0x60')](_0x70d0('0x92'));}}catch(_0x3e963f){logger['error'](_0x3e963f);}}exports[_0x70d0('0x93')]=function(_0x1a1352,_0x4ccf9d,_0x51f8f8){return db['Plugin'][_0x70d0('0x48')]({'where':{'id':_0x1a1352['params']['id']}})[_0x70d0('0x2a')](handleEntityNotFound(_0x4ccf9d,null))['then'](saveUpdates(_0x1a1352[_0x70d0('0x89')],null))['then'](respondWithResult(_0x4ccf9d,null))[_0x70d0('0x49')](handleError(_0x4ccf9d,null));};exports[_0x70d0('0x94')]=function(_0x453e34,_0x4ac25d,_0x2c5906){return db[_0x70d0('0x31')][_0x70d0('0x48')]({'where':{'id':_0x453e34[_0x70d0('0x4b')]['id']}})[_0x70d0('0x2a')](function(_0xe4acf1){if(_0xe4acf1){return _0xe4acf1['destroy']();}})[_0x70d0('0x2a')](function(_0x20e528){rimraf(path[_0x70d0('0x4c')](config[_0x70d0('0x4d')],_0x70d0('0x4e'),path[_0x70d0('0x58')](_0x20e528['path'])),function(){});return _0x20e528;})[_0x70d0('0x2a')](handleEntityNotFound(_0x4ac25d,null))['then'](respondWithStatusCode(_0x4ac25d,null))['catch'](handleError(_0x4ac25d,null));};exports[_0x70d0('0x95')]=function(_0x2e19df,_0x1c1de2,_0x2c359a){return BPromise['resolve']()[_0x70d0('0x2a')](function(){if(!_0x2e19df[_0x70d0('0x36')]['path']){throw new Error(_0x70d0('0x96'));}if(!_0x2e19df[_0x70d0('0x36')][_0x70d0('0x97')]){throw new Error(_0x70d0('0x98'));}var _0x53ba88=_0x2e19df['query'][_0x70d0('0x99')]?_0x2e19df['query'][_0x70d0('0x99')]+':'+_0x2e19df[_0x70d0('0x36')][_0x70d0('0x97')]:'http://localhost:'+_0x2e19df[_0x70d0('0x36')]['port'];var _0x3fccbd=_0x2e19df[_0x70d0('0x36')][_0x70d0('0x1d')]?_0x2e19df[_0x70d0('0x36')][_0x70d0('0x1d')]:!![];var _0x198bf7=_0x2e19df['query'][_0x70d0('0x9a')]?_0x2e19df[_0x70d0('0x36')][_0x70d0('0x9a')]:null;var _0x33fad3={'method':_0x2e19df[_0x70d0('0x9b')],'uri':util['format'](_0x70d0('0x9c'),_0x53ba88,_0x2e19df[_0x70d0('0x36')]['path']),'json':_0x3fccbd,'resolveWithFullResponse':!![],'encoding':_0x198bf7,'qs':_0x2e19df[_0x70d0('0x36')]};if(_0x2e19df[_0x70d0('0x9d')]){_0x33fad3[_0x70d0('0x9d')]=_0x2e19df[_0x70d0('0x9d')];if(_0x33fad3['headers']['content-length']){delete _0x33fad3[_0x70d0('0x9d')][_0x70d0('0x9e')];}}if(_0x33fad3[_0x70d0('0x9d')]['content-type']){delete _0x33fad3[_0x70d0('0x9d')]['content-type'];}return rp(_0x33fad3);})['then'](function(_0x5bd283){if(_0x5bd283){_0x1c1de2[_0x70d0('0x23')](_0x5bd283['headers']);logger[_0x70d0('0x60')](_0x5bd283[_0x70d0('0x89')]);if(_[_0x70d0('0x9f')](_0x2e19df[_0x70d0('0x36')][_0x70d0('0x8')],_0x70d0('0x4a'))&&_0x5bd283[_0x70d0('0xa0')]==0x1f4){return _0x1c1de2[_0x70d0('0x1c')](_0x5bd283[_0x70d0('0xa0')]);}else{return _0x1c1de2[_0x70d0('0x22')](_0x5bd283['statusCode'])[_0x70d0('0x90')](_0x5bd283[_0x70d0('0x89')]);}}else{return _0x1c1de2[_0x70d0('0x1c')](0xc8);}})[_0x70d0('0x49')](handleError(_0x1c1de2,null));};exports[_0x70d0('0xa1')]=function(_0x467b7b,_0x5dd22e,_0x2948f3){return BPromise['resolve']()[_0x70d0('0x2a')](function(){if(!_0x467b7b[_0x70d0('0x36')]['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x467b7b[_0x70d0('0x36')][_0x70d0('0x97')]){throw new Error(_0x70d0('0x98'));}var _0x386733=_0x467b7b[_0x70d0('0x36')][_0x70d0('0x99')]?_0x467b7b[_0x70d0('0x36')][_0x70d0('0x99')]+':'+_0x467b7b[_0x70d0('0x36')][_0x70d0('0x97')]:_0x70d0('0xa2')+_0x467b7b[_0x70d0('0x36')][_0x70d0('0x97')];var _0x4b0ed3=_0x467b7b[_0x70d0('0x36')][_0x70d0('0x1d')]?_0x467b7b[_0x70d0('0x36')][_0x70d0('0x1d')]:!![];var _0x2d6220=_0x467b7b[_0x70d0('0x36')][_0x70d0('0x9a')]?_0x467b7b[_0x70d0('0x36')][_0x70d0('0x9a')]:null;var _0x317220={'method':_0x467b7b[_0x70d0('0x9b')],'uri':util[_0x70d0('0x5c')](_0x70d0('0x9c'),_0x386733,_0x467b7b[_0x70d0('0x36')][_0x70d0('0x8')]),'json':_0x4b0ed3,'resolveWithFullResponse':!![],'encoding':_0x2d6220,'body':_0x467b7b[_0x70d0('0x89')]};if(_0x467b7b[_0x70d0('0x9d')]){_0x317220['headers']=_0x467b7b[_0x70d0('0x9d')];if(_0x317220[_0x70d0('0x9d')]['content-length']){delete _0x317220[_0x70d0('0x9d')][_0x70d0('0x9e')];}}if(_0x317220[_0x70d0('0x9d')][_0x70d0('0xa3')]){delete _0x317220[_0x70d0('0x9d')][_0x70d0('0xa3')];}return rp(_0x317220);})['then'](function(_0x413908){if(_0x413908){_0x5dd22e[_0x70d0('0x23')](_0x413908[_0x70d0('0x9d')]);logger[_0x70d0('0x60')](_0x413908['body']);return _0x5dd22e[_0x70d0('0x22')](_0x413908[_0x70d0('0xa0')])[_0x70d0('0x90')](_0x413908[_0x70d0('0x89')]);}else{return _0x5dd22e[_0x70d0('0x1c')](0xc8);}})[_0x70d0('0x49')](handleError(_0x5dd22e,null));}; \ No newline at end of file +var _0xeef6=['Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','content-type','endsWith','statusCode','%s%s','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','then','get','Plugins','UserProfileResource','sendStatus','error','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','length','find','download','root','format','basename','createWriteStream','zip','warning','code','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','dirname','join','node_modules/**/*','finalize','existsSync','Plugin\x20not\x20found','%s.zip','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','server/files/plugins','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','html','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','test','plugins','agent','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'];(function(_0x48b0a1,_0x2f21e3){var _0xc3b72f=function(_0x4c42b1){while(--_0x4c42b1){_0x48b0a1['push'](_0x48b0a1['shift']());}};_0xc3b72f(++_0x2f21e3);}(_0xeef6,0x16f));var _0x6eef=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xeef6[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0x6eef('0x0'));var rimraf=require(_0x6eef('0x1'));var zipdir=require(_0x6eef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6eef('0x3'));var moment=require('moment');var BPromise=require(_0x6eef('0x4'));var Mustache=require(_0x6eef('0x5'));var util=require(_0x6eef('0x6'));var path=require(_0x6eef('0x7'));var sox=require(_0x6eef('0x8'));var csv=require(_0x6eef('0x9'));var ejs=require(_0x6eef('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6eef('0xb'));var squel=require(_0x6eef('0xc'));var crypto=require(_0x6eef('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6eef('0xe'));var toCsv=require(_0x6eef('0x9'));var querystring=require('querystring');var Papa=require(_0x6eef('0xf'));var extract=require(_0x6eef('0x10'));var rimraf=require('rimraf');var archiver=require(_0x6eef('0x11'));var Redis=require(_0x6eef('0x12'));var authService=require(_0x6eef('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x6eef('0x14'));var hardwareService=require(_0x6eef('0x15'));var logger=require(_0x6eef('0x16'))(_0x6eef('0x17'));var utils=require(_0x6eef('0x18'));var config=require(_0x6eef('0x19'));var licenseUtil=require(_0x6eef('0x1a'));var db=require('../../mysqldb')['db'];config[_0x6eef('0x1b')]=_[_0x6eef('0x1c')](config[_0x6eef('0x1b')],{'host':_0x6eef('0x1d'),'port':0x18eb});var socket=require(_0x6eef('0x1e'))(new Redis(config[_0x6eef('0x1b')]));require(_0x6eef('0x1f'))[_0x6eef('0x20')](socket);function respondWithStatusCode(_0x29b503,_0x432294){_0x432294=_0x432294||0xcc;return function(_0x5dbe96){if(_0x5dbe96){return _0x29b503['sendStatus'](_0x432294);}return _0x29b503[_0x6eef('0x21')](_0x432294)[_0x6eef('0x22')]();};}function respondWithResult(_0x273f64,_0x4e0bd2){_0x4e0bd2=_0x4e0bd2||0xc8;return function(_0x215158){if(_0x215158){return _0x273f64[_0x6eef('0x21')](_0x4e0bd2)[_0x6eef('0x23')](_0x215158);}};}function respondWithFilteredResult(_0x3afac9,_0xc47eb6){return function(_0x4c3d65){if(_0x4c3d65){var _0x35dd54=typeof _0xc47eb6[_0x6eef('0x24')]===_0x6eef('0x25')&&typeof _0xc47eb6[_0x6eef('0x26')]===_0x6eef('0x25');var _0x65ad55=_0x4c3d65[_0x6eef('0x27')];var _0x4625ed=_0x35dd54?0x0:_0xc47eb6[_0x6eef('0x24')];var _0x3c27e1=_0x35dd54?_0x4c3d65['count']:_0xc47eb6[_0x6eef('0x24')]+_0xc47eb6[_0x6eef('0x26')];var _0x2c889a;if(_0x3c27e1>=_0x65ad55){_0x3c27e1=_0x65ad55;_0x2c889a=0xc8;}else{_0x2c889a=0xce;}_0x3afac9[_0x6eef('0x21')](_0x2c889a);return _0x3afac9[_0x6eef('0x28')](_0x6eef('0x29'),_0x4625ed+'-'+_0x3c27e1+'/'+_0x65ad55)[_0x6eef('0x23')](_0x4c3d65);}return null;};}function patchUpdates(_0x4ac330){return function(_0x5197d8){try{jsonpatch[_0x6eef('0x2a')](_0x5197d8,_0x4ac330,!![]);}catch(_0x25c61a){return BPromise['reject'](_0x25c61a);}return _0x5197d8[_0x6eef('0x2b')]();};}function saveUpdates(_0x473c71,_0x4dc0c4){return function(_0x9e34dd){if(_0x9e34dd){return _0x9e34dd[_0x6eef('0x2c')](_0x473c71)['then'](function(_0x423e11){return _0x423e11;});}return null;};}function removeEntity(_0x26db0b,_0x3d11d5){return function(_0x463959){if(_0x463959){return _0x463959[_0x6eef('0x2d')]()[_0x6eef('0x2e')](function(){var _0x173fd2=_0x463959[_0x6eef('0x2f')]({'plain':!![]});var _0x218aeb=_0x6eef('0x30');return db[_0x6eef('0x31')]['destroy']({'where':{'type':_0x218aeb,'resourceId':_0x173fd2['id']}})['then'](function(){return _0x463959;});})['then'](function(){_0x26db0b[_0x6eef('0x21')](0xcc)[_0x6eef('0x22')]();});}};}function handleEntityNotFound(_0x11dcd7,_0x4f50a6){return function(_0x1725f7){if(!_0x1725f7){_0x11dcd7[_0x6eef('0x32')](0x194);}return _0x1725f7;};}function handleError(_0x5c8dd9,_0x5d32e3){_0x5d32e3=_0x5d32e3||0x1f4;return function(_0x3c2dec){logger[_0x6eef('0x33')](_0x3c2dec['stack']);if(_0x3c2dec[_0x6eef('0x34')]){delete _0x3c2dec[_0x6eef('0x34')];}_0x5c8dd9['status'](_0x5d32e3)[_0x6eef('0x35')](_0x3c2dec);};}exports[_0x6eef('0x36')]=function(_0x5ddbf4,_0x186413){var _0x313240={},_0xeade76={},_0x3b1b21={'count':0x0,'rows':[]};var _0x18c597=_[_0x6eef('0x37')](db[_0x6eef('0x38')][_0x6eef('0x39')],function(_0x443688){return{'name':_0x443688[_0x6eef('0x3a')],'type':_0x443688[_0x6eef('0x3b')][_0x6eef('0x3c')]};});_0xeade76['model']=_[_0x6eef('0x37')](_0x18c597,'name');_0xeade76[_0x6eef('0x3d')]=_[_0x6eef('0x3e')](_0x5ddbf4['query']);_0xeade76[_0x6eef('0x3f')]=_[_0x6eef('0x40')](_0xeade76[_0x6eef('0x41')],_0xeade76[_0x6eef('0x3d')]);_0x313240['attributes']=_['intersection'](_0xeade76[_0x6eef('0x41')],qs[_0x6eef('0x42')](_0x5ddbf4[_0x6eef('0x3d')]['fields']));_0x313240[_0x6eef('0x43')]=_0x313240[_0x6eef('0x43')]['length']?_0x313240[_0x6eef('0x43')]:_0xeade76[_0x6eef('0x41')];if(!_0x5ddbf4[_0x6eef('0x3d')][_0x6eef('0x44')](_0x6eef('0x45'))){_0x313240[_0x6eef('0x26')]=qs[_0x6eef('0x26')](_0x5ddbf4['query'][_0x6eef('0x26')]);_0x313240[_0x6eef('0x24')]=qs[_0x6eef('0x24')](_0x5ddbf4[_0x6eef('0x3d')][_0x6eef('0x24')]);}_0x313240[_0x6eef('0x46')]=qs[_0x6eef('0x47')](_0x5ddbf4[_0x6eef('0x3d')][_0x6eef('0x47')]);_0x313240[_0x6eef('0x48')]=qs[_0x6eef('0x3f')](_['pick'](_0x5ddbf4[_0x6eef('0x3d')],_0xeade76[_0x6eef('0x3f')]),_0x18c597);if(_0x5ddbf4[_0x6eef('0x3d')][_0x6eef('0x49')]){_0x313240['where']=_[_0x6eef('0x4a')](_0x313240[_0x6eef('0x48')],{'$or':_[_0x6eef('0x37')](_0x18c597,function(_0x23a110){if(_0x23a110[_0x6eef('0x3b')]!==_0x6eef('0x4b')){var _0x261d1e={};_0x261d1e[_0x23a110[_0x6eef('0x34')]]={'$like':'%'+_0x5ddbf4['query'][_0x6eef('0x49')]+'%'};return _0x261d1e;}})});}_0x313240=_[_0x6eef('0x4a')]({},_0x313240,_0x5ddbf4[_0x6eef('0x4c')]);var _0x209b73={'where':_0x313240[_0x6eef('0x48')]};return db[_0x6eef('0x38')][_0x6eef('0x27')](_0x209b73)['then'](function(_0x6a3b58){_0x3b1b21['count']=_0x6a3b58;if(_0x5ddbf4[_0x6eef('0x3d')][_0x6eef('0x4d')]){_0x313240[_0x6eef('0x4e')]=[{'all':!![]}];}return db['Plugin'][_0x6eef('0x4f')](_0x313240);})[_0x6eef('0x2e')](function(_0xb4e8fe){_0x3b1b21['rows']=_0xb4e8fe;return _0x3b1b21;})[_0x6eef('0x2e')](respondWithFilteredResult(_0x186413,_0x313240))[_0x6eef('0x50')](handleError(_0x186413,null));};exports[_0x6eef('0x51')]=function(_0x368cc9,_0x5c8df6){var _0x29aefe={'raw':!![],'where':{'id':_0x368cc9[_0x6eef('0x52')]['id']}},_0x1f0c13={};_0x1f0c13[_0x6eef('0x41')]=_[_0x6eef('0x3e')](db['Plugin'][_0x6eef('0x39')]);_0x1f0c13[_0x6eef('0x3d')]=_[_0x6eef('0x3e')](_0x368cc9[_0x6eef('0x3d')]);_0x1f0c13['filters']=_[_0x6eef('0x40')](_0x1f0c13[_0x6eef('0x41')],_0x1f0c13[_0x6eef('0x3d')]);_0x29aefe['attributes']=_[_0x6eef('0x40')](_0x1f0c13[_0x6eef('0x41')],qs['fields'](_0x368cc9[_0x6eef('0x3d')][_0x6eef('0x42')]));_0x29aefe[_0x6eef('0x43')]=_0x29aefe[_0x6eef('0x43')][_0x6eef('0x53')]?_0x29aefe[_0x6eef('0x43')]:_0x1f0c13[_0x6eef('0x41')];if(_0x368cc9[_0x6eef('0x3d')]['includeAll']){_0x29aefe[_0x6eef('0x4e')]=[{'all':!![]}];}_0x29aefe=_[_0x6eef('0x4a')]({},_0x29aefe,_0x368cc9['options']);return db[_0x6eef('0x38')][_0x6eef('0x54')](_0x29aefe)[_0x6eef('0x2e')](handleEntityNotFound(_0x5c8df6,null))[_0x6eef('0x2e')](respondWithResult(_0x5c8df6,null))[_0x6eef('0x50')](handleError(_0x5c8df6,null));};exports[_0x6eef('0x55')]=function(_0x34c3c2,_0x175edc,_0x29eb02){return db[_0x6eef('0x38')][_0x6eef('0x54')]({'where':{'id':_0x34c3c2[_0x6eef('0x52')]['id']},'attributes':[_0x6eef('0x34'),_0x6eef('0x7')],'raw':!![]})[_0x6eef('0x2e')](handleEntityNotFound(_0x175edc,null))[_0x6eef('0x2e')](function(_0x2a10dd){if(_0x2a10dd){var _0x60cd66=path['join'](config[_0x6eef('0x56')],'server/files/plugins',util[_0x6eef('0x57')]('%s.zip',path[_0x6eef('0x58')](_0x2a10dd[_0x6eef('0x7')])));var _0x117c5d=fs[_0x6eef('0x59')](_0x60cd66);var _0x46b1e8=archiver(_0x6eef('0x5a'),{'zlib':{'level':0x9}});_0x46b1e8['on'](_0x6eef('0x5b'),function(_0x386a1c){if(_0x386a1c[_0x6eef('0x5c')]==='ENOENT'){logger[_0x6eef('0x33')](_0x386a1c);}else{throw new db['Sequelize'][(_0x6eef('0x5d'))](_0x6eef('0x5e'));}});_0x46b1e8['on']('error',function(_0x4df4f6){throw new db[(_0x6eef('0x5f'))][(_0x6eef('0x5d'))](_0x6eef('0x5e'));});_0x46b1e8[_0x6eef('0x60')](_0x117c5d);_0x46b1e8[_0x6eef('0x61')]('**/*',{'cwd':path['join'](config[_0x6eef('0x56')],'server/files/plugins',path[_0x6eef('0x62')](_0x2a10dd['path'])),'ignore':[path[_0x6eef('0x63')](path[_0x6eef('0x58')](_0x2a10dd['path']),_0x6eef('0x64')),path[_0x6eef('0x63')](path['basename'](_0x2a10dd[_0x6eef('0x7')]),'attachments/**/*')],'nodir':!![]})[_0x6eef('0x65')]();_0x117c5d['on']('close',function(){if(!fs[_0x6eef('0x66')](_0x60cd66)){throw new db[(_0x6eef('0x5f'))][(_0x6eef('0x5d'))](_0x6eef('0x67'));}return _0x175edc['download'](_0x60cd66,util[_0x6eef('0x57')](_0x6eef('0x68'),path[_0x6eef('0x58')](_0x2a10dd[_0x6eef('0x7')])),function(_0x1ff153){if(_0x1ff153){throw new db[(_0x6eef('0x5f'))][(_0x6eef('0x5d'))](_0x6eef('0x69'));}fs[_0x6eef('0x6a')](_0x60cd66);logger[_0x6eef('0x6b')](_0x6eef('0x6c'));logger[_0x6eef('0x6b')](_0x6eef('0x6d'));});});}return null;})[_0x6eef('0x50')](handleError(_0x175edc,null));};exports[_0x6eef('0x6e')]=function(_0x59ed86,_0x1d6e57,_0x11a565){var _0x587114=path['basename'](_0x59ed86[_0x6eef('0x6f')][_0x6eef('0x70')],path[_0x6eef('0x71')](_0x59ed86[_0x6eef('0x6f')]['filename']));var _0x278c05=path[_0x6eef('0x63')](config[_0x6eef('0x56')],_0x6eef('0x72'),_0x59ed86['file'][_0x6eef('0x70')]);var _0x160046=path[_0x6eef('0x63')](config[_0x6eef('0x56')],_0x6eef('0x72'),_0x587114);logger[_0x6eef('0x6b')]('Plugin\x20upload\x20filepath:\x20%s',_0x278c05);logger[_0x6eef('0x6b')]('Plugin\x20upload\x20destination:\x20%s',_0x160046);try{fs[_0x6eef('0x73')](_0x278c05,parseInt(_0x6eef('0x74'),0x8));extract(_0x278c05,{'dir':_0x160046},function(_0x1c7501){if(_0x1c7501){logger[_0x6eef('0x33')](_0x1c7501);handleError(_0x1c7501,!![]);};var _0xde9358=fs[_0x6eef('0x75')](_0x160046);if(_0xde9358['length']>0x1){removeReferences(_0x278c05,_0x160046);logger[_0x6eef('0x33')]('Invalid\x20plugin\x20structure');return _0x11a565(new Error(_0x6eef('0x76')));}var _0x3e7ab4=fs['lstatSync'](path[_0x6eef('0x63')](_0x160046,_0xde9358[0x0]));if(_0x3e7ab4[_0x6eef('0x77')]()){removeReferences(_0x278c05,_0x160046);logger[_0x6eef('0x33')](_0x6eef('0x76'));return _0x11a565(new Error(_0x6eef('0x76')));}if(_0x3e7ab4[_0x6eef('0x78')]()){var _0x25870c=fs[_0x6eef('0x75')](path['join'](_0x160046,_0xde9358[0x0]));if(_0x25870c['length']===0x0){removeReferences(_0x278c05,_0x160046);logger[_0x6eef('0x33')](_0x6eef('0x76'));return _0x11a565(new Error(_0x6eef('0x76')));}var _0x1e80f7=_0x25870c[_0x6eef('0x79')](function(_0x3a4d47){return _0x3a4d47===_0x6eef('0x7a');});if(!_0x1e80f7){return _0x11a565(new Error(_0x6eef('0x7b')));}var _0x9a3d16=fs[_0x6eef('0x7c')](path['join'](_0x160046,_0xde9358[0x0],_0x6eef('0x7a')));var _0x513638=JSON[_0x6eef('0x7d')](_0x9a3d16);if(_0x6eef('0x25')==typeof _0x513638[_0x6eef('0x34')]){return _0x11a565(new Error(_0x6eef('0x7e')));}if(_0x6eef('0x25')==typeof _0x513638[_0x6eef('0x3b')]){return _0x11a565(new Error(_0x6eef('0x7f')));}if(_0x6eef('0x25')==typeof _0x513638[_0x6eef('0x80')]){return _0x11a565(new Error(_0x6eef('0x81')));}if(_0x6eef('0x25')==typeof _0x513638['parameters']){return _0x11a565(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x513638[_0x6eef('0x3b')]===_0x6eef('0x82')){if(_0x6eef('0x25')==typeof _0x513638[_0x6eef('0x83')][_0x6eef('0x84')]){return _0x11a565(new Error(_0x6eef('0x85')));}if(_0x6eef('0x25')==typeof _0x513638['parameters'][_0x6eef('0x84')][_0x6eef('0x86')]&&_0x6eef('0x25')==typeof _0x513638[_0x6eef('0x83')]['views']['agent']){return _0x11a565(new Error(_0x6eef('0x87')));}}else if(_0x513638[_0x6eef('0x3b')]===_0x6eef('0x88')){if('undefined'==typeof _0x513638[_0x6eef('0x83')][_0x6eef('0x89')]){return _0x11a565(new Error(_0x6eef('0x8a')));}if(_0x6eef('0x25')==typeof _0x513638[_0x6eef('0x83')]['scriptPath']){return _0x11a565(new Error(_0x6eef('0x8b')));}}else{return _0x11a565(new Error(_0x6eef('0x8c')));}var _0x2219df=_0x513638[_0x6eef('0x34')];var _0xc01e9f=_0x513638[_0x6eef('0x8d')];var _0x4d0d67=_0x513638[_0x6eef('0x3b')];var _0x1fc1b3=_0x513638['sidebar']?_0x513638[_0x6eef('0x8e')]:_0x6eef('0x8f');var _0x4ce875=_0x513638[_0x6eef('0x90')]?_0x513638[_0x6eef('0x90')]:'icon-apps';var _0x1e3884='';var _0x31e310='';var _0x234bb2='';var _0x2bc5d9='';var _0xbb3139=_0x513638[_0x6eef('0x80')];if(_0x4d0d67==='html'){if(_0x6eef('0x25')!=typeof _0x513638[_0x6eef('0x83')][_0x6eef('0x84')][_0x6eef('0x86')]){var _0x209f40=_0x513638[_0x6eef('0x83')][_0x6eef('0x84')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x6eef('0x91')](_0x209f40)){_0x1e3884=path['join'](_0x6eef('0x92'),_0x587114,_0xde9358[0x0],_0x209f40);}else{_0x1e3884=_0x209f40;}}else{logger[_0x6eef('0x6b')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0x6eef('0x25')!=typeof _0x513638[_0x6eef('0x83')]['views'][_0x6eef('0x93')]){var _0x160e0d=_0x513638[_0x6eef('0x83')][_0x6eef('0x84')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x6eef('0x91')](_0x160e0d)){_0x31e310=path[_0x6eef('0x63')](_0x6eef('0x92'),_0x587114,_0xde9358[0x0],_0x160e0d);}else{_0x31e310=_0x160e0d;}}else{logger[_0x6eef('0x6b')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x4d0d67===_0x6eef('0x88')){_0x234bb2=_0x513638[_0x6eef('0x83')][_0x6eef('0x89')];_0x2bc5d9=_0x513638['parameters'][_0x6eef('0x94')];if(_0x6eef('0x25')!=typeof _0x513638[_0x6eef('0x83')][_0x6eef('0x84')]){if(_0x6eef('0x25')!=typeof _0x513638[_0x6eef('0x83')][_0x6eef('0x84')][_0x6eef('0x86')]){var _0x209f40=_0x513638[_0x6eef('0x83')][_0x6eef('0x84')][_0x6eef('0x86')];if(!/^(f|ht)tps?:\/\//i[_0x6eef('0x91')](_0x209f40)){_0x1e3884=path[_0x6eef('0x63')](_0x6eef('0x92'),_0x587114,_0xde9358[0x0],_0x209f40);}else{_0x1e3884=_0x209f40;}}if('undefined'!=typeof _0x513638[_0x6eef('0x83')][_0x6eef('0x84')]['agent']){var _0x160e0d=_0x513638[_0x6eef('0x83')][_0x6eef('0x84')][_0x6eef('0x93')];if(!/^(f|ht)tps?:\/\//i[_0x6eef('0x91')](_0x160e0d)){_0x31e310=path[_0x6eef('0x63')](_0x6eef('0x92'),_0x587114,_0xde9358[0x0],_0x160e0d);}else{_0x31e310=_0x160e0d;}}}}var _0xba3700={'name':_0x2219df,'description':_0xc01e9f,'path':path[_0x6eef('0x63')](_0x587114,_0xde9358[0x0]),'type':_0x4d0d67,'sidebar':_0x1fc1b3,'icon':_0x4ce875,'adminUrl':_0x1e3884,'agentUrl':_0x31e310,'scriptName':_0x234bb2,'scriptPath':_0x2bc5d9,'version':_0xbb3139};removeReferences(_0x278c05,null);return db[_0x6eef('0x38')][_0x6eef('0x95')](_0xba3700)['then'](function(_0x203ecf){var _0x2a2f25={'role':_0x59ed86[_0x6eef('0x96')][_0x6eef('0x97')],'userProfileId':_0x59ed86['body'][_0x6eef('0x98')]};if(!_0x2a2f25)throw new Error(_0x6eef('0x99'));if(_0x2a2f25[_0x6eef('0x97')]===_0x6eef('0x9a')){var _0xd47b3d=_0x203ecf[_0x6eef('0x2f')]({'plain':!![]});return db[_0x6eef('0x9b')]['find']({'where':{'name':'Plugins','userProfileId':_0x2a2f25[_0x6eef('0x98')]},'raw':!![]})[_0x6eef('0x2e')](function(_0x584d98){if(_0x584d98&&_0x584d98[_0x6eef('0x9c')]===0x0){return db[_0x6eef('0x31')][_0x6eef('0x95')]({'name':_0xd47b3d[_0x6eef('0x34')],'resourceId':_0xd47b3d['id'],'type':_0x584d98['name'],'sectionId':_0x584d98['id']},{})[_0x6eef('0x2e')](function(){return _0x203ecf;});}else{return _0x203ecf;}})['catch'](function(_0x40b8b6){logger[_0x6eef('0x33')](_0x6eef('0x9d'),_0x40b8b6);throw _0x40b8b6;});}return _0x203ecf;})[_0x6eef('0x2e')](respondWithResult(_0x1d6e57,null))[_0x6eef('0x50')](handleError(_0x1d6e57,null));}});}catch(_0x56307e){_0x1d6e57[_0x6eef('0x21')](0x1f4)['send'](_0x56307e);}};function removeReferences(_0x2f4cd4,_0x34eeff){try{if(_0x2f4cd4){fs['unlinkSync'](_0x2f4cd4);logger[_0x6eef('0x6b')](_0x6eef('0x9e'));}if(_0x34eeff){rimraf(_0x34eeff,function(){});logger[_0x6eef('0x6b')](_0x6eef('0x9f'));}}catch(_0x3c60b5){logger['error'](_0x3c60b5);}}exports[_0x6eef('0x2c')]=function(_0x9a0897,_0x4fab73,_0x1e7541){return db[_0x6eef('0x38')][_0x6eef('0x54')]({'where':{'id':_0x9a0897[_0x6eef('0x52')]['id']}})['then'](handleEntityNotFound(_0x4fab73,null))[_0x6eef('0x2e')](saveUpdates(_0x9a0897[_0x6eef('0x96')],null))[_0x6eef('0x2e')](respondWithResult(_0x4fab73,null))['catch'](handleError(_0x4fab73,null));};exports[_0x6eef('0xa0')]=function(_0x19c3f9,_0x54900e,_0x36acd7){return db[_0x6eef('0x38')]['find']({'where':{'id':_0x19c3f9[_0x6eef('0x52')]['id']}})[_0x6eef('0x2e')](function(_0x15662c){if(_0x15662c){return _0x15662c['destroy']();}})[_0x6eef('0x2e')](function(_0x414b34){rimraf(path['join'](config['root'],'server/files/plugins',path[_0x6eef('0x62')](_0x414b34['path'])),function(){});return _0x414b34;})[_0x6eef('0x2e')](handleEntityNotFound(_0x54900e,null))[_0x6eef('0x2e')](respondWithStatusCode(_0x54900e,null))['catch'](handleError(_0x54900e,null));};exports['webhookGet']=function(_0x1cedee,_0x4343a5,_0x339f79){return BPromise[_0x6eef('0xa1')]()[_0x6eef('0x2e')](function(){if(!_0x1cedee[_0x6eef('0x3d')][_0x6eef('0x7')]){throw new Error(_0x6eef('0xa2'));}if(!_0x1cedee['query'][_0x6eef('0xa3')]){throw new Error(_0x6eef('0xa4'));}var _0x23e998=_0x1cedee[_0x6eef('0x3d')][_0x6eef('0xa5')]?_0x1cedee[_0x6eef('0x3d')][_0x6eef('0xa5')]+':'+_0x1cedee[_0x6eef('0x3d')][_0x6eef('0xa3')]:_0x6eef('0xa6')+_0x1cedee[_0x6eef('0x3d')][_0x6eef('0xa3')];var _0x3e3b88=_0x1cedee[_0x6eef('0x3d')][_0x6eef('0x23')]?_0x1cedee[_0x6eef('0x3d')][_0x6eef('0x23')]:!![];var _0x49ef06=_0x1cedee[_0x6eef('0x3d')][_0x6eef('0xa7')]?_0x1cedee['query'][_0x6eef('0xa7')]:null;var _0x4128ef={'method':_0x1cedee[_0x6eef('0xa8')],'uri':util[_0x6eef('0x57')]('%s%s',_0x23e998,_0x1cedee[_0x6eef('0x3d')]['path']),'json':_0x3e3b88,'resolveWithFullResponse':!![],'encoding':_0x49ef06,'qs':_0x1cedee[_0x6eef('0x3d')]};if(_0x1cedee[_0x6eef('0xa9')]){_0x4128ef[_0x6eef('0xa9')]=_0x1cedee[_0x6eef('0xa9')];if(_0x4128ef[_0x6eef('0xa9')][_0x6eef('0xaa')]){delete _0x4128ef[_0x6eef('0xa9')][_0x6eef('0xaa')];}}if(_0x4128ef[_0x6eef('0xa9')][_0x6eef('0xab')]){delete _0x4128ef[_0x6eef('0xa9')]['content-type'];}return rp(_0x4128ef);})[_0x6eef('0x2e')](function(_0x4e9c75){if(_0x4e9c75){_0x4343a5['set'](_0x4e9c75[_0x6eef('0xa9')]);logger[_0x6eef('0x6b')](_0x4e9c75[_0x6eef('0x96')]);if(_[_0x6eef('0xac')](_0x1cedee[_0x6eef('0x3d')]['path'],'download')&&_0x4e9c75[_0x6eef('0xad')]==0x1f4){return _0x4343a5[_0x6eef('0x32')](_0x4e9c75[_0x6eef('0xad')]);}else{return _0x4343a5[_0x6eef('0x21')](_0x4e9c75[_0x6eef('0xad')])['send'](_0x4e9c75['body']);}}else{return _0x4343a5[_0x6eef('0x32')](0xc8);}})[_0x6eef('0x50')](handleError(_0x4343a5,null));};exports['webhookPost']=function(_0x4ebf15,_0x5d933c,_0x4a35a3){return BPromise[_0x6eef('0xa1')]()[_0x6eef('0x2e')](function(){if(!_0x4ebf15[_0x6eef('0x3d')][_0x6eef('0x7')]){throw new Error(_0x6eef('0xa2'));}if(!_0x4ebf15[_0x6eef('0x3d')][_0x6eef('0xa3')]){throw new Error(_0x6eef('0xa4'));}var _0x166d8f=_0x4ebf15[_0x6eef('0x3d')]['hostname']?_0x4ebf15[_0x6eef('0x3d')][_0x6eef('0xa5')]+':'+_0x4ebf15[_0x6eef('0x3d')][_0x6eef('0xa3')]:_0x6eef('0xa6')+_0x4ebf15['query'][_0x6eef('0xa3')];var _0x4bb103=_0x4ebf15[_0x6eef('0x3d')][_0x6eef('0x23')]?_0x4ebf15[_0x6eef('0x3d')]['json']:!![];var _0x192b00=_0x4ebf15[_0x6eef('0x3d')][_0x6eef('0xa7')]?_0x4ebf15[_0x6eef('0x3d')][_0x6eef('0xa7')]:null;var _0x230588={'method':_0x4ebf15[_0x6eef('0xa8')],'uri':util[_0x6eef('0x57')](_0x6eef('0xae'),_0x166d8f,_0x4ebf15['query'][_0x6eef('0x7')]),'json':_0x4bb103,'resolveWithFullResponse':!![],'encoding':_0x192b00,'body':_0x4ebf15[_0x6eef('0x96')]};if(_0x4ebf15[_0x6eef('0xa9')]){_0x230588[_0x6eef('0xa9')]=_0x4ebf15[_0x6eef('0xa9')];if(_0x230588[_0x6eef('0xa9')][_0x6eef('0xaa')]){delete _0x230588[_0x6eef('0xa9')][_0x6eef('0xaa')];}}if(_0x230588[_0x6eef('0xa9')][_0x6eef('0xab')]){delete _0x230588[_0x6eef('0xa9')][_0x6eef('0xab')];}return rp(_0x230588);})[_0x6eef('0x2e')](function(_0x4d742f){if(_0x4d742f){_0x5d933c[_0x6eef('0x28')](_0x4d742f['headers']);logger[_0x6eef('0x6b')](_0x4d742f[_0x6eef('0x96')]);return _0x5d933c[_0x6eef('0x21')](_0x4d742f['statusCode'])[_0x6eef('0x35')](_0x4d742f[_0x6eef('0x96')]);}else{return _0x5d933c[_0x6eef('0x32')](0xc8);}})['catch'](handleError(_0x5d933c,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 871fb3e..ecf7ef5 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 _0x9f02=['save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x43c920,_0x187315){var _0x16e4c0=function(_0xa1ae11){while(--_0xa1ae11){_0x43c920['push'](_0x43c920['shift']());}};_0x16e4c0(++_0x187315);}(_0x9f02,0x68));var _0x29f0=function(_0x2c77d1,_0x172e20){_0x2c77d1=_0x2c77d1-0x0;var _0x1cac3f=_0x9f02[_0x2c77d1];return _0x1cac3f;};'use strict';var EventEmitter=require(_0x29f0('0x0'));var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x29f0('0x1'),'afterUpdate':_0x29f0('0x2'),'afterDestroy':_0x29f0('0x3')};function emitEvent(_0x24792b){return function(_0x1a49c1,_0x47e569,_0x204fc4){PluginEvents['emit'](_0x24792b+':'+_0x1a49c1['id'],_0x1a49c1);PluginEvents[_0x29f0('0x4')](_0x24792b,_0x1a49c1);_0x204fc4(null);};}for(var e in events){if(events[_0x29f0('0x5')](e)){var event=events[e];Plugin[_0x29f0('0x6')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x0024=['../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x577b68,_0x5de18b){var _0x48fbfa=function(_0x5ee2fa){while(--_0x5ee2fa){_0x577b68['push'](_0x577b68['shift']());}};_0x48fbfa(++_0x5de18b);}(_0x0024,0xa8));var _0x4002=function(_0x3f3c56,_0x568017){_0x3f3c56=_0x3f3c56-0x0;var _0x4810a1=_0x0024[_0x3f3c56];return _0x4810a1;};'use strict';var EventEmitter=require('events');var Plugin=require(_0x4002('0x0'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0x4002('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x4002('0x2'),'afterDestroy':'remove'};function emitEvent(_0x4f3b32){return function(_0x423907,_0x1190e7,_0x5ca2fe){PluginEvents['emit'](_0x4f3b32+':'+_0x423907['id'],_0x423907);PluginEvents[_0x4002('0x3')](_0x4f3b32,_0x423907);_0x5ca2fe(null);};}for(var e in events){if(events[_0x4002('0x4')](e)){var event=events[e];Plugin[_0x4002('0x5')](e,emitEvent(event));}}module[_0x4002('0x6')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 1dd0741..7f10b6b 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 _0xc0bc=['Plugin','plugins','util','../../config/logger','api','moment','request-promise','path','rimraf','./plugin.attributes','exports','define'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0xc0bc,0x176));var _0xcc0b=function(_0xfe34bc,_0x191504){_0xfe34bc=_0xfe34bc-0x0;var _0x3a085c=_0xc0bc[_0xfe34bc];return _0x3a085c;};'use strict';var _=require('lodash');var util=require(_0xcc0b('0x0'));var logger=require(_0xcc0b('0x1'))(_0xcc0b('0x2'));var moment=require(_0xcc0b('0x3'));var BPromise=require('bluebird');var rp=require(_0xcc0b('0x4'));var fs=require('fs');var path=require(_0xcc0b('0x5'));var rimraf=require(_0xcc0b('0x6'));var config=require('../../config/environment');var attributes=require(_0xcc0b('0x7'));module[_0xcc0b('0x8')]=function(_0x526a0d,_0x5b427c){return _0x526a0d[_0xcc0b('0x9')](_0xcc0b('0xa'),attributes,{'tableName':_0xcc0b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e95=['Plugin','plugins','lodash','util','../../config/logger','api','moment','path','../../config/environment','./plugin.attributes','exports','define'];(function(_0x3be7ff,_0x12e714){var _0x186721=function(_0x2bc9e1){while(--_0x2bc9e1){_0x3be7ff['push'](_0x3be7ff['shift']());}};_0x186721(++_0x12e714);}(_0x7e95,0x1d6));var _0x57e9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e95[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x57e9('0x0'));var util=require(_0x57e9('0x1'));var logger=require(_0x57e9('0x2'))(_0x57e9('0x3'));var moment=require(_0x57e9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x57e9('0x5'));var rimraf=require('rimraf');var config=require(_0x57e9('0x6'));var attributes=require(_0x57e9('0x7'));module[_0x57e9('0x8')]=function(_0x438a70,_0x5958a3){return _0x438a70[_0x57e9('0x9')](_0x57e9('0xa'),attributes,{'tableName':_0x57e9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 60522a2..9f6ff74 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 _0x5000=['create','body','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','error','message','result','CreatePlugin','Plugin'];(function(_0x1d3ece,_0x3fb359){var _0x1ba5d2=function(_0xaa2729){while(--_0xaa2729){_0x1d3ece['push'](_0x1d3ece['shift']());}};_0x1ba5d2(++_0x3fb359);}(_0x5000,0x1c5));var _0x0500=function(_0x522736,_0x30aadc){_0x522736=_0x522736-0x0;var _0x4b4aae=_0x5000[_0x522736];return _0x4b4aae;};'use strict';var _=require(_0x0500('0x0'));var util=require(_0x0500('0x1'));var moment=require('moment');var BPromise=require(_0x0500('0x2'));var rs=require(_0x0500('0x3'));var fs=require('fs');var Redis=require(_0x0500('0x4'));var db=require(_0x0500('0x5'))['db'];var utils=require(_0x0500('0x6'));var logger=require(_0x0500('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0500('0x8'));var client=jayson['client'][_0x0500('0x9')]({'port':0x232a});config[_0x0500('0xa')]=_[_0x0500('0xb')](config[_0x0500('0xa')],{'host':_0x0500('0xc'),'port':0x18eb});var socket=require(_0x0500('0xd'))(new Redis(config[_0x0500('0xa')]));require(_0x0500('0xe'))[_0x0500('0xf')](socket);function respondWithRpcPromise(_0x3757de,_0xfe456e,_0x344135){return new BPromise(function(_0x31970b,_0x3c76aa){return client['request'](_0x3757de,_0x344135)[_0x0500('0x10')](function(_0x2510c5){logger[_0x0500('0x11')](_0x0500('0x12'),_0xfe456e,_0x0500('0x13'));logger[_0x0500('0x14')](_0x0500('0x15'),_0xfe456e,_0x0500('0x13'),JSON['stringify'](_0x2510c5));if(_0x2510c5[_0x0500('0x16')]){if(_0x2510c5[_0x0500('0x16')]['code']===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0xfe456e,_0x2510c5[_0x0500('0x16')][_0x0500('0x17')]);return _0x3c76aa(_0x2510c5[_0x0500('0x16')][_0x0500('0x17')]);}logger['error'](_0x0500('0x12'),_0xfe456e,_0x2510c5['error']['message']);return _0x31970b(_0x2510c5['error'][_0x0500('0x17')]);}else{logger[_0x0500('0x11')]('Plugin,\x20%s,\x20%s',_0xfe456e,_0x0500('0x13'));_0x31970b(_0x2510c5[_0x0500('0x18')][_0x0500('0x17')]);}})['catch'](function(_0x557a93){logger['error']('Plugin,\x20%s,\x20%s',_0xfe456e,_0x557a93);_0x3c76aa(_0x557a93);});});}exports[_0x0500('0x19')]=function(_0x2da331){var _0x404583=this;return new Promise(function(_0x431b6e,_0x2ccb2d){return db[_0x0500('0x1a')][_0x0500('0x1b')](_0x2da331[_0x0500('0x1c')],{'raw':_0x2da331['options']?_0x2da331['options']['raw']===undefined?!![]:![]:!![]})[_0x0500('0x10')](function(_0x5c4c9b){logger[_0x0500('0x11')](_0x0500('0x19'),_0x2da331);logger['debug'](_0x0500('0x19'),_0x2da331,JSON[_0x0500('0x1d')](_0x5c4c9b));_0x431b6e(_0x5c4c9b);})['catch'](function(_0x56f033){logger['error'](_0x0500('0x19'),_0x56f033[_0x0500('0x17')],_0x2da331);_0x2ccb2d(_0x404583[_0x0500('0x16')](0x1f4,_0x56f033['message']));});});}; \ No newline at end of file +var _0x9994=['jayson/promise','client','redis','localhost','./plugin.socket','register','request','then','info','request\x20sent','debug','error','code','message','Plugin,\x20%s,\x20%s','result','catch','CreatePlugin','Plugin','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x9994,0x77));var _0x4999=function(_0x4a6979,_0x5f3d1a){_0x4a6979=_0x4a6979-0x0;var _0x226f93=_0x9994[_0x4a6979];return _0x226f93;};'use strict';var _=require(_0x4999('0x0'));var util=require(_0x4999('0x1'));var moment=require(_0x4999('0x2'));var BPromise=require(_0x4999('0x3'));var rs=require(_0x4999('0x4'));var fs=require('fs');var Redis=require(_0x4999('0x5'));var db=require(_0x4999('0x6'))['db'];var utils=require(_0x4999('0x7'));var logger=require(_0x4999('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4999('0x9'));var client=jayson[_0x4999('0xa')]['http']({'port':0x232a});config[_0x4999('0xb')]=_['defaults'](config[_0x4999('0xb')],{'host':_0x4999('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4999('0xb')]));require(_0x4999('0xd'))[_0x4999('0xe')](socket);function respondWithRpcPromise(_0x521c32,_0xc589ac,_0x12c637){return new BPromise(function(_0x2f521e,_0x43ff05){return client[_0x4999('0xf')](_0x521c32,_0x12c637)[_0x4999('0x10')](function(_0xc1388f){logger[_0x4999('0x11')]('Plugin,\x20%s,\x20%s',_0xc589ac,_0x4999('0x12'));logger[_0x4999('0x13')]('Plugin,\x20%s,\x20%s,\x20%s',_0xc589ac,_0x4999('0x12'),JSON['stringify'](_0xc1388f));if(_0xc1388f[_0x4999('0x14')]){if(_0xc1388f[_0x4999('0x14')][_0x4999('0x15')]===0x1f4){logger['error']('Plugin,\x20%s,\x20%s',_0xc589ac,_0xc1388f[_0x4999('0x14')][_0x4999('0x16')]);return _0x43ff05(_0xc1388f['error'][_0x4999('0x16')]);}logger['error'](_0x4999('0x17'),_0xc589ac,_0xc1388f[_0x4999('0x14')][_0x4999('0x16')]);return _0x2f521e(_0xc1388f[_0x4999('0x14')]['message']);}else{logger[_0x4999('0x11')](_0x4999('0x17'),_0xc589ac,_0x4999('0x12'));_0x2f521e(_0xc1388f[_0x4999('0x18')][_0x4999('0x16')]);}})[_0x4999('0x19')](function(_0x4e40dc){logger[_0x4999('0x14')](_0x4999('0x17'),_0xc589ac,_0x4e40dc);_0x43ff05(_0x4e40dc);});});}exports[_0x4999('0x1a')]=function(_0x1ca31d){var _0xd4cebe=this;return new Promise(function(_0x216983,_0x57cd8a){return db[_0x4999('0x1b')][_0x4999('0x1c')](_0x1ca31d[_0x4999('0x1d')],{'raw':_0x1ca31d[_0x4999('0x1e')]?_0x1ca31d['options'][_0x4999('0x1f')]===undefined?!![]:![]:!![]})[_0x4999('0x10')](function(_0x5ae6d3){logger['info'](_0x4999('0x1a'),_0x1ca31d);logger[_0x4999('0x13')](_0x4999('0x1a'),_0x1ca31d,JSON['stringify'](_0x5ae6d3));_0x216983(_0x5ae6d3);})['catch'](function(_0x51c59f){logger['error'](_0x4999('0x1a'),_0x51c59f[_0x4999('0x16')],_0x1ca31d);_0x57cd8a(_0xd4cebe[_0x4999('0x14')](0x1f4,_0x51c59f[_0x4999('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 3b18591..aca202a 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 _0x8c93=['save','remove','update','removeListener','register','length','plugin:'];(function(_0x2a4885,_0x528f86){var _0x41a605=function(_0x2f756e){while(--_0x2f756e){_0x2a4885['push'](_0x2a4885['shift']());}};_0x41a605(++_0x528f86);}(_0x8c93,0xcb));var _0x38c9=function(_0x2d4d7e,_0x191aac){_0x2d4d7e=_0x2d4d7e-0x0;var _0x39c54c=_0x8c93[_0x2d4d7e];return _0x39c54c;};'use strict';var PluginEvents=require('./plugin.events');var events=[_0x38c9('0x0'),_0x38c9('0x1'),_0x38c9('0x2')];function createListener(_0x2f80f5,_0x18b2d2){return function(_0x20327f){_0x18b2d2['emit'](_0x2f80f5,_0x20327f);};}function removeListener(_0x3dad93,_0x370c11){return function(){PluginEvents[_0x38c9('0x3')](_0x3dad93,_0x370c11);};}exports[_0x38c9('0x4')]=function(_0x1e9fab){for(var _0x1f1094=0x0,_0x100272=events[_0x38c9('0x5')];_0x1f1094<_0x100272;_0x1f1094++){var _0x5829f0=events[_0x1f1094];var _0x2ef2bc=createListener(_0x38c9('0x6')+_0x5829f0,_0x1e9fab);PluginEvents['on'](_0x5829f0,_0x2ef2bc);}}; \ No newline at end of file +var _0xb0c5=['remove','update','emit','length','plugin:','./plugin.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb0c5,0x140));var _0x5b0c=function(_0x4965ca,_0x331e73){_0x4965ca=_0x4965ca-0x0;var _0x47ca8a=_0xb0c5[_0x4965ca];return _0x47ca8a;};'use strict';var PluginEvents=require(_0x5b0c('0x0'));var events=[_0x5b0c('0x1'),_0x5b0c('0x2'),_0x5b0c('0x3')];function createListener(_0x5dae1f,_0x50551e){return function(_0x3203ee){_0x50551e[_0x5b0c('0x4')](_0x5dae1f,_0x3203ee);};}function removeListener(_0x54e290,_0xdde472){return function(){PluginEvents['removeListener'](_0x54e290,_0xdde472);};}exports['register']=function(_0x91d10d){for(var _0x227cdb=0x0,_0x2a2354=events[_0x5b0c('0x5')];_0x227cdb<_0x2a2354;_0x227cdb++){var _0x2f1436=events[_0x227cdb];var _0x1b1bde=createListener(_0x5b0c('0x6')+_0x2f1436,_0x91d10d);PluginEvents['on'](_0x2f1436,_0x1b1bde);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 7c1ab62..8b97d79 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(_0x4186e4,_0x4db806){var _0x544e7a=function(_0x4a7e84){while(--_0x4a7e84){_0x4186e4['push'](_0x4186e4['shift']());}};_0x544e7a(++_0x4db806);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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(_0x18a841,_0x393d43){var _0x159f0b=function(_0x2135b1){while(--_0x2135b1){_0x18a841['push'](_0x18a841['shift']());}};_0x159f0b(++_0x393d43);}(_0xa9e0,0x123));var _0x0a9e=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0xa9e0[_0x25bea7];return _0x175952;};'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 5662d67..1ea8d6c 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 _0xb469=['motion2','show','create','body','join','../../files/plugins','chdir','dirname','start','dump','catch','status','update','restart','hasOwnProperty','params','Unknown\x20status','delete','Unknown\x20id','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','sendStatus','error','stack','name','send','info','index','list','then','reject','express'];(function(_0x48aaac,_0x34c645){var _0xd9947a=function(_0x1a039a){while(--_0x1a039a){_0x48aaac['push'](_0x48aaac['shift']());}};_0xd9947a(++_0x34c645);}(_0xb469,0x13b));var _0x9b46=function(_0x32c10f,_0x10a371){_0x32c10f=_0x32c10f-0x0;var _0x46c409=_0xb469[_0x32c10f];return _0x46c409;};'use strict';var _=require(_0x9b46('0x0'));var pm2=require(_0x9b46('0x1'));var logger=require(_0x9b46('0x2'))(_0x9b46('0x3'));var path=require(_0x9b46('0x4'));var exec=require(_0x9b46('0x5'))[_0x9b46('0x6')];var BPromise=require('bluebird');function handleEntityNotFound(_0x31f853,_0x45322f){return function(_0x538fc4){if(!_0x538fc4){_0x31f853[_0x9b46('0x7')](0x194);;}return _0x538fc4;};}function respondWithResult(_0x405d1c,_0x50b49e){_0x50b49e=_0x50b49e||0xc8;return function(_0x1b2dd3){if(_0x1b2dd3){return _0x405d1c['status'](_0x50b49e)['json'](_0x1b2dd3);}return null;};}function handleError(_0x34c0de,_0x545b6c){_0x545b6c=_0x545b6c||0x1f4;return function(_0x402595){logger[_0x9b46('0x8')](_0x402595[_0x9b46('0x9')]);if(_0x402595['name']){delete _0x402595[_0x9b46('0xa')];}_0x34c0de['status'](_0x545b6c)[_0x9b46('0xb')](_0x402595);};}function execChildProcess(){return new BPromise(function(_0x568d9a,_0x2c29a7){exec('npm\x20install',function(_0x672157,_0x233b6b,_0x563de4){logger[_0x9b46('0xc')](_0x233b6b);logger[_0x9b46('0xc')](_0x563de4);if(_0x672157){logger['error'](_0x672157);return _0x2c29a7(_0x672157);}return _0x568d9a(_0x233b6b);});});}exports[_0x9b46('0xd')]=function(_0x2cfb35,_0x3d9618){return pm2[_0x9b46('0xe')]()[_0x9b46('0xf')](function(_0x35c5c1){if(_0x35c5c1){var _0x2136bc=_[_0x9b46('0x10')](_0x35c5c1,function(_0x3f2b28){return _0x3f2b28[_0x9b46('0xa')]===_0x9b46('0x11')||_0x3f2b28[_0x9b46('0xa')]===_0x9b46('0x12');});return{'rows':_0x2136bc,'count':_0x2136bc['length']};}return null;})['then'](respondWithResult(_0x3d9618,null))['catch'](handleError(_0x3d9618,null));};exports[_0x9b46('0x13')]=function(_0x5a380c,_0x29fec9){return pm2['describe'](_0x5a380c['params']['id'])[_0x9b46('0xf')](respondWithResult(_0x29fec9,null))['then'](handleEntityNotFound(_0x29fec9,null))['catch'](handleError(_0x29fec9,null));};exports[_0x9b46('0x14')]=function(_0x3a15cc,_0x5a0d25){if(_0x3a15cc[_0x9b46('0x15')][_0x9b46('0xa')]&&_0x3a15cc['body']['script']){var _0xbec2ea=path[_0x9b46('0x16')](__dirname,_0x9b46('0x17'),_0x3a15cc['body']['script']);var _0x2b3440=process['cwd']();process[_0x9b46('0x18')](path[_0x9b46('0x19')](_0xbec2ea));return execChildProcess()['then'](function(_0xadff19){process['chdir'](_0x2b3440);return pm2[_0x9b46('0x1a')]({'name':_0x3a15cc[_0x9b46('0x15')]['name'],'script':_0xbec2ea});})[_0x9b46('0xf')](function(_0x31ca63){pm2[_0x9b46('0x1b')]();return _0x31ca63[0x0];})[_0x9b46('0xf')](respondWithResult(_0x5a0d25,0xc9))[_0x9b46('0x1c')](handleError(_0x5a0d25,null));}else{return _0x5a0d25[_0x9b46('0x1d')](0x1f4)[_0x9b46('0xb')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x9b46('0x1e')]=function(_0x3ac37e,_0x478105){if(_0x3ac37e[_0x9b46('0x15')]['id']){delete _0x3ac37e[_0x9b46('0x15')]['id'];}var _0x2a79a5={'online':_0x9b46('0x1f'),'stopped':'stop'};if(_0x2a79a5[_0x9b46('0x20')](_0x3ac37e[_0x9b46('0x15')][_0x9b46('0x1d')])){return pm2[_0x2a79a5[_0x3ac37e[_0x9b46('0x15')][_0x9b46('0x1d')]]](_0x3ac37e[_0x9b46('0x21')]['id'])[_0x9b46('0xf')](respondWithResult(_0x478105,0xc8))[_0x9b46('0x1c')](handleError(_0x478105,null));}else{return _0x478105[_0x9b46('0x1d')](0x1f4)[_0x9b46('0xb')]({'message':_0x9b46('0x22')});}};exports['destroy']=function(_0x1f722d,_0x27f326){if(_0x1f722d[_0x9b46('0x15')]['id']){delete _0x1f722d[_0x9b46('0x15')]['id'];}if(_0x1f722d[_0x9b46('0x21')]['id']){return pm2[_0x9b46('0x23')](_0x1f722d[_0x9b46('0x21')]['id'])[_0x9b46('0xf')](function(_0x3ab49a){pm2[_0x9b46('0x1b')]();return _0x3ab49a[0x0];})[_0x9b46('0xf')](respondWithResult(_0x27f326,null))['catch'](handleError(_0x27f326,null));}else{return _0x27f326[_0x9b46('0x1d')](0x1f4)['send']({'message':_0x9b46('0x24')});}}; \ No newline at end of file +var _0x7a2c=['start','dump','catch','status','Missing\x20name\x20and/or\x20path','restart','stop','hasOwnProperty','destroy','Unknown\x20id','lodash','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','json','stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','show','describe','params','create','body','join','script','cwd','chdir','dirname'];(function(_0x4a49c2,_0x411669){var _0x59c9c8=function(_0x5ff4a4){while(--_0x5ff4a4){_0x4a49c2['push'](_0x4a49c2['shift']());}};_0x59c9c8(++_0x411669);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x38f044,_0x4cb991){_0x38f044=_0x38f044-0x0;var _0x2a1a8d=_0x7a2c[_0x38f044];return _0x2a1a8d;};'use strict';var _=require(_0xc7a2('0x0'));var pm2=require('../../config/pm2');var logger=require(_0xc7a2('0x1'))(_0xc7a2('0x2'));var path=require(_0xc7a2('0x3'));var exec=require(_0xc7a2('0x4'))[_0xc7a2('0x5')];var BPromise=require(_0xc7a2('0x6'));function handleEntityNotFound(_0x3f2b0d,_0x34cd60){return function(_0x489232){if(!_0x489232){_0x3f2b0d[_0xc7a2('0x7')](0x194);;}return _0x489232;};}function respondWithResult(_0x1ddbae,_0x5f334e){_0x5f334e=_0x5f334e||0xc8;return function(_0x481430){if(_0x481430){return _0x1ddbae['status'](_0x5f334e)[_0xc7a2('0x8')](_0x481430);}return null;};}function handleError(_0x3de428,_0x3f0573){_0x3f0573=_0x3f0573||0x1f4;return function(_0x426fea){logger['error'](_0x426fea[_0xc7a2('0x9')]);if(_0x426fea[_0xc7a2('0xa')]){delete _0x426fea[_0xc7a2('0xa')];}_0x3de428['status'](_0x3f0573)[_0xc7a2('0xb')](_0x426fea);};}function execChildProcess(){return new BPromise(function(_0x4a44c7,_0x3e216a){exec(_0xc7a2('0xc'),function(_0x1a9b38,_0x540267,_0x226982){logger[_0xc7a2('0xd')](_0x540267);logger[_0xc7a2('0xd')](_0x226982);if(_0x1a9b38){logger['error'](_0x1a9b38);return _0x3e216a(_0x1a9b38);}return _0x4a44c7(_0x540267);});});}exports[_0xc7a2('0xe')]=function(_0x1b7844,_0x181f0c){return pm2[_0xc7a2('0xf')]()[_0xc7a2('0x10')](function(_0x2af363){if(_0x2af363){var _0x15d4cf=_[_0xc7a2('0x11')](_0x2af363,function(_0x275be9){return _0x275be9[_0xc7a2('0xa')]===_0xc7a2('0x12')||_0x275be9[_0xc7a2('0xa')]===_0xc7a2('0x13');});return{'rows':_0x15d4cf,'count':_0x15d4cf[_0xc7a2('0x14')]};}return null;})[_0xc7a2('0x10')](respondWithResult(_0x181f0c,null))['catch'](handleError(_0x181f0c,null));};exports[_0xc7a2('0x15')]=function(_0x59e8ad,_0x2414f4){return pm2[_0xc7a2('0x16')](_0x59e8ad[_0xc7a2('0x17')]['id'])[_0xc7a2('0x10')](respondWithResult(_0x2414f4,null))['then'](handleEntityNotFound(_0x2414f4,null))['catch'](handleError(_0x2414f4,null));};exports[_0xc7a2('0x18')]=function(_0x22e80a,_0x51cbb3){if(_0x22e80a['body']['name']&&_0x22e80a[_0xc7a2('0x19')]['script']){var _0x155c42=path[_0xc7a2('0x1a')](__dirname,'../../files/plugins',_0x22e80a[_0xc7a2('0x19')][_0xc7a2('0x1b')]);var _0x1b51a1=process[_0xc7a2('0x1c')]();process[_0xc7a2('0x1d')](path[_0xc7a2('0x1e')](_0x155c42));return execChildProcess()[_0xc7a2('0x10')](function(_0x4a05e1){process['chdir'](_0x1b51a1);return pm2[_0xc7a2('0x1f')]({'name':_0x22e80a[_0xc7a2('0x19')]['name'],'script':_0x155c42});})[_0xc7a2('0x10')](function(_0x3cad61){pm2[_0xc7a2('0x20')]();return _0x3cad61[0x0];})[_0xc7a2('0x10')](respondWithResult(_0x51cbb3,0xc9))[_0xc7a2('0x21')](handleError(_0x51cbb3,null));}else{return _0x51cbb3[_0xc7a2('0x22')](0x1f4)[_0xc7a2('0xb')]({'message':_0xc7a2('0x23')});}};exports['update']=function(_0x35a6e0,_0x505fe8){if(_0x35a6e0[_0xc7a2('0x19')]['id']){delete _0x35a6e0['body']['id'];}var _0x20404b={'online':_0xc7a2('0x24'),'stopped':_0xc7a2('0x25')};if(_0x20404b[_0xc7a2('0x26')](_0x35a6e0['body']['status'])){return pm2[_0x20404b[_0x35a6e0[_0xc7a2('0x19')][_0xc7a2('0x22')]]](_0x35a6e0[_0xc7a2('0x17')]['id'])[_0xc7a2('0x10')](respondWithResult(_0x505fe8,0xc8))[_0xc7a2('0x21')](handleError(_0x505fe8,null));}else{return _0x505fe8[_0xc7a2('0x22')](0x1f4)[_0xc7a2('0xb')]({'message':'Unknown\x20status'});}};exports[_0xc7a2('0x27')]=function(_0x926b6c,_0x496386){if(_0x926b6c[_0xc7a2('0x19')]['id']){delete _0x926b6c[_0xc7a2('0x19')]['id'];}if(_0x926b6c[_0xc7a2('0x17')]['id']){return pm2['delete'](_0x926b6c[_0xc7a2('0x17')]['id'])['then'](function(_0x1f9bdc){pm2['dump']();return _0x1f9bdc[0x0];})['then'](respondWithResult(_0x496386,null))[_0xc7a2('0x21')](handleError(_0x496386,null));}else{return _0x496386['status'](0x1f4)['send']({'message':_0xc7a2('0x28')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 05ad090..76b3c53 100644 --- a/server/api/realtime/index.js +++ b/server/api/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3dd2=['getAgents','/queues','exports','../../components/auth/service','./realtime.controller','/agents','isAuthenticated'];(function(_0xfbe361,_0x5573e2){var _0x4fcb56=function(_0x65dcd5){while(--_0x65dcd5){_0xfbe361['push'](_0xfbe361['shift']());}};_0x4fcb56(++_0x5573e2);}(_0x3dd2,0xab));var _0x23dd=function(_0x27cf2e,_0x2e99ee){_0x27cf2e=_0x27cf2e-0x0;var _0x4e8da7=_0x3dd2[_0x27cf2e];return _0x4e8da7;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x23dd('0x0'));var controller=require(_0x23dd('0x1'));router['get'](_0x23dd('0x2'),auth[_0x23dd('0x3')](),controller[_0x23dd('0x4')]);router['get'](_0x23dd('0x5'),auth[_0x23dd('0x3')](),controller['getQueues']);module[_0x23dd('0x6')]=router; \ No newline at end of file +var _0x03af=['getAgents','exports','express','../../components/auth/service','get','/agents','isAuthenticated'];(function(_0x75dd04,_0xcca125){var _0x5bcc9e=function(_0x4fe5d6){while(--_0x4fe5d6){_0x75dd04['push'](_0x75dd04['shift']());}};_0x5bcc9e(++_0xcca125);}(_0x03af,0xcd));var _0xf03a=function(_0x30f8ef,_0x2b21d0){_0x30f8ef=_0x30f8ef-0x0;var _0x22bf87=_0x03af[_0x30f8ef];return _0x22bf87;};'use strict';var express=require(_0xf03a('0x0'));var router=express['Router']();var auth=require(_0xf03a('0x1'));var controller=require('./realtime.controller');router[_0xf03a('0x2')](_0xf03a('0x3'),auth[_0xf03a('0x4')](),controller[_0xf03a('0x5')]);router[_0xf03a('0x2')]('/queues',auth[_0xf03a('0x4')](),controller['getQueues']);module[_0xf03a('0x6')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index ed6668b..fba864f 100644 --- a/server/api/realtime/realtime.controller.js +++ b/server/api/realtime/realtime.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0024=['then','channel','format','Channel\x20parameter\x20%s\x20is\x20invalid','toLowerCase','sort','includes','validateSortParameter','getUpdatedSortOptions','fields','getAgentIdsByQueues','getRealtimeAgents','getSortedAgentsIdsByStatus','getAgentIdsByStatus','map','User','rawAttributes','type','agent','online','raw','length','sequelize','literal','FIELD(id,','order','push','Pause','forEach','where','user','role','userProfileId','Agents','extraQueryConditions','assign','UserProfile','findAndCountAll','rows','find','filterAgentAttributes','merge','globalStatus','getAgentStatus','pause','Status','sortAgentsByStatus','split','catch','getQueues','startCase','Queue','fieldName','name','voice','outbound','join','getOptions','QueueCampaigns','Queues','filter','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../errors/api','APIBadRequestError','undefined','limit','offset','count','status','set','Content-Range','getChannels','query','globalQueueFilter','globalStatusFilter','pauseTypeFilter','*pause','resolve'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x0024,0x13a));var _0x4002=function(_0x178619,_0x8acdca){_0x178619=_0x178619-0x0;var _0x5d16a0=_0x0024[_0x178619];return _0x5d16a0;};'use strict';var _=require(_0x4002('0x0'));var util=require(_0x4002('0x1'));var rta=require(_0x4002('0x2'));var rtq=require(_0x4002('0x3'));var qs=require(_0x4002('0x4'));var utils=require(_0x4002('0x5'));var db=require('../../mysqldb')['db'];var APIBadRequestError=require(_0x4002('0x6'))[_0x4002('0x7')];var APIHandleError=require(_0x4002('0x6'))['handleError'];function respondWithFilteredResult(_0x17ef4c,_0x4c8855){return function(_0xfc8817){if(_0xfc8817){var _0x46fe98=typeof _0x4c8855['offset']===_0x4002('0x8')&&typeof _0x4c8855[_0x4002('0x9')]===_0x4002('0x8');var _0xe1c2b1=_0xfc8817['count'];var _0x3b6165=_0x46fe98?0x0:_0x4c8855[_0x4002('0xa')];var _0x966e72=_0x46fe98?_0xfc8817[_0x4002('0xb')]:_0x4c8855[_0x4002('0xa')]+_0x4c8855[_0x4002('0x9')];var _0x7e65f5;if(_0x966e72>=_0xe1c2b1){_0x966e72=_0xe1c2b1;_0x7e65f5=0xc8;}else{_0x7e65f5=0xce;}_0x17ef4c[_0x4002('0xc')](_0x7e65f5);return _0x17ef4c[_0x4002('0xd')](_0x4002('0xe'),_0x3b6165+'-'+_0x966e72+'/'+_0xe1c2b1)['json'](_0xfc8817);}return null;};}exports['getAgents']=function(_0x1429ae,_0xe2c82){var _0x391dff={'count':0x0,'rows':[]};var _0x3f4426={};var _0x3dafa7;var _0x592d33=utils[_0x4002('0xf')]();var _0xeb3e16;var _0x147a68;var _0x4c2a4f=_0x1429ae[_0x4002('0x10')][_0x4002('0x11')];var _0x3dd5e0=_0x1429ae['query'][_0x4002('0x12')];var _0x431d53=_0x1429ae[_0x4002('0x10')][_0x4002('0x13')];var _0x560357=_0x3dd5e0==='pause'||_0x3dd5e0===_0x4002('0x14')?!![]:![];var _0x39f259=[];var _0xccfbcc;var _0x41501f;Promise[_0x4002('0x15')]()[_0x4002('0x16')](function(){if(_0x1429ae[_0x4002('0x10')]['channel']){if(!utils['isValidChannel'](_0x1429ae[_0x4002('0x10')][_0x4002('0x17')])){throw new APIBadRequestError(util[_0x4002('0x18')](_0x4002('0x19'),_0x1429ae[_0x4002('0x10')][_0x4002('0x17')]));}_0x3dafa7=_0x1429ae['query'][_0x4002('0x17')][_0x4002('0x1a')]();}if(!_0x1429ae[_0x4002('0x10')][_0x4002('0x1b')]||!_0x1429ae[_0x4002('0x10')][_0x4002('0x1b')][_0x4002('0x1c')]('globalStatus')){_0x1429ae[_0x4002('0x10')][_0x4002('0x1b')]=rta[_0x4002('0x1d')](_0x1429ae[_0x4002('0x10')][_0x4002('0x1b')]);return;}var _0x2b3ea1=rta[_0x4002('0x1e')](_0x1429ae[_0x4002('0x10')]['sort']);_0x1429ae[_0x4002('0x10')]['sort']=_0x2b3ea1[_0x4002('0x1f')]['join'](',');_0xccfbcc=_0x2b3ea1['order'];})['then'](function(){if(!_0x4c2a4f){return[];}return rta[_0x4002('0x20')](_0x4c2a4f,_0x3dafa7);})[_0x4002('0x16')](function(_0x4aa848){_0x39f259=_0x4aa848;return rta[_0x4002('0x21')]();})['then'](function(_0x3ff082){_0x147a68=_0x3ff082['rows'];if((!_0x3dd5e0||_0x560357)&&!_0xccfbcc){return _0x39f259;}if(_0xccfbcc&&!_0x3dd5e0){return rta[_0x4002('0x22')](_0x147a68,_0x39f259,_0xccfbcc);}else{return rta[_0x4002('0x23')](_0x147a68,_0x39f259,_0x3dd5e0);}})[_0x4002('0x16')](function(_0x236b97){_0x39f259=_0x236b97;var _0x319637=![];if(_0x39f259['length']===0x0){if(_0x4c2a4f||_0x3dd5e0){_0x319637=!![];}if(_0x560357){_0x319637=![];}}if(_0x319637){return _0x391dff;}var _0x43d76c=_[_0x4002('0x24')](db[_0x4002('0x25')][_0x4002('0x26')],function(_0x3adfef){return{'name':_0x3adfef['fieldName'],'type':_0x3adfef[_0x4002('0x27')]['key']};});_0x1429ae['query']['role']=_0x4002('0x28');_0x1429ae[_0x4002('0x10')][_0x4002('0x29')]=!![];_0x3f4426=qs['getOptions'](_0x43d76c,_0x1429ae);_0x3f4426[_0x4002('0x2a')]=!![];var _0x2e3249=[];if(_0x39f259[_0x4002('0x2b')]>0x0){_0x2e3249['push']({'id':{'$in':_0x39f259}});if(_0xccfbcc&&!_0x3dd5e0){_0x41501f=[db[_0x4002('0x2c')][_0x4002('0x2d')](_0x4002('0x2e')+_0x39f259+')')];_0x3f4426[_0x4002('0x2f')]=_0x41501f;}}if(_0x560357){_0x592d33['forEach'](function(_0x5710ae){var _0xc0ade5=!![];if(_0x3dd5e0===_0x4002('0x14')&&_0x3dafa7!==_0x5710ae){_0xc0ade5=![];}_0x2e3249[_0x4002('0x30')]({[_0x5710ae+_0x4002('0x31')]:_0xc0ade5});});if(_0x431d53){_0x2e3249[_0x4002('0x30')]({'pauseType':_0x431d53});}}else if(_0x3dd5e0){_0x592d33[_0x4002('0x32')](function(_0x24a1ea){_0x2e3249[_0x4002('0x30')]({[_0x24a1ea+_0x4002('0x31')]:![]});});}_0x3f4426[_0x4002('0x33')]=_['merge'](_0x3f4426[_0x4002('0x33')],{'$and':_0x2e3249});if(_0x1429ae[_0x4002('0x34')][_0x4002('0x35')]===_0x4002('0x34')){var _0x5d4e2f={'params':{'id':_0x1429ae['user'][_0x4002('0x36')]},'query':{'section':_0x4002('0x37'),'role':'agent','online':!![],'raw':!![],'ids':_0x39f259,'customSorting':_0x41501f}};if(_0x560357){_0x5d4e2f[_0x4002('0x10')][_0x4002('0x38')]=_0x2e3249;}_0x5d4e2f['query']=Object[_0x4002('0x39')](_0x5d4e2f[_0x4002('0x10')],_0x1429ae[_0x4002('0x10')]);delete _0x5d4e2f[_0x4002('0x10')]['id'];return db[_0x4002('0x3a')]['getResources'](_0x5d4e2f);}return db[_0x4002('0x25')][_0x4002('0x3b')](_0x3f4426);})[_0x4002('0x16')](function(_0x50a6d9){_0x391dff[_0x4002('0xb')]=_0x50a6d9[_0x4002('0xb')];_0xeb3e16=_0x50a6d9[_0x4002('0x3c')];return _0xeb3e16[_0x4002('0x24')](function(_0x1266c7){var _0x59b58c=_[_0x4002('0x3d')](_0x147a68,['id',_0x1266c7['id']]);if(_0x59b58c){var _0x2f69b0=rta[_0x4002('0x3e')](_0x59b58c);_[_0x4002('0x3f')](_0x1266c7,_0x2f69b0);}_0x1266c7[_0x4002('0x40')]=rta[_0x4002('0x41')](_0x1266c7);if(_0x1266c7[_0x4002('0x40')][_0x4002('0x1c')](_0x4002('0x42'))){_0x592d33[_0x4002('0x32')](function(_0x7cdfe9){if(_0x1266c7[_0x7cdfe9+'Pause']){_0x1266c7[_0x7cdfe9+_0x4002('0x43')]=_0x4002('0x42');}});}return _0x1266c7;});})[_0x4002('0x16')](function(_0x1224bf){if(!_0xccfbcc||_0x41501f){return _0x1224bf;}return rta[_0x4002('0x44')](_0x1224bf,_0xccfbcc);})[_0x4002('0x16')](function(_0x51cab6){var _0x57e374=null;if(_0x1429ae[_0x4002('0x10')][_0x4002('0x1f')]){var _0x39b623=_0x1429ae[_0x4002('0x10')][_0x4002('0x1f')][_0x4002('0x45')](',');_0x57e374=_0x51cab6['map'](function(_0x1276a2){return _['pick'](_0x1276a2,_0x39b623);});}_0x391dff[_0x4002('0x3c')]=_0x57e374||_0x51cab6;return _0x391dff;})[_0x4002('0x16')](respondWithFilteredResult(_0xe2c82,_0x3f4426))[_0x4002('0x46')](APIHandleError(_0xe2c82));};exports[_0x4002('0x47')]=function(_0x37cf03,_0x597d87){var _0x1da662={'count':0x0,'rows':[]};var _0x21b8e4={};var _0xfa38ae;var _0x19ce66;var _0x471877;Promise['resolve']()[_0x4002('0x16')](function(){if(_0x37cf03[_0x4002('0x10')]['channel']){if(!utils['isValidChannel'](_0x37cf03[_0x4002('0x10')][_0x4002('0x17')])){throw new APIBadRequestError(util[_0x4002('0x18')](_0x4002('0x19'),_0x37cf03['query']['channel']));}_0xfa38ae=_0x37cf03['query'][_0x4002('0x17')][_0x4002('0x1a')]();}var _0xd37436=_[_0x4002('0x48')](_0xfa38ae)+_0x4002('0x49');var _0x3bc0f5=_[_0x4002('0x24')](db[_0xd37436][_0x4002('0x26')],function(_0x43f681){return{'name':_0x43f681[_0x4002('0x4a')],'type':_0x43f681['type']['key']};});if(!_0x37cf03[_0x4002('0x10')]['fields']){var _0x30b14b=['id',_0x4002('0x4b')];if(_0xfa38ae===_0x4002('0x4c')){_0x30b14b[_0x4002('0x30')]('type');if(_0x37cf03[_0x4002('0x10')]['type']===_0x4002('0x4d')){_0x30b14b[_0x4002('0x30')](['dialActive','dialMethod']);}}_0x37cf03[_0x4002('0x10')][_0x4002('0x1f')]=_0x30b14b[_0x4002('0x4e')](',');}_0x21b8e4=qs[_0x4002('0x4f')](_0x3bc0f5,_0x37cf03);if(_0x37cf03[_0x4002('0x34')][_0x4002('0x35')]==='user'){var _0x45613b={'params':{'id':_0x37cf03[_0x4002('0x34')][_0x4002('0x36')]},'query':{'section':_0xfa38ae===_0x4002('0x4c')&&_0x37cf03['query'][_0x4002('0x27')]==='outbound'?_0x4002('0x50'):_[_0x4002('0x48')](_0xfa38ae)+_0x4002('0x51'),'type':_0x37cf03[_0x4002('0x10')]['type'],'nolimit':!![],'sort':_0x4002('0x4b'),'filter':_0x37cf03[_0x4002('0x10')][_0x4002('0x52')]}};return db['UserProfile']['getResources'](_0x45613b);}return db[_0xd37436]['findAndCountAll'](_0x21b8e4);})[_0x4002('0x16')](function(_0x3e546b){_0x1da662['count']=_0x3e546b[_0x4002('0xb')];_0x19ce66=_0x3e546b[_0x4002('0x3c')];return rtq['getRealtimeQueues'](_0x37cf03,_0xfa38ae);})[_0x4002('0x16')](function(_0x52dba1){_0x471877=_0x52dba1['rows'];return rtq[_0x4002('0x53')](_0x19ce66,_0x471877,_0xfa38ae,_0x37cf03[_0x4002('0x10')][_0x4002('0x27')]);})[_0x4002('0x16')](function(_0x35d26b){_0x1da662[_0x4002('0x3c')]=_0x35d26b;return _0x1da662;})[_0x4002('0x16')](respondWithFilteredResult(_0x597d87,_0x21b8e4))['catch'](APIHandleError(_0x597d87));}; \ No newline at end of file +var _0xa971=['getAgentStatus','pause','Status','catch','getQueues','Queue','voice','outbound','Queues','filter','getResources','getRealtimeQueues','initializeQueues','lodash','util','../../components/realtime/agents','../../components/realtime/queues','../../components/parsers/qs','../../config/utils','../../mysqldb','APIBadRequestError','offset','undefined','limit','count','status','set','Content-Range','getAgents','getChannels','globalQueueFilter','globalStatusFilter','query','*pause','resolve','then','channel','isValidChannel','format','Channel\x20parameter\x20%s\x20is\x20invalid','sort','includes','validateSortParameter','getUpdatedSortOptions','fields','join','getRealtimeAgents','rows','getSortedAgentsIdsByStatus','getAgentIdsByStatus','length','map','User','rawAttributes','fieldName','type','key','agent','online','getOptions','raw','push','literal','FIELD(id,','order','forEach','Pause','where','user','userProfileId','Agents','extraQueryConditions','UserProfile','findAndCountAll','find','filterAgentAttributes','globalStatus'];(function(_0x54de36,_0x5e621d){var _0x3f78f0=function(_0x2b7cd9){while(--_0x2b7cd9){_0x54de36['push'](_0x54de36['shift']());}};_0x3f78f0(++_0x5e621d);}(_0xa971,0x141));var _0x1a97=function(_0x3f8b74,_0x4386bd){_0x3f8b74=_0x3f8b74-0x0;var _0x182d00=_0xa971[_0x3f8b74];return _0x182d00;};'use strict';var _=require(_0x1a97('0x0'));var util=require(_0x1a97('0x1'));var rta=require(_0x1a97('0x2'));var rtq=require(_0x1a97('0x3'));var qs=require(_0x1a97('0x4'));var utils=require(_0x1a97('0x5'));var db=require(_0x1a97('0x6'))['db'];var APIBadRequestError=require('../../errors/api')[_0x1a97('0x7')];var APIHandleError=require('../../errors/api')['handleError'];function respondWithFilteredResult(_0x3e4a9c,_0x1e87d1){return function(_0x343e96){if(_0x343e96){var _0x591f7f=typeof _0x1e87d1[_0x1a97('0x8')]===_0x1a97('0x9')&&typeof _0x1e87d1[_0x1a97('0xa')]==='undefined';var _0x9089fc=_0x343e96[_0x1a97('0xb')];var _0x20656c=_0x591f7f?0x0:_0x1e87d1[_0x1a97('0x8')];var _0x205624=_0x591f7f?_0x343e96[_0x1a97('0xb')]:_0x1e87d1[_0x1a97('0x8')]+_0x1e87d1[_0x1a97('0xa')];var _0x532ed3;if(_0x205624>=_0x9089fc){_0x205624=_0x9089fc;_0x532ed3=0xc8;}else{_0x532ed3=0xce;}_0x3e4a9c[_0x1a97('0xc')](_0x532ed3);return _0x3e4a9c[_0x1a97('0xd')](_0x1a97('0xe'),_0x20656c+'-'+_0x205624+'/'+_0x9089fc)['json'](_0x343e96);}return null;};}exports[_0x1a97('0xf')]=function(_0x24f2ec,_0x7dc26a){var _0x326bad={'count':0x0,'rows':[]};var _0x31657d={};var _0x5d3d53;var _0x794f03=utils[_0x1a97('0x10')]();var _0x200c05;var _0x17b6f3;var _0x343659=_0x24f2ec['query'][_0x1a97('0x11')];var _0x59e003=_0x24f2ec['query'][_0x1a97('0x12')];var _0x343f09=_0x24f2ec[_0x1a97('0x13')]['pauseTypeFilter'];var _0x469d1c=_0x59e003==='pause'||_0x59e003===_0x1a97('0x14')?!![]:![];var _0x5db0c7=[];var _0x22ee2e;var _0x4c959c;Promise[_0x1a97('0x15')]()[_0x1a97('0x16')](function(){if(_0x24f2ec[_0x1a97('0x13')][_0x1a97('0x17')]){if(!utils[_0x1a97('0x18')](_0x24f2ec['query']['channel'])){throw new APIBadRequestError(util[_0x1a97('0x19')](_0x1a97('0x1a'),_0x24f2ec['query'][_0x1a97('0x17')]));}_0x5d3d53=_0x24f2ec[_0x1a97('0x13')][_0x1a97('0x17')]['toLowerCase']();}if(!_0x24f2ec[_0x1a97('0x13')][_0x1a97('0x1b')]||!_0x24f2ec['query'][_0x1a97('0x1b')][_0x1a97('0x1c')]('globalStatus')){_0x24f2ec['query'][_0x1a97('0x1b')]=rta[_0x1a97('0x1d')](_0x24f2ec[_0x1a97('0x13')][_0x1a97('0x1b')]);return;}var _0x5d7abb=rta[_0x1a97('0x1e')](_0x24f2ec['query'][_0x1a97('0x1b')]);_0x24f2ec[_0x1a97('0x13')][_0x1a97('0x1b')]=_0x5d7abb[_0x1a97('0x1f')][_0x1a97('0x20')](',');_0x22ee2e=_0x5d7abb['order'];})[_0x1a97('0x16')](function(){if(!_0x343659){return[];}return rta['getAgentIdsByQueues'](_0x343659,_0x5d3d53);})[_0x1a97('0x16')](function(_0x25fe38){_0x5db0c7=_0x25fe38;return rta[_0x1a97('0x21')]();})[_0x1a97('0x16')](function(_0x4db4b1){_0x17b6f3=_0x4db4b1[_0x1a97('0x22')];if((!_0x59e003||_0x469d1c)&&!_0x22ee2e){return _0x5db0c7;}if(_0x22ee2e&&!_0x59e003){return rta[_0x1a97('0x23')](_0x17b6f3,_0x5db0c7,_0x22ee2e);}else{return rta[_0x1a97('0x24')](_0x17b6f3,_0x5db0c7,_0x59e003);}})['then'](function(_0x4b0f1c){_0x5db0c7=_0x4b0f1c;var _0x1f479f=![];if(_0x5db0c7[_0x1a97('0x25')]===0x0){if(_0x343659||_0x59e003){_0x1f479f=!![];}if(_0x469d1c){_0x1f479f=![];}}if(_0x1f479f){return _0x326bad;}var _0x2f0e91=_[_0x1a97('0x26')](db[_0x1a97('0x27')][_0x1a97('0x28')],function(_0x1d327b){return{'name':_0x1d327b[_0x1a97('0x29')],'type':_0x1d327b[_0x1a97('0x2a')][_0x1a97('0x2b')]};});_0x24f2ec[_0x1a97('0x13')]['role']=_0x1a97('0x2c');_0x24f2ec[_0x1a97('0x13')][_0x1a97('0x2d')]=!![];_0x31657d=qs[_0x1a97('0x2e')](_0x2f0e91,_0x24f2ec);_0x31657d[_0x1a97('0x2f')]=!![];var _0x2b1f97=[];if(_0x5db0c7[_0x1a97('0x25')]>0x0){_0x2b1f97[_0x1a97('0x30')]({'id':{'$in':_0x5db0c7}});if(_0x22ee2e&&!_0x59e003){_0x4c959c=[db['sequelize'][_0x1a97('0x31')](_0x1a97('0x32')+_0x5db0c7+')')];_0x31657d[_0x1a97('0x33')]=_0x4c959c;}}if(_0x469d1c){_0x794f03[_0x1a97('0x34')](function(_0x55491){var _0x511f83=!![];if(_0x59e003===_0x1a97('0x14')&&_0x5d3d53!==_0x55491){_0x511f83=![];}_0x2b1f97['push']({[_0x55491+_0x1a97('0x35')]:_0x511f83});});if(_0x343f09){_0x2b1f97[_0x1a97('0x30')]({'pauseType':_0x343f09});}}else if(_0x59e003){_0x794f03['forEach'](function(_0x3b5c6b){_0x2b1f97[_0x1a97('0x30')]({[_0x3b5c6b+_0x1a97('0x35')]:![]});});}_0x31657d[_0x1a97('0x36')]=_['merge'](_0x31657d[_0x1a97('0x36')],{'$and':_0x2b1f97});if(_0x24f2ec[_0x1a97('0x37')]['role']===_0x1a97('0x37')){var _0x154719={'params':{'id':_0x24f2ec[_0x1a97('0x37')][_0x1a97('0x38')]},'query':{'section':_0x1a97('0x39'),'role':_0x1a97('0x2c'),'online':!![],'raw':!![],'ids':_0x5db0c7,'customSorting':_0x4c959c}};if(_0x469d1c){_0x154719[_0x1a97('0x13')][_0x1a97('0x3a')]=_0x2b1f97;}_0x154719[_0x1a97('0x13')]=Object['assign'](_0x154719[_0x1a97('0x13')],_0x24f2ec['query']);delete _0x154719[_0x1a97('0x13')]['id'];return db[_0x1a97('0x3b')]['getResources'](_0x154719);}return db['User'][_0x1a97('0x3c')](_0x31657d);})[_0x1a97('0x16')](function(_0x43cb54){_0x326bad[_0x1a97('0xb')]=_0x43cb54['count'];_0x200c05=_0x43cb54[_0x1a97('0x22')];return _0x200c05['map'](function(_0x4e7af8){var _0xd897ac=_[_0x1a97('0x3d')](_0x17b6f3,['id',_0x4e7af8['id']]);if(_0xd897ac){var _0x1fb194=rta[_0x1a97('0x3e')](_0xd897ac);_['merge'](_0x4e7af8,_0x1fb194);}_0x4e7af8[_0x1a97('0x3f')]=rta[_0x1a97('0x40')](_0x4e7af8);if(_0x4e7af8[_0x1a97('0x3f')][_0x1a97('0x1c')](_0x1a97('0x41'))){_0x794f03[_0x1a97('0x34')](function(_0x1afea6){if(_0x4e7af8[_0x1afea6+_0x1a97('0x35')]){_0x4e7af8[_0x1afea6+_0x1a97('0x42')]=_0x1a97('0x41');}});}return _0x4e7af8;});})[_0x1a97('0x16')](function(_0x23da34){if(!_0x22ee2e||_0x4c959c){return _0x23da34;}return rta['sortAgentsByStatus'](_0x23da34,_0x22ee2e);})[_0x1a97('0x16')](function(_0x4691de){var _0x2612fc=null;if(_0x24f2ec['query']['fields']){var _0x16e9d8=_0x24f2ec[_0x1a97('0x13')][_0x1a97('0x1f')]['split'](',');_0x2612fc=_0x4691de['map'](function(_0x1fbe3c){return _['pick'](_0x1fbe3c,_0x16e9d8);});}_0x326bad[_0x1a97('0x22')]=_0x2612fc||_0x4691de;return _0x326bad;})[_0x1a97('0x16')](respondWithFilteredResult(_0x7dc26a,_0x31657d))[_0x1a97('0x43')](APIHandleError(_0x7dc26a));};exports[_0x1a97('0x44')]=function(_0x221db4,_0x8476b2){var _0x44c9e3={'count':0x0,'rows':[]};var _0x9c9780={};var _0x5f3dfa;var _0xe9dc31;var _0x3cec92;Promise[_0x1a97('0x15')]()[_0x1a97('0x16')](function(){if(_0x221db4['query'][_0x1a97('0x17')]){if(!utils['isValidChannel'](_0x221db4['query'][_0x1a97('0x17')])){throw new APIBadRequestError(util[_0x1a97('0x19')](_0x1a97('0x1a'),_0x221db4['query'][_0x1a97('0x17')]));}_0x5f3dfa=_0x221db4['query'][_0x1a97('0x17')]['toLowerCase']();}var _0x4ae941=_['startCase'](_0x5f3dfa)+_0x1a97('0x45');var _0x1e0cf7=_[_0x1a97('0x26')](db[_0x4ae941]['rawAttributes'],function(_0x3f510c){return{'name':_0x3f510c[_0x1a97('0x29')],'type':_0x3f510c[_0x1a97('0x2a')][_0x1a97('0x2b')]};});if(!_0x221db4[_0x1a97('0x13')][_0x1a97('0x1f')]){var _0xce833f=['id','name'];if(_0x5f3dfa===_0x1a97('0x46')){_0xce833f[_0x1a97('0x30')](_0x1a97('0x2a'));if(_0x221db4[_0x1a97('0x13')][_0x1a97('0x2a')]==='outbound'){_0xce833f[_0x1a97('0x30')](['dialActive','dialMethod']);}}_0x221db4['query'][_0x1a97('0x1f')]=_0xce833f[_0x1a97('0x20')](',');}_0x9c9780=qs['getOptions'](_0x1e0cf7,_0x221db4);if(_0x221db4[_0x1a97('0x37')]['role']===_0x1a97('0x37')){var _0x3655b9={'params':{'id':_0x221db4[_0x1a97('0x37')][_0x1a97('0x38')]},'query':{'section':_0x5f3dfa===_0x1a97('0x46')&&_0x221db4[_0x1a97('0x13')][_0x1a97('0x2a')]===_0x1a97('0x47')?'QueueCampaigns':_['startCase'](_0x5f3dfa)+_0x1a97('0x48'),'type':_0x221db4[_0x1a97('0x13')][_0x1a97('0x2a')],'nolimit':!![],'sort':'name','filter':_0x221db4['query'][_0x1a97('0x49')]}};return db[_0x1a97('0x3b')][_0x1a97('0x4a')](_0x3655b9);}return db[_0x4ae941][_0x1a97('0x3c')](_0x9c9780);})[_0x1a97('0x16')](function(_0x241e36){_0x44c9e3[_0x1a97('0xb')]=_0x241e36[_0x1a97('0xb')];_0xe9dc31=_0x241e36[_0x1a97('0x22')];return rtq[_0x1a97('0x4b')](_0x221db4,_0x5f3dfa);})[_0x1a97('0x16')](function(_0x1f8d7d){_0x3cec92=_0x1f8d7d[_0x1a97('0x22')];return rtq[_0x1a97('0x4c')](_0xe9dc31,_0x3cec92,_0x5f3dfa,_0x221db4[_0x1a97('0x13')][_0x1a97('0x2a')]);})['then'](function(_0x3edec8){_0x44c9e3[_0x1a97('0x22')]=_0x3edec8;return _0x44c9e3;})['then'](respondWithFilteredResult(_0x8476b2,_0x9c9780))[_0x1a97('0x43')](APIHandleError(_0x8476b2));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 723e800..065489a 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x43469e,_0x4e69d6){var _0xcefd2a=function(_0x8ded6f){while(--_0x8ded6f){_0x43469e['push'](_0x43469e['shift']());}};_0xcefd2a(++_0x4e69d6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0xa9e0[_0x37bd26];return _0xe83dc4;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x11d486,_0x275600){var _0x24695b=function(_0x5ceb03){while(--_0x5ceb03){_0x11d486['push'](_0x11d486['shift']());}};_0x24695b(++_0x275600);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index b0c0a30..3a472e5 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 _0x5e0c=['INTEGER','STRING','DATE','exports'];(function(_0xc64699,_0x1b3076){var _0x40732e=function(_0x23d369){while(--_0x23d369){_0xc64699['push'](_0xc64699['shift']());}};_0x40732e(++_0x1b3076);}(_0x5e0c,0x19f));var _0xc5e0=function(_0x37d8ef,_0x53fdea){_0x37d8ef=_0x37d8ef-0x0;var _0x520900=_0x5e0c[_0x37d8ef];return _0x520900;};'use strict';var Sequelize=require('sequelize');module[_0xc5e0('0x0')]={'state':{'type':Sequelize[_0xc5e0('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xc5e0('0x2')]},'scheduledat':{'type':Sequelize[_0xc5e0('0x3')]},'uniqueid':{'type':Sequelize[_0xc5e0('0x2')]},'starttime':{'type':Sequelize[_0xc5e0('0x3')]},'responsetime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xc5e0('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xc5e0('0x2')]},'campaigntype':{'type':Sequelize[_0xc5e0('0x2')]},'membername':{'type':Sequelize[_0xc5e0('0x2')]}}; \ No newline at end of file +var _0x6144=['INTEGER','STRING','DATE','sequelize','exports'];(function(_0x25c34b,_0x51b7d5){var _0x12a716=function(_0x34fd8c){while(--_0x34fd8c){_0x25c34b['push'](_0x25c34b['shift']());}};_0x12a716(++_0x51b7d5);}(_0x6144,0x99));var _0x4614=function(_0x80097b,_0x128ee1){_0x80097b=_0x80097b-0x0;var _0x4ba6f3=_0x6144[_0x80097b];return _0x4ba6f3;};'use strict';var Sequelize=require(_0x4614('0x0'));module[_0x4614('0x1')]={'state':{'type':Sequelize[_0x4614('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x4614('0x3')]},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x4614('0x3')]},'starttime':{'type':Sequelize[_0x4614('0x4')]},'responsetime':{'type':Sequelize[_0x4614('0x4')]},'ringtime':{'type':Sequelize[_0x4614('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x4614('0x3')]},'membername':{'type':Sequelize[_0x4614('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index f4af63b..52a6598 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 _0x8db8=['path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x528eb7,_0x1f0c9a){var _0x3a0370=function(_0x5dea57){while(--_0x5dea57){_0x528eb7['push'](_0x528eb7['shift']());}};_0x3a0370(++_0x1f0c9a);}(_0x8db8,0x145));var _0x88db=function(_0x5c6c50,_0x24be01){_0x5c6c50=_0x5c6c50-0x0;var _0x1a8d2a=_0x8db8[_0x5c6c50];return _0x1a8d2a;};'use strict';var _=require(_0x88db('0x0'));var util=require('util');var logger=require(_0x88db('0x1'))('api');var moment=require(_0x88db('0x2'));var BPromise=require(_0x88db('0x3'));var rp=require(_0x88db('0x4'));var fs=require('fs');var path=require(_0x88db('0x5'));var rimraf=require(_0x88db('0x6'));var config=require(_0x88db('0x7'));var attributes=require(_0x88db('0x8'));module[_0x88db('0x9')]=function(_0x2095b0,_0x56cc64){return _0x2095b0[_0x88db('0xa')]('ReportAgentPreview',attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3f1=['request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','api','moment','bluebird'];(function(_0x33e023,_0x739c22){var _0x1656fa=function(_0x19a293){while(--_0x19a293){_0x33e023['push'](_0x33e023['shift']());}};_0x1656fa(++_0x739c22);}(_0xc3f1,0x13d));var _0x1c3f=function(_0x4a8b5f,_0xbfd3ad){_0x4a8b5f=_0x4a8b5f-0x0;var _0x5aa80d=_0xc3f1[_0x4a8b5f];return _0x5aa80d;};'use strict';var _=require(_0x1c3f('0x0'));var util=require(_0x1c3f('0x1'));var logger=require('../../config/logger')(_0x1c3f('0x2'));var moment=require(_0x1c3f('0x3'));var BPromise=require(_0x1c3f('0x4'));var rp=require(_0x1c3f('0x5'));var fs=require('fs');var path=require(_0x1c3f('0x6'));var rimraf=require(_0x1c3f('0x7'));var config=require(_0x1c3f('0x8'));var attributes=require(_0x1c3f('0x9'));module[_0x1c3f('0xa')]=function(_0x39f1ff,_0x1f64c9){return _0x39f1ff[_0x1c3f('0xb')](_0x1c3f('0xc'),attributes,{'tableName':_0x1c3f('0xd'),'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 c1b7b8d..4e61605 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 _0xa713=['lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','http','request','then','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','ReportAgentPreview,\x20%s,\x20%s','result','catch','CreateReportAgentPreview','body','options','info'];(function(_0x473767,_0x1f69f9){var _0x193a36=function(_0x1851b4){while(--_0x1851b4){_0x473767['push'](_0x473767['shift']());}};_0x193a36(++_0x1f69f9);}(_0xa713,0xe6));var _0x3a71=function(_0x457e81,_0x44c530){_0x457e81=_0x457e81-0x0;var _0x2558e4=_0xa713[_0x457e81];return _0x2558e4;};'use strict';var _=require(_0x3a71('0x0'));var util=require(_0x3a71('0x1'));var moment=require(_0x3a71('0x2'));var BPromise=require('bluebird');var rs=require(_0x3a71('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3a71('0x4'));var logger=require(_0x3a71('0x5'))(_0x3a71('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3a71('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x49ff93,_0x2029e6,_0x19d306){return new BPromise(function(_0x2d1a94,_0x4733fa){return client[_0x3a71('0x8')](_0x49ff93,_0x19d306)[_0x3a71('0x9')](function(_0x2828d1){logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x2029e6,'request\x20sent');logger[_0x3a71('0xa')](_0x3a71('0xb'),_0x2029e6,_0x3a71('0xc'),JSON[_0x3a71('0xd')](_0x2828d1));if(_0x2828d1['error']){if(_0x2828d1['error']['code']===0x1f4){logger[_0x3a71('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x2029e6,_0x2828d1['error'][_0x3a71('0xf')]);return _0x4733fa(_0x2828d1[_0x3a71('0xe')][_0x3a71('0xf')]);}logger[_0x3a71('0xe')](_0x3a71('0x10'),_0x2029e6,_0x2828d1[_0x3a71('0xe')][_0x3a71('0xf')]);return _0x2d1a94(_0x2828d1[_0x3a71('0xe')][_0x3a71('0xf')]);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x2029e6,_0x3a71('0xc'));_0x2d1a94(_0x2828d1[_0x3a71('0x11')]['message']);}})[_0x3a71('0x12')](function(_0x4bf7b8){logger['error']('ReportAgentPreview,\x20%s,\x20%s',_0x2029e6,_0x4bf7b8);_0x4733fa(_0x4bf7b8);});});}exports[_0x3a71('0x13')]=function(_0x4b60b8){var _0x2f7f9a=this;return new Promise(function(_0x4d6d10,_0x41b1e2){return db['ReportAgentPreview']['create'](_0x4b60b8[_0x3a71('0x14')],{'raw':_0x4b60b8[_0x3a71('0x15')]?_0x4b60b8[_0x3a71('0x15')]['raw']===undefined?!![]:![]:!![]})[_0x3a71('0x9')](function(_0x141e4a){logger[_0x3a71('0x16')](_0x3a71('0x13'),_0x4b60b8);logger[_0x3a71('0xa')](_0x3a71('0x13'),_0x4b60b8,JSON[_0x3a71('0xd')](_0x141e4a));_0x4d6d10(_0x141e4a);})['catch'](function(_0x1dd509){logger[_0x3a71('0xe')](_0x3a71('0x13'),_0x1dd509[_0x3a71('0xf')],_0x4b60b8);_0x41b1e2(_0x2f7f9a[_0x3a71('0xe')](0x1f4,_0x1dd509[_0x3a71('0xf')]));});});}; \ No newline at end of file +var _0x520f=['debug','stringify','error','code','ReportAgentPreview,\x20%s,\x20%s','message','result','catch','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','request\x20sent'];(function(_0x42e179,_0x12fe7f){var _0x538938=function(_0x4d76b0){while(--_0x4d76b0){_0x42e179['push'](_0x42e179['shift']());}};_0x538938(++_0x12fe7f);}(_0x520f,0x11c));var _0xf520=function(_0x1cfc39,_0x15adef){_0x1cfc39=_0x1cfc39-0x0;var _0x1ae59b=_0x520f[_0x1cfc39];return _0x1ae59b;};'use strict';var _=require(_0xf520('0x0'));var util=require(_0xf520('0x1'));var moment=require(_0xf520('0x2'));var BPromise=require(_0xf520('0x3'));var rs=require(_0xf520('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf520('0x5'))['db'];var utils=require(_0xf520('0x6'));var logger=require('../../config/logger')(_0xf520('0x7'));var config=require('../../config/environment');var jayson=require(_0xf520('0x8'));var client=jayson[_0xf520('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c85e8,_0x1193c6,_0x4d22ba){return new BPromise(function(_0x27a668,_0x574208){return client[_0xf520('0xa')](_0x5c85e8,_0x4d22ba)[_0xf520('0xb')](function(_0x1a9c61){logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x1193c6,_0xf520('0xc'));logger[_0xf520('0xd')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x1193c6,_0xf520('0xc'),JSON[_0xf520('0xe')](_0x1a9c61));if(_0x1a9c61[_0xf520('0xf')]){if(_0x1a9c61[_0xf520('0xf')][_0xf520('0x10')]===0x1f4){logger[_0xf520('0xf')](_0xf520('0x11'),_0x1193c6,_0x1a9c61[_0xf520('0xf')][_0xf520('0x12')]);return _0x574208(_0x1a9c61['error'][_0xf520('0x12')]);}logger['error'](_0xf520('0x11'),_0x1193c6,_0x1a9c61[_0xf520('0xf')][_0xf520('0x12')]);return _0x27a668(_0x1a9c61[_0xf520('0xf')][_0xf520('0x12')]);}else{logger['info'](_0xf520('0x11'),_0x1193c6,_0xf520('0xc'));_0x27a668(_0x1a9c61[_0xf520('0x13')]['message']);}})[_0xf520('0x14')](function(_0x4b7c70){logger['error'](_0xf520('0x11'),_0x1193c6,_0x4b7c70);_0x574208(_0x4b7c70);});});}exports['CreateReportAgentPreview']=function(_0x1b0ecc){var _0x3c57e4=this;return new Promise(function(_0x1abb32,_0x4cbef0){return db[_0xf520('0x15')][_0xf520('0x16')](_0x1b0ecc[_0xf520('0x17')],{'raw':_0x1b0ecc['options']?_0x1b0ecc[_0xf520('0x18')][_0xf520('0x19')]===undefined?!![]:![]:!![]})[_0xf520('0xb')](function(_0x10ead7){logger['info'](_0xf520('0x1a'),_0x1b0ecc);logger[_0xf520('0xd')](_0xf520('0x1a'),_0x1b0ecc,JSON[_0xf520('0xe')](_0x10ead7));_0x1abb32(_0x10ead7);})[_0xf520('0x14')](function(_0xe3c960){logger[_0xf520('0xf')]('CreateReportAgentPreview',_0xe3c960['message'],_0x1b0ecc);_0x4cbef0(_0x3c57e4[_0xf520('0xf')](0x1f4,_0xe3c960[_0xf520('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index c2dbafc..4b8a847 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 _0x33d4=['post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','queueNotify','fax','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','multer','path','express','Router','../../components/auth/service','./rpc.controller','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions'];(function(_0x2d929c,_0x1e231d){var _0x20dac1=function(_0x3ac2c2){while(--_0x3ac2c2){_0x2d929c['push'](_0x2d929c['shift']());}};_0x20dac1(++_0x1e231d);}(_0x33d4,0x111));var _0x433d=function(_0x1111ba,_0x506977){_0x1111ba=_0x1111ba-0x0;var _0x5cf412=_0x33d4[_0x1111ba];return _0x5cf412;};'use strict';var multer=require(_0x433d('0x0'));var util=require('util');var path=require(_0x433d('0x1'));var express=require(_0x433d('0x2'));var router=express[_0x433d('0x3')]();var auth=require(_0x433d('0x4'));var controller=require(_0x433d('0x5'));router['get']('/voice/channels',auth[_0x433d('0x6')](),controller[_0x433d('0x7')]);router[_0x433d('0x8')](_0x433d('0x9'),auth['isAuthenticated'](),controller[_0x433d('0xa')]);router[_0x433d('0x8')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x433d('0x6')](),controller['voiceChannelStopMixMonitor']);router[_0x433d('0x8')](_0x433d('0xb'),auth[_0x433d('0x6')](),controller[_0x433d('0xc')]);router['get'](_0x433d('0xd'),auth[_0x433d('0x6')](),controller[_0x433d('0xe')]);router[_0x433d('0x8')](_0x433d('0xf'),auth[_0x433d('0x6')](),controller['mailQueues']);router['get'](_0x433d('0x10'),auth['isAuthenticated'](),controller[_0x433d('0x11')]);router[_0x433d('0x8')](_0x433d('0x12'),auth[_0x433d('0x6')](),controller['openchannelQueues']);router[_0x433d('0x8')]('/sms/queues',auth[_0x433d('0x6')](),controller[_0x433d('0x13')]);router[_0x433d('0x8')](_0x433d('0x14'),auth[_0x433d('0x6')](),controller[_0x433d('0x15')]);router[_0x433d('0x8')](_0x433d('0x16'),auth[_0x433d('0x6')](),controller[_0x433d('0x17')]);router['get'](_0x433d('0x18'),auth[_0x433d('0x6')](),controller[_0x433d('0x19')]);router['get']('/voice/queues/channels',auth[_0x433d('0x6')](),controller[_0x433d('0x1a')]);router[_0x433d('0x8')](_0x433d('0x1b'),auth[_0x433d('0x6')](),controller[_0x433d('0x1c')]);router[_0x433d('0x8')](_0x433d('0x1d'),auth[_0x433d('0x6')](),controller[_0x433d('0x1e')]);router[_0x433d('0x8')]('/voice/queues/channels/:uniqueid/redirect/:exten',auth[_0x433d('0x6')](),controller[_0x433d('0x1f')]);router[_0x433d('0x8')](_0x433d('0x20'),auth[_0x433d('0x6')](),controller[_0x433d('0x21')]);router['put']('/voice/queues/:id',auth[_0x433d('0x6')](),controller[_0x433d('0x22')]);router['get']('/outbound',auth[_0x433d('0x6')](),controller['outbound']);router[_0x433d('0x8')](_0x433d('0x23'),auth[_0x433d('0x6')](),controller[_0x433d('0x24')]);router[_0x433d('0x8')](_0x433d('0x25'),auth['isAuthenticated'](),controller[_0x433d('0x26')]);router['put'](_0x433d('0x27'),auth[_0x433d('0x6')](),controller[_0x433d('0x28')]);router[_0x433d('0x8')](_0x433d('0x29'),auth['isAuthenticated'](),controller[_0x433d('0x2a')]);router[_0x433d('0x8')](_0x433d('0x2b'),auth[_0x433d('0x6')](),controller[_0x433d('0x2c')]);router[_0x433d('0x8')](_0x433d('0x2d'),auth[_0x433d('0x6')](),controller['campaigns']);router['get'](_0x433d('0x2e'),auth['isAuthenticated'](),controller[_0x433d('0x2f')]);router[_0x433d('0x8')](_0x433d('0x30'),auth[_0x433d('0x6')](),controller[_0x433d('0x31')]);router[_0x433d('0x8')](_0x433d('0x32'),auth[_0x433d('0x6')](),controller[_0x433d('0x33')]);router['get'](_0x433d('0x34'),auth[_0x433d('0x6')](),controller[_0x433d('0x35')]);router[_0x433d('0x8')](_0x433d('0x36'),auth[_0x433d('0x6')](),controller['openchannelQueuesIdWaitingInteractions']);router[_0x433d('0x8')](_0x433d('0x37'),auth[_0x433d('0x6')](),controller[_0x433d('0x38')]);router['get']('/whatsapp/queues/waitinginteractions',auth['isAuthenticated'](),controller['whatsappQueuesWaitingInteractions']);router['get'](_0x433d('0x39'),auth[_0x433d('0x6')](),controller[_0x433d('0x3a')]);router[_0x433d('0x3b')](_0x433d('0x3c'),auth[_0x433d('0x6')](),controller['queueNotify'](_0x433d('0x3d')));router[_0x433d('0x8')](_0x433d('0x3e'),auth[_0x433d('0x6')](),controller[_0x433d('0x3f')]);router['post'](_0x433d('0x40'),auth['isAuthenticated'](),controller['queueNotify'](_0x433d('0x41')));router[_0x433d('0x8')](_0x433d('0x42'),auth[_0x433d('0x6')](),controller[_0x433d('0x43')]);router[_0x433d('0x3b')]('/fax/queues/:id/notify',auth[_0x433d('0x6')](),controller[_0x433d('0x44')](_0x433d('0x45')));router['get'](_0x433d('0x46'),auth[_0x433d('0x6')](),controller['showFaxQueues']);router[_0x433d('0x3b')](_0x433d('0x47'),auth['isAuthenticated'](),controller[_0x433d('0x44')](_0x433d('0x48')));router[_0x433d('0x8')]('/openchannel/queues/:id',auth[_0x433d('0x6')](),controller[_0x433d('0x49')]);router[_0x433d('0x3b')]('/sms/queues/:id/notify',auth['isAuthenticated'](),controller[_0x433d('0x44')](_0x433d('0x4a')));router['post'](_0x433d('0x4b'),auth[_0x433d('0x6')](),controller['queueNotify'](_0x433d('0x4c')));router[_0x433d('0x8')](_0x433d('0x4d'),auth['isAuthenticated'](),controller[_0x433d('0x4e')]);router[_0x433d('0x8')](_0x433d('0x4f'),auth['isAuthenticated'](),controller['showWhatsappQueues']);router[_0x433d('0x3b')](_0x433d('0x50'),auth[_0x433d('0x6')](),controller[_0x433d('0x51')]);module[_0x433d('0x52')]=router; \ No newline at end of file +var _0x1fd9=['/agents/:id/capacity','agentCapacity','telephones','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','queueNotify','/fax/queues/:id','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','whatsapp','showSmsQueues','/agents/:id/notify','agentNotify','exports','util','express','Router','../../components/auth/service','./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','voiceChannelMixMonitor','get','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','/agents','put'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1fd9,0x1b8));var _0x91fd=function(_0xaf8035,_0x19ecd1){_0xaf8035=_0xaf8035-0x0;var _0xe90cff=_0x1fd9[_0xaf8035];return _0xe90cff;};'use strict';var multer=require('multer');var util=require(_0x91fd('0x0'));var path=require('path');var express=require(_0x91fd('0x1'));var router=express[_0x91fd('0x2')]();var auth=require(_0x91fd('0x3'));var controller=require(_0x91fd('0x4'));router['get'](_0x91fd('0x5'),auth[_0x91fd('0x6')](),controller[_0x91fd('0x7')]);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0x91fd('0x6')](),controller[_0x91fd('0x8')]);router[_0x91fd('0x9')]('/voice/channels/:uniqueid/stopmixmonitor',auth['isAuthenticated'](),controller[_0x91fd('0xa')]);router[_0x91fd('0x9')](_0x91fd('0xb'),auth[_0x91fd('0x6')](),controller[_0x91fd('0xc')]);router[_0x91fd('0x9')](_0x91fd('0xd'),auth[_0x91fd('0x6')](),controller[_0x91fd('0xe')]);router[_0x91fd('0x9')](_0x91fd('0xf'),auth[_0x91fd('0x6')](),controller[_0x91fd('0x10')]);router['get'](_0x91fd('0x11'),auth['isAuthenticated'](),controller[_0x91fd('0x12')]);router[_0x91fd('0x9')](_0x91fd('0x13'),auth[_0x91fd('0x6')](),controller[_0x91fd('0x14')]);router[_0x91fd('0x9')](_0x91fd('0x15'),auth['isAuthenticated'](),controller[_0x91fd('0x16')]);router['get'](_0x91fd('0x17'),auth[_0x91fd('0x6')](),controller['whatsappQueues']);router[_0x91fd('0x9')]('/fax/queues',auth['isAuthenticated'](),controller[_0x91fd('0x18')]);router[_0x91fd('0x9')](_0x91fd('0x19'),auth['isAuthenticated'](),controller[_0x91fd('0x1a')]);router[_0x91fd('0x9')]('/voice/queues/channels',auth[_0x91fd('0x6')](),controller[_0x91fd('0x1b')]);router[_0x91fd('0x9')]('/voice/queues/channels/:uniqueid',auth[_0x91fd('0x6')](),controller[_0x91fd('0x1c')]);router['get'](_0x91fd('0x1d'),auth[_0x91fd('0x6')](),controller[_0x91fd('0x1e')]);router['get'](_0x91fd('0x1f'),auth[_0x91fd('0x6')](),controller[_0x91fd('0x20')]);router[_0x91fd('0x9')](_0x91fd('0x21'),auth[_0x91fd('0x6')](),controller[_0x91fd('0x22')]);router['put'](_0x91fd('0x21'),auth[_0x91fd('0x6')](),controller['updateVoiceQueue']);router[_0x91fd('0x9')](_0x91fd('0x23'),auth[_0x91fd('0x6')](),controller[_0x91fd('0x24')]);router[_0x91fd('0x9')](_0x91fd('0x25'),auth[_0x91fd('0x6')](),controller['outboundChannels']);router['get'](_0x91fd('0x26'),auth[_0x91fd('0x6')](),controller['agents']);router[_0x91fd('0x27')](_0x91fd('0x28'),auth[_0x91fd('0x6')](),controller[_0x91fd('0x29')]);router[_0x91fd('0x9')]('/telephones',auth['isAuthenticated'](),controller[_0x91fd('0x2a')]);router[_0x91fd('0x9')]('/trunks',auth[_0x91fd('0x6')](),controller['trunks']);router[_0x91fd('0x9')]('/campaigns',auth[_0x91fd('0x6')](),controller[_0x91fd('0x2b')]);router[_0x91fd('0x9')](_0x91fd('0x2c'),auth[_0x91fd('0x6')](),controller[_0x91fd('0x2d')]);router[_0x91fd('0x9')]('/chat/queues/waitinginteractions',auth[_0x91fd('0x6')](),controller[_0x91fd('0x2e')]);router['get'](_0x91fd('0x2f'),auth[_0x91fd('0x6')](),controller[_0x91fd('0x30')]);router[_0x91fd('0x9')](_0x91fd('0x31'),auth[_0x91fd('0x6')](),controller[_0x91fd('0x32')]);router['get'](_0x91fd('0x33'),auth[_0x91fd('0x6')](),controller[_0x91fd('0x34')]);router[_0x91fd('0x9')](_0x91fd('0x35'),auth['isAuthenticated'](),controller[_0x91fd('0x36')]);router['get'](_0x91fd('0x37'),auth[_0x91fd('0x6')](),controller['whatsappQueuesWaitingInteractions']);router[_0x91fd('0x9')]('/fax/queues/waitinginteractions',auth[_0x91fd('0x6')](),controller[_0x91fd('0x38')]);router[_0x91fd('0x39')](_0x91fd('0x3a'),auth[_0x91fd('0x6')](),controller['queueNotify'](_0x91fd('0x3b')));router['get'](_0x91fd('0x3c'),auth[_0x91fd('0x6')](),controller[_0x91fd('0x3d')]);router[_0x91fd('0x39')](_0x91fd('0x3e'),auth[_0x91fd('0x6')](),controller['queueNotify'](_0x91fd('0x3f')));router['get'](_0x91fd('0x40'),auth[_0x91fd('0x6')](),controller[_0x91fd('0x41')]);router[_0x91fd('0x39')](_0x91fd('0x42'),auth[_0x91fd('0x6')](),controller[_0x91fd('0x43')]('fax'));router['get'](_0x91fd('0x44'),auth['isAuthenticated'](),controller['showFaxQueues']);router[_0x91fd('0x39')](_0x91fd('0x45'),auth[_0x91fd('0x6')](),controller[_0x91fd('0x43')](_0x91fd('0x46')));router[_0x91fd('0x9')](_0x91fd('0x47'),auth[_0x91fd('0x6')](),controller[_0x91fd('0x48')]);router[_0x91fd('0x39')](_0x91fd('0x49'),auth[_0x91fd('0x6')](),controller['queueNotify'](_0x91fd('0x4a')));router['post']('/whatsapp/queues/:id/notify',auth[_0x91fd('0x6')](),controller[_0x91fd('0x43')](_0x91fd('0x4b')));router[_0x91fd('0x9')]('/sms/queues/:id',auth['isAuthenticated'](),controller[_0x91fd('0x4c')]);router[_0x91fd('0x9')]('/whatsapp/queues/:id',auth[_0x91fd('0x6')](),controller['showWhatsappQueues']);router['post'](_0x91fd('0x4d'),auth['isAuthenticated'](),controller[_0x91fd('0x4e')]);module[_0x91fd('0x4f')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 1babb91..f738e54 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 _0xe14b=['MessageId','InteractionId','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','chat','Website','User','agent','Agent\x20not\x20found','Message','update','From','bluebird','moment','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','error','message','result','catch','status','json','sendStatus','name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','params','VoiceChannelStopMixMonitor','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','agents','Agents','agentCapacity','interaction','user','hasOwnProperty','MemberReport','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','findOrCreate','interface','internal','AgentCapacity','capacity','telephones','Trunks','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Account','Queue','findOne','\x20Queue\x20not\x20found','messageId','Interaction','\x20Message\x20not\x20found'];(function(_0x2d9443,_0x558bca){var _0x5cbf52=function(_0xa246f9){while(--_0xa246f9){_0x2d9443['push'](_0x2d9443['shift']());}};_0x5cbf52(++_0x558bca);}(_0xe14b,0x93));var _0xbe14=function(_0x3006cb,_0x570eda){_0x3006cb=_0x3006cb-0x0;var _0x3eb32f=_0xe14b[_0x3006cb];return _0x3eb32f;};'use strict';var BPromise=require(_0xbe14('0x0'));var moment=require(_0xbe14('0x1'));var _=require('lodash');var util=require('util');var db=require(_0xbe14('0x2'))['db'];var logger=require(_0xbe14('0x3'))('api');var jayson=require(_0xbe14('0x4'));var amiClient=jayson['client']['http']({'port':0x232a});var mailClient=jayson[_0xbe14('0x5')][_0xbe14('0x6')]({'port':0x232b});var routingClient=jayson[_0xbe14('0x5')][_0xbe14('0x6')]({'port':0x232c});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){var _0x496063=_0x196fca?_0x196fca:amiClient;return _0x496063[_0xbe14('0x7')](_0x1d9ade,_0x39387e)[_0xbe14('0x8')](function(_0xd68cd7){if(_0xd68cd7[_0xbe14('0x9')]){if(_0xd68cd7['error']['code']===0x1f4){return _0x50f909(_0xd68cd7[_0xbe14('0x9')][_0xbe14('0xa')]);}return _0x566ae7(_0xd68cd7['error'][_0xbe14('0xa')]);}else{_0x566ae7(_0xd68cd7[_0xbe14('0xb')]);}})[_0xbe14('0xc')](function(_0x3d38c2){_0x50f909(_0x3d38c2);});});}function respondWithResult(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xc8;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0xd')](_0x3b898d)[_0xbe14('0xe')](_0x23a730);}return _0x27792f[_0xbe14('0xf')](0x194);};}function handleError(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0x1f4;return function(_0x813399){logger['error'](_0x813399['stack']);if(_0x813399[_0xbe14('0x10')]){delete _0x813399[_0xbe14('0x10')];}_0x1e4826[_0xbe14('0xd')](_0x33fd54)[_0xbe14('0x11')](_0x813399);};}function findById(_0x4e8f34){return function(_0x21c789){if(!_[_0xbe14('0x12')](_0x4e8f34)&&!_[_0xbe14('0x12')](_0x21c789)&&!_[_0xbe14('0x12')](_0x21c789[_0xbe14('0x13')])){return _[_0xbe14('0x14')](_0x21c789[_0xbe14('0x13')],function(_0x5ea1f8){return _0x5ea1f8['id']==_0x4e8f34;});}return null;};}exports[_0xbe14('0x15')]=function(_0x456ca8,_0x329588){return respondWithRpcPromise(_0xbe14('0x16'),_0x456ca8[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x329588,null))['catch'](handleError(_0x329588,null));};exports[_0xbe14('0x18')]=function(_0x4a1bbd,_0x417c8d){return respondWithRpcPromise(_0xbe14('0x19'),_[_0xbe14('0x1a')](_0x4a1bbd['query'],_0x4a1bbd[_0xbe14('0x1b')]))['then'](respondWithResult(_0x417c8d,null))[_0xbe14('0xc')](handleError(_0x417c8d,null));};exports['voiceChannelStopMixMonitor']=function(_0x32e8eb,_0x4a25fa){return respondWithRpcPromise(_0xbe14('0x1c'),_[_0xbe14('0x1a')](_0x32e8eb['query'],_0x32e8eb[_0xbe14('0x1b')]))['then'](respondWithResult(_0x4a25fa,null))[_0xbe14('0xc')](handleError(_0x4a25fa,null));};exports['voiceQueues']=function(_0x36a21e,_0x5fa043){return respondWithRpcPromise(_0xbe14('0x1d'),_0x36a21e[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x5fa043,null))[_0xbe14('0xc')](handleError(_0x5fa043,null));};exports['showVoiceQueues']=function(_0x1822e0,_0x1ba46a){return respondWithRpcPromise(_0xbe14('0x1d'),_0x1822e0[_0xbe14('0x17')])['then'](findById(_0x1822e0[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x1ba46a,null))['catch'](handleError(_0x1ba46a,null));};exports[_0xbe14('0x1e')]=function(_0x3b3e84,_0x1c7cc7){return respondWithRpcPromise(_0xbe14('0x1f'),_[_0xbe14('0x1a')](_0x3b3e84[_0xbe14('0x20')],_0x3b3e84[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x1c7cc7,null))[_0xbe14('0xc')](handleError(_0x1c7cc7,null));};exports[_0xbe14('0x21')]=function(_0x40538f,_0x3bf43c){return respondWithRpcPromise(_0xbe14('0x22'),_[_0xbe14('0x1a')](_0x40538f[_0xbe14('0x17')],_0x40538f[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x3bf43c,null))[_0xbe14('0xc')](handleError(_0x3bf43c,null));};exports[_0xbe14('0x23')]=function(_0x14e7c4,_0x581e86){return respondWithRpcPromise(_0xbe14('0x24'),_0x14e7c4['query'])['then'](respondWithResult(_0x581e86,null))[_0xbe14('0xc')](handleError(_0x581e86,null));};exports['voiceQueuesChannel']=function(_0x243524,_0x345b0){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x243524['query'],_0x243524[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x345b0,null))['catch'](handleError(_0x345b0,null));};exports[_0xbe14('0x25')]=function(_0x1faf3e,_0x452635){return respondWithRpcPromise(_0xbe14('0x26'),_[_0xbe14('0x1a')](_0x1faf3e['query'],_0x1faf3e['params']))[_0xbe14('0x8')](respondWithResult(_0x452635,null))['catch'](handleError(_0x452635,null));};exports['voiceQueuesChannelRedirect']=function(_0x5c5e9f,_0x163ef7){return respondWithRpcPromise(_0xbe14('0x27'),_[_0xbe14('0x1a')](_0x5c5e9f[_0xbe14('0x17')],_0x5c5e9f[_0xbe14('0x1b')]))[_0xbe14('0x8')](respondWithResult(_0x163ef7,null))[_0xbe14('0xc')](handleError(_0x163ef7,null));};exports[_0xbe14('0x28')]=function(_0x2d9c12,_0x2dfd5a){return respondWithRpcPromise(_0xbe14('0x29'),_0x2d9c12[_0xbe14('0x17')])['then'](respondWithResult(_0x2dfd5a,null))['catch'](handleError(_0x2dfd5a,null));};exports[_0xbe14('0x2a')]=function(_0x2951e1,_0x13bfcf){return respondWithRpcPromise('OutboundChannels',_0x2951e1[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x13bfcf,null))[_0xbe14('0xc')](handleError(_0x13bfcf,null));};exports[_0xbe14('0x2b')]=function(_0x3bd454,_0x25ee1f){var _0x19fa30;return respondWithRpcPromise(_0xbe14('0x2c'),_0x3bd454[_0xbe14('0x17')])['then'](function(_0xe51424){_0x19fa30=_0xe51424;return respondWithRpcPromise(_0xbe14('0x2c'),_0x3bd454[_0xbe14('0x17')],routingClient);})[_0xbe14('0x8')](function(_0x3287b9){return _[_0xbe14('0x1a')]({},_0x3287b9,_0x19fa30);})['then'](respondWithResult(_0x25ee1f,null))[_0xbe14('0xc')](handleError(_0x25ee1f,null));};exports[_0xbe14('0x2d')]=function(_0x1220c9,_0x36263c){if(_0x1220c9['body']&&_0x1220c9['body'][_0xbe14('0x2e')]&&_0x1220c9[_0xbe14('0x2f')]&&_0x1220c9[_0xbe14('0x2f')]['name']){for(var _0x5d5318 in _0x1220c9[_0xbe14('0x20')]['interaction']){if(_0x1220c9['body'][_0xbe14('0x2e')][_0xbe14('0x30')](_0x5d5318)){db[_0xbe14('0x31')]['findAll']({'where':{'channel':_0x5d5318,'membername':_0x1220c9['user']['name'],'type':_0xbe14('0x32'),'exitAt':null,'uniqueid':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318]&&_0x1220c9['body'][_0xbe14('0x2e')][_0x5d5318][_0xbe14('0x33')]?{'$notIn':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318]}:{'$ne':null}}})['then'](function(_0x4a1a4b){var _0x3e2fd3=moment()[_0xbe14('0x34')](_0xbe14('0x35'));for(var _0xb2b285=0x0,_0x2550dc=_0x4a1a4b['length'];_0xb2b285<_0x2550dc;_0xb2b285+=0x1){_0x4a1a4b[_0xb2b285]['updateAttributes']({'exitAt':_0x3e2fd3});}});for(var _0x46af81=0x0;_0x46af81<_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318][_0xbe14('0x33')];_0x46af81+=0x1){db['MemberReport'][_0xbe14('0x36')]({'where':{'channel':_0x5d5318,'membername':_0x1220c9[_0xbe14('0x2f')]['name'],'type':_0xbe14('0x32'),'uniqueid':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318][_0x46af81],'exitAt':null},'defaults':{'channel':_0x5d5318,'membername':_0x1220c9[_0xbe14('0x2f')]['name'],'interface':_['isNil'](_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x37')])?util['format']('SIP/%s',_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x10')]):_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x37')],'type':_0xbe14('0x32'),'enterAt':moment()[_0xbe14('0x34')](_0xbe14('0x35')),'role':'agent','internal':_0x1220c9[_0xbe14('0x2f')][_0xbe14('0x38')],'uniqueid':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x2e')][_0x5d5318][_0x46af81]}});}}}}return respondWithRpcPromise(_0xbe14('0x39'),{'id':_0x1220c9['params']['id'],'capacity':_0x1220c9[_0xbe14('0x20')][_0xbe14('0x3a')]},routingClient)[_0xbe14('0x8')](respondWithResult(_0x36263c,null))[_0xbe14('0xc')](handleError(_0x36263c,null));};exports[_0xbe14('0x3b')]=function(_0x2dbeb1,_0x505829){return respondWithRpcPromise('Telephones',_0x2dbeb1[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x505829,null))[_0xbe14('0xc')](handleError(_0x505829,null));};exports['trunks']=function(_0x497b00,_0x44fe0d){return respondWithRpcPromise(_0xbe14('0x3c'),_0x497b00['query'])[_0xbe14('0x8')](respondWithResult(_0x44fe0d,null))[_0xbe14('0xc')](handleError(_0x44fe0d,null));};exports['campaigns']=function(_0x28f995,_0x4a40d2){return respondWithRpcPromise(_0xbe14('0x3d'),_0x28f995[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x4a40d2,null))['catch'](handleError(_0x4a40d2,null));};exports[_0xbe14('0x3e')]=function(_0x404212,_0x5dc78a){return respondWithRpcPromise(_0xbe14('0x3f'),_0x404212[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x5dc78a,null))[_0xbe14('0xc')](handleError(_0x5dc78a,null));};exports[_0xbe14('0x40')]=function(_0x4f06a3,_0x42a346){return respondWithRpcPromise(_0xbe14('0x3f'),_0x4f06a3[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](findById(_0x4f06a3[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x42a346,null))[_0xbe14('0xc')](handleError(_0x42a346,null));};exports['mailQueues']=function(_0x72c875,_0x1b47a4){return respondWithRpcPromise(_0xbe14('0x41'),_0x72c875[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x1b47a4,null))[_0xbe14('0xc')](handleError(_0x1b47a4,null));};exports[_0xbe14('0x42')]=function(_0x32df3c,_0x285b6e){return respondWithRpcPromise(_0xbe14('0x41'),_0x32df3c[_0xbe14('0x17')],routingClient)['then'](findById(_0x32df3c['params']['id']))['then'](respondWithResult(_0x285b6e,null))[_0xbe14('0xc')](handleError(_0x285b6e,null));};exports[_0xbe14('0x43')]=function(_0x2f4e52,_0xf79b21){return respondWithRpcPromise(_0xbe14('0x44'),_0x2f4e52[_0xbe14('0x17')],mailClient)[_0xbe14('0x8')](respondWithResult(_0xf79b21,null))[_0xbe14('0xc')](handleError(_0xf79b21,null));};exports[_0xbe14('0x45')]=function(_0x451b0b,_0x603816){return respondWithRpcPromise(_0xbe14('0x46'),_0x451b0b[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x603816,null))[_0xbe14('0xc')](handleError(_0x603816,null));};exports[_0xbe14('0x47')]=function(_0x179077,_0x2225d9){return respondWithRpcPromise(_0xbe14('0x46'),_0x179077[_0xbe14('0x17')],routingClient)['then'](findById(_0x179077[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x2225d9,null))[_0xbe14('0xc')](handleError(_0x2225d9,null));};exports[_0xbe14('0x48')]=function(_0x3ee6b7,_0x222944){return respondWithRpcPromise(_0xbe14('0x49'),_0x3ee6b7[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x222944,null))[_0xbe14('0xc')](handleError(_0x222944,null));};exports['showSmsQueues']=function(_0x18be56,_0x442ec4){return respondWithRpcPromise(_0xbe14('0x49'),_0x18be56[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](findById(_0x18be56['params']['id']))[_0xbe14('0x8')](respondWithResult(_0x442ec4,null))[_0xbe14('0xc')](handleError(_0x442ec4,null));};exports[_0xbe14('0x4a')]=function(_0xd4e1c7,_0x46ac9c){return respondWithRpcPromise('WhatsappQueues',_0xd4e1c7[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x46ac9c,null))[_0xbe14('0xc')](handleError(_0x46ac9c,null));};exports[_0xbe14('0x4b')]=function(_0xaebce8,_0x289c4d){return respondWithRpcPromise(_0xbe14('0x4c'),_0xaebce8[_0xbe14('0x17')],routingClient)['then'](findById(_0xaebce8[_0xbe14('0x1b')]['id']))[_0xbe14('0x8')](respondWithResult(_0x289c4d,null))[_0xbe14('0xc')](handleError(_0x289c4d,null));};exports[_0xbe14('0x4d')]=function(_0x5982b7,_0xa4b2a3){return respondWithRpcPromise(_0xbe14('0x4e'),_0x5982b7['query'],routingClient)['then'](respondWithResult(_0xa4b2a3,null))[_0xbe14('0xc')](handleError(_0xa4b2a3,null));};exports[_0xbe14('0x4f')]=function(_0x2d2643,_0x2510a0){return respondWithRpcPromise(_0xbe14('0x4e'),_0x2d2643[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](findById(_0x2d2643[_0xbe14('0x1b')]['id']))['then'](respondWithResult(_0x2510a0,null))['catch'](handleError(_0x2510a0,null));};exports[_0xbe14('0x50')]=function(_0x1c18b6,_0x29aa52){return respondWithRpcPromise('FaxAccounts',_0x1c18b6[_0xbe14('0x17')])[_0xbe14('0x8')](respondWithResult(_0x29aa52,null))[_0xbe14('0xc')](handleError(_0x29aa52,null));};exports[_0xbe14('0x51')]=function(_0x468e9f,_0x1ef09b){return respondWithRpcPromise(_0xbe14('0x52'),_0x468e9f['query'],routingClient)[_0xbe14('0x8')](respondWithResult(_0x1ef09b,null))[_0xbe14('0xc')](handleError(_0x1ef09b,null));};exports[_0xbe14('0x53')]=function(_0x3afc5a,_0x469555){return respondWithRpcPromise(_0xbe14('0x54'),_0x3afc5a[_0xbe14('0x17')],routingClient)['then'](respondWithResult(_0x469555,null))[_0xbe14('0xc')](handleError(_0x469555,null));};exports[_0xbe14('0x55')]=function(_0x3cd17e,_0x1c0932){return respondWithRpcPromise(_0xbe14('0x56'),_0x3cd17e[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x1c0932,null))[_0xbe14('0xc')](handleError(_0x1c0932,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x1e5ce1,_0x401968){return respondWithRpcPromise(_0xbe14('0x56'),_0x1e5ce1[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](function(_0x17576b){if(_0x1e5ce1['query'][_0xbe14('0x57')]!==undefined){var _0x175213=_(_0x17576b[_0xbe14('0x13')])[_0xbe14('0x58')]([_0x1e5ce1['query'][_0xbe14('0x57')],_0x1e5ce1[_0xbe14('0x1b')]['id']])[_0xbe14('0x59')](_0xbe14('0x5a'))[_0xbe14('0x5b')]()[_0xbe14('0x5c')]();return _0x17576b[_0xbe14('0x13')]['filter'](function(_0x70ed08){return _0x175213['indexOf'](_0x70ed08[_0xbe14('0x5a')])>-0x1;});}else{return _0x17576b['rows'][_0xbe14('0x58')](function(_0x21837c){return _0x21837c[_0xbe14('0x5a')]===parseInt(_0x1e5ce1['params']['id']);});}})[_0xbe14('0x8')](respondWithResult(_0x401968,null))[_0xbe14('0xc')](handleError(_0x401968,null));};exports[_0xbe14('0x5d')]=function(_0x546f22,_0x41a896){return respondWithRpcPromise(_0xbe14('0x5e'),_0x546f22[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x41a896,null))['catch'](handleError(_0x41a896,null));};exports[_0xbe14('0x5f')]=function(_0x39bc54,_0x34f90b){return respondWithRpcPromise(_0xbe14('0x60'),_0x39bc54[_0xbe14('0x17')],routingClient)[_0xbe14('0x8')](respondWithResult(_0x34f90b,null))[_0xbe14('0xc')](handleError(_0x34f90b,null));};exports['faxQueuesWaitingInteractions']=function(_0x2ff94c,_0x123f4f){return respondWithRpcPromise(_0xbe14('0x61'),_0x2ff94c['query'],routingClient)[_0xbe14('0x8')](respondWithResult(_0x123f4f,null))[_0xbe14('0xc')](handleError(_0x123f4f,null));};exports[_0xbe14('0x62')]=function(_0x5bc52b){return function(_0xa53262,_0x1205d1){var _0x47d7bb,_0x2be969;var _0x49990b=_[_0xbe14('0x63')](_0x5bc52b);var _0x337073=_0x5bc52b==='chat'?'Website':_0xbe14('0x64');return db[_0x49990b+_0xbe14('0x65')][_0xbe14('0x66')]({'raw':!![],'where':{'id':_0xa53262['params']['id']}})[_0xbe14('0x8')](function(_0x30c03b){if(_[_0xbe14('0x12')](_0x30c03b)){throw new Error(_0x49990b+_0xbe14('0x67'));}_0x47d7bb=_0x30c03b;return db[_0x49990b+'Message']['findOne']({'where':{'id':_0xa53262[_0xbe14('0x20')][_0xbe14('0x68')]},'include':[{'model':db[_0x49990b+_0xbe14('0x69')],'as':_0xbe14('0x69')},{'model':db[_0x49990b+_0x337073],'as':_0xbe14('0x64')}]});})[_0xbe14('0x8')](function(_0x139aab){if(_['isNil'](_0x139aab)){throw new Error(_0x49990b+_0xbe14('0x6a'));}_0x2be969=_0x139aab;return _0x139aab['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xbe14('0x8')](function(){var _0x3a01bb={'uniqueid':_0x5bc52b+'.'+_0x2be969['id']+'.'+_0x2be969[_0xbe14('0x69')]['id'],'FromUserId':_0xa53262[_0xbe14('0x2f')]['id'],'type':'queue'};_0x3a01bb[_0x49990b+_0xbe14('0x6b')]=_0x2be969['id'];_0x3a01bb[_0x49990b+_0xbe14('0x6c')]=_0x2be969[_0xbe14('0x69')]['id'];_0x3a01bb['From'+_0x49990b+_0x337073+'Id']=_0x2be969[_0xbe14('0x64')]['id'];_0x3a01bb['To'+_0x49990b+_0xbe14('0x6d')]=_0x47d7bb['id'];return db[_0x49990b+_0xbe14('0x6e')][_0xbe14('0x6f')](_0x3a01bb);})[_0xbe14('0x8')](function(){return respondWithRpcPromise(_0xbe14('0x70'),{'channel':_0x5bc52b,'interaction':_0x2be969[_0xbe14('0x69')],'message':_0x2be969,'account':_0x2be969[_0xbe14('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0xbe14('0x71'),'appdata':_0x47d7bb[_0xbe14('0x10')]+','+(_0x2be969[_0xbe14('0x64')][_0xbe14('0x72')]||0x12c),'interval':_0xbe14('0x73')}]},routingClient);})[_0xbe14('0x8')](respondWithResult(_0x1205d1,null))[_0xbe14('0xc')](handleError(_0x1205d1,null));};};exports[_0xbe14('0x74')]=function(_0x1de70d,_0x30be9e){var _0x1679bd,_0x2ca6e6;if(_['isNil'](_0x1de70d[_0xbe14('0x20')]['channel'])){throw new Error(_0xbe14('0x75'));}var _0x1b8733=_0x1de70d[_0xbe14('0x20')][_0xbe14('0x76')];var _0x1d7b08=_['capitalize'](_0x1b8733);var _0x5868d7=_0x1b8733===_0xbe14('0x77')?_0xbe14('0x78'):_0xbe14('0x64');return db[_0xbe14('0x79')]['findOne']({'raw':!![],'where':{'id':_0x1de70d[_0xbe14('0x1b')]['id'],'role':_0xbe14('0x7a')}})['then'](function(_0x186225){if(_[_0xbe14('0x12')](_0x186225)){throw new Error(_0xbe14('0x7b'));}_0x1679bd=_0x186225;return db[_0x1d7b08+_0xbe14('0x7c')]['findOne']({'where':{'id':_0x1de70d[_0xbe14('0x20')]['messageId']},'include':[{'model':db[_0x1d7b08+'Interaction'],'as':_0xbe14('0x69')},{'model':db[_0x1d7b08+_0x5868d7],'as':_0xbe14('0x64')}]});})[_0xbe14('0x8')](function(_0x3d890b){if(_[_0xbe14('0x12')](_0x3d890b)){throw new Error(_0x1d7b08+'\x20Message\x20not\x20found');}_0x2ca6e6=_0x3d890b;return _0x3d890b[_0xbe14('0x7d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xbe14('0x8')](function(){var _0x5dc793={'uniqueid':_0x1b8733+'.'+_0x2ca6e6['id']+'.'+_0x2ca6e6['Interaction']['id'],'FromUserId':_0x1de70d[_0xbe14('0x2f')]['id'],'type':_0xbe14('0x71'),'ToUserId':_0x1679bd['id']};_0x5dc793[_0x1d7b08+'MessageId']=_0x2ca6e6['id'];_0x5dc793[_0x1d7b08+_0xbe14('0x6c')]=_0x2ca6e6['Interaction']['id'];_0x5dc793[_0xbe14('0x7e')+_0x1d7b08+_0x5868d7+'Id']=_0x2ca6e6['Account']['id'];return db[_0x1d7b08+_0xbe14('0x6e')]['create'](_0x5dc793);})[_0xbe14('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x1b8733,'interaction':_0x2ca6e6[_0xbe14('0x69')],'message':_0x2ca6e6,'account':_0x2ca6e6[_0xbe14('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x1679bd['name']+','+(_0x2ca6e6[_0xbe14('0x64')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xbe14('0x8')](respondWithResult(_0x30be9e,null))[_0xbe14('0xc')](handleError(_0x30be9e,null));}; \ No newline at end of file +var _0x46ed=['send','isNil','rows','VoiceChannels','query','then','catch','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','agentCapacity','interaction','user','hasOwnProperty','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','MemberReport','findOrCreate','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','WhatsappQueues','showWhatsappQueues','faxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','queue_id','uniq','indexOf','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','capitalize','chat','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','Website','User','\x20Message\x20not\x20found','bluebird','moment','util','../../mysqldb','../../config/logger','jayson/promise','client','http','request','error','code','message','result','status','name'];(function(_0x1c1431,_0x44d3a0){var _0x447a7d=function(_0x2bbf10){while(--_0x2bbf10){_0x1c1431['push'](_0x1c1431['shift']());}};_0x447a7d(++_0x44d3a0);}(_0x46ed,0x168));var _0xd46e=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x46ed[_0x4ff09b];return _0x3f5c2e;};'use strict';var BPromise=require(_0xd46e('0x0'));var moment=require(_0xd46e('0x1'));var _=require('lodash');var util=require(_0xd46e('0x2'));var db=require(_0xd46e('0x3'))['db'];var logger=require(_0xd46e('0x4'))('api');var jayson=require(_0xd46e('0x5'));var amiClient=jayson[_0xd46e('0x6')]['http']({'port':0x232a});var mailClient=jayson[_0xd46e('0x6')][_0xd46e('0x7')]({'port':0x232b});var routingClient=jayson[_0xd46e('0x6')][_0xd46e('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x45e680,_0x855f24,_0x437ea0){return new BPromise(function(_0x144687,_0x31259b){var _0x19e4f4=_0x437ea0?_0x437ea0:amiClient;return _0x19e4f4[_0xd46e('0x8')](_0x45e680,_0x855f24)['then'](function(_0x7b2d69){if(_0x7b2d69[_0xd46e('0x9')]){if(_0x7b2d69['error'][_0xd46e('0xa')]===0x1f4){return _0x31259b(_0x7b2d69[_0xd46e('0x9')][_0xd46e('0xb')]);}return _0x144687(_0x7b2d69[_0xd46e('0x9')][_0xd46e('0xb')]);}else{_0x144687(_0x7b2d69[_0xd46e('0xc')]);}})['catch'](function(_0x24c54b){_0x31259b(_0x24c54b);});});}function respondWithResult(_0x5bc1da,_0x48550b){_0x48550b=_0x48550b||0xc8;return function(_0xf3048c){if(_0xf3048c){return _0x5bc1da[_0xd46e('0xd')](_0x48550b)['json'](_0xf3048c);}return _0x5bc1da['sendStatus'](0x194);};}function handleError(_0xacd799,_0x4688ae){_0x4688ae=_0x4688ae||0x1f4;return function(_0x1e9aae){logger[_0xd46e('0x9')](_0x1e9aae['stack']);if(_0x1e9aae[_0xd46e('0xe')]){delete _0x1e9aae[_0xd46e('0xe')];}_0xacd799[_0xd46e('0xd')](_0x4688ae)[_0xd46e('0xf')](_0x1e9aae);};}function findById(_0x36a317){return function(_0x47fa8f){if(!_[_0xd46e('0x10')](_0x36a317)&&!_[_0xd46e('0x10')](_0x47fa8f)&&!_[_0xd46e('0x10')](_0x47fa8f['rows'])){return _['find'](_0x47fa8f[_0xd46e('0x11')],function(_0x1bd574){return _0x1bd574['id']==_0x36a317;});}return null;};}exports['voiceChannels']=function(_0x4fd1f2,_0x2d6f2c){return respondWithRpcPromise(_0xd46e('0x12'),_0x4fd1f2[_0xd46e('0x13')])[_0xd46e('0x14')](respondWithResult(_0x2d6f2c,null))[_0xd46e('0x15')](handleError(_0x2d6f2c,null));};exports[_0xd46e('0x16')]=function(_0x3b5fa4,_0x327b7e){return respondWithRpcPromise(_0xd46e('0x17'),_[_0xd46e('0x18')](_0x3b5fa4[_0xd46e('0x13')],_0x3b5fa4['params']))[_0xd46e('0x14')](respondWithResult(_0x327b7e,null))[_0xd46e('0x15')](handleError(_0x327b7e,null));};exports[_0xd46e('0x19')]=function(_0x45ce0b,_0x128246){return respondWithRpcPromise(_0xd46e('0x1a'),_[_0xd46e('0x18')](_0x45ce0b[_0xd46e('0x13')],_0x45ce0b[_0xd46e('0x1b')]))['then'](respondWithResult(_0x128246,null))[_0xd46e('0x15')](handleError(_0x128246,null));};exports['voiceQueues']=function(_0x4b8f6a,_0x371054){return respondWithRpcPromise(_0xd46e('0x1c'),_0x4b8f6a[_0xd46e('0x13')])[_0xd46e('0x14')](respondWithResult(_0x371054,null))[_0xd46e('0x15')](handleError(_0x371054,null));};exports[_0xd46e('0x1d')]=function(_0x1740d1,_0x4dab6a){return respondWithRpcPromise(_0xd46e('0x1c'),_0x1740d1[_0xd46e('0x13')])[_0xd46e('0x14')](findById(_0x1740d1[_0xd46e('0x1b')]['id']))[_0xd46e('0x14')](respondWithResult(_0x4dab6a,null))[_0xd46e('0x15')](handleError(_0x4dab6a,null));};exports['updateVoiceQueue']=function(_0x465d54,_0x3a1ced){return respondWithRpcPromise(_0xd46e('0x1e'),_[_0xd46e('0x18')](_0x465d54[_0xd46e('0x1f')],_0x465d54[_0xd46e('0x1b')]))[_0xd46e('0x14')](respondWithResult(_0x3a1ced,null))[_0xd46e('0x15')](handleError(_0x3a1ced,null));};exports[_0xd46e('0x20')]=function(_0x45ea47,_0x2ff785){return respondWithRpcPromise(_0xd46e('0x21'),_[_0xd46e('0x18')](_0x45ea47['query'],_0x45ea47[_0xd46e('0x1b')]))[_0xd46e('0x14')](respondWithResult(_0x2ff785,null))[_0xd46e('0x15')](handleError(_0x2ff785,null));};exports[_0xd46e('0x22')]=function(_0x5ef248,_0x2eed3a){return respondWithRpcPromise(_0xd46e('0x23'),_0x5ef248['query'])[_0xd46e('0x14')](respondWithResult(_0x2eed3a,null))[_0xd46e('0x15')](handleError(_0x2eed3a,null));};exports['voiceQueuesChannel']=function(_0x306458,_0x1c15c9){return respondWithRpcPromise(_0xd46e('0x24'),_['merge'](_0x306458['query'],_0x306458[_0xd46e('0x1b')]))[_0xd46e('0x14')](respondWithResult(_0x1c15c9,null))[_0xd46e('0x15')](handleError(_0x1c15c9,null));};exports[_0xd46e('0x25')]=function(_0x83526a,_0x423de9){return respondWithRpcPromise(_0xd46e('0x26'),_[_0xd46e('0x18')](_0x83526a['query'],_0x83526a[_0xd46e('0x1b')]))[_0xd46e('0x14')](respondWithResult(_0x423de9,null))[_0xd46e('0x15')](handleError(_0x423de9,null));};exports[_0xd46e('0x27')]=function(_0x1fa66c,_0x1e0897){return respondWithRpcPromise(_0xd46e('0x28'),_['merge'](_0x1fa66c[_0xd46e('0x13')],_0x1fa66c[_0xd46e('0x1b')]))['then'](respondWithResult(_0x1e0897,null))[_0xd46e('0x15')](handleError(_0x1e0897,null));};exports[_0xd46e('0x29')]=function(_0x12ccf8,_0x3b6e67){return respondWithRpcPromise('Outbound',_0x12ccf8[_0xd46e('0x13')])[_0xd46e('0x14')](respondWithResult(_0x3b6e67,null))[_0xd46e('0x15')](handleError(_0x3b6e67,null));};exports[_0xd46e('0x2a')]=function(_0xefe5f4,_0x1f58ad){return respondWithRpcPromise(_0xd46e('0x2b'),_0xefe5f4[_0xd46e('0x13')])['then'](respondWithResult(_0x1f58ad,null))[_0xd46e('0x15')](handleError(_0x1f58ad,null));};exports[_0xd46e('0x2c')]=function(_0xc83ea1,_0x25657a){var _0x165ce8;return respondWithRpcPromise('Agents',_0xc83ea1[_0xd46e('0x13')])['then'](function(_0x55230d){_0x165ce8=_0x55230d;return respondWithRpcPromise('Agents',_0xc83ea1['query'],routingClient);})[_0xd46e('0x14')](function(_0x54949f){return _[_0xd46e('0x18')]({},_0x54949f,_0x165ce8);})[_0xd46e('0x14')](respondWithResult(_0x25657a,null))['catch'](handleError(_0x25657a,null));};exports[_0xd46e('0x2d')]=function(_0x4114e6,_0x3bd5e9){if(_0x4114e6[_0xd46e('0x1f')]&&_0x4114e6[_0xd46e('0x1f')][_0xd46e('0x2e')]&&_0x4114e6[_0xd46e('0x2f')]&&_0x4114e6[_0xd46e('0x2f')][_0xd46e('0xe')]){for(var _0xec367d in _0x4114e6[_0xd46e('0x1f')]['interaction']){if(_0x4114e6['body']['interaction'][_0xd46e('0x30')](_0xec367d)){db['MemberReport'][_0xd46e('0x31')]({'where':{'channel':_0xec367d,'membername':_0x4114e6[_0xd46e('0x2f')][_0xd46e('0xe')],'type':_0xd46e('0x32'),'exitAt':null,'uniqueid':_0x4114e6[_0xd46e('0x1f')][_0xd46e('0x2e')][_0xec367d]&&_0x4114e6[_0xd46e('0x1f')][_0xd46e('0x2e')][_0xec367d]['length']?{'$notIn':_0x4114e6[_0xd46e('0x1f')]['interaction'][_0xec367d]}:{'$ne':null}}})[_0xd46e('0x14')](function(_0x196e51){var _0x41a983=moment()[_0xd46e('0x33')](_0xd46e('0x34'));for(var _0x5d65ca=0x0,_0x384b6e=_0x196e51[_0xd46e('0x35')];_0x5d65ca<_0x384b6e;_0x5d65ca+=0x1){_0x196e51[_0x5d65ca][_0xd46e('0x36')]({'exitAt':_0x41a983});}});for(var _0xac268d=0x0;_0xac268d<_0x4114e6[_0xd46e('0x1f')]['interaction'][_0xec367d][_0xd46e('0x35')];_0xac268d+=0x1){db[_0xd46e('0x37')][_0xd46e('0x38')]({'where':{'channel':_0xec367d,'membername':_0x4114e6[_0xd46e('0x2f')][_0xd46e('0xe')],'type':'INTERACTION','uniqueid':_0x4114e6[_0xd46e('0x1f')][_0xd46e('0x2e')][_0xec367d][_0xac268d],'exitAt':null},'defaults':{'channel':_0xec367d,'membername':_0x4114e6[_0xd46e('0x2f')][_0xd46e('0xe')],'interface':_[_0xd46e('0x10')](_0x4114e6[_0xd46e('0x2f')][_0xd46e('0x39')])?util[_0xd46e('0x33')]('SIP/%s',_0x4114e6[_0xd46e('0x2f')][_0xd46e('0xe')]):_0x4114e6[_0xd46e('0x2f')][_0xd46e('0x39')],'type':_0xd46e('0x32'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xd46e('0x3a'),'internal':_0x4114e6[_0xd46e('0x2f')][_0xd46e('0x3b')],'uniqueid':_0x4114e6['body']['interaction'][_0xec367d][_0xac268d]}});}}}}return respondWithRpcPromise(_0xd46e('0x3c'),{'id':_0x4114e6[_0xd46e('0x1b')]['id'],'capacity':_0x4114e6['body'][_0xd46e('0x3d')]},routingClient)[_0xd46e('0x14')](respondWithResult(_0x3bd5e9,null))[_0xd46e('0x15')](handleError(_0x3bd5e9,null));};exports[_0xd46e('0x3e')]=function(_0x1bd8a5,_0x34d4ca){return respondWithRpcPromise(_0xd46e('0x3f'),_0x1bd8a5[_0xd46e('0x13')])['then'](respondWithResult(_0x34d4ca,null))[_0xd46e('0x15')](handleError(_0x34d4ca,null));};exports[_0xd46e('0x40')]=function(_0x1c7f92,_0x63ee74){return respondWithRpcPromise('Trunks',_0x1c7f92['query'])[_0xd46e('0x14')](respondWithResult(_0x63ee74,null))['catch'](handleError(_0x63ee74,null));};exports[_0xd46e('0x41')]=function(_0x2af20b,_0x393cb9){return respondWithRpcPromise(_0xd46e('0x42'),_0x2af20b[_0xd46e('0x13')])[_0xd46e('0x14')](respondWithResult(_0x393cb9,null))['catch'](handleError(_0x393cb9,null));};exports[_0xd46e('0x43')]=function(_0x354739,_0x51f45a){return respondWithRpcPromise('ChatQueues',_0x354739[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](respondWithResult(_0x51f45a,null))[_0xd46e('0x15')](handleError(_0x51f45a,null));};exports[_0xd46e('0x44')]=function(_0x1886e6,_0x2cc676){return respondWithRpcPromise(_0xd46e('0x45'),_0x1886e6[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](findById(_0x1886e6[_0xd46e('0x1b')]['id']))[_0xd46e('0x14')](respondWithResult(_0x2cc676,null))[_0xd46e('0x15')](handleError(_0x2cc676,null));};exports[_0xd46e('0x46')]=function(_0x402df2,_0x47a86c){return respondWithRpcPromise(_0xd46e('0x47'),_0x402df2[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](respondWithResult(_0x47a86c,null))[_0xd46e('0x15')](handleError(_0x47a86c,null));};exports['showMailQueues']=function(_0x636f15,_0x36e18a){return respondWithRpcPromise(_0xd46e('0x47'),_0x636f15[_0xd46e('0x13')],routingClient)['then'](findById(_0x636f15[_0xd46e('0x1b')]['id']))[_0xd46e('0x14')](respondWithResult(_0x36e18a,null))['catch'](handleError(_0x36e18a,null));};exports['mailAccounts']=function(_0x45e102,_0xd59920){return respondWithRpcPromise(_0xd46e('0x48'),_0x45e102['query'],mailClient)['then'](respondWithResult(_0xd59920,null))[_0xd46e('0x15')](handleError(_0xd59920,null));};exports[_0xd46e('0x49')]=function(_0x1f310d,_0x263425){return respondWithRpcPromise(_0xd46e('0x4a'),_0x1f310d[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](respondWithResult(_0x263425,null))[_0xd46e('0x15')](handleError(_0x263425,null));};exports[_0xd46e('0x4b')]=function(_0x2a172c,_0x4af44){return respondWithRpcPromise(_0xd46e('0x4a'),_0x2a172c[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](findById(_0x2a172c[_0xd46e('0x1b')]['id']))[_0xd46e('0x14')](respondWithResult(_0x4af44,null))['catch'](handleError(_0x4af44,null));};exports[_0xd46e('0x4c')]=function(_0x1a3771,_0x3a2dec){return respondWithRpcPromise('SmsQueues',_0x1a3771[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](respondWithResult(_0x3a2dec,null))['catch'](handleError(_0x3a2dec,null));};exports[_0xd46e('0x4d')]=function(_0x2c86fe,_0x1801d4){return respondWithRpcPromise('SmsQueues',_0x2c86fe[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](findById(_0x2c86fe[_0xd46e('0x1b')]['id']))['then'](respondWithResult(_0x1801d4,null))[_0xd46e('0x15')](handleError(_0x1801d4,null));};exports['whatsappQueues']=function(_0x32eed0,_0x148187){return respondWithRpcPromise(_0xd46e('0x4e'),_0x32eed0['query'],routingClient)[_0xd46e('0x14')](respondWithResult(_0x148187,null))[_0xd46e('0x15')](handleError(_0x148187,null));};exports[_0xd46e('0x4f')]=function(_0xbce76f,_0x502f37){return respondWithRpcPromise(_0xd46e('0x4e'),_0xbce76f[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](findById(_0xbce76f[_0xd46e('0x1b')]['id']))[_0xd46e('0x14')](respondWithResult(_0x502f37,null))[_0xd46e('0x15')](handleError(_0x502f37,null));};exports[_0xd46e('0x50')]=function(_0x41057c,_0x24be84){return respondWithRpcPromise('FaxQueues',_0x41057c['query'],routingClient)[_0xd46e('0x14')](respondWithResult(_0x24be84,null))[_0xd46e('0x15')](handleError(_0x24be84,null));};exports[_0xd46e('0x51')]=function(_0x2fff69,_0x249938){return respondWithRpcPromise('FaxQueues',_0x2fff69[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](findById(_0x2fff69[_0xd46e('0x1b')]['id']))[_0xd46e('0x14')](respondWithResult(_0x249938,null))['catch'](handleError(_0x249938,null));};exports[_0xd46e('0x52')]=function(_0x9dd439,_0x5a36df){return respondWithRpcPromise(_0xd46e('0x53'),_0x9dd439[_0xd46e('0x13')])['then'](respondWithResult(_0x5a36df,null))[_0xd46e('0x15')](handleError(_0x5a36df,null));};exports[_0xd46e('0x54')]=function(_0x566e65,_0x44ba36){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x566e65[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](respondWithResult(_0x44ba36,null))['catch'](handleError(_0x44ba36,null));};exports['mailQueuesWaitingInteractions']=function(_0x475133,_0x3eb6b){return respondWithRpcPromise(_0xd46e('0x55'),_0x475133[_0xd46e('0x13')],routingClient)['then'](respondWithResult(_0x3eb6b,null))[_0xd46e('0x15')](handleError(_0x3eb6b,null));};exports[_0xd46e('0x56')]=function(_0x510a1e,_0x10bcdb){return respondWithRpcPromise(_0xd46e('0x57'),_0x510a1e[_0xd46e('0x13')],routingClient)[_0xd46e('0x14')](respondWithResult(_0x10bcdb,null))[_0xd46e('0x15')](handleError(_0x10bcdb,null));};exports[_0xd46e('0x58')]=function(_0x21f193,_0xaf7c79){return respondWithRpcPromise(_0xd46e('0x57'),_0x21f193['query'],routingClient)[_0xd46e('0x14')](function(_0x1c1bae){if(_0x21f193['query'][_0xd46e('0x59')]!==undefined){var _0x3ba83f=_(_0x1c1bae[_0xd46e('0x11')])[_0xd46e('0x5a')]([_0x21f193[_0xd46e('0x13')][_0xd46e('0x59')],_0x21f193['params']['id']])['map'](_0xd46e('0x5b'))[_0xd46e('0x5c')]()['value']();return _0x1c1bae['rows']['filter'](function(_0x825746){return _0x3ba83f[_0xd46e('0x5d')](_0x825746[_0xd46e('0x5b')])>-0x1;});}else{return _0x1c1bae['rows'][_0xd46e('0x5a')](function(_0x69ade9){return _0x69ade9[_0xd46e('0x5b')]===parseInt(_0x21f193['params']['id']);});}})['then'](respondWithResult(_0xaf7c79,null))['catch'](handleError(_0xaf7c79,null));};exports['smsQueuesWaitingInteractions']=function(_0x2d4410,_0x5d7c51){return respondWithRpcPromise(_0xd46e('0x5e'),_0x2d4410['query'],routingClient)['then'](respondWithResult(_0x5d7c51,null))[_0xd46e('0x15')](handleError(_0x5d7c51,null));};exports[_0xd46e('0x5f')]=function(_0x3df2c2,_0x2754ff){return respondWithRpcPromise(_0xd46e('0x60'),_0x3df2c2[_0xd46e('0x13')],routingClient)['then'](respondWithResult(_0x2754ff,null))['catch'](handleError(_0x2754ff,null));};exports[_0xd46e('0x61')]=function(_0x383919,_0x114f2c){return respondWithRpcPromise(_0xd46e('0x62'),_0x383919['query'],routingClient)[_0xd46e('0x14')](respondWithResult(_0x114f2c,null))[_0xd46e('0x15')](handleError(_0x114f2c,null));};exports['queueNotify']=function(_0x1309b5){return function(_0x483ef1,_0x2abaee){var _0x24a2e1,_0x5b54b6;var _0x59fb83=_[_0xd46e('0x63')](_0x1309b5);var _0x2c11b8=_0x1309b5===_0xd46e('0x64')?'Website':_0xd46e('0x65');return db[_0x59fb83+_0xd46e('0x66')][_0xd46e('0x67')]({'raw':!![],'where':{'id':_0x483ef1[_0xd46e('0x1b')]['id']}})[_0xd46e('0x14')](function(_0x88460a){if(_[_0xd46e('0x10')](_0x88460a)){throw new Error(_0x59fb83+_0xd46e('0x68'));}_0x24a2e1=_0x88460a;return db[_0x59fb83+_0xd46e('0x69')][_0xd46e('0x67')]({'where':{'id':_0x483ef1[_0xd46e('0x1f')][_0xd46e('0x6a')]},'include':[{'model':db[_0x59fb83+_0xd46e('0x6b')],'as':_0xd46e('0x6b')},{'model':db[_0x59fb83+_0x2c11b8],'as':_0xd46e('0x65')}]});})[_0xd46e('0x14')](function(_0x441f73){if(_[_0xd46e('0x10')](_0x441f73)){throw new Error(_0x59fb83+'\x20Message\x20not\x20found');}_0x5b54b6=_0x441f73;return _0x441f73[_0xd46e('0x6c')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x3436ff={'uniqueid':_0x1309b5+'.'+_0x5b54b6['id']+'.'+_0x5b54b6[_0xd46e('0x6b')]['id'],'FromUserId':_0x483ef1['user']['id'],'type':_0xd46e('0x6d')};_0x3436ff[_0x59fb83+_0xd46e('0x6e')]=_0x5b54b6['id'];_0x3436ff[_0x59fb83+_0xd46e('0x6f')]=_0x5b54b6[_0xd46e('0x6b')]['id'];_0x3436ff[_0xd46e('0x70')+_0x59fb83+_0x2c11b8+'Id']=_0x5b54b6[_0xd46e('0x65')]['id'];_0x3436ff['To'+_0x59fb83+_0xd46e('0x71')]=_0x24a2e1['id'];return db[_0x59fb83+_0xd46e('0x72')][_0xd46e('0x73')](_0x3436ff);})[_0xd46e('0x14')](function(){return respondWithRpcPromise(_0xd46e('0x74'),{'channel':_0x1309b5,'interaction':_0x5b54b6['Interaction'],'message':_0x5b54b6,'account':_0x5b54b6['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0xd46e('0x6d'),'appdata':_0x24a2e1[_0xd46e('0xe')]+','+(_0x5b54b6[_0xd46e('0x65')][_0xd46e('0x75')]||0x12c),'interval':_0xd46e('0x76')}]},routingClient);})[_0xd46e('0x14')](respondWithResult(_0x2abaee,null))['catch'](handleError(_0x2abaee,null));};};exports[_0xd46e('0x77')]=function(_0x127604,_0xa254f5){var _0x2c9703,_0x41443d;if(_[_0xd46e('0x10')](_0x127604['body'][_0xd46e('0x78')])){throw new Error(_0xd46e('0x79'));}var _0x59067a=_0x127604[_0xd46e('0x1f')][_0xd46e('0x78')];var _0x9e222d=_[_0xd46e('0x63')](_0x59067a);var _0x97ee80=_0x59067a===_0xd46e('0x64')?_0xd46e('0x7a'):_0xd46e('0x65');return db[_0xd46e('0x7b')][_0xd46e('0x67')]({'raw':!![],'where':{'id':_0x127604[_0xd46e('0x1b')]['id'],'role':_0xd46e('0x3a')}})[_0xd46e('0x14')](function(_0x30dcfc){if(_['isNil'](_0x30dcfc)){throw new Error('Agent\x20not\x20found');}_0x2c9703=_0x30dcfc;return db[_0x9e222d+_0xd46e('0x69')][_0xd46e('0x67')]({'where':{'id':_0x127604[_0xd46e('0x1f')][_0xd46e('0x6a')]},'include':[{'model':db[_0x9e222d+_0xd46e('0x6b')],'as':_0xd46e('0x6b')},{'model':db[_0x9e222d+_0x97ee80],'as':'Account'}]});})[_0xd46e('0x14')](function(_0x216143){if(_[_0xd46e('0x10')](_0x216143)){throw new Error(_0x9e222d+_0xd46e('0x7c'));}_0x41443d=_0x216143;return _0x216143['update']({'read':0x0,'readAt':null,'UserId':null});})[_0xd46e('0x14')](function(){var _0x191b48={'uniqueid':_0x59067a+'.'+_0x41443d['id']+'.'+_0x41443d['Interaction']['id'],'FromUserId':_0x127604[_0xd46e('0x2f')]['id'],'type':'queue','ToUserId':_0x2c9703['id']};_0x191b48[_0x9e222d+'MessageId']=_0x41443d['id'];_0x191b48[_0x9e222d+_0xd46e('0x6f')]=_0x41443d[_0xd46e('0x6b')]['id'];_0x191b48[_0xd46e('0x70')+_0x9e222d+_0x97ee80+'Id']=_0x41443d[_0xd46e('0x65')]['id'];return db[_0x9e222d+'TransferReport']['create'](_0x191b48);})[_0xd46e('0x14')](function(){return respondWithRpcPromise('Start',{'channel':_0x59067a,'interaction':_0x41443d[_0xd46e('0x6b')],'message':_0x41443d,'account':_0x41443d['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x2c9703[_0xd46e('0xe')]+','+(_0x41443d[_0xd46e('0x65')]['agentTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xd46e('0x14')](respondWithResult(_0xa254f5,null))[_0xd46e('0x15')](handleError(_0xa254f5,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 3ccde6b..3254413 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 _0x4b3e=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','show','/:id/run','post','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x4d1b69,_0x26283b){var _0x594ccd=function(_0xdc39d5){while(--_0xdc39d5){_0x4d1b69['push'](_0x4d1b69['shift']());}};_0x594ccd(++_0x26283b);}(_0x4b3e,0x1a1));var _0xe4b3=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x4b3e[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0xe4b3('0x0'));var util=require(_0xe4b3('0x1'));var path=require('path');var timeout=require(_0xe4b3('0x2'));var express=require(_0xe4b3('0x3'));var router=express[_0xe4b3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xe4b3('0x5'));var interaction=require(_0xe4b3('0x6'));var config=require(_0xe4b3('0x7'));var controller=require(_0xe4b3('0x8'));router[_0xe4b3('0x9')]('/',auth[_0xe4b3('0xa')](),controller[_0xe4b3('0xb')]);router[_0xe4b3('0x9')]('/:id',auth[_0xe4b3('0xa')](),controller[_0xe4b3('0xc')]);router[_0xe4b3('0x9')](_0xe4b3('0xd'),auth[_0xe4b3('0xa')](),controller['run']);router[_0xe4b3('0xe')]('/',auth['isAuthenticated'](),controller[_0xe4b3('0xf')]);router[_0xe4b3('0x10')](_0xe4b3('0x11'),auth[_0xe4b3('0xa')](),controller['update']);router[_0xe4b3('0x12')](_0xe4b3('0x11'),auth[_0xe4b3('0xa')](),controller[_0xe4b3('0x13')]);module[_0xe4b3('0x14')]=router; \ No newline at end of file +var _0x8481=['/:id','show','/:id/run','run','post','put','update','delete','exports','multer','util','connect-timeout','Router','fs-extra','../../config/environment','./schedule.controller','get','isAuthenticated','index'];(function(_0x215758,_0x212174){var _0x15e526=function(_0x39757d){while(--_0x39757d){_0x215758['push'](_0x215758['shift']());}};_0x15e526(++_0x212174);}(_0x8481,0x1be));var _0x1848=function(_0x122d9f,_0x2c9e5b){_0x122d9f=_0x122d9f-0x0;var _0x41a09e=_0x8481[_0x122d9f];return _0x41a09e;};'use strict';var multer=require(_0x1848('0x0'));var util=require(_0x1848('0x1'));var path=require('path');var timeout=require(_0x1848('0x2'));var express=require('express');var router=express[_0x1848('0x3')]();var fs_extra=require(_0x1848('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1848('0x5'));var controller=require(_0x1848('0x6'));router[_0x1848('0x7')]('/',auth[_0x1848('0x8')](),controller[_0x1848('0x9')]);router[_0x1848('0x7')](_0x1848('0xa'),auth['isAuthenticated'](),controller[_0x1848('0xb')]);router[_0x1848('0x7')](_0x1848('0xc'),auth['isAuthenticated'](),controller[_0x1848('0xd')]);router[_0x1848('0xe')]('/',auth[_0x1848('0x8')](),controller['create']);router[_0x1848('0xf')](_0x1848('0xa'),auth[_0x1848('0x8')](),controller[_0x1848('0x10')]);router[_0x1848('0x11')](_0x1848('0xa'),auth[_0x1848('0x8')](),controller['destroy']);module[_0x1848('0x12')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index a8fc7cd..ab87216 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 _0x5bd0=['days','minutes','csv','pdf','xlsx','custom','default','BOOLEAN','TEXT','sequelize','exports','STRING','DATE','INTEGER','ENUM','months','weeks'];(function(_0x441847,_0x21da34){var _0x5b109c=function(_0x1ec126){while(--_0x1ec126){_0x441847['push'](_0x441847['shift']());}};_0x5b109c(++_0x21da34);}(_0x5bd0,0xc4));var _0x05bd=function(_0x1a27f3,_0x1c082d){_0x1a27f3=_0x1a27f3-0x0;var _0x3ce222=_0x5bd0[_0x1a27f3];return _0x3ce222;};'use strict';var Sequelize=require(_0x05bd('0x0'));module[_0x05bd('0x1')]={'name':{'type':Sequelize[_0x05bd('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x05bd('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x05bd('0x2')],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0x05bd('0x3')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x05bd('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x05bd('0x5')]('years','quarters',_0x05bd('0x6'),_0x05bd('0x7'),_0x05bd('0x8'),'hours',_0x05bd('0x9')),'allowNull':![],'defaultValue':_0x05bd('0x8')},'output':{'type':Sequelize[_0x05bd('0x5')](_0x05bd('0xa'),_0x05bd('0xb'),_0x05bd('0xc')),'allowNull':![],'defaultValue':_0x05bd('0xa')},'type':{'type':Sequelize[_0x05bd('0x5')](_0x05bd('0xd'),_0x05bd('0xe')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x05bd('0xf')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x05bd('0x10')]},'bcc':{'type':Sequelize[_0x05bd('0x10')]},'sendIfEmpty':{'type':Sequelize[_0x05bd('0xf')],'defaultValue':!![]}}; \ No newline at end of file +var _0x3c8c=['days','hours','minutes','csv','pdf','xlsx','custom','default','TEXT','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','quarters','months','weeks'];(function(_0x3f3f31,_0x405858){var _0x3aa03b=function(_0x46d208){while(--_0x46d208){_0x3f3f31['push'](_0x3f3f31['shift']());}};_0x3aa03b(++_0x405858);}(_0x3c8c,0x15d));var _0xc3c8=function(_0x40991c,_0x44b859){_0x40991c=_0x40991c-0x0;var _0x2fcf03=_0x3c8c[_0x40991c];return _0x2fcf03;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc3c8('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xc3c8('0x1')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xc3c8('0x0')],'allowNull':![],'defaultValue':_0xc3c8('0x2')},'startAt':{'type':Sequelize[_0xc3c8('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xc3c8('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xc3c8('0x4')]('years',_0xc3c8('0x5'),_0xc3c8('0x6'),_0xc3c8('0x7'),_0xc3c8('0x8'),_0xc3c8('0x9'),_0xc3c8('0xa')),'allowNull':![],'defaultValue':_0xc3c8('0x8')},'output':{'type':Sequelize[_0xc3c8('0x4')](_0xc3c8('0xb'),_0xc3c8('0xc'),_0xc3c8('0xd')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize['ENUM'](_0xc3c8('0xe'),_0xc3c8('0xf')),'allowNull':![],'defaultValue':_0xc3c8('0xe')},'sendMail':{'type':Sequelize[_0xc3c8('0x1')],'defaultValue':![]},'email':{'type':Sequelize[_0xc3c8('0x0')]},'cc':{'type':Sequelize[_0xc3c8('0x10')]},'bcc':{'type':Sequelize[_0xc3c8('0x10')]},'sendIfEmpty':{'type':Sequelize[_0xc3c8('0x1')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index e694aa8..644a710 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 _0x2cc3=['intersection','model','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run','../../config/schedule','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Scheduler','UserProfileResource','destroy','end','error','stack','name','index','map','Schedule','fieldName','type','key','query','keys','filters'];(function(_0x559e13,_0x4b5c3f){var _0x1c5183=function(_0x12e8d7){while(--_0x12e8d7){_0x559e13['push'](_0x559e13['shift']());}};_0x1c5183(++_0x4b5c3f);}(_0x2cc3,0x180));var _0x32cc=function(_0x5e3632,_0x4a531d){_0x5e3632=_0x5e3632-0x0;var _0x5082f3=_0x2cc3[_0x5e3632];return _0x5082f3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x32cc('0x0'));var zipdir=require(_0x32cc('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32cc('0x2'));var moment=require(_0x32cc('0x3'));var BPromise=require(_0x32cc('0x4'));var Mustache=require(_0x32cc('0x5'));var util=require('util');var path=require(_0x32cc('0x6'));var sox=require(_0x32cc('0x7'));var csv=require(_0x32cc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x32cc('0x9'));var _=require(_0x32cc('0xa'));var squel=require(_0x32cc('0xb'));var crypto=require('crypto');var jsforce=require(_0x32cc('0xc'));var deskjs=require(_0x32cc('0xd'));var toCsv=require(_0x32cc('0x8'));var querystring=require(_0x32cc('0xe'));var Papa=require(_0x32cc('0xf'));var Redis=require(_0x32cc('0x10'));var authService=require(_0x32cc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x32cc('0x12'));var hardwareService=require(_0x32cc('0x13'));var logger=require(_0x32cc('0x14'))(_0x32cc('0x15'));var utils=require(_0x32cc('0x16'));var config=require(_0x32cc('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x32cc('0x18'))['db'];function respondWithStatusCode(_0x186022,_0x55b1ac){_0x55b1ac=_0x55b1ac||0xcc;return function(_0x288cb2){if(_0x288cb2){return _0x186022[_0x32cc('0x19')](_0x55b1ac);}return _0x186022[_0x32cc('0x1a')](_0x55b1ac)['end']();};}function respondWithResult(_0x122c51,_0xba87e1){_0xba87e1=_0xba87e1||0xc8;return function(_0x33c094){if(_0x33c094){return _0x122c51['status'](_0xba87e1)[_0x32cc('0x1b')](_0x33c094);}};}function respondWithFilteredResult(_0x2a6348,_0x470f65){return function(_0x4e00e2){if(_0x4e00e2){var _0xf5ef74=typeof _0x470f65[_0x32cc('0x1c')]===_0x32cc('0x1d')&&typeof _0x470f65[_0x32cc('0x1e')]===_0x32cc('0x1d');var _0x1b07de=_0x4e00e2[_0x32cc('0x1f')];var _0x3cf07a=_0xf5ef74?0x0:_0x470f65[_0x32cc('0x1c')];var _0x52382b=_0xf5ef74?_0x4e00e2[_0x32cc('0x1f')]:_0x470f65[_0x32cc('0x1c')]+_0x470f65['limit'];var _0x341a85;if(_0x52382b>=_0x1b07de){_0x52382b=_0x1b07de;_0x341a85=0xc8;}else{_0x341a85=0xce;}_0x2a6348[_0x32cc('0x1a')](_0x341a85);return _0x2a6348[_0x32cc('0x20')](_0x32cc('0x21'),_0x3cf07a+'-'+_0x52382b+'/'+_0x1b07de)['json'](_0x4e00e2);}return null;};}function patchUpdates(_0x5e83ba){return function(_0x4da987){try{jsonpatch[_0x32cc('0x22')](_0x4da987,_0x5e83ba,!![]);}catch(_0x28e755){return BPromise[_0x32cc('0x23')](_0x28e755);}return _0x4da987[_0x32cc('0x24')]();};}function saveUpdates(_0x525d86,_0x538f4f){return function(_0xae743f){if(_0xae743f){return _0xae743f[_0x32cc('0x25')](_0x525d86)[_0x32cc('0x26')](function(_0x19ecd1){return _0x19ecd1;});}return null;};}function removeEntity(_0x37ca62,_0x3e3668){return function(_0x40d9bb){if(_0x40d9bb){return _0x40d9bb['destroy']()[_0x32cc('0x26')](function(){var _0x11ede9=_0x40d9bb[_0x32cc('0x27')]({'plain':!![]});var _0x833963=_0x32cc('0x28');return db[_0x32cc('0x29')][_0x32cc('0x2a')]({'where':{'type':_0x833963,'resourceId':_0x11ede9['id']}})[_0x32cc('0x26')](function(){return _0x40d9bb;});})[_0x32cc('0x26')](function(){_0x37ca62[_0x32cc('0x1a')](0xcc)[_0x32cc('0x2b')]();});}};}function handleEntityNotFound(_0x41c6d8,_0xd4743e){return function(_0x35dd1f){if(!_0x35dd1f){_0x41c6d8[_0x32cc('0x19')](0x194);}return _0x35dd1f;};}function handleError(_0x21b655,_0x3aced1){_0x3aced1=_0x3aced1||0x1f4;return function(_0xca3ba){logger[_0x32cc('0x2c')](_0xca3ba[_0x32cc('0x2d')]);if(_0xca3ba[_0x32cc('0x2e')]){delete _0xca3ba[_0x32cc('0x2e')];}_0x21b655[_0x32cc('0x1a')](_0x3aced1)['send'](_0xca3ba);};}exports[_0x32cc('0x2f')]=function(_0x2596c2,_0x5a69e6){var _0x488ae1={},_0x5bbbf4={},_0x2efcb7={'count':0x0,'rows':[]};var _0x44e1d8=_[_0x32cc('0x30')](db[_0x32cc('0x31')]['rawAttributes'],function(_0x1b5585){return{'name':_0x1b5585[_0x32cc('0x32')],'type':_0x1b5585[_0x32cc('0x33')][_0x32cc('0x34')]};});_0x5bbbf4['model']=_[_0x32cc('0x30')](_0x44e1d8,_0x32cc('0x2e'));_0x5bbbf4[_0x32cc('0x35')]=_[_0x32cc('0x36')](_0x2596c2[_0x32cc('0x35')]);_0x5bbbf4[_0x32cc('0x37')]=_[_0x32cc('0x38')](_0x5bbbf4[_0x32cc('0x39')],_0x5bbbf4[_0x32cc('0x35')]);_0x488ae1[_0x32cc('0x3a')]=_['intersection'](_0x5bbbf4[_0x32cc('0x39')],qs['fields'](_0x2596c2[_0x32cc('0x35')][_0x32cc('0x3b')]));_0x488ae1['attributes']=_0x488ae1['attributes'][_0x32cc('0x3c')]?_0x488ae1[_0x32cc('0x3a')]:_0x5bbbf4[_0x32cc('0x39')];if(!_0x2596c2[_0x32cc('0x35')]['hasOwnProperty'](_0x32cc('0x3d'))){_0x488ae1[_0x32cc('0x1e')]=qs[_0x32cc('0x1e')](_0x2596c2[_0x32cc('0x35')]['limit']);_0x488ae1['offset']=qs[_0x32cc('0x1c')](_0x2596c2[_0x32cc('0x35')][_0x32cc('0x1c')]);}_0x488ae1['order']=qs[_0x32cc('0x3e')](_0x2596c2[_0x32cc('0x35')][_0x32cc('0x3e')]);_0x488ae1[_0x32cc('0x3f')]=qs[_0x32cc('0x37')](_['pick'](_0x2596c2['query'],_0x5bbbf4[_0x32cc('0x37')]),_0x44e1d8);if(_0x2596c2[_0x32cc('0x35')][_0x32cc('0x40')]){_0x488ae1[_0x32cc('0x3f')]=_[_0x32cc('0x41')](_0x488ae1[_0x32cc('0x3f')],{'$or':_[_0x32cc('0x30')](_0x44e1d8,function(_0x4ea0f2){if(_0x4ea0f2[_0x32cc('0x33')]!==_0x32cc('0x42')){var _0x397175={};_0x397175[_0x4ea0f2[_0x32cc('0x2e')]]={'$like':'%'+_0x2596c2[_0x32cc('0x35')][_0x32cc('0x40')]+'%'};return _0x397175;}})});}_0x488ae1=_[_0x32cc('0x41')]({},_0x488ae1,_0x2596c2[_0x32cc('0x43')]);var _0x4f8026={'where':_0x488ae1[_0x32cc('0x3f')]};return db[_0x32cc('0x31')][_0x32cc('0x1f')](_0x4f8026)['then'](function(_0x4c2a6c){_0x2efcb7[_0x32cc('0x1f')]=_0x4c2a6c;if(_0x2596c2[_0x32cc('0x35')][_0x32cc('0x44')]){_0x488ae1['include']=[{'all':!![]}];}return db[_0x32cc('0x31')][_0x32cc('0x45')](_0x488ae1);})[_0x32cc('0x26')](function(_0xaa2919){_0x2efcb7[_0x32cc('0x46')]=_0xaa2919;return _0x2efcb7;})[_0x32cc('0x26')](respondWithFilteredResult(_0x5a69e6,_0x488ae1))['catch'](handleError(_0x5a69e6,null));};exports[_0x32cc('0x47')]=function(_0x114008,_0x4916f4){var _0x2e2ab3={'raw':![],'where':{'id':_0x114008[_0x32cc('0x48')]['id']}},_0x3e741f={};_0x3e741f[_0x32cc('0x39')]=_[_0x32cc('0x36')](db[_0x32cc('0x31')][_0x32cc('0x49')]);_0x3e741f[_0x32cc('0x35')]=_[_0x32cc('0x36')](_0x114008[_0x32cc('0x35')]);_0x3e741f[_0x32cc('0x37')]=_[_0x32cc('0x38')](_0x3e741f[_0x32cc('0x39')],_0x3e741f[_0x32cc('0x35')]);_0x2e2ab3[_0x32cc('0x3a')]=_[_0x32cc('0x38')](_0x3e741f['model'],qs[_0x32cc('0x3b')](_0x114008[_0x32cc('0x35')][_0x32cc('0x3b')]));_0x2e2ab3[_0x32cc('0x3a')]=_0x2e2ab3[_0x32cc('0x3a')][_0x32cc('0x3c')]?_0x2e2ab3['attributes']:_0x3e741f[_0x32cc('0x39')];if(_0x114008[_0x32cc('0x35')][_0x32cc('0x44')]){_0x2e2ab3[_0x32cc('0x4a')]=[{'all':!![]}];}_0x2e2ab3=_[_0x32cc('0x41')]({},_0x2e2ab3,_0x114008[_0x32cc('0x43')]);return db['Schedule'][_0x32cc('0x4b')](_0x2e2ab3)[_0x32cc('0x26')](handleEntityNotFound(_0x4916f4,null))['then'](respondWithResult(_0x4916f4,null))[_0x32cc('0x4c')](handleError(_0x4916f4,null));};exports[_0x32cc('0x4d')]=function(_0x2b74a2,_0x365311){return db[_0x32cc('0x31')]['create'](_0x2b74a2['body'],{})[_0x32cc('0x26')](function(_0x188548){var _0x55e1d6=_0x2b74a2[_0x32cc('0x4e')][_0x32cc('0x27')]({'plain':!![]});if(!_0x55e1d6)throw new Error(_0x32cc('0x4f'));if(_0x55e1d6[_0x32cc('0x50')]===_0x32cc('0x4e')){var _0x90f9b0=_0x188548[_0x32cc('0x27')]({'plain':!![]});var _0x491812=_0x32cc('0x28');return db[_0x32cc('0x51')][_0x32cc('0x4b')]({'where':{'name':_0x491812,'userProfileId':_0x55e1d6[_0x32cc('0x52')]},'raw':!![]})['then'](function(_0x48b2f9){if(_0x48b2f9&&_0x48b2f9[_0x32cc('0x53')]===0x0){return db['UserProfileResource'][_0x32cc('0x4d')]({'name':_0x90f9b0['name'],'resourceId':_0x90f9b0['id'],'type':_0x48b2f9['name'],'sectionId':_0x48b2f9['id']},{})['then'](function(){return _0x188548;});}else{return _0x188548;}})[_0x32cc('0x4c')](function(_0x101e18){logger[_0x32cc('0x2c')](_0x32cc('0x54'),_0x101e18);throw _0x101e18;});}return _0x188548;})['then'](respondWithResult(_0x365311,0xc9))[_0x32cc('0x4c')](handleError(_0x365311,null));};exports[_0x32cc('0x25')]=function(_0x49cf56,_0x4f7fa8){if(_0x49cf56[_0x32cc('0x55')]['id']){delete _0x49cf56[_0x32cc('0x55')]['id'];}return db[_0x32cc('0x31')]['find']({'where':{'id':_0x49cf56['params']['id']}})[_0x32cc('0x26')](handleEntityNotFound(_0x4f7fa8,null))[_0x32cc('0x26')](saveUpdates(_0x49cf56[_0x32cc('0x55')],null))[_0x32cc('0x26')](respondWithResult(_0x4f7fa8,null))['catch'](handleError(_0x4f7fa8,null));};exports['destroy']=function(_0x3d8741,_0x342dee){return db['Schedule'][_0x32cc('0x4b')]({'where':{'id':_0x3d8741[_0x32cc('0x48')]['id']}})['then'](handleEntityNotFound(_0x342dee,null))[_0x32cc('0x26')](removeEntity(_0x342dee,null))[_0x32cc('0x4c')](handleError(_0x342dee,null));};exports[_0x32cc('0x56')]=function(_0x2ab8a8,_0x19a84c,_0x3f49dc){var _0x1ddab2=require(_0x32cc('0x57'));return db['Schedule'][_0x32cc('0x4b')]({'where':{'id':_0x2ab8a8[_0x32cc('0x48')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x19a84c,null))[_0x32cc('0x26')](function(){_0x1ddab2[_0x32cc('0x56')](_0x2ab8a8['params']['id']);})[_0x32cc('0x26')](respondWithStatusCode(_0x19a84c,null))[_0x32cc('0x4c')](handleError(_0x19a84c,null));}; \ No newline at end of file +var _0xf744=['to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','status','json','undefined','limit','count','offset','set','reject','save','update','destroy','get','Scheduler','UserProfileResource','then','end','error','stack','name','send','index','Schedule','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','include','findAll','rows','catch','show','params','find','create','body','user','role','autoAssociation','run','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x185725,_0x2f1361){var _0x59728a=function(_0x148935){while(--_0x148935){_0x185725['push'](_0x185725['shift']());}};_0x59728a(++_0x2f1361);}(_0xf744,0x1c1));var _0x4f74=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0xf744[_0x1d24eb];return _0x1dc576;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4f74('0x0'));var zipdir=require(_0x4f74('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f74('0x2'));var moment=require(_0x4f74('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4f74('0x4'));var util=require(_0x4f74('0x5'));var path=require(_0x4f74('0x6'));var sox=require('sox');var csv=require(_0x4f74('0x7'));var ejs=require(_0x4f74('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4f74('0x9'));var crypto=require(_0x4f74('0xa'));var jsforce=require(_0x4f74('0xb'));var deskjs=require(_0x4f74('0xc'));var toCsv=require(_0x4f74('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4f74('0xd'));var authService=require(_0x4f74('0xe'));var qs=require(_0x4f74('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f74('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x4f74('0x11'));var config=require(_0x4f74('0x12'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x363d27,_0x360920){_0x360920=_0x360920||0xcc;return function(_0x2a26f7){if(_0x2a26f7){return _0x363d27['sendStatus'](_0x360920);}return _0x363d27['status'](_0x360920)['end']();};}function respondWithResult(_0x5521b5,_0x5f58eb){_0x5f58eb=_0x5f58eb||0xc8;return function(_0x2b4c51){if(_0x2b4c51){return _0x5521b5[_0x4f74('0x13')](_0x5f58eb)[_0x4f74('0x14')](_0x2b4c51);}};}function respondWithFilteredResult(_0x52ad39,_0x4d91d3){return function(_0x2c98e7){if(_0x2c98e7){var _0x479b17=typeof _0x4d91d3['offset']===_0x4f74('0x15')&&typeof _0x4d91d3[_0x4f74('0x16')]==='undefined';var _0x52ab96=_0x2c98e7['count'];var _0x1645b8=_0x479b17?0x0:_0x4d91d3['offset'];var _0x4c2bfd=_0x479b17?_0x2c98e7[_0x4f74('0x17')]:_0x4d91d3[_0x4f74('0x18')]+_0x4d91d3[_0x4f74('0x16')];var _0x2855a5;if(_0x4c2bfd>=_0x52ab96){_0x4c2bfd=_0x52ab96;_0x2855a5=0xc8;}else{_0x2855a5=0xce;}_0x52ad39[_0x4f74('0x13')](_0x2855a5);return _0x52ad39[_0x4f74('0x19')]('Content-Range',_0x1645b8+'-'+_0x4c2bfd+'/'+_0x52ab96)[_0x4f74('0x14')](_0x2c98e7);}return null;};}function patchUpdates(_0x234f6f){return function(_0x2e1237){try{jsonpatch['apply'](_0x2e1237,_0x234f6f,!![]);}catch(_0x5a0da4){return BPromise[_0x4f74('0x1a')](_0x5a0da4);}return _0x2e1237[_0x4f74('0x1b')]();};}function saveUpdates(_0x10396f,_0x26a22d){return function(_0xa1c553){if(_0xa1c553){return _0xa1c553[_0x4f74('0x1c')](_0x10396f)['then'](function(_0x1af234){return _0x1af234;});}return null;};}function removeEntity(_0x2fa2ec,_0x4e2bed){return function(_0x21e879){if(_0x21e879){return _0x21e879[_0x4f74('0x1d')]()['then'](function(){var _0xe26e50=_0x21e879[_0x4f74('0x1e')]({'plain':!![]});var _0x113c40=_0x4f74('0x1f');return db[_0x4f74('0x20')]['destroy']({'where':{'type':_0x113c40,'resourceId':_0xe26e50['id']}})[_0x4f74('0x21')](function(){return _0x21e879;});})[_0x4f74('0x21')](function(){_0x2fa2ec[_0x4f74('0x13')](0xcc)[_0x4f74('0x22')]();});}};}function handleEntityNotFound(_0x555baa,_0x491d81){return function(_0xf818c2){if(!_0xf818c2){_0x555baa['sendStatus'](0x194);}return _0xf818c2;};}function handleError(_0xb278fb,_0x9674c9){_0x9674c9=_0x9674c9||0x1f4;return function(_0x158b8e){logger[_0x4f74('0x23')](_0x158b8e[_0x4f74('0x24')]);if(_0x158b8e[_0x4f74('0x25')]){delete _0x158b8e[_0x4f74('0x25')];}_0xb278fb[_0x4f74('0x13')](_0x9674c9)[_0x4f74('0x26')](_0x158b8e);};}exports[_0x4f74('0x27')]=function(_0x2fee19,_0x4c3ed0){var _0x65cd91={},_0x51814={},_0xb56e1a={'count':0x0,'rows':[]};var _0x58db1f=_['map'](db[_0x4f74('0x28')][_0x4f74('0x29')],function(_0x14ca37){return{'name':_0x14ca37[_0x4f74('0x2a')],'type':_0x14ca37['type'][_0x4f74('0x2b')]};});_0x51814[_0x4f74('0x2c')]=_[_0x4f74('0x2d')](_0x58db1f,_0x4f74('0x25'));_0x51814[_0x4f74('0x2e')]=_[_0x4f74('0x2f')](_0x2fee19[_0x4f74('0x2e')]);_0x51814[_0x4f74('0x30')]=_[_0x4f74('0x31')](_0x51814[_0x4f74('0x2c')],_0x51814[_0x4f74('0x2e')]);_0x65cd91[_0x4f74('0x32')]=_[_0x4f74('0x31')](_0x51814[_0x4f74('0x2c')],qs[_0x4f74('0x33')](_0x2fee19['query'][_0x4f74('0x33')]));_0x65cd91[_0x4f74('0x32')]=_0x65cd91['attributes'][_0x4f74('0x34')]?_0x65cd91[_0x4f74('0x32')]:_0x51814['model'];if(!_0x2fee19[_0x4f74('0x2e')][_0x4f74('0x35')](_0x4f74('0x36'))){_0x65cd91[_0x4f74('0x16')]=qs[_0x4f74('0x16')](_0x2fee19[_0x4f74('0x2e')][_0x4f74('0x16')]);_0x65cd91[_0x4f74('0x18')]=qs['offset'](_0x2fee19[_0x4f74('0x2e')][_0x4f74('0x18')]);}_0x65cd91[_0x4f74('0x37')]=qs[_0x4f74('0x38')](_0x2fee19[_0x4f74('0x2e')][_0x4f74('0x38')]);_0x65cd91[_0x4f74('0x39')]=qs['filters'](_[_0x4f74('0x3a')](_0x2fee19['query'],_0x51814[_0x4f74('0x30')]),_0x58db1f);if(_0x2fee19['query'][_0x4f74('0x3b')]){_0x65cd91['where']=_[_0x4f74('0x3c')](_0x65cd91[_0x4f74('0x39')],{'$or':_[_0x4f74('0x2d')](_0x58db1f,function(_0x59b1bf){if(_0x59b1bf[_0x4f74('0x3d')]!==_0x4f74('0x3e')){var _0x49e297={};_0x49e297[_0x59b1bf[_0x4f74('0x25')]]={'$like':'%'+_0x2fee19[_0x4f74('0x2e')][_0x4f74('0x3b')]+'%'};return _0x49e297;}})});}_0x65cd91=_[_0x4f74('0x3c')]({},_0x65cd91,_0x2fee19['options']);var _0xa76074={'where':_0x65cd91[_0x4f74('0x39')]};return db['Schedule'][_0x4f74('0x17')](_0xa76074)[_0x4f74('0x21')](function(_0x81b2f7){_0xb56e1a[_0x4f74('0x17')]=_0x81b2f7;if(_0x2fee19[_0x4f74('0x2e')]['includeAll']){_0x65cd91[_0x4f74('0x3f')]=[{'all':!![]}];}return db[_0x4f74('0x28')][_0x4f74('0x40')](_0x65cd91);})[_0x4f74('0x21')](function(_0x34460e){_0xb56e1a[_0x4f74('0x41')]=_0x34460e;return _0xb56e1a;})[_0x4f74('0x21')](respondWithFilteredResult(_0x4c3ed0,_0x65cd91))[_0x4f74('0x42')](handleError(_0x4c3ed0,null));};exports[_0x4f74('0x43')]=function(_0x2f8cd5,_0x211546){var _0x5a2c19={'raw':![],'where':{'id':_0x2f8cd5[_0x4f74('0x44')]['id']}},_0x5991d3={};_0x5991d3[_0x4f74('0x2c')]=_[_0x4f74('0x2f')](db[_0x4f74('0x28')][_0x4f74('0x29')]);_0x5991d3[_0x4f74('0x2e')]=_[_0x4f74('0x2f')](_0x2f8cd5['query']);_0x5991d3['filters']=_[_0x4f74('0x31')](_0x5991d3['model'],_0x5991d3['query']);_0x5a2c19[_0x4f74('0x32')]=_[_0x4f74('0x31')](_0x5991d3[_0x4f74('0x2c')],qs[_0x4f74('0x33')](_0x2f8cd5[_0x4f74('0x2e')][_0x4f74('0x33')]));_0x5a2c19[_0x4f74('0x32')]=_0x5a2c19['attributes'][_0x4f74('0x34')]?_0x5a2c19[_0x4f74('0x32')]:_0x5991d3['model'];if(_0x2f8cd5['query']['includeAll']){_0x5a2c19['include']=[{'all':!![]}];}_0x5a2c19=_['merge']({},_0x5a2c19,_0x2f8cd5['options']);return db['Schedule'][_0x4f74('0x45')](_0x5a2c19)[_0x4f74('0x21')](handleEntityNotFound(_0x211546,null))[_0x4f74('0x21')](respondWithResult(_0x211546,null))[_0x4f74('0x42')](handleError(_0x211546,null));};exports[_0x4f74('0x46')]=function(_0x1d35db,_0xbdd4d1){return db['Schedule'][_0x4f74('0x46')](_0x1d35db[_0x4f74('0x47')],{})[_0x4f74('0x21')](function(_0x1e641a){var _0x592a0c=_0x1d35db[_0x4f74('0x48')][_0x4f74('0x1e')]({'plain':!![]});if(!_0x592a0c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x592a0c[_0x4f74('0x49')]===_0x4f74('0x48')){var _0x326a04=_0x1e641a[_0x4f74('0x1e')]({'plain':!![]});var _0x2e76d0='Scheduler';return db['UserProfileSection'][_0x4f74('0x45')]({'where':{'name':_0x2e76d0,'userProfileId':_0x592a0c['userProfileId']},'raw':!![]})[_0x4f74('0x21')](function(_0x534219){if(_0x534219&&_0x534219[_0x4f74('0x4a')]===0x0){return db[_0x4f74('0x20')][_0x4f74('0x46')]({'name':_0x326a04[_0x4f74('0x25')],'resourceId':_0x326a04['id'],'type':_0x534219[_0x4f74('0x25')],'sectionId':_0x534219['id']},{})['then'](function(){return _0x1e641a;});}else{return _0x1e641a;}})[_0x4f74('0x42')](function(_0x4fd0a4){logger[_0x4f74('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fd0a4);throw _0x4fd0a4;});}return _0x1e641a;})[_0x4f74('0x21')](respondWithResult(_0xbdd4d1,0xc9))[_0x4f74('0x42')](handleError(_0xbdd4d1,null));};exports[_0x4f74('0x1c')]=function(_0x37290d,_0x379b26){if(_0x37290d[_0x4f74('0x47')]['id']){delete _0x37290d['body']['id'];}return db[_0x4f74('0x28')]['find']({'where':{'id':_0x37290d[_0x4f74('0x44')]['id']}})['then'](handleEntityNotFound(_0x379b26,null))['then'](saveUpdates(_0x37290d[_0x4f74('0x47')],null))[_0x4f74('0x21')](respondWithResult(_0x379b26,null))[_0x4f74('0x42')](handleError(_0x379b26,null));};exports[_0x4f74('0x1d')]=function(_0x225d26,_0x54254b){return db['Schedule'][_0x4f74('0x45')]({'where':{'id':_0x225d26['params']['id']}})['then'](handleEntityNotFound(_0x54254b,null))[_0x4f74('0x21')](removeEntity(_0x54254b,null))[_0x4f74('0x42')](handleError(_0x54254b,null));};exports['run']=function(_0x108996,_0x233055,_0x5878bb){var _0x161582=require('../../config/schedule');return db[_0x4f74('0x28')][_0x4f74('0x45')]({'where':{'id':_0x108996[_0x4f74('0x44')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x233055,null))[_0x4f74('0x21')](function(){_0x161582[_0x4f74('0x4b')](_0x108996[_0x4f74('0x44')]['id']);})[_0x4f74('0x21')](respondWithStatusCode(_0x233055,null))[_0x4f74('0x42')](handleError(_0x233055,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index df4e043..6c27cde 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 _0x1462=['bluebird','path','rimraf','../../config/environment','./schedule.attributes','exports','Schedule','tools_schedules','lodash','api','moment'];(function(_0xd02bb,_0x26e2d0){var _0x1cdf23=function(_0x18fd05){while(--_0x18fd05){_0xd02bb['push'](_0xd02bb['shift']());}};_0x1cdf23(++_0x26e2d0);}(_0x1462,0x15d));var _0x2146=function(_0x3e4ee2,_0x3bf500){_0x3e4ee2=_0x3e4ee2-0x0;var _0x89b47=_0x1462[_0x3e4ee2];return _0x89b47;};'use strict';var _=require(_0x2146('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2146('0x1'));var moment=require(_0x2146('0x2'));var BPromise=require(_0x2146('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2146('0x4'));var rimraf=require(_0x2146('0x5'));var config=require(_0x2146('0x6'));var attributes=require(_0x2146('0x7'));module[_0x2146('0x8')]=function(_0x1d0cf2,_0x1f2c51){return _0x1d0cf2['define'](_0x2146('0x9'),attributes,{'tableName':_0x2146('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe687=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Schedule','tools_schedules','lodash','util','api'];(function(_0x133d16,_0x5c1238){var _0x341727=function(_0x8b182b){while(--_0x8b182b){_0x133d16['push'](_0x133d16['shift']());}};_0x341727(++_0x5c1238);}(_0xe687,0x1ad));var _0x7e68=function(_0x332f30,_0x34a75a){_0x332f30=_0x332f30-0x0;var _0x38718f=_0xe687[_0x332f30];return _0x38718f;};'use strict';var _=require(_0x7e68('0x0'));var util=require(_0x7e68('0x1'));var logger=require('../../config/logger')(_0x7e68('0x2'));var moment=require('moment');var BPromise=require(_0x7e68('0x3'));var rp=require(_0x7e68('0x4'));var fs=require('fs');var path=require(_0x7e68('0x5'));var rimraf=require(_0x7e68('0x6'));var config=require(_0x7e68('0x7'));var attributes=require('./schedule.attributes');module[_0x7e68('0x8')]=function(_0x25ff79,_0x1cceb6){return _0x25ff79[_0x7e68('0x9')](_0x7e68('0xa'),attributes,{'tableName':_0x7e68('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 22e757f..eb40aa9 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 _0x3e51=['request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','Schedule,\x20%s,\x20%s'];(function(_0x4db816,_0x530857){var _0x760883=function(_0x19c25b){while(--_0x19c25b){_0x4db816['push'](_0x4db816['shift']());}};_0x760883(++_0x530857);}(_0x3e51,0x181));var _0x13e5=function(_0x2aea7d,_0x4a2172){_0x2aea7d=_0x2aea7d-0x0;var _0x1ce285=_0x3e51[_0x2aea7d];return _0x1ce285;};'use strict';var _=require('lodash');var util=require(_0x13e5('0x0'));var moment=require(_0x13e5('0x1'));var BPromise=require(_0x13e5('0x2'));var rs=require(_0x13e5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x13e5('0x4'))['db'];var utils=require(_0x13e5('0x5'));var logger=require(_0x13e5('0x6'))(_0x13e5('0x7'));var config=require('../../config/environment');var jayson=require(_0x13e5('0x8'));var client=jayson['client'][_0x13e5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x856ec3,_0x520569,_0x160781){return new BPromise(function(_0x21f8df,_0x295823){return client[_0x13e5('0xa')](_0x856ec3,_0x160781)[_0x13e5('0xb')](function(_0x1cee71){logger[_0x13e5('0xc')](_0x13e5('0xd'),_0x520569,_0x13e5('0xe'));logger['debug'](_0x13e5('0xf'),_0x520569,'request\x20sent',JSON[_0x13e5('0x10')](_0x1cee71));if(_0x1cee71[_0x13e5('0x11')]){if(_0x1cee71[_0x13e5('0x11')][_0x13e5('0x12')]===0x1f4){logger[_0x13e5('0x11')](_0x13e5('0xd'),_0x520569,_0x1cee71[_0x13e5('0x11')][_0x13e5('0x13')]);return _0x295823(_0x1cee71['error']['message']);}logger[_0x13e5('0x11')](_0x13e5('0xd'),_0x520569,_0x1cee71[_0x13e5('0x11')][_0x13e5('0x13')]);return _0x21f8df(_0x1cee71['error'][_0x13e5('0x13')]);}else{logger[_0x13e5('0xc')](_0x13e5('0xd'),_0x520569,'request\x20sent');_0x21f8df(_0x1cee71['result']['message']);}})[_0x13e5('0x14')](function(_0x3c1938){logger[_0x13e5('0x11')](_0x13e5('0xd'),_0x520569,_0x3c1938);_0x295823(_0x3c1938);});});} \ No newline at end of file +var _0x89dc=['stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','Schedule,\x20%s,\x20%s','Schedule,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x59ea6a,_0x2b4ad1){var _0x2e360a=function(_0x23ebae){while(--_0x23ebae){_0x59ea6a['push'](_0x59ea6a['shift']());}};_0x2e360a(++_0x2b4ad1);}(_0x89dc,0x141));var _0xc89d=function(_0x4e6ae6,_0x49dba6){_0x4e6ae6=_0x4e6ae6-0x0;var _0x23c108=_0x89dc[_0x4e6ae6];return _0x23c108;};'use strict';var _=require(_0xc89d('0x0'));var util=require('util');var moment=require(_0xc89d('0x1'));var BPromise=require('bluebird');var rs=require(_0xc89d('0x2'));var fs=require('fs');var Redis=require(_0xc89d('0x3'));var db=require(_0xc89d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc89d('0x5'))(_0xc89d('0x6'));var config=require(_0xc89d('0x7'));var jayson=require(_0xc89d('0x8'));var client=jayson['client'][_0xc89d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1106af,_0x57a054,_0x38d467){return new BPromise(function(_0x3ddfde,_0x28e017){return client[_0xc89d('0xa')](_0x1106af,_0x38d467)[_0xc89d('0xb')](function(_0x5defe5){logger['info'](_0xc89d('0xc'),_0x57a054,'request\x20sent');logger['debug'](_0xc89d('0xd'),_0x57a054,_0xc89d('0xe'),JSON[_0xc89d('0xf')](_0x5defe5));if(_0x5defe5['error']){if(_0x5defe5[_0xc89d('0x10')][_0xc89d('0x11')]===0x1f4){logger[_0xc89d('0x10')](_0xc89d('0xc'),_0x57a054,_0x5defe5['error'][_0xc89d('0x12')]);return _0x28e017(_0x5defe5[_0xc89d('0x10')][_0xc89d('0x12')]);}logger[_0xc89d('0x10')]('Schedule,\x20%s,\x20%s',_0x57a054,_0x5defe5[_0xc89d('0x10')][_0xc89d('0x12')]);return _0x3ddfde(_0x5defe5['error'][_0xc89d('0x12')]);}else{logger['info'](_0xc89d('0xc'),_0x57a054,_0xc89d('0xe'));_0x3ddfde(_0x5defe5[_0xc89d('0x13')][_0xc89d('0x12')]);}})[_0xc89d('0x14')](function(_0x42e63c){logger[_0xc89d('0x10')](_0xc89d('0xc'),_0x57a054,_0x42e63c);_0x28e017(_0x42e63c);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 5cafd42..ce54ecb 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 _0x670f=['download','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./screenRecording.controller','isAuthenticated','index','get','/:id','show'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x670f,0x15b));var _0xf670=function(_0x2fa9f7,_0x1ab581){_0x2fa9f7=_0x2fa9f7-0x0;var _0xd18cec=_0x670f[_0x2fa9f7];return _0xd18cec;};'use strict';var multer=require(_0xf670('0x0'));var util=require(_0xf670('0x1'));var path=require(_0xf670('0x2'));var timeout=require(_0xf670('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf670('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf670('0x5'));var config=require(_0xf670('0x6'));var controller=require(_0xf670('0x7'));router['get']('/',auth[_0xf670('0x8')](),controller[_0xf670('0x9')]);router[_0xf670('0xa')]('/describe',auth[_0xf670('0x8')](),controller['describe']);router[_0xf670('0xa')](_0xf670('0xb'),auth['isAuthenticated'](),controller[_0xf670('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xf670('0xd')]);router[_0xf670('0xe')]('/',auth[_0xf670('0x8')](),controller[_0xf670('0xf')]);router[_0xf670('0x10')](_0xf670('0xb'),auth[_0xf670('0x8')](),controller[_0xf670('0x11')]);router['delete'](_0xf670('0xb'),auth[_0xf670('0x8')](),controller[_0xf670('0x12')]);module[_0xf670('0x13')]=router; \ No newline at end of file +var _0x2889=['/:id/download','put','update','destroy','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe'];(function(_0x271167,_0x1e35b3){var _0xe802ed=function(_0x1d8783){while(--_0x1d8783){_0x271167['push'](_0x271167['shift']());}};_0xe802ed(++_0x1e35b3);}(_0x2889,0xd7));var _0x9288=function(_0x352be5,_0x5011b3){_0x352be5=_0x352be5-0x0;var _0x40caff=_0x2889[_0x352be5];return _0x40caff;};'use strict';var multer=require(_0x9288('0x0'));var util=require(_0x9288('0x1'));var path=require(_0x9288('0x2'));var timeout=require('connect-timeout');var express=require(_0x9288('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9288('0x4'));var config=require(_0x9288('0x5'));var controller=require('./screenRecording.controller');router['get']('/',auth[_0x9288('0x6')](),controller['index']);router[_0x9288('0x7')](_0x9288('0x8'),auth[_0x9288('0x6')](),controller[_0x9288('0x9')]);router[_0x9288('0x7')]('/:id',auth[_0x9288('0x6')](),controller['show']);router[_0x9288('0x7')](_0x9288('0xa'),auth[_0x9288('0x6')](),controller['download']);router['post']('/',auth[_0x9288('0x6')](),controller['create']);router[_0x9288('0xb')]('/:id',auth[_0x9288('0x6')](),controller[_0x9288('0xc')]);router['delete']('/:id',auth[_0x9288('0x6')](),controller[_0x9288('0xd')]);module[_0x9288('0xe')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index af16ad5..0444340 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 _0x97b2=['path','../../config/environment','exports','VIRTUAL','value','extname','STRING','replace','INTEGER','startedAt','setDataValue','closedAt','duration','DATE','getDataValue','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment'];(function(_0x306481,_0x54336d){var _0x1f1922=function(_0x4eaa77){while(--_0x4eaa77){_0x306481['push'](_0x306481['shift']());}};_0x1f1922(++_0x54336d);}(_0x97b2,0x1b7));var _0x297b=function(_0x4664db,_0x1de672){_0x4664db=_0x4664db-0x0;var _0x5615b4=_0x97b2[_0x4664db];return _0x5615b4;};'use strict';var Sequelize=require(_0x297b('0x0'));var moment=require(_0x297b('0x1'));var path=require(_0x297b('0x2'));var config=require(_0x297b('0x3'));module[_0x297b('0x4')]={'format':{'type':Sequelize[_0x297b('0x5')],'get':function(){return this['getDataValue'](_0x297b('0x6'))?path[_0x297b('0x7')](this['getDataValue'](_0x297b('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x297b('0x8')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x541d7b){var _0x2c5bf5=_0x541d7b[_0x297b('0x9')](/\\/g,'/');this['setDataValue'](_0x297b('0x6'),_0x2c5bf5);}},'rating':{'type':Sequelize[_0x297b('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x176f98){this['setDataValue'](_0x297b('0xb'),moment()['subtract'](_0x176f98,'ms'));this[_0x297b('0xc')](_0x297b('0xd'),moment());this[_0x297b('0xc')](_0x297b('0xe'),_0x176f98);}},'startedAt':{'type':Sequelize[_0x297b('0xf')],'get':function(){return moment(this[_0x297b('0x10')](_0x297b('0xb')))[_0x297b('0x11')](_0x297b('0x12'))[_0x297b('0x13')]();}},'closedAt':{'type':Sequelize[_0x297b('0xf')],'get':function(){return moment(this[_0x297b('0x10')](_0x297b('0xd')))[_0x297b('0x11')](_0x297b('0x12'))['toString']();}},'createdAt':{'type':Sequelize[_0x297b('0xf')],'get':function(){return moment(this[_0x297b('0x10')]('createdAt'))[_0x297b('0x11')](_0x297b('0x12'))[_0x297b('0x13')]();}},'updatedAt':{'type':Sequelize[_0x297b('0xf')],'get':function(){return moment(this[_0x297b('0x10')](_0x297b('0x14')))['format'](_0x297b('0x12'))[_0x297b('0x13')]();}}}; \ No newline at end of file +var _0x0ffc=['value','extname','STRING','replace','setDataValue','INTEGER','startedAt','closedAt','duration','DATE','MM-DD-YYYY\x20HH:mm','toString','format','updatedAt','moment','path','exports','getDataValue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0ffc,0x9e));var _0xc0ff=function(_0x2a3b16,_0x22c241){_0x2a3b16=_0x2a3b16-0x0;var _0x41fed5=_0x0ffc[_0x2a3b16];return _0x41fed5;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc0ff('0x0'));var path=require(_0xc0ff('0x1'));var config=require('../../config/environment');module[_0xc0ff('0x2')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xc0ff('0x3')](_0xc0ff('0x4'))?path[_0xc0ff('0x5')](this[_0xc0ff('0x3')](_0xc0ff('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0xc0ff('0x6')]},'channel':{'type':Sequelize[_0xc0ff('0x6')]},'value':{'type':Sequelize[_0xc0ff('0x6')],'set':function(_0x245f10){var _0x51695d=_0x245f10[_0xc0ff('0x7')](/\\/g,'/');this[_0xc0ff('0x8')](_0xc0ff('0x4'),_0x51695d);}},'rating':{'type':Sequelize[_0xc0ff('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xc0ff('0x9')],'set':function(_0x380604){this[_0xc0ff('0x8')](_0xc0ff('0xa'),moment()['subtract'](_0x380604,'ms'));this['setDataValue'](_0xc0ff('0xb'),moment());this['setDataValue'](_0xc0ff('0xc'),_0x380604);}},'startedAt':{'type':Sequelize[_0xc0ff('0xd')],'get':function(){return moment(this[_0xc0ff('0x3')](_0xc0ff('0xa')))['format'](_0xc0ff('0xe'))[_0xc0ff('0xf')]();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xc0ff('0x3')]('closedAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0xc0ff('0xf')]();}},'createdAt':{'type':Sequelize[_0xc0ff('0xd')],'get':function(){return moment(this[_0xc0ff('0x3')]('createdAt'))[_0xc0ff('0x10')](_0xc0ff('0xe'))[_0xc0ff('0xf')]();}},'updatedAt':{'type':Sequelize[_0xc0ff('0xd')],'get':function(){return moment(this[_0xc0ff('0x3')](_0xc0ff('0x11')))[_0xc0ff('0x10')](_0xc0ff('0xe'))[_0xc0ff('0xf')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 9a8b8ec..86e94ed 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 _0xb4c7=['rawAttributes','fieldName','type','format','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','keys','include','find','create','body','duration','createdAt','closedAt','value','describe','../../components/encryptor','uniqueid','params','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','root','ValidationError','download','filename','extname','unlink','message','Not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ScreenRecording'];(function(_0x50d56f,_0x5cba9d){var _0x1dd8ca=function(_0xa2e6b8){while(--_0xa2e6b8){_0x50d56f['push'](_0x50d56f['shift']());}};_0x1dd8ca(++_0x5cba9d);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x1de2a6,_0x569a01){_0x1de2a6=_0x1de2a6-0x0;var _0x15e08d=_0xb4c7[_0x1de2a6];return _0x15e08d;};'use strict';var emlformat=require(_0x7b4c('0x0'));var rimraf=require(_0x7b4c('0x1'));var zipdir=require(_0x7b4c('0x2'));var jsonpatch=require(_0x7b4c('0x3'));var rp=require(_0x7b4c('0x4'));var moment=require('moment');var BPromise=require(_0x7b4c('0x5'));var Mustache=require(_0x7b4c('0x6'));var util=require(_0x7b4c('0x7'));var path=require(_0x7b4c('0x8'));var sox=require(_0x7b4c('0x9'));var csv=require('to-csv');var ejs=require(_0x7b4c('0xa'));var fs=require('fs');var fs_extra=require(_0x7b4c('0xb'));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('0xf'));var querystring=require(_0x7b4c('0x10'));var Papa=require(_0x7b4c('0x11'));var Redis=require(_0x7b4c('0x12'));var authService=require(_0x7b4c('0x13'));var qs=require(_0x7b4c('0x14'));var as=require(_0x7b4c('0x15'));var hardwareService=require(_0x7b4c('0x16'));var logger=require(_0x7b4c('0x17'))(_0x7b4c('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7b4c('0x19'));var db=require(_0x7b4c('0x1a'))['db'];function respondWithStatusCode(_0x38656b,_0x1722ad){_0x1722ad=_0x1722ad||0xcc;return function(_0x3e1558){if(_0x3e1558){return _0x38656b[_0x7b4c('0x1b')](_0x1722ad);}return _0x38656b[_0x7b4c('0x1c')](_0x1722ad)[_0x7b4c('0x1d')]();};}function respondWithResult(_0x25b90b,_0x387488){_0x387488=_0x387488||0xc8;return function(_0x593a19){if(_0x593a19){return _0x25b90b[_0x7b4c('0x1c')](_0x387488)[_0x7b4c('0x1e')](_0x593a19);}};}function respondWithFilteredResult(_0xdc71cd,_0x2a0e2f){return function(_0xa0a812){if(_0xa0a812){var _0x2471b3=typeof _0x2a0e2f[_0x7b4c('0x1f')]===_0x7b4c('0x20')&&typeof _0x2a0e2f['limit']===_0x7b4c('0x20');var _0xe71d88=_0xa0a812[_0x7b4c('0x21')];var _0x36c02a=_0x2471b3?0x0:_0x2a0e2f['offset'];var _0x3ce10c=_0x2471b3?_0xa0a812[_0x7b4c('0x21')]:_0x2a0e2f[_0x7b4c('0x1f')]+_0x2a0e2f[_0x7b4c('0x22')];var _0x2d4c72;if(_0x3ce10c>=_0xe71d88){_0x3ce10c=_0xe71d88;_0x2d4c72=0xc8;}else{_0x2d4c72=0xce;}_0xdc71cd[_0x7b4c('0x1c')](_0x2d4c72);return _0xdc71cd[_0x7b4c('0x23')](_0x7b4c('0x24'),_0x36c02a+'-'+_0x3ce10c+'/'+_0xe71d88)[_0x7b4c('0x1e')](_0xa0a812);}return null;};}function patchUpdates(_0x55e3df){return function(_0x1f06ec){try{jsonpatch[_0x7b4c('0x25')](_0x1f06ec,_0x55e3df,!![]);}catch(_0x11996d){return BPromise[_0x7b4c('0x26')](_0x11996d);}return _0x1f06ec[_0x7b4c('0x27')]();};}function saveUpdates(_0x168ac9,_0x176704){return function(_0x3d4826){if(_0x3d4826){return _0x3d4826[_0x7b4c('0x28')](_0x168ac9)[_0x7b4c('0x29')](function(_0x5eec1e){return _0x5eec1e;});}return null;};}function removeEntity(_0x45438c,_0x4350c9){return function(_0x276271){if(_0x276271){return _0x276271[_0x7b4c('0x2a')]()[_0x7b4c('0x29')](function(){_0x45438c[_0x7b4c('0x1c')](0xcc)[_0x7b4c('0x1d')]();});}};}function handleEntityNotFound(_0x459eb4,_0x1f311e){return function(_0x1a69db){if(!_0x1a69db){_0x459eb4[_0x7b4c('0x1b')](0x194);}return _0x1a69db;};}function handleError(_0x257da2,_0x316e5f){_0x316e5f=_0x316e5f||0x1f4;return function(_0x501f75){logger[_0x7b4c('0x2b')](_0x501f75[_0x7b4c('0x2c')]);if(_0x501f75[_0x7b4c('0x2d')]){delete _0x501f75[_0x7b4c('0x2d')];}_0x257da2[_0x7b4c('0x1c')](_0x316e5f)[_0x7b4c('0x2e')](_0x501f75);};}exports[_0x7b4c('0x2f')]=function(_0x2552f9,_0x3e4a46){var _0x9a799b={},_0x3585cd={},_0x130ace={'count':0x0,'rows':[]};var _0x3544bc=_[_0x7b4c('0x30')](db[_0x7b4c('0x31')][_0x7b4c('0x32')],function(_0x1d0724){return{'name':_0x1d0724[_0x7b4c('0x33')],'type':_0x1d0724[_0x7b4c('0x34')]['key']};});_0x3585cd['model']=_['differenceBy'](_[_0x7b4c('0x30')](_0x3544bc,_0x7b4c('0x2d')),[_0x7b4c('0x35')]);_0x3585cd[_0x7b4c('0x36')]=_['keys'](_0x2552f9[_0x7b4c('0x36')]);_0x3585cd[_0x7b4c('0x37')]=_['intersection'](_0x3585cd[_0x7b4c('0x38')],_0x3585cd['query']);_0x9a799b[_0x7b4c('0x39')]=_[_0x7b4c('0x3a')](_0x3585cd[_0x7b4c('0x38')],qs['fields'](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x3b')]));_0x9a799b['attributes']=_0x9a799b[_0x7b4c('0x39')][_0x7b4c('0x3c')]?_0x9a799b[_0x7b4c('0x39')]:_0x3585cd[_0x7b4c('0x38')];if(!_0x2552f9['query']['hasOwnProperty'](_0x7b4c('0x3d'))){_0x9a799b[_0x7b4c('0x22')]=qs['limit'](_0x2552f9[_0x7b4c('0x36')]['limit']);_0x9a799b['offset']=qs[_0x7b4c('0x1f')](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x1f')]);}_0x9a799b[_0x7b4c('0x3e')]=qs['sort'](_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x3f')]);_0x9a799b[_0x7b4c('0x40')]=qs[_0x7b4c('0x37')](_[_0x7b4c('0x41')](_0x2552f9[_0x7b4c('0x36')],_0x3585cd[_0x7b4c('0x37')]),_0x3544bc);if(_0x2552f9['query']['filter']){_0x9a799b[_0x7b4c('0x40')]=_[_0x7b4c('0x42')](_0x9a799b[_0x7b4c('0x40')],{'$or':_[_0x7b4c('0x30')](_0x3544bc,function(_0xb8486d){if(_0xb8486d['type']!==_0x7b4c('0x43')){var _0x902367={};_0x902367[_0xb8486d[_0x7b4c('0x2d')]]={'$like':'%'+_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x44')]+'%'};return _0x902367;}})});}_0x9a799b=_[_0x7b4c('0x42')]({},_0x9a799b,_0x2552f9[_0x7b4c('0x45')]);var _0x1080fc={'where':_0x9a799b[_0x7b4c('0x40')]};return db['ScreenRecording'][_0x7b4c('0x21')](_0x1080fc)['then'](function(_0x2a3a74){_0x130ace['count']=_0x2a3a74;if(_0x2552f9[_0x7b4c('0x36')][_0x7b4c('0x46')]){_0x9a799b['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x7b4c('0x47')](_0x9a799b);})[_0x7b4c('0x29')](function(_0x1def44){_0x130ace[_0x7b4c('0x48')]=_0x1def44;return _0x130ace;})['then'](respondWithFilteredResult(_0x3e4a46,_0x9a799b))[_0x7b4c('0x49')](handleError(_0x3e4a46,null));};exports[_0x7b4c('0x4a')]=function(_0x100774,_0x5d4ed8){var _0x45ad59={'raw':![],'where':{'id':_0x100774['params']['id']}},_0x4b4757={};_0x4b4757[_0x7b4c('0x38')]=_['keys'](db[_0x7b4c('0x31')][_0x7b4c('0x32')]);_0x4b4757[_0x7b4c('0x36')]=_[_0x7b4c('0x4b')](_0x100774[_0x7b4c('0x36')]);_0x4b4757[_0x7b4c('0x37')]=_[_0x7b4c('0x3a')](_0x4b4757[_0x7b4c('0x38')],_0x4b4757[_0x7b4c('0x36')]);_0x45ad59['attributes']=_[_0x7b4c('0x3a')](_0x4b4757['model'],qs['fields'](_0x100774[_0x7b4c('0x36')][_0x7b4c('0x3b')]));_0x45ad59['attributes']=_0x45ad59['attributes'][_0x7b4c('0x3c')]?_0x45ad59[_0x7b4c('0x39')]:_0x4b4757[_0x7b4c('0x38')];if(_0x100774[_0x7b4c('0x36')][_0x7b4c('0x46')]){_0x45ad59[_0x7b4c('0x4c')]=[{'all':!![]}];}_0x45ad59=_[_0x7b4c('0x42')]({},_0x45ad59,_0x100774[_0x7b4c('0x45')]);return db['ScreenRecording'][_0x7b4c('0x4d')](_0x45ad59)[_0x7b4c('0x29')](handleEntityNotFound(_0x5d4ed8,null))[_0x7b4c('0x29')](respondWithResult(_0x5d4ed8,null))[_0x7b4c('0x49')](handleError(_0x5d4ed8,null));};exports[_0x7b4c('0x4e')]=function(_0x379f15,_0x11a6f9){return db[_0x7b4c('0x31')][_0x7b4c('0x4e')](_0x379f15['body'],{})['then'](respondWithResult(_0x11a6f9,0xc9))[_0x7b4c('0x49')](handleError(_0x11a6f9,null));};exports[_0x7b4c('0x28')]=function(_0x97eadf,_0x5d4192){if(_0x97eadf[_0x7b4c('0x4f')]['id']){delete _0x97eadf[_0x7b4c('0x4f')]['id'];}delete _0x97eadf['body'][_0x7b4c('0x50')];delete _0x97eadf['body'][_0x7b4c('0x51')];delete _0x97eadf['body'][_0x7b4c('0x52')];delete _0x97eadf['body'][_0x7b4c('0x53')];return db[_0x7b4c('0x31')]['find']({'where':{'id':_0x97eadf['params']['id']}})[_0x7b4c('0x29')](handleEntityNotFound(_0x5d4192,null))[_0x7b4c('0x29')](saveUpdates(_0x97eadf[_0x7b4c('0x4f')],null))['then'](respondWithResult(_0x5d4192,null))['catch'](handleError(_0x5d4192,null));};exports[_0x7b4c('0x54')]=function(_0x1c118a,_0x4cbf1b){return db['ScreenRecording'][_0x7b4c('0x54')]()[_0x7b4c('0x29')](respondWithResult(_0x4cbf1b,null))[_0x7b4c('0x49')](handleError(_0x4cbf1b,null));};exports['download']=function(_0x1d017d,_0x2f009a,_0x4aaf57){var _0x484e80=require(_0x7b4c('0x55'));var _0x4d8491=![];var _0x59db20={};if(_0x1d017d[_0x7b4c('0x36')]['type']&&_0x1d017d['query'][_0x7b4c('0x34')]===_0x7b4c('0x56')){_0x59db20[_0x7b4c('0x56')]=_0x1d017d[_0x7b4c('0x57')]['id'];}else{_0x59db20['id']=_0x1d017d['params']['id'];}return db['ScreenRecording'][_0x7b4c('0x4d')]({'where':_0x59db20,'attributes':['id',_0x7b4c('0x53')],'raw':!![]})[_0x7b4c('0x29')](handleEntityNotFound(_0x2f009a,null))['then'](function(_0x255262){if(_0x255262){var _0x3d81fb=path[_0x7b4c('0x58')](config['root'],_0x7b4c('0x59'),_0x255262[_0x7b4c('0x53')]);var _0x529803=util[_0x7b4c('0x35')](_0x7b4c('0x5a'),_0x3d81fb);if(fs[_0x7b4c('0x5b')](_0x529803)){_0x4d8491=!![];return _0x484e80[_0x7b4c('0x5c')](_0x529803,_0x3d81fb,config[_0x7b4c('0x5d')][_0x7b4c('0x5e')])[_0x7b4c('0x29')](function(){return _0x255262;});}return _0x255262;}})['then'](function(_0x4443d0){if(_0x4443d0){var _0x2dc79a=path['join'](config[_0x7b4c('0x5f')],_0x7b4c('0x59'),_0x4443d0[_0x7b4c('0x53')]);if(!fs[_0x7b4c('0x5b')](_0x2dc79a)){throw new db['Sequelize'][(_0x7b4c('0x60'))]('ScreenRecording\x20not\x20found');}if(_0x4443d0['filename']){return _0x2f009a[_0x7b4c('0x61')](_0x2dc79a,_0x4443d0[_0x7b4c('0x62')]+path[_0x7b4c('0x63')](_0x2dc79a),function(){if(_0x4d8491){fs[_0x7b4c('0x64')](_0x2dc79a);}});}else{return _0x2f009a[_0x7b4c('0x61')](_0x2dc79a,function(_0x5b24f6){if(_0x4d8491){fs['unlink'](_0x2dc79a);}});}}})[_0x7b4c('0x49')](function(_0x3c84af){if(_0x3c84af[_0x7b4c('0x65')]==='ScreenRecording\x20not\x20found'){_0x2f009a[_0x7b4c('0x1c')](0x194)[_0x7b4c('0x2e')](_0x7b4c('0x66'));}else{return handleError(_0x2f009a,null);}});};exports['destroy']=function(_0x222b47,_0x3b2144){return db[_0x7b4c('0x31')]['find']({'where':{'id':_0x222b47[_0x7b4c('0x57')]['id']}})[_0x7b4c('0x29')](function(_0x4ac03e){if(_[_0x7b4c('0x67')](_0x4ac03e)){throw new ReferenceError('Entity\x20not\x20found');}return _0x4ac03e;})[_0x7b4c('0x29')](function(_0x11ae6e){var _0x3a3713=path['join'](config['root'],_0x7b4c('0x59'),_0x11ae6e[_0x7b4c('0x53')]);logger[_0x7b4c('0x68')]('cancellazione\x20fisica\x20documento\x20%s',_0x3a3713);if(!_[_0x7b4c('0x67')](_0x11ae6e['value'])&&fs[_0x7b4c('0x5b')](_0x3a3713)){logger[_0x7b4c('0x68')](_0x7b4c('0x69')+_0x3a3713+_0x7b4c('0x6a'));fs[_0x7b4c('0x6b')](_0x3a3713);}_0x3a3713=_0x3a3713+'.cypher';if(!_[_0x7b4c('0x67')](_0x11ae6e[_0x7b4c('0x53')])&&fs['existsSync'](_0x3a3713)){logger[_0x7b4c('0x68')](_0x7b4c('0x69')+_0x3a3713+_0x7b4c('0x6a'));fs[_0x7b4c('0x6b')](_0x3a3713);}return _0x11ae6e;})[_0x7b4c('0x29')](function(_0x2befd7){if(!_0x2befd7)throw new InternalError();return _0x2befd7[_0x7b4c('0x2a')]();})[_0x7b4c('0x29')](function(){_0x3b2144['status'](0xcc)[_0x7b4c('0x1d')]();})[_0x7b4c('0x49')](handleError(_0x3b2144,null));}; \ No newline at end of file +var _0xee14=['path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','ScreenRecording','includeAll','include','findAll','rows','catch','params','find','create','body','duration','describe','../../components/encryptor','uniqueid','value','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','root','Sequelize','ValidationError','filename','download','unlink','ScreenRecording\x20not\x20found','isNil','Entity\x20not\x20found','join','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x2fbe75,_0x1490f3){var _0x3d74b2=function(_0x2623b3){while(--_0x2623b3){_0x2fbe75['push'](_0x2fbe75['shift']());}};_0x3d74b2(++_0x1490f3);}(_0xee14,0x13a));var _0x4ee1=function(_0x303f08,_0xcd04bc){_0x303f08=_0x303f08-0x0;var _0x1cab0c=_0xee14[_0x303f08];return _0x1cab0c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4ee1('0x0'));var jsonpatch=require(_0x4ee1('0x1'));var rp=require(_0x4ee1('0x2'));var moment=require(_0x4ee1('0x3'));var BPromise=require(_0x4ee1('0x4'));var Mustache=require(_0x4ee1('0x5'));var util=require(_0x4ee1('0x6'));var path=require(_0x4ee1('0x7'));var sox=require(_0x4ee1('0x8'));var csv=require('to-csv');var ejs=require(_0x4ee1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ee1('0xa'));var squel=require(_0x4ee1('0xb'));var crypto=require(_0x4ee1('0xc'));var jsforce=require(_0x4ee1('0xd'));var deskjs=require(_0x4ee1('0xe'));var toCsv=require(_0x4ee1('0xf'));var querystring=require('querystring');var Papa=require(_0x4ee1('0x10'));var Redis=require(_0x4ee1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4ee1('0x12'));var as=require(_0x4ee1('0x13'));var hardwareService=require(_0x4ee1('0x14'));var logger=require(_0x4ee1('0x15'))('api');var utils=require(_0x4ee1('0x16'));var config=require(_0x4ee1('0x17'));var licenseUtil=require(_0x4ee1('0x18'));var db=require(_0x4ee1('0x19'))['db'];function respondWithStatusCode(_0x2f864e,_0x174427){_0x174427=_0x174427||0xcc;return function(_0x5616d6){if(_0x5616d6){return _0x2f864e[_0x4ee1('0x1a')](_0x174427);}return _0x2f864e[_0x4ee1('0x1b')](_0x174427)[_0x4ee1('0x1c')]();};}function respondWithResult(_0x24a915,_0x46d2c2){_0x46d2c2=_0x46d2c2||0xc8;return function(_0x1c342a){if(_0x1c342a){return _0x24a915[_0x4ee1('0x1b')](_0x46d2c2)[_0x4ee1('0x1d')](_0x1c342a);}};}function respondWithFilteredResult(_0xb7eafd,_0x4e3490){return function(_0x2f9194){if(_0x2f9194){var _0x38008f=typeof _0x4e3490[_0x4ee1('0x1e')]===_0x4ee1('0x1f')&&typeof _0x4e3490[_0x4ee1('0x20')]===_0x4ee1('0x1f');var _0x2eff91=_0x2f9194[_0x4ee1('0x21')];var _0x360056=_0x38008f?0x0:_0x4e3490[_0x4ee1('0x1e')];var _0x274de5=_0x38008f?_0x2f9194['count']:_0x4e3490[_0x4ee1('0x1e')]+_0x4e3490[_0x4ee1('0x20')];var _0x173388;if(_0x274de5>=_0x2eff91){_0x274de5=_0x2eff91;_0x173388=0xc8;}else{_0x173388=0xce;}_0xb7eafd[_0x4ee1('0x1b')](_0x173388);return _0xb7eafd[_0x4ee1('0x22')](_0x4ee1('0x23'),_0x360056+'-'+_0x274de5+'/'+_0x2eff91)['json'](_0x2f9194);}return null;};}function patchUpdates(_0x8a631f){return function(_0x333e96){try{jsonpatch[_0x4ee1('0x24')](_0x333e96,_0x8a631f,!![]);}catch(_0x3f0d59){return BPromise[_0x4ee1('0x25')](_0x3f0d59);}return _0x333e96[_0x4ee1('0x26')]();};}function saveUpdates(_0x328f21,_0x40fd98){return function(_0x1dc1a8){if(_0x1dc1a8){return _0x1dc1a8[_0x4ee1('0x27')](_0x328f21)['then'](function(_0x53d43f){return _0x53d43f;});}return null;};}function removeEntity(_0x14110c,_0x459e2e){return function(_0xaf87e7){if(_0xaf87e7){return _0xaf87e7[_0x4ee1('0x28')]()[_0x4ee1('0x29')](function(){_0x14110c[_0x4ee1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cc0b5,_0x442c71){return function(_0x28b7e1){if(!_0x28b7e1){_0x5cc0b5['sendStatus'](0x194);}return _0x28b7e1;};}function handleError(_0x35900d,_0x213db8){_0x213db8=_0x213db8||0x1f4;return function(_0x36654c){logger[_0x4ee1('0x2a')](_0x36654c[_0x4ee1('0x2b')]);if(_0x36654c[_0x4ee1('0x2c')]){delete _0x36654c[_0x4ee1('0x2c')];}_0x35900d['status'](_0x213db8)[_0x4ee1('0x2d')](_0x36654c);};}exports['index']=function(_0x4746c2,_0x4ec408){var _0x3dc870={},_0x1d91be={},_0x59a34e={'count':0x0,'rows':[]};var _0x13944c=_[_0x4ee1('0x2e')](db['ScreenRecording'][_0x4ee1('0x2f')],function(_0x5b3792){return{'name':_0x5b3792[_0x4ee1('0x30')],'type':_0x5b3792[_0x4ee1('0x31')][_0x4ee1('0x32')]};});_0x1d91be[_0x4ee1('0x33')]=_[_0x4ee1('0x34')](_['map'](_0x13944c,_0x4ee1('0x2c')),[_0x4ee1('0x35')]);_0x1d91be[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x4746c2[_0x4ee1('0x36')]);_0x1d91be[_0x4ee1('0x38')]=_['intersection'](_0x1d91be['model'],_0x1d91be[_0x4ee1('0x36')]);_0x3dc870[_0x4ee1('0x39')]=_[_0x4ee1('0x3a')](_0x1d91be['model'],qs[_0x4ee1('0x3b')](_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x3b')]));_0x3dc870[_0x4ee1('0x39')]=_0x3dc870[_0x4ee1('0x39')][_0x4ee1('0x3c')]?_0x3dc870[_0x4ee1('0x39')]:_0x1d91be[_0x4ee1('0x33')];if(!_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x3d')](_0x4ee1('0x3e'))){_0x3dc870[_0x4ee1('0x20')]=qs[_0x4ee1('0x20')](_0x4746c2['query'][_0x4ee1('0x20')]);_0x3dc870[_0x4ee1('0x1e')]=qs[_0x4ee1('0x1e')](_0x4746c2['query']['offset']);}_0x3dc870[_0x4ee1('0x3f')]=qs[_0x4ee1('0x40')](_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x40')]);_0x3dc870['where']=qs[_0x4ee1('0x38')](_[_0x4ee1('0x41')](_0x4746c2[_0x4ee1('0x36')],_0x1d91be[_0x4ee1('0x38')]),_0x13944c);if(_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x42')]){_0x3dc870[_0x4ee1('0x43')]=_[_0x4ee1('0x44')](_0x3dc870['where'],{'$or':_[_0x4ee1('0x2e')](_0x13944c,function(_0x1116b4){if(_0x1116b4[_0x4ee1('0x31')]!==_0x4ee1('0x45')){var _0x45bb22={};_0x45bb22[_0x1116b4[_0x4ee1('0x2c')]]={'$like':'%'+_0x4746c2['query'][_0x4ee1('0x42')]+'%'};return _0x45bb22;}})});}_0x3dc870=_[_0x4ee1('0x44')]({},_0x3dc870,_0x4746c2[_0x4ee1('0x46')]);var _0x333690={'where':_0x3dc870[_0x4ee1('0x43')]};return db[_0x4ee1('0x47')][_0x4ee1('0x21')](_0x333690)[_0x4ee1('0x29')](function(_0x23bb5f){_0x59a34e[_0x4ee1('0x21')]=_0x23bb5f;if(_0x4746c2[_0x4ee1('0x36')][_0x4ee1('0x48')]){_0x3dc870[_0x4ee1('0x49')]=[{'all':!![]}];}return db['ScreenRecording'][_0x4ee1('0x4a')](_0x3dc870);})[_0x4ee1('0x29')](function(_0x5ee7b4){_0x59a34e[_0x4ee1('0x4b')]=_0x5ee7b4;return _0x59a34e;})['then'](respondWithFilteredResult(_0x4ec408,_0x3dc870))[_0x4ee1('0x4c')](handleError(_0x4ec408,null));};exports['show']=function(_0x14c333,_0xc7580c){var _0x557126={'raw':![],'where':{'id':_0x14c333[_0x4ee1('0x4d')]['id']}},_0x25d683={};_0x25d683[_0x4ee1('0x33')]=_[_0x4ee1('0x37')](db['ScreenRecording'][_0x4ee1('0x2f')]);_0x25d683[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x14c333['query']);_0x25d683['filters']=_[_0x4ee1('0x3a')](_0x25d683[_0x4ee1('0x33')],_0x25d683[_0x4ee1('0x36')]);_0x557126[_0x4ee1('0x39')]=_[_0x4ee1('0x3a')](_0x25d683['model'],qs['fields'](_0x14c333[_0x4ee1('0x36')][_0x4ee1('0x3b')]));_0x557126[_0x4ee1('0x39')]=_0x557126[_0x4ee1('0x39')]['length']?_0x557126[_0x4ee1('0x39')]:_0x25d683[_0x4ee1('0x33')];if(_0x14c333['query'][_0x4ee1('0x48')]){_0x557126[_0x4ee1('0x49')]=[{'all':!![]}];}_0x557126=_[_0x4ee1('0x44')]({},_0x557126,_0x14c333[_0x4ee1('0x46')]);return db[_0x4ee1('0x47')][_0x4ee1('0x4e')](_0x557126)[_0x4ee1('0x29')](handleEntityNotFound(_0xc7580c,null))[_0x4ee1('0x29')](respondWithResult(_0xc7580c,null))[_0x4ee1('0x4c')](handleError(_0xc7580c,null));};exports['create']=function(_0x49b667,_0x1a972b){return db[_0x4ee1('0x47')][_0x4ee1('0x4f')](_0x49b667[_0x4ee1('0x50')],{})['then'](respondWithResult(_0x1a972b,0xc9))[_0x4ee1('0x4c')](handleError(_0x1a972b,null));};exports[_0x4ee1('0x27')]=function(_0x42dd8d,_0x2bc77f){if(_0x42dd8d[_0x4ee1('0x50')]['id']){delete _0x42dd8d['body']['id'];}delete _0x42dd8d[_0x4ee1('0x50')][_0x4ee1('0x51')];delete _0x42dd8d[_0x4ee1('0x50')]['createdAt'];delete _0x42dd8d[_0x4ee1('0x50')]['closedAt'];delete _0x42dd8d[_0x4ee1('0x50')]['value'];return db[_0x4ee1('0x47')]['find']({'where':{'id':_0x42dd8d[_0x4ee1('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2bc77f,null))[_0x4ee1('0x29')](saveUpdates(_0x42dd8d[_0x4ee1('0x50')],null))[_0x4ee1('0x29')](respondWithResult(_0x2bc77f,null))['catch'](handleError(_0x2bc77f,null));};exports[_0x4ee1('0x52')]=function(_0x4118d7,_0xcdb873){return db[_0x4ee1('0x47')][_0x4ee1('0x52')]()[_0x4ee1('0x29')](respondWithResult(_0xcdb873,null))[_0x4ee1('0x4c')](handleError(_0xcdb873,null));};exports['download']=function(_0x4c4178,_0x1feb78,_0xcddc5d){var _0xf58cd8=require(_0x4ee1('0x53'));var _0x44e65f=![];var _0x31e82d={};if(_0x4c4178[_0x4ee1('0x36')][_0x4ee1('0x31')]&&_0x4c4178[_0x4ee1('0x36')][_0x4ee1('0x31')]===_0x4ee1('0x54')){_0x31e82d[_0x4ee1('0x54')]=_0x4c4178[_0x4ee1('0x4d')]['id'];}else{_0x31e82d['id']=_0x4c4178['params']['id'];}return db[_0x4ee1('0x47')]['find']({'where':_0x31e82d,'attributes':['id',_0x4ee1('0x55')],'raw':!![]})[_0x4ee1('0x29')](handleEntityNotFound(_0x1feb78,null))['then'](function(_0x1e0aac){if(_0x1e0aac){var _0x184e36=path['join'](config['root'],_0x4ee1('0x56'),_0x1e0aac['value']);var _0x1ce99e=util[_0x4ee1('0x35')]('%s.cypher',_0x184e36);if(fs[_0x4ee1('0x57')](_0x1ce99e)){_0x44e65f=!![];return _0xf58cd8[_0x4ee1('0x58')](_0x1ce99e,_0x184e36,config[_0x4ee1('0x59')][_0x4ee1('0x5a')])[_0x4ee1('0x29')](function(){return _0x1e0aac;});}return _0x1e0aac;}})[_0x4ee1('0x29')](function(_0x11f619){if(_0x11f619){var _0x5f5694=path['join'](config[_0x4ee1('0x5b')],_0x4ee1('0x56'),_0x11f619['value']);if(!fs[_0x4ee1('0x57')](_0x5f5694)){throw new db[(_0x4ee1('0x5c'))][(_0x4ee1('0x5d'))]('ScreenRecording\x20not\x20found');}if(_0x11f619[_0x4ee1('0x5e')]){return _0x1feb78['download'](_0x5f5694,_0x11f619[_0x4ee1('0x5e')]+path['extname'](_0x5f5694),function(){if(_0x44e65f){fs['unlink'](_0x5f5694);}});}else{return _0x1feb78[_0x4ee1('0x5f')](_0x5f5694,function(_0x16fcd0){if(_0x44e65f){fs[_0x4ee1('0x60')](_0x5f5694);}});}}})[_0x4ee1('0x4c')](function(_0x38e889){if(_0x38e889['message']===_0x4ee1('0x61')){_0x1feb78[_0x4ee1('0x1b')](0x194)[_0x4ee1('0x2d')]('Not\x20found');}else{return handleError(_0x1feb78,null);}});};exports[_0x4ee1('0x28')]=function(_0x109dc6,_0x3fdd61){return db[_0x4ee1('0x47')][_0x4ee1('0x4e')]({'where':{'id':_0x109dc6[_0x4ee1('0x4d')]['id']}})[_0x4ee1('0x29')](function(_0x20ca0b){if(_[_0x4ee1('0x62')](_0x20ca0b)){throw new ReferenceError(_0x4ee1('0x63'));}return _0x20ca0b;})[_0x4ee1('0x29')](function(_0x38e86f){var _0x5d396c=path[_0x4ee1('0x64')](config['root'],_0x4ee1('0x56'),_0x38e86f['value']);logger[_0x4ee1('0x65')](_0x4ee1('0x66'),_0x5d396c);if(!_[_0x4ee1('0x62')](_0x38e86f[_0x4ee1('0x55')])&&fs[_0x4ee1('0x57')](_0x5d396c)){logger[_0x4ee1('0x65')](_0x4ee1('0x67')+_0x5d396c+_0x4ee1('0x68'));fs[_0x4ee1('0x69')](_0x5d396c);}_0x5d396c=_0x5d396c+_0x4ee1('0x6a');if(!_[_0x4ee1('0x62')](_0x38e86f[_0x4ee1('0x55')])&&fs['existsSync'](_0x5d396c)){logger[_0x4ee1('0x65')](_0x4ee1('0x67')+_0x5d396c+_0x4ee1('0x68'));fs['unlinkSync'](_0x5d396c);}return _0x38e86f;})['then'](function(_0x40dac3){if(!_0x40dac3)throw new InternalError();return _0x40dac3[_0x4ee1('0x28')]();})['then'](function(){_0x3fdd61[_0x4ee1('0x1b')](0xcc)[_0x4ee1('0x1c')]();})[_0x4ee1('0x4c')](handleError(_0x3fdd61,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 1dd554f..2d80ba0 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 _0x558a=['exports','define','ScreenRecording','screen_recordings','interactionid','lodash','util','api','moment','bluebird','path','rimraf','./screenRecording.attributes'];(function(_0x1ae3aa,_0x50e0b0){var _0x492fd8=function(_0x123371){while(--_0x123371){_0x1ae3aa['push'](_0x1ae3aa['shift']());}};_0x492fd8(++_0x50e0b0);}(_0x558a,0x14a));var _0xa558=function(_0x143475,_0x458e84){_0x143475=_0x143475-0x0;var _0x491066=_0x558a[_0x143475];return _0x491066;};'use strict';var _=require(_0xa558('0x0'));var util=require(_0xa558('0x1'));var logger=require('../../config/logger')(_0xa558('0x2'));var moment=require(_0xa558('0x3'));var BPromise=require(_0xa558('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa558('0x5'));var rimraf=require(_0xa558('0x6'));var config=require('../../config/environment');var attributes=require(_0xa558('0x7'));module[_0xa558('0x8')]=function(_0x147162,_0x219601){return _0x147162[_0xa558('0x9')](_0xa558('0xa'),attributes,{'tableName':_0xa558('0xb'),'paranoid':![],'indexes':[{'name':_0xa558('0xc'),'fields':[_0xa558('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x88fb=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./screenRecording.attributes','exports','ScreenRecording','screen_recordings','interactionid','lodash'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x88fb,0xdc));var _0xb88f=function(_0x1b986c,_0x304375){_0x1b986c=_0x1b986c-0x0;var _0x262cbc=_0x88fb[_0x1b986c];return _0x262cbc;};'use strict';var _=require(_0xb88f('0x0'));var util=require('util');var logger=require(_0xb88f('0x1'))(_0xb88f('0x2'));var moment=require(_0xb88f('0x3'));var BPromise=require(_0xb88f('0x4'));var rp=require(_0xb88f('0x5'));var fs=require('fs');var path=require(_0xb88f('0x6'));var rimraf=require('rimraf');var config=require(_0xb88f('0x7'));var attributes=require(_0xb88f('0x8'));module[_0xb88f('0x9')]=function(_0x20e661,_0x570979){return _0x20e661['define'](_0xb88f('0xa'),attributes,{'tableName':_0xb88f('0xb'),'paranoid':![],'indexes':[{'name':_0xb88f('0xc'),'fields':[_0xb88f('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index f713593..84dee6c 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 _0x161b=['catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ScreenRecording,\x20%s,\x20%s','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result'];(function(_0x450ea0,_0x3a0adf){var _0x338474=function(_0x470dbd){while(--_0x470dbd){_0x450ea0['push'](_0x450ea0['shift']());}};_0x338474(++_0x3a0adf);}(_0x161b,0x1b6));var _0xb161=function(_0x543c5f,_0x193f22){_0x543c5f=_0x543c5f-0x0;var _0xa5b4ad=_0x161b[_0x543c5f];return _0xa5b4ad;};'use strict';var _=require('lodash');var util=require(_0xb161('0x0'));var moment=require(_0xb161('0x1'));var BPromise=require(_0xb161('0x2'));var rs=require(_0xb161('0x3'));var fs=require('fs');var Redis=require(_0xb161('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb161('0x5'))(_0xb161('0x6'));var config=require('../../config/environment');var jayson=require(_0xb161('0x7'));var client=jayson[_0xb161('0x8')][_0xb161('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x40a84e,_0x2de40c,_0x4a8e7a){return new BPromise(function(_0x2d4400,_0x44c228){return client[_0xb161('0xa')](_0x40a84e,_0x4a8e7a)[_0xb161('0xb')](function(_0xc6d0df){logger[_0xb161('0xc')](_0xb161('0xd'),_0x2de40c,'request\x20sent');logger[_0xb161('0xe')](_0xb161('0xf'),_0x2de40c,'request\x20sent',JSON[_0xb161('0x10')](_0xc6d0df));if(_0xc6d0df['error']){if(_0xc6d0df[_0xb161('0x11')][_0xb161('0x12')]===0x1f4){logger['error'](_0xb161('0xd'),_0x2de40c,_0xc6d0df[_0xb161('0x11')][_0xb161('0x13')]);return _0x44c228(_0xc6d0df[_0xb161('0x11')][_0xb161('0x13')]);}logger['error'](_0xb161('0xd'),_0x2de40c,_0xc6d0df[_0xb161('0x11')][_0xb161('0x13')]);return _0x2d4400(_0xc6d0df[_0xb161('0x11')][_0xb161('0x13')]);}else{logger[_0xb161('0xc')](_0xb161('0xd'),_0x2de40c,_0xb161('0x14'));_0x2d4400(_0xc6d0df[_0xb161('0x15')][_0xb161('0x13')]);}})[_0xb161('0x16')](function(_0x10a01e){logger[_0xb161('0x11')](_0xb161('0xd'),_0x2de40c,_0x10a01e);_0x44c228(_0x10a01e);});});} \ No newline at end of file +var _0x69ca=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xd8de75,_0x2b1975){var _0x1fe673=function(_0x394f42){while(--_0x394f42){_0xd8de75['push'](_0xd8de75['shift']());}};_0x1fe673(++_0x2b1975);}(_0x69ca,0x170));var _0xa69c=function(_0x50f288,_0xfecd76){_0x50f288=_0x50f288-0x0;var _0x2a0755=_0x69ca[_0x50f288];return _0x2a0755;};'use strict';var _=require(_0xa69c('0x0'));var util=require(_0xa69c('0x1'));var moment=require(_0xa69c('0x2'));var BPromise=require(_0xa69c('0x3'));var rs=require(_0xa69c('0x4'));var fs=require('fs');var Redis=require(_0xa69c('0x5'));var db=require(_0xa69c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa69c('0x7'))(_0xa69c('0x8'));var config=require(_0xa69c('0x9'));var jayson=require(_0xa69c('0xa'));var client=jayson[_0xa69c('0xb')][_0xa69c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e7dc1,_0x42c21d,_0x4b44d4){return new BPromise(function(_0x542ac6,_0x2108bc){return client[_0xa69c('0xd')](_0x3e7dc1,_0x4b44d4)['then'](function(_0xd23e92){logger[_0xa69c('0xe')]('ScreenRecording,\x20%s,\x20%s',_0x42c21d,_0xa69c('0xf'));logger[_0xa69c('0x10')](_0xa69c('0x11'),_0x42c21d,'request\x20sent',JSON[_0xa69c('0x12')](_0xd23e92));if(_0xd23e92[_0xa69c('0x13')]){if(_0xd23e92['error'][_0xa69c('0x14')]===0x1f4){logger[_0xa69c('0x13')](_0xa69c('0x15'),_0x42c21d,_0xd23e92[_0xa69c('0x13')][_0xa69c('0x16')]);return _0x2108bc(_0xd23e92[_0xa69c('0x13')][_0xa69c('0x16')]);}logger[_0xa69c('0x13')](_0xa69c('0x15'),_0x42c21d,_0xd23e92['error'][_0xa69c('0x16')]);return _0x542ac6(_0xd23e92[_0xa69c('0x13')][_0xa69c('0x16')]);}else{logger['info'](_0xa69c('0x15'),_0x42c21d,_0xa69c('0xf'));_0x542ac6(_0xd23e92[_0xa69c('0x17')][_0xa69c('0x16')]);}})[_0xa69c('0x18')](function(_0x24b509){logger[_0xa69c('0x13')]('ScreenRecording,\x20%s,\x20%s',_0x42c21d,_0x24b509);_0x2108bc(_0x24b509);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index e72a7a3..4552aef 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 _0x0174=['favicon','addFavicon','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','%s%s','logo','extname','originalname','post','file','addLogo','root','server/files/images/logos/','format','single','addLogoLogin','preferred'];(function(_0x1ba594,_0x47bb7a){var _0x2eedfc=function(_0x520a52){while(--_0x520a52){_0x1ba594['push'](_0x1ba594['shift']());}};_0x2eedfc(++_0x47bb7a);}(_0x0174,0x105));var _0x4017=function(_0x2eb13e,_0x1434b3){_0x2eb13e=_0x2eb13e-0x0;var _0x3589ac=_0x0174[_0x2eb13e];return _0x3589ac;};'use strict';var multer=require(_0x4017('0x0'));var util=require(_0x4017('0x1'));var path=require(_0x4017('0x2'));var timeout=require(_0x4017('0x3'));var express=require(_0x4017('0x4'));var router=express[_0x4017('0x5')]();var fs_extra=require(_0x4017('0x6'));var auth=require(_0x4017('0x7'));var interaction=require(_0x4017('0x8'));var config=require(_0x4017('0x9'));var controller=require(_0x4017('0xa'));router[_0x4017('0xb')]('/',auth[_0x4017('0xc')](),controller[_0x4017('0xd')]);router[_0x4017('0xb')](_0x4017('0xe'),controller['getDate']);router[_0x4017('0xb')](_0x4017('0xf'),controller['show']);router['get']('/:id/logo',controller[_0x4017('0x10')]);router[_0x4017('0xb')](_0x4017('0x11'),controller[_0x4017('0x12')]);router['get'](_0x4017('0x13'),controller[_0x4017('0x14')]);router[_0x4017('0xb')](_0x4017('0x15'),controller[_0x4017('0x16')]);router[_0x4017('0xb')](_0x4017('0x17'),controller[_0x4017('0x18')]);var upload=multer({'storage':multer[_0x4017('0x19')]({'destination':function(_0x16dae1,_0x3a1a03,_0x196d7e){_0x196d7e(null,path[_0x4017('0x1a')](config['root'],'server/files/images/logos/'));},'filename':function(_0x27c0cd,_0x3ccdb8,_0x4854c5){_0x4854c5(null,util['format'](_0x4017('0x1b'),_0x4017('0x1c'),path[_0x4017('0x1d')](_0x3ccdb8[_0x4017('0x1e')])));}})});router[_0x4017('0x1f')]('/:id/logo',upload['single'](_0x4017('0x20')),controller[_0x4017('0x21')]);var upload=multer({'storage':multer[_0x4017('0x19')]({'destination':function(_0x1af9b5,_0x589733,_0x279bce){_0x279bce(null,path[_0x4017('0x1a')](config[_0x4017('0x22')],_0x4017('0x23')));},'filename':function(_0x23c88f,_0x240043,_0x2c6b26){_0x2c6b26(null,util[_0x4017('0x24')](_0x4017('0x1b'),'logologin',path[_0x4017('0x1d')](_0x240043[_0x4017('0x1e')])));}})});router[_0x4017('0x1f')]('/:id/logo_login',upload[_0x4017('0x25')](_0x4017('0x20')),controller[_0x4017('0x26')]);var upload=multer({'storage':multer[_0x4017('0x19')]({'destination':function(_0x4fd117,_0x4fc65b,_0x48c937){_0x48c937(null,path[_0x4017('0x1a')](config['root'],'server/files/images/logos/'));},'filename':function(_0x134f4f,_0x585c04,_0x3f6614){_0x3f6614(null,util['format'](_0x4017('0x1b'),_0x4017('0x27'),path[_0x4017('0x1d')](_0x585c04['originalname'])));}})});router[_0x4017('0x1f')](_0x4017('0x15'),upload[_0x4017('0x25')](_0x4017('0x20')),controller['addPreferred']);var upload=multer({'storage':multer[_0x4017('0x19')]({'destination':function(_0x42de8f,_0x42d2ed,_0x4d335b){_0x4d335b(null,path[_0x4017('0x1a')](config['root'],_0x4017('0x23')));},'filename':function(_0x4b6238,_0x89250f,_0x557513){_0x557513(null,util[_0x4017('0x24')]('%s%s',_0x4017('0x28'),path[_0x4017('0x1d')](_0x89250f[_0x4017('0x1e')])));}})});router['post']('/:id/favicon',upload['single'](_0x4017('0x20')),controller[_0x4017('0x29')]);router['put'](_0x4017('0xf'),auth[_0x4017('0xc')](),controller['update']);module[_0x4017('0x2a')]=router; \ No newline at end of file +var _0x406d=['/:id/gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','%s%s','extname','originalname','post','file','addLogo','format','logologin','/:id/logo_login','addLogoLogin','preferred','addPreferred','favicon','single','/:id','update','multer','util','path','Router','fs-extra','../../components/auth/service','./setting.controller','isAuthenticated','index','get','/now','show','/:id/logo','getLogo','getLogoLogin'];(function(_0x4901c6,_0x3de057){var _0x4af485=function(_0x2efeea){while(--_0x2efeea){_0x4901c6['push'](_0x4901c6['shift']());}};_0x4af485(++_0x3de057);}(_0x406d,0x1d1));var _0xd406=function(_0x10faf1,_0x4641bb){_0x10faf1=_0x10faf1-0x0;var _0x33e27e=_0x406d[_0x10faf1];return _0x33e27e;};'use strict';var multer=require(_0xd406('0x0'));var util=require(_0xd406('0x1'));var path=require(_0xd406('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd406('0x3')]();var fs_extra=require(_0xd406('0x4'));var auth=require(_0xd406('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd406('0x6'));router['get']('/',auth[_0xd406('0x7')](),controller[_0xd406('0x8')]);router[_0xd406('0x9')](_0xd406('0xa'),controller['getDate']);router[_0xd406('0x9')]('/:id',controller[_0xd406('0xb')]);router['get'](_0xd406('0xc'),controller[_0xd406('0xd')]);router[_0xd406('0x9')]('/:id/logo_login',controller[_0xd406('0xe')]);router[_0xd406('0x9')](_0xd406('0xf'),controller['gdpr']);router[_0xd406('0x9')](_0xd406('0x10'),controller[_0xd406('0x11')]);router[_0xd406('0x9')](_0xd406('0x12'),controller[_0xd406('0x13')]);var upload=multer({'storage':multer[_0xd406('0x14')]({'destination':function(_0x5ab1ac,_0x58bac0,_0xe9d0a8){_0xe9d0a8(null,path[_0xd406('0x15')](config[_0xd406('0x16')],_0xd406('0x17')));},'filename':function(_0x46f850,_0x35bab4,_0x12386e){_0x12386e(null,util['format'](_0xd406('0x18'),'logo',path[_0xd406('0x19')](_0x35bab4[_0xd406('0x1a')])));}})});router[_0xd406('0x1b')](_0xd406('0xc'),upload['single'](_0xd406('0x1c')),controller[_0xd406('0x1d')]);var upload=multer({'storage':multer[_0xd406('0x14')]({'destination':function(_0x5844da,_0x5bd0e2,_0x15fef5){_0x15fef5(null,path['join'](config[_0xd406('0x16')],_0xd406('0x17')));},'filename':function(_0x53d84e,_0x1885c7,_0x40922f){_0x40922f(null,util[_0xd406('0x1e')](_0xd406('0x18'),_0xd406('0x1f'),path['extname'](_0x1885c7[_0xd406('0x1a')])));}})});router['post'](_0xd406('0x20'),upload['single'](_0xd406('0x1c')),controller[_0xd406('0x21')]);var upload=multer({'storage':multer[_0xd406('0x14')]({'destination':function(_0x55a9e8,_0x3a59bf,_0x560a27){_0x560a27(null,path[_0xd406('0x15')](config[_0xd406('0x16')],_0xd406('0x17')));},'filename':function(_0x386159,_0x1fe82b,_0x36cbe9){_0x36cbe9(null,util[_0xd406('0x1e')]('%s%s',_0xd406('0x22'),path['extname'](_0x1fe82b[_0xd406('0x1a')])));}})});router[_0xd406('0x1b')](_0xd406('0x10'),upload['single'](_0xd406('0x1c')),controller[_0xd406('0x23')]);var upload=multer({'storage':multer[_0xd406('0x14')]({'destination':function(_0x25c1bb,_0x7e0d28,_0x109955){_0x109955(null,path['join'](config[_0xd406('0x16')],_0xd406('0x17')));},'filename':function(_0xc7adfe,_0x3fad3f,_0x446def){_0x446def(null,util[_0xd406('0x1e')]('%s%s',_0xd406('0x24'),path[_0xd406('0x19')](_0x3fad3f[_0xd406('0x1a')])));}})});router[_0xd406('0x1b')]('/:id/favicon',upload[_0xd406('0x25')](_0xd406('0x1c')),controller['addFavicon']);router['put'](_0xd406('0x26'),auth[_0xd406('0x7')](),controller[_0xd406('0x27')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index b77f438..d5810e3 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 _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x4d10fa,_0x178053){var _0x1b04bc=function(_0x2c2653){while(--_0x2c2653){_0x4d10fa['push'](_0x4d10fa['shift']());}};_0x1b04bc(++_0x178053);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file +var _0xa9e0=['BOOLEAN','alternate','UNSIGNED','sequelize','exports','INTEGER','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted'];(function(_0x334f11,_0x43d43b){var _0x344c9a=function(_0x4c517c){while(--_0x4c517c){_0x334f11['push'](_0x334f11['shift']());}};_0x344c9a(++_0x43d43b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'min_internal':{'type':Sequelize[_0x0a9e('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x0a9e('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x5')},'logo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLogo':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x0a9e('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x0a9e('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0x0a9e('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x0a9e('0x4')]},'defaultPageTitle':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x0a9e('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x0a9e('0x4')],'defaultValue':_0x0a9e('0x7')},'chatTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x0a9e('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x0a9e('0x4')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize['INTEGER']},'transcribeRegion':{'type':Sequelize[_0x0a9e('0x4')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x0a9e('0x2')]},'sentimentRegion':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x0a9e('0x4')]},'bucket':{'type':Sequelize[_0x0a9e('0x4')]},'googleSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x0a9e('0x2')](0x2)[_0x0a9e('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x0a9e('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':![]},'secureCookieEnabled':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'viewHelpSection':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':!![]},'previewRecallmeReminderInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x5,'validate':{'min':0x1}},'disabledCookie':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'limitTabs':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x14}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 93cecb5..3f49b00 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 _0x8039=['undefined','limit','count','status','set','json','apply','reject','save','update','destroy','stack','send','index','map','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','offset','sort','where','pick','filter','type','merge','Setting','include','findAll','rows','show','params','keys','length','includeAll','body','find','addLogo','file','filename','addLogoLogin','loginLogo','../../config/license/util','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','download','getLogoLogin','default_loginLogo.svg','\x20not\x20found','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','error','Setting,\x20%s,\x20%s','message','catch','sendStatus','end'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x8039,0x14a));var _0x9803=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x8039[_0x403c20];return _0x2b271a;};'use strict';var emlformat=require(_0x9803('0x0'));var rimraf=require(_0x9803('0x1'));var zipdir=require(_0x9803('0x2'));var jsonpatch=require(_0x9803('0x3'));var rp=require(_0x9803('0x4'));var moment=require(_0x9803('0x5'));var BPromise=require(_0x9803('0x6'));var Mustache=require(_0x9803('0x7'));var util=require(_0x9803('0x8'));var path=require(_0x9803('0x9'));var sox=require('sox');var csv=require(_0x9803('0xa'));var ejs=require(_0x9803('0xb'));var fs=require('fs');var fs_extra=require(_0x9803('0xc'));var _=require(_0x9803('0xd'));var squel=require(_0x9803('0xe'));var crypto=require(_0x9803('0xf'));var jsforce=require(_0x9803('0x10'));var deskjs=require(_0x9803('0x11'));var toCsv=require(_0x9803('0xa'));var querystring=require(_0x9803('0x12'));var Papa=require(_0x9803('0x13'));var Redis=require(_0x9803('0x14'));var authService=require(_0x9803('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x9803('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9803('0x17'));var utils=require(_0x9803('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x9803('0x19'))['db'];var jayson=require(_0x9803('0x1a'));var client=jayson[_0x9803('0x1b')][_0x9803('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x40168b,_0x4b0418,_0x46511b,_0x1e1519){return new BPromise(function(_0x341c9f,_0x4e9c6d){var _0x37066e=_0x1e1519||client;return _0x37066e[_0x9803('0x1d')](_0x40168b,_0x46511b)[_0x9803('0x1e')](function(_0x12830a){logger[_0x9803('0x1f')]('Setting,\x20%s,\x20%s',_0x4b0418,_0x9803('0x20'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x4b0418,_0x9803('0x20'),JSON['stringify'](_0x12830a));if(_0x12830a[_0x9803('0x21')]){if(_0x12830a['error']['code']===0x1f4){logger[_0x9803('0x21')](_0x9803('0x22'),_0x4b0418,_0x12830a[_0x9803('0x21')][_0x9803('0x23')]);return _0x4e9c6d(_0x12830a['error'][_0x9803('0x23')]);}logger[_0x9803('0x21')](_0x9803('0x22'),_0x4b0418,_0x12830a[_0x9803('0x21')][_0x9803('0x23')]);return _0x341c9f(_0x12830a[_0x9803('0x21')][_0x9803('0x23')]);}else{logger[_0x9803('0x1f')](_0x9803('0x22'),_0x4b0418,_0x9803('0x20'));_0x341c9f(_0x12830a['result'][_0x9803('0x23')]);}})[_0x9803('0x24')](function(_0x5ef5c2){logger[_0x9803('0x21')](_0x9803('0x22'),_0x4b0418,_0x5ef5c2);_0x4e9c6d(_0x5ef5c2);});});}function respondWithStatusCode(_0xa3b6c5,_0x1798d2){_0x1798d2=_0x1798d2||0xcc;return function(_0x42566f){if(_0x42566f){return _0xa3b6c5[_0x9803('0x25')](_0x1798d2);}return _0xa3b6c5['status'](_0x1798d2)[_0x9803('0x26')]();};}function respondWithResult(_0x415c91,_0x4e9d34){_0x4e9d34=_0x4e9d34||0xc8;return function(_0x695cf){if(_0x695cf){return _0x415c91['status'](_0x4e9d34)['json'](_0x695cf);}};}function respondWithFilteredResult(_0x348719,_0x4044e4){return function(_0x3f3c47){if(_0x3f3c47){var _0x36cf92=typeof _0x4044e4['offset']===_0x9803('0x27')&&typeof _0x4044e4[_0x9803('0x28')]===_0x9803('0x27');var _0x39ecb1=_0x3f3c47[_0x9803('0x29')];var _0x3b729f=_0x36cf92?0x0:_0x4044e4['offset'];var _0x18d1bf=_0x36cf92?_0x3f3c47[_0x9803('0x29')]:_0x4044e4['offset']+_0x4044e4[_0x9803('0x28')];var _0x302813;if(_0x18d1bf>=_0x39ecb1){_0x18d1bf=_0x39ecb1;_0x302813=0xc8;}else{_0x302813=0xce;}_0x348719[_0x9803('0x2a')](_0x302813);return _0x348719[_0x9803('0x2b')]('Content-Range',_0x3b729f+'-'+_0x18d1bf+'/'+_0x39ecb1)[_0x9803('0x2c')](_0x3f3c47);}return null;};}function patchUpdates(_0x36c38e){return function(_0x42f004){try{jsonpatch[_0x9803('0x2d')](_0x42f004,_0x36c38e,!![]);}catch(_0x54d2df){return BPromise[_0x9803('0x2e')](_0x54d2df);}return _0x42f004[_0x9803('0x2f')]();};}function saveUpdates(_0x1d687a,_0x17f162){return function(_0x2c0d9e){if(_0x2c0d9e){return _0x2c0d9e[_0x9803('0x30')](_0x1d687a)[_0x9803('0x1e')](function(_0x30b605){return _0x30b605;});}return null;};}function removeEntity(_0x197ad4,_0x22b04a){return function(_0x4678d5){if(_0x4678d5){return _0x4678d5[_0x9803('0x31')]()[_0x9803('0x1e')](function(){_0x197ad4[_0x9803('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5687db,_0x13f1ae){return function(_0x211b9d){if(!_0x211b9d){_0x5687db[_0x9803('0x25')](0x194);}return _0x211b9d;};}function handleError(_0x271f02,_0xfe5db8){_0xfe5db8=_0xfe5db8||0x1f4;return function(_0x27d7f6){logger['error'](_0x27d7f6[_0x9803('0x32')]);if(_0x27d7f6['name']){delete _0x27d7f6['name'];}_0x271f02[_0x9803('0x2a')](_0xfe5db8)[_0x9803('0x33')](_0x27d7f6);};}exports[_0x9803('0x34')]=function(_0x375109,_0xa17f4b){var _0x3c14e4={},_0x333dcb={},_0x4b78c9={'count':0x0,'rows':[]};var _0xb617d0=_[_0x9803('0x35')](db['Setting'][_0x9803('0x36')],function(_0x486a87){return{'name':_0x486a87[_0x9803('0x37')],'type':_0x486a87['type'][_0x9803('0x38')]};});_0x333dcb[_0x9803('0x39')]=_[_0x9803('0x35')](_0xb617d0,_0x9803('0x3a'));_0x333dcb[_0x9803('0x3b')]=_['keys'](_0x375109[_0x9803('0x3b')]);_0x333dcb[_0x9803('0x3c')]=_[_0x9803('0x3d')](_0x333dcb['model'],_0x333dcb[_0x9803('0x3b')]);_0x3c14e4[_0x9803('0x3e')]=_['intersection'](_0x333dcb[_0x9803('0x39')],qs[_0x9803('0x3f')](_0x375109[_0x9803('0x3b')][_0x9803('0x3f')]));_0x3c14e4[_0x9803('0x3e')]=_0x3c14e4[_0x9803('0x3e')]['length']?_0x3c14e4[_0x9803('0x3e')]:_0x333dcb[_0x9803('0x39')];if(!_0x375109[_0x9803('0x3b')][_0x9803('0x40')]('nolimit')){_0x3c14e4[_0x9803('0x28')]=qs[_0x9803('0x28')](_0x375109[_0x9803('0x3b')][_0x9803('0x28')]);_0x3c14e4[_0x9803('0x41')]=qs['offset'](_0x375109['query'][_0x9803('0x41')]);}_0x3c14e4['order']=qs['sort'](_0x375109['query'][_0x9803('0x42')]);_0x3c14e4[_0x9803('0x43')]=qs[_0x9803('0x3c')](_[_0x9803('0x44')](_0x375109[_0x9803('0x3b')],_0x333dcb[_0x9803('0x3c')]),_0xb617d0);if(_0x375109[_0x9803('0x3b')][_0x9803('0x45')]){_0x3c14e4[_0x9803('0x43')]=_['merge'](_0x3c14e4[_0x9803('0x43')],{'$or':_['map'](_0xb617d0,function(_0xe00855){if(_0xe00855[_0x9803('0x46')]!=='VIRTUAL'){var _0x38a5a4={};_0x38a5a4[_0xe00855['name']]={'$like':'%'+_0x375109[_0x9803('0x3b')][_0x9803('0x45')]+'%'};return _0x38a5a4;}})});}_0x3c14e4=_[_0x9803('0x47')]({},_0x3c14e4,_0x375109['options']);var _0x5592bd={'where':_0x3c14e4[_0x9803('0x43')]};return db[_0x9803('0x48')]['count'](_0x5592bd)[_0x9803('0x1e')](function(_0x4cc20b){_0x4b78c9[_0x9803('0x29')]=_0x4cc20b;if(_0x375109[_0x9803('0x3b')]['includeAll']){_0x3c14e4[_0x9803('0x49')]=[{'all':!![]}];}return db['Setting'][_0x9803('0x4a')](_0x3c14e4);})[_0x9803('0x1e')](function(_0x577755){_0x4b78c9[_0x9803('0x4b')]=_0x577755;return _0x4b78c9;})['then'](respondWithFilteredResult(_0xa17f4b,_0x3c14e4))[_0x9803('0x24')](handleError(_0xa17f4b,null));};exports[_0x9803('0x4c')]=function(_0x44a46a,_0x3fd64f){var _0x452e05={'raw':![],'where':{'id':_0x44a46a[_0x9803('0x4d')]['id']}},_0x326569={};_0x326569[_0x9803('0x39')]=_[_0x9803('0x4e')](db[_0x9803('0x48')][_0x9803('0x36')]);_0x326569['query']=_[_0x9803('0x4e')](_0x44a46a[_0x9803('0x3b')]);_0x326569[_0x9803('0x3c')]=_[_0x9803('0x3d')](_0x326569['model'],_0x326569[_0x9803('0x3b')]);_0x452e05[_0x9803('0x3e')]=_[_0x9803('0x3d')](_0x326569[_0x9803('0x39')],qs['fields'](_0x44a46a[_0x9803('0x3b')][_0x9803('0x3f')]));_0x452e05[_0x9803('0x3e')]=_0x452e05['attributes'][_0x9803('0x4f')]?_0x452e05[_0x9803('0x3e')]:_0x326569[_0x9803('0x39')];if(_0x44a46a[_0x9803('0x3b')][_0x9803('0x50')]){_0x452e05[_0x9803('0x49')]=[{'all':!![]}];}_0x452e05=_[_0x9803('0x47')]({},_0x452e05,_0x44a46a['options']);return db[_0x9803('0x48')]['find'](_0x452e05)['then'](handleEntityNotFound(_0x3fd64f,null))['then'](respondWithResult(_0x3fd64f,null))[_0x9803('0x24')](handleError(_0x3fd64f,null));};exports['update']=function(_0x2c929c,_0x36caf1){if(_0x2c929c[_0x9803('0x51')]['id']){delete _0x2c929c['body']['id'];}return db[_0x9803('0x48')][_0x9803('0x52')]({'where':{'id':_0x2c929c[_0x9803('0x4d')]['id']}})['then'](handleEntityNotFound(_0x36caf1,null))[_0x9803('0x1e')](saveUpdates(_0x2c929c['body'],null))[_0x9803('0x1e')](respondWithResult(_0x36caf1,null))[_0x9803('0x24')](handleError(_0x36caf1,null));};exports[_0x9803('0x53')]=function(_0x1518de,_0x4703e7,_0x4c510d){if(_0x1518de[_0x9803('0x54')]&&_0x1518de[_0x9803('0x54')]['filename']){_0x1518de['body']['logo']=_0x1518de['file'][_0x9803('0x55')];}return db[_0x9803('0x48')][_0x9803('0x52')]({'where':{'id':_0x1518de[_0x9803('0x4d')]['id']}})[_0x9803('0x1e')](handleEntityNotFound(_0x4703e7,null))[_0x9803('0x1e')](saveUpdates(_0x1518de[_0x9803('0x51')],null))[_0x9803('0x1e')](respondWithResult(_0x4703e7,null))[_0x9803('0x24')](handleError(_0x4703e7,null));};exports[_0x9803('0x56')]=function(_0x33ef53,_0x5bb7d5,_0x58838e){if(_0x33ef53[_0x9803('0x54')]&&_0x33ef53[_0x9803('0x54')][_0x9803('0x55')]){_0x33ef53['body'][_0x9803('0x57')]=_0x33ef53['file'][_0x9803('0x55')];}return db[_0x9803('0x48')][_0x9803('0x52')]({'where':{'id':_0x33ef53[_0x9803('0x4d')]['id']}})[_0x9803('0x1e')](handleEntityNotFound(_0x5bb7d5,null))[_0x9803('0x1e')](saveUpdates(_0x33ef53[_0x9803('0x51')],null))['then'](respondWithResult(_0x5bb7d5,null))[_0x9803('0x24')](handleError(_0x5bb7d5,null));};var utilLicense=require(_0x9803('0x58'));exports['getLogo']=function(_0x51bfd4,_0x281aa7,_0x5b2a48){var _0x3da3c3=_0x9803('0x59');var _0x26b04f={'custom':![]};return utilLicense[_0x9803('0x5a')]()['then'](function(_0x3a4d5e){if(_0x3a4d5e){_0x26b04f=_0x3a4d5e;}return db[_0x9803('0x48')][_0x9803('0x52')]({'where':{'id':_0x51bfd4[_0x9803('0x4d')]['id']},'attributes':[_0x9803('0x5b'),_0x9803('0x57'),_0x9803('0x5c'),_0x9803('0x5d'),_0x9803('0x5e'),_0x9803('0x5f'),_0x9803('0x60'),_0x9803('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x281aa7,null))[_0x9803('0x1e')](function(_0x33b421){if(_0x33b421){var _0x30bd60=_0x33b421[_0x9803('0x5b')]&&fs[_0x9803('0x62')](path[_0x9803('0x63')](config[_0x9803('0x64')],_0x3da3c3,_[_0x9803('0x65')](_0x33b421[_0x9803('0x5b')])))?path[_0x9803('0x63')](config['root'],_0x3da3c3,_[_0x9803('0x65')](_0x33b421[_0x9803('0x5b')])):path['join'](config[_0x9803('0x64')],_0x3da3c3,_[_0x9803('0x65')](_0x9803('0x66')));var _0x2325d8=_0x9803('0x67')+_[_0x9803('0x68')](_0x9803('0x5b'));if(_0x33b421[_0x2325d8]||!_0x26b04f[_0x9803('0x69')]){_0x30bd60=path[_0x9803('0x63')](config['root'],_0x3da3c3,_[_0x9803('0x65')]('default_logo.svg'));}if(!fs[_0x9803('0x62')](_0x30bd60)){throw new db[(_0x9803('0x6a'))][(_0x9803('0x6b'))](_['upperFirst']('logo')+'\x20not\x20found');}return _0x281aa7[_0x9803('0x6c')](_0x30bd60);}})[_0x9803('0x24')](handleError(_0x281aa7,null));};var utilLicense=require(_0x9803('0x58'));exports[_0x9803('0x6d')]=function(_0x2b04c8,_0x567479,_0x468426){var _0x5beade='server/files/images/logos';var _0x1d7f63={'custom':![]};return utilLicense[_0x9803('0x5a')]()['then'](function(_0x446330){if(_0x446330){_0x1d7f63=_0x446330;}return db['Setting']['find']({'where':{'id':_0x2b04c8['params']['id']},'attributes':[_0x9803('0x5b'),_0x9803('0x57'),_0x9803('0x5c'),_0x9803('0x5d'),_0x9803('0x5e'),_0x9803('0x5f'),'defaultPreferred',_0x9803('0x61')],'raw':!![]});})[_0x9803('0x1e')](handleEntityNotFound(_0x567479,null))[_0x9803('0x1e')](function(_0x10415b){if(_0x10415b){var _0x1cd67a=_0x10415b[_0x9803('0x57')]&&fs[_0x9803('0x62')](path[_0x9803('0x63')](config[_0x9803('0x64')],_0x5beade,_['toLower'](_0x10415b[_0x9803('0x57')])))?path[_0x9803('0x63')](config[_0x9803('0x64')],_0x5beade,_[_0x9803('0x65')](_0x10415b[_0x9803('0x57')])):path['join'](config[_0x9803('0x64')],_0x5beade,_[_0x9803('0x65')]('default_loginLogo.svg'));var _0x95b4a2=_0x9803('0x67')+_[_0x9803('0x68')](_0x9803('0x57'));if(_0x10415b[_0x95b4a2]||!_0x1d7f63[_0x9803('0x69')]){_0x1cd67a=path[_0x9803('0x63')](config[_0x9803('0x64')],_0x5beade,_[_0x9803('0x65')](_0x9803('0x6e')));}if(!fs[_0x9803('0x62')](_0x1cd67a)){throw new db[(_0x9803('0x6a'))]['ValidationError'](_[_0x9803('0x68')]('loginLogo')+_0x9803('0x6f'));}return _0x567479[_0x9803('0x6c')](_0x1cd67a);}})[_0x9803('0x24')](handleError(_0x567479,null));};exports['gdpr']=function(_0x55b0fc,_0x19cc72){return db['Setting'][_0x9803('0x52')]({'where':{'id':_0x55b0fc[_0x9803('0x4d')]['id']},'attributes':[_0x9803('0x70')]})[_0x9803('0x1e')](respondWithResult(_0x19cc72,null))[_0x9803('0x24')](handleError(_0x19cc72,null));};exports[_0x9803('0x71')]=function(_0x4ae674,_0x340750,_0x5ba9d2){if(_0x4ae674['file']&&_0x4ae674[_0x9803('0x54')][_0x9803('0x55')]){_0x4ae674[_0x9803('0x51')][_0x9803('0x5c')]=_0x4ae674[_0x9803('0x54')][_0x9803('0x55')];}return db[_0x9803('0x48')][_0x9803('0x52')]({'where':{'id':_0x4ae674[_0x9803('0x4d')]['id']}})[_0x9803('0x1e')](handleEntityNotFound(_0x340750,null))['then'](saveUpdates(_0x4ae674['body'],null))[_0x9803('0x1e')](respondWithResult(_0x340750,null))['catch'](handleError(_0x340750,null));};var utilLicense=require(_0x9803('0x58'));exports[_0x9803('0x72')]=function(_0x1d96d8,_0x2849c6,_0x3238ff){var _0x29831e=_0x9803('0x59');var _0x16f0ed={'custom':![]};return utilLicense[_0x9803('0x5a')]()['then'](function(_0x5ed6ca){if(_0x5ed6ca){_0x16f0ed=_0x5ed6ca;}return db[_0x9803('0x48')]['find']({'where':{'id':_0x1d96d8['params']['id']},'attributes':[_0x9803('0x5b'),_0x9803('0x57'),_0x9803('0x5c'),_0x9803('0x5d'),_0x9803('0x5e'),'defaultLoginLogo',_0x9803('0x60'),_0x9803('0x61')],'raw':!![]});})[_0x9803('0x1e')](handleEntityNotFound(_0x2849c6,null))[_0x9803('0x1e')](function(_0x259282){if(_0x259282){var _0x50b81f=_0x259282[_0x9803('0x5c')]&&fs[_0x9803('0x62')](path[_0x9803('0x63')](config[_0x9803('0x64')],_0x29831e,_[_0x9803('0x65')](_0x259282[_0x9803('0x5c')])))?path[_0x9803('0x63')](config['root'],_0x29831e,_[_0x9803('0x65')](_0x259282[_0x9803('0x5c')])):path[_0x9803('0x63')](config[_0x9803('0x64')],_0x29831e,_['toLower'](_0x9803('0x73')));var _0x8d42da=_0x9803('0x67')+_['upperFirst'](_0x9803('0x5c'));if(_0x259282[_0x8d42da]||!_0x16f0ed['custom']||!_0x16f0ed[_0x9803('0x5c')]){_0x50b81f=path[_0x9803('0x63')](config['root'],_0x29831e,_[_0x9803('0x65')](_0x9803('0x73')));}if(!fs[_0x9803('0x62')](_0x50b81f)){throw new db['Sequelize'][(_0x9803('0x6b'))](_['upperFirst']('preferred')+_0x9803('0x6f'));}return _0x2849c6[_0x9803('0x6c')](_0x50b81f);}})[_0x9803('0x24')](handleError(_0x2849c6,null));};exports[_0x9803('0x74')]=function(_0x4e56b9,_0x211e51,_0x3979b6){if(_0x4e56b9[_0x9803('0x54')]&&_0x4e56b9['file'][_0x9803('0x55')]){_0x4e56b9['body'][_0x9803('0x5d')]=_0x4e56b9[_0x9803('0x54')][_0x9803('0x55')];}return db['Setting'][_0x9803('0x52')]({'where':{'id':_0x4e56b9[_0x9803('0x4d')]['id']}})['then'](handleEntityNotFound(_0x211e51,null))[_0x9803('0x1e')](saveUpdates(_0x4e56b9[_0x9803('0x51')],null))[_0x9803('0x1e')](respondWithResult(_0x211e51,null))['catch'](handleError(_0x211e51,null));};var utilLicense=require(_0x9803('0x58'));exports[_0x9803('0x75')]=function(_0x17fd4e,_0x2bd09c,_0x45f923){var _0x4e1f24=_0x9803('0x59');var _0x398995={'custom':![]};return utilLicense[_0x9803('0x5a')]()[_0x9803('0x1e')](function(_0x253863){if(_0x253863){_0x398995=_0x253863;}return db[_0x9803('0x48')][_0x9803('0x52')]({'where':{'id':_0x17fd4e[_0x9803('0x4d')]['id']},'attributes':[_0x9803('0x5b'),_0x9803('0x57'),_0x9803('0x5c'),'favicon',_0x9803('0x5e'),_0x9803('0x5f'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x9803('0x1e')](handleEntityNotFound(_0x2bd09c,null))[_0x9803('0x1e')](function(_0x490387){if(_0x490387){var _0x11c471=_0x490387['favicon']&&fs['existsSync'](path[_0x9803('0x63')](config['root'],_0x4e1f24,_['toLower'](_0x490387[_0x9803('0x5d')])))?path[_0x9803('0x63')](config[_0x9803('0x64')],_0x4e1f24,_[_0x9803('0x65')](_0x490387[_0x9803('0x5d')])):path[_0x9803('0x63')](config[_0x9803('0x64')],_0x4e1f24,_[_0x9803('0x65')]('default_favicon.ico'));var _0x4f783c=_0x9803('0x67')+_[_0x9803('0x68')](_0x9803('0x5d'));if(_0x490387[_0x4f783c]||!_0x398995[_0x9803('0x69')]){_0x11c471=path[_0x9803('0x63')](config[_0x9803('0x64')],_0x4e1f24,_[_0x9803('0x65')](_0x9803('0x76')));}if(!fs['existsSync'](_0x11c471)){throw new db[(_0x9803('0x6a'))][(_0x9803('0x6b'))](_[_0x9803('0x68')](_0x9803('0x5d'))+_0x9803('0x6f'));}return _0x2bd09c[_0x9803('0x6c')](_0x11c471);}})[_0x9803('0x24')](handleError(_0x2bd09c,null));};exports[_0x9803('0x77')]=function(_0x211f1c,_0x1b126a){var _0x3cfcda={'offset':moment()[_0x9803('0x78')]()};_0x3cfcda[_0x9803('0x79')]=moment()[_0x9803('0x78')](_0x3cfcda['offset'])['format'](_0x9803('0x7a'));return _0x1b126a[_0x9803('0x2a')](0xc8)[_0x9803('0x33')](_0x3cfcda);}; \ No newline at end of file +var _0x46cc=['rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','include','findAll','rows','params','includeAll','find','catch','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','toLower','default_logo.svg','default','upperFirst','custom','root','Sequelize','download','getLogoLogin','defaultLogo','default_loginLogo.svg','securePassword','addPreferred','getPreferred','default_preferred.png','ValidationError','\x20not\x20found','addFavicon','default_favicon.ico','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','set','apply','reject','update','then','destroy','sendStatus','stack','name','map','Setting'];(function(_0x3bd158,_0x533145){var _0x2c5f9c=function(_0x36fd1c){while(--_0x36fd1c){_0x3bd158['push'](_0x3bd158['shift']());}};_0x2c5f9c(++_0x533145);}(_0x46cc,0xc1));var _0xc46c=function(_0x12e3f4,_0x4a3923){_0x12e3f4=_0x12e3f4-0x0;var _0x50d9b4=_0x46cc[_0x12e3f4];return _0x50d9b4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc46c('0x0'));var zipdir=require(_0xc46c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc46c('0x2'));var moment=require(_0xc46c('0x3'));var BPromise=require(_0xc46c('0x4'));var Mustache=require(_0xc46c('0x5'));var util=require('util');var path=require('path');var sox=require(_0xc46c('0x6'));var csv=require(_0xc46c('0x7'));var ejs=require(_0xc46c('0x8'));var fs=require('fs');var fs_extra=require(_0xc46c('0x9'));var _=require(_0xc46c('0xa'));var squel=require(_0xc46c('0xb'));var crypto=require(_0xc46c('0xc'));var jsforce=require(_0xc46c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xc46c('0x7'));var querystring=require(_0xc46c('0xe'));var Papa=require('papaparse');var Redis=require(_0xc46c('0xf'));var authService=require(_0xc46c('0x10'));var qs=require(_0xc46c('0x11'));var as=require(_0xc46c('0x12'));var hardwareService=require(_0xc46c('0x13'));var logger=require(_0xc46c('0x14'))(_0xc46c('0x15'));var utils=require(_0xc46c('0x16'));var config=require(_0xc46c('0x17'));var licenseUtil=require(_0xc46c('0x18'));var db=require(_0xc46c('0x19'))['db'];var jayson=require(_0xc46c('0x1a'));var client=jayson[_0xc46c('0x1b')][_0xc46c('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x3bb544,_0x28132e,_0x2c9766,_0x5aaf37){return new BPromise(function(_0x1a9cc0,_0x240d60){var _0x13d794=_0x5aaf37||client;return _0x13d794['request'](_0x3bb544,_0x2c9766)['then'](function(_0x26e968){logger[_0xc46c('0x1d')](_0xc46c('0x1e'),_0x28132e,_0xc46c('0x1f'));logger[_0xc46c('0x20')](_0xc46c('0x21'),_0x28132e,'request\x20sent',JSON[_0xc46c('0x22')](_0x26e968));if(_0x26e968[_0xc46c('0x23')]){if(_0x26e968[_0xc46c('0x23')][_0xc46c('0x24')]===0x1f4){logger[_0xc46c('0x23')](_0xc46c('0x1e'),_0x28132e,_0x26e968[_0xc46c('0x23')]['message']);return _0x240d60(_0x26e968[_0xc46c('0x23')][_0xc46c('0x25')]);}logger['error'](_0xc46c('0x1e'),_0x28132e,_0x26e968['error'][_0xc46c('0x25')]);return _0x1a9cc0(_0x26e968['error']['message']);}else{logger['info'](_0xc46c('0x1e'),_0x28132e,_0xc46c('0x1f'));_0x1a9cc0(_0x26e968[_0xc46c('0x26')][_0xc46c('0x25')]);}})['catch'](function(_0x52ada4){logger[_0xc46c('0x23')](_0xc46c('0x1e'),_0x28132e,_0x52ada4);_0x240d60(_0x52ada4);});});}function respondWithStatusCode(_0x58e7ec,_0x13b316){_0x13b316=_0x13b316||0xcc;return function(_0x4de3f4){if(_0x4de3f4){return _0x58e7ec['sendStatus'](_0x13b316);}return _0x58e7ec[_0xc46c('0x27')](_0x13b316)[_0xc46c('0x28')]();};}function respondWithResult(_0xadcbc4,_0x554741){_0x554741=_0x554741||0xc8;return function(_0x166932){if(_0x166932){return _0xadcbc4[_0xc46c('0x27')](_0x554741)[_0xc46c('0x29')](_0x166932);}};}function respondWithFilteredResult(_0x177090,_0x51c67d){return function(_0x3f9ad5){if(_0x3f9ad5){var _0x4474b2=typeof _0x51c67d[_0xc46c('0x2a')]===_0xc46c('0x2b')&&typeof _0x51c67d[_0xc46c('0x2c')]==='undefined';var _0x44084e=_0x3f9ad5['count'];var _0x183004=_0x4474b2?0x0:_0x51c67d[_0xc46c('0x2a')];var _0x168ef1=_0x4474b2?_0x3f9ad5[_0xc46c('0x2d')]:_0x51c67d[_0xc46c('0x2a')]+_0x51c67d[_0xc46c('0x2c')];var _0x2c2c13;if(_0x168ef1>=_0x44084e){_0x168ef1=_0x44084e;_0x2c2c13=0xc8;}else{_0x2c2c13=0xce;}_0x177090[_0xc46c('0x27')](_0x2c2c13);return _0x177090[_0xc46c('0x2e')]('Content-Range',_0x183004+'-'+_0x168ef1+'/'+_0x44084e)[_0xc46c('0x29')](_0x3f9ad5);}return null;};}function patchUpdates(_0x3d5d8c){return function(_0x5d1787){try{jsonpatch[_0xc46c('0x2f')](_0x5d1787,_0x3d5d8c,!![]);}catch(_0x849754){return BPromise[_0xc46c('0x30')](_0x849754);}return _0x5d1787['save']();};}function saveUpdates(_0x923ea5,_0x282846){return function(_0x2558a9){if(_0x2558a9){return _0x2558a9[_0xc46c('0x31')](_0x923ea5)[_0xc46c('0x32')](function(_0x499856){return _0x499856;});}return null;};}function removeEntity(_0x45f173,_0x5a8078){return function(_0x78eeb0){if(_0x78eeb0){return _0x78eeb0[_0xc46c('0x33')]()[_0xc46c('0x32')](function(){_0x45f173['status'](0xcc)[_0xc46c('0x28')]();});}};}function handleEntityNotFound(_0x5d46cb,_0xf3a60d){return function(_0x311035){if(!_0x311035){_0x5d46cb[_0xc46c('0x34')](0x194);}return _0x311035;};}function handleError(_0x24e107,_0x1a29ee){_0x1a29ee=_0x1a29ee||0x1f4;return function(_0x477989){logger[_0xc46c('0x23')](_0x477989[_0xc46c('0x35')]);if(_0x477989[_0xc46c('0x36')]){delete _0x477989[_0xc46c('0x36')];}_0x24e107[_0xc46c('0x27')](_0x1a29ee)['send'](_0x477989);};}exports['index']=function(_0x5776a5,_0x5bbdc4){var _0x2dc452={},_0x1e6695={},_0x927c93={'count':0x0,'rows':[]};var _0x54ac31=_[_0xc46c('0x37')](db[_0xc46c('0x38')][_0xc46c('0x39')],function(_0x291679){return{'name':_0x291679[_0xc46c('0x3a')],'type':_0x291679['type'][_0xc46c('0x3b')]};});_0x1e6695[_0xc46c('0x3c')]=_['map'](_0x54ac31,_0xc46c('0x36'));_0x1e6695[_0xc46c('0x3d')]=_[_0xc46c('0x3e')](_0x5776a5[_0xc46c('0x3d')]);_0x1e6695['filters']=_['intersection'](_0x1e6695['model'],_0x1e6695[_0xc46c('0x3d')]);_0x2dc452[_0xc46c('0x3f')]=_[_0xc46c('0x40')](_0x1e6695[_0xc46c('0x3c')],qs['fields'](_0x5776a5['query'][_0xc46c('0x41')]));_0x2dc452[_0xc46c('0x3f')]=_0x2dc452[_0xc46c('0x3f')][_0xc46c('0x42')]?_0x2dc452[_0xc46c('0x3f')]:_0x1e6695[_0xc46c('0x3c')];if(!_0x5776a5[_0xc46c('0x3d')][_0xc46c('0x43')](_0xc46c('0x44'))){_0x2dc452['limit']=qs[_0xc46c('0x2c')](_0x5776a5[_0xc46c('0x3d')][_0xc46c('0x2c')]);_0x2dc452['offset']=qs[_0xc46c('0x2a')](_0x5776a5[_0xc46c('0x3d')][_0xc46c('0x2a')]);}_0x2dc452[_0xc46c('0x45')]=qs[_0xc46c('0x46')](_0x5776a5[_0xc46c('0x3d')][_0xc46c('0x46')]);_0x2dc452[_0xc46c('0x47')]=qs['filters'](_[_0xc46c('0x48')](_0x5776a5[_0xc46c('0x3d')],_0x1e6695[_0xc46c('0x49')]),_0x54ac31);if(_0x5776a5['query'][_0xc46c('0x4a')]){_0x2dc452[_0xc46c('0x47')]=_[_0xc46c('0x4b')](_0x2dc452['where'],{'$or':_['map'](_0x54ac31,function(_0x5324aa){if(_0x5324aa['type']!=='VIRTUAL'){var _0x3fc3e3={};_0x3fc3e3[_0x5324aa[_0xc46c('0x36')]]={'$like':'%'+_0x5776a5[_0xc46c('0x3d')][_0xc46c('0x4a')]+'%'};return _0x3fc3e3;}})});}_0x2dc452=_[_0xc46c('0x4b')]({},_0x2dc452,_0x5776a5[_0xc46c('0x4c')]);var _0x31bb3b={'where':_0x2dc452[_0xc46c('0x47')]};return db[_0xc46c('0x38')][_0xc46c('0x2d')](_0x31bb3b)['then'](function(_0x8bb723){_0x927c93[_0xc46c('0x2d')]=_0x8bb723;if(_0x5776a5[_0xc46c('0x3d')]['includeAll']){_0x2dc452[_0xc46c('0x4d')]=[{'all':!![]}];}return db['Setting'][_0xc46c('0x4e')](_0x2dc452);})[_0xc46c('0x32')](function(_0x2e43c8){_0x927c93[_0xc46c('0x4f')]=_0x2e43c8;return _0x927c93;})[_0xc46c('0x32')](respondWithFilteredResult(_0x5bbdc4,_0x2dc452))['catch'](handleError(_0x5bbdc4,null));};exports['show']=function(_0x2a5943,_0x31df70){var _0x5c8abb={'raw':![],'where':{'id':_0x2a5943[_0xc46c('0x50')]['id']}},_0x274db9={};_0x274db9[_0xc46c('0x3c')]=_[_0xc46c('0x3e')](db[_0xc46c('0x38')][_0xc46c('0x39')]);_0x274db9[_0xc46c('0x3d')]=_['keys'](_0x2a5943[_0xc46c('0x3d')]);_0x274db9['filters']=_[_0xc46c('0x40')](_0x274db9[_0xc46c('0x3c')],_0x274db9[_0xc46c('0x3d')]);_0x5c8abb[_0xc46c('0x3f')]=_[_0xc46c('0x40')](_0x274db9[_0xc46c('0x3c')],qs[_0xc46c('0x41')](_0x2a5943[_0xc46c('0x3d')]['fields']));_0x5c8abb[_0xc46c('0x3f')]=_0x5c8abb[_0xc46c('0x3f')][_0xc46c('0x42')]?_0x5c8abb[_0xc46c('0x3f')]:_0x274db9[_0xc46c('0x3c')];if(_0x2a5943[_0xc46c('0x3d')][_0xc46c('0x51')]){_0x5c8abb[_0xc46c('0x4d')]=[{'all':!![]}];}_0x5c8abb=_[_0xc46c('0x4b')]({},_0x5c8abb,_0x2a5943['options']);return db[_0xc46c('0x38')][_0xc46c('0x52')](_0x5c8abb)[_0xc46c('0x32')](handleEntityNotFound(_0x31df70,null))['then'](respondWithResult(_0x31df70,null))[_0xc46c('0x53')](handleError(_0x31df70,null));};exports[_0xc46c('0x31')]=function(_0x2a125c,_0x62f8fc){if(_0x2a125c[_0xc46c('0x54')]['id']){delete _0x2a125c[_0xc46c('0x54')]['id'];}return db[_0xc46c('0x38')]['find']({'where':{'id':_0x2a125c['params']['id']}})[_0xc46c('0x32')](handleEntityNotFound(_0x62f8fc,null))['then'](saveUpdates(_0x2a125c['body'],null))[_0xc46c('0x32')](respondWithResult(_0x62f8fc,null))[_0xc46c('0x53')](handleError(_0x62f8fc,null));};exports[_0xc46c('0x55')]=function(_0x36fd4d,_0x3375f8,_0x52dc88){if(_0x36fd4d[_0xc46c('0x56')]&&_0x36fd4d[_0xc46c('0x56')][_0xc46c('0x57')]){_0x36fd4d['body'][_0xc46c('0x58')]=_0x36fd4d[_0xc46c('0x56')][_0xc46c('0x57')];}return db[_0xc46c('0x38')][_0xc46c('0x52')]({'where':{'id':_0x36fd4d[_0xc46c('0x50')]['id']}})[_0xc46c('0x32')](handleEntityNotFound(_0x3375f8,null))[_0xc46c('0x32')](saveUpdates(_0x36fd4d['body'],null))[_0xc46c('0x32')](respondWithResult(_0x3375f8,null))['catch'](handleError(_0x3375f8,null));};exports[_0xc46c('0x59')]=function(_0x58fcfb,_0x4d094e,_0x40ef33){if(_0x58fcfb['file']&&_0x58fcfb[_0xc46c('0x56')][_0xc46c('0x57')]){_0x58fcfb['body'][_0xc46c('0x5a')]=_0x58fcfb[_0xc46c('0x56')][_0xc46c('0x57')];}return db[_0xc46c('0x38')][_0xc46c('0x52')]({'where':{'id':_0x58fcfb[_0xc46c('0x50')]['id']}})[_0xc46c('0x32')](handleEntityNotFound(_0x4d094e,null))[_0xc46c('0x32')](saveUpdates(_0x58fcfb['body'],null))[_0xc46c('0x32')](respondWithResult(_0x4d094e,null))[_0xc46c('0x53')](handleError(_0x4d094e,null));};var utilLicense=require(_0xc46c('0x18'));exports['getLogo']=function(_0x2a210a,_0x2c3136,_0x12a4b2){var _0x361805=_0xc46c('0x5b');var _0x2ec108={'custom':![]};return utilLicense[_0xc46c('0x5c')]()[_0xc46c('0x32')](function(_0x629e8e){if(_0x629e8e){_0x2ec108=_0x629e8e;}return db['Setting']['find']({'where':{'id':_0x2a210a[_0xc46c('0x50')]['id']},'attributes':[_0xc46c('0x58'),_0xc46c('0x5a'),_0xc46c('0x5d'),_0xc46c('0x5e'),'defaultLogo',_0xc46c('0x5f'),_0xc46c('0x60'),_0xc46c('0x61')],'raw':!![]});})[_0xc46c('0x32')](handleEntityNotFound(_0x2c3136,null))[_0xc46c('0x32')](function(_0x220987){if(_0x220987){var _0x212c6e=_0x220987[_0xc46c('0x58')]&&fs[_0xc46c('0x62')](path[_0xc46c('0x63')](config['root'],_0x361805,_[_0xc46c('0x64')](_0x220987[_0xc46c('0x58')])))?path[_0xc46c('0x63')](config['root'],_0x361805,_[_0xc46c('0x64')](_0x220987[_0xc46c('0x58')])):path[_0xc46c('0x63')](config['root'],_0x361805,_[_0xc46c('0x64')](_0xc46c('0x65')));var _0x3dc424=_0xc46c('0x66')+_[_0xc46c('0x67')](_0xc46c('0x58'));if(_0x220987[_0x3dc424]||!_0x2ec108[_0xc46c('0x68')]){_0x212c6e=path[_0xc46c('0x63')](config[_0xc46c('0x69')],_0x361805,_[_0xc46c('0x64')](_0xc46c('0x65')));}if(!fs[_0xc46c('0x62')](_0x212c6e)){throw new db[(_0xc46c('0x6a'))]['ValidationError'](_[_0xc46c('0x67')](_0xc46c('0x58'))+'\x20not\x20found');}return _0x2c3136[_0xc46c('0x6b')](_0x212c6e);}})[_0xc46c('0x53')](handleError(_0x2c3136,null));};var utilLicense=require(_0xc46c('0x18'));exports[_0xc46c('0x6c')]=function(_0x2ee274,_0x374b51,_0x8b05dc){var _0x114f99='server/files/images/logos';var _0x1ed5ad={'custom':![]};return utilLicense['getLicense']()[_0xc46c('0x32')](function(_0x59584e){if(_0x59584e){_0x1ed5ad=_0x59584e;}return db[_0xc46c('0x38')][_0xc46c('0x52')]({'where':{'id':_0x2ee274[_0xc46c('0x50')]['id']},'attributes':[_0xc46c('0x58'),'loginLogo',_0xc46c('0x5d'),_0xc46c('0x5e'),_0xc46c('0x6d'),_0xc46c('0x5f'),_0xc46c('0x60'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x374b51,null))[_0xc46c('0x32')](function(_0x239cb9){if(_0x239cb9){var _0x4224c1=_0x239cb9['loginLogo']&&fs[_0xc46c('0x62')](path['join'](config['root'],_0x114f99,_['toLower'](_0x239cb9[_0xc46c('0x5a')])))?path[_0xc46c('0x63')](config[_0xc46c('0x69')],_0x114f99,_['toLower'](_0x239cb9['loginLogo'])):path[_0xc46c('0x63')](config['root'],_0x114f99,_[_0xc46c('0x64')](_0xc46c('0x6e')));var _0x314473=_0xc46c('0x66')+_[_0xc46c('0x67')]('loginLogo');if(_0x239cb9[_0x314473]||!_0x1ed5ad[_0xc46c('0x68')]){_0x4224c1=path[_0xc46c('0x63')](config[_0xc46c('0x69')],_0x114f99,_[_0xc46c('0x64')](_0xc46c('0x6e')));}if(!fs[_0xc46c('0x62')](_0x4224c1)){throw new db['Sequelize']['ValidationError'](_[_0xc46c('0x67')](_0xc46c('0x5a'))+'\x20not\x20found');}return _0x374b51[_0xc46c('0x6b')](_0x4224c1);}})[_0xc46c('0x53')](handleError(_0x374b51,null));};exports['gdpr']=function(_0x31b1e4,_0xcb0321){return db[_0xc46c('0x38')]['find']({'where':{'id':_0x31b1e4[_0xc46c('0x50')]['id']},'attributes':[_0xc46c('0x6f')]})[_0xc46c('0x32')](respondWithResult(_0xcb0321,null))[_0xc46c('0x53')](handleError(_0xcb0321,null));};exports[_0xc46c('0x70')]=function(_0x22bfe1,_0x5a90f2,_0x276aec){if(_0x22bfe1[_0xc46c('0x56')]&&_0x22bfe1[_0xc46c('0x56')][_0xc46c('0x57')]){_0x22bfe1[_0xc46c('0x54')][_0xc46c('0x5d')]=_0x22bfe1[_0xc46c('0x56')][_0xc46c('0x57')];}return db['Setting']['find']({'where':{'id':_0x22bfe1['params']['id']}})[_0xc46c('0x32')](handleEntityNotFound(_0x5a90f2,null))[_0xc46c('0x32')](saveUpdates(_0x22bfe1[_0xc46c('0x54')],null))[_0xc46c('0x32')](respondWithResult(_0x5a90f2,null))[_0xc46c('0x53')](handleError(_0x5a90f2,null));};var utilLicense=require(_0xc46c('0x18'));exports[_0xc46c('0x71')]=function(_0x5d3d90,_0x15c1fa,_0x460e01){var _0x437607='server/files/images/logos';var _0x5adc0f={'custom':![]};return utilLicense[_0xc46c('0x5c')]()[_0xc46c('0x32')](function(_0x111901){if(_0x111901){_0x5adc0f=_0x111901;}return db[_0xc46c('0x38')]['find']({'where':{'id':_0x5d3d90[_0xc46c('0x50')]['id']},'attributes':['logo',_0xc46c('0x5a'),_0xc46c('0x5d'),_0xc46c('0x5e'),_0xc46c('0x6d'),_0xc46c('0x5f'),_0xc46c('0x60'),_0xc46c('0x61')],'raw':!![]});})['then'](handleEntityNotFound(_0x15c1fa,null))[_0xc46c('0x32')](function(_0x20af9f){if(_0x20af9f){var _0x855ebf=_0x20af9f[_0xc46c('0x5d')]&&fs[_0xc46c('0x62')](path[_0xc46c('0x63')](config[_0xc46c('0x69')],_0x437607,_[_0xc46c('0x64')](_0x20af9f[_0xc46c('0x5d')])))?path[_0xc46c('0x63')](config['root'],_0x437607,_[_0xc46c('0x64')](_0x20af9f['preferred'])):path[_0xc46c('0x63')](config[_0xc46c('0x69')],_0x437607,_[_0xc46c('0x64')](_0xc46c('0x72')));var _0x1bb82f=_0xc46c('0x66')+_[_0xc46c('0x67')](_0xc46c('0x5d'));if(_0x20af9f[_0x1bb82f]||!_0x5adc0f[_0xc46c('0x68')]||!_0x5adc0f[_0xc46c('0x5d')]){_0x855ebf=path[_0xc46c('0x63')](config[_0xc46c('0x69')],_0x437607,_[_0xc46c('0x64')](_0xc46c('0x72')));}if(!fs['existsSync'](_0x855ebf)){throw new db[(_0xc46c('0x6a'))][(_0xc46c('0x73'))](_['upperFirst'](_0xc46c('0x5d'))+_0xc46c('0x74'));}return _0x15c1fa[_0xc46c('0x6b')](_0x855ebf);}})[_0xc46c('0x53')](handleError(_0x15c1fa,null));};exports[_0xc46c('0x75')]=function(_0x5d036c,_0x21f3b5,_0x1dcacf){if(_0x5d036c[_0xc46c('0x56')]&&_0x5d036c[_0xc46c('0x56')][_0xc46c('0x57')]){_0x5d036c[_0xc46c('0x54')][_0xc46c('0x5e')]=_0x5d036c[_0xc46c('0x56')][_0xc46c('0x57')];}return db['Setting'][_0xc46c('0x52')]({'where':{'id':_0x5d036c[_0xc46c('0x50')]['id']}})[_0xc46c('0x32')](handleEntityNotFound(_0x21f3b5,null))[_0xc46c('0x32')](saveUpdates(_0x5d036c[_0xc46c('0x54')],null))[_0xc46c('0x32')](respondWithResult(_0x21f3b5,null))['catch'](handleError(_0x21f3b5,null));};var utilLicense=require(_0xc46c('0x18'));exports['getFavicon']=function(_0x1951b8,_0x121588,_0x2bad98){var _0x4566f9=_0xc46c('0x5b');var _0x5a7e94={'custom':![]};return utilLicense[_0xc46c('0x5c')]()['then'](function(_0x5cec76){if(_0x5cec76){_0x5a7e94=_0x5cec76;}return db[_0xc46c('0x38')][_0xc46c('0x52')]({'where':{'id':_0x1951b8['params']['id']},'attributes':[_0xc46c('0x58'),'loginLogo',_0xc46c('0x5d'),_0xc46c('0x5e'),_0xc46c('0x6d'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xc46c('0x32')](handleEntityNotFound(_0x121588,null))[_0xc46c('0x32')](function(_0x497a90){if(_0x497a90){var _0x2c6a60=_0x497a90['favicon']&&fs[_0xc46c('0x62')](path[_0xc46c('0x63')](config[_0xc46c('0x69')],_0x4566f9,_[_0xc46c('0x64')](_0x497a90[_0xc46c('0x5e')])))?path['join'](config[_0xc46c('0x69')],_0x4566f9,_[_0xc46c('0x64')](_0x497a90[_0xc46c('0x5e')])):path[_0xc46c('0x63')](config[_0xc46c('0x69')],_0x4566f9,_[_0xc46c('0x64')](_0xc46c('0x76')));var _0x1a3ed5='default'+_[_0xc46c('0x67')](_0xc46c('0x5e'));if(_0x497a90[_0x1a3ed5]||!_0x5a7e94[_0xc46c('0x68')]){_0x2c6a60=path['join'](config['root'],_0x4566f9,_[_0xc46c('0x64')](_0xc46c('0x76')));}if(!fs['existsSync'](_0x2c6a60)){throw new db[(_0xc46c('0x6a'))][(_0xc46c('0x73'))](_[_0xc46c('0x67')](_0xc46c('0x5e'))+_0xc46c('0x74'));}return _0x121588['download'](_0x2c6a60);}})['catch'](handleError(_0x121588,null));};exports[_0xc46c('0x77')]=function(_0x162789,_0x371735){var _0x3f382e={'offset':moment()['utcOffset']()};_0x3f382e[_0xc46c('0x78')]=moment()[_0xc46c('0x79')](_0x3f382e['offset'])[_0xc46c('0x7a')](_0xc46c('0x7b'));return _0x371735[_0xc46c('0x27')](0xc8)[_0xc46c('0x7c')](_0x3f382e);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 8a8aa3f..719a8d6 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 _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x504dc3,_0x547139){var _0x2d352c=function(_0x3cb526){while(--_0x3cb526){_0x504dc3['push'](_0x504dc3['shift']());}};_0x2d352c(++_0x547139);}(_0x008c,0x188));var _0xc008=function(_0x357f0a,_0x37aa60){_0x357f0a=_0x357f0a-0x0;var _0x10d41b=_0x008c[_0x357f0a];return _0x10d41b;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./setting.attributes','exports','define','settings','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x55ca,0x126));var _0xa55c=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x55ca[_0x2faddb];return _0x273c05;};'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')]('Setting',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index de8df14..b464196 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 _0xbe3d=['client','http','request','then','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','Setting,\x20%s,\x20%s','message','info','result','catch','ShowSetting','Setting','find','options','raw','where','include','map','model','attributes','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0xbe3d,0x182));var _0xdbe3=function(_0x232fe0,_0x5aaf77){_0x232fe0=_0x232fe0-0x0;var _0x2fc97c=_0xbe3d[_0x232fe0];return _0x2fc97c;};'use strict';var _=require(_0xdbe3('0x0'));var util=require('util');var moment=require(_0xdbe3('0x1'));var BPromise=require(_0xdbe3('0x2'));var rs=require(_0xdbe3('0x3'));var fs=require('fs');var Redis=require(_0xdbe3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdbe3('0x5'));var logger=require(_0xdbe3('0x6'))(_0xdbe3('0x7'));var config=require(_0xdbe3('0x8'));var jayson=require(_0xdbe3('0x9'));var client=jayson[_0xdbe3('0xa')][_0xdbe3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x14db19,_0x43f9f9,_0xf69004){return new BPromise(function(_0x11d22e,_0xe0b543){return client[_0xdbe3('0xc')](_0x14db19,_0xf69004)[_0xdbe3('0xd')](function(_0x5537ef){logger['info']('Setting,\x20%s,\x20%s',_0x43f9f9,'request\x20sent');logger['debug'](_0xdbe3('0xe'),_0x43f9f9,_0xdbe3('0xf'),JSON[_0xdbe3('0x10')](_0x5537ef));if(_0x5537ef[_0xdbe3('0x11')]){if(_0x5537ef[_0xdbe3('0x11')]['code']===0x1f4){logger[_0xdbe3('0x11')](_0xdbe3('0x12'),_0x43f9f9,_0x5537ef[_0xdbe3('0x11')][_0xdbe3('0x13')]);return _0xe0b543(_0x5537ef['error'][_0xdbe3('0x13')]);}logger[_0xdbe3('0x11')](_0xdbe3('0x12'),_0x43f9f9,_0x5537ef[_0xdbe3('0x11')]['message']);return _0x11d22e(_0x5537ef['error'][_0xdbe3('0x13')]);}else{logger[_0xdbe3('0x14')](_0xdbe3('0x12'),_0x43f9f9,'request\x20sent');_0x11d22e(_0x5537ef[_0xdbe3('0x15')][_0xdbe3('0x13')]);}})[_0xdbe3('0x16')](function(_0x421740){logger[_0xdbe3('0x11')](_0xdbe3('0x12'),_0x43f9f9,_0x421740);_0xe0b543(_0x421740);});});}exports[_0xdbe3('0x17')]=function(_0x4eb4fb){var _0x50f2c4=this;return new Promise(function(_0x2244ed,_0x2c70a6){return db[_0xdbe3('0x18')][_0xdbe3('0x19')]({'raw':_0x4eb4fb[_0xdbe3('0x1a')]?_0x4eb4fb[_0xdbe3('0x1a')][_0xdbe3('0x1b')]===undefined?!![]:![]:!![],'where':_0x4eb4fb[_0xdbe3('0x1a')]?_0x4eb4fb[_0xdbe3('0x1a')][_0xdbe3('0x1c')]||null:null,'attributes':_0x4eb4fb[_0xdbe3('0x1a')]?_0x4eb4fb[_0xdbe3('0x1a')]['attributes']||null:null,'include':_0x4eb4fb['options']?_0x4eb4fb[_0xdbe3('0x1a')][_0xdbe3('0x1d')]?_[_0xdbe3('0x1e')](_0x4eb4fb[_0xdbe3('0x1a')][_0xdbe3('0x1d')],function(_0x264fb6){return{'model':db[_0x264fb6[_0xdbe3('0x1f')]],'as':_0x264fb6['as'],'attributes':_0x264fb6['attributes'],'include':_0x264fb6[_0xdbe3('0x1d')]?_[_0xdbe3('0x1e')](_0x264fb6[_0xdbe3('0x1d')],function(_0x170f0c){return{'model':db[_0x170f0c['model']],'as':_0x170f0c['as'],'attributes':_0x170f0c[_0xdbe3('0x20')],'include':_0x170f0c[_0xdbe3('0x1d')]?_['map'](_0x170f0c[_0xdbe3('0x1d')],function(_0x465fa8){return{'model':db[_0x465fa8['model']],'as':_0x465fa8['as'],'attributes':_0x465fa8[_0xdbe3('0x20')]};}):[]};}):[]};}):[]:[]})[_0xdbe3('0xd')](function(_0x313ccd){logger[_0xdbe3('0x14')]('ShowSetting',_0x4eb4fb);logger['debug'](_0xdbe3('0x17'),_0x4eb4fb,JSON['stringify'](_0x313ccd));_0x2244ed(_0x313ccd);})[_0xdbe3('0x16')](function(_0x2a52a2){logger[_0xdbe3('0x11')](_0xdbe3('0x17'),_0x2a52a2[_0xdbe3('0x13')],_0x4eb4fb);_0x2c70a6(_0x50f2c4[_0xdbe3('0x11')](0x1f4,_0x2a52a2[_0xdbe3('0x13')]));});});}; \ No newline at end of file +var _0x1f7e=['find','raw','options','where','attributes','include','map','model','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowSetting','Setting'];(function(_0x1dc257,_0x651aa3){var _0x46df6a=function(_0x2f57a6){while(--_0x2f57a6){_0x1dc257['push'](_0x1dc257['shift']());}};_0x46df6a(++_0x651aa3);}(_0x1f7e,0xf1));var _0xe1f7=function(_0x1623ce,_0x18705d){_0x1623ce=_0x1623ce-0x0;var _0x26d697=_0x1f7e[_0x1623ce];return _0x26d697;};'use strict';var _=require(_0xe1f7('0x0'));var util=require(_0xe1f7('0x1'));var moment=require(_0xe1f7('0x2'));var BPromise=require(_0xe1f7('0x3'));var rs=require(_0xe1f7('0x4'));var fs=require('fs');var Redis=require(_0xe1f7('0x5'));var db=require(_0xe1f7('0x6'))['db'];var utils=require(_0xe1f7('0x7'));var logger=require(_0xe1f7('0x8'))(_0xe1f7('0x9'));var config=require(_0xe1f7('0xa'));var jayson=require(_0xe1f7('0xb'));var client=jayson['client'][_0xe1f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4ba08d,_0x6adbd4,_0xe8ca4f){return new BPromise(function(_0xa397c8,_0x2c22fe){return client['request'](_0x4ba08d,_0xe8ca4f)['then'](function(_0x3aad54){logger[_0xe1f7('0xd')](_0xe1f7('0xe'),_0x6adbd4,_0xe1f7('0xf'));logger['debug'](_0xe1f7('0x10'),_0x6adbd4,_0xe1f7('0xf'),JSON['stringify'](_0x3aad54));if(_0x3aad54[_0xe1f7('0x11')]){if(_0x3aad54[_0xe1f7('0x11')][_0xe1f7('0x12')]===0x1f4){logger['error'](_0xe1f7('0xe'),_0x6adbd4,_0x3aad54[_0xe1f7('0x11')][_0xe1f7('0x13')]);return _0x2c22fe(_0x3aad54['error']['message']);}logger[_0xe1f7('0x11')]('Setting,\x20%s,\x20%s',_0x6adbd4,_0x3aad54[_0xe1f7('0x11')][_0xe1f7('0x13')]);return _0xa397c8(_0x3aad54[_0xe1f7('0x11')]['message']);}else{logger['info'](_0xe1f7('0xe'),_0x6adbd4,_0xe1f7('0xf'));_0xa397c8(_0x3aad54['result'][_0xe1f7('0x13')]);}})[_0xe1f7('0x14')](function(_0x151e7f){logger[_0xe1f7('0x11')](_0xe1f7('0xe'),_0x6adbd4,_0x151e7f);_0x2c22fe(_0x151e7f);});});}exports[_0xe1f7('0x15')]=function(_0x572cc2){var _0x1deac6=this;return new Promise(function(_0x43cbf0,_0x2ca4cb){return db[_0xe1f7('0x16')][_0xe1f7('0x17')]({'raw':_0x572cc2['options']?_0x572cc2['options'][_0xe1f7('0x18')]===undefined?!![]:![]:!![],'where':_0x572cc2['options']?_0x572cc2[_0xe1f7('0x19')][_0xe1f7('0x1a')]||null:null,'attributes':_0x572cc2[_0xe1f7('0x19')]?_0x572cc2[_0xe1f7('0x19')][_0xe1f7('0x1b')]||null:null,'include':_0x572cc2['options']?_0x572cc2[_0xe1f7('0x19')][_0xe1f7('0x1c')]?_[_0xe1f7('0x1d')](_0x572cc2[_0xe1f7('0x19')]['include'],function(_0x56867c){return{'model':db[_0x56867c[_0xe1f7('0x1e')]],'as':_0x56867c['as'],'attributes':_0x56867c[_0xe1f7('0x1b')],'include':_0x56867c[_0xe1f7('0x1c')]?_[_0xe1f7('0x1d')](_0x56867c['include'],function(_0x2ec7d4){return{'model':db[_0x2ec7d4['model']],'as':_0x2ec7d4['as'],'attributes':_0x2ec7d4['attributes'],'include':_0x2ec7d4[_0xe1f7('0x1c')]?_[_0xe1f7('0x1d')](_0x2ec7d4[_0xe1f7('0x1c')],function(_0x2e900c){return{'model':db[_0x2e900c[_0xe1f7('0x1e')]],'as':_0x2e900c['as'],'attributes':_0x2e900c[_0xe1f7('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe1f7('0x1f')](function(_0x4e2efd){logger['info'](_0xe1f7('0x15'),_0x572cc2);logger[_0xe1f7('0x20')](_0xe1f7('0x15'),_0x572cc2,JSON['stringify'](_0x4e2efd));_0x43cbf0(_0x4e2efd);})['catch'](function(_0x39000a){logger[_0xe1f7('0x11')]('ShowSetting',_0x39000a[_0xe1f7('0x13')],_0x572cc2);_0x2ca4cb(_0x1deac6[_0xe1f7('0x11')](0x1f4,_0x39000a[_0xe1f7('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 7d83461..ed156f0 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 _0x53ec=['send','status','update','delete','removeDispositions','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','getInteractions','/:id/status','statusGet','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addApplications','/:id/send'];(function(_0x16dfb4,_0x51e627){var _0x1d2900=function(_0x511a48){while(--_0x511a48){_0x16dfb4['push'](_0x16dfb4['shift']());}};_0x1d2900(++_0x51e627);}(_0x53ec,0x192));var _0xc53e=function(_0x33f3f8,_0x51b47a){_0x33f3f8=_0x33f3f8-0x0;var _0x2122db=_0x53ec[_0x33f3f8];return _0x2122db;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xa')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router['get']('/:id/canned_answers',auth[_0xc53e('0x9')](),controller['getAnswers']);router['get'](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x12')]);router[_0xc53e('0xa')]('/:id/interactions',auth['isAuthenticated'](),controller[_0xc53e('0x13')]);router[_0xc53e('0xa')](_0xc53e('0x14'),controller[_0xc53e('0x15')]);router[_0xc53e('0xa')](_0xc53e('0x16'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x17')]);router[_0xc53e('0x18')]('/',auth[_0xc53e('0x9')](),controller['create']);router[_0xc53e('0x18')](_0xc53e('0xf'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x19')]);router[_0xc53e('0x18')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1b')]);router[_0xc53e('0x18')]('/:id/notify',controller['notify']);router[_0xc53e('0x18')](_0xc53e('0x11'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1c')]);router[_0xc53e('0x18')](_0xc53e('0x1d'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x1e')]);router[_0xc53e('0x18')](_0xc53e('0x14'),controller[_0xc53e('0x1f')]);router[_0xc53e('0x18')](_0xc53e('0x16'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0x20')]);router[_0xc53e('0x21')](_0xc53e('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0xc53e('0x21')]('/:id/dispositions',auth[_0xc53e('0x9')](),controller[_0xc53e('0x22')]);router[_0xc53e('0x21')](_0xc53e('0x1a'),auth[_0xc53e('0x9')](),controller['removeAnswers']);router[_0xc53e('0x21')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xc53e('0x23')]=router; \ No newline at end of file +var _0x326f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/status','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer'];(function(_0x4de1b5,_0x2a7626){var _0xed55cf=function(_0x5f1115){while(--_0x5f1115){_0x4de1b5['push'](_0x4de1b5['shift']());}};_0xed55cf(++_0x2a7626);}(_0x326f,0xd1));var _0xf326=function(_0x313ab2,_0x44ef88){_0x313ab2=_0x313ab2-0x0;var _0x120092=_0x326f[_0x313ab2];return _0x120092;};'use strict';var multer=require(_0xf326('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf326('0x1'));var express=require(_0xf326('0x2'));var router=express[_0xf326('0x3')]();var fs_extra=require(_0xf326('0x4'));var auth=require(_0xf326('0x5'));var interaction=require(_0xf326('0x6'));var config=require(_0xf326('0x7'));var controller=require(_0xf326('0x8'));router[_0xf326('0x9')]('/',auth[_0xf326('0xa')](),controller['index']);router[_0xf326('0x9')](_0xf326('0xb'),auth[_0xf326('0xa')](),controller[_0xf326('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xf326('0xd')]);router[_0xf326('0x9')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0xf')]);router['get'](_0xf326('0x10'),auth['isAuthenticated'](),controller[_0xf326('0x11')]);router['get'](_0xf326('0x12'),auth['isAuthenticated'](),controller[_0xf326('0x13')]);router[_0xf326('0x9')]('/:id/interactions',auth[_0xf326('0xa')](),controller[_0xf326('0x14')]);router[_0xf326('0x9')](_0xf326('0x15'),controller['statusGet']);router[_0xf326('0x9')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x16')]);router[_0xf326('0x17')]('/',auth[_0xf326('0xa')](),controller[_0xf326('0x18')]);router[_0xf326('0x17')](_0xf326('0xe'),auth[_0xf326('0xa')](),controller[_0xf326('0x19')]);router['post'](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x1a')]);router[_0xf326('0x17')](_0xf326('0x1b'),controller[_0xf326('0x1c')]);router['post']('/:id/applications',auth['isAuthenticated'](),controller[_0xf326('0x1d')]);router[_0xf326('0x17')]('/:id/send',auth['isAuthenticated'](),controller[_0xf326('0x1e')]);router['post']('/:id/status',controller[_0xf326('0x1f')]);router[_0xf326('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0xf326('0x20')]);router[_0xf326('0x21')]('/:id',auth[_0xf326('0xa')](),controller[_0xf326('0x22')]);router[_0xf326('0x23')](_0xf326('0x24'),auth[_0xf326('0xa')](),controller[_0xf326('0x25')]);router['delete']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xf326('0x26')]);router[_0xf326('0x23')](_0xf326('0x10'),auth[_0xf326('0xa')](),controller[_0xf326('0x27')]);router[_0xf326('0x23')]('/:id/users',auth[_0xf326('0xa')](),controller[_0xf326('0x28')]);module[_0xf326('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 15e1665..912683b 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 _0xbb34=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','setDataValue','sequelize','exports','STRING','name','ENUM','skebby','clicksend','clickatell','csc','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(_0x1c7bf5,_0x3ef5f5){var _0x500c82=function(_0x2509a1){while(--_0x2509a1){_0x1c7bf5['push'](_0x1c7bf5['shift']());}};_0x500c82(++_0x3ef5f5);}(_0xbb34,0x1b3));var _0x4bb3=function(_0xdfcfd1,_0x1ec03b){_0xdfcfd1=_0xdfcfd1-0x0;var _0x4e8035=_0xbb34[_0xdfcfd1];return _0x4e8035;};'use strict';var Sequelize=require(_0x4bb3('0x0'));var rs=require('randomstring');module[_0x4bb3('0x1')]={'name':{'type':Sequelize[_0x4bb3('0x2')],'unique':_0x4bb3('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x4bb3('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x4bb3('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x4bb3('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x4bb3('0x2')]},'type':{'type':Sequelize[_0x4bb3('0x4')]('twilio',_0x4bb3('0x5'),'connectel',_0x4bb3('0x6'),'plivo',_0x4bb3('0x7'),'bandwidth',_0x4bb3('0x8'),'infobip',_0x4bb3('0x9'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x4bb3('0x2')]},'authToken':{'type':Sequelize[_0x4bb3('0x2')]},'smsMethod':{'type':Sequelize[_0x4bb3('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0x4bb3('0x2')]},'password':{'type':Sequelize[_0x4bb3('0x2')]},'apiKey':{'type':Sequelize[_0x4bb3('0x2')]},'applicationId':{'type':Sequelize[_0x4bb3('0x2')]},'accountId':{'type':Sequelize[_0x4bb3('0x2')]},'senderString':{'type':Sequelize[_0x4bb3('0x2')]},'deliveryReport':{'type':Sequelize[_0x4bb3('0xa')],'defaultValue':![]},'description':{'type':Sequelize[_0x4bb3('0x2')]},'notificationTemplate':{'type':Sequelize[_0x4bb3('0xb')],'defaultValue':function(){return _0x4bb3('0xc');}},'notificationSound':{'type':Sequelize[_0x4bb3('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4bb3('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4bb3('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4bb3('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4bb3('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4bb3('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4bb3('0xd')],'comment':_0x4bb3('0xe')},'mandatoryDisposition':{'type':Sequelize[_0x4bb3('0xa')],'defaultValue':![],'comment':_0x4bb3('0xf'),'set':function(_0x137fc3){if(!_0x137fc3)this['setDataValue'](_0x4bb3('0x10'),null);this[_0x4bb3('0x11')]('mandatoryDisposition',_0x137fc3);}}}; \ No newline at end of file +var _0xc893=['skebby','clicksend','plivo','clickatell','bandwidth','csc','infobip','intelepeer','ENUM','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','name','generate','twilio'];(function(_0x38f77e,_0x4de736){var _0x4c654d=function(_0x3b7d0a){while(--_0x3b7d0a){_0x38f77e['push'](_0x38f77e['shift']());}};_0x4c654d(++_0x4de736);}(_0xc893,0x1aa));var _0x3c89=function(_0x142cdf,_0x8516c0){_0x142cdf=_0x142cdf-0x0;var _0x238b23=_0xc893[_0x142cdf];return _0x238b23;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x3c89('0x0'));module[_0x3c89('0x1')]={'name':{'type':Sequelize[_0x3c89('0x2')],'unique':_0x3c89('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x3c89('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x3c89('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x3c89('0x2')],'defaultValue':function(){return rs[_0x3c89('0x4')]();}},'phone':{'type':Sequelize[_0x3c89('0x2')]},'type':{'type':Sequelize['ENUM'](_0x3c89('0x5'),_0x3c89('0x6'),'connectel',_0x3c89('0x7'),_0x3c89('0x8'),_0x3c89('0x9'),_0x3c89('0xa'),_0x3c89('0xb'),_0x3c89('0xc'),_0x3c89('0xd'))},'accountSid':{'type':Sequelize[_0x3c89('0x2')]},'authId':{'type':Sequelize[_0x3c89('0x2')]},'authToken':{'type':Sequelize[_0x3c89('0x2')]},'smsMethod':{'type':Sequelize[_0x3c89('0xe')]('SI','TI','GP')},'username':{'type':Sequelize[_0x3c89('0x2')]},'password':{'type':Sequelize[_0x3c89('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x3c89('0x2')]},'accountId':{'type':Sequelize[_0x3c89('0x2')]},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x3c89('0x2')]},'notificationTemplate':{'type':Sequelize[_0x3c89('0xf')],'defaultValue':function(){return _0x3c89('0x10');}},'notificationSound':{'type':Sequelize[_0x3c89('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3c89('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3c89('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3c89('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x3c89('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x3c89('0x13')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x3c89('0x14'),'set':function(_0xc219f2){if(!_0xc219f2)this[_0x3c89('0x15')](_0x3c89('0x16'),null);this['setDataValue'](_0x3c89('0x17'),_0xc219f2);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 6f0d334..6564922 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 _0xd469=['getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','util','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./smsAccount.socket','register','jayson/promise','client','request','then','SmsAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','UserProfileResource','end','stack','name','send','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','SmsAccounts','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','addDisposition','SmsAccountId','Disposition','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','SmsApplication','account','applications','Applications','priority','asc','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','From','Body','messageId','MessageSid','skebby','from','sender','text','message_id','plivo','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','intelepeer','Sequelize','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ListId','CmContact','DESC','list','omit','Contacts','SmsInteraction','spread','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','UserId','unshift','agent','startRouting','Start','entity\x20found','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','Content-Type','text/xml','\x0a','sequelize','ISOLATION_LEVELS','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','List','out','Messages','dataValues','inspect','skebby_dispatch_id','statusInt','requestid','clicksend','status_code','groupName','redif','DELIVERED','SmsAccount,\x20%s,\x20%s,\x20%s','connectel','error_code','RECEIVED_BY_RECIPIENT','bandwidth','message-delivered','DELIVRD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','emit','userSmsAccount:save','isArray','userSmsAccount:remove'];(function(_0xfeddaf,_0xab5f9a){var _0x5b1150=function(_0x46d09d){while(--_0x46d09d){_0xfeddaf['push'](_0xfeddaf['shift']());}};_0x5b1150(++_0xab5f9a);}(_0xd469,0xe5));var _0x9d46=function(_0x5b4e9b,_0x3707a1){_0x5b4e9b=_0x5b4e9b-0x0;var _0x5b1ee4=_0xd469[_0x5b4e9b];return _0x5b1ee4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9d46('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9d46('0x1'));var rp=require(_0x9d46('0x2'));var moment=require(_0x9d46('0x3'));var BPromise=require(_0x9d46('0x4'));var Mustache=require('mustache');var util=require(_0x9d46('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x9d46('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9d46('0x7'));var _=require(_0x9d46('0x8'));var squel=require(_0x9d46('0x9'));var crypto=require(_0x9d46('0xa'));var jsforce=require(_0x9d46('0xb'));var deskjs=require(_0x9d46('0xc'));var toCsv=require(_0x9d46('0x6'));var querystring=require('querystring');var Papa=require(_0x9d46('0xd'));var Redis=require('ioredis');var authService=require(_0x9d46('0xe'));var qs=require(_0x9d46('0xf'));var as=require(_0x9d46('0x10'));var hardwareService=require(_0x9d46('0x11'));var logger=require('../../config/logger')(_0x9d46('0x12'));var utils=require(_0x9d46('0x13'));var config=require(_0x9d46('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9d46('0x15'))['db'];config['redis']=_[_0x9d46('0x16')](config['redis'],{'host':_0x9d46('0x17'),'port':0x18eb});var socket=require(_0x9d46('0x18'))(new Redis(config[_0x9d46('0x19')]));require(_0x9d46('0x1a'))[_0x9d46('0x1b')](socket);var jayson=require(_0x9d46('0x1c'));var client=jayson[_0x9d46('0x1d')]['http']({'port':0x232c});function respondWithRpcPromise(_0x347ee5,_0x41f8ff,_0xb3ec69,_0x3c5d41){return new BPromise(function(_0x48edc2,_0x5a7ffc){var _0x5e40d3=_0x3c5d41||client;return _0x5e40d3[_0x9d46('0x1e')](_0x347ee5,_0xb3ec69)[_0x9d46('0x1f')](function(_0x5b4520){logger['info'](_0x9d46('0x20'),_0x41f8ff,'request\x20sent');logger[_0x9d46('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x41f8ff,_0x9d46('0x22'),JSON[_0x9d46('0x23')](_0x5b4520));if(_0x5b4520[_0x9d46('0x24')]){if(_0x5b4520['error'][_0x9d46('0x25')]===0x1f4){logger[_0x9d46('0x24')](_0x9d46('0x20'),_0x41f8ff,_0x5b4520[_0x9d46('0x24')][_0x9d46('0x26')]);return _0x5a7ffc(_0x5b4520['error'][_0x9d46('0x26')]);}logger[_0x9d46('0x24')](_0x9d46('0x20'),_0x41f8ff,_0x5b4520[_0x9d46('0x24')][_0x9d46('0x26')]);return _0x48edc2(_0x5b4520[_0x9d46('0x24')]['message']);}else{logger[_0x9d46('0x27')](_0x9d46('0x20'),_0x41f8ff,_0x9d46('0x22'));_0x48edc2(_0x5b4520[_0x9d46('0x28')][_0x9d46('0x26')]);}})[_0x9d46('0x29')](function(_0xd232b){logger[_0x9d46('0x24')]('SmsAccount,\x20%s,\x20%s',_0x41f8ff,_0xd232b);_0x5a7ffc(_0xd232b);});});}function respondWithStatusCode(_0x398733,_0x5f3c9b){_0x5f3c9b=_0x5f3c9b||0xcc;return function(_0x386e18){if(_0x386e18){return _0x398733[_0x9d46('0x2a')](_0x5f3c9b);}return _0x398733[_0x9d46('0x2b')](_0x5f3c9b)['end']();};}function respondWithResult(_0x160c1b,_0x15b9a0){_0x15b9a0=_0x15b9a0||0xc8;return function(_0x43e66c){if(_0x43e66c){return _0x160c1b[_0x9d46('0x2b')](_0x15b9a0)[_0x9d46('0x2c')](_0x43e66c);}};}function respondWithFilteredResult(_0x14fa63,_0x16043b){return function(_0xca47e6){if(_0xca47e6){var _0x3cb939=typeof _0x16043b[_0x9d46('0x2d')]===_0x9d46('0x2e')&&typeof _0x16043b[_0x9d46('0x2f')]===_0x9d46('0x2e');var _0x1e9bad=_0xca47e6[_0x9d46('0x30')];var _0x526ea0=_0x3cb939?0x0:_0x16043b['offset'];var _0x40941b=_0x3cb939?_0xca47e6[_0x9d46('0x30')]:_0x16043b[_0x9d46('0x2d')]+_0x16043b[_0x9d46('0x2f')];var _0x458d8e;if(_0x40941b>=_0x1e9bad){_0x40941b=_0x1e9bad;_0x458d8e=0xc8;}else{_0x458d8e=0xce;}_0x14fa63[_0x9d46('0x2b')](_0x458d8e);return _0x14fa63[_0x9d46('0x31')](_0x9d46('0x32'),_0x526ea0+'-'+_0x40941b+'/'+_0x1e9bad)[_0x9d46('0x2c')](_0xca47e6);}return null;};}function patchUpdates(_0x6547be){return function(_0x325122){try{jsonpatch['apply'](_0x325122,_0x6547be,!![]);}catch(_0x129176){return BPromise[_0x9d46('0x33')](_0x129176);}return _0x325122[_0x9d46('0x34')]();};}function saveUpdates(_0x334ed3,_0x53a161){return function(_0x2e0050){if(_0x2e0050){return _0x2e0050[_0x9d46('0x35')](_0x334ed3)[_0x9d46('0x1f')](function(_0x5058e4){return _0x5058e4;});}return null;};}function removeEntity(_0x4bcef6,_0x58c13e){return function(_0x28bf4c){if(_0x28bf4c){return _0x28bf4c[_0x9d46('0x36')]()[_0x9d46('0x1f')](function(){var _0x361be9=_0x28bf4c[_0x9d46('0x37')]({'plain':!![]});var _0x342d38='SmsAccounts';return db[_0x9d46('0x38')][_0x9d46('0x36')]({'where':{'type':_0x342d38,'resourceId':_0x361be9['id']}})[_0x9d46('0x1f')](function(){return _0x28bf4c;});})['then'](function(){_0x4bcef6['status'](0xcc)[_0x9d46('0x39')]();});}};}function handleEntityNotFound(_0x1332c4,_0x1b3ae1){return function(_0x5a6940){if(!_0x5a6940){_0x1332c4[_0x9d46('0x2a')](0x194);}return _0x5a6940;};}function handleError(_0x31da0f,_0x2b9af8){_0x2b9af8=_0x2b9af8||0x1f4;return function(_0x35faa2){logger[_0x9d46('0x24')](_0x35faa2[_0x9d46('0x3a')]);if(_0x35faa2[_0x9d46('0x3b')]){delete _0x35faa2[_0x9d46('0x3b')];}_0x31da0f[_0x9d46('0x2b')](_0x2b9af8)[_0x9d46('0x3c')](_0x35faa2);};}exports[_0x9d46('0x3d')]=function(_0x2b67b9,_0x552298){var _0x2c8716={'include':[{'model':db[_0x9d46('0x3e')],'as':_0x9d46('0x3f')}]},_0x3a2051={},_0x10bb06={'count':0x0,'rows':[]};var _0x3b714c=_[_0x9d46('0x40')](db[_0x9d46('0x41')][_0x9d46('0x42')],function(_0x306ad0){return{'name':_0x306ad0['fieldName'],'type':_0x306ad0[_0x9d46('0x43')][_0x9d46('0x44')]};});_0x3a2051['model']=_[_0x9d46('0x40')](_0x3b714c,_0x9d46('0x3b'));_0x3a2051[_0x9d46('0x45')]=_[_0x9d46('0x46')](_0x2b67b9[_0x9d46('0x45')]);_0x3a2051['filters']=_[_0x9d46('0x47')](_0x3a2051[_0x9d46('0x48')],_0x3a2051['query']);_0x2c8716[_0x9d46('0x49')]=_['intersection'](_0x3a2051[_0x9d46('0x48')],qs[_0x9d46('0x4a')](_0x2b67b9[_0x9d46('0x45')][_0x9d46('0x4a')]));_0x2c8716[_0x9d46('0x49')]=_0x2c8716[_0x9d46('0x49')][_0x9d46('0x4b')]?_0x2c8716[_0x9d46('0x49')]:_0x3a2051[_0x9d46('0x48')];if(!_0x2b67b9[_0x9d46('0x45')][_0x9d46('0x4c')](_0x9d46('0x4d'))){_0x2c8716['limit']=qs[_0x9d46('0x2f')](_0x2b67b9[_0x9d46('0x45')]['limit']);_0x2c8716[_0x9d46('0x2d')]=qs[_0x9d46('0x2d')](_0x2b67b9[_0x9d46('0x45')]['offset']);}_0x2c8716[_0x9d46('0x4e')]=qs['sort'](_0x2b67b9[_0x9d46('0x45')][_0x9d46('0x4f')]);_0x2c8716[_0x9d46('0x50')]=qs['filters'](_[_0x9d46('0x51')](_0x2b67b9[_0x9d46('0x45')],_0x3a2051[_0x9d46('0x52')]),_0x3b714c);if(_0x2b67b9[_0x9d46('0x45')][_0x9d46('0x53')]){_0x2c8716['where']=_[_0x9d46('0x54')](_0x2c8716[_0x9d46('0x50')],{'$or':_[_0x9d46('0x40')](_0x3b714c,function(_0x1f540a){if(_0x1f540a['type']!==_0x9d46('0x55')){var _0xa085df={};_0xa085df[_0x1f540a[_0x9d46('0x3b')]]={'$like':'%'+_0x2b67b9[_0x9d46('0x45')][_0x9d46('0x53')]+'%'};return _0xa085df;}})});}_0x2c8716=_['merge']({},_0x2c8716,_0x2b67b9[_0x9d46('0x56')]);var _0x2958b2={'where':_0x2c8716[_0x9d46('0x50')]};return db[_0x9d46('0x41')]['count'](_0x2958b2)[_0x9d46('0x1f')](function(_0x78bbb5){_0x10bb06[_0x9d46('0x30')]=_0x78bbb5;if(_0x2b67b9[_0x9d46('0x45')][_0x9d46('0x57')]){_0x2c8716[_0x9d46('0x58')]=[{'all':!![]}];}return db[_0x9d46('0x41')][_0x9d46('0x59')](_0x2c8716);})['then'](function(_0x95b4d3){_0x10bb06[_0x9d46('0x5a')]=_0x95b4d3;return _0x10bb06;})['then'](respondWithFilteredResult(_0x552298,_0x2c8716))[_0x9d46('0x29')](handleError(_0x552298,null));};exports['show']=function(_0x364eb6,_0x519718){var _0x10ec1a={'raw':![],'where':{'id':_0x364eb6[_0x9d46('0x5b')]['id']},'include':[{'model':db[_0x9d46('0x3e')],'as':_0x9d46('0x3f')}]},_0x5b620c={};_0x5b620c[_0x9d46('0x48')]=_[_0x9d46('0x46')](db[_0x9d46('0x41')]['rawAttributes']);_0x5b620c[_0x9d46('0x45')]=_[_0x9d46('0x46')](_0x364eb6['query']);_0x5b620c['filters']=_[_0x9d46('0x47')](_0x5b620c['model'],_0x5b620c[_0x9d46('0x45')]);_0x10ec1a[_0x9d46('0x49')]=_[_0x9d46('0x47')](_0x5b620c[_0x9d46('0x48')],qs[_0x9d46('0x4a')](_0x364eb6[_0x9d46('0x45')][_0x9d46('0x4a')]));_0x10ec1a[_0x9d46('0x49')]=_0x10ec1a['attributes'][_0x9d46('0x4b')]?_0x10ec1a[_0x9d46('0x49')]:_0x5b620c[_0x9d46('0x48')];if(_0x364eb6[_0x9d46('0x45')]['includeAll']){_0x10ec1a[_0x9d46('0x58')]=[{'all':!![]}];}_0x10ec1a=_[_0x9d46('0x54')]({},_0x10ec1a,_0x364eb6['options']);return db['SmsAccount']['find'](_0x10ec1a)[_0x9d46('0x1f')](handleEntityNotFound(_0x519718,null))['then'](respondWithResult(_0x519718,null))[_0x9d46('0x29')](handleError(_0x519718,null));};exports[_0x9d46('0x5c')]=function(_0x2d9d46,_0x45ad77){return db[_0x9d46('0x41')][_0x9d46('0x5c')](_0x2d9d46[_0x9d46('0x5d')],{})['then'](function(_0x357628){var _0x273908=_0x2d9d46[_0x9d46('0x5e')]['get']({'plain':!![]});if(!_0x273908)throw new Error(_0x9d46('0x5f'));if(_0x273908['role']==='user'){var _0x4dec4a=_0x357628['get']({'plain':!![]});var _0x3e0268=_0x9d46('0x60');return db[_0x9d46('0x61')]['find']({'where':{'name':_0x3e0268,'userProfileId':_0x273908[_0x9d46('0x62')]},'raw':!![]})[_0x9d46('0x1f')](function(_0x1faee9){if(_0x1faee9&&_0x1faee9['autoAssociation']===0x0){return db[_0x9d46('0x38')][_0x9d46('0x5c')]({'name':_0x4dec4a[_0x9d46('0x3b')],'resourceId':_0x4dec4a['id'],'type':_0x1faee9[_0x9d46('0x3b')],'sectionId':_0x1faee9['id']},{})[_0x9d46('0x1f')](function(){return _0x357628;});}else{return _0x357628;}})[_0x9d46('0x29')](function(_0x3a11ce){logger[_0x9d46('0x24')](_0x9d46('0x63'),_0x3a11ce);throw _0x3a11ce;});}return _0x357628;})[_0x9d46('0x1f')](respondWithResult(_0x45ad77,0xc9))['catch'](handleError(_0x45ad77,null));};exports[_0x9d46('0x35')]=function(_0x554096,_0x2e6876){if(_0x554096[_0x9d46('0x5d')]['id']){delete _0x554096[_0x9d46('0x5d')]['id'];}return db['SmsAccount'][_0x9d46('0x64')]({'where':{'id':_0x554096['params']['id']},'include':[{'model':db[_0x9d46('0x3e')],'as':_0x9d46('0x3f')}]})[_0x9d46('0x1f')](handleEntityNotFound(_0x2e6876,null))[_0x9d46('0x1f')](saveUpdates(_0x554096[_0x9d46('0x5d')],null))[_0x9d46('0x1f')](respondWithResult(_0x2e6876,null))['catch'](handleError(_0x2e6876,null));};exports[_0x9d46('0x36')]=function(_0xd9a94,_0x550074){return db['SmsAccount'][_0x9d46('0x64')]({'where':{'id':_0xd9a94[_0x9d46('0x5b')]['id']}})[_0x9d46('0x1f')](handleEntityNotFound(_0x550074,null))[_0x9d46('0x1f')](removeEntity(_0x550074,null))['catch'](handleError(_0x550074,null));};exports['describe']=function(_0x43c49a,_0x1f4ba4){return db[_0x9d46('0x41')][_0x9d46('0x65')]()['then'](respondWithResult(_0x1f4ba4,null))[_0x9d46('0x29')](handleError(_0x1f4ba4,null));};exports[_0x9d46('0x66')]=function(_0x5b01fa,_0x1fe090,_0x4e878e){if(_0x5b01fa[_0x9d46('0x5d')]['id']){delete _0x5b01fa['body']['id'];}return db['SmsAccount']['find']({'where':{'id':_0x5b01fa['params']['id']}})[_0x9d46('0x1f')](handleEntityNotFound(_0x1fe090,null))['then'](function(_0x5150dd){if(_0x5150dd){_0x5b01fa[_0x9d46('0x5d')][_0x9d46('0x67')]=_0x5150dd['id'];return db[_0x9d46('0x68')]['create'](_0x5b01fa[_0x9d46('0x5d')]);}})['then'](respondWithResult(_0x1fe090,null))[_0x9d46('0x29')](handleError(_0x1fe090,null));};exports['getDispositions']=function(_0x287d7f,_0x55a72c,_0xf4da0){var _0x2133a2={'raw':![],'where':{}};var _0x2e2c1a={};var _0x1cabb6={'count':0x0,'rows':[]};return db['SmsAccount'][_0x9d46('0x69')]({'where':{'id':_0x287d7f['params']['id']}})[_0x9d46('0x1f')](handleEntityNotFound(_0x55a72c,null))[_0x9d46('0x1f')](function(_0x274afa){if(_0x274afa){_0x2e2c1a['model']=_['keys'](db[_0x9d46('0x68')][_0x9d46('0x42')]);_0x2e2c1a[_0x9d46('0x45')]=_[_0x9d46('0x46')](_0x287d7f['query']);_0x2e2c1a['filters']=_[_0x9d46('0x47')](_0x2e2c1a[_0x9d46('0x48')],_0x2e2c1a[_0x9d46('0x45')]);_0x2133a2[_0x9d46('0x49')]=_['intersection'](_0x2e2c1a[_0x9d46('0x48')],qs[_0x9d46('0x4a')](_0x287d7f[_0x9d46('0x45')][_0x9d46('0x4a')]));_0x2133a2[_0x9d46('0x49')]=_0x2133a2[_0x9d46('0x49')][_0x9d46('0x4b')]?_0x2133a2['attributes']:_0x2e2c1a[_0x9d46('0x48')];if(!_0x287d7f[_0x9d46('0x45')][_0x9d46('0x4c')](_0x9d46('0x4d'))){_0x2133a2['limit']=qs['limit'](_0x287d7f[_0x9d46('0x45')][_0x9d46('0x2f')]);_0x2133a2[_0x9d46('0x2d')]=qs[_0x9d46('0x2d')](_0x287d7f[_0x9d46('0x45')][_0x9d46('0x2d')]);}_0x2133a2['order']=qs['sort'](_0x287d7f[_0x9d46('0x45')][_0x9d46('0x4f')]);_0x2133a2[_0x9d46('0x50')]=qs[_0x9d46('0x52')](_['pick'](_0x287d7f[_0x9d46('0x45')],_0x2e2c1a[_0x9d46('0x52')]));_0x2133a2[_0x9d46('0x50')][_0x9d46('0x67')]=_0x274afa['id'];if(_0x287d7f['query'][_0x9d46('0x53')]){_0x2133a2[_0x9d46('0x50')]=_[_0x9d46('0x54')](_0x2133a2[_0x9d46('0x50')],{'$or':_[_0x9d46('0x40')](_0x2133a2[_0x9d46('0x49')],function(_0x4a100f){var _0x4086c1={};_0x4086c1[_0x4a100f]={'$like':'%'+_0x287d7f[_0x9d46('0x45')][_0x9d46('0x53')]+'%'};return _0x4086c1;})});}_0x2133a2=_['merge']({},_0x2133a2,_0x287d7f[_0x9d46('0x56')]);return db[_0x9d46('0x68')][_0x9d46('0x30')]({'where':_0x2133a2[_0x9d46('0x50')]})['then'](function(_0x4754c2){_0x1cabb6[_0x9d46('0x30')]=_0x4754c2;if(_0x287d7f['query'][_0x9d46('0x57')]){_0x2133a2['include']=[{'all':!![]}];}return db['Disposition'][_0x9d46('0x59')](_0x2133a2);})[_0x9d46('0x1f')](function(_0x2ff3ed){_0x1cabb6[_0x9d46('0x5a')]=_0x2ff3ed;return _0x1cabb6;});}})['then'](respondWithFilteredResult(_0x55a72c,_0x2133a2))[_0x9d46('0x29')](handleError(_0x55a72c,null));};exports[_0x9d46('0x6a')]=function(_0x5ba9a4,_0x20ea3b,_0x55cc64){return db[_0x9d46('0x41')][_0x9d46('0x64')]({'where':{'id':_0x5ba9a4[_0x9d46('0x5b')]['id']}})[_0x9d46('0x1f')](handleEntityNotFound(_0x20ea3b,null))[_0x9d46('0x1f')](function(_0x32bf75){if(_0x32bf75){return _0x32bf75[_0x9d46('0x6a')](_0x5ba9a4[_0x9d46('0x45')][_0x9d46('0x6b')]);}})[_0x9d46('0x1f')](respondWithStatusCode(_0x20ea3b,null))[_0x9d46('0x29')](handleError(_0x20ea3b,null));};exports[_0x9d46('0x6c')]=function(_0xdd1d0b,_0x2f222d,_0x5491f9){if(_0xdd1d0b[_0x9d46('0x5d')]['id']){delete _0xdd1d0b[_0x9d46('0x5d')]['id'];}return db[_0x9d46('0x41')][_0x9d46('0x64')]({'where':{'id':_0xdd1d0b[_0x9d46('0x5b')]['id']}})[_0x9d46('0x1f')](handleEntityNotFound(_0x2f222d,null))[_0x9d46('0x1f')](function(_0x43713d){if(_0x43713d){_0xdd1d0b[_0x9d46('0x5d')][_0x9d46('0x67')]=_0x43713d['id'];return db[_0x9d46('0x6d')][_0x9d46('0x5c')](_0xdd1d0b[_0x9d46('0x5d')]);}})[_0x9d46('0x1f')](respondWithResult(_0x2f222d,null))['catch'](handleError(_0x2f222d,null));};exports[_0x9d46('0x6e')]=function(_0xc48405,_0x40c5e2,_0x4e00bd){var _0x1fa9be={'raw':![],'where':{}};var _0x3c7d95={};var _0x5873f0={'count':0x0,'rows':[]};return db[_0x9d46('0x41')][_0x9d46('0x69')]({'where':{'id':_0xc48405[_0x9d46('0x5b')]['id']}})[_0x9d46('0x1f')](handleEntityNotFound(_0x40c5e2,null))[_0x9d46('0x1f')](function(_0x236d91){if(_0x236d91){_0x3c7d95[_0x9d46('0x48')]=_[_0x9d46('0x46')](db[_0x9d46('0x6d')][_0x9d46('0x42')]);_0x3c7d95['query']=_['keys'](_0xc48405[_0x9d46('0x45')]);_0x3c7d95[_0x9d46('0x52')]=_[_0x9d46('0x47')](_0x3c7d95[_0x9d46('0x48')],_0x3c7d95[_0x9d46('0x45')]);_0x1fa9be[_0x9d46('0x49')]=_[_0x9d46('0x47')](_0x3c7d95['model'],qs[_0x9d46('0x4a')](_0xc48405[_0x9d46('0x45')][_0x9d46('0x4a')]));_0x1fa9be[_0x9d46('0x49')]=_0x1fa9be[_0x9d46('0x49')]['length']?_0x1fa9be[_0x9d46('0x49')]:_0x3c7d95[_0x9d46('0x48')];if(!_0xc48405[_0x9d46('0x45')][_0x9d46('0x4c')](_0x9d46('0x4d'))){_0x1fa9be[_0x9d46('0x2f')]=qs[_0x9d46('0x2f')](_0xc48405[_0x9d46('0x45')]['limit']);_0x1fa9be[_0x9d46('0x2d')]=qs['offset'](_0xc48405['query'][_0x9d46('0x2d')]);}_0x1fa9be[_0x9d46('0x4e')]=qs['sort'](_0xc48405[_0x9d46('0x45')][_0x9d46('0x4f')]);_0x1fa9be[_0x9d46('0x50')]=qs[_0x9d46('0x52')](_[_0x9d46('0x51')](_0xc48405[_0x9d46('0x45')],_0x3c7d95[_0x9d46('0x52')]));_0x1fa9be['where'][_0x9d46('0x67')]=_0x236d91['id'];if(_0xc48405['query']['filter']){_0x1fa9be[_0x9d46('0x50')]=_[_0x9d46('0x54')](_0x1fa9be[_0x9d46('0x50')],{'$or':_[_0x9d46('0x40')](_0x1fa9be[_0x9d46('0x49')],function(_0x131d0a){var _0x4b3b37={};_0x4b3b37[_0x131d0a]={'$like':'%'+_0xc48405[_0x9d46('0x45')][_0x9d46('0x53')]+'%'};return _0x4b3b37;})});}_0x1fa9be=_[_0x9d46('0x54')]({},_0x1fa9be,_0xc48405[_0x9d46('0x56')]);return db[_0x9d46('0x6d')][_0x9d46('0x30')]({'where':_0x1fa9be['where']})[_0x9d46('0x1f')](function(_0x5ebd5f){_0x5873f0['count']=_0x5ebd5f;if(_0xc48405['query']['includeAll']){_0x1fa9be[_0x9d46('0x58')]=[{'all':!![]}];}return db[_0x9d46('0x6d')][_0x9d46('0x59')](_0x1fa9be);})[_0x9d46('0x1f')](function(_0x8e6531){_0x5873f0[_0x9d46('0x5a')]=_0x8e6531;return _0x5873f0;});}})[_0x9d46('0x1f')](respondWithFilteredResult(_0x40c5e2,_0x1fa9be))[_0x9d46('0x29')](handleError(_0x40c5e2,null));};exports[_0x9d46('0x6f')]=function(_0x4c0e4a,_0x48c6ce,_0x34be2b){return db[_0x9d46('0x41')][_0x9d46('0x64')]({'where':{'id':_0x4c0e4a[_0x9d46('0x5b')]['id']}})['then'](handleEntityNotFound(_0x48c6ce,null))[_0x9d46('0x1f')](function(_0x183088){if(_0x183088){return _0x183088['removeAnswers'](_0x4c0e4a[_0x9d46('0x45')][_0x9d46('0x6b')]);}})[_0x9d46('0x1f')](respondWithStatusCode(_0x48c6ce,null))[_0x9d46('0x29')](handleError(_0x48c6ce,null));};exports[_0x9d46('0x70')]=function(_0x32d59a,_0x1cce9b,_0x37b425){var _0x54ddfb={'channel':'sms'};var _0x2bde1d=[];var _0x5f3d08=[];var _0x455be9={};return db['SmsAccount'][_0x9d46('0x64')]({'where':{'id':_0x32d59a[_0x9d46('0x5b')]['id']},'include':[{'model':db[_0x9d46('0x71')],'as':'Applications'}]})[_0x9d46('0x1f')](handleEntityNotFound(_0x1cce9b,null))['then'](function(_0x56ca75){_0x54ddfb[_0x9d46('0x72')]=_0x56ca75;_0x54ddfb[_0x9d46('0x73')]=_['orderBy'](_0x56ca75[_0x9d46('0x74')],[_0x9d46('0x75')],[_0x9d46('0x76')]);if(_0x54ddfb[_0x9d46('0x72')]['Applications']){delete _0x54ddfb['account'][_0x9d46('0x74')];}return db['CmContact'][_0x9d46('0x65')]();})[_0x9d46('0x1f')](function(_0x5e1e25){if(!_0x5e1e25){throw new db['Sequelize'][(_0x9d46('0x77'))](_0x9d46('0x78'));}_0x2bde1d=_[_0x9d46('0x79')](_[_0x9d46('0x46')](_0x5e1e25),['createdAt',_0x9d46('0x7a')]);_0x5f3d08=_['difference'](_[_0x9d46('0x46')](_0x5e1e25),['createdAt',_0x9d46('0x7a'),_0x9d46('0x7b'),'ListId']);_0x54ddfb[_0x9d46('0x5d')]={'mapKey':'mobile'};if(_0x54ddfb[_0x9d46('0x72')]['type']){switch(_0x54ddfb[_0x9d46('0x72')][_0x9d46('0x43')]){case'twilio':_0x54ddfb[_0x9d46('0x5d')]['from']=_0x32d59a[_0x9d46('0x5d')][_0x9d46('0x7c')];_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x5d')]=_0x32d59a[_0x9d46('0x5d')][_0x9d46('0x7d')];_0x54ddfb['body'][_0x9d46('0x7e')]=_0x32d59a['body'][_0x9d46('0x7f')];break;case _0x9d46('0x80'):_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x81')]='+'+_0x32d59a[_0x9d46('0x5d')][_0x9d46('0x82')];_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x5d')]=_0x32d59a[_0x9d46('0x5d')][_0x9d46('0x83')];break;case'connectel':_0x54ddfb[_0x9d46('0x5d')]['from']=_0x32d59a[_0x9d46('0x5d')][_0x9d46('0x81')];_0x54ddfb['body']['body']=_0x32d59a[_0x9d46('0x5d')][_0x9d46('0x26')];break;case'clicksend':_0x54ddfb['body'][_0x9d46('0x81')]=_0x32d59a[_0x9d46('0x5d')][_0x9d46('0x81')];_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x5d')]=_0x32d59a[_0x9d46('0x5d')][_0x9d46('0x5d')];_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x7e')]=_0x32d59a[_0x9d46('0x5d')][_0x9d46('0x84')];break;case _0x9d46('0x85'):_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x81')]=_0x32d59a[_0x9d46('0x5d')]['From'];_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x5d')]=_0x32d59a[_0x9d46('0x5d')][_0x9d46('0x86')];_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x7e')]=_0x32d59a[_0x9d46('0x5d')][_0x9d46('0x87')];break;case _0x9d46('0x88'):_0x54ddfb['body'][_0x9d46('0x81')]='+'+_0x32d59a[_0x9d46('0x5d')][_0x9d46('0x89')][0x0][_0x9d46('0x81')];_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x5d')]=_0x32d59a[_0x9d46('0x5d')]['results'][0x0][_0x9d46('0x83')];_0x54ddfb[_0x9d46('0x5d')]['messageId']=_0x32d59a[_0x9d46('0x5d')][_0x9d46('0x89')][0x0][_0x9d46('0x7e')];break;case _0x9d46('0x8a'):_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x81')]=_0x32d59a[_0x9d46('0x5d')][_0x9d46('0x8b')];_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x5d')]=_0x32d59a[_0x9d46('0x5d')][_0x9d46('0x8c')]['message'];break;case _0x9d46('0x8d'):_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x81')]=_0x32d59a[_0x9d46('0x5d')]['fromNumber'];_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x5d')]=_0x32d59a[_0x9d46('0x5d')]['text'];_0x54ddfb['body'][_0x9d46('0x7e')]=_0x32d59a[_0x9d46('0x5d')][_0x9d46('0x8e')];break;case'bandwidth':_0x54ddfb['body']['messageId']=_0x32d59a[_0x9d46('0x5d')][0x0][_0x9d46('0x26')]['id'];_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x81')]=_0x32d59a[_0x9d46('0x5d')][0x0][_0x9d46('0x26')][_0x9d46('0x81')];_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x5d')]=_0x32d59a[_0x9d46('0x5d')][0x0]['message'][_0x9d46('0x83')];break;case _0x9d46('0x8f'):_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x81')]=_0x32d59a['body'][_0x9d46('0x81')];_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x5d')]=_0x32d59a[_0x9d46('0x5d')][_0x9d46('0x26')];_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x7e')]=_0x32d59a[_0x9d46('0x5d')]['refid'];break;}}if(_0x54ddfb[_0x9d46('0x5d')]['id']){delete _0x54ddfb['body']['id'];}if(_['isNil'](_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x81')])){throw new db[(_0x9d46('0x90'))][(_0x9d46('0x77'))](_0x9d46('0x91'));}if(_[_0x9d46('0x92')](_0x54ddfb[_0x9d46('0x5d')]['body'])||_0x54ddfb['body'][_0x9d46('0x5d')]===''){throw new db['Sequelize'][(_0x9d46('0x77'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x54ddfb['body'][_0x9d46('0x93')])){throw new db[(_0x9d46('0x90'))][(_0x9d46('0x77'))](_0x9d46('0x94')+_0x5f3d08);}if(!_[_0x9d46('0x95')](_0x5f3d08,_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x93')])){throw new db[(_0x9d46('0x90'))][(_0x9d46('0x77'))](_0x9d46('0x96')+_0x5f3d08);}_0x455be9[_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x93')]]=_0x54ddfb[_0x9d46('0x5d')]['from'];return db[_0x9d46('0x97')][_0x9d46('0x64')]({'where':{'id':_0x54ddfb['account'][_0x9d46('0x98')]},'include':[{'model':db[_0x9d46('0x99')],'as':'Contacts','where':_0x455be9,'limit':0x1,'order':[[_0x9d46('0x7a'),_0x9d46('0x9a')]]}]});})[_0x9d46('0x1f')](handleEntityNotFound(_0x1cce9b,null))['then'](function(_0x11014e){if(_0x11014e){_0x54ddfb[_0x9d46('0x9b')]=_[_0x9d46('0x9c')](_0x11014e,['Contacts']);if(_0x11014e['Contacts'][_0x9d46('0x4b')]){return _0x11014e[_0x9d46('0x9d')][0x0];}var _0x5f30a7=_[_0x9d46('0x16')](_0x54ddfb['body'],{'firstName':_0x54ddfb['body'][_0x9d46('0x81')],'ListId':_0x11014e['id']});_0x5f30a7[_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x93')]]=_0x54ddfb['body'][_0x9d46('0x81')];return db[_0x9d46('0x99')][_0x9d46('0x5c')](_0x5f30a7,{'fields':_0x2bde1d,'raw':!![]});}})[_0x9d46('0x1f')](handleEntityNotFound(_0x1cce9b,null))[_0x9d46('0x1f')](function(_0x4503e3){if(_0x4503e3){_0x54ddfb['contact']=_0x4503e3;var _0x18523b={'ContactId':_0x4503e3['id'],'phone':_0x54ddfb[_0x9d46('0x5d')]['from'],'SmsAccountId':_0x32d59a['params']['id']};var _0x57b90d={'ContactId':_0x4503e3['id'],'SmsAccountId':_0x32d59a['params']['id'],'closed':![]};return db['SmsInteraction'][_0x9d46('0x64')]({'where':_0x57b90d})[_0x9d46('0x1f')](function(_0x356eb9){if(_0x356eb9){return[_0x356eb9,![]];}return db[_0x9d46('0x9e')][_0x9d46('0x5c')](_0x18523b)[_0x9d46('0x1f')](function(_0x285416){return[_0x285416,!![]];});});}})[_0x9d46('0x9f')](function(_0xb25d2,_0x50138e){_0x54ddfb[_0x9d46('0xa0')]=_0xb25d2[_0x9d46('0x37')]({'plain':!![]});_0x54ddfb['interaction']['created']=![];if(_0x50138e){if(_0x54ddfb[_0x9d46('0x72')][_0x9d46('0xa1')]){_0x54ddfb[_0x9d46('0x73')][_0x9d46('0xa2')]({'id':0x0,'priority':_0x54ddfb[_0x9d46('0x73')]['length']+0x1,'app':_0x9d46('0xa3'),'appdata':_0x9d46('0xa4'),'interval':_0x9d46('0xa5')});}_0x54ddfb[_0x9d46('0xa0')][_0x9d46('0xa6')]=!![];}return db[_0x9d46('0xa7')][_0x9d46('0x5c')]({'phone':_0x54ddfb['body'][_0x9d46('0x81')],'messageId':_0x54ddfb[_0x9d46('0x5d')]['messageId'],'body':_0x54ddfb[_0x9d46('0x5d')][_0x9d46('0x5d')],'SmsAccountId':_0x32d59a[_0x9d46('0x5b')]['id'],'SmsInteractionId':_0xb25d2['id'],'direction':'in','ContactId':_0xb25d2[_0x9d46('0xa8')],'AttachmentId':_0x54ddfb['body'][_0x9d46('0xa9')]});})[_0x9d46('0x1f')](function(_0x410e78){_0x54ddfb['message']=_0x410e78;if(_0x54ddfb[_0x9d46('0xa0')][_0x9d46('0xaa')]){return db['User'][_0x9d46('0x64')]({'attributes':['id',_0x9d46('0x3b')],'where':{'id':_0x54ddfb[_0x9d46('0xa0')][_0x9d46('0xaa')]}})['then'](function(_0x106420){if(_0x106420){_0x54ddfb[_0x9d46('0x73')][_0x9d46('0xab')]({'id':0x0,'priority':0x0,'app':_0x9d46('0xac'),'appdata':_0x106420[_0x9d46('0x3b')]+','+(_0x54ddfb[_0x9d46('0x72')]['waitForTheAssignedAgent']||0xa),'interval':_0x9d46('0xa5')});}return respondWithRpcPromise('Start',_0x9d46('0xad'),_0x54ddfb);});}return respondWithRpcPromise(_0x9d46('0xae'),'startRouting',_0x54ddfb);})[_0x9d46('0x1f')](function(_0x25e933){if(_0x25e933){var _0x4e1e6f=0xc8;var _0x5c9ffe='receiveMessage';logger[_0x9d46('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5c9ffe,_0x4e1e6f,_0x9d46('0xaf'));logger[_0x9d46('0x21')](_0x9d46('0xb0'),_0x5c9ffe,_0x4e1e6f,'entity\x20found',JSON[_0x9d46('0x23')](_0x25e933));if(_0x54ddfb[_0x9d46('0x72')][_0x9d46('0x43')]===_0x9d46('0xb1')){return _0x1cce9b[_0x9d46('0x2b')](_0x4e1e6f)[_0x9d46('0x31')](_0x9d46('0xb2'),_0x9d46('0xb3'))[_0x9d46('0x3c')](_0x9d46('0xb4'));}else{return _0x1cce9b['status'](_0x4e1e6f)['json'](_0x25e933);}}})[_0x9d46('0x29')](handleError(_0x1cce9b,null));};exports['addApplications']=function(_0x5654c1,_0x3623f8){var _0x1965fe=_0x5654c1[_0x9d46('0x5b')]['id'];var _0x1f30ea=_0x5654c1[_0x9d46('0x5d')];var _0x2ccfc4=0xc8;var _0x596d2a=null;return db['sequelize']['transaction']({'isolationLevel':db[_0x9d46('0xb5')]['Transaction'][_0x9d46('0xb6')]['READ_COMMITTED']},function(_0x52d2c4){return db[_0x9d46('0x41')]['findOne']({'where':{'id':_0x1965fe},'transaction':_0x52d2c4})[_0x9d46('0x1f')](function(_0x2e7748){if(_0x2e7748){return db[_0x9d46('0x71')][_0x9d46('0x36')]({'where':{'SmsAccountId':_0x1965fe},'transaction':_0x52d2c4})[_0x9d46('0x1f')](function(){var _0x534f77=_['map'](_0x1f30ea,function(_0x57c0e6){_0x57c0e6[_0x9d46('0x67')]=_0x1965fe;return _0x57c0e6;});return db[_0x9d46('0x71')][_0x9d46('0xb7')](_0x534f77,{'transaction':_0x52d2c4});});}else{_0x2ccfc4=0x194;_0x596d2a=[];}});})[_0x9d46('0x1f')](function(){if(_0x2ccfc4!==0x194){return db[_0x9d46('0x71')][_0x9d46('0xb8')]({'where':{'SmsAccountId':_0x1965fe},'order':_0x9d46('0x75')})[_0x9d46('0x1f')](function(_0xf9610b){_0x596d2a=_0xf9610b;});}})[_0x9d46('0x29')](function(_0x38794b){_0x2ccfc4=0x1f4;logger[_0x9d46('0x24')](_0x38794b[_0x9d46('0x3a')]);if(_0x38794b['name']){delete _0x38794b[_0x9d46('0x3b')];}_0x596d2a=_0x38794b;})[_0x9d46('0xb9')](function(){if(_0x596d2a===null){_0x3623f8[_0x9d46('0x2a')](_0x2ccfc4);}else{if(_0x2ccfc4===0x1f4){_0x3623f8[_0x9d46('0x2b')](_0x2ccfc4)[_0x9d46('0x3c')](_0x596d2a);}else{_0x3623f8[_0x9d46('0x2b')](_0x2ccfc4)['json'](_0x596d2a);}}});};exports[_0x9d46('0xba')]=function(_0x38dd1a,_0x33b253,_0x24cce3){var _0x2d3e26={};var _0x52cce6={};var _0x1f42aa;var _0x33da10;return db['SmsAccount'][_0x9d46('0x69')]({'where':{'id':_0x38dd1a[_0x9d46('0x5b')]['id']}})['then'](handleEntityNotFound(_0x33b253,null))[_0x9d46('0x1f')](function(_0x2aeead){if(_0x2aeead){_0x1f42aa=_0x2aeead;_0x52cce6['model']=_[_0x9d46('0x46')](db[_0x9d46('0x71')][_0x9d46('0x42')]);_0x52cce6[_0x9d46('0x45')]=_[_0x9d46('0x46')](_0x38dd1a[_0x9d46('0x45')]);_0x52cce6[_0x9d46('0x52')]=_[_0x9d46('0x47')](_0x52cce6[_0x9d46('0x48')],_0x52cce6['query']);_0x2d3e26[_0x9d46('0x49')]=_[_0x9d46('0x47')](_0x52cce6[_0x9d46('0x48')],qs[_0x9d46('0x4a')](_0x38dd1a[_0x9d46('0x45')][_0x9d46('0x4a')]));_0x2d3e26[_0x9d46('0x49')]=_0x2d3e26[_0x9d46('0x49')][_0x9d46('0x4b')]?_0x2d3e26[_0x9d46('0x49')]:_0x52cce6[_0x9d46('0x48')];_0x2d3e26[_0x9d46('0x4e')]=qs['sort'](_0x38dd1a[_0x9d46('0x45')][_0x9d46('0x4f')]);_0x2d3e26[_0x9d46('0x50')]=qs['filters'](_['pick'](_0x38dd1a['query'],_0x52cce6[_0x9d46('0x52')]));if(_0x38dd1a[_0x9d46('0x45')]['filter']){_0x2d3e26[_0x9d46('0x50')]=_[_0x9d46('0x54')](_0x2d3e26[_0x9d46('0x50')],{'$or':_[_0x9d46('0x40')](_0x2d3e26[_0x9d46('0x49')],function(_0x251ded){var _0x528169={};_0x528169[_0x251ded]={'$like':'%'+_0x38dd1a[_0x9d46('0x45')][_0x9d46('0x53')]+'%'};return _0x528169;})});}_0x2d3e26=_[_0x9d46('0x54')]({},_0x2d3e26,_0x38dd1a['options']);return _0x1f42aa[_0x9d46('0xba')](_0x2d3e26);}})[_0x9d46('0x1f')](function(_0x34e418){if(_0x34e418){_0x33da10=_0x34e418['length'];if(!_0x38dd1a['query']['hasOwnProperty'](_0x9d46('0x4d'))){_0x2d3e26[_0x9d46('0x2f')]=qs[_0x9d46('0x2f')](_0x38dd1a[_0x9d46('0x45')]['limit']);_0x2d3e26[_0x9d46('0x2d')]=qs[_0x9d46('0x2d')](_0x38dd1a[_0x9d46('0x45')][_0x9d46('0x2d')]);}return _0x1f42aa['getApplications'](_0x2d3e26);}})[_0x9d46('0x1f')](function(_0x10ec0a){if(_0x10ec0a){return _0x10ec0a?{'count':_0x33da10,'rows':_0x10ec0a}:null;}})[_0x9d46('0x1f')](respondWithResult(_0x33b253,null))[_0x9d46('0x29')](handleError(_0x33b253,null));};exports[_0x9d46('0xbb')]=function(_0x12a6f4,_0x4d54f8,_0x265b53){var _0x41ca76={'raw':![],'where':{}};var _0x58659f={};var _0x272e80={'count':0x0,'rows':[]};return db[_0x9d46('0x41')][_0x9d46('0x69')]({'where':{'id':_0x12a6f4[_0x9d46('0x5b')]['id']}})[_0x9d46('0x1f')](handleEntityNotFound(_0x4d54f8,null))['then'](function(_0x7f0092){if(_0x7f0092){_0x58659f[_0x9d46('0x48')]=_['keys'](db['SmsInteraction'][_0x9d46('0x42')]);_0x58659f[_0x9d46('0x45')]=_[_0x9d46('0x46')](_0x12a6f4[_0x9d46('0x45')]);_0x58659f[_0x9d46('0x52')]=_['intersection'](_0x58659f[_0x9d46('0x48')],_0x58659f[_0x9d46('0x45')]);_0x41ca76['attributes']=_[_0x9d46('0x47')](_0x58659f[_0x9d46('0x48')],qs[_0x9d46('0x4a')](_0x12a6f4['query'][_0x9d46('0x4a')]));_0x41ca76[_0x9d46('0x49')]=_0x41ca76[_0x9d46('0x49')][_0x9d46('0x4b')]?_0x41ca76[_0x9d46('0x49')]:_0x58659f[_0x9d46('0x48')];if(!_0x12a6f4[_0x9d46('0x45')][_0x9d46('0x4c')]('nolimit')){_0x41ca76['limit']=qs['limit'](_0x12a6f4[_0x9d46('0x45')][_0x9d46('0x2f')]);_0x41ca76[_0x9d46('0x2d')]=qs[_0x9d46('0x2d')](_0x12a6f4[_0x9d46('0x45')][_0x9d46('0x2d')]);}_0x41ca76['order']=qs[_0x9d46('0x4f')](_0x12a6f4[_0x9d46('0x45')]['sort']);_0x41ca76[_0x9d46('0x50')]=qs['filters'](_[_0x9d46('0x51')](_0x12a6f4[_0x9d46('0x45')],_0x58659f[_0x9d46('0x52')]));_0x41ca76[_0x9d46('0x50')][_0x9d46('0x67')]=_0x7f0092['id'];if(_0x12a6f4['query'][_0x9d46('0x53')]){_0x41ca76['where']=_[_0x9d46('0x54')](_0x41ca76[_0x9d46('0x50')],{'$or':_[_0x9d46('0x40')](_0x41ca76[_0x9d46('0x49')],function(_0xe25519){var _0x4d0a81={};_0x4d0a81[_0xe25519]={'$like':'%'+_0x12a6f4[_0x9d46('0x45')][_0x9d46('0x53')]+'%'};return _0x4d0a81;})});}_0x41ca76=_[_0x9d46('0x54')]({},_0x41ca76,_0x12a6f4[_0x9d46('0x56')]);return db[_0x9d46('0x9e')][_0x9d46('0x30')]({'where':_0x41ca76[_0x9d46('0x50')]})[_0x9d46('0x1f')](function(_0x54aaee){_0x272e80[_0x9d46('0x30')]=_0x54aaee;if(_0x12a6f4['query'][_0x9d46('0x57')]){_0x41ca76[_0x9d46('0x58')]=[{'model':db[_0x9d46('0x99')],'as':_0x9d46('0xbc'),'required':![]},{'model':db[_0x9d46('0xbd')],'as':_0x9d46('0xbe'),'attributes':[_0x9d46('0x3b'),_0x9d46('0xbf'),_0x9d46('0xc0')],'required':![]},{'model':db[_0x9d46('0xc1')],'as':_0x9d46('0xc2'),'attributes':['id','name',_0x9d46('0xc3')],'where':_0x12a6f4['query'][_0x9d46('0xc4')]?{'id':_0x12a6f4[_0x9d46('0x45')][_0x9d46('0xc4')]}:undefined,'required':_0x12a6f4[_0x9d46('0x45')][_0x9d46('0xc4')]?!![]:![]}];}return db[_0x9d46('0x9e')][_0x9d46('0x59')](_0x41ca76);})[_0x9d46('0x1f')](function(_0x50be0d){_0x272e80[_0x9d46('0x5a')]=_0x50be0d;return _0x272e80;});}})[_0x9d46('0x1f')](respondWithFilteredResult(_0x4d54f8,_0x41ca76))[_0x9d46('0x29')](handleError(_0x4d54f8,null));};exports['send']=function(_0x40e800,_0x1bf2ed,_0x208c37){var _0x13733c,_0x4d1059,_0x458b14;if(_['isNil'](_0x40e800[_0x9d46('0x5d')]['body'])||_0x40e800[_0x9d46('0x5d')][_0x9d46('0x5d')]===''){throw new db[(_0x9d46('0x90'))][(_0x9d46('0x77'))](_0x9d46('0xc5'));}if(_[_0x9d46('0x92')](_0x40e800[_0x9d46('0x5d')]['to'])){throw new db[(_0x9d46('0x90'))][(_0x9d46('0x77'))]('to\x20is\x20mandatory');}_0x13733c=_0x40e800[_0x9d46('0x5d')]['to'];return db[_0x9d46('0x41')][_0x9d46('0x64')]({'where':{'id':_0x40e800[_0x9d46('0x5b')]['id']},'include':[{'model':db['CmList'],'as':_0x9d46('0xc6'),'include':[{'model':db['CmContact'],'as':_0x9d46('0x9d'),'where':{'mobile':_0x13733c},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x9d46('0x1f')](handleEntityNotFound(_0x1bf2ed,null))['then'](function(_0x145f86){if(_0x145f86&&_0x145f86[_0x9d46('0xc6')]){_0x4d1059=_0x145f86[_0x9d46('0x37')]({'plain':!![]});if(_0x4d1059[_0x9d46('0xc6')]&&_0x4d1059[_0x9d46('0xc6')][_0x9d46('0x9d')][_0x9d46('0x4b')]){return _0x4d1059[_0x9d46('0xc6')][_0x9d46('0x9d')][0x0];}return db[_0x9d46('0x99')][_0x9d46('0x5c')](_[_0x9d46('0x16')](_0x40e800[_0x9d46('0x5d')],{'firstName':_0x13733c,'mobile':_0x13733c,'phone':_0x13733c,'ListId':_0x4d1059[_0x9d46('0x98')]}));}})[_0x9d46('0x1f')](handleEntityNotFound(_0x1bf2ed,null))[_0x9d46('0x1f')](function(_0x205651){if(_0x205651){_0x458b14=_0x205651;return db['SmsInteraction'][_0x9d46('0x64')]({'where':{'ContactId':_0x458b14['id'],'closed':![],'SmsAccountId':_0x4d1059['id']}})[_0x9d46('0x1f')](function(_0x4a3d25){if(_0x4a3d25){return[_0x4a3d25,![]];}return db[_0x9d46('0x9e')][_0x9d46('0x5c')]({'UserId':_0x40e800['user']['id'],'ContactId':_0x458b14['id'],'SmsAccountId':_0x4d1059['id'],'phone':_0x13733c,'firstMsgDirection':_0x9d46('0xc7'),'Messages':[_['merge'](_0x40e800[_0x9d46('0x5d')],{'read':![],'body':_0x40e800[_0x9d46('0x5d')][_0x9d46('0x5d')],'phone':_0x13733c,'SmsAccountId':_0x4d1059['id'],'UserId':_0x40e800['user']['id'],'ContactId':_0x458b14['id']})]},{'include':[{'model':db[_0x9d46('0xa7')],'as':_0x9d46('0xc8')}]})[_0x9d46('0x1f')](function(_0x17a8cc){return[_0x17a8cc,!![]];});});}})[_0x9d46('0x9f')](function(_0x311c61,_0xb0e70f){if(_0xb0e70f){return _0x311c61;}return db[_0x9d46('0xa7')]['create'](_[_0x9d46('0x54')](_0x40e800[_0x9d46('0x5d')],{'read':![],'body':_0x40e800[_0x9d46('0x5d')][_0x9d46('0x5d')],'phone':_0x13733c,'SmsAccountId':_0x4d1059['id'],'SmsInteractionId':_0x311c61['id'],'UserId':_0x40e800[_0x9d46('0x5e')]['id'],'ContactId':_0x458b14['id']}))[_0x9d46('0x1f')](function(_0x3fe4e9){_0x311c61[_0x9d46('0xc9')][_0x9d46('0xc8')]=[];_0x311c61['dataValues'][_0x9d46('0xc8')][_0x9d46('0xa2')](_0x3fe4e9[_0x9d46('0xc9')]);return _0x311c61;});})[_0x9d46('0x1f')](respondWithResult(_0x1bf2ed,null))[_0x9d46('0x29')](handleError(_0x1bf2ed,null));};exports['status']=function(_0x2daff7,_0x1b6f1e,_0xc71b28){if(_0x2daff7[_0x9d46('0x5d')]['id']){delete _0x2daff7['body']['id'];}var _0x411c7b,_0x3c9c7e,_0xfd4d39;return db[_0x9d46('0x41')][_0x9d46('0x64')]({'where':{'id':_0x2daff7[_0x9d46('0x5b')]['id']}})[_0x9d46('0x1f')](handleEntityNotFound(_0x1b6f1e,null))[_0x9d46('0x1f')](function(_0x2870fd){if(_0x2870fd){_0xfd4d39=_0x2870fd;logger[_0x9d46('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x2870fd[_0x9d46('0x43')],util[_0x9d46('0xca')](_0x2daff7[_0x9d46('0x5d')],{'showHidden':![],'depth':null}));switch(_0x2870fd[_0x9d46('0x43')]){case _0x9d46('0x80'):if(_0x2daff7[_0x9d46('0x5d')][_0x9d46('0xcb')]&&_0x2daff7[_0x9d46('0x5d')]['status']){_0x3c9c7e=_0x2daff7[_0x9d46('0x5d')][_0x9d46('0x2b')];return db[_0x9d46('0xa7')][_0x9d46('0x64')]({'where':{'messageId':_0x2daff7[_0x9d46('0x5d')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x2daff7['body']['requestid']&&_0x2daff7['body'][_0x9d46('0xcc')]){_0x3c9c7e=_0x2daff7['body'][_0x9d46('0xcc')];return db[_0x9d46('0xa7')][_0x9d46('0x64')]({'where':{'messageId':_0x2daff7['body'][_0x9d46('0xcd')]}});}break;case _0x9d46('0xce'):if(_0x2daff7['body'][_0x9d46('0x84')]&&_0x2daff7[_0x9d46('0x5d')][_0x9d46('0xcf')]){_0x3c9c7e=_0x2daff7[_0x9d46('0x5d')]['status_code'];return db[_0x9d46('0xa7')][_0x9d46('0x64')]({'where':{'messageId':_0x2daff7[_0x9d46('0x5d')]['message_id']}});}break;case _0x9d46('0x88'):var _0x402024=_0x2daff7[_0x9d46('0x5d')]['results'][0x0];if(_0x402024['messageId']&&_0x402024[_0x9d46('0x2b')]['groupName']==='DELIVERED'){_0x3c9c7e=_0x402024['status'][_0x9d46('0xd0')];return db[_0x9d46('0xa7')]['find']({'where':{'messageId':_0x402024[_0x9d46('0x7e')]}});}break;case _0x9d46('0x8d'):if(_0x2daff7[_0x9d46('0x5d')][_0x9d46('0x7e')]&&_0x2daff7[_0x9d46('0x5d')]['status']){_0x3c9c7e=_0x2daff7[_0x9d46('0x5d')]['status'];return db[_0x9d46('0xa7')][_0x9d46('0x64')]({'where':{'messageId':_0x2daff7[_0x9d46('0x5d')][_0x9d46('0x7e')]}});}break;case'bandwidth':if(_0x2daff7[_0x9d46('0x5d')][0x0][_0x9d46('0x26')]['id']){_0x3c9c7e=_0x2daff7[_0x9d46('0x5d')][0x0][_0x9d46('0x43')];return db[_0x9d46('0xa7')][_0x9d46('0x64')]({'where':{'messageId':_0x2daff7['body'][0x0][_0x9d46('0x26')]['id']}});}break;case _0x9d46('0x8f'):if(_0x2daff7[_0x9d46('0x5d')]['redif']&&_0x2daff7[_0x9d46('0x5d')][_0x9d46('0x2b')]){_0x3c9c7e=_0x2daff7[_0x9d46('0x5d')][_0x9d46('0x2b')];return db[_0x9d46('0xa7')][_0x9d46('0x64')]({'where':{'messageId':_0x2daff7[_0x9d46('0x5d')][_0x9d46('0xd1')]}});}break;}}})[_0x9d46('0x1f')](handleEntityNotFound(_0x1b6f1e,null))[_0x9d46('0x1f')](function(_0x25d960){if(_0x25d960){_0x411c7b=_0x25d960;switch(_0xfd4d39[_0x9d46('0x43')]){case _0x9d46('0x80'):if(_0x3c9c7e===_0x9d46('0xd2')){return _0x411c7b[_0x9d46('0x35')]({'read':!![]});}else{logger[_0x9d46('0x24')](_0x9d46('0xd3'),_0x9d46('0x2b'),'skebby',util[_0x9d46('0xca')](_0x2daff7[_0x9d46('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x9d46('0xd4'):if(_0x3c9c7e==='1'){return _0x411c7b[_0x9d46('0x35')]({'read':!![]});}else{logger[_0x9d46('0x24')](_0x9d46('0xd3'),_0x9d46('0x2b'),_0x9d46('0x80'),util[_0x9d46('0xca')](_0x2daff7['body'],{'showHidden':![],'depth':null}));}break;case _0x9d46('0xce'):if(!_0x2daff7[_0x9d46('0x5d')][_0x9d46('0xd5')]&&_0x3c9c7e>=0xc8&&_0x3c9c7e<=0xce){return _0x411c7b[_0x9d46('0x35')]({'read':!![]});}else{logger[_0x9d46('0x24')](_0x9d46('0xd3'),_0x9d46('0x2b'),_0x9d46('0xce'),util[_0x9d46('0xca')](_0x2daff7[_0x9d46('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x9d46('0x88'):var _0x15e28f=_0x2daff7[_0x9d46('0x5d')][_0x9d46('0x89')][0x0];if(_0x15e28f['status'][_0x9d46('0xd0')]==='DELIVERED'){return _0x411c7b[_0x9d46('0x35')]({'read':!![]});}else{logger[_0x9d46('0x24')](_0x9d46('0xd3'),_0x9d46('0x2b'),_0x9d46('0x88'),util[_0x9d46('0xca')](_0x2daff7['body'],{'showHidden':![],'depth':null}));}break;case _0x9d46('0x8d'):if(_0x3c9c7e=='DELIVERED_TO_GATEWAY'||_0x3c9c7e==_0x9d46('0xd6')){return _0x411c7b[_0x9d46('0x35')]({'read':!![]});}else{logger[_0x9d46('0x24')](_0x9d46('0xd3'),_0x9d46('0x2b'),_0x9d46('0x8d'),util[_0x9d46('0xca')](_0x2daff7[_0x9d46('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x9d46('0xd7'):if(_0x3c9c7e==_0x9d46('0xd8')){return _0x411c7b[_0x9d46('0x35')]({'read':!![]});}else{logger[_0x9d46('0x24')](_0x9d46('0xd3'),_0x9d46('0x2b'),'bandwidth',util[_0x9d46('0xca')](_0x2daff7[_0x9d46('0x5d')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x3c9c7e===_0x9d46('0xd9')||_0x3c9c7e==='ACCEPTD'){return _0x411c7b[_0x9d46('0x35')]({'read':!![]});}else{logger['error'](_0x9d46('0xd3'),_0x9d46('0x2b'),'intelepeer',util['inspect'](_0x2daff7[_0x9d46('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x411c7b;}})[_0x9d46('0x1f')](respondWithResult(_0x1b6f1e,null))['catch'](handleError(_0x1b6f1e,null));};exports[_0x9d46('0xda')]=function(_0x39f398,_0x1ac65c,_0x58ce92){var _0x3996fa,_0x8f0b4,_0x3391b7;return db[_0x9d46('0x41')][_0x9d46('0x64')]({'where':{'id':_0x39f398[_0x9d46('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1ac65c,null))[_0x9d46('0x1f')](function(_0x32c6eb){if(_0x32c6eb){_0x3391b7=_0x32c6eb;logger[_0x9d46('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x9d46('0x2b'),_0x9d46('0xdb'),_0x32c6eb['type'],util['inspect'](_0x39f398['query'],{'showHidden':![],'depth':null}));switch(_0x32c6eb[_0x9d46('0x43')]){case _0x9d46('0x8a'):if(_0x39f398[_0x9d46('0x45')][_0x9d46('0xdc')]&&_0x39f398[_0x9d46('0x45')][_0x9d46('0xdd')]){_0x8f0b4=_0x39f398['query'][_0x9d46('0xdd')];return db['SmsMessage'][_0x9d46('0x64')]({'where':{'messageId':_0x39f398['query'][_0x9d46('0xdc')]}});}break;}}})[_0x9d46('0x1f')](handleEntityNotFound(_0x1ac65c,null))[_0x9d46('0x1f')](function(_0x35e27f){if(_0x35e27f){_0x3996fa=_0x35e27f;switch(_0x3391b7['type']){case _0x9d46('0x8a'):if(_0x8f0b4==='2'||_0x8f0b4==='6'){return _0x3996fa[_0x9d46('0x35')]({'read':!![]});}else{logger[_0x9d46('0x24')](_0x9d46('0xd3'),_0x9d46('0x2b'),_0x9d46('0x8a'),util[_0x9d46('0xca')](_0x39f398['query'],{'showHidden':![],'depth':null}));};break;}return _0x3996fa;}})[_0x9d46('0x1f')](respondWithResult(_0x1ac65c,null))[_0x9d46('0x29')](handleError(_0x1ac65c,null));};exports['addAgents']=function(_0x4817f0,_0x10019f,_0x42985f){return db[_0x9d46('0x41')][_0x9d46('0x64')]({'where':{'id':_0x4817f0['params']['id']}})[_0x9d46('0x1f')](handleEntityNotFound(_0x10019f,null))['then'](function(_0x4ce66d){if(_0x4ce66d){return _0x4ce66d[_0x9d46('0xde')](_0x4817f0[_0x9d46('0x5d')][_0x9d46('0x6b')],_[_0x9d46('0x9c')](_0x4817f0[_0x9d46('0x5d')],[_0x9d46('0x6b'),'id'])||{})[_0x9d46('0x9f')](function(_0x49aeb3){for(var _0x1205a0=0x0;_0x1205a0<_0x4817f0[_0x9d46('0x5d')][_0x9d46('0x6b')][_0x9d46('0x4b')];_0x1205a0+=0x1){socket[_0x9d46('0xdf')](_0x9d46('0xe0'),{'UserId':Number(_0x4817f0[_0x9d46('0x5d')][_0x9d46('0x6b')][_0x1205a0]),'SmsAccountId':Number(_0x4817f0['params']['id'])});}return _0x49aeb3;});}})[_0x9d46('0x1f')](respondWithResult(_0x10019f,null))[_0x9d46('0x29')](handleError(_0x10019f,null));};exports['removeAgents']=function(_0x5d0cb8,_0x1b5cb4,_0x4a05aa){return db[_0x9d46('0x41')]['find']({'where':{'id':_0x5d0cb8['params']['id']}})[_0x9d46('0x1f')](handleEntityNotFound(_0x1b5cb4,null))['then'](function(_0x5c8c7c){if(_0x5c8c7c){return _0x5c8c7c['removeAgents'](_0x5d0cb8[_0x9d46('0x45')][_0x9d46('0x6b')])[_0x9d46('0x1f')](function(){if(_[_0x9d46('0xe1')](_0x5d0cb8['query'][_0x9d46('0x6b')])){for(var _0x29e8a3=0x0;_0x29e8a3<_0x5d0cb8[_0x9d46('0x45')][_0x9d46('0x6b')][_0x9d46('0x4b')];_0x29e8a3+=0x1){socket[_0x9d46('0xdf')](_0x9d46('0xe2'),{'UserId':Number(_0x5d0cb8[_0x9d46('0x45')][_0x9d46('0x6b')][_0x29e8a3]),'SmsAccountId':Number(_0x5d0cb8[_0x9d46('0x5b')]['id'])});}}else{socket[_0x9d46('0xdf')](_0x9d46('0xe2'),{'UserId':Number(_0x5d0cb8[_0x9d46('0x45')][_0x9d46('0x6b')]),'SmsAccountId':Number(_0x5d0cb8[_0x9d46('0x5b')]['id'])});}});}})[_0x9d46('0x1f')](respondWithStatusCode(_0x1b5cb4,null))[_0x9d46('0x29')](handleError(_0x1b5cb4,null));};exports[_0x9d46('0xe3')]=function(_0x299c55,_0x12ea79,_0x53fd1e){var _0x4e537a={};var _0x3a0cc0={};var _0x1e945e;var _0x46a076;return db[_0x9d46('0x41')]['findOne']({'where':{'id':_0x299c55[_0x9d46('0x5b')]['id']}})['then'](handleEntityNotFound(_0x12ea79,null))[_0x9d46('0x1f')](function(_0x2d88eb){if(_0x2d88eb){_0x1e945e=_0x2d88eb;_0x3a0cc0[_0x9d46('0x48')]=_[_0x9d46('0x46')](db[_0x9d46('0xbd')]['rawAttributes']);_0x3a0cc0[_0x9d46('0x45')]=_[_0x9d46('0x46')](_0x299c55[_0x9d46('0x45')]);_0x3a0cc0[_0x9d46('0x52')]=_['intersection'](_0x3a0cc0[_0x9d46('0x48')],_0x3a0cc0['query']);_0x4e537a[_0x9d46('0x49')]=_[_0x9d46('0x47')](_0x3a0cc0[_0x9d46('0x48')],qs[_0x9d46('0x4a')](_0x299c55['query'][_0x9d46('0x4a')]));_0x4e537a[_0x9d46('0x49')]=_0x4e537a[_0x9d46('0x49')][_0x9d46('0x4b')]?_0x4e537a[_0x9d46('0x49')]:_0x3a0cc0[_0x9d46('0x48')];_0x4e537a[_0x9d46('0x4e')]=qs['sort'](_0x299c55[_0x9d46('0x45')][_0x9d46('0x4f')]);_0x4e537a[_0x9d46('0x50')]=qs['filters'](_[_0x9d46('0x51')](_0x299c55['query'],_0x3a0cc0[_0x9d46('0x52')]));if(_0x299c55['query'][_0x9d46('0x53')]){_0x4e537a[_0x9d46('0x50')]=_[_0x9d46('0x54')](_0x4e537a[_0x9d46('0x50')],{'$or':_[_0x9d46('0x40')](_0x4e537a[_0x9d46('0x49')],function(_0x15fbdc){var _0x418872={};_0x418872[_0x15fbdc]={'$like':'%'+_0x299c55[_0x9d46('0x45')][_0x9d46('0x53')]+'%'};return _0x418872;})});}_0x4e537a=_[_0x9d46('0x54')]({},_0x4e537a,_0x299c55[_0x9d46('0x56')]);return _0x1e945e[_0x9d46('0xe3')](_0x4e537a);}})[_0x9d46('0x1f')](function(_0xcb7511){if(_0xcb7511){_0x46a076=_0xcb7511[_0x9d46('0x4b')];if(!_0x299c55[_0x9d46('0x45')][_0x9d46('0x4c')](_0x9d46('0x4d'))){_0x4e537a[_0x9d46('0x2f')]=qs[_0x9d46('0x2f')](_0x299c55[_0x9d46('0x45')][_0x9d46('0x2f')]);_0x4e537a['offset']=qs[_0x9d46('0x2d')](_0x299c55[_0x9d46('0x45')][_0x9d46('0x2d')]);}return _0x1e945e[_0x9d46('0xe3')](_0x4e537a);}})[_0x9d46('0x1f')](function(_0x254134){if(_0x254134){return _0x254134?{'count':_0x46a076,'rows':_0x254134}:null;}})[_0x9d46('0x1f')](respondWithResult(_0x12ea79,null))[_0x9d46('0x29')](handleError(_0x12ea79,null));}; \ No newline at end of file +var _0xe7b5=['../../config/license/hardware','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','register','jayson/promise','client','http','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','undefined','limit','count','offset','set','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','Pause','map','SmsAccount','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','includeAll','include','catch','show','params','mandatoryDispositionPause','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','describe','addDisposition','SmsAccountId','Disposition','findOne','pick','options','rows','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','findAll','removeAnswers','sms','SmsApplication','Applications','account','applications','orderBy','priority','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','ListId','mobile','twilio','from','Body','messageId','MessageSid','skebby','text','connectel','clicksend','plivo','From','Text','MessageUUID','results','csc','segmentedMessage','fromNumber','bandwidth','intelepeer','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','Contacts','DESC','list','SmsInteraction','spread','created','autoclose','push','close','*,*,*,*','interaction','SmsMessage','UserId','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found','Content-Type','text/xml','\x0a','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','json','getApplications','User','Owner','fullname','internal','Tag','Tags','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','CmList','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','message_id','status_code','infobip','groupName','redif','DELIVERED','clickatell','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','ACCEPTD','statusGet','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x3877c1,_0x238c29){var _0x59056a=function(_0x3567cd){while(--_0x3567cd){_0x3877c1['push'](_0x3877c1['shift']());}};_0x59056a(++_0x238c29);}(_0xe7b5,0x1a6));var _0x5e7b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xe7b5[_0x167cc1];return _0x10bc4b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5e7b('0x0'));var jsonpatch=require(_0x5e7b('0x1'));var rp=require(_0x5e7b('0x2'));var moment=require(_0x5e7b('0x3'));var BPromise=require(_0x5e7b('0x4'));var Mustache=require(_0x5e7b('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5e7b('0x6'));var fs=require('fs');var fs_extra=require(_0x5e7b('0x7'));var _=require(_0x5e7b('0x8'));var squel=require(_0x5e7b('0x9'));var crypto=require(_0x5e7b('0xa'));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(_0x5e7b('0xb'));var authService=require(_0x5e7b('0xc'));var qs=require(_0x5e7b('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e7b('0xe'));var logger=require('../../config/logger')(_0x5e7b('0xf'));var utils=require('../../config/utils');var config=require(_0x5e7b('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x5e7b('0x11'))['db'];config['redis']=_[_0x5e7b('0x12')](config[_0x5e7b('0x13')],{'host':'localhost','port':0x18eb});var socket=require(_0x5e7b('0x14'))(new Redis(config[_0x5e7b('0x13')]));require('./smsAccount.socket')[_0x5e7b('0x15')](socket);var jayson=require(_0x5e7b('0x16'));var client=jayson[_0x5e7b('0x17')][_0x5e7b('0x18')]({'port':0x232c});function respondWithRpcPromise(_0x2ab8cc,_0x3ee1c4,_0x51e2d7,_0x128595){return new BPromise(function(_0x1e4941,_0x256eab){var _0x291166=_0x128595||client;return _0x291166[_0x5e7b('0x19')](_0x2ab8cc,_0x51e2d7)[_0x5e7b('0x1a')](function(_0x46a824){logger[_0x5e7b('0x1b')](_0x5e7b('0x1c'),_0x3ee1c4,_0x5e7b('0x1d'));logger[_0x5e7b('0x1e')](_0x5e7b('0x1f'),_0x3ee1c4,_0x5e7b('0x1d'),JSON[_0x5e7b('0x20')](_0x46a824));if(_0x46a824[_0x5e7b('0x21')]){if(_0x46a824['error'][_0x5e7b('0x22')]===0x1f4){logger['error'](_0x5e7b('0x1c'),_0x3ee1c4,_0x46a824[_0x5e7b('0x21')]['message']);return _0x256eab(_0x46a824[_0x5e7b('0x21')][_0x5e7b('0x23')]);}logger[_0x5e7b('0x21')](_0x5e7b('0x1c'),_0x3ee1c4,_0x46a824[_0x5e7b('0x21')][_0x5e7b('0x23')]);return _0x1e4941(_0x46a824[_0x5e7b('0x21')]['message']);}else{logger[_0x5e7b('0x1b')](_0x5e7b('0x1c'),_0x3ee1c4,_0x5e7b('0x1d'));_0x1e4941(_0x46a824[_0x5e7b('0x24')][_0x5e7b('0x23')]);}})['catch'](function(_0x4704b7){logger[_0x5e7b('0x21')]('SmsAccount,\x20%s,\x20%s',_0x3ee1c4,_0x4704b7);_0x256eab(_0x4704b7);});});}function respondWithStatusCode(_0x2ecd5b,_0x3b4fc9){_0x3b4fc9=_0x3b4fc9||0xcc;return function(_0x1ccc3f){if(_0x1ccc3f){return _0x2ecd5b[_0x5e7b('0x25')](_0x3b4fc9);}return _0x2ecd5b[_0x5e7b('0x26')](_0x3b4fc9)['end']();};}function respondWithResult(_0x1fca47,_0x487453){_0x487453=_0x487453||0xc8;return function(_0xf4e9f4){if(_0xf4e9f4){return _0x1fca47['status'](_0x487453)['json'](_0xf4e9f4);}};}function respondWithFilteredResult(_0x416880,_0x239ac0){return function(_0x51dd63){if(_0x51dd63){var _0x4a0135=typeof _0x239ac0['offset']===_0x5e7b('0x27')&&typeof _0x239ac0[_0x5e7b('0x28')]===_0x5e7b('0x27');var _0x28b35c=_0x51dd63[_0x5e7b('0x29')];var _0x4152a2=_0x4a0135?0x0:_0x239ac0['offset'];var _0x522b4d=_0x4a0135?_0x51dd63[_0x5e7b('0x29')]:_0x239ac0[_0x5e7b('0x2a')]+_0x239ac0[_0x5e7b('0x28')];var _0x1bb222;if(_0x522b4d>=_0x28b35c){_0x522b4d=_0x28b35c;_0x1bb222=0xc8;}else{_0x1bb222=0xce;}_0x416880[_0x5e7b('0x26')](_0x1bb222);return _0x416880[_0x5e7b('0x2b')]('Content-Range',_0x4152a2+'-'+_0x522b4d+'/'+_0x28b35c)['json'](_0x51dd63);}return null;};}function patchUpdates(_0x51010e){return function(_0x5472d2){try{jsonpatch[_0x5e7b('0x2c')](_0x5472d2,_0x51010e,!![]);}catch(_0x462552){return BPromise[_0x5e7b('0x2d')](_0x462552);}return _0x5472d2[_0x5e7b('0x2e')]();};}function saveUpdates(_0x1c733f,_0x53f3e7){return function(_0x2609e7){if(_0x2609e7){return _0x2609e7[_0x5e7b('0x2f')](_0x1c733f)[_0x5e7b('0x1a')](function(_0x3bd53c){return _0x3bd53c;});}return null;};}function removeEntity(_0x6246e3,_0x3d4ca8){return function(_0x3177c3){if(_0x3177c3){return _0x3177c3[_0x5e7b('0x30')]()['then'](function(){var _0x5e0f22=_0x3177c3[_0x5e7b('0x31')]({'plain':!![]});var _0x4994d2=_0x5e7b('0x32');return db[_0x5e7b('0x33')]['destroy']({'where':{'type':_0x4994d2,'resourceId':_0x5e0f22['id']}})[_0x5e7b('0x1a')](function(){return _0x3177c3;});})['then'](function(){_0x6246e3[_0x5e7b('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25cfc2,_0x4822f4){return function(_0x4c114a){if(!_0x4c114a){_0x25cfc2['sendStatus'](0x194);}return _0x4c114a;};}function handleError(_0xfdc856,_0x5c8c99){_0x5c8c99=_0x5c8c99||0x1f4;return function(_0x326914){logger[_0x5e7b('0x21')](_0x326914[_0x5e7b('0x34')]);if(_0x326914[_0x5e7b('0x35')]){delete _0x326914[_0x5e7b('0x35')];}_0xfdc856[_0x5e7b('0x26')](_0x5c8c99)[_0x5e7b('0x36')](_0x326914);};}exports['index']=function(_0x1e9bd1,_0xf5c0de){var _0x37bb3e={'include':[{'model':db[_0x5e7b('0x37')],'as':'mandatoryDispositionPause'}]},_0x195138={},_0x23f955={'count':0x0,'rows':[]};var _0x3df037=_[_0x5e7b('0x38')](db[_0x5e7b('0x39')]['rawAttributes'],function(_0x16e63c){return{'name':_0x16e63c['fieldName'],'type':_0x16e63c[_0x5e7b('0x3a')][_0x5e7b('0x3b')]};});_0x195138['model']=_[_0x5e7b('0x38')](_0x3df037,_0x5e7b('0x35'));_0x195138[_0x5e7b('0x3c')]=_[_0x5e7b('0x3d')](_0x1e9bd1[_0x5e7b('0x3c')]);_0x195138[_0x5e7b('0x3e')]=_[_0x5e7b('0x3f')](_0x195138[_0x5e7b('0x40')],_0x195138[_0x5e7b('0x3c')]);_0x37bb3e['attributes']=_[_0x5e7b('0x3f')](_0x195138[_0x5e7b('0x40')],qs[_0x5e7b('0x41')](_0x1e9bd1[_0x5e7b('0x3c')][_0x5e7b('0x41')]));_0x37bb3e[_0x5e7b('0x42')]=_0x37bb3e[_0x5e7b('0x42')][_0x5e7b('0x43')]?_0x37bb3e[_0x5e7b('0x42')]:_0x195138[_0x5e7b('0x40')];if(!_0x1e9bd1[_0x5e7b('0x3c')][_0x5e7b('0x44')](_0x5e7b('0x45'))){_0x37bb3e['limit']=qs[_0x5e7b('0x28')](_0x1e9bd1[_0x5e7b('0x3c')][_0x5e7b('0x28')]);_0x37bb3e[_0x5e7b('0x2a')]=qs[_0x5e7b('0x2a')](_0x1e9bd1['query']['offset']);}_0x37bb3e[_0x5e7b('0x46')]=qs[_0x5e7b('0x47')](_0x1e9bd1['query'][_0x5e7b('0x47')]);_0x37bb3e['where']=qs[_0x5e7b('0x3e')](_['pick'](_0x1e9bd1[_0x5e7b('0x3c')],_0x195138[_0x5e7b('0x3e')]),_0x3df037);if(_0x1e9bd1[_0x5e7b('0x3c')][_0x5e7b('0x48')]){_0x37bb3e[_0x5e7b('0x49')]=_[_0x5e7b('0x4a')](_0x37bb3e[_0x5e7b('0x49')],{'$or':_[_0x5e7b('0x38')](_0x3df037,function(_0x5cae20){if(_0x5cae20[_0x5e7b('0x3a')]!==_0x5e7b('0x4b')){var _0x434ea8={};_0x434ea8[_0x5cae20[_0x5e7b('0x35')]]={'$like':'%'+_0x1e9bd1[_0x5e7b('0x3c')][_0x5e7b('0x48')]+'%'};return _0x434ea8;}})});}_0x37bb3e=_[_0x5e7b('0x4a')]({},_0x37bb3e,_0x1e9bd1['options']);var _0xba14e3={'where':_0x37bb3e['where']};return db[_0x5e7b('0x39')][_0x5e7b('0x29')](_0xba14e3)['then'](function(_0x5bd679){_0x23f955[_0x5e7b('0x29')]=_0x5bd679;if(_0x1e9bd1[_0x5e7b('0x3c')][_0x5e7b('0x4c')]){_0x37bb3e[_0x5e7b('0x4d')]=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x37bb3e);})[_0x5e7b('0x1a')](function(_0xcdab37){_0x23f955['rows']=_0xcdab37;return _0x23f955;})[_0x5e7b('0x1a')](respondWithFilteredResult(_0xf5c0de,_0x37bb3e))[_0x5e7b('0x4e')](handleError(_0xf5c0de,null));};exports[_0x5e7b('0x4f')]=function(_0x465621,_0x5e7fc9){var _0x713ecd={'raw':![],'where':{'id':_0x465621[_0x5e7b('0x50')]['id']},'include':[{'model':db[_0x5e7b('0x37')],'as':_0x5e7b('0x51')}]},_0x3239cf={};_0x3239cf[_0x5e7b('0x40')]=_[_0x5e7b('0x3d')](db['SmsAccount'][_0x5e7b('0x52')]);_0x3239cf[_0x5e7b('0x3c')]=_[_0x5e7b('0x3d')](_0x465621[_0x5e7b('0x3c')]);_0x3239cf[_0x5e7b('0x3e')]=_[_0x5e7b('0x3f')](_0x3239cf[_0x5e7b('0x40')],_0x3239cf[_0x5e7b('0x3c')]);_0x713ecd[_0x5e7b('0x42')]=_[_0x5e7b('0x3f')](_0x3239cf[_0x5e7b('0x40')],qs[_0x5e7b('0x41')](_0x465621['query'][_0x5e7b('0x41')]));_0x713ecd[_0x5e7b('0x42')]=_0x713ecd[_0x5e7b('0x42')][_0x5e7b('0x43')]?_0x713ecd[_0x5e7b('0x42')]:_0x3239cf['model'];if(_0x465621[_0x5e7b('0x3c')][_0x5e7b('0x4c')]){_0x713ecd[_0x5e7b('0x4d')]=[{'all':!![]}];}_0x713ecd=_[_0x5e7b('0x4a')]({},_0x713ecd,_0x465621['options']);return db[_0x5e7b('0x39')][_0x5e7b('0x53')](_0x713ecd)[_0x5e7b('0x1a')](handleEntityNotFound(_0x5e7fc9,null))['then'](respondWithResult(_0x5e7fc9,null))[_0x5e7b('0x4e')](handleError(_0x5e7fc9,null));};exports['create']=function(_0x42cb8f,_0x5545a4){return db['SmsAccount'][_0x5e7b('0x54')](_0x42cb8f[_0x5e7b('0x55')],{})[_0x5e7b('0x1a')](function(_0x46e1c3){var _0x9a3725=_0x42cb8f[_0x5e7b('0x56')]['get']({'plain':!![]});if(!_0x9a3725)throw new Error(_0x5e7b('0x57'));if(_0x9a3725[_0x5e7b('0x58')]==='user'){var _0x585ddc=_0x46e1c3[_0x5e7b('0x31')]({'plain':!![]});var _0x4f4c47=_0x5e7b('0x32');return db[_0x5e7b('0x59')][_0x5e7b('0x53')]({'where':{'name':_0x4f4c47,'userProfileId':_0x9a3725[_0x5e7b('0x5a')]},'raw':!![]})[_0x5e7b('0x1a')](function(_0x497e1f){if(_0x497e1f&&_0x497e1f['autoAssociation']===0x0){return db[_0x5e7b('0x33')][_0x5e7b('0x54')]({'name':_0x585ddc['name'],'resourceId':_0x585ddc['id'],'type':_0x497e1f[_0x5e7b('0x35')],'sectionId':_0x497e1f['id']},{})[_0x5e7b('0x1a')](function(){return _0x46e1c3;});}else{return _0x46e1c3;}})['catch'](function(_0x436a26){logger[_0x5e7b('0x21')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x436a26);throw _0x436a26;});}return _0x46e1c3;})[_0x5e7b('0x1a')](respondWithResult(_0x5545a4,0xc9))[_0x5e7b('0x4e')](handleError(_0x5545a4,null));};exports[_0x5e7b('0x2f')]=function(_0x3896a6,_0x44c4f6){if(_0x3896a6[_0x5e7b('0x55')]['id']){delete _0x3896a6[_0x5e7b('0x55')]['id'];}return db[_0x5e7b('0x39')][_0x5e7b('0x53')]({'where':{'id':_0x3896a6['params']['id']},'include':[{'model':db[_0x5e7b('0x37')],'as':_0x5e7b('0x51')}]})[_0x5e7b('0x1a')](handleEntityNotFound(_0x44c4f6,null))[_0x5e7b('0x1a')](saveUpdates(_0x3896a6[_0x5e7b('0x55')],null))[_0x5e7b('0x1a')](respondWithResult(_0x44c4f6,null))[_0x5e7b('0x4e')](handleError(_0x44c4f6,null));};exports[_0x5e7b('0x30')]=function(_0xc0ffca,_0x378c08){return db[_0x5e7b('0x39')][_0x5e7b('0x53')]({'where':{'id':_0xc0ffca['params']['id']}})[_0x5e7b('0x1a')](handleEntityNotFound(_0x378c08,null))[_0x5e7b('0x1a')](removeEntity(_0x378c08,null))[_0x5e7b('0x4e')](handleError(_0x378c08,null));};exports['describe']=function(_0xc577d5,_0x506a1e){return db[_0x5e7b('0x39')][_0x5e7b('0x5b')]()[_0x5e7b('0x1a')](respondWithResult(_0x506a1e,null))[_0x5e7b('0x4e')](handleError(_0x506a1e,null));};exports[_0x5e7b('0x5c')]=function(_0x5cae4d,_0xc3bbcb,_0x474584){if(_0x5cae4d[_0x5e7b('0x55')]['id']){delete _0x5cae4d[_0x5e7b('0x55')]['id'];}return db['SmsAccount'][_0x5e7b('0x53')]({'where':{'id':_0x5cae4d[_0x5e7b('0x50')]['id']}})[_0x5e7b('0x1a')](handleEntityNotFound(_0xc3bbcb,null))[_0x5e7b('0x1a')](function(_0x367b53){if(_0x367b53){_0x5cae4d[_0x5e7b('0x55')][_0x5e7b('0x5d')]=_0x367b53['id'];return db[_0x5e7b('0x5e')][_0x5e7b('0x54')](_0x5cae4d['body']);}})[_0x5e7b('0x1a')](respondWithResult(_0xc3bbcb,null))[_0x5e7b('0x4e')](handleError(_0xc3bbcb,null));};exports['getDispositions']=function(_0x1f0e5c,_0x13f972,_0x4d93b0){var _0x3a0d3c={'raw':![],'where':{}};var _0x3eaba1={};var _0x25f335={'count':0x0,'rows':[]};return db['SmsAccount'][_0x5e7b('0x5f')]({'where':{'id':_0x1f0e5c[_0x5e7b('0x50')]['id']}})[_0x5e7b('0x1a')](handleEntityNotFound(_0x13f972,null))['then'](function(_0x25c688){if(_0x25c688){_0x3eaba1[_0x5e7b('0x40')]=_[_0x5e7b('0x3d')](db['Disposition'][_0x5e7b('0x52')]);_0x3eaba1[_0x5e7b('0x3c')]=_[_0x5e7b('0x3d')](_0x1f0e5c[_0x5e7b('0x3c')]);_0x3eaba1[_0x5e7b('0x3e')]=_[_0x5e7b('0x3f')](_0x3eaba1['model'],_0x3eaba1[_0x5e7b('0x3c')]);_0x3a0d3c[_0x5e7b('0x42')]=_[_0x5e7b('0x3f')](_0x3eaba1['model'],qs['fields'](_0x1f0e5c[_0x5e7b('0x3c')][_0x5e7b('0x41')]));_0x3a0d3c['attributes']=_0x3a0d3c[_0x5e7b('0x42')][_0x5e7b('0x43')]?_0x3a0d3c['attributes']:_0x3eaba1[_0x5e7b('0x40')];if(!_0x1f0e5c['query'][_0x5e7b('0x44')](_0x5e7b('0x45'))){_0x3a0d3c[_0x5e7b('0x28')]=qs[_0x5e7b('0x28')](_0x1f0e5c[_0x5e7b('0x3c')][_0x5e7b('0x28')]);_0x3a0d3c[_0x5e7b('0x2a')]=qs['offset'](_0x1f0e5c[_0x5e7b('0x3c')][_0x5e7b('0x2a')]);}_0x3a0d3c[_0x5e7b('0x46')]=qs[_0x5e7b('0x47')](_0x1f0e5c['query'][_0x5e7b('0x47')]);_0x3a0d3c[_0x5e7b('0x49')]=qs['filters'](_[_0x5e7b('0x60')](_0x1f0e5c[_0x5e7b('0x3c')],_0x3eaba1[_0x5e7b('0x3e')]));_0x3a0d3c['where']['SmsAccountId']=_0x25c688['id'];if(_0x1f0e5c[_0x5e7b('0x3c')][_0x5e7b('0x48')]){_0x3a0d3c[_0x5e7b('0x49')]=_[_0x5e7b('0x4a')](_0x3a0d3c[_0x5e7b('0x49')],{'$or':_['map'](_0x3a0d3c[_0x5e7b('0x42')],function(_0x5c5e2f){var _0x5236e4={};_0x5236e4[_0x5c5e2f]={'$like':'%'+_0x1f0e5c['query']['filter']+'%'};return _0x5236e4;})});}_0x3a0d3c=_[_0x5e7b('0x4a')]({},_0x3a0d3c,_0x1f0e5c[_0x5e7b('0x61')]);return db[_0x5e7b('0x5e')]['count']({'where':_0x3a0d3c['where']})[_0x5e7b('0x1a')](function(_0x30d202){_0x25f335['count']=_0x30d202;if(_0x1f0e5c[_0x5e7b('0x3c')][_0x5e7b('0x4c')]){_0x3a0d3c['include']=[{'all':!![]}];}return db['Disposition']['findAll'](_0x3a0d3c);})[_0x5e7b('0x1a')](function(_0x2ae0ea){_0x25f335[_0x5e7b('0x62')]=_0x2ae0ea;return _0x25f335;});}})[_0x5e7b('0x1a')](respondWithFilteredResult(_0x13f972,_0x3a0d3c))['catch'](handleError(_0x13f972,null));};exports[_0x5e7b('0x63')]=function(_0x442d50,_0x4fb832,_0x518ca8){return db[_0x5e7b('0x39')][_0x5e7b('0x53')]({'where':{'id':_0x442d50[_0x5e7b('0x50')]['id']}})[_0x5e7b('0x1a')](handleEntityNotFound(_0x4fb832,null))['then'](function(_0x1153f0){if(_0x1153f0){return _0x1153f0[_0x5e7b('0x63')](_0x442d50[_0x5e7b('0x3c')][_0x5e7b('0x64')]);}})[_0x5e7b('0x1a')](respondWithStatusCode(_0x4fb832,null))[_0x5e7b('0x4e')](handleError(_0x4fb832,null));};exports[_0x5e7b('0x65')]=function(_0xb087c4,_0x2ae4c3,_0xbce657){if(_0xb087c4['body']['id']){delete _0xb087c4[_0x5e7b('0x55')]['id'];}return db['SmsAccount'][_0x5e7b('0x53')]({'where':{'id':_0xb087c4[_0x5e7b('0x50')]['id']}})[_0x5e7b('0x1a')](handleEntityNotFound(_0x2ae4c3,null))['then'](function(_0x28ef34){if(_0x28ef34){_0xb087c4[_0x5e7b('0x55')]['SmsAccountId']=_0x28ef34['id'];return db['CannedAnswer'][_0x5e7b('0x54')](_0xb087c4[_0x5e7b('0x55')]);}})[_0x5e7b('0x1a')](respondWithResult(_0x2ae4c3,null))[_0x5e7b('0x4e')](handleError(_0x2ae4c3,null));};exports[_0x5e7b('0x66')]=function(_0x54e5b1,_0x578545,_0x36fa4e){var _0x4139da={'raw':![],'where':{}};var _0x64a057={};var _0x3e1b7d={'count':0x0,'rows':[]};return db[_0x5e7b('0x39')][_0x5e7b('0x5f')]({'where':{'id':_0x54e5b1[_0x5e7b('0x50')]['id']}})[_0x5e7b('0x1a')](handleEntityNotFound(_0x578545,null))[_0x5e7b('0x1a')](function(_0x1536e9){if(_0x1536e9){_0x64a057['model']=_['keys'](db['CannedAnswer'][_0x5e7b('0x52')]);_0x64a057['query']=_[_0x5e7b('0x3d')](_0x54e5b1[_0x5e7b('0x3c')]);_0x64a057[_0x5e7b('0x3e')]=_[_0x5e7b('0x3f')](_0x64a057['model'],_0x64a057[_0x5e7b('0x3c')]);_0x4139da[_0x5e7b('0x42')]=_[_0x5e7b('0x3f')](_0x64a057['model'],qs[_0x5e7b('0x41')](_0x54e5b1['query']['fields']));_0x4139da['attributes']=_0x4139da[_0x5e7b('0x42')][_0x5e7b('0x43')]?_0x4139da[_0x5e7b('0x42')]:_0x64a057[_0x5e7b('0x40')];if(!_0x54e5b1['query']['hasOwnProperty'](_0x5e7b('0x45'))){_0x4139da['limit']=qs[_0x5e7b('0x28')](_0x54e5b1['query'][_0x5e7b('0x28')]);_0x4139da[_0x5e7b('0x2a')]=qs[_0x5e7b('0x2a')](_0x54e5b1[_0x5e7b('0x3c')][_0x5e7b('0x2a')]);}_0x4139da['order']=qs[_0x5e7b('0x47')](_0x54e5b1[_0x5e7b('0x3c')][_0x5e7b('0x47')]);_0x4139da[_0x5e7b('0x49')]=qs['filters'](_[_0x5e7b('0x60')](_0x54e5b1[_0x5e7b('0x3c')],_0x64a057[_0x5e7b('0x3e')]));_0x4139da[_0x5e7b('0x49')][_0x5e7b('0x5d')]=_0x1536e9['id'];if(_0x54e5b1[_0x5e7b('0x3c')][_0x5e7b('0x48')]){_0x4139da[_0x5e7b('0x49')]=_[_0x5e7b('0x4a')](_0x4139da[_0x5e7b('0x49')],{'$or':_['map'](_0x4139da[_0x5e7b('0x42')],function(_0x369079){var _0x3b2a1d={};_0x3b2a1d[_0x369079]={'$like':'%'+_0x54e5b1['query'][_0x5e7b('0x48')]+'%'};return _0x3b2a1d;})});}_0x4139da=_[_0x5e7b('0x4a')]({},_0x4139da,_0x54e5b1[_0x5e7b('0x61')]);return db[_0x5e7b('0x67')][_0x5e7b('0x29')]({'where':_0x4139da[_0x5e7b('0x49')]})['then'](function(_0x1afd06){_0x3e1b7d['count']=_0x1afd06;if(_0x54e5b1['query'][_0x5e7b('0x4c')]){_0x4139da[_0x5e7b('0x4d')]=[{'all':!![]}];}return db[_0x5e7b('0x67')][_0x5e7b('0x68')](_0x4139da);})[_0x5e7b('0x1a')](function(_0x1a1cad){_0x3e1b7d[_0x5e7b('0x62')]=_0x1a1cad;return _0x3e1b7d;});}})['then'](respondWithFilteredResult(_0x578545,_0x4139da))[_0x5e7b('0x4e')](handleError(_0x578545,null));};exports[_0x5e7b('0x69')]=function(_0x2e0808,_0x20310e,_0x3e04bd){return db[_0x5e7b('0x39')][_0x5e7b('0x53')]({'where':{'id':_0x2e0808[_0x5e7b('0x50')]['id']}})[_0x5e7b('0x1a')](handleEntityNotFound(_0x20310e,null))['then'](function(_0x47389d){if(_0x47389d){return _0x47389d['removeAnswers'](_0x2e0808[_0x5e7b('0x3c')][_0x5e7b('0x64')]);}})['then'](respondWithStatusCode(_0x20310e,null))[_0x5e7b('0x4e')](handleError(_0x20310e,null));};exports['notify']=function(_0x247019,_0xf5869a,_0x1025b5){var _0x386b08={'channel':_0x5e7b('0x6a')};var _0xc38ef0=[];var _0x11bcee=[];var _0xe0dae0={};return db[_0x5e7b('0x39')][_0x5e7b('0x53')]({'where':{'id':_0x247019[_0x5e7b('0x50')]['id']},'include':[{'model':db[_0x5e7b('0x6b')],'as':_0x5e7b('0x6c')}]})[_0x5e7b('0x1a')](handleEntityNotFound(_0xf5869a,null))[_0x5e7b('0x1a')](function(_0x4be173){_0x386b08[_0x5e7b('0x6d')]=_0x4be173;_0x386b08[_0x5e7b('0x6e')]=_[_0x5e7b('0x6f')](_0x4be173[_0x5e7b('0x6c')],[_0x5e7b('0x70')],['asc']);if(_0x386b08[_0x5e7b('0x6d')]['Applications']){delete _0x386b08[_0x5e7b('0x6d')][_0x5e7b('0x6c')];}return db[_0x5e7b('0x71')][_0x5e7b('0x5b')]();})['then'](function(_0x584b42){if(!_0x584b42){throw new db[(_0x5e7b('0x72'))][(_0x5e7b('0x73'))](_0x5e7b('0x74'));}_0xc38ef0=_[_0x5e7b('0x75')](_[_0x5e7b('0x3d')](_0x584b42),['createdAt',_0x5e7b('0x76')]);_0x11bcee=_[_0x5e7b('0x75')](_[_0x5e7b('0x3d')](_0x584b42),['createdAt',_0x5e7b('0x76'),'CompanyId',_0x5e7b('0x77')]);_0x386b08['body']={'mapKey':_0x5e7b('0x78')};if(_0x386b08[_0x5e7b('0x6d')][_0x5e7b('0x3a')]){switch(_0x386b08[_0x5e7b('0x6d')][_0x5e7b('0x3a')]){case _0x5e7b('0x79'):_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x7a')]=_0x247019[_0x5e7b('0x55')]['From'];_0x386b08['body']['body']=_0x247019[_0x5e7b('0x55')][_0x5e7b('0x7b')];_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x7c')]=_0x247019['body'][_0x5e7b('0x7d')];break;case _0x5e7b('0x7e'):_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x7a')]='+'+_0x247019[_0x5e7b('0x55')]['sender'];_0x386b08[_0x5e7b('0x55')]['body']=_0x247019[_0x5e7b('0x55')][_0x5e7b('0x7f')];break;case _0x5e7b('0x80'):_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x7a')]=_0x247019['body'][_0x5e7b('0x7a')];_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x55')]=_0x247019[_0x5e7b('0x55')]['message'];break;case _0x5e7b('0x81'):_0x386b08['body'][_0x5e7b('0x7a')]=_0x247019[_0x5e7b('0x55')][_0x5e7b('0x7a')];_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x55')]=_0x247019[_0x5e7b('0x55')][_0x5e7b('0x55')];_0x386b08[_0x5e7b('0x55')]['messageId']=_0x247019[_0x5e7b('0x55')]['message_id'];break;case _0x5e7b('0x82'):_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x7a')]=_0x247019[_0x5e7b('0x55')][_0x5e7b('0x83')];_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x55')]=_0x247019[_0x5e7b('0x55')][_0x5e7b('0x84')];_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x7c')]=_0x247019[_0x5e7b('0x55')][_0x5e7b('0x85')];break;case'infobip':_0x386b08['body'][_0x5e7b('0x7a')]='+'+_0x247019[_0x5e7b('0x55')][_0x5e7b('0x86')][0x0][_0x5e7b('0x7a')];_0x386b08[_0x5e7b('0x55')]['body']=_0x247019[_0x5e7b('0x55')][_0x5e7b('0x86')][0x0][_0x5e7b('0x7f')];_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x7c')]=_0x247019[_0x5e7b('0x55')]['results'][0x0][_0x5e7b('0x7c')];break;case _0x5e7b('0x87'):_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x7a')]=_0x247019[_0x5e7b('0x55')]['originatingAddress'];_0x386b08[_0x5e7b('0x55')]['body']=_0x247019[_0x5e7b('0x55')][_0x5e7b('0x88')]['message'];break;case'clickatell':_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x7a')]=_0x247019['body'][_0x5e7b('0x89')];_0x386b08[_0x5e7b('0x55')]['body']=_0x247019[_0x5e7b('0x55')]['text'];_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x7c')]=_0x247019[_0x5e7b('0x55')]['replyMessageId'];break;case _0x5e7b('0x8a'):_0x386b08[_0x5e7b('0x55')]['messageId']=_0x247019[_0x5e7b('0x55')][0x0]['message']['id'];_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x7a')]=_0x247019['body'][0x0][_0x5e7b('0x23')][_0x5e7b('0x7a')];_0x386b08['body'][_0x5e7b('0x55')]=_0x247019[_0x5e7b('0x55')][0x0][_0x5e7b('0x23')][_0x5e7b('0x7f')];break;case _0x5e7b('0x8b'):_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x7a')]=_0x247019[_0x5e7b('0x55')][_0x5e7b('0x7a')];_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x55')]=_0x247019[_0x5e7b('0x55')][_0x5e7b('0x23')];_0x386b08[_0x5e7b('0x55')]['messageId']=_0x247019[_0x5e7b('0x55')]['refid'];break;}}if(_0x386b08[_0x5e7b('0x55')]['id']){delete _0x386b08[_0x5e7b('0x55')]['id'];}if(_[_0x5e7b('0x8c')](_0x386b08['body']['from'])){throw new db[(_0x5e7b('0x72'))][(_0x5e7b('0x73'))](_0x5e7b('0x8d'));}if(_[_0x5e7b('0x8c')](_0x386b08['body'][_0x5e7b('0x55')])||_0x386b08['body'][_0x5e7b('0x55')]===''){throw new db['Sequelize'][(_0x5e7b('0x73'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x8e')])){throw new db[(_0x5e7b('0x72'))][(_0x5e7b('0x73'))](_0x5e7b('0x8f')+_0x11bcee);}if(!_[_0x5e7b('0x90')](_0x11bcee,_0x386b08['body'][_0x5e7b('0x8e')])){throw new db[(_0x5e7b('0x72'))][(_0x5e7b('0x73'))](_0x5e7b('0x91')+_0x11bcee);}_0xe0dae0[_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x8e')]]=_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x7a')];return db['CmList']['find']({'where':{'id':_0x386b08[_0x5e7b('0x6d')][_0x5e7b('0x77')]},'include':[{'model':db[_0x5e7b('0x71')],'as':_0x5e7b('0x92'),'where':_0xe0dae0,'limit':0x1,'order':[[_0x5e7b('0x76'),_0x5e7b('0x93')]]}]});})[_0x5e7b('0x1a')](handleEntityNotFound(_0xf5869a,null))[_0x5e7b('0x1a')](function(_0x3f3742){if(_0x3f3742){_0x386b08[_0x5e7b('0x94')]=_['omit'](_0x3f3742,['Contacts']);if(_0x3f3742['Contacts']['length']){return _0x3f3742[_0x5e7b('0x92')][0x0];}var _0x534ac3=_[_0x5e7b('0x12')](_0x386b08[_0x5e7b('0x55')],{'firstName':_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x7a')],'ListId':_0x3f3742['id']});_0x534ac3[_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x8e')]]=_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x7a')];return db[_0x5e7b('0x71')]['create'](_0x534ac3,{'fields':_0xc38ef0,'raw':!![]});}})[_0x5e7b('0x1a')](handleEntityNotFound(_0xf5869a,null))[_0x5e7b('0x1a')](function(_0x4a3a43){if(_0x4a3a43){_0x386b08['contact']=_0x4a3a43;var _0x3ab043={'ContactId':_0x4a3a43['id'],'phone':_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x7a')],'SmsAccountId':_0x247019[_0x5e7b('0x50')]['id']};var _0x32023c={'ContactId':_0x4a3a43['id'],'SmsAccountId':_0x247019['params']['id'],'closed':![]};return db[_0x5e7b('0x95')][_0x5e7b('0x53')]({'where':_0x32023c})['then'](function(_0xfbe409){if(_0xfbe409){return[_0xfbe409,![]];}return db[_0x5e7b('0x95')][_0x5e7b('0x54')](_0x3ab043)['then'](function(_0x40504e){return[_0x40504e,!![]];});});}})[_0x5e7b('0x96')](function(_0x186ad1,_0x27c370){_0x386b08['interaction']=_0x186ad1[_0x5e7b('0x31')]({'plain':!![]});_0x386b08['interaction'][_0x5e7b('0x97')]=![];if(_0x27c370){if(_0x386b08[_0x5e7b('0x6d')][_0x5e7b('0x98')]){_0x386b08[_0x5e7b('0x6e')][_0x5e7b('0x99')]({'id':0x0,'priority':_0x386b08[_0x5e7b('0x6e')][_0x5e7b('0x43')]+0x1,'app':_0x5e7b('0x9a'),'appdata':'unmanaged','interval':_0x5e7b('0x9b')});}_0x386b08[_0x5e7b('0x9c')]['created']=!![];}return db[_0x5e7b('0x9d')]['create']({'phone':_0x386b08[_0x5e7b('0x55')]['from'],'messageId':_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x7c')],'body':_0x386b08[_0x5e7b('0x55')][_0x5e7b('0x55')],'SmsAccountId':_0x247019[_0x5e7b('0x50')]['id'],'SmsInteractionId':_0x186ad1['id'],'direction':'in','ContactId':_0x186ad1['ContactId'],'AttachmentId':_0x386b08['body']['AttachmentId']});})['then'](function(_0x7a46de){_0x386b08[_0x5e7b('0x23')]=_0x7a46de;if(_0x386b08[_0x5e7b('0x9c')][_0x5e7b('0x9e')]){return db['User'][_0x5e7b('0x53')]({'attributes':['id',_0x5e7b('0x35')],'where':{'id':_0x386b08[_0x5e7b('0x9c')][_0x5e7b('0x9e')]}})[_0x5e7b('0x1a')](function(_0x52014b){if(_0x52014b){_0x386b08[_0x5e7b('0x6e')]['unshift']({'id':0x0,'priority':0x0,'app':_0x5e7b('0x9f'),'appdata':_0x52014b[_0x5e7b('0x35')]+','+(_0x386b08[_0x5e7b('0x6d')][_0x5e7b('0xa0')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0x5e7b('0xa1'),_0x386b08);});}return respondWithRpcPromise(_0x5e7b('0xa2'),_0x5e7b('0xa1'),_0x386b08);})[_0x5e7b('0x1a')](function(_0x40b25a){if(_0x40b25a){var _0x1d7413=0xc8;var _0xacbc59=_0x5e7b('0xa3');logger[_0x5e7b('0x1b')](_0x5e7b('0x1f'),_0xacbc59,_0x1d7413,_0x5e7b('0xa4'));logger[_0x5e7b('0x1e')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0xacbc59,_0x1d7413,_0x5e7b('0xa4'),JSON[_0x5e7b('0x20')](_0x40b25a));if(_0x386b08[_0x5e7b('0x6d')][_0x5e7b('0x3a')]===_0x5e7b('0x79')){return _0xf5869a[_0x5e7b('0x26')](_0x1d7413)['set'](_0x5e7b('0xa5'),_0x5e7b('0xa6'))[_0x5e7b('0x36')](_0x5e7b('0xa7'));}else{return _0xf5869a[_0x5e7b('0x26')](_0x1d7413)['json'](_0x40b25a);}}})[_0x5e7b('0x4e')](handleError(_0xf5869a,null));};exports[_0x5e7b('0xa8')]=function(_0x1dac78,_0x37b725){var _0x5a0412=_0x1dac78[_0x5e7b('0x50')]['id'];var _0x2a7bd1=_0x1dac78[_0x5e7b('0x55')];var _0x567b6a=0xc8;var _0x4730a4=null;return db[_0x5e7b('0xa9')]['transaction']({'isolationLevel':db[_0x5e7b('0xa9')][_0x5e7b('0xaa')][_0x5e7b('0xab')][_0x5e7b('0xac')]},function(_0x220ac5){return db[_0x5e7b('0x39')]['findOne']({'where':{'id':_0x5a0412},'transaction':_0x220ac5})['then'](function(_0x126383){if(_0x126383){return db[_0x5e7b('0x6b')][_0x5e7b('0x30')]({'where':{'SmsAccountId':_0x5a0412},'transaction':_0x220ac5})[_0x5e7b('0x1a')](function(){var _0x2712cf=_['map'](_0x2a7bd1,function(_0x162975){_0x162975[_0x5e7b('0x5d')]=_0x5a0412;return _0x162975;});return db[_0x5e7b('0x6b')]['bulkCreate'](_0x2712cf,{'transaction':_0x220ac5});});}else{_0x567b6a=0x194;_0x4730a4=[];}});})[_0x5e7b('0x1a')](function(){if(_0x567b6a!==0x194){return db[_0x5e7b('0x6b')][_0x5e7b('0xad')]({'where':{'SmsAccountId':_0x5a0412},'order':_0x5e7b('0x70')})[_0x5e7b('0x1a')](function(_0x3b5cdc){_0x4730a4=_0x3b5cdc;});}})['catch'](function(_0x3d50c4){_0x567b6a=0x1f4;logger[_0x5e7b('0x21')](_0x3d50c4['stack']);if(_0x3d50c4['name']){delete _0x3d50c4['name'];}_0x4730a4=_0x3d50c4;})[_0x5e7b('0xae')](function(){if(_0x4730a4===null){_0x37b725['sendStatus'](_0x567b6a);}else{if(_0x567b6a===0x1f4){_0x37b725[_0x5e7b('0x26')](_0x567b6a)['send'](_0x4730a4);}else{_0x37b725[_0x5e7b('0x26')](_0x567b6a)[_0x5e7b('0xaf')](_0x4730a4);}}});};exports[_0x5e7b('0xb0')]=function(_0x18eb2e,_0x4a0780,_0x4f87fe){var _0x346443={};var _0xe90fcb={};var _0x51accb;var _0x2f7c08;return db[_0x5e7b('0x39')][_0x5e7b('0x5f')]({'where':{'id':_0x18eb2e[_0x5e7b('0x50')]['id']}})[_0x5e7b('0x1a')](handleEntityNotFound(_0x4a0780,null))[_0x5e7b('0x1a')](function(_0x5879ca){if(_0x5879ca){_0x51accb=_0x5879ca;_0xe90fcb[_0x5e7b('0x40')]=_[_0x5e7b('0x3d')](db[_0x5e7b('0x6b')]['rawAttributes']);_0xe90fcb[_0x5e7b('0x3c')]=_['keys'](_0x18eb2e[_0x5e7b('0x3c')]);_0xe90fcb[_0x5e7b('0x3e')]=_[_0x5e7b('0x3f')](_0xe90fcb[_0x5e7b('0x40')],_0xe90fcb['query']);_0x346443[_0x5e7b('0x42')]=_[_0x5e7b('0x3f')](_0xe90fcb[_0x5e7b('0x40')],qs[_0x5e7b('0x41')](_0x18eb2e[_0x5e7b('0x3c')][_0x5e7b('0x41')]));_0x346443[_0x5e7b('0x42')]=_0x346443['attributes'][_0x5e7b('0x43')]?_0x346443[_0x5e7b('0x42')]:_0xe90fcb['model'];_0x346443['order']=qs['sort'](_0x18eb2e[_0x5e7b('0x3c')][_0x5e7b('0x47')]);_0x346443['where']=qs[_0x5e7b('0x3e')](_['pick'](_0x18eb2e[_0x5e7b('0x3c')],_0xe90fcb['filters']));if(_0x18eb2e[_0x5e7b('0x3c')]['filter']){_0x346443[_0x5e7b('0x49')]=_[_0x5e7b('0x4a')](_0x346443[_0x5e7b('0x49')],{'$or':_[_0x5e7b('0x38')](_0x346443[_0x5e7b('0x42')],function(_0x310df1){var _0x3130e3={};_0x3130e3[_0x310df1]={'$like':'%'+_0x18eb2e[_0x5e7b('0x3c')][_0x5e7b('0x48')]+'%'};return _0x3130e3;})});}_0x346443=_['merge']({},_0x346443,_0x18eb2e['options']);return _0x51accb['getApplications'](_0x346443);}})[_0x5e7b('0x1a')](function(_0x234111){if(_0x234111){_0x2f7c08=_0x234111[_0x5e7b('0x43')];if(!_0x18eb2e[_0x5e7b('0x3c')][_0x5e7b('0x44')]('nolimit')){_0x346443[_0x5e7b('0x28')]=qs[_0x5e7b('0x28')](_0x18eb2e['query']['limit']);_0x346443[_0x5e7b('0x2a')]=qs['offset'](_0x18eb2e['query'][_0x5e7b('0x2a')]);}return _0x51accb[_0x5e7b('0xb0')](_0x346443);}})[_0x5e7b('0x1a')](function(_0x419dfd){if(_0x419dfd){return _0x419dfd?{'count':_0x2f7c08,'rows':_0x419dfd}:null;}})[_0x5e7b('0x1a')](respondWithResult(_0x4a0780,null))[_0x5e7b('0x4e')](handleError(_0x4a0780,null));};exports['getInteractions']=function(_0x55f8e1,_0x3fb5ac,_0x3c6270){var _0x4393cb={'raw':![],'where':{}};var _0x299819={};var _0x45c7e2={'count':0x0,'rows':[]};return db[_0x5e7b('0x39')][_0x5e7b('0x5f')]({'where':{'id':_0x55f8e1[_0x5e7b('0x50')]['id']}})[_0x5e7b('0x1a')](handleEntityNotFound(_0x3fb5ac,null))[_0x5e7b('0x1a')](function(_0x4f56b1){if(_0x4f56b1){_0x299819[_0x5e7b('0x40')]=_['keys'](db[_0x5e7b('0x95')]['rawAttributes']);_0x299819[_0x5e7b('0x3c')]=_[_0x5e7b('0x3d')](_0x55f8e1['query']);_0x299819['filters']=_['intersection'](_0x299819[_0x5e7b('0x40')],_0x299819[_0x5e7b('0x3c')]);_0x4393cb['attributes']=_[_0x5e7b('0x3f')](_0x299819[_0x5e7b('0x40')],qs[_0x5e7b('0x41')](_0x55f8e1[_0x5e7b('0x3c')][_0x5e7b('0x41')]));_0x4393cb[_0x5e7b('0x42')]=_0x4393cb[_0x5e7b('0x42')]['length']?_0x4393cb[_0x5e7b('0x42')]:_0x299819['model'];if(!_0x55f8e1[_0x5e7b('0x3c')][_0x5e7b('0x44')](_0x5e7b('0x45'))){_0x4393cb['limit']=qs[_0x5e7b('0x28')](_0x55f8e1['query'][_0x5e7b('0x28')]);_0x4393cb[_0x5e7b('0x2a')]=qs['offset'](_0x55f8e1['query'][_0x5e7b('0x2a')]);}_0x4393cb[_0x5e7b('0x46')]=qs[_0x5e7b('0x47')](_0x55f8e1[_0x5e7b('0x3c')][_0x5e7b('0x47')]);_0x4393cb[_0x5e7b('0x49')]=qs[_0x5e7b('0x3e')](_[_0x5e7b('0x60')](_0x55f8e1[_0x5e7b('0x3c')],_0x299819['filters']));_0x4393cb[_0x5e7b('0x49')][_0x5e7b('0x5d')]=_0x4f56b1['id'];if(_0x55f8e1[_0x5e7b('0x3c')][_0x5e7b('0x48')]){_0x4393cb[_0x5e7b('0x49')]=_[_0x5e7b('0x4a')](_0x4393cb['where'],{'$or':_[_0x5e7b('0x38')](_0x4393cb['attributes'],function(_0x5404f8){var _0x44a609={};_0x44a609[_0x5404f8]={'$like':'%'+_0x55f8e1['query'][_0x5e7b('0x48')]+'%'};return _0x44a609;})});}_0x4393cb=_[_0x5e7b('0x4a')]({},_0x4393cb,_0x55f8e1[_0x5e7b('0x61')]);return db[_0x5e7b('0x95')]['count']({'where':_0x4393cb[_0x5e7b('0x49')]})[_0x5e7b('0x1a')](function(_0x2aa4d6){_0x45c7e2[_0x5e7b('0x29')]=_0x2aa4d6;if(_0x55f8e1[_0x5e7b('0x3c')]['includeAll']){_0x4393cb['include']=[{'model':db[_0x5e7b('0x71')],'as':'Contact','required':![]},{'model':db[_0x5e7b('0xb1')],'as':_0x5e7b('0xb2'),'attributes':['name',_0x5e7b('0xb3'),_0x5e7b('0xb4')],'required':![]},{'model':db[_0x5e7b('0xb5')],'as':_0x5e7b('0xb6'),'attributes':['id',_0x5e7b('0x35'),'color'],'where':_0x55f8e1[_0x5e7b('0x3c')][_0x5e7b('0xb7')]?{'id':_0x55f8e1[_0x5e7b('0x3c')]['tag']}:undefined,'required':_0x55f8e1[_0x5e7b('0x3c')][_0x5e7b('0xb7')]?!![]:![]}];}return db[_0x5e7b('0x95')]['findAll'](_0x4393cb);})[_0x5e7b('0x1a')](function(_0x22b935){_0x45c7e2[_0x5e7b('0x62')]=_0x22b935;return _0x45c7e2;});}})[_0x5e7b('0x1a')](respondWithFilteredResult(_0x3fb5ac,_0x4393cb))[_0x5e7b('0x4e')](handleError(_0x3fb5ac,null));};exports[_0x5e7b('0x36')]=function(_0x161ae2,_0x52307c,_0x244534){var _0x5a9a58,_0x598a7d,_0x59433d;if(_[_0x5e7b('0x8c')](_0x161ae2['body'][_0x5e7b('0x55')])||_0x161ae2['body']['body']===''){throw new db['Sequelize'][(_0x5e7b('0x73'))](_0x5e7b('0xb8'));}if(_['isNil'](_0x161ae2[_0x5e7b('0x55')]['to'])){throw new db[(_0x5e7b('0x72'))][(_0x5e7b('0x73'))](_0x5e7b('0xb9'));}_0x5a9a58=_0x161ae2[_0x5e7b('0x55')]['to'];return db[_0x5e7b('0x39')][_0x5e7b('0x53')]({'where':{'id':_0x161ae2[_0x5e7b('0x50')]['id']},'include':[{'model':db[_0x5e7b('0xba')],'as':'List','include':[{'model':db[_0x5e7b('0x71')],'as':_0x5e7b('0x92'),'where':{'mobile':_0x5a9a58},'limit':0x1,'order':[['updatedAt',_0x5e7b('0x93')]]}]}]})['then'](handleEntityNotFound(_0x52307c,null))[_0x5e7b('0x1a')](function(_0x10c7fc){if(_0x10c7fc&&_0x10c7fc[_0x5e7b('0xbb')]){_0x598a7d=_0x10c7fc[_0x5e7b('0x31')]({'plain':!![]});if(_0x598a7d[_0x5e7b('0xbb')]&&_0x598a7d['List']['Contacts'][_0x5e7b('0x43')]){return _0x598a7d['List'][_0x5e7b('0x92')][0x0];}return db[_0x5e7b('0x71')][_0x5e7b('0x54')](_[_0x5e7b('0x12')](_0x161ae2[_0x5e7b('0x55')],{'firstName':_0x5a9a58,'mobile':_0x5a9a58,'phone':_0x5a9a58,'ListId':_0x598a7d[_0x5e7b('0x77')]}));}})[_0x5e7b('0x1a')](handleEntityNotFound(_0x52307c,null))[_0x5e7b('0x1a')](function(_0x5dd31a){if(_0x5dd31a){_0x59433d=_0x5dd31a;return db['SmsInteraction'][_0x5e7b('0x53')]({'where':{'ContactId':_0x59433d['id'],'closed':![],'SmsAccountId':_0x598a7d['id']}})['then'](function(_0x58d098){if(_0x58d098){return[_0x58d098,![]];}return db['SmsInteraction']['create']({'UserId':_0x161ae2[_0x5e7b('0x56')]['id'],'ContactId':_0x59433d['id'],'SmsAccountId':_0x598a7d['id'],'phone':_0x5a9a58,'firstMsgDirection':_0x5e7b('0xbc'),'Messages':[_[_0x5e7b('0x4a')](_0x161ae2[_0x5e7b('0x55')],{'read':![],'body':_0x161ae2['body'][_0x5e7b('0x55')],'phone':_0x5a9a58,'SmsAccountId':_0x598a7d['id'],'UserId':_0x161ae2[_0x5e7b('0x56')]['id'],'ContactId':_0x59433d['id']})]},{'include':[{'model':db[_0x5e7b('0x9d')],'as':_0x5e7b('0xbd')}]})[_0x5e7b('0x1a')](function(_0x45e6af){return[_0x45e6af,!![]];});});}})[_0x5e7b('0x96')](function(_0x39f7d8,_0x194d6e){if(_0x194d6e){return _0x39f7d8;}return db[_0x5e7b('0x9d')][_0x5e7b('0x54')](_[_0x5e7b('0x4a')](_0x161ae2[_0x5e7b('0x55')],{'read':![],'body':_0x161ae2[_0x5e7b('0x55')][_0x5e7b('0x55')],'phone':_0x5a9a58,'SmsAccountId':_0x598a7d['id'],'SmsInteractionId':_0x39f7d8['id'],'UserId':_0x161ae2[_0x5e7b('0x56')]['id'],'ContactId':_0x59433d['id']}))[_0x5e7b('0x1a')](function(_0x3451ca){_0x39f7d8[_0x5e7b('0xbe')][_0x5e7b('0xbd')]=[];_0x39f7d8[_0x5e7b('0xbe')][_0x5e7b('0xbd')]['push'](_0x3451ca['dataValues']);return _0x39f7d8;});})['then'](respondWithResult(_0x52307c,null))[_0x5e7b('0x4e')](handleError(_0x52307c,null));};exports[_0x5e7b('0x26')]=function(_0x10cb14,_0x4636e2,_0xde179){if(_0x10cb14[_0x5e7b('0x55')]['id']){delete _0x10cb14[_0x5e7b('0x55')]['id'];}var _0x25e697,_0x2e3d9c,_0x3364d2;return db[_0x5e7b('0x39')][_0x5e7b('0x53')]({'where':{'id':_0x10cb14[_0x5e7b('0x50')]['id']}})[_0x5e7b('0x1a')](handleEntityNotFound(_0x4636e2,null))[_0x5e7b('0x1a')](function(_0x61f9ef){if(_0x61f9ef){_0x3364d2=_0x61f9ef;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5e7b('0x26'),_0x5e7b('0xbf'),_0x61f9ef[_0x5e7b('0x3a')],util[_0x5e7b('0xc0')](_0x10cb14['body'],{'showHidden':![],'depth':null}));switch(_0x61f9ef[_0x5e7b('0x3a')]){case _0x5e7b('0x7e'):if(_0x10cb14[_0x5e7b('0x55')][_0x5e7b('0xc1')]&&_0x10cb14[_0x5e7b('0x55')]['status']){_0x2e3d9c=_0x10cb14[_0x5e7b('0x55')][_0x5e7b('0x26')];return db[_0x5e7b('0x9d')][_0x5e7b('0x53')]({'where':{'messageId':_0x10cb14['body'][_0x5e7b('0xc1')]}});}break;case'connectel':if(_0x10cb14[_0x5e7b('0x55')][_0x5e7b('0xc2')]&&_0x10cb14[_0x5e7b('0x55')][_0x5e7b('0xc3')]){_0x2e3d9c=_0x10cb14[_0x5e7b('0x55')]['statusInt'];return db[_0x5e7b('0x9d')][_0x5e7b('0x53')]({'where':{'messageId':_0x10cb14[_0x5e7b('0x55')][_0x5e7b('0xc2')]}});}break;case _0x5e7b('0x81'):if(_0x10cb14['body'][_0x5e7b('0xc4')]&&_0x10cb14[_0x5e7b('0x55')][_0x5e7b('0xc5')]){_0x2e3d9c=_0x10cb14[_0x5e7b('0x55')][_0x5e7b('0xc5')];return db[_0x5e7b('0x9d')][_0x5e7b('0x53')]({'where':{'messageId':_0x10cb14[_0x5e7b('0x55')][_0x5e7b('0xc4')]}});}break;case _0x5e7b('0xc6'):var _0x468ede=_0x10cb14['body'][_0x5e7b('0x86')][0x0];if(_0x468ede[_0x5e7b('0x7c')]&&_0x468ede[_0x5e7b('0x26')][_0x5e7b('0xc7')]==='DELIVERED'){_0x2e3d9c=_0x468ede[_0x5e7b('0x26')]['groupName'];return db[_0x5e7b('0x9d')][_0x5e7b('0x53')]({'where':{'messageId':_0x468ede['messageId']}});}break;case'clickatell':if(_0x10cb14[_0x5e7b('0x55')][_0x5e7b('0x7c')]&&_0x10cb14[_0x5e7b('0x55')][_0x5e7b('0x26')]){_0x2e3d9c=_0x10cb14[_0x5e7b('0x55')][_0x5e7b('0x26')];return db[_0x5e7b('0x9d')][_0x5e7b('0x53')]({'where':{'messageId':_0x10cb14[_0x5e7b('0x55')][_0x5e7b('0x7c')]}});}break;case _0x5e7b('0x8a'):if(_0x10cb14[_0x5e7b('0x55')][0x0][_0x5e7b('0x23')]['id']){_0x2e3d9c=_0x10cb14['body'][0x0][_0x5e7b('0x3a')];return db[_0x5e7b('0x9d')][_0x5e7b('0x53')]({'where':{'messageId':_0x10cb14['body'][0x0][_0x5e7b('0x23')]['id']}});}break;case'intelepeer':if(_0x10cb14[_0x5e7b('0x55')][_0x5e7b('0xc8')]&&_0x10cb14['body'][_0x5e7b('0x26')]){_0x2e3d9c=_0x10cb14[_0x5e7b('0x55')][_0x5e7b('0x26')];return db['SmsMessage']['find']({'where':{'messageId':_0x10cb14[_0x5e7b('0x55')][_0x5e7b('0xc8')]}});}break;}}})[_0x5e7b('0x1a')](handleEntityNotFound(_0x4636e2,null))[_0x5e7b('0x1a')](function(_0x3ebc70){if(_0x3ebc70){_0x25e697=_0x3ebc70;switch(_0x3364d2[_0x5e7b('0x3a')]){case _0x5e7b('0x7e'):if(_0x2e3d9c===_0x5e7b('0xc9')){return _0x25e697[_0x5e7b('0x2f')]({'read':!![]});}else{logger[_0x5e7b('0x21')](_0x5e7b('0x1f'),'status','skebby',util[_0x5e7b('0xc0')](_0x10cb14[_0x5e7b('0x55')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x2e3d9c==='1'){return _0x25e697[_0x5e7b('0x2f')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5e7b('0x26'),_0x5e7b('0x7e'),util['inspect'](_0x10cb14[_0x5e7b('0x55')],{'showHidden':![],'depth':null}));}break;case _0x5e7b('0x81'):if(!_0x10cb14[_0x5e7b('0x55')]['error_code']&&_0x2e3d9c>=0xc8&&_0x2e3d9c<=0xce){return _0x25e697[_0x5e7b('0x2f')]({'read':!![]});}else{logger['error'](_0x5e7b('0x1f'),_0x5e7b('0x26'),_0x5e7b('0x81'),util[_0x5e7b('0xc0')](_0x10cb14[_0x5e7b('0x55')],{'showHidden':![],'depth':null}));}break;case _0x5e7b('0xc6'):var _0x567de2=_0x10cb14[_0x5e7b('0x55')][_0x5e7b('0x86')][0x0];if(_0x567de2['status'][_0x5e7b('0xc7')]==='DELIVERED'){return _0x25e697[_0x5e7b('0x2f')]({'read':!![]});}else{logger['error'](_0x5e7b('0x1f'),'status','infobip',util[_0x5e7b('0xc0')](_0x10cb14['body'],{'showHidden':![],'depth':null}));}break;case _0x5e7b('0xca'):if(_0x2e3d9c==_0x5e7b('0xcb')||_0x2e3d9c==_0x5e7b('0xcc')){return _0x25e697['update']({'read':!![]});}else{logger[_0x5e7b('0x21')](_0x5e7b('0x1f'),_0x5e7b('0x26'),_0x5e7b('0xca'),util[_0x5e7b('0xc0')](_0x10cb14[_0x5e7b('0x55')],{'showHidden':![],'depth':null}));}break;case _0x5e7b('0x8a'):if(_0x2e3d9c==_0x5e7b('0xcd')){return _0x25e697[_0x5e7b('0x2f')]({'read':!![]});}else{logger[_0x5e7b('0x21')](_0x5e7b('0x1f'),_0x5e7b('0x26'),_0x5e7b('0x8a'),util[_0x5e7b('0xc0')](_0x10cb14[_0x5e7b('0x55')],{'showHidden':![],'depth':null}));}break;case _0x5e7b('0x8b'):if(_0x2e3d9c==='DELIVRD'||_0x2e3d9c===_0x5e7b('0xce')){return _0x25e697[_0x5e7b('0x2f')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5e7b('0x26'),_0x5e7b('0x8b'),util[_0x5e7b('0xc0')](_0x10cb14[_0x5e7b('0x55')],{'showHidden':![],'depth':null}));}break;}return _0x25e697;}})['then'](respondWithResult(_0x4636e2,null))[_0x5e7b('0x4e')](handleError(_0x4636e2,null));};exports[_0x5e7b('0xcf')]=function(_0x2d7e8a,_0x108be1,_0x4a1b9f){var _0x1dcc8b,_0x34eae0,_0x3b647e;return db[_0x5e7b('0x39')][_0x5e7b('0x53')]({'where':{'id':_0x2d7e8a['params']['id']}})[_0x5e7b('0x1a')](handleEntityNotFound(_0x108be1,null))['then'](function(_0x4da76e){if(_0x4da76e){_0x3b647e=_0x4da76e;logger[_0x5e7b('0x1e')](_0x5e7b('0x1f'),_0x5e7b('0x26'),_0x5e7b('0xbf'),_0x4da76e[_0x5e7b('0x3a')],util[_0x5e7b('0xc0')](_0x2d7e8a[_0x5e7b('0x3c')],{'showHidden':![],'depth':null}));switch(_0x4da76e[_0x5e7b('0x3a')]){case'csc':if(_0x2d7e8a[_0x5e7b('0x3c')][_0x5e7b('0xd0')]&&_0x2d7e8a[_0x5e7b('0x3c')][_0x5e7b('0xd1')]){_0x34eae0=_0x2d7e8a[_0x5e7b('0x3c')][_0x5e7b('0xd1')];return db[_0x5e7b('0x9d')][_0x5e7b('0x53')]({'where':{'messageId':_0x2d7e8a[_0x5e7b('0x3c')][_0x5e7b('0xd0')]}});}break;}}})['then'](handleEntityNotFound(_0x108be1,null))[_0x5e7b('0x1a')](function(_0x5c40f4){if(_0x5c40f4){_0x1dcc8b=_0x5c40f4;switch(_0x3b647e[_0x5e7b('0x3a')]){case'csc':if(_0x34eae0==='2'||_0x34eae0==='6'){return _0x1dcc8b[_0x5e7b('0x2f')]({'read':!![]});}else{logger[_0x5e7b('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5e7b('0x26'),_0x5e7b('0x87'),util[_0x5e7b('0xc0')](_0x2d7e8a[_0x5e7b('0x3c')],{'showHidden':![],'depth':null}));};break;}return _0x1dcc8b;}})['then'](respondWithResult(_0x108be1,null))['catch'](handleError(_0x108be1,null));};exports['addAgents']=function(_0x50099e,_0xe7e7df,_0x3e0654){return db['SmsAccount'][_0x5e7b('0x53')]({'where':{'id':_0x50099e[_0x5e7b('0x50')]['id']}})[_0x5e7b('0x1a')](handleEntityNotFound(_0xe7e7df,null))['then'](function(_0x4f0ed4){if(_0x4f0ed4){return _0x4f0ed4[_0x5e7b('0xd2')](_0x50099e[_0x5e7b('0x55')]['ids'],_[_0x5e7b('0xd3')](_0x50099e['body'],[_0x5e7b('0x64'),'id'])||{})[_0x5e7b('0x96')](function(_0x507e85){for(var _0x572a24=0x0;_0x572a24<_0x50099e[_0x5e7b('0x55')][_0x5e7b('0x64')][_0x5e7b('0x43')];_0x572a24+=0x1){socket[_0x5e7b('0xd4')](_0x5e7b('0xd5'),{'UserId':Number(_0x50099e[_0x5e7b('0x55')][_0x5e7b('0x64')][_0x572a24]),'SmsAccountId':Number(_0x50099e['params']['id'])});}return _0x507e85;});}})[_0x5e7b('0x1a')](respondWithResult(_0xe7e7df,null))['catch'](handleError(_0xe7e7df,null));};exports[_0x5e7b('0xd6')]=function(_0x48b9a7,_0x29e097,_0x3185f3){return db['SmsAccount'][_0x5e7b('0x53')]({'where':{'id':_0x48b9a7['params']['id']}})['then'](handleEntityNotFound(_0x29e097,null))[_0x5e7b('0x1a')](function(_0x13922d){if(_0x13922d){return _0x13922d[_0x5e7b('0xd6')](_0x48b9a7[_0x5e7b('0x3c')][_0x5e7b('0x64')])[_0x5e7b('0x1a')](function(){if(_[_0x5e7b('0xd7')](_0x48b9a7['query'][_0x5e7b('0x64')])){for(var _0x42d650=0x0;_0x42d650<_0x48b9a7[_0x5e7b('0x3c')][_0x5e7b('0x64')][_0x5e7b('0x43')];_0x42d650+=0x1){socket[_0x5e7b('0xd4')]('userSmsAccount:remove',{'UserId':Number(_0x48b9a7['query'][_0x5e7b('0x64')][_0x42d650]),'SmsAccountId':Number(_0x48b9a7['params']['id'])});}}else{socket[_0x5e7b('0xd4')](_0x5e7b('0xd8'),{'UserId':Number(_0x48b9a7['query'][_0x5e7b('0x64')]),'SmsAccountId':Number(_0x48b9a7[_0x5e7b('0x50')]['id'])});}});}})['then'](respondWithStatusCode(_0x29e097,null))['catch'](handleError(_0x29e097,null));};exports[_0x5e7b('0xd9')]=function(_0x5510fa,_0x26ebe7,_0x4307a6){var _0x3f569c={};var _0x3da710={};var _0x580647;var _0x2ebfc8;return db[_0x5e7b('0x39')]['findOne']({'where':{'id':_0x5510fa[_0x5e7b('0x50')]['id']}})[_0x5e7b('0x1a')](handleEntityNotFound(_0x26ebe7,null))[_0x5e7b('0x1a')](function(_0x556e21){if(_0x556e21){_0x580647=_0x556e21;_0x3da710[_0x5e7b('0x40')]=_[_0x5e7b('0x3d')](db['User']['rawAttributes']);_0x3da710[_0x5e7b('0x3c')]=_[_0x5e7b('0x3d')](_0x5510fa[_0x5e7b('0x3c')]);_0x3da710[_0x5e7b('0x3e')]=_[_0x5e7b('0x3f')](_0x3da710['model'],_0x3da710[_0x5e7b('0x3c')]);_0x3f569c['attributes']=_[_0x5e7b('0x3f')](_0x3da710[_0x5e7b('0x40')],qs['fields'](_0x5510fa[_0x5e7b('0x3c')][_0x5e7b('0x41')]));_0x3f569c[_0x5e7b('0x42')]=_0x3f569c['attributes'][_0x5e7b('0x43')]?_0x3f569c[_0x5e7b('0x42')]:_0x3da710[_0x5e7b('0x40')];_0x3f569c[_0x5e7b('0x46')]=qs[_0x5e7b('0x47')](_0x5510fa[_0x5e7b('0x3c')][_0x5e7b('0x47')]);_0x3f569c['where']=qs['filters'](_[_0x5e7b('0x60')](_0x5510fa[_0x5e7b('0x3c')],_0x3da710[_0x5e7b('0x3e')]));if(_0x5510fa['query'][_0x5e7b('0x48')]){_0x3f569c['where']=_[_0x5e7b('0x4a')](_0x3f569c[_0x5e7b('0x49')],{'$or':_[_0x5e7b('0x38')](_0x3f569c[_0x5e7b('0x42')],function(_0x4d296b){var _0x4f6582={};_0x4f6582[_0x4d296b]={'$like':'%'+_0x5510fa[_0x5e7b('0x3c')][_0x5e7b('0x48')]+'%'};return _0x4f6582;})});}_0x3f569c=_['merge']({},_0x3f569c,_0x5510fa[_0x5e7b('0x61')]);return _0x580647['getAgents'](_0x3f569c);}})[_0x5e7b('0x1a')](function(_0x57cf74){if(_0x57cf74){_0x2ebfc8=_0x57cf74[_0x5e7b('0x43')];if(!_0x5510fa[_0x5e7b('0x3c')][_0x5e7b('0x44')](_0x5e7b('0x45'))){_0x3f569c[_0x5e7b('0x28')]=qs[_0x5e7b('0x28')](_0x5510fa[_0x5e7b('0x3c')]['limit']);_0x3f569c[_0x5e7b('0x2a')]=qs[_0x5e7b('0x2a')](_0x5510fa['query'][_0x5e7b('0x2a')]);}return _0x580647[_0x5e7b('0xd9')](_0x3f569c);}})[_0x5e7b('0x1a')](function(_0x2af304){if(_0x2af304){return _0x2af304?{'count':_0x2ebfc8,'rows':_0x2af304}:null;}})['then'](respondWithResult(_0x26ebe7,null))[_0x5e7b('0x4e')](handleError(_0x26ebe7,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 3f49cf3..0715ffd 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 _0x4b35=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','SmsAccount','setMaxListeners'];(function(_0x2e34c4,_0x4fb4c0){var _0xac971d=function(_0x1c16e2){while(--_0x1c16e2){_0x2e34c4['push'](_0x2e34c4['shift']());}};_0xac971d(++_0x4fb4c0);}(_0x4b35,0x95));var _0x54b3=function(_0x236ac8,_0xa798d6){_0x236ac8=_0x236ac8-0x0;var _0x1ff538=_0x4b35[_0x236ac8];return _0x1ff538;};'use strict';var EventEmitter=require(_0x54b3('0x0'));var SmsAccount=require(_0x54b3('0x1'))['db'][_0x54b3('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x54b3('0x3')](0x0);var events={'afterCreate':_0x54b3('0x4'),'afterUpdate':'update','afterDestroy':_0x54b3('0x5')};function emitEvent(_0x1f63ab){return function(_0x5bfaf2,_0x4db480,_0x5c7472){SmsAccountEvents[_0x54b3('0x6')](_0x1f63ab+':'+_0x5bfaf2['id'],_0x5bfaf2);SmsAccountEvents['emit'](_0x1f63ab,_0x5bfaf2);_0x5c7472(null);};}for(var e in events){if(events[_0x54b3('0x7')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x54b3('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x7797=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x41cde8,_0x403375){var _0x473e3e=function(_0x3ed575){while(--_0x3ed575){_0x41cde8['push'](_0x41cde8['shift']());}};_0x473e3e(++_0x403375);}(_0x7797,0x161));var _0x7779=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0x7797[_0x15c421];return _0x5e5ed5;};'use strict';var EventEmitter=require(_0x7779('0x0'));var SmsAccount=require(_0x7779('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x7779('0x2')](0x0);var events={'afterCreate':_0x7779('0x3'),'afterUpdate':_0x7779('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5e25b1){return function(_0x2e004b,_0x194e6b,_0x29a36a){SmsAccountEvents[_0x7779('0x5')](_0x5e25b1+':'+_0x2e004b['id'],_0x2e004b);SmsAccountEvents[_0x7779('0x5')](_0x5e25b1,_0x2e004b);_0x29a36a(null);};}for(var e in events){if(events[_0x7779('0x6')](e)){var event=events[e];SmsAccount[_0x7779('0x7')](e,emitEvent(event));}}module[_0x7779('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index bb6cf11..212c405 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 _0x844d=['./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','util','api','request-promise','path','rimraf','../../config/environment'];(function(_0xef8fab,_0x13938e){var _0x1fc438=function(_0x49f6b9){while(--_0x49f6b9){_0xef8fab['push'](_0xef8fab['shift']());}};_0x1fc438(++_0x13938e);}(_0x844d,0xec));var _0xd844=function(_0x43f489,_0x2b4fea){_0x43f489=_0x43f489-0x0;var _0x4134b4=_0x844d[_0x43f489];return _0x4134b4;};'use strict';var _=require('lodash');var util=require(_0xd844('0x0'));var logger=require('../../config/logger')(_0xd844('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd844('0x2'));var fs=require('fs');var path=require(_0xd844('0x3'));var rimraf=require(_0xd844('0x4'));var config=require(_0xd844('0x5'));var attributes=require(_0xd844('0x6'));module[_0xd844('0x7')]=function(_0x296298,_0x4752d7){return _0x296298[_0xd844('0x8')](_0xd844('0x9'),attributes,{'tableName':_0xd844('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcbd=['request-promise','path','../../config/environment','./smsAccount.attributes','define','SmsAccount','util','api','moment','bluebird'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xfcbd,0xe2));var _0xdfcb=function(_0x1e5522,_0x6b8484){_0x1e5522=_0x1e5522-0x0;var _0x588c24=_0xfcbd[_0x1e5522];return _0x588c24;};'use strict';var _=require('lodash');var util=require(_0xdfcb('0x0'));var logger=require('../../config/logger')(_0xdfcb('0x1'));var moment=require(_0xdfcb('0x2'));var BPromise=require(_0xdfcb('0x3'));var rp=require(_0xdfcb('0x4'));var fs=require('fs');var path=require(_0xdfcb('0x5'));var rimraf=require('rimraf');var config=require(_0xdfcb('0x6'));var attributes=require(_0xdfcb('0x7'));module['exports']=function(_0x5ef50f,_0x511441){return _0x5ef50f[_0xdfcb('0x8')](_0xdfcb('0x9'),attributes,{'tableName':'sms_accounts','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 7c97002..29f6a24 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 _0xadce=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ShowSmsAccount','SmsAccount','find','options','raw','where','attributes','include','map','model','debug'];(function(_0x67655b,_0x15ff31){var _0x71c09d=function(_0x50c331){while(--_0x50c331){_0x67655b['push'](_0x67655b['shift']());}};_0x71c09d(++_0x15ff31);}(_0xadce,0xc9));var _0xeadc=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0xadce[_0x599e60];return _0x468e19;};'use strict';var _=require(_0xeadc('0x0'));var util=require(_0xeadc('0x1'));var moment=require(_0xeadc('0x2'));var BPromise=require(_0xeadc('0x3'));var rs=require(_0xeadc('0x4'));var fs=require('fs');var Redis=require(_0xeadc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xeadc('0x6'));var logger=require('../../config/logger')(_0xeadc('0x7'));var config=require('../../config/environment');var jayson=require(_0xeadc('0x8'));var client=jayson[_0xeadc('0x9')][_0xeadc('0xa')]({'port':0x232a});config['redis']=_[_0xeadc('0xb')](config[_0xeadc('0xc')],{'host':_0xeadc('0xd'),'port':0x18eb});var socket=require(_0xeadc('0xe'))(new Redis(config[_0xeadc('0xc')]));require(_0xeadc('0xf'))[_0xeadc('0x10')](socket);function respondWithRpcPromise(_0x260891,_0x5a7c9a,_0x4d16a9){return new BPromise(function(_0x1184d4,_0x1d18f9){return client[_0xeadc('0x11')](_0x260891,_0x4d16a9)[_0xeadc('0x12')](function(_0x3a0019){logger[_0xeadc('0x13')](_0xeadc('0x14'),_0x5a7c9a,'request\x20sent');logger['debug'](_0xeadc('0x15'),_0x5a7c9a,_0xeadc('0x16'),JSON[_0xeadc('0x17')](_0x3a0019));if(_0x3a0019[_0xeadc('0x18')]){if(_0x3a0019[_0xeadc('0x18')][_0xeadc('0x19')]===0x1f4){logger[_0xeadc('0x18')](_0xeadc('0x14'),_0x5a7c9a,_0x3a0019['error'][_0xeadc('0x1a')]);return _0x1d18f9(_0x3a0019[_0xeadc('0x18')][_0xeadc('0x1a')]);}logger[_0xeadc('0x18')]('SmsAccount,\x20%s,\x20%s',_0x5a7c9a,_0x3a0019[_0xeadc('0x18')]['message']);return _0x1184d4(_0x3a0019[_0xeadc('0x18')][_0xeadc('0x1a')]);}else{logger[_0xeadc('0x13')](_0xeadc('0x14'),_0x5a7c9a,'request\x20sent');_0x1184d4(_0x3a0019[_0xeadc('0x1b')][_0xeadc('0x1a')]);}})['catch'](function(_0x953a9f){logger[_0xeadc('0x18')]('SmsAccount,\x20%s,\x20%s',_0x5a7c9a,_0x953a9f);_0x1d18f9(_0x953a9f);});});}exports[_0xeadc('0x1c')]=function(_0x16eb82){var _0x3b00aa=this;return new Promise(function(_0x5d29ca,_0x5950b0){return db[_0xeadc('0x1d')][_0xeadc('0x1e')]({'raw':_0x16eb82[_0xeadc('0x1f')]?_0x16eb82[_0xeadc('0x1f')][_0xeadc('0x20')]===undefined?!![]:![]:!![],'where':_0x16eb82[_0xeadc('0x1f')]?_0x16eb82['options'][_0xeadc('0x21')]||null:null,'attributes':_0x16eb82['options']?_0x16eb82[_0xeadc('0x1f')][_0xeadc('0x22')]||null:null,'include':_0x16eb82[_0xeadc('0x1f')]?_0x16eb82[_0xeadc('0x1f')][_0xeadc('0x23')]?_[_0xeadc('0x24')](_0x16eb82[_0xeadc('0x1f')][_0xeadc('0x23')],function(_0x4b6652){return{'model':db[_0x4b6652[_0xeadc('0x25')]],'as':_0x4b6652['as'],'attributes':_0x4b6652[_0xeadc('0x22')],'include':_0x4b6652[_0xeadc('0x23')]?_[_0xeadc('0x24')](_0x4b6652[_0xeadc('0x23')],function(_0x384187){return{'model':db[_0x384187['model']],'as':_0x384187['as'],'attributes':_0x384187[_0xeadc('0x22')],'include':_0x384187[_0xeadc('0x23')]?_[_0xeadc('0x24')](_0x384187[_0xeadc('0x23')],function(_0x3d581a){return{'model':db[_0x3d581a['model']],'as':_0x3d581a['as'],'attributes':_0x3d581a[_0xeadc('0x22')]};}):[]};}):[]};}):[]:[]})[_0xeadc('0x12')](function(_0x3b1324){logger['info']('ShowSmsAccount',_0x16eb82);logger[_0xeadc('0x26')]('ShowSmsAccount',_0x16eb82,JSON[_0xeadc('0x17')](_0x3b1324));_0x5d29ca(_0x3b1324);})[_0xeadc('0x27')](function(_0x1b1cd4){logger[_0xeadc('0x18')](_0xeadc('0x1c'),_0x1b1cd4['message'],_0x16eb82);_0x5950b0(_0x3b00aa['error'](0x1f4,_0x1b1cd4[_0xeadc('0x1a')]));});});}; \ No newline at end of file +var _0x1c24=['map','info','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','./smsAccount.socket','register','request','then','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','SmsAccount,\x20%s,\x20%s','ShowSmsAccount','SmsAccount','find','options','where','attributes','include','model'];(function(_0x4d3a38,_0x464072){var _0x3ca174=function(_0xa86bf6){while(--_0xa86bf6){_0x4d3a38['push'](_0x4d3a38['shift']());}};_0x3ca174(++_0x464072);}(_0x1c24,0xbb));var _0x41c2=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x1c24[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require(_0x41c2('0x0'));var moment=require(_0x41c2('0x1'));var BPromise=require(_0x41c2('0x2'));var rs=require(_0x41c2('0x3'));var fs=require('fs');var Redis=require(_0x41c2('0x4'));var db=require(_0x41c2('0x5'))['db'];var utils=require(_0x41c2('0x6'));var logger=require(_0x41c2('0x7'))(_0x41c2('0x8'));var config=require(_0x41c2('0x9'));var jayson=require(_0x41c2('0xa'));var client=jayson['client'][_0x41c2('0xb')]({'port':0x232a});config['redis']=_[_0x41c2('0xc')](config[_0x41c2('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x41c2('0xd')]));require(_0x41c2('0xe'))[_0x41c2('0xf')](socket);function respondWithRpcPromise(_0x24ec19,_0x54c262,_0x56acc5){return new BPromise(function(_0x12d033,_0x3482a8){return client[_0x41c2('0x10')](_0x24ec19,_0x56acc5)[_0x41c2('0x11')](function(_0x591196){logger['info']('SmsAccount,\x20%s,\x20%s',_0x54c262,'request\x20sent');logger['debug'](_0x41c2('0x12'),_0x54c262,_0x41c2('0x13'),JSON[_0x41c2('0x14')](_0x591196));if(_0x591196['error']){if(_0x591196[_0x41c2('0x15')][_0x41c2('0x16')]===0x1f4){logger[_0x41c2('0x15')]('SmsAccount,\x20%s,\x20%s',_0x54c262,_0x591196['error'][_0x41c2('0x17')]);return _0x3482a8(_0x591196['error'][_0x41c2('0x17')]);}logger[_0x41c2('0x15')]('SmsAccount,\x20%s,\x20%s',_0x54c262,_0x591196[_0x41c2('0x15')][_0x41c2('0x17')]);return _0x12d033(_0x591196[_0x41c2('0x15')][_0x41c2('0x17')]);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x54c262,_0x41c2('0x13'));_0x12d033(_0x591196[_0x41c2('0x18')][_0x41c2('0x17')]);}})[_0x41c2('0x19')](function(_0x4439ff){logger[_0x41c2('0x15')](_0x41c2('0x1a'),_0x54c262,_0x4439ff);_0x3482a8(_0x4439ff);});});}exports[_0x41c2('0x1b')]=function(_0x3595d8){var _0x1a70a6=this;return new Promise(function(_0x5b88cf,_0xe1f300){return db[_0x41c2('0x1c')][_0x41c2('0x1d')]({'raw':_0x3595d8[_0x41c2('0x1e')]?_0x3595d8[_0x41c2('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x3595d8['options']?_0x3595d8[_0x41c2('0x1e')][_0x41c2('0x1f')]||null:null,'attributes':_0x3595d8[_0x41c2('0x1e')]?_0x3595d8[_0x41c2('0x1e')][_0x41c2('0x20')]||null:null,'include':_0x3595d8[_0x41c2('0x1e')]?_0x3595d8['options'][_0x41c2('0x21')]?_['map'](_0x3595d8[_0x41c2('0x1e')][_0x41c2('0x21')],function(_0x387dbc){return{'model':db[_0x387dbc[_0x41c2('0x22')]],'as':_0x387dbc['as'],'attributes':_0x387dbc[_0x41c2('0x20')],'include':_0x387dbc[_0x41c2('0x21')]?_[_0x41c2('0x23')](_0x387dbc[_0x41c2('0x21')],function(_0x1e8453){return{'model':db[_0x1e8453[_0x41c2('0x22')]],'as':_0x1e8453['as'],'attributes':_0x1e8453[_0x41c2('0x20')],'include':_0x1e8453[_0x41c2('0x21')]?_['map'](_0x1e8453[_0x41c2('0x21')],function(_0x268a08){return{'model':db[_0x268a08['model']],'as':_0x268a08['as'],'attributes':_0x268a08[_0x41c2('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b2e6a){logger[_0x41c2('0x24')](_0x41c2('0x1b'),_0x3595d8);logger['debug'](_0x41c2('0x1b'),_0x3595d8,JSON[_0x41c2('0x14')](_0x1b2e6a));_0x5b88cf(_0x1b2e6a);})[_0x41c2('0x19')](function(_0x293a13){logger[_0x41c2('0x15')](_0x41c2('0x1b'),_0x293a13[_0x41c2('0x17')],_0x3595d8);_0xe1f300(_0x1a70a6[_0x41c2('0x15')](0x1f4,_0x293a13[_0x41c2('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 9c36c52..ae0d4e1 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 _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var SmsAccountEvents=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(){SmsAccountEvents[_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);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.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(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var SmsAccountEvents=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(){SmsAccountEvents[_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);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index d6bf747..0ea0b5a 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 _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x3da3c4,_0x2b874d){var _0x36a3af=function(_0x6d3f2d){while(--_0x6d3f2d){_0x3da3c4['push'](_0x3da3c4['shift']());}};_0x36a3af(++_0x2b874d);}(_0x34e8,0x12c));var _0x834e=function(_0x150d0e,_0x31dd36){_0x150d0e=_0x150d0e-0x0;var _0x1fabcb=_0x34e8[_0x150d0e];return _0x1fabcb;};'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 fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file +var _0x9957=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0x1cfa0d,_0x4391f2){var _0xe33279=function(_0x3ce7c1){while(--_0x3ce7c1){_0x1cfa0d['push'](_0x1cfa0d['shift']());}};_0xe33279(++_0x4391f2);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth['isAuthenticated'](),controller[_0x7995('0xf')]);router[_0x7995('0x10')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0x13')]);module[_0x7995('0x14')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index f5d908a..db2df53 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 _0x227e=['STRING','*,*,*,*','INTEGER'];(function(_0x3254a7,_0x1187a5){var _0x446a65=function(_0x3afd5a){while(--_0x3afd5a){_0x3254a7['push'](_0x3254a7['shift']());}};_0x446a65(++_0x1187a5);}(_0x227e,0xf2));var _0xe227=function(_0x22a2e1,_0x5c1836){_0x22a2e1=_0x22a2e1-0x0;var _0x4a78dc=_0x227e[_0x22a2e1];return _0x4a78dc;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xe227('0x0')],'allowNull':![]},'app':{'type':Sequelize[_0xe227('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xe227('0x1')]},'interval':{'type':Sequelize[_0xe227('0x1')],'defaultValue':_0xe227('0x2')}}; \ No newline at end of file +var _0x3b7d=['sequelize','STRING','TEXT'];(function(_0x4ca796,_0x10dc47){var _0x171f87=function(_0x198d29){while(--_0x198d29){_0x4ca796['push'](_0x4ca796['shift']());}};_0x171f87(++_0x10dc47);}(_0x3b7d,0xbd));var _0xd3b7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x3b7d[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xd3b7('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xd3b7('0x1')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd3b7('0x2')]()},'description':{'type':Sequelize[_0xd3b7('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 4c5b6d0..e67abb2 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 _0xcfa6=['status','end','json','limit','undefined','offset','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x1fe9ad,_0x44176a){var _0xbc7389=function(_0x9eabb2){while(--_0x9eabb2){_0x1fe9ad['push'](_0x1fe9ad['shift']());}};_0xbc7389(++_0x44176a);}(_0xcfa6,0x1ba));var _0x6cfa=function(_0x3d6ad7,_0x5258aa){_0x3d6ad7=_0x3d6ad7-0x0;var _0x5d36d9=_0xcfa6[_0x3d6ad7];return _0x5d36d9;};'use strict';var emlformat=require(_0x6cfa('0x0'));var rimraf=require(_0x6cfa('0x1'));var zipdir=require(_0x6cfa('0x2'));var jsonpatch=require(_0x6cfa('0x3'));var rp=require(_0x6cfa('0x4'));var moment=require(_0x6cfa('0x5'));var BPromise=require(_0x6cfa('0x6'));var Mustache=require(_0x6cfa('0x7'));var util=require('util');var path=require(_0x6cfa('0x8'));var sox=require(_0x6cfa('0x9'));var csv=require(_0x6cfa('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6cfa('0xb'));var squel=require(_0x6cfa('0xc'));var crypto=require(_0x6cfa('0xd'));var jsforce=require(_0x6cfa('0xe'));var deskjs=require(_0x6cfa('0xf'));var toCsv=require(_0x6cfa('0xa'));var querystring=require(_0x6cfa('0x10'));var Papa=require('papaparse');var Redis=require(_0x6cfa('0x11'));var authService=require(_0x6cfa('0x12'));var qs=require(_0x6cfa('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6cfa('0x14'))('api');var utils=require(_0x6cfa('0x15'));var config=require(_0x6cfa('0x16'));var licenseUtil=require(_0x6cfa('0x17'));var db=require(_0x6cfa('0x18'))['db'];function respondWithStatusCode(_0x112d1d,_0x2a1a20){_0x2a1a20=_0x2a1a20||0xcc;return function(_0x2ac066){if(_0x2ac066){return _0x112d1d[_0x6cfa('0x19')](_0x2a1a20);}return _0x112d1d[_0x6cfa('0x1a')](_0x2a1a20)[_0x6cfa('0x1b')]();};}function respondWithResult(_0x2efff1,_0x51b8b2){_0x51b8b2=_0x51b8b2||0xc8;return function(_0x31d516){if(_0x31d516){return _0x2efff1[_0x6cfa('0x1a')](_0x51b8b2)[_0x6cfa('0x1c')](_0x31d516);}};}function respondWithFilteredResult(_0x2d2c42,_0x42e0ca){return function(_0x4c60e8){if(_0x4c60e8){var _0x13d05f=typeof _0x42e0ca['offset']==='undefined'&&typeof _0x42e0ca[_0x6cfa('0x1d')]===_0x6cfa('0x1e');var _0x23aca1=_0x4c60e8['count'];var _0x3c575e=_0x13d05f?0x0:_0x42e0ca['offset'];var _0x4c697b=_0x13d05f?_0x4c60e8['count']:_0x42e0ca[_0x6cfa('0x1f')]+_0x42e0ca[_0x6cfa('0x1d')];var _0x1d00ce;if(_0x4c697b>=_0x23aca1){_0x4c697b=_0x23aca1;_0x1d00ce=0xc8;}else{_0x1d00ce=0xce;}_0x2d2c42[_0x6cfa('0x1a')](_0x1d00ce);return _0x2d2c42[_0x6cfa('0x20')](_0x6cfa('0x21'),_0x3c575e+'-'+_0x4c697b+'/'+_0x23aca1)['json'](_0x4c60e8);}return null;};}function patchUpdates(_0x28a757){return function(_0x7c3026){try{jsonpatch['apply'](_0x7c3026,_0x28a757,!![]);}catch(_0x2da53d){return BPromise[_0x6cfa('0x22')](_0x2da53d);}return _0x7c3026['save']();};}function saveUpdates(_0x324ef1,_0x1842f3){return function(_0xc9a510){if(_0xc9a510){return _0xc9a510[_0x6cfa('0x23')](_0x324ef1)[_0x6cfa('0x24')](function(_0x5340a2){return _0x5340a2;});}return null;};}function removeEntity(_0x4c2448,_0x459310){return function(_0x209afc){if(_0x209afc){return _0x209afc[_0x6cfa('0x25')]()['then'](function(){_0x4c2448[_0x6cfa('0x1a')](0xcc)[_0x6cfa('0x1b')]();});}};}function handleEntityNotFound(_0x3bc9b0,_0x228cd1){return function(_0x3faf77){if(!_0x3faf77){_0x3bc9b0[_0x6cfa('0x19')](0x194);}return _0x3faf77;};}function handleError(_0x3162f3,_0x1b4f5e){_0x1b4f5e=_0x1b4f5e||0x1f4;return function(_0x4326a5){logger[_0x6cfa('0x26')](_0x4326a5[_0x6cfa('0x27')]);if(_0x4326a5[_0x6cfa('0x28')]){delete _0x4326a5['name'];}_0x3162f3['status'](_0x1b4f5e)[_0x6cfa('0x29')](_0x4326a5);};}exports[_0x6cfa('0x2a')]=function(_0x50a880,_0xddde34){var _0x37686a={},_0x3585dc={},_0xed1b75={'count':0x0,'rows':[]};var _0x3252a0=_[_0x6cfa('0x2b')](db[_0x6cfa('0x2c')][_0x6cfa('0x2d')],function(_0xaad3d1){return{'name':_0xaad3d1[_0x6cfa('0x2e')],'type':_0xaad3d1['type'][_0x6cfa('0x2f')]};});_0x3585dc[_0x6cfa('0x30')]=_[_0x6cfa('0x2b')](_0x3252a0,_0x6cfa('0x28'));_0x3585dc['query']=_[_0x6cfa('0x31')](_0x50a880[_0x6cfa('0x32')]);_0x3585dc[_0x6cfa('0x33')]=_[_0x6cfa('0x34')](_0x3585dc[_0x6cfa('0x30')],_0x3585dc[_0x6cfa('0x32')]);_0x37686a[_0x6cfa('0x35')]=_[_0x6cfa('0x34')](_0x3585dc[_0x6cfa('0x30')],qs[_0x6cfa('0x36')](_0x50a880[_0x6cfa('0x32')]['fields']));_0x37686a[_0x6cfa('0x35')]=_0x37686a[_0x6cfa('0x35')][_0x6cfa('0x37')]?_0x37686a[_0x6cfa('0x35')]:_0x3585dc['model'];if(!_0x50a880[_0x6cfa('0x32')][_0x6cfa('0x38')](_0x6cfa('0x39'))){_0x37686a[_0x6cfa('0x1d')]=qs['limit'](_0x50a880[_0x6cfa('0x32')][_0x6cfa('0x1d')]);_0x37686a[_0x6cfa('0x1f')]=qs['offset'](_0x50a880['query']['offset']);}_0x37686a[_0x6cfa('0x3a')]=qs[_0x6cfa('0x3b')](_0x50a880[_0x6cfa('0x32')]['sort']);_0x37686a['where']=qs[_0x6cfa('0x33')](_[_0x6cfa('0x3c')](_0x50a880[_0x6cfa('0x32')],_0x3585dc[_0x6cfa('0x33')]),_0x3252a0);if(_0x50a880[_0x6cfa('0x32')][_0x6cfa('0x3d')]){_0x37686a[_0x6cfa('0x3e')]=_[_0x6cfa('0x3f')](_0x37686a[_0x6cfa('0x3e')],{'$or':_[_0x6cfa('0x2b')](_0x3252a0,function(_0x375d4b){if(_0x375d4b[_0x6cfa('0x40')]!==_0x6cfa('0x41')){var _0x271203={};_0x271203[_0x375d4b[_0x6cfa('0x28')]]={'$like':'%'+_0x50a880[_0x6cfa('0x32')][_0x6cfa('0x3d')]+'%'};return _0x271203;}})});}_0x37686a=_['merge']({},_0x37686a,_0x50a880[_0x6cfa('0x42')]);var _0x19f042={'where':_0x37686a['where']};return db[_0x6cfa('0x2c')][_0x6cfa('0x43')](_0x19f042)[_0x6cfa('0x24')](function(_0x4c450d){_0xed1b75[_0x6cfa('0x43')]=_0x4c450d;if(_0x50a880['query'][_0x6cfa('0x44')]){_0x37686a[_0x6cfa('0x45')]=[{'all':!![]}];}return db[_0x6cfa('0x2c')][_0x6cfa('0x46')](_0x37686a);})['then'](function(_0x28068){_0xed1b75[_0x6cfa('0x47')]=_0x28068;return _0xed1b75;})['then'](respondWithFilteredResult(_0xddde34,_0x37686a))['catch'](handleError(_0xddde34,null));};exports[_0x6cfa('0x48')]=function(_0x366f02,_0x831bcf){var _0x27e9da={'raw':!![],'where':{'id':_0x366f02[_0x6cfa('0x49')]['id']}},_0x15de2b={};_0x15de2b[_0x6cfa('0x30')]=_['keys'](db[_0x6cfa('0x2c')]['rawAttributes']);_0x15de2b[_0x6cfa('0x32')]=_[_0x6cfa('0x31')](_0x366f02[_0x6cfa('0x32')]);_0x15de2b[_0x6cfa('0x33')]=_[_0x6cfa('0x34')](_0x15de2b[_0x6cfa('0x30')],_0x15de2b['query']);_0x27e9da[_0x6cfa('0x35')]=_[_0x6cfa('0x34')](_0x15de2b[_0x6cfa('0x30')],qs[_0x6cfa('0x36')](_0x366f02[_0x6cfa('0x32')][_0x6cfa('0x36')]));_0x27e9da[_0x6cfa('0x35')]=_0x27e9da[_0x6cfa('0x35')][_0x6cfa('0x37')]?_0x27e9da['attributes']:_0x15de2b[_0x6cfa('0x30')];if(_0x366f02[_0x6cfa('0x32')][_0x6cfa('0x44')]){_0x27e9da[_0x6cfa('0x45')]=[{'all':!![]}];}_0x27e9da=_[_0x6cfa('0x3f')]({},_0x27e9da,_0x366f02['options']);return db[_0x6cfa('0x2c')][_0x6cfa('0x4a')](_0x27e9da)[_0x6cfa('0x24')](handleEntityNotFound(_0x831bcf,null))[_0x6cfa('0x24')](respondWithResult(_0x831bcf,null))[_0x6cfa('0x4b')](handleError(_0x831bcf,null));};exports[_0x6cfa('0x4c')]=function(_0xb3bda1,_0x30f749){return db[_0x6cfa('0x2c')][_0x6cfa('0x4c')](_0xb3bda1[_0x6cfa('0x4d')],{})[_0x6cfa('0x24')](respondWithResult(_0x30f749,0xc9))[_0x6cfa('0x4b')](handleError(_0x30f749,null));};exports['update']=function(_0x2a5b03,_0x3b23f0){if(_0x2a5b03[_0x6cfa('0x4d')]['id']){delete _0x2a5b03[_0x6cfa('0x4d')]['id'];}return db[_0x6cfa('0x2c')][_0x6cfa('0x4a')]({'where':{'id':_0x2a5b03[_0x6cfa('0x49')]['id']}})[_0x6cfa('0x24')](handleEntityNotFound(_0x3b23f0,null))[_0x6cfa('0x24')](saveUpdates(_0x2a5b03[_0x6cfa('0x4d')],null))[_0x6cfa('0x24')](respondWithResult(_0x3b23f0,null))['catch'](handleError(_0x3b23f0,null));};exports[_0x6cfa('0x25')]=function(_0x3d73fb,_0x18529f){return db['SmsApplication'][_0x6cfa('0x4a')]({'where':{'id':_0x3d73fb['params']['id']}})[_0x6cfa('0x24')](handleEntityNotFound(_0x18529f,null))[_0x6cfa('0x24')](removeEntity(_0x18529f,null))[_0x6cfa('0x4b')](handleError(_0x18529f,null));}; \ No newline at end of file +var _0x484c=['length','options','create','body','find','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','offset','limit','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','catch','show','params'];(function(_0xf6e99f,_0x58daf8){var _0x34f260=function(_0x297d26){while(--_0x297d26){_0xf6e99f['push'](_0xf6e99f['shift']());}};_0x34f260(++_0x58daf8);}(_0x484c,0x177));var _0xc484=function(_0x321ca3,_0x525b6c){_0x321ca3=_0x321ca3-0x0;var _0x157ca3=_0x484c[_0x321ca3];return _0x157ca3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc484('0x0'));var zipdir=require(_0xc484('0x1'));var jsonpatch=require(_0xc484('0x2'));var rp=require(_0xc484('0x3'));var moment=require(_0xc484('0x4'));var BPromise=require(_0xc484('0x5'));var Mustache=require('mustache');var util=require(_0xc484('0x6'));var path=require(_0xc484('0x7'));var sox=require(_0xc484('0x8'));var csv=require(_0xc484('0x9'));var ejs=require(_0xc484('0xa'));var fs=require('fs');var fs_extra=require(_0xc484('0xb'));var _=require(_0xc484('0xc'));var squel=require(_0xc484('0xd'));var crypto=require(_0xc484('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc484('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc484('0x10'));var Papa=require(_0xc484('0x11'));var Redis=require(_0xc484('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc484('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc484('0x14'))(_0xc484('0x15'));var utils=require(_0xc484('0x16'));var config=require(_0xc484('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc484('0x18'))['db'];function respondWithStatusCode(_0x3445e0,_0x372358){_0x372358=_0x372358||0xcc;return function(_0xe34971){if(_0xe34971){return _0x3445e0[_0xc484('0x19')](_0x372358);}return _0x3445e0['status'](_0x372358)[_0xc484('0x1a')]();};}function respondWithResult(_0x29dff3,_0x55e964){_0x55e964=_0x55e964||0xc8;return function(_0xa7ae4b){if(_0xa7ae4b){return _0x29dff3[_0xc484('0x1b')](_0x55e964)['json'](_0xa7ae4b);}};}function respondWithFilteredResult(_0x8672bf,_0x2f01c3){return function(_0x4c3969){if(_0x4c3969){var _0x48d335=typeof _0x2f01c3[_0xc484('0x1c')]==='undefined'&&typeof _0x2f01c3[_0xc484('0x1d')]===_0xc484('0x1e');var _0x7d1104=_0x4c3969['count'];var _0x273dad=_0x48d335?0x0:_0x2f01c3[_0xc484('0x1c')];var _0x48066b=_0x48d335?_0x4c3969[_0xc484('0x1f')]:_0x2f01c3[_0xc484('0x1c')]+_0x2f01c3[_0xc484('0x1d')];var _0x20358d;if(_0x48066b>=_0x7d1104){_0x48066b=_0x7d1104;_0x20358d=0xc8;}else{_0x20358d=0xce;}_0x8672bf[_0xc484('0x1b')](_0x20358d);return _0x8672bf[_0xc484('0x20')](_0xc484('0x21'),_0x273dad+'-'+_0x48066b+'/'+_0x7d1104)[_0xc484('0x22')](_0x4c3969);}return null;};}function patchUpdates(_0x4d22a6){return function(_0xe7b764){try{jsonpatch[_0xc484('0x23')](_0xe7b764,_0x4d22a6,!![]);}catch(_0x335837){return BPromise['reject'](_0x335837);}return _0xe7b764[_0xc484('0x24')]();};}function saveUpdates(_0x353021,_0x402362){return function(_0x5abd36){if(_0x5abd36){return _0x5abd36[_0xc484('0x25')](_0x353021)[_0xc484('0x26')](function(_0x43f6eb){return _0x43f6eb;});}return null;};}function removeEntity(_0x5606ff,_0x188fb8){return function(_0x1d9bb2){if(_0x1d9bb2){return _0x1d9bb2[_0xc484('0x27')]()[_0xc484('0x26')](function(){_0x5606ff[_0xc484('0x1b')](0xcc)[_0xc484('0x1a')]();});}};}function handleEntityNotFound(_0x140282,_0x4617fb){return function(_0x4c8af9){if(!_0x4c8af9){_0x140282[_0xc484('0x19')](0x194);}return _0x4c8af9;};}function handleError(_0x3785c0,_0x187975){_0x187975=_0x187975||0x1f4;return function(_0x1099dd){logger[_0xc484('0x28')](_0x1099dd[_0xc484('0x29')]);if(_0x1099dd[_0xc484('0x2a')]){delete _0x1099dd[_0xc484('0x2a')];}_0x3785c0[_0xc484('0x1b')](_0x187975)['send'](_0x1099dd);};}exports['index']=function(_0x3cdc57,_0x2895b2){var _0xacc72b={},_0x42da1a={},_0x16900d={'count':0x0,'rows':[]};var _0xa989cd=_[_0xc484('0x2b')](db[_0xc484('0x2c')][_0xc484('0x2d')],function(_0x5afc43){return{'name':_0x5afc43[_0xc484('0x2e')],'type':_0x5afc43[_0xc484('0x2f')][_0xc484('0x30')]};});_0x42da1a[_0xc484('0x31')]=_[_0xc484('0x2b')](_0xa989cd,_0xc484('0x2a'));_0x42da1a[_0xc484('0x32')]=_[_0xc484('0x33')](_0x3cdc57[_0xc484('0x32')]);_0x42da1a[_0xc484('0x34')]=_[_0xc484('0x35')](_0x42da1a['model'],_0x42da1a['query']);_0xacc72b['attributes']=_[_0xc484('0x35')](_0x42da1a[_0xc484('0x31')],qs[_0xc484('0x36')](_0x3cdc57[_0xc484('0x32')]['fields']));_0xacc72b['attributes']=_0xacc72b[_0xc484('0x37')]['length']?_0xacc72b[_0xc484('0x37')]:_0x42da1a[_0xc484('0x31')];if(!_0x3cdc57[_0xc484('0x32')][_0xc484('0x38')]('nolimit')){_0xacc72b['limit']=qs[_0xc484('0x1d')](_0x3cdc57[_0xc484('0x32')][_0xc484('0x1d')]);_0xacc72b[_0xc484('0x1c')]=qs['offset'](_0x3cdc57[_0xc484('0x32')]['offset']);}_0xacc72b[_0xc484('0x39')]=qs['sort'](_0x3cdc57['query'][_0xc484('0x3a')]);_0xacc72b[_0xc484('0x3b')]=qs[_0xc484('0x34')](_[_0xc484('0x3c')](_0x3cdc57['query'],_0x42da1a[_0xc484('0x34')]),_0xa989cd);if(_0x3cdc57[_0xc484('0x32')][_0xc484('0x3d')]){_0xacc72b[_0xc484('0x3b')]=_[_0xc484('0x3e')](_0xacc72b['where'],{'$or':_[_0xc484('0x2b')](_0xa989cd,function(_0x377cb6){if(_0x377cb6[_0xc484('0x2f')]!==_0xc484('0x3f')){var _0x41832e={};_0x41832e[_0x377cb6['name']]={'$like':'%'+_0x3cdc57[_0xc484('0x32')][_0xc484('0x3d')]+'%'};return _0x41832e;}})});}_0xacc72b=_['merge']({},_0xacc72b,_0x3cdc57['options']);var _0x3cd109={'where':_0xacc72b['where']};return db[_0xc484('0x2c')][_0xc484('0x1f')](_0x3cd109)[_0xc484('0x26')](function(_0x4c5673){_0x16900d['count']=_0x4c5673;if(_0x3cdc57[_0xc484('0x32')][_0xc484('0x40')]){_0xacc72b[_0xc484('0x41')]=[{'all':!![]}];}return db[_0xc484('0x2c')]['findAll'](_0xacc72b);})[_0xc484('0x26')](function(_0x3447a7){_0x16900d['rows']=_0x3447a7;return _0x16900d;})[_0xc484('0x26')](respondWithFilteredResult(_0x2895b2,_0xacc72b))[_0xc484('0x42')](handleError(_0x2895b2,null));};exports[_0xc484('0x43')]=function(_0x103d49,_0x366916){var _0x21adca={'raw':!![],'where':{'id':_0x103d49[_0xc484('0x44')]['id']}},_0x5af51c={};_0x5af51c['model']=_[_0xc484('0x33')](db[_0xc484('0x2c')][_0xc484('0x2d')]);_0x5af51c['query']=_[_0xc484('0x33')](_0x103d49[_0xc484('0x32')]);_0x5af51c[_0xc484('0x34')]=_[_0xc484('0x35')](_0x5af51c['model'],_0x5af51c[_0xc484('0x32')]);_0x21adca[_0xc484('0x37')]=_[_0xc484('0x35')](_0x5af51c['model'],qs[_0xc484('0x36')](_0x103d49[_0xc484('0x32')][_0xc484('0x36')]));_0x21adca[_0xc484('0x37')]=_0x21adca[_0xc484('0x37')][_0xc484('0x45')]?_0x21adca[_0xc484('0x37')]:_0x5af51c[_0xc484('0x31')];if(_0x103d49[_0xc484('0x32')][_0xc484('0x40')]){_0x21adca[_0xc484('0x41')]=[{'all':!![]}];}_0x21adca=_[_0xc484('0x3e')]({},_0x21adca,_0x103d49[_0xc484('0x46')]);return db[_0xc484('0x2c')]['find'](_0x21adca)[_0xc484('0x26')](handleEntityNotFound(_0x366916,null))['then'](respondWithResult(_0x366916,null))[_0xc484('0x42')](handleError(_0x366916,null));};exports[_0xc484('0x47')]=function(_0x149a16,_0xc2c381){return db[_0xc484('0x2c')][_0xc484('0x47')](_0x149a16['body'],{})[_0xc484('0x26')](respondWithResult(_0xc2c381,0xc9))[_0xc484('0x42')](handleError(_0xc2c381,null));};exports[_0xc484('0x25')]=function(_0x41ed85,_0x3fc07c){if(_0x41ed85[_0xc484('0x48')]['id']){delete _0x41ed85[_0xc484('0x48')]['id'];}return db[_0xc484('0x2c')][_0xc484('0x49')]({'where':{'id':_0x41ed85[_0xc484('0x44')]['id']}})['then'](handleEntityNotFound(_0x3fc07c,null))[_0xc484('0x26')](saveUpdates(_0x41ed85[_0xc484('0x48')],null))[_0xc484('0x26')](respondWithResult(_0x3fc07c,null))[_0xc484('0x42')](handleError(_0x3fc07c,null));};exports[_0xc484('0x27')]=function(_0x6b6266,_0x3b59b7){return db[_0xc484('0x2c')][_0xc484('0x49')]({'where':{'id':_0x6b6266[_0xc484('0x44')]['id']}})[_0xc484('0x26')](handleEntityNotFound(_0x3b59b7,null))[_0xc484('0x26')](removeEntity(_0x3b59b7,null))[_0xc484('0x42')](handleError(_0x3b59b7,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 1f63b72..83ef89c 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 _0x2aba=['utf8mb4','utf8mb4_unicode_ci','lodash','util','request-promise','path','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications'];(function(_0x2f05bd,_0x424ac5){var _0x5da135=function(_0x2f094d){while(--_0x2f094d){_0x2f05bd['push'](_0x2f05bd['shift']());}};_0x5da135(++_0x424ac5);}(_0x2aba,0x19a));var _0xa2ab=function(_0x2b5b9b,_0x5116a9){_0x2b5b9b=_0x2b5b9b-0x0;var _0x12720e=_0x2aba[_0x2b5b9b];return _0x12720e;};'use strict';var _=require(_0xa2ab('0x0'));var util=require(_0xa2ab('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa2ab('0x2'));var fs=require('fs');var path=require(_0xa2ab('0x3'));var rimraf=require('rimraf');var config=require(_0xa2ab('0x4'));var attributes=require(_0xa2ab('0x5'));module[_0xa2ab('0x6')]=function(_0x285676,_0x2d4d89){return _0x285676[_0xa2ab('0x7')](_0xa2ab('0x8'),attributes,{'tableName':_0xa2ab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa2ab('0xa'),'collate':_0xa2ab('0xb')});}; \ No newline at end of file +var _0x7f2d=['bluebird','request-promise','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment'];(function(_0x32ac5a,_0x2a5a44){var _0x57649d=function(_0x529dd2){while(--_0x529dd2){_0x32ac5a['push'](_0x32ac5a['shift']());}};_0x57649d(++_0x2a5a44);}(_0x7f2d,0x1ea));var _0xd7f2=function(_0x23f769,_0x462b22){_0x23f769=_0x23f769-0x0;var _0x14bfac=_0x7f2d[_0x23f769];return _0x14bfac;};'use strict';var _=require(_0xd7f2('0x0'));var util=require(_0xd7f2('0x1'));var logger=require('../../config/logger')(_0xd7f2('0x2'));var moment=require(_0xd7f2('0x3'));var BPromise=require(_0xd7f2('0x4'));var rp=require(_0xd7f2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd7f2('0x6'));module[_0xd7f2('0x7')]=function(_0x1366ff,_0x212421){return _0x1366ff[_0xd7f2('0x8')](_0xd7f2('0x9'),attributes,{'tableName':_0xd7f2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd7f2('0xb'),'collate':_0xd7f2('0xc')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 27b269d..677a2a9 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 _0x3c32=['request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s'];(function(_0x5a29e0,_0x56678a){var _0x5fc0a2=function(_0x6397d2){while(--_0x6397d2){_0x5a29e0['push'](_0x5a29e0['shift']());}};_0x5fc0a2(++_0x56678a);}(_0x3c32,0x161));var _0x23c3=function(_0x34e341,_0xbddc4f){_0x34e341=_0x34e341-0x0;var _0x2b4f95=_0x3c32[_0x34e341];return _0x2b4f95;};'use strict';var _=require(_0x23c3('0x0'));var util=require(_0x23c3('0x1'));var moment=require(_0x23c3('0x2'));var BPromise=require('bluebird');var rs=require(_0x23c3('0x3'));var fs=require('fs');var Redis=require(_0x23c3('0x4'));var db=require(_0x23c3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x23c3('0x6'))('rpc');var config=require(_0x23c3('0x7'));var jayson=require(_0x23c3('0x8'));var client=jayson[_0x23c3('0x9')][_0x23c3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a6364,_0x56568e,_0x493ca6){return new BPromise(function(_0x4df5ee,_0x422558){return client[_0x23c3('0xb')](_0x4a6364,_0x493ca6)[_0x23c3('0xc')](function(_0x420987){logger[_0x23c3('0xd')](_0x23c3('0xe'),_0x56568e,_0x23c3('0xf'));logger[_0x23c3('0x10')](_0x23c3('0x11'),_0x56568e,_0x23c3('0xf'),JSON[_0x23c3('0x12')](_0x420987));if(_0x420987[_0x23c3('0x13')]){if(_0x420987[_0x23c3('0x13')][_0x23c3('0x14')]===0x1f4){logger[_0x23c3('0x13')](_0x23c3('0xe'),_0x56568e,_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);return _0x422558(_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x56568e,_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);return _0x4df5ee(_0x420987[_0x23c3('0x13')][_0x23c3('0x15')]);}else{logger[_0x23c3('0xd')](_0x23c3('0xe'),_0x56568e,_0x23c3('0xf'));_0x4df5ee(_0x420987['result']['message']);}})[_0x23c3('0x16')](function(_0x43534b){logger['error'](_0x23c3('0xe'),_0x56568e,_0x43534b);_0x422558(_0x43534b);});});} \ No newline at end of file +var _0x4c50=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x29f68d,_0x20a0e9){var _0x2184fa=function(_0x407c57){while(--_0x407c57){_0x29f68d['push'](_0x29f68d['shift']());}};_0x2184fa(++_0x20a0e9);}(_0x4c50,0x10f));var _0x04c5=function(_0x3226cb,_0x2996e3){_0x3226cb=_0x3226cb-0x0;var _0x4447ad=_0x4c50[_0x3226cb];return _0x4447ad;};'use strict';var _=require(_0x04c5('0x0'));var util=require(_0x04c5('0x1'));var moment=require(_0x04c5('0x2'));var BPromise=require(_0x04c5('0x3'));var rs=require(_0x04c5('0x4'));var fs=require('fs');var Redis=require(_0x04c5('0x5'));var db=require(_0x04c5('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x04c5('0x7'));var config=require(_0x04c5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x04c5('0x9')][_0x04c5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22535c,_0x34961a,_0x1fb2db){return new BPromise(function(_0x40a846,_0x411e7f){return client[_0x04c5('0xb')](_0x22535c,_0x1fb2db)['then'](function(_0x4ebad1){logger['info'](_0x04c5('0xc'),_0x34961a,_0x04c5('0xd'));logger[_0x04c5('0xe')](_0x04c5('0xf'),_0x34961a,_0x04c5('0xd'),JSON[_0x04c5('0x10')](_0x4ebad1));if(_0x4ebad1[_0x04c5('0x11')]){if(_0x4ebad1[_0x04c5('0x11')][_0x04c5('0x12')]===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x34961a,_0x4ebad1[_0x04c5('0x11')][_0x04c5('0x13')]);return _0x411e7f(_0x4ebad1['error'][_0x04c5('0x13')]);}logger[_0x04c5('0x11')](_0x04c5('0xc'),_0x34961a,_0x4ebad1[_0x04c5('0x11')][_0x04c5('0x13')]);return _0x40a846(_0x4ebad1['error']['message']);}else{logger['info']('SmsApplication,\x20%s,\x20%s',_0x34961a,'request\x20sent');_0x40a846(_0x4ebad1[_0x04c5('0x14')]['message']);}})['catch'](function(_0x1ee3a0){logger[_0x04c5('0x11')]('SmsApplication,\x20%s,\x20%s',_0x34961a,_0x1ee3a0);_0x411e7f(_0x1ee3a0);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index a25bfa0..faaf03b 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 _0x8603=['sms','addTags','put','/:id','smsinteraction:update','update','delete','destroy','removeTags','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./smsInteraction.controller','isAuthenticated','index','get','/describe','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked'];(function(_0x1f8921,_0x38bd21){var _0x2c2f34=function(_0x33d700){while(--_0x33d700){_0x1f8921['push'](_0x1f8921['shift']());}};_0x2c2f34(++_0x38bd21);}(_0x8603,0x190));var _0x3860=function(_0x528687,_0x55bc89){_0x528687=_0x528687-0x0;var _0x31e7ab=_0x8603[_0x528687];return _0x31e7ab;};'use strict';var multer=require('multer');var util=require(_0x3860('0x0'));var path=require(_0x3860('0x1'));var timeout=require(_0x3860('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x3860('0x3'));var auth=require(_0x3860('0x4'));var interaction=require(_0x3860('0x5'));var config=require('../../config/environment');var controller=require(_0x3860('0x6'));router['get']('/',auth[_0x3860('0x7')](),controller[_0x3860('0x8')]);router[_0x3860('0x9')](_0x3860('0xa'),auth[_0x3860('0x7')](),controller['describe']);router['get']('/:id',auth[_0x3860('0x7')](),controller[_0x3860('0xb')]);router['get'](_0x3860('0xc'),auth[_0x3860('0x7')](),controller['getMessages']);router[_0x3860('0x9')](_0x3860('0xd'),auth['isAuthenticated'](),controller[_0x3860('0xe')]);router[_0x3860('0xf')]('/',auth['isAuthenticated'](),controller[_0x3860('0x10')]);router[_0x3860('0xf')](_0x3860('0xc'),auth[_0x3860('0x7')](),controller[_0x3860('0x11')]);router[_0x3860('0xf')](_0x3860('0x12'),auth[_0x3860('0x7')](),interaction[_0x3860('0x13')](_0x3860('0x14'),'smsinteraction:addtags'),controller[_0x3860('0x15')]);router[_0x3860('0x16')](_0x3860('0x17'),auth[_0x3860('0x7')](),interaction[_0x3860('0x13')](_0x3860('0x14'),_0x3860('0x18')),controller[_0x3860('0x19')]);router[_0x3860('0x1a')](_0x3860('0x17'),auth[_0x3860('0x7')](),interaction[_0x3860('0x13')]('sms','smsinteraction:destroy'),controller[_0x3860('0x1b')]);router[_0x3860('0x1a')](_0x3860('0x12'),auth['isAuthenticated'](),controller[_0x3860('0x1c')]);module[_0x3860('0x1d')]=router; \ No newline at end of file +var _0x5eb8=['smsinteraction:update','update','delete','smsinteraction:destroy','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put'];(function(_0x116d47,_0x334c20){var _0x38fdd2=function(_0x21d23e){while(--_0x21d23e){_0x116d47['push'](_0x116d47['shift']());}};_0x38fdd2(++_0x334c20);}(_0x5eb8,0xb0));var _0x85eb=function(_0x3d4ef1,_0x5a957c){_0x3d4ef1=_0x3d4ef1-0x0;var _0x409423=_0x5eb8[_0x3d4ef1];return _0x409423;};'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 fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['get'](_0x85eb('0xe'),auth['isAuthenticated'](),controller[_0x85eb('0xf')]);router[_0x85eb('0x9')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller[_0x85eb('0x11')]);router[_0x85eb('0x9')](_0x85eb('0x12'),auth['isAuthenticated'](),controller[_0x85eb('0x13')]);router[_0x85eb('0x14')]('/',auth['isAuthenticated'](),controller[_0x85eb('0x15')]);router[_0x85eb('0x14')](_0x85eb('0x10'),auth[_0x85eb('0xa')](),controller['addMessage']);router['post'](_0x85eb('0x16'),auth['isAuthenticated'](),interaction[_0x85eb('0x17')](_0x85eb('0x18'),_0x85eb('0x19')),controller[_0x85eb('0x1a')]);router[_0x85eb('0x1b')]('/:id',auth[_0x85eb('0xa')](),interaction['tracked'](_0x85eb('0x18'),_0x85eb('0x1c')),controller[_0x85eb('0x1d')]);router[_0x85eb('0x1e')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x85eb('0x18'),_0x85eb('0x1f')),controller[_0x85eb('0x20')]);router[_0x85eb('0x1e')](_0x85eb('0x16'),auth[_0x85eb('0xa')](),controller['removeTags']);module[_0x85eb('0x21')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index d5e21fe..f02ec80 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 _0x0024=['moment','BOOLEAN','STRING','out','DATE','ENUM'];(function(_0x1b02bb,_0x3d9fde){var _0x131245=function(_0x2fd1d8){while(--_0x2fd1d8){_0x1b02bb['push'](_0x1b02bb['shift']());}};_0x131245(++_0x3d9fde);}(_0x0024,0xa8));var _0x4002=function(_0x5bfaa7,_0x404773){_0x5bfaa7=_0x5bfaa7-0x0;var _0xe1b1a3=_0x0024[_0x5bfaa7];return _0xe1b1a3;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4002('0x0'));module['exports']={'closed':{'type':Sequelize[_0x4002('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x4002('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x4002('0x2')]},'phone':{'type':Sequelize[_0x4002('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x4002('0x3')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4002('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x4002('0x5')]('in',_0x4002('0x3')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xe35c=['exports','BOOLEAN','DATE','STRING','ENUM','out','sequelize','moment'];(function(_0x1ab758,_0x3dbede){var _0x5788a0=function(_0x324d24){while(--_0x324d24){_0x1ab758['push'](_0x1ab758['shift']());}};_0x5788a0(++_0x3dbede);}(_0xe35c,0x146));var _0xce35=function(_0x1b8e33,_0xce6db5){_0x1b8e33=_0x1b8e33-0x0;var _0xd2a5b9=_0xe35c[_0x1b8e33];return _0xd2a5b9;};'use strict';var Sequelize=require(_0xce35('0x0'));var moment=require(_0xce35('0x1'));module[_0xce35('0x2')]={'closed':{'type':Sequelize[_0xce35('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xce35('0x4')]},'disposition':{'type':Sequelize[_0xce35('0x5')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xce35('0x5')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xce35('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xce35('0x6')]('in',_0xce35('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xce35('0x6')]('in',_0xce35('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xce35('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index 225eeb3..d0ebeb9 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 _0x169f=['pick','filter','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','include','rows','addTags','setTags','emit','smsInteractionTags:save','download','unix','toString','root','server','tmp','join','transcript-%d-%s.zip','push','User','fullname','CmContact','firstName','lastName','createdAt','direction','secret','Account','Owner','Sms','N.A.','closedAt','disposition','Messages','Contact','out','read','renderFile','views','.pdf','err','zip-dir','moment','bluebird','util','path','lodash','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','redis','defaults','localhost','register','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','update','then','destroy','name','send','index','map','SmsInteraction','rawAttributes','type','key','findAll','sms','query','user','catch','show','params','keys','intersection','model','attributes','fields','includeAll','merge','options','find','create','body','describe','addMessage','ids','omit','getMessages','findOne','SmsMessage','filters','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x114abb,_0x373ee1){var _0x4b2759=function(_0x527529){while(--_0x527529){_0x114abb['push'](_0x114abb['shift']());}};_0x4b2759(++_0x373ee1);}(_0x169f,0x172));var _0xf169=function(_0x253c0c,_0x55f71f){_0x253c0c=_0x253c0c-0x0;var _0x53fb71=_0x169f[_0x253c0c];return _0x53fb71;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xf169('0x0'));var moment=require(_0xf169('0x1'));var BPromise=require(_0xf169('0x2'));var util=require(_0xf169('0x3'));var path=require(_0xf169('0x4'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf169('0x5'));var Redis=require('ioredis');var interaction=require(_0xf169('0x6'));var qs=require(_0xf169('0x7'));var pdf=require(_0xf169('0x8'));var logger=require(_0xf169('0x9'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xf169('0xa')]=_[_0xf169('0xb')](config[_0xf169('0xa')],{'host':_0xf169('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf169('0xa')]));require('./smsInteraction.socket')[_0xf169('0xd')](socket);function respondWithStatusCode(_0x3f1eb0,_0x147bbc){_0x147bbc=_0x147bbc||0xcc;return function(_0x524983){if(_0x524983){return _0x3f1eb0[_0xf169('0xe')](_0x147bbc);}return _0x3f1eb0[_0xf169('0xf')](_0x147bbc)[_0xf169('0x10')]();};}function respondWithResult(_0x5c186f,_0x46bb00){_0x46bb00=_0x46bb00||0xc8;return function(_0x516fba){if(_0x516fba){return _0x5c186f[_0xf169('0xf')](_0x46bb00)['json'](_0x516fba);}};}function respondWithFilteredResult(_0x22d0c8,_0x2fc12c){return function(_0x19a646){if(_0x19a646){var _0x49c50c=typeof _0x2fc12c[_0xf169('0x11')]==='undefined'&&typeof _0x2fc12c['limit']===_0xf169('0x12');var _0x2206f0=_0x19a646[_0xf169('0x13')];var _0x4c9e2c=_0x49c50c?0x0:_0x2fc12c[_0xf169('0x11')];var _0x2c8433=_0x49c50c?_0x19a646[_0xf169('0x13')]:_0x2fc12c[_0xf169('0x11')]+_0x2fc12c['limit'];var _0x1101d7;if(_0x2c8433>=_0x2206f0){_0x2c8433=_0x2206f0;_0x1101d7=0xc8;}else{_0x1101d7=0xce;}_0x22d0c8[_0xf169('0xf')](_0x1101d7);return _0x22d0c8[_0xf169('0x14')](_0xf169('0x15'),_0x4c9e2c+'-'+_0x2c8433+'/'+_0x2206f0)[_0xf169('0x16')](_0x19a646);}return null;};}function saveUpdates(_0x13e753){return function(_0x4956ae){if(_0x4956ae){return _0x4956ae[_0xf169('0x17')](_0x13e753)[_0xf169('0x18')](function(_0x58108e){return _0x58108e;});}return null;};}function removeEntity(_0x565f9e){return function(_0x13f9dc){if(_0x13f9dc){return _0x13f9dc[_0xf169('0x19')]()[_0xf169('0x18')](function(){_0x565f9e[_0xf169('0xf')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e09cd){return function(_0x103ecf){if(!_0x103ecf){_0x1e09cd['sendStatus'](0x194);}return _0x103ecf;};}function handleError(_0x301c47,_0x539eca){_0x539eca=_0x539eca||0x1f4;return function(_0x45f6bb){logger['error'](_0x45f6bb['stack']);if(_0x45f6bb[_0xf169('0x1a')]){delete _0x45f6bb[_0xf169('0x1a')];}_0x301c47[_0xf169('0xf')](_0x539eca)[_0xf169('0x1b')](_0x45f6bb);};}exports[_0xf169('0x1c')]=function(_0x201ad7,_0xe50264){var _0x5ecd50={};var _0x25a5e9=_[_0xf169('0x1d')](db[_0xf169('0x1e')][_0xf169('0x1f')],function(_0x513e24){return{'name':_0x513e24['fieldName'],'type':_0x513e24[_0xf169('0x20')][_0xf169('0x21')]};});_0x5ecd50=qs['getOptions'](_0x25a5e9,_0x201ad7);return interaction[_0xf169('0x22')](_0xf169('0x23'),_0x201ad7[_0xf169('0x24')],_0x201ad7[_0xf169('0x25')],_0x5ecd50,_0x25a5e9)[_0xf169('0x18')](respondWithFilteredResult(_0xe50264,_0x5ecd50))[_0xf169('0x26')](handleError(_0xe50264,null));};exports[_0xf169('0x27')]=function(_0x4d1f0d,_0x4b4095){var _0x4d37cc={'raw':![],'where':{'id':_0x4d1f0d[_0xf169('0x28')]['id']}},_0x5edf96={};_0x5edf96['model']=_['keys'](db[_0xf169('0x1e')][_0xf169('0x1f')]);_0x5edf96[_0xf169('0x24')]=_[_0xf169('0x29')](_0x4d1f0d[_0xf169('0x24')]);_0x5edf96['filters']=_[_0xf169('0x2a')](_0x5edf96[_0xf169('0x2b')],_0x5edf96[_0xf169('0x24')]);_0x4d37cc[_0xf169('0x2c')]=_['intersection'](_0x5edf96[_0xf169('0x2b')],qs[_0xf169('0x2d')](_0x4d1f0d[_0xf169('0x24')][_0xf169('0x2d')]));_0x4d37cc['attributes']=_0x4d37cc['attributes']['length']?_0x4d37cc[_0xf169('0x2c')]:_0x5edf96[_0xf169('0x2b')];if(_0x4d1f0d[_0xf169('0x24')][_0xf169('0x2e')]){_0x4d37cc['include']=[{'all':!![]}];}_0x4d37cc=_[_0xf169('0x2f')]({},_0x4d37cc,_0x4d1f0d[_0xf169('0x30')]);return db['SmsInteraction'][_0xf169('0x31')](_0x4d37cc)['then'](handleEntityNotFound(_0x4b4095,null))['then'](respondWithResult(_0x4b4095,null))[_0xf169('0x26')](handleError(_0x4b4095,null));};exports['create']=function(_0x56ef43,_0x501ac4){return db[_0xf169('0x1e')][_0xf169('0x32')](_0x56ef43[_0xf169('0x33')],{})['then'](respondWithResult(_0x501ac4,0xc9))['catch'](handleError(_0x501ac4,null));};exports[_0xf169('0x17')]=function(_0x273757,_0x4563d2){if(_0x273757[_0xf169('0x33')]['id']){delete _0x273757[_0xf169('0x33')]['id'];}return db[_0xf169('0x1e')][_0xf169('0x31')]({'where':{'id':_0x273757['params']['id']}})[_0xf169('0x18')](handleEntityNotFound(_0x4563d2,null))['then'](saveUpdates(_0x273757[_0xf169('0x33')],null))[_0xf169('0x18')](respondWithResult(_0x4563d2,null))[_0xf169('0x26')](handleError(_0x4563d2,null));};exports['destroy']=function(_0x1fb77d,_0x2a7e34){return db[_0xf169('0x1e')][_0xf169('0x31')]({'where':{'id':_0x1fb77d[_0xf169('0x28')]['id']}})[_0xf169('0x18')](handleEntityNotFound(_0x2a7e34,null))['then'](removeEntity(_0x2a7e34,null))[_0xf169('0x26')](handleError(_0x2a7e34,null));};exports[_0xf169('0x34')]=function(_0x3ca585,_0x48b202){return db[_0xf169('0x1e')][_0xf169('0x34')]()['then'](respondWithResult(_0x48b202,null))['catch'](handleError(_0x48b202,null));};exports[_0xf169('0x35')]=function(_0x2f9f52,_0x37f53c){return db['SmsMessage'][_0xf169('0x31')]({'where':{'id':_0x2f9f52[_0xf169('0x28')]['id']}})['then'](handleEntityNotFound(_0x37f53c,null))[_0xf169('0x18')](function(_0x52d980){if(_0x52d980){return _0x52d980[_0xf169('0x35')](_0x2f9f52[_0xf169('0x33')][_0xf169('0x36')],_[_0xf169('0x37')](_0x2f9f52['body'],[_0xf169('0x36'),'id'])||{});}})[_0xf169('0x18')](respondWithResult(_0x37f53c,null))[_0xf169('0x26')](handleError(_0x37f53c,null));};exports[_0xf169('0x38')]=function(_0x437cde,_0x18162e){var _0x3b62c3={'raw':![],'where':{}};var _0xe76c72={};var _0x2ccae9={'count':0x0,'rows':[]};return db['SmsInteraction'][_0xf169('0x39')]({'where':{'id':_0x437cde[_0xf169('0x28')]['id']}})['then'](handleEntityNotFound(_0x18162e,null))[_0xf169('0x18')](function(_0x5d2d8b){if(_0x5d2d8b){_0xe76c72['model']=_[_0xf169('0x29')](db[_0xf169('0x3a')][_0xf169('0x1f')]);_0xe76c72[_0xf169('0x24')]=_[_0xf169('0x29')](_0x437cde[_0xf169('0x24')]);_0xe76c72[_0xf169('0x3b')]=_[_0xf169('0x2a')](_0xe76c72[_0xf169('0x2b')],_0xe76c72[_0xf169('0x24')]);_0x3b62c3[_0xf169('0x2c')]=_[_0xf169('0x2a')](_0xe76c72[_0xf169('0x2b')],qs[_0xf169('0x2d')](_0x437cde['query'][_0xf169('0x2d')]));_0x3b62c3[_0xf169('0x2c')]=_0x3b62c3[_0xf169('0x2c')]['length']?_0x3b62c3[_0xf169('0x2c')]:_0xe76c72['model'];if(!_0x437cde[_0xf169('0x24')][_0xf169('0x3c')](_0xf169('0x3d'))){_0x3b62c3[_0xf169('0x3e')]=qs[_0xf169('0x3e')](_0x437cde[_0xf169('0x24')][_0xf169('0x3e')]);_0x3b62c3[_0xf169('0x11')]=qs['offset'](_0x437cde[_0xf169('0x24')][_0xf169('0x11')]);}_0x3b62c3[_0xf169('0x3f')]=qs[_0xf169('0x40')](_0x437cde[_0xf169('0x24')][_0xf169('0x40')]);_0x3b62c3[_0xf169('0x41')]=qs['filters'](_[_0xf169('0x42')](_0x437cde[_0xf169('0x24')],_0xe76c72[_0xf169('0x3b')]));_0x3b62c3['where']['SmsInteractionId']=_0x5d2d8b['id'];if(_0x437cde['query'][_0xf169('0x43')]){_0x3b62c3[_0xf169('0x41')]=_[_0xf169('0x2f')](_0x3b62c3[_0xf169('0x41')],{'$or':_[_0xf169('0x1d')](_0x3b62c3[_0xf169('0x2c')],function(_0x317909){var _0x4752b5={};_0x4752b5[_0x317909]={'$like':'%'+_0x437cde[_0xf169('0x24')][_0xf169('0x43')]+'%'};return _0x4752b5;})});}if(_0x437cde[_0xf169('0x24')][_0xf169('0x44')]){var _0x41a12b=_0x437cde['query']['$gte'][_0xf169('0x45')](',');var _0x114f08={};_0x114f08[_0x41a12b[0x0]]={'$gte':moment(_0x41a12b[0x1])[_0xf169('0x46')](_0xf169('0x47'))};_0x3b62c3[_0xf169('0x41')]=_[_0xf169('0x2f')](_0x3b62c3[_0xf169('0x41')],_0x114f08);}_0x3b62c3=_[_0xf169('0x2f')]({},_0x3b62c3,_0x437cde[_0xf169('0x30')]);return db[_0xf169('0x3a')][_0xf169('0x13')]({'where':_0x3b62c3[_0xf169('0x41')]})['then'](function(_0x14a72a){_0x2ccae9['count']=_0x14a72a;if(_0x437cde[_0xf169('0x24')]['includeAll']){_0x3b62c3[_0xf169('0x48')]=[{'all':!![]}];}return db[_0xf169('0x3a')]['findAll'](_0x3b62c3);})[_0xf169('0x18')](function(_0x46c407){_0x2ccae9[_0xf169('0x49')]=_0x46c407;return _0x2ccae9;});}})[_0xf169('0x18')](respondWithFilteredResult(_0x18162e,_0x3b62c3))['catch'](handleError(_0x18162e,null));};exports[_0xf169('0x4a')]=function(_0x106078,_0x344ac9){return db[_0xf169('0x1e')][_0xf169('0x31')]({'where':{'id':_0x106078[_0xf169('0x28')]['id']}})['then'](handleEntityNotFound(_0x344ac9,null))[_0xf169('0x18')](function(_0x520877){if(_0x520877){return _0x520877[_0xf169('0x4b')](_0x106078[_0xf169('0x33')][_0xf169('0x36')],_['omit'](_0x106078[_0xf169('0x33')],['ids','id'])||{})['spread'](function(){return db['Tag'][_0xf169('0x22')]({'attributes':['id','name','color'],'where':{'id':_0x106078[_0xf169('0x33')][_0xf169('0x36')]}});})[_0xf169('0x18')](function(_0x5336f4){socket[_0xf169('0x4c')](_0xf169('0x4d'),{'id':Number(_0x106078[_0xf169('0x28')]['id']),'tags':_0x5336f4||[]});return{'id':Number(_0x106078[_0xf169('0x28')]['id']),'tags':_0x5336f4||[]};});}})[_0xf169('0x18')](respondWithResult(_0x344ac9,null))[_0xf169('0x26')](handleError(_0x344ac9,null));};exports['removeTags']=function(_0x219912,_0x27d76b){return db[_0xf169('0x1e')]['find']({'where':{'id':_0x219912[_0xf169('0x28')]['id']}})[_0xf169('0x18')](handleEntityNotFound(_0x27d76b,null))[_0xf169('0x18')](function(_0x4190bf){if(_0x4190bf){return _0x4190bf['removeTags'](_0x219912[_0xf169('0x24')][_0xf169('0x36')]);}})[_0xf169('0x18')](respondWithStatusCode(_0x27d76b,null))['catch'](handleError(_0x27d76b,null));};exports[_0xf169('0x4e')]=function(_0xbecd49,_0x1730e2){var _0x54bbb3=moment()[_0xf169('0x4f')]()[_0xf169('0x50')]();var _0x3fa6db=path['join'](config[_0xf169('0x51')],_0xf169('0x52'),'files',_0xf169('0x53'));var _0x38bcfd=path[_0xf169('0x54')](_0x3fa6db,_0x54bbb3);var _0x555aa1=util[_0xf169('0x46')](_0xf169('0x55'),_0xbecd49[_0xf169('0x28')]['id'],_0x54bbb3);var _0x18852a=path[_0xf169('0x54')](_0x3fa6db,_0x555aa1);var _0x269b5b=[];_0x269b5b[_0xf169('0x56')]({'model':db['User'],'as':_0xf169('0x57'),'attributes':['id',_0xf169('0x58')],'raw':!![]});_0x269b5b[_0xf169('0x56')]({'model':db[_0xf169('0x59')],'as':'Contact','attributes':['id',_0xf169('0x5a'),_0xf169('0x5b')],'raw':!![]});var _0xb333a4=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0xf169('0x33'),_0xf169('0x5c'),_0xf169('0x5d'),_0xf169('0x5e'),'read'],'include':_0x269b5b}];_0xb333a4[_0xf169('0x56')]({'model':db['SmsAccount'],'as':_0xf169('0x5f'),'attributes':['id',_0xf169('0x1a')]});_0xb333a4['push']({'model':db[_0xf169('0x57')],'as':_0xf169('0x60'),'attributes':['id','fullname']});return db[_0xf169('0x1e')][_0xf169('0x31')]({'where':{'id':_0xbecd49[_0xf169('0x28')]['id']},'include':_0xb333a4})[_0xf169('0x18')](handleEntityNotFound(_0x1730e2,null))['then'](function(_0x1faf85){if(_0x1faf85){var _0x3e1903=_0x1faf85['get']({'plain':!![]});fs['mkdirSync'](_0x38bcfd);var _0x19515c={'channel':_0xf169('0x61'),'account':_0x3e1903[_0xf169('0x5f')][_0xf169('0x1a')],'agent':_0x3e1903[_0xf169('0x60')]?_0x3e1903[_0xf169('0x60')]['fullname']:_0xf169('0x62'),'createdAt':moment(_0x3e1903[_0xf169('0x5c')])['format'](_0xf169('0x47'))['toString'](),'closedAt':_0x3e1903['closed']?moment(_0x3e1903[_0xf169('0x63')])[_0xf169('0x46')](_0xf169('0x47'))['toString']():'','disposition':_0x3e1903[_0xf169('0x64')],'messages':_(_0x3e1903[_0xf169('0x65')])[_0xf169('0x43')]({'secret':![]})['map'](function(_0x23fb19){return{'date':moment(_0x23fb19[_0xf169('0x5c')])['format'](_0xf169('0x47'))[_0xf169('0x50')](),'sender':_0x23fb19['direction']==='out'?_0x23fb19[_0xf169('0x57')]?_0x23fb19[_0xf169('0x57')]['fullname']:'System':_0x23fb19[_0xf169('0x66')]['firstName']+(_0x23fb19[_0xf169('0x66')]['lastName']?'\x20'+_0x23fb19[_0xf169('0x66')][_0xf169('0x5b')]:''),'body':_0x23fb19[_0xf169('0x33')],'direction':_0x23fb19[_0xf169('0x5d')]===_0xf169('0x67')?'A':'C','secret':_0x23fb19[_0xf169('0x5e')],'read':_0x23fb19[_0xf169('0x68')]};})['value']()};return ejs[_0xf169('0x69')](path[_0xf169('0x54')](config['root'],_0xf169('0x52'),_0xf169('0x6a'),'downloadInteraction.ejs'),{'interaction':_0x19515c})[_0xf169('0x18')](function(_0x3dda1b){var _0x14b15c=path[_0xf169('0x54')](_0x38bcfd,'transcript-'+_0x3e1903['id']+'-'+_0x54bbb3+_0xf169('0x6b'));var _0x302481={'path':_0x14b15c,'channel':_0xf169('0x61'),'interactionId':_0x3e1903['id']};return pdf['createPdfFromHTML'](_0x3dda1b,_0x302481);})[_0xf169('0x18')](function(){return new BPromise(function(_0xf46078,_0x536b63){zipdir(_0x38bcfd,{'saveTo':_0x18852a},function(_0x71687e,_0x7921ce){if(_0x71687e)return _0x536b63(_0x71687e);return _0xf46078(_0x7921ce);});})['then'](function(){return new BPromise(function(_0x5b0350,_0x25548d){rimraf(_0x38bcfd,function(_0xff798){if(_0xff798)_0x25548d(_0xff798);return _0x5b0350();});});})[_0xf169('0x18')](function(){return _0x1730e2[_0xf169('0x4e')](_0x18852a,_0x555aa1,function(_0x331056){if(_0x331056){console['log'](_0xf169('0x6c'),_0x331056);}else{fs['unlinkSync'](_0x18852a);}});});});}else{return _0x1730e2[_0xf169('0xe')](0xc8);}})['catch'](handleError(_0x1730e2,null));}; \ No newline at end of file +var _0x2731=['omit','ids','getMessages','findOne','nolimit','limit','order','sort','where','pick','SmsInteractionId','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','Tag','color','emit','removeTags','download','unix','toString','join','root','server','tmp','format','push','User','fullname','CmContact','lastName','Messages','direction','secret','read','SmsAccount','Account','Owner','get','mkdirSync','N.A.','createdAt','closedAt','disposition','filter','System','Contact','firstName','out','value','renderFile','views','downloadInteraction.ejs','.pdf','Sms','createPdfFromHTML','log','err','rimraf','moment','bluebird','util','path','ejs','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','SmsInteraction','fieldName','type','key','findAll','query','user','catch','model','keys','rawAttributes','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','params','describe','addMessage','SmsMessage'];(function(_0x24e373,_0x2bd453){var _0x2bf3ea=function(_0xfac880){while(--_0xfac880){_0x24e373['push'](_0x24e373['shift']());}};_0x2bf3ea(++_0x2bd453);}(_0x2731,0xbb));var _0x1273=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2731[_0x20a584];return _0x4b41a8;};'use strict';var rimraf=require(_0x1273('0x0'));var zipdir=require('zip-dir');var moment=require(_0x1273('0x1'));var BPromise=require(_0x1273('0x2'));var util=require(_0x1273('0x3'));var path=require(_0x1273('0x4'));var ejs=require(_0x1273('0x5'));var fs=require('fs');var _=require(_0x1273('0x6'));var Redis=require(_0x1273('0x7'));var interaction=require(_0x1273('0x8'));var qs=require(_0x1273('0x9'));var pdf=require(_0x1273('0xa'));var logger=require(_0x1273('0xb'))('api');var config=require(_0x1273('0xc'));var db=require(_0x1273('0xd'))['db'];config[_0x1273('0xe')]=_[_0x1273('0xf')](config['redis'],{'host':_0x1273('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1273('0x11'))[_0x1273('0x12')](socket);function respondWithStatusCode(_0x188776,_0x48ee9d){_0x48ee9d=_0x48ee9d||0xcc;return function(_0x5461c7){if(_0x5461c7){return _0x188776[_0x1273('0x13')](_0x48ee9d);}return _0x188776[_0x1273('0x14')](_0x48ee9d)[_0x1273('0x15')]();};}function respondWithResult(_0x28ac33,_0x33c526){_0x33c526=_0x33c526||0xc8;return function(_0x3b9bce){if(_0x3b9bce){return _0x28ac33[_0x1273('0x14')](_0x33c526)[_0x1273('0x16')](_0x3b9bce);}};}function respondWithFilteredResult(_0x3fc1ca,_0x278d63){return function(_0x176c8d){if(_0x176c8d){var _0xfc1931=typeof _0x278d63[_0x1273('0x17')]===_0x1273('0x18')&&typeof _0x278d63['limit']===_0x1273('0x18');var _0x465f7f=_0x176c8d[_0x1273('0x19')];var _0xe3f95d=_0xfc1931?0x0:_0x278d63[_0x1273('0x17')];var _0x4d3b61=_0xfc1931?_0x176c8d[_0x1273('0x19')]:_0x278d63['offset']+_0x278d63['limit'];var _0x2d63e9;if(_0x4d3b61>=_0x465f7f){_0x4d3b61=_0x465f7f;_0x2d63e9=0xc8;}else{_0x2d63e9=0xce;}_0x3fc1ca[_0x1273('0x14')](_0x2d63e9);return _0x3fc1ca[_0x1273('0x1a')](_0x1273('0x1b'),_0xe3f95d+'-'+_0x4d3b61+'/'+_0x465f7f)[_0x1273('0x16')](_0x176c8d);}return null;};}function saveUpdates(_0x3167e2){return function(_0x34cb55){if(_0x34cb55){return _0x34cb55[_0x1273('0x1c')](_0x3167e2)[_0x1273('0x1d')](function(_0x57e1d4){return _0x57e1d4;});}return null;};}function removeEntity(_0x59f894){return function(_0x236298){if(_0x236298){return _0x236298[_0x1273('0x1e')]()['then'](function(){_0x59f894[_0x1273('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50780c){return function(_0x15d1de){if(!_0x15d1de){_0x50780c[_0x1273('0x13')](0x194);}return _0x15d1de;};}function handleError(_0x676424,_0xb912f){_0xb912f=_0xb912f||0x1f4;return function(_0x113382){logger[_0x1273('0x1f')](_0x113382[_0x1273('0x20')]);if(_0x113382[_0x1273('0x21')]){delete _0x113382[_0x1273('0x21')];}_0x676424['status'](_0xb912f)[_0x1273('0x22')](_0x113382);};}exports[_0x1273('0x23')]=function(_0x3206fe,_0x234795){var _0x4ed731={};var _0x3fe32b=_['map'](db[_0x1273('0x24')]['rawAttributes'],function(_0x42726a){return{'name':_0x42726a[_0x1273('0x25')],'type':_0x42726a[_0x1273('0x26')][_0x1273('0x27')]};});_0x4ed731=qs['getOptions'](_0x3fe32b,_0x3206fe);return interaction[_0x1273('0x28')]('sms',_0x3206fe[_0x1273('0x29')],_0x3206fe[_0x1273('0x2a')],_0x4ed731,_0x3fe32b)[_0x1273('0x1d')](respondWithFilteredResult(_0x234795,_0x4ed731))[_0x1273('0x2b')](handleError(_0x234795,null));};exports['show']=function(_0xa399d4,_0x17721b){var _0x56fea0={'raw':![],'where':{'id':_0xa399d4['params']['id']}},_0x3af70d={};_0x3af70d[_0x1273('0x2c')]=_[_0x1273('0x2d')](db[_0x1273('0x24')][_0x1273('0x2e')]);_0x3af70d[_0x1273('0x29')]=_[_0x1273('0x2d')](_0xa399d4[_0x1273('0x29')]);_0x3af70d[_0x1273('0x2f')]=_[_0x1273('0x30')](_0x3af70d['model'],_0x3af70d['query']);_0x56fea0[_0x1273('0x31')]=_['intersection'](_0x3af70d[_0x1273('0x2c')],qs[_0x1273('0x32')](_0xa399d4[_0x1273('0x29')][_0x1273('0x32')]));_0x56fea0[_0x1273('0x31')]=_0x56fea0[_0x1273('0x31')][_0x1273('0x33')]?_0x56fea0['attributes']:_0x3af70d[_0x1273('0x2c')];if(_0xa399d4['query'][_0x1273('0x34')]){_0x56fea0[_0x1273('0x35')]=[{'all':!![]}];}_0x56fea0=_[_0x1273('0x36')]({},_0x56fea0,_0xa399d4[_0x1273('0x37')]);return db['SmsInteraction'][_0x1273('0x38')](_0x56fea0)[_0x1273('0x1d')](handleEntityNotFound(_0x17721b,null))[_0x1273('0x1d')](respondWithResult(_0x17721b,null))[_0x1273('0x2b')](handleError(_0x17721b,null));};exports[_0x1273('0x39')]=function(_0x22145f,_0x5de79f){return db['SmsInteraction']['create'](_0x22145f['body'],{})[_0x1273('0x1d')](respondWithResult(_0x5de79f,0xc9))['catch'](handleError(_0x5de79f,null));};exports[_0x1273('0x1c')]=function(_0x2f2035,_0xa0d863){if(_0x2f2035[_0x1273('0x3a')]['id']){delete _0x2f2035[_0x1273('0x3a')]['id'];}return db[_0x1273('0x24')]['find']({'where':{'id':_0x2f2035[_0x1273('0x3b')]['id']}})[_0x1273('0x1d')](handleEntityNotFound(_0xa0d863,null))['then'](saveUpdates(_0x2f2035[_0x1273('0x3a')],null))[_0x1273('0x1d')](respondWithResult(_0xa0d863,null))[_0x1273('0x2b')](handleError(_0xa0d863,null));};exports[_0x1273('0x1e')]=function(_0x2efb3b,_0x23ddec){return db[_0x1273('0x24')][_0x1273('0x38')]({'where':{'id':_0x2efb3b[_0x1273('0x3b')]['id']}})[_0x1273('0x1d')](handleEntityNotFound(_0x23ddec,null))[_0x1273('0x1d')](removeEntity(_0x23ddec,null))[_0x1273('0x2b')](handleError(_0x23ddec,null));};exports[_0x1273('0x3c')]=function(_0x4e9085,_0x59dc59){return db[_0x1273('0x24')][_0x1273('0x3c')]()[_0x1273('0x1d')](respondWithResult(_0x59dc59,null))[_0x1273('0x2b')](handleError(_0x59dc59,null));};exports[_0x1273('0x3d')]=function(_0x2c238d,_0x1a751c){return db[_0x1273('0x3e')]['find']({'where':{'id':_0x2c238d[_0x1273('0x3b')]['id']}})[_0x1273('0x1d')](handleEntityNotFound(_0x1a751c,null))[_0x1273('0x1d')](function(_0x383ba5){if(_0x383ba5){return _0x383ba5[_0x1273('0x3d')](_0x2c238d['body']['ids'],_[_0x1273('0x3f')](_0x2c238d[_0x1273('0x3a')],[_0x1273('0x40'),'id'])||{});}})[_0x1273('0x1d')](respondWithResult(_0x1a751c,null))[_0x1273('0x2b')](handleError(_0x1a751c,null));};exports[_0x1273('0x41')]=function(_0x1a9a98,_0x4f6b06){var _0x141e95={'raw':![],'where':{}};var _0x54eed5={};var _0x25aaad={'count':0x0,'rows':[]};return db[_0x1273('0x24')][_0x1273('0x42')]({'where':{'id':_0x1a9a98[_0x1273('0x3b')]['id']}})[_0x1273('0x1d')](handleEntityNotFound(_0x4f6b06,null))['then'](function(_0x23f163){if(_0x23f163){_0x54eed5[_0x1273('0x2c')]=_[_0x1273('0x2d')](db[_0x1273('0x3e')][_0x1273('0x2e')]);_0x54eed5['query']=_['keys'](_0x1a9a98['query']);_0x54eed5['filters']=_['intersection'](_0x54eed5[_0x1273('0x2c')],_0x54eed5[_0x1273('0x29')]);_0x141e95[_0x1273('0x31')]=_[_0x1273('0x30')](_0x54eed5[_0x1273('0x2c')],qs['fields'](_0x1a9a98['query'][_0x1273('0x32')]));_0x141e95[_0x1273('0x31')]=_0x141e95['attributes']['length']?_0x141e95[_0x1273('0x31')]:_0x54eed5['model'];if(!_0x1a9a98['query']['hasOwnProperty'](_0x1273('0x43'))){_0x141e95['limit']=qs[_0x1273('0x44')](_0x1a9a98[_0x1273('0x29')][_0x1273('0x44')]);_0x141e95[_0x1273('0x17')]=qs[_0x1273('0x17')](_0x1a9a98[_0x1273('0x29')][_0x1273('0x17')]);}_0x141e95[_0x1273('0x45')]=qs[_0x1273('0x46')](_0x1a9a98[_0x1273('0x29')][_0x1273('0x46')]);_0x141e95[_0x1273('0x47')]=qs[_0x1273('0x2f')](_[_0x1273('0x48')](_0x1a9a98['query'],_0x54eed5[_0x1273('0x2f')]));_0x141e95[_0x1273('0x47')][_0x1273('0x49')]=_0x23f163['id'];if(_0x1a9a98[_0x1273('0x29')]['filter']){_0x141e95[_0x1273('0x47')]=_[_0x1273('0x36')](_0x141e95['where'],{'$or':_[_0x1273('0x4a')](_0x141e95[_0x1273('0x31')],function(_0xaefbc2){var _0x3938f8={};_0x3938f8[_0xaefbc2]={'$like':'%'+_0x1a9a98[_0x1273('0x29')]['filter']+'%'};return _0x3938f8;})});}if(_0x1a9a98[_0x1273('0x29')][_0x1273('0x4b')]){var _0x541a17=_0x1a9a98[_0x1273('0x29')][_0x1273('0x4b')][_0x1273('0x4c')](',');var _0x4d7767={};_0x4d7767[_0x541a17[0x0]]={'$gte':moment(_0x541a17[0x1])['format'](_0x1273('0x4d'))};_0x141e95['where']=_[_0x1273('0x36')](_0x141e95[_0x1273('0x47')],_0x4d7767);}_0x141e95=_[_0x1273('0x36')]({},_0x141e95,_0x1a9a98[_0x1273('0x37')]);return db[_0x1273('0x3e')]['count']({'where':_0x141e95[_0x1273('0x47')]})['then'](function(_0x2d32eb){_0x25aaad['count']=_0x2d32eb;if(_0x1a9a98[_0x1273('0x29')][_0x1273('0x34')]){_0x141e95[_0x1273('0x35')]=[{'all':!![]}];}return db[_0x1273('0x3e')][_0x1273('0x28')](_0x141e95);})[_0x1273('0x1d')](function(_0x36b8eb){_0x25aaad[_0x1273('0x4e')]=_0x36b8eb;return _0x25aaad;});}})[_0x1273('0x1d')](respondWithFilteredResult(_0x4f6b06,_0x141e95))[_0x1273('0x2b')](handleError(_0x4f6b06,null));};exports[_0x1273('0x4f')]=function(_0x57f1cd,_0xc97a98){return db['SmsInteraction'][_0x1273('0x38')]({'where':{'id':_0x57f1cd[_0x1273('0x3b')]['id']}})['then'](handleEntityNotFound(_0xc97a98,null))[_0x1273('0x1d')](function(_0x44c179){if(_0x44c179){return _0x44c179[_0x1273('0x50')](_0x57f1cd['body'][_0x1273('0x40')],_[_0x1273('0x3f')](_0x57f1cd[_0x1273('0x3a')],['ids','id'])||{})['spread'](function(){return db[_0x1273('0x51')]['findAll']({'attributes':['id',_0x1273('0x21'),_0x1273('0x52')],'where':{'id':_0x57f1cd['body'][_0x1273('0x40')]}});})[_0x1273('0x1d')](function(_0x20ac8f){socket[_0x1273('0x53')]('smsInteractionTags:save',{'id':Number(_0x57f1cd[_0x1273('0x3b')]['id']),'tags':_0x20ac8f||[]});return{'id':Number(_0x57f1cd[_0x1273('0x3b')]['id']),'tags':_0x20ac8f||[]};});}})['then'](respondWithResult(_0xc97a98,null))[_0x1273('0x2b')](handleError(_0xc97a98,null));};exports['removeTags']=function(_0x4d403b,_0x1f8521){return db[_0x1273('0x24')][_0x1273('0x38')]({'where':{'id':_0x4d403b[_0x1273('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1f8521,null))[_0x1273('0x1d')](function(_0x48f81f){if(_0x48f81f){return _0x48f81f[_0x1273('0x54')](_0x4d403b[_0x1273('0x29')]['ids']);}})[_0x1273('0x1d')](respondWithStatusCode(_0x1f8521,null))[_0x1273('0x2b')](handleError(_0x1f8521,null));};exports[_0x1273('0x55')]=function(_0x10b18a,_0x2f1b4c){var _0x5e2bac=moment()[_0x1273('0x56')]()[_0x1273('0x57')]();var _0x483ec2=path[_0x1273('0x58')](config[_0x1273('0x59')],_0x1273('0x5a'),'files',_0x1273('0x5b'));var _0x842b9a=path['join'](_0x483ec2,_0x5e2bac);var _0x138027=util[_0x1273('0x5c')]('transcript-%d-%s.zip',_0x10b18a[_0x1273('0x3b')]['id'],_0x5e2bac);var _0x2f7a0b=path[_0x1273('0x58')](_0x483ec2,_0x138027);var _0x3bb483=[];_0x3bb483[_0x1273('0x5d')]({'model':db[_0x1273('0x5e')],'as':_0x1273('0x5e'),'attributes':['id',_0x1273('0x5f')],'raw':!![]});_0x3bb483['push']({'model':db[_0x1273('0x60')],'as':'Contact','attributes':['id','firstName',_0x1273('0x61')],'raw':!![]});var _0x4c1fb8=[{'model':db[_0x1273('0x3e')],'as':_0x1273('0x62'),'attributes':['id','body','createdAt',_0x1273('0x63'),_0x1273('0x64'),_0x1273('0x65')],'include':_0x3bb483}];_0x4c1fb8[_0x1273('0x5d')]({'model':db[_0x1273('0x66')],'as':_0x1273('0x67'),'attributes':['id','name']});_0x4c1fb8[_0x1273('0x5d')]({'model':db[_0x1273('0x5e')],'as':_0x1273('0x68'),'attributes':['id',_0x1273('0x5f')]});return db[_0x1273('0x24')][_0x1273('0x38')]({'where':{'id':_0x10b18a[_0x1273('0x3b')]['id']},'include':_0x4c1fb8})[_0x1273('0x1d')](handleEntityNotFound(_0x2f1b4c,null))[_0x1273('0x1d')](function(_0x33bbbe){if(_0x33bbbe){var _0x31bd95=_0x33bbbe[_0x1273('0x69')]({'plain':!![]});fs[_0x1273('0x6a')](_0x842b9a);var _0x290ca9={'channel':'Sms','account':_0x31bd95[_0x1273('0x67')]['name'],'agent':_0x31bd95[_0x1273('0x68')]?_0x31bd95['Owner'][_0x1273('0x5f')]:_0x1273('0x6b'),'createdAt':moment(_0x31bd95[_0x1273('0x6c')])['format'](_0x1273('0x4d'))[_0x1273('0x57')](),'closedAt':_0x31bd95['closed']?moment(_0x31bd95[_0x1273('0x6d')])[_0x1273('0x5c')](_0x1273('0x4d'))[_0x1273('0x57')]():'','disposition':_0x31bd95[_0x1273('0x6e')],'messages':_(_0x31bd95['Messages'])[_0x1273('0x6f')]({'secret':![]})[_0x1273('0x4a')](function(_0x76196){return{'date':moment(_0x76196[_0x1273('0x6c')])[_0x1273('0x5c')](_0x1273('0x4d'))[_0x1273('0x57')](),'sender':_0x76196[_0x1273('0x63')]==='out'?_0x76196[_0x1273('0x5e')]?_0x76196['User']['fullname']:_0x1273('0x70'):_0x76196[_0x1273('0x71')][_0x1273('0x72')]+(_0x76196[_0x1273('0x71')][_0x1273('0x61')]?'\x20'+_0x76196[_0x1273('0x71')][_0x1273('0x61')]:''),'body':_0x76196[_0x1273('0x3a')],'direction':_0x76196[_0x1273('0x63')]===_0x1273('0x73')?'A':'C','secret':_0x76196[_0x1273('0x64')],'read':_0x76196['read']};})[_0x1273('0x74')]()};return ejs[_0x1273('0x75')](path['join'](config[_0x1273('0x59')],_0x1273('0x5a'),_0x1273('0x76'),_0x1273('0x77')),{'interaction':_0x290ca9})[_0x1273('0x1d')](function(_0x4834a3){var _0x2cacba=path['join'](_0x842b9a,'transcript-'+_0x31bd95['id']+'-'+_0x5e2bac+_0x1273('0x78'));var _0x5e48bb={'path':_0x2cacba,'channel':_0x1273('0x79'),'interactionId':_0x31bd95['id']};return pdf[_0x1273('0x7a')](_0x4834a3,_0x5e48bb);})[_0x1273('0x1d')](function(){return new BPromise(function(_0x432368,_0x5818f9){zipdir(_0x842b9a,{'saveTo':_0x2f7a0b},function(_0x2f30c9,_0x5e852e){if(_0x2f30c9)return _0x5818f9(_0x2f30c9);return _0x432368(_0x5e852e);});})['then'](function(){return new BPromise(function(_0x582eaf,_0x319616){rimraf(_0x842b9a,function(_0x4a7093){if(_0x4a7093)_0x319616(_0x4a7093);return _0x582eaf();});});})[_0x1273('0x1d')](function(){return _0x2f1b4c[_0x1273('0x55')](_0x2f7a0b,_0x138027,function(_0x3f346){if(_0x3f346){console[_0x1273('0x7b')](_0x1273('0x7c'),_0x3f346);}else{fs['unlinkSync'](_0x2f7a0b);}});});});}else{return _0x2f1b4c[_0x1273('0x13')](0xc8);}})[_0x1273('0x2b')](handleError(_0x2f1b4c,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 58bf224..de7bff5 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 _0x3266=['length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','map','findAll','unreadMessages'];(function(_0x1e78c1,_0x8ec6ad){var _0x3c827c=function(_0x41ce54){while(--_0x41ce54){_0x1e78c1['push'](_0x1e78c1['shift']());}};_0x3c827c(++_0x8ec6ad);}(_0x3266,0x6a));var _0x6326=function(_0x44b3bd,_0x44c97d){_0x44b3bd=_0x44b3bd-0x0;var _0x1efc4a=_0x3266[_0x44b3bd];return _0x1efc4a;};'use strict';var EventEmitter=require(_0x6326('0x0'));var SmsInteraction=require(_0x6326('0x1'))['db'][_0x6326('0x2')];var SmsMessage=require(_0x6326('0x1'))['db'][_0x6326('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x6326('0x4')](0x0);var events={'afterCreate':_0x6326('0x5'),'afterUpdate':_0x6326('0x6'),'afterDestroy':_0x6326('0x7')};function emitEvent(_0x5a6b4d){return function(_0x30b22e,_0x5f38a3,_0x25ecd8){_0x30b22e[_0x6326('0x8')]({'attributes':['id'],'raw':!![]})[_0x6326('0x9')](function(_0x5402e5){_0x30b22e[_0x6326('0xa')]('Users',_0x5402e5[_0x6326('0xb')](function(_0x90c0f){return{'id':_0x90c0f['id']};}));return SmsMessage[_0x6326('0xc')]({'where':{'SmsInteractionId':_0x30b22e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6326('0x9')](function(_0x37a23d){_0x30b22e['setDataValue'](_0x6326('0xd'),_0x37a23d[_0x6326('0xe')]);SmsInteractionEvents[_0x6326('0xf')](_0x5a6b4d+':'+_0x30b22e['id'],_0x30b22e);SmsInteractionEvents[_0x6326('0xf')](_0x5a6b4d,_0x30b22e);_0x25ecd8(null);})[_0x6326('0x10')](_0x25ecd8(null));};}for(var e in events){if(events[_0x6326('0x11')](e)){var event=events[e];SmsInteraction[_0x6326('0x12')](e,emitEvent(event));}}module[_0x6326('0x13')]=SmsInteractionEvents; \ No newline at end of file +var _0xd4a2=['getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','update'];(function(_0x3e95a8,_0xa7af87){var _0x1d8724=function(_0xd751a7){while(--_0xd751a7){_0x3e95a8['push'](_0x3e95a8['shift']());}};_0x1d8724(++_0xa7af87);}(_0xd4a2,0x173));var _0x2d4a=function(_0x9b5e,_0xb76b79){_0x9b5e=_0x9b5e-0x0;var _0x8362cb=_0xd4a2[_0x9b5e];return _0x8362cb;};'use strict';var EventEmitter=require(_0x2d4a('0x0'));var SmsInteraction=require('../../mysqldb')['db']['SmsInteraction'];var SmsMessage=require(_0x2d4a('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x2d4a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2d4a('0x3'),'afterDestroy':'remove'};function emitEvent(_0x32af9e){return function(_0x40d744,_0x2624b5,_0x3a88e2){_0x40d744[_0x2d4a('0x4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x45fefb){_0x40d744[_0x2d4a('0x5')](_0x2d4a('0x6'),_0x45fefb[_0x2d4a('0x7')](function(_0x3b8d7b){return{'id':_0x3b8d7b['id']};}));return SmsMessage[_0x2d4a('0x8')]({'where':{'SmsInteractionId':_0x40d744['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2d4a('0x9')](function(_0x113839){_0x40d744[_0x2d4a('0x5')](_0x2d4a('0xa'),_0x113839[_0x2d4a('0xb')]);SmsInteractionEvents[_0x2d4a('0xc')](_0x32af9e+':'+_0x40d744['id'],_0x40d744);SmsInteractionEvents['emit'](_0x32af9e,_0x40d744);_0x3a88e2(null);})['catch'](_0x3a88e2(null));};}for(var e in events){if(events[_0x2d4a('0xd')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module[_0x2d4a('0xe')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index feb9892..9da92e7 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 _0xa2e4=['util','moment','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash'];(function(_0x1d6e3d,_0x51b0c5){var _0x27d1e4=function(_0x37d6c4){while(--_0x37d6c4){_0x1d6e3d['push'](_0x1d6e3d['shift']());}};_0x27d1e4(++_0x51b0c5);}(_0xa2e4,0x153));var _0x4a2e=function(_0x184a28,_0x5edabd){_0x184a28=_0x184a28-0x0;var _0xdd5f60=_0xa2e4[_0x184a28];return _0xdd5f60;};'use strict';var _=require(_0x4a2e('0x0'));var util=require(_0x4a2e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x4a2e('0x2'));var BPromise=require('bluebird');var rp=require(_0x4a2e('0x3'));var fs=require('fs');var path=require(_0x4a2e('0x4'));var rimraf=require(_0x4a2e('0x5'));var config=require(_0x4a2e('0x6'));var attributes=require(_0x4a2e('0x7'));module[_0x4a2e('0x8')]=function(_0x3ef64e,_0x8c64a3){return _0x3ef64e[_0x4a2e('0x9')](_0x4a2e('0xa'),attributes,{'tableName':_0x4a2e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x292b87,_0x185e22,_0x34aa2c){if(_0x292b87[_0x4a2e('0xc')](_0x4a2e('0xd'))){_0x292b87[_0x4a2e('0xe')]=moment()[_0x4a2e('0xf')](_0x4a2e('0x10'));}_0x34aa2c(null,_0x292b87);}}});}; \ No newline at end of file +var _0x1c82=['path','../../config/environment','exports','define','sms_interactions','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x91aa06,_0x2d2a2d){var _0x533ff6=function(_0x4cdd8d){while(--_0x4cdd8d){_0x91aa06['push'](_0x91aa06['shift']());}};_0x533ff6(++_0x2d2a2d);}(_0x1c82,0xad));var _0x21c8=function(_0xf325c7,_0x105c57){_0xf325c7=_0xf325c7-0x0;var _0x440666=_0x1c82[_0xf325c7];return _0x440666;};'use strict';var _=require(_0x21c8('0x0'));var util=require(_0x21c8('0x1'));var logger=require(_0x21c8('0x2'))(_0x21c8('0x3'));var moment=require(_0x21c8('0x4'));var BPromise=require(_0x21c8('0x5'));var rp=require(_0x21c8('0x6'));var fs=require('fs');var path=require(_0x21c8('0x7'));var rimraf=require('rimraf');var config=require(_0x21c8('0x8'));var attributes=require('./smsInteraction.attributes');module[_0x21c8('0x9')]=function(_0x172489,_0x41cffe){return _0x172489[_0x21c8('0xa')]('SmsInteraction',attributes,{'tableName':_0x21c8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xf4e2da,_0x4bfeb5,_0x66970a){if(_0xf4e2da[_0x21c8('0xc')]('closed')){_0xf4e2da['closedAt']=moment()[_0x21c8('0xd')](_0x21c8('0xe'));}_0x66970a(null,_0xf4e2da);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 3649dff..a92a473 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 _0xe48b=['AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./smsInteraction.socket','register','request','then','info','SmsInteraction,\x20%s,\x20%s','code','error','message','request\x20sent','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','attributes','limit','debug','stringify','catch','AddTagsToSmsInteraction','addTags','ids','spread'];(function(_0x540e4e,_0x1dd221){var _0x13bd45=function(_0x5a1ef){while(--_0x5a1ef){_0x540e4e['push'](_0x540e4e['shift']());}};_0x13bd45(++_0x1dd221);}(_0xe48b,0xa5));var _0xbe48=function(_0x34a617,_0x3412b){_0x34a617=_0x34a617-0x0;var _0x41b538=_0xe48b[_0x34a617];return _0x41b538;};'use strict';var _=require(_0xbe48('0x0'));var util=require(_0xbe48('0x1'));var moment=require(_0xbe48('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe48('0x3'));var db=require(_0xbe48('0x4'))['db'];var utils=require(_0xbe48('0x5'));var logger=require(_0xbe48('0x6'))(_0xbe48('0x7'));var config=require(_0xbe48('0x8'));var jayson=require(_0xbe48('0x9'));var client=jayson[_0xbe48('0xa')][_0xbe48('0xb')]({'port':0x232a});config[_0xbe48('0xc')]=_[_0xbe48('0xd')](config[_0xbe48('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbe48('0xe'))[_0xbe48('0xf')](socket);function respondWithRpcPromise(_0x2c6931,_0x587882,_0x3f75e9){return new BPromise(function(_0x192d27,_0x30a4ea){return client[_0xbe48('0x10')](_0x2c6931,_0x3f75e9)[_0xbe48('0x11')](function(_0x241660){logger[_0xbe48('0x12')](_0xbe48('0x13'),_0x587882,'request\x20sent');logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x587882,'request\x20sent',JSON['stringify'](_0x241660));if(_0x241660['error']){if(_0x241660['error'][_0xbe48('0x14')]===0x1f4){logger[_0xbe48('0x15')](_0xbe48('0x13'),_0x587882,_0x241660[_0xbe48('0x15')][_0xbe48('0x16')]);return _0x30a4ea(_0x241660[_0xbe48('0x15')][_0xbe48('0x16')]);}logger[_0xbe48('0x15')](_0xbe48('0x13'),_0x587882,_0x241660[_0xbe48('0x15')][_0xbe48('0x16')]);return _0x192d27(_0x241660['error'][_0xbe48('0x16')]);}else{logger['info'](_0xbe48('0x13'),_0x587882,_0xbe48('0x17'));_0x192d27(_0x241660['result'][_0xbe48('0x16')]);}})['catch'](function(_0x1c2c25){logger[_0xbe48('0x15')](_0xbe48('0x13'),_0x587882,_0x1c2c25);_0x30a4ea(_0x1c2c25);});});}exports[_0xbe48('0x18')]=function(_0x3e9e63){var _0xb249b8=this;return new Promise(function(_0x531f2d,_0x4a5766){return db[_0xbe48('0x19')][_0xbe48('0x1a')](_0x3e9e63[_0xbe48('0x1b')],{'raw':_0x3e9e63['options']?_0x3e9e63[_0xbe48('0x1c')][_0xbe48('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e9e63[_0xbe48('0x1c')]?_0x3e9e63[_0xbe48('0x1c')][_0xbe48('0x1e')]||null:null,'attributes':_0x3e9e63['options']?_0x3e9e63[_0xbe48('0x1c')][_0xbe48('0x1f')]||null:null,'limit':_0x3e9e63['options']?_0x3e9e63['options'][_0xbe48('0x20')]||null:null})['then'](function(_0x59997f){logger[_0xbe48('0x12')](_0xbe48('0x18'),_0x3e9e63);logger[_0xbe48('0x21')]('UpdateSmsInteraction',_0x3e9e63,JSON[_0xbe48('0x22')](_0x59997f));_0x531f2d(_0x59997f);})[_0xbe48('0x23')](function(_0x2ff19d){logger[_0xbe48('0x15')](_0xbe48('0x18'),_0x2ff19d['message'],_0x3e9e63);_0x4a5766(_0xb249b8[_0xbe48('0x15')](0x1f4,_0x2ff19d['message']));});});};exports[_0xbe48('0x24')]=function(_0x355cfb){return new Promise(function(_0x2250ed,_0x458bee){return db[_0xbe48('0x19')]['find']({'where':_0x355cfb[_0xbe48('0x1c')]?_0x355cfb['options'][_0xbe48('0x1e')]||null:null})[_0xbe48('0x11')](function(_0x1997e2){if(_0x1997e2){return _0x1997e2[_0xbe48('0x25')](_0x355cfb[_0xbe48('0x1b')][_0xbe48('0x26')],_['omit'](_0x355cfb[_0xbe48('0x1b')],[_0xbe48('0x26'),'id'])||{});}})[_0xbe48('0x27')](function(_0x208d56){logger[_0xbe48('0x12')](_0xbe48('0x28'),_0x355cfb);logger[_0xbe48('0x21')](_0xbe48('0x28'),_0x355cfb,JSON[_0xbe48('0x22')](_0x208d56));_0x2250ed(_0x208d56);})[_0xbe48('0x23')](function(_0x3942d8){logger[_0xbe48('0x15')](_0xbe48('0x28'),_0x3942d8['message'],_0x355cfb);_0x458bee(_this[_0xbe48('0x15')](0x1f4,_0x3942d8[_0xbe48('0x16')]));});});}; \ No newline at end of file +var _0x40ff=['addTags','ids','omit','spread','AddTags','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','UpdateSmsInteraction','SmsInteraction','update','body','options','raw','where','debug','AddTagsToSmsInteraction'];(function(_0x55ec85,_0x209bff){var _0x3a80c5=function(_0x19901d){while(--_0x19901d){_0x55ec85['push'](_0x55ec85['shift']());}};_0x3a80c5(++_0x209bff);}(_0x40ff,0x1bd));var _0xf40f=function(_0x8dba7,_0x29082e){_0x8dba7=_0x8dba7-0x0;var _0x542462=_0x40ff[_0x8dba7];return _0x542462;};'use strict';var _=require(_0xf40f('0x0'));var util=require(_0xf40f('0x1'));var moment=require(_0xf40f('0x2'));var BPromise=require('bluebird');var rs=require(_0xf40f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf40f('0x4'))['db'];var utils=require(_0xf40f('0x5'));var logger=require(_0xf40f('0x6'))(_0xf40f('0x7'));var config=require('../../config/environment');var jayson=require(_0xf40f('0x8'));var client=jayson[_0xf40f('0x9')][_0xf40f('0xa')]({'port':0x232a});config['redis']=_[_0xf40f('0xb')](config['redis'],{'host':_0xf40f('0xc'),'port':0x18eb});var socket=require(_0xf40f('0xd'))(new Redis(config['redis']));require(_0xf40f('0xe'))[_0xf40f('0xf')](socket);function respondWithRpcPromise(_0x193cba,_0x34f219,_0x143678){return new BPromise(function(_0x1d8404,_0x396a5d){return client[_0xf40f('0x10')](_0x193cba,_0x143678)[_0xf40f('0x11')](function(_0x1cdd27){logger['info'](_0xf40f('0x12'),_0x34f219,'request\x20sent');logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x34f219,_0xf40f('0x13'),JSON[_0xf40f('0x14')](_0x1cdd27));if(_0x1cdd27['error']){if(_0x1cdd27[_0xf40f('0x15')]['code']===0x1f4){logger[_0xf40f('0x15')](_0xf40f('0x12'),_0x34f219,_0x1cdd27[_0xf40f('0x15')][_0xf40f('0x16')]);return _0x396a5d(_0x1cdd27[_0xf40f('0x15')]['message']);}logger[_0xf40f('0x15')](_0xf40f('0x12'),_0x34f219,_0x1cdd27[_0xf40f('0x15')][_0xf40f('0x16')]);return _0x1d8404(_0x1cdd27[_0xf40f('0x15')][_0xf40f('0x16')]);}else{logger[_0xf40f('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x34f219,'request\x20sent');_0x1d8404(_0x1cdd27[_0xf40f('0x18')][_0xf40f('0x16')]);}})[_0xf40f('0x19')](function(_0x438bd2){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x34f219,_0x438bd2);_0x396a5d(_0x438bd2);});});}exports[_0xf40f('0x1a')]=function(_0x7adfd){var _0x1afb86=this;return new Promise(function(_0x58d658,_0x137d9e){return db[_0xf40f('0x1b')][_0xf40f('0x1c')](_0x7adfd[_0xf40f('0x1d')],{'raw':_0x7adfd[_0xf40f('0x1e')]?_0x7adfd[_0xf40f('0x1e')][_0xf40f('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7adfd[_0xf40f('0x1e')]?_0x7adfd[_0xf40f('0x1e')][_0xf40f('0x20')]||null:null,'attributes':_0x7adfd[_0xf40f('0x1e')]?_0x7adfd['options']['attributes']||null:null,'limit':_0x7adfd[_0xf40f('0x1e')]?_0x7adfd[_0xf40f('0x1e')]['limit']||null:null})[_0xf40f('0x11')](function(_0x47077d){logger[_0xf40f('0x17')](_0xf40f('0x1a'),_0x7adfd);logger[_0xf40f('0x21')](_0xf40f('0x1a'),_0x7adfd,JSON[_0xf40f('0x14')](_0x47077d));_0x58d658(_0x47077d);})['catch'](function(_0x28586a){logger[_0xf40f('0x15')](_0xf40f('0x1a'),_0x28586a[_0xf40f('0x16')],_0x7adfd);_0x137d9e(_0x1afb86[_0xf40f('0x15')](0x1f4,_0x28586a[_0xf40f('0x16')]));});});};exports[_0xf40f('0x22')]=function(_0x1875ba){return new Promise(function(_0x899782,_0x245c9f){return db[_0xf40f('0x1b')]['find']({'where':_0x1875ba[_0xf40f('0x1e')]?_0x1875ba[_0xf40f('0x1e')][_0xf40f('0x20')]||null:null})[_0xf40f('0x11')](function(_0x1a3fce){if(_0x1a3fce){return _0x1a3fce[_0xf40f('0x23')](_0x1875ba[_0xf40f('0x1d')][_0xf40f('0x24')],_[_0xf40f('0x25')](_0x1875ba[_0xf40f('0x1d')],[_0xf40f('0x24'),'id'])||{});}})[_0xf40f('0x26')](function(_0x4de485){logger[_0xf40f('0x17')](_0xf40f('0x27'),_0x1875ba);logger[_0xf40f('0x21')](_0xf40f('0x27'),_0x1875ba,JSON['stringify'](_0x4de485));_0x899782(_0x4de485);})[_0xf40f('0x19')](function(_0x23900f){logger[_0xf40f('0x15')]('AddTags',_0x23900f[_0xf40f('0x16')],_0x1875ba);_0x245c9f(_this[_0xf40f('0x15')](0x1f4,_0x23900f[_0xf40f('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 6495634..e18bceb 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 _0xfc94=['removeListener','register','smsInteraction:','./smsInteraction.events','update','emit'];(function(_0x2d8546,_0x5e75ee){var _0x4ae61d=function(_0x404e17){while(--_0x404e17){_0x2d8546['push'](_0x2d8546['shift']());}};_0x4ae61d(++_0x5e75ee);}(_0xfc94,0x1ef));var _0x4fc9=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xfc94[_0x413feb];return _0x40ee88;};'use strict';var SmsInteractionEvents=require(_0x4fc9('0x0'));var events=['save','remove',_0x4fc9('0x1')];function createListener(_0x286b45,_0xece44){return function(_0x196ae5){_0xece44[_0x4fc9('0x2')](_0x286b45,_0x196ae5);};}function removeListener(_0x500a19,_0x4c8610){return function(){SmsInteractionEvents[_0x4fc9('0x3')](_0x500a19,_0x4c8610);};}exports[_0x4fc9('0x4')]=function(_0x104877){for(var _0x5d5801=0x0,_0x5c093b=events['length'];_0x5d5801<_0x5c093b;_0x5d5801++){var _0x3fdf67=events[_0x5d5801];var _0x4d74b6=createListener(_0x4fc9('0x5')+_0x3fdf67,_0x104877);SmsInteractionEvents['on'](_0x3fdf67,_0x4d74b6);}}; \ No newline at end of file +var _0x1f04=['length','smsInteraction:','save','remove','update'];(function(_0x433795,_0x253d09){var _0x27661e=function(_0x1c4870){while(--_0x1c4870){_0x433795['push'](_0x433795['shift']());}};_0x27661e(++_0x253d09);}(_0x1f04,0x1c4));var _0x41f0=function(_0x59ffd4,_0x4bda83){_0x59ffd4=_0x59ffd4-0x0;var _0x31fb33=_0x1f04[_0x59ffd4];return _0x31fb33;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x41f0('0x0'),_0x41f0('0x1'),_0x41f0('0x2')];function createListener(_0x29ab9c,_0x1b806d){return function(_0x7ae718){_0x1b806d['emit'](_0x29ab9c,_0x7ae718);};}function removeListener(_0x1f679d,_0x3104f1){return function(){SmsInteractionEvents['removeListener'](_0x1f679d,_0x3104f1);};}exports['register']=function(_0x1bc04b){for(var _0x17ef9e=0x0,_0x583f71=events[_0x41f0('0x3')];_0x17ef9e<_0x583f71;_0x17ef9e++){var _0x5c6bd4=events[_0x17ef9e];var _0x4e739c=createListener(_0x41f0('0x4')+_0x5c6bd4,_0x1bc04b);SmsInteractionEvents['on'](_0x5c6bd4,_0x4e739c);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index f54c52f..6ca4ca1 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 _0x6f18=['./smsMessage.controller','get','isAuthenticated','index','describe','/:id','post','tracked','sms','smsmessage:create','create','/:id/status','put','update','/:id/accept','accept','/:id/reject','reject','delete','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2d85ae,_0x47fd0a){var _0x17c0ec=function(_0x3d18fb){while(--_0x3d18fb){_0x2d85ae['push'](_0x2d85ae['shift']());}};_0x17c0ec(++_0x47fd0a);}(_0x6f18,0x1b4));var _0x86f1=function(_0xe460a,_0x10af0e){_0xe460a=_0xe460a-0x0;var _0x5affc7=_0x6f18[_0xe460a];return _0x5affc7;};'use strict';var multer=require(_0x86f1('0x0'));var util=require('util');var path=require(_0x86f1('0x1'));var timeout=require('connect-timeout');var express=require(_0x86f1('0x2'));var router=express[_0x86f1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x86f1('0x4'));var interaction=require(_0x86f1('0x5'));var config=require('../../config/environment');var controller=require(_0x86f1('0x6'));router[_0x86f1('0x7')]('/',auth[_0x86f1('0x8')](),controller[_0x86f1('0x9')]);router[_0x86f1('0x7')]('/describe',auth[_0x86f1('0x8')](),controller[_0x86f1('0xa')]);router[_0x86f1('0x7')](_0x86f1('0xb'),auth[_0x86f1('0x8')](),controller['show']);router[_0x86f1('0xc')]('/',auth[_0x86f1('0x8')](),interaction[_0x86f1('0xd')](_0x86f1('0xe'),_0x86f1('0xf')),controller[_0x86f1('0x10')]);router[_0x86f1('0xc')](_0x86f1('0x11'),controller['status']);router[_0x86f1('0x12')](_0x86f1('0xb'),auth[_0x86f1('0x8')](),controller[_0x86f1('0x13')]);router[_0x86f1('0x12')](_0x86f1('0x14'),auth['isAuthenticated'](),controller[_0x86f1('0x15')]);router[_0x86f1('0x12')](_0x86f1('0x16'),auth[_0x86f1('0x8')](),controller[_0x86f1('0x17')]);router[_0x86f1('0x18')](_0x86f1('0xb'),auth[_0x86f1('0x8')](),controller['destroy']);module[_0x86f1('0x19')]=router; \ No newline at end of file +var _0x1bc8=['index','/describe','describe','/:id','show','post','tracked','smsmessage:create','create','status','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','express','Router','fs-extra','./smsMessage.controller','get','isAuthenticated'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0x1bc8,0x94));var _0x81bc=function(_0x225f50,_0x48a77d){_0x225f50=_0x225f50-0x0;var _0x19d003=_0x1bc8[_0x225f50];return _0x19d003;};'use strict';var multer=require(_0x81bc('0x0'));var util=require(_0x81bc('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x81bc('0x2'));var router=express[_0x81bc('0x3')]();var fs_extra=require(_0x81bc('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x81bc('0x5'));router[_0x81bc('0x6')]('/',auth[_0x81bc('0x7')](),controller[_0x81bc('0x8')]);router[_0x81bc('0x6')](_0x81bc('0x9'),auth[_0x81bc('0x7')](),controller[_0x81bc('0xa')]);router[_0x81bc('0x6')](_0x81bc('0xb'),auth[_0x81bc('0x7')](),controller[_0x81bc('0xc')]);router[_0x81bc('0xd')]('/',auth[_0x81bc('0x7')](),interaction[_0x81bc('0xe')]('sms',_0x81bc('0xf')),controller[_0x81bc('0x10')]);router[_0x81bc('0xd')]('/:id/status',controller[_0x81bc('0x11')]);router[_0x81bc('0x12')](_0x81bc('0xb'),auth[_0x81bc('0x7')](),controller[_0x81bc('0x13')]);router[_0x81bc('0x12')](_0x81bc('0x14'),auth[_0x81bc('0x7')](),controller[_0x81bc('0x15')]);router[_0x81bc('0x12')](_0x81bc('0x16'),auth[_0x81bc('0x7')](),controller['reject']);router[_0x81bc('0x17')](_0x81bc('0xb'),auth[_0x81bc('0x7')](),controller[_0x81bc('0x18')]);module[_0x81bc('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 93cc93b..df0fce8 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 _0xdfc3=['TEXT','medium','BOOLEAN','out','STRING','DATE','sequelize','exports'];(function(_0x4b8b31,_0x241247){var _0x5a790f=function(_0x4ebc26){while(--_0x4ebc26){_0x4b8b31['push'](_0x4b8b31['shift']());}};_0x5a790f(++_0x241247);}(_0xdfc3,0x1de));var _0x3dfc=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xdfc3[_0x342baa];return _0x1208f3;};'use strict';var Sequelize=require(_0x3dfc('0x0'));module[_0x3dfc('0x1')]={'body':{'type':Sequelize[_0x3dfc('0x2')](_0x3dfc('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3dfc('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x3dfc('0x5')),'defaultValue':_0x3dfc('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x3dfc('0x6')](0xbe)},'phone':{'type':Sequelize[_0x3dfc('0x6')]},'readAt':{'type':Sequelize[_0x3dfc('0x7')]},'secret':{'type':Sequelize[_0x3dfc('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x3dfc('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x45aa=['TEXT','medium','BOOLEAN','out','STRING','DATE','exports'];(function(_0x596c08,_0x262c3d){var _0x4bf37f=function(_0x4df873){while(--_0x4df873){_0x596c08['push'](_0x596c08['shift']());}};_0x4bf37f(++_0x262c3d);}(_0x45aa,0xdf));var _0xa45a=function(_0x1fb4d7,_0x5c252d){_0x1fb4d7=_0x1fb4d7-0x0;var _0x37b2bd=_0x45aa[_0x1fb4d7];return _0x37b2bd;};'use strict';var Sequelize=require('sequelize');module[_0xa45a('0x0')]={'body':{'type':Sequelize[_0xa45a('0x1')](_0xa45a('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa45a('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa45a('0x4')),'defaultValue':_0xa45a('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xa45a('0x5')](0xbe)},'phone':{'type':Sequelize[_0xa45a('0x5')]},'readAt':{'type':Sequelize[_0xa45a('0x6')]},'secret':{'type':Sequelize[_0xa45a('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa45a('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 8c6984d..3a60f6e 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 _0xe98f=['fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options','SmsMessage','includeAll','include','findAll','catch','show','params','intersection','find','create','body','describe','sms-interactions','accept','sms','read','format','UserId','user','agent','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','User','event','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','twilio','plivo','MessageUUID','indexOf','SmsAccount,\x20%s,\x20%s,\x20%s','groupName','DELIVERED','infobip','eml-format','zip-dir','request-promise','moment','util','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','jayson/promise','client','http','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','attributes'];(function(_0x30e0fc,_0x39acb6){var _0x4802ed=function(_0x22a4fd){while(--_0x22a4fd){_0x30e0fc['push'](_0x30e0fc['shift']());}};_0x4802ed(++_0x39acb6);}(_0xe98f,0xde));var _0xfe98=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe98f[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xfe98('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe98('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe98('0x2'));var moment=require(_0xfe98('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xfe98('0x4'));var path=require('path');var sox=require(_0xfe98('0x5'));var csv=require(_0xfe98('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe98('0x7'));var _=require('lodash');var squel=require(_0xfe98('0x8'));var crypto=require(_0xfe98('0x9'));var jsforce=require(_0xfe98('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xfe98('0x6'));var querystring=require(_0xfe98('0xb'));var Papa=require('papaparse');var Redis=require(_0xfe98('0xc'));var authService=require(_0xfe98('0xd'));var qs=require(_0xfe98('0xe'));var as=require(_0xfe98('0xf'));var hardwareService=require(_0xfe98('0x10'));var logger=require(_0xfe98('0x11'))('api');var utils=require(_0xfe98('0x12'));var config=require(_0xfe98('0x13'));var licenseUtil=require(_0xfe98('0x14'));var db=require(_0xfe98('0x15'))['db'];config[_0xfe98('0x16')]=_['defaults'](config[_0xfe98('0x16')],{'host':_0xfe98('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe98('0x16')]));require('./smsMessage.socket')[_0xfe98('0x18')](socket);var jayson=require(_0xfe98('0x19'));var client=jayson[_0xfe98('0x1a')][_0xfe98('0x1b')]({'port':0x232c});var client9002=jayson['client'][_0xfe98('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x4d92fc,_0x416c4c,_0x8c527c,_0x20d565){return new BPromise(function(_0x476932,_0x4deba7){var _0x56c0f4=_0x20d565||client;return _0x56c0f4[_0xfe98('0x1c')](_0x4d92fc,_0x8c527c)[_0xfe98('0x1d')](function(_0x31bb37){logger['info'](_0xfe98('0x1e'),_0x416c4c,_0xfe98('0x1f'));logger[_0xfe98('0x20')](_0xfe98('0x21'),_0x416c4c,_0xfe98('0x1f'),JSON[_0xfe98('0x22')](_0x31bb37));if(_0x31bb37[_0xfe98('0x23')]){if(_0x31bb37['error'][_0xfe98('0x24')]===0x1f4){logger['error'](_0xfe98('0x1e'),_0x416c4c,_0x31bb37['error']['message']);return _0x4deba7(_0x31bb37[_0xfe98('0x23')][_0xfe98('0x25')]);}logger[_0xfe98('0x23')](_0xfe98('0x1e'),_0x416c4c,_0x31bb37['error'][_0xfe98('0x25')]);return _0x476932(_0x31bb37['error'][_0xfe98('0x25')]);}else{logger[_0xfe98('0x26')](_0xfe98('0x1e'),_0x416c4c,'request\x20sent');_0x476932(_0x31bb37['result'][_0xfe98('0x25')]);}})['catch'](function(_0x7b629e){logger[_0xfe98('0x23')]('SmsMessage,\x20%s,\x20%s',_0x416c4c,_0x7b629e);_0x4deba7(_0x7b629e);});});}function respondWithStatusCode(_0x3dc31d,_0x25f675){_0x25f675=_0x25f675||0xcc;return function(_0x21325b){if(_0x21325b){return _0x3dc31d[_0xfe98('0x27')](_0x25f675);}return _0x3dc31d['status'](_0x25f675)['end']();};}function respondWithResult(_0x5921f0,_0x51da63){_0x51da63=_0x51da63||0xc8;return function(_0xc68e94){if(_0xc68e94){return _0x5921f0[_0xfe98('0x28')](_0x51da63)[_0xfe98('0x29')](_0xc68e94);}};}function respondWithFilteredResult(_0x21c730,_0x1f3fb5){return function(_0x1017b5){if(_0x1017b5){var _0x3029=typeof _0x1f3fb5[_0xfe98('0x2a')]===_0xfe98('0x2b')&&typeof _0x1f3fb5[_0xfe98('0x2c')]==='undefined';var _0x1bed97=_0x1017b5[_0xfe98('0x2d')];var _0x9eb9c9=_0x3029?0x0:_0x1f3fb5[_0xfe98('0x2a')];var _0x3094df=_0x3029?_0x1017b5[_0xfe98('0x2d')]:_0x1f3fb5[_0xfe98('0x2a')]+_0x1f3fb5[_0xfe98('0x2c')];var _0xdbb15e;if(_0x3094df>=_0x1bed97){_0x3094df=_0x1bed97;_0xdbb15e=0xc8;}else{_0xdbb15e=0xce;}_0x21c730[_0xfe98('0x28')](_0xdbb15e);return _0x21c730[_0xfe98('0x2e')](_0xfe98('0x2f'),_0x9eb9c9+'-'+_0x3094df+'/'+_0x1bed97)[_0xfe98('0x29')](_0x1017b5);}return null;};}function patchUpdates(_0x269899){return function(_0x9b0a91){try{jsonpatch['apply'](_0x9b0a91,_0x269899,!![]);}catch(_0x504b58){return BPromise[_0xfe98('0x30')](_0x504b58);}return _0x9b0a91[_0xfe98('0x31')]();};}function saveUpdates(_0x582efe,_0x1a1288){return function(_0x405ebf){if(_0x405ebf){return _0x405ebf[_0xfe98('0x32')](_0x582efe)[_0xfe98('0x1d')](function(_0x22a132){return _0x22a132;});}return null;};}function removeEntity(_0x5ceb1c,_0x2712b9){return function(_0x3a8ad9){if(_0x3a8ad9){return _0x3a8ad9[_0xfe98('0x33')]()[_0xfe98('0x1d')](function(){_0x5ceb1c[_0xfe98('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17dd03,_0x596609){return function(_0x19f0f1){if(!_0x19f0f1){_0x17dd03[_0xfe98('0x27')](0x194);}return _0x19f0f1;};}function handleError(_0x20738c,_0x15a19b){_0x15a19b=_0x15a19b||0x1f4;return function(_0x4131a4){logger[_0xfe98('0x23')](_0x4131a4[_0xfe98('0x34')]);if(_0x4131a4[_0xfe98('0x35')]){delete _0x4131a4['name'];}_0x20738c['status'](_0x15a19b)[_0xfe98('0x36')](_0x4131a4);};}exports[_0xfe98('0x37')]=function(_0x4002c1,_0x35502e){var _0x207a6c={},_0x535a61={},_0x3e996c={'count':0x0,'rows':[]};var _0xb371b=_[_0xfe98('0x38')](db['SmsMessage'][_0xfe98('0x39')],function(_0x30723b){return{'name':_0x30723b[_0xfe98('0x3a')],'type':_0x30723b[_0xfe98('0x3b')]['key']};});_0x535a61[_0xfe98('0x3c')]=_[_0xfe98('0x38')](_0xb371b,'name');_0x535a61[_0xfe98('0x3d')]=_[_0xfe98('0x3e')](_0x4002c1[_0xfe98('0x3d')]);_0x535a61['filters']=_['intersection'](_0x535a61['model'],_0x535a61['query']);_0x207a6c[_0xfe98('0x3f')]=_['intersection'](_0x535a61[_0xfe98('0x3c')],qs[_0xfe98('0x40')](_0x4002c1['query'][_0xfe98('0x40')]));_0x207a6c[_0xfe98('0x3f')]=_0x207a6c[_0xfe98('0x3f')][_0xfe98('0x41')]?_0x207a6c[_0xfe98('0x3f')]:_0x535a61[_0xfe98('0x3c')];if(!_0x4002c1[_0xfe98('0x3d')][_0xfe98('0x42')]('nolimit')){_0x207a6c[_0xfe98('0x2c')]=qs[_0xfe98('0x2c')](_0x4002c1['query'][_0xfe98('0x2c')]);_0x207a6c[_0xfe98('0x2a')]=qs[_0xfe98('0x2a')](_0x4002c1[_0xfe98('0x3d')]['offset']);}_0x207a6c[_0xfe98('0x43')]=qs['sort'](_0x4002c1[_0xfe98('0x3d')][_0xfe98('0x44')]);_0x207a6c[_0xfe98('0x45')]=qs[_0xfe98('0x46')](_['pick'](_0x4002c1[_0xfe98('0x3d')],_0x535a61[_0xfe98('0x46')]),_0xb371b);if(_0x4002c1[_0xfe98('0x3d')][_0xfe98('0x47')]){_0x207a6c[_0xfe98('0x45')]=_[_0xfe98('0x48')](_0x207a6c['where'],{'$or':_[_0xfe98('0x38')](_0xb371b,function(_0x1d430a){if(_0x1d430a[_0xfe98('0x3b')]!==_0xfe98('0x49')){var _0x46d5bb={};_0x46d5bb[_0x1d430a[_0xfe98('0x35')]]={'$like':'%'+_0x4002c1[_0xfe98('0x3d')]['filter']+'%'};return _0x46d5bb;}})});}_0x207a6c=_[_0xfe98('0x48')]({},_0x207a6c,_0x4002c1[_0xfe98('0x4a')]);var _0x183385={'where':_0x207a6c[_0xfe98('0x45')]};return db[_0xfe98('0x4b')]['count'](_0x183385)[_0xfe98('0x1d')](function(_0x5d9cb9){_0x3e996c[_0xfe98('0x2d')]=_0x5d9cb9;if(_0x4002c1[_0xfe98('0x3d')][_0xfe98('0x4c')]){_0x207a6c[_0xfe98('0x4d')]=[{'all':!![]}];}return db[_0xfe98('0x4b')][_0xfe98('0x4e')](_0x207a6c);})[_0xfe98('0x1d')](function(_0x754f39){_0x3e996c['rows']=_0x754f39;return _0x3e996c;})[_0xfe98('0x1d')](respondWithFilteredResult(_0x35502e,_0x207a6c))[_0xfe98('0x4f')](handleError(_0x35502e,null));};exports[_0xfe98('0x50')]=function(_0x1720d3,_0x5ad61e){var _0x26cb3d={'raw':!![],'where':{'id':_0x1720d3[_0xfe98('0x51')]['id']}},_0xc0573c={};_0xc0573c[_0xfe98('0x3c')]=_[_0xfe98('0x3e')](db[_0xfe98('0x4b')]['rawAttributes']);_0xc0573c[_0xfe98('0x3d')]=_[_0xfe98('0x3e')](_0x1720d3[_0xfe98('0x3d')]);_0xc0573c[_0xfe98('0x46')]=_[_0xfe98('0x52')](_0xc0573c['model'],_0xc0573c['query']);_0x26cb3d[_0xfe98('0x3f')]=_[_0xfe98('0x52')](_0xc0573c[_0xfe98('0x3c')],qs[_0xfe98('0x40')](_0x1720d3[_0xfe98('0x3d')][_0xfe98('0x40')]));_0x26cb3d[_0xfe98('0x3f')]=_0x26cb3d[_0xfe98('0x3f')][_0xfe98('0x41')]?_0x26cb3d[_0xfe98('0x3f')]:_0xc0573c['model'];if(_0x1720d3[_0xfe98('0x3d')]['includeAll']){_0x26cb3d[_0xfe98('0x4d')]=[{'all':!![]}];}_0x26cb3d=_[_0xfe98('0x48')]({},_0x26cb3d,_0x1720d3[_0xfe98('0x4a')]);return db['SmsMessage'][_0xfe98('0x53')](_0x26cb3d)['then'](handleEntityNotFound(_0x5ad61e,null))['then'](respondWithResult(_0x5ad61e,null))[_0xfe98('0x4f')](handleError(_0x5ad61e,null));};exports[_0xfe98('0x54')]=function(_0x2d7246,_0x3dfb51){return db[_0xfe98('0x4b')][_0xfe98('0x54')](_0x2d7246['body'],{})[_0xfe98('0x1d')](respondWithResult(_0x3dfb51,0xc9))['catch'](handleError(_0x3dfb51,null));};exports[_0xfe98('0x32')]=function(_0x4a5690,_0x54823a){if(_0x4a5690['body']['id']){delete _0x4a5690[_0xfe98('0x55')]['id'];}return db[_0xfe98('0x4b')][_0xfe98('0x53')]({'where':{'id':_0x4a5690[_0xfe98('0x51')]['id']}})['then'](handleEntityNotFound(_0x54823a,null))[_0xfe98('0x1d')](saveUpdates(_0x4a5690['body'],null))[_0xfe98('0x1d')](respondWithResult(_0x54823a,null))[_0xfe98('0x4f')](handleError(_0x54823a,null));};exports['destroy']=function(_0x7096d5,_0x6299e9){return db[_0xfe98('0x4b')][_0xfe98('0x53')]({'where':{'id':_0x7096d5['params']['id']}})[_0xfe98('0x1d')](handleEntityNotFound(_0x6299e9,null))[_0xfe98('0x1d')](removeEntity(_0x6299e9,null))[_0xfe98('0x4f')](handleError(_0x6299e9,null));};exports[_0xfe98('0x56')]=function(_0x4ab9c4,_0x4192e0){return db['SmsMessage'][_0xfe98('0x56')]()[_0xfe98('0x1d')](respondWithResult(_0x4192e0,null))[_0xfe98('0x4f')](handleError(_0x4192e0,null));};var interaction_log=require(_0xfe98('0x11'))(_0xfe98('0x57'));exports[_0xfe98('0x58')]=function(_0x4435d1,_0x247044,_0x36a92f){var _0x3b8626={'agent':{},'channel':_0xfe98('0x59')};if(_0x4435d1[_0xfe98('0x55')]['id']){delete _0x4435d1[_0xfe98('0x55')]['id'];}_0x4435d1['body'][_0xfe98('0x5a')]=!![];_0x4435d1['body']['readAt']=moment()[_0xfe98('0x5b')]('YYYY-MM-DD\x20HH:mm:ss');_0x4435d1[_0xfe98('0x55')][_0xfe98('0x5c')]=_0x4435d1[_0xfe98('0x55')][_0xfe98('0x5c')]||_0x4435d1[_0xfe98('0x5d')]['id'];_0x3b8626[_0xfe98('0x5e')]['id']=_0x4435d1[_0xfe98('0x55')][_0xfe98('0x5c')];return db[_0xfe98('0x4b')][_0xfe98('0x53')]({'where':{'id':_0x4435d1[_0xfe98('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x247044,null))[_0xfe98('0x1d')](saveUpdates(_0x4435d1[_0xfe98('0x55')],null))[_0xfe98('0x1d')](function(_0x3d86ea){if(_0x3d86ea){_0x3b8626[_0xfe98('0x25')]=_0x3d86ea['get']({'plain':!![]});return db[_0xfe98('0x5f')][_0xfe98('0x53')]({'where':{'id':_0x3d86ea[_0xfe98('0x60')]}});}return null;})[_0xfe98('0x1d')](handleEntityNotFound(_0x247044,null))[_0xfe98('0x1d')](function(_0x15f053){if(_0x15f053){return _0x15f053['update']({'UserId':_0x4435d1[_0xfe98('0x55')][_0xfe98('0x5c')],'read1stAt':_[_0xfe98('0x61')](_0x15f053[_0xfe98('0x62')])?moment()[_0xfe98('0x5b')](_0xfe98('0x63')):undefined});}return null;})[_0xfe98('0x1d')](function(_0x534f43){if(_0x534f43){_0x3b8626[_0xfe98('0x64')]=_0x534f43[_0xfe98('0x65')]({'plain':!![]});interaction_log[_0xfe98('0x26')](_0xfe98('0x66'),_0x4435d1[_0xfe98('0x5d')]['id'],_0x4435d1[_0xfe98('0x5d')][_0xfe98('0x35')],_0x4435d1[_0xfe98('0x5d')][_0xfe98('0x67')],_0x3b8626[_0xfe98('0x64')]['id'],_0x4435d1[_0xfe98('0x55')]?JSON[_0xfe98('0x22')](_0x4435d1[_0xfe98('0x55')]):_0xfe98('0x68'));return respondWithRpcPromise(_0xfe98('0x69'),_0xfe98('0x6a'),_0x3b8626);}return null;})[_0xfe98('0x1d')](function(_0x172754){var _0x259e75=_0xfe98('0x6b')+_0x172754[_0xfe98('0x25')][_0xfe98('0x6c')];return db[_0xfe98('0x6d')][_0xfe98('0x3d')](_0x259e75,{'type':db[_0xfe98('0x6e')][_0xfe98('0x6f')][_0xfe98('0x70')],'raw':!![]})['then'](function(_0x5b0125){return _0x5b0125;});})[_0xfe98('0x1d')](function(_0x1ab844){if(_0x1ab844){_0x3b8626[_0xfe98('0x25')]['contact']=_0x1ab844[0x0];if(!_0x4435d1['body'][_0xfe98('0x5c')])return;return db['User'][_0xfe98('0x53')]({'where':{'id':_0x4435d1[_0xfe98('0x55')]['UserId'],'role':_0xfe98('0x5e')},'attributes':['id',_0xfe98('0x35'),_0xfe98('0x71'),_0xfe98('0x72'),_0xfe98('0x73')],'raw':!![]});}return null;})[_0xfe98('0x1d')](function(_0x271c09){if(!_0x271c09)return null;_0x3b8626[_0xfe98('0x25')][_0xfe98('0x5e')]=_0x271c09;return _0x3b8626;})['then'](function(_0x2c9d80){if(_0x2c9d80){if(_0x4435d1['body'][_0xfe98('0x74')]){_0x3b8626[_0xfe98('0x25')][_0xfe98('0x75')]=util[_0xfe98('0x5b')](_0xfe98('0x76'),_0x4435d1[_0xfe98('0x5d')][_0xfe98('0x35')]);_0x3b8626[_0xfe98('0x25')][_0xfe98('0x77')]=_0x3b8626[_0xfe98('0x77')];_0x3b8626[_0xfe98('0x25')][_0xfe98('0x78')]=_0x3b8626[_0xfe98('0x77')];_0x3b8626['message']['event']=_0xfe98('0x58');return respondWithRpcPromise(_0xfe98('0x79'),_0xfe98('0x79'),{'event':_0xfe98('0x7a'),'message':_0x3b8626[_0xfe98('0x25')]},client9002)[_0xfe98('0x1d')](function(){return _0x3b8626;});}return _0x3b8626;}return null;})[_0xfe98('0x1d')](respondWithResult(_0x247044,null))[_0xfe98('0x4f')](handleError(_0x247044,null));};var interaction_log=require(_0xfe98('0x11'))(_0xfe98('0x57'));exports[_0xfe98('0x30')]=function(_0x25dea1,_0x162294,_0x27f70e){var _0x3ddb98={'agent':{},'channel':_0xfe98('0x59')};if(_0x25dea1['body']['id']){delete _0x25dea1[_0xfe98('0x55')]['id'];}_0x25dea1[_0xfe98('0x55')][_0xfe98('0x5c')]=_0x25dea1['body'][_0xfe98('0x5c')]||_0x25dea1[_0xfe98('0x5d')]['id'];_0x3ddb98[_0xfe98('0x5e')]['id']=_0x25dea1[_0xfe98('0x55')][_0xfe98('0x5c')];return db['SmsMessage']['find']({'where':{'id':_0x25dea1[_0xfe98('0x51')]['id'],'UserId':null}})[_0xfe98('0x1d')](handleEntityNotFound(_0x162294,null))['then'](function(_0x56d390){if(_0x56d390){_0x3ddb98['message']=_0x56d390['get']({'plain':!![]});return db[_0xfe98('0x5f')][_0xfe98('0x53')]({'where':{'id':_0x56d390[_0xfe98('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x162294,null))[_0xfe98('0x1d')](function(_0x450c06){if(_0x450c06){_0x3ddb98[_0xfe98('0x64')]=_0x450c06[_0xfe98('0x65')]({'plain':!![]});interaction_log[_0xfe98('0x26')](_0xfe98('0x7b'),_0x25dea1[_0xfe98('0x5d')]['id'],_0x25dea1['user']['name'],_0x25dea1['user'][_0xfe98('0x67')],_0x3ddb98[_0xfe98('0x64')]['id'],_0x25dea1[_0xfe98('0x55')]?JSON[_0xfe98('0x22')](_0x25dea1[_0xfe98('0x55')]):_0xfe98('0x68'));return respondWithRpcPromise(_0xfe98('0x7c'),_0xfe98('0x7d'),_0x3ddb98);}return null;})['then'](function(_0x5df11e){var _0x55322a='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5df11e[_0xfe98('0x25')][_0xfe98('0x6c')];return db[_0xfe98('0x6d')][_0xfe98('0x3d')](_0x55322a,{'type':db[_0xfe98('0x6e')][_0xfe98('0x6f')]['SELECT'],'raw':!![]})[_0xfe98('0x1d')](function(_0x2798d9){return _0x2798d9;});})['then'](function(_0x4a9028){if(_0x4a9028){_0x3ddb98[_0xfe98('0x25')][_0xfe98('0x7e')]=_0x4a9028[0x0];if(!_0x25dea1['body'][_0xfe98('0x5c')])return;return db[_0xfe98('0x7f')]['find']({'where':{'id':_0x25dea1[_0xfe98('0x55')]['UserId'],'role':_0xfe98('0x5e')},'attributes':['id',_0xfe98('0x35'),_0xfe98('0x71'),_0xfe98('0x72'),'internal'],'raw':!![]});}return null;})[_0xfe98('0x1d')](function(_0x42921a){if(!_0x42921a)return null;_0x3ddb98[_0xfe98('0x25')]['agent']=_0x42921a;return _0x3ddb98;})[_0xfe98('0x1d')](function(_0x406758){if(_0x406758){_0x406758['message'][_0xfe98('0x75')]=util[_0xfe98('0x5b')](_0xfe98('0x76'),_0x25dea1[_0xfe98('0x5d')]['name']);_0x406758[_0xfe98('0x25')][_0xfe98('0x77')]=_0x3ddb98[_0xfe98('0x77')];_0x406758[_0xfe98('0x25')]['motionChannel']=_0x3ddb98['channel'];_0x406758['message'][_0xfe98('0x80')]=_0xfe98('0x30');respondWithRpcPromise(_0xfe98('0x79'),_0xfe98('0x79'),{'event':_0xfe98('0x81'),'message':_0x406758[_0xfe98('0x25')]},client9002);return _0x3ddb98;}return null;})[_0xfe98('0x1d')](respondWithResult(_0x162294,null))[_0xfe98('0x4f')](handleError(_0x162294,null));};exports[_0xfe98('0x28')]=function(_0x1f21f7,_0xd367d9,_0x5cf971){if(_0x1f21f7[_0xfe98('0x55')]['id']){delete _0x1f21f7['body']['id'];}var _0xf1118;return db[_0xfe98('0x4b')][_0xfe98('0x53')]({'where':{'id':_0x1f21f7[_0xfe98('0x51')]['id']}})['then'](handleEntityNotFound(_0xd367d9,null))['then'](function(_0x1598db){if(_0x1598db){_0xf1118=_0x1598db;return db['SmsAccount'][_0xfe98('0x53')]({'where':{'id':_0x1598db[_0xfe98('0x82')]}});}})[_0xfe98('0x1d')](handleEntityNotFound(_0xd367d9,null))[_0xfe98('0x1d')](function(_0x362854){if(_0x362854){logger[_0xfe98('0x20')](_0xfe98('0x21'),_0xfe98('0x28'),_0xfe98('0x83'),_0x362854[_0xfe98('0x3b')],util[_0xfe98('0x84')](_0x1f21f7['body'],{'showHidden':![],'depth':null}));switch(_0x362854[_0xfe98('0x3b')]){case'twilio':if(_0x1f21f7[_0xfe98('0x55')]['MessageSid']&&_0x1f21f7[_0xfe98('0x55')][_0xfe98('0x85')]===_0xf1118[_0xfe98('0x86')]){return _0xf1118[_0xfe98('0x32')]({'read':!![]});}else{logger[_0xfe98('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfe98('0x28'),_0xfe98('0x87'),util['inspect'](_0x1f21f7[_0xfe98('0x55')],{'showHidden':![],'depth':null}));}break;case _0xfe98('0x88'):if(_0x1f21f7[_0xfe98('0x55')][_0xfe98('0x89')]&&_0x1f21f7[_0xfe98('0x55')][_0xfe98('0x89')]===_0xf1118[_0xfe98('0x86')]&&_[_0xfe98('0x8a')](['sent','delivered'],_0x1f21f7[_0xfe98('0x55')]['Status'])>=0x0){return _0xf1118[_0xfe98('0x32')]({'read':!![]});}else{logger[_0xfe98('0x23')](_0xfe98('0x8b'),_0xfe98('0x28'),'plivio',util['inspect'](_0x1f21f7[_0xfe98('0x55')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x4b0c1e=_0x1f21f7[_0xfe98('0x55')]['results'][0x0];if(_0x4b0c1e[_0xfe98('0x28')][_0xfe98('0x8c')]===_0xfe98('0x8d')){return _0xf1118[_0xfe98('0x32')]({'read':!![]});}else{logger[_0xfe98('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xfe98('0x28'),_0xfe98('0x8e'),util[_0xfe98('0x84')](_0x1f21f7[_0xfe98('0x55')],{'showHidden':![],'depth':null}));}break;}return _0xf1118;}})[_0xfe98('0x1d')](respondWithResult(_0xd367d9,null))[_0xfe98('0x4f')](handleError(_0xd367d9,null));}; \ No newline at end of file +var _0x0733=['destroy','describe','accept','sms','read','format','UserId','user','agent','SmsInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','sms-interactions','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','rejectmessage','SmsAccount','received\x20delivery\x20report\x20from','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','indexOf','sent','infobip','results','groupName','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','jayson/promise','client','http','request','then','info','SmsMessage,\x20%s,\x20%s','debug','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','update','stack','name','send','SmsMessage','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','order','filters','filter','merge','where','VIRTUAL','options','include','findAll','rows','params','rawAttributes','create','body','find'];(function(_0x4ae7f3,_0x57f4a7){var _0x1aeed6=function(_0x1435a1){while(--_0x1435a1){_0x4ae7f3['push'](_0x4ae7f3['shift']());}};_0x1aeed6(++_0x57f4a7);}(_0x0733,0xc4));var _0x3073=function(_0x3b9185,_0x1c3a33){_0x3b9185=_0x3b9185-0x0;var _0x448659=_0x0733[_0x3b9185];return _0x448659;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3073('0x0'));var jsonpatch=require(_0x3073('0x1'));var rp=require(_0x3073('0x2'));var moment=require('moment');var BPromise=require(_0x3073('0x3'));var Mustache=require(_0x3073('0x4'));var util=require('util');var path=require(_0x3073('0x5'));var sox=require(_0x3073('0x6'));var csv=require(_0x3073('0x7'));var ejs=require(_0x3073('0x8'));var fs=require('fs');var fs_extra=require(_0x3073('0x9'));var _=require(_0x3073('0xa'));var squel=require(_0x3073('0xb'));var crypto=require(_0x3073('0xc'));var jsforce=require(_0x3073('0xd'));var deskjs=require(_0x3073('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3073('0xf'));var Redis=require(_0x3073('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3073('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x3073('0x12'))(_0x3073('0x13'));var utils=require(_0x3073('0x14'));var config=require(_0x3073('0x15'));var licenseUtil=require(_0x3073('0x16'));var db=require(_0x3073('0x17'))['db'];config['redis']=_[_0x3073('0x18')](config[_0x3073('0x19')],{'host':_0x3073('0x1a'),'port':0x18eb});var socket=require(_0x3073('0x1b'))(new Redis(config[_0x3073('0x19')]));require(_0x3073('0x1c'))['register'](socket);var jayson=require(_0x3073('0x1d'));var client=jayson[_0x3073('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x3073('0x1e')][_0x3073('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x5efc8d,_0x169772,_0x11fdf5,_0x15d485){return new BPromise(function(_0x5092bb,_0xf0c54){var _0x3b2714=_0x15d485||client;return _0x3b2714[_0x3073('0x20')](_0x5efc8d,_0x11fdf5)[_0x3073('0x21')](function(_0x53d147){logger[_0x3073('0x22')](_0x3073('0x23'),_0x169772,'request\x20sent');logger[_0x3073('0x24')](_0x3073('0x25'),_0x169772,_0x3073('0x26'),JSON['stringify'](_0x53d147));if(_0x53d147[_0x3073('0x27')]){if(_0x53d147['error']['code']===0x1f4){logger['error']('SmsMessage,\x20%s,\x20%s',_0x169772,_0x53d147[_0x3073('0x27')][_0x3073('0x28')]);return _0xf0c54(_0x53d147['error'][_0x3073('0x28')]);}logger[_0x3073('0x27')](_0x3073('0x23'),_0x169772,_0x53d147[_0x3073('0x27')][_0x3073('0x28')]);return _0x5092bb(_0x53d147[_0x3073('0x27')][_0x3073('0x28')]);}else{logger[_0x3073('0x22')](_0x3073('0x23'),_0x169772,_0x3073('0x26'));_0x5092bb(_0x53d147['result'][_0x3073('0x28')]);}})[_0x3073('0x29')](function(_0x5cb529){logger[_0x3073('0x27')](_0x3073('0x23'),_0x169772,_0x5cb529);_0xf0c54(_0x5cb529);});});}function respondWithStatusCode(_0x11a1d8,_0x1e3b1d){_0x1e3b1d=_0x1e3b1d||0xcc;return function(_0x2cebe3){if(_0x2cebe3){return _0x11a1d8[_0x3073('0x2a')](_0x1e3b1d);}return _0x11a1d8[_0x3073('0x2b')](_0x1e3b1d)[_0x3073('0x2c')]();};}function respondWithResult(_0x4f6cf8,_0x7a8bbf){_0x7a8bbf=_0x7a8bbf||0xc8;return function(_0x25dd5c){if(_0x25dd5c){return _0x4f6cf8[_0x3073('0x2b')](_0x7a8bbf)[_0x3073('0x2d')](_0x25dd5c);}};}function respondWithFilteredResult(_0x1fdbcd,_0x484c47){return function(_0x22cc0f){if(_0x22cc0f){var _0x1bc498=typeof _0x484c47['offset']===_0x3073('0x2e')&&typeof _0x484c47['limit']===_0x3073('0x2e');var _0xe91ff4=_0x22cc0f[_0x3073('0x2f')];var _0x53b76e=_0x1bc498?0x0:_0x484c47[_0x3073('0x30')];var _0xe1604=_0x1bc498?_0x22cc0f[_0x3073('0x2f')]:_0x484c47[_0x3073('0x30')]+_0x484c47[_0x3073('0x31')];var _0x31cfd6;if(_0xe1604>=_0xe91ff4){_0xe1604=_0xe91ff4;_0x31cfd6=0xc8;}else{_0x31cfd6=0xce;}_0x1fdbcd[_0x3073('0x2b')](_0x31cfd6);return _0x1fdbcd['set'](_0x3073('0x32'),_0x53b76e+'-'+_0xe1604+'/'+_0xe91ff4)[_0x3073('0x2d')](_0x22cc0f);}return null;};}function patchUpdates(_0x3c2059){return function(_0x215994){try{jsonpatch['apply'](_0x215994,_0x3c2059,!![]);}catch(_0x19bfc4){return BPromise['reject'](_0x19bfc4);}return _0x215994['save']();};}function saveUpdates(_0x6114b3,_0x57315d){return function(_0x26ea33){if(_0x26ea33){return _0x26ea33[_0x3073('0x33')](_0x6114b3)[_0x3073('0x21')](function(_0x2ea12e){return _0x2ea12e;});}return null;};}function removeEntity(_0x4fed16,_0x380e0e){return function(_0x9556d4){if(_0x9556d4){return _0x9556d4['destroy']()['then'](function(){_0x4fed16[_0x3073('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1553b2,_0x4498c7){return function(_0x19b937){if(!_0x19b937){_0x1553b2[_0x3073('0x2a')](0x194);}return _0x19b937;};}function handleError(_0x398f26,_0x5eaf42){_0x5eaf42=_0x5eaf42||0x1f4;return function(_0x2c6558){logger[_0x3073('0x27')](_0x2c6558[_0x3073('0x34')]);if(_0x2c6558[_0x3073('0x35')]){delete _0x2c6558[_0x3073('0x35')];}_0x398f26[_0x3073('0x2b')](_0x5eaf42)[_0x3073('0x36')](_0x2c6558);};}exports['index']=function(_0xb22b7e,_0xcc7d92){var _0x1bf71e={},_0x1b8e5b={},_0x499c05={'count':0x0,'rows':[]};var _0x52308c=_['map'](db[_0x3073('0x37')]['rawAttributes'],function(_0x569153){return{'name':_0x569153[_0x3073('0x38')],'type':_0x569153[_0x3073('0x39')][_0x3073('0x3a')]};});_0x1b8e5b['model']=_[_0x3073('0x3b')](_0x52308c,_0x3073('0x35'));_0x1b8e5b[_0x3073('0x3c')]=_[_0x3073('0x3d')](_0xb22b7e['query']);_0x1b8e5b['filters']=_[_0x3073('0x3e')](_0x1b8e5b[_0x3073('0x3f')],_0x1b8e5b[_0x3073('0x3c')]);_0x1bf71e[_0x3073('0x40')]=_['intersection'](_0x1b8e5b[_0x3073('0x3f')],qs['fields'](_0xb22b7e[_0x3073('0x3c')][_0x3073('0x41')]));_0x1bf71e[_0x3073('0x40')]=_0x1bf71e[_0x3073('0x40')][_0x3073('0x42')]?_0x1bf71e['attributes']:_0x1b8e5b['model'];if(!_0xb22b7e[_0x3073('0x3c')]['hasOwnProperty']('nolimit')){_0x1bf71e['limit']=qs[_0x3073('0x31')](_0xb22b7e[_0x3073('0x3c')]['limit']);_0x1bf71e[_0x3073('0x30')]=qs[_0x3073('0x30')](_0xb22b7e[_0x3073('0x3c')][_0x3073('0x30')]);}_0x1bf71e[_0x3073('0x43')]=qs['sort'](_0xb22b7e[_0x3073('0x3c')]['sort']);_0x1bf71e['where']=qs[_0x3073('0x44')](_['pick'](_0xb22b7e['query'],_0x1b8e5b[_0x3073('0x44')]),_0x52308c);if(_0xb22b7e['query'][_0x3073('0x45')]){_0x1bf71e['where']=_[_0x3073('0x46')](_0x1bf71e[_0x3073('0x47')],{'$or':_[_0x3073('0x3b')](_0x52308c,function(_0x47e3fb){if(_0x47e3fb[_0x3073('0x39')]!==_0x3073('0x48')){var _0x17ad0d={};_0x17ad0d[_0x47e3fb[_0x3073('0x35')]]={'$like':'%'+_0xb22b7e[_0x3073('0x3c')][_0x3073('0x45')]+'%'};return _0x17ad0d;}})});}_0x1bf71e=_[_0x3073('0x46')]({},_0x1bf71e,_0xb22b7e[_0x3073('0x49')]);var _0x293fec={'where':_0x1bf71e[_0x3073('0x47')]};return db[_0x3073('0x37')][_0x3073('0x2f')](_0x293fec)[_0x3073('0x21')](function(_0x122b0a){_0x499c05[_0x3073('0x2f')]=_0x122b0a;if(_0xb22b7e[_0x3073('0x3c')]['includeAll']){_0x1bf71e[_0x3073('0x4a')]=[{'all':!![]}];}return db[_0x3073('0x37')][_0x3073('0x4b')](_0x1bf71e);})[_0x3073('0x21')](function(_0x40ae29){_0x499c05[_0x3073('0x4c')]=_0x40ae29;return _0x499c05;})['then'](respondWithFilteredResult(_0xcc7d92,_0x1bf71e))['catch'](handleError(_0xcc7d92,null));};exports['show']=function(_0x4ce38d,_0x53b44e){var _0x5690fd={'raw':!![],'where':{'id':_0x4ce38d[_0x3073('0x4d')]['id']}},_0x2de6df={};_0x2de6df['model']=_[_0x3073('0x3d')](db[_0x3073('0x37')][_0x3073('0x4e')]);_0x2de6df[_0x3073('0x3c')]=_[_0x3073('0x3d')](_0x4ce38d[_0x3073('0x3c')]);_0x2de6df[_0x3073('0x44')]=_['intersection'](_0x2de6df['model'],_0x2de6df[_0x3073('0x3c')]);_0x5690fd['attributes']=_[_0x3073('0x3e')](_0x2de6df['model'],qs[_0x3073('0x41')](_0x4ce38d[_0x3073('0x3c')][_0x3073('0x41')]));_0x5690fd[_0x3073('0x40')]=_0x5690fd[_0x3073('0x40')]['length']?_0x5690fd[_0x3073('0x40')]:_0x2de6df[_0x3073('0x3f')];if(_0x4ce38d[_0x3073('0x3c')]['includeAll']){_0x5690fd['include']=[{'all':!![]}];}_0x5690fd=_[_0x3073('0x46')]({},_0x5690fd,_0x4ce38d[_0x3073('0x49')]);return db[_0x3073('0x37')]['find'](_0x5690fd)[_0x3073('0x21')](handleEntityNotFound(_0x53b44e,null))[_0x3073('0x21')](respondWithResult(_0x53b44e,null))[_0x3073('0x29')](handleError(_0x53b44e,null));};exports[_0x3073('0x4f')]=function(_0x2fbcc2,_0x3078c9){return db[_0x3073('0x37')][_0x3073('0x4f')](_0x2fbcc2['body'],{})[_0x3073('0x21')](respondWithResult(_0x3078c9,0xc9))[_0x3073('0x29')](handleError(_0x3078c9,null));};exports['update']=function(_0x3294ac,_0x2571cf){if(_0x3294ac[_0x3073('0x50')]['id']){delete _0x3294ac[_0x3073('0x50')]['id'];}return db[_0x3073('0x37')][_0x3073('0x51')]({'where':{'id':_0x3294ac[_0x3073('0x4d')]['id']}})[_0x3073('0x21')](handleEntityNotFound(_0x2571cf,null))[_0x3073('0x21')](saveUpdates(_0x3294ac[_0x3073('0x50')],null))[_0x3073('0x21')](respondWithResult(_0x2571cf,null))[_0x3073('0x29')](handleError(_0x2571cf,null));};exports[_0x3073('0x52')]=function(_0x258ce2,_0x5f01e6){return db[_0x3073('0x37')]['find']({'where':{'id':_0x258ce2[_0x3073('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5f01e6,null))[_0x3073('0x21')](removeEntity(_0x5f01e6,null))[_0x3073('0x29')](handleError(_0x5f01e6,null));};exports[_0x3073('0x53')]=function(_0x302c31,_0x2bbf7b){return db[_0x3073('0x37')][_0x3073('0x53')]()[_0x3073('0x21')](respondWithResult(_0x2bbf7b,null))[_0x3073('0x29')](handleError(_0x2bbf7b,null));};var interaction_log=require(_0x3073('0x12'))('sms-interactions');exports[_0x3073('0x54')]=function(_0x3feabf,_0x49b82c,_0x5e1e53){var _0xac8467={'agent':{},'channel':_0x3073('0x55')};if(_0x3feabf[_0x3073('0x50')]['id']){delete _0x3feabf[_0x3073('0x50')]['id'];}_0x3feabf[_0x3073('0x50')][_0x3073('0x56')]=!![];_0x3feabf['body']['readAt']=moment()[_0x3073('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x3feabf[_0x3073('0x50')][_0x3073('0x58')]=_0x3feabf[_0x3073('0x50')][_0x3073('0x58')]||_0x3feabf[_0x3073('0x59')]['id'];_0xac8467[_0x3073('0x5a')]['id']=_0x3feabf[_0x3073('0x50')][_0x3073('0x58')];return db[_0x3073('0x37')]['find']({'where':{'id':_0x3feabf[_0x3073('0x4d')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x49b82c,null))['then'](saveUpdates(_0x3feabf[_0x3073('0x50')],null))[_0x3073('0x21')](function(_0x47bf90){if(_0x47bf90){_0xac8467['message']=_0x47bf90['get']({'plain':!![]});return db[_0x3073('0x5b')]['find']({'where':{'id':_0x47bf90['SmsInteractionId']}});}return null;})[_0x3073('0x21')](handleEntityNotFound(_0x49b82c,null))[_0x3073('0x21')](function(_0x1f6c71){if(_0x1f6c71){return _0x1f6c71['update']({'UserId':_0x3feabf[_0x3073('0x50')][_0x3073('0x58')],'read1stAt':_[_0x3073('0x5c')](_0x1f6c71['read1stAt'])?moment()[_0x3073('0x57')](_0x3073('0x5d')):undefined});}return null;})[_0x3073('0x21')](function(_0x333170){if(_0x333170){_0xac8467[_0x3073('0x5e')]=_0x333170[_0x3073('0x5f')]({'plain':!![]});interaction_log[_0x3073('0x22')](_0x3073('0x60'),_0x3feabf[_0x3073('0x59')]['id'],_0x3feabf['user'][_0x3073('0x35')],_0x3feabf['user'][_0x3073('0x61')],_0xac8467[_0x3073('0x5e')]['id'],_0x3feabf['body']?JSON[_0x3073('0x62')](_0x3feabf[_0x3073('0x50')]):'null');return respondWithRpcPromise(_0x3073('0x63'),'acceptMessage',_0xac8467);}return null;})[_0x3073('0x21')](function(_0x19750d){var _0x1c38ea='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x19750d[_0x3073('0x28')][_0x3073('0x64')];return db[_0x3073('0x65')][_0x3073('0x3c')](_0x1c38ea,{'type':db[_0x3073('0x66')][_0x3073('0x67')][_0x3073('0x68')],'raw':!![]})[_0x3073('0x21')](function(_0x2c41d1){return _0x2c41d1;});})[_0x3073('0x21')](function(_0x355473){if(_0x355473){_0xac8467['message']['contact']=_0x355473[0x0];if(!_0x3feabf[_0x3073('0x50')][_0x3073('0x58')])return;return db[_0x3073('0x69')]['find']({'where':{'id':_0x3feabf[_0x3073('0x50')][_0x3073('0x58')],'role':'agent'},'attributes':['id',_0x3073('0x35'),'fullname',_0x3073('0x6a'),_0x3073('0x6b')],'raw':!![]});}return null;})[_0x3073('0x21')](function(_0x442132){if(!_0x442132)return null;_0xac8467[_0x3073('0x28')][_0x3073('0x5a')]=_0x442132;return _0xac8467;})[_0x3073('0x21')](function(_0xde06fa){if(_0xde06fa){if(_0x3feabf[_0x3073('0x50')][_0x3073('0x6c')]){_0xac8467[_0x3073('0x28')][_0x3073('0x6d')]=util['format'](_0x3073('0x6e'),_0x3feabf['user'][_0x3073('0x35')]);_0xac8467[_0x3073('0x28')]['channel']=_0xac8467[_0x3073('0x6f')];_0xac8467['message'][_0x3073('0x70')]=_0xac8467[_0x3073('0x6f')];_0xac8467[_0x3073('0x28')][_0x3073('0x71')]=_0x3073('0x54');return respondWithRpcPromise(_0x3073('0x72'),_0x3073('0x72'),{'event':_0x3073('0x73'),'message':_0xac8467['message']},client9002)[_0x3073('0x21')](function(){return _0xac8467;});}return _0xac8467;}return null;})[_0x3073('0x21')](respondWithResult(_0x49b82c,null))[_0x3073('0x29')](handleError(_0x49b82c,null));};var interaction_log=require('../../config/logger')(_0x3073('0x74'));exports[_0x3073('0x75')]=function(_0x51fa4d,_0x158b4c,_0x75ecd0){var _0x4189d7={'agent':{},'channel':_0x3073('0x55')};if(_0x51fa4d[_0x3073('0x50')]['id']){delete _0x51fa4d[_0x3073('0x50')]['id'];}_0x51fa4d['body'][_0x3073('0x58')]=_0x51fa4d[_0x3073('0x50')][_0x3073('0x58')]||_0x51fa4d[_0x3073('0x59')]['id'];_0x4189d7[_0x3073('0x5a')]['id']=_0x51fa4d[_0x3073('0x50')][_0x3073('0x58')];return db[_0x3073('0x37')][_0x3073('0x51')]({'where':{'id':_0x51fa4d['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x158b4c,null))[_0x3073('0x21')](function(_0x16a736){if(_0x16a736){_0x4189d7[_0x3073('0x28')]=_0x16a736[_0x3073('0x5f')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x16a736['SmsInteractionId']}});}return null;})[_0x3073('0x21')](handleEntityNotFound(_0x158b4c,null))['then'](function(_0x36cac2){if(_0x36cac2){_0x4189d7[_0x3073('0x5e')]=_0x36cac2[_0x3073('0x5f')]({'plain':!![]});interaction_log[_0x3073('0x22')](_0x3073('0x76'),_0x51fa4d[_0x3073('0x59')]['id'],_0x51fa4d[_0x3073('0x59')][_0x3073('0x35')],_0x51fa4d[_0x3073('0x59')][_0x3073('0x61')],_0x4189d7[_0x3073('0x5e')]['id'],_0x51fa4d[_0x3073('0x50')]?JSON[_0x3073('0x62')](_0x51fa4d[_0x3073('0x50')]):_0x3073('0x77'));return respondWithRpcPromise(_0x3073('0x78'),_0x3073('0x79'),_0x4189d7);}return null;})[_0x3073('0x21')](function(_0x2421a5){var _0x20e3b3=_0x3073('0x7a')+_0x2421a5['message'][_0x3073('0x64')];return db[_0x3073('0x65')][_0x3073('0x3c')](_0x20e3b3,{'type':db['Sequelize'][_0x3073('0x67')]['SELECT'],'raw':!![]})['then'](function(_0x436909){return _0x436909;});})[_0x3073('0x21')](function(_0x44f057){if(_0x44f057){_0x4189d7[_0x3073('0x28')][_0x3073('0x7b')]=_0x44f057[0x0];if(!_0x51fa4d['body'][_0x3073('0x58')])return;return db[_0x3073('0x69')][_0x3073('0x51')]({'where':{'id':_0x51fa4d[_0x3073('0x50')][_0x3073('0x58')],'role':'agent'},'attributes':['id',_0x3073('0x35'),'fullname',_0x3073('0x6a'),_0x3073('0x6b')],'raw':!![]});}return null;})[_0x3073('0x21')](function(_0x3a82c7){if(!_0x3a82c7)return null;_0x4189d7[_0x3073('0x28')]['agent']=_0x3a82c7;return _0x4189d7;})[_0x3073('0x21')](function(_0x336d5f){if(_0x336d5f){_0x336d5f[_0x3073('0x28')]['interface']=util['format']('SIP/%s',_0x51fa4d[_0x3073('0x59')]['name']);_0x336d5f['message'][_0x3073('0x6f')]=_0x4189d7[_0x3073('0x6f')];_0x336d5f[_0x3073('0x28')][_0x3073('0x70')]=_0x4189d7['channel'];_0x336d5f[_0x3073('0x28')][_0x3073('0x71')]=_0x3073('0x75');respondWithRpcPromise(_0x3073('0x72'),_0x3073('0x72'),{'event':_0x3073('0x7c'),'message':_0x336d5f[_0x3073('0x28')]},client9002);return _0x4189d7;}return null;})[_0x3073('0x21')](respondWithResult(_0x158b4c,null))['catch'](handleError(_0x158b4c,null));};exports[_0x3073('0x2b')]=function(_0x1b5578,_0x3b7273,_0x2eeae7){if(_0x1b5578[_0x3073('0x50')]['id']){delete _0x1b5578['body']['id'];}var _0x58a97a;return db[_0x3073('0x37')]['find']({'where':{'id':_0x1b5578[_0x3073('0x4d')]['id']}})[_0x3073('0x21')](handleEntityNotFound(_0x3b7273,null))[_0x3073('0x21')](function(_0x55747c){if(_0x55747c){_0x58a97a=_0x55747c;return db[_0x3073('0x7d')][_0x3073('0x51')]({'where':{'id':_0x55747c['SmsAccountId']}});}})[_0x3073('0x21')](handleEntityNotFound(_0x3b7273,null))[_0x3073('0x21')](function(_0x382d29){if(_0x382d29){logger['debug'](_0x3073('0x25'),_0x3073('0x2b'),_0x3073('0x7e'),_0x382d29[_0x3073('0x39')],util['inspect'](_0x1b5578[_0x3073('0x50')],{'showHidden':![],'depth':null}));switch(_0x382d29[_0x3073('0x39')]){case _0x3073('0x7f'):if(_0x1b5578[_0x3073('0x50')]['MessageSid']&&_0x1b5578[_0x3073('0x50')][_0x3073('0x80')]===_0x58a97a[_0x3073('0x81')]){return _0x58a97a[_0x3073('0x33')]({'read':!![]});}else{logger[_0x3073('0x27')](_0x3073('0x82'),_0x3073('0x2b'),_0x3073('0x7f'),util[_0x3073('0x83')](_0x1b5578[_0x3073('0x50')],{'showHidden':![],'depth':null}));}break;case _0x3073('0x84'):if(_0x1b5578['body'][_0x3073('0x85')]&&_0x1b5578[_0x3073('0x50')][_0x3073('0x85')]===_0x58a97a[_0x3073('0x81')]&&_[_0x3073('0x86')]([_0x3073('0x87'),'delivered'],_0x1b5578[_0x3073('0x50')]['Status'])>=0x0){return _0x58a97a['update']({'read':!![]});}else{logger['error'](_0x3073('0x82'),_0x3073('0x2b'),'plivio',util[_0x3073('0x83')](_0x1b5578[_0x3073('0x50')],{'showHidden':![],'depth':null}));}break;case _0x3073('0x88'):var _0x5c5c98=_0x1b5578['body'][_0x3073('0x89')][0x0];if(_0x5c5c98[_0x3073('0x2b')][_0x3073('0x8a')]==='DELIVERED'){return _0x58a97a['update']({'read':!![]});}else{logger[_0x3073('0x27')](_0x3073('0x82'),'status','infobip',util['inspect'](_0x1b5578[_0x3073('0x50')],{'showHidden':![],'depth':null}));}break;}return _0x58a97a;}})['then'](respondWithResult(_0x3b7273,null))['catch'](handleError(_0x3b7273,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 30da7e4..0a3cc16 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 _0x5af1=['hasOwnProperty','hook','exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','update','emit'];(function(_0x3b720b,_0x5ec82e){var _0x1ce3fe=function(_0x167a43){while(--_0x167a43){_0x3b720b['push'](_0x3b720b['shift']());}};_0x1ce3fe(++_0x5ec82e);}(_0x5af1,0xfd));var _0x15af=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0x5af1[_0x4e93a9];return _0x43013c;};'use strict';var EventEmitter=require(_0x15af('0x0'));var SmsMessage=require(_0x15af('0x1'))['db'][_0x15af('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x15af('0x3')](0x0);var events={'afterCreate':_0x15af('0x4'),'afterUpdate':_0x15af('0x5'),'afterDestroy':'remove'};function emitEvent(_0x304117){return function(_0x40afd9,_0x5c1f3b,_0x47ac6e){SmsMessageEvents[_0x15af('0x6')](_0x304117+':'+_0x40afd9['id'],_0x40afd9);SmsMessageEvents['emit'](_0x304117,_0x40afd9);_0x47ac6e(null);};}for(var e in events){if(events[_0x15af('0x7')](e)){var event=events[e];SmsMessage[_0x15af('0x8')](e,emitEvent(event));}}module[_0x15af('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0x7581=['SmsMessage','save','update','emit','hook','events','../../mysqldb'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x7581,0xf3));var _0x1758=function(_0x1b5783,_0x2b572d){_0x1b5783=_0x1b5783-0x0;var _0x5182d8=_0x7581[_0x1b5783];return _0x5182d8;};'use strict';var EventEmitter=require(_0x1758('0x0'));var SmsMessage=require(_0x1758('0x1'))['db'][_0x1758('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1758('0x3'),'afterUpdate':_0x1758('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2beb91){return function(_0x3273e6,_0x5a7e46,_0x12e989){SmsMessageEvents[_0x1758('0x5')](_0x2beb91+':'+_0x3273e6['id'],_0x3273e6);SmsMessageEvents[_0x1758('0x5')](_0x2beb91,_0x3273e6);_0x12e989(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x1758('0x6')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 4e1d4ad..aa516df 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 _0x9528=['body','remote','/api/sms/messages/','/status?token=','token','sid','update','error','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','skebby','username','smsMethod','sender','login?username=','&password=','password','GET','split','POST','user_key','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','requestid','deliveryReport','clicksend','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','toString','base64','http_code','data','head','message_id','clickSend','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','plivo','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','infobip','Missing\x20parameters:\x20base_url','csc','crypto','login','text','keys','sort','length','apiKey','md5','digest','hex','signature=','/external/get/send.php?','id_sms','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','accountId','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','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','define','messageId','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','SmsInteraction','findOne','then','createdAt','catch','find','SmsAccountId','type','twilio','authToken','phone','accountSid','messages','create'];(function(_0x38f82a,_0x7d8152){var _0x339806=function(_0x4ae87d){while(--_0x4ae87d){_0x38f82a['push'](_0x38f82a['shift']());}};_0x339806(++_0x7d8152);}(_0x9528,0x1bc));var _0x8952=function(_0x5e42a3,_0x5b36a9){_0x5e42a3=_0x5e42a3-0x0;var _0x17d0a6=_0x9528[_0x5e42a3];return _0x17d0a6;};'use strict';var _=require(_0x8952('0x0'));var util=require(_0x8952('0x1'));var logger=require(_0x8952('0x2'))(_0x8952('0x3'));var moment=require(_0x8952('0x4'));var BPromise=require(_0x8952('0x5'));var rp=require(_0x8952('0x6'));var fs=require('fs');var path=require(_0x8952('0x7'));var rimraf=require(_0x8952('0x8'));var config=require(_0x8952('0x9'));var attributes=require(_0x8952('0xa'));module[_0x8952('0xb')]=function(_0x24eebd,_0x142f2f){return _0x24eebd[_0x8952('0xc')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x8952('0xd')]},{'name':'fti_sms_messages','fields':['body'],'type':_0x8952('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f3db6,_0xacbf1d,_0x37ff42){var _0x3c6e10=_0x24eebd[_0x8952('0xf')];var _0xd22858=_0x2f3db6[_0x8952('0x10')]({'plain':!![]});if(_0xd22858[_0x8952('0x11')][_0x8952('0x12')]()==='in'||_0xd22858[_0x8952('0x11')][_0x8952('0x12')]()===_0x8952('0x13')&&!_0xd22858[_0x8952('0x14')]&&!_[_0x8952('0x15')](_0xd22858['UserId'])&&!_[_0x8952('0x15')](_0xd22858['SmsInteractionId'])){_0x3c6e10[_0x8952('0x16')][_0x8952('0x17')]({'where':{'id':_0xd22858['SmsInteractionId']}})[_0x8952('0x18')](function(_0x466474){if(_0x466474){_0x466474['update']({'lastMsgAt':_0xd22858[_0x8952('0x19')],'lastMsgDirection':_0xd22858[_0x8952('0x11')][_0x8952('0x12')]()});}})[_0x8952('0x1a')](function(_0x526a3d){console['error'](_0x526a3d);});}if(_0xd22858[_0x8952('0x11')]===_0x8952('0x13')&&!_0xd22858['secret']){var _0x35aeed;_0x3c6e10['SmsAccount'][_0x8952('0x1b')]({'where':{'id':_0xd22858[_0x8952('0x1c')]},'raw':!![]})[_0x8952('0x18')](function(_0x5ad27b){_0x35aeed=_0x5ad27b;if(_0x35aeed&&_0x35aeed[_0x8952('0x1d')]){switch(_0x35aeed[_0x8952('0x1d')]){case _0x8952('0x1e'):var _0x4fb74a=require(_0x8952('0x1e'));if(_0x35aeed['accountSid']&&_0x35aeed[_0x8952('0x1f')]&&_0x35aeed[_0x8952('0x20')]){var _0x32fee5=new _0x4fb74a(_0x35aeed[_0x8952('0x21')],_0x35aeed[_0x8952('0x1f')]);_0x32fee5[_0x8952('0x22')][_0x8952('0x23')]({'body':_0xd22858[_0x8952('0x24')],'to':_0xd22858[_0x8952('0x20')],'from':_0x35aeed['phone'],'statusCallback':_0x35aeed[_0x8952('0x25')]+_0x8952('0x26')+_0xd22858['id']+_0x8952('0x27')+_0x35aeed[_0x8952('0x28')]})['then'](function(_0x5b76bc){if(_0x5b76bc[_0x8952('0x29')]){return _0x2f3db6[_0x8952('0x2a')]({'messageId':_0x5b76bc['sid']});}})['catch'](function(_0x10fbac){logger[_0x8952('0x2b')](_0x8952('0x2c'),'afterCreate',_0x8952('0x1e'),util[_0x8952('0x2d')](_0x10fbac,{'showHidden':![],'depth':null}));});}else{logger[_0x8952('0x2b')](_0x8952('0x2c'),_0x8952('0x2e'),_0x8952('0x1e'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0x8952('0x2f'):var _0x2972e6='https://api.skebby.it/API/v1.0/REST/';if(_0x35aeed[_0x8952('0x30')]&&_0x35aeed['password']){var _0x1657dd={'recipient':[_0xd22858[_0x8952('0x20')]],'message':_0xd22858[_0x8952('0x24')],'message_type':_0x35aeed[_0x8952('0x31')]};if(_0x35aeed[_0x8952('0x31')]&&_0x35aeed[_0x8952('0x31')]!=='SI'){_0x1657dd[_0x8952('0x32')]=_0x35aeed[_0x8952('0x20')];}var _0x3ba6d5={'url':_0x2972e6+_0x8952('0x33')+_0x35aeed[_0x8952('0x30')]+_0x8952('0x34')+_0x35aeed[_0x8952('0x35')],'method':_0x8952('0x36')};rp(_0x3ba6d5)['then'](function(_0x129f76){var _0x2a41e6=_0x129f76[_0x8952('0x37')](';');var _0x40ef55={'user_key':_0x2a41e6[0x0],'session_key':_0x2a41e6[0x1]};_0x3ba6d5={'url':_0x2972e6+'sms','method':_0x8952('0x38'),'headers':{'user_key':_0x40ef55[_0x8952('0x39')],'Session_key':_0x40ef55['session_key']},'json':!![],'body':_0x1657dd};return rp(_0x3ba6d5);})[_0x8952('0x18')](function(_0x25f05c){if(_0x25f05c['total_sent']>=0x1){var _0x45b430={'messageId':_0x25f05c[_0x8952('0x3a')]};if(_0x35aeed[_0x8952('0x31')]!=='GP'||!_0x35aeed['deliveryReport']){_0x45b430[_0x8952('0x3b')]=!![];}return _0x2f3db6[_0x8952('0x2a')](_0x45b430);}else{return logger[_0x8952('0x2b')](_0x8952('0x2c'),_0x8952('0x2e'),_0x8952('0x2f'),util[_0x8952('0x2d')](_0x25f05c,{'showHidden':![],'depth':null}));}})[_0x8952('0x1a')](function(_0x4dd23a){return logger[_0x8952('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8952('0x2e'),_0x8952('0x2f'),util[_0x8952('0x2d')](_0x4dd23a,{'showHidden':![],'depth':null}));});}else{logger[_0x8952('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8952('0x2e'),'skebby',_0x8952('0x3c'));}break;case _0x8952('0x3d'):if(_0x35aeed[_0x8952('0x1f')]){var _0x314602={'recipient':_0xd22858[_0x8952('0x20')],'message':_0xd22858['body'],'sender':_0x35aeed[_0x8952('0x3e')]||_0x35aeed[_0x8952('0x20')],'authorization':_0x35aeed['authToken']};var _0xacbf1d={'method':_0x8952('0x38'),'uri':'https://smsapi.connectel.se/api/v2/send/','body':_0x314602,'json':!![]};rp(_0xacbf1d)[_0x8952('0x18')](function(_0x1197a7){var _0x2730b3={'messageId':_0x1197a7[_0x8952('0x3f')]};if(!_0x35aeed[_0x8952('0x40')]){_0x2730b3[_0x8952('0x3b')]=!![];}return _0x2f3db6['update'](_0x2730b3);})['catch'](function(_0x24b94b){logger[_0x8952('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8952('0x2e'),_0x8952('0x3d'),util[_0x8952('0x2d')](_0x24b94b,{'showHidden':![],'depth':null}));});}else{logger[_0x8952('0x2b')](_0x8952('0x2c'),_0x8952('0x2e'),_0x8952('0x3d'),'Missing\x20parameters:\x20authToken');}break;case _0x8952('0x41'):if(_0x35aeed[_0x8952('0x30')]&&_0x35aeed[_0x8952('0x35')]){var _0x314602={'messages':[{'source':_0x8952('0x42'),'to':_0xd22858[_0x8952('0x20')],'body':_0xd22858['body'],'from':_0x35aeed[_0x8952('0x3e')]||_0x35aeed[_0x8952('0x20')]}]};var _0x2ea7c3=util['format'](_0x8952('0x43'),_0x35aeed['username'],_0x35aeed[_0x8952('0x35')]);var _0xacbf1d={'method':_0x8952('0x38'),'uri':_0x8952('0x44'),'body':_0x314602,'headers':{'Authorization':util[_0x8952('0x45')]('Basic\x20%s',new Buffer(_0x2ea7c3)[_0x8952('0x46')](_0x8952('0x47')))},'json':!![]};rp(_0xacbf1d)[_0x8952('0x18')](function(_0xef00be){if(_0xef00be[_0x8952('0x48')]>=0xc8&&_0xef00be[_0x8952('0x48')]<=0xce){if(_0xef00be['data']&&_0xef00be[_0x8952('0x49')]['queued_count']>0x0){var _0x46522f=_[_0x8952('0x4a')](_0xef00be[_0x8952('0x49')][_0x8952('0x22')]);var _0x36b433={'messageId':_0x46522f[_0x8952('0x4b')]};if(!_0x35aeed[_0x8952('0x40')]){_0x36b433[_0x8952('0x3b')]=!![];}return _0x2f3db6[_0x8952('0x2a')](_0x36b433);}else{logger[_0x8952('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8952('0x2e'),_0x8952('0x4c'),util[_0x8952('0x2d')](_0xef00be,{'showHidden':![],'depth':null}));}}else{logger[_0x8952('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','clickSend',util['inspect'](_0xef00be,{'showHidden':![],'depth':null}));}})[_0x8952('0x1a')](function(_0x5959d0){logger[_0x8952('0x2b')](_0x8952('0x2c'),_0x8952('0x2e'),_0x8952('0x4c'),util['inspect'](_0x5959d0,{'showHidden':![],'depth':null}));});}else{logger[_0x8952('0x2b')](_0x8952('0x2c'),_0x8952('0x2e'),_0x8952('0x4c'),_0x8952('0x3c'));}break;case'plivo':if(_0x35aeed[_0x8952('0x4d')]&&_0x35aeed['authToken']){var _0x314602={'dst':_0xd22858[_0x8952('0x20')],'text':_0xd22858['body'],'src':_0x35aeed['senderString']||_0x35aeed[_0x8952('0x20')],'url':_0x35aeed[_0x8952('0x25')]+'/api/sms/messages/'+_0xd22858['id']+_0x8952('0x27')+_0x35aeed[_0x8952('0x28')]};var _0x2ea7c3=util[_0x8952('0x45')](_0x8952('0x43'),_0x35aeed[_0x8952('0x4d')],_0x35aeed['authToken']);var _0xacbf1d={'method':_0x8952('0x38'),'uri':util[_0x8952('0x45')](_0x8952('0x4e'),_0x35aeed[_0x8952('0x4d')]),'body':_0x314602,'headers':{'Authorization':util[_0x8952('0x45')](_0x8952('0x4f'),new Buffer(_0x2ea7c3)['toString'](_0x8952('0x47')))},'json':!![]};rp(_0xacbf1d)[_0x8952('0x18')](function(_0x2e88dc){var _0x391691={'messageId':_0x2e88dc['message_uuid'][0x0]};return _0x2f3db6['update'](_0x391691);})[_0x8952('0x1a')](function(_0x5c6e26){logger[_0x8952('0x2b')](_0x8952('0x2c'),'afterCreate',_0x8952('0x50'),util[_0x8952('0x2d')](_0x5c6e26,{'showHidden':![],'depth':null}));});}else{logger[_0x8952('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8952('0x2e'),'plivo',_0x8952('0x51'));}break;case'infobip':if(_0x35aeed[_0x8952('0x30')]&&_0x35aeed[_0x8952('0x35')]){if(_0x35aeed[_0x8952('0x52')]){var _0x46aa19={'method':_0x8952('0x38'),'uri':_0x35aeed[_0x8952('0x52')]+_0x8952('0x53'),'body':{'username':_0x35aeed[_0x8952('0x30')],'password':_0x35aeed[_0x8952('0x35')]},'json':!![]};return rp(_0x46aa19)['then'](function(_0x2b5d2d){var _0x416917={'method':_0x8952('0x38'),'uri':_0x35aeed[_0x8952('0x52')]+_0x8952('0x54'),'body':{'messages':[{'from':_0x35aeed[_0x8952('0x20')],'destinations':[{'to':_0xd22858[_0x8952('0x20')]}],'text':_0xd22858[_0x8952('0x24')],'notifyUrl':_0x35aeed[_0x8952('0x25')]+'/api/sms/messages/'+_0xd22858['id']+_0x8952('0x27')+_0x35aeed[_0x8952('0x28')],'notifyContentType':_0x8952('0x55'),'callbackData':_0x35aeed[_0x8952('0x20')]+';'+_0xd22858[_0x8952('0x24')]}]},'headers':{'Authorization':_0x8952('0x56')+_0x2b5d2d[_0x8952('0x28')]},'json':!![]};return rp(_0x416917)[_0x8952('0x18')](function(_0x5a22b2){if(_0x5a22b2[_0x8952('0x22')]){var _0x1a7ae6={'messageId':_0x5a22b2[_0x8952('0x22')][0x0]['messageId']};if(!_0x35aeed['deliveryReport']){_0x1a7ae6['read']=!![];}return _0x2f3db6[_0x8952('0x2a')](_0x1a7ae6);}else{return logger[_0x8952('0x2b')](_0x8952('0x2c'),_0x8952('0x2e'),_0x8952('0x57'),util['inspect'](_0x5a22b2,{'showHidden':![],'depth':null}));}});})[_0x8952('0x1a')](function(_0x5ba1de){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8952('0x2e'),_0x8952('0x57'),util[_0x8952('0x2d')](_0x5ba1de,{'showHidden':![],'depth':null}));});}else{logger[_0x8952('0x2b')](_0x8952('0x2c'),_0x8952('0x2e'),_0x8952('0x57'),_0x8952('0x58'));}}else{logger[_0x8952('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip',_0x8952('0x3c'));}break;case _0x8952('0x59'):var _0x4bc649=require(_0x8952('0x5a'));if(_0x35aeed['apiKey']){var _0x15ed5b={};_0x15ed5b[_0x8952('0x5b')]=_0x35aeed['username'];_0x15ed5b['phone']=_0xd22858[_0x8952('0x20')];_0x15ed5b[_0x8952('0x32')]=_0x35aeed['phone'];_0x15ed5b[_0x8952('0x5c')]=_0xd22858[_0x8952('0x24')];_0x15ed5b['timestamp']=+new Date();var _0x386a7b='';var _0x3ecde4='';var _0x4bc077=Object[_0x8952('0x5d')](_0x15ed5b);_0x4bc077[_0x8952('0x5e')]();for(var _0x4804e7=0x0;_0x4804e7<_0x4bc077[_0x8952('0x5f')];_0x4804e7++){if(_0x386a7b!=''){_0x386a7b+='&';}_0x386a7b+=_0x4bc077[_0x4804e7]+'='+encodeURIComponent(_0x15ed5b[_0x4bc077[_0x4804e7]]);_0x3ecde4+=_0x15ed5b[_0x4bc077[_0x4804e7]];}_0x3ecde4+=_0x35aeed[_0x8952('0x60')];_0x3ecde4=_0x4bc649['createHash'](_0x8952('0x61'))[_0x8952('0x2a')](_0x3ecde4)[_0x8952('0x62')](_0x8952('0x63'));if(_0x386a7b!==''){_0x386a7b+='&';}_0x386a7b+=_0x8952('0x64')+_0x3ecde4;var _0x3ba6d5={'method':_0x8952('0x36'),'uri':_0x35aeed['baseUrl']+_0x8952('0x65')+_0x386a7b,'json':!![]};return rp(_0x3ba6d5)['then'](function(_0x18f4b){var _0x5bacd9=Object[_0x8952('0x5d')](_0x18f4b);if(_0x18f4b[_0x5bacd9[0x0]]['error']&&parseInt(_0x18f4b[_0x5bacd9[0x0]][_0x8952('0x2b')])===0x0){var _0x506e76={'messageId':_0x18f4b[_0x5bacd9[0x0]][_0x8952('0x66')]};if(!_0x35aeed[_0x8952('0x40')]){_0x506e76[_0x8952('0x3b')]=!![];}return _0x2f3db6['update'](_0x506e76);}else{return logger[_0x8952('0x2b')](_0x8952('0x2c'),'afterCreate','csc',util[_0x8952('0x2d')](_0x18f4b[_0x8952('0x2b')],{'showHidden':![],'depth':null}));}})[_0x8952('0x1a')](function(_0x509a67){return logger[_0x8952('0x2b')](_0x8952('0x2c'),_0x8952('0x2e'),_0x8952('0x59'),util[_0x8952('0x2d')](_0x509a67,{'showHidden':![],'depth':null}));});}else{logger[_0x8952('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8952('0x2e'),_0x8952('0x59'),'Missing\x20parameters:\x20apiKey');}break;case _0x8952('0x67'):if(_0x35aeed[_0x8952('0x60')]){var _0xbc83ad={'method':_0x8952('0x38'),'uri':_0x8952('0x68'),'headers':{'Authorization':_0x35aeed[_0x8952('0x60')]},'body':{'content':_0xd22858[_0x8952('0x24')],'to':[_0xd22858[_0x8952('0x20')]],'from':_0x35aeed[_0x8952('0x20')],'binary':![],'clientMessageId':_0x8952('0x69'),'charset':_0x8952('0x6a')},'json':!![]};rp(_0xbc83ad)[_0x8952('0x18')](function(_0x38eb16){if(!_0x38eb16[_0x8952('0x2b')]){var _0x19649c={'messageId':_0x38eb16['messages'][0x0][_0x8952('0x6b')]};if(!_0x35aeed['deliveryReport']){_0x19649c[_0x8952('0x3b')]=!![];}return _0x2f3db6[_0x8952('0x2a')](_0x19649c);}else{return logger[_0x8952('0x2b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x8952('0x2e'),_0x8952('0x67'),util[_0x8952('0x2d')](_0x38eb16['error'],{'showHidden':![],'depth':null}));}})[_0x8952('0x1a')](function(_0x43bda6){return logger[_0x8952('0x2b')](_0x8952('0x2c'),_0x8952('0x2e'),_0x8952('0x67'),util['inspect'](_0x43bda6,{'showHidden':![],'depth':null}));});}else{logger[_0x8952('0x2b')](_0x8952('0x2c'),_0x8952('0x2e'),_0x8952('0x67'),'Missing\x20parameters:\x20apiKey');}break;case _0x8952('0x6c'):if(_0x35aeed[_0x8952('0x30')]&&_0x35aeed[_0x8952('0x35')]){var _0x2ea7c3=util['format'](_0x8952('0x43'),_0x35aeed['username'],_0x35aeed[_0x8952('0x35')]);var _0xacbf1d={'method':_0x8952('0x38'),'uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x35aeed[_0x8952('0x6d')]+'/messages','body':{'to':[_0xd22858['phone']],'text':_0xd22858['body'],'from':_0x35aeed[_0x8952('0x20')],'applicationId':_0x35aeed['applicationId']},'headers':{'Authorization':util[_0x8952('0x45')](_0x8952('0x4f'),new Buffer(_0x2ea7c3)[_0x8952('0x46')](_0x8952('0x47')))},'json':!![]};rp(_0xacbf1d)['then'](function(_0x1a1b23){if(_0x1a1b23['id']){var _0x2ecd0f={'messageId':_0x1a1b23['id']};return _0x2f3db6[_0x8952('0x2a')](_0x2ecd0f);}else{logger['error'](_0x8952('0x2c'),_0x8952('0x2e'),_0x8952('0x6c'),util[_0x8952('0x2d')](_0x1a1b23,{'showHidden':![],'depth':null}));}})[_0x8952('0x1a')](function(_0x447f44){logger['error'](_0x8952('0x2c'),'afterCreate',_0x8952('0x6c'),util[_0x8952('0x2d')](_0x447f44,{'showHidden':![],'depth':null}));});}else{logger[_0x8952('0x2b')](_0x8952('0x2c'),_0x8952('0x2e'),'bandwidth',_0x8952('0x3c'));}break;case _0x8952('0x6e'):if(_0x35aeed['apiKey']){var _0x46ff54={};var _0x3ba6d5={'method':_0x8952('0x38'),'uri':_0x8952('0x6f'),'headers':{'Authorization':_0x8952('0x70')+_0x35aeed[_0x8952('0x60')],'Content-Type':_0x8952('0x55')},'body':{'from':_0x35aeed[_0x8952('0x20')],'to':_0xd22858[_0x8952('0x20')],'text':_0xd22858['body']},'json':!![]};return rp(_0x3ba6d5)[_0x8952('0x18')](function(_0x25414a){if(_0x25414a['code']==0xca){_0x46ff54[_0x8952('0x71')]=_0x25414a;var _0x5d56d0={'method':_0x8952('0x38'),'uri':_0x8952('0x72'),'headers':{'Authorization':_0x8952('0x70')+_0x35aeed[_0x8952('0x60')],'Content-Type':_0x8952('0x55')},'body':{'refid':_0x46ff54[_0x8952('0x71')][_0x8952('0x73')]},'json':!![]};return rp(_0x5d56d0)[_0x8952('0x18')](function(_0x5e4310){_0x46ff54[_0x8952('0x74')]=_0x5e4310;var _0x44843e={'messageId':_0x46ff54[_0x8952('0x71')][_0x8952('0x73')],'read':!![]};return _0x2f3db6[_0x8952('0x2a')](_0x44843e);});}else{return logger[_0x8952('0x2b')](_0x8952('0x2c'),_0x8952('0x2e'),_0x8952('0x6e'),util[_0x8952('0x2d')](_0x25414a,{'showHidden':![],'depth':null}));}})[_0x8952('0x1a')](function(_0x22ea51){return logger['error'](_0x8952('0x2c'),'afterCreate','intelepeer',util[_0x8952('0x2d')](_0x22ea51,{'showHidden':![],'depth':null}));});}else{return logger[_0x8952('0x2b')](_0x8952('0x2c'),_0x8952('0x2e'),_0x8952('0x6e'),_0x8952('0x75'));}break;}}})['finally'](function(){_0x37ff42();});}else{_0x37ff42();}}},'charset':_0x8952('0x76'),'collate':_0x8952('0x77')});}; \ No newline at end of file +var _0x2786=['SmsInteractionId','then','createdAt','toLowerCase','catch','error','SmsAccountId','type','twilio','authToken','phone','accountSid','create','remote','/api/sms/messages/','token','sid','update','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','username','password','smsMethod','sender','login?username=','&password=','GET','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','afterCreate','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','connectel','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','Basic\x20%s','base64','http_code','data','queued_count','head','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','/status?token=','https://api.plivo.com/v1/Account/%s/Message/','toString','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','messages','infobip','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','text','keys','sort','length','createHash','md5','digest','hex','/external/get/send.php?','Missing\x20parameters:\x20apiKey','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','clickatell','https://messaging.bandwidth.com/api/v2/users/','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','status','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','secret','isNil','UserId','findOne'];(function(_0x409deb,_0x2b731){var _0x15a4f7=function(_0x556510){while(--_0x556510){_0x409deb['push'](_0x409deb['shift']());}};_0x15a4f7(++_0x2b731);}(_0x2786,0x6a));var _0x6278=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2786[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x6278('0x0'));var util=require('util');var logger=require(_0x6278('0x1'))('api');var moment=require(_0x6278('0x2'));var BPromise=require(_0x6278('0x3'));var rp=require(_0x6278('0x4'));var fs=require('fs');var path=require(_0x6278('0x5'));var rimraf=require('rimraf');var config=require(_0x6278('0x6'));var attributes=require(_0x6278('0x7'));module['exports']=function(_0x5dc25f,_0x4a2291){return _0x5dc25f[_0x6278('0x8')](_0x6278('0x9'),attributes,{'tableName':_0x6278('0xa'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x6278('0xb')]},{'name':_0x6278('0xc'),'fields':[_0x6278('0xd')],'type':_0x6278('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4b9323,_0x5c5ad7,_0xd045cb){var _0x102fbc=_0x5dc25f[_0x6278('0xf')];var _0x1d5788=_0x4b9323[_0x6278('0x10')]({'plain':!![]});if(_0x1d5788[_0x6278('0x11')]['toLowerCase']()==='in'||_0x1d5788[_0x6278('0x11')]['toLowerCase']()==='out'&&!_0x1d5788[_0x6278('0x12')]&&!_[_0x6278('0x13')](_0x1d5788[_0x6278('0x14')])&&!_[_0x6278('0x13')](_0x1d5788['SmsInteractionId'])){_0x102fbc['SmsInteraction'][_0x6278('0x15')]({'where':{'id':_0x1d5788[_0x6278('0x16')]}})[_0x6278('0x17')](function(_0x4a1759){if(_0x4a1759){_0x4a1759['update']({'lastMsgAt':_0x1d5788[_0x6278('0x18')],'lastMsgDirection':_0x1d5788[_0x6278('0x11')][_0x6278('0x19')]()});}})[_0x6278('0x1a')](function(_0x4ce2f8){console[_0x6278('0x1b')](_0x4ce2f8);});}if(_0x1d5788[_0x6278('0x11')]==='out'&&!_0x1d5788['secret']){var _0xe6f028;_0x102fbc['SmsAccount']['find']({'where':{'id':_0x1d5788[_0x6278('0x1c')]},'raw':!![]})[_0x6278('0x17')](function(_0x3f58f7){_0xe6f028=_0x3f58f7;if(_0xe6f028&&_0xe6f028[_0x6278('0x1d')]){switch(_0xe6f028['type']){case _0x6278('0x1e'):var _0x252133=require(_0x6278('0x1e'));if(_0xe6f028['accountSid']&&_0xe6f028[_0x6278('0x1f')]&&_0xe6f028[_0x6278('0x20')]){var _0x4eb894=new _0x252133(_0xe6f028[_0x6278('0x21')],_0xe6f028[_0x6278('0x1f')]);_0x4eb894['messages'][_0x6278('0x22')]({'body':_0x1d5788['body'],'to':_0x1d5788[_0x6278('0x20')],'from':_0xe6f028[_0x6278('0x20')],'statusCallback':_0xe6f028[_0x6278('0x23')]+_0x6278('0x24')+_0x1d5788['id']+'/status?token='+_0xe6f028[_0x6278('0x25')]})[_0x6278('0x17')](function(_0x42886b){if(_0x42886b[_0x6278('0x26')]){return _0x4b9323[_0x6278('0x27')]({'messageId':_0x42886b[_0x6278('0x26')]});}})[_0x6278('0x1a')](function(_0x2cb82d){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x6278('0x1e'),util[_0x6278('0x28')](_0x2cb82d,{'showHidden':![],'depth':null}));});}else{logger[_0x6278('0x1b')](_0x6278('0x29'),'afterCreate',_0x6278('0x1e'),_0x6278('0x2a'));}break;case _0x6278('0x2b'):var _0x4cf204='https://api.skebby.it/API/v1.0/REST/';if(_0xe6f028[_0x6278('0x2c')]&&_0xe6f028[_0x6278('0x2d')]){var _0x2b3e2c={'recipient':[_0x1d5788[_0x6278('0x20')]],'message':_0x1d5788[_0x6278('0xd')],'message_type':_0xe6f028[_0x6278('0x2e')]};if(_0xe6f028['smsMethod']&&_0xe6f028[_0x6278('0x2e')]!=='SI'){_0x2b3e2c[_0x6278('0x2f')]=_0xe6f028[_0x6278('0x20')];}var _0x5b8289={'url':_0x4cf204+_0x6278('0x30')+_0xe6f028[_0x6278('0x2c')]+_0x6278('0x31')+_0xe6f028[_0x6278('0x2d')],'method':_0x6278('0x32')};rp(_0x5b8289)[_0x6278('0x17')](function(_0x290dc4){var _0x40c5c5=_0x290dc4[_0x6278('0x33')](';');var _0x1daf87={'user_key':_0x40c5c5[0x0],'session_key':_0x40c5c5[0x1]};_0x5b8289={'url':_0x4cf204+_0x6278('0x34'),'method':_0x6278('0x35'),'headers':{'user_key':_0x1daf87[_0x6278('0x36')],'Session_key':_0x1daf87[_0x6278('0x37')]},'json':!![],'body':_0x2b3e2c};return rp(_0x5b8289);})[_0x6278('0x17')](function(_0x5a0118){if(_0x5a0118[_0x6278('0x38')]>=0x1){var _0x38a66d={'messageId':_0x5a0118[_0x6278('0x39')]};if(_0xe6f028[_0x6278('0x2e')]!=='GP'||!_0xe6f028[_0x6278('0x3a')]){_0x38a66d[_0x6278('0x3b')]=!![];}return _0x4b9323['update'](_0x38a66d);}else{return logger[_0x6278('0x1b')](_0x6278('0x29'),_0x6278('0x3c'),'skebby',util[_0x6278('0x28')](_0x5a0118,{'showHidden':![],'depth':null}));}})['catch'](function(_0x254ae5){return logger['error'](_0x6278('0x29'),'afterCreate',_0x6278('0x2b'),util[_0x6278('0x28')](_0x254ae5,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x6278('0x29'),_0x6278('0x3c'),_0x6278('0x2b'),'Missing\x20parameters:\x20username,\x20password');}break;case'connectel':if(_0xe6f028[_0x6278('0x1f')]){var _0x316bd0={'recipient':_0x1d5788[_0x6278('0x20')],'message':_0x1d5788[_0x6278('0xd')],'sender':_0xe6f028[_0x6278('0x3d')]||_0xe6f028[_0x6278('0x20')],'authorization':_0xe6f028[_0x6278('0x1f')]};var _0x5c5ad7={'method':'POST','uri':_0x6278('0x3e'),'body':_0x316bd0,'json':!![]};rp(_0x5c5ad7)[_0x6278('0x17')](function(_0x1ef364){var _0x10b400={'messageId':_0x1ef364[_0x6278('0x3f')]};if(!_0xe6f028[_0x6278('0x3a')]){_0x10b400[_0x6278('0x3b')]=!![];}return _0x4b9323[_0x6278('0x27')](_0x10b400);})[_0x6278('0x1a')](function(_0x247a40){logger[_0x6278('0x1b')](_0x6278('0x29'),_0x6278('0x3c'),_0x6278('0x40'),util[_0x6278('0x28')](_0x247a40,{'showHidden':![],'depth':null}));});}else{logger[_0x6278('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6278('0x3c'),_0x6278('0x40'),_0x6278('0x41'));}break;case _0x6278('0x42'):if(_0xe6f028[_0x6278('0x2c')]&&_0xe6f028[_0x6278('0x2d')]){var _0x316bd0={'messages':[{'source':_0x6278('0x43'),'to':_0x1d5788[_0x6278('0x20')],'body':_0x1d5788[_0x6278('0xd')],'from':_0xe6f028['senderString']||_0xe6f028[_0x6278('0x20')]}]};var _0x1fad2a=util[_0x6278('0x44')](_0x6278('0x45'),_0xe6f028[_0x6278('0x2c')],_0xe6f028[_0x6278('0x2d')]);var _0x5c5ad7={'method':_0x6278('0x35'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x316bd0,'headers':{'Authorization':util['format'](_0x6278('0x46'),new Buffer(_0x1fad2a)['toString'](_0x6278('0x47')))},'json':!![]};rp(_0x5c5ad7)['then'](function(_0x43555e){if(_0x43555e[_0x6278('0x48')]>=0xc8&&_0x43555e['http_code']<=0xce){if(_0x43555e[_0x6278('0x49')]&&_0x43555e[_0x6278('0x49')][_0x6278('0x4a')]>0x0){var _0x2dae71=_[_0x6278('0x4b')](_0x43555e[_0x6278('0x49')]['messages']);var _0x50fbe9={'messageId':_0x2dae71[_0x6278('0x4c')]};if(!_0xe6f028[_0x6278('0x3a')]){_0x50fbe9[_0x6278('0x3b')]=!![];}return _0x4b9323[_0x6278('0x27')](_0x50fbe9);}else{logger[_0x6278('0x1b')](_0x6278('0x29'),_0x6278('0x3c'),_0x6278('0x4d'),util[_0x6278('0x28')](_0x43555e,{'showHidden':![],'depth':null}));}}else{logger[_0x6278('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6278('0x3c'),'clickSend',util[_0x6278('0x28')](_0x43555e,{'showHidden':![],'depth':null}));}})[_0x6278('0x1a')](function(_0x2bd2fe){logger[_0x6278('0x1b')](_0x6278('0x29'),_0x6278('0x3c'),_0x6278('0x4d'),util[_0x6278('0x28')](_0x2bd2fe,{'showHidden':![],'depth':null}));});}else{logger[_0x6278('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6278('0x3c'),'clickSend',_0x6278('0x4e'));}break;case _0x6278('0x4f'):if(_0xe6f028[_0x6278('0x50')]&&_0xe6f028[_0x6278('0x1f')]){var _0x316bd0={'dst':_0x1d5788['phone'],'text':_0x1d5788[_0x6278('0xd')],'src':_0xe6f028['senderString']||_0xe6f028[_0x6278('0x20')],'url':_0xe6f028[_0x6278('0x23')]+'/api/sms/messages/'+_0x1d5788['id']+_0x6278('0x51')+_0xe6f028[_0x6278('0x25')]};var _0x1fad2a=util[_0x6278('0x44')](_0x6278('0x45'),_0xe6f028[_0x6278('0x50')],_0xe6f028[_0x6278('0x1f')]);var _0x5c5ad7={'method':'POST','uri':util[_0x6278('0x44')](_0x6278('0x52'),_0xe6f028[_0x6278('0x50')]),'body':_0x316bd0,'headers':{'Authorization':util[_0x6278('0x44')](_0x6278('0x46'),new Buffer(_0x1fad2a)[_0x6278('0x53')](_0x6278('0x47')))},'json':!![]};rp(_0x5c5ad7)['then'](function(_0x57cbc0){var _0x5b3eb6={'messageId':_0x57cbc0[_0x6278('0x54')][0x0]};return _0x4b9323['update'](_0x5b3eb6);})[_0x6278('0x1a')](function(_0x1dcfe0){logger[_0x6278('0x1b')](_0x6278('0x29'),_0x6278('0x3c'),_0x6278('0x4f'),util[_0x6278('0x28')](_0x1dcfe0,{'showHidden':![],'depth':null}));});}else{logger[_0x6278('0x1b')](_0x6278('0x29'),_0x6278('0x3c'),'plivo',_0x6278('0x55'));}break;case'infobip':if(_0xe6f028[_0x6278('0x2c')]&&_0xe6f028[_0x6278('0x2d')]){if(_0xe6f028[_0x6278('0x56')]){var _0x289a3d={'method':'POST','uri':_0xe6f028[_0x6278('0x56')]+_0x6278('0x57'),'body':{'username':_0xe6f028[_0x6278('0x2c')],'password':_0xe6f028[_0x6278('0x2d')]},'json':!![]};return rp(_0x289a3d)[_0x6278('0x17')](function(_0x5ce2ce){var _0x495b9d={'method':_0x6278('0x35'),'uri':_0xe6f028[_0x6278('0x56')]+_0x6278('0x58'),'body':{'messages':[{'from':_0xe6f028[_0x6278('0x20')],'destinations':[{'to':_0x1d5788[_0x6278('0x20')]}],'text':_0x1d5788[_0x6278('0xd')],'notifyUrl':_0xe6f028[_0x6278('0x23')]+_0x6278('0x24')+_0x1d5788['id']+_0x6278('0x51')+_0xe6f028[_0x6278('0x25')],'notifyContentType':_0x6278('0x59'),'callbackData':_0xe6f028[_0x6278('0x20')]+';'+_0x1d5788[_0x6278('0xd')]}]},'headers':{'Authorization':_0x6278('0x5a')+_0x5ce2ce[_0x6278('0x25')]},'json':!![]};return rp(_0x495b9d)[_0x6278('0x17')](function(_0x295f7f){if(_0x295f7f[_0x6278('0x5b')]){var _0x5d26d2={'messageId':_0x295f7f[_0x6278('0x5b')][0x0][_0x6278('0xb')]};if(!_0xe6f028['deliveryReport']){_0x5d26d2['read']=!![];}return _0x4b9323[_0x6278('0x27')](_0x5d26d2);}else{return logger[_0x6278('0x1b')](_0x6278('0x29'),_0x6278('0x3c'),_0x6278('0x5c'),util[_0x6278('0x28')](_0x295f7f,{'showHidden':![],'depth':null}));}});})[_0x6278('0x1a')](function(_0x58a6f6){return logger[_0x6278('0x1b')](_0x6278('0x29'),_0x6278('0x3c'),_0x6278('0x5c'),util[_0x6278('0x28')](_0x58a6f6,{'showHidden':![],'depth':null}));});}else{logger[_0x6278('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x6278('0x5c'),_0x6278('0x5d'));}}else{logger[_0x6278('0x1b')](_0x6278('0x29'),_0x6278('0x3c'),_0x6278('0x5c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x6278('0x5e'):var _0x5610e8=require(_0x6278('0x5f'));if(_0xe6f028[_0x6278('0x60')]){var _0x5913a1={};_0x5913a1[_0x6278('0x61')]=_0xe6f028[_0x6278('0x2c')];_0x5913a1[_0x6278('0x20')]=_0x1d5788[_0x6278('0x20')];_0x5913a1[_0x6278('0x2f')]=_0xe6f028['phone'];_0x5913a1[_0x6278('0x62')]=_0x1d5788['body'];_0x5913a1['timestamp']=+new Date();var _0x10add3='';var _0x149fd7='';var _0x3f95eb=Object[_0x6278('0x63')](_0x5913a1);_0x3f95eb[_0x6278('0x64')]();for(var _0x1e4058=0x0;_0x1e4058<_0x3f95eb[_0x6278('0x65')];_0x1e4058++){if(_0x10add3!=''){_0x10add3+='&';}_0x10add3+=_0x3f95eb[_0x1e4058]+'='+encodeURIComponent(_0x5913a1[_0x3f95eb[_0x1e4058]]);_0x149fd7+=_0x5913a1[_0x3f95eb[_0x1e4058]];}_0x149fd7+=_0xe6f028[_0x6278('0x60')];_0x149fd7=_0x5610e8[_0x6278('0x66')](_0x6278('0x67'))['update'](_0x149fd7)[_0x6278('0x68')](_0x6278('0x69'));if(_0x10add3!==''){_0x10add3+='&';}_0x10add3+='signature='+_0x149fd7;var _0x5b8289={'method':_0x6278('0x32'),'uri':_0xe6f028[_0x6278('0x56')]+_0x6278('0x6a')+_0x10add3,'json':!![]};return rp(_0x5b8289)['then'](function(_0x35c99b){var _0x256c8b=Object[_0x6278('0x63')](_0x35c99b);if(_0x35c99b[_0x256c8b[0x0]]['error']&&parseInt(_0x35c99b[_0x256c8b[0x0]]['error'])===0x0){var _0x4a44a9={'messageId':_0x35c99b[_0x256c8b[0x0]]['id_sms']};if(!_0xe6f028[_0x6278('0x3a')]){_0x4a44a9[_0x6278('0x3b')]=!![];}return _0x4b9323[_0x6278('0x27')](_0x4a44a9);}else{return logger[_0x6278('0x1b')](_0x6278('0x29'),_0x6278('0x3c'),_0x6278('0x5e'),util['inspect'](_0x35c99b['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x18399a){return logger[_0x6278('0x1b')](_0x6278('0x29'),'afterCreate',_0x6278('0x5e'),util[_0x6278('0x28')](_0x18399a,{'showHidden':![],'depth':null}));});}else{logger[_0x6278('0x1b')](_0x6278('0x29'),_0x6278('0x3c'),_0x6278('0x5e'),_0x6278('0x6b'));}break;case'clickatell':if(_0xe6f028['apiKey']){var _0x2e953b={'method':_0x6278('0x35'),'uri':_0x6278('0x6c'),'headers':{'Authorization':_0xe6f028['apiKey']},'body':{'content':_0x1d5788[_0x6278('0xd')],'to':[_0x1d5788[_0x6278('0x20')]],'from':_0xe6f028['phone'],'binary':![],'clientMessageId':_0x6278('0x6d'),'charset':_0x6278('0x6e')},'json':!![]};rp(_0x2e953b)['then'](function(_0x2eb2d8){if(!_0x2eb2d8[_0x6278('0x1b')]){var _0x43ef1e={'messageId':_0x2eb2d8['messages'][0x0][_0x6278('0x6f')]};if(!_0xe6f028['deliveryReport']){_0x43ef1e['read']=!![];}return _0x4b9323['update'](_0x43ef1e);}else{return logger[_0x6278('0x1b')](_0x6278('0x29'),_0x6278('0x3c'),'clickatell',util[_0x6278('0x28')](_0x2eb2d8[_0x6278('0x1b')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x520105){return logger[_0x6278('0x1b')](_0x6278('0x29'),_0x6278('0x3c'),_0x6278('0x70'),util[_0x6278('0x28')](_0x520105,{'showHidden':![],'depth':null}));});}else{logger[_0x6278('0x1b')](_0x6278('0x29'),'afterCreate',_0x6278('0x70'),'Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0xe6f028[_0x6278('0x2c')]&&_0xe6f028[_0x6278('0x2d')]){var _0x1fad2a=util['format'](_0x6278('0x45'),_0xe6f028[_0x6278('0x2c')],_0xe6f028[_0x6278('0x2d')]);var _0x5c5ad7={'method':_0x6278('0x35'),'uri':_0x6278('0x71')+_0xe6f028['accountId']+_0x6278('0x72'),'body':{'to':[_0x1d5788[_0x6278('0x20')]],'text':_0x1d5788[_0x6278('0xd')],'from':_0xe6f028[_0x6278('0x20')],'applicationId':_0xe6f028[_0x6278('0x73')]},'headers':{'Authorization':util[_0x6278('0x44')](_0x6278('0x46'),new Buffer(_0x1fad2a)['toString'](_0x6278('0x47')))},'json':!![]};rp(_0x5c5ad7)['then'](function(_0x39d2ff){if(_0x39d2ff['id']){var _0x20a13f={'messageId':_0x39d2ff['id']};return _0x4b9323[_0x6278('0x27')](_0x20a13f);}else{logger[_0x6278('0x1b')](_0x6278('0x29'),_0x6278('0x3c'),'bandwidth',util[_0x6278('0x28')](_0x39d2ff,{'showHidden':![],'depth':null}));}})[_0x6278('0x1a')](function(_0x497f11){logger[_0x6278('0x1b')](_0x6278('0x29'),_0x6278('0x3c'),_0x6278('0x74'),util['inspect'](_0x497f11,{'showHidden':![],'depth':null}));});}else{logger[_0x6278('0x1b')](_0x6278('0x29'),_0x6278('0x3c'),_0x6278('0x74'),_0x6278('0x4e'));}break;case _0x6278('0x75'):if(_0xe6f028[_0x6278('0x60')]){var _0x5e0a68={};var _0x5b8289={'method':'POST','uri':_0x6278('0x76'),'headers':{'Authorization':_0x6278('0x77')+_0xe6f028[_0x6278('0x60')],'Content-Type':_0x6278('0x59')},'body':{'from':_0xe6f028[_0x6278('0x20')],'to':_0x1d5788[_0x6278('0x20')],'text':_0x1d5788[_0x6278('0xd')]},'json':!![]};return rp(_0x5b8289)['then'](function(_0x63cc65){if(_0x63cc65['code']==0xca){_0x5e0a68[_0x6278('0x78')]=_0x63cc65;var _0x3797f4={'method':_0x6278('0x35'),'uri':_0x6278('0x79'),'headers':{'Authorization':_0x6278('0x77')+_0xe6f028[_0x6278('0x60')],'Content-Type':_0x6278('0x59')},'body':{'refid':_0x5e0a68[_0x6278('0x78')]['refid']},'json':!![]};return rp(_0x3797f4)[_0x6278('0x17')](function(_0x5c46fa){_0x5e0a68[_0x6278('0x7a')]=_0x5c46fa;var _0x4fc46b={'messageId':_0x5e0a68[_0x6278('0x78')][_0x6278('0x7b')],'read':!![]};return _0x4b9323[_0x6278('0x27')](_0x4fc46b);});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6278('0x3c'),'intelepeer',util['inspect'](_0x63cc65,{'showHidden':![],'depth':null}));}})['catch'](function(_0x158fd8){return logger[_0x6278('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x6278('0x3c'),_0x6278('0x75'),util[_0x6278('0x28')](_0x158fd8,{'showHidden':![],'depth':null}));});}else{return logger[_0x6278('0x1b')](_0x6278('0x29'),_0x6278('0x3c'),_0x6278('0x75'),_0x6278('0x7c'));}break;}}})[_0x6278('0x7d')](function(){_0xd045cb();});}else{_0xd045cb();}}},'charset':_0x6278('0x7e'),'collate':_0x6278('0x7f')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 42a6b9e..fd35025 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 _0xd6d1=['debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s','message','result','catch','CreateSmsMessage','SmsMessage','create','options','raw','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent'];(function(_0xa5caf7,_0x3ec2fe){var _0x14eca9=function(_0x1ca9b6){while(--_0x1ca9b6){_0xa5caf7['push'](_0xa5caf7['shift']());}};_0x14eca9(++_0x3ec2fe);}(_0xd6d1,0x137));var _0x1d6d=function(_0x36c078,_0x4072a7){_0x36c078=_0x36c078-0x0;var _0x29c6ed=_0xd6d1[_0x36c078];return _0x29c6ed;};'use strict';var _=require(_0x1d6d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1d6d('0x1'));var rs=require(_0x1d6d('0x2'));var fs=require('fs');var Redis=require(_0x1d6d('0x3'));var db=require(_0x1d6d('0x4'))['db'];var utils=require(_0x1d6d('0x5'));var logger=require('../../config/logger')(_0x1d6d('0x6'));var config=require(_0x1d6d('0x7'));var jayson=require(_0x1d6d('0x8'));var client=jayson[_0x1d6d('0x9')][_0x1d6d('0xa')]({'port':0x232a});config['redis']=_[_0x1d6d('0xb')](config['redis'],{'host':_0x1d6d('0xc'),'port':0x18eb});var socket=require(_0x1d6d('0xd'))(new Redis(config['redis']));require('./smsMessage.socket')[_0x1d6d('0xe')](socket);function respondWithRpcPromise(_0x2dca75,_0x2f81e5,_0x53ce80){return new BPromise(function(_0x46469f,_0x423762){return client[_0x1d6d('0xf')](_0x2dca75,_0x53ce80)[_0x1d6d('0x10')](function(_0x10908e){logger[_0x1d6d('0x11')]('SmsMessage,\x20%s,\x20%s',_0x2f81e5,_0x1d6d('0x12'));logger[_0x1d6d('0x13')](_0x1d6d('0x14'),_0x2f81e5,_0x1d6d('0x12'),JSON[_0x1d6d('0x15')](_0x10908e));if(_0x10908e[_0x1d6d('0x16')]){if(_0x10908e['error'][_0x1d6d('0x17')]===0x1f4){logger[_0x1d6d('0x16')](_0x1d6d('0x18'),_0x2f81e5,_0x10908e[_0x1d6d('0x16')]['message']);return _0x423762(_0x10908e[_0x1d6d('0x16')][_0x1d6d('0x19')]);}logger['error'](_0x1d6d('0x18'),_0x2f81e5,_0x10908e[_0x1d6d('0x16')][_0x1d6d('0x19')]);return _0x46469f(_0x10908e[_0x1d6d('0x16')]['message']);}else{logger[_0x1d6d('0x11')]('SmsMessage,\x20%s,\x20%s',_0x2f81e5,'request\x20sent');_0x46469f(_0x10908e[_0x1d6d('0x1a')]['message']);}})[_0x1d6d('0x1b')](function(_0x593dac){logger[_0x1d6d('0x16')](_0x1d6d('0x18'),_0x2f81e5,_0x593dac);_0x423762(_0x593dac);});});}exports[_0x1d6d('0x1c')]=function(_0x477aab){var _0x246df9=this;return new Promise(function(_0x43e8d0,_0x287586){return db[_0x1d6d('0x1d')][_0x1d6d('0x1e')](_0x477aab['body'],{'raw':_0x477aab[_0x1d6d('0x1f')]?_0x477aab[_0x1d6d('0x1f')][_0x1d6d('0x20')]===undefined?!![]:![]:!![]})[_0x1d6d('0x10')](function(_0x3505ea){logger[_0x1d6d('0x11')]('CreateSmsMessage',_0x477aab);logger[_0x1d6d('0x13')](_0x1d6d('0x1c'),_0x477aab,JSON[_0x1d6d('0x15')](_0x3505ea));_0x43e8d0(_0x3505ea);})[_0x1d6d('0x1b')](function(_0x1c16f4){logger[_0x1d6d('0x16')](_0x1d6d('0x1c'),_0x1c16f4[_0x1d6d('0x19')],_0x477aab);_0x287586(_0x246df9[_0x1d6d('0x16')](0x1f4,_0x1c16f4[_0x1d6d('0x19')]));});});}; \ No newline at end of file +var _0x9148=['client','redis','localhost','socket.io-emitter','register','request','then','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','SmsMessage','create','body','options','raw','CreateSmsMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x2a8b73,_0x617ca1){var _0x2d895d=function(_0x2a36f6){while(--_0x2a36f6){_0x2a8b73['push'](_0x2a8b73['shift']());}};_0x2d895d(++_0x617ca1);}(_0x9148,0x10d));var _0x8914=function(_0x3bb077,_0x39643a){_0x3bb077=_0x3bb077-0x0;var _0x44ab12=_0x9148[_0x3bb077];return _0x44ab12;};'use strict';var _=require(_0x8914('0x0'));var util=require(_0x8914('0x1'));var moment=require(_0x8914('0x2'));var BPromise=require(_0x8914('0x3'));var rs=require(_0x8914('0x4'));var fs=require('fs');var Redis=require(_0x8914('0x5'));var db=require(_0x8914('0x6'))['db'];var utils=require(_0x8914('0x7'));var logger=require(_0x8914('0x8'))(_0x8914('0x9'));var config=require(_0x8914('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x8914('0xb')]['http']({'port':0x232a});config[_0x8914('0xc')]=_['defaults'](config[_0x8914('0xc')],{'host':_0x8914('0xd'),'port':0x18eb});var socket=require(_0x8914('0xe'))(new Redis(config[_0x8914('0xc')]));require('./smsMessage.socket')[_0x8914('0xf')](socket);function respondWithRpcPromise(_0x38defa,_0x63bdb4,_0x6e296e){return new BPromise(function(_0x3e8af9,_0x569386){return client[_0x8914('0x10')](_0x38defa,_0x6e296e)[_0x8914('0x11')](function(_0x4c8007){logger['info'](_0x8914('0x12'),_0x63bdb4,_0x8914('0x13'));logger[_0x8914('0x14')](_0x8914('0x15'),_0x63bdb4,_0x8914('0x13'),JSON[_0x8914('0x16')](_0x4c8007));if(_0x4c8007['error']){if(_0x4c8007[_0x8914('0x17')][_0x8914('0x18')]===0x1f4){logger['error'](_0x8914('0x12'),_0x63bdb4,_0x4c8007[_0x8914('0x17')][_0x8914('0x19')]);return _0x569386(_0x4c8007[_0x8914('0x17')][_0x8914('0x19')]);}logger[_0x8914('0x17')](_0x8914('0x12'),_0x63bdb4,_0x4c8007[_0x8914('0x17')][_0x8914('0x19')]);return _0x3e8af9(_0x4c8007['error'][_0x8914('0x19')]);}else{logger[_0x8914('0x1a')](_0x8914('0x12'),_0x63bdb4,_0x8914('0x13'));_0x3e8af9(_0x4c8007[_0x8914('0x1b')][_0x8914('0x19')]);}})[_0x8914('0x1c')](function(_0x4a93b5){logger[_0x8914('0x17')](_0x8914('0x12'),_0x63bdb4,_0x4a93b5);_0x569386(_0x4a93b5);});});}exports['CreateSmsMessage']=function(_0x5de618){var _0x3e4dcc=this;return new Promise(function(_0x564292,_0x5b4f7a){return db[_0x8914('0x1d')][_0x8914('0x1e')](_0x5de618[_0x8914('0x1f')],{'raw':_0x5de618[_0x8914('0x20')]?_0x5de618[_0x8914('0x20')][_0x8914('0x21')]===undefined?!![]:![]:!![]})[_0x8914('0x11')](function(_0x28ba81){logger[_0x8914('0x1a')](_0x8914('0x22'),_0x5de618);logger[_0x8914('0x14')](_0x8914('0x22'),_0x5de618,JSON[_0x8914('0x16')](_0x28ba81));_0x564292(_0x28ba81);})[_0x8914('0x1c')](function(_0x1398f9){logger['error']('CreateSmsMessage',_0x1398f9[_0x8914('0x19')],_0x5de618);_0x5b4f7a(_0x3e4dcc['error'](0x1f4,_0x1398f9['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 6e74bdf..a1e3368 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 _0x02ae=['update','removeListener','register','smsMessage:','save'];(function(_0x5443ac,_0x2cb686){var _0x2e4780=function(_0x54addf){while(--_0x54addf){_0x5443ac['push'](_0x5443ac['shift']());}};_0x2e4780(++_0x2cb686);}(_0x02ae,0x1c6));var _0xe02a=function(_0x57ec43,_0x5cd0f8){_0x57ec43=_0x57ec43-0x0;var _0x31c313=_0x02ae[_0x57ec43];return _0x31c313;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xe02a('0x0'),'remove',_0xe02a('0x1')];function createListener(_0xbed195,_0x56e66d){return function(_0x436819){_0x56e66d['emit'](_0xbed195,_0x436819);};}function removeListener(_0x2d6a6a,_0x4e75b7){return function(){SmsMessageEvents[_0xe02a('0x2')](_0x2d6a6a,_0x4e75b7);};}exports[_0xe02a('0x3')]=function(_0x2c290b){for(var _0x3d9303=0x0,_0x1c87e1=events['length'];_0x3d9303<_0x1c87e1;_0x3d9303++){var _0x3af94b=events[_0x3d9303];var _0x29798d=createListener(_0xe02a('0x4')+_0x3af94b,_0x2c290b);SmsMessageEvents['on'](_0x3af94b,_0x29798d);}}; \ No newline at end of file +var _0x726b=['remove','update','emit','removeListener','register','length','smsMessage:','save'];(function(_0x57a670,_0x30e402){var _0x41ce21=function(_0x11bd34){while(--_0x11bd34){_0x57a670['push'](_0x57a670['shift']());}};_0x41ce21(++_0x30e402);}(_0x726b,0x1af));var _0xb726=function(_0x4d27da,_0x2648d5){_0x4d27da=_0x4d27da-0x0;var _0x19f779=_0x726b[_0x4d27da];return _0x19f779;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xb726('0x0'),_0xb726('0x1'),_0xb726('0x2')];function createListener(_0xad4df4,_0x44da0d){return function(_0x2c724a){_0x44da0d[_0xb726('0x3')](_0xad4df4,_0x2c724a);};}function removeListener(_0x2686ff,_0x521dac){return function(){SmsMessageEvents[_0xb726('0x4')](_0x2686ff,_0x521dac);};}exports[_0xb726('0x5')]=function(_0x2c0364){for(var _0x234a90=0x0,_0x2e4577=events[_0xb726('0x6')];_0x234a90<_0x2e4577;_0x234a90++){var _0x3ec26e=events[_0x234a90];var _0x3b9f1b=createListener(_0xb726('0x7')+_0x3ec26e,_0x2c0364);SmsMessageEvents['on'](_0x3ec26e,_0x3b9f1b);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 6208a1b..0f47b44 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 _0x0874=['/:id','show','getMembers','/:id/users','getAgents','post','create','/:id/teams','addTeams','put','update','delete','destroy','removeTeams','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','describe'];(function(_0x58a4fe,_0x11d439){var _0x697de2=function(_0xe38c14){while(--_0xe38c14){_0x58a4fe['push'](_0x58a4fe['shift']());}};_0x697de2(++_0x11d439);}(_0x0874,0xe6));var _0x4087=function(_0x194d1c,_0x496df0){_0x194d1c=_0x194d1c-0x0;var _0x5c399b=_0x0874[_0x194d1c];return _0x5c399b;};'use strict';var multer=require(_0x4087('0x0'));var util=require(_0x4087('0x1'));var path=require(_0x4087('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4087('0x3')]();var fs_extra=require(_0x4087('0x4'));var auth=require(_0x4087('0x5'));var interaction=require(_0x4087('0x6'));var config=require(_0x4087('0x7'));var controller=require(_0x4087('0x8'));router[_0x4087('0x9')]('/',auth[_0x4087('0xa')](),controller[_0x4087('0xb')]);router[_0x4087('0x9')]('/describe',auth[_0x4087('0xa')](),controller[_0x4087('0xc')]);router[_0x4087('0x9')](_0x4087('0xd'),auth[_0x4087('0xa')](),controller[_0x4087('0xe')]);router[_0x4087('0x9')]('/:id/members',auth[_0x4087('0xa')](),controller[_0x4087('0xf')]);router['get']('/:id/teams',auth[_0x4087('0xa')](),controller['getTeams']);router[_0x4087('0x9')](_0x4087('0x10'),auth['isAuthenticated'](),controller[_0x4087('0x11')]);router[_0x4087('0x12')]('/',auth[_0x4087('0xa')](),controller[_0x4087('0x13')]);router['post'](_0x4087('0x14'),auth[_0x4087('0xa')](),controller[_0x4087('0x15')]);router[_0x4087('0x12')](_0x4087('0x10'),auth[_0x4087('0xa')](),controller['addAgents']);router[_0x4087('0x16')]('/:id',auth[_0x4087('0xa')](),controller[_0x4087('0x17')]);router[_0x4087('0x18')](_0x4087('0xd'),auth['isAuthenticated'](),controller[_0x4087('0x19')]);router['delete'](_0x4087('0x14'),auth[_0x4087('0xa')](),controller[_0x4087('0x1a')]);router[_0x4087('0x18')](_0x4087('0x10'),auth[_0x4087('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x9413=['removeAgents','multer','util','path','express','Router','fs-extra','./smsQueue.controller','get','isAuthenticated','/describe','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id','update','delete','destroy','removeTeams','/:id/users'];(function(_0x4a29f1,_0x23e312){var _0xe71461=function(_0x552bff){while(--_0x552bff){_0x4a29f1['push'](_0x4a29f1['shift']());}};_0xe71461(++_0x23e312);}(_0x9413,0x83));var _0x3941=function(_0x1b4002,_0x5b4094){_0x1b4002=_0x1b4002-0x0;var _0x1716f3=_0x9413[_0x1b4002];return _0x1716f3;};'use strict';var multer=require(_0x3941('0x0'));var util=require(_0x3941('0x1'));var path=require(_0x3941('0x2'));var timeout=require('connect-timeout');var express=require(_0x3941('0x3'));var router=express[_0x3941('0x4')]();var fs_extra=require(_0x3941('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3941('0x6'));router[_0x3941('0x7')]('/',auth[_0x3941('0x8')](),controller['index']);router['get'](_0x3941('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x3941('0x7')]('/:id',auth[_0x3941('0x8')](),controller[_0x3941('0xa')]);router[_0x3941('0x7')](_0x3941('0xb'),auth[_0x3941('0x8')](),controller[_0x3941('0xc')]);router[_0x3941('0x7')](_0x3941('0xd'),auth[_0x3941('0x8')](),controller[_0x3941('0xe')]);router['get']('/:id/users',auth[_0x3941('0x8')](),controller[_0x3941('0xf')]);router[_0x3941('0x10')]('/',auth[_0x3941('0x8')](),controller[_0x3941('0x11')]);router[_0x3941('0x10')](_0x3941('0xd'),auth[_0x3941('0x8')](),controller[_0x3941('0x12')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x3941('0x13'),auth[_0x3941('0x8')](),controller[_0x3941('0x14')]);router[_0x3941('0x15')]('/:id',auth[_0x3941('0x8')](),controller[_0x3941('0x16')]);router[_0x3941('0x15')]('/:id/teams',auth[_0x3941('0x8')](),controller[_0x3941('0x17')]);router[_0x3941('0x15')](_0x3941('0x18'),auth[_0x3941('0x8')](),controller[_0x3941('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index fa65090..d837b32 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 _0xe087=['sequelize','STRING','INTEGER','rrmemory','beepall','roundrobin'];(function(_0x539fa9,_0x3f506d){var _0x4774b1=function(_0x22ecb9){while(--_0x22ecb9){_0x539fa9['push'](_0x539fa9['shift']());}};_0x4774b1(++_0x3f506d);}(_0xe087,0x1bc));var _0x7e08=function(_0x34407a,_0x30aec6){_0x34407a=_0x34407a-0x0;var _0x56fc57=_0xe087[_0x34407a];return _0x56fc57;};'use strict';var Sequelize=require(_0x7e08('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7e08('0x1')]},'timeout':{'type':Sequelize[_0x7e08('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7e08('0x3'),_0x7e08('0x4'),_0x7e08('0x5'))}}; \ No newline at end of file +var _0xe52e=['sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x143290,_0x4637b1){var _0x794a32=function(_0x52e2e3){while(--_0x52e2e3){_0x143290['push'](_0x143290['shift']());}};_0x794a32(++_0x4637b1);}(_0xe52e,0xb4));var _0xee52=function(_0x2c3a88,_0x48637e){_0x2c3a88=_0x2c3a88-0x0;var _0x4a7925=_0xe52e[_0x2c3a88];return _0x4a7925;};'use strict';var Sequelize=require(_0xee52('0x0'));module[_0xee52('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xee52('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xee52('0x3')]},'timeout':{'type':Sequelize[_0xee52('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xee52('0x5')](_0xee52('0x6'),_0xee52('0x7'),_0xee52('0x8'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 99726d9..efa2535 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 _0x547e=['../../mysqldb','redis','localhost','./smsQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','SmsQueues','UserProfileResource','error','stack','name','send','SmsQueue','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','length','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','findOne','UserSmsQueue','order','SmsQueueId','User','findAndCountAll','UserId','agent','smsPause','updatedAt','createdAt','format','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','toString','SELECT','TeamId','includes','union','compact','value','isEmpty','removeAgents','userSmsQueue:remove','addAgents','spread','userSmsQueue:save','getAgents','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x3eb3e9,_0x34745a){var _0x4100cc=function(_0x5b78fa){while(--_0x5b78fa){_0x3eb3e9['push'](_0x3eb3e9['shift']());}};_0x4100cc(++_0x34745a);}(_0x547e,0xfd));var _0xe547=function(_0x16c6f0,_0x9a213a){_0x16c6f0=_0x16c6f0-0x0;var _0x6d3732=_0x547e[_0x16c6f0];return _0x6d3732;};'use strict';var emlformat=require(_0xe547('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe547('0x1'));var jsonpatch=require(_0xe547('0x2'));var rp=require('request-promise');var moment=require(_0xe547('0x3'));var BPromise=require(_0xe547('0x4'));var Mustache=require('mustache');var util=require(_0xe547('0x5'));var path=require(_0xe547('0x6'));var sox=require('sox');var csv=require(_0xe547('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe547('0x8'));var _=require(_0xe547('0x9'));var squel=require('squel');var crypto=require(_0xe547('0xa'));var jsforce=require(_0xe547('0xb'));var deskjs=require(_0xe547('0xc'));var toCsv=require(_0xe547('0x7'));var querystring=require(_0xe547('0xd'));var Papa=require(_0xe547('0xe'));var Redis=require(_0xe547('0xf'));var authService=require(_0xe547('0x10'));var qs=require(_0xe547('0x11'));var as=require(_0xe547('0x12'));var hardwareService=require(_0xe547('0x13'));var logger=require(_0xe547('0x14'))('api');var utils=require(_0xe547('0x15'));var config=require(_0xe547('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe547('0x17'))['db'];config[_0xe547('0x18')]=_['defaults'](config['redis'],{'host':_0xe547('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe547('0x1a'))[_0xe547('0x1b')](socket);function respondWithStatusCode(_0x4102d5,_0x2cd2a0){_0x2cd2a0=_0x2cd2a0||0xcc;return function(_0x49a13f){if(_0x49a13f){return _0x4102d5[_0xe547('0x1c')](_0x2cd2a0);}return _0x4102d5['status'](_0x2cd2a0)[_0xe547('0x1d')]();};}function respondWithResult(_0x5b28fc,_0x3c7124){_0x3c7124=_0x3c7124||0xc8;return function(_0x31ba00){if(_0x31ba00){return _0x5b28fc[_0xe547('0x1e')](_0x3c7124)[_0xe547('0x1f')](_0x31ba00);}};}function respondWithFilteredResult(_0x3e3555,_0x216661){return function(_0x11ad38){if(_0x11ad38){var _0x5a968d=typeof _0x216661[_0xe547('0x20')]===_0xe547('0x21')&&typeof _0x216661[_0xe547('0x22')]===_0xe547('0x21');var _0x383801=_0x11ad38[_0xe547('0x23')];var _0x450701=_0x5a968d?0x0:_0x216661['offset'];var _0x5bc104=_0x5a968d?_0x11ad38[_0xe547('0x23')]:_0x216661['offset']+_0x216661[_0xe547('0x22')];var _0x50dbb0;if(_0x5bc104>=_0x383801){_0x5bc104=_0x383801;_0x50dbb0=0xc8;}else{_0x50dbb0=0xce;}_0x3e3555[_0xe547('0x1e')](_0x50dbb0);return _0x3e3555['set'](_0xe547('0x24'),_0x450701+'-'+_0x5bc104+'/'+_0x383801)[_0xe547('0x1f')](_0x11ad38);}return null;};}function patchUpdates(_0x5f40b7){return function(_0x5a2e80){try{jsonpatch[_0xe547('0x25')](_0x5a2e80,_0x5f40b7,!![]);}catch(_0x1cf90e){return BPromise['reject'](_0x1cf90e);}return _0x5a2e80[_0xe547('0x26')]();};}function saveUpdates(_0x259644,_0x3939fb){return function(_0x44ac10){if(_0x44ac10){return _0x44ac10['update'](_0x259644)[_0xe547('0x27')](function(_0x418d45){return _0x418d45;});}return null;};}function removeEntity(_0x46958f,_0x43ed5c){return function(_0x43ec18){if(_0x43ec18){return _0x43ec18[_0xe547('0x28')]()[_0xe547('0x27')](function(){var _0x2e0075=_0x43ec18['get']({'plain':!![]});var _0x4ff0ed=_0xe547('0x29');return db[_0xe547('0x2a')][_0xe547('0x28')]({'where':{'type':_0x4ff0ed,'resourceId':_0x2e0075['id']}})[_0xe547('0x27')](function(){return _0x43ec18;});})['then'](function(){_0x46958f['status'](0xcc)[_0xe547('0x1d')]();});}};}function handleEntityNotFound(_0x38a4ae,_0x46be34){return function(_0x2c97a5){if(!_0x2c97a5){_0x38a4ae[_0xe547('0x1c')](0x194);}return _0x2c97a5;};}function handleError(_0xc8f420,_0x5c5ed8){_0x5c5ed8=_0x5c5ed8||0x1f4;return function(_0x4a23a6){logger[_0xe547('0x2b')](_0x4a23a6[_0xe547('0x2c')]);if(_0x4a23a6['name']){delete _0x4a23a6[_0xe547('0x2d')];}_0xc8f420[_0xe547('0x1e')](_0x5c5ed8)[_0xe547('0x2e')](_0x4a23a6);};}exports['index']=function(_0xfda88c,_0x47c347){var _0x275264={},_0x1b5cc1={},_0x16b5e4={'count':0x0,'rows':[]};var _0x4c33d7=_['map'](db[_0xe547('0x2f')][_0xe547('0x30')],function(_0x5aafa8){return{'name':_0x5aafa8['fieldName'],'type':_0x5aafa8[_0xe547('0x31')][_0xe547('0x32')]};});_0x1b5cc1[_0xe547('0x33')]=_[_0xe547('0x34')](_0x4c33d7,_0xe547('0x2d'));_0x1b5cc1[_0xe547('0x35')]=_[_0xe547('0x36')](_0xfda88c['query']);_0x1b5cc1[_0xe547('0x37')]=_[_0xe547('0x38')](_0x1b5cc1[_0xe547('0x33')],_0x1b5cc1['query']);_0x275264[_0xe547('0x39')]=_['intersection'](_0x1b5cc1[_0xe547('0x33')],qs[_0xe547('0x3a')](_0xfda88c['query'][_0xe547('0x3a')]));_0x275264[_0xe547('0x39')]=_0x275264[_0xe547('0x39')]['length']?_0x275264[_0xe547('0x39')]:_0x1b5cc1[_0xe547('0x33')];if(!_0xfda88c['query'][_0xe547('0x3b')](_0xe547('0x3c'))){_0x275264[_0xe547('0x22')]=qs[_0xe547('0x22')](_0xfda88c[_0xe547('0x35')][_0xe547('0x22')]);_0x275264['offset']=qs['offset'](_0xfda88c[_0xe547('0x35')][_0xe547('0x20')]);}_0x275264['order']=qs[_0xe547('0x3d')](_0xfda88c[_0xe547('0x35')][_0xe547('0x3d')]);_0x275264[_0xe547('0x3e')]=qs['filters'](_[_0xe547('0x3f')](_0xfda88c[_0xe547('0x35')],_0x1b5cc1[_0xe547('0x37')]),_0x4c33d7);if(_0xfda88c['query'][_0xe547('0x40')]){_0x275264[_0xe547('0x3e')]=_[_0xe547('0x41')](_0x275264[_0xe547('0x3e')],{'$or':_['map'](_0x4c33d7,function(_0x3760ca){if(_0x3760ca[_0xe547('0x31')]!==_0xe547('0x42')){var _0x265623={};_0x265623[_0x3760ca[_0xe547('0x2d')]]={'$like':'%'+_0xfda88c[_0xe547('0x35')][_0xe547('0x40')]+'%'};return _0x265623;}})});}_0x275264=_[_0xe547('0x41')]({},_0x275264,_0xfda88c[_0xe547('0x43')]);var _0x4a9517={'where':_0x275264[_0xe547('0x3e')]};return db['SmsQueue']['count'](_0x4a9517)[_0xe547('0x27')](function(_0xa8656b){_0x16b5e4[_0xe547('0x23')]=_0xa8656b;if(_0xfda88c['query'][_0xe547('0x44')]){_0x275264[_0xe547('0x45')]=[{'all':!![]}];}return db[_0xe547('0x2f')][_0xe547('0x46')](_0x275264);})['then'](function(_0x4e73ad){_0x16b5e4[_0xe547('0x47')]=_0x4e73ad;return _0x16b5e4;})[_0xe547('0x27')](respondWithFilteredResult(_0x47c347,_0x275264))['catch'](handleError(_0x47c347,null));};exports['show']=function(_0x1e48b9,_0x379368){var _0xe97ef5={'raw':!![],'where':{'id':_0x1e48b9[_0xe547('0x48')]['id']}},_0x4376db={};_0x4376db['model']=_[_0xe547('0x36')](db[_0xe547('0x2f')][_0xe547('0x30')]);_0x4376db[_0xe547('0x35')]=_[_0xe547('0x36')](_0x1e48b9['query']);_0x4376db['filters']=_[_0xe547('0x38')](_0x4376db[_0xe547('0x33')],_0x4376db['query']);_0xe97ef5[_0xe547('0x39')]=_[_0xe547('0x38')](_0x4376db['model'],qs[_0xe547('0x3a')](_0x1e48b9[_0xe547('0x35')][_0xe547('0x3a')]));_0xe97ef5['attributes']=_0xe97ef5[_0xe547('0x39')][_0xe547('0x49')]?_0xe97ef5[_0xe547('0x39')]:_0x4376db['model'];if(_0x1e48b9[_0xe547('0x35')][_0xe547('0x44')]){_0xe97ef5['include']=[{'all':!![]}];}_0xe97ef5=_['merge']({},_0xe97ef5,_0x1e48b9['options']);return db['SmsQueue'][_0xe547('0x4a')](_0xe97ef5)[_0xe547('0x27')](handleEntityNotFound(_0x379368,null))[_0xe547('0x27')](respondWithResult(_0x379368,null))[_0xe547('0x4b')](handleError(_0x379368,null));};exports[_0xe547('0x4c')]=function(_0x4c88ca,_0x107546){return db[_0xe547('0x2f')][_0xe547('0x4c')](_0x4c88ca['body'],{})[_0xe547('0x27')](function(_0x41b305){var _0x4b54e0=_0x4c88ca['user'][_0xe547('0x4d')]({'plain':!![]});if(!_0x4b54e0)throw new Error(_0xe547('0x4e'));if(_0x4b54e0['role']===_0xe547('0x4f')){var _0x3545e1=_0x41b305[_0xe547('0x4d')]({'plain':!![]});var _0x31a479=_0xe547('0x29');return db[_0xe547('0x50')][_0xe547('0x4a')]({'where':{'name':_0x31a479,'userProfileId':_0x4b54e0[_0xe547('0x51')]},'raw':!![]})[_0xe547('0x27')](function(_0x14d89c){if(_0x14d89c&&_0x14d89c['autoAssociation']===0x0){return db[_0xe547('0x2a')]['create']({'name':_0x3545e1[_0xe547('0x2d')],'resourceId':_0x3545e1['id'],'type':_0x14d89c[_0xe547('0x2d')],'sectionId':_0x14d89c['id']},{})['then'](function(){return _0x41b305;});}else{return _0x41b305;}})[_0xe547('0x4b')](function(_0x3f0d88){logger[_0xe547('0x2b')](_0xe547('0x52'),_0x3f0d88);throw _0x3f0d88;});}return _0x41b305;})[_0xe547('0x27')](respondWithResult(_0x107546,0xc9))['catch'](handleError(_0x107546,null));};exports[_0xe547('0x53')]=function(_0x25ae22,_0x553357){if(_0x25ae22[_0xe547('0x54')]['id']){delete _0x25ae22['body']['id'];}return db['SmsQueue'][_0xe547('0x4a')]({'where':{'id':_0x25ae22[_0xe547('0x48')]['id']}})[_0xe547('0x27')](handleEntityNotFound(_0x553357,null))[_0xe547('0x27')](saveUpdates(_0x25ae22['body'],null))[_0xe547('0x27')](respondWithResult(_0x553357,null))[_0xe547('0x4b')](handleError(_0x553357,null));};exports[_0xe547('0x28')]=function(_0x1eed90,_0x2b9359){return db[_0xe547('0x2f')][_0xe547('0x4a')]({'where':{'id':_0x1eed90[_0xe547('0x48')]['id']}})['then'](handleEntityNotFound(_0x2b9359,null))['then'](removeEntity(_0x2b9359,null))[_0xe547('0x4b')](handleError(_0x2b9359,null));};exports[_0xe547('0x55')]=function(_0x5c4b97,_0x26099d){return db[_0xe547('0x2f')][_0xe547('0x55')]()[_0xe547('0x27')](respondWithResult(_0x26099d,null))[_0xe547('0x4b')](handleError(_0x26099d,null));};exports['getMembers']=function(_0x29f3be,_0x151834,_0x1a561a){var _0x42d4dd={'raw':!![],'where':{}},_0x26544a={},_0x24a1d5;return db[_0xe547('0x2f')][_0xe547('0x56')]({'where':{'id':_0x29f3be[_0xe547('0x48')]['id']}})[_0xe547('0x27')](handleEntityNotFound(_0x151834,null))[_0xe547('0x27')](function(_0x581e53){if(_0x581e53){_0x24a1d5=_0x581e53[_0xe547('0x4d')]({'plain':!![]});_0x26544a[_0xe547('0x33')]=_[_0xe547('0x36')](db[_0xe547('0x57')][_0xe547('0x30')]);_0x26544a[_0xe547('0x35')]=_[_0xe547('0x36')](_0x29f3be[_0xe547('0x35')]);_0x26544a[_0xe547('0x37')]=_[_0xe547('0x38')](_0x26544a[_0xe547('0x33')],_0x26544a[_0xe547('0x35')]);_0x42d4dd[_0xe547('0x39')]=_[_0xe547('0x38')](_0x26544a[_0xe547('0x33')],qs[_0xe547('0x3a')](_0x29f3be[_0xe547('0x35')][_0xe547('0x3a')]));_0x42d4dd[_0xe547('0x39')]=_0x42d4dd[_0xe547('0x39')][_0xe547('0x49')]?_0x42d4dd[_0xe547('0x39')]:_0x26544a[_0xe547('0x33')];if(!_0x29f3be[_0xe547('0x35')][_0xe547('0x3b')](_0xe547('0x3c'))){_0x42d4dd[_0xe547('0x22')]=qs[_0xe547('0x22')](_0x29f3be['query'][_0xe547('0x22')]);_0x42d4dd['offset']=qs['offset'](_0x29f3be['query'][_0xe547('0x20')]);}_0x42d4dd[_0xe547('0x58')]=qs[_0xe547('0x3d')](_0x29f3be[_0xe547('0x35')][_0xe547('0x3d')]);_0x42d4dd[_0xe547('0x3e')]=qs[_0xe547('0x37')](_['pick'](_0x29f3be['query'],_0x26544a[_0xe547('0x37')]));_0x42d4dd[_0xe547('0x3e')][_0xe547('0x59')]=_0x581e53['id'];if(_0x29f3be[_0xe547('0x35')][_0xe547('0x40')]){_0x42d4dd['where']=_[_0xe547('0x41')](_0x42d4dd[_0xe547('0x3e')],{'$or':_['map'](_0x42d4dd[_0xe547('0x39')],function(_0x32acf3){var _0x675d8={};_0x675d8[_0x32acf3]={'$like':'%'+_0x29f3be[_0xe547('0x35')][_0xe547('0x40')]+'%'};return _0x675d8;})});}_0x42d4dd=_[_0xe547('0x41')]({},_0x42d4dd,_0x29f3be[_0xe547('0x43')]);return db['UserSmsQueue']['findAll'](_0x42d4dd);}})[_0xe547('0x27')](function(_0x479f36){if(_0x479f36){return db[_0xe547('0x5a')][_0xe547('0x5b')]({'where':{'id':_[_0xe547('0x34')](_0x479f36,_0xe547('0x5c')),'role':_0xe547('0x5d')},'attributes':['id',_0xe547('0x2d'),_0xe547('0x5e'),_0xe547('0x5f'),_0xe547('0x60')]});}})['then'](function(_0x4b43a9){if(_0x4b43a9){return{'count':_0x4b43a9[_0xe547('0x23')],'rows':_[_0xe547('0x34')](_0x4b43a9[_0xe547('0x47')],function(_0x5b7a48){return{'membername':_0x5b7a48['name'],'UserId':_0x5b7a48['id'],'queue_name':_0x24a1d5[_0xe547('0x2d')],'SmsQueueId':_0x24a1d5['id'],'interface':util[_0xe547('0x61')]('%s/%s',_0xe547('0x62'),_0x5b7a48[_0xe547('0x2d')]),'penalty':0x0,'paused':_0x5b7a48['smsPause'],'createdAt':_0x5b7a48[_0xe547('0x60')],'updatedAt':_0x5b7a48['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xe547('0x27')](respondWithFilteredResult(_0x151834,_0x42d4dd))[_0xe547('0x4b')](handleError(_0x151834,null));};exports[_0xe547('0x63')]=function(_0x2d4705,_0x5d3f0b,_0x9c34dc){var _0x49fb12={};var _0x29c194={};var _0xb5e381;var _0x5dfdce;return db[_0xe547('0x2f')][_0xe547('0x56')]({'where':{'id':_0x2d4705[_0xe547('0x48')]['id']}})[_0xe547('0x27')](handleEntityNotFound(_0x5d3f0b,null))[_0xe547('0x27')](function(_0x597ce){if(_0x597ce){_0xb5e381=_0x597ce;_0x29c194[_0xe547('0x33')]=_[_0xe547('0x36')](db[_0xe547('0x64')][_0xe547('0x30')]);_0x29c194['query']=_[_0xe547('0x36')](_0x2d4705[_0xe547('0x35')]);_0x29c194[_0xe547('0x37')]=_[_0xe547('0x38')](_0x29c194['model'],_0x29c194[_0xe547('0x35')]);_0x49fb12['attributes']=_[_0xe547('0x38')](_0x29c194[_0xe547('0x33')],qs[_0xe547('0x3a')](_0x2d4705[_0xe547('0x35')]['fields']));_0x49fb12['attributes']=_0x49fb12[_0xe547('0x39')][_0xe547('0x49')]?_0x49fb12[_0xe547('0x39')]:_0x29c194[_0xe547('0x33')];_0x49fb12[_0xe547('0x58')]=qs[_0xe547('0x3d')](_0x2d4705[_0xe547('0x35')][_0xe547('0x3d')]);_0x49fb12[_0xe547('0x3e')]=qs['filters'](_[_0xe547('0x3f')](_0x2d4705[_0xe547('0x35')],_0x29c194[_0xe547('0x37')]));if(_0x2d4705[_0xe547('0x35')][_0xe547('0x40')]){_0x49fb12['where']=_[_0xe547('0x41')](_0x49fb12[_0xe547('0x3e')],{'$or':_['map'](_0x49fb12[_0xe547('0x39')],function(_0x8f865b){var _0x2f6831={};_0x2f6831[_0x8f865b]={'$like':'%'+_0x2d4705[_0xe547('0x35')][_0xe547('0x40')]+'%'};return _0x2f6831;})});}_0x49fb12=_['merge']({},_0x49fb12,_0x2d4705[_0xe547('0x43')]);return _0xb5e381[_0xe547('0x63')](_0x49fb12);}})[_0xe547('0x27')](function(_0x45adc0){if(_0x45adc0){_0x5dfdce=_0x45adc0[_0xe547('0x49')];if(!_0x2d4705['query'][_0xe547('0x3b')]('nolimit')){_0x49fb12[_0xe547('0x22')]=qs[_0xe547('0x22')](_0x2d4705[_0xe547('0x35')]['limit']);_0x49fb12['offset']=qs[_0xe547('0x20')](_0x2d4705[_0xe547('0x35')]['offset']);}return _0xb5e381[_0xe547('0x63')](_0x49fb12);}})[_0xe547('0x27')](function(_0x1f6301){if(_0x1f6301){return _0x1f6301?{'count':_0x5dfdce,'rows':_0x1f6301}:null;}})['then'](respondWithResult(_0x5d3f0b,null))['catch'](handleError(_0x5d3f0b,null));};exports[_0xe547('0x65')]=function(_0x482ed2,_0x20b113,_0x13b010){var _0x1b382e=_0x482ed2[_0xe547('0x54')][_0xe547('0x66')];return db[_0xe547('0x64')][_0xe547('0x46')]({'where':{'id':_0x1b382e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe547('0x67'),'attributes':['id',_0xe547('0x2d'),_0xe547('0x68'),_0xe547('0x69'),_0xe547('0x6a')],'raw':!![]}]})[_0xe547('0x27')](function(_0x418b01){if(_0x418b01){var _0x27cc98=_['flatMap'](_0x418b01,function(_0x221b10){var _0x261b0b=_0x221b10['get']({'plain':!![]});return _0x261b0b['Agents'];});return db[_0xe547('0x2f')][_0xe547('0x4a')]({'where':{'id':_0x482ed2[_0xe547('0x48')]['id']}})['then'](function(_0x7bcf5a){return db[_0xe547('0x6b')][_0xe547('0x6c')](function(_0x288b0d){return _0x7bcf5a[_0xe547('0x65')](_0x1b382e,{'transaction':_0x288b0d})[_0xe547('0x27')](function(){return BPromise[_0xe547('0x6d')](_0x27cc98,function(_0x5e93d0){return db[_0xe547('0x57')][_0xe547('0x6e')]({'where':{'UserId':_0x5e93d0['id'],'SmsQueueId':_0x482ed2[_0xe547('0x48')]['id']},'transaction':_0x288b0d});});})[_0xe547('0x27')](function(){_0x27cc98[_0xe547('0x6f')](function(_0x504521){socket[_0xe547('0x70')]('userSmsQueue:save',{'UserId':_0x504521['id'],'SmsQueueId':_0x7bcf5a['id']});});});});});}})['then'](respondWithStatusCode(_0x20b113,null))[_0xe547('0x4b')](handleError(_0x20b113,null));};exports[_0xe547('0x71')]=function(_0x43b154,_0x47b4c7,_0x155693){return db[_0xe547('0x64')][_0xe547('0x46')]({'where':{'id':_0x43b154[_0xe547('0x35')][_0xe547('0x66')]},'attributes':['id'],'include':[{'model':db[_0xe547('0x5a')],'as':_0xe547('0x67'),'attributes':['id'],'raw':!![]}]})[_0xe547('0x27')](handleEntityNotFound(_0x47b4c7,null))[_0xe547('0x27')](function(_0x26b107){var _0x5cca18=_[_0xe547('0x34')](_0x26b107,'id');var _0x370f6f=[];var _0x44f540=[];var _0x58ff41=squel[_0xe547('0x72')]();_0x58ff41[_0xe547('0x73')](_0xe547('0x74'))[_0xe547('0x75')](_0xe547('0x76'),'tq')[_0xe547('0x77')](_0xe547('0x78'),'ut',_0xe547('0x79'))['where'](_0xe547('0x7a'),_0x43b154[_0xe547('0x48')]['id']);for(var _0x3a38b0=0x0;_0x3a38b0<_0x26b107[_0xe547('0x49')];_0x3a38b0+=0x1){let _0x3dbc52=_0x26b107[_0x3a38b0];for(var _0x2d13dc=0x0;_0x2d13dc<_0x3dbc52[_0xe547('0x67')][_0xe547('0x49')];_0x2d13dc+=0x1){let _0x10a9f4=_0x3dbc52['Agents'][_0x2d13dc];var _0x5e032e=_0x58ff41[_0xe547('0x7b')]();_0x5e032e[_0xe547('0x3e')]('ut.UserId\x20=\x20?',_0x10a9f4['id']);_0x44f540['push'](db[_0xe547('0x6b')][_0xe547('0x35')](_0x5e032e[_0xe547('0x7c')](),{'type':db['sequelize']['QueryTypes'][_0xe547('0x7d')]})['then'](function(_0x37973f){if(_0x37973f[_0xe547('0x49')]===0x1){return _0x10a9f4['id'];}else{var _0x216938=_['every'](_[_0xe547('0x34')](_0x37973f,_0xe547('0x7e')),function(_0x395547){return _[_0xe547('0x7f')](_0x5cca18,_0x395547);});if(_0x216938){return _0x10a9f4['id'];}}}));}}return BPromise['all'](_0x44f540)[_0xe547('0x27')](function(_0x342411){_0x370f6f=_(_0x370f6f)[_0xe547('0x80')](_0x342411)[_0xe547('0x81')]()[_0xe547('0x82')]();return db['SmsQueue'][_0xe547('0x4a')]({'where':{'id':_0x43b154[_0xe547('0x48')]['id']}})[_0xe547('0x27')](function(_0x43372b){return db[_0xe547('0x6b')][_0xe547('0x6c')](function(_0x5be988){return _0x43372b[_0xe547('0x71')](_0x43b154['query'][_0xe547('0x66')],{'transaction':_0x5be988})['then'](function(){if(!_[_0xe547('0x83')](_0x370f6f)){return _0x43372b[_0xe547('0x84')](_0x370f6f,{'transaction':_0x5be988});}})[_0xe547('0x27')](function(){_0x370f6f[_0xe547('0x6f')](function(_0x435d59){socket[_0xe547('0x70')](_0xe547('0x85'),{'UserId':_0x435d59,'SmsQueueId':_0x43372b['id']});});});});});});})[_0xe547('0x27')](respondWithStatusCode(_0x47b4c7,null))[_0xe547('0x4b')](handleError(_0x47b4c7,null));};exports[_0xe547('0x86')]=function(_0x1a1824,_0x386faf,_0x25f4e0){return db[_0xe547('0x2f')]['find']({'where':{'id':_0x1a1824['params']['id']}})[_0xe547('0x27')](handleEntityNotFound(_0x386faf,null))[_0xe547('0x27')](function(_0x1186e8){if(_0x1186e8){return _0x1186e8[_0xe547('0x86')](_0x1a1824[_0xe547('0x54')][_0xe547('0x66')],_['omit'](_0x1a1824[_0xe547('0x54')],[_0xe547('0x66'),'id'])||{})[_0xe547('0x87')](function(_0x379716){for(var _0x52ce7e=0x0;_0x52ce7e<_0x1a1824[_0xe547('0x54')][_0xe547('0x66')][_0xe547('0x49')];_0x52ce7e+=0x1){socket[_0xe547('0x70')](_0xe547('0x88'),{'UserId':Number(_0x1a1824['body']['ids'][_0x52ce7e]),'SmsQueueId':Number(_0x1a1824[_0xe547('0x48')]['id'])});}return _0x379716;});}})[_0xe547('0x27')](respondWithResult(_0x386faf,null))[_0xe547('0x4b')](handleError(_0x386faf,null));};exports['removeAgents']=function(_0x5cd43e,_0x1bdc18,_0xc22a84){return db['SmsQueue'][_0xe547('0x4a')]({'where':{'id':_0x5cd43e[_0xe547('0x48')]['id']}})['then'](handleEntityNotFound(_0x1bdc18,null))[_0xe547('0x27')](function(_0x5277b1){if(_0x5277b1){return _0x5277b1['removeAgents'](_0x5cd43e['query'][_0xe547('0x66')])[_0xe547('0x27')](function(){if(_['isArray'](_0x5cd43e['query'][_0xe547('0x66')])){for(var _0x242b80=0x0;_0x242b80<_0x5cd43e['query']['ids'][_0xe547('0x49')];_0x242b80+=0x1){socket[_0xe547('0x70')](_0xe547('0x85'),{'UserId':Number(_0x5cd43e[_0xe547('0x35')][_0xe547('0x66')][_0x242b80]),'SmsQueueId':Number(_0x5cd43e[_0xe547('0x48')]['id'])});}}else{socket[_0xe547('0x70')](_0xe547('0x85'),{'UserId':Number(_0x5cd43e[_0xe547('0x35')][_0xe547('0x66')]),'SmsQueueId':Number(_0x5cd43e[_0xe547('0x48')]['id'])});}});}})[_0xe547('0x27')](respondWithStatusCode(_0x1bdc18,null))[_0xe547('0x4b')](handleError(_0x1bdc18,null));};exports[_0xe547('0x89')]=function(_0x849e7c,_0x4d1d94,_0x5ae194){var _0xf33b49={};var _0x48983b={};var _0x3ca0cb;var _0x1282f0;return db[_0xe547('0x2f')][_0xe547('0x56')]({'where':{'id':_0x849e7c[_0xe547('0x48')]['id']}})[_0xe547('0x27')](handleEntityNotFound(_0x4d1d94,null))[_0xe547('0x27')](function(_0x3d7ef9){if(_0x3d7ef9){_0x3ca0cb=_0x3d7ef9;_0x48983b['model']=_[_0xe547('0x36')](db[_0xe547('0x5a')][_0xe547('0x30')]);_0x48983b['query']=_['keys'](_0x849e7c[_0xe547('0x35')]);_0x48983b[_0xe547('0x37')]=_[_0xe547('0x38')](_0x48983b[_0xe547('0x33')],_0x48983b['query']);_0xf33b49[_0xe547('0x39')]=_['intersection'](_0x48983b[_0xe547('0x33')],qs[_0xe547('0x3a')](_0x849e7c['query'][_0xe547('0x3a')]));_0xf33b49['attributes']=_0xf33b49[_0xe547('0x39')][_0xe547('0x49')]?_0xf33b49[_0xe547('0x39')]:_0x48983b['model'];_0xf33b49[_0xe547('0x58')]=qs['sort'](_0x849e7c[_0xe547('0x35')][_0xe547('0x3d')]);_0xf33b49[_0xe547('0x3e')]=qs[_0xe547('0x37')](_[_0xe547('0x3f')](_0x849e7c[_0xe547('0x35')],_0x48983b[_0xe547('0x37')]));if(_0x849e7c[_0xe547('0x35')]['filter']){_0xf33b49[_0xe547('0x3e')]=_[_0xe547('0x41')](_0xf33b49['where'],{'$or':_[_0xe547('0x34')](_0xf33b49['attributes'],function(_0x1b412f){var _0x5480b6={};_0x5480b6[_0x1b412f]={'$like':'%'+_0x849e7c[_0xe547('0x35')][_0xe547('0x40')]+'%'};return _0x5480b6;})});}_0xf33b49=_[_0xe547('0x41')]({},_0xf33b49,_0x849e7c[_0xe547('0x43')]);return _0x3ca0cb[_0xe547('0x89')](_0xf33b49);}})[_0xe547('0x27')](function(_0x5b5328){if(_0x5b5328){_0x1282f0=_0x5b5328[_0xe547('0x49')];if(!_0x849e7c[_0xe547('0x35')][_0xe547('0x3b')](_0xe547('0x3c'))){_0xf33b49[_0xe547('0x22')]=qs[_0xe547('0x22')](_0x849e7c[_0xe547('0x35')][_0xe547('0x22')]);_0xf33b49[_0xe547('0x20')]=qs['offset'](_0x849e7c[_0xe547('0x35')][_0xe547('0x20')]);}return _0x3ca0cb[_0xe547('0x89')](_0xf33b49);}})[_0xe547('0x27')](function(_0x143715){if(_0x143715){return _0x143715?{'count':_0x1282f0,'rows':_0x143715}:null;}})[_0xe547('0x27')](respondWithResult(_0x4d1d94,null))[_0xe547('0x4b')](handleError(_0x4d1d94,null));}; \ No newline at end of file +var _0x9627=['fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./smsQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','SmsQueues','UserProfileResource','stack','name','send','index','map','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','options','SmsQueue','includeAll','findAll','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','pick','SmsQueueId','filter','User','findAndCountAll','agent','smsPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','Agents','online','interface','flatMap','sequelize','transaction','addTeams','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','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','userSmsQueue:remove','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs'];(function(_0x52709a,_0x574fe8){var _0x2e62d5=function(_0x5c0459){while(--_0x5c0459){_0x52709a['push'](_0x52709a['shift']());}};_0x2e62d5(++_0x574fe8);}(_0x9627,0x8a));var _0x7962=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x9627[_0x4fbfd9];return _0x31dc94;};'use strict';var emlformat=require(_0x7962('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7962('0x1'));var jsonpatch=require(_0x7962('0x2'));var rp=require(_0x7962('0x3'));var moment=require(_0x7962('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7962('0x5'));var util=require('util');var path=require('path');var sox=require(_0x7962('0x6'));var csv=require(_0x7962('0x7'));var ejs=require(_0x7962('0x8'));var fs=require('fs');var fs_extra=require(_0x7962('0x9'));var _=require(_0x7962('0xa'));var squel=require('squel');var crypto=require(_0x7962('0xb'));var jsforce=require(_0x7962('0xc'));var deskjs=require(_0x7962('0xd'));var toCsv=require(_0x7962('0x7'));var querystring=require(_0x7962('0xe'));var Papa=require(_0x7962('0xf'));var Redis=require(_0x7962('0x10'));var authService=require(_0x7962('0x11'));var qs=require(_0x7962('0x12'));var as=require(_0x7962('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7962('0x14'))(_0x7962('0x15'));var utils=require(_0x7962('0x16'));var config=require(_0x7962('0x17'));var licenseUtil=require(_0x7962('0x18'));var db=require(_0x7962('0x19'))['db'];config['redis']=_[_0x7962('0x1a')](config[_0x7962('0x1b')],{'host':_0x7962('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7962('0x1b')]));require(_0x7962('0x1d'))[_0x7962('0x1e')](socket);function respondWithStatusCode(_0x2c877c,_0xe212c){_0xe212c=_0xe212c||0xcc;return function(_0x2315a6){if(_0x2315a6){return _0x2c877c[_0x7962('0x1f')](_0xe212c);}return _0x2c877c[_0x7962('0x20')](_0xe212c)[_0x7962('0x21')]();};}function respondWithResult(_0x2d4b4e,_0x43339c){_0x43339c=_0x43339c||0xc8;return function(_0x3bc3c4){if(_0x3bc3c4){return _0x2d4b4e[_0x7962('0x20')](_0x43339c)[_0x7962('0x22')](_0x3bc3c4);}};}function respondWithFilteredResult(_0x44466f,_0x115f8c){return function(_0x1a1e5d){if(_0x1a1e5d){var _0x9f2745=typeof _0x115f8c[_0x7962('0x23')]===_0x7962('0x24')&&typeof _0x115f8c[_0x7962('0x25')]===_0x7962('0x24');var _0x1e206a=_0x1a1e5d[_0x7962('0x26')];var _0x87fef4=_0x9f2745?0x0:_0x115f8c['offset'];var _0x30bffb=_0x9f2745?_0x1a1e5d[_0x7962('0x26')]:_0x115f8c[_0x7962('0x23')]+_0x115f8c[_0x7962('0x25')];var _0x3767ed;if(_0x30bffb>=_0x1e206a){_0x30bffb=_0x1e206a;_0x3767ed=0xc8;}else{_0x3767ed=0xce;}_0x44466f[_0x7962('0x20')](_0x3767ed);return _0x44466f[_0x7962('0x27')](_0x7962('0x28'),_0x87fef4+'-'+_0x30bffb+'/'+_0x1e206a)[_0x7962('0x22')](_0x1a1e5d);}return null;};}function patchUpdates(_0x2e7d7){return function(_0x51b051){try{jsonpatch[_0x7962('0x29')](_0x51b051,_0x2e7d7,!![]);}catch(_0x431c14){return BPromise[_0x7962('0x2a')](_0x431c14);}return _0x51b051[_0x7962('0x2b')]();};}function saveUpdates(_0x16e0c6,_0x17275e){return function(_0x5aceea){if(_0x5aceea){return _0x5aceea[_0x7962('0x2c')](_0x16e0c6)[_0x7962('0x2d')](function(_0x3ad1f7){return _0x3ad1f7;});}return null;};}function removeEntity(_0x2fd7ad,_0x908e11){return function(_0x37709b){if(_0x37709b){return _0x37709b[_0x7962('0x2e')]()[_0x7962('0x2d')](function(){var _0x553f5f=_0x37709b['get']({'plain':!![]});var _0x2ca49b=_0x7962('0x2f');return db[_0x7962('0x30')]['destroy']({'where':{'type':_0x2ca49b,'resourceId':_0x553f5f['id']}})[_0x7962('0x2d')](function(){return _0x37709b;});})['then'](function(){_0x2fd7ad[_0x7962('0x20')](0xcc)[_0x7962('0x21')]();});}};}function handleEntityNotFound(_0x371f18,_0xa3d21d){return function(_0x1b9de2){if(!_0x1b9de2){_0x371f18[_0x7962('0x1f')](0x194);}return _0x1b9de2;};}function handleError(_0x466e58,_0x533a87){_0x533a87=_0x533a87||0x1f4;return function(_0x20606d){logger['error'](_0x20606d[_0x7962('0x31')]);if(_0x20606d['name']){delete _0x20606d[_0x7962('0x32')];}_0x466e58[_0x7962('0x20')](_0x533a87)[_0x7962('0x33')](_0x20606d);};}exports[_0x7962('0x34')]=function(_0x29c61a,_0x4210d1){var _0x5ba587={},_0xc1b465={},_0xd1b075={'count':0x0,'rows':[]};var _0x3522db=_[_0x7962('0x35')](db['SmsQueue']['rawAttributes'],function(_0x5200d8){return{'name':_0x5200d8[_0x7962('0x36')],'type':_0x5200d8[_0x7962('0x37')]['key']};});_0xc1b465[_0x7962('0x38')]=_[_0x7962('0x35')](_0x3522db,_0x7962('0x32'));_0xc1b465[_0x7962('0x39')]=_[_0x7962('0x3a')](_0x29c61a['query']);_0xc1b465['filters']=_[_0x7962('0x3b')](_0xc1b465[_0x7962('0x38')],_0xc1b465['query']);_0x5ba587[_0x7962('0x3c')]=_[_0x7962('0x3b')](_0xc1b465[_0x7962('0x38')],qs[_0x7962('0x3d')](_0x29c61a[_0x7962('0x39')]['fields']));_0x5ba587[_0x7962('0x3c')]=_0x5ba587[_0x7962('0x3c')][_0x7962('0x3e')]?_0x5ba587[_0x7962('0x3c')]:_0xc1b465[_0x7962('0x38')];if(!_0x29c61a[_0x7962('0x39')][_0x7962('0x3f')](_0x7962('0x40'))){_0x5ba587[_0x7962('0x25')]=qs[_0x7962('0x25')](_0x29c61a[_0x7962('0x39')][_0x7962('0x25')]);_0x5ba587[_0x7962('0x23')]=qs[_0x7962('0x23')](_0x29c61a[_0x7962('0x39')][_0x7962('0x23')]);}_0x5ba587[_0x7962('0x41')]=qs[_0x7962('0x42')](_0x29c61a[_0x7962('0x39')]['sort']);_0x5ba587[_0x7962('0x43')]=qs['filters'](_['pick'](_0x29c61a[_0x7962('0x39')],_0xc1b465[_0x7962('0x44')]),_0x3522db);if(_0x29c61a['query']['filter']){_0x5ba587['where']=_[_0x7962('0x45')](_0x5ba587['where'],{'$or':_['map'](_0x3522db,function(_0x35c951){if(_0x35c951[_0x7962('0x37')]!==_0x7962('0x46')){var _0x31badf={};_0x31badf[_0x35c951['name']]={'$like':'%'+_0x29c61a[_0x7962('0x39')]['filter']+'%'};return _0x31badf;}})});}_0x5ba587=_[_0x7962('0x45')]({},_0x5ba587,_0x29c61a[_0x7962('0x47')]);var _0x502c58={'where':_0x5ba587['where']};return db[_0x7962('0x48')][_0x7962('0x26')](_0x502c58)['then'](function(_0x21cbe8){_0xd1b075[_0x7962('0x26')]=_0x21cbe8;if(_0x29c61a[_0x7962('0x39')][_0x7962('0x49')]){_0x5ba587['include']=[{'all':!![]}];}return db[_0x7962('0x48')][_0x7962('0x4a')](_0x5ba587);})[_0x7962('0x2d')](function(_0x4dbced){_0xd1b075['rows']=_0x4dbced;return _0xd1b075;})[_0x7962('0x2d')](respondWithFilteredResult(_0x4210d1,_0x5ba587))[_0x7962('0x4b')](handleError(_0x4210d1,null));};exports[_0x7962('0x4c')]=function(_0x3be7f4,_0x38bc10){var _0x830b9b={'raw':!![],'where':{'id':_0x3be7f4[_0x7962('0x4d')]['id']}},_0xc20cef={};_0xc20cef[_0x7962('0x38')]=_['keys'](db[_0x7962('0x48')][_0x7962('0x4e')]);_0xc20cef[_0x7962('0x39')]=_[_0x7962('0x3a')](_0x3be7f4[_0x7962('0x39')]);_0xc20cef[_0x7962('0x44')]=_[_0x7962('0x3b')](_0xc20cef['model'],_0xc20cef['query']);_0x830b9b['attributes']=_[_0x7962('0x3b')](_0xc20cef[_0x7962('0x38')],qs[_0x7962('0x3d')](_0x3be7f4[_0x7962('0x39')]['fields']));_0x830b9b[_0x7962('0x3c')]=_0x830b9b['attributes']['length']?_0x830b9b[_0x7962('0x3c')]:_0xc20cef['model'];if(_0x3be7f4[_0x7962('0x39')][_0x7962('0x49')]){_0x830b9b[_0x7962('0x4f')]=[{'all':!![]}];}_0x830b9b=_[_0x7962('0x45')]({},_0x830b9b,_0x3be7f4[_0x7962('0x47')]);return db[_0x7962('0x48')][_0x7962('0x50')](_0x830b9b)[_0x7962('0x2d')](handleEntityNotFound(_0x38bc10,null))['then'](respondWithResult(_0x38bc10,null))[_0x7962('0x4b')](handleError(_0x38bc10,null));};exports[_0x7962('0x51')]=function(_0x1feeb5,_0x21362c){return db[_0x7962('0x48')][_0x7962('0x51')](_0x1feeb5[_0x7962('0x52')],{})[_0x7962('0x2d')](function(_0x1d8e29){var _0x1d340f=_0x1feeb5[_0x7962('0x53')]['get']({'plain':!![]});if(!_0x1d340f)throw new Error(_0x7962('0x54'));if(_0x1d340f[_0x7962('0x55')]==='user'){var _0xe0ac41=_0x1d8e29[_0x7962('0x56')]({'plain':!![]});var _0x5ea7a9=_0x7962('0x2f');return db[_0x7962('0x57')][_0x7962('0x50')]({'where':{'name':_0x5ea7a9,'userProfileId':_0x1d340f['userProfileId']},'raw':!![]})[_0x7962('0x2d')](function(_0x53a0f9){if(_0x53a0f9&&_0x53a0f9['autoAssociation']===0x0){return db[_0x7962('0x30')][_0x7962('0x51')]({'name':_0xe0ac41[_0x7962('0x32')],'resourceId':_0xe0ac41['id'],'type':_0x53a0f9[_0x7962('0x32')],'sectionId':_0x53a0f9['id']},{})[_0x7962('0x2d')](function(){return _0x1d8e29;});}else{return _0x1d8e29;}})[_0x7962('0x4b')](function(_0x4cdab5){logger['error'](_0x7962('0x58'),_0x4cdab5);throw _0x4cdab5;});}return _0x1d8e29;})['then'](respondWithResult(_0x21362c,0xc9))['catch'](handleError(_0x21362c,null));};exports[_0x7962('0x2c')]=function(_0x3a6a3c,_0x5e4e28){if(_0x3a6a3c[_0x7962('0x52')]['id']){delete _0x3a6a3c[_0x7962('0x52')]['id'];}return db['SmsQueue']['find']({'where':{'id':_0x3a6a3c['params']['id']}})[_0x7962('0x2d')](handleEntityNotFound(_0x5e4e28,null))[_0x7962('0x2d')](saveUpdates(_0x3a6a3c['body'],null))[_0x7962('0x2d')](respondWithResult(_0x5e4e28,null))[_0x7962('0x4b')](handleError(_0x5e4e28,null));};exports['destroy']=function(_0x214101,_0x1f7857){return db[_0x7962('0x48')][_0x7962('0x50')]({'where':{'id':_0x214101[_0x7962('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1f7857,null))[_0x7962('0x2d')](removeEntity(_0x1f7857,null))[_0x7962('0x4b')](handleError(_0x1f7857,null));};exports[_0x7962('0x59')]=function(_0x17ba21,_0x73cfbe){return db[_0x7962('0x48')][_0x7962('0x59')]()['then'](respondWithResult(_0x73cfbe,null))[_0x7962('0x4b')](handleError(_0x73cfbe,null));};exports[_0x7962('0x5a')]=function(_0xf106d7,_0x2e2117,_0x2b8fc5){var _0x129c66={'raw':!![],'where':{}},_0x1bfd2a={},_0x788fbb;return db['SmsQueue'][_0x7962('0x5b')]({'where':{'id':_0xf106d7['params']['id']}})[_0x7962('0x2d')](handleEntityNotFound(_0x2e2117,null))[_0x7962('0x2d')](function(_0x56e5c5){if(_0x56e5c5){_0x788fbb=_0x56e5c5['get']({'plain':!![]});_0x1bfd2a[_0x7962('0x38')]=_[_0x7962('0x3a')](db[_0x7962('0x5c')][_0x7962('0x4e')]);_0x1bfd2a['query']=_[_0x7962('0x3a')](_0xf106d7[_0x7962('0x39')]);_0x1bfd2a[_0x7962('0x44')]=_[_0x7962('0x3b')](_0x1bfd2a['model'],_0x1bfd2a[_0x7962('0x39')]);_0x129c66[_0x7962('0x3c')]=_['intersection'](_0x1bfd2a['model'],qs['fields'](_0xf106d7[_0x7962('0x39')][_0x7962('0x3d')]));_0x129c66[_0x7962('0x3c')]=_0x129c66['attributes'][_0x7962('0x3e')]?_0x129c66[_0x7962('0x3c')]:_0x1bfd2a[_0x7962('0x38')];if(!_0xf106d7[_0x7962('0x39')][_0x7962('0x3f')](_0x7962('0x40'))){_0x129c66[_0x7962('0x25')]=qs[_0x7962('0x25')](_0xf106d7[_0x7962('0x39')][_0x7962('0x25')]);_0x129c66['offset']=qs[_0x7962('0x23')](_0xf106d7['query'][_0x7962('0x23')]);}_0x129c66[_0x7962('0x41')]=qs[_0x7962('0x42')](_0xf106d7[_0x7962('0x39')]['sort']);_0x129c66[_0x7962('0x43')]=qs[_0x7962('0x44')](_[_0x7962('0x5d')](_0xf106d7['query'],_0x1bfd2a[_0x7962('0x44')]));_0x129c66[_0x7962('0x43')][_0x7962('0x5e')]=_0x56e5c5['id'];if(_0xf106d7[_0x7962('0x39')][_0x7962('0x5f')]){_0x129c66[_0x7962('0x43')]=_[_0x7962('0x45')](_0x129c66['where'],{'$or':_['map'](_0x129c66[_0x7962('0x3c')],function(_0x444ce0){var _0x1d98f6={};_0x1d98f6[_0x444ce0]={'$like':'%'+_0xf106d7[_0x7962('0x39')][_0x7962('0x5f')]+'%'};return _0x1d98f6;})});}_0x129c66=_[_0x7962('0x45')]({},_0x129c66,_0xf106d7[_0x7962('0x47')]);return db[_0x7962('0x5c')][_0x7962('0x4a')](_0x129c66);}})[_0x7962('0x2d')](function(_0x3a78a5){if(_0x3a78a5){return db[_0x7962('0x60')][_0x7962('0x61')]({'where':{'id':_[_0x7962('0x35')](_0x3a78a5,'UserId'),'role':_0x7962('0x62')},'attributes':['id',_0x7962('0x32'),_0x7962('0x63'),_0x7962('0x64'),_0x7962('0x65')]});}})['then'](function(_0x4471b4){if(_0x4471b4){return{'count':_0x4471b4[_0x7962('0x26')],'rows':_['map'](_0x4471b4[_0x7962('0x66')],function(_0x76aab1){return{'membername':_0x76aab1[_0x7962('0x32')],'UserId':_0x76aab1['id'],'queue_name':_0x788fbb[_0x7962('0x32')],'SmsQueueId':_0x788fbb['id'],'interface':util[_0x7962('0x67')](_0x7962('0x68'),_0x7962('0x69'),_0x76aab1[_0x7962('0x32')]),'penalty':0x0,'paused':_0x76aab1[_0x7962('0x63')],'createdAt':_0x76aab1[_0x7962('0x65')],'updatedAt':_0x76aab1[_0x7962('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x7962('0x2d')](respondWithFilteredResult(_0x2e2117,_0x129c66))[_0x7962('0x4b')](handleError(_0x2e2117,null));};exports[_0x7962('0x6a')]=function(_0x2d1a7d,_0x4876a8,_0x556e39){var _0x49c913={};var _0x2ab95f={};var _0x7456ae;var _0x38352b;return db[_0x7962('0x48')][_0x7962('0x5b')]({'where':{'id':_0x2d1a7d[_0x7962('0x4d')]['id']}})[_0x7962('0x2d')](handleEntityNotFound(_0x4876a8,null))[_0x7962('0x2d')](function(_0x2f19a5){if(_0x2f19a5){_0x7456ae=_0x2f19a5;_0x2ab95f[_0x7962('0x38')]=_['keys'](db[_0x7962('0x6b')][_0x7962('0x4e')]);_0x2ab95f[_0x7962('0x39')]=_[_0x7962('0x3a')](_0x2d1a7d[_0x7962('0x39')]);_0x2ab95f[_0x7962('0x44')]=_[_0x7962('0x3b')](_0x2ab95f['model'],_0x2ab95f[_0x7962('0x39')]);_0x49c913[_0x7962('0x3c')]=_[_0x7962('0x3b')](_0x2ab95f['model'],qs['fields'](_0x2d1a7d['query'][_0x7962('0x3d')]));_0x49c913[_0x7962('0x3c')]=_0x49c913[_0x7962('0x3c')][_0x7962('0x3e')]?_0x49c913[_0x7962('0x3c')]:_0x2ab95f[_0x7962('0x38')];_0x49c913[_0x7962('0x41')]=qs['sort'](_0x2d1a7d[_0x7962('0x39')][_0x7962('0x42')]);_0x49c913[_0x7962('0x43')]=qs['filters'](_['pick'](_0x2d1a7d['query'],_0x2ab95f['filters']));if(_0x2d1a7d[_0x7962('0x39')]['filter']){_0x49c913[_0x7962('0x43')]=_['merge'](_0x49c913[_0x7962('0x43')],{'$or':_[_0x7962('0x35')](_0x49c913['attributes'],function(_0xabb380){var _0x5a96c6={};_0x5a96c6[_0xabb380]={'$like':'%'+_0x2d1a7d['query'][_0x7962('0x5f')]+'%'};return _0x5a96c6;})});}_0x49c913=_[_0x7962('0x45')]({},_0x49c913,_0x2d1a7d[_0x7962('0x47')]);return _0x7456ae['getTeams'](_0x49c913);}})[_0x7962('0x2d')](function(_0x3f0408){if(_0x3f0408){_0x38352b=_0x3f0408['length'];if(!_0x2d1a7d[_0x7962('0x39')][_0x7962('0x3f')](_0x7962('0x40'))){_0x49c913['limit']=qs[_0x7962('0x25')](_0x2d1a7d[_0x7962('0x39')][_0x7962('0x25')]);_0x49c913[_0x7962('0x23')]=qs[_0x7962('0x23')](_0x2d1a7d[_0x7962('0x39')][_0x7962('0x23')]);}return _0x7456ae[_0x7962('0x6a')](_0x49c913);}})[_0x7962('0x2d')](function(_0x499d20){if(_0x499d20){return _0x499d20?{'count':_0x38352b,'rows':_0x499d20}:null;}})[_0x7962('0x2d')](respondWithResult(_0x4876a8,null))[_0x7962('0x4b')](handleError(_0x4876a8,null));};exports['addTeams']=function(_0x388c7a,_0x38aeb6,_0x17c467){var _0x5a43fb=_0x388c7a[_0x7962('0x52')]['ids'];return db[_0x7962('0x6b')]['findAll']({'where':{'id':_0x5a43fb},'attributes':['id'],'include':[{'model':db[_0x7962('0x60')],'as':_0x7962('0x6c'),'attributes':['id',_0x7962('0x32'),_0x7962('0x6d'),'voicePause',_0x7962('0x6e')],'raw':!![]}]})[_0x7962('0x2d')](function(_0x4ecea8){if(_0x4ecea8){var _0x2f2d8f=_[_0x7962('0x6f')](_0x4ecea8,function(_0x1d4e95){var _0x478913=_0x1d4e95[_0x7962('0x56')]({'plain':!![]});return _0x478913[_0x7962('0x6c')];});return db[_0x7962('0x48')][_0x7962('0x50')]({'where':{'id':_0x388c7a[_0x7962('0x4d')]['id']}})[_0x7962('0x2d')](function(_0x56fcaf){return db[_0x7962('0x70')][_0x7962('0x71')](function(_0x11085c){return _0x56fcaf[_0x7962('0x72')](_0x5a43fb,{'transaction':_0x11085c})[_0x7962('0x2d')](function(){return BPromise[_0x7962('0x73')](_0x2f2d8f,function(_0x1e0a3c){return db[_0x7962('0x5c')][_0x7962('0x74')]({'where':{'UserId':_0x1e0a3c['id'],'SmsQueueId':_0x388c7a[_0x7962('0x4d')]['id']},'transaction':_0x11085c});});})[_0x7962('0x2d')](function(){_0x2f2d8f[_0x7962('0x75')](function(_0x4852fc){socket[_0x7962('0x76')](_0x7962('0x77'),{'UserId':_0x4852fc['id'],'SmsQueueId':_0x56fcaf['id']});});});});});}})['then'](respondWithStatusCode(_0x38aeb6,null))[_0x7962('0x4b')](handleError(_0x38aeb6,null));};exports[_0x7962('0x78')]=function(_0x26b80b,_0x9b94ca,_0x59380c){return db[_0x7962('0x6b')][_0x7962('0x4a')]({'where':{'id':_0x26b80b[_0x7962('0x39')][_0x7962('0x79')]},'attributes':['id'],'include':[{'model':db[_0x7962('0x60')],'as':_0x7962('0x6c'),'attributes':['id'],'raw':!![]}]})[_0x7962('0x2d')](handleEntityNotFound(_0x9b94ca,null))['then'](function(_0xc7e29){var _0xf05968=_['map'](_0xc7e29,'id');var _0x1279fa=[];var _0x4cffb1=[];var _0x259f94=squel[_0x7962('0x7a')]();_0x259f94[_0x7962('0x7b')](_0x7962('0x7c'))[_0x7962('0x7d')](_0x7962('0x7e'),'tq')[_0x7962('0x7f')](_0x7962('0x80'),'ut',_0x7962('0x81'))['where']('SmsQueueId\x20=\x20?',_0x26b80b[_0x7962('0x4d')]['id']);for(var _0x1f4e14=0x0;_0x1f4e14<_0xc7e29[_0x7962('0x3e')];_0x1f4e14+=0x1){let _0x30fc40=_0xc7e29[_0x1f4e14];for(var _0x5bf210=0x0;_0x5bf210<_0x30fc40[_0x7962('0x6c')][_0x7962('0x3e')];_0x5bf210+=0x1){let _0x57581e=_0x30fc40[_0x7962('0x6c')][_0x5bf210];var _0x4f82c4=_0x259f94[_0x7962('0x82')]();_0x4f82c4[_0x7962('0x43')](_0x7962('0x83'),_0x57581e['id']);_0x4cffb1[_0x7962('0x84')](db[_0x7962('0x70')][_0x7962('0x39')](_0x4f82c4[_0x7962('0x85')](),{'type':db[_0x7962('0x70')][_0x7962('0x86')][_0x7962('0x87')]})[_0x7962('0x2d')](function(_0x5787bb){if(_0x5787bb['length']===0x1){return _0x57581e['id'];}else{var _0x51622a=_[_0x7962('0x88')](_[_0x7962('0x35')](_0x5787bb,_0x7962('0x89')),function(_0x3835f6){return _[_0x7962('0x8a')](_0xf05968,_0x3835f6);});if(_0x51622a){return _0x57581e['id'];}}}));}}return BPromise[_0x7962('0x8b')](_0x4cffb1)['then'](function(_0x30785d){_0x1279fa=_(_0x1279fa)[_0x7962('0x8c')](_0x30785d)[_0x7962('0x8d')]()[_0x7962('0x8e')]();return db[_0x7962('0x48')]['find']({'where':{'id':_0x26b80b[_0x7962('0x4d')]['id']}})['then'](function(_0x470c46){return db['sequelize'][_0x7962('0x71')](function(_0x315774){return _0x470c46[_0x7962('0x78')](_0x26b80b[_0x7962('0x39')][_0x7962('0x79')],{'transaction':_0x315774})[_0x7962('0x2d')](function(){if(!_['isEmpty'](_0x1279fa)){return _0x470c46[_0x7962('0x8f')](_0x1279fa,{'transaction':_0x315774});}})[_0x7962('0x2d')](function(){_0x1279fa[_0x7962('0x75')](function(_0x3d58cc){socket['emit'](_0x7962('0x90'),{'UserId':_0x3d58cc,'SmsQueueId':_0x470c46['id']});});});});});});})['then'](respondWithStatusCode(_0x9b94ca,null))[_0x7962('0x4b')](handleError(_0x9b94ca,null));};exports['addAgents']=function(_0x7ea851,_0x5597b5,_0x3cbbe1){return db[_0x7962('0x48')][_0x7962('0x50')]({'where':{'id':_0x7ea851[_0x7962('0x4d')]['id']}})[_0x7962('0x2d')](handleEntityNotFound(_0x5597b5,null))[_0x7962('0x2d')](function(_0x128a0b){if(_0x128a0b){return _0x128a0b['addAgents'](_0x7ea851[_0x7962('0x52')][_0x7962('0x79')],_['omit'](_0x7ea851[_0x7962('0x52')],[_0x7962('0x79'),'id'])||{})['spread'](function(_0x1bae2a){for(var _0x214511=0x0;_0x214511<_0x7ea851[_0x7962('0x52')][_0x7962('0x79')]['length'];_0x214511+=0x1){socket[_0x7962('0x76')](_0x7962('0x77'),{'UserId':Number(_0x7ea851[_0x7962('0x52')][_0x7962('0x79')][_0x214511]),'SmsQueueId':Number(_0x7ea851['params']['id'])});}return _0x1bae2a;});}})[_0x7962('0x2d')](respondWithResult(_0x5597b5,null))[_0x7962('0x4b')](handleError(_0x5597b5,null));};exports[_0x7962('0x8f')]=function(_0x4ca090,_0x2a50c9,_0x43c3a6){return db[_0x7962('0x48')][_0x7962('0x50')]({'where':{'id':_0x4ca090[_0x7962('0x4d')]['id']}})[_0x7962('0x2d')](handleEntityNotFound(_0x2a50c9,null))[_0x7962('0x2d')](function(_0x5ca013){if(_0x5ca013){return _0x5ca013['removeAgents'](_0x4ca090[_0x7962('0x39')]['ids'])[_0x7962('0x2d')](function(){if(_[_0x7962('0x91')](_0x4ca090[_0x7962('0x39')][_0x7962('0x79')])){for(var _0x68eab0=0x0;_0x68eab0<_0x4ca090[_0x7962('0x39')]['ids'][_0x7962('0x3e')];_0x68eab0+=0x1){socket[_0x7962('0x76')](_0x7962('0x90'),{'UserId':Number(_0x4ca090[_0x7962('0x39')][_0x7962('0x79')][_0x68eab0]),'SmsQueueId':Number(_0x4ca090[_0x7962('0x4d')]['id'])});}}else{socket['emit'](_0x7962('0x90'),{'UserId':Number(_0x4ca090[_0x7962('0x39')][_0x7962('0x79')]),'SmsQueueId':Number(_0x4ca090[_0x7962('0x4d')]['id'])});}});}})[_0x7962('0x2d')](respondWithStatusCode(_0x2a50c9,null))[_0x7962('0x4b')](handleError(_0x2a50c9,null));};exports[_0x7962('0x92')]=function(_0x4eb3e1,_0x4f1ba4,_0x776bff){var _0x777913={};var _0x2bd147={};var _0xf811dc;var _0xb530e1;return db['SmsQueue']['findOne']({'where':{'id':_0x4eb3e1[_0x7962('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4f1ba4,null))[_0x7962('0x2d')](function(_0x279457){if(_0x279457){_0xf811dc=_0x279457;_0x2bd147['model']=_[_0x7962('0x3a')](db[_0x7962('0x60')][_0x7962('0x4e')]);_0x2bd147['query']=_[_0x7962('0x3a')](_0x4eb3e1[_0x7962('0x39')]);_0x2bd147[_0x7962('0x44')]=_[_0x7962('0x3b')](_0x2bd147[_0x7962('0x38')],_0x2bd147['query']);_0x777913[_0x7962('0x3c')]=_[_0x7962('0x3b')](_0x2bd147[_0x7962('0x38')],qs[_0x7962('0x3d')](_0x4eb3e1[_0x7962('0x39')][_0x7962('0x3d')]));_0x777913[_0x7962('0x3c')]=_0x777913[_0x7962('0x3c')][_0x7962('0x3e')]?_0x777913[_0x7962('0x3c')]:_0x2bd147[_0x7962('0x38')];_0x777913['order']=qs[_0x7962('0x42')](_0x4eb3e1[_0x7962('0x39')][_0x7962('0x42')]);_0x777913[_0x7962('0x43')]=qs[_0x7962('0x44')](_[_0x7962('0x5d')](_0x4eb3e1[_0x7962('0x39')],_0x2bd147[_0x7962('0x44')]));if(_0x4eb3e1[_0x7962('0x39')][_0x7962('0x5f')]){_0x777913[_0x7962('0x43')]=_['merge'](_0x777913[_0x7962('0x43')],{'$or':_[_0x7962('0x35')](_0x777913[_0x7962('0x3c')],function(_0x13cd84){var _0x379457={};_0x379457[_0x13cd84]={'$like':'%'+_0x4eb3e1[_0x7962('0x39')][_0x7962('0x5f')]+'%'};return _0x379457;})});}_0x777913=_[_0x7962('0x45')]({},_0x777913,_0x4eb3e1[_0x7962('0x47')]);return _0xf811dc[_0x7962('0x92')](_0x777913);}})[_0x7962('0x2d')](function(_0x42059b){if(_0x42059b){_0xb530e1=_0x42059b[_0x7962('0x3e')];if(!_0x4eb3e1[_0x7962('0x39')][_0x7962('0x3f')](_0x7962('0x40'))){_0x777913[_0x7962('0x25')]=qs['limit'](_0x4eb3e1['query'][_0x7962('0x25')]);_0x777913[_0x7962('0x23')]=qs[_0x7962('0x23')](_0x4eb3e1[_0x7962('0x39')][_0x7962('0x23')]);}return _0xf811dc[_0x7962('0x92')](_0x777913);}})['then'](function(_0x125622){if(_0x125622){return _0x125622?{'count':_0xb530e1,'rows':_0x125622}:null;}})['then'](respondWithResult(_0x4f1ba4,null))[_0x7962('0x4b')](handleError(_0x4f1ba4,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 8d21196..1e7b120 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 _0x1859=['events','../../mysqldb','SmsQueue','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x4864ea,_0x7764ed){var _0x12e74f=function(_0x3fe41d){while(--_0x3fe41d){_0x4864ea['push'](_0x4864ea['shift']());}};_0x12e74f(++_0x7764ed);}(_0x1859,0x183));var _0x9185=function(_0x177701,_0x3a9273){_0x177701=_0x177701-0x0;var _0xa4527e=_0x1859[_0x177701];return _0xa4527e;};'use strict';var EventEmitter=require(_0x9185('0x0'));var SmsQueue=require(_0x9185('0x1'))['db'][_0x9185('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x9185('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9185('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3b3d3d){return function(_0x3246b1,_0x1b8133,_0x208136){SmsQueueEvents[_0x9185('0x5')](_0x3b3d3d+':'+_0x3246b1['id'],_0x3246b1);SmsQueueEvents[_0x9185('0x5')](_0x3b3d3d,_0x3246b1);_0x208136(null);};}for(var e in events){if(events[_0x9185('0x6')](e)){var event=events[e];SmsQueue[_0x9185('0x7')](e,emitEvent(event));}}module[_0x9185('0x8')]=SmsQueueEvents; \ No newline at end of file +var _0x1111=['hook','exports','events','SmsQueue','save','emit'];(function(_0x2c4776,_0x2fa2d9){var _0xfbb9df=function(_0x5a2098){while(--_0x5a2098){_0x2c4776['push'](_0x2c4776['shift']());}};_0xfbb9df(++_0x2fa2d9);}(_0x1111,0xb0));var _0x1111=function(_0x411f78,_0x59e966){_0x411f78=_0x411f78-0x0;var _0x274d13=_0x1111[_0x411f78];return _0x274d13;};'use strict';var EventEmitter=require(_0x1111('0x0'));var SmsQueue=require('../../mysqldb')['db'][_0x1111('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1111('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x59ece3){return function(_0x2af248,_0xf0ffa2,_0x532c74){SmsQueueEvents[_0x1111('0x3')](_0x59ece3+':'+_0x2af248['id'],_0x2af248);SmsQueueEvents[_0x1111('0x3')](_0x59ece3,_0x2af248);_0x532c74(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x1111('0x4')](e,emitEvent(event));}}module[_0x1111('0x5')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index b1bee86..122bdb7 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 _0x7f63=['moment','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash','../../config/logger','api'];(function(_0x2c7d03,_0x467e23){var _0x1892e1=function(_0x40d09f){while(--_0x40d09f){_0x2c7d03['push'](_0x2c7d03['shift']());}};_0x1892e1(++_0x467e23);}(_0x7f63,0xd5));var _0x37f6=function(_0x191c4c,_0x3b7c2b){_0x191c4c=_0x191c4c-0x0;var _0x2fd037=_0x7f63[_0x191c4c];return _0x2fd037;};'use strict';var _=require(_0x37f6('0x0'));var util=require('util');var logger=require(_0x37f6('0x1'))(_0x37f6('0x2'));var moment=require(_0x37f6('0x3'));var BPromise=require(_0x37f6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x37f6('0x5'));var rimraf=require(_0x37f6('0x6'));var config=require(_0x37f6('0x7'));var attributes=require(_0x37f6('0x8'));module[_0x37f6('0x9')]=function(_0x16a637,_0x6ba279){return _0x16a637['define'](_0x37f6('0xa'),attributes,{'tableName':_0x37f6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9dd8=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes','exports','lodash','util'];(function(_0x409090,_0x229646){var _0x36386e=function(_0x4bc60f){while(--_0x4bc60f){_0x409090['push'](_0x409090['shift']());}};_0x36386e(++_0x229646);}(_0x9dd8,0x106));var _0x89dd=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x9dd8[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0x89dd('0x0'));var util=require(_0x89dd('0x1'));var logger=require(_0x89dd('0x2'))(_0x89dd('0x3'));var moment=require(_0x89dd('0x4'));var BPromise=require(_0x89dd('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x89dd('0x6'));var rimraf=require(_0x89dd('0x7'));var config=require(_0x89dd('0x8'));var attributes=require(_0x89dd('0x9'));module[_0x89dd('0xa')]=function(_0x35505d,_0x58540e){return _0x35505d['define']('SmsQueue',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 f70346f..2d7ac15 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 _0xa993=['options','raw','where','attributes','include','map','model','ShowSmsQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSmsQueue','SmsQueue','findAll'];(function(_0x5cd87c,_0x5e4540){var _0x4e9f40=function(_0x2964e0){while(--_0x2964e0){_0x5cd87c['push'](_0x5cd87c['shift']());}};_0x4e9f40(++_0x5e4540);}(_0xa993,0x1b6));var _0x3a99=function(_0x3fb5fa,_0x99815a){_0x3fb5fa=_0x3fb5fa-0x0;var _0x368105=_0xa993[_0x3fb5fa];return _0x368105;};'use strict';var _=require(_0x3a99('0x0'));var util=require(_0x3a99('0x1'));var moment=require(_0x3a99('0x2'));var BPromise=require(_0x3a99('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3a99('0x4'));var db=require(_0x3a99('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x3a99('0x6'));var jayson=require(_0x3a99('0x7'));var client=jayson[_0x3a99('0x8')][_0x3a99('0x9')]({'port':0x232a});config[_0x3a99('0xa')]=_[_0x3a99('0xb')](config['redis'],{'host':_0x3a99('0xc'),'port':0x18eb});var socket=require(_0x3a99('0xd'))(new Redis(config[_0x3a99('0xa')]));require(_0x3a99('0xe'))['register'](socket);function respondWithRpcPromise(_0x1be3d1,_0x31c45f,_0x3fc34d){return new BPromise(function(_0x2499af,_0x373241){return client['request'](_0x1be3d1,_0x3fc34d)[_0x3a99('0xf')](function(_0x41b5ad){logger[_0x3a99('0x10')](_0x3a99('0x11'),_0x31c45f,_0x3a99('0x12'));logger[_0x3a99('0x13')](_0x3a99('0x14'),_0x31c45f,_0x3a99('0x12'),JSON[_0x3a99('0x15')](_0x41b5ad));if(_0x41b5ad[_0x3a99('0x16')]){if(_0x41b5ad['error'][_0x3a99('0x17')]===0x1f4){logger[_0x3a99('0x16')](_0x3a99('0x11'),_0x31c45f,_0x41b5ad[_0x3a99('0x16')][_0x3a99('0x18')]);return _0x373241(_0x41b5ad['error'][_0x3a99('0x18')]);}logger[_0x3a99('0x16')](_0x3a99('0x11'),_0x31c45f,_0x41b5ad['error'][_0x3a99('0x18')]);return _0x2499af(_0x41b5ad[_0x3a99('0x16')]['message']);}else{logger[_0x3a99('0x10')]('SmsQueue,\x20%s,\x20%s',_0x31c45f,_0x3a99('0x12'));_0x2499af(_0x41b5ad[_0x3a99('0x19')]['message']);}})[_0x3a99('0x1a')](function(_0x33f3e4){logger[_0x3a99('0x16')](_0x3a99('0x11'),_0x31c45f,_0x33f3e4);_0x373241(_0x33f3e4);});});}exports[_0x3a99('0x1b')]=function(_0x4ca7dd){var _0x5c4c7d=this;return new Promise(function(_0x557ffb,_0x41d96e){return db[_0x3a99('0x1c')][_0x3a99('0x1d')]({'raw':_0x4ca7dd[_0x3a99('0x1e')]?_0x4ca7dd[_0x3a99('0x1e')][_0x3a99('0x1f')]===undefined?!![]:![]:!![],'where':_0x4ca7dd[_0x3a99('0x1e')]?_0x4ca7dd[_0x3a99('0x1e')][_0x3a99('0x20')]||null:null,'attributes':_0x4ca7dd[_0x3a99('0x1e')]?_0x4ca7dd[_0x3a99('0x1e')][_0x3a99('0x21')]||null:null,'limit':_0x4ca7dd[_0x3a99('0x1e')]?_0x4ca7dd[_0x3a99('0x1e')]['limit']||null:null,'include':_0x4ca7dd['options']?_0x4ca7dd[_0x3a99('0x1e')][_0x3a99('0x22')]?_[_0x3a99('0x23')](_0x4ca7dd['options'][_0x3a99('0x22')],function(_0x34ae45){return{'model':db[_0x34ae45['model']],'as':_0x34ae45['as'],'attributes':_0x34ae45[_0x3a99('0x21')],'include':_0x34ae45['include']?_[_0x3a99('0x23')](_0x34ae45[_0x3a99('0x22')],function(_0xa3872){return{'model':db[_0xa3872['model']],'as':_0xa3872['as'],'attributes':_0xa3872[_0x3a99('0x21')],'include':_0xa3872[_0x3a99('0x22')]?_[_0x3a99('0x23')](_0xa3872[_0x3a99('0x22')],function(_0x571e6f){return{'model':db[_0x571e6f[_0x3a99('0x24')]],'as':_0x571e6f['as'],'attributes':_0x571e6f[_0x3a99('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3a99('0xf')](function(_0x5d7e74){logger[_0x3a99('0x10')]('GetSmsQueue',_0x4ca7dd);logger[_0x3a99('0x13')](_0x3a99('0x1b'),_0x4ca7dd,JSON['stringify'](_0x5d7e74));_0x557ffb(_0x5d7e74);})[_0x3a99('0x1a')](function(_0x35ddee){logger['error'](_0x3a99('0x1b'),_0x35ddee[_0x3a99('0x18')],_0x4ca7dd);_0x41d96e(_0x5c4c7d[_0x3a99('0x16')](0x1f4,_0x35ddee[_0x3a99('0x18')]));});});};exports[_0x3a99('0x25')]=function(_0x335fc0){var _0x23fd81=this;return new Promise(function(_0x37fcf8,_0x314e40){return db[_0x3a99('0x1c')][_0x3a99('0x26')]({'raw':_0x335fc0[_0x3a99('0x1e')]?_0x335fc0[_0x3a99('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x335fc0[_0x3a99('0x1e')]?_0x335fc0[_0x3a99('0x1e')][_0x3a99('0x20')]||null:null,'attributes':_0x335fc0['options']?_0x335fc0['options'][_0x3a99('0x21')]||null:null,'include':_0x335fc0[_0x3a99('0x1e')]?_0x335fc0[_0x3a99('0x1e')][_0x3a99('0x22')]?_[_0x3a99('0x23')](_0x335fc0['options']['include'],function(_0x481710){return{'model':db[_0x481710[_0x3a99('0x24')]],'as':_0x481710['as'],'attributes':_0x481710[_0x3a99('0x21')],'include':_0x481710[_0x3a99('0x22')]?_[_0x3a99('0x23')](_0x481710[_0x3a99('0x22')],function(_0x4ea8ca){return{'model':db[_0x4ea8ca[_0x3a99('0x24')]],'as':_0x4ea8ca['as'],'attributes':_0x4ea8ca[_0x3a99('0x21')],'include':_0x4ea8ca['include']?_['map'](_0x4ea8ca[_0x3a99('0x22')],function(_0x3a2250){return{'model':db[_0x3a2250[_0x3a99('0x24')]],'as':_0x3a2250['as'],'attributes':_0x3a2250[_0x3a99('0x21')]};}):[]};}):[]};}):[]:[]})[_0x3a99('0xf')](function(_0x5980fd){logger['info']('ShowSmsQueue',_0x335fc0);logger[_0x3a99('0x13')](_0x3a99('0x25'),_0x335fc0,JSON[_0x3a99('0x15')](_0x5980fd));_0x37fcf8(_0x5980fd);})[_0x3a99('0x1a')](function(_0x47d04d){logger['error']('ShowSmsQueue',_0x47d04d['message'],_0x335fc0);_0x314e40(_0x23fd81[_0x3a99('0x16')](0x1f4,_0x47d04d[_0x3a99('0x18')]));});});}; \ No newline at end of file +var _0x17c4=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','request','then','info','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsQueue,\x20%s,\x20%s','message','result','GetSmsQueue','findAll','options','where','attributes','limit','include','map','model','debug','catch','ShowSmsQueue','SmsQueue','lodash','util'];(function(_0x1463e3,_0x2d2703){var _0x15ca0a=function(_0x34c792){while(--_0x34c792){_0x1463e3['push'](_0x1463e3['shift']());}};_0x15ca0a(++_0x2d2703);}(_0x17c4,0x1ec));var _0x417c=function(_0x39834d,_0x4fa4c8){_0x39834d=_0x39834d-0x0;var _0x336d1c=_0x17c4[_0x39834d];return _0x336d1c;};'use strict';var _=require(_0x417c('0x0'));var util=require(_0x417c('0x1'));var moment=require('moment');var BPromise=require(_0x417c('0x2'));var rs=require(_0x417c('0x3'));var fs=require('fs');var Redis=require(_0x417c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x417c('0x5'));var logger=require(_0x417c('0x6'))('rpc');var config=require(_0x417c('0x7'));var jayson=require(_0x417c('0x8'));var client=jayson['client'][_0x417c('0x9')]({'port':0x232a});config[_0x417c('0xa')]=_[_0x417c('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x417c('0xc'))(new Redis(config[_0x417c('0xa')]));require('./smsQueue.socket')[_0x417c('0xd')](socket);function respondWithRpcPromise(_0x5348f3,_0x297a45,_0x185d5e){return new BPromise(function(_0x172c80,_0x51730c){return client[_0x417c('0xe')](_0x5348f3,_0x185d5e)[_0x417c('0xf')](function(_0x112c8c){logger[_0x417c('0x10')]('SmsQueue,\x20%s,\x20%s',_0x297a45,_0x417c('0x11'));logger['debug'](_0x417c('0x12'),_0x297a45,_0x417c('0x11'),JSON[_0x417c('0x13')](_0x112c8c));if(_0x112c8c['error']){if(_0x112c8c[_0x417c('0x14')][_0x417c('0x15')]===0x1f4){logger[_0x417c('0x14')](_0x417c('0x16'),_0x297a45,_0x112c8c[_0x417c('0x14')][_0x417c('0x17')]);return _0x51730c(_0x112c8c[_0x417c('0x14')][_0x417c('0x17')]);}logger[_0x417c('0x14')](_0x417c('0x16'),_0x297a45,_0x112c8c[_0x417c('0x14')][_0x417c('0x17')]);return _0x172c80(_0x112c8c[_0x417c('0x14')][_0x417c('0x17')]);}else{logger[_0x417c('0x10')](_0x417c('0x16'),_0x297a45,_0x417c('0x11'));_0x172c80(_0x112c8c[_0x417c('0x18')]['message']);}})['catch'](function(_0x5c1c2f){logger[_0x417c('0x14')](_0x417c('0x16'),_0x297a45,_0x5c1c2f);_0x51730c(_0x5c1c2f);});});}exports[_0x417c('0x19')]=function(_0x4cbea5){var _0x44bedf=this;return new Promise(function(_0x32479a,_0x51ee63){return db['SmsQueue'][_0x417c('0x1a')]({'raw':_0x4cbea5[_0x417c('0x1b')]?_0x4cbea5[_0x417c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4cbea5[_0x417c('0x1b')]?_0x4cbea5[_0x417c('0x1b')][_0x417c('0x1c')]||null:null,'attributes':_0x4cbea5[_0x417c('0x1b')]?_0x4cbea5[_0x417c('0x1b')][_0x417c('0x1d')]||null:null,'limit':_0x4cbea5['options']?_0x4cbea5[_0x417c('0x1b')][_0x417c('0x1e')]||null:null,'include':_0x4cbea5['options']?_0x4cbea5[_0x417c('0x1b')][_0x417c('0x1f')]?_[_0x417c('0x20')](_0x4cbea5[_0x417c('0x1b')][_0x417c('0x1f')],function(_0x5a50a8){return{'model':db[_0x5a50a8[_0x417c('0x21')]],'as':_0x5a50a8['as'],'attributes':_0x5a50a8[_0x417c('0x1d')],'include':_0x5a50a8['include']?_['map'](_0x5a50a8[_0x417c('0x1f')],function(_0x26f4a8){return{'model':db[_0x26f4a8[_0x417c('0x21')]],'as':_0x26f4a8['as'],'attributes':_0x26f4a8[_0x417c('0x1d')],'include':_0x26f4a8[_0x417c('0x1f')]?_[_0x417c('0x20')](_0x26f4a8[_0x417c('0x1f')],function(_0x567e1b){return{'model':db[_0x567e1b['model']],'as':_0x567e1b['as'],'attributes':_0x567e1b['attributes']};}):[]};}):[]};}):[]:[]})[_0x417c('0xf')](function(_0x278d4c){logger[_0x417c('0x10')](_0x417c('0x19'),_0x4cbea5);logger[_0x417c('0x22')](_0x417c('0x19'),_0x4cbea5,JSON[_0x417c('0x13')](_0x278d4c));_0x32479a(_0x278d4c);})[_0x417c('0x23')](function(_0x517271){logger[_0x417c('0x14')](_0x417c('0x19'),_0x517271[_0x417c('0x17')],_0x4cbea5);_0x51ee63(_0x44bedf[_0x417c('0x14')](0x1f4,_0x517271[_0x417c('0x17')]));});});};exports[_0x417c('0x24')]=function(_0x493501){var _0x1d9992=this;return new Promise(function(_0x50e168,_0x34a454){return db[_0x417c('0x25')]['find']({'raw':_0x493501[_0x417c('0x1b')]?_0x493501['options']['raw']===undefined?!![]:![]:!![],'where':_0x493501['options']?_0x493501[_0x417c('0x1b')]['where']||null:null,'attributes':_0x493501[_0x417c('0x1b')]?_0x493501[_0x417c('0x1b')][_0x417c('0x1d')]||null:null,'include':_0x493501[_0x417c('0x1b')]?_0x493501[_0x417c('0x1b')][_0x417c('0x1f')]?_['map'](_0x493501['options'][_0x417c('0x1f')],function(_0x20d5cc){return{'model':db[_0x20d5cc[_0x417c('0x21')]],'as':_0x20d5cc['as'],'attributes':_0x20d5cc[_0x417c('0x1d')],'include':_0x20d5cc[_0x417c('0x1f')]?_['map'](_0x20d5cc[_0x417c('0x1f')],function(_0x38d167){return{'model':db[_0x38d167[_0x417c('0x21')]],'as':_0x38d167['as'],'attributes':_0x38d167[_0x417c('0x1d')],'include':_0x38d167[_0x417c('0x1f')]?_[_0x417c('0x20')](_0x38d167[_0x417c('0x1f')],function(_0x4597de){return{'model':db[_0x4597de[_0x417c('0x21')]],'as':_0x4597de['as'],'attributes':_0x4597de['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x16bb3e){logger[_0x417c('0x10')](_0x417c('0x24'),_0x493501);logger['debug']('ShowSmsQueue',_0x493501,JSON[_0x417c('0x13')](_0x16bb3e));_0x50e168(_0x16bb3e);})['catch'](function(_0x563c6c){logger[_0x417c('0x14')](_0x417c('0x24'),_0x563c6c[_0x417c('0x17')],_0x493501);_0x34a454(_0x1d9992[_0x417c('0x14')](0x1f4,_0x563c6c[_0x417c('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 00324ec..701f2e5 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 _0xac22=['smsQueue:','save','remove','update','emit','removeListener'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xac22,0x133));var _0x2ac2=function(_0x5471f5,_0x1eb932){_0x5471f5=_0x5471f5-0x0;var _0x2ef429=_0xac22[_0x5471f5];return _0x2ef429;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0x2ac2('0x0'),_0x2ac2('0x1'),_0x2ac2('0x2')];function createListener(_0x722f0,_0x1a4b3b){return function(_0x165994){_0x1a4b3b[_0x2ac2('0x3')](_0x722f0,_0x165994);};}function removeListener(_0xced1c7,_0x1cdff4){return function(){SmsQueueEvents[_0x2ac2('0x4')](_0xced1c7,_0x1cdff4);};}exports['register']=function(_0x4a51cb){for(var _0x5db06a=0x0,_0x19fb8c=events['length'];_0x5db06a<_0x19fb8c;_0x5db06a++){var _0x31db8c=events[_0x5db06a];var _0x49d334=createListener(_0x2ac2('0x5')+_0x31db8c,_0x4a51cb);SmsQueueEvents['on'](_0x31db8c,_0x49d334);}}; \ No newline at end of file +var _0xd948=['register','length','./smsQueue.events','remove','update','emit','removeListener'];(function(_0x37914d,_0x4209c0){var _0x2b4118=function(_0x10de2){while(--_0x10de2){_0x37914d['push'](_0x37914d['shift']());}};_0x2b4118(++_0x4209c0);}(_0xd948,0xb1));var _0x8d94=function(_0x246235,_0x26a40f){_0x246235=_0x246235-0x0;var _0x58e3ed=_0xd948[_0x246235];return _0x58e3ed;};'use strict';var SmsQueueEvents=require(_0x8d94('0x0'));var events=['save',_0x8d94('0x1'),_0x8d94('0x2')];function createListener(_0x36fc61,_0x24118f){return function(_0x573ae2){_0x24118f[_0x8d94('0x3')](_0x36fc61,_0x573ae2);};}function removeListener(_0x4aa471,_0x189f90){return function(){SmsQueueEvents[_0x8d94('0x4')](_0x4aa471,_0x189f90);};}exports[_0x8d94('0x5')]=function(_0x3eba0a){for(var _0x50dd99=0x0,_0x178cf3=events[_0x8d94('0x6')];_0x50dd99<_0x178cf3;_0x50dd99++){var _0x47accf=events[_0x50dd99];var _0x51fe71=createListener('smsQueue:'+_0x47accf,_0x3eba0a);SmsQueueEvents['on'](_0x47accf,_0x51fe71);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 13b2c70..c5c3d87 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 _0xc7b9=['multer','util','path','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xc7b9,0xa8));var _0x9c7b=function(_0x5cc3ad,_0x169e2a){_0x5cc3ad=_0x5cc3ad-0x0;var _0x773e57=_0xc7b9[_0x5cc3ad];return _0x773e57;};'use strict';var multer=require(_0x9c7b('0x0'));var util=require(_0x9c7b('0x1'));var path=require(_0x9c7b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9c7b('0x3')]();var fs_extra=require(_0x9c7b('0x4'));var auth=require(_0x9c7b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9c7b('0x6'));var controller=require('./smsQueueReport.controller');router[_0x9c7b('0x7')]('/',auth[_0x9c7b('0x8')](),controller[_0x9c7b('0x9')]);router[_0x9c7b('0x7')](_0x9c7b('0xa'),auth['isAuthenticated'](),controller[_0x9c7b('0xb')]);router[_0x9c7b('0x7')](_0x9c7b('0xc'),auth[_0x9c7b('0x8')](),controller[_0x9c7b('0xd')]);router[_0x9c7b('0xe')]('/',auth[_0x9c7b('0x8')](),controller[_0x9c7b('0xf')]);router[_0x9c7b('0x10')]('/:id',auth[_0x9c7b('0x8')](),controller[_0x9c7b('0x11')]);router[_0x9c7b('0x12')]('/:id',auth[_0x9c7b('0x8')](),controller[_0x9c7b('0x13')]);module[_0x9c7b('0x14')]=router; \ No newline at end of file +var _0xede7=['../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','index','isAuthenticated','describe','/:id','show','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x2aa16c,_0x228266){var _0x59d251=function(_0x1ec998){while(--_0x1ec998){_0x2aa16c['push'](_0x2aa16c['shift']());}};_0x59d251(++_0x228266);}(_0xede7,0xcc));var _0x7ede=function(_0x49fffd,_0x534844){_0x49fffd=_0x49fffd-0x0;var _0x4c90ed=_0xede7[_0x49fffd];return _0x4c90ed;};'use strict';var multer=require(_0x7ede('0x0'));var util=require('util');var path=require(_0x7ede('0x1'));var timeout=require(_0x7ede('0x2'));var express=require(_0x7ede('0x3'));var router=express[_0x7ede('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x7ede('0x5'));var config=require(_0x7ede('0x6'));var controller=require(_0x7ede('0x7'));router[_0x7ede('0x8')]('/',auth['isAuthenticated'](),controller[_0x7ede('0x9')]);router[_0x7ede('0x8')]('/describe',auth[_0x7ede('0xa')](),controller[_0x7ede('0xb')]);router[_0x7ede('0x8')](_0x7ede('0xc'),auth[_0x7ede('0xa')](),controller[_0x7ede('0xd')]);router['post']('/',auth[_0x7ede('0xa')](),controller['create']);router[_0x7ede('0xe')](_0x7ede('0xc'),auth[_0x7ede('0xa')](),controller[_0x7ede('0xf')]);router[_0x7ede('0x10')]('/:id',auth[_0x7ede('0xa')](),controller[_0x7ede('0x11')]);module[_0x7ede('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 1a54185..a1c5d26 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 _0x9a6b=['sequelize','exports','STRING','DATE','moment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9a6b,0x77));var _0xb9a6=function(_0x186888,_0xe402a8){_0x186888=_0x186888-0x0;var _0x3224bf=_0x9a6b[_0x186888];return _0x3224bf;};'use strict';var moment=require(_0xb9a6('0x0'));var Sequelize=require(_0xb9a6('0x1'));module[_0xb9a6('0x2')]={'uniqueid':{'type':Sequelize[_0xb9a6('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xb9a6('0x3')]},'joinAt':{'type':Sequelize[_0xb9a6('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb9a6('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb9a6('0x3')]}}; \ No newline at end of file +var _0xef4b=['sequelize','DATE'];(function(_0x38b31a,_0x155285){var _0x3da938=function(_0x8b8a0e){while(--_0x8b8a0e){_0x38b31a['push'](_0x38b31a['shift']());}};_0x3da938(++_0x155285);}(_0xef4b,0x86));var _0xbef4=function(_0x43d0e6,_0x3c1489){_0x43d0e6=_0x43d0e6-0x0;var _0x51d841=_0xef4b[_0x43d0e6];return _0x51d841;};'use strict';var moment=require('moment');var Sequelize=require(_0xbef4('0x0'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xbef4('0x1')]},'acceptAt':{'type':Sequelize[_0xbef4('0x1')]},'exitAt':{'type':Sequelize[_0xbef4('0x1')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index cf09775..b9f784d 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 _0xea02=['fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','rawAttributes','key','map','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','type','VIRTUAL','filter','merge','options','SmsQueueReport','includeAll','include','findAll','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs'];(function(_0x4efcad,_0x4ed9a7){var _0x5a6d2a=function(_0x908dca){while(--_0x908dca){_0x4efcad['push'](_0x4efcad['shift']());}};_0x5a6d2a(++_0x4ed9a7);}(_0xea02,0x1c2));var _0x2ea0=function(_0x1ffc15,_0x1dcef3){_0x1ffc15=_0x1ffc15-0x0;var _0x351b0a=_0xea02[_0x1ffc15];return _0x351b0a;};'use strict';var emlformat=require(_0x2ea0('0x0'));var rimraf=require(_0x2ea0('0x1'));var zipdir=require(_0x2ea0('0x2'));var jsonpatch=require(_0x2ea0('0x3'));var rp=require(_0x2ea0('0x4'));var moment=require(_0x2ea0('0x5'));var BPromise=require(_0x2ea0('0x6'));var Mustache=require(_0x2ea0('0x7'));var util=require(_0x2ea0('0x8'));var path=require(_0x2ea0('0x9'));var sox=require('sox');var csv=require(_0x2ea0('0xa'));var ejs=require(_0x2ea0('0xb'));var fs=require('fs');var fs_extra=require(_0x2ea0('0xc'));var _=require(_0x2ea0('0xd'));var squel=require('squel');var crypto=require(_0x2ea0('0xe'));var jsforce=require(_0x2ea0('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2ea0('0x10'));var Redis=require(_0x2ea0('0x11'));var authService=require(_0x2ea0('0x12'));var qs=require(_0x2ea0('0x13'));var as=require(_0x2ea0('0x14'));var hardwareService=require(_0x2ea0('0x15'));var logger=require(_0x2ea0('0x16'))('api');var utils=require(_0x2ea0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2ea0('0x18'));var db=require(_0x2ea0('0x19'))['db'];function respondWithStatusCode(_0x351216,_0x5a3ee9){_0x5a3ee9=_0x5a3ee9||0xcc;return function(_0x580cbc){if(_0x580cbc){return _0x351216[_0x2ea0('0x1a')](_0x5a3ee9);}return _0x351216[_0x2ea0('0x1b')](_0x5a3ee9)[_0x2ea0('0x1c')]();};}function respondWithResult(_0x22b2d5,_0x47a43e){_0x47a43e=_0x47a43e||0xc8;return function(_0x1bffc3){if(_0x1bffc3){return _0x22b2d5['status'](_0x47a43e)[_0x2ea0('0x1d')](_0x1bffc3);}};}function respondWithFilteredResult(_0x1c75ca,_0x39d4bc){return function(_0x541e08){if(_0x541e08){var _0x2ad334=typeof _0x39d4bc[_0x2ea0('0x1e')]===_0x2ea0('0x1f')&&typeof _0x39d4bc[_0x2ea0('0x20')]==='undefined';var _0x1448db=_0x541e08['count'];var _0x3bd5a4=_0x2ad334?0x0:_0x39d4bc[_0x2ea0('0x1e')];var _0x39862f=_0x2ad334?_0x541e08[_0x2ea0('0x21')]:_0x39d4bc[_0x2ea0('0x1e')]+_0x39d4bc[_0x2ea0('0x20')];var _0xee6c3e;if(_0x39862f>=_0x1448db){_0x39862f=_0x1448db;_0xee6c3e=0xc8;}else{_0xee6c3e=0xce;}_0x1c75ca[_0x2ea0('0x1b')](_0xee6c3e);return _0x1c75ca[_0x2ea0('0x22')](_0x2ea0('0x23'),_0x3bd5a4+'-'+_0x39862f+'/'+_0x1448db)['json'](_0x541e08);}return null;};}function patchUpdates(_0x5dbc87){return function(_0x9254b1){try{jsonpatch[_0x2ea0('0x24')](_0x9254b1,_0x5dbc87,!![]);}catch(_0x49a15a){return BPromise[_0x2ea0('0x25')](_0x49a15a);}return _0x9254b1[_0x2ea0('0x26')]();};}function saveUpdates(_0x47be97,_0x58b97f){return function(_0x457ec2){if(_0x457ec2){return _0x457ec2[_0x2ea0('0x27')](_0x47be97)[_0x2ea0('0x28')](function(_0x47af26){return _0x47af26;});}return null;};}function removeEntity(_0x45830f,_0x17373b){return function(_0x21b28e){if(_0x21b28e){return _0x21b28e[_0x2ea0('0x29')]()[_0x2ea0('0x28')](function(){_0x45830f[_0x2ea0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17b5c4,_0x174219){return function(_0x3cb828){if(!_0x3cb828){_0x17b5c4[_0x2ea0('0x1a')](0x194);}return _0x3cb828;};}function handleError(_0x210ac0,_0xcd9f2e){_0xcd9f2e=_0xcd9f2e||0x1f4;return function(_0x38767a){logger['error'](_0x38767a[_0x2ea0('0x2a')]);if(_0x38767a[_0x2ea0('0x2b')]){delete _0x38767a[_0x2ea0('0x2b')];}_0x210ac0['status'](_0xcd9f2e)[_0x2ea0('0x2c')](_0x38767a);};}exports[_0x2ea0('0x2d')]=function(_0x5df443,_0x53a105){var _0x5d0a0a={},_0x247187={},_0x24a07f={'count':0x0,'rows':[]};var _0x451691=_['map'](db['SmsQueueReport'][_0x2ea0('0x2e')],function(_0x8ca81e){return{'name':_0x8ca81e['fieldName'],'type':_0x8ca81e['type'][_0x2ea0('0x2f')]};});_0x247187['model']=_[_0x2ea0('0x30')](_0x451691,'name');_0x247187[_0x2ea0('0x31')]=_[_0x2ea0('0x32')](_0x5df443[_0x2ea0('0x31')]);_0x247187[_0x2ea0('0x33')]=_[_0x2ea0('0x34')](_0x247187['model'],_0x247187[_0x2ea0('0x31')]);_0x5d0a0a[_0x2ea0('0x35')]=_[_0x2ea0('0x34')](_0x247187[_0x2ea0('0x36')],qs[_0x2ea0('0x37')](_0x5df443['query'][_0x2ea0('0x37')]));_0x5d0a0a[_0x2ea0('0x35')]=_0x5d0a0a['attributes']['length']?_0x5d0a0a['attributes']:_0x247187['model'];if(!_0x5df443['query'][_0x2ea0('0x38')](_0x2ea0('0x39'))){_0x5d0a0a['limit']=qs[_0x2ea0('0x20')](_0x5df443['query'][_0x2ea0('0x20')]);_0x5d0a0a['offset']=qs[_0x2ea0('0x1e')](_0x5df443[_0x2ea0('0x31')][_0x2ea0('0x1e')]);}_0x5d0a0a[_0x2ea0('0x3a')]=qs[_0x2ea0('0x3b')](_0x5df443[_0x2ea0('0x31')][_0x2ea0('0x3b')]);_0x5d0a0a[_0x2ea0('0x3c')]=qs[_0x2ea0('0x33')](_['pick'](_0x5df443[_0x2ea0('0x31')],_0x247187['filters']),_0x451691);if(_0x5df443[_0x2ea0('0x31')]['filter']){_0x5d0a0a['where']=_['merge'](_0x5d0a0a[_0x2ea0('0x3c')],{'$or':_['map'](_0x451691,function(_0x149400){if(_0x149400[_0x2ea0('0x3d')]!==_0x2ea0('0x3e')){var _0x35cae0={};_0x35cae0[_0x149400[_0x2ea0('0x2b')]]={'$like':'%'+_0x5df443[_0x2ea0('0x31')][_0x2ea0('0x3f')]+'%'};return _0x35cae0;}})});}_0x5d0a0a=_[_0x2ea0('0x40')]({},_0x5d0a0a,_0x5df443[_0x2ea0('0x41')]);var _0x46c521={'where':_0x5d0a0a[_0x2ea0('0x3c')]};return db[_0x2ea0('0x42')][_0x2ea0('0x21')](_0x46c521)['then'](function(_0x34c7fb){_0x24a07f[_0x2ea0('0x21')]=_0x34c7fb;if(_0x5df443[_0x2ea0('0x31')][_0x2ea0('0x43')]){_0x5d0a0a[_0x2ea0('0x44')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x2ea0('0x45')](_0x5d0a0a);})[_0x2ea0('0x28')](function(_0x83f07d){_0x24a07f['rows']=_0x83f07d;return _0x24a07f;})[_0x2ea0('0x28')](respondWithFilteredResult(_0x53a105,_0x5d0a0a))[_0x2ea0('0x46')](handleError(_0x53a105,null));};exports[_0x2ea0('0x47')]=function(_0x16bab6,_0x2f8085){var _0x3f53af={'raw':!![],'where':{'id':_0x16bab6[_0x2ea0('0x48')]['id']}},_0x3eea46={};_0x3eea46[_0x2ea0('0x36')]=_['keys'](db['SmsQueueReport'][_0x2ea0('0x2e')]);_0x3eea46[_0x2ea0('0x31')]=_[_0x2ea0('0x32')](_0x16bab6[_0x2ea0('0x31')]);_0x3eea46[_0x2ea0('0x33')]=_[_0x2ea0('0x34')](_0x3eea46[_0x2ea0('0x36')],_0x3eea46[_0x2ea0('0x31')]);_0x3f53af['attributes']=_['intersection'](_0x3eea46[_0x2ea0('0x36')],qs[_0x2ea0('0x37')](_0x16bab6['query']['fields']));_0x3f53af[_0x2ea0('0x35')]=_0x3f53af[_0x2ea0('0x35')]['length']?_0x3f53af['attributes']:_0x3eea46['model'];if(_0x16bab6[_0x2ea0('0x31')]['includeAll']){_0x3f53af[_0x2ea0('0x44')]=[{'all':!![]}];}_0x3f53af=_[_0x2ea0('0x40')]({},_0x3f53af,_0x16bab6[_0x2ea0('0x41')]);return db['SmsQueueReport'][_0x2ea0('0x49')](_0x3f53af)[_0x2ea0('0x28')](handleEntityNotFound(_0x2f8085,null))['then'](respondWithResult(_0x2f8085,null))[_0x2ea0('0x46')](handleError(_0x2f8085,null));};exports[_0x2ea0('0x4a')]=function(_0x44f26b,_0x2c641b){return db['SmsQueueReport'][_0x2ea0('0x4a')](_0x44f26b[_0x2ea0('0x4b')],{})[_0x2ea0('0x28')](respondWithResult(_0x2c641b,0xc9))[_0x2ea0('0x46')](handleError(_0x2c641b,null));};exports[_0x2ea0('0x27')]=function(_0x161bee,_0x26a772){if(_0x161bee['body']['id']){delete _0x161bee[_0x2ea0('0x4b')]['id'];}return db[_0x2ea0('0x42')]['find']({'where':{'id':_0x161bee[_0x2ea0('0x48')]['id']}})[_0x2ea0('0x28')](handleEntityNotFound(_0x26a772,null))[_0x2ea0('0x28')](saveUpdates(_0x161bee[_0x2ea0('0x4b')],null))[_0x2ea0('0x28')](respondWithResult(_0x26a772,null))[_0x2ea0('0x46')](handleError(_0x26a772,null));};exports[_0x2ea0('0x29')]=function(_0x38e14f,_0x3083d2){return db[_0x2ea0('0x42')][_0x2ea0('0x49')]({'where':{'id':_0x38e14f[_0x2ea0('0x48')]['id']}})[_0x2ea0('0x28')](handleEntityNotFound(_0x3083d2,null))['then'](removeEntity(_0x3083d2,null))[_0x2ea0('0x46')](handleError(_0x3083d2,null));};exports[_0x2ea0('0x4c')]=function(_0x29bc6c,_0x42f738){return db[_0x2ea0('0x42')][_0x2ea0('0x4c')]()[_0x2ea0('0x28')](respondWithResult(_0x42f738,null))[_0x2ea0('0x46')](handleError(_0x42f738,null));}; \ No newline at end of file +var _0x97cb=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send','SmsQueueReport','rawAttributes','fieldName','type','map','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','rows','show','length','catch','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis'];(function(_0x1480ab,_0x219a96){var _0x3ac72f=function(_0x5923c8){while(--_0x5923c8){_0x1480ab['push'](_0x1480ab['shift']());}};_0x3ac72f(++_0x219a96);}(_0x97cb,0x125));var _0xb97c=function(_0x19c60e,_0x5f31a5){_0x19c60e=_0x19c60e-0x0;var _0x476274=_0x97cb[_0x19c60e];return _0x476274;};'use strict';var emlformat=require(_0xb97c('0x0'));var rimraf=require(_0xb97c('0x1'));var zipdir=require(_0xb97c('0x2'));var jsonpatch=require(_0xb97c('0x3'));var rp=require('request-promise');var moment=require(_0xb97c('0x4'));var BPromise=require(_0xb97c('0x5'));var Mustache=require(_0xb97c('0x6'));var util=require('util');var path=require(_0xb97c('0x7'));var sox=require(_0xb97c('0x8'));var csv=require(_0xb97c('0x9'));var ejs=require(_0xb97c('0xa'));var fs=require('fs');var fs_extra=require(_0xb97c('0xb'));var _=require(_0xb97c('0xc'));var squel=require(_0xb97c('0xd'));var crypto=require(_0xb97c('0xe'));var jsforce=require(_0xb97c('0xf'));var deskjs=require(_0xb97c('0x10'));var toCsv=require(_0xb97c('0x9'));var querystring=require('querystring');var Papa=require(_0xb97c('0x11'));var Redis=require(_0xb97c('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb97c('0x13'));var as=require(_0xb97c('0x14'));var hardwareService=require(_0xb97c('0x15'));var logger=require(_0xb97c('0x16'))(_0xb97c('0x17'));var utils=require(_0xb97c('0x18'));var config=require(_0xb97c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xb97c('0x1a'))['db'];function respondWithStatusCode(_0x1f61b3,_0x468d43){_0x468d43=_0x468d43||0xcc;return function(_0x5b2f22){if(_0x5b2f22){return _0x1f61b3[_0xb97c('0x1b')](_0x468d43);}return _0x1f61b3[_0xb97c('0x1c')](_0x468d43)[_0xb97c('0x1d')]();};}function respondWithResult(_0x559ff8,_0x46dc44){_0x46dc44=_0x46dc44||0xc8;return function(_0x1a0de3){if(_0x1a0de3){return _0x559ff8[_0xb97c('0x1c')](_0x46dc44)[_0xb97c('0x1e')](_0x1a0de3);}};}function respondWithFilteredResult(_0x12d214,_0x29e2a4){return function(_0x1f8839){if(_0x1f8839){var _0xa6606d=typeof _0x29e2a4['offset']===_0xb97c('0x1f')&&typeof _0x29e2a4['limit']===_0xb97c('0x1f');var _0x448fcd=_0x1f8839[_0xb97c('0x20')];var _0x1de949=_0xa6606d?0x0:_0x29e2a4[_0xb97c('0x21')];var _0x443e92=_0xa6606d?_0x1f8839[_0xb97c('0x20')]:_0x29e2a4[_0xb97c('0x21')]+_0x29e2a4[_0xb97c('0x22')];var _0x376659;if(_0x443e92>=_0x448fcd){_0x443e92=_0x448fcd;_0x376659=0xc8;}else{_0x376659=0xce;}_0x12d214[_0xb97c('0x1c')](_0x376659);return _0x12d214[_0xb97c('0x23')](_0xb97c('0x24'),_0x1de949+'-'+_0x443e92+'/'+_0x448fcd)['json'](_0x1f8839);}return null;};}function patchUpdates(_0x363152){return function(_0xcdb787){try{jsonpatch[_0xb97c('0x25')](_0xcdb787,_0x363152,!![]);}catch(_0xd13aa8){return BPromise['reject'](_0xd13aa8);}return _0xcdb787[_0xb97c('0x26')]();};}function saveUpdates(_0x6876cc,_0x26c5ab){return function(_0x369fcd){if(_0x369fcd){return _0x369fcd[_0xb97c('0x27')](_0x6876cc)['then'](function(_0x4194d1){return _0x4194d1;});}return null;};}function removeEntity(_0x527f66,_0x108745){return function(_0x15eaf5){if(_0x15eaf5){return _0x15eaf5[_0xb97c('0x28')]()[_0xb97c('0x29')](function(){_0x527f66[_0xb97c('0x1c')](0xcc)[_0xb97c('0x1d')]();});}};}function handleEntityNotFound(_0x3fda7a,_0x245787){return function(_0x4b1226){if(!_0x4b1226){_0x3fda7a[_0xb97c('0x1b')](0x194);}return _0x4b1226;};}function handleError(_0x1733fd,_0x1ee31d){_0x1ee31d=_0x1ee31d||0x1f4;return function(_0x1b4512){logger[_0xb97c('0x2a')](_0x1b4512[_0xb97c('0x2b')]);if(_0x1b4512[_0xb97c('0x2c')]){delete _0x1b4512[_0xb97c('0x2c')];}_0x1733fd[_0xb97c('0x1c')](_0x1ee31d)[_0xb97c('0x2d')](_0x1b4512);};}exports['index']=function(_0x92c0b4,_0x2509a3){var _0x112642={},_0xaa7de3={},_0x2c0cdd={'count':0x0,'rows':[]};var _0x3233d8=_['map'](db[_0xb97c('0x2e')][_0xb97c('0x2f')],function(_0x17e365){return{'name':_0x17e365[_0xb97c('0x30')],'type':_0x17e365[_0xb97c('0x31')]['key']};});_0xaa7de3['model']=_[_0xb97c('0x32')](_0x3233d8,_0xb97c('0x2c'));_0xaa7de3['query']=_[_0xb97c('0x33')](_0x92c0b4[_0xb97c('0x34')]);_0xaa7de3[_0xb97c('0x35')]=_[_0xb97c('0x36')](_0xaa7de3[_0xb97c('0x37')],_0xaa7de3[_0xb97c('0x34')]);_0x112642['attributes']=_[_0xb97c('0x36')](_0xaa7de3[_0xb97c('0x37')],qs[_0xb97c('0x38')](_0x92c0b4[_0xb97c('0x34')][_0xb97c('0x38')]));_0x112642['attributes']=_0x112642[_0xb97c('0x39')]['length']?_0x112642['attributes']:_0xaa7de3[_0xb97c('0x37')];if(!_0x92c0b4[_0xb97c('0x34')][_0xb97c('0x3a')](_0xb97c('0x3b'))){_0x112642[_0xb97c('0x22')]=qs['limit'](_0x92c0b4[_0xb97c('0x34')][_0xb97c('0x22')]);_0x112642[_0xb97c('0x21')]=qs[_0xb97c('0x21')](_0x92c0b4['query'][_0xb97c('0x21')]);}_0x112642[_0xb97c('0x3c')]=qs['sort'](_0x92c0b4[_0xb97c('0x34')][_0xb97c('0x3d')]);_0x112642[_0xb97c('0x3e')]=qs[_0xb97c('0x35')](_[_0xb97c('0x3f')](_0x92c0b4[_0xb97c('0x34')],_0xaa7de3[_0xb97c('0x35')]),_0x3233d8);if(_0x92c0b4[_0xb97c('0x34')]['filter']){_0x112642['where']=_[_0xb97c('0x40')](_0x112642[_0xb97c('0x3e')],{'$or':_[_0xb97c('0x32')](_0x3233d8,function(_0x21adda){if(_0x21adda[_0xb97c('0x31')]!==_0xb97c('0x41')){var _0x5a1956={};_0x5a1956[_0x21adda[_0xb97c('0x2c')]]={'$like':'%'+_0x92c0b4[_0xb97c('0x34')][_0xb97c('0x42')]+'%'};return _0x5a1956;}})});}_0x112642=_[_0xb97c('0x40')]({},_0x112642,_0x92c0b4[_0xb97c('0x43')]);var _0x25f449={'where':_0x112642['where']};return db[_0xb97c('0x2e')]['count'](_0x25f449)[_0xb97c('0x29')](function(_0xb7adcd){_0x2c0cdd[_0xb97c('0x20')]=_0xb7adcd;if(_0x92c0b4[_0xb97c('0x34')][_0xb97c('0x44')]){_0x112642['include']=[{'all':!![]}];}return db[_0xb97c('0x2e')]['findAll'](_0x112642);})[_0xb97c('0x29')](function(_0x225364){_0x2c0cdd[_0xb97c('0x45')]=_0x225364;return _0x2c0cdd;})[_0xb97c('0x29')](respondWithFilteredResult(_0x2509a3,_0x112642))['catch'](handleError(_0x2509a3,null));};exports[_0xb97c('0x46')]=function(_0x3b32bf,_0x49488c){var _0x49e9da={'raw':!![],'where':{'id':_0x3b32bf['params']['id']}},_0x56d5e9={};_0x56d5e9[_0xb97c('0x37')]=_[_0xb97c('0x33')](db['SmsQueueReport'][_0xb97c('0x2f')]);_0x56d5e9[_0xb97c('0x34')]=_[_0xb97c('0x33')](_0x3b32bf[_0xb97c('0x34')]);_0x56d5e9[_0xb97c('0x35')]=_['intersection'](_0x56d5e9[_0xb97c('0x37')],_0x56d5e9[_0xb97c('0x34')]);_0x49e9da[_0xb97c('0x39')]=_[_0xb97c('0x36')](_0x56d5e9['model'],qs[_0xb97c('0x38')](_0x3b32bf['query'][_0xb97c('0x38')]));_0x49e9da[_0xb97c('0x39')]=_0x49e9da[_0xb97c('0x39')][_0xb97c('0x47')]?_0x49e9da['attributes']:_0x56d5e9['model'];if(_0x3b32bf['query'][_0xb97c('0x44')]){_0x49e9da['include']=[{'all':!![]}];}_0x49e9da=_['merge']({},_0x49e9da,_0x3b32bf['options']);return db[_0xb97c('0x2e')]['find'](_0x49e9da)[_0xb97c('0x29')](handleEntityNotFound(_0x49488c,null))[_0xb97c('0x29')](respondWithResult(_0x49488c,null))[_0xb97c('0x48')](handleError(_0x49488c,null));};exports[_0xb97c('0x49')]=function(_0x19368b,_0x56604c){return db[_0xb97c('0x2e')][_0xb97c('0x49')](_0x19368b[_0xb97c('0x4a')],{})[_0xb97c('0x29')](respondWithResult(_0x56604c,0xc9))[_0xb97c('0x48')](handleError(_0x56604c,null));};exports[_0xb97c('0x27')]=function(_0x166696,_0x23384c){if(_0x166696['body']['id']){delete _0x166696['body']['id'];}return db[_0xb97c('0x2e')][_0xb97c('0x4b')]({'where':{'id':_0x166696[_0xb97c('0x4c')]['id']}})[_0xb97c('0x29')](handleEntityNotFound(_0x23384c,null))[_0xb97c('0x29')](saveUpdates(_0x166696[_0xb97c('0x4a')],null))[_0xb97c('0x29')](respondWithResult(_0x23384c,null))[_0xb97c('0x48')](handleError(_0x23384c,null));};exports[_0xb97c('0x28')]=function(_0x30e0a5,_0x5eb670){return db[_0xb97c('0x2e')]['find']({'where':{'id':_0x30e0a5[_0xb97c('0x4c')]['id']}})[_0xb97c('0x29')](handleEntityNotFound(_0x5eb670,null))[_0xb97c('0x29')](removeEntity(_0x5eb670,null))[_0xb97c('0x48')](handleError(_0x5eb670,null));};exports[_0xb97c('0x4d')]=function(_0x1c7ced,_0x518316){return db[_0xb97c('0x2e')][_0xb97c('0x4d')]()[_0xb97c('0x29')](respondWithResult(_0x518316,null))[_0xb97c('0x48')](handleError(_0x518316,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index dbc4eb3..bb3e866 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 _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1e944f,_0x59fe91){var _0x20612c=function(_0xe002b4){while(--_0xe002b4){_0x1e944f['push'](_0x1e944f['shift']());}};_0x20612c(++_0x59fe91);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var 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('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4a817e,_0xec3b79){var _0x8b5ae1=function(_0x1c5a2c){while(--_0x1c5a2c){_0x4a817e['push'](_0x4a817e['shift']());}};_0x8b5ae1(++_0xec3b79);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index a820d74..1b741df 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 _0xdebb=['request\x20sent','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','create','body','options','raw','debug','SmsQueueReport','update','where','attributes','limit','UpdateSmsQueueReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s'];(function(_0x283127,_0x54d4d5){var _0x43da5d=function(_0x10947f){while(--_0x10947f){_0x283127['push'](_0x283127['shift']());}};_0x43da5d(++_0x54d4d5);}(_0xdebb,0x14f));var _0xbdeb=function(_0xe539a7,_0x5733d8){_0xe539a7=_0xe539a7-0x0;var _0x3f2233=_0xdebb[_0xe539a7];return _0x3f2233;};'use strict';var _=require(_0xbdeb('0x0'));var util=require(_0xbdeb('0x1'));var moment=require(_0xbdeb('0x2'));var BPromise=require('bluebird');var rs=require(_0xbdeb('0x3'));var fs=require('fs');var Redis=require(_0xbdeb('0x4'));var db=require(_0xbdeb('0x5'))['db'];var utils=require(_0xbdeb('0x6'));var logger=require('../../config/logger')(_0xbdeb('0x7'));var config=require(_0xbdeb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbdeb('0x9')][_0xbdeb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x112a61,_0x140203,_0x178608){return new BPromise(function(_0x44b80a,_0x5dc8ed){return client[_0xbdeb('0xb')](_0x112a61,_0x178608)[_0xbdeb('0xc')](function(_0x53b32b){logger[_0xbdeb('0xd')](_0xbdeb('0xe'),_0x140203,_0xbdeb('0xf'));logger['debug'](_0xbdeb('0x10'),_0x140203,'request\x20sent',JSON[_0xbdeb('0x11')](_0x53b32b));if(_0x53b32b[_0xbdeb('0x12')]){if(_0x53b32b['error'][_0xbdeb('0x13')]===0x1f4){logger[_0xbdeb('0x12')](_0xbdeb('0xe'),_0x140203,_0x53b32b[_0xbdeb('0x12')]['message']);return _0x5dc8ed(_0x53b32b[_0xbdeb('0x12')][_0xbdeb('0x14')]);}logger[_0xbdeb('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x140203,_0x53b32b[_0xbdeb('0x12')][_0xbdeb('0x14')]);return _0x44b80a(_0x53b32b[_0xbdeb('0x12')][_0xbdeb('0x14')]);}else{logger[_0xbdeb('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x140203,_0xbdeb('0xf'));_0x44b80a(_0x53b32b[_0xbdeb('0x15')][_0xbdeb('0x14')]);}})[_0xbdeb('0x16')](function(_0x56c49e){logger['error'](_0xbdeb('0xe'),_0x140203,_0x56c49e);_0x5dc8ed(_0x56c49e);});});}exports[_0xbdeb('0x17')]=function(_0x2ee33c){var _0x3af4cf=this;return new Promise(function(_0x26f5c8,_0x4489cc){return db['SmsQueueReport'][_0xbdeb('0x18')](_0x2ee33c[_0xbdeb('0x19')],{'raw':_0x2ee33c[_0xbdeb('0x1a')]?_0x2ee33c[_0xbdeb('0x1a')][_0xbdeb('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x5f1eae){logger[_0xbdeb('0xd')](_0xbdeb('0x17'),_0x2ee33c);logger[_0xbdeb('0x1c')](_0xbdeb('0x17'),_0x2ee33c,JSON['stringify'](_0x5f1eae));_0x26f5c8(_0x5f1eae);})[_0xbdeb('0x16')](function(_0x4b994e){logger[_0xbdeb('0x12')]('CreateSmsQueueReport',_0x4b994e[_0xbdeb('0x14')],_0x2ee33c);_0x4489cc(_0x3af4cf[_0xbdeb('0x12')](0x1f4,_0x4b994e[_0xbdeb('0x14')]));});});};exports['UpdateSmsQueueReport']=function(_0x302f6c){var _0x349d55=this;return new Promise(function(_0x41bf16,_0x1b903b){return db[_0xbdeb('0x1d')][_0xbdeb('0x1e')](_0x302f6c['body'],{'raw':_0x302f6c['options']?_0x302f6c[_0xbdeb('0x1a')][_0xbdeb('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x302f6c[_0xbdeb('0x1a')]?_0x302f6c[_0xbdeb('0x1a')][_0xbdeb('0x1f')]||null:null,'attributes':_0x302f6c[_0xbdeb('0x1a')]?_0x302f6c['options'][_0xbdeb('0x20')]||null:null,'limit':_0x302f6c['options']?_0x302f6c[_0xbdeb('0x1a')][_0xbdeb('0x21')]||null:null})[_0xbdeb('0xc')](function(_0x38e937){logger[_0xbdeb('0xd')]('UpdateSmsQueueReport',_0x302f6c);logger[_0xbdeb('0x1c')](_0xbdeb('0x22'),_0x302f6c,JSON['stringify'](_0x38e937));_0x41bf16(_0x38e937);})[_0xbdeb('0x16')](function(_0x50cf86){logger[_0xbdeb('0x12')](_0xbdeb('0x22'),_0x50cf86[_0xbdeb('0x14')],_0x302f6c);_0x1b903b(_0x349d55[_0xbdeb('0x12')](0x1f4,_0x50cf86[_0xbdeb('0x14')]));});});}; \ No newline at end of file +var _0x1448=['body','options','UpdateSmsQueueReport','update','where','limit','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create'];(function(_0x38e656,_0x21bcb0){var _0x411375=function(_0x1582c3){while(--_0x1582c3){_0x38e656['push'](_0x38e656['shift']());}};_0x411375(++_0x21bcb0);}(_0x1448,0x1c6));var _0x8144=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1448[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8144('0x0'));var BPromise=require('bluebird');var rs=require(_0x8144('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8144('0x2'))['db'];var utils=require(_0x8144('0x3'));var logger=require('../../config/logger')(_0x8144('0x4'));var config=require('../../config/environment');var jayson=require(_0x8144('0x5'));var client=jayson['client'][_0x8144('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1614de,_0x3bd8e5,_0x9a4e5a){return new BPromise(function(_0x5b2b41,_0x14d4b0){return client[_0x8144('0x7')](_0x1614de,_0x9a4e5a)[_0x8144('0x8')](function(_0x5ce362){logger[_0x8144('0x9')](_0x8144('0xa'),_0x3bd8e5,_0x8144('0xb'));logger[_0x8144('0xc')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x3bd8e5,'request\x20sent',JSON[_0x8144('0xd')](_0x5ce362));if(_0x5ce362[_0x8144('0xe')]){if(_0x5ce362[_0x8144('0xe')][_0x8144('0xf')]===0x1f4){logger[_0x8144('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x3bd8e5,_0x5ce362['error'][_0x8144('0x10')]);return _0x14d4b0(_0x5ce362['error'][_0x8144('0x10')]);}logger[_0x8144('0xe')](_0x8144('0xa'),_0x3bd8e5,_0x5ce362[_0x8144('0xe')][_0x8144('0x10')]);return _0x5b2b41(_0x5ce362[_0x8144('0xe')][_0x8144('0x10')]);}else{logger['info'](_0x8144('0xa'),_0x3bd8e5,'request\x20sent');_0x5b2b41(_0x5ce362[_0x8144('0x11')][_0x8144('0x10')]);}})[_0x8144('0x12')](function(_0x322e84){logger['error'](_0x8144('0xa'),_0x3bd8e5,_0x322e84);_0x14d4b0(_0x322e84);});});}exports[_0x8144('0x13')]=function(_0x1f2eae){var _0xfe6e06=this;return new Promise(function(_0x143a28,_0xd6ee48){return db[_0x8144('0x14')][_0x8144('0x15')](_0x1f2eae[_0x8144('0x16')],{'raw':_0x1f2eae[_0x8144('0x17')]?_0x1f2eae[_0x8144('0x17')]['raw']===undefined?!![]:![]:!![]})[_0x8144('0x8')](function(_0x21a6c5){logger[_0x8144('0x9')](_0x8144('0x13'),_0x1f2eae);logger[_0x8144('0xc')]('CreateSmsQueueReport',_0x1f2eae,JSON[_0x8144('0xd')](_0x21a6c5));_0x143a28(_0x21a6c5);})['catch'](function(_0x1842c7){logger['error'](_0x8144('0x13'),_0x1842c7[_0x8144('0x10')],_0x1f2eae);_0xd6ee48(_0xfe6e06[_0x8144('0xe')](0x1f4,_0x1842c7[_0x8144('0x10')]));});});};exports[_0x8144('0x18')]=function(_0x3b70e3){var _0x5b99f9=this;return new Promise(function(_0x130550,_0x23b268){return db['SmsQueueReport'][_0x8144('0x19')](_0x3b70e3['body'],{'raw':_0x3b70e3['options']?_0x3b70e3[_0x8144('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b70e3[_0x8144('0x17')]?_0x3b70e3[_0x8144('0x17')][_0x8144('0x1a')]||null:null,'attributes':_0x3b70e3[_0x8144('0x17')]?_0x3b70e3[_0x8144('0x17')]['attributes']||null:null,'limit':_0x3b70e3['options']?_0x3b70e3[_0x8144('0x17')][_0x8144('0x1b')]||null:null})[_0x8144('0x8')](function(_0x363848){logger['info'](_0x8144('0x18'),_0x3b70e3);logger[_0x8144('0xc')](_0x8144('0x18'),_0x3b70e3,JSON[_0x8144('0xd')](_0x363848));_0x130550(_0x363848);})[_0x8144('0x12')](function(_0x29178a){logger[_0x8144('0xe')](_0x8144('0x18'),_0x29178a['message'],_0x3b70e3);_0x23b268(_0x5b99f9[_0x8144('0xe')](0x1f4,_0x29178a[_0x8144('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 60ee3b4..5c2814c 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 _0x446c=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','describe','get','/:id','post','create','put','update','delete'];(function(_0x50b63c,_0x690d99){var _0x258408=function(_0x57d169){while(--_0x57d169){_0x50b63c['push'](_0x50b63c['shift']());}};_0x258408(++_0x690d99);}(_0x446c,0x156));var _0xc446=function(_0x219fa0,_0x18b239){_0x219fa0=_0x219fa0-0x0;var _0xc603fb=_0x446c[_0x219fa0];return _0xc603fb;};'use strict';var multer=require(_0xc446('0x0'));var util=require(_0xc446('0x1'));var path=require(_0xc446('0x2'));var timeout=require(_0xc446('0x3'));var express=require('express');var router=express[_0xc446('0x4')]();var fs_extra=require(_0xc446('0x5'));var auth=require(_0xc446('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc446('0x7'));var controller=require('./smsTransferReport.controller');router['get']('/',auth[_0xc446('0x8')](),controller[_0xc446('0x9')]);router['get']('/describe',auth[_0xc446('0x8')](),controller[_0xc446('0xa')]);router[_0xc446('0xb')](_0xc446('0xc'),auth[_0xc446('0x8')](),controller['show']);router[_0xc446('0xd')]('/',auth[_0xc446('0x8')](),controller[_0xc446('0xe')]);router[_0xc446('0xf')]('/:id',auth[_0xc446('0x8')](),controller[_0xc446('0x10')]);router[_0xc446('0x11')](_0xc446('0xc'),auth[_0xc446('0x8')](),controller[_0xc446('0x12')]);module[_0xc446('0x13')]=router; \ No newline at end of file +var _0xe015=['../../components/interaction/service','../../config/environment','./smsTransferReport.controller','isAuthenticated','index','describe','get','/:id','show','put','update','multer','util','path','Router','../../components/auth/service'];(function(_0x5de930,_0x549653){var _0x26972c=function(_0x4dcc8f){while(--_0x4dcc8f){_0x5de930['push'](_0x5de930['shift']());}};_0x26972c(++_0x549653);}(_0xe015,0x13b));var _0x5e01=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe015[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x5e01('0x0'));var util=require(_0x5e01('0x1'));var path=require(_0x5e01('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x5e01('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5e01('0x4'));var interaction=require(_0x5e01('0x5'));var config=require(_0x5e01('0x6'));var controller=require(_0x5e01('0x7'));router['get']('/',auth[_0x5e01('0x8')](),controller[_0x5e01('0x9')]);router['get']('/describe',auth[_0x5e01('0x8')](),controller[_0x5e01('0xa')]);router[_0x5e01('0xb')](_0x5e01('0xc'),auth[_0x5e01('0x8')](),controller[_0x5e01('0xd')]);router['post']('/',auth[_0x5e01('0x8')](),controller['create']);router[_0x5e01('0xe')]('/:id',auth[_0x5e01('0x8')](),controller[_0x5e01('0xf')]);router['delete'](_0x5e01('0xc'),auth[_0x5e01('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 4cf5721..f49cb49 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x24b852,_0x2bad67){var _0x180ad2=function(_0x454562){while(--_0x454562){_0x24b852['push'](_0x24b852['shift']());}};_0x180ad2(++_0x2bad67);}(_0x008c,0x188));var _0xc008=function(_0xc67084,_0x3e2efc){_0xc67084=_0xc67084-0x0;var _0x4d06c6=_0x008c[_0xc67084];return _0x4d06c6;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x4f83ca,_0x46f67a){var _0x1fbac3=function(_0x19e401){while(--_0x19e401){_0x4f83ca['push'](_0x4f83ca['shift']());}};_0x1fbac3(++_0x46f67a);}(_0x34e8,0x12c));var _0x834e=function(_0x559a84,_0xf84a16){_0x559a84=_0x559a84-0x0;var _0x26034c=_0x34e8[_0x559a84];return _0x26034c;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 11e83f0..4e0ac74 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 _0xae0f=['sendStatus','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xae0f,0xbc));var _0xfae0=function(_0x584892,_0x3c53bf){_0x584892=_0x584892-0x0;var _0x210ce2=_0xae0f[_0x584892];return _0x210ce2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfae0('0x0'));var zipdir=require(_0xfae0('0x1'));var jsonpatch=require(_0xfae0('0x2'));var rp=require(_0xfae0('0x3'));var moment=require(_0xfae0('0x4'));var BPromise=require(_0xfae0('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xfae0('0x6'));var ejs=require(_0xfae0('0x7'));var fs=require('fs');var fs_extra=require(_0xfae0('0x8'));var _=require(_0xfae0('0x9'));var squel=require(_0xfae0('0xa'));var crypto=require('crypto');var jsforce=require(_0xfae0('0xb'));var deskjs=require(_0xfae0('0xc'));var toCsv=require('to-csv');var querystring=require(_0xfae0('0xd'));var Papa=require(_0xfae0('0xe'));var Redis=require('ioredis');var authService=require(_0xfae0('0xf'));var qs=require(_0xfae0('0x10'));var as=require(_0xfae0('0x11'));var hardwareService=require(_0xfae0('0x12'));var logger=require(_0xfae0('0x13'))(_0xfae0('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfae0('0x15'));var db=require(_0xfae0('0x16'))['db'];function respondWithStatusCode(_0x498145,_0x1c100a){_0x1c100a=_0x1c100a||0xcc;return function(_0x26c7bd){if(_0x26c7bd){return _0x498145['sendStatus'](_0x1c100a);}return _0x498145['status'](_0x1c100a)[_0xfae0('0x17')]();};}function respondWithResult(_0x26a7ef,_0x39535f){_0x39535f=_0x39535f||0xc8;return function(_0x23c393){if(_0x23c393){return _0x26a7ef[_0xfae0('0x18')](_0x39535f)[_0xfae0('0x19')](_0x23c393);}};}function respondWithFilteredResult(_0x484f5c,_0x442cd6){return function(_0x293fee){if(_0x293fee){var _0x329514=typeof _0x442cd6[_0xfae0('0x1a')]===_0xfae0('0x1b')&&typeof _0x442cd6[_0xfae0('0x1c')]==='undefined';var _0x2ccdd8=_0x293fee[_0xfae0('0x1d')];var _0xaeb197=_0x329514?0x0:_0x442cd6[_0xfae0('0x1a')];var _0x11080b=_0x329514?_0x293fee['count']:_0x442cd6[_0xfae0('0x1a')]+_0x442cd6[_0xfae0('0x1c')];var _0x24498b;if(_0x11080b>=_0x2ccdd8){_0x11080b=_0x2ccdd8;_0x24498b=0xc8;}else{_0x24498b=0xce;}_0x484f5c[_0xfae0('0x18')](_0x24498b);return _0x484f5c[_0xfae0('0x1e')](_0xfae0('0x1f'),_0xaeb197+'-'+_0x11080b+'/'+_0x2ccdd8)[_0xfae0('0x19')](_0x293fee);}return null;};}function patchUpdates(_0x1e99f1){return function(_0x52992f){try{jsonpatch[_0xfae0('0x20')](_0x52992f,_0x1e99f1,!![]);}catch(_0x2ba164){return BPromise[_0xfae0('0x21')](_0x2ba164);}return _0x52992f['save']();};}function saveUpdates(_0x1d3a04,_0x214faa){return function(_0x28d673){if(_0x28d673){return _0x28d673[_0xfae0('0x22')](_0x1d3a04)['then'](function(_0x5a3493){return _0x5a3493;});}return null;};}function removeEntity(_0x19903a,_0x569a83){return function(_0x2faad2){if(_0x2faad2){return _0x2faad2[_0xfae0('0x23')]()[_0xfae0('0x24')](function(){_0x19903a[_0xfae0('0x18')](0xcc)[_0xfae0('0x17')]();});}};}function handleEntityNotFound(_0x472cde,_0x21f02c){return function(_0x3d611f){if(!_0x3d611f){_0x472cde[_0xfae0('0x25')](0x194);}return _0x3d611f;};}function handleError(_0x3775fb,_0x37aa01){_0x37aa01=_0x37aa01||0x1f4;return function(_0x48feba){logger[_0xfae0('0x26')](_0x48feba[_0xfae0('0x27')]);if(_0x48feba[_0xfae0('0x28')]){delete _0x48feba[_0xfae0('0x28')];}_0x3775fb[_0xfae0('0x18')](_0x37aa01)[_0xfae0('0x29')](_0x48feba);};}exports[_0xfae0('0x2a')]=function(_0x3e10cc,_0x1951a1){var _0x1aab6c={},_0x27755c={},_0x551281={'count':0x0,'rows':[]};var _0x142c0b=_[_0xfae0('0x2b')](db[_0xfae0('0x2c')][_0xfae0('0x2d')],function(_0x6ad10e){return{'name':_0x6ad10e[_0xfae0('0x2e')],'type':_0x6ad10e[_0xfae0('0x2f')][_0xfae0('0x30')]};});_0x27755c['model']=_[_0xfae0('0x2b')](_0x142c0b,_0xfae0('0x28'));_0x27755c[_0xfae0('0x31')]=_['keys'](_0x3e10cc['query']);_0x27755c[_0xfae0('0x32')]=_[_0xfae0('0x33')](_0x27755c[_0xfae0('0x34')],_0x27755c[_0xfae0('0x31')]);_0x1aab6c[_0xfae0('0x35')]=_[_0xfae0('0x33')](_0x27755c[_0xfae0('0x34')],qs[_0xfae0('0x36')](_0x3e10cc[_0xfae0('0x31')][_0xfae0('0x36')]));_0x1aab6c[_0xfae0('0x35')]=_0x1aab6c[_0xfae0('0x35')][_0xfae0('0x37')]?_0x1aab6c[_0xfae0('0x35')]:_0x27755c[_0xfae0('0x34')];if(!_0x3e10cc[_0xfae0('0x31')][_0xfae0('0x38')]('nolimit')){_0x1aab6c[_0xfae0('0x1c')]=qs['limit'](_0x3e10cc[_0xfae0('0x31')]['limit']);_0x1aab6c[_0xfae0('0x1a')]=qs[_0xfae0('0x1a')](_0x3e10cc[_0xfae0('0x31')][_0xfae0('0x1a')]);}_0x1aab6c[_0xfae0('0x39')]=qs[_0xfae0('0x3a')](_0x3e10cc['query'][_0xfae0('0x3a')]);_0x1aab6c[_0xfae0('0x3b')]=qs[_0xfae0('0x32')](_[_0xfae0('0x3c')](_0x3e10cc[_0xfae0('0x31')],_0x27755c[_0xfae0('0x32')]),_0x142c0b);if(_0x3e10cc['query'][_0xfae0('0x3d')]){_0x1aab6c[_0xfae0('0x3b')]=_[_0xfae0('0x3e')](_0x1aab6c[_0xfae0('0x3b')],{'$or':_[_0xfae0('0x2b')](_0x142c0b,function(_0x477770){if(_0x477770['type']!=='VIRTUAL'){var _0x3a5535={};_0x3a5535[_0x477770[_0xfae0('0x28')]]={'$like':'%'+_0x3e10cc['query'][_0xfae0('0x3d')]+'%'};return _0x3a5535;}})});}_0x1aab6c=_[_0xfae0('0x3e')]({},_0x1aab6c,_0x3e10cc[_0xfae0('0x3f')]);var _0x2c0de0={'where':_0x1aab6c[_0xfae0('0x3b')]};return db[_0xfae0('0x2c')][_0xfae0('0x1d')](_0x2c0de0)[_0xfae0('0x24')](function(_0x21c3a8){_0x551281[_0xfae0('0x1d')]=_0x21c3a8;if(_0x3e10cc[_0xfae0('0x31')]['includeAll']){_0x1aab6c[_0xfae0('0x40')]=[{'all':!![]}];}return db[_0xfae0('0x2c')][_0xfae0('0x41')](_0x1aab6c);})[_0xfae0('0x24')](function(_0xa9e27c){_0x551281[_0xfae0('0x42')]=_0xa9e27c;return _0x551281;})[_0xfae0('0x24')](respondWithFilteredResult(_0x1951a1,_0x1aab6c))[_0xfae0('0x43')](handleError(_0x1951a1,null));};exports[_0xfae0('0x44')]=function(_0x29da7e,_0x419949){var _0x18eb37={'raw':!![],'where':{'id':_0x29da7e[_0xfae0('0x45')]['id']}},_0xfcf69a={};_0xfcf69a[_0xfae0('0x34')]=_[_0xfae0('0x46')](db[_0xfae0('0x2c')]['rawAttributes']);_0xfcf69a['query']=_[_0xfae0('0x46')](_0x29da7e[_0xfae0('0x31')]);_0xfcf69a['filters']=_[_0xfae0('0x33')](_0xfcf69a[_0xfae0('0x34')],_0xfcf69a[_0xfae0('0x31')]);_0x18eb37[_0xfae0('0x35')]=_[_0xfae0('0x33')](_0xfcf69a[_0xfae0('0x34')],qs[_0xfae0('0x36')](_0x29da7e[_0xfae0('0x31')]['fields']));_0x18eb37['attributes']=_0x18eb37[_0xfae0('0x35')][_0xfae0('0x37')]?_0x18eb37[_0xfae0('0x35')]:_0xfcf69a[_0xfae0('0x34')];if(_0x29da7e[_0xfae0('0x31')]['includeAll']){_0x18eb37[_0xfae0('0x40')]=[{'all':!![]}];}_0x18eb37=_[_0xfae0('0x3e')]({},_0x18eb37,_0x29da7e[_0xfae0('0x3f')]);return db['SmsTransferReport'][_0xfae0('0x47')](_0x18eb37)['then'](handleEntityNotFound(_0x419949,null))[_0xfae0('0x24')](respondWithResult(_0x419949,null))[_0xfae0('0x43')](handleError(_0x419949,null));};exports[_0xfae0('0x48')]=function(_0x46e1e4,_0x2b61f9){return db[_0xfae0('0x2c')][_0xfae0('0x48')](_0x46e1e4['body'],{})[_0xfae0('0x24')](respondWithResult(_0x2b61f9,0xc9))[_0xfae0('0x43')](handleError(_0x2b61f9,null));};exports[_0xfae0('0x22')]=function(_0x1f4834,_0x2d2ee5){if(_0x1f4834[_0xfae0('0x49')]['id']){delete _0x1f4834[_0xfae0('0x49')]['id'];}return db[_0xfae0('0x2c')]['find']({'where':{'id':_0x1f4834[_0xfae0('0x45')]['id']}})[_0xfae0('0x24')](handleEntityNotFound(_0x2d2ee5,null))[_0xfae0('0x24')](saveUpdates(_0x1f4834[_0xfae0('0x49')],null))['then'](respondWithResult(_0x2d2ee5,null))[_0xfae0('0x43')](handleError(_0x2d2ee5,null));};exports['destroy']=function(_0xe089dc,_0x19f419){return db['SmsTransferReport'][_0xfae0('0x47')]({'where':{'id':_0xe089dc[_0xfae0('0x45')]['id']}})[_0xfae0('0x24')](handleEntityNotFound(_0x19f419,null))[_0xfae0('0x24')](removeEntity(_0x19f419,null))[_0xfae0('0x43')](handleError(_0x19f419,null));};exports[_0xfae0('0x4a')]=function(_0x28abf3,_0x5621fd){return db['SmsTransferReport'][_0xfae0('0x4a')]()['then'](respondWithResult(_0x5621fd,null))['catch'](handleError(_0x5621fd,null));}; \ No newline at end of file +var _0x5048=['catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','nolimit','sort','pick','filter','where','merge','VIRTUAL','SmsTransferReport','includeAll','include','findAll','rows','params','keys','length','options','find'];(function(_0x527f33,_0x12b632){var _0x2bdabd=function(_0x410d55){while(--_0x410d55){_0x527f33['push'](_0x527f33['shift']());}};_0x2bdabd(++_0x12b632);}(_0x5048,0x1d8));var _0x8504=function(_0x2de9a8,_0x160b48){_0x2de9a8=_0x2de9a8-0x0;var _0xbd1ad=_0x5048[_0x2de9a8];return _0xbd1ad;};'use strict';var emlformat=require(_0x8504('0x0'));var rimraf=require(_0x8504('0x1'));var zipdir=require(_0x8504('0x2'));var jsonpatch=require(_0x8504('0x3'));var rp=require(_0x8504('0x4'));var moment=require(_0x8504('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8504('0x6'));var util=require(_0x8504('0x7'));var path=require(_0x8504('0x8'));var sox=require(_0x8504('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8504('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8504('0xb'));var jsforce=require(_0x8504('0xc'));var deskjs=require(_0x8504('0xd'));var toCsv=require(_0x8504('0xe'));var querystring=require(_0x8504('0xf'));var Papa=require(_0x8504('0x10'));var Redis=require(_0x8504('0x11'));var authService=require(_0x8504('0x12'));var qs=require(_0x8504('0x13'));var as=require(_0x8504('0x14'));var hardwareService=require(_0x8504('0x15'));var logger=require(_0x8504('0x16'))(_0x8504('0x17'));var utils=require(_0x8504('0x18'));var config=require(_0x8504('0x19'));var licenseUtil=require(_0x8504('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26d930,_0x431c1a){_0x431c1a=_0x431c1a||0xcc;return function(_0x45cb4a){if(_0x45cb4a){return _0x26d930[_0x8504('0x1b')](_0x431c1a);}return _0x26d930[_0x8504('0x1c')](_0x431c1a)[_0x8504('0x1d')]();};}function respondWithResult(_0x1d1cfd,_0xd99a2f){_0xd99a2f=_0xd99a2f||0xc8;return function(_0x4db8a4){if(_0x4db8a4){return _0x1d1cfd[_0x8504('0x1c')](_0xd99a2f)[_0x8504('0x1e')](_0x4db8a4);}};}function respondWithFilteredResult(_0x16c47e,_0x153a68){return function(_0x5a32fc){if(_0x5a32fc){var _0x389a48=typeof _0x153a68['offset']===_0x8504('0x1f')&&typeof _0x153a68['limit']===_0x8504('0x1f');var _0x30a581=_0x5a32fc[_0x8504('0x20')];var _0x2c39ec=_0x389a48?0x0:_0x153a68[_0x8504('0x21')];var _0x522995=_0x389a48?_0x5a32fc['count']:_0x153a68[_0x8504('0x21')]+_0x153a68[_0x8504('0x22')];var _0x1d58e3;if(_0x522995>=_0x30a581){_0x522995=_0x30a581;_0x1d58e3=0xc8;}else{_0x1d58e3=0xce;}_0x16c47e[_0x8504('0x1c')](_0x1d58e3);return _0x16c47e['set'](_0x8504('0x23'),_0x2c39ec+'-'+_0x522995+'/'+_0x30a581)[_0x8504('0x1e')](_0x5a32fc);}return null;};}function patchUpdates(_0x22e1b0){return function(_0x2a042a){try{jsonpatch[_0x8504('0x24')](_0x2a042a,_0x22e1b0,!![]);}catch(_0x187202){return BPromise[_0x8504('0x25')](_0x187202);}return _0x2a042a[_0x8504('0x26')]();};}function saveUpdates(_0x45247f,_0x104077){return function(_0x31bd84){if(_0x31bd84){return _0x31bd84[_0x8504('0x27')](_0x45247f)['then'](function(_0x3d2217){return _0x3d2217;});}return null;};}function removeEntity(_0x2e1f6a,_0x4a2e3f){return function(_0x4dc719){if(_0x4dc719){return _0x4dc719[_0x8504('0x28')]()[_0x8504('0x29')](function(){_0x2e1f6a[_0x8504('0x1c')](0xcc)[_0x8504('0x1d')]();});}};}function handleEntityNotFound(_0x4fb62a,_0x15606f){return function(_0x322a7d){if(!_0x322a7d){_0x4fb62a[_0x8504('0x1b')](0x194);}return _0x322a7d;};}function handleError(_0x1e95a9,_0x3010cf){_0x3010cf=_0x3010cf||0x1f4;return function(_0x5f9cb8){logger[_0x8504('0x2a')](_0x5f9cb8[_0x8504('0x2b')]);if(_0x5f9cb8[_0x8504('0x2c')]){delete _0x5f9cb8[_0x8504('0x2c')];}_0x1e95a9[_0x8504('0x1c')](_0x3010cf)[_0x8504('0x2d')](_0x5f9cb8);};}exports[_0x8504('0x2e')]=function(_0x42b56c,_0x1f6fa0){var _0x5d3b76={},_0x56ca2e={},_0x306f8e={'count':0x0,'rows':[]};var _0x3cbc67=_[_0x8504('0x2f')](db['SmsTransferReport'][_0x8504('0x30')],function(_0x2b78b6){return{'name':_0x2b78b6[_0x8504('0x31')],'type':_0x2b78b6[_0x8504('0x32')]['key']};});_0x56ca2e[_0x8504('0x33')]=_['map'](_0x3cbc67,_0x8504('0x2c'));_0x56ca2e[_0x8504('0x34')]=_['keys'](_0x42b56c[_0x8504('0x34')]);_0x56ca2e[_0x8504('0x35')]=_['intersection'](_0x56ca2e[_0x8504('0x33')],_0x56ca2e[_0x8504('0x34')]);_0x5d3b76[_0x8504('0x36')]=_[_0x8504('0x37')](_0x56ca2e[_0x8504('0x33')],qs['fields'](_0x42b56c[_0x8504('0x34')][_0x8504('0x38')]));_0x5d3b76[_0x8504('0x36')]=_0x5d3b76['attributes']['length']?_0x5d3b76['attributes']:_0x56ca2e[_0x8504('0x33')];if(!_0x42b56c[_0x8504('0x34')]['hasOwnProperty'](_0x8504('0x39'))){_0x5d3b76[_0x8504('0x22')]=qs[_0x8504('0x22')](_0x42b56c['query']['limit']);_0x5d3b76[_0x8504('0x21')]=qs['offset'](_0x42b56c[_0x8504('0x34')]['offset']);}_0x5d3b76['order']=qs[_0x8504('0x3a')](_0x42b56c[_0x8504('0x34')][_0x8504('0x3a')]);_0x5d3b76['where']=qs[_0x8504('0x35')](_[_0x8504('0x3b')](_0x42b56c[_0x8504('0x34')],_0x56ca2e[_0x8504('0x35')]),_0x3cbc67);if(_0x42b56c['query'][_0x8504('0x3c')]){_0x5d3b76[_0x8504('0x3d')]=_[_0x8504('0x3e')](_0x5d3b76['where'],{'$or':_[_0x8504('0x2f')](_0x3cbc67,function(_0x3c1bda){if(_0x3c1bda[_0x8504('0x32')]!==_0x8504('0x3f')){var _0x34dbb0={};_0x34dbb0[_0x3c1bda[_0x8504('0x2c')]]={'$like':'%'+_0x42b56c[_0x8504('0x34')][_0x8504('0x3c')]+'%'};return _0x34dbb0;}})});}_0x5d3b76=_[_0x8504('0x3e')]({},_0x5d3b76,_0x42b56c['options']);var _0xd01475={'where':_0x5d3b76[_0x8504('0x3d')]};return db[_0x8504('0x40')][_0x8504('0x20')](_0xd01475)['then'](function(_0x383d9f){_0x306f8e['count']=_0x383d9f;if(_0x42b56c[_0x8504('0x34')][_0x8504('0x41')]){_0x5d3b76[_0x8504('0x42')]=[{'all':!![]}];}return db[_0x8504('0x40')][_0x8504('0x43')](_0x5d3b76);})[_0x8504('0x29')](function(_0x1cb582){_0x306f8e[_0x8504('0x44')]=_0x1cb582;return _0x306f8e;})[_0x8504('0x29')](respondWithFilteredResult(_0x1f6fa0,_0x5d3b76))['catch'](handleError(_0x1f6fa0,null));};exports['show']=function(_0x3babd9,_0x2f359e){var _0x557cf3={'raw':!![],'where':{'id':_0x3babd9[_0x8504('0x45')]['id']}},_0x560505={};_0x560505[_0x8504('0x33')]=_[_0x8504('0x46')](db[_0x8504('0x40')][_0x8504('0x30')]);_0x560505[_0x8504('0x34')]=_[_0x8504('0x46')](_0x3babd9[_0x8504('0x34')]);_0x560505[_0x8504('0x35')]=_[_0x8504('0x37')](_0x560505[_0x8504('0x33')],_0x560505[_0x8504('0x34')]);_0x557cf3['attributes']=_[_0x8504('0x37')](_0x560505[_0x8504('0x33')],qs[_0x8504('0x38')](_0x3babd9[_0x8504('0x34')][_0x8504('0x38')]));_0x557cf3[_0x8504('0x36')]=_0x557cf3[_0x8504('0x36')][_0x8504('0x47')]?_0x557cf3[_0x8504('0x36')]:_0x560505[_0x8504('0x33')];if(_0x3babd9[_0x8504('0x34')][_0x8504('0x41')]){_0x557cf3[_0x8504('0x42')]=[{'all':!![]}];}_0x557cf3=_['merge']({},_0x557cf3,_0x3babd9[_0x8504('0x48')]);return db[_0x8504('0x40')][_0x8504('0x49')](_0x557cf3)[_0x8504('0x29')](handleEntityNotFound(_0x2f359e,null))['then'](respondWithResult(_0x2f359e,null))[_0x8504('0x4a')](handleError(_0x2f359e,null));};exports[_0x8504('0x4b')]=function(_0x28e15c,_0x213370){return db['SmsTransferReport'][_0x8504('0x4b')](_0x28e15c['body'],{})['then'](respondWithResult(_0x213370,0xc9))[_0x8504('0x4a')](handleError(_0x213370,null));};exports[_0x8504('0x27')]=function(_0x4221da,_0xefe0d6){if(_0x4221da[_0x8504('0x4c')]['id']){delete _0x4221da['body']['id'];}return db['SmsTransferReport'][_0x8504('0x49')]({'where':{'id':_0x4221da[_0x8504('0x45')]['id']}})['then'](handleEntityNotFound(_0xefe0d6,null))[_0x8504('0x29')](saveUpdates(_0x4221da[_0x8504('0x4c')],null))[_0x8504('0x29')](respondWithResult(_0xefe0d6,null))[_0x8504('0x4a')](handleError(_0xefe0d6,null));};exports[_0x8504('0x28')]=function(_0x59272f,_0x5adec6){return db[_0x8504('0x40')][_0x8504('0x49')]({'where':{'id':_0x59272f['params']['id']}})[_0x8504('0x29')](handleEntityNotFound(_0x5adec6,null))[_0x8504('0x29')](removeEntity(_0x5adec6,null))[_0x8504('0x4a')](handleError(_0x5adec6,null));};exports[_0x8504('0x4d')]=function(_0x502954,_0x566716){return db[_0x8504('0x40')][_0x8504('0x4d')]()[_0x8504('0x29')](respondWithResult(_0x566716,null))[_0x8504('0x4a')](handleError(_0x566716,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 42bb5c3..d86b492 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 _0x92ba=['bluebird','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','report_sms_transfer','uniqueid','util','../../config/logger','api','moment'];(function(_0x3987d3,_0x5e9a84){var _0x389897=function(_0x307c3c){while(--_0x307c3c){_0x3987d3['push'](_0x3987d3['shift']());}};_0x389897(++_0x5e9a84);}(_0x92ba,0x1d0));var _0xa92b=function(_0x3e4a00,_0x5549e3){_0x3e4a00=_0x3e4a00-0x0;var _0x45598a=_0x92ba[_0x3e4a00];return _0x45598a;};'use strict';var _=require('lodash');var util=require(_0xa92b('0x0'));var logger=require(_0xa92b('0x1'))(_0xa92b('0x2'));var moment=require(_0xa92b('0x3'));var BPromise=require(_0xa92b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa92b('0x5'));var rimraf=require(_0xa92b('0x6'));var config=require(_0xa92b('0x7'));var attributes=require(_0xa92b('0x8'));module[_0xa92b('0x9')]=function(_0x15dbe0,_0x171f67){return _0x15dbe0[_0xa92b('0xa')]('SmsTransferReport',attributes,{'tableName':_0xa92b('0xb'),'paranoid':![],'indexes':[{'name':_0xa92b('0xc'),'fields':[_0xa92b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6c21=['lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x550aa9,_0x1295ee){var _0xe8d17=function(_0x34c107){while(--_0x34c107){_0x550aa9['push'](_0x550aa9['shift']());}};_0xe8d17(++_0x1295ee);}(_0x6c21,0x1b2));var _0x16c2=function(_0xac3328,_0x23745a){_0xac3328=_0xac3328-0x0;var _0x33aec4=_0x6c21[_0xac3328];return _0x33aec4;};'use strict';var _=require(_0x16c2('0x0'));var util=require(_0x16c2('0x1'));var logger=require(_0x16c2('0x2'))(_0x16c2('0x3'));var moment=require('moment');var BPromise=require(_0x16c2('0x4'));var rp=require(_0x16c2('0x5'));var fs=require('fs');var path=require(_0x16c2('0x6'));var rimraf=require(_0x16c2('0x7'));var config=require(_0x16c2('0x8'));var attributes=require('./smsTransferReport.attributes');module[_0x16c2('0x9')]=function(_0x998f4a,_0x20e281){return _0x998f4a[_0x16c2('0xa')](_0x16c2('0xb'),attributes,{'tableName':_0x16c2('0xc'),'paranoid':![],'indexes':[{'name':_0x16c2('0xd'),'fields':[_0x16c2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 55e815c..22291d4 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 _0x79a8=['message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x79a8,0x1d0));var _0x879a=function(_0x1e9604,_0x5de613){_0x1e9604=_0x1e9604-0x0;var _0x522053=_0x79a8[_0x1e9604];return _0x522053;};'use strict';var _=require(_0x879a('0x0'));var util=require('util');var moment=require(_0x879a('0x1'));var BPromise=require(_0x879a('0x2'));var rs=require(_0x879a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x879a('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x879a('0x5'))(_0x879a('0x6'));var config=require(_0x879a('0x7'));var jayson=require(_0x879a('0x8'));var client=jayson[_0x879a('0x9')][_0x879a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d353e,_0x2427bf,_0x4bf3ab){return new BPromise(function(_0xe27fe6,_0x5cb5c9){return client[_0x879a('0xb')](_0x1d353e,_0x4bf3ab)[_0x879a('0xc')](function(_0x5eba04){logger[_0x879a('0xd')](_0x879a('0xe'),_0x2427bf,_0x879a('0xf'));logger['debug'](_0x879a('0x10'),_0x2427bf,_0x879a('0xf'),JSON['stringify'](_0x5eba04));if(_0x5eba04['error']){if(_0x5eba04[_0x879a('0x11')][_0x879a('0x12')]===0x1f4){logger[_0x879a('0x11')](_0x879a('0xe'),_0x2427bf,_0x5eba04['error'][_0x879a('0x13')]);return _0x5cb5c9(_0x5eba04[_0x879a('0x11')][_0x879a('0x13')]);}logger[_0x879a('0x11')](_0x879a('0xe'),_0x2427bf,_0x5eba04[_0x879a('0x11')][_0x879a('0x13')]);return _0xe27fe6(_0x5eba04[_0x879a('0x11')][_0x879a('0x13')]);}else{logger[_0x879a('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x2427bf,'request\x20sent');_0xe27fe6(_0x5eba04[_0x879a('0x14')][_0x879a('0x13')]);}})['catch'](function(_0x119260){logger[_0x879a('0x11')](_0x879a('0xe'),_0x2427bf,_0x119260);_0x5cb5c9(_0x119260);});});} \ No newline at end of file +var _0x0fcd=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','util','moment','bluebird'];(function(_0x30cd54,_0x4b92f8){var _0x3bdce1=function(_0x1187cf){while(--_0x1187cf){_0x30cd54['push'](_0x30cd54['shift']());}};_0x3bdce1(++_0x4b92f8);}(_0x0fcd,0x129));var _0xd0fc=function(_0x582bbb,_0x8fd93d){_0x582bbb=_0x582bbb-0x0;var _0x210963=_0x0fcd[_0x582bbb];return _0x210963;};'use strict';var _=require('lodash');var util=require(_0xd0fc('0x0'));var moment=require(_0xd0fc('0x1'));var BPromise=require(_0xd0fc('0x2'));var rs=require(_0xd0fc('0x3'));var fs=require('fs');var Redis=require(_0xd0fc('0x4'));var db=require(_0xd0fc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd0fc('0x6'))(_0xd0fc('0x7'));var config=require(_0xd0fc('0x8'));var jayson=require(_0xd0fc('0x9'));var client=jayson['client'][_0xd0fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d93cc,_0x5efebd,_0x5ad581){return new BPromise(function(_0x5e42a1,_0x2f1e84){return client[_0xd0fc('0xb')](_0x5d93cc,_0x5ad581)[_0xd0fc('0xc')](function(_0x499260){logger[_0xd0fc('0xd')](_0xd0fc('0xe'),_0x5efebd,'request\x20sent');logger['debug'](_0xd0fc('0xf'),_0x5efebd,_0xd0fc('0x10'),JSON[_0xd0fc('0x11')](_0x499260));if(_0x499260['error']){if(_0x499260[_0xd0fc('0x12')]['code']===0x1f4){logger[_0xd0fc('0x12')](_0xd0fc('0xe'),_0x5efebd,_0x499260['error'][_0xd0fc('0x13')]);return _0x2f1e84(_0x499260[_0xd0fc('0x12')][_0xd0fc('0x13')]);}logger['error'](_0xd0fc('0xe'),_0x5efebd,_0x499260[_0xd0fc('0x12')][_0xd0fc('0x13')]);return _0x5e42a1(_0x499260['error']['message']);}else{logger[_0xd0fc('0xd')](_0xd0fc('0xe'),_0x5efebd,_0xd0fc('0x10'));_0x5e42a1(_0x499260['result']['message']);}})['catch'](function(_0x53e28d){logger[_0xd0fc('0x12')]('SmsTransferReport,\x20%s,\x20%s',_0x5efebd,_0x53e28d);_0x2f1e84(_0x53e28d);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index fd8d425..5978ba2 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 _0xcc02=['multer','util','path','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','/:id/download','download','diskStorage','root','server/files/sounds/original/','originalname','replace','basename','post','single','file','create','put','update','delete'];(function(_0x18b9cc,_0x42bafc){var _0x373cc9=function(_0x46aa3d){while(--_0x46aa3d){_0x18b9cc['push'](_0x18b9cc['shift']());}};_0x373cc9(++_0x42bafc);}(_0xcc02,0x9c));var _0x2cc0=function(_0x4a9b47,_0x8b9c3e){_0x4a9b47=_0x4a9b47-0x0;var _0x31ec47=_0xcc02[_0x4a9b47];return _0x31ec47;};'use strict';var multer=require(_0x2cc0('0x0'));var util=require(_0x2cc0('0x1'));var path=require(_0x2cc0('0x2'));var timeout=require('connect-timeout');var express=require(_0x2cc0('0x3'));var router=express[_0x2cc0('0x4')]();var fs_extra=require(_0x2cc0('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2cc0('0x6'));var controller=require('./sound.controller');router[_0x2cc0('0x7')]('/',auth[_0x2cc0('0x8')](),controller[_0x2cc0('0x9')]);router['get'](_0x2cc0('0xa'),auth[_0x2cc0('0x8')](),controller['show']);router[_0x2cc0('0x7')](_0x2cc0('0xb'),auth[_0x2cc0('0x8')](),controller[_0x2cc0('0xc')]);var upload=multer({'storage':multer[_0x2cc0('0xd')]({'destination':function(_0x301c5e,_0x4635a4,_0x494a5e){_0x494a5e(null,path['join'](config[_0x2cc0('0xe')],_0x2cc0('0xf')));},'filename':function(_0x4afd6b,_0x1238d0,_0x2715d0){_0x1238d0[_0x2cc0('0x10')]=_0x1238d0[_0x2cc0('0x10')][_0x2cc0('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2715d0(null,util['format']('%s-%s%s',path[_0x2cc0('0x12')](_0x1238d0[_0x2cc0('0x10')],path['extname'](_0x1238d0[_0x2cc0('0x10')])),Date['now'](),path['extname'](_0x1238d0['originalname'])));}})});router[_0x2cc0('0x13')]('/',upload[_0x2cc0('0x14')](_0x2cc0('0x15')),controller[_0x2cc0('0x16')]);router[_0x2cc0('0x17')](_0x2cc0('0xa'),auth[_0x2cc0('0x8')](),controller[_0x2cc0('0x18')]);router[_0x2cc0('0x19')](_0x2cc0('0xa'),auth['isAuthenticated'](),controller[_0x2cc0('0x19')]);module['exports']=router; \ No newline at end of file +var _0x0a25=['create','put','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','post','single'];(function(_0x33aff2,_0x28e1db){var _0x333b2b=function(_0x162184){while(--_0x162184){_0x33aff2['push'](_0x33aff2['shift']());}};_0x333b2b(++_0x28e1db);}(_0x0a25,0x68));var _0x50a2=function(_0x1aa8fc,_0x288358){_0x1aa8fc=_0x1aa8fc-0x0;var _0x1d2273=_0x0a25[_0x1aa8fc];return _0x1d2273;};'use strict';var multer=require(_0x50a2('0x0'));var util=require(_0x50a2('0x1'));var path=require('path');var timeout=require(_0x50a2('0x2'));var express=require(_0x50a2('0x3'));var router=express['Router']();var fs_extra=require(_0x50a2('0x4'));var auth=require(_0x50a2('0x5'));var interaction=require(_0x50a2('0x6'));var config=require(_0x50a2('0x7'));var controller=require(_0x50a2('0x8'));router[_0x50a2('0x9')]('/',auth[_0x50a2('0xa')](),controller[_0x50a2('0xb')]);router[_0x50a2('0x9')](_0x50a2('0xc'),auth[_0x50a2('0xa')](),controller[_0x50a2('0xd')]);router[_0x50a2('0x9')](_0x50a2('0xe'),auth[_0x50a2('0xa')](),controller[_0x50a2('0xf')]);var upload=multer({'storage':multer[_0x50a2('0x10')]({'destination':function(_0x201e9d,_0x4b145f,_0x1862ce){_0x1862ce(null,path[_0x50a2('0x11')](config[_0x50a2('0x12')],_0x50a2('0x13')));},'filename':function(_0x18590e,_0x352c6f,_0x5cc052){_0x352c6f[_0x50a2('0x14')]=_0x352c6f[_0x50a2('0x14')][_0x50a2('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5cc052(null,util[_0x50a2('0x16')](_0x50a2('0x17'),path[_0x50a2('0x18')](_0x352c6f[_0x50a2('0x14')],path[_0x50a2('0x19')](_0x352c6f['originalname'])),Date['now'](),path['extname'](_0x352c6f[_0x50a2('0x14')])));}})});router[_0x50a2('0x1a')]('/',upload[_0x50a2('0x1b')]('file'),controller[_0x50a2('0x1c')]);router[_0x50a2('0x1d')](_0x50a2('0xc'),auth[_0x50a2('0xa')](),controller[_0x50a2('0x1e')]);router[_0x50a2('0x1f')](_0x50a2('0xc'),auth['isAuthenticated'](),controller[_0x50a2('0x1f')]);module[_0x50a2('0x20')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 818dd23..dab4e1e 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 _0x4121=['INTEGER','sequelize','STRING','name','FLOAT','BIGINT'];(function(_0x1e8f6b,_0x36ef00){var _0x171dfc=function(_0x573798){while(--_0x573798){_0x1e8f6b['push'](_0x1e8f6b['shift']());}};_0x171dfc(++_0x36ef00);}(_0x4121,0x14b));var _0x1412=function(_0x4133a2,_0x2287b6){_0x4133a2=_0x4133a2-0x0;var _0x4d8387=_0x4121[_0x4133a2];return _0x4d8387;};'use strict';var Sequelize=require(_0x1412('0x0'));module['exports']={'name':{'type':Sequelize[_0x1412('0x1')],'unique':_0x1412('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x1412('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0x1412('0x1')]},'original_format':{'type':Sequelize[_0x1412('0x1')]},'original_duration':{'type':Sequelize[_0x1412('0x3')]},'original_sampleCount':{'type':Sequelize[_0x1412('0x4')]},'original_channelCount':{'type':Sequelize[_0x1412('0x5')]},'original_bitRate':{'type':Sequelize[_0x1412('0x4')]},'original_sampleRate':{'type':Sequelize[_0x1412('0x5')]},'converted_format':{'type':Sequelize[_0x1412('0x1')]},'converted_duration':{'type':Sequelize[_0x1412('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x1412('0x4')]},'converted_channelCount':{'type':Sequelize[_0x1412('0x5')]},'converted_bitRate':{'type':Sequelize[_0x1412('0x4')]},'converted_sampleRate':{'type':Sequelize[_0x1412('0x5')]}}; \ No newline at end of file +var _0x080b=['INTEGER','BIGINT','sequelize','STRING','name','FLOAT'];(function(_0x390b46,_0x310e77){var _0x5ee529=function(_0x52bf59){while(--_0x52bf59){_0x390b46['push'](_0x390b46['shift']());}};_0x5ee529(++_0x310e77);}(_0x080b,0x128));var _0xb080=function(_0x3f1381,_0x20567b){_0x3f1381=_0x3f1381-0x0;var _0x53d765=_0x080b[_0x3f1381];return _0x53d765;};'use strict';var Sequelize=require(_0xb080('0x0'));module['exports']={'name':{'type':Sequelize[_0xb080('0x1')],'unique':_0xb080('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xb080('0x1')]},'display_name':{'type':Sequelize[_0xb080('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0xb080('0x1')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xb080('0x3')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xb080('0x4')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0xb080('0x4')]},'converted_format':{'type':Sequelize[_0xb080('0x1')]},'converted_duration':{'type':Sequelize[_0xb080('0x3')]},'converted_sampleCount':{'type':Sequelize[_0xb080('0x5')]},'converted_channelCount':{'type':Sequelize[_0xb080('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xb080('0x4')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index fc7051b..1957f98 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 _0xfaef=['body','role','userProfileId','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','params','save_name','original_format','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','undefined','offset','count','set','Content-Range','apply','save','update','then','get','Sounds','UserProfileResource','destroy','sendStatus','name','send','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','Sound','includeAll','include','findAll','rows','catch','show','find','download','join','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','root','server/files/sounds/converted','%s.%s','create','basename','file','originalname','extname','filename','substring','format','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','transcode','wav','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_sampleRate'];(function(_0x15ec92,_0x1e80d2){var _0x376fc6=function(_0x4fb6ed){while(--_0x4fb6ed){_0x15ec92['push'](_0x15ec92['shift']());}};_0x376fc6(++_0x1e80d2);}(_0xfaef,0x8d));var _0xffae=function(_0x3e99cb,_0x1d2fe0){_0x3e99cb=_0x3e99cb-0x0;var _0x1bc729=_0xfaef[_0x3e99cb];return _0x1bc729;};'use strict';var emlformat=require(_0xffae('0x0'));var rimraf=require(_0xffae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xffae('0x2'));var rp=require(_0xffae('0x3'));var moment=require(_0xffae('0x4'));var BPromise=require(_0xffae('0x5'));var Mustache=require(_0xffae('0x6'));var util=require(_0xffae('0x7'));var path=require(_0xffae('0x8'));var sox=require(_0xffae('0x9'));var csv=require(_0xffae('0xa'));var ejs=require(_0xffae('0xb'));var fs=require('fs');var fs_extra=require(_0xffae('0xc'));var _=require(_0xffae('0xd'));var squel=require(_0xffae('0xe'));var crypto=require(_0xffae('0xf'));var jsforce=require(_0xffae('0x10'));var deskjs=require(_0xffae('0x11'));var toCsv=require(_0xffae('0xa'));var querystring=require(_0xffae('0x12'));var Papa=require(_0xffae('0x13'));var Redis=require('ioredis');var authService=require(_0xffae('0x14'));var qs=require(_0xffae('0x15'));var as=require(_0xffae('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xffae('0x17'))(_0xffae('0x18'));var utils=require(_0xffae('0x19'));var config=require(_0xffae('0x1a'));var licenseUtil=require(_0xffae('0x1b'));var db=require(_0xffae('0x1c'))['db'];function respondWithStatusCode(_0x1a6546,_0xfb6c18){_0xfb6c18=_0xfb6c18||0xcc;return function(_0x5d1c35){if(_0x5d1c35){return _0x1a6546['sendStatus'](_0xfb6c18);}return _0x1a6546[_0xffae('0x1d')](_0xfb6c18)[_0xffae('0x1e')]();};}function respondWithResult(_0x102fb3,_0xd4d71e){_0xd4d71e=_0xd4d71e||0xc8;return function(_0x5e3b60){if(_0x5e3b60){return _0x102fb3[_0xffae('0x1d')](_0xd4d71e)[_0xffae('0x1f')](_0x5e3b60);}};}function respondWithFilteredResult(_0x2bfadf,_0x3b61cd){return function(_0x3d8879){if(_0x3d8879){var _0x420a47=typeof _0x3b61cd['offset']==='undefined'&&typeof _0x3b61cd[_0xffae('0x20')]===_0xffae('0x21');var _0x1c3b50=_0x3d8879['count'];var _0x12e55d=_0x420a47?0x0:_0x3b61cd[_0xffae('0x22')];var _0x5e911e=_0x420a47?_0x3d8879[_0xffae('0x23')]:_0x3b61cd[_0xffae('0x22')]+_0x3b61cd[_0xffae('0x20')];var _0x454ba6;if(_0x5e911e>=_0x1c3b50){_0x5e911e=_0x1c3b50;_0x454ba6=0xc8;}else{_0x454ba6=0xce;}_0x2bfadf['status'](_0x454ba6);return _0x2bfadf[_0xffae('0x24')](_0xffae('0x25'),_0x12e55d+'-'+_0x5e911e+'/'+_0x1c3b50)[_0xffae('0x1f')](_0x3d8879);}return null;};}function patchUpdates(_0x4da60d){return function(_0x414495){try{jsonpatch[_0xffae('0x26')](_0x414495,_0x4da60d,!![]);}catch(_0x30eae2){return BPromise['reject'](_0x30eae2);}return _0x414495[_0xffae('0x27')]();};}function saveUpdates(_0x2778fd,_0x3af01e){return function(_0x5e2f27){if(_0x5e2f27){return _0x5e2f27[_0xffae('0x28')](_0x2778fd)[_0xffae('0x29')](function(_0x5e7e7d){return _0x5e7e7d;});}return null;};}function removeEntity(_0x47b9de,_0x35ea0b){return function(_0x2c28ff){if(_0x2c28ff){return _0x2c28ff['destroy']()[_0xffae('0x29')](function(){var _0x232bdb=_0x2c28ff[_0xffae('0x2a')]({'plain':!![]});var _0x206708=_0xffae('0x2b');return db[_0xffae('0x2c')][_0xffae('0x2d')]({'where':{'type':_0x206708,'resourceId':_0x232bdb['id']}})[_0xffae('0x29')](function(){return _0x2c28ff;});})['then'](function(){_0x47b9de[_0xffae('0x1d')](0xcc)[_0xffae('0x1e')]();});}};}function handleEntityNotFound(_0x35ba21,_0x2ab192){return function(_0x5c570f){if(!_0x5c570f){_0x35ba21[_0xffae('0x2e')](0x194);}return _0x5c570f;};}function handleError(_0x50b1e9,_0xd91a93){_0xd91a93=_0xd91a93||0x1f4;return function(_0x394de9){logger['error'](_0x394de9['stack']);if(_0x394de9[_0xffae('0x2f')]){delete _0x394de9[_0xffae('0x2f')];}_0x50b1e9[_0xffae('0x1d')](_0xd91a93)[_0xffae('0x30')](_0x394de9);};}exports['index']=function(_0x1cefed,_0x4714ff){var _0x1ebf77={},_0x167fd0={},_0x394720={'count':0x0,'rows':[]};var _0x5dfccf=_['map'](db['Sound'][_0xffae('0x31')],function(_0x294bb){return{'name':_0x294bb[_0xffae('0x32')],'type':_0x294bb['type'][_0xffae('0x33')]};});_0x167fd0[_0xffae('0x34')]=_[_0xffae('0x35')](_0x5dfccf,_0xffae('0x2f'));_0x167fd0['query']=_[_0xffae('0x36')](_0x1cefed[_0xffae('0x37')]);_0x167fd0[_0xffae('0x38')]=_[_0xffae('0x39')](_0x167fd0[_0xffae('0x34')],_0x167fd0[_0xffae('0x37')]);_0x1ebf77[_0xffae('0x3a')]=_['intersection'](_0x167fd0[_0xffae('0x34')],qs[_0xffae('0x3b')](_0x1cefed[_0xffae('0x37')]['fields']));_0x1ebf77[_0xffae('0x3a')]=_0x1ebf77[_0xffae('0x3a')][_0xffae('0x3c')]?_0x1ebf77[_0xffae('0x3a')]:_0x167fd0[_0xffae('0x34')];if(!_0x1cefed[_0xffae('0x37')]['hasOwnProperty']('nolimit')){_0x1ebf77[_0xffae('0x20')]=qs['limit'](_0x1cefed[_0xffae('0x37')]['limit']);_0x1ebf77[_0xffae('0x22')]=qs['offset'](_0x1cefed[_0xffae('0x37')][_0xffae('0x22')]);}_0x1ebf77[_0xffae('0x3d')]=qs['sort'](_0x1cefed['query'][_0xffae('0x3e')]);_0x1ebf77[_0xffae('0x3f')]=qs['filters'](_[_0xffae('0x40')](_0x1cefed[_0xffae('0x37')],_0x167fd0[_0xffae('0x38')]),_0x5dfccf);if(_0x1cefed['query'][_0xffae('0x41')]){_0x1ebf77[_0xffae('0x3f')]=_[_0xffae('0x42')](_0x1ebf77['where'],{'$or':_[_0xffae('0x35')](_0x5dfccf,function(_0x522390){if(_0x522390[_0xffae('0x43')]!==_0xffae('0x44')){var _0x13d8b7={};_0x13d8b7[_0x522390[_0xffae('0x2f')]]={'$like':'%'+_0x1cefed['query'][_0xffae('0x41')]+'%'};return _0x13d8b7;}})});}_0x1ebf77=_[_0xffae('0x42')]({},_0x1ebf77,_0x1cefed[_0xffae('0x45')]);var _0x46aa71={'where':_0x1ebf77['where']};return db[_0xffae('0x46')][_0xffae('0x23')](_0x46aa71)[_0xffae('0x29')](function(_0x3ea6dc){_0x394720[_0xffae('0x23')]=_0x3ea6dc;if(_0x1cefed[_0xffae('0x37')][_0xffae('0x47')]){_0x1ebf77[_0xffae('0x48')]=[{'all':!![]}];}return db[_0xffae('0x46')][_0xffae('0x49')](_0x1ebf77);})['then'](function(_0x194880){_0x394720[_0xffae('0x4a')]=_0x194880;return _0x394720;})['then'](respondWithFilteredResult(_0x4714ff,_0x1ebf77))[_0xffae('0x4b')](handleError(_0x4714ff,null));};exports[_0xffae('0x4c')]=function(_0x2d2802,_0x2cebf2){var _0x35485b={'raw':!![],'where':{'id':_0x2d2802['params']['id']}},_0x95315d={};_0x95315d['model']=_['keys'](db[_0xffae('0x46')][_0xffae('0x31')]);_0x95315d[_0xffae('0x37')]=_['keys'](_0x2d2802[_0xffae('0x37')]);_0x95315d[_0xffae('0x38')]=_['intersection'](_0x95315d[_0xffae('0x34')],_0x95315d[_0xffae('0x37')]);_0x35485b[_0xffae('0x3a')]=_[_0xffae('0x39')](_0x95315d['model'],qs[_0xffae('0x3b')](_0x2d2802[_0xffae('0x37')][_0xffae('0x3b')]));_0x35485b[_0xffae('0x3a')]=_0x35485b[_0xffae('0x3a')][_0xffae('0x3c')]?_0x35485b[_0xffae('0x3a')]:_0x95315d['model'];if(_0x2d2802[_0xffae('0x37')][_0xffae('0x47')]){_0x35485b['include']=[{'all':!![]}];}_0x35485b=_[_0xffae('0x42')]({},_0x35485b,_0x2d2802[_0xffae('0x45')]);return db[_0xffae('0x46')][_0xffae('0x4d')](_0x35485b)['then'](handleEntityNotFound(_0x2cebf2,null))[_0xffae('0x29')](respondWithResult(_0x2cebf2,null))[_0xffae('0x4b')](handleError(_0x2cebf2,null));};exports[_0xffae('0x4e')]=function(_0x2803a7,_0x27cf07,_0x2902bd){return db[_0xffae('0x46')][_0xffae('0x4d')]({'where':{'id':_0x2803a7['params']['id']},'attributes':[_0xffae('0x2f'),'save_name','converted_format'],'raw':!![]})[_0xffae('0x29')](handleEntityNotFound(_0x27cf07,null))[_0xffae('0x29')](function(_0x5b01cf){if(_0x5b01cf){if(!fs['existsSync'](path[_0xffae('0x4f')](config['root'],'server/files/sounds/converted',_0x5b01cf['save_name']+'.'+_0x5b01cf[_0xffae('0x50')]))){throw new db[(_0xffae('0x51'))][(_0xffae('0x52'))](_0xffae('0x53'));}return _0x27cf07['download'](path[_0xffae('0x4f')](config[_0xffae('0x54')],_0xffae('0x55'),util['format'](_0xffae('0x56'),_0x5b01cf['save_name'],_0x5b01cf['converted_format'])),util['format'](_0xffae('0x56'),_0x5b01cf['name'],_0x5b01cf[_0xffae('0x50')]));}return null;})['catch'](handleError(_0x27cf07,null));};exports[_0xffae('0x57')]=function(_0x44f03e,_0x2b60f2,_0x5578c0){var _0x5328b2={'name':path[_0xffae('0x58')](_0x44f03e[_0xffae('0x59')][_0xffae('0x5a')],path[_0xffae('0x5b')](_0x44f03e[_0xffae('0x59')]['originalname'])),'save_name':path[_0xffae('0x58')](_0x44f03e[_0xffae('0x59')][_0xffae('0x5c')],path[_0xffae('0x5b')](_0x44f03e['file'][_0xffae('0x5c')])),'original_format':path['extname'](_0x44f03e['file']['originalname'])[_0xffae('0x5d')](0x1),'converted_format':'wav'};var _0xc7ee21=path[_0xffae('0x4f')](config[_0xffae('0x54')],'server/files/sounds/original',_0x44f03e[_0xffae('0x59')][_0xffae('0x5c')]);var _0x23886b=path['join'](config['root'],'server/files/sounds/converted',util[_0xffae('0x5e')](_0xffae('0x56'),path['basename'](_0x44f03e[_0xffae('0x59')][_0xffae('0x5c')],path[_0xffae('0x5b')](_0x44f03e[_0xffae('0x59')][_0xffae('0x5c')])),_0x5328b2[_0xffae('0x50')]));logger[_0xffae('0x5f')](_0xffae('0x60'),_0xc7ee21);logger[_0xffae('0x5f')](_0xffae('0x61'),_0x23886b);try{fs[_0xffae('0x62')](_0xc7ee21,parseInt('0777',0x8));var _0xb03ccc=sox[_0xffae('0x63')](_0xc7ee21,_0x23886b,{'sampleRate':0x1f40,'format':_0xffae('0x64'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xb03ccc['on']('error',function(_0x5785c3){fs[_0xffae('0x65')](_0xc7ee21);_0x2b60f2[_0xffae('0x1d')](0x1f4)[_0xffae('0x30')](_0x5785c3);});_0xb03ccc['on']('src',function(_0x1c83e7){_0x5328b2[_0xffae('0x66')]=isNaN(_0x1c83e7[_0xffae('0x67')])?null:_0x1c83e7[_0xffae('0x67')]*0x3e8;_0x5328b2[_0xffae('0x68')]=isNaN(_0x1c83e7['sampleCount'])?null:_0x1c83e7[_0xffae('0x69')];_0x5328b2[_0xffae('0x6a')]=isNaN(_0x1c83e7[_0xffae('0x6b')])?null:_0x1c83e7[_0xffae('0x6b')];_0x5328b2['original_bitRate']=isNaN(_0x1c83e7[_0xffae('0x6c')])?null:_0x1c83e7[_0xffae('0x6c')];_0x5328b2[_0xffae('0x6d')]=isNaN(_0x1c83e7[_0xffae('0x6e')])?null:_0x1c83e7[_0xffae('0x6e')];});_0xb03ccc['on']('dest',function(_0x99fc7d){_0x5328b2[_0xffae('0x6f')]=isNaN(_0x99fc7d[_0xffae('0x67')])?null:_0x99fc7d[_0xffae('0x67')]*0x3e8;_0x5328b2[_0xffae('0x70')]=isNaN(_0x99fc7d[_0xffae('0x69')])?null:_0x99fc7d[_0xffae('0x69')];_0x5328b2[_0xffae('0x71')]=isNaN(_0x99fc7d['channelCount'])?null:_0x99fc7d['channelCount'];_0x5328b2['converted_bitRate']=isNaN(_0x99fc7d['bitRate'])?null:_0x99fc7d[_0xffae('0x6c')];_0x5328b2[_0xffae('0x72')]=isNaN(_0x99fc7d['sampleRate'])?null:_0x99fc7d[_0xffae('0x6e')];});_0xb03ccc['on'](_0xffae('0x1e'),function(){fs['chmodSync'](_0x23886b,parseInt('0777',0x8));return db[_0xffae('0x46')][_0xffae('0x57')](_0x5328b2)['then'](function(_0x52c51e){var _0x4565a0={'role':_0x44f03e[_0xffae('0x73')][_0xffae('0x74')],'userProfileId':_0x44f03e['body'][_0xffae('0x75')]};if(!_0x4565a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4565a0[_0xffae('0x74')]===_0xffae('0x76')){var _0x45266d=_0x52c51e['get']({'plain':!![]});return db[_0xffae('0x77')][_0xffae('0x4d')]({'where':{'name':_0xffae('0x2b'),'userProfileId':_0x4565a0[_0xffae('0x75')]},'raw':!![]})[_0xffae('0x29')](function(_0x46b170){if(_0x46b170&&_0x46b170[_0xffae('0x78')]===0x0){return db[_0xffae('0x2c')][_0xffae('0x57')]({'name':_0x45266d[_0xffae('0x2f')],'resourceId':_0x45266d['id'],'type':_0x46b170[_0xffae('0x2f')],'sectionId':_0x46b170['id']},{})['then'](function(){return _0x52c51e;});}else{return _0x52c51e;}})['catch'](function(_0x367cc8){logger[_0xffae('0x79')](_0xffae('0x7a'),_0x367cc8);throw _0x367cc8;});}return _0x52c51e;})[_0xffae('0x29')](respondWithResult(_0x2b60f2,null))[_0xffae('0x4b')](handleError(_0x2b60f2,null));});_0xb03ccc['start']();}catch(_0x192199){_0x2b60f2[_0xffae('0x1d')](0x1f4)[_0xffae('0x30')](_0x192199);}};exports[_0xffae('0x28')]=function(_0x5d7760,_0x16df68,_0x5af6c3){return db['Sound'][_0xffae('0x4d')]({'where':{'id':_0x5d7760['params']['id']}})['then'](handleEntityNotFound(_0x16df68,null))[_0xffae('0x29')](saveUpdates(_[_0xffae('0x40')](_0x5d7760[_0xffae('0x73')],['name',_0xffae('0x7b')]),null))[_0xffae('0x29')](respondWithResult(_0x16df68,null))[_0xffae('0x4b')](handleError(_0x16df68,null));};exports[_0xffae('0x7c')]=function(_0xb5059a,_0x1920fd,_0x3d7d8f){return db['Sound']['find']({'where':{'id':_0xb5059a[_0xffae('0x7d')]['id']}})[_0xffae('0x29')](function(_0x5d0279){if(_0x5d0279){return _0x5d0279[_0xffae('0x2d')]();}})[_0xffae('0x29')](function(_0x50809c){var _0xd2b6cc=path['join'](config[_0xffae('0x54')],'server/files/sounds/original',util[_0xffae('0x5e')](_0xffae('0x56'),_0x50809c[_0xffae('0x7e')],_0x50809c[_0xffae('0x7f')]));var _0x5b0427=path['join'](config[_0xffae('0x54')],_0xffae('0x55'),util[_0xffae('0x5e')](_0xffae('0x56'),_0x50809c[_0xffae('0x7e')],_0x50809c['converted_format']));fs[_0xffae('0x65')](_0xd2b6cc);fs['unlinkSync'](_0x5b0427);return _0x50809c;})['then'](function(_0x1fba0){if(_0x1fba0){return _0x1920fd[_0xffae('0x1d')](0xcc)[_0xffae('0x1e')]();}})[_0xffae('0x29')](handleEntityNotFound(_0x1920fd,null))['catch'](handleError(_0x1920fd,null));}; \ No newline at end of file +var _0xe36a=['chmodSync','0777','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','params','description','delete','eml-format','rimraf','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','apply','reject','update','destroy','then','get','Sounds','UserProfileResource','error','name','send','index','Sound','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','merge','where','options','includeAll','include','rows','catch','show','find','existsSync','join','root','server/files/sounds/converted','save_name','Sequelize','ValidationError','format','%s.%s','converted_format','create','basename','file','originalname','filename','substring','wav','extname','info','Sound\x20upload\x20filepath:\x20%s','unlinkSync','src','original_sampleCount','sampleCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','duration','converted_sampleCount','converted_channelCount','converted_bitRate'];(function(_0xa5100c,_0xd12229){var _0x1ff64a=function(_0x3349b6){while(--_0x3349b6){_0xa5100c['push'](_0xa5100c['shift']());}};_0x1ff64a(++_0xd12229);}(_0xe36a,0xf0));var _0xae36=function(_0x54c191,_0x4a04ef){_0x54c191=_0x54c191-0x0;var _0x40ee4a=_0xe36a[_0x54c191];return _0x40ee4a;};'use strict';var emlformat=require(_0xae36('0x0'));var rimraf=require(_0xae36('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xae36('0x2'));var BPromise=require(_0xae36('0x3'));var Mustache=require('mustache');var util=require(_0xae36('0x4'));var path=require(_0xae36('0x5'));var sox=require(_0xae36('0x6'));var csv=require('to-csv');var ejs=require(_0xae36('0x7'));var fs=require('fs');var fs_extra=require(_0xae36('0x8'));var _=require(_0xae36('0x9'));var squel=require(_0xae36('0xa'));var crypto=require(_0xae36('0xb'));var jsforce=require(_0xae36('0xc'));var deskjs=require(_0xae36('0xd'));var toCsv=require(_0xae36('0xe'));var querystring=require('querystring');var Papa=require(_0xae36('0xf'));var Redis=require(_0xae36('0x10'));var authService=require(_0xae36('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xae36('0x12'));var hardwareService=require(_0xae36('0x13'));var logger=require('../../config/logger')(_0xae36('0x14'));var utils=require(_0xae36('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xae36('0x16'));var db=require(_0xae36('0x17'))['db'];function respondWithStatusCode(_0x4c193f,_0x139efc){_0x139efc=_0x139efc||0xcc;return function(_0x248e2e){if(_0x248e2e){return _0x4c193f['sendStatus'](_0x139efc);}return _0x4c193f[_0xae36('0x18')](_0x139efc)[_0xae36('0x19')]();};}function respondWithResult(_0x4ea067,_0x402dfb){_0x402dfb=_0x402dfb||0xc8;return function(_0x54890e){if(_0x54890e){return _0x4ea067[_0xae36('0x18')](_0x402dfb)['json'](_0x54890e);}};}function respondWithFilteredResult(_0x2a4797,_0x2152d8){return function(_0x2a42fc){if(_0x2a42fc){var _0x81e10=typeof _0x2152d8[_0xae36('0x1a')]===_0xae36('0x1b')&&typeof _0x2152d8[_0xae36('0x1c')]===_0xae36('0x1b');var _0x5e0b12=_0x2a42fc[_0xae36('0x1d')];var _0x2fb323=_0x81e10?0x0:_0x2152d8[_0xae36('0x1a')];var _0xfddf4=_0x81e10?_0x2a42fc[_0xae36('0x1d')]:_0x2152d8[_0xae36('0x1a')]+_0x2152d8['limit'];var _0x186bf0;if(_0xfddf4>=_0x5e0b12){_0xfddf4=_0x5e0b12;_0x186bf0=0xc8;}else{_0x186bf0=0xce;}_0x2a4797[_0xae36('0x18')](_0x186bf0);return _0x2a4797['set']('Content-Range',_0x2fb323+'-'+_0xfddf4+'/'+_0x5e0b12)['json'](_0x2a42fc);}return null;};}function patchUpdates(_0x5b3f07){return function(_0x343e26){try{jsonpatch[_0xae36('0x1e')](_0x343e26,_0x5b3f07,!![]);}catch(_0xa5166b){return BPromise[_0xae36('0x1f')](_0xa5166b);}return _0x343e26['save']();};}function saveUpdates(_0x5d8b19,_0x19e4a2){return function(_0x11db8c){if(_0x11db8c){return _0x11db8c[_0xae36('0x20')](_0x5d8b19)['then'](function(_0x1d090c){return _0x1d090c;});}return null;};}function removeEntity(_0x2e0aed,_0x2af78e){return function(_0x2132f8){if(_0x2132f8){return _0x2132f8[_0xae36('0x21')]()[_0xae36('0x22')](function(){var _0x1c80ad=_0x2132f8[_0xae36('0x23')]({'plain':!![]});var _0xd38017=_0xae36('0x24');return db[_0xae36('0x25')][_0xae36('0x21')]({'where':{'type':_0xd38017,'resourceId':_0x1c80ad['id']}})[_0xae36('0x22')](function(){return _0x2132f8;});})[_0xae36('0x22')](function(){_0x2e0aed['status'](0xcc)[_0xae36('0x19')]();});}};}function handleEntityNotFound(_0x48db8b,_0x5f040a){return function(_0xbbc25b){if(!_0xbbc25b){_0x48db8b['sendStatus'](0x194);}return _0xbbc25b;};}function handleError(_0x2b6613,_0x4c3ba0){_0x4c3ba0=_0x4c3ba0||0x1f4;return function(_0x2f2cb0){logger[_0xae36('0x26')](_0x2f2cb0['stack']);if(_0x2f2cb0['name']){delete _0x2f2cb0[_0xae36('0x27')];}_0x2b6613[_0xae36('0x18')](_0x4c3ba0)[_0xae36('0x28')](_0x2f2cb0);};}exports[_0xae36('0x29')]=function(_0xdb1c16,_0x1a8e09){var _0x28b627={},_0x11d14d={},_0x1ddf8c={'count':0x0,'rows':[]};var _0x153bac=_['map'](db[_0xae36('0x2a')][_0xae36('0x2b')],function(_0x5bb5d7){return{'name':_0x5bb5d7[_0xae36('0x2c')],'type':_0x5bb5d7[_0xae36('0x2d')]['key']};});_0x11d14d[_0xae36('0x2e')]=_[_0xae36('0x2f')](_0x153bac,_0xae36('0x27'));_0x11d14d[_0xae36('0x30')]=_[_0xae36('0x31')](_0xdb1c16[_0xae36('0x30')]);_0x11d14d[_0xae36('0x32')]=_[_0xae36('0x33')](_0x11d14d[_0xae36('0x2e')],_0x11d14d['query']);_0x28b627[_0xae36('0x34')]=_[_0xae36('0x33')](_0x11d14d[_0xae36('0x2e')],qs[_0xae36('0x35')](_0xdb1c16[_0xae36('0x30')][_0xae36('0x35')]));_0x28b627[_0xae36('0x34')]=_0x28b627[_0xae36('0x34')]['length']?_0x28b627['attributes']:_0x11d14d[_0xae36('0x2e')];if(!_0xdb1c16['query'][_0xae36('0x36')](_0xae36('0x37'))){_0x28b627[_0xae36('0x1c')]=qs[_0xae36('0x1c')](_0xdb1c16[_0xae36('0x30')][_0xae36('0x1c')]);_0x28b627['offset']=qs[_0xae36('0x1a')](_0xdb1c16[_0xae36('0x30')][_0xae36('0x1a')]);}_0x28b627['order']=qs[_0xae36('0x38')](_0xdb1c16[_0xae36('0x30')][_0xae36('0x38')]);_0x28b627['where']=qs[_0xae36('0x32')](_[_0xae36('0x39')](_0xdb1c16[_0xae36('0x30')],_0x11d14d[_0xae36('0x32')]),_0x153bac);if(_0xdb1c16[_0xae36('0x30')][_0xae36('0x3a')]){_0x28b627['where']=_[_0xae36('0x3b')](_0x28b627[_0xae36('0x3c')],{'$or':_[_0xae36('0x2f')](_0x153bac,function(_0x8db74e){if(_0x8db74e['type']!=='VIRTUAL'){var _0x5d1301={};_0x5d1301[_0x8db74e[_0xae36('0x27')]]={'$like':'%'+_0xdb1c16[_0xae36('0x30')]['filter']+'%'};return _0x5d1301;}})});}_0x28b627=_[_0xae36('0x3b')]({},_0x28b627,_0xdb1c16[_0xae36('0x3d')]);var _0x583b8b={'where':_0x28b627['where']};return db[_0xae36('0x2a')][_0xae36('0x1d')](_0x583b8b)[_0xae36('0x22')](function(_0x1e1d1a){_0x1ddf8c[_0xae36('0x1d')]=_0x1e1d1a;if(_0xdb1c16[_0xae36('0x30')][_0xae36('0x3e')]){_0x28b627[_0xae36('0x3f')]=[{'all':!![]}];}return db[_0xae36('0x2a')]['findAll'](_0x28b627);})[_0xae36('0x22')](function(_0x4f0f06){_0x1ddf8c[_0xae36('0x40')]=_0x4f0f06;return _0x1ddf8c;})[_0xae36('0x22')](respondWithFilteredResult(_0x1a8e09,_0x28b627))[_0xae36('0x41')](handleError(_0x1a8e09,null));};exports[_0xae36('0x42')]=function(_0x47225c,_0x54e027){var _0xf21c6c={'raw':!![],'where':{'id':_0x47225c['params']['id']}},_0x1865b4={};_0x1865b4['model']=_[_0xae36('0x31')](db['Sound'][_0xae36('0x2b')]);_0x1865b4[_0xae36('0x30')]=_['keys'](_0x47225c[_0xae36('0x30')]);_0x1865b4[_0xae36('0x32')]=_[_0xae36('0x33')](_0x1865b4[_0xae36('0x2e')],_0x1865b4[_0xae36('0x30')]);_0xf21c6c[_0xae36('0x34')]=_['intersection'](_0x1865b4[_0xae36('0x2e')],qs[_0xae36('0x35')](_0x47225c[_0xae36('0x30')][_0xae36('0x35')]));_0xf21c6c['attributes']=_0xf21c6c[_0xae36('0x34')]['length']?_0xf21c6c[_0xae36('0x34')]:_0x1865b4[_0xae36('0x2e')];if(_0x47225c[_0xae36('0x30')]['includeAll']){_0xf21c6c['include']=[{'all':!![]}];}_0xf21c6c=_['merge']({},_0xf21c6c,_0x47225c['options']);return db[_0xae36('0x2a')][_0xae36('0x43')](_0xf21c6c)['then'](handleEntityNotFound(_0x54e027,null))[_0xae36('0x22')](respondWithResult(_0x54e027,null))[_0xae36('0x41')](handleError(_0x54e027,null));};exports['download']=function(_0x4335d6,_0x2a9b57,_0x10d239){return db[_0xae36('0x2a')][_0xae36('0x43')]({'where':{'id':_0x4335d6['params']['id']},'attributes':[_0xae36('0x27'),'save_name','converted_format'],'raw':!![]})[_0xae36('0x22')](handleEntityNotFound(_0x2a9b57,null))['then'](function(_0x395712){if(_0x395712){if(!fs[_0xae36('0x44')](path[_0xae36('0x45')](config[_0xae36('0x46')],_0xae36('0x47'),_0x395712[_0xae36('0x48')]+'.'+_0x395712['converted_format']))){throw new db[(_0xae36('0x49'))][(_0xae36('0x4a'))]('Sound\x20not\x20found');}return _0x2a9b57['download'](path['join'](config['root'],'server/files/sounds/converted',util[_0xae36('0x4b')](_0xae36('0x4c'),_0x395712['save_name'],_0x395712[_0xae36('0x4d')])),util[_0xae36('0x4b')](_0xae36('0x4c'),_0x395712[_0xae36('0x27')],_0x395712[_0xae36('0x4d')]));}return null;})[_0xae36('0x41')](handleError(_0x2a9b57,null));};exports[_0xae36('0x4e')]=function(_0xa22ad,_0x62e4fc,_0x469f5d){var _0x37dc7c={'name':path[_0xae36('0x4f')](_0xa22ad[_0xae36('0x50')][_0xae36('0x51')],path['extname'](_0xa22ad['file'][_0xae36('0x51')])),'save_name':path[_0xae36('0x4f')](_0xa22ad[_0xae36('0x50')][_0xae36('0x52')],path['extname'](_0xa22ad[_0xae36('0x50')][_0xae36('0x52')])),'original_format':path['extname'](_0xa22ad[_0xae36('0x50')]['originalname'])[_0xae36('0x53')](0x1),'converted_format':_0xae36('0x54')};var _0x1238dd=path[_0xae36('0x45')](config[_0xae36('0x46')],'server/files/sounds/original',_0xa22ad['file'][_0xae36('0x52')]);var _0x17221b=path[_0xae36('0x45')](config['root'],_0xae36('0x47'),util[_0xae36('0x4b')](_0xae36('0x4c'),path[_0xae36('0x4f')](_0xa22ad[_0xae36('0x50')][_0xae36('0x52')],path[_0xae36('0x55')](_0xa22ad[_0xae36('0x50')]['filename'])),_0x37dc7c[_0xae36('0x4d')]));logger[_0xae36('0x56')](_0xae36('0x57'),_0x1238dd);logger[_0xae36('0x56')]('Sound\x20upload\x20destination:\x20%s',_0x17221b);try{fs['chmodSync'](_0x1238dd,parseInt('0777',0x8));var _0xa86342=sox['transcode'](_0x1238dd,_0x17221b,{'sampleRate':0x1f40,'format':_0xae36('0x54'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xa86342['on']('error',function(_0x4e6a7d){fs[_0xae36('0x58')](_0x1238dd);_0x62e4fc['status'](0x1f4)[_0xae36('0x28')](_0x4e6a7d);});_0xa86342['on'](_0xae36('0x59'),function(_0x2adf19){_0x37dc7c['original_duration']=isNaN(_0x2adf19['duration'])?null:_0x2adf19['duration']*0x3e8;_0x37dc7c[_0xae36('0x5a')]=isNaN(_0x2adf19[_0xae36('0x5b')])?null:_0x2adf19[_0xae36('0x5b')];_0x37dc7c['original_channelCount']=isNaN(_0x2adf19[_0xae36('0x5c')])?null:_0x2adf19[_0xae36('0x5c')];_0x37dc7c[_0xae36('0x5d')]=isNaN(_0x2adf19[_0xae36('0x5e')])?null:_0x2adf19[_0xae36('0x5e')];_0x37dc7c[_0xae36('0x5f')]=isNaN(_0x2adf19[_0xae36('0x60')])?null:_0x2adf19[_0xae36('0x60')];});_0xa86342['on']('dest',function(_0x4e322f){_0x37dc7c[_0xae36('0x61')]=isNaN(_0x4e322f[_0xae36('0x62')])?null:_0x4e322f['duration']*0x3e8;_0x37dc7c[_0xae36('0x63')]=isNaN(_0x4e322f[_0xae36('0x5b')])?null:_0x4e322f[_0xae36('0x5b')];_0x37dc7c[_0xae36('0x64')]=isNaN(_0x4e322f['channelCount'])?null:_0x4e322f[_0xae36('0x5c')];_0x37dc7c[_0xae36('0x65')]=isNaN(_0x4e322f[_0xae36('0x5e')])?null:_0x4e322f['bitRate'];_0x37dc7c['converted_sampleRate']=isNaN(_0x4e322f[_0xae36('0x60')])?null:_0x4e322f[_0xae36('0x60')];});_0xa86342['on'](_0xae36('0x19'),function(){fs[_0xae36('0x66')](_0x17221b,parseInt(_0xae36('0x67'),0x8));return db[_0xae36('0x2a')][_0xae36('0x4e')](_0x37dc7c)[_0xae36('0x22')](function(_0x3eb451){var _0x5891c6={'role':_0xa22ad[_0xae36('0x68')]['role'],'userProfileId':_0xa22ad[_0xae36('0x68')]['userProfileId']};if(!_0x5891c6)throw new Error(_0xae36('0x69'));if(_0x5891c6[_0xae36('0x6a')]===_0xae36('0x6b')){var _0x54bf16=_0x3eb451[_0xae36('0x23')]({'plain':!![]});return db['UserProfileSection'][_0xae36('0x43')]({'where':{'name':_0xae36('0x24'),'userProfileId':_0x5891c6[_0xae36('0x6c')]},'raw':!![]})['then'](function(_0x5625d7){if(_0x5625d7&&_0x5625d7['autoAssociation']===0x0){return db[_0xae36('0x25')]['create']({'name':_0x54bf16['name'],'resourceId':_0x54bf16['id'],'type':_0x5625d7[_0xae36('0x27')],'sectionId':_0x5625d7['id']},{})[_0xae36('0x22')](function(){return _0x3eb451;});}else{return _0x3eb451;}})[_0xae36('0x41')](function(_0x146da7){logger['error'](_0xae36('0x6d'),_0x146da7);throw _0x146da7;});}return _0x3eb451;})[_0xae36('0x22')](respondWithResult(_0x62e4fc,null))['catch'](handleError(_0x62e4fc,null));});_0xa86342[_0xae36('0x6e')]();}catch(_0x38898f){_0x62e4fc[_0xae36('0x18')](0x1f4)['send'](_0x38898f);}};exports['update']=function(_0x2b7ecb,_0x1bb652,_0x1a6fa7){return db[_0xae36('0x2a')][_0xae36('0x43')]({'where':{'id':_0x2b7ecb[_0xae36('0x6f')]['id']}})[_0xae36('0x22')](handleEntityNotFound(_0x1bb652,null))[_0xae36('0x22')](saveUpdates(_['pick'](_0x2b7ecb[_0xae36('0x68')],['name',_0xae36('0x70')]),null))[_0xae36('0x22')](respondWithResult(_0x1bb652,null))[_0xae36('0x41')](handleError(_0x1bb652,null));};exports[_0xae36('0x71')]=function(_0x136c51,_0x2e178e,_0x4b4bab){return db[_0xae36('0x2a')][_0xae36('0x43')]({'where':{'id':_0x136c51['params']['id']}})['then'](function(_0x445a2e){if(_0x445a2e){return _0x445a2e[_0xae36('0x21')]();}})['then'](function(_0x562937){var _0x11e352=path['join'](config[_0xae36('0x46')],'server/files/sounds/original',util['format'](_0xae36('0x4c'),_0x562937[_0xae36('0x48')],_0x562937['original_format']));var _0x393934=path[_0xae36('0x45')](config[_0xae36('0x46')],'server/files/sounds/converted',util[_0xae36('0x4b')](_0xae36('0x4c'),_0x562937['save_name'],_0x562937[_0xae36('0x4d')]));fs[_0xae36('0x58')](_0x11e352);fs[_0xae36('0x58')](_0x393934);return _0x562937;})[_0xae36('0x22')](function(_0xcae187){if(_0xcae187){return _0x2e178e[_0xae36('0x18')](0xcc)[_0xae36('0x19')]();}})[_0xae36('0x22')](handleEntityNotFound(_0x2e178e,null))[_0xae36('0x41')](handleError(_0x2e178e,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 8c01b43..34d73eb 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 _0xad7c=['path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound','tools_sounds','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xc368f5,_0x5ef6a3){var _0x5855ef=function(_0x791ae1){while(--_0x791ae1){_0xc368f5['push'](_0xc368f5['shift']());}};_0x5855ef(++_0x5ef6a3);}(_0xad7c,0x1d6));var _0xcad7=function(_0x59c718,_0x5e3a4d){_0x59c718=_0x59c718-0x0;var _0x5edd9b=_0xad7c[_0x59c718];return _0x5edd9b;};'use strict';var _=require(_0xcad7('0x0'));var util=require(_0xcad7('0x1'));var logger=require(_0xcad7('0x2'))(_0xcad7('0x3'));var moment=require(_0xcad7('0x4'));var BPromise=require(_0xcad7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcad7('0x6'));var rimraf=require(_0xcad7('0x7'));var config=require(_0xcad7('0x8'));var attributes=require(_0xcad7('0x9'));module[_0xcad7('0xa')]=function(_0x2f73d9,_0x522a64){return _0x2f73d9[_0xcad7('0xb')](_0xcad7('0xc'),attributes,{'tableName':_0xcad7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7b66=['rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x7b66,0x1da));var _0x67b6=function(_0x2ec2b9,_0xf36af9){_0x2ec2b9=_0x2ec2b9-0x0;var _0x29d27c=_0x7b66[_0x2ec2b9];return _0x29d27c;};'use strict';var _=require(_0x67b6('0x0'));var util=require(_0x67b6('0x1'));var logger=require(_0x67b6('0x2'))(_0x67b6('0x3'));var moment=require(_0x67b6('0x4'));var BPromise=require('bluebird');var rp=require(_0x67b6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x67b6('0x6'));var config=require(_0x67b6('0x7'));var attributes=require('./sound.attributes');module[_0x67b6('0x8')]=function(_0x240a75,_0x54d5be){return _0x240a75[_0x67b6('0x9')]('Sound',attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index f84dd98..a59eadf 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 _0xb957=['message','request\x20sent','result','ShowSound','find','options','where','attributes','include','model','map','then','debug','catch','lodash','util','bluebird','../../config/logger','rpc','../../config/environment','client','http','request','info','Sound,\x20%s,\x20%s','Sound,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4bec27,_0x529585){var _0x5ab08f=function(_0x45e6d5){while(--_0x45e6d5){_0x4bec27['push'](_0x4bec27['shift']());}};_0x5ab08f(++_0x529585);}(_0xb957,0x126));var _0x7b95=function(_0x4402f3,_0xd95eca){_0x4402f3=_0x4402f3-0x0;var _0x3b4f40=_0xb957[_0x4402f3];return _0x3b4f40;};'use strict';var _=require(_0x7b95('0x0'));var util=require(_0x7b95('0x1'));var moment=require('moment');var BPromise=require(_0x7b95('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(_0x7b95('0x3'))(_0x7b95('0x4'));var config=require(_0x7b95('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7b95('0x6')][_0x7b95('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x164ca2,_0xa823b5,_0x591267){return new BPromise(function(_0x4b02a5,_0x1616f8){return client[_0x7b95('0x8')](_0x164ca2,_0x591267)['then'](function(_0x4e8633){logger[_0x7b95('0x9')](_0x7b95('0xa'),_0xa823b5,'request\x20sent');logger['debug'](_0x7b95('0xb'),_0xa823b5,'request\x20sent',JSON[_0x7b95('0xc')](_0x4e8633));if(_0x4e8633[_0x7b95('0xd')]){if(_0x4e8633[_0x7b95('0xd')]['code']===0x1f4){logger[_0x7b95('0xd')](_0x7b95('0xa'),_0xa823b5,_0x4e8633[_0x7b95('0xd')][_0x7b95('0xe')]);return _0x1616f8(_0x4e8633[_0x7b95('0xd')][_0x7b95('0xe')]);}logger[_0x7b95('0xd')](_0x7b95('0xa'),_0xa823b5,_0x4e8633['error'][_0x7b95('0xe')]);return _0x4b02a5(_0x4e8633[_0x7b95('0xd')][_0x7b95('0xe')]);}else{logger[_0x7b95('0x9')](_0x7b95('0xa'),_0xa823b5,_0x7b95('0xf'));_0x4b02a5(_0x4e8633[_0x7b95('0x10')]['message']);}})['catch'](function(_0x16b3ae){logger[_0x7b95('0xd')]('Sound,\x20%s,\x20%s',_0xa823b5,_0x16b3ae);_0x1616f8(_0x16b3ae);});});}exports[_0x7b95('0x11')]=function(_0x48c5dc){var _0x59d66a=this;return new Promise(function(_0x543ff0,_0x1b04f3){return db['Sound'][_0x7b95('0x12')]({'raw':_0x48c5dc[_0x7b95('0x13')]?_0x48c5dc[_0x7b95('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x48c5dc[_0x7b95('0x13')]?_0x48c5dc[_0x7b95('0x13')][_0x7b95('0x14')]||null:null,'attributes':_0x48c5dc[_0x7b95('0x13')]?_0x48c5dc['options'][_0x7b95('0x15')]||null:null,'include':_0x48c5dc[_0x7b95('0x13')]?_0x48c5dc[_0x7b95('0x13')][_0x7b95('0x16')]?_['map'](_0x48c5dc[_0x7b95('0x13')][_0x7b95('0x16')],function(_0x5cea27){return{'model':db[_0x5cea27[_0x7b95('0x17')]],'as':_0x5cea27['as'],'attributes':_0x5cea27[_0x7b95('0x15')],'include':_0x5cea27[_0x7b95('0x16')]?_['map'](_0x5cea27[_0x7b95('0x16')],function(_0x23bdd3){return{'model':db[_0x23bdd3['model']],'as':_0x23bdd3['as'],'attributes':_0x23bdd3[_0x7b95('0x15')],'include':_0x23bdd3[_0x7b95('0x16')]?_[_0x7b95('0x18')](_0x23bdd3['include'],function(_0x1296ea){return{'model':db[_0x1296ea['model']],'as':_0x1296ea['as'],'attributes':_0x1296ea['attributes']};}):[]};}):[]};}):[]:[]})[_0x7b95('0x19')](function(_0x5770fb){logger[_0x7b95('0x9')]('ShowSound',_0x48c5dc);logger[_0x7b95('0x1a')](_0x7b95('0x11'),_0x48c5dc,JSON[_0x7b95('0xc')](_0x5770fb));_0x543ff0(_0x5770fb);})[_0x7b95('0x1b')](function(_0x6b25fa){logger[_0x7b95('0xd')]('ShowSound',_0x6b25fa[_0x7b95('0xe')],_0x48c5dc);_0x1b04f3(_0x59d66a[_0x7b95('0xd')](0x1f4,_0x6b25fa['message']));});});}; \ No newline at end of file +var _0x439c=['attributes','include','map','model','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','result','ShowSound','Sound','options','raw','where'];(function(_0x45cc7c,_0x1710c1){var _0x596016=function(_0xf91524){while(--_0xf91524){_0x45cc7c['push'](_0x45cc7c['shift']());}};_0x596016(++_0x1710c1);}(_0x439c,0x81));var _0xc439=function(_0x4f7338,_0x317ba4){_0x4f7338=_0x4f7338-0x0;var _0x4dff5f=_0x439c[_0x4f7338];return _0x4dff5f;};'use strict';var _=require(_0xc439('0x0'));var util=require('util');var moment=require(_0xc439('0x1'));var BPromise=require('bluebird');var rs=require(_0xc439('0x2'));var fs=require('fs');var Redis=require(_0xc439('0x3'));var db=require(_0xc439('0x4'))['db'];var utils=require(_0xc439('0x5'));var logger=require('../../config/logger')(_0xc439('0x6'));var config=require(_0xc439('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xc439('0x8')][_0xc439('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xdc40a7,_0x5a4a46,_0x18573d){return new BPromise(function(_0x489ad8,_0x2cfc65){return client[_0xc439('0xa')](_0xdc40a7,_0x18573d)[_0xc439('0xb')](function(_0x62e76e){logger[_0xc439('0xc')](_0xc439('0xd'),_0x5a4a46,_0xc439('0xe'));logger[_0xc439('0xf')](_0xc439('0x10'),_0x5a4a46,_0xc439('0xe'),JSON[_0xc439('0x11')](_0x62e76e));if(_0x62e76e[_0xc439('0x12')]){if(_0x62e76e[_0xc439('0x12')]['code']===0x1f4){logger[_0xc439('0x12')]('Sound,\x20%s,\x20%s',_0x5a4a46,_0x62e76e[_0xc439('0x12')][_0xc439('0x13')]);return _0x2cfc65(_0x62e76e[_0xc439('0x12')][_0xc439('0x13')]);}logger[_0xc439('0x12')](_0xc439('0xd'),_0x5a4a46,_0x62e76e[_0xc439('0x12')][_0xc439('0x13')]);return _0x489ad8(_0x62e76e[_0xc439('0x12')][_0xc439('0x13')]);}else{logger[_0xc439('0xc')]('Sound,\x20%s,\x20%s',_0x5a4a46,_0xc439('0xe'));_0x489ad8(_0x62e76e[_0xc439('0x14')][_0xc439('0x13')]);}})['catch'](function(_0x2e633a){logger[_0xc439('0x12')](_0xc439('0xd'),_0x5a4a46,_0x2e633a);_0x2cfc65(_0x2e633a);});});}exports[_0xc439('0x15')]=function(_0x1f9187){var _0x11770f=this;return new Promise(function(_0x2548a2,_0x15ca6a){return db[_0xc439('0x16')]['find']({'raw':_0x1f9187[_0xc439('0x17')]?_0x1f9187[_0xc439('0x17')][_0xc439('0x18')]===undefined?!![]:![]:!![],'where':_0x1f9187[_0xc439('0x17')]?_0x1f9187[_0xc439('0x17')][_0xc439('0x19')]||null:null,'attributes':_0x1f9187[_0xc439('0x17')]?_0x1f9187[_0xc439('0x17')][_0xc439('0x1a')]||null:null,'include':_0x1f9187[_0xc439('0x17')]?_0x1f9187['options']['include']?_['map'](_0x1f9187[_0xc439('0x17')]['include'],function(_0x22903d){return{'model':db[_0x22903d['model']],'as':_0x22903d['as'],'attributes':_0x22903d[_0xc439('0x1a')],'include':_0x22903d[_0xc439('0x1b')]?_[_0xc439('0x1c')](_0x22903d['include'],function(_0x55833f){return{'model':db[_0x55833f[_0xc439('0x1d')]],'as':_0x55833f['as'],'attributes':_0x55833f[_0xc439('0x1a')],'include':_0x55833f[_0xc439('0x1b')]?_['map'](_0x55833f['include'],function(_0x4e9e49){return{'model':db[_0x4e9e49[_0xc439('0x1d')]],'as':_0x4e9e49['as'],'attributes':_0x4e9e49['attributes']};}):[]};}):[]};}):[]:[]})[_0xc439('0xb')](function(_0x3f471d){logger[_0xc439('0xc')](_0xc439('0x15'),_0x1f9187);logger[_0xc439('0xf')](_0xc439('0x15'),_0x1f9187,JSON[_0xc439('0x11')](_0x3f471d));_0x2548a2(_0x3f471d);})[_0xc439('0x1e')](function(_0x4c7f8e){logger[_0xc439('0x12')]('ShowSound',_0x4c7f8e[_0xc439('0x13')],_0x1f9187);_0x15ca6a(_0x11770f['error'](0x1f4,_0x4c7f8e[_0xc439('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index b9ce4f9..955928a 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 _0x5eb8=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x53dacc,_0x1ab9b6){var _0x38eff2=function(_0x5b3814){while(--_0x5b3814){_0x53dacc['push'](_0x53dacc['shift']());}};_0x38eff2(++_0x1ab9b6);}(_0x5eb8,0xb0));var _0x85eb=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5eb8[_0x321bb2];return _0x9c12ed;};'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 fs_extra=require(_0x85eb('0x4'));var auth=require(_0x85eb('0x5'));var interaction=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var controller=require(_0x85eb('0x8'));router[_0x85eb('0x9')]('/',auth[_0x85eb('0xa')](),controller[_0x85eb('0xb')]);router['get'](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xd')]);router['post']('/',auth[_0x85eb('0xa')](),controller['create']);router[_0x85eb('0xe')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller[_0x85eb('0xf')]);router[_0x85eb('0x10')](_0x85eb('0xc'),auth[_0x85eb('0xa')](),controller['destroy']);module[_0x85eb('0x11')]=router; \ No newline at end of file +var _0x0b0e=['./squareMessage.controller','get','isAuthenticated','index','show','post','create','/:id','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xf1499b,_0x4e8f51){var _0x2c589c=function(_0x1039fa){while(--_0x1039fa){_0xf1499b['push'](_0xf1499b['shift']());}};_0x2c589c(++_0x4e8f51);}(_0x0b0e,0x187));var _0xe0b0=function(_0x572165,_0x6a45cc){_0x572165=_0x572165-0x0;var _0x8c8709=_0x0b0e[_0x572165];return _0x8c8709;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0xd')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xf'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x10')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x11')]);module[_0xe0b0('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index dfdae37..dd7cd34 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 _0x83cf=['sequelize','exports','STRING','TEXT','ENUM','out'];(function(_0x1cd674,_0x8d3638){var _0x27928f=function(_0x5e3c70){while(--_0x5e3c70){_0x1cd674['push'](_0x1cd674['shift']());}};_0x27928f(++_0x8d3638);}(_0x83cf,0x180));var _0xf83c=function(_0xd384ec,_0x4f1c7c){_0xd384ec=_0xd384ec-0x0;var _0x4f0f80=_0x83cf[_0xd384ec];return _0x4f0f80;};'use strict';var Sequelize=require(_0xf83c('0x0'));module[_0xf83c('0x1')]={'uniqueid':{'type':Sequelize[_0xf83c('0x2')]},'body':{'type':Sequelize[_0xf83c('0x3')]('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xf83c('0x4')]('in',_0xf83c('0x5')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0xf83c('0x2')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xeb7c=['out','TEXT','sequelize','exports','STRING','ENUM'];(function(_0x5128ca,_0x1ac9ec){var _0x55c484=function(_0x6a8360){while(--_0x6a8360){_0x5128ca['push'](_0x5128ca['shift']());}};_0x55c484(++_0x1ac9ec);}(_0xeb7c,0x1ee));var _0xceb7=function(_0x4031b0,_0x272e0){_0x4031b0=_0x4031b0-0x0;var _0x384397=_0xeb7c[_0x4031b0];return _0x384397;};'use strict';var Sequelize=require(_0xceb7('0x0'));module[_0xceb7('0x1')]={'uniqueid':{'type':Sequelize[_0xceb7('0x2')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0xceb7('0x3')]('in',_0xceb7('0x4')),'defaultValue':_0xceb7('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0xceb7('0x2')]},'providerResponse':{'type':Sequelize[_0xceb7('0x5')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 31f2a2d..7552358 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 _0xc4d8=['nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','fields','find','create','body','eml-format','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','save','update','then','destroy','name','index','map','SquareMessage','rawAttributes','fieldName','type','query','keys','filters','attributes','intersection','model','length','hasOwnProperty'];(function(_0x506a60,_0x46793f){var _0x4d12df=function(_0x27b10b){while(--_0x27b10b){_0x506a60['push'](_0x506a60['shift']());}};_0x4d12df(++_0x46793f);}(_0xc4d8,0xa6));var _0x8c4d=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xc4d8[_0x5bd426];return _0x23a7eb;};'use strict';var emlformat=require(_0x8c4d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8c4d('0x1'));var jsonpatch=require(_0x8c4d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8c4d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x8c4d('0x4'));var sox=require(_0x8c4d('0x5'));var csv=require(_0x8c4d('0x6'));var ejs=require(_0x8c4d('0x7'));var fs=require('fs');var fs_extra=require(_0x8c4d('0x8'));var _=require(_0x8c4d('0x9'));var squel=require(_0x8c4d('0xa'));var crypto=require(_0x8c4d('0xb'));var jsforce=require(_0x8c4d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8c4d('0x6'));var querystring=require(_0x8c4d('0xd'));var Papa=require(_0x8c4d('0xe'));var Redis=require(_0x8c4d('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8c4d('0x10'));var hardwareService=require(_0x8c4d('0x11'));var logger=require(_0x8c4d('0x12'))(_0x8c4d('0x13'));var utils=require(_0x8c4d('0x14'));var config=require(_0x8c4d('0x15'));var licenseUtil=require(_0x8c4d('0x16'));var db=require(_0x8c4d('0x17'))['db'];function respondWithStatusCode(_0x50de53,_0x21768d){_0x21768d=_0x21768d||0xcc;return function(_0x303bbc){if(_0x303bbc){return _0x50de53[_0x8c4d('0x18')](_0x21768d);}return _0x50de53[_0x8c4d('0x19')](_0x21768d)[_0x8c4d('0x1a')]();};}function respondWithResult(_0x207f67,_0x3d42f1){_0x3d42f1=_0x3d42f1||0xc8;return function(_0x220cfa){if(_0x220cfa){return _0x207f67['status'](_0x3d42f1)['json'](_0x220cfa);}};}function respondWithFilteredResult(_0x20ab4f,_0x1d410e){return function(_0x498e5d){if(_0x498e5d){var _0x355345=typeof _0x1d410e[_0x8c4d('0x1b')]===_0x8c4d('0x1c')&&typeof _0x1d410e['limit']===_0x8c4d('0x1c');var _0x3d082f=_0x498e5d[_0x8c4d('0x1d')];var _0x3a9321=_0x355345?0x0:_0x1d410e[_0x8c4d('0x1b')];var _0x59cc48=_0x355345?_0x498e5d[_0x8c4d('0x1d')]:_0x1d410e[_0x8c4d('0x1b')]+_0x1d410e['limit'];var _0x409568;if(_0x59cc48>=_0x3d082f){_0x59cc48=_0x3d082f;_0x409568=0xc8;}else{_0x409568=0xce;}_0x20ab4f[_0x8c4d('0x19')](_0x409568);return _0x20ab4f[_0x8c4d('0x1e')](_0x8c4d('0x1f'),_0x3a9321+'-'+_0x59cc48+'/'+_0x3d082f)[_0x8c4d('0x20')](_0x498e5d);}return null;};}function patchUpdates(_0x10ef16){return function(_0x17c206){try{jsonpatch[_0x8c4d('0x21')](_0x17c206,_0x10ef16,!![]);}catch(_0x17708c){return BPromise['reject'](_0x17708c);}return _0x17c206[_0x8c4d('0x22')]();};}function saveUpdates(_0x16ddc9,_0x33f0a2){return function(_0x663624){if(_0x663624){return _0x663624[_0x8c4d('0x23')](_0x16ddc9)[_0x8c4d('0x24')](function(_0x54d835){return _0x54d835;});}return null;};}function removeEntity(_0x3fd1e1,_0x10ea9b){return function(_0x52114f){if(_0x52114f){return _0x52114f[_0x8c4d('0x25')]()['then'](function(){_0x3fd1e1[_0x8c4d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a0d83,_0x292602){return function(_0x3f428b){if(!_0x3f428b){_0x2a0d83[_0x8c4d('0x18')](0x194);}return _0x3f428b;};}function handleError(_0x3dec4b,_0x10ed15){_0x10ed15=_0x10ed15||0x1f4;return function(_0x33d5f1){logger['error'](_0x33d5f1['stack']);if(_0x33d5f1[_0x8c4d('0x26')]){delete _0x33d5f1[_0x8c4d('0x26')];}_0x3dec4b[_0x8c4d('0x19')](_0x10ed15)['send'](_0x33d5f1);};}exports[_0x8c4d('0x27')]=function(_0x2c829b,_0x10ef81){var _0x5dfb6f={},_0x22f944={},_0x476266={'count':0x0,'rows':[]};var _0x2e4076=_[_0x8c4d('0x28')](db[_0x8c4d('0x29')][_0x8c4d('0x2a')],function(_0x5b35b6){return{'name':_0x5b35b6[_0x8c4d('0x2b')],'type':_0x5b35b6[_0x8c4d('0x2c')]['key']};});_0x22f944['model']=_['map'](_0x2e4076,_0x8c4d('0x26'));_0x22f944[_0x8c4d('0x2d')]=_[_0x8c4d('0x2e')](_0x2c829b[_0x8c4d('0x2d')]);_0x22f944[_0x8c4d('0x2f')]=_['intersection'](_0x22f944['model'],_0x22f944['query']);_0x5dfb6f[_0x8c4d('0x30')]=_[_0x8c4d('0x31')](_0x22f944[_0x8c4d('0x32')],qs['fields'](_0x2c829b[_0x8c4d('0x2d')]['fields']));_0x5dfb6f[_0x8c4d('0x30')]=_0x5dfb6f[_0x8c4d('0x30')][_0x8c4d('0x33')]?_0x5dfb6f[_0x8c4d('0x30')]:_0x22f944['model'];if(!_0x2c829b[_0x8c4d('0x2d')][_0x8c4d('0x34')](_0x8c4d('0x35'))){_0x5dfb6f[_0x8c4d('0x36')]=qs[_0x8c4d('0x36')](_0x2c829b[_0x8c4d('0x2d')][_0x8c4d('0x36')]);_0x5dfb6f[_0x8c4d('0x1b')]=qs['offset'](_0x2c829b[_0x8c4d('0x2d')]['offset']);}_0x5dfb6f[_0x8c4d('0x37')]=qs[_0x8c4d('0x38')](_0x2c829b[_0x8c4d('0x2d')][_0x8c4d('0x38')]);_0x5dfb6f[_0x8c4d('0x39')]=qs['filters'](_[_0x8c4d('0x3a')](_0x2c829b[_0x8c4d('0x2d')],_0x22f944[_0x8c4d('0x2f')]),_0x2e4076);if(_0x2c829b[_0x8c4d('0x2d')][_0x8c4d('0x3b')]){_0x5dfb6f[_0x8c4d('0x39')]=_[_0x8c4d('0x3c')](_0x5dfb6f[_0x8c4d('0x39')],{'$or':_[_0x8c4d('0x28')](_0x2e4076,function(_0x1b67b5){if(_0x1b67b5[_0x8c4d('0x2c')]!=='VIRTUAL'){var _0x3391d6={};_0x3391d6[_0x1b67b5[_0x8c4d('0x26')]]={'$like':'%'+_0x2c829b['query']['filter']+'%'};return _0x3391d6;}})});}_0x5dfb6f=_[_0x8c4d('0x3c')]({},_0x5dfb6f,_0x2c829b[_0x8c4d('0x3d')]);var _0x40d23c={'where':_0x5dfb6f[_0x8c4d('0x39')]};return db[_0x8c4d('0x29')][_0x8c4d('0x1d')](_0x40d23c)[_0x8c4d('0x24')](function(_0x1fa027){_0x476266['count']=_0x1fa027;if(_0x2c829b[_0x8c4d('0x2d')][_0x8c4d('0x3e')]){_0x5dfb6f[_0x8c4d('0x3f')]=[{'all':!![]}];}return db['SquareMessage'][_0x8c4d('0x40')](_0x5dfb6f);})[_0x8c4d('0x24')](function(_0x5d930c){_0x476266[_0x8c4d('0x41')]=_0x5d930c;return _0x476266;})['then'](respondWithFilteredResult(_0x10ef81,_0x5dfb6f))[_0x8c4d('0x42')](handleError(_0x10ef81,null));};exports[_0x8c4d('0x43')]=function(_0xf30b0d,_0x22487e){var _0x5ed269={'raw':!![],'where':{'id':_0xf30b0d[_0x8c4d('0x44')]['id']}},_0x3d95fd={};_0x3d95fd[_0x8c4d('0x32')]=_[_0x8c4d('0x2e')](db['SquareMessage']['rawAttributes']);_0x3d95fd['query']=_[_0x8c4d('0x2e')](_0xf30b0d[_0x8c4d('0x2d')]);_0x3d95fd[_0x8c4d('0x2f')]=_['intersection'](_0x3d95fd['model'],_0x3d95fd[_0x8c4d('0x2d')]);_0x5ed269[_0x8c4d('0x30')]=_[_0x8c4d('0x31')](_0x3d95fd['model'],qs[_0x8c4d('0x45')](_0xf30b0d[_0x8c4d('0x2d')][_0x8c4d('0x45')]));_0x5ed269[_0x8c4d('0x30')]=_0x5ed269[_0x8c4d('0x30')]['length']?_0x5ed269[_0x8c4d('0x30')]:_0x3d95fd['model'];if(_0xf30b0d['query'][_0x8c4d('0x3e')]){_0x5ed269['include']=[{'all':!![]}];}_0x5ed269=_['merge']({},_0x5ed269,_0xf30b0d[_0x8c4d('0x3d')]);return db[_0x8c4d('0x29')][_0x8c4d('0x46')](_0x5ed269)[_0x8c4d('0x24')](handleEntityNotFound(_0x22487e,null))['then'](respondWithResult(_0x22487e,null))[_0x8c4d('0x42')](handleError(_0x22487e,null));};exports[_0x8c4d('0x47')]=function(_0x590c79,_0x44c0d8){return db[_0x8c4d('0x29')][_0x8c4d('0x47')](_0x590c79[_0x8c4d('0x48')],{})[_0x8c4d('0x24')](respondWithResult(_0x44c0d8,0xc9))['catch'](handleError(_0x44c0d8,null));};exports[_0x8c4d('0x23')]=function(_0x1b7801,_0x3018e2){if(_0x1b7801[_0x8c4d('0x48')]['id']){delete _0x1b7801['body']['id'];}return db[_0x8c4d('0x29')][_0x8c4d('0x46')]({'where':{'id':_0x1b7801[_0x8c4d('0x44')]['id']}})[_0x8c4d('0x24')](handleEntityNotFound(_0x3018e2,null))[_0x8c4d('0x24')](saveUpdates(_0x1b7801[_0x8c4d('0x48')],null))[_0x8c4d('0x24')](respondWithResult(_0x3018e2,null))[_0x8c4d('0x42')](handleError(_0x3018e2,null));};exports[_0x8c4d('0x25')]=function(_0xa4ec88,_0x396e8c){return db[_0x8c4d('0x29')][_0x8c4d('0x46')]({'where':{'id':_0xa4ec88[_0x8c4d('0x44')]['id']}})[_0x8c4d('0x24')](handleEntityNotFound(_0x396e8c,null))[_0x8c4d('0x24')](removeEntity(_0x396e8c,null))[_0x8c4d('0x42')](handleError(_0x396e8c,null));}; \ No newline at end of file +var _0x7334=['params','keys','rawAttributes','length','include','find','create','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','error','name','send','map','SquareMessage','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show'];(function(_0x48b446,_0x56ca7c){var _0x474008=function(_0x12b579){while(--_0x12b579){_0x48b446['push'](_0x48b446['shift']());}};_0x474008(++_0x56ca7c);}(_0x7334,0x184));var _0x4733=function(_0x5c3ec0,_0x24e394){_0x5c3ec0=_0x5c3ec0-0x0;var _0x3f9787=_0x7334[_0x5c3ec0];return _0x3f9787;};'use strict';var emlformat=require(_0x4733('0x0'));var rimraf=require(_0x4733('0x1'));var zipdir=require(_0x4733('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4733('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4733('0x4'));var util=require(_0x4733('0x5'));var path=require(_0x4733('0x6'));var sox=require(_0x4733('0x7'));var csv=require(_0x4733('0x8'));var ejs=require(_0x4733('0x9'));var fs=require('fs');var fs_extra=require(_0x4733('0xa'));var _=require(_0x4733('0xb'));var squel=require(_0x4733('0xc'));var crypto=require(_0x4733('0xd'));var jsforce=require(_0x4733('0xe'));var deskjs=require(_0x4733('0xf'));var toCsv=require(_0x4733('0x8'));var querystring=require(_0x4733('0x10'));var Papa=require(_0x4733('0x11'));var Redis=require(_0x4733('0x12'));var authService=require(_0x4733('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4733('0x14'));var hardwareService=require(_0x4733('0x15'));var logger=require('../../config/logger')(_0x4733('0x16'));var utils=require('../../config/utils');var config=require(_0x4733('0x17'));var licenseUtil=require(_0x4733('0x18'));var db=require(_0x4733('0x19'))['db'];function respondWithStatusCode(_0x461f74,_0x100ecd){_0x100ecd=_0x100ecd||0xcc;return function(_0x1c146c){if(_0x1c146c){return _0x461f74[_0x4733('0x1a')](_0x100ecd);}return _0x461f74['status'](_0x100ecd)[_0x4733('0x1b')]();};}function respondWithResult(_0x543caf,_0x4327f3){_0x4327f3=_0x4327f3||0xc8;return function(_0x1a22e4){if(_0x1a22e4){return _0x543caf[_0x4733('0x1c')](_0x4327f3)[_0x4733('0x1d')](_0x1a22e4);}};}function respondWithFilteredResult(_0x3813df,_0x167016){return function(_0x12f111){if(_0x12f111){var _0x9fff=typeof _0x167016[_0x4733('0x1e')]==='undefined'&&typeof _0x167016[_0x4733('0x1f')]===_0x4733('0x20');var _0x47b129=_0x12f111[_0x4733('0x21')];var _0x1d2fb6=_0x9fff?0x0:_0x167016[_0x4733('0x1e')];var _0x384e0c=_0x9fff?_0x12f111['count']:_0x167016['offset']+_0x167016[_0x4733('0x1f')];var _0x3b730a;if(_0x384e0c>=_0x47b129){_0x384e0c=_0x47b129;_0x3b730a=0xc8;}else{_0x3b730a=0xce;}_0x3813df['status'](_0x3b730a);return _0x3813df[_0x4733('0x22')](_0x4733('0x23'),_0x1d2fb6+'-'+_0x384e0c+'/'+_0x47b129)[_0x4733('0x1d')](_0x12f111);}return null;};}function patchUpdates(_0x7a4e0){return function(_0x493cd3){try{jsonpatch[_0x4733('0x24')](_0x493cd3,_0x7a4e0,!![]);}catch(_0xb45e1){return BPromise['reject'](_0xb45e1);}return _0x493cd3[_0x4733('0x25')]();};}function saveUpdates(_0x18da47,_0x478e34){return function(_0x15a291){if(_0x15a291){return _0x15a291[_0x4733('0x26')](_0x18da47)[_0x4733('0x27')](function(_0x1a0643){return _0x1a0643;});}return null;};}function removeEntity(_0x3a2542,_0x24db74){return function(_0x180049){if(_0x180049){return _0x180049[_0x4733('0x28')]()['then'](function(){_0x3a2542[_0x4733('0x1c')](0xcc)[_0x4733('0x1b')]();});}};}function handleEntityNotFound(_0x7884e5,_0x2cb247){return function(_0x30ee9b){if(!_0x30ee9b){_0x7884e5[_0x4733('0x1a')](0x194);}return _0x30ee9b;};}function handleError(_0x24fc0d,_0xc3ab0a){_0xc3ab0a=_0xc3ab0a||0x1f4;return function(_0x13bc12){logger[_0x4733('0x29')](_0x13bc12['stack']);if(_0x13bc12[_0x4733('0x2a')]){delete _0x13bc12['name'];}_0x24fc0d['status'](_0xc3ab0a)[_0x4733('0x2b')](_0x13bc12);};}exports['index']=function(_0xcde4f4,_0x479989){var _0x4abc0d={},_0x517c73={},_0x2976b0={'count':0x0,'rows':[]};var _0x3bfe53=_[_0x4733('0x2c')](db[_0x4733('0x2d')]['rawAttributes'],function(_0x538a7c){return{'name':_0x538a7c['fieldName'],'type':_0x538a7c[_0x4733('0x2e')]['key']};});_0x517c73['model']=_[_0x4733('0x2c')](_0x3bfe53,_0x4733('0x2a'));_0x517c73[_0x4733('0x2f')]=_['keys'](_0xcde4f4['query']);_0x517c73[_0x4733('0x30')]=_[_0x4733('0x31')](_0x517c73[_0x4733('0x32')],_0x517c73[_0x4733('0x2f')]);_0x4abc0d[_0x4733('0x33')]=_['intersection'](_0x517c73[_0x4733('0x32')],qs[_0x4733('0x34')](_0xcde4f4[_0x4733('0x2f')][_0x4733('0x34')]));_0x4abc0d[_0x4733('0x33')]=_0x4abc0d['attributes']['length']?_0x4abc0d[_0x4733('0x33')]:_0x517c73[_0x4733('0x32')];if(!_0xcde4f4[_0x4733('0x2f')][_0x4733('0x35')](_0x4733('0x36'))){_0x4abc0d['limit']=qs[_0x4733('0x1f')](_0xcde4f4[_0x4733('0x2f')][_0x4733('0x1f')]);_0x4abc0d['offset']=qs[_0x4733('0x1e')](_0xcde4f4[_0x4733('0x2f')][_0x4733('0x1e')]);}_0x4abc0d[_0x4733('0x37')]=qs[_0x4733('0x38')](_0xcde4f4[_0x4733('0x2f')][_0x4733('0x38')]);_0x4abc0d[_0x4733('0x39')]=qs['filters'](_[_0x4733('0x3a')](_0xcde4f4['query'],_0x517c73[_0x4733('0x30')]),_0x3bfe53);if(_0xcde4f4[_0x4733('0x2f')][_0x4733('0x3b')]){_0x4abc0d[_0x4733('0x39')]=_[_0x4733('0x3c')](_0x4abc0d[_0x4733('0x39')],{'$or':_[_0x4733('0x2c')](_0x3bfe53,function(_0x15ab49){if(_0x15ab49['type']!==_0x4733('0x3d')){var _0x68d682={};_0x68d682[_0x15ab49['name']]={'$like':'%'+_0xcde4f4[_0x4733('0x2f')][_0x4733('0x3b')]+'%'};return _0x68d682;}})});}_0x4abc0d=_['merge']({},_0x4abc0d,_0xcde4f4[_0x4733('0x3e')]);var _0x50849a={'where':_0x4abc0d[_0x4733('0x39')]};return db['SquareMessage'][_0x4733('0x21')](_0x50849a)[_0x4733('0x27')](function(_0x5d4b95){_0x2976b0['count']=_0x5d4b95;if(_0xcde4f4[_0x4733('0x2f')][_0x4733('0x3f')]){_0x4abc0d['include']=[{'all':!![]}];}return db[_0x4733('0x2d')][_0x4733('0x40')](_0x4abc0d);})[_0x4733('0x27')](function(_0x28ed14){_0x2976b0[_0x4733('0x41')]=_0x28ed14;return _0x2976b0;})[_0x4733('0x27')](respondWithFilteredResult(_0x479989,_0x4abc0d))[_0x4733('0x42')](handleError(_0x479989,null));};exports[_0x4733('0x43')]=function(_0x1f04dd,_0x42e055){var _0x444471={'raw':!![],'where':{'id':_0x1f04dd[_0x4733('0x44')]['id']}},_0x1d32df={};_0x1d32df[_0x4733('0x32')]=_[_0x4733('0x45')](db[_0x4733('0x2d')][_0x4733('0x46')]);_0x1d32df[_0x4733('0x2f')]=_['keys'](_0x1f04dd[_0x4733('0x2f')]);_0x1d32df[_0x4733('0x30')]=_[_0x4733('0x31')](_0x1d32df[_0x4733('0x32')],_0x1d32df[_0x4733('0x2f')]);_0x444471[_0x4733('0x33')]=_[_0x4733('0x31')](_0x1d32df[_0x4733('0x32')],qs[_0x4733('0x34')](_0x1f04dd[_0x4733('0x2f')][_0x4733('0x34')]));_0x444471[_0x4733('0x33')]=_0x444471[_0x4733('0x33')][_0x4733('0x47')]?_0x444471['attributes']:_0x1d32df['model'];if(_0x1f04dd[_0x4733('0x2f')][_0x4733('0x3f')]){_0x444471[_0x4733('0x48')]=[{'all':!![]}];}_0x444471=_[_0x4733('0x3c')]({},_0x444471,_0x1f04dd[_0x4733('0x3e')]);return db[_0x4733('0x2d')][_0x4733('0x49')](_0x444471)[_0x4733('0x27')](handleEntityNotFound(_0x42e055,null))[_0x4733('0x27')](respondWithResult(_0x42e055,null))[_0x4733('0x42')](handleError(_0x42e055,null));};exports['create']=function(_0x4c5f4e,_0x51e201){return db['SquareMessage'][_0x4733('0x4a')](_0x4c5f4e[_0x4733('0x4b')],{})[_0x4733('0x27')](respondWithResult(_0x51e201,0xc9))[_0x4733('0x42')](handleError(_0x51e201,null));};exports[_0x4733('0x26')]=function(_0x45b9cf,_0x1c6abf){if(_0x45b9cf[_0x4733('0x4b')]['id']){delete _0x45b9cf[_0x4733('0x4b')]['id'];}return db[_0x4733('0x2d')]['find']({'where':{'id':_0x45b9cf['params']['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x1c6abf,null))['then'](saveUpdates(_0x45b9cf[_0x4733('0x4b')],null))[_0x4733('0x27')](respondWithResult(_0x1c6abf,null))[_0x4733('0x42')](handleError(_0x1c6abf,null));};exports['destroy']=function(_0x3f2a78,_0x45c9ad){return db[_0x4733('0x2d')][_0x4733('0x49')]({'where':{'id':_0x3f2a78[_0x4733('0x44')]['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x45c9ad,null))[_0x4733('0x27')](removeEntity(_0x45c9ad,null))[_0x4733('0x42')](handleError(_0x45c9ad,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index b4ae52b..7cdb8b9 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 _0x85f3=['path','rimraf','./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2ba24f,_0x1e67d4){var _0x564da4=function(_0x3f3c06){while(--_0x3f3c06){_0x2ba24f['push'](_0x2ba24f['shift']());}};_0x564da4(++_0x1e67d4);}(_0x85f3,0x132));var _0x385f=function(_0xd73d53,_0x598443){_0xd73d53=_0xd73d53-0x0;var _0x560148=_0x85f3[_0xd73d53];return _0x560148;};'use strict';var _=require(_0x385f('0x0'));var util=require('util');var logger=require(_0x385f('0x1'))(_0x385f('0x2'));var moment=require(_0x385f('0x3'));var BPromise=require(_0x385f('0x4'));var rp=require(_0x385f('0x5'));var fs=require('fs');var path=require(_0x385f('0x6'));var rimraf=require(_0x385f('0x7'));var config=require('../../config/environment');var attributes=require(_0x385f('0x8'));module[_0x385f('0x9')]=function(_0x18ae19,_0x5c8a1e){return _0x18ae19[_0x385f('0xa')](_0x385f('0xb'),attributes,{'tableName':_0x385f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63df=['../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x56917b,_0x210955){var _0x3577bc=function(_0x2e016b){while(--_0x2e016b){_0x56917b['push'](_0x56917b['shift']());}};_0x3577bc(++_0x210955);}(_0x63df,0xa1));var _0xf63d=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x63df[_0x2112d4];return _0x434972;};'use strict';var _=require(_0xf63d('0x0'));var util=require(_0xf63d('0x1'));var logger=require(_0xf63d('0x2'))(_0xf63d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf63d('0x4'));var fs=require('fs');var path=require(_0xf63d('0x5'));var rimraf=require(_0xf63d('0x6'));var config=require(_0xf63d('0x7'));var attributes=require(_0xf63d('0x8'));module[_0xf63d('0x9')]=function(_0xe527df,_0x13f16b){return _0xe527df[_0xf63d('0xa')](_0xf63d('0xb'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index d979fc0..bcf3f4d 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 _0x8e27=['lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareMessage','body','options','raw','debug'];(function(_0x2a2840,_0x19c9a2){var _0xecebc9=function(_0x1777af){while(--_0x1777af){_0x2a2840['push'](_0x2a2840['shift']());}};_0xecebc9(++_0x19c9a2);}(_0x8e27,0xa2));var _0x78e2=function(_0x291e0e,_0x792683){_0x291e0e=_0x291e0e-0x0;var _0x3f85f3=_0x8e27[_0x291e0e];return _0x3f85f3;};'use strict';var _=require(_0x78e2('0x0'));var util=require(_0x78e2('0x1'));var moment=require(_0x78e2('0x2'));var BPromise=require(_0x78e2('0x3'));var rs=require(_0x78e2('0x4'));var fs=require('fs');var Redis=require(_0x78e2('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x78e2('0x6'));var config=require(_0x78e2('0x7'));var jayson=require(_0x78e2('0x8'));var client=jayson[_0x78e2('0x9')][_0x78e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e71ce,_0x356ea9,_0x17a522){return new BPromise(function(_0x1a5fc9,_0x286a10){return client['request'](_0x2e71ce,_0x17a522)[_0x78e2('0xb')](function(_0xbf81c2){logger[_0x78e2('0xc')](_0x78e2('0xd'),_0x356ea9,_0x78e2('0xe'));logger['debug'](_0x78e2('0xf'),_0x356ea9,_0x78e2('0xe'),JSON[_0x78e2('0x10')](_0xbf81c2));if(_0xbf81c2[_0x78e2('0x11')]){if(_0xbf81c2[_0x78e2('0x11')][_0x78e2('0x12')]===0x1f4){logger[_0x78e2('0x11')]('SquareMessage,\x20%s,\x20%s',_0x356ea9,_0xbf81c2[_0x78e2('0x11')]['message']);return _0x286a10(_0xbf81c2[_0x78e2('0x11')][_0x78e2('0x13')]);}logger[_0x78e2('0x11')]('SquareMessage,\x20%s,\x20%s',_0x356ea9,_0xbf81c2[_0x78e2('0x11')][_0x78e2('0x13')]);return _0x1a5fc9(_0xbf81c2[_0x78e2('0x11')][_0x78e2('0x13')]);}else{logger['info'](_0x78e2('0xd'),_0x356ea9,_0x78e2('0xe'));_0x1a5fc9(_0xbf81c2[_0x78e2('0x14')][_0x78e2('0x13')]);}})[_0x78e2('0x15')](function(_0x2d8a9f){logger['error'](_0x78e2('0xd'),_0x356ea9,_0x2d8a9f);_0x286a10(_0x2d8a9f);});});}exports[_0x78e2('0x16')]=function(_0x3f8b4b){var _0x5509a0=this;return new Promise(function(_0x516a2a,_0x2e958e){return db['SquareMessage']['create'](_0x3f8b4b[_0x78e2('0x17')],{'raw':_0x3f8b4b[_0x78e2('0x18')]?_0x3f8b4b[_0x78e2('0x18')][_0x78e2('0x19')]===undefined?!![]:![]:!![]})[_0x78e2('0xb')](function(_0x343257){logger[_0x78e2('0xc')](_0x78e2('0x16'),_0x3f8b4b);logger[_0x78e2('0x1a')](_0x78e2('0x16'),_0x3f8b4b,JSON[_0x78e2('0x10')](_0x343257));_0x516a2a(_0x343257);})[_0x78e2('0x15')](function(_0x359a08){logger[_0x78e2('0x11')](_0x78e2('0x16'),_0x359a08[_0x78e2('0x13')],_0x3f8b4b);_0x2e958e(_0x5509a0[_0x78e2('0x11')](0x1f4,_0x359a08[_0x78e2('0x13')]));});});}; \ No newline at end of file +var _0x505c=['error','code','message','result','catch','CreateSquareMessage','SquareMessage','create','body','options','raw','debug','lodash','util','moment','bluebird','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4b4b0e,_0x6c674){var _0x4c2d91=function(_0x4d440d){while(--_0x4d440d){_0x4b4b0e['push'](_0x4b4b0e['shift']());}};_0x4c2d91(++_0x6c674);}(_0x505c,0xd7));var _0xc505=function(_0x2583a7,_0x3beef9){_0x2583a7=_0x2583a7-0x0;var _0x35de7b=_0x505c[_0x2583a7];return _0x35de7b;};'use strict';var _=require(_0xc505('0x0'));var util=require(_0xc505('0x1'));var moment=require(_0xc505('0x2'));var BPromise=require(_0xc505('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc505('0x4'));var logger=require('../../config/logger')(_0xc505('0x5'));var config=require(_0xc505('0x6'));var jayson=require(_0xc505('0x7'));var client=jayson[_0xc505('0x8')][_0xc505('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbb8f4f,_0x20c319,_0x42b624){return new BPromise(function(_0xb89a9d,_0x393e11){return client[_0xc505('0xa')](_0xbb8f4f,_0x42b624)[_0xc505('0xb')](function(_0x4ff151){logger[_0xc505('0xc')](_0xc505('0xd'),_0x20c319,'request\x20sent');logger['debug'](_0xc505('0xe'),_0x20c319,_0xc505('0xf'),JSON[_0xc505('0x10')](_0x4ff151));if(_0x4ff151[_0xc505('0x11')]){if(_0x4ff151[_0xc505('0x11')][_0xc505('0x12')]===0x1f4){logger['error'](_0xc505('0xd'),_0x20c319,_0x4ff151['error']['message']);return _0x393e11(_0x4ff151['error']['message']);}logger[_0xc505('0x11')]('SquareMessage,\x20%s,\x20%s',_0x20c319,_0x4ff151[_0xc505('0x11')]['message']);return _0xb89a9d(_0x4ff151[_0xc505('0x11')][_0xc505('0x13')]);}else{logger[_0xc505('0xc')](_0xc505('0xd'),_0x20c319,_0xc505('0xf'));_0xb89a9d(_0x4ff151[_0xc505('0x14')][_0xc505('0x13')]);}})[_0xc505('0x15')](function(_0x4ec985){logger[_0xc505('0x11')]('SquareMessage,\x20%s,\x20%s',_0x20c319,_0x4ec985);_0x393e11(_0x4ec985);});});}exports[_0xc505('0x16')]=function(_0x15fce8){var _0x44cdc1=this;return new Promise(function(_0x350fa2,_0x15dcde){return db[_0xc505('0x17')][_0xc505('0x18')](_0x15fce8[_0xc505('0x19')],{'raw':_0x15fce8[_0xc505('0x1a')]?_0x15fce8['options'][_0xc505('0x1b')]===undefined?!![]:![]:!![]})[_0xc505('0xb')](function(_0x4837a2){logger[_0xc505('0xc')]('CreateSquareMessage',_0x15fce8);logger[_0xc505('0x1c')](_0xc505('0x16'),_0x15fce8,JSON['stringify'](_0x4837a2));_0x350fa2(_0x4837a2);})[_0xc505('0x15')](function(_0x8ae6f1){logger[_0xc505('0x11')](_0xc505('0x16'),_0x8ae6f1[_0xc505('0x13')],_0x15fce8);_0x15dcde(_0x44cdc1[_0xc505('0x11')](0x1f4,_0x8ae6f1[_0xc505('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index f64c703..0a318b4 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 _0xc609=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','/:id/test','15s','post','create','put'];(function(_0x1e451e,_0x5c27d1){var _0x324014=function(_0x1a2b32){while(--_0x1a2b32){_0x1e451e['push'](_0x1e451e['shift']());}};_0x324014(++_0x5c27d1);}(_0xc609,0x1d1));var _0x9c60=function(_0x316ff9,_0x2ed79f){_0x316ff9=_0x316ff9-0x0;var _0x3a1328=_0xc609[_0x316ff9];return _0x3a1328;};'use strict';var multer=require(_0x9c60('0x0'));var util=require(_0x9c60('0x1'));var path=require(_0x9c60('0x2'));var timeout=require(_0x9c60('0x3'));var express=require(_0x9c60('0x4'));var router=express[_0x9c60('0x5')]();var fs_extra=require(_0x9c60('0x6'));var auth=require(_0x9c60('0x7'));var interaction=require(_0x9c60('0x8'));var config=require(_0x9c60('0x9'));var controller=require('./squareOdbc.controller');router[_0x9c60('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9c60('0xa')](_0x9c60('0xb'),auth[_0x9c60('0xc')](),controller['show']);router[_0x9c60('0xa')](_0x9c60('0xd'),auth[_0x9c60('0xc')](),timeout(_0x9c60('0xe')),controller['test']);router[_0x9c60('0xf')]('/',auth[_0x9c60('0xc')](),controller[_0x9c60('0x10')]);router[_0x9c60('0x11')](_0x9c60('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x9c60('0x12')](_0x9c60('0xb'),auth['isAuthenticated'](),controller[_0x9c60('0x13')]);module[_0x9c60('0x14')]=router; \ No newline at end of file +var _0xebb9=['get','isAuthenticated','index','/:id','/:id/test','15s','test','put','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/interaction/service','./squareOdbc.controller'];(function(_0x57efe4,_0x572b1b){var _0x4abbae=function(_0x5a6af9){while(--_0x5a6af9){_0x57efe4['push'](_0x57efe4['shift']());}};_0x4abbae(++_0x572b1b);}(_0xebb9,0x150));var _0x9ebb=function(_0x3d8ff,_0x20ece7){_0x3d8ff=_0x3d8ff-0x0;var _0x36da3d=_0xebb9[_0x3d8ff];return _0x36da3d;};'use strict';var multer=require(_0x9ebb('0x0'));var util=require('util');var path=require(_0x9ebb('0x1'));var timeout=require('connect-timeout');var express=require(_0x9ebb('0x2'));var router=express['Router']();var fs_extra=require(_0x9ebb('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x9ebb('0x4'));var config=require('../../config/environment');var controller=require(_0x9ebb('0x5'));router[_0x9ebb('0x6')]('/',auth[_0x9ebb('0x7')](),controller[_0x9ebb('0x8')]);router[_0x9ebb('0x6')](_0x9ebb('0x9'),auth[_0x9ebb('0x7')](),controller['show']);router['get'](_0x9ebb('0xa'),auth[_0x9ebb('0x7')](),timeout(_0x9ebb('0xb')),controller[_0x9ebb('0xc')]);router['post']('/',auth[_0x9ebb('0x7')](),controller['create']);router[_0x9ebb('0xd')]('/:id',auth[_0x9ebb('0x7')](),controller[_0x9ebb('0xe')]);router[_0x9ebb('0xf')]('/:id',auth[_0x9ebb('0x7')](),controller[_0x9ebb('0x10')]);module[_0x9ebb('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index e875c90..bd81a4e 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 _0x5c5f=['STRING','sequelize','exports'];(function(_0x5e7de0,_0x3d6b19){var _0x3a627d=function(_0x1ffee2){while(--_0x1ffee2){_0x5e7de0['push'](_0x5e7de0['shift']());}};_0x3a627d(++_0x3d6b19);}(_0x5c5f,0x1d8));var _0xf5c5=function(_0x456a49,_0x80653c){_0x456a49=_0x456a49-0x0;var _0x4dc2ba=_0x5c5f[_0x456a49];return _0x4dc2ba;};'use strict';var Sequelize=require(_0xf5c5('0x0'));module[_0xf5c5('0x1')]={'name':{'type':Sequelize[_0xf5c5('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xf5c5('0x2')]},'description':{'type':Sequelize[_0xf5c5('0x2')]}}; \ No newline at end of file +var _0xeef0=['exports','name','STRING','sequelize'];(function(_0x869432,_0x298980){var _0x48a9cc=function(_0x3e4e8c){while(--_0x3e4e8c){_0x869432['push'](_0x869432['shift']());}};_0x48a9cc(++_0x298980);}(_0xeef0,0xef));var _0x0eef=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xeef0[_0x4c445a];return _0x2f611c;};'use strict';var Sequelize=require(_0x0eef('0x0'));module[_0x0eef('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0eef('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x0eef('0x3')]},'description':{'type':Sequelize[_0x0eef('0x3')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index f5a436a..ed02148 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 _0x7f97=['offset','set','Content-Range','reject','save','destroy','then','get','ODBC','end','name','send','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','SquareOdbc','findAll','rows','catch','show','params','keys','includeAll','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','dsn','odbc','openSync','closeSync','rimraf','zip-dir','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','count'];(function(_0x542da8,_0x509c26){var _0x533d7e=function(_0x2a3d04){while(--_0x2a3d04){_0x542da8['push'](_0x542da8['shift']());}};_0x533d7e(++_0x509c26);}(_0x7f97,0x196));var _0x77f9=function(_0x382384,_0x446aba){_0x382384=_0x382384-0x0;var _0x6d92b5=_0x7f97[_0x382384];return _0x6d92b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x77f9('0x0'));var zipdir=require(_0x77f9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x77f9('0x2'));var moment=require('moment');var BPromise=require(_0x77f9('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x77f9('0x4'));var sox=require(_0x77f9('0x5'));var csv=require(_0x77f9('0x6'));var ejs=require(_0x77f9('0x7'));var fs=require('fs');var fs_extra=require(_0x77f9('0x8'));var _=require('lodash');var squel=require(_0x77f9('0x9'));var crypto=require(_0x77f9('0xa'));var jsforce=require(_0x77f9('0xb'));var deskjs=require(_0x77f9('0xc'));var toCsv=require(_0x77f9('0x6'));var querystring=require(_0x77f9('0xd'));var Papa=require(_0x77f9('0xe'));var Redis=require(_0x77f9('0xf'));var authService=require(_0x77f9('0x10'));var qs=require(_0x77f9('0x11'));var as=require(_0x77f9('0x12'));var hardwareService=require(_0x77f9('0x13'));var logger=require(_0x77f9('0x14'))(_0x77f9('0x15'));var utils=require(_0x77f9('0x16'));var config=require(_0x77f9('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4aac03,_0x1ae84b){_0x1ae84b=_0x1ae84b||0xcc;return function(_0x2edd21){if(_0x2edd21){return _0x4aac03[_0x77f9('0x18')](_0x1ae84b);}return _0x4aac03[_0x77f9('0x19')](_0x1ae84b)['end']();};}function respondWithResult(_0x335fe5,_0x6415b1){_0x6415b1=_0x6415b1||0xc8;return function(_0x3dc699){if(_0x3dc699){return _0x335fe5[_0x77f9('0x19')](_0x6415b1)[_0x77f9('0x1a')](_0x3dc699);}};}function respondWithFilteredResult(_0x561417,_0x340431){return function(_0x21a619){if(_0x21a619){var _0x3e515d=typeof _0x340431['offset']==='undefined'&&typeof _0x340431['limit']===_0x77f9('0x1b');var _0x2813fa=_0x21a619[_0x77f9('0x1c')];var _0x38ceea=_0x3e515d?0x0:_0x340431[_0x77f9('0x1d')];var _0x162b4a=_0x3e515d?_0x21a619[_0x77f9('0x1c')]:_0x340431[_0x77f9('0x1d')]+_0x340431['limit'];var _0x123171;if(_0x162b4a>=_0x2813fa){_0x162b4a=_0x2813fa;_0x123171=0xc8;}else{_0x123171=0xce;}_0x561417[_0x77f9('0x19')](_0x123171);return _0x561417[_0x77f9('0x1e')](_0x77f9('0x1f'),_0x38ceea+'-'+_0x162b4a+'/'+_0x2813fa)['json'](_0x21a619);}return null;};}function patchUpdates(_0x2ba8d6){return function(_0x56ed54){try{jsonpatch['apply'](_0x56ed54,_0x2ba8d6,!![]);}catch(_0x4f525a){return BPromise[_0x77f9('0x20')](_0x4f525a);}return _0x56ed54[_0x77f9('0x21')]();};}function saveUpdates(_0x15c8f6,_0x4b3181){return function(_0x13135f){if(_0x13135f){return _0x13135f['update'](_0x15c8f6)['then'](function(_0x5d3951){return _0x5d3951;});}return null;};}function removeEntity(_0x270243,_0x34ce34){return function(_0x581c40){if(_0x581c40){return _0x581c40[_0x77f9('0x22')]()[_0x77f9('0x23')](function(){var _0x399bef=_0x581c40[_0x77f9('0x24')]({'plain':!![]});var _0xf9636d=_0x77f9('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0xf9636d,'resourceId':_0x399bef['id']}})[_0x77f9('0x23')](function(){return _0x581c40;});})[_0x77f9('0x23')](function(){_0x270243[_0x77f9('0x19')](0xcc)[_0x77f9('0x26')]();});}};}function handleEntityNotFound(_0x143048,_0x2414d9){return function(_0x2c5027){if(!_0x2c5027){_0x143048[_0x77f9('0x18')](0x194);}return _0x2c5027;};}function handleError(_0x52d7b6,_0x3b525b){_0x3b525b=_0x3b525b||0x1f4;return function(_0x4c9483){logger['error'](_0x4c9483['stack']);if(_0x4c9483[_0x77f9('0x27')]){delete _0x4c9483[_0x77f9('0x27')];}_0x52d7b6[_0x77f9('0x19')](_0x3b525b)[_0x77f9('0x28')](_0x4c9483);};}exports['index']=function(_0x31a80e,_0xae58e2){var _0x386077={},_0x355d65={},_0x4fc7fb={'count':0x0,'rows':[]};var _0x346a58=_[_0x77f9('0x29')](db['SquareOdbc'][_0x77f9('0x2a')],function(_0x26a621){return{'name':_0x26a621[_0x77f9('0x2b')],'type':_0x26a621[_0x77f9('0x2c')][_0x77f9('0x2d')]};});_0x355d65[_0x77f9('0x2e')]=_[_0x77f9('0x29')](_0x346a58,_0x77f9('0x27'));_0x355d65[_0x77f9('0x2f')]=_['keys'](_0x31a80e[_0x77f9('0x2f')]);_0x355d65['filters']=_[_0x77f9('0x30')](_0x355d65[_0x77f9('0x2e')],_0x355d65[_0x77f9('0x2f')]);_0x386077[_0x77f9('0x31')]=_[_0x77f9('0x30')](_0x355d65[_0x77f9('0x2e')],qs['fields'](_0x31a80e[_0x77f9('0x2f')][_0x77f9('0x32')]));_0x386077[_0x77f9('0x31')]=_0x386077[_0x77f9('0x31')][_0x77f9('0x33')]?_0x386077[_0x77f9('0x31')]:_0x355d65[_0x77f9('0x2e')];if(!_0x31a80e[_0x77f9('0x2f')]['hasOwnProperty']('nolimit')){_0x386077[_0x77f9('0x34')]=qs[_0x77f9('0x34')](_0x31a80e['query'][_0x77f9('0x34')]);_0x386077[_0x77f9('0x1d')]=qs[_0x77f9('0x1d')](_0x31a80e['query']['offset']);}_0x386077[_0x77f9('0x35')]=qs['sort'](_0x31a80e['query'][_0x77f9('0x36')]);_0x386077[_0x77f9('0x37')]=qs[_0x77f9('0x38')](_[_0x77f9('0x39')](_0x31a80e['query'],_0x355d65[_0x77f9('0x38')]),_0x346a58);if(_0x31a80e[_0x77f9('0x2f')][_0x77f9('0x3a')]){_0x386077[_0x77f9('0x37')]=_[_0x77f9('0x3b')](_0x386077['where'],{'$or':_[_0x77f9('0x29')](_0x346a58,function(_0x1aa776){if(_0x1aa776[_0x77f9('0x2c')]!==_0x77f9('0x3c')){var _0x1df8ad={};_0x1df8ad[_0x1aa776[_0x77f9('0x27')]]={'$like':'%'+_0x31a80e[_0x77f9('0x2f')][_0x77f9('0x3a')]+'%'};return _0x1df8ad;}})});}_0x386077=_['merge']({},_0x386077,_0x31a80e['options']);var _0x284602={'where':_0x386077[_0x77f9('0x37')]};return db['SquareOdbc'][_0x77f9('0x1c')](_0x284602)[_0x77f9('0x23')](function(_0x42bd69){_0x4fc7fb[_0x77f9('0x1c')]=_0x42bd69;if(_0x31a80e[_0x77f9('0x2f')]['includeAll']){_0x386077[_0x77f9('0x3d')]=[{'all':!![]}];}return db[_0x77f9('0x3e')][_0x77f9('0x3f')](_0x386077);})[_0x77f9('0x23')](function(_0x32e2d0){_0x4fc7fb[_0x77f9('0x40')]=_0x32e2d0;return _0x4fc7fb;})['then'](respondWithFilteredResult(_0xae58e2,_0x386077))[_0x77f9('0x41')](handleError(_0xae58e2,null));};exports[_0x77f9('0x42')]=function(_0x1d7597,_0x1e3d6b){var _0x4d794c={'raw':!![],'where':{'id':_0x1d7597[_0x77f9('0x43')]['id']}},_0x2aef9f={};_0x2aef9f['model']=_[_0x77f9('0x44')](db[_0x77f9('0x3e')][_0x77f9('0x2a')]);_0x2aef9f[_0x77f9('0x2f')]=_[_0x77f9('0x44')](_0x1d7597[_0x77f9('0x2f')]);_0x2aef9f[_0x77f9('0x38')]=_[_0x77f9('0x30')](_0x2aef9f[_0x77f9('0x2e')],_0x2aef9f[_0x77f9('0x2f')]);_0x4d794c[_0x77f9('0x31')]=_[_0x77f9('0x30')](_0x2aef9f[_0x77f9('0x2e')],qs[_0x77f9('0x32')](_0x1d7597[_0x77f9('0x2f')][_0x77f9('0x32')]));_0x4d794c['attributes']=_0x4d794c['attributes']['length']?_0x4d794c[_0x77f9('0x31')]:_0x2aef9f[_0x77f9('0x2e')];if(_0x1d7597['query'][_0x77f9('0x45')]){_0x4d794c[_0x77f9('0x3d')]=[{'all':!![]}];}_0x4d794c=_[_0x77f9('0x3b')]({},_0x4d794c,_0x1d7597[_0x77f9('0x46')]);return db['SquareOdbc'][_0x77f9('0x47')](_0x4d794c)[_0x77f9('0x23')](handleEntityNotFound(_0x1e3d6b,null))[_0x77f9('0x23')](respondWithResult(_0x1e3d6b,null))['catch'](handleError(_0x1e3d6b,null));};exports[_0x77f9('0x48')]=function(_0x52a87f,_0x4abad5){return db[_0x77f9('0x3e')][_0x77f9('0x48')](_0x52a87f['body'],{})[_0x77f9('0x23')](function(_0xa2cafa){var _0x15d728=_0x52a87f[_0x77f9('0x49')][_0x77f9('0x24')]({'plain':!![]});if(!_0x15d728)throw new Error(_0x77f9('0x4a'));if(_0x15d728[_0x77f9('0x4b')]===_0x77f9('0x49')){var _0x12fde4=_0xa2cafa[_0x77f9('0x24')]({'plain':!![]});var _0x2313c2=_0x77f9('0x25');return db['UserProfileSection'][_0x77f9('0x47')]({'where':{'name':_0x2313c2,'userProfileId':_0x15d728[_0x77f9('0x4c')]},'raw':!![]})[_0x77f9('0x23')](function(_0x410fae){if(_0x410fae&&_0x410fae[_0x77f9('0x4d')]===0x0){return db[_0x77f9('0x4e')][_0x77f9('0x48')]({'name':_0x12fde4[_0x77f9('0x27')],'resourceId':_0x12fde4['id'],'type':_0x410fae[_0x77f9('0x27')],'sectionId':_0x410fae['id']},{})['then'](function(){return _0xa2cafa;});}else{return _0xa2cafa;}})[_0x77f9('0x41')](function(_0x24266d){logger[_0x77f9('0x4f')](_0x77f9('0x50'),_0x24266d);throw _0x24266d;});}return _0xa2cafa;})[_0x77f9('0x23')](respondWithResult(_0x4abad5,0xc9))[_0x77f9('0x41')](handleError(_0x4abad5,null));};exports[_0x77f9('0x51')]=function(_0x2980f6,_0x89351d){if(_0x2980f6[_0x77f9('0x52')]['id']){delete _0x2980f6[_0x77f9('0x52')]['id'];}return db[_0x77f9('0x3e')]['find']({'where':{'id':_0x2980f6['params']['id']}})['then'](handleEntityNotFound(_0x89351d,null))[_0x77f9('0x23')](saveUpdates(_0x2980f6[_0x77f9('0x52')],null))['then'](respondWithResult(_0x89351d,null))[_0x77f9('0x41')](handleError(_0x89351d,null));};exports[_0x77f9('0x22')]=function(_0x3b0a8d,_0x514628){return db[_0x77f9('0x3e')][_0x77f9('0x47')]({'where':{'id':_0x3b0a8d['params']['id']}})[_0x77f9('0x23')](handleEntityNotFound(_0x514628,null))[_0x77f9('0x23')](removeEntity(_0x514628,null))[_0x77f9('0x41')](handleError(_0x514628,null));};exports['test']=function(_0x572b5a,_0x19484d,_0x4b3007){var _0x549954;return db[_0x77f9('0x3e')][_0x77f9('0x47')]({'where':{'id':_0x572b5a[_0x77f9('0x43')]['id']},'attributes':['id',_0x77f9('0x53')]})[_0x77f9('0x23')](handleEntityNotFound(_0x19484d,null))[_0x77f9('0x23')](function(_0x32ba99){if(_0x32ba99){var _0x4b1354=require(_0x77f9('0x54'))();_0x4b1354[_0x77f9('0x55')](_0x32ba99[_0x77f9('0x53')]);_0x4b1354[_0x77f9('0x56')]();return _0x32ba99;}})['then'](respondWithResult(_0x19484d,null))['catch'](handleError(_0x19484d,null));}; \ No newline at end of file +var _0x6c07=['map','SquareOdbc','fieldName','model','keys','filters','intersection','fields','query','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','merge','options','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','openSync','closeSync','eml-format','rimraf','fast-json-patch','request-promise','moment','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','error','stack','name'];(function(_0x30cd7e,_0x4db10a){var _0x462a02=function(_0x157d81){while(--_0x157d81){_0x30cd7e['push'](_0x30cd7e['shift']());}};_0x462a02(++_0x4db10a);}(_0x6c07,0x185));var _0x76c0=function(_0x161bbe,_0x580d2b){_0x161bbe=_0x161bbe-0x0;var _0x206207=_0x6c07[_0x161bbe];return _0x206207;};'use strict';var emlformat=require(_0x76c0('0x0'));var rimraf=require(_0x76c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x76c0('0x2'));var rp=require(_0x76c0('0x3'));var moment=require(_0x76c0('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x76c0('0x5'));var csv=require(_0x76c0('0x6'));var ejs=require(_0x76c0('0x7'));var fs=require('fs');var fs_extra=require(_0x76c0('0x8'));var _=require(_0x76c0('0x9'));var squel=require(_0x76c0('0xa'));var crypto=require(_0x76c0('0xb'));var jsforce=require(_0x76c0('0xc'));var deskjs=require(_0x76c0('0xd'));var toCsv=require(_0x76c0('0x6'));var querystring=require(_0x76c0('0xe'));var Papa=require('papaparse');var Redis=require(_0x76c0('0xf'));var authService=require(_0x76c0('0x10'));var qs=require(_0x76c0('0x11'));var as=require(_0x76c0('0x12'));var hardwareService=require(_0x76c0('0x13'));var logger=require(_0x76c0('0x14'))(_0x76c0('0x15'));var utils=require(_0x76c0('0x16'));var config=require(_0x76c0('0x17'));var licenseUtil=require(_0x76c0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e8ec3,_0x2cffe8){_0x2cffe8=_0x2cffe8||0xcc;return function(_0x46b021){if(_0x46b021){return _0x3e8ec3[_0x76c0('0x19')](_0x2cffe8);}return _0x3e8ec3['status'](_0x2cffe8)[_0x76c0('0x1a')]();};}function respondWithResult(_0x1ed7fb,_0x2e52a5){_0x2e52a5=_0x2e52a5||0xc8;return function(_0xcf2024){if(_0xcf2024){return _0x1ed7fb[_0x76c0('0x1b')](_0x2e52a5)[_0x76c0('0x1c')](_0xcf2024);}};}function respondWithFilteredResult(_0x173de3,_0x487983){return function(_0x55976a){if(_0x55976a){var _0x60a3ed=typeof _0x487983[_0x76c0('0x1d')]===_0x76c0('0x1e')&&typeof _0x487983[_0x76c0('0x1f')]==='undefined';var _0x17c307=_0x55976a[_0x76c0('0x20')];var _0x508622=_0x60a3ed?0x0:_0x487983[_0x76c0('0x1d')];var _0x956fef=_0x60a3ed?_0x55976a[_0x76c0('0x20')]:_0x487983[_0x76c0('0x1d')]+_0x487983[_0x76c0('0x1f')];var _0x4c414d;if(_0x956fef>=_0x17c307){_0x956fef=_0x17c307;_0x4c414d=0xc8;}else{_0x4c414d=0xce;}_0x173de3['status'](_0x4c414d);return _0x173de3[_0x76c0('0x21')]('Content-Range',_0x508622+'-'+_0x956fef+'/'+_0x17c307)[_0x76c0('0x1c')](_0x55976a);}return null;};}function patchUpdates(_0x20ab61){return function(_0x433ed1){try{jsonpatch[_0x76c0('0x22')](_0x433ed1,_0x20ab61,!![]);}catch(_0x5811ec){return BPromise[_0x76c0('0x23')](_0x5811ec);}return _0x433ed1[_0x76c0('0x24')]();};}function saveUpdates(_0x494f74,_0x151e75){return function(_0x5da421){if(_0x5da421){return _0x5da421[_0x76c0('0x25')](_0x494f74)[_0x76c0('0x26')](function(_0x6d6776){return _0x6d6776;});}return null;};}function removeEntity(_0x4cdfbb,_0x4e534d){return function(_0x17d662){if(_0x17d662){return _0x17d662[_0x76c0('0x27')]()[_0x76c0('0x26')](function(){var _0x10d7d0=_0x17d662[_0x76c0('0x28')]({'plain':!![]});var _0xb747a1=_0x76c0('0x29');return db[_0x76c0('0x2a')][_0x76c0('0x27')]({'where':{'type':_0xb747a1,'resourceId':_0x10d7d0['id']}})[_0x76c0('0x26')](function(){return _0x17d662;});})[_0x76c0('0x26')](function(){_0x4cdfbb[_0x76c0('0x1b')](0xcc)[_0x76c0('0x1a')]();});}};}function handleEntityNotFound(_0x526ac9,_0x363558){return function(_0x32ecc5){if(!_0x32ecc5){_0x526ac9['sendStatus'](0x194);}return _0x32ecc5;};}function handleError(_0x137d2d,_0x85f5ae){_0x85f5ae=_0x85f5ae||0x1f4;return function(_0x29c915){logger[_0x76c0('0x2b')](_0x29c915[_0x76c0('0x2c')]);if(_0x29c915[_0x76c0('0x2d')]){delete _0x29c915[_0x76c0('0x2d')];}_0x137d2d[_0x76c0('0x1b')](_0x85f5ae)['send'](_0x29c915);};}exports['index']=function(_0x5639c8,_0x55765f){var _0x18ddac={},_0x33e758={},_0x5dc8e1={'count':0x0,'rows':[]};var _0x3a3bd8=_[_0x76c0('0x2e')](db[_0x76c0('0x2f')]['rawAttributes'],function(_0x5733c8){return{'name':_0x5733c8[_0x76c0('0x30')],'type':_0x5733c8['type']['key']};});_0x33e758[_0x76c0('0x31')]=_[_0x76c0('0x2e')](_0x3a3bd8,_0x76c0('0x2d'));_0x33e758['query']=_[_0x76c0('0x32')](_0x5639c8['query']);_0x33e758[_0x76c0('0x33')]=_['intersection'](_0x33e758[_0x76c0('0x31')],_0x33e758['query']);_0x18ddac['attributes']=_[_0x76c0('0x34')](_0x33e758['model'],qs[_0x76c0('0x35')](_0x5639c8[_0x76c0('0x36')][_0x76c0('0x35')]));_0x18ddac[_0x76c0('0x37')]=_0x18ddac[_0x76c0('0x37')][_0x76c0('0x38')]?_0x18ddac['attributes']:_0x33e758['model'];if(!_0x5639c8[_0x76c0('0x36')][_0x76c0('0x39')](_0x76c0('0x3a'))){_0x18ddac[_0x76c0('0x1f')]=qs[_0x76c0('0x1f')](_0x5639c8['query'][_0x76c0('0x1f')]);_0x18ddac[_0x76c0('0x1d')]=qs[_0x76c0('0x1d')](_0x5639c8[_0x76c0('0x36')][_0x76c0('0x1d')]);}_0x18ddac[_0x76c0('0x3b')]=qs['sort'](_0x5639c8[_0x76c0('0x36')][_0x76c0('0x3c')]);_0x18ddac[_0x76c0('0x3d')]=qs[_0x76c0('0x33')](_['pick'](_0x5639c8[_0x76c0('0x36')],_0x33e758['filters']),_0x3a3bd8);if(_0x5639c8[_0x76c0('0x36')][_0x76c0('0x3e')]){_0x18ddac[_0x76c0('0x3d')]=_['merge'](_0x18ddac['where'],{'$or':_[_0x76c0('0x2e')](_0x3a3bd8,function(_0x59c84b){if(_0x59c84b[_0x76c0('0x3f')]!==_0x76c0('0x40')){var _0x18cbcf={};_0x18cbcf[_0x59c84b[_0x76c0('0x2d')]]={'$like':'%'+_0x5639c8[_0x76c0('0x36')][_0x76c0('0x3e')]+'%'};return _0x18cbcf;}})});}_0x18ddac=_[_0x76c0('0x41')]({},_0x18ddac,_0x5639c8[_0x76c0('0x42')]);var _0x37defe={'where':_0x18ddac[_0x76c0('0x3d')]};return db[_0x76c0('0x2f')][_0x76c0('0x20')](_0x37defe)[_0x76c0('0x26')](function(_0x353e3c){_0x5dc8e1[_0x76c0('0x20')]=_0x353e3c;if(_0x5639c8[_0x76c0('0x36')]['includeAll']){_0x18ddac[_0x76c0('0x43')]=[{'all':!![]}];}return db['SquareOdbc'][_0x76c0('0x44')](_0x18ddac);})['then'](function(_0x2f5040){_0x5dc8e1[_0x76c0('0x45')]=_0x2f5040;return _0x5dc8e1;})['then'](respondWithFilteredResult(_0x55765f,_0x18ddac))['catch'](handleError(_0x55765f,null));};exports[_0x76c0('0x46')]=function(_0x3c041d,_0x278aa7){var _0x29ea2a={'raw':!![],'where':{'id':_0x3c041d[_0x76c0('0x47')]['id']}},_0x4d7835={};_0x4d7835[_0x76c0('0x31')]=_[_0x76c0('0x32')](db[_0x76c0('0x2f')][_0x76c0('0x48')]);_0x4d7835[_0x76c0('0x36')]=_['keys'](_0x3c041d['query']);_0x4d7835['filters']=_[_0x76c0('0x34')](_0x4d7835[_0x76c0('0x31')],_0x4d7835['query']);_0x29ea2a[_0x76c0('0x37')]=_[_0x76c0('0x34')](_0x4d7835[_0x76c0('0x31')],qs[_0x76c0('0x35')](_0x3c041d['query'][_0x76c0('0x35')]));_0x29ea2a[_0x76c0('0x37')]=_0x29ea2a['attributes']['length']?_0x29ea2a[_0x76c0('0x37')]:_0x4d7835[_0x76c0('0x31')];if(_0x3c041d[_0x76c0('0x36')]['includeAll']){_0x29ea2a[_0x76c0('0x43')]=[{'all':!![]}];}_0x29ea2a=_[_0x76c0('0x41')]({},_0x29ea2a,_0x3c041d[_0x76c0('0x42')]);return db[_0x76c0('0x2f')][_0x76c0('0x49')](_0x29ea2a)[_0x76c0('0x26')](handleEntityNotFound(_0x278aa7,null))['then'](respondWithResult(_0x278aa7,null))[_0x76c0('0x4a')](handleError(_0x278aa7,null));};exports[_0x76c0('0x4b')]=function(_0x24d493,_0x74004){return db[_0x76c0('0x2f')]['create'](_0x24d493[_0x76c0('0x4c')],{})[_0x76c0('0x26')](function(_0x1fa551){var _0x5d0119=_0x24d493['user']['get']({'plain':!![]});if(!_0x5d0119)throw new Error(_0x76c0('0x4d'));if(_0x5d0119[_0x76c0('0x4e')]===_0x76c0('0x4f')){var _0x33b6a7=_0x1fa551[_0x76c0('0x28')]({'plain':!![]});var _0x47dcb6=_0x76c0('0x29');return db[_0x76c0('0x50')][_0x76c0('0x49')]({'where':{'name':_0x47dcb6,'userProfileId':_0x5d0119[_0x76c0('0x51')]},'raw':!![]})['then'](function(_0x4fbdba){if(_0x4fbdba&&_0x4fbdba[_0x76c0('0x52')]===0x0){return db['UserProfileResource'][_0x76c0('0x4b')]({'name':_0x33b6a7[_0x76c0('0x2d')],'resourceId':_0x33b6a7['id'],'type':_0x4fbdba[_0x76c0('0x2d')],'sectionId':_0x4fbdba['id']},{})[_0x76c0('0x26')](function(){return _0x1fa551;});}else{return _0x1fa551;}})[_0x76c0('0x4a')](function(_0x308ae2){logger[_0x76c0('0x2b')](_0x76c0('0x53'),_0x308ae2);throw _0x308ae2;});}return _0x1fa551;})[_0x76c0('0x26')](respondWithResult(_0x74004,0xc9))[_0x76c0('0x4a')](handleError(_0x74004,null));};exports['update']=function(_0x54c891,_0x20b166){if(_0x54c891[_0x76c0('0x4c')]['id']){delete _0x54c891[_0x76c0('0x4c')]['id'];}return db[_0x76c0('0x2f')][_0x76c0('0x49')]({'where':{'id':_0x54c891[_0x76c0('0x47')]['id']}})[_0x76c0('0x26')](handleEntityNotFound(_0x20b166,null))[_0x76c0('0x26')](saveUpdates(_0x54c891['body'],null))[_0x76c0('0x26')](respondWithResult(_0x20b166,null))[_0x76c0('0x4a')](handleError(_0x20b166,null));};exports[_0x76c0('0x27')]=function(_0x559326,_0x39e19d){return db[_0x76c0('0x2f')][_0x76c0('0x49')]({'where':{'id':_0x559326[_0x76c0('0x47')]['id']}})[_0x76c0('0x26')](handleEntityNotFound(_0x39e19d,null))[_0x76c0('0x26')](removeEntity(_0x39e19d,null))['catch'](handleError(_0x39e19d,null));};exports[_0x76c0('0x54')]=function(_0x45a237,_0x7502c0,_0x2143b8){var _0x17f945;return db[_0x76c0('0x2f')][_0x76c0('0x49')]({'where':{'id':_0x45a237[_0x76c0('0x47')]['id']},'attributes':['id','dsn']})[_0x76c0('0x26')](handleEntityNotFound(_0x7502c0,null))['then'](function(_0x3c41c5){if(_0x3c41c5){var _0x4ad2e0=require('odbc')();_0x4ad2e0[_0x76c0('0x55')](_0x3c41c5['dsn']);_0x4ad2e0[_0x76c0('0x56')]();return _0x3c41c5;}})['then'](respondWithResult(_0x7502c0,null))[_0x76c0('0x4a')](handleError(_0x7502c0,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index a6a783c..c943324 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 _0x59d7=['square_odbc','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment','./squareOdbc.attributes','define','SquareOdbc'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x59d7,0x1f0));var _0x759d=function(_0x396466,_0xe9857b){_0x396466=_0x396466-0x0;var _0x5e9ab4=_0x59d7[_0x396466];return _0x5e9ab4;};'use strict';var _=require(_0x759d('0x0'));var util=require(_0x759d('0x1'));var logger=require(_0x759d('0x2'))(_0x759d('0x3'));var moment=require(_0x759d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x759d('0x5'));var config=require(_0x759d('0x6'));var attributes=require(_0x759d('0x7'));module['exports']=function(_0x1f188d,_0x4c5167){return _0x1f188d[_0x759d('0x8')](_0x759d('0x9'),attributes,{'tableName':_0x759d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc9c=['exports','define','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x430d92,_0x23b922){var _0x3b6d50=function(_0x59d73d){while(--_0x59d73d){_0x430d92['push'](_0x430d92['shift']());}};_0x3b6d50(++_0x23b922);}(_0xdc9c,0x87));var _0xcdc9=function(_0x47b64f,_0x394a7e){_0x47b64f=_0x47b64f-0x0;var _0x6e2293=_0xdc9c[_0x47b64f];return _0x6e2293;};'use strict';var _=require('lodash');var util=require(_0xcdc9('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xcdc9('0x1'));var rp=require(_0xcdc9('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcdc9('0x3'));var config=require(_0xcdc9('0x4'));var attributes=require('./squareOdbc.attributes');module[_0xcdc9('0x5')]=function(_0x92f0a7,_0x4e7801){return _0x92f0a7[_0xcdc9('0x6')]('SquareOdbc',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 29f2262..1a96ab7 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 _0x52e9=['model','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','ShowSquareOdbc','SquareOdbc','find','options','where','attributes','map','include'];(function(_0x3fd603,_0x5f5b06){var _0x5026af=function(_0x5f199d){while(--_0x5f199d){_0x3fd603['push'](_0x3fd603['shift']());}};_0x5026af(++_0x5f5b06);}(_0x52e9,0x145));var _0x952e=function(_0x4f6692,_0x298a79){_0x4f6692=_0x4f6692-0x0;var _0x58b110=_0x52e9[_0x4f6692];return _0x58b110;};'use strict';var _=require(_0x952e('0x0'));var util=require('util');var moment=require(_0x952e('0x1'));var BPromise=require('bluebird');var rs=require(_0x952e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x952e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x952e('0x4'))(_0x952e('0x5'));var config=require(_0x952e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x952e('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x99d4e1,_0x319fef,_0x381146){return new BPromise(function(_0x283ba1,_0x282bd7){return client['request'](_0x99d4e1,_0x381146)[_0x952e('0x8')](function(_0x22fae9){logger[_0x952e('0x9')](_0x952e('0xa'),_0x319fef,_0x952e('0xb'));logger[_0x952e('0xc')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x319fef,_0x952e('0xb'),JSON[_0x952e('0xd')](_0x22fae9));if(_0x22fae9[_0x952e('0xe')]){if(_0x22fae9[_0x952e('0xe')][_0x952e('0xf')]===0x1f4){logger[_0x952e('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x319fef,_0x22fae9[_0x952e('0xe')]['message']);return _0x282bd7(_0x22fae9['error'][_0x952e('0x10')]);}logger[_0x952e('0xe')](_0x952e('0xa'),_0x319fef,_0x22fae9[_0x952e('0xe')][_0x952e('0x10')]);return _0x283ba1(_0x22fae9[_0x952e('0xe')][_0x952e('0x10')]);}else{logger[_0x952e('0x9')](_0x952e('0xa'),_0x319fef,_0x952e('0xb'));_0x283ba1(_0x22fae9['result'][_0x952e('0x10')]);}})[_0x952e('0x11')](function(_0x47be9a){logger['error'](_0x952e('0xa'),_0x319fef,_0x47be9a);_0x282bd7(_0x47be9a);});});}exports[_0x952e('0x12')]=function(_0x2829cf){var _0x3df865=this;return new Promise(function(_0x74cb7f,_0x4722e7){return db[_0x952e('0x13')][_0x952e('0x14')]({'raw':_0x2829cf[_0x952e('0x15')]?_0x2829cf[_0x952e('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2829cf[_0x952e('0x15')]?_0x2829cf[_0x952e('0x15')][_0x952e('0x16')]||null:null,'attributes':_0x2829cf[_0x952e('0x15')]?_0x2829cf[_0x952e('0x15')][_0x952e('0x17')]||null:null,'include':_0x2829cf['options']?_0x2829cf[_0x952e('0x15')]['include']?_[_0x952e('0x18')](_0x2829cf[_0x952e('0x15')][_0x952e('0x19')],function(_0x54deb6){return{'model':db[_0x54deb6[_0x952e('0x1a')]],'as':_0x54deb6['as'],'attributes':_0x54deb6[_0x952e('0x17')],'include':_0x54deb6['include']?_['map'](_0x54deb6['include'],function(_0x377bcc){return{'model':db[_0x377bcc['model']],'as':_0x377bcc['as'],'attributes':_0x377bcc[_0x952e('0x17')],'include':_0x377bcc[_0x952e('0x19')]?_[_0x952e('0x18')](_0x377bcc['include'],function(_0x40f760){return{'model':db[_0x40f760[_0x952e('0x1a')]],'as':_0x40f760['as'],'attributes':_0x40f760[_0x952e('0x17')]};}):[]};}):[]};}):[]:[]})[_0x952e('0x8')](function(_0x164a09){logger[_0x952e('0x9')](_0x952e('0x12'),_0x2829cf);logger[_0x952e('0xc')](_0x952e('0x12'),_0x2829cf,JSON['stringify'](_0x164a09));_0x74cb7f(_0x164a09);})[_0x952e('0x11')](function(_0x5e7e3d){logger[_0x952e('0xe')](_0x952e('0x12'),_0x5e7e3d[_0x952e('0x10')],_0x2829cf);_0x4722e7(_0x3df865['error'](0x1f4,_0x5e7e3d[_0x952e('0x10')]));});});}; \ No newline at end of file +var _0xe172=['debug','stringify','error','code','message','result','catch','ShowSquareOdbc','SquareOdbc','find','options','raw','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent'];(function(_0x1347f8,_0x233feb){var _0x218368=function(_0x3f4ca3){while(--_0x3f4ca3){_0x1347f8['push'](_0x1347f8['shift']());}};_0x218368(++_0x233feb);}(_0xe172,0x170));var _0x2e17=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xe172[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0x2e17('0x0'));var util=require(_0x2e17('0x1'));var moment=require(_0x2e17('0x2'));var BPromise=require(_0x2e17('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e17('0x4'));var db=require(_0x2e17('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e17('0x6'))(_0x2e17('0x7'));var config=require(_0x2e17('0x8'));var jayson=require(_0x2e17('0x9'));var client=jayson['client'][_0x2e17('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x203f9c,_0x35bb1e,_0x548a5a){return new BPromise(function(_0x53cd2d,_0x47d8d1){return client[_0x2e17('0xb')](_0x203f9c,_0x548a5a)[_0x2e17('0xc')](function(_0x52d9ba){logger[_0x2e17('0xd')](_0x2e17('0xe'),_0x35bb1e,_0x2e17('0xf'));logger[_0x2e17('0x10')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x35bb1e,_0x2e17('0xf'),JSON[_0x2e17('0x11')](_0x52d9ba));if(_0x52d9ba[_0x2e17('0x12')]){if(_0x52d9ba[_0x2e17('0x12')][_0x2e17('0x13')]===0x1f4){logger[_0x2e17('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x35bb1e,_0x52d9ba[_0x2e17('0x12')][_0x2e17('0x14')]);return _0x47d8d1(_0x52d9ba['error'][_0x2e17('0x14')]);}logger[_0x2e17('0x12')]('SquareOdbc,\x20%s,\x20%s',_0x35bb1e,_0x52d9ba[_0x2e17('0x12')][_0x2e17('0x14')]);return _0x53cd2d(_0x52d9ba[_0x2e17('0x12')]['message']);}else{logger[_0x2e17('0xd')](_0x2e17('0xe'),_0x35bb1e,'request\x20sent');_0x53cd2d(_0x52d9ba[_0x2e17('0x15')][_0x2e17('0x14')]);}})[_0x2e17('0x16')](function(_0x2dabfc){logger['error'](_0x2e17('0xe'),_0x35bb1e,_0x2dabfc);_0x47d8d1(_0x2dabfc);});});}exports[_0x2e17('0x17')]=function(_0xd7a60){var _0x598bfa=this;return new Promise(function(_0x20f700,_0x533e92){return db[_0x2e17('0x18')][_0x2e17('0x19')]({'raw':_0xd7a60[_0x2e17('0x1a')]?_0xd7a60[_0x2e17('0x1a')][_0x2e17('0x1b')]===undefined?!![]:![]:!![],'where':_0xd7a60[_0x2e17('0x1a')]?_0xd7a60[_0x2e17('0x1a')]['where']||null:null,'attributes':_0xd7a60[_0x2e17('0x1a')]?_0xd7a60[_0x2e17('0x1a')][_0x2e17('0x1c')]||null:null,'include':_0xd7a60[_0x2e17('0x1a')]?_0xd7a60['options'][_0x2e17('0x1d')]?_['map'](_0xd7a60[_0x2e17('0x1a')][_0x2e17('0x1d')],function(_0x10ed1b){return{'model':db[_0x10ed1b['model']],'as':_0x10ed1b['as'],'attributes':_0x10ed1b[_0x2e17('0x1c')],'include':_0x10ed1b[_0x2e17('0x1d')]?_[_0x2e17('0x1e')](_0x10ed1b[_0x2e17('0x1d')],function(_0xb82b35){return{'model':db[_0xb82b35[_0x2e17('0x1f')]],'as':_0xb82b35['as'],'attributes':_0xb82b35[_0x2e17('0x1c')],'include':_0xb82b35[_0x2e17('0x1d')]?_[_0x2e17('0x1e')](_0xb82b35['include'],function(_0x4a8f80){return{'model':db[_0x4a8f80[_0x2e17('0x1f')]],'as':_0x4a8f80['as'],'attributes':_0x4a8f80[_0x2e17('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x2e17('0xc')](function(_0x32d57e){logger[_0x2e17('0xd')](_0x2e17('0x17'),_0xd7a60);logger[_0x2e17('0x10')](_0x2e17('0x17'),_0xd7a60,JSON[_0x2e17('0x11')](_0x32d57e));_0x20f700(_0x32d57e);})[_0x2e17('0x16')](function(_0xc634dc){logger[_0x2e17('0x12')]('ShowSquareOdbc',_0xc634dc[_0x2e17('0x14')],_0xd7a60);_0x533e92(_0x598bfa[_0x2e17('0x12')](0x1f4,_0xc634dc[_0x2e17('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 4a7ce00..56057fd 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 _0xea02=['index','/:id','show','post','create','put','delete','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated'];(function(_0x55b6e1,_0x18d927){var _0x5e69af=function(_0x47d45f){while(--_0x47d45f){_0x55b6e1['push'](_0x55b6e1['shift']());}};_0x5e69af(++_0x18d927);}(_0xea02,0xb1));var _0x2ea0=function(_0x51a03c,_0x28e37a){_0x51a03c=_0x51a03c-0x0;var _0x4d9b98=_0xea02[_0x51a03c];return _0x4d9b98;};'use strict';var multer=require(_0x2ea0('0x0'));var util=require('util');var path=require(_0x2ea0('0x1'));var timeout=require(_0x2ea0('0x2'));var express=require(_0x2ea0('0x3'));var router=express[_0x2ea0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x2ea0('0x5'));var config=require(_0x2ea0('0x6'));var controller=require(_0x2ea0('0x7'));router[_0x2ea0('0x8')]('/',auth[_0x2ea0('0x9')](),controller[_0x2ea0('0xa')]);router[_0x2ea0('0x8')](_0x2ea0('0xb'),auth[_0x2ea0('0x9')](),controller[_0x2ea0('0xc')]);router[_0x2ea0('0xd')]('/',auth[_0x2ea0('0x9')](),controller[_0x2ea0('0xe')]);router[_0x2ea0('0xf')](_0x2ea0('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x2ea0('0x10')](_0x2ea0('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x321c=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./squareProject.controller','get','index','/:id','isAuthenticated','show','put','update','destroy'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x321c,0x199));var _0xc321=function(_0xca8b0b,_0x1aa33b){_0xca8b0b=_0xca8b0b-0x0;var _0x41c49c=_0x321c[_0xca8b0b];return _0x41c49c;};'use strict';var multer=require(_0xc321('0x0'));var util=require(_0xc321('0x1'));var path=require(_0xc321('0x2'));var timeout=require(_0xc321('0x3'));var express=require(_0xc321('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc321('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xc321('0x6'));var controller=require(_0xc321('0x7'));router[_0xc321('0x8')]('/',auth['isAuthenticated'](),controller[_0xc321('0x9')]);router[_0xc321('0x8')](_0xc321('0xa'),auth[_0xc321('0xb')](),controller[_0xc321('0xc')]);router['post']('/',auth[_0xc321('0xb')](),controller['create']);router[_0xc321('0xd')](_0xc321('0xa'),auth[_0xc321('0xb')](),controller[_0xc321('0xe')]);router['delete'](_0xc321('0xa'),auth[_0xc321('0xb')](),controller[_0xc321('0xf')]);module[_0xc321('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 14901a7..5322a57 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 _0xe396=['long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','STRING','name','TEXT','BLOB'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe396,0xa3));var _0x6e39=function(_0xe2b853,_0x114638){_0xe2b853=_0xe2b853-0x0;var _0x3717ed=_0xe396[_0xe2b853];return _0x3717ed;};'use strict';var Sequelize=require(_0x6e39('0x0'));module[_0x6e39('0x1')]={'name':{'type':Sequelize[_0x6e39('0x2')],'unique':_0x6e39('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x6e39('0x2')]},'notes':{'type':Sequelize[_0x6e39('0x4')]},'preproduction':{'type':Sequelize[_0x6e39('0x5')](_0x6e39('0x6')),'get':function(){if(this[_0x6e39('0x7')]('preproduction')){return this[_0x6e39('0x7')](_0x6e39('0x8'))[_0x6e39('0x9')](_0x6e39('0xa'));}}},'production':{'type':Sequelize[_0x6e39('0x5')](_0x6e39('0x6')),'get':function(){if(this['getDataValue']('production')){return this[_0x6e39('0x7')](_0x6e39('0xb'))[_0x6e39('0x9')](_0x6e39('0xa'));}}},'savedAt':{'type':Sequelize[_0x6e39('0xc')]},'publishedAt':{'type':Sequelize[_0x6e39('0xc')]}}; \ No newline at end of file +var _0xbb36=['TEXT','BLOB','getDataValue','preproduction','toString','utf8','long','production','DATE','sequelize','exports','STRING'];(function(_0xf18f5c,_0x547fbd){var _0x5b0939=function(_0x1824a5){while(--_0x1824a5){_0xf18f5c['push'](_0xf18f5c['shift']());}};_0x5b0939(++_0x547fbd);}(_0xbb36,0x105));var _0x6bb3=function(_0x199c77,_0xb8b6d7){_0x199c77=_0x199c77-0x0;var _0x57541d=_0xbb36[_0x199c77];return _0x57541d;};'use strict';var Sequelize=require(_0x6bb3('0x0'));module[_0x6bb3('0x1')]={'name':{'type':Sequelize[_0x6bb3('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x6bb3('0x2')]},'notes':{'type':Sequelize[_0x6bb3('0x3')]},'preproduction':{'type':Sequelize[_0x6bb3('0x4')]('long'),'get':function(){if(this[_0x6bb3('0x5')](_0x6bb3('0x6'))){return this[_0x6bb3('0x5')](_0x6bb3('0x6'))[_0x6bb3('0x7')](_0x6bb3('0x8'));}}},'production':{'type':Sequelize[_0x6bb3('0x4')](_0x6bb3('0x9')),'get':function(){if(this[_0x6bb3('0x5')]('production')){return this[_0x6bb3('0x5')](_0x6bb3('0xa'))[_0x6bb3('0x7')](_0x6bb3('0x8'));}}},'savedAt':{'type':Sequelize['DATE']},'publishedAt':{'type':Sequelize[_0x6bb3('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 1d9fc4c..324ce4c 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 _0x37ea=['pick','filter','merge','VIRTUAL','options','SquareProject','includeAll','include','rows','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','production','ioredis','../../components/parsers/qs','api','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','json','limit','undefined','count','offset','set','Content-Range','then','destroy','get','SquareProjects','publish','agi','stringify','status','end','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters'];(function(_0x238942,_0x3fe35e){var _0x17b205=function(_0x307c77){while(--_0x307c77){_0x238942['push'](_0x238942['shift']());}};_0x17b205(++_0x3fe35e);}(_0x37ea,0x1c3));var _0xa37e=function(_0x6a088b,_0x7000f8){_0x6a088b=_0x6a088b-0x0;var _0x18e69b=_0x37ea[_0x6a088b];return _0x18e69b;};'use strict';var _=require('lodash');var Redis=require(_0xa37e('0x0'));var qs=require(_0xa37e('0x1'));var logger=require('../../config/logger')(_0xa37e('0x2'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xa37e('0x3')]=_[_0xa37e('0x4')](config[_0xa37e('0x3')],{'host':_0xa37e('0x5'),'port':0x18eb});var socket=require(_0xa37e('0x6'))(new Redis(config[_0xa37e('0x3')]));require(_0xa37e('0x7'))['register'](socket);function respondWithResult(_0x54ca7b,_0x163ffe){_0x163ffe=_0x163ffe||0xc8;return function(_0x3a05e0){if(_0x3a05e0){return _0x54ca7b['status'](_0x163ffe)[_0xa37e('0x8')](_0x3a05e0);}};}function respondWithFilteredResult(_0x5b831f,_0x332d16){return function(_0x2964e9){if(_0x2964e9){var _0x14d4ae=typeof _0x332d16['offset']==='undefined'&&typeof _0x332d16[_0xa37e('0x9')]===_0xa37e('0xa');var _0x55ddb7=_0x2964e9[_0xa37e('0xb')];var _0xc4cfbd=_0x14d4ae?0x0:_0x332d16[_0xa37e('0xc')];var _0x242598=_0x14d4ae?_0x2964e9[_0xa37e('0xb')]:_0x332d16['offset']+_0x332d16['limit'];var _0x164c3b;if(_0x242598>=_0x55ddb7){_0x242598=_0x55ddb7;_0x164c3b=0xc8;}else{_0x164c3b=0xce;}_0x5b831f['status'](_0x164c3b);return _0x5b831f[_0xa37e('0xd')](_0xa37e('0xe'),_0xc4cfbd+'-'+_0x242598+'/'+_0x55ddb7)[_0xa37e('0x8')](_0x2964e9);}return null;};}function saveUpdates(_0x6595a){return function(_0x5939c7){if(_0x5939c7){return _0x5939c7['update'](_0x6595a)[_0xa37e('0xf')](function(_0x5c9596){return _0x5c9596;});}return null;};}function removeEntity(_0x5c3dce){return function(_0x476baa){if(_0x476baa){return _0x476baa[_0xa37e('0x10')]()[_0xa37e('0xf')](function(){var _0x26e369=_0x476baa[_0xa37e('0x11')]({'plain':!![]});var _0xef3fe1=_0xa37e('0x12');return db['UserProfileResource'][_0xa37e('0x10')]({'where':{'type':_0xef3fe1,'resourceId':_0x26e369['id']}})['then'](function(){return _0x476baa;});})['then'](function(){var _0xdb8974=new Redis(config[_0xa37e('0x3')]);_0xdb8974[_0xa37e('0x13')](_0xa37e('0x14'),JSON[_0xa37e('0x15')]({'id':_0x476baa['id'],'deleted':!![]}));})[_0xa37e('0xf')](function(){_0x5c3dce[_0xa37e('0x16')](0xcc)[_0xa37e('0x17')]();});}};}function handleEntityNotFound(_0x112e93){return function(_0x5d378e){if(!_0x5d378e){_0x112e93[_0xa37e('0x18')](0x194);}return _0x5d378e;};}function handleError(_0x5c1ab8,_0x3f1ec7){_0x3f1ec7=_0x3f1ec7||0x1f4;return function(_0x8b4e70){logger[_0xa37e('0x19')](_0x8b4e70[_0xa37e('0x1a')]);if(_0x8b4e70[_0xa37e('0x1b')]){delete _0x8b4e70[_0xa37e('0x1b')];}_0x5c1ab8[_0xa37e('0x16')](_0x3f1ec7)[_0xa37e('0x1c')](_0x8b4e70);};}exports[_0xa37e('0x1d')]=function(_0xe9e9e7,_0x5d47b0){var _0x489947={},_0x5ac340={},_0x530b0f={'count':0x0,'rows':[]};var _0x463936=_['map'](db['SquareProject'][_0xa37e('0x1e')],function(_0x504c32){return{'name':_0x504c32[_0xa37e('0x1f')],'type':_0x504c32[_0xa37e('0x20')][_0xa37e('0x21')]};});_0x5ac340['model']=_[_0xa37e('0x22')](_0x463936,_0xa37e('0x1b'));_0x5ac340['query']=_['keys'](_0xe9e9e7[_0xa37e('0x23')]);_0x5ac340['filters']=_[_0xa37e('0x24')](_0x5ac340[_0xa37e('0x25')],_0x5ac340['query']);_0x489947[_0xa37e('0x26')]=_[_0xa37e('0x24')](_0x5ac340[_0xa37e('0x25')],qs[_0xa37e('0x27')](_0xe9e9e7[_0xa37e('0x23')][_0xa37e('0x27')]));_0x489947['attributes']=_0x489947['attributes'][_0xa37e('0x28')]?_0x489947['attributes']:_0x5ac340[_0xa37e('0x25')];if(!_0xe9e9e7[_0xa37e('0x23')]['hasOwnProperty'](_0xa37e('0x29'))){_0x489947[_0xa37e('0x9')]=qs['limit'](_0xe9e9e7[_0xa37e('0x23')]['limit']);_0x489947[_0xa37e('0xc')]=qs[_0xa37e('0xc')](_0xe9e9e7[_0xa37e('0x23')][_0xa37e('0xc')]);}_0x489947[_0xa37e('0x2a')]=qs[_0xa37e('0x2b')](_0xe9e9e7['query'][_0xa37e('0x2b')]);_0x489947[_0xa37e('0x2c')]=qs[_0xa37e('0x2d')](_[_0xa37e('0x2e')](_0xe9e9e7[_0xa37e('0x23')],_0x5ac340[_0xa37e('0x2d')]),_0x463936);if(_0xe9e9e7['query'][_0xa37e('0x2f')]){_0x489947['where']=_[_0xa37e('0x30')](_0x489947[_0xa37e('0x2c')],{'$or':_['map'](_0x463936,function(_0x1d978c){if(_0x1d978c[_0xa37e('0x20')]!==_0xa37e('0x31')){var _0x5527fd={};_0x5527fd[_0x1d978c[_0xa37e('0x1b')]]={'$like':'%'+_0xe9e9e7[_0xa37e('0x23')][_0xa37e('0x2f')]+'%'};return _0x5527fd;}})});}_0x489947=_[_0xa37e('0x30')]({},_0x489947,_0xe9e9e7[_0xa37e('0x32')]);var _0x3edbd9={'where':_0x489947[_0xa37e('0x2c')]};return db[_0xa37e('0x33')][_0xa37e('0xb')](_0x3edbd9)[_0xa37e('0xf')](function(_0x5ee82e){_0x530b0f['count']=_0x5ee82e;if(_0xe9e9e7[_0xa37e('0x23')][_0xa37e('0x34')]){_0x489947[_0xa37e('0x35')]=[{'all':!![]}];}return db[_0xa37e('0x33')]['findAll'](_0x489947);})[_0xa37e('0xf')](function(_0x49c149){_0x530b0f[_0xa37e('0x36')]=_0x49c149;return _0x530b0f;})[_0xa37e('0xf')](respondWithFilteredResult(_0x5d47b0,_0x489947))['catch'](handleError(_0x5d47b0,null));};exports[_0xa37e('0x37')]=function(_0x559a18,_0x4840b4){var _0x586f7e={'raw':![],'where':{'id':_0x559a18[_0xa37e('0x38')]['id']}},_0x7e8c55={};_0x7e8c55[_0xa37e('0x25')]=_['keys'](db[_0xa37e('0x33')][_0xa37e('0x1e')]);_0x7e8c55[_0xa37e('0x23')]=_[_0xa37e('0x39')](_0x559a18[_0xa37e('0x23')]);_0x7e8c55['filters']=_[_0xa37e('0x24')](_0x7e8c55[_0xa37e('0x25')],_0x7e8c55[_0xa37e('0x23')]);_0x586f7e[_0xa37e('0x26')]=_[_0xa37e('0x24')](_0x7e8c55[_0xa37e('0x25')],qs['fields'](_0x559a18[_0xa37e('0x23')][_0xa37e('0x27')]));_0x586f7e[_0xa37e('0x26')]=_0x586f7e[_0xa37e('0x26')][_0xa37e('0x28')]?_0x586f7e[_0xa37e('0x26')]:_0x7e8c55[_0xa37e('0x25')];if(_0x559a18[_0xa37e('0x23')][_0xa37e('0x34')]){_0x586f7e[_0xa37e('0x35')]=[{'all':!![]}];}_0x586f7e=_[_0xa37e('0x30')]({},_0x586f7e,_0x559a18[_0xa37e('0x32')]);return db[_0xa37e('0x33')][_0xa37e('0x3a')](_0x586f7e)[_0xa37e('0xf')](handleEntityNotFound(_0x4840b4,null))['then'](respondWithResult(_0x4840b4,null))['catch'](handleError(_0x4840b4,null));};exports['create']=function(_0x5c44d9,_0x166aea){return db[_0xa37e('0x33')][_0xa37e('0x3b')](_0x5c44d9[_0xa37e('0x3c')],{})[_0xa37e('0xf')](function(_0x38ad10){var _0x410198=_0x5c44d9['user'][_0xa37e('0x11')]({'plain':!![]});if(!_0x410198)throw new Error(_0xa37e('0x3d'));if(_0x410198[_0xa37e('0x3e')]==='user'){var _0xcbc764=_0x38ad10[_0xa37e('0x11')]({'plain':!![]});var _0x5f37da=_0xa37e('0x12');return db[_0xa37e('0x3f')][_0xa37e('0x3a')]({'where':{'name':_0x5f37da,'userProfileId':_0x410198[_0xa37e('0x40')]},'raw':!![]})[_0xa37e('0xf')](function(_0x4eabf9){if(_0x4eabf9&&_0x4eabf9[_0xa37e('0x41')]===0x0){return db[_0xa37e('0x42')][_0xa37e('0x3b')]({'name':_0xcbc764[_0xa37e('0x1b')],'resourceId':_0xcbc764['id'],'type':_0x4eabf9[_0xa37e('0x1b')],'sectionId':_0x4eabf9['id']},{})[_0xa37e('0xf')](function(){return _0x38ad10;});}else{return _0x38ad10;}})[_0xa37e('0x43')](function(_0x260da0){logger[_0xa37e('0x19')](_0xa37e('0x44'),_0x260da0);throw _0x260da0;});}return _0x38ad10;})[_0xa37e('0xf')](respondWithResult(_0x166aea,0xc9))['catch'](handleError(_0x166aea,null));};exports[_0xa37e('0x45')]=function(_0x501040,_0x4085b5){if(_0x501040[_0xa37e('0x3c')]['id']){delete _0x501040['body']['id'];}return db['SquareProject'][_0xa37e('0x3a')]({'where':{'id':_0x501040['params']['id']}})[_0xa37e('0xf')](handleEntityNotFound(_0x4085b5,null))[_0xa37e('0xf')](saveUpdates(_0x501040['body'],null))['then'](function(_0x1fc20e){if(!_0x1fc20e)return;var _0x30ae8f=_0x1fc20e[_0xa37e('0x11')]({'plain':!![]});return _0x30ae8f;})[_0xa37e('0xf')](function(_0x2f2f0c){var _0x2e8af6=new Redis(config['redis']);_0x2e8af6[_0xa37e('0x13')]('agi',JSON['stringify'](_[_0xa37e('0x2e')](_0x2f2f0c,['id',_0xa37e('0x1b'),_0xa37e('0x46')])));return _0x2f2f0c;})[_0xa37e('0xf')](respondWithResult(_0x4085b5,null))[_0xa37e('0x43')](handleError(_0x4085b5,null));};exports[_0xa37e('0x10')]=function(_0x1f8b3c,_0x4fbb50){return db[_0xa37e('0x33')]['find']({'where':{'id':_0x1f8b3c[_0xa37e('0x38')]['id']}})[_0xa37e('0xf')](handleEntityNotFound(_0x4fbb50,null))[_0xa37e('0xf')](removeEntity(_0x4fbb50,null))[_0xa37e('0x43')](handleError(_0x4fbb50,null));}; \ No newline at end of file +var _0x2bf5=['userProfileId','autoAssociation','error','production','ioredis','../../config/logger','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./squareProject.socket','status','json','limit','undefined','count','set','Content-Range','update','then','get','SquareProjects','UserProfileResource','destroy','publish','agi','stringify','end','stack','name','send','map','SquareProject','rawAttributes','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','offset','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x39c089,_0x4b7d7c){var _0x371a82=function(_0x121ce7){while(--_0x121ce7){_0x39c089['push'](_0x39c089['shift']());}};_0x371a82(++_0x4b7d7c);}(_0x2bf5,0xcd));var _0x52bf=function(_0x1bb7eb,_0x21b2b1){_0x1bb7eb=_0x1bb7eb-0x0;var _0x1ca17b=_0x2bf5[_0x1bb7eb];return _0x1ca17b;};'use strict';var _=require('lodash');var Redis=require(_0x52bf('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0x52bf('0x1'))('api');var config=require(_0x52bf('0x2'));var db=require(_0x52bf('0x3'))['db'];config['redis']=_[_0x52bf('0x4')](config[_0x52bf('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x52bf('0x6'))(new Redis(config[_0x52bf('0x5')]));require(_0x52bf('0x7'))['register'](socket);function respondWithResult(_0x2a1f5b,_0x19fd33){_0x19fd33=_0x19fd33||0xc8;return function(_0x386bc7){if(_0x386bc7){return _0x2a1f5b[_0x52bf('0x8')](_0x19fd33)[_0x52bf('0x9')](_0x386bc7);}};}function respondWithFilteredResult(_0x4f986d,_0x119034){return function(_0x1d5cab){if(_0x1d5cab){var _0x4b5ae9=typeof _0x119034['offset']==='undefined'&&typeof _0x119034[_0x52bf('0xa')]===_0x52bf('0xb');var _0x517cd1=_0x1d5cab[_0x52bf('0xc')];var _0x19f316=_0x4b5ae9?0x0:_0x119034['offset'];var _0x40a636=_0x4b5ae9?_0x1d5cab[_0x52bf('0xc')]:_0x119034['offset']+_0x119034['limit'];var _0x5d9e03;if(_0x40a636>=_0x517cd1){_0x40a636=_0x517cd1;_0x5d9e03=0xc8;}else{_0x5d9e03=0xce;}_0x4f986d[_0x52bf('0x8')](_0x5d9e03);return _0x4f986d[_0x52bf('0xd')](_0x52bf('0xe'),_0x19f316+'-'+_0x40a636+'/'+_0x517cd1)[_0x52bf('0x9')](_0x1d5cab);}return null;};}function saveUpdates(_0x1bd124){return function(_0x45a81a){if(_0x45a81a){return _0x45a81a[_0x52bf('0xf')](_0x1bd124)[_0x52bf('0x10')](function(_0x4aa534){return _0x4aa534;});}return null;};}function removeEntity(_0x5e2a2d){return function(_0x5b2d82){if(_0x5b2d82){return _0x5b2d82['destroy']()[_0x52bf('0x10')](function(){var _0x19d28b=_0x5b2d82[_0x52bf('0x11')]({'plain':!![]});var _0xa4e85f=_0x52bf('0x12');return db[_0x52bf('0x13')][_0x52bf('0x14')]({'where':{'type':_0xa4e85f,'resourceId':_0x19d28b['id']}})['then'](function(){return _0x5b2d82;});})[_0x52bf('0x10')](function(){var _0x5e24f6=new Redis(config[_0x52bf('0x5')]);_0x5e24f6[_0x52bf('0x15')](_0x52bf('0x16'),JSON[_0x52bf('0x17')]({'id':_0x5b2d82['id'],'deleted':!![]}));})[_0x52bf('0x10')](function(){_0x5e2a2d[_0x52bf('0x8')](0xcc)[_0x52bf('0x18')]();});}};}function handleEntityNotFound(_0x2d57c3){return function(_0x53e51c){if(!_0x53e51c){_0x2d57c3['sendStatus'](0x194);}return _0x53e51c;};}function handleError(_0x5c34aa,_0xcd6e09){_0xcd6e09=_0xcd6e09||0x1f4;return function(_0xc12e21){logger['error'](_0xc12e21[_0x52bf('0x19')]);if(_0xc12e21[_0x52bf('0x1a')]){delete _0xc12e21[_0x52bf('0x1a')];}_0x5c34aa['status'](_0xcd6e09)[_0x52bf('0x1b')](_0xc12e21);};}exports['index']=function(_0x12c485,_0x3be2b1){var _0x2df1f8={},_0x56fc19={},_0x1226a6={'count':0x0,'rows':[]};var _0x467b9c=_[_0x52bf('0x1c')](db[_0x52bf('0x1d')][_0x52bf('0x1e')],function(_0x3806ba){return{'name':_0x3806ba['fieldName'],'type':_0x3806ba['type'][_0x52bf('0x1f')]};});_0x56fc19[_0x52bf('0x20')]=_[_0x52bf('0x1c')](_0x467b9c,_0x52bf('0x1a'));_0x56fc19['query']=_['keys'](_0x12c485['query']);_0x56fc19['filters']=_['intersection'](_0x56fc19[_0x52bf('0x20')],_0x56fc19[_0x52bf('0x21')]);_0x2df1f8['attributes']=_[_0x52bf('0x22')](_0x56fc19['model'],qs[_0x52bf('0x23')](_0x12c485['query'][_0x52bf('0x23')]));_0x2df1f8['attributes']=_0x2df1f8[_0x52bf('0x24')]['length']?_0x2df1f8[_0x52bf('0x24')]:_0x56fc19[_0x52bf('0x20')];if(!_0x12c485[_0x52bf('0x21')][_0x52bf('0x25')](_0x52bf('0x26'))){_0x2df1f8['limit']=qs[_0x52bf('0xa')](_0x12c485['query'][_0x52bf('0xa')]);_0x2df1f8[_0x52bf('0x27')]=qs[_0x52bf('0x27')](_0x12c485[_0x52bf('0x21')][_0x52bf('0x27')]);}_0x2df1f8['order']=qs[_0x52bf('0x28')](_0x12c485[_0x52bf('0x21')]['sort']);_0x2df1f8[_0x52bf('0x29')]=qs[_0x52bf('0x2a')](_[_0x52bf('0x2b')](_0x12c485['query'],_0x56fc19[_0x52bf('0x2a')]),_0x467b9c);if(_0x12c485[_0x52bf('0x21')]['filter']){_0x2df1f8['where']=_[_0x52bf('0x2c')](_0x2df1f8[_0x52bf('0x29')],{'$or':_['map'](_0x467b9c,function(_0x4ef442){if(_0x4ef442['type']!=='VIRTUAL'){var _0xcac48a={};_0xcac48a[_0x4ef442[_0x52bf('0x1a')]]={'$like':'%'+_0x12c485['query'][_0x52bf('0x2d')]+'%'};return _0xcac48a;}})});}_0x2df1f8=_[_0x52bf('0x2c')]({},_0x2df1f8,_0x12c485[_0x52bf('0x2e')]);var _0x4f1e9a={'where':_0x2df1f8['where']};return db[_0x52bf('0x1d')][_0x52bf('0xc')](_0x4f1e9a)[_0x52bf('0x10')](function(_0x2d33bd){_0x1226a6[_0x52bf('0xc')]=_0x2d33bd;if(_0x12c485['query'][_0x52bf('0x2f')]){_0x2df1f8[_0x52bf('0x30')]=[{'all':!![]}];}return db[_0x52bf('0x1d')][_0x52bf('0x31')](_0x2df1f8);})[_0x52bf('0x10')](function(_0x39f109){_0x1226a6[_0x52bf('0x32')]=_0x39f109;return _0x1226a6;})[_0x52bf('0x10')](respondWithFilteredResult(_0x3be2b1,_0x2df1f8))[_0x52bf('0x33')](handleError(_0x3be2b1,null));};exports[_0x52bf('0x34')]=function(_0x48e37e,_0x2abbad){var _0x1c45d={'raw':![],'where':{'id':_0x48e37e[_0x52bf('0x35')]['id']}},_0x760ea5={};_0x760ea5[_0x52bf('0x20')]=_[_0x52bf('0x36')](db[_0x52bf('0x1d')][_0x52bf('0x1e')]);_0x760ea5['query']=_[_0x52bf('0x36')](_0x48e37e[_0x52bf('0x21')]);_0x760ea5['filters']=_[_0x52bf('0x22')](_0x760ea5['model'],_0x760ea5[_0x52bf('0x21')]);_0x1c45d[_0x52bf('0x24')]=_[_0x52bf('0x22')](_0x760ea5['model'],qs['fields'](_0x48e37e[_0x52bf('0x21')]['fields']));_0x1c45d[_0x52bf('0x24')]=_0x1c45d[_0x52bf('0x24')][_0x52bf('0x37')]?_0x1c45d[_0x52bf('0x24')]:_0x760ea5['model'];if(_0x48e37e['query']['includeAll']){_0x1c45d[_0x52bf('0x30')]=[{'all':!![]}];}_0x1c45d=_[_0x52bf('0x2c')]({},_0x1c45d,_0x48e37e[_0x52bf('0x2e')]);return db[_0x52bf('0x1d')][_0x52bf('0x38')](_0x1c45d)[_0x52bf('0x10')](handleEntityNotFound(_0x2abbad,null))[_0x52bf('0x10')](respondWithResult(_0x2abbad,null))[_0x52bf('0x33')](handleError(_0x2abbad,null));};exports[_0x52bf('0x39')]=function(_0x1dd55e,_0x32b720){return db[_0x52bf('0x1d')][_0x52bf('0x39')](_0x1dd55e[_0x52bf('0x3a')],{})['then'](function(_0x4338d5){var _0x4d2cab=_0x1dd55e[_0x52bf('0x3b')]['get']({'plain':!![]});if(!_0x4d2cab)throw new Error(_0x52bf('0x3c'));if(_0x4d2cab[_0x52bf('0x3d')]==='user'){var _0x226088=_0x4338d5[_0x52bf('0x11')]({'plain':!![]});var _0x261608=_0x52bf('0x12');return db[_0x52bf('0x3e')][_0x52bf('0x38')]({'where':{'name':_0x261608,'userProfileId':_0x4d2cab[_0x52bf('0x3f')]},'raw':!![]})[_0x52bf('0x10')](function(_0x3a7f3c){if(_0x3a7f3c&&_0x3a7f3c[_0x52bf('0x40')]===0x0){return db['UserProfileResource'][_0x52bf('0x39')]({'name':_0x226088[_0x52bf('0x1a')],'resourceId':_0x226088['id'],'type':_0x3a7f3c[_0x52bf('0x1a')],'sectionId':_0x3a7f3c['id']},{})[_0x52bf('0x10')](function(){return _0x4338d5;});}else{return _0x4338d5;}})[_0x52bf('0x33')](function(_0x204210){logger[_0x52bf('0x41')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x204210);throw _0x204210;});}return _0x4338d5;})[_0x52bf('0x10')](respondWithResult(_0x32b720,0xc9))[_0x52bf('0x33')](handleError(_0x32b720,null));};exports[_0x52bf('0xf')]=function(_0xd29812,_0x490a34){if(_0xd29812['body']['id']){delete _0xd29812['body']['id'];}return db[_0x52bf('0x1d')][_0x52bf('0x38')]({'where':{'id':_0xd29812[_0x52bf('0x35')]['id']}})['then'](handleEntityNotFound(_0x490a34,null))[_0x52bf('0x10')](saveUpdates(_0xd29812['body'],null))['then'](function(_0x331fd7){if(!_0x331fd7)return;var _0x47750c=_0x331fd7['get']({'plain':!![]});return _0x47750c;})[_0x52bf('0x10')](function(_0x20a059){var _0x9892ad=new Redis(config[_0x52bf('0x5')]);_0x9892ad['publish']('agi',JSON[_0x52bf('0x17')](_[_0x52bf('0x2b')](_0x20a059,['id',_0x52bf('0x1a'),_0x52bf('0x42')])));return _0x20a059;})[_0x52bf('0x10')](respondWithResult(_0x490a34,null))[_0x52bf('0x33')](handleError(_0x490a34,null));};exports['destroy']=function(_0x22cebe,_0x3e670b){return db[_0x52bf('0x1d')][_0x52bf('0x38')]({'where':{'id':_0x22cebe[_0x52bf('0x35')]['id']}})[_0x52bf('0x10')](handleEntityNotFound(_0x3e670b,null))[_0x52bf('0x10')](removeEntity(_0x3e670b,null))[_0x52bf('0x33')](handleError(_0x3e670b,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 2dde876..01d5070 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 _0xfd1c=['setMaxListeners','save','update','remove','hook','exports','events','../../mysqldb','SquareProject'];(function(_0x1976a1,_0x522f17){var _0x85e7=function(_0x24ca63){while(--_0x24ca63){_0x1976a1['push'](_0x1976a1['shift']());}};_0x85e7(++_0x522f17);}(_0xfd1c,0x96));var _0xcfd1=function(_0xfad1a7,_0x2e3b8d){_0xfad1a7=_0xfad1a7-0x0;var _0x571012=_0xfd1c[_0xfad1a7];return _0x571012;};'use strict';var EventEmitter=require(_0xcfd1('0x0'));var SquareProject=require(_0xcfd1('0x1'))['db'][_0xcfd1('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xcfd1('0x3')](0x0);var events={'afterCreate':_0xcfd1('0x4'),'afterUpdate':_0xcfd1('0x5'),'afterDestroy':_0xcfd1('0x6')};function emitEvent(_0x5f5ad8){return function(_0xcfcc7e,_0xd0fcb2,_0x2d6c5b){SquareProjectEvents['emit'](_0x5f5ad8+':'+_0xcfcc7e['id'],_0xcfcc7e);SquareProjectEvents['emit'](_0x5f5ad8,_0xcfcc7e);_0x2d6c5b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject[_0xcfd1('0x7')](e,emitEvent(event));}}module[_0xcfd1('0x8')]=SquareProjectEvents; \ No newline at end of file +var _0x2fcf=['hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','remove','emit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2fcf,0x9b));var _0xf2fc=function(_0xb11639,_0x9c8aa8){_0xb11639=_0xb11639-0x0;var _0x2f87de=_0x2fcf[_0xb11639];return _0x2f87de;};'use strict';var EventEmitter=require(_0xf2fc('0x0'));var SquareProject=require(_0xf2fc('0x1'))['db'][_0xf2fc('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0xf2fc('0x3')};function emitEvent(_0x4b9dad){return function(_0x4c7e7e,_0x52d6c8,_0x174dbf){SquareProjectEvents[_0xf2fc('0x4')](_0x4b9dad+':'+_0x4c7e7e['id'],_0x4c7e7e);SquareProjectEvents[_0xf2fc('0x4')](_0x4b9dad,_0x4c7e7e);_0x174dbf(null);};}for(var e in events){if(events[_0xf2fc('0x5')](e)){var event=events[e];SquareProject[_0xf2fc('0x6')](e,emitEvent(event));}}module[_0xf2fc('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 505a2cd..864245f 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 _0xd6f1=['changed','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects'];(function(_0x2c9062,_0x525a88){var _0x48fa9f=function(_0x2d2731){while(--_0x2d2731){_0x2c9062['push'](_0x2c9062['shift']());}};_0x48fa9f(++_0x525a88);}(_0xd6f1,0x145));var _0x1d6f=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0xd6f1[_0x28947d];return _0x12d2ee;};'use strict';var _=require(_0x1d6f('0x0'));var util=require(_0x1d6f('0x1'));var logger=require(_0x1d6f('0x2'))(_0x1d6f('0x3'));var moment=require(_0x1d6f('0x4'));var BPromise=require(_0x1d6f('0x5'));var rp=require(_0x1d6f('0x6'));var fs=require('fs');var path=require(_0x1d6f('0x7'));var rimraf=require(_0x1d6f('0x8'));var config=require(_0x1d6f('0x9'));var attributes=require(_0x1d6f('0xa'));module[_0x1d6f('0xb')]=function(_0x1dcb94,_0x69e6f2){return _0x1dcb94[_0x1d6f('0xc')](_0x1d6f('0xd'),attributes,{'tableName':_0x1d6f('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x155da3,_0x3e7326,_0x56d4ed){if(_0x155da3[_0x1d6f('0xf')]('preproduction')){_0x155da3[_0x1d6f('0x10')]=moment()[_0x1d6f('0x11')](_0x1d6f('0x12'));}if(_0x155da3['changed'](_0x1d6f('0x13'))){_0x155da3['publishedAt']=moment()['format'](_0x1d6f('0x12'));}_0x56d4ed(null,_0x155da3);}}});}; \ No newline at end of file +var _0x96b2=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./squareProject.attributes','exports','define','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','format','util'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x96b2,0x1cf));var _0x296b=function(_0x37d307,_0xd5b663){_0x37d307=_0x37d307-0x0;var _0xc19be1=_0x96b2[_0x37d307];return _0xc19be1;};'use strict';var _=require('lodash');var util=require(_0x296b('0x0'));var logger=require(_0x296b('0x1'))(_0x296b('0x2'));var moment=require('moment');var BPromise=require(_0x296b('0x3'));var rp=require(_0x296b('0x4'));var fs=require('fs');var path=require(_0x296b('0x5'));var rimraf=require('rimraf');var config=require(_0x296b('0x6'));var attributes=require(_0x296b('0x7'));module[_0x296b('0x8')]=function(_0x1a97b7,_0x57cba3){return _0x1a97b7[_0x296b('0x9')]('SquareProject',attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5fe136,_0x22d3a2,_0x15ecbe){if(_0x5fe136[_0x296b('0xa')](_0x296b('0xb'))){_0x5fe136[_0x296b('0xc')]=moment()['format'](_0x296b('0xd'));}if(_0x5fe136[_0x296b('0xa')](_0x296b('0xe'))){_0x5fe136['publishedAt']=moment()[_0x296b('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x15ecbe(null,_0x5fe136);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 00e4596..5f91d7a 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 _0x131e=['model','then','info','GetSquareProjects','debug','stringify','catch','error','message','ShowSquareProject','find','where','lodash','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','localhost','./squareProject.socket','register','SquareProject','findAll','options','raw','attributes','limit','include','map'];(function(_0x24e91d,_0x5d6ffe){var _0x324d8d=function(_0x53a0e0){while(--_0x53a0e0){_0x24e91d['push'](_0x24e91d['shift']());}};_0x324d8d(++_0x5d6ffe);}(_0x131e,0xfc));var _0xe131=function(_0x1f58ad,_0x959626){_0x1f58ad=_0x1f58ad-0x0;var _0x211dd4=_0x131e[_0x1f58ad];return _0x211dd4;};'use strict';var _=require(_0xe131('0x0'));var Redis=require(_0xe131('0x1'));var db=require(_0xe131('0x2'))['db'];var logger=require(_0xe131('0x3'))(_0xe131('0x4'));var config=require(_0xe131('0x5'));config[_0xe131('0x6')]=_['defaults'](config[_0xe131('0x6')],{'host':_0xe131('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe131('0x8'))[_0xe131('0x9')](socket);exports['GetSquareProjects']=function(_0x45962d){var _0x1277dc=this;return new Promise(function(_0x36f26e,_0x54caa4){return db[_0xe131('0xa')][_0xe131('0xb')]({'raw':_0x45962d[_0xe131('0xc')]?_0x45962d['options'][_0xe131('0xd')]===undefined?!![]:![]:!![],'where':_0x45962d[_0xe131('0xc')]?_0x45962d[_0xe131('0xc')]['where']||null:null,'attributes':_0x45962d[_0xe131('0xc')]?_0x45962d[_0xe131('0xc')][_0xe131('0xe')]||null:null,'limit':_0x45962d[_0xe131('0xc')]?_0x45962d[_0xe131('0xc')][_0xe131('0xf')]||null:null,'include':_0x45962d[_0xe131('0xc')]?_0x45962d[_0xe131('0xc')][_0xe131('0x10')]?_[_0xe131('0x11')](_0x45962d[_0xe131('0xc')][_0xe131('0x10')],function(_0x5f209f){return{'model':db[_0x5f209f['model']],'as':_0x5f209f['as'],'attributes':_0x5f209f[_0xe131('0xe')],'include':_0x5f209f[_0xe131('0x10')]?_[_0xe131('0x11')](_0x5f209f[_0xe131('0x10')],function(_0x2c2a49){return{'model':db[_0x2c2a49[_0xe131('0x12')]],'as':_0x2c2a49['as'],'attributes':_0x2c2a49[_0xe131('0xe')],'include':_0x2c2a49[_0xe131('0x10')]?_[_0xe131('0x11')](_0x2c2a49['include'],function(_0x20b9c9){return{'model':db[_0x20b9c9[_0xe131('0x12')]],'as':_0x20b9c9['as'],'attributes':_0x20b9c9[_0xe131('0xe')]};}):[]};}):[]};}):[]:[]})[_0xe131('0x13')](function(_0x5f4678){logger[_0xe131('0x14')](_0xe131('0x15'),_0x45962d);logger[_0xe131('0x16')](_0xe131('0x15'),_0x45962d,JSON[_0xe131('0x17')](_0x5f4678));_0x36f26e(_0x5f4678);})[_0xe131('0x18')](function(_0x9df200){logger[_0xe131('0x19')](_0xe131('0x15'),_0x9df200[_0xe131('0x1a')],_0x45962d);_0x54caa4(_0x1277dc[_0xe131('0x19')](0x1f4,_0x9df200['message']));});});};exports[_0xe131('0x1b')]=function(_0x5c9ddb){var _0x46deb0=this;return new Promise(function(_0x3d96ed,_0x1c4d00){return db[_0xe131('0xa')][_0xe131('0x1c')]({'raw':_0x5c9ddb[_0xe131('0xc')]?_0x5c9ddb[_0xe131('0xc')][_0xe131('0xd')]===undefined?!![]:![]:!![],'where':_0x5c9ddb[_0xe131('0xc')]?_0x5c9ddb[_0xe131('0xc')][_0xe131('0x1d')]||null:null,'attributes':_0x5c9ddb['options']?_0x5c9ddb['options'][_0xe131('0xe')]||null:null,'include':_0x5c9ddb[_0xe131('0xc')]?_0x5c9ddb[_0xe131('0xc')][_0xe131('0x10')]?_[_0xe131('0x11')](_0x5c9ddb['options']['include'],function(_0x524c8b){return{'model':db[_0x524c8b[_0xe131('0x12')]],'as':_0x524c8b['as'],'attributes':_0x524c8b[_0xe131('0xe')],'include':_0x524c8b[_0xe131('0x10')]?_['map'](_0x524c8b[_0xe131('0x10')],function(_0x2e3767){return{'model':db[_0x2e3767['model']],'as':_0x2e3767['as'],'attributes':_0x2e3767[_0xe131('0xe')],'include':_0x2e3767[_0xe131('0x10')]?_['map'](_0x2e3767[_0xe131('0x10')],function(_0x4be986){return{'model':db[_0x4be986['model']],'as':_0x4be986['as'],'attributes':_0x4be986[_0xe131('0xe')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4aee1f){logger[_0xe131('0x14')](_0xe131('0x1b'),_0x5c9ddb);logger[_0xe131('0x16')](_0xe131('0x1b'),_0x5c9ddb,JSON[_0xe131('0x17')](_0x4aee1f));_0x3d96ed(_0x4aee1f);})['catch'](function(_0x1a5cfe){logger[_0xe131('0x19')](_0xe131('0x1b'),_0x1a5cfe['message'],_0x5c9ddb);_0x1c4d00(_0x46deb0['error'](0x1f4,_0x1a5cfe['message']));});});}; \ No newline at end of file +var _0xc3a2=['debug','stringify','catch','error','message','find','info','ShowSquareProject','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','redis','localhost','socket.io-emitter','register','GetSquareProjects','SquareProject','findAll','options','raw','where','map','model','include','attributes','then'];(function(_0x32e77f,_0x14464d){var _0x47e651=function(_0x3c318e){while(--_0x3c318e){_0x32e77f['push'](_0x32e77f['shift']());}};_0x47e651(++_0x14464d);}(_0xc3a2,0x1e4));var _0x2c3a=function(_0x4915cb,_0x17a442){_0x4915cb=_0x4915cb-0x0;var _0x1d4383=_0xc3a2[_0x4915cb];return _0x1d4383;};'use strict';var _=require('lodash');var Redis=require(_0x2c3a('0x0'));var db=require(_0x2c3a('0x1'))['db'];var logger=require(_0x2c3a('0x2'))(_0x2c3a('0x3'));var config=require(_0x2c3a('0x4'));config['redis']=_['defaults'](config[_0x2c3a('0x5')],{'host':_0x2c3a('0x6'),'port':0x18eb});var socket=require(_0x2c3a('0x7'))(new Redis(config[_0x2c3a('0x5')]));require('./squareProject.socket')[_0x2c3a('0x8')](socket);exports[_0x2c3a('0x9')]=function(_0x171885){var _0x1b2946=this;return new Promise(function(_0x37dcc4,_0x351054){return db[_0x2c3a('0xa')][_0x2c3a('0xb')]({'raw':_0x171885[_0x2c3a('0xc')]?_0x171885['options'][_0x2c3a('0xd')]===undefined?!![]:![]:!![],'where':_0x171885[_0x2c3a('0xc')]?_0x171885[_0x2c3a('0xc')][_0x2c3a('0xe')]||null:null,'attributes':_0x171885[_0x2c3a('0xc')]?_0x171885['options']['attributes']||null:null,'limit':_0x171885[_0x2c3a('0xc')]?_0x171885[_0x2c3a('0xc')]['limit']||null:null,'include':_0x171885[_0x2c3a('0xc')]?_0x171885[_0x2c3a('0xc')]['include']?_[_0x2c3a('0xf')](_0x171885['options']['include'],function(_0x2414ea){return{'model':db[_0x2414ea[_0x2c3a('0x10')]],'as':_0x2414ea['as'],'attributes':_0x2414ea['attributes'],'include':_0x2414ea[_0x2c3a('0x11')]?_[_0x2c3a('0xf')](_0x2414ea['include'],function(_0x4e0cce){return{'model':db[_0x4e0cce[_0x2c3a('0x10')]],'as':_0x4e0cce['as'],'attributes':_0x4e0cce[_0x2c3a('0x12')],'include':_0x4e0cce[_0x2c3a('0x11')]?_[_0x2c3a('0xf')](_0x4e0cce['include'],function(_0x5adfbc){return{'model':db[_0x5adfbc[_0x2c3a('0x10')]],'as':_0x5adfbc['as'],'attributes':_0x5adfbc[_0x2c3a('0x12')]};}):[]};}):[]};}):[]:[]})[_0x2c3a('0x13')](function(_0x2d4ad4){logger['info'](_0x2c3a('0x9'),_0x171885);logger[_0x2c3a('0x14')]('GetSquareProjects',_0x171885,JSON[_0x2c3a('0x15')](_0x2d4ad4));_0x37dcc4(_0x2d4ad4);})[_0x2c3a('0x16')](function(_0x530af3){logger[_0x2c3a('0x17')](_0x2c3a('0x9'),_0x530af3['message'],_0x171885);_0x351054(_0x1b2946[_0x2c3a('0x17')](0x1f4,_0x530af3[_0x2c3a('0x18')]));});});};exports['ShowSquareProject']=function(_0x2ededc){var _0x2aee0d=this;return new Promise(function(_0x5beabe,_0x2b7326){return db[_0x2c3a('0xa')][_0x2c3a('0x19')]({'raw':_0x2ededc[_0x2c3a('0xc')]?_0x2ededc['options']['raw']===undefined?!![]:![]:!![],'where':_0x2ededc['options']?_0x2ededc['options'][_0x2c3a('0xe')]||null:null,'attributes':_0x2ededc[_0x2c3a('0xc')]?_0x2ededc[_0x2c3a('0xc')][_0x2c3a('0x12')]||null:null,'include':_0x2ededc[_0x2c3a('0xc')]?_0x2ededc['options'][_0x2c3a('0x11')]?_['map'](_0x2ededc[_0x2c3a('0xc')]['include'],function(_0x58b868){return{'model':db[_0x58b868[_0x2c3a('0x10')]],'as':_0x58b868['as'],'attributes':_0x58b868[_0x2c3a('0x12')],'include':_0x58b868[_0x2c3a('0x11')]?_['map'](_0x58b868['include'],function(_0x10cae7){return{'model':db[_0x10cae7[_0x2c3a('0x10')]],'as':_0x10cae7['as'],'attributes':_0x10cae7[_0x2c3a('0x12')],'include':_0x10cae7[_0x2c3a('0x11')]?_[_0x2c3a('0xf')](_0x10cae7[_0x2c3a('0x11')],function(_0x5649a5){return{'model':db[_0x5649a5[_0x2c3a('0x10')]],'as':_0x5649a5['as'],'attributes':_0x5649a5['attributes']};}):[]};}):[]};}):[]:[]})[_0x2c3a('0x13')](function(_0x1cde5a){logger[_0x2c3a('0x1a')](_0x2c3a('0x1b'),_0x2ededc);logger['debug'](_0x2c3a('0x1b'),_0x2ededc,JSON['stringify'](_0x1cde5a));_0x5beabe(_0x1cde5a);})[_0x2c3a('0x16')](function(_0x21dae9){logger[_0x2c3a('0x17')](_0x2c3a('0x1b'),_0x21dae9[_0x2c3a('0x18')],_0x2ededc);_0x2b7326(_0x2aee0d['error'](0x1f4,_0x21dae9[_0x2c3a('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 7f56e09..528d949 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 _0xa283=['save','remove','update','removeListener','register','length','squareProject:','./squareProject.events'];(function(_0x2e08d1,_0x3ee7c3){var _0x5e76ec=function(_0x5d070f){while(--_0x5d070f){_0x2e08d1['push'](_0x2e08d1['shift']());}};_0x5e76ec(++_0x3ee7c3);}(_0xa283,0xbf));var _0x3a28=function(_0x212d2f,_0x2522bd){_0x212d2f=_0x212d2f-0x0;var _0x537dba=_0xa283[_0x212d2f];return _0x537dba;};'use strict';var SquareProjectEvents=require(_0x3a28('0x0'));var events=[_0x3a28('0x1'),_0x3a28('0x2'),_0x3a28('0x3')];function createListener(_0x1ba5d9,_0x4ca068){return function(_0x17c869){_0x4ca068['emit'](_0x1ba5d9,_0x17c869);};}function removeListener(_0x318dad,_0x1f269f){return function(){SquareProjectEvents[_0x3a28('0x4')](_0x318dad,_0x1f269f);};}exports[_0x3a28('0x5')]=function(_0x219555){for(var _0x3a2621=0x0,_0x5d34f4=events[_0x3a28('0x6')];_0x3a2621<_0x5d34f4;_0x3a2621++){var _0x467b86=events[_0x3a2621];var _0x320fe1=createListener(_0x3a28('0x7')+_0x467b86,_0x219555);SquareProjectEvents['on'](_0x467b86,_0x320fe1);}}; \ No newline at end of file +var _0xb26f=['length','squareProject:','./squareProject.events','remove','emit','removeListener','register'];(function(_0x591db7,_0x150445){var _0x4ad760=function(_0x5dd24e){while(--_0x5dd24e){_0x591db7['push'](_0x591db7['shift']());}};_0x4ad760(++_0x150445);}(_0xb26f,0xdb));var _0xfb26=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0xb26f[_0x4cc280];return _0x16ed24;};'use strict';var SquareProjectEvents=require(_0xfb26('0x0'));var events=['save',_0xfb26('0x1'),'update'];function createListener(_0x205dab,_0x430306){return function(_0x548d4c){_0x430306[_0xfb26('0x2')](_0x205dab,_0x548d4c);};}function removeListener(_0x15f103,_0x148fce){return function(){SquareProjectEvents[_0xfb26('0x3')](_0x15f103,_0x148fce);};}exports[_0xfb26('0x4')]=function(_0x3b098c){for(var _0x5bddd8=0x0,_0x3ae7e6=events[_0xfb26('0x5')];_0x5bddd8<_0x3ae7e6;_0x5bddd8++){var _0x5ee4fb=events[_0x5bddd8];var _0x3cf71c=createListener(_0xfb26('0x6')+_0x5ee4fb,_0x3b098c);SquareProjectEvents['on'](_0x5ee4fb,_0x3cf71c);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 9d63737..ac6fbf9 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 _0x1261=['isAuthenticated','show','/:id/download','post','create','/:id','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','index','get'];(function(_0x1f38db,_0x2af54a){var _0x598816=function(_0x3c82d2){while(--_0x3c82d2){_0x1f38db['push'](_0x1f38db['shift']());}};_0x598816(++_0x2af54a);}(_0x1261,0x144));var _0x1126=function(_0x598b78,_0xf4ee7e){_0x598b78=_0x598b78-0x0;var _0x6392fa=_0x1261[_0x598b78];return _0x6392fa;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var fs_extra=require(_0x1126('0x5'));var auth=require(_0x1126('0x6'));var interaction=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var controller=require(_0x1126('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0xd')]);router[_0x1126('0xb')](_0x1126('0xe'),auth[_0x1126('0xc')](),controller['download']);router[_0x1126('0xf')]('/',auth[_0x1126('0xc')](),controller[_0x1126('0x10')]);router['put'](_0x1126('0x11'),auth['isAuthenticated'](),controller['update']);router[_0x1126('0x12')]('/:id',auth[_0x1126('0xc')](),controller[_0x1126('0x13')]);module[_0x1126('0x14')]=router; \ No newline at end of file +var _0x53ec=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareRecording.controller','isAuthenticated','get','/:id','show','/:id/download','download','post','create','put'];(function(_0xbf23d9,_0x2f4f8d){var _0x5d5f9f=function(_0xcb67df){while(--_0xcb67df){_0xbf23d9['push'](_0xbf23d9['shift']());}};_0x5d5f9f(++_0x2f4f8d);}(_0x53ec,0x192));var _0xc53e=function(_0x107f31,_0x1bcd53){_0x107f31=_0x107f31-0x0;var _0x10560c=_0x53ec[_0x107f31];return _0x10560c;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')]('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller[_0xc53e('0x13')]);module[_0xc53e('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 5975dcd..b994bc8 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 _0xbd51=['VIRTUAL','getDataValue','savePath','lastIndexOf','sequelize','STRING'];(function(_0x1e673a,_0x3070c4){var _0x4350b7=function(_0x26b207){while(--_0x26b207){_0x1e673a['push'](_0x1e673a['shift']());}};_0x4350b7(++_0x3070c4);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x5aa2d7,_0x2a0504){_0x5aa2d7=_0x5aa2d7-0x0;var _0x1328f2=_0xbd51[_0x5aa2d7];return _0x1328f2;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x1bd5('0x1')]},'callerid':{'type':Sequelize[_0x1bd5('0x1')]},'calleridname':{'type':Sequelize[_0x1bd5('0x1')]},'context':{'type':Sequelize[_0x1bd5('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x1bd5('0x1')]},'saveName':{'type':Sequelize[_0x1bd5('0x1')]},'filename':{'type':Sequelize[_0x1bd5('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x1bd5('0x2')],'get':function(){var _0x30a385='';var _0x19077c=this[_0x1bd5('0x3')](_0x1bd5('0x4'));if(_0x19077c){_0x30a385=_0x19077c['substring'](_0x19077c[_0x1bd5('0x5')]('.'));}return _0x30a385;}}}; \ No newline at end of file +var _0x98a8=['exports','STRING','VIRTUAL','savePath','substring','lastIndexOf','sequelize'];(function(_0x284a61,_0x231686){var _0x220e3c=function(_0x104496){while(--_0x104496){_0x284a61['push'](_0x284a61['shift']());}};_0x220e3c(++_0x231686);}(_0x98a8,0x12c));var _0x898a=function(_0x2c6acb,_0xeb01a8){_0x2c6acb=_0x2c6acb-0x0;var _0x5a6958=_0x98a8[_0x2c6acb];return _0x5a6958;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'uniqueid':{'type':Sequelize[_0x898a('0x2')]},'callerid':{'type':Sequelize[_0x898a('0x2')]},'calleridname':{'type':Sequelize[_0x898a('0x2')]},'context':{'type':Sequelize[_0x898a('0x2')]},'extension':{'type':Sequelize[_0x898a('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x898a('0x2')]},'dnid':{'type':Sequelize[_0x898a('0x2')]},'projectName':{'type':Sequelize[_0x898a('0x2')]},'saveName':{'type':Sequelize[_0x898a('0x2')]},'filename':{'type':Sequelize[_0x898a('0x2')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x898a('0x3')],'get':function(){var _0x564583='';var _0xfa8c50=this['getDataValue'](_0x898a('0x4'));if(_0xfa8c50){_0x564583=_0xfa8c50[_0x898a('0x5')](_0xfa8c50[_0x898a('0x6')]('.'));}return _0x564583;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 3543f53..a520ee6 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 _0x94ce=['SquareRecording','includeAll','include','findAll','catch','params','create','body','find','download','../../components/encryptor','uniqueid','savePath','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','destroy','then','stack','name','send','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options'];(function(_0x3c7fbf,_0x57c5eb){var _0x2b0aa4=function(_0x21460c){while(--_0x21460c){_0x3c7fbf['push'](_0x3c7fbf['shift']());}};_0x2b0aa4(++_0x57c5eb);}(_0x94ce,0xd4));var _0xe94c=function(_0x53dac4,_0x436fac){_0x53dac4=_0x53dac4-0x0;var _0x589366=_0x94ce[_0x53dac4];return _0x589366;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe94c('0x0'));var zipdir=require(_0xe94c('0x1'));var jsonpatch=require(_0xe94c('0x2'));var rp=require('request-promise');var moment=require(_0xe94c('0x3'));var BPromise=require(_0xe94c('0x4'));var Mustache=require(_0xe94c('0x5'));var util=require('util');var path=require(_0xe94c('0x6'));var sox=require(_0xe94c('0x7'));var csv=require(_0xe94c('0x8'));var ejs=require(_0xe94c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe94c('0xa'));var jsforce=require(_0xe94c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xe94c('0x8'));var querystring=require(_0xe94c('0xc'));var Papa=require(_0xe94c('0xd'));var Redis=require(_0xe94c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xe94c('0xf'));var as=require(_0xe94c('0x10'));var hardwareService=require(_0xe94c('0x11'));var logger=require(_0xe94c('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xe94c('0x13'))['db'];function respondWithStatusCode(_0x5c563b,_0x5a9b68){_0x5a9b68=_0x5a9b68||0xcc;return function(_0x39151d){if(_0x39151d){return _0x5c563b[_0xe94c('0x14')](_0x5a9b68);}return _0x5c563b[_0xe94c('0x15')](_0x5a9b68)[_0xe94c('0x16')]();};}function respondWithResult(_0x5b09e2,_0x404478){_0x404478=_0x404478||0xc8;return function(_0x1ac0fe){if(_0x1ac0fe){return _0x5b09e2[_0xe94c('0x15')](_0x404478)['json'](_0x1ac0fe);}};}function respondWithFilteredResult(_0x2b3508,_0xc0911d){return function(_0x48a470){if(_0x48a470){var _0x216e6d=typeof _0xc0911d[_0xe94c('0x17')]===_0xe94c('0x18')&&typeof _0xc0911d[_0xe94c('0x19')]===_0xe94c('0x18');var _0x3e03a9=_0x48a470['count'];var _0x433373=_0x216e6d?0x0:_0xc0911d[_0xe94c('0x17')];var _0x19cf11=_0x216e6d?_0x48a470[_0xe94c('0x1a')]:_0xc0911d[_0xe94c('0x17')]+_0xc0911d[_0xe94c('0x19')];var _0x459109;if(_0x19cf11>=_0x3e03a9){_0x19cf11=_0x3e03a9;_0x459109=0xc8;}else{_0x459109=0xce;}_0x2b3508[_0xe94c('0x15')](_0x459109);return _0x2b3508[_0xe94c('0x1b')](_0xe94c('0x1c'),_0x433373+'-'+_0x19cf11+'/'+_0x3e03a9)[_0xe94c('0x1d')](_0x48a470);}return null;};}function patchUpdates(_0x4fcd2d){return function(_0x5bbb10){try{jsonpatch[_0xe94c('0x1e')](_0x5bbb10,_0x4fcd2d,!![]);}catch(_0x134323){return BPromise[_0xe94c('0x1f')](_0x134323);}return _0x5bbb10['save']();};}function saveUpdates(_0xe6612f,_0x2d60f4){return function(_0x52a5c2){if(_0x52a5c2){return _0x52a5c2[_0xe94c('0x20')](_0xe6612f)['then'](function(_0xb11e48){return _0xb11e48;});}return null;};}function removeEntity(_0x5d71c0,_0xc19af2){return function(_0x1df2c7){if(_0x1df2c7){return _0x1df2c7[_0xe94c('0x21')]()[_0xe94c('0x22')](function(){_0x5d71c0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ff532,_0x230397){return function(_0x86a400){if(!_0x86a400){_0x4ff532[_0xe94c('0x14')](0x194);}return _0x86a400;};}function handleError(_0x1f5632,_0x33a155){_0x33a155=_0x33a155||0x1f4;return function(_0x2c125d){logger['error'](_0x2c125d[_0xe94c('0x23')]);if(_0x2c125d['name']){delete _0x2c125d[_0xe94c('0x24')];}_0x1f5632[_0xe94c('0x15')](_0x33a155)[_0xe94c('0x25')](_0x2c125d);};}exports[_0xe94c('0x26')]=function(_0x1ccea8,_0x1eeade){var _0x7926c1={},_0x4478e0={},_0x34f507={'count':0x0,'rows':[]};var _0x1a4b47=_['map'](db['SquareRecording'][_0xe94c('0x27')],function(_0x47e61c){return{'name':_0x47e61c[_0xe94c('0x28')],'type':_0x47e61c[_0xe94c('0x29')]['key']};});_0x4478e0['model']=_[_0xe94c('0x2a')](_0x1a4b47,_0xe94c('0x24'));_0x4478e0[_0xe94c('0x2b')]=_[_0xe94c('0x2c')](_0x1ccea8[_0xe94c('0x2b')]);_0x4478e0[_0xe94c('0x2d')]=_[_0xe94c('0x2e')](_0x4478e0['model'],_0x4478e0[_0xe94c('0x2b')]);_0x7926c1['attributes']=_[_0xe94c('0x2e')](_0x4478e0[_0xe94c('0x2f')],qs[_0xe94c('0x30')](_0x1ccea8[_0xe94c('0x2b')][_0xe94c('0x30')]));_0x7926c1[_0xe94c('0x31')]=_0x7926c1[_0xe94c('0x31')][_0xe94c('0x32')]?_0x7926c1[_0xe94c('0x31')]:_0x4478e0[_0xe94c('0x2f')];if(!_0x1ccea8[_0xe94c('0x2b')][_0xe94c('0x33')](_0xe94c('0x34'))){_0x7926c1[_0xe94c('0x19')]=qs[_0xe94c('0x19')](_0x1ccea8['query'][_0xe94c('0x19')]);_0x7926c1[_0xe94c('0x17')]=qs[_0xe94c('0x17')](_0x1ccea8[_0xe94c('0x2b')][_0xe94c('0x17')]);}_0x7926c1[_0xe94c('0x35')]=qs[_0xe94c('0x36')](_0x1ccea8[_0xe94c('0x2b')][_0xe94c('0x36')]);_0x7926c1[_0xe94c('0x37')]=qs[_0xe94c('0x2d')](_[_0xe94c('0x38')](_0x1ccea8[_0xe94c('0x2b')],_0x4478e0['filters']),_0x1a4b47);if(_0x1ccea8[_0xe94c('0x2b')][_0xe94c('0x39')]){_0x7926c1[_0xe94c('0x37')]=_['merge'](_0x7926c1[_0xe94c('0x37')],{'$or':_['map'](_0x1a4b47,function(_0x31e6c8){if(_0x31e6c8[_0xe94c('0x29')]!==_0xe94c('0x3a')){var _0x5b46ce={};_0x5b46ce[_0x31e6c8[_0xe94c('0x24')]]={'$like':'%'+_0x1ccea8[_0xe94c('0x2b')]['filter']+'%'};return _0x5b46ce;}})});}_0x7926c1=_[_0xe94c('0x3b')]({},_0x7926c1,_0x1ccea8[_0xe94c('0x3c')]);var _0x37a335={'where':_0x7926c1[_0xe94c('0x37')]};return db[_0xe94c('0x3d')][_0xe94c('0x1a')](_0x37a335)[_0xe94c('0x22')](function(_0x46d1ae){_0x34f507[_0xe94c('0x1a')]=_0x46d1ae;if(_0x1ccea8[_0xe94c('0x2b')][_0xe94c('0x3e')]){_0x7926c1[_0xe94c('0x3f')]=[{'all':!![]}];}return db[_0xe94c('0x3d')][_0xe94c('0x40')](_0x7926c1);})[_0xe94c('0x22')](function(_0x1ea345){_0x34f507['rows']=_0x1ea345;return _0x34f507;})[_0xe94c('0x22')](respondWithFilteredResult(_0x1eeade,_0x7926c1))[_0xe94c('0x41')](handleError(_0x1eeade,null));};exports['show']=function(_0x4d63bb,_0x4efc3b){var _0x3016f6={'raw':!![],'where':{'id':_0x4d63bb[_0xe94c('0x42')]['id']}},_0x2b9ce7={};_0x2b9ce7[_0xe94c('0x2f')]=_[_0xe94c('0x2c')](db[_0xe94c('0x3d')]['rawAttributes']);_0x2b9ce7[_0xe94c('0x2b')]=_[_0xe94c('0x2c')](_0x4d63bb['query']);_0x2b9ce7['filters']=_['intersection'](_0x2b9ce7[_0xe94c('0x2f')],_0x2b9ce7['query']);_0x3016f6[_0xe94c('0x31')]=_[_0xe94c('0x2e')](_0x2b9ce7[_0xe94c('0x2f')],qs[_0xe94c('0x30')](_0x4d63bb[_0xe94c('0x2b')]['fields']));_0x3016f6[_0xe94c('0x31')]=_0x3016f6[_0xe94c('0x31')][_0xe94c('0x32')]?_0x3016f6['attributes']:_0x2b9ce7['model'];if(_0x4d63bb[_0xe94c('0x2b')][_0xe94c('0x3e')]){_0x3016f6[_0xe94c('0x3f')]=[{'all':!![]}];}_0x3016f6=_['merge']({},_0x3016f6,_0x4d63bb[_0xe94c('0x3c')]);return db['SquareRecording']['find'](_0x3016f6)[_0xe94c('0x22')](handleEntityNotFound(_0x4efc3b,null))[_0xe94c('0x22')](respondWithResult(_0x4efc3b,null))[_0xe94c('0x41')](handleError(_0x4efc3b,null));};exports['create']=function(_0x569f62,_0x51d8a2){return db[_0xe94c('0x3d')][_0xe94c('0x43')](_0x569f62['body'],{})['then'](respondWithResult(_0x51d8a2,0xc9))['catch'](handleError(_0x51d8a2,null));};exports['update']=function(_0x181a8c,_0x201bbb){if(_0x181a8c[_0xe94c('0x44')]['id']){delete _0x181a8c[_0xe94c('0x44')]['id'];}return db['SquareRecording'][_0xe94c('0x45')]({'where':{'id':_0x181a8c['params']['id']}})[_0xe94c('0x22')](handleEntityNotFound(_0x201bbb,null))[_0xe94c('0x22')](saveUpdates(_0x181a8c[_0xe94c('0x44')],null))[_0xe94c('0x22')](respondWithResult(_0x201bbb,null))[_0xe94c('0x41')](handleError(_0x201bbb,null));};exports[_0xe94c('0x46')]=function(_0xbf8090,_0x222807,_0x13b3c0){var _0x3f2fd=require(_0xe94c('0x47'));var _0xbe587e=![];var _0x3e0e5b={};if(_0xbf8090[_0xe94c('0x2b')]['type']&&_0xbf8090[_0xe94c('0x2b')][_0xe94c('0x29')]===_0xe94c('0x48')){_0x3e0e5b['uniqueid']=_0xbf8090['params']['id'];}else{_0x3e0e5b['id']=_0xbf8090[_0xe94c('0x42')]['id'];}return db[_0xe94c('0x3d')]['find']({'where':_0x3e0e5b,'attributes':['id',_0xe94c('0x49'),'filename'],'raw':!![]})[_0xe94c('0x22')](handleEntityNotFound(_0x222807,null))[_0xe94c('0x22')](function(_0x27a0b5){if(_0x27a0b5){var _0x1f269e=_0x27a0b5[_0xe94c('0x49')];var _0x309001=util['format']('%s.cypher',_0x1f269e);if(fs[_0xe94c('0x4a')](_0x309001)){_0xbe587e=!![];return _0x3f2fd[_0xe94c('0x4b')](_0x309001,_0x1f269e,config[_0xe94c('0x4c')][_0xe94c('0x4d')])[_0xe94c('0x22')](function(){return _0x27a0b5;});}return _0x27a0b5;}})[_0xe94c('0x22')](function(_0x51cbc7){if(_0x51cbc7){var _0x19209e=_0x51cbc7['savePath'];if(!fs[_0xe94c('0x4a')](_0x19209e)){throw new db[(_0xe94c('0x4e'))][(_0xe94c('0x4f'))](_0xe94c('0x50'));}if(_0x51cbc7[_0xe94c('0x51')]){return _0x222807['download'](_0x19209e,_0x51cbc7['filename']+path[_0xe94c('0x52')](_0x19209e),function(){if(_0xbe587e){fs['unlink'](_0x19209e);}});}else{return _0x222807[_0xe94c('0x46')](_0x19209e,function(_0x2e3e67){if(_0xbe587e){fs['unlink'](_0x19209e);}});}}})['catch'](function(_0x1ba590){if(_0x1ba590['message']===_0xe94c('0x50')){_0x222807[_0xe94c('0x15')](0x194)['send'](_0xe94c('0x53'));}else{return handleError(_0x222807,null);}});};exports[_0xe94c('0x21')]=function(_0x304559,_0x53b5cf){return db[_0xe94c('0x3d')][_0xe94c('0x45')]({'where':{'id':_0x304559['params']['id']}})[_0xe94c('0x22')](function(_0x27db64){if(_['isNil'](_0x27db64)){throw new ReferenceError('Entity\x20not\x20found');}return _0x27db64;})[_0xe94c('0x22')](function(_0x4f656c){var _0x25bf48=_0x4f656c[_0xe94c('0x49')];logger['info'](_0xe94c('0x54'),_0x25bf48);if(!_[_0xe94c('0x55')](_0x4f656c['savePath'])&&fs[_0xe94c('0x4a')](_0x25bf48)){logger[_0xe94c('0x56')](_0xe94c('0x57')+_0x25bf48+_0xe94c('0x58'));fs[_0xe94c('0x59')](_0x25bf48);}_0x25bf48=_0x25bf48+_0xe94c('0x5a');if(!_['isNil'](_0x4f656c['savePath'])&&fs[_0xe94c('0x4a')](_0x25bf48)){logger['info'](_0xe94c('0x57')+_0x25bf48+_0xe94c('0x58'));fs[_0xe94c('0x59')](_0x25bf48);}return _0x4f656c;})[_0xe94c('0x22')](function(_0x5ec6f3){if(!_0x5ec6f3)throw new InternalError();return _0x5ec6f3[_0xe94c('0x21')]();})[_0xe94c('0x22')](function(){_0x53b5cf[_0xe94c('0x15')](0xcc)[_0xe94c('0x16')]();})[_0xe94c('0x41')](handleError(_0x53b5cf,null));}; \ No newline at end of file +var _0xb5bb=['uniqueid','savePath','format','existsSync','decryptFile','secrets','recording','filename','extname','unlink','SquareRecording\x20not\x20found','Not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','info','destroy','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','options','find','create','body','download','../../components/encryptor'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0xb5bb,0xda));var _0xbb5b=function(_0x107f4f,_0x2e431c){_0x107f4f=_0x107f4f-0x0;var _0x1d8fd5=_0xb5bb[_0x107f4f];return _0x1d8fd5;};'use strict';var emlformat=require(_0xbb5b('0x0'));var rimraf=require(_0xbb5b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbb5b('0x2'));var moment=require('moment');var BPromise=require(_0xbb5b('0x3'));var Mustache=require(_0xbb5b('0x4'));var util=require(_0xbb5b('0x5'));var path=require(_0xbb5b('0x6'));var sox=require('sox');var csv=require(_0xbb5b('0x7'));var ejs=require(_0xbb5b('0x8'));var fs=require('fs');var fs_extra=require(_0xbb5b('0x9'));var _=require(_0xbb5b('0xa'));var squel=require('squel');var crypto=require(_0xbb5b('0xb'));var jsforce=require(_0xbb5b('0xc'));var deskjs=require(_0xbb5b('0xd'));var toCsv=require(_0xbb5b('0x7'));var querystring=require(_0xbb5b('0xe'));var Papa=require(_0xbb5b('0xf'));var Redis=require(_0xbb5b('0x10'));var authService=require(_0xbb5b('0x11'));var qs=require(_0xbb5b('0x12'));var as=require(_0xbb5b('0x13'));var hardwareService=require(_0xbb5b('0x14'));var logger=require(_0xbb5b('0x15'))('api');var utils=require(_0xbb5b('0x16'));var config=require(_0xbb5b('0x17'));var licenseUtil=require(_0xbb5b('0x18'));var db=require(_0xbb5b('0x19'))['db'];function respondWithStatusCode(_0x6fbbf,_0x18dfb6){_0x18dfb6=_0x18dfb6||0xcc;return function(_0x4f946f){if(_0x4f946f){return _0x6fbbf[_0xbb5b('0x1a')](_0x18dfb6);}return _0x6fbbf[_0xbb5b('0x1b')](_0x18dfb6)[_0xbb5b('0x1c')]();};}function respondWithResult(_0x3d5586,_0xab8a8b){_0xab8a8b=_0xab8a8b||0xc8;return function(_0x1b1e5b){if(_0x1b1e5b){return _0x3d5586['status'](_0xab8a8b)['json'](_0x1b1e5b);}};}function respondWithFilteredResult(_0x2f0dfc,_0x23e147){return function(_0x1fe314){if(_0x1fe314){var _0x395f82=typeof _0x23e147[_0xbb5b('0x1d')]===_0xbb5b('0x1e')&&typeof _0x23e147['limit']===_0xbb5b('0x1e');var _0xd85463=_0x1fe314[_0xbb5b('0x1f')];var _0x389248=_0x395f82?0x0:_0x23e147[_0xbb5b('0x1d')];var _0x5a2c62=_0x395f82?_0x1fe314['count']:_0x23e147['offset']+_0x23e147[_0xbb5b('0x20')];var _0x4d49c9;if(_0x5a2c62>=_0xd85463){_0x5a2c62=_0xd85463;_0x4d49c9=0xc8;}else{_0x4d49c9=0xce;}_0x2f0dfc[_0xbb5b('0x1b')](_0x4d49c9);return _0x2f0dfc['set'](_0xbb5b('0x21'),_0x389248+'-'+_0x5a2c62+'/'+_0xd85463)[_0xbb5b('0x22')](_0x1fe314);}return null;};}function patchUpdates(_0x18be07){return function(_0x5a5d00){try{jsonpatch[_0xbb5b('0x23')](_0x5a5d00,_0x18be07,!![]);}catch(_0x566bc5){return BPromise[_0xbb5b('0x24')](_0x566bc5);}return _0x5a5d00[_0xbb5b('0x25')]();};}function saveUpdates(_0x59e7cc,_0x1a6bcc){return function(_0x181d80){if(_0x181d80){return _0x181d80[_0xbb5b('0x26')](_0x59e7cc)[_0xbb5b('0x27')](function(_0x9de532){return _0x9de532;});}return null;};}function removeEntity(_0xd5134f,_0x16aed3){return function(_0x1d2d23){if(_0x1d2d23){return _0x1d2d23['destroy']()[_0xbb5b('0x27')](function(){_0xd5134f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bd805,_0x276cdd){return function(_0x387f02){if(!_0x387f02){_0x5bd805['sendStatus'](0x194);}return _0x387f02;};}function handleError(_0x1f0f3d,_0x4845c7){_0x4845c7=_0x4845c7||0x1f4;return function(_0x2ec027){logger[_0xbb5b('0x28')](_0x2ec027[_0xbb5b('0x29')]);if(_0x2ec027[_0xbb5b('0x2a')]){delete _0x2ec027[_0xbb5b('0x2a')];}_0x1f0f3d[_0xbb5b('0x1b')](_0x4845c7)[_0xbb5b('0x2b')](_0x2ec027);};}exports[_0xbb5b('0x2c')]=function(_0x244868,_0x228a96){var _0x2a5f56={},_0x508f28={},_0x40e26e={'count':0x0,'rows':[]};var _0x4781ef=_[_0xbb5b('0x2d')](db[_0xbb5b('0x2e')][_0xbb5b('0x2f')],function(_0x58a07f){return{'name':_0x58a07f[_0xbb5b('0x30')],'type':_0x58a07f[_0xbb5b('0x31')][_0xbb5b('0x32')]};});_0x508f28['model']=_[_0xbb5b('0x2d')](_0x4781ef,'name');_0x508f28[_0xbb5b('0x33')]=_['keys'](_0x244868[_0xbb5b('0x33')]);_0x508f28[_0xbb5b('0x34')]=_[_0xbb5b('0x35')](_0x508f28['model'],_0x508f28[_0xbb5b('0x33')]);_0x2a5f56[_0xbb5b('0x36')]=_[_0xbb5b('0x35')](_0x508f28[_0xbb5b('0x37')],qs[_0xbb5b('0x38')](_0x244868[_0xbb5b('0x33')][_0xbb5b('0x38')]));_0x2a5f56['attributes']=_0x2a5f56['attributes']['length']?_0x2a5f56[_0xbb5b('0x36')]:_0x508f28['model'];if(!_0x244868[_0xbb5b('0x33')]['hasOwnProperty'](_0xbb5b('0x39'))){_0x2a5f56[_0xbb5b('0x20')]=qs[_0xbb5b('0x20')](_0x244868[_0xbb5b('0x33')][_0xbb5b('0x20')]);_0x2a5f56['offset']=qs[_0xbb5b('0x1d')](_0x244868[_0xbb5b('0x33')][_0xbb5b('0x1d')]);}_0x2a5f56['order']=qs[_0xbb5b('0x3a')](_0x244868[_0xbb5b('0x33')][_0xbb5b('0x3a')]);_0x2a5f56[_0xbb5b('0x3b')]=qs['filters'](_[_0xbb5b('0x3c')](_0x244868['query'],_0x508f28[_0xbb5b('0x34')]),_0x4781ef);if(_0x244868[_0xbb5b('0x33')][_0xbb5b('0x3d')]){_0x2a5f56[_0xbb5b('0x3b')]=_[_0xbb5b('0x3e')](_0x2a5f56['where'],{'$or':_[_0xbb5b('0x2d')](_0x4781ef,function(_0x1907aa){if(_0x1907aa['type']!==_0xbb5b('0x3f')){var _0x32ac98={};_0x32ac98[_0x1907aa['name']]={'$like':'%'+_0x244868[_0xbb5b('0x33')][_0xbb5b('0x3d')]+'%'};return _0x32ac98;}})});}_0x2a5f56=_[_0xbb5b('0x3e')]({},_0x2a5f56,_0x244868['options']);var _0x269902={'where':_0x2a5f56['where']};return db['SquareRecording'][_0xbb5b('0x1f')](_0x269902)['then'](function(_0x331669){_0x40e26e[_0xbb5b('0x1f')]=_0x331669;if(_0x244868[_0xbb5b('0x33')][_0xbb5b('0x40')]){_0x2a5f56[_0xbb5b('0x41')]=[{'all':!![]}];}return db[_0xbb5b('0x2e')][_0xbb5b('0x42')](_0x2a5f56);})[_0xbb5b('0x27')](function(_0x2f9295){_0x40e26e[_0xbb5b('0x43')]=_0x2f9295;return _0x40e26e;})[_0xbb5b('0x27')](respondWithFilteredResult(_0x228a96,_0x2a5f56))[_0xbb5b('0x44')](handleError(_0x228a96,null));};exports[_0xbb5b('0x45')]=function(_0x3d8ffc,_0x4310f6){var _0x268fd4={'raw':!![],'where':{'id':_0x3d8ffc[_0xbb5b('0x46')]['id']}},_0x4e5c72={};_0x4e5c72[_0xbb5b('0x37')]=_[_0xbb5b('0x47')](db['SquareRecording'][_0xbb5b('0x2f')]);_0x4e5c72['query']=_[_0xbb5b('0x47')](_0x3d8ffc['query']);_0x4e5c72['filters']=_[_0xbb5b('0x35')](_0x4e5c72[_0xbb5b('0x37')],_0x4e5c72['query']);_0x268fd4[_0xbb5b('0x36')]=_[_0xbb5b('0x35')](_0x4e5c72[_0xbb5b('0x37')],qs[_0xbb5b('0x38')](_0x3d8ffc[_0xbb5b('0x33')][_0xbb5b('0x38')]));_0x268fd4['attributes']=_0x268fd4[_0xbb5b('0x36')][_0xbb5b('0x48')]?_0x268fd4[_0xbb5b('0x36')]:_0x4e5c72[_0xbb5b('0x37')];if(_0x3d8ffc[_0xbb5b('0x33')][_0xbb5b('0x40')]){_0x268fd4['include']=[{'all':!![]}];}_0x268fd4=_[_0xbb5b('0x3e')]({},_0x268fd4,_0x3d8ffc[_0xbb5b('0x49')]);return db[_0xbb5b('0x2e')][_0xbb5b('0x4a')](_0x268fd4)[_0xbb5b('0x27')](handleEntityNotFound(_0x4310f6,null))[_0xbb5b('0x27')](respondWithResult(_0x4310f6,null))[_0xbb5b('0x44')](handleError(_0x4310f6,null));};exports[_0xbb5b('0x4b')]=function(_0x369e87,_0x47e417){return db[_0xbb5b('0x2e')][_0xbb5b('0x4b')](_0x369e87[_0xbb5b('0x4c')],{})['then'](respondWithResult(_0x47e417,0xc9))[_0xbb5b('0x44')](handleError(_0x47e417,null));};exports[_0xbb5b('0x26')]=function(_0x4b42f8,_0x3634a7){if(_0x4b42f8[_0xbb5b('0x4c')]['id']){delete _0x4b42f8[_0xbb5b('0x4c')]['id'];}return db['SquareRecording'][_0xbb5b('0x4a')]({'where':{'id':_0x4b42f8['params']['id']}})['then'](handleEntityNotFound(_0x3634a7,null))[_0xbb5b('0x27')](saveUpdates(_0x4b42f8[_0xbb5b('0x4c')],null))[_0xbb5b('0x27')](respondWithResult(_0x3634a7,null))[_0xbb5b('0x44')](handleError(_0x3634a7,null));};exports[_0xbb5b('0x4d')]=function(_0x3ef527,_0x282e76,_0x41552a){var _0x5878a2=require(_0xbb5b('0x4e'));var _0x3d3b65=![];var _0x227dc8={};if(_0x3ef527[_0xbb5b('0x33')][_0xbb5b('0x31')]&&_0x3ef527[_0xbb5b('0x33')]['type']===_0xbb5b('0x4f')){_0x227dc8[_0xbb5b('0x4f')]=_0x3ef527[_0xbb5b('0x46')]['id'];}else{_0x227dc8['id']=_0x3ef527[_0xbb5b('0x46')]['id'];}return db[_0xbb5b('0x2e')][_0xbb5b('0x4a')]({'where':_0x227dc8,'attributes':['id',_0xbb5b('0x50'),'filename'],'raw':!![]})[_0xbb5b('0x27')](handleEntityNotFound(_0x282e76,null))[_0xbb5b('0x27')](function(_0x16a004){if(_0x16a004){var _0x3aad40=_0x16a004[_0xbb5b('0x50')];var _0x18c64a=util[_0xbb5b('0x51')]('%s.cypher',_0x3aad40);if(fs[_0xbb5b('0x52')](_0x18c64a)){_0x3d3b65=!![];return _0x5878a2[_0xbb5b('0x53')](_0x18c64a,_0x3aad40,config[_0xbb5b('0x54')][_0xbb5b('0x55')])[_0xbb5b('0x27')](function(){return _0x16a004;});}return _0x16a004;}})[_0xbb5b('0x27')](function(_0x8fbaec){if(_0x8fbaec){var _0x14b290=_0x8fbaec['savePath'];if(!fs[_0xbb5b('0x52')](_0x14b290)){throw new db['Sequelize']['ValidationError']('SquareRecording\x20not\x20found');}if(_0x8fbaec[_0xbb5b('0x56')]){return _0x282e76[_0xbb5b('0x4d')](_0x14b290,_0x8fbaec['filename']+path[_0xbb5b('0x57')](_0x14b290),function(){if(_0x3d3b65){fs[_0xbb5b('0x58')](_0x14b290);}});}else{return _0x282e76[_0xbb5b('0x4d')](_0x14b290,function(_0x13628c){if(_0x3d3b65){fs[_0xbb5b('0x58')](_0x14b290);}});}}})[_0xbb5b('0x44')](function(_0x1911ae){if(_0x1911ae['message']===_0xbb5b('0x59')){_0x282e76[_0xbb5b('0x1b')](0x194)[_0xbb5b('0x2b')](_0xbb5b('0x5a'));}else{return handleError(_0x282e76,null);}});};exports['destroy']=function(_0x369297,_0x2a5ed4){return db[_0xbb5b('0x2e')]['find']({'where':{'id':_0x369297['params']['id']}})[_0xbb5b('0x27')](function(_0x300e56){if(_['isNil'](_0x300e56)){throw new ReferenceError('Entity\x20not\x20found');}return _0x300e56;})[_0xbb5b('0x27')](function(_0x14773c){var _0x20e792=_0x14773c['savePath'];logger['info'](_0xbb5b('0x5b'),_0x20e792);if(!_[_0xbb5b('0x5c')](_0x14773c[_0xbb5b('0x50')])&&fs['existsSync'](_0x20e792)){logger['info'](_0xbb5b('0x5d')+_0x20e792+_0xbb5b('0x5e'));fs[_0xbb5b('0x5f')](_0x20e792);}_0x20e792=_0x20e792+_0xbb5b('0x60');if(!_['isNil'](_0x14773c[_0xbb5b('0x50')])&&fs[_0xbb5b('0x52')](_0x20e792)){logger[_0xbb5b('0x61')](_0xbb5b('0x5d')+_0x20e792+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xbb5b('0x5f')](_0x20e792);}return _0x14773c;})[_0xbb5b('0x27')](function(_0x6b8298){if(!_0x6b8298)throw new InternalError();return _0x6b8298[_0xbb5b('0x62')]();})['then'](function(){_0x2a5ed4['status'](0xcc)[_0xbb5b('0x1c')]();})[_0xbb5b('0x44')](handleError(_0x2a5ed4,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 08dfc47..38e2570 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 _0xe3da=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','lodash'];(function(_0x46d0c9,_0x526bfa){var _0x174506=function(_0x654bc6){while(--_0x654bc6){_0x46d0c9['push'](_0x46d0c9['shift']());}};_0x174506(++_0x526bfa);}(_0xe3da,0x1cd));var _0xae3d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe3da[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xae3d('0x0'));var util=require(_0xae3d('0x1'));var logger=require(_0xae3d('0x2'))(_0xae3d('0x3'));var moment=require(_0xae3d('0x4'));var BPromise=require(_0xae3d('0x5'));var rp=require(_0xae3d('0x6'));var fs=require('fs');var path=require(_0xae3d('0x7'));var rimraf=require(_0xae3d('0x8'));var config=require(_0xae3d('0x9'));var attributes=require(_0xae3d('0xa'));module[_0xae3d('0xb')]=function(_0xa9a1a,_0xa54808){return _0xa9a1a[_0xae3d('0xc')](_0xae3d('0xd'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b64=['util','api','path','rimraf','../../config/environment','./squareRecording.attributes','lodash'];(function(_0x28f6a4,_0x329f15){var _0x96bf1a=function(_0x581c0e){while(--_0x581c0e){_0x28f6a4['push'](_0x28f6a4['shift']());}};_0x96bf1a(++_0x329f15);}(_0x1b64,0x76));var _0x41b6=function(_0x44acde,_0x14e4d2){_0x44acde=_0x44acde-0x0;var _0x10fdef=_0x1b64[_0x44acde];return _0x10fdef;};'use strict';var _=require(_0x41b6('0x0'));var util=require(_0x41b6('0x1'));var logger=require('../../config/logger')(_0x41b6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x41b6('0x3'));var rimraf=require(_0x41b6('0x4'));var config=require(_0x41b6('0x5'));var attributes=require(_0x41b6('0x6'));module['exports']=function(_0x4562da,_0x2d8af3){return _0x4562da['define']('SquareRecording',attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index 260ec5e..0edbc4a 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 _0x9934=['stringify','error','code','message','CreateSquareRecording','SquareRecording','create','body','options','raw','then','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x9934,0x7c));var _0x4993=function(_0x58a4ac,_0x43fd42){_0x58a4ac=_0x58a4ac-0x0;var _0x545810=_0x9934[_0x58a4ac];return _0x545810;};'use strict';var _=require('lodash');var util=require(_0x4993('0x0'));var moment=require('moment');var BPromise=require(_0x4993('0x1'));var rs=require(_0x4993('0x2'));var fs=require('fs');var Redis=require(_0x4993('0x3'));var db=require(_0x4993('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4993('0x5'))(_0x4993('0x6'));var config=require(_0x4993('0x7'));var jayson=require(_0x4993('0x8'));var client=jayson[_0x4993('0x9')][_0x4993('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x484c87,_0x4afbb7,_0x31354d){return new BPromise(function(_0x1171aa,_0x5125dc){return client['request'](_0x484c87,_0x31354d)['then'](function(_0x390beb){logger[_0x4993('0xb')](_0x4993('0xc'),_0x4afbb7,_0x4993('0xd'));logger[_0x4993('0xe')](_0x4993('0xf'),_0x4afbb7,'request\x20sent',JSON[_0x4993('0x10')](_0x390beb));if(_0x390beb[_0x4993('0x11')]){if(_0x390beb[_0x4993('0x11')][_0x4993('0x12')]===0x1f4){logger['error'](_0x4993('0xc'),_0x4afbb7,_0x390beb[_0x4993('0x11')][_0x4993('0x13')]);return _0x5125dc(_0x390beb['error'][_0x4993('0x13')]);}logger[_0x4993('0x11')]('SquareRecording,\x20%s,\x20%s',_0x4afbb7,_0x390beb[_0x4993('0x11')][_0x4993('0x13')]);return _0x1171aa(_0x390beb[_0x4993('0x11')][_0x4993('0x13')]);}else{logger[_0x4993('0xb')](_0x4993('0xc'),_0x4afbb7,_0x4993('0xd'));_0x1171aa(_0x390beb['result'][_0x4993('0x13')]);}})['catch'](function(_0x4b4a27){logger[_0x4993('0x11')](_0x4993('0xc'),_0x4afbb7,_0x4b4a27);_0x5125dc(_0x4b4a27);});});}exports[_0x4993('0x14')]=function(_0x276282){var _0x57eefd=this;return new Promise(function(_0x5d8d07,_0x4c0172){return db[_0x4993('0x15')][_0x4993('0x16')](_0x276282[_0x4993('0x17')],{'raw':_0x276282[_0x4993('0x18')]?_0x276282[_0x4993('0x18')][_0x4993('0x19')]===undefined?!![]:![]:!![]})[_0x4993('0x1a')](function(_0x49b97a){logger[_0x4993('0xb')](_0x4993('0x14'),_0x276282);logger[_0x4993('0xe')]('CreateSquareRecording',_0x276282,JSON['stringify'](_0x49b97a));_0x5d8d07(_0x49b97a);})[_0x4993('0x1b')](function(_0x498490){logger[_0x4993('0x11')](_0x4993('0x14'),_0x498490[_0x4993('0x13')],_0x276282);_0x4c0172(_0x57eefd[_0x4993('0x11')](0x1f4,_0x498490[_0x4993('0x13')]));});});}; \ No newline at end of file +var _0xd226=['catch','CreateSquareRecording','create','body','options','raw','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x111311,_0x1e2f69){var _0x4cef39=function(_0x382ab2){while(--_0x382ab2){_0x111311['push'](_0x111311['shift']());}};_0x4cef39(++_0x1e2f69);}(_0xd226,0x13e));var _0x6d22=function(_0x3bd478,_0x1bb19a){_0x3bd478=_0x3bd478-0x0;var _0x5d4211=_0xd226[_0x3bd478];return _0x5d4211;};'use strict';var _=require(_0x6d22('0x0'));var util=require('util');var moment=require(_0x6d22('0x1'));var BPromise=require('bluebird');var rs=require(_0x6d22('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6d22('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6d22('0x4'))(_0x6d22('0x5'));var config=require(_0x6d22('0x6'));var jayson=require(_0x6d22('0x7'));var client=jayson[_0x6d22('0x8')][_0x6d22('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x196a1f,_0xe012a3,_0x55e6d5){return new BPromise(function(_0x269af4,_0x37e06b){return client[_0x6d22('0xa')](_0x196a1f,_0x55e6d5)[_0x6d22('0xb')](function(_0x1f4984){logger[_0x6d22('0xc')](_0x6d22('0xd'),_0xe012a3,_0x6d22('0xe'));logger[_0x6d22('0xf')](_0x6d22('0x10'),_0xe012a3,_0x6d22('0xe'),JSON[_0x6d22('0x11')](_0x1f4984));if(_0x1f4984['error']){if(_0x1f4984['error']['code']===0x1f4){logger[_0x6d22('0x12')](_0x6d22('0xd'),_0xe012a3,_0x1f4984[_0x6d22('0x12')][_0x6d22('0x13')]);return _0x37e06b(_0x1f4984['error'][_0x6d22('0x13')]);}logger['error']('SquareRecording,\x20%s,\x20%s',_0xe012a3,_0x1f4984[_0x6d22('0x12')][_0x6d22('0x13')]);return _0x269af4(_0x1f4984[_0x6d22('0x12')][_0x6d22('0x13')]);}else{logger[_0x6d22('0xc')](_0x6d22('0xd'),_0xe012a3,_0x6d22('0xe'));_0x269af4(_0x1f4984['result'][_0x6d22('0x13')]);}})[_0x6d22('0x14')](function(_0x2efcd7){logger[_0x6d22('0x12')](_0x6d22('0xd'),_0xe012a3,_0x2efcd7);_0x37e06b(_0x2efcd7);});});}exports[_0x6d22('0x15')]=function(_0x300911){var _0x2f9ad2=this;return new Promise(function(_0x2c43a6,_0x2b9afe){return db['SquareRecording'][_0x6d22('0x16')](_0x300911[_0x6d22('0x17')],{'raw':_0x300911[_0x6d22('0x18')]?_0x300911[_0x6d22('0x18')][_0x6d22('0x19')]===undefined?!![]:![]:!![]})[_0x6d22('0xb')](function(_0x3bf758){logger[_0x6d22('0xc')](_0x6d22('0x15'),_0x300911);logger[_0x6d22('0xf')](_0x6d22('0x15'),_0x300911,JSON[_0x6d22('0x11')](_0x3bf758));_0x2c43a6(_0x3bf758);})[_0x6d22('0x14')](function(_0x45def6){logger[_0x6d22('0x12')](_0x6d22('0x15'),_0x45def6[_0x6d22('0x13')],_0x300911);_0x2b9afe(_0x2f9ad2[_0x6d22('0x12')](0x1f4,_0x45def6[_0x6d22('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 6a98abe..767841b 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','index','/describe','show','post'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router; \ No newline at end of file +var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x1389de,_0x54250f){var _0x2dba13=function(_0x31ad66){while(--_0x31ad66){_0x1389de['push'](_0x1389de['shift']());}};_0x2dba13(++_0x54250f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 9012e1e..0d61d23 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 _0x633c=['BOOLEAN','sequelize','STRING','DATE'];(function(_0x2b78e5,_0x3126f8){var _0xa8d52d=function(_0x51fd7f){while(--_0x51fd7f){_0x2b78e5['push'](_0x2b78e5['shift']());}};_0xa8d52d(++_0x3126f8);}(_0x633c,0x1c5));var _0xc633=function(_0x21839e,_0x22f8ed){_0x21839e=_0x21839e-0x0;var _0x5cf6ba=_0x633c[_0x21839e];return _0x5cf6ba;};'use strict';var Sequelize=require(_0xc633('0x0'));module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0xc633('0x1')]},'request':{'type':Sequelize[_0xc633('0x1')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xc633('0x1')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xc633('0x1')]},'version':{'type':Sequelize[_0xc633('0x1')]},'callerid':{'type':Sequelize[_0xc633('0x1')]},'calleridname':{'type':Sequelize[_0xc633('0x1')]},'callingpres':{'type':Sequelize[_0xc633('0x1')]},'callingani2':{'type':Sequelize[_0xc633('0x1')]},'callington':{'type':Sequelize[_0xc633('0x1')]},'callingtns':{'type':Sequelize[_0xc633('0x1')]},'dnid':{'type':Sequelize[_0xc633('0x1')]},'rdnis':{'type':Sequelize[_0xc633('0x1')]},'context':{'type':Sequelize[_0xc633('0x1')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0xc633('0x1')]},'accountcode':{'type':Sequelize[_0xc633('0x1')]},'threadid':{'type':Sequelize[_0xc633('0x1')]},'project_name':{'type':Sequelize[_0xc633('0x1')]},'joinAt':{'type':Sequelize[_0xc633('0x2')]},'leaveAt':{'type':Sequelize[_0xc633('0x2')]},'bot':{'type':Sequelize[_0xc633('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xe496=['exports','STRING','DATE'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xe496,0x114));var _0x6e49=function(_0x1bbc86,_0x27e57b){_0x1bbc86=_0x1bbc86-0x0;var _0x5de2f4=_0xe496[_0x1bbc86];return _0x5de2f4;};'use strict';var Sequelize=require('sequelize');module[_0x6e49('0x0')]={'network':{'type':Sequelize[_0x6e49('0x1')]},'network_script':{'type':Sequelize[_0x6e49('0x1')]},'request':{'type':Sequelize[_0x6e49('0x1')]},'channel':{'type':Sequelize[_0x6e49('0x1')]},'language':{'type':Sequelize[_0x6e49('0x1')]},'type':{'type':Sequelize[_0x6e49('0x1')]},'uniqueid':{'type':Sequelize[_0x6e49('0x1')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x6e49('0x1')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x6e49('0x1')]},'callingtns':{'type':Sequelize[_0x6e49('0x1')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize[_0x6e49('0x1')]},'context':{'type':Sequelize[_0x6e49('0x1')]},'extension':{'type':Sequelize[_0x6e49('0x1')]},'priority':{'type':Sequelize[_0x6e49('0x1')]},'enhanced':{'type':Sequelize[_0x6e49('0x1')]},'accountcode':{'type':Sequelize[_0x6e49('0x1')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x6e49('0x1')]},'joinAt':{'type':Sequelize[_0x6e49('0x2')]},'leaveAt':{'type':Sequelize[_0x6e49('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 a842d18..ab91966 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 _0x54aa=['path','sox','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','map','SquareReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x54aa,0x1c1));var _0xa54a=function(_0x12c007,_0xe2c490){_0x12c007=_0x12c007-0x0;var _0x5bc14b=_0x54aa[_0x12c007];return _0x5bc14b;};'use strict';var emlformat=require(_0xa54a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa54a('0x1'));var jsonpatch=require(_0xa54a('0x2'));var rp=require(_0xa54a('0x3'));var moment=require(_0xa54a('0x4'));var BPromise=require(_0xa54a('0x5'));var Mustache=require(_0xa54a('0x6'));var util=require('util');var path=require(_0xa54a('0x7'));var sox=require(_0xa54a('0x8'));var csv=require('to-csv');var ejs=require(_0xa54a('0x9'));var fs=require('fs');var fs_extra=require(_0xa54a('0xa'));var _=require('lodash');var squel=require(_0xa54a('0xb'));var crypto=require('crypto');var jsforce=require(_0xa54a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa54a('0xd'));var querystring=require(_0xa54a('0xe'));var Papa=require(_0xa54a('0xf'));var Redis=require(_0xa54a('0x10'));var authService=require(_0xa54a('0x11'));var qs=require(_0xa54a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa54a('0x13'));var logger=require(_0xa54a('0x14'))('api');var utils=require(_0xa54a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa54a('0x16'));var db=require(_0xa54a('0x17'))['db'];function respondWithStatusCode(_0x2f7cf2,_0x4c9cca){_0x4c9cca=_0x4c9cca||0xcc;return function(_0x294d62){if(_0x294d62){return _0x2f7cf2['sendStatus'](_0x4c9cca);}return _0x2f7cf2[_0xa54a('0x18')](_0x4c9cca)['end']();};}function respondWithResult(_0x1f8b0e,_0x43e94f){_0x43e94f=_0x43e94f||0xc8;return function(_0x4d1da9){if(_0x4d1da9){return _0x1f8b0e[_0xa54a('0x18')](_0x43e94f)[_0xa54a('0x19')](_0x4d1da9);}};}function respondWithFilteredResult(_0x352268,_0x5580c8){return function(_0x2212bc){if(_0x2212bc){var _0x503526=typeof _0x5580c8['offset']===_0xa54a('0x1a')&&typeof _0x5580c8[_0xa54a('0x1b')]===_0xa54a('0x1a');var _0xe5e79b=_0x2212bc[_0xa54a('0x1c')];var _0x485885=_0x503526?0x0:_0x5580c8[_0xa54a('0x1d')];var _0x3d993f=_0x503526?_0x2212bc[_0xa54a('0x1c')]:_0x5580c8[_0xa54a('0x1d')]+_0x5580c8[_0xa54a('0x1b')];var _0x189b32;if(_0x3d993f>=_0xe5e79b){_0x3d993f=_0xe5e79b;_0x189b32=0xc8;}else{_0x189b32=0xce;}_0x352268[_0xa54a('0x18')](_0x189b32);return _0x352268[_0xa54a('0x1e')](_0xa54a('0x1f'),_0x485885+'-'+_0x3d993f+'/'+_0xe5e79b)['json'](_0x2212bc);}return null;};}function patchUpdates(_0x51b9b7){return function(_0x3dd310){try{jsonpatch[_0xa54a('0x20')](_0x3dd310,_0x51b9b7,!![]);}catch(_0x426a5a){return BPromise[_0xa54a('0x21')](_0x426a5a);}return _0x3dd310[_0xa54a('0x22')]();};}function saveUpdates(_0x455c74,_0x2ae94b){return function(_0x13ed15){if(_0x13ed15){return _0x13ed15[_0xa54a('0x23')](_0x455c74)[_0xa54a('0x24')](function(_0x4a9da6){return _0x4a9da6;});}return null;};}function removeEntity(_0x33e794,_0x1ebd62){return function(_0x1ef230){if(_0x1ef230){return _0x1ef230[_0xa54a('0x25')]()[_0xa54a('0x24')](function(){_0x33e794[_0xa54a('0x18')](0xcc)[_0xa54a('0x26')]();});}};}function handleEntityNotFound(_0x5b01f2,_0x3c8279){return function(_0x314e2d){if(!_0x314e2d){_0x5b01f2[_0xa54a('0x27')](0x194);}return _0x314e2d;};}function handleError(_0x109469,_0x395053){_0x395053=_0x395053||0x1f4;return function(_0x3d59e0){logger[_0xa54a('0x28')](_0x3d59e0[_0xa54a('0x29')]);if(_0x3d59e0[_0xa54a('0x2a')]){delete _0x3d59e0[_0xa54a('0x2a')];}_0x109469[_0xa54a('0x18')](_0x395053)['send'](_0x3d59e0);};}exports['index']=function(_0x6b0ba5,_0x295fd8){var _0x17aa6b={},_0x52376f={},_0x1369df={'count':0x0,'rows':[]};var _0x5958d4=_[_0xa54a('0x2b')](db[_0xa54a('0x2c')][_0xa54a('0x2d')],function(_0x4476ec){return{'name':_0x4476ec['fieldName'],'type':_0x4476ec[_0xa54a('0x2e')][_0xa54a('0x2f')]};});_0x52376f[_0xa54a('0x30')]=_[_0xa54a('0x2b')](_0x5958d4,_0xa54a('0x2a'));_0x52376f[_0xa54a('0x31')]=_[_0xa54a('0x32')](_0x6b0ba5[_0xa54a('0x31')]);_0x52376f[_0xa54a('0x33')]=_[_0xa54a('0x34')](_0x52376f[_0xa54a('0x30')],_0x52376f[_0xa54a('0x31')]);_0x17aa6b[_0xa54a('0x35')]=_[_0xa54a('0x34')](_0x52376f[_0xa54a('0x30')],qs[_0xa54a('0x36')](_0x6b0ba5[_0xa54a('0x31')][_0xa54a('0x36')]));_0x17aa6b['attributes']=_0x17aa6b[_0xa54a('0x35')][_0xa54a('0x37')]?_0x17aa6b[_0xa54a('0x35')]:_0x52376f['model'];if(!_0x6b0ba5[_0xa54a('0x31')]['hasOwnProperty'](_0xa54a('0x38'))){_0x17aa6b[_0xa54a('0x1b')]=qs['limit'](_0x6b0ba5[_0xa54a('0x31')][_0xa54a('0x1b')]);_0x17aa6b[_0xa54a('0x1d')]=qs[_0xa54a('0x1d')](_0x6b0ba5[_0xa54a('0x31')]['offset']);}_0x17aa6b[_0xa54a('0x39')]=qs[_0xa54a('0x3a')](_0x6b0ba5[_0xa54a('0x31')]['sort']);_0x17aa6b['where']=qs[_0xa54a('0x33')](_[_0xa54a('0x3b')](_0x6b0ba5[_0xa54a('0x31')],_0x52376f[_0xa54a('0x33')]),_0x5958d4);if(_0x6b0ba5[_0xa54a('0x31')]['filter']){_0x17aa6b[_0xa54a('0x3c')]=_[_0xa54a('0x3d')](_0x17aa6b[_0xa54a('0x3c')],{'$or':_[_0xa54a('0x2b')](_0x5958d4,function(_0x512d1d){if(_0x512d1d[_0xa54a('0x2e')]!==_0xa54a('0x3e')){var _0x287604={};_0x287604[_0x512d1d[_0xa54a('0x2a')]]={'$like':'%'+_0x6b0ba5['query'][_0xa54a('0x3f')]+'%'};return _0x287604;}})});}_0x17aa6b=_[_0xa54a('0x3d')]({},_0x17aa6b,_0x6b0ba5[_0xa54a('0x40')]);var _0x3f542f={'where':_0x17aa6b[_0xa54a('0x3c')]};return db[_0xa54a('0x2c')]['count'](_0x3f542f)['then'](function(_0x29af18){_0x1369df['count']=_0x29af18;if(_0x6b0ba5[_0xa54a('0x31')][_0xa54a('0x41')]){_0x17aa6b[_0xa54a('0x42')]=[{'all':!![]}];}return db[_0xa54a('0x2c')][_0xa54a('0x43')](_0x17aa6b);})['then'](function(_0x577a48){_0x1369df[_0xa54a('0x44')]=_0x577a48;return _0x1369df;})[_0xa54a('0x24')](respondWithFilteredResult(_0x295fd8,_0x17aa6b))['catch'](handleError(_0x295fd8,null));};exports[_0xa54a('0x45')]=function(_0x21181b,_0x1091da){var _0x317015={'raw':!![],'where':{'id':_0x21181b[_0xa54a('0x46')]['id']}},_0x277936={};_0x277936[_0xa54a('0x30')]=_[_0xa54a('0x32')](db[_0xa54a('0x2c')][_0xa54a('0x2d')]);_0x277936[_0xa54a('0x31')]=_[_0xa54a('0x32')](_0x21181b[_0xa54a('0x31')]);_0x277936[_0xa54a('0x33')]=_[_0xa54a('0x34')](_0x277936['model'],_0x277936[_0xa54a('0x31')]);_0x317015[_0xa54a('0x35')]=_[_0xa54a('0x34')](_0x277936[_0xa54a('0x30')],qs[_0xa54a('0x36')](_0x21181b[_0xa54a('0x31')][_0xa54a('0x36')]));_0x317015[_0xa54a('0x35')]=_0x317015['attributes'][_0xa54a('0x37')]?_0x317015['attributes']:_0x277936[_0xa54a('0x30')];if(_0x21181b[_0xa54a('0x31')][_0xa54a('0x41')]){_0x317015[_0xa54a('0x42')]=[{'all':!![]}];}_0x317015=_[_0xa54a('0x3d')]({},_0x317015,_0x21181b['options']);return db[_0xa54a('0x2c')][_0xa54a('0x47')](_0x317015)['then'](handleEntityNotFound(_0x1091da,null))[_0xa54a('0x24')](respondWithResult(_0x1091da,null))[_0xa54a('0x48')](handleError(_0x1091da,null));};exports[_0xa54a('0x49')]=function(_0x749d2b,_0xca62a6){return db[_0xa54a('0x2c')][_0xa54a('0x49')](_0x749d2b[_0xa54a('0x4a')],{})[_0xa54a('0x24')](respondWithResult(_0xca62a6,0xc9))[_0xa54a('0x48')](handleError(_0xca62a6,null));};exports['update']=function(_0x2a05b8,_0x4baa75){if(_0x2a05b8[_0xa54a('0x4a')]['id']){delete _0x2a05b8['body']['id'];}return db[_0xa54a('0x2c')][_0xa54a('0x47')]({'where':{'id':_0x2a05b8[_0xa54a('0x46')]['id']}})['then'](handleEntityNotFound(_0x4baa75,null))[_0xa54a('0x24')](saveUpdates(_0x2a05b8[_0xa54a('0x4a')],null))[_0xa54a('0x24')](respondWithResult(_0x4baa75,null))[_0xa54a('0x48')](handleError(_0x4baa75,null));};exports[_0xa54a('0x25')]=function(_0x526f27,_0x4f2159){return db[_0xa54a('0x2c')][_0xa54a('0x47')]({'where':{'id':_0x526f27[_0xa54a('0x46')]['id']}})[_0xa54a('0x24')](handleEntityNotFound(_0x4f2159,null))[_0xa54a('0x24')](removeEntity(_0x4f2159,null))['catch'](handleError(_0x4f2159,null));};exports[_0xa54a('0x4b')]=function(_0x49e963,_0x122b91){return db['SquareReport'][_0xa54a('0x4b')]()['then'](respondWithResult(_0x122b91,null))[_0xa54a('0x48')](handleError(_0x122b91,null));}; \ No newline at end of file +var _0x64cb=['ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','destroy','then','error','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse'];(function(_0x3af6d5,_0x170dbc){var _0x5458a3=function(_0x2cb06a){while(--_0x2cb06a){_0x3af6d5['push'](_0x3af6d5['shift']());}};_0x5458a3(++_0x170dbc);}(_0x64cb,0x86));var _0xb64c=function(_0x28d252,_0x160cb9){_0x28d252=_0x28d252-0x0;var _0x48d8cb=_0x64cb[_0x28d252];return _0x48d8cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb64c('0x0'));var zipdir=require(_0xb64c('0x1'));var jsonpatch=require(_0xb64c('0x2'));var rp=require(_0xb64c('0x3'));var moment=require(_0xb64c('0x4'));var BPromise=require(_0xb64c('0x5'));var Mustache=require(_0xb64c('0x6'));var util=require(_0xb64c('0x7'));var path=require(_0xb64c('0x8'));var sox=require(_0xb64c('0x9'));var csv=require(_0xb64c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb64c('0xb'));var squel=require('squel');var crypto=require(_0xb64c('0xc'));var jsforce=require(_0xb64c('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb64c('0xe'));var Papa=require(_0xb64c('0xf'));var Redis=require(_0xb64c('0x10'));var authService=require(_0xb64c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb64c('0x12'))(_0xb64c('0x13'));var utils=require(_0xb64c('0x14'));var config=require(_0xb64c('0x15'));var licenseUtil=require(_0xb64c('0x16'));var db=require(_0xb64c('0x17'))['db'];function respondWithStatusCode(_0x581c22,_0x2f492d){_0x2f492d=_0x2f492d||0xcc;return function(_0x89d8de){if(_0x89d8de){return _0x581c22[_0xb64c('0x18')](_0x2f492d);}return _0x581c22['status'](_0x2f492d)[_0xb64c('0x19')]();};}function respondWithResult(_0x25d354,_0x53de44){_0x53de44=_0x53de44||0xc8;return function(_0xa7998){if(_0xa7998){return _0x25d354[_0xb64c('0x1a')](_0x53de44)['json'](_0xa7998);}};}function respondWithFilteredResult(_0x2ffd1b,_0x2bc425){return function(_0x43115e){if(_0x43115e){var _0xb8d321=typeof _0x2bc425[_0xb64c('0x1b')]===_0xb64c('0x1c')&&typeof _0x2bc425[_0xb64c('0x1d')]===_0xb64c('0x1c');var _0x5590f8=_0x43115e[_0xb64c('0x1e')];var _0x58a0b6=_0xb8d321?0x0:_0x2bc425[_0xb64c('0x1b')];var _0x16055f=_0xb8d321?_0x43115e['count']:_0x2bc425[_0xb64c('0x1b')]+_0x2bc425['limit'];var _0x4daef0;if(_0x16055f>=_0x5590f8){_0x16055f=_0x5590f8;_0x4daef0=0xc8;}else{_0x4daef0=0xce;}_0x2ffd1b[_0xb64c('0x1a')](_0x4daef0);return _0x2ffd1b[_0xb64c('0x1f')](_0xb64c('0x20'),_0x58a0b6+'-'+_0x16055f+'/'+_0x5590f8)[_0xb64c('0x21')](_0x43115e);}return null;};}function patchUpdates(_0x44c5b2){return function(_0x3ce093){try{jsonpatch['apply'](_0x3ce093,_0x44c5b2,!![]);}catch(_0x3ae3a0){return BPromise['reject'](_0x3ae3a0);}return _0x3ce093['save']();};}function saveUpdates(_0x3c55b7,_0x4144aa){return function(_0x19cdd8){if(_0x19cdd8){return _0x19cdd8['update'](_0x3c55b7)['then'](function(_0x15a3eb){return _0x15a3eb;});}return null;};}function removeEntity(_0x4c749e,_0x244a37){return function(_0x2b8646){if(_0x2b8646){return _0x2b8646[_0xb64c('0x22')]()[_0xb64c('0x23')](function(){_0x4c749e[_0xb64c('0x1a')](0xcc)[_0xb64c('0x19')]();});}};}function handleEntityNotFound(_0x1b2501,_0x5e88eb){return function(_0xcaa377){if(!_0xcaa377){_0x1b2501[_0xb64c('0x18')](0x194);}return _0xcaa377;};}function handleError(_0x2d5edd,_0x14e226){_0x14e226=_0x14e226||0x1f4;return function(_0x3dca7c){logger[_0xb64c('0x24')](_0x3dca7c[_0xb64c('0x25')]);if(_0x3dca7c[_0xb64c('0x26')]){delete _0x3dca7c[_0xb64c('0x26')];}_0x2d5edd['status'](_0x14e226)[_0xb64c('0x27')](_0x3dca7c);};}exports[_0xb64c('0x28')]=function(_0x5ae468,_0x577bc6){var _0x1f19d9={},_0x598241={},_0x559948={'count':0x0,'rows':[]};var _0x1d0c2c=_[_0xb64c('0x29')](db[_0xb64c('0x2a')][_0xb64c('0x2b')],function(_0x507f00){return{'name':_0x507f00[_0xb64c('0x2c')],'type':_0x507f00[_0xb64c('0x2d')]['key']};});_0x598241['model']=_[_0xb64c('0x29')](_0x1d0c2c,'name');_0x598241[_0xb64c('0x2e')]=_['keys'](_0x5ae468[_0xb64c('0x2e')]);_0x598241['filters']=_['intersection'](_0x598241[_0xb64c('0x2f')],_0x598241['query']);_0x1f19d9[_0xb64c('0x30')]=_[_0xb64c('0x31')](_0x598241[_0xb64c('0x2f')],qs[_0xb64c('0x32')](_0x5ae468['query']['fields']));_0x1f19d9[_0xb64c('0x30')]=_0x1f19d9[_0xb64c('0x30')][_0xb64c('0x33')]?_0x1f19d9[_0xb64c('0x30')]:_0x598241[_0xb64c('0x2f')];if(!_0x5ae468[_0xb64c('0x2e')][_0xb64c('0x34')](_0xb64c('0x35'))){_0x1f19d9[_0xb64c('0x1d')]=qs[_0xb64c('0x1d')](_0x5ae468['query'][_0xb64c('0x1d')]);_0x1f19d9[_0xb64c('0x1b')]=qs[_0xb64c('0x1b')](_0x5ae468['query']['offset']);}_0x1f19d9[_0xb64c('0x36')]=qs[_0xb64c('0x37')](_0x5ae468[_0xb64c('0x2e')][_0xb64c('0x37')]);_0x1f19d9[_0xb64c('0x38')]=qs[_0xb64c('0x39')](_[_0xb64c('0x3a')](_0x5ae468['query'],_0x598241[_0xb64c('0x39')]),_0x1d0c2c);if(_0x5ae468[_0xb64c('0x2e')][_0xb64c('0x3b')]){_0x1f19d9[_0xb64c('0x38')]=_[_0xb64c('0x3c')](_0x1f19d9[_0xb64c('0x38')],{'$or':_[_0xb64c('0x29')](_0x1d0c2c,function(_0x531637){if(_0x531637['type']!=='VIRTUAL'){var _0x50f95d={};_0x50f95d[_0x531637[_0xb64c('0x26')]]={'$like':'%'+_0x5ae468[_0xb64c('0x2e')][_0xb64c('0x3b')]+'%'};return _0x50f95d;}})});}_0x1f19d9=_[_0xb64c('0x3c')]({},_0x1f19d9,_0x5ae468[_0xb64c('0x3d')]);var _0x83d224={'where':_0x1f19d9[_0xb64c('0x38')]};return db[_0xb64c('0x2a')][_0xb64c('0x1e')](_0x83d224)[_0xb64c('0x23')](function(_0x3ad115){_0x559948[_0xb64c('0x1e')]=_0x3ad115;if(_0x5ae468['query'][_0xb64c('0x3e')]){_0x1f19d9[_0xb64c('0x3f')]=[{'all':!![]}];}return db[_0xb64c('0x2a')][_0xb64c('0x40')](_0x1f19d9);})[_0xb64c('0x23')](function(_0x127eea){_0x559948[_0xb64c('0x41')]=_0x127eea;return _0x559948;})[_0xb64c('0x23')](respondWithFilteredResult(_0x577bc6,_0x1f19d9))[_0xb64c('0x42')](handleError(_0x577bc6,null));};exports[_0xb64c('0x43')]=function(_0x50e602,_0x27b3c5){var _0x5d7b64={'raw':!![],'where':{'id':_0x50e602[_0xb64c('0x44')]['id']}},_0x2f62c0={};_0x2f62c0['model']=_['keys'](db[_0xb64c('0x2a')]['rawAttributes']);_0x2f62c0[_0xb64c('0x2e')]=_[_0xb64c('0x45')](_0x50e602[_0xb64c('0x2e')]);_0x2f62c0[_0xb64c('0x39')]=_['intersection'](_0x2f62c0[_0xb64c('0x2f')],_0x2f62c0[_0xb64c('0x2e')]);_0x5d7b64[_0xb64c('0x30')]=_[_0xb64c('0x31')](_0x2f62c0['model'],qs[_0xb64c('0x32')](_0x50e602['query'][_0xb64c('0x32')]));_0x5d7b64['attributes']=_0x5d7b64['attributes']['length']?_0x5d7b64[_0xb64c('0x30')]:_0x2f62c0['model'];if(_0x50e602[_0xb64c('0x2e')]['includeAll']){_0x5d7b64[_0xb64c('0x3f')]=[{'all':!![]}];}_0x5d7b64=_[_0xb64c('0x3c')]({},_0x5d7b64,_0x50e602[_0xb64c('0x3d')]);return db['SquareReport'][_0xb64c('0x46')](_0x5d7b64)[_0xb64c('0x23')](handleEntityNotFound(_0x27b3c5,null))[_0xb64c('0x23')](respondWithResult(_0x27b3c5,null))[_0xb64c('0x42')](handleError(_0x27b3c5,null));};exports[_0xb64c('0x47')]=function(_0x4b952c,_0x43e380){return db[_0xb64c('0x2a')][_0xb64c('0x47')](_0x4b952c[_0xb64c('0x48')],{})[_0xb64c('0x23')](respondWithResult(_0x43e380,0xc9))[_0xb64c('0x42')](handleError(_0x43e380,null));};exports[_0xb64c('0x49')]=function(_0x15ea54,_0x5e1daa){if(_0x15ea54[_0xb64c('0x48')]['id']){delete _0x15ea54[_0xb64c('0x48')]['id'];}return db['SquareReport'][_0xb64c('0x46')]({'where':{'id':_0x15ea54[_0xb64c('0x44')]['id']}})['then'](handleEntityNotFound(_0x5e1daa,null))[_0xb64c('0x23')](saveUpdates(_0x15ea54['body'],null))[_0xb64c('0x23')](respondWithResult(_0x5e1daa,null))[_0xb64c('0x42')](handleError(_0x5e1daa,null));};exports[_0xb64c('0x22')]=function(_0x1223f3,_0x28aa61){return db[_0xb64c('0x2a')]['find']({'where':{'id':_0x1223f3[_0xb64c('0x44')]['id']}})[_0xb64c('0x23')](handleEntityNotFound(_0x28aa61,null))[_0xb64c('0x23')](removeEntity(_0x28aa61,null))[_0xb64c('0x42')](handleError(_0x28aa61,null));};exports[_0xb64c('0x4a')]=function(_0x19c1d2,_0x418c21){return db[_0xb64c('0x2a')][_0xb64c('0x4a')]()[_0xb64c('0x23')](respondWithResult(_0x418c21,null))[_0xb64c('0x42')](handleError(_0x418c21,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 5110438..4a59e69 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 _0x81f5=['moment','request-promise','path','./squareReport.attributes','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api'];(function(_0xc7d42d,_0x27afe7){var _0x1f5389=function(_0x8f0a0a){while(--_0x8f0a0a){_0xc7d42d['push'](_0xc7d42d['shift']());}};_0x1f5389(++_0x27afe7);}(_0x81f5,0xec));var _0x581f=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0x81f5[_0x49ca18];return _0x145d54;};'use strict';var _=require(_0x581f('0x0'));var util=require(_0x581f('0x1'));var logger=require(_0x581f('0x2'))(_0x581f('0x3'));var moment=require(_0x581f('0x4'));var BPromise=require('bluebird');var rp=require(_0x581f('0x5'));var fs=require('fs');var path=require(_0x581f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x581f('0x7'));module['exports']=function(_0x4861ba,_0x4bdd78){return _0x4861ba[_0x581f('0x8')](_0x581f('0x9'),attributes,{'tableName':_0x581f('0xa'),'paranoid':![],'indexes':[{'name':_0x581f('0xb'),'fields':[_0x581f('0xc'),_0x581f('0xd')]},{'name':_0x581f('0xe'),'fields':[_0x581f('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc9a0=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','util'];(function(_0x3a493c,_0x2db3f8){var _0x46c900=function(_0xf4bad4){while(--_0xf4bad4){_0x3a493c['push'](_0x3a493c['shift']());}};_0x46c900(++_0x2db3f8);}(_0xc9a0,0x1ec));var _0x0c9a=function(_0x314f47,_0x3b1d4e){_0x314f47=_0x314f47-0x0;var _0x470ad9=_0xc9a0[_0x314f47];return _0x470ad9;};'use strict';var _=require('lodash');var util=require(_0x0c9a('0x0'));var logger=require('../../config/logger')(_0x0c9a('0x1'));var moment=require(_0x0c9a('0x2'));var BPromise=require(_0x0c9a('0x3'));var rp=require(_0x0c9a('0x4'));var fs=require('fs');var path=require(_0x0c9a('0x5'));var rimraf=require(_0x0c9a('0x6'));var config=require(_0x0c9a('0x7'));var attributes=require(_0x0c9a('0x8'));module[_0x0c9a('0x9')]=function(_0x1744f7,_0x61b468){return _0x1744f7[_0x0c9a('0xa')](_0x0c9a('0xb'),attributes,{'tableName':_0x0c9a('0xc'),'paranoid':![],'indexes':[{'name':_0x0c9a('0xd'),'fields':[_0x0c9a('0xe'),_0x0c9a('0xf')]},{'name':'leaveAt','fields':[_0x0c9a('0x10')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index afde7af..5731266 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 _0x1b27=['moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','request','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateSquareReport','SquareReport','create','body','options','raw','then','catch','UpdateSquareReport','where','limit','lodash','util'];(function(_0x162f3d,_0x431654){var _0x2f5437=function(_0x37483f){while(--_0x37483f){_0x162f3d['push'](_0x162f3d['shift']());}};_0x2f5437(++_0x431654);}(_0x1b27,0x14e));var _0x71b2=function(_0x2a9461,_0x25ecf8){_0x2a9461=_0x2a9461-0x0;var _0x15b1f0=_0x1b27[_0x2a9461];return _0x15b1f0;};'use strict';var _=require(_0x71b2('0x0'));var util=require(_0x71b2('0x1'));var moment=require(_0x71b2('0x2'));var BPromise=require(_0x71b2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x71b2('0x4'));var db=require(_0x71b2('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x71b2('0x6'));var config=require(_0x71b2('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x22e912,_0xa9dac2,_0x100945){return new BPromise(function(_0xc4de6b,_0x4dc169){return client[_0x71b2('0x8')](_0x22e912,_0x100945)['then'](function(_0x5a7a07){logger[_0x71b2('0x9')](_0x71b2('0xa'),_0xa9dac2,'request\x20sent');logger[_0x71b2('0xb')](_0x71b2('0xc'),_0xa9dac2,'request\x20sent',JSON[_0x71b2('0xd')](_0x5a7a07));if(_0x5a7a07[_0x71b2('0xe')]){if(_0x5a7a07['error'][_0x71b2('0xf')]===0x1f4){logger[_0x71b2('0xe')]('SquareReport,\x20%s,\x20%s',_0xa9dac2,_0x5a7a07[_0x71b2('0xe')][_0x71b2('0x10')]);return _0x4dc169(_0x5a7a07['error'][_0x71b2('0x10')]);}logger[_0x71b2('0xe')](_0x71b2('0xa'),_0xa9dac2,_0x5a7a07[_0x71b2('0xe')]['message']);return _0xc4de6b(_0x5a7a07['error'][_0x71b2('0x10')]);}else{logger[_0x71b2('0x9')](_0x71b2('0xa'),_0xa9dac2,'request\x20sent');_0xc4de6b(_0x5a7a07['result']['message']);}})['catch'](function(_0x575719){logger[_0x71b2('0xe')](_0x71b2('0xa'),_0xa9dac2,_0x575719);_0x4dc169(_0x575719);});});}exports[_0x71b2('0x11')]=function(_0x3b4bd0){var _0x3e906f=this;return new Promise(function(_0x50dc52,_0x3e2568){return db[_0x71b2('0x12')][_0x71b2('0x13')](_0x3b4bd0[_0x71b2('0x14')],{'raw':_0x3b4bd0[_0x71b2('0x15')]?_0x3b4bd0[_0x71b2('0x15')][_0x71b2('0x16')]===undefined?!![]:![]:!![]})[_0x71b2('0x17')](function(_0x629550){logger[_0x71b2('0x9')](_0x71b2('0x11'),_0x3b4bd0);logger['debug']('CreateSquareReport',_0x3b4bd0,JSON[_0x71b2('0xd')](_0x629550));_0x50dc52(_0x629550);})[_0x71b2('0x18')](function(_0x5c971d){logger['error']('CreateSquareReport',_0x5c971d[_0x71b2('0x10')],_0x3b4bd0);_0x3e2568(_0x3e906f[_0x71b2('0xe')](0x1f4,_0x5c971d[_0x71b2('0x10')]));});});};exports[_0x71b2('0x19')]=function(_0x20efb3){var _0x12f56f=this;return new Promise(function(_0x26de16,_0x530cff){return db['SquareReport']['update'](_0x20efb3[_0x71b2('0x14')],{'raw':_0x20efb3[_0x71b2('0x15')]?_0x20efb3[_0x71b2('0x15')][_0x71b2('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20efb3[_0x71b2('0x15')]?_0x20efb3[_0x71b2('0x15')][_0x71b2('0x1a')]||null:null,'attributes':_0x20efb3[_0x71b2('0x15')]?_0x20efb3[_0x71b2('0x15')]['attributes']||null:null,'limit':_0x20efb3['options']?_0x20efb3[_0x71b2('0x15')][_0x71b2('0x1b')]||null:null})[_0x71b2('0x17')](function(_0x32f3da){logger[_0x71b2('0x9')](_0x71b2('0x19'),_0x20efb3);logger[_0x71b2('0xb')](_0x71b2('0x19'),_0x20efb3,JSON[_0x71b2('0xd')](_0x32f3da));_0x26de16(_0x32f3da);})[_0x71b2('0x18')](function(_0x159763){logger[_0x71b2('0xe')](_0x71b2('0x19'),_0x159763[_0x71b2('0x10')],_0x20efb3);_0x530cff(_0x12f56f[_0x71b2('0xe')](0x1f4,_0x159763[_0x71b2('0x10')]));});});}; \ No newline at end of file +var _0xbf69=['debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','SquareReport','create','body','options','raw','catch','UpdateSquareReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','SquareReport,\x20%s,\x20%s','request\x20sent'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xbf69,0x78));var _0x9bf6=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0xbf69[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x9bf6('0x0'));var util=require(_0x9bf6('0x1'));var moment=require(_0x9bf6('0x2'));var BPromise=require(_0x9bf6('0x3'));var rs=require(_0x9bf6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9bf6('0x5'))['db'];var utils=require(_0x9bf6('0x6'));var logger=require('../../config/logger')(_0x9bf6('0x7'));var config=require('../../config/environment');var jayson=require(_0x9bf6('0x8'));var client=jayson[_0x9bf6('0x9')][_0x9bf6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38e310,_0xe3f075,_0x187090){return new BPromise(function(_0x1c6041,_0x24df54){return client[_0x9bf6('0xb')](_0x38e310,_0x187090)[_0x9bf6('0xc')](function(_0x44fbb1){logger[_0x9bf6('0xd')](_0x9bf6('0xe'),_0xe3f075,_0x9bf6('0xf'));logger[_0x9bf6('0x10')](_0x9bf6('0x11'),_0xe3f075,'request\x20sent',JSON[_0x9bf6('0x12')](_0x44fbb1));if(_0x44fbb1[_0x9bf6('0x13')]){if(_0x44fbb1[_0x9bf6('0x13')][_0x9bf6('0x14')]===0x1f4){logger['error'](_0x9bf6('0xe'),_0xe3f075,_0x44fbb1['error']['message']);return _0x24df54(_0x44fbb1[_0x9bf6('0x13')][_0x9bf6('0x15')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0xe3f075,_0x44fbb1[_0x9bf6('0x13')][_0x9bf6('0x15')]);return _0x1c6041(_0x44fbb1[_0x9bf6('0x13')][_0x9bf6('0x15')]);}else{logger[_0x9bf6('0xd')](_0x9bf6('0xe'),_0xe3f075,'request\x20sent');_0x1c6041(_0x44fbb1[_0x9bf6('0x16')][_0x9bf6('0x15')]);}})['catch'](function(_0x435da3){logger[_0x9bf6('0x13')]('SquareReport,\x20%s,\x20%s',_0xe3f075,_0x435da3);_0x24df54(_0x435da3);});});}exports['CreateSquareReport']=function(_0x52553e){var _0x6bbb65=this;return new Promise(function(_0x30a044,_0x8db428){return db[_0x9bf6('0x17')][_0x9bf6('0x18')](_0x52553e[_0x9bf6('0x19')],{'raw':_0x52553e['options']?_0x52553e[_0x9bf6('0x1a')][_0x9bf6('0x1b')]===undefined?!![]:![]:!![]})[_0x9bf6('0xc')](function(_0x721de8){logger[_0x9bf6('0xd')]('CreateSquareReport',_0x52553e);logger[_0x9bf6('0x10')]('CreateSquareReport',_0x52553e,JSON[_0x9bf6('0x12')](_0x721de8));_0x30a044(_0x721de8);})[_0x9bf6('0x1c')](function(_0x466db0){logger[_0x9bf6('0x13')]('CreateSquareReport',_0x466db0[_0x9bf6('0x15')],_0x52553e);_0x8db428(_0x6bbb65[_0x9bf6('0x13')](0x1f4,_0x466db0[_0x9bf6('0x15')]));});});};exports[_0x9bf6('0x1d')]=function(_0x53dc11){var _0x5c9377=this;return new Promise(function(_0x6d04c6,_0x2cacc8){return db['SquareReport'][_0x9bf6('0x1e')](_0x53dc11[_0x9bf6('0x19')],{'raw':_0x53dc11[_0x9bf6('0x1a')]?_0x53dc11[_0x9bf6('0x1a')][_0x9bf6('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53dc11[_0x9bf6('0x1a')]?_0x53dc11[_0x9bf6('0x1a')][_0x9bf6('0x1f')]||null:null,'attributes':_0x53dc11[_0x9bf6('0x1a')]?_0x53dc11['options'][_0x9bf6('0x20')]||null:null,'limit':_0x53dc11['options']?_0x53dc11['options'][_0x9bf6('0x21')]||null:null})[_0x9bf6('0xc')](function(_0x165765){logger['info'](_0x9bf6('0x1d'),_0x53dc11);logger['debug'](_0x9bf6('0x1d'),_0x53dc11,JSON['stringify'](_0x165765));_0x6d04c6(_0x165765);})[_0x9bf6('0x1c')](function(_0x4bbcd3){logger['error'](_0x9bf6('0x1d'),_0x4bbcd3[_0x9bf6('0x15')],_0x53dc11);_0x2cacc8(_0x5c9377[_0x9bf6('0x13')](0x1f4,_0x4bbcd3['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index a9bb203..551a3c5 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 _0x66d3=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util'];(function(_0x4e8c42,_0x36dc88){var _0x22952f=function(_0x31a013){while(--_0x31a013){_0x4e8c42['push'](_0x4e8c42['shift']());}};_0x22952f(++_0x36dc88);}(_0x66d3,0x106));var _0x366d=function(_0x43d31b,_0x1f6c4c){_0x43d31b=_0x43d31b-0x0;var _0x3b7e15=_0x66d3[_0x43d31b];return _0x3b7e15;};'use strict';var multer=require(_0x366d('0x0'));var util=require(_0x366d('0x1'));var path=require(_0x366d('0x2'));var timeout=require('connect-timeout');var express=require(_0x366d('0x3'));var router=express[_0x366d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x366d('0x5'));var interaction=require(_0x366d('0x6'));var config=require(_0x366d('0x7'));var controller=require(_0x366d('0x8'));router[_0x366d('0x9')]('/',auth['isAuthenticated'](),controller[_0x366d('0xa')]);router[_0x366d('0x9')](_0x366d('0xb'),auth[_0x366d('0xc')](),controller[_0x366d('0xd')]);router[_0x366d('0x9')](_0x366d('0xe'),auth[_0x366d('0xc')](),controller[_0x366d('0xf')]);router[_0x366d('0x10')]('/',auth[_0x366d('0xc')](),controller[_0x366d('0x11')]);router['put']('/:id',auth[_0x366d('0xc')](),controller[_0x366d('0x12')]);router[_0x366d('0x13')](_0x366d('0xe'),auth[_0x366d('0xc')](),controller[_0x366d('0x14')]);module[_0x366d('0x15')]=router; \ No newline at end of file +var _0x5bdf=['../../config/environment','/describe','isAuthenticated','describe','get','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x219632,_0x476c58){var _0x192b37=function(_0x53fa1){while(--_0x53fa1){_0x219632['push'](_0x219632['shift']());}};_0x192b37(++_0x476c58);}(_0x5bdf,0x91));var _0xf5bd=function(_0x38befb,_0x416a0a){_0x38befb=_0x38befb-0x0;var _0x35909f=_0x5bdf[_0x38befb];return _0x35909f;};'use strict';var multer=require(_0xf5bd('0x0'));var util=require(_0xf5bd('0x1'));var path=require(_0xf5bd('0x2'));var timeout=require(_0xf5bd('0x3'));var express=require(_0xf5bd('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf5bd('0x5'));var interaction=require(_0xf5bd('0x6'));var config=require(_0xf5bd('0x7'));var controller=require('./squareReportDetail.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xf5bd('0x8'),auth[_0xf5bd('0x9')](),controller[_0xf5bd('0xa')]);router[_0xf5bd('0xb')](_0xf5bd('0xc'),auth[_0xf5bd('0x9')](),controller[_0xf5bd('0xd')]);router[_0xf5bd('0xe')]('/',auth[_0xf5bd('0x9')](),controller[_0xf5bd('0xf')]);router[_0xf5bd('0x10')]('/:id',auth[_0xf5bd('0x9')](),controller['update']);router[_0xf5bd('0x11')](_0xf5bd('0xc'),auth[_0xf5bd('0x9')](),controller[_0xf5bd('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 1a08011..7f44202 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 _0x4b23=['STRING','TEXT','sequelize'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0x4b23,0xb6));var _0x34b2=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0x4b23[_0x2d61b2];return _0x12df89;};'use strict';var Sequelize=require(_0x34b2('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x34b2('0x1')]},'node':{'type':Sequelize[_0x34b2('0x1')]},'application':{'type':Sequelize[_0x34b2('0x1')]},'data':{'type':Sequelize[_0x34b2('0x2')]},'project_name':{'type':Sequelize[_0x34b2('0x1')]},'callerid':{'type':Sequelize[_0x34b2('0x1')]}}; \ No newline at end of file +var _0xac5f=['TEXT','sequelize','exports','STRING'];(function(_0x1cd4d5,_0x40bd09){var _0x348028=function(_0x10ffb3){while(--_0x10ffb3){_0x1cd4d5['push'](_0x1cd4d5['shift']());}};_0x348028(++_0x40bd09);}(_0xac5f,0x1e5));var _0xfac5=function(_0x387618,_0x53767b){_0x387618=_0x387618-0x0;var _0x3a1b2e=_0xac5f[_0x387618];return _0x3a1b2e;};'use strict';var Sequelize=require(_0xfac5('0x0'));module[_0xfac5('0x1')]={'uniqueid':{'type':Sequelize[_0xfac5('0x2')]},'node':{'type':Sequelize[_0xfac5('0x2')]},'application':{'type':Sequelize[_0xfac5('0x2')]},'data':{'type':Sequelize[_0xfac5('0x3')]},'project_name':{'type':Sequelize[_0xfac5('0x2')]},'callerid':{'type':Sequelize[_0xfac5('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 6992346..a3e02b6 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 _0x52de=['limit','count','offset','set','Content-Range','apply','save','destroy','error','stack','name','send','map','SquareDetailsReport','rawAttributes','fieldName','type','model','keys','intersection','attributes','fields','query','length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined'];(function(_0x51b14d,_0x2d7ac5){var _0x3af577=function(_0x4ef060){while(--_0x4ef060){_0x51b14d['push'](_0x51b14d['shift']());}};_0x3af577(++_0x2d7ac5);}(_0x52de,0x119));var _0xe52d=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x52de[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0xe52d('0x0'));var rimraf=require(_0xe52d('0x1'));var zipdir=require(_0xe52d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe52d('0x3'));var moment=require(_0xe52d('0x4'));var BPromise=require(_0xe52d('0x5'));var Mustache=require(_0xe52d('0x6'));var util=require('util');var path=require(_0xe52d('0x7'));var sox=require(_0xe52d('0x8'));var csv=require('to-csv');var ejs=require(_0xe52d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe52d('0xa'));var squel=require(_0xe52d('0xb'));var crypto=require(_0xe52d('0xc'));var jsforce=require(_0xe52d('0xd'));var deskjs=require(_0xe52d('0xe'));var toCsv=require(_0xe52d('0xf'));var querystring=require(_0xe52d('0x10'));var Papa=require(_0xe52d('0x11'));var Redis=require('ioredis');var authService=require(_0xe52d('0x12'));var qs=require(_0xe52d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe52d('0x14'));var logger=require(_0xe52d('0x15'))(_0xe52d('0x16'));var utils=require(_0xe52d('0x17'));var config=require(_0xe52d('0x18'));var licenseUtil=require(_0xe52d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49a7f0,_0x107688){_0x107688=_0x107688||0xcc;return function(_0x192de5){if(_0x192de5){return _0x49a7f0[_0xe52d('0x1a')](_0x107688);}return _0x49a7f0[_0xe52d('0x1b')](_0x107688)[_0xe52d('0x1c')]();};}function respondWithResult(_0x2468ea,_0x407cd4){_0x407cd4=_0x407cd4||0xc8;return function(_0x23020b){if(_0x23020b){return _0x2468ea[_0xe52d('0x1b')](_0x407cd4)[_0xe52d('0x1d')](_0x23020b);}};}function respondWithFilteredResult(_0x4c8a6c,_0x12c009){return function(_0x19346d){if(_0x19346d){var _0x2148b1=typeof _0x12c009['offset']===_0xe52d('0x1e')&&typeof _0x12c009[_0xe52d('0x1f')]===_0xe52d('0x1e');var _0x9a12b7=_0x19346d[_0xe52d('0x20')];var _0x6f28d9=_0x2148b1?0x0:_0x12c009[_0xe52d('0x21')];var _0x3c7d7e=_0x2148b1?_0x19346d[_0xe52d('0x20')]:_0x12c009[_0xe52d('0x21')]+_0x12c009[_0xe52d('0x1f')];var _0x50cc43;if(_0x3c7d7e>=_0x9a12b7){_0x3c7d7e=_0x9a12b7;_0x50cc43=0xc8;}else{_0x50cc43=0xce;}_0x4c8a6c[_0xe52d('0x1b')](_0x50cc43);return _0x4c8a6c[_0xe52d('0x22')](_0xe52d('0x23'),_0x6f28d9+'-'+_0x3c7d7e+'/'+_0x9a12b7)[_0xe52d('0x1d')](_0x19346d);}return null;};}function patchUpdates(_0x15e278){return function(_0x33a816){try{jsonpatch[_0xe52d('0x24')](_0x33a816,_0x15e278,!![]);}catch(_0x12560c){return BPromise['reject'](_0x12560c);}return _0x33a816[_0xe52d('0x25')]();};}function saveUpdates(_0x1aef7c,_0x4e581d){return function(_0x257a18){if(_0x257a18){return _0x257a18['update'](_0x1aef7c)['then'](function(_0xc67ef7){return _0xc67ef7;});}return null;};}function removeEntity(_0x28752a,_0x123097){return function(_0x5c5625){if(_0x5c5625){return _0x5c5625[_0xe52d('0x26')]()['then'](function(){_0x28752a[_0xe52d('0x1b')](0xcc)[_0xe52d('0x1c')]();});}};}function handleEntityNotFound(_0x53fbac,_0x1ab7f0){return function(_0x3636dc){if(!_0x3636dc){_0x53fbac[_0xe52d('0x1a')](0x194);}return _0x3636dc;};}function handleError(_0x448ea4,_0x3d24cc){_0x3d24cc=_0x3d24cc||0x1f4;return function(_0x15d356){logger[_0xe52d('0x27')](_0x15d356[_0xe52d('0x28')]);if(_0x15d356['name']){delete _0x15d356[_0xe52d('0x29')];}_0x448ea4[_0xe52d('0x1b')](_0x3d24cc)[_0xe52d('0x2a')](_0x15d356);};}exports['index']=function(_0x3ebffa,_0x3110cd){var _0x705b82={},_0x3329e0={},_0x37a5ec={'count':0x0,'rows':[]};var _0x454573=_[_0xe52d('0x2b')](db[_0xe52d('0x2c')][_0xe52d('0x2d')],function(_0x5e8ee8){return{'name':_0x5e8ee8[_0xe52d('0x2e')],'type':_0x5e8ee8[_0xe52d('0x2f')]['key']};});_0x3329e0[_0xe52d('0x30')]=_['map'](_0x454573,_0xe52d('0x29'));_0x3329e0['query']=_[_0xe52d('0x31')](_0x3ebffa['query']);_0x3329e0['filters']=_[_0xe52d('0x32')](_0x3329e0[_0xe52d('0x30')],_0x3329e0['query']);_0x705b82[_0xe52d('0x33')]=_[_0xe52d('0x32')](_0x3329e0[_0xe52d('0x30')],qs[_0xe52d('0x34')](_0x3ebffa[_0xe52d('0x35')]['fields']));_0x705b82['attributes']=_0x705b82[_0xe52d('0x33')][_0xe52d('0x36')]?_0x705b82[_0xe52d('0x33')]:_0x3329e0[_0xe52d('0x30')];if(!_0x3ebffa['query'][_0xe52d('0x37')]('nolimit')){_0x705b82[_0xe52d('0x1f')]=qs[_0xe52d('0x1f')](_0x3ebffa[_0xe52d('0x35')][_0xe52d('0x1f')]);_0x705b82[_0xe52d('0x21')]=qs[_0xe52d('0x21')](_0x3ebffa['query']['offset']);}_0x705b82[_0xe52d('0x38')]=qs[_0xe52d('0x39')](_0x3ebffa[_0xe52d('0x35')][_0xe52d('0x39')]);_0x705b82[_0xe52d('0x3a')]=qs['filters'](_[_0xe52d('0x3b')](_0x3ebffa[_0xe52d('0x35')],_0x3329e0[_0xe52d('0x3c')]),_0x454573);if(_0x3ebffa['query'][_0xe52d('0x3d')]){_0x705b82[_0xe52d('0x3a')]=_[_0xe52d('0x3e')](_0x705b82[_0xe52d('0x3a')],{'$or':_[_0xe52d('0x2b')](_0x454573,function(_0x784d7f){if(_0x784d7f[_0xe52d('0x2f')]!==_0xe52d('0x3f')){var _0x23842f={};_0x23842f[_0x784d7f['name']]={'$like':'%'+_0x3ebffa[_0xe52d('0x35')][_0xe52d('0x3d')]+'%'};return _0x23842f;}})});}_0x705b82=_[_0xe52d('0x3e')]({},_0x705b82,_0x3ebffa[_0xe52d('0x40')]);var _0x3f2c93={'where':_0x705b82[_0xe52d('0x3a')]};return db[_0xe52d('0x2c')][_0xe52d('0x20')](_0x3f2c93)[_0xe52d('0x41')](function(_0x44ad2e){_0x37a5ec[_0xe52d('0x20')]=_0x44ad2e;if(_0x3ebffa['query'][_0xe52d('0x42')]){_0x705b82[_0xe52d('0x43')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0xe52d('0x44')](_0x705b82);})['then'](function(_0x1ef696){_0x37a5ec[_0xe52d('0x45')]=_0x1ef696;return _0x37a5ec;})[_0xe52d('0x41')](respondWithFilteredResult(_0x3110cd,_0x705b82))[_0xe52d('0x46')](handleError(_0x3110cd,null));};exports[_0xe52d('0x47')]=function(_0x492247,_0x47319a){var _0x344dc8={'raw':!![],'where':{'id':_0x492247[_0xe52d('0x48')]['id']}},_0x44068c={};_0x44068c['model']=_['keys'](db['SquareDetailsReport'][_0xe52d('0x2d')]);_0x44068c[_0xe52d('0x35')]=_[_0xe52d('0x31')](_0x492247[_0xe52d('0x35')]);_0x44068c[_0xe52d('0x3c')]=_[_0xe52d('0x32')](_0x44068c[_0xe52d('0x30')],_0x44068c['query']);_0x344dc8['attributes']=_[_0xe52d('0x32')](_0x44068c[_0xe52d('0x30')],qs[_0xe52d('0x34')](_0x492247['query'][_0xe52d('0x34')]));_0x344dc8[_0xe52d('0x33')]=_0x344dc8[_0xe52d('0x33')][_0xe52d('0x36')]?_0x344dc8[_0xe52d('0x33')]:_0x44068c['model'];if(_0x492247[_0xe52d('0x35')]['includeAll']){_0x344dc8['include']=[{'all':!![]}];}_0x344dc8=_[_0xe52d('0x3e')]({},_0x344dc8,_0x492247[_0xe52d('0x40')]);return db['SquareDetailsReport'][_0xe52d('0x49')](_0x344dc8)[_0xe52d('0x41')](handleEntityNotFound(_0x47319a,null))[_0xe52d('0x41')](respondWithResult(_0x47319a,null))[_0xe52d('0x46')](handleError(_0x47319a,null));};exports[_0xe52d('0x4a')]=function(_0x149321,_0x73a082){return db[_0xe52d('0x2c')][_0xe52d('0x4a')](_0x149321[_0xe52d('0x4b')],{})[_0xe52d('0x41')](respondWithResult(_0x73a082,0xc9))[_0xe52d('0x46')](handleError(_0x73a082,null));};exports[_0xe52d('0x4c')]=function(_0x3b516d,_0x5818df){if(_0x3b516d[_0xe52d('0x4b')]['id']){delete _0x3b516d[_0xe52d('0x4b')]['id'];}return db['SquareDetailsReport']['find']({'where':{'id':_0x3b516d['params']['id']}})[_0xe52d('0x41')](handleEntityNotFound(_0x5818df,null))[_0xe52d('0x41')](saveUpdates(_0x3b516d[_0xe52d('0x4b')],null))[_0xe52d('0x41')](respondWithResult(_0x5818df,null))[_0xe52d('0x46')](handleError(_0x5818df,null));};exports[_0xe52d('0x26')]=function(_0x65601e,_0x3c2989){return db[_0xe52d('0x2c')][_0xe52d('0x49')]({'where':{'id':_0x65601e[_0xe52d('0x48')]['id']}})[_0xe52d('0x41')](handleEntityNotFound(_0x3c2989,null))['then'](removeEntity(_0x3c2989,null))[_0xe52d('0x46')](handleError(_0x3c2989,null));};exports[_0xe52d('0x4d')]=function(_0x27f04a,_0xd07cbc){return db[_0xe52d('0x2c')][_0xe52d('0x4d')]()['then'](respondWithResult(_0xd07cbc,null))[_0xe52d('0x46')](handleError(_0xd07cbc,null));}; \ No newline at end of file +var _0x0a45=['create','body','describe','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','destroy','end','stack','name','send','index','map','SquareDetailsReport','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','find'];(function(_0x539b55,_0x2688d0){var _0x25dd5c=function(_0x731aa0){while(--_0x731aa0){_0x539b55['push'](_0x539b55['shift']());}};_0x25dd5c(++_0x2688d0);}(_0x0a45,0x123));var _0x50a4=function(_0x112f93,_0x481a66){_0x112f93=_0x112f93-0x0;var _0x4ecb83=_0x0a45[_0x112f93];return _0x4ecb83;};'use strict';var emlformat=require(_0x50a4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x50a4('0x1'));var rp=require(_0x50a4('0x2'));var moment=require('moment');var BPromise=require(_0x50a4('0x3'));var Mustache=require(_0x50a4('0x4'));var util=require('util');var path=require(_0x50a4('0x5'));var sox=require(_0x50a4('0x6'));var csv=require(_0x50a4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x50a4('0x8'));var _=require('lodash');var squel=require(_0x50a4('0x9'));var crypto=require(_0x50a4('0xa'));var jsforce=require(_0x50a4('0xb'));var deskjs=require(_0x50a4('0xc'));var toCsv=require('to-csv');var querystring=require(_0x50a4('0xd'));var Papa=require(_0x50a4('0xe'));var Redis=require(_0x50a4('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x50a4('0x10'));var hardwareService=require(_0x50a4('0x11'));var logger=require('../../config/logger')(_0x50a4('0x12'));var utils=require(_0x50a4('0x13'));var config=require(_0x50a4('0x14'));var licenseUtil=require(_0x50a4('0x15'));var db=require(_0x50a4('0x16'))['db'];function respondWithStatusCode(_0x19147b,_0x29224e){_0x29224e=_0x29224e||0xcc;return function(_0x586fbf){if(_0x586fbf){return _0x19147b[_0x50a4('0x17')](_0x29224e);}return _0x19147b[_0x50a4('0x18')](_0x29224e)['end']();};}function respondWithResult(_0x30a3b1,_0x454270){_0x454270=_0x454270||0xc8;return function(_0x5c4b46){if(_0x5c4b46){return _0x30a3b1[_0x50a4('0x18')](_0x454270)[_0x50a4('0x19')](_0x5c4b46);}};}function respondWithFilteredResult(_0x19edf3,_0x2acba2){return function(_0x3e11d1){if(_0x3e11d1){var _0x5e8363=typeof _0x2acba2[_0x50a4('0x1a')]===_0x50a4('0x1b')&&typeof _0x2acba2[_0x50a4('0x1c')]===_0x50a4('0x1b');var _0x1ca7fe=_0x3e11d1[_0x50a4('0x1d')];var _0x59dadd=_0x5e8363?0x0:_0x2acba2[_0x50a4('0x1a')];var _0x30b803=_0x5e8363?_0x3e11d1[_0x50a4('0x1d')]:_0x2acba2['offset']+_0x2acba2[_0x50a4('0x1c')];var _0x3f33f3;if(_0x30b803>=_0x1ca7fe){_0x30b803=_0x1ca7fe;_0x3f33f3=0xc8;}else{_0x3f33f3=0xce;}_0x19edf3[_0x50a4('0x18')](_0x3f33f3);return _0x19edf3[_0x50a4('0x1e')]('Content-Range',_0x59dadd+'-'+_0x30b803+'/'+_0x1ca7fe)[_0x50a4('0x19')](_0x3e11d1);}return null;};}function patchUpdates(_0x5d3fd8){return function(_0x132659){try{jsonpatch['apply'](_0x132659,_0x5d3fd8,!![]);}catch(_0x859b16){return BPromise[_0x50a4('0x1f')](_0x859b16);}return _0x132659[_0x50a4('0x20')]();};}function saveUpdates(_0xcb416c,_0x4bf428){return function(_0x23d49e){if(_0x23d49e){return _0x23d49e[_0x50a4('0x21')](_0xcb416c)[_0x50a4('0x22')](function(_0x2024bf){return _0x2024bf;});}return null;};}function removeEntity(_0x16df0f,_0xd3d461){return function(_0xd49dda){if(_0xd49dda){return _0xd49dda[_0x50a4('0x23')]()[_0x50a4('0x22')](function(){_0x16df0f[_0x50a4('0x18')](0xcc)[_0x50a4('0x24')]();});}};}function handleEntityNotFound(_0x4977f4,_0x18a73c){return function(_0x3ade93){if(!_0x3ade93){_0x4977f4[_0x50a4('0x17')](0x194);}return _0x3ade93;};}function handleError(_0x45485e,_0x4131d3){_0x4131d3=_0x4131d3||0x1f4;return function(_0x55cefe){logger['error'](_0x55cefe[_0x50a4('0x25')]);if(_0x55cefe[_0x50a4('0x26')]){delete _0x55cefe[_0x50a4('0x26')];}_0x45485e[_0x50a4('0x18')](_0x4131d3)[_0x50a4('0x27')](_0x55cefe);};}exports[_0x50a4('0x28')]=function(_0x38ae55,_0x418281){var _0x2c53ab={},_0x46deb1={},_0x2b694d={'count':0x0,'rows':[]};var _0x3ae355=_[_0x50a4('0x29')](db[_0x50a4('0x2a')][_0x50a4('0x2b')],function(_0xcc8513){return{'name':_0xcc8513['fieldName'],'type':_0xcc8513[_0x50a4('0x2c')][_0x50a4('0x2d')]};});_0x46deb1['model']=_[_0x50a4('0x29')](_0x3ae355,_0x50a4('0x26'));_0x46deb1[_0x50a4('0x2e')]=_[_0x50a4('0x2f')](_0x38ae55[_0x50a4('0x2e')]);_0x46deb1[_0x50a4('0x30')]=_[_0x50a4('0x31')](_0x46deb1[_0x50a4('0x32')],_0x46deb1[_0x50a4('0x2e')]);_0x2c53ab[_0x50a4('0x33')]=_['intersection'](_0x46deb1[_0x50a4('0x32')],qs[_0x50a4('0x34')](_0x38ae55[_0x50a4('0x2e')]['fields']));_0x2c53ab[_0x50a4('0x33')]=_0x2c53ab[_0x50a4('0x33')][_0x50a4('0x35')]?_0x2c53ab[_0x50a4('0x33')]:_0x46deb1['model'];if(!_0x38ae55[_0x50a4('0x2e')][_0x50a4('0x36')]('nolimit')){_0x2c53ab['limit']=qs['limit'](_0x38ae55[_0x50a4('0x2e')][_0x50a4('0x1c')]);_0x2c53ab[_0x50a4('0x1a')]=qs[_0x50a4('0x1a')](_0x38ae55[_0x50a4('0x2e')][_0x50a4('0x1a')]);}_0x2c53ab['order']=qs[_0x50a4('0x37')](_0x38ae55[_0x50a4('0x2e')]['sort']);_0x2c53ab[_0x50a4('0x38')]=qs[_0x50a4('0x30')](_[_0x50a4('0x39')](_0x38ae55['query'],_0x46deb1[_0x50a4('0x30')]),_0x3ae355);if(_0x38ae55[_0x50a4('0x2e')][_0x50a4('0x3a')]){_0x2c53ab[_0x50a4('0x38')]=_[_0x50a4('0x3b')](_0x2c53ab['where'],{'$or':_[_0x50a4('0x29')](_0x3ae355,function(_0x1ba709){if(_0x1ba709[_0x50a4('0x2c')]!==_0x50a4('0x3c')){var _0x4ed79a={};_0x4ed79a[_0x1ba709[_0x50a4('0x26')]]={'$like':'%'+_0x38ae55[_0x50a4('0x2e')]['filter']+'%'};return _0x4ed79a;}})});}_0x2c53ab=_[_0x50a4('0x3b')]({},_0x2c53ab,_0x38ae55[_0x50a4('0x3d')]);var _0x35cb1d={'where':_0x2c53ab[_0x50a4('0x38')]};return db[_0x50a4('0x2a')][_0x50a4('0x1d')](_0x35cb1d)[_0x50a4('0x22')](function(_0x22ae6e){_0x2b694d[_0x50a4('0x1d')]=_0x22ae6e;if(_0x38ae55['query']['includeAll']){_0x2c53ab['include']=[{'all':!![]}];}return db['SquareDetailsReport'][_0x50a4('0x3e')](_0x2c53ab);})['then'](function(_0x2e1502){_0x2b694d[_0x50a4('0x3f')]=_0x2e1502;return _0x2b694d;})[_0x50a4('0x22')](respondWithFilteredResult(_0x418281,_0x2c53ab))[_0x50a4('0x40')](handleError(_0x418281,null));};exports[_0x50a4('0x41')]=function(_0x3dd7a1,_0x411038){var _0xa90b55={'raw':!![],'where':{'id':_0x3dd7a1[_0x50a4('0x42')]['id']}},_0x2ad470={};_0x2ad470[_0x50a4('0x32')]=_[_0x50a4('0x2f')](db['SquareDetailsReport']['rawAttributes']);_0x2ad470[_0x50a4('0x2e')]=_[_0x50a4('0x2f')](_0x3dd7a1[_0x50a4('0x2e')]);_0x2ad470[_0x50a4('0x30')]=_[_0x50a4('0x31')](_0x2ad470[_0x50a4('0x32')],_0x2ad470['query']);_0xa90b55[_0x50a4('0x33')]=_[_0x50a4('0x31')](_0x2ad470[_0x50a4('0x32')],qs[_0x50a4('0x34')](_0x3dd7a1[_0x50a4('0x2e')][_0x50a4('0x34')]));_0xa90b55[_0x50a4('0x33')]=_0xa90b55['attributes'][_0x50a4('0x35')]?_0xa90b55[_0x50a4('0x33')]:_0x2ad470[_0x50a4('0x32')];if(_0x3dd7a1[_0x50a4('0x2e')][_0x50a4('0x43')]){_0xa90b55['include']=[{'all':!![]}];}_0xa90b55=_[_0x50a4('0x3b')]({},_0xa90b55,_0x3dd7a1[_0x50a4('0x3d')]);return db[_0x50a4('0x2a')][_0x50a4('0x44')](_0xa90b55)[_0x50a4('0x22')](handleEntityNotFound(_0x411038,null))['then'](respondWithResult(_0x411038,null))[_0x50a4('0x40')](handleError(_0x411038,null));};exports[_0x50a4('0x45')]=function(_0x5d8429,_0x167845){return db[_0x50a4('0x2a')][_0x50a4('0x45')](_0x5d8429[_0x50a4('0x46')],{})['then'](respondWithResult(_0x167845,0xc9))[_0x50a4('0x40')](handleError(_0x167845,null));};exports[_0x50a4('0x21')]=function(_0x4a82e8,_0x31fb61){if(_0x4a82e8[_0x50a4('0x46')]['id']){delete _0x4a82e8[_0x50a4('0x46')]['id'];}return db[_0x50a4('0x2a')][_0x50a4('0x44')]({'where':{'id':_0x4a82e8['params']['id']}})[_0x50a4('0x22')](handleEntityNotFound(_0x31fb61,null))[_0x50a4('0x22')](saveUpdates(_0x4a82e8[_0x50a4('0x46')],null))['then'](respondWithResult(_0x31fb61,null))[_0x50a4('0x40')](handleError(_0x31fb61,null));};exports['destroy']=function(_0x21719b,_0xe29d22){return db[_0x50a4('0x2a')]['find']({'where':{'id':_0x21719b['params']['id']}})[_0x50a4('0x22')](handleEntityNotFound(_0xe29d22,null))['then'](removeEntity(_0xe29d22,null))['catch'](handleError(_0xe29d22,null));};exports[_0x50a4('0x47')]=function(_0x2e3e0b,_0x58a3bc){return db[_0x50a4('0x2a')][_0x50a4('0x47')]()[_0x50a4('0x22')](respondWithResult(_0x58a3bc,null))[_0x50a4('0x40')](handleError(_0x58a3bc,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 94e1071..bb8dc79 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 _0xff9d=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','lodash','util'];(function(_0x100f34,_0x15422f){var _0x422458=function(_0x2596cf){while(--_0x2596cf){_0x100f34['push'](_0x100f34['shift']());}};_0x422458(++_0x15422f);}(_0xff9d,0x11c));var _0xdff9=function(_0x419fff,_0x2827cd){_0x419fff=_0x419fff-0x0;var _0x57bb43=_0xff9d[_0x419fff];return _0x57bb43;};'use strict';var _=require(_0xdff9('0x0'));var util=require(_0xdff9('0x1'));var logger=require(_0xdff9('0x2'))(_0xdff9('0x3'));var moment=require(_0xdff9('0x4'));var BPromise=require(_0xdff9('0x5'));var rp=require(_0xdff9('0x6'));var fs=require('fs');var path=require(_0xdff9('0x7'));var rimraf=require('rimraf');var config=require(_0xdff9('0x8'));var attributes=require(_0xdff9('0x9'));module[_0xdff9('0xa')]=function(_0x400d59,_0x39f13b){return _0x400d59['define'](_0xdff9('0xb'),attributes,{'tableName':_0xdff9('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8fbe=['util','../../config/logger','bluebird','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash'];(function(_0x3d487e,_0x4f1340){var _0x5771a3=function(_0x10f2f5){while(--_0x10f2f5){_0x3d487e['push'](_0x3d487e['shift']());}};_0x5771a3(++_0x4f1340);}(_0x8fbe,0x173));var _0xe8fb=function(_0x2a6895,_0x29b01f){_0x2a6895=_0x2a6895-0x0;var _0x532f2e=_0x8fbe[_0x2a6895];return _0x532f2e;};'use strict';var _=require(_0xe8fb('0x0'));var util=require(_0xe8fb('0x1'));var logger=require(_0xe8fb('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe8fb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe8fb('0x4'));var rimraf=require(_0xe8fb('0x5'));var config=require(_0xe8fb('0x6'));var attributes=require(_0xe8fb('0x7'));module[_0xe8fb('0x8')]=function(_0x47d5e0,_0x1fd1fc){return _0x47d5e0[_0xe8fb('0x9')](_0xe8fb('0xa'),attributes,{'tableName':_0xe8fb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 9b09152..2dc6d1b 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 _0xfef3=['../../config/environment','jayson/promise','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateSquareDetailsReport','SquareDetailsReport','body','options','raw','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x4246bd,_0xdab764){var _0x20e0b7=function(_0x402785){while(--_0x402785){_0x4246bd['push'](_0x4246bd['shift']());}};_0x20e0b7(++_0xdab764);}(_0xfef3,0x118));var _0x3fef=function(_0x3aa48e,_0x22eb8d){_0x3aa48e=_0x3aa48e-0x0;var _0x26f857=_0xfef3[_0x3aa48e];return _0x26f857;};'use strict';var _=require(_0x3fef('0x0'));var util=require('util');var moment=require(_0x3fef('0x1'));var BPromise=require('bluebird');var rs=require(_0x3fef('0x2'));var fs=require('fs');var Redis=require(_0x3fef('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3fef('0x4'));var logger=require(_0x3fef('0x5'))('rpc');var config=require(_0x3fef('0x6'));var jayson=require(_0x3fef('0x7'));var client=jayson['client'][_0x3fef('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5f5b72,_0x800850,_0x33e00a){return new BPromise(function(_0x1fffc5,_0x41960c){return client[_0x3fef('0x9')](_0x5f5b72,_0x33e00a)[_0x3fef('0xa')](function(_0x31c30f){logger[_0x3fef('0xb')](_0x3fef('0xc'),_0x800850,_0x3fef('0xd'));logger[_0x3fef('0xe')](_0x3fef('0xf'),_0x800850,'request\x20sent',JSON[_0x3fef('0x10')](_0x31c30f));if(_0x31c30f[_0x3fef('0x11')]){if(_0x31c30f[_0x3fef('0x11')]['code']===0x1f4){logger[_0x3fef('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x800850,_0x31c30f[_0x3fef('0x11')][_0x3fef('0x12')]);return _0x41960c(_0x31c30f[_0x3fef('0x11')]['message']);}logger[_0x3fef('0x11')]('SquareDetailsReport,\x20%s,\x20%s',_0x800850,_0x31c30f[_0x3fef('0x11')][_0x3fef('0x12')]);return _0x1fffc5(_0x31c30f['error'][_0x3fef('0x12')]);}else{logger[_0x3fef('0xb')](_0x3fef('0xc'),_0x800850,_0x3fef('0xd'));_0x1fffc5(_0x31c30f[_0x3fef('0x13')][_0x3fef('0x12')]);}})['catch'](function(_0x1cbdbb){logger[_0x3fef('0x11')](_0x3fef('0xc'),_0x800850,_0x1cbdbb);_0x41960c(_0x1cbdbb);});});}exports[_0x3fef('0x14')]=function(_0x1613ad){var _0xaa0ae3=this;return new Promise(function(_0x53d993,_0x36669d){return db[_0x3fef('0x15')]['create'](_0x1613ad[_0x3fef('0x16')],{'raw':_0x1613ad[_0x3fef('0x17')]?_0x1613ad[_0x3fef('0x17')][_0x3fef('0x18')]===undefined?!![]:![]:!![]})[_0x3fef('0xa')](function(_0x2b5226){logger[_0x3fef('0xb')](_0x3fef('0x14'),_0x1613ad);logger[_0x3fef('0xe')](_0x3fef('0x14'),_0x1613ad,JSON[_0x3fef('0x10')](_0x2b5226));_0x53d993(_0x2b5226);})[_0x3fef('0x19')](function(_0x2eb578){logger[_0x3fef('0x11')](_0x3fef('0x14'),_0x2eb578['message'],_0x1613ad);_0x36669d(_0xaa0ae3['error'](0x1f4,_0x2eb578['message']));});});}; \ No newline at end of file +var _0x937d=['CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','debug','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareDetailsReport,\x20%s,\x20%s','result','catch'];(function(_0x21ab76,_0x1e8f2){var _0x12322a=function(_0x214872){while(--_0x214872){_0x21ab76['push'](_0x21ab76['shift']());}};_0x12322a(++_0x1e8f2);}(_0x937d,0x1f4));var _0xd937=function(_0x3b872b,_0x2bb6c5){_0x3b872b=_0x3b872b-0x0;var _0x214ec9=_0x937d[_0x3b872b];return _0x214ec9;};'use strict';var _=require(_0xd937('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd937('0x1'));var fs=require('fs');var Redis=require(_0xd937('0x2'));var db=require(_0xd937('0x3'))['db'];var utils=require(_0xd937('0x4'));var logger=require(_0xd937('0x5'))(_0xd937('0x6'));var config=require('../../config/environment');var jayson=require(_0xd937('0x7'));var client=jayson[_0xd937('0x8')][_0xd937('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f6cd9,_0x2454f9,_0x4dc790){return new BPromise(function(_0x490b1d,_0x372dff){return client[_0xd937('0xa')](_0x4f6cd9,_0x4dc790)[_0xd937('0xb')](function(_0xa97338){logger[_0xd937('0xc')]('SquareDetailsReport,\x20%s,\x20%s',_0x2454f9,_0xd937('0xd'));logger['debug'](_0xd937('0xe'),_0x2454f9,'request\x20sent',JSON[_0xd937('0xf')](_0xa97338));if(_0xa97338[_0xd937('0x10')]){if(_0xa97338[_0xd937('0x10')][_0xd937('0x11')]===0x1f4){logger[_0xd937('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x2454f9,_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);return _0x372dff(_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);}logger[_0xd937('0x10')](_0xd937('0x13'),_0x2454f9,_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);return _0x490b1d(_0xa97338[_0xd937('0x10')][_0xd937('0x12')]);}else{logger['info'](_0xd937('0x13'),_0x2454f9,_0xd937('0xd'));_0x490b1d(_0xa97338[_0xd937('0x14')]['message']);}})[_0xd937('0x15')](function(_0x16d2ba){logger[_0xd937('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x2454f9,_0x16d2ba);_0x372dff(_0x16d2ba);});});}exports[_0xd937('0x16')]=function(_0x3d6b1c){var _0x1d1b8b=this;return new Promise(function(_0x1bd7ee,_0x26d5ca){return db[_0xd937('0x17')][_0xd937('0x18')](_0x3d6b1c[_0xd937('0x19')],{'raw':_0x3d6b1c[_0xd937('0x1a')]?_0x3d6b1c[_0xd937('0x1a')][_0xd937('0x1b')]===undefined?!![]:![]:!![]})[_0xd937('0xb')](function(_0x2c18ea){logger[_0xd937('0xc')](_0xd937('0x16'),_0x3d6b1c);logger[_0xd937('0x1c')](_0xd937('0x16'),_0x3d6b1c,JSON['stringify'](_0x2c18ea));_0x1bd7ee(_0x2c18ea);})[_0xd937('0x15')](function(_0x168f3e){logger[_0xd937('0x10')](_0xd937('0x16'),_0x168f3e[_0xd937('0x12')],_0x3d6b1c);_0x26d5ca(_0x1d1b8b[_0xd937('0x10')](0x1f4,_0x168f3e[_0xd937('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index 505d342..49f5324 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 _0x3e44=['index','/process/:pid/kill','exports','express','Router','get','isAuthenticated'];(function(_0x4e349e,_0x92589f){var _0x20abd3=function(_0x29837f){while(--_0x29837f){_0x4e349e['push'](_0x4e349e['shift']());}};_0x20abd3(++_0x92589f);}(_0x3e44,0x6c));var _0x43e4=function(_0x362bed,_0x40d4c3){_0x362bed=_0x362bed-0x0;var _0x197fd6=_0x3e44[_0x362bed];return _0x197fd6;};'use strict';var express=require(_0x43e4('0x0'));var router=express[_0x43e4('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0x43e4('0x2')]('/',auth[_0x43e4('0x3')](),controller[_0x43e4('0x4')]);router[_0x43e4('0x2')](_0x43e4('0x5'),auth[_0x43e4('0x3')](),controller['killProcess']);module[_0x43e4('0x6')]=router; \ No newline at end of file +var _0xc39b=['express','Router','../../components/auth/service','./system.controller','isAuthenticated','get','/process/:pid/kill','killProcess','exports'];(function(_0x22b1a3,_0x3b3f34){var _0x3bc6b4=function(_0x5a6ef8){while(--_0x5a6ef8){_0x22b1a3['push'](_0x22b1a3['shift']());}};_0x3bc6b4(++_0x3b3f34);}(_0xc39b,0x10e));var _0xbc39=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0xc39b[_0xbf8ebe];return _0x1e25e8;};'use strict';var express=require(_0xbc39('0x0'));var router=express[_0xbc39('0x1')]();var auth=require(_0xbc39('0x2'));var controller=require(_0xbc39('0x3'));router['get']('/',auth[_0xbc39('0x4')](),controller['index']);router[_0xbc39('0x5')](_0xbc39('0x6'),auth[_0xbc39('0x4')](),controller[_0xbc39('0x7')]);module[_0xbc39('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index f140a15..8e48a8f 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 _0xdd40=['catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','send','index','getAllData','status','json'];(function(_0x2a0a56,_0x209e23){var _0x3b959e=function(_0x91be9d){while(--_0x91be9d){_0x2a0a56['push'](_0x2a0a56['shift']());}};_0x3b959e(++_0x209e23);}(_0xdd40,0x151));var _0x0dd4=function(_0xa9e64b,_0x4701f4){_0xa9e64b=_0xa9e64b-0x0;var _0x389dc9=_0xdd40[_0xa9e64b];return _0x389dc9;};'use strict';var info=require(_0x0dd4('0x0'));var exec=require(_0x0dd4('0x1'))[_0x0dd4('0x2')];var logger=require(_0x0dd4('0x3'))(_0x0dd4('0x4'));var util=require('util');var BPromise=require('bluebird');var _=require(_0x0dd4('0x5'));function handleError(_0x109c7e,_0x44cfc0,_0x73c505){_0x44cfc0=_0x44cfc0||0x1f4;return function(_0x40c72c){logger[_0x0dd4('0x6')](_0x0dd4('0x7'),_0x73c505,_0x44cfc0,util[_0x0dd4('0x8')](_0x40c72c,{'showHidden':![],'depth':null}));delete _0x40c72c['name'];_0x109c7e['status'](_0x44cfc0)[_0x0dd4('0x9')](_0x40c72c);};}exports[_0x0dd4('0xa')]=function(_0x5d1d68,_0x20a518){return info[_0x0dd4('0xb')]()['then'](function(_0x4b2b3a){return _0x20a518[_0x0dd4('0xc')](0xc8)[_0x0dd4('0xd')](_0x4b2b3a);})[_0x0dd4('0xe')](function(_0x3e54a4){return _0x20a518[_0x0dd4('0xc')](0x1f4)[_0x0dd4('0xd')](_0x3e54a4);});};exports[_0x0dd4('0xf')]=function(_0x67803,_0x50053e){var _0x18d3c7=[_0x0dd4('0x10')];return new BPromise(function(_0x4fbca2,_0x5ec7af){return exec(util[_0x0dd4('0x11')](_0x0dd4('0x12'),_0x67803[_0x0dd4('0x13')][_0x0dd4('0x14')]),function(_0x650f76,_0x1de3fd,_0x46668f){if(_0x650f76){return _0x5ec7af(_0x650f76);}return _0x4fbca2(_0x1de3fd);});})['then'](function(_0x58dcf5){var _0x250cd9=![];var _0xae26c6=_0x58dcf5['split'](/\n/);for(var _0x43e263=0x0,_0x44dd52=_0x18d3c7[_0x0dd4('0x15')];_0x43e263<_0x44dd52,_0x250cd9===![];_0x43e263+=0x1){if(_0x58dcf5[_0x0dd4('0x16')](_0x18d3c7[_0x43e263])>=0x0){_0x250cd9=!![];}}if(!_0x250cd9){throw new Error(util[_0x0dd4('0x11')](_0x0dd4('0x17'),_0x67803['params'][_0x0dd4('0x14')]));}process[_0x0dd4('0x18')](_0x67803['params'][_0x0dd4('0x14')],_0x0dd4('0x19'));return _0x50053e[_0x0dd4('0xc')](0xc8)[_0x0dd4('0xd')]({'message':util[_0x0dd4('0x11')](_0x0dd4('0x1a'),_0x67803[_0x0dd4('0x13')][_0x0dd4('0x14')])});})[_0x0dd4('0xe')](handleError(_0x50053e,null,_0x0dd4('0xf')));}; \ No newline at end of file +var _0x65f6=['../../config/logger','api','util','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','catch','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation'];(function(_0x5a3202,_0x4a9c0d){var _0xb4cf2=function(_0x169a51){while(--_0x169a51){_0x5a3202['push'](_0x5a3202['shift']());}};_0xb4cf2(++_0x4a9c0d);}(_0x65f6,0xd1));var _0x665f=function(_0x377cd4,_0x39b33c){_0x377cd4=_0x377cd4-0x0;var _0x3179d2=_0x65f6[_0x377cd4];return _0x3179d2;};'use strict';var info=require(_0x665f('0x0'));var exec=require('child_process')['exec'];var logger=require(_0x665f('0x1'))(_0x665f('0x2'));var util=require(_0x665f('0x3'));var BPromise=require(_0x665f('0x4'));var _=require(_0x665f('0x5'));function handleError(_0x559f6b,_0x11312d,_0x126f26){_0x11312d=_0x11312d||0x1f4;return function(_0x4b97d3){logger[_0x665f('0x6')](_0x665f('0x7'),_0x126f26,_0x11312d,util[_0x665f('0x8')](_0x4b97d3,{'showHidden':![],'depth':null}));delete _0x4b97d3[_0x665f('0x9')];_0x559f6b[_0x665f('0xa')](_0x11312d)[_0x665f('0xb')](_0x4b97d3);};}exports[_0x665f('0xc')]=function(_0xf96db7,_0x2299cc){return info[_0x665f('0xd')]()[_0x665f('0xe')](function(_0x103bd4){return _0x2299cc[_0x665f('0xa')](0xc8)[_0x665f('0xf')](_0x103bd4);})[_0x665f('0x10')](function(_0x353b6e){return _0x2299cc['status'](0x1f4)['json'](_0x353b6e);});};exports['killProcess']=function(_0x44d975,_0x3ad525){var _0x57bbd1=[_0x665f('0x11')];return new BPromise(function(_0x45785e,_0x2bf613){return exec(util[_0x665f('0x12')](_0x665f('0x13'),_0x44d975[_0x665f('0x14')][_0x665f('0x15')]),function(_0x24a132,_0x284a91,_0xa18d46){if(_0x24a132){return _0x2bf613(_0x24a132);}return _0x45785e(_0x284a91);});})[_0x665f('0xe')](function(_0x22b365){var _0x794558=![];var _0x595555=_0x22b365[_0x665f('0x16')](/\n/);for(var _0x58186c=0x0,_0x1de9ea=_0x57bbd1[_0x665f('0x17')];_0x58186c<_0x1de9ea,_0x794558===![];_0x58186c+=0x1){if(_0x22b365[_0x665f('0x18')](_0x57bbd1[_0x58186c])>=0x0){_0x794558=!![];}}if(!_0x794558){throw new Error(util['format'](_0x665f('0x19'),_0x44d975[_0x665f('0x14')][_0x665f('0x15')]));}process[_0x665f('0x1a')](_0x44d975[_0x665f('0x14')][_0x665f('0x15')],_0x665f('0x1b'));return _0x3ad525[_0x665f('0xa')](0xc8)[_0x665f('0xf')]({'message':util[_0x665f('0x12')](_0x665f('0x1c'),_0x44d975[_0x665f('0x14')][_0x665f('0x15')])});})['catch'](handleError(_0x3ad525,null,_0x665f('0x1d')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index aa8a9e0..76308b7 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 _0x7e0c=['/:id','isAuthenticated','show','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','get'];(function(_0x3ec71b,_0x1d3472){var _0x4ed32b=function(_0x381497){while(--_0x381497){_0x3ec71b['push'](_0x3ec71b['shift']());}};_0x4ed32b(++_0x1d3472);}(_0x7e0c,0xdf));var _0xc7e0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7e0c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc7e0('0x0'));var util=require(_0xc7e0('0x1'));var path=require(_0xc7e0('0x2'));var timeout=require(_0xc7e0('0x3'));var express=require(_0xc7e0('0x4'));var router=express[_0xc7e0('0x5')]();var fs_extra=require(_0xc7e0('0x6'));var auth=require(_0xc7e0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xc7e0('0x8'));var controller=require(_0xc7e0('0x9'));router[_0xc7e0('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc7e0('0xa')](_0xc7e0('0xb'),auth[_0xc7e0('0xc')](),controller[_0xc7e0('0xd')]);router['post']('/',auth[_0xc7e0('0xc')](),controller[_0xc7e0('0xe')]);router['put'](_0xc7e0('0xb'),auth[_0xc7e0('0xc')](),controller[_0xc7e0('0xf')]);router['delete'](_0xc7e0('0xb'),auth[_0xc7e0('0xc')](),controller[_0xc7e0('0x10')]);module[_0xc7e0('0x11')]=router; \ No newline at end of file +var _0xb999=['Router','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','put','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x430481,_0x3133c4){var _0xe4aafb=function(_0x274bf1){while(--_0x274bf1){_0x430481['push'](_0x430481['shift']());}};_0xe4aafb(++_0x3133c4);}(_0xb999,0xad));var _0x9b99=function(_0x66d15c,_0x48d145){_0x66d15c=_0x66d15c-0x0;var _0x2baf1a=_0xb999[_0x66d15c];return _0x2baf1a;};'use strict';var multer=require(_0x9b99('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x9b99('0x1'));var express=require(_0x9b99('0x2'));var router=express[_0x9b99('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x9b99('0x4'));var config=require(_0x9b99('0x5'));var controller=require(_0x9b99('0x6'));router[_0x9b99('0x7')]('/',auth[_0x9b99('0x8')](),controller['index']);router[_0x9b99('0x7')](_0x9b99('0x9'),auth['isAuthenticated'](),controller[_0x9b99('0xa')]);router['post']('/',auth[_0x9b99('0x8')](),controller['create']);router[_0x9b99('0xb')]('/:id',auth[_0x9b99('0x8')](),controller[_0x9b99('0xc')]);router[_0x9b99('0xd')]('/:id',auth[_0x9b99('0x8')](),controller[_0x9b99('0xe')]);module[_0x9b99('0xf')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 3283501..695775a 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 _0x8227=['STRING','#0091EA','exports','name'];(function(_0x2dde6e,_0x41f1c4){var _0x321eb2=function(_0x424a90){while(--_0x424a90){_0x2dde6e['push'](_0x2dde6e['shift']());}};_0x321eb2(++_0x41f1c4);}(_0x8227,0x146));var _0x7822=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8227[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x7822('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x7822('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x7822('0x2')],'defaultValue':_0x7822('0x3')},'description':{'type':Sequelize[_0x7822('0x2')]}}; \ No newline at end of file +var _0x5523=['name','#0091EA','STRING'];(function(_0x1c6412,_0x143f92){var _0xc2872=function(_0x3d04af){while(--_0x3d04af){_0x1c6412['push'](_0x1c6412['shift']());}};_0xc2872(++_0x143f92);}(_0x5523,0x137));var _0x3552=function(_0x58488d,_0x8d907b){_0x58488d=_0x58488d-0x0;var _0x8b052d=_0x5523[_0x58488d];return _0x8b052d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3552('0x0')],'unique':_0x3552('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3552('0x0')],'defaultValue':_0x3552('0x2')},'description':{'type':Sequelize[_0x3552('0x0')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 4996007..316e809 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 _0x407f=['filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','then','destroy','get','Tags','error','stack','name','send','index','map','Tag','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0x46a60a,_0x1c54fe){var _0x1ff42a=function(_0x55f6c3){while(--_0x55f6c3){_0x46a60a['push'](_0x46a60a['shift']());}};_0x1ff42a(++_0x1c54fe);}(_0x407f,0xc2));var _0xf407=function(_0x5b37e5,_0x101120){_0x5b37e5=_0x5b37e5-0x0;var _0x5d285c=_0x407f[_0x5b37e5];return _0x5d285c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf407('0x0'));var rp=require(_0xf407('0x1'));var moment=require(_0xf407('0x2'));var BPromise=require(_0xf407('0x3'));var Mustache=require(_0xf407('0x4'));var util=require(_0xf407('0x5'));var path=require(_0xf407('0x6'));var sox=require(_0xf407('0x7'));var csv=require(_0xf407('0x8'));var ejs=require(_0xf407('0x9'));var fs=require('fs');var fs_extra=require(_0xf407('0xa'));var _=require(_0xf407('0xb'));var squel=require(_0xf407('0xc'));var crypto=require(_0xf407('0xd'));var jsforce=require(_0xf407('0xe'));var deskjs=require(_0xf407('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf407('0x10'));var Papa=require(_0xf407('0x11'));var Redis=require(_0xf407('0x12'));var authService=require(_0xf407('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf407('0x14'))(_0xf407('0x15'));var utils=require(_0xf407('0x16'));var config=require(_0xf407('0x17'));var licenseUtil=require(_0xf407('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ee485,_0x3f4ca0){_0x3f4ca0=_0x3f4ca0||0xcc;return function(_0x3b26ae){if(_0x3b26ae){return _0x2ee485[_0xf407('0x19')](_0x3f4ca0);}return _0x2ee485[_0xf407('0x1a')](_0x3f4ca0)[_0xf407('0x1b')]();};}function respondWithResult(_0x242f43,_0x5257ef){_0x5257ef=_0x5257ef||0xc8;return function(_0x5d80ab){if(_0x5d80ab){return _0x242f43['status'](_0x5257ef)[_0xf407('0x1c')](_0x5d80ab);}};}function respondWithFilteredResult(_0x593e36,_0x454710){return function(_0x4c1320){if(_0x4c1320){var _0x48fd5d=typeof _0x454710[_0xf407('0x1d')]===_0xf407('0x1e')&&typeof _0x454710[_0xf407('0x1f')]===_0xf407('0x1e');var _0x351252=_0x4c1320[_0xf407('0x20')];var _0x4ddbe6=_0x48fd5d?0x0:_0x454710[_0xf407('0x1d')];var _0x588fe4=_0x48fd5d?_0x4c1320[_0xf407('0x20')]:_0x454710[_0xf407('0x1d')]+_0x454710[_0xf407('0x1f')];var _0x334c1a;if(_0x588fe4>=_0x351252){_0x588fe4=_0x351252;_0x334c1a=0xc8;}else{_0x334c1a=0xce;}_0x593e36[_0xf407('0x1a')](_0x334c1a);return _0x593e36[_0xf407('0x21')]('Content-Range',_0x4ddbe6+'-'+_0x588fe4+'/'+_0x351252)[_0xf407('0x1c')](_0x4c1320);}return null;};}function patchUpdates(_0x39febd){return function(_0x2f7ed0){try{jsonpatch[_0xf407('0x22')](_0x2f7ed0,_0x39febd,!![]);}catch(_0x4eb0c3){return BPromise[_0xf407('0x23')](_0x4eb0c3);}return _0x2f7ed0[_0xf407('0x24')]();};}function saveUpdates(_0x23659c,_0xa6f11e){return function(_0x5f32bb){if(_0x5f32bb){return _0x5f32bb['update'](_0x23659c)[_0xf407('0x25')](function(_0x100e6e){return _0x100e6e;});}return null;};}function removeEntity(_0x2558a1,_0x2cea00){return function(_0x9406cf){if(_0x9406cf){return _0x9406cf[_0xf407('0x26')]()[_0xf407('0x25')](function(){var _0x5aecf2=_0x9406cf[_0xf407('0x27')]({'plain':!![]});var _0x1996c8=_0xf407('0x28');return db['UserProfileResource'][_0xf407('0x26')]({'where':{'type':_0x1996c8,'resourceId':_0x5aecf2['id']}})[_0xf407('0x25')](function(){return _0x9406cf;});})[_0xf407('0x25')](function(){_0x2558a1[_0xf407('0x1a')](0xcc)[_0xf407('0x1b')]();});}};}function handleEntityNotFound(_0x187c93,_0x524b34){return function(_0x3953c5){if(!_0x3953c5){_0x187c93['sendStatus'](0x194);}return _0x3953c5;};}function handleError(_0x4fc4df,_0x949669){_0x949669=_0x949669||0x1f4;return function(_0x115dce){logger[_0xf407('0x29')](_0x115dce[_0xf407('0x2a')]);if(_0x115dce[_0xf407('0x2b')]){delete _0x115dce[_0xf407('0x2b')];}_0x4fc4df['status'](_0x949669)[_0xf407('0x2c')](_0x115dce);};}exports[_0xf407('0x2d')]=function(_0xa91b61,_0x89915b){var _0x15cd8d={},_0x5e12da={},_0x4a763e={'count':0x0,'rows':[]};var _0xce3a12=_[_0xf407('0x2e')](db[_0xf407('0x2f')][_0xf407('0x30')],function(_0x153287){return{'name':_0x153287[_0xf407('0x31')],'type':_0x153287[_0xf407('0x32')]['key']};});_0x5e12da[_0xf407('0x33')]=_['map'](_0xce3a12,_0xf407('0x2b'));_0x5e12da[_0xf407('0x34')]=_['keys'](_0xa91b61['query']);_0x5e12da['filters']=_[_0xf407('0x35')](_0x5e12da[_0xf407('0x33')],_0x5e12da['query']);_0x15cd8d[_0xf407('0x36')]=_[_0xf407('0x35')](_0x5e12da[_0xf407('0x33')],qs[_0xf407('0x37')](_0xa91b61['query']['fields']));_0x15cd8d[_0xf407('0x36')]=_0x15cd8d[_0xf407('0x36')][_0xf407('0x38')]?_0x15cd8d[_0xf407('0x36')]:_0x5e12da[_0xf407('0x33')];if(!_0xa91b61[_0xf407('0x34')][_0xf407('0x39')](_0xf407('0x3a'))){_0x15cd8d[_0xf407('0x1f')]=qs[_0xf407('0x1f')](_0xa91b61['query'][_0xf407('0x1f')]);_0x15cd8d['offset']=qs[_0xf407('0x1d')](_0xa91b61[_0xf407('0x34')][_0xf407('0x1d')]);}_0x15cd8d[_0xf407('0x3b')]=qs[_0xf407('0x3c')](_0xa91b61['query'][_0xf407('0x3c')]);_0x15cd8d[_0xf407('0x3d')]=qs[_0xf407('0x3e')](_[_0xf407('0x3f')](_0xa91b61['query'],_0x5e12da[_0xf407('0x3e')]),_0xce3a12);if(_0xa91b61[_0xf407('0x34')][_0xf407('0x40')]){_0x15cd8d['where']=_['merge'](_0x15cd8d[_0xf407('0x3d')],{'$or':_['map'](_0xce3a12,function(_0x573fae){if(_0x573fae[_0xf407('0x32')]!==_0xf407('0x41')){var _0x4890ae={};_0x4890ae[_0x573fae[_0xf407('0x2b')]]={'$like':'%'+_0xa91b61[_0xf407('0x34')][_0xf407('0x40')]+'%'};return _0x4890ae;}})});}_0x15cd8d=_[_0xf407('0x42')]({},_0x15cd8d,_0xa91b61[_0xf407('0x43')]);var _0x5c27c4={'where':_0x15cd8d[_0xf407('0x3d')]};return db['Tag']['count'](_0x5c27c4)[_0xf407('0x25')](function(_0x1ddb15){_0x4a763e['count']=_0x1ddb15;if(_0xa91b61[_0xf407('0x34')][_0xf407('0x44')]){_0x15cd8d[_0xf407('0x45')]=[{'all':!![]}];}return db[_0xf407('0x2f')][_0xf407('0x46')](_0x15cd8d);})[_0xf407('0x25')](function(_0x1c8f17){_0x4a763e[_0xf407('0x47')]=_0x1c8f17;return _0x4a763e;})['then'](respondWithFilteredResult(_0x89915b,_0x15cd8d))[_0xf407('0x48')](handleError(_0x89915b,null));};exports['show']=function(_0x2def2e,_0x571188){var _0x444b01={'raw':!![],'where':{'id':_0x2def2e[_0xf407('0x49')]['id']}},_0x56ea2b={};_0x56ea2b[_0xf407('0x33')]=_[_0xf407('0x4a')](db[_0xf407('0x2f')][_0xf407('0x30')]);_0x56ea2b[_0xf407('0x34')]=_[_0xf407('0x4a')](_0x2def2e['query']);_0x56ea2b[_0xf407('0x3e')]=_[_0xf407('0x35')](_0x56ea2b[_0xf407('0x33')],_0x56ea2b[_0xf407('0x34')]);_0x444b01[_0xf407('0x36')]=_[_0xf407('0x35')](_0x56ea2b['model'],qs[_0xf407('0x37')](_0x2def2e[_0xf407('0x34')][_0xf407('0x37')]));_0x444b01[_0xf407('0x36')]=_0x444b01[_0xf407('0x36')][_0xf407('0x38')]?_0x444b01['attributes']:_0x56ea2b[_0xf407('0x33')];if(_0x2def2e[_0xf407('0x34')][_0xf407('0x44')]){_0x444b01['include']=[{'all':!![]}];}_0x444b01=_[_0xf407('0x42')]({},_0x444b01,_0x2def2e['options']);return db[_0xf407('0x2f')][_0xf407('0x4b')](_0x444b01)[_0xf407('0x25')](handleEntityNotFound(_0x571188,null))[_0xf407('0x25')](respondWithResult(_0x571188,null))['catch'](handleError(_0x571188,null));};exports[_0xf407('0x4c')]=function(_0x3b6c44,_0x16cf14){return db['Tag']['create'](_0x3b6c44[_0xf407('0x4d')],{})[_0xf407('0x25')](function(_0x45e9ab){var _0x4799c1=_0x3b6c44[_0xf407('0x4e')][_0xf407('0x27')]({'plain':!![]});if(!_0x4799c1)throw new Error(_0xf407('0x4f'));if(_0x4799c1[_0xf407('0x50')]==='user'){var _0x1282df=_0x45e9ab[_0xf407('0x27')]({'plain':!![]});var _0x4e8483=_0xf407('0x28');return db[_0xf407('0x51')][_0xf407('0x4b')]({'where':{'name':_0x4e8483,'userProfileId':_0x4799c1['userProfileId']},'raw':!![]})[_0xf407('0x25')](function(_0xd168af){if(_0xd168af&&_0xd168af[_0xf407('0x52')]===0x0){return db[_0xf407('0x53')]['create']({'name':_0x1282df[_0xf407('0x2b')],'resourceId':_0x1282df['id'],'type':_0xd168af[_0xf407('0x2b')],'sectionId':_0xd168af['id']},{})['then'](function(){return _0x45e9ab;});}else{return _0x45e9ab;}})[_0xf407('0x48')](function(_0x588fd7){logger[_0xf407('0x29')](_0xf407('0x54'),_0x588fd7);throw _0x588fd7;});}return _0x45e9ab;})['then'](respondWithResult(_0x16cf14,0xc9))[_0xf407('0x48')](handleError(_0x16cf14,null));};exports[_0xf407('0x55')]=function(_0x4b161b,_0x289d00){if(_0x4b161b['body']['id']){delete _0x4b161b['body']['id'];}return db[_0xf407('0x2f')][_0xf407('0x4b')]({'where':{'id':_0x4b161b[_0xf407('0x49')]['id']}})[_0xf407('0x25')](handleEntityNotFound(_0x289d00,null))[_0xf407('0x25')](saveUpdates(_0x4b161b[_0xf407('0x4d')],null))['then'](respondWithResult(_0x289d00,null))['catch'](handleError(_0x289d00,null));};exports[_0xf407('0x26')]=function(_0x34cdf1,_0x417bdd){return db[_0xf407('0x2f')][_0xf407('0x4b')]({'where':{'id':_0x34cdf1[_0xf407('0x49')]['id']}})['then'](handleEntityNotFound(_0x417bdd,null))[_0xf407('0x25')](removeEntity(_0x417bdd,null))[_0xf407('0x48')](handleError(_0x417bdd,null));}; \ No newline at end of file +var _0x3685=['squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','index','Tag','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','map','options','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x3685,0xf8));var _0x5368=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3685[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0x5368('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5368('0x1'));var jsonpatch=require(_0x5368('0x2'));var rp=require(_0x5368('0x3'));var moment=require(_0x5368('0x4'));var BPromise=require(_0x5368('0x5'));var Mustache=require(_0x5368('0x6'));var util=require(_0x5368('0x7'));var path=require(_0x5368('0x8'));var sox=require(_0x5368('0x9'));var csv=require(_0x5368('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5368('0xb'));var _=require(_0x5368('0xc'));var squel=require(_0x5368('0xd'));var crypto=require(_0x5368('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x5368('0xf'));var toCsv=require(_0x5368('0xa'));var querystring=require(_0x5368('0x10'));var Papa=require(_0x5368('0x11'));var Redis=require(_0x5368('0x12'));var authService=require(_0x5368('0x13'));var qs=require(_0x5368('0x14'));var as=require(_0x5368('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5368('0x16'))(_0x5368('0x17'));var utils=require(_0x5368('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x5368('0x19'));var db=require(_0x5368('0x1a'))['db'];function respondWithStatusCode(_0x4940af,_0x5d6a86){_0x5d6a86=_0x5d6a86||0xcc;return function(_0x5c626a){if(_0x5c626a){return _0x4940af[_0x5368('0x1b')](_0x5d6a86);}return _0x4940af[_0x5368('0x1c')](_0x5d6a86)[_0x5368('0x1d')]();};}function respondWithResult(_0x5df43,_0xa5ce3c){_0xa5ce3c=_0xa5ce3c||0xc8;return function(_0x2f18dd){if(_0x2f18dd){return _0x5df43[_0x5368('0x1c')](_0xa5ce3c)[_0x5368('0x1e')](_0x2f18dd);}};}function respondWithFilteredResult(_0x3a3b8e,_0x5b1da2){return function(_0x524fbf){if(_0x524fbf){var _0x41ce0e=typeof _0x5b1da2[_0x5368('0x1f')]==='undefined'&&typeof _0x5b1da2[_0x5368('0x20')]===_0x5368('0x21');var _0x973143=_0x524fbf[_0x5368('0x22')];var _0x5b10e9=_0x41ce0e?0x0:_0x5b1da2[_0x5368('0x1f')];var _0x56ac4d=_0x41ce0e?_0x524fbf['count']:_0x5b1da2[_0x5368('0x1f')]+_0x5b1da2['limit'];var _0x52afa9;if(_0x56ac4d>=_0x973143){_0x56ac4d=_0x973143;_0x52afa9=0xc8;}else{_0x52afa9=0xce;}_0x3a3b8e['status'](_0x52afa9);return _0x3a3b8e[_0x5368('0x23')](_0x5368('0x24'),_0x5b10e9+'-'+_0x56ac4d+'/'+_0x973143)[_0x5368('0x1e')](_0x524fbf);}return null;};}function patchUpdates(_0x5cef40){return function(_0x4e3267){try{jsonpatch[_0x5368('0x25')](_0x4e3267,_0x5cef40,!![]);}catch(_0x3c891a){return BPromise[_0x5368('0x26')](_0x3c891a);}return _0x4e3267[_0x5368('0x27')]();};}function saveUpdates(_0x1c2fcd,_0x1093e2){return function(_0x4885d0){if(_0x4885d0){return _0x4885d0[_0x5368('0x28')](_0x1c2fcd)[_0x5368('0x29')](function(_0x4705f2){return _0x4705f2;});}return null;};}function removeEntity(_0x57108b,_0x45884f){return function(_0xb994f4){if(_0xb994f4){return _0xb994f4[_0x5368('0x2a')]()[_0x5368('0x29')](function(){var _0x1c287f=_0xb994f4[_0x5368('0x2b')]({'plain':!![]});var _0xabac8c=_0x5368('0x2c');return db[_0x5368('0x2d')]['destroy']({'where':{'type':_0xabac8c,'resourceId':_0x1c287f['id']}})['then'](function(){return _0xb994f4;});})[_0x5368('0x29')](function(){_0x57108b[_0x5368('0x1c')](0xcc)[_0x5368('0x1d')]();});}};}function handleEntityNotFound(_0x452c81,_0x131722){return function(_0x4b94cd){if(!_0x4b94cd){_0x452c81[_0x5368('0x1b')](0x194);}return _0x4b94cd;};}function handleError(_0x200ad0,_0x2e18e0){_0x2e18e0=_0x2e18e0||0x1f4;return function(_0x2bcf41){logger[_0x5368('0x2e')](_0x2bcf41[_0x5368('0x2f')]);if(_0x2bcf41[_0x5368('0x30')]){delete _0x2bcf41[_0x5368('0x30')];}_0x200ad0[_0x5368('0x1c')](_0x2e18e0)[_0x5368('0x31')](_0x2bcf41);};}exports[_0x5368('0x32')]=function(_0x46ea22,_0x7449cd){var _0x5810cb={},_0x73111b={},_0x256abd={'count':0x0,'rows':[]};var _0x36e230=_['map'](db[_0x5368('0x33')]['rawAttributes'],function(_0x26fc48){return{'name':_0x26fc48[_0x5368('0x34')],'type':_0x26fc48['type'][_0x5368('0x35')]};});_0x73111b[_0x5368('0x36')]=_['map'](_0x36e230,'name');_0x73111b[_0x5368('0x37')]=_[_0x5368('0x38')](_0x46ea22['query']);_0x73111b[_0x5368('0x39')]=_[_0x5368('0x3a')](_0x73111b[_0x5368('0x36')],_0x73111b['query']);_0x5810cb[_0x5368('0x3b')]=_['intersection'](_0x73111b[_0x5368('0x36')],qs[_0x5368('0x3c')](_0x46ea22[_0x5368('0x37')]['fields']));_0x5810cb[_0x5368('0x3b')]=_0x5810cb[_0x5368('0x3b')][_0x5368('0x3d')]?_0x5810cb[_0x5368('0x3b')]:_0x73111b['model'];if(!_0x46ea22[_0x5368('0x37')]['hasOwnProperty'](_0x5368('0x3e'))){_0x5810cb[_0x5368('0x20')]=qs['limit'](_0x46ea22[_0x5368('0x37')][_0x5368('0x20')]);_0x5810cb[_0x5368('0x1f')]=qs[_0x5368('0x1f')](_0x46ea22['query'][_0x5368('0x1f')]);}_0x5810cb[_0x5368('0x3f')]=qs[_0x5368('0x40')](_0x46ea22[_0x5368('0x37')][_0x5368('0x40')]);_0x5810cb['where']=qs[_0x5368('0x39')](_[_0x5368('0x41')](_0x46ea22['query'],_0x73111b[_0x5368('0x39')]),_0x36e230);if(_0x46ea22[_0x5368('0x37')][_0x5368('0x42')]){_0x5810cb['where']=_[_0x5368('0x43')](_0x5810cb[_0x5368('0x44')],{'$or':_[_0x5368('0x45')](_0x36e230,function(_0x25e432){if(_0x25e432['type']!=='VIRTUAL'){var _0x1be46a={};_0x1be46a[_0x25e432[_0x5368('0x30')]]={'$like':'%'+_0x46ea22[_0x5368('0x37')]['filter']+'%'};return _0x1be46a;}})});}_0x5810cb=_['merge']({},_0x5810cb,_0x46ea22[_0x5368('0x46')]);var _0x5ae3f1={'where':_0x5810cb[_0x5368('0x44')]};return db[_0x5368('0x33')]['count'](_0x5ae3f1)[_0x5368('0x29')](function(_0x3b57a2){_0x256abd[_0x5368('0x22')]=_0x3b57a2;if(_0x46ea22[_0x5368('0x37')][_0x5368('0x47')]){_0x5810cb[_0x5368('0x48')]=[{'all':!![]}];}return db[_0x5368('0x33')][_0x5368('0x49')](_0x5810cb);})[_0x5368('0x29')](function(_0x43c776){_0x256abd[_0x5368('0x4a')]=_0x43c776;return _0x256abd;})[_0x5368('0x29')](respondWithFilteredResult(_0x7449cd,_0x5810cb))['catch'](handleError(_0x7449cd,null));};exports[_0x5368('0x4b')]=function(_0x61b1a1,_0xd4e247){var _0x4cb800={'raw':!![],'where':{'id':_0x61b1a1[_0x5368('0x4c')]['id']}},_0x1b66a1={};_0x1b66a1['model']=_[_0x5368('0x38')](db[_0x5368('0x33')][_0x5368('0x4d')]);_0x1b66a1[_0x5368('0x37')]=_[_0x5368('0x38')](_0x61b1a1[_0x5368('0x37')]);_0x1b66a1[_0x5368('0x39')]=_[_0x5368('0x3a')](_0x1b66a1[_0x5368('0x36')],_0x1b66a1[_0x5368('0x37')]);_0x4cb800['attributes']=_['intersection'](_0x1b66a1[_0x5368('0x36')],qs[_0x5368('0x3c')](_0x61b1a1[_0x5368('0x37')][_0x5368('0x3c')]));_0x4cb800['attributes']=_0x4cb800['attributes'][_0x5368('0x3d')]?_0x4cb800['attributes']:_0x1b66a1[_0x5368('0x36')];if(_0x61b1a1['query'][_0x5368('0x47')]){_0x4cb800['include']=[{'all':!![]}];}_0x4cb800=_[_0x5368('0x43')]({},_0x4cb800,_0x61b1a1[_0x5368('0x46')]);return db['Tag']['find'](_0x4cb800)[_0x5368('0x29')](handleEntityNotFound(_0xd4e247,null))['then'](respondWithResult(_0xd4e247,null))[_0x5368('0x4e')](handleError(_0xd4e247,null));};exports[_0x5368('0x4f')]=function(_0x2ee00b,_0x121d8d){return db['Tag'][_0x5368('0x4f')](_0x2ee00b[_0x5368('0x50')],{})[_0x5368('0x29')](function(_0x1d9c87){var _0x20e641=_0x2ee00b[_0x5368('0x51')][_0x5368('0x2b')]({'plain':!![]});if(!_0x20e641)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x20e641['role']===_0x5368('0x51')){var _0x7d7a5=_0x1d9c87[_0x5368('0x2b')]({'plain':!![]});var _0x4850f8=_0x5368('0x2c');return db[_0x5368('0x52')][_0x5368('0x53')]({'where':{'name':_0x4850f8,'userProfileId':_0x20e641[_0x5368('0x54')]},'raw':!![]})[_0x5368('0x29')](function(_0x233bf6){if(_0x233bf6&&_0x233bf6[_0x5368('0x55')]===0x0){return db[_0x5368('0x2d')]['create']({'name':_0x7d7a5[_0x5368('0x30')],'resourceId':_0x7d7a5['id'],'type':_0x233bf6[_0x5368('0x30')],'sectionId':_0x233bf6['id']},{})[_0x5368('0x29')](function(){return _0x1d9c87;});}else{return _0x1d9c87;}})[_0x5368('0x4e')](function(_0x5720c8){logger[_0x5368('0x2e')](_0x5368('0x56'),_0x5720c8);throw _0x5720c8;});}return _0x1d9c87;})[_0x5368('0x29')](respondWithResult(_0x121d8d,0xc9))[_0x5368('0x4e')](handleError(_0x121d8d,null));};exports[_0x5368('0x28')]=function(_0x44a481,_0x42544e){if(_0x44a481[_0x5368('0x50')]['id']){delete _0x44a481[_0x5368('0x50')]['id'];}return db[_0x5368('0x33')][_0x5368('0x53')]({'where':{'id':_0x44a481[_0x5368('0x4c')]['id']}})[_0x5368('0x29')](handleEntityNotFound(_0x42544e,null))[_0x5368('0x29')](saveUpdates(_0x44a481['body'],null))[_0x5368('0x29')](respondWithResult(_0x42544e,null))[_0x5368('0x4e')](handleError(_0x42544e,null));};exports[_0x5368('0x2a')]=function(_0x2971de,_0x2688a9){return db[_0x5368('0x33')]['find']({'where':{'id':_0x2971de[_0x5368('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2688a9,null))[_0x5368('0x29')](removeEntity(_0x2688a9,null))[_0x5368('0x4e')](handleError(_0x2688a9,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 0e431f4..46099e8 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 _0xf8bc=['path','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x450689,_0x3b857c){var _0x46ffb0=function(_0x5d3679){while(--_0x5d3679){_0x450689['push'](_0x450689['shift']());}};_0x46ffb0(++_0x3b857c);}(_0xf8bc,0x180));var _0xcf8b=function(_0x1d04b5,_0x30792c){_0x1d04b5=_0x1d04b5-0x0;var _0x161342=_0xf8bc[_0x1d04b5];return _0x161342;};'use strict';var _=require(_0xcf8b('0x0'));var util=require(_0xcf8b('0x1'));var logger=require(_0xcf8b('0x2'))(_0xcf8b('0x3'));var moment=require(_0xcf8b('0x4'));var BPromise=require(_0xcf8b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf8b('0x6'));var rimraf=require('rimraf');var config=require(_0xcf8b('0x7'));var attributes=require(_0xcf8b('0x8'));module[_0xcf8b('0x9')]=function(_0x5aef34,_0x597405){return _0x5aef34[_0xcf8b('0xa')](_0xcf8b('0xb'),attributes,{'tableName':_0xcf8b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0a9f=['request-promise','rimraf','exports','define','Tag','tools_tags','lodash','util','api','moment','bluebird'];(function(_0xc795e0,_0x2d113e){var _0x5607cf=function(_0x13b7a0){while(--_0x13b7a0){_0xc795e0['push'](_0xc795e0['shift']());}};_0x5607cf(++_0x2d113e);}(_0x0a9f,0x19d));var _0xf0a9=function(_0x1c3281,_0x5c69a0){_0x1c3281=_0x1c3281-0x0;var _0x27588d=_0x0a9f[_0x1c3281];return _0x27588d;};'use strict';var _=require(_0xf0a9('0x0'));var util=require(_0xf0a9('0x1'));var logger=require('../../config/logger')(_0xf0a9('0x2'));var moment=require(_0xf0a9('0x3'));var BPromise=require(_0xf0a9('0x4'));var rp=require(_0xf0a9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0a9('0x6'));var config=require('../../config/environment');var attributes=require('./tag.attributes');module[_0xf0a9('0x7')]=function(_0x450780,_0x16965a){return _0x450780[_0xf0a9('0x8')](_0xf0a9('0x9'),attributes,{'tableName':_0xf0a9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 0203402..947c675 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 _0xe13a=['code','message','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x14815b,_0x258a44){var _0x3ccb14=function(_0xb53a){while(--_0xb53a){_0x14815b['push'](_0x14815b['shift']());}};_0x3ccb14(++_0x258a44);}(_0xe13a,0x178));var _0xae13=function(_0x484f49,_0x247163){_0x484f49=_0x484f49-0x0;var _0x4dcedc=_0xe13a[_0x484f49];return _0x4dcedc;};'use strict';var _=require('lodash');var util=require(_0xae13('0x0'));var moment=require(_0xae13('0x1'));var BPromise=require(_0xae13('0x2'));var rs=require(_0xae13('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xae13('0x4'))['db'];var utils=require(_0xae13('0x5'));var logger=require(_0xae13('0x6'))(_0xae13('0x7'));var config=require(_0xae13('0x8'));var jayson=require(_0xae13('0x9'));var client=jayson[_0xae13('0xa')][_0xae13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x341ba4,_0x4ae51f,_0x2f6d10){return new BPromise(function(_0x2b2e1f,_0x27fefd){return client[_0xae13('0xc')](_0x341ba4,_0x2f6d10)[_0xae13('0xd')](function(_0x41bf44){logger[_0xae13('0xe')](_0xae13('0xf'),_0x4ae51f,_0xae13('0x10'));logger['debug'](_0xae13('0x11'),_0x4ae51f,_0xae13('0x10'),JSON[_0xae13('0x12')](_0x41bf44));if(_0x41bf44[_0xae13('0x13')]){if(_0x41bf44[_0xae13('0x13')][_0xae13('0x14')]===0x1f4){logger[_0xae13('0x13')]('Tag,\x20%s,\x20%s',_0x4ae51f,_0x41bf44[_0xae13('0x13')][_0xae13('0x15')]);return _0x27fefd(_0x41bf44['error']['message']);}logger['error']('Tag,\x20%s,\x20%s',_0x4ae51f,_0x41bf44['error'][_0xae13('0x15')]);return _0x2b2e1f(_0x41bf44[_0xae13('0x13')][_0xae13('0x15')]);}else{logger[_0xae13('0xe')](_0xae13('0xf'),_0x4ae51f,_0xae13('0x10'));_0x2b2e1f(_0x41bf44['result'][_0xae13('0x15')]);}})['catch'](function(_0xe10aab){logger[_0xae13('0x13')](_0xae13('0xf'),_0x4ae51f,_0xe10aab);_0x27fefd(_0xe10aab);});});} \ No newline at end of file +var _0x0207=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','error','code','message','util','randomstring','ioredis'];(function(_0x205338,_0x516bf7){var _0x5ea60e=function(_0x535682){while(--_0x535682){_0x205338['push'](_0x205338['shift']());}};_0x5ea60e(++_0x516bf7);}(_0x0207,0x162));var _0x7020=function(_0x28dd1a,_0x48ecb3){_0x28dd1a=_0x28dd1a-0x0;var _0x18d911=_0x0207[_0x28dd1a];return _0x18d911;};'use strict';var _=require('lodash');var util=require(_0x7020('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7020('0x1'));var fs=require('fs');var Redis=require(_0x7020('0x2'));var db=require(_0x7020('0x3'))['db'];var utils=require(_0x7020('0x4'));var logger=require(_0x7020('0x5'))(_0x7020('0x6'));var config=require(_0x7020('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7020('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39263c,_0x3c6c11,_0x17deac){return new BPromise(function(_0x42bc79,_0x22ba3e){return client[_0x7020('0x9')](_0x39263c,_0x17deac)['then'](function(_0x5e86b5){logger[_0x7020('0xa')](_0x7020('0xb'),_0x3c6c11,_0x7020('0xc'));logger['debug'](_0x7020('0xd'),_0x3c6c11,_0x7020('0xc'),JSON['stringify'](_0x5e86b5));if(_0x5e86b5[_0x7020('0xe')]){if(_0x5e86b5[_0x7020('0xe')][_0x7020('0xf')]===0x1f4){logger['error'](_0x7020('0xb'),_0x3c6c11,_0x5e86b5[_0x7020('0xe')][_0x7020('0x10')]);return _0x22ba3e(_0x5e86b5[_0x7020('0xe')][_0x7020('0x10')]);}logger['error'](_0x7020('0xb'),_0x3c6c11,_0x5e86b5['error'][_0x7020('0x10')]);return _0x42bc79(_0x5e86b5[_0x7020('0xe')][_0x7020('0x10')]);}else{logger[_0x7020('0xa')](_0x7020('0xb'),_0x3c6c11,_0x7020('0xc'));_0x42bc79(_0x5e86b5['result'][_0x7020('0x10')]);}})['catch'](function(_0x2f4db5){logger[_0x7020('0xe')](_0x7020('0xb'),_0x3c6c11,_0x2f4db5);_0x22ba3e(_0x2f4db5);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 67bd2a0..dc42e49 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 _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);module['exports']=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','index','/:id','getQueues','/:id/users','isAuthenticated','getAgents','post','addQueues','addAgents','update','delete','removeAgents','multer','util','path'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/queues',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0xf')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);router['put'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router[_0x0a9e('0x13')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller['destroy']);router[_0x0a9e('0x13')]('/:id/queues',auth[_0x0a9e('0xd')](),controller['removeQueues']);router[_0x0a9e('0x13')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x14')]);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 b8fa0d2..9a1788e 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 _0xb7e7=['STRING','sequelize'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xb7e7[_0x4b7b62];return _0x2280df;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0xbaf0=['name','exports','STRING'];(function(_0x1f7413,_0x3388c3){var _0x2d2775=function(_0x5e5b4){while(--_0x5e5b4){_0x1f7413['push'](_0x1f7413['shift']());}};_0x2d2775(++_0x3388c3);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index cc7d5e5..146090e 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 _0x29f5=['register','sendStatus','status','end','undefined','limit','count','offset','json','save','then','error','name','index','Team','fieldName','type','key','model','map','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','filters','pick','where','VIRTUAL','options','includeAll','include','findAll','rows','params','length','merge','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Teams','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','SELECT','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','send','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','rawAttributes','Queues','addQueues','findOne','ValidationError','ids','removeQueues','remove','addAgents','isArray','Voice','Mail','Sms','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','emit','Queue:save','online','interface','UserVoiceQueueRt','upsert','isNil','voicePause','all','VoicePrefixId','spread','removeAgents','Chat','Openchannel','Queue:remove','getAgents','filter','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','defaults','redis','localhost','./team.socket'];(function(_0x7fab1f,_0x3b5399){var _0x1699e2=function(_0x340ffd){while(--_0x340ffd){_0x7fab1f['push'](_0x7fab1f['shift']());}};_0x1699e2(++_0x3b5399);}(_0x29f5,0x1ac));var _0x529f=function(_0x1a5059,_0x48e6b2){_0x1a5059=_0x1a5059-0x0;var _0x318d5b=_0x29f5[_0x1a5059];return _0x318d5b;};'use strict';var emlformat=require(_0x529f('0x0'));var rimraf=require(_0x529f('0x1'));var zipdir=require(_0x529f('0x2'));var jsonpatch=require(_0x529f('0x3'));var rp=require(_0x529f('0x4'));var moment=require(_0x529f('0x5'));var BPromise=require(_0x529f('0x6'));var Mustache=require(_0x529f('0x7'));var util=require(_0x529f('0x8'));var path=require('path');var sox=require(_0x529f('0x9'));var csv=require(_0x529f('0xa'));var ejs=require(_0x529f('0xb'));var fs=require('fs');var fs_extra=require(_0x529f('0xc'));var _=require(_0x529f('0xd'));var squel=require(_0x529f('0xe'));var crypto=require(_0x529f('0xf'));var jsforce=require(_0x529f('0x10'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x529f('0x11'));var Papa=require(_0x529f('0x12'));var Redis=require(_0x529f('0x13'));var authService=require(_0x529f('0x14'));var qs=require(_0x529f('0x15'));var as=require(_0x529f('0x16'));var hardwareService=require(_0x529f('0x17'));var logger=require('../../config/logger')(_0x529f('0x18'));var utils=require(_0x529f('0x19'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x529f('0x1a'))['db'];config['redis']=_[_0x529f('0x1b')](config[_0x529f('0x1c')],{'host':_0x529f('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x529f('0x1e'))[_0x529f('0x1f')](socket);function respondWithStatusCode(_0x59012f,_0x46d07a){_0x46d07a=_0x46d07a||0xcc;return function(_0x238319){if(_0x238319){return _0x59012f[_0x529f('0x20')](_0x46d07a);}return _0x59012f[_0x529f('0x21')](_0x46d07a)[_0x529f('0x22')]();};}function respondWithResult(_0x40404f,_0x492751){_0x492751=_0x492751||0xc8;return function(_0x5cdc28){if(_0x5cdc28){return _0x40404f['status'](_0x492751)['json'](_0x5cdc28);}};}function respondWithFilteredResult(_0x5b6561,_0x483d3e){return function(_0x80d2d){if(_0x80d2d){var _0x1cfb38=typeof _0x483d3e['offset']===_0x529f('0x23')&&typeof _0x483d3e[_0x529f('0x24')]===_0x529f('0x23');var _0x18bdaf=_0x80d2d[_0x529f('0x25')];var _0x5b8d0a=_0x1cfb38?0x0:_0x483d3e[_0x529f('0x26')];var _0x2b3c2a=_0x1cfb38?_0x80d2d['count']:_0x483d3e[_0x529f('0x26')]+_0x483d3e[_0x529f('0x24')];var _0x512fb7;if(_0x2b3c2a>=_0x18bdaf){_0x2b3c2a=_0x18bdaf;_0x512fb7=0xc8;}else{_0x512fb7=0xce;}_0x5b6561[_0x529f('0x21')](_0x512fb7);return _0x5b6561['set']('Content-Range',_0x5b8d0a+'-'+_0x2b3c2a+'/'+_0x18bdaf)[_0x529f('0x27')](_0x80d2d);}return null;};}function patchUpdates(_0x3415c9){return function(_0x310b8c){try{jsonpatch['apply'](_0x310b8c,_0x3415c9,!![]);}catch(_0xae27d7){return BPromise['reject'](_0xae27d7);}return _0x310b8c[_0x529f('0x28')]();};}function saveUpdates(_0x539080,_0x451f55){return function(_0x3c24ce){if(_0x3c24ce){return _0x3c24ce['update'](_0x539080)[_0x529f('0x29')](function(_0x58874d){return _0x58874d;});}return null;};}function handleEntityNotFound(_0x10f0a3,_0xd52676){return function(_0x3cb06b){if(!_0x3cb06b){_0x10f0a3[_0x529f('0x20')](0x194);}return _0x3cb06b;};}function handleError(_0x2571b6,_0x3ca0b4){_0x3ca0b4=_0x3ca0b4||0x1f4;return function(_0x5ca83f){logger[_0x529f('0x2a')](_0x5ca83f['stack']);if(_0x5ca83f[_0x529f('0x2b')]){delete _0x5ca83f[_0x529f('0x2b')];}_0x2571b6[_0x529f('0x21')](_0x3ca0b4)['send'](_0x5ca83f);};}exports[_0x529f('0x2c')]=function(_0x4a13ce,_0x4c10ee){var _0x37e5ab={},_0x364cd7={},_0x48b00d={'count':0x0,'rows':[]};var _0x51027d=_['map'](db[_0x529f('0x2d')]['rawAttributes'],function(_0x5e5a64){return{'name':_0x5e5a64[_0x529f('0x2e')],'type':_0x5e5a64[_0x529f('0x2f')][_0x529f('0x30')]};});_0x364cd7[_0x529f('0x31')]=_[_0x529f('0x32')](_0x51027d,_0x529f('0x2b'));_0x364cd7[_0x529f('0x33')]=_[_0x529f('0x34')](_0x4a13ce[_0x529f('0x33')]);_0x364cd7['filters']=_['intersection'](_0x364cd7[_0x529f('0x31')],_0x364cd7[_0x529f('0x33')]);_0x37e5ab[_0x529f('0x35')]=_[_0x529f('0x36')](_0x364cd7[_0x529f('0x31')],qs[_0x529f('0x37')](_0x4a13ce[_0x529f('0x33')][_0x529f('0x37')]));_0x37e5ab[_0x529f('0x35')]=_0x37e5ab[_0x529f('0x35')]['length']?_0x37e5ab[_0x529f('0x35')]:_0x364cd7[_0x529f('0x31')];if(!_0x4a13ce[_0x529f('0x33')][_0x529f('0x38')](_0x529f('0x39'))){_0x37e5ab[_0x529f('0x24')]=qs[_0x529f('0x24')](_0x4a13ce[_0x529f('0x33')][_0x529f('0x24')]);_0x37e5ab[_0x529f('0x26')]=qs[_0x529f('0x26')](_0x4a13ce[_0x529f('0x33')][_0x529f('0x26')]);}_0x37e5ab[_0x529f('0x3a')]=qs[_0x529f('0x3b')](_0x4a13ce[_0x529f('0x33')][_0x529f('0x3b')]);_0x37e5ab['where']=qs[_0x529f('0x3c')](_[_0x529f('0x3d')](_0x4a13ce['query'],_0x364cd7[_0x529f('0x3c')]),_0x51027d);if(_0x4a13ce['query']['filter']){_0x37e5ab['where']=_['merge'](_0x37e5ab[_0x529f('0x3e')],{'$or':_['map'](_0x51027d,function(_0x56a2f7){if(_0x56a2f7[_0x529f('0x2f')]!==_0x529f('0x3f')){var _0x254c87={};_0x254c87[_0x56a2f7[_0x529f('0x2b')]]={'$like':'%'+_0x4a13ce['query']['filter']+'%'};return _0x254c87;}})});}_0x37e5ab=_['merge']({},_0x37e5ab,_0x4a13ce[_0x529f('0x40')]);var _0x19928b={'where':_0x37e5ab[_0x529f('0x3e')]};return db['Team']['count'](_0x19928b)[_0x529f('0x29')](function(_0x852c41){_0x48b00d[_0x529f('0x25')]=_0x852c41;if(_0x4a13ce[_0x529f('0x33')][_0x529f('0x41')]){_0x37e5ab[_0x529f('0x42')]=[{'all':!![]}];}return db['Team'][_0x529f('0x43')](_0x37e5ab);})[_0x529f('0x29')](function(_0x41c831){_0x48b00d[_0x529f('0x44')]=_0x41c831;return _0x48b00d;})[_0x529f('0x29')](respondWithFilteredResult(_0x4c10ee,_0x37e5ab))['catch'](handleError(_0x4c10ee,null));};exports['show']=function(_0x4bfa40,_0x1414a5){var _0x147238={'raw':![],'where':{'id':_0x4bfa40[_0x529f('0x45')]['id']}},_0x46926b={};_0x46926b[_0x529f('0x31')]=_[_0x529f('0x34')](db[_0x529f('0x2d')]['rawAttributes']);_0x46926b[_0x529f('0x33')]=_[_0x529f('0x34')](_0x4bfa40['query']);_0x46926b[_0x529f('0x3c')]=_[_0x529f('0x36')](_0x46926b[_0x529f('0x31')],_0x46926b[_0x529f('0x33')]);_0x147238['attributes']=_[_0x529f('0x36')](_0x46926b[_0x529f('0x31')],qs[_0x529f('0x37')](_0x4bfa40['query'][_0x529f('0x37')]));_0x147238[_0x529f('0x35')]=_0x147238[_0x529f('0x35')][_0x529f('0x46')]?_0x147238['attributes']:_0x46926b[_0x529f('0x31')];if(_0x4bfa40[_0x529f('0x33')][_0x529f('0x41')]){_0x147238[_0x529f('0x42')]=[{'all':!![]}];}_0x147238=_[_0x529f('0x47')]({},_0x147238,_0x4bfa40[_0x529f('0x40')]);return db[_0x529f('0x2d')][_0x529f('0x48')](_0x147238)[_0x529f('0x29')](handleEntityNotFound(_0x1414a5,null))['then'](respondWithResult(_0x1414a5,null))[_0x529f('0x49')](handleError(_0x1414a5,null));};exports['create']=function(_0x4b476d,_0x534f8e){return db[_0x529f('0x2d')][_0x529f('0x4a')](_0x4b476d[_0x529f('0x4b')],{})[_0x529f('0x29')](function(_0x332457){var _0x5def85=_0x4b476d[_0x529f('0x4c')][_0x529f('0x4d')]({'plain':!![]});if(!_0x5def85)throw new Error(_0x529f('0x4e'));if(_0x5def85['role']===_0x529f('0x4c')){var _0x483ec7=_0x332457[_0x529f('0x4d')]({'plain':!![]});var _0x4ce297=_0x529f('0x4f');return db['UserProfileSection']['find']({'where':{'name':_0x4ce297,'userProfileId':_0x5def85[_0x529f('0x50')]},'raw':!![]})[_0x529f('0x29')](function(_0x491aaf){if(_0x491aaf&&_0x491aaf[_0x529f('0x51')]===0x0){return db[_0x529f('0x52')][_0x529f('0x4a')]({'name':_0x483ec7['name'],'resourceId':_0x483ec7['id'],'type':_0x491aaf['name'],'sectionId':_0x491aaf['id']},{})[_0x529f('0x29')](function(){return _0x332457;});}else{return _0x332457;}})[_0x529f('0x49')](function(_0x320e1a){logger[_0x529f('0x2a')](_0x529f('0x53'),_0x320e1a);throw _0x320e1a;});}return _0x332457;})[_0x529f('0x29')](respondWithResult(_0x534f8e,0xc9))[_0x529f('0x49')](handleError(_0x534f8e,null));};exports['update']=function(_0x5044ae,_0x365088){if(_0x5044ae[_0x529f('0x4b')]['id']){delete _0x5044ae['body']['id'];}return db[_0x529f('0x2d')]['find']({'where':{'id':_0x5044ae[_0x529f('0x45')]['id']}})[_0x529f('0x29')](handleEntityNotFound(_0x365088,null))[_0x529f('0x29')](saveUpdates(_0x5044ae[_0x529f('0x4b')],null))[_0x529f('0x29')](respondWithResult(_0x365088,null))[_0x529f('0x49')](handleError(_0x365088,null));};exports[_0x529f('0x54')]=function(_0x211cf6,_0x5413ff){var _0x4dd668=_0x211cf6[_0x529f('0x45')]['id'];var _0x2db0d6=[];return db[_0x529f('0x55')][_0x529f('0x56')](function(_0xab075f){var _0x4d0205=_0x529f('0x57')+_0x4dd668;return db[_0x529f('0x55')][_0x529f('0x33')](_0x4d0205,{'type':db[_0x529f('0x58')][_0x529f('0x59')][_0x529f('0x5a')],'raw':!![],'transaction':_0xab075f})['then'](function(_0x7ffddd){_0x2db0d6=_[_0x529f('0x32')](_0x7ffddd,function(_0x3e487b){return Number(_0x3e487b[_0x529f('0x5b')]);});})[_0x529f('0x29')](function(){var _0x17b4b5=_0x529f('0x5c')+_0x4dd668;return db[_0x529f('0x55')]['query'](_0x17b4b5,{'type':db['Sequelize'][_0x529f('0x59')][_0x529f('0x5a')],'raw':!![],'transaction':_0xab075f});})[_0x529f('0x29')](function(_0x2f65c8){var _0x14c4f1=_[_0x529f('0x32')](_0x2f65c8,function(_0x5ba69d){return Number(_0x5ba69d[_0x529f('0x5d')]);});return db[_0x529f('0x5e')][_0x529f('0x54')]({'where':{'UserId':{'$in':_0x2db0d6},'VoiceQueueId':{'$in':_0x14c4f1}},'transaction':_0xab075f});})[_0x529f('0x29')](function(){var _0x5d9bff=_0x529f('0x5f')+_0x4dd668;return db[_0x529f('0x55')]['query'](_0x5d9bff,{'type':db[_0x529f('0x58')]['QueryTypes'][_0x529f('0x5a')],'raw':!![],'transaction':_0xab075f});})[_0x529f('0x29')](function(_0x5477e6){var _0x5e8b2b=_[_0x529f('0x32')](_0x5477e6,function(_0x57ecf4){return Number(_0x57ecf4[_0x529f('0x60')]);});return db[_0x529f('0x61')][_0x529f('0x54')]({'where':{'UserId':{'$in':_0x2db0d6},'MailQueueId':{'$in':_0x5e8b2b}},'transaction':_0xab075f});})[_0x529f('0x29')](function(){var _0x48e05e=_0x529f('0x62')+_0x4dd668;return db[_0x529f('0x55')]['query'](_0x48e05e,{'type':db[_0x529f('0x58')][_0x529f('0x59')][_0x529f('0x5a')],'raw':!![],'transaction':_0xab075f});})[_0x529f('0x29')](function(_0x1d543a){var _0xf095c2=_[_0x529f('0x32')](_0x1d543a,function(_0xe352f4){return Number(_0xe352f4[_0x529f('0x63')]);});return db[_0x529f('0x64')][_0x529f('0x54')]({'where':{'UserId':{'$in':_0x2db0d6},'SmsQueueId':{'$in':_0xf095c2}},'transaction':_0xab075f});})['then'](function(){var _0x4791ab='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4dd668;return db[_0x529f('0x55')][_0x529f('0x33')](_0x4791ab,{'type':db['Sequelize']['QueryTypes'][_0x529f('0x5a')],'raw':!![],'transaction':_0xab075f});})[_0x529f('0x29')](function(_0x4c8000){var _0x4d37cb=_[_0x529f('0x32')](_0x4c8000,function(_0x438c06){return Number(_0x438c06['ChatQueueId']);});return db[_0x529f('0x65')][_0x529f('0x54')]({'where':{'UserId':{'$in':_0x2db0d6},'ChatQueueId':{'$in':_0x4d37cb}},'transaction':_0xab075f});})['then'](function(){var _0x479900=_0x529f('0x66')+_0x4dd668;return db['sequelize'][_0x529f('0x33')](_0x479900,{'type':db['Sequelize']['QueryTypes'][_0x529f('0x5a')],'raw':!![],'transaction':_0xab075f});})['then'](function(_0x33ef7d){var _0xc853ca=_[_0x529f('0x32')](_0x33ef7d,function(_0xd1a964){return Number(_0xd1a964[_0x529f('0x67')]);});return db[_0x529f('0x68')][_0x529f('0x54')]({'where':{'UserId':{'$in':_0x2db0d6},'FaxQueueId':{'$in':_0xc853ca}},'transaction':_0xab075f});})[_0x529f('0x29')](function(){var _0xa79758='SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20'+_0x4dd668;return db[_0x529f('0x55')]['query'](_0xa79758,{'type':db['Sequelize'][_0x529f('0x59')][_0x529f('0x5a')],'raw':!![],'transaction':_0xab075f});})[_0x529f('0x29')](function(_0x543950){var _0x12b6aa=_['map'](_0x543950,function(_0x491169){return Number(_0x491169['OpenchannelQueueId']);});return db[_0x529f('0x69')][_0x529f('0x54')]({'where':{'UserId':{'$in':_0x2db0d6},'OpenchannelQueueId':{'$in':_0x12b6aa}},'transaction':_0xab075f});})[_0x529f('0x29')](function(){var _0x1be5d3=_0x529f('0x6a')+_0x4dd668;return db[_0x529f('0x55')][_0x529f('0x33')](_0x1be5d3,{'type':db[_0x529f('0x58')]['QueryTypes'][_0x529f('0x5a')],'raw':!![],'transaction':_0xab075f});})[_0x529f('0x29')](function(_0x2bded7){var _0x5d1f9b=_[_0x529f('0x32')](_0x2bded7,function(_0x259288){return Number(_0x259288['WhatsappQueueId']);});return db[_0x529f('0x6b')][_0x529f('0x54')]({'where':{'UserId':{'$in':_0x2db0d6},'WhatsappQueueId':{'$in':_0x5d1f9b}},'transaction':_0xab075f});})['then'](function(){return db[_0x529f('0x6c')][_0x529f('0x48')]({'where':{'TeamId':_0x4dd668}});})['then'](function(_0x4ae59e){if(_0x4ae59e===null){return;}return db[_0x529f('0x6d')]['destroy']({'where':{'UserId':{'$in':_0x2db0d6},'VoicePrefixId':_0x4ae59e['VoicePrefixId']},'transaction':_0xab075f});})['then'](function(){return db['Team']['destroy']({'where':{'id':_0x4dd668},'cascade':!![],'transaction':_0xab075f});})[_0x529f('0x29')](function(_0x5c1837){if(_0x5c1837===0x0){_0x5413ff['sendStatus'](0x194);}else{return db[_0x529f('0x52')][_0x529f('0x54')]({'where':{'type':_0x529f('0x4f'),'resourceId':_0x4dd668},'cascade':!![],'transaction':_0xab075f})[_0x529f('0x29')](function(){_0x5413ff[_0x529f('0x21')](0xcc)[_0x529f('0x22')]();});}})[_0x529f('0x49')](function(_0x30a800){_0x5413ff['status'](0x1f4)[_0x529f('0x6e')](_0x30a800);});});};exports['getQueues']=function(_0x533107,_0x43b795,_0x40da34){return db[_0x529f('0x2d')]['findOne']({'where':{'id':_0x533107[_0x529f('0x45')]['id']}})[_0x529f('0x29')](handleEntityNotFound(_0x43b795,null))[_0x529f('0x29')](function(_0x9c43a5){if(!_0x533107['query'][_0x529f('0x6f')]||!utils[_0x529f('0x70')](_0x533107[_0x529f('0x33')][_0x529f('0x6f')])){throw new db[(_0x529f('0x58'))]['ValidationError'](_0x529f('0x71'));}var _0x2cde23={};var _0x3ac992={};_0x3ac992[_0x529f('0x31')]=_[_0x529f('0x34')](db[_[_0x529f('0x72')](_0x533107[_0x529f('0x33')]['channel'][_0x529f('0x73')]())+_0x529f('0x74')][_0x529f('0x75')]);_0x3ac992['query']=_[_0x529f('0x34')](_0x533107[_0x529f('0x33')]);_0x3ac992['filters']=_[_0x529f('0x36')](_0x3ac992[_0x529f('0x31')],_0x3ac992[_0x529f('0x33')]);_0x2cde23[_0x529f('0x35')]=_['intersection'](_0x3ac992[_0x529f('0x31')],qs[_0x529f('0x37')](_0x533107[_0x529f('0x33')][_0x529f('0x37')]));_0x2cde23['attributes']=_0x2cde23[_0x529f('0x35')][_0x529f('0x46')]?_0x2cde23[_0x529f('0x35')]:_0x3ac992[_0x529f('0x31')];_0x2cde23[_0x529f('0x24')]=qs[_0x529f('0x24')](_0x533107[_0x529f('0x33')][_0x529f('0x24')]);_0x2cde23['offset']=qs[_0x529f('0x26')](_0x533107['query'][_0x529f('0x26')]);_0x2cde23['order']=qs[_0x529f('0x3b')](_0x533107[_0x529f('0x33')][_0x529f('0x3b')]);_0x2cde23[_0x529f('0x3e')]=qs[_0x529f('0x3c')](_[_0x529f('0x3d')](_0x533107['query'],_0x3ac992[_0x529f('0x3c')]));_0x2cde23=_['merge']({},_0x2cde23,_0x533107[_0x529f('0x40')]);return _0x9c43a5[_0x529f('0x4d')+_[_0x529f('0x72')](_0x533107[_0x529f('0x33')][_0x529f('0x6f')][_0x529f('0x73')]())+_0x529f('0x76')](_0x2cde23);})[_0x529f('0x29')](respondWithResult(_0x43b795,null))[_0x529f('0x49')](handleError(_0x43b795,null));};exports[_0x529f('0x77')]=function(_0x135769,_0x45737d,_0x274738){return db[_0x529f('0x2d')][_0x529f('0x78')]({'where':{'id':_0x135769['params']['id']}})['then'](function(_0x2e34ba){if(_0x2e34ba){if(!_0x135769[_0x529f('0x4b')][_0x529f('0x6f')]||!utils[_0x529f('0x70')](_0x135769[_0x529f('0x4b')][_0x529f('0x6f')])){throw new db[(_0x529f('0x58'))][(_0x529f('0x79'))](_0x529f('0x71'));}return _0x2e34ba['add'+_[_0x529f('0x72')](_0x135769[_0x529f('0x4b')][_0x529f('0x6f')]['toLowerCase']())+_0x529f('0x76')](_0x135769[_0x529f('0x4b')][_0x529f('0x7a')]);}return null;})['then'](handleEntityNotFound(_0x45737d,null))[_0x529f('0x29')](respondWithStatusCode(_0x45737d,null))[_0x529f('0x49')](handleError(_0x45737d,null));};exports[_0x529f('0x7b')]=function(_0x40788c,_0x69a984,_0x4bb6bf){return db[_0x529f('0x2d')][_0x529f('0x78')]({'where':{'id':_0x40788c[_0x529f('0x45')]['id']}})[_0x529f('0x29')](function(_0x306a13){if(_0x306a13){if(!_0x40788c[_0x529f('0x33')][_0x529f('0x6f')]||!utils['isValidChannel'](_0x40788c[_0x529f('0x33')][_0x529f('0x6f')])){throw new db[(_0x529f('0x58'))][(_0x529f('0x79'))](_0x529f('0x71'));}return _0x306a13[_0x529f('0x7c')+_['capitalize'](_0x40788c[_0x529f('0x33')]['channel']['toLowerCase']())+_0x529f('0x76')](_0x40788c[_0x529f('0x33')][_0x529f('0x7a')]);}return null;})[_0x529f('0x29')](handleEntityNotFound(_0x69a984,null))['then'](respondWithStatusCode(_0x69a984,null))['catch'](handleError(_0x69a984,null));};exports[_0x529f('0x7d')]=function(_0x29cc35,_0x342816){var _0x458ada=_[_0x529f('0x7e')](_0x29cc35[_0x529f('0x4b')][_0x529f('0x7a')])?_0x29cc35[_0x529f('0x4b')][_0x529f('0x7a')]:[_0x29cc35[_0x529f('0x4b')][_0x529f('0x7a')]];var _0x1e2a4f=_0x29cc35[_0x529f('0x45')]['id'];return db['Team'][_0x529f('0x48')]({'where':{'id':_0x1e2a4f}})[_0x529f('0x29')](handleEntityNotFound(_0x342816,null))[_0x529f('0x29')](function(_0xae677e){if(_0xae677e){var _0x537896=[_0x529f('0x7f'),'Chat',_0x529f('0x80'),_0x529f('0x81'),'Fax','Openchannel',_0x529f('0x82')];return db[_0x529f('0x55')][_0x529f('0x56')](function(_0x2df48c){var _0x2e28a8=_[_0x529f('0x32')](_0x537896,function(_0x3667e3){var _0x51cd29={'attributes':['id',_0x529f('0x2b')]};if(_0x3667e3===_0x529f('0x7f')){_0x51cd29[_0x529f('0x83')]={'attributes':[_0x529f('0x84')]};}return _0xae677e[_0x529f('0x4d')+_0x3667e3+_0x529f('0x76')](_0x51cd29)[_0x529f('0x29')](function(_0x2b7963){var _0x2ebadc=_[_0x529f('0x32')](_0x2b7963,function(_0x38d051){var _0x3bfe83=_[_0x529f('0x32')](_0x458ada,function(_0x39dc78){var _0xc6486b={'where':{'UserId':_0x39dc78,[_0x3667e3+_0x529f('0x85')]:_0x38d051['id']},'transaction':_0x2df48c};if(_0x3667e3==='Voice'){_0xc6486b[_0x529f('0x1b')]={'penalty':_0x38d051[_0x529f('0x86')]['penalty']};}return db[_0x529f('0x87')+_0x3667e3+_0x529f('0x74')]['findOrCreate'](_0xc6486b)[_0x529f('0x29')](function(){socket[_0x529f('0x88')]('user'+_0x3667e3+_0x529f('0x89'),{'UserId':_0x39dc78,[_0x3667e3+_0x529f('0x85')]:_0x38d051['id']});if(_0x3667e3!==_0x529f('0x7f')){return;}return db[_0x529f('0x87')][_0x529f('0x43')]({'where':{'id':_0x458ada,'online':0x1},'attributes':['id',_0x529f('0x2b'),_0x529f('0x8a'),'voicePause',_0x529f('0x8b')],'raw':!![]})[_0x529f('0x29')](function(_0x31f645){var _0x26fad8=_[_0x529f('0x32')](_0x31f645,function(_0x205065){return db[_0x529f('0x8c')][_0x529f('0x8d')]({'membername':_0x205065['name'],'UserId':_0x205065['id'],'queue_name':_0x38d051[_0x529f('0x2b')],'VoiceQueueId':_0x38d051['id'],'interface':_[_0x529f('0x8e')](_0x205065[_0x529f('0x8b')])?util['format']('SIP/%s',_0x205065[_0x529f('0x2b')]):_0x205065[_0x529f('0x8b')],'paused':_0x205065[_0x529f('0x8f')]||![],'penalty':_0x38d051['TeamVoiceQueue'][_0x529f('0x84')]},{'transaction':_0x2df48c});});return Promise[_0x529f('0x90')](_0x26fad8);});});});return Promise[_0x529f('0x90')](_0x3bfe83);});return Promise['all'](_0x2ebadc);})[_0x529f('0x29')](function(){return db['TeamVoicePrefix']['findOne']({'where':{'teamId':_0x1e2a4f}})['then'](function(_0x185b72){if(_0x185b72){var _0x5a7b8c=_['map'](_0x458ada,function(_0x963c63){db[_0x529f('0x6d')][_0x529f('0x8d')]({'UserId':_0x963c63,'VoicePrefixId':_0x185b72[_0x529f('0x91')]});});return Promise[_0x529f('0x90')](_0x5a7b8c);}});});});return Promise[_0x529f('0x90')](_0x2e28a8)['then'](function(){return _0xae677e[_0x529f('0x7d')](_0x458ada,{'transaction':_0x2df48c})[_0x529f('0x92')](function(_0x464c19){return _0x464c19;});});});}})[_0x529f('0x29')](respondWithResult(_0x342816,null))[_0x529f('0x49')](handleError(_0x342816,null));};exports[_0x529f('0x93')]=function(_0x2aa253,_0x4cded4){var _0xaeaeba=_[_0x529f('0x7e')](_0x2aa253['query'][_0x529f('0x7a')])?_0x2aa253[_0x529f('0x33')][_0x529f('0x7a')]:[_0x2aa253[_0x529f('0x33')]['ids']];var _0xd54448=_0x2aa253['params']['id'];return db[_0x529f('0x2d')][_0x529f('0x48')]({'where':{'id':_0xd54448}})[_0x529f('0x29')](handleEntityNotFound(_0x4cded4,null))[_0x529f('0x29')](function(_0x21b2f4){if(_0x21b2f4){var _0x4bcbc8=[_0x529f('0x7f'),_0x529f('0x94'),'Mail',_0x529f('0x81'),'Fax',_0x529f('0x95'),_0x529f('0x82')];return db[_0x529f('0x55')][_0x529f('0x56')](function(_0xe660a4){var _0x3dd7f3=_[_0x529f('0x32')](_0x4bcbc8,function(_0x1708be){var _0x204394={'attributes':['id',_0x529f('0x2b')]};return _0x21b2f4[_0x529f('0x4d')+_0x1708be+'Queues'](_0x204394)[_0x529f('0x29')](function(_0xf4183){var _0x16a811=_[_0x529f('0x32')](_0xf4183,function(_0x1cf5ae){return _0x1cf5ae['removeAgents'](_0xaeaeba,{'transaction':_0xe660a4})[_0x529f('0x29')](function(){var _0x424c27=_['map'](_0xaeaeba,function(_0x43172b){socket['emit'](_0x529f('0x4c')+_0x1708be+_0x529f('0x96'),{'UserId':Number(_0x43172b),[_0x1708be+_0x529f('0x85')]:_0x1cf5ae['id']});if(_0x1708be!==_0x529f('0x7f')){return;}return db[_0x529f('0x8c')]['destroy']({'where':{'VoiceQueueId':_0x1cf5ae['id'],'UserId':_0x43172b},'transaction':_0xe660a4});});return Promise[_0x529f('0x90')](_0x424c27);});});return Promise[_0x529f('0x90')](_0x16a811);});});return Promise['all'](_0x3dd7f3)[_0x529f('0x29')](function(){return _0x21b2f4[_0x529f('0x93')](_0xaeaeba,{'transaction':_0xe660a4});})[_0x529f('0x29')](function(){return db['TeamVoicePrefix'][_0x529f('0x78')]({'where':{'teamId':_0xd54448}})[_0x529f('0x29')](function(_0x28e15f){if(_0x28e15f){var _0x3f1b0a=_[_0x529f('0x32')](_0xaeaeba,function(_0x315d16){db[_0x529f('0x6d')][_0x529f('0x54')]({'where':{'UserId':_0x315d16,'VoicePrefixId':_0x28e15f[_0x529f('0x91')]}});});return Promise[_0x529f('0x90')](_0x3f1b0a);}});});});}})['then'](respondWithStatusCode(_0x4cded4,null))[_0x529f('0x49')](handleError(_0x4cded4,null));};exports[_0x529f('0x97')]=function(_0x54af22,_0x385baa,_0xb0dd65){var _0x1eef02={};var _0x40ce20={};var _0x48de07;var _0xca906b;return db[_0x529f('0x2d')]['findOne']({'where':{'id':_0x54af22['params']['id']}})[_0x529f('0x29')](handleEntityNotFound(_0x385baa,null))[_0x529f('0x29')](function(_0x5b3e23){if(_0x5b3e23){_0x48de07=_0x5b3e23;_0x40ce20['model']=_[_0x529f('0x34')](db[_0x529f('0x87')][_0x529f('0x75')]);_0x40ce20[_0x529f('0x33')]=_[_0x529f('0x34')](_0x54af22[_0x529f('0x33')]);_0x40ce20[_0x529f('0x3c')]=_[_0x529f('0x36')](_0x40ce20['model'],_0x40ce20['query']);_0x1eef02[_0x529f('0x35')]=_['intersection'](_0x40ce20[_0x529f('0x31')],qs[_0x529f('0x37')](_0x54af22[_0x529f('0x33')]['fields']));_0x1eef02['attributes']=_0x1eef02[_0x529f('0x35')][_0x529f('0x46')]?_0x1eef02[_0x529f('0x35')]:_0x40ce20[_0x529f('0x31')];_0x1eef02[_0x529f('0x3a')]=qs[_0x529f('0x3b')](_0x54af22[_0x529f('0x33')][_0x529f('0x3b')]);_0x1eef02[_0x529f('0x3e')]=qs[_0x529f('0x3c')](_[_0x529f('0x3d')](_0x54af22[_0x529f('0x33')],_0x40ce20[_0x529f('0x3c')]));if(_0x54af22[_0x529f('0x33')][_0x529f('0x98')]){_0x1eef02['where']=_[_0x529f('0x47')](_0x1eef02['where'],{'$or':_[_0x529f('0x32')](_0x1eef02['attributes'],function(_0x48677d){var _0x40ed05={};_0x40ed05[_0x48677d]={'$like':'%'+_0x54af22[_0x529f('0x33')]['filter']+'%'};return _0x40ed05;})});}_0x1eef02=_[_0x529f('0x47')]({},_0x1eef02,_0x54af22[_0x529f('0x40')]);return _0x48de07['getAgents'](_0x1eef02);}})[_0x529f('0x29')](function(_0x392c7a){if(_0x392c7a){_0xca906b=_0x392c7a['length'];if(!_0x54af22[_0x529f('0x33')][_0x529f('0x38')]('nolimit')){_0x1eef02[_0x529f('0x24')]=qs[_0x529f('0x24')](_0x54af22[_0x529f('0x33')][_0x529f('0x24')]);_0x1eef02[_0x529f('0x26')]=qs[_0x529f('0x26')](_0x54af22[_0x529f('0x33')][_0x529f('0x26')]);}return _0x48de07['getAgents'](_0x1eef02);}})[_0x529f('0x29')](function(_0x17aa20){if(_0x17aa20){return _0x17aa20?{'count':_0xca906b,'rows':_0x17aa20}:null;}})[_0x529f('0x29')](respondWithResult(_0x385baa,null))[_0x529f('0x49')](handleError(_0x385baa,null));}; \ No newline at end of file +var _0xcfb3=['../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./team.socket','status','end','offset','count','set','Content-Range','json','apply','reject','update','then','sendStatus','error','name','index','map','Team','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','show','includeAll','options','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','sequelize','Sequelize','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','QueryTypes','SELECT','VoiceQueueId','UserVoiceQueue','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','UserMailQueue','destroy','UserSmsQueue','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','OpenchannelQueueId','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','send','getQueues','params','isValidChannel','channel','ValidationError','toLowerCase','Queue','length','capitalize','addQueues','Unknown\x20channel','add','ids','removeQueues','remove','addAgents','isArray','Voice','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','through','penalty','Queues','QueueId','TeamVoiceQueue','findOrCreate','Queue:save','User','findAll','interface','UserVoiceQueueRt','upsert','isNil','format','voicePause','all','findOne','spread','removeAgents','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x3cb30b,_0x504b3e){var _0x2ca717=function(_0x32a3d9){while(--_0x32a3d9){_0x3cb30b['push'](_0x3cb30b['shift']());}};_0x2ca717(++_0x504b3e);}(_0xcfb3,0x87));var _0x3cfb=function(_0x1c3132,_0xfb131a){_0x1c3132=_0x1c3132-0x0;var _0x5cb330=_0xcfb3[_0x1c3132];return _0x5cb330;};'use strict';var emlformat=require(_0x3cfb('0x0'));var rimraf=require(_0x3cfb('0x1'));var zipdir=require(_0x3cfb('0x2'));var jsonpatch=require(_0x3cfb('0x3'));var rp=require(_0x3cfb('0x4'));var moment=require(_0x3cfb('0x5'));var BPromise=require(_0x3cfb('0x6'));var Mustache=require(_0x3cfb('0x7'));var util=require('util');var path=require(_0x3cfb('0x8'));var sox=require(_0x3cfb('0x9'));var csv=require(_0x3cfb('0xa'));var ejs=require(_0x3cfb('0xb'));var fs=require('fs');var fs_extra=require(_0x3cfb('0xc'));var _=require(_0x3cfb('0xd'));var squel=require(_0x3cfb('0xe'));var crypto=require(_0x3cfb('0xf'));var jsforce=require(_0x3cfb('0x10'));var deskjs=require(_0x3cfb('0x11'));var toCsv=require(_0x3cfb('0xa'));var querystring=require(_0x3cfb('0x12'));var Papa=require(_0x3cfb('0x13'));var Redis=require(_0x3cfb('0x14'));var authService=require(_0x3cfb('0x15'));var qs=require(_0x3cfb('0x16'));var as=require(_0x3cfb('0x17'));var hardwareService=require(_0x3cfb('0x18'));var logger=require('../../config/logger')(_0x3cfb('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3cfb('0x1a'));var db=require(_0x3cfb('0x1b'))['db'];config['redis']=_[_0x3cfb('0x1c')](config['redis'],{'host':_0x3cfb('0x1d'),'port':0x18eb});var socket=require(_0x3cfb('0x1e'))(new Redis(config[_0x3cfb('0x1f')]));require(_0x3cfb('0x20'))['register'](socket);function respondWithStatusCode(_0x501e8f,_0x3af7be){_0x3af7be=_0x3af7be||0xcc;return function(_0x5a5e44){if(_0x5a5e44){return _0x501e8f['sendStatus'](_0x3af7be);}return _0x501e8f[_0x3cfb('0x21')](_0x3af7be)[_0x3cfb('0x22')]();};}function respondWithResult(_0x1af06e,_0x538df6){_0x538df6=_0x538df6||0xc8;return function(_0x48b7d6){if(_0x48b7d6){return _0x1af06e[_0x3cfb('0x21')](_0x538df6)['json'](_0x48b7d6);}};}function respondWithFilteredResult(_0x3dddfe,_0x35c7ac){return function(_0x5df646){if(_0x5df646){var _0x2af858=typeof _0x35c7ac[_0x3cfb('0x23')]==='undefined'&&typeof _0x35c7ac['limit']==='undefined';var _0x5d3e27=_0x5df646[_0x3cfb('0x24')];var _0x367818=_0x2af858?0x0:_0x35c7ac[_0x3cfb('0x23')];var _0x4a40ef=_0x2af858?_0x5df646[_0x3cfb('0x24')]:_0x35c7ac[_0x3cfb('0x23')]+_0x35c7ac['limit'];var _0x11b894;if(_0x4a40ef>=_0x5d3e27){_0x4a40ef=_0x5d3e27;_0x11b894=0xc8;}else{_0x11b894=0xce;}_0x3dddfe[_0x3cfb('0x21')](_0x11b894);return _0x3dddfe[_0x3cfb('0x25')](_0x3cfb('0x26'),_0x367818+'-'+_0x4a40ef+'/'+_0x5d3e27)[_0x3cfb('0x27')](_0x5df646);}return null;};}function patchUpdates(_0x559d31){return function(_0xf39fab){try{jsonpatch[_0x3cfb('0x28')](_0xf39fab,_0x559d31,!![]);}catch(_0x3bf17b){return BPromise[_0x3cfb('0x29')](_0x3bf17b);}return _0xf39fab['save']();};}function saveUpdates(_0x4af711,_0x4d89d7){return function(_0x53f544){if(_0x53f544){return _0x53f544[_0x3cfb('0x2a')](_0x4af711)[_0x3cfb('0x2b')](function(_0x4b5196){return _0x4b5196;});}return null;};}function handleEntityNotFound(_0x5955d0,_0x2f20f7){return function(_0x3cc1b6){if(!_0x3cc1b6){_0x5955d0[_0x3cfb('0x2c')](0x194);}return _0x3cc1b6;};}function handleError(_0x521a0d,_0x1019f8){_0x1019f8=_0x1019f8||0x1f4;return function(_0xf502c8){logger[_0x3cfb('0x2d')](_0xf502c8['stack']);if(_0xf502c8[_0x3cfb('0x2e')]){delete _0xf502c8[_0x3cfb('0x2e')];}_0x521a0d['status'](_0x1019f8)['send'](_0xf502c8);};}exports[_0x3cfb('0x2f')]=function(_0x444cf9,_0x22cd56){var _0x145db0={},_0x3262a1={},_0x9bce25={'count':0x0,'rows':[]};var _0x73c50d=_[_0x3cfb('0x30')](db[_0x3cfb('0x31')][_0x3cfb('0x32')],function(_0x2049a4){return{'name':_0x2049a4[_0x3cfb('0x33')],'type':_0x2049a4[_0x3cfb('0x34')][_0x3cfb('0x35')]};});_0x3262a1['model']=_[_0x3cfb('0x30')](_0x73c50d,'name');_0x3262a1[_0x3cfb('0x36')]=_[_0x3cfb('0x37')](_0x444cf9['query']);_0x3262a1[_0x3cfb('0x38')]=_[_0x3cfb('0x39')](_0x3262a1[_0x3cfb('0x3a')],_0x3262a1[_0x3cfb('0x36')]);_0x145db0['attributes']=_['intersection'](_0x3262a1[_0x3cfb('0x3a')],qs['fields'](_0x444cf9[_0x3cfb('0x36')][_0x3cfb('0x3b')]));_0x145db0[_0x3cfb('0x3c')]=_0x145db0[_0x3cfb('0x3c')]['length']?_0x145db0['attributes']:_0x3262a1['model'];if(!_0x444cf9[_0x3cfb('0x36')][_0x3cfb('0x3d')]('nolimit')){_0x145db0[_0x3cfb('0x3e')]=qs[_0x3cfb('0x3e')](_0x444cf9['query']['limit']);_0x145db0['offset']=qs[_0x3cfb('0x23')](_0x444cf9[_0x3cfb('0x36')][_0x3cfb('0x23')]);}_0x145db0[_0x3cfb('0x3f')]=qs[_0x3cfb('0x40')](_0x444cf9[_0x3cfb('0x36')][_0x3cfb('0x40')]);_0x145db0[_0x3cfb('0x41')]=qs[_0x3cfb('0x38')](_[_0x3cfb('0x42')](_0x444cf9[_0x3cfb('0x36')],_0x3262a1[_0x3cfb('0x38')]),_0x73c50d);if(_0x444cf9[_0x3cfb('0x36')][_0x3cfb('0x43')]){_0x145db0[_0x3cfb('0x41')]=_[_0x3cfb('0x44')](_0x145db0[_0x3cfb('0x41')],{'$or':_[_0x3cfb('0x30')](_0x73c50d,function(_0x25c111){if(_0x25c111[_0x3cfb('0x34')]!==_0x3cfb('0x45')){var _0x3fd6c8={};_0x3fd6c8[_0x25c111['name']]={'$like':'%'+_0x444cf9[_0x3cfb('0x36')][_0x3cfb('0x43')]+'%'};return _0x3fd6c8;}})});}_0x145db0=_[_0x3cfb('0x44')]({},_0x145db0,_0x444cf9['options']);var _0x2900a4={'where':_0x145db0[_0x3cfb('0x41')]};return db['Team'][_0x3cfb('0x24')](_0x2900a4)[_0x3cfb('0x2b')](function(_0x11baee){_0x9bce25[_0x3cfb('0x24')]=_0x11baee;if(_0x444cf9['query']['includeAll']){_0x145db0[_0x3cfb('0x46')]=[{'all':!![]}];}return db['Team']['findAll'](_0x145db0);})[_0x3cfb('0x2b')](function(_0x125258){_0x9bce25[_0x3cfb('0x47')]=_0x125258;return _0x9bce25;})[_0x3cfb('0x2b')](respondWithFilteredResult(_0x22cd56,_0x145db0))['catch'](handleError(_0x22cd56,null));};exports[_0x3cfb('0x48')]=function(_0x146f45,_0x1002d9){var _0x57894c={'raw':![],'where':{'id':_0x146f45['params']['id']}},_0x3f7d77={};_0x3f7d77[_0x3cfb('0x3a')]=_[_0x3cfb('0x37')](db['Team'][_0x3cfb('0x32')]);_0x3f7d77[_0x3cfb('0x36')]=_[_0x3cfb('0x37')](_0x146f45['query']);_0x3f7d77[_0x3cfb('0x38')]=_['intersection'](_0x3f7d77[_0x3cfb('0x3a')],_0x3f7d77[_0x3cfb('0x36')]);_0x57894c[_0x3cfb('0x3c')]=_[_0x3cfb('0x39')](_0x3f7d77[_0x3cfb('0x3a')],qs[_0x3cfb('0x3b')](_0x146f45['query'][_0x3cfb('0x3b')]));_0x57894c[_0x3cfb('0x3c')]=_0x57894c['attributes']['length']?_0x57894c[_0x3cfb('0x3c')]:_0x3f7d77['model'];if(_0x146f45[_0x3cfb('0x36')][_0x3cfb('0x49')]){_0x57894c[_0x3cfb('0x46')]=[{'all':!![]}];}_0x57894c=_[_0x3cfb('0x44')]({},_0x57894c,_0x146f45[_0x3cfb('0x4a')]);return db[_0x3cfb('0x31')][_0x3cfb('0x4b')](_0x57894c)['then'](handleEntityNotFound(_0x1002d9,null))[_0x3cfb('0x2b')](respondWithResult(_0x1002d9,null))[_0x3cfb('0x4c')](handleError(_0x1002d9,null));};exports['create']=function(_0x384b51,_0x528f88){return db[_0x3cfb('0x31')][_0x3cfb('0x4d')](_0x384b51['body'],{})[_0x3cfb('0x2b')](function(_0x417e99){var _0x5286a8=_0x384b51['user'][_0x3cfb('0x4e')]({'plain':!![]});if(!_0x5286a8)throw new Error(_0x3cfb('0x4f'));if(_0x5286a8[_0x3cfb('0x50')]===_0x3cfb('0x51')){var _0x4806c2=_0x417e99[_0x3cfb('0x4e')]({'plain':!![]});var _0x18f7ca=_0x3cfb('0x52');return db[_0x3cfb('0x53')][_0x3cfb('0x4b')]({'where':{'name':_0x18f7ca,'userProfileId':_0x5286a8[_0x3cfb('0x54')]},'raw':!![]})[_0x3cfb('0x2b')](function(_0x41e28f){if(_0x41e28f&&_0x41e28f[_0x3cfb('0x55')]===0x0){return db[_0x3cfb('0x56')][_0x3cfb('0x4d')]({'name':_0x4806c2['name'],'resourceId':_0x4806c2['id'],'type':_0x41e28f[_0x3cfb('0x2e')],'sectionId':_0x41e28f['id']},{})[_0x3cfb('0x2b')](function(){return _0x417e99;});}else{return _0x417e99;}})['catch'](function(_0xf1134a){logger['error'](_0x3cfb('0x57'),_0xf1134a);throw _0xf1134a;});}return _0x417e99;})['then'](respondWithResult(_0x528f88,0xc9))[_0x3cfb('0x4c')](handleError(_0x528f88,null));};exports['update']=function(_0x39ace2,_0x49e0d4){if(_0x39ace2[_0x3cfb('0x58')]['id']){delete _0x39ace2['body']['id'];}return db['Team'][_0x3cfb('0x4b')]({'where':{'id':_0x39ace2['params']['id']}})[_0x3cfb('0x2b')](handleEntityNotFound(_0x49e0d4,null))[_0x3cfb('0x2b')](saveUpdates(_0x39ace2['body'],null))[_0x3cfb('0x2b')](respondWithResult(_0x49e0d4,null))[_0x3cfb('0x4c')](handleError(_0x49e0d4,null));};exports['destroy']=function(_0x5341df,_0x263f14){var _0x2355a4=_0x5341df['params']['id'];var _0xd7e25a=[];return db['sequelize']['transaction'](function(_0x4e25da){var _0x12cb7d='SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20'+_0x2355a4;return db[_0x3cfb('0x59')][_0x3cfb('0x36')](_0x12cb7d,{'type':db[_0x3cfb('0x5a')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x4e25da})[_0x3cfb('0x2b')](function(_0xc8b98a){_0xd7e25a=_[_0x3cfb('0x30')](_0xc8b98a,function(_0x11e7f6){return Number(_0x11e7f6[_0x3cfb('0x5b')]);});})[_0x3cfb('0x2b')](function(){var _0x579c13=_0x3cfb('0x5c')+_0x2355a4;return db[_0x3cfb('0x59')]['query'](_0x579c13,{'type':db[_0x3cfb('0x5a')][_0x3cfb('0x5d')][_0x3cfb('0x5e')],'raw':!![],'transaction':_0x4e25da});})[_0x3cfb('0x2b')](function(_0x38b3ed){var _0x3e3872=_[_0x3cfb('0x30')](_0x38b3ed,function(_0x29c919){return Number(_0x29c919[_0x3cfb('0x5f')]);});return db[_0x3cfb('0x60')]['destroy']({'where':{'UserId':{'$in':_0xd7e25a},'VoiceQueueId':{'$in':_0x3e3872}},'transaction':_0x4e25da});})[_0x3cfb('0x2b')](function(){var _0x25c2be=_0x3cfb('0x61')+_0x2355a4;return db[_0x3cfb('0x59')][_0x3cfb('0x36')](_0x25c2be,{'type':db[_0x3cfb('0x5a')][_0x3cfb('0x5d')]['SELECT'],'raw':!![],'transaction':_0x4e25da});})[_0x3cfb('0x2b')](function(_0x4abb3d){var _0x5c07de=_[_0x3cfb('0x30')](_0x4abb3d,function(_0x40ed67){return Number(_0x40ed67[_0x3cfb('0x62')]);});return db[_0x3cfb('0x63')][_0x3cfb('0x64')]({'where':{'UserId':{'$in':_0xd7e25a},'MailQueueId':{'$in':_0x5c07de}},'transaction':_0x4e25da});})['then'](function(){var _0x3b50aa='SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2355a4;return db['sequelize']['query'](_0x3b50aa,{'type':db['Sequelize'][_0x3cfb('0x5d')][_0x3cfb('0x5e')],'raw':!![],'transaction':_0x4e25da});})[_0x3cfb('0x2b')](function(_0x67317e){var _0x2993af=_[_0x3cfb('0x30')](_0x67317e,function(_0x17a5bb){return Number(_0x17a5bb['SmsQueueId']);});return db[_0x3cfb('0x65')][_0x3cfb('0x64')]({'where':{'UserId':{'$in':_0xd7e25a},'SmsQueueId':{'$in':_0x2993af}},'transaction':_0x4e25da});})['then'](function(){var _0xbb4456='SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20'+_0x2355a4;return db[_0x3cfb('0x59')]['query'](_0xbb4456,{'type':db[_0x3cfb('0x5a')]['QueryTypes'][_0x3cfb('0x5e')],'raw':!![],'transaction':_0x4e25da});})[_0x3cfb('0x2b')](function(_0x5ee90b){var _0x1fa53c=_[_0x3cfb('0x30')](_0x5ee90b,function(_0x3e9e52){return Number(_0x3e9e52[_0x3cfb('0x66')]);});return db[_0x3cfb('0x67')][_0x3cfb('0x64')]({'where':{'UserId':{'$in':_0xd7e25a},'ChatQueueId':{'$in':_0x1fa53c}},'transaction':_0x4e25da});})[_0x3cfb('0x2b')](function(){var _0x5d3521=_0x3cfb('0x68')+_0x2355a4;return db[_0x3cfb('0x59')][_0x3cfb('0x36')](_0x5d3521,{'type':db[_0x3cfb('0x5a')][_0x3cfb('0x5d')]['SELECT'],'raw':!![],'transaction':_0x4e25da});})[_0x3cfb('0x2b')](function(_0xbd1d3){var _0x172978=_[_0x3cfb('0x30')](_0xbd1d3,function(_0x130922){return Number(_0x130922['FaxQueueId']);});return db[_0x3cfb('0x69')][_0x3cfb('0x64')]({'where':{'UserId':{'$in':_0xd7e25a},'FaxQueueId':{'$in':_0x172978}},'transaction':_0x4e25da});})[_0x3cfb('0x2b')](function(){var _0x535d21=_0x3cfb('0x6a')+_0x2355a4;return db['sequelize'][_0x3cfb('0x36')](_0x535d21,{'type':db[_0x3cfb('0x5a')][_0x3cfb('0x5d')][_0x3cfb('0x5e')],'raw':!![],'transaction':_0x4e25da});})[_0x3cfb('0x2b')](function(_0x1d7980){var _0x564a58=_[_0x3cfb('0x30')](_0x1d7980,function(_0x57936b){return Number(_0x57936b[_0x3cfb('0x6b')]);});return db[_0x3cfb('0x6c')][_0x3cfb('0x64')]({'where':{'UserId':{'$in':_0xd7e25a},'OpenchannelQueueId':{'$in':_0x564a58}},'transaction':_0x4e25da});})[_0x3cfb('0x2b')](function(){var _0x29fa07=_0x3cfb('0x6d')+_0x2355a4;return db[_0x3cfb('0x59')][_0x3cfb('0x36')](_0x29fa07,{'type':db[_0x3cfb('0x5a')]['QueryTypes'][_0x3cfb('0x5e')],'raw':!![],'transaction':_0x4e25da});})[_0x3cfb('0x2b')](function(_0x926096){var _0xff9bf=_['map'](_0x926096,function(_0x4f3e22){return Number(_0x4f3e22[_0x3cfb('0x6e')]);});return db[_0x3cfb('0x6f')][_0x3cfb('0x64')]({'where':{'UserId':{'$in':_0xd7e25a},'WhatsappQueueId':{'$in':_0xff9bf}},'transaction':_0x4e25da});})[_0x3cfb('0x2b')](function(){return db[_0x3cfb('0x70')][_0x3cfb('0x4b')]({'where':{'TeamId':_0x2355a4}});})[_0x3cfb('0x2b')](function(_0x438ef8){if(_0x438ef8===null){return;}return db[_0x3cfb('0x71')]['destroy']({'where':{'UserId':{'$in':_0xd7e25a},'VoicePrefixId':_0x438ef8[_0x3cfb('0x72')]},'transaction':_0x4e25da});})['then'](function(){return db[_0x3cfb('0x31')][_0x3cfb('0x64')]({'where':{'id':_0x2355a4},'cascade':!![],'transaction':_0x4e25da});})['then'](function(_0x41e101){if(_0x41e101===0x0){_0x263f14[_0x3cfb('0x2c')](0x194);}else{return db[_0x3cfb('0x56')]['destroy']({'where':{'type':_0x3cfb('0x52'),'resourceId':_0x2355a4},'cascade':!![],'transaction':_0x4e25da})[_0x3cfb('0x2b')](function(){_0x263f14[_0x3cfb('0x21')](0xcc)['end']();});}})[_0x3cfb('0x4c')](function(_0x3c5b49){_0x263f14[_0x3cfb('0x21')](0x1f4)[_0x3cfb('0x73')](_0x3c5b49);});});};exports[_0x3cfb('0x74')]=function(_0x80c880,_0x581426,_0x56aa0f){return db[_0x3cfb('0x31')]['findOne']({'where':{'id':_0x80c880[_0x3cfb('0x75')]['id']}})['then'](handleEntityNotFound(_0x581426,null))[_0x3cfb('0x2b')](function(_0x222d10){if(!_0x80c880[_0x3cfb('0x36')]['channel']||!utils[_0x3cfb('0x76')](_0x80c880[_0x3cfb('0x36')][_0x3cfb('0x77')])){throw new db[(_0x3cfb('0x5a'))][(_0x3cfb('0x78'))]('Unknown\x20channel');}var _0x4e8d7e={};var _0x116484={};_0x116484['model']=_[_0x3cfb('0x37')](db[_['capitalize'](_0x80c880[_0x3cfb('0x36')]['channel'][_0x3cfb('0x79')]())+_0x3cfb('0x7a')][_0x3cfb('0x32')]);_0x116484[_0x3cfb('0x36')]=_[_0x3cfb('0x37')](_0x80c880[_0x3cfb('0x36')]);_0x116484[_0x3cfb('0x38')]=_[_0x3cfb('0x39')](_0x116484[_0x3cfb('0x3a')],_0x116484[_0x3cfb('0x36')]);_0x4e8d7e[_0x3cfb('0x3c')]=_[_0x3cfb('0x39')](_0x116484[_0x3cfb('0x3a')],qs[_0x3cfb('0x3b')](_0x80c880[_0x3cfb('0x36')]['fields']));_0x4e8d7e['attributes']=_0x4e8d7e['attributes'][_0x3cfb('0x7b')]?_0x4e8d7e[_0x3cfb('0x3c')]:_0x116484['model'];_0x4e8d7e[_0x3cfb('0x3e')]=qs[_0x3cfb('0x3e')](_0x80c880[_0x3cfb('0x36')][_0x3cfb('0x3e')]);_0x4e8d7e[_0x3cfb('0x23')]=qs['offset'](_0x80c880['query'][_0x3cfb('0x23')]);_0x4e8d7e[_0x3cfb('0x3f')]=qs[_0x3cfb('0x40')](_0x80c880[_0x3cfb('0x36')][_0x3cfb('0x40')]);_0x4e8d7e['where']=qs[_0x3cfb('0x38')](_[_0x3cfb('0x42')](_0x80c880[_0x3cfb('0x36')],_0x116484[_0x3cfb('0x38')]));_0x4e8d7e=_[_0x3cfb('0x44')]({},_0x4e8d7e,_0x80c880[_0x3cfb('0x4a')]);return _0x222d10[_0x3cfb('0x4e')+_[_0x3cfb('0x7c')](_0x80c880[_0x3cfb('0x36')]['channel'][_0x3cfb('0x79')]())+'Queues'](_0x4e8d7e);})[_0x3cfb('0x2b')](respondWithResult(_0x581426,null))[_0x3cfb('0x4c')](handleError(_0x581426,null));};exports[_0x3cfb('0x7d')]=function(_0x1d30e0,_0x3a3d62,_0x528187){return db['Team']['findOne']({'where':{'id':_0x1d30e0[_0x3cfb('0x75')]['id']}})[_0x3cfb('0x2b')](function(_0x93731d){if(_0x93731d){if(!_0x1d30e0['body'][_0x3cfb('0x77')]||!utils['isValidChannel'](_0x1d30e0[_0x3cfb('0x58')][_0x3cfb('0x77')])){throw new db[(_0x3cfb('0x5a'))]['ValidationError'](_0x3cfb('0x7e'));}return _0x93731d[_0x3cfb('0x7f')+_['capitalize'](_0x1d30e0[_0x3cfb('0x58')][_0x3cfb('0x77')][_0x3cfb('0x79')]())+'Queues'](_0x1d30e0[_0x3cfb('0x58')][_0x3cfb('0x80')]);}return null;})[_0x3cfb('0x2b')](handleEntityNotFound(_0x3a3d62,null))[_0x3cfb('0x2b')](respondWithStatusCode(_0x3a3d62,null))[_0x3cfb('0x4c')](handleError(_0x3a3d62,null));};exports[_0x3cfb('0x81')]=function(_0x4bbb49,_0x4dd219,_0x12ce28){return db['Team']['findOne']({'where':{'id':_0x4bbb49[_0x3cfb('0x75')]['id']}})['then'](function(_0x7de996){if(_0x7de996){if(!_0x4bbb49[_0x3cfb('0x36')][_0x3cfb('0x77')]||!utils['isValidChannel'](_0x4bbb49['query']['channel'])){throw new db[(_0x3cfb('0x5a'))][(_0x3cfb('0x78'))](_0x3cfb('0x7e'));}return _0x7de996[_0x3cfb('0x82')+_[_0x3cfb('0x7c')](_0x4bbb49[_0x3cfb('0x36')][_0x3cfb('0x77')][_0x3cfb('0x79')]())+'Queues'](_0x4bbb49['query'][_0x3cfb('0x80')]);}return null;})[_0x3cfb('0x2b')](handleEntityNotFound(_0x4dd219,null))[_0x3cfb('0x2b')](respondWithStatusCode(_0x4dd219,null))[_0x3cfb('0x4c')](handleError(_0x4dd219,null));};exports[_0x3cfb('0x83')]=function(_0x59ac31,_0x3639d7){var _0x5b0fa9=_[_0x3cfb('0x84')](_0x59ac31[_0x3cfb('0x58')][_0x3cfb('0x80')])?_0x59ac31[_0x3cfb('0x58')][_0x3cfb('0x80')]:[_0x59ac31[_0x3cfb('0x58')][_0x3cfb('0x80')]];var _0x216e2b=_0x59ac31['params']['id'];return db['Team'][_0x3cfb('0x4b')]({'where':{'id':_0x216e2b}})[_0x3cfb('0x2b')](handleEntityNotFound(_0x3639d7,null))[_0x3cfb('0x2b')](function(_0x544616){if(_0x544616){var _0xfe3f61=[_0x3cfb('0x85'),_0x3cfb('0x86'),_0x3cfb('0x87'),_0x3cfb('0x88'),_0x3cfb('0x89'),_0x3cfb('0x8a'),_0x3cfb('0x8b')];return db[_0x3cfb('0x59')]['transaction'](function(_0x43b0ad){var _0x431ba0=_['map'](_0xfe3f61,function(_0xb42048){var _0x5b57ff={'attributes':['id','name']};if(_0xb42048===_0x3cfb('0x85')){_0x5b57ff[_0x3cfb('0x8c')]={'attributes':[_0x3cfb('0x8d')]};}return _0x544616[_0x3cfb('0x4e')+_0xb42048+_0x3cfb('0x8e')](_0x5b57ff)[_0x3cfb('0x2b')](function(_0x4e8bc0){var _0x13cec1=_['map'](_0x4e8bc0,function(_0x52d2e0){var _0x1ab460=_[_0x3cfb('0x30')](_0x5b0fa9,function(_0x33ea1a){var _0x52eba3={'where':{'UserId':_0x33ea1a,[_0xb42048+_0x3cfb('0x8f')]:_0x52d2e0['id']},'transaction':_0x43b0ad};if(_0xb42048===_0x3cfb('0x85')){_0x52eba3[_0x3cfb('0x1c')]={'penalty':_0x52d2e0[_0x3cfb('0x90')][_0x3cfb('0x8d')]};}return db['User'+_0xb42048+_0x3cfb('0x7a')][_0x3cfb('0x91')](_0x52eba3)['then'](function(){socket['emit'](_0x3cfb('0x51')+_0xb42048+_0x3cfb('0x92'),{'UserId':_0x33ea1a,[_0xb42048+_0x3cfb('0x8f')]:_0x52d2e0['id']});if(_0xb42048!=='Voice'){return;}return db[_0x3cfb('0x93')][_0x3cfb('0x94')]({'where':{'id':_0x5b0fa9,'online':0x1},'attributes':['id','name','online','voicePause',_0x3cfb('0x95')],'raw':!![]})[_0x3cfb('0x2b')](function(_0x5c7823){var _0x28d375=_['map'](_0x5c7823,function(_0x2de9ce){return db[_0x3cfb('0x96')][_0x3cfb('0x97')]({'membername':_0x2de9ce[_0x3cfb('0x2e')],'UserId':_0x2de9ce['id'],'queue_name':_0x52d2e0['name'],'VoiceQueueId':_0x52d2e0['id'],'interface':_[_0x3cfb('0x98')](_0x2de9ce[_0x3cfb('0x95')])?util[_0x3cfb('0x99')]('SIP/%s',_0x2de9ce[_0x3cfb('0x2e')]):_0x2de9ce['interface'],'paused':_0x2de9ce[_0x3cfb('0x9a')]||![],'penalty':_0x52d2e0['TeamVoiceQueue'][_0x3cfb('0x8d')]},{'transaction':_0x43b0ad});});return Promise[_0x3cfb('0x9b')](_0x28d375);});});});return Promise[_0x3cfb('0x9b')](_0x1ab460);});return Promise[_0x3cfb('0x9b')](_0x13cec1);})[_0x3cfb('0x2b')](function(){return db['TeamVoicePrefix'][_0x3cfb('0x9c')]({'where':{'teamId':_0x216e2b}})[_0x3cfb('0x2b')](function(_0x195be3){if(_0x195be3){var _0x5e767d=_['map'](_0x5b0fa9,function(_0x18110b){db[_0x3cfb('0x71')]['upsert']({'UserId':_0x18110b,'VoicePrefixId':_0x195be3[_0x3cfb('0x72')]});});return Promise[_0x3cfb('0x9b')](_0x5e767d);}});});});return Promise[_0x3cfb('0x9b')](_0x431ba0)[_0x3cfb('0x2b')](function(){return _0x544616[_0x3cfb('0x83')](_0x5b0fa9,{'transaction':_0x43b0ad})[_0x3cfb('0x9d')](function(_0x2c9d44){return _0x2c9d44;});});});}})[_0x3cfb('0x2b')](respondWithResult(_0x3639d7,null))[_0x3cfb('0x4c')](handleError(_0x3639d7,null));};exports[_0x3cfb('0x9e')]=function(_0x4036da,_0x252fab){var _0x37c2da=_[_0x3cfb('0x84')](_0x4036da[_0x3cfb('0x36')][_0x3cfb('0x80')])?_0x4036da['query'][_0x3cfb('0x80')]:[_0x4036da[_0x3cfb('0x36')]['ids']];var _0x46653c=_0x4036da['params']['id'];return db[_0x3cfb('0x31')][_0x3cfb('0x4b')]({'where':{'id':_0x46653c}})[_0x3cfb('0x2b')](handleEntityNotFound(_0x252fab,null))[_0x3cfb('0x2b')](function(_0x18a5ba){if(_0x18a5ba){var _0x272be8=[_0x3cfb('0x85'),_0x3cfb('0x86'),_0x3cfb('0x87'),_0x3cfb('0x88'),_0x3cfb('0x89'),_0x3cfb('0x8a'),_0x3cfb('0x8b')];return db[_0x3cfb('0x59')]['transaction'](function(_0x26dc8e){var _0x2f5775=_[_0x3cfb('0x30')](_0x272be8,function(_0x5e8720){var _0x183bf2={'attributes':['id',_0x3cfb('0x2e')]};return _0x18a5ba[_0x3cfb('0x4e')+_0x5e8720+_0x3cfb('0x8e')](_0x183bf2)[_0x3cfb('0x2b')](function(_0x45c21f){var _0x2b01fe=_['map'](_0x45c21f,function(_0x387f3e){return _0x387f3e[_0x3cfb('0x9e')](_0x37c2da,{'transaction':_0x26dc8e})[_0x3cfb('0x2b')](function(){var _0x4ea9bd=_[_0x3cfb('0x30')](_0x37c2da,function(_0x53fc7d){socket[_0x3cfb('0x9f')](_0x3cfb('0x51')+_0x5e8720+'Queue:remove',{'UserId':Number(_0x53fc7d),[_0x5e8720+'QueueId']:_0x387f3e['id']});if(_0x5e8720!==_0x3cfb('0x85')){return;}return db[_0x3cfb('0x96')][_0x3cfb('0x64')]({'where':{'VoiceQueueId':_0x387f3e['id'],'UserId':_0x53fc7d},'transaction':_0x26dc8e});});return Promise['all'](_0x4ea9bd);});});return Promise[_0x3cfb('0x9b')](_0x2b01fe);});});return Promise[_0x3cfb('0x9b')](_0x2f5775)[_0x3cfb('0x2b')](function(){return _0x18a5ba[_0x3cfb('0x9e')](_0x37c2da,{'transaction':_0x26dc8e});})[_0x3cfb('0x2b')](function(){return db['TeamVoicePrefix'][_0x3cfb('0x9c')]({'where':{'teamId':_0x46653c}})[_0x3cfb('0x2b')](function(_0xc53049){if(_0xc53049){var _0x524336=_[_0x3cfb('0x30')](_0x37c2da,function(_0x480ad8){db[_0x3cfb('0x71')][_0x3cfb('0x64')]({'where':{'UserId':_0x480ad8,'VoicePrefixId':_0xc53049[_0x3cfb('0x72')]}});});return Promise[_0x3cfb('0x9b')](_0x524336);}});});});}})[_0x3cfb('0x2b')](respondWithStatusCode(_0x252fab,null))[_0x3cfb('0x4c')](handleError(_0x252fab,null));};exports[_0x3cfb('0xa0')]=function(_0x51b4e3,_0x206925,_0x5c020b){var _0x2b7579={};var _0x2c0bbc={};var _0x484b62;var _0x3fc4d4;return db[_0x3cfb('0x31')][_0x3cfb('0x9c')]({'where':{'id':_0x51b4e3['params']['id']}})['then'](handleEntityNotFound(_0x206925,null))['then'](function(_0x42f97f){if(_0x42f97f){_0x484b62=_0x42f97f;_0x2c0bbc['model']=_['keys'](db[_0x3cfb('0x93')][_0x3cfb('0x32')]);_0x2c0bbc['query']=_[_0x3cfb('0x37')](_0x51b4e3[_0x3cfb('0x36')]);_0x2c0bbc[_0x3cfb('0x38')]=_[_0x3cfb('0x39')](_0x2c0bbc[_0x3cfb('0x3a')],_0x2c0bbc[_0x3cfb('0x36')]);_0x2b7579[_0x3cfb('0x3c')]=_[_0x3cfb('0x39')](_0x2c0bbc[_0x3cfb('0x3a')],qs[_0x3cfb('0x3b')](_0x51b4e3['query']['fields']));_0x2b7579[_0x3cfb('0x3c')]=_0x2b7579[_0x3cfb('0x3c')]['length']?_0x2b7579[_0x3cfb('0x3c')]:_0x2c0bbc[_0x3cfb('0x3a')];_0x2b7579[_0x3cfb('0x3f')]=qs[_0x3cfb('0x40')](_0x51b4e3['query']['sort']);_0x2b7579[_0x3cfb('0x41')]=qs['filters'](_[_0x3cfb('0x42')](_0x51b4e3['query'],_0x2c0bbc[_0x3cfb('0x38')]));if(_0x51b4e3[_0x3cfb('0x36')][_0x3cfb('0x43')]){_0x2b7579[_0x3cfb('0x41')]=_[_0x3cfb('0x44')](_0x2b7579['where'],{'$or':_[_0x3cfb('0x30')](_0x2b7579[_0x3cfb('0x3c')],function(_0x1e5a79){var _0xbb237a={};_0xbb237a[_0x1e5a79]={'$like':'%'+_0x51b4e3['query'][_0x3cfb('0x43')]+'%'};return _0xbb237a;})});}_0x2b7579=_[_0x3cfb('0x44')]({},_0x2b7579,_0x51b4e3['options']);return _0x484b62[_0x3cfb('0xa0')](_0x2b7579);}})['then'](function(_0x3d763a){if(_0x3d763a){_0x3fc4d4=_0x3d763a['length'];if(!_0x51b4e3[_0x3cfb('0x36')]['hasOwnProperty']('nolimit')){_0x2b7579['limit']=qs['limit'](_0x51b4e3[_0x3cfb('0x36')][_0x3cfb('0x3e')]);_0x2b7579[_0x3cfb('0x23')]=qs['offset'](_0x51b4e3[_0x3cfb('0x36')]['offset']);}return _0x484b62[_0x3cfb('0xa0')](_0x2b7579);}})['then'](function(_0x1e90b3){if(_0x1e90b3){return _0x1e90b3?{'count':_0x3fc4d4,'rows':_0x1e90b3}:null;}})[_0x3cfb('0x2b')](respondWithResult(_0x206925,null))[_0x3cfb('0x4c')](handleError(_0x206925,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 1060eff..be6ecf2 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 _0x680b=['remove','emit','hasOwnProperty','hook','exports','events','save'];(function(_0x81e39d,_0x4c3934){var _0x548fbb=function(_0x1adda5){while(--_0x1adda5){_0x81e39d['push'](_0x81e39d['shift']());}};_0x548fbb(++_0x4c3934);}(_0x680b,0x10f));var _0xb680=function(_0x1a2ccd,_0x356f8c){_0x1a2ccd=_0x1a2ccd-0x0;var _0x52fb4f=_0x680b[_0x1a2ccd];return _0x52fb4f;};'use strict';var EventEmitter=require(_0xb680('0x0'));var Team=require('../../mysqldb')['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb680('0x1'),'afterUpdate':'update','afterDestroy':_0xb680('0x2')};function emitEvent(_0x50ba97){return function(_0x12a8cf,_0x4869c4,_0x302f73){TeamEvents[_0xb680('0x3')](_0x50ba97+':'+_0x12a8cf['id'],_0x12a8cf);TeamEvents['emit'](_0x50ba97,_0x12a8cf);_0x302f73(null);};}for(var e in events){if(events[_0xb680('0x4')](e)){var event=events[e];Team[_0xb680('0x5')](e,emitEvent(event));}}module[_0xb680('0x6')]=TeamEvents; \ No newline at end of file +var _0x272b=['hasOwnProperty','hook','exports','events','Team','setMaxListeners','save','update','remove','emit'];(function(_0x32cf51,_0x2ff147){var _0x8b9a94=function(_0x30f8e0){while(--_0x30f8e0){_0x32cf51['push'](_0x32cf51['shift']());}};_0x8b9a94(++_0x2ff147);}(_0x272b,0x161));var _0xb272=function(_0x11ea64,_0x59f7a2){_0x11ea64=_0x11ea64-0x0;var _0x30590a=_0x272b[_0x11ea64];return _0x30590a;};'use strict';var EventEmitter=require(_0xb272('0x0'));var Team=require('../../mysqldb')['db'][_0xb272('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0xb272('0x2')](0x0);var events={'afterCreate':_0xb272('0x3'),'afterUpdate':_0xb272('0x4'),'afterDestroy':_0xb272('0x5')};function emitEvent(_0x31ae52){return function(_0x59bc4d,_0x4b39eb,_0x356dd1){TeamEvents[_0xb272('0x6')](_0x31ae52+':'+_0x59bc4d['id'],_0x59bc4d);TeamEvents['emit'](_0x31ae52,_0x59bc4d);_0x356dd1(null);};}for(var e in events){if(events[_0xb272('0x7')](e)){var event=events[e];Team[_0xb272('0x8')](e,emitEvent(event));}}module[_0xb272('0x9')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 6d5d104..2080f6a 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 _0xbb00=['then','map','catch','exports','define','Team','teams','Fax','Mail','Openchannel','Sms','Voice','resolve','all','lodash','get'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0xbb00,0x13e));var _0x0bb0=function(_0x29b1b7,_0x9947f){_0x29b1b7=_0x29b1b7-0x0;var _0x326e97=_0xbb00[_0x29b1b7];return _0x326e97;};'use strict';var _=require(_0x0bb0('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x1a24fc,_0x35b047){var _0x1bd1aa=_0x0bb0('0x1')+_0x35b047+'Queues';return _0x1a24fc[_0x1bd1aa]()[_0x0bb0('0x2')](function(_0x217ceb){return _[_0x0bb0('0x3')](_0x217ceb,function(_0x1a114d){_0x1a114d['setDataValue']('channel',_0x35b047);return _0x1a114d;});})[_0x0bb0('0x4')](function(_0x321ddb){throw _0x321ddb;});}module[_0x0bb0('0x5')]=function(_0x1a5f38){return _0x1a5f38[_0x0bb0('0x6')](_0x0bb0('0x7'),attributes,{'tableName':_0x0bb0('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x5c1960=this;var _0x22b9bd=['Chat',_0x0bb0('0x9'),_0x0bb0('0xa'),_0x0bb0('0xb'),_0x0bb0('0xc'),_0x0bb0('0xd'),'Whatsapp'];return Promise[_0x0bb0('0xe')]()['then'](function(){var _0xad7d2d=_[_0x0bb0('0x3')](_0x22b9bd,function(_0x237c49){return getQueuesByChannel(_0x5c1960,_0x237c49);});return Promise[_0x0bb0('0xf')](_0xad7d2d);})['catch'](function(_0x4ffdf0){throw _0x4ffdf0;});}}});}; \ No newline at end of file +var _0x4828=['teams','Chat','Fax','Mail','Voice','Whatsapp','resolve','all','lodash','then','map','setDataValue','channel','define'];(function(_0x4af8c2,_0x571991){var _0x13537d=function(_0x271c75){while(--_0x271c75){_0x4af8c2['push'](_0x4af8c2['shift']());}};_0x13537d(++_0x571991);}(_0x4828,0x112));var _0x8482=function(_0x50f94e,_0x452ebe){_0x50f94e=_0x50f94e-0x0;var _0x46973e=_0x4828[_0x50f94e];return _0x46973e;};'use strict';var _=require(_0x8482('0x0'));var attributes=require('./team.attributes');function getQueuesByChannel(_0x6f20bf,_0x5bf107){var _0x66f763='get'+_0x5bf107+'Queues';return _0x6f20bf[_0x66f763]()[_0x8482('0x1')](function(_0xfe458){return _[_0x8482('0x2')](_0xfe458,function(_0x58d2f4){_0x58d2f4[_0x8482('0x3')](_0x8482('0x4'),_0x5bf107);return _0x58d2f4;});})['catch'](function(_0x274ea6){throw _0x274ea6;});}module['exports']=function(_0x3f4034){return _0x3f4034[_0x8482('0x5')]('Team',attributes,{'tableName':_0x8482('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'getAssociatedQueues':function(){var _0x5e8ecb=this;var _0x2b7f68=[_0x8482('0x7'),_0x8482('0x8'),_0x8482('0x9'),'Openchannel','Sms',_0x8482('0xa'),_0x8482('0xb')];return Promise[_0x8482('0xc')]()[_0x8482('0x1')](function(){var _0x1e98c8=_[_0x8482('0x2')](_0x2b7f68,function(_0x500642){return getQueuesByChannel(_0x5e8ecb,_0x500642);});return Promise[_0x8482('0xd')](_0x1e98c8);})['catch'](function(_0x57e5c1){throw _0x57e5c1;});}}});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index e54ca3a..2899726 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 _0x4855=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','info','request\x20sent','Team,\x20%s,\x20%s,\x20%s','error','code','Team,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x1b85b3,_0x23861a){var _0x35a6b9=function(_0x1b663e){while(--_0x1b663e){_0x1b85b3['push'](_0x1b85b3['shift']());}};_0x35a6b9(++_0x23861a);}(_0x4855,0x1d9));var _0x5485=function(_0x10bae6,_0x41d85f){_0x10bae6=_0x10bae6-0x0;var _0x251123=_0x4855[_0x10bae6];return _0x251123;};'use strict';var _=require(_0x5485('0x0'));var util=require(_0x5485('0x1'));var moment=require(_0x5485('0x2'));var BPromise=require(_0x5485('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5485('0x4'));var db=require(_0x5485('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5485('0x6'))('rpc');var config=require(_0x5485('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5485('0x8')][_0x5485('0x9')]({'port':0x232a});config[_0x5485('0xa')]=_[_0x5485('0xb')](config[_0x5485('0xa')],{'host':_0x5485('0xc'),'port':0x18eb});var socket=require(_0x5485('0xd'))(new Redis(config[_0x5485('0xa')]));require(_0x5485('0xe'))[_0x5485('0xf')](socket);function respondWithRpcPromise(_0x7ce15e,_0x76b576,_0x233cc1){return new BPromise(function(_0x5b9662,_0x31786f){return client[_0x5485('0x10')](_0x7ce15e,_0x233cc1)['then'](function(_0x30688c){logger[_0x5485('0x11')]('Team,\x20%s,\x20%s',_0x76b576,_0x5485('0x12'));logger['debug'](_0x5485('0x13'),_0x76b576,_0x5485('0x12'),JSON['stringify'](_0x30688c));if(_0x30688c['error']){if(_0x30688c[_0x5485('0x14')][_0x5485('0x15')]===0x1f4){logger[_0x5485('0x14')](_0x5485('0x16'),_0x76b576,_0x30688c[_0x5485('0x14')][_0x5485('0x17')]);return _0x31786f(_0x30688c['error'][_0x5485('0x17')]);}logger[_0x5485('0x14')](_0x5485('0x16'),_0x76b576,_0x30688c[_0x5485('0x14')][_0x5485('0x17')]);return _0x5b9662(_0x30688c[_0x5485('0x14')][_0x5485('0x17')]);}else{logger[_0x5485('0x11')]('Team,\x20%s,\x20%s',_0x76b576,_0x5485('0x12'));_0x5b9662(_0x30688c['result']['message']);}})[_0x5485('0x18')](function(_0x36e66c){logger[_0x5485('0x14')]('Team,\x20%s,\x20%s',_0x76b576,_0x36e66c);_0x31786f(_0x36e66c);});});} \ No newline at end of file +var _0x747c=['client','redis','socket.io-emitter','./team.socket','request','then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2fbea3,_0x55209f){var _0x1b279e=function(_0x22399e){while(--_0x22399e){_0x2fbea3['push'](_0x2fbea3['shift']());}};_0x1b279e(++_0x55209f);}(_0x747c,0x10b));var _0xc747=function(_0x1b6e11,_0x182d00){_0x1b6e11=_0x1b6e11-0x0;var _0x594ac6=_0x747c[_0x1b6e11];return _0x594ac6;};'use strict';var _=require(_0xc747('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc747('0x1'));var db=require(_0xc747('0x2'))['db'];var utils=require(_0xc747('0x3'));var logger=require(_0xc747('0x4'))('rpc');var config=require(_0xc747('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xc747('0x6')]['http']({'port':0x232a});config[_0xc747('0x7')]=_['defaults'](config[_0xc747('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xc747('0x8'))(new Redis(config[_0xc747('0x7')]));require(_0xc747('0x9'))['register'](socket);function respondWithRpcPromise(_0x2abae6,_0x450d0b,_0x392093){return new BPromise(function(_0x83b072,_0x4c06ee){return client[_0xc747('0xa')](_0x2abae6,_0x392093)[_0xc747('0xb')](function(_0x4311b5){logger[_0xc747('0xc')](_0xc747('0xd'),_0x450d0b,_0xc747('0xe'));logger['debug'](_0xc747('0xf'),_0x450d0b,_0xc747('0xe'),JSON[_0xc747('0x10')](_0x4311b5));if(_0x4311b5[_0xc747('0x11')]){if(_0x4311b5[_0xc747('0x11')][_0xc747('0x12')]===0x1f4){logger[_0xc747('0x11')]('Team,\x20%s,\x20%s',_0x450d0b,_0x4311b5['error'][_0xc747('0x13')]);return _0x4c06ee(_0x4311b5[_0xc747('0x11')][_0xc747('0x13')]);}logger[_0xc747('0x11')]('Team,\x20%s,\x20%s',_0x450d0b,_0x4311b5[_0xc747('0x11')][_0xc747('0x13')]);return _0x83b072(_0x4311b5[_0xc747('0x11')][_0xc747('0x13')]);}else{logger[_0xc747('0xc')](_0xc747('0xd'),_0x450d0b,'request\x20sent');_0x83b072(_0x4311b5[_0xc747('0x14')][_0xc747('0x13')]);}})['catch'](function(_0x36756f){logger[_0xc747('0x11')](_0xc747('0xd'),_0x450d0b,_0x36756f);_0x4c06ee(_0x36756f);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 837f455..d20b3d7 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 _0xe62a=['team:','./team.events','save','emit','removeListener','register','length'];(function(_0x1f951b,_0x654997){var _0x503af0=function(_0x40a7d9){while(--_0x40a7d9){_0x1f951b['push'](_0x1f951b['shift']());}};_0x503af0(++_0x654997);}(_0xe62a,0x143));var _0xae62=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe62a[_0x19950b];return _0x3c6b41;};'use strict';var TeamEvents=require(_0xae62('0x0'));var events=[_0xae62('0x1'),'remove','update'];function createListener(_0x4b6bce,_0x10f15b){return function(_0x37923c){_0x10f15b[_0xae62('0x2')](_0x4b6bce,_0x37923c);};}function removeListener(_0x3ce754,_0x2bb2ba){return function(){TeamEvents[_0xae62('0x3')](_0x3ce754,_0x2bb2ba);};}exports[_0xae62('0x4')]=function(_0x1c69d8){for(var _0x10a5dd=0x0,_0x362244=events[_0xae62('0x5')];_0x10a5dd<_0x362244;_0x10a5dd++){var _0x2a8d24=events[_0x10a5dd];var _0x891ab3=createListener(_0xae62('0x6')+_0x2a8d24,_0x1c69d8);TeamEvents['on'](_0x2a8d24,_0x891ab3);}}; \ No newline at end of file +var _0xfc4c=['remove','removeListener','length','team:','./team.events','save'];(function(_0x4706a6,_0x5a1c63){var _0x1bb705=function(_0x484ebb){while(--_0x484ebb){_0x4706a6['push'](_0x4706a6['shift']());}};_0x1bb705(++_0x5a1c63);}(_0xfc4c,0xca));var _0xcfc4=function(_0x5dae7a,_0xe5dbf3){_0x5dae7a=_0x5dae7a-0x0;var _0x348e11=_0xfc4c[_0x5dae7a];return _0x348e11;};'use strict';var TeamEvents=require(_0xcfc4('0x0'));var events=[_0xcfc4('0x1'),_0xcfc4('0x2'),'update'];function createListener(_0x29323d,_0xb8f67b){return function(_0x3a0bd9){_0xb8f67b['emit'](_0x29323d,_0x3a0bd9);};}function removeListener(_0x57bf8a,_0x436d9b){return function(){TeamEvents[_0xcfc4('0x3')](_0x57bf8a,_0x436d9b);};}exports['register']=function(_0x4a4db3){for(var _0x30b6d4=0x0,_0x53486d=events[_0xcfc4('0x4')];_0x30b6d4<_0x53486d;_0x30b6d4++){var _0x4578f4=events[_0x30b6d4];var _0x520566=createListener(_0xcfc4('0x5')+_0x4578f4,_0x4a4db3);TeamEvents['on'](_0x4578f4,_0x520566);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 23ebf6a..3642682 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbc47=['exports','INTEGER','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbc47,0x7a));var _0x7bc4=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xbc47[_0x279d37];return _0x530173;};'use strict';var Sequelize=require(_0x7bc4('0x0'));module[_0x7bc4('0x1')]={'TeamId':{'type':Sequelize[_0x7bc4('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x7bc4('0x2')]}}; \ No newline at end of file +var _0x3fb7=['INTEGER','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3fb7,0x187));var _0x73fb=function(_0x238ebc,_0x1119cc){_0x238ebc=_0x238ebc-0x0;var _0x55ecba=_0x3fb7[_0x238ebc];return _0x55ecba;};'use strict';var Sequelize=require(_0x73fb('0x0'));module[_0x73fb('0x1')]={'TeamId':{'type':Sequelize[_0x73fb('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x73fb('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index c663263..b19091e 100644 --- a/server/api/teamVoicePrefix/teamVoicePrefix.model.js +++ b/server/api/teamVoicePrefix/teamVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf996=['path','rimraf','../../config/environment','./teamVoicePrefix.attributes','exports','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','../../config/logger','moment'];(function(_0x50d984,_0x4d41e4){var _0xa81ece=function(_0x45e047){while(--_0x45e047){_0x50d984['push'](_0x50d984['shift']());}};_0xa81ece(++_0x4d41e4);}(_0xf996,0x74));var _0x6f99=function(_0x48b7ca,_0x592d87){_0x48b7ca=_0x48b7ca-0x0;var _0x2d4fda=_0xf996[_0x48b7ca];return _0x2d4fda;};'use strict';var _=require(_0x6f99('0x0'));var util=require(_0x6f99('0x1'));var logger=require(_0x6f99('0x2'))('api');var moment=require(_0x6f99('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f99('0x4'));var rimraf=require(_0x6f99('0x5'));var config=require(_0x6f99('0x6'));var attributes=require(_0x6f99('0x7'));module[_0x6f99('0x8')]=function(_0xf2b5ee,_0xa07ac1){return _0xf2b5ee[_0x6f99('0x9')](_0x6f99('0xa'),attributes,{'tableName':_0x6f99('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1339=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','TeamVoicePrefix','team_has_voice_prefixes','../../config/logger','api'];(function(_0x974280,_0x43d935){var _0x2bcbb3=function(_0x11c7fa){while(--_0x11c7fa){_0x974280['push'](_0x974280['shift']());}};_0x2bcbb3(++_0x43d935);}(_0x1339,0x1ed));var _0x9133=function(_0x499404,_0x378956){_0x499404=_0x499404-0x0;var _0x1ffc2f=_0x1339[_0x499404];return _0x1ffc2f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9133('0x0'))(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var BPromise=require(_0x9133('0x3'));var rp=require(_0x9133('0x4'));var fs=require('fs');var path=require(_0x9133('0x5'));var rimraf=require(_0x9133('0x6'));var config=require(_0x9133('0x7'));var attributes=require('./teamVoicePrefix.attributes');module[_0x9133('0x8')]=function(_0x855473,_0x379915){return _0x855473['define'](_0x9133('0x9'),attributes,{'tableName':_0x9133('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index a6b752c..30c2720 100644 --- a/server/api/teamVoiceQueue/index.js +++ b/server/api/teamVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2c3255,_0x4e00ae){var _0x282aba=function(_0x5721d5){while(--_0x5721d5){_0x2c3255['push'](_0x2c3255['shift']());}};_0x282aba(++_0x4e00ae);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x185d4c,_0x541480){var _0x413709=function(_0x828720){while(--_0x828720){_0x185d4c['push'](_0x185d4c['shift']());}};_0x413709(++_0x541480);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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 fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index c9b7819..40c48be 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3697=['INTEGER','sequelize','exports'];(function(_0x2921de,_0x5896b3){var _0x3b8d59=function(_0x435c59){while(--_0x435c59){_0x2921de['push'](_0x2921de['shift']());}};_0x3b8d59(++_0x5896b3);}(_0x3697,0x1ea));var _0x7369=function(_0x37e0a0,_0x462179){_0x37e0a0=_0x37e0a0-0x0;var _0x21badd=_0x3697[_0x37e0a0];return _0x21badd;};'use strict';var Sequelize=require(_0x7369('0x0'));module[_0x7369('0x1')]={'penalty':{'type':Sequelize[_0x7369('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6a8e=['exports'];(function(_0x343ec2,_0x4f4049){var _0x2af9eb=function(_0x426634){while(--_0x426634){_0x343ec2['push'](_0x343ec2['shift']());}};_0x2af9eb(++_0x4f4049);}(_0x6a8e,0xc4));var _0xe6a8=function(_0x396883,_0x5851ff){_0x396883=_0x396883-0x0;var _0x3b64d4=_0x6a8e[_0x396883];return _0x3b64d4;};'use strict';var Sequelize=require('sequelize');module[_0xe6a8('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 635e863..002eeb3 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.model.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5636=['./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','bluebird','request-promise','path','../../config/environment'];(function(_0x287883,_0x39bc56){var _0x477ce9=function(_0x28e702){while(--_0x28e702){_0x287883['push'](_0x287883['shift']());}};_0x477ce9(++_0x39bc56);}(_0x5636,0x102));var _0x6563=function(_0x48666f,_0x2c7e1a){_0x48666f=_0x48666f-0x0;var _0xc3d576=_0x5636[_0x48666f];return _0xc3d576;};'use strict';var _=require(_0x6563('0x0'));var util=require(_0x6563('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x6563('0x2'));var rp=require(_0x6563('0x3'));var fs=require('fs');var path=require(_0x6563('0x4'));var rimraf=require('rimraf');var config=require(_0x6563('0x5'));var attributes=require(_0x6563('0x6'));module[_0x6563('0x7')]=function(_0x39792f,_0x29f687){return _0x39792f[_0x6563('0x8')](_0x6563('0x9'),attributes,{'tableName':_0x6563('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe13e=['team_has_voice_queues','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue'];(function(_0x3fb980,_0x23e2da){var _0x2779cf=function(_0xee953c){while(--_0xee953c){_0x3fb980['push'](_0x3fb980['shift']());}};_0x2779cf(++_0x23e2da);}(_0xe13e,0xde));var _0xee13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe13e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xee13('0x0'))(_0xee13('0x1'));var moment=require(_0xee13('0x2'));var BPromise=require(_0xee13('0x3'));var rp=require(_0xee13('0x4'));var fs=require('fs');var path=require(_0xee13('0x5'));var rimraf=require(_0xee13('0x6'));var config=require(_0xee13('0x7'));var attributes=require(_0xee13('0x8'));module[_0xee13('0x9')]=function(_0x43cfb0,_0x48e7b0){return _0x43cfb0[_0xee13('0xa')](_0xee13('0xb'),attributes,{'tableName':_0xee13('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 8634c39..3b54c2a 100644 --- a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js +++ b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa952=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','code','TeamVoiceQueue,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x54a14f,_0x59c124){var _0x47d334=function(_0xfe197f){while(--_0xfe197f){_0x54a14f['push'](_0x54a14f['shift']());}};_0x47d334(++_0x59c124);}(_0xa952,0x1b2));var _0x2a95=function(_0x1c0713,_0xb12e42){_0x1c0713=_0x1c0713-0x0;var _0x3559a6=_0xa952[_0x1c0713];return _0x3559a6;};'use strict';var _=require(_0x2a95('0x0'));var util=require(_0x2a95('0x1'));var moment=require(_0x2a95('0x2'));var BPromise=require(_0x2a95('0x3'));var rs=require(_0x2a95('0x4'));var fs=require('fs');var Redis=require(_0x2a95('0x5'));var db=require(_0x2a95('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2a95('0x7'))(_0x2a95('0x8'));var config=require(_0x2a95('0x9'));var jayson=require(_0x2a95('0xa'));var client=jayson['client'][_0x2a95('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c279d,_0x36e284,_0x538ef9){return new BPromise(function(_0x2a9705,_0x4922bc){return client[_0x2a95('0xc')](_0x1c279d,_0x538ef9)[_0x2a95('0xd')](function(_0x15b1c8){logger[_0x2a95('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x36e284,_0x2a95('0xf'));logger[_0x2a95('0x10')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x36e284,_0x2a95('0xf'),JSON['stringify'](_0x15b1c8));if(_0x15b1c8[_0x2a95('0x11')]){if(_0x15b1c8[_0x2a95('0x11')][_0x2a95('0x12')]===0x1f4){logger[_0x2a95('0x11')](_0x2a95('0x13'),_0x36e284,_0x15b1c8[_0x2a95('0x11')][_0x2a95('0x14')]);return _0x4922bc(_0x15b1c8[_0x2a95('0x11')][_0x2a95('0x14')]);}logger['error'](_0x2a95('0x13'),_0x36e284,_0x15b1c8[_0x2a95('0x11')][_0x2a95('0x14')]);return _0x2a9705(_0x15b1c8[_0x2a95('0x11')][_0x2a95('0x14')]);}else{logger[_0x2a95('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x36e284,'request\x20sent');_0x2a9705(_0x15b1c8['result'][_0x2a95('0x14')]);}})[_0x2a95('0x15')](function(_0x3d3448){logger[_0x2a95('0x11')](_0x2a95('0x13'),_0x36e284,_0x3d3448);_0x4922bc(_0x3d3448);});});} \ No newline at end of file +var _0x7c5d=['debug','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s'];(function(_0x423540,_0xa699c){var _0x58c29f=function(_0x43a178){while(--_0x43a178){_0x423540['push'](_0x423540['shift']());}};_0x58c29f(++_0xa699c);}(_0x7c5d,0x1aa));var _0xd7c5=function(_0x9071f5,_0x3230d4){_0x9071f5=_0x9071f5-0x0;var _0x1d389d=_0x7c5d[_0x9071f5];return _0x1d389d;};'use strict';var _=require(_0xd7c5('0x0'));var util=require('util');var moment=require(_0xd7c5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd7c5('0x2'));var db=require(_0xd7c5('0x3'))['db'];var utils=require(_0xd7c5('0x4'));var logger=require(_0xd7c5('0x5'))(_0xd7c5('0x6'));var config=require('../../config/environment');var jayson=require(_0xd7c5('0x7'));var client=jayson[_0xd7c5('0x8')][_0xd7c5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1f1518,_0x523443,_0x1edac4){return new BPromise(function(_0x4362b8,_0x14ae74){return client[_0xd7c5('0xa')](_0x1f1518,_0x1edac4)[_0xd7c5('0xb')](function(_0x15ab5f){logger[_0xd7c5('0xc')](_0xd7c5('0xd'),_0x523443,'request\x20sent');logger[_0xd7c5('0xe')]('TeamVoiceQueue,\x20%s,\x20%s,\x20%s',_0x523443,_0xd7c5('0xf'),JSON[_0xd7c5('0x10')](_0x15ab5f));if(_0x15ab5f[_0xd7c5('0x11')]){if(_0x15ab5f[_0xd7c5('0x11')][_0xd7c5('0x12')]===0x1f4){logger[_0xd7c5('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x523443,_0x15ab5f[_0xd7c5('0x11')][_0xd7c5('0x13')]);return _0x14ae74(_0x15ab5f[_0xd7c5('0x11')][_0xd7c5('0x13')]);}logger['error'](_0xd7c5('0xd'),_0x523443,_0x15ab5f[_0xd7c5('0x11')]['message']);return _0x4362b8(_0x15ab5f[_0xd7c5('0x11')]['message']);}else{logger[_0xd7c5('0xc')](_0xd7c5('0xd'),_0x523443,_0xd7c5('0xf'));_0x4362b8(_0x15ab5f[_0xd7c5('0x14')][_0xd7c5('0x13')]);}})[_0xd7c5('0x15')](function(_0x299b67){logger[_0xd7c5('0x11')]('TeamVoiceQueue,\x20%s,\x20%s',_0x523443,_0x299b67);_0x14ae74(_0x299b67);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index ddf1707..5524375 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 _0xa9fc=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','index','/:id','isAuthenticated','show','post','create','put','update','delete'];(function(_0x3743d4,_0x73ba92){var _0x4e3e2f=function(_0x40a8af){while(--_0x40a8af){_0x3743d4['push'](_0x3743d4['shift']());}};_0x4e3e2f(++_0x73ba92);}(_0xa9fc,0x19f));var _0xca9f=function(_0x1602fb,_0x20b6b3){_0x1602fb=_0x1602fb-0x0;var _0x461831=_0xa9fc[_0x1602fb];return _0x461831;};'use strict';var multer=require(_0xca9f('0x0'));var util=require(_0xca9f('0x1'));var path=require(_0xca9f('0x2'));var timeout=require(_0xca9f('0x3'));var express=require(_0xca9f('0x4'));var router=express['Router']();var fs_extra=require(_0xca9f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xca9f('0x6'));var config=require(_0xca9f('0x7'));var controller=require('./template.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xca9f('0x8')]);router['get'](_0xca9f('0x9'),auth[_0xca9f('0xa')](),controller[_0xca9f('0xb')]);router[_0xca9f('0xc')]('/',auth[_0xca9f('0xa')](),controller[_0xca9f('0xd')]);router[_0xca9f('0xe')](_0xca9f('0x9'),auth['isAuthenticated'](),controller[_0xca9f('0xf')]);router[_0xca9f('0x10')](_0xca9f('0x9'),auth[_0xca9f('0xa')](),controller['destroy']);module[_0xca9f('0x11')]=router; \ No newline at end of file +var _0x0137=['index','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get'];(function(_0x1a899a,_0x559faf){var _0x38e5e4=function(_0x4be0e0){while(--_0x4be0e0){_0x1a899a['push'](_0x1a899a['shift']());}};_0x38e5e4(++_0x559faf);}(_0x0137,0x1d8));var _0x7013=function(_0x5253c3,_0x3e4a0a){_0x5253c3=_0x5253c3-0x0;var _0x3c3917=_0x0137[_0x5253c3];return _0x3c3917;};'use strict';var multer=require(_0x7013('0x0'));var util=require(_0x7013('0x1'));var path=require(_0x7013('0x2'));var timeout=require(_0x7013('0x3'));var express=require(_0x7013('0x4'));var router=express['Router']();var fs_extra=require(_0x7013('0x5'));var auth=require(_0x7013('0x6'));var interaction=require(_0x7013('0x7'));var config=require(_0x7013('0x8'));var controller=require(_0x7013('0x9'));router[_0x7013('0xa')]('/',auth['isAuthenticated'](),controller[_0x7013('0xb')]);router[_0x7013('0xa')]('/:id',auth[_0x7013('0xc')](),controller[_0x7013('0xd')]);router[_0x7013('0xe')]('/',auth['isAuthenticated'](),controller[_0x7013('0xf')]);router[_0x7013('0x10')](_0x7013('0x11'),auth[_0x7013('0xc')](),controller['update']);router[_0x7013('0x12')](_0x7013('0x11'),auth[_0x7013('0xc')](),controller[_0x7013('0x13')]);module[_0x7013('0x14')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index d346158..8c36c26 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 _0x8f53=['exports','STRING','sequelize'];(function(_0x496b11,_0x576cb0){var _0x3030ac=function(_0x38185b){while(--_0x38185b){_0x496b11['push'](_0x496b11['shift']());}};_0x3030ac(++_0x576cb0);}(_0x8f53,0x125));var _0x38f5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8f53[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x38f5('0x0'));module[_0x38f5('0x1')]={'name':{'type':Sequelize[_0x38f5('0x2')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xeec6=['TEXT','sequelize','STRING'];(function(_0x36def7,_0x401864){var _0x57bc33=function(_0x4eefd0){while(--_0x4eefd0){_0x36def7['push'](_0x36def7['shift']());}};_0x57bc33(++_0x401864);}(_0xeec6,0xe5));var _0x6eec=function(_0x1ab758,_0x3dbede){_0x1ab758=_0x1ab758-0x0;var _0x5788a0=_0xeec6[_0x1ab758];return _0x5788a0;};'use strict';var Sequelize=require(_0x6eec('0x0'));module['exports']={'name':{'type':Sequelize[_0x6eec('0x1')]},'description':{'type':Sequelize[_0x6eec('0x1')]},'html':{'type':Sequelize[_0x6eec('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 841cace..6e54010 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 _0x4388=['../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','end','error','name','send','index','map','Template','fieldName','type','key','keys','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','params','rawAttributes','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Templates','UserProfileSection','userProfileId','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x2d7e09,_0x16be83){var _0x1ba707=function(_0x4d3063){while(--_0x4d3063){_0x2d7e09['push'](_0x2d7e09['shift']());}};_0x1ba707(++_0x16be83);}(_0x4388,0x127));var _0x8438=function(_0x10a951,_0x5da875){_0x10a951=_0x10a951-0x0;var _0x6da0d=_0x4388[_0x10a951];return _0x6da0d;};'use strict';var emlformat=require(_0x8438('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8438('0x1'));var jsonpatch=require(_0x8438('0x2'));var rp=require(_0x8438('0x3'));var moment=require(_0x8438('0x4'));var BPromise=require(_0x8438('0x5'));var Mustache=require('mustache');var util=require(_0x8438('0x6'));var path=require(_0x8438('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8438('0x8'));var _=require('lodash');var squel=require(_0x8438('0x9'));var crypto=require(_0x8438('0xa'));var jsforce=require(_0x8438('0xb'));var deskjs=require(_0x8438('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8438('0xd'));var Redis=require(_0x8438('0xe'));var authService=require(_0x8438('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8438('0x10'));var hardwareService=require(_0x8438('0x11'));var logger=require(_0x8438('0x12'))('api');var utils=require(_0x8438('0x13'));var config=require(_0x8438('0x14'));var licenseUtil=require(_0x8438('0x15'));var db=require(_0x8438('0x16'))['db'];function respondWithStatusCode(_0x43fcb5,_0x4fe2d2){_0x4fe2d2=_0x4fe2d2||0xcc;return function(_0x1cf599){if(_0x1cf599){return _0x43fcb5[_0x8438('0x17')](_0x4fe2d2);}return _0x43fcb5[_0x8438('0x18')](_0x4fe2d2)['end']();};}function respondWithResult(_0x403773,_0x57f98e){_0x57f98e=_0x57f98e||0xc8;return function(_0x53224d){if(_0x53224d){return _0x403773[_0x8438('0x18')](_0x57f98e)[_0x8438('0x19')](_0x53224d);}};}function respondWithFilteredResult(_0x562c66,_0x5639f4){return function(_0x4601d9){if(_0x4601d9){var _0x4171f2=typeof _0x5639f4[_0x8438('0x1a')]===_0x8438('0x1b')&&typeof _0x5639f4[_0x8438('0x1c')]===_0x8438('0x1b');var _0x2cbf37=_0x4601d9['count'];var _0x58110d=_0x4171f2?0x0:_0x5639f4['offset'];var _0xccb427=_0x4171f2?_0x4601d9[_0x8438('0x1d')]:_0x5639f4['offset']+_0x5639f4[_0x8438('0x1c')];var _0xa0edc0;if(_0xccb427>=_0x2cbf37){_0xccb427=_0x2cbf37;_0xa0edc0=0xc8;}else{_0xa0edc0=0xce;}_0x562c66['status'](_0xa0edc0);return _0x562c66[_0x8438('0x1e')](_0x8438('0x1f'),_0x58110d+'-'+_0xccb427+'/'+_0x2cbf37)[_0x8438('0x19')](_0x4601d9);}return null;};}function patchUpdates(_0x3c62be){return function(_0x23d43e){try{jsonpatch['apply'](_0x23d43e,_0x3c62be,!![]);}catch(_0x441a8c){return BPromise[_0x8438('0x20')](_0x441a8c);}return _0x23d43e[_0x8438('0x21')]();};}function saveUpdates(_0xcc7d67,_0x391848){return function(_0x59a60c){if(_0x59a60c){return _0x59a60c[_0x8438('0x22')](_0xcc7d67)['then'](function(_0x3ea90b){return _0x3ea90b;});}return null;};}function removeEntity(_0x23947c,_0xd81cf1){return function(_0x2a947b){if(_0x2a947b){return _0x2a947b[_0x8438('0x23')]()[_0x8438('0x24')](function(){var _0x5d4369=_0x2a947b['get']({'plain':!![]});var _0x31a318='Templates';return db['UserProfileResource'][_0x8438('0x23')]({'where':{'type':_0x31a318,'resourceId':_0x5d4369['id']}})['then'](function(){return _0x2a947b;});})[_0x8438('0x24')](function(){_0x23947c['status'](0xcc)[_0x8438('0x25')]();});}};}function handleEntityNotFound(_0x5a80e3,_0x4b4069){return function(_0x1f101a){if(!_0x1f101a){_0x5a80e3[_0x8438('0x17')](0x194);}return _0x1f101a;};}function handleError(_0x3359e6,_0xad7dd4){_0xad7dd4=_0xad7dd4||0x1f4;return function(_0x3f8bae){logger[_0x8438('0x26')](_0x3f8bae['stack']);if(_0x3f8bae[_0x8438('0x27')]){delete _0x3f8bae['name'];}_0x3359e6[_0x8438('0x18')](_0xad7dd4)[_0x8438('0x28')](_0x3f8bae);};}exports[_0x8438('0x29')]=function(_0x1efe7f,_0x5a07d9){var _0x103b8b={},_0x5787a1={},_0x28d6a3={'count':0x0,'rows':[]};var _0x3b0bee=_[_0x8438('0x2a')](db[_0x8438('0x2b')]['rawAttributes'],function(_0x51af99){return{'name':_0x51af99[_0x8438('0x2c')],'type':_0x51af99[_0x8438('0x2d')][_0x8438('0x2e')]};});_0x5787a1['model']=_['map'](_0x3b0bee,'name');_0x5787a1['query']=_[_0x8438('0x2f')](_0x1efe7f[_0x8438('0x30')]);_0x5787a1['filters']=_[_0x8438('0x31')](_0x5787a1[_0x8438('0x32')],_0x5787a1['query']);_0x103b8b[_0x8438('0x33')]=_[_0x8438('0x31')](_0x5787a1[_0x8438('0x32')],qs[_0x8438('0x34')](_0x1efe7f[_0x8438('0x30')]['fields']));_0x103b8b[_0x8438('0x33')]=_0x103b8b['attributes'][_0x8438('0x35')]?_0x103b8b['attributes']:_0x5787a1[_0x8438('0x32')];if(!_0x1efe7f['query'][_0x8438('0x36')](_0x8438('0x37'))){_0x103b8b[_0x8438('0x1c')]=qs[_0x8438('0x1c')](_0x1efe7f[_0x8438('0x30')][_0x8438('0x1c')]);_0x103b8b['offset']=qs[_0x8438('0x1a')](_0x1efe7f[_0x8438('0x30')]['offset']);}_0x103b8b['order']=qs[_0x8438('0x38')](_0x1efe7f[_0x8438('0x30')]['sort']);_0x103b8b[_0x8438('0x39')]=qs[_0x8438('0x3a')](_[_0x8438('0x3b')](_0x1efe7f['query'],_0x5787a1[_0x8438('0x3a')]),_0x3b0bee);if(_0x1efe7f[_0x8438('0x30')][_0x8438('0x3c')]){_0x103b8b['where']=_['merge'](_0x103b8b[_0x8438('0x39')],{'$or':_[_0x8438('0x2a')](_0x3b0bee,function(_0x2687ac){if(_0x2687ac[_0x8438('0x2d')]!==_0x8438('0x3d')){var _0x1197fb={};_0x1197fb[_0x2687ac['name']]={'$like':'%'+_0x1efe7f[_0x8438('0x30')][_0x8438('0x3c')]+'%'};return _0x1197fb;}})});}_0x103b8b=_[_0x8438('0x3e')]({},_0x103b8b,_0x1efe7f[_0x8438('0x3f')]);var _0x5793c4={'where':_0x103b8b[_0x8438('0x39')]};return db['Template'][_0x8438('0x1d')](_0x5793c4)[_0x8438('0x24')](function(_0x303ada){_0x28d6a3[_0x8438('0x1d')]=_0x303ada;if(_0x1efe7f[_0x8438('0x30')][_0x8438('0x40')]){_0x103b8b[_0x8438('0x41')]=[{'all':!![]}];}return db['Template'][_0x8438('0x42')](_0x103b8b);})[_0x8438('0x24')](function(_0x3727e3){_0x28d6a3['rows']=_0x3727e3;return _0x28d6a3;})[_0x8438('0x24')](respondWithFilteredResult(_0x5a07d9,_0x103b8b))['catch'](handleError(_0x5a07d9,null));};exports['show']=function(_0x4d7d60,_0x1781b1){var _0x2d744e={'raw':!![],'where':{'id':_0x4d7d60[_0x8438('0x43')]['id']}},_0x9879b7={};_0x9879b7[_0x8438('0x32')]=_[_0x8438('0x2f')](db[_0x8438('0x2b')][_0x8438('0x44')]);_0x9879b7[_0x8438('0x30')]=_[_0x8438('0x2f')](_0x4d7d60['query']);_0x9879b7['filters']=_[_0x8438('0x31')](_0x9879b7[_0x8438('0x32')],_0x9879b7[_0x8438('0x30')]);_0x2d744e[_0x8438('0x33')]=_[_0x8438('0x31')](_0x9879b7[_0x8438('0x32')],qs[_0x8438('0x34')](_0x4d7d60[_0x8438('0x30')]['fields']));_0x2d744e[_0x8438('0x33')]=_0x2d744e['attributes'][_0x8438('0x35')]?_0x2d744e[_0x8438('0x33')]:_0x9879b7['model'];if(_0x4d7d60[_0x8438('0x30')][_0x8438('0x40')]){_0x2d744e[_0x8438('0x41')]=[{'all':!![]}];}_0x2d744e=_[_0x8438('0x3e')]({},_0x2d744e,_0x4d7d60[_0x8438('0x3f')]);return db[_0x8438('0x2b')][_0x8438('0x45')](_0x2d744e)[_0x8438('0x24')](handleEntityNotFound(_0x1781b1,null))['then'](respondWithResult(_0x1781b1,null))[_0x8438('0x46')](handleError(_0x1781b1,null));};exports[_0x8438('0x47')]=function(_0x30da72,_0x2369b6){return db[_0x8438('0x2b')][_0x8438('0x47')](_0x30da72['body'],{})[_0x8438('0x24')](function(_0x9a11c9){var _0x361630=_0x30da72[_0x8438('0x48')][_0x8438('0x49')]({'plain':!![]});if(!_0x361630)throw new Error(_0x8438('0x4a'));if(_0x361630['role']===_0x8438('0x48')){var _0x54e116=_0x9a11c9['get']({'plain':!![]});var _0x48c290=_0x8438('0x4b');return db[_0x8438('0x4c')]['find']({'where':{'name':_0x48c290,'userProfileId':_0x361630[_0x8438('0x4d')]},'raw':!![]})[_0x8438('0x24')](function(_0xb83c7b){if(_0xb83c7b&&_0xb83c7b['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x54e116[_0x8438('0x27')],'resourceId':_0x54e116['id'],'type':_0xb83c7b[_0x8438('0x27')],'sectionId':_0xb83c7b['id']},{})['then'](function(){return _0x9a11c9;});}else{return _0x9a11c9;}})['catch'](function(_0x3170e9){logger[_0x8438('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3170e9);throw _0x3170e9;});}return _0x9a11c9;})[_0x8438('0x24')](respondWithResult(_0x2369b6,0xc9))['catch'](handleError(_0x2369b6,null));};exports[_0x8438('0x22')]=function(_0x5b9aad,_0x42aab3){if(_0x5b9aad[_0x8438('0x4e')]['id']){delete _0x5b9aad['body']['id'];}return db['Template'][_0x8438('0x45')]({'where':{'id':_0x5b9aad[_0x8438('0x43')]['id']}})[_0x8438('0x24')](handleEntityNotFound(_0x42aab3,null))[_0x8438('0x24')](saveUpdates(_0x5b9aad[_0x8438('0x4e')],null))['then'](respondWithResult(_0x42aab3,null))[_0x8438('0x46')](handleError(_0x42aab3,null));};exports[_0x8438('0x23')]=function(_0x166456,_0xa1de40){return db[_0x8438('0x2b')][_0x8438('0x45')]({'where':{'id':_0x166456[_0x8438('0x43')]['id']}})[_0x8438('0x24')](handleEntityNotFound(_0xa1de40,null))[_0x8438('0x24')](removeEntity(_0xa1de40,null))[_0x8438('0x46')](handleError(_0xa1de40,null));}; \ No newline at end of file +var _0x8398=['then','UserProfileResource','destroy','error','stack','name','map','Template','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','show','length','options','find','create','body','get','role','user','Templates','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save'];(function(_0x2ccd5e,_0x3deb44){var _0x1a758e=function(_0x535991){while(--_0x535991){_0x2ccd5e['push'](_0x2ccd5e['shift']());}};_0x1a758e(++_0x3deb44);}(_0x8398,0x178));var _0x8839=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x8398[_0x263a74];return _0x2aa86c;};'use strict';var emlformat=require(_0x8839('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8839('0x1'));var jsonpatch=require(_0x8839('0x2'));var rp=require(_0x8839('0x3'));var moment=require(_0x8839('0x4'));var BPromise=require(_0x8839('0x5'));var Mustache=require(_0x8839('0x6'));var util=require(_0x8839('0x7'));var path=require(_0x8839('0x8'));var sox=require(_0x8839('0x9'));var csv=require(_0x8839('0xa'));var ejs=require(_0x8839('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8839('0xc'));var squel=require(_0x8839('0xd'));var crypto=require(_0x8839('0xe'));var jsforce=require(_0x8839('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x8839('0xa'));var querystring=require(_0x8839('0x10'));var Papa=require(_0x8839('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8839('0x12'))(_0x8839('0x13'));var utils=require(_0x8839('0x14'));var config=require(_0x8839('0x15'));var licenseUtil=require(_0x8839('0x16'));var db=require(_0x8839('0x17'))['db'];function respondWithStatusCode(_0x3b3209,_0x267836){_0x267836=_0x267836||0xcc;return function(_0x2f2245){if(_0x2f2245){return _0x3b3209[_0x8839('0x18')](_0x267836);}return _0x3b3209[_0x8839('0x19')](_0x267836)[_0x8839('0x1a')]();};}function respondWithResult(_0x5872d1,_0x15be1){_0x15be1=_0x15be1||0xc8;return function(_0x2e0c30){if(_0x2e0c30){return _0x5872d1[_0x8839('0x19')](_0x15be1)[_0x8839('0x1b')](_0x2e0c30);}};}function respondWithFilteredResult(_0x229690,_0x14133c){return function(_0x30eb79){if(_0x30eb79){var _0x2dbf5e=typeof _0x14133c[_0x8839('0x1c')]==='undefined'&&typeof _0x14133c[_0x8839('0x1d')]==='undefined';var _0x1e52e9=_0x30eb79['count'];var _0x320238=_0x2dbf5e?0x0:_0x14133c[_0x8839('0x1c')];var _0x4dc31d=_0x2dbf5e?_0x30eb79['count']:_0x14133c[_0x8839('0x1c')]+_0x14133c[_0x8839('0x1d')];var _0xf0b979;if(_0x4dc31d>=_0x1e52e9){_0x4dc31d=_0x1e52e9;_0xf0b979=0xc8;}else{_0xf0b979=0xce;}_0x229690['status'](_0xf0b979);return _0x229690[_0x8839('0x1e')](_0x8839('0x1f'),_0x320238+'-'+_0x4dc31d+'/'+_0x1e52e9)[_0x8839('0x1b')](_0x30eb79);}return null;};}function patchUpdates(_0x118df8){return function(_0x20ae16){try{jsonpatch['apply'](_0x20ae16,_0x118df8,!![]);}catch(_0x45f751){return BPromise[_0x8839('0x20')](_0x45f751);}return _0x20ae16[_0x8839('0x21')]();};}function saveUpdates(_0x1a71ed,_0x845eff){return function(_0x1b09f0){if(_0x1b09f0){return _0x1b09f0['update'](_0x1a71ed)[_0x8839('0x22')](function(_0x199999){return _0x199999;});}return null;};}function removeEntity(_0xa19a11,_0x2227ac){return function(_0x4649bd){if(_0x4649bd){return _0x4649bd['destroy']()['then'](function(){var _0x2fa781=_0x4649bd['get']({'plain':!![]});var _0x584711='Templates';return db[_0x8839('0x23')][_0x8839('0x24')]({'where':{'type':_0x584711,'resourceId':_0x2fa781['id']}})[_0x8839('0x22')](function(){return _0x4649bd;});})['then'](function(){_0xa19a11[_0x8839('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ecc73,_0x4ce588){return function(_0x5ca181){if(!_0x5ca181){_0x1ecc73[_0x8839('0x18')](0x194);}return _0x5ca181;};}function handleError(_0x3e776e,_0x25ad9f){_0x25ad9f=_0x25ad9f||0x1f4;return function(_0x115018){logger[_0x8839('0x25')](_0x115018[_0x8839('0x26')]);if(_0x115018['name']){delete _0x115018[_0x8839('0x27')];}_0x3e776e[_0x8839('0x19')](_0x25ad9f)['send'](_0x115018);};}exports['index']=function(_0x546e5c,_0x202bc2){var _0x4792ee={},_0x171ed8={},_0x33f838={'count':0x0,'rows':[]};var _0x3505f4=_[_0x8839('0x28')](db[_0x8839('0x29')][_0x8839('0x2a')],function(_0x3ef275){return{'name':_0x3ef275[_0x8839('0x2b')],'type':_0x3ef275[_0x8839('0x2c')][_0x8839('0x2d')]};});_0x171ed8[_0x8839('0x2e')]=_['map'](_0x3505f4,_0x8839('0x27'));_0x171ed8[_0x8839('0x2f')]=_[_0x8839('0x30')](_0x546e5c[_0x8839('0x2f')]);_0x171ed8[_0x8839('0x31')]=_[_0x8839('0x32')](_0x171ed8[_0x8839('0x2e')],_0x171ed8['query']);_0x4792ee[_0x8839('0x33')]=_[_0x8839('0x32')](_0x171ed8[_0x8839('0x2e')],qs[_0x8839('0x34')](_0x546e5c[_0x8839('0x2f')][_0x8839('0x34')]));_0x4792ee[_0x8839('0x33')]=_0x4792ee[_0x8839('0x33')]['length']?_0x4792ee[_0x8839('0x33')]:_0x171ed8[_0x8839('0x2e')];if(!_0x546e5c[_0x8839('0x2f')][_0x8839('0x35')](_0x8839('0x36'))){_0x4792ee['limit']=qs[_0x8839('0x1d')](_0x546e5c[_0x8839('0x2f')]['limit']);_0x4792ee[_0x8839('0x1c')]=qs[_0x8839('0x1c')](_0x546e5c[_0x8839('0x2f')]['offset']);}_0x4792ee[_0x8839('0x37')]=qs[_0x8839('0x38')](_0x546e5c[_0x8839('0x2f')]['sort']);_0x4792ee[_0x8839('0x39')]=qs[_0x8839('0x31')](_[_0x8839('0x3a')](_0x546e5c[_0x8839('0x2f')],_0x171ed8[_0x8839('0x31')]),_0x3505f4);if(_0x546e5c['query'][_0x8839('0x3b')]){_0x4792ee[_0x8839('0x39')]=_[_0x8839('0x3c')](_0x4792ee[_0x8839('0x39')],{'$or':_[_0x8839('0x28')](_0x3505f4,function(_0x3984b4){if(_0x3984b4[_0x8839('0x2c')]!==_0x8839('0x3d')){var _0x246df9={};_0x246df9[_0x3984b4[_0x8839('0x27')]]={'$like':'%'+_0x546e5c['query'][_0x8839('0x3b')]+'%'};return _0x246df9;}})});}_0x4792ee=_[_0x8839('0x3c')]({},_0x4792ee,_0x546e5c['options']);var _0x119a87={'where':_0x4792ee[_0x8839('0x39')]};return db[_0x8839('0x29')][_0x8839('0x3e')](_0x119a87)['then'](function(_0x46b1ac){_0x33f838['count']=_0x46b1ac;if(_0x546e5c[_0x8839('0x2f')][_0x8839('0x3f')]){_0x4792ee[_0x8839('0x40')]=[{'all':!![]}];}return db[_0x8839('0x29')][_0x8839('0x41')](_0x4792ee);})[_0x8839('0x22')](function(_0x1bc448){_0x33f838['rows']=_0x1bc448;return _0x33f838;})[_0x8839('0x22')](respondWithFilteredResult(_0x202bc2,_0x4792ee))['catch'](handleError(_0x202bc2,null));};exports[_0x8839('0x42')]=function(_0x1f6333,_0x296264){var _0xd0b384={'raw':!![],'where':{'id':_0x1f6333['params']['id']}},_0x16afd3={};_0x16afd3[_0x8839('0x2e')]=_[_0x8839('0x30')](db[_0x8839('0x29')][_0x8839('0x2a')]);_0x16afd3['query']=_[_0x8839('0x30')](_0x1f6333[_0x8839('0x2f')]);_0x16afd3['filters']=_[_0x8839('0x32')](_0x16afd3[_0x8839('0x2e')],_0x16afd3['query']);_0xd0b384[_0x8839('0x33')]=_[_0x8839('0x32')](_0x16afd3[_0x8839('0x2e')],qs['fields'](_0x1f6333[_0x8839('0x2f')][_0x8839('0x34')]));_0xd0b384[_0x8839('0x33')]=_0xd0b384[_0x8839('0x33')][_0x8839('0x43')]?_0xd0b384[_0x8839('0x33')]:_0x16afd3['model'];if(_0x1f6333[_0x8839('0x2f')]['includeAll']){_0xd0b384[_0x8839('0x40')]=[{'all':!![]}];}_0xd0b384=_[_0x8839('0x3c')]({},_0xd0b384,_0x1f6333[_0x8839('0x44')]);return db['Template'][_0x8839('0x45')](_0xd0b384)['then'](handleEntityNotFound(_0x296264,null))[_0x8839('0x22')](respondWithResult(_0x296264,null))['catch'](handleError(_0x296264,null));};exports[_0x8839('0x46')]=function(_0x5bf8ce,_0x23f0cc){return db[_0x8839('0x29')]['create'](_0x5bf8ce[_0x8839('0x47')],{})['then'](function(_0x32b371){var _0x4bd5a0=_0x5bf8ce['user'][_0x8839('0x48')]({'plain':!![]});if(!_0x4bd5a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4bd5a0[_0x8839('0x49')]===_0x8839('0x4a')){var _0x5b1b59=_0x32b371[_0x8839('0x48')]({'plain':!![]});var _0x58c9a5=_0x8839('0x4b');return db['UserProfileSection'][_0x8839('0x45')]({'where':{'name':_0x58c9a5,'userProfileId':_0x4bd5a0[_0x8839('0x4c')]},'raw':!![]})[_0x8839('0x22')](function(_0x313ae6){if(_0x313ae6&&_0x313ae6[_0x8839('0x4d')]===0x0){return db[_0x8839('0x23')][_0x8839('0x46')]({'name':_0x5b1b59[_0x8839('0x27')],'resourceId':_0x5b1b59['id'],'type':_0x313ae6[_0x8839('0x27')],'sectionId':_0x313ae6['id']},{})[_0x8839('0x22')](function(){return _0x32b371;});}else{return _0x32b371;}})[_0x8839('0x4e')](function(_0x10f005){logger[_0x8839('0x25')](_0x8839('0x4f'),_0x10f005);throw _0x10f005;});}return _0x32b371;})['then'](respondWithResult(_0x23f0cc,0xc9))[_0x8839('0x4e')](handleError(_0x23f0cc,null));};exports[_0x8839('0x50')]=function(_0x150aa7,_0x3ac511){if(_0x150aa7[_0x8839('0x47')]['id']){delete _0x150aa7[_0x8839('0x47')]['id'];}return db['Template'][_0x8839('0x45')]({'where':{'id':_0x150aa7[_0x8839('0x51')]['id']}})[_0x8839('0x22')](handleEntityNotFound(_0x3ac511,null))[_0x8839('0x22')](saveUpdates(_0x150aa7['body'],null))[_0x8839('0x22')](respondWithResult(_0x3ac511,null))[_0x8839('0x4e')](handleError(_0x3ac511,null));};exports[_0x8839('0x24')]=function(_0x5573d2,_0x4250b8){return db['Template'][_0x8839('0x45')]({'where':{'id':_0x5573d2[_0x8839('0x51')]['id']}})[_0x8839('0x22')](handleEntityNotFound(_0x4250b8,null))[_0x8839('0x22')](removeEntity(_0x4250b8,null))[_0x8839('0x4e')](handleError(_0x4250b8,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 2abc473..7334ecf 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 _0x267f=['rimraf','exports','define','Template','lodash','util','api','request-promise'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x267f,0x64));var _0xf267=function(_0x562c31,_0x15841a){_0x562c31=_0x562c31-0x0;var _0x480eb4=_0x267f[_0x562c31];return _0x480eb4;};'use strict';var _=require(_0xf267('0x0'));var util=require(_0xf267('0x1'));var logger=require('../../config/logger')(_0xf267('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf267('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf267('0x4'));var config=require('../../config/environment');var attributes=require('./template.attributes');module[_0xf267('0x5')]=function(_0xaab24,_0xfb8eca){return _0xaab24[_0xf267('0x6')](_0xf267('0x7'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a0c=['bluebird','request-promise','path','rimraf','./template.attributes','define','tools_templates','lodash','util','../../config/logger','api','moment'];(function(_0x48c69d,_0x2c45a0){var _0x552fec=function(_0x2b00e6){while(--_0x2b00e6){_0x48c69d['push'](_0x48c69d['shift']());}};_0x552fec(++_0x2c45a0);}(_0x2a0c,0x13f));var _0xc2a0=function(_0x1bdf2a,_0x4eeef3){_0x1bdf2a=_0x1bdf2a-0x0;var _0x40981b=_0x2a0c[_0x1bdf2a];return _0x40981b;};'use strict';var _=require(_0xc2a0('0x0'));var util=require(_0xc2a0('0x1'));var logger=require(_0xc2a0('0x2'))(_0xc2a0('0x3'));var moment=require(_0xc2a0('0x4'));var BPromise=require(_0xc2a0('0x5'));var rp=require(_0xc2a0('0x6'));var fs=require('fs');var path=require(_0xc2a0('0x7'));var rimraf=require(_0xc2a0('0x8'));var config=require('../../config/environment');var attributes=require(_0xc2a0('0x9'));module['exports']=function(_0x4d7d33,_0xe56712){return _0x4d7d33[_0xc2a0('0xa')]('Template',attributes,{'tableName':_0xc2a0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 58868e2..83c93e5 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 _0xcd84=['rpc','../../config/environment','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTemplate','Template','findAll','options','raw','where','include','map','attributes','model','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xcd84,0x1d9));var _0x4cd8=function(_0x236812,_0x40484a){_0x236812=_0x236812-0x0;var _0x28b8e2=_0xcd84[_0x236812];return _0x28b8e2;};'use strict';var _=require('lodash');var util=require(_0x4cd8('0x0'));var moment=require(_0x4cd8('0x1'));var BPromise=require(_0x4cd8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4cd8('0x3'));var db=require(_0x4cd8('0x4'))['db'];var utils=require(_0x4cd8('0x5'));var logger=require(_0x4cd8('0x6'))(_0x4cd8('0x7'));var config=require(_0x4cd8('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4cd8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x427835,_0x2fc73f,_0x6cfede){return new BPromise(function(_0x25400f,_0x3389c6){return client[_0x4cd8('0xa')](_0x427835,_0x6cfede)[_0x4cd8('0xb')](function(_0xc4ab9f){logger[_0x4cd8('0xc')](_0x4cd8('0xd'),_0x2fc73f,_0x4cd8('0xe'));logger[_0x4cd8('0xf')](_0x4cd8('0x10'),_0x2fc73f,'request\x20sent',JSON[_0x4cd8('0x11')](_0xc4ab9f));if(_0xc4ab9f[_0x4cd8('0x12')]){if(_0xc4ab9f[_0x4cd8('0x12')][_0x4cd8('0x13')]===0x1f4){logger[_0x4cd8('0x12')](_0x4cd8('0xd'),_0x2fc73f,_0xc4ab9f[_0x4cd8('0x12')][_0x4cd8('0x14')]);return _0x3389c6(_0xc4ab9f[_0x4cd8('0x12')][_0x4cd8('0x14')]);}logger[_0x4cd8('0x12')](_0x4cd8('0xd'),_0x2fc73f,_0xc4ab9f[_0x4cd8('0x12')]['message']);return _0x25400f(_0xc4ab9f[_0x4cd8('0x12')]['message']);}else{logger[_0x4cd8('0xc')](_0x4cd8('0xd'),_0x2fc73f,_0x4cd8('0xe'));_0x25400f(_0xc4ab9f['result'][_0x4cd8('0x14')]);}})[_0x4cd8('0x15')](function(_0x3d0f97){logger[_0x4cd8('0x12')]('Template,\x20%s,\x20%s',_0x2fc73f,_0x3d0f97);_0x3389c6(_0x3d0f97);});});}exports[_0x4cd8('0x16')]=function(_0x47a364){var _0x216aa0=this;return new Promise(function(_0x21b3b6,_0x2a666e){return db[_0x4cd8('0x17')][_0x4cd8('0x18')]({'raw':_0x47a364[_0x4cd8('0x19')]?_0x47a364[_0x4cd8('0x19')][_0x4cd8('0x1a')]===undefined?!![]:![]:!![],'where':_0x47a364[_0x4cd8('0x19')]?_0x47a364[_0x4cd8('0x19')][_0x4cd8('0x1b')]||null:null,'attributes':_0x47a364[_0x4cd8('0x19')]?_0x47a364['options']['attributes']||null:null,'limit':_0x47a364[_0x4cd8('0x19')]?_0x47a364[_0x4cd8('0x19')]['limit']||null:null,'include':_0x47a364[_0x4cd8('0x19')]?_0x47a364[_0x4cd8('0x19')][_0x4cd8('0x1c')]?_[_0x4cd8('0x1d')](_0x47a364[_0x4cd8('0x19')]['include'],function(_0x4ea593){return{'model':db[_0x4ea593['model']],'as':_0x4ea593['as'],'attributes':_0x4ea593[_0x4cd8('0x1e')],'include':_0x4ea593[_0x4cd8('0x1c')]?_['map'](_0x4ea593[_0x4cd8('0x1c')],function(_0x5b0f5f){return{'model':db[_0x5b0f5f[_0x4cd8('0x1f')]],'as':_0x5b0f5f['as'],'attributes':_0x5b0f5f['attributes'],'include':_0x5b0f5f[_0x4cd8('0x1c')]?_[_0x4cd8('0x1d')](_0x5b0f5f[_0x4cd8('0x1c')],function(_0x2675ab){return{'model':db[_0x2675ab[_0x4cd8('0x1f')]],'as':_0x2675ab['as'],'attributes':_0x2675ab[_0x4cd8('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x4cd8('0xb')](function(_0x4656d4){logger[_0x4cd8('0xc')](_0x4cd8('0x16'),_0x47a364);logger['debug'](_0x4cd8('0x16'),_0x47a364,JSON[_0x4cd8('0x11')](_0x4656d4));_0x21b3b6(_0x4656d4);})[_0x4cd8('0x15')](function(_0x3cda62){logger[_0x4cd8('0x12')]('GetTemplate',_0x3cda62[_0x4cd8('0x14')],_0x47a364);_0x2a666e(_0x216aa0['error'](0x1f4,_0x3cda62['message']));});});}; \ No newline at end of file +var _0x51bd=['../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','Template,\x20%s,\x20%s','message','result','catch','GetTemplate','Template','findAll','options','raw','attributes','include','map','model','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x51bd,0x122));var _0xd51b=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x51bd[_0x27af45];return _0x18df21;};'use strict';var _=require('lodash');var util=require(_0xd51b('0x0'));var moment=require('moment');var BPromise=require(_0xd51b('0x1'));var rs=require(_0xd51b('0x2'));var fs=require('fs');var Redis=require(_0xd51b('0x3'));var db=require(_0xd51b('0x4'))['db'];var utils=require(_0xd51b('0x5'));var logger=require('../../config/logger')(_0xd51b('0x6'));var config=require(_0xd51b('0x7'));var jayson=require(_0xd51b('0x8'));var client=jayson[_0xd51b('0x9')][_0xd51b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36b316,_0x4a231a,_0x2e6217){return new BPromise(function(_0x220c22,_0x119b4d){return client[_0xd51b('0xb')](_0x36b316,_0x2e6217)[_0xd51b('0xc')](function(_0x182a43){logger[_0xd51b('0xd')]('Template,\x20%s,\x20%s',_0x4a231a,_0xd51b('0xe'));logger[_0xd51b('0xf')](_0xd51b('0x10'),_0x4a231a,_0xd51b('0xe'),JSON[_0xd51b('0x11')](_0x182a43));if(_0x182a43[_0xd51b('0x12')]){if(_0x182a43[_0xd51b('0x12')][_0xd51b('0x13')]===0x1f4){logger[_0xd51b('0x12')](_0xd51b('0x14'),_0x4a231a,_0x182a43[_0xd51b('0x12')][_0xd51b('0x15')]);return _0x119b4d(_0x182a43[_0xd51b('0x12')][_0xd51b('0x15')]);}logger[_0xd51b('0x12')]('Template,\x20%s,\x20%s',_0x4a231a,_0x182a43['error'][_0xd51b('0x15')]);return _0x220c22(_0x182a43[_0xd51b('0x12')][_0xd51b('0x15')]);}else{logger[_0xd51b('0xd')]('Template,\x20%s,\x20%s',_0x4a231a,_0xd51b('0xe'));_0x220c22(_0x182a43[_0xd51b('0x16')][_0xd51b('0x15')]);}})[_0xd51b('0x17')](function(_0x60c44c){logger[_0xd51b('0x12')](_0xd51b('0x14'),_0x4a231a,_0x60c44c);_0x119b4d(_0x60c44c);});});}exports[_0xd51b('0x18')]=function(_0x364026){var _0x517f4d=this;return new Promise(function(_0x522d51,_0x219059){return db[_0xd51b('0x19')][_0xd51b('0x1a')]({'raw':_0x364026['options']?_0x364026[_0xd51b('0x1b')][_0xd51b('0x1c')]===undefined?!![]:![]:!![],'where':_0x364026[_0xd51b('0x1b')]?_0x364026[_0xd51b('0x1b')]['where']||null:null,'attributes':_0x364026['options']?_0x364026[_0xd51b('0x1b')][_0xd51b('0x1d')]||null:null,'limit':_0x364026[_0xd51b('0x1b')]?_0x364026['options']['limit']||null:null,'include':_0x364026[_0xd51b('0x1b')]?_0x364026[_0xd51b('0x1b')][_0xd51b('0x1e')]?_[_0xd51b('0x1f')](_0x364026[_0xd51b('0x1b')]['include'],function(_0x1a98da){return{'model':db[_0x1a98da[_0xd51b('0x20')]],'as':_0x1a98da['as'],'attributes':_0x1a98da['attributes'],'include':_0x1a98da[_0xd51b('0x1e')]?_[_0xd51b('0x1f')](_0x1a98da[_0xd51b('0x1e')],function(_0x2fdc3c){return{'model':db[_0x2fdc3c[_0xd51b('0x20')]],'as':_0x2fdc3c['as'],'attributes':_0x2fdc3c[_0xd51b('0x1d')],'include':_0x2fdc3c[_0xd51b('0x1e')]?_['map'](_0x2fdc3c[_0xd51b('0x1e')],function(_0x25f613){return{'model':db[_0x25f613['model']],'as':_0x25f613['as'],'attributes':_0x25f613['attributes']};}):[]};}):[]};}):[]:[]})[_0xd51b('0xc')](function(_0x51d89e){logger[_0xd51b('0xd')](_0xd51b('0x18'),_0x364026);logger[_0xd51b('0xf')]('GetTemplate',_0x364026,JSON[_0xd51b('0x11')](_0x51d89e));_0x522d51(_0x51d89e);})[_0xd51b('0x17')](function(_0x310a79){logger[_0xd51b('0x12')]('GetTemplate',_0x310a79[_0xd51b('0x15')],_0x364026);_0x219059(_0x517f4d[_0xd51b('0x12')](0x1f4,_0x310a79[_0xd51b('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 8c2170e..9c4e0ab 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 _0xe3f6=['isAuthenticated','index','/:id/all_conditions','/:id/any_conditions','getAnyConditions','/:id/actions','create','post','addAllCondition','addAction','put','/:id','update','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','get'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe3f6,0x92));var _0x6e3f=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xe3f6[_0x616290];return _0x453879;};'use strict';var multer=require(_0x6e3f('0x0'));var util=require(_0x6e3f('0x1'));var path=require(_0x6e3f('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e3f('0x3'));var router=express['Router']();var fs_extra=require(_0x6e3f('0x4'));var auth=require(_0x6e3f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6e3f('0x6'));var controller=require('./trigger.controller');router[_0x6e3f('0x7')]('/',auth[_0x6e3f('0x8')](),controller[_0x6e3f('0x9')]);router[_0x6e3f('0x7')]('/:id',auth[_0x6e3f('0x8')](),controller['show']);router[_0x6e3f('0x7')](_0x6e3f('0xa'),auth[_0x6e3f('0x8')](),controller['getAllConditions']);router[_0x6e3f('0x7')](_0x6e3f('0xb'),auth[_0x6e3f('0x8')](),controller[_0x6e3f('0xc')]);router[_0x6e3f('0x7')](_0x6e3f('0xd'),auth[_0x6e3f('0x8')](),controller['getActions']);router['post']('/',auth['isAuthenticated'](),controller[_0x6e3f('0xe')]);router[_0x6e3f('0xf')](_0x6e3f('0xa'),auth[_0x6e3f('0x8')](),controller[_0x6e3f('0x10')]);router[_0x6e3f('0xf')]('/:id/any_conditions',auth[_0x6e3f('0x8')](),controller['addAnyCondition']);router['post'](_0x6e3f('0xd'),auth[_0x6e3f('0x8')](),controller[_0x6e3f('0x11')]);router[_0x6e3f('0x12')](_0x6e3f('0x13'),auth['isAuthenticated'](),controller[_0x6e3f('0x14')]);router['delete'](_0x6e3f('0x13'),auth['isAuthenticated'](),controller['destroy']);module[_0x6e3f('0x15')]=router; \ No newline at end of file +var _0x3ee0=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','/:id/all_conditions','addAction','put','update','destroy','multer','util'];(function(_0xc67528,_0x24e2fb){var _0x38e26d=function(_0x1b0efe){while(--_0x1b0efe){_0xc67528['push'](_0xc67528['shift']());}};_0x38e26d(++_0x24e2fb);}(_0x3ee0,0x196));var _0x03ee=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x3ee0[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x03ee('0x0'));var util=require(_0x03ee('0x1'));var path=require('path');var timeout=require(_0x03ee('0x2'));var express=require(_0x03ee('0x3'));var router=express[_0x03ee('0x4')]();var fs_extra=require(_0x03ee('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x03ee('0x6'));var config=require(_0x03ee('0x7'));var controller=require('./trigger.controller');router[_0x03ee('0x8')]('/',auth[_0x03ee('0x9')](),controller[_0x03ee('0xa')]);router[_0x03ee('0x8')](_0x03ee('0xb'),auth[_0x03ee('0x9')](),controller[_0x03ee('0xc')]);router['get']('/:id/all_conditions',auth['isAuthenticated'](),controller[_0x03ee('0xd')]);router['get'](_0x03ee('0xe'),auth[_0x03ee('0x9')](),controller[_0x03ee('0xf')]);router[_0x03ee('0x8')](_0x03ee('0x10'),auth['isAuthenticated'](),controller[_0x03ee('0x11')]);router[_0x03ee('0x12')]('/',auth[_0x03ee('0x9')](),controller['create']);router[_0x03ee('0x12')](_0x03ee('0x13'),auth[_0x03ee('0x9')](),controller['addAllCondition']);router[_0x03ee('0x12')](_0x03ee('0xe'),auth[_0x03ee('0x9')](),controller['addAnyCondition']);router[_0x03ee('0x12')](_0x03ee('0x10'),auth[_0x03ee('0x9')](),controller[_0x03ee('0x14')]);router[_0x03ee('0x15')](_0x03ee('0xb'),auth[_0x03ee('0x9')](),controller[_0x03ee('0x16')]);router['delete']('/:id',auth[_0x03ee('0x9')](),controller[_0x03ee('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index ebea0b9..f505c03 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 _0xaf70=['STRING','exports'];(function(_0x39a6ca,_0x10c9f0){var _0x752c2f=function(_0x3f6ed1){while(--_0x3f6ed1){_0x39a6ca['push'](_0x39a6ca['shift']());}};_0x752c2f(++_0x10c9f0);}(_0xaf70,0x10d));var _0x0af7=function(_0x5c737b,_0x13ad79){_0x5c737b=_0x5c737b-0x0;var _0x2b0492=_0xaf70[_0x5c737b];return _0x2b0492;};'use strict';var Sequelize=require('sequelize');module[_0x0af7('0x0')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0af7('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa8a5=['sequelize','exports','STRING','BOOLEAN'];(function(_0x54c192,_0x458ab4){var _0x566735=function(_0x5018b9){while(--_0x5018b9){_0x54c192['push'](_0x54c192['shift']());}};_0x566735(++_0x458ab4);}(_0xa8a5,0xfc));var _0x5a8a=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0xa8a5[_0x50f392];return _0x5926f2;};'use strict';var Sequelize=require(_0x5a8a('0x0'));module[_0x5a8a('0x1')]={'name':{'type':Sequelize[_0x5a8a('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5a8a('0x2')]},'status':{'type':Sequelize[_0x5a8a('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 2477d69..ffd26a2 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 _0x5eb4=['TriggerAnyId','Condition','getAllConditions','findOne','getAnyConditions','pick','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','apply','reject','save','update','UserProfileResource','destroy','then','sendStatus','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','rows','params','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','catch','body','addAllCondition','TriggerAllId'];(function(_0x51d84c,_0x303457){var _0x52a4f2=function(_0x267d3a){while(--_0x267d3a){_0x51d84c['push'](_0x51d84c['shift']());}};_0x52a4f2(++_0x303457);}(_0x5eb4,0x1d6));var _0x45eb=function(_0x15c83b,_0x1299cc){_0x15c83b=_0x15c83b-0x0;var _0x1a54ef=_0x5eb4[_0x15c83b];return _0x1a54ef;};'use strict';var emlformat=require(_0x45eb('0x0'));var rimraf=require(_0x45eb('0x1'));var zipdir=require(_0x45eb('0x2'));var jsonpatch=require(_0x45eb('0x3'));var rp=require('request-promise');var moment=require(_0x45eb('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x45eb('0x5'));var path=require(_0x45eb('0x6'));var sox=require(_0x45eb('0x7'));var csv=require(_0x45eb('0x8'));var ejs=require(_0x45eb('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x45eb('0xa'));var crypto=require(_0x45eb('0xb'));var jsforce=require(_0x45eb('0xc'));var deskjs=require(_0x45eb('0xd'));var toCsv=require(_0x45eb('0x8'));var querystring=require(_0x45eb('0xe'));var Papa=require(_0x45eb('0xf'));var Redis=require('ioredis');var authService=require(_0x45eb('0x10'));var qs=require(_0x45eb('0x11'));var as=require(_0x45eb('0x12'));var hardwareService=require(_0x45eb('0x13'));var logger=require('../../config/logger')(_0x45eb('0x14'));var utils=require(_0x45eb('0x15'));var config=require(_0x45eb('0x16'));var licenseUtil=require(_0x45eb('0x17'));var db=require(_0x45eb('0x18'))['db'];function respondWithStatusCode(_0x4cc905,_0x3c581f){_0x3c581f=_0x3c581f||0xcc;return function(_0x1761b6){if(_0x1761b6){return _0x4cc905['sendStatus'](_0x3c581f);}return _0x4cc905[_0x45eb('0x19')](_0x3c581f)[_0x45eb('0x1a')]();};}function respondWithResult(_0x3163ad,_0x210c03){_0x210c03=_0x210c03||0xc8;return function(_0x4bd580){if(_0x4bd580){return _0x3163ad[_0x45eb('0x19')](_0x210c03)[_0x45eb('0x1b')](_0x4bd580);}};}function respondWithFilteredResult(_0x371524,_0xe528f){return function(_0x2aba46){if(_0x2aba46){var _0xe24d6d=typeof _0xe528f[_0x45eb('0x1c')]===_0x45eb('0x1d')&&typeof _0xe528f[_0x45eb('0x1e')]===_0x45eb('0x1d');var _0x103cd9=_0x2aba46[_0x45eb('0x1f')];var _0x49720a=_0xe24d6d?0x0:_0xe528f[_0x45eb('0x1c')];var _0x51dcab=_0xe24d6d?_0x2aba46['count']:_0xe528f['offset']+_0xe528f[_0x45eb('0x1e')];var _0x4e2e1a;if(_0x51dcab>=_0x103cd9){_0x51dcab=_0x103cd9;_0x4e2e1a=0xc8;}else{_0x4e2e1a=0xce;}_0x371524['status'](_0x4e2e1a);return _0x371524['set']('Content-Range',_0x49720a+'-'+_0x51dcab+'/'+_0x103cd9)[_0x45eb('0x1b')](_0x2aba46);}return null;};}function patchUpdates(_0x50ddd2){return function(_0x241099){try{jsonpatch[_0x45eb('0x20')](_0x241099,_0x50ddd2,!![]);}catch(_0x262b55){return BPromise[_0x45eb('0x21')](_0x262b55);}return _0x241099[_0x45eb('0x22')]();};}function saveUpdates(_0x5e0435,_0x231082){return function(_0x26e976){if(_0x26e976){return _0x26e976[_0x45eb('0x23')](_0x5e0435)['then'](function(_0x164ddf){return _0x164ddf;});}return null;};}function removeEntity(_0x473e2d,_0x167725){return function(_0x289902){if(_0x289902){return _0x289902['destroy']()['then'](function(){var _0x56cc58=_0x289902['get']({'plain':!![]});var _0x4b9fb4='Triggers';return db[_0x45eb('0x24')][_0x45eb('0x25')]({'where':{'type':_0x4b9fb4,'resourceId':_0x56cc58['id']}})[_0x45eb('0x26')](function(){return _0x289902;});})[_0x45eb('0x26')](function(){_0x473e2d[_0x45eb('0x19')](0xcc)[_0x45eb('0x1a')]();});}};}function handleEntityNotFound(_0x12524d,_0x2d0373){return function(_0xdd6a28){if(!_0xdd6a28){_0x12524d[_0x45eb('0x27')](0x194);}return _0xdd6a28;};}function handleError(_0x150ac4,_0x5b4a4a){_0x5b4a4a=_0x5b4a4a||0x1f4;return function(_0x2a62e1){logger[_0x45eb('0x28')](_0x2a62e1[_0x45eb('0x29')]);if(_0x2a62e1[_0x45eb('0x2a')]){delete _0x2a62e1['name'];}_0x150ac4[_0x45eb('0x19')](_0x5b4a4a)[_0x45eb('0x2b')](_0x2a62e1);};}exports[_0x45eb('0x2c')]=function(_0x44ac5e,_0x455b85){var _0x56acb8={},_0x4e3122={},_0x5ed7b2={'count':0x0,'rows':[]};var _0x3c15f0=_[_0x45eb('0x2d')](db[_0x45eb('0x2e')][_0x45eb('0x2f')],function(_0x2ddc63){return{'name':_0x2ddc63[_0x45eb('0x30')],'type':_0x2ddc63[_0x45eb('0x31')]['key']};});_0x4e3122[_0x45eb('0x32')]=_[_0x45eb('0x2d')](_0x3c15f0,_0x45eb('0x2a'));_0x4e3122[_0x45eb('0x33')]=_[_0x45eb('0x34')](_0x44ac5e[_0x45eb('0x33')]);_0x4e3122[_0x45eb('0x35')]=_[_0x45eb('0x36')](_0x4e3122[_0x45eb('0x32')],_0x4e3122[_0x45eb('0x33')]);_0x56acb8[_0x45eb('0x37')]=_[_0x45eb('0x36')](_0x4e3122['model'],qs[_0x45eb('0x38')](_0x44ac5e[_0x45eb('0x33')][_0x45eb('0x38')]));_0x56acb8[_0x45eb('0x37')]=_0x56acb8['attributes'][_0x45eb('0x39')]?_0x56acb8[_0x45eb('0x37')]:_0x4e3122[_0x45eb('0x32')];if(!_0x44ac5e[_0x45eb('0x33')][_0x45eb('0x3a')](_0x45eb('0x3b'))){_0x56acb8[_0x45eb('0x1e')]=qs[_0x45eb('0x1e')](_0x44ac5e[_0x45eb('0x33')][_0x45eb('0x1e')]);_0x56acb8[_0x45eb('0x1c')]=qs[_0x45eb('0x1c')](_0x44ac5e[_0x45eb('0x33')][_0x45eb('0x1c')]);}_0x56acb8[_0x45eb('0x3c')]=qs[_0x45eb('0x3d')](_0x44ac5e[_0x45eb('0x33')][_0x45eb('0x3d')]);_0x56acb8[_0x45eb('0x3e')]=qs[_0x45eb('0x35')](_['pick'](_0x44ac5e[_0x45eb('0x33')],_0x4e3122[_0x45eb('0x35')]),_0x3c15f0);if(_0x44ac5e['query'][_0x45eb('0x3f')]){_0x56acb8['where']=_['merge'](_0x56acb8[_0x45eb('0x3e')],{'$or':_[_0x45eb('0x2d')](_0x3c15f0,function(_0x1d7207){if(_0x1d7207[_0x45eb('0x31')]!==_0x45eb('0x40')){var _0x2c7d27={};_0x2c7d27[_0x1d7207[_0x45eb('0x2a')]]={'$like':'%'+_0x44ac5e['query']['filter']+'%'};return _0x2c7d27;}})});}_0x56acb8=_[_0x45eb('0x41')]({},_0x56acb8,_0x44ac5e[_0x45eb('0x42')]);var _0x38c350={'where':_0x56acb8[_0x45eb('0x3e')]};return db[_0x45eb('0x2e')][_0x45eb('0x1f')](_0x38c350)[_0x45eb('0x26')](function(_0x705c5e){_0x5ed7b2[_0x45eb('0x1f')]=_0x705c5e;if(_0x44ac5e[_0x45eb('0x33')][_0x45eb('0x43')]){_0x56acb8['include']=[{'all':!![]}];}return db[_0x45eb('0x2e')]['findAll'](_0x56acb8);})['then'](function(_0x3ab2d1){_0x5ed7b2[_0x45eb('0x44')]=_0x3ab2d1;return _0x5ed7b2;})[_0x45eb('0x26')](respondWithFilteredResult(_0x455b85,_0x56acb8))['catch'](handleError(_0x455b85,null));};exports['show']=function(_0x4a56d1,_0xcdf901){var _0x3ffefa={'raw':![],'where':{'id':_0x4a56d1[_0x45eb('0x45')]['id']}},_0x5ec5a5={};_0x5ec5a5[_0x45eb('0x32')]=_[_0x45eb('0x34')](db[_0x45eb('0x2e')]['rawAttributes']);_0x5ec5a5[_0x45eb('0x33')]=_[_0x45eb('0x34')](_0x4a56d1[_0x45eb('0x33')]);_0x5ec5a5['filters']=_[_0x45eb('0x36')](_0x5ec5a5['model'],_0x5ec5a5[_0x45eb('0x33')]);_0x3ffefa['attributes']=_[_0x45eb('0x36')](_0x5ec5a5[_0x45eb('0x32')],qs[_0x45eb('0x38')](_0x4a56d1[_0x45eb('0x33')][_0x45eb('0x38')]));_0x3ffefa['attributes']=_0x3ffefa[_0x45eb('0x37')][_0x45eb('0x39')]?_0x3ffefa[_0x45eb('0x37')]:_0x5ec5a5[_0x45eb('0x32')];if(_0x4a56d1['query'][_0x45eb('0x43')]){_0x3ffefa[_0x45eb('0x46')]=[{'all':!![]}];}_0x3ffefa=_['merge']({},_0x3ffefa,_0x4a56d1[_0x45eb('0x42')]);return db['Trigger'][_0x45eb('0x47')](_0x3ffefa)[_0x45eb('0x26')](handleEntityNotFound(_0xcdf901,null))[_0x45eb('0x26')](respondWithResult(_0xcdf901,null))['catch'](handleError(_0xcdf901,null));};exports[_0x45eb('0x48')]=function(_0x1e5adc,_0x4738f7){return db[_0x45eb('0x2e')]['create'](_0x1e5adc['body'],{})[_0x45eb('0x26')](function(_0x4bfe7d){var _0x150285=_0x1e5adc[_0x45eb('0x49')][_0x45eb('0x4a')]({'plain':!![]});if(!_0x150285)throw new Error(_0x45eb('0x4b'));if(_0x150285[_0x45eb('0x4c')]===_0x45eb('0x49')){var _0xc77996=_0x4bfe7d[_0x45eb('0x4a')]({'plain':!![]});var _0x1d801c='Triggers';return db[_0x45eb('0x4d')][_0x45eb('0x47')]({'where':{'name':_0x1d801c,'userProfileId':_0x150285['userProfileId']},'raw':!![]})[_0x45eb('0x26')](function(_0x3fe992){if(_0x3fe992&&_0x3fe992['autoAssociation']===0x0){return db[_0x45eb('0x24')][_0x45eb('0x48')]({'name':_0xc77996['name'],'resourceId':_0xc77996['id'],'type':_0x3fe992[_0x45eb('0x2a')],'sectionId':_0x3fe992['id']},{})[_0x45eb('0x26')](function(){return _0x4bfe7d;});}else{return _0x4bfe7d;}})[_0x45eb('0x4e')](function(_0xae871b){logger[_0x45eb('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xae871b);throw _0xae871b;});}return _0x4bfe7d;})['then'](respondWithResult(_0x4738f7,0xc9))[_0x45eb('0x4e')](handleError(_0x4738f7,null));};exports[_0x45eb('0x23')]=function(_0x421be8,_0x1e8604){if(_0x421be8[_0x45eb('0x4f')]['id']){delete _0x421be8['body']['id'];}return db['Trigger'][_0x45eb('0x47')]({'where':{'id':_0x421be8[_0x45eb('0x45')]['id']}})['then'](handleEntityNotFound(_0x1e8604,null))[_0x45eb('0x26')](saveUpdates(_0x421be8[_0x45eb('0x4f')],null))[_0x45eb('0x26')](respondWithResult(_0x1e8604,null))[_0x45eb('0x4e')](handleError(_0x1e8604,null));};exports[_0x45eb('0x25')]=function(_0x24eb54,_0xaf5b03){return db[_0x45eb('0x2e')]['find']({'where':{'id':_0x24eb54[_0x45eb('0x45')]['id']}})['then'](handleEntityNotFound(_0xaf5b03,null))[_0x45eb('0x26')](removeEntity(_0xaf5b03,null))['catch'](handleError(_0xaf5b03,null));};exports[_0x45eb('0x50')]=function(_0x218fb8,_0xc02d32,_0x2c78a2){if(_0x218fb8[_0x45eb('0x4f')]['id']){delete _0x218fb8[_0x45eb('0x4f')]['id'];}return db[_0x45eb('0x2e')][_0x45eb('0x47')]({'where':{'id':_0x218fb8[_0x45eb('0x45')]['id']}})[_0x45eb('0x26')](handleEntityNotFound(_0xc02d32,null))[_0x45eb('0x26')](function(_0x52a76f){if(_0x52a76f){_0x218fb8[_0x45eb('0x4f')][_0x45eb('0x51')]=_0x52a76f['id'];return db['Condition'][_0x45eb('0x48')](_0x218fb8['body']);}})[_0x45eb('0x26')](respondWithResult(_0xc02d32,null))[_0x45eb('0x4e')](handleError(_0xc02d32,null));};exports['addAnyCondition']=function(_0x3e94a7,_0x9ee309,_0x5ef509){if(_0x3e94a7['body']['id']){delete _0x3e94a7[_0x45eb('0x4f')]['id'];}return db[_0x45eb('0x2e')]['find']({'where':{'id':_0x3e94a7[_0x45eb('0x45')]['id']}})[_0x45eb('0x26')](handleEntityNotFound(_0x9ee309,null))[_0x45eb('0x26')](function(_0x214b9d){if(_0x214b9d){_0x3e94a7[_0x45eb('0x4f')][_0x45eb('0x52')]=_0x214b9d['id'];return db[_0x45eb('0x53')][_0x45eb('0x48')](_0x3e94a7[_0x45eb('0x4f')]);}})['then'](respondWithResult(_0x9ee309,null))['catch'](handleError(_0x9ee309,null));};exports[_0x45eb('0x54')]=function(_0x277a1d,_0x2b9d52,_0x153228){var _0x15a910={};var _0x4fc7c6={};var _0xe8c72e;var _0x5afcee;return db[_0x45eb('0x2e')][_0x45eb('0x55')]({'where':{'id':_0x277a1d['params']['id']}})['then'](handleEntityNotFound(_0x2b9d52,null))['then'](function(_0x12a767){if(_0x12a767){_0xe8c72e=_0x12a767;_0x4fc7c6[_0x45eb('0x32')]=_[_0x45eb('0x34')](db[_0x45eb('0x53')][_0x45eb('0x2f')]);_0x4fc7c6['query']=_[_0x45eb('0x34')](_0x277a1d[_0x45eb('0x33')]);_0x4fc7c6['filters']=_[_0x45eb('0x36')](_0x4fc7c6[_0x45eb('0x32')],_0x4fc7c6['query']);_0x15a910[_0x45eb('0x37')]=_[_0x45eb('0x36')](_0x4fc7c6['model'],qs[_0x45eb('0x38')](_0x277a1d[_0x45eb('0x33')][_0x45eb('0x38')]));_0x15a910[_0x45eb('0x37')]=_0x15a910[_0x45eb('0x37')][_0x45eb('0x39')]?_0x15a910[_0x45eb('0x37')]:_0x4fc7c6['model'];_0x15a910['order']=qs[_0x45eb('0x3d')](_0x277a1d[_0x45eb('0x33')][_0x45eb('0x3d')]);_0x15a910[_0x45eb('0x3e')]=qs[_0x45eb('0x35')](_['pick'](_0x277a1d['query'],_0x4fc7c6[_0x45eb('0x35')]));if(_0x277a1d[_0x45eb('0x33')][_0x45eb('0x3f')]){_0x15a910[_0x45eb('0x3e')]=_[_0x45eb('0x41')](_0x15a910[_0x45eb('0x3e')],{'$or':_['map'](_0x15a910['attributes'],function(_0x2ab2e6){var _0x2ae790={};_0x2ae790[_0x2ab2e6]={'$like':'%'+_0x277a1d[_0x45eb('0x33')][_0x45eb('0x3f')]+'%'};return _0x2ae790;})});}_0x15a910=_[_0x45eb('0x41')]({},_0x15a910,_0x277a1d[_0x45eb('0x42')]);return _0xe8c72e[_0x45eb('0x54')](_0x15a910);}})[_0x45eb('0x26')](function(_0x49fb58){if(_0x49fb58){_0x5afcee=_0x49fb58[_0x45eb('0x39')];if(!_0x277a1d[_0x45eb('0x33')]['hasOwnProperty']('nolimit')){_0x15a910[_0x45eb('0x1e')]=qs[_0x45eb('0x1e')](_0x277a1d[_0x45eb('0x33')][_0x45eb('0x1e')]);_0x15a910['offset']=qs['offset'](_0x277a1d[_0x45eb('0x33')]['offset']);}return _0xe8c72e[_0x45eb('0x54')](_0x15a910);}})[_0x45eb('0x26')](function(_0x971fa1){if(_0x971fa1){return _0x971fa1?{'count':_0x5afcee,'rows':_0x971fa1}:null;}})[_0x45eb('0x26')](respondWithResult(_0x2b9d52,null))['catch'](handleError(_0x2b9d52,null));};exports[_0x45eb('0x56')]=function(_0x2a2a5f,_0x215b48,_0x193f92){var _0x2a2959={};var _0x398266={};var _0x1d35b3;var _0x1093dd;return db[_0x45eb('0x2e')][_0x45eb('0x55')]({'where':{'id':_0x2a2a5f[_0x45eb('0x45')]['id']}})[_0x45eb('0x26')](handleEntityNotFound(_0x215b48,null))[_0x45eb('0x26')](function(_0x2ad73b){if(_0x2ad73b){_0x1d35b3=_0x2ad73b;_0x398266['model']=_['keys'](db[_0x45eb('0x53')][_0x45eb('0x2f')]);_0x398266[_0x45eb('0x33')]=_['keys'](_0x2a2a5f[_0x45eb('0x33')]);_0x398266[_0x45eb('0x35')]=_[_0x45eb('0x36')](_0x398266['model'],_0x398266[_0x45eb('0x33')]);_0x2a2959[_0x45eb('0x37')]=_['intersection'](_0x398266[_0x45eb('0x32')],qs['fields'](_0x2a2a5f[_0x45eb('0x33')][_0x45eb('0x38')]));_0x2a2959[_0x45eb('0x37')]=_0x2a2959[_0x45eb('0x37')][_0x45eb('0x39')]?_0x2a2959[_0x45eb('0x37')]:_0x398266[_0x45eb('0x32')];_0x2a2959[_0x45eb('0x3c')]=qs[_0x45eb('0x3d')](_0x2a2a5f[_0x45eb('0x33')]['sort']);_0x2a2959[_0x45eb('0x3e')]=qs[_0x45eb('0x35')](_[_0x45eb('0x57')](_0x2a2a5f['query'],_0x398266[_0x45eb('0x35')]));if(_0x2a2a5f[_0x45eb('0x33')][_0x45eb('0x3f')]){_0x2a2959[_0x45eb('0x3e')]=_[_0x45eb('0x41')](_0x2a2959[_0x45eb('0x3e')],{'$or':_['map'](_0x2a2959['attributes'],function(_0x392d2b){var _0x4a685f={};_0x4a685f[_0x392d2b]={'$like':'%'+_0x2a2a5f['query'][_0x45eb('0x3f')]+'%'};return _0x4a685f;})});}_0x2a2959=_[_0x45eb('0x41')]({},_0x2a2959,_0x2a2a5f[_0x45eb('0x42')]);return _0x1d35b3[_0x45eb('0x56')](_0x2a2959);}})[_0x45eb('0x26')](function(_0x4d2f28){if(_0x4d2f28){_0x1093dd=_0x4d2f28[_0x45eb('0x39')];if(!_0x2a2a5f[_0x45eb('0x33')][_0x45eb('0x3a')](_0x45eb('0x3b'))){_0x2a2959[_0x45eb('0x1e')]=qs[_0x45eb('0x1e')](_0x2a2a5f['query']['limit']);_0x2a2959['offset']=qs[_0x45eb('0x1c')](_0x2a2a5f['query'][_0x45eb('0x1c')]);}return _0x1d35b3[_0x45eb('0x56')](_0x2a2959);}})['then'](function(_0xf45206){if(_0xf45206){return _0xf45206?{'count':_0x1093dd,'rows':_0xf45206}:null;}})[_0x45eb('0x26')](respondWithResult(_0x215b48,null))[_0x45eb('0x4e')](handleError(_0x215b48,null));};exports[_0x45eb('0x58')]=function(_0x81c22f,_0x55a18d,_0x3292d7){if(_0x81c22f[_0x45eb('0x4f')]['id']){delete _0x81c22f['body']['id'];}return db[_0x45eb('0x2e')][_0x45eb('0x47')]({'where':{'id':_0x81c22f['params']['id']}})[_0x45eb('0x26')](handleEntityNotFound(_0x55a18d,null))[_0x45eb('0x26')](function(_0x663c5f){if(_0x663c5f){_0x81c22f[_0x45eb('0x4f')][_0x45eb('0x59')]=_0x663c5f['id'];return db['Action'][_0x45eb('0x48')](_0x81c22f['body']);}})[_0x45eb('0x26')](respondWithResult(_0x55a18d,null))[_0x45eb('0x4e')](handleError(_0x55a18d,null));};exports['getActions']=function(_0x2cc0f2,_0x223608,_0x4b7195){var _0x400b58={};var _0x57453e={};var _0x171d25;var _0x522a21;return db[_0x45eb('0x2e')][_0x45eb('0x55')]({'where':{'id':_0x2cc0f2['params']['id']}})[_0x45eb('0x26')](handleEntityNotFound(_0x223608,null))[_0x45eb('0x26')](function(_0x5344da){if(_0x5344da){_0x171d25=_0x5344da;_0x57453e[_0x45eb('0x32')]=_[_0x45eb('0x34')](db[_0x45eb('0x5a')][_0x45eb('0x2f')]);_0x57453e['query']=_['keys'](_0x2cc0f2['query']);_0x57453e[_0x45eb('0x35')]=_[_0x45eb('0x36')](_0x57453e[_0x45eb('0x32')],_0x57453e[_0x45eb('0x33')]);_0x400b58['attributes']=_['intersection'](_0x57453e[_0x45eb('0x32')],qs[_0x45eb('0x38')](_0x2cc0f2['query'][_0x45eb('0x38')]));_0x400b58[_0x45eb('0x37')]=_0x400b58[_0x45eb('0x37')][_0x45eb('0x39')]?_0x400b58[_0x45eb('0x37')]:_0x57453e[_0x45eb('0x32')];_0x400b58[_0x45eb('0x3c')]=qs[_0x45eb('0x3d')](_0x2cc0f2[_0x45eb('0x33')][_0x45eb('0x3d')]);_0x400b58['where']=qs[_0x45eb('0x35')](_[_0x45eb('0x57')](_0x2cc0f2[_0x45eb('0x33')],_0x57453e[_0x45eb('0x35')]));if(_0x2cc0f2[_0x45eb('0x33')][_0x45eb('0x3f')]){_0x400b58[_0x45eb('0x3e')]=_[_0x45eb('0x41')](_0x400b58['where'],{'$or':_[_0x45eb('0x2d')](_0x400b58['attributes'],function(_0x5b7a8f){var _0x1d2bdc={};_0x1d2bdc[_0x5b7a8f]={'$like':'%'+_0x2cc0f2[_0x45eb('0x33')][_0x45eb('0x3f')]+'%'};return _0x1d2bdc;})});}_0x400b58=_[_0x45eb('0x41')]({},_0x400b58,_0x2cc0f2[_0x45eb('0x42')]);return _0x171d25[_0x45eb('0x5b')](_0x400b58);}})['then'](function(_0x51e6de){if(_0x51e6de){_0x522a21=_0x51e6de[_0x45eb('0x39')];if(!_0x2cc0f2[_0x45eb('0x33')][_0x45eb('0x3a')](_0x45eb('0x3b'))){_0x400b58[_0x45eb('0x1e')]=qs[_0x45eb('0x1e')](_0x2cc0f2[_0x45eb('0x33')][_0x45eb('0x1e')]);_0x400b58[_0x45eb('0x1c')]=qs[_0x45eb('0x1c')](_0x2cc0f2[_0x45eb('0x33')][_0x45eb('0x1c')]);}return _0x171d25[_0x45eb('0x5b')](_0x400b58);}})[_0x45eb('0x26')](function(_0x3f1650){if(_0x3f1650){return _0x3f1650?{'count':_0x522a21,'rows':_0x3f1650}:null;}})[_0x45eb('0x26')](respondWithResult(_0x223608,null))[_0x45eb('0x4e')](handleError(_0x223608,null));}; \ No newline at end of file +var _0xf915=['Triggers','UserProfileResource','error','name','index','map','Trigger','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','role','UserProfileSection','userProfileId','addAllCondition','Condition','addAnyCondition','findOne','length','order','getAllConditions','getAnyConditions','rawAttributes','nolimit','addAction','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy'];(function(_0x35db12,_0x3ac128){var _0x3b0856=function(_0x6f200){while(--_0x6f200){_0x35db12['push'](_0x35db12['shift']());}};_0x3b0856(++_0x3ac128);}(_0xf915,0x140));var _0x5f91=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xf915[_0x4e676e];return _0x336a3c;};'use strict';var emlformat=require(_0x5f91('0x0'));var rimraf=require(_0x5f91('0x1'));var zipdir=require(_0x5f91('0x2'));var jsonpatch=require(_0x5f91('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5f91('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5f91('0x5'));var sox=require(_0x5f91('0x6'));var csv=require('to-csv');var ejs=require(_0x5f91('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5f91('0x8'));var squel=require(_0x5f91('0x9'));var crypto=require('crypto');var jsforce=require(_0x5f91('0xa'));var deskjs=require(_0x5f91('0xb'));var toCsv=require(_0x5f91('0xc'));var querystring=require(_0x5f91('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5f91('0xe'));var qs=require(_0x5f91('0xf'));var as=require(_0x5f91('0x10'));var hardwareService=require(_0x5f91('0x11'));var logger=require(_0x5f91('0x12'))('api');var utils=require(_0x5f91('0x13'));var config=require(_0x5f91('0x14'));var licenseUtil=require(_0x5f91('0x15'));var db=require(_0x5f91('0x16'))['db'];function respondWithStatusCode(_0x395798,_0x3474b3){_0x3474b3=_0x3474b3||0xcc;return function(_0x16c87d){if(_0x16c87d){return _0x395798[_0x5f91('0x17')](_0x3474b3);}return _0x395798[_0x5f91('0x18')](_0x3474b3)[_0x5f91('0x19')]();};}function respondWithResult(_0x1831f8,_0x55e221){_0x55e221=_0x55e221||0xc8;return function(_0x3186fe){if(_0x3186fe){return _0x1831f8['status'](_0x55e221)['json'](_0x3186fe);}};}function respondWithFilteredResult(_0x328bf7,_0x18583e){return function(_0x3254cc){if(_0x3254cc){var _0xc6e164=typeof _0x18583e[_0x5f91('0x1a')]==='undefined'&&typeof _0x18583e[_0x5f91('0x1b')]==='undefined';var _0x34db71=_0x3254cc[_0x5f91('0x1c')];var _0x2bf029=_0xc6e164?0x0:_0x18583e[_0x5f91('0x1a')];var _0x1d981b=_0xc6e164?_0x3254cc[_0x5f91('0x1c')]:_0x18583e[_0x5f91('0x1a')]+_0x18583e[_0x5f91('0x1b')];var _0x1cb71f;if(_0x1d981b>=_0x34db71){_0x1d981b=_0x34db71;_0x1cb71f=0xc8;}else{_0x1cb71f=0xce;}_0x328bf7[_0x5f91('0x18')](_0x1cb71f);return _0x328bf7[_0x5f91('0x1d')](_0x5f91('0x1e'),_0x2bf029+'-'+_0x1d981b+'/'+_0x34db71)['json'](_0x3254cc);}return null;};}function patchUpdates(_0x916797){return function(_0x47cf9b){try{jsonpatch[_0x5f91('0x1f')](_0x47cf9b,_0x916797,!![]);}catch(_0x589f97){return BPromise[_0x5f91('0x20')](_0x589f97);}return _0x47cf9b['save']();};}function saveUpdates(_0x19a30f,_0x3127a1){return function(_0x53db3f){if(_0x53db3f){return _0x53db3f[_0x5f91('0x21')](_0x19a30f)[_0x5f91('0x22')](function(_0x2d3354){return _0x2d3354;});}return null;};}function removeEntity(_0x2caba6,_0x3f3760){return function(_0x5dbaa7){if(_0x5dbaa7){return _0x5dbaa7[_0x5f91('0x23')]()[_0x5f91('0x22')](function(){var _0x1beff9=_0x5dbaa7['get']({'plain':!![]});var _0x3f118d=_0x5f91('0x24');return db[_0x5f91('0x25')][_0x5f91('0x23')]({'where':{'type':_0x3f118d,'resourceId':_0x1beff9['id']}})[_0x5f91('0x22')](function(){return _0x5dbaa7;});})[_0x5f91('0x22')](function(){_0x2caba6['status'](0xcc)[_0x5f91('0x19')]();});}};}function handleEntityNotFound(_0x2b6290,_0x511702){return function(_0x3b5b2d){if(!_0x3b5b2d){_0x2b6290['sendStatus'](0x194);}return _0x3b5b2d;};}function handleError(_0x211d73,_0x11ffc7){_0x11ffc7=_0x11ffc7||0x1f4;return function(_0xf3eb48){logger[_0x5f91('0x26')](_0xf3eb48['stack']);if(_0xf3eb48[_0x5f91('0x27')]){delete _0xf3eb48[_0x5f91('0x27')];}_0x211d73['status'](_0x11ffc7)['send'](_0xf3eb48);};}exports[_0x5f91('0x28')]=function(_0x2d8873,_0x2d1aa7){var _0x4589e1={},_0x436a4b={},_0x1cc4c5={'count':0x0,'rows':[]};var _0x37f0fa=_[_0x5f91('0x29')](db[_0x5f91('0x2a')]['rawAttributes'],function(_0x1c4caa){return{'name':_0x1c4caa[_0x5f91('0x2b')],'type':_0x1c4caa[_0x5f91('0x2c')][_0x5f91('0x2d')]};});_0x436a4b[_0x5f91('0x2e')]=_[_0x5f91('0x29')](_0x37f0fa,_0x5f91('0x27'));_0x436a4b[_0x5f91('0x2f')]=_[_0x5f91('0x30')](_0x2d8873[_0x5f91('0x2f')]);_0x436a4b['filters']=_[_0x5f91('0x31')](_0x436a4b[_0x5f91('0x2e')],_0x436a4b[_0x5f91('0x2f')]);_0x4589e1[_0x5f91('0x32')]=_['intersection'](_0x436a4b[_0x5f91('0x2e')],qs[_0x5f91('0x33')](_0x2d8873['query'][_0x5f91('0x33')]));_0x4589e1[_0x5f91('0x32')]=_0x4589e1[_0x5f91('0x32')]['length']?_0x4589e1[_0x5f91('0x32')]:_0x436a4b['model'];if(!_0x2d8873[_0x5f91('0x2f')][_0x5f91('0x34')]('nolimit')){_0x4589e1[_0x5f91('0x1b')]=qs[_0x5f91('0x1b')](_0x2d8873[_0x5f91('0x2f')][_0x5f91('0x1b')]);_0x4589e1['offset']=qs[_0x5f91('0x1a')](_0x2d8873[_0x5f91('0x2f')][_0x5f91('0x1a')]);}_0x4589e1['order']=qs[_0x5f91('0x35')](_0x2d8873['query'][_0x5f91('0x35')]);_0x4589e1[_0x5f91('0x36')]=qs[_0x5f91('0x37')](_[_0x5f91('0x38')](_0x2d8873['query'],_0x436a4b[_0x5f91('0x37')]),_0x37f0fa);if(_0x2d8873[_0x5f91('0x2f')]['filter']){_0x4589e1[_0x5f91('0x36')]=_[_0x5f91('0x39')](_0x4589e1[_0x5f91('0x36')],{'$or':_[_0x5f91('0x29')](_0x37f0fa,function(_0x27cdbb){if(_0x27cdbb[_0x5f91('0x2c')]!==_0x5f91('0x3a')){var _0x3a29a5={};_0x3a29a5[_0x27cdbb[_0x5f91('0x27')]]={'$like':'%'+_0x2d8873[_0x5f91('0x2f')][_0x5f91('0x3b')]+'%'};return _0x3a29a5;}})});}_0x4589e1=_[_0x5f91('0x39')]({},_0x4589e1,_0x2d8873[_0x5f91('0x3c')]);var _0x12c4b3={'where':_0x4589e1[_0x5f91('0x36')]};return db['Trigger'][_0x5f91('0x1c')](_0x12c4b3)[_0x5f91('0x22')](function(_0x396c2b){_0x1cc4c5[_0x5f91('0x1c')]=_0x396c2b;if(_0x2d8873[_0x5f91('0x2f')][_0x5f91('0x3d')]){_0x4589e1[_0x5f91('0x3e')]=[{'all':!![]}];}return db[_0x5f91('0x2a')][_0x5f91('0x3f')](_0x4589e1);})[_0x5f91('0x22')](function(_0x19613e){_0x1cc4c5[_0x5f91('0x40')]=_0x19613e;return _0x1cc4c5;})[_0x5f91('0x22')](respondWithFilteredResult(_0x2d1aa7,_0x4589e1))[_0x5f91('0x41')](handleError(_0x2d1aa7,null));};exports[_0x5f91('0x42')]=function(_0x18aa5d,_0x313e01){var _0x510362={'raw':![],'where':{'id':_0x18aa5d[_0x5f91('0x43')]['id']}},_0x1c27a2={};_0x1c27a2[_0x5f91('0x2e')]=_[_0x5f91('0x30')](db[_0x5f91('0x2a')]['rawAttributes']);_0x1c27a2[_0x5f91('0x2f')]=_[_0x5f91('0x30')](_0x18aa5d[_0x5f91('0x2f')]);_0x1c27a2['filters']=_[_0x5f91('0x31')](_0x1c27a2['model'],_0x1c27a2[_0x5f91('0x2f')]);_0x510362[_0x5f91('0x32')]=_[_0x5f91('0x31')](_0x1c27a2['model'],qs[_0x5f91('0x33')](_0x18aa5d['query'][_0x5f91('0x33')]));_0x510362[_0x5f91('0x32')]=_0x510362[_0x5f91('0x32')]['length']?_0x510362['attributes']:_0x1c27a2[_0x5f91('0x2e')];if(_0x18aa5d['query'][_0x5f91('0x3d')]){_0x510362[_0x5f91('0x3e')]=[{'all':!![]}];}_0x510362=_[_0x5f91('0x39')]({},_0x510362,_0x18aa5d[_0x5f91('0x3c')]);return db[_0x5f91('0x2a')][_0x5f91('0x44')](_0x510362)[_0x5f91('0x22')](handleEntityNotFound(_0x313e01,null))[_0x5f91('0x22')](respondWithResult(_0x313e01,null))[_0x5f91('0x41')](handleError(_0x313e01,null));};exports[_0x5f91('0x45')]=function(_0x353e11,_0xd36f70){return db[_0x5f91('0x2a')][_0x5f91('0x45')](_0x353e11[_0x5f91('0x46')],{})[_0x5f91('0x22')](function(_0x17717d){var _0x40a777=_0x353e11[_0x5f91('0x47')][_0x5f91('0x48')]({'plain':!![]});if(!_0x40a777)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x40a777[_0x5f91('0x49')]==='user'){var _0x481a9e=_0x17717d[_0x5f91('0x48')]({'plain':!![]});var _0x10084d=_0x5f91('0x24');return db[_0x5f91('0x4a')][_0x5f91('0x44')]({'where':{'name':_0x10084d,'userProfileId':_0x40a777[_0x5f91('0x4b')]},'raw':!![]})[_0x5f91('0x22')](function(_0x16fafc){if(_0x16fafc&&_0x16fafc['autoAssociation']===0x0){return db[_0x5f91('0x25')]['create']({'name':_0x481a9e[_0x5f91('0x27')],'resourceId':_0x481a9e['id'],'type':_0x16fafc[_0x5f91('0x27')],'sectionId':_0x16fafc['id']},{})[_0x5f91('0x22')](function(){return _0x17717d;});}else{return _0x17717d;}})[_0x5f91('0x41')](function(_0x2decfc){logger[_0x5f91('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2decfc);throw _0x2decfc;});}return _0x17717d;})[_0x5f91('0x22')](respondWithResult(_0xd36f70,0xc9))[_0x5f91('0x41')](handleError(_0xd36f70,null));};exports[_0x5f91('0x21')]=function(_0x24f4d5,_0x48ef15){if(_0x24f4d5[_0x5f91('0x46')]['id']){delete _0x24f4d5[_0x5f91('0x46')]['id'];}return db['Trigger'][_0x5f91('0x44')]({'where':{'id':_0x24f4d5[_0x5f91('0x43')]['id']}})[_0x5f91('0x22')](handleEntityNotFound(_0x48ef15,null))[_0x5f91('0x22')](saveUpdates(_0x24f4d5[_0x5f91('0x46')],null))['then'](respondWithResult(_0x48ef15,null))[_0x5f91('0x41')](handleError(_0x48ef15,null));};exports[_0x5f91('0x23')]=function(_0x469e16,_0x372a12){return db[_0x5f91('0x2a')][_0x5f91('0x44')]({'where':{'id':_0x469e16['params']['id']}})[_0x5f91('0x22')](handleEntityNotFound(_0x372a12,null))[_0x5f91('0x22')](removeEntity(_0x372a12,null))[_0x5f91('0x41')](handleError(_0x372a12,null));};exports[_0x5f91('0x4c')]=function(_0xfe2a6d,_0x5e1b10,_0x3694ea){if(_0xfe2a6d['body']['id']){delete _0xfe2a6d[_0x5f91('0x46')]['id'];}return db[_0x5f91('0x2a')][_0x5f91('0x44')]({'where':{'id':_0xfe2a6d[_0x5f91('0x43')]['id']}})[_0x5f91('0x22')](handleEntityNotFound(_0x5e1b10,null))[_0x5f91('0x22')](function(_0x11be30){if(_0x11be30){_0xfe2a6d[_0x5f91('0x46')]['TriggerAllId']=_0x11be30['id'];return db[_0x5f91('0x4d')][_0x5f91('0x45')](_0xfe2a6d[_0x5f91('0x46')]);}})[_0x5f91('0x22')](respondWithResult(_0x5e1b10,null))[_0x5f91('0x41')](handleError(_0x5e1b10,null));};exports[_0x5f91('0x4e')]=function(_0x475ca8,_0x3df1cc,_0x378df9){if(_0x475ca8['body']['id']){delete _0x475ca8[_0x5f91('0x46')]['id'];}return db[_0x5f91('0x2a')][_0x5f91('0x44')]({'where':{'id':_0x475ca8['params']['id']}})[_0x5f91('0x22')](handleEntityNotFound(_0x3df1cc,null))[_0x5f91('0x22')](function(_0x170113){if(_0x170113){_0x475ca8['body']['TriggerAnyId']=_0x170113['id'];return db[_0x5f91('0x4d')][_0x5f91('0x45')](_0x475ca8[_0x5f91('0x46')]);}})[_0x5f91('0x22')](respondWithResult(_0x3df1cc,null))[_0x5f91('0x41')](handleError(_0x3df1cc,null));};exports['getAllConditions']=function(_0x1dee0a,_0x2c96d1,_0x332762){var _0x1cb02d={};var _0x1bed69={};var _0x474b5f;var _0x539ac9;return db[_0x5f91('0x2a')][_0x5f91('0x4f')]({'where':{'id':_0x1dee0a[_0x5f91('0x43')]['id']}})[_0x5f91('0x22')](handleEntityNotFound(_0x2c96d1,null))[_0x5f91('0x22')](function(_0x395515){if(_0x395515){_0x474b5f=_0x395515;_0x1bed69[_0x5f91('0x2e')]=_[_0x5f91('0x30')](db[_0x5f91('0x4d')]['rawAttributes']);_0x1bed69[_0x5f91('0x2f')]=_[_0x5f91('0x30')](_0x1dee0a[_0x5f91('0x2f')]);_0x1bed69['filters']=_[_0x5f91('0x31')](_0x1bed69['model'],_0x1bed69[_0x5f91('0x2f')]);_0x1cb02d[_0x5f91('0x32')]=_[_0x5f91('0x31')](_0x1bed69[_0x5f91('0x2e')],qs[_0x5f91('0x33')](_0x1dee0a[_0x5f91('0x2f')]['fields']));_0x1cb02d['attributes']=_0x1cb02d[_0x5f91('0x32')][_0x5f91('0x50')]?_0x1cb02d[_0x5f91('0x32')]:_0x1bed69[_0x5f91('0x2e')];_0x1cb02d[_0x5f91('0x51')]=qs[_0x5f91('0x35')](_0x1dee0a[_0x5f91('0x2f')][_0x5f91('0x35')]);_0x1cb02d['where']=qs[_0x5f91('0x37')](_[_0x5f91('0x38')](_0x1dee0a[_0x5f91('0x2f')],_0x1bed69[_0x5f91('0x37')]));if(_0x1dee0a[_0x5f91('0x2f')][_0x5f91('0x3b')]){_0x1cb02d[_0x5f91('0x36')]=_['merge'](_0x1cb02d[_0x5f91('0x36')],{'$or':_['map'](_0x1cb02d[_0x5f91('0x32')],function(_0x926d43){var _0x33fac9={};_0x33fac9[_0x926d43]={'$like':'%'+_0x1dee0a[_0x5f91('0x2f')][_0x5f91('0x3b')]+'%'};return _0x33fac9;})});}_0x1cb02d=_[_0x5f91('0x39')]({},_0x1cb02d,_0x1dee0a['options']);return _0x474b5f[_0x5f91('0x52')](_0x1cb02d);}})[_0x5f91('0x22')](function(_0x5e6fb7){if(_0x5e6fb7){_0x539ac9=_0x5e6fb7['length'];if(!_0x1dee0a[_0x5f91('0x2f')][_0x5f91('0x34')]('nolimit')){_0x1cb02d[_0x5f91('0x1b')]=qs[_0x5f91('0x1b')](_0x1dee0a[_0x5f91('0x2f')]['limit']);_0x1cb02d[_0x5f91('0x1a')]=qs[_0x5f91('0x1a')](_0x1dee0a[_0x5f91('0x2f')][_0x5f91('0x1a')]);}return _0x474b5f[_0x5f91('0x52')](_0x1cb02d);}})[_0x5f91('0x22')](function(_0x1f657a){if(_0x1f657a){return _0x1f657a?{'count':_0x539ac9,'rows':_0x1f657a}:null;}})[_0x5f91('0x22')](respondWithResult(_0x2c96d1,null))['catch'](handleError(_0x2c96d1,null));};exports[_0x5f91('0x53')]=function(_0x19452a,_0x7f5224,_0x312e1a){var _0x29c08e={};var _0x4920ea={};var _0x113f21;var _0x5126a3;return db[_0x5f91('0x2a')]['findOne']({'where':{'id':_0x19452a[_0x5f91('0x43')]['id']}})[_0x5f91('0x22')](handleEntityNotFound(_0x7f5224,null))['then'](function(_0x44a941){if(_0x44a941){_0x113f21=_0x44a941;_0x4920ea['model']=_[_0x5f91('0x30')](db[_0x5f91('0x4d')][_0x5f91('0x54')]);_0x4920ea[_0x5f91('0x2f')]=_[_0x5f91('0x30')](_0x19452a[_0x5f91('0x2f')]);_0x4920ea['filters']=_[_0x5f91('0x31')](_0x4920ea[_0x5f91('0x2e')],_0x4920ea[_0x5f91('0x2f')]);_0x29c08e[_0x5f91('0x32')]=_[_0x5f91('0x31')](_0x4920ea[_0x5f91('0x2e')],qs['fields'](_0x19452a[_0x5f91('0x2f')][_0x5f91('0x33')]));_0x29c08e['attributes']=_0x29c08e[_0x5f91('0x32')][_0x5f91('0x50')]?_0x29c08e[_0x5f91('0x32')]:_0x4920ea[_0x5f91('0x2e')];_0x29c08e['order']=qs[_0x5f91('0x35')](_0x19452a[_0x5f91('0x2f')][_0x5f91('0x35')]);_0x29c08e[_0x5f91('0x36')]=qs[_0x5f91('0x37')](_[_0x5f91('0x38')](_0x19452a[_0x5f91('0x2f')],_0x4920ea[_0x5f91('0x37')]));if(_0x19452a['query'][_0x5f91('0x3b')]){_0x29c08e[_0x5f91('0x36')]=_[_0x5f91('0x39')](_0x29c08e[_0x5f91('0x36')],{'$or':_[_0x5f91('0x29')](_0x29c08e['attributes'],function(_0x1b2aea){var _0x2eb2ff={};_0x2eb2ff[_0x1b2aea]={'$like':'%'+_0x19452a[_0x5f91('0x2f')][_0x5f91('0x3b')]+'%'};return _0x2eb2ff;})});}_0x29c08e=_[_0x5f91('0x39')]({},_0x29c08e,_0x19452a[_0x5f91('0x3c')]);return _0x113f21[_0x5f91('0x53')](_0x29c08e);}})['then'](function(_0xdb7a79){if(_0xdb7a79){_0x5126a3=_0xdb7a79['length'];if(!_0x19452a[_0x5f91('0x2f')]['hasOwnProperty'](_0x5f91('0x55'))){_0x29c08e[_0x5f91('0x1b')]=qs[_0x5f91('0x1b')](_0x19452a[_0x5f91('0x2f')][_0x5f91('0x1b')]);_0x29c08e[_0x5f91('0x1a')]=qs[_0x5f91('0x1a')](_0x19452a['query']['offset']);}return _0x113f21[_0x5f91('0x53')](_0x29c08e);}})[_0x5f91('0x22')](function(_0x4a54ca){if(_0x4a54ca){return _0x4a54ca?{'count':_0x5126a3,'rows':_0x4a54ca}:null;}})[_0x5f91('0x22')](respondWithResult(_0x7f5224,null))['catch'](handleError(_0x7f5224,null));};exports[_0x5f91('0x56')]=function(_0x4bf374,_0x291bab,_0x1748ef){if(_0x4bf374[_0x5f91('0x46')]['id']){delete _0x4bf374['body']['id'];}return db[_0x5f91('0x2a')][_0x5f91('0x44')]({'where':{'id':_0x4bf374[_0x5f91('0x43')]['id']}})['then'](handleEntityNotFound(_0x291bab,null))['then'](function(_0x2adbdf){if(_0x2adbdf){_0x4bf374['body']['TriggerId']=_0x2adbdf['id'];return db[_0x5f91('0x57')][_0x5f91('0x45')](_0x4bf374['body']);}})[_0x5f91('0x22')](respondWithResult(_0x291bab,null))['catch'](handleError(_0x291bab,null));};exports['getActions']=function(_0x5c5492,_0x2aee7e,_0x2edea0){var _0x4e484a={};var _0xc97824={};var _0x58244e;var _0x3b6fae;return db[_0x5f91('0x2a')]['findOne']({'where':{'id':_0x5c5492[_0x5f91('0x43')]['id']}})[_0x5f91('0x22')](handleEntityNotFound(_0x2aee7e,null))['then'](function(_0x551a2c){if(_0x551a2c){_0x58244e=_0x551a2c;_0xc97824[_0x5f91('0x2e')]=_[_0x5f91('0x30')](db[_0x5f91('0x57')][_0x5f91('0x54')]);_0xc97824[_0x5f91('0x2f')]=_[_0x5f91('0x30')](_0x5c5492[_0x5f91('0x2f')]);_0xc97824[_0x5f91('0x37')]=_[_0x5f91('0x31')](_0xc97824[_0x5f91('0x2e')],_0xc97824['query']);_0x4e484a[_0x5f91('0x32')]=_[_0x5f91('0x31')](_0xc97824[_0x5f91('0x2e')],qs['fields'](_0x5c5492[_0x5f91('0x2f')]['fields']));_0x4e484a[_0x5f91('0x32')]=_0x4e484a[_0x5f91('0x32')][_0x5f91('0x50')]?_0x4e484a[_0x5f91('0x32')]:_0xc97824['model'];_0x4e484a[_0x5f91('0x51')]=qs['sort'](_0x5c5492[_0x5f91('0x2f')]['sort']);_0x4e484a['where']=qs[_0x5f91('0x37')](_[_0x5f91('0x38')](_0x5c5492['query'],_0xc97824[_0x5f91('0x37')]));if(_0x5c5492['query'][_0x5f91('0x3b')]){_0x4e484a['where']=_[_0x5f91('0x39')](_0x4e484a[_0x5f91('0x36')],{'$or':_[_0x5f91('0x29')](_0x4e484a['attributes'],function(_0x5b1ef4){var _0x2ab5e3={};_0x2ab5e3[_0x5b1ef4]={'$like':'%'+_0x5c5492[_0x5f91('0x2f')][_0x5f91('0x3b')]+'%'};return _0x2ab5e3;})});}_0x4e484a=_[_0x5f91('0x39')]({},_0x4e484a,_0x5c5492[_0x5f91('0x3c')]);return _0x58244e[_0x5f91('0x58')](_0x4e484a);}})['then'](function(_0x3a8ecc){if(_0x3a8ecc){_0x3b6fae=_0x3a8ecc[_0x5f91('0x50')];if(!_0x5c5492[_0x5f91('0x2f')][_0x5f91('0x34')](_0x5f91('0x55'))){_0x4e484a[_0x5f91('0x1b')]=qs['limit'](_0x5c5492['query']['limit']);_0x4e484a[_0x5f91('0x1a')]=qs['offset'](_0x5c5492[_0x5f91('0x2f')][_0x5f91('0x1a')]);}return _0x58244e[_0x5f91('0x58')](_0x4e484a);}})[_0x5f91('0x22')](function(_0x5120fe){if(_0x5120fe){return _0x5120fe?{'count':_0x3b6fae,'rows':_0x5120fe}:null;}})[_0x5f91('0x22')](respondWithResult(_0x2aee7e,null))[_0x5f91('0x41')](handleError(_0x2aee7e,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 51c4e69..9ff58a5 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 _0xfe60=['define','Trigger','tools_triggers','util','api','moment','bluebird','path','rimraf','../../config/environment','./trigger.attributes','exports'];(function(_0x4cba56,_0x5b2c44){var _0x3cc9f3=function(_0x5bb80a){while(--_0x5bb80a){_0x4cba56['push'](_0x4cba56['shift']());}};_0x3cc9f3(++_0x5b2c44);}(_0xfe60,0x1cb));var _0x0fe6=function(_0x25962a,_0x1011b2){_0x25962a=_0x25962a-0x0;var _0x117af3=_0xfe60[_0x25962a];return _0x117af3;};'use strict';var _=require('lodash');var util=require(_0x0fe6('0x0'));var logger=require('../../config/logger')(_0x0fe6('0x1'));var moment=require(_0x0fe6('0x2'));var BPromise=require(_0x0fe6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0fe6('0x4'));var rimraf=require(_0x0fe6('0x5'));var config=require(_0x0fe6('0x6'));var attributes=require(_0x0fe6('0x7'));module[_0x0fe6('0x8')]=function(_0x1281fc,_0x13b947){return _0x1281fc[_0x0fe6('0x9')](_0x0fe6('0xa'),attributes,{'tableName':_0x0fe6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2494=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','./trigger.attributes','define','tools_triggers'];(function(_0x549d41,_0x526355){var _0x44b860=function(_0x5c64e8){while(--_0x5c64e8){_0x549d41['push'](_0x549d41['shift']());}};_0x44b860(++_0x526355);}(_0x2494,0x82));var _0x4249=function(_0x55c116,_0x15d999){_0x55c116=_0x55c116-0x0;var _0x4ceb93=_0x2494[_0x55c116];return _0x4ceb93;};'use strict';var _=require(_0x4249('0x0'));var util=require('util');var logger=require(_0x4249('0x1'))(_0x4249('0x2'));var moment=require(_0x4249('0x3'));var BPromise=require(_0x4249('0x4'));var rp=require(_0x4249('0x5'));var fs=require('fs');var path=require(_0x4249('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4249('0x7'));module['exports']=function(_0x3c2d8d,_0x1d4ca8){return _0x3c2d8d[_0x4249('0x8')]('Trigger',attributes,{'tableName':_0x4249('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index fbcda6a..58b2b06 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 _0xf68c=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','stringify','error','code','Trigger,\x20%s,\x20%s','message','info','result','catch','GetTrigger','Trigger','findAll','options','raw','where','limit','include','map','model','attributes','ShowTrigger','lodash','util'];(function(_0x5cbe5e,_0x259669){var _0x57db9f=function(_0x14c544){while(--_0x14c544){_0x5cbe5e['push'](_0x5cbe5e['shift']());}};_0x57db9f(++_0x259669);}(_0xf68c,0x152));var _0xcf68=function(_0x4d0856,_0x102ed6){_0x4d0856=_0x4d0856-0x0;var _0x783ff6=_0xf68c[_0x4d0856];return _0x783ff6;};'use strict';var _=require(_0xcf68('0x0'));var util=require(_0xcf68('0x1'));var moment=require(_0xcf68('0x2'));var BPromise=require(_0xcf68('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf68('0x4'));var db=require(_0xcf68('0x5'))['db'];var utils=require(_0xcf68('0x6'));var logger=require('../../config/logger')(_0xcf68('0x7'));var config=require(_0xcf68('0x8'));var jayson=require(_0xcf68('0x9'));var client=jayson[_0xcf68('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x546e73,_0x57edc5,_0x5a6091){return new BPromise(function(_0x48e749,_0x37a783){return client[_0xcf68('0xb')](_0x546e73,_0x5a6091)[_0xcf68('0xc')](function(_0x36c02d){logger['info']('Trigger,\x20%s,\x20%s',_0x57edc5,_0xcf68('0xd'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x57edc5,_0xcf68('0xd'),JSON[_0xcf68('0xe')](_0x36c02d));if(_0x36c02d['error']){if(_0x36c02d[_0xcf68('0xf')][_0xcf68('0x10')]===0x1f4){logger[_0xcf68('0xf')](_0xcf68('0x11'),_0x57edc5,_0x36c02d[_0xcf68('0xf')][_0xcf68('0x12')]);return _0x37a783(_0x36c02d['error'][_0xcf68('0x12')]);}logger[_0xcf68('0xf')](_0xcf68('0x11'),_0x57edc5,_0x36c02d['error'][_0xcf68('0x12')]);return _0x48e749(_0x36c02d[_0xcf68('0xf')][_0xcf68('0x12')]);}else{logger[_0xcf68('0x13')]('Trigger,\x20%s,\x20%s',_0x57edc5,'request\x20sent');_0x48e749(_0x36c02d[_0xcf68('0x14')]['message']);}})[_0xcf68('0x15')](function(_0xd8896b){logger['error'](_0xcf68('0x11'),_0x57edc5,_0xd8896b);_0x37a783(_0xd8896b);});});}exports[_0xcf68('0x16')]=function(_0x5e17aa){var _0x598c32=this;return new Promise(function(_0x3c5bf5,_0x35e546){return db[_0xcf68('0x17')][_0xcf68('0x18')]({'raw':_0x5e17aa[_0xcf68('0x19')]?_0x5e17aa[_0xcf68('0x19')][_0xcf68('0x1a')]===undefined?!![]:![]:!![],'where':_0x5e17aa[_0xcf68('0x19')]?_0x5e17aa[_0xcf68('0x19')][_0xcf68('0x1b')]||null:null,'attributes':_0x5e17aa[_0xcf68('0x19')]?_0x5e17aa[_0xcf68('0x19')]['attributes']||null:null,'limit':_0x5e17aa[_0xcf68('0x19')]?_0x5e17aa[_0xcf68('0x19')][_0xcf68('0x1c')]||null:null,'include':_0x5e17aa[_0xcf68('0x19')]?_0x5e17aa[_0xcf68('0x19')][_0xcf68('0x1d')]?_[_0xcf68('0x1e')](_0x5e17aa[_0xcf68('0x19')]['include'],function(_0x542b6c){return{'model':db[_0x542b6c[_0xcf68('0x1f')]],'as':_0x542b6c['as'],'attributes':_0x542b6c[_0xcf68('0x20')],'include':_0x542b6c[_0xcf68('0x1d')]?_['map'](_0x542b6c[_0xcf68('0x1d')],function(_0xc48bb0){return{'model':db[_0xc48bb0['model']],'as':_0xc48bb0['as'],'attributes':_0xc48bb0[_0xcf68('0x20')],'include':_0xc48bb0[_0xcf68('0x1d')]?_[_0xcf68('0x1e')](_0xc48bb0[_0xcf68('0x1d')],function(_0x182a0d){return{'model':db[_0x182a0d[_0xcf68('0x1f')]],'as':_0x182a0d['as'],'attributes':_0x182a0d[_0xcf68('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1411db){logger[_0xcf68('0x13')]('GetTrigger',_0x5e17aa);logger['debug'](_0xcf68('0x16'),_0x5e17aa,JSON[_0xcf68('0xe')](_0x1411db));_0x3c5bf5(_0x1411db);})[_0xcf68('0x15')](function(_0x48816b){logger['error'](_0xcf68('0x16'),_0x48816b[_0xcf68('0x12')],_0x5e17aa);_0x35e546(_0x598c32[_0xcf68('0xf')](0x1f4,_0x48816b[_0xcf68('0x12')]));});});};exports[_0xcf68('0x21')]=function(_0x53d9d3){var _0x224e14=this;return new Promise(function(_0x42e643,_0x2d7ea4){return db[_0xcf68('0x17')]['find']({'raw':_0x53d9d3[_0xcf68('0x19')]?_0x53d9d3[_0xcf68('0x19')][_0xcf68('0x1a')]===undefined?!![]:![]:!![],'where':_0x53d9d3[_0xcf68('0x19')]?_0x53d9d3['options'][_0xcf68('0x1b')]||null:null,'attributes':_0x53d9d3[_0xcf68('0x19')]?_0x53d9d3[_0xcf68('0x19')]['attributes']||null:null,'include':_0x53d9d3[_0xcf68('0x19')]?_0x53d9d3[_0xcf68('0x19')][_0xcf68('0x1d')]?_['map'](_0x53d9d3[_0xcf68('0x19')][_0xcf68('0x1d')],function(_0x317d10){return{'model':db[_0x317d10['model']],'as':_0x317d10['as'],'attributes':_0x317d10['attributes'],'include':_0x317d10['include']?_[_0xcf68('0x1e')](_0x317d10[_0xcf68('0x1d')],function(_0x42d53a){return{'model':db[_0x42d53a[_0xcf68('0x1f')]],'as':_0x42d53a['as'],'attributes':_0x42d53a[_0xcf68('0x20')],'include':_0x42d53a['include']?_['map'](_0x42d53a['include'],function(_0xb36283){return{'model':db[_0xb36283['model']],'as':_0xb36283['as'],'attributes':_0xb36283['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x53cdf0){logger[_0xcf68('0x13')]('ShowTrigger',_0x53d9d3);logger['debug'](_0xcf68('0x21'),_0x53d9d3,JSON[_0xcf68('0xe')](_0x53cdf0));_0x42e643(_0x53cdf0);})[_0xcf68('0x15')](function(_0xd89388){logger[_0xcf68('0xf')](_0xcf68('0x21'),_0xd89388[_0xcf68('0x12')],_0x53d9d3);_0x2d7ea4(_0x224e14['error'](0x1f4,_0xd89388[_0xcf68('0x12')]));});});}; \ No newline at end of file +var _0xec9f=['ShowTrigger','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','Trigger,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetTrigger','Trigger','options','raw','where','limit','include','map','model','attributes','then','debug'];(function(_0x5ae1a2,_0x3601ba){var _0x9ac42f=function(_0x16abe8){while(--_0x16abe8){_0x5ae1a2['push'](_0x5ae1a2['shift']());}};_0x9ac42f(++_0x3601ba);}(_0xec9f,0xf8));var _0xfec9=function(_0x55a007,_0x4a51b9){_0x55a007=_0x55a007-0x0;var _0x3a1867=_0xec9f[_0x55a007];return _0x3a1867;};'use strict';var _=require(_0xfec9('0x0'));var util=require(_0xfec9('0x1'));var moment=require(_0xfec9('0x2'));var BPromise=require(_0xfec9('0x3'));var rs=require(_0xfec9('0x4'));var fs=require('fs');var Redis=require(_0xfec9('0x5'));var db=require(_0xfec9('0x6'))['db'];var utils=require(_0xfec9('0x7'));var logger=require(_0xfec9('0x8'))(_0xfec9('0x9'));var config=require(_0xfec9('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xfec9('0xb')][_0xfec9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47edd2,_0x401c38,_0x5734fa){return new BPromise(function(_0xfe9bf1,_0x4f85d7){return client['request'](_0x47edd2,_0x5734fa)['then'](function(_0x2b8fd){logger[_0xfec9('0xd')](_0xfec9('0xe'),_0x401c38,_0xfec9('0xf'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x401c38,_0xfec9('0xf'),JSON['stringify'](_0x2b8fd));if(_0x2b8fd[_0xfec9('0x10')]){if(_0x2b8fd[_0xfec9('0x10')]['code']===0x1f4){logger[_0xfec9('0x10')]('Trigger,\x20%s,\x20%s',_0x401c38,_0x2b8fd[_0xfec9('0x10')][_0xfec9('0x11')]);return _0x4f85d7(_0x2b8fd[_0xfec9('0x10')][_0xfec9('0x11')]);}logger[_0xfec9('0x10')](_0xfec9('0xe'),_0x401c38,_0x2b8fd[_0xfec9('0x10')][_0xfec9('0x11')]);return _0xfe9bf1(_0x2b8fd['error'][_0xfec9('0x11')]);}else{logger[_0xfec9('0xd')](_0xfec9('0xe'),_0x401c38,_0xfec9('0xf'));_0xfe9bf1(_0x2b8fd[_0xfec9('0x12')]['message']);}})[_0xfec9('0x13')](function(_0x329a3b){logger[_0xfec9('0x10')](_0xfec9('0xe'),_0x401c38,_0x329a3b);_0x4f85d7(_0x329a3b);});});}exports[_0xfec9('0x14')]=function(_0x4f2d9f){var _0x363e74=this;return new Promise(function(_0x50a960,_0x1e88bb){return db[_0xfec9('0x15')]['findAll']({'raw':_0x4f2d9f['options']?_0x4f2d9f[_0xfec9('0x16')][_0xfec9('0x17')]===undefined?!![]:![]:!![],'where':_0x4f2d9f['options']?_0x4f2d9f[_0xfec9('0x16')][_0xfec9('0x18')]||null:null,'attributes':_0x4f2d9f[_0xfec9('0x16')]?_0x4f2d9f[_0xfec9('0x16')]['attributes']||null:null,'limit':_0x4f2d9f[_0xfec9('0x16')]?_0x4f2d9f[_0xfec9('0x16')][_0xfec9('0x19')]||null:null,'include':_0x4f2d9f['options']?_0x4f2d9f[_0xfec9('0x16')][_0xfec9('0x1a')]?_[_0xfec9('0x1b')](_0x4f2d9f[_0xfec9('0x16')][_0xfec9('0x1a')],function(_0x309b7c){return{'model':db[_0x309b7c[_0xfec9('0x1c')]],'as':_0x309b7c['as'],'attributes':_0x309b7c[_0xfec9('0x1d')],'include':_0x309b7c[_0xfec9('0x1a')]?_[_0xfec9('0x1b')](_0x309b7c[_0xfec9('0x1a')],function(_0x5a7529){return{'model':db[_0x5a7529[_0xfec9('0x1c')]],'as':_0x5a7529['as'],'attributes':_0x5a7529['attributes'],'include':_0x5a7529[_0xfec9('0x1a')]?_['map'](_0x5a7529[_0xfec9('0x1a')],function(_0x3b7375){return{'model':db[_0x3b7375[_0xfec9('0x1c')]],'as':_0x3b7375['as'],'attributes':_0x3b7375['attributes']};}):[]};}):[]};}):[]:[]})[_0xfec9('0x1e')](function(_0xb209a9){logger[_0xfec9('0xd')](_0xfec9('0x14'),_0x4f2d9f);logger[_0xfec9('0x1f')](_0xfec9('0x14'),_0x4f2d9f,JSON['stringify'](_0xb209a9));_0x50a960(_0xb209a9);})[_0xfec9('0x13')](function(_0x3a224c){logger['error']('GetTrigger',_0x3a224c[_0xfec9('0x11')],_0x4f2d9f);_0x1e88bb(_0x363e74[_0xfec9('0x10')](0x1f4,_0x3a224c['message']));});});};exports[_0xfec9('0x20')]=function(_0x49d7a7){var _0x47172b=this;return new Promise(function(_0x54cb77,_0x44c030){return db[_0xfec9('0x15')][_0xfec9('0x21')]({'raw':_0x49d7a7[_0xfec9('0x16')]?_0x49d7a7[_0xfec9('0x16')][_0xfec9('0x17')]===undefined?!![]:![]:!![],'where':_0x49d7a7['options']?_0x49d7a7[_0xfec9('0x16')][_0xfec9('0x18')]||null:null,'attributes':_0x49d7a7[_0xfec9('0x16')]?_0x49d7a7[_0xfec9('0x16')][_0xfec9('0x1d')]||null:null,'include':_0x49d7a7[_0xfec9('0x16')]?_0x49d7a7[_0xfec9('0x16')][_0xfec9('0x1a')]?_['map'](_0x49d7a7[_0xfec9('0x16')][_0xfec9('0x1a')],function(_0x1611b6){return{'model':db[_0x1611b6[_0xfec9('0x1c')]],'as':_0x1611b6['as'],'attributes':_0x1611b6[_0xfec9('0x1d')],'include':_0x1611b6[_0xfec9('0x1a')]?_[_0xfec9('0x1b')](_0x1611b6[_0xfec9('0x1a')],function(_0x48db95){return{'model':db[_0x48db95[_0xfec9('0x1c')]],'as':_0x48db95['as'],'attributes':_0x48db95[_0xfec9('0x1d')],'include':_0x48db95[_0xfec9('0x1a')]?_[_0xfec9('0x1b')](_0x48db95[_0xfec9('0x1a')],function(_0x1fcc8f){return{'model':db[_0x1fcc8f['model']],'as':_0x1fcc8f['as'],'attributes':_0x1fcc8f[_0xfec9('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfec9('0x1e')](function(_0x36183d){logger[_0xfec9('0xd')](_0xfec9('0x20'),_0x49d7a7);logger[_0xfec9('0x1f')](_0xfec9('0x20'),_0x49d7a7,JSON[_0xfec9('0x22')](_0x36183d));_0x54cb77(_0x36183d);})[_0xfec9('0x13')](function(_0x5623f6){logger['error'](_0xfec9('0x20'),_0x5623f6[_0xfec9('0x11')],_0x49d7a7);_0x44c030(_0x47172b['error'](0x1f4,_0x5623f6[_0xfec9('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index ec940dc..524d60a 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 _0x0937=['show','post','/:id/clone','isAuthenticated','clone','create','put','/:id','update','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller'];(function(_0x322743,_0x3903b9){var _0x13de4d=function(_0x13a597){while(--_0x13a597){_0x322743['push'](_0x322743['shift']());}};_0x13de4d(++_0x3903b9);}(_0x0937,0x197));var _0x7093=function(_0x427ba3,_0x37c2ce){_0x427ba3=_0x427ba3-0x0;var _0x49a8d1=_0x0937[_0x427ba3];return _0x49a8d1;};'use strict';var multer=require(_0x7093('0x0'));var util=require(_0x7093('0x1'));var path=require(_0x7093('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x7093('0x3'));var auth=require(_0x7093('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7093('0x5'));var controller=require(_0x7093('0x6'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7093('0x7')]);router[_0x7093('0x8')](_0x7093('0x9'),auth[_0x7093('0xa')](),controller[_0x7093('0xb')]);router[_0x7093('0x8')]('/',auth[_0x7093('0xa')](),controller[_0x7093('0xc')]);router[_0x7093('0xd')](_0x7093('0xe'),auth['isAuthenticated'](),controller[_0x7093('0xf')]);router['delete'](_0x7093('0xe'),auth['isAuthenticated'](),controller[_0x7093('0x10')]);module[_0x7093('0x11')]=router; \ No newline at end of file +var _0x21ab=['index','get','post','/:id/clone','clone','create','/:id','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./trunk.controller','isAuthenticated'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x21ab,0x14d));var _0xb21a=function(_0x2fa411,_0x1f755a){_0x2fa411=_0x2fa411-0x0;var _0x465756=_0x21ab[_0x2fa411];return _0x465756;};'use strict';var multer=require(_0xb21a('0x0'));var util=require(_0xb21a('0x1'));var path=require('path');var timeout=require(_0xb21a('0x2'));var express=require(_0xb21a('0x3'));var router=express[_0xb21a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb21a('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb21a('0x6'));var controller=require(_0xb21a('0x7'));router['get']('/',auth[_0xb21a('0x8')](),controller[_0xb21a('0x9')]);router[_0xb21a('0xa')]('/:id',auth[_0xb21a('0x8')](),controller['show']);router[_0xb21a('0xb')](_0xb21a('0xc'),auth['isAuthenticated'](),controller[_0xb21a('0xd')]);router[_0xb21a('0xb')]('/',auth[_0xb21a('0x8')](),controller[_0xb21a('0xe')]);router['put'](_0xb21a('0xf'),auth['isAuthenticated'](),controller[_0xb21a('0x10')]);router[_0xb21a('0x11')](_0xb21a('0xf'),auth[_0xb21a('0x8')](),controller[_0xb21a('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 49353ca..c8ccaf8 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 _0x48a3=['insecure','never','INTEGER','\x22\x22\x20<>','always','refuse','originate','uac','uas','pai','fingerprint','active','passive','dynamic','nonat','BOOLEAN','sequelize','exports','name','ENUM','user','peer','friend','STRING','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','rfc2833','yes','update','outgoing','force_rport,comedia','setDataValue','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite'];(function(_0x3d966a,_0x447353){var _0x4180f0=function(_0x424871){while(--_0x424871){_0x3d966a['push'](_0x3d966a['shift']());}};_0x4180f0(++_0x447353);}(_0x48a3,0x1ed));var _0x348a=function(_0x64e3c1,_0x14da00){_0x64e3c1=_0x64e3c1-0x0;var _0x44adc8=_0x48a3[_0x64e3c1];return _0x44adc8;};'use strict';var Sequelize=require(_0x348a('0x0'));module[_0x348a('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x348a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x348a('0x3')]('friend',_0x348a('0x4'),_0x348a('0x5')),'allowNull':![],'defaultValue':_0x348a('0x6')},'context':{'type':Sequelize[_0x348a('0x7')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x348a('0x3')](_0x348a('0x8'),_0x348a('0x9'),'ALLOWED_FAILED_SCREEN',_0x348a('0xa'),_0x348a('0xb'),_0x348a('0xc'),'PROHIB_FAILED_SCREEN',_0x348a('0xd'))},'deny':{'type':Sequelize[_0x348a('0x7')]},'permit':{'type':Sequelize[_0x348a('0x7')]},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x348a('0x7')]},'remotesecret':{'type':Sequelize[_0x348a('0x7')]},'transport':{'type':Sequelize[_0x348a('0x7')],'defaultValue':_0x348a('0xe'),'set':function(_0xa2da0d){this['setDataValue'](_0x348a('0xf'),_0xa2da0d?_0xa2da0d[_0x348a('0x10')](','):null);},'get':function(){return this['getDataValue'](_0x348a('0xf'))?this['getDataValue'](_0x348a('0xf'))[_0x348a('0x11')](','):null;},'comment':_0x348a('0x12')},'dtmfmode':{'type':Sequelize[_0x348a('0x3')]('rfc2833',_0x348a('0x13'),_0x348a('0x14'),_0x348a('0x15'),_0x348a('0x16')),'defaultValue':_0x348a('0x17')},'directmedia':{'type':Sequelize[_0x348a('0x3')](_0x348a('0x18'),'no','nonat',_0x348a('0x19'),_0x348a('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x348a('0x3')](_0x348a('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x348a('0x7')]},'directmediadeny':{'type':Sequelize[_0x348a('0x7')]},'nat':{'type':Sequelize[_0x348a('0x7')],'defaultValue':_0x348a('0x1b'),'set':function(_0x1e92d6){this[_0x348a('0x1c')](_0x348a('0x1d'),_0x1e92d6?_0x1e92d6['join'](','):null);},'get':function(){return this['getDataValue'](_0x348a('0x1d'))?this['getDataValue'](_0x348a('0x1d'))[_0x348a('0x11')](','):null;},'comment':_0x348a('0x1e')},'callgroup':{'type':Sequelize[_0x348a('0x7')]},'namedcallgroup':{'type':Sequelize[_0x348a('0x7')]},'pickupgroup':{'type':Sequelize[_0x348a('0x7')]},'namedpickupgroup':{'type':Sequelize[_0x348a('0x7')]},'language':{'type':Sequelize[_0x348a('0x7')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x348a('0x1f')},'allow':{'type':Sequelize[_0x348a('0x7')],'allowNull':![],'defaultValue':_0x348a('0x20'),'set':function(_0x30ebcd){this[_0x348a('0x1c')](_0x348a('0x21'),_0x30ebcd?_0x30ebcd[_0x348a('0x10')](';'):_0x348a('0x20'));},'get':function(){return this[_0x348a('0x22')](_0x348a('0x21'))?this[_0x348a('0x22')](_0x348a('0x21'))[_0x348a('0x11')](';'):null;},'comment':_0x348a('0x23')},'autoframing':{'type':Sequelize[_0x348a('0x3')](_0x348a('0x18'),'no')},'insecure':{'type':Sequelize[_0x348a('0x7')],'defaultValue':_0x348a('0x24'),'set':function(_0x10e120){this[_0x348a('0x1c')]('insecure',_0x10e120?_0x10e120['join'](','):null);},'get':function(){return this[_0x348a('0x22')](_0x348a('0x25'))?this[_0x348a('0x22')](_0x348a('0x25'))[_0x348a('0x11')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x348a('0x3')](_0x348a('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x348a('0x3')](_0x348a('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x348a('0x3')](_0x348a('0x18'),'no',_0x348a('0x26'))},'promiscredir':{'type':Sequelize['ENUM'](_0x348a('0x18'),'no')},'useclientcode':{'type':Sequelize[_0x348a('0x3')](_0x348a('0x18'),'no')},'accountcode':{'type':Sequelize[_0x348a('0x27')](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x348a('0x7')],'defaultValue':_0x348a('0x28')},'amaflags':{'type':Sequelize[_0x348a('0x7')]},'callcounter':{'type':Sequelize[_0x348a('0x3')](_0x348a('0x18'),'no'),'defaultValue':_0x348a('0x18')},'busylevel':{'type':Sequelize[_0x348a('0x27')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x348a('0x18'),'no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0x348a('0x3')](_0x348a('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x348a('0x3')](_0x348a('0x18'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x348a('0x3')](_0x348a('0x18'),'no',_0x348a('0x29')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x348a('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x348a('0x18'),'no')},'mailbox':{'type':Sequelize[_0x348a('0x7')]},'session_timers':{'type':Sequelize[_0x348a('0x3')]('accept',_0x348a('0x2a'),_0x348a('0x2b'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x348a('0x27')](0xb)},'session_refresher':{'type':Sequelize[_0x348a('0x3')](_0x348a('0x2c'),_0x348a('0x2d')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x348a('0x7')]},'regexten':{'type':Sequelize[_0x348a('0x7')]},'fromdomain':{'type':Sequelize[_0x348a('0x7')]},'fromuser':{'type':Sequelize[_0x348a('0x7')]},'port':{'type':Sequelize[_0x348a('0x27')](0x5)},'qualify':{'type':Sequelize[_0x348a('0x3')](_0x348a('0x18'),'no'),'defaultValue':_0x348a('0x18')},'keepalive':{'type':Sequelize[_0x348a('0x27')](0xb)},'defaultip':{'type':Sequelize[_0x348a('0x7')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0x348a('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x348a('0x27')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x348a('0x3')](_0x348a('0x18'),'no',_0x348a('0x2e')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x348a('0x7')]},'callbackextension':{'type':Sequelize[_0x348a('0x7')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x348a('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0x348a('0x27')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x348a('0x7')]},'contactacl':{'type':Sequelize[_0x348a('0x7')]},'unsolicited_mailbox':{'type':Sequelize[_0x348a('0x7')]},'use_q850_reason':{'type':Sequelize[_0x348a('0x7')]},'maxforwards':{'type':Sequelize[_0x348a('0x27')](0xb)},'encryption':{'type':Sequelize[_0x348a('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x348a('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0x348a('0x3')]('yes','no')},'icesupport':{'type':Sequelize[_0x348a('0x3')](_0x348a('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0x348a('0x3')](_0x348a('0x18'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0x348a('0x18'),'no',_0x348a('0x2f'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x348a('0x27')](0xb)},'dtlscertfile':{'type':Sequelize[_0x348a('0x7')]},'dtlsprivatekey':{'type':Sequelize[_0x348a('0x7')]},'dtlscipher':{'type':Sequelize[_0x348a('0x7')]},'dtlscafile':{'type':Sequelize[_0x348a('0x7')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x348a('0x3')](_0x348a('0x30'),_0x348a('0x31'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x348a('0x7')]},'usereqphone':{'type':Sequelize['ENUM'](_0x348a('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x348a('0x7')]},'recordofffeature':{'type':Sequelize[_0x348a('0x7')]},'call_limit':{'type':Sequelize[_0x348a('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x348a('0x3')]('yes','no')},'subscribemwi':{'type':Sequelize[_0x348a('0x3')]('yes','no')},'vmexten':{'type':Sequelize[_0x348a('0x7')]},'mohinterpret':{'type':Sequelize[_0x348a('0x7')]},'mohsuggest':{'type':Sequelize[_0x348a('0x7')]},'parkinglot':{'type':Sequelize[_0x348a('0x7')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x348a('0x7')],'defaultValue':_0x348a('0x32')},'canreinvite':{'type':Sequelize['ENUM'](_0x348a('0x18'),'no',_0x348a('0x33'),_0x348a('0x19'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x348a('0x7')]},'otherFields':{'type':Sequelize[_0x348a('0x7')]},'active':{'type':Sequelize[_0x348a('0x34')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x348a('0x7')],'defaultValue':'no'}}; \ No newline at end of file +var _0xd8c3=['STRING','name','ENUM','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_PASSED_SCREEN','PROHIB','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','auto','nonat','update','outgoing','yes','force_rport,comedia','setDataValue','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','INTEGER','accept','originate','uas','certificate','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xd8c3,0x193));var _0x3d8c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xd8c3[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x3d8c('0x0'));module[_0x3d8c('0x1')]={'name':{'type':Sequelize[_0x3d8c('0x2')],'allowNull':![],'unique':_0x3d8c('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x5'),'user','peer'),'allowNull':![],'defaultValue':_0x3d8c('0x5')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3d8c('0x6')},'callingpres':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x7'),_0x3d8c('0x8'),_0x3d8c('0x9'),'ALLOWED','PROHIB_NOT_SCREENED',_0x3d8c('0xa'),'PROHIB_FAILED_SCREEN',_0x3d8c('0xb'))},'deny':{'type':Sequelize[_0x3d8c('0x2')]},'permit':{'type':Sequelize[_0x3d8c('0x2')]},'secret':{'type':Sequelize[_0x3d8c('0x2')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':'udp','set':function(_0x2cc908){this['setDataValue'](_0x3d8c('0xc'),_0x2cc908?_0x2cc908[_0x3d8c('0xd')](','):null);},'get':function(){return this[_0x3d8c('0xe')]('transport')?this[_0x3d8c('0xe')](_0x3d8c('0xc'))['split'](','):null;},'comment':_0x3d8c('0xf')},'dtmfmode':{'type':Sequelize['ENUM'](_0x3d8c('0x10'),'info',_0x3d8c('0x11'),_0x3d8c('0x12'),_0x3d8c('0x13')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0x3d8c('0x4')]('yes','no',_0x3d8c('0x14'),_0x3d8c('0x15'),_0x3d8c('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x3d8c('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x3d8c('0x2')]},'directmediadeny':{'type':Sequelize[_0x3d8c('0x2')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x3d8c('0x18'),'set':function(_0x3c49cd){this[_0x3d8c('0x19')](_0x3d8c('0x1a'),_0x3c49cd?_0x3c49cd[_0x3d8c('0xd')](','):null);},'get':function(){return this[_0x3d8c('0xe')](_0x3d8c('0x1a'))?this[_0x3d8c('0xe')](_0x3d8c('0x1a'))[_0x3d8c('0x1b')](','):null;},'comment':_0x3d8c('0x1c')},'callgroup':{'type':Sequelize[_0x3d8c('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x3d8c('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x3d8c('0x2')]},'language':{'type':Sequelize[_0x3d8c('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x3d8c('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0x3d8c('0x1d')},'allow':{'type':Sequelize[_0x3d8c('0x2')],'allowNull':![],'defaultValue':_0x3d8c('0x1e'),'set':function(_0x2ab3d9){this['setDataValue'](_0x3d8c('0x1f'),_0x2ab3d9?_0x2ab3d9[_0x3d8c('0xd')](';'):_0x3d8c('0x1e'));},'get':function(){return this[_0x3d8c('0xe')](_0x3d8c('0x1f'))?this['getDataValue'](_0x3d8c('0x1f'))[_0x3d8c('0x1b')](';'):null;},'comment':_0x3d8c('0x20')},'autoframing':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x17'),'no')},'insecure':{'type':Sequelize[_0x3d8c('0x2')],'defaultValue':'port,invite','set':function(_0x4a938e){this['setDataValue'](_0x3d8c('0x21'),_0x4a938e?_0x4a938e['join'](','):null);},'get':function(){return this[_0x3d8c('0xe')](_0x3d8c('0x21'))?this[_0x3d8c('0xe')](_0x3d8c('0x21'))['split'](','):null;},'comment':_0x3d8c('0x22')},'trustrpid':{'type':Sequelize[_0x3d8c('0x4')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x17'),'no','never')},'promiscredir':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x3d8c('0x4')]('yes','no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x3d8c('0x2')]},'callerid':{'type':Sequelize[_0x3d8c('0x2')],'defaultValue':_0x3d8c('0x23')},'amaflags':{'type':Sequelize[_0x3d8c('0x2')]},'callcounter':{'type':Sequelize['ENUM'](_0x3d8c('0x17'),'no'),'defaultValue':_0x3d8c('0x17')},'busylevel':{'type':Sequelize[_0x3d8c('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x3d8c('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize['ENUM']('yes','no')},'allowtransfer':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x3d8c('0x2')]},'template':{'type':Sequelize[_0x3d8c('0x2')]},'videosupport':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x17'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x17'),'no')},'mailbox':{'type':Sequelize[_0x3d8c('0x2')]},'session_timers':{'type':Sequelize['ENUM'](_0x3d8c('0x25'),'refuse',_0x3d8c('0x26'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x3d8c('0x4')]('uac',_0x3d8c('0x27')),'defaultValue':_0x3d8c('0x27')},'t38pt_usertpsource':{'type':Sequelize[_0x3d8c('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x3d8c('0x2')]},'fromuser':{'type':Sequelize[_0x3d8c('0x2')]},'port':{'type':Sequelize[_0x3d8c('0x24')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x3d8c('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x3d8c('0x2')]},'defaultuser':{'type':Sequelize[_0x3d8c('0x2')]},'rtptimeout':{'type':Sequelize[_0x3d8c('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x3d8c('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x17'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x3d8c('0x2')]},'callbackextension':{'type':Sequelize[_0x3d8c('0x2')]},'timert1':{'type':Sequelize[_0x3d8c('0x24')](0xb)},'timerb':{'type':Sequelize[_0x3d8c('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0x3d8c('0x24')](0xb)},'contactpermit':{'type':Sequelize[_0x3d8c('0x2')]},'contactdeny':{'type':Sequelize[_0x3d8c('0x2')]},'contactacl':{'type':Sequelize[_0x3d8c('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0x3d8c('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x3d8c('0x24')](0xb)},'encryption':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x17'),'no')},'force_avp':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x17'),'no')},'icesupport':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x17'),'no','fingerprint',_0x3d8c('0x28'))},'dtlsrekey':{'type':Sequelize[_0x3d8c('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0x3d8c('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x3d8c('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x3d8c('0x4')]('active','passive',_0x3d8c('0x29')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x3d8c('0x2')]},'usereqphone':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x3d8c('0x2')]},'recordofffeature':{'type':Sequelize[_0x3d8c('0x2')]},'call_limit':{'type':Sequelize[_0x3d8c('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x17'),'no')},'subscribemwi':{'type':Sequelize['ENUM']('yes','no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x3d8c('0x2')]},'mohsuggest':{'type':Sequelize[_0x3d8c('0x2')]},'parkinglot':{'type':Sequelize[_0x3d8c('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING'],'defaultValue':_0x3d8c('0x2a')},'canreinvite':{'type':Sequelize[_0x3d8c('0x4')](_0x3d8c('0x17'),'no',_0x3d8c('0x14'),_0x3d8c('0x15'),_0x3d8c('0x2b')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x3d8c('0x2')]},'otherFields':{'type':Sequelize[_0x3d8c('0x2')]},'active':{'type':Sequelize[_0x3d8c('0x2c')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x3d8c('0x2')],'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 11bfe24..e1b1bde 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 _0x9a19=['query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','show','include','find','clone','params','omit','updatedAt','body','createdAt','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','role','autoAssociation','findAll','readFileSync','writeFileSync','Reload','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','destroy','get','Trunks','UserProfileResource','stack','name','index','map','Trunk','rawAttributes','fieldName','type'];(function(_0x4ae39d,_0x5c3787){var _0x1015a7=function(_0x261278){while(--_0x261278){_0x4ae39d['push'](_0x4ae39d['shift']());}};_0x1015a7(++_0x5c3787);}(_0x9a19,0x114));var _0x99a1=function(_0x152fe3,_0x12b0c8){_0x152fe3=_0x152fe3-0x0;var _0xc5bb39=_0x9a19[_0x152fe3];return _0xc5bb39;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];var jayson=require(_0x99a1('0x19'));var client=jayson[_0x99a1('0x1a')][_0x99a1('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xf713b9,_0x40c19c,_0x3a865c,_0x47815e){return new BPromise(function(_0xe1a1f,_0x3c9ef4){var _0x39ee55=_0x47815e||client;return _0x39ee55['request'](_0xf713b9,_0x3a865c)[_0x99a1('0x1c')](function(_0x3e45d4){logger[_0x99a1('0x1d')](_0x99a1('0x1e'),_0x40c19c,_0x99a1('0x1f'));logger[_0x99a1('0x20')](_0x99a1('0x21'),_0x40c19c,'request\x20sent',JSON['stringify'](_0x3e45d4));if(_0x3e45d4[_0x99a1('0x22')]){if(_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x23')]===0x1f4){logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x24')]);return _0x3c9ef4(_0x3e45d4[_0x99a1('0x22')][_0x99a1('0x24')]);}logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x3e45d4['error'][_0x99a1('0x24')]);return _0xe1a1f(_0x3e45d4[_0x99a1('0x22')]['message']);}else{logger[_0x99a1('0x1d')]('Trunk,\x20%s,\x20%s',_0x40c19c,_0x99a1('0x1f'));_0xe1a1f(_0x3e45d4[_0x99a1('0x25')][_0x99a1('0x24')]);}})[_0x99a1('0x26')](function(_0x5a88c6){logger[_0x99a1('0x22')](_0x99a1('0x1e'),_0x40c19c,_0x5a88c6);_0x3c9ef4(_0x5a88c6);});});}function respondWithStatusCode(_0x483c17,_0x44df2d){_0x44df2d=_0x44df2d||0xcc;return function(_0x5b5dfa){if(_0x5b5dfa){return _0x483c17[_0x99a1('0x27')](_0x44df2d);}return _0x483c17[_0x99a1('0x28')](_0x44df2d)[_0x99a1('0x29')]();};}function respondWithResult(_0xdaa27d,_0x3c813){_0x3c813=_0x3c813||0xc8;return function(_0x491341){if(_0x491341){return _0xdaa27d['status'](_0x3c813)[_0x99a1('0x2a')](_0x491341);}};}function respondWithFilteredResult(_0x5dabd9,_0x5dc733){return function(_0xafea84){if(_0xafea84){var _0x440879=typeof _0x5dc733[_0x99a1('0x2b')]===_0x99a1('0x2c')&&typeof _0x5dc733[_0x99a1('0x2d')]===_0x99a1('0x2c');var _0x183037=_0xafea84['count'];var _0xf41b0d=_0x440879?0x0:_0x5dc733['offset'];var _0x255197=_0x440879?_0xafea84[_0x99a1('0x2e')]:_0x5dc733[_0x99a1('0x2b')]+_0x5dc733['limit'];var _0x371edf;if(_0x255197>=_0x183037){_0x255197=_0x183037;_0x371edf=0xc8;}else{_0x371edf=0xce;}_0x5dabd9[_0x99a1('0x28')](_0x371edf);return _0x5dabd9['set'](_0x99a1('0x2f'),_0xf41b0d+'-'+_0x255197+'/'+_0x183037)[_0x99a1('0x2a')](_0xafea84);}return null;};}function patchUpdates(_0x36aa34){return function(_0x303d1e){try{jsonpatch[_0x99a1('0x30')](_0x303d1e,_0x36aa34,!![]);}catch(_0x969f6e){return BPromise[_0x99a1('0x31')](_0x969f6e);}return _0x303d1e[_0x99a1('0x32')]();};}function saveUpdates(_0x52da8d,_0x4960e4){return function(_0x3fa342){if(_0x3fa342){return _0x3fa342['update'](_0x52da8d)[_0x99a1('0x1c')](function(_0x400581){return _0x400581;});}return null;};}function removeEntity(_0x5b1a79,_0xa5972b){return function(_0x3503d5){if(_0x3503d5){return _0x3503d5[_0x99a1('0x33')]()[_0x99a1('0x1c')](function(){var _0x13f4db=_0x3503d5[_0x99a1('0x34')]({'plain':!![]});var _0x3081cd=_0x99a1('0x35');return db[_0x99a1('0x36')][_0x99a1('0x33')]({'where':{'type':_0x3081cd,'resourceId':_0x13f4db['id']}})[_0x99a1('0x1c')](function(){return _0x3503d5;});})[_0x99a1('0x1c')](function(){_0x5b1a79[_0x99a1('0x28')](0xcc)[_0x99a1('0x29')]();});}};}function handleEntityNotFound(_0x55005e,_0x53fed5){return function(_0x46e3f2){if(!_0x46e3f2){_0x55005e[_0x99a1('0x27')](0x194);}return _0x46e3f2;};}function handleError(_0x416a36,_0x4131e0){_0x4131e0=_0x4131e0||0x1f4;return function(_0x2690bd){logger[_0x99a1('0x22')](_0x2690bd[_0x99a1('0x37')]);if(_0x2690bd['name']){delete _0x2690bd[_0x99a1('0x38')];}_0x416a36[_0x99a1('0x28')](_0x4131e0)['send'](_0x2690bd);};}exports[_0x99a1('0x39')]=function(_0x2d328c,_0x391afa){var _0x3cd1a0={},_0x430cbc={},_0x399fd4={'count':0x0,'rows':[]};var _0x30e8a9=_[_0x99a1('0x3a')](db[_0x99a1('0x3b')][_0x99a1('0x3c')],function(_0x1da3e7){return{'name':_0x1da3e7[_0x99a1('0x3d')],'type':_0x1da3e7[_0x99a1('0x3e')]['key']};});_0x430cbc['model']=_['map'](_0x30e8a9,_0x99a1('0x38'));_0x430cbc[_0x99a1('0x3f')]=_[_0x99a1('0x40')](_0x2d328c[_0x99a1('0x3f')]);_0x430cbc[_0x99a1('0x41')]=_['intersection'](_0x430cbc[_0x99a1('0x42')],_0x430cbc[_0x99a1('0x3f')]);_0x3cd1a0[_0x99a1('0x43')]=_['intersection'](_0x430cbc['model'],qs[_0x99a1('0x44')](_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x44')]));_0x3cd1a0['attributes']=_0x3cd1a0[_0x99a1('0x43')][_0x99a1('0x45')]?_0x3cd1a0[_0x99a1('0x43')]:_0x430cbc[_0x99a1('0x42')];if(!_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x46')](_0x99a1('0x47'))){_0x3cd1a0[_0x99a1('0x2d')]=qs[_0x99a1('0x2d')](_0x2d328c[_0x99a1('0x3f')]['limit']);_0x3cd1a0[_0x99a1('0x2b')]=qs[_0x99a1('0x2b')](_0x2d328c[_0x99a1('0x3f')]['offset']);}_0x3cd1a0[_0x99a1('0x48')]=qs['sort'](_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x49')]);_0x3cd1a0[_0x99a1('0x4a')]=qs[_0x99a1('0x41')](_[_0x99a1('0x4b')](_0x2d328c[_0x99a1('0x3f')],_0x430cbc['filters']),_0x30e8a9);if(_0x2d328c[_0x99a1('0x3f')]['filter']){_0x3cd1a0[_0x99a1('0x4a')]=_[_0x99a1('0x4c')](_0x3cd1a0[_0x99a1('0x4a')],{'$or':_[_0x99a1('0x3a')](_0x30e8a9,function(_0x3a0b44){if(_0x3a0b44[_0x99a1('0x3e')]!==_0x99a1('0x4d')){var _0x3861b6={};_0x3861b6[_0x3a0b44[_0x99a1('0x38')]]={'$like':'%'+_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x4e')]+'%'};return _0x3861b6;}})});}_0x3cd1a0=_['merge']({},_0x3cd1a0,_0x2d328c[_0x99a1('0x4f')]);var _0x330e3b={'where':_0x3cd1a0['where']};return db[_0x99a1('0x3b')][_0x99a1('0x2e')](_0x330e3b)[_0x99a1('0x1c')](function(_0x2e377b){_0x399fd4[_0x99a1('0x2e')]=_0x2e377b;if(_0x2d328c[_0x99a1('0x3f')][_0x99a1('0x50')]){_0x3cd1a0['include']=[{'all':!![]}];}return db[_0x99a1('0x3b')]['findAll'](_0x3cd1a0);})[_0x99a1('0x1c')](function(_0x269798){_0x399fd4['rows']=_0x269798;return _0x399fd4;})['then'](respondWithFilteredResult(_0x391afa,_0x3cd1a0))[_0x99a1('0x26')](handleError(_0x391afa,null));};exports[_0x99a1('0x51')]=function(_0x462c15,_0x4519fb){var _0xee2b1b={'raw':![],'where':{'id':_0x462c15['params']['id']}},_0x597836={};_0x597836['model']=_[_0x99a1('0x40')](db[_0x99a1('0x3b')][_0x99a1('0x3c')]);_0x597836[_0x99a1('0x3f')]=_[_0x99a1('0x40')](_0x462c15[_0x99a1('0x3f')]);_0x597836[_0x99a1('0x41')]=_['intersection'](_0x597836[_0x99a1('0x42')],_0x597836[_0x99a1('0x3f')]);_0xee2b1b[_0x99a1('0x43')]=_['intersection'](_0x597836[_0x99a1('0x42')],qs['fields'](_0x462c15['query'][_0x99a1('0x44')]));_0xee2b1b[_0x99a1('0x43')]=_0xee2b1b[_0x99a1('0x43')][_0x99a1('0x45')]?_0xee2b1b[_0x99a1('0x43')]:_0x597836[_0x99a1('0x42')];if(_0x462c15[_0x99a1('0x3f')][_0x99a1('0x50')]){_0xee2b1b[_0x99a1('0x52')]=[{'all':!![]}];}_0xee2b1b=_['merge']({},_0xee2b1b,_0x462c15[_0x99a1('0x4f')]);return db['Trunk'][_0x99a1('0x53')](_0xee2b1b)[_0x99a1('0x1c')](handleEntityNotFound(_0x4519fb,null))['then'](respondWithResult(_0x4519fb,null))[_0x99a1('0x26')](handleError(_0x4519fb,null));};exports[_0x99a1('0x54')]=function(_0x469e10,_0x2b2d63){var _0x2800d5={'where':{'id':_0x469e10[_0x99a1('0x55')]['id']}},_0x1bff78={};_0x1bff78[_0x99a1('0x42')]=_[_0x99a1('0x40')](db[_0x99a1('0x3b')][_0x99a1('0x3c')]);_0x2800d5[_0x99a1('0x43')]=_['intersection'](_0x1bff78['model'],qs[_0x99a1('0x44')](_0x469e10[_0x99a1('0x3f')][_0x99a1('0x44')]));_0x2800d5[_0x99a1('0x43')]=_0x2800d5[_0x99a1('0x43')]['length']?_0x2800d5[_0x99a1('0x43')]:_0x1bff78[_0x99a1('0x42')];if(_0x469e10['query'][_0x99a1('0x50')]){_0x2800d5[_0x99a1('0x52')]=[{'all':!![]}];}_0x2800d5=_[_0x99a1('0x4c')]({},_0x2800d5,_0x469e10[_0x99a1('0x4f')]);return db[_0x99a1('0x3b')]['find'](_0x2800d5)[_0x99a1('0x1c')](handleEntityNotFound(_0x2b2d63,null))[_0x99a1('0x1c')](function(_0x1bb1cb){if(_0x1bb1cb){var _0x22811f=_0x1bb1cb[_0x99a1('0x34')]({'plain':!![]});_0x22811f=qs[_0x99a1('0x56')](_0x22811f,['id','createdAt',_0x99a1('0x57')]);_0x469e10[_0x99a1('0x58')]=_['omit'](_0x469e10[_0x99a1('0x58')],['id',_0x99a1('0x59'),_0x99a1('0x57')]);return db[_0x99a1('0x3b')][_0x99a1('0x5a')](_['merge'](_0x22811f,_0x469e10[_0x99a1('0x58')]),{'include':_0x469e10['query']['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x38ce3c){var _0x3f7c16=_0x469e10['user']['get']({'plain':!![]});if(!_0x3f7c16)throw new Error(_0x99a1('0x5b'));if(_0x3f7c16['role']===_0x99a1('0x5c')){var _0x263db3=_0x38ce3c[_0x99a1('0x34')]({'plain':!![]});var _0x180c1e='Trunks';return db[_0x99a1('0x5d')][_0x99a1('0x53')]({'where':{'name':_0x180c1e,'userProfileId':_0x3f7c16[_0x99a1('0x5e')]},'raw':!![]})['then'](function(_0x3a62c6){if(_0x3a62c6&&_0x3a62c6['autoAssociation']===0x0){return db[_0x99a1('0x36')][_0x99a1('0x5a')]({'name':_0x263db3[_0x99a1('0x38')],'resourceId':_0x263db3['id'],'type':_0x3a62c6[_0x99a1('0x38')],'sectionId':_0x3a62c6['id']},{})[_0x99a1('0x1c')](function(){return _0x38ce3c;});}else{return _0x38ce3c;}})['catch'](function(_0x4d37f8){logger['error'](_0x99a1('0x5f'),_0x4d37f8);throw _0x4d37f8;});}return _0x38ce3c;});}})[_0x99a1('0x1c')](respondWithResult(_0x2b2d63,0xc9))['catch'](handleError(_0x2b2d63,null));};exports['create']=function(_0x1fe7af,_0x2f5587,_0x401c8f){var _0x509d4f;return db['Trunk'][_0x99a1('0x5a')](_0x1fe7af['body'],{'raw':!![]})[_0x99a1('0x1c')](function(_0x129690){_0x509d4f=_0x129690;return db[_0x99a1('0x3b')]['findAll']({'raw':!![]});})[_0x99a1('0x1c')](function(_0x28c7d8){var _0x4ac99e=fs['readFileSync'](path[_0x99a1('0x60')](config['root'],_0x99a1('0x61')),_0x99a1('0x62'));var _0x30a0a5=fs['readFileSync'](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0x3d0ff6=ejs['render'](_0x4ac99e,{'trunks':_0x28c7d8||[]});fs['writeFileSync'](_0x99a1('0x65'),_0x3d0ff6);if(_0x509d4f[_0x99a1('0x66')]){var _0x1750d5=ejs[_0x99a1('0x67')](_0x30a0a5,{'trunks':_0x28c7d8||[]});fs['writeFileSync'](_0x99a1('0x68'),_0x1750d5);}})['then'](function(){return respondWithRpcPromise('Reload',_0x99a1('0x5a'),{'module':_0x99a1('0x69')});})[_0x99a1('0x1c')](function(){var _0x525969=_0x1fe7af[_0x99a1('0x5c')][_0x99a1('0x34')]({'plain':!![]});if(!_0x525969)throw new Error(_0x99a1('0x5b'));if(_0x525969[_0x99a1('0x6a')]===_0x99a1('0x5c')){var _0x4ae313=_0x509d4f[_0x99a1('0x34')]({'plain':!![]});return db[_0x99a1('0x5d')][_0x99a1('0x53')]({'where':{'name':_0x99a1('0x35'),'userProfileId':_0x525969[_0x99a1('0x5e')]},'raw':!![]})[_0x99a1('0x1c')](function(_0x5e42be){if(_0x5e42be&&_0x5e42be[_0x99a1('0x6b')]===0x0){return db[_0x99a1('0x36')][_0x99a1('0x5a')]({'name':_0x4ae313[_0x99a1('0x38')],'resourceId':_0x4ae313['id'],'type':_0x5e42be[_0x99a1('0x38')],'sectionId':_0x5e42be['id']},{})['then'](function(){return _0x509d4f;});}else{return _0x509d4f;}})[_0x99a1('0x26')](function(_0x68c944){logger[_0x99a1('0x22')](_0x99a1('0x5f'),_0x68c944);throw _0x68c944;});}return _0x509d4f;})[_0x99a1('0x1c')](respondWithResult(_0x2f5587,0xc9))[_0x99a1('0x26')](handleError(_0x2f5587,null));};exports['update']=function(_0xaa953e,_0x33d96b,_0x4a5617){var _0x56716a;return db[_0x99a1('0x3b')][_0x99a1('0x53')]({'where':{'id':_0xaa953e['params']['id']}})[_0x99a1('0x1c')](handleEntityNotFound(_0x33d96b,null))[_0x99a1('0x1c')](saveUpdates(_0xaa953e[_0x99a1('0x58')],null))[_0x99a1('0x1c')](function(_0x43156f){if(_0x43156f){_0x56716a=_0x43156f;return db[_0x99a1('0x3b')][_0x99a1('0x6c')]({'raw':!![]});}})[_0x99a1('0x1c')](function(_0x4260d7){if(_0x4260d7){var _0x3e099c=fs[_0x99a1('0x6d')](path[_0x99a1('0x60')](config[_0x99a1('0x63')],'server/files/templates/trunk.ejs'),_0x99a1('0x62'));var _0x5a9a7d=fs['readFileSync'](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0xbbbe26=ejs[_0x99a1('0x67')](_0x3e099c,{'trunks':_0x4260d7||[]});fs[_0x99a1('0x6e')](_0x99a1('0x65'),_0xbbbe26);var _0x361ce6=ejs['render'](_0x5a9a7d,{'trunks':_0x4260d7||[]});fs[_0x99a1('0x6e')](_0x99a1('0x68'),_0x361ce6);return respondWithRpcPromise(_0x99a1('0x6f'),_0x99a1('0x70'),{'module':_0x99a1('0x69')});}return null;})[_0x99a1('0x1c')](function(_0x6dab29){if(_0x6dab29){return _0x56716a;}})[_0x99a1('0x1c')](respondWithResult(_0x33d96b,null))['catch'](handleError(_0x33d96b,null));};exports['destroy']=function(_0x51c289,_0x2dd29b,_0x353f25){var _0x53cdb3;return db[_0x99a1('0x3b')][_0x99a1('0x53')]({'where':{'id':_0x51c289[_0x99a1('0x55')]['id']}})[_0x99a1('0x1c')](handleEntityNotFound(_0x2dd29b,null))['then'](removeEntity(_0x2dd29b,null))[_0x99a1('0x1c')](function(){return db[_0x99a1('0x3b')][_0x99a1('0x6c')]({'raw':!![]});})[_0x99a1('0x1c')](function(_0x4e9fe9){var _0x24aa05=fs['readFileSync'](path['join'](config['root'],_0x99a1('0x61')),'utf8');var _0xb7744c=fs[_0x99a1('0x6d')](path[_0x99a1('0x60')](config[_0x99a1('0x63')],_0x99a1('0x64')),_0x99a1('0x62'));var _0x444e43=ejs['render'](_0x24aa05,{'trunks':_0x4e9fe9});var _0x4fcd65=ejs[_0x99a1('0x67')](_0xb7744c,{'trunks':_0x4e9fe9});fs[_0x99a1('0x6e')](_0x99a1('0x65'),_0x444e43);fs['writeFileSync'](_0x99a1('0x68'),_0x4fcd65);return respondWithRpcPromise(_0x99a1('0x6f'),_0x99a1('0x33'),{'module':'chan_sip.so'});})[_0x99a1('0x26')](handleError(_0x2dd29b,null));}; \ No newline at end of file +var _0x24ca=['lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','get','Trunks','UserProfileResource','destroy','then','end','name','send','map','Trunk','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','params','rawAttributes','keys','find','clone','length','omit','createdAt','updatedAt','create','user','role','userProfileId','autoAssociation','body','join','root','server/files/templates/trunk.ejs','readFileSync','server/files/templates/registry.ejs','utf8','writeFileSync','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/sip_xcally_trunks.conf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra'];(function(_0x1008da,_0x1bdec0){var _0x4ed756=function(_0x4ac079){while(--_0x4ac079){_0x1008da['push'](_0x1008da['shift']());}};_0x4ed756(++_0x1bdec0);}(_0x24ca,0x1bc));var _0xa24c=function(_0x22868f,_0x450f48){_0x22868f=_0x22868f-0x0;var _0x97bc75=_0x24ca[_0x22868f];return _0x97bc75;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));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('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];var jayson=require(_0xa24c('0x1b'));var client=jayson[_0xa24c('0x1c')][_0xa24c('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x5a9486,_0x3ad0bf,_0x3c23fc,_0x26ff28){return new BPromise(function(_0x2fcd8b,_0x1cb08e){var _0x2d185c=_0x26ff28||client;return _0x2d185c[_0xa24c('0x1e')](_0x5a9486,_0x3c23fc)['then'](function(_0x47a063){logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,'request\x20sent');logger['debug'](_0xa24c('0x21'),_0x3ad0bf,_0xa24c('0x22'),JSON['stringify'](_0x47a063));if(_0x47a063[_0xa24c('0x23')]){if(_0x47a063['error'][_0xa24c('0x24')]===0x1f4){logger[_0xa24c('0x23')](_0xa24c('0x20'),_0x3ad0bf,_0x47a063[_0xa24c('0x23')]['message']);return _0x1cb08e(_0x47a063[_0xa24c('0x23')][_0xa24c('0x25')]);}logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x47a063['error']['message']);return _0x2fcd8b(_0x47a063['error'][_0xa24c('0x25')]);}else{logger[_0xa24c('0x1f')](_0xa24c('0x20'),_0x3ad0bf,_0xa24c('0x22'));_0x2fcd8b(_0x47a063['result'][_0xa24c('0x25')]);}})['catch'](function(_0x224bca){logger[_0xa24c('0x23')]('Trunk,\x20%s,\x20%s',_0x3ad0bf,_0x224bca);_0x1cb08e(_0x224bca);});});}function respondWithStatusCode(_0x346ee8,_0x363d52){_0x363d52=_0x363d52||0xcc;return function(_0x43a0c0){if(_0x43a0c0){return _0x346ee8[_0xa24c('0x26')](_0x363d52);}return _0x346ee8[_0xa24c('0x27')](_0x363d52)['end']();};}function respondWithResult(_0xec9167,_0x5cc9cb){_0x5cc9cb=_0x5cc9cb||0xc8;return function(_0x2365f9){if(_0x2365f9){return _0xec9167[_0xa24c('0x27')](_0x5cc9cb)[_0xa24c('0x28')](_0x2365f9);}};}function respondWithFilteredResult(_0x51dc3f,_0x1beb55){return function(_0x31c4d9){if(_0x31c4d9){var _0x14fd5a=typeof _0x1beb55[_0xa24c('0x29')]===_0xa24c('0x2a')&&typeof _0x1beb55[_0xa24c('0x2b')]===_0xa24c('0x2a');var _0x5b23f4=_0x31c4d9[_0xa24c('0x2c')];var _0x28675f=_0x14fd5a?0x0:_0x1beb55[_0xa24c('0x29')];var _0x12dbdc=_0x14fd5a?_0x31c4d9['count']:_0x1beb55[_0xa24c('0x29')]+_0x1beb55[_0xa24c('0x2b')];var _0x97c08;if(_0x12dbdc>=_0x5b23f4){_0x12dbdc=_0x5b23f4;_0x97c08=0xc8;}else{_0x97c08=0xce;}_0x51dc3f['status'](_0x97c08);return _0x51dc3f[_0xa24c('0x2d')](_0xa24c('0x2e'),_0x28675f+'-'+_0x12dbdc+'/'+_0x5b23f4)[_0xa24c('0x28')](_0x31c4d9);}return null;};}function patchUpdates(_0x4ae35c){return function(_0x245fb2){try{jsonpatch['apply'](_0x245fb2,_0x4ae35c,!![]);}catch(_0x1102ab){return BPromise[_0xa24c('0x2f')](_0x1102ab);}return _0x245fb2[_0xa24c('0x30')]();};}function saveUpdates(_0x5d025a,_0x1f52f8){return function(_0x53f90){if(_0x53f90){return _0x53f90[_0xa24c('0x31')](_0x5d025a)['then'](function(_0x1c1ed3){return _0x1c1ed3;});}return null;};}function removeEntity(_0x57c340,_0xa20091){return function(_0x42ba21){if(_0x42ba21){return _0x42ba21['destroy']()['then'](function(){var _0x20a276=_0x42ba21[_0xa24c('0x32')]({'plain':!![]});var _0x182e86=_0xa24c('0x33');return db[_0xa24c('0x34')][_0xa24c('0x35')]({'where':{'type':_0x182e86,'resourceId':_0x20a276['id']}})[_0xa24c('0x36')](function(){return _0x42ba21;});})['then'](function(){_0x57c340[_0xa24c('0x27')](0xcc)[_0xa24c('0x37')]();});}};}function handleEntityNotFound(_0x12825d,_0xbd24c0){return function(_0xc6337b){if(!_0xc6337b){_0x12825d[_0xa24c('0x26')](0x194);}return _0xc6337b;};}function handleError(_0x86902f,_0x81d471){_0x81d471=_0x81d471||0x1f4;return function(_0x1ea166){logger[_0xa24c('0x23')](_0x1ea166['stack']);if(_0x1ea166[_0xa24c('0x38')]){delete _0x1ea166[_0xa24c('0x38')];}_0x86902f[_0xa24c('0x27')](_0x81d471)[_0xa24c('0x39')](_0x1ea166);};}exports['index']=function(_0x56a485,_0x19a65f){var _0x56ef4d={},_0xb690b5={},_0x13f272={'count':0x0,'rows':[]};var _0x22a316=_[_0xa24c('0x3a')](db[_0xa24c('0x3b')]['rawAttributes'],function(_0x532875){return{'name':_0x532875[_0xa24c('0x3c')],'type':_0x532875[_0xa24c('0x3d')][_0xa24c('0x3e')]};});_0xb690b5[_0xa24c('0x3f')]=_[_0xa24c('0x3a')](_0x22a316,_0xa24c('0x38'));_0xb690b5['query']=_['keys'](_0x56a485[_0xa24c('0x40')]);_0xb690b5[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],_0xb690b5[_0xa24c('0x40')]);_0x56ef4d['attributes']=_[_0xa24c('0x42')](_0xb690b5[_0xa24c('0x3f')],qs['fields'](_0x56a485['query'][_0xa24c('0x43')]));_0x56ef4d[_0xa24c('0x44')]=_0x56ef4d[_0xa24c('0x44')]['length']?_0x56ef4d['attributes']:_0xb690b5[_0xa24c('0x3f')];if(!_0x56a485[_0xa24c('0x40')][_0xa24c('0x45')](_0xa24c('0x46'))){_0x56ef4d[_0xa24c('0x2b')]=qs[_0xa24c('0x2b')](_0x56a485[_0xa24c('0x40')][_0xa24c('0x2b')]);_0x56ef4d['offset']=qs['offset'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x29')]);}_0x56ef4d[_0xa24c('0x47')]=qs['sort'](_0x56a485[_0xa24c('0x40')][_0xa24c('0x48')]);_0x56ef4d[_0xa24c('0x49')]=qs[_0xa24c('0x41')](_[_0xa24c('0x4a')](_0x56a485[_0xa24c('0x40')],_0xb690b5[_0xa24c('0x41')]),_0x22a316);if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]){_0x56ef4d[_0xa24c('0x49')]=_['merge'](_0x56ef4d[_0xa24c('0x49')],{'$or':_[_0xa24c('0x3a')](_0x22a316,function(_0x39a6cd){if(_0x39a6cd['type']!==_0xa24c('0x4c')){var _0x247d2c={};_0x247d2c[_0x39a6cd[_0xa24c('0x38')]]={'$like':'%'+_0x56a485[_0xa24c('0x40')][_0xa24c('0x4b')]+'%'};return _0x247d2c;}})});}_0x56ef4d=_[_0xa24c('0x4d')]({},_0x56ef4d,_0x56a485[_0xa24c('0x4e')]);var _0x46f725={'where':_0x56ef4d[_0xa24c('0x49')]};return db[_0xa24c('0x3b')][_0xa24c('0x2c')](_0x46f725)['then'](function(_0x29a84d){_0x13f272[_0xa24c('0x2c')]=_0x29a84d;if(_0x56a485[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x56ef4d[_0xa24c('0x50')]=[{'all':!![]}];}return db[_0xa24c('0x3b')][_0xa24c('0x51')](_0x56ef4d);})[_0xa24c('0x36')](function(_0x184179){_0x13f272['rows']=_0x184179;return _0x13f272;})['then'](respondWithFilteredResult(_0x19a65f,_0x56ef4d))[_0xa24c('0x52')](handleError(_0x19a65f,null));};exports['show']=function(_0xc078ef,_0x1f436c){var _0x4ec677={'raw':![],'where':{'id':_0xc078ef[_0xa24c('0x53')]['id']}},_0x24b3df={};_0x24b3df[_0xa24c('0x3f')]=_['keys'](db['Trunk'][_0xa24c('0x54')]);_0x24b3df['query']=_[_0xa24c('0x55')](_0xc078ef[_0xa24c('0x40')]);_0x24b3df[_0xa24c('0x41')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],_0x24b3df[_0xa24c('0x40')]);_0x4ec677[_0xa24c('0x44')]=_[_0xa24c('0x42')](_0x24b3df[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0xc078ef['query'][_0xa24c('0x43')]));_0x4ec677[_0xa24c('0x44')]=_0x4ec677[_0xa24c('0x44')]['length']?_0x4ec677['attributes']:_0x24b3df['model'];if(_0xc078ef[_0xa24c('0x40')]['includeAll']){_0x4ec677[_0xa24c('0x50')]=[{'all':!![]}];}_0x4ec677=_[_0xa24c('0x4d')]({},_0x4ec677,_0xc078ef['options']);return db[_0xa24c('0x3b')][_0xa24c('0x56')](_0x4ec677)[_0xa24c('0x36')](handleEntityNotFound(_0x1f436c,null))[_0xa24c('0x36')](respondWithResult(_0x1f436c,null))[_0xa24c('0x52')](handleError(_0x1f436c,null));};exports[_0xa24c('0x57')]=function(_0x3816f7,_0xbeab78){var _0x518c2a={'where':{'id':_0x3816f7['params']['id']}},_0x172645={};_0x172645['model']=_['keys'](db['Trunk']['rawAttributes']);_0x518c2a[_0xa24c('0x44')]=_['intersection'](_0x172645[_0xa24c('0x3f')],qs[_0xa24c('0x43')](_0x3816f7[_0xa24c('0x40')][_0xa24c('0x43')]));_0x518c2a[_0xa24c('0x44')]=_0x518c2a[_0xa24c('0x44')][_0xa24c('0x58')]?_0x518c2a[_0xa24c('0x44')]:_0x172645[_0xa24c('0x3f')];if(_0x3816f7[_0xa24c('0x40')][_0xa24c('0x4f')]){_0x518c2a[_0xa24c('0x50')]=[{'all':!![]}];}_0x518c2a=_[_0xa24c('0x4d')]({},_0x518c2a,_0x3816f7[_0xa24c('0x4e')]);return db[_0xa24c('0x3b')]['find'](_0x518c2a)[_0xa24c('0x36')](handleEntityNotFound(_0xbeab78,null))[_0xa24c('0x36')](function(_0x5264a7){if(_0x5264a7){var _0x1e08bb=_0x5264a7[_0xa24c('0x32')]({'plain':!![]});_0x1e08bb=qs[_0xa24c('0x59')](_0x1e08bb,['id',_0xa24c('0x5a'),'updatedAt']);_0x3816f7['body']=_[_0xa24c('0x59')](_0x3816f7['body'],['id','createdAt',_0xa24c('0x5b')]);return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_[_0xa24c('0x4d')](_0x1e08bb,_0x3816f7['body']),{'include':_0x3816f7['query'][_0xa24c('0x4f')]?[{'all':!![]}]:undefined})['then'](function(_0x52a895){var _0xfcc193=_0x3816f7[_0xa24c('0x5d')][_0xa24c('0x32')]({'plain':!![]});if(!_0xfcc193)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfcc193[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5c3285=_0x52a895[_0xa24c('0x32')]({'plain':!![]});var _0x3f306d=_0xa24c('0x33');return db['UserProfileSection'][_0xa24c('0x56')]({'where':{'name':_0x3f306d,'userProfileId':_0xfcc193[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x7aab6e){if(_0x7aab6e&&_0x7aab6e[_0xa24c('0x60')]===0x0){return db['UserProfileResource'][_0xa24c('0x5c')]({'name':_0x5c3285[_0xa24c('0x38')],'resourceId':_0x5c3285['id'],'type':_0x7aab6e[_0xa24c('0x38')],'sectionId':_0x7aab6e['id']},{})[_0xa24c('0x36')](function(){return _0x52a895;});}else{return _0x52a895;}})[_0xa24c('0x52')](function(_0x2ca3fa){logger[_0xa24c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ca3fa);throw _0x2ca3fa;});}return _0x52a895;});}})[_0xa24c('0x36')](respondWithResult(_0xbeab78,0xc9))[_0xa24c('0x52')](handleError(_0xbeab78,null));};exports['create']=function(_0xb1048a,_0x3e455b,_0x14da5e){var _0xb460b4;return db[_0xa24c('0x3b')][_0xa24c('0x5c')](_0xb1048a[_0xa24c('0x61')],{'raw':!![]})[_0xa24c('0x36')](function(_0x38cc30){_0xb460b4=_0x38cc30;return db[_0xa24c('0x3b')]['findAll']({'raw':!![]});})[_0xa24c('0x36')](function(_0x3a4abd){var _0x3b894f=fs['readFileSync'](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x64')),'utf8');var _0x3ac3a0=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4f9b56=ejs['render'](_0x3b894f,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x4f9b56);if(_0xb460b4[_0xa24c('0x69')]){var _0x1879ae=ejs[_0xa24c('0x6a')](_0x3ac3a0,{'trunks':_0x3a4abd||[]});fs[_0xa24c('0x68')](_0xa24c('0x6b'),_0x1879ae);}})['then'](function(){return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x5c'),{'module':_0xa24c('0x6d')});})[_0xa24c('0x36')](function(){var _0x987aca=_0xb1048a[_0xa24c('0x5d')]['get']({'plain':!![]});if(!_0x987aca)throw new Error(_0xa24c('0x6e'));if(_0x987aca[_0xa24c('0x5e')]===_0xa24c('0x5d')){var _0x5b9ad7=_0xb460b4['get']({'plain':!![]});return db[_0xa24c('0x6f')]['find']({'where':{'name':_0xa24c('0x33'),'userProfileId':_0x987aca[_0xa24c('0x5f')]},'raw':!![]})[_0xa24c('0x36')](function(_0x180da2){if(_0x180da2&&_0x180da2['autoAssociation']===0x0){return db[_0xa24c('0x34')][_0xa24c('0x5c')]({'name':_0x5b9ad7['name'],'resourceId':_0x5b9ad7['id'],'type':_0x180da2[_0xa24c('0x38')],'sectionId':_0x180da2['id']},{})[_0xa24c('0x36')](function(){return _0xb460b4;});}else{return _0xb460b4;}})[_0xa24c('0x52')](function(_0x3e0c08){logger[_0xa24c('0x23')](_0xa24c('0x70'),_0x3e0c08);throw _0x3e0c08;});}return _0xb460b4;})[_0xa24c('0x36')](respondWithResult(_0x3e455b,0xc9))[_0xa24c('0x52')](handleError(_0x3e455b,null));};exports['update']=function(_0x12508e,_0x3c2726,_0x2cae90){var _0x28c3ff;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x12508e[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3c2726,null))[_0xa24c('0x36')](saveUpdates(_0x12508e[_0xa24c('0x61')],null))[_0xa24c('0x36')](function(_0x5b0127){if(_0x5b0127){_0x28c3ff=_0x5b0127;return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});}})['then'](function(_0x141ccf){if(_0x141ccf){var _0x3f212f=fs[_0xa24c('0x65')](path['join'](config['root'],_0xa24c('0x64')),_0xa24c('0x67'));var _0x53928f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config[_0xa24c('0x63')],_0xa24c('0x66')),_0xa24c('0x67'));var _0x336898=ejs['render'](_0x3f212f,{'trunks':_0x141ccf||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x336898);var _0x263dab=ejs['render'](_0x53928f,{'trunks':_0x141ccf||[]});fs['writeFileSync'](_0xa24c('0x6b'),_0x263dab);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x31'),{'module':_0xa24c('0x6d')});}return null;})[_0xa24c('0x36')](function(_0x45b2fe){if(_0x45b2fe){return _0x28c3ff;}})[_0xa24c('0x36')](respondWithResult(_0x3c2726,null))[_0xa24c('0x52')](handleError(_0x3c2726,null));};exports[_0xa24c('0x35')]=function(_0x4ee10d,_0x3897ca,_0xa077c8){var _0x16e1db;return db[_0xa24c('0x3b')][_0xa24c('0x56')]({'where':{'id':_0x4ee10d[_0xa24c('0x53')]['id']}})[_0xa24c('0x36')](handleEntityNotFound(_0x3897ca,null))[_0xa24c('0x36')](removeEntity(_0x3897ca,null))[_0xa24c('0x36')](function(){return db[_0xa24c('0x3b')][_0xa24c('0x51')]({'raw':!![]});})[_0xa24c('0x36')](function(_0x4ecbe9){var _0x1fe0f3=fs[_0xa24c('0x65')](path['join'](config[_0xa24c('0x63')],_0xa24c('0x64')),_0xa24c('0x67'));var _0x4af78f=fs[_0xa24c('0x65')](path[_0xa24c('0x62')](config['root'],_0xa24c('0x66')),_0xa24c('0x67'));var _0x4c108f=ejs['render'](_0x1fe0f3,{'trunks':_0x4ecbe9});var _0x124d52=ejs[_0xa24c('0x6a')](_0x4af78f,{'trunks':_0x4ecbe9});fs[_0xa24c('0x68')](_0xa24c('0x71'),_0x4c108f);fs['writeFileSync'](_0xa24c('0x6b'),_0x124d52);return respondWithRpcPromise(_0xa24c('0x6c'),_0xa24c('0x35'),{'module':'chan_sip.so'});})['catch'](handleError(_0x3897ca,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 5999c9c..addaf98 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 _0xa7f8=['api','moment','request-promise','path','rimraf','exports','define','Trunk','tools_trunks','lodash','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa7f8,0x195));var _0x8a7f=function(_0x3d34da,_0x3abcc1){_0x3d34da=_0x3d34da-0x0;var _0xcf6af8=_0xa7f8[_0x3d34da];return _0xcf6af8;};'use strict';var _=require(_0x8a7f('0x0'));var util=require(_0x8a7f('0x1'));var logger=require(_0x8a7f('0x2'))(_0x8a7f('0x3'));var moment=require(_0x8a7f('0x4'));var BPromise=require('bluebird');var rp=require(_0x8a7f('0x5'));var fs=require('fs');var path=require(_0x8a7f('0x6'));var rimraf=require(_0x8a7f('0x7'));var config=require('../../config/environment');var attributes=require('./trunk.attributes');module[_0x8a7f('0x8')]=function(_0x3369b5,_0x345f63){return _0x3369b5[_0x8a7f('0x9')](_0x8a7f('0xa'),attributes,{'tableName':_0x8a7f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbac9=['bluebird','request-promise','rimraf','../../config/environment','exports','define','Trunk','util','moment'];(function(_0x456f71,_0x621c51){var _0x70f0f7=function(_0x2b24c2){while(--_0x2b24c2){_0x456f71['push'](_0x456f71['shift']());}};_0x70f0f7(++_0x621c51);}(_0xbac9,0xf1));var _0x9bac=function(_0x93bdde,_0x26ca52){_0x93bdde=_0x93bdde-0x0;var _0x19fb76=_0xbac9[_0x93bdde];return _0x19fb76;};'use strict';var _=require('lodash');var util=require(_0x9bac('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x9bac('0x1'));var BPromise=require(_0x9bac('0x2'));var rp=require(_0x9bac('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9bac('0x4'));var config=require(_0x9bac('0x5'));var attributes=require('./trunk.attributes');module[_0x9bac('0x6')]=function(_0x322344,_0x34b56f){return _0x322344[_0x9bac('0x7')](_0x9bac('0x8'),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 f7e9d85..54a555a 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 _0xa9f5=['Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetTrunk','Trunk','findAll','options','raw','where','attributes','map','include','model','catch','find','ShowTrunk','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','Trunk,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x8a25ce,_0x1d3d41){var _0x195a76=function(_0x37787e){while(--_0x37787e){_0x8a25ce['push'](_0x8a25ce['shift']());}};_0x195a76(++_0x1d3d41);}(_0xa9f5,0x17c));var _0x5a9f=function(_0x24c643,_0x5555c6){_0x24c643=_0x24c643-0x0;var _0x51afe6=_0xa9f5[_0x24c643];return _0x51afe6;};'use strict';var _=require(_0x5a9f('0x0'));var util=require(_0x5a9f('0x1'));var moment=require('moment');var BPromise=require(_0x5a9f('0x2'));var rs=require(_0x5a9f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a9f('0x4'))['db'];var utils=require(_0x5a9f('0x5'));var logger=require(_0x5a9f('0x6'))(_0x5a9f('0x7'));var config=require(_0x5a9f('0x8'));var jayson=require(_0x5a9f('0x9'));var client=jayson[_0x5a9f('0xa')][_0x5a9f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4393c,_0xb4234e,_0x53e462){return new BPromise(function(_0x3c2a53,_0x543cc3){return client['request'](_0x4393c,_0x53e462)[_0x5a9f('0xc')](function(_0x321803){logger['info'](_0x5a9f('0xd'),_0xb4234e,_0x5a9f('0xe'));logger[_0x5a9f('0xf')](_0x5a9f('0x10'),_0xb4234e,_0x5a9f('0xe'),JSON[_0x5a9f('0x11')](_0x321803));if(_0x321803[_0x5a9f('0x12')]){if(_0x321803[_0x5a9f('0x12')][_0x5a9f('0x13')]===0x1f4){logger[_0x5a9f('0x12')](_0x5a9f('0xd'),_0xb4234e,_0x321803[_0x5a9f('0x12')][_0x5a9f('0x14')]);return _0x543cc3(_0x321803[_0x5a9f('0x12')][_0x5a9f('0x14')]);}logger[_0x5a9f('0x12')](_0x5a9f('0xd'),_0xb4234e,_0x321803[_0x5a9f('0x12')]['message']);return _0x3c2a53(_0x321803[_0x5a9f('0x12')][_0x5a9f('0x14')]);}else{logger[_0x5a9f('0x15')]('Trunk,\x20%s,\x20%s',_0xb4234e,_0x5a9f('0xe'));_0x3c2a53(_0x321803[_0x5a9f('0x16')][_0x5a9f('0x14')]);}})['catch'](function(_0x1092ac){logger[_0x5a9f('0x12')](_0x5a9f('0xd'),_0xb4234e,_0x1092ac);_0x543cc3(_0x1092ac);});});}exports[_0x5a9f('0x17')]=function(_0x4706e0){var _0x3038e1=this;return new Promise(function(_0x7dfda6,_0x55649f){return db[_0x5a9f('0x18')][_0x5a9f('0x19')]({'raw':_0x4706e0[_0x5a9f('0x1a')]?_0x4706e0[_0x5a9f('0x1a')][_0x5a9f('0x1b')]===undefined?!![]:![]:!![],'where':_0x4706e0[_0x5a9f('0x1a')]?_0x4706e0[_0x5a9f('0x1a')][_0x5a9f('0x1c')]||null:null,'attributes':_0x4706e0['options']?_0x4706e0[_0x5a9f('0x1a')][_0x5a9f('0x1d')]||null:null,'limit':_0x4706e0['options']?_0x4706e0[_0x5a9f('0x1a')]['limit']||null:null,'include':_0x4706e0[_0x5a9f('0x1a')]?_0x4706e0[_0x5a9f('0x1a')]['include']?_[_0x5a9f('0x1e')](_0x4706e0[_0x5a9f('0x1a')][_0x5a9f('0x1f')],function(_0x3bb460){return{'model':db[_0x3bb460['model']],'as':_0x3bb460['as'],'attributes':_0x3bb460[_0x5a9f('0x1d')],'include':_0x3bb460[_0x5a9f('0x1f')]?_['map'](_0x3bb460['include'],function(_0x36f1dc){return{'model':db[_0x36f1dc['model']],'as':_0x36f1dc['as'],'attributes':_0x36f1dc[_0x5a9f('0x1d')],'include':_0x36f1dc[_0x5a9f('0x1f')]?_[_0x5a9f('0x1e')](_0x36f1dc[_0x5a9f('0x1f')],function(_0x361dd1){return{'model':db[_0x361dd1[_0x5a9f('0x20')]],'as':_0x361dd1['as'],'attributes':_0x361dd1[_0x5a9f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5a9f('0xc')](function(_0x6a089a){logger[_0x5a9f('0x15')](_0x5a9f('0x17'),_0x4706e0);logger['debug']('GetTrunk',_0x4706e0,JSON[_0x5a9f('0x11')](_0x6a089a));_0x7dfda6(_0x6a089a);})[_0x5a9f('0x21')](function(_0x3c10a9){logger['error'](_0x5a9f('0x17'),_0x3c10a9[_0x5a9f('0x14')],_0x4706e0);_0x55649f(_0x3038e1[_0x5a9f('0x12')](0x1f4,_0x3c10a9[_0x5a9f('0x14')]));});});};exports['ShowTrunk']=function(_0x2c518a){var _0xf7efa9=this;return new Promise(function(_0x4a0d1f,_0x103a6c){return db['Trunk'][_0x5a9f('0x22')]({'raw':_0x2c518a[_0x5a9f('0x1a')]?_0x2c518a[_0x5a9f('0x1a')][_0x5a9f('0x1b')]===undefined?!![]:![]:!![],'where':_0x2c518a[_0x5a9f('0x1a')]?_0x2c518a['options'][_0x5a9f('0x1c')]||null:null,'attributes':_0x2c518a['options']?_0x2c518a[_0x5a9f('0x1a')]['attributes']||null:null,'include':_0x2c518a[_0x5a9f('0x1a')]?_0x2c518a['options'][_0x5a9f('0x1f')]?_['map'](_0x2c518a['options'][_0x5a9f('0x1f')],function(_0x1c51af){return{'model':db[_0x1c51af[_0x5a9f('0x20')]],'as':_0x1c51af['as'],'attributes':_0x1c51af[_0x5a9f('0x1d')],'include':_0x1c51af[_0x5a9f('0x1f')]?_[_0x5a9f('0x1e')](_0x1c51af[_0x5a9f('0x1f')],function(_0x186f87){return{'model':db[_0x186f87[_0x5a9f('0x20')]],'as':_0x186f87['as'],'attributes':_0x186f87['attributes'],'include':_0x186f87[_0x5a9f('0x1f')]?_[_0x5a9f('0x1e')](_0x186f87['include'],function(_0x2e8c49){return{'model':db[_0x2e8c49[_0x5a9f('0x20')]],'as':_0x2e8c49['as'],'attributes':_0x2e8c49[_0x5a9f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x5a9f('0xc')](function(_0x2f05bd){logger[_0x5a9f('0x15')](_0x5a9f('0x23'),_0x2c518a);logger['debug']('ShowTrunk',_0x2c518a,JSON['stringify'](_0x2f05bd));_0x4a0d1f(_0x2f05bd);})['catch'](function(_0x4a920b){logger['error'](_0x5a9f('0x23'),_0x4a920b[_0x5a9f('0x14')],_0x2c518a);_0x103a6c(_0xf7efa9[_0x5a9f('0x12')](0x1f4,_0x4a920b[_0x5a9f('0x14')]));});});}; \ No newline at end of file +var _0xc393=['jayson/promise','client','http','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTrunk','Trunk','options','where','attributes','include','map','model','debug','ShowTrunk','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc393,0x177));var _0x3c39=function(_0x14686a,_0x540f0d){_0x14686a=_0x14686a-0x0;var _0xeafc86=_0xc393[_0x14686a];return _0xeafc86;};'use strict';var _=require(_0x3c39('0x0'));var util=require(_0x3c39('0x1'));var moment=require(_0x3c39('0x2'));var BPromise=require(_0x3c39('0x3'));var rs=require(_0x3c39('0x4'));var fs=require('fs');var Redis=require(_0x3c39('0x5'));var db=require(_0x3c39('0x6'))['db'];var utils=require(_0x3c39('0x7'));var logger=require(_0x3c39('0x8'))(_0x3c39('0x9'));var config=require('../../config/environment');var jayson=require(_0x3c39('0xa'));var client=jayson[_0x3c39('0xb')][_0x3c39('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16dc74,_0x21a287,_0x4a7c07){return new BPromise(function(_0x292b18,_0xdd12e5){return client['request'](_0x16dc74,_0x4a7c07)[_0x3c39('0xd')](function(_0x1826af){logger[_0x3c39('0xe')](_0x3c39('0xf'),_0x21a287,_0x3c39('0x10'));logger['debug'](_0x3c39('0x11'),_0x21a287,_0x3c39('0x10'),JSON[_0x3c39('0x12')](_0x1826af));if(_0x1826af[_0x3c39('0x13')]){if(_0x1826af['error'][_0x3c39('0x14')]===0x1f4){logger[_0x3c39('0x13')](_0x3c39('0xf'),_0x21a287,_0x1826af['error'][_0x3c39('0x15')]);return _0xdd12e5(_0x1826af['error'][_0x3c39('0x15')]);}logger[_0x3c39('0x13')](_0x3c39('0xf'),_0x21a287,_0x1826af[_0x3c39('0x13')][_0x3c39('0x15')]);return _0x292b18(_0x1826af[_0x3c39('0x13')][_0x3c39('0x15')]);}else{logger[_0x3c39('0xe')](_0x3c39('0xf'),_0x21a287,_0x3c39('0x10'));_0x292b18(_0x1826af['result'][_0x3c39('0x15')]);}})[_0x3c39('0x16')](function(_0x839dd2){logger[_0x3c39('0x13')](_0x3c39('0xf'),_0x21a287,_0x839dd2);_0xdd12e5(_0x839dd2);});});}exports[_0x3c39('0x17')]=function(_0x3d4bd0){var _0xae8961=this;return new Promise(function(_0x4b6d81,_0x4fbd8c){return db[_0x3c39('0x18')]['findAll']({'raw':_0x3d4bd0[_0x3c39('0x19')]?_0x3d4bd0['options']['raw']===undefined?!![]:![]:!![],'where':_0x3d4bd0[_0x3c39('0x19')]?_0x3d4bd0[_0x3c39('0x19')][_0x3c39('0x1a')]||null:null,'attributes':_0x3d4bd0[_0x3c39('0x19')]?_0x3d4bd0[_0x3c39('0x19')][_0x3c39('0x1b')]||null:null,'limit':_0x3d4bd0[_0x3c39('0x19')]?_0x3d4bd0[_0x3c39('0x19')]['limit']||null:null,'include':_0x3d4bd0[_0x3c39('0x19')]?_0x3d4bd0['options'][_0x3c39('0x1c')]?_[_0x3c39('0x1d')](_0x3d4bd0[_0x3c39('0x19')][_0x3c39('0x1c')],function(_0x2485fe){return{'model':db[_0x2485fe[_0x3c39('0x1e')]],'as':_0x2485fe['as'],'attributes':_0x2485fe[_0x3c39('0x1b')],'include':_0x2485fe[_0x3c39('0x1c')]?_[_0x3c39('0x1d')](_0x2485fe[_0x3c39('0x1c')],function(_0x11f419){return{'model':db[_0x11f419['model']],'as':_0x11f419['as'],'attributes':_0x11f419[_0x3c39('0x1b')],'include':_0x11f419[_0x3c39('0x1c')]?_['map'](_0x11f419[_0x3c39('0x1c')],function(_0x3fc5aa){return{'model':db[_0x3fc5aa[_0x3c39('0x1e')]],'as':_0x3fc5aa['as'],'attributes':_0x3fc5aa[_0x3c39('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3c39('0xd')](function(_0x595ade){logger[_0x3c39('0xe')](_0x3c39('0x17'),_0x3d4bd0);logger[_0x3c39('0x1f')]('GetTrunk',_0x3d4bd0,JSON[_0x3c39('0x12')](_0x595ade));_0x4b6d81(_0x595ade);})[_0x3c39('0x16')](function(_0xc348eb){logger[_0x3c39('0x13')]('GetTrunk',_0xc348eb[_0x3c39('0x15')],_0x3d4bd0);_0x4fbd8c(_0xae8961[_0x3c39('0x13')](0x1f4,_0xc348eb[_0x3c39('0x15')]));});});};exports[_0x3c39('0x20')]=function(_0x4789c8){var _0x4cc1a8=this;return new Promise(function(_0x469228,_0x3cad10){return db[_0x3c39('0x18')][_0x3c39('0x21')]({'raw':_0x4789c8[_0x3c39('0x19')]?_0x4789c8['options'][_0x3c39('0x22')]===undefined?!![]:![]:!![],'where':_0x4789c8[_0x3c39('0x19')]?_0x4789c8[_0x3c39('0x19')][_0x3c39('0x1a')]||null:null,'attributes':_0x4789c8[_0x3c39('0x19')]?_0x4789c8[_0x3c39('0x19')][_0x3c39('0x1b')]||null:null,'include':_0x4789c8['options']?_0x4789c8[_0x3c39('0x19')][_0x3c39('0x1c')]?_[_0x3c39('0x1d')](_0x4789c8['options']['include'],function(_0x149b94){return{'model':db[_0x149b94['model']],'as':_0x149b94['as'],'attributes':_0x149b94[_0x3c39('0x1b')],'include':_0x149b94[_0x3c39('0x1c')]?_[_0x3c39('0x1d')](_0x149b94['include'],function(_0x3c6821){return{'model':db[_0x3c6821[_0x3c39('0x1e')]],'as':_0x3c6821['as'],'attributes':_0x3c6821[_0x3c39('0x1b')],'include':_0x3c6821[_0x3c39('0x1c')]?_[_0x3c39('0x1d')](_0x3c6821[_0x3c39('0x1c')],function(_0x46402a){return{'model':db[_0x46402a[_0x3c39('0x1e')]],'as':_0x46402a['as'],'attributes':_0x46402a[_0x3c39('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x3c39('0xd')](function(_0x2e3eee){logger[_0x3c39('0xe')](_0x3c39('0x20'),_0x4789c8);logger[_0x3c39('0x1f')](_0x3c39('0x20'),_0x4789c8,JSON[_0x3c39('0x12')](_0x2e3eee));_0x469228(_0x2e3eee);})['catch'](function(_0x316b0f){logger[_0x3c39('0x13')](_0x3c39('0x20'),_0x316b0f[_0x3c39('0x15')],_0x4789c8);_0x3cad10(_0x4cc1a8[_0x3c39('0x13')](0x1f4,_0x316b0f[_0x3c39('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user-setting/index.js b/server/api/user-setting/index.js index 3e0cba0..e0dbeb9 100644 --- a/server/api/user-setting/index.js +++ b/server/api/user-setting/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x21d0=['update','exports','../../components/auth/service','./user-setting.controller','put','/:id','isAuthenticated'];(function(_0x3f4def,_0x21d1aa){var _0x5a2c09=function(_0xefd26b){while(--_0xefd26b){_0x3f4def['push'](_0x3f4def['shift']());}};_0x5a2c09(++_0x21d1aa);}(_0x21d0,0x16e));var _0x021d=function(_0x56d54c,_0x24037a){_0x56d54c=_0x56d54c-0x0;var _0x35fd91=_0x21d0[_0x56d54c];return _0x35fd91;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x021d('0x0'));var controller=require(_0x021d('0x1'));router[_0x021d('0x2')](_0x021d('0x3'),auth[_0x021d('0x4')](),controller[_0x021d('0x5')]);module[_0x021d('0x6')]=router; \ No newline at end of file +var _0x64e4=['./user-setting.controller','put','/:id','isAuthenticated','update','exports','express','Router'];(function(_0x2dfe33,_0x40a45e){var _0x22e088=function(_0x662e3e){while(--_0x662e3e){_0x2dfe33['push'](_0x2dfe33['shift']());}};_0x22e088(++_0x40a45e);}(_0x64e4,0x186));var _0x464e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x64e4[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x464e('0x0'));var router=express[_0x464e('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x464e('0x2'));router[_0x464e('0x3')](_0x464e('0x4'),auth[_0x464e('0x5')](),controller[_0x464e('0x6')]);module[_0x464e('0x7')]=router; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.attributes.js b/server/api/user-setting/user-setting.attributes.js index d9bf19f..58e313e 100644 --- a/server/api/user-setting/user-setting.attributes.js +++ b/server/api/user-setting/user-setting.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb702=['error','info','debug','exports','ENUM','DATE','INTEGER','UserId'];(function(_0x502eb9,_0x279312){var _0x49f697=function(_0x287dc2){while(--_0x287dc2){_0x502eb9['push'](_0x502eb9['shift']());}};_0x49f697(++_0x279312);}(_0xb702,0x130));var _0x2b70=function(_0x5e8c32,_0x1b1f3f){_0x5e8c32=_0x5e8c32-0x0;var _0x595f7b=_0xb702[_0x5e8c32];return _0x595f7b;};'use strict';var Sequelize=require('sequelize');const CLIENT_SIDE_LOG_LEVELS=[_0x2b70('0x0'),'warning',_0x2b70('0x1'),_0x2b70('0x2')];module[_0x2b70('0x3')]={'clientSideLoggingLevel':{'type':Sequelize[_0x2b70('0x4')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0x2b70('0x0'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0x2b70('0x5')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize[_0x2b70('0x6')],'unique':_0x2b70('0x7')}}; \ No newline at end of file +var _0x6d0f=['ENUM','BOOLEAN','DATE','UserId','sequelize','error','warning','info','debug','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x6d0f,0x18a));var _0xf6d0=function(_0x10e3af,_0x39bd50){_0x10e3af=_0x10e3af-0x0;var _0xe7b59a=_0x6d0f[_0x10e3af];return _0xe7b59a;};'use strict';var Sequelize=require(_0xf6d0('0x0'));const CLIENT_SIDE_LOG_LEVELS=[_0xf6d0('0x1'),_0xf6d0('0x2'),_0xf6d0('0x3'),_0xf6d0('0x4')];module[_0xf6d0('0x5')]={'clientSideLoggingLevel':{'type':Sequelize[_0xf6d0('0x6')](CLIENT_SIDE_LOG_LEVELS),'allowNull':![],'defaultValue':_0xf6d0('0x1'),'validate':{'isIn':[CLIENT_SIDE_LOG_LEVELS]}},'clientSideLoggingEnabled':{'type':Sequelize[_0xf6d0('0x7')],'defaultValue':![]},'clientSideLoggingScopes':{'type':Sequelize['TEXT'],'allowNull':!![]},'clientSideLoggingEnabledSince':{'type':Sequelize[_0xf6d0('0x8')],'allowNull':!![],'defaultValue':null},'UserId':{'type':Sequelize['INTEGER'],'unique':_0xf6d0('0x9')}}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.controller.js b/server/api/user-setting/user-setting.controller.js index da09c70..a1e5f28 100644 --- a/server/api/user-setting/user-setting.controller.js +++ b/server/api/user-setting/user-setting.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd2ea=['catch','lodash','ioredis','../../config/logger','api','../../config/environment','socket.io-emitter','redis','./user-setting.socket','register','defaults','json','update','sendStatus','error','stack','name','send','Unauthorized','params','Invalid\x20user\x20setting\x20id','UserSetting','find','then','body'];(function(_0x488602,_0x3a62aa){var _0x4e53db=function(_0x4db67d){while(--_0x4db67d){_0x488602['push'](_0x488602['shift']());}};_0x4e53db(++_0x3a62aa);}(_0xd2ea,0x15f));var _0xad2e=function(_0x155c6d,_0xcb4e2d){_0x155c6d=_0x155c6d-0x0;var _0x3080c8=_0xd2ea[_0x155c6d];return _0x3080c8;};'use strict';var _=require(_0xad2e('0x0'));var Redis=require(_0xad2e('0x1'));var logger=require(_0xad2e('0x2'))(_0xad2e('0x3'));var config=require(_0xad2e('0x4'));var db=require('../../mysqldb')['db'];var socket=require(_0xad2e('0x5'))(new Redis(config[_0xad2e('0x6')]));require(_0xad2e('0x7'))[_0xad2e('0x8')](socket);config[_0xad2e('0x6')]=_[_0xad2e('0x9')](config[_0xad2e('0x6')],{'host':'localhost','port':0x18eb});function respondWithResult(_0x3b5170,_0x3e3d1f){_0x3e3d1f=_0x3e3d1f||0xc8;return function(_0x2ff7b2){if(_0x2ff7b2){return _0x3b5170['status'](_0x3e3d1f)[_0xad2e('0xa')](_0x2ff7b2);}};}function saveUpdates(_0x19bb0d){return function(_0x4b45f2){if(_0x4b45f2){return _0x4b45f2[_0xad2e('0xb')](_0x19bb0d)['then'](function(_0x430443){return _0x430443;});}return null;};}function handleEntityNotFound(_0x415a41){return function(_0x9879f2){if(!_0x9879f2){_0x415a41[_0xad2e('0xc')](0x194);}return _0x9879f2;};}function handleError(_0x489f25,_0x7df3c6){_0x7df3c6=_0x7df3c6||0x1f4;return function(_0x5707a5){logger[_0xad2e('0xd')](_0x5707a5[_0xad2e('0xe')]);if(_0x5707a5[_0xad2e('0xf')]){delete _0x5707a5[_0xad2e('0xf')];}_0x489f25['status'](_0x7df3c6)[_0xad2e('0x10')](_0x5707a5);};}exports['update']=function(_0x1a91ce,_0x5772f0){if(_0x1a91ce['user']['role']!=='admin')throw new Error(_0xad2e('0x11'));if(isNaN(Number(_0x1a91ce[_0xad2e('0x12')]['id'])))throw new Error(_0xad2e('0x13'));return db[_0xad2e('0x14')][_0xad2e('0x15')]({'where':{'id':_0x1a91ce[_0xad2e('0x12')]['id']}})[_0xad2e('0x16')](handleEntityNotFound(_0x5772f0,null))[_0xad2e('0x16')](saveUpdates(_0x1a91ce[_0xad2e('0x17')],null))[_0xad2e('0x16')](respondWithResult(_0x5772f0,null))[_0xad2e('0x18')](handleError(_0x5772f0,null));}; \ No newline at end of file +var _0xf842=['socket.io-emitter','redis','./user-setting.socket','register','defaults','localhost','status','json','update','then','sendStatus','error','stack','name','send','user','params','Invalid\x20user\x20setting\x20id','UserSetting','catch','lodash','ioredis','../../config/logger','api','../../mysqldb'];(function(_0xb0de07,_0x3ca2a0){var _0x4633d8=function(_0x2368e0){while(--_0x2368e0){_0xb0de07['push'](_0xb0de07['shift']());}};_0x4633d8(++_0x3ca2a0);}(_0xf842,0x172));var _0x2f84=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0xf842[_0xf2628e];return _0x13863a;};'use strict';var _=require(_0x2f84('0x0'));var Redis=require(_0x2f84('0x1'));var logger=require(_0x2f84('0x2'))(_0x2f84('0x3'));var config=require('../../config/environment');var db=require(_0x2f84('0x4'))['db'];var socket=require(_0x2f84('0x5'))(new Redis(config[_0x2f84('0x6')]));require(_0x2f84('0x7'))[_0x2f84('0x8')](socket);config['redis']=_[_0x2f84('0x9')](config[_0x2f84('0x6')],{'host':_0x2f84('0xa'),'port':0x18eb});function respondWithResult(_0x55bc67,_0x29019a){_0x29019a=_0x29019a||0xc8;return function(_0x29a2db){if(_0x29a2db){return _0x55bc67[_0x2f84('0xb')](_0x29019a)[_0x2f84('0xc')](_0x29a2db);}};}function saveUpdates(_0x186888){return function(_0x146693){if(_0x146693){return _0x146693[_0x2f84('0xd')](_0x186888)[_0x2f84('0xe')](function(_0x2d789f){return _0x2d789f;});}return null;};}function handleEntityNotFound(_0x171cca){return function(_0x4edf3b){if(!_0x4edf3b){_0x171cca[_0x2f84('0xf')](0x194);}return _0x4edf3b;};}function handleError(_0x555dd2,_0x1f8cb1){_0x1f8cb1=_0x1f8cb1||0x1f4;return function(_0x14b1e2){logger[_0x2f84('0x10')](_0x14b1e2[_0x2f84('0x11')]);if(_0x14b1e2[_0x2f84('0x12')]){delete _0x14b1e2[_0x2f84('0x12')];}_0x555dd2[_0x2f84('0xb')](_0x1f8cb1)[_0x2f84('0x13')](_0x14b1e2);};}exports[_0x2f84('0xd')]=function(_0x20e0d0,_0x1143fa){if(_0x20e0d0[_0x2f84('0x14')]['role']!=='admin')throw new Error('Unauthorized');if(isNaN(Number(_0x20e0d0[_0x2f84('0x15')]['id'])))throw new Error(_0x2f84('0x16'));return db[_0x2f84('0x17')]['find']({'where':{'id':_0x20e0d0[_0x2f84('0x15')]['id']}})[_0x2f84('0xe')](handleEntityNotFound(_0x1143fa,null))[_0x2f84('0xe')](saveUpdates(_0x20e0d0['body'],null))[_0x2f84('0xe')](respondWithResult(_0x1143fa,null))[_0x2f84('0x18')](handleError(_0x1143fa,null));}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.events.js b/server/api/user-setting/user-setting.events.js index 0560d86..07da6c0 100644 --- a/server/api/user-setting/user-setting.events.js +++ b/server/api/user-setting/user-setting.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ce5=['remove','emit','hook','exports','../../mysqldb','UserSetting','setMaxListeners','save','update'];(function(_0x585fae,_0x21653d){var _0x5516dc=function(_0x1aba97){while(--_0x1aba97){_0x585fae['push'](_0x585fae['shift']());}};_0x5516dc(++_0x21653d);}(_0x2ce5,0xa6));var _0x52ce=function(_0x3f3b4b,_0x42e5aa){_0x3f3b4b=_0x3f3b4b-0x0;var _0x26f149=_0x2ce5[_0x3f3b4b];return _0x26f149;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0x52ce('0x0'))['db'][_0x52ce('0x1')];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0x52ce('0x2')](0x0);var events={'afterCreate':_0x52ce('0x3'),'afterUpdate':_0x52ce('0x4'),'afterDestroy':_0x52ce('0x5')};function emitEvent(_0x533231){return function(_0x2b6723,_0x1f81c7,_0x2c38fe){UserSettingEvents[_0x52ce('0x6')](_0x533231+':'+_0x2b6723['id'],_0x2b6723);UserSettingEvents['emit'](_0x533231,_0x2b6723);_0x2c38fe(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserSetting[_0x52ce('0x7')](e,emitEvent(event));}}module[_0x52ce('0x8')]=UserSettingEvents; \ No newline at end of file +var _0xb34c=['../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x40bffc,_0x3a45d7){var _0x3007e9=function(_0x4c8fda){while(--_0x4c8fda){_0x40bffc['push'](_0x40bffc['shift']());}};_0x3007e9(++_0x3a45d7);}(_0xb34c,0x1ea));var _0xcb34=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xb34c[_0x3947c9];return _0x2e7871;};'use strict';var EventEmitter=require('events');var UserSetting=require(_0xcb34('0x0'))['db']['UserSetting'];var UserSettingEvents=new EventEmitter();UserSettingEvents[_0xcb34('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xcb34('0x2'),'afterDestroy':'remove'};function emitEvent(_0x22d788){return function(_0x3c1fe2,_0x190741,_0x4442b5){UserSettingEvents[_0xcb34('0x3')](_0x22d788+':'+_0x3c1fe2['id'],_0x3c1fe2);UserSettingEvents[_0xcb34('0x3')](_0x22d788,_0x3c1fe2);_0x4442b5(null);};}for(var e in events){if(events[_0xcb34('0x4')](e)){var event=events[e];UserSetting[_0xcb34('0x5')](e,emitEvent(event));}}module[_0xcb34('0x6')]=UserSettingEvents; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.model.js b/server/api/user-setting/user-setting.model.js index a7e147c..6db486a 100644 --- a/server/api/user-setting/user-setting.model.js +++ b/server/api/user-setting/user-setting.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9354=['exports','UserSetting','user_settings','clientSideLoggingEnabled','clientSideLoggingEnabledSince'];(function(_0x1f5ee7,_0x1e4b82){var _0x25d695=function(_0x2756a2){while(--_0x2756a2){_0x1f5ee7['push'](_0x1f5ee7['shift']());}};_0x25d695(++_0x1e4b82);}(_0x9354,0x96));var _0x4935=function(_0x4ee9cd,_0xd375b0){_0x4ee9cd=_0x4ee9cd-0x0;var _0x328a5b=_0x9354[_0x4ee9cd];return _0x328a5b;};'use strict';var attributes=require('./user-setting.attributes');module[_0x4935('0x0')]=function(_0xc3c1f3){return _0xc3c1f3['define'](_0x4935('0x1'),attributes,{'tableName':_0x4935('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x29d1eb){if(!_0x29d1eb[_0x4935('0x3')])_0x29d1eb['clientSideLoggingEnabledSince']=null;else if(_0x29d1eb[_0x4935('0x4')]===null)_0x29d1eb[_0x4935('0x4')]=new Date();}}});}; \ No newline at end of file +var _0x0abf=['clientSideLoggingEnabledSince','./user-setting.attributes','define'];(function(_0x44e344,_0x3ae6e4){var _0x32b41f=function(_0x3a38e4){while(--_0x3a38e4){_0x44e344['push'](_0x44e344['shift']());}};_0x32b41f(++_0x3ae6e4);}(_0x0abf,0xe8));var _0xf0ab=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x0abf[_0x5b644e];return _0x49c6bf;};'use strict';var attributes=require(_0xf0ab('0x0'));module['exports']=function(_0x4698fb){return _0x4698fb[_0xf0ab('0x1')]('UserSetting',attributes,{'tableName':'user_settings','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x313b14){if(!_0x313b14['clientSideLoggingEnabled'])_0x313b14[_0xf0ab('0x2')]=null;else if(_0x313b14[_0xf0ab('0x2')]===null)_0x313b14[_0xf0ab('0x2')]=new Date();}}});}; \ No newline at end of file diff --git a/server/api/user-setting/user-setting.socket.js b/server/api/user-setting/user-setting.socket.js index d526443..ec46afc 100644 --- a/server/api/user-setting/user-setting.socket.js +++ b/server/api/user-setting/user-setting.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd547=['save','remove','update','emit','user-setting:update','user-setting:update:user-','UserId','register','length','user-setting:','./user-setting.events'];(function(_0x1ba955,_0x3bbd8a){var _0x345c04=function(_0x5be11f){while(--_0x5be11f){_0x1ba955['push'](_0x1ba955['shift']());}};_0x345c04(++_0x3bbd8a);}(_0xd547,0x1a1));var _0x7d54=function(_0x799123,_0x4e7fbc){_0x799123=_0x799123-0x0;var _0x46d7bc=_0xd547[_0x799123];return _0x46d7bc;};'use strict';var UserSettingEvents=require(_0x7d54('0x0'));var events=[_0x7d54('0x1'),_0x7d54('0x2'),_0x7d54('0x3')];function createListener(_0x3f2a6f,_0x3068bd){return function(_0x5a1b05){_0x3068bd[_0x7d54('0x4')](_0x3f2a6f,_0x5a1b05);if(_0x3f2a6f===_0x7d54('0x5')){_0x3068bd['emit'](_0x7d54('0x6')+_0x5a1b05[_0x7d54('0x7')],_0x5a1b05);}};}exports[_0x7d54('0x8')]=function(_0x32d549){for(var _0x4985eb=0x0,_0x1d6982=events[_0x7d54('0x9')];_0x4985eb<_0x1d6982;_0x4985eb++){var _0x45aae0=events[_0x4985eb];var _0x228e3b=createListener(_0x7d54('0xa')+_0x45aae0,_0x32d549);UserSettingEvents['on'](_0x45aae0,_0x228e3b);}}; \ No newline at end of file +var _0xea69=['update','emit','user-setting:update','user-setting:update:user-','UserId','register','user-setting:','./user-setting.events','remove'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0xea69,0x97));var _0x9ea6=function(_0x4b5d3b,_0x4a2701){_0x4b5d3b=_0x4b5d3b-0x0;var _0x2e037f=_0xea69[_0x4b5d3b];return _0x2e037f;};'use strict';var UserSettingEvents=require(_0x9ea6('0x0'));var events=['save',_0x9ea6('0x1'),_0x9ea6('0x2')];function createListener(_0x6341ce,_0x6a0527){return function(_0x35ab6c){_0x6a0527[_0x9ea6('0x3')](_0x6341ce,_0x35ab6c);if(_0x6341ce===_0x9ea6('0x4')){_0x6a0527['emit'](_0x9ea6('0x5')+_0x35ab6c[_0x9ea6('0x6')],_0x35ab6c);}};}exports[_0x9ea6('0x7')]=function(_0x10cae9){for(var _0xf7e9b=0x0,_0x1b158e=events['length'];_0xf7e9b<_0x1b158e;_0xf7e9b++){var _0x41aa9f=events[_0xf7e9b];var _0xebaa4a=createListener(_0x9ea6('0x8')+_0x41aa9f,_0x10cae9);UserSettingEvents['on'](_0x41aa9f,_0xebaa4a);}}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 7bf0a44..849b308 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 _0xdc25=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/presence','/:id','show','/:id/open_tabs','getOpenTabs','/:id/contacts','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/fax/interactions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','/:id/scheduled_calls','addContacts','post','addQueues','server/files/images/','format','now','originalname','/:id/avatar','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addMailInteractions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addOpenchannelAccounts','createApiKey','put','update','/:id/password','changePassword','delete','removeTeams','destroy','removeChatInteractions','/:id/mail_interactions','removeFaxInteractions','/:id/sms_interactions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','/:id/api_key','removeApiKey','multer','util','path','connect-timeout'];(function(_0x42fb74,_0xd10771){var _0x88ec64=function(_0x458dc6){while(--_0x458dc6){_0x42fb74['push'](_0x42fb74['shift']());}};_0x88ec64(++_0xd10771);}(_0xdc25,0x128));var _0x5dc2=function(_0xf53f90,_0x1f94cb){_0xf53f90=_0xf53f90-0x0;var _0x2a3e6b=_0xdc25[_0xf53f90];return _0x2a3e6b;};'use strict';var multer=require(_0x5dc2('0x0'));var util=require(_0x5dc2('0x1'));var path=require(_0x5dc2('0x2'));var timeout=require(_0x5dc2('0x3'));var express=require('express');var router=express[_0x5dc2('0x4')]();var fs_extra=require(_0x5dc2('0x5'));var auth=require(_0x5dc2('0x6'));var interaction=require(_0x5dc2('0x7'));var config=require(_0x5dc2('0x8'));var controller=require(_0x5dc2('0x9'));router[_0x5dc2('0xa')]('/',auth[_0x5dc2('0xb')](),controller[_0x5dc2('0xc')]);router[_0x5dc2('0xa')](_0x5dc2('0xd'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0xe')]);router[_0x5dc2('0xa')]('/whoami',auth[_0x5dc2('0xb')](),controller['whoami']);router[_0x5dc2('0xa')](_0x5dc2('0xf'),auth[_0x5dc2('0xb')](),controller['getPresence']);router[_0x5dc2('0xa')](_0x5dc2('0x10'),auth['isAuthenticated'](),controller[_0x5dc2('0x11')]);router[_0x5dc2('0xa')]('/:id/avatar',controller['getAvatar']);router['get'](_0x5dc2('0x12'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x13')]);router[_0x5dc2('0xa')](_0x5dc2('0x14'),auth[_0x5dc2('0xb')](),controller['getContacts']);router[_0x5dc2('0xa')]('/:id/queues',auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x15')]);router[_0x5dc2('0xa')](_0x5dc2('0x16'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x17')]);router[_0x5dc2('0xa')](_0x5dc2('0x18'),auth['isAuthenticated'](),controller[_0x5dc2('0x19')]);router[_0x5dc2('0xa')](_0x5dc2('0x1a'),auth['isAuthenticated'](),controller[_0x5dc2('0x1b')]);router[_0x5dc2('0xa')](_0x5dc2('0x1c'),auth['isAuthenticated'](),controller[_0x5dc2('0x1d')]);router[_0x5dc2('0xa')](_0x5dc2('0x1e'),auth[_0x5dc2('0xb')](),controller['getChatInteractions']);router[_0x5dc2('0xa')](_0x5dc2('0x1f'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x20')]);router[_0x5dc2('0xa')]('/:id/mail/interactions',auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x21')]);router[_0x5dc2('0xa')]('/:id/sms/interactions',auth[_0x5dc2('0xb')](),controller['getSmsInteractions']);router[_0x5dc2('0xa')](_0x5dc2('0x22'),auth['isAuthenticated'](),controller['getFaxInteractions']);router['get'](_0x5dc2('0x23'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x24')]);router['get'](_0x5dc2('0x25'),auth[_0x5dc2('0xb')](),controller['getTeams']);router[_0x5dc2('0xa')](_0x5dc2('0x26'),auth['isAuthenticated'](),controller[_0x5dc2('0x27')]);router[_0x5dc2('0xa')](_0x5dc2('0x28'),auth['isAuthenticated'](),controller[_0x5dc2('0x29')]);router[_0x5dc2('0xa')](_0x5dc2('0x2a'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x2b')]);router[_0x5dc2('0xa')](_0x5dc2('0x2c'),auth[_0x5dc2('0xb')](),controller['getFaxAccounts']);router[_0x5dc2('0xa')](_0x5dc2('0x2d'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x2e')]);router[_0x5dc2('0xa')](_0x5dc2('0x2f'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x30')]);router[_0x5dc2('0xa')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0x5dc2('0x31')]);router['get'](_0x5dc2('0x32'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x33')]);router['get'](_0x5dc2('0x34'),auth[_0x5dc2('0xb')](),controller['getWhatsappAccounts']);router['get'](_0x5dc2('0x35'),auth['isAuthenticated'](),controller['getScheduledCalls']);router['get']('/:id/api_key',auth[_0x5dc2('0xb')](),controller['getApiKey']);router['post'](_0x5dc2('0x14'),auth['isAuthenticated'](),controller[_0x5dc2('0x36')]);router[_0x5dc2('0x37')]('/',auth[_0x5dc2('0xb')](),controller['create']);router['post']('/create_many',auth[_0x5dc2('0xb')](),controller['bulkCreate']);router[_0x5dc2('0x37')]('/:id/queues',auth['isAuthenticated'](),controller[_0x5dc2('0x38')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1f1f8e,_0x1b551c,_0x5993cc){_0x5993cc(null,path['join'](config['root'],_0x5dc2('0x39')));},'filename':function(_0x4027de,_0x3eb518,_0x491f96){_0x491f96(null,util[_0x5dc2('0x3a')]('%s-%s',Date[_0x5dc2('0x3b')](),_0x3eb518[_0x5dc2('0x3c')]));}})});router[_0x5dc2('0x37')](_0x5dc2('0x3d'),upload['single'](_0x5dc2('0x3e')),controller[_0x5dc2('0x3f')]);router['post'](_0x5dc2('0x40'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x41')]);router['post'](_0x5dc2('0x42'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x43')]);router['post'](_0x5dc2('0x44'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x45')]);router[_0x5dc2('0x37')](_0x5dc2('0x46'),auth[_0x5dc2('0xb')](),controller['unpause']);router[_0x5dc2('0x37')]('/:id/teams',auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x47')]);router[_0x5dc2('0x37')](_0x5dc2('0x48'),auth[_0x5dc2('0xb')](),controller['addChatInteractions']);router[_0x5dc2('0x37')]('/:id/mail_interactions',auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x49')]);router['post']('/:id/fax_interactions',auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x4a')]);router[_0x5dc2('0x37')]('/:id/sms_interactions',auth['isAuthenticated'](),controller[_0x5dc2('0x4b')]);router[_0x5dc2('0x37')](_0x5dc2('0x4c'),auth[_0x5dc2('0xb')](),controller['addOpenchannelInteractions']);router[_0x5dc2('0x37')](_0x5dc2('0x4d'),auth['isAuthenticated'](),controller[_0x5dc2('0x4e')]);router['post'](_0x5dc2('0x2c'),auth['isAuthenticated'](),controller['addFaxAccounts']);router['post']('/:id/mail_accounts',auth['isAuthenticated'](),controller['addMailAccounts']);router[_0x5dc2('0x37')](_0x5dc2('0x2f'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x4f')]);router[_0x5dc2('0x37')]('/:id/sms_accounts',auth[_0x5dc2('0xb')](),controller['addSmsAccounts']);router[_0x5dc2('0x37')](_0x5dc2('0x32'),auth[_0x5dc2('0xb')](),controller['addChatWebsites']);router[_0x5dc2('0x37')](_0x5dc2('0x34'),auth[_0x5dc2('0xb')](),controller['addWhatsappAccounts']);router[_0x5dc2('0x37')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x5dc2('0x50')]);router[_0x5dc2('0x51')](_0x5dc2('0x10'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x52')]);router[_0x5dc2('0x51')](_0x5dc2('0x53'),auth['isAuthenticated'](),controller[_0x5dc2('0x54')]);router[_0x5dc2('0x55')]('/:id/queues',auth[_0x5dc2('0xb')](),controller['removeQueues']);router[_0x5dc2('0x55')](_0x5dc2('0x25'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x56')]);router['delete'](_0x5dc2('0x10'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x57')]);router[_0x5dc2('0x55')](_0x5dc2('0x48'),auth['isAuthenticated'](),controller[_0x5dc2('0x58')]);router[_0x5dc2('0x55')](_0x5dc2('0x59'),auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0x5dc2('0x55')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x5dc2('0x5a')]);router[_0x5dc2('0x55')](_0x5dc2('0x5b'),auth[_0x5dc2('0xb')](),controller['removeSmsInteractions']);router[_0x5dc2('0x55')](_0x5dc2('0x4c'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x5c')]);router['delete'](_0x5dc2('0x4d'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x5d')]);router[_0x5dc2('0x55')](_0x5dc2('0x2c'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x5e')]);router[_0x5dc2('0x55')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x5dc2('0x5f')]);router[_0x5dc2('0x55')](_0x5dc2('0x2f'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x60')]);router['delete']('/:id/sms_accounts',auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x61')]);router['delete'](_0x5dc2('0x32'),auth[_0x5dc2('0xb')](),controller['removeChatWebsites']);router[_0x5dc2('0x55')](_0x5dc2('0x34'),auth['isAuthenticated'](),controller['removeWhatsappAccounts']);router['delete'](_0x5dc2('0x62'),auth[_0x5dc2('0xb')](),controller[_0x5dc2('0x63')]);module['exports']=router; \ No newline at end of file +var _0x7d13=['removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeApiKey','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/whoami','whoami','getPresence','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','getContacts','getQueues','getVoiceQueuesRt','getGroups','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','/:id/mail/interactions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/agents','getVoicePrefixes','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','addContacts','/create_many','/:id/queues','diskStorage','join','root','%s-%s','now','single','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','/:id/openchannel_accounts','addOpenchannelAccounts','addSmsAccounts','/:id/whatsapp_accounts','addWhatsappAccounts','createApiKey','put','update','/:id/password','delete','removeTeams','/:id','removeChatInteractions','removeFaxInteractions','/:id/sms_interactions','removeOpenchannelInteractions','/:id/whatsapp_interactions','removeWhatsappInteractions','/:id/fax_accounts','removeFaxAccounts','removeOpenchannelAccounts'];(function(_0x48f270,_0x2ba6e9){var _0x4bdf06=function(_0x4279fe){while(--_0x4279fe){_0x48f270['push'](_0x48f270['shift']());}};_0x4bdf06(++_0x2ba6e9);}(_0x7d13,0x6c));var _0x37d1=function(_0x1d9934,_0x15c292){_0x1d9934=_0x1d9934-0x0;var _0x3f8856=_0x7d13[_0x1d9934];return _0x3f8856;};'use strict';var multer=require('multer');var util=require(_0x37d1('0x0'));var path=require('path');var timeout=require(_0x37d1('0x1'));var express=require('express');var router=express[_0x37d1('0x2')]();var fs_extra=require(_0x37d1('0x3'));var auth=require(_0x37d1('0x4'));var interaction=require(_0x37d1('0x5'));var config=require(_0x37d1('0x6'));var controller=require('./user.controller');router[_0x37d1('0x7')]('/',auth[_0x37d1('0x8')](),controller[_0x37d1('0x9')]);router[_0x37d1('0x7')]('/describe',auth[_0x37d1('0x8')](),controller[_0x37d1('0xa')]);router[_0x37d1('0x7')](_0x37d1('0xb'),auth[_0x37d1('0x8')](),controller[_0x37d1('0xc')]);router[_0x37d1('0x7')]('/presence',auth['isAuthenticated'](),controller[_0x37d1('0xd')]);router[_0x37d1('0x7')]('/:id',auth[_0x37d1('0x8')](),controller[_0x37d1('0xe')]);router[_0x37d1('0x7')](_0x37d1('0xf'),controller[_0x37d1('0x10')]);router[_0x37d1('0x7')](_0x37d1('0x11'),auth[_0x37d1('0x8')](),controller['getOpenTabs']);router[_0x37d1('0x7')](_0x37d1('0x12'),auth['isAuthenticated'](),controller[_0x37d1('0x13')]);router[_0x37d1('0x7')]('/:id/queues',auth[_0x37d1('0x8')](),controller[_0x37d1('0x14')]);router['get']('/:id/queues_rt',auth[_0x37d1('0x8')](),controller[_0x37d1('0x15')]);router[_0x37d1('0x7')]('/:id/groups',auth[_0x37d1('0x8')](),controller[_0x37d1('0x16')]);router[_0x37d1('0x7')]('/:id/recordings',auth[_0x37d1('0x8')](),controller[_0x37d1('0x17')]);router['get'](_0x37d1('0x18'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x19')]);router[_0x37d1('0x7')](_0x37d1('0x1a'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x1b')]);router[_0x37d1('0x7')]('/:id/openchannel/interactions',auth[_0x37d1('0x8')](),controller[_0x37d1('0x1c')]);router[_0x37d1('0x7')](_0x37d1('0x1d'),auth['isAuthenticated'](),controller['getMailInteractions']);router[_0x37d1('0x7')](_0x37d1('0x1e'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x1f')]);router[_0x37d1('0x7')](_0x37d1('0x20'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x21')]);router[_0x37d1('0x7')](_0x37d1('0x22'),auth[_0x37d1('0x8')](),controller['getWhatsappInteractions']);router[_0x37d1('0x7')](_0x37d1('0x23'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x24')]);router[_0x37d1('0x7')]('/:id/lists',auth[_0x37d1('0x8')](),controller['getLists']);router[_0x37d1('0x7')](_0x37d1('0x25'),auth[_0x37d1('0x8')](),controller['getAgents']);router[_0x37d1('0x7')]('/:id/prefixes',auth[_0x37d1('0x8')](),controller[_0x37d1('0x26')]);router[_0x37d1('0x7')]('/:id/fax_accounts',auth[_0x37d1('0x8')](),controller[_0x37d1('0x27')]);router[_0x37d1('0x7')](_0x37d1('0x28'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x29')]);router[_0x37d1('0x7')]('/:id/openchannel_accounts',auth[_0x37d1('0x8')](),controller[_0x37d1('0x2a')]);router[_0x37d1('0x7')](_0x37d1('0x2b'),auth[_0x37d1('0x8')](),controller['getSmsAccounts']);router[_0x37d1('0x7')](_0x37d1('0x2c'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x2d')]);router[_0x37d1('0x7')]('/:id/whatsapp_accounts',auth[_0x37d1('0x8')](),controller[_0x37d1('0x2e')]);router[_0x37d1('0x7')](_0x37d1('0x2f'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x30')]);router[_0x37d1('0x7')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x37d1('0x31')]);router[_0x37d1('0x32')](_0x37d1('0x12'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x33')]);router[_0x37d1('0x32')]('/',auth['isAuthenticated'](),controller['create']);router[_0x37d1('0x32')](_0x37d1('0x34'),auth[_0x37d1('0x8')](),controller['bulkCreate']);router[_0x37d1('0x32')](_0x37d1('0x35'),auth[_0x37d1('0x8')](),controller['addQueues']);var upload=multer({'storage':multer[_0x37d1('0x36')]({'destination':function(_0x22fad4,_0x4c11d5,_0x3fb0b4){_0x3fb0b4(null,path[_0x37d1('0x37')](config[_0x37d1('0x38')],'server/files/images/'));},'filename':function(_0x34f822,_0x46bc3e,_0xd8f52e){_0xd8f52e(null,util['format'](_0x37d1('0x39'),Date[_0x37d1('0x3a')](),_0x46bc3e['originalname']));}})});router[_0x37d1('0x32')]('/:id/avatar',upload[_0x37d1('0x3b')]('file'),controller['addAvatar']);router[_0x37d1('0x32')](_0x37d1('0x3c'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x3d')]);router[_0x37d1('0x32')](_0x37d1('0x3e'),auth['isAuthenticated'](),controller['logout']);router[_0x37d1('0x32')](_0x37d1('0x3f'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x40')]);router['post'](_0x37d1('0x41'),auth[_0x37d1('0x8')](),controller['unpause']);router['post']('/:id/teams',auth[_0x37d1('0x8')](),controller[_0x37d1('0x42')]);router[_0x37d1('0x32')](_0x37d1('0x43'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x44')]);router['post'](_0x37d1('0x45'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x46')]);router[_0x37d1('0x32')](_0x37d1('0x47'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x48')]);router[_0x37d1('0x32')]('/:id/sms_interactions',auth[_0x37d1('0x8')](),controller[_0x37d1('0x49')]);router[_0x37d1('0x32')](_0x37d1('0x4a'),auth['isAuthenticated'](),controller[_0x37d1('0x4b')]);router['post']('/:id/whatsapp_interactions',auth[_0x37d1('0x8')](),controller[_0x37d1('0x4c')]);router['post']('/:id/fax_accounts',auth[_0x37d1('0x8')](),controller[_0x37d1('0x4d')]);router['post'](_0x37d1('0x28'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x4e')]);router[_0x37d1('0x32')](_0x37d1('0x4f'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x50')]);router[_0x37d1('0x32')](_0x37d1('0x2b'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x51')]);router[_0x37d1('0x32')](_0x37d1('0x2c'),auth['isAuthenticated'](),controller['addChatWebsites']);router[_0x37d1('0x32')](_0x37d1('0x52'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x53')]);router[_0x37d1('0x32')]('/:id/api_key',auth['isAuthenticated'](),controller[_0x37d1('0x54')]);router[_0x37d1('0x55')]('/:id',auth[_0x37d1('0x8')](),controller[_0x37d1('0x56')]);router[_0x37d1('0x55')](_0x37d1('0x57'),auth[_0x37d1('0x8')](),controller['changePassword']);router[_0x37d1('0x58')](_0x37d1('0x35'),auth['isAuthenticated'](),controller['removeQueues']);router['delete'](_0x37d1('0x23'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x59')]);router['delete'](_0x37d1('0x5a'),auth[_0x37d1('0x8')](),controller['destroy']);router['delete']('/:id/chat_interactions',auth[_0x37d1('0x8')](),controller[_0x37d1('0x5b')]);router[_0x37d1('0x58')](_0x37d1('0x45'),auth[_0x37d1('0x8')](),controller['removeMailInteractions']);router[_0x37d1('0x58')](_0x37d1('0x47'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x5c')]);router['delete'](_0x37d1('0x5d'),auth[_0x37d1('0x8')](),controller['removeSmsInteractions']);router[_0x37d1('0x58')](_0x37d1('0x4a'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x5e')]);router[_0x37d1('0x58')](_0x37d1('0x5f'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x60')]);router[_0x37d1('0x58')](_0x37d1('0x61'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x62')]);router['delete'](_0x37d1('0x28'),auth['isAuthenticated'](),controller['removeMailAccounts']);router[_0x37d1('0x58')](_0x37d1('0x4f'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x63')]);router['delete'](_0x37d1('0x2b'),auth['isAuthenticated'](),controller[_0x37d1('0x64')]);router[_0x37d1('0x58')](_0x37d1('0x2c'),auth[_0x37d1('0x8')](),controller[_0x37d1('0x65')]);router[_0x37d1('0x58')](_0x37d1('0x52'),auth['isAuthenticated'](),controller[_0x37d1('0x66')]);router[_0x37d1('0x58')]('/:id/api_key',auth[_0x37d1('0x8')](),controller[_0x37d1('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 6b108c1..89acfdd 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 _0x34e8=['isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','avpf','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','permissions','map','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','lodash','STRING','name','setDataValue','defaultuser','fullname','callerid','format','\x22%s\x22\x20<%s>','getDataValue','internal','email','toLowerCase','ENUM','admin','agent','telephone','local','INTEGER','accountcode','BOOLEAN','DEFAULT\x20PAUSE','DATE','dynamic','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','actpass','update,nonat','TEXT','showWebBar','get'];(function(_0x444bb4,_0x327ffb){var _0x14905d=function(_0x11465d){while(--_0x11465d){_0x444bb4['push'](_0x444bb4['shift']());}};_0x14905d(++_0x327ffb);}(_0x34e8,0x12c));var _0x834e=function(_0x4a960a,_0x21ee52){_0x4a960a=_0x4a960a-0x0;var _0xb9972a=_0x34e8[_0x4a960a];return _0xb9972a;};'use strict';var Sequelize=require(_0x834e('0x0'));var moment=require(_0x834e('0x1'));var util=require(_0x834e('0x2'));var _=require(_0x834e('0x3'));module['exports']={'name':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x472111){this[_0x834e('0x6')](_0x834e('0x5'),_0x472111);this[_0x834e('0x6')](_0x834e('0x7'),_0x472111);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'set':function(_0x52056d){this[_0x834e('0x6')](_0x834e('0x8'),_0x52056d);this[_0x834e('0x6')](_0x834e('0x9'),util[_0x834e('0xa')](_0x834e('0xb'),_0x52056d,this[_0x834e('0xc')](_0x834e('0xd'))));}},'alias':{'type':Sequelize[_0x834e('0x4')]},'email':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'unique':_0x834e('0xe'),'validate':{'isEmail':!![]},'set':function(_0x36e124){if(_0x36e124){this[_0x834e('0x6')](_0x834e('0xe'),_0x36e124[_0x834e('0xf')]());}}},'role':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x11'),'user',_0x834e('0x12'),_0x834e('0x13')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x834e('0x4')],'defaultValue':_0x834e('0x14')},'internal':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':![],'unique':_0x834e('0xd'),'set':function(_0x50e860){this[_0x834e('0x6')](_0x834e('0xd'),_0x50e860);this['setDataValue'](_0x834e('0x16'),_0x50e860);this['setDataValue'](_0x834e('0x9'),util[_0x834e('0xa')]('\x22%s\x22\x20<%s>',this[_0x834e('0xc')](_0x834e('0x8')),_0x50e860));}},'salt':{'type':Sequelize[_0x834e('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x834e('0x4')]},'address':{'type':Sequelize[_0x834e('0x4')]},'zipcode':{'type':Sequelize[_0x834e('0x4')]},'userpic':{'type':Sequelize[_0x834e('0x4')]},'city':{'type':Sequelize[_0x834e('0x4')]},'country':{'type':Sequelize[_0x834e('0x4')]},'online':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0x834e('0x18')},'lastPauseAt':{'type':Sequelize[_0x834e('0x19')]},'chatCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x834e('0x15')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x1a')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x834e('0x15')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user','peer'),'allowNull':!![],'defaultValue':_0x834e('0x1b')},'context':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x1c')},'callingpres':{'type':Sequelize['ENUM'](_0x834e('0x1d'),_0x834e('0x1e'),_0x834e('0x1f'),_0x834e('0x20'),_0x834e('0x21'),_0x834e('0x22'),_0x834e('0x23'),_0x834e('0x24')),'allowNull':!![]},'deny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x25'),'set':function(_0x2b3418){this[_0x834e('0x6')](_0x834e('0x26'),_0x2b3418?_0x2b3418[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x26'))?this[_0x834e('0xc')]('transport')[_0x834e('0x28')](','):null;},'comment':_0x834e('0x29')},'dtmfmode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2a'),'info',_0x834e('0x2b'),_0x834e('0x2c'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x30')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x834e('0x31'),'set':function(_0x6a3ac){this['setDataValue'](_0x834e('0x32'),_0x6a3ac?_0x6a3ac[_0x834e('0x27')](','):null);},'get':function(){return this['getDataValue']('nat')?this[_0x834e('0xc')](_0x834e('0x32'))[_0x834e('0x28')](','):null;},'comment':_0x834e('0x33')},'callgroup':{'type':Sequelize[_0x834e('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x834e('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x834e('0x4')]},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x834e('0x34')},'allow':{'type':Sequelize[_0x834e('0x4')],'allowNull':![],'defaultValue':_0x834e('0x35'),'set':function(_0x3c59af){this[_0x834e('0x6')]('allow',_0x3c59af?_0x3c59af[_0x834e('0x27')](';'):_0x834e('0x35'));},'get':function(){return this[_0x834e('0xc')]('allow')?this[_0x834e('0xc')](_0x834e('0x36'))['split'](';'):null;},'comment':_0x834e('0x37')},'autoframing':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'set':function(_0x4a18bb){this['setDataValue'](_0x834e('0x38'),_0x4a18bb?_0x4a18bb[_0x834e('0x27')](','):null);},'get':function(){return this[_0x834e('0xc')](_0x834e('0x38'))?this[_0x834e('0xc')](_0x834e('0x38'))[_0x834e('0x28')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x834e('0x10')]('yes','no',_0x834e('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![],'defaultValue':_0x834e('0x3a')},'amaflags':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'busylevel':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'template':{'type':Sequelize['STRING'],'allowNull':!![]},'videosupport':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3c'),_0x834e('0x3d'),_0x834e('0x3e')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x3f'),_0x834e('0x40')),'allowNull':!![],'defaultValue':_0x834e('0x40')},'t38pt_usertpsource':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':_0x834e('0x2d')},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x834e('0x10')]('yes','no','fingerprint',_0x834e('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x834e('0x15')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x834e('0x10')]('active',_0x834e('0x42'),_0x834e('0x43')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x834e('0x10')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0x834e('0x2d'),'no',_0x834e('0x2e'),_0x834e('0x2f'),_0x834e('0x44')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x834e('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0x834e('0x19')]},'passwordResetAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x834e('0x45')]},'showWebBar':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0,'set':function(_0x1e4310){this[_0x834e('0x6')](_0x834e('0x46'),_0x1e4310);var _0x1659c8=this[_0x834e('0x47')]({'plain':!![]});switch(_0x1e4310){case 0x0:case 0x1:var _0x17b8e3=_0x1659c8[_0x834e('0x26')]?_[_0x834e('0x48')](_0x1659c8[_0x834e('0x26')])?_0x1659c8[_0x834e('0x26')][_0x834e('0x27')]():_0x1659c8[_0x834e('0x26')]:'udp';if(_0x17b8e3===_0x834e('0x49')){_0x17b8e3=_0x834e('0x25');}this[_0x834e('0x6')](_0x834e('0x26'),_0x17b8e3);this['setDataValue'](_0x834e('0x4a'),'no');this['setDataValue']('avpf',null);this[_0x834e('0x6')](_0x834e('0x4b'),null);this[_0x834e('0x6')](_0x834e('0x4c'),null);this[_0x834e('0x6')](_0x834e('0x4d'),null);this[_0x834e('0x6')](_0x834e('0x4e'),null);this['setDataValue'](_0x834e('0x4f'),null);this['setDataValue'](_0x834e('0x50'),null);this[_0x834e('0x6')]('dtlsprivatekey',null);this['setDataValue'](_0x834e('0x51'),'no');break;case 0x2:this[_0x834e('0x6')](_0x834e('0x26'),_0x834e('0x49'));this[_0x834e('0x6')]('encryption',_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x52'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4b'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4c'),_0x834e('0x2d'));this['setDataValue'](_0x834e('0x4d'),_0x834e('0x2d'));this[_0x834e('0x6')](_0x834e('0x4e'),'no');this['setDataValue'](_0x834e('0x4f'),'actpass');this['setDataValue']('dtlscertfile',_0x1659c8[_0x834e('0x50')]||_0x834e('0x53'));this['setDataValue'](_0x834e('0x54'),_0x1659c8[_0x834e('0x54')]||'/etc/pki/tls/private/motion.key');this[_0x834e('0x6')](_0x834e('0x51'),'yes');break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x346be5){this[_0x834e('0x6')](_0x834e('0x55'),_0x346be5?_0x346be5[_0x834e('0x27')](','):[]);},'get':function(){return this[_0x834e('0xc')]('permissions')?_[_0x834e('0x56')](this['getDataValue'](_0x834e('0x55'))[_0x834e('0x28')](','),function(_0x2c758c){return parseInt(_0x2c758c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize['STRING']},'phoneBarNoReplyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0x834e('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x834e('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x834e('0x10')](_0x834e('0x2d'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x834e('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('phoneBarEnableScreenRecordingByAgent')?this[_0x834e('0xc')](_0x834e('0x57')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x834e('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x18ddac){if(typeof _0x18ddac===_0x834e('0x58')){var _0x5acf5c=_0x18ddac==='1'?!![]:_0x18ddac==='0'?![]:_0x18ddac===_0x834e('0x59')?!![]:_0x18ddac===_0x834e('0x5a')?![]:![];this[_0x834e('0x6')]('screenrecording',_0x5acf5c);}else{this[_0x834e('0x6')](_0x834e('0x5b'),_0x18ddac);}}},'blocked':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![],'set':function(_0x443633){this[_0x834e('0x6')]('blocked',_0x443633);if(_0x443633===!![]){this['setDataValue'](_0x834e('0x5c'),moment());this[_0x834e('0x6')]('loginAttempts',0x0);}else{this[_0x834e('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0x834e('0x19')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x834e('0x15')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x834e('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize[_0x834e('0x17')],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize[_0x834e('0x15')],'defaultValue':0x0}}; \ No newline at end of file +var _0x008c=['all','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','always','refuse','originate','uac','uas','fingerprint','certificate','active','actpass','update,nonat','TEXT','get','isArray','encryption','avpf','force_avp','icesupport','dtlsenable','dtlssetup','dtlsprivatekey','wss','dtlsverify','dtlscertfile','/etc/pki/tls/private/motion.key','rtcp_mux','permissions','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','UNSIGNED','sequelize','moment','util','lodash','exports','name','setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','STRING','fullname','callerid','getDataValue','internal','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','accountcode','\x22%s\x22\x20<%s>','BOOLEAN','DATE','dynamic','friend','from-sip','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'];(function(_0x2bef41,_0x5122e3){var _0x582177=function(_0x533c94){while(--_0x533c94){_0x2bef41['push'](_0x2bef41['shift']());}};_0x582177(++_0x5122e3);}(_0x008c,0x188));var _0xc008=function(_0x5eb868,_0x3edfb0){_0x5eb868=_0x5eb868-0x0;var _0x278458=_0x008c[_0x5eb868];return _0x278458;};'use strict';var Sequelize=require(_0xc008('0x0'));var moment=require(_0xc008('0x1'));var util=require(_0xc008('0x2'));var _=require(_0xc008('0x3'));module[_0xc008('0x4')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc008('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x47063f){this[_0xc008('0x6')](_0xc008('0x5'),_0x47063f);this[_0xc008('0x6')](_0xc008('0x7'),_0x47063f);},'comment':_0xc008('0x8')},'fullname':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'set':function(_0x9c8cb2){this['setDataValue'](_0xc008('0xa'),_0x9c8cb2);this['setDataValue'](_0xc008('0xb'),util['format']('\x22%s\x22\x20<%s>',_0x9c8cb2,this[_0xc008('0xc')](_0xc008('0xd'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x1eacfa){if(_0x1eacfa){this[_0xc008('0x6')]('email',_0x1eacfa[_0xc008('0xe')]());}}},'role':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x10'),_0xc008('0x11'),_0xc008('0x12'),_0xc008('0x13')),'allowNull':![]},'password':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':![],'unique':'internal','set':function(_0x25e13f){this[_0xc008('0x6')](_0xc008('0xd'),_0x25e13f);this[_0xc008('0x6')](_0xc008('0x15'),_0x25e13f);this['setDataValue']('callerid',util['format'](_0xc008('0x16'),this[_0xc008('0xc')](_0xc008('0xa')),_0x25e13f));}},'salt':{'type':Sequelize[_0xc008('0x9')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xc008('0x9')]},'city':{'type':Sequelize[_0xc008('0x9')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0xc008('0x18')]},'chatCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xc008('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'host':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':_0xc008('0x19')},'ipaddr':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'port':{'type':Sequelize[_0xc008('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize['STRING'],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x1a'),_0xc008('0x11'),'peer'),'allowNull':!![],'defaultValue':_0xc008('0x1a')},'context':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':_0xc008('0x1b')},'callingpres':{'type':Sequelize[_0xc008('0xf')]('ALLOWED_NOT_SCREENED',_0xc008('0x1c'),_0xc008('0x1d'),'ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0xc008('0x1e'),_0xc008('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'permit':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'secret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'transport':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':_0xc008('0x20'),'set':function(_0x2b862d){this[_0xc008('0x6')](_0xc008('0x21'),_0x2b862d?_0x2b862d['join'](','):null);},'get':function(){return this[_0xc008('0xc')](_0xc008('0x21'))?this['getDataValue'](_0xc008('0x21'))[_0xc008('0x22')](','):null;},'comment':_0xc008('0x23')},'dtmfmode':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x24'),_0xc008('0x25'),_0xc008('0x26'),_0xc008('0x27'),_0xc008('0x28')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x2a'),_0xc008('0x2b'),_0xc008('0x2c')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'nat':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x399b64){this[_0xc008('0x6')]('nat',_0x399b64?_0x399b64[_0xc008('0x2d')](','):null);},'get':function(){return this[_0xc008('0xc')](_0xc008('0x2e'))?this['getDataValue']('nat')['split'](','):null;},'comment':_0xc008('0x2f')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xc008('0x9')]},'pickupgroup':{'type':Sequelize[_0xc008('0x9')]},'namedpickupgroup':{'type':Sequelize[_0xc008('0x9')]},'language':{'type':Sequelize[_0xc008('0x9')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc008('0x9')]},'disallow':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'defaultValue':_0xc008('0x30')},'allow':{'type':Sequelize[_0xc008('0x9')],'allowNull':![],'defaultValue':_0xc008('0x31'),'set':function(_0x387dfd){this[_0xc008('0x6')](_0xc008('0x32'),_0x387dfd?_0x387dfd[_0xc008('0x2d')](';'):_0xc008('0x31'));},'get':function(){return this['getDataValue'](_0xc008('0x32'))?this[_0xc008('0xc')](_0xc008('0x32'))[_0xc008('0x22')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'set':function(_0x36e7ae){this[_0xc008('0x6')]('insecure',_0x36e7ae?_0x36e7ae[_0xc008('0x2d')](','):null);},'get':function(){return this[_0xc008('0xc')](_0xc008('0x33'))?this[_0xc008('0xc')](_0xc008('0x33'))['split'](','):null;},'comment':_0xc008('0x34')},'trustrpid':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'busylevel':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'template':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM']('accept',_0xc008('0x37'),_0xc008('0x38')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x39'),_0xc008('0x3a')),'allowNull':!![],'defaultValue':_0xc008('0x3a')},'t38pt_usertpsource':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'maxforwards':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'encryption':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no',_0xc008('0x3b'),_0xc008('0x3c')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x3d'),'passive',_0xc008('0x3e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xc008('0x14')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0xc008('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xc008('0xf')](_0xc008('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xc008('0xf')]('yes','no',_0xc008('0x2a'),'update',_0xc008('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xc008('0x9')]},'resetPasswordExpires':{'type':Sequelize[_0xc008('0x18')]},'passwordResetAt':{'type':Sequelize[_0xc008('0x18')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xc008('0x40')]},'showWebBar':{'type':Sequelize['INTEGER'],'defaultValue':0x0,'set':function(_0x375e71){this['setDataValue']('showWebBar',_0x375e71);var _0x37ce5e=this[_0xc008('0x41')]({'plain':!![]});switch(_0x375e71){case 0x0:case 0x1:var _0x56e755=_0x37ce5e[_0xc008('0x21')]?_[_0xc008('0x42')](_0x37ce5e[_0xc008('0x21')])?_0x37ce5e[_0xc008('0x21')][_0xc008('0x2d')]():_0x37ce5e[_0xc008('0x21')]:_0xc008('0x20');if(_0x56e755==='wss'){_0x56e755=_0xc008('0x20');}this[_0xc008('0x6')](_0xc008('0x21'),_0x56e755);this[_0xc008('0x6')](_0xc008('0x43'),'no');this[_0xc008('0x6')](_0xc008('0x44'),null);this[_0xc008('0x6')](_0xc008('0x45'),null);this[_0xc008('0x6')](_0xc008('0x46'),null);this[_0xc008('0x6')](_0xc008('0x47'),null);this[_0xc008('0x6')]('dtlsverify',null);this[_0xc008('0x6')](_0xc008('0x48'),null);this[_0xc008('0x6')]('dtlscertfile',null);this[_0xc008('0x6')](_0xc008('0x49'),null);this['setDataValue']('rtcp_mux','no');break;case 0x2:this[_0xc008('0x6')](_0xc008('0x21'),_0xc008('0x4a'));this[_0xc008('0x6')](_0xc008('0x43'),_0xc008('0x29'));this[_0xc008('0x6')](_0xc008('0x44'),_0xc008('0x29'));this[_0xc008('0x6')](_0xc008('0x45'),'yes');this[_0xc008('0x6')](_0xc008('0x46'),_0xc008('0x29'));this[_0xc008('0x6')]('dtlsenable',_0xc008('0x29'));this['setDataValue'](_0xc008('0x4b'),'no');this[_0xc008('0x6')](_0xc008('0x48'),'actpass');this[_0xc008('0x6')](_0xc008('0x4c'),_0x37ce5e[_0xc008('0x4c')]||'/etc/pki/tls/certs/motion.crt');this[_0xc008('0x6')]('dtlsprivatekey',_0x37ce5e[_0xc008('0x49')]||_0xc008('0x4d'));this[_0xc008('0x6')](_0xc008('0x4e'),_0xc008('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x3c30db){this[_0xc008('0x6')]('permissions',_0x3c30db?_0x3c30db[_0xc008('0x2d')](','):[]);},'get':function(){return this['getDataValue'](_0xc008('0x4f'))?_['map'](this[_0xc008('0xc')]('permissions')[_0xc008('0x22')](','),function(_0x103d75){return parseInt(_0x103d75,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xc008('0x9')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xc008('0x9')]},'phoneBarBusyNumber':{'type':Sequelize['STRING']},'phoneBarUnconditional':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xc008('0x9')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xc008('0xf')]('yes','no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize['STRING']},'phoneBarEnableJaws':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xc008('0x50')],'get':function(){return this[_0xc008('0xc')](_0xc008('0x51'))?this[_0xc008('0xc')](_0xc008('0x51')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xc008('0x9')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xc008('0x9')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![],'set':function(_0x3b2669){if(typeof _0x3b2669===_0xc008('0x52')){var _0x2edb8e=_0x3b2669==='1'?!![]:_0x3b2669==='0'?![]:_0x3b2669===_0xc008('0x53')?!![]:_0x3b2669===_0xc008('0x54')?![]:![];this[_0xc008('0x6')](_0xc008('0x55'),_0x2edb8e);}else{this['setDataValue']('screenrecording',_0x3b2669);}}},'blocked':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![],'set':function(_0x3104cd){this[_0xc008('0x6')]('blocked',_0x3104cd);if(_0x3104cd===!![]){this[_0xc008('0x6')](_0xc008('0x56'),moment());this['setDataValue']('loginAttempts',0x0);}else{this['setDataValue'](_0xc008('0x56'),null);}}},'blockedAt':{'type':Sequelize[_0xc008('0x18')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xc008('0x14')](0x5)[_0xc008('0x57')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xc008('0x17')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'chatAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'chatAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'emailAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'emailAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'smsAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'smsAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'openchannelAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'faxAutoanswer':{'type':Sequelize[_0xc008('0x17')],'defaultValue':![]},'faxAutoanswerDelay':{'type':Sequelize[_0xc008('0x14')],'defaultValue':0x0},'whatsappAutoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappAutoanswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index d3b4956..607fa6f 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 _0xb449=['uniqBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','client','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','unknown','unavailable','ringing','voiceStatus','busy','slice','SELECT','select','InteractionId','field','ui.createdAt','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','util','lodash','squel','jayson/promise','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','APIBadRequestError','../../errors/api','APINotFoundError','handleError','../../mysqldb','socket.io-emitter','redis','defaults','localhost','http','request','then','info','User,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','sendStatus','status','end','offset','undefined','limit','count','json','update','role','agent','emit','userNotification:recalc:','get','user','Agents','Telephones','telephone','filter','ignore','map','value','includes','find','name','destroy','stack','send','index','User','fieldName','type','key','getOptions','where','query','userSetting','true','UserSetting','attributes','push','findAll','rows','openTabs','length','chat','dataValues','sms','fax','mail','openchannel','whatsapp','all','show','params','model','differenceBy','keys','rawAttributes','password','salt','filters','intersection','fields','includeAll','include','options','body','describe','addContacts','ids','internal','findById','validatePasswordPattern','max','min_internal','isNil','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','QueryTypes','from','mailbox','VoiceMail','fullname','email','permissions','101','102','103','113','104','107','108','100','111','114','115','Unauthorized','admin','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator','checkUserLimits','settingsEnabled','userProfileId','UserProfileSection','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','isEmpty','autoAssociation','compact','changePassword','oldPassword','newPassword','Sequelize','authenticate','Wrong\x20credentials','ValidationError','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','addQueues','channel','loginInPause','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','penalty','QueueId','Queue:save','voice','online','interface','format','SIP/%s','voicePause','UserVoiceQueueRt','upsert','remove','Queues','isArray','Queue:remove','addAvatar','filename','join','root','server/files/images/logos/default_profile.png','userpic','download','existsSync','server/files/images/','getOpenTabs','ChatOpenTabs','CHAT','createdAt','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','SmsOpenTabs','WhatsappOpenTabs','WHATSAPP','getContacts','findOne','order','sort','pick','merge','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','getQueues','Queue','getVoiceQueuesRt','getGroups','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','getFaxInteractions','getWhatsappInteractions','WhatsappInteraction','phone','LOCAL/%s@from-sip/n','intrf','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','PAUSE','LOGININPAUSE','bulkCreate','concat','resolve','logout','pause','QueuePause','DEFAULT\x20PAUSE','unpause','mailPause','faxPause','openchannelPause','smsPause','whatsappPause','pauseType','lastPauseAt','User\x20with\x20id\x20%s\x20not\x20found','getTeams','Body\x20parameter\x20\x27ids\x27\x20is\x20required','transaction','addTeams','Team','getAssociatedQueues','flattenDeep','getDataValue','Voice','TeamVoicePrefix','UserVoicePrefix','removeTeams','Query\x20parameter\x20\x27ids\x27\x20is\x20required','getLists','getAgents','addChatInteractions','omit','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','VoicePrefix','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','ChatWebsite','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$notIn','$like','$notILike','$overlap','$contains','$contained','firstName','lastName','dialActive','VoiceQueue','getApiKey','retrieveApiKey','token','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','iat','nonce','apiKeyNonce','whoami','getUserSetting','getPresence','teams','queues','flatten','col','toString','asc','desc','substring'];(function(_0xcc84ec,_0x348bb6){var _0x3e9632=function(_0x317c71){while(--_0x317c71){_0xcc84ec['push'](_0xcc84ec['shift']());}};_0x3e9632(++_0x348bb6);}(_0xb449,0x19d));var _0x9b44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb449[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0x9b44('0x0'));var util=require(_0x9b44('0x1'));var path=require('path');var fs=require('fs');var _=require(_0x9b44('0x2'));var squel=require(_0x9b44('0x3'));var jayson=require(_0x9b44('0x4'));var Redis=require(_0x9b44('0x5'));var authService=require(_0x9b44('0x6'));var qs=require(_0x9b44('0x7'));var logger=require(_0x9b44('0x8'))('api');var utils=require(_0x9b44('0x9'));var config=require(_0x9b44('0xa'));var licenseUtil=require(_0x9b44('0xb'));var APIBadRequestError=require('../../errors/api')[_0x9b44('0xc')];var APINotFoundError=require(_0x9b44('0xd'))[_0x9b44('0xe')];var APIHandleError=require('../../errors/api')[_0x9b44('0xf')];var db=require(_0x9b44('0x10'))['db'];var socket=require(_0x9b44('0x11'))(new Redis(config[_0x9b44('0x12')]));require('./user.socket')['register'](socket);config[_0x9b44('0x12')]=_[_0x9b44('0x13')](config[_0x9b44('0x12')],{'host':_0x9b44('0x14'),'port':0x18eb});var amiClient=jayson['client'][_0x9b44('0x15')]({'port':0x232a});var values;function respondWithRpcPromise(_0x5af290,_0xdf7a5,_0x3b052f,_0x3e3cb3){return new Promise(function(_0x2a7d4e,_0x1ba7b9){var _0x50fd16=_0x3e3cb3||amiClient;return _0x50fd16[_0x9b44('0x16')](_0x5af290,_0x3b052f)[_0x9b44('0x17')](function(_0x5e25f3){logger[_0x9b44('0x18')](_0x9b44('0x19'),_0xdf7a5,'request\x20sent');logger[_0x9b44('0x1a')]('User,\x20%s,\x20%s,\x20%s',_0xdf7a5,_0x9b44('0x1b'),JSON['stringify'](_0x5e25f3));if(_0x5e25f3[_0x9b44('0x1c')]){if(_0x5e25f3['error'][_0x9b44('0x1d')]===0x1f4){logger['error'](_0x9b44('0x19'),_0xdf7a5,_0x5e25f3[_0x9b44('0x1c')][_0x9b44('0x1e')]);return _0x1ba7b9(_0x5e25f3[_0x9b44('0x1c')][_0x9b44('0x1e')]);}logger['error'](_0x9b44('0x19'),_0xdf7a5,_0x5e25f3[_0x9b44('0x1c')][_0x9b44('0x1e')]);return _0x2a7d4e(_0x5e25f3[_0x9b44('0x1c')][_0x9b44('0x1e')]);}else{logger[_0x9b44('0x18')]('User,\x20%s,\x20%s',_0xdf7a5,_0x9b44('0x1b'));_0x2a7d4e(_0x5e25f3['result'][_0x9b44('0x1e')]);}})[_0x9b44('0x1f')](function(_0x33d69a){logger[_0x9b44('0x1c')]('User,\x20%s,\x20%s',_0xdf7a5,_0x33d69a);_0x1ba7b9(_0x33d69a);});});}function respondWithStatusCode(_0x2910cf,_0x129ed4){_0x129ed4=_0x129ed4||0xcc;return function(_0x16baa3){if(_0x16baa3){return _0x2910cf[_0x9b44('0x20')](_0x129ed4);}return _0x2910cf[_0x9b44('0x21')](_0x129ed4)[_0x9b44('0x22')]();};}function respondWithResult(_0x658819,_0xc57f15){_0xc57f15=_0xc57f15||0xc8;return function(_0x592743){if(_0x592743){return _0x658819['status'](_0xc57f15)['json'](_0x592743);}};}function respondWithFilteredResult(_0x4b25a5,_0x1cbb79){return function(_0x15f49d){if(_0x15f49d){var _0x913b68=typeof _0x1cbb79[_0x9b44('0x23')]===_0x9b44('0x24')&&typeof _0x1cbb79[_0x9b44('0x25')]===_0x9b44('0x24');var _0x1085d1=_0x15f49d[_0x9b44('0x26')];var _0x276dfc=_0x913b68?0x0:_0x1cbb79['offset'];var _0x1cc388=_0x913b68?_0x15f49d['count']:_0x1cbb79['offset']+_0x1cbb79[_0x9b44('0x25')];var _0x1932f4;if(_0x1cc388>=_0x1085d1){_0x1cc388=_0x1085d1;_0x1932f4=0xc8;}else{_0x1932f4=0xce;}_0x4b25a5[_0x9b44('0x21')](_0x1932f4);return _0x4b25a5['set']('Content-Range',_0x276dfc+'-'+_0x1cc388+'/'+_0x1085d1)[_0x9b44('0x27')](_0x15f49d);}return null;};}function saveUpdates(_0x2920e8){return function(_0x380e19){if(_0x380e19){return _0x380e19[_0x9b44('0x28')](_0x2920e8)[_0x9b44('0x17')](function(_0x56b456){if(_0x56b456[_0x9b44('0x29')]===_0x9b44('0x2a')){socket[_0x9b44('0x2b')](_0x9b44('0x2c')+_0x56b456['id'],_0x56b456);}return _0x56b456;});}return null;};}function removeEntity(_0xc7a7f5){return function(_0x3e8e4b){if(_0x3e8e4b){return _0x3e8e4b['destroy']()['then'](function(){var _0x4f4ee0=_0x3e8e4b[_0x9b44('0x2d')]({'plain':!![]});if(_0x4f4ee0[_0x9b44('0x29')]==='admin')return;var _0xa3875b=[{'name':'Users','value':_0x9b44('0x2e'),'ignore':!![]},{'name':_0x9b44('0x2f'),'value':_0x9b44('0x2a'),'ignore':![]},{'name':_0x9b44('0x30'),'value':_0x9b44('0x31'),'ignore':![]}];var _0x710d91=_(_0xa3875b)[_0x9b44('0x32')](_0x9b44('0x33'))[_0x9b44('0x34')](_0x9b44('0x35'))['value']();if(_[_0x9b44('0x36')](_0x710d91,_0x4f4ee0['role'])){return;}var _0x3d66d5=_[_0x9b44('0x37')](_0xa3875b,[_0x9b44('0x35'),_0x4f4ee0['role']])[_0x9b44('0x38')];return db['UserProfileResource'][_0x9b44('0x39')]({'where':{'type':_0x3d66d5,'resourceId':_0x4f4ee0['id']}})[_0x9b44('0x17')](function(){return _0x3e8e4b;});})[_0x9b44('0x17')](function(){_0xc7a7f5[_0x9b44('0x21')](0xcc)[_0x9b44('0x22')]();});}};}function handleEntityNotFound(_0x3cec7d){return function(_0x242809){if(!_0x242809){_0x3cec7d[_0x9b44('0x20')](0x194);}return _0x242809;};}function handleError(_0x5826be,_0x17401a){_0x17401a=_0x17401a||0x1f4;return function(_0x187d0d){logger[_0x9b44('0x1c')](_0x187d0d[_0x9b44('0x3a')]);if(_0x187d0d['name']){delete _0x187d0d['name'];}_0x5826be[_0x9b44('0x21')](_0x17401a)[_0x9b44('0x3b')](_0x187d0d);};}exports[_0x9b44('0x3c')]=function(_0x361368,_0x4f37d8){var _0xc16d90={},_0x5c459f={'count':0x0,'rows':[]};var _0x200baf=_(db[_0x9b44('0x3d')]['rawAttributes'])[_0x9b44('0x34')](function(_0x30905c){return{'name':_0x30905c[_0x9b44('0x3e')],'type':_0x30905c[_0x9b44('0x3f')][_0x9b44('0x40')]};})[_0x9b44('0x32')](function(_0x42e7de){return!_[_0x9b44('0x36')](['password','salt'],_0x42e7de['name']);})[_0x9b44('0x35')]();_0xc16d90=qs[_0x9b44('0x41')](_0x200baf,_0x361368);var _0x1fe244={'where':_0xc16d90[_0x9b44('0x42')]};return db[_0x9b44('0x3d')][_0x9b44('0x26')](_0x1fe244)[_0x9b44('0x17')](function(_0x2d1afc){_0x5c459f[_0x9b44('0x26')]=_0x2d1afc;if(_0x361368[_0x9b44('0x43')]['includeAll']){_0xc16d90['include']=[{'all':!![]}];}if(_0x361368[_0x9b44('0x43')][_0x9b44('0x44')]===_0x9b44('0x45')){_0xc16d90['include']=[{'model':db[_0x9b44('0x46')],'as':_0x9b44('0x44')}];}if(!_['includes'](_0xc16d90[_0x9b44('0x47')],'id')){_0xc16d90[_0x9b44('0x47')][_0x9b44('0x48')]('id');}return db[_0x9b44('0x3d')][_0x9b44('0x49')](_0xc16d90);})[_0x9b44('0x17')](function(_0x32ccaa){_0x5c459f[_0x9b44('0x4a')]=_0x32ccaa;if(_0x361368['query'][_0x9b44('0x4b')]===_0x9b44('0x45')){var _0x91fee1=[];for(var _0x5a3615=0x0;_0x5a3615<_0x5c459f[_0x9b44('0x4a')][_0x9b44('0x4c')];_0x5a3615++){_0x91fee1[_0x9b44('0x48')](get_open_tabs(_0x9b44('0x4d'),_0x5c459f[_0x9b44('0x4a')][_0x5a3615][_0x9b44('0x4e')]));_0x91fee1[_0x9b44('0x48')](get_open_tabs(_0x9b44('0x4f'),_0x5c459f[_0x9b44('0x4a')][_0x5a3615]['dataValues']));_0x91fee1[_0x9b44('0x48')](get_open_tabs(_0x9b44('0x50'),_0x5c459f[_0x9b44('0x4a')][_0x5a3615]['dataValues']));_0x91fee1[_0x9b44('0x48')](get_open_tabs(_0x9b44('0x51'),_0x5c459f[_0x9b44('0x4a')][_0x5a3615][_0x9b44('0x4e')]));_0x91fee1[_0x9b44('0x48')](get_open_tabs(_0x9b44('0x52'),_0x5c459f[_0x9b44('0x4a')][_0x5a3615][_0x9b44('0x4e')]));_0x91fee1['push'](get_open_tabs(_0x9b44('0x53'),_0x5c459f[_0x9b44('0x4a')][_0x5a3615][_0x9b44('0x4e')]));}return Promise[_0x9b44('0x54')](_0x91fee1)[_0x9b44('0x17')](function(){return _0x5c459f;});}else{return _0x5c459f;}})['then'](respondWithFilteredResult(_0x4f37d8,_0xc16d90))[_0x9b44('0x1f')](handleError(_0x4f37d8,null));};exports[_0x9b44('0x55')]=function(_0x108fcb,_0x4d9521){var _0x278abb={'raw':![],'where':{'id':_0x108fcb[_0x9b44('0x56')]['id']}},_0x3883fb={};_0x3883fb[_0x9b44('0x57')]=_[_0x9b44('0x58')](_[_0x9b44('0x59')](db['User'][_0x9b44('0x5a')]),[_0x9b44('0x5b'),_0x9b44('0x5c')]);_0x3883fb['query']=_[_0x9b44('0x59')](_0x108fcb[_0x9b44('0x43')]);_0x3883fb[_0x9b44('0x5d')]=_[_0x9b44('0x5e')](_0x3883fb[_0x9b44('0x57')],_0x3883fb[_0x9b44('0x43')]);_0x278abb['attributes']=_[_0x9b44('0x5e')](_0x3883fb[_0x9b44('0x57')],qs[_0x9b44('0x5f')](_0x108fcb['query'][_0x9b44('0x5f')]));_0x278abb[_0x9b44('0x47')]=_0x278abb[_0x9b44('0x47')][_0x9b44('0x4c')]?_0x278abb[_0x9b44('0x47')]:_0x3883fb[_0x9b44('0x57')];if(_0x108fcb[_0x9b44('0x43')][_0x9b44('0x60')]){_0x278abb['include']=[{'all':!![]}];}if(_0x108fcb['query'][_0x9b44('0x44')]==='true'){_0x278abb[_0x9b44('0x61')]=[{'model':db[_0x9b44('0x46')],'as':_0x9b44('0x44')}];}_0x278abb=_['merge']({},_0x278abb,_0x108fcb[_0x9b44('0x62')]);if(!_[_0x9b44('0x36')](_0x278abb[_0x9b44('0x47')],'id')){_0x278abb[_0x9b44('0x47')][_0x9b44('0x48')]('id');}return db['User'][_0x9b44('0x37')](_0x278abb)['then'](handleEntityNotFound(_0x4d9521,null))[_0x9b44('0x17')](function(_0x4a2462){var _0x55ac4f=[];values=_0x4a2462;if(_0x108fcb[_0x9b44('0x43')][_0x9b44('0x4b')]===_0x9b44('0x45')){_0x55ac4f[_0x9b44('0x48')](get_open_tabs(_0x9b44('0x4d'),_0x4a2462['dataValues']));_0x55ac4f[_0x9b44('0x48')](get_open_tabs(_0x9b44('0x4f'),_0x4a2462[_0x9b44('0x4e')]));_0x55ac4f['push'](get_open_tabs(_0x9b44('0x52'),_0x4a2462['dataValues']));_0x55ac4f[_0x9b44('0x48')](get_open_tabs(_0x9b44('0x53'),_0x4a2462['dataValues']));_0x55ac4f[_0x9b44('0x48')](get_open_tabs('fax',_0x4a2462[_0x9b44('0x4e')]));_0x55ac4f[_0x9b44('0x48')](get_open_tabs('mail',_0x4a2462[_0x9b44('0x4e')]));return Promise[_0x9b44('0x54')](_0x55ac4f);}else{return values;}})[_0x9b44('0x17')](function(){return values;})[_0x9b44('0x17')](respondWithResult(_0x4d9521,null))[_0x9b44('0x1f')](handleError(_0x4d9521,null));};exports[_0x9b44('0x28')]=function(_0x525750,_0xb7e0e7){if(_0x525750[_0x9b44('0x63')]['id']){delete _0x525750['body']['id'];}delete _0x525750[_0x9b44('0x63')][_0x9b44('0x29')];return db[_0x9b44('0x3d')]['find']({'where':{'id':_0x525750[_0x9b44('0x56')]['id']}})['then'](handleEntityNotFound(_0xb7e0e7,null))[_0x9b44('0x17')](saveUpdates(_0x525750[_0x9b44('0x63')],null))['then'](respondWithResult(_0xb7e0e7,null))[_0x9b44('0x1f')](handleError(_0xb7e0e7,null));};exports[_0x9b44('0x64')]=function(_0x8689f,_0xd9091f){return db[_0x9b44('0x3d')]['describe']()[_0x9b44('0x17')](respondWithResult(_0xd9091f,null))[_0x9b44('0x1f')](handleError(_0xd9091f,null));};exports[_0x9b44('0x65')]=function(_0x31bf22,_0x4402e3){return db['User'][_0x9b44('0x37')]({'where':{'id':_0x31bf22[_0x9b44('0x56')]['id']}})[_0x9b44('0x17')](handleEntityNotFound(_0x4402e3,null))['then'](function(_0x5b5333){if(_0x5b5333){return _0x5b5333[_0x9b44('0x65')](_0x31bf22[_0x9b44('0x63')][_0x9b44('0x66')],_['omit'](_0x31bf22[_0x9b44('0x63')],['ids','id'])||{});}})['then'](respondWithResult(_0x4402e3,null))[_0x9b44('0x1f')](handleError(_0x4402e3,null));};function validateUser(_0x77b17e){return new Promise(function(_0x1b3756,_0x31c703){if(_0x77b17e[_0x9b44('0x67')])return _0x1b3756(_0x77b17e);return db['Setting'][_0x9b44('0x68')](0x1)['then'](function(_0x34e7c3){if(_0x34e7c3['securePassword'])authService[_0x9b44('0x69')](_0x77b17e[_0x9b44('0x5b')]);db[_0x9b44('0x3d')][_0x9b44('0x6a')](_0x9b44('0x67'))[_0x9b44('0x17')](function(_0x2b4edb){if(_['isNil'](_0x2b4edb)){_0x77b17e['internal']=_0x34e7c3[_0x9b44('0x6b')]||0x1;return;}if(_[_0x9b44('0x6c')](_0x34e7c3['min_internal'])||_0x34e7c3[_0x9b44('0x6b')]===_0x2b4edb){_0x77b17e[_0x9b44('0x67')]=_0x2b4edb+0x1;return;}if(_0x34e7c3['min_internal']>_0x2b4edb){_0x77b17e[_0x9b44('0x67')]=_0x34e7c3[_0x9b44('0x6b')];return;}return db[_0x9b44('0x6d')][_0x9b44('0x43')](_0x9b44('0x6e'),{'type':db[_0x9b44('0x6d')][_0x9b44('0x6f')]['SELECT']})[_0x9b44('0x17')](function(_0x4d676e){if(_0x4d676e&&_0x4d676e[_0x9b44('0x4c')]){for(var _0x42feea=0x0,_0x5c8f7c=_0x4d676e[_0x9b44('0x4c')];_0x42feea<_0x5c8f7c&&_[_0x9b44('0x6c')](_0x77b17e[_0x9b44('0x67')]);_0x42feea++){if(_0x34e7c3['min_internal']<=_0x4d676e[_0x42feea][_0x9b44('0x70')]){_0x77b17e[_0x9b44('0x67')]=_0x4d676e[_0x42feea][_0x9b44('0x70')];}else if(_0x34e7c3[_0x9b44('0x6b')]>_0x4d676e[_0x42feea][_0x9b44('0x70')]&&_0x34e7c3[_0x9b44('0x6b')]<=_0x4d676e[_0x42feea]['to']){_0x77b17e[_0x9b44('0x67')]=_0x34e7c3[_0x9b44('0x6b')];}}}if(_['isNil'](_0x77b17e[_0x9b44('0x67')])){_0x77b17e['internal']=_0x2b4edb+0x1;}return _0x1b3756(_0x77b17e);});});})[_0x9b44('0x1f')](function(_0x1e79fa){_0x31c703(_0x1e79fa);});});}function updateUser(_0x52699c){return new Promise(function(_0x41d002,_0x366c02){try{if(_0x52699c['voicemail']){_0x52699c[_0x9b44('0x71')]=_0x52699c[_0x9b44('0x67')];_0x52699c[_0x9b44('0x72')]={'mailbox':_0x52699c['internal'],'password':_0x52699c[_0x9b44('0x5b')],'fullname':_0x52699c[_0x9b44('0x73')],'email':_0x52699c[_0x9b44('0x74')]};}if(_0x52699c[_0x9b44('0x29')]===_0x9b44('0x2a')){if(!_0x52699c['permissions'])_0x52699c[_0x9b44('0x75')]=[_0x9b44('0x76'),_0x9b44('0x77'),_0x9b44('0x78'),_0x9b44('0x79'),'110',_0x9b44('0x7a'),'105','106',_0x9b44('0x7b'),_0x9b44('0x7c'),'109',_0x9b44('0x7d'),_0x9b44('0x7e'),_0x9b44('0x7f'),_0x9b44('0x80')];}_0x41d002(_0x52699c);}catch(_0x3f8317){_0x366c02(_0x3f8317);}});}exports['create']=function(_0x13f4bd,_0x81ff4c){if(_0x13f4bd[_0x9b44('0x2e')][_0x9b44('0x29')]===_0x9b44('0x2a'))throw new Error(_0x9b44('0x81'));if(_0x13f4bd[_0x9b44('0x63')][_0x9b44('0x29')]===_0x9b44('0x2e')&&_0x13f4bd['user'][_0x9b44('0x29')]!==_0x9b44('0x82')){throw new Error(_0x9b44('0x83'));}if(_0x13f4bd[_0x9b44('0x63')][_0x9b44('0x29')]===_0x9b44('0x82')&&_0x13f4bd[_0x9b44('0x2e')][_0x9b44('0x29')]!==_0x9b44('0x82')){throw new Error(_0x9b44('0x84'));}return licenseUtil[_0x9b44('0x85')]([_0x13f4bd[_0x9b44('0x63')]])[_0x9b44('0x17')](function(){return validateUser(_0x13f4bd[_0x9b44('0x63')]);})[_0x9b44('0x17')](function(_0x420129){return updateUser(_0x420129)[_0x9b44('0x17')](function(_0x11ee8f){if(_0x11ee8f[_0x9b44('0x29')]===_0x9b44('0x82')){_0x11ee8f[_0x9b44('0x86')]=_0x13f4bd[_0x9b44('0x2e')][_0x9b44('0x86')];delete _0x11ee8f[_0x9b44('0x87')];}return _0x11ee8f;});})[_0x9b44('0x17')](function(_0x1dd28b){return db[_0x9b44('0x3d')]['create'](_0x1dd28b,{'include':[{'model':db[_0x9b44('0x72')],'as':_0x9b44('0x72')}]});})[_0x9b44('0x17')](function(_0x5c55ea){if(_0x13f4bd[_0x9b44('0x63')]['role']===_0x9b44('0x2e'))return _0x5c55ea;if(_0x13f4bd['user']['role']!==_0x9b44('0x2e'))return _0x5c55ea;return db[_0x9b44('0x88')][_0x9b44('0x37')]({'where':{'name':_0x5c55ea[_0x9b44('0x29')]==='agent'?_0x9b44('0x2f'):_0x9b44('0x30'),'userProfileId':_0x13f4bd[_0x9b44('0x2e')][_0x9b44('0x87')]},'raw':!![]})[_0x9b44('0x17')](function(_0x55ebde){if(!_0x55ebde||_0x55ebde['autoAssociation']!=0x0)return _0x5c55ea;return db[_0x9b44('0x89')][_0x9b44('0x8a')]({'name':_0x5c55ea[_0x9b44('0x38')],'resourceId':_0x5c55ea['id'],'type':_0x55ebde[_0x9b44('0x38')],'sectionId':_0x55ebde['id']},{})[_0x9b44('0x17')](function(){return _0x5c55ea;});})[_0x9b44('0x1f')](function(_0x1b6946){logger['error'](_0x9b44('0x8b'),_0x1b6946);throw _0x1b6946;});})[_0x9b44('0x17')](respondWithResult(_0x81ff4c,0xc9))[_0x9b44('0x1f')](handleError(_0x81ff4c,null));};exports['bulkCreate']=function(_0x15d436,_0x22dc9c){var _0x4b8a89=_0x15d436[_0x9b44('0x63')];var _0x53744b=[];if(_0x15d436[_0x9b44('0x2e')][_0x9b44('0x29')]===_0x9b44('0x2a'))throw new Error(_0x9b44('0x81'));if(_[_0x9b44('0x8c')](_0x4b8a89,[_0x9b44('0x29'),'user'])&&_0x15d436[_0x9b44('0x2e')][_0x9b44('0x29')]!==_0x9b44('0x82')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_['some'](_0x4b8a89,['role',_0x9b44('0x82')])&&_0x15d436['user']['role']!==_0x9b44('0x82')){throw new Error(_0x9b44('0x8d'));}return licenseUtil[_0x9b44('0x85')](_0x4b8a89)[_0x9b44('0x17')](function(){return validateUser(_0x4b8a89[0x0]);})[_0x9b44('0x17')](function(){for(var _0x10ec7c=0x1;_0x10ec7c<_0x4b8a89[_0x9b44('0x4c')];_0x10ec7c++){var _0x5b406d=_0x4b8a89[_0x10ec7c-0x1][_0x9b44('0x67')];if(!_0x4b8a89[_0x10ec7c]['internal'])_0x4b8a89[_0x10ec7c]['internal']=_0x5b406d+0x1;_0x53744b[_0x9b44('0x48')](validateUser(_0x4b8a89[_0x10ec7c]));}return Promise[_0x9b44('0x54')](_0x53744b);})[_0x9b44('0x17')](function(){_0x53744b=[];for(var _0x5c08b5=0x0;_0x5c08b5<_0x4b8a89[_0x9b44('0x4c')];_0x5c08b5++){_0x53744b[_0x9b44('0x48')](updateUser(_0x4b8a89[_0x5c08b5]));}return Promise[_0x9b44('0x54')](_0x53744b);})[_0x9b44('0x17')](function(){_0x53744b=_0x4b8a89[_0x9b44('0x34')](function(_0x5858c7){return db['User'][_0x9b44('0x8a')](_0x5858c7,{'include':[{'model':db['VoiceMail'],'as':_0x9b44('0x72')}]})[_0x9b44('0x17')](function(_0x513f86){_0x5858c7['id']=_0x513f86['id'];return _0x5858c7;});});return Promise[_0x9b44('0x54')](_0x53744b);})['then'](function(_0x3591c7){if(_0x15d436[_0x9b44('0x63')]['role']==='user')return _0x3591c7;if(_0x15d436['user'][_0x9b44('0x29')]!==_0x9b44('0x2e'))return _0x3591c7;var _0x384f7a=_[_0x9b44('0x8c')](_0x3591c7,function(_0x445f6c){return _0x445f6c[_0x9b44('0x29')]==='agent'||_0x445f6c[_0x9b44('0x29')]===_0x9b44('0x31');});if(!_0x384f7a)return _0x3591c7;return db[_0x9b44('0x88')]['findAll']({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x15d436[_0x9b44('0x2e')][_0x9b44('0x87')]},'raw':!![]})[_0x9b44('0x17')](function(_0x1a19d2){if(_[_0x9b44('0x8e')](_0x1a19d2)||!_[_0x9b44('0x8c')](_0x1a19d2,[_0x9b44('0x8f'),0x0]))return _0x3591c7;_0x53744b=[];var _0x3d93c5=_(_0x1a19d2)[_0x9b44('0x34')](function(_0x1ddbf3){if(_0x1ddbf3['autoAssociation']===0x1)return;return _0x1ddbf3['name']===_0x9b44('0x2f')?'agent':_0x9b44('0x31');})[_0x9b44('0x90')]()[_0x9b44('0x35')]();for(var _0x42f1c5=0x0;_0x42f1c5<_0x3591c7[_0x9b44('0x4c')];_0x42f1c5++){if(!_[_0x9b44('0x36')](_0x3d93c5,_0x3591c7[_0x42f1c5]['role']))return;var _0x5b976d=_0x3591c7[_0x42f1c5][_0x9b44('0x29')]===_0x9b44('0x2a')?_0x9b44('0x2f'):_0x9b44('0x30');_0x53744b['push'](db['UserProfileResource']['create']({'name':_0x3591c7[_0x42f1c5][_0x9b44('0x38')],'resourceId':_0x3591c7[_0x42f1c5]['id'],'type':_0x5b976d,'sectionId':_[_0x9b44('0x37')](_0x1a19d2,[_0x9b44('0x38'),_0x5b976d])['id']},{}));}return Promise[_0x9b44('0x54')](_0x53744b);});})[_0x9b44('0x17')](respondWithResult(_0x22dc9c,0xc9))[_0x9b44('0x1f')](handleError(_0x22dc9c,null));};exports[_0x9b44('0x91')]=function(_0x250916,_0xe67782){if(_0x250916['body']['id']){delete _0x250916[_0x9b44('0x63')]['id'];}return db[_0x9b44('0x3d')][_0x9b44('0x37')]({'where':{'id':_0x250916[_0x9b44('0x56')]['id']}})['then'](function(_0x446fd0){if(!_0x446fd0)return null;if(_0x446fd0['id']===_0x250916['user']['id']){if(!_0x250916[_0x9b44('0x63')][_0x9b44('0x92')]||!_0x250916[_0x9b44('0x63')][_0x9b44('0x93')]){throw new db[(_0x9b44('0x94'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x446fd0[_0x9b44('0x95')](_0x250916[_0x9b44('0x63')][_0x9b44('0x92')])){throw new db[(_0x9b44('0x94'))]['ValidationError'](_0x9b44('0x96'));}if(_0x250916[_0x9b44('0x63')][_0x9b44('0x92')]===_0x250916[_0x9b44('0x63')][_0x9b44('0x93')]){throw new db[(_0x9b44('0x94'))][(_0x9b44('0x97'))](_0x9b44('0x98'));}}else if(_0x250916['user'][_0x9b44('0x29')]===_0x9b44('0x82')){if(!_0x250916[_0x9b44('0x63')][_0x9b44('0x93')]){throw new db[(_0x9b44('0x94'))]['ValidationError'](_0x9b44('0x99'));}}else if(_0x250916[_0x9b44('0x2e')]['role']===_0x9b44('0x2e')){if(!_0x250916[_0x9b44('0x63')][_0x9b44('0x93')]){throw new db[(_0x9b44('0x94'))][(_0x9b44('0x97'))](_0x9b44('0x99'));}if(_0x446fd0['role']!=='agent'){throw new db[(_0x9b44('0x94'))]['ValidationError'](_0x9b44('0x81'));}}else{throw new db[(_0x9b44('0x94'))][(_0x9b44('0x97'))](_0x9b44('0x81'));}return _0x446fd0;})[_0x9b44('0x17')](handleEntityNotFound(_0xe67782,null))[_0x9b44('0x17')](function(_0x4c4f0f){return db[_0x9b44('0x9a')]['findOne']({'attributes':['id',_0x9b44('0x9b'),_0x9b44('0x9c'),_0x9b44('0x9d')]})['then'](function(_0x270f18){if(_0x270f18[_0x9b44('0x9b')])authService[_0x9b44('0x69')](_0x250916['body'][_0x9b44('0x93')]);if(!_0x270f18['enforcePasswordHistory']||!_0x4c4f0f[_0x9b44('0x9e')])return _0x4c4f0f;authService['validatePasswordHistory'](_0x250916['body'][_0x9b44('0x93')],_0x4c4f0f[_0x9b44('0x9e')],_0x270f18[_0x9b44('0x9d')]);return _0x4c4f0f;})[_0x9b44('0x17')](saveUpdates({'password':_0x250916[_0x9b44('0x63')][_0x9b44('0x93')],'passwordResetAt':_0x250916[_0x9b44('0x2e')]['id']==_0x250916[_0x9b44('0x56')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x250916[_0x9b44('0x63')][_0x9b44('0x93')],_0x4c4f0f[_0x9b44('0x9e')])},null));})[_0x9b44('0x17')](respondWithResult(_0xe67782,null))[_0x9b44('0x1f')](handleError(_0xe67782,null));};exports[_0x9b44('0x9f')]=function(_0x2b592d,_0x15baca){var _0xd3f04d=_0x2b592d[_0x9b44('0x63')][_0x9b44('0xa0')];return db[_0x9b44('0x3d')]['find']({'where':{'id':_0x2b592d[_0x9b44('0x56')]['id']},'attributes':['id','name',_0x9b44('0x29'),'online',_0x9b44('0xa1'),'voicePause','interface']})[_0x9b44('0x17')](handleEntityNotFound(_0x15baca,null))[_0x9b44('0x17')](function(_0x49124b){if(_0x49124b){if(!utils[_0x9b44('0xa2')](_0xd3f04d)){throw new db['Sequelize'][(_0x9b44('0x97'))](_0x9b44('0xa3'));}return _0x49124b[_0x9b44('0xa4')+_[_0x9b44('0xa5')](_0xd3f04d[_0x9b44('0xa6')]())+'Queues'](_0x2b592d[_0x9b44('0x63')]['ids'],{'penalty':_0x2b592d['body'][_0x9b44('0xa7')]||0x0})['spread'](function(_0x25ac2f){for(var _0x162f12=0x0;_0x162f12<_0x2b592d[_0x9b44('0x63')][_0x9b44('0x66')][_0x9b44('0x4c')];_0x162f12+=0x1){var _0x222dd2={'UserId':Number(_0x2b592d['params']['id'])};_0x222dd2[_[_0x9b44('0xa5')](_0xd3f04d[_0x9b44('0xa6')]())+_0x9b44('0xa8')]=Number(_0x2b592d['body'][_0x9b44('0x66')][_0x162f12]);socket[_0x9b44('0x2b')]('user'+_[_0x9b44('0xa5')](_0xd3f04d[_0x9b44('0xa6')]())+_0x9b44('0xa9'),_0x222dd2);}return _0x25ac2f;})['then'](function(){if(_0xd3f04d===_0x9b44('0xaa')){return db['VoiceQueue']['findAll']({'where':{'id':_0x2b592d[_0x9b44('0x63')][_0x9b44('0x66')]||[]},'raw':!![],'attributes':['id',_0x9b44('0x38')]});}})['then'](function(_0x33623f){var _0x425ced=_0x49124b['get']({'plain':!![]});var _0x5778e6=[];if(_0xd3f04d===_0x9b44('0xaa')&&_0x425ced[_0x9b44('0x29')]==='agent'&&_0x425ced[_0x9b44('0xab')]){for(let _0x346d86=0x0;_0x346d86<_0x33623f['length'];_0x346d86+=0x1){_0x5778e6[_0x9b44('0x48')]({'membername':_0x425ced['name'],'UserId':_0x425ced['id'],'queue_name':_0x33623f[_0x346d86][_0x9b44('0x38')],'VoiceQueueId':_0x33623f[_0x346d86]['id'],'interface':_[_0x9b44('0x6c')](_0x425ced[_0x9b44('0xac')])?util[_0x9b44('0xad')](_0x9b44('0xae'),_0x425ced[_0x9b44('0x38')]):_0x425ced[_0x9b44('0xac')],'paused':_0x425ced[_0x9b44('0xaf')]||![],'penalty':_0x2b592d[_0x9b44('0x63')]['penalty']||0x0});}return Promise[_0x9b44('0x54')](_0x5778e6[_0x9b44('0x34')](function(_0x4fc836){return db[_0x9b44('0xb0')][_0x9b44('0xb1')](_0x4fc836);}));}return _0x49124b;});}})[_0x9b44('0x17')](respondWithStatusCode(_0x15baca,null))[_0x9b44('0x1f')](handleError(_0x15baca,null));};exports['removeQueues']=function(_0xc75f8a,_0x3d2410){var _0x3a190d,_0x1e66ee;return db[_0x9b44('0x3d')][_0x9b44('0x37')]({'where':{'id':_0xc75f8a['params']['id']},'attributes':['id',_0x9b44('0x38'),_0x9b44('0x29')]})[_0x9b44('0x17')](handleEntityNotFound(_0x3d2410,null))['then'](function(_0x38584b){if(_0x38584b){_0x3a190d=_0x38584b;if(!_0xc75f8a[_0x9b44('0x43')][_0x9b44('0xa0')]||!utils[_0x9b44('0xa2')](_0xc75f8a['query']['channel'])){throw new db[(_0x9b44('0x94'))]['ValidationError'](_0x9b44('0xa3'));}return _0x38584b[_0x9b44('0xb2')+_[_0x9b44('0xa5')](_0xc75f8a['query'][_0x9b44('0xa0')][_0x9b44('0xa6')]())+_0x9b44('0xb3')](_0xc75f8a[_0x9b44('0x43')][_0x9b44('0x66')]);}})[_0x9b44('0x17')](function(_0x46428b){if(_[_0x9b44('0xb4')](_0xc75f8a[_0x9b44('0x43')][_0x9b44('0x66')])){for(var _0x213424=0x0;_0x213424<_0xc75f8a[_0x9b44('0x43')][_0x9b44('0x66')]['length'];_0x213424+=0x1){_0x1e66ee={'UserId':Number(_0xc75f8a[_0x9b44('0x56')]['id'])};_0x1e66ee[_[_0x9b44('0xa5')](_0xc75f8a['query']['channel'][_0x9b44('0xa6')]())+_0x9b44('0xa8')]=Number(_0xc75f8a['query'][_0x9b44('0x66')][_0x213424]);socket[_0x9b44('0x2b')]('user'+_[_0x9b44('0xa5')](_0xc75f8a[_0x9b44('0x43')]['channel']['toLowerCase']())+_0x9b44('0xb5'),_0x1e66ee);}}else{_0x1e66ee={'UserId':Number(_0xc75f8a[_0x9b44('0x56')]['id'])};_0x1e66ee[_['capitalize'](_0xc75f8a['query'][_0x9b44('0xa0')]['toLowerCase']())+_0x9b44('0xa8')]=Number(_0xc75f8a[_0x9b44('0x43')][_0x9b44('0x66')]);socket[_0x9b44('0x2b')]('user'+_[_0x9b44('0xa5')](_0xc75f8a['query'][_0x9b44('0xa0')][_0x9b44('0xa6')]())+_0x9b44('0xb5'),_0x1e66ee);}return _0x46428b;})['then'](function(){if(_0xc75f8a[_0x9b44('0x43')][_0x9b44('0xa0')]===_0x9b44('0xaa')){return db['UserVoiceQueueRt'][_0x9b44('0x39')]({'where':{'UserId':_0xc75f8a[_0x9b44('0x56')]['id'],'VoiceQueueId':_0xc75f8a['query'][_0x9b44('0x66')]},'individualHooks':!![]})[_0x9b44('0x17')](function(){return _0x3a190d;});}return _0x3a190d;})[_0x9b44('0x17')](respondWithStatusCode(_0x3d2410,null))[_0x9b44('0x1f')](handleError(_0x3d2410,null));};exports[_0x9b44('0xb6')]=function(_0x54ec4e,_0x140bf1){_0x54ec4e[_0x9b44('0x63')]['userpic']=_0x54ec4e['file'][_0x9b44('0xb7')];return db['User'][_0x9b44('0x37')]({'where':{'id':_0x54ec4e[_0x9b44('0x56')]['id']}})[_0x9b44('0x17')](handleEntityNotFound(_0x140bf1,null))[_0x9b44('0x17')](saveUpdates(_0x54ec4e[_0x9b44('0x63')],null))[_0x9b44('0x17')](respondWithResult(_0x140bf1,null))[_0x9b44('0x1f')](handleError(_0x140bf1,null));};exports['getAvatar']=function(_0x31e27a,_0x203f87){var _0x27866d=path[_0x9b44('0xb8')](config[_0x9b44('0xb9')],_0x9b44('0xba'));return db[_0x9b44('0x3d')][_0x9b44('0x37')]({'where':{'id':_0x31e27a[_0x9b44('0x56')]['id']},'attributes':['id',_0x9b44('0xbb')],'raw':!![]})[_0x9b44('0x17')](handleEntityNotFound(_0x203f87,null))[_0x9b44('0x17')](function(_0x57108e){if(_0x57108e){if(_[_0x9b44('0x6c')](_0x57108e[_0x9b44('0xbb')])){return _0x203f87[_0x9b44('0xbc')](_0x27866d);}else{if(!fs[_0x9b44('0xbd')](path['join'](config[_0x9b44('0xb9')],_0x9b44('0xbe'),_0x57108e[_0x9b44('0xbb')]))){return _0x203f87[_0x9b44('0xbc')](_0x27866d);}return _0x203f87['download'](path[_0x9b44('0xb8')](config[_0x9b44('0xb9')],_0x9b44('0xbe'),_0x57108e[_0x9b44('0xbb')]));}}})[_0x9b44('0x1f')](handleError(_0x203f87,null));};exports[_0x9b44('0xbf')]=function(_0x4a7794,_0x23a591){return db[_0x9b44('0x3d')][_0x9b44('0x37')]({'where':{'id':_0x4a7794[_0x9b44('0x56')]['id']},'attributes':['id']})[_0x9b44('0x17')](handleEntityNotFound(_0x23a591,null))[_0x9b44('0x17')](function(_0x2c85a9){var _0x37cc2c=[];values=_0x2c85a9['dataValues'];_0x37cc2c[_0x9b44('0x48')](get_open_tabs(_0x9b44('0x4d'),_0x2c85a9[_0x9b44('0x4e')]));_0x37cc2c[_0x9b44('0x48')](get_open_tabs(_0x9b44('0x4f'),_0x2c85a9[_0x9b44('0x4e')]));_0x37cc2c[_0x9b44('0x48')](get_open_tabs('openchannel',_0x2c85a9[_0x9b44('0x4e')]));_0x37cc2c[_0x9b44('0x48')](get_open_tabs(_0x9b44('0x53'),_0x2c85a9[_0x9b44('0x4e')]));_0x37cc2c['push'](get_open_tabs(_0x9b44('0x50'),_0x2c85a9[_0x9b44('0x4e')]));_0x37cc2c['push'](get_open_tabs(_0x9b44('0x51'),_0x2c85a9['dataValues']));return Promise[_0x9b44('0x54')](_0x37cc2c);})['then'](function(_0x297078){if(_0x297078){var _0x5ce485=_[_0x9b44('0x34')](values[_0x9b44('0xc0')],function(_0xee4c8){return{'channel':_0x9b44('0xc1'),'id':_0xee4c8['id'],'createdAt':_0xee4c8[_0x9b44('0xc2')]};});var _0x1eeef8=_[_0x9b44('0x34')](values['FaxOpenTabs'],function(_0x50facd){return{'channel':_0x9b44('0xc3'),'id':_0x50facd['id'],'createdAt':_0x50facd[_0x9b44('0xc2')]};});var _0x1a6257=_[_0x9b44('0x34')](values[_0x9b44('0xc4')],function(_0x50ab68){return{'channel':_0x9b44('0xc5'),'id':_0x50ab68['id'],'createdAt':_0x50ab68['createdAt']};});var _0x347255=_['map'](values[_0x9b44('0xc6')],function(_0x573015){return{'channel':'MAIL','id':_0x573015['id'],'createdAt':_0x573015[_0x9b44('0xc2')]};});var _0x9c06e5=_['map'](values[_0x9b44('0xc7')],function(_0x38a352){return{'channel':'SMS','id':_0x38a352['id'],'createdAt':_0x38a352[_0x9b44('0xc2')]};});var _0x15637e=_[_0x9b44('0x34')](values[_0x9b44('0xc8')],function(_0x24078f){return{'channel':_0x9b44('0xc9'),'id':_0x24078f['id'],'createdAt':_0x24078f['createdAt']};});var _0x58c10d=_['concat'](_0x5ce485,_0x1eeef8,_0x1a6257,_0x347255,_0x9c06e5,_0x15637e);var _0x5721cb={'count':_0x58c10d[_0x9b44('0x4c')],'rows':_0x58c10d};return _0x5721cb;}else return null;})[_0x9b44('0x17')](respondWithResult(_0x23a591,null))[_0x9b44('0x1f')](handleError(_0x23a591,null));};exports[_0x9b44('0xca')]=function(_0x8fc349,_0x3bf98d){var _0x4948e7={};var _0x1f279d={};var _0x260297;var _0x3c2bf8;return db[_0x9b44('0x3d')][_0x9b44('0xcb')]({'where':{'id':_0x8fc349['params']['id']}})[_0x9b44('0x17')](handleEntityNotFound(_0x3bf98d,null))['then'](function(_0x56b392){if(_0x56b392){_0x260297=_0x56b392;_0x1f279d['model']=_['keys'](db['CmContact'][_0x9b44('0x5a')]);_0x1f279d[_0x9b44('0x43')]=_[_0x9b44('0x59')](_0x8fc349[_0x9b44('0x43')]);_0x1f279d['filters']=_[_0x9b44('0x5e')](_0x1f279d[_0x9b44('0x57')],_0x1f279d[_0x9b44('0x43')]);_0x4948e7[_0x9b44('0x47')]=_[_0x9b44('0x5e')](_0x1f279d[_0x9b44('0x57')],qs[_0x9b44('0x5f')](_0x8fc349[_0x9b44('0x43')][_0x9b44('0x5f')]));_0x4948e7[_0x9b44('0x47')]=_0x4948e7[_0x9b44('0x47')][_0x9b44('0x4c')]?_0x4948e7[_0x9b44('0x47')]:_0x1f279d[_0x9b44('0x57')];_0x4948e7[_0x9b44('0xcc')]=qs[_0x9b44('0xcd')](_0x8fc349[_0x9b44('0x43')][_0x9b44('0xcd')]);_0x4948e7['where']=qs[_0x9b44('0x5d')](_[_0x9b44('0xce')](_0x8fc349['query'],_0x1f279d['filters']));if(_0x8fc349[_0x9b44('0x43')]['filter']){_0x4948e7[_0x9b44('0x42')]=_[_0x9b44('0xcf')](_0x4948e7[_0x9b44('0x42')],{'$or':_['map'](_0x4948e7[_0x9b44('0x47')],function(_0x56eb12){var _0x4eb608={};_0x4eb608[_0x56eb12]={'$like':'%'+_0x8fc349['query'][_0x9b44('0x32')]+'%'};return _0x4eb608;})});}_0x4948e7=_[_0x9b44('0xcf')]({},_0x4948e7,_0x8fc349[_0x9b44('0x62')]);return _0x260297[_0x9b44('0xca')](_0x4948e7);}})[_0x9b44('0x17')](function(_0x1970aa){if(_0x1970aa){_0x3c2bf8=_0x1970aa[_0x9b44('0x4c')];if(_0x8fc349['query'][_0x9b44('0xd0')](_0x9b44('0x60'))){_0x4948e7[_0x9b44('0x61')]=[{'model':db[_0x9b44('0xd1')],'as':_0x9b44('0xd2'),'required':![]},{'model':db[_0x9b44('0xd3')],'as':_0x9b44('0xd4'),'attributes':['id',_0x9b44('0x38'),_0x9b44('0xd5')],'where':_0x8fc349[_0x9b44('0x43')]['tag']?{'id':_0x8fc349[_0x9b44('0x43')][_0x9b44('0xd6')]}:undefined,'required':_0x8fc349[_0x9b44('0x43')]['tag']?!![]:![]}];}if(!_0x8fc349[_0x9b44('0x43')][_0x9b44('0xd0')](_0x9b44('0xd7'))){_0x4948e7['limit']=qs[_0x9b44('0x25')](_0x8fc349[_0x9b44('0x43')]['limit']);_0x4948e7['offset']=qs['offset'](_0x8fc349[_0x9b44('0x43')][_0x9b44('0x23')]);}return _0x260297[_0x9b44('0xca')](_0x4948e7);}})['then'](function(_0x3e6607){if(_0x3e6607){return _0x3e6607?{'count':_0x3c2bf8,'rows':_0x3e6607}:null;}})[_0x9b44('0x17')](respondWithResult(_0x3bf98d,null))[_0x9b44('0x1f')](handleError(_0x3bf98d,null));};exports[_0x9b44('0xd8')]=function(_0x26cc53,_0x596edb){var _0x5ee4d5;var _0xcb8e47={};var _0x34b3c6;return db[_0x9b44('0x3d')]['findOne']({'where':{'id':_0x26cc53[_0x9b44('0x56')]['id']},'attributes':['id',_0x9b44('0x38'),_0x9b44('0x29')]})[_0x9b44('0x17')](handleEntityNotFound(_0x596edb,null))[_0x9b44('0x17')](function(_0x250aba){if(!utils[_0x9b44('0xa2')](_0x26cc53[_0x9b44('0x43')][_0x9b44('0xa0')])){throw new db[(_0x9b44('0x94'))][(_0x9b44('0x97'))]('Unknown\x20channel');}_0x5ee4d5=_0x250aba;var _0xf92ca1={};_0xf92ca1[_0x9b44('0x57')]=_[_0x9b44('0x59')](db[_[_0x9b44('0xa5')](_0x26cc53[_0x9b44('0x43')][_0x9b44('0xa0')])+'Queue'][_0x9b44('0x5a')]);_0xf92ca1[_0x9b44('0x43')]=_['keys'](_0x26cc53['query']);_0xf92ca1[_0x9b44('0x5d')]=_[_0x9b44('0x5e')](_0xf92ca1['model'],_0xf92ca1[_0x9b44('0x43')]);_0xcb8e47[_0x9b44('0x47')]=_[_0x9b44('0x5e')](_0xf92ca1[_0x9b44('0x57')],qs['fields'](_0x26cc53[_0x9b44('0x43')][_0x9b44('0x5f')]));_0xcb8e47[_0x9b44('0x47')]=_0xcb8e47[_0x9b44('0x47')][_0x9b44('0x4c')]?_0xcb8e47['attributes']:_0xf92ca1[_0x9b44('0x57')];_0xcb8e47['order']=qs[_0x9b44('0xcd')](_0x26cc53[_0x9b44('0x43')]['sort']);_0xcb8e47['where']=qs[_0x9b44('0x5d')](_[_0x9b44('0xce')](_0x26cc53[_0x9b44('0x43')],_0xf92ca1[_0x9b44('0x5d')]));if(_0x26cc53[_0x9b44('0x43')]['filter']){_0xcb8e47['where']=_[_0x9b44('0xcf')](_0xcb8e47['where'],{'$or':_[_0x9b44('0x34')](_0xcb8e47[_0x9b44('0x47')],function(_0x34a4ad){var _0x51cb9e={};_0x51cb9e[_0x34a4ad]={'$like':'%'+_0x26cc53[_0x9b44('0x43')][_0x9b44('0x32')]+'%'};return _0x51cb9e;})});}_0xcb8e47=_[_0x9b44('0xcf')]({},_0xcb8e47,_0x26cc53[_0x9b44('0x62')]);switch(_0x5ee4d5[_0x9b44('0x29')]){case _0x9b44('0x82'):return db[_['capitalize'](_0x26cc53['query'][_0x9b44('0xa0')])+_0x9b44('0xd9')][_0x9b44('0x49')](_0xcb8e47);case'user':case _0x9b44('0x2a'):return _0x5ee4d5[_0x9b44('0x2d')+_[_0x9b44('0xa5')](_0x26cc53[_0x9b44('0x43')][_0x9b44('0xa0')])+_0x9b44('0xb3')](_0xcb8e47);default:throw new db[(_0x9b44('0x94'))]['ValidationError']('Unknown\x20role');}})[_0x9b44('0x17')](function(_0x55186d){_0x34b3c6=_0x55186d['length'];if(!_0x26cc53['query'][_0x9b44('0xd0')]('nolimit')){_0xcb8e47[_0x9b44('0x25')]=qs[_0x9b44('0x25')](_0x26cc53[_0x9b44('0x43')][_0x9b44('0x25')]);_0xcb8e47[_0x9b44('0x23')]=qs['offset'](_0x26cc53[_0x9b44('0x43')][_0x9b44('0x23')]);}switch(_0x5ee4d5[_0x9b44('0x29')]){case _0x9b44('0x82'):return db[_[_0x9b44('0xa5')](_0x26cc53[_0x9b44('0x43')]['channel'])+_0x9b44('0xd9')][_0x9b44('0x49')](_0xcb8e47);case _0x9b44('0x2e'):case _0x9b44('0x2a'):return _0x5ee4d5[_0x9b44('0x2d')+_[_0x9b44('0xa5')](_0x26cc53[_0x9b44('0x43')][_0x9b44('0xa0')])+'Queues'](_0xcb8e47);}})['then'](function(_0x5366d8){return{'count':_0x34b3c6,'rows':_0x5366d8};})[_0x9b44('0x17')](respondWithResult(_0x596edb,null))[_0x9b44('0x1f')](handleError(_0x596edb,null));};exports[_0x9b44('0xda')]=function(_0x4aa8b7,_0x14ee44){var _0x53824d={};var _0x20426a={};var _0x4c4d3c;var _0x401e32;return db[_0x9b44('0x3d')]['findOne']({'where':{'id':_0x4aa8b7['params']['id']}})[_0x9b44('0x17')](handleEntityNotFound(_0x14ee44,null))[_0x9b44('0x17')](function(_0x1f8e2d){if(_0x1f8e2d){_0x4c4d3c=_0x1f8e2d;_0x20426a[_0x9b44('0x57')]=_[_0x9b44('0x59')](db['UserVoiceQueueRt'][_0x9b44('0x5a')]);_0x20426a[_0x9b44('0x43')]=_[_0x9b44('0x59')](_0x4aa8b7['query']);_0x20426a[_0x9b44('0x5d')]=_[_0x9b44('0x5e')](_0x20426a['model'],_0x20426a[_0x9b44('0x43')]);_0x53824d[_0x9b44('0x47')]=_[_0x9b44('0x5e')](_0x20426a[_0x9b44('0x57')],qs[_0x9b44('0x5f')](_0x4aa8b7[_0x9b44('0x43')]['fields']));_0x53824d[_0x9b44('0x47')]=_0x53824d[_0x9b44('0x47')][_0x9b44('0x4c')]?_0x53824d['attributes']:_0x20426a[_0x9b44('0x57')];_0x53824d[_0x9b44('0xcc')]=qs['sort'](_0x4aa8b7['query'][_0x9b44('0xcd')]);_0x53824d[_0x9b44('0x42')]=qs[_0x9b44('0x5d')](_[_0x9b44('0xce')](_0x4aa8b7[_0x9b44('0x43')],_0x20426a[_0x9b44('0x5d')]));if(_0x4aa8b7['query'][_0x9b44('0x32')]){_0x53824d['where']=_['merge'](_0x53824d[_0x9b44('0x42')],{'$or':_[_0x9b44('0x34')](_0x53824d[_0x9b44('0x47')],function(_0x1e6948){var _0x5c740c={};_0x5c740c[_0x1e6948]={'$like':'%'+_0x4aa8b7[_0x9b44('0x43')][_0x9b44('0x32')]+'%'};return _0x5c740c;})});}_0x53824d=_[_0x9b44('0xcf')]({},_0x53824d,_0x4aa8b7['options']);return _0x4c4d3c[_0x9b44('0xda')](_0x53824d);}})[_0x9b44('0x17')](function(_0x536272){if(_0x536272){_0x401e32=_0x536272[_0x9b44('0x4c')];if(!_0x4aa8b7[_0x9b44('0x43')][_0x9b44('0xd0')](_0x9b44('0xd7'))){_0x53824d['limit']=qs[_0x9b44('0x25')](_0x4aa8b7[_0x9b44('0x43')]['limit']);_0x53824d[_0x9b44('0x23')]=qs['offset'](_0x4aa8b7[_0x9b44('0x43')]['offset']);}return _0x4c4d3c[_0x9b44('0xda')](_0x53824d);}})[_0x9b44('0x17')](function(_0x3fadc9){if(_0x3fadc9){return _0x3fadc9?{'count':_0x401e32,'rows':_0x3fadc9}:null;}})[_0x9b44('0x17')](respondWithResult(_0x14ee44,null))[_0x9b44('0x1f')](handleError(_0x14ee44,null));};exports[_0x9b44('0xdb')]=function(_0x462c24,_0x47e748){var _0x3f7edc={};var _0x294daa={};var _0x54d49a;var _0x401248;return db[_0x9b44('0x3d')][_0x9b44('0xcb')]({'where':{'id':_0x462c24[_0x9b44('0x56')]['id']}})['then'](handleEntityNotFound(_0x47e748,null))[_0x9b44('0x17')](function(_0x21727){if(_0x21727){_0x54d49a=_0x21727;_0x294daa['model']=_['keys'](db['ChatGroup'][_0x9b44('0x5a')]);_0x294daa['query']=_[_0x9b44('0x59')](_0x462c24[_0x9b44('0x43')]);_0x294daa[_0x9b44('0x5d')]=_[_0x9b44('0x5e')](_0x294daa[_0x9b44('0x57')],_0x294daa[_0x9b44('0x43')]);_0x3f7edc[_0x9b44('0x47')]=_[_0x9b44('0x5e')](_0x294daa['model'],qs[_0x9b44('0x5f')](_0x462c24[_0x9b44('0x43')][_0x9b44('0x5f')]));_0x3f7edc[_0x9b44('0x47')]=_0x3f7edc[_0x9b44('0x47')][_0x9b44('0x4c')]?_0x3f7edc['attributes']:_0x294daa[_0x9b44('0x57')];_0x3f7edc['order']=qs[_0x9b44('0xcd')](_0x462c24[_0x9b44('0x43')][_0x9b44('0xcd')]);_0x3f7edc[_0x9b44('0x42')]=qs[_0x9b44('0x5d')](_[_0x9b44('0xce')](_0x462c24[_0x9b44('0x43')],_0x294daa[_0x9b44('0x5d')]));if(_0x462c24['query'][_0x9b44('0x32')]){_0x3f7edc[_0x9b44('0x42')]=_[_0x9b44('0xcf')](_0x3f7edc['where'],{'$or':_[_0x9b44('0x34')](_0x3f7edc[_0x9b44('0x47')],function(_0x2af8cd){var _0x48a221={};_0x48a221[_0x2af8cd]={'$like':'%'+_0x462c24['query'][_0x9b44('0x32')]+'%'};return _0x48a221;})});}_0x3f7edc=_[_0x9b44('0xcf')]({},_0x3f7edc,_0x462c24['options']);return _0x54d49a[_0x9b44('0xdb')](_0x3f7edc);}})['then'](function(_0x3f0bfd){if(_0x3f0bfd){_0x401248=_0x3f0bfd[_0x9b44('0x4c')];if(!_0x462c24[_0x9b44('0x43')][_0x9b44('0xd0')]('nolimit')){_0x3f7edc['limit']=qs[_0x9b44('0x25')](_0x462c24[_0x9b44('0x43')][_0x9b44('0x25')]);_0x3f7edc[_0x9b44('0x23')]=qs['offset'](_0x462c24[_0x9b44('0x43')][_0x9b44('0x23')]);}return _0x54d49a['getGroups'](_0x3f7edc);}})[_0x9b44('0x17')](function(_0x2ca0c8){if(_0x2ca0c8){return _0x2ca0c8?{'count':_0x401248,'rows':_0x2ca0c8}:null;}})[_0x9b44('0x17')](respondWithResult(_0x47e748,null))[_0x9b44('0x1f')](handleError(_0x47e748,null));};exports[_0x9b44('0xdc')]=function(_0x20894f,_0x37b4de){var _0x5d2f75={'raw':!![],'where':{}};var _0x39c6df={};var _0x1cbec7={'count':0x0,'rows':[]};return db[_0x9b44('0x3d')][_0x9b44('0xcb')]({'where':{'id':_0x20894f[_0x9b44('0x56')]['id']}})[_0x9b44('0x17')](handleEntityNotFound(_0x37b4de,null))[_0x9b44('0x17')](function(_0x99305c){if(_0x99305c){_0x39c6df['model']=_[_0x9b44('0x59')](db['VoiceRecording']['rawAttributes']);_0x39c6df[_0x9b44('0x43')]=_[_0x9b44('0x59')](_0x20894f[_0x9b44('0x43')]);_0x39c6df[_0x9b44('0x5d')]=_[_0x9b44('0x5e')](_0x39c6df[_0x9b44('0x57')],_0x39c6df['query']);_0x5d2f75[_0x9b44('0x47')]=_[_0x9b44('0x5e')](_0x39c6df['model'],qs['fields'](_0x20894f['query'][_0x9b44('0x5f')]));_0x5d2f75['attributes']=_0x5d2f75[_0x9b44('0x47')]['length']?_0x5d2f75[_0x9b44('0x47')]:_0x39c6df['model'];if(!_0x20894f[_0x9b44('0x43')]['hasOwnProperty']('nolimit')){_0x5d2f75['limit']=qs[_0x9b44('0x25')](_0x20894f[_0x9b44('0x43')][_0x9b44('0x25')]);_0x5d2f75[_0x9b44('0x23')]=qs[_0x9b44('0x23')](_0x20894f[_0x9b44('0x43')][_0x9b44('0x23')]);}_0x5d2f75['order']=qs[_0x9b44('0xcd')](_0x20894f['query'][_0x9b44('0xcd')]);_0x5d2f75[_0x9b44('0x42')]=qs[_0x9b44('0x5d')](_['pick'](_0x20894f[_0x9b44('0x43')],_0x39c6df[_0x9b44('0x5d')]));_0x5d2f75[_0x9b44('0x42')][_0x9b44('0xdd')]=_0x99305c['id'];if(_0x20894f['query'][_0x9b44('0x32')]){_0x5d2f75[_0x9b44('0x42')]=_[_0x9b44('0xcf')](_0x5d2f75[_0x9b44('0x42')],{'$or':_[_0x9b44('0x34')](_0x5d2f75[_0x9b44('0x47')],function(_0x70ef58){var _0x5eddcf={};_0x5eddcf[_0x70ef58]={'$like':'%'+_0x20894f[_0x9b44('0x43')][_0x9b44('0x32')]+'%'};return _0x5eddcf;})});}_0x5d2f75=_['merge']({},_0x5d2f75,_0x20894f[_0x9b44('0x62')]);return db['VoiceRecording'][_0x9b44('0x26')]({'where':_0x5d2f75[_0x9b44('0x42')]})[_0x9b44('0x17')](function(_0x521f33){_0x1cbec7['count']=_0x521f33;if(_0x20894f[_0x9b44('0x43')][_0x9b44('0x60')]){_0x5d2f75['include']=[{'all':!![]}];}return db[_0x9b44('0xde')][_0x9b44('0x49')](_0x5d2f75);})[_0x9b44('0x17')](function(_0x19d445){_0x1cbec7[_0x9b44('0x4a')]=_0x19d445;return _0x1cbec7;});}})[_0x9b44('0x17')](respondWithFilteredResult(_0x37b4de,_0x5d2f75))['catch'](handleError(_0x37b4de,null));};exports[_0x9b44('0xdf')]=function(_0x3b715b,_0x109042){var _0x232aa6={'raw':!![],'where':{}};var _0x44c17f={};var _0x4746a8={'count':0x0,'rows':[]};return db[_0x9b44('0x3d')][_0x9b44('0xcb')]({'where':{'id':_0x3b715b[_0x9b44('0x56')]['id']}})[_0x9b44('0x17')](handleEntityNotFound(_0x109042,null))[_0x9b44('0x17')](function(_0x4cedfa){if(_0x4cedfa){_0x44c17f['model']=_[_0x9b44('0x59')](db[_0x9b44('0xe0')][_0x9b44('0x5a')]);_0x44c17f[_0x9b44('0x43')]=_[_0x9b44('0x59')](_0x3b715b[_0x9b44('0x43')]);_0x44c17f[_0x9b44('0x5d')]=_[_0x9b44('0x5e')](_0x44c17f[_0x9b44('0x57')],_0x44c17f[_0x9b44('0x43')]);_0x232aa6[_0x9b44('0x47')]=_['intersection'](_0x44c17f[_0x9b44('0x57')],qs['fields'](_0x3b715b['query'][_0x9b44('0x5f')]));_0x232aa6[_0x9b44('0x47')]=_0x232aa6[_0x9b44('0x47')][_0x9b44('0x4c')]?_0x232aa6[_0x9b44('0x47')]:_0x44c17f['model'];if(!_0x3b715b[_0x9b44('0x43')][_0x9b44('0xd0')]('nolimit')){_0x232aa6[_0x9b44('0x25')]=qs['limit'](_0x3b715b[_0x9b44('0x43')]['limit']);_0x232aa6['offset']=qs[_0x9b44('0x23')](_0x3b715b[_0x9b44('0x43')]['offset']);}_0x232aa6[_0x9b44('0xcc')]=qs['sort'](_0x3b715b['query']['sort']);_0x232aa6[_0x9b44('0x42')]=qs[_0x9b44('0x5d')](_[_0x9b44('0xce')](_0x3b715b[_0x9b44('0x43')],_0x44c17f[_0x9b44('0x5d')]));_0x232aa6['where'][_0x9b44('0xdd')]=_0x4cedfa['id'];if(_0x3b715b[_0x9b44('0x43')][_0x9b44('0x32')]){_0x232aa6['where']=_[_0x9b44('0xcf')](_0x232aa6[_0x9b44('0x42')],{'$or':_['map'](_0x232aa6['attributes'],function(_0x37a7e6){var _0x2ec918={};_0x2ec918[_0x37a7e6]={'$like':'%'+_0x3b715b['query']['filter']+'%'};return _0x2ec918;})});}_0x232aa6=_[_0x9b44('0xcf')]({},_0x232aa6,_0x3b715b[_0x9b44('0x62')]);return db[_0x9b44('0xe0')][_0x9b44('0x26')]({'where':_0x232aa6[_0x9b44('0x42')]})[_0x9b44('0x17')](function(_0x24fdf0){_0x4746a8[_0x9b44('0x26')]=_0x24fdf0;if(_0x3b715b[_0x9b44('0x43')][_0x9b44('0x60')]){_0x232aa6[_0x9b44('0x61')]=[{'all':!![]}];}return db['ScreenRecording'][_0x9b44('0x49')](_0x232aa6);})[_0x9b44('0x17')](function(_0x8a8e2e){_0x4746a8[_0x9b44('0x4a')]=_0x8a8e2e;return _0x4746a8;});}})[_0x9b44('0x17')](respondWithFilteredResult(_0x109042,_0x232aa6))[_0x9b44('0x1f')](handleError(_0x109042,null));};exports[_0x9b44('0xe1')]=function(_0xa02d2,_0x2029c5){var _0x47282e={};var _0x543c47={};var _0x1c6587;var _0xc411c7;return db[_0x9b44('0x3d')]['findOne']({'where':{'id':_0xa02d2['params']['id']}})[_0x9b44('0x17')](handleEntityNotFound(_0x2029c5,null))[_0x9b44('0x17')](function(_0x1c4239){if(_0x1c4239){_0x1c6587=_0x1c4239;_0x543c47[_0x9b44('0x57')]=_[_0x9b44('0x59')](db['ChatInteraction'][_0x9b44('0x5a')]);_0x543c47['query']=_[_0x9b44('0x59')](_0xa02d2[_0x9b44('0x43')]);_0x543c47[_0x9b44('0x5d')]=_[_0x9b44('0x5e')](_0x543c47[_0x9b44('0x57')],_0x543c47['query']);_0x47282e[_0x9b44('0x47')]=_[_0x9b44('0x5e')](_0x543c47[_0x9b44('0x57')],qs[_0x9b44('0x5f')](_0xa02d2[_0x9b44('0x43')][_0x9b44('0x5f')]));_0x47282e[_0x9b44('0x47')]=_0x47282e[_0x9b44('0x47')][_0x9b44('0x4c')]?_0x47282e[_0x9b44('0x47')]:_0x543c47[_0x9b44('0x57')];_0x47282e[_0x9b44('0xcc')]=qs[_0x9b44('0xcd')](_0xa02d2[_0x9b44('0x43')][_0x9b44('0xcd')]);_0x47282e[_0x9b44('0x42')]=qs[_0x9b44('0x5d')](_[_0x9b44('0xce')](_0xa02d2[_0x9b44('0x43')],_0x543c47[_0x9b44('0x5d')]));if(_0xa02d2[_0x9b44('0x43')]['filter']){_0x47282e[_0x9b44('0x42')]=_[_0x9b44('0xcf')](_0x47282e[_0x9b44('0x42')],{'$or':_[_0x9b44('0x34')](_0x47282e[_0x9b44('0x47')],function(_0x46e5b2){var _0x5612af={};_0x5612af[_0x46e5b2]={'$like':'%'+_0xa02d2[_0x9b44('0x43')][_0x9b44('0x32')]+'%'};return _0x5612af;})});}_0x47282e=_['merge']({},_0x47282e,_0xa02d2['options']);return _0x1c6587[_0x9b44('0xe1')](_0x47282e);}})[_0x9b44('0x17')](function(_0x101119){if(_0x101119){_0xc411c7=_0x101119[_0x9b44('0x4c')];if(!_0xa02d2[_0x9b44('0x43')][_0x9b44('0xd0')](_0x9b44('0xd7'))){_0x47282e[_0x9b44('0x25')]=qs['limit'](_0xa02d2[_0x9b44('0x43')]['limit']);_0x47282e[_0x9b44('0x23')]=qs[_0x9b44('0x23')](_0xa02d2[_0x9b44('0x43')][_0x9b44('0x23')]);}return _0x1c6587[_0x9b44('0xe1')](_0x47282e);}})[_0x9b44('0x17')](function(_0x227084){if(_0x227084){return _0x227084?{'count':_0xc411c7,'rows':_0x227084}:null;}})[_0x9b44('0x17')](respondWithResult(_0x2029c5,null))[_0x9b44('0x1f')](handleError(_0x2029c5,null));};exports[_0x9b44('0xe2')]=function(_0x198853,_0x19f616){var _0x1566bb={};var _0x57783d={};var _0x37e870;var _0x43a7b9;return db['User'][_0x9b44('0xcb')]({'where':{'id':_0x198853[_0x9b44('0x56')]['id']}})[_0x9b44('0x17')](handleEntityNotFound(_0x19f616,null))[_0x9b44('0x17')](function(_0x5d06ea){if(_0x5d06ea){_0x37e870=_0x5d06ea;_0x57783d[_0x9b44('0x57')]=_['keys'](db[_0x9b44('0xe3')][_0x9b44('0x5a')]);_0x57783d[_0x9b44('0x43')]=_[_0x9b44('0x59')](_0x198853[_0x9b44('0x43')]);_0x57783d[_0x9b44('0x5d')]=_[_0x9b44('0x5e')](_0x57783d[_0x9b44('0x57')],_0x57783d['query']);_0x1566bb[_0x9b44('0x47')]=_['intersection'](_0x57783d['model'],qs['fields'](_0x198853[_0x9b44('0x43')]['fields']));_0x1566bb['attributes']=_0x1566bb[_0x9b44('0x47')][_0x9b44('0x4c')]?_0x1566bb[_0x9b44('0x47')]:_0x57783d[_0x9b44('0x57')];_0x1566bb[_0x9b44('0xcc')]=qs[_0x9b44('0xcd')](_0x198853[_0x9b44('0x43')][_0x9b44('0xcd')]);_0x1566bb['where']=qs[_0x9b44('0x5d')](_['pick'](_0x198853[_0x9b44('0x43')],_0x57783d[_0x9b44('0x5d')]));if(_0x198853[_0x9b44('0x43')][_0x9b44('0x32')]){_0x1566bb['where']=_[_0x9b44('0xcf')](_0x1566bb['where'],{'$or':_[_0x9b44('0x34')](_0x1566bb['attributes'],function(_0x93fd3d){var _0x45f611={};_0x45f611[_0x93fd3d]={'$like':'%'+_0x198853['query']['filter']+'%'};return _0x45f611;})});}_0x1566bb=_[_0x9b44('0xcf')]({},_0x1566bb,_0x198853['options']);return _0x37e870[_0x9b44('0xe2')](_0x1566bb);}})[_0x9b44('0x17')](function(_0x468761){if(_0x468761){_0x43a7b9=_0x468761[_0x9b44('0x4c')];if(!_0x198853['query'][_0x9b44('0xd0')]('nolimit')){_0x1566bb[_0x9b44('0x25')]=qs[_0x9b44('0x25')](_0x198853[_0x9b44('0x43')][_0x9b44('0x25')]);_0x1566bb[_0x9b44('0x23')]=qs[_0x9b44('0x23')](_0x198853[_0x9b44('0x43')][_0x9b44('0x23')]);}return _0x37e870[_0x9b44('0xe2')](_0x1566bb);}})[_0x9b44('0x17')](function(_0x2c44e0){if(_0x2c44e0){return _0x2c44e0?{'count':_0x43a7b9,'rows':_0x2c44e0}:null;}})[_0x9b44('0x17')](respondWithResult(_0x19f616,null))['catch'](handleError(_0x19f616,null));};exports[_0x9b44('0xe4')]=function(_0x30aa13,_0x2f70b5){var _0x1fe3d1={'raw':!![],'where':{}};var _0x4bd72b={};var _0x1daec0={'count':0x0,'rows':[]};return db[_0x9b44('0x3d')][_0x9b44('0xcb')]({'where':{'id':_0x30aa13[_0x9b44('0x56')]['id']}})[_0x9b44('0x17')](handleEntityNotFound(_0x2f70b5,null))[_0x9b44('0x17')](function(_0x3cc661){if(_0x3cc661){_0x4bd72b[_0x9b44('0x57')]=_[_0x9b44('0x59')](db[_0x9b44('0xe5')]['rawAttributes']);_0x4bd72b[_0x9b44('0x43')]=_[_0x9b44('0x59')](_0x30aa13[_0x9b44('0x43')]);_0x4bd72b[_0x9b44('0x5d')]=_[_0x9b44('0x5e')](_0x4bd72b['model'],_0x4bd72b['query']);_0x1fe3d1[_0x9b44('0x47')]=_['intersection'](_0x4bd72b['model'],qs['fields'](_0x30aa13[_0x9b44('0x43')][_0x9b44('0x5f')]));_0x1fe3d1[_0x9b44('0x47')]=_0x1fe3d1[_0x9b44('0x47')][_0x9b44('0x4c')]?_0x1fe3d1['attributes']:_0x4bd72b[_0x9b44('0x57')];if(!_0x30aa13[_0x9b44('0x43')][_0x9b44('0xd0')](_0x9b44('0xd7'))){_0x1fe3d1[_0x9b44('0x25')]=qs['limit'](_0x30aa13[_0x9b44('0x43')][_0x9b44('0x25')]);_0x1fe3d1[_0x9b44('0x23')]=qs[_0x9b44('0x23')](_0x30aa13['query'][_0x9b44('0x23')]);}_0x1fe3d1['order']=qs['sort'](_0x30aa13[_0x9b44('0x43')][_0x9b44('0xcd')]);_0x1fe3d1[_0x9b44('0x42')]=qs[_0x9b44('0x5d')](_[_0x9b44('0xce')](_0x30aa13['query'],_0x4bd72b[_0x9b44('0x5d')]));_0x1fe3d1[_0x9b44('0x42')][_0x9b44('0xdd')]=_0x3cc661['id'];if(_0x30aa13[_0x9b44('0x43')][_0x9b44('0x32')]){_0x1fe3d1[_0x9b44('0x42')]=_['merge'](_0x1fe3d1['where'],{'$or':_[_0x9b44('0x34')](_0x1fe3d1[_0x9b44('0x47')],function(_0x384ecd){var _0x1c8987={};_0x1c8987[_0x384ecd]={'$like':'%'+_0x30aa13[_0x9b44('0x43')][_0x9b44('0x32')]+'%'};return _0x1c8987;})});}_0x1fe3d1=_[_0x9b44('0xcf')]({},_0x1fe3d1,_0x30aa13[_0x9b44('0x62')]);return db[_0x9b44('0xe5')][_0x9b44('0x26')]({'where':_0x1fe3d1[_0x9b44('0x42')]})[_0x9b44('0x17')](function(_0x379c64){_0x1daec0[_0x9b44('0x26')]=_0x379c64;if(_0x30aa13['query'][_0x9b44('0x60')]){_0x1fe3d1['include']=[{'all':!![]}];}return db[_0x9b44('0xe5')][_0x9b44('0x49')](_0x1fe3d1);})[_0x9b44('0x17')](function(_0xe59014){_0x1daec0[_0x9b44('0x4a')]=_0xe59014;return _0x1daec0;});}})[_0x9b44('0x17')](respondWithFilteredResult(_0x2f70b5,_0x1fe3d1))[_0x9b44('0x1f')](handleError(_0x2f70b5,null));};exports['getSmsInteractions']=function(_0x4b877d,_0x156abd){var _0x428219={};var _0x18013c={};var _0x48cb20;var _0x24aeb7;return db['User'][_0x9b44('0xcb')]({'where':{'id':_0x4b877d[_0x9b44('0x56')]['id']}})[_0x9b44('0x17')](handleEntityNotFound(_0x156abd,null))[_0x9b44('0x17')](function(_0x377abc){if(_0x377abc){_0x48cb20=_0x377abc;_0x18013c[_0x9b44('0x57')]=_[_0x9b44('0x59')](db['SmsInteraction'][_0x9b44('0x5a')]);_0x18013c[_0x9b44('0x43')]=_[_0x9b44('0x59')](_0x4b877d[_0x9b44('0x43')]);_0x18013c['filters']=_['intersection'](_0x18013c[_0x9b44('0x57')],_0x18013c[_0x9b44('0x43')]);_0x428219[_0x9b44('0x47')]=_[_0x9b44('0x5e')](_0x18013c[_0x9b44('0x57')],qs['fields'](_0x4b877d[_0x9b44('0x43')]['fields']));_0x428219[_0x9b44('0x47')]=_0x428219['attributes'][_0x9b44('0x4c')]?_0x428219['attributes']:_0x18013c['model'];_0x428219[_0x9b44('0xcc')]=qs[_0x9b44('0xcd')](_0x4b877d[_0x9b44('0x43')][_0x9b44('0xcd')]);_0x428219[_0x9b44('0x42')]=qs[_0x9b44('0x5d')](_[_0x9b44('0xce')](_0x4b877d[_0x9b44('0x43')],_0x18013c['filters']));if(_0x4b877d['query']['filter']){_0x428219[_0x9b44('0x42')]=_[_0x9b44('0xcf')](_0x428219[_0x9b44('0x42')],{'$or':_[_0x9b44('0x34')](_0x428219['attributes'],function(_0x2a3777){var _0x2a6696={};_0x2a6696[_0x2a3777]={'$like':'%'+_0x4b877d[_0x9b44('0x43')]['filter']+'%'};return _0x2a6696;})});}_0x428219=_[_0x9b44('0xcf')]({},_0x428219,_0x4b877d[_0x9b44('0x62')]);return _0x48cb20[_0x9b44('0xe6')](_0x428219);}})[_0x9b44('0x17')](function(_0x4ecfce){if(_0x4ecfce){_0x24aeb7=_0x4ecfce['length'];if(!_0x4b877d[_0x9b44('0x43')][_0x9b44('0xd0')](_0x9b44('0xd7'))){_0x428219['limit']=qs[_0x9b44('0x25')](_0x4b877d[_0x9b44('0x43')]['limit']);_0x428219[_0x9b44('0x23')]=qs['offset'](_0x4b877d[_0x9b44('0x43')][_0x9b44('0x23')]);}return _0x48cb20[_0x9b44('0xe6')](_0x428219);}})[_0x9b44('0x17')](function(_0x4d9773){if(_0x4d9773){return _0x4d9773?{'count':_0x24aeb7,'rows':_0x4d9773}:null;}})[_0x9b44('0x17')](respondWithResult(_0x156abd,null))[_0x9b44('0x1f')](handleError(_0x156abd,null));};exports[_0x9b44('0xe7')]=function(_0x17d237,_0x2b2b46){var _0x3ad785={};var _0x1cdf42={};var _0x4cbe59;var _0x448069;return db['User'][_0x9b44('0xcb')]({'where':{'id':_0x17d237[_0x9b44('0x56')]['id']}})[_0x9b44('0x17')](handleEntityNotFound(_0x2b2b46,null))['then'](function(_0x560a6f){if(_0x560a6f){_0x4cbe59=_0x560a6f;_0x1cdf42['model']=_[_0x9b44('0x59')](db['FaxInteraction']['rawAttributes']);_0x1cdf42[_0x9b44('0x43')]=_[_0x9b44('0x59')](_0x17d237['query']);_0x1cdf42['filters']=_['intersection'](_0x1cdf42['model'],_0x1cdf42['query']);_0x3ad785['attributes']=_['intersection'](_0x1cdf42[_0x9b44('0x57')],qs['fields'](_0x17d237['query']['fields']));_0x3ad785[_0x9b44('0x47')]=_0x3ad785[_0x9b44('0x47')][_0x9b44('0x4c')]?_0x3ad785[_0x9b44('0x47')]:_0x1cdf42[_0x9b44('0x57')];_0x3ad785['order']=qs[_0x9b44('0xcd')](_0x17d237['query'][_0x9b44('0xcd')]);_0x3ad785[_0x9b44('0x42')]=qs['filters'](_['pick'](_0x17d237[_0x9b44('0x43')],_0x1cdf42[_0x9b44('0x5d')]));if(_0x17d237['query'][_0x9b44('0x32')]){_0x3ad785['where']=_[_0x9b44('0xcf')](_0x3ad785[_0x9b44('0x42')],{'$or':_[_0x9b44('0x34')](_0x3ad785[_0x9b44('0x47')],function(_0x5d8239){var _0x58d9be={};_0x58d9be[_0x5d8239]={'$like':'%'+_0x17d237[_0x9b44('0x43')][_0x9b44('0x32')]+'%'};return _0x58d9be;})});}_0x3ad785=_[_0x9b44('0xcf')]({},_0x3ad785,_0x17d237['options']);return _0x4cbe59['getFaxInteractions'](_0x3ad785);}})[_0x9b44('0x17')](function(_0x355866){if(_0x355866){_0x448069=_0x355866[_0x9b44('0x4c')];if(!_0x17d237[_0x9b44('0x43')][_0x9b44('0xd0')](_0x9b44('0xd7'))){_0x3ad785['limit']=qs['limit'](_0x17d237[_0x9b44('0x43')]['limit']);_0x3ad785[_0x9b44('0x23')]=qs[_0x9b44('0x23')](_0x17d237[_0x9b44('0x43')]['offset']);}return _0x4cbe59['getFaxInteractions'](_0x3ad785);}})[_0x9b44('0x17')](function(_0x671958){if(_0x671958){return _0x671958?{'count':_0x448069,'rows':_0x671958}:null;}})[_0x9b44('0x17')](respondWithResult(_0x2b2b46,null))[_0x9b44('0x1f')](handleError(_0x2b2b46,null));};exports[_0x9b44('0xe8')]=function(_0x11c473,_0x2bb52c){var _0x4a1e39={};var _0x2e53a9={};var _0x8977df;var _0xe20893;return db[_0x9b44('0x3d')][_0x9b44('0xcb')]({'where':{'id':_0x11c473[_0x9b44('0x56')]['id']}})['then'](handleEntityNotFound(_0x2bb52c,null))[_0x9b44('0x17')](function(_0x10df79){if(_0x10df79){_0x8977df=_0x10df79;_0x2e53a9['model']=_[_0x9b44('0x59')](db[_0x9b44('0xe9')][_0x9b44('0x5a')]);_0x2e53a9[_0x9b44('0x43')]=_[_0x9b44('0x59')](_0x11c473[_0x9b44('0x43')]);_0x2e53a9[_0x9b44('0x5d')]=_[_0x9b44('0x5e')](_0x2e53a9[_0x9b44('0x57')],_0x2e53a9['query']);_0x4a1e39[_0x9b44('0x47')]=_[_0x9b44('0x5e')](_0x2e53a9[_0x9b44('0x57')],qs['fields'](_0x11c473[_0x9b44('0x43')][_0x9b44('0x5f')]));_0x4a1e39[_0x9b44('0x47')]=_0x4a1e39[_0x9b44('0x47')][_0x9b44('0x4c')]?_0x4a1e39['attributes']:_0x2e53a9[_0x9b44('0x57')];_0x4a1e39[_0x9b44('0xcc')]=qs['sort'](_0x11c473[_0x9b44('0x43')]['sort']);_0x4a1e39['where']=qs[_0x9b44('0x5d')](_['pick'](_0x11c473[_0x9b44('0x43')],_0x2e53a9[_0x9b44('0x5d')]));if(_0x11c473[_0x9b44('0x43')]['filter']){_0x4a1e39['where']=_[_0x9b44('0xcf')](_0x4a1e39[_0x9b44('0x42')],{'$or':_[_0x9b44('0x34')](_0x4a1e39[_0x9b44('0x47')],function(_0x5854d4){var _0x56dfcb={};_0x56dfcb[_0x5854d4]={'$like':'%'+_0x11c473[_0x9b44('0x43')][_0x9b44('0x32')]+'%'};return _0x56dfcb;})});}_0x4a1e39=_[_0x9b44('0xcf')]({},_0x4a1e39,_0x11c473[_0x9b44('0x62')]);return _0x8977df[_0x9b44('0xe8')](_0x4a1e39);}})[_0x9b44('0x17')](function(_0x37a509){if(_0x37a509){_0xe20893=_0x37a509['length'];if(!_0x11c473[_0x9b44('0x43')]['hasOwnProperty'](_0x9b44('0xd7'))){_0x4a1e39['limit']=qs[_0x9b44('0x25')](_0x11c473[_0x9b44('0x43')][_0x9b44('0x25')]);_0x4a1e39[_0x9b44('0x23')]=qs[_0x9b44('0x23')](_0x11c473[_0x9b44('0x43')][_0x9b44('0x23')]);}return _0x8977df['getWhatsappInteractions'](_0x4a1e39);}})['then'](function(_0x2b0612){if(_0x2b0612){return _0x2b0612?{'count':_0xe20893,'rows':_0x2b0612}:null;}})[_0x9b44('0x17')](respondWithResult(_0x2bb52c,null))[_0x9b44('0x1f')](handleError(_0x2bb52c,null));};exports['login']=function(_0x2b7a18,_0x4db032,_0x4da05a){var _0x3845e5;var _0x3cc011;var _0xbddaf9;var _0x3e8262=!_[_0x9b44('0x6c')](_0x2b7a18[_0x9b44('0x56')]['id'])?_0x2b7a18['params']['id']:!_[_0x9b44('0x6c')](_0x2b7a18[_0x9b44('0x2e')]['id'])?_0x2b7a18[_0x9b44('0x2e')]['id']:null;return db[_0x9b44('0x3d')][_0x9b44('0x37')]({'where':{'id':_0x3e8262,'role':{'$or':[_0x9b44('0x82'),'user','agent']}},'attributes':['id','name',_0x9b44('0xea'),'mobile',_0x9b44('0x29'),_0x9b44('0x67'),'loginInPause']})[_0x9b44('0x17')](function(_0x2b1cca){if(_0x2b1cca){if(_0x2b1cca[_0x9b44('0x29')]==='agent'){_0x3845e5=_0x2b1cca;if(_0x2b7a18['body'][_0x9b44('0xac')]){_0xbddaf9=util[_0x9b44('0xad')](_0x9b44('0xeb'),_0x3845e5[_0x2b7a18['body']['interface']]);}else if(_0x2b7a18[_0x9b44('0x63')]['intrf']){_0xbddaf9=util['format'](_0x9b44('0xae'),_0x2b7a18[_0x9b44('0x63')][_0x9b44('0xec')]);}else{_0xbddaf9=util[_0x9b44('0xad')](_0x9b44('0xae'),_0x3845e5[_0x9b44('0x38')]);}socket['to'](util[_0x9b44('0xad')]('user:%s',_0x3845e5['name']))[_0x9b44('0x2b')]('user:forcelogout',{'user':{'id':_0x3845e5['id'],'name':_0x3845e5[_0x9b44('0x38')]},'ip':_0x2b7a18[_0x9b44('0xed')][_0x9b44('0xee')]||_0x2b7a18[_0x9b44('0xef')][_0x9b44('0xf0')]||_0x2b7a18[_0x9b44('0xf1')]['remoteAddress']||_0x2b7a18[_0x9b44('0xef')][_0x9b44('0xf1')]['remoteAddress']});return db[_0x9b44('0xb0')][_0x9b44('0x39')]({'where':{'membername':_0x3845e5['name']},'individualHooks':!![]});}}else{throw new db[(_0x9b44('0x94'))][(_0x9b44('0x97'))](_0x9b44('0xf2'));}})[_0x9b44('0x17')](function(){if(_0x3845e5){return _0x3845e5[_0x9b44('0xf3')]({'raw':!![]});}})[_0x9b44('0x17')](function(_0x154a32){if(_0x3845e5){if(_0x154a32){_0x3cc011=_0x154a32;if(_0x3cc011['length']){var _0x75ec0a=_0x3cc011['map'](function(_0x483696){var _0x36938a={'membername':_0x3845e5['name'],'UserId':_0x3845e5['id'],'queue_name':_0x483696[_0x9b44('0x38')],'VoiceQueueId':_0x483696['id'],'interface':_0xbddaf9,'paused':_0x3845e5[_0x9b44('0xa1')]||![],'penalty':_0x483696['UserVoiceQueue.penalty']||0x0};return db[_0x9b44('0xb0')][_0x9b44('0xb1')](_0x36938a);});return Promise[_0x9b44('0x54')](_0x75ec0a);}}}})[_0x9b44('0x17')](function(){if(_0x3845e5){return db[_0x9b44('0xf4')]['findAll']({'where':{'membername':_0x3845e5['name'],'exitAt':null}});}})['then'](function(_0x1d6e73){if(_0x3845e5){var _0x497bfd=[];_0x1d6e73[_0x9b44('0xf5')](function(_0x1076b6){_0x497bfd['push'](_0x1076b6['update']({'exitAt':moment()['format'](_0x9b44('0xf6'))}));});return Promise['all'](_0x497bfd);}})[_0x9b44('0x17')](function(){if(_0x3845e5){var _0x305207=[];var _0x373b95=[];var _0x485cc5=utils[_0x9b44('0xf7')]();var _0x40b8b0={'membername':_0x3845e5[_0x9b44('0x38')],'interface':_0xbddaf9,'enterAt':moment()[_0x9b44('0xad')](_0x9b44('0xf6')),'role':_0x3845e5[_0x9b44('0x29')],'internal':_0x3845e5[_0x9b44('0x67')]};_0x485cc5[_0x9b44('0xf5')](function(_0x9bd5c2){_0x305207[_0x9b44('0x48')](_[_0x9b44('0xcf')]({'channel':_0x9bd5c2,'type':'LOGIN','data1':_0x2b7a18[_0x9b44('0x63')]['device'],'data2':_0xbddaf9},_0x40b8b0));if(_0x3845e5[_0x9b44('0xa1')]){_0x373b95[_0x9b44('0x48')](_[_0x9b44('0xcf')]({'channel':_0x9bd5c2,'type':_0x9b44('0xf8'),'data1':_0x9b44('0xf9')},_0x40b8b0));}});return db[_0x9b44('0xf4')][_0x9b44('0xfa')](_0x305207[_0x9b44('0xfb')](_0x373b95),{'individualHooks':!![]});}})[_0x9b44('0x17')](function(){if(_0x3845e5){return _0x3845e5[_0x9b44('0x28')]({'online':!![],'lastLoginAt':moment()[_0x9b44('0xad')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x3845e5[_0x9b44('0xa1')]||![],'mailPause':_0x3845e5[_0x9b44('0xa1')]||![],'chatPause':_0x3845e5[_0x9b44('0xa1')]||![],'faxPause':_0x3845e5['loginInPause']||![],'smsPause':_0x3845e5['loginInPause']||![],'openchannelPause':_0x3845e5['loginInPause']||![],'whatsappPause':_0x3845e5[_0x9b44('0xa1')]||![],'pauseType':_0x3845e5[_0x9b44('0xa1')]?'LOGININPAUSE':null,'interface':_0xbddaf9,'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x9b44('0x17')](function(_0x56639d){if(_0x2b7a18['isMiddleware']){return _0x4da05a();}else{return Promise[_0x9b44('0xfc')](_0x56639d)[_0x9b44('0x17')](respondWithResult(_0x4db032,null));}})[_0x9b44('0x1f')](handleError(_0x4db032,null));};exports[_0x9b44('0xfd')]=function(_0x3e3c1b,_0x5cea85){var _0x56d9b5;return db[_0x9b44('0x3d')][_0x9b44('0x37')]({'where':{'id':_0x3e3c1b[_0x9b44('0x56')]['id'],'role':_0x9b44('0x2a')},'attributes':['id',_0x9b44('0x38'),'role']})[_0x9b44('0x17')](handleEntityNotFound(_0x5cea85,null))['then'](function(_0x52cb52){if(_0x52cb52){_0x56d9b5=_0x52cb52;return db[_0x9b44('0xb0')]['destroy']({'where':{'membername':_0x56d9b5[_0x9b44('0x38')]},'individualHooks':!![]});}})[_0x9b44('0x17')](function(){return db[_0x9b44('0xf4')][_0x9b44('0x49')]({'where':{'membername':_0x56d9b5[_0x9b44('0x38')],'exitAt':null}});})[_0x9b44('0x17')](function(_0x4fc976){var _0x20c710=[];_0x4fc976[_0x9b44('0xf5')](function(_0x30597f){_0x20c710[_0x9b44('0x48')](_0x30597f[_0x9b44('0x28')]({'exitAt':moment()[_0x9b44('0xad')]('YYYY-MM-DD\x20HH:mm:ss')}));});return Promise[_0x9b44('0x54')](_0x20c710);})['then'](function(){return _0x56d9b5[_0x9b44('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})[_0x9b44('0x17')](respondWithResult(_0x5cea85,null))[_0x9b44('0x1f')](handleError(_0x5cea85,null));};exports[_0x9b44('0xfe')]=function(_0x3b6766,_0x44dda6){var _0x32819c;return db[_0x9b44('0xb0')][_0x9b44('0x28')]({'paused':0x1},{'where':{'UserId':_0x3b6766['params']['id']},'individualHooks':!![]})[_0x9b44('0x17')](function(){return db[_0x9b44('0x3d')]['find']({'where':{'id':_0x3b6766[_0x9b44('0x56')]['id'],'role':_0x9b44('0x2a')},'attributes':['id',_0x9b44('0x38'),_0x9b44('0x29'),_0x9b44('0x67'),'interface',_0x9b44('0xab')]});})[_0x9b44('0x17')](handleEntityNotFound(_0x44dda6,null))['then'](function(_0x139078){if(_0x139078){_0x32819c=_0x139078;return respondWithRpcPromise(_0x9b44('0xff'),'pause',{'id':_0x32819c['id'],'name':_0x32819c['name'],'pause':!![]});}})[_0x9b44('0x17')](function(){if(_0x32819c){return db[_0x9b44('0xf4')][_0x9b44('0x49')]({'where':{'membername':_0x32819c[_0x9b44('0x38')],'type':_0x9b44('0xf8'),'exitAt':null}});}})[_0x9b44('0x17')](function(_0x490129){if(_0x490129['length']){var _0x577b02=moment()[_0x9b44('0xad')](_0x9b44('0xf6'));for(var _0x58fcc4=0x0,_0x58df9a=_0x490129[_0x9b44('0x4c')];_0x58fcc4<_0x58df9a;_0x58fcc4++){_0x490129[_0x58fcc4]['updateAttributes']({'exitAt':_0x577b02});}}})[_0x9b44('0x17')](function(){var _0x527ebf=[];var _0xec3bc3=utils[_0x9b44('0xf7')]();_0xec3bc3[_0x9b44('0xf5')](function(_0x22e4b0){_0x527ebf[_0x9b44('0x48')]({'channel':_0x22e4b0,'membername':_0x32819c[_0x9b44('0x38')],'interface':_[_0x9b44('0x6c')](_0x32819c[_0x9b44('0xac')])?util[_0x9b44('0xad')]('SIP/%s',_0x32819c[_0x9b44('0x38')]):_0x32819c[_0x9b44('0xac')],'type':_0x9b44('0xf8'),'enterAt':moment()[_0x9b44('0xad')](_0x9b44('0xf6')),'data1':_0x3b6766[_0x9b44('0x63')][_0x9b44('0x3f')]||'DEFAULT\x20PAUSE','role':_0x32819c[_0x9b44('0x29')],'internal':_0x32819c['internal']});});return db[_0x9b44('0xf4')][_0x9b44('0xfa')](_0x527ebf,{'individualHooks':!![]});})[_0x9b44('0x17')](function(){return _0x32819c[_0x9b44('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x3b6766[_0x9b44('0x63')]['type']||_0x9b44('0x100'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x9b44('0x17')](respondWithResult(_0x44dda6,null))[_0x9b44('0x1f')](handleError(_0x44dda6,null));};exports[_0x9b44('0x101')]=function(_0x92d0a1,_0x276d96){if(_0x92d0a1[_0x9b44('0x63')][_0x9b44('0xa0')]&&!utils['isValidChannel'](_0x92d0a1['body'][_0x9b44('0xa0')])){throw new APIBadRequestError(util[_0x9b44('0xad')]('Channel\x20parameter\x20%s\x20is\x20invalid',_0x92d0a1[_0x9b44('0x63')][_0x9b44('0xa0')]));}return db[_0x9b44('0x3d')][_0x9b44('0x37')]({'where':{'id':_0x92d0a1[_0x9b44('0x56')]['id']},'attributes':['id',_0x9b44('0x38'),'role',_0x9b44('0x67'),_0x9b44('0xac'),'online',_0x9b44('0xaf'),_0x9b44('0x102'),'chatPause',_0x9b44('0x103'),_0x9b44('0x104'),_0x9b44('0x105'),_0x9b44('0x106'),_0x9b44('0x107'),_0x9b44('0x108')]})['then'](function(_0x443188){if(!_0x443188){throw new APINotFoundError(util[_0x9b44('0xad')](_0x9b44('0x109'),_0x92d0a1[_0x9b44('0x56')]['id']));}return _0x443188[_0x9b44('0x101')](_0x92d0a1['body'][_0x9b44('0xa0')]);})[_0x9b44('0x17')](respondWithResult(_0x276d96,null))[_0x9b44('0x1f')](APIHandleError(_0x276d96));};exports[_0x9b44('0x10a')]=function(_0x1acefa,_0x1c05a6){var _0x7d825b={};var _0x41c807={};var _0x29b1f6;var _0x58f81b;return db[_0x9b44('0x3d')][_0x9b44('0xcb')]({'where':{'id':_0x1acefa[_0x9b44('0x56')]['id']}})[_0x9b44('0x17')](handleEntityNotFound(_0x1c05a6,null))[_0x9b44('0x17')](function(_0x560894){if(_0x560894){_0x29b1f6=_0x560894;_0x41c807[_0x9b44('0x57')]=_[_0x9b44('0x59')](db['Team']['rawAttributes']);_0x41c807[_0x9b44('0x43')]=_[_0x9b44('0x59')](_0x1acefa[_0x9b44('0x43')]);_0x41c807['filters']=_['intersection'](_0x41c807[_0x9b44('0x57')],_0x41c807[_0x9b44('0x43')]);_0x7d825b[_0x9b44('0x47')]=_['intersection'](_0x41c807['model'],qs[_0x9b44('0x5f')](_0x1acefa[_0x9b44('0x43')][_0x9b44('0x5f')]));_0x7d825b[_0x9b44('0x47')]=_0x7d825b['attributes'][_0x9b44('0x4c')]?_0x7d825b[_0x9b44('0x47')]:_0x41c807[_0x9b44('0x57')];_0x7d825b[_0x9b44('0xcc')]=qs[_0x9b44('0xcd')](_0x1acefa[_0x9b44('0x43')][_0x9b44('0xcd')]);_0x7d825b[_0x9b44('0x42')]=qs[_0x9b44('0x5d')](_[_0x9b44('0xce')](_0x1acefa[_0x9b44('0x43')],_0x41c807[_0x9b44('0x5d')]));if(_0x1acefa[_0x9b44('0x43')][_0x9b44('0x32')]){_0x7d825b[_0x9b44('0x42')]=_[_0x9b44('0xcf')](_0x7d825b[_0x9b44('0x42')],{'$or':_[_0x9b44('0x34')](_0x7d825b[_0x9b44('0x47')],function(_0xbce6c6){var _0x44bf42={};_0x44bf42[_0xbce6c6]={'$like':'%'+_0x1acefa['query'][_0x9b44('0x32')]+'%'};return _0x44bf42;})});}_0x7d825b=_[_0x9b44('0xcf')]({},_0x7d825b,_0x1acefa['options']);return _0x29b1f6[_0x9b44('0x10a')](_0x7d825b);}})[_0x9b44('0x17')](function(_0x3ecfd4){if(_0x3ecfd4){_0x58f81b=_0x3ecfd4[_0x9b44('0x4c')];if(!_0x1acefa[_0x9b44('0x43')][_0x9b44('0xd0')]('nolimit')){_0x7d825b['limit']=qs[_0x9b44('0x25')](_0x1acefa['query'][_0x9b44('0x25')]);_0x7d825b[_0x9b44('0x23')]=qs[_0x9b44('0x23')](_0x1acefa[_0x9b44('0x43')][_0x9b44('0x23')]);}return _0x29b1f6[_0x9b44('0x10a')](_0x7d825b);}})['then'](function(_0x4f29bf){if(_0x4f29bf){return _0x4f29bf?{'count':_0x58f81b,'rows':_0x4f29bf}:null;}})['then'](respondWithResult(_0x1c05a6,null))[_0x9b44('0x1f')](handleError(_0x1c05a6,null));};exports['addTeams']=function(_0x2109d8,_0x3f7fc5){var _0x3b8558=_0x2109d8['params']['id'];var _0x1a2247=_0x2109d8[_0x9b44('0x63')]?_0x2109d8['body'][_0x9b44('0x66')]:null;var _0x1b009a=[];return Promise[_0x9b44('0xfc')]()[_0x9b44('0x17')](function(){if(!_0x1a2247)throw new APIBadRequestError(_0x9b44('0x10b'));})[_0x9b44('0x17')](function(){return db[_0x9b44('0x3d')]['findOne']({'where':{'id':_0x3b8558}});})[_0x9b44('0x17')](function(_0x15c315){if(!_0x15c315)throw new APINotFoundError(util[_0x9b44('0xad')](_0x9b44('0x109'),_0x2109d8[_0x9b44('0x56')]['id']));return db[_0x9b44('0x6d')][_0x9b44('0x10c')](function(_0x1963e2){return _0x15c315[_0x9b44('0x10d')](_0x1a2247,{'transaction':_0x1963e2})[_0x9b44('0x17')](function(){return db[_0x9b44('0x10e')]['findAll']({'where':{'id':{'$in':_0x1a2247}}});})[_0x9b44('0x17')](function(_0x4329ca){var _0x2633cc=_[_0x9b44('0x34')](_0x4329ca,function(_0x3c917a){return _0x3c917a[_0x9b44('0x10f')]();});return Promise[_0x9b44('0x54')](_0x2633cc);})[_0x9b44('0x17')](function(_0x299693){_0x1b009a=_[_0x9b44('0x110')](_0x299693);var _0x172ff0=_[_0x9b44('0x34')](_0x1b009a,function(_0x2cc464){return _0x2cc464['addAgent'](_0x15c315['id'],{'transaction':_0x1963e2});});return Promise[_0x9b44('0x54')](_0x172ff0);})[_0x9b44('0x17')](function(){if(!_0x15c315[_0x9b44('0xab')])return;var _0x29235b=_['filter'](_0x1b009a,function(_0x5a24d1){return _0x5a24d1[_0x9b44('0x111')]('channel')===_0x9b44('0x112');});var _0x4504bb=_[_0x9b44('0x34')](_0x29235b,function(_0x5d3d28){return db['UserVoiceQueueRt'][_0x9b44('0xb1')]({'membername':_0x15c315[_0x9b44('0x38')],'UserId':_0x15c315['id'],'queue_name':_0x5d3d28[_0x9b44('0x38')],'VoiceQueueId':_0x5d3d28['id'],'interface':_[_0x9b44('0x6c')](_0x15c315[_0x9b44('0xac')])?util[_0x9b44('0xad')](_0x9b44('0xae'),_0x15c315[_0x9b44('0x38')]):_0x15c315['interface'],'paused':_0x15c315[_0x9b44('0xaf')]||![],'penalty':_0x15c315[_0x9b44('0xa7')]},{'transaction':_0x1963e2});});return Promise[_0x9b44('0x54')](_0x4504bb);})[_0x9b44('0x17')](function(){return db[_0x9b44('0x113')]['findAll']({'where':{'teamId':{'$in':_0x1a2247}}});})[_0x9b44('0x17')](function(_0x213628){var _0x212bee=_[_0x9b44('0x34')](_0x213628,function(_0x1dbc0){return db[_0x9b44('0x114')]['create']({'UserId':_0x15c315['id'],'VoicePrefixId':_0x1dbc0['VoicePrefixId']},{'transaction':_0x1963e2});});return Promise['all'](_0x212bee);});});})[_0x9b44('0x17')](function(){for(var _0x210c3e=0x0;_0x210c3e<_0x1b009a[_0x9b44('0x4c')];_0x210c3e++){var _0xab1552=_0x1b009a[_0x210c3e][_0x9b44('0x111')]('channel');var _0x13d8db=_0xab1552+_0x9b44('0xa8');socket[_0x9b44('0x2b')](_0x9b44('0x2e')+_0xab1552+_0x9b44('0xa9'),{'UserId':_0x3b8558,['queueField']:_0x1b009a[_0x210c3e]['id']});}})[_0x9b44('0x17')](respondWithStatusCode(_0x3f7fc5,null))['catch'](APIHandleError(_0x3f7fc5));};exports[_0x9b44('0x115')]=function(_0xa7aac6,_0x4f885d){var _0x27aeb3=_0xa7aac6[_0x9b44('0x56')]['id'];var _0x120270=null;if(_0xa7aac6['query']['ids']){_0x120270=_[_0x9b44('0xb4')](_0xa7aac6[_0x9b44('0x43')][_0x9b44('0x66')])?_0xa7aac6[_0x9b44('0x43')][_0x9b44('0x66')]:[_0xa7aac6[_0x9b44('0x43')][_0x9b44('0x66')]];}var _0x866737=[];return Promise[_0x9b44('0xfc')]()[_0x9b44('0x17')](function(){if(!_0x120270)throw new APIBadRequestError(_0x9b44('0x116'));})[_0x9b44('0x17')](function(){return db[_0x9b44('0x3d')][_0x9b44('0xcb')]({'where':{'id':_0x27aeb3}});})['then'](function(_0x1d1b92){if(!_0x1d1b92)throw new APINotFoundError(util[_0x9b44('0xad')]('User\x20with\x20id\x20%s\x20not\x20found',_0xa7aac6['params']['id']));return db['sequelize']['transaction'](function(_0x193c16){return _0x1d1b92[_0x9b44('0x115')](_0x120270,{'transaction':_0x193c16})['then'](function(){return db[_0x9b44('0x10e')]['findAll']({'where':{'id':{'$in':_0x120270}}});})['then'](function(_0x21c332){var _0x1ef137=_['map'](_0x21c332,function(_0xa33c0){return _0xa33c0[_0x9b44('0x10f')]();});return Promise[_0x9b44('0x54')](_0x1ef137);})[_0x9b44('0x17')](function(_0x352080){_0x866737=_[_0x9b44('0x110')](_0x352080);var _0x53249c=_['map'](_0x866737,function(_0x5637c1){return _0x5637c1['removeAgent'](_0x1d1b92['id'],{'transaction':_0x193c16});});return Promise[_0x9b44('0x54')](_0x53249c);})[_0x9b44('0x17')](function(){if(!_0x1d1b92[_0x9b44('0xab')])return;var _0x1e88b5=_[_0x9b44('0x32')](_0x866737,function(_0x4a7525){return _0x4a7525[_0x9b44('0x111')]('channel')===_0x9b44('0x112');});var _0x271dc1=_['map'](_0x1e88b5,function(_0x272f1a){return db[_0x9b44('0xb0')]['destroy']({'where':{'VoiceQueueId':_0x272f1a['id'],'UserId':_0x1d1b92['id']},'transaction':_0x193c16});});return Promise[_0x9b44('0x54')](_0x271dc1);})[_0x9b44('0x17')](function(){return db[_0x9b44('0x113')][_0x9b44('0x49')]({'where':{'teamId':{'$in':_0x120270}}});})[_0x9b44('0x17')](function(_0x32bc9e){var _0x29117b=_[_0x9b44('0x34')](_0x32bc9e,function(_0x4c61dc){return db[_0x9b44('0x114')][_0x9b44('0x39')]({'where':{'UserId':_0x1d1b92['id'],'VoicePrefixId':_0x4c61dc['VoicePrefixId']}},{'transaction':_0x193c16});});return Promise[_0x9b44('0x54')](_0x29117b);});});})[_0x9b44('0x17')](function(){for(var _0x5e096b=0x0;_0x5e096b<_0x866737[_0x9b44('0x4c')];_0x5e096b++){var _0x1a3471=_0x866737[_0x5e096b]['getDataValue']('channel');var _0x5daa29=_0x1a3471+_0x9b44('0xa8');socket[_0x9b44('0x2b')](_0x9b44('0x2e')+_0x1a3471+_0x9b44('0xb5'),{'UserId':_0x27aeb3,['queueField']:_0x866737[_0x5e096b]['id']});}})['then'](respondWithStatusCode(_0x4f885d,null))[_0x9b44('0x1f')](APIHandleError(_0x4f885d));};exports[_0x9b44('0x117')]=function(_0x241f43,_0x3dc834){var _0x588bda={};var _0x34e740={};var _0x1032db;var _0x3e00be;return db['User'][_0x9b44('0xcb')]({'where':{'id':_0x241f43[_0x9b44('0x56')]['id']}})[_0x9b44('0x17')](handleEntityNotFound(_0x3dc834,null))[_0x9b44('0x17')](function(_0x620c89){if(_0x620c89){_0x1032db=_0x620c89;_0x34e740['model']=_[_0x9b44('0x59')](db[_0x9b44('0xd1')]['rawAttributes']);_0x34e740[_0x9b44('0x43')]=_['keys'](_0x241f43['query']);_0x34e740[_0x9b44('0x5d')]=_[_0x9b44('0x5e')](_0x34e740[_0x9b44('0x57')],_0x34e740[_0x9b44('0x43')]);_0x588bda[_0x9b44('0x47')]=_['intersection'](_0x34e740[_0x9b44('0x57')],qs[_0x9b44('0x5f')](_0x241f43[_0x9b44('0x43')][_0x9b44('0x5f')]));_0x588bda[_0x9b44('0x47')]=_0x588bda['attributes'][_0x9b44('0x4c')]?_0x588bda['attributes']:_0x34e740[_0x9b44('0x57')];_0x588bda[_0x9b44('0xcc')]=qs[_0x9b44('0xcd')](_0x241f43[_0x9b44('0x43')][_0x9b44('0xcd')]);_0x588bda[_0x9b44('0x42')]=qs[_0x9b44('0x5d')](_[_0x9b44('0xce')](_0x241f43[_0x9b44('0x43')],_0x34e740[_0x9b44('0x5d')]));if(_0x241f43['query']['filter']){_0x588bda[_0x9b44('0x42')]=_[_0x9b44('0xcf')](_0x588bda[_0x9b44('0x42')],{'$or':_['map'](_0x588bda[_0x9b44('0x47')],function(_0x3ce887){var _0x3aa9fc={};_0x3aa9fc[_0x3ce887]={'$like':'%'+_0x241f43[_0x9b44('0x43')]['filter']+'%'};return _0x3aa9fc;})});}_0x588bda=_[_0x9b44('0xcf')]({},_0x588bda,_0x241f43['options']);return _0x1032db[_0x9b44('0x117')](_0x588bda);}})[_0x9b44('0x17')](function(_0x1b749c){if(_0x1b749c){_0x3e00be=_0x1b749c[_0x9b44('0x4c')];if(!_0x241f43[_0x9b44('0x43')][_0x9b44('0xd0')](_0x9b44('0xd7'))){_0x588bda[_0x9b44('0x25')]=qs[_0x9b44('0x25')](_0x241f43[_0x9b44('0x43')]['limit']);_0x588bda[_0x9b44('0x23')]=qs[_0x9b44('0x23')](_0x241f43[_0x9b44('0x43')][_0x9b44('0x23')]);}return _0x1032db[_0x9b44('0x117')](_0x588bda);}})[_0x9b44('0x17')](function(_0x454d86){if(_0x454d86){return _0x454d86?{'count':_0x3e00be,'rows':_0x454d86}:null;}})[_0x9b44('0x17')](respondWithResult(_0x3dc834,null))[_0x9b44('0x1f')](handleError(_0x3dc834,null));};exports[_0x9b44('0x118')]=function(_0x30e14e,_0x324991){var _0x1e0603={};var _0x502622={};var _0x3c33db;return db['User'][_0x9b44('0xcb')]({'where':{'id':_0x30e14e[_0x9b44('0x56')]['id']}})[_0x9b44('0x17')](handleEntityNotFound(_0x324991,null))['then'](function(_0x228b37){if(_0x228b37){_0x3c33db=_0x228b37;_0x502622[_0x9b44('0x57')]=_['keys'](db[_0x9b44('0x3d')][_0x9b44('0x5a')]);_0x502622['query']=_['keys'](_0x30e14e[_0x9b44('0x43')]);_0x502622['filters']=_[_0x9b44('0x5e')](_0x502622[_0x9b44('0x57')],_0x502622[_0x9b44('0x43')]);_0x1e0603[_0x9b44('0x47')]=_[_0x9b44('0x5e')](_0x502622['model'],qs[_0x9b44('0x5f')](_0x30e14e[_0x9b44('0x43')][_0x9b44('0x5f')]));_0x1e0603[_0x9b44('0x47')]=_0x1e0603['attributes'][_0x9b44('0x4c')]?_0x1e0603['attributes']:_0x502622[_0x9b44('0x57')];_0x1e0603[_0x9b44('0xcc')]=qs['sort'](_0x30e14e[_0x9b44('0x43')][_0x9b44('0xcd')]);_0x1e0603[_0x9b44('0x42')]=qs[_0x9b44('0x5d')](_['pick'](_0x30e14e['query'],_0x502622[_0x9b44('0x5d')]));if(_0x30e14e[_0x9b44('0x43')][_0x9b44('0x32')]){_0x1e0603[_0x9b44('0x42')]=_['merge'](_0x1e0603[_0x9b44('0x42')],{'$or':_['map'](_0x1e0603['attributes'],function(_0x5ce254){var _0x952f78={};_0x952f78[_0x5ce254]={'$like':'%'+_0x30e14e[_0x9b44('0x43')][_0x9b44('0x32')]+'%'};return _0x952f78;})});}_0x1e0603[_0x9b44('0x57')]=db[_0x9b44('0x3d')];_0x1e0603['as']=_0x9b44('0x2f');_0x1e0603=_['merge']({},_0x1e0603,_0x30e14e[_0x9b44('0x62')]);return _0x3c33db[_0x9b44('0xf3')]({'include':[_0x1e0603]});}})['then'](function(_0x4c8412){if(_0x4c8412){var _0x2a04c1={},_0x13c535=[];for(var _0x3ec50b=0x0;_0x3ec50b<_0x4c8412[_0x9b44('0x4c')];_0x3ec50b+=0x1){for(var _0x5674ce=0x0,_0x5e0b05;_0x5674ce<_0x4c8412[_0x3ec50b][_0x9b44('0x2f')]['length'];_0x5674ce+=0x1){_0x5e0b05=_0x4c8412[_0x3ec50b][_0x9b44('0x2f')][_0x5674ce][_0x9b44('0x2d')]({'plain':!![]});_0x2a04c1[_0x5e0b05['id']]=_0x5e0b05;}}_0x2a04c1=_['values'](_0x2a04c1);for(var _0x59bcab=qs['offset'](_0x30e14e[_0x9b44('0x43')]['offset']);_0x59bcab<_0x2a04c1[_0x9b44('0x4c')]&&_0x13c535[_0x9b44('0x4c')]=_0x410407){_0x50d5ac=_0x410407;_0x5ee077=0xc8;}else{_0x5ee077=0xce;}_0x37ac95[_0x7d1a('0x21')](_0x5ee077);return _0x37ac95['set'](_0x7d1a('0x27'),_0x513579+'-'+_0x50d5ac+'/'+_0x410407)['json'](_0x19a299);}return null;};}function saveUpdates(_0x55bb04){return function(_0x16d6e4){if(_0x16d6e4){return _0x16d6e4[_0x7d1a('0x28')](_0x55bb04)[_0x7d1a('0x18')](function(_0x42d47c){if(_0x42d47c[_0x7d1a('0x29')]===_0x7d1a('0x2a')){socket[_0x7d1a('0x2b')](_0x7d1a('0x2c')+_0x42d47c['id'],_0x42d47c);}return _0x42d47c;});}return null;};}function removeEntity(_0x348b18){return function(_0x579194){if(_0x579194){return _0x579194[_0x7d1a('0x2d')]()[_0x7d1a('0x18')](function(){var _0x5c72eb=_0x579194[_0x7d1a('0x2e')]({'plain':!![]});if(_0x5c72eb[_0x7d1a('0x29')]===_0x7d1a('0x2f'))return;var _0x2c5640=[{'name':'Users','value':_0x7d1a('0x30'),'ignore':!![]},{'name':'Agents','value':_0x7d1a('0x2a'),'ignore':![]},{'name':_0x7d1a('0x31'),'value':_0x7d1a('0x32'),'ignore':![]}];var _0x48b9c9=_(_0x2c5640)[_0x7d1a('0x33')](_0x7d1a('0x34'))['map'](_0x7d1a('0x35'))[_0x7d1a('0x35')]();if(_[_0x7d1a('0x36')](_0x48b9c9,_0x5c72eb[_0x7d1a('0x29')])){return;}var _0x4036de=_[_0x7d1a('0x37')](_0x2c5640,[_0x7d1a('0x35'),_0x5c72eb[_0x7d1a('0x29')]])[_0x7d1a('0x38')];return db[_0x7d1a('0x39')][_0x7d1a('0x2d')]({'where':{'type':_0x4036de,'resourceId':_0x5c72eb['id']}})[_0x7d1a('0x18')](function(){return _0x579194;});})[_0x7d1a('0x18')](function(){_0x348b18['status'](0xcc)[_0x7d1a('0x20')]();});}};}function handleEntityNotFound(_0x4bb7b9){return function(_0x1bb66c){if(!_0x1bb66c){_0x4bb7b9[_0x7d1a('0x3a')](0x194);}return _0x1bb66c;};}function handleError(_0x52e2be,_0x4f0e4e){_0x4f0e4e=_0x4f0e4e||0x1f4;return function(_0x5784ab){logger['error'](_0x5784ab['stack']);if(_0x5784ab[_0x7d1a('0x38')]){delete _0x5784ab[_0x7d1a('0x38')];}_0x52e2be[_0x7d1a('0x21')](_0x4f0e4e)[_0x7d1a('0x3b')](_0x5784ab);};}exports[_0x7d1a('0x3c')]=function(_0x138691,_0x1527b0){var _0x54813d={},_0x581343={'count':0x0,'rows':[]};var _0x39e2b1=_(db[_0x7d1a('0x3d')][_0x7d1a('0x3e')])['map'](function(_0x2aa315){return{'name':_0x2aa315['fieldName'],'type':_0x2aa315[_0x7d1a('0x3f')][_0x7d1a('0x40')]};})[_0x7d1a('0x33')](function(_0x106aae){return!_['includes'](['password',_0x7d1a('0x41')],_0x106aae[_0x7d1a('0x38')]);})[_0x7d1a('0x35')]();_0x54813d=qs['getOptions'](_0x39e2b1,_0x138691);var _0x2c016f={'where':_0x54813d['where']};return db[_0x7d1a('0x3d')]['count'](_0x2c016f)[_0x7d1a('0x18')](function(_0x5e9698){_0x581343[_0x7d1a('0x24')]=_0x5e9698;if(_0x138691['query'][_0x7d1a('0x42')]){_0x54813d[_0x7d1a('0x43')]=[{'all':!![]}];}if(_0x138691[_0x7d1a('0x44')]['userSetting']===_0x7d1a('0x45')){_0x54813d[_0x7d1a('0x43')]=[{'model':db['UserSetting'],'as':'userSetting'}];}if(!_[_0x7d1a('0x36')](_0x54813d[_0x7d1a('0x46')],'id')){_0x54813d[_0x7d1a('0x46')][_0x7d1a('0x47')]('id');}return db[_0x7d1a('0x3d')][_0x7d1a('0x48')](_0x54813d);})[_0x7d1a('0x18')](function(_0x5b37a0){_0x581343[_0x7d1a('0x49')]=_0x5b37a0;if(_0x138691[_0x7d1a('0x44')]['openTabs']===_0x7d1a('0x45')){var _0x345544=[];for(var _0x391209=0x0;_0x391209<_0x581343[_0x7d1a('0x49')][_0x7d1a('0x4a')];_0x391209++){_0x345544['push'](get_open_tabs(_0x7d1a('0x4b'),_0x581343[_0x7d1a('0x49')][_0x391209][_0x7d1a('0x4c')]));_0x345544[_0x7d1a('0x47')](get_open_tabs('sms',_0x581343[_0x7d1a('0x49')][_0x391209][_0x7d1a('0x4c')]));_0x345544[_0x7d1a('0x47')](get_open_tabs('fax',_0x581343[_0x7d1a('0x49')][_0x391209]['dataValues']));_0x345544[_0x7d1a('0x47')](get_open_tabs(_0x7d1a('0x4d'),_0x581343[_0x7d1a('0x49')][_0x391209]['dataValues']));_0x345544[_0x7d1a('0x47')](get_open_tabs(_0x7d1a('0x4e'),_0x581343[_0x7d1a('0x49')][_0x391209][_0x7d1a('0x4c')]));_0x345544['push'](get_open_tabs('whatsapp',_0x581343[_0x7d1a('0x49')][_0x391209]['dataValues']));}return Promise['all'](_0x345544)[_0x7d1a('0x18')](function(){return _0x581343;});}else{return _0x581343;}})['then'](respondWithFilteredResult(_0x1527b0,_0x54813d))[_0x7d1a('0x4f')](handleError(_0x1527b0,null));};exports[_0x7d1a('0x50')]=function(_0x48bae9,_0x1ea095){var _0x25f5c7={'raw':![],'where':{'id':_0x48bae9[_0x7d1a('0x51')]['id']}},_0x433c66={};_0x433c66[_0x7d1a('0x52')]=_['differenceBy'](_[_0x7d1a('0x53')](db['User'][_0x7d1a('0x3e')]),[_0x7d1a('0x54'),'salt']);_0x433c66[_0x7d1a('0x44')]=_[_0x7d1a('0x53')](_0x48bae9[_0x7d1a('0x44')]);_0x433c66[_0x7d1a('0x55')]=_[_0x7d1a('0x56')](_0x433c66[_0x7d1a('0x52')],_0x433c66[_0x7d1a('0x44')]);_0x25f5c7['attributes']=_['intersection'](_0x433c66[_0x7d1a('0x52')],qs['fields'](_0x48bae9['query'][_0x7d1a('0x57')]));_0x25f5c7['attributes']=_0x25f5c7[_0x7d1a('0x46')][_0x7d1a('0x4a')]?_0x25f5c7[_0x7d1a('0x46')]:_0x433c66[_0x7d1a('0x52')];if(_0x48bae9[_0x7d1a('0x44')]['includeAll']){_0x25f5c7[_0x7d1a('0x43')]=[{'all':!![]}];}if(_0x48bae9['query']['userSetting']===_0x7d1a('0x45')){_0x25f5c7[_0x7d1a('0x43')]=[{'model':db[_0x7d1a('0x58')],'as':'userSetting'}];}_0x25f5c7=_[_0x7d1a('0x59')]({},_0x25f5c7,_0x48bae9[_0x7d1a('0x5a')]);if(!_['includes'](_0x25f5c7[_0x7d1a('0x46')],'id')){_0x25f5c7[_0x7d1a('0x46')][_0x7d1a('0x47')]('id');}return db['User'][_0x7d1a('0x37')](_0x25f5c7)[_0x7d1a('0x18')](handleEntityNotFound(_0x1ea095,null))[_0x7d1a('0x18')](function(_0x50ace5){var _0x4323c5=[];values=_0x50ace5;if(_0x48bae9[_0x7d1a('0x44')][_0x7d1a('0x5b')]==='true'){_0x4323c5['push'](get_open_tabs(_0x7d1a('0x4b'),_0x50ace5['dataValues']));_0x4323c5[_0x7d1a('0x47')](get_open_tabs('sms',_0x50ace5[_0x7d1a('0x4c')]));_0x4323c5['push'](get_open_tabs('openchannel',_0x50ace5[_0x7d1a('0x4c')]));_0x4323c5[_0x7d1a('0x47')](get_open_tabs(_0x7d1a('0x5c'),_0x50ace5[_0x7d1a('0x4c')]));_0x4323c5['push'](get_open_tabs('fax',_0x50ace5['dataValues']));_0x4323c5['push'](get_open_tabs('mail',_0x50ace5[_0x7d1a('0x4c')]));return Promise[_0x7d1a('0x5d')](_0x4323c5);}else{return values;}})[_0x7d1a('0x18')](function(){return values;})['then'](respondWithResult(_0x1ea095,null))['catch'](handleError(_0x1ea095,null));};exports[_0x7d1a('0x28')]=function(_0xbe0590,_0x567322){if(_0xbe0590['body']['id']){delete _0xbe0590[_0x7d1a('0x5e')]['id'];}delete _0xbe0590[_0x7d1a('0x5e')]['role'];return db[_0x7d1a('0x3d')][_0x7d1a('0x37')]({'where':{'id':_0xbe0590['params']['id']}})['then'](handleEntityNotFound(_0x567322,null))['then'](saveUpdates(_0xbe0590[_0x7d1a('0x5e')],null))[_0x7d1a('0x18')](respondWithResult(_0x567322,null))[_0x7d1a('0x4f')](handleError(_0x567322,null));};exports['describe']=function(_0x26347f,_0x80908c){return db[_0x7d1a('0x3d')][_0x7d1a('0x5f')]()[_0x7d1a('0x18')](respondWithResult(_0x80908c,null))[_0x7d1a('0x4f')](handleError(_0x80908c,null));};exports[_0x7d1a('0x60')]=function(_0x6280d9,_0x54196a){return db[_0x7d1a('0x3d')][_0x7d1a('0x37')]({'where':{'id':_0x6280d9[_0x7d1a('0x51')]['id']}})[_0x7d1a('0x18')](handleEntityNotFound(_0x54196a,null))['then'](function(_0x3595d0){if(_0x3595d0){return _0x3595d0[_0x7d1a('0x60')](_0x6280d9[_0x7d1a('0x5e')][_0x7d1a('0x61')],_['omit'](_0x6280d9[_0x7d1a('0x5e')],[_0x7d1a('0x61'),'id'])||{});}})[_0x7d1a('0x18')](respondWithResult(_0x54196a,null))['catch'](handleError(_0x54196a,null));};function validateUser(_0x2613a2){return new Promise(function(_0x4f58a8,_0x206dfa){if(_0x2613a2[_0x7d1a('0x62')])return _0x4f58a8(_0x2613a2);return db[_0x7d1a('0x63')]['findById'](0x1)[_0x7d1a('0x18')](function(_0x174738){if(_0x174738[_0x7d1a('0x64')])authService['validatePasswordPattern'](_0x2613a2[_0x7d1a('0x54')]);db['User'][_0x7d1a('0x65')](_0x7d1a('0x62'))[_0x7d1a('0x18')](function(_0x375ff3){if(_[_0x7d1a('0x66')](_0x375ff3)){_0x2613a2[_0x7d1a('0x62')]=_0x174738[_0x7d1a('0x67')]||0x1;return;}if(_['isNil'](_0x174738[_0x7d1a('0x67')])||_0x174738[_0x7d1a('0x67')]===_0x375ff3){_0x2613a2[_0x7d1a('0x62')]=_0x375ff3+0x1;return;}if(_0x174738[_0x7d1a('0x67')]>_0x375ff3){_0x2613a2[_0x7d1a('0x62')]=_0x174738[_0x7d1a('0x67')];return;}return db[_0x7d1a('0x68')][_0x7d1a('0x44')](_0x7d1a('0x69'),{'type':db['sequelize'][_0x7d1a('0x6a')]['SELECT']})[_0x7d1a('0x18')](function(_0x255514){if(_0x255514&&_0x255514[_0x7d1a('0x4a')]){for(var _0x3b6318=0x0,_0x2e6b2f=_0x255514['length'];_0x3b6318<_0x2e6b2f&&_[_0x7d1a('0x66')](_0x2613a2[_0x7d1a('0x62')]);_0x3b6318++){if(_0x174738[_0x7d1a('0x67')]<=_0x255514[_0x3b6318][_0x7d1a('0x6b')]){_0x2613a2[_0x7d1a('0x62')]=_0x255514[_0x3b6318]['from'];}else if(_0x174738[_0x7d1a('0x67')]>_0x255514[_0x3b6318][_0x7d1a('0x6b')]&&_0x174738[_0x7d1a('0x67')]<=_0x255514[_0x3b6318]['to']){_0x2613a2[_0x7d1a('0x62')]=_0x174738['min_internal'];}}}if(_[_0x7d1a('0x66')](_0x2613a2[_0x7d1a('0x62')])){_0x2613a2[_0x7d1a('0x62')]=_0x375ff3+0x1;}return _0x4f58a8(_0x2613a2);});});})[_0x7d1a('0x4f')](function(_0x98f975){_0x206dfa(_0x98f975);});});}function updateUser(_0x45a399){return new Promise(function(_0x45f4da,_0x28e711){try{if(_0x45a399['voicemail']){_0x45a399[_0x7d1a('0x6c')]=_0x45a399[_0x7d1a('0x62')];_0x45a399[_0x7d1a('0x6d')]={'mailbox':_0x45a399['internal'],'password':_0x45a399[_0x7d1a('0x54')],'fullname':_0x45a399[_0x7d1a('0x6e')],'email':_0x45a399[_0x7d1a('0x6f')]};}if(_0x45a399[_0x7d1a('0x29')]===_0x7d1a('0x2a')){if(!_0x45a399[_0x7d1a('0x70')])_0x45a399['permissions']=[_0x7d1a('0x71'),'102',_0x7d1a('0x72'),_0x7d1a('0x73'),_0x7d1a('0x74'),'104',_0x7d1a('0x75'),_0x7d1a('0x76'),'107',_0x7d1a('0x77'),_0x7d1a('0x78'),_0x7d1a('0x79'),'111',_0x7d1a('0x7a'),_0x7d1a('0x7b')];}_0x45f4da(_0x45a399);}catch(_0x24db3f){_0x28e711(_0x24db3f);}});}exports['create']=function(_0x311b4e,_0x513b54){if(_0x311b4e['user'][_0x7d1a('0x29')]==='agent')throw new Error(_0x7d1a('0x7c'));if(_0x311b4e[_0x7d1a('0x5e')][_0x7d1a('0x29')]==='user'&&_0x311b4e[_0x7d1a('0x30')][_0x7d1a('0x29')]!=='admin'){throw new Error(_0x7d1a('0x7d'));}if(_0x311b4e['body'][_0x7d1a('0x29')]===_0x7d1a('0x2f')&&_0x311b4e[_0x7d1a('0x30')]['role']!==_0x7d1a('0x2f')){throw new Error(_0x7d1a('0x7e'));}return licenseUtil[_0x7d1a('0x7f')]([_0x311b4e[_0x7d1a('0x5e')]])[_0x7d1a('0x18')](function(){return validateUser(_0x311b4e['body']);})['then'](function(_0x186ac2){return updateUser(_0x186ac2)[_0x7d1a('0x18')](function(_0x11f7e9){if(_0x11f7e9[_0x7d1a('0x29')]===_0x7d1a('0x2f')){_0x11f7e9[_0x7d1a('0x80')]=_0x311b4e['user'][_0x7d1a('0x80')];delete _0x11f7e9[_0x7d1a('0x81')];}return _0x11f7e9;});})['then'](function(_0x546796){return db[_0x7d1a('0x3d')][_0x7d1a('0x82')](_0x546796,{'include':[{'model':db[_0x7d1a('0x6d')],'as':_0x7d1a('0x6d')}]});})[_0x7d1a('0x18')](function(_0x5970b2){if(_0x311b4e[_0x7d1a('0x5e')][_0x7d1a('0x29')]==='user')return _0x5970b2;if(_0x311b4e['user'][_0x7d1a('0x29')]!==_0x7d1a('0x30'))return _0x5970b2;return db[_0x7d1a('0x83')][_0x7d1a('0x37')]({'where':{'name':_0x5970b2[_0x7d1a('0x29')]===_0x7d1a('0x2a')?_0x7d1a('0x84'):_0x7d1a('0x31'),'userProfileId':_0x311b4e['user'][_0x7d1a('0x81')]},'raw':!![]})[_0x7d1a('0x18')](function(_0x53bbc2){if(!_0x53bbc2||_0x53bbc2[_0x7d1a('0x85')]!=0x0)return _0x5970b2;return db[_0x7d1a('0x39')][_0x7d1a('0x82')]({'name':_0x5970b2[_0x7d1a('0x38')],'resourceId':_0x5970b2['id'],'type':_0x53bbc2['name'],'sectionId':_0x53bbc2['id']},{})[_0x7d1a('0x18')](function(){return _0x5970b2;});})[_0x7d1a('0x4f')](function(_0x501309){logger[_0x7d1a('0x1c')](_0x7d1a('0x86'),_0x501309);throw _0x501309;});})[_0x7d1a('0x18')](respondWithResult(_0x513b54,0xc9))['catch'](handleError(_0x513b54,null));};exports['bulkCreate']=function(_0x177f94,_0x4ee72f){var _0x5c96b9=_0x177f94['body'];var _0x58e5fd=[];if(_0x177f94[_0x7d1a('0x30')][_0x7d1a('0x29')]===_0x7d1a('0x2a'))throw new Error('Unauthorized');if(_[_0x7d1a('0x87')](_0x5c96b9,[_0x7d1a('0x29'),_0x7d1a('0x30')])&&_0x177f94['user'][_0x7d1a('0x29')]!==_0x7d1a('0x2f')){throw new Error(_0x7d1a('0x7d'));}if(_[_0x7d1a('0x87')](_0x5c96b9,[_0x7d1a('0x29'),_0x7d1a('0x2f')])&&_0x177f94[_0x7d1a('0x30')]['role']!==_0x7d1a('0x2f')){throw new Error(_0x7d1a('0x88'));}return licenseUtil['checkUserLimits'](_0x5c96b9)[_0x7d1a('0x18')](function(){return validateUser(_0x5c96b9[0x0]);})['then'](function(){for(var _0x25b1fa=0x1;_0x25b1fa<_0x5c96b9[_0x7d1a('0x4a')];_0x25b1fa++){var _0x478e47=_0x5c96b9[_0x25b1fa-0x1][_0x7d1a('0x62')];if(!_0x5c96b9[_0x25b1fa][_0x7d1a('0x62')])_0x5c96b9[_0x25b1fa]['internal']=_0x478e47+0x1;_0x58e5fd[_0x7d1a('0x47')](validateUser(_0x5c96b9[_0x25b1fa]));}return Promise[_0x7d1a('0x5d')](_0x58e5fd);})[_0x7d1a('0x18')](function(){_0x58e5fd=[];for(var _0x22f98f=0x0;_0x22f98f<_0x5c96b9[_0x7d1a('0x4a')];_0x22f98f++){_0x58e5fd[_0x7d1a('0x47')](updateUser(_0x5c96b9[_0x22f98f]));}return Promise[_0x7d1a('0x5d')](_0x58e5fd);})[_0x7d1a('0x18')](function(){_0x58e5fd=_0x5c96b9[_0x7d1a('0x89')](function(_0x22677e){return db['User']['create'](_0x22677e,{'include':[{'model':db['VoiceMail'],'as':_0x7d1a('0x6d')}]})[_0x7d1a('0x18')](function(_0x497bcd){_0x22677e['id']=_0x497bcd['id'];return _0x22677e;});});return Promise[_0x7d1a('0x5d')](_0x58e5fd);})[_0x7d1a('0x18')](function(_0x48e03d){if(_0x177f94[_0x7d1a('0x5e')][_0x7d1a('0x29')]===_0x7d1a('0x30'))return _0x48e03d;if(_0x177f94['user']['role']!==_0x7d1a('0x30'))return _0x48e03d;var _0x83555f=_[_0x7d1a('0x87')](_0x48e03d,function(_0x55570b){return _0x55570b['role']===_0x7d1a('0x2a')||_0x55570b[_0x7d1a('0x29')]===_0x7d1a('0x32');});if(!_0x83555f)return _0x48e03d;return db[_0x7d1a('0x83')]['findAll']({'where':{'name':{'$or':[_0x7d1a('0x84'),_0x7d1a('0x31')]},'userProfileId':_0x177f94[_0x7d1a('0x30')][_0x7d1a('0x81')]},'raw':!![]})[_0x7d1a('0x18')](function(_0x485bc4){if(_['isEmpty'](_0x485bc4)||!_['some'](_0x485bc4,['autoAssociation',0x0]))return _0x48e03d;_0x58e5fd=[];var _0x4c60b5=_(_0x485bc4)['map'](function(_0x3b3bc3){if(_0x3b3bc3[_0x7d1a('0x85')]===0x1)return;return _0x3b3bc3[_0x7d1a('0x38')]===_0x7d1a('0x84')?_0x7d1a('0x2a'):_0x7d1a('0x32');})[_0x7d1a('0x8a')]()[_0x7d1a('0x35')]();for(var _0x143138=0x0;_0x143138<_0x48e03d['length'];_0x143138++){if(!_[_0x7d1a('0x36')](_0x4c60b5,_0x48e03d[_0x143138][_0x7d1a('0x29')]))return;var _0x113615=_0x48e03d[_0x143138][_0x7d1a('0x29')]==='agent'?_0x7d1a('0x84'):_0x7d1a('0x31');_0x58e5fd[_0x7d1a('0x47')](db[_0x7d1a('0x39')][_0x7d1a('0x82')]({'name':_0x48e03d[_0x143138][_0x7d1a('0x38')],'resourceId':_0x48e03d[_0x143138]['id'],'type':_0x113615,'sectionId':_[_0x7d1a('0x37')](_0x485bc4,['name',_0x113615])['id']},{}));}return Promise['all'](_0x58e5fd);});})[_0x7d1a('0x18')](respondWithResult(_0x4ee72f,0xc9))[_0x7d1a('0x4f')](handleError(_0x4ee72f,null));};exports[_0x7d1a('0x8b')]=function(_0x12d338,_0x4d6f85){if(_0x12d338[_0x7d1a('0x5e')]['id']){delete _0x12d338[_0x7d1a('0x5e')]['id'];}return db[_0x7d1a('0x3d')]['find']({'where':{'id':_0x12d338[_0x7d1a('0x51')]['id']}})[_0x7d1a('0x18')](function(_0x1eae54){if(!_0x1eae54)return null;if(_0x1eae54['id']===_0x12d338[_0x7d1a('0x30')]['id']){if(!_0x12d338[_0x7d1a('0x5e')][_0x7d1a('0x8c')]||!_0x12d338[_0x7d1a('0x5e')][_0x7d1a('0x8d')]){throw new db[(_0x7d1a('0x8e'))][(_0x7d1a('0x8f'))](_0x7d1a('0x90'));}if(!_0x1eae54[_0x7d1a('0x91')](_0x12d338[_0x7d1a('0x5e')]['oldPassword'])){throw new db['Sequelize'][(_0x7d1a('0x8f'))]('Wrong\x20credentials');}if(_0x12d338[_0x7d1a('0x5e')]['oldPassword']===_0x12d338[_0x7d1a('0x5e')][_0x7d1a('0x8d')]){throw new db[(_0x7d1a('0x8e'))][(_0x7d1a('0x8f'))]('New\x20password\x20must\x20be\x20different\x20from\x20old\x20password');}}else if(_0x12d338[_0x7d1a('0x30')][_0x7d1a('0x29')]==='admin'){if(!_0x12d338[_0x7d1a('0x5e')][_0x7d1a('0x8d')]){throw new db[(_0x7d1a('0x8e'))]['ValidationError'](_0x7d1a('0x92'));}}else if(_0x12d338[_0x7d1a('0x30')][_0x7d1a('0x29')]===_0x7d1a('0x30')){if(!_0x12d338['body']['newPassword']){throw new db[(_0x7d1a('0x8e'))]['ValidationError'](_0x7d1a('0x92'));}if(_0x1eae54[_0x7d1a('0x29')]!==_0x7d1a('0x2a')){throw new db[(_0x7d1a('0x8e'))]['ValidationError']('Unauthorized');}}else{throw new db[(_0x7d1a('0x8e'))][(_0x7d1a('0x8f'))](_0x7d1a('0x7c'));}return _0x1eae54;})['then'](handleEntityNotFound(_0x4d6f85,null))[_0x7d1a('0x18')](function(_0x10de04){return db[_0x7d1a('0x63')][_0x7d1a('0x93')]({'attributes':['id',_0x7d1a('0x64'),_0x7d1a('0x94'),_0x7d1a('0x95')]})[_0x7d1a('0x18')](function(_0x32cdae){if(_0x32cdae[_0x7d1a('0x64')])authService[_0x7d1a('0x96')](_0x12d338[_0x7d1a('0x5e')]['newPassword']);if(!_0x32cdae[_0x7d1a('0x94')]||!_0x10de04[_0x7d1a('0x97')])return _0x10de04;authService[_0x7d1a('0x98')](_0x12d338[_0x7d1a('0x5e')][_0x7d1a('0x8d')],_0x10de04[_0x7d1a('0x97')],_0x32cdae[_0x7d1a('0x95')]);return _0x10de04;})['then'](saveUpdates({'password':_0x12d338['body']['newPassword'],'passwordResetAt':_0x12d338[_0x7d1a('0x30')]['id']==_0x12d338['params']['id']?moment():null,'previousPasswords':authService[_0x7d1a('0x99')](_0x12d338['body'][_0x7d1a('0x8d')],_0x10de04[_0x7d1a('0x97')])},null));})[_0x7d1a('0x18')](respondWithResult(_0x4d6f85,null))[_0x7d1a('0x4f')](handleError(_0x4d6f85,null));};exports['addQueues']=function(_0xc78207,_0x1953b5){var _0x23f8be=_0xc78207[_0x7d1a('0x5e')]['channel'];return db['User'][_0x7d1a('0x37')]({'where':{'id':_0xc78207[_0x7d1a('0x51')]['id']},'attributes':['id',_0x7d1a('0x38'),_0x7d1a('0x29'),_0x7d1a('0x9a'),'loginInPause',_0x7d1a('0x9b'),_0x7d1a('0x9c')]})['then'](handleEntityNotFound(_0x1953b5,null))[_0x7d1a('0x18')](function(_0x8665ac){if(_0x8665ac){if(!utils['isValidChannel'](_0x23f8be)){throw new db['Sequelize'][(_0x7d1a('0x8f'))](_0x7d1a('0x9d'));}return _0x8665ac[_0x7d1a('0x9e')+_[_0x7d1a('0x9f')](_0x23f8be[_0x7d1a('0xa0')]())+_0x7d1a('0xa1')](_0xc78207[_0x7d1a('0x5e')][_0x7d1a('0x61')],{'penalty':_0xc78207[_0x7d1a('0x5e')][_0x7d1a('0xa2')]||0x0})[_0x7d1a('0xa3')](function(_0x1d9e10){for(var _0x572e06=0x0;_0x572e06<_0xc78207[_0x7d1a('0x5e')]['ids'][_0x7d1a('0x4a')];_0x572e06+=0x1){var _0x4e1106={'UserId':Number(_0xc78207['params']['id'])};_0x4e1106[_[_0x7d1a('0x9f')](_0x23f8be[_0x7d1a('0xa0')]())+_0x7d1a('0xa4')]=Number(_0xc78207['body']['ids'][_0x572e06]);socket[_0x7d1a('0x2b')]('user'+_[_0x7d1a('0x9f')](_0x23f8be[_0x7d1a('0xa0')]())+_0x7d1a('0xa5'),_0x4e1106);}return _0x1d9e10;})[_0x7d1a('0x18')](function(){if(_0x23f8be===_0x7d1a('0xa6')){return db[_0x7d1a('0xa7')][_0x7d1a('0x48')]({'where':{'id':_0xc78207[_0x7d1a('0x5e')]['ids']||[]},'raw':!![],'attributes':['id',_0x7d1a('0x38')]});}})['then'](function(_0x1b5e8c){var _0x2a1bdc=_0x8665ac[_0x7d1a('0x2e')]({'plain':!![]});var _0x3e08ef=[];if(_0x23f8be==='voice'&&_0x2a1bdc[_0x7d1a('0x29')]===_0x7d1a('0x2a')&&_0x2a1bdc[_0x7d1a('0x9a')]){for(let _0x32e739=0x0;_0x32e739<_0x1b5e8c[_0x7d1a('0x4a')];_0x32e739+=0x1){_0x3e08ef['push']({'membername':_0x2a1bdc[_0x7d1a('0x38')],'UserId':_0x2a1bdc['id'],'queue_name':_0x1b5e8c[_0x32e739]['name'],'VoiceQueueId':_0x1b5e8c[_0x32e739]['id'],'interface':_[_0x7d1a('0x66')](_0x2a1bdc[_0x7d1a('0x9c')])?util[_0x7d1a('0xa8')](_0x7d1a('0xa9'),_0x2a1bdc[_0x7d1a('0x38')]):_0x2a1bdc[_0x7d1a('0x9c')],'paused':_0x2a1bdc[_0x7d1a('0x9b')]||![],'penalty':_0xc78207[_0x7d1a('0x5e')][_0x7d1a('0xa2')]||0x0});}return Promise[_0x7d1a('0x5d')](_0x3e08ef[_0x7d1a('0x89')](function(_0x557d6d){return db[_0x7d1a('0xaa')][_0x7d1a('0xab')](_0x557d6d);}));}return _0x8665ac;});}})[_0x7d1a('0x18')](respondWithStatusCode(_0x1953b5,null))[_0x7d1a('0x4f')](handleError(_0x1953b5,null));};exports['removeQueues']=function(_0xef27d,_0x2e1300){var _0x1c136e,_0x463994;return db[_0x7d1a('0x3d')][_0x7d1a('0x37')]({'where':{'id':_0xef27d[_0x7d1a('0x51')]['id']},'attributes':['id','name',_0x7d1a('0x29')]})[_0x7d1a('0x18')](handleEntityNotFound(_0x2e1300,null))[_0x7d1a('0x18')](function(_0x4fc83a){if(_0x4fc83a){_0x1c136e=_0x4fc83a;if(!_0xef27d['query'][_0x7d1a('0xac')]||!utils[_0x7d1a('0xad')](_0xef27d[_0x7d1a('0x44')][_0x7d1a('0xac')])){throw new db[(_0x7d1a('0x8e'))][(_0x7d1a('0x8f'))](_0x7d1a('0x9d'));}return _0x4fc83a[_0x7d1a('0xae')+_[_0x7d1a('0x9f')](_0xef27d[_0x7d1a('0x44')][_0x7d1a('0xac')][_0x7d1a('0xa0')]())+_0x7d1a('0xa1')](_0xef27d[_0x7d1a('0x44')][_0x7d1a('0x61')]);}})[_0x7d1a('0x18')](function(_0x4c518f){if(_['isArray'](_0xef27d[_0x7d1a('0x44')][_0x7d1a('0x61')])){for(var _0x36d15b=0x0;_0x36d15b<_0xef27d['query']['ids'][_0x7d1a('0x4a')];_0x36d15b+=0x1){_0x463994={'UserId':Number(_0xef27d[_0x7d1a('0x51')]['id'])};_0x463994[_['capitalize'](_0xef27d[_0x7d1a('0x44')][_0x7d1a('0xac')][_0x7d1a('0xa0')]())+_0x7d1a('0xa4')]=Number(_0xef27d[_0x7d1a('0x44')][_0x7d1a('0x61')][_0x36d15b]);socket[_0x7d1a('0x2b')](_0x7d1a('0x30')+_['capitalize'](_0xef27d[_0x7d1a('0x44')][_0x7d1a('0xac')][_0x7d1a('0xa0')]())+'Queue:remove',_0x463994);}}else{_0x463994={'UserId':Number(_0xef27d['params']['id'])};_0x463994[_['capitalize'](_0xef27d[_0x7d1a('0x44')][_0x7d1a('0xac')][_0x7d1a('0xa0')]())+'QueueId']=Number(_0xef27d[_0x7d1a('0x44')][_0x7d1a('0x61')]);socket['emit'](_0x7d1a('0x30')+_[_0x7d1a('0x9f')](_0xef27d[_0x7d1a('0x44')][_0x7d1a('0xac')][_0x7d1a('0xa0')]())+_0x7d1a('0xaf'),_0x463994);}return _0x4c518f;})['then'](function(){if(_0xef27d[_0x7d1a('0x44')]['channel']===_0x7d1a('0xa6')){return db[_0x7d1a('0xaa')][_0x7d1a('0x2d')]({'where':{'UserId':_0xef27d[_0x7d1a('0x51')]['id'],'VoiceQueueId':_0xef27d['query'][_0x7d1a('0x61')]},'individualHooks':!![]})['then'](function(){return _0x1c136e;});}return _0x1c136e;})[_0x7d1a('0x18')](respondWithStatusCode(_0x2e1300,null))[_0x7d1a('0x4f')](handleError(_0x2e1300,null));};exports[_0x7d1a('0xb0')]=function(_0x4ba2de,_0x3ad1d8){_0x4ba2de[_0x7d1a('0x5e')]['userpic']=_0x4ba2de[_0x7d1a('0xb1')][_0x7d1a('0xb2')];return db[_0x7d1a('0x3d')][_0x7d1a('0x37')]({'where':{'id':_0x4ba2de[_0x7d1a('0x51')]['id']}})[_0x7d1a('0x18')](handleEntityNotFound(_0x3ad1d8,null))[_0x7d1a('0x18')](saveUpdates(_0x4ba2de['body'],null))[_0x7d1a('0x18')](respondWithResult(_0x3ad1d8,null))[_0x7d1a('0x4f')](handleError(_0x3ad1d8,null));};exports[_0x7d1a('0xb3')]=function(_0x31b862,_0x47818a){var _0x2ae201=path[_0x7d1a('0xb4')](config[_0x7d1a('0xb5')],_0x7d1a('0xb6'));return db['User'][_0x7d1a('0x37')]({'where':{'id':_0x31b862[_0x7d1a('0x51')]['id']},'attributes':['id',_0x7d1a('0xb7')],'raw':!![]})[_0x7d1a('0x18')](handleEntityNotFound(_0x47818a,null))['then'](function(_0x359fd1){if(_0x359fd1){if(_[_0x7d1a('0x66')](_0x359fd1[_0x7d1a('0xb7')])){return _0x47818a[_0x7d1a('0xb8')](_0x2ae201);}else{if(!fs[_0x7d1a('0xb9')](path[_0x7d1a('0xb4')](config['root'],_0x7d1a('0xba'),_0x359fd1['userpic']))){return _0x47818a[_0x7d1a('0xb8')](_0x2ae201);}return _0x47818a['download'](path[_0x7d1a('0xb4')](config[_0x7d1a('0xb5')],'server/files/images/',_0x359fd1[_0x7d1a('0xb7')]));}}})[_0x7d1a('0x4f')](handleError(_0x47818a,null));};exports[_0x7d1a('0xbb')]=function(_0x5dd68b,_0x349ef8){return db[_0x7d1a('0x3d')][_0x7d1a('0x37')]({'where':{'id':_0x5dd68b[_0x7d1a('0x51')]['id']},'attributes':['id']})[_0x7d1a('0x18')](handleEntityNotFound(_0x349ef8,null))[_0x7d1a('0x18')](function(_0x52b8cd){var _0x259a60=[];values=_0x52b8cd[_0x7d1a('0x4c')];_0x259a60[_0x7d1a('0x47')](get_open_tabs(_0x7d1a('0x4b'),_0x52b8cd[_0x7d1a('0x4c')]));_0x259a60[_0x7d1a('0x47')](get_open_tabs(_0x7d1a('0xbc'),_0x52b8cd[_0x7d1a('0x4c')]));_0x259a60[_0x7d1a('0x47')](get_open_tabs(_0x7d1a('0x4e'),_0x52b8cd['dataValues']));_0x259a60[_0x7d1a('0x47')](get_open_tabs('whatsapp',_0x52b8cd[_0x7d1a('0x4c')]));_0x259a60[_0x7d1a('0x47')](get_open_tabs(_0x7d1a('0xbd'),_0x52b8cd[_0x7d1a('0x4c')]));_0x259a60[_0x7d1a('0x47')](get_open_tabs(_0x7d1a('0x4d'),_0x52b8cd['dataValues']));return Promise[_0x7d1a('0x5d')](_0x259a60);})[_0x7d1a('0x18')](function(_0x3a7233){if(_0x3a7233){var _0x310aa2=_[_0x7d1a('0x89')](values[_0x7d1a('0xbe')],function(_0x1c6d2f){return{'channel':_0x7d1a('0xbf'),'id':_0x1c6d2f['id'],'createdAt':_0x1c6d2f[_0x7d1a('0xc0')]};});var _0x518a3e=_['map'](values[_0x7d1a('0xc1')],function(_0x154a9c){return{'channel':_0x7d1a('0xc2'),'id':_0x154a9c['id'],'createdAt':_0x154a9c[_0x7d1a('0xc0')]};});var _0x5cdbf2=_[_0x7d1a('0x89')](values[_0x7d1a('0xc3')],function(_0x464877){return{'channel':_0x7d1a('0xc4'),'id':_0x464877['id'],'createdAt':_0x464877[_0x7d1a('0xc0')]};});var _0x58d495=_[_0x7d1a('0x89')](values[_0x7d1a('0xc5')],function(_0x46f926){return{'channel':_0x7d1a('0xc6'),'id':_0x46f926['id'],'createdAt':_0x46f926[_0x7d1a('0xc0')]};});var _0x12e91b=_[_0x7d1a('0x89')](values[_0x7d1a('0xc7')],function(_0x3a73c0){return{'channel':'SMS','id':_0x3a73c0['id'],'createdAt':_0x3a73c0[_0x7d1a('0xc0')]};});var _0x98dc7e=_[_0x7d1a('0x89')](values[_0x7d1a('0xc8')],function(_0x9ff132){return{'channel':_0x7d1a('0xc9'),'id':_0x9ff132['id'],'createdAt':_0x9ff132[_0x7d1a('0xc0')]};});var _0x3afd8c=_[_0x7d1a('0xca')](_0x310aa2,_0x518a3e,_0x5cdbf2,_0x58d495,_0x12e91b,_0x98dc7e);var _0x2cd103={'count':_0x3afd8c['length'],'rows':_0x3afd8c};return _0x2cd103;}else return null;})['then'](respondWithResult(_0x349ef8,null))[_0x7d1a('0x4f')](handleError(_0x349ef8,null));};exports[_0x7d1a('0xcb')]=function(_0x5928c9,_0x203ddc){var _0x55d15d={};var _0x5b7a59={};var _0x2d6908;var _0x1db407;return db[_0x7d1a('0x3d')][_0x7d1a('0x93')]({'where':{'id':_0x5928c9[_0x7d1a('0x51')]['id']}})[_0x7d1a('0x18')](handleEntityNotFound(_0x203ddc,null))[_0x7d1a('0x18')](function(_0xc96404){if(_0xc96404){_0x2d6908=_0xc96404;_0x5b7a59[_0x7d1a('0x52')]=_[_0x7d1a('0x53')](db[_0x7d1a('0xcc')][_0x7d1a('0x3e')]);_0x5b7a59['query']=_[_0x7d1a('0x53')](_0x5928c9[_0x7d1a('0x44')]);_0x5b7a59['filters']=_[_0x7d1a('0x56')](_0x5b7a59[_0x7d1a('0x52')],_0x5b7a59[_0x7d1a('0x44')]);_0x55d15d[_0x7d1a('0x46')]=_['intersection'](_0x5b7a59['model'],qs[_0x7d1a('0x57')](_0x5928c9[_0x7d1a('0x44')][_0x7d1a('0x57')]));_0x55d15d[_0x7d1a('0x46')]=_0x55d15d['attributes'][_0x7d1a('0x4a')]?_0x55d15d[_0x7d1a('0x46')]:_0x5b7a59[_0x7d1a('0x52')];_0x55d15d[_0x7d1a('0xcd')]=qs['sort'](_0x5928c9['query']['sort']);_0x55d15d[_0x7d1a('0xce')]=qs[_0x7d1a('0x55')](_['pick'](_0x5928c9[_0x7d1a('0x44')],_0x5b7a59[_0x7d1a('0x55')]));if(_0x5928c9[_0x7d1a('0x44')][_0x7d1a('0x33')]){_0x55d15d['where']=_[_0x7d1a('0x59')](_0x55d15d[_0x7d1a('0xce')],{'$or':_['map'](_0x55d15d[_0x7d1a('0x46')],function(_0x3c64c0){var _0x7974a2={};_0x7974a2[_0x3c64c0]={'$like':'%'+_0x5928c9[_0x7d1a('0x44')][_0x7d1a('0x33')]+'%'};return _0x7974a2;})});}_0x55d15d=_[_0x7d1a('0x59')]({},_0x55d15d,_0x5928c9[_0x7d1a('0x5a')]);return _0x2d6908[_0x7d1a('0xcb')](_0x55d15d);}})[_0x7d1a('0x18')](function(_0x18ee76){if(_0x18ee76){_0x1db407=_0x18ee76[_0x7d1a('0x4a')];if(_0x5928c9[_0x7d1a('0x44')][_0x7d1a('0xcf')](_0x7d1a('0x42'))){_0x55d15d[_0x7d1a('0x43')]=[{'model':db[_0x7d1a('0xd0')],'as':_0x7d1a('0xd1'),'required':![]},{'model':db[_0x7d1a('0xd2')],'as':'Tags','attributes':['id',_0x7d1a('0x38'),'color'],'where':_0x5928c9['query'][_0x7d1a('0xd3')]?{'id':_0x5928c9[_0x7d1a('0x44')][_0x7d1a('0xd3')]}:undefined,'required':_0x5928c9[_0x7d1a('0x44')][_0x7d1a('0xd3')]?!![]:![]}];}if(!_0x5928c9[_0x7d1a('0x44')]['hasOwnProperty']('nolimit')){_0x55d15d[_0x7d1a('0x26')]=qs[_0x7d1a('0x26')](_0x5928c9[_0x7d1a('0x44')][_0x7d1a('0x26')]);_0x55d15d[_0x7d1a('0x25')]=qs['offset'](_0x5928c9['query']['offset']);}return _0x2d6908[_0x7d1a('0xcb')](_0x55d15d);}})[_0x7d1a('0x18')](function(_0x10ff30){if(_0x10ff30){return _0x10ff30?{'count':_0x1db407,'rows':_0x10ff30}:null;}})['then'](respondWithResult(_0x203ddc,null))['catch'](handleError(_0x203ddc,null));};exports[_0x7d1a('0xd4')]=function(_0x8c0f3b,_0x480657){var _0x264b7a;var _0x5a9ad1={};var _0x3c7f0d;return db[_0x7d1a('0x3d')][_0x7d1a('0x93')]({'where':{'id':_0x8c0f3b[_0x7d1a('0x51')]['id']},'attributes':['id',_0x7d1a('0x38'),_0x7d1a('0x29')]})[_0x7d1a('0x18')](handleEntityNotFound(_0x480657,null))[_0x7d1a('0x18')](function(_0x3a9551){if(!utils[_0x7d1a('0xad')](_0x8c0f3b[_0x7d1a('0x44')][_0x7d1a('0xac')])){throw new db['Sequelize'][(_0x7d1a('0x8f'))]('Unknown\x20channel');}_0x264b7a=_0x3a9551;var _0x3ff86a={};_0x3ff86a[_0x7d1a('0x52')]=_[_0x7d1a('0x53')](db[_['capitalize'](_0x8c0f3b[_0x7d1a('0x44')][_0x7d1a('0xac')])+_0x7d1a('0xd5')][_0x7d1a('0x3e')]);_0x3ff86a[_0x7d1a('0x44')]=_[_0x7d1a('0x53')](_0x8c0f3b[_0x7d1a('0x44')]);_0x3ff86a[_0x7d1a('0x55')]=_[_0x7d1a('0x56')](_0x3ff86a[_0x7d1a('0x52')],_0x3ff86a['query']);_0x5a9ad1[_0x7d1a('0x46')]=_[_0x7d1a('0x56')](_0x3ff86a[_0x7d1a('0x52')],qs['fields'](_0x8c0f3b[_0x7d1a('0x44')]['fields']));_0x5a9ad1[_0x7d1a('0x46')]=_0x5a9ad1[_0x7d1a('0x46')][_0x7d1a('0x4a')]?_0x5a9ad1[_0x7d1a('0x46')]:_0x3ff86a[_0x7d1a('0x52')];_0x5a9ad1['order']=qs[_0x7d1a('0xd6')](_0x8c0f3b[_0x7d1a('0x44')][_0x7d1a('0xd6')]);_0x5a9ad1['where']=qs[_0x7d1a('0x55')](_[_0x7d1a('0xd7')](_0x8c0f3b[_0x7d1a('0x44')],_0x3ff86a[_0x7d1a('0x55')]));if(_0x8c0f3b[_0x7d1a('0x44')][_0x7d1a('0x33')]){_0x5a9ad1[_0x7d1a('0xce')]=_[_0x7d1a('0x59')](_0x5a9ad1[_0x7d1a('0xce')],{'$or':_['map'](_0x5a9ad1[_0x7d1a('0x46')],function(_0x26d0e4){var _0x2a0ead={};_0x2a0ead[_0x26d0e4]={'$like':'%'+_0x8c0f3b['query']['filter']+'%'};return _0x2a0ead;})});}_0x5a9ad1=_[_0x7d1a('0x59')]({},_0x5a9ad1,_0x8c0f3b['options']);switch(_0x264b7a['role']){case'admin':return db[_['capitalize'](_0x8c0f3b[_0x7d1a('0x44')]['channel'])+_0x7d1a('0xd5')][_0x7d1a('0x48')](_0x5a9ad1);case'user':case'agent':return _0x264b7a[_0x7d1a('0x2e')+_[_0x7d1a('0x9f')](_0x8c0f3b['query'][_0x7d1a('0xac')])+'Queues'](_0x5a9ad1);default:throw new db['Sequelize'][(_0x7d1a('0x8f'))](_0x7d1a('0xd8'));}})[_0x7d1a('0x18')](function(_0x104d16){_0x3c7f0d=_0x104d16[_0x7d1a('0x4a')];if(!_0x8c0f3b[_0x7d1a('0x44')][_0x7d1a('0xcf')]('nolimit')){_0x5a9ad1[_0x7d1a('0x26')]=qs[_0x7d1a('0x26')](_0x8c0f3b[_0x7d1a('0x44')][_0x7d1a('0x26')]);_0x5a9ad1[_0x7d1a('0x25')]=qs['offset'](_0x8c0f3b[_0x7d1a('0x44')]['offset']);}switch(_0x264b7a[_0x7d1a('0x29')]){case _0x7d1a('0x2f'):return db[_['capitalize'](_0x8c0f3b[_0x7d1a('0x44')][_0x7d1a('0xac')])+_0x7d1a('0xd5')][_0x7d1a('0x48')](_0x5a9ad1);case'user':case _0x7d1a('0x2a'):return _0x264b7a[_0x7d1a('0x2e')+_[_0x7d1a('0x9f')](_0x8c0f3b[_0x7d1a('0x44')][_0x7d1a('0xac')])+_0x7d1a('0xa1')](_0x5a9ad1);}})['then'](function(_0xb9894){return{'count':_0x3c7f0d,'rows':_0xb9894};})['then'](respondWithResult(_0x480657,null))['catch'](handleError(_0x480657,null));};exports[_0x7d1a('0xd9')]=function(_0x1b2474,_0x14180d){var _0x5d0da9={};var _0x368965={};var _0x8819cc;var _0x5994af;return db[_0x7d1a('0x3d')][_0x7d1a('0x93')]({'where':{'id':_0x1b2474[_0x7d1a('0x51')]['id']}})[_0x7d1a('0x18')](handleEntityNotFound(_0x14180d,null))['then'](function(_0x3717cc){if(_0x3717cc){_0x8819cc=_0x3717cc;_0x368965[_0x7d1a('0x52')]=_[_0x7d1a('0x53')](db['UserVoiceQueueRt'][_0x7d1a('0x3e')]);_0x368965[_0x7d1a('0x44')]=_[_0x7d1a('0x53')](_0x1b2474[_0x7d1a('0x44')]);_0x368965['filters']=_[_0x7d1a('0x56')](_0x368965[_0x7d1a('0x52')],_0x368965[_0x7d1a('0x44')]);_0x5d0da9[_0x7d1a('0x46')]=_['intersection'](_0x368965['model'],qs['fields'](_0x1b2474[_0x7d1a('0x44')][_0x7d1a('0x57')]));_0x5d0da9['attributes']=_0x5d0da9[_0x7d1a('0x46')][_0x7d1a('0x4a')]?_0x5d0da9['attributes']:_0x368965[_0x7d1a('0x52')];_0x5d0da9[_0x7d1a('0xcd')]=qs[_0x7d1a('0xd6')](_0x1b2474[_0x7d1a('0x44')][_0x7d1a('0xd6')]);_0x5d0da9[_0x7d1a('0xce')]=qs['filters'](_[_0x7d1a('0xd7')](_0x1b2474[_0x7d1a('0x44')],_0x368965[_0x7d1a('0x55')]));if(_0x1b2474[_0x7d1a('0x44')]['filter']){_0x5d0da9[_0x7d1a('0xce')]=_[_0x7d1a('0x59')](_0x5d0da9[_0x7d1a('0xce')],{'$or':_[_0x7d1a('0x89')](_0x5d0da9['attributes'],function(_0xdd5289){var _0x179fb6={};_0x179fb6[_0xdd5289]={'$like':'%'+_0x1b2474[_0x7d1a('0x44')][_0x7d1a('0x33')]+'%'};return _0x179fb6;})});}_0x5d0da9=_['merge']({},_0x5d0da9,_0x1b2474['options']);return _0x8819cc['getVoiceQueuesRt'](_0x5d0da9);}})[_0x7d1a('0x18')](function(_0x254a77){if(_0x254a77){_0x5994af=_0x254a77['length'];if(!_0x1b2474[_0x7d1a('0x44')][_0x7d1a('0xcf')](_0x7d1a('0xda'))){_0x5d0da9[_0x7d1a('0x26')]=qs[_0x7d1a('0x26')](_0x1b2474[_0x7d1a('0x44')]['limit']);_0x5d0da9['offset']=qs[_0x7d1a('0x25')](_0x1b2474[_0x7d1a('0x44')]['offset']);}return _0x8819cc[_0x7d1a('0xd9')](_0x5d0da9);}})[_0x7d1a('0x18')](function(_0x2d6e87){if(_0x2d6e87){return _0x2d6e87?{'count':_0x5994af,'rows':_0x2d6e87}:null;}})[_0x7d1a('0x18')](respondWithResult(_0x14180d,null))[_0x7d1a('0x4f')](handleError(_0x14180d,null));};exports[_0x7d1a('0xdb')]=function(_0x1affc6,_0x37ce00){var _0x476932={};var _0x194706={};var _0x22c47f;var _0xb6a0a;return db[_0x7d1a('0x3d')]['findOne']({'where':{'id':_0x1affc6[_0x7d1a('0x51')]['id']}})[_0x7d1a('0x18')](handleEntityNotFound(_0x37ce00,null))[_0x7d1a('0x18')](function(_0x51d7e2){if(_0x51d7e2){_0x22c47f=_0x51d7e2;_0x194706[_0x7d1a('0x52')]=_[_0x7d1a('0x53')](db[_0x7d1a('0xdc')][_0x7d1a('0x3e')]);_0x194706[_0x7d1a('0x44')]=_[_0x7d1a('0x53')](_0x1affc6[_0x7d1a('0x44')]);_0x194706[_0x7d1a('0x55')]=_['intersection'](_0x194706[_0x7d1a('0x52')],_0x194706[_0x7d1a('0x44')]);_0x476932['attributes']=_['intersection'](_0x194706[_0x7d1a('0x52')],qs[_0x7d1a('0x57')](_0x1affc6[_0x7d1a('0x44')][_0x7d1a('0x57')]));_0x476932[_0x7d1a('0x46')]=_0x476932[_0x7d1a('0x46')][_0x7d1a('0x4a')]?_0x476932[_0x7d1a('0x46')]:_0x194706['model'];_0x476932[_0x7d1a('0xcd')]=qs[_0x7d1a('0xd6')](_0x1affc6[_0x7d1a('0x44')][_0x7d1a('0xd6')]);_0x476932[_0x7d1a('0xce')]=qs[_0x7d1a('0x55')](_[_0x7d1a('0xd7')](_0x1affc6['query'],_0x194706[_0x7d1a('0x55')]));if(_0x1affc6[_0x7d1a('0x44')][_0x7d1a('0x33')]){_0x476932[_0x7d1a('0xce')]=_[_0x7d1a('0x59')](_0x476932['where'],{'$or':_[_0x7d1a('0x89')](_0x476932[_0x7d1a('0x46')],function(_0x325c28){var _0x42508e={};_0x42508e[_0x325c28]={'$like':'%'+_0x1affc6['query'][_0x7d1a('0x33')]+'%'};return _0x42508e;})});}_0x476932=_[_0x7d1a('0x59')]({},_0x476932,_0x1affc6['options']);return _0x22c47f[_0x7d1a('0xdb')](_0x476932);}})[_0x7d1a('0x18')](function(_0x2acf83){if(_0x2acf83){_0xb6a0a=_0x2acf83[_0x7d1a('0x4a')];if(!_0x1affc6[_0x7d1a('0x44')][_0x7d1a('0xcf')](_0x7d1a('0xda'))){_0x476932[_0x7d1a('0x26')]=qs[_0x7d1a('0x26')](_0x1affc6[_0x7d1a('0x44')][_0x7d1a('0x26')]);_0x476932[_0x7d1a('0x25')]=qs['offset'](_0x1affc6[_0x7d1a('0x44')][_0x7d1a('0x25')]);}return _0x22c47f[_0x7d1a('0xdb')](_0x476932);}})[_0x7d1a('0x18')](function(_0x1d160f){if(_0x1d160f){return _0x1d160f?{'count':_0xb6a0a,'rows':_0x1d160f}:null;}})['then'](respondWithResult(_0x37ce00,null))['catch'](handleError(_0x37ce00,null));};exports[_0x7d1a('0xdd')]=function(_0x2951dd,_0x27d0e9){var _0x5de256={'raw':!![],'where':{}};var _0x20fa8b={};var _0x31535a={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x2951dd['params']['id']}})[_0x7d1a('0x18')](handleEntityNotFound(_0x27d0e9,null))[_0x7d1a('0x18')](function(_0x35875c){if(_0x35875c){_0x20fa8b[_0x7d1a('0x52')]=_[_0x7d1a('0x53')](db[_0x7d1a('0xde')][_0x7d1a('0x3e')]);_0x20fa8b[_0x7d1a('0x44')]=_[_0x7d1a('0x53')](_0x2951dd[_0x7d1a('0x44')]);_0x20fa8b[_0x7d1a('0x55')]=_[_0x7d1a('0x56')](_0x20fa8b[_0x7d1a('0x52')],_0x20fa8b[_0x7d1a('0x44')]);_0x5de256[_0x7d1a('0x46')]=_['intersection'](_0x20fa8b['model'],qs[_0x7d1a('0x57')](_0x2951dd[_0x7d1a('0x44')][_0x7d1a('0x57')]));_0x5de256[_0x7d1a('0x46')]=_0x5de256[_0x7d1a('0x46')][_0x7d1a('0x4a')]?_0x5de256[_0x7d1a('0x46')]:_0x20fa8b[_0x7d1a('0x52')];if(!_0x2951dd['query'][_0x7d1a('0xcf')](_0x7d1a('0xda'))){_0x5de256['limit']=qs['limit'](_0x2951dd[_0x7d1a('0x44')][_0x7d1a('0x26')]);_0x5de256[_0x7d1a('0x25')]=qs[_0x7d1a('0x25')](_0x2951dd[_0x7d1a('0x44')][_0x7d1a('0x25')]);}_0x5de256[_0x7d1a('0xcd')]=qs[_0x7d1a('0xd6')](_0x2951dd[_0x7d1a('0x44')][_0x7d1a('0xd6')]);_0x5de256[_0x7d1a('0xce')]=qs[_0x7d1a('0x55')](_[_0x7d1a('0xd7')](_0x2951dd[_0x7d1a('0x44')],_0x20fa8b[_0x7d1a('0x55')]));_0x5de256['where'][_0x7d1a('0xdf')]=_0x35875c['id'];if(_0x2951dd[_0x7d1a('0x44')][_0x7d1a('0x33')]){_0x5de256[_0x7d1a('0xce')]=_['merge'](_0x5de256[_0x7d1a('0xce')],{'$or':_[_0x7d1a('0x89')](_0x5de256[_0x7d1a('0x46')],function(_0x30c7b8){var _0x4be791={};_0x4be791[_0x30c7b8]={'$like':'%'+_0x2951dd[_0x7d1a('0x44')]['filter']+'%'};return _0x4be791;})});}_0x5de256=_[_0x7d1a('0x59')]({},_0x5de256,_0x2951dd[_0x7d1a('0x5a')]);return db['VoiceRecording'][_0x7d1a('0x24')]({'where':_0x5de256[_0x7d1a('0xce')]})[_0x7d1a('0x18')](function(_0x5471b2){_0x31535a['count']=_0x5471b2;if(_0x2951dd['query']['includeAll']){_0x5de256[_0x7d1a('0x43')]=[{'all':!![]}];}return db['VoiceRecording'][_0x7d1a('0x48')](_0x5de256);})[_0x7d1a('0x18')](function(_0x4b6398){_0x31535a[_0x7d1a('0x49')]=_0x4b6398;return _0x31535a;});}})[_0x7d1a('0x18')](respondWithFilteredResult(_0x27d0e9,_0x5de256))['catch'](handleError(_0x27d0e9,null));};exports[_0x7d1a('0xe0')]=function(_0x552644,_0x1489dd){var _0x62f87b={'raw':!![],'where':{}};var _0x4d19d9={};var _0x1e48dd={'count':0x0,'rows':[]};return db[_0x7d1a('0x3d')][_0x7d1a('0x93')]({'where':{'id':_0x552644[_0x7d1a('0x51')]['id']}})[_0x7d1a('0x18')](handleEntityNotFound(_0x1489dd,null))[_0x7d1a('0x18')](function(_0x232522){if(_0x232522){_0x4d19d9['model']=_[_0x7d1a('0x53')](db[_0x7d1a('0xe1')][_0x7d1a('0x3e')]);_0x4d19d9[_0x7d1a('0x44')]=_['keys'](_0x552644['query']);_0x4d19d9['filters']=_[_0x7d1a('0x56')](_0x4d19d9['model'],_0x4d19d9[_0x7d1a('0x44')]);_0x62f87b[_0x7d1a('0x46')]=_[_0x7d1a('0x56')](_0x4d19d9[_0x7d1a('0x52')],qs[_0x7d1a('0x57')](_0x552644[_0x7d1a('0x44')]['fields']));_0x62f87b[_0x7d1a('0x46')]=_0x62f87b['attributes'][_0x7d1a('0x4a')]?_0x62f87b['attributes']:_0x4d19d9[_0x7d1a('0x52')];if(!_0x552644['query']['hasOwnProperty'](_0x7d1a('0xda'))){_0x62f87b[_0x7d1a('0x26')]=qs[_0x7d1a('0x26')](_0x552644['query'][_0x7d1a('0x26')]);_0x62f87b[_0x7d1a('0x25')]=qs[_0x7d1a('0x25')](_0x552644[_0x7d1a('0x44')][_0x7d1a('0x25')]);}_0x62f87b[_0x7d1a('0xcd')]=qs[_0x7d1a('0xd6')](_0x552644['query'][_0x7d1a('0xd6')]);_0x62f87b['where']=qs['filters'](_[_0x7d1a('0xd7')](_0x552644['query'],_0x4d19d9['filters']));_0x62f87b[_0x7d1a('0xce')][_0x7d1a('0xdf')]=_0x232522['id'];if(_0x552644['query'][_0x7d1a('0x33')]){_0x62f87b[_0x7d1a('0xce')]=_['merge'](_0x62f87b[_0x7d1a('0xce')],{'$or':_[_0x7d1a('0x89')](_0x62f87b[_0x7d1a('0x46')],function(_0x37505c){var _0x183748={};_0x183748[_0x37505c]={'$like':'%'+_0x552644[_0x7d1a('0x44')][_0x7d1a('0x33')]+'%'};return _0x183748;})});}_0x62f87b=_['merge']({},_0x62f87b,_0x552644[_0x7d1a('0x5a')]);return db[_0x7d1a('0xe1')][_0x7d1a('0x24')]({'where':_0x62f87b[_0x7d1a('0xce')]})['then'](function(_0x2ea199){_0x1e48dd[_0x7d1a('0x24')]=_0x2ea199;if(_0x552644[_0x7d1a('0x44')][_0x7d1a('0x42')]){_0x62f87b['include']=[{'all':!![]}];}return db[_0x7d1a('0xe1')]['findAll'](_0x62f87b);})[_0x7d1a('0x18')](function(_0x49cadb){_0x1e48dd['rows']=_0x49cadb;return _0x1e48dd;});}})[_0x7d1a('0x18')](respondWithFilteredResult(_0x1489dd,_0x62f87b))[_0x7d1a('0x4f')](handleError(_0x1489dd,null));};exports['getChatInteractions']=function(_0x45b713,_0x4e0058){var _0x590852={};var _0x55f207={};var _0x4ba7e7;var _0x1aa3fc;return db['User'][_0x7d1a('0x93')]({'where':{'id':_0x45b713['params']['id']}})[_0x7d1a('0x18')](handleEntityNotFound(_0x4e0058,null))[_0x7d1a('0x18')](function(_0xae4037){if(_0xae4037){_0x4ba7e7=_0xae4037;_0x55f207[_0x7d1a('0x52')]=_['keys'](db[_0x7d1a('0xe2')][_0x7d1a('0x3e')]);_0x55f207['query']=_['keys'](_0x45b713[_0x7d1a('0x44')]);_0x55f207[_0x7d1a('0x55')]=_[_0x7d1a('0x56')](_0x55f207[_0x7d1a('0x52')],_0x55f207[_0x7d1a('0x44')]);_0x590852[_0x7d1a('0x46')]=_[_0x7d1a('0x56')](_0x55f207[_0x7d1a('0x52')],qs[_0x7d1a('0x57')](_0x45b713[_0x7d1a('0x44')][_0x7d1a('0x57')]));_0x590852[_0x7d1a('0x46')]=_0x590852[_0x7d1a('0x46')][_0x7d1a('0x4a')]?_0x590852[_0x7d1a('0x46')]:_0x55f207[_0x7d1a('0x52')];_0x590852['order']=qs[_0x7d1a('0xd6')](_0x45b713['query'][_0x7d1a('0xd6')]);_0x590852[_0x7d1a('0xce')]=qs['filters'](_[_0x7d1a('0xd7')](_0x45b713[_0x7d1a('0x44')],_0x55f207[_0x7d1a('0x55')]));if(_0x45b713[_0x7d1a('0x44')][_0x7d1a('0x33')]){_0x590852['where']=_[_0x7d1a('0x59')](_0x590852['where'],{'$or':_[_0x7d1a('0x89')](_0x590852[_0x7d1a('0x46')],function(_0x2c8930){var _0x586063={};_0x586063[_0x2c8930]={'$like':'%'+_0x45b713[_0x7d1a('0x44')][_0x7d1a('0x33')]+'%'};return _0x586063;})});}_0x590852=_['merge']({},_0x590852,_0x45b713['options']);return _0x4ba7e7['getChatInteractions'](_0x590852);}})[_0x7d1a('0x18')](function(_0x506c45){if(_0x506c45){_0x1aa3fc=_0x506c45[_0x7d1a('0x4a')];if(!_0x45b713[_0x7d1a('0x44')][_0x7d1a('0xcf')](_0x7d1a('0xda'))){_0x590852['limit']=qs['limit'](_0x45b713[_0x7d1a('0x44')][_0x7d1a('0x26')]);_0x590852[_0x7d1a('0x25')]=qs[_0x7d1a('0x25')](_0x45b713[_0x7d1a('0x44')][_0x7d1a('0x25')]);}return _0x4ba7e7[_0x7d1a('0xe3')](_0x590852);}})[_0x7d1a('0x18')](function(_0x42d1ca){if(_0x42d1ca){return _0x42d1ca?{'count':_0x1aa3fc,'rows':_0x42d1ca}:null;}})[_0x7d1a('0x18')](respondWithResult(_0x4e0058,null))['catch'](handleError(_0x4e0058,null));};exports['getOpenchannelInteractions']=function(_0x2d5863,_0x34d307){var _0x50edda={};var _0x47e0e7={};var _0x31534b;var _0xb2f41d;return db[_0x7d1a('0x3d')][_0x7d1a('0x93')]({'where':{'id':_0x2d5863[_0x7d1a('0x51')]['id']}})['then'](handleEntityNotFound(_0x34d307,null))[_0x7d1a('0x18')](function(_0xbc9ff0){if(_0xbc9ff0){_0x31534b=_0xbc9ff0;_0x47e0e7['model']=_[_0x7d1a('0x53')](db['OpenchannelInteraction']['rawAttributes']);_0x47e0e7['query']=_['keys'](_0x2d5863[_0x7d1a('0x44')]);_0x47e0e7[_0x7d1a('0x55')]=_['intersection'](_0x47e0e7[_0x7d1a('0x52')],_0x47e0e7[_0x7d1a('0x44')]);_0x50edda[_0x7d1a('0x46')]=_[_0x7d1a('0x56')](_0x47e0e7[_0x7d1a('0x52')],qs['fields'](_0x2d5863[_0x7d1a('0x44')][_0x7d1a('0x57')]));_0x50edda[_0x7d1a('0x46')]=_0x50edda[_0x7d1a('0x46')][_0x7d1a('0x4a')]?_0x50edda[_0x7d1a('0x46')]:_0x47e0e7['model'];_0x50edda[_0x7d1a('0xcd')]=qs[_0x7d1a('0xd6')](_0x2d5863[_0x7d1a('0x44')][_0x7d1a('0xd6')]);_0x50edda[_0x7d1a('0xce')]=qs[_0x7d1a('0x55')](_[_0x7d1a('0xd7')](_0x2d5863[_0x7d1a('0x44')],_0x47e0e7[_0x7d1a('0x55')]));if(_0x2d5863[_0x7d1a('0x44')]['filter']){_0x50edda[_0x7d1a('0xce')]=_[_0x7d1a('0x59')](_0x50edda[_0x7d1a('0xce')],{'$or':_[_0x7d1a('0x89')](_0x50edda[_0x7d1a('0x46')],function(_0x39e82c){var _0x3f5ba1={};_0x3f5ba1[_0x39e82c]={'$like':'%'+_0x2d5863[_0x7d1a('0x44')][_0x7d1a('0x33')]+'%'};return _0x3f5ba1;})});}_0x50edda=_[_0x7d1a('0x59')]({},_0x50edda,_0x2d5863[_0x7d1a('0x5a')]);return _0x31534b[_0x7d1a('0xe4')](_0x50edda);}})[_0x7d1a('0x18')](function(_0x3103d8){if(_0x3103d8){_0xb2f41d=_0x3103d8[_0x7d1a('0x4a')];if(!_0x2d5863[_0x7d1a('0x44')][_0x7d1a('0xcf')]('nolimit')){_0x50edda[_0x7d1a('0x26')]=qs['limit'](_0x2d5863[_0x7d1a('0x44')][_0x7d1a('0x26')]);_0x50edda[_0x7d1a('0x25')]=qs['offset'](_0x2d5863[_0x7d1a('0x44')][_0x7d1a('0x25')]);}return _0x31534b[_0x7d1a('0xe4')](_0x50edda);}})[_0x7d1a('0x18')](function(_0x569c2a){if(_0x569c2a){return _0x569c2a?{'count':_0xb2f41d,'rows':_0x569c2a}:null;}})[_0x7d1a('0x18')](respondWithResult(_0x34d307,null))[_0x7d1a('0x4f')](handleError(_0x34d307,null));};exports[_0x7d1a('0xe5')]=function(_0x4917b1,_0x345335){var _0x16f6fe={'raw':!![],'where':{}};var _0x3adf03={};var _0x1b61fe={'count':0x0,'rows':[]};return db[_0x7d1a('0x3d')][_0x7d1a('0x93')]({'where':{'id':_0x4917b1[_0x7d1a('0x51')]['id']}})[_0x7d1a('0x18')](handleEntityNotFound(_0x345335,null))[_0x7d1a('0x18')](function(_0x154b6b){if(_0x154b6b){_0x3adf03[_0x7d1a('0x52')]=_[_0x7d1a('0x53')](db[_0x7d1a('0xe6')][_0x7d1a('0x3e')]);_0x3adf03[_0x7d1a('0x44')]=_[_0x7d1a('0x53')](_0x4917b1[_0x7d1a('0x44')]);_0x3adf03[_0x7d1a('0x55')]=_[_0x7d1a('0x56')](_0x3adf03['model'],_0x3adf03[_0x7d1a('0x44')]);_0x16f6fe[_0x7d1a('0x46')]=_[_0x7d1a('0x56')](_0x3adf03['model'],qs['fields'](_0x4917b1[_0x7d1a('0x44')][_0x7d1a('0x57')]));_0x16f6fe[_0x7d1a('0x46')]=_0x16f6fe[_0x7d1a('0x46')]['length']?_0x16f6fe['attributes']:_0x3adf03[_0x7d1a('0x52')];if(!_0x4917b1['query'][_0x7d1a('0xcf')](_0x7d1a('0xda'))){_0x16f6fe['limit']=qs['limit'](_0x4917b1[_0x7d1a('0x44')]['limit']);_0x16f6fe[_0x7d1a('0x25')]=qs[_0x7d1a('0x25')](_0x4917b1[_0x7d1a('0x44')][_0x7d1a('0x25')]);}_0x16f6fe[_0x7d1a('0xcd')]=qs[_0x7d1a('0xd6')](_0x4917b1[_0x7d1a('0x44')][_0x7d1a('0xd6')]);_0x16f6fe[_0x7d1a('0xce')]=qs['filters'](_['pick'](_0x4917b1[_0x7d1a('0x44')],_0x3adf03['filters']));_0x16f6fe[_0x7d1a('0xce')][_0x7d1a('0xdf')]=_0x154b6b['id'];if(_0x4917b1[_0x7d1a('0x44')]['filter']){_0x16f6fe['where']=_[_0x7d1a('0x59')](_0x16f6fe[_0x7d1a('0xce')],{'$or':_[_0x7d1a('0x89')](_0x16f6fe[_0x7d1a('0x46')],function(_0xdf87e0){var _0x5972d6={};_0x5972d6[_0xdf87e0]={'$like':'%'+_0x4917b1['query'][_0x7d1a('0x33')]+'%'};return _0x5972d6;})});}_0x16f6fe=_[_0x7d1a('0x59')]({},_0x16f6fe,_0x4917b1[_0x7d1a('0x5a')]);return db['MailInteraction'][_0x7d1a('0x24')]({'where':_0x16f6fe[_0x7d1a('0xce')]})['then'](function(_0x10430e){_0x1b61fe[_0x7d1a('0x24')]=_0x10430e;if(_0x4917b1[_0x7d1a('0x44')][_0x7d1a('0x42')]){_0x16f6fe['include']=[{'all':!![]}];}return db[_0x7d1a('0xe6')][_0x7d1a('0x48')](_0x16f6fe);})['then'](function(_0x202a33){_0x1b61fe[_0x7d1a('0x49')]=_0x202a33;return _0x1b61fe;});}})[_0x7d1a('0x18')](respondWithFilteredResult(_0x345335,_0x16f6fe))['catch'](handleError(_0x345335,null));};exports[_0x7d1a('0xe7')]=function(_0x33d083,_0x176eca){var _0x24a676={};var _0x193a36={};var _0x331888;var _0x10d1c3;return db[_0x7d1a('0x3d')]['findOne']({'where':{'id':_0x33d083[_0x7d1a('0x51')]['id']}})[_0x7d1a('0x18')](handleEntityNotFound(_0x176eca,null))[_0x7d1a('0x18')](function(_0x36c601){if(_0x36c601){_0x331888=_0x36c601;_0x193a36[_0x7d1a('0x52')]=_[_0x7d1a('0x53')](db['SmsInteraction'][_0x7d1a('0x3e')]);_0x193a36['query']=_['keys'](_0x33d083[_0x7d1a('0x44')]);_0x193a36[_0x7d1a('0x55')]=_['intersection'](_0x193a36[_0x7d1a('0x52')],_0x193a36[_0x7d1a('0x44')]);_0x24a676[_0x7d1a('0x46')]=_['intersection'](_0x193a36['model'],qs[_0x7d1a('0x57')](_0x33d083['query'][_0x7d1a('0x57')]));_0x24a676[_0x7d1a('0x46')]=_0x24a676[_0x7d1a('0x46')][_0x7d1a('0x4a')]?_0x24a676[_0x7d1a('0x46')]:_0x193a36['model'];_0x24a676[_0x7d1a('0xcd')]=qs[_0x7d1a('0xd6')](_0x33d083[_0x7d1a('0x44')]['sort']);_0x24a676[_0x7d1a('0xce')]=qs[_0x7d1a('0x55')](_[_0x7d1a('0xd7')](_0x33d083['query'],_0x193a36[_0x7d1a('0x55')]));if(_0x33d083[_0x7d1a('0x44')][_0x7d1a('0x33')]){_0x24a676[_0x7d1a('0xce')]=_[_0x7d1a('0x59')](_0x24a676[_0x7d1a('0xce')],{'$or':_[_0x7d1a('0x89')](_0x24a676['attributes'],function(_0x501e30){var _0xbd670b={};_0xbd670b[_0x501e30]={'$like':'%'+_0x33d083[_0x7d1a('0x44')][_0x7d1a('0x33')]+'%'};return _0xbd670b;})});}_0x24a676=_[_0x7d1a('0x59')]({},_0x24a676,_0x33d083['options']);return _0x331888[_0x7d1a('0xe7')](_0x24a676);}})[_0x7d1a('0x18')](function(_0x59b448){if(_0x59b448){_0x10d1c3=_0x59b448[_0x7d1a('0x4a')];if(!_0x33d083[_0x7d1a('0x44')][_0x7d1a('0xcf')](_0x7d1a('0xda'))){_0x24a676[_0x7d1a('0x26')]=qs[_0x7d1a('0x26')](_0x33d083[_0x7d1a('0x44')][_0x7d1a('0x26')]);_0x24a676[_0x7d1a('0x25')]=qs[_0x7d1a('0x25')](_0x33d083['query'][_0x7d1a('0x25')]);}return _0x331888[_0x7d1a('0xe7')](_0x24a676);}})[_0x7d1a('0x18')](function(_0x519724){if(_0x519724){return _0x519724?{'count':_0x10d1c3,'rows':_0x519724}:null;}})[_0x7d1a('0x18')](respondWithResult(_0x176eca,null))[_0x7d1a('0x4f')](handleError(_0x176eca,null));};exports[_0x7d1a('0xe8')]=function(_0x1bf3bb,_0x233fbf){var _0x5ee888={};var _0x51b9dd={};var _0x486776;var _0x4a2908;return db[_0x7d1a('0x3d')][_0x7d1a('0x93')]({'where':{'id':_0x1bf3bb[_0x7d1a('0x51')]['id']}})['then'](handleEntityNotFound(_0x233fbf,null))[_0x7d1a('0x18')](function(_0x1fc2dc){if(_0x1fc2dc){_0x486776=_0x1fc2dc;_0x51b9dd[_0x7d1a('0x52')]=_[_0x7d1a('0x53')](db[_0x7d1a('0xe9')][_0x7d1a('0x3e')]);_0x51b9dd[_0x7d1a('0x44')]=_[_0x7d1a('0x53')](_0x1bf3bb[_0x7d1a('0x44')]);_0x51b9dd[_0x7d1a('0x55')]=_[_0x7d1a('0x56')](_0x51b9dd[_0x7d1a('0x52')],_0x51b9dd[_0x7d1a('0x44')]);_0x5ee888[_0x7d1a('0x46')]=_[_0x7d1a('0x56')](_0x51b9dd[_0x7d1a('0x52')],qs[_0x7d1a('0x57')](_0x1bf3bb[_0x7d1a('0x44')][_0x7d1a('0x57')]));_0x5ee888[_0x7d1a('0x46')]=_0x5ee888['attributes']['length']?_0x5ee888[_0x7d1a('0x46')]:_0x51b9dd['model'];_0x5ee888[_0x7d1a('0xcd')]=qs[_0x7d1a('0xd6')](_0x1bf3bb[_0x7d1a('0x44')][_0x7d1a('0xd6')]);_0x5ee888[_0x7d1a('0xce')]=qs[_0x7d1a('0x55')](_['pick'](_0x1bf3bb[_0x7d1a('0x44')],_0x51b9dd[_0x7d1a('0x55')]));if(_0x1bf3bb[_0x7d1a('0x44')][_0x7d1a('0x33')]){_0x5ee888[_0x7d1a('0xce')]=_[_0x7d1a('0x59')](_0x5ee888[_0x7d1a('0xce')],{'$or':_[_0x7d1a('0x89')](_0x5ee888[_0x7d1a('0x46')],function(_0x3db0d5){var _0xb1496f={};_0xb1496f[_0x3db0d5]={'$like':'%'+_0x1bf3bb[_0x7d1a('0x44')][_0x7d1a('0x33')]+'%'};return _0xb1496f;})});}_0x5ee888=_[_0x7d1a('0x59')]({},_0x5ee888,_0x1bf3bb[_0x7d1a('0x5a')]);return _0x486776[_0x7d1a('0xe8')](_0x5ee888);}})[_0x7d1a('0x18')](function(_0x1acf14){if(_0x1acf14){_0x4a2908=_0x1acf14[_0x7d1a('0x4a')];if(!_0x1bf3bb[_0x7d1a('0x44')][_0x7d1a('0xcf')]('nolimit')){_0x5ee888[_0x7d1a('0x26')]=qs[_0x7d1a('0x26')](_0x1bf3bb[_0x7d1a('0x44')][_0x7d1a('0x26')]);_0x5ee888[_0x7d1a('0x25')]=qs[_0x7d1a('0x25')](_0x1bf3bb[_0x7d1a('0x44')][_0x7d1a('0x25')]);}return _0x486776[_0x7d1a('0xe8')](_0x5ee888);}})[_0x7d1a('0x18')](function(_0x14e0b3){if(_0x14e0b3){return _0x14e0b3?{'count':_0x4a2908,'rows':_0x14e0b3}:null;}})[_0x7d1a('0x18')](respondWithResult(_0x233fbf,null))[_0x7d1a('0x4f')](handleError(_0x233fbf,null));};exports[_0x7d1a('0xea')]=function(_0x587372,_0x3cb731){var _0x28f6a8={};var _0x347065={};var _0x38b92b;var _0x191aaf;return db[_0x7d1a('0x3d')]['findOne']({'where':{'id':_0x587372[_0x7d1a('0x51')]['id']}})[_0x7d1a('0x18')](handleEntityNotFound(_0x3cb731,null))['then'](function(_0x2fdb5e){if(_0x2fdb5e){_0x38b92b=_0x2fdb5e;_0x347065[_0x7d1a('0x52')]=_['keys'](db[_0x7d1a('0xeb')][_0x7d1a('0x3e')]);_0x347065[_0x7d1a('0x44')]=_[_0x7d1a('0x53')](_0x587372[_0x7d1a('0x44')]);_0x347065[_0x7d1a('0x55')]=_[_0x7d1a('0x56')](_0x347065[_0x7d1a('0x52')],_0x347065[_0x7d1a('0x44')]);_0x28f6a8[_0x7d1a('0x46')]=_[_0x7d1a('0x56')](_0x347065['model'],qs[_0x7d1a('0x57')](_0x587372[_0x7d1a('0x44')][_0x7d1a('0x57')]));_0x28f6a8[_0x7d1a('0x46')]=_0x28f6a8[_0x7d1a('0x46')][_0x7d1a('0x4a')]?_0x28f6a8[_0x7d1a('0x46')]:_0x347065[_0x7d1a('0x52')];_0x28f6a8['order']=qs[_0x7d1a('0xd6')](_0x587372[_0x7d1a('0x44')]['sort']);_0x28f6a8[_0x7d1a('0xce')]=qs[_0x7d1a('0x55')](_['pick'](_0x587372['query'],_0x347065['filters']));if(_0x587372[_0x7d1a('0x44')]['filter']){_0x28f6a8[_0x7d1a('0xce')]=_[_0x7d1a('0x59')](_0x28f6a8[_0x7d1a('0xce')],{'$or':_[_0x7d1a('0x89')](_0x28f6a8[_0x7d1a('0x46')],function(_0x2b3a70){var _0x3771dd={};_0x3771dd[_0x2b3a70]={'$like':'%'+_0x587372[_0x7d1a('0x44')][_0x7d1a('0x33')]+'%'};return _0x3771dd;})});}_0x28f6a8=_[_0x7d1a('0x59')]({},_0x28f6a8,_0x587372['options']);return _0x38b92b['getWhatsappInteractions'](_0x28f6a8);}})[_0x7d1a('0x18')](function(_0x512aa1){if(_0x512aa1){_0x191aaf=_0x512aa1['length'];if(!_0x587372[_0x7d1a('0x44')][_0x7d1a('0xcf')](_0x7d1a('0xda'))){_0x28f6a8[_0x7d1a('0x26')]=qs[_0x7d1a('0x26')](_0x587372[_0x7d1a('0x44')][_0x7d1a('0x26')]);_0x28f6a8[_0x7d1a('0x25')]=qs[_0x7d1a('0x25')](_0x587372[_0x7d1a('0x44')][_0x7d1a('0x25')]);}return _0x38b92b[_0x7d1a('0xea')](_0x28f6a8);}})[_0x7d1a('0x18')](function(_0x2629e9){if(_0x2629e9){return _0x2629e9?{'count':_0x191aaf,'rows':_0x2629e9}:null;}})[_0x7d1a('0x18')](respondWithResult(_0x3cb731,null))[_0x7d1a('0x4f')](handleError(_0x3cb731,null));};exports['login']=function(_0xcbab9f,_0x4da70b,_0x5468ce){var _0x4a68a2;var _0x4989cc;var _0x53e50d;var _0x5555a0=!_[_0x7d1a('0x66')](_0xcbab9f['params']['id'])?_0xcbab9f['params']['id']:!_[_0x7d1a('0x66')](_0xcbab9f['user']['id'])?_0xcbab9f[_0x7d1a('0x30')]['id']:null;return db['User'][_0x7d1a('0x37')]({'where':{'id':_0x5555a0,'role':{'$or':[_0x7d1a('0x2f'),'user',_0x7d1a('0x2a')]}},'attributes':['id',_0x7d1a('0x38'),_0x7d1a('0xec'),'mobile','role','internal',_0x7d1a('0xed')]})[_0x7d1a('0x18')](function(_0x4f52d5){if(_0x4f52d5){if(_0x4f52d5[_0x7d1a('0x29')]==='agent'){_0x4a68a2=_0x4f52d5;if(_0xcbab9f[_0x7d1a('0x5e')][_0x7d1a('0x9c')]){_0x53e50d=util['format'](_0x7d1a('0xee'),_0x4a68a2[_0xcbab9f[_0x7d1a('0x5e')]['interface']]);}else if(_0xcbab9f[_0x7d1a('0x5e')][_0x7d1a('0xef')]){_0x53e50d=util['format'](_0x7d1a('0xa9'),_0xcbab9f[_0x7d1a('0x5e')][_0x7d1a('0xef')]);}else{_0x53e50d=util['format'](_0x7d1a('0xa9'),_0x4a68a2['name']);}socket['to'](util['format']('user:%s',_0x4a68a2[_0x7d1a('0x38')]))[_0x7d1a('0x2b')](_0x7d1a('0xf0'),{'user':{'id':_0x4a68a2['id'],'name':_0x4a68a2['name']},'ip':_0xcbab9f['headers'][_0x7d1a('0xf1')]||_0xcbab9f[_0x7d1a('0xf2')]['remoteAddress']||_0xcbab9f[_0x7d1a('0xf3')]['remoteAddress']||_0xcbab9f[_0x7d1a('0xf2')][_0x7d1a('0xf3')][_0x7d1a('0xf4')]});return db['UserVoiceQueueRt'][_0x7d1a('0x2d')]({'where':{'membername':_0x4a68a2[_0x7d1a('0x38')]},'individualHooks':!![]});}}else{throw new db[(_0x7d1a('0x8e'))][(_0x7d1a('0x8f'))](_0x7d1a('0xf5'));}})[_0x7d1a('0x18')](function(){if(_0x4a68a2){return _0x4a68a2['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x1423c8){if(_0x4a68a2){if(_0x1423c8){_0x4989cc=_0x1423c8;if(_0x4989cc[_0x7d1a('0x4a')]){var _0x466923=_0x4989cc[_0x7d1a('0x89')](function(_0x4a1b16){var _0xa4c368={'membername':_0x4a68a2['name'],'UserId':_0x4a68a2['id'],'queue_name':_0x4a1b16['name'],'VoiceQueueId':_0x4a1b16['id'],'interface':_0x53e50d,'paused':_0x4a68a2[_0x7d1a('0xed')]||![],'penalty':_0x4a1b16[_0x7d1a('0xf6')]||0x0};return db[_0x7d1a('0xaa')]['upsert'](_0xa4c368);});return Promise[_0x7d1a('0x5d')](_0x466923);}}}})['then'](function(){if(_0x4a68a2){return db[_0x7d1a('0xf7')][_0x7d1a('0x48')]({'where':{'membername':_0x4a68a2[_0x7d1a('0x38')],'exitAt':null}});}})[_0x7d1a('0x18')](function(_0x549360){if(_0x4a68a2){var _0x3ff508=[];_0x549360[_0x7d1a('0xf8')](function(_0x244216){_0x3ff508[_0x7d1a('0x47')](_0x244216['update']({'exitAt':moment()[_0x7d1a('0xa8')](_0x7d1a('0xf9'))}));});return Promise[_0x7d1a('0x5d')](_0x3ff508);}})[_0x7d1a('0x18')](function(){if(_0x4a68a2){var _0x3eedf8=[];var _0x1cca07=[];var _0xc794a5=utils[_0x7d1a('0xfa')]();var _0x13fc2f={'membername':_0x4a68a2['name'],'interface':_0x53e50d,'enterAt':moment()[_0x7d1a('0xa8')](_0x7d1a('0xf9')),'role':_0x4a68a2[_0x7d1a('0x29')],'internal':_0x4a68a2['internal']};_0xc794a5[_0x7d1a('0xf8')](function(_0x57dadd){_0x3eedf8[_0x7d1a('0x47')](_[_0x7d1a('0x59')]({'channel':_0x57dadd,'type':_0x7d1a('0xfb'),'data1':_0xcbab9f[_0x7d1a('0x5e')][_0x7d1a('0xfc')],'data2':_0x53e50d},_0x13fc2f));if(_0x4a68a2[_0x7d1a('0xed')]){_0x1cca07['push'](_[_0x7d1a('0x59')]({'channel':_0x57dadd,'type':_0x7d1a('0xfd'),'data1':'LOGININPAUSE'},_0x13fc2f));}});return db[_0x7d1a('0xf7')][_0x7d1a('0xfe')](_0x3eedf8[_0x7d1a('0xca')](_0x1cca07),{'individualHooks':!![]});}})[_0x7d1a('0x18')](function(){if(_0x4a68a2){return _0x4a68a2[_0x7d1a('0x28')]({'online':!![],'lastLoginAt':moment()[_0x7d1a('0xa8')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4a68a2[_0x7d1a('0xed')]||![],'mailPause':_0x4a68a2[_0x7d1a('0xed')]||![],'chatPause':_0x4a68a2[_0x7d1a('0xed')]||![],'faxPause':_0x4a68a2[_0x7d1a('0xed')]||![],'smsPause':_0x4a68a2[_0x7d1a('0xed')]||![],'openchannelPause':_0x4a68a2[_0x7d1a('0xed')]||![],'whatsappPause':_0x4a68a2[_0x7d1a('0xed')]||![],'pauseType':_0x4a68a2[_0x7d1a('0xed')]?_0x7d1a('0xff'):null,'interface':_0x53e50d,'lastPauseAt':moment()[_0x7d1a('0xa8')](_0x7d1a('0xf9'))});}})[_0x7d1a('0x18')](function(_0x169514){if(_0xcbab9f[_0x7d1a('0x100')]){return _0x5468ce();}else{return Promise[_0x7d1a('0x101')](_0x169514)['then'](respondWithResult(_0x4da70b,null));}})[_0x7d1a('0x4f')](handleError(_0x4da70b,null));};exports['logout']=function(_0x5ee23c,_0x54c713){var _0x2d440f;return db[_0x7d1a('0x3d')][_0x7d1a('0x37')]({'where':{'id':_0x5ee23c['params']['id'],'role':_0x7d1a('0x2a')},'attributes':['id',_0x7d1a('0x38'),_0x7d1a('0x29')]})[_0x7d1a('0x18')](handleEntityNotFound(_0x54c713,null))[_0x7d1a('0x18')](function(_0xc4bf4c){if(_0xc4bf4c){_0x2d440f=_0xc4bf4c;return db[_0x7d1a('0xaa')][_0x7d1a('0x2d')]({'where':{'membername':_0x2d440f['name']},'individualHooks':!![]});}})[_0x7d1a('0x18')](function(){return db[_0x7d1a('0xf7')]['findAll']({'where':{'membername':_0x2d440f[_0x7d1a('0x38')],'exitAt':null}});})['then'](function(_0x570af3){var _0x3a2f26=[];_0x570af3[_0x7d1a('0xf8')](function(_0x56a750){_0x3a2f26['push'](_0x56a750[_0x7d1a('0x28')]({'exitAt':moment()[_0x7d1a('0xa8')](_0x7d1a('0xf9'))}));});return Promise[_0x7d1a('0x5d')](_0x3a2f26);})[_0x7d1a('0x18')](function(){return _0x2d440f['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![],'interface':null});})['then'](respondWithResult(_0x54c713,null))[_0x7d1a('0x4f')](handleError(_0x54c713,null));};exports[_0x7d1a('0x102')]=function(_0x320ea8,_0x103584){var _0x20989d;return db[_0x7d1a('0xaa')][_0x7d1a('0x28')]({'paused':0x1},{'where':{'UserId':_0x320ea8[_0x7d1a('0x51')]['id']},'individualHooks':!![]})[_0x7d1a('0x18')](function(){return db[_0x7d1a('0x3d')]['find']({'where':{'id':_0x320ea8[_0x7d1a('0x51')]['id'],'role':_0x7d1a('0x2a')},'attributes':['id',_0x7d1a('0x38'),_0x7d1a('0x29'),_0x7d1a('0x62'),_0x7d1a('0x9c'),_0x7d1a('0x9a')]});})[_0x7d1a('0x18')](handleEntityNotFound(_0x103584,null))[_0x7d1a('0x18')](function(_0x40023e){if(_0x40023e){_0x20989d=_0x40023e;return respondWithRpcPromise('QueuePause',_0x7d1a('0x102'),{'id':_0x20989d['id'],'name':_0x20989d[_0x7d1a('0x38')],'pause':!![]});}})[_0x7d1a('0x18')](function(){if(_0x20989d){return db[_0x7d1a('0xf7')]['findAll']({'where':{'membername':_0x20989d[_0x7d1a('0x38')],'type':_0x7d1a('0xfd'),'exitAt':null}});}})[_0x7d1a('0x18')](function(_0xb4d53){if(_0xb4d53[_0x7d1a('0x4a')]){var _0x1290bb=moment()['format'](_0x7d1a('0xf9'));for(var _0x15c49f=0x0,_0x12ed28=_0xb4d53[_0x7d1a('0x4a')];_0x15c49f<_0x12ed28;_0x15c49f++){_0xb4d53[_0x15c49f][_0x7d1a('0x103')]({'exitAt':_0x1290bb});}}})['then'](function(){var _0x45bfae=[];var _0xf29e46=utils[_0x7d1a('0xfa')]();_0xf29e46[_0x7d1a('0xf8')](function(_0x122898){_0x45bfae[_0x7d1a('0x47')]({'channel':_0x122898,'membername':_0x20989d[_0x7d1a('0x38')],'interface':_[_0x7d1a('0x66')](_0x20989d['interface'])?util[_0x7d1a('0xa8')]('SIP/%s',_0x20989d['name']):_0x20989d[_0x7d1a('0x9c')],'type':'PAUSE','enterAt':moment()[_0x7d1a('0xa8')](_0x7d1a('0xf9')),'data1':_0x320ea8[_0x7d1a('0x5e')][_0x7d1a('0x3f')]||_0x7d1a('0x104'),'role':_0x20989d['role'],'internal':_0x20989d[_0x7d1a('0x62')]});});return db['MemberReport'][_0x7d1a('0xfe')](_0x45bfae,{'individualHooks':!![]});})['then'](function(){return _0x20989d[_0x7d1a('0x28')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'whatsappPause':!![],'openchannelPause':!![],'pauseType':_0x320ea8[_0x7d1a('0x5e')][_0x7d1a('0x3f')]||_0x7d1a('0x104'),'lastPauseAt':moment()[_0x7d1a('0xa8')](_0x7d1a('0xf9'))});})[_0x7d1a('0x18')](respondWithResult(_0x103584,null))[_0x7d1a('0x4f')](handleError(_0x103584,null));};exports[_0x7d1a('0x105')]=function(_0x50d4cf,_0x1149e6){if(_0x50d4cf[_0x7d1a('0x5e')][_0x7d1a('0xac')]&&!utils['isValidChannel'](_0x50d4cf[_0x7d1a('0x5e')][_0x7d1a('0xac')])){throw new APIBadRequestError(util[_0x7d1a('0xa8')](_0x7d1a('0x106'),_0x50d4cf['body']['channel']));}return db[_0x7d1a('0x3d')][_0x7d1a('0x37')]({'where':{'id':_0x50d4cf[_0x7d1a('0x51')]['id']},'attributes':['id',_0x7d1a('0x38'),'role',_0x7d1a('0x62'),_0x7d1a('0x9c'),_0x7d1a('0x9a'),_0x7d1a('0x9b'),_0x7d1a('0x107'),_0x7d1a('0x108'),'faxPause',_0x7d1a('0x109'),_0x7d1a('0x10a'),_0x7d1a('0x10b'),_0x7d1a('0x10c'),'lastPauseAt']})['then'](function(_0x1617c8){if(!_0x1617c8){throw new APINotFoundError(util[_0x7d1a('0xa8')](_0x7d1a('0x10d'),_0x50d4cf[_0x7d1a('0x51')]['id']));}return _0x1617c8[_0x7d1a('0x105')](_0x50d4cf[_0x7d1a('0x5e')]['channel']);})[_0x7d1a('0x18')](respondWithResult(_0x1149e6,null))[_0x7d1a('0x4f')](APIHandleError(_0x1149e6));};exports[_0x7d1a('0x10e')]=function(_0x13a2ea,_0x1b3629){var _0x12f0a4={};var _0x19ee0c={};var _0x3a9b70;var _0x1f1c44;return db[_0x7d1a('0x3d')][_0x7d1a('0x93')]({'where':{'id':_0x13a2ea[_0x7d1a('0x51')]['id']}})[_0x7d1a('0x18')](handleEntityNotFound(_0x1b3629,null))[_0x7d1a('0x18')](function(_0x5d8fe8){if(_0x5d8fe8){_0x3a9b70=_0x5d8fe8;_0x19ee0c[_0x7d1a('0x52')]=_[_0x7d1a('0x53')](db[_0x7d1a('0x10f')][_0x7d1a('0x3e')]);_0x19ee0c[_0x7d1a('0x44')]=_[_0x7d1a('0x53')](_0x13a2ea[_0x7d1a('0x44')]);_0x19ee0c[_0x7d1a('0x55')]=_[_0x7d1a('0x56')](_0x19ee0c[_0x7d1a('0x52')],_0x19ee0c[_0x7d1a('0x44')]);_0x12f0a4[_0x7d1a('0x46')]=_[_0x7d1a('0x56')](_0x19ee0c['model'],qs[_0x7d1a('0x57')](_0x13a2ea[_0x7d1a('0x44')]['fields']));_0x12f0a4['attributes']=_0x12f0a4['attributes'][_0x7d1a('0x4a')]?_0x12f0a4[_0x7d1a('0x46')]:_0x19ee0c[_0x7d1a('0x52')];_0x12f0a4[_0x7d1a('0xcd')]=qs[_0x7d1a('0xd6')](_0x13a2ea['query'][_0x7d1a('0xd6')]);_0x12f0a4[_0x7d1a('0xce')]=qs[_0x7d1a('0x55')](_[_0x7d1a('0xd7')](_0x13a2ea['query'],_0x19ee0c[_0x7d1a('0x55')]));if(_0x13a2ea['query']['filter']){_0x12f0a4['where']=_[_0x7d1a('0x59')](_0x12f0a4['where'],{'$or':_['map'](_0x12f0a4[_0x7d1a('0x46')],function(_0x23971f){var _0x4de10f={};_0x4de10f[_0x23971f]={'$like':'%'+_0x13a2ea['query'][_0x7d1a('0x33')]+'%'};return _0x4de10f;})});}_0x12f0a4=_[_0x7d1a('0x59')]({},_0x12f0a4,_0x13a2ea['options']);return _0x3a9b70[_0x7d1a('0x10e')](_0x12f0a4);}})[_0x7d1a('0x18')](function(_0x19c4be){if(_0x19c4be){_0x1f1c44=_0x19c4be[_0x7d1a('0x4a')];if(!_0x13a2ea['query'][_0x7d1a('0xcf')](_0x7d1a('0xda'))){_0x12f0a4[_0x7d1a('0x26')]=qs[_0x7d1a('0x26')](_0x13a2ea[_0x7d1a('0x44')][_0x7d1a('0x26')]);_0x12f0a4[_0x7d1a('0x25')]=qs['offset'](_0x13a2ea['query'][_0x7d1a('0x25')]);}return _0x3a9b70['getTeams'](_0x12f0a4);}})[_0x7d1a('0x18')](function(_0x5b3b78){if(_0x5b3b78){return _0x5b3b78?{'count':_0x1f1c44,'rows':_0x5b3b78}:null;}})[_0x7d1a('0x18')](respondWithResult(_0x1b3629,null))['catch'](handleError(_0x1b3629,null));};exports[_0x7d1a('0x110')]=function(_0x52bca0,_0x3c83bb){var _0x21aad5=_0x52bca0[_0x7d1a('0x51')]['id'];var _0x1f48e9=_0x52bca0['body']?_0x52bca0[_0x7d1a('0x5e')][_0x7d1a('0x61')]:null;var _0x5550f2=[];return Promise[_0x7d1a('0x101')]()[_0x7d1a('0x18')](function(){if(!_0x1f48e9)throw new APIBadRequestError('Body\x20parameter\x20\x27ids\x27\x20is\x20required');})[_0x7d1a('0x18')](function(){return db[_0x7d1a('0x3d')][_0x7d1a('0x93')]({'where':{'id':_0x21aad5}});})['then'](function(_0x5e204a){if(!_0x5e204a)throw new APINotFoundError(util[_0x7d1a('0xa8')]('User\x20with\x20id\x20%s\x20not\x20found',_0x52bca0[_0x7d1a('0x51')]['id']));return db[_0x7d1a('0x68')][_0x7d1a('0x111')](function(_0xdf7718){return _0x5e204a['addTeams'](_0x1f48e9,{'transaction':_0xdf7718})[_0x7d1a('0x18')](function(){return db[_0x7d1a('0x10f')]['findAll']({'where':{'id':{'$in':_0x1f48e9}}});})[_0x7d1a('0x18')](function(_0x4cf1e2){var _0x445e5b=_[_0x7d1a('0x89')](_0x4cf1e2,function(_0x201617){return _0x201617[_0x7d1a('0x112')]();});return Promise[_0x7d1a('0x5d')](_0x445e5b);})[_0x7d1a('0x18')](function(_0x9a2d30){_0x5550f2=_[_0x7d1a('0x113')](_0x9a2d30);var _0x3ad9da=_[_0x7d1a('0x89')](_0x5550f2,function(_0x5143c4){return _0x5143c4[_0x7d1a('0x114')](_0x5e204a['id'],{'transaction':_0xdf7718});});return Promise['all'](_0x3ad9da);})['then'](function(){if(!_0x5e204a[_0x7d1a('0x9a')])return;var _0x44cc4c=_[_0x7d1a('0x33')](_0x5550f2,function(_0x15953b){return _0x15953b[_0x7d1a('0x115')](_0x7d1a('0xac'))===_0x7d1a('0x116');});var _0x43bd1b=_[_0x7d1a('0x89')](_0x44cc4c,function(_0x37f94a){return db['UserVoiceQueueRt'][_0x7d1a('0xab')]({'membername':_0x5e204a[_0x7d1a('0x38')],'UserId':_0x5e204a['id'],'queue_name':_0x37f94a[_0x7d1a('0x38')],'VoiceQueueId':_0x37f94a['id'],'interface':_['isNil'](_0x5e204a['interface'])?util[_0x7d1a('0xa8')](_0x7d1a('0xa9'),_0x5e204a[_0x7d1a('0x38')]):_0x5e204a[_0x7d1a('0x9c')],'paused':_0x5e204a[_0x7d1a('0x9b')]||![],'penalty':_0x5e204a['penalty']},{'transaction':_0xdf7718});});return Promise[_0x7d1a('0x5d')](_0x43bd1b);})['then'](function(){return db[_0x7d1a('0x117')][_0x7d1a('0x48')]({'where':{'teamId':{'$in':_0x1f48e9}}});})['then'](function(_0x5b1f6b){var _0x631a12=_[_0x7d1a('0x89')](_0x5b1f6b,function(_0x1810ce){return db[_0x7d1a('0x118')][_0x7d1a('0x82')]({'UserId':_0x5e204a['id'],'VoicePrefixId':_0x1810ce[_0x7d1a('0x119')]},{'transaction':_0xdf7718});});return Promise[_0x7d1a('0x5d')](_0x631a12);});});})['then'](function(){for(var _0x2b9cdc=0x0;_0x2b9cdc<_0x5550f2[_0x7d1a('0x4a')];_0x2b9cdc++){var _0x32d43f=_0x5550f2[_0x2b9cdc]['getDataValue'](_0x7d1a('0xac'));var _0x4739f1=_0x32d43f+_0x7d1a('0xa4');socket[_0x7d1a('0x2b')](_0x7d1a('0x30')+_0x32d43f+'Queue:save',{'UserId':_0x21aad5,['queueField']:_0x5550f2[_0x2b9cdc]['id']});}})[_0x7d1a('0x18')](respondWithStatusCode(_0x3c83bb,null))[_0x7d1a('0x4f')](APIHandleError(_0x3c83bb));};exports['removeTeams']=function(_0x2b28ae,_0x390fbe){var _0x309ec4=_0x2b28ae[_0x7d1a('0x51')]['id'];var _0x172cba=null;if(_0x2b28ae[_0x7d1a('0x44')][_0x7d1a('0x61')]){_0x172cba=_[_0x7d1a('0x11a')](_0x2b28ae[_0x7d1a('0x44')]['ids'])?_0x2b28ae['query'][_0x7d1a('0x61')]:[_0x2b28ae[_0x7d1a('0x44')][_0x7d1a('0x61')]];}var _0x24ac3f=[];return Promise[_0x7d1a('0x101')]()[_0x7d1a('0x18')](function(){if(!_0x172cba)throw new APIBadRequestError(_0x7d1a('0x11b'));})[_0x7d1a('0x18')](function(){return db[_0x7d1a('0x3d')][_0x7d1a('0x93')]({'where':{'id':_0x309ec4}});})[_0x7d1a('0x18')](function(_0x2b60fb){if(!_0x2b60fb)throw new APINotFoundError(util[_0x7d1a('0xa8')]('User\x20with\x20id\x20%s\x20not\x20found',_0x2b28ae[_0x7d1a('0x51')]['id']));return db[_0x7d1a('0x68')][_0x7d1a('0x111')](function(_0x3975e7){return _0x2b60fb[_0x7d1a('0x11c')](_0x172cba,{'transaction':_0x3975e7})[_0x7d1a('0x18')](function(){return db[_0x7d1a('0x10f')][_0x7d1a('0x48')]({'where':{'id':{'$in':_0x172cba}}});})[_0x7d1a('0x18')](function(_0x4fe5f2){var _0x11e356=_['map'](_0x4fe5f2,function(_0xe8fbd5){return _0xe8fbd5[_0x7d1a('0x112')]();});return Promise[_0x7d1a('0x5d')](_0x11e356);})[_0x7d1a('0x18')](function(_0x352c73){_0x24ac3f=_['flattenDeep'](_0x352c73);var _0x52be2e=_[_0x7d1a('0x89')](_0x24ac3f,function(_0x2e43fa){return _0x2e43fa['removeAgent'](_0x2b60fb['id'],{'transaction':_0x3975e7});});return Promise['all'](_0x52be2e);})[_0x7d1a('0x18')](function(){if(!_0x2b60fb[_0x7d1a('0x9a')])return;var _0x20d3d6=_[_0x7d1a('0x33')](_0x24ac3f,function(_0x34ae7d){return _0x34ae7d[_0x7d1a('0x115')](_0x7d1a('0xac'))===_0x7d1a('0x116');});var _0x4ad8c4=_[_0x7d1a('0x89')](_0x20d3d6,function(_0x5d1c1a){return db[_0x7d1a('0xaa')][_0x7d1a('0x2d')]({'where':{'VoiceQueueId':_0x5d1c1a['id'],'UserId':_0x2b60fb['id']},'transaction':_0x3975e7});});return Promise[_0x7d1a('0x5d')](_0x4ad8c4);})['then'](function(){return db['TeamVoicePrefix'][_0x7d1a('0x48')]({'where':{'teamId':{'$in':_0x172cba}}});})[_0x7d1a('0x18')](function(_0xcac3a2){var _0x227813=_[_0x7d1a('0x89')](_0xcac3a2,function(_0x34580d){return db['UserVoicePrefix'][_0x7d1a('0x2d')]({'where':{'UserId':_0x2b60fb['id'],'VoicePrefixId':_0x34580d[_0x7d1a('0x119')]}},{'transaction':_0x3975e7});});return Promise[_0x7d1a('0x5d')](_0x227813);});});})[_0x7d1a('0x18')](function(){for(var _0x35b5cf=0x0;_0x35b5cf<_0x24ac3f[_0x7d1a('0x4a')];_0x35b5cf++){var _0x1d7753=_0x24ac3f[_0x35b5cf]['getDataValue'](_0x7d1a('0xac'));var _0x5e5f70=_0x1d7753+'QueueId';socket[_0x7d1a('0x2b')](_0x7d1a('0x30')+_0x1d7753+_0x7d1a('0xaf'),{'UserId':_0x309ec4,['queueField']:_0x24ac3f[_0x35b5cf]['id']});}})[_0x7d1a('0x18')](respondWithStatusCode(_0x390fbe,null))['catch'](APIHandleError(_0x390fbe));};exports[_0x7d1a('0x11d')]=function(_0x189b6c,_0x5b61c2){var _0x2feaca={};var _0x275f6b={};var _0x499a16;var _0xb2c34b;return db[_0x7d1a('0x3d')][_0x7d1a('0x93')]({'where':{'id':_0x189b6c[_0x7d1a('0x51')]['id']}})[_0x7d1a('0x18')](handleEntityNotFound(_0x5b61c2,null))[_0x7d1a('0x18')](function(_0x25e329){if(_0x25e329){_0x499a16=_0x25e329;_0x275f6b[_0x7d1a('0x52')]=_[_0x7d1a('0x53')](db[_0x7d1a('0xd0')][_0x7d1a('0x3e')]);_0x275f6b[_0x7d1a('0x44')]=_[_0x7d1a('0x53')](_0x189b6c[_0x7d1a('0x44')]);_0x275f6b['filters']=_[_0x7d1a('0x56')](_0x275f6b['model'],_0x275f6b[_0x7d1a('0x44')]);_0x2feaca[_0x7d1a('0x46')]=_[_0x7d1a('0x56')](_0x275f6b['model'],qs[_0x7d1a('0x57')](_0x189b6c[_0x7d1a('0x44')]['fields']));_0x2feaca[_0x7d1a('0x46')]=_0x2feaca[_0x7d1a('0x46')][_0x7d1a('0x4a')]?_0x2feaca[_0x7d1a('0x46')]:_0x275f6b[_0x7d1a('0x52')];_0x2feaca[_0x7d1a('0xcd')]=qs[_0x7d1a('0xd6')](_0x189b6c[_0x7d1a('0x44')][_0x7d1a('0xd6')]);_0x2feaca[_0x7d1a('0xce')]=qs[_0x7d1a('0x55')](_[_0x7d1a('0xd7')](_0x189b6c[_0x7d1a('0x44')],_0x275f6b[_0x7d1a('0x55')]));if(_0x189b6c[_0x7d1a('0x44')]['filter']){_0x2feaca['where']=_[_0x7d1a('0x59')](_0x2feaca[_0x7d1a('0xce')],{'$or':_[_0x7d1a('0x89')](_0x2feaca['attributes'],function(_0x27ae2d){var _0x303ceb={};_0x303ceb[_0x27ae2d]={'$like':'%'+_0x189b6c[_0x7d1a('0x44')][_0x7d1a('0x33')]+'%'};return _0x303ceb;})});}_0x2feaca=_[_0x7d1a('0x59')]({},_0x2feaca,_0x189b6c[_0x7d1a('0x5a')]);return _0x499a16['getLists'](_0x2feaca);}})[_0x7d1a('0x18')](function(_0x13bf04){if(_0x13bf04){_0xb2c34b=_0x13bf04['length'];if(!_0x189b6c[_0x7d1a('0x44')][_0x7d1a('0xcf')]('nolimit')){_0x2feaca[_0x7d1a('0x26')]=qs['limit'](_0x189b6c[_0x7d1a('0x44')]['limit']);_0x2feaca[_0x7d1a('0x25')]=qs[_0x7d1a('0x25')](_0x189b6c['query'][_0x7d1a('0x25')]);}return _0x499a16['getLists'](_0x2feaca);}})[_0x7d1a('0x18')](function(_0xc6e11e){if(_0xc6e11e){return _0xc6e11e?{'count':_0xb2c34b,'rows':_0xc6e11e}:null;}})['then'](respondWithResult(_0x5b61c2,null))['catch'](handleError(_0x5b61c2,null));};exports[_0x7d1a('0x11e')]=function(_0x43457a,_0x3c6df5){var _0x476bdc={};var _0x4d2429={};var _0x5023ba;return db['User'][_0x7d1a('0x93')]({'where':{'id':_0x43457a[_0x7d1a('0x51')]['id']}})[_0x7d1a('0x18')](handleEntityNotFound(_0x3c6df5,null))[_0x7d1a('0x18')](function(_0x334f64){if(_0x334f64){_0x5023ba=_0x334f64;_0x4d2429[_0x7d1a('0x52')]=_[_0x7d1a('0x53')](db['User'][_0x7d1a('0x3e')]);_0x4d2429[_0x7d1a('0x44')]=_[_0x7d1a('0x53')](_0x43457a[_0x7d1a('0x44')]);_0x4d2429['filters']=_[_0x7d1a('0x56')](_0x4d2429[_0x7d1a('0x52')],_0x4d2429[_0x7d1a('0x44')]);_0x476bdc[_0x7d1a('0x46')]=_[_0x7d1a('0x56')](_0x4d2429['model'],qs['fields'](_0x43457a[_0x7d1a('0x44')][_0x7d1a('0x57')]));_0x476bdc[_0x7d1a('0x46')]=_0x476bdc[_0x7d1a('0x46')][_0x7d1a('0x4a')]?_0x476bdc['attributes']:_0x4d2429[_0x7d1a('0x52')];_0x476bdc[_0x7d1a('0xcd')]=qs[_0x7d1a('0xd6')](_0x43457a[_0x7d1a('0x44')][_0x7d1a('0xd6')]);_0x476bdc[_0x7d1a('0xce')]=qs['filters'](_[_0x7d1a('0xd7')](_0x43457a[_0x7d1a('0x44')],_0x4d2429[_0x7d1a('0x55')]));if(_0x43457a['query'][_0x7d1a('0x33')]){_0x476bdc['where']=_[_0x7d1a('0x59')](_0x476bdc['where'],{'$or':_[_0x7d1a('0x89')](_0x476bdc[_0x7d1a('0x46')],function(_0x55a0d3){var _0x1411fb={};_0x1411fb[_0x55a0d3]={'$like':'%'+_0x43457a['query']['filter']+'%'};return _0x1411fb;})});}_0x476bdc[_0x7d1a('0x52')]=db[_0x7d1a('0x3d')];_0x476bdc['as']=_0x7d1a('0x84');_0x476bdc=_[_0x7d1a('0x59')]({},_0x476bdc,_0x43457a[_0x7d1a('0x5a')]);return _0x5023ba[_0x7d1a('0x11f')]({'include':[_0x476bdc]});}})[_0x7d1a('0x18')](function(_0x327d80){if(_0x327d80){var _0x147998={},_0x10de36=[];for(var _0x5172c2=0x0;_0x5172c2<_0x327d80[_0x7d1a('0x4a')];_0x5172c2+=0x1){for(var _0x49f49c=0x0,_0x4d6cc6;_0x49f49c<_0x327d80[_0x5172c2][_0x7d1a('0x84')][_0x7d1a('0x4a')];_0x49f49c+=0x1){_0x4d6cc6=_0x327d80[_0x5172c2][_0x7d1a('0x84')][_0x49f49c]['get']({'plain':!![]});_0x147998[_0x4d6cc6['id']]=_0x4d6cc6;}}_0x147998=_['values'](_0x147998);for(var _0x448424=qs['offset'](_0x43457a[_0x7d1a('0x44')][_0x7d1a('0x25')]);_0x448424<_0x147998['length']&&_0x10de36['length']=_0x3e1283['agents']){throw new Error(_0xfe0f('0x4d'));}})['then'](function(){if(_0x1d228d){return db['UserVoiceQueueRt'][_0xfe0f('0x43')]({'where':{'membername':_0x1d228d['name']},'individualHooks':!![]});}})[_0xfe0f('0x14')](function(){if(_0x1d228d){return _0x1d228d[_0xfe0f('0x4e')]({'raw':!![]});}})[_0xfe0f('0x14')](function(_0x392610){if(_0x1d228d){if(_0x392610){var _0x37a8cc=[];_0x56db4b=_0x392610;if(_0x56db4b[_0xfe0f('0x2a')]){for(var _0x4c8bf4=0x0;_0x4c8bf4<_0x56db4b[_0xfe0f('0x2a')];_0x4c8bf4++){_0x37a8cc['push'](db[_0xfe0f('0x26')][_0xfe0f('0x4f')]({'membername':_0x1d228d['name'],'UserId':_0x1d228d['id'],'queue_name':_0x56db4b[_0x4c8bf4][_0xfe0f('0x20')],'VoiceQueueId':_0x56db4b[_0x4c8bf4]['id'],'interface':_0x5eb6c3,'paused':_0x1d228d[_0xfe0f('0x48')]||![],'penalty':_0x56db4b[_0x4c8bf4][_0xfe0f('0x50')]||0x0}));}return BPromise['all'](_0x37a8cc);}}}})[_0xfe0f('0x14')](function(){if(_0x1d228d){return db['MemberReport'][_0xfe0f('0xc')]({'where':{'membername':_0x1d228d[_0xfe0f('0x20')],'exitAt':null}});}})[_0xfe0f('0x14')](function(_0xd44ca4){if(_0x1d228d){if(_0xd44ca4&&_0xd44ca4[_0xfe0f('0x2a')]){var _0x52b669=[];_0xd44ca4[_0xfe0f('0x2e')](function(_0x645dee){_0x52b669[_0xfe0f('0x44')](_0x645dee[_0xfe0f('0x27')]({'exitAt':moment()[_0xfe0f('0x23')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xfe0f('0x45')](_0x52b669);}}})[_0xfe0f('0x14')](function(){if(_0x1d228d){var _0x3408eb=[];var _0x48c95a=[];var _0x14f22a=utils[_0xfe0f('0x2d')]();var _0x46d646={'membername':_0x1d228d['name'],'interface':_0x5eb6c3,'enterAt':moment()[_0xfe0f('0x23')](_0xfe0f('0x2b')),'role':_0x1d228d[_0xfe0f('0x21')],'internal':_0x1d228d[_0xfe0f('0x22')]};_0x14f22a[_0xfe0f('0x2e')](function(_0x4005dd){_0x3408eb['push'](_[_0xfe0f('0x51')]({'channel':_0x4005dd,'type':_0xfe0f('0x52'),'data1':_0xfe0f('0x53'),'data2':_0x5eb6c3},_0x46d646));if(_0x1d228d[_0xfe0f('0x48')]){_0x48c95a['push'](_[_0xfe0f('0x51')]({'channel':_0x4005dd,'type':_0xfe0f('0x29'),'data1':_0xfe0f('0x54')},_0x46d646));}});return db[_0xfe0f('0x28')][_0xfe0f('0x34')](_0x3408eb[_0xfe0f('0x55')](_0x48c95a),{'individualHooks':!![]});}})[_0xfe0f('0x14')](function(){if(_0x1d228d){return _0x1d228d[_0xfe0f('0x27')]({'online':!![],'lastLoginAt':moment()[_0xfe0f('0x23')](_0xfe0f('0x2b')),'voicePause':_0x1d228d[_0xfe0f('0x48')]||![],'mailPause':_0x1d228d[_0xfe0f('0x48')]||![],'chatPause':_0x1d228d[_0xfe0f('0x48')]||![],'faxPause':_0x1d228d['loginInPause']||![],'smsPause':_0x1d228d[_0xfe0f('0x48')]||![],'openchannelPause':_0x1d228d[_0xfe0f('0x48')]||![],'pauseType':_0x1d228d[_0xfe0f('0x48')]?_0xfe0f('0x54'):null,'lastPauseAt':moment()[_0xfe0f('0x23')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x5eb6c3});}})['then'](function(_0x21c85e){_0x1eb2a9(_0x21c85e);})['catch'](function(_0x5a3f42){_0x1e46be(_0x58cdd2[_0xfe0f('0x18')](0x1f4,_0x5a3f42[_0xfe0f('0x19')]));});});}; \ No newline at end of file +var _0x912e=['PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','push','isNil','SIP/%s','type','DEFAULT\x20PAUSE','uniqueid','bulkCreate','body','channel','Channel\x20parameter\x20%s\x20is\x20invalid','findOne','online','voicePause','mailPause','smsPause','pauseType','lastPauseAt','unpause','LogoutUser','destroy','forEach','all','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','UserVoiceQueue.penalty','merge','LOGIN','callysquare','concat','LOGININPAUSE','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','defaults','localhost','socket.io-emitter','redis','./user.socket','register','GetUser','options','raw','attributes','limit','include','map','model','stringify','catch','error','message','ShowUser','find','where','info','debug','User','name','role','internal','interface','then','format','User\x20with\x20id\x20%s\x20not\x20found','params','UserVoiceQueueRt','update','MemberReport','findAll'];(function(_0x7c81f5,_0x3ed7e3){var _0x5467d9=function(_0x3ab549){while(--_0x3ab549){_0x7c81f5['push'](_0x7c81f5['shift']());}};_0x5467d9(++_0x3ed7e3);}(_0x912e,0x129));var _0xe912=function(_0x2d5271,_0x5bc52e){_0x2d5271=_0x2d5271-0x0;var _0x3b5bdc=_0x912e[_0x2d5271];return _0x3b5bdc;};'use strict';var _=require(_0xe912('0x0'));var util=require(_0xe912('0x1'));var moment=require(_0xe912('0x2'));var BPromise=require(_0xe912('0x3'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe912('0x4'));var logger=require(_0xe912('0x5'))(_0xe912('0x6'));var config=require('../../config/environment');config['redis']=_[_0xe912('0x7')](config['redis'],{'host':_0xe912('0x8'),'port':0x18eb});var socket=require(_0xe912('0x9'))(new Redis(config[_0xe912('0xa')]));require(_0xe912('0xb'))[_0xe912('0xc')](socket);exports[_0xe912('0xd')]=function(_0x2acfd9){var _0x504087=this;return new Promise(function(_0x58418a,_0x54fa18){return db['User']['findAll']({'raw':_0x2acfd9[_0xe912('0xe')]?_0x2acfd9[_0xe912('0xe')][_0xe912('0xf')]===undefined?!![]:![]:!![],'where':_0x2acfd9['options']?_0x2acfd9['options']['where']||null:null,'attributes':_0x2acfd9[_0xe912('0xe')]?_0x2acfd9[_0xe912('0xe')][_0xe912('0x10')]||null:null,'limit':_0x2acfd9['options']?_0x2acfd9[_0xe912('0xe')][_0xe912('0x11')]||null:null,'include':_0x2acfd9[_0xe912('0xe')]?_0x2acfd9[_0xe912('0xe')][_0xe912('0x12')]?_[_0xe912('0x13')](_0x2acfd9[_0xe912('0xe')][_0xe912('0x12')],function(_0x150e23){return{'model':db[_0x150e23[_0xe912('0x14')]],'as':_0x150e23['as'],'attributes':_0x150e23[_0xe912('0x10')],'include':_0x150e23['include']?_['map'](_0x150e23[_0xe912('0x12')],function(_0x157c82){return{'model':db[_0x157c82[_0xe912('0x14')]],'as':_0x157c82['as'],'attributes':_0x157c82[_0xe912('0x10')],'include':_0x157c82[_0xe912('0x12')]?_[_0xe912('0x13')](_0x157c82[_0xe912('0x12')],function(_0x224666){return{'model':db[_0x224666['model']],'as':_0x224666['as'],'attributes':_0x224666[_0xe912('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4d1ba){logger['info'](_0xe912('0xd'),_0x2acfd9);logger['debug'](_0xe912('0xd'),_0x2acfd9,JSON[_0xe912('0x15')](_0x4d1ba));_0x58418a(_0x4d1ba);})[_0xe912('0x16')](function(_0x315a7e){logger[_0xe912('0x17')](_0xe912('0xd'),_0x315a7e[_0xe912('0x18')],_0x2acfd9);_0x54fa18(_0x504087['error'](0x1f4,_0x315a7e[_0xe912('0x18')]));});});};exports[_0xe912('0x19')]=function(_0xcaee78){var _0x3754c8=this;return new Promise(function(_0x81c4ed,_0x5005be){return db['User'][_0xe912('0x1a')]({'raw':_0xcaee78[_0xe912('0xe')]?_0xcaee78['options'][_0xe912('0xf')]===undefined?!![]:![]:!![],'where':_0xcaee78[_0xe912('0xe')]?_0xcaee78['options'][_0xe912('0x1b')]||null:null,'attributes':_0xcaee78[_0xe912('0xe')]?_0xcaee78[_0xe912('0xe')]['attributes']||null:null,'include':_0xcaee78[_0xe912('0xe')]?_0xcaee78[_0xe912('0xe')][_0xe912('0x12')]?_['map'](_0xcaee78[_0xe912('0xe')][_0xe912('0x12')],function(_0x5633b6){return{'model':db[_0x5633b6['model']],'as':_0x5633b6['as'],'attributes':_0x5633b6[_0xe912('0x10')],'include':_0x5633b6[_0xe912('0x12')]?_[_0xe912('0x13')](_0x5633b6['include'],function(_0x30a8f7){return{'model':db[_0x30a8f7[_0xe912('0x14')]],'as':_0x30a8f7['as'],'attributes':_0x30a8f7[_0xe912('0x10')],'include':_0x30a8f7[_0xe912('0x12')]?_[_0xe912('0x13')](_0x30a8f7[_0xe912('0x12')],function(_0x5cecd8){return{'model':db[_0x5cecd8[_0xe912('0x14')]],'as':_0x5cecd8['as'],'attributes':_0x5cecd8[_0xe912('0x10')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x413b81){logger[_0xe912('0x1c')](_0xe912('0x19'),_0xcaee78);logger[_0xe912('0x1d')](_0xe912('0x19'),_0xcaee78,JSON['stringify'](_0x413b81));_0x81c4ed(_0x413b81);})[_0xe912('0x16')](function(_0x27098b){logger[_0xe912('0x17')](_0xe912('0x19'),_0x27098b[_0xe912('0x18')],_0xcaee78);_0x5005be(_0x3754c8['error'](0x1f4,_0x27098b[_0xe912('0x18')]));});});};exports['PauseUser']=function(_0x3ba5d2){var _0x10b5be;return db[_0xe912('0x1e')][_0xe912('0x1a')]({'where':_0x3ba5d2['options']['where']||{},'attributes':['id',_0xe912('0x1f'),_0xe912('0x20'),_0xe912('0x21'),_0xe912('0x22')]})[_0xe912('0x23')](function(_0x1714c7){if(!_0x1714c7){throw new Error(util[_0xe912('0x24')](_0xe912('0x25'),_0x3ba5d2[_0xe912('0x26')]['id']));}_0x10b5be=_0x1714c7;return db[_0xe912('0x27')][_0xe912('0x28')]({'paused':0x1},{'where':{'UserId':_0x10b5be['id']},'individualHooks':!![]});})[_0xe912('0x23')](function(){return db[_0xe912('0x29')][_0xe912('0x2a')]({'where':{'membername':_0x10b5be[_0xe912('0x1f')],'type':_0xe912('0x2b'),'exitAt':null}});})[_0xe912('0x23')](function(_0xe5b703){if(_0xe5b703&&_0xe5b703[_0xe912('0x2c')]){var _0x5fddb1=moment()[_0xe912('0x24')](_0xe912('0x2d'));for(var _0x565bfc=0x0,_0x331a01=_0xe5b703[_0xe912('0x2c')];_0x565bfc<_0x331a01;_0x565bfc++){_0xe5b703[_0x565bfc][_0xe912('0x2e')]({'exitAt':_0x5fddb1});}}})[_0xe912('0x23')](function(){var _0x349ff9=[];var _0x408553=utils[_0xe912('0x2f')]();_0x408553['forEach'](function(_0x5a77ee){_0x349ff9[_0xe912('0x30')]({'channel':_0x5a77ee,'membername':_0x10b5be['name'],'interface':_[_0xe912('0x31')](_0x10b5be[_0xe912('0x22')])?util[_0xe912('0x24')](_0xe912('0x32'),_0x10b5be[_0xe912('0x1f')]):_0x10b5be[_0xe912('0x22')],'type':'PAUSE','enterAt':moment()[_0xe912('0x24')](_0xe912('0x2d')),'data1':_0x3ba5d2['body'][_0xe912('0x33')]||_0xe912('0x34'),'role':_0x10b5be[_0xe912('0x20')],'internal':_0x10b5be[_0xe912('0x21')],'uniqueid':_0x3ba5d2['body'][_0xe912('0x35')]||null});});return db[_0xe912('0x29')][_0xe912('0x36')](_0x349ff9,{'individualHooks':!![]});})[_0xe912('0x23')](function(){return _0x10b5be['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x3ba5d2['body'][_0xe912('0x33')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0xe912('0x24')](_0xe912('0x2d'))});})['catch'](function(_0x43637a){throw _0x43637a;});};exports['UnpauseUser']=function(_0x8c1a19){return Promise['resolve']()['then'](function(){if(_0x8c1a19['body']['channel']&&!utils['isValidChannel'](_0x8c1a19[_0xe912('0x37')][_0xe912('0x38')])){throw new Error(util[_0xe912('0x24')](_0xe912('0x39'),_0x8c1a19[_0xe912('0x37')][_0xe912('0x38')]));}return db['User'][_0xe912('0x3a')]({'where':_0x8c1a19[_0xe912('0xe')]['where']||{},'attributes':['id',_0xe912('0x1f'),_0xe912('0x20'),'internal',_0xe912('0x22'),_0xe912('0x3b'),_0xe912('0x3c'),_0xe912('0x3d'),'chatPause','faxPause','openchannelPause',_0xe912('0x3e'),'whatsappPause',_0xe912('0x3f'),_0xe912('0x40')]});})[_0xe912('0x23')](function(_0x3743ce){if(!_0x3743ce){throw new Error(util[_0xe912('0x24')](_0xe912('0x25'),_0x8c1a19['params']['id']));}return _0x3743ce[_0xe912('0x41')](_0x8c1a19[_0xe912('0x37')][_0xe912('0x38')],'system');})[_0xe912('0x16')](function(_0x540d62){throw _0x540d62;});};exports[_0xe912('0x42')]=function(_0x13f590){var _0x3cad5b=this;return new Promise(function(_0xf0afab,_0x35c2d0){var _0x3bb41b;return db[_0xe912('0x1e')][_0xe912('0x3a')]({'where':_0x13f590['options']['where']||{},'attributes':['id',_0xe912('0x1f')]})['then'](function(_0x198d99){if(_0x198d99){_0x3bb41b=_0x198d99;return db[_0xe912('0x27')][_0xe912('0x43')]({'where':{'membername':_0x3bb41b['name']},'individualHooks':!![]});}})[_0xe912('0x23')](function(){if(_0x3bb41b){return db[_0xe912('0x29')]['findAll']({'where':{'membername':_0x3bb41b[_0xe912('0x1f')],'exitAt':null}});}})['then'](function(_0x1d27f8){if(_0x3bb41b){if(_0x1d27f8&&_0x1d27f8['length']){var _0xf6d0ae=[];_0x1d27f8[_0xe912('0x44')](function(_0x18a192){_0xf6d0ae[_0xe912('0x30')](_0x18a192[_0xe912('0x28')]({'exitAt':moment()[_0xe912('0x24')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0xe912('0x45')](_0xf6d0ae);}}})['then'](function(){if(_0x3bb41b){return _0x3bb41b[_0xe912('0x28')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0xe912('0x23')](function(_0x2019d5){_0xf0afab(_0x2019d5);})[_0xe912('0x16')](function(_0x3f36f7){_0x35c2d0(_0x3cad5b[_0xe912('0x17')](0x1f4,_0x3f36f7[_0xe912('0x18')]));});});};exports[_0xe912('0x46')]=function(_0x41f7b2){var _0x5e7b92=this;return new Promise(function(_0xf92d54,_0x515a32){var _0x4ae0f5;var _0x13bf40;var _0x51d13d;var _0x1c2706;return db[_0xe912('0x1e')]['findOne']({'where':_0x41f7b2[_0xe912('0xe')][_0xe912('0x1b')]||{},'attributes':['id',_0xe912('0x1f'),_0xe912('0x20'),_0xe912('0x47'),_0xe912('0x48'),_0xe912('0x21'),_0xe912('0x49'),'interface']})[_0xe912('0x23')](function(_0x23fc41){if(_0x23fc41){_0x4ae0f5=_0x23fc41;_0x1c2706=_0x41f7b2[_0xe912('0x37')][_0xe912('0x22')]?_0x41f7b2[_0xe912('0x37')][_0xe912('0x22')]:util['format'](_0xe912('0x32'),_0x4ae0f5[_0xe912('0x1f')]);return db[_0xe912('0x1e')][_0xe912('0x4a')]({'where':{'role':_0xe912('0x4b'),'online':!![],'id':{'$ne':_0x4ae0f5['id']}}});}})[_0xe912('0x23')](function(_0x26392c){if(_0x26392c){_0x51d13d=_0x26392c;return require(_0xe912('0x4c'))['getLicense']();}})[_0xe912('0x23')](function(_0xc260c0){if(_0xc260c0&&_0xc260c0['agents']&&_0x51d13d>=_0xc260c0['agents']){throw new Error(_0xe912('0x4d'));}})['then'](function(){if(_0x4ae0f5){return db[_0xe912('0x27')]['destroy']({'where':{'membername':_0x4ae0f5[_0xe912('0x1f')]},'individualHooks':!![]});}})['then'](function(){if(_0x4ae0f5){return _0x4ae0f5[_0xe912('0x4e')]({'raw':!![]});}})['then'](function(_0x55dc46){if(_0x4ae0f5){if(_0x55dc46){var _0x5a164f=[];_0x13bf40=_0x55dc46;if(_0x13bf40['length']){for(var _0x55d65e=0x0;_0x55d65e<_0x13bf40[_0xe912('0x2c')];_0x55d65e++){_0x5a164f[_0xe912('0x30')](db['UserVoiceQueueRt']['upsert']({'membername':_0x4ae0f5[_0xe912('0x1f')],'UserId':_0x4ae0f5['id'],'queue_name':_0x13bf40[_0x55d65e][_0xe912('0x1f')],'VoiceQueueId':_0x13bf40[_0x55d65e]['id'],'interface':_0x1c2706,'paused':_0x4ae0f5[_0xe912('0x49')]||![],'penalty':_0x13bf40[_0x55d65e][_0xe912('0x4f')]||0x0}));}return BPromise['all'](_0x5a164f);}}}})['then'](function(){if(_0x4ae0f5){return db[_0xe912('0x29')][_0xe912('0x2a')]({'where':{'membername':_0x4ae0f5[_0xe912('0x1f')],'exitAt':null}});}})[_0xe912('0x23')](function(_0x89a0){if(_0x4ae0f5){if(_0x89a0&&_0x89a0[_0xe912('0x2c')]){var _0x170e06=[];_0x89a0[_0xe912('0x44')](function(_0x5e957b){_0x170e06[_0xe912('0x30')](_0x5e957b['update']({'exitAt':moment()[_0xe912('0x24')](_0xe912('0x2d'))}));});return BPromise[_0xe912('0x45')](_0x170e06);}}})[_0xe912('0x23')](function(){if(_0x4ae0f5){var _0x3e1e3b=[];var _0x53358a=[];var _0xb8339d=utils[_0xe912('0x2f')]();var _0x142e0e={'membername':_0x4ae0f5['name'],'interface':_0x1c2706,'enterAt':moment()[_0xe912('0x24')](_0xe912('0x2d')),'role':_0x4ae0f5['role'],'internal':_0x4ae0f5[_0xe912('0x21')]};_0xb8339d['forEach'](function(_0x2a9401){_0x3e1e3b[_0xe912('0x30')](_[_0xe912('0x50')]({'channel':_0x2a9401,'type':_0xe912('0x51'),'data1':_0xe912('0x52'),'data2':_0x1c2706},_0x142e0e));if(_0x4ae0f5['loginInPause']){_0x53358a['push'](_[_0xe912('0x50')]({'channel':_0x2a9401,'type':_0xe912('0x2b'),'data1':'LOGININPAUSE'},_0x142e0e));}});return db['MemberReport'][_0xe912('0x36')](_0x3e1e3b[_0xe912('0x53')](_0x53358a),{'individualHooks':!![]});}})['then'](function(){if(_0x4ae0f5){return _0x4ae0f5[_0xe912('0x28')]({'online':!![],'lastLoginAt':moment()[_0xe912('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x4ae0f5[_0xe912('0x49')]||![],'mailPause':_0x4ae0f5[_0xe912('0x49')]||![],'chatPause':_0x4ae0f5[_0xe912('0x49')]||![],'faxPause':_0x4ae0f5['loginInPause']||![],'smsPause':_0x4ae0f5['loginInPause']||![],'openchannelPause':_0x4ae0f5[_0xe912('0x49')]||![],'pauseType':_0x4ae0f5['loginInPause']?_0xe912('0x54'):null,'lastPauseAt':moment()[_0xe912('0x24')](_0xe912('0x2d')),'interface':_0x1c2706});}})[_0xe912('0x23')](function(_0x24b9b9){_0xf92d54(_0x24b9b9);})['catch'](function(_0x105412){_0x515a32(_0x5e7b92[_0xe912('0x17')](0x1f4,_0x105412[_0xe912('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index eca77f2..ecaec4e 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 _0x25b6=['update','removeListener','length','user:'];(function(_0x487f07,_0x5256f4){var _0x30f811=function(_0x56bc87){while(--_0x56bc87){_0x487f07['push'](_0x487f07['shift']());}};_0x30f811(++_0x5256f4);}(_0x25b6,0x150));var _0x625b=function(_0x46111d,_0x5d286b){_0x46111d=_0x46111d-0x0;var _0xe82586=_0x25b6[_0x46111d];return _0xe82586;};'use strict';var UserEvents=require('./user.events');var events=['save','remove',_0x625b('0x0')];function createListener(_0x5edd04,_0xfbe237){return function(_0x5bc4d5){_0xfbe237['emit'](_0x5edd04,_0x5bc4d5);};}function removeListener(_0x509e3d,_0x1cc4e5){return function(){UserEvents[_0x625b('0x1')](_0x509e3d,_0x1cc4e5);};}exports['register']=function(_0x107b93){for(var _0x70681f=0x0,_0xb18ac6=events[_0x625b('0x2')];_0x70681f<_0xb18ac6;_0x70681f++){var _0x442979=events[_0x70681f];var _0x353cb7=createListener(_0x625b('0x3')+_0x442979,_0x107b93);UserEvents['on'](_0x442979,_0x353cb7);}}; \ No newline at end of file +var _0xa816=['user:','./user.events','remove','emit','removeListener','register'];(function(_0x5c332e,_0x29f6bb){var _0x4aa64b=function(_0x368dae){while(--_0x368dae){_0x5c332e['push'](_0x5c332e['shift']());}};_0x4aa64b(++_0x29f6bb);}(_0xa816,0x1f3));var _0x6a81=function(_0x507ac5,_0x33aaee){_0x507ac5=_0x507ac5-0x0;var _0x12c1bc=_0xa816[_0x507ac5];return _0x12c1bc;};'use strict';var UserEvents=require(_0x6a81('0x0'));var events=['save',_0x6a81('0x1'),'update'];function createListener(_0x3d5360,_0x4b1ad1){return function(_0x5a0517){_0x4b1ad1[_0x6a81('0x2')](_0x3d5360,_0x5a0517);};}function removeListener(_0x890d58,_0x12df87){return function(){UserEvents[_0x6a81('0x3')](_0x890d58,_0x12df87);};}exports[_0x6a81('0x4')]=function(_0x40d6c0){for(var _0x37ceb3=0x0,_0x54f2d0=events['length'];_0x37ceb3<_0x54f2d0;_0x37ceb3++){var _0x3a63a2=events[_0x37ceb3];var _0x4fd344=createListener(_0x6a81('0x5')+_0x3a63a2,_0x40d6c0);UserEvents['on'](_0x3a63a2,_0x4fd344);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index deb4ff7..524b060 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x17543f,_0x34a3aa){var _0x479c57=function(_0x10207e){while(--_0x10207e){_0x17543f['push'](_0x17543f['shift']());}};_0x479c57(++_0x34a3aa);}(_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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0xc84c3d,_0x191cc9){var _0x220bf5=function(_0x426945){while(--_0x426945){_0xc84c3d['push'](_0xc84c3d['shift']());}};_0x220bf5(++_0x191cc9);}(_0xe706,0xa3));var _0x6e70=function(_0x500785,_0x15e5ff){_0x500785=_0x500785-0x0;var _0x1f8bcc=_0xe706[_0x500785];return _0x1f8bcc;};'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 fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index e2aaf0d..4504383 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 _0xc7e2=['sequelize','exports'];(function(_0x330d71,_0x23b7f2){var _0x463119=function(_0x5c0510){while(--_0x5c0510){_0x330d71['push'](_0x330d71['shift']());}};_0x463119(++_0x23b7f2);}(_0xc7e2,0x1d4));var _0x2c7e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc7e2[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x2c7e('0x0'));module[_0x2c7e('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x16eb=['exports','sequelize'];(function(_0x2eed64,_0x40e262){var _0x3b75d0=function(_0x260664){while(--_0x260664){_0x2eed64['push'](_0x2eed64['shift']());}};_0x3b75d0(++_0x40e262);}(_0x16eb,0x73));var _0xb16e=function(_0x46c913,_0x1a4181){_0x46c913=_0x46c913-0x0;var _0x41c6f6=_0x16eb[_0x46c913];return _0x41c6f6;};'use strict';var Sequelize=require(_0xb16e('0x0'));module[_0xb16e('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index d6afbed..10db7cd 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 _0x5b51=['api','bluebird','rimraf','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue','lodash','util','../../config/logger'];(function(_0xaa1b3e,_0x47d976){var _0x454d7d=function(_0x575b32){while(--_0x575b32){_0xaa1b3e['push'](_0xaa1b3e['shift']());}};_0x454d7d(++_0x47d976);}(_0x5b51,0x9d));var _0x15b5=function(_0x5cfb92,_0x5797e6){_0x5cfb92=_0x5cfb92-0x0;var _0x1cd7c2=_0x5b51[_0x5cfb92];return _0x1cd7c2;};'use strict';var _=require(_0x15b5('0x0'));var util=require(_0x15b5('0x1'));var logger=require(_0x15b5('0x2'))(_0x15b5('0x3'));var moment=require('moment');var BPromise=require(_0x15b5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x15b5('0x5'));var config=require(_0x15b5('0x6'));var attributes=require(_0x15b5('0x7'));module[_0x15b5('0x8')]=function(_0xf65df3,_0x28e2c6){return _0xf65df3['define'](_0x15b5('0x9'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbdf8=['path','exports','UserChatQueue','user_has_chat_queues','util','../../config/logger','moment'];(function(_0x4c7d5d,_0x385713){var _0x3f476d=function(_0x3fa87f){while(--_0x3fa87f){_0x4c7d5d['push'](_0x4c7d5d['shift']());}};_0x3f476d(++_0x385713);}(_0xbdf8,0x1a8));var _0x8bdf=function(_0x53d2fe,_0x226c7e){_0x53d2fe=_0x53d2fe-0x0;var _0x1610a8=_0xbdf8[_0x53d2fe];return _0x1610a8;};'use strict';var _=require('lodash');var util=require(_0x8bdf('0x0'));var logger=require(_0x8bdf('0x1'))('api');var moment=require(_0x8bdf('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8bdf('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userChatQueue.attributes');module[_0x8bdf('0x4')]=function(_0x4b8975,_0x47fd9c){return _0x4b8975['define'](_0x8bdf('0x5'),attributes,{'tableName':_0x8bdf('0x6'),'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 ed3b959..c4d9d53 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 _0x37ad=['code','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0xc45495,_0x4e59bf){var _0x131eb5=function(_0x1b55d4){while(--_0x1b55d4){_0xc45495['push'](_0xc45495['shift']());}};_0x131eb5(++_0x4e59bf);}(_0x37ad,0x1a5));var _0xd37a=function(_0x1c5209,_0x1a557d){_0x1c5209=_0x1c5209-0x0;var _0x2a9911=_0x37ad[_0x1c5209];return _0x2a9911;};'use strict';var _=require(_0xd37a('0x0'));var util=require(_0xd37a('0x1'));var moment=require(_0xd37a('0x2'));var BPromise=require(_0xd37a('0x3'));var rs=require(_0xd37a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd37a('0x5'));var logger=require(_0xd37a('0x6'))('rpc');var config=require(_0xd37a('0x7'));var jayson=require(_0xd37a('0x8'));var client=jayson[_0xd37a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e6891,_0x188228,_0x4afaf5){return new BPromise(function(_0x1d85ca,_0x5ee0dd){return client['request'](_0x2e6891,_0x4afaf5)[_0xd37a('0xa')](function(_0x5f43d1){logger['info'](_0xd37a('0xb'),_0x188228,_0xd37a('0xc'));logger[_0xd37a('0xd')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x188228,'request\x20sent',JSON[_0xd37a('0xe')](_0x5f43d1));if(_0x5f43d1['error']){if(_0x5f43d1[_0xd37a('0xf')][_0xd37a('0x10')]===0x1f4){logger[_0xd37a('0xf')](_0xd37a('0xb'),_0x188228,_0x5f43d1[_0xd37a('0xf')][_0xd37a('0x11')]);return _0x5ee0dd(_0x5f43d1['error'][_0xd37a('0x11')]);}logger[_0xd37a('0xf')](_0xd37a('0xb'),_0x188228,_0x5f43d1[_0xd37a('0xf')][_0xd37a('0x11')]);return _0x1d85ca(_0x5f43d1[_0xd37a('0xf')][_0xd37a('0x11')]);}else{logger['info']('UserChatQueue,\x20%s,\x20%s',_0x188228,_0xd37a('0xc'));_0x1d85ca(_0x5f43d1[_0xd37a('0x12')][_0xd37a('0x11')]);}})['catch'](function(_0x143e75){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x188228,_0x143e75);_0x5ee0dd(_0x143e75);});});} \ No newline at end of file +var _0x75d3=['then','info','UserChatQueue,\x20%s,\x20%s','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x2cda83,_0x2d38b9){var _0x3539d5=function(_0x2387df){while(--_0x2387df){_0x2cda83['push'](_0x2cda83['shift']());}};_0x3539d5(++_0x2d38b9);}(_0x75d3,0x173));var _0x375d=function(_0xe1e649,_0x1fee1a){_0xe1e649=_0xe1e649-0x0;var _0x4188f3=_0x75d3[_0xe1e649];return _0x4188f3;};'use strict';var _=require(_0x375d('0x0'));var util=require('util');var moment=require(_0x375d('0x1'));var BPromise=require(_0x375d('0x2'));var rs=require(_0x375d('0x3'));var fs=require('fs');var Redis=require(_0x375d('0x4'));var db=require(_0x375d('0x5'))['db'];var utils=require(_0x375d('0x6'));var logger=require(_0x375d('0x7'))(_0x375d('0x8'));var config=require('../../config/environment');var jayson=require(_0x375d('0x9'));var client=jayson[_0x375d('0xa')][_0x375d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e2f7f,_0x433191,_0x495dea){return new BPromise(function(_0x378417,_0x2d7bf0){return client[_0x375d('0xc')](_0x5e2f7f,_0x495dea)[_0x375d('0xd')](function(_0x1dc2e2){logger[_0x375d('0xe')](_0x375d('0xf'),_0x433191,'request\x20sent');logger[_0x375d('0x10')](_0x375d('0x11'),_0x433191,_0x375d('0x12'),JSON[_0x375d('0x13')](_0x1dc2e2));if(_0x1dc2e2[_0x375d('0x14')]){if(_0x1dc2e2['error'][_0x375d('0x15')]===0x1f4){logger[_0x375d('0x14')](_0x375d('0xf'),_0x433191,_0x1dc2e2[_0x375d('0x14')][_0x375d('0x16')]);return _0x2d7bf0(_0x1dc2e2[_0x375d('0x14')][_0x375d('0x16')]);}logger[_0x375d('0x14')](_0x375d('0xf'),_0x433191,_0x1dc2e2[_0x375d('0x14')][_0x375d('0x16')]);return _0x378417(_0x1dc2e2[_0x375d('0x14')][_0x375d('0x16')]);}else{logger[_0x375d('0xe')](_0x375d('0xf'),_0x433191,'request\x20sent');_0x378417(_0x1dc2e2[_0x375d('0x17')][_0x375d('0x16')]);}})['catch'](function(_0x5178b9){logger[_0x375d('0x14')](_0x375d('0xf'),_0x433191,_0x5178b9);_0x2d7bf0(_0x5178b9);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 041c545..5d87806 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 _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2c17c7,_0x171f6a){var _0x2c0cda=function(_0xe91723){while(--_0xe91723){_0x2c17c7['push'](_0x2c17c7['shift']());}};_0x2c0cda(++_0x171f6a);}(_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 fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x25b18e,_0x30f87f){var _0x5712be=function(_0xb79ff4){while(--_0xb79ff4){_0x25b18e['push'](_0x25b18e['shift']());}};_0x5712be(++_0x30f87f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('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 e2aab7f..440446a 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 _0xf461=['exports','INTEGER','STRING','sequelize'];(function(_0x2b3b07,_0xa237cb){var _0x553ac5=function(_0x3d9297){while(--_0x3d9297){_0x2b3b07['push'](_0x2b3b07['shift']());}};_0x553ac5(++_0xa237cb);}(_0xf461,0x14f));var _0x1f46=function(_0x246be2,_0x120bca){_0x246be2=_0x246be2-0x0;var _0x3a08c7=_0xf461[_0x246be2];return _0x3a08c7;};'use strict';var Sequelize=require(_0x1f46('0x0'));module[_0x1f46('0x1')]={'penalty':{'type':Sequelize[_0x1f46('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1f46('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x1f46('0x3')]}}; \ No newline at end of file +var _0x0ac0=['exports','INTEGER','STRING','sequelize'];(function(_0x1593ff,_0x36d2ae){var _0x3ca047=function(_0x1439af){while(--_0x1439af){_0x1593ff['push'](_0x1593ff['shift']());}};_0x3ca047(++_0x36d2ae);}(_0x0ac0,0x1c7));var _0x00ac=function(_0xe1a3a5,_0xd3e341){_0xe1a3a5=_0xe1a3a5-0x0;var _0x362646=_0x0ac0[_0xe1a3a5];return _0x362646;};'use strict';var Sequelize=require(_0x00ac('0x0'));module[_0x00ac('0x1')]={'penalty':{'type':Sequelize[_0x00ac('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0x00ac('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 1b9f607..027b69d 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 _0x97ca=['./userFaxQueue.attributes','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x97ca,0x19b));var _0xa97c=function(_0x1cccea,_0x27acc2){_0x1cccea=_0x1cccea-0x0;var _0x571972=_0x97ca[_0x1cccea];return _0x571972;};'use strict';var _=require(_0xa97c('0x0'));var util=require(_0xa97c('0x1'));var logger=require(_0xa97c('0x2'))(_0xa97c('0x3'));var moment=require(_0xa97c('0x4'));var BPromise=require('bluebird');var rp=require(_0xa97c('0x5'));var fs=require('fs');var path=require(_0xa97c('0x6'));var rimraf=require(_0xa97c('0x7'));var config=require(_0xa97c('0x8'));var attributes=require(_0xa97c('0x9'));module['exports']=function(_0x2f3cd5,_0x3119cd){return _0x2f3cd5['define'](_0xa97c('0xa'),attributes,{'tableName':_0xa97c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafcf=['util','path','rimraf','../../config/environment','UserFaxQueue','user_has_fax_queues','lodash'];(function(_0x2d54ea,_0x220b01){var _0x5e8e57=function(_0x183b74){while(--_0x183b74){_0x2d54ea['push'](_0x2d54ea['shift']());}};_0x5e8e57(++_0x220b01);}(_0xafcf,0xd8));var _0xfafc=function(_0x34022f,_0x21134c){_0x34022f=_0x34022f-0x0;var _0x1bebdf=_0xafcf[_0x34022f];return _0x1bebdf;};'use strict';var _=require(_0xfafc('0x0'));var util=require(_0xfafc('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfafc('0x2'));var rimraf=require(_0xfafc('0x3'));var config=require(_0xfafc('0x4'));var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x271846,_0x3b8379){return _0x271846['define'](_0xfafc('0x5'),attributes,{'tableName':_0xfafc('0x6'),'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 dd0902a..7251f48 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 _0xfc19=['http','request','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x3bf83e,_0x36169b){var _0xa24fe5=function(_0x4c427f){while(--_0x4c427f){_0x3bf83e['push'](_0x3bf83e['shift']());}};_0xa24fe5(++_0x36169b);}(_0xfc19,0x64));var _0x9fc1=function(_0x4d4ef0,_0x5c6861){_0x4d4ef0=_0x4d4ef0-0x0;var _0x2a7d05=_0xfc19[_0x4d4ef0];return _0x2a7d05;};'use strict';var _=require(_0x9fc1('0x0'));var util=require(_0x9fc1('0x1'));var moment=require(_0x9fc1('0x2'));var BPromise=require(_0x9fc1('0x3'));var rs=require(_0x9fc1('0x4'));var fs=require('fs');var Redis=require(_0x9fc1('0x5'));var db=require(_0x9fc1('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9fc1('0x7'));var config=require(_0x9fc1('0x8'));var jayson=require(_0x9fc1('0x9'));var client=jayson['client'][_0x9fc1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19ad5e,_0x313c8c,_0x141949){return new BPromise(function(_0x1c40d2,_0x51a42e){return client[_0x9fc1('0xb')](_0x19ad5e,_0x141949)[_0x9fc1('0xc')](function(_0x2af6e2){logger[_0x9fc1('0xd')](_0x9fc1('0xe'),_0x313c8c,_0x9fc1('0xf'));logger[_0x9fc1('0x10')](_0x9fc1('0x11'),_0x313c8c,_0x9fc1('0xf'),JSON['stringify'](_0x2af6e2));if(_0x2af6e2[_0x9fc1('0x12')]){if(_0x2af6e2[_0x9fc1('0x12')][_0x9fc1('0x13')]===0x1f4){logger[_0x9fc1('0x12')](_0x9fc1('0xe'),_0x313c8c,_0x2af6e2[_0x9fc1('0x12')][_0x9fc1('0x14')]);return _0x51a42e(_0x2af6e2[_0x9fc1('0x12')][_0x9fc1('0x14')]);}logger[_0x9fc1('0x12')](_0x9fc1('0xe'),_0x313c8c,_0x2af6e2['error'][_0x9fc1('0x14')]);return _0x1c40d2(_0x2af6e2['error'][_0x9fc1('0x14')]);}else{logger[_0x9fc1('0xd')](_0x9fc1('0xe'),_0x313c8c,'request\x20sent');_0x1c40d2(_0x2af6e2['result']['message']);}})[_0x9fc1('0x15')](function(_0x5c5322){logger['error'](_0x9fc1('0xe'),_0x313c8c,_0x5c5322);_0x51a42e(_0x5c5322);});});} \ No newline at end of file +var _0x2cc8=['request\x20sent','debug','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','UserFaxQueue,\x20%s,\x20%s'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x2cc8,0x99));var _0x82cc=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x2cc8[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0x82cc('0x0'));var util=require(_0x82cc('0x1'));var moment=require('moment');var BPromise=require(_0x82cc('0x2'));var rs=require(_0x82cc('0x3'));var fs=require('fs');var Redis=require(_0x82cc('0x4'));var db=require(_0x82cc('0x5'))['db'];var utils=require(_0x82cc('0x6'));var logger=require(_0x82cc('0x7'))(_0x82cc('0x8'));var config=require(_0x82cc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x82cc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45050e,_0x299874,_0x15d53c){return new BPromise(function(_0xe9bc8,_0x244629){return client[_0x82cc('0xb')](_0x45050e,_0x15d53c)[_0x82cc('0xc')](function(_0x33231e){logger[_0x82cc('0xd')](_0x82cc('0xe'),_0x299874,_0x82cc('0xf'));logger[_0x82cc('0x10')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x299874,_0x82cc('0xf'),JSON[_0x82cc('0x11')](_0x33231e));if(_0x33231e['error']){if(_0x33231e[_0x82cc('0x12')]['code']===0x1f4){logger[_0x82cc('0x12')](_0x82cc('0xe'),_0x299874,_0x33231e['error']['message']);return _0x244629(_0x33231e[_0x82cc('0x12')][_0x82cc('0x13')]);}logger[_0x82cc('0x12')](_0x82cc('0xe'),_0x299874,_0x33231e[_0x82cc('0x12')][_0x82cc('0x13')]);return _0xe9bc8(_0x33231e['error'][_0x82cc('0x13')]);}else{logger[_0x82cc('0xd')](_0x82cc('0xe'),_0x299874,'request\x20sent');_0xe9bc8(_0x33231e['result'][_0x82cc('0x13')]);}})[_0x82cc('0x14')](function(_0x4ea303){logger[_0x82cc('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x299874,_0x4ea303);_0x244629(_0x4ea303);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index c06c4e6..c6c6208 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4316d5,_0x17ca8c){var _0x304ce7=function(_0x7b464a){while(--_0x7b464a){_0x4316d5['push'](_0x4316d5['shift']());}};_0x304ce7(++_0x17ca8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x266691,_0x1656a4){var _0x213d71=function(_0x494c5d){while(--_0x494c5d){_0x266691['push'](_0x266691['shift']());}};_0x213d71(++_0x1656a4);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index e95e28d..7599201 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 _0x49be=['exports','sequelize'];(function(_0xf7d967,_0x8bf1cb){var _0x2a4f92=function(_0x59b128){while(--_0x59b128){_0xf7d967['push'](_0xf7d967['shift']());}};_0x2a4f92(++_0x8bf1cb);}(_0x49be,0x12b));var _0xe49b=function(_0x47878f,_0x48d3bf){_0x47878f=_0x47878f-0x0;var _0x4b05b8=_0x49be[_0x47878f];return _0x4b05b8;};'use strict';var Sequelize=require(_0xe49b('0x0'));module[_0xe49b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3a57=['INTEGER'];(function(_0x54fe4e,_0x153ebc){var _0x21ceae=function(_0x2d907b){while(--_0x2d907b){_0x54fe4e['push'](_0x54fe4e['shift']());}};_0x21ceae(++_0x153ebc);}(_0x3a57,0xaf));var _0x73a5=function(_0x3aafb3,_0x551aa0){_0x3aafb3=_0x3aafb3-0x0;var _0x2999d7=_0x3a57[_0x3aafb3];return _0x2999d7;};'use strict';var Sequelize=require('sequelize');module['exports']={'penalty':{'type':Sequelize[_0x73a5('0x0')],'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 06bbfe7..f008ad7 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 _0x9b39=['path','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','lodash','util','api','moment','bluebird'];(function(_0x169c39,_0x5d9651){var _0x820530=function(_0x498674){while(--_0x498674){_0x169c39['push'](_0x169c39['shift']());}};_0x820530(++_0x5d9651);}(_0x9b39,0x17c));var _0x99b3=function(_0x9731fe,_0x3116cf){_0x9731fe=_0x9731fe-0x0;var _0x45adea=_0x9b39[_0x9731fe];return _0x45adea;};'use strict';var _=require(_0x99b3('0x0'));var util=require(_0x99b3('0x1'));var logger=require('../../config/logger')(_0x99b3('0x2'));var moment=require(_0x99b3('0x3'));var BPromise=require(_0x99b3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x99b3('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x99b3('0x6'));module[_0x99b3('0x7')]=function(_0x4537f9,_0x26d0c4){return _0x4537f9[_0x99b3('0x8')](_0x99b3('0x9'),attributes,{'tableName':_0x99b3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3214=['user_has_mail_queues','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./userMailQueue.attributes','define','UserMailQueue'];(function(_0x5cbd45,_0x585d90){var _0x365b5d=function(_0x53eafc){while(--_0x53eafc){_0x5cbd45['push'](_0x5cbd45['shift']());}};_0x365b5d(++_0x585d90);}(_0x3214,0xbc));var _0x4321=function(_0x3e42b9,_0x35971e){_0x3e42b9=_0x3e42b9-0x0;var _0x3fa173=_0x3214[_0x3e42b9];return _0x3fa173;};'use strict';var _=require('lodash');var util=require(_0x4321('0x0'));var logger=require(_0x4321('0x1'))(_0x4321('0x2'));var moment=require(_0x4321('0x3'));var BPromise=require(_0x4321('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4321('0x5'));var rimraf=require('rimraf');var config=require(_0x4321('0x6'));var attributes=require(_0x4321('0x7'));module['exports']=function(_0x13a426,_0x2647a1){return _0x13a426[_0x4321('0x8')](_0x4321('0x9'),attributes,{'tableName':_0x4321('0xa'),'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 7894b32..ce37284 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 _0x00bb=['stringify','error','message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x1a9c91,_0x5ddb25){var _0x2ea348=function(_0x9695a5){while(--_0x9695a5){_0x1a9c91['push'](_0x1a9c91['shift']());}};_0x2ea348(++_0x5ddb25);}(_0x00bb,0x1d8));var _0xb00b=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x00bb[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var moment=require(_0xb00b('0x2'));var BPromise=require('bluebird');var rs=require(_0xb00b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb00b('0x4'))['db'];var utils=require(_0xb00b('0x5'));var logger=require('../../config/logger')(_0xb00b('0x6'));var config=require(_0xb00b('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x36e363,_0xf737d0,_0x41dfc9){return new BPromise(function(_0x37f07d,_0xfa4181){return client[_0xb00b('0x8')](_0x36e363,_0x41dfc9)['then'](function(_0x51d12b){logger[_0xb00b('0x9')](_0xb00b('0xa'),_0xf737d0,_0xb00b('0xb'));logger[_0xb00b('0xc')](_0xb00b('0xd'),_0xf737d0,'request\x20sent',JSON[_0xb00b('0xe')](_0x51d12b));if(_0x51d12b['error']){if(_0x51d12b['error']['code']===0x1f4){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);return _0xfa4181(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}logger['error'](_0xb00b('0xa'),_0xf737d0,_0x51d12b[_0xb00b('0xf')]['message']);return _0x37f07d(_0x51d12b[_0xb00b('0xf')][_0xb00b('0x10')]);}else{logger['info']('UserMailQueue,\x20%s,\x20%s',_0xf737d0,_0xb00b('0xb'));_0x37f07d(_0x51d12b['result']['message']);}})[_0xb00b('0x11')](function(_0x638443){logger[_0xb00b('0xf')](_0xb00b('0xa'),_0xf737d0,_0x638443);_0xfa4181(_0x638443);});});} \ No newline at end of file +var _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','UserMailQueue,\x20%s,\x20%s','UserMailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x56f2f1,_0xa7d5d2){var _0xe1b548=function(_0x11c57f){while(--_0x11c57f){_0x56f2f1['push'](_0x56f2f1['shift']());}};_0xe1b548(++_0xa7d5d2);}(_0xe14b,0x93));var _0xbe14=function(_0x29749a,_0x1d2e64){_0x29749a=_0x29749a-0x0;var _0x2a6fc0=_0xe14b[_0x29749a];return _0x2a6fc0;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index c187fde..2d60f6d 100644 --- a/server/api/userNotification/index.js +++ b/server/api/userNotification/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9700=['isAuthenticated','sendUserNotification','multer','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./userNotification.controller','post'];(function(_0x32cc68,_0x5d2b21){var _0x472ab1=function(_0x14ff66){while(--_0x14ff66){_0x32cc68['push'](_0x32cc68['shift']());}};_0x472ab1(++_0x5d2b21);}(_0x9700,0x178));var _0x0970=function(_0x2b06ef,_0x413e75){_0x2b06ef=_0x2b06ef-0x0;var _0x35f5d1=_0x9700[_0x2b06ef];return _0x35f5d1;};'use strict';var multer=require(_0x0970('0x0'));var util=require('util');var path=require(_0x0970('0x1'));var timeout=require(_0x0970('0x2'));var express=require('express');var router=express[_0x0970('0x3')]();var fs_extra=require(_0x0970('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0970('0x5'));var config=require(_0x0970('0x6'));var controller=require(_0x0970('0x7'));router[_0x0970('0x8')]('/',auth[_0x0970('0x9')](),controller[_0x0970('0xa')]);module['exports']=router; \ No newline at end of file +var _0x5820=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userNotification.controller','post','isAuthenticated','sendUserNotification','exports'];(function(_0x2f2ed5,_0x81d50e){var _0x3b21f5=function(_0x338e04){while(--_0x338e04){_0x2f2ed5['push'](_0x2f2ed5['shift']());}};_0x3b21f5(++_0x81d50e);}(_0x5820,0xf7));var _0x0582=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5820[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0582('0x0'));var util=require(_0x0582('0x1'));var path=require('path');var timeout=require(_0x0582('0x2'));var express=require('express');var router=express[_0x0582('0x3')]();var fs_extra=require(_0x0582('0x4'));var auth=require(_0x0582('0x5'));var interaction=require(_0x0582('0x6'));var config=require(_0x0582('0x7'));var controller=require(_0x0582('0x8'));router[_0x0582('0x9')]('/',auth[_0x0582('0xa')](),controller[_0x0582('0xb')]);module[_0x0582('0xc')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index 63a5a95..7e0f0da 100644 --- a/server/api/userNotification/userNotification.attributes.js +++ b/server/api/userNotification/userNotification.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ffd=['STRING','sequelize','TEXT'];(function(_0x45ce90,_0x114609){var _0x313c45=function(_0x55102a){while(--_0x55102a){_0x45ce90['push'](_0x45ce90['shift']());}};_0x313c45(++_0x114609);}(_0x4ffd,0xb2));var _0xd4ff=function(_0xf9a6cf,_0x11870e){_0xf9a6cf=_0xf9a6cf-0x0;var _0x59e2bc=_0x4ffd[_0xf9a6cf];return _0x59e2bc;};'use strict';var Sequelize=require(_0xd4ff('0x0'));module['exports']={'body':{'type':Sequelize[_0xd4ff('0x1')]},'senderName':{'type':Sequelize[_0xd4ff('0x2')]},'recipientsId':{'type':Sequelize[_0xd4ff('0x1')]},'recipientsDescription':{'type':Sequelize['STRING']},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0x2050=['sequelize','STRING','TEXT','BOOLEAN'];(function(_0x4402a3,_0x5a6322){var _0x4a7096=function(_0x2933fe){while(--_0x2933fe){_0x4402a3['push'](_0x4402a3['shift']());}};_0x4a7096(++_0x5a6322);}(_0x2050,0x7c));var _0x0205=function(_0x554eb0,_0x123e96){_0x554eb0=_0x554eb0-0x0;var _0x24e109=_0x2050[_0x554eb0];return _0x24e109;};'use strict';var Sequelize=require(_0x0205('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize[_0x0205('0x1')]},'recipientsId':{'type':Sequelize[_0x0205('0x2')]},'recipientsDescription':{'type':Sequelize[_0x0205('0x1')]},'beep':{'type':Sequelize[_0x0205('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index cd6c191..60bd7ab 100644 --- a/server/api/userNotification/userNotification.controller.js +++ b/server/api/userNotification/userNotification.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff2d=['sendUserNotification','body','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Missing\x20\x27view\x27\x20parameter','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','openchannelqueue','voicequeue','team','user','some','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','transaction','UserNotification','create','forEach','recipient','emit','userNotification:send','catch','Template','findOne','html','Invalid\x20\x27TemplateId\x27\x20parameter','render','startCase','model','queue','replace','Queue','ids','push','all','union','flatten','map','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./userNotification.socket','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send'];(function(_0xaf404b,_0x35df1d){var _0x356cbd=function(_0x39250c){while(--_0x39250c){_0xaf404b['push'](_0xaf404b['shift']());}};_0x356cbd(++_0x35df1d);}(_0xff2d,0x9a));var _0xdff2=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0xff2d[_0x342700];return _0x53406f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdff2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdff2('0x1'));var rp=require(_0xdff2('0x2'));var moment=require(_0xdff2('0x3'));var BPromise=require(_0xdff2('0x4'));var Mustache=require(_0xdff2('0x5'));var util=require('util');var path=require('path');var sox=require(_0xdff2('0x6'));var csv=require('to-csv');var ejs=require(_0xdff2('0x7'));var fs=require('fs');var fs_extra=require(_0xdff2('0x8'));var _=require(_0xdff2('0x9'));var squel=require(_0xdff2('0xa'));var crypto=require(_0xdff2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xdff2('0xc'));var toCsv=require('to-csv');var querystring=require(_0xdff2('0xd'));var Papa=require(_0xdff2('0xe'));var Redis=require('ioredis');var authService=require(_0xdff2('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xdff2('0x10'));var hardwareService=require(_0xdff2('0x11'));var logger=require('../../config/logger')(_0xdff2('0x12'));var utils=require(_0xdff2('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xdff2('0x14'));var db=require(_0xdff2('0x15'))['db'];config[_0xdff2('0x16')]=_['defaults'](config[_0xdff2('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xdff2('0x17'))(new Redis(config[_0xdff2('0x16')]));require(_0xdff2('0x18'))['register'](socket);function respondWithStatusCode(_0x159af7,_0x4b018d){_0x4b018d=_0x4b018d||0xcc;return function(_0x161c93){if(_0x161c93){return _0x159af7['sendStatus'](_0x4b018d);}return _0x159af7['status'](_0x4b018d)[_0xdff2('0x19')]();};}function respondWithResult(_0x305cbe,_0x9589d6){_0x9589d6=_0x9589d6||0xc8;return function(_0x299a0d){if(_0x299a0d){return _0x305cbe[_0xdff2('0x1a')](_0x9589d6)[_0xdff2('0x1b')](_0x299a0d);}};}function respondWithFilteredResult(_0x584c47,_0x2acc81){return function(_0x5c6ec9){if(_0x5c6ec9){var _0x584bba=typeof _0x2acc81[_0xdff2('0x1c')]===_0xdff2('0x1d')&&typeof _0x2acc81[_0xdff2('0x1e')]===_0xdff2('0x1d');var _0x4e9440=_0x5c6ec9['count'];var _0xf6e49c=_0x584bba?0x0:_0x2acc81[_0xdff2('0x1c')];var _0x36732d=_0x584bba?_0x5c6ec9[_0xdff2('0x1f')]:_0x2acc81[_0xdff2('0x1c')]+_0x2acc81[_0xdff2('0x1e')];var _0x137575;if(_0x36732d>=_0x4e9440){_0x36732d=_0x4e9440;_0x137575=0xc8;}else{_0x137575=0xce;}_0x584c47['status'](_0x137575);return _0x584c47[_0xdff2('0x20')](_0xdff2('0x21'),_0xf6e49c+'-'+_0x36732d+'/'+_0x4e9440)[_0xdff2('0x1b')](_0x5c6ec9);}return null;};}function patchUpdates(_0x405372){return function(_0x30e825){try{jsonpatch[_0xdff2('0x22')](_0x30e825,_0x405372,!![]);}catch(_0x1a18b9){return BPromise[_0xdff2('0x23')](_0x1a18b9);}return _0x30e825['save']();};}function saveUpdates(_0x1f0ad9,_0x26ef12){return function(_0x4acc1a){if(_0x4acc1a){return _0x4acc1a[_0xdff2('0x24')](_0x1f0ad9)[_0xdff2('0x25')](function(_0x3b2a91){return _0x3b2a91;});}return null;};}function removeEntity(_0x40db12,_0x2c4c03){return function(_0x4c5174){if(_0x4c5174){return _0x4c5174[_0xdff2('0x26')]()['then'](function(){_0x40db12[_0xdff2('0x1a')](0xcc)[_0xdff2('0x19')]();});}};}function handleEntityNotFound(_0x3e0eb2,_0x4aaa60){return function(_0x1a982d){if(!_0x1a982d){_0x3e0eb2[_0xdff2('0x27')](0x194);}return _0x1a982d;};}function handleError(_0x4b5321,_0x3f27b6){_0x3f27b6=_0x3f27b6||0x1f4;return function(_0x51f8fd){logger[_0xdff2('0x28')](_0x51f8fd[_0xdff2('0x29')]);if(_0x51f8fd[_0xdff2('0x2a')]){delete _0x51f8fd['name'];}_0x4b5321[_0xdff2('0x1a')](_0x3f27b6)[_0xdff2('0x2b')](_0x51f8fd);};}exports[_0xdff2('0x2c')]=function(_0x5b8db8,_0x54efab,_0x1d480b){if(!_0x5b8db8[_0xdff2('0x2d')][_0xdff2('0x2e')](_0xdff2('0x2f'))&&!_0x5b8db8['body'][_0xdff2('0x2e')](_0xdff2('0x30'))){throw new db[(_0xdff2('0x31'))][(_0xdff2('0x32'))](_0xdff2('0x33'));}else{if(_0x5b8db8[_0xdff2('0x2d')]['hasOwnProperty'](_0xdff2('0x30'))&&!_0x5b8db8[_0xdff2('0x2d')][_0xdff2('0x2e')](_0xdff2('0x34'))){throw new db[(_0xdff2('0x31'))]['ValidationError'](_0xdff2('0x35'));}if(!_0x5b8db8['body'][_0xdff2('0x2e')](_0xdff2('0x36'))){throw new db[(_0xdff2('0x31'))]['ValidationError'](_0xdff2('0x37'));}else{try{var _0x5c7ca=JSON[_0xdff2('0x38')](_0x5b8db8[_0xdff2('0x2d')][_0xdff2('0x36')]);}catch(_0x17796a){logger['error'](_0x17796a);throw new db[(_0xdff2('0x31'))][(_0xdff2('0x32'))](_0xdff2('0x39'));}var _0x13a568=[_0xdff2('0x3a'),_0xdff2('0x3b'),'mailqueue',_0xdff2('0x3c'),'smsqueue',_0xdff2('0x3d'),'whatsappqueue',_0xdff2('0x3e'),_0xdff2('0x3f')];if(_[_0xdff2('0x40')](_0x5c7ca,function(_0x144556){return!_['includes'](_0x13a568,_0x144556['model'][_0xdff2('0x41')]());})){throw new db[(_0xdff2('0x31'))][(_0xdff2('0x32'))](_0xdff2('0x42'));}}}var _0x217c45={};_0x217c45[_0xdff2('0x43')]=_0x5b8db8[_0xdff2('0x2d')][_0xdff2('0x2e')](_0xdff2('0x43'))?_0x5b8db8[_0xdff2('0x2d')][_0xdff2('0x43')]:_0x5b8db8[_0xdff2('0x3f')][_0xdff2('0x44')];_0x217c45['recipientsDescription']=_['isEmpty'](_0x5b8db8[_0xdff2('0x2d')][_0xdff2('0x45')])?null:_0x5b8db8['body'][_0xdff2('0x45')];_0x217c45['beep']=_0x5b8db8[_0xdff2('0x2d')][_0xdff2('0x46')]||![];_0x217c45[_0xdff2('0x47')]=_0x5b8db8['user']['id'];return getContent(_0x5b8db8[_0xdff2('0x2d')])[_0xdff2('0x25')](function(_0x265931){_0x217c45[_0xdff2('0x2d')]=_0x265931;return getRecipients(_0x5c7ca);})[_0xdff2('0x25')](function(_0x5092ab){_0x217c45[_0xdff2('0x48')]=_[_0xdff2('0x49')](_0x5092ab)[_0xdff2('0x4a')](',');return db['sequelize'][_0xdff2('0x4b')](function(_0x978724){return db[_0xdff2('0x4c')][_0xdff2('0x4d')](_0x217c45,{'raw':!![],'transaction':_0x978724})[_0xdff2('0x25')](function(_0x17a10d){var _0x255297={'sender':_0x217c45[_0xdff2('0x43')],'description':_0x217c45['recipientsDescription'],'content':_0x217c45[_0xdff2('0x2d')],'beep':_0x217c45['beep']};_0x5092ab[_0xdff2('0x4e')](function(_0x444be8){_0x255297[_0xdff2('0x4f')]=_0x444be8;socket[_0xdff2('0x50')](_0xdff2('0x51'),_0x255297);});return _0x17a10d;});});})['then'](respondWithResult(_0x54efab,0xc9))[_0xdff2('0x52')](handleError(_0x54efab,null));};function getContent(_0x120ac7){return new BPromise(function(_0x3744f7,_0x34c3f0){if(_0x120ac7[_0xdff2('0x2f')]){_0x3744f7(_0x120ac7[_0xdff2('0x2f')]);return;}return db[_0xdff2('0x53')][_0xdff2('0x54')]({'attributes':[_0xdff2('0x55')],'where':{'id':_0x120ac7[_0xdff2('0x30')]},'raw':!![]})['then'](function(_0x4e2726){if(!_0x4e2726)throw new db[(_0xdff2('0x31'))][(_0xdff2('0x32'))](_0xdff2('0x56'));var _0x4d058e=Mustache[_0xdff2('0x57')](_0x4e2726[_0xdff2('0x55')],_0x120ac7[_0xdff2('0x34')]);_0x3744f7(_0x4d058e);})['catch'](function(_0x4c9ae1){_0x34c3f0(_0x4c9ae1);});});}function getRecipients(_0x37c03e){return new BPromise(function(_0x3b6ba0,_0xc8d74e){var _0x5282b7=[];var _0x4b2a9=[];_0x37c03e[_0xdff2('0x4e')](function(_0x5e64b8){var _0x1c4992=_[_0xdff2('0x58')](_0x5e64b8[_0xdff2('0x59')][_0xdff2('0x41')]());if(_0x1c4992==='User'){_0x5282b7=_['union'](_0x5282b7,_0x5e64b8['ids']);}else{if(_['includes'](_0x1c4992,_0xdff2('0x5a')))_0x1c4992=_0x1c4992[_0xdff2('0x5b')](_0xdff2('0x5a'),_0xdff2('0x5c'));_0x5e64b8[_0xdff2('0x5d')][_0xdff2('0x4e')](function(_0x542cf6){_0x4b2a9[_0xdff2('0x5e')](getAgents(_0x1c4992,_0x542cf6));});}});return BPromise[_0xdff2('0x5f')](_0x4b2a9)[_0xdff2('0x25')](function(_0x2884cf){_0x5282b7=_[_0xdff2('0x60')](_0x5282b7,_[_0xdff2('0x61')](_0x2884cf));_0x3b6ba0(_0x5282b7);})[_0xdff2('0x52')](function(_0xa63476){_0xc8d74e(_0xa63476);});});}function getAgents(_0x238169,_0x22e493){return new BPromise(function(_0x53a27b,_0x2ef94c){return db[_0x238169][_0xdff2('0x54')]({'where':{'id':_0x22e493}})[_0xdff2('0x25')](function(_0x242899){return _0x242899['getAgents']({'attributes':['id'],'raw':!![]})[_0xdff2('0x25')](function(_0x5e9980){var _0x1c1c16=_[_0xdff2('0x62')](_0x5e9980,'id');_0x53a27b(_0x1c1c16);});})['catch'](function(_0x7b5c33){_0x2ef94c(_0x7b5c33);});});} \ No newline at end of file +var _0x69c0=['UserNotification','create','recipient','emit','userNotification:send','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','catch','User','ids','replace','queue','Queue','push','all','flatten','getAgents','map','eml-format','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./userNotification.socket','register','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','save','destroy','then','sendStatus','error','stack','name','send','hasOwnProperty','text','TemplateId','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','recipients','parse','body','chatqueue','faxqueue','openchannelqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','senderName','fullname','recipientsDescription','beep','SenderId','recipientsId','sortBy','sequelize'];(function(_0x421777,_0x5a7b59){var _0x1de9bb=function(_0x3df54c){while(--_0x3df54c){_0x421777['push'](_0x421777['shift']());}};_0x1de9bb(++_0x5a7b59);}(_0x69c0,0xd3));var _0x069c=function(_0x10d52b,_0xc6a4f1){_0x10d52b=_0x10d52b-0x0;var _0x2bf44a=_0x69c0[_0x10d52b];return _0x2bf44a;};'use strict';var emlformat=require(_0x069c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x069c('0x1'));var moment=require(_0x069c('0x2'));var BPromise=require(_0x069c('0x3'));var Mustache=require(_0x069c('0x4'));var util=require(_0x069c('0x5'));var path=require(_0x069c('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x069c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x069c('0x8'));var squel=require('squel');var crypto=require(_0x069c('0x9'));var jsforce=require(_0x069c('0xa'));var deskjs=require(_0x069c('0xb'));var toCsv=require(_0x069c('0xc'));var querystring=require('querystring');var Papa=require(_0x069c('0xd'));var Redis=require(_0x069c('0xe'));var authService=require(_0x069c('0xf'));var qs=require(_0x069c('0x10'));var as=require(_0x069c('0x11'));var hardwareService=require(_0x069c('0x12'));var logger=require('../../config/logger')(_0x069c('0x13'));var utils=require(_0x069c('0x14'));var config=require(_0x069c('0x15'));var licenseUtil=require(_0x069c('0x16'));var db=require('../../mysqldb')['db'];config[_0x069c('0x17')]=_['defaults'](config[_0x069c('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x069c('0x18'))(new Redis(config[_0x069c('0x17')]));require(_0x069c('0x19'))[_0x069c('0x1a')](socket);function respondWithStatusCode(_0x58c695,_0x4a835f){_0x4a835f=_0x4a835f||0xcc;return function(_0x1b10d1){if(_0x1b10d1){return _0x58c695['sendStatus'](_0x4a835f);}return _0x58c695[_0x069c('0x1b')](_0x4a835f)[_0x069c('0x1c')]();};}function respondWithResult(_0x317492,_0x468c68){_0x468c68=_0x468c68||0xc8;return function(_0x55be38){if(_0x55be38){return _0x317492['status'](_0x468c68)[_0x069c('0x1d')](_0x55be38);}};}function respondWithFilteredResult(_0x3836c3,_0x2e36a8){return function(_0x445fbc){if(_0x445fbc){var _0x23f995=typeof _0x2e36a8['offset']===_0x069c('0x1e')&&typeof _0x2e36a8['limit']===_0x069c('0x1e');var _0x570af6=_0x445fbc[_0x069c('0x1f')];var _0x458141=_0x23f995?0x0:_0x2e36a8[_0x069c('0x20')];var _0x44035c=_0x23f995?_0x445fbc[_0x069c('0x1f')]:_0x2e36a8[_0x069c('0x20')]+_0x2e36a8[_0x069c('0x21')];var _0x30164f;if(_0x44035c>=_0x570af6){_0x44035c=_0x570af6;_0x30164f=0xc8;}else{_0x30164f=0xce;}_0x3836c3[_0x069c('0x1b')](_0x30164f);return _0x3836c3[_0x069c('0x22')](_0x069c('0x23'),_0x458141+'-'+_0x44035c+'/'+_0x570af6)[_0x069c('0x1d')](_0x445fbc);}return null;};}function patchUpdates(_0x453432){return function(_0x4211dc){try{jsonpatch[_0x069c('0x24')](_0x4211dc,_0x453432,!![]);}catch(_0x4fcadf){return BPromise['reject'](_0x4fcadf);}return _0x4211dc[_0x069c('0x25')]();};}function saveUpdates(_0x3f8a99,_0x2b3330){return function(_0x312eb5){if(_0x312eb5){return _0x312eb5['update'](_0x3f8a99)['then'](function(_0x4bf13c){return _0x4bf13c;});}return null;};}function removeEntity(_0x4acab0,_0x300c64){return function(_0x55e55d){if(_0x55e55d){return _0x55e55d[_0x069c('0x26')]()[_0x069c('0x27')](function(){_0x4acab0[_0x069c('0x1b')](0xcc)[_0x069c('0x1c')]();});}};}function handleEntityNotFound(_0x565f1d,_0x1cf885){return function(_0x5d07f1){if(!_0x5d07f1){_0x565f1d[_0x069c('0x28')](0x194);}return _0x5d07f1;};}function handleError(_0x562d43,_0xeb2515){_0xeb2515=_0xeb2515||0x1f4;return function(_0x431d40){logger[_0x069c('0x29')](_0x431d40[_0x069c('0x2a')]);if(_0x431d40[_0x069c('0x2b')]){delete _0x431d40[_0x069c('0x2b')];}_0x562d43[_0x069c('0x1b')](_0xeb2515)[_0x069c('0x2c')](_0x431d40);};}exports['sendUserNotification']=function(_0x9ab925,_0x4d3f0c,_0x2f143a){if(!_0x9ab925['body'][_0x069c('0x2d')](_0x069c('0x2e'))&&!_0x9ab925['body'][_0x069c('0x2d')](_0x069c('0x2f'))){throw new db[(_0x069c('0x30'))][(_0x069c('0x31'))](_0x069c('0x32'));}else{if(_0x9ab925['body']['hasOwnProperty']('TemplateId')&&!_0x9ab925['body'][_0x069c('0x2d')](_0x069c('0x33'))){throw new db[(_0x069c('0x30'))][(_0x069c('0x31'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x9ab925['body']['hasOwnProperty'](_0x069c('0x34'))){throw new db[(_0x069c('0x30'))][(_0x069c('0x31'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x5bd962=JSON[_0x069c('0x35')](_0x9ab925[_0x069c('0x36')][_0x069c('0x34')]);}catch(_0x583bc4){logger[_0x069c('0x29')](_0x583bc4);throw new db[(_0x069c('0x30'))][(_0x069c('0x31'))]('Invalid\x20\x27recipients\x27\x20object');}var _0x144457=[_0x069c('0x37'),_0x069c('0x38'),'mailqueue',_0x069c('0x39'),'smsqueue',_0x069c('0x3a'),_0x069c('0x3b'),_0x069c('0x3c'),_0x069c('0x3d')];if(_[_0x069c('0x3e')](_0x5bd962,function(_0x464299){return!_[_0x069c('0x3f')](_0x144457,_0x464299[_0x069c('0x40')][_0x069c('0x41')]());})){throw new db[(_0x069c('0x30'))][(_0x069c('0x31'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x4f8e99={};_0x4f8e99['senderName']=_0x9ab925['body']['hasOwnProperty'](_0x069c('0x42'))?_0x9ab925['body'][_0x069c('0x42')]:_0x9ab925[_0x069c('0x3d')][_0x069c('0x43')];_0x4f8e99[_0x069c('0x44')]=_['isEmpty'](_0x9ab925[_0x069c('0x36')][_0x069c('0x44')])?null:_0x9ab925[_0x069c('0x36')][_0x069c('0x44')];_0x4f8e99[_0x069c('0x45')]=_0x9ab925[_0x069c('0x36')][_0x069c('0x45')]||![];_0x4f8e99[_0x069c('0x46')]=_0x9ab925[_0x069c('0x3d')]['id'];return getContent(_0x9ab925[_0x069c('0x36')])['then'](function(_0xc9b56d){_0x4f8e99['body']=_0xc9b56d;return getRecipients(_0x5bd962);})[_0x069c('0x27')](function(_0x5818dc){_0x4f8e99[_0x069c('0x47')]=_[_0x069c('0x48')](_0x5818dc)['join'](',');return db[_0x069c('0x49')]['transaction'](function(_0x24c6eb){return db[_0x069c('0x4a')][_0x069c('0x4b')](_0x4f8e99,{'raw':!![],'transaction':_0x24c6eb})[_0x069c('0x27')](function(_0x379e6d){var _0x3f6ac9={'sender':_0x4f8e99[_0x069c('0x42')],'description':_0x4f8e99[_0x069c('0x44')],'content':_0x4f8e99[_0x069c('0x36')],'beep':_0x4f8e99[_0x069c('0x45')]};_0x5818dc['forEach'](function(_0x28f13b){_0x3f6ac9[_0x069c('0x4c')]=_0x28f13b;socket[_0x069c('0x4d')](_0x069c('0x4e'),_0x3f6ac9);});return _0x379e6d;});});})[_0x069c('0x27')](respondWithResult(_0x4d3f0c,0xc9))['catch'](handleError(_0x4d3f0c,null));};function getContent(_0x22a386){return new BPromise(function(_0xc93183,_0x588a8c){if(_0x22a386[_0x069c('0x2e')]){_0xc93183(_0x22a386['text']);return;}return db[_0x069c('0x4f')][_0x069c('0x50')]({'attributes':['html'],'where':{'id':_0x22a386[_0x069c('0x2f')]},'raw':!![]})['then'](function(_0x23a0a7){if(!_0x23a0a7)throw new db['Sequelize'][(_0x069c('0x31'))](_0x069c('0x51'));var _0x4eb13=Mustache[_0x069c('0x52')](_0x23a0a7[_0x069c('0x53')],_0x22a386[_0x069c('0x33')]);_0xc93183(_0x4eb13);})[_0x069c('0x54')](function(_0xb460c3){_0x588a8c(_0xb460c3);});});}function getRecipients(_0x103c34){return new BPromise(function(_0x40dd1c,_0x276129){var _0x1206bd=[];var _0x464070=[];_0x103c34['forEach'](function(_0x553f6b){var _0x4857a5=_['startCase'](_0x553f6b['model']['toLowerCase']());if(_0x4857a5===_0x069c('0x55')){_0x1206bd=_['union'](_0x1206bd,_0x553f6b[_0x069c('0x56')]);}else{if(_[_0x069c('0x3f')](_0x4857a5,'queue'))_0x4857a5=_0x4857a5[_0x069c('0x57')](_0x069c('0x58'),_0x069c('0x59'));_0x553f6b[_0x069c('0x56')]['forEach'](function(_0x960591){_0x464070[_0x069c('0x5a')](getAgents(_0x4857a5,_0x960591));});}});return BPromise[_0x069c('0x5b')](_0x464070)[_0x069c('0x27')](function(_0x3c4361){_0x1206bd=_['union'](_0x1206bd,_[_0x069c('0x5c')](_0x3c4361));_0x40dd1c(_0x1206bd);})[_0x069c('0x54')](function(_0x2ee4ec){_0x276129(_0x2ee4ec);});});}function getAgents(_0x4b2105,_0x5ebf3c){return new BPromise(function(_0x3a77c2,_0x469879){return db[_0x4b2105]['findOne']({'where':{'id':_0x5ebf3c}})[_0x069c('0x27')](function(_0x131f79){return _0x131f79[_0x069c('0x5d')]({'attributes':['id'],'raw':!![]})[_0x069c('0x27')](function(_0x5bbb5e){var _0xf12564=_[_0x069c('0x5e')](_0x5bbb5e,'id');_0x3a77c2(_0xf12564);});})[_0x069c('0x54')](function(_0x31df14){_0x469879(_0x31df14);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 02aceea..df81da1 100644 --- a/server/api/userNotification/userNotification.events.js +++ b/server/api/userNotification/userNotification.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0077=['hasOwnProperty','hook','exports','events','../../mysqldb','UserNotification','setMaxListeners','update','emit'];(function(_0x1df4be,_0x5965c1){var _0x218122=function(_0x1af9ad){while(--_0x1af9ad){_0x1df4be['push'](_0x1df4be['shift']());}};_0x218122(++_0x5965c1);}(_0x0077,0x1e9));var _0x7007=function(_0x6bfd74,_0x558572){_0x6bfd74=_0x6bfd74-0x0;var _0x28acb3=_0x0077[_0x6bfd74];return _0x28acb3;};'use strict';var EventEmitter=require(_0x7007('0x0'));var UserNotification=require(_0x7007('0x1'))['db'][_0x7007('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x7007('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7007('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1c7f3f){return function(_0x16a076,_0x25cf07,_0x46d172){UserNotificationEvents[_0x7007('0x5')](_0x1c7f3f+':'+_0x16a076['id'],_0x16a076);UserNotificationEvents[_0x7007('0x5')](_0x1c7f3f,_0x16a076);_0x46d172(null);};}for(var e in events){if(events[_0x7007('0x6')](e)){var event=events[e];UserNotification[_0x7007('0x7')](e,emitEvent(event));}}module[_0x7007('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0xcc8b=['exports','events','UserNotification','setMaxListeners','update','emit','hook'];(function(_0x16e605,_0xf3d60b){var _0x3e64cd=function(_0x4ee310){while(--_0x4ee310){_0x16e605['push'](_0x16e605['shift']());}};_0x3e64cd(++_0xf3d60b);}(_0xcc8b,0x1f2));var _0xbcc8=function(_0x653b47,_0x52af9c){_0x653b47=_0x653b47-0x0;var _0x1f9e32=_0xcc8b[_0x653b47];return _0x1f9e32;};'use strict';var EventEmitter=require(_0xbcc8('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xbcc8('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xbcc8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbcc8('0x3'),'afterDestroy':'remove'};function emitEvent(_0x173a5b){return function(_0x32f913,_0x18cf6c,_0x1741e8){UserNotificationEvents[_0xbcc8('0x4')](_0x173a5b+':'+_0x32f913['id'],_0x32f913);UserNotificationEvents['emit'](_0x173a5b,_0x32f913);_0x1741e8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification[_0xbcc8('0x5')](e,emitEvent(event));}}module[_0xbcc8('0x6')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index a07b281..07a3105 100644 --- a/server/api/userNotification/userNotification.model.js +++ b/server/api/userNotification/userNotification.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bd8=['bluebird','request-promise','path','rimraf','./userNotification.attributes','define','UserNotification','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api'];(function(_0x12e7c6,_0x4273e8){var _0x25be4d=function(_0x21e55e){while(--_0x21e55e){_0x12e7c6['push'](_0x12e7c6['shift']());}};_0x25be4d(++_0x4273e8);}(_0x9bd8,0x82));var _0x89bd=function(_0x29de96,_0x42cc38){_0x29de96=_0x29de96-0x0;var _0x1b9352=_0x9bd8[_0x29de96];return _0x1b9352;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x89bd('0x0'))(_0x89bd('0x1'));var moment=require('moment');var BPromise=require(_0x89bd('0x2'));var rp=require(_0x89bd('0x3'));var fs=require('fs');var path=require(_0x89bd('0x4'));var rimraf=require(_0x89bd('0x5'));var config=require('../../config/environment');var attributes=require(_0x89bd('0x6'));module['exports']=function(_0x506768,_0x186885){return _0x506768[_0x89bd('0x7')](_0x89bd('0x8'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x89bd('0x9'),'collate':_0x89bd('0xa')});}; \ No newline at end of file +var _0x675e=['api','moment','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','define','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x675e,0x18a));var _0xe675=function(_0x208d75,_0x92d742){_0x208d75=_0x208d75-0x0;var _0x382d27=_0x675e[_0x208d75];return _0x382d27;};'use strict';var _=require('lodash');var util=require(_0xe675('0x0'));var logger=require(_0xe675('0x1'))(_0xe675('0x2'));var moment=require(_0xe675('0x3'));var BPromise=require('bluebird');var rp=require(_0xe675('0x4'));var fs=require('fs');var path=require(_0xe675('0x5'));var rimraf=require(_0xe675('0x6'));var config=require(_0xe675('0x7'));var attributes=require(_0xe675('0x8'));module['exports']=function(_0x2c69f0,_0x1152e3){return _0x2c69f0[_0xe675('0x9')]('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe675('0xa'),'collate':_0xe675('0xb')});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 4fd5f94..ae5649e 100644 --- a/server/api/userNotification/userNotification.rpc.js +++ b/server/api/userNotification/userNotification.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x527b=['then','info','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','code','error','UserNotification,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','request'];(function(_0x397680,_0x4eb586){var _0x3fd9a9=function(_0x2f3718){while(--_0x2f3718){_0x397680['push'](_0x397680['shift']());}};_0x3fd9a9(++_0x4eb586);}(_0x527b,0xec));var _0xb527=function(_0x3e91a9,_0x53c466){_0x3e91a9=_0x3e91a9-0x0;var _0x25c9ad=_0x527b[_0x3e91a9];return _0x25c9ad;};'use strict';var _=require(_0xb527('0x0'));var util=require(_0xb527('0x1'));var moment=require(_0xb527('0x2'));var BPromise=require(_0xb527('0x3'));var rs=require(_0xb527('0x4'));var fs=require('fs');var Redis=require(_0xb527('0x5'));var db=require(_0xb527('0x6'))['db'];var utils=require(_0xb527('0x7'));var logger=require(_0xb527('0x8'))('rpc');var config=require(_0xb527('0x9'));var jayson=require(_0xb527('0xa'));var client=jayson[_0xb527('0xb')][_0xb527('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb527('0xd')],{'host':_0xb527('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb527('0xd')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x92196,_0xe383a3,_0x5ddce4){return new BPromise(function(_0x11adac,_0x114b7f){return client[_0xb527('0xf')](_0x92196,_0x5ddce4)[_0xb527('0x10')](function(_0x19e807){logger[_0xb527('0x11')]('UserNotification,\x20%s,\x20%s',_0xe383a3,'request\x20sent');logger[_0xb527('0x12')](_0xb527('0x13'),_0xe383a3,'request\x20sent',JSON[_0xb527('0x14')](_0x19e807));if(_0x19e807['error']){if(_0x19e807['error'][_0xb527('0x15')]===0x1f4){logger[_0xb527('0x16')](_0xb527('0x17'),_0xe383a3,_0x19e807['error'][_0xb527('0x18')]);return _0x114b7f(_0x19e807[_0xb527('0x16')][_0xb527('0x18')]);}logger[_0xb527('0x16')](_0xb527('0x17'),_0xe383a3,_0x19e807['error']['message']);return _0x11adac(_0x19e807[_0xb527('0x16')][_0xb527('0x18')]);}else{logger['info'](_0xb527('0x17'),_0xe383a3,_0xb527('0x19'));_0x11adac(_0x19e807[_0xb527('0x1a')][_0xb527('0x18')]);}})[_0xb527('0x1b')](function(_0x50d355){logger[_0xb527('0x16')](_0xb527('0x17'),_0xe383a3,_0x50d355);_0x114b7f(_0x50d355);});});} \ No newline at end of file +var _0x6ecd=['UserNotification,\x20%s,\x20%s,\x20%s','stringify','code','error','message','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','request','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1d88e5,_0x169a73){var _0x3e0722=function(_0x48b214){while(--_0x48b214){_0x1d88e5['push'](_0x1d88e5['shift']());}};_0x3e0722(++_0x169a73);}(_0x6ecd,0xec));var _0xd6ec=function(_0xec9516,_0x866a8e){_0xec9516=_0xec9516-0x0;var _0x4fee75=_0x6ecd[_0xec9516];return _0x4fee75;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd6ec('0x0'));var BPromise=require(_0xd6ec('0x1'));var rs=require(_0xd6ec('0x2'));var fs=require('fs');var Redis=require(_0xd6ec('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd6ec('0x4'));var logger=require(_0xd6ec('0x5'))(_0xd6ec('0x6'));var config=require(_0xd6ec('0x7'));var jayson=require(_0xd6ec('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0xd6ec('0x9')]=_[_0xd6ec('0xa')](config[_0xd6ec('0x9')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd6ec('0x9')]));require('./userNotification.socket')['register'](socket);function respondWithRpcPromise(_0x4254aa,_0x134752,_0x43c6ea){return new BPromise(function(_0x243ce0,_0x17c844){return client[_0xd6ec('0xb')](_0x4254aa,_0x43c6ea)['then'](function(_0x28ab57){logger[_0xd6ec('0xc')](_0xd6ec('0xd'),_0x134752,_0xd6ec('0xe'));logger[_0xd6ec('0xf')](_0xd6ec('0x10'),_0x134752,_0xd6ec('0xe'),JSON[_0xd6ec('0x11')](_0x28ab57));if(_0x28ab57['error']){if(_0x28ab57['error'][_0xd6ec('0x12')]===0x1f4){logger[_0xd6ec('0x13')](_0xd6ec('0xd'),_0x134752,_0x28ab57['error'][_0xd6ec('0x14')]);return _0x17c844(_0x28ab57[_0xd6ec('0x13')][_0xd6ec('0x14')]);}logger[_0xd6ec('0x13')](_0xd6ec('0xd'),_0x134752,_0x28ab57[_0xd6ec('0x13')][_0xd6ec('0x14')]);return _0x243ce0(_0x28ab57[_0xd6ec('0x13')][_0xd6ec('0x14')]);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x134752,'request\x20sent');_0x243ce0(_0x28ab57['result']['message']);}})['catch'](function(_0x4183cd){logger[_0xd6ec('0x13')]('UserNotification,\x20%s,\x20%s',_0x134752,_0x4183cd);_0x17c844(_0x4183cd);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index ad27b6c..594a1c2 100644 --- a/server/api/userNotification/userNotification.socket.js +++ b/server/api/userNotification/userNotification.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4e1a=['update','emit','removeListener','register','length','./userNotification.events','save','remove'];(function(_0x44fc85,_0x1e97b9){var _0x3b5be3=function(_0x500539){while(--_0x500539){_0x44fc85['push'](_0x44fc85['shift']());}};_0x3b5be3(++_0x1e97b9);}(_0x4e1a,0x11d));var _0xa4e1=function(_0x3fbde2,_0x4296b4){_0x3fbde2=_0x3fbde2-0x0;var _0x5721e6=_0x4e1a[_0x3fbde2];return _0x5721e6;};'use strict';var UserNotificationEvents=require(_0xa4e1('0x0'));var events=[_0xa4e1('0x1'),_0xa4e1('0x2'),_0xa4e1('0x3')];function createListener(_0x3162eb,_0x535d3d){return function(_0x5dbca4){_0x535d3d[_0xa4e1('0x4')](_0x3162eb,_0x5dbca4);};}function removeListener(_0x73540b,_0x26cf7b){return function(){UserNotificationEvents[_0xa4e1('0x5')](_0x73540b,_0x26cf7b);};}exports[_0xa4e1('0x6')]=function(_0x27e819){for(var _0x33e2ef=0x0,_0x55c1e6=events[_0xa4e1('0x7')];_0x33e2ef<_0x55c1e6;_0x33e2ef++){var _0x803dd7=events[_0x33e2ef];var _0x204173=createListener('userNotification:'+_0x803dd7,_0x27e819);UserNotificationEvents['on'](_0x803dd7,_0x204173);}}; \ No newline at end of file +var _0x67b3=['update','emit','removeListener','register','userNotification:','./userNotification.events','save'];(function(_0xd44b84,_0x1caf09){var _0x5c71fc=function(_0x1d50d0){while(--_0x1d50d0){_0xd44b84['push'](_0xd44b84['shift']());}};_0x5c71fc(++_0x1caf09);}(_0x67b3,0xde));var _0x367b=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x67b3[_0x485b5a];return _0xd2b34d;};'use strict';var UserNotificationEvents=require(_0x367b('0x0'));var events=[_0x367b('0x1'),'remove',_0x367b('0x2')];function createListener(_0x5045e2,_0x4839d6){return function(_0x3ef09d){_0x4839d6[_0x367b('0x3')](_0x5045e2,_0x3ef09d);};}function removeListener(_0x699f0a,_0x18d9d6){return function(){UserNotificationEvents[_0x367b('0x4')](_0x699f0a,_0x18d9d6);};}exports[_0x367b('0x5')]=function(_0x479cd5){for(var _0x23366b=0x0,_0x5d8d33=events['length'];_0x23366b<_0x5d8d33;_0x23366b++){var _0x46f359=events[_0x23366b];var _0x31f99b=createListener(_0x367b('0x6')+_0x46f359,_0x479cd5);UserNotificationEvents['on'](_0x46f359,_0x31f99b);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index c6cf2a7..a0025a7 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x1a3e23,_0xce45e){var _0x5ee0d8=function(_0x4b932f){while(--_0x4b932f){_0x1a3e23['push'](_0x1a3e23['shift']());}};_0x5ee0d8(++_0xce45e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0xa9e0[_0x8de54f];return _0x14cba4;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x12d100,_0x516db1){var _0x114e3b=function(_0x2f92e8){while(--_0x2f92e8){_0x12d100['push'](_0x12d100['shift']());}};_0x114e3b(++_0x516db1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4d82ea,_0x4d459f){_0x4d82ea=_0x4d82ea-0x0;var _0x257f4a=_0xcb91[_0x4d82ea];return _0x257f4a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('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 081b522..e15f72b 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 _0xcc7a=['sequelize'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xcc7a,0x1e0));var _0xacc7=function(_0x2d982d,_0x121028){_0x2d982d=_0x2d982d-0x0;var _0x4f36b0=_0xcc7a[_0x2d982d];return _0x4f36b0;};'use strict';var Sequelize=require(_0xacc7('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xe1ce=['exports','INTEGER','sequelize'];(function(_0x41ea32,_0x14162e){var _0x137ae9=function(_0x3f8784){while(--_0x3f8784){_0x41ea32['push'](_0x41ea32['shift']());}};_0x137ae9(++_0x14162e);}(_0xe1ce,0x15e));var _0xee1c=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0xe1ce[_0x47a349];return _0x18ab75;};'use strict';var Sequelize=require(_0xee1c('0x0'));module[_0xee1c('0x1')]={'penalty':{'type':Sequelize[_0xee1c('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 e5575ac..f1a8202 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 _0xdc53=['UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment','rimraf','../../config/environment','./userOpenchannelQueue.attributes','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdc53,0x8e));var _0x3dc5=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xdc53[_0x288f5e];return _0x476cc9;};'use strict';var _=require(_0x3dc5('0x0'));var util=require(_0x3dc5('0x1'));var logger=require('../../config/logger')(_0x3dc5('0x2'));var moment=require(_0x3dc5('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3dc5('0x4'));var config=require(_0x3dc5('0x5'));var attributes=require(_0x3dc5('0x6'));module['exports']=function(_0x3c25a6,_0xa40be8){return _0x3c25a6[_0x3dc5('0x7')](_0x3dc5('0x8'),attributes,{'tableName':_0x3dc5('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8634=['./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment'];(function(_0x199bc4,_0x338105){var _0x136ffb=function(_0x3e7ced){while(--_0x3e7ced){_0x199bc4['push'](_0x199bc4['shift']());}};_0x136ffb(++_0x338105);}(_0x8634,0x143));var _0x4863=function(_0x7148a3,_0x1c6652){_0x7148a3=_0x7148a3-0x0;var _0x52f31d=_0x8634[_0x7148a3];return _0x52f31d;};'use strict';var _=require(_0x4863('0x0'));var util=require(_0x4863('0x1'));var logger=require(_0x4863('0x2'))(_0x4863('0x3'));var moment=require('moment');var BPromise=require(_0x4863('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4863('0x5'));var config=require(_0x4863('0x6'));var attributes=require(_0x4863('0x7'));module[_0x4863('0x8')]=function(_0x365393,_0x494572){return _0x365393['define'](_0x4863('0x9'),attributes,{'tableName':_0x4863('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index e822b38..54ab8ba 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 _0x66ba=['rpc','../../config/environment','jayson/promise','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x29570a,_0x124a5b){var _0x7be1a2=function(_0x44faaf){while(--_0x44faaf){_0x29570a['push'](_0x29570a['shift']());}};_0x7be1a2(++_0x124a5b);}(_0x66ba,0x1c8));var _0xa66b=function(_0x9641f8,_0x5c2372){_0x9641f8=_0x9641f8-0x0;var _0x3881b4=_0x66ba[_0x9641f8];return _0x3881b4;};'use strict';var _=require(_0xa66b('0x0'));var util=require(_0xa66b('0x1'));var moment=require(_0xa66b('0x2'));var BPromise=require(_0xa66b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa66b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa66b('0x5'));var logger=require('../../config/logger')(_0xa66b('0x6'));var config=require(_0xa66b('0x7'));var jayson=require(_0xa66b('0x8'));var client=jayson[_0xa66b('0x9')][_0xa66b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c40b6,_0x56c39f,_0xe1b781){return new BPromise(function(_0x128c94,_0x48d25b){return client['request'](_0x4c40b6,_0xe1b781)[_0xa66b('0xb')](function(_0x24a72a){logger[_0xa66b('0xc')](_0xa66b('0xd'),_0x56c39f,'request\x20sent');logger[_0xa66b('0xe')](_0xa66b('0xf'),_0x56c39f,_0xa66b('0x10'),JSON['stringify'](_0x24a72a));if(_0x24a72a['error']){if(_0x24a72a['error']['code']===0x1f4){logger[_0xa66b('0x11')](_0xa66b('0xd'),_0x56c39f,_0x24a72a[_0xa66b('0x11')][_0xa66b('0x12')]);return _0x48d25b(_0x24a72a[_0xa66b('0x11')][_0xa66b('0x12')]);}logger[_0xa66b('0x11')](_0xa66b('0xd'),_0x56c39f,_0x24a72a[_0xa66b('0x11')][_0xa66b('0x12')]);return _0x128c94(_0x24a72a['error'][_0xa66b('0x12')]);}else{logger[_0xa66b('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x56c39f,_0xa66b('0x10'));_0x128c94(_0x24a72a[_0xa66b('0x13')]['message']);}})[_0xa66b('0x14')](function(_0x24b968){logger['error'](_0xa66b('0xd'),_0x56c39f,_0x24b968);_0x48d25b(_0x24b968);});});} \ No newline at end of file +var _0x3379=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','util'];(function(_0x4f16a2,_0x2acb39){var _0x4e625e=function(_0x1c8daf){while(--_0x1c8daf){_0x4f16a2['push'](_0x4f16a2['shift']());}};_0x4e625e(++_0x2acb39);}(_0x3379,0xfb));var _0x9337=function(_0x39a40e,_0x369e5c){_0x39a40e=_0x39a40e-0x0;var _0x5cf7e5=_0x3379[_0x39a40e];return _0x5cf7e5;};'use strict';var _=require(_0x9337('0x0'));var util=require(_0x9337('0x1'));var moment=require(_0x9337('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9337('0x3'));var db=require(_0x9337('0x4'))['db'];var utils=require(_0x9337('0x5'));var logger=require(_0x9337('0x6'))(_0x9337('0x7'));var config=require(_0x9337('0x8'));var jayson=require(_0x9337('0x9'));var client=jayson[_0x9337('0xa')][_0x9337('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1571e3,_0x2903d3,_0x2338ed){return new BPromise(function(_0x275a0a,_0x599225){return client[_0x9337('0xc')](_0x1571e3,_0x2338ed)[_0x9337('0xd')](function(_0xcefe65){logger[_0x9337('0xe')](_0x9337('0xf'),_0x2903d3,'request\x20sent');logger[_0x9337('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x2903d3,_0x9337('0x11'),JSON[_0x9337('0x12')](_0xcefe65));if(_0xcefe65[_0x9337('0x13')]){if(_0xcefe65[_0x9337('0x13')][_0x9337('0x14')]===0x1f4){logger['error'](_0x9337('0xf'),_0x2903d3,_0xcefe65[_0x9337('0x13')][_0x9337('0x15')]);return _0x599225(_0xcefe65[_0x9337('0x13')]['message']);}logger[_0x9337('0x13')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2903d3,_0xcefe65[_0x9337('0x13')][_0x9337('0x15')]);return _0x275a0a(_0xcefe65['error']['message']);}else{logger['info'](_0x9337('0xf'),_0x2903d3,_0x9337('0x11'));_0x275a0a(_0xcefe65[_0x9337('0x16')]['message']);}})['catch'](function(_0x4d83f4){logger[_0x9337('0x13')](_0x9337('0xf'),_0x2903d3,_0x4d83f4);_0x599225(_0x4d83f4);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index f653d2f..98621af 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 _0x4dd8=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/resources','post','create','/:id/clone','clone','/:id/sections','addSections','addResources','put','delete','destroy','removeResources','exports','multer','path','connect-timeout'];(function(_0xb2acdf,_0x42b3fa){var _0x4ba468=function(_0x2bf136){while(--_0x2bf136){_0xb2acdf['push'](_0xb2acdf['shift']());}};_0x4ba468(++_0x42b3fa);}(_0x4dd8,0x71));var _0x84dd=function(_0x2a90d0,_0x48b69c){_0x2a90d0=_0x2a90d0-0x0;var _0x59b931=_0x4dd8[_0x2a90d0];return _0x59b931;};'use strict';var multer=require(_0x84dd('0x0'));var util=require('util');var path=require(_0x84dd('0x1'));var timeout=require(_0x84dd('0x2'));var express=require(_0x84dd('0x3'));var router=express[_0x84dd('0x4')]();var fs_extra=require(_0x84dd('0x5'));var auth=require(_0x84dd('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x84dd('0x7'));var controller=require(_0x84dd('0x8'));router[_0x84dd('0x9')]('/',auth[_0x84dd('0xa')](),controller[_0x84dd('0xb')]);router[_0x84dd('0x9')](_0x84dd('0xc'),auth['isAuthenticated'](),controller[_0x84dd('0xd')]);router[_0x84dd('0x9')](_0x84dd('0xe'),auth[_0x84dd('0xa')](),controller[_0x84dd('0xf')]);router[_0x84dd('0x9')]('/:id/sections',auth['isAuthenticated'](),controller['getSections']);router['get'](_0x84dd('0x10'),auth[_0x84dd('0xa')](),controller['getResources']);router[_0x84dd('0x11')]('/',auth[_0x84dd('0xa')](),controller[_0x84dd('0x12')]);router[_0x84dd('0x11')](_0x84dd('0x13'),auth['isAuthenticated'](),controller[_0x84dd('0x14')]);router[_0x84dd('0x11')](_0x84dd('0x15'),auth['isAuthenticated'](),controller[_0x84dd('0x16')]);router[_0x84dd('0x11')]('/:id/resources',auth[_0x84dd('0xa')](),controller[_0x84dd('0x17')]);router[_0x84dd('0x18')]('/:id',auth[_0x84dd('0xa')](),controller['update']);router[_0x84dd('0x19')](_0x84dd('0xe'),auth['isAuthenticated'](),controller[_0x84dd('0x1a')]);router[_0x84dd('0x19')](_0x84dd('0x15'),auth[_0x84dd('0xa')](),controller['removeSections']);router['delete'](_0x84dd('0x10'),auth[_0x84dd('0xa')](),controller[_0x84dd('0x1b')]);module[_0x84dd('0x1c')]=router; \ No newline at end of file +var _0xf097=['getResources','post','create','/:id/clone','clone','/:id/sections','addSections','addResources','update','delete','destroy','removeSections','removeResources','exports','multer','util','path','connect-timeout','express','Router','fs-extra','./userProfile.controller','get','isAuthenticated','index','describe','/:id','show','getSections','/:id/resources'];(function(_0x3b45e8,_0x628af6){var _0x370099=function(_0x80765f){while(--_0x80765f){_0x3b45e8['push'](_0x3b45e8['shift']());}};_0x370099(++_0x628af6);}(_0xf097,0x1b2));var _0x7f09=function(_0x3e8d4d,_0x850052){_0x3e8d4d=_0x3e8d4d-0x0;var _0x3255ff=_0xf097[_0x3e8d4d];return _0x3255ff;};'use strict';var multer=require(_0x7f09('0x0'));var util=require(_0x7f09('0x1'));var path=require(_0x7f09('0x2'));var timeout=require(_0x7f09('0x3'));var express=require(_0x7f09('0x4'));var router=express[_0x7f09('0x5')]();var fs_extra=require(_0x7f09('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7f09('0x7'));router[_0x7f09('0x8')]('/',auth[_0x7f09('0x9')](),controller[_0x7f09('0xa')]);router[_0x7f09('0x8')]('/describe',auth[_0x7f09('0x9')](),controller[_0x7f09('0xb')]);router['get'](_0x7f09('0xc'),auth[_0x7f09('0x9')](),controller[_0x7f09('0xd')]);router[_0x7f09('0x8')]('/:id/sections',auth[_0x7f09('0x9')](),controller[_0x7f09('0xe')]);router[_0x7f09('0x8')](_0x7f09('0xf'),auth[_0x7f09('0x9')](),controller[_0x7f09('0x10')]);router[_0x7f09('0x11')]('/',auth[_0x7f09('0x9')](),controller[_0x7f09('0x12')]);router[_0x7f09('0x11')](_0x7f09('0x13'),auth[_0x7f09('0x9')](),controller[_0x7f09('0x14')]);router[_0x7f09('0x11')](_0x7f09('0x15'),auth['isAuthenticated'](),controller[_0x7f09('0x16')]);router['post'](_0x7f09('0xf'),auth['isAuthenticated'](),controller[_0x7f09('0x17')]);router['put'](_0x7f09('0xc'),auth[_0x7f09('0x9')](),controller[_0x7f09('0x18')]);router[_0x7f09('0x19')]('/:id',auth[_0x7f09('0x9')](),controller[_0x7f09('0x1a')]);router[_0x7f09('0x19')](_0x7f09('0x15'),auth[_0x7f09('0x9')](),controller[_0x7f09('0x1b')]);router[_0x7f09('0x19')](_0x7f09('0xf'),auth[_0x7f09('0x9')](),controller[_0x7f09('0x1c')]);module[_0x7f09('0x1d')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index dc038f9..ea1ec71 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 _0xa06f=['BOOLEAN','exports','STRING','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x488069,_0x55c204){var _0x592336=function(_0x127efb){while(--_0x127efb){_0x488069['push'](_0x488069['shift']());}};_0x592336(++_0x55c204);}(_0xa06f,0x79));var _0xfa06=function(_0x28c585,_0x1b2cdc){_0x28c585=_0x28c585-0x0;var _0x1b9a9b=_0xa06f[_0x28c585];return _0x1b9a9b;};'use strict';var Sequelize=require('sequelize');module[_0xfa06('0x0')]={'name':{'type':Sequelize[_0xfa06('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xfa06('0x1')],'set':function(_0x1b70a2){this[_0xfa06('0x2')](_0xfa06('0x3'),_0x1b70a2?_0x1b70a2[_0xfa06('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0xfa06('0x3'))?this[_0xfa06('0x5')]('crudPermissions')[_0xfa06('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xfa06('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xfa06('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0xfa06('0x7')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xfa06('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xfa06('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xfa06('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xfa06('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xfa06('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0x0955=['BOOLEAN','name','STRING','setDataValue','crudPermissions','join','getDataValue'];(function(_0x508c49,_0x5a79b0){var _0xaf8a22=function(_0x371f9c){while(--_0x371f9c){_0x508c49['push'](_0x508c49['shift']());}};_0xaf8a22(++_0x5a79b0);}(_0x0955,0x112));var _0x5095=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x0955[_0x2112d4];return _0x434972;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5095('0x0')},'crudPermissions':{'type':Sequelize[_0x5095('0x1')],'set':function(_0x20036e){this[_0x5095('0x2')](_0x5095('0x3'),_0x20036e?_0x20036e[_0x5095('0x4')](''):[]);},'get':function(){return this[_0x5095('0x5')](_0x5095('0x3'))?this[_0x5095('0x5')](_0x5095('0x3'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x5095('0x1')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x5095('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x5095('0x6')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x5095('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x5095('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x5095('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x5095('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x5095('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index d4a547d..02ff890 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 _0x7861=['removeResources','getResources','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfile','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','length','include','merge','body','clone','find','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','autoAssociation','UserProfileResource','sectionId','Resources','create','describe','addSections','userProfileId','each','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','concat','push','findOne','forEach','resourceId','Plugin','bulkCreate'];(function(_0x47a5ba,_0x1b8463){var _0x2a3e43=function(_0x45e858){while(--_0x45e858){_0x47a5ba['push'](_0x47a5ba['shift']());}};_0x2a3e43(++_0x1b8463);}(_0x7861,0xeb));var _0x1786=function(_0x364bc0,_0x90e05b){_0x364bc0=_0x364bc0-0x0;var _0x31f133=_0x7861[_0x364bc0];return _0x31f133;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1786('0x0'));var jsonpatch=require(_0x1786('0x1'));var rp=require('request-promise');var moment=require(_0x1786('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1786('0x3'));var util=require(_0x1786('0x4'));var path=require(_0x1786('0x5'));var sox=require(_0x1786('0x6'));var csv=require('to-csv');var ejs=require(_0x1786('0x7'));var fs=require('fs');var fs_extra=require(_0x1786('0x8'));var _=require(_0x1786('0x9'));var squel=require(_0x1786('0xa'));var crypto=require(_0x1786('0xb'));var jsforce=require(_0x1786('0xc'));var deskjs=require(_0x1786('0xd'));var toCsv=require(_0x1786('0xe'));var querystring=require(_0x1786('0xf'));var Papa=require(_0x1786('0x10'));var Redis=require('ioredis');var authService=require(_0x1786('0x11'));var qs=require(_0x1786('0x12'));var as=require(_0x1786('0x13'));var hardwareService=require(_0x1786('0x14'));var logger=require('../../config/logger')(_0x1786('0x15'));var utils=require('../../config/utils');var config=require(_0x1786('0x16'));var licenseUtil=require(_0x1786('0x17'));var db=require(_0x1786('0x18'))['db'];config[_0x1786('0x19')]=_[_0x1786('0x1a')](config[_0x1786('0x19')],{'host':_0x1786('0x1b'),'port':0x18eb});var socket=require(_0x1786('0x1c'))(new Redis(config[_0x1786('0x19')]));require('./userProfile.socket')['register'](socket);function respondWithStatusCode(_0x29645c,_0x421fcd){_0x421fcd=_0x421fcd||0xcc;return function(_0x1a14c1){if(_0x1a14c1){return _0x29645c[_0x1786('0x1d')](_0x421fcd);}return _0x29645c['status'](_0x421fcd)[_0x1786('0x1e')]();};}function respondWithResult(_0x448352,_0x4da861){_0x4da861=_0x4da861||0xc8;return function(_0x178128){if(_0x178128){return _0x448352[_0x1786('0x1f')](_0x4da861)['json'](_0x178128);}};}function respondWithFilteredResult(_0x476b3b,_0x33eca3){return function(_0x10a634){if(_0x10a634){var _0x5a2179=typeof _0x33eca3[_0x1786('0x20')]===_0x1786('0x21')&&typeof _0x33eca3[_0x1786('0x22')]===_0x1786('0x21');var _0x855925=_0x10a634[_0x1786('0x23')];var _0x39ae2a=_0x5a2179?0x0:_0x33eca3[_0x1786('0x20')];var _0x1bd0c1=_0x5a2179?_0x10a634[_0x1786('0x23')]:_0x33eca3[_0x1786('0x20')]+_0x33eca3[_0x1786('0x22')];var _0x5f1640;if(_0x1bd0c1>=_0x855925){_0x1bd0c1=_0x855925;_0x5f1640=0xc8;}else{_0x5f1640=0xce;}_0x476b3b[_0x1786('0x1f')](_0x5f1640);return _0x476b3b[_0x1786('0x24')](_0x1786('0x25'),_0x39ae2a+'-'+_0x1bd0c1+'/'+_0x855925)['json'](_0x10a634);}return null;};}function patchUpdates(_0x5749ee){return function(_0xdb2ae9){try{jsonpatch['apply'](_0xdb2ae9,_0x5749ee,!![]);}catch(_0x2610ba){return BPromise[_0x1786('0x26')](_0x2610ba);}return _0xdb2ae9[_0x1786('0x27')]();};}function saveUpdates(_0x39892b,_0x47a565){return function(_0xf539fe){if(_0xf539fe){return _0xf539fe[_0x1786('0x28')](_0x39892b)[_0x1786('0x29')](function(_0x7278dd){return _0x7278dd;});}return null;};}function removeEntity(_0x2098c7,_0x50688a){return function(_0x1f7850){if(_0x1f7850){return _0x1f7850[_0x1786('0x2a')]()[_0x1786('0x29')](function(){_0x2098c7[_0x1786('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b3b01,_0x5f33dd){return function(_0x430932){if(!_0x430932){_0x4b3b01[_0x1786('0x1d')](0x194);}return _0x430932;};}function handleError(_0x2dbc31,_0x1d0397){_0x1d0397=_0x1d0397||0x1f4;return function(_0x1d5372){logger[_0x1786('0x2b')](_0x1d5372[_0x1786('0x2c')]);if(_0x1d5372['name']){delete _0x1d5372[_0x1786('0x2d')];}_0x2dbc31[_0x1786('0x1f')](_0x1d0397)[_0x1786('0x2e')](_0x1d5372);};}exports[_0x1786('0x2f')]=function(_0x2ad3a4,_0x12308c){var _0x582312={},_0x3416b6={},_0x500470={'count':0x0,'rows':[]};var _0x20bc93=_[_0x1786('0x30')](db[_0x1786('0x31')]['rawAttributes'],function(_0x10dcf9){return{'name':_0x10dcf9['fieldName'],'type':_0x10dcf9['type'][_0x1786('0x32')]};});_0x3416b6['model']=_[_0x1786('0x30')](_0x20bc93,_0x1786('0x2d'));_0x3416b6[_0x1786('0x33')]=_[_0x1786('0x34')](_0x2ad3a4[_0x1786('0x33')]);_0x3416b6['filters']=_[_0x1786('0x35')](_0x3416b6[_0x1786('0x36')],_0x3416b6['query']);_0x582312[_0x1786('0x37')]=_[_0x1786('0x35')](_0x3416b6[_0x1786('0x36')],qs[_0x1786('0x38')](_0x2ad3a4['query']['fields']));_0x582312[_0x1786('0x37')]=_0x582312['attributes']['length']?_0x582312['attributes']:_0x3416b6['model'];if(!_0x2ad3a4[_0x1786('0x33')][_0x1786('0x39')]('nolimit')){_0x582312[_0x1786('0x22')]=qs[_0x1786('0x22')](_0x2ad3a4[_0x1786('0x33')][_0x1786('0x22')]);_0x582312[_0x1786('0x20')]=qs[_0x1786('0x20')](_0x2ad3a4[_0x1786('0x33')]['offset']);}_0x582312['order']=qs[_0x1786('0x3a')](_0x2ad3a4[_0x1786('0x33')]['sort']);_0x582312[_0x1786('0x3b')]=qs[_0x1786('0x3c')](_[_0x1786('0x3d')](_0x2ad3a4['query'],_0x3416b6[_0x1786('0x3c')]),_0x20bc93);if(_0x2ad3a4['query'][_0x1786('0x3e')]){_0x582312[_0x1786('0x3b')]=_['merge'](_0x582312[_0x1786('0x3b')],{'$or':_[_0x1786('0x30')](_0x20bc93,function(_0x202c79){if(_0x202c79[_0x1786('0x3f')]!==_0x1786('0x40')){var _0x27770c={};_0x27770c[_0x202c79[_0x1786('0x2d')]]={'$like':'%'+_0x2ad3a4['query'][_0x1786('0x3e')]+'%'};return _0x27770c;}})});}_0x582312=_['merge']({},_0x582312,_0x2ad3a4[_0x1786('0x41')]);var _0x22a6ec={'where':_0x582312[_0x1786('0x3b')]};return db[_0x1786('0x31')][_0x1786('0x23')](_0x22a6ec)[_0x1786('0x29')](function(_0x3f8e77){_0x500470[_0x1786('0x23')]=_0x3f8e77;if(_0x2ad3a4[_0x1786('0x33')][_0x1786('0x42')]){_0x582312['include']=[{'all':!![]}];}return db[_0x1786('0x31')][_0x1786('0x43')](_0x582312);})[_0x1786('0x29')](function(_0x1c3185){_0x500470[_0x1786('0x44')]=_0x1c3185;return _0x500470;})[_0x1786('0x29')](respondWithFilteredResult(_0x12308c,_0x582312))[_0x1786('0x45')](handleError(_0x12308c,null));};exports[_0x1786('0x46')]=function(_0x2aea47,_0x15d6c2){var _0x3f58a4={'raw':![],'where':{'id':_0x2aea47[_0x1786('0x47')]['id']}},_0x493a48={};_0x493a48['model']=_['keys'](db[_0x1786('0x31')][_0x1786('0x48')]);_0x493a48['query']=_[_0x1786('0x34')](_0x2aea47[_0x1786('0x33')]);_0x493a48['filters']=_[_0x1786('0x35')](_0x493a48[_0x1786('0x36')],_0x493a48[_0x1786('0x33')]);_0x3f58a4[_0x1786('0x37')]=_[_0x1786('0x35')](_0x493a48['model'],qs[_0x1786('0x38')](_0x2aea47[_0x1786('0x33')][_0x1786('0x38')]));_0x3f58a4[_0x1786('0x37')]=_0x3f58a4[_0x1786('0x37')][_0x1786('0x49')]?_0x3f58a4[_0x1786('0x37')]:_0x493a48[_0x1786('0x36')];if(_0x2aea47[_0x1786('0x33')][_0x1786('0x42')]){_0x3f58a4[_0x1786('0x4a')]=[{'all':!![]}];}_0x3f58a4=_[_0x1786('0x4b')]({},_0x3f58a4,_0x2aea47['options']);return db[_0x1786('0x31')]['find'](_0x3f58a4)[_0x1786('0x29')](handleEntityNotFound(_0x15d6c2,null))[_0x1786('0x29')](respondWithResult(_0x15d6c2,null))[_0x1786('0x45')](handleError(_0x15d6c2,null));};exports['create']=function(_0x48fd52,_0x16e881){return db['UserProfile']['create'](_0x48fd52[_0x1786('0x4c')],{})[_0x1786('0x29')](respondWithResult(_0x16e881,0xc9))[_0x1786('0x45')](handleError(_0x16e881,null));};exports[_0x1786('0x4d')]=function(_0x15f1fa,_0x50ff9f){var _0x1f8e35={'where':{'id':_0x15f1fa['params']['id']}},_0x3ff112={};_0x3ff112['model']=_[_0x1786('0x34')](db[_0x1786('0x31')][_0x1786('0x48')]);_0x1f8e35['attributes']=_[_0x1786('0x35')](_0x3ff112[_0x1786('0x36')],qs[_0x1786('0x38')](_0x15f1fa[_0x1786('0x33')][_0x1786('0x38')]));_0x1f8e35[_0x1786('0x37')]=_0x1f8e35[_0x1786('0x37')][_0x1786('0x49')]?_0x1f8e35[_0x1786('0x37')]:_0x3ff112[_0x1786('0x36')];if(_0x15f1fa[_0x1786('0x33')][_0x1786('0x42')]){_0x1f8e35[_0x1786('0x4a')]=[{'all':!![]}];}_0x1f8e35=_[_0x1786('0x4b')]({},_0x1f8e35,_0x15f1fa[_0x1786('0x41')]);return db[_0x1786('0x31')][_0x1786('0x4e')](_0x1f8e35)[_0x1786('0x29')](handleEntityNotFound(_0x50ff9f,null))[_0x1786('0x29')](function(_0x52462f){if(_0x52462f){var _0x4a21a8=_0x52462f[_0x1786('0x4f')]({'plain':!![]});_0x4a21a8=qs[_0x1786('0x50')](_0x4a21a8,['id',_0x1786('0x51'),_0x1786('0x52'),_0x1786('0x53')]);_0x15f1fa[_0x1786('0x4c')]=_[_0x1786('0x50')](_0x15f1fa[_0x1786('0x4c')],['id',_0x1786('0x51'),_0x1786('0x52')]);return db[_0x1786('0x54')][_0x1786('0x55')](function(_0x1813d2){return db[_0x1786('0x31')]['create'](_[_0x1786('0x4b')](_0x4a21a8,_0x15f1fa[_0x1786('0x4c')]),{'include':_0x15f1fa[_0x1786('0x33')][_0x1786('0x42')]?[{'all':!![]}]:undefined,'transaction':_0x1813d2})[_0x1786('0x29')](function(_0x3e3b22){var _0x324492=_0x3e3b22[_0x1786('0x4f')]({'plain':!![]});return db[_0x1786('0x56')]['findAll']({'where':{'userProfileId':_0x15f1fa['params']['id']},'raw':!![]})['then'](function(_0x6f1155){if(_0x6f1155){return BPromise['each'](_0x6f1155,function(_0x46475f){return new BPromise(function(_0x97e8a4,_0x357152){if(_0x46475f[_0x1786('0x57')]===null||_0x46475f[_0x1786('0x57')]===0x1)_0x97e8a4(null);return db[_0x1786('0x58')][_0x1786('0x43')]({'where':{'sectionId':_0x46475f['id']},'raw':!![]})[_0x1786('0x29')](function(_0x2c110c){var _0x301537=_[_0x1786('0x30')](_0x2c110c,function(_0x2d4180){return qs[_0x1786('0x50')](_0x2d4180,['id','createdAt',_0x1786('0x52'),_0x1786('0x59')]);});_0x97e8a4(_0x301537);})[_0x1786('0x45')](function(_0x264906){_0x357152(_0x264906);});})['then'](function(_0x28f8f5){var _0x29864f=qs[_0x1786('0x50')](_0x46475f,['id','createdAt',_0x1786('0x52')]);_0x29864f['userProfileId']=_0x324492['id'];if(_0x28f8f5)_0x29864f[_0x1786('0x5a')]=_0x28f8f5;return _0x29864f;})[_0x1786('0x29')](function(_0xc62704){return db['UserProfileSection'][_0x1786('0x5b')](_0xc62704,{'include':[{'model':db['UserProfileResource'],'as':_0x1786('0x5a')}],'raw':!![],'transaction':_0x1813d2});});})[_0x1786('0x29')](function(){return _0x324492;});}});});});}})[_0x1786('0x29')](respondWithResult(_0x50ff9f,0xc9))['catch'](handleError(_0x50ff9f,null));};exports['update']=function(_0x5e1b57,_0x11756a){if(_0x5e1b57[_0x1786('0x4c')]['id']){delete _0x5e1b57[_0x1786('0x4c')]['id'];}return db[_0x1786('0x31')][_0x1786('0x4e')]({'where':{'id':_0x5e1b57[_0x1786('0x47')]['id']}})[_0x1786('0x29')](handleEntityNotFound(_0x11756a,null))[_0x1786('0x29')](saveUpdates(_0x5e1b57[_0x1786('0x4c')],null))[_0x1786('0x29')](respondWithResult(_0x11756a,null))[_0x1786('0x45')](handleError(_0x11756a,null));};exports[_0x1786('0x2a')]=function(_0x59fd3d,_0xd249e7){return db[_0x1786('0x31')]['find']({'where':{'id':_0x59fd3d[_0x1786('0x47')]['id']}})[_0x1786('0x29')](handleEntityNotFound(_0xd249e7,null))[_0x1786('0x29')](removeEntity(_0xd249e7,null))[_0x1786('0x45')](handleError(_0xd249e7,null));};exports[_0x1786('0x5c')]=function(_0x28ff57,_0x3e725e){return db['UserProfile']['describe']()['then'](respondWithResult(_0x3e725e,null))[_0x1786('0x45')](handleError(_0x3e725e,null));};exports[_0x1786('0x5d')]=function(_0x187f9c,_0x125263){var _0x3a5045=_0x187f9c['body'];return db[_0x1786('0x31')]['find']({'where':{'id':_0x187f9c[_0x1786('0x47')]['id']}})[_0x1786('0x29')](handleEntityNotFound(_0x125263,null))[_0x1786('0x29')](function(_0x2db3e1){if(_0x2db3e1){return db[_0x1786('0x54')]['transaction'](function(_0x280847){return db[_0x1786('0x56')][_0x1786('0x2a')]({'where':{'userProfileId':_0x187f9c[_0x1786('0x47')]['id'],'sectionId':_['map'](_0x3a5045,function(_0x891d78){return _0x891d78[_0x1786('0x59')];})},'transaction':_0x280847})[_0x1786('0x29')](function(){var _0x2b0f4e=_['map'](_0x3a5045,function(_0x138471){_0x138471[_0x1786('0x5e')]=_0x187f9c[_0x1786('0x47')]['id'];return _0x138471;});var _0x458863=[];return BPromise[_0x1786('0x5f')](_0x2b0f4e,function(_0x5f2a8b){return db['UserProfileSection'][_0x1786('0x5b')](_0x5f2a8b,{'include':[{'model':db[_0x1786('0x58')],'as':_0x1786('0x5a')}],'raw':!![],'transaction':_0x280847})['then'](function(_0x1547c0){_0x458863['push'](_0x1547c0['get']({'plain':!![]}));});})['then'](function(){return _0x458863;});});});}})['then'](function(_0x1966b8){return _0x1966b8;})[_0x1786('0x29')](respondWithResult(_0x125263,null))['catch'](handleError(_0x125263,null));};exports[_0x1786('0x60')]=function(_0x18dc17,_0x21a81b){var _0x7615f9;return db[_0x1786('0x31')][_0x1786('0x4e')]({'where':{'id':_0x18dc17['params']['id']},'attributes':['id',_0x1786('0x2d')]})['then'](handleEntityNotFound(_0x21a81b,null))[_0x1786('0x29')](function(_0x4d2a1b){if(_0x4d2a1b){_0x7615f9=_0x4d2a1b;return db[_0x1786('0x56')][_0x1786('0x2a')]({'where':{'userProfileId':_0x18dc17[_0x1786('0x47')]['id'],'sectionId':_0x18dc17['query'][_0x1786('0x61')]}});}})[_0x1786('0x29')](function(){return _0x7615f9;})['then'](respondWithStatusCode(_0x21a81b,null))[_0x1786('0x45')](handleError(_0x21a81b,null));};exports[_0x1786('0x62')]=function(_0x131fe7,_0x5cf131){var _0x588a75=[];var _0x389303=[];return db[_0x1786('0x56')][_0x1786('0x43')]({'where':{'userProfileId':_0x131fe7[_0x1786('0x47')]['id']},'raw':!![]})[_0x1786('0x29')](function(_0x20c035){_0x588a75=_['filter'](_0x20c035,function(_0x40ca39){return _0x40ca39[_0x1786('0x63')]===0x1||_[_0x1786('0x64')]([0x3eb,0x709],_0x40ca39[_0x1786('0x59')]);});if(!_[_0x1786('0x65')](_0x588a75)){return _[_0x1786('0x30')](_0x588a75,function(_0x150c0d){return _0x150c0d[_0x1786('0x59')];});}else{return;}})['then'](function(_0x379fde){if(_0x379fde)_0x389303=_0x379fde;if(_[_0x1786('0x64')](_0x389303,0x64)){var _0x38b2b8=_[_0x1786('0x4e')](_0x588a75,{'sectionId':0x64});return hasDefaultDashboard(_0x38b2b8)[_0x1786('0x29')](function(_0x51e3c0){return _[_0x1786('0x30')](_0x588a75,function(_0x5194c5){if(_0x5194c5[_0x1786('0x59')]===0x64){_0x5194c5[_0x1786('0x66')]=_0x51e3c0;}return _0x5194c5;});});}else{return;}})[_0x1786('0x29')](function(_0x1da714){if(_0x1da714)_0x588a75=_0x1da714;if(_[_0x1786('0x64')](_0x389303,0x3eb)){var _0x58faff=_[_0x1786('0x4e')](_0x588a75,{'sectionId':0x3eb});return getCustomDashboards(_0x58faff)[_0x1786('0x29')](function(_0x3f779b){return _['map'](_0x588a75,function(_0x4c7aff){if(_0x58faff['enabled']){if(_0x4c7aff[_0x1786('0x59')]===0x3eb){_0x4c7aff[_0x1786('0x66')]=_0x3f779b;}}else{if(_0x4c7aff[_0x1786('0x59')]===0x64){if(!_0x4c7aff[_0x1786('0x66')]){_0x4c7aff[_0x1786('0x66')]=[];}_0x4c7aff['subsections']=_0x4c7aff['subsections'][_0x1786('0x67')](_0x3f779b);}}return _0x4c7aff;});});}else{return;}})[_0x1786('0x29')](function(_0x8a5875){if(_0x8a5875)_0x588a75=_0x8a5875;if(_['includes'](_0x389303,0x709)){var _0x400c58=_['find'](_0x588a75,{'sectionId':0x709});return getPlugins(_0x400c58)['then'](function(_0x1b9e7e){if(_0x400c58[_0x1786('0x63')]){return _[_0x1786('0x30')](_0x588a75,function(_0x5333a7){if(_0x5333a7[_0x1786('0x59')]===0x709){_0x5333a7[_0x1786('0x66')]=_0x1b9e7e;}return _0x5333a7;});}else{var _0x325123={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1b9e7e};var _0x23bac0=_[_0x1786('0x30')](_0x588a75);_0x23bac0[_0x1786('0x68')](_0x325123);return _0x23bac0;}});}else{return;}})[_0x1786('0x29')](function(_0x30371c){if(_0x30371c)_0x588a75=_0x30371c;return _[_0x1786('0x3e')](_0x588a75,[_0x1786('0x63'),0x1]);})[_0x1786('0x29')](respondWithResult(_0x5cf131,null))[_0x1786('0x45')](handleError(_0x5cf131,null));};function hasDefaultDashboard(_0x259bb5){var _0x15d6a1=[0x65];return new BPromise(function(_0x5a9ab6,_0x58f02f){try{if(_0x259bb5[_0x1786('0x57')]){_0x5a9ab6(_0x15d6a1);}else{return db[_0x1786('0x58')][_0x1786('0x69')]({'where':{'sectionId':_0x259bb5['id']},'raw':!![]})[_0x1786('0x29')](function(_0x306037){_0x306037?_0x5a9ab6(_0x15d6a1):_0x5a9ab6();});}}catch(_0x47b80b){_0x58f02f(_0x47b80b);}});}function getCustomDashboards(_0x517c43){var _0xf0a8c1=[];return new BPromise(function(_0x1429e1,_0x3c7648){try{if(_0x517c43[_0x1786('0x57')]){return db['Dashboard']['findAll']({'raw':!![]})[_0x1786('0x29')](function(_0x4df0be){_0x4df0be['forEach'](function(_0xd1bd64){_0xf0a8c1[_0x1786('0x68')](_0xd1bd64['id']+0x1869f);});_0x1429e1(_0xf0a8c1);});}else{return db[_0x1786('0x58')][_0x1786('0x43')]({'where':{'sectionId':_0x517c43['id']},'raw':!![]})[_0x1786('0x29')](function(_0x56b0f6){_0x56b0f6[_0x1786('0x6a')](function(_0x45d48e){_0xf0a8c1[_0x1786('0x68')](_0x45d48e[_0x1786('0x6b')]+0x1869f);});_0x1429e1(_0xf0a8c1);});}}catch(_0xdeaecf){_0x3c7648(_0xdeaecf);}});}function getPlugins(_0x2697ed){var _0x402334=[];return new BPromise(function(_0x5215bb,_0x47de57){try{if(_0x2697ed[_0x1786('0x57')]){return db[_0x1786('0x6c')][_0x1786('0x43')]({'raw':!![]})[_0x1786('0x29')](function(_0x1332e5){_0x1332e5[_0x1786('0x6a')](function(_0x2a8f7e){_0x402334['push'](_0x2a8f7e['id']+0x15b38);});_0x5215bb(_0x402334);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x2697ed['id']},'raw':!![]})[_0x1786('0x29')](function(_0x23dd01){_0x23dd01['forEach'](function(_0x39fd37){_0x402334[_0x1786('0x68')](_0x39fd37[_0x1786('0x6b')]+0x15b38);});_0x5215bb(_0x402334);});}}catch(_0x24bf09){_0x47de57(_0x24bf09);}});}exports['addResources']=function(_0x4757e4,_0xdfb599){return db[_0x1786('0x31')][_0x1786('0x4e')]({'where':{'id':_0x4757e4[_0x1786('0x47')]['id']}})[_0x1786('0x29')](handleEntityNotFound(_0xdfb599,null))[_0x1786('0x29')](function(_0x159162){if(_0x159162){return db[_0x1786('0x54')][_0x1786('0x55')](function(_0x1e2ebe){return db[_0x1786('0x56')][_0x1786('0x43')]({'where':{'userProfileId':_0x4757e4[_0x1786('0x47')]['id']},'attributes':['id'],'raw':!![]})[_0x1786('0x29')](function(_0x576446){if(_0x576446){return db[_0x1786('0x56')]['destroy']({'where':{'userProfileId':_0x4757e4[_0x1786('0x47')]['id'],'id':_[_0x1786('0x30')](_0x576446,function(_0x26ab56){return _0x26ab56['id'];})},'transaction':_0x1e2ebe});}})[_0x1786('0x29')](function(_0x41610e){var _0x47c369=_[_0x1786('0x30')](_0x4757e4[_0x1786('0x4c')],function(_0x2b1249){_0x2b1249[_0x1786('0x5e')]=_0x4757e4[_0x1786('0x47')]['id'];return _0x2b1249;});return db[_0x1786('0x56')][_0x1786('0x6d')](_0x47c369,{'raw':!![],'transaction':_0x1e2ebe});})[_0x1786('0x29')](function(_0x8eea44){var _0x4c6ada=_[_0x1786('0x3e')](_[_0x1786('0x30')](_0x8eea44,function(_0xb2b032){return _0xb2b032[_0x1786('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x4c6ada){return db[_0x1786('0x56')][_0x1786('0x43')]({'where':{'userProfileId':_0x4757e4[_0x1786('0x47')]['id'],'sectionId':_[_0x1786('0x30')](_0x4c6ada,function(_0x10d157){return _0x10d157['sectionId'];})},'attributes':['id',_0x1786('0x59')],'raw':!![]})[_0x1786('0x29')](function(_0xd27636){var _0x547a07=_[_0x1786('0x30')](_0x4757e4[_0x1786('0x4c')],function(_0x88b46){_0x88b46[_0x1786('0x5e')]=_0x4757e4[_0x1786('0x47')]['id'];return _0x88b46;});return db[_0x1786('0x58')]['bulkCreate'](_0x547a07,{'raw':!![],'transaction':_0x1e2ebe});});}})[_0x1786('0x45')](handleError(_0xdfb599,null));});}})['then'](function(_0x4bef51){var _0x5e3c91=_[_0x1786('0x30')](_0x4bef51,function(_0x1bb572){return _0x1bb572[_0x1786('0x4f')]({'plain':!![]});});})[_0x1786('0x29')](respondWithResult(_0xdfb599,null))[_0x1786('0x45')](handleError(_0xdfb599,null));};exports[_0x1786('0x6e')]=function(_0x5bad38,_0x54069a,_0x4d9455){return db[_0x1786('0x31')][_0x1786('0x4e')]({'where':{'id':_0x5bad38[_0x1786('0x47')]['id']}})[_0x1786('0x29')](handleEntityNotFound(_0x54069a,null))[_0x1786('0x29')](function(_0x2dd64d){if(_0x2dd64d){return _0x2dd64d[_0x1786('0x6e')](_0x5bad38[_0x1786('0x33')]['ids']);}})['then'](respondWithStatusCode(_0x54069a,null))[_0x1786('0x45')](handleError(_0x54069a,null));};exports[_0x1786('0x6f')]=function(_0x240aaf,_0x206a2b){var _0x230c34={};if(!_0x240aaf[_0x1786('0x33')]['section'])throw new Error(_0x1786('0x70'));if(!_0x240aaf[_0x1786('0x33')][_0x1786('0x39')](_0x1786('0x71'))){_0x230c34[_0x1786('0x22')]=qs[_0x1786('0x22')](_0x240aaf[_0x1786('0x33')][_0x1786('0x22')]);_0x230c34['offset']=qs[_0x1786('0x20')](_0x240aaf[_0x1786('0x33')][_0x1786('0x20')]);}return db[_0x1786('0x31')][_0x1786('0x4e')]({'where':{'id':_0x240aaf[_0x1786('0x47')]['id']}})['then'](function(_0x19e70d){if(!_0x19e70d)throw new Error(_0x1786('0x72')+_0x240aaf[_0x1786('0x47')]['id']);return db['UserProfile'][_0x1786('0x6f')](_0x240aaf);})[_0x1786('0x29')](respondWithFilteredResult(_0x206a2b,_0x230c34))[_0x1786('0x45')](handleError(_0x206a2b,null));}; \ No newline at end of file +var _0x9923=['offset','undefined','limit','count','set','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','UserProfile','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','params','include','find','create','clone','includeAll','get','omit','createdAt','body','updatedAt','sequelize','transaction','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','UserProfileSection','update','describe','addSections','destroy','push','removeSections','ids','getSections','enabled','isEmpty','subsections','includes','findOne','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','getResources','section','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','status','end','json'];(function(_0x46e523,_0xe6fccb){var _0x5da0ee=function(_0x396682){while(--_0x396682){_0x46e523['push'](_0x46e523['shift']());}};_0x5da0ee(++_0xe6fccb);}(_0x9923,0x13e));var _0x3992=function(_0x3a852a,_0xf3f1d3){_0x3a852a=_0x3a852a-0x0;var _0x48c902=_0x9923[_0x3a852a];return _0x48c902;};'use strict';var emlformat=require(_0x3992('0x0'));var rimraf=require(_0x3992('0x1'));var zipdir=require(_0x3992('0x2'));var jsonpatch=require(_0x3992('0x3'));var rp=require(_0x3992('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x3992('0x5'));var sox=require(_0x3992('0x6'));var csv=require(_0x3992('0x7'));var ejs=require(_0x3992('0x8'));var fs=require('fs');var fs_extra=require(_0x3992('0x9'));var _=require(_0x3992('0xa'));var squel=require('squel');var crypto=require(_0x3992('0xb'));var jsforce=require(_0x3992('0xc'));var deskjs=require(_0x3992('0xd'));var toCsv=require(_0x3992('0x7'));var querystring=require(_0x3992('0xe'));var Papa=require(_0x3992('0xf'));var Redis=require(_0x3992('0x10'));var authService=require(_0x3992('0x11'));var qs=require(_0x3992('0x12'));var as=require(_0x3992('0x13'));var hardwareService=require(_0x3992('0x14'));var logger=require(_0x3992('0x15'))(_0x3992('0x16'));var utils=require(_0x3992('0x17'));var config=require(_0x3992('0x18'));var licenseUtil=require(_0x3992('0x19'));var db=require(_0x3992('0x1a'))['db'];config[_0x3992('0x1b')]=_['defaults'](config[_0x3992('0x1b')],{'host':_0x3992('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./userProfile.socket')[_0x3992('0x1d')](socket);function respondWithStatusCode(_0x5b19ea,_0x581b31){_0x581b31=_0x581b31||0xcc;return function(_0x4d894c){if(_0x4d894c){return _0x5b19ea['sendStatus'](_0x581b31);}return _0x5b19ea[_0x3992('0x1e')](_0x581b31)[_0x3992('0x1f')]();};}function respondWithResult(_0x55bb40,_0x375f9d){_0x375f9d=_0x375f9d||0xc8;return function(_0xbed54a){if(_0xbed54a){return _0x55bb40[_0x3992('0x1e')](_0x375f9d)[_0x3992('0x20')](_0xbed54a);}};}function respondWithFilteredResult(_0x599816,_0x17a349){return function(_0x187f73){if(_0x187f73){var _0x2783c5=typeof _0x17a349[_0x3992('0x21')]===_0x3992('0x22')&&typeof _0x17a349[_0x3992('0x23')]===_0x3992('0x22');var _0x12f7b5=_0x187f73[_0x3992('0x24')];var _0x7f6f80=_0x2783c5?0x0:_0x17a349[_0x3992('0x21')];var _0x14a7ee=_0x2783c5?_0x187f73[_0x3992('0x24')]:_0x17a349['offset']+_0x17a349['limit'];var _0x197d58;if(_0x14a7ee>=_0x12f7b5){_0x14a7ee=_0x12f7b5;_0x197d58=0xc8;}else{_0x197d58=0xce;}_0x599816['status'](_0x197d58);return _0x599816[_0x3992('0x25')]('Content-Range',_0x7f6f80+'-'+_0x14a7ee+'/'+_0x12f7b5)['json'](_0x187f73);}return null;};}function patchUpdates(_0x540851){return function(_0x2381b1){try{jsonpatch[_0x3992('0x26')](_0x2381b1,_0x540851,!![]);}catch(_0x53f9d4){return BPromise[_0x3992('0x27')](_0x53f9d4);}return _0x2381b1[_0x3992('0x28')]();};}function saveUpdates(_0x1a24fa,_0x32e76d){return function(_0x33a77c){if(_0x33a77c){return _0x33a77c['update'](_0x1a24fa)[_0x3992('0x29')](function(_0x25ac10){return _0x25ac10;});}return null;};}function removeEntity(_0x345f7a,_0x17218b){return function(_0x4794df){if(_0x4794df){return _0x4794df['destroy']()[_0x3992('0x29')](function(){_0x345f7a[_0x3992('0x1e')](0xcc)[_0x3992('0x1f')]();});}};}function handleEntityNotFound(_0x4a651a,_0x5c1c9a){return function(_0x443d5c){if(!_0x443d5c){_0x4a651a[_0x3992('0x2a')](0x194);}return _0x443d5c;};}function handleError(_0x968296,_0x2ede4a){_0x2ede4a=_0x2ede4a||0x1f4;return function(_0x4ed948){logger[_0x3992('0x2b')](_0x4ed948[_0x3992('0x2c')]);if(_0x4ed948[_0x3992('0x2d')]){delete _0x4ed948[_0x3992('0x2d')];}_0x968296[_0x3992('0x1e')](_0x2ede4a)[_0x3992('0x2e')](_0x4ed948);};}exports[_0x3992('0x2f')]=function(_0x1862e1,_0x287744){var _0x42fa46={},_0x3667d8={},_0xed94df={'count':0x0,'rows':[]};var _0x2e61ea=_[_0x3992('0x30')](db[_0x3992('0x31')][_0x3992('0x32')],function(_0x4d14f1){return{'name':_0x4d14f1['fieldName'],'type':_0x4d14f1[_0x3992('0x33')][_0x3992('0x34')]};});_0x3667d8['model']=_[_0x3992('0x30')](_0x2e61ea,_0x3992('0x2d'));_0x3667d8['query']=_[_0x3992('0x35')](_0x1862e1[_0x3992('0x36')]);_0x3667d8[_0x3992('0x37')]=_[_0x3992('0x38')](_0x3667d8[_0x3992('0x39')],_0x3667d8[_0x3992('0x36')]);_0x42fa46[_0x3992('0x3a')]=_[_0x3992('0x38')](_0x3667d8['model'],qs[_0x3992('0x3b')](_0x1862e1[_0x3992('0x36')][_0x3992('0x3b')]));_0x42fa46['attributes']=_0x42fa46[_0x3992('0x3a')][_0x3992('0x3c')]?_0x42fa46[_0x3992('0x3a')]:_0x3667d8[_0x3992('0x39')];if(!_0x1862e1[_0x3992('0x36')][_0x3992('0x3d')](_0x3992('0x3e'))){_0x42fa46[_0x3992('0x23')]=qs[_0x3992('0x23')](_0x1862e1[_0x3992('0x36')]['limit']);_0x42fa46[_0x3992('0x21')]=qs[_0x3992('0x21')](_0x1862e1[_0x3992('0x36')][_0x3992('0x21')]);}_0x42fa46[_0x3992('0x3f')]=qs[_0x3992('0x40')](_0x1862e1[_0x3992('0x36')]['sort']);_0x42fa46[_0x3992('0x41')]=qs[_0x3992('0x37')](_[_0x3992('0x42')](_0x1862e1[_0x3992('0x36')],_0x3667d8[_0x3992('0x37')]),_0x2e61ea);if(_0x1862e1[_0x3992('0x36')][_0x3992('0x43')]){_0x42fa46[_0x3992('0x41')]=_[_0x3992('0x44')](_0x42fa46['where'],{'$or':_[_0x3992('0x30')](_0x2e61ea,function(_0x3a776f){if(_0x3a776f[_0x3992('0x33')]!==_0x3992('0x45')){var _0x109aa9={};_0x109aa9[_0x3a776f[_0x3992('0x2d')]]={'$like':'%'+_0x1862e1[_0x3992('0x36')][_0x3992('0x43')]+'%'};return _0x109aa9;}})});}_0x42fa46=_['merge']({},_0x42fa46,_0x1862e1[_0x3992('0x46')]);var _0x1efce4={'where':_0x42fa46[_0x3992('0x41')]};return db['UserProfile'][_0x3992('0x24')](_0x1efce4)[_0x3992('0x29')](function(_0x5595be){_0xed94df['count']=_0x5595be;if(_0x1862e1[_0x3992('0x36')]['includeAll']){_0x42fa46['include']=[{'all':!![]}];}return db['UserProfile'][_0x3992('0x47')](_0x42fa46);})[_0x3992('0x29')](function(_0x3f2b15){_0xed94df[_0x3992('0x48')]=_0x3f2b15;return _0xed94df;})['then'](respondWithFilteredResult(_0x287744,_0x42fa46))[_0x3992('0x49')](handleError(_0x287744,null));};exports['show']=function(_0x402bc5,_0x2155e3){var _0x5b9e3a={'raw':![],'where':{'id':_0x402bc5[_0x3992('0x4a')]['id']}},_0x115f31={};_0x115f31['model']=_[_0x3992('0x35')](db[_0x3992('0x31')][_0x3992('0x32')]);_0x115f31['query']=_[_0x3992('0x35')](_0x402bc5[_0x3992('0x36')]);_0x115f31[_0x3992('0x37')]=_[_0x3992('0x38')](_0x115f31[_0x3992('0x39')],_0x115f31[_0x3992('0x36')]);_0x5b9e3a[_0x3992('0x3a')]=_[_0x3992('0x38')](_0x115f31[_0x3992('0x39')],qs[_0x3992('0x3b')](_0x402bc5[_0x3992('0x36')][_0x3992('0x3b')]));_0x5b9e3a['attributes']=_0x5b9e3a[_0x3992('0x3a')][_0x3992('0x3c')]?_0x5b9e3a[_0x3992('0x3a')]:_0x115f31[_0x3992('0x39')];if(_0x402bc5[_0x3992('0x36')]['includeAll']){_0x5b9e3a[_0x3992('0x4b')]=[{'all':!![]}];}_0x5b9e3a=_[_0x3992('0x44')]({},_0x5b9e3a,_0x402bc5['options']);return db[_0x3992('0x31')][_0x3992('0x4c')](_0x5b9e3a)[_0x3992('0x29')](handleEntityNotFound(_0x2155e3,null))[_0x3992('0x29')](respondWithResult(_0x2155e3,null))[_0x3992('0x49')](handleError(_0x2155e3,null));};exports[_0x3992('0x4d')]=function(_0x5e786d,_0x298fbe){return db[_0x3992('0x31')][_0x3992('0x4d')](_0x5e786d['body'],{})['then'](respondWithResult(_0x298fbe,0xc9))['catch'](handleError(_0x298fbe,null));};exports[_0x3992('0x4e')]=function(_0x1a51f,_0x2c48e0){var _0x2d8e25={'where':{'id':_0x1a51f['params']['id']}},_0x4b435c={};_0x4b435c[_0x3992('0x39')]=_[_0x3992('0x35')](db['UserProfile'][_0x3992('0x32')]);_0x2d8e25[_0x3992('0x3a')]=_[_0x3992('0x38')](_0x4b435c[_0x3992('0x39')],qs[_0x3992('0x3b')](_0x1a51f[_0x3992('0x36')][_0x3992('0x3b')]));_0x2d8e25[_0x3992('0x3a')]=_0x2d8e25[_0x3992('0x3a')][_0x3992('0x3c')]?_0x2d8e25[_0x3992('0x3a')]:_0x4b435c[_0x3992('0x39')];if(_0x1a51f[_0x3992('0x36')][_0x3992('0x4f')]){_0x2d8e25[_0x3992('0x4b')]=[{'all':!![]}];}_0x2d8e25=_['merge']({},_0x2d8e25,_0x1a51f[_0x3992('0x46')]);return db[_0x3992('0x31')][_0x3992('0x4c')](_0x2d8e25)[_0x3992('0x29')](handleEntityNotFound(_0x2c48e0,null))['then'](function(_0x1d9a96){if(_0x1d9a96){var _0x6c2ff5=_0x1d9a96[_0x3992('0x50')]({'plain':!![]});_0x6c2ff5=qs[_0x3992('0x51')](_0x6c2ff5,['id',_0x3992('0x52'),'updatedAt','crudPermissions']);_0x1a51f[_0x3992('0x53')]=_[_0x3992('0x51')](_0x1a51f[_0x3992('0x53')],['id','createdAt',_0x3992('0x54')]);return db[_0x3992('0x55')][_0x3992('0x56')](function(_0x267492){return db[_0x3992('0x31')]['create'](_[_0x3992('0x44')](_0x6c2ff5,_0x1a51f[_0x3992('0x53')]),{'include':_0x1a51f['query'][_0x3992('0x4f')]?[{'all':!![]}]:undefined,'transaction':_0x267492})['then'](function(_0x335b72){var _0x345a0c=_0x335b72['get']({'plain':!![]});return db['UserProfileSection'][_0x3992('0x47')]({'where':{'userProfileId':_0x1a51f[_0x3992('0x4a')]['id']},'raw':!![]})[_0x3992('0x29')](function(_0x2a39ae){if(_0x2a39ae){return BPromise[_0x3992('0x57')](_0x2a39ae,function(_0x3bf8ca){return new BPromise(function(_0x44fc69,_0x4de29b){if(_0x3bf8ca[_0x3992('0x58')]===null||_0x3bf8ca[_0x3992('0x58')]===0x1)_0x44fc69(null);return db[_0x3992('0x59')][_0x3992('0x47')]({'where':{'sectionId':_0x3bf8ca['id']},'raw':!![]})[_0x3992('0x29')](function(_0x549ab3){var _0x412c5b=_['map'](_0x549ab3,function(_0x16763b){return qs['omit'](_0x16763b,['id',_0x3992('0x52'),'updatedAt',_0x3992('0x5a')]);});_0x44fc69(_0x412c5b);})['catch'](function(_0x49d94b){_0x4de29b(_0x49d94b);});})[_0x3992('0x29')](function(_0x59baac){var _0x5772e7=qs[_0x3992('0x51')](_0x3bf8ca,['id',_0x3992('0x52'),_0x3992('0x54')]);_0x5772e7[_0x3992('0x5b')]=_0x345a0c['id'];if(_0x59baac)_0x5772e7[_0x3992('0x5c')]=_0x59baac;return _0x5772e7;})['then'](function(_0x4e0f7f){return db[_0x3992('0x5d')][_0x3992('0x4d')](_0x4e0f7f,{'include':[{'model':db[_0x3992('0x59')],'as':_0x3992('0x5c')}],'raw':!![],'transaction':_0x267492});});})[_0x3992('0x29')](function(){return _0x345a0c;});}});});});}})['then'](respondWithResult(_0x2c48e0,0xc9))[_0x3992('0x49')](handleError(_0x2c48e0,null));};exports[_0x3992('0x5e')]=function(_0x3077a0,_0x1e92b0){if(_0x3077a0[_0x3992('0x53')]['id']){delete _0x3077a0[_0x3992('0x53')]['id'];}return db[_0x3992('0x31')]['find']({'where':{'id':_0x3077a0['params']['id']}})[_0x3992('0x29')](handleEntityNotFound(_0x1e92b0,null))['then'](saveUpdates(_0x3077a0['body'],null))[_0x3992('0x29')](respondWithResult(_0x1e92b0,null))[_0x3992('0x49')](handleError(_0x1e92b0,null));};exports['destroy']=function(_0x4ca380,_0x48c2c8){return db[_0x3992('0x31')][_0x3992('0x4c')]({'where':{'id':_0x4ca380[_0x3992('0x4a')]['id']}})[_0x3992('0x29')](handleEntityNotFound(_0x48c2c8,null))[_0x3992('0x29')](removeEntity(_0x48c2c8,null))[_0x3992('0x49')](handleError(_0x48c2c8,null));};exports[_0x3992('0x5f')]=function(_0xf5130c,_0x396d03){return db[_0x3992('0x31')][_0x3992('0x5f')]()['then'](respondWithResult(_0x396d03,null))[_0x3992('0x49')](handleError(_0x396d03,null));};exports[_0x3992('0x60')]=function(_0x57dc42,_0x3523ef){var _0xc9c99=_0x57dc42[_0x3992('0x53')];return db[_0x3992('0x31')][_0x3992('0x4c')]({'where':{'id':_0x57dc42[_0x3992('0x4a')]['id']}})[_0x3992('0x29')](handleEntityNotFound(_0x3523ef,null))[_0x3992('0x29')](function(_0x257806){if(_0x257806){return db[_0x3992('0x55')][_0x3992('0x56')](function(_0x34a5af){return db[_0x3992('0x5d')][_0x3992('0x61')]({'where':{'userProfileId':_0x57dc42[_0x3992('0x4a')]['id'],'sectionId':_['map'](_0xc9c99,function(_0x51659f){return _0x51659f[_0x3992('0x5a')];})},'transaction':_0x34a5af})[_0x3992('0x29')](function(){var _0x501710=_['map'](_0xc9c99,function(_0x2a28b1){_0x2a28b1[_0x3992('0x5b')]=_0x57dc42[_0x3992('0x4a')]['id'];return _0x2a28b1;});var _0x4caf8d=[];return BPromise[_0x3992('0x57')](_0x501710,function(_0x6848e5){return db[_0x3992('0x5d')][_0x3992('0x4d')](_0x6848e5,{'include':[{'model':db[_0x3992('0x59')],'as':_0x3992('0x5c')}],'raw':!![],'transaction':_0x34a5af})[_0x3992('0x29')](function(_0x5bda58){_0x4caf8d[_0x3992('0x62')](_0x5bda58['get']({'plain':!![]}));});})['then'](function(){return _0x4caf8d;});});});}})['then'](function(_0x240c93){return _0x240c93;})[_0x3992('0x29')](respondWithResult(_0x3523ef,null))['catch'](handleError(_0x3523ef,null));};exports[_0x3992('0x63')]=function(_0x2083c9,_0x59c195){var _0x42bb7a;return db[_0x3992('0x31')][_0x3992('0x4c')]({'where':{'id':_0x2083c9['params']['id']},'attributes':['id',_0x3992('0x2d')]})['then'](handleEntityNotFound(_0x59c195,null))[_0x3992('0x29')](function(_0x5602c4){if(_0x5602c4){_0x42bb7a=_0x5602c4;return db[_0x3992('0x5d')][_0x3992('0x61')]({'where':{'userProfileId':_0x2083c9[_0x3992('0x4a')]['id'],'sectionId':_0x2083c9[_0x3992('0x36')][_0x3992('0x64')]}});}})['then'](function(){return _0x42bb7a;})[_0x3992('0x29')](respondWithStatusCode(_0x59c195,null))[_0x3992('0x49')](handleError(_0x59c195,null));};exports[_0x3992('0x65')]=function(_0x44a728,_0x26b584){var _0x56ec3b=[];var _0x392324=[];return db['UserProfileSection'][_0x3992('0x47')]({'where':{'userProfileId':_0x44a728[_0x3992('0x4a')]['id']},'raw':!![]})[_0x3992('0x29')](function(_0x469f8c){_0x56ec3b=_[_0x3992('0x43')](_0x469f8c,function(_0xd2b78f){return _0xd2b78f[_0x3992('0x66')]===0x1||_['includes']([0x3eb,0x709],_0xd2b78f['sectionId']);});if(!_[_0x3992('0x67')](_0x56ec3b)){return _[_0x3992('0x30')](_0x56ec3b,function(_0x19ba65){return _0x19ba65['sectionId'];});}else{return;}})['then'](function(_0x1e5660){if(_0x1e5660)_0x392324=_0x1e5660;if(_['includes'](_0x392324,0x64)){var _0x3cdd8f=_['find'](_0x56ec3b,{'sectionId':0x64});return hasDefaultDashboard(_0x3cdd8f)[_0x3992('0x29')](function(_0x44fdb8){return _['map'](_0x56ec3b,function(_0x29bad0){if(_0x29bad0[_0x3992('0x5a')]===0x64){_0x29bad0[_0x3992('0x68')]=_0x44fdb8;}return _0x29bad0;});});}else{return;}})[_0x3992('0x29')](function(_0x57b353){if(_0x57b353)_0x56ec3b=_0x57b353;if(_[_0x3992('0x69')](_0x392324,0x3eb)){var _0x66a9=_[_0x3992('0x4c')](_0x56ec3b,{'sectionId':0x3eb});return getCustomDashboards(_0x66a9)['then'](function(_0x1fe6c9){return _[_0x3992('0x30')](_0x56ec3b,function(_0x523fea){if(_0x66a9['enabled']){if(_0x523fea[_0x3992('0x5a')]===0x3eb){_0x523fea[_0x3992('0x68')]=_0x1fe6c9;}}else{if(_0x523fea[_0x3992('0x5a')]===0x64){if(!_0x523fea[_0x3992('0x68')]){_0x523fea[_0x3992('0x68')]=[];}_0x523fea[_0x3992('0x68')]=_0x523fea['subsections']['concat'](_0x1fe6c9);}}return _0x523fea;});});}else{return;}})[_0x3992('0x29')](function(_0x4fca50){if(_0x4fca50)_0x56ec3b=_0x4fca50;if(_[_0x3992('0x69')](_0x392324,0x709)){var _0x7a6b25=_['find'](_0x56ec3b,{'sectionId':0x709});return getPlugins(_0x7a6b25)[_0x3992('0x29')](function(_0x3950dd){if(_0x7a6b25[_0x3992('0x66')]){return _[_0x3992('0x30')](_0x56ec3b,function(_0x2d7a21){if(_0x2d7a21[_0x3992('0x5a')]===0x709){_0x2d7a21[_0x3992('0x68')]=_0x3950dd;}return _0x2d7a21;});}else{var _0x47a03a={'sectionId':0x76c,'enabled':0x1,'subsections':_0x3950dd};var _0x49e802=_[_0x3992('0x30')](_0x56ec3b);_0x49e802[_0x3992('0x62')](_0x47a03a);return _0x49e802;}});}else{return;}})['then'](function(_0x3ac15a){if(_0x3ac15a)_0x56ec3b=_0x3ac15a;return _[_0x3992('0x43')](_0x56ec3b,['enabled',0x1]);})[_0x3992('0x29')](respondWithResult(_0x26b584,null))[_0x3992('0x49')](handleError(_0x26b584,null));};function hasDefaultDashboard(_0x2d3201){var _0x441f4d=[0x65];return new BPromise(function(_0x382f6e,_0x442393){try{if(_0x2d3201[_0x3992('0x58')]){_0x382f6e(_0x441f4d);}else{return db[_0x3992('0x59')][_0x3992('0x6a')]({'where':{'sectionId':_0x2d3201['id']},'raw':!![]})[_0x3992('0x29')](function(_0x3cd2b3){_0x3cd2b3?_0x382f6e(_0x441f4d):_0x382f6e();});}}catch(_0x40b125){_0x442393(_0x40b125);}});}function getCustomDashboards(_0x32584d){var _0x5e540b=[];return new BPromise(function(_0x14e216,_0xbf6942){try{if(_0x32584d[_0x3992('0x58')]){return db[_0x3992('0x6b')][_0x3992('0x47')]({'raw':!![]})[_0x3992('0x29')](function(_0x332e0d){_0x332e0d[_0x3992('0x6c')](function(_0x5ee9ec){_0x5e540b[_0x3992('0x62')](_0x5ee9ec['id']+0x1869f);});_0x14e216(_0x5e540b);});}else{return db[_0x3992('0x59')]['findAll']({'where':{'sectionId':_0x32584d['id']},'raw':!![]})['then'](function(_0x1a8259){_0x1a8259[_0x3992('0x6c')](function(_0x41b831){_0x5e540b[_0x3992('0x62')](_0x41b831[_0x3992('0x6d')]+0x1869f);});_0x14e216(_0x5e540b);});}}catch(_0x567d4f){_0xbf6942(_0x567d4f);}});}function getPlugins(_0x30fed9){var _0x309711=[];return new BPromise(function(_0x48a6ca,_0x1ed13c){try{if(_0x30fed9[_0x3992('0x58')]){return db[_0x3992('0x6e')][_0x3992('0x47')]({'raw':!![]})[_0x3992('0x29')](function(_0x32ffb7){_0x32ffb7[_0x3992('0x6c')](function(_0x2def5c){_0x309711[_0x3992('0x62')](_0x2def5c['id']+0x15b38);});_0x48a6ca(_0x309711);});}else{return db['UserProfileResource'][_0x3992('0x47')]({'where':{'sectionId':_0x30fed9['id']},'raw':!![]})[_0x3992('0x29')](function(_0x57cb09){_0x57cb09[_0x3992('0x6c')](function(_0x2e5e9a){_0x309711[_0x3992('0x62')](_0x2e5e9a[_0x3992('0x6d')]+0x15b38);});_0x48a6ca(_0x309711);});}}catch(_0x319ec1){_0x1ed13c(_0x319ec1);}});}exports['addResources']=function(_0x2c355d,_0x382745){return db[_0x3992('0x31')][_0x3992('0x4c')]({'where':{'id':_0x2c355d['params']['id']}})[_0x3992('0x29')](handleEntityNotFound(_0x382745,null))['then'](function(_0x5f2278){if(_0x5f2278){return db[_0x3992('0x55')][_0x3992('0x56')](function(_0x46d733){return db[_0x3992('0x5d')][_0x3992('0x47')]({'where':{'userProfileId':_0x2c355d['params']['id']},'attributes':['id'],'raw':!![]})[_0x3992('0x29')](function(_0x4b1280){if(_0x4b1280){return db[_0x3992('0x5d')][_0x3992('0x61')]({'where':{'userProfileId':_0x2c355d['params']['id'],'id':_[_0x3992('0x30')](_0x4b1280,function(_0x5f0b89){return _0x5f0b89['id'];})},'transaction':_0x46d733});}})[_0x3992('0x29')](function(_0x222085){var _0x517270=_[_0x3992('0x30')](_0x2c355d['body'],function(_0x136da2){_0x136da2[_0x3992('0x5b')]=_0x2c355d['params']['id'];return _0x136da2;});return db[_0x3992('0x5d')][_0x3992('0x6f')](_0x517270,{'raw':!![],'transaction':_0x46d733});})[_0x3992('0x29')](function(_0x5d5077){var _0x425137=_['filter'](_[_0x3992('0x30')](_0x5d5077,function(_0x20a83c){return _0x20a83c['get']({'plain':!![]});}),{'includeAll':![]});if(_0x425137){return db[_0x3992('0x5d')][_0x3992('0x47')]({'where':{'userProfileId':_0x2c355d[_0x3992('0x4a')]['id'],'sectionId':_[_0x3992('0x30')](_0x425137,function(_0xd8f83b){return _0xd8f83b[_0x3992('0x5a')];})},'attributes':['id',_0x3992('0x5a')],'raw':!![]})[_0x3992('0x29')](function(_0x5f075b){var _0x260012=_[_0x3992('0x30')](_0x2c355d['body'],function(_0x36456f){_0x36456f[_0x3992('0x5b')]=_0x2c355d[_0x3992('0x4a')]['id'];return _0x36456f;});return db[_0x3992('0x59')][_0x3992('0x6f')](_0x260012,{'raw':!![],'transaction':_0x46d733});});}})['catch'](handleError(_0x382745,null));});}})[_0x3992('0x29')](function(_0x6270d1){var _0x5c268e=_[_0x3992('0x30')](_0x6270d1,function(_0x354344){return _0x354344['get']({'plain':!![]});});})[_0x3992('0x29')](respondWithResult(_0x382745,null))[_0x3992('0x49')](handleError(_0x382745,null));};exports[_0x3992('0x70')]=function(_0x1284be,_0x18ab8f,_0x2c261a){return db['UserProfile'][_0x3992('0x4c')]({'where':{'id':_0x1284be[_0x3992('0x4a')]['id']}})['then'](handleEntityNotFound(_0x18ab8f,null))[_0x3992('0x29')](function(_0xb67e8b){if(_0xb67e8b){return _0xb67e8b[_0x3992('0x70')](_0x1284be[_0x3992('0x36')][_0x3992('0x64')]);}})[_0x3992('0x29')](respondWithStatusCode(_0x18ab8f,null))[_0x3992('0x49')](handleError(_0x18ab8f,null));};exports[_0x3992('0x71')]=function(_0x23f1cc,_0x5eb52f){var _0x510a5c={};if(!_0x23f1cc['query'][_0x3992('0x72')])throw new Error(_0x3992('0x73'));if(!_0x23f1cc['query']['hasOwnProperty'](_0x3992('0x3e'))){_0x510a5c['limit']=qs[_0x3992('0x23')](_0x23f1cc[_0x3992('0x36')][_0x3992('0x23')]);_0x510a5c[_0x3992('0x21')]=qs[_0x3992('0x21')](_0x23f1cc[_0x3992('0x36')][_0x3992('0x21')]);}return db[_0x3992('0x31')]['find']({'where':{'id':_0x23f1cc[_0x3992('0x4a')]['id']}})[_0x3992('0x29')](function(_0x417a89){if(!_0x417a89)throw new Error(_0x3992('0x74')+_0x23f1cc[_0x3992('0x4a')]['id']);return db[_0x3992('0x31')][_0x3992('0x71')](_0x23f1cc);})[_0x3992('0x29')](respondWithFilteredResult(_0x5eb52f,_0x510a5c))[_0x3992('0x49')](handleError(_0x5eb52f,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 995efbe..ebb04aa 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 _0x01a6=['emit','hasOwnProperty','hook','events','UserProfile','setMaxListeners','save','update','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x01a6,0x162));var _0x601a=function(_0x500841,_0x4f5d59){_0x500841=_0x500841-0x0;var _0x3766ba=_0x01a6[_0x500841];return _0x3766ba;};'use strict';var EventEmitter=require(_0x601a('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x601a('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x601a('0x2')](0x0);var events={'afterCreate':_0x601a('0x3'),'afterUpdate':_0x601a('0x4'),'afterDestroy':_0x601a('0x5')};function emitEvent(_0x526c19){return function(_0x2ac499,_0x4c666c,_0x245bd0){UserProfileEvents[_0x601a('0x6')](_0x526c19+':'+_0x2ac499['id'],_0x2ac499);UserProfileEvents[_0x601a('0x6')](_0x526c19,_0x2ac499);_0x245bd0(null);};}for(var e in events){if(events[_0x601a('0x7')](e)){var event=events[e];UserProfile[_0x601a('0x8')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x68fd=['exports','events','UserProfile','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x547add,_0x387042){var _0x2ed1f3=function(_0x3bbb4d){while(--_0x3bbb4d){_0x547add['push'](_0x547add['shift']());}};_0x2ed1f3(++_0x387042);}(_0x68fd,0x1e9));var _0xd68f=function(_0x226291,_0x45dff0){_0x226291=_0x226291-0x0;var _0x2ae02e=_0x68fd[_0x226291];return _0x2ae02e;};'use strict';var EventEmitter=require(_0xd68f('0x0'));var UserProfile=require('../../mysqldb')['db'][_0xd68f('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xd68f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd68f('0x3'),'afterDestroy':_0xd68f('0x4')};function emitEvent(_0x96d959){return function(_0x3e5e78,_0x37c481,_0x9814cb){UserProfileEvents[_0xd68f('0x5')](_0x96d959+':'+_0x3e5e78['id'],_0x3e5e78);UserProfileEvents[_0xd68f('0x5')](_0x96d959,_0x3e5e78);_0x9814cb(null);};}for(var e in events){if(events[_0xd68f('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0xd68f('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 50621e0..65a8e9d 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 _0x0735=['WhatsappAccount','teams','voicequeues','queuecampaigns','users','agents','telephones','Users','admin','Telephones','zendeskaccounts','ZendeskAccount','salesforceaccounts','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','CannedAnswer','dispositions','customdashboards','Dashboard','intervals','Interval','scheduler','Schedule','sounds','Sound','tags','Tag','Template','Trigger','variables','extractedreports','metrics','AnalyticMetric','charAt','toUpperCase','slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','ui.UserId\x20=\x20?','query','toString','OpenTabs','define','UserProfile','user_profiles','raw','section','mergeResources','Invalid\x20section\x20\x27','isEmpty','length','find','all','union','ignore','autoAssociation','push','keys','intersection','fields','attributes','model','hasOwnProperty','limit','offset','sort','filters','pick','key','VIRTUAL','foreignKey','forEach','merge','includeAll','reportType','default','DefaultReports','custom','reportId','CustomReports','count','ids','customSorting','include','Tags','color','tag','ThroughTags','Agents','rows','dataValues','sms','mail','lodash','./userProfile.attributes','../../components/parsers/qs','exports','models','filter','field','value','findAll','then','associatedResources','map','catch','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','squareprojects','childModel','SquareProject','odbc','SquareOdbc','SquareRecording','SquareProjects','name','projects','JscriptyProject','parentSections','Lists','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','contexts','voicemails','VoiceMail','voicerecordings','VoiceRecording','User','agent','role','telephone','VoiceQueues','queue','VoiceQueue','type','inbound','QueueCampaigns','outbound','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x0735,0x68));var _0x5073=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0x0735[_0x24237f];return _0x48298e;};'use strict';var _=require(_0x5073('0x0'));var attributes=require(_0x5073('0x1'));var qs=require(_0x5073('0x2'));var squel=require('squel');module[_0x5073('0x3')]=function(_0x7ec072){var _0x4ee954=_0x7ec072[_0x5073('0x4')];function _0x2be9c3(_0x1336a5,_0xe818e4){return new Promise(function(_0xd2e42f,_0x4c6fa1){if(!_0xe818e4)return _0xd2e42f(null);var _0x1693c4=_0xe818e4[_0x5073('0x5')]?{[_0xe818e4[_0x5073('0x5')][_0x5073('0x6')]]:_0xe818e4[_0x5073('0x5')][_0x5073('0x7')]}:undefined;return _0x4ee954[_0x1336a5][_0x5073('0x8')]({'where':_0x1693c4,'raw':!![]})[_0x5073('0x9')](function(_0xdca88d){_0xe818e4[_0x5073('0xa')]=_[_0x5073('0xb')](_0xdca88d,'id');_0xd2e42f(_0xe818e4);})[_0x5073('0xc')](function(_0x29600e){_0x4c6fa1(_0x29600e);});});}function _0x4a3ceb(_0x4f00d1,_0x196fca){return new Promise(function(_0x52be01,_0x404e06){var _0x223cca=_0x4f00d1['filter']?{[_0x4f00d1[_0x5073('0x5')][_0x5073('0x6')]]:_0x4f00d1['filter'][_0x5073('0x7')]}:undefined;return _0x4ee954[_0x4f00d1['model']][_0x5073('0x8')]({'where':_0x223cca,'raw':!![]})[_0x5073('0x9')](function(_0xd5005b){_0x196fca[_0x5073('0xa')]=_[_0x5073('0xb')](_0xd5005b,function(_0x17db19){return _0x17db19['name'];});_0x52be01(_0x196fca);})['catch'](function(_0x41fc0e){_0x404e06(_0x41fc0e);});});}function _0x578b97(_0x34867d,_0x495a34,_0x3b2875){if(!_0x495a34)return Promise[_0x5073('0xd')](null);return new Promise(function(_0x54585c,_0x4e78d9){return _0x4ee954[_0x5073('0xe')][_0x5073('0x8')]({'where':{'sectionId':_0x495a34['id']},'raw':!![]})[_0x5073('0x9')](function(_0x15afe7){if(_0x34867d[_0x5073('0x6')]&&_0x34867d[_0x5073('0x6')]!=='id'){_0x495a34[_0x5073('0xa')]=_[_0x5073('0xb')](_0x15afe7,function(_0x167fc5){return _0x167fc5[_0x34867d[_0x5073('0x6')]];});}else{if(_0x3b2875===_0x5073('0xf')){_0x495a34[_0x5073('0xa')]=_[_0x5073('0xb')](_0x15afe7,function(_0x5b4819){return{'id':_0x5b4819[_0x5073('0x10')],'type':_0x5b4819['type']};});}else{_0x495a34[_0x5073('0xa')]=_['map'](_0x15afe7,function(_0x3fd864){return _0x3fd864['resourceId'];});}}_0x54585c(_0x495a34);})[_0x5073('0xc')](function(_0x37a82a){_0x4e78d9(_0x37a82a);});});}function _0x1d361b(_0x431e25,_0x4844e8){var _0x937b7d={'parentSections':[]};switch(_0x431e25['toLowerCase']()){case _0x5073('0x11'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x13');break;case _0x5073('0x14'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x15');break;case'squarerecordings':_0x937b7d[_0x5073('0x12')]=_0x5073('0x16');_0x937b7d['parentSections']=[{'name':_0x5073('0x17'),'field':_0x5073('0x18'),'foreignKey':'projectName'}];break;case _0x5073('0x19'):_0x937b7d['childModel']=_0x5073('0x1a');break;case'contacts':_0x937b7d[_0x5073('0x12')]='CmContact';_0x937b7d[_0x5073('0x1b')]=[{'name':_0x5073('0x1c'),'field':'id','foreignKey':'ListId'}];break;case _0x5073('0x1d'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x1e');break;case _0x5073('0x1f'):_0x937b7d['childModel']='CmCompany';break;case _0x5073('0x20'):_0x937b7d['childModel']=_0x5073('0x21');break;case _0x5073('0x22'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x23');break;case _0x5073('0x24'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x25');break;case _0x5073('0x26'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x27');break;case'faxaccounts':_0x937b7d[_0x5073('0x12')]=_0x5073('0x28');break;case _0x5073('0x29'):case'internalroutes':case _0x5073('0x2a'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x2b');break;case _0x5073('0x2c'):_0x937b7d[_0x5073('0x12')]='VoiceContext';break;case _0x5073('0x2d'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x2e');break;case _0x5073('0x2f'):_0x937b7d['childModel']=_0x5073('0x30');_0x937b7d[_0x5073('0x1b')]=[{'name':'Agents','field':_0x5073('0x18'),'foreignKey':'membername','model':_0x5073('0x31'),'filter':{'field':'role','value':[_0x5073('0x32')]}},{'name':'Telephones','field':_0x5073('0x18'),'foreignKey':'membername','model':_0x5073('0x31'),'filter':{'field':_0x5073('0x33'),'value':[_0x5073('0x34')]}},{'name':_0x5073('0x35'),'field':_0x5073('0x18'),'foreignKey':_0x5073('0x36'),'model':_0x5073('0x37'),'filter':{'field':_0x5073('0x38'),'value':[_0x5073('0x39')]}},{'name':_0x5073('0x3a'),'field':_0x5073('0x18'),'foreignKey':_0x5073('0x36'),'model':_0x5073('0x37'),'filter':{'field':'type','value':[_0x5073('0x3b')]}}];break;case'musiconholds':_0x937b7d[_0x5073('0x12')]='VoiceMusicOnHold';break;case _0x5073('0x3c'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x3d');break;case _0x5073('0x3e'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x3f');break;case _0x5073('0x40'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x41');break;case _0x5073('0x42'):_0x937b7d['childModel']=_0x5073('0x43');break;case _0x5073('0x44'):_0x937b7d['childModel']='MailAccount';break;case _0x5073('0x45'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x46');break;case _0x5073('0x47'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x48');break;case _0x5073('0x49'):_0x937b7d[_0x5073('0x12')]='OpenchannelAccount';break;case _0x5073('0x4a'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x4b');break;case _0x5073('0x4c'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x4d');break;case _0x5073('0x4e'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x4f');break;case _0x5073('0x50'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x51');break;case _0x5073('0x52'):_0x937b7d[_0x5073('0x12')]='Team';break;case _0x5073('0x53'):case _0x5073('0x54'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x37');if(_0x4844e8){_0x937b7d[_0x5073('0x1b')]=[{'name':_0x5073('0x35')},{'name':_0x5073('0x3a')}];}break;case _0x5073('0x55'):case _0x5073('0x56'):case _0x5073('0x57'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x31');if(_0x4844e8){_0x937b7d[_0x5073('0x1b')]=[{'name':_0x5073('0x58'),'filter':{'field':_0x5073('0x33'),'value':[_0x5073('0x59'),'user']},'ignore':!![]},{'name':'Agents'},{'name':_0x5073('0x5a')}];}break;case _0x5073('0x5b'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x5c');break;case _0x5073('0x5d'):_0x937b7d['childModel']='SalesforceAccount';break;case'freshdeskaccounts':_0x937b7d[_0x5073('0x12')]='FreshdeskAccount';break;case _0x5073('0x5e'):_0x937b7d['childModel']='SugarcrmAccount';break;case _0x5073('0x5f'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x60');break;case _0x5073('0x61'):_0x937b7d[_0x5073('0x12')]='ZohoAccount';break;case _0x5073('0x62'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x31');break;case'cannedanswers':_0x937b7d[_0x5073('0x12')]=_0x5073('0x63');break;case _0x5073('0x64'):_0x937b7d[_0x5073('0x12')]='Disposition';break;case _0x5073('0x65'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x66');break;case _0x5073('0x67'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x68');break;case'pauses':_0x937b7d[_0x5073('0x12')]='Pause';break;case _0x5073('0x69'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x6a');break;case _0x5073('0x6b'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x6c');break;case _0x5073('0x6d'):_0x937b7d['childModel']=_0x5073('0x6e');break;case'templates':_0x937b7d[_0x5073('0x12')]=_0x5073('0x6f');break;case'triggers':_0x937b7d[_0x5073('0x12')]=_0x5073('0x70');break;case'trunks':_0x937b7d[_0x5073('0x12')]='Trunk';break;case _0x5073('0x71'):_0x937b7d['childModel']='Variable';break;case'plugins':_0x937b7d[_0x5073('0x12')]='Plugin';break;case _0x5073('0x72'):_0x937b7d[_0x5073('0x12')]=_0x5073('0xf');_0x937b7d['parentSections']=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0x5073('0x73'):_0x937b7d[_0x5073('0x12')]=_0x5073('0x74');break;}return _0x937b7d;}function _0x5a096e(_0x433d45,_0x4ceb67){var _0x617795=_0x433d45[_0x5073('0x75')](0x0)[_0x5073('0x76')]()+_0x433d45[_0x5073('0x77')](0x1);var _0x1c1836={'type':_0x4ee954[_0x5073('0x78')][_0x5073('0x79')][_0x5073('0x7a')],'raw':!![]};return new Promise(function(_0x15fcdf,_0x3f816b){var _0x2db0c4=squel['select']()[_0x5073('0x6')](_0x5073('0x7b')+_0x617795+_0x5073('0x7c'),'id')['field'](_0x5073('0x7d'))[_0x5073('0x7e')](_0x5073('0x7f')+_0x433d45+_0x5073('0x80'),'ui')[_0x5073('0x81')](_0x5073('0x82'),_0x4ceb67['id']);return _0x4ee954['sequelize'][_0x5073('0x83')](_0x2db0c4[_0x5073('0x84')](),_0x1c1836)[_0x5073('0x9')](function(_0x587fbe){_0x4ceb67[_0x617795+_0x5073('0x85')]=_0x587fbe;_0x15fcdf(_0x587fbe);})['catch'](function(_0x49bb5d){_0x3f816b(_0x49bb5d);});});}return _0x7ec072[_0x5073('0x86')](_0x5073('0x87'),attributes,{'tableName':_0x5073('0x88'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x5b16f9){var _0x41381a={'raw':_0x5b16f9['query'][_0x5073('0x89')],'where':{}};var _0x3e6d9f={};var _0x3a6d09={'count':0x0,'rows':[]};var _0x14d07e=_0x5b16f9['query'][_0x5073('0x8a')];var _0x3a4de1=_0x5b16f9[_0x5073('0x83')][_0x5073('0x8b')]||![];var _0x43a411=_0x1d361b(_0x14d07e,_0x3a4de1);if(!_0x43a411[_0x5073('0x12')])throw new Error(_0x5073('0x8c')+_0x14d07e+'\x27');var _0x52a76a=[{'name':_0x14d07e}];if(!_[_0x5073('0x8d')](_0x43a411[_0x5073('0x1b')]))_0x52a76a=_0x43a411[_0x5073('0x1b')];var _0x12a704=[];for(var _0x21529a=0x0;_0x21529a<_0x52a76a[_0x5073('0x8e')];_0x21529a++){_0x12a704['push'](_0x4ee954['UserProfileSection'][_0x5073('0x8f')]({'where':{'userProfileId':_0x5b16f9['params']['id'],'name':_0x52a76a[_0x21529a][_0x5073('0x18')]},'raw':!![]}));}return Promise[_0x5073('0x90')](_0x12a704)[_0x5073('0x9')](function(_0x578d69){var _0x2c9c24=_[_0x5073('0x5')](_0x578d69,function(_0x1a6c8b){return _0x1a6c8b?_0x1a6c8b:undefined;});var _0x20ff06=_['filter'](_0x52a76a,['ignore',!![]]);var _0x297d9d=_[_0x5073('0x8d')](_0x2c9c24)&&_['isEmpty'](_0x20ff06)?null:_[_0x5073('0x91')](_0x20ff06,_0x2c9c24);if(!_0x297d9d)return null;var _0x4915f8=[];for(var _0x5471cc=0x0;_0x5471cc<_0x297d9d[_0x5073('0x8e')];_0x5471cc++){var _0x2c85b6=_[_0x5073('0x8f')](_0x52a76a,function(_0x2b4140){return _0x297d9d[_0x5471cc]?_0x2b4140['name']===_0x297d9d[_0x5471cc][_0x5073('0x18')]:null;});if(_0x2c85b6){if(_0x297d9d[_0x5471cc][_0x5073('0x92')]){_0x4915f8['push'](_0x2be9c3(_0x43a411[_0x5073('0x12')],_0x297d9d[_0x5471cc]));}else{if(!_0x297d9d[_0x5471cc][_0x5073('0x93')]){_0x4915f8[_0x5073('0x94')](_0x578b97(_0x2c85b6,_0x297d9d[_0x5471cc],_0x43a411[_0x5073('0x12')]));}else{if(_0x2c85b6['model']){_0x4915f8[_0x5073('0x94')](_0x4a3ceb(_0x2c85b6,_0x297d9d[_0x5471cc]));}}}}}return Promise[_0x5073('0x90')](_0x4915f8);})[_0x5073('0x9')](function(_0x17a77e){var _0x59ef15=_0x17a77e;var _0x343bd1=null;if(_0x59ef15){_0x343bd1=_0x59ef15['length']===0x1?_0x59ef15[0x0]:null;}if(!_0x343bd1&&!_0x59ef15)return _0x3a6d09;var _0x4f6194=_0x4ee954[_0x43a411[_0x5073('0x12')]]['rawAttributes'];_0x3e6d9f['model']=_[_0x5073('0x95')](_0x4f6194);_0x3e6d9f[_0x5073('0x83')]=_[_0x5073('0x95')](_0x5b16f9[_0x5073('0x83')]);_0x3e6d9f['filters']=_['intersection'](_0x3e6d9f['model'],_0x3e6d9f[_0x5073('0x83')]);_0x41381a['attributes']=_[_0x5073('0x96')](_0x3e6d9f['model'],qs[_0x5073('0x97')](_0x5b16f9[_0x5073('0x83')][_0x5073('0x97')]));_0x41381a[_0x5073('0x98')]=_0x41381a['attributes'][_0x5073('0x8e')]?_0x41381a[_0x5073('0x98')]:_0x3e6d9f[_0x5073('0x99')];if(!_0x5b16f9[_0x5073('0x83')][_0x5073('0x9a')]('nolimit')){_0x41381a[_0x5073('0x9b')]=qs[_0x5073('0x9b')](_0x5b16f9['query'][_0x5073('0x9b')]);_0x41381a[_0x5073('0x9c')]=qs['offset'](_0x5b16f9[_0x5073('0x83')][_0x5073('0x9c')]);}_0x41381a['order']=qs[_0x5073('0x9d')](_0x5b16f9[_0x5073('0x83')]['sort']);_0x41381a['where']=qs[_0x5073('0x9e')](_[_0x5073('0x9f')](_0x5b16f9[_0x5073('0x83')],_0x3e6d9f['filters']));if(_0x5b16f9['query'][_0x5073('0x5')]){_0x41381a[_0x5073('0x81')]=_['merge'](_0x41381a[_0x5073('0x81')],{'$or':_['map'](_0x4f6194,function(_0x106262){if(_0x106262[_0x5073('0x38')][_0x5073('0xa0')]!==_0x5073('0xa1')){var _0x215f14={};_0x215f14[_0x106262[_0x5073('0x6')]]={'$like':'%'+_0x5b16f9[_0x5073('0x83')]['filter']+'%'};return _0x215f14;}})});}var _0x4451f5=[];var _0x9c5a47=null;var _0x16395d={};if(_0x343bd1){_0x9c5a47=_['find'](_0x52a76a,['name',_0x343bd1[_0x5073('0x18')]]);if(_0x9c5a47[_0x5073('0x6')]){_0x16395d={};if(_0x43a411[_0x5073('0x12')]===_0x5073('0xf')){_0x16395d[_0x9c5a47['foreignKey']]=_[_0x5073('0xb')](_0x343bd1[_0x5073('0xa')],'id');}else{_0x16395d[_0x9c5a47['foreignKey']]=_0x343bd1[_0x5073('0xa')];}_0x4451f5[_0x5073('0x94')](_0x16395d);}else{_0x41381a[_0x5073('0x81')]['id']=_0x343bd1[_0x5073('0xa')];}}else{for(var _0x115134=0x0;_0x115134<_0x59ef15['length'];_0x115134++){_0x9c5a47=_['find'](_0x52a76a,[_0x5073('0x18'),_0x59ef15[_0x115134][_0x5073('0x18')]]);if(_0x9c5a47[_0x5073('0x6')]){_0x16395d={};_0x16395d[_0x9c5a47[_0x5073('0xa2')]]=_0x59ef15[_0x115134][_0x5073('0xa')];_0x4451f5[_0x5073('0x94')](_0x16395d);}else{if(!_0x41381a[_0x5073('0x81')]['id'])_0x41381a[_0x5073('0x81')]['id']=[];_0x59ef15[_0x115134][_0x5073('0xa')][_0x5073('0xa3')](function(_0x3b3b19){_0x41381a[_0x5073('0x81')]['id']['push'](_0x3b3b19);});}}}if(!_[_0x5073('0x8d')](_0x4451f5)){_0x41381a['where']=_['merge'](_0x41381a[_0x5073('0x81')],{'$and':{'$or':_0x4451f5}});}_0x41381a=_[_0x5073('0xa4')]({},_0x41381a,_0x5b16f9['options']);if(_0x343bd1&&!_0x343bd1['autoAssociation']&&_0x43a411[_0x5073('0x12')]==='AnalyticExtractedReport'){if(_0x5b16f9[_0x5073('0x83')][_0x5073('0xa5')]){_0x41381a['include']=[{'all':!![]}];}return _0x4ee954[_0x43a411[_0x5073('0x12')]][_0x5073('0x8')](_0x41381a)[_0x5073('0x9')](function(_0x2322d0){var _0x363389=[];_0x2322d0[_0x5073('0xa3')](function(_0x35a728){var _0x2f0944;switch(_0x35a728[_0x5073('0xa6')]){case _0x5073('0xa7'):_0x2f0944=_['find'](_0x343bd1['associatedResources'],function(_0x326d22){return _0x326d22['id']===_0x35a728['reportId']&&_0x326d22['type']===_0x5073('0xa8');});break;case _0x5073('0xa9'):_0x2f0944=_[_0x5073('0x8f')](_0x343bd1[_0x5073('0xa')],function(_0x53969b){return _0x53969b['id']===_0x35a728[_0x5073('0xaa')]&&_0x53969b[_0x5073('0x38')]===_0x5073('0xab');});break;}if(_0x2f0944)_0x363389[_0x5073('0x94')](_0x35a728);});_0x3a6d09[_0x5073('0xac')]=_0x363389['length'];_0x3a6d09['rows']=_0x363389;return _0x3a6d09;});}else{if(!_['isEmpty'](_0x5b16f9[_0x5073('0x83')][_0x5073('0xad')])){_0x41381a['where']['id']=_0x41381a[_0x5073('0x81')]['id']?_['intersection'](_0x41381a[_0x5073('0x81')]['id'],_0x5b16f9['query'][_0x5073('0xad')]):_0x5b16f9[_0x5073('0x83')][_0x5073('0xad')];if(_0x5b16f9['query'][_0x5073('0xae')]){_0x41381a['order']=_0x5b16f9['query'][_0x5073('0xae')];}}if(_0x5b16f9[_0x5073('0x83')]['extraQueryConditions']){_0x41381a[_0x5073('0x81')]=_[_0x5073('0xa4')](_0x41381a[_0x5073('0x81')],{'$and':_0x5b16f9[_0x5073('0x83')]['extraQueryConditions']});}return _0x4ee954[_0x43a411[_0x5073('0x12')]][_0x5073('0xac')]({'where':_0x41381a[_0x5073('0x81')]})[_0x5073('0x9')](function(_0x3a3b43){_0x3a6d09[_0x5073('0xac')]=_0x3a3b43;if(_0x5b16f9[_0x5073('0x83')][_0x5073('0xa5')]){if(_0x43a411[_0x5073('0x12')]==='CmContact'){_0x41381a[_0x5073('0xaf')]=[{'model':_0x4ee954[_0x5073('0x6e')],'as':_0x5073('0xb0'),'attributes':['id',_0x5073('0x18'),_0x5073('0xb1')],'required':_0x5b16f9[_0x5073('0x83')][_0x5073('0xb2')]?!![]:![]},{'model':_0x4ee954[_0x5073('0x6e')],'as':_0x5073('0xb3'),'attributes':['id',_0x5073('0x18'),'color'],'through':_0x5b16f9[_0x5073('0x83')][_0x5073('0xb2')]?{'attributes':[],'where':{'TagId':_0x5b16f9[_0x5073('0x83')]['tag']||undefined}}:{},'required':_0x5b16f9['query']['tag']?!![]:![]}];}else{_0x41381a[_0x5073('0xaf')]=[{'all':!![]}];}}return _0x4ee954[_0x43a411[_0x5073('0x12')]][_0x5073('0x8')](_0x41381a);})[_0x5073('0x9')](function(_0x29dbb6){_0x3a6d09['rows']=_0x29dbb6;if(_0x14d07e===_0x5073('0xb4')&&_0x5b16f9[_0x5073('0x83')]['openTabs']==='true'){var _0x347046=[];for(var _0x1b07d5=0x0;_0x1b07d5<_0x3a6d09[_0x5073('0xb5')][_0x5073('0x8e')];_0x1b07d5++){_0x347046[_0x5073('0x94')](_0x5a096e('chat',_0x3a6d09[_0x5073('0xb5')][_0x1b07d5][_0x5073('0xb6')]));_0x347046[_0x5073('0x94')](_0x5a096e(_0x5073('0xb7'),_0x3a6d09[_0x5073('0xb5')][_0x1b07d5][_0x5073('0xb6')]));_0x347046['push'](_0x5a096e('fax',_0x3a6d09['rows'][_0x1b07d5][_0x5073('0xb6')]));_0x347046[_0x5073('0x94')](_0x5a096e(_0x5073('0xb8'),_0x3a6d09[_0x5073('0xb5')][_0x1b07d5][_0x5073('0xb6')]));_0x347046[_0x5073('0x94')](_0x5a096e('openchannel',_0x3a6d09[_0x5073('0xb5')][_0x1b07d5]['dataValues']));_0x347046[_0x5073('0x94')](_0x5a096e('whatsapp',_0x3a6d09[_0x5073('0xb5')][_0x1b07d5]['dataValues']));}return Promise[_0x5073('0x90')](_0x347046)[_0x5073('0x9')](function(){return _0x3a6d09;});}return _0x3a6d09;});}});}}});}; \ No newline at end of file +var _0xd035=['Tag','triggers','Trigger','trunks','Trunk','Variable','plugins','Plugin','extractedreports','reportId','metrics','AnalyticMetric','charAt','slice','Sequelize','QueryTypes','SELECT','select','ui.','ui.createdAt','from','user_has_','_interactions','where','sequelize','query','toString','OpenTabs','define','user_profiles','raw','section','mergeResources','isEmpty','length','push','UserProfileSection','find','all','ignore','union','autoAssociation','rawAttributes','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','pick','AnalyticExtractedReport','foreignKey','merge','options','forEach','reportType','default','DefaultReports','custom','CustomReports','count','customSorting','extraQueryConditions','includeAll','include','Tags','color','tag','ThroughTags','rows','openTabs','true','chat','dataValues','sms','openchannel','whatsapp','lodash','./userProfile.attributes','squel','exports','models','filter','field','value','findAll','then','associatedResources','catch','model','map','name','resourceId','type','toLowerCase','squareprojects','childModel','SquareProject','odbc','SquareOdbc','squarerecordings','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','ListId','lists','CmList','companies','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','Agents','User','role','agent','Telephones','membername','telephone','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','smsqueues','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','Team','queuecampaigns','VoiceQueues','users','agents','telephones','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','DeskAccount','zohoaccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','Pause','scheduler','sounds','Sound','tags'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd035,0x115));var _0x5d03=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xd035[_0x2283dc];return _0x16db90;};'use strict';var _=require(_0x5d03('0x0'));var attributes=require(_0x5d03('0x1'));var qs=require('../../components/parsers/qs');var squel=require(_0x5d03('0x2'));module[_0x5d03('0x3')]=function(_0x1fa396){var _0x2815c0=_0x1fa396[_0x5d03('0x4')];function _0x26a1cc(_0x4de0fe,_0x69dea){return new Promise(function(_0x3344e9,_0x26fd6c){if(!_0x69dea)return _0x3344e9(null);var _0x4a901b=_0x69dea[_0x5d03('0x5')]?{[_0x69dea[_0x5d03('0x5')][_0x5d03('0x6')]]:_0x69dea[_0x5d03('0x5')][_0x5d03('0x7')]}:undefined;return _0x2815c0[_0x4de0fe][_0x5d03('0x8')]({'where':_0x4a901b,'raw':!![]})[_0x5d03('0x9')](function(_0x462dad){_0x69dea[_0x5d03('0xa')]=_['map'](_0x462dad,'id');_0x3344e9(_0x69dea);})[_0x5d03('0xb')](function(_0x2c9d6c){_0x26fd6c(_0x2c9d6c);});});}function _0x473bbd(_0x386333,_0x2d20ec){return new Promise(function(_0x268417,_0x1cafad){var _0x4d3cf2=_0x386333[_0x5d03('0x5')]?{[_0x386333[_0x5d03('0x5')][_0x5d03('0x6')]]:_0x386333['filter']['value']}:undefined;return _0x2815c0[_0x386333[_0x5d03('0xc')]][_0x5d03('0x8')]({'where':_0x4d3cf2,'raw':!![]})[_0x5d03('0x9')](function(_0x2c4a86){_0x2d20ec['associatedResources']=_[_0x5d03('0xd')](_0x2c4a86,function(_0x1361a1){return _0x1361a1[_0x5d03('0xe')];});_0x268417(_0x2d20ec);})[_0x5d03('0xb')](function(_0x2e098f){_0x1cafad(_0x2e098f);});});}function _0x3eb724(_0x14f86e,_0x5c3e3b,_0x58124f){if(!_0x5c3e3b)return Promise['resolve'](null);return new Promise(function(_0x2b35a1,_0x2e025c){return _0x2815c0['UserProfileResource'][_0x5d03('0x8')]({'where':{'sectionId':_0x5c3e3b['id']},'raw':!![]})['then'](function(_0x496492){if(_0x14f86e[_0x5d03('0x6')]&&_0x14f86e[_0x5d03('0x6')]!=='id'){_0x5c3e3b[_0x5d03('0xa')]=_['map'](_0x496492,function(_0x161eff){return _0x161eff[_0x14f86e[_0x5d03('0x6')]];});}else{if(_0x58124f==='AnalyticExtractedReport'){_0x5c3e3b[_0x5d03('0xa')]=_[_0x5d03('0xd')](_0x496492,function(_0x232129){return{'id':_0x232129[_0x5d03('0xf')],'type':_0x232129[_0x5d03('0x10')]};});}else{_0x5c3e3b[_0x5d03('0xa')]=_[_0x5d03('0xd')](_0x496492,function(_0x4bc9f5){return _0x4bc9f5['resourceId'];});}}_0x2b35a1(_0x5c3e3b);})[_0x5d03('0xb')](function(_0x1c7be1){_0x2e025c(_0x1c7be1);});});}function _0x9c73a1(_0x5137a3,_0x2fab9a){var _0x416f63={'parentSections':[]};switch(_0x5137a3[_0x5d03('0x11')]()){case _0x5d03('0x12'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x14');break;case _0x5d03('0x15'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x16');break;case _0x5d03('0x17'):_0x416f63[_0x5d03('0x13')]='SquareRecording';_0x416f63[_0x5d03('0x18')]=[{'name':_0x5d03('0x19'),'field':_0x5d03('0xe'),'foreignKey':_0x5d03('0x1a')}];break;case _0x5d03('0x1b'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x1c');break;case _0x5d03('0x1d'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x1e');_0x416f63[_0x5d03('0x18')]=[{'name':'Lists','field':'id','foreignKey':_0x5d03('0x1f')}];break;case _0x5d03('0x20'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x21');break;case _0x5d03('0x22'):_0x416f63[_0x5d03('0x13')]='CmCompany';break;case _0x5d03('0x23'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x24');break;case _0x5d03('0x25'):_0x416f63['childModel']=_0x5d03('0x26');break;case _0x5d03('0x27'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x28');break;case _0x5d03('0x29'):_0x416f63['childModel']=_0x5d03('0x2a');break;case'faxaccounts':_0x416f63[_0x5d03('0x13')]=_0x5d03('0x2b');break;case _0x5d03('0x2c'):case _0x5d03('0x2d'):case _0x5d03('0x2e'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x2f');break;case _0x5d03('0x30'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x31');break;case _0x5d03('0x32'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x33');break;case _0x5d03('0x34'):_0x416f63[_0x5d03('0x13')]='VoiceRecording';_0x416f63['parentSections']=[{'name':_0x5d03('0x35'),'field':_0x5d03('0xe'),'foreignKey':'membername','model':_0x5d03('0x36'),'filter':{'field':_0x5d03('0x37'),'value':[_0x5d03('0x38')]}},{'name':_0x5d03('0x39'),'field':_0x5d03('0xe'),'foreignKey':_0x5d03('0x3a'),'model':_0x5d03('0x36'),'filter':{'field':_0x5d03('0x37'),'value':[_0x5d03('0x3b')]}},{'name':'VoiceQueues','field':'name','foreignKey':_0x5d03('0x3c'),'model':_0x5d03('0x3d'),'filter':{'field':_0x5d03('0x10'),'value':[_0x5d03('0x3e')]}},{'name':_0x5d03('0x3f'),'field':'name','foreignKey':_0x5d03('0x3c'),'model':'VoiceQueue','filter':{'field':_0x5d03('0x10'),'value':[_0x5d03('0x40')]}}];break;case'musiconholds':_0x416f63[_0x5d03('0x13')]=_0x5d03('0x41');break;case _0x5d03('0x42'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x43');break;case _0x5d03('0x44'):_0x416f63['childModel']=_0x5d03('0x45');break;case _0x5d03('0x46'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x47');break;case _0x5d03('0x48'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x49');break;case _0x5d03('0x4a'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x4b');break;case _0x5d03('0x4c'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x4d');break;case _0x5d03('0x4e'):_0x416f63[_0x5d03('0x13')]='OpenchannelQueue';break;case'openchannelaccounts':_0x416f63[_0x5d03('0x13')]='OpenchannelAccount';break;case _0x5d03('0x4f'):_0x416f63[_0x5d03('0x13')]='SmsQueue';break;case _0x5d03('0x50'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x51');break;case _0x5d03('0x52'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x53');break;case _0x5d03('0x54'):_0x416f63['childModel']=_0x5d03('0x55');break;case'teams':_0x416f63[_0x5d03('0x13')]=_0x5d03('0x56');break;case'voicequeues':case _0x5d03('0x57'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x3d');if(_0x2fab9a){_0x416f63['parentSections']=[{'name':_0x5d03('0x58')},{'name':_0x5d03('0x3f')}];}break;case _0x5d03('0x59'):case _0x5d03('0x5a'):case _0x5d03('0x5b'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x36');if(_0x2fab9a){_0x416f63['parentSections']=[{'name':_0x5d03('0x5c'),'filter':{'field':'role','value':[_0x5d03('0x5d'),'user']},'ignore':!![]},{'name':_0x5d03('0x35')},{'name':_0x5d03('0x39')}];}break;case _0x5d03('0x5e'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x5f');break;case _0x5d03('0x60'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x61');break;case _0x5d03('0x62'):_0x416f63[_0x5d03('0x13')]='FreshdeskAccount';break;case _0x5d03('0x63'):_0x416f63['childModel']=_0x5d03('0x64');break;case'deskaccounts':_0x416f63['childModel']=_0x5d03('0x65');break;case _0x5d03('0x66'):_0x416f63[_0x5d03('0x13')]='ZohoAccount';break;case'vtigeraccounts':_0x416f63[_0x5d03('0x13')]=_0x5d03('0x36');break;case _0x5d03('0x67'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x68');break;case'dispositions':_0x416f63[_0x5d03('0x13')]=_0x5d03('0x69');break;case _0x5d03('0x6a'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x6b');break;case'intervals':_0x416f63[_0x5d03('0x13')]='Interval';break;case'pauses':_0x416f63[_0x5d03('0x13')]=_0x5d03('0x6c');break;case _0x5d03('0x6d'):_0x416f63[_0x5d03('0x13')]='Schedule';break;case _0x5d03('0x6e'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x6f');break;case _0x5d03('0x70'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x71');break;case'templates':_0x416f63['childModel']='Template';break;case _0x5d03('0x72'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x73');break;case _0x5d03('0x74'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x75');break;case'variables':_0x416f63['childModel']=_0x5d03('0x76');break;case _0x5d03('0x77'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x78');break;case _0x5d03('0x79'):_0x416f63['childModel']='AnalyticExtractedReport';_0x416f63[_0x5d03('0x18')]=[{'name':'Reports','field':'id','foreignKey':_0x5d03('0x7a')}];break;case _0x5d03('0x7b'):_0x416f63[_0x5d03('0x13')]=_0x5d03('0x7c');break;}return _0x416f63;}function _0x2d8b44(_0x341e36,_0x1fd469){var _0x591338=_0x341e36[_0x5d03('0x7d')](0x0)['toUpperCase']()+_0x341e36[_0x5d03('0x7e')](0x1);var _0x290823={'type':_0x2815c0[_0x5d03('0x7f')][_0x5d03('0x80')][_0x5d03('0x81')],'raw':!![]};return new Promise(function(_0x134cfe,_0x5d2baa){var _0xe99c6f=squel[_0x5d03('0x82')]()[_0x5d03('0x6')](_0x5d03('0x83')+_0x591338+'InteractionId','id')['field'](_0x5d03('0x84'))[_0x5d03('0x85')](_0x5d03('0x86')+_0x341e36+_0x5d03('0x87'),'ui')[_0x5d03('0x88')]('ui.UserId\x20=\x20?',_0x1fd469['id']);return _0x2815c0[_0x5d03('0x89')][_0x5d03('0x8a')](_0xe99c6f[_0x5d03('0x8b')](),_0x290823)['then'](function(_0x4c3dd5){_0x1fd469[_0x591338+_0x5d03('0x8c')]=_0x4c3dd5;_0x134cfe(_0x4c3dd5);})[_0x5d03('0xb')](function(_0x138105){_0x5d2baa(_0x138105);});});}return _0x1fa396[_0x5d03('0x8d')]('UserProfile',attributes,{'tableName':_0x5d03('0x8e'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2f3d04){var _0x1e6443={'raw':_0x2f3d04[_0x5d03('0x8a')][_0x5d03('0x8f')],'where':{}};var _0x564626={};var _0x1cc037={'count':0x0,'rows':[]};var _0x4b617b=_0x2f3d04['query'][_0x5d03('0x90')];var _0x8cafff=_0x2f3d04['query'][_0x5d03('0x91')]||![];var _0x150716=_0x9c73a1(_0x4b617b,_0x8cafff);if(!_0x150716['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x4b617b+'\x27');var _0x2cb690=[{'name':_0x4b617b}];if(!_[_0x5d03('0x92')](_0x150716[_0x5d03('0x18')]))_0x2cb690=_0x150716[_0x5d03('0x18')];var _0x5deffd=[];for(var _0x35901c=0x0;_0x35901c<_0x2cb690[_0x5d03('0x93')];_0x35901c++){_0x5deffd[_0x5d03('0x94')](_0x2815c0[_0x5d03('0x95')][_0x5d03('0x96')]({'where':{'userProfileId':_0x2f3d04['params']['id'],'name':_0x2cb690[_0x35901c]['name']},'raw':!![]}));}return Promise[_0x5d03('0x97')](_0x5deffd)[_0x5d03('0x9')](function(_0x1421aa){var _0x16d8c8=_[_0x5d03('0x5')](_0x1421aa,function(_0xc021cb){return _0xc021cb?_0xc021cb:undefined;});var _0x588ee7=_[_0x5d03('0x5')](_0x2cb690,[_0x5d03('0x98'),!![]]);var _0x23915c=_[_0x5d03('0x92')](_0x16d8c8)&&_[_0x5d03('0x92')](_0x588ee7)?null:_[_0x5d03('0x99')](_0x588ee7,_0x16d8c8);if(!_0x23915c)return null;var _0xc83973=[];for(var _0x50e60b=0x0;_0x50e60b<_0x23915c[_0x5d03('0x93')];_0x50e60b++){var _0x6f1554=_[_0x5d03('0x96')](_0x2cb690,function(_0x301bb4){return _0x23915c[_0x50e60b]?_0x301bb4['name']===_0x23915c[_0x50e60b][_0x5d03('0xe')]:null;});if(_0x6f1554){if(_0x23915c[_0x50e60b][_0x5d03('0x98')]){_0xc83973[_0x5d03('0x94')](_0x26a1cc(_0x150716[_0x5d03('0x13')],_0x23915c[_0x50e60b]));}else{if(!_0x23915c[_0x50e60b][_0x5d03('0x9a')]){_0xc83973[_0x5d03('0x94')](_0x3eb724(_0x6f1554,_0x23915c[_0x50e60b],_0x150716[_0x5d03('0x13')]));}else{if(_0x6f1554['model']){_0xc83973['push'](_0x473bbd(_0x6f1554,_0x23915c[_0x50e60b]));}}}}}return Promise[_0x5d03('0x97')](_0xc83973);})[_0x5d03('0x9')](function(_0x1f2780){var _0x3266f4=_0x1f2780;var _0x379778=null;if(_0x3266f4){_0x379778=_0x3266f4[_0x5d03('0x93')]===0x1?_0x3266f4[0x0]:null;}if(!_0x379778&&!_0x3266f4)return _0x1cc037;var _0x1fee4c=_0x2815c0[_0x150716[_0x5d03('0x13')]][_0x5d03('0x9b')];_0x564626[_0x5d03('0xc')]=_[_0x5d03('0x9c')](_0x1fee4c);_0x564626['query']=_[_0x5d03('0x9c')](_0x2f3d04['query']);_0x564626[_0x5d03('0x9d')]=_[_0x5d03('0x9e')](_0x564626[_0x5d03('0xc')],_0x564626[_0x5d03('0x8a')]);_0x1e6443[_0x5d03('0x9f')]=_[_0x5d03('0x9e')](_0x564626[_0x5d03('0xc')],qs['fields'](_0x2f3d04[_0x5d03('0x8a')][_0x5d03('0xa0')]));_0x1e6443[_0x5d03('0x9f')]=_0x1e6443['attributes'][_0x5d03('0x93')]?_0x1e6443[_0x5d03('0x9f')]:_0x564626[_0x5d03('0xc')];if(!_0x2f3d04[_0x5d03('0x8a')][_0x5d03('0xa1')](_0x5d03('0xa2'))){_0x1e6443[_0x5d03('0xa3')]=qs[_0x5d03('0xa3')](_0x2f3d04[_0x5d03('0x8a')][_0x5d03('0xa3')]);_0x1e6443[_0x5d03('0xa4')]=qs['offset'](_0x2f3d04[_0x5d03('0x8a')][_0x5d03('0xa4')]);}_0x1e6443[_0x5d03('0xa5')]=qs[_0x5d03('0xa6')](_0x2f3d04[_0x5d03('0x8a')][_0x5d03('0xa6')]);_0x1e6443['where']=qs[_0x5d03('0x9d')](_[_0x5d03('0xa7')](_0x2f3d04['query'],_0x564626[_0x5d03('0x9d')]));if(_0x2f3d04[_0x5d03('0x8a')][_0x5d03('0x5')]){_0x1e6443[_0x5d03('0x88')]=_['merge'](_0x1e6443[_0x5d03('0x88')],{'$or':_[_0x5d03('0xd')](_0x1fee4c,function(_0x579b9d){if(_0x579b9d[_0x5d03('0x10')]['key']!=='VIRTUAL'){var _0x54f647={};_0x54f647[_0x579b9d[_0x5d03('0x6')]]={'$like':'%'+_0x2f3d04[_0x5d03('0x8a')][_0x5d03('0x5')]+'%'};return _0x54f647;}})});}var _0x6d98c2=[];var _0x34a679=null;var _0x49b547={};if(_0x379778){_0x34a679=_[_0x5d03('0x96')](_0x2cb690,[_0x5d03('0xe'),_0x379778['name']]);if(_0x34a679['field']){_0x49b547={};if(_0x150716[_0x5d03('0x13')]===_0x5d03('0xa8')){_0x49b547[_0x34a679[_0x5d03('0xa9')]]=_[_0x5d03('0xd')](_0x379778[_0x5d03('0xa')],'id');}else{_0x49b547[_0x34a679[_0x5d03('0xa9')]]=_0x379778[_0x5d03('0xa')];}_0x6d98c2[_0x5d03('0x94')](_0x49b547);}else{_0x1e6443[_0x5d03('0x88')]['id']=_0x379778[_0x5d03('0xa')];}}else{for(var _0x47934c=0x0;_0x47934c<_0x3266f4['length'];_0x47934c++){_0x34a679=_[_0x5d03('0x96')](_0x2cb690,[_0x5d03('0xe'),_0x3266f4[_0x47934c][_0x5d03('0xe')]]);if(_0x34a679['field']){_0x49b547={};_0x49b547[_0x34a679['foreignKey']]=_0x3266f4[_0x47934c][_0x5d03('0xa')];_0x6d98c2[_0x5d03('0x94')](_0x49b547);}else{if(!_0x1e6443[_0x5d03('0x88')]['id'])_0x1e6443[_0x5d03('0x88')]['id']=[];_0x3266f4[_0x47934c][_0x5d03('0xa')]['forEach'](function(_0x1c1c43){_0x1e6443[_0x5d03('0x88')]['id'][_0x5d03('0x94')](_0x1c1c43);});}}}if(!_['isEmpty'](_0x6d98c2)){_0x1e6443[_0x5d03('0x88')]=_[_0x5d03('0xaa')](_0x1e6443[_0x5d03('0x88')],{'$and':{'$or':_0x6d98c2}});}_0x1e6443=_[_0x5d03('0xaa')]({},_0x1e6443,_0x2f3d04[_0x5d03('0xab')]);if(_0x379778&&!_0x379778['autoAssociation']&&_0x150716[_0x5d03('0x13')]===_0x5d03('0xa8')){if(_0x2f3d04[_0x5d03('0x8a')]['includeAll']){_0x1e6443['include']=[{'all':!![]}];}return _0x2815c0[_0x150716[_0x5d03('0x13')]][_0x5d03('0x8')](_0x1e6443)[_0x5d03('0x9')](function(_0x365743){var _0x2c7a4e=[];_0x365743[_0x5d03('0xac')](function(_0x1cce4a){var _0x234ba0;switch(_0x1cce4a[_0x5d03('0xad')]){case _0x5d03('0xae'):_0x234ba0=_[_0x5d03('0x96')](_0x379778[_0x5d03('0xa')],function(_0xcb7179){return _0xcb7179['id']===_0x1cce4a[_0x5d03('0x7a')]&&_0xcb7179[_0x5d03('0x10')]===_0x5d03('0xaf');});break;case _0x5d03('0xb0'):_0x234ba0=_[_0x5d03('0x96')](_0x379778['associatedResources'],function(_0x583eb3){return _0x583eb3['id']===_0x1cce4a[_0x5d03('0x7a')]&&_0x583eb3[_0x5d03('0x10')]===_0x5d03('0xb1');});break;}if(_0x234ba0)_0x2c7a4e[_0x5d03('0x94')](_0x1cce4a);});_0x1cc037[_0x5d03('0xb2')]=_0x2c7a4e['length'];_0x1cc037['rows']=_0x2c7a4e;return _0x1cc037;});}else{if(!_[_0x5d03('0x92')](_0x2f3d04[_0x5d03('0x8a')]['ids'])){_0x1e6443['where']['id']=_0x1e6443[_0x5d03('0x88')]['id']?_[_0x5d03('0x9e')](_0x1e6443[_0x5d03('0x88')]['id'],_0x2f3d04['query']['ids']):_0x2f3d04['query']['ids'];if(_0x2f3d04['query'][_0x5d03('0xb3')]){_0x1e6443[_0x5d03('0xa5')]=_0x2f3d04['query'][_0x5d03('0xb3')];}}if(_0x2f3d04[_0x5d03('0x8a')][_0x5d03('0xb4')]){_0x1e6443['where']=_[_0x5d03('0xaa')](_0x1e6443[_0x5d03('0x88')],{'$and':_0x2f3d04[_0x5d03('0x8a')][_0x5d03('0xb4')]});}return _0x2815c0[_0x150716[_0x5d03('0x13')]][_0x5d03('0xb2')]({'where':_0x1e6443[_0x5d03('0x88')]})['then'](function(_0x5ba49c){_0x1cc037[_0x5d03('0xb2')]=_0x5ba49c;if(_0x2f3d04[_0x5d03('0x8a')][_0x5d03('0xb5')]){if(_0x150716[_0x5d03('0x13')]===_0x5d03('0x1e')){_0x1e6443[_0x5d03('0xb6')]=[{'model':_0x2815c0[_0x5d03('0x71')],'as':_0x5d03('0xb7'),'attributes':['id',_0x5d03('0xe'),_0x5d03('0xb8')],'required':_0x2f3d04[_0x5d03('0x8a')][_0x5d03('0xb9')]?!![]:![]},{'model':_0x2815c0[_0x5d03('0x71')],'as':_0x5d03('0xba'),'attributes':['id',_0x5d03('0xe'),_0x5d03('0xb8')],'through':_0x2f3d04[_0x5d03('0x8a')][_0x5d03('0xb9')]?{'attributes':[],'where':{'TagId':_0x2f3d04['query'][_0x5d03('0xb9')]||undefined}}:{},'required':_0x2f3d04[_0x5d03('0x8a')]['tag']?!![]:![]}];}else{_0x1e6443['include']=[{'all':!![]}];}}return _0x2815c0[_0x150716[_0x5d03('0x13')]]['findAll'](_0x1e6443);})[_0x5d03('0x9')](function(_0x1afb9f){_0x1cc037[_0x5d03('0xbb')]=_0x1afb9f;if(_0x4b617b===_0x5d03('0x35')&&_0x2f3d04[_0x5d03('0x8a')][_0x5d03('0xbc')]===_0x5d03('0xbd')){var _0xe974ba=[];for(var _0x2d2d22=0x0;_0x2d2d22<_0x1cc037[_0x5d03('0xbb')][_0x5d03('0x93')];_0x2d2d22++){_0xe974ba['push'](_0x2d8b44(_0x5d03('0xbe'),_0x1cc037[_0x5d03('0xbb')][_0x2d2d22][_0x5d03('0xbf')]));_0xe974ba[_0x5d03('0x94')](_0x2d8b44(_0x5d03('0xc0'),_0x1cc037['rows'][_0x2d2d22][_0x5d03('0xbf')]));_0xe974ba[_0x5d03('0x94')](_0x2d8b44('fax',_0x1cc037[_0x5d03('0xbb')][_0x2d2d22][_0x5d03('0xbf')]));_0xe974ba['push'](_0x2d8b44('mail',_0x1cc037[_0x5d03('0xbb')][_0x2d2d22][_0x5d03('0xbf')]));_0xe974ba[_0x5d03('0x94')](_0x2d8b44(_0x5d03('0xc1'),_0x1cc037[_0x5d03('0xbb')][_0x2d2d22][_0x5d03('0xbf')]));_0xe974ba[_0x5d03('0x94')](_0x2d8b44(_0x5d03('0xc2'),_0x1cc037[_0x5d03('0xbb')][_0x2d2d22][_0x5d03('0xbf')]));}return Promise[_0x5d03('0x97')](_0xe974ba)[_0x5d03('0x9')](function(){return _0x1cc037;});}return _0x1cc037;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 758da0a..d6a974b 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 _0x598a=['result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info'];(function(_0x934754,_0x15bd40){var _0x5cf1fc=function(_0x2c1de6){while(--_0x2c1de6){_0x934754['push'](_0x934754['shift']());}};_0x5cf1fc(++_0x15bd40);}(_0x598a,0xfb));var _0xa598=function(_0x57e9b5,_0x657a46){_0x57e9b5=_0x57e9b5-0x0;var _0x5eee02=_0x598a[_0x57e9b5];return _0x5eee02;};'use strict';var _=require(_0xa598('0x0'));var util=require(_0xa598('0x1'));var moment=require(_0xa598('0x2'));var BPromise=require(_0xa598('0x3'));var rs=require(_0xa598('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa598('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa598('0x6'));var jayson=require(_0xa598('0x7'));var client=jayson[_0xa598('0x8')][_0xa598('0x9')]({'port':0x232a});config[_0xa598('0xa')]=_['defaults'](config['redis'],{'host':_0xa598('0xb'),'port':0x18eb});var socket=require(_0xa598('0xc'))(new Redis(config[_0xa598('0xa')]));require(_0xa598('0xd'))[_0xa598('0xe')](socket);function respondWithRpcPromise(_0x387afc,_0x5207d5,_0x5871a3){return new BPromise(function(_0x3ea1e4,_0x3cb7b8){return client[_0xa598('0xf')](_0x387afc,_0x5871a3)[_0xa598('0x10')](function(_0xa1c53){logger['info'](_0xa598('0x11'),_0x5207d5,_0xa598('0x12'));logger[_0xa598('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x5207d5,_0xa598('0x12'),JSON['stringify'](_0xa1c53));if(_0xa1c53[_0xa598('0x14')]){if(_0xa1c53[_0xa598('0x14')][_0xa598('0x15')]===0x1f4){logger[_0xa598('0x14')](_0xa598('0x11'),_0x5207d5,_0xa1c53[_0xa598('0x14')][_0xa598('0x16')]);return _0x3cb7b8(_0xa1c53[_0xa598('0x14')][_0xa598('0x16')]);}logger['error'](_0xa598('0x11'),_0x5207d5,_0xa1c53[_0xa598('0x14')][_0xa598('0x16')]);return _0x3ea1e4(_0xa1c53[_0xa598('0x14')][_0xa598('0x16')]);}else{logger[_0xa598('0x17')](_0xa598('0x11'),_0x5207d5,_0xa598('0x12'));_0x3ea1e4(_0xa1c53[_0xa598('0x18')][_0xa598('0x16')]);}})['catch'](function(_0x1ed03f){logger[_0xa598('0x14')](_0xa598('0x11'),_0x5207d5,_0x1ed03f);_0x3cb7b8(_0x1ed03f);});});} \ No newline at end of file +var _0xf567=['http','redis','localhost','socket.io-emitter','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x22cb34,_0x116622){var _0x592d3c=function(_0x5f19a4){while(--_0x5f19a4){_0x22cb34['push'](_0x22cb34['shift']());}};_0x592d3c(++_0x116622);}(_0xf567,0x118));var _0x7f56=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xf567[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x7f56('0x0'));var util=require(_0x7f56('0x1'));var moment=require(_0x7f56('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f56('0x3'));var fs=require('fs');var Redis=require(_0x7f56('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f56('0x5'));var logger=require(_0x7f56('0x6'))(_0x7f56('0x7'));var config=require(_0x7f56('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7f56('0x9')][_0x7f56('0xa')]({'port':0x232a});config[_0x7f56('0xb')]=_['defaults'](config[_0x7f56('0xb')],{'host':_0x7f56('0xc'),'port':0x18eb});var socket=require(_0x7f56('0xd'))(new Redis(config[_0x7f56('0xb')]));require(_0x7f56('0xe'))[_0x7f56('0xf')](socket);function respondWithRpcPromise(_0xc757aa,_0x502a2b,_0xe41219){return new BPromise(function(_0xe00be5,_0x138bd2){return client[_0x7f56('0x10')](_0xc757aa,_0xe41219)[_0x7f56('0x11')](function(_0x2a10d9){logger[_0x7f56('0x12')](_0x7f56('0x13'),_0x502a2b,_0x7f56('0x14'));logger[_0x7f56('0x15')](_0x7f56('0x16'),_0x502a2b,_0x7f56('0x14'),JSON[_0x7f56('0x17')](_0x2a10d9));if(_0x2a10d9[_0x7f56('0x18')]){if(_0x2a10d9['error'][_0x7f56('0x19')]===0x1f4){logger[_0x7f56('0x18')](_0x7f56('0x13'),_0x502a2b,_0x2a10d9['error'][_0x7f56('0x1a')]);return _0x138bd2(_0x2a10d9[_0x7f56('0x18')]['message']);}logger[_0x7f56('0x18')](_0x7f56('0x13'),_0x502a2b,_0x2a10d9['error']['message']);return _0xe00be5(_0x2a10d9[_0x7f56('0x18')]['message']);}else{logger[_0x7f56('0x12')](_0x7f56('0x13'),_0x502a2b,'request\x20sent');_0xe00be5(_0x2a10d9[_0x7f56('0x1b')][_0x7f56('0x1a')]);}})[_0x7f56('0x1c')](function(_0x4aae03){logger[_0x7f56('0x18')](_0x7f56('0x13'),_0x502a2b,_0x4aae03);_0x138bd2(_0x4aae03);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 3ce064e..4a96052 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 _0x63f4=['update','emit','removeListener','length','userProfile:','./userProfile.events','save'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x63f4,0x9f));var _0x463f=function(_0x26e031,_0x8dd228){_0x26e031=_0x26e031-0x0;var _0x5c3cc7=_0x63f4[_0x26e031];return _0x5c3cc7;};'use strict';var UserProfileEvents=require(_0x463f('0x0'));var events=[_0x463f('0x1'),'remove',_0x463f('0x2')];function createListener(_0x4e2e71,_0x350a7f){return function(_0x1330d4){_0x350a7f[_0x463f('0x3')](_0x4e2e71,_0x1330d4);};}function removeListener(_0x1c357e,_0x14dc8e){return function(){UserProfileEvents[_0x463f('0x4')](_0x1c357e,_0x14dc8e);};}exports['register']=function(_0x4777fe){for(var _0x30375b=0x0,_0xcdf461=events[_0x463f('0x5')];_0x30375b<_0xcdf461;_0x30375b++){var _0x1b8b2c=events[_0x30375b];var _0x16d9ba=createListener(_0x463f('0x6')+_0x1b8b2c,_0x4777fe);UserProfileEvents['on'](_0x1b8b2c,_0x16d9ba);}}; \ No newline at end of file +var _0x1371=['userProfile:','./userProfile.events','save','remove','update','emit','removeListener','register'];(function(_0x26c66b,_0x1e8054){var _0x2d09cd=function(_0x2e271f){while(--_0x2e271f){_0x26c66b['push'](_0x26c66b['shift']());}};_0x2d09cd(++_0x1e8054);}(_0x1371,0x1c9));var _0x1137=function(_0x5b36f6,_0x17ff83){_0x5b36f6=_0x5b36f6-0x0;var _0x333c95=_0x1371[_0x5b36f6];return _0x333c95;};'use strict';var UserProfileEvents=require(_0x1137('0x0'));var events=[_0x1137('0x1'),_0x1137('0x2'),_0x1137('0x3')];function createListener(_0x5505b3,_0x48d471){return function(_0x37329f){_0x48d471[_0x1137('0x4')](_0x5505b3,_0x37329f);};}function removeListener(_0x2cb078,_0x1ce67b){return function(){UserProfileEvents[_0x1137('0x5')](_0x2cb078,_0x1ce67b);};}exports[_0x1137('0x6')]=function(_0x59e911){for(var _0x2ed449=0x0,_0x12879a=events['length'];_0x2ed449<_0x12879a;_0x2ed449++){var _0x176525=events[_0x2ed449];var _0x3b29d8=createListener(_0x1137('0x7')+_0x176525,_0x59e911);UserProfileEvents['on'](_0x176525,_0x3b29d8);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 3d3174c..c15bffe 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 _0xd812=['fs-extra','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','index','/describe','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','connect-timeout','express'];(function(_0x12a201,_0x30aaba){var _0x52a4d2=function(_0x5ca28d){while(--_0x5ca28d){_0x12a201['push'](_0x12a201['shift']());}};_0x52a4d2(++_0x30aaba);}(_0xd812,0x18d));var _0x2d81=function(_0x5db313,_0x3c8f0c){_0x5db313=_0x5db313-0x0;var _0x36d503=_0xd812[_0x5db313];return _0x36d503;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x2d81('0x0'));var express=require(_0x2d81('0x1'));var router=express['Router']();var fs_extra=require(_0x2d81('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x2d81('0x3'));var config=require(_0x2d81('0x4'));var controller=require(_0x2d81('0x5'));router[_0x2d81('0x6')]('/',auth['isAuthenticated'](),controller[_0x2d81('0x7')]);router[_0x2d81('0x6')](_0x2d81('0x8'),auth[_0x2d81('0x9')](),controller['describe']);router[_0x2d81('0x6')](_0x2d81('0xa'),auth[_0x2d81('0x9')](),controller[_0x2d81('0xb')]);router[_0x2d81('0xc')]('/',auth[_0x2d81('0x9')](),controller[_0x2d81('0xd')]);router[_0x2d81('0xe')](_0x2d81('0xa'),auth[_0x2d81('0x9')](),controller[_0x2d81('0xf')]);router[_0x2d81('0x10')](_0x2d81('0xa'),auth[_0x2d81('0x9')](),controller[_0x2d81('0x11')]);module[_0x2d81('0x12')]=router; \ No newline at end of file +var _0xa64a=['put','/:id','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','./userProfileResource.controller','get','isAuthenticated','index','/describe','show','create'];(function(_0x45eb8c,_0x281634){var _0x4dedc8=function(_0x43f82a){while(--_0x43f82a){_0x45eb8c['push'](_0x45eb8c['shift']());}};_0x4dedc8(++_0x281634);}(_0xa64a,0x1d0));var _0xaa64=function(_0x495ef8,_0x1d55fb){_0x495ef8=_0x495ef8-0x0;var _0x7ce43b=_0xa64a[_0x495ef8];return _0x7ce43b;};'use strict';var multer=require('multer');var util=require(_0xaa64('0x0'));var path=require(_0xaa64('0x1'));var timeout=require(_0xaa64('0x2'));var express=require(_0xaa64('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xaa64('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaa64('0x5'));router[_0xaa64('0x6')]('/',auth[_0xaa64('0x7')](),controller[_0xaa64('0x8')]);router['get'](_0xaa64('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xaa64('0x6')]('/:id',auth['isAuthenticated'](),controller[_0xaa64('0xa')]);router['post']('/',auth[_0xaa64('0x7')](),controller[_0xaa64('0xb')]);router[_0xaa64('0xc')](_0xaa64('0xd'),auth[_0xaa64('0x7')](),controller['update']);router[_0xaa64('0xe')](_0xaa64('0xd'),auth['isAuthenticated'](),controller[_0xaa64('0xf')]);module[_0xaa64('0x10')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 0078c61..59c30df 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 _0x0a84=['sequelize','exports','STRING','INTEGER'];(function(_0x32fcf8,_0x3b1c96){var _0x11fe25=function(_0x1a243d){while(--_0x1a243d){_0x32fcf8['push'](_0x32fcf8['shift']());}};_0x11fe25(++_0x3b1c96);}(_0x0a84,0x1f4));var _0x40a8=function(_0x79a88b,_0x31698c){_0x79a88b=_0x79a88b-0x0;var _0x4cca8d=_0x0a84[_0x79a88b];return _0x4cca8d;};'use strict';var Sequelize=require(_0x40a8('0x0'));module[_0x40a8('0x1')]={'name':{'type':Sequelize[_0x40a8('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x40a8('0x3')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x1b1e=['STRING','INTEGER','sequelize','exports'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x1b1e,0xb2));var _0xe1b1=function(_0xb00710,_0x4d7d03){_0xb00710=_0xb00710-0x0;var _0x3980c0=_0x1b1e[_0xb00710];return _0x3980c0;};'use strict';var Sequelize=require(_0xe1b1('0x0'));module[_0xe1b1('0x1')]={'name':{'type':Sequelize[_0xe1b1('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xe1b1('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xe1b1('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 469eba9..af5cbc4 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 _0x9f0e=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','end','error','name','send','index','map','UserProfileResource','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','options','find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f0e,0x116));var _0xe9f0=function(_0xb6e19c,_0x4639b8){_0xb6e19c=_0xb6e19c-0x0;var _0x5b6fbb=_0x9f0e[_0xb6e19c];return _0x5b6fbb;};'use strict';var emlformat=require(_0xe9f0('0x0'));var rimraf=require(_0xe9f0('0x1'));var zipdir=require(_0xe9f0('0x2'));var jsonpatch=require(_0xe9f0('0x3'));var rp=require(_0xe9f0('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe9f0('0x5'));var util=require(_0xe9f0('0x6'));var path=require(_0xe9f0('0x7'));var sox=require(_0xe9f0('0x8'));var csv=require(_0xe9f0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');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('0x9'));var querystring=require(_0xe9f0('0xe'));var Papa=require(_0xe9f0('0xf'));var Redis=require(_0xe9f0('0x10'));var authService=require(_0xe9f0('0x11'));var qs=require(_0xe9f0('0x12'));var as=require(_0xe9f0('0x13'));var hardwareService=require(_0xe9f0('0x14'));var logger=require('../../config/logger')(_0xe9f0('0x15'));var utils=require(_0xe9f0('0x16'));var config=require(_0xe9f0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xe9f0('0x18'))['db'];function respondWithStatusCode(_0x586763,_0x367545){_0x367545=_0x367545||0xcc;return function(_0xd82420){if(_0xd82420){return _0x586763[_0xe9f0('0x19')](_0x367545);}return _0x586763[_0xe9f0('0x1a')](_0x367545)['end']();};}function respondWithResult(_0x2cf75d,_0x5a10c6){_0x5a10c6=_0x5a10c6||0xc8;return function(_0x1e3ba8){if(_0x1e3ba8){return _0x2cf75d[_0xe9f0('0x1a')](_0x5a10c6)[_0xe9f0('0x1b')](_0x1e3ba8);}};}function respondWithFilteredResult(_0x59320d,_0x28bfac){return function(_0x33e9e4){if(_0x33e9e4){var _0x2e68ef=typeof _0x28bfac['offset']===_0xe9f0('0x1c')&&typeof _0x28bfac[_0xe9f0('0x1d')]===_0xe9f0('0x1c');var _0xd71ac8=_0x33e9e4[_0xe9f0('0x1e')];var _0x2ab12b=_0x2e68ef?0x0:_0x28bfac[_0xe9f0('0x1f')];var _0x59bf5a=_0x2e68ef?_0x33e9e4[_0xe9f0('0x1e')]:_0x28bfac[_0xe9f0('0x1f')]+_0x28bfac[_0xe9f0('0x1d')];var _0x5c4182;if(_0x59bf5a>=_0xd71ac8){_0x59bf5a=_0xd71ac8;_0x5c4182=0xc8;}else{_0x5c4182=0xce;}_0x59320d[_0xe9f0('0x1a')](_0x5c4182);return _0x59320d[_0xe9f0('0x20')](_0xe9f0('0x21'),_0x2ab12b+'-'+_0x59bf5a+'/'+_0xd71ac8)[_0xe9f0('0x1b')](_0x33e9e4);}return null;};}function patchUpdates(_0x5ba788){return function(_0x33f143){try{jsonpatch[_0xe9f0('0x22')](_0x33f143,_0x5ba788,!![]);}catch(_0x583687){return BPromise['reject'](_0x583687);}return _0x33f143['save']();};}function saveUpdates(_0x12fe9f,_0xa1ddc){return function(_0x1211ae){if(_0x1211ae){return _0x1211ae[_0xe9f0('0x23')](_0x12fe9f)[_0xe9f0('0x24')](function(_0x4a5c27){return _0x4a5c27;});}return null;};}function removeEntity(_0x229fe0,_0x38b7ee){return function(_0x437d43){if(_0x437d43){return _0x437d43[_0xe9f0('0x25')]()[_0xe9f0('0x24')](function(){_0x229fe0[_0xe9f0('0x1a')](0xcc)[_0xe9f0('0x26')]();});}};}function handleEntityNotFound(_0x1321bb,_0x3c4ba9){return function(_0x3fce54){if(!_0x3fce54){_0x1321bb['sendStatus'](0x194);}return _0x3fce54;};}function handleError(_0x371095,_0x27541f){_0x27541f=_0x27541f||0x1f4;return function(_0x2ddfba){logger[_0xe9f0('0x27')](_0x2ddfba['stack']);if(_0x2ddfba[_0xe9f0('0x28')]){delete _0x2ddfba[_0xe9f0('0x28')];}_0x371095[_0xe9f0('0x1a')](_0x27541f)[_0xe9f0('0x29')](_0x2ddfba);};}exports[_0xe9f0('0x2a')]=function(_0x5457f6,_0x130f96){var _0xdc16bc={},_0x44fb5b={},_0xab3d81={'count':0x0,'rows':[]};var _0xa27c84=_[_0xe9f0('0x2b')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')],function(_0x2b6503){return{'name':_0x2b6503[_0xe9f0('0x2e')],'type':_0x2b6503[_0xe9f0('0x2f')][_0xe9f0('0x30')]};});_0x44fb5b[_0xe9f0('0x31')]=_[_0xe9f0('0x2b')](_0xa27c84,_0xe9f0('0x28'));_0x44fb5b[_0xe9f0('0x32')]=_[_0xe9f0('0x33')](_0x5457f6[_0xe9f0('0x32')]);_0x44fb5b[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x44fb5b[_0xe9f0('0x31')],_0x44fb5b[_0xe9f0('0x32')]);_0xdc16bc[_0xe9f0('0x36')]=_[_0xe9f0('0x35')](_0x44fb5b['model'],qs['fields'](_0x5457f6['query'][_0xe9f0('0x37')]));_0xdc16bc['attributes']=_0xdc16bc[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0xdc16bc['attributes']:_0x44fb5b[_0xe9f0('0x31')];if(!_0x5457f6['query']['hasOwnProperty']('nolimit')){_0xdc16bc[_0xe9f0('0x1d')]=qs[_0xe9f0('0x1d')](_0x5457f6['query'][_0xe9f0('0x1d')]);_0xdc16bc[_0xe9f0('0x1f')]=qs[_0xe9f0('0x1f')](_0x5457f6['query']['offset']);}_0xdc16bc[_0xe9f0('0x39')]=qs[_0xe9f0('0x3a')](_0x5457f6[_0xe9f0('0x32')]['sort']);_0xdc16bc[_0xe9f0('0x3b')]=qs[_0xe9f0('0x34')](_[_0xe9f0('0x3c')](_0x5457f6[_0xe9f0('0x32')],_0x44fb5b[_0xe9f0('0x34')]),_0xa27c84);if(_0x5457f6['query'][_0xe9f0('0x3d')]){_0xdc16bc[_0xe9f0('0x3b')]=_[_0xe9f0('0x3e')](_0xdc16bc['where'],{'$or':_[_0xe9f0('0x2b')](_0xa27c84,function(_0xbec11f){if(_0xbec11f['type']!==_0xe9f0('0x3f')){var _0x5154c3={};_0x5154c3[_0xbec11f[_0xe9f0('0x28')]]={'$like':'%'+_0x5457f6['query']['filter']+'%'};return _0x5154c3;}})});}_0xdc16bc=_['merge']({},_0xdc16bc,_0x5457f6['options']);var _0x5165f7={'where':_0xdc16bc[_0xe9f0('0x3b')]};return db[_0xe9f0('0x2c')][_0xe9f0('0x1e')](_0x5165f7)[_0xe9f0('0x24')](function(_0x2560c6){_0xab3d81[_0xe9f0('0x1e')]=_0x2560c6;if(_0x5457f6[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0xdc16bc[_0xe9f0('0x41')]=[{'all':!![]}];}return db['UserProfileResource'][_0xe9f0('0x42')](_0xdc16bc);})[_0xe9f0('0x24')](function(_0x36b00a){_0xab3d81['rows']=_0x36b00a;return _0xab3d81;})['then'](respondWithFilteredResult(_0x130f96,_0xdc16bc))[_0xe9f0('0x43')](handleError(_0x130f96,null));};exports['show']=function(_0x297689,_0x52613a){var _0x314f0e={'raw':![],'where':{'id':_0x297689['params']['id']}},_0x42d9d2={};_0x42d9d2[_0xe9f0('0x31')]=_[_0xe9f0('0x33')](db[_0xe9f0('0x2c')][_0xe9f0('0x2d')]);_0x42d9d2[_0xe9f0('0x32')]=_['keys'](_0x297689[_0xe9f0('0x32')]);_0x42d9d2[_0xe9f0('0x34')]=_[_0xe9f0('0x35')](_0x42d9d2[_0xe9f0('0x31')],_0x42d9d2[_0xe9f0('0x32')]);_0x314f0e['attributes']=_[_0xe9f0('0x35')](_0x42d9d2['model'],qs['fields'](_0x297689[_0xe9f0('0x32')][_0xe9f0('0x37')]));_0x314f0e['attributes']=_0x314f0e[_0xe9f0('0x36')][_0xe9f0('0x38')]?_0x314f0e[_0xe9f0('0x36')]:_0x42d9d2[_0xe9f0('0x31')];if(_0x297689[_0xe9f0('0x32')][_0xe9f0('0x40')]){_0x314f0e[_0xe9f0('0x41')]=[{'all':!![]}];}_0x314f0e=_['merge']({},_0x314f0e,_0x297689[_0xe9f0('0x44')]);return db['UserProfileResource'][_0xe9f0('0x45')](_0x314f0e)['then'](handleEntityNotFound(_0x52613a,null))[_0xe9f0('0x24')](respondWithResult(_0x52613a,null))['catch'](handleError(_0x52613a,null));};exports[_0xe9f0('0x46')]=function(_0x2023b4,_0x422324){return db['UserProfileResource'][_0xe9f0('0x46')](_0x2023b4[_0xe9f0('0x47')],{})[_0xe9f0('0x24')](respondWithResult(_0x422324,0xc9))[_0xe9f0('0x43')](handleError(_0x422324,null));};exports[_0xe9f0('0x23')]=function(_0x135175,_0x6ece3f){if(_0x135175[_0xe9f0('0x47')]['id']){delete _0x135175[_0xe9f0('0x47')]['id'];}return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x135175[_0xe9f0('0x48')]['id']}})['then'](handleEntityNotFound(_0x6ece3f,null))['then'](saveUpdates(_0x135175[_0xe9f0('0x47')],null))[_0xe9f0('0x24')](respondWithResult(_0x6ece3f,null))[_0xe9f0('0x43')](handleError(_0x6ece3f,null));};exports['destroy']=function(_0x1ac381,_0x4d8b2e){return db[_0xe9f0('0x2c')][_0xe9f0('0x45')]({'where':{'id':_0x1ac381[_0xe9f0('0x48')]['id']}})[_0xe9f0('0x24')](handleEntityNotFound(_0x4d8b2e,null))['then'](removeEntity(_0x4d8b2e,null))[_0xe9f0('0x43')](handleError(_0x4d8b2e,null));};exports[_0xe9f0('0x49')]=function(_0x5163ea,_0x2bf65c){return db[_0xe9f0('0x2c')][_0xe9f0('0x49')]()[_0xe9f0('0x24')](respondWithResult(_0x2bf65c,null))['catch'](handleError(_0x2bf65c,null));}; \ No newline at end of file +var _0x2ef3=['name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','UserProfileResource','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','error','stack'];(function(_0x3732dd,_0x2e914){var _0x347d53=function(_0x408b35){while(--_0x408b35){_0x3732dd['push'](_0x3732dd['shift']());}};_0x347d53(++_0x2e914);}(_0x2ef3,0xba));var _0x32ef=function(_0x2e63a9,_0x361d0b){_0x2e63a9=_0x2e63a9-0x0;var _0x3136bf=_0x2ef3[_0x2e63a9];return _0x3136bf;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['UserProfileResource'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['UserProfileResource'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['UserProfileResource']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));};exports['describe']=function(_0x179c2f,_0x259c32){return db[_0x32ef('0x3d')][_0x32ef('0x4a')]()[_0x32ef('0x3e')](respondWithResult(_0x259c32,null))[_0x32ef('0x42')](handleError(_0x259c32,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 6792e68..1af23f8 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 _0x7c39=['../../config/environment','./userProfileResource.attributes','exports','define','user_profile_has_resources','compositeIndex','resourceId','sectionId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x12978f,_0x527378){var _0x1041ad=function(_0x394add){while(--_0x394add){_0x12978f['push'](_0x12978f['shift']());}};_0x1041ad(++_0x527378);}(_0x7c39,0x1c8));var _0x97c3=function(_0x3b1198,_0x41650f){_0x3b1198=_0x3b1198-0x0;var _0x1505a6=_0x7c39[_0x3b1198];return _0x1505a6;};'use strict';var _=require('lodash');var util=require(_0x97c3('0x0'));var logger=require(_0x97c3('0x1'))(_0x97c3('0x2'));var moment=require(_0x97c3('0x3'));var BPromise=require(_0x97c3('0x4'));var rp=require(_0x97c3('0x5'));var fs=require('fs');var path=require(_0x97c3('0x6'));var rimraf=require(_0x97c3('0x7'));var config=require(_0x97c3('0x8'));var attributes=require(_0x97c3('0x9'));module[_0x97c3('0xa')]=function(_0x38a54e,_0x8a292b){return _0x38a54e[_0x97c3('0xb')]('UserProfileResource',attributes,{'tableName':_0x97c3('0xc'),'paranoid':![],'indexes':[{'name':_0x97c3('0xd'),'fields':[_0x97c3('0xe'),_0x97c3('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x54b5=['moment','path','rimraf','../../config/environment','./userProfileResource.attributes','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','util','api'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x54b5,0x10e));var _0x554b=function(_0xdf6837,_0x440887){_0xdf6837=_0xdf6837-0x0;var _0x254cfa=_0x54b5[_0xdf6837];return _0x254cfa;};'use strict';var _=require(_0x554b('0x0'));var util=require(_0x554b('0x1'));var logger=require('../../config/logger')(_0x554b('0x2'));var moment=require(_0x554b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x554b('0x4'));var rimraf=require(_0x554b('0x5'));var config=require(_0x554b('0x6'));var attributes=require(_0x554b('0x7'));module['exports']=function(_0x36c13c,_0x5e163b){return _0x36c13c['define'](_0x554b('0x8'),attributes,{'tableName':_0x554b('0x9'),'paranoid':![],'indexes':[{'name':_0x554b('0xa'),'fields':[_0x554b('0xb'),_0x554b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index b545e34..24fd944 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 _0x3df6=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','info','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','UserProfileResource,\x20%s,\x20%s','message'];(function(_0x25ada9,_0x5f0e07){var _0x59e1ab=function(_0x241d91){while(--_0x241d91){_0x25ada9['push'](_0x25ada9['shift']());}};_0x59e1ab(++_0x5f0e07);}(_0x3df6,0xfe));var _0x63df=function(_0x96a338,_0x57ee18){_0x96a338=_0x96a338-0x0;var _0x1ef407=_0x3df6[_0x96a338];return _0x1ef407;};'use strict';var _=require(_0x63df('0x0'));var util=require(_0x63df('0x1'));var moment=require(_0x63df('0x2'));var BPromise=require(_0x63df('0x3'));var rs=require(_0x63df('0x4'));var fs=require('fs');var Redis=require(_0x63df('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x63df('0x6'));var logger=require(_0x63df('0x7'))('rpc');var config=require(_0x63df('0x8'));var jayson=require(_0x63df('0x9'));var client=jayson[_0x63df('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b2fe9,_0x159ef4,_0x534dde){return new BPromise(function(_0x29d4ae,_0x1875a6){return client[_0x63df('0xb')](_0x1b2fe9,_0x534dde)['then'](function(_0x4fae3b){logger[_0x63df('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x159ef4,_0x63df('0xd'));logger['debug'](_0x63df('0xe'),_0x159ef4,_0x63df('0xd'),JSON[_0x63df('0xf')](_0x4fae3b));if(_0x4fae3b[_0x63df('0x10')]){if(_0x4fae3b['error']['code']===0x1f4){logger[_0x63df('0x10')](_0x63df('0x11'),_0x159ef4,_0x4fae3b[_0x63df('0x10')][_0x63df('0x12')]);return _0x1875a6(_0x4fae3b['error'][_0x63df('0x12')]);}logger[_0x63df('0x10')]('UserProfileResource,\x20%s,\x20%s',_0x159ef4,_0x4fae3b[_0x63df('0x10')][_0x63df('0x12')]);return _0x29d4ae(_0x4fae3b[_0x63df('0x10')][_0x63df('0x12')]);}else{logger[_0x63df('0xc')](_0x63df('0x11'),_0x159ef4,_0x63df('0xd'));_0x29d4ae(_0x4fae3b[_0x63df('0x13')][_0x63df('0x12')]);}})[_0x63df('0x14')](function(_0x3e749e){logger[_0x63df('0x10')](_0x63df('0x11'),_0x159ef4,_0x3e749e);_0x1875a6(_0x3e749e);});});} \ No newline at end of file +var _0x5e9d=['then','info','UserProfileResource,\x20%s,\x20%s','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x5e9d,0xb4));var _0xd5e9=function(_0x390bcb,_0x5c8f39){_0x390bcb=_0x390bcb-0x0;var _0x52e01f=_0x5e9d[_0x390bcb];return _0x52e01f;};'use strict';var _=require(_0xd5e9('0x0'));var util=require(_0xd5e9('0x1'));var moment=require(_0xd5e9('0x2'));var BPromise=require('bluebird');var rs=require(_0xd5e9('0x3'));var fs=require('fs');var Redis=require(_0xd5e9('0x4'));var db=require(_0xd5e9('0x5'))['db'];var utils=require(_0xd5e9('0x6'));var logger=require('../../config/logger')(_0xd5e9('0x7'));var config=require(_0xd5e9('0x8'));var jayson=require(_0xd5e9('0x9'));var client=jayson['client'][_0xd5e9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11b7bc,_0x19dca1,_0x3818af){return new BPromise(function(_0xd91cae,_0xd846e7){return client[_0xd5e9('0xb')](_0x11b7bc,_0x3818af)[_0xd5e9('0xc')](function(_0x5dd691){logger[_0xd5e9('0xd')](_0xd5e9('0xe'),_0x19dca1,'request\x20sent');logger[_0xd5e9('0xf')](_0xd5e9('0x10'),_0x19dca1,'request\x20sent',JSON[_0xd5e9('0x11')](_0x5dd691));if(_0x5dd691[_0xd5e9('0x12')]){if(_0x5dd691['error'][_0xd5e9('0x13')]===0x1f4){logger[_0xd5e9('0x12')](_0xd5e9('0xe'),_0x19dca1,_0x5dd691[_0xd5e9('0x12')][_0xd5e9('0x14')]);return _0xd846e7(_0x5dd691[_0xd5e9('0x12')]['message']);}logger[_0xd5e9('0x12')](_0xd5e9('0xe'),_0x19dca1,_0x5dd691[_0xd5e9('0x12')][_0xd5e9('0x14')]);return _0xd91cae(_0x5dd691[_0xd5e9('0x12')][_0xd5e9('0x14')]);}else{logger[_0xd5e9('0xd')](_0xd5e9('0xe'),_0x19dca1,_0xd5e9('0x15'));_0xd91cae(_0x5dd691[_0xd5e9('0x16')]['message']);}})[_0xd5e9('0x17')](function(_0x2a4d2a){logger[_0xd5e9('0x12')](_0xd5e9('0xe'),_0x19dca1,_0x2a4d2a);_0xd846e7(_0x2a4d2a);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 07c6df3..58c242f 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 _0xfd67=['delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./userProfileSection.controller','index','describe','/:id','isAuthenticated','show','put','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfd67,0x8b));var _0x7fd6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd67[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7fd6('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7fd6('0x1'));var express=require(_0x7fd6('0x2'));var router=express[_0x7fd6('0x3')]();var fs_extra=require(_0x7fd6('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7fd6('0x5'));var config=require('../../config/environment');var controller=require(_0x7fd6('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x7fd6('0x7')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x7fd6('0x8')]);router['get'](_0x7fd6('0x9'),auth[_0x7fd6('0xa')](),controller[_0x7fd6('0xb')]);router['post']('/',auth[_0x7fd6('0xa')](),controller['create']);router[_0x7fd6('0xc')]('/:id',auth[_0x7fd6('0xa')](),controller[_0x7fd6('0xd')]);router[_0x7fd6('0xe')](_0x7fd6('0x9'),auth['isAuthenticated'](),controller[_0x7fd6('0xf')]);module[_0x7fd6('0x10')]=router; \ No newline at end of file +var _0x89e0=['connect-timeout','fs-extra','../../config/environment','get','index','isAuthenticated','/:id','show','create','update','delete','destroy','multer','path'];(function(_0x40e989,_0x157065){var _0x116160=function(_0x13f2f5){while(--_0x13f2f5){_0x40e989['push'](_0x40e989['shift']());}};_0x116160(++_0x157065);}(_0x89e0,0x132));var _0x089e=function(_0x156e99,_0x2bf27e){_0x156e99=_0x156e99-0x0;var _0x18870e=_0x89e0[_0x156e99];return _0x18870e;};'use strict';var multer=require(_0x089e('0x0'));var util=require('util');var path=require(_0x089e('0x1'));var timeout=require(_0x089e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x089e('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x089e('0x4'));var controller=require('./userProfileSection.controller');router[_0x089e('0x5')]('/',auth['isAuthenticated'](),controller[_0x089e('0x6')]);router[_0x089e('0x5')]('/describe',auth[_0x089e('0x7')](),controller['describe']);router[_0x089e('0x5')](_0x089e('0x8'),auth[_0x089e('0x7')](),controller[_0x089e('0x9')]);router['post']('/',auth[_0x089e('0x7')](),controller[_0x089e('0xa')]);router['put'](_0x089e('0x8'),auth[_0x089e('0x7')](),controller[_0x089e('0xb')]);router[_0x089e('0xc')]('/:id',auth[_0x089e('0x7')](),controller[_0x089e('0xd')]);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 64f87c9..69542ab 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 _0x9c00=['STRING','setDataValue','crudPermissions','join','getDataValue','split','sequelize','exports','INTEGER','BOOLEAN'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x9c00,0x1a0));var _0x09c0=function(_0x39ce5a,_0x260622){_0x39ce5a=_0x39ce5a-0x0;var _0x46cd9a=_0x9c00[_0x39ce5a];return _0x46cd9a;};'use strict';var Sequelize=require(_0x09c0('0x0'));module[_0x09c0('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x09c0('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x09c0('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x09c0('0x4')],'set':function(_0x2c702c){this[_0x09c0('0x5')](_0x09c0('0x6'),_0x2c702c?_0x2c702c[_0x09c0('0x7')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x09c0('0x8')](_0x09c0('0x6'))[_0x09c0('0x9')](''):[];}}}; \ No newline at end of file +var _0x8f59=['INTEGER','BOOLEAN','setDataValue','crudPermissions','getDataValue','sequelize','exports','STRING'];(function(_0x52bf6f,_0x3d3be7){var _0x462f45=function(_0x58a3f8){while(--_0x58a3f8){_0x52bf6f['push'](_0x52bf6f['shift']());}};_0x462f45(++_0x3d3be7);}(_0x8f59,0x11d));var _0x98f5=function(_0x257996,_0x31432b){_0x257996=_0x257996-0x0;var _0x531817=_0x8f59[_0x257996];return _0x531817;};'use strict';var Sequelize=require(_0x98f5('0x0'));module[_0x98f5('0x1')]={'name':{'type':Sequelize[_0x98f5('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x98f5('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x98f5('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x98f5('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x98f5('0x2')],'set':function(_0x320235){this[_0x98f5('0x5')](_0x98f5('0x6'),_0x320235?_0x320235['join'](''):[]);},'get':function(){return this[_0x98f5('0x7')](_0x98f5('0x6'))?this[_0x98f5('0x7')]('crudPermissions')['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index e11b25d..df57a5b 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 _0xb631=['send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','sort','filters','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','name'];(function(_0x3adeb5,_0x3c2c44){var _0x1ccf64=function(_0x1ac079){while(--_0x1ac079){_0x3adeb5['push'](_0x3adeb5['shift']());}};_0x1ccf64(++_0x3c2c44);}(_0xb631,0x105));var _0x1b63=function(_0x5d45e7,_0x227c05){_0x5d45e7=_0x5d45e7-0x0;var _0x26a8d4=_0xb631[_0x5d45e7];return _0x26a8d4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1b63('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b63('0x1'));var moment=require(_0x1b63('0x2'));var BPromise=require(_0x1b63('0x3'));var Mustache=require('mustache');var util=require(_0x1b63('0x4'));var path=require(_0x1b63('0x5'));var sox=require(_0x1b63('0x6'));var csv=require(_0x1b63('0x7'));var ejs=require(_0x1b63('0x8'));var fs=require('fs');var fs_extra=require(_0x1b63('0x9'));var _=require(_0x1b63('0xa'));var squel=require(_0x1b63('0xb'));var crypto=require(_0x1b63('0xc'));var jsforce=require(_0x1b63('0xd'));var deskjs=require(_0x1b63('0xe'));var toCsv=require(_0x1b63('0x7'));var querystring=require(_0x1b63('0xf'));var Papa=require(_0x1b63('0x10'));var Redis=require(_0x1b63('0x11'));var authService=require(_0x1b63('0x12'));var qs=require(_0x1b63('0x13'));var as=require(_0x1b63('0x14'));var hardwareService=require(_0x1b63('0x15'));var logger=require(_0x1b63('0x16'))(_0x1b63('0x17'));var utils=require('../../config/utils');var config=require(_0x1b63('0x18'));var licenseUtil=require(_0x1b63('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c532e,_0x5b326c){_0x5b326c=_0x5b326c||0xcc;return function(_0x1c2da5){if(_0x1c2da5){return _0x1c532e[_0x1b63('0x1a')](_0x5b326c);}return _0x1c532e[_0x1b63('0x1b')](_0x5b326c)[_0x1b63('0x1c')]();};}function respondWithResult(_0x3d472d,_0x2c4ae8){_0x2c4ae8=_0x2c4ae8||0xc8;return function(_0x526be0){if(_0x526be0){return _0x3d472d[_0x1b63('0x1b')](_0x2c4ae8)['json'](_0x526be0);}};}function respondWithFilteredResult(_0x7a7e44,_0x5abee1){return function(_0x2e471a){if(_0x2e471a){var _0x3f054b=typeof _0x5abee1[_0x1b63('0x1d')]===_0x1b63('0x1e')&&typeof _0x5abee1[_0x1b63('0x1f')]===_0x1b63('0x1e');var _0x539e23=_0x2e471a[_0x1b63('0x20')];var _0x549b1c=_0x3f054b?0x0:_0x5abee1[_0x1b63('0x1d')];var _0x49e255=_0x3f054b?_0x2e471a[_0x1b63('0x20')]:_0x5abee1[_0x1b63('0x1d')]+_0x5abee1['limit'];var _0x598321;if(_0x49e255>=_0x539e23){_0x49e255=_0x539e23;_0x598321=0xc8;}else{_0x598321=0xce;}_0x7a7e44[_0x1b63('0x1b')](_0x598321);return _0x7a7e44['set'](_0x1b63('0x21'),_0x549b1c+'-'+_0x49e255+'/'+_0x539e23)[_0x1b63('0x22')](_0x2e471a);}return null;};}function patchUpdates(_0x3007aa){return function(_0xe10444){try{jsonpatch[_0x1b63('0x23')](_0xe10444,_0x3007aa,!![]);}catch(_0xea7028){return BPromise[_0x1b63('0x24')](_0xea7028);}return _0xe10444[_0x1b63('0x25')]();};}function saveUpdates(_0x39ac68,_0x1e9b14){return function(_0x2b26bf){if(_0x2b26bf){return _0x2b26bf[_0x1b63('0x26')](_0x39ac68)[_0x1b63('0x27')](function(_0x327476){return _0x327476;});}return null;};}function removeEntity(_0x4bfbcd,_0x5a97ef){return function(_0x180d24){if(_0x180d24){return _0x180d24[_0x1b63('0x28')]()['then'](function(){_0x4bfbcd['status'](0xcc)[_0x1b63('0x1c')]();});}};}function handleEntityNotFound(_0x1a4da3,_0x650a68){return function(_0x455fd7){if(!_0x455fd7){_0x1a4da3[_0x1b63('0x1a')](0x194);}return _0x455fd7;};}function handleError(_0x103ae8,_0x16be77){_0x16be77=_0x16be77||0x1f4;return function(_0x2322d4){logger[_0x1b63('0x29')](_0x2322d4['stack']);if(_0x2322d4['name']){delete _0x2322d4[_0x1b63('0x2a')];}_0x103ae8[_0x1b63('0x1b')](_0x16be77)[_0x1b63('0x2b')](_0x2322d4);};}exports[_0x1b63('0x2c')]=function(_0x47a154,_0x1ae903){var _0x40a083={},_0x502027={},_0x244bef={'count':0x0,'rows':[]};var _0x48ab1e=_[_0x1b63('0x2d')](db[_0x1b63('0x2e')][_0x1b63('0x2f')],function(_0xf14a3f){return{'name':_0xf14a3f[_0x1b63('0x30')],'type':_0xf14a3f[_0x1b63('0x31')][_0x1b63('0x32')]};});_0x502027[_0x1b63('0x33')]=_[_0x1b63('0x2d')](_0x48ab1e,_0x1b63('0x2a'));_0x502027[_0x1b63('0x34')]=_[_0x1b63('0x35')](_0x47a154[_0x1b63('0x34')]);_0x502027['filters']=_['intersection'](_0x502027[_0x1b63('0x33')],_0x502027['query']);_0x40a083[_0x1b63('0x36')]=_[_0x1b63('0x37')](_0x502027[_0x1b63('0x33')],qs[_0x1b63('0x38')](_0x47a154[_0x1b63('0x34')]['fields']));_0x40a083[_0x1b63('0x36')]=_0x40a083[_0x1b63('0x36')][_0x1b63('0x39')]?_0x40a083[_0x1b63('0x36')]:_0x502027[_0x1b63('0x33')];if(!_0x47a154['query'][_0x1b63('0x3a')]('nolimit')){_0x40a083[_0x1b63('0x1f')]=qs[_0x1b63('0x1f')](_0x47a154[_0x1b63('0x34')]['limit']);_0x40a083[_0x1b63('0x1d')]=qs[_0x1b63('0x1d')](_0x47a154[_0x1b63('0x34')][_0x1b63('0x1d')]);}_0x40a083['order']=qs['sort'](_0x47a154[_0x1b63('0x34')][_0x1b63('0x3b')]);_0x40a083['where']=qs[_0x1b63('0x3c')](_[_0x1b63('0x3d')](_0x47a154[_0x1b63('0x34')],_0x502027[_0x1b63('0x3c')]),_0x48ab1e);if(_0x47a154[_0x1b63('0x34')][_0x1b63('0x3e')]){_0x40a083[_0x1b63('0x3f')]=_[_0x1b63('0x40')](_0x40a083[_0x1b63('0x3f')],{'$or':_[_0x1b63('0x2d')](_0x48ab1e,function(_0x398419){if(_0x398419[_0x1b63('0x31')]!==_0x1b63('0x41')){var _0x2ac04a={};_0x2ac04a[_0x398419[_0x1b63('0x2a')]]={'$like':'%'+_0x47a154['query'][_0x1b63('0x3e')]+'%'};return _0x2ac04a;}})});}_0x40a083=_[_0x1b63('0x40')]({},_0x40a083,_0x47a154['options']);var _0x30c7d6={'where':_0x40a083['where']};return db[_0x1b63('0x2e')][_0x1b63('0x20')](_0x30c7d6)['then'](function(_0x6ddbe9){_0x244bef[_0x1b63('0x20')]=_0x6ddbe9;if(_0x47a154[_0x1b63('0x34')][_0x1b63('0x42')]){_0x40a083[_0x1b63('0x43')]=[{'all':!![]}];}return db[_0x1b63('0x2e')][_0x1b63('0x44')](_0x40a083);})['then'](function(_0x2539c6){_0x244bef[_0x1b63('0x45')]=_0x2539c6;return _0x244bef;})[_0x1b63('0x27')](respondWithFilteredResult(_0x1ae903,_0x40a083))[_0x1b63('0x46')](handleError(_0x1ae903,null));};exports[_0x1b63('0x47')]=function(_0x56a1ea,_0x10a17c){var _0x56ee9e={'raw':![],'where':{'id':_0x56a1ea[_0x1b63('0x48')]['id']}},_0x5a5864={};_0x5a5864['model']=_[_0x1b63('0x35')](db['UserProfileSection'][_0x1b63('0x2f')]);_0x5a5864[_0x1b63('0x34')]=_[_0x1b63('0x35')](_0x56a1ea['query']);_0x5a5864['filters']=_[_0x1b63('0x37')](_0x5a5864['model'],_0x5a5864['query']);_0x56ee9e[_0x1b63('0x36')]=_[_0x1b63('0x37')](_0x5a5864[_0x1b63('0x33')],qs['fields'](_0x56a1ea[_0x1b63('0x34')][_0x1b63('0x38')]));_0x56ee9e[_0x1b63('0x36')]=_0x56ee9e[_0x1b63('0x36')][_0x1b63('0x39')]?_0x56ee9e['attributes']:_0x5a5864[_0x1b63('0x33')];if(_0x56a1ea[_0x1b63('0x34')][_0x1b63('0x42')]){_0x56ee9e[_0x1b63('0x43')]=[{'all':!![]}];}_0x56ee9e=_['merge']({},_0x56ee9e,_0x56a1ea['options']);return db['UserProfileSection'][_0x1b63('0x49')](_0x56ee9e)[_0x1b63('0x27')](handleEntityNotFound(_0x10a17c,null))[_0x1b63('0x27')](respondWithResult(_0x10a17c,null))[_0x1b63('0x46')](handleError(_0x10a17c,null));};exports[_0x1b63('0x4a')]=function(_0x12137a,_0x30235e){return db['UserProfileSection'][_0x1b63('0x4a')](_0x12137a[_0x1b63('0x4b')],{})[_0x1b63('0x27')](respondWithResult(_0x30235e,0xc9))[_0x1b63('0x46')](handleError(_0x30235e,null));};exports['update']=function(_0x49758e,_0x2f0f01){if(_0x49758e[_0x1b63('0x4b')]['id']){delete _0x49758e[_0x1b63('0x4b')]['id'];}return db[_0x1b63('0x2e')][_0x1b63('0x49')]({'where':{'id':_0x49758e[_0x1b63('0x48')]['id']}})[_0x1b63('0x27')](handleEntityNotFound(_0x2f0f01,null))[_0x1b63('0x27')](saveUpdates(_0x49758e[_0x1b63('0x4b')],null))['then'](respondWithResult(_0x2f0f01,null))[_0x1b63('0x46')](handleError(_0x2f0f01,null));};exports['destroy']=function(_0x4936ee,_0x1052b2){return db['UserProfileSection'][_0x1b63('0x49')]({'where':{'id':_0x4936ee[_0x1b63('0x48')]['id']}})[_0x1b63('0x27')](handleEntityNotFound(_0x1052b2,null))[_0x1b63('0x27')](removeEntity(_0x1052b2,null))[_0x1b63('0x46')](handleError(_0x1052b2,null));};exports['describe']=function(_0x542655,_0x1ec0f5){return db[_0x1b63('0x2e')]['describe']()[_0x1b63('0x27')](respondWithResult(_0x1ec0f5,null))[_0x1b63('0x46')](handleError(_0x1ec0f5,null));}; \ No newline at end of file +var _0xb42a=['Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','send','index','UserProfileSection','rawAttributes','fieldName','type','key','map','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','keys','intersection','includeAll','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','json','offset','undefined','limit','count'];(function(_0x4ecd38,_0x526e94){var _0x579b87=function(_0x2d64a6){while(--_0x2d64a6){_0x4ecd38['push'](_0x4ecd38['shift']());}};_0x579b87(++_0x526e94);}(_0xb42a,0xc5));var _0xab42=function(_0x239623,_0x19de29){_0x239623=_0x239623-0x0;var _0xc5b2f5=_0xb42a[_0x239623];return _0xc5b2f5;};'use strict';var emlformat=require(_0xab42('0x0'));var rimraf=require(_0xab42('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xab42('0x2'));var rp=require('request-promise');var moment=require(_0xab42('0x3'));var BPromise=require(_0xab42('0x4'));var Mustache=require(_0xab42('0x5'));var util=require(_0xab42('0x6'));var path=require(_0xab42('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xab42('0x8'));var fs=require('fs');var fs_extra=require(_0xab42('0x9'));var _=require(_0xab42('0xa'));var squel=require(_0xab42('0xb'));var crypto=require(_0xab42('0xc'));var jsforce=require(_0xab42('0xd'));var deskjs=require(_0xab42('0xe'));var toCsv=require(_0xab42('0xf'));var querystring=require(_0xab42('0x10'));var Papa=require('papaparse');var Redis=require(_0xab42('0x11'));var authService=require(_0xab42('0x12'));var qs=require(_0xab42('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab42('0x14'));var logger=require(_0xab42('0x15'))(_0xab42('0x16'));var utils=require(_0xab42('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xab42('0x18'))['db'];function respondWithStatusCode(_0x2c5485,_0x369d78){_0x369d78=_0x369d78||0xcc;return function(_0x1701f4){if(_0x1701f4){return _0x2c5485['sendStatus'](_0x369d78);}return _0x2c5485[_0xab42('0x19')](_0x369d78)['end']();};}function respondWithResult(_0x4a9395,_0x2de540){_0x2de540=_0x2de540||0xc8;return function(_0x5c8cd4){if(_0x5c8cd4){return _0x4a9395['status'](_0x2de540)[_0xab42('0x1a')](_0x5c8cd4);}};}function respondWithFilteredResult(_0xa82d47,_0x40cc49){return function(_0x3fdbb7){if(_0x3fdbb7){var _0x3fb307=typeof _0x40cc49[_0xab42('0x1b')]===_0xab42('0x1c')&&typeof _0x40cc49[_0xab42('0x1d')]==='undefined';var _0x29cb5d=_0x3fdbb7[_0xab42('0x1e')];var _0x41ca70=_0x3fb307?0x0:_0x40cc49[_0xab42('0x1b')];var _0x336644=_0x3fb307?_0x3fdbb7[_0xab42('0x1e')]:_0x40cc49[_0xab42('0x1b')]+_0x40cc49['limit'];var _0x7593da;if(_0x336644>=_0x29cb5d){_0x336644=_0x29cb5d;_0x7593da=0xc8;}else{_0x7593da=0xce;}_0xa82d47[_0xab42('0x19')](_0x7593da);return _0xa82d47['set'](_0xab42('0x1f'),_0x41ca70+'-'+_0x336644+'/'+_0x29cb5d)['json'](_0x3fdbb7);}return null;};}function patchUpdates(_0x3173a6){return function(_0x3bc1d7){try{jsonpatch[_0xab42('0x20')](_0x3bc1d7,_0x3173a6,!![]);}catch(_0x568a61){return BPromise[_0xab42('0x21')](_0x568a61);}return _0x3bc1d7[_0xab42('0x22')]();};}function saveUpdates(_0x4b26df,_0x5edeb7){return function(_0x4f4deb){if(_0x4f4deb){return _0x4f4deb[_0xab42('0x23')](_0x4b26df)[_0xab42('0x24')](function(_0x1b2692){return _0x1b2692;});}return null;};}function removeEntity(_0x10ecf2,_0x103d14){return function(_0x32bc9c){if(_0x32bc9c){return _0x32bc9c[_0xab42('0x25')]()[_0xab42('0x24')](function(){_0x10ecf2[_0xab42('0x19')](0xcc)[_0xab42('0x26')]();});}};}function handleEntityNotFound(_0x38a487,_0x1f3b9f){return function(_0x336f6a){if(!_0x336f6a){_0x38a487[_0xab42('0x27')](0x194);}return _0x336f6a;};}function handleError(_0x222da3,_0x380fc7){_0x380fc7=_0x380fc7||0x1f4;return function(_0x3f7db7){logger[_0xab42('0x28')](_0x3f7db7[_0xab42('0x29')]);if(_0x3f7db7[_0xab42('0x2a')]){delete _0x3f7db7[_0xab42('0x2a')];}_0x222da3[_0xab42('0x19')](_0x380fc7)[_0xab42('0x2b')](_0x3f7db7);};}exports[_0xab42('0x2c')]=function(_0x272ce6,_0x1543ba){var _0x4daaa2={},_0x505d78={},_0x1ea98e={'count':0x0,'rows':[]};var _0x23c10b=_['map'](db[_0xab42('0x2d')][_0xab42('0x2e')],function(_0x7b7ec){return{'name':_0x7b7ec[_0xab42('0x2f')],'type':_0x7b7ec[_0xab42('0x30')][_0xab42('0x31')]};});_0x505d78['model']=_[_0xab42('0x32')](_0x23c10b,'name');_0x505d78[_0xab42('0x33')]=_['keys'](_0x272ce6[_0xab42('0x33')]);_0x505d78[_0xab42('0x34')]=_['intersection'](_0x505d78[_0xab42('0x35')],_0x505d78[_0xab42('0x33')]);_0x4daaa2[_0xab42('0x36')]=_['intersection'](_0x505d78[_0xab42('0x35')],qs['fields'](_0x272ce6[_0xab42('0x33')][_0xab42('0x37')]));_0x4daaa2[_0xab42('0x36')]=_0x4daaa2[_0xab42('0x36')][_0xab42('0x38')]?_0x4daaa2['attributes']:_0x505d78[_0xab42('0x35')];if(!_0x272ce6['query'][_0xab42('0x39')](_0xab42('0x3a'))){_0x4daaa2[_0xab42('0x1d')]=qs[_0xab42('0x1d')](_0x272ce6[_0xab42('0x33')][_0xab42('0x1d')]);_0x4daaa2[_0xab42('0x1b')]=qs['offset'](_0x272ce6[_0xab42('0x33')][_0xab42('0x1b')]);}_0x4daaa2['order']=qs[_0xab42('0x3b')](_0x272ce6[_0xab42('0x33')][_0xab42('0x3b')]);_0x4daaa2[_0xab42('0x3c')]=qs[_0xab42('0x34')](_['pick'](_0x272ce6[_0xab42('0x33')],_0x505d78[_0xab42('0x34')]),_0x23c10b);if(_0x272ce6[_0xab42('0x33')][_0xab42('0x3d')]){_0x4daaa2[_0xab42('0x3c')]=_[_0xab42('0x3e')](_0x4daaa2['where'],{'$or':_['map'](_0x23c10b,function(_0x1fdc52){if(_0x1fdc52['type']!==_0xab42('0x3f')){var _0x3f08b8={};_0x3f08b8[_0x1fdc52['name']]={'$like':'%'+_0x272ce6['query'][_0xab42('0x3d')]+'%'};return _0x3f08b8;}})});}_0x4daaa2=_[_0xab42('0x3e')]({},_0x4daaa2,_0x272ce6[_0xab42('0x40')]);var _0x22a855={'where':_0x4daaa2[_0xab42('0x3c')]};return db[_0xab42('0x2d')][_0xab42('0x1e')](_0x22a855)[_0xab42('0x24')](function(_0x1d405f){_0x1ea98e['count']=_0x1d405f;if(_0x272ce6[_0xab42('0x33')]['includeAll']){_0x4daaa2[_0xab42('0x41')]=[{'all':!![]}];}return db[_0xab42('0x2d')][_0xab42('0x42')](_0x4daaa2);})[_0xab42('0x24')](function(_0x1b1c15){_0x1ea98e['rows']=_0x1b1c15;return _0x1ea98e;})[_0xab42('0x24')](respondWithFilteredResult(_0x1543ba,_0x4daaa2))[_0xab42('0x43')](handleError(_0x1543ba,null));};exports[_0xab42('0x44')]=function(_0x2dbaa7,_0x285a93){var _0x5c19cd={'raw':![],'where':{'id':_0x2dbaa7[_0xab42('0x45')]['id']}},_0x1fd926={};_0x1fd926[_0xab42('0x35')]=_[_0xab42('0x46')](db[_0xab42('0x2d')]['rawAttributes']);_0x1fd926['query']=_[_0xab42('0x46')](_0x2dbaa7['query']);_0x1fd926['filters']=_[_0xab42('0x47')](_0x1fd926['model'],_0x1fd926[_0xab42('0x33')]);_0x5c19cd['attributes']=_[_0xab42('0x47')](_0x1fd926[_0xab42('0x35')],qs['fields'](_0x2dbaa7[_0xab42('0x33')]['fields']));_0x5c19cd[_0xab42('0x36')]=_0x5c19cd[_0xab42('0x36')][_0xab42('0x38')]?_0x5c19cd['attributes']:_0x1fd926[_0xab42('0x35')];if(_0x2dbaa7[_0xab42('0x33')][_0xab42('0x48')]){_0x5c19cd['include']=[{'all':!![]}];}_0x5c19cd=_['merge']({},_0x5c19cd,_0x2dbaa7['options']);return db[_0xab42('0x2d')][_0xab42('0x49')](_0x5c19cd)[_0xab42('0x24')](handleEntityNotFound(_0x285a93,null))[_0xab42('0x24')](respondWithResult(_0x285a93,null))[_0xab42('0x43')](handleError(_0x285a93,null));};exports[_0xab42('0x4a')]=function(_0x2f1a0e,_0x1ee076){return db['UserProfileSection']['create'](_0x2f1a0e[_0xab42('0x4b')],{})[_0xab42('0x24')](respondWithResult(_0x1ee076,0xc9))[_0xab42('0x43')](handleError(_0x1ee076,null));};exports['update']=function(_0x3da14d,_0x1f8ebb){if(_0x3da14d[_0xab42('0x4b')]['id']){delete _0x3da14d[_0xab42('0x4b')]['id'];}return db[_0xab42('0x2d')]['find']({'where':{'id':_0x3da14d['params']['id']}})[_0xab42('0x24')](handleEntityNotFound(_0x1f8ebb,null))[_0xab42('0x24')](saveUpdates(_0x3da14d[_0xab42('0x4b')],null))[_0xab42('0x24')](respondWithResult(_0x1f8ebb,null))[_0xab42('0x43')](handleError(_0x1f8ebb,null));};exports[_0xab42('0x25')]=function(_0x4e4db5,_0x2a4927){return db[_0xab42('0x2d')][_0xab42('0x49')]({'where':{'id':_0x4e4db5['params']['id']}})[_0xab42('0x24')](handleEntityNotFound(_0x2a4927,null))[_0xab42('0x24')](removeEntity(_0x2a4927,null))[_0xab42('0x43')](handleError(_0x2a4927,null));};exports['describe']=function(_0x5f27ac,_0x1dbd46){return db[_0xab42('0x2d')]['describe']()[_0xab42('0x24')](respondWithResult(_0x1dbd46,null))[_0xab42('0x43')](handleError(_0x1dbd46,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 43ff600..dde4f83 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 _0x0109=['request-promise','path','../../config/environment','exports','UserProfileSection','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4a46b0,_0x27c455){var _0x2ffdee=function(_0x118bed){while(--_0x118bed){_0x4a46b0['push'](_0x4a46b0['shift']());}};_0x2ffdee(++_0x27c455);}(_0x0109,0xea));var _0x9010=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x0109[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x9010('0x0'));var util=require(_0x9010('0x1'));var logger=require(_0x9010('0x2'))(_0x9010('0x3'));var moment=require(_0x9010('0x4'));var BPromise=require(_0x9010('0x5'));var rp=require(_0x9010('0x6'));var fs=require('fs');var path=require(_0x9010('0x7'));var rimraf=require('rimraf');var config=require(_0x9010('0x8'));var attributes=require('./userProfileSection.attributes');module[_0x9010('0x9')]=function(_0x199ac4,_0x3b2418){return _0x199ac4['define'](_0x9010('0xa'),attributes,{'tableName':_0x9010('0xb'),'paranoid':![],'indexes':[{'name':_0x9010('0xc'),'fields':[_0x9010('0xd'),_0x9010('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4d1=['exports','define','UserProfileSection','user_profile_has_sections','sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x47c3b9,_0xf4e765){var _0x15d901=function(_0x506980){while(--_0x506980){_0x47c3b9['push'](_0x47c3b9['shift']());}};_0x15d901(++_0xf4e765);}(_0xc4d1,0x1b9));var _0x1c4d=function(_0x3391fe,_0x5c24d9){_0x3391fe=_0x3391fe-0x0;var _0x1ae383=_0xc4d1[_0x3391fe];return _0x1ae383;};'use strict';var _=require(_0x1c4d('0x0'));var util=require(_0x1c4d('0x1'));var logger=require(_0x1c4d('0x2'))(_0x1c4d('0x3'));var moment=require(_0x1c4d('0x4'));var BPromise=require(_0x1c4d('0x5'));var rp=require(_0x1c4d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1c4d('0x7'));var config=require(_0x1c4d('0x8'));var attributes=require('./userProfileSection.attributes');module[_0x1c4d('0x9')]=function(_0x1a457e,_0x255f82){return _0x1a457e[_0x1c4d('0xa')](_0x1c4d('0xb'),attributes,{'tableName':_0x1c4d('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x1c4d('0xd'),_0x1c4d('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index a7b21e7..4e78e06 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 _0xd5f7=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash'];(function(_0x47c9be,_0x2aedd9){var _0x51282a=function(_0x11d341){while(--_0x11d341){_0x47c9be['push'](_0x47c9be['shift']());}};_0x51282a(++_0x2aedd9);}(_0xd5f7,0x16f));var _0x7d5f=function(_0x4f91c5,_0x2ea939){_0x4f91c5=_0x4f91c5-0x0;var _0x1ddbae=_0xd5f7[_0x4f91c5];return _0x1ddbae;};'use strict';var _=require(_0x7d5f('0x0'));var util=require(_0x7d5f('0x1'));var moment=require(_0x7d5f('0x2'));var BPromise=require(_0x7d5f('0x3'));var rs=require(_0x7d5f('0x4'));var fs=require('fs');var Redis=require(_0x7d5f('0x5'));var db=require(_0x7d5f('0x6'))['db'];var utils=require(_0x7d5f('0x7'));var logger=require(_0x7d5f('0x8'))(_0x7d5f('0x9'));var config=require(_0x7d5f('0xa'));var jayson=require(_0x7d5f('0xb'));var client=jayson['client'][_0x7d5f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x92c404,_0x2b191d,_0x3b7e34){return new BPromise(function(_0x470589,_0x1e404a){return client['request'](_0x92c404,_0x3b7e34)[_0x7d5f('0xd')](function(_0x416872){logger[_0x7d5f('0xe')](_0x7d5f('0xf'),_0x2b191d,_0x7d5f('0x10'));logger[_0x7d5f('0x11')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x2b191d,_0x7d5f('0x10'),JSON[_0x7d5f('0x12')](_0x416872));if(_0x416872[_0x7d5f('0x13')]){if(_0x416872['error']['code']===0x1f4){logger[_0x7d5f('0x13')](_0x7d5f('0xf'),_0x2b191d,_0x416872[_0x7d5f('0x13')][_0x7d5f('0x14')]);return _0x1e404a(_0x416872[_0x7d5f('0x13')][_0x7d5f('0x14')]);}logger[_0x7d5f('0x13')]('UserProfileSection,\x20%s,\x20%s',_0x2b191d,_0x416872[_0x7d5f('0x13')]['message']);return _0x470589(_0x416872[_0x7d5f('0x13')][_0x7d5f('0x14')]);}else{logger[_0x7d5f('0xe')](_0x7d5f('0xf'),_0x2b191d,_0x7d5f('0x10'));_0x470589(_0x416872[_0x7d5f('0x15')][_0x7d5f('0x14')]);}})[_0x7d5f('0x16')](function(_0x5965cc){logger[_0x7d5f('0x13')]('UserProfileSection,\x20%s,\x20%s',_0x2b191d,_0x5965cc);_0x1e404a(_0x5965cc);});});} \ No newline at end of file +var _0xe80e=['then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','client','http','request'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0xe80e,0x1d8));var _0xee80=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xe80e[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xee80('0x0'));var util=require(_0xee80('0x1'));var moment=require(_0xee80('0x2'));var BPromise=require(_0xee80('0x3'));var rs=require(_0xee80('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xee80('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xee80('0x6'))('rpc');var config=require(_0xee80('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xee80('0x8')][_0xee80('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c88b5,_0x3a3865,_0x1bcac3){return new BPromise(function(_0x4c9b1f,_0x4bf00e){return client[_0xee80('0xa')](_0x5c88b5,_0x1bcac3)[_0xee80('0xb')](function(_0x2e5c7b){logger[_0xee80('0xc')](_0xee80('0xd'),_0x3a3865,_0xee80('0xe'));logger['debug'](_0xee80('0xf'),_0x3a3865,_0xee80('0xe'),JSON[_0xee80('0x10')](_0x2e5c7b));if(_0x2e5c7b[_0xee80('0x11')]){if(_0x2e5c7b['error']['code']===0x1f4){logger[_0xee80('0x11')](_0xee80('0xd'),_0x3a3865,_0x2e5c7b['error']['message']);return _0x4bf00e(_0x2e5c7b[_0xee80('0x11')][_0xee80('0x12')]);}logger[_0xee80('0x11')](_0xee80('0xd'),_0x3a3865,_0x2e5c7b['error']['message']);return _0x4c9b1f(_0x2e5c7b[_0xee80('0x11')][_0xee80('0x12')]);}else{logger[_0xee80('0xc')](_0xee80('0xd'),_0x3a3865,_0xee80('0xe'));_0x4c9b1f(_0x2e5c7b[_0xee80('0x13')]['message']);}})[_0xee80('0x14')](function(_0xec37c7){logger[_0xee80('0x11')](_0xee80('0xd'),_0x3a3865,_0xec37c7);_0x4bf00e(_0xec37c7);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index ff15cbb..5759ff8 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x2a9536,_0x5a801e){var _0x181aeb=function(_0x3662d5){while(--_0x3662d5){_0x2a9536['push'](_0x2a9536['shift']());}};_0x181aeb(++_0x5a801e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x226ad1,_0x2858e2){_0x226ad1=_0x226ad1-0x0;var _0x16b625=_0xcb91[_0x226ad1];return _0x16b625;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x17bf06,_0x53fc25){var _0x5a72c8=function(_0x9dcb06){while(--_0x9dcb06){_0x17bf06['push'](_0x17bf06['shift']());}};_0x5a72c8(++_0x53fc25);}(_0x70e0,0x17b));var _0x070e=function(_0x59f0c2,_0x8154){_0x59f0c2=_0x59f0c2-0x0;var _0x252618=_0x70e0[_0x59f0c2];return _0x252618;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 734cd79..298d357 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 _0xc7fb=['exports','INTEGER','sequelize'];(function(_0xb632a3,_0x526b16){var _0x139ec4=function(_0x141d0d){while(--_0x141d0d){_0xb632a3['push'](_0xb632a3['shift']());}};_0x139ec4(++_0x526b16);}(_0xc7fb,0x68));var _0xbc7f=function(_0x177fb3,_0x4b2f47){_0x177fb3=_0x177fb3-0x0;var _0x366c11=_0xc7fb[_0x177fb3];return _0x366c11;};'use strict';var Sequelize=require(_0xbc7f('0x0'));module[_0xbc7f('0x1')]={'penalty':{'type':Sequelize[_0xbc7f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x42ee=['exports','INTEGER'];(function(_0x3c487b,_0x44c5e2){var _0x1d65f6=function(_0x135e6d){while(--_0x135e6d){_0x3c487b['push'](_0x3c487b['shift']());}};_0x1d65f6(++_0x44c5e2);}(_0x42ee,0x19a));var _0xe42e=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x42ee[_0x4792c8];return _0x35edb1;};'use strict';var Sequelize=require('sequelize');module[_0xe42e('0x0')]={'penalty':{'type':Sequelize[_0xe42e('0x1')],'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 b2aa38e..b236608 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 _0x7096=['exports','define','UserSmsQueue','user_has_sms_queues','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0x7096,0x10c));var _0x6709=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0x7096[_0x23e7c1];return _0x1add43;};'use strict';var _=require('lodash');var util=require(_0x6709('0x0'));var logger=require('../../config/logger')(_0x6709('0x1'));var moment=require('moment');var BPromise=require(_0x6709('0x2'));var rp=require(_0x6709('0x3'));var fs=require('fs');var path=require(_0x6709('0x4'));var rimraf=require(_0x6709('0x5'));var config=require(_0x6709('0x6'));var attributes=require(_0x6709('0x7'));module[_0x6709('0x8')]=function(_0x9d630f,_0xa35832){return _0x9d630f[_0x6709('0x9')](_0x6709('0xa'),attributes,{'tableName':_0x6709('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe785=['util','api','moment','bluebird','request-promise','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','lodash'];(function(_0x4d4188,_0x23e126){var _0x3f9c84=function(_0x216d1e){while(--_0x216d1e){_0x4d4188['push'](_0x4d4188['shift']());}};_0x3f9c84(++_0x23e126);}(_0xe785,0x128));var _0x5e78=function(_0x445988,_0x19a6fe){_0x445988=_0x445988-0x0;var _0x2a2fd0=_0xe785[_0x445988];return _0x2a2fd0;};'use strict';var _=require(_0x5e78('0x0'));var util=require(_0x5e78('0x1'));var logger=require('../../config/logger')(_0x5e78('0x2'));var moment=require(_0x5e78('0x3'));var BPromise=require(_0x5e78('0x4'));var rp=require(_0x5e78('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5e78('0x6'));var attributes=require(_0x5e78('0x7'));module[_0x5e78('0x8')]=function(_0x135552,_0x502114){return _0x135552['define'](_0x5e78('0x9'),attributes,{'tableName':_0x5e78('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 64f68bb..bae9f9c 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 _0xfe7f=['request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s'];(function(_0x2be00b,_0x309873){var _0x2f7b52=function(_0x57759b){while(--_0x57759b){_0x2be00b['push'](_0x2be00b['shift']());}};_0x2f7b52(++_0x309873);}(_0xfe7f,0x1eb));var _0xffe7=function(_0x1d0f10,_0x4de9fb){_0x1d0f10=_0x1d0f10-0x0;var _0xa1dcaf=_0xfe7f[_0x1d0f10];return _0xa1dcaf;};'use strict';var _=require('lodash');var util=require(_0xffe7('0x0'));var moment=require(_0xffe7('0x1'));var BPromise=require(_0xffe7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xffe7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xffe7('0x4'));var logger=require(_0xffe7('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xffe7('0x6'));var client=jayson[_0xffe7('0x7')][_0xffe7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d84b9,_0x13a2cf,_0x189bb8){return new BPromise(function(_0x231656,_0x3f7894){return client[_0xffe7('0x9')](_0x1d84b9,_0x189bb8)[_0xffe7('0xa')](function(_0x5c13a8){logger[_0xffe7('0xb')](_0xffe7('0xc'),_0x13a2cf,_0xffe7('0xd'));logger[_0xffe7('0xe')](_0xffe7('0xf'),_0x13a2cf,_0xffe7('0xd'),JSON['stringify'](_0x5c13a8));if(_0x5c13a8['error']){if(_0x5c13a8[_0xffe7('0x10')][_0xffe7('0x11')]===0x1f4){logger[_0xffe7('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x13a2cf,_0x5c13a8['error']['message']);return _0x3f7894(_0x5c13a8[_0xffe7('0x10')][_0xffe7('0x12')]);}logger[_0xffe7('0x10')](_0xffe7('0xc'),_0x13a2cf,_0x5c13a8[_0xffe7('0x10')][_0xffe7('0x12')]);return _0x231656(_0x5c13a8['error'][_0xffe7('0x12')]);}else{logger[_0xffe7('0xb')]('UserSmsQueue,\x20%s,\x20%s',_0x13a2cf,'request\x20sent');_0x231656(_0x5c13a8[_0xffe7('0x13')][_0xffe7('0x12')]);}})[_0xffe7('0x14')](function(_0x1eab8c){logger[_0xffe7('0x10')](_0xffe7('0xc'),_0x13a2cf,_0x1eab8c);_0x3f7894(_0x1eab8c);});});} \ No newline at end of file +var _0xd4ec=['UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0xc20f22,_0x49698f){var _0x1535d5=function(_0x5ce3f3){while(--_0x5ce3f3){_0xc20f22['push'](_0xc20f22['shift']());}};_0x1535d5(++_0x49698f);}(_0xd4ec,0x11c));var _0xcd4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4ec[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcd4e('0x0'));var util=require(_0xcd4e('0x1'));var moment=require(_0xcd4e('0x2'));var BPromise=require(_0xcd4e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcd4e('0x4'));var db=require(_0xcd4e('0x5'))['db'];var utils=require(_0xcd4e('0x6'));var logger=require(_0xcd4e('0x7'))(_0xcd4e('0x8'));var config=require(_0xcd4e('0x9'));var jayson=require(_0xcd4e('0xa'));var client=jayson[_0xcd4e('0xb')][_0xcd4e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4c82ee,_0x3f69cf,_0x1dee18){return new BPromise(function(_0x5ad803,_0x1c6751){return client['request'](_0x4c82ee,_0x1dee18)[_0xcd4e('0xd')](function(_0x5e6db2){logger[_0xcd4e('0xe')](_0xcd4e('0xf'),_0x3f69cf,_0xcd4e('0x10'));logger[_0xcd4e('0x11')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x3f69cf,_0xcd4e('0x10'),JSON[_0xcd4e('0x12')](_0x5e6db2));if(_0x5e6db2[_0xcd4e('0x13')]){if(_0x5e6db2[_0xcd4e('0x13')][_0xcd4e('0x14')]===0x1f4){logger[_0xcd4e('0x13')](_0xcd4e('0xf'),_0x3f69cf,_0x5e6db2[_0xcd4e('0x13')][_0xcd4e('0x15')]);return _0x1c6751(_0x5e6db2[_0xcd4e('0x13')][_0xcd4e('0x15')]);}logger[_0xcd4e('0x13')](_0xcd4e('0xf'),_0x3f69cf,_0x5e6db2[_0xcd4e('0x13')][_0xcd4e('0x15')]);return _0x5ad803(_0x5e6db2[_0xcd4e('0x13')][_0xcd4e('0x15')]);}else{logger[_0xcd4e('0xe')]('UserSmsQueue,\x20%s,\x20%s',_0x3f69cf,_0xcd4e('0x10'));_0x5ad803(_0x5e6db2[_0xcd4e('0x16')][_0xcd4e('0x15')]);}})['catch'](function(_0x3b6f1a){logger[_0xcd4e('0x13')](_0xcd4e('0xf'),_0x3f69cf,_0x3b6f1a);_0x1c6751(_0x3b6f1a);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index 2388f60..580a5c3 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.attributes.js +++ b/server/api/userVoicePrefix/userVoicePrefix.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8240=['sequelize','INTEGER'];(function(_0x4b2873,_0x368dcc){var _0x169a18=function(_0x22f7ab){while(--_0x22f7ab){_0x4b2873['push'](_0x4b2873['shift']());}};_0x169a18(++_0x368dcc);}(_0x8240,0x124));var _0x0824=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0x8240[_0x31b5a5];return _0x364cc9;};'use strict';var Sequelize=require(_0x0824('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x0824('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x0824('0x1')]}}; \ No newline at end of file +var _0x5749=['INTEGER','sequelize'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x5749,0x109));var _0x9574=function(_0x509a3d,_0x2ffd62){_0x509a3d=_0x509a3d-0x0;var _0x7956a0=_0x5749[_0x509a3d];return _0x7956a0;};'use strict';var Sequelize=require(_0x9574('0x0'));module['exports']={'UserId':{'type':Sequelize[_0x9574('0x1')]},'VoicePrefixId':{'type':Sequelize[_0x9574('0x1')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index fd53baf..bb86fa5 100644 --- a/server/api/userVoicePrefix/userVoicePrefix.model.js +++ b/server/api/userVoicePrefix/userVoicePrefix.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x27827e,_0x5c842d){var _0x585ab3=function(_0x467637){while(--_0x467637){_0x27827e['push'](_0x27827e['shift']());}};_0x585ab3(++_0x5c842d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./userVoicePrefix.attributes','exports','define','UserVoicePrefix','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x391852,_0xb68420){var _0x58035a=function(_0x354a60){while(--_0x354a60){_0x391852['push'](_0x391852['shift']());}};_0x58035a(++_0xb68420);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'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':'user_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index a377e10..e782579 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x30c57f,_0x4e26ca){var _0x570756=function(_0xd1ee2e){while(--_0xd1ee2e){_0x30c57f['push'](_0x30c57f['shift']());}};_0x570756(++_0x4e26ca);}(_0x9c44,0x178));var _0x49c4=function(_0x2064e5,_0x4f6fa2){_0x2064e5=_0x2064e5-0x0;var _0x21a233=_0x9c44[_0x2064e5];return _0x21a233;};'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 fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x311aad,_0x54d658){var _0x1779bd=function(_0x2520fb){while(--_0x2520fb){_0x311aad['push'](_0x311aad['shift']());}};_0x1779bd(++_0x54d658);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index c5872c8..24c3f0d 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 _0x99fc=['INTEGER','sequelize'];(function(_0x2f0723,_0x3ecd67){var _0x34f47b=function(_0x155ad7){while(--_0x155ad7){_0x2f0723['push'](_0x2f0723['shift']());}};_0x34f47b(++_0x3ecd67);}(_0x99fc,0x1df));var _0xc99f=function(_0x7f038a,_0xcbf254){_0x7f038a=_0x7f038a-0x0;var _0x4cb3dd=_0x99fc[_0x7f038a];return _0x4cb3dd;};'use strict';var Sequelize=require(_0xc99f('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xc99f('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd2d6=['INTEGER','sequelize','exports'];(function(_0x842533,_0x312233){var _0x362b0c=function(_0x2131f1){while(--_0x2131f1){_0x842533['push'](_0x842533['shift']());}};_0x362b0c(++_0x312233);}(_0xd2d6,0xa3));var _0x6d2d=function(_0x4db079,_0x4a8d32){_0x4db079=_0x4db079-0x0;var _0x2adf36=_0xd2d6[_0x4db079];return _0x2adf36;};'use strict';var Sequelize=require(_0x6d2d('0x0'));module[_0x6d2d('0x1')]={'penalty':{'type':Sequelize[_0x6d2d('0x2')],'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 ee704c7..5b6bafd 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 _0xdf14=['UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','moment','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xdf14,0x162));var _0x4df1=function(_0x22d862,_0x37e96b){_0x22d862=_0x22d862-0x0;var _0x16def8=_0xdf14[_0x22d862];return _0x16def8;};'use strict';var _=require(_0x4df1('0x0'));var util=require(_0x4df1('0x1'));var logger=require(_0x4df1('0x2'))('api');var moment=require(_0x4df1('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4df1('0x4'));var config=require(_0x4df1('0x5'));var attributes=require(_0x4df1('0x6'));module[_0x4df1('0x7')]=function(_0x37c6df,_0x51f1b5){return _0x37c6df[_0x4df1('0x8')](_0x4df1('0x9'),attributes,{'tableName':_0x4df1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2853=['./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x250ed4,_0x9bb8b2){var _0x2c5a32=function(_0x5ec55d){while(--_0x5ec55d){_0x250ed4['push'](_0x250ed4['shift']());}};_0x2c5a32(++_0x9bb8b2);}(_0x2853,0x11d));var _0x3285=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0x2853[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x3285('0x0'));var util=require(_0x3285('0x1'));var logger=require(_0x3285('0x2'))(_0x3285('0x3'));var moment=require('moment');var BPromise=require(_0x3285('0x4'));var rp=require(_0x3285('0x5'));var fs=require('fs');var path=require(_0x3285('0x6'));var rimraf=require(_0x3285('0x7'));var config=require(_0x3285('0x8'));var attributes=require(_0x3285('0x9'));module[_0x3285('0xa')]=function(_0x13502d,_0x4b081f){return _0x13502d[_0x3285('0xb')](_0x3285('0xc'),attributes,{'tableName':_0x3285('0xd'),'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 82bf0f7..918ea48 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 _0x9ba9=['util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x5a0d75,_0x4ef5c2){var _0x37b4f9=function(_0x4fdda0){while(--_0x4fdda0){_0x5a0d75['push'](_0x5a0d75['shift']());}};_0x37b4f9(++_0x4ef5c2);}(_0x9ba9,0x190));var _0x99ba=function(_0x11a4d7,_0x55c864){_0x11a4d7=_0x11a4d7-0x0;var _0x64cbcf=_0x9ba9[_0x11a4d7];return _0x64cbcf;};'use strict';var _=require('lodash');var util=require(_0x99ba('0x0'));var moment=require(_0x99ba('0x1'));var BPromise=require(_0x99ba('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x99ba('0x3'));var logger=require(_0x99ba('0x4'))(_0x99ba('0x5'));var config=require(_0x99ba('0x6'));var jayson=require(_0x99ba('0x7'));var client=jayson[_0x99ba('0x8')][_0x99ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c7c18,_0x25e29a,_0x977814){return new BPromise(function(_0x3e592a,_0x1166e2){return client['request'](_0x1c7c18,_0x977814)[_0x99ba('0xa')](function(_0x2b32f4){logger[_0x99ba('0xb')](_0x99ba('0xc'),_0x25e29a,_0x99ba('0xd'));logger[_0x99ba('0xe')](_0x99ba('0xf'),_0x25e29a,_0x99ba('0xd'),JSON['stringify'](_0x2b32f4));if(_0x2b32f4['error']){if(_0x2b32f4[_0x99ba('0x10')]['code']===0x1f4){logger[_0x99ba('0x10')](_0x99ba('0xc'),_0x25e29a,_0x2b32f4['error'][_0x99ba('0x11')]);return _0x1166e2(_0x2b32f4[_0x99ba('0x10')][_0x99ba('0x11')]);}logger[_0x99ba('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x25e29a,_0x2b32f4[_0x99ba('0x10')]['message']);return _0x3e592a(_0x2b32f4[_0x99ba('0x10')]['message']);}else{logger['info'](_0x99ba('0xc'),_0x25e29a,'request\x20sent');_0x3e592a(_0x2b32f4[_0x99ba('0x12')][_0x99ba('0x11')]);}})[_0x99ba('0x13')](function(_0x5ce9ab){logger[_0x99ba('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x25e29a,_0x5ce9ab);_0x1166e2(_0x5ce9ab);});});} \ No newline at end of file +var _0xdf2f=['message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x404cde,_0x27b51c){var _0x139882=function(_0x1f31d1){while(--_0x1f31d1){_0x404cde['push'](_0x404cde['shift']());}};_0x139882(++_0x27b51c);}(_0xdf2f,0x10a));var _0xfdf2=function(_0x1d9540,_0x9707e0){_0x1d9540=_0x1d9540-0x0;var _0x1a9562=_0xdf2f[_0x1d9540];return _0x1a9562;};'use strict';var _=require(_0xfdf2('0x0'));var util=require(_0xfdf2('0x1'));var moment=require(_0xfdf2('0x2'));var BPromise=require('bluebird');var rs=require(_0xfdf2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfdf2('0x4'))['db'];var utils=require(_0xfdf2('0x5'));var logger=require(_0xfdf2('0x6'))(_0xfdf2('0x7'));var config=require(_0xfdf2('0x8'));var jayson=require(_0xfdf2('0x9'));var client=jayson[_0xfdf2('0xa')][_0xfdf2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2df402,_0x48ed88,_0x182812){return new BPromise(function(_0x43d289,_0x1f0600){return client[_0xfdf2('0xc')](_0x2df402,_0x182812)['then'](function(_0x21cde6){logger[_0xfdf2('0xd')](_0xfdf2('0xe'),_0x48ed88,'request\x20sent');logger[_0xfdf2('0xf')](_0xfdf2('0x10'),_0x48ed88,_0xfdf2('0x11'),JSON['stringify'](_0x21cde6));if(_0x21cde6[_0xfdf2('0x12')]){if(_0x21cde6[_0xfdf2('0x12')][_0xfdf2('0x13')]===0x1f4){logger[_0xfdf2('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x48ed88,_0x21cde6[_0xfdf2('0x12')]['message']);return _0x1f0600(_0x21cde6[_0xfdf2('0x12')]['message']);}logger[_0xfdf2('0x12')]('UserVoiceQueue,\x20%s,\x20%s',_0x48ed88,_0x21cde6[_0xfdf2('0x12')]['message']);return _0x43d289(_0x21cde6['error'][_0xfdf2('0x14')]);}else{logger['info'](_0xfdf2('0xe'),_0x48ed88,_0xfdf2('0x11'));_0x43d289(_0x21cde6[_0xfdf2('0x15')]['message']);}})['catch'](function(_0x133080){logger[_0xfdf2('0x12')](_0xfdf2('0xe'),_0x48ed88,_0x133080);_0x1f0600(_0x133080);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 0f5275e..eaad1e3 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x523671,_0x4657fc){var _0x5b0bdc=function(_0x301007){while(--_0x301007){_0x523671['push'](_0x523671['shift']());}};_0x5b0bdc(++_0x4657fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x227b67,_0x5c4075){var _0x16f616=function(_0x46e857){while(--_0x46e857){_0x227b67['push'](_0x227b67['shift']());}};_0x16f616(++_0x5c4075);}(_0x9c44,0x178));var _0x49c4=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x9c44[_0x465a0c];return _0x1e202e;};'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 fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 497f4ce..a718cfa 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 _0x8d6a=['exports','INTEGER','STRING','Required\x20by\x20Asterisk','queue_interface','sequelize'];(function(_0x5d407f,_0xae041c){var _0x3dbf71=function(_0x5f42c0){while(--_0x5f42c0){_0x5d407f['push'](_0x5d407f['shift']());}};_0x3dbf71(++_0xae041c);}(_0x8d6a,0x143));var _0xa8d6=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x8d6a[_0x56482c];return _0x5aae7a;};'use strict';var Sequelize=require(_0xa8d6('0x0'));module[_0xa8d6('0x1')]={'uniqueid':{'type':Sequelize[_0xa8d6('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0xa8d6('0x3')],'allowNull':![],'comment':_0xa8d6('0x4')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0xa8d6('0x3')],'allowNull':![],'unique':_0xa8d6('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0xa8d6('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xa8d6('0x3')],'allowNull':![],'unique':_0xa8d6('0x5'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xa8d6('0x4')},'paused':{'type':Sequelize[_0xa8d6('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x02e4=['Required\x20by\x20Asterisk','INTEGER','queue_interface','sequelize','exports','STRING'];(function(_0x537d07,_0x420ce4){var _0x11065f=function(_0x332a48){while(--_0x332a48){_0x537d07['push'](_0x537d07['shift']());}};_0x11065f(++_0x420ce4);}(_0x02e4,0xb1));var _0x402e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x02e4[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x402e('0x0'));module[_0x402e('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x402e('0x2')],'allowNull':![],'comment':_0x402e('0x3')},'UserId':{'type':Sequelize[_0x402e('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x402e('0x5'),'comment':_0x402e('0x3')},'VoiceQueueId':{'type':Sequelize[_0x402e('0x4')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x402e('0x5'),'comment':_0x402e('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x402e('0x3')},'paused':{'type':Sequelize[_0x402e('0x4')](0xb),'defaultValue':0x0,'comment':_0x402e('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index e9a21d3..331ec0e 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 _0xed50=['UserVoiceQueueRt','setMaxListeners','update','remove','emit','hook','events','../../mysqldb'];(function(_0x35f191,_0x1ff4ad){var _0x42ade7=function(_0x3c0b1d){while(--_0x3c0b1d){_0x35f191['push'](_0x35f191['shift']());}};_0x42ade7(++_0x1ff4ad);}(_0xed50,0x1a6));var _0x0ed5=function(_0x1b7368,_0x3286ed){_0x1b7368=_0x1b7368-0x0;var _0x25d54c=_0xed50[_0x1b7368];return _0x25d54c;};'use strict';var EventEmitter=require(_0x0ed5('0x0'));var UserVoiceQueueRt=require(_0x0ed5('0x1'))['db'][_0x0ed5('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x0ed5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0ed5('0x4'),'afterDestroy':_0x0ed5('0x5')};function emitEvent(_0x31244f){return function(_0x200229,_0x523874,_0x2e2b6f){UserVoiceQueueRtEvents[_0x0ed5('0x6')](_0x31244f+':'+_0x200229['id'],_0x200229);UserVoiceQueueRtEvents['emit'](_0x31244f,_0x200229);_0x2e2b6f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x0ed5('0x7')](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x85fa=['hasOwnProperty','hook','exports','events','UserVoiceQueueRt','setMaxListeners','save','emit'];(function(_0x152e06,_0x256cc3){var _0xd97283=function(_0x224794){while(--_0x224794){_0x152e06['push'](_0x152e06['shift']());}};_0xd97283(++_0x256cc3);}(_0x85fa,0xab));var _0xa85f=function(_0x43131d,_0x2db0c4){_0x43131d=_0x43131d-0x0;var _0x27918b=_0x85fa[_0x43131d];return _0x27918b;};'use strict';var EventEmitter=require(_0xa85f('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0xa85f('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xa85f('0x2')](0x0);var events={'afterCreate':_0xa85f('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4f5de5){return function(_0x1e8c00,_0x2682fd,_0x2a1fa1){UserVoiceQueueRtEvents['emit'](_0x4f5de5+':'+_0x1e8c00['id'],_0x1e8c00);UserVoiceQueueRtEvents[_0xa85f('0x4')](_0x4f5de5,_0x1e8c00);_0x2a1fa1(null);};}for(var e in events){if(events[_0xa85f('0x5')](e)){var event=events[e];UserVoiceQueueRt[_0xa85f('0x6')](e,emitEvent(event));}}module[_0xa85f('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 d7bfbd8..ddd44f3 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 _0xf7df=['bluebird','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','util','../../config/logger','moment'];(function(_0x20520f,_0x4bf423){var _0xf893fd=function(_0x35f8dc){while(--_0x35f8dc){_0x20520f['push'](_0x20520f['shift']());}};_0xf893fd(++_0x4bf423);}(_0xf7df,0x1d1));var _0xff7d=function(_0x2628fd,_0x1e3921){_0x2628fd=_0x2628fd-0x0;var _0x3763ed=_0xf7df[_0x2628fd];return _0x3763ed;};'use strict';var _=require('lodash');var util=require(_0xff7d('0x0'));var logger=require(_0xff7d('0x1'))('api');var moment=require(_0xff7d('0x2'));var BPromise=require(_0xff7d('0x3'));var rp=require(_0xff7d('0x4'));var fs=require('fs');var path=require(_0xff7d('0x5'));var rimraf=require('rimraf');var config=require(_0xff7d('0x6'));var attributes=require(_0xff7d('0x7'));module[_0xff7d('0x8')]=function(_0x78f2ea,_0x3fb1b0){return _0x78f2ea[_0xff7d('0x9')](_0xff7d('0xa'),attributes,{'tableName':_0xff7d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e4b=['define','UserVoiceQueueRt','user_has_voice_queues_rt','../../config/logger','api','moment','path','rimraf','exports'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x3e4b,0x108));var _0xb3e4=function(_0x3d5888,_0xb25af2){_0x3d5888=_0x3d5888-0x0;var _0x3f9206=_0x3e4b[_0x3d5888];return _0x3f9206;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb3e4('0x0'))(_0xb3e4('0x1'));var moment=require(_0xb3e4('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb3e4('0x3'));var rimraf=require(_0xb3e4('0x4'));var config=require('../../config/environment');var attributes=require('./userVoiceQueueRt.attributes');module[_0xb3e4('0x5')]=function(_0x106ef0,_0x54928e){return _0x106ef0[_0xb3e4('0x6')](_0xb3e4('0x7'),attributes,{'tableName':_0xb3e4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.rpc.js index 60218eb..bd8d96e 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 _0x2553=['then','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','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./userVoiceQueueRt.socket','register','request'];(function(_0xd6ca7,_0xf8aca2){var _0x5f269f=function(_0x1c58b9){while(--_0x1c58b9){_0xd6ca7['push'](_0xd6ca7['shift']());}};_0x5f269f(++_0xf8aca2);}(_0x2553,0xfa));var _0x3255=function(_0x4adfa4,_0x121c5a){_0x4adfa4=_0x4adfa4-0x0;var _0x14cec1=_0x2553[_0x4adfa4];return _0x14cec1;};'use strict';var _=require(_0x3255('0x0'));var util=require('util');var moment=require(_0x3255('0x1'));var BPromise=require(_0x3255('0x2'));var rs=require(_0x3255('0x3'));var fs=require('fs');var Redis=require(_0x3255('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3255('0x5'))('rpc');var config=require(_0x3255('0x6'));var jayson=require(_0x3255('0x7'));var client=jayson[_0x3255('0x8')][_0x3255('0x9')]({'port':0x232a});config['redis']=_[_0x3255('0xa')](config['redis'],{'host':_0x3255('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3255('0xc')]));require(_0x3255('0xd'))[_0x3255('0xe')](socket);function respondWithRpcPromise(_0xc58677,_0x4fb06f,_0x2d8784){return new BPromise(function(_0x4e607e,_0x5a7d20){return client[_0x3255('0xf')](_0xc58677,_0x2d8784)[_0x3255('0x10')](function(_0x456596){logger[_0x3255('0x11')](_0x3255('0x12'),_0x4fb06f,'request\x20sent');logger[_0x3255('0x13')](_0x3255('0x14'),_0x4fb06f,'request\x20sent',JSON[_0x3255('0x15')](_0x456596));if(_0x456596[_0x3255('0x16')]){if(_0x456596['error'][_0x3255('0x17')]===0x1f4){logger['error'](_0x3255('0x12'),_0x4fb06f,_0x456596[_0x3255('0x16')][_0x3255('0x18')]);return _0x5a7d20(_0x456596['error'][_0x3255('0x18')]);}logger[_0x3255('0x16')](_0x3255('0x12'),_0x4fb06f,_0x456596[_0x3255('0x16')]['message']);return _0x4e607e(_0x456596[_0x3255('0x16')][_0x3255('0x18')]);}else{logger['info'](_0x3255('0x12'),_0x4fb06f,_0x3255('0x19'));_0x4e607e(_0x456596['result']['message']);}})[_0x3255('0x1a')](function(_0x5e6791){logger[_0x3255('0x16')](_0x3255('0x12'),_0x4fb06f,_0x5e6791);_0x5a7d20(_0x5e6791);});});}exports[_0x3255('0x1b')]=function(_0x3a45b7){var _0x48a551=this;return new Promise(function(_0x2a868e,_0x259222){return db[_0x3255('0x1c')][_0x3255('0x1d')]({'raw':_0x3a45b7[_0x3255('0x1e')]?_0x3a45b7[_0x3255('0x1e')][_0x3255('0x1f')]===undefined?!![]:![]:!![],'where':_0x3a45b7['options']?_0x3a45b7[_0x3255('0x1e')][_0x3255('0x20')]||null:null,'attributes':[[db[_0x3255('0x21')]['fn'](_0x3255('0x22'),db[_0x3255('0x21')]['fn']('IF',db[_0x3255('0x21')][_0x3255('0x23')](_0x3255('0x24')))),_0x3255('0x25')]]})[_0x3255('0x10')](function(_0x539299){logger[_0x3255('0x11')](_0x3255('0x1b'),_0x3a45b7);logger['debug']('GetVoiceQueueRtPauses',_0x3a45b7,JSON[_0x3255('0x15')](_0x539299));_0x2a868e(_0x539299);})[_0x3255('0x1a')](function(_0x18ea81){logger[_0x3255('0x16')](_0x3255('0x1b'),_0x18ea81[_0x3255('0x18')],_0x3a45b7);_0x259222(_0x48a551['error'](0x1f4,_0x18ea81[_0x3255('0x18')]));});});}; \ No newline at end of file +var _0x1bde=['result','catch','GetVoiceQueueRtPauses','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','./userVoiceQueueRt.socket','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x4c6494,_0x3f802c){var _0x24f2e3=function(_0x5b3cbd){while(--_0x5b3cbd){_0x4c6494['push'](_0x4c6494['shift']());}};_0x24f2e3(++_0x3f802c);}(_0x1bde,0x10e));var _0xe1bd=function(_0x360ec,_0x585d47){_0x360ec=_0x360ec-0x0;var _0xf03953=_0x1bde[_0x360ec];return _0xf03953;};'use strict';var _=require(_0xe1bd('0x0'));var util=require(_0xe1bd('0x1'));var moment=require(_0xe1bd('0x2'));var BPromise=require(_0xe1bd('0x3'));var rs=require(_0xe1bd('0x4'));var fs=require('fs');var Redis=require(_0xe1bd('0x5'));var db=require(_0xe1bd('0x6'))['db'];var utils=require(_0xe1bd('0x7'));var logger=require(_0xe1bd('0x8'))('rpc');var config=require(_0xe1bd('0x9'));var jayson=require(_0xe1bd('0xa'));var client=jayson['client'][_0xe1bd('0xb')]({'port':0x232a});config[_0xe1bd('0xc')]=_[_0xe1bd('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xe1bd('0xe'))(new Redis(config[_0xe1bd('0xc')]));require(_0xe1bd('0xf'))['register'](socket);function respondWithRpcPromise(_0x405edc,_0x256c19,_0x55c721){return new BPromise(function(_0x22a5e5,_0x32dedd){return client[_0xe1bd('0x10')](_0x405edc,_0x55c721)[_0xe1bd('0x11')](function(_0x32941e){logger[_0xe1bd('0x12')](_0xe1bd('0x13'),_0x256c19,_0xe1bd('0x14'));logger[_0xe1bd('0x15')](_0xe1bd('0x16'),_0x256c19,'request\x20sent',JSON[_0xe1bd('0x17')](_0x32941e));if(_0x32941e[_0xe1bd('0x18')]){if(_0x32941e['error']['code']===0x1f4){logger[_0xe1bd('0x18')](_0xe1bd('0x13'),_0x256c19,_0x32941e[_0xe1bd('0x18')][_0xe1bd('0x19')]);return _0x32dedd(_0x32941e['error'][_0xe1bd('0x19')]);}logger[_0xe1bd('0x18')](_0xe1bd('0x13'),_0x256c19,_0x32941e[_0xe1bd('0x18')]['message']);return _0x22a5e5(_0x32941e[_0xe1bd('0x18')][_0xe1bd('0x19')]);}else{logger[_0xe1bd('0x12')](_0xe1bd('0x13'),_0x256c19,_0xe1bd('0x14'));_0x22a5e5(_0x32941e[_0xe1bd('0x1a')][_0xe1bd('0x19')]);}})[_0xe1bd('0x1b')](function(_0x4c8035){logger['error'](_0xe1bd('0x13'),_0x256c19,_0x4c8035);_0x32dedd(_0x4c8035);});});}exports[_0xe1bd('0x1c')]=function(_0x41e1e4){var _0xc8b918=this;return new Promise(function(_0x20bd98,_0x520c6e){return db['UserVoiceQueueRt'][_0xe1bd('0x1d')]({'raw':_0x41e1e4[_0xe1bd('0x1e')]?_0x41e1e4['options'][_0xe1bd('0x1f')]===undefined?!![]:![]:!![],'where':_0x41e1e4[_0xe1bd('0x1e')]?_0x41e1e4[_0xe1bd('0x1e')][_0xe1bd('0x20')]||null:null,'attributes':[[db[_0xe1bd('0x21')]['fn'](_0xe1bd('0x22'),db[_0xe1bd('0x21')]['fn']('IF',db[_0xe1bd('0x21')][_0xe1bd('0x23')](_0xe1bd('0x24')))),'outboundQueuePauses']]})[_0xe1bd('0x11')](function(_0x4861a1){logger[_0xe1bd('0x12')](_0xe1bd('0x1c'),_0x41e1e4);logger[_0xe1bd('0x15')](_0xe1bd('0x1c'),_0x41e1e4,JSON['stringify'](_0x4861a1));_0x20bd98(_0x4861a1);})[_0xe1bd('0x1b')](function(_0x121482){logger[_0xe1bd('0x18')](_0xe1bd('0x1c'),_0x121482[_0xe1bd('0x19')],_0x41e1e4);_0x520c6e(_0xc8b918[_0xe1bd('0x18')](0x1f4,_0x121482[_0xe1bd('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 19d9cb9..8f7a3e3 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 _0xd307=['./userVoiceQueueRt.events','save','remove','update','emit','removeListener','length','userVoiceQueueRt:'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xd307,0x110));var _0x7d30=function(_0x2ba4e9,_0x5cdea4){_0x2ba4e9=_0x2ba4e9-0x0;var _0x36ea64=_0xd307[_0x2ba4e9];return _0x36ea64;};'use strict';var UserVoiceQueueRtEvents=require(_0x7d30('0x0'));var events=[_0x7d30('0x1'),_0x7d30('0x2'),_0x7d30('0x3')];function createListener(_0x2917cd,_0x3c6f99){return function(_0x359ef3){_0x3c6f99[_0x7d30('0x4')](_0x2917cd,_0x359ef3);};}function removeListener(_0x57cf6e,_0x2a0bb8){return function(){UserVoiceQueueRtEvents[_0x7d30('0x5')](_0x57cf6e,_0x2a0bb8);};}exports['register']=function(_0x400916){for(var _0x449938=0x0,_0x9451ed=events[_0x7d30('0x6')];_0x449938<_0x9451ed;_0x449938++){var _0x43b35e=events[_0x449938];var _0x1ef3e7=createListener(_0x7d30('0x7')+_0x43b35e,_0x400916);UserVoiceQueueRtEvents['on'](_0x43b35e,_0x1ef3e7);}}; \ No newline at end of file +var _0xed1f=['removeListener','register','length','./userVoiceQueueRt.events','save'];(function(_0x11bffb,_0x2c2729){var _0x390a69=function(_0x23cdda){while(--_0x23cdda){_0x11bffb['push'](_0x11bffb['shift']());}};_0x390a69(++_0x2c2729);}(_0xed1f,0x170));var _0xfed1=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xed1f[_0x40a045];return _0x1a687c;};'use strict';var UserVoiceQueueRtEvents=require(_0xfed1('0x0'));var events=[_0xfed1('0x1'),'remove','update'];function createListener(_0x2c9577,_0x5c56c8){return function(_0x36764e){_0x5c56c8['emit'](_0x2c9577,_0x36764e);};}function removeListener(_0x444ba8,_0x423af3){return function(){UserVoiceQueueRtEvents[_0xfed1('0x2')](_0x444ba8,_0x423af3);};}exports[_0xfed1('0x3')]=function(_0x465671){for(var _0x1f2391=0x0,_0x471095=events[_0xfed1('0x4')];_0x1f2391<_0x471095;_0x1f2391++){var _0x4e7fe7=events[_0x1f2391];var _0x37565a=createListener('userVoiceQueueRt:'+_0x4e7fe7,_0x465671);UserVoiceQueueRtEvents['on'](_0x4e7fe7,_0x37565a);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index 07a4d25..929eb39 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0xc27fe1,_0x1f51ba){var _0xde1ffc=function(_0x1421bb){while(--_0x1421bb){_0xc27fe1['push'](_0xc27fe1['shift']());}};_0xde1ffc(++_0x1f51ba);}(_0xedd9,0xfc));var _0x9edd=function(_0x281ad6,_0x4e02f8){_0x281ad6=_0x281ad6-0x0;var _0x73f177=_0xedd9[_0x281ad6];return _0x73f177;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x562eea,_0x1f9ea7){var _0x39caf9=function(_0x14f022){while(--_0x14f022){_0x562eea['push'](_0x562eea['shift']());}};_0x39caf9(++_0x1f9ea7);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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 fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 43a80ef..a7aca68 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfc76=['INTEGER','exports'];(function(_0x189963,_0x319152){var _0x4d94e7=function(_0x18b744){while(--_0x18b744){_0x189963['push'](_0x189963['shift']());}};_0x4d94e7(++_0x319152);}(_0xfc76,0xb5));var _0x6fc7=function(_0x264444,_0x3a51d6){_0x264444=_0x264444-0x0;var _0x937f30=_0xfc76[_0x264444];return _0x937f30;};'use strict';var Sequelize=require('sequelize');module[_0x6fc7('0x0')]={'penalty':{'type':Sequelize[_0x6fc7('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd928=['exports'];(function(_0x500211,_0x1a0367){var _0x48f4e0=function(_0x47a67e){while(--_0x47a67e){_0x500211['push'](_0x500211['shift']());}};_0x48f4e0(++_0x1a0367);}(_0xd928,0x85));var _0x8d92=function(_0x584931,_0x728803){_0x584931=_0x584931-0x0;var _0x73524f=_0xd928[_0x584931];return _0x73524f;};'use strict';var Sequelize=require('sequelize');module[_0x8d92('0x0')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 6f3d69b..54a9dc1 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.model.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d06=['request-promise','path','rimraf','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','lodash','api','moment'];(function(_0x5a67ed,_0xb5fff7){var _0x4b59e3=function(_0x3bd063){while(--_0x3bd063){_0x5a67ed['push'](_0x5a67ed['shift']());}};_0x4b59e3(++_0xb5fff7);}(_0x0d06,0x1d1));var _0x60d0=function(_0x559aab,_0x4b7dc4){_0x559aab=_0x559aab-0x0;var _0x5e5801=_0x0d06[_0x559aab];return _0x5e5801;};'use strict';var _=require(_0x60d0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x60d0('0x1'));var moment=require(_0x60d0('0x2'));var BPromise=require('bluebird');var rp=require(_0x60d0('0x3'));var fs=require('fs');var path=require(_0x60d0('0x4'));var rimraf=require(_0x60d0('0x5'));var config=require('../../config/environment');var attributes=require(_0x60d0('0x6'));module[_0x60d0('0x7')]=function(_0x31151f,_0x3cad37){return _0x31151f['define'](_0x60d0('0x8'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0077=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','define','UserWhatsappQueue','user_has_whatsapp_queues','lodash','util'];(function(_0x4f340b,_0x20bc7b){var _0x560a58=function(_0x4df030){while(--_0x4df030){_0x4f340b['push'](_0x4f340b['shift']());}};_0x560a58(++_0x20bc7b);}(_0x0077,0x166));var _0x7007=function(_0x4235ee,_0x4eea6d){_0x4235ee=_0x4235ee-0x0;var _0xaae9f2=_0x0077[_0x4235ee];return _0xaae9f2;};'use strict';var _=require(_0x7007('0x0'));var util=require(_0x7007('0x1'));var logger=require(_0x7007('0x2'))(_0x7007('0x3'));var moment=require(_0x7007('0x4'));var BPromise=require(_0x7007('0x5'));var rp=require(_0x7007('0x6'));var fs=require('fs');var path=require(_0x7007('0x7'));var rimraf=require(_0x7007('0x8'));var config=require(_0x7007('0x9'));var attributes=require(_0x7007('0xa'));module[_0x7007('0xb')]=function(_0x4c0789,_0x370a5e){return _0x4c0789[_0x7007('0xc')](_0x7007('0xd'),attributes,{'tableName':_0x7007('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index cdc71ac..1c8610e 100644 --- a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js +++ b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xae5b=['error','message','UserWhatsappQueue,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','info','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4f6ad2,_0x5f36c8){var _0x358b3a=function(_0x5c694a){while(--_0x5c694a){_0x4f6ad2['push'](_0x4f6ad2['shift']());}};_0x358b3a(++_0x5f36c8);}(_0xae5b,0x1d2));var _0xbae5=function(_0x4ecb49,_0x432e82){_0x4ecb49=_0x4ecb49-0x0;var _0x50a24c=_0xae5b[_0x4ecb49];return _0x50a24c;};'use strict';var _=require(_0xbae5('0x0'));var util=require(_0xbae5('0x1'));var moment=require(_0xbae5('0x2'));var BPromise=require(_0xbae5('0x3'));var rs=require(_0xbae5('0x4'));var fs=require('fs');var Redis=require(_0xbae5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbae5('0x6'));var logger=require(_0xbae5('0x7'))(_0xbae5('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbae5('0x9')][_0xbae5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xcffe25,_0x305819,_0x4b78fd){return new BPromise(function(_0x4a207e,_0x295024){return client[_0xbae5('0xb')](_0xcffe25,_0x4b78fd)[_0xbae5('0xc')](function(_0x199984){logger[_0xbae5('0xd')]('UserWhatsappQueue,\x20%s,\x20%s',_0x305819,'request\x20sent');logger[_0xbae5('0xe')](_0xbae5('0xf'),_0x305819,_0xbae5('0x10'),JSON[_0xbae5('0x11')](_0x199984));if(_0x199984[_0xbae5('0x12')]){if(_0x199984['error']['code']===0x1f4){logger[_0xbae5('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x305819,_0x199984[_0xbae5('0x12')][_0xbae5('0x13')]);return _0x295024(_0x199984[_0xbae5('0x12')][_0xbae5('0x13')]);}logger[_0xbae5('0x12')]('UserWhatsappQueue,\x20%s,\x20%s',_0x305819,_0x199984[_0xbae5('0x12')][_0xbae5('0x13')]);return _0x4a207e(_0x199984[_0xbae5('0x12')][_0xbae5('0x13')]);}else{logger[_0xbae5('0xd')](_0xbae5('0x14'),_0x305819,_0xbae5('0x10'));_0x4a207e(_0x199984['result'][_0xbae5('0x13')]);}})[_0xbae5('0x15')](function(_0x203885){logger[_0xbae5('0x12')](_0xbae5('0x14'),_0x305819,_0x203885);_0x295024(_0x203885);});});} \ No newline at end of file +var _0x9c88=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','error','code','UserWhatsappQueue,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x9c88,0x1b5));var _0x89c8=function(_0x21d6fa,_0x5e623a){_0x21d6fa=_0x21d6fa-0x0;var _0x405b62=_0x9c88[_0x21d6fa];return _0x405b62;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x89c8('0x0'));var BPromise=require(_0x89c8('0x1'));var rs=require(_0x89c8('0x2'));var fs=require('fs');var Redis=require(_0x89c8('0x3'));var db=require(_0x89c8('0x4'))['db'];var utils=require(_0x89c8('0x5'));var logger=require('../../config/logger')(_0x89c8('0x6'));var config=require('../../config/environment');var jayson=require(_0x89c8('0x7'));var client=jayson[_0x89c8('0x8')][_0x89c8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ce4ba,_0x14ddf6,_0x4ccbde){return new BPromise(function(_0x463a19,_0x3d827c){return client[_0x89c8('0xa')](_0x3ce4ba,_0x4ccbde)[_0x89c8('0xb')](function(_0x276b71){logger[_0x89c8('0xc')]('UserWhatsappQueue,\x20%s,\x20%s',_0x14ddf6,_0x89c8('0xd'));logger[_0x89c8('0xe')](_0x89c8('0xf'),_0x14ddf6,_0x89c8('0xd'),JSON['stringify'](_0x276b71));if(_0x276b71[_0x89c8('0x10')]){if(_0x276b71[_0x89c8('0x10')][_0x89c8('0x11')]===0x1f4){logger[_0x89c8('0x10')](_0x89c8('0x12'),_0x14ddf6,_0x276b71[_0x89c8('0x10')][_0x89c8('0x13')]);return _0x3d827c(_0x276b71['error']['message']);}logger[_0x89c8('0x10')](_0x89c8('0x12'),_0x14ddf6,_0x276b71[_0x89c8('0x10')][_0x89c8('0x13')]);return _0x463a19(_0x276b71[_0x89c8('0x10')][_0x89c8('0x13')]);}else{logger['info'](_0x89c8('0x12'),_0x14ddf6,'request\x20sent');_0x463a19(_0x276b71[_0x89c8('0x14')][_0x89c8('0x13')]);}})[_0x89c8('0x15')](function(_0x536da6){logger[_0x89c8('0x10')](_0x89c8('0x12'),_0x14ddf6,_0x536da6);_0x3d827c(_0x536da6);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 7592ba3..755bdca 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 _0xcf1c=['destroy','multer','util','connect-timeout','express','Router','fs-extra','./variable.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete'];(function(_0x245095,_0x512248){var _0x411cce=function(_0x5820ea){while(--_0x5820ea){_0x245095['push'](_0x245095['shift']());}};_0x411cce(++_0x512248);}(_0xcf1c,0x18d));var _0xccf1=function(_0x161341,_0x1c054d){_0x161341=_0x161341-0x0;var _0x5e06c3=_0xcf1c[_0x161341];return _0x5e06c3;};'use strict';var multer=require(_0xccf1('0x0'));var util=require(_0xccf1('0x1'));var path=require('path');var timeout=require(_0xccf1('0x2'));var express=require(_0xccf1('0x3'));var router=express[_0xccf1('0x4')]();var fs_extra=require(_0xccf1('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xccf1('0x6'));router['get']('/',auth[_0xccf1('0x7')](),controller[_0xccf1('0x8')]);router[_0xccf1('0x9')](_0xccf1('0xa'),auth[_0xccf1('0x7')](),controller[_0xccf1('0xb')]);router[_0xccf1('0xc')]('/',auth[_0xccf1('0x7')](),controller[_0xccf1('0xd')]);router[_0xccf1('0xe')](_0xccf1('0xa'),auth[_0xccf1('0x7')](),controller[_0xccf1('0xf')]);router[_0xccf1('0x10')](_0xccf1('0xa'),auth[_0xccf1('0x7')](),controller[_0xccf1('0x11')]);module['exports']=router; \ No newline at end of file +var _0x8255=['multer','util','path','connect-timeout','express','Router','fs-extra','./variable.controller','get','isAuthenticated','index','/:id','create','put','update','delete','destroy'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x8255,0x176));var _0x5825=function(_0x111544,_0x1b55ef){_0x111544=_0x111544-0x0;var _0x5d8d1d=_0x8255[_0x111544];return _0x5d8d1d;};'use strict';var multer=require(_0x5825('0x0'));var util=require(_0x5825('0x1'));var path=require(_0x5825('0x2'));var timeout=require(_0x5825('0x3'));var express=require(_0x5825('0x4'));var router=express[_0x5825('0x5')]();var fs_extra=require(_0x5825('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x5825('0x7'));router[_0x5825('0x8')]('/',auth[_0x5825('0x9')](),controller[_0x5825('0xa')]);router[_0x5825('0x8')](_0x5825('0xb'),auth[_0x5825('0x9')](),controller['show']);router['post']('/',auth[_0x5825('0x9')](),controller[_0x5825('0xc')]);router[_0x5825('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x5825('0xe')]);router[_0x5825('0xf')]('/:id',auth[_0x5825('0x9')](),controller[_0x5825('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 54f7501..fcef0b1 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 _0x2881=['name','sequelize','exports','STRING'];(function(_0x28407a,_0x2a7269){var _0x8bd6ef=function(_0x3c886f){while(--_0x3c886f){_0x28407a['push'](_0x28407a['shift']());}};_0x8bd6ef(++_0x2a7269);}(_0x2881,0x1f1));var _0x1288=function(_0x4201a4,_0x347560){_0x4201a4=_0x4201a4-0x0;var _0x2ffadd=_0x2881[_0x4201a4];return _0x2ffadd;};'use strict';var Sequelize=require(_0x1288('0x0'));module[_0x1288('0x1')]={'name':{'type':Sequelize[_0x1288('0x2')],'unique':_0x1288('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1288('0x2')]}}; \ No newline at end of file +var _0x3e03=['sequelize','exports'];(function(_0x5566ff,_0xd9a33){var _0x126605=function(_0x3a1b27){while(--_0x3a1b27){_0x5566ff['push'](_0x5566ff['shift']());}};_0x126605(++_0xd9a33);}(_0x3e03,0xc2));var _0x33e0=function(_0x415260,_0x135fcb){_0x415260=_0x415260-0x0;var _0x490f21=_0x3e03[_0x415260];return _0x490f21;};'use strict';var Sequelize=require(_0x33e0('0x0'));module[_0x33e0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 2e64d89..fb65411 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 _0xe134=['then','destroy','get','Variables','UserProfileResource','sendStatus','error','stack','name','send','index','map','Variable','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update'];(function(_0x3a7bb2,_0x4d9a9b){var _0x138ef1=function(_0x19bdd6){while(--_0x19bdd6){_0x3a7bb2['push'](_0x3a7bb2['shift']());}};_0x138ef1(++_0x4d9a9b);}(_0xe134,0x122));var _0x4e13=function(_0x595c8e,_0x394e77){_0x595c8e=_0x595c8e-0x0;var _0x3087b1=_0xe134[_0x595c8e];return _0x3087b1;};'use strict';var emlformat=require(_0x4e13('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4e13('0x1'));var jsonpatch=require(_0x4e13('0x2'));var rp=require(_0x4e13('0x3'));var moment=require(_0x4e13('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4e13('0x5'));var path=require(_0x4e13('0x6'));var sox=require('sox');var csv=require(_0x4e13('0x7'));var ejs=require(_0x4e13('0x8'));var fs=require('fs');var fs_extra=require(_0x4e13('0x9'));var _=require(_0x4e13('0xa'));var squel=require(_0x4e13('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4e13('0xc'));var toCsv=require(_0x4e13('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4e13('0xd'));var authService=require(_0x4e13('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4e13('0xf'));var logger=require(_0x4e13('0x10'))(_0x4e13('0x11'));var utils=require(_0x4e13('0x12'));var config=require(_0x4e13('0x13'));var licenseUtil=require(_0x4e13('0x14'));var db=require(_0x4e13('0x15'))['db'];function respondWithStatusCode(_0x295dfb,_0x3cb5a7){_0x3cb5a7=_0x3cb5a7||0xcc;return function(_0x72ceab){if(_0x72ceab){return _0x295dfb['sendStatus'](_0x3cb5a7);}return _0x295dfb['status'](_0x3cb5a7)[_0x4e13('0x16')]();};}function respondWithResult(_0x1ebfac,_0x4f73e4){_0x4f73e4=_0x4f73e4||0xc8;return function(_0x5b8a4d){if(_0x5b8a4d){return _0x1ebfac[_0x4e13('0x17')](_0x4f73e4)['json'](_0x5b8a4d);}};}function respondWithFilteredResult(_0x4423c1,_0x2ae2f4){return function(_0xc8e21c){if(_0xc8e21c){var _0x177d22=typeof _0x2ae2f4[_0x4e13('0x18')]===_0x4e13('0x19')&&typeof _0x2ae2f4[_0x4e13('0x1a')]==='undefined';var _0x56b769=_0xc8e21c['count'];var _0x3e0c7e=_0x177d22?0x0:_0x2ae2f4['offset'];var _0x3ef929=_0x177d22?_0xc8e21c[_0x4e13('0x1b')]:_0x2ae2f4['offset']+_0x2ae2f4[_0x4e13('0x1a')];var _0x54c9a8;if(_0x3ef929>=_0x56b769){_0x3ef929=_0x56b769;_0x54c9a8=0xc8;}else{_0x54c9a8=0xce;}_0x4423c1[_0x4e13('0x17')](_0x54c9a8);return _0x4423c1[_0x4e13('0x1c')](_0x4e13('0x1d'),_0x3e0c7e+'-'+_0x3ef929+'/'+_0x56b769)['json'](_0xc8e21c);}return null;};}function patchUpdates(_0x5d206e){return function(_0x48b48d){try{jsonpatch[_0x4e13('0x1e')](_0x48b48d,_0x5d206e,!![]);}catch(_0x460753){return BPromise[_0x4e13('0x1f')](_0x460753);}return _0x48b48d[_0x4e13('0x20')]();};}function saveUpdates(_0x26bfd,_0x2271af){return function(_0x43b1e9){if(_0x43b1e9){return _0x43b1e9[_0x4e13('0x21')](_0x26bfd)[_0x4e13('0x22')](function(_0x52bf73){return _0x52bf73;});}return null;};}function removeEntity(_0xf05bc0,_0x4279ec){return function(_0x68aad5){if(_0x68aad5){return _0x68aad5[_0x4e13('0x23')]()[_0x4e13('0x22')](function(){var _0x51aa82=_0x68aad5[_0x4e13('0x24')]({'plain':!![]});var _0x4b5734=_0x4e13('0x25');return db[_0x4e13('0x26')][_0x4e13('0x23')]({'where':{'type':_0x4b5734,'resourceId':_0x51aa82['id']}})[_0x4e13('0x22')](function(){return _0x68aad5;});})[_0x4e13('0x22')](function(){_0xf05bc0[_0x4e13('0x17')](0xcc)[_0x4e13('0x16')]();});}};}function handleEntityNotFound(_0x2cdd4b,_0x38aa27){return function(_0xcfb98c){if(!_0xcfb98c){_0x2cdd4b[_0x4e13('0x27')](0x194);}return _0xcfb98c;};}function handleError(_0x42d50c,_0x4927bb){_0x4927bb=_0x4927bb||0x1f4;return function(_0x1c3fdb){logger[_0x4e13('0x28')](_0x1c3fdb[_0x4e13('0x29')]);if(_0x1c3fdb[_0x4e13('0x2a')]){delete _0x1c3fdb['name'];}_0x42d50c[_0x4e13('0x17')](_0x4927bb)[_0x4e13('0x2b')](_0x1c3fdb);};}exports[_0x4e13('0x2c')]=function(_0x1ec73a,_0x33e7d4){var _0x584e1c={},_0x3b04eb={},_0x2dfab3={'count':0x0,'rows':[]};var _0x189ae0=_[_0x4e13('0x2d')](db[_0x4e13('0x2e')]['rawAttributes'],function(_0x1d00bb){return{'name':_0x1d00bb['fieldName'],'type':_0x1d00bb[_0x4e13('0x2f')]['key']};});_0x3b04eb[_0x4e13('0x30')]=_['map'](_0x189ae0,_0x4e13('0x2a'));_0x3b04eb['query']=_[_0x4e13('0x31')](_0x1ec73a['query']);_0x3b04eb[_0x4e13('0x32')]=_[_0x4e13('0x33')](_0x3b04eb[_0x4e13('0x30')],_0x3b04eb[_0x4e13('0x34')]);_0x584e1c[_0x4e13('0x35')]=_[_0x4e13('0x33')](_0x3b04eb[_0x4e13('0x30')],qs[_0x4e13('0x36')](_0x1ec73a[_0x4e13('0x34')][_0x4e13('0x36')]));_0x584e1c[_0x4e13('0x35')]=_0x584e1c[_0x4e13('0x35')][_0x4e13('0x37')]?_0x584e1c[_0x4e13('0x35')]:_0x3b04eb[_0x4e13('0x30')];if(!_0x1ec73a[_0x4e13('0x34')][_0x4e13('0x38')]('nolimit')){_0x584e1c[_0x4e13('0x1a')]=qs[_0x4e13('0x1a')](_0x1ec73a['query'][_0x4e13('0x1a')]);_0x584e1c[_0x4e13('0x18')]=qs[_0x4e13('0x18')](_0x1ec73a[_0x4e13('0x34')][_0x4e13('0x18')]);}_0x584e1c[_0x4e13('0x39')]=qs['sort'](_0x1ec73a['query'][_0x4e13('0x3a')]);_0x584e1c[_0x4e13('0x3b')]=qs[_0x4e13('0x32')](_[_0x4e13('0x3c')](_0x1ec73a[_0x4e13('0x34')],_0x3b04eb[_0x4e13('0x32')]),_0x189ae0);if(_0x1ec73a[_0x4e13('0x34')][_0x4e13('0x3d')]){_0x584e1c[_0x4e13('0x3b')]=_['merge'](_0x584e1c['where'],{'$or':_['map'](_0x189ae0,function(_0xa768bb){if(_0xa768bb['type']!=='VIRTUAL'){var _0x114653={};_0x114653[_0xa768bb[_0x4e13('0x2a')]]={'$like':'%'+_0x1ec73a[_0x4e13('0x34')][_0x4e13('0x3d')]+'%'};return _0x114653;}})});}_0x584e1c=_[_0x4e13('0x3e')]({},_0x584e1c,_0x1ec73a[_0x4e13('0x3f')]);var _0x15210a={'where':_0x584e1c[_0x4e13('0x3b')]};return db['Variable'][_0x4e13('0x1b')](_0x15210a)[_0x4e13('0x22')](function(_0x4e6eca){_0x2dfab3['count']=_0x4e6eca;if(_0x1ec73a['query'][_0x4e13('0x40')]){_0x584e1c[_0x4e13('0x41')]=[{'all':!![]}];}return db[_0x4e13('0x2e')][_0x4e13('0x42')](_0x584e1c);})[_0x4e13('0x22')](function(_0x3d2800){_0x2dfab3[_0x4e13('0x43')]=_0x3d2800;return _0x2dfab3;})[_0x4e13('0x22')](respondWithFilteredResult(_0x33e7d4,_0x584e1c))['catch'](handleError(_0x33e7d4,null));};exports[_0x4e13('0x44')]=function(_0x2becb5,_0x3592fa){var _0x4f50dd={'raw':!![],'where':{'id':_0x2becb5[_0x4e13('0x45')]['id']}},_0x204924={};_0x204924[_0x4e13('0x30')]=_[_0x4e13('0x31')](db['Variable'][_0x4e13('0x46')]);_0x204924[_0x4e13('0x34')]=_[_0x4e13('0x31')](_0x2becb5[_0x4e13('0x34')]);_0x204924[_0x4e13('0x32')]=_[_0x4e13('0x33')](_0x204924['model'],_0x204924[_0x4e13('0x34')]);_0x4f50dd[_0x4e13('0x35')]=_[_0x4e13('0x33')](_0x204924['model'],qs[_0x4e13('0x36')](_0x2becb5[_0x4e13('0x34')][_0x4e13('0x36')]));_0x4f50dd[_0x4e13('0x35')]=_0x4f50dd['attributes'][_0x4e13('0x37')]?_0x4f50dd[_0x4e13('0x35')]:_0x204924[_0x4e13('0x30')];if(_0x2becb5[_0x4e13('0x34')][_0x4e13('0x40')]){_0x4f50dd[_0x4e13('0x41')]=[{'all':!![]}];}_0x4f50dd=_['merge']({},_0x4f50dd,_0x2becb5['options']);return db[_0x4e13('0x2e')][_0x4e13('0x47')](_0x4f50dd)[_0x4e13('0x22')](handleEntityNotFound(_0x3592fa,null))[_0x4e13('0x22')](respondWithResult(_0x3592fa,null))[_0x4e13('0x48')](handleError(_0x3592fa,null));};exports['create']=function(_0x2d7983,_0x16eb4d){return db['Variable'][_0x4e13('0x49')](_0x2d7983[_0x4e13('0x4a')],{})[_0x4e13('0x22')](function(_0x1507bc){var _0x177c74=_0x2d7983[_0x4e13('0x4b')][_0x4e13('0x24')]({'plain':!![]});if(!_0x177c74)throw new Error(_0x4e13('0x4c'));if(_0x177c74['role']==='user'){var _0x2bf97d=_0x1507bc[_0x4e13('0x24')]({'plain':!![]});var _0x2355ce=_0x4e13('0x25');return db[_0x4e13('0x4d')][_0x4e13('0x47')]({'where':{'name':_0x2355ce,'userProfileId':_0x177c74[_0x4e13('0x4e')]},'raw':!![]})[_0x4e13('0x22')](function(_0x4d19a2){if(_0x4d19a2&&_0x4d19a2[_0x4e13('0x4f')]===0x0){return db[_0x4e13('0x26')][_0x4e13('0x49')]({'name':_0x2bf97d[_0x4e13('0x2a')],'resourceId':_0x2bf97d['id'],'type':_0x4d19a2['name'],'sectionId':_0x4d19a2['id']},{})[_0x4e13('0x22')](function(){return _0x1507bc;});}else{return _0x1507bc;}})[_0x4e13('0x48')](function(_0x19d009){logger[_0x4e13('0x28')](_0x4e13('0x50'),_0x19d009);throw _0x19d009;});}return _0x1507bc;})[_0x4e13('0x22')](respondWithResult(_0x16eb4d,0xc9))['catch'](handleError(_0x16eb4d,null));};exports[_0x4e13('0x21')]=function(_0x1ceb29,_0x4198a8){if(_0x1ceb29[_0x4e13('0x4a')]['id']){delete _0x1ceb29[_0x4e13('0x4a')]['id'];}return db[_0x4e13('0x2e')][_0x4e13('0x47')]({'where':{'id':_0x1ceb29[_0x4e13('0x45')]['id']}})[_0x4e13('0x22')](handleEntityNotFound(_0x4198a8,null))[_0x4e13('0x22')](saveUpdates(_0x1ceb29[_0x4e13('0x4a')],null))[_0x4e13('0x22')](respondWithResult(_0x4198a8,null))['catch'](handleError(_0x4198a8,null));};exports[_0x4e13('0x23')]=function(_0x2c82ff,_0x3aab7e){return db[_0x4e13('0x2e')][_0x4e13('0x47')]({'where':{'id':_0x2c82ff['params']['id']}})[_0x4e13('0x22')](handleEntityNotFound(_0x3aab7e,null))[_0x4e13('0x22')](removeEntity(_0x3aab7e,null))[_0x4e13('0x48')](handleError(_0x3aab7e,null));}; \ No newline at end of file +var _0x6e4b=['keys','length','includeAll','find','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','apply','save','update','then','destroy','Variables','error','stack','name','send','index','map','Variable','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','order','sort','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','show','params'];(function(_0x244215,_0x3e69dd){var _0x1cb040=function(_0x2c6bc2){while(--_0x2c6bc2){_0x244215['push'](_0x244215['shift']());}};_0x1cb040(++_0x3e69dd);}(_0x6e4b,0xa5));var _0xb6e4=function(_0x507fdf,_0x129ea7){_0x507fdf=_0x507fdf-0x0;var _0x4cd090=_0x6e4b[_0x507fdf];return _0x4cd090;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb6e4('0x0'));var jsonpatch=require(_0xb6e4('0x1'));var rp=require(_0xb6e4('0x2'));var moment=require(_0xb6e4('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb6e4('0x4'));var path=require('path');var sox=require(_0xb6e4('0x5'));var csv=require(_0xb6e4('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xb6e4('0x7'));var _=require(_0xb6e4('0x8'));var squel=require(_0xb6e4('0x9'));var crypto=require(_0xb6e4('0xa'));var jsforce=require(_0xb6e4('0xb'));var deskjs=require(_0xb6e4('0xc'));var toCsv=require(_0xb6e4('0x6'));var querystring=require(_0xb6e4('0xd'));var Papa=require(_0xb6e4('0xe'));var Redis=require(_0xb6e4('0xf'));var authService=require(_0xb6e4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xb6e4('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6e4('0x12'))('api');var utils=require(_0xb6e4('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xb6e4('0x14'));var db=require(_0xb6e4('0x15'))['db'];function respondWithStatusCode(_0x5094f3,_0xed2471){_0xed2471=_0xed2471||0xcc;return function(_0x26f258){if(_0x26f258){return _0x5094f3[_0xb6e4('0x16')](_0xed2471);}return _0x5094f3[_0xb6e4('0x17')](_0xed2471)[_0xb6e4('0x18')]();};}function respondWithResult(_0x30533a,_0x3fc45e){_0x3fc45e=_0x3fc45e||0xc8;return function(_0x3af146){if(_0x3af146){return _0x30533a[_0xb6e4('0x17')](_0x3fc45e)[_0xb6e4('0x19')](_0x3af146);}};}function respondWithFilteredResult(_0x288779,_0x53fcf0){return function(_0x269988){if(_0x269988){var _0x4f0ba9=typeof _0x53fcf0['offset']==='undefined'&&typeof _0x53fcf0['limit']===_0xb6e4('0x1a');var _0xe42328=_0x269988[_0xb6e4('0x1b')];var _0x2aed60=_0x4f0ba9?0x0:_0x53fcf0[_0xb6e4('0x1c')];var _0x393a10=_0x4f0ba9?_0x269988[_0xb6e4('0x1b')]:_0x53fcf0[_0xb6e4('0x1c')]+_0x53fcf0[_0xb6e4('0x1d')];var _0x37c5c4;if(_0x393a10>=_0xe42328){_0x393a10=_0xe42328;_0x37c5c4=0xc8;}else{_0x37c5c4=0xce;}_0x288779[_0xb6e4('0x17')](_0x37c5c4);return _0x288779['set']('Content-Range',_0x2aed60+'-'+_0x393a10+'/'+_0xe42328)[_0xb6e4('0x19')](_0x269988);}return null;};}function patchUpdates(_0x5c7b64){return function(_0x2f1e98){try{jsonpatch[_0xb6e4('0x1e')](_0x2f1e98,_0x5c7b64,!![]);}catch(_0x174831){return BPromise['reject'](_0x174831);}return _0x2f1e98[_0xb6e4('0x1f')]();};}function saveUpdates(_0x2dc816,_0x4c04cc){return function(_0x5428e0){if(_0x5428e0){return _0x5428e0[_0xb6e4('0x20')](_0x2dc816)[_0xb6e4('0x21')](function(_0x179cdb){return _0x179cdb;});}return null;};}function removeEntity(_0x237c87,_0x3bea76){return function(_0x5a4e10){if(_0x5a4e10){return _0x5a4e10[_0xb6e4('0x22')]()[_0xb6e4('0x21')](function(){var _0x471a70=_0x5a4e10['get']({'plain':!![]});var _0x1b08d8=_0xb6e4('0x23');return db['UserProfileResource'][_0xb6e4('0x22')]({'where':{'type':_0x1b08d8,'resourceId':_0x471a70['id']}})[_0xb6e4('0x21')](function(){return _0x5a4e10;});})['then'](function(){_0x237c87['status'](0xcc)[_0xb6e4('0x18')]();});}};}function handleEntityNotFound(_0x389f25,_0x4df6a9){return function(_0x3835ef){if(!_0x3835ef){_0x389f25[_0xb6e4('0x16')](0x194);}return _0x3835ef;};}function handleError(_0x3fd1a5,_0x459fe6){_0x459fe6=_0x459fe6||0x1f4;return function(_0x4b51c2){logger[_0xb6e4('0x24')](_0x4b51c2[_0xb6e4('0x25')]);if(_0x4b51c2[_0xb6e4('0x26')]){delete _0x4b51c2['name'];}_0x3fd1a5['status'](_0x459fe6)[_0xb6e4('0x27')](_0x4b51c2);};}exports[_0xb6e4('0x28')]=function(_0x53f3cb,_0x265fac){var _0x538e21={},_0x38448b={},_0xeb755a={'count':0x0,'rows':[]};var _0x1ba62d=_[_0xb6e4('0x29')](db[_0xb6e4('0x2a')][_0xb6e4('0x2b')],function(_0x59a15a){return{'name':_0x59a15a[_0xb6e4('0x2c')],'type':_0x59a15a[_0xb6e4('0x2d')][_0xb6e4('0x2e')]};});_0x38448b[_0xb6e4('0x2f')]=_['map'](_0x1ba62d,_0xb6e4('0x26'));_0x38448b['query']=_['keys'](_0x53f3cb[_0xb6e4('0x30')]);_0x38448b[_0xb6e4('0x31')]=_[_0xb6e4('0x32')](_0x38448b[_0xb6e4('0x2f')],_0x38448b[_0xb6e4('0x30')]);_0x538e21['attributes']=_[_0xb6e4('0x32')](_0x38448b['model'],qs[_0xb6e4('0x33')](_0x53f3cb[_0xb6e4('0x30')]['fields']));_0x538e21[_0xb6e4('0x34')]=_0x538e21[_0xb6e4('0x34')]['length']?_0x538e21[_0xb6e4('0x34')]:_0x38448b[_0xb6e4('0x2f')];if(!_0x53f3cb[_0xb6e4('0x30')]['hasOwnProperty']('nolimit')){_0x538e21[_0xb6e4('0x1d')]=qs['limit'](_0x53f3cb[_0xb6e4('0x30')][_0xb6e4('0x1d')]);_0x538e21[_0xb6e4('0x1c')]=qs[_0xb6e4('0x1c')](_0x53f3cb['query'][_0xb6e4('0x1c')]);}_0x538e21[_0xb6e4('0x35')]=qs['sort'](_0x53f3cb[_0xb6e4('0x30')][_0xb6e4('0x36')]);_0x538e21['where']=qs[_0xb6e4('0x31')](_['pick'](_0x53f3cb['query'],_0x38448b[_0xb6e4('0x31')]),_0x1ba62d);if(_0x53f3cb['query'][_0xb6e4('0x37')]){_0x538e21['where']=_[_0xb6e4('0x38')](_0x538e21[_0xb6e4('0x39')],{'$or':_[_0xb6e4('0x29')](_0x1ba62d,function(_0x1594d5){if(_0x1594d5[_0xb6e4('0x2d')]!==_0xb6e4('0x3a')){var _0x411b20={};_0x411b20[_0x1594d5[_0xb6e4('0x26')]]={'$like':'%'+_0x53f3cb['query'][_0xb6e4('0x37')]+'%'};return _0x411b20;}})});}_0x538e21=_['merge']({},_0x538e21,_0x53f3cb[_0xb6e4('0x3b')]);var _0x317931={'where':_0x538e21['where']};return db['Variable']['count'](_0x317931)['then'](function(_0x2e29b8){_0xeb755a[_0xb6e4('0x1b')]=_0x2e29b8;if(_0x53f3cb['query']['includeAll']){_0x538e21[_0xb6e4('0x3c')]=[{'all':!![]}];}return db['Variable'][_0xb6e4('0x3d')](_0x538e21);})[_0xb6e4('0x21')](function(_0x24c3da){_0xeb755a[_0xb6e4('0x3e')]=_0x24c3da;return _0xeb755a;})[_0xb6e4('0x21')](respondWithFilteredResult(_0x265fac,_0x538e21))[_0xb6e4('0x3f')](handleError(_0x265fac,null));};exports[_0xb6e4('0x40')]=function(_0x430b8f,_0x244647){var _0x28d02e={'raw':!![],'where':{'id':_0x430b8f[_0xb6e4('0x41')]['id']}},_0x2052fc={};_0x2052fc[_0xb6e4('0x2f')]=_[_0xb6e4('0x42')](db[_0xb6e4('0x2a')][_0xb6e4('0x2b')]);_0x2052fc[_0xb6e4('0x30')]=_[_0xb6e4('0x42')](_0x430b8f[_0xb6e4('0x30')]);_0x2052fc[_0xb6e4('0x31')]=_[_0xb6e4('0x32')](_0x2052fc[_0xb6e4('0x2f')],_0x2052fc[_0xb6e4('0x30')]);_0x28d02e[_0xb6e4('0x34')]=_['intersection'](_0x2052fc[_0xb6e4('0x2f')],qs[_0xb6e4('0x33')](_0x430b8f[_0xb6e4('0x30')][_0xb6e4('0x33')]));_0x28d02e[_0xb6e4('0x34')]=_0x28d02e[_0xb6e4('0x34')][_0xb6e4('0x43')]?_0x28d02e[_0xb6e4('0x34')]:_0x2052fc['model'];if(_0x430b8f[_0xb6e4('0x30')][_0xb6e4('0x44')]){_0x28d02e[_0xb6e4('0x3c')]=[{'all':!![]}];}_0x28d02e=_[_0xb6e4('0x38')]({},_0x28d02e,_0x430b8f['options']);return db[_0xb6e4('0x2a')][_0xb6e4('0x45')](_0x28d02e)['then'](handleEntityNotFound(_0x244647,null))['then'](respondWithResult(_0x244647,null))[_0xb6e4('0x3f')](handleError(_0x244647,null));};exports['create']=function(_0x1c66fa,_0x1d1449){return db['Variable']['create'](_0x1c66fa[_0xb6e4('0x46')],{})['then'](function(_0x593a78){var _0x1eb743=_0x1c66fa[_0xb6e4('0x47')][_0xb6e4('0x48')]({'plain':!![]});if(!_0x1eb743)throw new Error(_0xb6e4('0x49'));if(_0x1eb743['role']==='user'){var _0x530435=_0x593a78[_0xb6e4('0x48')]({'plain':!![]});var _0x538009=_0xb6e4('0x23');return db['UserProfileSection'][_0xb6e4('0x45')]({'where':{'name':_0x538009,'userProfileId':_0x1eb743[_0xb6e4('0x4a')]},'raw':!![]})[_0xb6e4('0x21')](function(_0x4172ec){if(_0x4172ec&&_0x4172ec['autoAssociation']===0x0){return db['UserProfileResource'][_0xb6e4('0x4b')]({'name':_0x530435['name'],'resourceId':_0x530435['id'],'type':_0x4172ec[_0xb6e4('0x26')],'sectionId':_0x4172ec['id']},{})[_0xb6e4('0x21')](function(){return _0x593a78;});}else{return _0x593a78;}})['catch'](function(_0x437dba){logger['error'](_0xb6e4('0x4c'),_0x437dba);throw _0x437dba;});}return _0x593a78;})[_0xb6e4('0x21')](respondWithResult(_0x1d1449,0xc9))[_0xb6e4('0x3f')](handleError(_0x1d1449,null));};exports[_0xb6e4('0x20')]=function(_0x45037f,_0x489ddf){if(_0x45037f[_0xb6e4('0x46')]['id']){delete _0x45037f[_0xb6e4('0x46')]['id'];}return db[_0xb6e4('0x2a')][_0xb6e4('0x45')]({'where':{'id':_0x45037f[_0xb6e4('0x41')]['id']}})['then'](handleEntityNotFound(_0x489ddf,null))[_0xb6e4('0x21')](saveUpdates(_0x45037f[_0xb6e4('0x46')],null))[_0xb6e4('0x21')](respondWithResult(_0x489ddf,null))[_0xb6e4('0x3f')](handleError(_0x489ddf,null));};exports[_0xb6e4('0x22')]=function(_0x4e1c81,_0x59f606){return db['Variable'][_0xb6e4('0x45')]({'where':{'id':_0x4e1c81[_0xb6e4('0x41')]['id']}})[_0xb6e4('0x21')](handleEntityNotFound(_0x59f606,null))[_0xb6e4('0x21')](removeEntity(_0x59f606,null))[_0xb6e4('0x3f')](handleError(_0x59f606,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 9eee38d..c558604 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 _0xb0d5=['../../config/logger','api','moment','bluebird','request-promise','path','tools_variables','lodash','util'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xb0d5,0x18a));var _0x5b0d=function(_0x2e612a,_0x106dd7){_0x2e612a=_0x2e612a-0x0;var _0x3cb97c=_0xb0d5[_0x2e612a];return _0x3cb97c;};'use strict';var _=require(_0x5b0d('0x0'));var util=require(_0x5b0d('0x1'));var logger=require(_0x5b0d('0x2'))(_0x5b0d('0x3'));var moment=require(_0x5b0d('0x4'));var BPromise=require(_0x5b0d('0x5'));var rp=require(_0x5b0d('0x6'));var fs=require('fs');var path=require(_0x5b0d('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./variable.attributes');module['exports']=function(_0x42f98d,_0x1be8a8){return _0x42f98d['define']('Variable',attributes,{'tableName':_0x5b0d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e4a=['request-promise','path','rimraf','../../config/environment','./variable.attributes','define','Variable','tools_variables','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x6e4a,0x174));var _0xa6e4=function(_0x5712e5,_0x10a956){_0x5712e5=_0x5712e5-0x0;var _0x4c5215=_0x6e4a[_0x5712e5];return _0x4c5215;};'use strict';var _=require(_0xa6e4('0x0'));var util=require(_0xa6e4('0x1'));var logger=require(_0xa6e4('0x2'))(_0xa6e4('0x3'));var moment=require(_0xa6e4('0x4'));var BPromise=require(_0xa6e4('0x5'));var rp=require(_0xa6e4('0x6'));var fs=require('fs');var path=require(_0xa6e4('0x7'));var rimraf=require(_0xa6e4('0x8'));var config=require(_0xa6e4('0x9'));var attributes=require(_0xa6e4('0xa'));module['exports']=function(_0x229a5,_0x2ac5ad){return _0x229a5[_0xa6e4('0xb')](_0xa6e4('0xc'),attributes,{'tableName':_0xa6e4('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 0541d8c..c73d904 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 _0x5fc3=['info','request\x20sent','debug','stringify','error','code','message','Variable,\x20%s,\x20%s','result','catch','ShowVariable','find','options','where','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request','then'];(function(_0x2d2949,_0x24c559){var _0x4bb11f=function(_0x2a75d7){while(--_0x2a75d7){_0x2d2949['push'](_0x2d2949['shift']());}};_0x4bb11f(++_0x24c559);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1992f1,_0x5c61f0){_0x1992f1=_0x1992f1-0x0;var _0x413dfe=_0x5fc3[_0x1992f1];return _0x413dfe;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Variable,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Variable,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}exports[_0x35fc('0x16')]=function(_0x553677){var _0x41e165=this;return new Promise(function(_0x363e47,_0x2e513b){return db['Variable'][_0x35fc('0x17')]({'raw':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x19')]||null:null,'attributes':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1a')]||null:null,'include':_0x553677[_0x35fc('0x18')]?_0x553677[_0x35fc('0x18')][_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x553677['options'][_0x35fc('0x1b')],function(_0xd5399f){return{'model':db[_0xd5399f[_0x35fc('0x1d')]],'as':_0xd5399f['as'],'attributes':_0xd5399f[_0x35fc('0x1a')],'include':_0xd5399f[_0x35fc('0x1b')]?_['map'](_0xd5399f[_0x35fc('0x1b')],function(_0x4c587a){return{'model':db[_0x4c587a['model']],'as':_0x4c587a['as'],'attributes':_0x4c587a[_0x35fc('0x1a')],'include':_0x4c587a[_0x35fc('0x1b')]?_[_0x35fc('0x1c')](_0x4c587a['include'],function(_0x4086e9){return{'model':db[_0x4086e9['model']],'as':_0x4086e9['as'],'attributes':_0x4086e9[_0x35fc('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x35fc('0xb')](function(_0x5cb986){logger['info'](_0x35fc('0x16'),_0x553677);logger['debug'](_0x35fc('0x16'),_0x553677,JSON[_0x35fc('0xf')](_0x5cb986));_0x363e47(_0x5cb986);})['catch'](function(_0x26b7cb){logger[_0x35fc('0x10')](_0x35fc('0x16'),_0x26b7cb[_0x35fc('0x12')],_0x553677);_0x2e513b(_0x41e165[_0x35fc('0x10')](0x1f4,_0x26b7cb[_0x35fc('0x12')]));});});}; \ No newline at end of file +var _0xe14b=['ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','Variable,\x20%s,\x20%s','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','ShowVariable','Variable','find','options','raw','where','attributes','map','include','model','stringify','lodash','util','randomstring'];(function(_0x1e1185,_0x35ca20){var _0x50615d=function(_0x25c6be){while(--_0x25c6be){_0x1e1185['push'](_0x1e1185['shift']());}};_0x50615d(++_0x35ca20);}(_0xe14b,0x93));var _0xbe14=function(_0x5ddd81,_0x37a147){_0x5ddd81=_0x5ddd81-0x0;var _0x3d3fcc=_0xe14b[_0x5ddd81];return _0x3d3fcc;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}exports[_0xbe14('0x13')]=function(_0x29ab73){var _0x17ae86=this;return new Promise(function(_0x5ea1f8,_0x137ee5){return db[_0xbe14('0x14')][_0xbe14('0x15')]({'raw':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x17')]===undefined?!![]:![]:!![],'where':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x18')]||null:null,'attributes':_0x29ab73[_0xbe14('0x16')]?_0x29ab73[_0xbe14('0x16')][_0xbe14('0x19')]||null:null,'include':_0x29ab73['options']?_0x29ab73[_0xbe14('0x16')]['include']?_[_0xbe14('0x1a')](_0x29ab73['options'][_0xbe14('0x1b')],function(_0x4a25fa){return{'model':db[_0x4a25fa[_0xbe14('0x1c')]],'as':_0x4a25fa['as'],'attributes':_0x4a25fa[_0xbe14('0x19')],'include':_0x4a25fa['include']?_[_0xbe14('0x1a')](_0x4a25fa['include'],function(_0x4587a8){return{'model':db[_0x4587a8['model']],'as':_0x4587a8['as'],'attributes':_0x4587a8[_0xbe14('0x19')],'include':_0x4587a8[_0xbe14('0x1b')]?_[_0xbe14('0x1a')](_0x4587a8[_0xbe14('0x1b')],function(_0x15ef02){return{'model':db[_0x15ef02[_0xbe14('0x1c')]],'as':_0x15ef02['as'],'attributes':_0x15ef02['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe14('0x9')](function(_0x1ba46a){logger[_0xbe14('0xa')](_0xbe14('0x13'),_0x29ab73);logger['debug'](_0xbe14('0x13'),_0x29ab73,JSON[_0xbe14('0x1d')](_0x1ba46a));_0x5ea1f8(_0x1ba46a);})['catch'](function(_0x3c3613){logger[_0xbe14('0xe')](_0xbe14('0x13'),_0x3c3613[_0xbe14('0x10')],_0x29ab73);_0x137ee5(_0x17ae86[_0xbe14('0xe')](0x1f4,_0x3c3613[_0xbe14('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 67cfb15..ac39b2e 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 _0xe5a7=['index','/fetch','isAuthenticated','fetch','/reset','canUpdate','reset','/pull','pull','/migrations','migrations','exports','./version.controller','get'];(function(_0x3c3e72,_0x3e1858){var _0x48a7e5=function(_0x3d1c72){while(--_0x3d1c72){_0x3c3e72['push'](_0x3c3e72['shift']());}};_0x48a7e5(++_0x3e1858);}(_0xe5a7,0xa6));var _0x7e5a=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xe5a7[_0x311c35];return _0x5cc50c;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x7e5a('0x0'));router[_0x7e5a('0x1')]('/',controller[_0x7e5a('0x2')]);router['get'](_0x7e5a('0x3'),auth[_0x7e5a('0x4')](),auth['canUpdate'](),controller[_0x7e5a('0x5')]);router[_0x7e5a('0x1')](_0x7e5a('0x6'),auth[_0x7e5a('0x4')](),auth[_0x7e5a('0x7')](),controller[_0x7e5a('0x8')]);router[_0x7e5a('0x1')](_0x7e5a('0x9'),auth['isAuthenticated'](),auth[_0x7e5a('0x7')](),controller[_0x7e5a('0xa')]);router['get']('/restart',auth['isAuthenticated'](),controller['restart']);router['get'](_0x7e5a('0xb'),controller[_0x7e5a('0xc')]);module[_0x7e5a('0xd')]=router; \ No newline at end of file +var _0x5019=['index','/fetch','isAuthenticated','canUpdate','reset','/restart','restart','/migrations','exports','express','../../components/auth/service','./version.controller','get'];(function(_0x342b66,_0xc35dc2){var _0x3c374a=function(_0x4fcac1){while(--_0x4fcac1){_0x342b66['push'](_0x342b66['shift']());}};_0x3c374a(++_0xc35dc2);}(_0x5019,0x14e));var _0x9501=function(_0x2bc756,_0x5c221e){_0x2bc756=_0x2bc756-0x0;var _0x389436=_0x5019[_0x2bc756];return _0x389436;};'use strict';var express=require(_0x9501('0x0'));var router=express['Router']();var auth=require(_0x9501('0x1'));var controller=require(_0x9501('0x2'));router[_0x9501('0x3')]('/',controller[_0x9501('0x4')]);router[_0x9501('0x3')](_0x9501('0x5'),auth[_0x9501('0x6')](),auth[_0x9501('0x7')](),controller['fetch']);router[_0x9501('0x3')]('/reset',auth[_0x9501('0x6')](),auth['canUpdate'](),controller[_0x9501('0x8')]);router['get']('/pull',auth[_0x9501('0x6')](),auth['canUpdate'](),controller['pull']);router['get'](_0x9501('0x9'),auth[_0x9501('0x6')](),controller[_0x9501('0xa')]);router[_0x9501('0x3')](_0x9501('0xb'),controller['migrations']);module[_0x9501('0xc')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index aca98f5..5505b75 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 _0x2c5f=['length','.js','push','Migration','sequelize','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','path','pkginfo','compare-versions','exec','../../mysqldb','../../config/logger','simple-git','root','index','exports','version','query','latest','fetch','status','json','origin','master','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','join','server'];(function(_0x1e243a,_0x412fd0){var _0x561939=function(_0x25b5f8){while(--_0x25b5f8){_0x1e243a['push'](_0x1e243a['shift']());}};_0x561939(++_0x412fd0);}(_0x2c5f,0x9e));var _0xf2c5=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x2c5f[_0x5627e1];return _0x2f013f;};'use strict';var Umzug=require('umzug');var path=require(_0xf2c5('0x0'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xf2c5('0x1'))(module,'version');var compareVersions=require(_0xf2c5('0x2'));var exec=require('child_process')[_0xf2c5('0x3')];var db=require(_0xf2c5('0x4'))['db'];var config=require('../../config/environment');var pm2=require('../../config/pm2');var logger=require(_0xf2c5('0x5'))('update');var git=require(_0xf2c5('0x6'))(config[_0xf2c5('0x7')]);exports[_0xf2c5('0x8')]=function(_0x26baa0,_0x21d3d7){var _0x2e2369={'current':module[_0xf2c5('0x9')][_0xf2c5('0xa')],'phonebar':0x2};if(_0x26baa0[_0xf2c5('0xb')]&&_0x26baa0['query'][_0xf2c5('0xc')]){return git[_0xf2c5('0xd')]()['tags'](function(_0x452eae,_0x126510){_0x2e2369[_0xf2c5('0xc')]=(_0x452eae?module[_0xf2c5('0x9')][_0xf2c5('0xa')]:_0x126510[_0xf2c5('0xc')])||'2.0.0';return _0x21d3d7[_0xf2c5('0xe')](0xc8)[_0xf2c5('0xf')](_0x2e2369);});}else{return _0x21d3d7[_0xf2c5('0xe')](0xc8)['json'](_0x2e2369);}};exports[_0xf2c5('0xd')]=function(_0x2b967a,_0xff535){return git[_0xf2c5('0xd')]([_0xf2c5('0x10'),_0xf2c5('0x11')],function(_0x4b9fc0){if(_0x4b9fc0){logger[_0xf2c5('0x12')](_0x4b9fc0);return _0xff535[_0xf2c5('0xe')](0x1f4)[_0xf2c5('0xf')](_0x4b9fc0);}logger[_0xf2c5('0x13')]('git\x20fetch');return _0xff535[_0xf2c5('0xe')](0xc8)['json']({'output':_0xf2c5('0x14')});});};exports[_0xf2c5('0x15')]=function(_0x41d47f,_0xbe22c){return git[_0xf2c5('0x15')]([_0xf2c5('0x16'),_0xf2c5('0x17')],function(_0xb2defc){if(_0xb2defc){logger[_0xf2c5('0x12')](_0xb2defc);return _0xbe22c['status'](0x1f4)[_0xf2c5('0xf')](_0xb2defc);}logger[_0xf2c5('0x13')](_0xf2c5('0x18'));return _0xbe22c[_0xf2c5('0xe')](0xc8)[_0xf2c5('0xf')]({'output':_0xf2c5('0x19')});});};exports[_0xf2c5('0x1a')]=function(_0x4cbb56,_0x3a9b12){exec('npm\x20install\x20--production',function(_0x5143cc,_0x3a01c0,_0x4aeeb6){logger[_0xf2c5('0x13')](_0x3a01c0);logger[_0xf2c5('0x13')](_0x4aeeb6);if(_0x5143cc){logger[_0xf2c5('0x12')](_0x5143cc);return _0x3a9b12[_0xf2c5('0xe')](0x1f4)['json'](_0x5143cc);}return _0x3a9b12[_0xf2c5('0xe')](0xc8)[_0xf2c5('0xf')]({'output':_0x3a01c0});});};exports[_0xf2c5('0x1b')]=function(_0x5d5449,_0x22df07){return pm2[_0xf2c5('0x1b')](_0xf2c5('0x1c'))['then'](function(_0x277680){logger[_0xf2c5('0x13')]('pm2\x20restart\x20motion\x20%s',_0x277680);return _0x22df07[_0xf2c5('0xe')](0xc8)['json']({'output':_0xf2c5('0x1d')});})[_0xf2c5('0x1e')](function(_0x14341b){logger[_0xf2c5('0x12')](_0x14341b);return _0x22df07[_0xf2c5('0xe')](0x1f4)['json'](_0x14341b);});};exports[_0xf2c5('0x1f')]=function(_0x34e9f1,_0x19482b){var _0x345462=fs['readdirSync'](path[_0xf2c5('0x20')](config[_0xf2c5('0x7')],_0xf2c5('0x21'),'migrations'));var _0x52188e=[];for(var _0x157488=0x0;_0x157488<_0x345462[_0xf2c5('0x22')];_0x157488++){var _0x38fb36=_0x345462[_0x157488]['replace'](_0xf2c5('0x23'),'');if(compareVersions(module[_0xf2c5('0x9')][_0xf2c5('0xa')],_0x38fb36)===-0x1){_0x52188e[_0xf2c5('0x24')](_0x38fb36);}}if(_0x52188e[_0xf2c5('0x22')]){var _0xb9e661=_0x52188e['sort'](compareVersions);var _0x2f2028=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xf2c5('0x25')],'modelName':_0xf2c5('0x25'),'columnName':_0xf2c5('0xa')},'migrations':{'params':[db[_0xf2c5('0x26')]['getQueryInterface'](),db[_0xf2c5('0x26')][_0xf2c5('0x27')],function(){throw new Error(_0xf2c5('0x28'));}],'path':path['join'](config[_0xf2c5('0x7')],'server',_0xf2c5('0x1f')),'pattern':/\.js$/}});_0x2f2028['up']({'migrations':_[_0xf2c5('0x29')](_0xb9e661,function(_0x3888a7){return _0x3888a7+_0xf2c5('0x23');})})[_0xf2c5('0x2a')](function(){return _0x19482b[_0xf2c5('0xe')](0xc8)['json']({'output':_0xf2c5('0x2b')+module[_0xf2c5('0x9')][_0xf2c5('0xa')]+_0xf2c5('0x2c')+_[_0xf2c5('0x2d')](_0xb9e661),'migrations':_[_0xf2c5('0x20')](_0xb9e661)});})[_0xf2c5('0x1e')](function(_0x29a35a){if(_0x29a35a instanceof db[_0xf2c5('0x26')][_0xf2c5('0x2e')]){return _0x19482b[_0xf2c5('0xe')](0xc8)[_0xf2c5('0xf')]({'output':_0xf2c5('0x2f')});}else{return _0x19482b['status'](0x1f4)[_0xf2c5('0xf')](_0x29a35a);}});}else{return _0x19482b[_0xf2c5('0xe')](0xc8)[_0xf2c5('0xf')]({'output':_0xf2c5('0x2f')});}}; \ No newline at end of file +var _0x94e1=['master','error','git\x20fetch','reset','--hard','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','restart','motion2','then','pm2\x20restart\x20motion\x20%s','migrations','readdirSync','join','replace','.js','push','sort','sequelize','Migration','constructor','server','Database\x20migrated\x20successfully\x20from\x20version\x20','last','catch','pkginfo','version','child_process','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x94e1,0x77));var _0x194e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x94e1[_0x321bb2];return _0x9c12ed;};'use strict';var Umzug=require('umzug');var path=require('path');var fs=require('fs');var _=require('lodash');var pkginfo=require(_0x194e('0x0'))(module,_0x194e('0x1'));var compareVersions=require('compare-versions');var exec=require(_0x194e('0x2'))['exec'];var db=require('../../mysqldb')['db'];var config=require(_0x194e('0x3'));var pm2=require(_0x194e('0x4'));var logger=require(_0x194e('0x5'))(_0x194e('0x6'));var git=require(_0x194e('0x7'))(config[_0x194e('0x8')]);exports[_0x194e('0x9')]=function(_0xb6aedb,_0xa5b9c){var _0x305337={'current':module[_0x194e('0xa')]['version'],'phonebar':0x2};if(_0xb6aedb['query']&&_0xb6aedb[_0x194e('0xb')][_0x194e('0xc')]){return git[_0x194e('0xd')]()[_0x194e('0xe')](function(_0x3787c3,_0x1d84b7){_0x305337['latest']=(_0x3787c3?module[_0x194e('0xa')][_0x194e('0x1')]:_0x1d84b7['latest'])||_0x194e('0xf');return _0xa5b9c['status'](0xc8)['json'](_0x305337);});}else{return _0xa5b9c[_0x194e('0x10')](0xc8)[_0x194e('0x11')](_0x305337);}};exports[_0x194e('0xd')]=function(_0x40f762,_0x1f683a){return git[_0x194e('0xd')]([_0x194e('0x12'),_0x194e('0x13')],function(_0x1bc385){if(_0x1bc385){logger[_0x194e('0x14')](_0x1bc385);return _0x1f683a[_0x194e('0x10')](0x1f4)[_0x194e('0x11')](_0x1bc385);}logger['info'](_0x194e('0x15'));return _0x1f683a[_0x194e('0x10')](0xc8)[_0x194e('0x11')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x194e('0x16')]=function(_0x49b936,_0x40eae9){return git[_0x194e('0x16')]([_0x194e('0x17'),'FETCH_HEAD'],function(_0x31a619){if(_0x31a619){logger['error'](_0x31a619);return _0x40eae9[_0x194e('0x10')](0x1f4)[_0x194e('0x11')](_0x31a619);}logger[_0x194e('0x18')](_0x194e('0x19'));return _0x40eae9['status'](0xc8)[_0x194e('0x11')]({'output':_0x194e('0x1a')});});};exports[_0x194e('0x1b')]=function(_0x49eddc,_0x24bd36){exec('npm\x20install\x20--production',function(_0x28dfb7,_0x2f1d1f,_0x2575fe){logger['info'](_0x2f1d1f);logger[_0x194e('0x18')](_0x2575fe);if(_0x28dfb7){logger[_0x194e('0x14')](_0x28dfb7);return _0x24bd36[_0x194e('0x10')](0x1f4)[_0x194e('0x11')](_0x28dfb7);}return _0x24bd36[_0x194e('0x10')](0xc8)[_0x194e('0x11')]({'output':_0x2f1d1f});});};exports[_0x194e('0x1c')]=function(_0x2912eb,_0x170e49){return pm2[_0x194e('0x1c')](_0x194e('0x1d'))[_0x194e('0x1e')](function(_0x500f8b){logger[_0x194e('0x18')](_0x194e('0x1f'),_0x500f8b);return _0x170e49[_0x194e('0x10')](0xc8)[_0x194e('0x11')]({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x1938be){logger['error'](_0x1938be);return _0x170e49['status'](0x1f4)[_0x194e('0x11')](_0x1938be);});};exports[_0x194e('0x20')]=function(_0x2535f9,_0x31b132){var _0x3b5bff=fs[_0x194e('0x21')](path[_0x194e('0x22')](config[_0x194e('0x8')],'server',_0x194e('0x20')));var _0x49e811=[];for(var _0x592b33=0x0;_0x592b33<_0x3b5bff['length'];_0x592b33++){var _0xcf9fb6=_0x3b5bff[_0x592b33][_0x194e('0x23')](_0x194e('0x24'),'');if(compareVersions(module[_0x194e('0xa')][_0x194e('0x1')],_0xcf9fb6)===-0x1){_0x49e811[_0x194e('0x25')](_0xcf9fb6);}}if(_0x49e811['length']){var _0x23129e=_0x49e811[_0x194e('0x26')](compareVersions);var _0x5583d8=new Umzug({'storage':_0x194e('0x27'),'storageOptions':{'model':db[_0x194e('0x28')],'modelName':_0x194e('0x28'),'columnName':'version'},'migrations':{'params':[db[_0x194e('0x27')]['getQueryInterface'](),db[_0x194e('0x27')][_0x194e('0x29')],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[_0x194e('0x22')](config[_0x194e('0x8')],_0x194e('0x2a'),'migrations'),'pattern':/\.js$/}});_0x5583d8['up']({'migrations':_['map'](_0x23129e,function(_0x5ae5a0){return _0x5ae5a0+'.js';})})[_0x194e('0x1e')](function(){return _0x31b132[_0x194e('0x10')](0xc8)[_0x194e('0x11')]({'output':_0x194e('0x2b')+module[_0x194e('0xa')][_0x194e('0x1')]+'\x20to\x20'+_[_0x194e('0x2c')](_0x23129e),'migrations':_[_0x194e('0x22')](_0x23129e)});})[_0x194e('0x2d')](function(_0x273f5f){if(_0x273f5f instanceof db['sequelize']['UniqueConstraintError']){return _0x31b132[_0x194e('0x10')](0xc8)[_0x194e('0x11')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x31b132['status'](0x1f4)['json'](_0x273f5f);}});}else{return _0x31b132[_0x194e('0x10')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index afcf71b..e26e6fc 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 _0x496a=['./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x357444,_0x5bb343){var _0x41a0e2=function(_0x2e0244){while(--_0x2e0244){_0x357444['push'](_0x357444['shift']());}};_0x41a0e2(++_0x5bb343);}(_0x496a,0x17d));var _0xa496=function(_0x36844a,_0x3bcf46){_0x36844a=_0x36844a-0x0;var _0xbab229=_0x496a[_0x36844a];return _0xbab229;};'use strict';var multer=require(_0xa496('0x0'));var util=require(_0xa496('0x1'));var path=require(_0xa496('0x2'));var timeout=require(_0xa496('0x3'));var express=require(_0xa496('0x4'));var router=express[_0xa496('0x5')]();var fs_extra=require(_0xa496('0x6'));var auth=require(_0xa496('0x7'));var interaction=require(_0xa496('0x8'));var config=require(_0xa496('0x9'));var controller=require(_0xa496('0xa'));router[_0xa496('0xb')]('/',auth[_0xa496('0xc')](),controller[_0xa496('0xd')]);router[_0xa496('0xb')](_0xa496('0xe'),auth['isAuthenticated'](),controller[_0xa496('0xf')]);router['get'](_0xa496('0x10'),auth[_0xa496('0xc')](),controller['show']);router[_0xa496('0x11')]('/',auth[_0xa496('0xc')](),controller[_0xa496('0x12')]);router[_0xa496('0x13')](_0xa496('0x10'),auth[_0xa496('0xc')](),controller[_0xa496('0x14')]);router[_0xa496('0x15')](_0xa496('0x10'),auth[_0xa496('0xc')](),controller[_0xa496('0x16')]);module['exports']=router; \ No newline at end of file +var _0xeb37=['../../components/auth/service','../../config/environment','isAuthenticated','get','/describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xeb37,0x176));var _0x7eb3=function(_0x3d7a4a,_0x39d280){_0x3d7a4a=_0x3d7a4a-0x0;var _0x21e66f=_0xeb37[_0x3d7a4a];return _0x21e66f;};'use strict';var multer=require(_0x7eb3('0x0'));var util=require(_0x7eb3('0x1'));var path=require(_0x7eb3('0x2'));var timeout=require('connect-timeout');var express=require(_0x7eb3('0x3'));var router=express[_0x7eb3('0x4')]();var fs_extra=require(_0x7eb3('0x5'));var auth=require(_0x7eb3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7eb3('0x7'));var controller=require('./voiceAgentReport.controller');router['get']('/',auth[_0x7eb3('0x8')](),controller['index']);router[_0x7eb3('0x9')](_0x7eb3('0xa'),auth[_0x7eb3('0x8')](),controller['describe']);router[_0x7eb3('0x9')]('/:id',auth[_0x7eb3('0x8')](),controller[_0x7eb3('0xb')]);router[_0x7eb3('0xc')]('/',auth['isAuthenticated'](),controller[_0x7eb3('0xd')]);router[_0x7eb3('0xe')](_0x7eb3('0xf'),auth[_0x7eb3('0x8')](),controller[_0x7eb3('0x10')]);router[_0x7eb3('0x11')]('/:id',auth[_0x7eb3('0x8')](),controller[_0x7eb3('0x12')]);module[_0x7eb3('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 56584ed..0b5e138 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 _0x282b=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x282b,0xec));var _0xb282=function(_0x48b9d5,_0x191b27){_0x48b9d5=_0x48b9d5-0x0;var _0x4739c3=_0x282b[_0x48b9d5];return _0x4739c3;};'use strict';var Sequelize=require(_0xb282('0x0'));module[_0xb282('0x1')]={'type':{'type':Sequelize[_0xb282('0x2')]},'uniqueid':{'type':Sequelize[_0xb282('0x2')]},'calleridnum':{'type':Sequelize[_0xb282('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xb282('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xb282('0x3')]},'agentconnectAt':{'type':Sequelize[_0xb282('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xb282('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xb282('0x3')]},'agentdumpAt':{'type':Sequelize[_0xb282('0x3')]},'holdtime':{'type':Sequelize[_0xb282('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xb282('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xb282('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb282('0x4')]},'reason':{'type':Sequelize[_0xb282('0x2')]},'lastevent':{'type':Sequelize[_0xb282('0x2')]},'channel':{'type':Sequelize[_0xb282('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xb282('0x2')]},'connectedlinename':{'type':Sequelize[_0xb282('0x2')]},'language':{'type':Sequelize[_0xb282('0x2')]},'accountcode':{'type':Sequelize[_0xb282('0x2')]},'context':{'type':Sequelize[_0xb282('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xb282('0x2')]},'destchannelstate':{'type':Sequelize[_0xb282('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xb282('0x2')]},'destcalleridnum':{'type':Sequelize[_0xb282('0x2')]},'destcalleridname':{'type':Sequelize[_0xb282('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xb282('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xb282('0x2')]},'destcontext':{'type':Sequelize[_0xb282('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xb282('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xb282('0x2')]},'transfer':{'type':Sequelize[_0xb282('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb282('0x2')],'comment':_0xb282('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xb282('0x2')]},'agententerreason':{'type':Sequelize[_0xb282('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9c1d=['exports','STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x442013,_0x4cadc1){var _0x1730f5=function(_0x93914e){while(--_0x93914e){_0x442013['push'](_0x442013['shift']());}};_0x1730f5(++_0x4cadc1);}(_0x9c1d,0x1a9));var _0xd9c1=function(_0x19d52e,_0x5c676c){_0x19d52e=_0x19d52e-0x0;var _0x50d4f8=_0x9c1d[_0x19d52e];return _0x50d4f8;};'use strict';var Sequelize=require(_0xd9c1('0x0'));module[_0xd9c1('0x1')]={'type':{'type':Sequelize[_0xd9c1('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xd9c1('0x2')]},'calleridname':{'type':Sequelize[_0xd9c1('0x2')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xd9c1('0x2')]},'membername':{'type':Sequelize[_0xd9c1('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xd9c1('0x3')]},'agentcompleteAt':{'type':Sequelize[_0xd9c1('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xd9c1('0x3')]},'agentdumpAt':{'type':Sequelize[_0xd9c1('0x3')]},'holdtime':{'type':Sequelize[_0xd9c1('0x4')]},'agentcomplete':{'type':Sequelize[_0xd9c1('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xd9c1('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xd9c1('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0xd9c1('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xd9c1('0x4')]},'reason':{'type':Sequelize[_0xd9c1('0x2')]},'lastevent':{'type':Sequelize[_0xd9c1('0x2')]},'channel':{'type':Sequelize[_0xd9c1('0x2')]},'channelstate':{'type':Sequelize[_0xd9c1('0x4')]},'channelstatedesc':{'type':Sequelize[_0xd9c1('0x2')]},'connectedlinenum':{'type':Sequelize[_0xd9c1('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd9c1('0x2')]},'accountcode':{'type':Sequelize[_0xd9c1('0x2')]},'context':{'type':Sequelize[_0xd9c1('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xd9c1('0x2')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xd9c1('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0xd9c1('0x2')]},'destcalleridnum':{'type':Sequelize[_0xd9c1('0x2')]},'destcalleridname':{'type':Sequelize[_0xd9c1('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xd9c1('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xd9c1('0x2')]},'destlanguage':{'type':Sequelize[_0xd9c1('0x2')]},'destaccountcode':{'type':Sequelize[_0xd9c1('0x2')]},'destcontext':{'type':Sequelize[_0xd9c1('0x2')]},'destexten':{'type':Sequelize[_0xd9c1('0x2')]},'destpriority':{'type':Sequelize[_0xd9c1('0x2')]},'destuniqueid':{'type':Sequelize[_0xd9c1('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xd9c1('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xd9c1('0x2')]},'transfer':{'type':Sequelize[_0xd9c1('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0xd9c1('0x2')]},'transferuniqueid':{'type':Sequelize[_0xd9c1('0x2')]},'agententerreason':{'type':Sequelize[_0xd9c1('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 6b203c2..5d28f39 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 _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file +var _0xa9e0=['type','options','includeAll','include','findAll','catch','show','params','find','body','describe','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0a9e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0a9e('0x4'));var util=require(_0x0a9e('0x5'));var path=require(_0x0a9e('0x6'));var sox=require(_0x0a9e('0x7'));var csv=require(_0x0a9e('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0a9e('0x9'));var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x0a9e('0x13'));var db=require(_0x0a9e('0x14'))['db'];function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=typeof _0x22dccb['offset']===_0x0a9e('0x19')&&typeof _0x22dccb[_0x0a9e('0x1a')]==='undefined';var _0x225616=_0x5d0880['count'];var _0x459eb1=_0x1985b6?0x0:_0x22dccb[_0x0a9e('0x1b')];var _0x106033=_0x1985b6?_0x5d0880[_0x0a9e('0x1c')]:_0x22dccb[_0x0a9e('0x1b')]+_0x22dccb[_0x0a9e('0x1a')];var _0x530eb7;if(_0x106033>=_0x225616){_0x106033=_0x225616;_0x530eb7=0xc8;}else{_0x530eb7=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x530eb7);return _0x52a03d[_0x0a9e('0x1d')](_0x0a9e('0x1e'),_0x459eb1+'-'+_0x106033+'/'+_0x225616)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x105080){return function(_0x4bb1e3){try{jsonpatch[_0x0a9e('0x1f')](_0x4bb1e3,_0x105080,!![]);}catch(_0x155cce){return BPromise['reject'](_0x155cce);}return _0x4bb1e3[_0x0a9e('0x20')]();};}function saveUpdates(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')](_0x5a09ef)[_0x0a9e('0x22')](function(_0x30bae6){return _0x30bae6;});}return null;};}function removeEntity(_0x4abc77,_0xfb6e48){return function(_0x2fb0e4){if(_0x2fb0e4){return _0x2fb0e4[_0x0a9e('0x23')]()[_0x0a9e('0x22')](function(){_0x4abc77[_0x0a9e('0x17')](0xcc)[_0x0a9e('0x16')]();});}};}function handleEntityNotFound(_0x16b1ca,_0x5ea472){return function(_0x59181e){if(!_0x59181e){_0x16b1ca[_0x0a9e('0x15')](0x194);}return _0x59181e;};}function handleError(_0x3a8e58,_0x40c424){_0x40c424=_0x40c424||0x1f4;return function(_0x33161b){logger['error'](_0x33161b[_0x0a9e('0x24')]);if(_0x33161b['name']){delete _0x33161b[_0x0a9e('0x25')];}_0x3a8e58['status'](_0x40c424)[_0x0a9e('0x26')](_0x33161b);};}exports[_0x0a9e('0x27')]=function(_0x25fba9,_0x14433c){var _0x140511={},_0x1538a4={},_0x11c3b6={'count':0x0,'rows':[]};var _0x14de77=_['map'](db[_0x0a9e('0x28')][_0x0a9e('0x29')],function(_0x2b1f27){return{'name':_0x2b1f27[_0x0a9e('0x2a')],'type':_0x2b1f27['type'][_0x0a9e('0x2b')]};});_0x1538a4[_0x0a9e('0x2c')]=_[_0x0a9e('0x2d')](_0x14de77,_0x0a9e('0x25'));_0x1538a4[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x25fba9[_0x0a9e('0x2e')]);_0x1538a4[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x1538a4['model'],_0x1538a4[_0x0a9e('0x2e')]);_0x140511['attributes']=_[_0x0a9e('0x31')](_0x1538a4[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0x140511['attributes']=_0x140511[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0x140511[_0x0a9e('0x33')]:_0x1538a4[_0x0a9e('0x2c')];if(!_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x35')](_0x0a9e('0x36'))){_0x140511[_0x0a9e('0x1a')]=qs['limit'](_0x25fba9[_0x0a9e('0x2e')]['limit']);_0x140511[_0x0a9e('0x1b')]=qs[_0x0a9e('0x1b')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x1b')]);}_0x140511['order']=qs[_0x0a9e('0x37')](_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x37')]);_0x140511[_0x0a9e('0x38')]=qs['filters'](_['pick'](_0x25fba9[_0x0a9e('0x2e')],_0x1538a4['filters']),_0x14de77);if(_0x25fba9[_0x0a9e('0x2e')][_0x0a9e('0x39')]){_0x140511[_0x0a9e('0x38')]=_[_0x0a9e('0x3a')](_0x140511['where'],{'$or':_[_0x0a9e('0x2d')](_0x14de77,function(_0x3bfce8){if(_0x3bfce8[_0x0a9e('0x3b')]!=='VIRTUAL'){var _0x1dbf74={};_0x1dbf74[_0x3bfce8[_0x0a9e('0x25')]]={'$like':'%'+_0x25fba9[_0x0a9e('0x2e')]['filter']+'%'};return _0x1dbf74;}})});}_0x140511=_['merge']({},_0x140511,_0x25fba9[_0x0a9e('0x3c')]);var _0x40d766={'where':_0x140511['where']};return db[_0x0a9e('0x28')][_0x0a9e('0x1c')](_0x40d766)[_0x0a9e('0x22')](function(_0x148f55){_0x11c3b6['count']=_0x148f55;if(_0x25fba9['query'][_0x0a9e('0x3d')]){_0x140511[_0x0a9e('0x3e')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x0a9e('0x3f')](_0x140511);})[_0x0a9e('0x22')](function(_0x1459bb){_0x11c3b6['rows']=_0x1459bb;return _0x11c3b6;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x14433c,_0x140511))[_0x0a9e('0x40')](handleError(_0x14433c,null));};exports[_0x0a9e('0x41')]=function(_0x43dd5b,_0x13cb1f){var _0xeaa5e5={'raw':![],'where':{'id':_0x43dd5b[_0x0a9e('0x42')]['id']}},_0x2881b3={};_0x2881b3[_0x0a9e('0x2c')]=_[_0x0a9e('0x2f')](db[_0x0a9e('0x28')][_0x0a9e('0x29')]);_0x2881b3[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x43dd5b[_0x0a9e('0x2e')]);_0x2881b3['filters']=_['intersection'](_0x2881b3[_0x0a9e('0x2c')],_0x2881b3[_0x0a9e('0x2e')]);_0xeaa5e5[_0x0a9e('0x33')]=_[_0x0a9e('0x31')](_0x2881b3[_0x0a9e('0x2c')],qs[_0x0a9e('0x32')](_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x32')]));_0xeaa5e5[_0x0a9e('0x33')]=_0xeaa5e5[_0x0a9e('0x33')][_0x0a9e('0x34')]?_0xeaa5e5[_0x0a9e('0x33')]:_0x2881b3['model'];if(_0x43dd5b[_0x0a9e('0x2e')][_0x0a9e('0x3d')]){_0xeaa5e5[_0x0a9e('0x3e')]=[{'all':!![]}];}_0xeaa5e5=_[_0x0a9e('0x3a')]({},_0xeaa5e5,_0x43dd5b[_0x0a9e('0x3c')]);return db[_0x0a9e('0x28')][_0x0a9e('0x43')](_0xeaa5e5)[_0x0a9e('0x22')](handleEntityNotFound(_0x13cb1f,null))['then'](respondWithResult(_0x13cb1f,null))[_0x0a9e('0x40')](handleError(_0x13cb1f,null));};exports['create']=function(_0x473dc8,_0x476688){return db[_0x0a9e('0x28')]['create'](_0x473dc8[_0x0a9e('0x44')],{})[_0x0a9e('0x22')](respondWithResult(_0x476688,0xc9))[_0x0a9e('0x40')](handleError(_0x476688,null));};exports[_0x0a9e('0x21')]=function(_0x45c845,_0x37be73){if(_0x45c845[_0x0a9e('0x44')]['id']){delete _0x45c845['body']['id'];}return db[_0x0a9e('0x28')][_0x0a9e('0x43')]({'where':{'id':_0x45c845[_0x0a9e('0x42')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x37be73,null))[_0x0a9e('0x22')](saveUpdates(_0x45c845[_0x0a9e('0x44')],null))[_0x0a9e('0x22')](respondWithResult(_0x37be73,null))[_0x0a9e('0x40')](handleError(_0x37be73,null));};exports[_0x0a9e('0x23')]=function(_0x58a5c2,_0xe401a){return db[_0x0a9e('0x28')]['find']({'where':{'id':_0x58a5c2['params']['id']}})['then'](handleEntityNotFound(_0xe401a,null))[_0x0a9e('0x22')](removeEntity(_0xe401a,null))[_0x0a9e('0x40')](handleError(_0xe401a,null));};exports[_0x0a9e('0x45')]=function(_0x11545a,_0x61bb17){return db[_0x0a9e('0x28')][_0x0a9e('0x45')]()[_0x0a9e('0x22')](respondWithResult(_0x61bb17,null))['catch'](handleError(_0x61bb17,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 5b35b3d..71f9726 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 _0x1501=['path','rimraf','./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','util','../../config/logger','api','bluebird','request-promise'];(function(_0x49f913,_0x12ccd8){var _0xf48ea5=function(_0xfd48b0){while(--_0xfd48b0){_0x49f913['push'](_0x49f913['shift']());}};_0xf48ea5(++_0x12ccd8);}(_0x1501,0x126));var _0x1150=function(_0x3ed0e4,_0x473e73){_0x3ed0e4=_0x3ed0e4-0x0;var _0x13d9ee=_0x1501[_0x3ed0e4];return _0x13d9ee;};'use strict';var _=require('lodash');var util=require(_0x1150('0x0'));var logger=require(_0x1150('0x1'))(_0x1150('0x2'));var moment=require('moment');var BPromise=require(_0x1150('0x3'));var rp=require(_0x1150('0x4'));var fs=require('fs');var path=require(_0x1150('0x5'));var rimraf=require(_0x1150('0x6'));var config=require('../../config/environment');var attributes=require(_0x1150('0x7'));module['exports']=function(_0x63c724,_0x316a7d){return _0x63c724[_0x1150('0x8')](_0x1150('0x9'),attributes,{'tableName':_0x1150('0xa'),'paranoid':![],'indexes':[{'fields':[_0x1150('0xb'),_0x1150('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9ab0=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash'];(function(_0x18dc89,_0x1020bb){var _0x467f42=function(_0xacb90c){while(--_0xacb90c){_0x18dc89['push'](_0x18dc89['shift']());}};_0x467f42(++_0x1020bb);}(_0x9ab0,0x195));var _0x09ab=function(_0x35f24f,_0x3bf4b4){_0x35f24f=_0x35f24f-0x0;var _0x44b103=_0x9ab0[_0x35f24f];return _0x44b103;};'use strict';var _=require(_0x09ab('0x0'));var util=require(_0x09ab('0x1'));var logger=require(_0x09ab('0x2'))(_0x09ab('0x3'));var moment=require(_0x09ab('0x4'));var BPromise=require(_0x09ab('0x5'));var rp=require(_0x09ab('0x6'));var fs=require('fs');var path=require(_0x09ab('0x7'));var rimraf=require(_0x09ab('0x8'));var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module['exports']=function(_0x3144ec,_0x387ac8){return _0x3144ec[_0x09ab('0x9')](_0x09ab('0xa'),attributes,{'tableName':_0x09ab('0xb'),'paranoid':![],'indexes':[{'fields':[_0x09ab('0xc'),_0x09ab('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 6ccb997..1c61ca6 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 _0x99bb=['then','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','catch','VoiceAgentReport','create','options','raw','CreateVoiceAgentReport','UpdateVoiceAgentReport','update','body','attributes','lodash','util','moment','bluebird','../../mysqldb','../../config/environment','client','request'];(function(_0x1c7586,_0x1d46bd){var _0x3bd9a1=function(_0x2f2d4d){while(--_0x2f2d4d){_0x1c7586['push'](_0x1c7586['shift']());}};_0x3bd9a1(++_0x1d46bd);}(_0x99bb,0x14a));var _0xb99b=function(_0x1bcf55,_0x3eefa4){_0x1bcf55=_0x1bcf55-0x0;var _0x30bf4c=_0x99bb[_0x1bcf55];return _0x30bf4c;};'use strict';var _=require(_0xb99b('0x0'));var util=require(_0xb99b('0x1'));var moment=require(_0xb99b('0x2'));var BPromise=require(_0xb99b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb99b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xb99b('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb99b('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a21a7,_0x5d150b,_0x5c87c2){return new BPromise(function(_0x56ea5f,_0x5ab2b7){return client[_0xb99b('0x7')](_0x4a21a7,_0x5c87c2)[_0xb99b('0x8')](function(_0x8b1cdb){logger['info'](_0xb99b('0x9'),_0x5d150b,'request\x20sent');logger[_0xb99b('0xa')](_0xb99b('0xb'),_0x5d150b,_0xb99b('0xc'),JSON['stringify'](_0x8b1cdb));if(_0x8b1cdb[_0xb99b('0xd')]){if(_0x8b1cdb['error']['code']===0x1f4){logger[_0xb99b('0xd')](_0xb99b('0x9'),_0x5d150b,_0x8b1cdb[_0xb99b('0xd')][_0xb99b('0xe')]);return _0x5ab2b7(_0x8b1cdb[_0xb99b('0xd')]['message']);}logger[_0xb99b('0xd')](_0xb99b('0x9'),_0x5d150b,_0x8b1cdb['error']['message']);return _0x56ea5f(_0x8b1cdb[_0xb99b('0xd')][_0xb99b('0xe')]);}else{logger[_0xb99b('0xf')](_0xb99b('0x9'),_0x5d150b,_0xb99b('0xc'));_0x56ea5f(_0x8b1cdb['result'][_0xb99b('0xe')]);}})[_0xb99b('0x10')](function(_0x4b7e3b){logger[_0xb99b('0xd')](_0xb99b('0x9'),_0x5d150b,_0x4b7e3b);_0x5ab2b7(_0x4b7e3b);});});}exports['CreateVoiceAgentReport']=function(_0x27391d){var _0x35e859=this;return new Promise(function(_0xb94620,_0x1e17ce){return db[_0xb99b('0x11')][_0xb99b('0x12')](_0x27391d['body'],{'raw':_0x27391d[_0xb99b('0x13')]?_0x27391d[_0xb99b('0x13')][_0xb99b('0x14')]===undefined?!![]:![]:!![]})[_0xb99b('0x8')](function(_0x14d08c){logger[_0xb99b('0xf')]('CreateVoiceAgentReport',_0x27391d);logger[_0xb99b('0xa')]('CreateVoiceAgentReport',_0x27391d,JSON['stringify'](_0x14d08c));_0xb94620(_0x14d08c);})[_0xb99b('0x10')](function(_0x5d90ed){logger[_0xb99b('0xd')](_0xb99b('0x15'),_0x5d90ed[_0xb99b('0xe')],_0x27391d);_0x1e17ce(_0x35e859[_0xb99b('0xd')](0x1f4,_0x5d90ed['message']));});});};exports[_0xb99b('0x16')]=function(_0x911442){var _0x156e95=this;return new Promise(function(_0x505f7e,_0x543ba0){return db[_0xb99b('0x11')][_0xb99b('0x17')](_0x911442[_0xb99b('0x18')],{'raw':_0x911442['options']?_0x911442[_0xb99b('0x13')][_0xb99b('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x911442[_0xb99b('0x13')]?_0x911442[_0xb99b('0x13')]['where']||null:null,'attributes':_0x911442[_0xb99b('0x13')]?_0x911442[_0xb99b('0x13')][_0xb99b('0x19')]||null:null,'limit':_0x911442[_0xb99b('0x13')]?_0x911442[_0xb99b('0x13')]['limit']||null:null})[_0xb99b('0x8')](function(_0x8a5bf0){logger['info']('UpdateVoiceAgentReport',_0x911442);logger[_0xb99b('0xa')](_0xb99b('0x16'),_0x911442,JSON['stringify'](_0x8a5bf0));_0x505f7e(_0x8a5bf0);})['catch'](function(_0x11c816){logger['error'](_0xb99b('0x16'),_0x11c816[_0xb99b('0xe')],_0x911442);_0x543ba0(_0x156e95[_0xb99b('0xd')](0x1f4,_0x11c816[_0xb99b('0xe')]));});});}; \ No newline at end of file +var _0x3cd2=['../../config/logger','rpc','../../config/environment','client','http','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','then','debug','UpdateVoiceAgentReport','update','where','attributes','limit','util','bluebird','randomstring','ioredis'];(function(_0x2270a5,_0x1de292){var _0x2ab31b=function(_0x37b3ad){while(--_0x37b3ad){_0x2270a5['push'](_0x2270a5['shift']());}};_0x2ab31b(++_0x1de292);}(_0x3cd2,0x188));var _0x23cd=function(_0x134227,_0x375809){_0x134227=_0x134227-0x0;var _0x42775a=_0x3cd2[_0x134227];return _0x42775a;};'use strict';var _=require('lodash');var util=require(_0x23cd('0x0'));var moment=require('moment');var BPromise=require(_0x23cd('0x1'));var rs=require(_0x23cd('0x2'));var fs=require('fs');var Redis=require(_0x23cd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x23cd('0x4'))(_0x23cd('0x5'));var config=require(_0x23cd('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x23cd('0x7')][_0x23cd('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f0a6e,_0x351e98,_0x34a0fb){return new BPromise(function(_0x588517,_0x5160e6){return client[_0x23cd('0x9')](_0x2f0a6e,_0x34a0fb)['then'](function(_0x16c378){logger[_0x23cd('0xa')](_0x23cd('0xb'),_0x351e98,_0x23cd('0xc'));logger['debug'](_0x23cd('0xd'),_0x351e98,_0x23cd('0xc'),JSON[_0x23cd('0xe')](_0x16c378));if(_0x16c378[_0x23cd('0xf')]){if(_0x16c378[_0x23cd('0xf')][_0x23cd('0x10')]===0x1f4){logger[_0x23cd('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x351e98,_0x16c378[_0x23cd('0xf')][_0x23cd('0x11')]);return _0x5160e6(_0x16c378[_0x23cd('0xf')][_0x23cd('0x11')]);}logger[_0x23cd('0xf')](_0x23cd('0xb'),_0x351e98,_0x16c378[_0x23cd('0xf')][_0x23cd('0x11')]);return _0x588517(_0x16c378['error']['message']);}else{logger[_0x23cd('0xa')](_0x23cd('0xb'),_0x351e98,_0x23cd('0xc'));_0x588517(_0x16c378[_0x23cd('0x12')][_0x23cd('0x11')]);}})[_0x23cd('0x13')](function(_0x4a4b76){logger[_0x23cd('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x351e98,_0x4a4b76);_0x5160e6(_0x4a4b76);});});}exports[_0x23cd('0x14')]=function(_0x1720c2){var _0x588c27=this;return new Promise(function(_0x58615d,_0xf93e83){return db[_0x23cd('0x15')][_0x23cd('0x16')](_0x1720c2[_0x23cd('0x17')],{'raw':_0x1720c2[_0x23cd('0x18')]?_0x1720c2[_0x23cd('0x18')][_0x23cd('0x19')]===undefined?!![]:![]:!![]})[_0x23cd('0x1a')](function(_0x213b84){logger[_0x23cd('0xa')]('CreateVoiceAgentReport',_0x1720c2);logger[_0x23cd('0x1b')](_0x23cd('0x14'),_0x1720c2,JSON[_0x23cd('0xe')](_0x213b84));_0x58615d(_0x213b84);})[_0x23cd('0x13')](function(_0x4c3bc9){logger[_0x23cd('0xf')](_0x23cd('0x14'),_0x4c3bc9[_0x23cd('0x11')],_0x1720c2);_0xf93e83(_0x588c27['error'](0x1f4,_0x4c3bc9[_0x23cd('0x11')]));});});};exports[_0x23cd('0x1c')]=function(_0x2bcd52){var _0x202a9c=this;return new Promise(function(_0x4a9430,_0x300eaa){return db['VoiceAgentReport'][_0x23cd('0x1d')](_0x2bcd52[_0x23cd('0x17')],{'raw':_0x2bcd52[_0x23cd('0x18')]?_0x2bcd52[_0x23cd('0x18')][_0x23cd('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2bcd52['options']?_0x2bcd52['options'][_0x23cd('0x1e')]||null:null,'attributes':_0x2bcd52[_0x23cd('0x18')]?_0x2bcd52['options'][_0x23cd('0x1f')]||null:null,'limit':_0x2bcd52[_0x23cd('0x18')]?_0x2bcd52['options'][_0x23cd('0x20')]||null:null})[_0x23cd('0x1a')](function(_0x35c670){logger['info'](_0x23cd('0x1c'),_0x2bcd52);logger[_0x23cd('0x1b')](_0x23cd('0x1c'),_0x2bcd52,JSON[_0x23cd('0xe')](_0x35c670));_0x4a9430(_0x35c670);})[_0x23cd('0x13')](function(_0x5ea2f6){logger[_0x23cd('0xf')](_0x23cd('0x1c'),_0x5ea2f6[_0x23cd('0x11')],_0x2bcd52);_0x300eaa(_0x202a9c[_0x23cd('0xf')](0x1f4,_0x5ea2f6[_0x23cd('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index ad21f30..c41c93d 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 _0x46ed=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','multer'];(function(_0x11e2b0,_0x386c82){var _0x1b9672=function(_0x51096d){while(--_0x51096d){_0x11e2b0['push'](_0x11e2b0['shift']());}};_0x1b9672(++_0x386c82);}(_0x46ed,0x168));var _0xd46e=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x46ed[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var path=require('path');var timeout=require(_0xd46e('0x2'));var express=require(_0xd46e('0x3'));var router=express[_0xd46e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xd46e('0x5'));var interaction=require(_0xd46e('0x6'));var config=require('../../config/environment');var controller=require(_0xd46e('0x7'));router[_0xd46e('0x8')]('/',auth[_0xd46e('0x9')](),controller[_0xd46e('0xa')]);router[_0xd46e('0x8')](_0xd46e('0xb'),auth[_0xd46e('0x9')](),controller[_0xd46e('0xc')]);router[_0xd46e('0x8')](_0xd46e('0xd'),auth[_0xd46e('0x9')](),controller['show']);router[_0xd46e('0xe')]('/',auth[_0xd46e('0x9')](),controller['create']);router[_0xd46e('0xf')](_0xd46e('0xd'),auth[_0xd46e('0x9')](),controller[_0xd46e('0x10')]);router[_0xd46e('0x11')](_0xd46e('0xd'),auth['isAuthenticated'](),controller[_0xd46e('0x12')]);module['exports']=router; \ No newline at end of file +var _0xb138=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','isAuthenticated','index','/describe','describe','/:id','create','put','delete','destroy','exports','multer','util','path'];(function(_0x554e24,_0x4ef8f6){var _0x25b475=function(_0x4e7798){while(--_0x4e7798){_0x554e24['push'](_0x554e24['shift']());}};_0x25b475(++_0x4ef8f6);}(_0xb138,0x1dd));var _0x8b13=function(_0x579d58,_0x1517da){_0x579d58=_0x579d58-0x0;var _0x155d36=_0xb138[_0x579d58];return _0x155d36;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var fs_extra=require(_0x8b13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var controller=require(_0x8b13('0x9'));router['get']('/',auth[_0x8b13('0xa')](),controller[_0x8b13('0xb')]);router['get'](_0x8b13('0xc'),auth[_0x8b13('0xa')](),controller[_0x8b13('0xd')]);router['get'](_0x8b13('0xe'),auth[_0x8b13('0xa')](),controller['show']);router['post']('/',auth[_0x8b13('0xa')](),controller[_0x8b13('0xf')]);router[_0x8b13('0x10')](_0x8b13('0xe'),auth[_0x8b13('0xa')](),controller['update']);router[_0x8b13('0x11')](_0x8b13('0xe'),auth[_0x8b13('0xa')](),controller[_0x8b13('0x12')]);module[_0x8b13('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 56ac657..5a6fa3b 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 _0xed0b=['STRING','ENUM','inbound','outbound-fax','TEXT','DATE','INTEGER','sequelize'];(function(_0x135705,_0x1e4438){var _0x3cdb42=function(_0x4fe1bd){while(--_0x4fe1bd){_0x135705['push'](_0x135705['shift']());}};_0x3cdb42(++_0x1e4438);}(_0xed0b,0x15f));var _0xbed0=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xed0b[_0x20589d];return _0x422de9;};'use strict';var Sequelize=require(_0xbed0('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xbed0('0x1')]},'type':{'type':Sequelize[_0xbed0('0x2')](_0xbed0('0x3'),'internal','outbound','inbound-fax',_0xbed0('0x4'),'dialer')},'tag':{'type':Sequelize[_0xbed0('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0xbed0('0x1')]},'destinationcontext':{'type':Sequelize[_0xbed0('0x1')]},'callerid':{'type':Sequelize[_0xbed0('0x1')]},'channel':{'type':Sequelize[_0xbed0('0x1')]},'destinationchannel':{'type':Sequelize[_0xbed0('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xbed0('0x5')]},'starttime':{'type':Sequelize[_0xbed0('0x6')]},'systemanswertime':{'type':Sequelize[_0xbed0('0x6')]},'answertime':{'type':Sequelize[_0xbed0('0x6')]},'endtime':{'type':Sequelize[_0xbed0('0x6')]},'duration':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize[_0xbed0('0x7')]},'mohtime':{'type':Sequelize[_0xbed0('0x7')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xbed0('0x1')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xbed0('0x1')]},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0xbed0('0x1')]},'userThirdDisposition':{'type':Sequelize[_0xbed0('0x1')]},'note':{'type':Sequelize[_0xbed0('0x1')]},'prefix':{'type':Sequelize[_0xbed0('0x1')]},'routeid':{'type':Sequelize[_0xbed0('0x7')]},'sipcallid':{'type':Sequelize[_0xbed0('0x1')]}}; \ No newline at end of file +var _0x9f7b=['exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax','dialer','TEXT','DATE','INTEGER','sequelize'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0x9f7b,0x15e));var _0xb9f7=function(_0xe4bc78,_0x549371){_0xe4bc78=_0xe4bc78-0x0;var _0x11fb77=_0x9f7b[_0xe4bc78];return _0x11fb77;};'use strict';var Sequelize=require(_0xb9f7('0x0'));module[_0xb9f7('0x1')]={'uniqueid':{'type':Sequelize[_0xb9f7('0x2')]},'type':{'type':Sequelize[_0xb9f7('0x3')](_0xb9f7('0x4'),_0xb9f7('0x5'),_0xb9f7('0x6'),_0xb9f7('0x7'),_0xb9f7('0x8'),_0xb9f7('0x9'))},'tag':{'type':Sequelize[_0xb9f7('0x2')]},'accountcode':{'type':Sequelize[_0xb9f7('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0xb9f7('0x2')]},'destinationcontext':{'type':Sequelize[_0xb9f7('0x2')]},'callerid':{'type':Sequelize[_0xb9f7('0x2')]},'channel':{'type':Sequelize[_0xb9f7('0x2')]},'destinationchannel':{'type':Sequelize[_0xb9f7('0x2')]},'lastapplication':{'type':Sequelize[_0xb9f7('0x2')]},'lastdata':{'type':Sequelize[_0xb9f7('0xa')]},'starttime':{'type':Sequelize[_0xb9f7('0xb')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xb9f7('0xb')]},'endtime':{'type':Sequelize[_0xb9f7('0xb')]},'duration':{'type':Sequelize[_0xb9f7('0xc')]},'billableseconds':{'type':Sequelize[_0xb9f7('0xc')]},'mohtime':{'type':Sequelize[_0xb9f7('0xc')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xb9f7('0x2')]},'amaflags':{'type':Sequelize[_0xb9f7('0x2')]},'userfield':{'type':Sequelize[_0xb9f7('0x2')]},'userDisposition':{'type':Sequelize[_0xb9f7('0x2')]},'userSecondDisposition':{'type':Sequelize['STRING']},'userThirdDisposition':{'type':Sequelize[_0xb9f7('0x2')]},'note':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0xb9f7('0x2')]},'routeid':{'type':Sequelize[_0xb9f7('0xc')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index ad389a3..745ec5c 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 _0xb10b=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','merge','options','VoiceCallReport','includeAll','include','alias','User','rows','show','find','create','body','catch','params','describe','uniqueid','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce'];(function(_0x20765e,_0x4ef104){var _0x4a6213=function(_0x18cf51){while(--_0x18cf51){_0x20765e['push'](_0x20765e['shift']());}};_0x4a6213(++_0x4ef104);}(_0xb10b,0x12a));var _0xbb10=function(_0x213295,_0x465d81){_0x213295=_0x213295-0x0;var _0x43a797=_0xb10b[_0x213295];return _0x43a797;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));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('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){_0x1824b7[_0xbb10('0x19')](0xcc)[_0xbb10('0x25')]();});}};}function handleEntityNotFound(_0x537898,_0x4fedac){return function(_0x4fb5e0){if(!_0x4fb5e0){_0x537898[_0xbb10('0x18')](0x194);}return _0x4fb5e0;};}function handleError(_0x3c5ae7,_0x2c89b9){_0x2c89b9=_0x2c89b9||0x1f4;return function(_0x4e25ff){logger[_0xbb10('0x26')](_0x4e25ff[_0xbb10('0x27')]);if(_0x4e25ff[_0xbb10('0x28')]){delete _0x4e25ff[_0xbb10('0x28')];}_0x3c5ae7[_0xbb10('0x19')](_0x2c89b9)[_0xbb10('0x29')](_0x4e25ff);};}exports[_0xbb10('0x2a')]=function(_0x4aabb9,_0x3796c7){var _0x21ac54={},_0xfc3595={},_0x2e0249={'count':0x0,'rows':[]};var _0x1d30aa=_[_0xbb10('0x2b')](db['VoiceCallReport'][_0xbb10('0x2c')],function(_0x4ee02e){return{'name':_0x4ee02e[_0xbb10('0x2d')],'type':_0x4ee02e['type'][_0xbb10('0x2e')]};});_0xfc3595[_0xbb10('0x2f')]=_[_0xbb10('0x2b')](_0x1d30aa,'name');_0xfc3595['query']=_[_0xbb10('0x30')](_0x4aabb9[_0xbb10('0x31')]);_0xfc3595['filters']=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],_0xfc3595[_0xbb10('0x31')]);_0x21ac54[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0xfc3595[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x4aabb9['query'][_0xbb10('0x34')]));_0x21ac54[_0xbb10('0x33')]=_0x21ac54[_0xbb10('0x33')][_0xbb10('0x35')]?_0x21ac54[_0xbb10('0x33')]:_0xfc3595[_0xbb10('0x2f')];if(!_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x36')](_0xbb10('0x37'))){_0x21ac54['limit']=qs[_0xbb10('0x1c')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x1c')]);_0x21ac54[_0xbb10('0x1b')]=qs['offset'](_0x4aabb9[_0xbb10('0x31')]['offset']);}_0x21ac54['order']=qs[_0xbb10('0x38')](_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x38')]);_0x21ac54[_0xbb10('0x39')]=qs[_0xbb10('0x3a')](_[_0xbb10('0x3b')](_0x4aabb9['query'],_0xfc3595[_0xbb10('0x3a')]),_0x1d30aa);if(_0x4aabb9[_0xbb10('0x31')]['filter']){_0x21ac54['where']=_['merge'](_0x21ac54[_0xbb10('0x39')],{'$or':_[_0xbb10('0x2b')](_0x1d30aa,function(_0x2b658a){if(_0x2b658a['type']!==_0xbb10('0x3c')){var _0x3e8538={};_0x3e8538[_0x2b658a[_0xbb10('0x28')]]={'$like':'%'+_0x4aabb9['query'][_0xbb10('0x3d')]+'%'};return _0x3e8538;}})});}_0x21ac54=_[_0xbb10('0x3e')]({},_0x21ac54,_0x4aabb9[_0xbb10('0x3f')]);var _0x446f49={'where':_0x21ac54['where']};return db[_0xbb10('0x40')][_0xbb10('0x1e')](_0x446f49)['then'](function(_0xe2040f){_0x2e0249[_0xbb10('0x1e')]=_0xe2040f;if(_0x4aabb9[_0xbb10('0x31')][_0xbb10('0x41')]){_0x21ac54[_0xbb10('0x42')]=[{'attributes':['id',_0xbb10('0x28'),'fullname',_0xbb10('0x43')],'model':db[_0xbb10('0x44')],'as':_0xbb10('0x44')}];}return db[_0xbb10('0x40')]['findAll'](_0x21ac54);})[_0xbb10('0x23')](function(_0x331751){_0x2e0249[_0xbb10('0x45')]=_0x331751;return _0x2e0249;})[_0xbb10('0x23')](respondWithFilteredResult(_0x3796c7,_0x21ac54))['catch'](handleError(_0x3796c7,null));};exports[_0xbb10('0x46')]=function(_0x202c60,_0x54ac18){var _0x5d9a4f={'raw':!![],'where':{'id':_0x202c60['params']['id']}},_0x38d78f={};_0x38d78f[_0xbb10('0x2f')]=_[_0xbb10('0x30')](db['VoiceCallReport'][_0xbb10('0x2c')]);_0x38d78f[_0xbb10('0x31')]=_[_0xbb10('0x30')](_0x202c60['query']);_0x38d78f[_0xbb10('0x3a')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],_0x38d78f[_0xbb10('0x31')]);_0x5d9a4f[_0xbb10('0x33')]=_[_0xbb10('0x32')](_0x38d78f[_0xbb10('0x2f')],qs[_0xbb10('0x34')](_0x202c60[_0xbb10('0x31')][_0xbb10('0x34')]));_0x5d9a4f[_0xbb10('0x33')]=_0x5d9a4f[_0xbb10('0x33')]['length']?_0x5d9a4f[_0xbb10('0x33')]:_0x38d78f[_0xbb10('0x2f')];if(_0x202c60['query'][_0xbb10('0x41')]){_0x5d9a4f[_0xbb10('0x42')]=[{'all':!![]}];}_0x5d9a4f=_[_0xbb10('0x3e')]({},_0x5d9a4f,_0x202c60[_0xbb10('0x3f')]);return db[_0xbb10('0x40')][_0xbb10('0x47')](_0x5d9a4f)[_0xbb10('0x23')](handleEntityNotFound(_0x54ac18,null))['then'](respondWithResult(_0x54ac18,null))['catch'](handleError(_0x54ac18,null));};exports[_0xbb10('0x48')]=function(_0x76a208,_0x2b12bd){return db['VoiceCallReport']['create'](_0x76a208[_0xbb10('0x49')],{})[_0xbb10('0x23')](respondWithResult(_0x2b12bd,0xc9))[_0xbb10('0x4a')](handleError(_0x2b12bd,null));};exports[_0xbb10('0x24')]=function(_0x10159b,_0x22b315){return db[_0xbb10('0x40')][_0xbb10('0x47')]({'where':{'id':_0x10159b[_0xbb10('0x4b')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x22b315,null))['then'](removeEntity(_0x22b315,null))['catch'](handleError(_0x22b315,null));};exports[_0xbb10('0x4c')]=function(_0x467dba,_0x36ab7d){return db[_0xbb10('0x40')][_0xbb10('0x4c')]()[_0xbb10('0x23')](respondWithResult(_0x36ab7d,null))[_0xbb10('0x4a')](handleError(_0x36ab7d,null));};exports[_0xbb10('0x22')]=function(_0x1c0d8f,_0x1214f7){if(_0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')]){delete _0x1c0d8f[_0xbb10('0x49')][_0xbb10('0x4d')];}return db[_0xbb10('0x40')]['find']({'where':{'uniqueid':_0x1c0d8f[_0xbb10('0x4b')]['id'],'UserId':{'$or':[null,_0x1c0d8f['user']['id']]}}})[_0xbb10('0x23')](handleEntityNotFound(_0x1214f7,null))[_0xbb10('0x23')](saveUpdates(_0x1c0d8f[_0xbb10('0x49')],null))[_0xbb10('0x23')](respondWithResult(_0x1214f7,null))[_0xbb10('0x4a')](handleError(_0x1214f7,null));}; \ No newline at end of file +var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x5f66,0x1a0));var _0x65f6=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x5f66[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index be5051e..c8176bf 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 _0x1d5c=['rimraf','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x552b21,_0x4e6e66){var _0x535611=function(_0x518b19){while(--_0x518b19){_0x552b21['push'](_0x552b21['shift']());}};_0x535611(++_0x4e6e66);}(_0x1d5c,0xeb));var _0xc1d5=function(_0x1d2f15,_0x1107c6){_0x1d2f15=_0x1d2f15-0x0;var _0x19efd2=_0x1d5c[_0x1d2f15];return _0x19efd2;};'use strict';var _=require(_0xc1d5('0x0'));var util=require(_0xc1d5('0x1'));var logger=require(_0xc1d5('0x2'))(_0xc1d5('0x3'));var moment=require(_0xc1d5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc1d5('0x5'));var config=require('../../config/environment');var attributes=require(_0xc1d5('0x6'));module[_0xc1d5('0x7')]=function(_0x4a80ad,_0x2accf0){return _0x4a80ad[_0xc1d5('0x8')](_0xc1d5('0x9'),attributes,{'tableName':_0xc1d5('0xa'),'paranoid':![],'indexes':[{'fields':[_0xc1d5('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5a1f=['define','VoiceCallReport','report_call','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','exports'];(function(_0xe11825,_0x153aba){var _0x3268b9=function(_0x3be661){while(--_0x3be661){_0xe11825['push'](_0xe11825['shift']());}};_0x3268b9(++_0x153aba);}(_0x5a1f,0x19c));var _0xf5a1=function(_0x1e97c5,_0x4012d0){_0x1e97c5=_0x1e97c5-0x0;var _0x165bac=_0x5a1f[_0x1e97c5];return _0x165bac;};'use strict';var _=require(_0xf5a1('0x0'));var util=require(_0xf5a1('0x1'));var logger=require(_0xf5a1('0x2'))(_0xf5a1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf5a1('0x4'));var fs=require('fs');var path=require(_0xf5a1('0x5'));var rimraf=require(_0xf5a1('0x6'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0xf5a1('0x7')]=function(_0x23af9e,_0x2f9f73){return _0x23af9e[_0xf5a1('0x8')](_0xf5a1('0x9'),attributes,{'tableName':_0xf5a1('0xa'),'paranoid':![],'indexes':[{'fields':[_0xf5a1('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 61fa13a..e59efba 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 _0xe081=['create','body','update','where','UpdateVoiceCallReport','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','attributes','limit','include','map','model','CreateVoiceCallReport'];(function(_0x27a057,_0x255f9c){var _0xff90bc=function(_0x403f71){while(--_0x403f71){_0x27a057['push'](_0x27a057['shift']());}};_0xff90bc(++_0x255f9c);}(_0xe081,0x1bd));var _0x1e08=function(_0x1c7115,_0x47b37a){_0x1c7115=_0x1c7115-0x0;var _0xca4fac=_0xe081[_0x1c7115];return _0xca4fac;};'use strict';var _=require('lodash');var util=require(_0x1e08('0x0'));var moment=require(_0x1e08('0x1'));var BPromise=require(_0x1e08('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e08('0x3'));var db=require(_0x1e08('0x4'))['db'];var utils=require(_0x1e08('0x5'));var logger=require(_0x1e08('0x6'))(_0x1e08('0x7'));var config=require(_0x1e08('0x8'));var jayson=require(_0x1e08('0x9'));var client=jayson[_0x1e08('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24d6bc,_0x4a9345,_0x258a41){return new BPromise(function(_0xc2f6d9,_0x418ff9){return client[_0x1e08('0xb')](_0x24d6bc,_0x258a41)[_0x1e08('0xc')](function(_0x127097){logger[_0x1e08('0xd')](_0x1e08('0xe'),_0x4a9345,_0x1e08('0xf'));logger[_0x1e08('0x10')](_0x1e08('0x11'),_0x4a9345,_0x1e08('0xf'),JSON[_0x1e08('0x12')](_0x127097));if(_0x127097[_0x1e08('0x13')]){if(_0x127097[_0x1e08('0x13')][_0x1e08('0x14')]===0x1f4){logger[_0x1e08('0x13')](_0x1e08('0xe'),_0x4a9345,_0x127097[_0x1e08('0x13')][_0x1e08('0x15')]);return _0x418ff9(_0x127097[_0x1e08('0x13')][_0x1e08('0x15')]);}logger[_0x1e08('0x13')](_0x1e08('0xe'),_0x4a9345,_0x127097['error'][_0x1e08('0x15')]);return _0xc2f6d9(_0x127097[_0x1e08('0x13')][_0x1e08('0x15')]);}else{logger[_0x1e08('0xd')](_0x1e08('0xe'),_0x4a9345,_0x1e08('0xf'));_0xc2f6d9(_0x127097[_0x1e08('0x16')]['message']);}})[_0x1e08('0x17')](function(_0x3afaeb){logger[_0x1e08('0x13')](_0x1e08('0xe'),_0x4a9345,_0x3afaeb);_0x418ff9(_0x3afaeb);});});}exports[_0x1e08('0x18')]=function(_0x384714){var _0x5c70eb=this;return new Promise(function(_0x19914d,_0x226b3c){return db[_0x1e08('0x19')][_0x1e08('0x1a')]({'raw':_0x384714[_0x1e08('0x1b')]?_0x384714['options'][_0x1e08('0x1c')]===undefined?!![]:![]:!![],'where':_0x384714[_0x1e08('0x1b')]?_0x384714[_0x1e08('0x1b')]['where']||null:null,'attributes':_0x384714[_0x1e08('0x1b')]?_0x384714['options'][_0x1e08('0x1d')]||null:null,'limit':_0x384714[_0x1e08('0x1b')]?_0x384714[_0x1e08('0x1b')][_0x1e08('0x1e')]||null:null,'include':_0x384714[_0x1e08('0x1b')]?_0x384714[_0x1e08('0x1b')][_0x1e08('0x1f')]?_[_0x1e08('0x20')](_0x384714[_0x1e08('0x1b')][_0x1e08('0x1f')],function(_0x40b187){return{'model':db[_0x40b187[_0x1e08('0x21')]],'as':_0x40b187['as'],'attributes':_0x40b187['attributes'],'include':_0x40b187[_0x1e08('0x1f')]?_[_0x1e08('0x20')](_0x40b187['include'],function(_0x49c8da){return{'model':db[_0x49c8da[_0x1e08('0x21')]],'as':_0x49c8da['as'],'attributes':_0x49c8da['attributes'],'include':_0x49c8da[_0x1e08('0x1f')]?_['map'](_0x49c8da[_0x1e08('0x1f')],function(_0x5eb9a2){return{'model':db[_0x5eb9a2[_0x1e08('0x21')]],'as':_0x5eb9a2['as'],'attributes':_0x5eb9a2[_0x1e08('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x1e08('0xc')](function(_0xaf73b5){logger[_0x1e08('0xd')](_0x1e08('0x18'),_0x384714);logger[_0x1e08('0x10')](_0x1e08('0x18'),_0x384714,JSON[_0x1e08('0x12')](_0xaf73b5));_0x19914d(_0xaf73b5);})[_0x1e08('0x17')](function(_0x4411a8){logger[_0x1e08('0x13')](_0x1e08('0x18'),_0x4411a8['message'],_0x384714);_0x226b3c(_0x5c70eb[_0x1e08('0x13')](0x1f4,_0x4411a8[_0x1e08('0x15')]));});});};exports[_0x1e08('0x22')]=function(_0x230f2a){var _0x15441d=this;return new Promise(function(_0x13e62,_0x2b6baf){return db[_0x1e08('0x19')][_0x1e08('0x23')](_0x230f2a[_0x1e08('0x24')],{'raw':_0x230f2a['options']?_0x230f2a[_0x1e08('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x1e08('0xc')](function(_0x325d6e){logger[_0x1e08('0xd')](_0x1e08('0x22'),_0x230f2a);logger[_0x1e08('0x10')]('CreateVoiceCallReport',_0x230f2a,JSON[_0x1e08('0x12')](_0x325d6e));_0x13e62(_0x325d6e);})[_0x1e08('0x17')](function(_0x20d263){logger[_0x1e08('0x13')](_0x1e08('0x22'),_0x20d263[_0x1e08('0x15')],_0x230f2a);_0x2b6baf(_0x15441d[_0x1e08('0x13')](0x1f4,_0x20d263['message']));});});};exports['UpdateVoiceCallReport']=function(_0x341ef8){var _0x3094c8=this;return new Promise(function(_0x302686,_0x53f8ed){return db[_0x1e08('0x19')][_0x1e08('0x25')](_0x341ef8['body'],{'raw':_0x341ef8[_0x1e08('0x1b')]?_0x341ef8[_0x1e08('0x1b')][_0x1e08('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x341ef8['options']?_0x341ef8['options'][_0x1e08('0x26')]||null:null,'attributes':_0x341ef8[_0x1e08('0x1b')]?_0x341ef8[_0x1e08('0x1b')]['attributes']||null:null,'limit':_0x341ef8[_0x1e08('0x1b')]?_0x341ef8[_0x1e08('0x1b')]['limit']||null:null})[_0x1e08('0xc')](function(_0x591b8d){logger['info'](_0x1e08('0x27'),_0x341ef8);logger[_0x1e08('0x10')](_0x1e08('0x27'),_0x341ef8,JSON['stringify'](_0x591b8d));_0x302686(_0x591b8d);})[_0x1e08('0x17')](function(_0x2c2281){logger[_0x1e08('0x13')](_0x1e08('0x27'),_0x2c2281['message'],_0x341ef8);_0x53f8ed(_0x3094c8[_0x1e08('0x13')](0x1f4,_0x2c2281[_0x1e08('0x15')]));});});}; \ No newline at end of file +var _0x3923=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceCallReport','create','UpdateVoiceCallReport','update'];(function(_0x555e79,_0x9ee00e){var _0x36cb67=function(_0x207ec7){while(--_0x207ec7){_0x555e79['push'](_0x555e79['shift']());}};_0x36cb67(++_0x9ee00e);}(_0x3923,0x1e0));var _0x3392=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3923[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3392('0x0'));var util=require(_0x3392('0x1'));var moment=require(_0x3392('0x2'));var BPromise=require(_0x3392('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3392('0x4'));var db=require(_0x3392('0x5'))['db'];var utils=require(_0x3392('0x6'));var logger=require(_0x3392('0x7'))(_0x3392('0x8'));var config=require('../../config/environment');var jayson=require(_0x3392('0x9'));var client=jayson[_0x3392('0xa')][_0x3392('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25e80a,_0x50744e,_0x5d2f23){return new BPromise(function(_0x8044fb,_0x3fc57e){return client[_0x3392('0xc')](_0x25e80a,_0x5d2f23)[_0x3392('0xd')](function(_0x10c33d){logger['info'](_0x3392('0xe'),_0x50744e,_0x3392('0xf'));logger[_0x3392('0x10')](_0x3392('0x11'),_0x50744e,_0x3392('0xf'),JSON[_0x3392('0x12')](_0x10c33d));if(_0x10c33d[_0x3392('0x13')]){if(_0x10c33d['error'][_0x3392('0x14')]===0x1f4){logger['error'](_0x3392('0xe'),_0x50744e,_0x10c33d[_0x3392('0x13')][_0x3392('0x15')]);return _0x3fc57e(_0x10c33d[_0x3392('0x13')]['message']);}logger[_0x3392('0x13')](_0x3392('0xe'),_0x50744e,_0x10c33d[_0x3392('0x13')][_0x3392('0x15')]);return _0x8044fb(_0x10c33d['error']['message']);}else{logger[_0x3392('0x16')](_0x3392('0xe'),_0x50744e,_0x3392('0xf'));_0x8044fb(_0x10c33d[_0x3392('0x17')][_0x3392('0x15')]);}})[_0x3392('0x18')](function(_0xa009de){logger[_0x3392('0x13')]('VoiceCallReport,\x20%s,\x20%s',_0x50744e,_0xa009de);_0x3fc57e(_0xa009de);});});}exports[_0x3392('0x19')]=function(_0xf240a9){var _0x6286d6=this;return new Promise(function(_0x42ab7f,_0x26be5b){return db[_0x3392('0x1a')][_0x3392('0x1b')]({'raw':_0xf240a9[_0x3392('0x1c')]?_0xf240a9[_0x3392('0x1c')][_0x3392('0x1d')]===undefined?!![]:![]:!![],'where':_0xf240a9[_0x3392('0x1c')]?_0xf240a9[_0x3392('0x1c')][_0x3392('0x1e')]||null:null,'attributes':_0xf240a9['options']?_0xf240a9[_0x3392('0x1c')][_0x3392('0x1f')]||null:null,'limit':_0xf240a9[_0x3392('0x1c')]?_0xf240a9['options'][_0x3392('0x20')]||null:null,'include':_0xf240a9[_0x3392('0x1c')]?_0xf240a9[_0x3392('0x1c')][_0x3392('0x21')]?_[_0x3392('0x22')](_0xf240a9[_0x3392('0x1c')]['include'],function(_0x460a7d){return{'model':db[_0x460a7d[_0x3392('0x23')]],'as':_0x460a7d['as'],'attributes':_0x460a7d['attributes'],'include':_0x460a7d[_0x3392('0x21')]?_[_0x3392('0x22')](_0x460a7d[_0x3392('0x21')],function(_0x2a8aca){return{'model':db[_0x2a8aca['model']],'as':_0x2a8aca['as'],'attributes':_0x2a8aca[_0x3392('0x1f')],'include':_0x2a8aca[_0x3392('0x21')]?_[_0x3392('0x22')](_0x2a8aca[_0x3392('0x21')],function(_0x4543e1){return{'model':db[_0x4543e1['model']],'as':_0x4543e1['as'],'attributes':_0x4543e1['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c8bbc){logger['info'](_0x3392('0x19'),_0xf240a9);logger[_0x3392('0x10')](_0x3392('0x19'),_0xf240a9,JSON[_0x3392('0x12')](_0x5c8bbc));_0x42ab7f(_0x5c8bbc);})['catch'](function(_0x1d7b30){logger[_0x3392('0x13')](_0x3392('0x19'),_0x1d7b30['message'],_0xf240a9);_0x26be5b(_0x6286d6[_0x3392('0x13')](0x1f4,_0x1d7b30[_0x3392('0x15')]));});});};exports[_0x3392('0x24')]=function(_0x1f4037){var _0x1e32a4=this;return new Promise(function(_0x574658,_0xba09cd){return db[_0x3392('0x1a')][_0x3392('0x25')](_0x1f4037['body'],{'raw':_0x1f4037[_0x3392('0x1c')]?_0x1f4037[_0x3392('0x1c')][_0x3392('0x1d')]===undefined?!![]:![]:!![]})[_0x3392('0xd')](function(_0x1f4f66){logger[_0x3392('0x16')](_0x3392('0x24'),_0x1f4037);logger['debug'](_0x3392('0x24'),_0x1f4037,JSON[_0x3392('0x12')](_0x1f4f66));_0x574658(_0x1f4f66);})['catch'](function(_0x2d9f49){logger[_0x3392('0x13')](_0x3392('0x24'),_0x2d9f49[_0x3392('0x15')],_0x1f4037);_0xba09cd(_0x1e32a4[_0x3392('0x13')](0x1f4,_0x2d9f49[_0x3392('0x15')]));});});};exports[_0x3392('0x26')]=function(_0x96421f){var _0x59aa6a=this;return new Promise(function(_0x411361,_0x11388c){return db[_0x3392('0x1a')][_0x3392('0x27')](_0x96421f['body'],{'raw':_0x96421f['options']?_0x96421f[_0x3392('0x1c')][_0x3392('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x96421f[_0x3392('0x1c')]?_0x96421f[_0x3392('0x1c')][_0x3392('0x1e')]||null:null,'attributes':_0x96421f[_0x3392('0x1c')]?_0x96421f[_0x3392('0x1c')][_0x3392('0x1f')]||null:null,'limit':_0x96421f['options']?_0x96421f[_0x3392('0x1c')]['limit']||null:null})['then'](function(_0xe07056){logger[_0x3392('0x16')](_0x3392('0x26'),_0x96421f);logger[_0x3392('0x10')]('UpdateVoiceCallReport',_0x96421f,JSON['stringify'](_0xe07056));_0x411361(_0xe07056);})[_0x3392('0x18')](function(_0x2609d0){logger[_0x3392('0x13')](_0x3392('0x26'),_0x2609d0['message'],_0x96421f);_0x11388c(_0x59aa6a['error'](0x1f4,_0x2609d0['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 015c93b..ca96508 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 _0xc134=['util','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','show','post','create','put','/:id','update','exports'];(function(_0x430524,_0x23b611){var _0x3a726d=function(_0x5cc39d){while(--_0x5cc39d){_0x430524['push'](_0x430524['shift']());}};_0x3a726d(++_0x23b611);}(_0xc134,0x1a0));var _0x4c13=function(_0x57fc1e,_0x1dfca2){_0x57fc1e=_0x57fc1e-0x0;var _0x54616e=_0xc134[_0x57fc1e];return _0x54616e;};'use strict';var multer=require('multer');var util=require(_0x4c13('0x0'));var path=require(_0x4c13('0x1'));var timeout=require(_0x4c13('0x2'));var express=require(_0x4c13('0x3'));var router=express[_0x4c13('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4c13('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0x4c13('0x6')]('/',auth[_0x4c13('0x7')](),controller[_0x4c13('0x8')]);router[_0x4c13('0x6')]('/:id',auth[_0x4c13('0x7')](),controller[_0x4c13('0x9')]);router[_0x4c13('0xa')]('/',auth[_0x4c13('0x7')](),controller[_0x4c13('0xb')]);router[_0x4c13('0xc')](_0x4c13('0xd'),auth[_0x4c13('0x7')](),controller[_0x4c13('0xe')]);router['delete'](_0x4c13('0xd'),auth[_0x4c13('0x7')](),controller['destroy']);module[_0x4c13('0xf')]=router; \ No newline at end of file +var _0xd2c2=['../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x10e9cc,_0x81a27f){var _0x68de49=function(_0x16fe44){while(--_0x16fe44){_0x10e9cc['push'](_0x10e9cc['shift']());}};_0x68de49(++_0x81a27f);}(_0xd2c2,0xcb));var _0x2d2c=function(_0x5a840a,_0x33a052){_0x5a840a=_0x5a840a-0x0;var _0x167525=_0xd2c2[_0x5a840a];return _0x167525;};'use strict';var multer=require(_0x2d2c('0x0'));var util=require('util');var path=require(_0x2d2c('0x1'));var timeout=require(_0x2d2c('0x2'));var express=require(_0x2d2c('0x3'));var router=express['Router']();var fs_extra=require(_0x2d2c('0x4'));var auth=require(_0x2d2c('0x5'));var interaction=require(_0x2d2c('0x6'));var config=require(_0x2d2c('0x7'));var controller=require(_0x2d2c('0x8'));router['get']('/',auth[_0x2d2c('0x9')](),controller['index']);router['get'](_0x2d2c('0xa'),auth[_0x2d2c('0x9')](),controller[_0x2d2c('0xb')]);router[_0x2d2c('0xc')]('/',auth[_0x2d2c('0x9')](),controller[_0x2d2c('0xd')]);router[_0x2d2c('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x2d2c('0xf')]);router[_0x2d2c('0x10')](_0x2d2c('0xa'),auth[_0x2d2c('0x9')](),controller[_0x2d2c('0x11')]);module[_0x2d2c('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 97ca58c..6c8983f 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 _0x3027=['options','BOOLEAN','sequelize','exports','STRING','getDataValue'];(function(_0x396be2,_0x16d201){var _0x3197ef=function(_0x2c97bb){while(--_0x2c97bb){_0x396be2['push'](_0x396be2['shift']());}};_0x3197ef(++_0x16d201);}(_0x3027,0x128));var _0x7302=function(_0x232be6,_0x58c722){_0x232be6=_0x232be6-0x0;var _0x5c4524=_0x3027[_0x232be6];return _0x5c4524;};'use strict';var Sequelize=require(_0x7302('0x0'));module[_0x7302('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize[_0x7302('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x7302('0x2')],'set':function(_0x565732){this['setDataValue']('options',_0x565732?_0x565732['join'](''):[]);},'get':function(){return this[_0x7302('0x3')](_0x7302('0x4'))?this[_0x7302('0x3')](_0x7302('0x4'))['split'](''):[];}},'auth':{'type':Sequelize[_0x7302('0x5')],'defaultValue':![]},'password':{'type':Sequelize[_0x7302('0x2')]},'record':{'type':Sequelize[_0x7302('0x5')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x7302('0x2')]},'description':{'type':Sequelize[_0x7302('0x2')]}}; \ No newline at end of file +var _0x3204=['sequelize','exports','STRING','options','join','getDataValue','split','BOOLEAN'];(function(_0x5e4563,_0x3ff918){var _0x8d1bf5=function(_0x3bf7a9){while(--_0x3bf7a9){_0x5e4563['push'](_0x5e4563['shift']());}};_0x8d1bf5(++_0x3ff918);}(_0x3204,0x70));var _0x4320=function(_0xd9f7e2,_0x1bf3a3){_0xd9f7e2=_0xd9f7e2-0x0;var _0x4a6b84=_0x3204[_0xd9f7e2];return _0x4a6b84;};'use strict';var Sequelize=require(_0x4320('0x0'));module[_0x4320('0x1')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x4320('0x2')],'set':function(_0x163117){this['setDataValue'](_0x4320('0x3'),_0x163117?_0x163117[_0x4320('0x4')](''):[]);},'get':function(){return this[_0x4320('0x5')](_0x4320('0x3'))?this[_0x4320('0x5')]('options')[_0x4320('0x6')](''):[];}},'auth':{'type':Sequelize[_0x4320('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x4320('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 9cedb2a..1ab93e5 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 _0x1ddc=['merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','index','VoiceChanSpy','fieldName','type','model','map','query','filters','intersection','attributes','fields','nolimit','order','sort','where','pick'];(function(_0x299c54,_0x5ba02a){var _0x17a1d8=function(_0x25d3fe){while(--_0x25d3fe){_0x299c54['push'](_0x299c54['shift']());}};_0x17a1d8(++_0x5ba02a);}(_0x1ddc,0x6e));var _0xc1dd=function(_0x3ea99a,_0x4f3f9d){_0x3ea99a=_0x3ea99a-0x0;var _0x579c5b=_0x1ddc[_0x3ea99a];return _0x579c5b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc1dd('0x0'));var zipdir=require(_0xc1dd('0x1'));var jsonpatch=require(_0xc1dd('0x2'));var rp=require('request-promise');var moment=require(_0xc1dd('0x3'));var BPromise=require(_0xc1dd('0x4'));var Mustache=require('mustache');var util=require(_0xc1dd('0x5'));var path=require(_0xc1dd('0x6'));var sox=require('sox');var csv=require(_0xc1dd('0x7'));var ejs=require(_0xc1dd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc1dd('0x9'));var squel=require(_0xc1dd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc1dd('0xb'));var toCsv=require(_0xc1dd('0x7'));var querystring=require(_0xc1dd('0xc'));var Papa=require(_0xc1dd('0xd'));var Redis=require('ioredis');var authService=require(_0xc1dd('0xe'));var qs=require(_0xc1dd('0xf'));var as=require(_0xc1dd('0x10'));var hardwareService=require(_0xc1dd('0x11'));var logger=require('../../config/logger')(_0xc1dd('0x12'));var utils=require(_0xc1dd('0x13'));var config=require(_0xc1dd('0x14'));var licenseUtil=require(_0xc1dd('0x15'));var db=require(_0xc1dd('0x16'))['db'];function respondWithStatusCode(_0x2613c9,_0x1d9815){_0x1d9815=_0x1d9815||0xcc;return function(_0x83a291){if(_0x83a291){return _0x2613c9[_0xc1dd('0x17')](_0x1d9815);}return _0x2613c9[_0xc1dd('0x18')](_0x1d9815)[_0xc1dd('0x19')]();};}function respondWithResult(_0x576fc1,_0x3d4c7f){_0x3d4c7f=_0x3d4c7f||0xc8;return function(_0x30f49a){if(_0x30f49a){return _0x576fc1[_0xc1dd('0x18')](_0x3d4c7f)[_0xc1dd('0x1a')](_0x30f49a);}};}function respondWithFilteredResult(_0x104177,_0x52a9b8){return function(_0xe5a17a){if(_0xe5a17a){var _0x76994c=typeof _0x52a9b8[_0xc1dd('0x1b')]===_0xc1dd('0x1c')&&typeof _0x52a9b8['limit']==='undefined';var _0x3e7e6f=_0xe5a17a['count'];var _0x35139a=_0x76994c?0x0:_0x52a9b8['offset'];var _0x6198a7=_0x76994c?_0xe5a17a[_0xc1dd('0x1d')]:_0x52a9b8[_0xc1dd('0x1b')]+_0x52a9b8[_0xc1dd('0x1e')];var _0x312054;if(_0x6198a7>=_0x3e7e6f){_0x6198a7=_0x3e7e6f;_0x312054=0xc8;}else{_0x312054=0xce;}_0x104177[_0xc1dd('0x18')](_0x312054);return _0x104177['set'](_0xc1dd('0x1f'),_0x35139a+'-'+_0x6198a7+'/'+_0x3e7e6f)[_0xc1dd('0x1a')](_0xe5a17a);}return null;};}function patchUpdates(_0x5e99a6){return function(_0x3d22bb){try{jsonpatch[_0xc1dd('0x20')](_0x3d22bb,_0x5e99a6,!![]);}catch(_0x3650fd){return BPromise[_0xc1dd('0x21')](_0x3650fd);}return _0x3d22bb[_0xc1dd('0x22')]();};}function saveUpdates(_0x266147,_0x228626){return function(_0x60ef4a){if(_0x60ef4a){return _0x60ef4a['update'](_0x266147)[_0xc1dd('0x23')](function(_0x16a2b0){return _0x16a2b0;});}return null;};}function removeEntity(_0x22f9be,_0x3363ff){return function(_0x5f4c9e){if(_0x5f4c9e){return _0x5f4c9e[_0xc1dd('0x24')]()[_0xc1dd('0x23')](function(){var _0x30b4b8=_0x5f4c9e[_0xc1dd('0x25')]({'plain':!![]});var _0x16fb8b=_0xc1dd('0x26');return db[_0xc1dd('0x27')][_0xc1dd('0x24')]({'where':{'type':_0x16fb8b,'resourceId':_0x30b4b8['id']}})[_0xc1dd('0x23')](function(){return _0x5f4c9e;});})[_0xc1dd('0x23')](function(){_0x22f9be[_0xc1dd('0x18')](0xcc)[_0xc1dd('0x19')]();});}};}function handleEntityNotFound(_0x1d3b04,_0xc6607f){return function(_0x5b8edc){if(!_0x5b8edc){_0x1d3b04['sendStatus'](0x194);}return _0x5b8edc;};}function handleError(_0x388f35,_0x19d818){_0x19d818=_0x19d818||0x1f4;return function(_0x25a651){logger[_0xc1dd('0x28')](_0x25a651[_0xc1dd('0x29')]);if(_0x25a651[_0xc1dd('0x2a')]){delete _0x25a651[_0xc1dd('0x2a')];}_0x388f35['status'](_0x19d818)[_0xc1dd('0x2b')](_0x25a651);};}exports[_0xc1dd('0x2c')]=function(_0x34abb7,_0xed3d4c){var _0x5ce3eb={},_0x14b1d4={},_0x2fe0ba={'count':0x0,'rows':[]};var _0x2938e2=_['map'](db[_0xc1dd('0x2d')]['rawAttributes'],function(_0x26f119){return{'name':_0x26f119[_0xc1dd('0x2e')],'type':_0x26f119[_0xc1dd('0x2f')]['key']};});_0x14b1d4[_0xc1dd('0x30')]=_[_0xc1dd('0x31')](_0x2938e2,_0xc1dd('0x2a'));_0x14b1d4[_0xc1dd('0x32')]=_['keys'](_0x34abb7[_0xc1dd('0x32')]);_0x14b1d4[_0xc1dd('0x33')]=_[_0xc1dd('0x34')](_0x14b1d4['model'],_0x14b1d4['query']);_0x5ce3eb[_0xc1dd('0x35')]=_[_0xc1dd('0x34')](_0x14b1d4[_0xc1dd('0x30')],qs[_0xc1dd('0x36')](_0x34abb7[_0xc1dd('0x32')]['fields']));_0x5ce3eb[_0xc1dd('0x35')]=_0x5ce3eb[_0xc1dd('0x35')]['length']?_0x5ce3eb[_0xc1dd('0x35')]:_0x14b1d4[_0xc1dd('0x30')];if(!_0x34abb7[_0xc1dd('0x32')]['hasOwnProperty'](_0xc1dd('0x37'))){_0x5ce3eb['limit']=qs[_0xc1dd('0x1e')](_0x34abb7[_0xc1dd('0x32')]['limit']);_0x5ce3eb[_0xc1dd('0x1b')]=qs[_0xc1dd('0x1b')](_0x34abb7[_0xc1dd('0x32')][_0xc1dd('0x1b')]);}_0x5ce3eb[_0xc1dd('0x38')]=qs[_0xc1dd('0x39')](_0x34abb7[_0xc1dd('0x32')][_0xc1dd('0x39')]);_0x5ce3eb[_0xc1dd('0x3a')]=qs[_0xc1dd('0x33')](_[_0xc1dd('0x3b')](_0x34abb7[_0xc1dd('0x32')],_0x14b1d4['filters']),_0x2938e2);if(_0x34abb7[_0xc1dd('0x32')]['filter']){_0x5ce3eb[_0xc1dd('0x3a')]=_[_0xc1dd('0x3c')](_0x5ce3eb[_0xc1dd('0x3a')],{'$or':_[_0xc1dd('0x31')](_0x2938e2,function(_0x4764d2){if(_0x4764d2[_0xc1dd('0x2f')]!==_0xc1dd('0x3d')){var _0x583688={};_0x583688[_0x4764d2[_0xc1dd('0x2a')]]={'$like':'%'+_0x34abb7['query'][_0xc1dd('0x3e')]+'%'};return _0x583688;}})});}_0x5ce3eb=_[_0xc1dd('0x3c')]({},_0x5ce3eb,_0x34abb7[_0xc1dd('0x3f')]);var _0x27bea1={'where':_0x5ce3eb[_0xc1dd('0x3a')]};return db[_0xc1dd('0x2d')][_0xc1dd('0x1d')](_0x27bea1)['then'](function(_0x2d903f){_0x2fe0ba[_0xc1dd('0x1d')]=_0x2d903f;if(_0x34abb7[_0xc1dd('0x32')][_0xc1dd('0x40')]){_0x5ce3eb[_0xc1dd('0x41')]=[{'all':!![]}];}return db[_0xc1dd('0x2d')][_0xc1dd('0x42')](_0x5ce3eb);})[_0xc1dd('0x23')](function(_0x445586){_0x2fe0ba[_0xc1dd('0x43')]=_0x445586;return _0x2fe0ba;})[_0xc1dd('0x23')](respondWithFilteredResult(_0xed3d4c,_0x5ce3eb))[_0xc1dd('0x44')](handleError(_0xed3d4c,null));};exports[_0xc1dd('0x45')]=function(_0x5d5bdb,_0x285b38){var _0x2f50f5={'raw':![],'where':{'id':_0x5d5bdb[_0xc1dd('0x46')]['id']}},_0x3f3aae={};_0x3f3aae[_0xc1dd('0x30')]=_[_0xc1dd('0x47')](db[_0xc1dd('0x2d')][_0xc1dd('0x48')]);_0x3f3aae['query']=_['keys'](_0x5d5bdb[_0xc1dd('0x32')]);_0x3f3aae[_0xc1dd('0x33')]=_[_0xc1dd('0x34')](_0x3f3aae[_0xc1dd('0x30')],_0x3f3aae[_0xc1dd('0x32')]);_0x2f50f5[_0xc1dd('0x35')]=_['intersection'](_0x3f3aae[_0xc1dd('0x30')],qs[_0xc1dd('0x36')](_0x5d5bdb[_0xc1dd('0x32')][_0xc1dd('0x36')]));_0x2f50f5[_0xc1dd('0x35')]=_0x2f50f5['attributes'][_0xc1dd('0x49')]?_0x2f50f5[_0xc1dd('0x35')]:_0x3f3aae['model'];if(_0x5d5bdb[_0xc1dd('0x32')][_0xc1dd('0x40')]){_0x2f50f5[_0xc1dd('0x41')]=[{'all':!![]}];}_0x2f50f5=_['merge']({},_0x2f50f5,_0x5d5bdb[_0xc1dd('0x3f')]);return db[_0xc1dd('0x2d')]['find'](_0x2f50f5)[_0xc1dd('0x23')](handleEntityNotFound(_0x285b38,null))[_0xc1dd('0x23')](respondWithResult(_0x285b38,null))[_0xc1dd('0x44')](handleError(_0x285b38,null));};exports[_0xc1dd('0x4a')]=function(_0x55fbc9,_0x53763d){return db[_0xc1dd('0x2d')]['create'](_0x55fbc9['body'],{})['then'](function(_0x16991d){var _0x1e2319=_0x55fbc9[_0xc1dd('0x4b')]['get']({'plain':!![]});if(!_0x1e2319)throw new Error(_0xc1dd('0x4c'));if(_0x1e2319[_0xc1dd('0x4d')]===_0xc1dd('0x4b')){var _0x9e7cb7=_0x16991d[_0xc1dd('0x25')]({'plain':!![]});var _0x745e54=_0xc1dd('0x26');return db[_0xc1dd('0x4e')][_0xc1dd('0x4f')]({'where':{'name':_0x745e54,'userProfileId':_0x1e2319[_0xc1dd('0x50')]},'raw':!![]})[_0xc1dd('0x23')](function(_0x50ce4c){if(_0x50ce4c&&_0x50ce4c[_0xc1dd('0x51')]===0x0){return db[_0xc1dd('0x27')]['create']({'name':_0x9e7cb7[_0xc1dd('0x2a')],'resourceId':_0x9e7cb7['id'],'type':_0x50ce4c[_0xc1dd('0x2a')],'sectionId':_0x50ce4c['id']},{})[_0xc1dd('0x23')](function(){return _0x16991d;});}else{return _0x16991d;}})['catch'](function(_0xe1bf9a){logger['error'](_0xc1dd('0x52'),_0xe1bf9a);throw _0xe1bf9a;});}return _0x16991d;})[_0xc1dd('0x23')](respondWithResult(_0x53763d,0xc9))[_0xc1dd('0x44')](handleError(_0x53763d,null));};exports[_0xc1dd('0x53')]=function(_0x343fc2,_0x5980c8){if(_0x343fc2['body']['id']){delete _0x343fc2[_0xc1dd('0x54')]['id'];}return db[_0xc1dd('0x2d')][_0xc1dd('0x4f')]({'where':{'id':_0x343fc2[_0xc1dd('0x46')]['id']}})[_0xc1dd('0x23')](handleEntityNotFound(_0x5980c8,null))[_0xc1dd('0x23')](saveUpdates(_0x343fc2[_0xc1dd('0x54')],null))[_0xc1dd('0x23')](respondWithResult(_0x5980c8,null))[_0xc1dd('0x44')](handleError(_0x5980c8,null));};exports[_0xc1dd('0x24')]=function(_0x261028,_0x2cd794){return db[_0xc1dd('0x2d')][_0xc1dd('0x4f')]({'where':{'id':_0x261028[_0xc1dd('0x46')]['id']}})[_0xc1dd('0x23')](handleEntityNotFound(_0x2cd794,null))[_0xc1dd('0x23')](removeEntity(_0x2cd794,null))[_0xc1dd('0x44')](handleError(_0x2cd794,null));}; \ No newline at end of file +var _0x7b05=['path','sox','to-csv','fs-extra','squel','crypto','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','json','offset','undefined','limit','count','status','set','reject','save','update','then','get','ChanSpies','UserProfileResource','destroy','sendStatus','name','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','VoiceChanSpy','includeAll','include','catch','show','params','options','find','create','body','user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util'];(function(_0x5f152d,_0x4fa8ac){var _0x332df3=function(_0x3453db){while(--_0x3453db){_0x5f152d['push'](_0x5f152d['shift']());}};_0x332df3(++_0x4fa8ac);}(_0x7b05,0x91));var _0x57b0=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x7b05[_0x28947d];return _0x12d2ee;};'use strict';var emlformat=require(_0x57b0('0x0'));var rimraf=require(_0x57b0('0x1'));var zipdir=require(_0x57b0('0x2'));var jsonpatch=require(_0x57b0('0x3'));var rp=require('request-promise');var moment=require(_0x57b0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x57b0('0x5'));var util=require(_0x57b0('0x6'));var path=require(_0x57b0('0x7'));var sox=require(_0x57b0('0x8'));var csv=require(_0x57b0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x57b0('0xa'));var _=require('lodash');var squel=require(_0x57b0('0xb'));var crypto=require(_0x57b0('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x57b0('0xd'));var Redis=require(_0x57b0('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x57b0('0xf'));var logger=require(_0x57b0('0x10'))(_0x57b0('0x11'));var utils=require(_0x57b0('0x12'));var config=require(_0x57b0('0x13'));var licenseUtil=require(_0x57b0('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x363096,_0x145eae){_0x145eae=_0x145eae||0xcc;return function(_0xee8335){if(_0xee8335){return _0x363096['sendStatus'](_0x145eae);}return _0x363096['status'](_0x145eae)[_0x57b0('0x15')]();};}function respondWithResult(_0x3f95e3,_0xc9044f){_0xc9044f=_0xc9044f||0xc8;return function(_0x3b48a3){if(_0x3b48a3){return _0x3f95e3['status'](_0xc9044f)[_0x57b0('0x16')](_0x3b48a3);}};}function respondWithFilteredResult(_0x5c46a5,_0x235d4a){return function(_0xa20423){if(_0xa20423){var _0x55fd9c=typeof _0x235d4a[_0x57b0('0x17')]===_0x57b0('0x18')&&typeof _0x235d4a[_0x57b0('0x19')]===_0x57b0('0x18');var _0x3eb198=_0xa20423['count'];var _0x37bd5d=_0x55fd9c?0x0:_0x235d4a['offset'];var _0x592b2d=_0x55fd9c?_0xa20423[_0x57b0('0x1a')]:_0x235d4a[_0x57b0('0x17')]+_0x235d4a[_0x57b0('0x19')];var _0x3e14f5;if(_0x592b2d>=_0x3eb198){_0x592b2d=_0x3eb198;_0x3e14f5=0xc8;}else{_0x3e14f5=0xce;}_0x5c46a5[_0x57b0('0x1b')](_0x3e14f5);return _0x5c46a5[_0x57b0('0x1c')]('Content-Range',_0x37bd5d+'-'+_0x592b2d+'/'+_0x3eb198)[_0x57b0('0x16')](_0xa20423);}return null;};}function patchUpdates(_0x1d81ff){return function(_0x35a457){try{jsonpatch['apply'](_0x35a457,_0x1d81ff,!![]);}catch(_0x12f2f6){return BPromise[_0x57b0('0x1d')](_0x12f2f6);}return _0x35a457[_0x57b0('0x1e')]();};}function saveUpdates(_0x149056,_0x2ffc0a){return function(_0x22b11e){if(_0x22b11e){return _0x22b11e[_0x57b0('0x1f')](_0x149056)[_0x57b0('0x20')](function(_0x3497e4){return _0x3497e4;});}return null;};}function removeEntity(_0x5c60b9,_0x55b870){return function(_0x40c279){if(_0x40c279){return _0x40c279['destroy']()[_0x57b0('0x20')](function(){var _0x3ce739=_0x40c279[_0x57b0('0x21')]({'plain':!![]});var _0x38e3a0=_0x57b0('0x22');return db[_0x57b0('0x23')][_0x57b0('0x24')]({'where':{'type':_0x38e3a0,'resourceId':_0x3ce739['id']}})[_0x57b0('0x20')](function(){return _0x40c279;});})[_0x57b0('0x20')](function(){_0x5c60b9[_0x57b0('0x1b')](0xcc)[_0x57b0('0x15')]();});}};}function handleEntityNotFound(_0x43b90f,_0x196c85){return function(_0x508288){if(!_0x508288){_0x43b90f[_0x57b0('0x25')](0x194);}return _0x508288;};}function handleError(_0x114cd7,_0xf8e773){_0xf8e773=_0xf8e773||0x1f4;return function(_0x228dfe){logger['error'](_0x228dfe['stack']);if(_0x228dfe[_0x57b0('0x26')]){delete _0x228dfe[_0x57b0('0x26')];}_0x114cd7[_0x57b0('0x1b')](_0xf8e773)['send'](_0x228dfe);};}exports['index']=function(_0x9d9195,_0x577dae){var _0x12f4bf={},_0x5b6c1d={},_0x5d19a6={'count':0x0,'rows':[]};var _0x2fb4b7=_[_0x57b0('0x27')](db['VoiceChanSpy'][_0x57b0('0x28')],function(_0x32e03e){return{'name':_0x32e03e['fieldName'],'type':_0x32e03e[_0x57b0('0x29')][_0x57b0('0x2a')]};});_0x5b6c1d[_0x57b0('0x2b')]=_['map'](_0x2fb4b7,_0x57b0('0x26'));_0x5b6c1d[_0x57b0('0x2c')]=_[_0x57b0('0x2d')](_0x9d9195[_0x57b0('0x2c')]);_0x5b6c1d[_0x57b0('0x2e')]=_['intersection'](_0x5b6c1d['model'],_0x5b6c1d['query']);_0x12f4bf['attributes']=_[_0x57b0('0x2f')](_0x5b6c1d[_0x57b0('0x2b')],qs[_0x57b0('0x30')](_0x9d9195[_0x57b0('0x2c')][_0x57b0('0x30')]));_0x12f4bf['attributes']=_0x12f4bf[_0x57b0('0x31')][_0x57b0('0x32')]?_0x12f4bf[_0x57b0('0x31')]:_0x5b6c1d[_0x57b0('0x2b')];if(!_0x9d9195['query'][_0x57b0('0x33')](_0x57b0('0x34'))){_0x12f4bf['limit']=qs[_0x57b0('0x19')](_0x9d9195[_0x57b0('0x2c')]['limit']);_0x12f4bf['offset']=qs[_0x57b0('0x17')](_0x9d9195[_0x57b0('0x2c')][_0x57b0('0x17')]);}_0x12f4bf[_0x57b0('0x35')]=qs[_0x57b0('0x36')](_0x9d9195[_0x57b0('0x2c')][_0x57b0('0x36')]);_0x12f4bf[_0x57b0('0x37')]=qs[_0x57b0('0x2e')](_[_0x57b0('0x38')](_0x9d9195[_0x57b0('0x2c')],_0x5b6c1d[_0x57b0('0x2e')]),_0x2fb4b7);if(_0x9d9195['query'][_0x57b0('0x39')]){_0x12f4bf[_0x57b0('0x37')]=_[_0x57b0('0x3a')](_0x12f4bf['where'],{'$or':_['map'](_0x2fb4b7,function(_0x48bf5c){if(_0x48bf5c[_0x57b0('0x29')]!==_0x57b0('0x3b')){var _0xc3b922={};_0xc3b922[_0x48bf5c[_0x57b0('0x26')]]={'$like':'%'+_0x9d9195['query'][_0x57b0('0x39')]+'%'};return _0xc3b922;}})});}_0x12f4bf=_[_0x57b0('0x3a')]({},_0x12f4bf,_0x9d9195['options']);var _0x24afa0={'where':_0x12f4bf[_0x57b0('0x37')]};return db[_0x57b0('0x3c')][_0x57b0('0x1a')](_0x24afa0)[_0x57b0('0x20')](function(_0x5980db){_0x5d19a6[_0x57b0('0x1a')]=_0x5980db;if(_0x9d9195[_0x57b0('0x2c')][_0x57b0('0x3d')]){_0x12f4bf[_0x57b0('0x3e')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x12f4bf);})[_0x57b0('0x20')](function(_0x344bc6){_0x5d19a6['rows']=_0x344bc6;return _0x5d19a6;})[_0x57b0('0x20')](respondWithFilteredResult(_0x577dae,_0x12f4bf))[_0x57b0('0x3f')](handleError(_0x577dae,null));};exports[_0x57b0('0x40')]=function(_0x546d5d,_0x4f5ebd){var _0x3b7b4a={'raw':![],'where':{'id':_0x546d5d[_0x57b0('0x41')]['id']}},_0x3f3b1c={};_0x3f3b1c[_0x57b0('0x2b')]=_[_0x57b0('0x2d')](db['VoiceChanSpy'][_0x57b0('0x28')]);_0x3f3b1c[_0x57b0('0x2c')]=_[_0x57b0('0x2d')](_0x546d5d[_0x57b0('0x2c')]);_0x3f3b1c[_0x57b0('0x2e')]=_['intersection'](_0x3f3b1c['model'],_0x3f3b1c['query']);_0x3b7b4a['attributes']=_[_0x57b0('0x2f')](_0x3f3b1c[_0x57b0('0x2b')],qs[_0x57b0('0x30')](_0x546d5d[_0x57b0('0x2c')][_0x57b0('0x30')]));_0x3b7b4a[_0x57b0('0x31')]=_0x3b7b4a[_0x57b0('0x31')]['length']?_0x3b7b4a[_0x57b0('0x31')]:_0x3f3b1c[_0x57b0('0x2b')];if(_0x546d5d[_0x57b0('0x2c')][_0x57b0('0x3d')]){_0x3b7b4a[_0x57b0('0x3e')]=[{'all':!![]}];}_0x3b7b4a=_[_0x57b0('0x3a')]({},_0x3b7b4a,_0x546d5d[_0x57b0('0x42')]);return db['VoiceChanSpy'][_0x57b0('0x43')](_0x3b7b4a)['then'](handleEntityNotFound(_0x4f5ebd,null))[_0x57b0('0x20')](respondWithResult(_0x4f5ebd,null))['catch'](handleError(_0x4f5ebd,null));};exports[_0x57b0('0x44')]=function(_0x5cae47,_0x40dae2){return db[_0x57b0('0x3c')]['create'](_0x5cae47[_0x57b0('0x45')],{})[_0x57b0('0x20')](function(_0x1047a2){var _0x4fe484=_0x5cae47[_0x57b0('0x46')][_0x57b0('0x21')]({'plain':!![]});if(!_0x4fe484)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4fe484[_0x57b0('0x47')]===_0x57b0('0x46')){var _0x4d891b=_0x1047a2[_0x57b0('0x21')]({'plain':!![]});var _0x35ed98=_0x57b0('0x22');return db[_0x57b0('0x48')][_0x57b0('0x43')]({'where':{'name':_0x35ed98,'userProfileId':_0x4fe484['userProfileId']},'raw':!![]})['then'](function(_0x3696b5){if(_0x3696b5&&_0x3696b5[_0x57b0('0x49')]===0x0){return db[_0x57b0('0x23')]['create']({'name':_0x4d891b[_0x57b0('0x26')],'resourceId':_0x4d891b['id'],'type':_0x3696b5[_0x57b0('0x26')],'sectionId':_0x3696b5['id']},{})[_0x57b0('0x20')](function(){return _0x1047a2;});}else{return _0x1047a2;}})[_0x57b0('0x3f')](function(_0xe3c067){logger[_0x57b0('0x4a')](_0x57b0('0x4b'),_0xe3c067);throw _0xe3c067;});}return _0x1047a2;})[_0x57b0('0x20')](respondWithResult(_0x40dae2,0xc9))[_0x57b0('0x3f')](handleError(_0x40dae2,null));};exports[_0x57b0('0x1f')]=function(_0x1350a0,_0x446d19){if(_0x1350a0[_0x57b0('0x45')]['id']){delete _0x1350a0[_0x57b0('0x45')]['id'];}return db[_0x57b0('0x3c')][_0x57b0('0x43')]({'where':{'id':_0x1350a0[_0x57b0('0x41')]['id']}})[_0x57b0('0x20')](handleEntityNotFound(_0x446d19,null))['then'](saveUpdates(_0x1350a0[_0x57b0('0x45')],null))[_0x57b0('0x20')](respondWithResult(_0x446d19,null))[_0x57b0('0x3f')](handleError(_0x446d19,null));};exports['destroy']=function(_0x56bcec,_0x2670f5){return db['VoiceChanSpy']['find']({'where':{'id':_0x56bcec[_0x57b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x2670f5,null))[_0x57b0('0x20')](removeEntity(_0x2670f5,null))['catch'](handleError(_0x2670f5,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 6d7b8d9..c5a8b89 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 _0x52b2=['concat','internal','User','findAll','then','exports','define','voice_chanspy','VoiceExtension','catch','bulkCreate','lodash','bluebird','./voiceChanSpy.attributes','context','from-sip','format','%s%s','prefix','system','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','recordingFormat','auth','Authenticate','password','SIP/%s,%s','name','options','join','StopMixMonitor','length'];(function(_0x51db0c,_0x346f5a){var _0xfa1c1e=function(_0x2f9478){while(--_0x2f9478){_0x51db0c['push'](_0x51db0c['shift']());}};_0xfa1c1e(++_0x346f5a);}(_0x52b2,0x158));var _0x252b=function(_0x37ffad,_0x443124){_0x37ffad=_0x37ffad-0x0;var _0x290d04=_0x52b2[_0x37ffad];return _0x290d04;};'use strict';var _=require(_0x252b('0x0'));var util=require('util');var BPromise=require(_0x252b('0x1'));var attributes=require(_0x252b('0x2'));var getUserApplications=function(_0x38ab10,_0xe3a3a4,_0x4dd102){var _0x20eadc=0x1;var _0x3bcef2=[];var _0x352179={'context':_0xe3a3a4[_0x252b('0x3')]||_0x252b('0x4'),'exten':util[_0x252b('0x5')](_0x252b('0x6'),_0x38ab10[_0x252b('0x7')],_0x4dd102),'type':_0x252b('0x8'),'isApp':![],'ChanSpyId':_0x38ab10['id'],'UserId':_0xe3a3a4['id']};_0x3bcef2[_0x252b('0x9')](_[_0x252b('0xa')]({'app':_0x252b('0xb'),'appdata':util[_0x252b('0x5')](_0x252b('0xc'),_0x252b('0xd')),'priority':_0x20eadc++},_0x352179));if(_0x38ab10[_0x252b('0xe')]){_0x3bcef2[_0x252b('0x9')](_[_0x252b('0xa')]({'app':_0x252b('0xf'),'appdata':util[_0x252b('0x5')]('${UNIQUEID}.%s,a',_0x38ab10[_0x252b('0x10')]),'priority':_0x20eadc++},_0x352179));}if(_0x38ab10[_0x252b('0x11')]){_0x3bcef2['push'](_[_0x252b('0xa')]({'app':_0x252b('0x12'),'appdata':_0x38ab10[_0x252b('0x13')],'priority':_0x20eadc++},_0x352179));}_0x3bcef2[_0x252b('0x9')](_[_0x252b('0xa')]({'app':'ChanSpy','appdata':util[_0x252b('0x5')](_0x252b('0x14'),_0xe3a3a4[_0x252b('0x15')],_0x38ab10[_0x252b('0x16')]?_0x38ab10[_0x252b('0x16')][_0x252b('0x17')](''):''),'priority':_0x20eadc++},_0x352179));if(_0x38ab10['record']){_0x3bcef2[_0x252b('0x9')](_[_0x252b('0xa')]({'app':_0x252b('0x18'),'priority':_0x20eadc++},_0x352179));}return _0x3bcef2;};var getChanSpyApplications=function(_0x2c49fe,_0x5cc762){var _0x2eab33=[];for(var _0x141490=0x0,_0x38f4fe=0x1;_0x141490<_0x5cc762[_0x252b('0x19')];_0x141490++,_0x38f4fe=0x1){_0x2eab33=_0x2eab33[_0x252b('0x1a')](getUserApplications(_0x2c49fe,_0x5cc762[_0x141490],_0x5cc762[_0x141490][_0x252b('0x1b')]));if(_0x5cc762[_0x141490][_0x252b('0x1b')]!=_0x5cc762[_0x141490][_0x252b('0x15')]){_0x2eab33=_0x2eab33[_0x252b('0x1a')](getUserApplications(_0x2c49fe,_0x5cc762[_0x141490],_0x5cc762[_0x141490]['name']));}}return _0x2eab33;};var getChanSpyPromise=function(_0x116b62,_0x5d6019){return new BPromise(function(_0x1a607e,_0x2d05e5){return _0x116b62[_0x252b('0x1c')][_0x252b('0x1d')]({'attributes':['id',_0x252b('0x15'),'internal'],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x252b('0x1e')](function(_0x4045f9){if(_0x4045f9){return _0x1a607e(getChanSpyApplications(_0x5d6019,_0x4045f9));}return _0x1a607e([]);})['catch'](function(_0x4129ac){_0x2d05e5(_0x4129ac);});});};module[_0x252b('0x1f')]=function(_0x229fcd,_0x99852c){var _0x24767c=_0x229fcd['models'];return _0x229fcd[_0x252b('0x20')]('VoiceChanSpy',attributes,{'tableName':_0x252b('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1645bb,_0x49920a,_0x1c1c33){return getChanSpyPromise(_0x24767c,_0x1645bb)['then'](function(_0x3aba2f){if(_0x3aba2f&&_0x3aba2f[_0x252b('0x19')]){return _0x24767c[_0x252b('0x22')]['bulkCreate'](_0x3aba2f);}})['then'](function(){_0x1c1c33();})[_0x252b('0x23')](function(_0x308872){_0x1c1c33(_0x308872);});},'afterUpdate':function(_0x4e7e0f,_0x5ab10,_0x3965e3){return _0x24767c[_0x252b('0x22')]['destroy']({'where':{'ChanSpyId':_0x4e7e0f['id']}})['then'](function(){return getChanSpyPromise(_0x24767c,_0x4e7e0f);})['then'](function(_0x2eaf31){if(_0x2eaf31&&_0x2eaf31['length']){return _0x24767c[_0x252b('0x22')][_0x252b('0x24')](_0x2eaf31);}})[_0x252b('0x1e')](function(){_0x3965e3();})[_0x252b('0x23')](function(_0x5300a2){_0x3965e3(_0x5300a2);});},'afterDestroy':function(_0x2b24a3,_0x57876d,_0x34e55c){return _0x24767c[_0x252b('0x22')]['destroy']({'where':{'ChanSpyId':_0x2b24a3['id']}})['then'](function(){_0x34e55c();})[_0x252b('0x23')](function(_0x13cf2d){_0x34e55c(_0x13cf2d);});}}});}; \ No newline at end of file +var _0xc627=['StopMixMonitor','length','concat','internal','agent','then','exports','models','define','VoiceChanSpy','voice_chanspy','catch','VoiceExtension','destroy','bulkCreate','util','bluebird','context','from-sip','format','prefix','push','merge','Set','CDR(type)=%s','chanspy','MixMonitor','recordingFormat','auth','Authenticate','password','SIP/%s,%s','name','options','join','record'];(function(_0x7d4e7e,_0x423e0f){var _0xee35cd=function(_0x15137b){while(--_0x15137b){_0x7d4e7e['push'](_0x7d4e7e['shift']());}};_0xee35cd(++_0x423e0f);}(_0xc627,0x1e3));var _0x7c62=function(_0x50fd88,_0x4dc70d){_0x50fd88=_0x50fd88-0x0;var _0x1ab5bf=_0xc627[_0x50fd88];return _0x1ab5bf;};'use strict';var _=require('lodash');var util=require(_0x7c62('0x0'));var BPromise=require(_0x7c62('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x57bc43,_0x4da8ac,_0x91222a){var _0x4e1155=0x1;var _0x326c83=[];var _0x2ba827={'context':_0x4da8ac[_0x7c62('0x2')]||_0x7c62('0x3'),'exten':util[_0x7c62('0x4')]('%s%s',_0x57bc43[_0x7c62('0x5')],_0x91222a),'type':'system','isApp':![],'ChanSpyId':_0x57bc43['id'],'UserId':_0x4da8ac['id']};_0x326c83[_0x7c62('0x6')](_[_0x7c62('0x7')]({'app':_0x7c62('0x8'),'appdata':util['format'](_0x7c62('0x9'),_0x7c62('0xa')),'priority':_0x4e1155++},_0x2ba827));if(_0x57bc43['record']){_0x326c83[_0x7c62('0x6')](_['merge']({'app':_0x7c62('0xb'),'appdata':util[_0x7c62('0x4')]('${UNIQUEID}.%s,a',_0x57bc43[_0x7c62('0xc')]),'priority':_0x4e1155++},_0x2ba827));}if(_0x57bc43[_0x7c62('0xd')]){_0x326c83[_0x7c62('0x6')](_[_0x7c62('0x7')]({'app':_0x7c62('0xe'),'appdata':_0x57bc43[_0x7c62('0xf')],'priority':_0x4e1155++},_0x2ba827));}_0x326c83[_0x7c62('0x6')](_['merge']({'app':'ChanSpy','appdata':util[_0x7c62('0x4')](_0x7c62('0x10'),_0x4da8ac[_0x7c62('0x11')],_0x57bc43[_0x7c62('0x12')]?_0x57bc43[_0x7c62('0x12')][_0x7c62('0x13')](''):''),'priority':_0x4e1155++},_0x2ba827));if(_0x57bc43[_0x7c62('0x14')]){_0x326c83[_0x7c62('0x6')](_['merge']({'app':_0x7c62('0x15'),'priority':_0x4e1155++},_0x2ba827));}return _0x326c83;};var getChanSpyApplications=function(_0xd82466,_0x42a8a1){var _0x5e4f1d=[];for(var _0x4e715a=0x0,_0xe06765=0x1;_0x4e715a<_0x42a8a1[_0x7c62('0x16')];_0x4e715a++,_0xe06765=0x1){_0x5e4f1d=_0x5e4f1d[_0x7c62('0x17')](getUserApplications(_0xd82466,_0x42a8a1[_0x4e715a],_0x42a8a1[_0x4e715a]['internal']));if(_0x42a8a1[_0x4e715a][_0x7c62('0x18')]!=_0x42a8a1[_0x4e715a][_0x7c62('0x11')]){_0x5e4f1d=_0x5e4f1d[_0x7c62('0x17')](getUserApplications(_0xd82466,_0x42a8a1[_0x4e715a],_0x42a8a1[_0x4e715a][_0x7c62('0x11')]));}}return _0x5e4f1d;};var getChanSpyPromise=function(_0x315633,_0x1c84a1){return new BPromise(function(_0x222ee5,_0x362248){return _0x315633['User']['findAll']({'attributes':['id','name','internal'],'where':{'role':_0x7c62('0x19'),'chanspy':!![]},'raw':!![]})[_0x7c62('0x1a')](function(_0xf67603){if(_0xf67603){return _0x222ee5(getChanSpyApplications(_0x1c84a1,_0xf67603));}return _0x222ee5([]);})['catch'](function(_0xc3b941){_0x362248(_0xc3b941);});});};module[_0x7c62('0x1b')]=function(_0x2309a6,_0x4e339d){var _0x54afb5=_0x2309a6[_0x7c62('0x1c')];return _0x2309a6[_0x7c62('0x1d')](_0x7c62('0x1e'),attributes,{'tableName':_0x7c62('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a0e0d,_0x5b7cbc,_0x586791){return getChanSpyPromise(_0x54afb5,_0x3a0e0d)[_0x7c62('0x1a')](function(_0x54d1fe){if(_0x54d1fe&&_0x54d1fe['length']){return _0x54afb5['VoiceExtension']['bulkCreate'](_0x54d1fe);}})[_0x7c62('0x1a')](function(){_0x586791();})[_0x7c62('0x20')](function(_0x323642){_0x586791(_0x323642);});},'afterUpdate':function(_0x2d5046,_0x5cb103,_0x310db){return _0x54afb5[_0x7c62('0x21')][_0x7c62('0x22')]({'where':{'ChanSpyId':_0x2d5046['id']}})[_0x7c62('0x1a')](function(){return getChanSpyPromise(_0x54afb5,_0x2d5046);})[_0x7c62('0x1a')](function(_0x55c799){if(_0x55c799&&_0x55c799[_0x7c62('0x16')]){return _0x54afb5['VoiceExtension'][_0x7c62('0x23')](_0x55c799);}})[_0x7c62('0x1a')](function(){_0x310db();})['catch'](function(_0x50843c){_0x310db(_0x50843c);});},'afterDestroy':function(_0x5aa9e0,_0xa91c5,_0x2539a7){return _0x54afb5[_0x7c62('0x21')][_0x7c62('0x22')]({'where':{'ChanSpyId':_0x5aa9e0['id']}})[_0x7c62('0x1a')](function(){_0x2539a7();})[_0x7c62('0x20')](function(_0x4b7c14){_0x2539a7(_0x4b7c14);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index fb86462..d9c517a 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 _0x41bb=['VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x9df2ab,_0xbf33b7){var _0x4273a4=function(_0x4444eb){while(--_0x4444eb){_0x9df2ab['push'](_0x9df2ab['shift']());}};_0x4273a4(++_0xbf33b7);}(_0x41bb,0xc5));var _0xb41b=function(_0x690c93,_0x3941e8){_0x690c93=_0x690c93-0x0;var _0x4b5bd5=_0x41bb[_0x690c93];return _0x4b5bd5;};'use strict';var _=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var moment=require('moment');var BPromise=require(_0xb41b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb41b('0x3'));var db=require(_0xb41b('0x4'))['db'];var utils=require(_0xb41b('0x5'));var logger=require(_0xb41b('0x6'))('rpc');var config=require(_0xb41b('0x7'));var jayson=require(_0xb41b('0x8'));var client=jayson[_0xb41b('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5455ce,_0x497242,_0x2704f0){return new BPromise(function(_0x29c30d,_0x53722a){return client[_0xb41b('0xa')](_0x5455ce,_0x2704f0)[_0xb41b('0xb')](function(_0x11b8b2){logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));logger[_0xb41b('0xf')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x497242,_0xb41b('0xe'),JSON['stringify'](_0x11b8b2));if(_0x11b8b2[_0xb41b('0x10')]){if(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x11')]===0x1f4){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error'][_0xb41b('0x12')]);return _0x53722a(_0x11b8b2[_0xb41b('0x10')][_0xb41b('0x12')]);}logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0x11b8b2['error']['message']);return _0x29c30d(_0x11b8b2['error'][_0xb41b('0x12')]);}else{logger[_0xb41b('0xc')](_0xb41b('0xd'),_0x497242,_0xb41b('0xe'));_0x29c30d(_0x11b8b2[_0xb41b('0x13')]['message']);}})[_0xb41b('0x14')](function(_0xd0b6b5){logger[_0xb41b('0x10')](_0xb41b('0xd'),_0x497242,_0xd0b6b5);_0x53722a(_0xd0b6b5);});});} \ No newline at end of file +var _0xb4e6=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4f617a,_0x2475f7){var _0x9d2059=function(_0x498fa6){while(--_0x498fa6){_0x4f617a['push'](_0x4f617a['shift']());}};_0x9d2059(++_0x2475f7);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x7c0074,_0x1ffdcf){_0x7c0074=_0x7c0074-0x0;var _0x13e95b=_0xb4e6[_0x7c0074];return _0x13e95b;};'use strict';var _=require(_0x6b4e('0x0'));var util=require('util');var moment=require(_0x6b4e('0x1'));var BPromise=require(_0x6b4e('0x2'));var rs=require(_0x6b4e('0x3'));var fs=require('fs');var Redis=require(_0x6b4e('0x4'));var db=require(_0x6b4e('0x5'))['db'];var utils=require(_0x6b4e('0x6'));var logger=require(_0x6b4e('0x7'))('rpc');var config=require(_0x6b4e('0x8'));var jayson=require(_0x6b4e('0x9'));var client=jayson[_0x6b4e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd3138f,_0x570346,_0x4f00be){return new BPromise(function(_0x2311d9,_0x48c870){return client['request'](_0xd3138f,_0x4f00be)[_0x6b4e('0xb')](function(_0x2bd576){logger[_0x6b4e('0xc')](_0x6b4e('0xd'),_0x570346,_0x6b4e('0xe'));logger[_0x6b4e('0xf')](_0x6b4e('0x10'),_0x570346,'request\x20sent',JSON[_0x6b4e('0x11')](_0x2bd576));if(_0x2bd576[_0x6b4e('0x12')]){if(_0x2bd576['error'][_0x6b4e('0x13')]===0x1f4){logger[_0x6b4e('0x12')](_0x6b4e('0xd'),_0x570346,_0x2bd576[_0x6b4e('0x12')][_0x6b4e('0x14')]);return _0x48c870(_0x2bd576[_0x6b4e('0x12')][_0x6b4e('0x14')]);}logger['error'](_0x6b4e('0xd'),_0x570346,_0x2bd576[_0x6b4e('0x12')]['message']);return _0x2311d9(_0x2bd576[_0x6b4e('0x12')]['message']);}else{logger[_0x6b4e('0xc')](_0x6b4e('0xd'),_0x570346,_0x6b4e('0xe'));_0x2311d9(_0x2bd576[_0x6b4e('0x15')][_0x6b4e('0x14')]);}})[_0x6b4e('0x16')](function(_0x53a934){logger['error'](_0x6b4e('0xd'),_0x570346,_0x53a934);_0x48c870(_0x53a934);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 7b9b5d9..74f61a0 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 _0xef85=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete'];(function(_0x14e06c,_0x219a79){var _0x1a0533=function(_0x54dd04){while(--_0x54dd04){_0x14e06c['push'](_0x14e06c['shift']());}};_0x1a0533(++_0x219a79);}(_0xef85,0x1ba));var _0x5ef8=function(_0x11f0a2,_0x1a1c6f){_0x11f0a2=_0x11f0a2-0x0;var _0x1da82b=_0xef85[_0x11f0a2];return _0x1da82b;};'use strict';var multer=require(_0x5ef8('0x0'));var util=require(_0x5ef8('0x1'));var path=require(_0x5ef8('0x2'));var timeout=require(_0x5ef8('0x3'));var express=require('express');var router=express[_0x5ef8('0x4')]();var fs_extra=require(_0x5ef8('0x5'));var auth=require(_0x5ef8('0x6'));var interaction=require(_0x5ef8('0x7'));var config=require(_0x5ef8('0x8'));var controller=require(_0x5ef8('0x9'));router[_0x5ef8('0xa')]('/',auth[_0x5ef8('0xb')](),controller[_0x5ef8('0xc')]);router['get'](_0x5ef8('0xd'),auth[_0x5ef8('0xb')](),controller[_0x5ef8('0xe')]);router[_0x5ef8('0xf')]('/',auth[_0x5ef8('0xb')](),controller[_0x5ef8('0x10')]);router[_0x5ef8('0x11')](_0x5ef8('0xd'),auth[_0x5ef8('0xb')](),controller[_0x5ef8('0x12')]);router[_0x5ef8('0x13')](_0x5ef8('0xd'),auth[_0x5ef8('0xb')](),controller[_0x5ef8('0x14')]);module[_0x5ef8('0x15')]=router; \ No newline at end of file +var _0x0b3c=['/:id','show','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','get','isAuthenticated'];(function(_0x2cf2ce,_0x9c970){var _0x11f24d=function(_0x455b76){while(--_0x455b76){_0x2cf2ce['push'](_0x2cf2ce['shift']());}};_0x11f24d(++_0x9c970);}(_0x0b3c,0xf8));var _0xc0b3=function(_0x4a8a55,_0x2d3009){_0x4a8a55=_0x4a8a55-0x0;var _0x1de991=_0x0b3c[_0x4a8a55];return _0x1de991;};'use strict';var multer=require(_0xc0b3('0x0'));var util=require(_0xc0b3('0x1'));var path=require(_0xc0b3('0x2'));var timeout=require(_0xc0b3('0x3'));var express=require(_0xc0b3('0x4'));var router=express['Router']();var fs_extra=require(_0xc0b3('0x5'));var auth=require(_0xc0b3('0x6'));var interaction=require(_0xc0b3('0x7'));var config=require(_0xc0b3('0x8'));var controller=require(_0xc0b3('0x9'));router[_0xc0b3('0xa')]('/',auth[_0xc0b3('0xb')](),controller['index']);router[_0xc0b3('0xa')](_0xc0b3('0xc'),auth[_0xc0b3('0xb')](),controller[_0xc0b3('0xd')]);router[_0xc0b3('0xe')]('/',auth[_0xc0b3('0xb')](),controller[_0xc0b3('0xf')]);router[_0xc0b3('0x10')](_0xc0b3('0xc'),auth[_0xc0b3('0xb')](),controller[_0xc0b3('0x11')]);router[_0xc0b3('0x12')](_0xc0b3('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xc0b3('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 5821814..7a56a3c 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 _0x6dbc=['exports','name','STRING','BOOLEAN','sequelize'];(function(_0x84ae3,_0x5a3052){var _0x59401b=function(_0x58b3d5){while(--_0x58b3d5){_0x84ae3['push'](_0x84ae3['shift']());}};_0x59401b(++_0x5a3052);}(_0x6dbc,0x1e4));var _0xc6db=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x6dbc[_0x565c49];return _0x20ca34;};'use strict';var Sequelize=require(_0xc6db('0x0'));module[_0xc6db('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc6db('0x2')},'description':{'type':Sequelize[_0xc6db('0x3')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xc6db('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9ddc=['sequelize','STRING','BOOLEAN'];(function(_0x53ad58,_0x3fb489){var _0x554b03=function(_0x5769ba){while(--_0x5769ba){_0x53ad58['push'](_0x53ad58['shift']());}};_0x554b03(++_0x3fb489);}(_0x9ddc,0xae));var _0xc9dd=function(_0x55c1ef,_0x5d128d){_0x55c1ef=_0x55c1ef-0x0;var _0x1df6af=_0x9ddc[_0x55c1ef];return _0x1df6af;};'use strict';var Sequelize=require(_0xc9dd('0x0'));module['exports']={'name':{'type':Sequelize[_0xc9dd('0x1')],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xc9dd('0x2')],'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 fbb68ee..423dca9 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 _0xf415=['offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','get','Contexts','sendStatus','stack','name','send','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','order','sort','pick','filter','where','type','VIRTUAL','options','VoiceContext','include','findAll','rows','params','includeAll','find','catch','create','body','join','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','chan_sip.so','Reload','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','status','end','json'];(function(_0x363e6f,_0x342898){var _0x14cf12=function(_0x140849){while(--_0x140849){_0x363e6f['push'](_0x363e6f['shift']());}};_0x14cf12(++_0x342898);}(_0xf415,0x1dd));var _0x5f41=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0xf415[_0x13b02f];return _0x12e9a6;};'use strict';var emlformat=require(_0x5f41('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5f41('0x1'));var jsonpatch=require(_0x5f41('0x2'));var rp=require('request-promise');var moment=require(_0x5f41('0x3'));var BPromise=require(_0x5f41('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5f41('0x5'));var sox=require(_0x5f41('0x6'));var csv=require('to-csv');var ejs=require(_0x5f41('0x7'));var fs=require('fs');var fs_extra=require(_0x5f41('0x8'));var _=require(_0x5f41('0x9'));var squel=require(_0x5f41('0xa'));var crypto=require('crypto');var jsforce=require(_0x5f41('0xb'));var deskjs=require(_0x5f41('0xc'));var toCsv=require(_0x5f41('0xd'));var querystring=require(_0x5f41('0xe'));var Papa=require(_0x5f41('0xf'));var Redis=require(_0x5f41('0x10'));var authService=require(_0x5f41('0x11'));var qs=require(_0x5f41('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5f41('0x13'));var logger=require(_0x5f41('0x14'))(_0x5f41('0x15'));var utils=require(_0x5f41('0x16'));var config=require(_0x5f41('0x17'));var licenseUtil=require(_0x5f41('0x18'));var db=require(_0x5f41('0x19'))['db'];var jayson=require(_0x5f41('0x1a'));var client=jayson[_0x5f41('0x1b')][_0x5f41('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x20e02d,_0x2a1727,_0x3613aa,_0x159cce){return new BPromise(function(_0x47bef5,_0x3f48e1){var _0x5cd230=_0x159cce||client;return _0x5cd230[_0x5f41('0x1d')](_0x20e02d,_0x3613aa)[_0x5f41('0x1e')](function(_0x5da658){logger[_0x5f41('0x1f')]('VoiceContext,\x20%s,\x20%s',_0x2a1727,_0x5f41('0x20'));logger[_0x5f41('0x21')](_0x5f41('0x22'),_0x2a1727,'request\x20sent',JSON[_0x5f41('0x23')](_0x5da658));if(_0x5da658[_0x5f41('0x24')]){if(_0x5da658[_0x5f41('0x24')]['code']===0x1f4){logger[_0x5f41('0x24')](_0x5f41('0x25'),_0x2a1727,_0x5da658[_0x5f41('0x24')][_0x5f41('0x26')]);return _0x3f48e1(_0x5da658[_0x5f41('0x24')][_0x5f41('0x26')]);}logger[_0x5f41('0x24')](_0x5f41('0x25'),_0x2a1727,_0x5da658[_0x5f41('0x24')][_0x5f41('0x26')]);return _0x47bef5(_0x5da658[_0x5f41('0x24')][_0x5f41('0x26')]);}else{logger[_0x5f41('0x1f')](_0x5f41('0x25'),_0x2a1727,_0x5f41('0x20'));_0x47bef5(_0x5da658[_0x5f41('0x27')][_0x5f41('0x26')]);}})['catch'](function(_0x1020d0){logger[_0x5f41('0x24')](_0x5f41('0x25'),_0x2a1727,_0x1020d0);_0x3f48e1(_0x1020d0);});});}function respondWithStatusCode(_0x4d6720,_0x549131){_0x549131=_0x549131||0xcc;return function(_0x3443fb){if(_0x3443fb){return _0x4d6720['sendStatus'](_0x549131);}return _0x4d6720[_0x5f41('0x28')](_0x549131)[_0x5f41('0x29')]();};}function respondWithResult(_0x20c7b5,_0x5ef051){_0x5ef051=_0x5ef051||0xc8;return function(_0x11f84b){if(_0x11f84b){return _0x20c7b5['status'](_0x5ef051)[_0x5f41('0x2a')](_0x11f84b);}};}function respondWithFilteredResult(_0x15e70c,_0x471aed){return function(_0x2da2f1){if(_0x2da2f1){var _0x19119d=typeof _0x471aed[_0x5f41('0x2b')]===_0x5f41('0x2c')&&typeof _0x471aed[_0x5f41('0x2d')]==='undefined';var _0x1305f0=_0x2da2f1[_0x5f41('0x2e')];var _0x2865ff=_0x19119d?0x0:_0x471aed[_0x5f41('0x2b')];var _0xcd345a=_0x19119d?_0x2da2f1['count']:_0x471aed[_0x5f41('0x2b')]+_0x471aed[_0x5f41('0x2d')];var _0x54969a;if(_0xcd345a>=_0x1305f0){_0xcd345a=_0x1305f0;_0x54969a=0xc8;}else{_0x54969a=0xce;}_0x15e70c[_0x5f41('0x28')](_0x54969a);return _0x15e70c[_0x5f41('0x2f')](_0x5f41('0x30'),_0x2865ff+'-'+_0xcd345a+'/'+_0x1305f0)[_0x5f41('0x2a')](_0x2da2f1);}return null;};}function patchUpdates(_0x391e6e){return function(_0x38830d){try{jsonpatch[_0x5f41('0x31')](_0x38830d,_0x391e6e,!![]);}catch(_0x3378e0){return BPromise['reject'](_0x3378e0);}return _0x38830d[_0x5f41('0x32')]();};}function saveUpdates(_0x104a37,_0x8cf4ef){return function(_0xc223a5){if(_0xc223a5){return _0xc223a5[_0x5f41('0x33')](_0x104a37)[_0x5f41('0x1e')](function(_0x4ce13b){return _0x4ce13b;});}return null;};}function removeEntity(_0x1e9576,_0x5cc45a){return function(_0x504df4){if(_0x504df4){return _0x504df4[_0x5f41('0x34')]()[_0x5f41('0x1e')](function(){var _0x4c44fb=_0x504df4[_0x5f41('0x35')]({'plain':!![]});var _0x1ce9d2=_0x5f41('0x36');return db['UserProfileResource'][_0x5f41('0x34')]({'where':{'type':_0x1ce9d2,'resourceId':_0x4c44fb['id']}})[_0x5f41('0x1e')](function(){return _0x504df4;});})[_0x5f41('0x1e')](function(){_0x1e9576['status'](0xcc)[_0x5f41('0x29')]();});}};}function handleEntityNotFound(_0x11ac5c,_0x39a72b){return function(_0x19b5ea){if(!_0x19b5ea){_0x11ac5c[_0x5f41('0x37')](0x194);}return _0x19b5ea;};}function handleError(_0xa90d72,_0x3c0301){_0x3c0301=_0x3c0301||0x1f4;return function(_0x3593e8){logger['error'](_0x3593e8[_0x5f41('0x38')]);if(_0x3593e8['name']){delete _0x3593e8[_0x5f41('0x39')];}_0xa90d72[_0x5f41('0x28')](_0x3c0301)[_0x5f41('0x3a')](_0x3593e8);};}exports['index']=function(_0x583fb9,_0x54f301){var _0x2f72b2={},_0x59b453={},_0x507c22={'count':0x0,'rows':[]};var _0x39a521=_[_0x5f41('0x3b')](db['VoiceContext'][_0x5f41('0x3c')],function(_0x3c76cc){return{'name':_0x3c76cc['fieldName'],'type':_0x3c76cc['type']['key']};});_0x59b453[_0x5f41('0x3d')]=_[_0x5f41('0x3b')](_0x39a521,_0x5f41('0x39'));_0x59b453[_0x5f41('0x3e')]=_[_0x5f41('0x3f')](_0x583fb9[_0x5f41('0x3e')]);_0x59b453[_0x5f41('0x40')]=_[_0x5f41('0x41')](_0x59b453['model'],_0x59b453[_0x5f41('0x3e')]);_0x2f72b2[_0x5f41('0x42')]=_['intersection'](_0x59b453[_0x5f41('0x3d')],qs[_0x5f41('0x43')](_0x583fb9[_0x5f41('0x3e')][_0x5f41('0x43')]));_0x2f72b2[_0x5f41('0x42')]=_0x2f72b2['attributes'][_0x5f41('0x44')]?_0x2f72b2[_0x5f41('0x42')]:_0x59b453[_0x5f41('0x3d')];if(!_0x583fb9['query']['hasOwnProperty']('nolimit')){_0x2f72b2[_0x5f41('0x2d')]=qs[_0x5f41('0x2d')](_0x583fb9['query'][_0x5f41('0x2d')]);_0x2f72b2[_0x5f41('0x2b')]=qs[_0x5f41('0x2b')](_0x583fb9[_0x5f41('0x3e')]['offset']);}_0x2f72b2[_0x5f41('0x45')]=qs[_0x5f41('0x46')](_0x583fb9[_0x5f41('0x3e')][_0x5f41('0x46')]);_0x2f72b2['where']=qs[_0x5f41('0x40')](_[_0x5f41('0x47')](_0x583fb9[_0x5f41('0x3e')],_0x59b453[_0x5f41('0x40')]),_0x39a521);if(_0x583fb9['query'][_0x5f41('0x48')]){_0x2f72b2[_0x5f41('0x49')]=_['merge'](_0x2f72b2[_0x5f41('0x49')],{'$or':_[_0x5f41('0x3b')](_0x39a521,function(_0x529c21){if(_0x529c21[_0x5f41('0x4a')]!==_0x5f41('0x4b')){var _0x3c56ee={};_0x3c56ee[_0x529c21[_0x5f41('0x39')]]={'$like':'%'+_0x583fb9[_0x5f41('0x3e')][_0x5f41('0x48')]+'%'};return _0x3c56ee;}})});}_0x2f72b2=_['merge']({},_0x2f72b2,_0x583fb9[_0x5f41('0x4c')]);var _0x50e780={'where':_0x2f72b2['where']};return db[_0x5f41('0x4d')][_0x5f41('0x2e')](_0x50e780)[_0x5f41('0x1e')](function(_0x10398d){_0x507c22[_0x5f41('0x2e')]=_0x10398d;if(_0x583fb9[_0x5f41('0x3e')]['includeAll']){_0x2f72b2[_0x5f41('0x4e')]=[{'all':!![]}];}return db['VoiceContext'][_0x5f41('0x4f')](_0x2f72b2);})[_0x5f41('0x1e')](function(_0x43ed86){_0x507c22[_0x5f41('0x50')]=_0x43ed86;return _0x507c22;})[_0x5f41('0x1e')](respondWithFilteredResult(_0x54f301,_0x2f72b2))['catch'](handleError(_0x54f301,null));};exports['show']=function(_0x5917b3,_0xcbbff9){var _0x1898a2={'raw':![],'where':{'id':_0x5917b3[_0x5f41('0x51')]['id']}},_0xdfe9e2={};_0xdfe9e2[_0x5f41('0x3d')]=_['keys'](db[_0x5f41('0x4d')][_0x5f41('0x3c')]);_0xdfe9e2[_0x5f41('0x3e')]=_[_0x5f41('0x3f')](_0x5917b3[_0x5f41('0x3e')]);_0xdfe9e2[_0x5f41('0x40')]=_['intersection'](_0xdfe9e2[_0x5f41('0x3d')],_0xdfe9e2[_0x5f41('0x3e')]);_0x1898a2[_0x5f41('0x42')]=_['intersection'](_0xdfe9e2[_0x5f41('0x3d')],qs['fields'](_0x5917b3['query'][_0x5f41('0x43')]));_0x1898a2['attributes']=_0x1898a2['attributes']['length']?_0x1898a2['attributes']:_0xdfe9e2[_0x5f41('0x3d')];if(_0x5917b3[_0x5f41('0x3e')][_0x5f41('0x52')]){_0x1898a2[_0x5f41('0x4e')]=[{'all':!![]}];}_0x1898a2=_['merge']({},_0x1898a2,_0x5917b3[_0x5f41('0x4c')]);return db['VoiceContext'][_0x5f41('0x53')](_0x1898a2)['then'](handleEntityNotFound(_0xcbbff9,null))[_0x5f41('0x1e')](respondWithResult(_0xcbbff9,null))[_0x5f41('0x54')](handleError(_0xcbbff9,null));};exports[_0x5f41('0x55')]=function(_0x3a2f54,_0x170c2c,_0x36cebb){var _0x734bc9;return db[_0x5f41('0x4d')][_0x5f41('0x55')](_0x3a2f54[_0x5f41('0x56')],{'raw':!![]})[_0x5f41('0x1e')](function(_0x2f9db3){_0x734bc9=_0x2f9db3;return db['VoiceContext'][_0x5f41('0x4f')]({'raw':!![]});})[_0x5f41('0x1e')](function(_0x2344c2){var _0x156b40=fs['readFileSync'](path[_0x5f41('0x57')](config['root'],_0x5f41('0x58')),_0x5f41('0x59'));var _0x327f72=ejs[_0x5f41('0x5a')](_0x156b40,{'contexts':_0x2344c2||[]});fs[_0x5f41('0x5b')](_0x5f41('0x5c'),_0x327f72);})[_0x5f41('0x1e')](function(){return respondWithRpcPromise('Reload',_0x5f41('0x55'),{'module':'chan_sip.so'});})['then'](function(){var _0x42ae35=_0x3a2f54[_0x5f41('0x5d')]['get']({'plain':!![]});if(!_0x42ae35)throw new Error(_0x5f41('0x5e'));if(_0x42ae35[_0x5f41('0x5f')]===_0x5f41('0x5d')){var _0x35c272=_0x734bc9['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x5f41('0x36'),'userProfileId':_0x42ae35[_0x5f41('0x60')]},'raw':!![]})[_0x5f41('0x1e')](function(_0x42b729){if(_0x42b729&&_0x42b729[_0x5f41('0x61')]===0x0){return db[_0x5f41('0x62')]['create']({'name':_0x35c272[_0x5f41('0x39')],'resourceId':_0x35c272['id'],'type':_0x42b729['name'],'sectionId':_0x42b729['id']},{})[_0x5f41('0x1e')](function(){return _0x734bc9;});}else{return _0x734bc9;}})[_0x5f41('0x54')](function(_0x2914a6){logger[_0x5f41('0x24')](_0x5f41('0x63'),_0x2914a6);throw _0x2914a6;});}return _0x734bc9;})[_0x5f41('0x1e')](respondWithResult(_0x170c2c,0xc9))[_0x5f41('0x54')](handleError(_0x170c2c,null));};exports[_0x5f41('0x33')]=function(_0x782c1,_0x5978b6,_0x400a03){var _0x64766e;return db[_0x5f41('0x4d')][_0x5f41('0x53')]({'where':{'id':_0x782c1[_0x5f41('0x51')]['id']}})['then'](handleEntityNotFound(_0x5978b6,null))[_0x5f41('0x1e')](saveUpdates(_0x782c1[_0x5f41('0x56')],null))[_0x5f41('0x1e')](function(_0x233a81){if(_0x233a81){_0x64766e=_0x233a81;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0x5f41('0x1e')](function(_0x3ebde7){var _0x1da7f3=fs[_0x5f41('0x64')](path[_0x5f41('0x57')](config[_0x5f41('0x65')],_0x5f41('0x58')),_0x5f41('0x59'));var _0x2cb00b=ejs[_0x5f41('0x5a')](_0x1da7f3,{'contexts':_0x3ebde7||[]});fs[_0x5f41('0x5b')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2cb00b);})[_0x5f41('0x1e')](function(){return respondWithRpcPromise('Reload',_0x5f41('0x33'),{'module':_0x5f41('0x66')});})['then'](function(){return _0x64766e;})[_0x5f41('0x1e')](respondWithResult(_0x5978b6,null))[_0x5f41('0x54')](handleError(_0x5978b6,null));};exports[_0x5f41('0x34')]=function(_0x5809bc,_0x1ae494,_0x5adc0e){var _0x13baac;return db[_0x5f41('0x4d')]['find']({'where':{'id':_0x5809bc['params']['id']}})['then'](handleEntityNotFound(_0x1ae494,null))[_0x5f41('0x1e')](removeEntity(_0x1ae494,null))['then'](function(){return db[_0x5f41('0x4d')][_0x5f41('0x4f')]({'raw':!![]});})['then'](function(_0x1f5fb5){var _0x11718e=fs[_0x5f41('0x64')](path['join'](config[_0x5f41('0x65')],_0x5f41('0x58')),_0x5f41('0x59'));var _0x4cd315=ejs[_0x5f41('0x5a')](_0x11718e,{'contexts':_0x1f5fb5});fs[_0x5f41('0x5b')](_0x5f41('0x5c'),_0x4cd315);return respondWithRpcPromise(_0x5f41('0x67'),_0x5f41('0x34'),{'module':'chan_sip.so'});})[_0x5f41('0x54')](handleError(_0x1ae494,null));}; \ No newline at end of file +var _0xacbb=['sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','get','UserProfileResource','destroy','stack','name','index','map','VoiceContext','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','options','includeAll','include','findAll','show','length','merge','create','body','readFileSync','join','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','UserProfileSection','Contexts','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','params','root','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','client','http','request','then','request\x20sent','debug','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','info','result','catch'];(function(_0x3e9f19,_0x46edab){var _0x33e2cc=function(_0x481429){while(--_0x481429){_0x3e9f19['push'](_0x3e9f19['shift']());}};_0x33e2cc(++_0x46edab);}(_0xacbb,0x115));var _0xbacb=function(_0x1215b5,_0x151f17){_0x1215b5=_0x1215b5-0x0;var _0x147060=_0xacbb[_0x1215b5];return _0x147060;};'use strict';var emlformat=require(_0xbacb('0x0'));var rimraf=require(_0xbacb('0x1'));var zipdir=require(_0xbacb('0x2'));var jsonpatch=require(_0xbacb('0x3'));var rp=require(_0xbacb('0x4'));var moment=require(_0xbacb('0x5'));var BPromise=require(_0xbacb('0x6'));var Mustache=require('mustache');var util=require(_0xbacb('0x7'));var path=require(_0xbacb('0x8'));var sox=require(_0xbacb('0x9'));var csv=require(_0xbacb('0xa'));var ejs=require(_0xbacb('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbacb('0xc'));var squel=require(_0xbacb('0xd'));var crypto=require(_0xbacb('0xe'));var jsforce=require(_0xbacb('0xf'));var deskjs=require(_0xbacb('0x10'));var toCsv=require(_0xbacb('0xa'));var querystring=require('querystring');var Papa=require(_0xbacb('0x11'));var Redis=require(_0xbacb('0x12'));var authService=require(_0xbacb('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xbacb('0x14'));var hardwareService=require(_0xbacb('0x15'));var logger=require(_0xbacb('0x16'))('api');var utils=require(_0xbacb('0x17'));var config=require(_0xbacb('0x18'));var licenseUtil=require(_0xbacb('0x19'));var db=require(_0xbacb('0x1a'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xbacb('0x1b')][_0xbacb('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1a5c96,_0x35607b,_0x4f5655,_0x233df2){return new BPromise(function(_0x4e2a95,_0x134f80){var _0x3061c8=_0x233df2||client;return _0x3061c8[_0xbacb('0x1d')](_0x1a5c96,_0x4f5655)[_0xbacb('0x1e')](function(_0x37f56b){logger['info']('VoiceContext,\x20%s,\x20%s',_0x35607b,_0xbacb('0x1f'));logger[_0xbacb('0x20')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x35607b,_0xbacb('0x1f'),JSON[_0xbacb('0x21')](_0x37f56b));if(_0x37f56b[_0xbacb('0x22')]){if(_0x37f56b[_0xbacb('0x22')][_0xbacb('0x23')]===0x1f4){logger[_0xbacb('0x22')](_0xbacb('0x24'),_0x35607b,_0x37f56b[_0xbacb('0x22')][_0xbacb('0x25')]);return _0x134f80(_0x37f56b['error'][_0xbacb('0x25')]);}logger[_0xbacb('0x22')](_0xbacb('0x24'),_0x35607b,_0x37f56b[_0xbacb('0x22')][_0xbacb('0x25')]);return _0x4e2a95(_0x37f56b[_0xbacb('0x22')][_0xbacb('0x25')]);}else{logger[_0xbacb('0x26')](_0xbacb('0x24'),_0x35607b,'request\x20sent');_0x4e2a95(_0x37f56b[_0xbacb('0x27')][_0xbacb('0x25')]);}})[_0xbacb('0x28')](function(_0x3c8207){logger['error'](_0xbacb('0x24'),_0x35607b,_0x3c8207);_0x134f80(_0x3c8207);});});}function respondWithStatusCode(_0x43d616,_0x5cc6da){_0x5cc6da=_0x5cc6da||0xcc;return function(_0x2eb7dc){if(_0x2eb7dc){return _0x43d616[_0xbacb('0x29')](_0x5cc6da);}return _0x43d616[_0xbacb('0x2a')](_0x5cc6da)[_0xbacb('0x2b')]();};}function respondWithResult(_0x127a18,_0x4ed5f5){_0x4ed5f5=_0x4ed5f5||0xc8;return function(_0x2a2e20){if(_0x2a2e20){return _0x127a18[_0xbacb('0x2a')](_0x4ed5f5)['json'](_0x2a2e20);}};}function respondWithFilteredResult(_0xa0bfe2,_0x3cff6e){return function(_0xb8164b){if(_0xb8164b){var _0x4f5d3e=typeof _0x3cff6e['offset']===_0xbacb('0x2c')&&typeof _0x3cff6e[_0xbacb('0x2d')]===_0xbacb('0x2c');var _0x8f8c3b=_0xb8164b[_0xbacb('0x2e')];var _0x5cf5da=_0x4f5d3e?0x0:_0x3cff6e[_0xbacb('0x2f')];var _0x3391df=_0x4f5d3e?_0xb8164b[_0xbacb('0x2e')]:_0x3cff6e[_0xbacb('0x2f')]+_0x3cff6e[_0xbacb('0x2d')];var _0x1cfdc5;if(_0x3391df>=_0x8f8c3b){_0x3391df=_0x8f8c3b;_0x1cfdc5=0xc8;}else{_0x1cfdc5=0xce;}_0xa0bfe2[_0xbacb('0x2a')](_0x1cfdc5);return _0xa0bfe2[_0xbacb('0x30')](_0xbacb('0x31'),_0x5cf5da+'-'+_0x3391df+'/'+_0x8f8c3b)[_0xbacb('0x32')](_0xb8164b);}return null;};}function patchUpdates(_0x166799){return function(_0x309d3b){try{jsonpatch[_0xbacb('0x33')](_0x309d3b,_0x166799,!![]);}catch(_0x4bf3df){return BPromise['reject'](_0x4bf3df);}return _0x309d3b[_0xbacb('0x34')]();};}function saveUpdates(_0x146ebd,_0x4f40da){return function(_0x33e25f){if(_0x33e25f){return _0x33e25f['update'](_0x146ebd)[_0xbacb('0x1e')](function(_0x32e730){return _0x32e730;});}return null;};}function removeEntity(_0x56ed3c,_0x1342de){return function(_0x114548){if(_0x114548){return _0x114548['destroy']()[_0xbacb('0x1e')](function(){var _0x4de49c=_0x114548[_0xbacb('0x35')]({'plain':!![]});var _0xfe2b9e='Contexts';return db[_0xbacb('0x36')][_0xbacb('0x37')]({'where':{'type':_0xfe2b9e,'resourceId':_0x4de49c['id']}})[_0xbacb('0x1e')](function(){return _0x114548;});})['then'](function(){_0x56ed3c[_0xbacb('0x2a')](0xcc)[_0xbacb('0x2b')]();});}};}function handleEntityNotFound(_0x2cf55b,_0x1df881){return function(_0xf8bad6){if(!_0xf8bad6){_0x2cf55b['sendStatus'](0x194);}return _0xf8bad6;};}function handleError(_0x3609f5,_0x4e33d2){_0x4e33d2=_0x4e33d2||0x1f4;return function(_0x5ba10f){logger['error'](_0x5ba10f[_0xbacb('0x38')]);if(_0x5ba10f[_0xbacb('0x39')]){delete _0x5ba10f['name'];}_0x3609f5[_0xbacb('0x2a')](_0x4e33d2)['send'](_0x5ba10f);};}exports[_0xbacb('0x3a')]=function(_0x250ca7,_0x1fe657){var _0x2d25ac={},_0x512e8e={},_0x5bb5e4={'count':0x0,'rows':[]};var _0x9aab97=_[_0xbacb('0x3b')](db[_0xbacb('0x3c')][_0xbacb('0x3d')],function(_0x2ac9b3){return{'name':_0x2ac9b3['fieldName'],'type':_0x2ac9b3[_0xbacb('0x3e')][_0xbacb('0x3f')]};});_0x512e8e['model']=_[_0xbacb('0x3b')](_0x9aab97,_0xbacb('0x39'));_0x512e8e[_0xbacb('0x40')]=_[_0xbacb('0x41')](_0x250ca7[_0xbacb('0x40')]);_0x512e8e[_0xbacb('0x42')]=_[_0xbacb('0x43')](_0x512e8e[_0xbacb('0x44')],_0x512e8e[_0xbacb('0x40')]);_0x2d25ac[_0xbacb('0x45')]=_[_0xbacb('0x43')](_0x512e8e[_0xbacb('0x44')],qs[_0xbacb('0x46')](_0x250ca7[_0xbacb('0x40')][_0xbacb('0x46')]));_0x2d25ac[_0xbacb('0x45')]=_0x2d25ac['attributes']['length']?_0x2d25ac[_0xbacb('0x45')]:_0x512e8e[_0xbacb('0x44')];if(!_0x250ca7['query'][_0xbacb('0x47')](_0xbacb('0x48'))){_0x2d25ac[_0xbacb('0x2d')]=qs[_0xbacb('0x2d')](_0x250ca7['query'][_0xbacb('0x2d')]);_0x2d25ac[_0xbacb('0x2f')]=qs[_0xbacb('0x2f')](_0x250ca7[_0xbacb('0x40')]['offset']);}_0x2d25ac[_0xbacb('0x49')]=qs[_0xbacb('0x4a')](_0x250ca7[_0xbacb('0x40')][_0xbacb('0x4a')]);_0x2d25ac['where']=qs['filters'](_[_0xbacb('0x4b')](_0x250ca7[_0xbacb('0x40')],_0x512e8e[_0xbacb('0x42')]),_0x9aab97);if(_0x250ca7[_0xbacb('0x40')][_0xbacb('0x4c')]){_0x2d25ac['where']=_['merge'](_0x2d25ac[_0xbacb('0x4d')],{'$or':_[_0xbacb('0x3b')](_0x9aab97,function(_0x483d1c){if(_0x483d1c[_0xbacb('0x3e')]!=='VIRTUAL'){var _0xcbb8a7={};_0xcbb8a7[_0x483d1c[_0xbacb('0x39')]]={'$like':'%'+_0x250ca7[_0xbacb('0x40')][_0xbacb('0x4c')]+'%'};return _0xcbb8a7;}})});}_0x2d25ac=_['merge']({},_0x2d25ac,_0x250ca7[_0xbacb('0x4e')]);var _0x159f7b={'where':_0x2d25ac['where']};return db[_0xbacb('0x3c')]['count'](_0x159f7b)[_0xbacb('0x1e')](function(_0x7d7e5a){_0x5bb5e4[_0xbacb('0x2e')]=_0x7d7e5a;if(_0x250ca7[_0xbacb('0x40')][_0xbacb('0x4f')]){_0x2d25ac[_0xbacb('0x50')]=[{'all':!![]}];}return db[_0xbacb('0x3c')][_0xbacb('0x51')](_0x2d25ac);})[_0xbacb('0x1e')](function(_0x20154f){_0x5bb5e4['rows']=_0x20154f;return _0x5bb5e4;})['then'](respondWithFilteredResult(_0x1fe657,_0x2d25ac))[_0xbacb('0x28')](handleError(_0x1fe657,null));};exports[_0xbacb('0x52')]=function(_0x1873a1,_0x22aa77){var _0x22fc58={'raw':![],'where':{'id':_0x1873a1['params']['id']}},_0x1126e1={};_0x1126e1[_0xbacb('0x44')]=_[_0xbacb('0x41')](db[_0xbacb('0x3c')][_0xbacb('0x3d')]);_0x1126e1['query']=_[_0xbacb('0x41')](_0x1873a1[_0xbacb('0x40')]);_0x1126e1[_0xbacb('0x42')]=_[_0xbacb('0x43')](_0x1126e1[_0xbacb('0x44')],_0x1126e1['query']);_0x22fc58[_0xbacb('0x45')]=_[_0xbacb('0x43')](_0x1126e1['model'],qs[_0xbacb('0x46')](_0x1873a1[_0xbacb('0x40')][_0xbacb('0x46')]));_0x22fc58[_0xbacb('0x45')]=_0x22fc58[_0xbacb('0x45')][_0xbacb('0x53')]?_0x22fc58[_0xbacb('0x45')]:_0x1126e1[_0xbacb('0x44')];if(_0x1873a1['query']['includeAll']){_0x22fc58['include']=[{'all':!![]}];}_0x22fc58=_[_0xbacb('0x54')]({},_0x22fc58,_0x1873a1[_0xbacb('0x4e')]);return db[_0xbacb('0x3c')]['find'](_0x22fc58)[_0xbacb('0x1e')](handleEntityNotFound(_0x22aa77,null))['then'](respondWithResult(_0x22aa77,null))[_0xbacb('0x28')](handleError(_0x22aa77,null));};exports[_0xbacb('0x55')]=function(_0x143582,_0xe66fb2,_0x282d0c){var _0x111d14;return db[_0xbacb('0x3c')][_0xbacb('0x55')](_0x143582[_0xbacb('0x56')],{'raw':!![]})[_0xbacb('0x1e')](function(_0x1a7b9d){_0x111d14=_0x1a7b9d;return db['VoiceContext'][_0xbacb('0x51')]({'raw':!![]});})[_0xbacb('0x1e')](function(_0x3d7504){var _0x9f0342=fs[_0xbacb('0x57')](path[_0xbacb('0x58')](config['root'],_0xbacb('0x59')),_0xbacb('0x5a'));var _0x5b5958=ejs[_0xbacb('0x5b')](_0x9f0342,{'contexts':_0x3d7504||[]});fs[_0xbacb('0x5c')](_0xbacb('0x5d'),_0x5b5958);})[_0xbacb('0x1e')](function(){return respondWithRpcPromise(_0xbacb('0x5e'),_0xbacb('0x55'),{'module':_0xbacb('0x5f')});})['then'](function(){var _0x3a3b40=_0x143582[_0xbacb('0x60')][_0xbacb('0x35')]({'plain':!![]});if(!_0x3a3b40)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3a3b40[_0xbacb('0x61')]==='user'){var _0xbe539c=_0x111d14[_0xbacb('0x35')]({'plain':!![]});return db[_0xbacb('0x62')]['find']({'where':{'name':_0xbacb('0x63'),'userProfileId':_0x3a3b40[_0xbacb('0x64')]},'raw':!![]})[_0xbacb('0x1e')](function(_0x3934f8){if(_0x3934f8&&_0x3934f8['autoAssociation']===0x0){return db[_0xbacb('0x36')][_0xbacb('0x55')]({'name':_0xbe539c[_0xbacb('0x39')],'resourceId':_0xbe539c['id'],'type':_0x3934f8[_0xbacb('0x39')],'sectionId':_0x3934f8['id']},{})[_0xbacb('0x1e')](function(){return _0x111d14;});}else{return _0x111d14;}})['catch'](function(_0x355d43){logger['error'](_0xbacb('0x65'),_0x355d43);throw _0x355d43;});}return _0x111d14;})[_0xbacb('0x1e')](respondWithResult(_0xe66fb2,0xc9))[_0xbacb('0x28')](handleError(_0xe66fb2,null));};exports[_0xbacb('0x66')]=function(_0x9e4043,_0x4b5114,_0x11a3c1){var _0x3a92b2;return db[_0xbacb('0x3c')][_0xbacb('0x67')]({'where':{'id':_0x9e4043[_0xbacb('0x68')]['id']}})[_0xbacb('0x1e')](handleEntityNotFound(_0x4b5114,null))[_0xbacb('0x1e')](saveUpdates(_0x9e4043[_0xbacb('0x56')],null))[_0xbacb('0x1e')](function(_0x5f5d9f){if(_0x5f5d9f){_0x3a92b2=_0x5f5d9f;return db[_0xbacb('0x3c')][_0xbacb('0x51')]({'raw':!![]});}})[_0xbacb('0x1e')](function(_0x134057){var _0x54e37b=fs[_0xbacb('0x57')](path[_0xbacb('0x58')](config[_0xbacb('0x69')],_0xbacb('0x59')),_0xbacb('0x5a'));var _0x345284=ejs['render'](_0x54e37b,{'contexts':_0x134057||[]});fs[_0xbacb('0x5c')](_0xbacb('0x5d'),_0x345284);})[_0xbacb('0x1e')](function(){return respondWithRpcPromise(_0xbacb('0x5e'),'update',{'module':_0xbacb('0x5f')});})[_0xbacb('0x1e')](function(){return _0x3a92b2;})[_0xbacb('0x1e')](respondWithResult(_0x4b5114,null))[_0xbacb('0x28')](handleError(_0x4b5114,null));};exports[_0xbacb('0x37')]=function(_0x5d419c,_0x24100f,_0x28f6b2){var _0x7da1da;return db['VoiceContext'][_0xbacb('0x67')]({'where':{'id':_0x5d419c[_0xbacb('0x68')]['id']}})['then'](handleEntityNotFound(_0x24100f,null))[_0xbacb('0x1e')](removeEntity(_0x24100f,null))[_0xbacb('0x1e')](function(){return db[_0xbacb('0x3c')][_0xbacb('0x51')]({'raw':!![]});})[_0xbacb('0x1e')](function(_0x2529b7){var _0x3acac4=fs['readFileSync'](path[_0xbacb('0x58')](config[_0xbacb('0x69')],_0xbacb('0x59')),_0xbacb('0x5a'));var _0x1d5de5=ejs[_0xbacb('0x5b')](_0x3acac4,{'contexts':_0x2529b7});fs[_0xbacb('0x5c')](_0xbacb('0x5d'),_0x1d5de5);return respondWithRpcPromise(_0xbacb('0x5e'),_0xbacb('0x37'),{'module':_0xbacb('0x5f')});})[_0xbacb('0x28')](handleError(_0x24100f,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index d06f0aa..435ae6a 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 _0xe886=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash','util','../../config/logger'];(function(_0x5180c3,_0x4b35f7){var _0x55c975=function(_0x4746cb){while(--_0x4746cb){_0x5180c3['push'](_0x5180c3['shift']());}};_0x55c975(++_0x4b35f7);}(_0xe886,0x183));var _0x6e88=function(_0x5e2cd6,_0x193f61){_0x5e2cd6=_0x5e2cd6-0x0;var _0x5e9163=_0xe886[_0x5e2cd6];return _0x5e9163;};'use strict';var _=require(_0x6e88('0x0'));var util=require(_0x6e88('0x1'));var logger=require(_0x6e88('0x2'))(_0x6e88('0x3'));var moment=require(_0x6e88('0x4'));var BPromise=require(_0x6e88('0x5'));var rp=require(_0x6e88('0x6'));var fs=require('fs');var path=require(_0x6e88('0x7'));var rimraf=require(_0x6e88('0x8'));var config=require(_0x6e88('0x9'));var attributes=require(_0x6e88('0xa'));module[_0x6e88('0xb')]=function(_0x38609f,_0x53345f){return _0x38609f[_0x6e88('0xc')](_0x6e88('0xd'),attributes,{'tableName':_0x6e88('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11cc=['./voiceContext.attributes','exports','define','voice_contexts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4ce048,_0x27a6fd){var _0x4c6524=function(_0x3319e8){while(--_0x3319e8){_0x4ce048['push'](_0x4ce048['shift']());}};_0x4c6524(++_0x27a6fd);}(_0x11cc,0x1d8));var _0xc11c=function(_0x37d9b1,_0x358b0d){_0x37d9b1=_0x37d9b1-0x0;var _0x580044=_0x11cc[_0x37d9b1];return _0x580044;};'use strict';var _=require(_0xc11c('0x0'));var util=require('util');var logger=require(_0xc11c('0x1'))(_0xc11c('0x2'));var moment=require(_0xc11c('0x3'));var BPromise=require(_0xc11c('0x4'));var rp=require(_0xc11c('0x5'));var fs=require('fs');var path=require(_0xc11c('0x6'));var rimraf=require(_0xc11c('0x7'));var config=require(_0xc11c('0x8'));var attributes=require(_0xc11c('0x9'));module[_0xc11c('0xa')]=function(_0x154f5c,_0x24cc7e){return _0x154f5c[_0xc11c('0xb')]('VoiceContext',attributes,{'tableName':_0xc11c('0xc'),'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 9e213ec..d04b3ff 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 _0x605a=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x625e10,_0xe85ecc){var _0x5f12da=function(_0x3dc311){while(--_0x3dc311){_0x625e10['push'](_0x625e10['shift']());}};_0x5f12da(++_0xe85ecc);}(_0x605a,0x1d7));var _0xa605=function(_0x74ce70,_0x2b02cf){_0x74ce70=_0x74ce70-0x0;var _0x4da6a8=_0x605a[_0x74ce70];return _0x4da6a8;};'use strict';var _=require(_0xa605('0x0'));var util=require('util');var moment=require(_0xa605('0x1'));var BPromise=require(_0xa605('0x2'));var rs=require(_0xa605('0x3'));var fs=require('fs');var Redis=require(_0xa605('0x4'));var db=require(_0xa605('0x5'))['db'];var utils=require(_0xa605('0x6'));var logger=require(_0xa605('0x7'))(_0xa605('0x8'));var config=require(_0xa605('0x9'));var jayson=require(_0xa605('0xa'));var client=jayson[_0xa605('0xb')][_0xa605('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5bf362,_0x4c300e,_0x3573f5){return new BPromise(function(_0xe23170,_0x243d8d){return client[_0xa605('0xd')](_0x5bf362,_0x3573f5)[_0xa605('0xe')](function(_0x15f775){logger[_0xa605('0xf')](_0xa605('0x10'),_0x4c300e,_0xa605('0x11'));logger[_0xa605('0x12')](_0xa605('0x13'),_0x4c300e,_0xa605('0x11'),JSON[_0xa605('0x14')](_0x15f775));if(_0x15f775[_0xa605('0x15')]){if(_0x15f775[_0xa605('0x15')][_0xa605('0x16')]===0x1f4){logger[_0xa605('0x15')](_0xa605('0x10'),_0x4c300e,_0x15f775[_0xa605('0x15')]['message']);return _0x243d8d(_0x15f775[_0xa605('0x15')][_0xa605('0x17')]);}logger['error'](_0xa605('0x10'),_0x4c300e,_0x15f775[_0xa605('0x15')][_0xa605('0x17')]);return _0xe23170(_0x15f775[_0xa605('0x15')][_0xa605('0x17')]);}else{logger[_0xa605('0xf')](_0xa605('0x10'),_0x4c300e,_0xa605('0x11'));_0xe23170(_0x15f775[_0xa605('0x18')]['message']);}})[_0xa605('0x19')](function(_0x32c75e){logger[_0xa605('0x15')](_0xa605('0x10'),_0x4c300e,_0x32c75e);_0x243d8d(_0x32c75e);});});} \ No newline at end of file +var _0xf269=['info','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','VoiceContext,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x1ac2d6,_0xb74fe7){var _0x4b4bf4=function(_0x4f7486){while(--_0x4f7486){_0x1ac2d6['push'](_0x1ac2d6['shift']());}};_0x4b4bf4(++_0xb74fe7);}(_0xf269,0xd2));var _0x9f26=function(_0x32cefe,_0x1befba){_0x32cefe=_0x32cefe-0x0;var _0x283e79=_0xf269[_0x32cefe];return _0x283e79;};'use strict';var _=require('lodash');var util=require(_0x9f26('0x0'));var moment=require(_0x9f26('0x1'));var BPromise=require('bluebird');var rs=require(_0x9f26('0x2'));var fs=require('fs');var Redis=require(_0x9f26('0x3'));var db=require(_0x9f26('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x9f26('0x5'))('rpc');var config=require(_0x9f26('0x6'));var jayson=require(_0x9f26('0x7'));var client=jayson[_0x9f26('0x8')][_0x9f26('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xfa0f44,_0x10b905,_0x4700a8){return new BPromise(function(_0x14a6ba,_0x5bece0){return client['request'](_0xfa0f44,_0x4700a8)['then'](function(_0x19f7b8){logger[_0x9f26('0xa')]('VoiceContext,\x20%s,\x20%s',_0x10b905,'request\x20sent');logger[_0x9f26('0xb')](_0x9f26('0xc'),_0x10b905,_0x9f26('0xd'),JSON[_0x9f26('0xe')](_0x19f7b8));if(_0x19f7b8['error']){if(_0x19f7b8['error']['code']===0x1f4){logger[_0x9f26('0xf')](_0x9f26('0x10'),_0x10b905,_0x19f7b8['error'][_0x9f26('0x11')]);return _0x5bece0(_0x19f7b8[_0x9f26('0xf')][_0x9f26('0x11')]);}logger[_0x9f26('0xf')](_0x9f26('0x10'),_0x10b905,_0x19f7b8['error'][_0x9f26('0x11')]);return _0x14a6ba(_0x19f7b8[_0x9f26('0xf')][_0x9f26('0x11')]);}else{logger['info'](_0x9f26('0x10'),_0x10b905,_0x9f26('0xd'));_0x14a6ba(_0x19f7b8[_0x9f26('0x12')][_0x9f26('0x11')]);}})[_0x9f26('0x13')](function(_0x542567){logger[_0x9f26('0xf')](_0x9f26('0x10'),_0x10b905,_0x542567);_0x5bece0(_0x542567);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 656fec4..cfdedcc 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 _0xb0fc=['show','post','create','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id'];(function(_0x5736df,_0x377e0b){var _0x4de591=function(_0x30dd4f){while(--_0x30dd4f){_0x5736df['push'](_0x5736df['shift']());}};_0x4de591(++_0x377e0b);}(_0xb0fc,0xf6));var _0xcb0f=function(_0x598b78,_0xf4ee7e){_0x598b78=_0x598b78-0x0;var _0x6392fa=_0xb0fc[_0x598b78];return _0x6392fa;};'use strict';var multer=require(_0xcb0f('0x0'));var util=require(_0xcb0f('0x1'));var path=require('path');var timeout=require(_0xcb0f('0x2'));var express=require(_0xcb0f('0x3'));var router=express[_0xcb0f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xcb0f('0x5'));var interaction=require(_0xcb0f('0x6'));var config=require(_0xcb0f('0x7'));var controller=require('./voiceDialReport.controller');router['get']('/',auth[_0xcb0f('0x8')](),controller[_0xcb0f('0x9')]);router['get'](_0xcb0f('0xa'),auth[_0xcb0f('0x8')](),controller[_0xcb0f('0xb')]);router[_0xcb0f('0xc')](_0xcb0f('0xd'),auth[_0xcb0f('0x8')](),controller[_0xcb0f('0xe')]);router[_0xcb0f('0xf')]('/',auth['isAuthenticated'](),controller[_0xcb0f('0x10')]);router['put'](_0xcb0f('0xd'),auth[_0xcb0f('0x8')](),controller[_0xcb0f('0x11')]);router[_0xcb0f('0x12')](_0xcb0f('0xd'),auth[_0xcb0f('0x8')](),controller['destroy']);module[_0xcb0f('0x13')]=router; \ No newline at end of file +var _0xb78e=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','./voiceDialReport.controller','get','isAuthenticated','index'];(function(_0x3ffc10,_0x3929ec){var _0x995678=function(_0x4572c7){while(--_0x4572c7){_0x3ffc10['push'](_0x3ffc10['shift']());}};_0x995678(++_0x3929ec);}(_0xb78e,0xf9));var _0xeb78=function(_0x285390,_0x224549){_0x285390=_0x285390-0x0;var _0x51960a=_0xb78e[_0x285390];return _0x51960a;};'use strict';var multer=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var path=require(_0xeb78('0x2'));var timeout=require(_0xeb78('0x3'));var express=require(_0xeb78('0x4'));var router=express['Router']();var fs_extra=require(_0xeb78('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xeb78('0x6'));var config=require('../../config/environment');var controller=require(_0xeb78('0x7'));router[_0xeb78('0x8')]('/',auth[_0xeb78('0x9')](),controller[_0xeb78('0xa')]);router['get']('/describe',auth[_0xeb78('0x9')](),controller['describe']);router['get'](_0xeb78('0xb'),auth['isAuthenticated'](),controller[_0xeb78('0xc')]);router[_0xeb78('0xd')]('/',auth[_0xeb78('0x9')](),controller[_0xeb78('0xe')]);router[_0xeb78('0xf')](_0xeb78('0xb'),auth[_0xeb78('0x9')](),controller[_0xeb78('0x10')]);router[_0xeb78('0x11')]('/:id',auth[_0xeb78('0x9')](),controller[_0xeb78('0x12')]);module[_0xeb78('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 4a09b2c..6dad475 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 _0x9a19=['sequelize','exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x3194b6,_0x4d04af){var _0x7534f6=function(_0x561885){while(--_0x561885){_0x3194b6['push'](_0x3194b6['shift']());}};_0x7534f6(++_0x4d04af);}(_0x9a19,0x114));var _0x99a1=function(_0x2bcb75,_0x5789a7){_0x2bcb75=_0x2bcb75-0x0;var _0x175345=_0x9a19[_0x2bcb75];return _0x175345;};'use strict';var Sequelize=require(_0x99a1('0x0'));module[_0x99a1('0x1')]={'privilege':{'type':Sequelize[_0x99a1('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x99a1('0x3')]},'channelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'calleridnum':{'type':Sequelize[_0x99a1('0x2')]},'calleridname':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'connectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'language':{'type':Sequelize[_0x99a1('0x2')]},'accountcode':{'type':Sequelize[_0x99a1('0x2')]},'context':{'type':Sequelize[_0x99a1('0x2')]},'exten':{'type':Sequelize[_0x99a1('0x2')]},'priority':{'type':Sequelize[_0x99a1('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x99a1('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x99a1('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x99a1('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x99a1('0x2')]},'destlanguage':{'type':Sequelize[_0x99a1('0x2')]},'destaccountcode':{'type':Sequelize[_0x99a1('0x2')]},'destcontext':{'type':Sequelize[_0x99a1('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x99a1('0x3')]},'destuniqueid':{'type':Sequelize[_0x99a1('0x2')]},'destlinkedid':{'type':Sequelize[_0x99a1('0x2')]},'dialstring':{'type':Sequelize[_0x99a1('0x2')]},'dialstatus':{'type':Sequelize[_0x99a1('0x2')]},'starttime':{'type':Sequelize[_0x99a1('0x4')]},'answertime':{'type':Sequelize[_0x99a1('0x4')]},'endtime':{'type':Sequelize[_0x99a1('0x4')]},'lastevent':{'type':Sequelize[_0x99a1('0x2')],'comment':_0x99a1('0x5')},'routeId':{'type':Sequelize[_0x99a1('0x3')]},'duration':{'type':Sequelize[_0x99a1('0x3')]},'holdtime':{'type':Sequelize[_0x99a1('0x3')]},'billableseconds':{'type':Sequelize[_0x99a1('0x3')]}}; \ No newline at end of file +var _0x9c44=['STRING','INTEGER','DATE','called,connect,complete'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x9c44,0x178));var _0x49c4=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x9c44[_0x3b0731];return _0x4204d7;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize[_0x49c4('0x0')]},'channel':{'type':Sequelize[_0x49c4('0x0')]},'channelstate':{'type':Sequelize[_0x49c4('0x1')]},'channelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'calleridnum':{'type':Sequelize[_0x49c4('0x0')]},'calleridname':{'type':Sequelize[_0x49c4('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x49c4('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x49c4('0x0')]},'exten':{'type':Sequelize[_0x49c4('0x0')]},'priority':{'type':Sequelize[_0x49c4('0x1')]},'uniqueid':{'type':Sequelize[_0x49c4('0x0')]},'linkedid':{'type':Sequelize[_0x49c4('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x49c4('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridnum':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridname':{'type':Sequelize[_0x49c4('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x49c4('0x0')]},'destaccountcode':{'type':Sequelize[_0x49c4('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x49c4('0x0')]},'destpriority':{'type':Sequelize[_0x49c4('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x49c4('0x0')]},'dialstatus':{'type':Sequelize[_0x49c4('0x0')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x49c4('0x2')]},'endtime':{'type':Sequelize[_0x49c4('0x2')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x49c4('0x3')},'routeId':{'type':Sequelize[_0x49c4('0x1')]},'duration':{'type':Sequelize[_0x49c4('0x1')]},'holdtime':{'type':Sequelize[_0x49c4('0x1')]},'billableseconds':{'type':Sequelize[_0x49c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 6f5ee24..03fade1 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 _0x645c=['catch','show','params','keys','intersection','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceDialReport','includeAll','findAll','rows'];(function(_0x14a2da,_0x6c5759){var _0x5d5122=function(_0x2dd379){while(--_0x2dd379){_0x14a2da['push'](_0x14a2da['shift']());}};_0x5d5122(++_0x6c5759);}(_0x645c,0xe5));var _0xc645=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x645c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc645('0x0'));var rimraf=require(_0xc645('0x1'));var zipdir=require(_0xc645('0x2'));var jsonpatch=require(_0xc645('0x3'));var rp=require(_0xc645('0x4'));var moment=require(_0xc645('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc645('0x6'));var util=require('util');var path=require('path');var sox=require(_0xc645('0x7'));var csv=require(_0xc645('0x8'));var ejs=require(_0xc645('0x9'));var fs=require('fs');var fs_extra=require(_0xc645('0xa'));var _=require(_0xc645('0xb'));var squel=require(_0xc645('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc645('0x8'));var querystring=require(_0xc645('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc645('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc645('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xc645('0x10'));var config=require(_0xc645('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0xc645('0x12'))['db'];function respondWithStatusCode(_0x481f1e,_0x2a9e89){_0x2a9e89=_0x2a9e89||0xcc;return function(_0x851e25){if(_0x851e25){return _0x481f1e['sendStatus'](_0x2a9e89);}return _0x481f1e[_0xc645('0x13')](_0x2a9e89)[_0xc645('0x14')]();};}function respondWithResult(_0x293d92,_0x269489){_0x269489=_0x269489||0xc8;return function(_0xc55729){if(_0xc55729){return _0x293d92[_0xc645('0x13')](_0x269489)['json'](_0xc55729);}};}function respondWithFilteredResult(_0x489caa,_0x45eb8a){return function(_0x270722){if(_0x270722){var _0x1dc313=typeof _0x45eb8a[_0xc645('0x15')]===_0xc645('0x16')&&typeof _0x45eb8a[_0xc645('0x17')]===_0xc645('0x16');var _0x33a8f5=_0x270722[_0xc645('0x18')];var _0x55133c=_0x1dc313?0x0:_0x45eb8a[_0xc645('0x15')];var _0x5c5e04=_0x1dc313?_0x270722[_0xc645('0x18')]:_0x45eb8a['offset']+_0x45eb8a[_0xc645('0x17')];var _0x1ea196;if(_0x5c5e04>=_0x33a8f5){_0x5c5e04=_0x33a8f5;_0x1ea196=0xc8;}else{_0x1ea196=0xce;}_0x489caa[_0xc645('0x13')](_0x1ea196);return _0x489caa['set'](_0xc645('0x19'),_0x55133c+'-'+_0x5c5e04+'/'+_0x33a8f5)['json'](_0x270722);}return null;};}function patchUpdates(_0x29b592){return function(_0x1059f3){try{jsonpatch[_0xc645('0x1a')](_0x1059f3,_0x29b592,!![]);}catch(_0x1f36f0){return BPromise[_0xc645('0x1b')](_0x1f36f0);}return _0x1059f3[_0xc645('0x1c')]();};}function saveUpdates(_0x40641b,_0x484b9c){return function(_0xedd89b){if(_0xedd89b){return _0xedd89b[_0xc645('0x1d')](_0x40641b)[_0xc645('0x1e')](function(_0x524945){return _0x524945;});}return null;};}function removeEntity(_0xfcbe58,_0x273e62){return function(_0x1a17a0){if(_0x1a17a0){return _0x1a17a0[_0xc645('0x1f')]()[_0xc645('0x1e')](function(){_0xfcbe58[_0xc645('0x13')](0xcc)[_0xc645('0x14')]();});}};}function handleEntityNotFound(_0x1f188a,_0x10c957){return function(_0x3ada34){if(!_0x3ada34){_0x1f188a[_0xc645('0x20')](0x194);}return _0x3ada34;};}function handleError(_0x17ebe9,_0x3a8769){_0x3a8769=_0x3a8769||0x1f4;return function(_0xefd8b2){logger[_0xc645('0x21')](_0xefd8b2[_0xc645('0x22')]);if(_0xefd8b2['name']){delete _0xefd8b2[_0xc645('0x23')];}_0x17ebe9[_0xc645('0x13')](_0x3a8769)[_0xc645('0x24')](_0xefd8b2);};}exports[_0xc645('0x25')]=function(_0x7c3c5c,_0x3d3117){var _0x539927={},_0x5e217a={},_0x52d9e0={'count':0x0,'rows':[]};var _0x42abbd=_[_0xc645('0x26')](db['VoiceDialReport'][_0xc645('0x27')],function(_0x1781a9){return{'name':_0x1781a9[_0xc645('0x28')],'type':_0x1781a9[_0xc645('0x29')][_0xc645('0x2a')]};});_0x5e217a[_0xc645('0x2b')]=_['map'](_0x42abbd,_0xc645('0x23'));_0x5e217a[_0xc645('0x2c')]=_['keys'](_0x7c3c5c['query']);_0x5e217a[_0xc645('0x2d')]=_['intersection'](_0x5e217a[_0xc645('0x2b')],_0x5e217a[_0xc645('0x2c')]);_0x539927[_0xc645('0x2e')]=_['intersection'](_0x5e217a[_0xc645('0x2b')],qs[_0xc645('0x2f')](_0x7c3c5c[_0xc645('0x2c')][_0xc645('0x2f')]));_0x539927['attributes']=_0x539927['attributes'][_0xc645('0x30')]?_0x539927[_0xc645('0x2e')]:_0x5e217a[_0xc645('0x2b')];if(!_0x7c3c5c[_0xc645('0x2c')][_0xc645('0x31')](_0xc645('0x32'))){_0x539927[_0xc645('0x17')]=qs[_0xc645('0x17')](_0x7c3c5c[_0xc645('0x2c')][_0xc645('0x17')]);_0x539927[_0xc645('0x15')]=qs[_0xc645('0x15')](_0x7c3c5c[_0xc645('0x2c')][_0xc645('0x15')]);}_0x539927[_0xc645('0x33')]=qs[_0xc645('0x34')](_0x7c3c5c[_0xc645('0x2c')][_0xc645('0x34')]);_0x539927[_0xc645('0x35')]=qs[_0xc645('0x2d')](_[_0xc645('0x36')](_0x7c3c5c[_0xc645('0x2c')],_0x5e217a[_0xc645('0x2d')]),_0x42abbd);if(_0x7c3c5c[_0xc645('0x2c')][_0xc645('0x37')]){_0x539927[_0xc645('0x35')]=_[_0xc645('0x38')](_0x539927[_0xc645('0x35')],{'$or':_[_0xc645('0x26')](_0x42abbd,function(_0x2d7c21){if(_0x2d7c21[_0xc645('0x29')]!==_0xc645('0x39')){var _0x2bf603={};_0x2bf603[_0x2d7c21[_0xc645('0x23')]]={'$like':'%'+_0x7c3c5c[_0xc645('0x2c')]['filter']+'%'};return _0x2bf603;}})});}_0x539927=_['merge']({},_0x539927,_0x7c3c5c[_0xc645('0x3a')]);var _0x2d221c={'where':_0x539927[_0xc645('0x35')]};return db[_0xc645('0x3b')]['count'](_0x2d221c)[_0xc645('0x1e')](function(_0x468160){_0x52d9e0[_0xc645('0x18')]=_0x468160;if(_0x7c3c5c['query'][_0xc645('0x3c')]){_0x539927['include']=[{'all':!![]}];}return db[_0xc645('0x3b')][_0xc645('0x3d')](_0x539927);})[_0xc645('0x1e')](function(_0x48e117){_0x52d9e0[_0xc645('0x3e')]=_0x48e117;return _0x52d9e0;})[_0xc645('0x1e')](respondWithFilteredResult(_0x3d3117,_0x539927))[_0xc645('0x3f')](handleError(_0x3d3117,null));};exports[_0xc645('0x40')]=function(_0x2dc907,_0x5ea738){var _0x4b03d6={'raw':!![],'where':{'id':_0x2dc907[_0xc645('0x41')]['id']}},_0x5918cb={};_0x5918cb[_0xc645('0x2b')]=_['keys'](db['VoiceDialReport'][_0xc645('0x27')]);_0x5918cb[_0xc645('0x2c')]=_[_0xc645('0x42')](_0x2dc907[_0xc645('0x2c')]);_0x5918cb[_0xc645('0x2d')]=_['intersection'](_0x5918cb[_0xc645('0x2b')],_0x5918cb[_0xc645('0x2c')]);_0x4b03d6[_0xc645('0x2e')]=_[_0xc645('0x43')](_0x5918cb[_0xc645('0x2b')],qs[_0xc645('0x2f')](_0x2dc907['query'][_0xc645('0x2f')]));_0x4b03d6['attributes']=_0x4b03d6[_0xc645('0x2e')][_0xc645('0x30')]?_0x4b03d6[_0xc645('0x2e')]:_0x5918cb[_0xc645('0x2b')];if(_0x2dc907[_0xc645('0x2c')]['includeAll']){_0x4b03d6[_0xc645('0x44')]=[{'all':!![]}];}_0x4b03d6=_[_0xc645('0x38')]({},_0x4b03d6,_0x2dc907[_0xc645('0x3a')]);return db[_0xc645('0x3b')][_0xc645('0x45')](_0x4b03d6)[_0xc645('0x1e')](handleEntityNotFound(_0x5ea738,null))[_0xc645('0x1e')](respondWithResult(_0x5ea738,null))['catch'](handleError(_0x5ea738,null));};exports['create']=function(_0xe37212,_0x1a7a03){return db[_0xc645('0x3b')][_0xc645('0x46')](_0xe37212[_0xc645('0x47')],{})['then'](respondWithResult(_0x1a7a03,0xc9))[_0xc645('0x3f')](handleError(_0x1a7a03,null));};exports[_0xc645('0x1d')]=function(_0x26d697,_0x3cdac0){if(_0x26d697[_0xc645('0x47')]['id']){delete _0x26d697['body']['id'];}return db['VoiceDialReport'][_0xc645('0x45')]({'where':{'id':_0x26d697[_0xc645('0x41')]['id']}})[_0xc645('0x1e')](handleEntityNotFound(_0x3cdac0,null))['then'](saveUpdates(_0x26d697[_0xc645('0x47')],null))[_0xc645('0x1e')](respondWithResult(_0x3cdac0,null))[_0xc645('0x3f')](handleError(_0x3cdac0,null));};exports[_0xc645('0x1f')]=function(_0x3e3344,_0x384c24){return db[_0xc645('0x3b')][_0xc645('0x45')]({'where':{'id':_0x3e3344[_0xc645('0x41')]['id']}})['then'](handleEntityNotFound(_0x384c24,null))[_0xc645('0x1e')](removeEntity(_0x384c24,null))[_0xc645('0x3f')](handleError(_0x384c24,null));};exports['describe']=function(_0x26d8e1,_0x30efe5){return db[_0xc645('0x3b')][_0xc645('0x48')]()[_0xc645('0x1e')](respondWithResult(_0x30efe5,null))[_0xc645('0x3f')](handleError(_0x30efe5,null));}; \ No newline at end of file +var _0xfc31=['then','destroy','name','send','index','map','VoiceDialReport','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','rows','catch','params','rawAttributes','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','reject','save','update'];(function(_0x131623,_0x4d5abb){var _0x5d03b6=function(_0x38f446){while(--_0x38f446){_0x131623['push'](_0x131623['shift']());}};_0x5d03b6(++_0x4d5abb);}(_0xfc31,0x1db));var _0x1fc3=function(_0x1e71a1,_0x1cf423){_0x1e71a1=_0x1e71a1-0x0;var _0x16ab82=_0xfc31[_0x1e71a1];return _0x16ab82;};'use strict';var emlformat=require(_0x1fc3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1fc3('0x1'));var jsonpatch=require(_0x1fc3('0x2'));var rp=require(_0x1fc3('0x3'));var moment=require(_0x1fc3('0x4'));var BPromise=require(_0x1fc3('0x5'));var Mustache=require(_0x1fc3('0x6'));var util=require(_0x1fc3('0x7'));var path=require(_0x1fc3('0x8'));var sox=require(_0x1fc3('0x9'));var csv=require(_0x1fc3('0xa'));var ejs=require(_0x1fc3('0xb'));var fs=require('fs');var fs_extra=require(_0x1fc3('0xc'));var _=require(_0x1fc3('0xd'));var squel=require(_0x1fc3('0xe'));var crypto=require(_0x1fc3('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x1fc3('0x10'));var toCsv=require(_0x1fc3('0xa'));var querystring=require('querystring');var Papa=require(_0x1fc3('0x11'));var Redis=require(_0x1fc3('0x12'));var authService=require(_0x1fc3('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1fc3('0x14'))(_0x1fc3('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1fc3('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f9fd2,_0xb31565){_0xb31565=_0xb31565||0xcc;return function(_0xe343fc){if(_0xe343fc){return _0x3f9fd2[_0x1fc3('0x17')](_0xb31565);}return _0x3f9fd2[_0x1fc3('0x18')](_0xb31565)[_0x1fc3('0x19')]();};}function respondWithResult(_0x2680b4,_0x539edb){_0x539edb=_0x539edb||0xc8;return function(_0x58eb31){if(_0x58eb31){return _0x2680b4['status'](_0x539edb)['json'](_0x58eb31);}};}function respondWithFilteredResult(_0x50ad4c,_0x4df1b6){return function(_0x4693c9){if(_0x4693c9){var _0x1b7c77=typeof _0x4df1b6['offset']===_0x1fc3('0x1a')&&typeof _0x4df1b6[_0x1fc3('0x1b')]==='undefined';var _0x586d86=_0x4693c9[_0x1fc3('0x1c')];var _0x1dfb88=_0x1b7c77?0x0:_0x4df1b6[_0x1fc3('0x1d')];var _0x6c696c=_0x1b7c77?_0x4693c9['count']:_0x4df1b6[_0x1fc3('0x1d')]+_0x4df1b6[_0x1fc3('0x1b')];var _0xb1d374;if(_0x6c696c>=_0x586d86){_0x6c696c=_0x586d86;_0xb1d374=0xc8;}else{_0xb1d374=0xce;}_0x50ad4c[_0x1fc3('0x18')](_0xb1d374);return _0x50ad4c['set'](_0x1fc3('0x1e'),_0x1dfb88+'-'+_0x6c696c+'/'+_0x586d86)[_0x1fc3('0x1f')](_0x4693c9);}return null;};}function patchUpdates(_0x29f288){return function(_0xb04ec1){try{jsonpatch[_0x1fc3('0x20')](_0xb04ec1,_0x29f288,!![]);}catch(_0x152c80){return BPromise[_0x1fc3('0x21')](_0x152c80);}return _0xb04ec1[_0x1fc3('0x22')]();};}function saveUpdates(_0x17a230,_0x422594){return function(_0x111597){if(_0x111597){return _0x111597[_0x1fc3('0x23')](_0x17a230)[_0x1fc3('0x24')](function(_0x2efc8f){return _0x2efc8f;});}return null;};}function removeEntity(_0x1a3749,_0x41b4a2){return function(_0x1efa82){if(_0x1efa82){return _0x1efa82[_0x1fc3('0x25')]()[_0x1fc3('0x24')](function(){_0x1a3749['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x16791c,_0x1e4a36){return function(_0x46ebf6){if(!_0x46ebf6){_0x16791c[_0x1fc3('0x17')](0x194);}return _0x46ebf6;};}function handleError(_0x4ab67c,_0x419c32){_0x419c32=_0x419c32||0x1f4;return function(_0x2480d7){logger['error'](_0x2480d7['stack']);if(_0x2480d7[_0x1fc3('0x26')]){delete _0x2480d7[_0x1fc3('0x26')];}_0x4ab67c['status'](_0x419c32)[_0x1fc3('0x27')](_0x2480d7);};}exports[_0x1fc3('0x28')]=function(_0x20dbf3,_0x41ad8f){var _0x2e1083={},_0x25f199={},_0x5d89ec={'count':0x0,'rows':[]};var _0x290b0e=_[_0x1fc3('0x29')](db[_0x1fc3('0x2a')]['rawAttributes'],function(_0xa8e007){return{'name':_0xa8e007[_0x1fc3('0x2b')],'type':_0xa8e007[_0x1fc3('0x2c')][_0x1fc3('0x2d')]};});_0x25f199[_0x1fc3('0x2e')]=_['map'](_0x290b0e,_0x1fc3('0x26'));_0x25f199['query']=_[_0x1fc3('0x2f')](_0x20dbf3[_0x1fc3('0x30')]);_0x25f199[_0x1fc3('0x31')]=_['intersection'](_0x25f199[_0x1fc3('0x2e')],_0x25f199[_0x1fc3('0x30')]);_0x2e1083['attributes']=_[_0x1fc3('0x32')](_0x25f199['model'],qs[_0x1fc3('0x33')](_0x20dbf3['query'][_0x1fc3('0x33')]));_0x2e1083[_0x1fc3('0x34')]=_0x2e1083[_0x1fc3('0x34')]['length']?_0x2e1083[_0x1fc3('0x34')]:_0x25f199[_0x1fc3('0x2e')];if(!_0x20dbf3[_0x1fc3('0x30')][_0x1fc3('0x35')](_0x1fc3('0x36'))){_0x2e1083[_0x1fc3('0x1b')]=qs[_0x1fc3('0x1b')](_0x20dbf3[_0x1fc3('0x30')][_0x1fc3('0x1b')]);_0x2e1083[_0x1fc3('0x1d')]=qs[_0x1fc3('0x1d')](_0x20dbf3['query']['offset']);}_0x2e1083[_0x1fc3('0x37')]=qs[_0x1fc3('0x38')](_0x20dbf3[_0x1fc3('0x30')][_0x1fc3('0x38')]);_0x2e1083['where']=qs[_0x1fc3('0x31')](_[_0x1fc3('0x39')](_0x20dbf3[_0x1fc3('0x30')],_0x25f199[_0x1fc3('0x31')]),_0x290b0e);if(_0x20dbf3[_0x1fc3('0x30')]['filter']){_0x2e1083['where']=_['merge'](_0x2e1083[_0x1fc3('0x3a')],{'$or':_['map'](_0x290b0e,function(_0x47945c){if(_0x47945c[_0x1fc3('0x2c')]!==_0x1fc3('0x3b')){var _0x237daa={};_0x237daa[_0x47945c[_0x1fc3('0x26')]]={'$like':'%'+_0x20dbf3[_0x1fc3('0x30')][_0x1fc3('0x3c')]+'%'};return _0x237daa;}})});}_0x2e1083=_[_0x1fc3('0x3d')]({},_0x2e1083,_0x20dbf3[_0x1fc3('0x3e')]);var _0x167763={'where':_0x2e1083['where']};return db[_0x1fc3('0x2a')][_0x1fc3('0x1c')](_0x167763)[_0x1fc3('0x24')](function(_0xd125a9){_0x5d89ec[_0x1fc3('0x1c')]=_0xd125a9;if(_0x20dbf3['query'][_0x1fc3('0x3f')]){_0x2e1083['include']=[{'all':!![]}];}return db[_0x1fc3('0x2a')]['findAll'](_0x2e1083);})[_0x1fc3('0x24')](function(_0x3af54d){_0x5d89ec[_0x1fc3('0x40')]=_0x3af54d;return _0x5d89ec;})[_0x1fc3('0x24')](respondWithFilteredResult(_0x41ad8f,_0x2e1083))[_0x1fc3('0x41')](handleError(_0x41ad8f,null));};exports['show']=function(_0x16550a,_0x2fe476){var _0x1a0d6c={'raw':!![],'where':{'id':_0x16550a[_0x1fc3('0x42')]['id']}},_0x293f89={};_0x293f89[_0x1fc3('0x2e')]=_[_0x1fc3('0x2f')](db['VoiceDialReport'][_0x1fc3('0x43')]);_0x293f89[_0x1fc3('0x30')]=_[_0x1fc3('0x2f')](_0x16550a[_0x1fc3('0x30')]);_0x293f89['filters']=_[_0x1fc3('0x32')](_0x293f89[_0x1fc3('0x2e')],_0x293f89[_0x1fc3('0x30')]);_0x1a0d6c[_0x1fc3('0x34')]=_[_0x1fc3('0x32')](_0x293f89['model'],qs[_0x1fc3('0x33')](_0x16550a[_0x1fc3('0x30')]['fields']));_0x1a0d6c[_0x1fc3('0x34')]=_0x1a0d6c[_0x1fc3('0x34')][_0x1fc3('0x44')]?_0x1a0d6c[_0x1fc3('0x34')]:_0x293f89[_0x1fc3('0x2e')];if(_0x16550a['query'][_0x1fc3('0x3f')]){_0x1a0d6c['include']=[{'all':!![]}];}_0x1a0d6c=_[_0x1fc3('0x3d')]({},_0x1a0d6c,_0x16550a[_0x1fc3('0x3e')]);return db[_0x1fc3('0x2a')][_0x1fc3('0x45')](_0x1a0d6c)[_0x1fc3('0x24')](handleEntityNotFound(_0x2fe476,null))[_0x1fc3('0x24')](respondWithResult(_0x2fe476,null))['catch'](handleError(_0x2fe476,null));};exports[_0x1fc3('0x46')]=function(_0x1cc71e,_0x2b075d){return db['VoiceDialReport'][_0x1fc3('0x46')](_0x1cc71e[_0x1fc3('0x47')],{})['then'](respondWithResult(_0x2b075d,0xc9))['catch'](handleError(_0x2b075d,null));};exports[_0x1fc3('0x23')]=function(_0x287501,_0x1a82af){if(_0x287501[_0x1fc3('0x47')]['id']){delete _0x287501['body']['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x287501[_0x1fc3('0x42')]['id']}})[_0x1fc3('0x24')](handleEntityNotFound(_0x1a82af,null))[_0x1fc3('0x24')](saveUpdates(_0x287501['body'],null))[_0x1fc3('0x24')](respondWithResult(_0x1a82af,null))['catch'](handleError(_0x1a82af,null));};exports[_0x1fc3('0x25')]=function(_0x54bb76,_0x8a228a){return db['VoiceDialReport'][_0x1fc3('0x45')]({'where':{'id':_0x54bb76[_0x1fc3('0x42')]['id']}})[_0x1fc3('0x24')](handleEntityNotFound(_0x8a228a,null))[_0x1fc3('0x24')](removeEntity(_0x8a228a,null))[_0x1fc3('0x41')](handleError(_0x8a228a,null));};exports[_0x1fc3('0x48')]=function(_0x1cc33b,_0x45b71d){return db[_0x1fc3('0x2a')]['describe']()[_0x1fc3('0x24')](respondWithResult(_0x45b71d,null))[_0x1fc3('0x41')](handleError(_0x45b71d,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 8129624..fde01a9 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 _0x2411=['bluebird','request-promise','rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','report_dial','uniqueid','util','../../config/logger','api','moment'];(function(_0x3f0800,_0x6eb84){var _0x19267e=function(_0x4fe065){while(--_0x4fe065){_0x3f0800['push'](_0x3f0800['shift']());}};_0x19267e(++_0x6eb84);}(_0x2411,0x175));var _0x1241=function(_0x5ac1e5,_0x4b5012){_0x5ac1e5=_0x5ac1e5-0x0;var _0x1bccc6=_0x2411[_0x5ac1e5];return _0x1bccc6;};'use strict';var _=require('lodash');var util=require(_0x1241('0x0'));var logger=require(_0x1241('0x1'))(_0x1241('0x2'));var moment=require(_0x1241('0x3'));var BPromise=require(_0x1241('0x4'));var rp=require(_0x1241('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1241('0x6'));var config=require(_0x1241('0x7'));var attributes=require(_0x1241('0x8'));module[_0x1241('0x9')]=function(_0x3b2074,_0x1f9d02){return _0x3b2074[_0x1241('0xa')]('VoiceDialReport',attributes,{'tableName':_0x1241('0xb'),'paranoid':![],'indexes':[{'fields':[_0x1241('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x463e=['./voiceDialReport.attributes','exports','VoiceDialReport','report_dial','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2b04c7,_0x544682){var _0x279f78=function(_0x24f025){while(--_0x24f025){_0x2b04c7['push'](_0x2b04c7['shift']());}};_0x279f78(++_0x544682);}(_0x463e,0x1d6));var _0xe463=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x463e[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xe463('0x0'));var util=require(_0xe463('0x1'));var logger=require(_0xe463('0x2'))(_0xe463('0x3'));var moment=require(_0xe463('0x4'));var BPromise=require(_0xe463('0x5'));var rp=require(_0xe463('0x6'));var fs=require('fs');var path=require(_0xe463('0x7'));var rimraf=require(_0xe463('0x8'));var config=require(_0xe463('0x9'));var attributes=require(_0xe463('0xa'));module[_0xe463('0xb')]=function(_0x4969ec,_0x4f9125){return _0x4969ec['define'](_0xe463('0xc'),attributes,{'tableName':_0xe463('0xd'),'paranoid':![],'indexes':[{'fields':[_0xe463('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 42c42c2..41c9d4a 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 _0x45e1=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','request\x20sent','debug','stringify','error','code','VoiceDialReport,\x20%s,\x20%s','message','info','catch','CreateVoiceDialReport','VoiceDialReport','body','options','then','UpdateVoiceDialReport','update','where','attributes','lodash','moment','randomstring','ioredis'];(function(_0x13843f,_0x50422d){var _0x1063ae=function(_0x12fd6b){while(--_0x12fd6b){_0x13843f['push'](_0x13843f['shift']());}};_0x1063ae(++_0x50422d);}(_0x45e1,0x10a));var _0x145e=function(_0x515283,_0x813dea){_0x515283=_0x515283-0x0;var _0x38f836=_0x45e1[_0x515283];return _0x38f836;};'use strict';var _=require(_0x145e('0x0'));var util=require('util');var moment=require(_0x145e('0x1'));var BPromise=require('bluebird');var rs=require(_0x145e('0x2'));var fs=require('fs');var Redis=require(_0x145e('0x3'));var db=require(_0x145e('0x4'))['db'];var utils=require(_0x145e('0x5'));var logger=require(_0x145e('0x6'))(_0x145e('0x7'));var config=require(_0x145e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x145e('0x9')][_0x145e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54850b,_0xe50be0,_0x37c3e2){return new BPromise(function(_0x26f840,_0x470ba0){return client[_0x145e('0xb')](_0x54850b,_0x37c3e2)['then'](function(_0x4035b4){logger['info']('VoiceDialReport,\x20%s,\x20%s',_0xe50be0,_0x145e('0xc'));logger[_0x145e('0xd')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0xe50be0,_0x145e('0xc'),JSON[_0x145e('0xe')](_0x4035b4));if(_0x4035b4[_0x145e('0xf')]){if(_0x4035b4['error'][_0x145e('0x10')]===0x1f4){logger[_0x145e('0xf')](_0x145e('0x11'),_0xe50be0,_0x4035b4[_0x145e('0xf')][_0x145e('0x12')]);return _0x470ba0(_0x4035b4[_0x145e('0xf')][_0x145e('0x12')]);}logger[_0x145e('0xf')](_0x145e('0x11'),_0xe50be0,_0x4035b4[_0x145e('0xf')]['message']);return _0x26f840(_0x4035b4[_0x145e('0xf')][_0x145e('0x12')]);}else{logger[_0x145e('0x13')](_0x145e('0x11'),_0xe50be0,_0x145e('0xc'));_0x26f840(_0x4035b4['result'][_0x145e('0x12')]);}})[_0x145e('0x14')](function(_0xc3e47c){logger['error'](_0x145e('0x11'),_0xe50be0,_0xc3e47c);_0x470ba0(_0xc3e47c);});});}exports[_0x145e('0x15')]=function(_0x12a905){var _0x5ae142=this;return new Promise(function(_0x38fc99,_0x52ea60){return db[_0x145e('0x16')]['create'](_0x12a905[_0x145e('0x17')],{'raw':_0x12a905[_0x145e('0x18')]?_0x12a905[_0x145e('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x145e('0x19')](function(_0x5b137c){logger['info'](_0x145e('0x15'),_0x12a905);logger['debug'](_0x145e('0x15'),_0x12a905,JSON[_0x145e('0xe')](_0x5b137c));_0x38fc99(_0x5b137c);})[_0x145e('0x14')](function(_0x271788){logger[_0x145e('0xf')](_0x145e('0x15'),_0x271788['message'],_0x12a905);_0x52ea60(_0x5ae142['error'](0x1f4,_0x271788['message']));});});};exports[_0x145e('0x1a')]=function(_0x2a81e0){var _0x2d1bee=this;return new Promise(function(_0x57a37d,_0x38657a){return db['VoiceDialReport'][_0x145e('0x1b')](_0x2a81e0[_0x145e('0x17')],{'raw':_0x2a81e0[_0x145e('0x18')]?_0x2a81e0[_0x145e('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a81e0[_0x145e('0x18')]?_0x2a81e0[_0x145e('0x18')][_0x145e('0x1c')]||null:null,'attributes':_0x2a81e0[_0x145e('0x18')]?_0x2a81e0['options'][_0x145e('0x1d')]||null:null,'limit':_0x2a81e0[_0x145e('0x18')]?_0x2a81e0[_0x145e('0x18')]['limit']||null:null})[_0x145e('0x19')](function(_0x4add22){logger[_0x145e('0x13')]('UpdateVoiceDialReport',_0x2a81e0);logger[_0x145e('0xd')](_0x145e('0x1a'),_0x2a81e0,JSON['stringify'](_0x4add22));_0x57a37d(_0x4add22);})[_0x145e('0x14')](function(_0x2d3441){logger[_0x145e('0xf')](_0x145e('0x1a'),_0x2d3441[_0x145e('0x12')],_0x2a81e0);_0x38657a(_0x2d1bee['error'](0x1f4,_0x2d3441['message']));});});}; \ No newline at end of file +var _0x1473=['options','raw','catch','UpdateVoiceDialReport','where','attributes','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','CreateVoiceDialReport','VoiceDialReport','create','body'];(function(_0x587a80,_0x4b0de4){var _0x35926d=function(_0x11dce1){while(--_0x11dce1){_0x587a80['push'](_0x587a80['shift']());}};_0x35926d(++_0x4b0de4);}(_0x1473,0x199));var _0x3147=function(_0x3289bb,_0x46d24e){_0x3289bb=_0x3289bb-0x0;var _0x54bd2c=_0x1473[_0x3289bb];return _0x54bd2c;};'use strict';var _=require('lodash');var util=require(_0x3147('0x0'));var moment=require('moment');var BPromise=require(_0x3147('0x1'));var rs=require(_0x3147('0x2'));var fs=require('fs');var Redis=require(_0x3147('0x3'));var db=require(_0x3147('0x4'))['db'];var utils=require(_0x3147('0x5'));var logger=require('../../config/logger')(_0x3147('0x6'));var config=require(_0x3147('0x7'));var jayson=require(_0x3147('0x8'));var client=jayson[_0x3147('0x9')][_0x3147('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x130a3d,_0x218b33,_0x4b3281){return new BPromise(function(_0x1f395b,_0x157d86){return client[_0x3147('0xb')](_0x130a3d,_0x4b3281)[_0x3147('0xc')](function(_0x4e9892){logger[_0x3147('0xd')](_0x3147('0xe'),_0x218b33,_0x3147('0xf'));logger[_0x3147('0x10')](_0x3147('0x11'),_0x218b33,_0x3147('0xf'),JSON[_0x3147('0x12')](_0x4e9892));if(_0x4e9892[_0x3147('0x13')]){if(_0x4e9892['error']['code']===0x1f4){logger['error'](_0x3147('0xe'),_0x218b33,_0x4e9892['error'][_0x3147('0x14')]);return _0x157d86(_0x4e9892[_0x3147('0x13')][_0x3147('0x14')]);}logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x218b33,_0x4e9892[_0x3147('0x13')][_0x3147('0x14')]);return _0x1f395b(_0x4e9892[_0x3147('0x13')]['message']);}else{logger[_0x3147('0xd')](_0x3147('0xe'),_0x218b33,'request\x20sent');_0x1f395b(_0x4e9892['result'][_0x3147('0x14')]);}})['catch'](function(_0x5767a9){logger[_0x3147('0x13')](_0x3147('0xe'),_0x218b33,_0x5767a9);_0x157d86(_0x5767a9);});});}exports[_0x3147('0x15')]=function(_0x550ebe){var _0x1de18a=this;return new Promise(function(_0x49e1d5,_0x5a4084){return db[_0x3147('0x16')][_0x3147('0x17')](_0x550ebe[_0x3147('0x18')],{'raw':_0x550ebe['options']?_0x550ebe[_0x3147('0x19')][_0x3147('0x1a')]===undefined?!![]:![]:!![]})[_0x3147('0xc')](function(_0x19a2a6){logger[_0x3147('0xd')](_0x3147('0x15'),_0x550ebe);logger[_0x3147('0x10')](_0x3147('0x15'),_0x550ebe,JSON[_0x3147('0x12')](_0x19a2a6));_0x49e1d5(_0x19a2a6);})[_0x3147('0x1b')](function(_0x365051){logger[_0x3147('0x13')](_0x3147('0x15'),_0x365051['message'],_0x550ebe);_0x5a4084(_0x1de18a[_0x3147('0x13')](0x1f4,_0x365051[_0x3147('0x14')]));});});};exports[_0x3147('0x1c')]=function(_0x2141c9){var _0x5ad2af=this;return new Promise(function(_0x2f43bb,_0x356265){return db[_0x3147('0x16')]['update'](_0x2141c9[_0x3147('0x18')],{'raw':_0x2141c9[_0x3147('0x19')]?_0x2141c9[_0x3147('0x19')][_0x3147('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2141c9[_0x3147('0x19')]?_0x2141c9[_0x3147('0x19')][_0x3147('0x1d')]||null:null,'attributes':_0x2141c9[_0x3147('0x19')]?_0x2141c9[_0x3147('0x19')][_0x3147('0x1e')]||null:null,'limit':_0x2141c9[_0x3147('0x19')]?_0x2141c9[_0x3147('0x19')]['limit']||null:null})[_0x3147('0xc')](function(_0x4447ac){logger[_0x3147('0xd')](_0x3147('0x1c'),_0x2141c9);logger[_0x3147('0x10')]('UpdateVoiceDialReport',_0x2141c9,JSON[_0x3147('0x12')](_0x4447ac));_0x2f43bb(_0x4447ac);})[_0x3147('0x1b')](function(_0x41a46f){logger[_0x3147('0x13')](_0x3147('0x1c'),_0x41a46f['message'],_0x2141c9);_0x356265(_0x5ad2af[_0x3147('0x13')](0x1f4,_0x41a46f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index d200a99..aac6541 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 _0xc6af=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','index','/:id','show','post','isAuthenticated','/:id/applications','update','delete'];(function(_0x32c819,_0x1f75c3){var _0x2a5145=function(_0x519b06){while(--_0x519b06){_0x32c819['push'](_0x32c819['shift']());}};_0x2a5145(++_0x1f75c3);}(_0xc6af,0x1e1));var _0xfc6a=function(_0x28bc39,_0x384426){_0x28bc39=_0x28bc39-0x0;var _0x2d40be=_0xc6af[_0x28bc39];return _0x2d40be;};'use strict';var multer=require(_0xfc6a('0x0'));var util=require('util');var path=require(_0xfc6a('0x1'));var timeout=require(_0xfc6a('0x2'));var express=require(_0xfc6a('0x3'));var router=express[_0xfc6a('0x4')]();var fs_extra=require(_0xfc6a('0x5'));var auth=require(_0xfc6a('0x6'));var interaction=require(_0xfc6a('0x7'));var config=require(_0xfc6a('0x8'));var controller=require(_0xfc6a('0x9'));router[_0xfc6a('0xa')]('/',auth['isAuthenticated'](),controller[_0xfc6a('0xb')]);router[_0xfc6a('0xa')](_0xfc6a('0xc'),auth['isAuthenticated'](),controller[_0xfc6a('0xd')]);router[_0xfc6a('0xe')]('/',auth[_0xfc6a('0xf')](),controller['create']);router[_0xfc6a('0xe')](_0xfc6a('0x10'),auth[_0xfc6a('0xf')](),controller['addApplications']);router['put'](_0xfc6a('0xc'),auth[_0xfc6a('0xf')](),controller[_0xfc6a('0x11')]);router[_0xfc6a('0x12')](_0xfc6a('0xc'),auth[_0xfc6a('0xf')](),controller['destroy']);module[_0xfc6a('0x13')]=router; \ No newline at end of file +var _0xb21a=['../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','create','post','addApplications','put','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb21a,0xb5));var _0xab21=function(_0x37df2b,_0x21fe81){_0x37df2b=_0x37df2b-0x0;var _0x1f3384=_0xb21a[_0x37df2b];return _0x1f3384;};'use strict';var multer=require(_0xab21('0x0'));var util=require(_0xab21('0x1'));var path=require(_0xab21('0x2'));var timeout=require(_0xab21('0x3'));var express=require(_0xab21('0x4'));var router=express[_0xab21('0x5')]();var fs_extra=require(_0xab21('0x6'));var auth=require(_0xab21('0x7'));var interaction=require(_0xab21('0x8'));var config=require(_0xab21('0x9'));var controller=require(_0xab21('0xa'));router[_0xab21('0xb')]('/',auth[_0xab21('0xc')](),controller[_0xab21('0xd')]);router[_0xab21('0xb')](_0xab21('0xe'),auth[_0xab21('0xc')](),controller[_0xab21('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xab21('0x10')]);router[_0xab21('0x11')]('/:id/applications',auth[_0xab21('0xc')](),controller[_0xab21('0x12')]);router[_0xab21('0x13')](_0xab21('0xe'),auth[_0xab21('0xc')](),controller['update']);router['delete']('/:id',auth[_0xab21('0xc')](),controller[_0xab21('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 6138ee3..408c9ce 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 _0xce7f=['internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','wav','getDataValue','exten','exports','STRING','NoOp','ENUM','inbound','outbound'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xce7f,0x170));var _0xfce7=function(_0x23af31,_0x8a1add){_0x23af31=_0x23af31-0x0;var _0x49b82f=_0xce7f[_0x23af31];return _0x49b82f;};'use strict';var Sequelize=require('sequelize');module[_0xfce7('0x0')]={'context':{'type':Sequelize[_0xfce7('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xfce7('0x1')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0xfce7('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xfce7('0x2')},'appdata':{'type':Sequelize[_0xfce7('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xfce7('0x3')](_0xfce7('0x4'),_0xfce7('0x5'),_0xfce7('0x6'),_0xfce7('0x7'),_0xfce7('0x8'),_0xfce7('0x9'),_0xfce7('0xa')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xfce7('0x1')],'allowNull':![],'defaultValue':_0xfce7('0xb')},'IntervalId':{'type':Sequelize[_0xfce7('0xc')]},'isApp':{'type':Sequelize[_0xfce7('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xfce7('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xfce7('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xfce7('0x1')],'defaultValue':_0xfce7('0xe')},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x20f820){return this[_0xfce7('0xf')](_0xfce7('0x10'));}},'alias':{'type':Sequelize[_0xfce7('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0x30de=['system','any','*,*,*,*','BOOLEAN','wav','VIRTUAL','sequelize','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax'];(function(_0x10c363,_0x5bca68){var _0x5444b2=function(_0x5afe29){while(--_0x5afe29){_0x10c363['push'](_0x10c363['shift']());}};_0x5444b2(++_0x5bca68);}(_0x30de,0x96));var _0xe30d=function(_0xa43bf,_0x4bf1b7){_0xa43bf=_0xa43bf-0x0;var _0x4248dc=_0x30de[_0xa43bf];return _0x4248dc;};'use strict';var Sequelize=require(_0xe30d('0x0'));module['exports']={'context':{'type':Sequelize[_0xe30d('0x1')],'allowNull':![],'unique':_0xe30d('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0xe30d('0x1')],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xe30d('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xe30d('0x2')},'tag':{'type':Sequelize[_0xe30d('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe30d('0x3')},'appdata':{'type':Sequelize[_0xe30d('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xe30d('0x4')](_0xe30d('0x5'),_0xe30d('0x6'),_0xe30d('0x7'),_0xe30d('0x8'),_0xe30d('0x9'),_0xe30d('0xa'),_0xe30d('0xb')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe30d('0x1')],'allowNull':![],'defaultValue':_0xe30d('0xc')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0xe30d('0xd')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0xe30d('0x1')],'defaultValue':null},'callerID':{'type':Sequelize['STRING'],'allowNull':!![]},'record':{'type':Sequelize[_0xe30d('0xd')],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize[_0xe30d('0x1')],'defaultValue':_0xe30d('0xe')},'answer':{'type':Sequelize[_0xe30d('0xd')],'defaultValue':!![]},'name':{'type':Sequelize[_0xe30d('0xf')],'get':function(_0x2c31f9){return this['getDataValue']('exten');}},'alias':{'type':Sequelize[_0xe30d('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 9cc461b..46b80a7 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 _0x9faf=['error','stack','name','send','VoiceExtension','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','outbound','body','exten','concat','user','value','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','addApplications','sequelize','transaction','ISOLATION_LEVELS','READ_COMMITTED','createRouting','bulkCreate','cast(priority\x20as\x20unsigned)','finally','lodash','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','localhost','./voiceExtension.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','then','get','InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','map','includes','type','UserProfileResource'];(function(_0x4a5c7a,_0x6e37d4){var _0x1650ac=function(_0x484bf7){while(--_0x484bf7){_0x4a5c7a['push'](_0x4a5c7a['shift']());}};_0x1650ac(++_0x6e37d4);}(_0x9faf,0xf4));var _0xf9fa=function(_0x226c3f,_0x18fbd7){_0x226c3f=_0x226c3f-0x0;var _0x2f9232=_0x9faf[_0x226c3f];return _0x2f9232;};'use strict';var _=require(_0xf9fa('0x0'));var Redis=require(_0xf9fa('0x1'));var qs=require(_0xf9fa('0x2'));var logger=require('../../config/logger')(_0xf9fa('0x3'));var config=require('../../config/environment');var db=require(_0xf9fa('0x4'))['db'];config[_0xf9fa('0x5')]=_[_0xf9fa('0x6')](config[_0xf9fa('0x5')],{'host':_0xf9fa('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf9fa('0x5')]));require(_0xf9fa('0x8'))[_0xf9fa('0x9')](socket);function respondWithStatusCode(_0x615f21,_0x13ac56){_0x13ac56=_0x13ac56||0xcc;return function(_0x50898b){if(_0x50898b){return _0x615f21[_0xf9fa('0xa')](_0x13ac56);}return _0x615f21[_0xf9fa('0xb')](_0x13ac56)[_0xf9fa('0xc')]();};}function respondWithResult(_0x180af1,_0x172046){_0x172046=_0x172046||0xc8;return function(_0x4603f6){if(_0x4603f6){return _0x180af1[_0xf9fa('0xb')](_0x172046)[_0xf9fa('0xd')](_0x4603f6);}};}function respondWithFilteredResult(_0xad49f0,_0x270b01){return function(_0x4896e9){if(_0x4896e9){var _0x2803f2=typeof _0x270b01[_0xf9fa('0xe')]===_0xf9fa('0xf')&&typeof _0x270b01[_0xf9fa('0x10')]==='undefined';var _0x334f5a=_0x4896e9[_0xf9fa('0x11')];var _0x598695=_0x2803f2?0x0:_0x270b01['offset'];var _0x1d5fb7=_0x2803f2?_0x4896e9['count']:_0x270b01[_0xf9fa('0xe')]+_0x270b01['limit'];var _0x468933;if(_0x1d5fb7>=_0x334f5a){_0x1d5fb7=_0x334f5a;_0x468933=0xc8;}else{_0x468933=0xce;}_0xad49f0[_0xf9fa('0xb')](_0x468933);return _0xad49f0[_0xf9fa('0x12')](_0xf9fa('0x13'),_0x598695+'-'+_0x1d5fb7+'/'+_0x334f5a)[_0xf9fa('0xd')](_0x4896e9);}return null;};}function removeEntity(_0x2014ac){return function(_0x34cd3c){if(_0x34cd3c){return _0x34cd3c[_0xf9fa('0x14')]()[_0xf9fa('0x15')](function(){var _0x1fd132=_0x34cd3c[_0xf9fa('0x16')]({'plain':!![]});var _0x455005=[{'name':_0xf9fa('0x17'),'value':_0xf9fa('0x18'),'ignore':![]},{'name':_0xf9fa('0x19'),'value':'outbound','ignore':![]},{'name':_0xf9fa('0x1a'),'value':_0xf9fa('0x1b'),'ignore':![]}];var _0xadb6d4=_(_0x455005)['filter']('ignore')[_0xf9fa('0x1c')]('value')['value']();if(_[_0xf9fa('0x1d')](_0xadb6d4,_0x1fd132[_0xf9fa('0x1e')])){return;}var _0x5b7a77=_['find'](_0x455005,['value',_0x1fd132['type']])['name'];return db[_0xf9fa('0x1f')][_0xf9fa('0x14')]({'where':{'type':_0x5b7a77,'resourceId':_0x1fd132['id']}})['then'](function(){return _0x34cd3c;});})['then'](function(){_0x2014ac[_0xf9fa('0xb')](0xcc)[_0xf9fa('0xc')]();});}};}function handleEntityNotFound(_0x2eb1a5){return function(_0x4a39d3){if(!_0x4a39d3){_0x2eb1a5['sendStatus'](0x194);}return _0x4a39d3;};}function handleError(_0x2de098,_0x442697){_0x442697=_0x442697||0x1f4;return function(_0x2b5b30){logger[_0xf9fa('0x20')](_0x2b5b30[_0xf9fa('0x21')]);if(_0x2b5b30[_0xf9fa('0x22')]){delete _0x2b5b30[_0xf9fa('0x22')];}_0x2de098[_0xf9fa('0xb')](_0x442697)[_0xf9fa('0x23')](_0x2b5b30);};}exports['index']=function(_0x2ac541,_0x1c0ff4){var _0x504114={},_0x3df9a1={},_0x2661a2={'count':0x0,'rows':[]};var _0x2b1036=_[_0xf9fa('0x1c')](db[_0xf9fa('0x24')]['rawAttributes'],function(_0x4b1085){return{'name':_0x4b1085[_0xf9fa('0x25')],'type':_0x4b1085['type'][_0xf9fa('0x26')]};});_0x3df9a1[_0xf9fa('0x27')]=_['map'](_0x2b1036,_0xf9fa('0x22'));_0x3df9a1[_0xf9fa('0x28')]=_[_0xf9fa('0x29')](_0x2ac541['query']);_0x3df9a1[_0xf9fa('0x2a')]=_[_0xf9fa('0x2b')](_0x3df9a1['model'],_0x3df9a1[_0xf9fa('0x28')]);_0x504114['attributes']=_[_0xf9fa('0x2b')](_0x3df9a1[_0xf9fa('0x27')],qs[_0xf9fa('0x2c')](_0x2ac541['query']['fields']));_0x504114[_0xf9fa('0x2d')]=_0x504114[_0xf9fa('0x2d')][_0xf9fa('0x2e')]?_0x504114[_0xf9fa('0x2d')]:_0x3df9a1[_0xf9fa('0x27')];if(!_0x2ac541[_0xf9fa('0x28')][_0xf9fa('0x2f')](_0xf9fa('0x30'))){_0x504114[_0xf9fa('0x10')]=qs[_0xf9fa('0x10')](_0x2ac541[_0xf9fa('0x28')][_0xf9fa('0x10')]);_0x504114['offset']=qs[_0xf9fa('0xe')](_0x2ac541[_0xf9fa('0x28')][_0xf9fa('0xe')]);}_0x504114[_0xf9fa('0x31')]=qs[_0xf9fa('0x32')](_0x2ac541[_0xf9fa('0x28')]['sort']);_0x504114[_0xf9fa('0x33')]=qs[_0xf9fa('0x2a')](_[_0xf9fa('0x34')](_0x2ac541['query'],_0x3df9a1[_0xf9fa('0x2a')]),_0x2b1036);if(_0x2ac541[_0xf9fa('0x28')][_0xf9fa('0x35')]){_0x504114['where']=_[_0xf9fa('0x36')](_0x504114['where'],{'$or':_['map'](_0x2b1036,function(_0x36f32a){if(_0x36f32a['type']!==_0xf9fa('0x37')){var _0x30feef={};_0x30feef[_0x36f32a['name']]={'$like':'%'+_0x2ac541[_0xf9fa('0x28')]['filter']+'%'};return _0x30feef;}})});}_0x504114=_[_0xf9fa('0x36')]({},_0x504114,_0x2ac541['options']);var _0x5e1eb7={'where':_0x504114[_0xf9fa('0x33')]};return db['VoiceExtension'][_0xf9fa('0x11')](_0x5e1eb7)['then'](function(_0x55d5fc){_0x2661a2['count']=_0x55d5fc;if(_0x2ac541[_0xf9fa('0x28')][_0xf9fa('0x38')]){_0x504114[_0xf9fa('0x39')]=[{'all':!![]}];}return db[_0xf9fa('0x24')][_0xf9fa('0x3a')](_0x504114);})[_0xf9fa('0x15')](function(_0x574189){_0x2661a2[_0xf9fa('0x3b')]=_0x574189;return _0x2661a2;})[_0xf9fa('0x15')](respondWithFilteredResult(_0x1c0ff4,_0x504114))[_0xf9fa('0x3c')](handleError(_0x1c0ff4,null));};exports[_0xf9fa('0x3d')]=function(_0x53db8a,_0x3cfc2b){var _0x433835={'raw':![],'where':{'id':_0x53db8a[_0xf9fa('0x3e')]['id']}},_0x63f1fc={};_0x63f1fc[_0xf9fa('0x27')]=_[_0xf9fa('0x29')](db['VoiceExtension']['rawAttributes']);_0x63f1fc[_0xf9fa('0x28')]=_[_0xf9fa('0x29')](_0x53db8a[_0xf9fa('0x28')]);_0x63f1fc[_0xf9fa('0x2a')]=_['intersection'](_0x63f1fc[_0xf9fa('0x27')],_0x63f1fc[_0xf9fa('0x28')]);_0x433835[_0xf9fa('0x2d')]=_[_0xf9fa('0x2b')](_0x63f1fc[_0xf9fa('0x27')],qs[_0xf9fa('0x2c')](_0x53db8a['query'][_0xf9fa('0x2c')]));_0x433835['attributes']=_0x433835[_0xf9fa('0x2d')][_0xf9fa('0x2e')]?_0x433835[_0xf9fa('0x2d')]:_0x63f1fc[_0xf9fa('0x27')];if(_0x53db8a['query'][_0xf9fa('0x38')]){_0x433835[_0xf9fa('0x39')]=[{'all':!![]}];}_0x433835=_[_0xf9fa('0x36')]({},_0x433835,_0x53db8a[_0xf9fa('0x3f')]);return db[_0xf9fa('0x24')][_0xf9fa('0x40')](_0x433835)['then'](handleEntityNotFound(_0x3cfc2b,null))[_0xf9fa('0x15')](respondWithResult(_0x3cfc2b,null))[_0xf9fa('0x3c')](handleError(_0x3cfc2b,null));};exports[_0xf9fa('0x14')]=function(_0xaf4bc9,_0x968bff){return db[_0xf9fa('0x24')][_0xf9fa('0x40')]({'where':{'id':_0xaf4bc9[_0xf9fa('0x3e')]['id']}})[_0xf9fa('0x15')](handleEntityNotFound(_0x968bff,null))[_0xf9fa('0x15')](removeEntity(_0x968bff,null))['catch'](handleError(_0x968bff,null));};exports[_0xf9fa('0x41')]=function(_0x244bce,_0x10bd7f){if(_0x244bce['body'][_0xf9fa('0x1e')]===_0xf9fa('0x42')&&!_['startsWith'](_0x244bce[_0xf9fa('0x43')][_0xf9fa('0x44')],'_')){_0x244bce[_0xf9fa('0x43')][_0xf9fa('0x44')]='_'[_0xf9fa('0x45')](_0x244bce[_0xf9fa('0x43')][_0xf9fa('0x44')]);}return db[_0xf9fa('0x24')]['create'](_0x244bce[_0xf9fa('0x43')],{'raw':![]})[_0xf9fa('0x15')](function(_0x513a2){var _0x23f25d=_0x244bce[_0xf9fa('0x46')]['get']({'plain':!![]});if(!_0x23f25d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23f25d['role']===_0xf9fa('0x46')){var _0x58d3a2=_0x513a2[_0xf9fa('0x16')]({'plain':!![]});var _0x259550=[{'name':'InboundRoutes','value':_0xf9fa('0x18')},{'name':_0xf9fa('0x19'),'value':_0xf9fa('0x42')},{'name':'InternalRoutes','value':_0xf9fa('0x1b')}];var _0x5b6120=_[_0xf9fa('0x40')](_0x259550,[_0xf9fa('0x47'),_0x58d3a2['type']])['name'];return db[_0xf9fa('0x48')][_0xf9fa('0x40')]({'where':{'name':_0x5b6120,'userProfileId':_0x23f25d[_0xf9fa('0x49')]},'raw':!![]})[_0xf9fa('0x15')](function(_0x5af1e7){if(_0x5af1e7&&_0x5af1e7[_0xf9fa('0x4a')]===0x0){return db[_0xf9fa('0x1f')][_0xf9fa('0x41')]({'name':_0x58d3a2[_0xf9fa('0x22')],'resourceId':_0x58d3a2['id'],'type':_0x5af1e7['name'],'sectionId':_0x5af1e7['id']},{})[_0xf9fa('0x15')](function(){return _0x513a2;});}else{return _0x513a2;}})[_0xf9fa('0x3c')](function(_0x1dbed7){logger[_0xf9fa('0x20')](_0xf9fa('0x4b'),_0x1dbed7);throw _0x1dbed7;});}return _0x513a2;})[_0xf9fa('0x15')](respondWithResult(_0x10bd7f,0xc9))[_0xf9fa('0x3c')](handleError(_0x10bd7f,null));};exports[_0xf9fa('0x4c')]=function(_0x5ef0b8,_0x1e3619){if(_0x5ef0b8[_0xf9fa('0x43')]['id']){delete _0x5ef0b8[_0xf9fa('0x43')]['id'];}return db[_0xf9fa('0x24')][_0xf9fa('0x40')]({'where':{'id':_0x5ef0b8[_0xf9fa('0x3e')]['id']}})[_0xf9fa('0x15')](handleEntityNotFound(_0x1e3619,null))[_0xf9fa('0x15')](function(_0x566e56){if(_0x566e56){return db['VoiceExtension']['update'](_['pick'](_0x5ef0b8[_0xf9fa('0x43')],['exten',_0xf9fa('0x4d'),_0xf9fa('0x4e'),_0xf9fa('0x4f'),_0xf9fa('0x50'),_0xf9fa('0x51'),_0xf9fa('0x52')]),{'where':{'context':_0x566e56[_0xf9fa('0x4d')],'exten':_0x566e56[_0xf9fa('0x44')]},'individualHooks':!![]})[_0xf9fa('0x15')](function(_0x41d6a5){return _0x41d6a5;});}return null;})['then'](respondWithStatusCode(_0x1e3619,null))[_0xf9fa('0x3c')](handleError(_0x1e3619,null));};exports[_0xf9fa('0x53')]=function(_0x2f22db,_0x5e74f2){var _0x3e9045=_0x2f22db[_0xf9fa('0x3e')]['id'];var _0x587be4=_0x2f22db[_0xf9fa('0x43')];var _0x39b215=0xc8;var _0x39d51d=null;return db[_0xf9fa('0x54')][_0xf9fa('0x55')]({'isolationLevel':db[_0xf9fa('0x54')]['Transaction'][_0xf9fa('0x56')][_0xf9fa('0x57')]},function(_0x99f98){return db[_0xf9fa('0x24')]['findOne']({'where':{'id':_0x3e9045},'transaction':_0x99f98})[_0xf9fa('0x15')](function(_0xebaa84){if(_0xebaa84){return db['VoiceExtension'][_0xf9fa('0x14')]({'where':{'VoiceExtensionId':_0x3e9045},'transaction':_0x99f98})[_0xf9fa('0x15')](function(){var _0x5e9792=_[_0xf9fa('0x1c')](_0x587be4,function(_0x26b938){_0x26b938['VoiceExtensionId']=_0x3e9045;_0x26b938['isApp']=!![];return _0x26b938;});return _0xebaa84[_0xf9fa('0x58')](_0x5e9792);})['then'](function(_0x53f3bb){return db[_0xf9fa('0x24')][_0xf9fa('0x59')](_0x53f3bb,{'transaction':_0x99f98});});}else{_0x39b215=0x194;_0x39d51d=[];}});})[_0xf9fa('0x15')](function(){if(_0x39b215!==0x194){return db[_0xf9fa('0x24')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x3e9045},'order':_0xf9fa('0x5a')})[_0xf9fa('0x15')](function(_0x1471e7){_0x39d51d=_0x1471e7;});}})['catch'](function(_0x392d4b){_0x39b215=0x1f4;logger[_0xf9fa('0x20')](_0x392d4b[_0xf9fa('0x21')]);if(_0x392d4b[_0xf9fa('0x22')]){delete _0x392d4b[_0xf9fa('0x22')];}_0x39d51d=_0x392d4b;})[_0xf9fa('0x5b')](function(){if(_0x39d51d===null){_0x5e74f2['sendStatus'](_0x39b215);}else{if(_0x39b215===0x1f4){_0x5e74f2['status'](_0x39b215)[_0xf9fa('0x23')](_0x39d51d);}else{_0x5e74f2[_0xf9fa('0xb')](_0x39b215)[_0xf9fa('0xd')](_0x39d51d);}}});}; \ No newline at end of file +var _0x7fca=['recordingFormat','mandatoryDisposition','alias','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findOne','VoiceExtensionId','isApp','bulkCreate','stack','finally','send','lodash','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','destroy','then','get','inbound','InternalRoutes','filter','ignore','includes','type','find','value','name','UserProfileResource','index','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','where','merge','VIRTUAL','includeAll','VoiceExtension','findAll','rows','catch','show','params','include','create','body','outbound','startsWith','exten','concat','user','role','internal','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','description'];(function(_0x3c5924,_0x4d295f){var _0x576958=function(_0x4a3e2d){while(--_0x4a3e2d){_0x3c5924['push'](_0x3c5924['shift']());}};_0x576958(++_0x4d295f);}(_0x7fca,0x120));var _0xa7fc=function(_0x311d75,_0x312cc2){_0x311d75=_0x311d75-0x0;var _0xf5cc3c=_0x7fca[_0x311d75];return _0xf5cc3c;};'use strict';var _=require(_0xa7fc('0x0'));var Redis=require('ioredis');var qs=require(_0xa7fc('0x1'));var logger=require(_0xa7fc('0x2'))(_0xa7fc('0x3'));var config=require(_0xa7fc('0x4'));var db=require('../../mysqldb')['db'];config[_0xa7fc('0x5')]=_['defaults'](config[_0xa7fc('0x5')],{'host':_0xa7fc('0x6'),'port':0x18eb});var socket=require(_0xa7fc('0x7'))(new Redis(config['redis']));require(_0xa7fc('0x8'))['register'](socket);function respondWithStatusCode(_0x187d98,_0x3907dc){_0x3907dc=_0x3907dc||0xcc;return function(_0x3906c7){if(_0x3906c7){return _0x187d98[_0xa7fc('0x9')](_0x3907dc);}return _0x187d98['status'](_0x3907dc)[_0xa7fc('0xa')]();};}function respondWithResult(_0x36a3d7,_0x2835af){_0x2835af=_0x2835af||0xc8;return function(_0x1042f3){if(_0x1042f3){return _0x36a3d7[_0xa7fc('0xb')](_0x2835af)[_0xa7fc('0xc')](_0x1042f3);}};}function respondWithFilteredResult(_0x2afe96,_0x201cec){return function(_0x214157){if(_0x214157){var _0x560b8f=typeof _0x201cec['offset']===_0xa7fc('0xd')&&typeof _0x201cec[_0xa7fc('0xe')]===_0xa7fc('0xd');var _0x3304ff=_0x214157['count'];var _0x53f51d=_0x560b8f?0x0:_0x201cec[_0xa7fc('0xf')];var _0x2f21d8=_0x560b8f?_0x214157[_0xa7fc('0x10')]:_0x201cec[_0xa7fc('0xf')]+_0x201cec[_0xa7fc('0xe')];var _0x134035;if(_0x2f21d8>=_0x3304ff){_0x2f21d8=_0x3304ff;_0x134035=0xc8;}else{_0x134035=0xce;}_0x2afe96[_0xa7fc('0xb')](_0x134035);return _0x2afe96[_0xa7fc('0x11')](_0xa7fc('0x12'),_0x53f51d+'-'+_0x2f21d8+'/'+_0x3304ff)[_0xa7fc('0xc')](_0x214157);}return null;};}function removeEntity(_0x36d3e0){return function(_0x517092){if(_0x517092){return _0x517092[_0xa7fc('0x13')]()[_0xa7fc('0x14')](function(){var _0x486be4=_0x517092[_0xa7fc('0x15')]({'plain':!![]});var _0x1aed0e=[{'name':'InboundRoutes','value':_0xa7fc('0x16'),'ignore':![]},{'name':'OutboundRoutes','value':'outbound','ignore':![]},{'name':_0xa7fc('0x17'),'value':'internal','ignore':![]}];var _0x5ac7d6=_(_0x1aed0e)[_0xa7fc('0x18')](_0xa7fc('0x19'))['map']('value')['value']();if(_[_0xa7fc('0x1a')](_0x5ac7d6,_0x486be4[_0xa7fc('0x1b')])){return;}var _0x30bcc9=_[_0xa7fc('0x1c')](_0x1aed0e,[_0xa7fc('0x1d'),_0x486be4[_0xa7fc('0x1b')]])[_0xa7fc('0x1e')];return db[_0xa7fc('0x1f')]['destroy']({'where':{'type':_0x30bcc9,'resourceId':_0x486be4['id']}})[_0xa7fc('0x14')](function(){return _0x517092;});})['then'](function(){_0x36d3e0['status'](0xcc)[_0xa7fc('0xa')]();});}};}function handleEntityNotFound(_0x2b6efc){return function(_0x49e28f){if(!_0x49e28f){_0x2b6efc[_0xa7fc('0x9')](0x194);}return _0x49e28f;};}function handleError(_0x1eab98,_0x3d57c9){_0x3d57c9=_0x3d57c9||0x1f4;return function(_0x446e5c){logger['error'](_0x446e5c['stack']);if(_0x446e5c['name']){delete _0x446e5c[_0xa7fc('0x1e')];}_0x1eab98[_0xa7fc('0xb')](_0x3d57c9)['send'](_0x446e5c);};}exports[_0xa7fc('0x20')]=function(_0x5b6066,_0x6f5d27){var _0x38e03e={},_0x46f211={},_0x7eb849={'count':0x0,'rows':[]};var _0x52c179=_['map'](db['VoiceExtension'][_0xa7fc('0x21')],function(_0xef24c5){return{'name':_0xef24c5[_0xa7fc('0x22')],'type':_0xef24c5[_0xa7fc('0x1b')][_0xa7fc('0x23')]};});_0x46f211[_0xa7fc('0x24')]=_[_0xa7fc('0x25')](_0x52c179,_0xa7fc('0x1e'));_0x46f211[_0xa7fc('0x26')]=_[_0xa7fc('0x27')](_0x5b6066['query']);_0x46f211['filters']=_[_0xa7fc('0x28')](_0x46f211[_0xa7fc('0x24')],_0x46f211['query']);_0x38e03e[_0xa7fc('0x29')]=_[_0xa7fc('0x28')](_0x46f211[_0xa7fc('0x24')],qs['fields'](_0x5b6066[_0xa7fc('0x26')][_0xa7fc('0x2a')]));_0x38e03e[_0xa7fc('0x29')]=_0x38e03e[_0xa7fc('0x29')][_0xa7fc('0x2b')]?_0x38e03e['attributes']:_0x46f211[_0xa7fc('0x24')];if(!_0x5b6066[_0xa7fc('0x26')][_0xa7fc('0x2c')]('nolimit')){_0x38e03e['limit']=qs[_0xa7fc('0xe')](_0x5b6066[_0xa7fc('0x26')][_0xa7fc('0xe')]);_0x38e03e['offset']=qs[_0xa7fc('0xf')](_0x5b6066['query'][_0xa7fc('0xf')]);}_0x38e03e[_0xa7fc('0x2d')]=qs['sort'](_0x5b6066[_0xa7fc('0x26')][_0xa7fc('0x2e')]);_0x38e03e['where']=qs[_0xa7fc('0x2f')](_['pick'](_0x5b6066[_0xa7fc('0x26')],_0x46f211['filters']),_0x52c179);if(_0x5b6066['query'][_0xa7fc('0x18')]){_0x38e03e[_0xa7fc('0x30')]=_[_0xa7fc('0x31')](_0x38e03e[_0xa7fc('0x30')],{'$or':_[_0xa7fc('0x25')](_0x52c179,function(_0x5f2cc5){if(_0x5f2cc5[_0xa7fc('0x1b')]!==_0xa7fc('0x32')){var _0x1ffa56={};_0x1ffa56[_0x5f2cc5[_0xa7fc('0x1e')]]={'$like':'%'+_0x5b6066[_0xa7fc('0x26')][_0xa7fc('0x18')]+'%'};return _0x1ffa56;}})});}_0x38e03e=_[_0xa7fc('0x31')]({},_0x38e03e,_0x5b6066['options']);var _0x46d154={'where':_0x38e03e['where']};return db['VoiceExtension']['count'](_0x46d154)['then'](function(_0x4126e3){_0x7eb849[_0xa7fc('0x10')]=_0x4126e3;if(_0x5b6066[_0xa7fc('0x26')][_0xa7fc('0x33')]){_0x38e03e['include']=[{'all':!![]}];}return db[_0xa7fc('0x34')][_0xa7fc('0x35')](_0x38e03e);})[_0xa7fc('0x14')](function(_0x53d8cb){_0x7eb849[_0xa7fc('0x36')]=_0x53d8cb;return _0x7eb849;})[_0xa7fc('0x14')](respondWithFilteredResult(_0x6f5d27,_0x38e03e))[_0xa7fc('0x37')](handleError(_0x6f5d27,null));};exports[_0xa7fc('0x38')]=function(_0x649d67,_0x18579f){var _0x970e41={'raw':![],'where':{'id':_0x649d67[_0xa7fc('0x39')]['id']}},_0x71bae4={};_0x71bae4[_0xa7fc('0x24')]=_[_0xa7fc('0x27')](db[_0xa7fc('0x34')][_0xa7fc('0x21')]);_0x71bae4[_0xa7fc('0x26')]=_['keys'](_0x649d67[_0xa7fc('0x26')]);_0x71bae4[_0xa7fc('0x2f')]=_[_0xa7fc('0x28')](_0x71bae4[_0xa7fc('0x24')],_0x71bae4['query']);_0x970e41[_0xa7fc('0x29')]=_[_0xa7fc('0x28')](_0x71bae4[_0xa7fc('0x24')],qs[_0xa7fc('0x2a')](_0x649d67['query'][_0xa7fc('0x2a')]));_0x970e41[_0xa7fc('0x29')]=_0x970e41[_0xa7fc('0x29')][_0xa7fc('0x2b')]?_0x970e41[_0xa7fc('0x29')]:_0x71bae4[_0xa7fc('0x24')];if(_0x649d67[_0xa7fc('0x26')]['includeAll']){_0x970e41[_0xa7fc('0x3a')]=[{'all':!![]}];}_0x970e41=_[_0xa7fc('0x31')]({},_0x970e41,_0x649d67['options']);return db[_0xa7fc('0x34')][_0xa7fc('0x1c')](_0x970e41)[_0xa7fc('0x14')](handleEntityNotFound(_0x18579f,null))[_0xa7fc('0x14')](respondWithResult(_0x18579f,null))[_0xa7fc('0x37')](handleError(_0x18579f,null));};exports[_0xa7fc('0x13')]=function(_0x27e358,_0x37284c){return db[_0xa7fc('0x34')]['find']({'where':{'id':_0x27e358[_0xa7fc('0x39')]['id']}})['then'](handleEntityNotFound(_0x37284c,null))[_0xa7fc('0x14')](removeEntity(_0x37284c,null))[_0xa7fc('0x37')](handleError(_0x37284c,null));};exports[_0xa7fc('0x3b')]=function(_0xdff9f1,_0x20bc30){if(_0xdff9f1[_0xa7fc('0x3c')]['type']===_0xa7fc('0x3d')&&!_[_0xa7fc('0x3e')](_0xdff9f1[_0xa7fc('0x3c')]['exten'],'_')){_0xdff9f1[_0xa7fc('0x3c')][_0xa7fc('0x3f')]='_'[_0xa7fc('0x40')](_0xdff9f1['body']['exten']);}return db[_0xa7fc('0x34')]['create'](_0xdff9f1[_0xa7fc('0x3c')],{'raw':![]})['then'](function(_0x464acd){var _0x1199e6=_0xdff9f1[_0xa7fc('0x41')][_0xa7fc('0x15')]({'plain':!![]});if(!_0x1199e6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1199e6[_0xa7fc('0x42')]===_0xa7fc('0x41')){var _0x22accb=_0x464acd['get']({'plain':!![]});var _0x51b444=[{'name':'InboundRoutes','value':_0xa7fc('0x16')},{'name':'OutboundRoutes','value':_0xa7fc('0x3d')},{'name':_0xa7fc('0x17'),'value':_0xa7fc('0x43')}];var _0x8f1bc9=_[_0xa7fc('0x1c')](_0x51b444,['value',_0x22accb[_0xa7fc('0x1b')]])[_0xa7fc('0x1e')];return db['UserProfileSection']['find']({'where':{'name':_0x8f1bc9,'userProfileId':_0x1199e6[_0xa7fc('0x44')]},'raw':!![]})[_0xa7fc('0x14')](function(_0x5db95f){if(_0x5db95f&&_0x5db95f[_0xa7fc('0x45')]===0x0){return db[_0xa7fc('0x1f')]['create']({'name':_0x22accb[_0xa7fc('0x1e')],'resourceId':_0x22accb['id'],'type':_0x5db95f['name'],'sectionId':_0x5db95f['id']},{})[_0xa7fc('0x14')](function(){return _0x464acd;});}else{return _0x464acd;}})[_0xa7fc('0x37')](function(_0x1d3622){logger[_0xa7fc('0x46')](_0xa7fc('0x47'),_0x1d3622);throw _0x1d3622;});}return _0x464acd;})[_0xa7fc('0x14')](respondWithResult(_0x20bc30,0xc9))['catch'](handleError(_0x20bc30,null));};exports[_0xa7fc('0x48')]=function(_0x50e3ab,_0x1de372){if(_0x50e3ab[_0xa7fc('0x3c')]['id']){delete _0x50e3ab[_0xa7fc('0x3c')]['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x50e3ab[_0xa7fc('0x39')]['id']}})[_0xa7fc('0x14')](handleEntityNotFound(_0x1de372,null))[_0xa7fc('0x14')](function(_0x34a378){if(_0x34a378){return db['VoiceExtension'][_0xa7fc('0x48')](_[_0xa7fc('0x49')](_0x50e3ab['body'],[_0xa7fc('0x3f'),_0xa7fc('0x4a'),_0xa7fc('0x4b'),_0xa7fc('0x4c'),'cutdigits',_0xa7fc('0x4d'),_0xa7fc('0x4e')]),{'where':{'context':_0x34a378[_0xa7fc('0x4a')],'exten':_0x34a378[_0xa7fc('0x3f')]},'individualHooks':!![]})[_0xa7fc('0x14')](function(_0x552da4){return _0x552da4;});}return null;})['then'](respondWithStatusCode(_0x1de372,null))[_0xa7fc('0x37')](handleError(_0x1de372,null));};exports[_0xa7fc('0x4f')]=function(_0x352bd0,_0x2991f8){var _0x23faf9=_0x352bd0[_0xa7fc('0x39')]['id'];var _0x1f22fb=_0x352bd0[_0xa7fc('0x3c')];var _0x194d55=0xc8;var _0x5d0352=null;return db[_0xa7fc('0x50')]['transaction']({'isolationLevel':db['sequelize'][_0xa7fc('0x51')][_0xa7fc('0x52')][_0xa7fc('0x53')]},function(_0x12a437){return db['VoiceExtension'][_0xa7fc('0x54')]({'where':{'id':_0x23faf9},'transaction':_0x12a437})[_0xa7fc('0x14')](function(_0x538d08){if(_0x538d08){return db[_0xa7fc('0x34')][_0xa7fc('0x13')]({'where':{'VoiceExtensionId':_0x23faf9},'transaction':_0x12a437})[_0xa7fc('0x14')](function(){var _0x744d6b=_[_0xa7fc('0x25')](_0x1f22fb,function(_0x46938e){_0x46938e[_0xa7fc('0x55')]=_0x23faf9;_0x46938e[_0xa7fc('0x56')]=!![];return _0x46938e;});return _0x538d08['createRouting'](_0x744d6b);})['then'](function(_0x31249e){return db[_0xa7fc('0x34')][_0xa7fc('0x57')](_0x31249e,{'transaction':_0x12a437});});}else{_0x194d55=0x194;_0x5d0352=[];}});})['then'](function(){if(_0x194d55!==0x194){return db[_0xa7fc('0x34')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x23faf9},'order':'cast(priority\x20as\x20unsigned)'})[_0xa7fc('0x14')](function(_0x4366f6){_0x5d0352=_0x4366f6;});}})[_0xa7fc('0x37')](function(_0x1d179a){_0x194d55=0x1f4;logger[_0xa7fc('0x46')](_0x1d179a[_0xa7fc('0x58')]);if(_0x1d179a[_0xa7fc('0x1e')]){delete _0x1d179a['name'];}_0x5d0352=_0x1d179a;})[_0xa7fc('0x59')](function(){if(_0x5d0352===null){_0x2991f8[_0xa7fc('0x9')](_0x194d55);}else{if(_0x194d55===0x1f4){_0x2991f8[_0xa7fc('0xb')](_0x194d55)[_0xa7fc('0x5a')](_0x5d0352);}else{_0x2991f8[_0xa7fc('0xb')](_0x194d55)['json'](_0x5d0352);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index f256ff6..66fd959 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 _0x0c49=['events','../../mysqldb','setMaxListeners','save','update','emit','hook','exports'];(function(_0x439e8b,_0x456333){var _0x1389ef=function(_0x186832){while(--_0x186832){_0x439e8b['push'](_0x439e8b['shift']());}};_0x1389ef(++_0x456333);}(_0x0c49,0x198));var _0x90c4=function(_0x3adc1c,_0x277bc8){_0x3adc1c=_0x3adc1c-0x0;var _0xa592bc=_0x0c49[_0x3adc1c];return _0xa592bc;};'use strict';var EventEmitter=require(_0x90c4('0x0'));var VoiceExtension=require(_0x90c4('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x90c4('0x2')](0x0);var events={'afterCreate':_0x90c4('0x3'),'afterUpdate':_0x90c4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x33159b){return function(_0x59b197,_0x13b37d,_0x154242){VoiceExtensionEvents[_0x90c4('0x5')](_0x33159b+':'+_0x59b197['id'],_0x59b197);VoiceExtensionEvents['emit'](_0x33159b,_0x59b197);_0x154242(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x90c4('0x6')](e,emitEvent(event));}}module[_0x90c4('0x7')]=VoiceExtensionEvents; \ No newline at end of file +var _0xd696=['remove','hasOwnProperty','hook','exports','events','VoiceExtension','setMaxListeners','update'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0xd696,0x1bc));var _0x6d69=function(_0x4583d0,_0x24551f){_0x4583d0=_0x4583d0-0x0;var _0x7b3c5a=_0xd696[_0x4583d0];return _0x7b3c5a;};'use strict';var EventEmitter=require(_0x6d69('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x6d69('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x6d69('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6d69('0x3'),'afterDestroy':_0x6d69('0x4')};function emitEvent(_0xa20570){return function(_0x39a16d,_0x23fb30,_0x386d95){VoiceExtensionEvents['emit'](_0xa20570+':'+_0x39a16d['id'],_0x39a16d);VoiceExtensionEvents['emit'](_0xa20570,_0x39a16d);_0x386d95(null);};}for(var e in events){if(events[_0x6d69('0x5')](e)){var event=events[e];VoiceExtension[_0x6d69('0x6')](e,emitEvent(event));}}module[_0x6d69('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 cfebc58..0273ab2 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 _0xbeea=['$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','outboundDial','appdata','last','priority','concat','catch','VoiceExtension','voice_extensions','get','then','Hangup','lodash','exports','type','Set','CDR(type)=','exten','alias','CDR(routeAlias)=','No\x20alias\x20set','context','inbound','push','CDR(routeid)=','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','XCALLY-MOTION-ANSWER=0','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','trunk','timeout','options','url','split','param','prefix','phone','${EXTEN:','${EXTEN}','SIP','none','indexOf','U(xcally-mixmonitor-context)','replace','join','isEmpty','Interval','findAll','interval','IntervalId','intervals','map','filter','toLowerCase','hasOwnProperty','tag','length','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1'];(function(_0x36504d,_0x2918e7){var _0x1200a6=function(_0x326c8c){while(--_0x326c8c){_0x36504d['push'](_0x36504d['shift']());}};_0x1200a6(++_0x2918e7);}(_0xbeea,0xb1));var _0xabee=function(_0x46226f,_0x1abd11){_0x46226f=_0x46226f-0x0;var _0x15fc73=_0xbeea[_0x46226f];return _0x15fc73;};'use strict';var _=require(_0xabee('0x0'));var attributes=require('./voiceExtension.attributes');module[_0xabee('0x1')]=function(_0x3b377b){var _0x35ca8b=_0x3b377b['models'];function _0x972e88(_0x59e264){var _0x58afa7=0x2;var _0x33571e=[{'type':_0x59e264[_0xabee('0x2')],'app':_0xabee('0x3'),'appdata':_0xabee('0x4')+_0x59e264['type'],'context':_0x59e264['context'],'exten':_0x59e264[_0xabee('0x5')],'priority':_0x58afa7++,'VoiceExtensionId':_0x59e264['id']},{'type':_0x59e264[_0xabee('0x2')],'app':_0x59e264['alias']?_0xabee('0x3'):'NoOp','appdata':_0x59e264[_0xabee('0x6')]?_0xabee('0x7')+_0x59e264[_0xabee('0x6')]:_0xabee('0x8'),'context':_0x59e264[_0xabee('0x9')],'exten':_0x59e264[_0xabee('0x5')],'priority':_0x58afa7++,'VoiceExtensionId':_0x59e264['id']}];if(_0x59e264['type']===_0xabee('0xa')){_0x33571e[_0xabee('0xb')]({'type':_0xabee('0xa'),'app':'Set','appdata':_0xabee('0xc')+_0x59e264['id'],'context':_0x59e264[_0xabee('0x9')],'exten':_0x59e264[_0xabee('0x5')],'priority':_0x58afa7++,'VoiceExtensionId':_0x59e264['id']});}_0x33571e['push']({'type':_0x59e264['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=0','context':_0x59e264['context'],'exten':_0x59e264[_0xabee('0x5')],'priority':_0x58afa7++,'VoiceExtensionId':_0x59e264['id']},{'type':_0x59e264[_0xabee('0x2')],'app':_0xabee('0x3'),'appdata':_0xabee('0xd'),'context':_0x59e264[_0xabee('0x9')],'exten':_0x59e264['exten'],'priority':_0x58afa7++,'VoiceExtensionId':_0x59e264['id']},{'type':_0x59e264[_0xabee('0x2')],'app':_0xabee('0x3'),'appdata':_0xabee('0xe'),'context':_0x59e264[_0xabee('0x9')],'exten':_0x59e264[_0xabee('0x5')],'priority':_0x58afa7++,'VoiceExtensionId':_0x59e264['id']});return _0x33571e;}function _0x2d6e69(_0x440413){var _0x5a9562=0x2;var _0x33e3c0=[{'type':_0xabee('0xf'),'app':_0xabee('0x3'),'appdata':_0xabee('0x10'),'context':_0x440413[_0xabee('0x9')],'exten':_0x440413[_0xabee('0x5')],'priority':_0x5a9562++,'VoiceExtensionId':_0x440413['id']},{'type':'outbound','app':_0x440413['alias']?_0xabee('0x3'):'NoOp','appdata':_0x440413['alias']?_0xabee('0x7')+_0x440413[_0xabee('0x6')]:_0xabee('0x8'),'context':_0x440413[_0xabee('0x9')],'exten':_0x440413[_0xabee('0x5')],'priority':_0x5a9562++,'VoiceExtensionId':_0x440413['id']},{'type':'outbound','app':_0xabee('0x3'),'appdata':'CDR(destination)='+(_0x440413['cutdigits']?'${EXTEN:'+_0x440413[_0xabee('0x11')]+'}':'${EXTEN}'),'context':_0x440413[_0xabee('0x9')],'exten':_0x440413[_0xabee('0x5')],'priority':_0x5a9562++,'VoiceExtensionId':_0x440413['id']},{'type':_0xabee('0xf'),'app':_0xabee('0x3'),'appdata':_0xabee('0xc')+_0x440413['id'],'context':_0x440413[_0xabee('0x9')],'exten':_0x440413[_0xabee('0x5')],'priority':_0x5a9562++,'VoiceExtensionId':_0x440413['id']},{'type':'outbound','app':_0xabee('0x12'),'appdata':_0xabee('0x13')+(_0x5a9562+0x2)+_0xabee('0x14')+(_0x5a9562+0x1)+')','context':_0x440413[_0xabee('0x9')],'exten':_0x440413['exten'],'priority':_0x5a9562++,'VoiceExtensionId':_0x440413['id']},{'type':_0xabee('0xf'),'app':_0xabee('0x3'),'appdata':_0x440413['cutdigits']?_0xabee('0x15')+_0x440413[_0xabee('0x11')]+'}':_0xabee('0x16'),'context':_0x440413[_0xabee('0x9')],'exten':_0x440413['exten'],'priority':_0x5a9562++,'VoiceExtensionId':_0x440413['id']},{'type':_0xabee('0xf'),'app':_0xabee('0x3'),'appdata':_0xabee('0x17'),'context':_0x440413[_0xabee('0x9')],'exten':_0x440413[_0xabee('0x5')],'priority':_0x5a9562++,'VoiceExtensionId':_0x440413['id']},{'type':_0xabee('0xf'),'app':_0xabee('0x3'),'appdata':_0xabee('0xd'),'context':_0x440413[_0xabee('0x9')],'exten':_0x440413['exten'],'priority':_0x5a9562++,'VoiceExtensionId':_0x440413['id']},{'type':_0xabee('0xf'),'app':'Set','appdata':_0xabee('0xe'),'context':_0x440413[_0xabee('0x9')],'exten':_0x440413[_0xabee('0x5')],'priority':_0x5a9562++,'VoiceExtensionId':_0x440413['id']},{'type':_0xabee('0xf'),'app':'Set','appdata':_0xabee('0x18')+_0x440413['id'],'context':_0x440413['context'],'exten':_0x440413[_0xabee('0x5')],'priority':_0x5a9562++,'VoiceExtensionId':_0x440413['id']}];if(_0x440413['hasOwnProperty'](_0xabee('0x19'))&&_0x440413['recordingFormat']!=='none'){_0x33e3c0[_0xabee('0xb')]({'type':_0xabee('0xf'),'app':_0xabee('0x3'),'appdata':_0xabee('0x1a'),'context':_0x440413[_0xabee('0x9')],'exten':_0x440413[_0xabee('0x5')],'priority':_0x5a9562++,'VoiceExtensionId':_0x440413['id']},{'type':_0xabee('0xf'),'app':_0xabee('0x3'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x440413[_0xabee('0x19')]||_0xabee('0x1b'),'context':_0x440413[_0xabee('0x9')],'exten':_0x440413[_0xabee('0x5')],'priority':_0x5a9562++,'VoiceExtensionId':_0x440413['id']});}return _0x33e3c0;}function _0x146ae9(_0x77c942,_0x9703eb){var _0x2d0953=[{'name':_0xabee('0x1c'),'param':0x0},{'name':_0xabee('0x1d'),'param':0x1},{'name':_0xabee('0x1e'),'param':0x2},{'name':_0xabee('0x1f'),'param':0x3}];var _0xb1ef34={};var _0x2ca217=_0x9703eb[_0xabee('0x20')](',');var _0x2e2769=[];for(var _0x3db173=0x0;_0x3db173<_0x2d0953['length'];_0x3db173++){switch(_0x2d0953[_0x3db173]['name']){case _0xabee('0x1c'):_0xb1ef34[_0xabee('0x1c')]=_0x2ca217[_0x2d0953[_0x3db173][_0xabee('0x21')]][_0xabee('0x20')]('/')[0x1];_0xb1ef34['phone']=_0x2ca217[_0x2d0953[_0x3db173][_0xabee('0x21')]][_0xabee('0x20')]('/')[0x2];_0xb1ef34[_0xabee('0x22')]=_0xb1ef34['phone']?_0xb1ef34[_0xabee('0x23')]['split']('$')[0x0]:undefined;_0xb1ef34[_0xabee('0x23')]=_0x77c942[_0xabee('0x11')]?(_0xb1ef34[_0xabee('0x22')]||'')+_0xabee('0x24')+_0x77c942['cutdigits']+'}':(_0xb1ef34['prefix']||'')+_0xabee('0x25');_0x2e2769[_0x2d0953[_0x3db173][_0xabee('0x21')]]=[_0xabee('0x26'),_0xb1ef34[_0xabee('0x1c')],_0xb1ef34[_0xabee('0x23')]]['join']('/');break;case _0xabee('0x1e'):_0xb1ef34[_0xabee('0x1e')]=_0x2ca217[_0x2d0953[_0x3db173]['param']];if(_0x77c942[_0xabee('0x19')]!==_0xabee('0x27')){if(_0xb1ef34['options'][_0xabee('0x28')](_0xabee('0x29'))<0x0){_0xb1ef34[_0xabee('0x1e')]+=_0xabee('0x29');}}else{_0xb1ef34[_0xabee('0x1e')]=_0xb1ef34[_0xabee('0x1e')][_0xabee('0x2a')]('U(xcally-mixmonitor-context)','');}_0x2e2769[_0x2d0953[_0x3db173][_0xabee('0x21')]]=_0xb1ef34[_0xabee('0x1e')];break;default:_0x2e2769[_0x2d0953[_0x3db173][_0xabee('0x21')]]=_0x2ca217[_0x2d0953[_0x3db173]['param']];}}return _0x2e2769[_0xabee('0x2b')](',');}function _0x2701b7(_0x5a918e,_0x29ffe9,_0x1475f3){return new Promise(function(_0x50b996,_0x1ce8ae){var _0x2e3675=[];if(_[_0xabee('0x2c')](_0x29ffe9))return _0x50b996(_0x2e3675);_0x35ca8b[_0xabee('0x2d')][_0xabee('0x2e')]({'attributes':['id',_0xabee('0x2f'),_0xabee('0x30')],'raw':!![]})['then'](function(_0x2aa2f0){for(var _0x23735d=0x0,_0x441af1=0x0;_0x23735d<_0x29ffe9['length'];_0x23735d++,_0x441af1=0x0){var _0x444a92=_0x29ffe9[_0x23735d];var _0x2e83e0=[];var _0x5ae15a=[];delete _0x444a92['id'];if(_0x444a92['interval']!=='*,*,*,*'){_0x444a92[_0xabee('0x31')]=[_0x444a92[_0xabee('0x2f')]];}else{_0x444a92['intervals']=_0x444a92['IntervalId']?_[_0xabee('0x32')](_[_0xabee('0x33')](_0x2aa2f0,{'IntervalId':_0x444a92[_0xabee('0x30')]}),_0xabee('0x2f')):[];}_0x444a92[_0xabee('0x9')]=_0x5a918e[_0xabee('0x9')];_0x444a92[_0xabee('0x5')]=_0x5a918e[_0xabee('0x5')];if(_0x444a92[_0xabee('0x2')])_0x444a92[_0xabee('0x2')]=_0x444a92[_0xabee('0x2')][_0xabee('0x34')]();if(_0x5a918e[_0xabee('0x2')]===_0xabee('0xf')){if(_0x444a92[_0xabee('0x35')](_0xabee('0x36'))&&_0x444a92[_0xabee('0x36')]&&_0x444a92[_0xabee('0x36')]!=='--'){_0x2e83e0['push']({'type':_0x444a92[_0xabee('0x2')][_0xabee('0x34')](),'app':'Set','appdata':'CDR(tag)='+_0x444a92[_0xabee('0x36')],'context':_0x5a918e[_0xabee('0x9')],'exten':_0x5a918e[_0xabee('0x5')],'priority':_0x444a92[_0xabee('0x31')][_0xabee('0x37')]+_0x1475f3+_0x441af1++,'VoiceExtensionId':_0x5a918e['id']});}_0x2e83e0[_0xabee('0xb')]({'type':_0x444a92[_0xabee('0x2')]['toLowerCase'](),'app':_0xabee('0x12'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):'+(_0x444a92[_0xabee('0x38')]?_0xabee('0x39')+_0x444a92['callerID']+')':_0xabee('0x3a')),'context':_0x5a918e[_0xabee('0x9')],'exten':_0x5a918e[_0xabee('0x5')],'priority':_0x444a92['intervals'][_0xabee('0x37')]+_0x1475f3+_0x441af1++,'VoiceExtensionId':_0x5a918e['id']});}else{if(_0x444a92['hasOwnProperty'](_0xabee('0x3b'))){if([_0xabee('0x3c'),_0xabee('0x3d')]['includes'](_0x444a92[_0xabee('0x3e')][_0xabee('0x34')]())&&_0x444a92[_0xabee('0x3f')]!=='custom'){if(_0x444a92[_0xabee('0x3b')]){_0x2e83e0[_0xabee('0xb')]({'type':_0x444a92[_0xabee('0x2')][_0xabee('0x34')](),'app':'ExecIf','appdata':_0xabee('0x40'),'context':_0x5a918e[_0xabee('0x9')],'exten':_0x5a918e[_0xabee('0x5')],'priority':_0x444a92['intervals'][_0xabee('0x37')]+_0x1475f3+_0x441af1++,'VoiceExtensionId':_0x5a918e['id']});_0x2e83e0[_0xabee('0xb')]({'type':_0x444a92[_0xabee('0x2')][_0xabee('0x34')](),'app':_0xabee('0x3'),'appdata':_0xabee('0x41'),'context':_0x5a918e[_0xabee('0x9')],'exten':_0x5a918e[_0xabee('0x5')],'priority':_0x444a92[_0xabee('0x31')]['length']+_0x1475f3+_0x441af1++,'VoiceExtensionId':_0x5a918e['id']});}else{_0x2e83e0['push']({'type':_0x444a92[_0xabee('0x2')][_0xabee('0x34')](),'app':_0xabee('0x12'),'appdata':_0xabee('0x42'),'context':_0x5a918e[_0xabee('0x9')],'exten':_0x5a918e[_0xabee('0x5')],'priority':_0x444a92['intervals'][_0xabee('0x37')]+_0x1475f3+_0x441af1++,'VoiceExtensionId':_0x5a918e['id']});_0x2e83e0[_0xabee('0xb')]({'type':_0x444a92[_0xabee('0x2')]['toLowerCase'](),'app':'Set','appdata':_0xabee('0x43'),'context':_0x5a918e['context'],'exten':_0x5a918e['exten'],'priority':_0x444a92['intervals'][_0xabee('0x37')]+_0x1475f3+_0x441af1++,'VoiceExtensionId':_0x5a918e['id']});}}}}for(var _0x5b975b=0x0;_0x5b975b<_0x444a92[_0xabee('0x31')]['length'];_0x5b975b++){var _0x12240a=_0x1475f3+_0x444a92['intervals'][_0xabee('0x37')];var _0x2c88fc=_0x5b975b===_0x444a92[_0xabee('0x31')][_0xabee('0x37')]-0x1?_0x1475f3+_0x2e83e0['length']+_0x5ae15a[_0xabee('0x37')]+0x2:_0x1475f3+_0x5b975b+0x1;_0x2e83e0['splice'](_0x5b975b,0x0,{'type':_0x5a918e[_0xabee('0x2')],'app':_0xabee('0x44'),'appdata':_0x444a92[_0xabee('0x31')][_0x5b975b]+'?'+_0x5a918e[_0xabee('0x9')]+_0xabee('0x45')+_0x12240a+':'+_0x5a918e[_0xabee('0x9')]+_0xabee('0x45')+_0x2c88fc,'exten':_0x5a918e[_0xabee('0x5')],'context':_0x5a918e['context'],'priority':_0x1475f3+_0x5b975b,'VoiceExtensionId':_0x5a918e['id']});}if(_0x444a92[_0xabee('0x3f')]===_0xabee('0x46'))_0x444a92['appdata']=_0x146ae9(_0x5a918e,_0x444a92[_0xabee('0x47')]);_0x444a92['priority']=_0x2e83e0[_0xabee('0x37')]?_[_0xabee('0x48')](_0x2e83e0)[_0xabee('0x49')]+0x1:_0x1475f3;_0x2e3675=_[_0xabee('0x4a')](_0x2e3675,_0x2e83e0,[_0x444a92],_0x5ae15a);_0x1475f3=_['last'](_0x2e3675)[_0xabee('0x49')]+0x1;}return _0x50b996(_0x2e3675);})[_0xabee('0x4b')](function(_0x2bfdb5){_0x1ce8ae(_0x2bfdb5);});});}return _0x3b377b['define'](_0xabee('0x4c'),attributes,{'tableName':_0xabee('0x4d'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x4861e5){var _0x47a561=this[_0xabee('0x4e')]({'plain':!![]});var _0x1e0082=_0x47a561['type']===_0xabee('0xf')?_0x2d6e69(_0x47a561):_0x972e88(_0x47a561);return _0x2701b7(_0x47a561,_0x4861e5,_['last'](_0x1e0082)[_0xabee('0x49')]+0x1)[_0xabee('0x4f')](function(_0x5e0133){var _0x1f87da=_[_0xabee('0x4a')](_0x1e0082,_0x5e0133);_0x1f87da[_0xabee('0xb')]({'type':_0x47a561[_0xabee('0x2')],'app':_0xabee('0x50'),'exten':_0x47a561[_0xabee('0x5')],'context':_0x47a561['context'],'priority':_[_0xabee('0x48')](_0x1f87da)[_0xabee('0x49')]+0x1,'VoiceExtensionId':_0x47a561['id']});return _0x1f87da;});}}});}; \ No newline at end of file +var _0x2409=['CDR(destination)=','cutdigits','${EXTEN:','ExecIf','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','wav','trunk','timeout','url','param','split','phone','prefix','${EXTEN}','join','options','indexOf','U(xcally-mixmonitor-context)','replace','Interval','findAll','IntervalId','then','length','*,*,*,*','intervals','interval','map','filter','toLowerCase','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','appdata','priority','last','concat','catch','get','Hangup','lodash','./voiceExtension.attributes','exports','models','type','Set','context','exten','NoOp','alias','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(routeAlias)=','No\x20alias\x20set'];(function(_0x171de5,_0x260fd1){var _0x1c2d68=function(_0x111adc){while(--_0x111adc){_0x171de5['push'](_0x171de5['shift']());}};_0x1c2d68(++_0x260fd1);}(_0x2409,0x128));var _0x9240=function(_0x8df9fd,_0x4308f4){_0x8df9fd=_0x8df9fd-0x0;var _0x572563=_0x2409[_0x8df9fd];return _0x572563;};'use strict';var _=require(_0x9240('0x0'));var attributes=require(_0x9240('0x1'));module[_0x9240('0x2')]=function(_0x238ca5){var _0x45933d=_0x238ca5[_0x9240('0x3')];function _0x4d88c7(_0x387668){var _0x6947ae=0x2;var _0x3d3683=[{'type':_0x387668[_0x9240('0x4')],'app':_0x9240('0x5'),'appdata':'CDR(type)='+_0x387668[_0x9240('0x4')],'context':_0x387668[_0x9240('0x6')],'exten':_0x387668[_0x9240('0x7')],'priority':_0x6947ae++,'VoiceExtensionId':_0x387668['id']},{'type':_0x387668['type'],'app':_0x387668['alias']?'Set':_0x9240('0x8'),'appdata':_0x387668[_0x9240('0x9')]?'CDR(routeAlias)='+_0x387668[_0x9240('0x9')]:'No\x20alias\x20set','context':_0x387668['context'],'exten':_0x387668[_0x9240('0x7')],'priority':_0x6947ae++,'VoiceExtensionId':_0x387668['id']}];if(_0x387668['type']===_0x9240('0xa')){_0x3d3683[_0x9240('0xb')]({'type':_0x9240('0xa'),'app':_0x9240('0x5'),'appdata':_0x9240('0xc')+_0x387668['id'],'context':_0x387668[_0x9240('0x6')],'exten':_0x387668['exten'],'priority':_0x6947ae++,'VoiceExtensionId':_0x387668['id']});}_0x3d3683[_0x9240('0xb')]({'type':_0x387668['type'],'app':_0x9240('0x5'),'appdata':_0x9240('0xd'),'context':_0x387668[_0x9240('0x6')],'exten':_0x387668[_0x9240('0x7')],'priority':_0x6947ae++,'VoiceExtensionId':_0x387668['id']},{'type':_0x387668[_0x9240('0x4')],'app':_0x9240('0x5'),'appdata':_0x9240('0xe'),'context':_0x387668[_0x9240('0x6')],'exten':_0x387668[_0x9240('0x7')],'priority':_0x6947ae++,'VoiceExtensionId':_0x387668['id']},{'type':_0x387668[_0x9240('0x4')],'app':_0x9240('0x5'),'appdata':_0x9240('0xf'),'context':_0x387668['context'],'exten':_0x387668[_0x9240('0x7')],'priority':_0x6947ae++,'VoiceExtensionId':_0x387668['id']});return _0x3d3683;}function _0x3fab8c(_0x56fc22){var _0x55ed28=0x2;var _0x2242c6=[{'type':_0x9240('0x10'),'app':_0x9240('0x5'),'appdata':_0x9240('0x11'),'context':_0x56fc22[_0x9240('0x6')],'exten':_0x56fc22[_0x9240('0x7')],'priority':_0x55ed28++,'VoiceExtensionId':_0x56fc22['id']},{'type':_0x9240('0x10'),'app':_0x56fc22[_0x9240('0x9')]?'Set':_0x9240('0x8'),'appdata':_0x56fc22[_0x9240('0x9')]?_0x9240('0x12')+_0x56fc22[_0x9240('0x9')]:_0x9240('0x13'),'context':_0x56fc22[_0x9240('0x6')],'exten':_0x56fc22[_0x9240('0x7')],'priority':_0x55ed28++,'VoiceExtensionId':_0x56fc22['id']},{'type':_0x9240('0x10'),'app':_0x9240('0x5'),'appdata':_0x9240('0x14')+(_0x56fc22[_0x9240('0x15')]?_0x9240('0x16')+_0x56fc22[_0x9240('0x15')]+'}':'${EXTEN}'),'context':_0x56fc22[_0x9240('0x6')],'exten':_0x56fc22['exten'],'priority':_0x55ed28++,'VoiceExtensionId':_0x56fc22['id']},{'type':'outbound','app':_0x9240('0x5'),'appdata':_0x9240('0xc')+_0x56fc22['id'],'context':_0x56fc22[_0x9240('0x6')],'exten':_0x56fc22[_0x9240('0x7')],'priority':_0x55ed28++,'VoiceExtensionId':_0x56fc22['id']},{'type':'outbound','app':_0x9240('0x17'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x55ed28+0x2)+'):Goto('+(_0x55ed28+0x1)+')','context':_0x56fc22[_0x9240('0x6')],'exten':_0x56fc22['exten'],'priority':_0x55ed28++,'VoiceExtensionId':_0x56fc22['id']},{'type':_0x9240('0x10'),'app':_0x9240('0x5'),'appdata':_0x56fc22['cutdigits']?_0x9240('0x18')+_0x56fc22[_0x9240('0x15')]+'}':_0x9240('0x19'),'context':_0x56fc22[_0x9240('0x6')],'exten':_0x56fc22[_0x9240('0x7')],'priority':_0x55ed28++,'VoiceExtensionId':_0x56fc22['id']},{'type':'outbound','app':_0x9240('0x5'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x56fc22['context'],'exten':_0x56fc22[_0x9240('0x7')],'priority':_0x55ed28++,'VoiceExtensionId':_0x56fc22['id']},{'type':'outbound','app':_0x9240('0x5'),'appdata':_0x9240('0xe'),'context':_0x56fc22['context'],'exten':_0x56fc22[_0x9240('0x7')],'priority':_0x55ed28++,'VoiceExtensionId':_0x56fc22['id']},{'type':_0x9240('0x10'),'app':_0x9240('0x5'),'appdata':_0x9240('0xf'),'context':_0x56fc22['context'],'exten':_0x56fc22['exten'],'priority':_0x55ed28++,'VoiceExtensionId':_0x56fc22['id']},{'type':_0x9240('0x10'),'app':_0x9240('0x5'),'appdata':_0x9240('0x1a')+_0x56fc22['id'],'context':_0x56fc22[_0x9240('0x6')],'exten':_0x56fc22[_0x9240('0x7')],'priority':_0x55ed28++,'VoiceExtensionId':_0x56fc22['id']}];if(_0x56fc22[_0x9240('0x1b')](_0x9240('0x1c'))&&_0x56fc22[_0x9240('0x1c')]!==_0x9240('0x1d')){_0x2242c6[_0x9240('0xb')]({'type':_0x9240('0x10'),'app':_0x9240('0x5'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x56fc22['context'],'exten':_0x56fc22[_0x9240('0x7')],'priority':_0x55ed28++,'VoiceExtensionId':_0x56fc22['id']},{'type':_0x9240('0x10'),'app':_0x9240('0x5'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x56fc22[_0x9240('0x1c')]||_0x9240('0x1e'),'context':_0x56fc22[_0x9240('0x6')],'exten':_0x56fc22['exten'],'priority':_0x55ed28++,'VoiceExtensionId':_0x56fc22['id']});}return _0x2242c6;}function _0x50c2e3(_0xa51f28,_0x3a7444){var _0x57eb15=[{'name':_0x9240('0x1f'),'param':0x0},{'name':_0x9240('0x20'),'param':0x1},{'name':'options','param':0x2},{'name':_0x9240('0x21'),'param':0x3}];var _0x3b4e5d={};var _0x25dd26=_0x3a7444['split'](',');var _0x62a7b6=[];for(var _0x895997=0x0;_0x895997<_0x57eb15['length'];_0x895997++){switch(_0x57eb15[_0x895997]['name']){case _0x9240('0x1f'):_0x3b4e5d[_0x9240('0x1f')]=_0x25dd26[_0x57eb15[_0x895997][_0x9240('0x22')]][_0x9240('0x23')]('/')[0x1];_0x3b4e5d[_0x9240('0x24')]=_0x25dd26[_0x57eb15[_0x895997][_0x9240('0x22')]][_0x9240('0x23')]('/')[0x2];_0x3b4e5d[_0x9240('0x25')]=_0x3b4e5d[_0x9240('0x24')]?_0x3b4e5d[_0x9240('0x24')][_0x9240('0x23')]('$')[0x0]:undefined;_0x3b4e5d[_0x9240('0x24')]=_0xa51f28[_0x9240('0x15')]?(_0x3b4e5d[_0x9240('0x25')]||'')+_0x9240('0x16')+_0xa51f28['cutdigits']+'}':(_0x3b4e5d[_0x9240('0x25')]||'')+_0x9240('0x26');_0x62a7b6[_0x57eb15[_0x895997][_0x9240('0x22')]]=['SIP',_0x3b4e5d[_0x9240('0x1f')],_0x3b4e5d[_0x9240('0x24')]][_0x9240('0x27')]('/');break;case _0x9240('0x28'):_0x3b4e5d['options']=_0x25dd26[_0x57eb15[_0x895997][_0x9240('0x22')]];if(_0xa51f28['recordingFormat']!==_0x9240('0x1d')){if(_0x3b4e5d[_0x9240('0x28')][_0x9240('0x29')](_0x9240('0x2a'))<0x0){_0x3b4e5d[_0x9240('0x28')]+=_0x9240('0x2a');}}else{_0x3b4e5d['options']=_0x3b4e5d[_0x9240('0x28')][_0x9240('0x2b')](_0x9240('0x2a'),'');}_0x62a7b6[_0x57eb15[_0x895997]['param']]=_0x3b4e5d['options'];break;default:_0x62a7b6[_0x57eb15[_0x895997]['param']]=_0x25dd26[_0x57eb15[_0x895997][_0x9240('0x22')]];}}return _0x62a7b6[_0x9240('0x27')](',');}function _0x29e44f(_0x1e6c55,_0x1e6791,_0x1e34ee){return new Promise(function(_0x534591,_0x541762){var _0x1c17b8=[];if(_['isEmpty'](_0x1e6791))return _0x534591(_0x1c17b8);_0x45933d[_0x9240('0x2c')][_0x9240('0x2d')]({'attributes':['id','interval',_0x9240('0x2e')],'raw':!![]})[_0x9240('0x2f')](function(_0x23e415){for(var _0x45007a=0x0,_0xbe6835=0x0;_0x45007a<_0x1e6791[_0x9240('0x30')];_0x45007a++,_0xbe6835=0x0){var _0x5d5205=_0x1e6791[_0x45007a];var _0x4f35ee=[];var _0x1aba64=[];delete _0x5d5205['id'];if(_0x5d5205['interval']!==_0x9240('0x31')){_0x5d5205[_0x9240('0x32')]=[_0x5d5205[_0x9240('0x33')]];}else{_0x5d5205[_0x9240('0x32')]=_0x5d5205['IntervalId']?_[_0x9240('0x34')](_[_0x9240('0x35')](_0x23e415,{'IntervalId':_0x5d5205[_0x9240('0x2e')]}),_0x9240('0x33')):[];}_0x5d5205['context']=_0x1e6c55[_0x9240('0x6')];_0x5d5205['exten']=_0x1e6c55[_0x9240('0x7')];if(_0x5d5205['type'])_0x5d5205['type']=_0x5d5205[_0x9240('0x4')][_0x9240('0x36')]();if(_0x1e6c55[_0x9240('0x4')]===_0x9240('0x10')){if(_0x5d5205[_0x9240('0x1b')]('tag')&&_0x5d5205['tag']&&_0x5d5205['tag']!=='--'){_0x4f35ee[_0x9240('0xb')]({'type':_0x5d5205[_0x9240('0x4')][_0x9240('0x36')](),'app':'Set','appdata':_0x9240('0x37')+_0x5d5205['tag'],'context':_0x1e6c55[_0x9240('0x6')],'exten':_0x1e6c55[_0x9240('0x7')],'priority':_0x5d5205[_0x9240('0x32')][_0x9240('0x30')]+_0x1e34ee+_0xbe6835++,'VoiceExtensionId':_0x1e6c55['id']});}_0x4f35ee['push']({'type':_0x5d5205[_0x9240('0x4')][_0x9240('0x36')](),'app':_0x9240('0x17'),'appdata':_0x9240('0x38')+(_0x5d5205[_0x9240('0x39')]?_0x9240('0x3a')+_0x5d5205['callerID']+')':_0x9240('0x3b')),'context':_0x1e6c55[_0x9240('0x6')],'exten':_0x1e6c55[_0x9240('0x7')],'priority':_0x5d5205[_0x9240('0x32')][_0x9240('0x30')]+_0x1e34ee+_0xbe6835++,'VoiceExtensionId':_0x1e6c55['id']});}else{if(_0x5d5205[_0x9240('0x1b')](_0x9240('0x3c'))){if([_0x9240('0x3d'),_0x9240('0x3e')]['includes'](_0x5d5205[_0x9240('0x3f')][_0x9240('0x36')]())&&_0x5d5205[_0x9240('0x40')]!==_0x9240('0x41')){if(_0x5d5205[_0x9240('0x3c')]){_0x4f35ee['push']({'type':_0x5d5205['type'][_0x9240('0x36')](),'app':_0x9240('0x17'),'appdata':_0x9240('0x42'),'context':_0x1e6c55[_0x9240('0x6')],'exten':_0x1e6c55[_0x9240('0x7')],'priority':_0x5d5205['intervals'][_0x9240('0x30')]+_0x1e34ee+_0xbe6835++,'VoiceExtensionId':_0x1e6c55['id']});_0x4f35ee[_0x9240('0xb')]({'type':_0x5d5205[_0x9240('0x4')][_0x9240('0x36')](),'app':_0x9240('0x5'),'appdata':_0x9240('0x43'),'context':_0x1e6c55['context'],'exten':_0x1e6c55['exten'],'priority':_0x5d5205[_0x9240('0x32')][_0x9240('0x30')]+_0x1e34ee+_0xbe6835++,'VoiceExtensionId':_0x1e6c55['id']});}else{_0x4f35ee['push']({'type':_0x5d5205[_0x9240('0x4')][_0x9240('0x36')](),'app':_0x9240('0x17'),'appdata':_0x9240('0x44'),'context':_0x1e6c55[_0x9240('0x6')],'exten':_0x1e6c55['exten'],'priority':_0x5d5205[_0x9240('0x32')][_0x9240('0x30')]+_0x1e34ee+_0xbe6835++,'VoiceExtensionId':_0x1e6c55['id']});_0x4f35ee[_0x9240('0xb')]({'type':_0x5d5205['type'][_0x9240('0x36')](),'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x1e6c55[_0x9240('0x6')],'exten':_0x1e6c55['exten'],'priority':_0x5d5205[_0x9240('0x32')][_0x9240('0x30')]+_0x1e34ee+_0xbe6835++,'VoiceExtensionId':_0x1e6c55['id']});}}}}for(var _0x59f4c8=0x0;_0x59f4c8<_0x5d5205[_0x9240('0x32')]['length'];_0x59f4c8++){var _0x55d6e3=_0x1e34ee+_0x5d5205[_0x9240('0x32')][_0x9240('0x30')];var _0x4d8b35=_0x59f4c8===_0x5d5205['intervals'][_0x9240('0x30')]-0x1?_0x1e34ee+_0x4f35ee[_0x9240('0x30')]+_0x1aba64['length']+0x2:_0x1e34ee+_0x59f4c8+0x1;_0x4f35ee[_0x9240('0x45')](_0x59f4c8,0x0,{'type':_0x1e6c55[_0x9240('0x4')],'app':_0x9240('0x46'),'appdata':_0x5d5205[_0x9240('0x32')][_0x59f4c8]+'?'+_0x1e6c55[_0x9240('0x6')]+_0x9240('0x47')+_0x55d6e3+':'+_0x1e6c55[_0x9240('0x6')]+',${EXTEN},'+_0x4d8b35,'exten':_0x1e6c55[_0x9240('0x7')],'context':_0x1e6c55[_0x9240('0x6')],'priority':_0x1e34ee+_0x59f4c8,'VoiceExtensionId':_0x1e6c55['id']});}if(_0x5d5205[_0x9240('0x40')]==='outboundDial')_0x5d5205[_0x9240('0x48')]=_0x50c2e3(_0x1e6c55,_0x5d5205[_0x9240('0x48')]);_0x5d5205[_0x9240('0x49')]=_0x4f35ee[_0x9240('0x30')]?_[_0x9240('0x4a')](_0x4f35ee)['priority']+0x1:_0x1e34ee;_0x1c17b8=_[_0x9240('0x4b')](_0x1c17b8,_0x4f35ee,[_0x5d5205],_0x1aba64);_0x1e34ee=_[_0x9240('0x4a')](_0x1c17b8)['priority']+0x1;}return _0x534591(_0x1c17b8);})[_0x9240('0x4c')](function(_0x18b33c){_0x541762(_0x18b33c);});});}return _0x238ca5['define']('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x49695e){var _0x2d03d6=this[_0x9240('0x4d')]({'plain':!![]});var _0x59d6b8=_0x2d03d6[_0x9240('0x4')]===_0x9240('0x10')?_0x3fab8c(_0x2d03d6):_0x4d88c7(_0x2d03d6);return _0x29e44f(_0x2d03d6,_0x49695e,_[_0x9240('0x4a')](_0x59d6b8)[_0x9240('0x49')]+0x1)[_0x9240('0x2f')](function(_0x152e96){var _0x152cd3=_[_0x9240('0x4b')](_0x59d6b8,_0x152e96);_0x152cd3[_0x9240('0xb')]({'type':_0x2d03d6[_0x9240('0x4')],'app':_0x9240('0x4e'),'exten':_0x2d03d6[_0x9240('0x7')],'context':_0x2d03d6['context'],'priority':_[_0x9240('0x4a')](_0x152cd3)[_0x9240('0x49')]+0x1,'VoiceExtensionId':_0x2d03d6['id']});return _0x152cd3;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 0990a60..6ce8694 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 _0x6eed=['VoiceExtension','options','raw','limit','include','map','model','attributes','then','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','localhost','register','request','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetVoiceExtension'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6eed,0xff));var _0xd6ee=function(_0x2717eb,_0x39ea39){_0x2717eb=_0x2717eb-0x0;var _0xc7342c=_0x6eed[_0x2717eb];return _0xc7342c;};'use strict';var _=require(_0xd6ee('0x0'));var util=require(_0xd6ee('0x1'));var moment=require(_0xd6ee('0x2'));var BPromise=require(_0xd6ee('0x3'));var rs=require(_0xd6ee('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6ee('0x5'))['db'];var utils=require(_0xd6ee('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xd6ee('0x7'));var jayson=require(_0xd6ee('0x8'));var client=jayson[_0xd6ee('0x9')][_0xd6ee('0xa')]({'port':0x232a});config[_0xd6ee('0xb')]=_['defaults'](config['redis'],{'host':_0xd6ee('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voiceExtension.socket')[_0xd6ee('0xd')](socket);function respondWithRpcPromise(_0x213396,_0x5c3c61,_0x24385c){return new BPromise(function(_0xc3f404,_0x2e55a2){return client[_0xd6ee('0xe')](_0x213396,_0x24385c)['then'](function(_0x15baf3){logger[_0xd6ee('0xf')](_0xd6ee('0x10'),_0x5c3c61,_0xd6ee('0x11'));logger[_0xd6ee('0x12')](_0xd6ee('0x13'),_0x5c3c61,'request\x20sent',JSON[_0xd6ee('0x14')](_0x15baf3));if(_0x15baf3[_0xd6ee('0x15')]){if(_0x15baf3['error'][_0xd6ee('0x16')]===0x1f4){logger[_0xd6ee('0x15')](_0xd6ee('0x10'),_0x5c3c61,_0x15baf3[_0xd6ee('0x15')][_0xd6ee('0x17')]);return _0x2e55a2(_0x15baf3[_0xd6ee('0x15')]['message']);}logger[_0xd6ee('0x15')](_0xd6ee('0x10'),_0x5c3c61,_0x15baf3[_0xd6ee('0x15')]['message']);return _0xc3f404(_0x15baf3[_0xd6ee('0x15')]['message']);}else{logger[_0xd6ee('0xf')](_0xd6ee('0x10'),_0x5c3c61,_0xd6ee('0x11'));_0xc3f404(_0x15baf3['result'][_0xd6ee('0x17')]);}})['catch'](function(_0x391488){logger['error'](_0xd6ee('0x10'),_0x5c3c61,_0x391488);_0x2e55a2(_0x391488);});});}exports[_0xd6ee('0x18')]=function(_0x23ff1f){var _0x2888ef=this;return new Promise(function(_0x134c65,_0x4b33f1){return db[_0xd6ee('0x19')]['findAll']({'raw':_0x23ff1f[_0xd6ee('0x1a')]?_0x23ff1f[_0xd6ee('0x1a')][_0xd6ee('0x1b')]===undefined?!![]:![]:!![],'where':_0x23ff1f[_0xd6ee('0x1a')]?_0x23ff1f[_0xd6ee('0x1a')]['where']||null:null,'attributes':_0x23ff1f['options']?_0x23ff1f[_0xd6ee('0x1a')]['attributes']||null:null,'limit':_0x23ff1f[_0xd6ee('0x1a')]?_0x23ff1f['options'][_0xd6ee('0x1c')]||null:null,'include':_0x23ff1f[_0xd6ee('0x1a')]?_0x23ff1f[_0xd6ee('0x1a')][_0xd6ee('0x1d')]?_[_0xd6ee('0x1e')](_0x23ff1f['options']['include'],function(_0x2f438c){return{'model':db[_0x2f438c[_0xd6ee('0x1f')]],'as':_0x2f438c['as'],'attributes':_0x2f438c['attributes'],'include':_0x2f438c[_0xd6ee('0x1d')]?_[_0xd6ee('0x1e')](_0x2f438c[_0xd6ee('0x1d')],function(_0x373308){return{'model':db[_0x373308[_0xd6ee('0x1f')]],'as':_0x373308['as'],'attributes':_0x373308[_0xd6ee('0x20')],'include':_0x373308[_0xd6ee('0x1d')]?_['map'](_0x373308[_0xd6ee('0x1d')],function(_0x124ab7){return{'model':db[_0x124ab7['model']],'as':_0x124ab7['as'],'attributes':_0x124ab7['attributes']};}):[]};}):[]};}):[]:[]})[_0xd6ee('0x21')](function(_0x4580a7){logger[_0xd6ee('0xf')](_0xd6ee('0x18'),_0x23ff1f);logger[_0xd6ee('0x12')]('GetVoiceExtension',_0x23ff1f,JSON[_0xd6ee('0x14')](_0x4580a7));_0x134c65(_0x4580a7);})[_0xd6ee('0x22')](function(_0x21ce09){logger['error'](_0xd6ee('0x18'),_0x21ce09[_0xd6ee('0x17')],_0x23ff1f);_0x4b33f1(_0x2888ef[_0xd6ee('0x15')](0x1f4,_0x21ce09['message']));});});}; \ No newline at end of file +var _0xc15b=['map','attributes','model','debug','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','redis','defaults','./voiceExtension.socket','request','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceExtension','VoiceExtension','options','raw','where','limit','include'];(function(_0x2d3b05,_0x12fd04){var _0x46cc57=function(_0x1a77a4){while(--_0x1a77a4){_0x2d3b05['push'](_0x2d3b05['shift']());}};_0x46cc57(++_0x12fd04);}(_0xc15b,0xe4));var _0xbc15=function(_0x872b02,_0x4f4458){_0x872b02=_0x872b02-0x0;var _0x1a6b24=_0xc15b[_0x872b02];return _0x1a6b24;};'use strict';var _=require(_0xbc15('0x0'));var util=require('util');var moment=require(_0xbc15('0x1'));var BPromise=require(_0xbc15('0x2'));var rs=require(_0xbc15('0x3'));var fs=require('fs');var Redis=require(_0xbc15('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbc15('0x5'))(_0xbc15('0x6'));var config=require(_0xbc15('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xbc15('0x8')]=_[_0xbc15('0x9')](config[_0xbc15('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xbc15('0xa'))['register'](socket);function respondWithRpcPromise(_0x2189d4,_0x42f0b9,_0x359eb9){return new BPromise(function(_0x551a7b,_0x413eda){return client[_0xbc15('0xb')](_0x2189d4,_0x359eb9)['then'](function(_0xc677d5){logger[_0xbc15('0xc')](_0xbc15('0xd'),_0x42f0b9,'request\x20sent');logger['debug']('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x42f0b9,_0xbc15('0xe'),JSON[_0xbc15('0xf')](_0xc677d5));if(_0xc677d5[_0xbc15('0x10')]){if(_0xc677d5[_0xbc15('0x10')][_0xbc15('0x11')]===0x1f4){logger[_0xbc15('0x10')](_0xbc15('0xd'),_0x42f0b9,_0xc677d5[_0xbc15('0x10')][_0xbc15('0x12')]);return _0x413eda(_0xc677d5[_0xbc15('0x10')][_0xbc15('0x12')]);}logger[_0xbc15('0x10')](_0xbc15('0xd'),_0x42f0b9,_0xc677d5[_0xbc15('0x10')]['message']);return _0x551a7b(_0xc677d5[_0xbc15('0x10')]['message']);}else{logger[_0xbc15('0xc')](_0xbc15('0xd'),_0x42f0b9,_0xbc15('0xe'));_0x551a7b(_0xc677d5[_0xbc15('0x13')][_0xbc15('0x12')]);}})[_0xbc15('0x14')](function(_0x7e7826){logger[_0xbc15('0x10')](_0xbc15('0xd'),_0x42f0b9,_0x7e7826);_0x413eda(_0x7e7826);});});}exports[_0xbc15('0x15')]=function(_0x2b5dbb){var _0x1b80e1=this;return new Promise(function(_0x58a204,_0x247ce3){return db[_0xbc15('0x16')]['findAll']({'raw':_0x2b5dbb[_0xbc15('0x17')]?_0x2b5dbb[_0xbc15('0x17')][_0xbc15('0x18')]===undefined?!![]:![]:!![],'where':_0x2b5dbb[_0xbc15('0x17')]?_0x2b5dbb[_0xbc15('0x17')][_0xbc15('0x19')]||null:null,'attributes':_0x2b5dbb[_0xbc15('0x17')]?_0x2b5dbb[_0xbc15('0x17')]['attributes']||null:null,'limit':_0x2b5dbb[_0xbc15('0x17')]?_0x2b5dbb[_0xbc15('0x17')][_0xbc15('0x1a')]||null:null,'include':_0x2b5dbb['options']?_0x2b5dbb[_0xbc15('0x17')][_0xbc15('0x1b')]?_[_0xbc15('0x1c')](_0x2b5dbb[_0xbc15('0x17')][_0xbc15('0x1b')],function(_0x2a76de){return{'model':db[_0x2a76de['model']],'as':_0x2a76de['as'],'attributes':_0x2a76de[_0xbc15('0x1d')],'include':_0x2a76de[_0xbc15('0x1b')]?_[_0xbc15('0x1c')](_0x2a76de[_0xbc15('0x1b')],function(_0x2f57d6){return{'model':db[_0x2f57d6[_0xbc15('0x1e')]],'as':_0x2f57d6['as'],'attributes':_0x2f57d6[_0xbc15('0x1d')],'include':_0x2f57d6[_0xbc15('0x1b')]?_[_0xbc15('0x1c')](_0x2f57d6[_0xbc15('0x1b')],function(_0x2497de){return{'model':db[_0x2497de[_0xbc15('0x1e')]],'as':_0x2497de['as'],'attributes':_0x2497de['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b5b0f){logger[_0xbc15('0xc')](_0xbc15('0x15'),_0x2b5dbb);logger[_0xbc15('0x1f')](_0xbc15('0x15'),_0x2b5dbb,JSON[_0xbc15('0xf')](_0x4b5b0f));_0x58a204(_0x4b5b0f);})[_0xbc15('0x14')](function(_0xa9cf30){logger['error'](_0xbc15('0x15'),_0xa9cf30[_0xbc15('0x12')],_0x2b5dbb);_0x247ce3(_0x1b80e1['error'](0x1f4,_0xa9cf30[_0xbc15('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index b20bce2..d0b5430 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 _0x1261=['save','remove','update','emit','removeListener','voiceExtension:'];(function(_0x51f58d,_0x210643){var _0x4ee1c7=function(_0xfa4ece){while(--_0xfa4ece){_0x51f58d['push'](_0x51f58d['shift']());}};_0x4ee1c7(++_0x210643);}(_0x1261,0x144));var _0x1126=function(_0xf26d40,_0x2f4f46){_0xf26d40=_0xf26d40-0x0;var _0x50b68c=_0x1261[_0xf26d40];return _0x50b68c;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x1126('0x0'),_0x1126('0x1'),_0x1126('0x2')];function createListener(_0x331a2c,_0x39b786){return function(_0x350f3a){_0x39b786[_0x1126('0x3')](_0x331a2c,_0x350f3a);};}function removeListener(_0x4245ca,_0x21a480){return function(){VoiceExtensionEvents[_0x1126('0x4')](_0x4245ca,_0x21a480);};}exports['register']=function(_0x5c68c8){for(var _0x40ba58=0x0,_0x907180=events['length'];_0x40ba58<_0x907180;_0x40ba58++){var _0x17e5f0=events[_0x40ba58];var _0x28772d=createListener(_0x1126('0x5')+_0x17e5f0,_0x5c68c8);VoiceExtensionEvents['on'](_0x17e5f0,_0x28772d);}}; \ No newline at end of file +var _0x326f=['update','emit','removeListener','register','length','./voiceExtension.events'];(function(_0x32f514,_0x108632){var _0x1aef60=function(_0x3831b8){while(--_0x3831b8){_0x32f514['push'](_0x32f514['shift']());}};_0x1aef60(++_0x108632);}(_0x326f,0xd1));var _0xf326=function(_0x11c541,_0x1f8e03){_0x11c541=_0x11c541-0x0;var _0x7bed29=_0x326f[_0x11c541];return _0x7bed29;};'use strict';var VoiceExtensionEvents=require(_0xf326('0x0'));var events=['save','remove',_0xf326('0x1')];function createListener(_0x330ddb,_0x22aabf){return function(_0x408257){_0x22aabf[_0xf326('0x2')](_0x330ddb,_0x408257);};}function removeListener(_0x120a26,_0x9445c6){return function(){VoiceExtensionEvents[_0xf326('0x3')](_0x120a26,_0x9445c6);};}exports[_0xf326('0x4')]=function(_0x3ace29){for(var _0x4c2249=0x0,_0x3c254d=events[_0xf326('0x5')];_0x4c2249<_0x3c254d;_0x4c2249++){var _0x165f95=events[_0x4c2249];var _0x1e7b8a=createListener('voiceExtension:'+_0x165f95,_0x3ace29);VoiceExtensionEvents['on'](_0x165f95,_0x1e7b8a);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 645f371..3d8c465 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 _0x32f4=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id','getMessages','post','create','update','exports'];(function(_0x2dfbb4,_0x532b0e){var _0x16ad9c=function(_0x1bff62){while(--_0x1bff62){_0x2dfbb4['push'](_0x2dfbb4['shift']());}};_0x16ad9c(++_0x532b0e);}(_0x32f4,0x154));var _0x432f=function(_0x393cdc,_0x5bb732){_0x393cdc=_0x393cdc-0x0;var _0x1333a3=_0x32f4[_0x393cdc];return _0x1333a3;};'use strict';var multer=require(_0x432f('0x0'));var util=require(_0x432f('0x1'));var path=require(_0x432f('0x2'));var timeout=require(_0x432f('0x3'));var express=require('express');var router=express[_0x432f('0x4')]();var fs_extra=require(_0x432f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x432f('0x6'));var config=require(_0x432f('0x7'));var controller=require(_0x432f('0x8'));router[_0x432f('0x9')]('/',auth[_0x432f('0xa')](),controller['index']);router['get'](_0x432f('0xb'),auth[_0x432f('0xa')](),controller['show']);router[_0x432f('0x9')]('/:id/messages',auth[_0x432f('0xa')](),controller[_0x432f('0xc')]);router[_0x432f('0xd')]('/',auth[_0x432f('0xa')](),controller[_0x432f('0xe')]);router['put'](_0x432f('0xb'),auth['isAuthenticated'](),controller[_0x432f('0xf')]);router['delete'](_0x432f('0xb'),auth[_0x432f('0xa')](),controller['destroy']);module[_0x432f('0x10')]=router; \ No newline at end of file +var _0x4c60=['exports','multer','util','path','connect-timeout','Router','./voiceMail.controller','get','isAuthenticated','index','/:id','/:id/messages','getMessages','put','update','destroy'];(function(_0x4e24f4,_0xb0d023){var _0x14c73a=function(_0x3f6eb8){while(--_0x3f6eb8){_0x4e24f4['push'](_0x4e24f4['shift']());}};_0x14c73a(++_0xb0d023);}(_0x4c60,0xc1));var _0x04c6=function(_0xfeda91,_0x48fabe){_0xfeda91=_0xfeda91-0x0;var _0x220ab1=_0x4c60[_0xfeda91];return _0x220ab1;};'use strict';var multer=require(_0x04c6('0x0'));var util=require(_0x04c6('0x1'));var path=require(_0x04c6('0x2'));var timeout=require(_0x04c6('0x3'));var express=require('express');var router=express[_0x04c6('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x04c6('0x5'));router[_0x04c6('0x6')]('/',auth[_0x04c6('0x7')](),controller[_0x04c6('0x8')]);router[_0x04c6('0x6')](_0x04c6('0x9'),auth[_0x04c6('0x7')](),controller['show']);router[_0x04c6('0x6')](_0x04c6('0xa'),auth[_0x04c6('0x7')](),controller[_0x04c6('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x04c6('0xc')]('/:id',auth[_0x04c6('0x7')](),controller[_0x04c6('0xd')]);router['delete'](_0x04c6('0x9'),auth[_0x04c6('0x7')](),controller[_0x04c6('0xe')]);module[_0x04c6('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 73cb2b1..e007bb4 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 _0x4885=['from-voicemail','contest_mailbox','setDataValue','email','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING'];(function(_0x527824,_0xc824a9){var _0xc8b8ed=function(_0x1b0e19){while(--_0x1b0e19){_0x527824['push'](_0x527824['shift']());}};_0xc8b8ed(++_0xc824a9);}(_0x4885,0x7c));var _0x5488=function(_0x4dfc72,_0x20e817){_0x4dfc72=_0x4dfc72-0x0;var _0x2413f1=_0x4885[_0x4dfc72];return _0x2413f1;};'use strict';var Sequelize=require('sequelize');module[_0x5488('0x0')]={'customer_id':{'type':Sequelize[_0x5488('0x1')]},'context':{'type':Sequelize[_0x5488('0x1')],'defaultValue':_0x5488('0x2'),'unique':_0x5488('0x3')},'mailbox':{'type':Sequelize[_0x5488('0x1')],'defaultValue':'','allowNull':![],'unique':_0x5488('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x5488('0x1')]},'email':{'type':Sequelize[_0x5488('0x1')],'validate':{'isEmail':!![]},'set':function(_0xabe059){this[_0x5488('0x4')](_0x5488('0x5'),typeof _0xabe059===_0x5488('0x6')&&_0xabe059[_0x5488('0x7')]()?_0xabe059['trim']():null);}},'pager':{'type':Sequelize[_0x5488('0x1')]},'tz':{'type':Sequelize[_0x5488('0x1')],'defaultValue':'central'},'attach':{'type':Sequelize[_0x5488('0x8')](_0x5488('0x9'),'no'),'defaultValue':_0x5488('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x5488('0x8')](_0x5488('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x5488('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x5488('0x8')](_0x5488('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x5488('0x8')](_0x5488('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x5488('0x8')](_0x5488('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x5488('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x5488('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x5488('0x8')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x5488('0x8')]('yes','no'),'defaultValue':_0x5488('0x9'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0x5488('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x5488('0x8')](_0x5488('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x5488('0x8')]('yes','no'),'defaultValue':_0x5488('0x9'),'allowNull':![]},'stamp':{'type':_0x5488('0xb')},'emailsubject':{'type':Sequelize[_0x5488('0x1')]},'emailbody':{'type':Sequelize[_0x5488('0x1')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x5488('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x5488('0xd')],'get':function(){return this[_0x5488('0xe')](_0x5488('0xf'))+_0x5488('0x10')+this[_0x5488('0xe')](_0x5488('0x11'));}}}; \ No newline at end of file +var _0x1707=['trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string'];(function(_0x46d87a,_0x5183db){var _0x115296=function(_0x880a1c){while(--_0x880a1c){_0x46d87a['push'](_0x46d87a['shift']());}};_0x115296(++_0x5183db);}(_0x1707,0x14e));var _0x7170=function(_0xe112,_0x166655){_0xe112=_0xe112-0x0;var _0x35efe9=_0x1707[_0xe112];return _0x35efe9;};'use strict';var Sequelize=require(_0x7170('0x0'));module[_0x7170('0x1')]={'customer_id':{'type':Sequelize[_0x7170('0x2')]},'context':{'type':Sequelize[_0x7170('0x2')],'defaultValue':_0x7170('0x3'),'unique':_0x7170('0x4')},'mailbox':{'type':Sequelize[_0x7170('0x2')],'defaultValue':'','allowNull':![],'unique':_0x7170('0x4')},'password':{'type':Sequelize[_0x7170('0x2')]},'fullname':{'type':Sequelize[_0x7170('0x2')]},'email':{'type':Sequelize[_0x7170('0x2')],'validate':{'isEmail':!![]},'set':function(_0x39c3b1){this[_0x7170('0x5')](_0x7170('0x6'),typeof _0x39c3b1===_0x7170('0x7')&&_0x39c3b1[_0x7170('0x8')]()?_0x39c3b1[_0x7170('0x8')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x7170('0x2')],'defaultValue':_0x7170('0x9')},'attach':{'type':Sequelize[_0x7170('0xa')]('yes','no'),'defaultValue':_0x7170('0xb'),'allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x7170('0xb'),'no'),'defaultValue':_0x7170('0xb'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0x7170('0x2')]},'review':{'type':Sequelize['ENUM'](_0x7170('0xb'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x7170('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x7170('0xb'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x7170('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x7170('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0x7170('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x7170('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x7170('0xa')](_0x7170('0xb'),'no'),'defaultValue':_0x7170('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0x7170('0xa')](_0x7170('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x7170('0xa')](_0x7170('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x7170('0xa')](_0x7170('0xb'),'no'),'defaultValue':_0x7170('0xb'),'allowNull':![]},'stamp':{'type':_0x7170('0xd')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x7170('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x7170('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x7170('0xf')],'get':function(){return this[_0x7170('0x10')](_0x7170('0x11'))+_0x7170('0x12')+this[_0x7170('0x10')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 12b387f..d57e8d7 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 _0xa478=['UserProfileResource','destroy','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','where','merge','VIRTUAL','filter','options','includeAll','include','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','catch','error','getMessages','findOne','VoiceMailMessage','pick','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','get','Voicemails'];(function(_0x524e28,_0x1992af){var _0x10ccdc=function(_0x31cd97){while(--_0x31cd97){_0x524e28['push'](_0x524e28['shift']());}};_0x10ccdc(++_0x1992af);}(_0xa478,0x136));var _0x8a47=function(_0x5c4e16,_0x113035){_0x5c4e16=_0x5c4e16-0x0;var _0x36044a=_0xa478[_0x5c4e16];return _0x36044a;};'use strict';var emlformat=require(_0x8a47('0x0'));var rimraf=require(_0x8a47('0x1'));var zipdir=require(_0x8a47('0x2'));var jsonpatch=require(_0x8a47('0x3'));var rp=require(_0x8a47('0x4'));var moment=require(_0x8a47('0x5'));var BPromise=require(_0x8a47('0x6'));var Mustache=require(_0x8a47('0x7'));var util=require(_0x8a47('0x8'));var path=require(_0x8a47('0x9'));var sox=require(_0x8a47('0xa'));var csv=require(_0x8a47('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8a47('0xc'));var _=require(_0x8a47('0xd'));var squel=require(_0x8a47('0xe'));var crypto=require(_0x8a47('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8a47('0x10'));var toCsv=require('to-csv');var querystring=require(_0x8a47('0x11'));var Papa=require(_0x8a47('0x12'));var Redis=require(_0x8a47('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x8a47('0x14'));var as=require(_0x8a47('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a47('0x16'))('api');var utils=require(_0x8a47('0x17'));var config=require(_0x8a47('0x18'));var licenseUtil=require(_0x8a47('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e3166,_0x59efc7){_0x59efc7=_0x59efc7||0xcc;return function(_0x36941a){if(_0x36941a){return _0x5e3166[_0x8a47('0x1a')](_0x59efc7);}return _0x5e3166['status'](_0x59efc7)[_0x8a47('0x1b')]();};}function respondWithResult(_0x28bbc5,_0x1a9a6f){_0x1a9a6f=_0x1a9a6f||0xc8;return function(_0x55985c){if(_0x55985c){return _0x28bbc5[_0x8a47('0x1c')](_0x1a9a6f)[_0x8a47('0x1d')](_0x55985c);}};}function respondWithFilteredResult(_0x2f682e,_0x1c8488){return function(_0x41bdaf){if(_0x41bdaf){var _0x18f2be=typeof _0x1c8488[_0x8a47('0x1e')]===_0x8a47('0x1f')&&typeof _0x1c8488[_0x8a47('0x20')]==='undefined';var _0x20fbf7=_0x41bdaf[_0x8a47('0x21')];var _0x3f9093=_0x18f2be?0x0:_0x1c8488['offset'];var _0x341089=_0x18f2be?_0x41bdaf['count']:_0x1c8488['offset']+_0x1c8488[_0x8a47('0x20')];var _0x2174b1;if(_0x341089>=_0x20fbf7){_0x341089=_0x20fbf7;_0x2174b1=0xc8;}else{_0x2174b1=0xce;}_0x2f682e[_0x8a47('0x1c')](_0x2174b1);return _0x2f682e[_0x8a47('0x22')](_0x8a47('0x23'),_0x3f9093+'-'+_0x341089+'/'+_0x20fbf7)[_0x8a47('0x1d')](_0x41bdaf);}return null;};}function patchUpdates(_0x44e119){return function(_0x1bbed6){try{jsonpatch[_0x8a47('0x24')](_0x1bbed6,_0x44e119,!![]);}catch(_0xc2065a){return BPromise['reject'](_0xc2065a);}return _0x1bbed6[_0x8a47('0x25')]();};}function saveUpdates(_0x5923ec,_0x289f28){return function(_0x3d7993){if(_0x3d7993){return _0x3d7993[_0x8a47('0x26')](_0x5923ec)[_0x8a47('0x27')](function(_0x5d4b6c){return _0x5d4b6c;});}return null;};}function removeEntity(_0x116b5e,_0x5ae186){return function(_0x50f6ba){if(_0x50f6ba){return _0x50f6ba['destroy']()['then'](function(){var _0xf46d2c=_0x50f6ba[_0x8a47('0x28')]({'plain':!![]});var _0x5bed3e=_0x8a47('0x29');return db[_0x8a47('0x2a')][_0x8a47('0x2b')]({'where':{'type':_0x5bed3e,'resourceId':_0xf46d2c['id']}})[_0x8a47('0x27')](function(){return _0x50f6ba;});})[_0x8a47('0x27')](function(){_0x116b5e[_0x8a47('0x1c')](0xcc)[_0x8a47('0x1b')]();});}};}function handleEntityNotFound(_0x576fb3,_0x22a52f){return function(_0x4a10c3){if(!_0x4a10c3){_0x576fb3[_0x8a47('0x1a')](0x194);}return _0x4a10c3;};}function handleError(_0x3a8685,_0x54d4b2){_0x54d4b2=_0x54d4b2||0x1f4;return function(_0x1e89b1){logger['error'](_0x1e89b1['stack']);if(_0x1e89b1[_0x8a47('0x2c')]){delete _0x1e89b1[_0x8a47('0x2c')];}_0x3a8685[_0x8a47('0x1c')](_0x54d4b2)[_0x8a47('0x2d')](_0x1e89b1);};}exports[_0x8a47('0x2e')]=function(_0x18bfd3,_0x58aa06){var _0x353576={},_0x4d78b5={},_0x549913={'count':0x0,'rows':[]};var _0x448459=_[_0x8a47('0x2f')](db[_0x8a47('0x30')][_0x8a47('0x31')],function(_0x16e024){return{'name':_0x16e024[_0x8a47('0x32')],'type':_0x16e024[_0x8a47('0x33')][_0x8a47('0x34')]};});_0x4d78b5[_0x8a47('0x35')]=_[_0x8a47('0x2f')](_0x448459,'name');_0x4d78b5[_0x8a47('0x36')]=_[_0x8a47('0x37')](_0x18bfd3[_0x8a47('0x36')]);_0x4d78b5['filters']=_[_0x8a47('0x38')](_0x4d78b5[_0x8a47('0x35')],_0x4d78b5['query']);_0x353576[_0x8a47('0x39')]=_[_0x8a47('0x38')](_0x4d78b5[_0x8a47('0x35')],qs[_0x8a47('0x3a')](_0x18bfd3['query']['fields']));_0x353576[_0x8a47('0x39')]=_0x353576[_0x8a47('0x39')][_0x8a47('0x3b')]?_0x353576[_0x8a47('0x39')]:_0x4d78b5[_0x8a47('0x35')];if(!_0x18bfd3[_0x8a47('0x36')][_0x8a47('0x3c')]('nolimit')){_0x353576['limit']=qs[_0x8a47('0x20')](_0x18bfd3[_0x8a47('0x36')][_0x8a47('0x20')]);_0x353576[_0x8a47('0x1e')]=qs[_0x8a47('0x1e')](_0x18bfd3[_0x8a47('0x36')][_0x8a47('0x1e')]);}_0x353576[_0x8a47('0x3d')]=qs[_0x8a47('0x3e')](_0x18bfd3[_0x8a47('0x36')][_0x8a47('0x3e')]);_0x353576['where']=qs[_0x8a47('0x3f')](_['pick'](_0x18bfd3['query'],_0x4d78b5['filters']),_0x448459);if(_0x18bfd3['query']['filter']){_0x353576[_0x8a47('0x40')]=_[_0x8a47('0x41')](_0x353576[_0x8a47('0x40')],{'$or':_[_0x8a47('0x2f')](_0x448459,function(_0x10c483){if(_0x10c483[_0x8a47('0x33')]!==_0x8a47('0x42')){var _0x29beee={};_0x29beee[_0x10c483['name']]={'$like':'%'+_0x18bfd3['query'][_0x8a47('0x43')]+'%'};return _0x29beee;}})});}_0x353576=_[_0x8a47('0x41')]({},_0x353576,_0x18bfd3[_0x8a47('0x44')]);var _0x19298d={'where':_0x353576['where']};return db[_0x8a47('0x30')][_0x8a47('0x21')](_0x19298d)[_0x8a47('0x27')](function(_0x369dd5){_0x549913[_0x8a47('0x21')]=_0x369dd5;if(_0x18bfd3['query'][_0x8a47('0x45')]){_0x353576[_0x8a47('0x46')]=[{'all':!![]}];}return db[_0x8a47('0x30')]['findAll'](_0x353576);})[_0x8a47('0x27')](function(_0x2c70ea){_0x549913[_0x8a47('0x47')]=_0x2c70ea;return _0x549913;})[_0x8a47('0x27')](respondWithFilteredResult(_0x58aa06,_0x353576))['catch'](handleError(_0x58aa06,null));};exports[_0x8a47('0x48')]=function(_0x2f523f,_0x2fa701){var _0x2e2520={'raw':!![],'where':{'id':_0x2f523f[_0x8a47('0x49')]['id']}},_0x22b0d6={};_0x22b0d6['model']=_['keys'](db[_0x8a47('0x30')][_0x8a47('0x31')]);_0x22b0d6[_0x8a47('0x36')]=_['keys'](_0x2f523f[_0x8a47('0x36')]);_0x22b0d6[_0x8a47('0x3f')]=_['intersection'](_0x22b0d6['model'],_0x22b0d6[_0x8a47('0x36')]);_0x2e2520['attributes']=_[_0x8a47('0x38')](_0x22b0d6[_0x8a47('0x35')],qs[_0x8a47('0x3a')](_0x2f523f[_0x8a47('0x36')][_0x8a47('0x3a')]));_0x2e2520[_0x8a47('0x39')]=_0x2e2520['attributes']['length']?_0x2e2520[_0x8a47('0x39')]:_0x22b0d6[_0x8a47('0x35')];if(_0x2f523f[_0x8a47('0x36')][_0x8a47('0x45')]){_0x2e2520[_0x8a47('0x46')]=[{'all':!![]}];}_0x2e2520=_['merge']({},_0x2e2520,_0x2f523f['options']);return db[_0x8a47('0x30')]['find'](_0x2e2520)[_0x8a47('0x27')](handleEntityNotFound(_0x2fa701,null))[_0x8a47('0x27')](respondWithResult(_0x2fa701,null))['catch'](handleError(_0x2fa701,null));};exports[_0x8a47('0x4a')]=function(_0x237ed1,_0x14e22c){return db[_0x8a47('0x30')][_0x8a47('0x4a')](_0x237ed1[_0x8a47('0x4b')],{})[_0x8a47('0x27')](function(_0x2d2455){var _0x512938=_0x237ed1[_0x8a47('0x4c')][_0x8a47('0x28')]({'plain':!![]});if(!_0x512938)throw new Error(_0x8a47('0x4d'));if(_0x512938[_0x8a47('0x4e')]==='user'){var _0x11db4e=_0x2d2455[_0x8a47('0x28')]({'plain':!![]});var _0x24e123=_0x8a47('0x29');return db[_0x8a47('0x4f')][_0x8a47('0x50')]({'where':{'name':_0x24e123,'userProfileId':_0x512938['userProfileId']},'raw':!![]})['then'](function(_0x456cfb){if(_0x456cfb&&_0x456cfb['autoAssociation']===0x0){return db[_0x8a47('0x2a')][_0x8a47('0x4a')]({'name':_0x11db4e['name'],'resourceId':_0x11db4e['id'],'type':_0x456cfb[_0x8a47('0x2c')],'sectionId':_0x456cfb['id']},{})['then'](function(){return _0x2d2455;});}else{return _0x2d2455;}})[_0x8a47('0x51')](function(_0x5c5577){logger[_0x8a47('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c5577);throw _0x5c5577;});}return _0x2d2455;})[_0x8a47('0x27')](respondWithResult(_0x14e22c,0xc9))[_0x8a47('0x51')](handleError(_0x14e22c,null));};exports[_0x8a47('0x26')]=function(_0x144ce6,_0x4590ae){if(_0x144ce6[_0x8a47('0x4b')]['id']){delete _0x144ce6[_0x8a47('0x4b')]['id'];}return db[_0x8a47('0x30')][_0x8a47('0x50')]({'where':{'id':_0x144ce6[_0x8a47('0x49')]['id']}})[_0x8a47('0x27')](handleEntityNotFound(_0x4590ae,null))['then'](saveUpdates(_0x144ce6[_0x8a47('0x4b')],null))[_0x8a47('0x27')](respondWithResult(_0x4590ae,null))['catch'](handleError(_0x4590ae,null));};exports[_0x8a47('0x2b')]=function(_0x408ce2,_0x436c27){return db[_0x8a47('0x30')][_0x8a47('0x50')]({'where':{'id':_0x408ce2[_0x8a47('0x49')]['id']}})[_0x8a47('0x27')](handleEntityNotFound(_0x436c27,null))[_0x8a47('0x27')](removeEntity(_0x436c27,null))[_0x8a47('0x51')](handleError(_0x436c27,null));};exports[_0x8a47('0x53')]=function(_0x2100cb,_0x385087,_0x5f448e){return db[_0x8a47('0x30')][_0x8a47('0x54')]({'where':{'id':_0x2100cb[_0x8a47('0x49')]['id']}})[_0x8a47('0x27')](handleEntityNotFound(_0x385087,null))[_0x8a47('0x27')](function(_0x6c2f83){var _0x134fc5;var _0x3242b7={},_0x41cc36={};_0x41cc36[_0x8a47('0x35')]=_[_0x8a47('0x37')](db[_0x8a47('0x55')][_0x8a47('0x31')]);_0x41cc36[_0x8a47('0x36')]=_[_0x8a47('0x37')](_0x2100cb[_0x8a47('0x36')]);_0x41cc36['filters']=_[_0x8a47('0x38')](_0x41cc36['model'],_0x41cc36[_0x8a47('0x36')]);_0x3242b7[_0x8a47('0x39')]=_[_0x8a47('0x38')](_0x41cc36[_0x8a47('0x35')],qs[_0x8a47('0x3a')](_0x2100cb[_0x8a47('0x36')]['fields']));_0x3242b7[_0x8a47('0x39')]=_0x3242b7[_0x8a47('0x39')][_0x8a47('0x3b')]?_0x3242b7['attributes']:_0x41cc36['model'];if(!_0x2100cb[_0x8a47('0x36')][_0x8a47('0x3c')]('nolimit')){_0x3242b7[_0x8a47('0x20')]=qs[_0x8a47('0x20')](_0x2100cb[_0x8a47('0x36')][_0x8a47('0x20')]);_0x3242b7[_0x8a47('0x1e')]=qs[_0x8a47('0x1e')](_0x2100cb[_0x8a47('0x36')][_0x8a47('0x1e')]);}_0x3242b7[_0x8a47('0x3d')]=qs[_0x8a47('0x3e')](_0x2100cb[_0x8a47('0x36')][_0x8a47('0x3e')]);_0x3242b7[_0x8a47('0x40')]=qs['filters'](_[_0x8a47('0x56')](_0x2100cb[_0x8a47('0x36')],_0x41cc36[_0x8a47('0x3f')]));if(_0x2100cb[_0x8a47('0x36')][_0x8a47('0x43')]){_0x3242b7[_0x8a47('0x40')]=_['merge'](_0x3242b7[_0x8a47('0x40')],{'$or':_['map'](_0x3242b7['attributes'],function(_0x400c4e){var _0x439172={};_0x439172[_0x400c4e]={'$like':'%'+_0x2100cb[_0x8a47('0x36')][_0x8a47('0x43')]+'%'};return _0x439172;})});}_0x3242b7[_0x8a47('0x40')]=_[_0x8a47('0x41')](_0x3242b7['where'],{'mailboxuser':_0x6c2f83['mailbox']});_0x3242b7=_[_0x8a47('0x41')]({},_0x3242b7,_0x2100cb['options']);return db[_0x8a47('0x55')][_0x8a47('0x57')](_0x3242b7)[_0x8a47('0x27')](respondWithFilteredResult(_0x385087,_0x3242b7));})[_0x8a47('0x51')](handleError(_0x385087,null));}; \ No newline at end of file +var _0x69d3=['Voicemails','UserProfileResource','error','name','send','index','map','VoiceMail','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','findAll','catch','show','params','include','options','find','create','body','user','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','VoiceMailMessage','mailbox','eml-format','rimraf','zip-dir','request-promise','moment','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','destroy','then'];(function(_0x299b15,_0x4ae4f9){var _0x30da73=function(_0x5b7df1){while(--_0x5b7df1){_0x299b15['push'](_0x299b15['shift']());}};_0x30da73(++_0x4ae4f9);}(_0x69d3,0xda));var _0x369d=function(_0x46c37c,_0x46f115){_0x46c37c=_0x46c37c-0x0;var _0x169c0a=_0x69d3[_0x46c37c];return _0x169c0a;};'use strict';var emlformat=require(_0x369d('0x0'));var rimraf=require(_0x369d('0x1'));var zipdir=require(_0x369d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x369d('0x3'));var moment=require(_0x369d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x369d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x369d('0x6'));var ejs=require(_0x369d('0x7'));var fs=require('fs');var fs_extra=require(_0x369d('0x8'));var _=require(_0x369d('0x9'));var squel=require(_0x369d('0xa'));var crypto=require(_0x369d('0xb'));var jsforce=require(_0x369d('0xc'));var deskjs=require(_0x369d('0xd'));var toCsv=require(_0x369d('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x369d('0xe'));var authService=require(_0x369d('0xf'));var qs=require(_0x369d('0x10'));var as=require(_0x369d('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x369d('0x12'));var utils=require(_0x369d('0x13'));var config=require(_0x369d('0x14'));var licenseUtil=require(_0x369d('0x15'));var db=require(_0x369d('0x16'))['db'];function respondWithStatusCode(_0xee549e,_0x52c126){_0x52c126=_0x52c126||0xcc;return function(_0x15b417){if(_0x15b417){return _0xee549e[_0x369d('0x17')](_0x52c126);}return _0xee549e[_0x369d('0x18')](_0x52c126)[_0x369d('0x19')]();};}function respondWithResult(_0x121307,_0x539536){_0x539536=_0x539536||0xc8;return function(_0x5cd4c3){if(_0x5cd4c3){return _0x121307['status'](_0x539536)[_0x369d('0x1a')](_0x5cd4c3);}};}function respondWithFilteredResult(_0xa126c1,_0x389c43){return function(_0x5b4f55){if(_0x5b4f55){var _0x2c1a4a=typeof _0x389c43[_0x369d('0x1b')]===_0x369d('0x1c')&&typeof _0x389c43['limit']===_0x369d('0x1c');var _0x1f37ff=_0x5b4f55['count'];var _0x572513=_0x2c1a4a?0x0:_0x389c43['offset'];var _0x2946be=_0x2c1a4a?_0x5b4f55[_0x369d('0x1d')]:_0x389c43[_0x369d('0x1b')]+_0x389c43['limit'];var _0x410dbe;if(_0x2946be>=_0x1f37ff){_0x2946be=_0x1f37ff;_0x410dbe=0xc8;}else{_0x410dbe=0xce;}_0xa126c1[_0x369d('0x18')](_0x410dbe);return _0xa126c1[_0x369d('0x1e')](_0x369d('0x1f'),_0x572513+'-'+_0x2946be+'/'+_0x1f37ff)[_0x369d('0x1a')](_0x5b4f55);}return null;};}function patchUpdates(_0x538ca4){return function(_0x5c9fdd){try{jsonpatch[_0x369d('0x20')](_0x5c9fdd,_0x538ca4,!![]);}catch(_0x1edcd5){return BPromise[_0x369d('0x21')](_0x1edcd5);}return _0x5c9fdd[_0x369d('0x22')]();};}function saveUpdates(_0x84cc0f,_0x15fbef){return function(_0x1b262a){if(_0x1b262a){return _0x1b262a['update'](_0x84cc0f)['then'](function(_0x32ef9a){return _0x32ef9a;});}return null;};}function removeEntity(_0xed16e,_0xf7bc3a){return function(_0xcae58){if(_0xcae58){return _0xcae58[_0x369d('0x23')]()[_0x369d('0x24')](function(){var _0x36cf04=_0xcae58['get']({'plain':!![]});var _0x4dfe83=_0x369d('0x25');return db[_0x369d('0x26')][_0x369d('0x23')]({'where':{'type':_0x4dfe83,'resourceId':_0x36cf04['id']}})[_0x369d('0x24')](function(){return _0xcae58;});})[_0x369d('0x24')](function(){_0xed16e[_0x369d('0x18')](0xcc)[_0x369d('0x19')]();});}};}function handleEntityNotFound(_0x570db4,_0x23656b){return function(_0xe95742){if(!_0xe95742){_0x570db4[_0x369d('0x17')](0x194);}return _0xe95742;};}function handleError(_0xf952a3,_0x345be5){_0x345be5=_0x345be5||0x1f4;return function(_0x41367a){logger[_0x369d('0x27')](_0x41367a['stack']);if(_0x41367a[_0x369d('0x28')]){delete _0x41367a['name'];}_0xf952a3['status'](_0x345be5)[_0x369d('0x29')](_0x41367a);};}exports[_0x369d('0x2a')]=function(_0x5844c7,_0x104540){var _0x5a14ce={},_0x37274f={},_0x39d656={'count':0x0,'rows':[]};var _0xe45219=_[_0x369d('0x2b')](db[_0x369d('0x2c')][_0x369d('0x2d')],function(_0x119c00){return{'name':_0x119c00['fieldName'],'type':_0x119c00[_0x369d('0x2e')][_0x369d('0x2f')]};});_0x37274f[_0x369d('0x30')]=_[_0x369d('0x2b')](_0xe45219,_0x369d('0x28'));_0x37274f[_0x369d('0x31')]=_[_0x369d('0x32')](_0x5844c7[_0x369d('0x31')]);_0x37274f['filters']=_[_0x369d('0x33')](_0x37274f[_0x369d('0x30')],_0x37274f[_0x369d('0x31')]);_0x5a14ce[_0x369d('0x34')]=_[_0x369d('0x33')](_0x37274f['model'],qs[_0x369d('0x35')](_0x5844c7[_0x369d('0x31')][_0x369d('0x35')]));_0x5a14ce[_0x369d('0x34')]=_0x5a14ce[_0x369d('0x34')][_0x369d('0x36')]?_0x5a14ce['attributes']:_0x37274f[_0x369d('0x30')];if(!_0x5844c7[_0x369d('0x31')][_0x369d('0x37')](_0x369d('0x38'))){_0x5a14ce[_0x369d('0x39')]=qs[_0x369d('0x39')](_0x5844c7[_0x369d('0x31')][_0x369d('0x39')]);_0x5a14ce[_0x369d('0x1b')]=qs[_0x369d('0x1b')](_0x5844c7[_0x369d('0x31')][_0x369d('0x1b')]);}_0x5a14ce[_0x369d('0x3a')]=qs[_0x369d('0x3b')](_0x5844c7[_0x369d('0x31')][_0x369d('0x3b')]);_0x5a14ce[_0x369d('0x3c')]=qs[_0x369d('0x3d')](_[_0x369d('0x3e')](_0x5844c7[_0x369d('0x31')],_0x37274f[_0x369d('0x3d')]),_0xe45219);if(_0x5844c7[_0x369d('0x31')][_0x369d('0x3f')]){_0x5a14ce[_0x369d('0x3c')]=_['merge'](_0x5a14ce['where'],{'$or':_[_0x369d('0x2b')](_0xe45219,function(_0x319e5d){if(_0x319e5d[_0x369d('0x2e')]!==_0x369d('0x40')){var _0x3afa89={};_0x3afa89[_0x319e5d[_0x369d('0x28')]]={'$like':'%'+_0x5844c7[_0x369d('0x31')][_0x369d('0x3f')]+'%'};return _0x3afa89;}})});}_0x5a14ce=_[_0x369d('0x41')]({},_0x5a14ce,_0x5844c7['options']);var _0x322b13={'where':_0x5a14ce[_0x369d('0x3c')]};return db[_0x369d('0x2c')][_0x369d('0x1d')](_0x322b13)[_0x369d('0x24')](function(_0x25cf4e){_0x39d656[_0x369d('0x1d')]=_0x25cf4e;if(_0x5844c7[_0x369d('0x31')]['includeAll']){_0x5a14ce['include']=[{'all':!![]}];}return db[_0x369d('0x2c')][_0x369d('0x42')](_0x5a14ce);})[_0x369d('0x24')](function(_0x4dad71){_0x39d656['rows']=_0x4dad71;return _0x39d656;})['then'](respondWithFilteredResult(_0x104540,_0x5a14ce))[_0x369d('0x43')](handleError(_0x104540,null));};exports[_0x369d('0x44')]=function(_0x55dfde,_0xe7ba64){var _0x430040={'raw':!![],'where':{'id':_0x55dfde[_0x369d('0x45')]['id']}},_0x102a65={};_0x102a65['model']=_[_0x369d('0x32')](db['VoiceMail'][_0x369d('0x2d')]);_0x102a65['query']=_[_0x369d('0x32')](_0x55dfde[_0x369d('0x31')]);_0x102a65[_0x369d('0x3d')]=_['intersection'](_0x102a65['model'],_0x102a65[_0x369d('0x31')]);_0x430040[_0x369d('0x34')]=_[_0x369d('0x33')](_0x102a65['model'],qs[_0x369d('0x35')](_0x55dfde[_0x369d('0x31')][_0x369d('0x35')]));_0x430040[_0x369d('0x34')]=_0x430040[_0x369d('0x34')][_0x369d('0x36')]?_0x430040[_0x369d('0x34')]:_0x102a65[_0x369d('0x30')];if(_0x55dfde[_0x369d('0x31')]['includeAll']){_0x430040[_0x369d('0x46')]=[{'all':!![]}];}_0x430040=_[_0x369d('0x41')]({},_0x430040,_0x55dfde[_0x369d('0x47')]);return db[_0x369d('0x2c')][_0x369d('0x48')](_0x430040)[_0x369d('0x24')](handleEntityNotFound(_0xe7ba64,null))['then'](respondWithResult(_0xe7ba64,null))[_0x369d('0x43')](handleError(_0xe7ba64,null));};exports[_0x369d('0x49')]=function(_0x16dd8f,_0x44a357){return db[_0x369d('0x2c')][_0x369d('0x49')](_0x16dd8f[_0x369d('0x4a')],{})[_0x369d('0x24')](function(_0x3f8a54){var _0x3c15cb=_0x16dd8f[_0x369d('0x4b')][_0x369d('0x4c')]({'plain':!![]});if(!_0x3c15cb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c15cb[_0x369d('0x4d')]===_0x369d('0x4b')){var _0x289eb8=_0x3f8a54[_0x369d('0x4c')]({'plain':!![]});var _0x648a0d='Voicemails';return db[_0x369d('0x4e')]['find']({'where':{'name':_0x648a0d,'userProfileId':_0x3c15cb[_0x369d('0x4f')]},'raw':!![]})[_0x369d('0x24')](function(_0x22b594){if(_0x22b594&&_0x22b594[_0x369d('0x50')]===0x0){return db[_0x369d('0x26')][_0x369d('0x49')]({'name':_0x289eb8[_0x369d('0x28')],'resourceId':_0x289eb8['id'],'type':_0x22b594[_0x369d('0x28')],'sectionId':_0x22b594['id']},{})[_0x369d('0x24')](function(){return _0x3f8a54;});}else{return _0x3f8a54;}})[_0x369d('0x43')](function(_0x4d582a){logger['error'](_0x369d('0x51'),_0x4d582a);throw _0x4d582a;});}return _0x3f8a54;})[_0x369d('0x24')](respondWithResult(_0x44a357,0xc9))[_0x369d('0x43')](handleError(_0x44a357,null));};exports[_0x369d('0x52')]=function(_0x347df4,_0x5cd43f){if(_0x347df4['body']['id']){delete _0x347df4[_0x369d('0x4a')]['id'];}return db[_0x369d('0x2c')]['find']({'where':{'id':_0x347df4[_0x369d('0x45')]['id']}})['then'](handleEntityNotFound(_0x5cd43f,null))[_0x369d('0x24')](saveUpdates(_0x347df4[_0x369d('0x4a')],null))[_0x369d('0x24')](respondWithResult(_0x5cd43f,null))['catch'](handleError(_0x5cd43f,null));};exports[_0x369d('0x23')]=function(_0x145ba8,_0x45ac3c){return db[_0x369d('0x2c')]['find']({'where':{'id':_0x145ba8['params']['id']}})[_0x369d('0x24')](handleEntityNotFound(_0x45ac3c,null))[_0x369d('0x24')](removeEntity(_0x45ac3c,null))[_0x369d('0x43')](handleError(_0x45ac3c,null));};exports['getMessages']=function(_0x43afd7,_0x2dbbee,_0x402aae){return db['VoiceMail']['findOne']({'where':{'id':_0x43afd7[_0x369d('0x45')]['id']}})[_0x369d('0x24')](handleEntityNotFound(_0x2dbbee,null))[_0x369d('0x24')](function(_0x158ce7){var _0x5408b3;var _0x33bba6={},_0x1fa6bb={};_0x1fa6bb[_0x369d('0x30')]=_[_0x369d('0x32')](db[_0x369d('0x53')]['rawAttributes']);_0x1fa6bb[_0x369d('0x31')]=_[_0x369d('0x32')](_0x43afd7[_0x369d('0x31')]);_0x1fa6bb['filters']=_[_0x369d('0x33')](_0x1fa6bb['model'],_0x1fa6bb[_0x369d('0x31')]);_0x33bba6['attributes']=_['intersection'](_0x1fa6bb['model'],qs['fields'](_0x43afd7[_0x369d('0x31')]['fields']));_0x33bba6[_0x369d('0x34')]=_0x33bba6['attributes'][_0x369d('0x36')]?_0x33bba6[_0x369d('0x34')]:_0x1fa6bb[_0x369d('0x30')];if(!_0x43afd7['query'][_0x369d('0x37')](_0x369d('0x38'))){_0x33bba6[_0x369d('0x39')]=qs[_0x369d('0x39')](_0x43afd7[_0x369d('0x31')][_0x369d('0x39')]);_0x33bba6['offset']=qs[_0x369d('0x1b')](_0x43afd7['query']['offset']);}_0x33bba6['order']=qs[_0x369d('0x3b')](_0x43afd7[_0x369d('0x31')][_0x369d('0x3b')]);_0x33bba6[_0x369d('0x3c')]=qs[_0x369d('0x3d')](_[_0x369d('0x3e')](_0x43afd7[_0x369d('0x31')],_0x1fa6bb[_0x369d('0x3d')]));if(_0x43afd7[_0x369d('0x31')][_0x369d('0x3f')]){_0x33bba6[_0x369d('0x3c')]=_[_0x369d('0x41')](_0x33bba6[_0x369d('0x3c')],{'$or':_[_0x369d('0x2b')](_0x33bba6[_0x369d('0x34')],function(_0x46f58a){var _0x4fe1b6={};_0x4fe1b6[_0x46f58a]={'$like':'%'+_0x43afd7[_0x369d('0x31')]['filter']+'%'};return _0x4fe1b6;})});}_0x33bba6[_0x369d('0x3c')]=_[_0x369d('0x41')](_0x33bba6[_0x369d('0x3c')],{'mailboxuser':_0x158ce7[_0x369d('0x54')]});_0x33bba6=_[_0x369d('0x41')]({},_0x33bba6,_0x43afd7['options']);return db[_0x369d('0x53')]['findAndCountAll'](_0x33bba6)['then'](respondWithFilteredResult(_0x2dbbee,_0x33bba6));})[_0x369d('0x43')](handleError(_0x2dbbee,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 110862a..f80827b 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 _0x34cf=['bluebird','request-promise','path','rimraf','./voiceMail.attributes','exports','define','VoiceMail','mailbox_context','mailbox','util','../../config/logger'];(function(_0x3abdcf,_0x15b602){var _0x2ed52b=function(_0x3ee7f0){while(--_0x3ee7f0){_0x3abdcf['push'](_0x3abdcf['shift']());}};_0x2ed52b(++_0x15b602);}(_0x34cf,0x9a));var _0xf34c=function(_0x40e1f5,_0x4d480f){_0x40e1f5=_0x40e1f5-0x0;var _0x473b7e=_0x34cf[_0x40e1f5];return _0x473b7e;};'use strict';var _=require('lodash');var util=require(_0xf34c('0x0'));var logger=require(_0xf34c('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf34c('0x2'));var rp=require(_0xf34c('0x3'));var fs=require('fs');var path=require(_0xf34c('0x4'));var rimraf=require(_0xf34c('0x5'));var config=require('../../config/environment');var attributes=require(_0xf34c('0x6'));module[_0xf34c('0x7')]=function(_0x225513,_0xdf85da){return _0x225513[_0xf34c('0x8')](_0xf34c('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0xf34c('0xa'),'fields':[_0xf34c('0xb'),'context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x2e09=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash'];(function(_0x2ac4af,_0x288c53){var _0x3a36df=function(_0x271b11){while(--_0x271b11){_0x2ac4af['push'](_0x2ac4af['shift']());}};_0x3a36df(++_0x288c53);}(_0x2e09,0xed));var _0x92e0=function(_0x5b52e5,_0x578460){_0x5b52e5=_0x5b52e5-0x0;var _0x3b4f6d=_0x2e09[_0x5b52e5];return _0x3b4f6d;};'use strict';var _=require(_0x92e0('0x0'));var util=require('util');var logger=require(_0x92e0('0x1'))(_0x92e0('0x2'));var moment=require('moment');var BPromise=require(_0x92e0('0x3'));var rp=require(_0x92e0('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x92e0('0x5'));var config=require(_0x92e0('0x6'));var attributes=require(_0x92e0('0x7'));module[_0x92e0('0x8')]=function(_0x465c06,_0x5d2d83){return _0x465c06['define'](_0x92e0('0x9'),attributes,{'tableName':_0x92e0('0xa'),'paranoid':![],'indexes':[{'name':_0x92e0('0xb'),'fields':[_0x92e0('0xc'),_0x92e0('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 75991f1..ba151d6 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 _0x955b=['randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','VoiceMail,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x5e2953,_0x79755){var _0x44608c=function(_0x1a20d6){while(--_0x1a20d6){_0x5e2953['push'](_0x5e2953['shift']());}};_0x44608c(++_0x79755);}(_0x955b,0x1dc));var _0xb955=function(_0x258238,_0x219494){_0x258238=_0x258238-0x0;var _0x126c77=_0x955b[_0x258238];return _0x126c77;};'use strict';var _=require(_0xb955('0x0'));var util=require(_0xb955('0x1'));var moment=require(_0xb955('0x2'));var BPromise=require(_0xb955('0x3'));var rs=require(_0xb955('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb955('0x5'))['db'];var utils=require(_0xb955('0x6'));var logger=require('../../config/logger')(_0xb955('0x7'));var config=require(_0xb955('0x8'));var jayson=require(_0xb955('0x9'));var client=jayson['client'][_0xb955('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d589d,_0x247033,_0x5b73f7){return new BPromise(function(_0x5ae251,_0x888f76){return client[_0xb955('0xb')](_0x2d589d,_0x5b73f7)['then'](function(_0x59c5ce){logger[_0xb955('0xc')](_0xb955('0xd'),_0x247033,_0xb955('0xe'));logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x247033,_0xb955('0xe'),JSON[_0xb955('0xf')](_0x59c5ce));if(_0x59c5ce['error']){if(_0x59c5ce[_0xb955('0x10')]['code']===0x1f4){logger[_0xb955('0x10')](_0xb955('0xd'),_0x247033,_0x59c5ce[_0xb955('0x10')][_0xb955('0x11')]);return _0x888f76(_0x59c5ce[_0xb955('0x10')][_0xb955('0x11')]);}logger[_0xb955('0x10')]('VoiceMail,\x20%s,\x20%s',_0x247033,_0x59c5ce[_0xb955('0x10')][_0xb955('0x11')]);return _0x5ae251(_0x59c5ce['error'][_0xb955('0x11')]);}else{logger[_0xb955('0xc')]('VoiceMail,\x20%s,\x20%s',_0x247033,_0xb955('0xe'));_0x5ae251(_0x59c5ce[_0xb955('0x12')][_0xb955('0x11')]);}})[_0xb955('0x13')](function(_0x18b750){logger['error'](_0xb955('0xd'),_0x247033,_0x18b750);_0x888f76(_0x18b750);});});} \ No newline at end of file +var _0x8281=['VoiceMail,\x20%s,\x20%s,\x20%s','error','VoiceMail,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug'];(function(_0x5224ba,_0x3fb4e1){var _0x459bd2=function(_0x61be43){while(--_0x61be43){_0x5224ba['push'](_0x5224ba['shift']());}};_0x459bd2(++_0x3fb4e1);}(_0x8281,0x1aa));var _0x1828=function(_0x3d751e,_0x442833){_0x3d751e=_0x3d751e-0x0;var _0x4faa3c=_0x8281[_0x3d751e];return _0x4faa3c;};'use strict';var _=require(_0x1828('0x0'));var util=require('util');var moment=require(_0x1828('0x1'));var BPromise=require(_0x1828('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1828('0x3'));var db=require(_0x1828('0x4'))['db'];var utils=require(_0x1828('0x5'));var logger=require(_0x1828('0x6'))('rpc');var config=require(_0x1828('0x7'));var jayson=require(_0x1828('0x8'));var client=jayson['client'][_0x1828('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd0afb3,_0xeece6c,_0x3ad00c){return new BPromise(function(_0x189355,_0x133296){return client[_0x1828('0xa')](_0xd0afb3,_0x3ad00c)[_0x1828('0xb')](function(_0x51f6d9){logger[_0x1828('0xc')]('VoiceMail,\x20%s,\x20%s',_0xeece6c,_0x1828('0xd'));logger[_0x1828('0xe')](_0x1828('0xf'),_0xeece6c,'request\x20sent',JSON['stringify'](_0x51f6d9));if(_0x51f6d9[_0x1828('0x10')]){if(_0x51f6d9[_0x1828('0x10')]['code']===0x1f4){logger[_0x1828('0x10')](_0x1828('0x11'),_0xeece6c,_0x51f6d9['error']['message']);return _0x133296(_0x51f6d9[_0x1828('0x10')][_0x1828('0x12')]);}logger['error']('VoiceMail,\x20%s,\x20%s',_0xeece6c,_0x51f6d9[_0x1828('0x10')][_0x1828('0x12')]);return _0x189355(_0x51f6d9[_0x1828('0x10')][_0x1828('0x12')]);}else{logger[_0x1828('0xc')](_0x1828('0x11'),_0xeece6c,_0x1828('0xd'));_0x189355(_0x51f6d9[_0x1828('0x13')][_0x1828('0x12')]);}})[_0x1828('0x14')](function(_0xc29239){logger['error'](_0x1828('0x11'),_0xeece6c,_0xc29239);_0x133296(_0xc29239);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 55bf9d1..2d84e24 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 _0x110c=['../../config/environment','get','index','/:id','isAuthenticated','create','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0x110c,0x1cb));var _0xc110=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x110c[_0x1cc8fe];return _0x230054;};'use strict';var multer=require(_0xc110('0x0'));var util=require(_0xc110('0x1'));var path=require(_0xc110('0x2'));var timeout=require(_0xc110('0x3'));var express=require(_0xc110('0x4'));var router=express[_0xc110('0x5')]();var fs_extra=require(_0xc110('0x6'));var auth=require(_0xc110('0x7'));var interaction=require(_0xc110('0x8'));var config=require(_0xc110('0x9'));var controller=require('./voiceMailMessage.controller');router[_0xc110('0xa')]('/',auth['isAuthenticated'](),controller[_0xc110('0xb')]);router['get'](_0xc110('0xc'),auth[_0xc110('0xd')](),controller['show']);router['get']('/:id/download',auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0xc110('0xd')](),controller[_0xc110('0xe')]);router['put'](_0xc110('0xc'),auth[_0xc110('0xd')](),controller[_0xc110('0xf')]);router['delete'](_0xc110('0xc'),auth['isAuthenticated'](),controller[_0xc110('0x10')]);module[_0xc110('0x11')]=router; \ No newline at end of file +var _0xcbda=['destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','/:id/download','download','post','create','put','update','delete','/:id'];(function(_0xac151d,_0x4ea1d2){var _0x111dba=function(_0x13d7f4){while(--_0x13d7f4){_0xac151d['push'](_0xac151d['shift']());}};_0x111dba(++_0x4ea1d2);}(_0xcbda,0xf4));var _0xacbd=function(_0x297345,_0x388810){_0x297345=_0x297345-0x0;var _0x405f39=_0xcbda[_0x297345];return _0x405f39;};'use strict';var multer=require(_0xacbd('0x0'));var util=require(_0xacbd('0x1'));var path=require('path');var timeout=require(_0xacbd('0x2'));var express=require(_0xacbd('0x3'));var router=express['Router']();var fs_extra=require(_0xacbd('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xacbd('0x5'));var config=require(_0xacbd('0x6'));var controller=require(_0xacbd('0x7'));router[_0xacbd('0x8')]('/',auth[_0xacbd('0x9')](),controller[_0xacbd('0xa')]);router[_0xacbd('0x8')]('/:id',auth[_0xacbd('0x9')](),controller[_0xacbd('0xb')]);router[_0xacbd('0x8')](_0xacbd('0xc'),auth['isAuthenticated'](),controller[_0xacbd('0xd')]);router[_0xacbd('0xe')]('/',auth['isAuthenticated'](),controller[_0xacbd('0xf')]);router[_0xacbd('0x10')]('/:id',auth[_0xacbd('0x9')](),controller[_0xacbd('0x11')]);router[_0xacbd('0x12')](_0xacbd('0x13'),auth['isAuthenticated'](),controller[_0xacbd('0x14')]);module[_0xacbd('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index ecd697f..ca6d8a6 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 _0xf809=['sequelize','exports','getDataValue','INTEGER','STRING','long','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP'];(function(_0x11fd0f,_0x2398dc){var _0x58deaf=function(_0x34b034){while(--_0x34b034){_0x11fd0f['push'](_0x11fd0f['shift']());}};_0x58deaf(++_0x2398dc);}(_0xf809,0x183));var _0x9f80=function(_0x115eda,_0x30c8f6){_0x115eda=_0x115eda-0x0;var _0x55d6a7=_0xf809[_0x115eda];return _0x55d6a7;};'use strict';var Sequelize=require(_0x9f80('0x0'));module[_0x9f80('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x795d48){return this[_0x9f80('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x9f80('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x9f80('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x9f80('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x9f80('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x9f80('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x9f80('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x9f80('0x4')],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x9f80('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x9f80('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x9f80('0x6'),'defaultValue':Sequelize[_0x9f80('0x7')](_0x9f80('0x8'))}}; \ No newline at end of file +var _0x0a67=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','TIMESTAMP','literal'];(function(_0x4e2a3e,_0x4bfa0c){var _0x59ba56=function(_0x3e99ee){while(--_0x3e99ee){_0x4e2a3e['push'](_0x4e2a3e['shift']());}};_0x59ba56(++_0x4bfa0c);}(_0x0a67,0x137));var _0x70a6=function(_0x57c085,_0x53e090){_0x57c085=_0x57c085-0x0;var _0x173a98=_0x0a67[_0x57c085];return _0x173a98;};'use strict';var Sequelize=require(_0x70a6('0x0'));module[_0x70a6('0x1')]={'name':{'type':Sequelize[_0x70a6('0x2')],'get':function(_0x1d6ee8){return this[_0x70a6('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x70a6('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x70a6('0x5')],'defaultValue':''},'context':{'type':Sequelize[_0x70a6('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x70a6('0x5')],'defaultValue':''},'callerid':{'type':Sequelize[_0x70a6('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x70a6('0x5')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x70a6('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x70a6('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0x70a6('0x6')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x70a6('0x5')],'defaultValue':''},'stamp':{'type':_0x70a6('0x7'),'defaultValue':Sequelize[_0x70a6('0x8')](_0x70a6('0x9'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 6a78983..2dacb16 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 _0x1f8a=['download','recording','msg_id','ValidationError','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','fast-json-patch','request-promise','mustache','sox','ejs','lodash','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','offset','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','VoiceMailMessage','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','create','body','find','params'];(function(_0x15ff47,_0x3d08c5){var _0x239fb9=function(_0x395f25){while(--_0x395f25){_0x15ff47['push'](_0x15ff47['shift']());}};_0x239fb9(++_0x3d08c5);}(_0x1f8a,0x18b));var _0xa1f8=function(_0x4818a0,_0x130415){_0x4818a0=_0x4818a0-0x0;var _0x465228=_0x1f8a[_0x4818a0];return _0x465228;};'use strict';var emlformat=require(_0xa1f8('0x0'));var rimraf=require(_0xa1f8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa1f8('0x2'));var rp=require(_0xa1f8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa1f8('0x4'));var util=require('util');var path=require('path');var sox=require(_0xa1f8('0x5'));var csv=require('to-csv');var ejs=require(_0xa1f8('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa1f8('0x7'));var squel=require('squel');var crypto=require(_0xa1f8('0x8'));var jsforce=require(_0xa1f8('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xa1f8('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa1f8('0xb'));var authService=require(_0xa1f8('0xc'));var qs=require(_0xa1f8('0xd'));var as=require(_0xa1f8('0xe'));var hardwareService=require(_0xa1f8('0xf'));var logger=require(_0xa1f8('0x10'))('api');var utils=require(_0xa1f8('0x11'));var config=require(_0xa1f8('0x12'));var licenseUtil=require(_0xa1f8('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50d50b,_0x408e48){_0x408e48=_0x408e48||0xcc;return function(_0x424012){if(_0x424012){return _0x50d50b[_0xa1f8('0x14')](_0x408e48);}return _0x50d50b[_0xa1f8('0x15')](_0x408e48)[_0xa1f8('0x16')]();};}function respondWithResult(_0x122b64,_0x37ac22){_0x37ac22=_0x37ac22||0xc8;return function(_0x2ddfad){if(_0x2ddfad){return _0x122b64[_0xa1f8('0x15')](_0x37ac22)['json'](_0x2ddfad);}};}function respondWithFilteredResult(_0x13cf65,_0x31835c){return function(_0xd13fc0){if(_0xd13fc0){var _0x2645ab=typeof _0x31835c['offset']===_0xa1f8('0x17')&&typeof _0x31835c[_0xa1f8('0x18')]==='undefined';var _0x906427=_0xd13fc0['count'];var _0x164585=_0x2645ab?0x0:_0x31835c[_0xa1f8('0x19')];var _0x4393f4=_0x2645ab?_0xd13fc0[_0xa1f8('0x1a')]:_0x31835c['offset']+_0x31835c['limit'];var _0xa1edf0;if(_0x4393f4>=_0x906427){_0x4393f4=_0x906427;_0xa1edf0=0xc8;}else{_0xa1edf0=0xce;}_0x13cf65[_0xa1f8('0x15')](_0xa1edf0);return _0x13cf65[_0xa1f8('0x1b')](_0xa1f8('0x1c'),_0x164585+'-'+_0x4393f4+'/'+_0x906427)['json'](_0xd13fc0);}return null;};}function patchUpdates(_0x2c9087){return function(_0x2534d7){try{jsonpatch[_0xa1f8('0x1d')](_0x2534d7,_0x2c9087,!![]);}catch(_0x342167){return BPromise[_0xa1f8('0x1e')](_0x342167);}return _0x2534d7['save']();};}function saveUpdates(_0x161aee,_0xa8f73a){return function(_0x527722){if(_0x527722){return _0x527722[_0xa1f8('0x1f')](_0x161aee)[_0xa1f8('0x20')](function(_0x29b883){return _0x29b883;});}return null;};}function removeEntity(_0x2a6de6,_0x316ac5){return function(_0x4322fa){if(_0x4322fa){return _0x4322fa[_0xa1f8('0x21')]()['then'](function(){_0x2a6de6[_0xa1f8('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b48a8,_0x12b7ee){return function(_0x4a32fa){if(!_0x4a32fa){_0x4b48a8['sendStatus'](0x194);}return _0x4a32fa;};}function handleError(_0x12d848,_0x3b36a8){_0x3b36a8=_0x3b36a8||0x1f4;return function(_0x5f470b){logger[_0xa1f8('0x22')](_0x5f470b[_0xa1f8('0x23')]);if(_0x5f470b[_0xa1f8('0x24')]){delete _0x5f470b[_0xa1f8('0x24')];}_0x12d848[_0xa1f8('0x15')](_0x3b36a8)['send'](_0x5f470b);};}exports['index']=function(_0x5be46e,_0x59e157){var _0x5c3a50={},_0x25222e={},_0x253152={'count':0x0,'rows':[]};var _0x5a99db=_['map'](db[_0xa1f8('0x25')]['rawAttributes'],function(_0x869359){return{'name':_0x869359['fieldName'],'type':_0x869359['type'][_0xa1f8('0x26')]};});_0x25222e[_0xa1f8('0x27')]=_['differenceBy'](_['map'](_0x5a99db,_0xa1f8('0x24')),[_0xa1f8('0x24')]);_0x25222e[_0xa1f8('0x28')]=_[_0xa1f8('0x29')](_0x5be46e['query']);_0x25222e[_0xa1f8('0x2a')]=_[_0xa1f8('0x2b')](_0x25222e[_0xa1f8('0x27')],_0x25222e['query']);_0x5c3a50[_0xa1f8('0x2c')]=_[_0xa1f8('0x2b')](_0x25222e['model'],qs['fields'](_0x5be46e[_0xa1f8('0x28')][_0xa1f8('0x2d')]));_0x5c3a50[_0xa1f8('0x2c')]=_0x5c3a50[_0xa1f8('0x2c')]['length']?_0x5c3a50[_0xa1f8('0x2c')]:_0x25222e[_0xa1f8('0x27')];if(!_0x5be46e['query'][_0xa1f8('0x2e')]('nolimit')){_0x5c3a50['limit']=qs[_0xa1f8('0x18')](_0x5be46e[_0xa1f8('0x28')]['limit']);_0x5c3a50[_0xa1f8('0x19')]=qs['offset'](_0x5be46e[_0xa1f8('0x28')][_0xa1f8('0x19')]);}_0x5c3a50[_0xa1f8('0x2f')]=qs[_0xa1f8('0x30')](_0x5be46e['query'][_0xa1f8('0x30')]);_0x5c3a50[_0xa1f8('0x31')]=qs[_0xa1f8('0x2a')](_[_0xa1f8('0x32')](_0x5be46e[_0xa1f8('0x28')],_0x25222e[_0xa1f8('0x2a')]),_0x5a99db);if(_0x5be46e[_0xa1f8('0x28')][_0xa1f8('0x33')]){_0x5c3a50['where']=_[_0xa1f8('0x34')](_0x5c3a50[_0xa1f8('0x31')],{'$or':_[_0xa1f8('0x35')](_0x5a99db,function(_0x20b1ce){if(_0x20b1ce[_0xa1f8('0x36')]!==_0xa1f8('0x37')){var _0x273079={};_0x273079[_0x20b1ce['name']]={'$like':'%'+_0x5be46e[_0xa1f8('0x28')][_0xa1f8('0x33')]+'%'};return _0x273079;}})});}_0x5c3a50=_[_0xa1f8('0x34')]({},_0x5c3a50,_0x5be46e[_0xa1f8('0x38')]);var _0x2e7c1a={'where':_0x5c3a50[_0xa1f8('0x31')]};return db[_0xa1f8('0x25')][_0xa1f8('0x1a')](_0x2e7c1a)[_0xa1f8('0x20')](function(_0x24b4de){_0x253152[_0xa1f8('0x1a')]=_0x24b4de;if(_0x5be46e[_0xa1f8('0x28')][_0xa1f8('0x39')]){_0x5c3a50[_0xa1f8('0x3a')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0xa1f8('0x3b')](_0x5c3a50);})[_0xa1f8('0x20')](function(_0x269780){_0x253152[_0xa1f8('0x3c')]=_0x269780;return _0x253152;})['then'](respondWithFilteredResult(_0x59e157,_0x5c3a50))[_0xa1f8('0x3d')](handleError(_0x59e157,null));};exports[_0xa1f8('0x3e')]=function(_0x716b65,_0x1c3b5a){var _0x19966c={'raw':!![],'where':{'id':_0x716b65['params']['id']}},_0xab5ff2={};_0xab5ff2['model']=_[_0xa1f8('0x29')](db[_0xa1f8('0x25')]['rawAttributes']);_0xab5ff2[_0xa1f8('0x28')]=_['keys'](_0x716b65['query']);_0xab5ff2[_0xa1f8('0x2a')]=_[_0xa1f8('0x2b')](_0xab5ff2[_0xa1f8('0x27')],_0xab5ff2[_0xa1f8('0x28')]);_0x19966c[_0xa1f8('0x2c')]=_[_0xa1f8('0x2b')](_0xab5ff2[_0xa1f8('0x27')],qs['fields'](_0x716b65['query'][_0xa1f8('0x2d')]));_0x19966c[_0xa1f8('0x2c')]=_0x19966c[_0xa1f8('0x2c')]['length']?_0x19966c[_0xa1f8('0x2c')]:_0xab5ff2[_0xa1f8('0x27')];if(_0x716b65['query']['includeAll']){_0x19966c[_0xa1f8('0x3a')]=[{'all':!![]}];}_0x19966c=_['merge']({},_0x19966c,_0x716b65[_0xa1f8('0x38')]);return db['VoiceMailMessage']['find'](_0x19966c)[_0xa1f8('0x20')](handleEntityNotFound(_0x1c3b5a,null))[_0xa1f8('0x20')](respondWithResult(_0x1c3b5a,null))[_0xa1f8('0x3d')](handleError(_0x1c3b5a,null));};exports[_0xa1f8('0x3f')]=function(_0x35cb7f,_0x6ca13e){return db[_0xa1f8('0x25')][_0xa1f8('0x3f')](_0x35cb7f[_0xa1f8('0x40')],{})[_0xa1f8('0x20')](respondWithResult(_0x6ca13e,0xc9))[_0xa1f8('0x3d')](handleError(_0x6ca13e,null));};exports['update']=function(_0x9e24ee,_0x319471){if(_0x9e24ee['body']['id']){delete _0x9e24ee['body']['id'];}return db[_0xa1f8('0x25')][_0xa1f8('0x41')]({'where':{'id':_0x9e24ee[_0xa1f8('0x42')]['id']}})[_0xa1f8('0x20')](handleEntityNotFound(_0x319471,null))['then'](saveUpdates(_0x9e24ee['body'],null))[_0xa1f8('0x20')](respondWithResult(_0x319471,null))['catch'](handleError(_0x319471,null));};exports[_0xa1f8('0x21')]=function(_0x24cd6d,_0x252a7c){return db[_0xa1f8('0x25')][_0xa1f8('0x41')]({'where':{'id':_0x24cd6d[_0xa1f8('0x42')]['id']}})[_0xa1f8('0x20')](handleEntityNotFound(_0x252a7c,null))[_0xa1f8('0x20')](removeEntity(_0x252a7c,null))[_0xa1f8('0x3d')](handleError(_0x252a7c,null));};exports[_0xa1f8('0x43')]=function(_0x3b0cbf,_0x5d07e3,_0x4bf82f){return db['VoiceMailMessage'][_0xa1f8('0x41')]({'where':{'id':_0x3b0cbf['params']['id']},'attributes':['id',_0xa1f8('0x44'),_0xa1f8('0x45')]})[_0xa1f8('0x20')](handleEntityNotFound(_0x5d07e3,null))[_0xa1f8('0x20')](function(_0x21b3b6){if(_0x21b3b6){if(!_0x21b3b6['recording']){throw new db['Sequelize'][(_0xa1f8('0x46'))]('VoiceMailMessage\x20not\x20found');}var _0x28508a={'Content-Type':_0xa1f8('0x47'),'Content-Disposition':_0xa1f8('0x48')};if(_0x21b3b6['msg_id']){_0x28508a[_0xa1f8('0x49')]=_0xa1f8('0x4a')+_0x21b3b6[_0xa1f8('0x45')]+_0xa1f8('0x4b');}_0x5d07e3[_0xa1f8('0x1b')](_0x28508a);return _0x5d07e3[_0xa1f8('0x4c')](new Buffer(_0x21b3b6['recording']));}})[_0xa1f8('0x3d')](handleError(_0x5d07e3,null));}; \ No newline at end of file +var _0x973f=['path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','VoiceMailMessage','rawAttributes','fieldName','type','model','differenceBy','map','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','intersection','fields','create','body','params','find','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x973f,0x145));var _0xf973=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0x973f[_0x1e4360];return _0x31e6b4;};'use strict';var emlformat=require(_0xf973('0x0'));var rimraf=require(_0xf973('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf973('0x2'));var rp=require(_0xf973('0x3'));var moment=require(_0xf973('0x4'));var BPromise=require(_0xf973('0x5'));var Mustache=require('mustache');var util=require(_0xf973('0x6'));var path=require(_0xf973('0x7'));var sox=require(_0xf973('0x8'));var csv=require(_0xf973('0x9'));var ejs=require(_0xf973('0xa'));var fs=require('fs');var fs_extra=require(_0xf973('0xb'));var _=require('lodash');var squel=require(_0xf973('0xc'));var crypto=require(_0xf973('0xd'));var jsforce=require(_0xf973('0xe'));var deskjs=require(_0xf973('0xf'));var toCsv=require(_0xf973('0x9'));var querystring=require(_0xf973('0x10'));var Papa=require(_0xf973('0x11'));var Redis=require(_0xf973('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf973('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf973('0x14'));var db=require(_0xf973('0x15'))['db'];function respondWithStatusCode(_0x56a46f,_0x409953){_0x409953=_0x409953||0xcc;return function(_0x3e8139){if(_0x3e8139){return _0x56a46f[_0xf973('0x16')](_0x409953);}return _0x56a46f[_0xf973('0x17')](_0x409953)[_0xf973('0x18')]();};}function respondWithResult(_0x319281,_0x47e48a){_0x47e48a=_0x47e48a||0xc8;return function(_0x424fcb){if(_0x424fcb){return _0x319281[_0xf973('0x17')](_0x47e48a)[_0xf973('0x19')](_0x424fcb);}};}function respondWithFilteredResult(_0x53baf0,_0x115986){return function(_0x54e54d){if(_0x54e54d){var _0x224961=typeof _0x115986[_0xf973('0x1a')]==='undefined'&&typeof _0x115986[_0xf973('0x1b')]===_0xf973('0x1c');var _0x235f97=_0x54e54d[_0xf973('0x1d')];var _0x49d2c9=_0x224961?0x0:_0x115986['offset'];var _0x54220c=_0x224961?_0x54e54d['count']:_0x115986[_0xf973('0x1a')]+_0x115986[_0xf973('0x1b')];var _0x33d3f3;if(_0x54220c>=_0x235f97){_0x54220c=_0x235f97;_0x33d3f3=0xc8;}else{_0x33d3f3=0xce;}_0x53baf0[_0xf973('0x17')](_0x33d3f3);return _0x53baf0[_0xf973('0x1e')](_0xf973('0x1f'),_0x49d2c9+'-'+_0x54220c+'/'+_0x235f97)[_0xf973('0x19')](_0x54e54d);}return null;};}function patchUpdates(_0x5ad376){return function(_0x5a1515){try{jsonpatch[_0xf973('0x20')](_0x5a1515,_0x5ad376,!![]);}catch(_0x40a293){return BPromise[_0xf973('0x21')](_0x40a293);}return _0x5a1515[_0xf973('0x22')]();};}function saveUpdates(_0xc175b7,_0x52aade){return function(_0x34ee4c){if(_0x34ee4c){return _0x34ee4c[_0xf973('0x23')](_0xc175b7)[_0xf973('0x24')](function(_0xd6ee6e){return _0xd6ee6e;});}return null;};}function removeEntity(_0x38133f,_0x20589e){return function(_0x4e5052){if(_0x4e5052){return _0x4e5052[_0xf973('0x25')]()['then'](function(){_0x38133f[_0xf973('0x17')](0xcc)[_0xf973('0x18')]();});}};}function handleEntityNotFound(_0x2c9a71,_0x284ace){return function(_0xa32595){if(!_0xa32595){_0x2c9a71['sendStatus'](0x194);}return _0xa32595;};}function handleError(_0x3398c0,_0x4fb467){_0x4fb467=_0x4fb467||0x1f4;return function(_0x4ebea0){logger[_0xf973('0x26')](_0x4ebea0['stack']);if(_0x4ebea0['name']){delete _0x4ebea0[_0xf973('0x27')];}_0x3398c0[_0xf973('0x17')](_0x4fb467)[_0xf973('0x28')](_0x4ebea0);};}exports[_0xf973('0x29')]=function(_0x130510,_0x485225){var _0xb37aa3={},_0x3390c8={},_0x597511={'count':0x0,'rows':[]};var _0x316044=_['map'](db[_0xf973('0x2a')][_0xf973('0x2b')],function(_0x55ebf7){return{'name':_0x55ebf7[_0xf973('0x2c')],'type':_0x55ebf7[_0xf973('0x2d')]['key']};});_0x3390c8[_0xf973('0x2e')]=_[_0xf973('0x2f')](_[_0xf973('0x30')](_0x316044,_0xf973('0x27')),['name']);_0x3390c8[_0xf973('0x31')]=_[_0xf973('0x32')](_0x130510['query']);_0x3390c8[_0xf973('0x33')]=_['intersection'](_0x3390c8[_0xf973('0x2e')],_0x3390c8[_0xf973('0x31')]);_0xb37aa3[_0xf973('0x34')]=_['intersection'](_0x3390c8[_0xf973('0x2e')],qs['fields'](_0x130510[_0xf973('0x31')]['fields']));_0xb37aa3[_0xf973('0x34')]=_0xb37aa3['attributes'][_0xf973('0x35')]?_0xb37aa3['attributes']:_0x3390c8[_0xf973('0x2e')];if(!_0x130510[_0xf973('0x31')][_0xf973('0x36')](_0xf973('0x37'))){_0xb37aa3['limit']=qs['limit'](_0x130510[_0xf973('0x31')]['limit']);_0xb37aa3[_0xf973('0x1a')]=qs[_0xf973('0x1a')](_0x130510[_0xf973('0x31')][_0xf973('0x1a')]);}_0xb37aa3[_0xf973('0x38')]=qs[_0xf973('0x39')](_0x130510[_0xf973('0x31')][_0xf973('0x39')]);_0xb37aa3[_0xf973('0x3a')]=qs[_0xf973('0x33')](_[_0xf973('0x3b')](_0x130510[_0xf973('0x31')],_0x3390c8['filters']),_0x316044);if(_0x130510['query'][_0xf973('0x3c')]){_0xb37aa3['where']=_[_0xf973('0x3d')](_0xb37aa3[_0xf973('0x3a')],{'$or':_[_0xf973('0x30')](_0x316044,function(_0x168a2c){if(_0x168a2c[_0xf973('0x2d')]!==_0xf973('0x3e')){var _0x11c619={};_0x11c619[_0x168a2c['name']]={'$like':'%'+_0x130510[_0xf973('0x31')][_0xf973('0x3c')]+'%'};return _0x11c619;}})});}_0xb37aa3=_[_0xf973('0x3d')]({},_0xb37aa3,_0x130510[_0xf973('0x3f')]);var _0x1a8aa9={'where':_0xb37aa3[_0xf973('0x3a')]};return db[_0xf973('0x2a')][_0xf973('0x1d')](_0x1a8aa9)[_0xf973('0x24')](function(_0x56ffcd){_0x597511[_0xf973('0x1d')]=_0x56ffcd;if(_0x130510[_0xf973('0x31')][_0xf973('0x40')]){_0xb37aa3[_0xf973('0x41')]=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0xb37aa3);})['then'](function(_0x281f61){_0x597511[_0xf973('0x42')]=_0x281f61;return _0x597511;})[_0xf973('0x24')](respondWithFilteredResult(_0x485225,_0xb37aa3))[_0xf973('0x43')](handleError(_0x485225,null));};exports[_0xf973('0x44')]=function(_0x2b78e2,_0x39c8a8){var _0xda2347={'raw':!![],'where':{'id':_0x2b78e2['params']['id']}},_0x4287e9={};_0x4287e9[_0xf973('0x2e')]=_[_0xf973('0x32')](db[_0xf973('0x2a')][_0xf973('0x2b')]);_0x4287e9['query']=_[_0xf973('0x32')](_0x2b78e2[_0xf973('0x31')]);_0x4287e9['filters']=_[_0xf973('0x45')](_0x4287e9[_0xf973('0x2e')],_0x4287e9[_0xf973('0x31')]);_0xda2347[_0xf973('0x34')]=_['intersection'](_0x4287e9['model'],qs[_0xf973('0x46')](_0x2b78e2[_0xf973('0x31')]['fields']));_0xda2347[_0xf973('0x34')]=_0xda2347[_0xf973('0x34')][_0xf973('0x35')]?_0xda2347[_0xf973('0x34')]:_0x4287e9[_0xf973('0x2e')];if(_0x2b78e2[_0xf973('0x31')][_0xf973('0x40')]){_0xda2347['include']=[{'all':!![]}];}_0xda2347=_[_0xf973('0x3d')]({},_0xda2347,_0x2b78e2['options']);return db[_0xf973('0x2a')]['find'](_0xda2347)[_0xf973('0x24')](handleEntityNotFound(_0x39c8a8,null))['then'](respondWithResult(_0x39c8a8,null))[_0xf973('0x43')](handleError(_0x39c8a8,null));};exports['create']=function(_0x2bb987,_0x199a95){return db[_0xf973('0x2a')][_0xf973('0x47')](_0x2bb987[_0xf973('0x48')],{})[_0xf973('0x24')](respondWithResult(_0x199a95,0xc9))[_0xf973('0x43')](handleError(_0x199a95,null));};exports['update']=function(_0x1bb56d,_0x29ba65){if(_0x1bb56d[_0xf973('0x48')]['id']){delete _0x1bb56d[_0xf973('0x48')]['id'];}return db['VoiceMailMessage']['find']({'where':{'id':_0x1bb56d[_0xf973('0x49')]['id']}})[_0xf973('0x24')](handleEntityNotFound(_0x29ba65,null))[_0xf973('0x24')](saveUpdates(_0x1bb56d[_0xf973('0x48')],null))[_0xf973('0x24')](respondWithResult(_0x29ba65,null))[_0xf973('0x43')](handleError(_0x29ba65,null));};exports['destroy']=function(_0x2fdfad,_0x1e4195){return db[_0xf973('0x2a')][_0xf973('0x4a')]({'where':{'id':_0x2fdfad[_0xf973('0x49')]['id']}})[_0xf973('0x24')](handleEntityNotFound(_0x1e4195,null))[_0xf973('0x24')](removeEntity(_0x1e4195,null))[_0xf973('0x43')](handleError(_0x1e4195,null));};exports['download']=function(_0x17b27d,_0x497109,_0x3c14c7){return db['VoiceMailMessage'][_0xf973('0x4a')]({'where':{'id':_0x17b27d[_0xf973('0x49')]['id']},'attributes':['id',_0xf973('0x4b'),_0xf973('0x4c')]})[_0xf973('0x24')](handleEntityNotFound(_0x497109,null))[_0xf973('0x24')](function(_0x1d3178){if(_0x1d3178){if(!_0x1d3178[_0xf973('0x4b')]){throw new db['Sequelize'][(_0xf973('0x4d'))](_0xf973('0x4e'));}var _0x121911={'Content-Type':_0xf973('0x4f'),'Content-Disposition':_0xf973('0x50')};if(_0x1d3178['msg_id']){_0x121911['Content-Disposition']=_0xf973('0x51')+_0x1d3178[_0xf973('0x4c')]+_0xf973('0x52');}_0x497109['set'](_0x121911);return _0x497109[_0xf973('0x28')](new Buffer(_0x1d3178[_0xf973('0x4b')]));}})[_0xf973('0x43')](handleError(_0x497109,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 5a3f88a..87d4556 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 _0x5c35=['exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0x5c35,0x1a9));var _0x55c3=function(_0x78a014,_0x5eb19b){_0x78a014=_0x78a014-0x0;var _0x1e5802=_0x5c35[_0x78a014];return _0x1e5802;};'use strict';var _=require(_0x55c3('0x0'));var util=require('util');var logger=require(_0x55c3('0x1'))(_0x55c3('0x2'));var moment=require(_0x55c3('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x55c3('0x4'));var rimraf=require(_0x55c3('0x5'));var config=require(_0x55c3('0x6'));var attributes=require('./voiceMailMessage.attributes');module[_0x55c3('0x7')]=function(_0x5575a1,_0x48e606){return _0x5575a1[_0x55c3('0x8')](_0x55c3('0x9'),attributes,{'tableName':_0x55c3('0xa'),'paranoid':![],'indexes':[{'name':_0x55c3('0xb'),'fields':[_0x55c3('0xb')]}],'timestamps':![]});}; \ No newline at end of file +var _0x6107=['exports','dir','util','../../config/logger','api','moment','bluebird','../../config/environment','./voiceMailMessage.attributes'];(function(_0x1240ea,_0x361541){var _0x282bc=function(_0x8d9b3d){while(--_0x8d9b3d){_0x1240ea['push'](_0x1240ea['shift']());}};_0x282bc(++_0x361541);}(_0x6107,0x122));var _0x7610=function(_0x3848b,_0x15ec60){_0x3848b=_0x3848b-0x0;var _0x5903ac=_0x6107[_0x3848b];return _0x5903ac;};'use strict';var _=require('lodash');var util=require(_0x7610('0x0'));var logger=require(_0x7610('0x1'))(_0x7610('0x2'));var moment=require(_0x7610('0x3'));var BPromise=require(_0x7610('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7610('0x5'));var attributes=require(_0x7610('0x6'));module[_0x7610('0x7')]=function(_0x4a06a2,_0x448b27){return _0x4a06a2['define']('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x7610('0x8'),'fields':[_0x7610('0x8')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 5bf9096..fca5324 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 _0x6314=['VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x317d31,_0x353b8a){var _0xf92210=function(_0x1b3fe8){while(--_0x1b3fe8){_0x317d31['push'](_0x317d31['shift']());}};_0xf92210(++_0x353b8a);}(_0x6314,0xad));var _0x4631=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0x6314[_0x1cfa0d];return _0xe33279;};'use strict';var _=require('lodash');var util=require(_0x4631('0x0'));var moment=require(_0x4631('0x1'));var BPromise=require(_0x4631('0x2'));var rs=require(_0x4631('0x3'));var fs=require('fs');var Redis=require(_0x4631('0x4'));var db=require(_0x4631('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4631('0x6'));var config=require(_0x4631('0x7'));var jayson=require(_0x4631('0x8'));var client=jayson['client'][_0x4631('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a9cbb,_0x3d2bc0,_0x4984f0){return new BPromise(function(_0x2bb9a9,_0x499e50){return client[_0x4631('0xa')](_0x1a9cbb,_0x4984f0)[_0x4631('0xb')](function(_0x13c06c){logger[_0x4631('0xc')](_0x4631('0xd'),_0x3d2bc0,_0x4631('0xe'));logger[_0x4631('0xf')](_0x4631('0x10'),_0x3d2bc0,'request\x20sent',JSON['stringify'](_0x13c06c));if(_0x13c06c[_0x4631('0x11')]){if(_0x13c06c[_0x4631('0x11')][_0x4631('0x12')]===0x1f4){logger[_0x4631('0x11')]('VoiceMailMessage,\x20%s,\x20%s',_0x3d2bc0,_0x13c06c[_0x4631('0x11')]['message']);return _0x499e50(_0x13c06c[_0x4631('0x11')][_0x4631('0x13')]);}logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x3d2bc0,_0x13c06c[_0x4631('0x11')][_0x4631('0x13')]);return _0x2bb9a9(_0x13c06c[_0x4631('0x11')][_0x4631('0x13')]);}else{logger[_0x4631('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x3d2bc0,_0x4631('0xe'));_0x2bb9a9(_0x13c06c['result'][_0x4631('0x13')]);}})[_0x4631('0x14')](function(_0x5af0bc){logger[_0x4631('0x11')](_0x4631('0xd'),_0x3d2bc0,_0x5af0bc);_0x499e50(_0x5af0bc);});});} \ No newline at end of file +var _0x5da9=['client','http','request','VoiceMailMessage,\x20%s,\x20%s','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x2c61a2,_0x40fe37){var _0x28bf7c=function(_0x4afffe){while(--_0x4afffe){_0x2c61a2['push'](_0x2c61a2['shift']());}};_0x28bf7c(++_0x40fe37);}(_0x5da9,0xfe));var _0x95da=function(_0x310d10,_0x3fe887){_0x310d10=_0x310d10-0x0;var _0x1fb8af=_0x5da9[_0x310d10];return _0x1fb8af;};'use strict';var _=require(_0x95da('0x0'));var util=require(_0x95da('0x1'));var moment=require(_0x95da('0x2'));var BPromise=require(_0x95da('0x3'));var rs=require(_0x95da('0x4'));var fs=require('fs');var Redis=require(_0x95da('0x5'));var db=require(_0x95da('0x6'))['db'];var utils=require(_0x95da('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x95da('0x8'));var jayson=require(_0x95da('0x9'));var client=jayson[_0x95da('0xa')][_0x95da('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4781b5,_0x4fc261,_0x47dfd){return new BPromise(function(_0xd67387,_0x690140){return client[_0x95da('0xc')](_0x4781b5,_0x47dfd)['then'](function(_0x3250fa){logger['info'](_0x95da('0xd'),_0x4fc261,'request\x20sent');logger[_0x95da('0xe')](_0x95da('0xf'),_0x4fc261,_0x95da('0x10'),JSON[_0x95da('0x11')](_0x3250fa));if(_0x3250fa[_0x95da('0x12')]){if(_0x3250fa[_0x95da('0x12')][_0x95da('0x13')]===0x1f4){logger[_0x95da('0x12')]('VoiceMailMessage,\x20%s,\x20%s',_0x4fc261,_0x3250fa[_0x95da('0x12')][_0x95da('0x14')]);return _0x690140(_0x3250fa[_0x95da('0x12')]['message']);}logger[_0x95da('0x12')](_0x95da('0xd'),_0x4fc261,_0x3250fa[_0x95da('0x12')][_0x95da('0x14')]);return _0xd67387(_0x3250fa[_0x95da('0x12')]['message']);}else{logger['info'](_0x95da('0xd'),_0x4fc261,_0x95da('0x10'));_0xd67387(_0x3250fa['result']['message']);}})[_0x95da('0x15')](function(_0x23d5d2){logger[_0x95da('0x12')](_0x95da('0xd'),_0x4fc261,_0x23d5d2);_0x690140(_0x23d5d2);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 2a91590..af9608b 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 _0x5737=['isAuthenticated','/:id','/:id/sounds','addSound','put','delete','destroy','removeSound','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get'];(function(_0x405dc0,_0x5f2898){var _0x1ed46d=function(_0x5efad7){while(--_0x5efad7){_0x405dc0['push'](_0x405dc0['shift']());}};_0x1ed46d(++_0x5f2898);}(_0x5737,0xb4));var _0x7573=function(_0x3416d9,_0x6a56f9){_0x3416d9=_0x3416d9-0x0;var _0x589ad9=_0x5737[_0x3416d9];return _0x589ad9;};'use strict';var multer=require('multer');var util=require(_0x7573('0x0'));var path=require(_0x7573('0x1'));var timeout=require(_0x7573('0x2'));var express=require('express');var router=express[_0x7573('0x3')]();var fs_extra=require(_0x7573('0x4'));var auth=require(_0x7573('0x5'));var interaction=require(_0x7573('0x6'));var config=require(_0x7573('0x7'));var controller=require(_0x7573('0x8'));router[_0x7573('0x9')]('/',auth[_0x7573('0xa')](),controller['index']);router['get'](_0x7573('0xb'),auth[_0x7573('0xa')](),controller['show']);router[_0x7573('0x9')]('/:id/sounds',auth[_0x7573('0xa')](),controller['getSounds']);router['post']('/',auth[_0x7573('0xa')](),controller['create']);router['post'](_0x7573('0xc'),auth[_0x7573('0xa')](),controller[_0x7573('0xd')]);router[_0x7573('0xe')](_0x7573('0xb'),auth[_0x7573('0xa')](),controller['update']);router[_0x7573('0xf')](_0x7573('0xb'),auth[_0x7573('0xa')](),controller[_0x7573('0x10')]);router[_0x7573('0xf')]('/:id/sounds/:id2',auth[_0x7573('0xa')](),controller[_0x7573('0x11')]);module[_0x7573('0x12')]=router; \ No newline at end of file +var _0x6fc4=['/:id/sounds','getSounds','post','create','put','delete','destroy','/:id/sounds/:id2','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id'];(function(_0x50e826,_0x984648){var _0x4fb9df=function(_0x14bea0){while(--_0x14bea0){_0x50e826['push'](_0x50e826['shift']());}};_0x4fb9df(++_0x984648);}(_0x6fc4,0x77));var _0x46fc=function(_0x4375fb,_0x22650a){_0x4375fb=_0x4375fb-0x0;var _0x445a97=_0x6fc4[_0x4375fb];return _0x445a97;};'use strict';var multer=require(_0x46fc('0x0'));var util=require(_0x46fc('0x1'));var path=require(_0x46fc('0x2'));var timeout=require(_0x46fc('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x46fc('0x4'));var auth=require(_0x46fc('0x5'));var interaction=require(_0x46fc('0x6'));var config=require(_0x46fc('0x7'));var controller=require(_0x46fc('0x8'));router[_0x46fc('0x9')]('/',auth[_0x46fc('0xa')](),controller[_0x46fc('0xb')]);router[_0x46fc('0x9')](_0x46fc('0xc'),auth[_0x46fc('0xa')](),controller['show']);router[_0x46fc('0x9')](_0x46fc('0xd'),auth[_0x46fc('0xa')](),controller[_0x46fc('0xe')]);router[_0x46fc('0xf')]('/',auth[_0x46fc('0xa')](),controller[_0x46fc('0x10')]);router[_0x46fc('0xf')](_0x46fc('0xd'),auth[_0x46fc('0xa')](),controller['addSound']);router[_0x46fc('0x11')](_0x46fc('0xc'),auth[_0x46fc('0xa')](),controller['update']);router[_0x46fc('0x12')](_0x46fc('0xc'),auth['isAuthenticated'](),controller[_0x46fc('0x13')]);router[_0x46fc('0x12')](_0x46fc('0x14'),auth[_0x46fc('0xa')](),controller['removeSound']);module[_0x46fc('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 5823f75..cf7f459 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 _0x8afd=['alpha','BOOLEAN','sequelize','exports','STRING','name','mp3nb','quietmp3nb','quietmp3','mp3','files'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8afd,0x178));var _0xd8af=function(_0x43bce3,_0x5c12b4){_0x43bce3=_0x43bce3-0x0;var _0x4f0bd0=_0x8afd[_0x43bce3];return _0x4f0bd0;};'use strict';var Sequelize=require(_0xd8af('0x0'));module[_0xd8af('0x1')]={'name':{'type':Sequelize[_0xd8af('0x2')],'allowNull':![],'unique':_0xd8af('0x3')},'mode':{'type':Sequelize['ENUM']('custom','files',_0xd8af('0x4'),_0xd8af('0x5'),_0xd8af('0x6'),_0xd8af('0x7')),'allowNull':!![],'defaultValue':_0xd8af('0x8')},'directory':{'type':Sequelize[_0xd8af('0x2')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0xd8af('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xd8af('0x2')],'allowNull':!![],'defaultValue':_0xd8af('0x9')},'format':{'type':Sequelize[_0xd8af('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0xd8af('0xa')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd81d=['mp3','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM','files','quietmp3nb','quietmp3'];(function(_0x44e5d7,_0xf2ced2){var _0xd5d6b3=function(_0x3b0822){while(--_0x3b0822){_0x44e5d7['push'](_0x44e5d7['shift']());}};_0xd5d6b3(++_0xf2ced2);}(_0xd81d,0x10c));var _0xdd81=function(_0x32ecff,_0x465b38){_0x32ecff=_0x32ecff-0x0;var _0xdff227=_0xd81d[_0x32ecff];return _0xdff227;};'use strict';var Sequelize=require(_0xdd81('0x0'));module[_0xdd81('0x1')]={'name':{'type':Sequelize[_0xdd81('0x2')],'allowNull':![],'unique':_0xdd81('0x3')},'mode':{'type':Sequelize[_0xdd81('0x4')]('custom',_0xdd81('0x5'),'mp3nb',_0xdd81('0x6'),_0xdd81('0x7'),_0xdd81('0x8')),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize[_0xdd81('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0xdd81('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0xdd81('0x2')],'allowNull':!![],'defaultValue':_0xdd81('0x9')},'format':{'type':Sequelize[_0xdd81('0x2')],'allowNull':!![]},'stamp':{'type':_0xdd81('0xa')},'defaultEntry':{'type':Sequelize[_0xdd81('0xb')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index 14329fc..b4dae72 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 _0xd8d3=['apply','reject','save','then','get','MusicOnHolds','error','name','send','index','VoiceMusicOnHold','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','filter','options','includeAll','include','findAll','catch','params','body','find','transaction','mode','files','directory','join','root','server/files/moh','create','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','destroy','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','sequelize','addSound','Sound','findOne','save_name','converted_format','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','id2','rawAttributes','getSounds','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x4a5bf4,_0x1e45d5){var _0x350cb9=function(_0x18a1fe){while(--_0x18a1fe){_0x4a5bf4['push'](_0x4a5bf4['shift']());}};_0x350cb9(++_0x1e45d5);}(_0xd8d3,0xbd));var _0x3d8d=function(_0x4eba91,_0x55b74c){_0x4eba91=_0x4eba91-0x0;var _0x185e37=_0xd8d3[_0x4eba91];return _0x185e37;};'use strict';var emlformat=require(_0x3d8d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3d8d('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3d8d('0x2'));var Mustache=require(_0x3d8d('0x3'));var util=require(_0x3d8d('0x4'));var path=require(_0x3d8d('0x5'));var sox=require(_0x3d8d('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d8d('0x7'));var _=require(_0x3d8d('0x8'));var squel=require(_0x3d8d('0x9'));var crypto=require(_0x3d8d('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3d8d('0xb'));var toCsv=require(_0x3d8d('0xc'));var querystring=require(_0x3d8d('0xd'));var Papa=require('papaparse');var Redis=require(_0x3d8d('0xe'));var authService=require(_0x3d8d('0xf'));var qs=require(_0x3d8d('0x10'));var as=require(_0x3d8d('0x11'));var hardwareService=require(_0x3d8d('0x12'));var logger=require(_0x3d8d('0x13'))('api');var utils=require(_0x3d8d('0x14'));var config=require(_0x3d8d('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30f791,_0x458d70){_0x458d70=_0x458d70||0xcc;return function(_0x1e977e){if(_0x1e977e){return _0x30f791[_0x3d8d('0x16')](_0x458d70);}return _0x30f791[_0x3d8d('0x17')](_0x458d70)[_0x3d8d('0x18')]();};}function respondWithResult(_0x90aa43,_0x2c934b){_0x2c934b=_0x2c934b||0xc8;return function(_0x50b5bc){if(_0x50b5bc){return _0x90aa43[_0x3d8d('0x17')](_0x2c934b)[_0x3d8d('0x19')](_0x50b5bc);}};}function respondWithFilteredResult(_0x49600d,_0x3538de){return function(_0x1343ea){if(_0x1343ea){var _0x59b81b=typeof _0x3538de[_0x3d8d('0x1a')]===_0x3d8d('0x1b')&&typeof _0x3538de[_0x3d8d('0x1c')]===_0x3d8d('0x1b');var _0x1fb45d=_0x1343ea[_0x3d8d('0x1d')];var _0x5c3008=_0x59b81b?0x0:_0x3538de[_0x3d8d('0x1a')];var _0x43c8e8=_0x59b81b?_0x1343ea['count']:_0x3538de[_0x3d8d('0x1a')]+_0x3538de[_0x3d8d('0x1c')];var _0x5ace44;if(_0x43c8e8>=_0x1fb45d){_0x43c8e8=_0x1fb45d;_0x5ace44=0xc8;}else{_0x5ace44=0xce;}_0x49600d[_0x3d8d('0x17')](_0x5ace44);return _0x49600d[_0x3d8d('0x1e')]('Content-Range',_0x5c3008+'-'+_0x43c8e8+'/'+_0x1fb45d)[_0x3d8d('0x19')](_0x1343ea);}return null;};}function patchUpdates(_0x45c9d3){return function(_0x5e0e3a){try{jsonpatch[_0x3d8d('0x1f')](_0x5e0e3a,_0x45c9d3,!![]);}catch(_0x16f1a9){return BPromise[_0x3d8d('0x20')](_0x16f1a9);}return _0x5e0e3a[_0x3d8d('0x21')]();};}function saveUpdates(_0xf6dc2b,_0x5339d0){return function(_0x5c513a){if(_0x5c513a){return _0x5c513a['update'](_0xf6dc2b)[_0x3d8d('0x22')](function(_0x414e03){return _0x414e03;});}return null;};}function removeEntity(_0x16d0ce,_0x42208a){return function(_0x4cbbb1){if(_0x4cbbb1){return _0x4cbbb1['destroy']()[_0x3d8d('0x22')](function(){var _0x2121b3=_0x4cbbb1[_0x3d8d('0x23')]({'plain':!![]});var _0x1ff2aa=_0x3d8d('0x24');return db['UserProfileResource']['destroy']({'where':{'type':_0x1ff2aa,'resourceId':_0x2121b3['id']}})[_0x3d8d('0x22')](function(){return _0x4cbbb1;});})[_0x3d8d('0x22')](function(){_0x16d0ce['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x480709,_0xd562b9){return function(_0x5c99dc){if(!_0x5c99dc){_0x480709[_0x3d8d('0x16')](0x194);}return _0x5c99dc;};}function handleError(_0xdb72b1,_0x37a682){_0x37a682=_0x37a682||0x1f4;return function(_0x1e8e64){logger[_0x3d8d('0x25')](_0x1e8e64['stack']);if(_0x1e8e64['name']){delete _0x1e8e64[_0x3d8d('0x26')];}_0xdb72b1[_0x3d8d('0x17')](_0x37a682)[_0x3d8d('0x27')](_0x1e8e64);};}exports[_0x3d8d('0x28')]=function(_0x17ec4e,_0xc3f95a){var _0x3b4a18={},_0x2c5040={},_0x2001bf={'count':0x0,'rows':[]};var _0x45c0a0=_['map'](db[_0x3d8d('0x29')]['rawAttributes'],function(_0x30a8ee){return{'name':_0x30a8ee[_0x3d8d('0x2a')],'type':_0x30a8ee[_0x3d8d('0x2b')][_0x3d8d('0x2c')]};});_0x2c5040[_0x3d8d('0x2d')]=_[_0x3d8d('0x2e')](_0x45c0a0,_0x3d8d('0x26'));_0x2c5040[_0x3d8d('0x2f')]=_[_0x3d8d('0x30')](_0x17ec4e[_0x3d8d('0x2f')]);_0x2c5040[_0x3d8d('0x31')]=_['intersection'](_0x2c5040[_0x3d8d('0x2d')],_0x2c5040['query']);_0x3b4a18['attributes']=_[_0x3d8d('0x32')](_0x2c5040[_0x3d8d('0x2d')],qs[_0x3d8d('0x33')](_0x17ec4e[_0x3d8d('0x2f')]['fields']));_0x3b4a18['attributes']=_0x3b4a18[_0x3d8d('0x34')][_0x3d8d('0x35')]?_0x3b4a18[_0x3d8d('0x34')]:_0x2c5040[_0x3d8d('0x2d')];if(!_0x17ec4e[_0x3d8d('0x2f')][_0x3d8d('0x36')](_0x3d8d('0x37'))){_0x3b4a18[_0x3d8d('0x1c')]=qs[_0x3d8d('0x1c')](_0x17ec4e[_0x3d8d('0x2f')][_0x3d8d('0x1c')]);_0x3b4a18[_0x3d8d('0x1a')]=qs['offset'](_0x17ec4e[_0x3d8d('0x2f')][_0x3d8d('0x1a')]);}_0x3b4a18[_0x3d8d('0x38')]=qs[_0x3d8d('0x39')](_0x17ec4e[_0x3d8d('0x2f')][_0x3d8d('0x39')]);delete _0x17ec4e[_0x3d8d('0x2f')][_0x3d8d('0x39')];_0x3b4a18['where']=qs[_0x3d8d('0x31')](_[_0x3d8d('0x3a')](_0x17ec4e[_0x3d8d('0x2f')],_0x2c5040[_0x3d8d('0x31')]),_0x45c0a0);if(_0x17ec4e[_0x3d8d('0x2f')]['filter']){_0x3b4a18[_0x3d8d('0x3b')]=_[_0x3d8d('0x3c')](_0x3b4a18[_0x3d8d('0x3b')],{'$or':_[_0x3d8d('0x2e')](_0x45c0a0,function(_0x24009e){if(_0x24009e[_0x3d8d('0x2b')]!=='VIRTUAL'){var _0x5241f6={};_0x5241f6[_0x24009e[_0x3d8d('0x26')]]={'$like':'%'+_0x17ec4e[_0x3d8d('0x2f')][_0x3d8d('0x3d')]+'%'};return _0x5241f6;}})});}_0x3b4a18=_[_0x3d8d('0x3c')]({},_0x3b4a18,_0x17ec4e[_0x3d8d('0x3e')]);var _0x43c74c={'where':_0x3b4a18[_0x3d8d('0x3b')]};return db[_0x3d8d('0x29')][_0x3d8d('0x1d')](_0x43c74c)[_0x3d8d('0x22')](function(_0x84200c){_0x2001bf[_0x3d8d('0x1d')]=_0x84200c;if(_0x17ec4e['query'][_0x3d8d('0x3f')]){_0x3b4a18[_0x3d8d('0x40')]=[{'all':!![]}];}return db[_0x3d8d('0x29')][_0x3d8d('0x41')](_0x3b4a18);})['then'](function(_0x4ae34a){_0x2001bf['rows']=_0x4ae34a;return _0x2001bf;})['then'](respondWithFilteredResult(_0xc3f95a,_0x3b4a18))[_0x3d8d('0x42')](handleError(_0xc3f95a,null));};exports['show']=function(_0x2a6026,_0x2c6a61){var _0x4118d6={'raw':![],'where':{'id':_0x2a6026[_0x3d8d('0x43')]['id']}},_0x50c743={};_0x50c743[_0x3d8d('0x2d')]=_[_0x3d8d('0x30')](db[_0x3d8d('0x29')]['rawAttributes']);_0x50c743['query']=_['keys'](_0x2a6026['query']);_0x50c743[_0x3d8d('0x31')]=_['intersection'](_0x50c743[_0x3d8d('0x2d')],_0x50c743[_0x3d8d('0x2f')]);_0x4118d6[_0x3d8d('0x34')]=_[_0x3d8d('0x32')](_0x50c743[_0x3d8d('0x2d')],qs[_0x3d8d('0x33')](_0x2a6026[_0x3d8d('0x2f')][_0x3d8d('0x33')]));_0x4118d6['attributes']=_0x4118d6[_0x3d8d('0x34')]['length']?_0x4118d6[_0x3d8d('0x34')]:_0x50c743['model'];if(_0x2a6026['query'][_0x3d8d('0x3f')]){_0x4118d6['include']=[{'all':!![]}];}_0x4118d6=_[_0x3d8d('0x3c')]({},_0x4118d6,_0x2a6026[_0x3d8d('0x3e')]);return db[_0x3d8d('0x29')]['find'](_0x4118d6)[_0x3d8d('0x22')](handleEntityNotFound(_0x2c6a61,null))['then'](respondWithResult(_0x2c6a61,null))[_0x3d8d('0x42')](handleError(_0x2c6a61,null));};exports['update']=function(_0x2c6d0f,_0x430d39){if(_0x2c6d0f['body']['id']){delete _0x2c6d0f[_0x3d8d('0x44')]['id'];}return db[_0x3d8d('0x29')][_0x3d8d('0x45')]({'where':{'id':_0x2c6d0f[_0x3d8d('0x43')]['id']}})['then'](handleEntityNotFound(_0x430d39,null))[_0x3d8d('0x22')](saveUpdates(_0x2c6d0f[_0x3d8d('0x44')],null))['then'](respondWithResult(_0x430d39,null))[_0x3d8d('0x42')](handleError(_0x430d39,null));};exports['create']=function(_0x5ed283,_0x3f71f1,_0x8af153){return db['sequelize'][_0x3d8d('0x46')](function(_0x19553e){if(_0x5ed283[_0x3d8d('0x44')][_0x3d8d('0x47')]===_0x3d8d('0x48')){_0x5ed283[_0x3d8d('0x44')][_0x3d8d('0x49')]=path[_0x3d8d('0x4a')](config[_0x3d8d('0x4b')],_0x3d8d('0x4c'),_0x5ed283['body'][_0x3d8d('0x26')]);}return db[_0x3d8d('0x29')][_0x3d8d('0x4d')](_0x5ed283[_0x3d8d('0x44')],{'transaction':_0x19553e})['then'](function(_0x32227b){if(_0x5ed283['body'][_0x3d8d('0x47')]==='files'){fs[_0x3d8d('0x4e')](_0x32227b[_0x3d8d('0x49')],parseInt(_0x3d8d('0x4f'),0x8));}var _0x1fe3b5=_0x5ed283['user']['get']({'plain':!![]});if(!_0x1fe3b5)throw new Error(_0x3d8d('0x50'));if(_0x1fe3b5[_0x3d8d('0x51')]===_0x3d8d('0x52')){var _0x16651f=_0x32227b[_0x3d8d('0x23')]({'plain':!![]});return db['UserProfileSection'][_0x3d8d('0x45')]({'where':{'name':_0x3d8d('0x24'),'userProfileId':_0x1fe3b5[_0x3d8d('0x53')]},'raw':!![]})[_0x3d8d('0x22')](function(_0x15616f){if(_0x15616f&&_0x15616f[_0x3d8d('0x54')]===0x0){return db['UserProfileResource'][_0x3d8d('0x4d')]({'name':_0x16651f[_0x3d8d('0x26')],'resourceId':_0x16651f['id'],'type':_0x15616f[_0x3d8d('0x26')],'sectionId':_0x15616f['id']},{})['then'](function(){return _0x32227b;});}else{return _0x32227b;}})['catch'](function(_0x5796eb){logger[_0x3d8d('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5796eb);});}return _0x32227b;});})[_0x3d8d('0x22')](respondWithResult(_0x3f71f1,0xc9))[_0x3d8d('0x42')](handleError(_0x3f71f1,null));};exports[_0x3d8d('0x55')]=function(_0x56dee8,_0x1df669,_0x3b328c){var _0x3648b3;return db[_0x3d8d('0x29')][_0x3d8d('0x45')]({'where':{'id':_0x56dee8['params']['id']}})[_0x3d8d('0x22')](function(_0x4ac6cb){if(_0x4ac6cb){return db['sequelize'][_0x3d8d('0x46')](function(_0x389d3b){return _0x4ac6cb[_0x3d8d('0x55')]({'transaction':_0x389d3b,'raw':!![]})[_0x3d8d('0x22')](function(_0x44a664){if(_0x44a664[_0x3d8d('0x49')]){fs[_0x3d8d('0x56')](_0x44a664['directory'])[_0x3d8d('0x57')](function(_0x2502e0){fs[_0x3d8d('0x58')](path[_0x3d8d('0x4a')](_0x44a664[_0x3d8d('0x49')],_0x2502e0));});fs[_0x3d8d('0x59')](_0x44a664[_0x3d8d('0x49')]);}return _0x44a664;});})[_0x3d8d('0x42')](function(_0x16e871){throw new db[(_0x3d8d('0x5a'))][(_0x3d8d('0x5b'))](_0x16e871[_0x3d8d('0x5c')]);});}})[_0x3d8d('0x22')](handleEntityNotFound(_0x1df669,null))[_0x3d8d('0x22')](removeEntity(_0x1df669,null))[_0x3d8d('0x42')](handleError(_0x1df669,null));};exports['addSound']=function(_0xbca50f,_0x5b0911,_0x18604b){return db[_0x3d8d('0x5d')][_0x3d8d('0x46')](function(_0x5d6a3f){var _0x1bdc6e;return db['VoiceMusicOnHold'][_0x3d8d('0x45')]({'where':{'id':_0xbca50f[_0x3d8d('0x43')]['id']}})[_0x3d8d('0x22')](function(_0x117dde){if(_0x117dde){_0x1bdc6e=_0x117dde;return _0x117dde[_0x3d8d('0x5e')](_0xbca50f[_0x3d8d('0x44')]['id'],{'transaction':_0x5d6a3f});}})[_0x3d8d('0x22')](function(_0xd3f262){if(_0xd3f262){return db[_0x3d8d('0x5f')][_0x3d8d('0x60')]({'where':{'id':_0xbca50f[_0x3d8d('0x44')]['id']},'attributes':['id','name',_0x3d8d('0x61'),_0x3d8d('0x62'),_0x3d8d('0x63')],'raw':!![]});}})[_0x3d8d('0x22')](function(_0x52ea50){if(_0x52ea50){var _0x143ffa=path[_0x3d8d('0x4a')](config[_0x3d8d('0x4b')],_0x3d8d('0x64'),util[_0x3d8d('0x65')](_0x3d8d('0x66'),path[_0x3d8d('0x67')](_0x52ea50[_0x3d8d('0x61')],path[_0x3d8d('0x68')](_0x52ea50['save_name'])),_0x52ea50[_0x3d8d('0x62')]));var _0x112f8f=path['join'](config[_0x3d8d('0x4b')],_0x3d8d('0x4c'),_0x1bdc6e[_0x3d8d('0x26')],util[_0x3d8d('0x65')](_0x3d8d('0x66'),_0x52ea50[_0x3d8d('0x26')],_0x52ea50[_0x3d8d('0x62')]));fs[_0x3d8d('0x69')](_0x143ffa,_0x112f8f);return _0x52ea50;}})[_0x3d8d('0x42')](function(_0xe7637d){throw new db[(_0x3d8d('0x5a'))]['ValidationError'](_0xe7637d[_0x3d8d('0x5c')]);});})['then'](handleEntityNotFound(_0x5b0911,null))[_0x3d8d('0x22')](respondWithResult(_0x5b0911,0xc9))[_0x3d8d('0x42')](handleError(_0x5b0911,null));};exports[_0x3d8d('0x6a')]=function(_0x3491a1,_0x106566,_0x3dc648){return db[_0x3d8d('0x5d')][_0x3d8d('0x46')](function(_0x16a504){var _0xae368;return db['VoiceMusicOnHold'][_0x3d8d('0x60')]({'where':{'id':_0x3491a1[_0x3d8d('0x43')]['id']}})[_0x3d8d('0x22')](handleEntityNotFound(_0x106566,null))[_0x3d8d('0x22')](function(_0x50249d){if(_0x50249d){_0xae368=_0x50249d;return _0x50249d[_0x3d8d('0x6a')](_0x3491a1['params'][_0x3d8d('0x6b')]);}})[_0x3d8d('0x22')](function(_0x1e8df3){if(_0x1e8df3){return db[_0x3d8d('0x5f')][_0x3d8d('0x60')]({'where':{'id':_0x3491a1[_0x3d8d('0x43')][_0x3d8d('0x6b')]},'attributes':['id',_0x3d8d('0x26'),'save_name','converted_format','createdAt'],'raw':!![]});}})[_0x3d8d('0x22')](function(_0x5bff97){if(_0x5bff97){fs[_0x3d8d('0x58')](path[_0x3d8d('0x4a')](_0xae368['directory'],util['format'](_0x3d8d('0x66'),_0x5bff97[_0x3d8d('0x26')],_0x5bff97['converted_format'])));return _0x5bff97;}})[_0x3d8d('0x42')](function(_0x27789a){throw new db['Sequelize']['ValidationError'](_0x27789a['message']);});})[_0x3d8d('0x22')](handleEntityNotFound(_0x106566,null))[_0x3d8d('0x22')](respondWithStatusCode(_0x106566,0xcc))[_0x3d8d('0x42')](handleError(_0x106566,null));};exports['getSounds']=function(_0x587d10,_0x16cac8,_0x50844e){var _0x17af8e={};var _0x30b9={};var _0x5b84eb;var _0x4ae936;return db[_0x3d8d('0x29')][_0x3d8d('0x60')]({'where':{'id':_0x587d10[_0x3d8d('0x43')]['id']}})[_0x3d8d('0x22')](handleEntityNotFound(_0x16cac8,null))[_0x3d8d('0x22')](function(_0x512d06){if(_0x512d06){_0x5b84eb=_0x512d06;_0x30b9[_0x3d8d('0x2d')]=_[_0x3d8d('0x30')](db['Sound'][_0x3d8d('0x6c')]);_0x30b9[_0x3d8d('0x2f')]=_[_0x3d8d('0x30')](_0x587d10[_0x3d8d('0x2f')]);_0x30b9[_0x3d8d('0x31')]=_['intersection'](_0x30b9[_0x3d8d('0x2d')],_0x30b9[_0x3d8d('0x2f')]);_0x17af8e[_0x3d8d('0x34')]=_[_0x3d8d('0x32')](_0x30b9[_0x3d8d('0x2d')],qs[_0x3d8d('0x33')](_0x587d10[_0x3d8d('0x2f')][_0x3d8d('0x33')]));_0x17af8e[_0x3d8d('0x34')]=_0x17af8e[_0x3d8d('0x34')][_0x3d8d('0x35')]?_0x17af8e[_0x3d8d('0x34')]:_0x30b9[_0x3d8d('0x2d')];_0x17af8e['order']=qs[_0x3d8d('0x39')](_0x587d10['query']['sort']);_0x17af8e[_0x3d8d('0x3b')]=qs['filters'](_[_0x3d8d('0x3a')](_0x587d10[_0x3d8d('0x2f')],_0x30b9[_0x3d8d('0x31')]));if(_0x587d10[_0x3d8d('0x2f')][_0x3d8d('0x3d')]){_0x17af8e[_0x3d8d('0x3b')]=_[_0x3d8d('0x3c')](_0x17af8e[_0x3d8d('0x3b')],{'$or':_['map'](_0x17af8e[_0x3d8d('0x34')],function(_0x2a5ebc){var _0x39093a={};_0x39093a[_0x2a5ebc]={'$like':'%'+_0x587d10[_0x3d8d('0x2f')][_0x3d8d('0x3d')]+'%'};return _0x39093a;})});}_0x17af8e=_['merge']({},_0x17af8e,_0x587d10[_0x3d8d('0x3e')]);return _0x5b84eb[_0x3d8d('0x6d')](_0x17af8e);}})[_0x3d8d('0x22')](function(_0x5325cf){if(_0x5325cf){_0x4ae936=_0x5325cf[_0x3d8d('0x35')];if(!_0x587d10[_0x3d8d('0x2f')]['hasOwnProperty'](_0x3d8d('0x37'))){_0x17af8e[_0x3d8d('0x1c')]=qs[_0x3d8d('0x1c')](_0x587d10[_0x3d8d('0x2f')][_0x3d8d('0x1c')]);_0x17af8e[_0x3d8d('0x1a')]=qs['offset'](_0x587d10[_0x3d8d('0x2f')]['offset']);}return _0x5b84eb['getSounds'](_0x17af8e);}})[_0x3d8d('0x22')](function(_0x3fb665){if(_0x3fb665){return _0x3fb665?{'count':_0x4ae936,'rows':_0x3fb665}:null;}})['then'](respondWithResult(_0x16cac8,null))['catch'](handleError(_0x16cac8,null));}; \ No newline at end of file +var _0x8df1=['offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','end','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','VoiceMusicOnHold','includeAll','include','findAll','rows','catch','show','params','find','body','create','mode','files','directory','join','root','server/files/moh','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','sequelize','transaction','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','addSound','save_name','converted_format','%s.%s','basename','extname','format','message','removeSound','findOne','id2','getSounds','Sound','pick','hasOwnProperty','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8df1,0x1a9));var _0x18df=function(_0x28b43b,_0x21b019){_0x28b43b=_0x28b43b-0x0;var _0x3d2c01=_0x8df1[_0x28b43b];return _0x3d2c01;};'use strict';var emlformat=require(_0x18df('0x0'));var rimraf=require(_0x18df('0x1'));var zipdir=require(_0x18df('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x18df('0x3'));var BPromise=require(_0x18df('0x4'));var Mustache=require(_0x18df('0x5'));var util=require(_0x18df('0x6'));var path=require('path');var sox=require(_0x18df('0x7'));var csv=require(_0x18df('0x8'));var ejs=require(_0x18df('0x9'));var fs=require('fs');var fs_extra=require(_0x18df('0xa'));var _=require(_0x18df('0xb'));var squel=require(_0x18df('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x18df('0xd'));var toCsv=require(_0x18df('0x8'));var querystring=require(_0x18df('0xe'));var Papa=require(_0x18df('0xf'));var Redis=require(_0x18df('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x18df('0x11'));var logger=require(_0x18df('0x12'))(_0x18df('0x13'));var utils=require(_0x18df('0x14'));var config=require(_0x18df('0x15'));var licenseUtil=require(_0x18df('0x16'));var db=require(_0x18df('0x17'))['db'];function respondWithStatusCode(_0x2b0b95,_0x174870){_0x174870=_0x174870||0xcc;return function(_0x8d1ddc){if(_0x8d1ddc){return _0x2b0b95[_0x18df('0x18')](_0x174870);}return _0x2b0b95[_0x18df('0x19')](_0x174870)['end']();};}function respondWithResult(_0x748e4a,_0x4196ee){_0x4196ee=_0x4196ee||0xc8;return function(_0x1fb5b6){if(_0x1fb5b6){return _0x748e4a[_0x18df('0x19')](_0x4196ee)[_0x18df('0x1a')](_0x1fb5b6);}};}function respondWithFilteredResult(_0x3fa401,_0x432dd9){return function(_0x2b6f47){if(_0x2b6f47){var _0x1748d9=typeof _0x432dd9[_0x18df('0x1b')]==='undefined'&&typeof _0x432dd9[_0x18df('0x1c')]==='undefined';var _0x4692fe=_0x2b6f47[_0x18df('0x1d')];var _0x1e8f3f=_0x1748d9?0x0:_0x432dd9[_0x18df('0x1b')];var _0x21493b=_0x1748d9?_0x2b6f47[_0x18df('0x1d')]:_0x432dd9[_0x18df('0x1b')]+_0x432dd9[_0x18df('0x1c')];var _0x5e8629;if(_0x21493b>=_0x4692fe){_0x21493b=_0x4692fe;_0x5e8629=0xc8;}else{_0x5e8629=0xce;}_0x3fa401[_0x18df('0x19')](_0x5e8629);return _0x3fa401[_0x18df('0x1e')](_0x18df('0x1f'),_0x1e8f3f+'-'+_0x21493b+'/'+_0x4692fe)[_0x18df('0x1a')](_0x2b6f47);}return null;};}function patchUpdates(_0xdc18aa){return function(_0x4a1382){try{jsonpatch[_0x18df('0x20')](_0x4a1382,_0xdc18aa,!![]);}catch(_0x2a9be1){return BPromise[_0x18df('0x21')](_0x2a9be1);}return _0x4a1382[_0x18df('0x22')]();};}function saveUpdates(_0x34a254,_0x1d17bb){return function(_0x3b70e4){if(_0x3b70e4){return _0x3b70e4[_0x18df('0x23')](_0x34a254)[_0x18df('0x24')](function(_0x3a2424){return _0x3a2424;});}return null;};}function removeEntity(_0x3c895c,_0x3d80fe){return function(_0x55a8aa){if(_0x55a8aa){return _0x55a8aa[_0x18df('0x25')]()[_0x18df('0x24')](function(){var _0x11d0b0=_0x55a8aa[_0x18df('0x26')]({'plain':!![]});var _0x22e383=_0x18df('0x27');return db[_0x18df('0x28')][_0x18df('0x25')]({'where':{'type':_0x22e383,'resourceId':_0x11d0b0['id']}})[_0x18df('0x24')](function(){return _0x55a8aa;});})['then'](function(){_0x3c895c[_0x18df('0x19')](0xcc)[_0x18df('0x29')]();});}};}function handleEntityNotFound(_0x1b4ecf,_0x18f1d2){return function(_0x546cc6){if(!_0x546cc6){_0x1b4ecf['sendStatus'](0x194);}return _0x546cc6;};}function handleError(_0x1e97b7,_0x5b1748){_0x5b1748=_0x5b1748||0x1f4;return function(_0x2d116b){logger['error'](_0x2d116b['stack']);if(_0x2d116b[_0x18df('0x2a')]){delete _0x2d116b['name'];}_0x1e97b7[_0x18df('0x19')](_0x5b1748)[_0x18df('0x2b')](_0x2d116b);};}exports[_0x18df('0x2c')]=function(_0x345c3b,_0x206820){var _0x362b31={},_0x33a36a={},_0x271944={'count':0x0,'rows':[]};var _0x26d3cc=_[_0x18df('0x2d')](db['VoiceMusicOnHold'][_0x18df('0x2e')],function(_0x394efb){return{'name':_0x394efb[_0x18df('0x2f')],'type':_0x394efb[_0x18df('0x30')][_0x18df('0x31')]};});_0x33a36a[_0x18df('0x32')]=_[_0x18df('0x2d')](_0x26d3cc,_0x18df('0x2a'));_0x33a36a[_0x18df('0x33')]=_[_0x18df('0x34')](_0x345c3b['query']);_0x33a36a[_0x18df('0x35')]=_[_0x18df('0x36')](_0x33a36a[_0x18df('0x32')],_0x33a36a[_0x18df('0x33')]);_0x362b31[_0x18df('0x37')]=_[_0x18df('0x36')](_0x33a36a['model'],qs[_0x18df('0x38')](_0x345c3b[_0x18df('0x33')][_0x18df('0x38')]));_0x362b31[_0x18df('0x37')]=_0x362b31['attributes'][_0x18df('0x39')]?_0x362b31['attributes']:_0x33a36a[_0x18df('0x32')];if(!_0x345c3b['query']['hasOwnProperty'](_0x18df('0x3a'))){_0x362b31[_0x18df('0x1c')]=qs[_0x18df('0x1c')](_0x345c3b[_0x18df('0x33')][_0x18df('0x1c')]);_0x362b31[_0x18df('0x1b')]=qs[_0x18df('0x1b')](_0x345c3b[_0x18df('0x33')][_0x18df('0x1b')]);}_0x362b31['order']=qs[_0x18df('0x3b')](_0x345c3b[_0x18df('0x33')]['sort']);delete _0x345c3b[_0x18df('0x33')][_0x18df('0x3b')];_0x362b31[_0x18df('0x3c')]=qs[_0x18df('0x35')](_['pick'](_0x345c3b[_0x18df('0x33')],_0x33a36a[_0x18df('0x35')]),_0x26d3cc);if(_0x345c3b[_0x18df('0x33')][_0x18df('0x3d')]){_0x362b31[_0x18df('0x3c')]=_[_0x18df('0x3e')](_0x362b31[_0x18df('0x3c')],{'$or':_[_0x18df('0x2d')](_0x26d3cc,function(_0x374d56){if(_0x374d56[_0x18df('0x30')]!==_0x18df('0x3f')){var _0x4115cb={};_0x4115cb[_0x374d56[_0x18df('0x2a')]]={'$like':'%'+_0x345c3b[_0x18df('0x33')]['filter']+'%'};return _0x4115cb;}})});}_0x362b31=_[_0x18df('0x3e')]({},_0x362b31,_0x345c3b[_0x18df('0x40')]);var _0x1e03b4={'where':_0x362b31[_0x18df('0x3c')]};return db[_0x18df('0x41')][_0x18df('0x1d')](_0x1e03b4)[_0x18df('0x24')](function(_0x450e19){_0x271944[_0x18df('0x1d')]=_0x450e19;if(_0x345c3b[_0x18df('0x33')][_0x18df('0x42')]){_0x362b31[_0x18df('0x43')]=[{'all':!![]}];}return db[_0x18df('0x41')][_0x18df('0x44')](_0x362b31);})[_0x18df('0x24')](function(_0x5d7d73){_0x271944[_0x18df('0x45')]=_0x5d7d73;return _0x271944;})[_0x18df('0x24')](respondWithFilteredResult(_0x206820,_0x362b31))[_0x18df('0x46')](handleError(_0x206820,null));};exports[_0x18df('0x47')]=function(_0x89c12d,_0x507c33){var _0xec0bbd={'raw':![],'where':{'id':_0x89c12d[_0x18df('0x48')]['id']}},_0xedb0ed={};_0xedb0ed[_0x18df('0x32')]=_[_0x18df('0x34')](db[_0x18df('0x41')][_0x18df('0x2e')]);_0xedb0ed['query']=_[_0x18df('0x34')](_0x89c12d['query']);_0xedb0ed[_0x18df('0x35')]=_[_0x18df('0x36')](_0xedb0ed['model'],_0xedb0ed[_0x18df('0x33')]);_0xec0bbd[_0x18df('0x37')]=_['intersection'](_0xedb0ed[_0x18df('0x32')],qs[_0x18df('0x38')](_0x89c12d[_0x18df('0x33')]['fields']));_0xec0bbd[_0x18df('0x37')]=_0xec0bbd[_0x18df('0x37')][_0x18df('0x39')]?_0xec0bbd[_0x18df('0x37')]:_0xedb0ed[_0x18df('0x32')];if(_0x89c12d['query']['includeAll']){_0xec0bbd[_0x18df('0x43')]=[{'all':!![]}];}_0xec0bbd=_[_0x18df('0x3e')]({},_0xec0bbd,_0x89c12d[_0x18df('0x40')]);return db[_0x18df('0x41')][_0x18df('0x49')](_0xec0bbd)[_0x18df('0x24')](handleEntityNotFound(_0x507c33,null))['then'](respondWithResult(_0x507c33,null))[_0x18df('0x46')](handleError(_0x507c33,null));};exports[_0x18df('0x23')]=function(_0x8ba1fe,_0x5e204a){if(_0x8ba1fe[_0x18df('0x4a')]['id']){delete _0x8ba1fe[_0x18df('0x4a')]['id'];}return db[_0x18df('0x41')][_0x18df('0x49')]({'where':{'id':_0x8ba1fe[_0x18df('0x48')]['id']}})['then'](handleEntityNotFound(_0x5e204a,null))[_0x18df('0x24')](saveUpdates(_0x8ba1fe[_0x18df('0x4a')],null))[_0x18df('0x24')](respondWithResult(_0x5e204a,null))['catch'](handleError(_0x5e204a,null));};exports[_0x18df('0x4b')]=function(_0x21d5c4,_0x26a1e9,_0x5bf6ac){return db['sequelize']['transaction'](function(_0x4da553){if(_0x21d5c4[_0x18df('0x4a')][_0x18df('0x4c')]===_0x18df('0x4d')){_0x21d5c4[_0x18df('0x4a')][_0x18df('0x4e')]=path[_0x18df('0x4f')](config[_0x18df('0x50')],_0x18df('0x51'),_0x21d5c4[_0x18df('0x4a')]['name']);}return db['VoiceMusicOnHold'][_0x18df('0x4b')](_0x21d5c4[_0x18df('0x4a')],{'transaction':_0x4da553})['then'](function(_0x44b4d5){if(_0x21d5c4[_0x18df('0x4a')]['mode']===_0x18df('0x4d')){fs[_0x18df('0x52')](_0x44b4d5[_0x18df('0x4e')],parseInt(_0x18df('0x53'),0x8));}var _0x33dd2e=_0x21d5c4['user'][_0x18df('0x26')]({'plain':!![]});if(!_0x33dd2e)throw new Error(_0x18df('0x54'));if(_0x33dd2e[_0x18df('0x55')]===_0x18df('0x56')){var _0x1ba6a7=_0x44b4d5['get']({'plain':!![]});return db[_0x18df('0x57')][_0x18df('0x49')]({'where':{'name':_0x18df('0x27'),'userProfileId':_0x33dd2e[_0x18df('0x58')]},'raw':!![]})[_0x18df('0x24')](function(_0x515dba){if(_0x515dba&&_0x515dba[_0x18df('0x59')]===0x0){return db['UserProfileResource'][_0x18df('0x4b')]({'name':_0x1ba6a7[_0x18df('0x2a')],'resourceId':_0x1ba6a7['id'],'type':_0x515dba[_0x18df('0x2a')],'sectionId':_0x515dba['id']},{})[_0x18df('0x24')](function(){return _0x44b4d5;});}else{return _0x44b4d5;}})['catch'](function(_0x3fc704){logger[_0x18df('0x5a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3fc704);});}return _0x44b4d5;});})[_0x18df('0x24')](respondWithResult(_0x26a1e9,0xc9))[_0x18df('0x46')](handleError(_0x26a1e9,null));};exports[_0x18df('0x25')]=function(_0x413240,_0x264b44,_0x3cb0ec){var _0x3b30cb;return db[_0x18df('0x41')][_0x18df('0x49')]({'where':{'id':_0x413240[_0x18df('0x48')]['id']}})['then'](function(_0x3fab68){if(_0x3fab68){return db[_0x18df('0x5b')][_0x18df('0x5c')](function(_0x5cb3c1){return _0x3fab68['destroy']({'transaction':_0x5cb3c1,'raw':!![]})[_0x18df('0x24')](function(_0x66ade3){if(_0x66ade3[_0x18df('0x4e')]){fs[_0x18df('0x5d')](_0x66ade3[_0x18df('0x4e')])[_0x18df('0x5e')](function(_0xc3af1f){fs[_0x18df('0x5f')](path[_0x18df('0x4f')](_0x66ade3[_0x18df('0x4e')],_0xc3af1f));});fs['rmdirSync'](_0x66ade3['directory']);}return _0x66ade3;});})[_0x18df('0x46')](function(_0x5f0f43){throw new db[(_0x18df('0x60'))][(_0x18df('0x61'))](_0x5f0f43['message']);});}})['then'](handleEntityNotFound(_0x264b44,null))[_0x18df('0x24')](removeEntity(_0x264b44,null))['catch'](handleError(_0x264b44,null));};exports[_0x18df('0x62')]=function(_0x52aecb,_0x56b91e,_0x162399){return db[_0x18df('0x5b')][_0x18df('0x5c')](function(_0x4634d8){var _0x1fb04f;return db[_0x18df('0x41')][_0x18df('0x49')]({'where':{'id':_0x52aecb[_0x18df('0x48')]['id']}})[_0x18df('0x24')](function(_0x845db7){if(_0x845db7){_0x1fb04f=_0x845db7;return _0x845db7[_0x18df('0x62')](_0x52aecb[_0x18df('0x4a')]['id'],{'transaction':_0x4634d8});}})[_0x18df('0x24')](function(_0x538797){if(_0x538797){return db['Sound']['findOne']({'where':{'id':_0x52aecb[_0x18df('0x4a')]['id']},'attributes':['id','name',_0x18df('0x63'),_0x18df('0x64'),'createdAt'],'raw':!![]});}})['then'](function(_0x28e712){if(_0x28e712){var _0x4ab2e7=path[_0x18df('0x4f')](config[_0x18df('0x50')],'server/files/sounds/converted',util['format'](_0x18df('0x65'),path[_0x18df('0x66')](_0x28e712[_0x18df('0x63')],path[_0x18df('0x67')](_0x28e712[_0x18df('0x63')])),_0x28e712[_0x18df('0x64')]));var _0x5555ca=path[_0x18df('0x4f')](config[_0x18df('0x50')],_0x18df('0x51'),_0x1fb04f[_0x18df('0x2a')],util[_0x18df('0x68')](_0x18df('0x65'),_0x28e712['name'],_0x28e712[_0x18df('0x64')]));fs['symlinkSync'](_0x4ab2e7,_0x5555ca);return _0x28e712;}})['catch'](function(_0x2a960c){throw new db[(_0x18df('0x60'))][(_0x18df('0x61'))](_0x2a960c[_0x18df('0x69')]);});})[_0x18df('0x24')](handleEntityNotFound(_0x56b91e,null))['then'](respondWithResult(_0x56b91e,0xc9))[_0x18df('0x46')](handleError(_0x56b91e,null));};exports[_0x18df('0x6a')]=function(_0x1dfd66,_0x194620,_0x299c51){return db[_0x18df('0x5b')][_0x18df('0x5c')](function(_0x37730d){var _0x1792fb;return db[_0x18df('0x41')]['findOne']({'where':{'id':_0x1dfd66['params']['id']}})[_0x18df('0x24')](handleEntityNotFound(_0x194620,null))['then'](function(_0x174448){if(_0x174448){_0x1792fb=_0x174448;return _0x174448['removeSound'](_0x1dfd66[_0x18df('0x48')]['id2']);}})[_0x18df('0x24')](function(_0x5e02b0){if(_0x5e02b0){return db['Sound'][_0x18df('0x6b')]({'where':{'id':_0x1dfd66[_0x18df('0x48')][_0x18df('0x6c')]},'attributes':['id',_0x18df('0x2a'),_0x18df('0x63'),_0x18df('0x64'),'createdAt'],'raw':!![]});}})[_0x18df('0x24')](function(_0x5bcb81){if(_0x5bcb81){fs[_0x18df('0x5f')](path[_0x18df('0x4f')](_0x1792fb[_0x18df('0x4e')],util['format'](_0x18df('0x65'),_0x5bcb81[_0x18df('0x2a')],_0x5bcb81['converted_format'])));return _0x5bcb81;}})['catch'](function(_0x1a3e76){throw new db[(_0x18df('0x60'))]['ValidationError'](_0x1a3e76[_0x18df('0x69')]);});})[_0x18df('0x24')](handleEntityNotFound(_0x194620,null))[_0x18df('0x24')](respondWithStatusCode(_0x194620,0xcc))[_0x18df('0x46')](handleError(_0x194620,null));};exports[_0x18df('0x6d')]=function(_0x46b4ba,_0xf9aa47,_0x374c0b){var _0x3ae894={};var _0x5bb0c1={};var _0x2fa0a6;var _0x303f54;return db[_0x18df('0x41')][_0x18df('0x6b')]({'where':{'id':_0x46b4ba[_0x18df('0x48')]['id']}})[_0x18df('0x24')](handleEntityNotFound(_0xf9aa47,null))[_0x18df('0x24')](function(_0x88e196){if(_0x88e196){_0x2fa0a6=_0x88e196;_0x5bb0c1[_0x18df('0x32')]=_[_0x18df('0x34')](db[_0x18df('0x6e')][_0x18df('0x2e')]);_0x5bb0c1[_0x18df('0x33')]=_[_0x18df('0x34')](_0x46b4ba[_0x18df('0x33')]);_0x5bb0c1[_0x18df('0x35')]=_[_0x18df('0x36')](_0x5bb0c1[_0x18df('0x32')],_0x5bb0c1[_0x18df('0x33')]);_0x3ae894[_0x18df('0x37')]=_[_0x18df('0x36')](_0x5bb0c1['model'],qs['fields'](_0x46b4ba[_0x18df('0x33')][_0x18df('0x38')]));_0x3ae894[_0x18df('0x37')]=_0x3ae894[_0x18df('0x37')][_0x18df('0x39')]?_0x3ae894[_0x18df('0x37')]:_0x5bb0c1[_0x18df('0x32')];_0x3ae894['order']=qs[_0x18df('0x3b')](_0x46b4ba[_0x18df('0x33')]['sort']);_0x3ae894[_0x18df('0x3c')]=qs[_0x18df('0x35')](_[_0x18df('0x6f')](_0x46b4ba[_0x18df('0x33')],_0x5bb0c1[_0x18df('0x35')]));if(_0x46b4ba[_0x18df('0x33')][_0x18df('0x3d')]){_0x3ae894[_0x18df('0x3c')]=_[_0x18df('0x3e')](_0x3ae894[_0x18df('0x3c')],{'$or':_['map'](_0x3ae894[_0x18df('0x37')],function(_0x221c3a){var _0x5517f4={};_0x5517f4[_0x221c3a]={'$like':'%'+_0x46b4ba['query'][_0x18df('0x3d')]+'%'};return _0x5517f4;})});}_0x3ae894=_[_0x18df('0x3e')]({},_0x3ae894,_0x46b4ba['options']);return _0x2fa0a6[_0x18df('0x6d')](_0x3ae894);}})[_0x18df('0x24')](function(_0x15d437){if(_0x15d437){_0x303f54=_0x15d437[_0x18df('0x39')];if(!_0x46b4ba[_0x18df('0x33')][_0x18df('0x70')](_0x18df('0x3a'))){_0x3ae894[_0x18df('0x1c')]=qs['limit'](_0x46b4ba[_0x18df('0x33')][_0x18df('0x1c')]);_0x3ae894['offset']=qs[_0x18df('0x1b')](_0x46b4ba[_0x18df('0x33')]['offset']);}return _0x2fa0a6[_0x18df('0x6d')](_0x3ae894);}})['then'](function(_0x3a6518){if(_0x3a6518){return _0x3a6518?{'count':_0x303f54,'rows':_0x3a6518}:null;}})[_0x18df('0x24')](respondWithResult(_0xf9aa47,null))[_0x18df('0x46')](handleError(_0xf9aa47,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index c216201..3cc4ccd 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 _0xd0da=['request-promise','path','rimraf','voice_musiconhold','lodash','util','../../config/logger','moment'];(function(_0x53dd63,_0x5e1852){var _0x460c0a=function(_0x599511){while(--_0x599511){_0x53dd63['push'](_0x53dd63['shift']());}};_0x460c0a(++_0x5e1852);}(_0xd0da,0x7c));var _0xad0d=function(_0x3a6194,_0x4574e2){_0x3a6194=_0x3a6194-0x0;var _0x298116=_0xd0da[_0x3a6194];return _0x298116;};'use strict';var _=require(_0xad0d('0x0'));var util=require(_0xad0d('0x1'));var logger=require(_0xad0d('0x2'))('api');var moment=require(_0xad0d('0x3'));var BPromise=require('bluebird');var rp=require(_0xad0d('0x4'));var fs=require('fs');var path=require(_0xad0d('0x5'));var rimraf=require(_0xad0d('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x46e793,_0x54245e){return _0x46e793['define']('VoiceMusicOnHold',attributes,{'tableName':_0xad0d('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f34=['./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3344cc,_0x584c19){var _0x5f0082=function(_0x15bcba){while(--_0x15bcba){_0x3344cc['push'](_0x3344cc['shift']());}};_0x5f0082(++_0x584c19);}(_0x9f34,0x13d));var _0x49f3=function(_0xc23f79,_0x3b670a){_0xc23f79=_0xc23f79-0x0;var _0x143502=_0x9f34[_0xc23f79];return _0x143502;};'use strict';var _=require('lodash');var util=require(_0x49f3('0x0'));var logger=require(_0x49f3('0x1'))(_0x49f3('0x2'));var moment=require(_0x49f3('0x3'));var BPromise=require(_0x49f3('0x4'));var rp=require(_0x49f3('0x5'));var fs=require('fs');var path=require(_0x49f3('0x6'));var rimraf=require('rimraf');var config=require(_0x49f3('0x7'));var attributes=require(_0x49f3('0x8'));module[_0x49f3('0x9')]=function(_0x3ace7d,_0x4e224f){return _0x3ace7d[_0x49f3('0xa')](_0x49f3('0xb'),attributes,{'tableName':_0x49f3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 60763c5..9bc6b41 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 _0x70e0=['code','VoiceMusicOnHold,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x395cea,_0x137431){var _0x104804=function(_0x5c43ba){while(--_0x5c43ba){_0x395cea['push'](_0x395cea['shift']());}};_0x104804(++_0x137431);}(_0x70e0,0x17b));var _0x070e=function(_0x289906,_0x40f55d){_0x289906=_0x289906-0x0;var _0xb4a82b=_0x70e0[_0x289906];return _0xb4a82b;};'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')]('VoiceMusicOnHold,\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')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('VoiceMusicOnHold,\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);});});} \ No newline at end of file +var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\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(_0x54805f,_0x1d10e4){var _0x12d872=function(_0x382b69){while(--_0x382b69){_0x54805f['push'](_0x54805f['shift']());}};_0x12d872(++_0x1d10e4);}(_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')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\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')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index acf25f1..9385cf6 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 _0xe444=['show','/:id/users','getTeams','post','create','addAgents','/:id/teams','addTeams','put','/:id','update','destroy','delete','removeAgents','removeTeams','exports','multer','util','express','Router','fs-extra','../../components/auth/service','./voicePrefix.controller','get','isAuthenticated','/describe'];(function(_0x233d84,_0x3f63c9){var _0x33f28f=function(_0x27646b){while(--_0x27646b){_0x233d84['push'](_0x233d84['shift']());}};_0x33f28f(++_0x3f63c9);}(_0xe444,0xe0));var _0x4e44=function(_0x2c0464,_0x5316c4){_0x2c0464=_0x2c0464-0x0;var _0x5818d7=_0xe444[_0x2c0464];return _0x5818d7;};'use strict';var multer=require(_0x4e44('0x0'));var util=require(_0x4e44('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4e44('0x2'));var router=express[_0x4e44('0x3')]();var fs_extra=require(_0x4e44('0x4'));var auth=require(_0x4e44('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4e44('0x6'));router[_0x4e44('0x7')]('/',auth[_0x4e44('0x8')](),controller['index']);router[_0x4e44('0x7')](_0x4e44('0x9'),auth[_0x4e44('0x8')](),controller['describe']);router[_0x4e44('0x7')]('/:id',auth[_0x4e44('0x8')](),controller[_0x4e44('0xa')]);router[_0x4e44('0x7')](_0x4e44('0xb'),auth[_0x4e44('0x8')](),controller['getAgents']);router[_0x4e44('0x7')]('/:id/teams',auth[_0x4e44('0x8')](),controller[_0x4e44('0xc')]);router[_0x4e44('0xd')]('/',auth[_0x4e44('0x8')](),controller[_0x4e44('0xe')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x4e44('0xf')]);router['post'](_0x4e44('0x10'),auth[_0x4e44('0x8')](),controller[_0x4e44('0x11')]);router[_0x4e44('0x12')](_0x4e44('0x13'),auth[_0x4e44('0x8')](),controller[_0x4e44('0x14')]);router['delete'](_0x4e44('0x13'),auth[_0x4e44('0x8')](),controller[_0x4e44('0x15')]);router[_0x4e44('0x16')](_0x4e44('0xb'),auth[_0x4e44('0x8')](),controller[_0x4e44('0x17')]);router['delete'](_0x4e44('0x10'),auth[_0x4e44('0x8')](),controller[_0x4e44('0x18')]);module[_0x4e44('0x19')]=router; \ No newline at end of file +var _0x5900=['../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','getAgents','/:id/teams','post','/:id/users','addAgents','addTeams','update','destroy','delete','removeAgents','exports','util','path','express','Router','fs-extra','../../components/interaction/service'];(function(_0x51cc1b,_0xc6adf2){var _0x4718e3=function(_0x51eaaf){while(--_0x51eaaf){_0x51cc1b['push'](_0x51cc1b['shift']());}};_0x4718e3(++_0xc6adf2);}(_0x5900,0xd2));var _0x0590=function(_0x456eae,_0x4290c3){_0x456eae=_0x456eae-0x0;var _0x49f4b1=_0x5900[_0x456eae];return _0x49f4b1;};'use strict';var multer=require('multer');var util=require(_0x0590('0x0'));var path=require(_0x0590('0x1'));var timeout=require('connect-timeout');var express=require(_0x0590('0x2'));var router=express[_0x0590('0x3')]();var fs_extra=require(_0x0590('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0590('0x5'));var config=require(_0x0590('0x6'));var controller=require('./voicePrefix.controller');router[_0x0590('0x7')]('/',auth[_0x0590('0x8')](),controller['index']);router[_0x0590('0x7')](_0x0590('0x9'),auth[_0x0590('0x8')](),controller[_0x0590('0xa')]);router[_0x0590('0x7')](_0x0590('0xb'),auth[_0x0590('0x8')](),controller[_0x0590('0xc')]);router[_0x0590('0x7')]('/:id/users',auth[_0x0590('0x8')](),controller[_0x0590('0xd')]);router['get'](_0x0590('0xe'),auth[_0x0590('0x8')](),controller['getTeams']);router['post']('/',auth[_0x0590('0x8')](),controller['create']);router[_0x0590('0xf')](_0x0590('0x10'),auth[_0x0590('0x8')](),controller[_0x0590('0x11')]);router[_0x0590('0xf')]('/:id/teams',auth[_0x0590('0x8')](),controller[_0x0590('0x12')]);router['put'](_0x0590('0xb'),auth[_0x0590('0x8')](),controller[_0x0590('0x13')]);router['delete'](_0x0590('0xb'),auth['isAuthenticated'](),controller[_0x0590('0x14')]);router[_0x0590('0x15')](_0x0590('0x10'),auth[_0x0590('0x8')](),controller[_0x0590('0x16')]);router[_0x0590('0x15')](_0x0590('0xe'),auth['isAuthenticated'](),controller['removeTeams']);module[_0x0590('0x17')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 114c46c..e9077b8 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 _0x8f7e=['getDataValue','INTEGER','exports','STRING','name','VIRTUAL','system-'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x8f7e,0x13d));var _0xe8f7=function(_0x45a150,_0x6ace92){_0x45a150=_0x45a150-0x0;var _0x1e0cb1=_0x8f7e[_0x45a150];return _0x1e0cb1;};'use strict';var Sequelize=require('sequelize');module[_0xe8f7('0x0')]={'name':{'type':Sequelize[_0xe8f7('0x1')],'allowNull':![],'unique':_0xe8f7('0x2')},'prefix':{'type':Sequelize[_0xe8f7('0x3')],'get':function(_0x157ad7){return _0xe8f7('0x4')+this[_0xe8f7('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0xe8f7('0x1')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0xe8f7('0x6')]}}; \ No newline at end of file +var _0xa945=['getDataValue','INTEGER','sequelize','STRING','name','system-'];(function(_0x3abff3,_0x4200ba){var _0x562ae9=function(_0x59ba9b){while(--_0x59ba9b){_0x3abff3['push'](_0x3abff3['shift']());}};_0x562ae9(++_0x4200ba);}(_0xa945,0x1a6));var _0x5a94=function(_0x249f7e,_0x2fa170){_0x249f7e=_0x249f7e-0x0;var _0x31fd45=_0xa945[_0x249f7e];return _0x31fd45;};'use strict';var Sequelize=require(_0x5a94('0x0'));module['exports']={'name':{'type':Sequelize[_0x5a94('0x1')],'allowNull':![],'unique':_0x5a94('0x2')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x1a4347){return _0x5a94('0x3')+this[_0x5a94('0x4')](_0x5a94('0x2'))+'-';}},'description':{'type':Sequelize[_0x5a94('0x1')]},'callerIdAll':{'type':Sequelize[_0x5a94('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0x5a94('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 4ddf74e..34d79f0 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 _0x02ce=['apply','reject','save','update','destroy','then','get','VoicePrefixes','UserProfileResource','sendStatus','error','name','send','index','map','VoicePrefix','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','show','params','length','find','catch','sequelize','body','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','create','context','from-sip','exten','app','type','description','Voice\x20Prefix\x20Extension','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','callerIdAll','Set','PREFIX-CALLERIDALL=','${EXTEN:','charAt','system-','transaction','VoiceExtension','findById','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','getAgents','User','pick','findOne','Team','getTeams','addTeams','online','voicePause','flatMap','Agents','each','TeamVoicePrefix','upsert','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','union','compact','value','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voicePrefix.socket','status','end','json','undefined','limit','count','offset','set'];(function(_0x5afaf2,_0xe98979){var _0x4cb867=function(_0x472969){while(--_0x472969){_0x5afaf2['push'](_0x5afaf2['shift']());}};_0x4cb867(++_0xe98979);}(_0x02ce,0x1ac));var _0xe02c=function(_0x1d4a8,_0x496c80){_0x1d4a8=_0x1d4a8-0x0;var _0x382be7=_0x02ce[_0x1d4a8];return _0x382be7;};'use strict';var emlformat=require(_0xe02c('0x0'));var rimraf=require(_0xe02c('0x1'));var zipdir=require(_0xe02c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe02c('0x3'));var moment=require('moment');var BPromise=require(_0xe02c('0x4'));var Mustache=require(_0xe02c('0x5'));var util=require(_0xe02c('0x6'));var path=require(_0xe02c('0x7'));var sox=require(_0xe02c('0x8'));var csv=require(_0xe02c('0x9'));var ejs=require(_0xe02c('0xa'));var fs=require('fs');var fs_extra=require(_0xe02c('0xb'));var _=require(_0xe02c('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe02c('0xd'));var deskjs=require(_0xe02c('0xe'));var toCsv=require(_0xe02c('0x9'));var querystring=require(_0xe02c('0xf'));var Papa=require(_0xe02c('0x10'));var Redis=require(_0xe02c('0x11'));var authService=require(_0xe02c('0x12'));var qs=require(_0xe02c('0x13'));var as=require(_0xe02c('0x14'));var hardwareService=require(_0xe02c('0x15'));var logger=require(_0xe02c('0x16'))(_0xe02c('0x17'));var utils=require(_0xe02c('0x18'));var config=require(_0xe02c('0x19'));var licenseUtil=require(_0xe02c('0x1a'));var db=require(_0xe02c('0x1b'))['db'];config[_0xe02c('0x1c')]=_[_0xe02c('0x1d')](config['redis'],{'host':_0xe02c('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe02c('0x1f'))['register'](socket);function respondWithStatusCode(_0x221910,_0x59614c){_0x59614c=_0x59614c||0xcc;return function(_0x3a5a2c){if(_0x3a5a2c){return _0x221910['sendStatus'](_0x59614c);}return _0x221910[_0xe02c('0x20')](_0x59614c)[_0xe02c('0x21')]();};}function respondWithResult(_0x59f2f6,_0x10a2a6){_0x10a2a6=_0x10a2a6||0xc8;return function(_0x226a80){if(_0x226a80){return _0x59f2f6['status'](_0x10a2a6)[_0xe02c('0x22')](_0x226a80);}};}function respondWithFilteredResult(_0x20f492,_0x5a4583){return function(_0x52917f){if(_0x52917f){var _0x3e37bf=typeof _0x5a4583['offset']===_0xe02c('0x23')&&typeof _0x5a4583[_0xe02c('0x24')]===_0xe02c('0x23');var _0x36fed0=_0x52917f[_0xe02c('0x25')];var _0x54c5b0=_0x3e37bf?0x0:_0x5a4583[_0xe02c('0x26')];var _0x59026f=_0x3e37bf?_0x52917f['count']:_0x5a4583[_0xe02c('0x26')]+_0x5a4583[_0xe02c('0x24')];var _0x480b9a;if(_0x59026f>=_0x36fed0){_0x59026f=_0x36fed0;_0x480b9a=0xc8;}else{_0x480b9a=0xce;}_0x20f492[_0xe02c('0x20')](_0x480b9a);return _0x20f492[_0xe02c('0x27')]('Content-Range',_0x54c5b0+'-'+_0x59026f+'/'+_0x36fed0)[_0xe02c('0x22')](_0x52917f);}return null;};}function patchUpdates(_0x45fd82){return function(_0x39b00c){try{jsonpatch[_0xe02c('0x28')](_0x39b00c,_0x45fd82,!![]);}catch(_0x2d44c8){return BPromise[_0xe02c('0x29')](_0x2d44c8);}return _0x39b00c[_0xe02c('0x2a')]();};}function saveUpdates(_0xf41d4c,_0xeae877){return function(_0x18b538){if(_0x18b538){return _0x18b538[_0xe02c('0x2b')](_0xf41d4c)['then'](function(_0xefd882){return _0xefd882;});}return null;};}function removeEntity(_0x4411d8,_0x3592ca){return function(_0x14ffba){if(_0x14ffba){return _0x14ffba[_0xe02c('0x2c')]()[_0xe02c('0x2d')](function(){var _0x43dc78=_0x14ffba[_0xe02c('0x2e')]({'plain':!![]});var _0x55ef2a=_0xe02c('0x2f');return db[_0xe02c('0x30')][_0xe02c('0x2c')]({'where':{'type':_0x55ef2a,'resourceId':_0x43dc78['id']}})['then'](function(){return _0x14ffba;});})[_0xe02c('0x2d')](function(){_0x4411d8[_0xe02c('0x20')](0xcc)[_0xe02c('0x21')]();});}};}function handleEntityNotFound(_0x287f7e,_0x1e7eab){return function(_0x35a309){if(!_0x35a309){_0x287f7e[_0xe02c('0x31')](0x194);}return _0x35a309;};}function handleError(_0x1b8f21,_0x9ee479){_0x9ee479=_0x9ee479||0x1f4;return function(_0x288004){logger[_0xe02c('0x32')](_0x288004['stack']);if(_0x288004[_0xe02c('0x33')]){delete _0x288004[_0xe02c('0x33')];}_0x1b8f21[_0xe02c('0x20')](_0x9ee479)[_0xe02c('0x34')](_0x288004);};}exports[_0xe02c('0x35')]=function(_0x14d27a,_0x58bf16){var _0x436bcc={},_0x1e605c={},_0x4fc4fd={'count':0x0,'rows':[]};var _0x1ce34c=_[_0xe02c('0x36')](db[_0xe02c('0x37')][_0xe02c('0x38')],function(_0x2b5ebe){return{'name':_0x2b5ebe['fieldName'],'type':_0x2b5ebe['type'][_0xe02c('0x39')]};});_0x1e605c[_0xe02c('0x3a')]=_['map'](_0x1ce34c,_0xe02c('0x33'));_0x1e605c['query']=_[_0xe02c('0x3b')](_0x14d27a[_0xe02c('0x3c')]);_0x1e605c[_0xe02c('0x3d')]=_[_0xe02c('0x3e')](_0x1e605c[_0xe02c('0x3a')],_0x1e605c['query']);_0x436bcc[_0xe02c('0x3f')]=_['intersection'](_0x1e605c[_0xe02c('0x3a')],qs[_0xe02c('0x40')](_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x40')]));_0x436bcc[_0xe02c('0x3f')]=_0x436bcc[_0xe02c('0x3f')]['length']?_0x436bcc[_0xe02c('0x3f')]:_0x1e605c[_0xe02c('0x3a')];if(!_0x14d27a['query'][_0xe02c('0x41')](_0xe02c('0x42'))){_0x436bcc['limit']=qs[_0xe02c('0x24')](_0x14d27a['query'][_0xe02c('0x24')]);_0x436bcc[_0xe02c('0x26')]=qs['offset'](_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x26')]);}_0x436bcc[_0xe02c('0x43')]=qs[_0xe02c('0x44')](_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x44')]);_0x436bcc['where']=qs[_0xe02c('0x3d')](_['pick'](_0x14d27a['query'],_0x1e605c[_0xe02c('0x3d')]),_0x1ce34c);if(_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x45')]){_0x436bcc[_0xe02c('0x46')]=_['merge'](_0x436bcc[_0xe02c('0x46')],{'$or':_[_0xe02c('0x36')](_0x1ce34c,function(_0x163573){if(_0x163573['type']!=='VIRTUAL'){var _0x33c6da={};_0x33c6da[_0x163573[_0xe02c('0x33')]]={'$like':'%'+_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x45')]+'%'};return _0x33c6da;}})});}_0x436bcc=_[_0xe02c('0x47')]({},_0x436bcc,_0x14d27a[_0xe02c('0x48')]);var _0x25f8ae={'where':_0x436bcc[_0xe02c('0x46')]};return db[_0xe02c('0x37')]['count'](_0x25f8ae)[_0xe02c('0x2d')](function(_0x5ef4a1){_0x4fc4fd['count']=_0x5ef4a1;if(_0x14d27a[_0xe02c('0x3c')][_0xe02c('0x49')]){_0x436bcc[_0xe02c('0x4a')]=[{'all':!![]}];}return db[_0xe02c('0x37')][_0xe02c('0x4b')](_0x436bcc);})[_0xe02c('0x2d')](function(_0x165f4a){_0x4fc4fd[_0xe02c('0x4c')]=_0x165f4a;return _0x4fc4fd;})['then'](respondWithFilteredResult(_0x58bf16,_0x436bcc))['catch'](handleError(_0x58bf16,null));};exports[_0xe02c('0x4d')]=function(_0xf89a57,_0x304ece){var _0x52f239={'raw':![],'where':{'id':_0xf89a57[_0xe02c('0x4e')]['id']}},_0x1cf443={};_0x1cf443[_0xe02c('0x3a')]=_[_0xe02c('0x3b')](db[_0xe02c('0x37')][_0xe02c('0x38')]);_0x1cf443[_0xe02c('0x3c')]=_[_0xe02c('0x3b')](_0xf89a57[_0xe02c('0x3c')]);_0x1cf443[_0xe02c('0x3d')]=_['intersection'](_0x1cf443[_0xe02c('0x3a')],_0x1cf443[_0xe02c('0x3c')]);_0x52f239[_0xe02c('0x3f')]=_[_0xe02c('0x3e')](_0x1cf443[_0xe02c('0x3a')],qs[_0xe02c('0x40')](_0xf89a57[_0xe02c('0x3c')][_0xe02c('0x40')]));_0x52f239[_0xe02c('0x3f')]=_0x52f239[_0xe02c('0x3f')][_0xe02c('0x4f')]?_0x52f239[_0xe02c('0x3f')]:_0x1cf443[_0xe02c('0x3a')];if(_0xf89a57['query'][_0xe02c('0x49')]){_0x52f239['include']=[{'all':!![]}];}_0x52f239=_[_0xe02c('0x47')]({},_0x52f239,_0xf89a57[_0xe02c('0x48')]);return db[_0xe02c('0x37')][_0xe02c('0x50')](_0x52f239)[_0xe02c('0x2d')](handleEntityNotFound(_0x304ece,null))[_0xe02c('0x2d')](respondWithResult(_0x304ece,null))[_0xe02c('0x51')](handleError(_0x304ece,null));};exports[_0xe02c('0x2c')]=function(_0xc6ea7b,_0x385497){return db['VoicePrefix'][_0xe02c('0x50')]({'where':{'id':_0xc6ea7b[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](handleEntityNotFound(_0x385497,null))['then'](removeEntity(_0x385497,null))[_0xe02c('0x51')](handleError(_0x385497,null));};exports['describe']=function(_0x21a126,_0x56b9e2){return db['VoicePrefix']['describe']()['then'](respondWithResult(_0x56b9e2,null))['catch'](handleError(_0x56b9e2,null));};exports['create']=function(_0x107f3f,_0x3ac0a5){var _0x1510aa;return db[_0xe02c('0x52')]['transaction'](function(_0x274beb){return db[_0xe02c('0x37')]['create'](_0x107f3f[_0xe02c('0x53')],{'transaction':_0x274beb})[_0xe02c('0x2d')](function(_0x221e5e){_0x1510aa=_0x221e5e['get']({'plain':!![]});return db['VoiceExtension'][_0xe02c('0x50')]({'where':{'id':_0x1510aa[_0xe02c('0x54')]},'raw':!![]})[_0xe02c('0x2d')](function(_0x5b2d2b){return createVoicePrefixExtensions(_0x1510aa,_0x5b2d2b,_0x274beb);});});})[_0xe02c('0x2d')](function(){var _0x53765c=_0x107f3f['user'][_0xe02c('0x2e')]({'plain':!![]});if(!_0x53765c)throw new Error(_0xe02c('0x55'));if(_0x53765c['role']===_0xe02c('0x56')){var _0x849eea=_0x1510aa;return db[_0xe02c('0x57')]['find']({'where':{'name':_0xe02c('0x2f'),'userProfileId':_0x53765c[_0xe02c('0x58')]},'raw':!![]})['then'](function(_0x3788e8){if(_0x3788e8&&_0x3788e8[_0xe02c('0x59')]===0x0){return db[_0xe02c('0x30')][_0xe02c('0x5a')]({'name':_0x849eea[_0xe02c('0x33')],'resourceId':_0x849eea['id'],'type':_0x3788e8[_0xe02c('0x33')],'sectionId':_0x3788e8['id']},{})[_0xe02c('0x2d')](function(){return _0x1510aa;});}else{return _0x1510aa;}})[_0xe02c('0x51')](function(_0xf7e836){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xf7e836);throw _0xf7e836;});}return _0x1510aa;})['then'](respondWithResult(_0x3ac0a5,null))[_0xe02c('0x51')](handleError(_0x3ac0a5,null));};function Extension(_0x299770,_0x42f2fd,_0x496eb1,_0x4eb35d){this[_0xe02c('0x5b')]=_0xe02c('0x5c');this[_0xe02c('0x5d')]=_0x299770;this[_0xe02c('0x5e')]=_0x496eb1;this[_0xe02c('0x5f')]='system';this[_0xe02c('0x60')]=_0xe02c('0x61');this['priority']=_0x42f2fd;this['appdata']=_0x4eb35d;}function createVoicePrefixExtensions(_0x879d99,_0x566204,_0x4da197){return new BPromise(function(_0x480d49,_0x3b19c9){var _0x28d7a2=new Extension(formatPrefixName(_0x879d99[_0xe02c('0x62')]),0x1,_0xe02c('0x63'),_0xe02c('0x64'));_0x28d7a2[_0xe02c('0x65')]=_0x879d99['id'];return db['VoiceExtension'][_0xe02c('0x5a')](_0x28d7a2,{'transaction':_0x4da197})['then'](function(_0x4f3c9a){var _0x185dc2=_0x4f3c9a[_0xe02c('0x2e')]({'plain':!![]});var _0x44ba68=_[_0xe02c('0x36')](addVoicePrefixExtensions(_0x879d99,_0x566204),function(_0x5b6979){_0x5b6979[_0xe02c('0x54')]=_0x185dc2['id'];_0x5b6979[_0xe02c('0x65')]=_0x879d99['id'];return _0x5b6979;});return db['VoiceExtension'][_0xe02c('0x66')](_0x44ba68,{'transaction':_0x4da197})[_0xe02c('0x2d')](function(_0x4cc74d){if(!_0x4cc74d){return _0x3b19c9(_0xe02c('0x67'));}else{return _0x480d49(_0x4cc74d);}})[_0xe02c('0x51')](function(_0x44f28f){return _0x3b19c9(_0x44f28f);});});;});};function addVoicePrefixExtensions(_0x4053e6,_0x323f3b){var _0x3a62a2=[];var _0x31b281=formatPrefixName(_0x4053e6['prefix']);_0x3a62a2[_0xe02c('0x68')](new Extension(_0x31b281,0x2,'Set','CDR(prefix)='+_0x4053e6['name']));if(_0x4053e6[_0xe02c('0x69')]){_0x3a62a2[_0xe02c('0x68')](new Extension(_0x31b281,0x3,_0xe02c('0x6a'),_0xe02c('0x6b')+_0x4053e6['callerIdAll']));}else{_0x3a62a2[_0xe02c('0x68')](new Extension(_0x31b281,0x3,_0xe02c('0x63'),'No\x20callerid\x20available'));}_0x3a62a2['push'](new Extension(_0x31b281,0x4,'goto',_0x323f3b[_0xe02c('0x5b')]+','+_0xe02c('0x6c')+(0x8+_0x4053e6['name']['length'])+'}'+','+0x1));return _0x3a62a2;}function formatPrefixName(_0x38789c){var _0x30ad9f='_';for(var _0x120ef1=0x0;_0x120ef1<_0x38789c[_0xe02c('0x4f')];_0x120ef1++){if(_0x38789c[_0xe02c('0x6d')](_0x120ef1)=='-'){_0x30ad9f+=_0x38789c['charAt'](_0x120ef1);}else{_0x30ad9f+='['+_0x38789c[_0xe02c('0x6d')](_0x120ef1)+']';}}_0x30ad9f+='.';return _0x30ad9f;}exports[_0xe02c('0x2b')]=function(_0x3f277b,_0x2776c0,_0x11c506){var _0x119119=_0x3f277b['body'];_0x119119[_0xe02c('0x62')]=_0xe02c('0x6e')+_0x119119['name']+'-';return db[_0xe02c('0x52')][_0xe02c('0x6f')](function(_0x123ca9){return db[_0xe02c('0x37')]['update'](_0x119119,{'where':{'id':_0x119119['id']},'transaction':_0x123ca9})[_0xe02c('0x2d')](function(){return db[_0xe02c('0x70')]['destroy']({'where':{'VoicePrefixId':_0x119119['id']},'transaction':_0x123ca9})['then'](function(){return db['VoiceExtension'][_0xe02c('0x50')]({'where':{'id':_0x119119[_0xe02c('0x54')]},'raw':!![]})[_0xe02c('0x2d')](function(_0x34e692){return createVoicePrefixExtensions(_0x119119,_0x34e692,_0x123ca9);});});});})[_0xe02c('0x2d')](function(){return db['VoicePrefix'][_0xe02c('0x71')](_0x119119['id']);})[_0xe02c('0x2d')](respondWithResult(_0x2776c0,null))[_0xe02c('0x51')](handleError(_0x2776c0,null));};exports['addAgents']=function(_0x4a7783,_0x4c3c91,_0x3cd802){return db[_0xe02c('0x37')][_0xe02c('0x50')]({'where':{'id':_0x4a7783[_0xe02c('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4c3c91,null))[_0xe02c('0x2d')](function(_0x48f524){if(_0x48f524){return _0x48f524['addAgents'](_0x4a7783[_0xe02c('0x53')][_0xe02c('0x72')],_[_0xe02c('0x73')](_0x4a7783[_0xe02c('0x53')],[_0xe02c('0x72'),'id'])||{})[_0xe02c('0x74')](function(_0x748217){for(var _0x12aaea=0x0;_0x12aaea<_0x4a7783['body'][_0xe02c('0x72')][_0xe02c('0x4f')];_0x12aaea+=0x1){socket[_0xe02c('0x75')](_0xe02c('0x76'),{'UserId':Number(_0x4a7783[_0xe02c('0x53')][_0xe02c('0x72')][_0x12aaea]),'VoicePrefixId':Number(_0x4a7783[_0xe02c('0x4e')]['id'])});}return _0x748217;});}})[_0xe02c('0x2d')](respondWithResult(_0x4c3c91,null))[_0xe02c('0x51')](handleError(_0x4c3c91,null));};exports[_0xe02c('0x77')]=function(_0x5e6df5,_0x58acfd,_0x120dd7){return db[_0xe02c('0x37')][_0xe02c('0x50')]({'where':{'id':_0x5e6df5[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](handleEntityNotFound(_0x58acfd,null))['then'](function(_0x405b16){if(_0x405b16){return _0x405b16[_0xe02c('0x77')](_0x5e6df5[_0xe02c('0x3c')][_0xe02c('0x72')])[_0xe02c('0x2d')](function(){if(_[_0xe02c('0x78')](_0x5e6df5[_0xe02c('0x3c')][_0xe02c('0x72')])){for(var _0x1d594c=0x0;_0x1d594c<_0x5e6df5[_0xe02c('0x3c')][_0xe02c('0x72')][_0xe02c('0x4f')];_0x1d594c+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x5e6df5[_0xe02c('0x3c')][_0xe02c('0x72')][_0x1d594c]),'VoicePrefixId':Number(_0x5e6df5['params']['id'])});}}else{socket[_0xe02c('0x75')]('userVoicePrefix:remove',{'UserId':Number(_0x5e6df5[_0xe02c('0x3c')]['ids']),'VoicePrefixId':Number(_0x5e6df5[_0xe02c('0x4e')]['id'])});}});}})[_0xe02c('0x2d')](respondWithStatusCode(_0x58acfd,null))[_0xe02c('0x51')](handleError(_0x58acfd,null));};exports[_0xe02c('0x79')]=function(_0x28755a,_0x3c44d3,_0x119439){var _0x10d067={};var _0x3d3954={};var _0xd0d895;var _0x567478;return db['VoicePrefix']['findOne']({'where':{'id':_0x28755a[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](handleEntityNotFound(_0x3c44d3,null))[_0xe02c('0x2d')](function(_0x1133ce){if(_0x1133ce){_0xd0d895=_0x1133ce;_0x3d3954[_0xe02c('0x3a')]=_[_0xe02c('0x3b')](db[_0xe02c('0x7a')][_0xe02c('0x38')]);_0x3d3954[_0xe02c('0x3c')]=_[_0xe02c('0x3b')](_0x28755a[_0xe02c('0x3c')]);_0x3d3954[_0xe02c('0x3d')]=_[_0xe02c('0x3e')](_0x3d3954['model'],_0x3d3954['query']);_0x10d067[_0xe02c('0x3f')]=_[_0xe02c('0x3e')](_0x3d3954[_0xe02c('0x3a')],qs['fields'](_0x28755a[_0xe02c('0x3c')][_0xe02c('0x40')]));_0x10d067[_0xe02c('0x3f')]=_0x10d067[_0xe02c('0x3f')][_0xe02c('0x4f')]?_0x10d067['attributes']:_0x3d3954[_0xe02c('0x3a')];_0x10d067[_0xe02c('0x43')]=qs[_0xe02c('0x44')](_0x28755a['query'][_0xe02c('0x44')]);_0x10d067[_0xe02c('0x46')]=qs[_0xe02c('0x3d')](_[_0xe02c('0x7b')](_0x28755a[_0xe02c('0x3c')],_0x3d3954['filters']));if(_0x28755a[_0xe02c('0x3c')][_0xe02c('0x45')]){_0x10d067[_0xe02c('0x46')]=_['merge'](_0x10d067[_0xe02c('0x46')],{'$or':_[_0xe02c('0x36')](_0x10d067[_0xe02c('0x3f')],function(_0x3a5ec8){var _0x45e463={};_0x45e463[_0x3a5ec8]={'$like':'%'+_0x28755a['query'][_0xe02c('0x45')]+'%'};return _0x45e463;})});}_0x10d067=_[_0xe02c('0x47')]({},_0x10d067,_0x28755a['options']);return _0xd0d895[_0xe02c('0x79')](_0x10d067);}})['then'](function(_0x52fcd6){if(_0x52fcd6){_0x567478=_0x52fcd6['length'];if(!_0x28755a[_0xe02c('0x3c')][_0xe02c('0x41')](_0xe02c('0x42'))){_0x10d067[_0xe02c('0x24')]=qs[_0xe02c('0x24')](_0x28755a[_0xe02c('0x3c')][_0xe02c('0x24')]);_0x10d067[_0xe02c('0x26')]=qs[_0xe02c('0x26')](_0x28755a[_0xe02c('0x3c')][_0xe02c('0x26')]);}return _0xd0d895[_0xe02c('0x79')](_0x10d067);}})[_0xe02c('0x2d')](function(_0xfe0b1c){if(_0xfe0b1c){return _0xfe0b1c?{'count':_0x567478,'rows':_0xfe0b1c}:null;}})[_0xe02c('0x2d')](respondWithResult(_0x3c44d3,null))[_0xe02c('0x51')](handleError(_0x3c44d3,null));};exports['getTeams']=function(_0x283de9,_0x4cfbc0,_0x3650cb){var _0xdc8df0={};var _0x4564f1={};var _0x2c6d29;var _0x5b75ed;return db[_0xe02c('0x37')][_0xe02c('0x7c')]({'where':{'id':_0x283de9[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](handleEntityNotFound(_0x4cfbc0,null))[_0xe02c('0x2d')](function(_0xced62f){if(_0xced62f){_0x2c6d29=_0xced62f;_0x4564f1[_0xe02c('0x3a')]=_['keys'](db[_0xe02c('0x7d')][_0xe02c('0x38')]);_0x4564f1['query']=_[_0xe02c('0x3b')](_0x283de9['query']);_0x4564f1['filters']=_[_0xe02c('0x3e')](_0x4564f1[_0xe02c('0x3a')],_0x4564f1[_0xe02c('0x3c')]);_0xdc8df0[_0xe02c('0x3f')]=_['intersection'](_0x4564f1['model'],qs[_0xe02c('0x40')](_0x283de9[_0xe02c('0x3c')]['fields']));_0xdc8df0[_0xe02c('0x3f')]=_0xdc8df0[_0xe02c('0x3f')][_0xe02c('0x4f')]?_0xdc8df0[_0xe02c('0x3f')]:_0x4564f1[_0xe02c('0x3a')];_0xdc8df0[_0xe02c('0x43')]=qs['sort'](_0x283de9[_0xe02c('0x3c')][_0xe02c('0x44')]);_0xdc8df0[_0xe02c('0x46')]=qs[_0xe02c('0x3d')](_[_0xe02c('0x7b')](_0x283de9[_0xe02c('0x3c')],_0x4564f1[_0xe02c('0x3d')]));if(_0x283de9[_0xe02c('0x3c')][_0xe02c('0x45')]){_0xdc8df0[_0xe02c('0x46')]=_[_0xe02c('0x47')](_0xdc8df0[_0xe02c('0x46')],{'$or':_[_0xe02c('0x36')](_0xdc8df0[_0xe02c('0x3f')],function(_0x5c4ed7){var _0x1abb2d={};_0x1abb2d[_0x5c4ed7]={'$like':'%'+_0x283de9[_0xe02c('0x3c')][_0xe02c('0x45')]+'%'};return _0x1abb2d;})});}_0xdc8df0=_['merge']({},_0xdc8df0,_0x283de9[_0xe02c('0x48')]);return _0x2c6d29[_0xe02c('0x7e')](_0xdc8df0);}})[_0xe02c('0x2d')](function(_0x2127e7){if(_0x2127e7){_0x5b75ed=_0x2127e7[_0xe02c('0x4f')];if(!_0x283de9[_0xe02c('0x3c')][_0xe02c('0x41')]('nolimit')){_0xdc8df0[_0xe02c('0x24')]=qs[_0xe02c('0x24')](_0x283de9[_0xe02c('0x3c')][_0xe02c('0x24')]);_0xdc8df0[_0xe02c('0x26')]=qs[_0xe02c('0x26')](_0x283de9[_0xe02c('0x3c')][_0xe02c('0x26')]);}return _0x2c6d29[_0xe02c('0x7e')](_0xdc8df0);}})['then'](function(_0x4297b2){if(_0x4297b2){return _0x4297b2?{'count':_0x5b75ed,'rows':_0x4297b2}:null;}})[_0xe02c('0x2d')](respondWithResult(_0x4cfbc0,null))['catch'](handleError(_0x4cfbc0,null));};exports[_0xe02c('0x7f')]=function(_0x4081f5,_0x1d23ed,_0x46fd38){var _0x7cd9df=_0x4081f5[_0xe02c('0x53')]['ids'];var _0xc21958;return db[_0xe02c('0x7d')][_0xe02c('0x4b')]({'where':{'id':_0x7cd9df},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xe02c('0x33'),_0xe02c('0x80'),_0xe02c('0x81'),'interface'],'raw':!![]}]})[_0xe02c('0x2d')](function(_0x35b30c){if(_0x35b30c){_0xc21958=_0x35b30c;var _0x469eac=_[_0xe02c('0x82')](_0x35b30c,function(_0x7441e6){var _0x56e35d=_0x7441e6[_0xe02c('0x2e')]({'plain':!![]});return _0x56e35d[_0xe02c('0x83')];});return db[_0xe02c('0x37')][_0xe02c('0x50')]({'where':{'id':_0x4081f5[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](function(_0x327507){return db[_0xe02c('0x52')][_0xe02c('0x6f')](function(_0x2ee007){return _0x327507[_0xe02c('0x7f')](_0x7cd9df,{'transaction':_0x2ee007})[_0xe02c('0x2d')](function(){return BPromise[_0xe02c('0x84')](_0xc21958,function(_0x1de725){return db[_0xe02c('0x85')][_0xe02c('0x86')]({'TeamId':_0x1de725['id'],'VoicePrefixId':_0x4081f5[_0xe02c('0x4e')]['id']},{'transaction':_0x2ee007});});})['then'](function(){return BPromise['each'](_0x469eac,function(_0x4400b2){return db['UserVoicePrefix']['findOrCreate']({'where':{'UserId':_0x4400b2['id'],'VoicePrefixId':_0x4081f5['params']['id']},'transaction':_0x2ee007});});})[_0xe02c('0x2d')](function(){_0x469eac[_0xe02c('0x87')](function(_0x889cef){socket['emit'](_0xe02c('0x76'),{'UserId':_0x889cef['id'],'VoicePrefixId':_0x327507['id']});});});});});}})['then'](respondWithStatusCode(_0x1d23ed,null))['catch'](handleError(_0x1d23ed,null));};exports[_0xe02c('0x88')]=function(_0x3ca665,_0x4eb163,_0x1433bd){return db['Team']['findAll']({'where':{'id':_0x3ca665[_0xe02c('0x3c')][_0xe02c('0x72')]},'attributes':['id'],'include':[{'model':db[_0xe02c('0x7a')],'as':_0xe02c('0x83'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4eb163,null))[_0xe02c('0x2d')](function(_0x25933f){var _0x323d81=_[_0xe02c('0x36')](_0x25933f,'id');var _0x3b6e15=[];var _0x1c96cc=[];var _0x322b4a=squel[_0xe02c('0x89')]();_0x322b4a[_0xe02c('0x8a')](_0xe02c('0x8b'))[_0xe02c('0x8c')](_0xe02c('0x8d'),'tq')[_0xe02c('0x8e')](_0xe02c('0x8f'),'ut',_0xe02c('0x90'))[_0xe02c('0x46')](_0xe02c('0x91'),_0x3ca665['params']['id']);for(var _0x252f5f=0x0;_0x252f5f<_0x25933f[_0xe02c('0x4f')];_0x252f5f+=0x1){let _0x4d112d=_0x25933f[_0x252f5f];for(var _0x3e0961=0x0;_0x3e0961<_0x4d112d[_0xe02c('0x83')][_0xe02c('0x4f')];_0x3e0961+=0x1){let _0x4b7886=_0x4d112d[_0xe02c('0x83')][_0x3e0961];var _0x505074=_0x322b4a[_0xe02c('0x92')]();_0x505074['where'](_0xe02c('0x93'),_0x4b7886['id']);_0x1c96cc[_0xe02c('0x68')](db[_0xe02c('0x52')][_0xe02c('0x3c')](_0x505074[_0xe02c('0x94')](),{'type':db['sequelize'][_0xe02c('0x95')]['SELECT']})[_0xe02c('0x2d')](function(_0x47d3fa){if(_0x47d3fa[_0xe02c('0x4f')]===0x1){return _0x4b7886['id'];}else{var _0x534002=_[_0xe02c('0x96')](_[_0xe02c('0x36')](_0x47d3fa,_0xe02c('0x97')),function(_0x45c425){return _[_0xe02c('0x98')](_0x323d81,_0x45c425);});if(_0x534002){return _0x4b7886['id'];}}}));}}return BPromise['all'](_0x1c96cc)['then'](function(_0x27ea6e){_0x3b6e15=_(_0x3b6e15)[_0xe02c('0x99')](_0x27ea6e)[_0xe02c('0x9a')]()[_0xe02c('0x9b')]();return db[_0xe02c('0x37')]['find']({'where':{'id':_0x3ca665[_0xe02c('0x4e')]['id']}})[_0xe02c('0x2d')](function(_0x34b426){return db['sequelize'][_0xe02c('0x6f')](function(_0x2a8e1d){return _0x34b426[_0xe02c('0x88')](_0x3ca665[_0xe02c('0x3c')][_0xe02c('0x72')],{'transaction':_0x2a8e1d})[_0xe02c('0x2d')](function(){if(!_['isEmpty'](_0x3b6e15)){return _0x34b426['removeAgents'](_0x3b6e15,{'transaction':_0x2a8e1d});}})[_0xe02c('0x2d')](function(){_0x3b6e15[_0xe02c('0x87')](function(_0x4b9fb7){socket['emit']('userVoicePrefix:remove',{'UserId':_0x4b9fb7,'VoicePrefixId':_0x34b426['id']});});});});});});})['then'](respondWithStatusCode(_0x4eb163,null))[_0xe02c('0x51')](handleError(_0x4eb163,null));}; \ No newline at end of file +var _0x34b7=['fieldName','type','key','model','keys','filters','intersection','query','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','rows','catch','fields','includeAll','find','params','describe','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','exten','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','findById','addAgents','ids','spread','userVoicePrefix:save','removeAgents','isArray','emit','userVoicePrefix:remove','getAgents','findOne','User','order','getTeams','Team','addTeams','findAll','Agents','online','voicePause','interface','flatMap','TeamVoicePrefix','upsert','each','findOrCreate','forEach','removeTeams','select','from','team_has_voice_prefixes','join','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','toString','SELECT','every','TeamId','all','compact','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','get','VoicePrefixes','UserProfileResource','destroy','error','stack','name','send','index','map','VoicePrefix','rawAttributes'];(function(_0x15b4fc,_0x2bbcf6){var _0x4d0f3b=function(_0x3c5da7){while(--_0x3c5da7){_0x15b4fc['push'](_0x15b4fc['shift']());}};_0x4d0f3b(++_0x2bbcf6);}(_0x34b7,0x196));var _0x734b=function(_0x204e08,_0x36ca59){_0x204e08=_0x204e08-0x0;var _0x4dd55e=_0x34b7[_0x204e08];return _0x4dd55e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x734b('0x0'));var jsonpatch=require(_0x734b('0x1'));var rp=require(_0x734b('0x2'));var moment=require(_0x734b('0x3'));var BPromise=require(_0x734b('0x4'));var Mustache=require(_0x734b('0x5'));var util=require('util');var path=require('path');var sox=require(_0x734b('0x6'));var csv=require(_0x734b('0x7'));var ejs=require(_0x734b('0x8'));var fs=require('fs');var fs_extra=require(_0x734b('0x9'));var _=require(_0x734b('0xa'));var squel=require(_0x734b('0xb'));var crypto=require('crypto');var jsforce=require(_0x734b('0xc'));var deskjs=require(_0x734b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x734b('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x734b('0xf'));var as=require(_0x734b('0x10'));var hardwareService=require(_0x734b('0x11'));var logger=require(_0x734b('0x12'))(_0x734b('0x13'));var utils=require(_0x734b('0x14'));var config=require(_0x734b('0x15'));var licenseUtil=require(_0x734b('0x16'));var db=require(_0x734b('0x17'))['db'];config[_0x734b('0x18')]=_[_0x734b('0x19')](config[_0x734b('0x18')],{'host':_0x734b('0x1a'),'port':0x18eb});var socket=require(_0x734b('0x1b'))(new Redis(config['redis']));require(_0x734b('0x1c'))[_0x734b('0x1d')](socket);function respondWithStatusCode(_0x47791c,_0xd1ab2a){_0xd1ab2a=_0xd1ab2a||0xcc;return function(_0x19f427){if(_0x19f427){return _0x47791c[_0x734b('0x1e')](_0xd1ab2a);}return _0x47791c[_0x734b('0x1f')](_0xd1ab2a)[_0x734b('0x20')]();};}function respondWithResult(_0xa6d111,_0x4b8c63){_0x4b8c63=_0x4b8c63||0xc8;return function(_0x42407a){if(_0x42407a){return _0xa6d111['status'](_0x4b8c63)[_0x734b('0x21')](_0x42407a);}};}function respondWithFilteredResult(_0x2ee290,_0xfb661a){return function(_0x5edbe9){if(_0x5edbe9){var _0x4d3b9c=typeof _0xfb661a['offset']===_0x734b('0x22')&&typeof _0xfb661a[_0x734b('0x23')]===_0x734b('0x22');var _0x41ba87=_0x5edbe9[_0x734b('0x24')];var _0xfe567d=_0x4d3b9c?0x0:_0xfb661a[_0x734b('0x25')];var _0x6572ee=_0x4d3b9c?_0x5edbe9[_0x734b('0x24')]:_0xfb661a[_0x734b('0x25')]+_0xfb661a[_0x734b('0x23')];var _0x3d0ffd;if(_0x6572ee>=_0x41ba87){_0x6572ee=_0x41ba87;_0x3d0ffd=0xc8;}else{_0x3d0ffd=0xce;}_0x2ee290[_0x734b('0x1f')](_0x3d0ffd);return _0x2ee290[_0x734b('0x26')]('Content-Range',_0xfe567d+'-'+_0x6572ee+'/'+_0x41ba87)[_0x734b('0x21')](_0x5edbe9);}return null;};}function patchUpdates(_0x7856d7){return function(_0x4f98a7){try{jsonpatch[_0x734b('0x27')](_0x4f98a7,_0x7856d7,!![]);}catch(_0x1f81de){return BPromise[_0x734b('0x28')](_0x1f81de);}return _0x4f98a7[_0x734b('0x29')]();};}function saveUpdates(_0x46d432,_0x26d118){return function(_0x26eccf){if(_0x26eccf){return _0x26eccf[_0x734b('0x2a')](_0x46d432)[_0x734b('0x2b')](function(_0x3abbe6){return _0x3abbe6;});}return null;};}function removeEntity(_0x44ffa9,_0x148abe){return function(_0x3bb651){if(_0x3bb651){return _0x3bb651['destroy']()['then'](function(){var _0x13cc5a=_0x3bb651[_0x734b('0x2c')]({'plain':!![]});var _0x47a0a9=_0x734b('0x2d');return db[_0x734b('0x2e')][_0x734b('0x2f')]({'where':{'type':_0x47a0a9,'resourceId':_0x13cc5a['id']}})[_0x734b('0x2b')](function(){return _0x3bb651;});})[_0x734b('0x2b')](function(){_0x44ffa9[_0x734b('0x1f')](0xcc)[_0x734b('0x20')]();});}};}function handleEntityNotFound(_0x5c6c5d,_0x1f3652){return function(_0x436efe){if(!_0x436efe){_0x5c6c5d[_0x734b('0x1e')](0x194);}return _0x436efe;};}function handleError(_0x241c89,_0x729431){_0x729431=_0x729431||0x1f4;return function(_0x427c36){logger[_0x734b('0x30')](_0x427c36[_0x734b('0x31')]);if(_0x427c36[_0x734b('0x32')]){delete _0x427c36[_0x734b('0x32')];}_0x241c89['status'](_0x729431)[_0x734b('0x33')](_0x427c36);};}exports[_0x734b('0x34')]=function(_0x57f792,_0xbbe037){var _0x3cfce2={},_0xf4ef21={},_0x2fe7d5={'count':0x0,'rows':[]};var _0x21cb04=_[_0x734b('0x35')](db[_0x734b('0x36')][_0x734b('0x37')],function(_0x1e53fb){return{'name':_0x1e53fb[_0x734b('0x38')],'type':_0x1e53fb[_0x734b('0x39')][_0x734b('0x3a')]};});_0xf4ef21[_0x734b('0x3b')]=_[_0x734b('0x35')](_0x21cb04,_0x734b('0x32'));_0xf4ef21['query']=_[_0x734b('0x3c')](_0x57f792['query']);_0xf4ef21[_0x734b('0x3d')]=_[_0x734b('0x3e')](_0xf4ef21[_0x734b('0x3b')],_0xf4ef21[_0x734b('0x3f')]);_0x3cfce2[_0x734b('0x40')]=_[_0x734b('0x3e')](_0xf4ef21['model'],qs['fields'](_0x57f792[_0x734b('0x3f')]['fields']));_0x3cfce2[_0x734b('0x40')]=_0x3cfce2['attributes'][_0x734b('0x41')]?_0x3cfce2['attributes']:_0xf4ef21[_0x734b('0x3b')];if(!_0x57f792['query'][_0x734b('0x42')](_0x734b('0x43'))){_0x3cfce2[_0x734b('0x23')]=qs[_0x734b('0x23')](_0x57f792[_0x734b('0x3f')][_0x734b('0x23')]);_0x3cfce2[_0x734b('0x25')]=qs['offset'](_0x57f792[_0x734b('0x3f')][_0x734b('0x25')]);}_0x3cfce2['order']=qs[_0x734b('0x44')](_0x57f792[_0x734b('0x3f')][_0x734b('0x44')]);_0x3cfce2[_0x734b('0x45')]=qs['filters'](_[_0x734b('0x46')](_0x57f792[_0x734b('0x3f')],_0xf4ef21['filters']),_0x21cb04);if(_0x57f792[_0x734b('0x3f')][_0x734b('0x47')]){_0x3cfce2['where']=_[_0x734b('0x48')](_0x3cfce2[_0x734b('0x45')],{'$or':_[_0x734b('0x35')](_0x21cb04,function(_0x300aaa){if(_0x300aaa['type']!=='VIRTUAL'){var _0x2f6cee={};_0x2f6cee[_0x300aaa['name']]={'$like':'%'+_0x57f792['query'][_0x734b('0x47')]+'%'};return _0x2f6cee;}})});}_0x3cfce2=_['merge']({},_0x3cfce2,_0x57f792[_0x734b('0x49')]);var _0x4d77f0={'where':_0x3cfce2[_0x734b('0x45')]};return db[_0x734b('0x36')][_0x734b('0x24')](_0x4d77f0)['then'](function(_0x5cf3a0){_0x2fe7d5[_0x734b('0x24')]=_0x5cf3a0;if(_0x57f792['query']['includeAll']){_0x3cfce2[_0x734b('0x4a')]=[{'all':!![]}];}return db[_0x734b('0x36')]['findAll'](_0x3cfce2);})[_0x734b('0x2b')](function(_0x513f07){_0x2fe7d5[_0x734b('0x4b')]=_0x513f07;return _0x2fe7d5;})[_0x734b('0x2b')](respondWithFilteredResult(_0xbbe037,_0x3cfce2))[_0x734b('0x4c')](handleError(_0xbbe037,null));};exports['show']=function(_0xe8b116,_0x2455b9){var _0x3bca7e={'raw':![],'where':{'id':_0xe8b116['params']['id']}},_0x439139={};_0x439139['model']=_['keys'](db[_0x734b('0x36')]['rawAttributes']);_0x439139['query']=_[_0x734b('0x3c')](_0xe8b116['query']);_0x439139[_0x734b('0x3d')]=_[_0x734b('0x3e')](_0x439139[_0x734b('0x3b')],_0x439139[_0x734b('0x3f')]);_0x3bca7e['attributes']=_[_0x734b('0x3e')](_0x439139['model'],qs[_0x734b('0x4d')](_0xe8b116[_0x734b('0x3f')][_0x734b('0x4d')]));_0x3bca7e['attributes']=_0x3bca7e[_0x734b('0x40')]['length']?_0x3bca7e[_0x734b('0x40')]:_0x439139[_0x734b('0x3b')];if(_0xe8b116['query'][_0x734b('0x4e')]){_0x3bca7e[_0x734b('0x4a')]=[{'all':!![]}];}_0x3bca7e=_[_0x734b('0x48')]({},_0x3bca7e,_0xe8b116[_0x734b('0x49')]);return db[_0x734b('0x36')]['find'](_0x3bca7e)[_0x734b('0x2b')](handleEntityNotFound(_0x2455b9,null))['then'](respondWithResult(_0x2455b9,null))[_0x734b('0x4c')](handleError(_0x2455b9,null));};exports['destroy']=function(_0xd3c688,_0xa2fd9d){return db[_0x734b('0x36')][_0x734b('0x4f')]({'where':{'id':_0xd3c688[_0x734b('0x50')]['id']}})['then'](handleEntityNotFound(_0xa2fd9d,null))['then'](removeEntity(_0xa2fd9d,null))['catch'](handleError(_0xa2fd9d,null));};exports[_0x734b('0x51')]=function(_0x1901a8,_0x541991){return db[_0x734b('0x36')][_0x734b('0x51')]()['then'](respondWithResult(_0x541991,null))[_0x734b('0x4c')](handleError(_0x541991,null));};exports[_0x734b('0x52')]=function(_0x44e6d2,_0x4d6501){var _0x2e95aa;return db[_0x734b('0x53')][_0x734b('0x54')](function(_0xe605be){return db['VoicePrefix'][_0x734b('0x52')](_0x44e6d2[_0x734b('0x55')],{'transaction':_0xe605be})[_0x734b('0x2b')](function(_0x432a96){_0x2e95aa=_0x432a96['get']({'plain':!![]});return db[_0x734b('0x56')]['find']({'where':{'id':_0x2e95aa[_0x734b('0x57')]},'raw':!![]})[_0x734b('0x2b')](function(_0x1f3594){return createVoicePrefixExtensions(_0x2e95aa,_0x1f3594,_0xe605be);});});})[_0x734b('0x2b')](function(){var _0x58d665=_0x44e6d2[_0x734b('0x58')][_0x734b('0x2c')]({'plain':!![]});if(!_0x58d665)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58d665['role']===_0x734b('0x58')){var _0x577735=_0x2e95aa;return db[_0x734b('0x59')][_0x734b('0x4f')]({'where':{'name':_0x734b('0x2d'),'userProfileId':_0x58d665['userProfileId']},'raw':!![]})[_0x734b('0x2b')](function(_0x588cd8){if(_0x588cd8&&_0x588cd8[_0x734b('0x5a')]===0x0){return db[_0x734b('0x2e')][_0x734b('0x52')]({'name':_0x577735[_0x734b('0x32')],'resourceId':_0x577735['id'],'type':_0x588cd8['name'],'sectionId':_0x588cd8['id']},{})[_0x734b('0x2b')](function(){return _0x2e95aa;});}else{return _0x2e95aa;}})['catch'](function(_0x6b198c){logger[_0x734b('0x30')](_0x734b('0x5b'),_0x6b198c);throw _0x6b198c;});}return _0x2e95aa;})['then'](respondWithResult(_0x4d6501,null))[_0x734b('0x4c')](handleError(_0x4d6501,null));};function Extension(_0x55c699,_0x2c81a1,_0x17a217,_0x3ec705){this[_0x734b('0x5c')]='from-sip';this[_0x734b('0x5d')]=_0x55c699;this['app']=_0x17a217;this[_0x734b('0x39')]=_0x734b('0x5e');this[_0x734b('0x5f')]='Voice\x20Prefix\x20Extension';this[_0x734b('0x60')]=_0x2c81a1;this[_0x734b('0x61')]=_0x3ec705;}function createVoicePrefixExtensions(_0x366379,_0x3b16bb,_0x228f85){return new BPromise(function(_0x262244,_0x164c81){var _0x506407=new Extension(formatPrefixName(_0x366379[_0x734b('0x62')]),0x1,_0x734b('0x63'),_0x734b('0x64'));_0x506407['VoicePrefixId']=_0x366379['id'];return db['VoiceExtension'][_0x734b('0x52')](_0x506407,{'transaction':_0x228f85})[_0x734b('0x2b')](function(_0x391c04){var _0x1eec8e=_0x391c04['get']({'plain':!![]});var _0x565a2e=_['map'](addVoicePrefixExtensions(_0x366379,_0x3b16bb),function(_0x1bd023){_0x1bd023[_0x734b('0x57')]=_0x1eec8e['id'];_0x1bd023[_0x734b('0x65')]=_0x366379['id'];return _0x1bd023;});return db[_0x734b('0x56')][_0x734b('0x66')](_0x565a2e,{'transaction':_0x228f85})[_0x734b('0x2b')](function(_0x113931){if(!_0x113931){return _0x164c81(_0x734b('0x67'));}else{return _0x262244(_0x113931);}})[_0x734b('0x4c')](function(_0x459788){return _0x164c81(_0x459788);});});;});};function addVoicePrefixExtensions(_0xc5a114,_0x69b605){var _0x43951a=[];var _0x467b1=formatPrefixName(_0xc5a114[_0x734b('0x62')]);_0x43951a[_0x734b('0x68')](new Extension(_0x467b1,0x2,_0x734b('0x69'),_0x734b('0x6a')+_0xc5a114[_0x734b('0x32')]));if(_0xc5a114[_0x734b('0x6b')]){_0x43951a[_0x734b('0x68')](new Extension(_0x467b1,0x3,'Set',_0x734b('0x6c')+_0xc5a114[_0x734b('0x6b')]));}else{_0x43951a[_0x734b('0x68')](new Extension(_0x467b1,0x3,_0x734b('0x63'),_0x734b('0x6d')));}_0x43951a['push'](new Extension(_0x467b1,0x4,_0x734b('0x6e'),_0x69b605[_0x734b('0x5c')]+','+_0x734b('0x6f')+(0x8+_0xc5a114[_0x734b('0x32')][_0x734b('0x41')])+'}'+','+0x1));return _0x43951a;}function formatPrefixName(_0x5d785d){var _0x594df0='_';for(var _0x479ee2=0x0;_0x479ee2<_0x5d785d['length'];_0x479ee2++){if(_0x5d785d['charAt'](_0x479ee2)=='-'){_0x594df0+=_0x5d785d['charAt'](_0x479ee2);}else{_0x594df0+='['+_0x5d785d[_0x734b('0x70')](_0x479ee2)+']';}}_0x594df0+='.';return _0x594df0;}exports[_0x734b('0x2a')]=function(_0x16c9d2,_0xb23b61,_0x496070){var _0x4f79a9=_0x16c9d2[_0x734b('0x55')];_0x4f79a9[_0x734b('0x62')]=_0x734b('0x71')+_0x4f79a9[_0x734b('0x32')]+'-';return db['sequelize'][_0x734b('0x54')](function(_0x24ab5c){return db[_0x734b('0x36')][_0x734b('0x2a')](_0x4f79a9,{'where':{'id':_0x4f79a9['id']},'transaction':_0x24ab5c})['then'](function(){return db[_0x734b('0x56')]['destroy']({'where':{'VoicePrefixId':_0x4f79a9['id']},'transaction':_0x24ab5c})[_0x734b('0x2b')](function(){return db[_0x734b('0x56')][_0x734b('0x4f')]({'where':{'id':_0x4f79a9[_0x734b('0x57')]},'raw':!![]})[_0x734b('0x2b')](function(_0x4e43c3){return createVoicePrefixExtensions(_0x4f79a9,_0x4e43c3,_0x24ab5c);});});});})[_0x734b('0x2b')](function(){return db[_0x734b('0x36')][_0x734b('0x72')](_0x4f79a9['id']);})[_0x734b('0x2b')](respondWithResult(_0xb23b61,null))[_0x734b('0x4c')](handleError(_0xb23b61,null));};exports['addAgents']=function(_0x475ecd,_0x2dcb30,_0x1316ae){return db[_0x734b('0x36')]['find']({'where':{'id':_0x475ecd[_0x734b('0x50')]['id']}})[_0x734b('0x2b')](handleEntityNotFound(_0x2dcb30,null))[_0x734b('0x2b')](function(_0x407006){if(_0x407006){return _0x407006[_0x734b('0x73')](_0x475ecd['body'][_0x734b('0x74')],_['omit'](_0x475ecd[_0x734b('0x55')],[_0x734b('0x74'),'id'])||{})[_0x734b('0x75')](function(_0x27fd22){for(var _0x4624c7=0x0;_0x4624c7<_0x475ecd[_0x734b('0x55')]['ids']['length'];_0x4624c7+=0x1){socket['emit'](_0x734b('0x76'),{'UserId':Number(_0x475ecd['body'][_0x734b('0x74')][_0x4624c7]),'VoicePrefixId':Number(_0x475ecd[_0x734b('0x50')]['id'])});}return _0x27fd22;});}})['then'](respondWithResult(_0x2dcb30,null))[_0x734b('0x4c')](handleError(_0x2dcb30,null));};exports[_0x734b('0x77')]=function(_0x17749f,_0x2a3c8d,_0x1d0bfb){return db[_0x734b('0x36')][_0x734b('0x4f')]({'where':{'id':_0x17749f[_0x734b('0x50')]['id']}})[_0x734b('0x2b')](handleEntityNotFound(_0x2a3c8d,null))[_0x734b('0x2b')](function(_0x5de89a){if(_0x5de89a){return _0x5de89a[_0x734b('0x77')](_0x17749f[_0x734b('0x3f')][_0x734b('0x74')])['then'](function(){if(_[_0x734b('0x78')](_0x17749f[_0x734b('0x3f')][_0x734b('0x74')])){for(var _0x13f1fd=0x0;_0x13f1fd<_0x17749f[_0x734b('0x3f')][_0x734b('0x74')][_0x734b('0x41')];_0x13f1fd+=0x1){socket[_0x734b('0x79')]('userVoicePrefix:remove',{'UserId':Number(_0x17749f[_0x734b('0x3f')][_0x734b('0x74')][_0x13f1fd]),'VoicePrefixId':Number(_0x17749f[_0x734b('0x50')]['id'])});}}else{socket[_0x734b('0x79')](_0x734b('0x7a'),{'UserId':Number(_0x17749f[_0x734b('0x3f')][_0x734b('0x74')]),'VoicePrefixId':Number(_0x17749f[_0x734b('0x50')]['id'])});}});}})[_0x734b('0x2b')](respondWithStatusCode(_0x2a3c8d,null))['catch'](handleError(_0x2a3c8d,null));};exports[_0x734b('0x7b')]=function(_0x13f4e8,_0x41eca7,_0x500ebf){var _0x31e1ec={};var _0x2fde66={};var _0x24fb9d;var _0x3f3511;return db[_0x734b('0x36')][_0x734b('0x7c')]({'where':{'id':_0x13f4e8['params']['id']}})[_0x734b('0x2b')](handleEntityNotFound(_0x41eca7,null))['then'](function(_0x504a7f){if(_0x504a7f){_0x24fb9d=_0x504a7f;_0x2fde66['model']=_['keys'](db[_0x734b('0x7d')][_0x734b('0x37')]);_0x2fde66[_0x734b('0x3f')]=_[_0x734b('0x3c')](_0x13f4e8['query']);_0x2fde66['filters']=_[_0x734b('0x3e')](_0x2fde66['model'],_0x2fde66[_0x734b('0x3f')]);_0x31e1ec[_0x734b('0x40')]=_['intersection'](_0x2fde66[_0x734b('0x3b')],qs['fields'](_0x13f4e8['query']['fields']));_0x31e1ec[_0x734b('0x40')]=_0x31e1ec[_0x734b('0x40')][_0x734b('0x41')]?_0x31e1ec[_0x734b('0x40')]:_0x2fde66['model'];_0x31e1ec[_0x734b('0x7e')]=qs[_0x734b('0x44')](_0x13f4e8['query'][_0x734b('0x44')]);_0x31e1ec[_0x734b('0x45')]=qs['filters'](_[_0x734b('0x46')](_0x13f4e8['query'],_0x2fde66[_0x734b('0x3d')]));if(_0x13f4e8[_0x734b('0x3f')][_0x734b('0x47')]){_0x31e1ec[_0x734b('0x45')]=_[_0x734b('0x48')](_0x31e1ec[_0x734b('0x45')],{'$or':_[_0x734b('0x35')](_0x31e1ec['attributes'],function(_0x5be5f2){var _0x57f20a={};_0x57f20a[_0x5be5f2]={'$like':'%'+_0x13f4e8[_0x734b('0x3f')][_0x734b('0x47')]+'%'};return _0x57f20a;})});}_0x31e1ec=_['merge']({},_0x31e1ec,_0x13f4e8[_0x734b('0x49')]);return _0x24fb9d[_0x734b('0x7b')](_0x31e1ec);}})[_0x734b('0x2b')](function(_0x48b0e1){if(_0x48b0e1){_0x3f3511=_0x48b0e1[_0x734b('0x41')];if(!_0x13f4e8[_0x734b('0x3f')][_0x734b('0x42')]('nolimit')){_0x31e1ec[_0x734b('0x23')]=qs[_0x734b('0x23')](_0x13f4e8[_0x734b('0x3f')]['limit']);_0x31e1ec['offset']=qs['offset'](_0x13f4e8[_0x734b('0x3f')]['offset']);}return _0x24fb9d[_0x734b('0x7b')](_0x31e1ec);}})[_0x734b('0x2b')](function(_0x2a5aa9){if(_0x2a5aa9){return _0x2a5aa9?{'count':_0x3f3511,'rows':_0x2a5aa9}:null;}})['then'](respondWithResult(_0x41eca7,null))['catch'](handleError(_0x41eca7,null));};exports[_0x734b('0x7f')]=function(_0xa9bb2a,_0x4f3a90,_0x72d3ad){var _0x548206={};var _0x4a809a={};var _0x52890d;var _0xbb8121;return db[_0x734b('0x36')][_0x734b('0x7c')]({'where':{'id':_0xa9bb2a[_0x734b('0x50')]['id']}})[_0x734b('0x2b')](handleEntityNotFound(_0x4f3a90,null))[_0x734b('0x2b')](function(_0x18cb9){if(_0x18cb9){_0x52890d=_0x18cb9;_0x4a809a['model']=_[_0x734b('0x3c')](db[_0x734b('0x80')][_0x734b('0x37')]);_0x4a809a[_0x734b('0x3f')]=_['keys'](_0xa9bb2a['query']);_0x4a809a['filters']=_[_0x734b('0x3e')](_0x4a809a[_0x734b('0x3b')],_0x4a809a[_0x734b('0x3f')]);_0x548206[_0x734b('0x40')]=_[_0x734b('0x3e')](_0x4a809a[_0x734b('0x3b')],qs[_0x734b('0x4d')](_0xa9bb2a[_0x734b('0x3f')][_0x734b('0x4d')]));_0x548206[_0x734b('0x40')]=_0x548206[_0x734b('0x40')][_0x734b('0x41')]?_0x548206[_0x734b('0x40')]:_0x4a809a['model'];_0x548206['order']=qs[_0x734b('0x44')](_0xa9bb2a[_0x734b('0x3f')][_0x734b('0x44')]);_0x548206['where']=qs[_0x734b('0x3d')](_[_0x734b('0x46')](_0xa9bb2a[_0x734b('0x3f')],_0x4a809a[_0x734b('0x3d')]));if(_0xa9bb2a[_0x734b('0x3f')][_0x734b('0x47')]){_0x548206[_0x734b('0x45')]=_[_0x734b('0x48')](_0x548206[_0x734b('0x45')],{'$or':_[_0x734b('0x35')](_0x548206[_0x734b('0x40')],function(_0x30dff6){var _0x5ac65f={};_0x5ac65f[_0x30dff6]={'$like':'%'+_0xa9bb2a[_0x734b('0x3f')]['filter']+'%'};return _0x5ac65f;})});}_0x548206=_[_0x734b('0x48')]({},_0x548206,_0xa9bb2a[_0x734b('0x49')]);return _0x52890d[_0x734b('0x7f')](_0x548206);}})[_0x734b('0x2b')](function(_0x1bedc4){if(_0x1bedc4){_0xbb8121=_0x1bedc4['length'];if(!_0xa9bb2a[_0x734b('0x3f')][_0x734b('0x42')]('nolimit')){_0x548206[_0x734b('0x23')]=qs[_0x734b('0x23')](_0xa9bb2a[_0x734b('0x3f')][_0x734b('0x23')]);_0x548206['offset']=qs['offset'](_0xa9bb2a[_0x734b('0x3f')][_0x734b('0x25')]);}return _0x52890d['getTeams'](_0x548206);}})[_0x734b('0x2b')](function(_0x19a54a){if(_0x19a54a){return _0x19a54a?{'count':_0xbb8121,'rows':_0x19a54a}:null;}})[_0x734b('0x2b')](respondWithResult(_0x4f3a90,null))[_0x734b('0x4c')](handleError(_0x4f3a90,null));};exports[_0x734b('0x81')]=function(_0x4e46a2,_0x5d0a69,_0x303257){var _0x1bac04=_0x4e46a2[_0x734b('0x55')]['ids'];var _0x200182;return db[_0x734b('0x80')][_0x734b('0x82')]({'where':{'id':_0x1bac04},'attributes':['id'],'include':[{'model':db[_0x734b('0x7d')],'as':_0x734b('0x83'),'attributes':['id',_0x734b('0x32'),_0x734b('0x84'),_0x734b('0x85'),_0x734b('0x86')],'raw':!![]}]})[_0x734b('0x2b')](function(_0x48fbb3){if(_0x48fbb3){_0x200182=_0x48fbb3;var _0x564dda=_[_0x734b('0x87')](_0x48fbb3,function(_0x26af1f){var _0x1ba633=_0x26af1f[_0x734b('0x2c')]({'plain':!![]});return _0x1ba633[_0x734b('0x83')];});return db[_0x734b('0x36')][_0x734b('0x4f')]({'where':{'id':_0x4e46a2[_0x734b('0x50')]['id']}})[_0x734b('0x2b')](function(_0xc74aeb){return db[_0x734b('0x53')]['transaction'](function(_0x288109){return _0xc74aeb[_0x734b('0x81')](_0x1bac04,{'transaction':_0x288109})['then'](function(){return BPromise['each'](_0x200182,function(_0x255fca){return db[_0x734b('0x88')][_0x734b('0x89')]({'TeamId':_0x255fca['id'],'VoicePrefixId':_0x4e46a2[_0x734b('0x50')]['id']},{'transaction':_0x288109});});})['then'](function(){return BPromise[_0x734b('0x8a')](_0x564dda,function(_0x1c9a1e){return db['UserVoicePrefix'][_0x734b('0x8b')]({'where':{'UserId':_0x1c9a1e['id'],'VoicePrefixId':_0x4e46a2[_0x734b('0x50')]['id']},'transaction':_0x288109});});})[_0x734b('0x2b')](function(){_0x564dda[_0x734b('0x8c')](function(_0x189e6d){socket[_0x734b('0x79')](_0x734b('0x76'),{'UserId':_0x189e6d['id'],'VoicePrefixId':_0xc74aeb['id']});});});});});}})[_0x734b('0x2b')](respondWithStatusCode(_0x5d0a69,null))['catch'](handleError(_0x5d0a69,null));};exports[_0x734b('0x8d')]=function(_0x31468d,_0x45a160,_0x16451a){return db[_0x734b('0x80')]['findAll']({'where':{'id':_0x31468d['query'][_0x734b('0x74')]},'attributes':['id'],'include':[{'model':db[_0x734b('0x7d')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x734b('0x2b')](handleEntityNotFound(_0x45a160,null))['then'](function(_0x19cf27){var _0x1237cf=_[_0x734b('0x35')](_0x19cf27,'id');var _0x42038a=[];var _0x3e61f1=[];var _0x22e919=squel[_0x734b('0x8e')]();_0x22e919['field']('tq.TeamId')[_0x734b('0x8f')](_0x734b('0x90'),'tq')[_0x734b('0x91')]('user_has_teams','ut',_0x734b('0x92'))[_0x734b('0x45')](_0x734b('0x93'),_0x31468d['params']['id']);for(var _0x1fcc17=0x0;_0x1fcc17<_0x19cf27[_0x734b('0x41')];_0x1fcc17+=0x1){let _0x39a46e=_0x19cf27[_0x1fcc17];for(var _0x2a8f17=0x0;_0x2a8f17<_0x39a46e['Agents']['length'];_0x2a8f17+=0x1){let _0x9cfb2f=_0x39a46e[_0x734b('0x83')][_0x2a8f17];var _0x326783=_0x22e919['clone']();_0x326783[_0x734b('0x45')]('ut.UserId\x20=\x20?',_0x9cfb2f['id']);_0x3e61f1[_0x734b('0x68')](db[_0x734b('0x53')][_0x734b('0x3f')](_0x326783[_0x734b('0x94')](),{'type':db[_0x734b('0x53')]['QueryTypes'][_0x734b('0x95')]})[_0x734b('0x2b')](function(_0x5ddf23){if(_0x5ddf23['length']===0x1){return _0x9cfb2f['id'];}else{var _0x967ccc=_[_0x734b('0x96')](_['map'](_0x5ddf23,_0x734b('0x97')),function(_0x23be49){return _['includes'](_0x1237cf,_0x23be49);});if(_0x967ccc){return _0x9cfb2f['id'];}}}));}}return BPromise[_0x734b('0x98')](_0x3e61f1)['then'](function(_0x4d75bc){_0x42038a=_(_0x42038a)['union'](_0x4d75bc)[_0x734b('0x99')]()['value']();return db[_0x734b('0x36')]['find']({'where':{'id':_0x31468d[_0x734b('0x50')]['id']}})['then'](function(_0xf43253){return db[_0x734b('0x53')][_0x734b('0x54')](function(_0x483d0a){return _0xf43253[_0x734b('0x8d')](_0x31468d[_0x734b('0x3f')]['ids'],{'transaction':_0x483d0a})[_0x734b('0x2b')](function(){if(!_['isEmpty'](_0x42038a)){return _0xf43253[_0x734b('0x77')](_0x42038a,{'transaction':_0x483d0a});}})[_0x734b('0x2b')](function(){_0x42038a['forEach'](function(_0x1f00b3){socket[_0x734b('0x79')](_0x734b('0x7a'),{'UserId':_0x1f00b3,'VoicePrefixId':_0xf43253['id']});});});});});});})[_0x734b('0x2b')](respondWithStatusCode(_0x45a160,null))['catch'](handleError(_0x45a160,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 83abc3e..1659807 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 _0x8007=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x3fd695,_0x2c0419){var _0x1b9f21=function(_0x476f99){while(--_0x476f99){_0x3fd695['push'](_0x3fd695['shift']());}};_0x1b9f21(++_0x2c0419);}(_0x8007,0x1aa));var _0x7800=function(_0x4ab5da,_0x514fb7){_0x4ab5da=_0x4ab5da-0x0;var _0x21c927=_0x8007[_0x4ab5da];return _0x21c927;};'use strict';var EventEmitter=require(_0x7800('0x0'));var VoicePrefix=require(_0x7800('0x1'))['db'][_0x7800('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x7800('0x3')](0x0);var events={'afterCreate':_0x7800('0x4'),'afterUpdate':'update','afterDestroy':_0x7800('0x5')};function emitEvent(_0x47d5d1){return function(_0xe4b12,_0xecf907,_0x51c22e){VoicePrefixEvents[_0x7800('0x6')](_0x47d5d1+':'+_0xe4b12['id'],_0xe4b12);VoicePrefixEvents[_0x7800('0x6')](_0x47d5d1,_0xe4b12);_0x51c22e(null);};}for(var e in events){if(events[_0x7800('0x7')](e)){var event=events[e];VoicePrefix[_0x7800('0x8')](e,emitEvent(event));}}module[_0x7800('0x9')]=VoicePrefixEvents; \ No newline at end of file +var _0x59a2=['../../mysqldb','VoicePrefix','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0xe27810,_0x8b3e76){var _0x53dcec=function(_0x4a83c7){while(--_0x4a83c7){_0xe27810['push'](_0xe27810['shift']());}};_0x53dcec(++_0x8b3e76);}(_0x59a2,0x13f));var _0x259a=function(_0x1b5818,_0x242115){_0x1b5818=_0x1b5818-0x0;var _0x5e3876=_0x59a2[_0x1b5818];return _0x5e3876;};'use strict';var EventEmitter=require(_0x259a('0x0'));var VoicePrefix=require(_0x259a('0x1'))['db'][_0x259a('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x259a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x259a('0x4'),'afterDestroy':_0x259a('0x5')};function emitEvent(_0x4454cf){return function(_0xeabd6f,_0x28a12d,_0x500de7){VoicePrefixEvents[_0x259a('0x6')](_0x4454cf+':'+_0xeabd6f['id'],_0xeabd6f);VoicePrefixEvents[_0x259a('0x6')](_0x4454cf,_0xeabd6f);_0x500de7(null);};}for(var e in events){if(events[_0x259a('0x7')](e)){var event=events[e];VoicePrefix[_0x259a('0x8')](e,emitEvent(event));}}module[_0x259a('0x9')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index ff8d346..bfc10c3 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 _0xcf2f=['bluebird','request-promise','path','rimraf','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger','api','moment'];(function(_0x1f23b1,_0x57c83f){var _0x3c9197=function(_0x2f6e4a){while(--_0x2f6e4a){_0x1f23b1['push'](_0x1f23b1['shift']());}};_0x3c9197(++_0x57c83f);}(_0xcf2f,0xbf));var _0xfcf2=function(_0x10df71,_0x4dbaf4){_0x10df71=_0x10df71-0x0;var _0x1fd8c3=_0xcf2f[_0x10df71];return _0x1fd8c3;};'use strict';var _=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var logger=require(_0xfcf2('0x2'))(_0xfcf2('0x3'));var moment=require(_0xfcf2('0x4'));var BPromise=require(_0xfcf2('0x5'));var rp=require(_0xfcf2('0x6'));var fs=require('fs');var path=require(_0xfcf2('0x7'));var rimraf=require(_0xfcf2('0x8'));var config=require('../../config/environment');var attributes=require(_0xfcf2('0x9'));module[_0xfcf2('0xa')]=function(_0x293344,_0x55b46a){return _0x293344[_0xfcf2('0xb')](_0xfcf2('0xc'),attributes,{'tableName':_0xfcf2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeee1=['voice_prefixes','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','VoicePrefix'];(function(_0x1a1caa,_0x39295f){var _0x322687=function(_0x3289f1){while(--_0x3289f1){_0x1a1caa['push'](_0x1a1caa['shift']());}};_0x322687(++_0x39295f);}(_0xeee1,0x177));var _0x1eee=function(_0x5dacfa,_0x394140){_0x5dacfa=_0x5dacfa-0x0;var _0x48dac6=_0xeee1[_0x5dacfa];return _0x48dac6;};'use strict';var _=require(_0x1eee('0x0'));var util=require('util');var logger=require(_0x1eee('0x1'))(_0x1eee('0x2'));var moment=require(_0x1eee('0x3'));var BPromise=require('bluebird');var rp=require(_0x1eee('0x4'));var fs=require('fs');var path=require(_0x1eee('0x5'));var rimraf=require(_0x1eee('0x6'));var config=require(_0x1eee('0x7'));var attributes=require('./voicePrefix.attributes');module[_0x1eee('0x8')]=function(_0x563fa1,_0x11596f){return _0x563fa1['define'](_0x1eee('0x9'),attributes,{'tableName':_0x1eee('0xa'),'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 0369950..19af409 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 _0x9134=['error','code','message','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','request','then','VoicePrefix,\x20%s,\x20%s','debug','request\x20sent','stringify'];(function(_0xca4cee,_0x44a631){var _0x5d2fdd=function(_0x3d4215){while(--_0x3d4215){_0xca4cee['push'](_0xca4cee['shift']());}};_0x5d2fdd(++_0x44a631);}(_0x9134,0x87));var _0x4913=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9134[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x4913('0x0'));var moment=require(_0x4913('0x1'));var BPromise=require(_0x4913('0x2'));var rs=require(_0x4913('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4913('0x4'));var logger=require(_0x4913('0x5'))(_0x4913('0x6'));var config=require(_0x4913('0x7'));var jayson=require(_0x4913('0x8'));var client=jayson[_0x4913('0x9')]['http']({'port':0x232a});config[_0x4913('0xa')]=_[_0x4913('0xb')](config[_0x4913('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4913('0xc'))(new Redis(config[_0x4913('0xa')]));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x4d9eb2,_0xae5842,_0x57260f){return new BPromise(function(_0x28f919,_0x1c08ac){return client[_0x4913('0xd')](_0x4d9eb2,_0x57260f)[_0x4913('0xe')](function(_0x3c3272){logger['info'](_0x4913('0xf'),_0xae5842,'request\x20sent');logger[_0x4913('0x10')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0xae5842,_0x4913('0x11'),JSON[_0x4913('0x12')](_0x3c3272));if(_0x3c3272[_0x4913('0x13')]){if(_0x3c3272['error'][_0x4913('0x14')]===0x1f4){logger[_0x4913('0x13')]('VoicePrefix,\x20%s,\x20%s',_0xae5842,_0x3c3272['error'][_0x4913('0x15')]);return _0x1c08ac(_0x3c3272[_0x4913('0x13')][_0x4913('0x15')]);}logger[_0x4913('0x13')]('VoicePrefix,\x20%s,\x20%s',_0xae5842,_0x3c3272[_0x4913('0x13')][_0x4913('0x15')]);return _0x28f919(_0x3c3272['error'][_0x4913('0x15')]);}else{logger['info'](_0x4913('0xf'),_0xae5842,_0x4913('0x11'));_0x28f919(_0x3c3272['result'][_0x4913('0x15')]);}})['catch'](function(_0x50584a){logger[_0x4913('0x13')](_0x4913('0xf'),_0xae5842,_0x50584a);_0x1c08ac(_0x50584a);});});} \ No newline at end of file +var _0x176c=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird'];(function(_0x3428b7,_0x597cea){var _0x8ffa4d=function(_0x4bca28){while(--_0x4bca28){_0x3428b7['push'](_0x3428b7['shift']());}};_0x8ffa4d(++_0x597cea);}(_0x176c,0x134));var _0xc176=function(_0x323c6a,_0x5309c4){_0x323c6a=_0x323c6a-0x0;var _0x19bd03=_0x176c[_0x323c6a];return _0x19bd03;};'use strict';var _=require(_0xc176('0x0'));var util=require(_0xc176('0x1'));var moment=require(_0xc176('0x2'));var BPromise=require(_0xc176('0x3'));var rs=require(_0xc176('0x4'));var fs=require('fs');var Redis=require(_0xc176('0x5'));var db=require(_0xc176('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc176('0x7'))(_0xc176('0x8'));var config=require('../../config/environment');var jayson=require(_0xc176('0x9'));var client=jayson[_0xc176('0xa')][_0xc176('0xb')]({'port':0x232a});config['redis']=_[_0xc176('0xc')](config[_0xc176('0xd')],{'host':_0xc176('0xe'),'port':0x18eb});var socket=require(_0xc176('0xf'))(new Redis(config[_0xc176('0xd')]));require('./voicePrefix.socket')[_0xc176('0x10')](socket);function respondWithRpcPromise(_0x1486c9,_0x2f95eb,_0x48186c){return new BPromise(function(_0x3e7997,_0x208607){return client[_0xc176('0x11')](_0x1486c9,_0x48186c)[_0xc176('0x12')](function(_0x420bf8){logger[_0xc176('0x13')](_0xc176('0x14'),_0x2f95eb,_0xc176('0x15'));logger['debug'](_0xc176('0x16'),_0x2f95eb,_0xc176('0x15'),JSON[_0xc176('0x17')](_0x420bf8));if(_0x420bf8[_0xc176('0x18')]){if(_0x420bf8[_0xc176('0x18')]['code']===0x1f4){logger[_0xc176('0x18')](_0xc176('0x14'),_0x2f95eb,_0x420bf8[_0xc176('0x18')]['message']);return _0x208607(_0x420bf8[_0xc176('0x18')]['message']);}logger[_0xc176('0x18')](_0xc176('0x14'),_0x2f95eb,_0x420bf8['error'][_0xc176('0x19')]);return _0x3e7997(_0x420bf8[_0xc176('0x18')][_0xc176('0x19')]);}else{logger[_0xc176('0x13')](_0xc176('0x14'),_0x2f95eb,_0xc176('0x15'));_0x3e7997(_0x420bf8['result'][_0xc176('0x19')]);}})['catch'](function(_0x20228b){logger[_0xc176('0x18')](_0xc176('0x14'),_0x2f95eb,_0x20228b);_0x208607(_0x20228b);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index f5cfff2..057f53d 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 _0x0db9=['emit','removeListener','length','./voicePrefix.events'];(function(_0x513c68,_0x3d15e2){var _0x361e7d=function(_0x131ed6){while(--_0x131ed6){_0x513c68['push'](_0x513c68['shift']());}};_0x361e7d(++_0x3d15e2);}(_0x0db9,0xa3));var _0x90db=function(_0x59145a,_0x1f60f1){_0x59145a=_0x59145a-0x0;var _0xf04d7=_0x0db9[_0x59145a];return _0xf04d7;};'use strict';var VoicePrefixEvents=require(_0x90db('0x0'));var events=['save','remove','update'];function createListener(_0x2c73bc,_0x405229){return function(_0x553431){_0x405229[_0x90db('0x1')](_0x2c73bc,_0x553431);};}function removeListener(_0x500dcf,_0x1e0f41){return function(){VoicePrefixEvents[_0x90db('0x2')](_0x500dcf,_0x1e0f41);};}exports['register']=function(_0x2d02a1){for(var _0x242774=0x0,_0x476491=events[_0x90db('0x3')];_0x242774<_0x476491;_0x242774++){var _0x915ca=events[_0x242774];var _0x9b6d0d=createListener('voicePrefix:'+_0x915ca,_0x2d02a1);VoicePrefixEvents['on'](_0x915ca,_0x9b6d0d);}}; \ No newline at end of file +var _0x0962=['./voicePrefix.events','save','remove','update','removeListener','register','length','voicePrefix:'];(function(_0xd690a1,_0x4c9ab8){var _0x588cba=function(_0x454ec4){while(--_0x454ec4){_0xd690a1['push'](_0xd690a1['shift']());}};_0x588cba(++_0x4c9ab8);}(_0x0962,0x198));var _0x2096=function(_0x42c646,_0x283326){_0x42c646=_0x42c646-0x0;var _0x24e32a=_0x0962[_0x42c646];return _0x24e32a;};'use strict';var VoicePrefixEvents=require(_0x2096('0x0'));var events=[_0x2096('0x1'),_0x2096('0x2'),_0x2096('0x3')];function createListener(_0x57617c,_0x38bed1){return function(_0x580e85){_0x38bed1['emit'](_0x57617c,_0x580e85);};}function removeListener(_0x2fe7b1,_0x2001d9){return function(){VoicePrefixEvents[_0x2096('0x4')](_0x2fe7b1,_0x2001d9);};}exports[_0x2096('0x5')]=function(_0x1ce10d){for(var _0x462564=0x0,_0x130711=events[_0x2096('0x6')];_0x462564<_0x130711;_0x462564++){var _0x4b5f76=events[_0x462564];var _0x16799f=createListener(_0x2096('0x7')+_0x4b5f76,_0x1ce10d);VoicePrefixEvents['on'](_0x4b5f76,_0x16799f);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 40b0d41..677e448 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 _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0x24cc72,_0x4dc73a){var _0xd49f1e=function(_0x39f581){while(--_0x39f581){_0x24cc72['push'](_0x24cc72['shift']());}};_0xd49f1e(++_0x4dc73a);}(_0xb10b,0x12a));var _0xbb10=function(_0x953a55,_0x736d43){_0x953a55=_0x953a55-0x0;var _0x43fa9a=_0xb10b[_0x953a55];return _0x43fa9a;};'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 fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file +var _0xb10b=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','getTeams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','/:id','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout'];(function(_0xdb4e73,_0x30b446){var _0x4578b4=function(_0x119eb5){while(--_0x119eb5){_0xdb4e73['push'](_0xdb4e73['shift']());}};_0x4578b4(++_0x30b446);}(_0xb10b,0x12a));var _0xbb10=function(_0x5ecff9,_0x473070){_0x5ecff9=_0x5ecff9-0x0;var _0x5e1415=_0xb10b[_0x5ecff9];return _0x5e1415;};'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 fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0x9')](_0xbb10('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xbb10('0x9')](_0xbb10('0x10'),auth[_0xbb10('0xb')](),controller['getHopperFinals']);router[_0xbb10('0x9')]('/:id/hopper_black',auth[_0xbb10('0xb')](),controller[_0xbb10('0x11')]);router[_0xbb10('0x9')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x13')]);router['get'](_0xbb10('0x14'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x15')]);router[_0xbb10('0x9')](_0xbb10('0x16'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x17')]);router[_0xbb10('0x9')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller['getLists']);router[_0xbb10('0x9')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')]('/',auth[_0xbb10('0xb')](),controller[_0xbb10('0x1c')]);router[_0xbb10('0x1b')](_0xbb10('0x1d'),auth[_0xbb10('0xb')](),controller['clone']);router[_0xbb10('0x1b')](_0xbb10('0x12'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);router[_0xbb10('0x1b')](_0xbb10('0x14'),auth['isAuthenticated'](),controller[_0xbb10('0x1f')]);router[_0xbb10('0x1b')]('/:id/lists',auth['isAuthenticated'](),controller[_0xbb10('0x20')]);router[_0xbb10('0x1b')](_0xbb10('0x19'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x21')]);router[_0xbb10('0x22')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x24')]);router[_0xbb10('0x25')](_0xbb10('0x23'),auth[_0xbb10('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth[_0xbb10('0xb')](),controller[_0xbb10('0x26')]);router[_0xbb10('0x25')]('/:id/users',auth[_0xbb10('0xb')](),controller[_0xbb10('0x27')]);router[_0xbb10('0x25')](_0xbb10('0x18'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x28')]);router[_0xbb10('0x25')]('/:id/blacklists',auth[_0xbb10('0xb')](),controller[_0xbb10('0x29')]);module[_0xbb10('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index e2d3e05..647f8cb 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 _0xbb7b=['onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#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)','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','inbound','default','ringall','leastrecent','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','type','dialMethod','getDataValue','preview','booked','roundrobin','includes','INTEGER','yes','all','once','TEXT','join','periodic_announce','joinempty','split','leavewhenempty','BOOLEAN','acw','wrapuptime','power','predictive','progressive','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','never'];(function(_0xff2f6d,_0x3fde1c){var _0x5e7681=function(_0x53f971){while(--_0x53f971){_0xff2f6d['push'](_0xff2f6d['shift']());}};_0x5e7681(++_0x3fde1c);}(_0xbb7b,0x158));var _0xbbb7=function(_0x276580,_0x18b849){_0x276580=_0x276580-0x0;var _0x47c12f=_0xbb7b[_0x276580];return _0x47c12f;};'use strict';var Sequelize=require(_0xbbb7('0x0'));module[_0xbbb7('0x1')]={'name':{'type':Sequelize[_0xbbb7('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xbbb7('0x3')]('inbound','outbound'),'allowNull':![],'defaultValue':_0xbbb7('0x4')},'musiconhold':{'type':Sequelize[_0xbbb7('0x2')],'defaultValue':_0xbbb7('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0xbbb7('0x3')]('rr',_0xbbb7('0x6'),_0xbbb7('0x7'),'fewestcalls','random',_0xbbb7('0x8'),_0xbbb7('0x9'),_0xbbb7('0xa'),_0xbbb7('0xb')),'allowNull':![],'defaultValue':_0xbbb7('0x6'),'set':function(_0x8a69c0){this[_0xbbb7('0xc')](_0xbbb7('0xd'),_0x8a69c0?_0x8a69c0:_0xbbb7('0x8'));},'get':function(){var _0x48b911=this['getDataValue'](_0xbbb7('0xe'));var _0x44aa2d=this['getDataValue'](_0xbbb7('0xf'));var _0x53ca5e=this[_0xbbb7('0x10')](_0xbbb7('0xd'));if(_0x48b911==='outbound'){if(_0x44aa2d===_0xbbb7('0x11')){return null;}if(_0x44aa2d===_0xbbb7('0x12')&&!['rrmemory',_0xbbb7('0x13')][_0xbbb7('0x14')](_0x53ca5e)){this[_0xbbb7('0xc')](_0xbbb7('0xd'),_0xbbb7('0x8'));}}return _0x53ca5e;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xbbb7('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xbbb7('0x15')](0xb)},'timeout':{'type':Sequelize[_0xbbb7('0x15')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xbbb7('0x15')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xbbb7('0x2')]},'weight':{'type':Sequelize[_0xbbb7('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0xbbb7('0x3')](_0xbbb7('0x16'),'no'),'defaultValue':_0xbbb7('0x16')},'autopause':{'type':Sequelize[_0xbbb7('0x3')](_0xbbb7('0x16'),'no',_0xbbb7('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xbbb7('0x15')](0xb)},'autopausebusy':{'type':Sequelize[_0xbbb7('0x3')](_0xbbb7('0x16'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0xbbb7('0x16'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xbbb7('0x15')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xbbb7('0x3')](_0xbbb7('0x16'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0xbbb7('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xbbb7('0x3')](_0xbbb7('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xbbb7('0x3')](_0xbbb7('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xbbb7('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xbbb7('0x2')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xbbb7('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xbbb7('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xbbb7('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xbbb7('0x3')](_0xbbb7('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xbbb7('0x3')](_0xbbb7('0x16'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0xbbb7('0x3')](_0xbbb7('0x16'),'no',_0xbbb7('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize['STRING'],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0xbbb7('0x15')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xbbb7('0x3')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xbbb7('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0xbbb7('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xbbb7('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xbbb7('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xbbb7('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xbbb7('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xbbb7('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thankyou':{'type':Sequelize['STRING'],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xbbb7('0x2')]},'queue_quantity1':{'type':Sequelize[_0xbbb7('0x2')]},'queue_quantity2':{'type':Sequelize[_0xbbb7('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0xbbb7('0x2')]},'queue_less_than':{'type':Sequelize[_0xbbb7('0x2')]},'periodic_announce':{'type':Sequelize[_0xbbb7('0x19')],'set':function(_0xc2b350){this[_0xbbb7('0xc')]('periodic_announce',_0xc2b350?_0xc2b350[_0xbbb7('0x1a')](','):[]);},'get':function(){return this[_0xbbb7('0x10')](_0xbbb7('0x1b'))?this[_0xbbb7('0x10')](_0xbbb7('0x1b'))['split'](','):[];}},'joinempty':{'type':Sequelize[_0xbbb7('0x2')],'defaultValue':_0xbbb7('0x16'),'set':function(_0x2d082c){this['setDataValue']('joinempty',_0x2d082c?_0x2d082c[_0xbbb7('0x1a')](','):undefined);},'get':function(){return this['getDataValue'](_0xbbb7('0x1c'))?this['getDataValue'](_0xbbb7('0x1c'))[_0xbbb7('0x1d')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x89c48e){this[_0xbbb7('0xc')](_0xbbb7('0x1e'),_0x89c48e?_0x89c48e[_0xbbb7('0x1a')](','):undefined);},'get':function(){return this[_0xbbb7('0x10')](_0xbbb7('0x1e'))?this[_0xbbb7('0x10')]('leavewhenempty')[_0xbbb7('0x1d')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xbbb7('0x3')](_0xbbb7('0x16'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xbbb7('0x16'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xbbb7('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xbbb7('0x2')]},'description':{'type':Sequelize[_0xbbb7('0x2')]},'acw':{'type':Sequelize[_0xbbb7('0x1f')],'defaultValue':0x0,'set':function(_0x3ecf35){this['setDataValue'](_0xbbb7('0x20'),_0x3ecf35);if(_0x3ecf35){if(this[_0xbbb7('0x10')](_0xbbb7('0x21'))<0x2){this[_0xbbb7('0xc')](_0xbbb7('0x21'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0xbbb7('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xbbb7('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0xbbb7('0x3')]('preview','progressive',_0xbbb7('0x22'),_0xbbb7('0x23'),_0xbbb7('0x12')),'defaultValue':_0xbbb7('0x24'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0xbbb7('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xbbb7('0x25')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xbbb7('0x26')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xbbb7('0x27')},'dialPowerLevel':{'type':Sequelize[_0xbbb7('0x28')](0x2)[_0xbbb7('0x26')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xbbb7('0x3')](_0xbbb7('0x29'),_0xbbb7('0x2a')),'defaultValue':_0xbbb7('0x2a'),'comment':_0xbbb7('0x2b')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xbbb7('0x28')](0x2)[_0xbbb7('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0xbbb7('0x26')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xbbb7('0x2c')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xbbb7('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0xbbb7('0x15')](0x3)[_0xbbb7('0x26')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbbb7('0x2d')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0xbbb7('0x2e'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbbb7('0x2f')},'dialQueueProject':{'type':Sequelize[_0xbbb7('0x2')],'comment':_0xbbb7('0x30')},'dialCongestionMaxRetry':{'type':Sequelize[_0xbbb7('0x15')](0x3)[_0xbbb7('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbbb7('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xbbb7('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbbb7('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0xbbb7('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbbb7('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0xbbb7('0x15')](0x5)[_0xbbb7('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xbbb7('0x15')](0x3)[_0xbbb7('0x26')],'defaultValue':0x3,'comment':_0xbbb7('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xbbb7('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbbb7('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0xbbb7('0x15')](0x3)[_0xbbb7('0x26')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xbbb7('0x36')},'dialTimezone':{'type':Sequelize[_0xbbb7('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xbbb7('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xbbb7('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xbbb7('0x3')]('always',_0xbbb7('0x37'),_0xbbb7('0x38')),'defaultValue':_0xbbb7('0x39')},'dialAMDActive':{'type':Sequelize[_0xbbb7('0x1f')],'defaultValue':0x0,'comment':_0xbbb7('0x3a')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xbbb7('0x26')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xbbb7('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0xbbb7('0x15')](0x9)[_0xbbb7('0x26')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xbbb7('0x26')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xbbb7('0x3c')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xbbb7('0x15')](0x9)[_0xbbb7('0x26')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xbbb7('0x3d')},'dialAMDMinWordLength':{'type':Sequelize[_0xbbb7('0x15')](0x9)[_0xbbb7('0x26')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xbbb7('0x3e')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xbbb7('0x15')](0x9)[_0xbbb7('0x26')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xbbb7('0x15')](0x9)[_0xbbb7('0x26')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xbbb7('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xbbb7('0x15')](0x5)[_0xbbb7('0x26')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xbbb7('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0xbbb7('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xbbb7('0x41')},'dialRecallInQueue':{'type':Sequelize[_0xbbb7('0x1f')],'defaultValue':0x0,'comment':_0xbbb7('0x42')},'dialOrderByScheduledAt':{'type':Sequelize[_0xbbb7('0x3')]('DESC',_0xbbb7('0x43')),'defaultValue':_0xbbb7('0x44')},'dialQueueProject2':{'type':Sequelize[_0xbbb7('0x2')],'comment':_0xbbb7('0x30')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xbbb7('0x15')](0x3)[_0xbbb7('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xbbb7('0x45')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0xbbb7('0x26')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xbbb7('0x15')](0x3)[_0xbbb7('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xbbb7('0x15')](0x5)[_0xbbb7('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xbbb7('0x15')](0x3)[_0xbbb7('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbbb7('0x46')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xbbb7('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbbb7('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbbb7('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xbbb7('0x15')](0x5)[_0xbbb7('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbbb7('0x48')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xbbb7('0x26')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbbb7('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0xbbb7('0x15')](0x5)[_0xbbb7('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbbb7('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xbbb7('0x15')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xbbb7('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xbbb7('0x15')](0x5)[_0xbbb7('0x26')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xbbb7('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':_0xbbb7('0x4d')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2469f0){if(!_0x2469f0)this['setDataValue'](_0xbbb7('0x4e'),null);this[_0xbbb7('0xc')](_0xbbb7('0x4f'),_0x2469f0);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xbbb7('0x15')](0x3)[_0xbbb7('0x26')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0xbbb7('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xbbb7('0x1f')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize[_0xbbb7('0x15')](0x3)[_0xbbb7('0x26')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize[_0xbbb7('0x1f')],'defaultValue':![]}}; \ No newline at end of file +var _0x2fec=['random','rrmemory','setDataValue','strategy','getDataValue','type','dialMethod','preview','booked','roundrobin','includes','INTEGER','yes','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','Active/Disactive\x20Campaign','progressive','power','predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','FLOAT','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','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','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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','always','never','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#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)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls'];(function(_0x73a3ce,_0x3152f0){var _0x3dd74e=function(_0x2ebb3d){while(--_0x2ebb3d){_0x73a3ce['push'](_0x73a3ce['shift']());}};_0x3dd74e(++_0x3152f0);}(_0x2fec,0x11b));var _0xc2fe=function(_0x41fd5a,_0xfc2fca){_0x41fd5a=_0x41fd5a-0x0;var _0xbc6e4d=_0x2fec[_0x41fd5a];return _0xbc6e4d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc2fe('0x0')],'allowNull':![],'unique':_0xc2fe('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xc2fe('0x2')](_0xc2fe('0x3'),_0xc2fe('0x4')),'allowNull':![],'defaultValue':_0xc2fe('0x3')},'musiconhold':{'type':Sequelize['STRING'],'defaultValue':_0xc2fe('0x5')},'announce':{'type':Sequelize['STRING'],'defaultValue':''},'strategy':{'type':Sequelize[_0xc2fe('0x2')]('rr',_0xc2fe('0x6'),_0xc2fe('0x7'),_0xc2fe('0x8'),_0xc2fe('0x9'),_0xc2fe('0xa'),'linear','wrandom','rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x9d8e10){this[_0xc2fe('0xb')](_0xc2fe('0xc'),_0x9d8e10?_0x9d8e10:_0xc2fe('0xa'));},'get':function(){var _0x44e39a=this[_0xc2fe('0xd')](_0xc2fe('0xe'));var _0x3bf131=this[_0xc2fe('0xd')](_0xc2fe('0xf'));var _0x12875a=this[_0xc2fe('0xd')](_0xc2fe('0xc'));if(_0x44e39a===_0xc2fe('0x4')){if(_0x3bf131===_0xc2fe('0x10')){return null;}if(_0x3bf131===_0xc2fe('0x11')&&![_0xc2fe('0xa'),_0xc2fe('0x12')][_0xc2fe('0x13')](_0x12875a)){this['setDataValue'](_0xc2fe('0xc'),'rrmemory');}}return _0x12875a;}},'servicelevel':{'type':Sequelize[_0xc2fe('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xc2fe('0x0')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xc2fe('0x14')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xc2fe('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0xc2fe('0x0')]},'weight':{'type':Sequelize[_0xc2fe('0x14')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xc2fe('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xc2fe('0x15'),'no'),'defaultValue':_0xc2fe('0x15')},'autopause':{'type':Sequelize[_0xc2fe('0x2')]('yes','no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0xc2fe('0x14')](0xb)},'autopausebusy':{'type':Sequelize[_0xc2fe('0x2')](_0xc2fe('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xc2fe('0x2')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xc2fe('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0xc2fe('0x2')](_0xc2fe('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0xc2fe('0x2')]('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xc2fe('0x2')](_0xc2fe('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xc2fe('0x2')](_0xc2fe('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xc2fe('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xc2fe('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xc2fe('0x2')](_0xc2fe('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0xc2fe('0x2')](_0xc2fe('0x15'),'no'),'defaultValue':_0xc2fe('0x15')},'announce_holdtime':{'type':Sequelize[_0xc2fe('0x2')](_0xc2fe('0x15'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xc2fe('0x0')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xc2fe('0x2')](_0xc2fe('0x15'),'no')},'announce_position_limit':{'type':Sequelize[_0xc2fe('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xc2fe('0x2')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xc2fe('0x0')]},'queue_youarenext':{'type':Sequelize[_0xc2fe('0x0')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xc2fe('0x0')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xc2fe('0x0')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xc2fe('0x0')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xc2fe('0x0')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xc2fe('0x0')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xc2fe('0x0')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xc2fe('0x0')]},'queue_quantity1':{'type':Sequelize[_0xc2fe('0x0')]},'queue_quantity2':{'type':Sequelize[_0xc2fe('0x0')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x213c37){this[_0xc2fe('0xb')](_0xc2fe('0x16'),_0x213c37?_0x213c37['join'](','):[]);},'get':function(){return this[_0xc2fe('0xd')](_0xc2fe('0x16'))?this[_0xc2fe('0xd')]('periodic_announce')[_0xc2fe('0x17')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0xc2fe('0x15'),'set':function(_0x2c1e68){this['setDataValue'](_0xc2fe('0x18'),_0x2c1e68?_0x2c1e68[_0xc2fe('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0xc2fe('0x18'))?this['getDataValue'](_0xc2fe('0x18'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0xc2fe('0x0')],'defaultValue':'no','set':function(_0x582d8d){this['setDataValue'](_0xc2fe('0x1a'),_0x582d8d?_0x582d8d[_0xc2fe('0x19')](','):undefined);},'get':function(){return this[_0xc2fe('0xd')](_0xc2fe('0x1a'))?this['getDataValue'](_0xc2fe('0x1a'))['split'](','):undefined;}},'reportholdtime':{'type':Sequelize[_0xc2fe('0x2')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xc2fe('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xc2fe('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xc2fe('0x2')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xc2fe('0x0')]},'description':{'type':Sequelize[_0xc2fe('0x0')]},'acw':{'type':Sequelize[_0xc2fe('0x1b')],'defaultValue':0x0,'set':function(_0x573654){this[_0xc2fe('0xb')]('acw',_0x573654);if(_0x573654){if(this[_0xc2fe('0xd')]('wrapuptime')<0x2){this[_0xc2fe('0xb')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xc2fe('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0xc2fe('0x1b')],'defaultValue':0x0,'comment':_0xc2fe('0x1c')},'dialMethod':{'type':Sequelize['ENUM'](_0xc2fe('0x10'),_0xc2fe('0x1d'),_0xc2fe('0x1e'),_0xc2fe('0x1f'),_0xc2fe('0x11')),'defaultValue':_0xc2fe('0x1d'),'comment':_0xc2fe('0x20')},'dialLimitChannel':{'type':Sequelize[_0xc2fe('0x14')](0x4)[_0xc2fe('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xc2fe('0x22')},'dialLimitQueue':{'type':Sequelize[_0xc2fe('0x14')](0x4)[_0xc2fe('0x21')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.'},'dialPowerLevel':{'type':Sequelize[_0xc2fe('0x23')](0x2)[_0xc2fe('0x21')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0xc2fe('0x24'),_0xc2fe('0x25')),'defaultValue':'dropRate','comment':_0xc2fe('0x26')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xc2fe('0x23')](0x2)[_0xc2fe('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xc2fe('0x27')},'dialPredictiveInterval':{'type':Sequelize[_0xc2fe('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xc2fe('0x28')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc2fe('0x0')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc2fe('0x0')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xc2fe('0x21')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc2fe('0x29')},'dialQueueOptions':{'type':Sequelize[_0xc2fe('0x0')],'defaultValue':_0xc2fe('0x2a'),'comment':_0xc2fe('0x2b')},'dialQueueTimeout':{'type':Sequelize[_0xc2fe('0x14')](0x3)[_0xc2fe('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc2fe('0x2c')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xc2fe('0x2d')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc2fe('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc2fe('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc2fe('0x14')](0x5)[_0xc2fe('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc2fe('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0xc2fe('0x14')](0x3)[_0xc2fe('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xc2fe('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc2fe('0x30')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc2fe('0x14')](0x3)[_0xc2fe('0x21')],'defaultValue':0x3,'comment':_0xc2fe('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc2fe('0x14')](0x5)[_0xc2fe('0x21')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc2fe('0x32')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc2fe('0x14')](0x3)[_0xc2fe('0x21')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialPrefix':{'type':Sequelize[_0xc2fe('0x0')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xc2fe('0x2')](_0xc2fe('0x33'),_0xc2fe('0x34'),'onlyIfOpen'),'defaultValue':_0xc2fe('0x33')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xc2fe('0x35')},'dialAMDInitialSilence':{'type':Sequelize[_0xc2fe('0x14')](0x9)[_0xc2fe('0x21')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xc2fe('0x21')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xc2fe('0x36')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc2fe('0x14')](0x9)[_0xc2fe('0x21')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc2fe('0x37')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xc2fe('0x14')](0x9)[_0xc2fe('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xc2fe('0x14')](0x9)[_0xc2fe('0x21')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc2fe('0x38')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xc2fe('0x21')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc2fe('0x14')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc2fe('0x14')](0x5)[_0xc2fe('0x21')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc2fe('0x39')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc2fe('0x14')](0x9)[_0xc2fe('0x21')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc2fe('0x3a')},'dialRecallMeTimeout':{'type':Sequelize[_0xc2fe('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xc2fe('0x3b')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize[_0xc2fe('0x2')](_0xc2fe('0x3c'),_0xc2fe('0x3d')),'defaultValue':_0xc2fe('0x3c')},'dialQueueProject2':{'type':Sequelize[_0xc2fe('0x0')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0xc2fe('0x1b')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc2fe('0x14')](0x3)[_0xc2fe('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc2fe('0x3e')},'dialCutDigit':{'type':Sequelize[_0xc2fe('0x14')](0x3)[_0xc2fe('0x21')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc2fe('0x3f')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc2fe('0x14')](0x3)[_0xc2fe('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc2fe('0x40')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc2fe('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xc2fe('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc2fe('0x41')},'dialDropRetryFrequency':{'type':Sequelize[_0xc2fe('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0xc2fe('0x14')](0x3)[_0xc2fe('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc2fe('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc2fe('0x42')},'dialMachineMaxRetry':{'type':Sequelize[_0xc2fe('0x14')](0x3)[_0xc2fe('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc2fe('0x43')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc2fe('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc2fe('0x21')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc2fe('0x44')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc2fe('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc2fe('0x45')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xc2fe('0x14')],'allowNull':!![],'comment':_0xc2fe('0x46')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xc2fe('0x47'),'set':function(_0x4bdccb){if(!_0x4bdccb)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0xc2fe('0xb')](_0xc2fe('0x48'),_0x4bdccb);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0xc2fe('0x14')](0x3)[_0xc2fe('0x21')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xc2fe('0x21')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0xc2fe('0x1b')],'defaultValue':!![]},'callAdditionalPhoneAfterMin':{'type':Sequelize['INTEGER'](0x3)[_0xc2fe('0x21')],'defaultValue':0x4},'dialPreviewRecallmeReminder':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index 3fee0b4..a241598 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 _0x6f44=['role','user','inbound','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','outbound','findOne','hasOwnProperty','nolimit','VoiceQueueId','CmHopper','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','flatMap','Agents','penalty','transaction','TeamVoiceQueue','upsert','each','UserVoiceQueueRt','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','ids','User','select','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.UserId\x20=\x20?','sequelize','union','compact','removeTeams','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','interface','online','push','all','isArray','getAgents','getMembers','getLists','YYYY-MM-DD\x20HH:mm:ss','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','ContactId','CmListId','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_contacts','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','insert','cm_hopper_additional_phones','CmHopperId','OrderBy','h.id','ci.OrderBy+1','cm_contact_has_items','join','h.ContactId=ci.CmContactId','PHONE','removeLists','getBlackLists','CmList','addBlackLists','spread','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','status','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','get','VoiceQueues','QueueCampaigns','ignore','value','includes','type','name','error','send','index','map','VoiceQueue','key','model','query','filters','attributes','fields','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','rawAttributes','intersection','length','find','body','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x4a47fc,_0x25208f){var _0x30f1ee=function(_0x33ea17){while(--_0x33ea17){_0x4a47fc['push'](_0x4a47fc['shift']());}};_0x30f1ee(++_0x25208f);}(_0x6f44,0x1ea));var _0x46f4=function(_0x90cc54,_0x35c5ad){_0x90cc54=_0x90cc54-0x0;var _0x599dab=_0x6f44[_0x90cc54];return _0x599dab;};'use strict';var emlformat=require(_0x46f4('0x0'));var rimraf=require(_0x46f4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46f4('0x2'));var rp=require(_0x46f4('0x3'));var moment=require(_0x46f4('0x4'));var BPromise=require(_0x46f4('0x5'));var Mustache=require(_0x46f4('0x6'));var util=require(_0x46f4('0x7'));var path=require(_0x46f4('0x8'));var sox=require(_0x46f4('0x9'));var csv=require(_0x46f4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x46f4('0xb'));var _=require(_0x46f4('0xc'));var squel=require(_0x46f4('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x46f4('0xe'));var toCsv=require(_0x46f4('0xa'));var querystring=require('querystring');var Papa=require(_0x46f4('0xf'));var Redis=require('ioredis');var authService=require(_0x46f4('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x46f4('0x11'));var hardwareService=require(_0x46f4('0x12'));var logger=require(_0x46f4('0x13'))(_0x46f4('0x14'));var utils=require(_0x46f4('0x15'));var config=require(_0x46f4('0x16'));var licenseUtil=require(_0x46f4('0x17'));var db=require(_0x46f4('0x18'))['db'];config[_0x46f4('0x19')]=_[_0x46f4('0x1a')](config[_0x46f4('0x19')],{'host':_0x46f4('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x46f4('0x19')]));require(_0x46f4('0x1c'))['register'](socket);function respondWithStatusCode(_0x44a55b,_0xbe2e79){_0xbe2e79=_0xbe2e79||0xcc;return function(_0x1a1649){if(_0x1a1649){return _0x44a55b['sendStatus'](_0xbe2e79);}return _0x44a55b[_0x46f4('0x1d')](_0xbe2e79)['end']();};}function respondWithResult(_0x4e84ce,_0x45917e){_0x45917e=_0x45917e||0xc8;return function(_0xf082a9){if(_0xf082a9){return _0x4e84ce[_0x46f4('0x1d')](_0x45917e)['json'](_0xf082a9);}};}function respondWithFilteredResult(_0x5c191a,_0x5e237d){return function(_0x5d3471){if(_0x5d3471){var _0x26287f=typeof _0x5e237d[_0x46f4('0x1e')]==='undefined'&&typeof _0x5e237d[_0x46f4('0x1f')]===_0x46f4('0x20');var _0x2232d6=_0x5d3471[_0x46f4('0x21')];var _0x4b0650=_0x26287f?0x0:_0x5e237d[_0x46f4('0x1e')];var _0x390137=_0x26287f?_0x5d3471[_0x46f4('0x21')]:_0x5e237d[_0x46f4('0x1e')]+_0x5e237d[_0x46f4('0x1f')];var _0xdb9f25;if(_0x390137>=_0x2232d6){_0x390137=_0x2232d6;_0xdb9f25=0xc8;}else{_0xdb9f25=0xce;}_0x5c191a['status'](_0xdb9f25);return _0x5c191a[_0x46f4('0x22')](_0x46f4('0x23'),_0x4b0650+'-'+_0x390137+'/'+_0x2232d6)[_0x46f4('0x24')](_0x5d3471);}return null;};}function patchUpdates(_0x4ba21a){return function(_0x2d6ebc){try{jsonpatch[_0x46f4('0x25')](_0x2d6ebc,_0x4ba21a,!![]);}catch(_0x185ec2){return BPromise[_0x46f4('0x26')](_0x185ec2);}return _0x2d6ebc[_0x46f4('0x27')]();};}function saveUpdates(_0x41be5e,_0x204db6){return function(_0x58d27d){if(_0x58d27d){return _0x58d27d[_0x46f4('0x28')](_0x41be5e)[_0x46f4('0x29')](function(_0x2ad553){return _0x2ad553;});}return null;};}function removeEntity(_0x16cd7f,_0x197e55){return function(_0x59b5e2){if(_0x59b5e2){return _0x59b5e2[_0x46f4('0x2a')]()[_0x46f4('0x29')](function(){var _0xb23194=_0x59b5e2[_0x46f4('0x2b')]({'plain':!![]});var _0x57eb00=[{'name':_0x46f4('0x2c'),'value':'inbound','ignore':![]},{'name':_0x46f4('0x2d'),'value':'outbound','ignore':![]}];var _0x546d2b=_(_0x57eb00)['filter'](_0x46f4('0x2e'))['map'](_0x46f4('0x2f'))[_0x46f4('0x2f')]();if(_[_0x46f4('0x30')](_0x546d2b,_0xb23194[_0x46f4('0x31')])){return;}var _0x375da1=_['find'](_0x57eb00,[_0x46f4('0x2f'),_0xb23194[_0x46f4('0x31')]])[_0x46f4('0x32')];return db['UserProfileResource'][_0x46f4('0x2a')]({'where':{'type':_0x375da1,'resourceId':_0xb23194['id']}})[_0x46f4('0x29')](function(){return _0x59b5e2;});})[_0x46f4('0x29')](function(){_0x16cd7f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f781c,_0x1ae611){return function(_0x2afa3b){if(!_0x2afa3b){_0x1f781c['sendStatus'](0x194);}return _0x2afa3b;};}function handleError(_0x2bb1e3,_0x3a61c9){_0x3a61c9=_0x3a61c9||0x1f4;return function(_0x518128){logger[_0x46f4('0x33')](_0x518128['stack']);if(_0x518128[_0x46f4('0x32')]){delete _0x518128[_0x46f4('0x32')];}_0x2bb1e3[_0x46f4('0x1d')](_0x3a61c9)[_0x46f4('0x34')](_0x518128);};}exports[_0x46f4('0x35')]=function(_0x57c030,_0x43867b){var _0x213bcd={},_0x5d35d5={},_0xd1516a={'count':0x0,'rows':[]};var _0x5c952b=_[_0x46f4('0x36')](db[_0x46f4('0x37')]['rawAttributes'],function(_0xda13d4){return{'name':_0xda13d4['fieldName'],'type':_0xda13d4[_0x46f4('0x31')][_0x46f4('0x38')]};});_0x5d35d5[_0x46f4('0x39')]=_[_0x46f4('0x36')](_0x5c952b,'name');_0x5d35d5[_0x46f4('0x3a')]=_['keys'](_0x57c030['query']);_0x5d35d5[_0x46f4('0x3b')]=_['intersection'](_0x5d35d5['model'],_0x5d35d5[_0x46f4('0x3a')]);_0x213bcd[_0x46f4('0x3c')]=_['intersection'](_0x5d35d5[_0x46f4('0x39')],qs['fields'](_0x57c030[_0x46f4('0x3a')][_0x46f4('0x3d')]));_0x213bcd[_0x46f4('0x3c')]=_0x213bcd[_0x46f4('0x3c')]['length']?_0x213bcd[_0x46f4('0x3c')]:_0x5d35d5[_0x46f4('0x39')];if(!_0x57c030[_0x46f4('0x3a')]['hasOwnProperty']('nolimit')){_0x213bcd['limit']=qs[_0x46f4('0x1f')](_0x57c030[_0x46f4('0x3a')][_0x46f4('0x1f')]);_0x213bcd[_0x46f4('0x1e')]=qs['offset'](_0x57c030[_0x46f4('0x3a')][_0x46f4('0x1e')]);}_0x213bcd[_0x46f4('0x3e')]=qs[_0x46f4('0x3f')](_0x57c030[_0x46f4('0x3a')]['sort']);_0x213bcd[_0x46f4('0x40')]=qs[_0x46f4('0x3b')](_[_0x46f4('0x41')](_0x57c030[_0x46f4('0x3a')],_0x5d35d5[_0x46f4('0x3b')]),_0x5c952b);if(_0x57c030['query']['filter']){_0x213bcd['where']=_[_0x46f4('0x42')](_0x213bcd[_0x46f4('0x40')],{'$or':_[_0x46f4('0x36')](_0x5c952b,function(_0x5eb355){if(_0x5eb355[_0x46f4('0x31')]!==_0x46f4('0x43')){var _0x33aa3b={};_0x33aa3b[_0x5eb355[_0x46f4('0x32')]]={'$like':'%'+_0x57c030[_0x46f4('0x3a')][_0x46f4('0x44')]+'%'};return _0x33aa3b;}})});}_0x213bcd=_[_0x46f4('0x42')]({},_0x213bcd,_0x57c030[_0x46f4('0x45')]);var _0x543900={'where':_0x213bcd[_0x46f4('0x40')]};return db[_0x46f4('0x37')][_0x46f4('0x21')](_0x543900)[_0x46f4('0x29')](function(_0x596039){_0xd1516a[_0x46f4('0x21')]=_0x596039;if(_0x57c030[_0x46f4('0x3a')][_0x46f4('0x46')]){_0x213bcd[_0x46f4('0x47')]=[{'all':!![]}];}return db[_0x46f4('0x37')][_0x46f4('0x48')](_0x213bcd);})['then'](function(_0x5e1cd3){_0xd1516a['rows']=_0x5e1cd3;return _0xd1516a;})[_0x46f4('0x29')](respondWithFilteredResult(_0x43867b,_0x213bcd))[_0x46f4('0x49')](handleError(_0x43867b,null));};exports[_0x46f4('0x4a')]=function(_0x19b357,_0x4369a4){var _0x379757={'raw':![],'where':{'id':_0x19b357[_0x46f4('0x4b')]['id']}},_0x2ca55d={};_0x2ca55d[_0x46f4('0x39')]=_[_0x46f4('0x4c')](db[_0x46f4('0x37')][_0x46f4('0x4d')]);_0x2ca55d['query']=_[_0x46f4('0x4c')](_0x19b357[_0x46f4('0x3a')]);_0x2ca55d[_0x46f4('0x3b')]=_['intersection'](_0x2ca55d['model'],_0x2ca55d[_0x46f4('0x3a')]);_0x379757[_0x46f4('0x3c')]=_[_0x46f4('0x4e')](_0x2ca55d['model'],qs['fields'](_0x19b357[_0x46f4('0x3a')][_0x46f4('0x3d')]));_0x379757[_0x46f4('0x3c')]=_0x379757[_0x46f4('0x3c')][_0x46f4('0x4f')]?_0x379757[_0x46f4('0x3c')]:_0x2ca55d['model'];if(_0x19b357[_0x46f4('0x3a')][_0x46f4('0x46')]){_0x379757[_0x46f4('0x47')]=[{'all':!![]}];}_0x379757=_['merge']({},_0x379757,_0x19b357[_0x46f4('0x45')]);return db[_0x46f4('0x37')][_0x46f4('0x50')](_0x379757)[_0x46f4('0x29')](handleEntityNotFound(_0x4369a4,null))['then'](respondWithResult(_0x4369a4,null))[_0x46f4('0x49')](handleError(_0x4369a4,null));};exports['create']=function(_0x2a9548,_0x3dfb7b){return db[_0x46f4('0x37')]['create'](_0x2a9548[_0x46f4('0x51')],{})[_0x46f4('0x29')](function(_0x51a464){var _0x1a2698=_0x2a9548['user']['get']({'plain':!![]});if(!_0x1a2698)throw new Error(_0x46f4('0x52'));if(_0x1a2698[_0x46f4('0x53')]===_0x46f4('0x54')){var _0x1e968a=_0x51a464['get']({'plain':!![]});var _0x5c0372=[{'name':'VoiceQueues','value':_0x46f4('0x55')},{'name':_0x46f4('0x2d'),'value':'outbound'}];var _0x9b1ef9=_[_0x46f4('0x50')](_0x5c0372,[_0x46f4('0x2f'),_0x1e968a[_0x46f4('0x31')]])['name'];return db[_0x46f4('0x56')]['find']({'where':{'name':_0x9b1ef9,'userProfileId':_0x1a2698[_0x46f4('0x57')]},'raw':!![]})[_0x46f4('0x29')](function(_0x289dde){if(_0x289dde&&_0x289dde[_0x46f4('0x58')]===0x0){return db[_0x46f4('0x59')][_0x46f4('0x5a')]({'name':_0x1e968a[_0x46f4('0x32')],'resourceId':_0x1e968a['id'],'type':_0x289dde[_0x46f4('0x32')],'sectionId':_0x289dde['id']},{})[_0x46f4('0x29')](function(){return _0x51a464;});}else{return _0x51a464;}})[_0x46f4('0x49')](function(_0x3f420b){logger[_0x46f4('0x33')](_0x46f4('0x5b'),_0x3f420b);throw _0x3f420b;});}return _0x51a464;})['then'](respondWithResult(_0x3dfb7b,0xc9))[_0x46f4('0x49')](handleError(_0x3dfb7b,null));};exports[_0x46f4('0x5c')]=function(_0x5538b9,_0x509f82){var _0x1d38f6={'where':{'id':_0x5538b9['params']['id']}},_0x32bf41={};_0x32bf41['model']=_[_0x46f4('0x4c')](db['VoiceQueue'][_0x46f4('0x4d')]);_0x1d38f6[_0x46f4('0x3c')]=_[_0x46f4('0x4e')](_0x32bf41[_0x46f4('0x39')],qs[_0x46f4('0x3d')](_0x5538b9['query'][_0x46f4('0x3d')]));_0x1d38f6['attributes']=_0x1d38f6['attributes'][_0x46f4('0x4f')]?_0x1d38f6[_0x46f4('0x3c')]:_0x32bf41[_0x46f4('0x39')];if(_0x5538b9[_0x46f4('0x3a')][_0x46f4('0x46')]){_0x1d38f6[_0x46f4('0x47')]=[{'all':!![]}];}_0x1d38f6=_['merge']({},_0x1d38f6,_0x5538b9[_0x46f4('0x45')]);return db[_0x46f4('0x37')][_0x46f4('0x50')](_0x1d38f6)[_0x46f4('0x29')](handleEntityNotFound(_0x509f82,null))[_0x46f4('0x29')](function(_0x115d77){if(_0x115d77){var _0x927caa=_0x115d77[_0x46f4('0x2b')]({'plain':!![]});_0x927caa=qs[_0x46f4('0x5d')](_0x927caa,['id',_0x46f4('0x5e'),_0x46f4('0x5f')]);_0x5538b9[_0x46f4('0x51')]=_[_0x46f4('0x5d')](_0x5538b9[_0x46f4('0x51')],['id',_0x46f4('0x5e'),_0x46f4('0x5f')]);return db[_0x46f4('0x37')][_0x46f4('0x5a')](_['merge'](_0x927caa,_0x5538b9[_0x46f4('0x51')]),{'include':_0x5538b9[_0x46f4('0x3a')][_0x46f4('0x46')]?[{'all':!![]}]:undefined})[_0x46f4('0x29')](function(_0x36ae73){var _0x5dee95=_0x5538b9[_0x46f4('0x54')][_0x46f4('0x2b')]({'plain':!![]});if(!_0x5dee95)throw new Error(_0x46f4('0x52'));if(_0x5dee95[_0x46f4('0x53')]===_0x46f4('0x54')){var _0x2a3a17=_0x36ae73[_0x46f4('0x2b')]({'plain':!![]});var _0x429f53=[{'name':_0x46f4('0x2c'),'value':_0x46f4('0x55')},{'name':_0x46f4('0x2d'),'value':_0x46f4('0x60')}];var _0x2b57df=_[_0x46f4('0x50')](_0x429f53,[_0x46f4('0x2f'),_0x2a3a17[_0x46f4('0x31')]])[_0x46f4('0x32')];return db[_0x46f4('0x56')][_0x46f4('0x50')]({'where':{'name':_0x2b57df,'userProfileId':_0x5dee95[_0x46f4('0x57')]},'raw':!![]})[_0x46f4('0x29')](function(_0x36a256){if(_0x36a256&&_0x36a256[_0x46f4('0x58')]===0x0){return db[_0x46f4('0x59')][_0x46f4('0x5a')]({'name':_0x2a3a17['name'],'resourceId':_0x2a3a17['id'],'type':_0x36a256[_0x46f4('0x32')],'sectionId':_0x36a256['id']},{})['then'](function(){return _0x36ae73;});}else{return _0x36ae73;}})[_0x46f4('0x49')](function(_0x3edcd3){logger[_0x46f4('0x33')](_0x46f4('0x5b'),_0x3edcd3);throw _0x3edcd3;});}return _0x36ae73;});}})[_0x46f4('0x29')](respondWithResult(_0x509f82,0xc9))[_0x46f4('0x49')](handleError(_0x509f82,null));};exports[_0x46f4('0x28')]=function(_0x2d804c,_0x576574){if(_0x2d804c[_0x46f4('0x51')]['id']){delete _0x2d804c[_0x46f4('0x51')]['id'];}return db['VoiceQueue'][_0x46f4('0x50')]({'where':{'id':_0x2d804c[_0x46f4('0x4b')]['id']}})[_0x46f4('0x29')](handleEntityNotFound(_0x576574,null))[_0x46f4('0x29')](saveUpdates(_0x2d804c[_0x46f4('0x51')],null))['then'](respondWithResult(_0x576574,null))[_0x46f4('0x49')](handleError(_0x576574,null));};exports['destroy']=function(_0x231d84,_0xa9b2aa){return db[_0x46f4('0x37')]['find']({'where':{'id':_0x231d84[_0x46f4('0x4b')]['id']}})[_0x46f4('0x29')](handleEntityNotFound(_0xa9b2aa,null))[_0x46f4('0x29')](removeEntity(_0xa9b2aa,null))[_0x46f4('0x49')](handleError(_0xa9b2aa,null));};exports['getHoppers']=function(_0x35b090,_0xe91269,_0x30ddf0){var _0x318c28={'raw':![],'where':{}};var _0x433340={};var _0x42b31b={'count':0x0,'rows':[]};return db[_0x46f4('0x37')][_0x46f4('0x61')]({'where':{'id':_0x35b090['params']['id']}})[_0x46f4('0x29')](handleEntityNotFound(_0xe91269,null))[_0x46f4('0x29')](function(_0x5194d8){if(_0x5194d8){_0x433340[_0x46f4('0x39')]=_[_0x46f4('0x4c')](db['CmHopper'][_0x46f4('0x4d')]);_0x433340['query']=_[_0x46f4('0x4c')](_0x35b090['query']);_0x433340[_0x46f4('0x3b')]=_[_0x46f4('0x4e')](_0x433340['model'],_0x433340['query']);_0x318c28[_0x46f4('0x3c')]=_[_0x46f4('0x4e')](_0x433340[_0x46f4('0x39')],qs[_0x46f4('0x3d')](_0x35b090[_0x46f4('0x3a')][_0x46f4('0x3d')]));_0x318c28[_0x46f4('0x3c')]=_0x318c28['attributes'][_0x46f4('0x4f')]?_0x318c28[_0x46f4('0x3c')]:_0x433340[_0x46f4('0x39')];if(!_0x35b090[_0x46f4('0x3a')][_0x46f4('0x62')](_0x46f4('0x63'))){_0x318c28['limit']=qs[_0x46f4('0x1f')](_0x35b090[_0x46f4('0x3a')]['limit']);_0x318c28[_0x46f4('0x1e')]=qs['offset'](_0x35b090[_0x46f4('0x3a')]['offset']);}_0x318c28[_0x46f4('0x3e')]=qs[_0x46f4('0x3f')](_0x35b090[_0x46f4('0x3a')]['sort']);_0x318c28[_0x46f4('0x40')]=qs[_0x46f4('0x3b')](_[_0x46f4('0x41')](_0x35b090[_0x46f4('0x3a')],_0x433340['filters']));_0x318c28[_0x46f4('0x40')][_0x46f4('0x64')]=_0x5194d8['id'];if(_0x35b090['query'][_0x46f4('0x44')]){_0x318c28[_0x46f4('0x40')]=_[_0x46f4('0x42')](_0x318c28[_0x46f4('0x40')],{'$or':_['map'](_0x318c28[_0x46f4('0x3c')],function(_0x3ec22f){var _0x48f5c2={};_0x48f5c2[_0x3ec22f]={'$like':'%'+_0x35b090[_0x46f4('0x3a')]['filter']+'%'};return _0x48f5c2;})});}_0x318c28=_[_0x46f4('0x42')]({},_0x318c28,_0x35b090[_0x46f4('0x45')]);return db[_0x46f4('0x65')]['count']({'where':_0x318c28[_0x46f4('0x40')]})[_0x46f4('0x29')](function(_0x5b9fb1){_0x42b31b[_0x46f4('0x21')]=_0x5b9fb1;if(_0x35b090[_0x46f4('0x3a')][_0x46f4('0x46')]){_0x318c28[_0x46f4('0x47')]=[{'all':!![]}];}return db[_0x46f4('0x65')][_0x46f4('0x48')](_0x318c28);})[_0x46f4('0x29')](function(_0x31fb77){_0x42b31b[_0x46f4('0x66')]=_0x31fb77;return _0x42b31b;});}})[_0x46f4('0x29')](respondWithFilteredResult(_0xe91269,_0x318c28))['catch'](handleError(_0xe91269,null));};exports[_0x46f4('0x67')]=function(_0x6531c1,_0x42a2be,_0x513d58){var _0x2df7dc={'raw':!![],'where':{}};var _0x2f7ca8={};var _0x2acb74={'count':0x0,'rows':[]};return db[_0x46f4('0x37')][_0x46f4('0x61')]({'where':{'id':_0x6531c1[_0x46f4('0x4b')]['id']}})[_0x46f4('0x29')](handleEntityNotFound(_0x42a2be,null))[_0x46f4('0x29')](function(_0x181690){if(_0x181690){_0x2f7ca8[_0x46f4('0x39')]=_[_0x46f4('0x4c')](db[_0x46f4('0x68')][_0x46f4('0x4d')]);_0x2f7ca8['query']=_[_0x46f4('0x4c')](_0x6531c1['query']);_0x2f7ca8[_0x46f4('0x3b')]=_['intersection'](_0x2f7ca8[_0x46f4('0x39')],_0x2f7ca8[_0x46f4('0x3a')]);_0x2df7dc[_0x46f4('0x3c')]=_['intersection'](_0x2f7ca8[_0x46f4('0x39')],qs[_0x46f4('0x3d')](_0x6531c1[_0x46f4('0x3a')]['fields']));_0x2df7dc['attributes']=_0x2df7dc[_0x46f4('0x3c')]['length']?_0x2df7dc[_0x46f4('0x3c')]:_0x2f7ca8[_0x46f4('0x39')];if(!_0x6531c1[_0x46f4('0x3a')][_0x46f4('0x62')](_0x46f4('0x63'))){_0x2df7dc[_0x46f4('0x1f')]=qs['limit'](_0x6531c1['query'][_0x46f4('0x1f')]);_0x2df7dc[_0x46f4('0x1e')]=qs[_0x46f4('0x1e')](_0x6531c1[_0x46f4('0x3a')][_0x46f4('0x1e')]);}_0x2df7dc['order']=qs[_0x46f4('0x3f')](_0x6531c1[_0x46f4('0x3a')][_0x46f4('0x3f')]);_0x2df7dc['where']=qs[_0x46f4('0x3b')](_['pick'](_0x6531c1['query'],_0x2f7ca8[_0x46f4('0x3b')]));_0x2df7dc[_0x46f4('0x40')][_0x46f4('0x64')]=_0x181690['id'];if(_0x6531c1[_0x46f4('0x3a')]['filter']){_0x2df7dc[_0x46f4('0x40')]=_[_0x46f4('0x42')](_0x2df7dc[_0x46f4('0x40')],{'$or':_[_0x46f4('0x36')](_0x2df7dc[_0x46f4('0x3c')],function(_0x577c48){var _0xa1d6bf={};_0xa1d6bf[_0x577c48]={'$like':'%'+_0x6531c1[_0x46f4('0x3a')][_0x46f4('0x44')]+'%'};return _0xa1d6bf;})});}_0x2df7dc=_['merge']({},_0x2df7dc,_0x6531c1[_0x46f4('0x45')]);return db[_0x46f4('0x68')]['count']({'where':_0x2df7dc[_0x46f4('0x40')]})[_0x46f4('0x29')](function(_0x121201){_0x2acb74['count']=_0x121201;if(_0x6531c1[_0x46f4('0x3a')][_0x46f4('0x46')]){_0x2df7dc['include']=[{'all':!![]}];}return db[_0x46f4('0x68')][_0x46f4('0x48')](_0x2df7dc);})['then'](function(_0x3304d0){_0x2acb74[_0x46f4('0x66')]=_0x3304d0;return _0x2acb74;});}})[_0x46f4('0x29')](respondWithFilteredResult(_0x42a2be,_0x2df7dc))[_0x46f4('0x49')](handleError(_0x42a2be,null));};exports[_0x46f4('0x69')]=function(_0xfbb58a,_0x10ba2e,_0x206b66){var _0x254cce={'raw':!![],'where':{}};var _0x4121f4={};var _0x150ace={'count':0x0,'rows':[]};return db[_0x46f4('0x37')][_0x46f4('0x61')]({'where':{'id':_0xfbb58a['params']['id']}})[_0x46f4('0x29')](handleEntityNotFound(_0x10ba2e,null))['then'](function(_0x317f12){if(_0x317f12){_0x4121f4[_0x46f4('0x39')]=_['keys'](db['CmHopperFinal'][_0x46f4('0x4d')]);_0x4121f4[_0x46f4('0x3a')]=_[_0x46f4('0x4c')](_0xfbb58a[_0x46f4('0x3a')]);_0x4121f4[_0x46f4('0x3b')]=_[_0x46f4('0x4e')](_0x4121f4[_0x46f4('0x39')],_0x4121f4[_0x46f4('0x3a')]);_0x254cce[_0x46f4('0x3c')]=_[_0x46f4('0x4e')](_0x4121f4['model'],qs['fields'](_0xfbb58a['query'][_0x46f4('0x3d')]));_0x254cce[_0x46f4('0x3c')]=_0x254cce[_0x46f4('0x3c')]['length']?_0x254cce['attributes']:_0x4121f4[_0x46f4('0x39')];if(!_0xfbb58a['query'][_0x46f4('0x62')](_0x46f4('0x63'))){_0x254cce[_0x46f4('0x1f')]=qs[_0x46f4('0x1f')](_0xfbb58a[_0x46f4('0x3a')][_0x46f4('0x1f')]);_0x254cce[_0x46f4('0x1e')]=qs['offset'](_0xfbb58a[_0x46f4('0x3a')]['offset']);}_0x254cce[_0x46f4('0x3e')]=qs[_0x46f4('0x3f')](_0xfbb58a['query'][_0x46f4('0x3f')]);_0x254cce['where']=qs[_0x46f4('0x3b')](_['pick'](_0xfbb58a[_0x46f4('0x3a')],_0x4121f4[_0x46f4('0x3b')]));_0x254cce[_0x46f4('0x40')][_0x46f4('0x64')]=_0x317f12['id'];if(_0xfbb58a[_0x46f4('0x3a')]['filter']){_0x254cce['where']=_[_0x46f4('0x42')](_0x254cce[_0x46f4('0x40')],{'$or':_[_0x46f4('0x36')](_0x254cce[_0x46f4('0x3c')],function(_0x3eb2be){var _0x2b7cb8={};_0x2b7cb8[_0x3eb2be]={'$like':'%'+_0xfbb58a[_0x46f4('0x3a')][_0x46f4('0x44')]+'%'};return _0x2b7cb8;})});}_0x254cce=_['merge']({},_0x254cce,_0xfbb58a['options']);return db[_0x46f4('0x6a')]['count']({'where':_0x254cce[_0x46f4('0x40')]})[_0x46f4('0x29')](function(_0x13fc61){_0x150ace[_0x46f4('0x21')]=_0x13fc61;if(_0xfbb58a['query'][_0x46f4('0x46')]){_0x254cce[_0x46f4('0x47')]=[{'all':!![]}];}return db[_0x46f4('0x6a')][_0x46f4('0x48')](_0x254cce);})['then'](function(_0x467f35){_0x150ace[_0x46f4('0x66')]=_0x467f35;return _0x150ace;});}})[_0x46f4('0x29')](respondWithFilteredResult(_0x10ba2e,_0x254cce))['catch'](handleError(_0x10ba2e,null));};exports[_0x46f4('0x6b')]=function(_0x19e222,_0x400784,_0x26a2fd){var _0x14e48c={'raw':!![],'where':{}};var _0x1d7c36={};var _0x338cad={'count':0x0,'rows':[]};return db[_0x46f4('0x37')][_0x46f4('0x61')]({'where':{'id':_0x19e222[_0x46f4('0x4b')]['id']}})[_0x46f4('0x29')](handleEntityNotFound(_0x400784,null))[_0x46f4('0x29')](function(_0x44d9ee){if(_0x44d9ee){_0x1d7c36[_0x46f4('0x39')]=_[_0x46f4('0x4c')](db[_0x46f4('0x6c')][_0x46f4('0x4d')]);_0x1d7c36['query']=_[_0x46f4('0x4c')](_0x19e222[_0x46f4('0x3a')]);_0x1d7c36['filters']=_[_0x46f4('0x4e')](_0x1d7c36[_0x46f4('0x39')],_0x1d7c36[_0x46f4('0x3a')]);_0x14e48c[_0x46f4('0x3c')]=_[_0x46f4('0x4e')](_0x1d7c36[_0x46f4('0x39')],qs[_0x46f4('0x3d')](_0x19e222[_0x46f4('0x3a')][_0x46f4('0x3d')]));_0x14e48c[_0x46f4('0x3c')]=_0x14e48c[_0x46f4('0x3c')][_0x46f4('0x4f')]?_0x14e48c[_0x46f4('0x3c')]:_0x1d7c36[_0x46f4('0x39')];if(!_0x19e222[_0x46f4('0x3a')][_0x46f4('0x62')](_0x46f4('0x63'))){_0x14e48c[_0x46f4('0x1f')]=qs['limit'](_0x19e222[_0x46f4('0x3a')][_0x46f4('0x1f')]);_0x14e48c[_0x46f4('0x1e')]=qs[_0x46f4('0x1e')](_0x19e222[_0x46f4('0x3a')][_0x46f4('0x1e')]);}_0x14e48c[_0x46f4('0x3e')]=qs[_0x46f4('0x3f')](_0x19e222['query'][_0x46f4('0x3f')]);_0x14e48c[_0x46f4('0x40')]=qs[_0x46f4('0x3b')](_[_0x46f4('0x41')](_0x19e222[_0x46f4('0x3a')],_0x1d7c36[_0x46f4('0x3b')]));_0x14e48c[_0x46f4('0x40')][_0x46f4('0x64')]=_0x44d9ee['id'];if(_0x19e222[_0x46f4('0x3a')][_0x46f4('0x44')]){_0x14e48c[_0x46f4('0x40')]=_[_0x46f4('0x42')](_0x14e48c[_0x46f4('0x40')],{'$or':_[_0x46f4('0x36')](_0x14e48c[_0x46f4('0x3c')],function(_0x56722e){var _0x2c16a8={};_0x2c16a8[_0x56722e]={'$like':'%'+_0x19e222['query'][_0x46f4('0x44')]+'%'};return _0x2c16a8;})});}_0x14e48c=_[_0x46f4('0x42')]({},_0x14e48c,_0x19e222[_0x46f4('0x45')]);return db[_0x46f4('0x6c')][_0x46f4('0x21')]({'where':_0x14e48c[_0x46f4('0x40')]})[_0x46f4('0x29')](function(_0x386ebf){_0x338cad[_0x46f4('0x21')]=_0x386ebf;if(_0x19e222[_0x46f4('0x3a')][_0x46f4('0x46')]){_0x14e48c[_0x46f4('0x47')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x46f4('0x48')](_0x14e48c);})[_0x46f4('0x29')](function(_0x372d89){_0x338cad[_0x46f4('0x66')]=_0x372d89;return _0x338cad;});}})[_0x46f4('0x29')](respondWithFilteredResult(_0x400784,_0x14e48c))['catch'](handleError(_0x400784,null));};exports['getTeams']=function(_0x1268d9,_0x296541,_0x1654b6){var _0x14963e={};var _0x38d63b={};var _0x3584a6;var _0x2eaf43;return db[_0x46f4('0x37')][_0x46f4('0x61')]({'where':{'id':_0x1268d9[_0x46f4('0x4b')]['id']}})[_0x46f4('0x29')](handleEntityNotFound(_0x296541,null))[_0x46f4('0x29')](function(_0x37270e){if(_0x37270e){_0x3584a6=_0x37270e;_0x38d63b[_0x46f4('0x39')]=_[_0x46f4('0x4c')](db[_0x46f4('0x6d')]['rawAttributes']);_0x38d63b[_0x46f4('0x3a')]=_[_0x46f4('0x4c')](_0x1268d9['query']);_0x38d63b[_0x46f4('0x3b')]=_[_0x46f4('0x4e')](_0x38d63b[_0x46f4('0x39')],_0x38d63b[_0x46f4('0x3a')]);_0x14963e[_0x46f4('0x3c')]=_[_0x46f4('0x4e')](_0x38d63b[_0x46f4('0x39')],qs[_0x46f4('0x3d')](_0x1268d9[_0x46f4('0x3a')][_0x46f4('0x3d')]));_0x14963e[_0x46f4('0x3c')]=_0x14963e[_0x46f4('0x3c')][_0x46f4('0x4f')]?_0x14963e[_0x46f4('0x3c')]:_0x38d63b[_0x46f4('0x39')];_0x14963e[_0x46f4('0x3e')]=qs['sort'](_0x1268d9['query']['sort']);_0x14963e[_0x46f4('0x40')]=qs[_0x46f4('0x3b')](_[_0x46f4('0x41')](_0x1268d9[_0x46f4('0x3a')],_0x38d63b[_0x46f4('0x3b')]));if(_0x1268d9[_0x46f4('0x3a')][_0x46f4('0x44')]){_0x14963e[_0x46f4('0x40')]=_[_0x46f4('0x42')](_0x14963e['where'],{'$or':_[_0x46f4('0x36')](_0x14963e['attributes'],function(_0x48cf8d){var _0x7c4d6f={};_0x7c4d6f[_0x48cf8d]={'$like':'%'+_0x1268d9[_0x46f4('0x3a')]['filter']+'%'};return _0x7c4d6f;})});}_0x14963e=_[_0x46f4('0x42')]({},_0x14963e,_0x1268d9['options']);return _0x3584a6[_0x46f4('0x6e')](_0x14963e);}})[_0x46f4('0x29')](function(_0x1e3cd4){if(_0x1e3cd4){_0x2eaf43=_0x1e3cd4[_0x46f4('0x4f')];if(!_0x1268d9['query'][_0x46f4('0x62')](_0x46f4('0x63'))){_0x14963e[_0x46f4('0x1f')]=qs['limit'](_0x1268d9[_0x46f4('0x3a')]['limit']);_0x14963e[_0x46f4('0x1e')]=qs[_0x46f4('0x1e')](_0x1268d9['query'][_0x46f4('0x1e')]);}return _0x3584a6[_0x46f4('0x6e')](_0x14963e);}})[_0x46f4('0x29')](function(_0x2df23e){if(_0x2df23e){return _0x2df23e?{'count':_0x2eaf43,'rows':_0x2df23e}:null;}})[_0x46f4('0x29')](respondWithResult(_0x296541,null))[_0x46f4('0x49')](handleError(_0x296541,null));};exports['addTeams']=function(_0xd469df,_0x2398db,_0x1f8fa8){var _0x281cce=_0xd469df[_0x46f4('0x51')][_0x46f4('0x6f')];var _0x1dcf1b=_[_0x46f4('0x36')](_0x281cce,'id');return db[_0x46f4('0x6d')][_0x46f4('0x48')]({'where':{'id':_0x1dcf1b},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id','name','online','voicePause','interface'],'raw':!![]}]})['then'](function(_0x2fe2d2){if(_0x2fe2d2){var _0x328f55=_[_0x46f4('0x70')](_0x2fe2d2,function(_0x5df687){var _0x336d74=_0x5df687['get']({'plain':!![]});_0x336d74[_0x46f4('0x71')]['forEach'](function(_0x3f7812){_0x3f7812[_0x46f4('0x72')]=_[_0x46f4('0x50')](_0x281cce,{'id':_0x336d74['id']})[_0x46f4('0x72')];});return _0x336d74[_0x46f4('0x71')];});return db[_0x46f4('0x37')][_0x46f4('0x50')]({'where':{'id':_0xd469df[_0x46f4('0x4b')]['id']}})[_0x46f4('0x29')](function(_0x2b4870){return db['sequelize'][_0x46f4('0x73')](function(_0x3d9492){return _0x2b4870['addTeams'](_0x1dcf1b,{'transaction':_0x3d9492})[_0x46f4('0x29')](function(){return BPromise['each'](_0x281cce,function(_0x4c0c59){return db[_0x46f4('0x74')][_0x46f4('0x75')]({'TeamId':_0x4c0c59['id'],'VoiceQueueId':_0xd469df[_0x46f4('0x4b')]['id'],'penalty':_0x4c0c59[_0x46f4('0x72')]},{'transaction':_0x3d9492});});})['then'](function(){return BPromise[_0x46f4('0x76')](_0x328f55,function(_0x2df6bf){return db['UserVoiceQueue']['findOrCreate']({'where':{'UserId':_0x2df6bf['id'],'VoiceQueueId':_0xd469df[_0x46f4('0x4b')]['id']},'defaults':{'penalty':_0x2df6bf[_0x46f4('0x72')]},'transaction':_0x3d9492});});})[_0x46f4('0x29')](function(){return BPromise[_0x46f4('0x76')](_[_0x46f4('0x44')](_0x328f55,{'online':!![]}),function(_0x426e10){return db[_0x46f4('0x77')][_0x46f4('0x75')]({'membername':_0x426e10[_0x46f4('0x32')],'UserId':_0x426e10['id'],'queue_name':_0x2b4870[_0x46f4('0x32')],'VoiceQueueId':_0x2b4870['id'],'interface':_[_0x46f4('0x78')](_0x426e10['interface'])?util[_0x46f4('0x79')](_0x46f4('0x7a'),_0x426e10[_0x46f4('0x32')]):_0x426e10['interface'],'paused':_0x426e10[_0x46f4('0x7b')]||![],'penalty':_0x426e10[_0x46f4('0x72')]},{'transaction':_0x3d9492});});})[_0x46f4('0x29')](function(){_0x328f55['forEach'](function(_0x5c8e84){socket[_0x46f4('0x7c')](_0x46f4('0x7d'),{'UserId':_0x5c8e84['id'],'VoiceQueueId':_0x2b4870['id']});});});});});}})[_0x46f4('0x29')](respondWithStatusCode(_0x2398db,null))[_0x46f4('0x49')](handleError(_0x2398db,null));};exports['removeTeams']=function(_0x5d9065,_0x4089d2,_0xa3380c){return db[_0x46f4('0x6d')][_0x46f4('0x48')]({'where':{'id':_0x5d9065[_0x46f4('0x3a')][_0x46f4('0x7e')]},'attributes':['id'],'include':[{'model':db[_0x46f4('0x7f')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4089d2,null))['then'](function(_0x41dbdc){var _0x5a17d5=_[_0x46f4('0x36')](_0x41dbdc,'id');var _0x5a9a7e=[];var _0x433243=[];var _0x12f8dd=squel[_0x46f4('0x80')]();_0x12f8dd[_0x46f4('0x81')](_0x46f4('0x82'))[_0x46f4('0x83')](_0x46f4('0x84'),'tq')['join'](_0x46f4('0x85'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('VoiceQueueId\x20=\x20?',_0x5d9065[_0x46f4('0x4b')]['id']);for(var _0x35b61b=0x0;_0x35b61b<_0x41dbdc['length'];_0x35b61b+=0x1){let _0x162d8f=_0x41dbdc[_0x35b61b];for(var _0x153597=0x0;_0x153597<_0x162d8f[_0x46f4('0x71')][_0x46f4('0x4f')];_0x153597+=0x1){let _0xd5909b=_0x162d8f[_0x46f4('0x71')][_0x153597];var _0x4a633a=_0x12f8dd['clone']();_0x4a633a[_0x46f4('0x40')](_0x46f4('0x86'),_0xd5909b['id']);_0x433243['push'](db[_0x46f4('0x87')][_0x46f4('0x3a')](_0x4a633a['toString'](),{'type':db[_0x46f4('0x87')]['QueryTypes']['SELECT']})[_0x46f4('0x29')](function(_0x2681ba){if(_0x2681ba['length']===0x1){return _0xd5909b['id'];}else{var _0x3dea0a=_['every'](_[_0x46f4('0x36')](_0x2681ba,'TeamId'),function(_0x528463){return _[_0x46f4('0x30')](_0x5a17d5,_0x528463);});if(_0x3dea0a){return _0xd5909b['id'];}}}));}}return BPromise['all'](_0x433243)['then'](function(_0x3291f5){_0x5a9a7e=_(_0x5a9a7e)[_0x46f4('0x88')](_0x3291f5)[_0x46f4('0x89')]()[_0x46f4('0x2f')]();return db['VoiceQueue']['find']({'where':{'id':_0x5d9065[_0x46f4('0x4b')]['id']}})[_0x46f4('0x29')](function(_0x3b7786){return db[_0x46f4('0x87')][_0x46f4('0x73')](function(_0x2640af){return _0x3b7786[_0x46f4('0x8a')](_0x5d9065['query'][_0x46f4('0x7e')],{'transaction':_0x2640af})[_0x46f4('0x29')](function(){if(!_[_0x46f4('0x8b')](_0x5a9a7e)){return _0x3b7786[_0x46f4('0x8c')](_0x5a9a7e,{'transaction':_0x2640af})[_0x46f4('0x29')](function(){return db[_0x46f4('0x77')][_0x46f4('0x2a')]({'where':{'VoiceQueueId':_0x5d9065[_0x46f4('0x4b')]['id'],'UserId':_0x5a9a7e},'transaction':_0x2640af});});}})[_0x46f4('0x29')](function(){_0x5a9a7e['forEach'](function(_0x139c6e){socket[_0x46f4('0x7c')](_0x46f4('0x8d'),{'UserId':_0x139c6e,'VoiceQueueId':_0x3b7786['id']});});});});});});})[_0x46f4('0x29')](respondWithStatusCode(_0x4089d2,null))[_0x46f4('0x49')](handleError(_0x4089d2,null));};exports[_0x46f4('0x8e')]=function(_0x3b58e2,_0x340223,_0xc44bc2){var _0x16d319,_0x8d0cca;return db[_0x46f4('0x37')][_0x46f4('0x50')]({'where':{'id':_0x3b58e2[_0x46f4('0x4b')]['id']}})[_0x46f4('0x29')](handleEntityNotFound(_0x340223,null))['then'](function(_0x497f8c){if(_0x497f8c){_0x8d0cca=_0x497f8c;return _0x497f8c[_0x46f4('0x8e')](_0x3b58e2['body'][_0x46f4('0x7e')],_['omit'](_0x3b58e2[_0x46f4('0x51')],[_0x46f4('0x7e'),'id'])||{})['spread'](function(_0x511c4b){for(var _0x339959=0x0;_0x339959<_0x3b58e2[_0x46f4('0x51')][_0x46f4('0x7e')][_0x46f4('0x4f')];_0x339959+=0x1){socket[_0x46f4('0x7c')](_0x46f4('0x7d'),{'UserId':Number(_0x3b58e2['body'][_0x46f4('0x7e')][_0x339959]),'VoiceQueueId':Number(_0x3b58e2[_0x46f4('0x4b')]['id'])});}return _0x511c4b;});}})[_0x46f4('0x29')](function(_0x31550a){_0x16d319=_0x31550a||[];if(_0x8d0cca){return db[_0x46f4('0x7f')]['findAll']({'where':{'id':_0x3b58e2[_0x46f4('0x51')][_0x46f4('0x7e')]},'attributes':['id',_0x46f4('0x32'),'online',_0x46f4('0x7b'),_0x46f4('0x8f')],'raw':!![]});}})[_0x46f4('0x29')](function(_0x37c458){if(!_['isEmpty'](_0x37c458)){var _0x444a7c=[];for(var _0x357c85=0x0;_0x357c85<_0x37c458[_0x46f4('0x4f')];_0x357c85++){if(_0x37c458[_0x357c85][_0x46f4('0x90')]){_0x444a7c[_0x46f4('0x91')](db[_0x46f4('0x77')]['upsert']({'membername':_0x37c458[_0x357c85][_0x46f4('0x32')],'UserId':_0x37c458[_0x357c85]['id'],'queue_name':_0x8d0cca[_0x46f4('0x32')],'VoiceQueueId':_0x8d0cca['id'],'interface':_['isNil'](_0x37c458[_0x357c85]['interface'])?util[_0x46f4('0x79')](_0x46f4('0x7a'),_0x37c458[_0x357c85][_0x46f4('0x32')]):_0x37c458[_0x357c85]['interface'],'paused':_0x37c458[_0x357c85]['voicePause']||![],'penalty':_0x3b58e2[_0x46f4('0x51')][_0x46f4('0x72')]||0x0}));}}return BPromise[_0x46f4('0x92')](_0x444a7c);}})[_0x46f4('0x29')](function(){return _0x16d319;})[_0x46f4('0x29')](respondWithResult(_0x340223,null))[_0x46f4('0x49')](handleError(_0x340223,null));};exports[_0x46f4('0x8c')]=function(_0x45a7d1,_0x3a8e48,_0x1340e0){return db[_0x46f4('0x37')][_0x46f4('0x50')]({'where':{'id':_0x45a7d1[_0x46f4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3a8e48,null))['then'](function(_0x4328f9){if(_0x4328f9){return _0x4328f9[_0x46f4('0x8c')](_0x45a7d1[_0x46f4('0x3a')][_0x46f4('0x7e')])[_0x46f4('0x29')](function(){if(_[_0x46f4('0x93')](_0x45a7d1[_0x46f4('0x3a')][_0x46f4('0x7e')])){for(var _0xfd104d=0x0;_0xfd104d<_0x45a7d1[_0x46f4('0x3a')][_0x46f4('0x7e')][_0x46f4('0x4f')];_0xfd104d+=0x1){socket[_0x46f4('0x7c')](_0x46f4('0x8d'),{'UserId':Number(_0x45a7d1[_0x46f4('0x3a')][_0x46f4('0x7e')][_0xfd104d]),'VoiceQueueId':Number(_0x45a7d1['params']['id'])});}}else{socket[_0x46f4('0x7c')](_0x46f4('0x8d'),{'UserId':Number(_0x45a7d1[_0x46f4('0x3a')][_0x46f4('0x7e')]),'VoiceQueueId':Number(_0x45a7d1[_0x46f4('0x4b')]['id'])});}});}})[_0x46f4('0x29')](function(_0x122d95){return db[_0x46f4('0x77')][_0x46f4('0x2a')]({'where':{'VoiceQueueId':_0x45a7d1[_0x46f4('0x4b')]['id'],'UserId':_0x45a7d1['query'][_0x46f4('0x7e')]}})[_0x46f4('0x29')](function(){return _0x122d95;});})[_0x46f4('0x29')](respondWithStatusCode(_0x3a8e48,null))[_0x46f4('0x49')](handleError(_0x3a8e48,null));};exports[_0x46f4('0x94')]=function(_0x5e6b3e,_0x4d9644,_0x92aab6){var _0x247eca={};var _0x232b9c={};var _0x412342;var _0x22dfab;return db[_0x46f4('0x37')][_0x46f4('0x61')]({'where':{'id':_0x5e6b3e[_0x46f4('0x4b')]['id']}})[_0x46f4('0x29')](handleEntityNotFound(_0x4d9644,null))['then'](function(_0x87514c){if(_0x87514c){_0x412342=_0x87514c;_0x232b9c[_0x46f4('0x39')]=_[_0x46f4('0x4c')](db['User'][_0x46f4('0x4d')]);_0x232b9c['query']=_['keys'](_0x5e6b3e['query']);_0x232b9c[_0x46f4('0x3b')]=_[_0x46f4('0x4e')](_0x232b9c[_0x46f4('0x39')],_0x232b9c['query']);_0x247eca[_0x46f4('0x3c')]=_[_0x46f4('0x4e')](_0x232b9c[_0x46f4('0x39')],qs[_0x46f4('0x3d')](_0x5e6b3e['query'][_0x46f4('0x3d')]));_0x247eca['attributes']=_0x247eca[_0x46f4('0x3c')][_0x46f4('0x4f')]?_0x247eca['attributes']:_0x232b9c['model'];_0x247eca[_0x46f4('0x3e')]=qs[_0x46f4('0x3f')](_0x5e6b3e[_0x46f4('0x3a')]['sort']);_0x247eca['where']=qs[_0x46f4('0x3b')](_[_0x46f4('0x41')](_0x5e6b3e['query'],_0x232b9c['filters']));if(_0x5e6b3e['query'][_0x46f4('0x44')]){_0x247eca[_0x46f4('0x40')]=_[_0x46f4('0x42')](_0x247eca[_0x46f4('0x40')],{'$or':_[_0x46f4('0x36')](_0x247eca['attributes'],function(_0x51cadf){var _0x5b5074={};_0x5b5074[_0x51cadf]={'$like':'%'+_0x5e6b3e['query'][_0x46f4('0x44')]+'%'};return _0x5b5074;})});}_0x247eca=_[_0x46f4('0x42')]({},_0x247eca,_0x5e6b3e[_0x46f4('0x45')]);return _0x412342[_0x46f4('0x94')](_0x247eca);}})[_0x46f4('0x29')](function(_0x271ae6){if(_0x271ae6){_0x22dfab=_0x271ae6['length'];if(!_0x5e6b3e[_0x46f4('0x3a')][_0x46f4('0x62')](_0x46f4('0x63'))){_0x247eca[_0x46f4('0x1f')]=qs[_0x46f4('0x1f')](_0x5e6b3e[_0x46f4('0x3a')]['limit']);_0x247eca[_0x46f4('0x1e')]=qs[_0x46f4('0x1e')](_0x5e6b3e[_0x46f4('0x3a')][_0x46f4('0x1e')]);}return _0x412342[_0x46f4('0x94')](_0x247eca);}})['then'](function(_0x2a6c74){if(_0x2a6c74){return _0x2a6c74?{'count':_0x22dfab,'rows':_0x2a6c74}:null;}})[_0x46f4('0x29')](respondWithResult(_0x4d9644,null))[_0x46f4('0x49')](handleError(_0x4d9644,null));};exports['getMembers']=function(_0x953370,_0x3c9d0e,_0x266c00){var _0x500634={};var _0x1bb92c={};var _0x41817b;var _0x1238c5;return db[_0x46f4('0x37')]['findOne']({'where':{'id':_0x953370[_0x46f4('0x4b')]['id']}})[_0x46f4('0x29')](handleEntityNotFound(_0x3c9d0e,null))[_0x46f4('0x29')](function(_0x27951c){if(_0x27951c){_0x41817b=_0x27951c;_0x1bb92c['model']=_['keys'](db[_0x46f4('0x77')]['rawAttributes']);_0x1bb92c[_0x46f4('0x3a')]=_[_0x46f4('0x4c')](_0x953370[_0x46f4('0x3a')]);_0x1bb92c[_0x46f4('0x3b')]=_[_0x46f4('0x4e')](_0x1bb92c['model'],_0x1bb92c[_0x46f4('0x3a')]);_0x500634[_0x46f4('0x3c')]=_['intersection'](_0x1bb92c[_0x46f4('0x39')],qs['fields'](_0x953370[_0x46f4('0x3a')]['fields']));_0x500634['attributes']=_0x500634[_0x46f4('0x3c')][_0x46f4('0x4f')]?_0x500634[_0x46f4('0x3c')]:_0x1bb92c[_0x46f4('0x39')];_0x500634['order']=qs[_0x46f4('0x3f')](_0x953370['query']['sort']);_0x500634['where']=qs['filters'](_[_0x46f4('0x41')](_0x953370[_0x46f4('0x3a')],_0x1bb92c['filters']));if(_0x953370[_0x46f4('0x3a')][_0x46f4('0x44')]){_0x500634['where']=_[_0x46f4('0x42')](_0x500634['where'],{'$or':_[_0x46f4('0x36')](_0x500634[_0x46f4('0x3c')],function(_0x3cf592){var _0x548fdb={};_0x548fdb[_0x3cf592]={'$like':'%'+_0x953370['query'][_0x46f4('0x44')]+'%'};return _0x548fdb;})});}_0x500634=_[_0x46f4('0x42')]({},_0x500634,_0x953370[_0x46f4('0x45')]);return _0x41817b[_0x46f4('0x95')](_0x500634);}})[_0x46f4('0x29')](function(_0x2481ed){if(_0x2481ed){_0x1238c5=_0x2481ed[_0x46f4('0x4f')];if(!_0x953370[_0x46f4('0x3a')][_0x46f4('0x62')](_0x46f4('0x63'))){_0x500634[_0x46f4('0x1f')]=qs['limit'](_0x953370['query'][_0x46f4('0x1f')]);_0x500634[_0x46f4('0x1e')]=qs[_0x46f4('0x1e')](_0x953370['query'][_0x46f4('0x1e')]);}return _0x41817b[_0x46f4('0x95')](_0x500634);}})['then'](function(_0x3cafa6){return _0x3cafa6?{'count':_0x1238c5,'rows':_0x3cafa6}:null;})['then'](respondWithResult(_0x3c9d0e,null))['catch'](handleError(_0x3c9d0e,null));};exports['getLists']=function(_0x321026,_0x2c273a,_0x242f56){var _0x7ba995={};var _0x1dbfdf={};var _0x5dd4bc;var _0xae878e;return db[_0x46f4('0x37')][_0x46f4('0x61')]({'where':{'id':_0x321026[_0x46f4('0x4b')]['id']}})[_0x46f4('0x29')](handleEntityNotFound(_0x2c273a,null))['then'](function(_0x527f57){if(_0x527f57){_0x5dd4bc=_0x527f57;_0x1dbfdf[_0x46f4('0x39')]=_[_0x46f4('0x4c')](db['CmList']['rawAttributes']);_0x1dbfdf[_0x46f4('0x3a')]=_['keys'](_0x321026[_0x46f4('0x3a')]);_0x1dbfdf['filters']=_[_0x46f4('0x4e')](_0x1dbfdf[_0x46f4('0x39')],_0x1dbfdf[_0x46f4('0x3a')]);_0x7ba995[_0x46f4('0x3c')]=_[_0x46f4('0x4e')](_0x1dbfdf[_0x46f4('0x39')],qs['fields'](_0x321026[_0x46f4('0x3a')]['fields']));_0x7ba995[_0x46f4('0x3c')]=_0x7ba995[_0x46f4('0x3c')][_0x46f4('0x4f')]?_0x7ba995[_0x46f4('0x3c')]:_0x1dbfdf['model'];_0x7ba995[_0x46f4('0x3e')]=qs[_0x46f4('0x3f')](_0x321026[_0x46f4('0x3a')][_0x46f4('0x3f')]);_0x7ba995[_0x46f4('0x40')]=qs[_0x46f4('0x3b')](_['pick'](_0x321026[_0x46f4('0x3a')],_0x1dbfdf['filters']));if(_0x321026[_0x46f4('0x3a')][_0x46f4('0x44')]){_0x7ba995[_0x46f4('0x40')]=_[_0x46f4('0x42')](_0x7ba995[_0x46f4('0x40')],{'$or':_[_0x46f4('0x36')](_0x7ba995['attributes'],function(_0x339ed6){var _0x481f74={};_0x481f74[_0x339ed6]={'$like':'%'+_0x321026['query'][_0x46f4('0x44')]+'%'};return _0x481f74;})});}_0x7ba995=_[_0x46f4('0x42')]({},_0x7ba995,_0x321026[_0x46f4('0x45')]);return _0x5dd4bc[_0x46f4('0x96')](_0x7ba995);}})['then'](function(_0x498419){if(_0x498419){_0xae878e=_0x498419[_0x46f4('0x4f')];if(!_0x321026[_0x46f4('0x3a')][_0x46f4('0x62')]('nolimit')){_0x7ba995[_0x46f4('0x1f')]=qs[_0x46f4('0x1f')](_0x321026[_0x46f4('0x3a')]['limit']);_0x7ba995[_0x46f4('0x1e')]=qs[_0x46f4('0x1e')](_0x321026[_0x46f4('0x3a')][_0x46f4('0x1e')]);}return _0x5dd4bc[_0x46f4('0x96')](_0x7ba995);}})[_0x46f4('0x29')](function(_0x2b7c2e){if(_0x2b7c2e){return _0x2b7c2e?{'count':_0xae878e,'rows':_0x2b7c2e}:null;}})[_0x46f4('0x29')](respondWithResult(_0x2c273a,null))['catch'](handleError(_0x2c273a,null));};exports['addLists']=function(_0x8799e8,_0x3fadcb,_0x5eb13f){var _0x411936=moment()[_0x46f4('0x79')](_0x46f4('0x97'));var _0x4ca171,_0x5b2d1f;return db[_0x46f4('0x37')][_0x46f4('0x50')]({'where':{'id':_0x8799e8[_0x46f4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3fadcb,null))[_0x46f4('0x29')](function(_0x1b9a2f){if(_0x1b9a2f){_0x5b2d1f=_0x1b9a2f;return _0x1b9a2f[_0x46f4('0x98')](_0x8799e8['body'][_0x46f4('0x7e')],_[_0x46f4('0x5d')](_0x8799e8[_0x46f4('0x51')],[_0x46f4('0x7e'),'id'])||{});}return null;})['spread'](function(_0x217b1e){var _0x141d0b;_0x4ca171=_0x217b1e||[];var _0x15f13c=[];if(_0x217b1e){for(var _0x2f6599=0x0;_0x2f6599<_0x217b1e[_0x46f4('0x4f')];_0x2f6599+=0x1){var _0x3673ca=_0x217b1e[_0x2f6599][_0x46f4('0x2b')]({'plain':!![]});_0x5b2d1f[_0x46f4('0x99')]=_0x8799e8[_0x46f4('0x51')][_0x46f4('0x99')]?_0x8799e8[_0x46f4('0x51')][_0x46f4('0x99')]:_0x5b2d1f[_0x46f4('0x99')];switch(_0x5b2d1f[_0x46f4('0x99')]){case _0x46f4('0x9a'):_0x141d0b=squel['insert']()[_0x46f4('0x9b')](_0x46f4('0x9c'))[_0x46f4('0x9d')]([_0x46f4('0x9e'),_0x46f4('0x9f'),'ContactId',_0x46f4('0xa0'),_0x46f4('0x64'),'createdAt','updatedAt'],squel[_0x46f4('0x80')]()['field']('phone',_0x46f4('0x9e'))[_0x46f4('0x81')]('\x27'+_0x411936+'\x27',_0x46f4('0x9f'))[_0x46f4('0x81')]('id',_0x46f4('0xa1'))[_0x46f4('0x81')](_0x3673ca[_0x46f4('0xa2')][_0x46f4('0xa3')](),_0x46f4('0xa0'))[_0x46f4('0x81')](_0x8799e8[_0x46f4('0x4b')]['id']['toString'](),_0x46f4('0x64'))[_0x46f4('0x81')]('\x27'+_0x411936+'\x27',_0x46f4('0x5e'))[_0x46f4('0x81')]('\x27'+_0x411936+'\x27',_0x46f4('0x5f'))['from']('cm_contacts')[_0x46f4('0x40')]('deletedAt\x20IS\x20NULL')[_0x46f4('0x40')]('ListId\x20=\x20?',_0x3673ca['CmListId'][_0x46f4('0xa3')]())[_0x46f4('0x40')](_0x46f4('0xa4'))[_0x46f4('0x40')](_0x46f4('0xa5'),squel[_0x46f4('0x80')]()[_0x46f4('0x81')](_0x46f4('0xa6'))['from'](_0x46f4('0xa7'))['where'](_0x46f4('0xa8'),_0x8799e8['params']['id'][_0x46f4('0xa3')]()))['where'](_0x46f4('0xa5'),squel['select']()[_0x46f4('0x81')](_0x46f4('0xa9'))[_0x46f4('0x83')](_0x46f4('0x9c'))['where'](_0x46f4('0xa8'),_0x8799e8[_0x46f4('0x4b')]['id']['toString']())))[_0x46f4('0xa3')]();break;case'onlyIfOpen':_0x141d0b=squel['insert']()[_0x46f4('0x9b')](_0x46f4('0x9c'))[_0x46f4('0x9d')]([_0x46f4('0x9e'),'scheduledAt','ContactId',_0x46f4('0xa0'),_0x46f4('0x64'),'createdAt',_0x46f4('0x5f')],squel[_0x46f4('0x80')]()[_0x46f4('0x81')](_0x46f4('0x9e'),_0x46f4('0x9e'))['field']('\x27'+_0x411936+'\x27',_0x46f4('0x9f'))[_0x46f4('0x81')]('id',_0x46f4('0xa1'))[_0x46f4('0x81')](_0x3673ca[_0x46f4('0xa2')][_0x46f4('0xa3')](),_0x46f4('0xa0'))[_0x46f4('0x81')](_0x8799e8[_0x46f4('0x4b')]['id']['toString'](),'VoiceQueueId')[_0x46f4('0x81')]('\x27'+_0x411936+'\x27',_0x46f4('0x5e'))[_0x46f4('0x81')]('\x27'+_0x411936+'\x27','updatedAt')[_0x46f4('0x83')](_0x46f4('0xaa'))[_0x46f4('0x40')]('deletedAt\x20IS\x20NULL')[_0x46f4('0x40')](_0x46f4('0xab'),_0x3673ca[_0x46f4('0xa2')][_0x46f4('0xa3')]())[_0x46f4('0x40')](_0x46f4('0xa4'))[_0x46f4('0x40')](_0x46f4('0xa5'),squel[_0x46f4('0x80')]()['field'](_0x46f4('0xa9'))[_0x46f4('0x83')](_0x46f4('0x9c'))[_0x46f4('0x40')](_0x46f4('0xa8'),_0x8799e8[_0x46f4('0x4b')]['id'][_0x46f4('0xa3')]())))['toString']();break;default:_0x141d0b=squel['insert']()[_0x46f4('0x9b')](_0x46f4('0x9c'))[_0x46f4('0x9d')]([_0x46f4('0x9e'),_0x46f4('0x9f'),_0x46f4('0xa1'),_0x46f4('0xa0'),'VoiceQueueId',_0x46f4('0x5e'),_0x46f4('0x5f')],squel[_0x46f4('0x80')]()[_0x46f4('0x81')](_0x46f4('0x9e'),'phone')[_0x46f4('0x81')]('\x27'+_0x411936+'\x27',_0x46f4('0x9f'))['field']('id','ContactId')[_0x46f4('0x81')](_0x3673ca[_0x46f4('0xa2')][_0x46f4('0xa3')](),'ListId')[_0x46f4('0x81')](_0x8799e8[_0x46f4('0x4b')]['id']['toString'](),_0x46f4('0x64'))[_0x46f4('0x81')]('\x27'+_0x411936+'\x27','createdAt')[_0x46f4('0x81')]('\x27'+_0x411936+'\x27',_0x46f4('0x5f'))[_0x46f4('0x83')](_0x46f4('0xaa'))[_0x46f4('0x40')](_0x46f4('0xac'))['where']('ListId\x20=\x20?',_0x3673ca[_0x46f4('0xa2')][_0x46f4('0xa3')]())[_0x46f4('0x40')](_0x46f4('0xa4')))[_0x46f4('0xa3')]();}_0x15f13c[_0x46f4('0x91')](db[_0x46f4('0x87')][_0x46f4('0x3a')](_0x141d0b));}return BPromise[_0x46f4('0x92')](_0x15f13c);}})[_0x46f4('0x29')](function(){var _0x35df03=[];var _0x470b31=squel[_0x46f4('0xad')]()[_0x46f4('0x9b')](_0x46f4('0xae'))[_0x46f4('0x9d')]([_0x46f4('0xaf'),_0x46f4('0x9e'),_0x46f4('0xb0'),_0x46f4('0x5e'),'updatedAt'],squel[_0x46f4('0x80')]()[_0x46f4('0x81')](_0x46f4('0xb1'))[_0x46f4('0x81')]('ci.item')[_0x46f4('0x81')](_0x46f4('0xb2'))['field']('\x27'+_0x411936+'\x27',_0x46f4('0x5e'))[_0x46f4('0x81')]('\x27'+_0x411936+'\x27',_0x46f4('0x5f'))['from'](_0x46f4('0xb3'),'ci')[_0x46f4('0xb4')](_0x46f4('0x9c'),'h',_0x46f4('0xb5'))[_0x46f4('0x40')]('h.scheduledat=?',_0x411936)[_0x46f4('0x40')]('ci.ItemClass=?',_0x46f4('0xb6')))[_0x46f4('0xa3')]();_0x35df03['push'](db[_0x46f4('0x87')][_0x46f4('0x3a')](_0x470b31));return BPromise[_0x46f4('0x92')](_0x35df03);})[_0x46f4('0x29')](function(){return _0x4ca171;})[_0x46f4('0x29')](respondWithResult(_0x3fadcb,null))['catch'](handleError(_0x3fadcb,null));};exports[_0x46f4('0xb7')]=function(_0x4c95d,_0x5a6f70,_0x4f77e4){return db[_0x46f4('0x37')][_0x46f4('0x50')]({'where':{'id':_0x4c95d[_0x46f4('0x4b')]['id']}})[_0x46f4('0x29')](handleEntityNotFound(_0x5a6f70,null))['then'](function(_0x329e85){if(_0x329e85){return _0x329e85[_0x46f4('0xb7')](_0x4c95d[_0x46f4('0x3a')][_0x46f4('0x7e')]);}})['then'](function(_0x253c9f){if(_0x253c9f){return db['CmHopper']['destroy']({'where':{'ListId':_0x4c95d[_0x46f4('0x3a')][_0x46f4('0x7e')],'VoiceQueueId':_0x4c95d[_0x46f4('0x4b')]['id']}})['then'](function(){return _0x253c9f;});}})[_0x46f4('0x29')](respondWithStatusCode(_0x5a6f70,null))[_0x46f4('0x49')](handleError(_0x5a6f70,null));};exports[_0x46f4('0xb8')]=function(_0xe50797,_0x3fb0d6,_0x561ea6){var _0x3135d5={};var _0x40bd8c={};var _0x4c2054;var _0x3f13f9;return db[_0x46f4('0x37')]['findOne']({'where':{'id':_0xe50797['params']['id']}})['then'](handleEntityNotFound(_0x3fb0d6,null))[_0x46f4('0x29')](function(_0x14dfa1){if(_0x14dfa1){_0x4c2054=_0x14dfa1;_0x40bd8c[_0x46f4('0x39')]=_[_0x46f4('0x4c')](db[_0x46f4('0xb9')][_0x46f4('0x4d')]);_0x40bd8c['query']=_[_0x46f4('0x4c')](_0xe50797['query']);_0x40bd8c[_0x46f4('0x3b')]=_[_0x46f4('0x4e')](_0x40bd8c['model'],_0x40bd8c[_0x46f4('0x3a')]);_0x3135d5['attributes']=_[_0x46f4('0x4e')](_0x40bd8c[_0x46f4('0x39')],qs['fields'](_0xe50797['query'][_0x46f4('0x3d')]));_0x3135d5[_0x46f4('0x3c')]=_0x3135d5[_0x46f4('0x3c')]['length']?_0x3135d5[_0x46f4('0x3c')]:_0x40bd8c[_0x46f4('0x39')];_0x3135d5['order']=qs['sort'](_0xe50797['query'][_0x46f4('0x3f')]);_0x3135d5[_0x46f4('0x40')]=qs['filters'](_[_0x46f4('0x41')](_0xe50797[_0x46f4('0x3a')],_0x40bd8c[_0x46f4('0x3b')]));if(_0xe50797[_0x46f4('0x3a')]['filter']){_0x3135d5['where']=_[_0x46f4('0x42')](_0x3135d5[_0x46f4('0x40')],{'$or':_['map'](_0x3135d5[_0x46f4('0x3c')],function(_0x4f5250){var _0x4ff46f={};_0x4ff46f[_0x4f5250]={'$like':'%'+_0xe50797[_0x46f4('0x3a')][_0x46f4('0x44')]+'%'};return _0x4ff46f;})});}_0x3135d5=_['merge']({},_0x3135d5,_0xe50797['options']);return _0x4c2054[_0x46f4('0xb8')](_0x3135d5);}})[_0x46f4('0x29')](function(_0x551ca7){if(_0x551ca7){_0x3f13f9=_0x551ca7['length'];if(!_0xe50797[_0x46f4('0x3a')][_0x46f4('0x62')](_0x46f4('0x63'))){_0x3135d5[_0x46f4('0x1f')]=qs['limit'](_0xe50797['query']['limit']);_0x3135d5[_0x46f4('0x1e')]=qs['offset'](_0xe50797[_0x46f4('0x3a')][_0x46f4('0x1e')]);}return _0x4c2054[_0x46f4('0xb8')](_0x3135d5);}})['then'](function(_0x127a97){if(_0x127a97){return _0x127a97?{'count':_0x3f13f9,'rows':_0x127a97}:null;}})[_0x46f4('0x29')](respondWithResult(_0x3fb0d6,null))[_0x46f4('0x49')](handleError(_0x3fb0d6,null));};exports['addBlackLists']=function(_0x232cf6,_0x462f25,_0x22ebb4){var _0x57a6ed,_0x6bb502;return db[_0x46f4('0x37')][_0x46f4('0x50')]({'where':{'id':_0x232cf6['params']['id']}})[_0x46f4('0x29')](handleEntityNotFound(_0x462f25,null))[_0x46f4('0x29')](function(_0xf8d8d){if(_0xf8d8d){_0x6bb502=_0xf8d8d;return _0xf8d8d[_0x46f4('0xba')](_0x232cf6[_0x46f4('0x51')][_0x46f4('0x7e')],_[_0x46f4('0x5d')](_0x232cf6[_0x46f4('0x51')],[_0x46f4('0x7e'),'id'])||{});}return null;})[_0x46f4('0xbb')](function(_0x2a0096){var _0x2608a4;_0x57a6ed=_0x2a0096||[];var _0x406269=[];if(_0x2a0096){for(var _0x3d63ad=0x0;_0x3d63ad<_0x2a0096['length'];_0x3d63ad+=0x1){var _0x2525a2=_0x2a0096[_0x3d63ad][_0x46f4('0x2b')]({'plain':!![]});_0x2608a4=squel[_0x46f4('0xad')]()[_0x46f4('0x9b')](_0x46f4('0xbc'))[_0x46f4('0x9d')](['phone','ContactId',_0x46f4('0xa0'),_0x46f4('0x64'),_0x46f4('0x5e'),_0x46f4('0x5f')],squel['select']()[_0x46f4('0x81')](_0x46f4('0x9e'),_0x46f4('0x9e'))['field']('id','ContactId')[_0x46f4('0x81')](_0x2525a2[_0x46f4('0xa2')][_0x46f4('0xa3')](),_0x46f4('0xa0'))[_0x46f4('0x81')](_0x232cf6[_0x46f4('0x4b')]['id']['toString'](),_0x46f4('0x64'))['field']('NOW()',_0x46f4('0x5e'))[_0x46f4('0x81')](_0x46f4('0xbd'),_0x46f4('0x5f'))['from'](_0x46f4('0xaa'))[_0x46f4('0x40')](_0x46f4('0xac'))[_0x46f4('0x40')](_0x46f4('0xab'),_0x2525a2[_0x46f4('0xa2')][_0x46f4('0xa3')]())[_0x46f4('0x40')](_0x46f4('0xa4')))[_0x46f4('0xa3')]();_0x406269['push'](db[_0x46f4('0x87')][_0x46f4('0x3a')](_0x2608a4));}return BPromise['all'](_0x406269);}})[_0x46f4('0x29')](function(){return _0x57a6ed;})[_0x46f4('0x29')](respondWithResult(_0x462f25,null))['catch'](handleError(_0x462f25,null));};exports[_0x46f4('0xbe')]=function(_0x176f88,_0x232fad,_0x4f5871){return db[_0x46f4('0x37')][_0x46f4('0x50')]({'where':{'id':_0x176f88['params']['id']}})[_0x46f4('0x29')](handleEntityNotFound(_0x232fad,null))[_0x46f4('0x29')](function(_0x15bce9){if(_0x15bce9){return _0x15bce9['removeBlackLists'](_0x176f88[_0x46f4('0x3a')][_0x46f4('0x7e')]);}})[_0x46f4('0x29')](function(_0x49359c){if(_0x49359c){return db[_0x46f4('0x6c')]['destroy']({'where':{'ListId':_0x176f88[_0x46f4('0x3a')][_0x46f4('0x7e')],'VoiceQueueId':_0x176f88[_0x46f4('0x4b')]['id']}})['then'](function(){return _0x49359c;});}})['then'](respondWithStatusCode(_0x232fad,null))[_0x46f4('0x49')](handleError(_0x232fad,null));}; \ No newline at end of file +var _0x1059=['api','../../config/environment','redis','defaults','localhost','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','filter','ignore','value','includes','find','type','UserProfileResource','stack','name','send','map','VoiceQueue','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','includeAll','findAll','rows','params','include','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','outbound','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','updatedAt','body','omit','findOne','CmHopper','pick','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','addTeams','teams','Agents','online','voicePause','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','upsert','UserVoiceQueue','findOrCreate','interface','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','User','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','isEmpty','removeAgents','UserVoiceQueueRt','addAgents','spread','push','isNil','isArray','userVoiceQueue:remove','getAgents','getMembers','CmList','getLists','YYYY-MM-DD\x20HH:mm:ss','addLists','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','createdAt','select','phone','scheduledAt','ContactId','CmListId','ListId','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','onlyIfOpen','into','deletedAt\x20IS\x20NULL','COALESCE(phone,\x27\x27)','cm_hopper_additional_phones','OrderBy','h.id','ci.item','ci.OrderBy+1','cm_contact_has_items','h.ContactId=ci.CmContactId','h.scheduledat=?','ci.ItemClass=?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','NOW()','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x24431a,_0x52459a){var _0x454ec7=function(_0x34cd60){while(--_0x34cd60){_0x24431a['push'](_0x24431a['shift']());}};_0x454ec7(++_0x52459a);}(_0x1059,0x176));var _0x9105=function(_0x4817eb,_0x118027){_0x4817eb=_0x4817eb-0x0;var _0x138929=_0x1059[_0x4817eb];return _0x138929;};'use strict';var emlformat=require(_0x9105('0x0'));var rimraf=require(_0x9105('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9105('0x2'));var rp=require(_0x9105('0x3'));var moment=require(_0x9105('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9105('0x5'));var util=require('util');var path=require(_0x9105('0x6'));var sox=require(_0x9105('0x7'));var csv=require('to-csv');var ejs=require(_0x9105('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9105('0x9'));var squel=require(_0x9105('0xa'));var crypto=require(_0x9105('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9105('0xc'));var toCsv=require(_0x9105('0xd'));var querystring=require(_0x9105('0xe'));var Papa=require(_0x9105('0xf'));var Redis=require('ioredis');var authService=require(_0x9105('0x10'));var qs=require(_0x9105('0x11'));var as=require(_0x9105('0x12'));var hardwareService=require(_0x9105('0x13'));var logger=require('../../config/logger')(_0x9105('0x14'));var utils=require('../../config/utils');var config=require(_0x9105('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x9105('0x16')]=_[_0x9105('0x17')](config[_0x9105('0x16')],{'host':_0x9105('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9105('0x16')]));require('./voiceQueue.socket')[_0x9105('0x19')](socket);function respondWithStatusCode(_0x1aa0d0,_0x3d4790){_0x3d4790=_0x3d4790||0xcc;return function(_0x481152){if(_0x481152){return _0x1aa0d0['sendStatus'](_0x3d4790);}return _0x1aa0d0[_0x9105('0x1a')](_0x3d4790)[_0x9105('0x1b')]();};}function respondWithResult(_0x3933d5,_0x40d98){_0x40d98=_0x40d98||0xc8;return function(_0x1a01dd){if(_0x1a01dd){return _0x3933d5[_0x9105('0x1a')](_0x40d98)[_0x9105('0x1c')](_0x1a01dd);}};}function respondWithFilteredResult(_0x13d241,_0xb093b0){return function(_0x3d44d4){if(_0x3d44d4){var _0x17e769=typeof _0xb093b0[_0x9105('0x1d')]==='undefined'&&typeof _0xb093b0['limit']===_0x9105('0x1e');var _0x825941=_0x3d44d4[_0x9105('0x1f')];var _0x6eafc8=_0x17e769?0x0:_0xb093b0['offset'];var _0x395454=_0x17e769?_0x3d44d4[_0x9105('0x1f')]:_0xb093b0['offset']+_0xb093b0[_0x9105('0x20')];var _0x2810f5;if(_0x395454>=_0x825941){_0x395454=_0x825941;_0x2810f5=0xc8;}else{_0x2810f5=0xce;}_0x13d241[_0x9105('0x1a')](_0x2810f5);return _0x13d241[_0x9105('0x21')](_0x9105('0x22'),_0x6eafc8+'-'+_0x395454+'/'+_0x825941)[_0x9105('0x1c')](_0x3d44d4);}return null;};}function patchUpdates(_0x47a77e){return function(_0x318aaa){try{jsonpatch[_0x9105('0x23')](_0x318aaa,_0x47a77e,!![]);}catch(_0x2e6988){return BPromise[_0x9105('0x24')](_0x2e6988);}return _0x318aaa[_0x9105('0x25')]();};}function saveUpdates(_0x432025,_0xbbad86){return function(_0x44a3d8){if(_0x44a3d8){return _0x44a3d8[_0x9105('0x26')](_0x432025)[_0x9105('0x27')](function(_0x2d83e2){return _0x2d83e2;});}return null;};}function removeEntity(_0x59f4c3,_0x3a66f1){return function(_0x474069){if(_0x474069){return _0x474069[_0x9105('0x28')]()[_0x9105('0x27')](function(){var _0x3f660c=_0x474069[_0x9105('0x29')]({'plain':!![]});var _0x5d7db1=[{'name':_0x9105('0x2a'),'value':_0x9105('0x2b'),'ignore':![]},{'name':_0x9105('0x2c'),'value':'outbound','ignore':![]}];var _0x3ce577=_(_0x5d7db1)[_0x9105('0x2d')](_0x9105('0x2e'))['map'](_0x9105('0x2f'))[_0x9105('0x2f')]();if(_[_0x9105('0x30')](_0x3ce577,_0x3f660c['type'])){return;}var _0x4a7630=_[_0x9105('0x31')](_0x5d7db1,[_0x9105('0x2f'),_0x3f660c[_0x9105('0x32')]])['name'];return db[_0x9105('0x33')][_0x9105('0x28')]({'where':{'type':_0x4a7630,'resourceId':_0x3f660c['id']}})['then'](function(){return _0x474069;});})[_0x9105('0x27')](function(){_0x59f4c3[_0x9105('0x1a')](0xcc)[_0x9105('0x1b')]();});}};}function handleEntityNotFound(_0x4bd38c,_0x52452a){return function(_0x52ea6f){if(!_0x52ea6f){_0x4bd38c['sendStatus'](0x194);}return _0x52ea6f;};}function handleError(_0x121d54,_0x516e85){_0x516e85=_0x516e85||0x1f4;return function(_0x3a49ba){logger['error'](_0x3a49ba[_0x9105('0x34')]);if(_0x3a49ba[_0x9105('0x35')]){delete _0x3a49ba[_0x9105('0x35')];}_0x121d54[_0x9105('0x1a')](_0x516e85)[_0x9105('0x36')](_0x3a49ba);};}exports['index']=function(_0x20043a,_0xcbd370){var _0x458825={},_0x4c9b92={},_0x490e9f={'count':0x0,'rows':[]};var _0x18d0cb=_[_0x9105('0x37')](db[_0x9105('0x38')][_0x9105('0x39')],function(_0x4880c9){return{'name':_0x4880c9[_0x9105('0x3a')],'type':_0x4880c9[_0x9105('0x32')][_0x9105('0x3b')]};});_0x4c9b92[_0x9105('0x3c')]=_[_0x9105('0x37')](_0x18d0cb,_0x9105('0x35'));_0x4c9b92[_0x9105('0x3d')]=_[_0x9105('0x3e')](_0x20043a['query']);_0x4c9b92[_0x9105('0x3f')]=_[_0x9105('0x40')](_0x4c9b92[_0x9105('0x3c')],_0x4c9b92['query']);_0x458825[_0x9105('0x41')]=_[_0x9105('0x40')](_0x4c9b92[_0x9105('0x3c')],qs[_0x9105('0x42')](_0x20043a[_0x9105('0x3d')][_0x9105('0x42')]));_0x458825['attributes']=_0x458825[_0x9105('0x41')][_0x9105('0x43')]?_0x458825[_0x9105('0x41')]:_0x4c9b92[_0x9105('0x3c')];if(!_0x20043a['query'][_0x9105('0x44')](_0x9105('0x45'))){_0x458825['limit']=qs[_0x9105('0x20')](_0x20043a[_0x9105('0x3d')][_0x9105('0x20')]);_0x458825[_0x9105('0x1d')]=qs[_0x9105('0x1d')](_0x20043a[_0x9105('0x3d')][_0x9105('0x1d')]);}_0x458825[_0x9105('0x46')]=qs['sort'](_0x20043a[_0x9105('0x3d')][_0x9105('0x47')]);_0x458825[_0x9105('0x48')]=qs[_0x9105('0x3f')](_['pick'](_0x20043a['query'],_0x4c9b92['filters']),_0x18d0cb);if(_0x20043a[_0x9105('0x3d')]['filter']){_0x458825[_0x9105('0x48')]=_[_0x9105('0x49')](_0x458825[_0x9105('0x48')],{'$or':_['map'](_0x18d0cb,function(_0x3dc106){if(_0x3dc106[_0x9105('0x32')]!==_0x9105('0x4a')){var _0xb6341e={};_0xb6341e[_0x3dc106[_0x9105('0x35')]]={'$like':'%'+_0x20043a[_0x9105('0x3d')][_0x9105('0x2d')]+'%'};return _0xb6341e;}})});}_0x458825=_[_0x9105('0x49')]({},_0x458825,_0x20043a[_0x9105('0x4b')]);var _0x40fd1c={'where':_0x458825[_0x9105('0x48')]};return db[_0x9105('0x38')]['count'](_0x40fd1c)[_0x9105('0x27')](function(_0x284164){_0x490e9f[_0x9105('0x1f')]=_0x284164;if(_0x20043a[_0x9105('0x3d')][_0x9105('0x4c')]){_0x458825['include']=[{'all':!![]}];}return db['VoiceQueue'][_0x9105('0x4d')](_0x458825);})[_0x9105('0x27')](function(_0x2f467b){_0x490e9f[_0x9105('0x4e')]=_0x2f467b;return _0x490e9f;})[_0x9105('0x27')](respondWithFilteredResult(_0xcbd370,_0x458825))['catch'](handleError(_0xcbd370,null));};exports['show']=function(_0x350cd6,_0x412124){var _0xe2c41e={'raw':![],'where':{'id':_0x350cd6[_0x9105('0x4f')]['id']}},_0x453bf8={};_0x453bf8[_0x9105('0x3c')]=_[_0x9105('0x3e')](db[_0x9105('0x38')][_0x9105('0x39')]);_0x453bf8[_0x9105('0x3d')]=_[_0x9105('0x3e')](_0x350cd6[_0x9105('0x3d')]);_0x453bf8[_0x9105('0x3f')]=_['intersection'](_0x453bf8[_0x9105('0x3c')],_0x453bf8['query']);_0xe2c41e[_0x9105('0x41')]=_['intersection'](_0x453bf8[_0x9105('0x3c')],qs[_0x9105('0x42')](_0x350cd6[_0x9105('0x3d')]['fields']));_0xe2c41e[_0x9105('0x41')]=_0xe2c41e[_0x9105('0x41')]['length']?_0xe2c41e[_0x9105('0x41')]:_0x453bf8[_0x9105('0x3c')];if(_0x350cd6[_0x9105('0x3d')][_0x9105('0x4c')]){_0xe2c41e[_0x9105('0x50')]=[{'all':!![]}];}_0xe2c41e=_[_0x9105('0x49')]({},_0xe2c41e,_0x350cd6['options']);return db[_0x9105('0x38')][_0x9105('0x31')](_0xe2c41e)[_0x9105('0x27')](handleEntityNotFound(_0x412124,null))[_0x9105('0x27')](respondWithResult(_0x412124,null))[_0x9105('0x51')](handleError(_0x412124,null));};exports[_0x9105('0x52')]=function(_0x5c4e43,_0x280cce){return db[_0x9105('0x38')][_0x9105('0x52')](_0x5c4e43['body'],{})[_0x9105('0x27')](function(_0x4f61bb){var _0xe17cf2=_0x5c4e43['user'][_0x9105('0x29')]({'plain':!![]});if(!_0xe17cf2)throw new Error(_0x9105('0x53'));if(_0xe17cf2[_0x9105('0x54')]===_0x9105('0x55')){var _0x58142c=_0x4f61bb[_0x9105('0x29')]({'plain':!![]});var _0x1d40e3=[{'name':_0x9105('0x2a'),'value':'inbound'},{'name':_0x9105('0x2c'),'value':_0x9105('0x56')}];var _0x5dcb54=_[_0x9105('0x31')](_0x1d40e3,[_0x9105('0x2f'),_0x58142c[_0x9105('0x32')]])['name'];return db[_0x9105('0x57')][_0x9105('0x31')]({'where':{'name':_0x5dcb54,'userProfileId':_0xe17cf2[_0x9105('0x58')]},'raw':!![]})[_0x9105('0x27')](function(_0x41804e){if(_0x41804e&&_0x41804e[_0x9105('0x59')]===0x0){return db[_0x9105('0x33')]['create']({'name':_0x58142c[_0x9105('0x35')],'resourceId':_0x58142c['id'],'type':_0x41804e['name'],'sectionId':_0x41804e['id']},{})[_0x9105('0x27')](function(){return _0x4f61bb;});}else{return _0x4f61bb;}})[_0x9105('0x51')](function(_0xefbea7){logger[_0x9105('0x5a')](_0x9105('0x5b'),_0xefbea7);throw _0xefbea7;});}return _0x4f61bb;})[_0x9105('0x27')](respondWithResult(_0x280cce,0xc9))['catch'](handleError(_0x280cce,null));};exports[_0x9105('0x5c')]=function(_0x215e8b,_0x520ce5){var _0x424e12={'where':{'id':_0x215e8b[_0x9105('0x4f')]['id']}},_0x3e268a={};_0x3e268a[_0x9105('0x3c')]=_[_0x9105('0x3e')](db[_0x9105('0x38')][_0x9105('0x39')]);_0x424e12['attributes']=_[_0x9105('0x40')](_0x3e268a['model'],qs[_0x9105('0x42')](_0x215e8b['query'][_0x9105('0x42')]));_0x424e12[_0x9105('0x41')]=_0x424e12[_0x9105('0x41')][_0x9105('0x43')]?_0x424e12[_0x9105('0x41')]:_0x3e268a[_0x9105('0x3c')];if(_0x215e8b['query'][_0x9105('0x4c')]){_0x424e12[_0x9105('0x50')]=[{'all':!![]}];}_0x424e12=_[_0x9105('0x49')]({},_0x424e12,_0x215e8b[_0x9105('0x4b')]);return db[_0x9105('0x38')]['find'](_0x424e12)[_0x9105('0x27')](handleEntityNotFound(_0x520ce5,null))['then'](function(_0xfc3378){if(_0xfc3378){var _0x4d3b36=_0xfc3378['get']({'plain':!![]});_0x4d3b36=qs['omit'](_0x4d3b36,['id','createdAt',_0x9105('0x5d')]);_0x215e8b[_0x9105('0x5e')]=_[_0x9105('0x5f')](_0x215e8b[_0x9105('0x5e')],['id','createdAt',_0x9105('0x5d')]);return db[_0x9105('0x38')][_0x9105('0x52')](_[_0x9105('0x49')](_0x4d3b36,_0x215e8b[_0x9105('0x5e')]),{'include':_0x215e8b[_0x9105('0x3d')][_0x9105('0x4c')]?[{'all':!![]}]:undefined})[_0x9105('0x27')](function(_0x3049e7){var _0x451e1f=_0x215e8b['user'][_0x9105('0x29')]({'plain':!![]});if(!_0x451e1f)throw new Error(_0x9105('0x53'));if(_0x451e1f[_0x9105('0x54')]===_0x9105('0x55')){var _0x1a8187=_0x3049e7['get']({'plain':!![]});var _0x26fc6a=[{'name':_0x9105('0x2a'),'value':'inbound'},{'name':_0x9105('0x2c'),'value':_0x9105('0x56')}];var _0x333edd=_['find'](_0x26fc6a,[_0x9105('0x2f'),_0x1a8187[_0x9105('0x32')]])[_0x9105('0x35')];return db['UserProfileSection'][_0x9105('0x31')]({'where':{'name':_0x333edd,'userProfileId':_0x451e1f[_0x9105('0x58')]},'raw':!![]})[_0x9105('0x27')](function(_0x5ba1f3){if(_0x5ba1f3&&_0x5ba1f3['autoAssociation']===0x0){return db[_0x9105('0x33')]['create']({'name':_0x1a8187[_0x9105('0x35')],'resourceId':_0x1a8187['id'],'type':_0x5ba1f3[_0x9105('0x35')],'sectionId':_0x5ba1f3['id']},{})[_0x9105('0x27')](function(){return _0x3049e7;});}else{return _0x3049e7;}})[_0x9105('0x51')](function(_0x1d238f){logger[_0x9105('0x5a')](_0x9105('0x5b'),_0x1d238f);throw _0x1d238f;});}return _0x3049e7;});}})['then'](respondWithResult(_0x520ce5,0xc9))[_0x9105('0x51')](handleError(_0x520ce5,null));};exports[_0x9105('0x26')]=function(_0x45a9f1,_0x195161){if(_0x45a9f1[_0x9105('0x5e')]['id']){delete _0x45a9f1['body']['id'];}return db['VoiceQueue'][_0x9105('0x31')]({'where':{'id':_0x45a9f1['params']['id']}})[_0x9105('0x27')](handleEntityNotFound(_0x195161,null))[_0x9105('0x27')](saveUpdates(_0x45a9f1[_0x9105('0x5e')],null))[_0x9105('0x27')](respondWithResult(_0x195161,null))[_0x9105('0x51')](handleError(_0x195161,null));};exports[_0x9105('0x28')]=function(_0x594536,_0xfce202){return db[_0x9105('0x38')][_0x9105('0x31')]({'where':{'id':_0x594536[_0x9105('0x4f')]['id']}})[_0x9105('0x27')](handleEntityNotFound(_0xfce202,null))[_0x9105('0x27')](removeEntity(_0xfce202,null))[_0x9105('0x51')](handleError(_0xfce202,null));};exports['getHoppers']=function(_0x237e83,_0x2783c8,_0x31fe4b){var _0x8d270e={'raw':![],'where':{}};var _0x177457={};var _0x29eaaf={'count':0x0,'rows':[]};return db[_0x9105('0x38')][_0x9105('0x60')]({'where':{'id':_0x237e83['params']['id']}})[_0x9105('0x27')](handleEntityNotFound(_0x2783c8,null))[_0x9105('0x27')](function(_0xddc159){if(_0xddc159){_0x177457[_0x9105('0x3c')]=_[_0x9105('0x3e')](db[_0x9105('0x61')][_0x9105('0x39')]);_0x177457[_0x9105('0x3d')]=_[_0x9105('0x3e')](_0x237e83[_0x9105('0x3d')]);_0x177457['filters']=_[_0x9105('0x40')](_0x177457[_0x9105('0x3c')],_0x177457[_0x9105('0x3d')]);_0x8d270e[_0x9105('0x41')]=_[_0x9105('0x40')](_0x177457['model'],qs[_0x9105('0x42')](_0x237e83[_0x9105('0x3d')]['fields']));_0x8d270e[_0x9105('0x41')]=_0x8d270e['attributes'][_0x9105('0x43')]?_0x8d270e[_0x9105('0x41')]:_0x177457[_0x9105('0x3c')];if(!_0x237e83[_0x9105('0x3d')][_0x9105('0x44')](_0x9105('0x45'))){_0x8d270e[_0x9105('0x20')]=qs[_0x9105('0x20')](_0x237e83[_0x9105('0x3d')][_0x9105('0x20')]);_0x8d270e[_0x9105('0x1d')]=qs[_0x9105('0x1d')](_0x237e83[_0x9105('0x3d')][_0x9105('0x1d')]);}_0x8d270e[_0x9105('0x46')]=qs[_0x9105('0x47')](_0x237e83[_0x9105('0x3d')]['sort']);_0x8d270e[_0x9105('0x48')]=qs[_0x9105('0x3f')](_[_0x9105('0x62')](_0x237e83['query'],_0x177457[_0x9105('0x3f')]));_0x8d270e[_0x9105('0x48')][_0x9105('0x63')]=_0xddc159['id'];if(_0x237e83[_0x9105('0x3d')]['filter']){_0x8d270e[_0x9105('0x48')]=_['merge'](_0x8d270e[_0x9105('0x48')],{'$or':_['map'](_0x8d270e['attributes'],function(_0x7c16a5){var _0x303aa5={};_0x303aa5[_0x7c16a5]={'$like':'%'+_0x237e83['query']['filter']+'%'};return _0x303aa5;})});}_0x8d270e=_[_0x9105('0x49')]({},_0x8d270e,_0x237e83[_0x9105('0x4b')]);return db[_0x9105('0x61')][_0x9105('0x1f')]({'where':_0x8d270e[_0x9105('0x48')]})[_0x9105('0x27')](function(_0x46aa65){_0x29eaaf[_0x9105('0x1f')]=_0x46aa65;if(_0x237e83[_0x9105('0x3d')]['includeAll']){_0x8d270e[_0x9105('0x50')]=[{'all':!![]}];}return db['CmHopper'][_0x9105('0x4d')](_0x8d270e);})[_0x9105('0x27')](function(_0x53c90d){_0x29eaaf[_0x9105('0x4e')]=_0x53c90d;return _0x29eaaf;});}})[_0x9105('0x27')](respondWithFilteredResult(_0x2783c8,_0x8d270e))['catch'](handleError(_0x2783c8,null));};exports[_0x9105('0x64')]=function(_0x41f238,_0x2b8da9,_0x250966){var _0x21380e={'raw':!![],'where':{}};var _0x26a3d5={};var _0x153036={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x9105('0x60')]({'where':{'id':_0x41f238['params']['id']}})['then'](handleEntityNotFound(_0x2b8da9,null))[_0x9105('0x27')](function(_0x1ab234){if(_0x1ab234){_0x26a3d5[_0x9105('0x3c')]=_['keys'](db[_0x9105('0x65')][_0x9105('0x39')]);_0x26a3d5[_0x9105('0x3d')]=_['keys'](_0x41f238['query']);_0x26a3d5['filters']=_['intersection'](_0x26a3d5['model'],_0x26a3d5[_0x9105('0x3d')]);_0x21380e[_0x9105('0x41')]=_[_0x9105('0x40')](_0x26a3d5[_0x9105('0x3c')],qs[_0x9105('0x42')](_0x41f238['query'][_0x9105('0x42')]));_0x21380e[_0x9105('0x41')]=_0x21380e[_0x9105('0x41')][_0x9105('0x43')]?_0x21380e['attributes']:_0x26a3d5[_0x9105('0x3c')];if(!_0x41f238[_0x9105('0x3d')][_0x9105('0x44')](_0x9105('0x45'))){_0x21380e['limit']=qs['limit'](_0x41f238[_0x9105('0x3d')][_0x9105('0x20')]);_0x21380e['offset']=qs[_0x9105('0x1d')](_0x41f238[_0x9105('0x3d')][_0x9105('0x1d')]);}_0x21380e[_0x9105('0x46')]=qs[_0x9105('0x47')](_0x41f238[_0x9105('0x3d')][_0x9105('0x47')]);_0x21380e[_0x9105('0x48')]=qs['filters'](_['pick'](_0x41f238[_0x9105('0x3d')],_0x26a3d5[_0x9105('0x3f')]));_0x21380e['where'][_0x9105('0x63')]=_0x1ab234['id'];if(_0x41f238[_0x9105('0x3d')][_0x9105('0x2d')]){_0x21380e[_0x9105('0x48')]=_[_0x9105('0x49')](_0x21380e['where'],{'$or':_[_0x9105('0x37')](_0x21380e[_0x9105('0x41')],function(_0x35e092){var _0x307344={};_0x307344[_0x35e092]={'$like':'%'+_0x41f238[_0x9105('0x3d')][_0x9105('0x2d')]+'%'};return _0x307344;})});}_0x21380e=_[_0x9105('0x49')]({},_0x21380e,_0x41f238[_0x9105('0x4b')]);return db[_0x9105('0x65')][_0x9105('0x1f')]({'where':_0x21380e[_0x9105('0x48')]})['then'](function(_0x485973){_0x153036['count']=_0x485973;if(_0x41f238[_0x9105('0x3d')]['includeAll']){_0x21380e[_0x9105('0x50')]=[{'all':!![]}];}return db[_0x9105('0x65')][_0x9105('0x4d')](_0x21380e);})[_0x9105('0x27')](function(_0x3e5e18){_0x153036[_0x9105('0x4e')]=_0x3e5e18;return _0x153036;});}})[_0x9105('0x27')](respondWithFilteredResult(_0x2b8da9,_0x21380e))[_0x9105('0x51')](handleError(_0x2b8da9,null));};exports[_0x9105('0x66')]=function(_0x22431f,_0x3465a4,_0x49f115){var _0x3e0b90={'raw':!![],'where':{}};var _0x4ea184={};var _0x38c519={'count':0x0,'rows':[]};return db[_0x9105('0x38')]['findOne']({'where':{'id':_0x22431f[_0x9105('0x4f')]['id']}})[_0x9105('0x27')](handleEntityNotFound(_0x3465a4,null))['then'](function(_0x3bc127){if(_0x3bc127){_0x4ea184[_0x9105('0x3c')]=_[_0x9105('0x3e')](db[_0x9105('0x67')][_0x9105('0x39')]);_0x4ea184['query']=_[_0x9105('0x3e')](_0x22431f['query']);_0x4ea184[_0x9105('0x3f')]=_['intersection'](_0x4ea184['model'],_0x4ea184['query']);_0x3e0b90[_0x9105('0x41')]=_[_0x9105('0x40')](_0x4ea184[_0x9105('0x3c')],qs[_0x9105('0x42')](_0x22431f[_0x9105('0x3d')][_0x9105('0x42')]));_0x3e0b90[_0x9105('0x41')]=_0x3e0b90[_0x9105('0x41')][_0x9105('0x43')]?_0x3e0b90[_0x9105('0x41')]:_0x4ea184['model'];if(!_0x22431f[_0x9105('0x3d')]['hasOwnProperty'](_0x9105('0x45'))){_0x3e0b90[_0x9105('0x20')]=qs[_0x9105('0x20')](_0x22431f[_0x9105('0x3d')][_0x9105('0x20')]);_0x3e0b90[_0x9105('0x1d')]=qs['offset'](_0x22431f['query'][_0x9105('0x1d')]);}_0x3e0b90[_0x9105('0x46')]=qs[_0x9105('0x47')](_0x22431f['query'][_0x9105('0x47')]);_0x3e0b90[_0x9105('0x48')]=qs[_0x9105('0x3f')](_['pick'](_0x22431f[_0x9105('0x3d')],_0x4ea184[_0x9105('0x3f')]));_0x3e0b90[_0x9105('0x48')]['VoiceQueueId']=_0x3bc127['id'];if(_0x22431f[_0x9105('0x3d')]['filter']){_0x3e0b90[_0x9105('0x48')]=_[_0x9105('0x49')](_0x3e0b90[_0x9105('0x48')],{'$or':_['map'](_0x3e0b90[_0x9105('0x41')],function(_0x4fa48d){var _0x121b43={};_0x121b43[_0x4fa48d]={'$like':'%'+_0x22431f[_0x9105('0x3d')]['filter']+'%'};return _0x121b43;})});}_0x3e0b90=_[_0x9105('0x49')]({},_0x3e0b90,_0x22431f['options']);return db[_0x9105('0x67')][_0x9105('0x1f')]({'where':_0x3e0b90[_0x9105('0x48')]})['then'](function(_0x27051b){_0x38c519[_0x9105('0x1f')]=_0x27051b;if(_0x22431f[_0x9105('0x3d')]['includeAll']){_0x3e0b90[_0x9105('0x50')]=[{'all':!![]}];}return db[_0x9105('0x67')][_0x9105('0x4d')](_0x3e0b90);})[_0x9105('0x27')](function(_0x4c0c71){_0x38c519[_0x9105('0x4e')]=_0x4c0c71;return _0x38c519;});}})['then'](respondWithFilteredResult(_0x3465a4,_0x3e0b90))[_0x9105('0x51')](handleError(_0x3465a4,null));};exports[_0x9105('0x68')]=function(_0x52ff3c,_0x13f068,_0x162f7b){var _0x5f3c8f={'raw':!![],'where':{}};var _0x4b6d13={};var _0x33b1f7={'count':0x0,'rows':[]};return db[_0x9105('0x38')]['findOne']({'where':{'id':_0x52ff3c[_0x9105('0x4f')]['id']}})[_0x9105('0x27')](handleEntityNotFound(_0x13f068,null))[_0x9105('0x27')](function(_0x2caa34){if(_0x2caa34){_0x4b6d13[_0x9105('0x3c')]=_[_0x9105('0x3e')](db[_0x9105('0x69')]['rawAttributes']);_0x4b6d13['query']=_[_0x9105('0x3e')](_0x52ff3c['query']);_0x4b6d13[_0x9105('0x3f')]=_[_0x9105('0x40')](_0x4b6d13[_0x9105('0x3c')],_0x4b6d13[_0x9105('0x3d')]);_0x5f3c8f[_0x9105('0x41')]=_[_0x9105('0x40')](_0x4b6d13[_0x9105('0x3c')],qs[_0x9105('0x42')](_0x52ff3c[_0x9105('0x3d')][_0x9105('0x42')]));_0x5f3c8f['attributes']=_0x5f3c8f[_0x9105('0x41')][_0x9105('0x43')]?_0x5f3c8f['attributes']:_0x4b6d13[_0x9105('0x3c')];if(!_0x52ff3c['query']['hasOwnProperty'](_0x9105('0x45'))){_0x5f3c8f[_0x9105('0x20')]=qs[_0x9105('0x20')](_0x52ff3c['query'][_0x9105('0x20')]);_0x5f3c8f['offset']=qs[_0x9105('0x1d')](_0x52ff3c['query'][_0x9105('0x1d')]);}_0x5f3c8f[_0x9105('0x46')]=qs[_0x9105('0x47')](_0x52ff3c[_0x9105('0x3d')][_0x9105('0x47')]);_0x5f3c8f['where']=qs['filters'](_[_0x9105('0x62')](_0x52ff3c[_0x9105('0x3d')],_0x4b6d13[_0x9105('0x3f')]));_0x5f3c8f[_0x9105('0x48')][_0x9105('0x63')]=_0x2caa34['id'];if(_0x52ff3c['query']['filter']){_0x5f3c8f['where']=_[_0x9105('0x49')](_0x5f3c8f[_0x9105('0x48')],{'$or':_[_0x9105('0x37')](_0x5f3c8f[_0x9105('0x41')],function(_0x459673){var _0x4ebfe9={};_0x4ebfe9[_0x459673]={'$like':'%'+_0x52ff3c['query']['filter']+'%'};return _0x4ebfe9;})});}_0x5f3c8f=_[_0x9105('0x49')]({},_0x5f3c8f,_0x52ff3c['options']);return db[_0x9105('0x69')][_0x9105('0x1f')]({'where':_0x5f3c8f[_0x9105('0x48')]})[_0x9105('0x27')](function(_0x390cb1){_0x33b1f7[_0x9105('0x1f')]=_0x390cb1;if(_0x52ff3c['query'][_0x9105('0x4c')]){_0x5f3c8f[_0x9105('0x50')]=[{'all':!![]}];}return db[_0x9105('0x69')][_0x9105('0x4d')](_0x5f3c8f);})[_0x9105('0x27')](function(_0x5a1448){_0x33b1f7['rows']=_0x5a1448;return _0x33b1f7;});}})[_0x9105('0x27')](respondWithFilteredResult(_0x13f068,_0x5f3c8f))['catch'](handleError(_0x13f068,null));};exports['getTeams']=function(_0x12992f,_0x263337,_0x38a396){var _0x25fbf9={};var _0x24f60a={};var _0x4dd138;var _0x180470;return db[_0x9105('0x38')][_0x9105('0x60')]({'where':{'id':_0x12992f[_0x9105('0x4f')]['id']}})[_0x9105('0x27')](handleEntityNotFound(_0x263337,null))['then'](function(_0x103b8f){if(_0x103b8f){_0x4dd138=_0x103b8f;_0x24f60a['model']=_['keys'](db[_0x9105('0x6a')]['rawAttributes']);_0x24f60a[_0x9105('0x3d')]=_['keys'](_0x12992f[_0x9105('0x3d')]);_0x24f60a['filters']=_[_0x9105('0x40')](_0x24f60a['model'],_0x24f60a['query']);_0x25fbf9['attributes']=_['intersection'](_0x24f60a[_0x9105('0x3c')],qs['fields'](_0x12992f[_0x9105('0x3d')][_0x9105('0x42')]));_0x25fbf9['attributes']=_0x25fbf9[_0x9105('0x41')][_0x9105('0x43')]?_0x25fbf9[_0x9105('0x41')]:_0x24f60a['model'];_0x25fbf9[_0x9105('0x46')]=qs[_0x9105('0x47')](_0x12992f[_0x9105('0x3d')][_0x9105('0x47')]);_0x25fbf9[_0x9105('0x48')]=qs[_0x9105('0x3f')](_[_0x9105('0x62')](_0x12992f[_0x9105('0x3d')],_0x24f60a['filters']));if(_0x12992f['query'][_0x9105('0x2d')]){_0x25fbf9[_0x9105('0x48')]=_[_0x9105('0x49')](_0x25fbf9[_0x9105('0x48')],{'$or':_[_0x9105('0x37')](_0x25fbf9[_0x9105('0x41')],function(_0x27e335){var _0x517b85={};_0x517b85[_0x27e335]={'$like':'%'+_0x12992f['query']['filter']+'%'};return _0x517b85;})});}_0x25fbf9=_['merge']({},_0x25fbf9,_0x12992f[_0x9105('0x4b')]);return _0x4dd138[_0x9105('0x6b')](_0x25fbf9);}})[_0x9105('0x27')](function(_0x100dad){if(_0x100dad){_0x180470=_0x100dad['length'];if(!_0x12992f[_0x9105('0x3d')]['hasOwnProperty'](_0x9105('0x45'))){_0x25fbf9[_0x9105('0x20')]=qs[_0x9105('0x20')](_0x12992f[_0x9105('0x3d')][_0x9105('0x20')]);_0x25fbf9['offset']=qs[_0x9105('0x1d')](_0x12992f[_0x9105('0x3d')][_0x9105('0x1d')]);}return _0x4dd138[_0x9105('0x6b')](_0x25fbf9);}})[_0x9105('0x27')](function(_0x2862f5){if(_0x2862f5){return _0x2862f5?{'count':_0x180470,'rows':_0x2862f5}:null;}})['then'](respondWithResult(_0x263337,null))['catch'](handleError(_0x263337,null));};exports[_0x9105('0x6c')]=function(_0x1a7f8d,_0x53afda,_0x1a4fd6){var _0x4e71fd=_0x1a7f8d[_0x9105('0x5e')][_0x9105('0x6d')];var _0x217c17=_[_0x9105('0x37')](_0x4e71fd,'id');return db[_0x9105('0x6a')]['findAll']({'where':{'id':_0x217c17},'attributes':['id'],'include':[{'model':db['User'],'as':_0x9105('0x6e'),'attributes':['id',_0x9105('0x35'),_0x9105('0x6f'),_0x9105('0x70'),'interface'],'raw':!![]}]})[_0x9105('0x27')](function(_0x5d41e2){if(_0x5d41e2){var _0x5064d5=_['flatMap'](_0x5d41e2,function(_0x5cff60){var _0x4d1317=_0x5cff60[_0x9105('0x29')]({'plain':!![]});_0x4d1317[_0x9105('0x6e')][_0x9105('0x71')](function(_0x354c7a){_0x354c7a[_0x9105('0x72')]=_[_0x9105('0x31')](_0x4e71fd,{'id':_0x4d1317['id']})[_0x9105('0x72')];});return _0x4d1317[_0x9105('0x6e')];});return db[_0x9105('0x38')]['find']({'where':{'id':_0x1a7f8d['params']['id']}})[_0x9105('0x27')](function(_0x33383e){return db[_0x9105('0x73')][_0x9105('0x74')](function(_0x4a572f){return _0x33383e[_0x9105('0x6c')](_0x217c17,{'transaction':_0x4a572f})[_0x9105('0x27')](function(){return BPromise[_0x9105('0x75')](_0x4e71fd,function(_0x2a6c1e){return db[_0x9105('0x76')][_0x9105('0x77')]({'TeamId':_0x2a6c1e['id'],'VoiceQueueId':_0x1a7f8d[_0x9105('0x4f')]['id'],'penalty':_0x2a6c1e[_0x9105('0x72')]},{'transaction':_0x4a572f});});})[_0x9105('0x27')](function(){return BPromise[_0x9105('0x75')](_0x5064d5,function(_0x217329){return db[_0x9105('0x78')][_0x9105('0x79')]({'where':{'UserId':_0x217329['id'],'VoiceQueueId':_0x1a7f8d['params']['id']},'defaults':{'penalty':_0x217329[_0x9105('0x72')]},'transaction':_0x4a572f});});})[_0x9105('0x27')](function(){return BPromise['each'](_['filter'](_0x5064d5,{'online':!![]}),function(_0x1a80be){return db['UserVoiceQueueRt'][_0x9105('0x77')]({'membername':_0x1a80be[_0x9105('0x35')],'UserId':_0x1a80be['id'],'queue_name':_0x33383e[_0x9105('0x35')],'VoiceQueueId':_0x33383e['id'],'interface':_['isNil'](_0x1a80be[_0x9105('0x7a')])?util[_0x9105('0x7b')](_0x9105('0x7c'),_0x1a80be[_0x9105('0x35')]):_0x1a80be[_0x9105('0x7a')],'paused':_0x1a80be['voicePause']||![],'penalty':_0x1a80be[_0x9105('0x72')]},{'transaction':_0x4a572f});});})[_0x9105('0x27')](function(){_0x5064d5[_0x9105('0x71')](function(_0x3192d5){socket[_0x9105('0x7d')](_0x9105('0x7e'),{'UserId':_0x3192d5['id'],'VoiceQueueId':_0x33383e['id']});});});});});}})['then'](respondWithStatusCode(_0x53afda,null))[_0x9105('0x51')](handleError(_0x53afda,null));};exports[_0x9105('0x7f')]=function(_0x184937,_0x5291d4,_0x293260){return db[_0x9105('0x6a')][_0x9105('0x4d')]({'where':{'id':_0x184937['query'][_0x9105('0x80')]},'attributes':['id'],'include':[{'model':db[_0x9105('0x81')],'as':_0x9105('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x9105('0x27')](handleEntityNotFound(_0x5291d4,null))['then'](function(_0x2258a4){var _0x502490=_[_0x9105('0x37')](_0x2258a4,'id');var _0x4726d8=[];var _0x424df7=[];var _0x4b91a2=squel['select']();_0x4b91a2[_0x9105('0x82')](_0x9105('0x83'))[_0x9105('0x84')]('team_has_voice_queues','tq')[_0x9105('0x85')]('user_has_teams','ut',_0x9105('0x86'))[_0x9105('0x48')](_0x9105('0x87'),_0x184937[_0x9105('0x4f')]['id']);for(var _0x534c54=0x0;_0x534c54<_0x2258a4[_0x9105('0x43')];_0x534c54+=0x1){let _0x11559c=_0x2258a4[_0x534c54];for(var _0x2cbfee=0x0;_0x2cbfee<_0x11559c[_0x9105('0x6e')][_0x9105('0x43')];_0x2cbfee+=0x1){let _0x2bd972=_0x11559c['Agents'][_0x2cbfee];var _0x90f08a=_0x4b91a2[_0x9105('0x5c')]();_0x90f08a[_0x9105('0x48')](_0x9105('0x88'),_0x2bd972['id']);_0x424df7['push'](db[_0x9105('0x73')][_0x9105('0x3d')](_0x90f08a[_0x9105('0x89')](),{'type':db[_0x9105('0x73')][_0x9105('0x8a')][_0x9105('0x8b')]})['then'](function(_0x1933d3){if(_0x1933d3[_0x9105('0x43')]===0x1){return _0x2bd972['id'];}else{var _0x4ffc7e=_[_0x9105('0x8c')](_[_0x9105('0x37')](_0x1933d3,_0x9105('0x8d')),function(_0x4d684a){return _[_0x9105('0x30')](_0x502490,_0x4d684a);});if(_0x4ffc7e){return _0x2bd972['id'];}}}));}}return BPromise[_0x9105('0x8e')](_0x424df7)[_0x9105('0x27')](function(_0x47e5c4){_0x4726d8=_(_0x4726d8)[_0x9105('0x8f')](_0x47e5c4)[_0x9105('0x90')]()['value']();return db[_0x9105('0x38')][_0x9105('0x31')]({'where':{'id':_0x184937['params']['id']}})[_0x9105('0x27')](function(_0x2f3a35){return db[_0x9105('0x73')][_0x9105('0x74')](function(_0x183cfd){return _0x2f3a35[_0x9105('0x7f')](_0x184937[_0x9105('0x3d')]['ids'],{'transaction':_0x183cfd})[_0x9105('0x27')](function(){if(!_[_0x9105('0x91')](_0x4726d8)){return _0x2f3a35[_0x9105('0x92')](_0x4726d8,{'transaction':_0x183cfd})['then'](function(){return db[_0x9105('0x93')][_0x9105('0x28')]({'where':{'VoiceQueueId':_0x184937[_0x9105('0x4f')]['id'],'UserId':_0x4726d8},'transaction':_0x183cfd});});}})[_0x9105('0x27')](function(){_0x4726d8[_0x9105('0x71')](function(_0x443a13){socket[_0x9105('0x7d')]('userVoiceQueue:remove',{'UserId':_0x443a13,'VoiceQueueId':_0x2f3a35['id']});});});});});});})[_0x9105('0x27')](respondWithStatusCode(_0x5291d4,null))[_0x9105('0x51')](handleError(_0x5291d4,null));};exports[_0x9105('0x94')]=function(_0x1f3cf6,_0x46cd2c,_0x29545f){var _0x367640,_0xac62ef;return db[_0x9105('0x38')][_0x9105('0x31')]({'where':{'id':_0x1f3cf6['params']['id']}})[_0x9105('0x27')](handleEntityNotFound(_0x46cd2c,null))[_0x9105('0x27')](function(_0xe26b3e){if(_0xe26b3e){_0xac62ef=_0xe26b3e;return _0xe26b3e[_0x9105('0x94')](_0x1f3cf6[_0x9105('0x5e')][_0x9105('0x80')],_[_0x9105('0x5f')](_0x1f3cf6['body'],[_0x9105('0x80'),'id'])||{})[_0x9105('0x95')](function(_0x692674){for(var _0x5bfc14=0x0;_0x5bfc14<_0x1f3cf6['body'][_0x9105('0x80')]['length'];_0x5bfc14+=0x1){socket[_0x9105('0x7d')](_0x9105('0x7e'),{'UserId':Number(_0x1f3cf6['body']['ids'][_0x5bfc14]),'VoiceQueueId':Number(_0x1f3cf6[_0x9105('0x4f')]['id'])});}return _0x692674;});}})['then'](function(_0x55642f){_0x367640=_0x55642f||[];if(_0xac62ef){return db[_0x9105('0x81')]['findAll']({'where':{'id':_0x1f3cf6[_0x9105('0x5e')]['ids']},'attributes':['id',_0x9105('0x35'),_0x9105('0x6f'),_0x9105('0x70'),_0x9105('0x7a')],'raw':!![]});}})[_0x9105('0x27')](function(_0x4ea349){if(!_[_0x9105('0x91')](_0x4ea349)){var _0x285ae4=[];for(var _0x1c2d16=0x0;_0x1c2d16<_0x4ea349[_0x9105('0x43')];_0x1c2d16++){if(_0x4ea349[_0x1c2d16][_0x9105('0x6f')]){_0x285ae4[_0x9105('0x96')](db['UserVoiceQueueRt']['upsert']({'membername':_0x4ea349[_0x1c2d16][_0x9105('0x35')],'UserId':_0x4ea349[_0x1c2d16]['id'],'queue_name':_0xac62ef[_0x9105('0x35')],'VoiceQueueId':_0xac62ef['id'],'interface':_[_0x9105('0x97')](_0x4ea349[_0x1c2d16][_0x9105('0x7a')])?util[_0x9105('0x7b')](_0x9105('0x7c'),_0x4ea349[_0x1c2d16][_0x9105('0x35')]):_0x4ea349[_0x1c2d16][_0x9105('0x7a')],'paused':_0x4ea349[_0x1c2d16][_0x9105('0x70')]||![],'penalty':_0x1f3cf6[_0x9105('0x5e')]['penalty']||0x0}));}}return BPromise[_0x9105('0x8e')](_0x285ae4);}})[_0x9105('0x27')](function(){return _0x367640;})[_0x9105('0x27')](respondWithResult(_0x46cd2c,null))[_0x9105('0x51')](handleError(_0x46cd2c,null));};exports[_0x9105('0x92')]=function(_0x810f97,_0x274eb8,_0x38d743){return db[_0x9105('0x38')][_0x9105('0x31')]({'where':{'id':_0x810f97[_0x9105('0x4f')]['id']}})['then'](handleEntityNotFound(_0x274eb8,null))['then'](function(_0x1097c7){if(_0x1097c7){return _0x1097c7[_0x9105('0x92')](_0x810f97['query'][_0x9105('0x80')])['then'](function(){if(_[_0x9105('0x98')](_0x810f97[_0x9105('0x3d')][_0x9105('0x80')])){for(var _0x35bd8d=0x0;_0x35bd8d<_0x810f97[_0x9105('0x3d')][_0x9105('0x80')][_0x9105('0x43')];_0x35bd8d+=0x1){socket[_0x9105('0x7d')](_0x9105('0x99'),{'UserId':Number(_0x810f97[_0x9105('0x3d')]['ids'][_0x35bd8d]),'VoiceQueueId':Number(_0x810f97[_0x9105('0x4f')]['id'])});}}else{socket[_0x9105('0x7d')](_0x9105('0x99'),{'UserId':Number(_0x810f97['query']['ids']),'VoiceQueueId':Number(_0x810f97[_0x9105('0x4f')]['id'])});}});}})['then'](function(_0x5078cb){return db[_0x9105('0x93')]['destroy']({'where':{'VoiceQueueId':_0x810f97['params']['id'],'UserId':_0x810f97[_0x9105('0x3d')]['ids']}})[_0x9105('0x27')](function(){return _0x5078cb;});})[_0x9105('0x27')](respondWithStatusCode(_0x274eb8,null))['catch'](handleError(_0x274eb8,null));};exports[_0x9105('0x9a')]=function(_0x2f3253,_0x29051c,_0xf7d537){var _0x508fa1={};var _0x186d92={};var _0x40d363;var _0x4fd875;return db['VoiceQueue']['findOne']({'where':{'id':_0x2f3253[_0x9105('0x4f')]['id']}})['then'](handleEntityNotFound(_0x29051c,null))[_0x9105('0x27')](function(_0x5352a1){if(_0x5352a1){_0x40d363=_0x5352a1;_0x186d92[_0x9105('0x3c')]=_['keys'](db['User'][_0x9105('0x39')]);_0x186d92[_0x9105('0x3d')]=_[_0x9105('0x3e')](_0x2f3253[_0x9105('0x3d')]);_0x186d92[_0x9105('0x3f')]=_[_0x9105('0x40')](_0x186d92[_0x9105('0x3c')],_0x186d92[_0x9105('0x3d')]);_0x508fa1[_0x9105('0x41')]=_['intersection'](_0x186d92[_0x9105('0x3c')],qs[_0x9105('0x42')](_0x2f3253['query'][_0x9105('0x42')]));_0x508fa1['attributes']=_0x508fa1[_0x9105('0x41')]['length']?_0x508fa1['attributes']:_0x186d92[_0x9105('0x3c')];_0x508fa1[_0x9105('0x46')]=qs[_0x9105('0x47')](_0x2f3253['query'][_0x9105('0x47')]);_0x508fa1[_0x9105('0x48')]=qs[_0x9105('0x3f')](_[_0x9105('0x62')](_0x2f3253[_0x9105('0x3d')],_0x186d92['filters']));if(_0x2f3253[_0x9105('0x3d')][_0x9105('0x2d')]){_0x508fa1['where']=_[_0x9105('0x49')](_0x508fa1[_0x9105('0x48')],{'$or':_[_0x9105('0x37')](_0x508fa1[_0x9105('0x41')],function(_0x25b910){var _0x8d00e8={};_0x8d00e8[_0x25b910]={'$like':'%'+_0x2f3253[_0x9105('0x3d')][_0x9105('0x2d')]+'%'};return _0x8d00e8;})});}_0x508fa1=_[_0x9105('0x49')]({},_0x508fa1,_0x2f3253[_0x9105('0x4b')]);return _0x40d363['getAgents'](_0x508fa1);}})[_0x9105('0x27')](function(_0x5cbb57){if(_0x5cbb57){_0x4fd875=_0x5cbb57[_0x9105('0x43')];if(!_0x2f3253[_0x9105('0x3d')][_0x9105('0x44')](_0x9105('0x45'))){_0x508fa1['limit']=qs[_0x9105('0x20')](_0x2f3253[_0x9105('0x3d')][_0x9105('0x20')]);_0x508fa1[_0x9105('0x1d')]=qs['offset'](_0x2f3253[_0x9105('0x3d')][_0x9105('0x1d')]);}return _0x40d363[_0x9105('0x9a')](_0x508fa1);}})[_0x9105('0x27')](function(_0x504411){if(_0x504411){return _0x504411?{'count':_0x4fd875,'rows':_0x504411}:null;}})[_0x9105('0x27')](respondWithResult(_0x29051c,null))[_0x9105('0x51')](handleError(_0x29051c,null));};exports[_0x9105('0x9b')]=function(_0x3b41b1,_0x26bf03,_0x306292){var _0x134234={};var _0x5319c5={};var _0x5d9dea;var _0xc1964f;return db[_0x9105('0x38')][_0x9105('0x60')]({'where':{'id':_0x3b41b1[_0x9105('0x4f')]['id']}})[_0x9105('0x27')](handleEntityNotFound(_0x26bf03,null))[_0x9105('0x27')](function(_0x25d45c){if(_0x25d45c){_0x5d9dea=_0x25d45c;_0x5319c5[_0x9105('0x3c')]=_[_0x9105('0x3e')](db[_0x9105('0x93')][_0x9105('0x39')]);_0x5319c5['query']=_[_0x9105('0x3e')](_0x3b41b1[_0x9105('0x3d')]);_0x5319c5[_0x9105('0x3f')]=_['intersection'](_0x5319c5[_0x9105('0x3c')],_0x5319c5['query']);_0x134234[_0x9105('0x41')]=_['intersection'](_0x5319c5[_0x9105('0x3c')],qs['fields'](_0x3b41b1[_0x9105('0x3d')][_0x9105('0x42')]));_0x134234[_0x9105('0x41')]=_0x134234['attributes'][_0x9105('0x43')]?_0x134234[_0x9105('0x41')]:_0x5319c5['model'];_0x134234[_0x9105('0x46')]=qs['sort'](_0x3b41b1[_0x9105('0x3d')]['sort']);_0x134234[_0x9105('0x48')]=qs[_0x9105('0x3f')](_['pick'](_0x3b41b1[_0x9105('0x3d')],_0x5319c5[_0x9105('0x3f')]));if(_0x3b41b1[_0x9105('0x3d')]['filter']){_0x134234[_0x9105('0x48')]=_[_0x9105('0x49')](_0x134234[_0x9105('0x48')],{'$or':_[_0x9105('0x37')](_0x134234[_0x9105('0x41')],function(_0x42956e){var _0x3e5c58={};_0x3e5c58[_0x42956e]={'$like':'%'+_0x3b41b1[_0x9105('0x3d')]['filter']+'%'};return _0x3e5c58;})});}_0x134234=_[_0x9105('0x49')]({},_0x134234,_0x3b41b1['options']);return _0x5d9dea[_0x9105('0x9b')](_0x134234);}})[_0x9105('0x27')](function(_0x193756){if(_0x193756){_0xc1964f=_0x193756[_0x9105('0x43')];if(!_0x3b41b1[_0x9105('0x3d')][_0x9105('0x44')]('nolimit')){_0x134234[_0x9105('0x20')]=qs[_0x9105('0x20')](_0x3b41b1[_0x9105('0x3d')][_0x9105('0x20')]);_0x134234[_0x9105('0x1d')]=qs[_0x9105('0x1d')](_0x3b41b1['query'][_0x9105('0x1d')]);}return _0x5d9dea['getMembers'](_0x134234);}})[_0x9105('0x27')](function(_0x577fba){return _0x577fba?{'count':_0xc1964f,'rows':_0x577fba}:null;})[_0x9105('0x27')](respondWithResult(_0x26bf03,null))['catch'](handleError(_0x26bf03,null));};exports['getLists']=function(_0x108aa2,_0xd45c3e,_0x110fd8){var _0x3533e8={};var _0x61b3a2={};var _0x2d2942;var _0x28a51c;return db['VoiceQueue']['findOne']({'where':{'id':_0x108aa2[_0x9105('0x4f')]['id']}})[_0x9105('0x27')](handleEntityNotFound(_0xd45c3e,null))[_0x9105('0x27')](function(_0x546289){if(_0x546289){_0x2d2942=_0x546289;_0x61b3a2['model']=_[_0x9105('0x3e')](db[_0x9105('0x9c')]['rawAttributes']);_0x61b3a2[_0x9105('0x3d')]=_['keys'](_0x108aa2[_0x9105('0x3d')]);_0x61b3a2['filters']=_[_0x9105('0x40')](_0x61b3a2[_0x9105('0x3c')],_0x61b3a2[_0x9105('0x3d')]);_0x3533e8[_0x9105('0x41')]=_[_0x9105('0x40')](_0x61b3a2['model'],qs[_0x9105('0x42')](_0x108aa2[_0x9105('0x3d')][_0x9105('0x42')]));_0x3533e8[_0x9105('0x41')]=_0x3533e8['attributes'][_0x9105('0x43')]?_0x3533e8[_0x9105('0x41')]:_0x61b3a2[_0x9105('0x3c')];_0x3533e8[_0x9105('0x46')]=qs[_0x9105('0x47')](_0x108aa2[_0x9105('0x3d')][_0x9105('0x47')]);_0x3533e8[_0x9105('0x48')]=qs[_0x9105('0x3f')](_['pick'](_0x108aa2[_0x9105('0x3d')],_0x61b3a2[_0x9105('0x3f')]));if(_0x108aa2[_0x9105('0x3d')]['filter']){_0x3533e8[_0x9105('0x48')]=_['merge'](_0x3533e8[_0x9105('0x48')],{'$or':_[_0x9105('0x37')](_0x3533e8[_0x9105('0x41')],function(_0xaf3fab){var _0x51aa79={};_0x51aa79[_0xaf3fab]={'$like':'%'+_0x108aa2[_0x9105('0x3d')][_0x9105('0x2d')]+'%'};return _0x51aa79;})});}_0x3533e8=_[_0x9105('0x49')]({},_0x3533e8,_0x108aa2[_0x9105('0x4b')]);return _0x2d2942['getLists'](_0x3533e8);}})[_0x9105('0x27')](function(_0xb9233c){if(_0xb9233c){_0x28a51c=_0xb9233c[_0x9105('0x43')];if(!_0x108aa2[_0x9105('0x3d')][_0x9105('0x44')](_0x9105('0x45'))){_0x3533e8['limit']=qs[_0x9105('0x20')](_0x108aa2[_0x9105('0x3d')][_0x9105('0x20')]);_0x3533e8[_0x9105('0x1d')]=qs['offset'](_0x108aa2[_0x9105('0x3d')][_0x9105('0x1d')]);}return _0x2d2942[_0x9105('0x9d')](_0x3533e8);}})[_0x9105('0x27')](function(_0x21129f){if(_0x21129f){return _0x21129f?{'count':_0x28a51c,'rows':_0x21129f}:null;}})[_0x9105('0x27')](respondWithResult(_0xd45c3e,null))[_0x9105('0x51')](handleError(_0xd45c3e,null));};exports['addLists']=function(_0x2c0bc6,_0x29f6f6,_0x160331){var _0x324232=moment()[_0x9105('0x7b')](_0x9105('0x9e'));var _0x1ada72,_0x49eecb;return db['VoiceQueue'][_0x9105('0x31')]({'where':{'id':_0x2c0bc6[_0x9105('0x4f')]['id']}})[_0x9105('0x27')](handleEntityNotFound(_0x29f6f6,null))[_0x9105('0x27')](function(_0x210212){if(_0x210212){_0x49eecb=_0x210212;return _0x210212[_0x9105('0x9f')](_0x2c0bc6[_0x9105('0x5e')][_0x9105('0x80')],_['omit'](_0x2c0bc6[_0x9105('0x5e')],[_0x9105('0x80'),'id'])||{});}return null;})[_0x9105('0x95')](function(_0x36f404){var _0x3d08cd;_0x1ada72=_0x36f404||[];var _0x1abca6=[];if(_0x36f404){for(var _0x4ee4b8=0x0;_0x4ee4b8<_0x36f404['length'];_0x4ee4b8+=0x1){var _0x29d928=_0x36f404[_0x4ee4b8][_0x9105('0x29')]({'plain':!![]});_0x49eecb[_0x9105('0xa0')]=_0x2c0bc6[_0x9105('0x5e')][_0x9105('0xa0')]?_0x2c0bc6[_0x9105('0x5e')][_0x9105('0xa0')]:_0x49eecb[_0x9105('0xa0')];switch(_0x49eecb[_0x9105('0xa0')]){case _0x9105('0xa1'):_0x3d08cd=squel[_0x9105('0xa2')]()['into'](_0x9105('0xa3'))[_0x9105('0xa4')](['phone','scheduledAt','ContactId','ListId',_0x9105('0x63'),_0x9105('0xa5'),_0x9105('0x5d')],squel[_0x9105('0xa6')]()['field'](_0x9105('0xa7'),_0x9105('0xa7'))[_0x9105('0x82')]('\x27'+_0x324232+'\x27',_0x9105('0xa8'))[_0x9105('0x82')]('id',_0x9105('0xa9'))[_0x9105('0x82')](_0x29d928[_0x9105('0xaa')][_0x9105('0x89')](),_0x9105('0xab'))['field'](_0x2c0bc6[_0x9105('0x4f')]['id'][_0x9105('0x89')](),'VoiceQueueId')[_0x9105('0x82')]('\x27'+_0x324232+'\x27',_0x9105('0xa5'))[_0x9105('0x82')]('\x27'+_0x324232+'\x27',_0x9105('0x5d'))[_0x9105('0x84')](_0x9105('0xac'))[_0x9105('0x48')]('deletedAt\x20IS\x20NULL')[_0x9105('0x48')](_0x9105('0xad'),_0x29d928[_0x9105('0xaa')][_0x9105('0x89')]())[_0x9105('0x48')](_0x9105('0xae'))['where'](_0x9105('0xaf'),squel['select']()[_0x9105('0x82')](_0x9105('0xb0'))['from'](_0x9105('0xb1'))[_0x9105('0x48')](_0x9105('0x87'),_0x2c0bc6[_0x9105('0x4f')]['id'][_0x9105('0x89')]()))[_0x9105('0x48')](_0x9105('0xaf'),squel['select']()['field']('COALESCE(phone,\x27\x27)')['from'](_0x9105('0xa3'))[_0x9105('0x48')](_0x9105('0x87'),_0x2c0bc6[_0x9105('0x4f')]['id'][_0x9105('0x89')]())))[_0x9105('0x89')]();break;case _0x9105('0xb2'):_0x3d08cd=squel[_0x9105('0xa2')]()[_0x9105('0xb3')]('cm_hopper')['fromQuery'](['phone',_0x9105('0xa8'),_0x9105('0xa9'),'ListId',_0x9105('0x63'),_0x9105('0xa5'),'updatedAt'],squel['select']()[_0x9105('0x82')](_0x9105('0xa7'),_0x9105('0xa7'))[_0x9105('0x82')]('\x27'+_0x324232+'\x27',_0x9105('0xa8'))[_0x9105('0x82')]('id',_0x9105('0xa9'))['field'](_0x29d928[_0x9105('0xaa')][_0x9105('0x89')](),'ListId')[_0x9105('0x82')](_0x2c0bc6['params']['id'][_0x9105('0x89')](),_0x9105('0x63'))['field']('\x27'+_0x324232+'\x27','createdAt')[_0x9105('0x82')]('\x27'+_0x324232+'\x27',_0x9105('0x5d'))[_0x9105('0x84')](_0x9105('0xac'))['where'](_0x9105('0xb4'))['where'](_0x9105('0xad'),_0x29d928['CmListId'][_0x9105('0x89')]())[_0x9105('0x48')](_0x9105('0xae'))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x9105('0x82')](_0x9105('0xb5'))['from']('cm_hopper')[_0x9105('0x48')](_0x9105('0x87'),_0x2c0bc6[_0x9105('0x4f')]['id'][_0x9105('0x89')]())))[_0x9105('0x89')]();break;default:_0x3d08cd=squel[_0x9105('0xa2')]()['into'](_0x9105('0xa3'))[_0x9105('0xa4')]([_0x9105('0xa7'),_0x9105('0xa8'),_0x9105('0xa9'),'ListId',_0x9105('0x63'),_0x9105('0xa5'),_0x9105('0x5d')],squel[_0x9105('0xa6')]()[_0x9105('0x82')](_0x9105('0xa7'),_0x9105('0xa7'))[_0x9105('0x82')]('\x27'+_0x324232+'\x27',_0x9105('0xa8'))[_0x9105('0x82')]('id',_0x9105('0xa9'))[_0x9105('0x82')](_0x29d928[_0x9105('0xaa')][_0x9105('0x89')](),_0x9105('0xab'))[_0x9105('0x82')](_0x2c0bc6[_0x9105('0x4f')]['id'][_0x9105('0x89')](),_0x9105('0x63'))[_0x9105('0x82')]('\x27'+_0x324232+'\x27',_0x9105('0xa5'))['field']('\x27'+_0x324232+'\x27',_0x9105('0x5d'))[_0x9105('0x84')](_0x9105('0xac'))[_0x9105('0x48')](_0x9105('0xb4'))[_0x9105('0x48')](_0x9105('0xad'),_0x29d928['CmListId'][_0x9105('0x89')]())[_0x9105('0x48')](_0x9105('0xae')))['toString']();}_0x1abca6['push'](db['sequelize']['query'](_0x3d08cd));}return BPromise['all'](_0x1abca6);}})[_0x9105('0x27')](function(){var _0x4f8b35=[];var _0x5e81fe=squel[_0x9105('0xa2')]()[_0x9105('0xb3')](_0x9105('0xb6'))['fromQuery'](['CmHopperId',_0x9105('0xa7'),_0x9105('0xb7'),_0x9105('0xa5'),_0x9105('0x5d')],squel['select']()[_0x9105('0x82')](_0x9105('0xb8'))[_0x9105('0x82')](_0x9105('0xb9'))[_0x9105('0x82')](_0x9105('0xba'))['field']('\x27'+_0x324232+'\x27',_0x9105('0xa5'))[_0x9105('0x82')]('\x27'+_0x324232+'\x27',_0x9105('0x5d'))[_0x9105('0x84')](_0x9105('0xbb'),'ci')[_0x9105('0x85')](_0x9105('0xa3'),'h',_0x9105('0xbc'))[_0x9105('0x48')](_0x9105('0xbd'),_0x324232)['where'](_0x9105('0xbe'),'PHONE'))['toString']();_0x4f8b35['push'](db[_0x9105('0x73')][_0x9105('0x3d')](_0x5e81fe));return BPromise[_0x9105('0x8e')](_0x4f8b35);})[_0x9105('0x27')](function(){return _0x1ada72;})[_0x9105('0x27')](respondWithResult(_0x29f6f6,null))[_0x9105('0x51')](handleError(_0x29f6f6,null));};exports['removeLists']=function(_0x1cf40f,_0x410c66,_0x179c75){return db['VoiceQueue'][_0x9105('0x31')]({'where':{'id':_0x1cf40f[_0x9105('0x4f')]['id']}})['then'](handleEntityNotFound(_0x410c66,null))['then'](function(_0xe1d895){if(_0xe1d895){return _0xe1d895[_0x9105('0xbf')](_0x1cf40f['query'][_0x9105('0x80')]);}})[_0x9105('0x27')](function(_0x40511a){if(_0x40511a){return db['CmHopper'][_0x9105('0x28')]({'where':{'ListId':_0x1cf40f[_0x9105('0x3d')][_0x9105('0x80')],'VoiceQueueId':_0x1cf40f['params']['id']}})[_0x9105('0x27')](function(){return _0x40511a;});}})[_0x9105('0x27')](respondWithStatusCode(_0x410c66,null))[_0x9105('0x51')](handleError(_0x410c66,null));};exports[_0x9105('0xc0')]=function(_0x5bd3bb,_0x4fe6cb,_0x5cc5ec){var _0x1f66d0={};var _0x21bc37={};var _0x3e9cee;var _0x169711;return db[_0x9105('0x38')]['findOne']({'where':{'id':_0x5bd3bb[_0x9105('0x4f')]['id']}})[_0x9105('0x27')](handleEntityNotFound(_0x4fe6cb,null))[_0x9105('0x27')](function(_0x15cf2b){if(_0x15cf2b){_0x3e9cee=_0x15cf2b;_0x21bc37[_0x9105('0x3c')]=_[_0x9105('0x3e')](db['CmList'][_0x9105('0x39')]);_0x21bc37[_0x9105('0x3d')]=_[_0x9105('0x3e')](_0x5bd3bb['query']);_0x21bc37[_0x9105('0x3f')]=_[_0x9105('0x40')](_0x21bc37[_0x9105('0x3c')],_0x21bc37[_0x9105('0x3d')]);_0x1f66d0['attributes']=_['intersection'](_0x21bc37[_0x9105('0x3c')],qs[_0x9105('0x42')](_0x5bd3bb[_0x9105('0x3d')]['fields']));_0x1f66d0[_0x9105('0x41')]=_0x1f66d0['attributes'][_0x9105('0x43')]?_0x1f66d0['attributes']:_0x21bc37['model'];_0x1f66d0[_0x9105('0x46')]=qs[_0x9105('0x47')](_0x5bd3bb[_0x9105('0x3d')]['sort']);_0x1f66d0[_0x9105('0x48')]=qs[_0x9105('0x3f')](_[_0x9105('0x62')](_0x5bd3bb[_0x9105('0x3d')],_0x21bc37[_0x9105('0x3f')]));if(_0x5bd3bb[_0x9105('0x3d')][_0x9105('0x2d')]){_0x1f66d0['where']=_[_0x9105('0x49')](_0x1f66d0['where'],{'$or':_['map'](_0x1f66d0[_0x9105('0x41')],function(_0x54856){var _0x210812={};_0x210812[_0x54856]={'$like':'%'+_0x5bd3bb[_0x9105('0x3d')][_0x9105('0x2d')]+'%'};return _0x210812;})});}_0x1f66d0=_[_0x9105('0x49')]({},_0x1f66d0,_0x5bd3bb[_0x9105('0x4b')]);return _0x3e9cee[_0x9105('0xc0')](_0x1f66d0);}})[_0x9105('0x27')](function(_0xa00f1){if(_0xa00f1){_0x169711=_0xa00f1[_0x9105('0x43')];if(!_0x5bd3bb['query'][_0x9105('0x44')](_0x9105('0x45'))){_0x1f66d0[_0x9105('0x20')]=qs[_0x9105('0x20')](_0x5bd3bb[_0x9105('0x3d')][_0x9105('0x20')]);_0x1f66d0[_0x9105('0x1d')]=qs[_0x9105('0x1d')](_0x5bd3bb[_0x9105('0x3d')][_0x9105('0x1d')]);}return _0x3e9cee[_0x9105('0xc0')](_0x1f66d0);}})['then'](function(_0x4e9ce7){if(_0x4e9ce7){return _0x4e9ce7?{'count':_0x169711,'rows':_0x4e9ce7}:null;}})[_0x9105('0x27')](respondWithResult(_0x4fe6cb,null))[_0x9105('0x51')](handleError(_0x4fe6cb,null));};exports[_0x9105('0xc1')]=function(_0x1dcda9,_0x1b6cd8,_0x370771){var _0x247fba,_0x51c514;return db[_0x9105('0x38')][_0x9105('0x31')]({'where':{'id':_0x1dcda9[_0x9105('0x4f')]['id']}})[_0x9105('0x27')](handleEntityNotFound(_0x1b6cd8,null))[_0x9105('0x27')](function(_0x251b23){if(_0x251b23){_0x51c514=_0x251b23;return _0x251b23[_0x9105('0xc1')](_0x1dcda9['body'][_0x9105('0x80')],_[_0x9105('0x5f')](_0x1dcda9[_0x9105('0x5e')],[_0x9105('0x80'),'id'])||{});}return null;})['spread'](function(_0x392a90){var _0x546664;_0x247fba=_0x392a90||[];var _0x338f60=[];if(_0x392a90){for(var _0x1d9021=0x0;_0x1d9021<_0x392a90['length'];_0x1d9021+=0x1){var _0x1cd665=_0x392a90[_0x1d9021][_0x9105('0x29')]({'plain':!![]});_0x546664=squel[_0x9105('0xa2')]()[_0x9105('0xb3')](_0x9105('0xc2'))[_0x9105('0xa4')]([_0x9105('0xa7'),_0x9105('0xa9'),_0x9105('0xab'),_0x9105('0x63'),'createdAt',_0x9105('0x5d')],squel['select']()[_0x9105('0x82')](_0x9105('0xa7'),'phone')['field']('id',_0x9105('0xa9'))[_0x9105('0x82')](_0x1cd665['CmListId'][_0x9105('0x89')](),_0x9105('0xab'))[_0x9105('0x82')](_0x1dcda9[_0x9105('0x4f')]['id'][_0x9105('0x89')](),_0x9105('0x63'))[_0x9105('0x82')]('NOW()','createdAt')[_0x9105('0x82')](_0x9105('0xc3'),'updatedAt')[_0x9105('0x84')](_0x9105('0xac'))[_0x9105('0x48')](_0x9105('0xb4'))[_0x9105('0x48')](_0x9105('0xad'),_0x1cd665[_0x9105('0xaa')][_0x9105('0x89')]())[_0x9105('0x48')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x338f60[_0x9105('0x96')](db['sequelize'][_0x9105('0x3d')](_0x546664));}return BPromise[_0x9105('0x8e')](_0x338f60);}})[_0x9105('0x27')](function(){return _0x247fba;})[_0x9105('0x27')](respondWithResult(_0x1b6cd8,null))[_0x9105('0x51')](handleError(_0x1b6cd8,null));};exports[_0x9105('0xc4')]=function(_0x355baa,_0x3c9f67,_0x4e20b6){return db['VoiceQueue'][_0x9105('0x31')]({'where':{'id':_0x355baa[_0x9105('0x4f')]['id']}})[_0x9105('0x27')](handleEntityNotFound(_0x3c9f67,null))[_0x9105('0x27')](function(_0x1045c3){if(_0x1045c3){return _0x1045c3['removeBlackLists'](_0x355baa[_0x9105('0x3d')][_0x9105('0x80')]);}})[_0x9105('0x27')](function(_0x108042){if(_0x108042){return db[_0x9105('0x69')][_0x9105('0x28')]({'where':{'ListId':_0x355baa[_0x9105('0x3d')][_0x9105('0x80')],'VoiceQueueId':_0x355baa['params']['id']}})[_0x9105('0x27')](function(){return _0x108042;});}})['then'](respondWithStatusCode(_0x3c9f67,null))['catch'](handleError(_0x3c9f67,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 5719fad..12c38e5 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 _0x0360=['exports','events','../../mysqldb','VoiceQueue','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x47ea2b,_0x23ec13){var _0x214d98=function(_0x1b4caa){while(--_0x1b4caa){_0x47ea2b['push'](_0x47ea2b['shift']());}};_0x214d98(++_0x23ec13);}(_0x0360,0x139));var _0x0036=function(_0x21bea9,_0x40d301){_0x21bea9=_0x21bea9-0x0;var _0x487aa3=_0x0360[_0x21bea9];return _0x487aa3;};'use strict';var EventEmitter=require(_0x0036('0x0'));var VoiceQueue=require(_0x0036('0x1'))['db'][_0x0036('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x0036('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0036('0x4')};function emitEvent(_0x49a18d){return function(_0x5caa9b,_0x4a612f,_0x3c476c){VoiceQueueEvents[_0x0036('0x5')](_0x49a18d+':'+_0x5caa9b['id'],_0x5caa9b);VoiceQueueEvents[_0x0036('0x5')](_0x49a18d,_0x5caa9b);_0x3c476c(null);};}for(var e in events){if(events[_0x0036('0x6')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0x0036('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0x1025=['remove','emit','hook','exports','events','../../mysqldb'];(function(_0x4fbff3,_0x484761){var _0x68b35a=function(_0x58c052){while(--_0x58c052){_0x4fbff3['push'](_0x4fbff3['shift']());}};_0x68b35a(++_0x484761);}(_0x1025,0x142));var _0x5102=function(_0x3a23b4,_0x49d839){_0x3a23b4=_0x3a23b4-0x0;var _0x302bca=_0x1025[_0x3a23b4];return _0x302bca;};'use strict';var EventEmitter=require(_0x5102('0x0'));var VoiceQueue=require(_0x5102('0x1'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x5102('0x2')};function emitEvent(_0x223093){return function(_0x5aba01,_0x1aa5f7,_0x387956){VoiceQueueEvents[_0x5102('0x3')](_0x223093+':'+_0x5aba01['id'],_0x5aba01);VoiceQueueEvents[_0x5102('0x3')](_0x223093,_0x5aba01);_0x387956(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x5102('0x4')](e,emitEvent(event));}}module[_0x5102('0x5')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index e48cf74..8845a70 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 _0x70e0=['voice_queues','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','./voiceQueue.attributes'];(function(_0x5d0207,_0xee695a){var _0x440b63=function(_0x1eb40e){while(--_0x1eb40e){_0x5d0207['push'](_0x5d0207['shift']());}};_0x440b63(++_0xee695a);}(_0x70e0,0x17b));var _0x070e=function(_0x488b95,_0x40db71){_0x488b95=_0x488b95-0x0;var _0x41e742=_0x70e0[_0x488b95];return _0x41e742;};'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']('VoiceQueue',attributes,{'tableName':_0x070e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x3cc4c8,_0x114636){var _0xdc0123=function(_0x1c3078){while(--_0x1c3078){_0x3cc4c8['push'](_0x3cc4c8['shift']());}};_0xdc0123(++_0x114636);}(_0x008c,0x188));var _0xc008=function(_0x3008b1,_0x2a89f){_0x3008b1=_0x3008b1-0x0;var _0x1922d9=_0x008c[_0x3008b1];return _0x1922d9;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('VoiceQueue',attributes,{'tableName':_0xc008('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 9332e07..d782209 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 _0x4e5a=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','where','limit','include','model','attributes','map','find','ShowVoiceQueue','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x43a5ee,_0x12ef80){var _0x4dcb0b=function(_0x1dc776){while(--_0x1dc776){_0x43a5ee['push'](_0x43a5ee['shift']());}};_0x4dcb0b(++_0x12ef80);}(_0x4e5a,0x1e7));var _0xa4e5=function(_0x160814,_0x57b5c6){_0x160814=_0x160814-0x0;var _0x427a69=_0x4e5a[_0x160814];return _0x427a69;};'use strict';var _=require(_0xa4e5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa4e5('0x1'));var rs=require(_0xa4e5('0x2'));var fs=require('fs');var Redis=require(_0xa4e5('0x3'));var db=require(_0xa4e5('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa4e5('0x5'))(_0xa4e5('0x6'));var config=require(_0xa4e5('0x7'));var jayson=require(_0xa4e5('0x8'));var client=jayson['client'][_0xa4e5('0x9')]({'port':0x232a});config[_0xa4e5('0xa')]=_[_0xa4e5('0xb')](config[_0xa4e5('0xa')],{'host':_0xa4e5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4e5('0xa')]));require(_0xa4e5('0xd'))[_0xa4e5('0xe')](socket);function respondWithRpcPromise(_0x311e0a,_0x2bc7f2,_0x42ca60){return new BPromise(function(_0x3a2397,_0x13a10c){return client[_0xa4e5('0xf')](_0x311e0a,_0x42ca60)[_0xa4e5('0x10')](function(_0x48cd92){logger[_0xa4e5('0x11')](_0xa4e5('0x12'),_0x2bc7f2,_0xa4e5('0x13'));logger['debug'](_0xa4e5('0x14'),_0x2bc7f2,_0xa4e5('0x13'),JSON[_0xa4e5('0x15')](_0x48cd92));if(_0x48cd92['error']){if(_0x48cd92[_0xa4e5('0x16')][_0xa4e5('0x17')]===0x1f4){logger[_0xa4e5('0x16')](_0xa4e5('0x12'),_0x2bc7f2,_0x48cd92[_0xa4e5('0x16')][_0xa4e5('0x18')]);return _0x13a10c(_0x48cd92[_0xa4e5('0x16')]['message']);}logger[_0xa4e5('0x16')](_0xa4e5('0x12'),_0x2bc7f2,_0x48cd92[_0xa4e5('0x16')][_0xa4e5('0x18')]);return _0x3a2397(_0x48cd92[_0xa4e5('0x16')][_0xa4e5('0x18')]);}else{logger[_0xa4e5('0x11')](_0xa4e5('0x12'),_0x2bc7f2,'request\x20sent');_0x3a2397(_0x48cd92[_0xa4e5('0x19')][_0xa4e5('0x18')]);}})[_0xa4e5('0x1a')](function(_0x576138){logger[_0xa4e5('0x16')](_0xa4e5('0x12'),_0x2bc7f2,_0x576138);_0x13a10c(_0x576138);});});}exports[_0xa4e5('0x1b')]=function(_0x2041af){var _0x707c7=this;return new Promise(function(_0x4c30b2,_0x502478){return db[_0xa4e5('0x1c')][_0xa4e5('0x1d')]({'raw':_0x2041af[_0xa4e5('0x1e')]?_0x2041af['options'][_0xa4e5('0x1f')]===undefined?!![]:![]:!![],'where':_0x2041af['options']?_0x2041af[_0xa4e5('0x1e')][_0xa4e5('0x20')]||null:null,'attributes':_0x2041af[_0xa4e5('0x1e')]?_0x2041af[_0xa4e5('0x1e')]['attributes']||null:null,'limit':_0x2041af[_0xa4e5('0x1e')]?_0x2041af[_0xa4e5('0x1e')][_0xa4e5('0x21')]||null:null,'include':_0x2041af[_0xa4e5('0x1e')]?_0x2041af[_0xa4e5('0x1e')][_0xa4e5('0x22')]?_['map'](_0x2041af[_0xa4e5('0x1e')][_0xa4e5('0x22')],function(_0x9b1e69){return{'model':db[_0x9b1e69[_0xa4e5('0x23')]],'as':_0x9b1e69['as'],'attributes':_0x9b1e69[_0xa4e5('0x24')],'include':_0x9b1e69[_0xa4e5('0x22')]?_[_0xa4e5('0x25')](_0x9b1e69[_0xa4e5('0x22')],function(_0x4d4719){return{'model':db[_0x4d4719[_0xa4e5('0x23')]],'as':_0x4d4719['as'],'attributes':_0x4d4719[_0xa4e5('0x24')],'include':_0x4d4719[_0xa4e5('0x22')]?_[_0xa4e5('0x25')](_0x4d4719[_0xa4e5('0x22')],function(_0x4ce3e7){return{'model':db[_0x4ce3e7[_0xa4e5('0x23')]],'as':_0x4ce3e7['as'],'attributes':_0x4ce3e7[_0xa4e5('0x24')]};}):[]};}):[]};}):[]:[]})[_0xa4e5('0x10')](function(_0x213308){logger[_0xa4e5('0x11')](_0xa4e5('0x1b'),_0x2041af);logger['debug'](_0xa4e5('0x1b'),_0x2041af,JSON[_0xa4e5('0x15')](_0x213308));_0x4c30b2(_0x213308);})[_0xa4e5('0x1a')](function(_0x28859a){logger[_0xa4e5('0x16')](_0xa4e5('0x1b'),_0x28859a[_0xa4e5('0x18')],_0x2041af);_0x502478(_0x707c7['error'](0x1f4,_0x28859a[_0xa4e5('0x18')]));});});};exports['ShowVoiceQueue']=function(_0x166074){var _0x30ab57=this;return new Promise(function(_0xe596d4,_0x51ab72){return db[_0xa4e5('0x1c')][_0xa4e5('0x26')]({'raw':_0x166074[_0xa4e5('0x1e')]?_0x166074[_0xa4e5('0x1e')][_0xa4e5('0x1f')]===undefined?!![]:![]:!![],'where':_0x166074[_0xa4e5('0x1e')]?_0x166074[_0xa4e5('0x1e')][_0xa4e5('0x20')]||null:null,'attributes':_0x166074[_0xa4e5('0x1e')]?_0x166074[_0xa4e5('0x1e')][_0xa4e5('0x24')]||null:null,'include':_0x166074['options']?_0x166074['options']['include']?_[_0xa4e5('0x25')](_0x166074[_0xa4e5('0x1e')]['include'],function(_0x2c823a){return{'model':db[_0x2c823a['model']],'as':_0x2c823a['as'],'attributes':_0x2c823a[_0xa4e5('0x24')],'include':_0x2c823a[_0xa4e5('0x22')]?_[_0xa4e5('0x25')](_0x2c823a['include'],function(_0x313156){return{'model':db[_0x313156[_0xa4e5('0x23')]],'as':_0x313156['as'],'attributes':_0x313156['attributes'],'include':_0x313156['include']?_[_0xa4e5('0x25')](_0x313156[_0xa4e5('0x22')],function(_0x56aadc){return{'model':db[_0x56aadc[_0xa4e5('0x23')]],'as':_0x56aadc['as'],'attributes':_0x56aadc[_0xa4e5('0x24')]};}):[]};}):[]};}):[]:[]})[_0xa4e5('0x10')](function(_0x220b25){logger[_0xa4e5('0x11')](_0xa4e5('0x27'),_0x166074);logger[_0xa4e5('0x28')]('ShowVoiceQueue',_0x166074,JSON[_0xa4e5('0x15')](_0x220b25));_0xe596d4(_0x220b25);})[_0xa4e5('0x1a')](function(_0x10cca8){logger[_0xa4e5('0x16')](_0xa4e5('0x27'),_0x10cca8[_0xa4e5('0x18')],_0x166074);_0x51ab72(_0x30ab57[_0xa4e5('0x16')](0x1f4,_0x10cca8[_0xa4e5('0x18')]));});});}; \ No newline at end of file +var _0xdfed=['VoiceQueue,\x20%s,\x20%s','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetVoiceQueue','VoiceQueue','findAll','options','raw','attributes','limit','map','include','model','ShowVoiceQueue','where','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','./voiceQueue.socket','request','then','info'];(function(_0x5eb250,_0x10e901){var _0xdab1b2=function(_0x5131fe){while(--_0x5131fe){_0x5eb250['push'](_0x5eb250['shift']());}};_0xdab1b2(++_0x10e901);}(_0xdfed,0x155));var _0xddfe=function(_0x39d711,_0xe11eb7){_0x39d711=_0x39d711-0x0;var _0xee1d0c=_0xdfed[_0x39d711];return _0xee1d0c;};'use strict';var _=require(_0xddfe('0x0'));var util=require(_0xddfe('0x1'));var moment=require(_0xddfe('0x2'));var BPromise=require(_0xddfe('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddfe('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xddfe('0x5'));var logger=require(_0xddfe('0x6'))(_0xddfe('0x7'));var config=require(_0xddfe('0x8'));var jayson=require(_0xddfe('0x9'));var client=jayson['client'][_0xddfe('0xa')]({'port':0x232a});config['redis']=_[_0xddfe('0xb')](config[_0xddfe('0xc')],{'host':_0xddfe('0xd'),'port':0x18eb});var socket=require(_0xddfe('0xe'))(new Redis(config[_0xddfe('0xc')]));require(_0xddfe('0xf'))['register'](socket);function respondWithRpcPromise(_0x35be61,_0x5531d7,_0x40fe39){return new BPromise(function(_0x30cb75,_0x56a254){return client[_0xddfe('0x10')](_0x35be61,_0x40fe39)[_0xddfe('0x11')](function(_0x4c4b78){logger[_0xddfe('0x12')](_0xddfe('0x13'),_0x5531d7,'request\x20sent');logger[_0xddfe('0x14')](_0xddfe('0x15'),_0x5531d7,_0xddfe('0x16'),JSON[_0xddfe('0x17')](_0x4c4b78));if(_0x4c4b78[_0xddfe('0x18')]){if(_0x4c4b78[_0xddfe('0x18')]['code']===0x1f4){logger[_0xddfe('0x18')](_0xddfe('0x13'),_0x5531d7,_0x4c4b78['error'][_0xddfe('0x19')]);return _0x56a254(_0x4c4b78[_0xddfe('0x18')][_0xddfe('0x19')]);}logger['error'](_0xddfe('0x13'),_0x5531d7,_0x4c4b78['error'][_0xddfe('0x19')]);return _0x30cb75(_0x4c4b78[_0xddfe('0x18')]['message']);}else{logger[_0xddfe('0x12')](_0xddfe('0x13'),_0x5531d7,_0xddfe('0x16'));_0x30cb75(_0x4c4b78[_0xddfe('0x1a')][_0xddfe('0x19')]);}})[_0xddfe('0x1b')](function(_0x5dd6dd){logger[_0xddfe('0x18')](_0xddfe('0x13'),_0x5531d7,_0x5dd6dd);_0x56a254(_0x5dd6dd);});});}exports[_0xddfe('0x1c')]=function(_0x28cd10){var _0x11b2c0=this;return new Promise(function(_0xe78125,_0x114a6b){return db[_0xddfe('0x1d')][_0xddfe('0x1e')]({'raw':_0x28cd10['options']?_0x28cd10[_0xddfe('0x1f')][_0xddfe('0x20')]===undefined?!![]:![]:!![],'where':_0x28cd10[_0xddfe('0x1f')]?_0x28cd10[_0xddfe('0x1f')]['where']||null:null,'attributes':_0x28cd10[_0xddfe('0x1f')]?_0x28cd10[_0xddfe('0x1f')][_0xddfe('0x21')]||null:null,'limit':_0x28cd10[_0xddfe('0x1f')]?_0x28cd10[_0xddfe('0x1f')][_0xddfe('0x22')]||null:null,'include':_0x28cd10[_0xddfe('0x1f')]?_0x28cd10[_0xddfe('0x1f')]['include']?_[_0xddfe('0x23')](_0x28cd10['options'][_0xddfe('0x24')],function(_0x227053){return{'model':db[_0x227053[_0xddfe('0x25')]],'as':_0x227053['as'],'attributes':_0x227053[_0xddfe('0x21')],'include':_0x227053['include']?_[_0xddfe('0x23')](_0x227053[_0xddfe('0x24')],function(_0x3c01cf){return{'model':db[_0x3c01cf['model']],'as':_0x3c01cf['as'],'attributes':_0x3c01cf[_0xddfe('0x21')],'include':_0x3c01cf[_0xddfe('0x24')]?_[_0xddfe('0x23')](_0x3c01cf[_0xddfe('0x24')],function(_0x376b84){return{'model':db[_0x376b84[_0xddfe('0x25')]],'as':_0x376b84['as'],'attributes':_0x376b84[_0xddfe('0x21')]};}):[]};}):[]};}):[]:[]})[_0xddfe('0x11')](function(_0x52bcab){logger[_0xddfe('0x12')]('GetVoiceQueue',_0x28cd10);logger[_0xddfe('0x14')](_0xddfe('0x1c'),_0x28cd10,JSON[_0xddfe('0x17')](_0x52bcab));_0xe78125(_0x52bcab);})['catch'](function(_0x804be4){logger[_0xddfe('0x18')](_0xddfe('0x1c'),_0x804be4[_0xddfe('0x19')],_0x28cd10);_0x114a6b(_0x11b2c0[_0xddfe('0x18')](0x1f4,_0x804be4[_0xddfe('0x19')]));});});};exports[_0xddfe('0x26')]=function(_0x48cb72){var _0x1b98e4=this;return new Promise(function(_0x22972c,_0xf167b1){return db[_0xddfe('0x1d')]['find']({'raw':_0x48cb72['options']?_0x48cb72['options'][_0xddfe('0x20')]===undefined?!![]:![]:!![],'where':_0x48cb72['options']?_0x48cb72[_0xddfe('0x1f')][_0xddfe('0x27')]||null:null,'attributes':_0x48cb72[_0xddfe('0x1f')]?_0x48cb72[_0xddfe('0x1f')][_0xddfe('0x21')]||null:null,'include':_0x48cb72[_0xddfe('0x1f')]?_0x48cb72[_0xddfe('0x1f')]['include']?_[_0xddfe('0x23')](_0x48cb72[_0xddfe('0x1f')][_0xddfe('0x24')],function(_0x4a2263){return{'model':db[_0x4a2263[_0xddfe('0x25')]],'as':_0x4a2263['as'],'attributes':_0x4a2263[_0xddfe('0x21')],'include':_0x4a2263['include']?_[_0xddfe('0x23')](_0x4a2263[_0xddfe('0x24')],function(_0x3010ae){return{'model':db[_0x3010ae[_0xddfe('0x25')]],'as':_0x3010ae['as'],'attributes':_0x3010ae['attributes'],'include':_0x3010ae['include']?_['map'](_0x3010ae[_0xddfe('0x24')],function(_0x1cf661){return{'model':db[_0x1cf661[_0xddfe('0x25')]],'as':_0x1cf661['as'],'attributes':_0x1cf661[_0xddfe('0x21')]};}):[]};}):[]};}):[]:[]})[_0xddfe('0x11')](function(_0x41ebae){logger['info'](_0xddfe('0x26'),_0x48cb72);logger[_0xddfe('0x14')](_0xddfe('0x26'),_0x48cb72,JSON[_0xddfe('0x17')](_0x41ebae));_0x22972c(_0x41ebae);})[_0xddfe('0x1b')](function(_0x41cb60){logger[_0xddfe('0x18')]('ShowVoiceQueue',_0x41cb60['message'],_0x48cb72);_0xf167b1(_0x1b98e4[_0xddfe('0x18')](0x1f4,_0x41cb60[_0xddfe('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 2da78e9..3d3c23e 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 _0x4c4d=['save','remove','emit','removeListener','register','length','voiceQueue:'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4c4d,0x1e3));var _0xd4c4=function(_0x162404,_0x3903c7){_0x162404=_0x162404-0x0;var _0x1d7869=_0x4c4d[_0x162404];return _0x1d7869;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0xd4c4('0x0'),_0xd4c4('0x1'),'update'];function createListener(_0x29cba5,_0x3b3462){return function(_0x362f17){_0x3b3462[_0xd4c4('0x2')](_0x29cba5,_0x362f17);};}function removeListener(_0x248992,_0x1fc186){return function(){VoiceQueueEvents[_0xd4c4('0x3')](_0x248992,_0x1fc186);};}exports[_0xd4c4('0x4')]=function(_0xd9811e){for(var _0x202ff1=0x0,_0x5d3325=events[_0xd4c4('0x5')];_0x202ff1<_0x5d3325;_0x202ff1++){var _0x25c82b=events[_0x202ff1];var _0x2ce6fd=createListener(_0xd4c4('0x6')+_0x25c82b,_0xd9811e);VoiceQueueEvents['on'](_0x25c82b,_0x2ce6fd);}}; \ No newline at end of file +var _0x8075=['voiceQueue:','./voiceQueue.events','update','emit','removeListener','register','length'];(function(_0x557dc4,_0x2c86c6){var _0x51e824=function(_0x2a13f9){while(--_0x2a13f9){_0x557dc4['push'](_0x557dc4['shift']());}};_0x51e824(++_0x2c86c6);}(_0x8075,0x120));var _0x5807=function(_0xdeaa59,_0x397809){_0xdeaa59=_0xdeaa59-0x0;var _0x21b7ae=_0x8075[_0xdeaa59];return _0x21b7ae;};'use strict';var VoiceQueueEvents=require(_0x5807('0x0'));var events=['save','remove',_0x5807('0x1')];function createListener(_0x555b79,_0x17ceb5){return function(_0x5a8c43){_0x17ceb5[_0x5807('0x2')](_0x555b79,_0x5a8c43);};}function removeListener(_0x9c8446,_0x1e29f0){return function(){VoiceQueueEvents[_0x5807('0x3')](_0x9c8446,_0x1e29f0);};}exports[_0x5807('0x4')]=function(_0xfc5b6c){for(var _0x505112=0x0,_0x1adc08=events[_0x5807('0x5')];_0x505112<_0x1adc08;_0x505112++){var _0x15a206=events[_0x505112];var _0x484073=createListener(_0x5807('0x6')+_0x15a206,_0xfc5b6c);VoiceQueueEvents['on'](_0x15a206,_0x484073);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index aab729e..495df8c 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 _0x2529=['/describe','describe','/index','get','/:id','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voiceQueueReport.controller','isAuthenticated','index'];(function(_0x4d5e1a,_0x267064){var _0x4b1085=function(_0x1dea8c){while(--_0x1dea8c){_0x4d5e1a['push'](_0x4d5e1a['shift']());}};_0x4b1085(++_0x267064);}(_0x2529,0x98));var _0x9252=function(_0x1bfc52,_0x3ad80a){_0x1bfc52=_0x1bfc52-0x0;var _0xf287d8=_0x2529[_0x1bfc52];return _0xf287d8;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9252('0x0'));var timeout=require(_0x9252('0x1'));var express=require(_0x9252('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9252('0x3'));var interaction=require(_0x9252('0x4'));var config=require('../../config/environment');var controller=require(_0x9252('0x5'));router['get']('/',auth[_0x9252('0x6')](),controller[_0x9252('0x7')]);router['get'](_0x9252('0x8'),auth[_0x9252('0x6')](),controller[_0x9252('0x9')]);router['get'](_0x9252('0xa'),auth[_0x9252('0x6')](),controller['getVoiceQueuesReport']);router[_0x9252('0xb')](_0x9252('0xc'),auth[_0x9252('0x6')](),controller['show']);router[_0x9252('0xd')]('/',auth[_0x9252('0x6')](),controller[_0x9252('0xe')]);router[_0x9252('0xf')]('/:id',auth[_0x9252('0x6')](),controller[_0x9252('0x10')]);router[_0x9252('0x11')]('/:id',auth[_0x9252('0x6')](),controller[_0x9252('0x12')]);module[_0x9252('0x13')]=router; \ No newline at end of file +var _0x07aa=['put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','describe','/index','getVoiceQueuesReport','show','create'];(function(_0x394571,_0x48d0d0){var _0x3b0f9b=function(_0x380683){while(--_0x380683){_0x394571['push'](_0x394571['shift']());}};_0x3b0f9b(++_0x48d0d0);}(_0x07aa,0x1ba));var _0xa07a=function(_0x462bf7,_0x4855bc){_0x462bf7=_0x462bf7-0x0;var _0x553571=_0x07aa[_0x462bf7];return _0x553571;};'use strict';var multer=require(_0xa07a('0x0'));var util=require(_0xa07a('0x1'));var path=require(_0xa07a('0x2'));var timeout=require(_0xa07a('0x3'));var express=require(_0xa07a('0x4'));var router=express[_0xa07a('0x5')]();var fs_extra=require(_0xa07a('0x6'));var auth=require(_0xa07a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa07a('0x8'));var controller=require(_0xa07a('0x9'));router[_0xa07a('0xa')]('/',auth[_0xa07a('0xb')](),controller[_0xa07a('0xc')]);router['get']('/describe',auth[_0xa07a('0xb')](),controller[_0xa07a('0xd')]);router[_0xa07a('0xa')](_0xa07a('0xe'),auth['isAuthenticated'](),controller[_0xa07a('0xf')]);router[_0xa07a('0xa')]('/:id',auth[_0xa07a('0xb')](),controller[_0xa07a('0x10')]);router['post']('/',auth[_0xa07a('0xb')](),controller[_0xa07a('0x11')]);router[_0xa07a('0x12')](_0xa07a('0x13'),auth[_0xa07a('0xb')](),controller[_0xa07a('0x14')]);router[_0xa07a('0x15')](_0xa07a('0x13'),auth[_0xa07a('0xb')](),controller['destroy']);module[_0xa07a('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index a61de86..9371793 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 _0x8543=['exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment'];(function(_0x3d5a58,_0x51c353){var _0x3b6ce4=function(_0x24c449){while(--_0x24c449){_0x3d5a58['push'](_0x3d5a58['shift']());}};_0x3b6ce4(++_0x51c353);}(_0x8543,0x10f));var _0x3854=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x8543[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3854('0x0'));module[_0x3854('0x1')]={'type':{'type':Sequelize[_0x3854('0x2')]},'uniqueid':{'type':Sequelize[_0x3854('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x3854('0x2')]},'queue':{'type':Sequelize[_0x3854('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x3854('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x3854('0x3')],'set':function(_0x5b85e5){var _0x3f9d0e=moment(_0x5b85e5);var _0x1a24c3=moment(this[_0x3854('0x4')](_0x3854('0x5')))[_0x3854('0x6')](_0x3854('0x7'));var _0x21b431=_0x3f9d0e[_0x3854('0x8')](_0x1a24c3,_0x3854('0x9'));this['setDataValue'](_0x3854('0xa'),_0x5b85e5);this[_0x3854('0xb')](_0x3854('0xc'),_0x21b431||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x3854('0xd')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x3854('0x3')]},'queuecallercomplete':{'type':Sequelize[_0x3854('0xe')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x3854('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x3854('0x2')],'comment':_0x3854('0xf')},'originalposition':{'type':Sequelize[_0x3854('0xd')]},'channel':{'type':Sequelize[_0x3854('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3854('0x2')]},'connectedlinename':{'type':Sequelize[_0x3854('0x2')]},'accountcode':{'type':Sequelize[_0x3854('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x3854('0x2')]},'priority':{'type':Sequelize[_0x3854('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x3854('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3854('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x3854('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3854('0x2')],'comment':_0x3854('0x10')},'transferexten':{'type':Sequelize[_0x3854('0x2')]},'transferuniqueid':{'type':Sequelize[_0x3854('0x2')]},'disposition':{'type':Sequelize[_0x3854('0x2')]},'secondDisposition':{'type':Sequelize[_0x3854('0x2')]},'thirdDisposition':{'type':Sequelize[_0x3854('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x3854('0xd')],'defaultValue':0x0},'note':{'type':Sequelize[_0x3854('0x2')]}}; \ No newline at end of file +var _0x16b7=['BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','INTEGER','sequelize','moment','exports','STRING','DATE','getDataValue','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','holdtime'];(function(_0x6e1239,_0x3562ac){var _0x418150=function(_0x279f06){while(--_0x279f06){_0x6e1239['push'](_0x6e1239['shift']());}};_0x418150(++_0x3562ac);}(_0x16b7,0xd5));var _0x716b=function(_0x4ecba2,_0x387f1a){_0x4ecba2=_0x4ecba2-0x0;var _0x44ecac=_0x16b7[_0x4ecba2];return _0x44ecac;};'use strict';var Sequelize=require(_0x716b('0x0'));var moment=require(_0x716b('0x1'));module[_0x716b('0x2')]={'type':{'type':Sequelize[_0x716b('0x3')]},'uniqueid':{'type':Sequelize[_0x716b('0x3')]},'calleridnum':{'type':Sequelize[_0x716b('0x3')]},'calleridname':{'type':Sequelize[_0x716b('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x716b('0x4')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x17e12a){var _0x470d92=moment(_0x17e12a);var _0x27ad07=moment(this[_0x716b('0x5')]('queuecallerjoinAt'))['format'](_0x716b('0x6'));var _0x497fb0=_0x470d92[_0x716b('0x7')](_0x27ad07,_0x716b('0x8'));this['setDataValue']('queuecallerleaveAt',_0x17e12a);this[_0x716b('0x9')](_0x716b('0xa'),_0x497fb0||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize['INTEGER']},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0x716b('0xb')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x716b('0x4')]},'queuecallerexitreason':{'type':Sequelize[_0x716b('0x3')],'comment':_0x716b('0xc')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x716b('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x716b('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x716b('0x3')]},'holdtime':{'type':Sequelize[_0x716b('0xd')]},'mohtime':{'type':Sequelize[_0x716b('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x716b('0xb')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x716b('0x3')]},'transfer':{'type':Sequelize[_0x716b('0xb')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x716b('0x3')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x716b('0x3')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x716b('0x3')]},'secondDisposition':{'type':Sequelize[_0x716b('0x3')]},'thirdDisposition':{'type':Sequelize[_0x716b('0x3')]},'queuecallerenterreason':{'type':Sequelize[_0x716b('0xd')],'defaultValue':0x0},'note':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index fc22f73..a6c88e8 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 _0x01fa=['redis','defaults','./voiceQueueReport.socket','register','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','update','then','destroy','error','name','index','VoiceQueueReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','show','params','length','find','create','body','catch','describe','getVoiceQueuesReport','include','rows','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3d2949,_0x509812){var _0x49953f=function(_0x394418){while(--_0x394418){_0x3d2949['push'](_0x3d2949['shift']());}};_0x49953f(++_0x509812);}(_0x01fa,0x132));var _0xa01f=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0x01fa[_0x2cfb58];return _0xd99951;};'use strict';var emlformat=require(_0xa01f('0x0'));var rimraf=require(_0xa01f('0x1'));var zipdir=require(_0xa01f('0x2'));var jsonpatch=require(_0xa01f('0x3'));var rp=require(_0xa01f('0x4'));var moment=require(_0xa01f('0x5'));var BPromise=require(_0xa01f('0x6'));var Mustache=require('mustache');var util=require(_0xa01f('0x7'));var path=require(_0xa01f('0x8'));var sox=require('sox');var csv=require(_0xa01f('0x9'));var ejs=require(_0xa01f('0xa'));var fs=require('fs');var fs_extra=require(_0xa01f('0xb'));var _=require(_0xa01f('0xc'));var squel=require(_0xa01f('0xd'));var crypto=require(_0xa01f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa01f('0xf'));var toCsv=require(_0xa01f('0x9'));var querystring=require(_0xa01f('0x10'));var Papa=require(_0xa01f('0x11'));var Redis=require('ioredis');var authService=require(_0xa01f('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa01f('0x13'));var logger=require(_0xa01f('0x14'))(_0xa01f('0x15'));var utils=require(_0xa01f('0x16'));var config=require(_0xa01f('0x17'));var licenseUtil=require(_0xa01f('0x18'));var db=require(_0xa01f('0x19'))['db'];config[_0xa01f('0x1a')]=_[_0xa01f('0x1b')](config[_0xa01f('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa01f('0x1a')]));require(_0xa01f('0x1c'))[_0xa01f('0x1d')](socket);function respondWithStatusCode(_0x54fae1,_0x3384d8){_0x3384d8=_0x3384d8||0xcc;return function(_0x4e47e9){if(_0x4e47e9){return _0x54fae1[_0xa01f('0x1e')](_0x3384d8);}return _0x54fae1['status'](_0x3384d8)[_0xa01f('0x1f')]();};}function respondWithResult(_0x32bf5e,_0xfc5bd4){_0xfc5bd4=_0xfc5bd4||0xc8;return function(_0x135f3b){if(_0x135f3b){return _0x32bf5e['status'](_0xfc5bd4)[_0xa01f('0x20')](_0x135f3b);}};}function respondWithFilteredResult(_0xaa0fa0,_0x5ddcc2){return function(_0x5c4fe1){if(_0x5c4fe1){var _0xa5339c=typeof _0x5ddcc2[_0xa01f('0x21')]===_0xa01f('0x22')&&typeof _0x5ddcc2[_0xa01f('0x23')]==='undefined';var _0x163793=_0x5c4fe1['count'];var _0x4006fc=_0xa5339c?0x0:_0x5ddcc2['offset'];var _0x507bd7=_0xa5339c?_0x5c4fe1[_0xa01f('0x24')]:_0x5ddcc2[_0xa01f('0x21')]+_0x5ddcc2['limit'];var _0x3eb7ba;if(_0x507bd7>=_0x163793){_0x507bd7=_0x163793;_0x3eb7ba=0xc8;}else{_0x3eb7ba=0xce;}_0xaa0fa0[_0xa01f('0x25')](_0x3eb7ba);return _0xaa0fa0[_0xa01f('0x26')](_0xa01f('0x27'),_0x4006fc+'-'+_0x507bd7+'/'+_0x163793)['json'](_0x5c4fe1);}return null;};}function patchUpdates(_0x5b9ce8){return function(_0x408687){try{jsonpatch[_0xa01f('0x28')](_0x408687,_0x5b9ce8,!![]);}catch(_0x2fc91d){return BPromise[_0xa01f('0x29')](_0x2fc91d);}return _0x408687['save']();};}function saveUpdates(_0x4898ea,_0x5acb9a){return function(_0x10a454){if(_0x10a454){return _0x10a454[_0xa01f('0x2a')](_0x4898ea)[_0xa01f('0x2b')](function(_0x414b17){return _0x414b17;});}return null;};}function removeEntity(_0xb6b17e,_0x30ee11){return function(_0x543d61){if(_0x543d61){return _0x543d61[_0xa01f('0x2c')]()['then'](function(){_0xb6b17e[_0xa01f('0x25')](0xcc)[_0xa01f('0x1f')]();});}};}function handleEntityNotFound(_0x39048c,_0x4d87ad){return function(_0x217842){if(!_0x217842){_0x39048c[_0xa01f('0x1e')](0x194);}return _0x217842;};}function handleError(_0x71f9f5,_0x4b2616){_0x4b2616=_0x4b2616||0x1f4;return function(_0x3e7ccd){logger[_0xa01f('0x2d')](_0x3e7ccd['stack']);if(_0x3e7ccd[_0xa01f('0x2e')]){delete _0x3e7ccd[_0xa01f('0x2e')];}_0x71f9f5[_0xa01f('0x25')](_0x4b2616)['send'](_0x3e7ccd);};}exports[_0xa01f('0x2f')]=function(_0x117585,_0x444dc3){var _0x2f2bb4={},_0x412a4e={},_0x5d3146={'count':0x0,'rows':[]};var _0x433e7f=_['map'](db[_0xa01f('0x30')][_0xa01f('0x31')],function(_0xc32904){return{'name':_0xc32904['fieldName'],'type':_0xc32904[_0xa01f('0x32')][_0xa01f('0x33')]};});_0x412a4e[_0xa01f('0x34')]=_[_0xa01f('0x35')](_0x433e7f,'name');_0x412a4e[_0xa01f('0x36')]=_[_0xa01f('0x37')](_0x117585[_0xa01f('0x36')]);_0x412a4e[_0xa01f('0x38')]=_[_0xa01f('0x39')](_0x412a4e[_0xa01f('0x34')],_0x412a4e[_0xa01f('0x36')]);_0x2f2bb4[_0xa01f('0x3a')]=_[_0xa01f('0x39')](_0x412a4e['model'],qs[_0xa01f('0x3b')](_0x117585[_0xa01f('0x36')][_0xa01f('0x3b')]));_0x2f2bb4['attributes']=_0x2f2bb4[_0xa01f('0x3a')]['length']?_0x2f2bb4[_0xa01f('0x3a')]:_0x412a4e[_0xa01f('0x34')];if(!_0x117585['query'][_0xa01f('0x3c')](_0xa01f('0x3d'))){_0x2f2bb4['limit']=qs['limit'](_0x117585[_0xa01f('0x36')][_0xa01f('0x23')]);_0x2f2bb4[_0xa01f('0x21')]=qs[_0xa01f('0x21')](_0x117585[_0xa01f('0x36')][_0xa01f('0x21')]);}_0x2f2bb4[_0xa01f('0x3e')]=qs[_0xa01f('0x3f')](_0x117585[_0xa01f('0x36')][_0xa01f('0x3f')]);_0x2f2bb4['where']=qs[_0xa01f('0x38')](_[_0xa01f('0x40')](_0x117585[_0xa01f('0x36')],_0x412a4e['filters']),_0x433e7f);if(_0x117585[_0xa01f('0x36')][_0xa01f('0x41')]){_0x2f2bb4[_0xa01f('0x42')]=_[_0xa01f('0x43')](_0x2f2bb4[_0xa01f('0x42')],{'$or':_[_0xa01f('0x35')](_0x433e7f,function(_0x20ae8f){if(_0x20ae8f[_0xa01f('0x32')]!==_0xa01f('0x44')){var _0x1c03e4={};_0x1c03e4[_0x20ae8f[_0xa01f('0x2e')]]={'$like':'%'+_0x117585[_0xa01f('0x36')][_0xa01f('0x41')]+'%'};return _0x1c03e4;}})});}_0x2f2bb4=_[_0xa01f('0x43')]({},_0x2f2bb4,_0x117585[_0xa01f('0x45')]);var _0x1b43de={'where':_0x2f2bb4[_0xa01f('0x42')]};return db[_0xa01f('0x30')][_0xa01f('0x24')](_0x1b43de)[_0xa01f('0x2b')](function(_0x248e6f){_0x5d3146[_0xa01f('0x24')]=_0x248e6f;if(_0x117585[_0xa01f('0x36')][_0xa01f('0x46')]){_0x2f2bb4['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0xa01f('0x47')](_0x2f2bb4);})['then'](function(_0x10dc35){_0x5d3146['rows']=_0x10dc35;return _0x5d3146;})[_0xa01f('0x2b')](respondWithFilteredResult(_0x444dc3,_0x2f2bb4))['catch'](handleError(_0x444dc3,null));};exports[_0xa01f('0x48')]=function(_0x3d490c,_0x4a5e29){var _0x4dfc36={'raw':![],'where':{'id':_0x3d490c[_0xa01f('0x49')]['id']}},_0x1bd6b8={};_0x1bd6b8[_0xa01f('0x34')]=_[_0xa01f('0x37')](db[_0xa01f('0x30')][_0xa01f('0x31')]);_0x1bd6b8[_0xa01f('0x36')]=_[_0xa01f('0x37')](_0x3d490c[_0xa01f('0x36')]);_0x1bd6b8[_0xa01f('0x38')]=_[_0xa01f('0x39')](_0x1bd6b8[_0xa01f('0x34')],_0x1bd6b8[_0xa01f('0x36')]);_0x4dfc36[_0xa01f('0x3a')]=_[_0xa01f('0x39')](_0x1bd6b8[_0xa01f('0x34')],qs[_0xa01f('0x3b')](_0x3d490c[_0xa01f('0x36')]['fields']));_0x4dfc36[_0xa01f('0x3a')]=_0x4dfc36['attributes'][_0xa01f('0x4a')]?_0x4dfc36['attributes']:_0x1bd6b8[_0xa01f('0x34')];if(_0x3d490c[_0xa01f('0x36')][_0xa01f('0x46')]){_0x4dfc36['include']=[{'all':!![]}];}_0x4dfc36=_[_0xa01f('0x43')]({},_0x4dfc36,_0x3d490c[_0xa01f('0x45')]);return db[_0xa01f('0x30')][_0xa01f('0x4b')](_0x4dfc36)[_0xa01f('0x2b')](handleEntityNotFound(_0x4a5e29,null))[_0xa01f('0x2b')](respondWithResult(_0x4a5e29,null))['catch'](handleError(_0x4a5e29,null));};exports[_0xa01f('0x4c')]=function(_0x19b9b3,_0xbd5441){return db[_0xa01f('0x30')][_0xa01f('0x4c')](_0x19b9b3[_0xa01f('0x4d')],{})[_0xa01f('0x2b')](respondWithResult(_0xbd5441,0xc9))[_0xa01f('0x4e')](handleError(_0xbd5441,null));};exports['update']=function(_0x5d1a46,_0x473774){if(_0x5d1a46[_0xa01f('0x4d')]['id']){delete _0x5d1a46['body']['id'];}return db[_0xa01f('0x30')][_0xa01f('0x4b')]({'where':{'id':_0x5d1a46[_0xa01f('0x49')]['id']}})[_0xa01f('0x2b')](handleEntityNotFound(_0x473774,null))[_0xa01f('0x2b')](saveUpdates(_0x5d1a46[_0xa01f('0x4d')],null))['then'](respondWithResult(_0x473774,null))[_0xa01f('0x4e')](handleError(_0x473774,null));};exports['destroy']=function(_0x4a6c9d,_0x4f09a3){return db[_0xa01f('0x30')]['find']({'where':{'id':_0x4a6c9d[_0xa01f('0x49')]['id']}})[_0xa01f('0x2b')](handleEntityNotFound(_0x4f09a3,null))[_0xa01f('0x2b')](removeEntity(_0x4f09a3,null))['catch'](handleError(_0x4f09a3,null));};exports[_0xa01f('0x4f')]=function(_0x386a77,_0x490463){return db['VoiceQueueReport'][_0xa01f('0x4f')]()[_0xa01f('0x2b')](respondWithResult(_0x490463,null))['catch'](handleError(_0x490463,null));};exports[_0xa01f('0x50')]=function(_0x148c30,_0x5abd9c){var _0x195016={},_0xac1fee={},_0x14e093={'count':0x0,'rows':[]};_0xac1fee[_0xa01f('0x34')]=_[_0xa01f('0x37')](db[_0xa01f('0x30')][_0xa01f('0x31')]);_0xac1fee['query']=_['keys'](_0x148c30[_0xa01f('0x36')]);_0xac1fee['filters']=_[_0xa01f('0x39')](_0xac1fee[_0xa01f('0x34')],_0xac1fee['query']);_0x195016[_0xa01f('0x3a')]=_[_0xa01f('0x39')](_0xac1fee[_0xa01f('0x34')],qs[_0xa01f('0x3b')](_0x148c30[_0xa01f('0x36')]['fields']));_0x195016[_0xa01f('0x3a')]=_0x195016[_0xa01f('0x3a')][_0xa01f('0x4a')]?_0x195016[_0xa01f('0x3a')]:_0xac1fee[_0xa01f('0x34')];if(!_0x148c30[_0xa01f('0x36')][_0xa01f('0x3c')](_0xa01f('0x3d'))){_0x195016[_0xa01f('0x23')]=qs[_0xa01f('0x23')](_0x148c30[_0xa01f('0x36')][_0xa01f('0x23')]);_0x195016[_0xa01f('0x21')]=qs[_0xa01f('0x21')](_0x148c30['query'][_0xa01f('0x21')]);}_0x195016['order']=qs[_0xa01f('0x3f')](_0x148c30[_0xa01f('0x36')][_0xa01f('0x3f')]);_0x195016[_0xa01f('0x42')]=qs['filters'](_[_0xa01f('0x40')](_0x148c30[_0xa01f('0x36')],_0xac1fee['filters']));if(_0x148c30[_0xa01f('0x36')][_0xa01f('0x41')]){_0x195016[_0xa01f('0x42')]=_['merge'](_0x195016[_0xa01f('0x42')],{'$or':_[_0xa01f('0x35')](_0x195016[_0xa01f('0x3a')],function(_0x9cff4f){var _0x4caaf1={};_0x4caaf1[_0x9cff4f]={'$like':'%'+_0x148c30[_0xa01f('0x36')][_0xa01f('0x41')]+'%'};return _0x4caaf1;})});}_0x195016=_[_0xa01f('0x43')]({},_0x195016,_0x148c30[_0xa01f('0x45')]);var _0x4fe89a={'where':_0x195016[_0xa01f('0x42')]};return db['VoiceQueueReport'][_0xa01f('0x24')](_0x4fe89a)[_0xa01f('0x2b')](function(_0x5cedf4){_0x14e093['count']=_0x5cedf4;if(_0x148c30[_0xa01f('0x36')]['includeAll']){_0x195016[_0xa01f('0x51')]=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x195016);})[_0xa01f('0x2b')](function(_0x1635cf){_0x14e093[_0xa01f('0x52')]=_0x1635cf;return _0x14e093;})['then'](respondWithFilteredResult(_0x5abd9c,_0x195016,_0xa01f('0x50')))[_0xa01f('0x4e')](handleError(_0x5abd9c,null,_0xa01f('0x50')));}; \ No newline at end of file +var _0xa371=['update','then','end','stack','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','destroy','describe','getVoiceQueuesReport','nolimit','pick','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','reject','save'];(function(_0x54ab73,_0x24627a){var _0x3e9ce1=function(_0x11bbb3){while(--_0x11bbb3){_0x54ab73['push'](_0x54ab73['shift']());}};_0x3e9ce1(++_0x24627a);}(_0xa371,0x81));var _0x1a37=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xa371[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0x1a37('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1a37('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1a37('0x2'));var moment=require('moment');var BPromise=require(_0x1a37('0x3'));var Mustache=require(_0x1a37('0x4'));var util=require(_0x1a37('0x5'));var path=require(_0x1a37('0x6'));var sox=require(_0x1a37('0x7'));var csv=require(_0x1a37('0x8'));var ejs=require(_0x1a37('0x9'));var fs=require('fs');var fs_extra=require(_0x1a37('0xa'));var _=require('lodash');var squel=require(_0x1a37('0xb'));var crypto=require('crypto');var jsforce=require(_0x1a37('0xc'));var deskjs=require(_0x1a37('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1a37('0xe'));var Papa=require(_0x1a37('0xf'));var Redis=require(_0x1a37('0x10'));var authService=require(_0x1a37('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1a37('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1a37('0x13'))(_0x1a37('0x14'));var utils=require(_0x1a37('0x15'));var config=require(_0x1a37('0x16'));var licenseUtil=require(_0x1a37('0x17'));var db=require(_0x1a37('0x18'))['db'];config[_0x1a37('0x19')]=_[_0x1a37('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x1a37('0x1b'))(new Redis(config[_0x1a37('0x19')]));require(_0x1a37('0x1c'))[_0x1a37('0x1d')](socket);function respondWithStatusCode(_0x1d8e8f,_0x180582){_0x180582=_0x180582||0xcc;return function(_0x263258){if(_0x263258){return _0x1d8e8f[_0x1a37('0x1e')](_0x180582);}return _0x1d8e8f[_0x1a37('0x1f')](_0x180582)['end']();};}function respondWithResult(_0x34806d,_0x541cb3){_0x541cb3=_0x541cb3||0xc8;return function(_0x11030e){if(_0x11030e){return _0x34806d['status'](_0x541cb3)[_0x1a37('0x20')](_0x11030e);}};}function respondWithFilteredResult(_0x22f79e,_0x4923c8){return function(_0x3535c0){if(_0x3535c0){var _0x1f2ff0=typeof _0x4923c8['offset']===_0x1a37('0x21')&&typeof _0x4923c8[_0x1a37('0x22')]===_0x1a37('0x21');var _0x1b7424=_0x3535c0[_0x1a37('0x23')];var _0x401ee4=_0x1f2ff0?0x0:_0x4923c8[_0x1a37('0x24')];var _0x4bf287=_0x1f2ff0?_0x3535c0['count']:_0x4923c8['offset']+_0x4923c8[_0x1a37('0x22')];var _0x5c36d7;if(_0x4bf287>=_0x1b7424){_0x4bf287=_0x1b7424;_0x5c36d7=0xc8;}else{_0x5c36d7=0xce;}_0x22f79e[_0x1a37('0x1f')](_0x5c36d7);return _0x22f79e['set'](_0x1a37('0x25'),_0x401ee4+'-'+_0x4bf287+'/'+_0x1b7424)[_0x1a37('0x20')](_0x3535c0);}return null;};}function patchUpdates(_0x391377){return function(_0x40c1e1){try{jsonpatch[_0x1a37('0x26')](_0x40c1e1,_0x391377,!![]);}catch(_0x35b1bb){return BPromise[_0x1a37('0x27')](_0x35b1bb);}return _0x40c1e1[_0x1a37('0x28')]();};}function saveUpdates(_0x197eef,_0x588a39){return function(_0x2572fd){if(_0x2572fd){return _0x2572fd[_0x1a37('0x29')](_0x197eef)[_0x1a37('0x2a')](function(_0x32e9dd){return _0x32e9dd;});}return null;};}function removeEntity(_0x352216,_0x4d1423){return function(_0x36e3c1){if(_0x36e3c1){return _0x36e3c1['destroy']()[_0x1a37('0x2a')](function(){_0x352216[_0x1a37('0x1f')](0xcc)[_0x1a37('0x2b')]();});}};}function handleEntityNotFound(_0x437b15,_0x1c27e9){return function(_0x438e35){if(!_0x438e35){_0x437b15['sendStatus'](0x194);}return _0x438e35;};}function handleError(_0xe14755,_0x1fb650){_0x1fb650=_0x1fb650||0x1f4;return function(_0x1fe77d){logger['error'](_0x1fe77d[_0x1a37('0x2c')]);if(_0x1fe77d[_0x1a37('0x2d')]){delete _0x1fe77d[_0x1a37('0x2d')];}_0xe14755[_0x1a37('0x1f')](_0x1fb650)[_0x1a37('0x2e')](_0x1fe77d);};}exports[_0x1a37('0x2f')]=function(_0x169029,_0x305a9f){var _0x9016b6={},_0x9de9d7={},_0x289779={'count':0x0,'rows':[]};var _0x11baa9=_[_0x1a37('0x30')](db[_0x1a37('0x31')][_0x1a37('0x32')],function(_0x1cef2c){return{'name':_0x1cef2c[_0x1a37('0x33')],'type':_0x1cef2c[_0x1a37('0x34')][_0x1a37('0x35')]};});_0x9de9d7[_0x1a37('0x36')]=_[_0x1a37('0x30')](_0x11baa9,'name');_0x9de9d7[_0x1a37('0x37')]=_[_0x1a37('0x38')](_0x169029[_0x1a37('0x37')]);_0x9de9d7[_0x1a37('0x39')]=_[_0x1a37('0x3a')](_0x9de9d7[_0x1a37('0x36')],_0x9de9d7['query']);_0x9016b6['attributes']=_['intersection'](_0x9de9d7['model'],qs[_0x1a37('0x3b')](_0x169029['query']['fields']));_0x9016b6[_0x1a37('0x3c')]=_0x9016b6[_0x1a37('0x3c')][_0x1a37('0x3d')]?_0x9016b6[_0x1a37('0x3c')]:_0x9de9d7[_0x1a37('0x36')];if(!_0x169029['query'][_0x1a37('0x3e')]('nolimit')){_0x9016b6[_0x1a37('0x22')]=qs[_0x1a37('0x22')](_0x169029[_0x1a37('0x37')][_0x1a37('0x22')]);_0x9016b6[_0x1a37('0x24')]=qs[_0x1a37('0x24')](_0x169029[_0x1a37('0x37')][_0x1a37('0x24')]);}_0x9016b6[_0x1a37('0x3f')]=qs[_0x1a37('0x40')](_0x169029[_0x1a37('0x37')][_0x1a37('0x40')]);_0x9016b6[_0x1a37('0x41')]=qs[_0x1a37('0x39')](_['pick'](_0x169029[_0x1a37('0x37')],_0x9de9d7[_0x1a37('0x39')]),_0x11baa9);if(_0x169029['query'][_0x1a37('0x42')]){_0x9016b6[_0x1a37('0x41')]=_['merge'](_0x9016b6[_0x1a37('0x41')],{'$or':_[_0x1a37('0x30')](_0x11baa9,function(_0x42cc1c){if(_0x42cc1c['type']!==_0x1a37('0x43')){var _0x69187e={};_0x69187e[_0x42cc1c[_0x1a37('0x2d')]]={'$like':'%'+_0x169029[_0x1a37('0x37')]['filter']+'%'};return _0x69187e;}})});}_0x9016b6=_[_0x1a37('0x44')]({},_0x9016b6,_0x169029[_0x1a37('0x45')]);var _0x377a3e={'where':_0x9016b6[_0x1a37('0x41')]};return db['VoiceQueueReport'][_0x1a37('0x23')](_0x377a3e)[_0x1a37('0x2a')](function(_0x48fcd9){_0x289779[_0x1a37('0x23')]=_0x48fcd9;if(_0x169029[_0x1a37('0x37')][_0x1a37('0x46')]){_0x9016b6['include']=[{'all':!![]}];}return db[_0x1a37('0x31')][_0x1a37('0x47')](_0x9016b6);})[_0x1a37('0x2a')](function(_0x329630){_0x289779[_0x1a37('0x48')]=_0x329630;return _0x289779;})[_0x1a37('0x2a')](respondWithFilteredResult(_0x305a9f,_0x9016b6))[_0x1a37('0x49')](handleError(_0x305a9f,null));};exports[_0x1a37('0x4a')]=function(_0x354d0b,_0xae2f4){var _0x476b7a={'raw':![],'where':{'id':_0x354d0b[_0x1a37('0x4b')]['id']}},_0x1e722d={};_0x1e722d['model']=_[_0x1a37('0x38')](db[_0x1a37('0x31')][_0x1a37('0x32')]);_0x1e722d[_0x1a37('0x37')]=_[_0x1a37('0x38')](_0x354d0b[_0x1a37('0x37')]);_0x1e722d[_0x1a37('0x39')]=_['intersection'](_0x1e722d[_0x1a37('0x36')],_0x1e722d['query']);_0x476b7a[_0x1a37('0x3c')]=_['intersection'](_0x1e722d['model'],qs[_0x1a37('0x3b')](_0x354d0b[_0x1a37('0x37')]['fields']));_0x476b7a[_0x1a37('0x3c')]=_0x476b7a[_0x1a37('0x3c')][_0x1a37('0x3d')]?_0x476b7a['attributes']:_0x1e722d[_0x1a37('0x36')];if(_0x354d0b[_0x1a37('0x37')][_0x1a37('0x46')]){_0x476b7a[_0x1a37('0x4c')]=[{'all':!![]}];}_0x476b7a=_[_0x1a37('0x44')]({},_0x476b7a,_0x354d0b[_0x1a37('0x45')]);return db['VoiceQueueReport'][_0x1a37('0x4d')](_0x476b7a)['then'](handleEntityNotFound(_0xae2f4,null))[_0x1a37('0x2a')](respondWithResult(_0xae2f4,null))[_0x1a37('0x49')](handleError(_0xae2f4,null));};exports[_0x1a37('0x4e')]=function(_0x32b9d9,_0x14ad1f){return db[_0x1a37('0x31')][_0x1a37('0x4e')](_0x32b9d9['body'],{})['then'](respondWithResult(_0x14ad1f,0xc9))[_0x1a37('0x49')](handleError(_0x14ad1f,null));};exports['update']=function(_0x383ba1,_0x31d06b){if(_0x383ba1[_0x1a37('0x4f')]['id']){delete _0x383ba1[_0x1a37('0x4f')]['id'];}return db[_0x1a37('0x31')][_0x1a37('0x4d')]({'where':{'id':_0x383ba1[_0x1a37('0x4b')]['id']}})[_0x1a37('0x2a')](handleEntityNotFound(_0x31d06b,null))['then'](saveUpdates(_0x383ba1[_0x1a37('0x4f')],null))['then'](respondWithResult(_0x31d06b,null))['catch'](handleError(_0x31d06b,null));};exports[_0x1a37('0x50')]=function(_0x909545,_0x1f82aa){return db[_0x1a37('0x31')][_0x1a37('0x4d')]({'where':{'id':_0x909545[_0x1a37('0x4b')]['id']}})[_0x1a37('0x2a')](handleEntityNotFound(_0x1f82aa,null))[_0x1a37('0x2a')](removeEntity(_0x1f82aa,null))['catch'](handleError(_0x1f82aa,null));};exports[_0x1a37('0x51')]=function(_0x2d8555,_0x2866c2){return db[_0x1a37('0x31')]['describe']()[_0x1a37('0x2a')](respondWithResult(_0x2866c2,null))[_0x1a37('0x49')](handleError(_0x2866c2,null));};exports[_0x1a37('0x52')]=function(_0x3ea234,_0x2feca7){var _0x4953bd={},_0x3379d9={},_0x5c0853={'count':0x0,'rows':[]};_0x3379d9['model']=_['keys'](db[_0x1a37('0x31')][_0x1a37('0x32')]);_0x3379d9['query']=_[_0x1a37('0x38')](_0x3ea234['query']);_0x3379d9['filters']=_['intersection'](_0x3379d9['model'],_0x3379d9[_0x1a37('0x37')]);_0x4953bd[_0x1a37('0x3c')]=_[_0x1a37('0x3a')](_0x3379d9['model'],qs['fields'](_0x3ea234[_0x1a37('0x37')][_0x1a37('0x3b')]));_0x4953bd[_0x1a37('0x3c')]=_0x4953bd[_0x1a37('0x3c')][_0x1a37('0x3d')]?_0x4953bd[_0x1a37('0x3c')]:_0x3379d9[_0x1a37('0x36')];if(!_0x3ea234[_0x1a37('0x37')]['hasOwnProperty'](_0x1a37('0x53'))){_0x4953bd[_0x1a37('0x22')]=qs[_0x1a37('0x22')](_0x3ea234['query']['limit']);_0x4953bd[_0x1a37('0x24')]=qs['offset'](_0x3ea234['query']['offset']);}_0x4953bd[_0x1a37('0x3f')]=qs[_0x1a37('0x40')](_0x3ea234['query']['sort']);_0x4953bd[_0x1a37('0x41')]=qs['filters'](_[_0x1a37('0x54')](_0x3ea234[_0x1a37('0x37')],_0x3379d9[_0x1a37('0x39')]));if(_0x3ea234[_0x1a37('0x37')][_0x1a37('0x42')]){_0x4953bd['where']=_['merge'](_0x4953bd[_0x1a37('0x41')],{'$or':_[_0x1a37('0x30')](_0x4953bd[_0x1a37('0x3c')],function(_0x576b97){var _0x412444={};_0x412444[_0x576b97]={'$like':'%'+_0x3ea234[_0x1a37('0x37')][_0x1a37('0x42')]+'%'};return _0x412444;})});}_0x4953bd=_[_0x1a37('0x44')]({},_0x4953bd,_0x3ea234[_0x1a37('0x45')]);var _0x4eb8ec={'where':_0x4953bd[_0x1a37('0x41')]};return db[_0x1a37('0x31')][_0x1a37('0x23')](_0x4eb8ec)[_0x1a37('0x2a')](function(_0x1224cc){_0x5c0853['count']=_0x1224cc;if(_0x3ea234[_0x1a37('0x37')][_0x1a37('0x46')]){_0x4953bd[_0x1a37('0x4c')]=[{'all':!![]}];}return db[_0x1a37('0x31')][_0x1a37('0x47')](_0x4953bd);})['then'](function(_0x192a99){_0x5c0853[_0x1a37('0x48')]=_0x192a99;return _0x5c0853;})[_0x1a37('0x2a')](respondWithFilteredResult(_0x2feca7,_0x4953bd,_0x1a37('0x52')))[_0x1a37('0x49')](handleError(_0x2feca7,null,_0x1a37('0x52')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 5dc0093..d6ae267 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 _0x5cff=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x181678,_0x5553ec){var _0xa17ff4=function(_0x5a44e1){while(--_0x5a44e1){_0x181678['push'](_0x181678['shift']());}};_0xa17ff4(++_0x5553ec);}(_0x5cff,0x87));var _0xf5cf=function(_0x337377,_0x241b24){_0x337377=_0x337377-0x0;var _0x1c1c32=_0x5cff[_0x337377];return _0x1c1c32;};'use strict';var EventEmitter=require(_0xf5cf('0x0'));var VoiceQueueReport=require(_0xf5cf('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xf5cf('0x2')](0x0);var events={'afterCreate':_0xf5cf('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x13c528){return function(_0x3a6058,_0x1875d1,_0x4f63b5){VoiceQueueReportEvents[_0xf5cf('0x4')](_0x13c528+':'+_0x3a6058['id'],_0x3a6058);VoiceQueueReportEvents[_0xf5cf('0x4')](_0x13c528,_0x3a6058);_0x4f63b5(null);};}for(var e in events){if(events[_0xf5cf('0x5')](e)){var event=events[e];VoiceQueueReport[_0xf5cf('0x6')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file +var _0x2b96=['save','update','emit','hasOwnProperty','hook','VoiceQueueReport'];(function(_0x3e7b5a,_0x4c06fe){var _0x4880aa=function(_0x2410ac){while(--_0x2410ac){_0x3e7b5a['push'](_0x3e7b5a['shift']());}};_0x4880aa(++_0x4c06fe);}(_0x2b96,0x10d));var _0x62b9=function(_0x406c6b,_0x5128f1){_0x406c6b=_0x406c6b-0x0;var _0x2ba7b4=_0x2b96[_0x406c6b];return _0x2ba7b4;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db'][_0x62b9('0x0')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x62b9('0x1'),'afterUpdate':_0x62b9('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5397ec){return function(_0x3e92f1,_0x152be4,_0x3ddc68){VoiceQueueReportEvents[_0x62b9('0x3')](_0x5397ec+':'+_0x3e92f1['id'],_0x3e92f1);VoiceQueueReportEvents[_0x62b9('0x3')](_0x5397ec,_0x3e92f1);_0x3ddc68(null);};}for(var e in events){if(events[_0x62b9('0x4')](e)){var event=events[e];VoiceQueueReport[_0x62b9('0x5')](e,emitEvent(event));}}module['exports']=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index c998c62..ed1349b 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 _0x4983=['exports','VoiceQueueReport','report_queue','calleridnum','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x41db9c,_0x1d3bb4){var _0x3de4bf=function(_0x4f4776){while(--_0x4f4776){_0x41db9c['push'](_0x41db9c['shift']());}};_0x3de4bf(++_0x1d3bb4);}(_0x4983,0xb8));var _0x3498=function(_0x289b3d,_0x45d444){_0x289b3d=_0x289b3d-0x0;var _0x599c7a=_0x4983[_0x289b3d];return _0x599c7a;};'use strict';var _=require(_0x3498('0x0'));var util=require(_0x3498('0x1'));var logger=require(_0x3498('0x2'))(_0x3498('0x3'));var moment=require(_0x3498('0x4'));var BPromise=require('bluebird');var rp=require(_0x3498('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3498('0x6'));var config=require(_0x3498('0x7'));var attributes=require('./voiceQueueReport.attributes');module[_0x3498('0x8')]=function(_0x162b54,_0x16d504){return _0x162b54['define'](_0x3498('0x9'),attributes,{'tableName':_0x3498('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid']},{'fields':[_0x3498('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5eda=['uniqueid','calleridnum','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','VoiceQueueReport','report_queue'];(function(_0x449235,_0x567736){var _0x2446ad=function(_0x36d60c){while(--_0x36d60c){_0x449235['push'](_0x449235['shift']());}};_0x2446ad(++_0x567736);}(_0x5eda,0x197));var _0xa5ed=function(_0xd51501,_0x249b6a){_0xd51501=_0xd51501-0x0;var _0x418237=_0x5eda[_0xd51501];return _0x418237;};'use strict';var _=require('lodash');var util=require(_0xa5ed('0x0'));var logger=require(_0xa5ed('0x1'))(_0xa5ed('0x2'));var moment=require(_0xa5ed('0x3'));var BPromise=require(_0xa5ed('0x4'));var rp=require(_0xa5ed('0x5'));var fs=require('fs');var path=require(_0xa5ed('0x6'));var rimraf=require(_0xa5ed('0x7'));var config=require(_0xa5ed('0x8'));var attributes=require(_0xa5ed('0x9'));module[_0xa5ed('0xa')]=function(_0x97672a,_0x1375f9){return _0x97672a['define'](_0xa5ed('0xb'),attributes,{'tableName':_0xa5ed('0xc'),'paranoid':![],'indexes':[{'fields':[_0xa5ed('0xd')]},{'fields':[_0xa5ed('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 14ade4b..80c32f6 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 _0xd963=['client','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','request\x20sent','debug','stringify','error','VoiceQueueReport,\x20%s,\x20%s','message','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','map','include','model','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','limit','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x134b6e,_0x21b5ca){var _0x2229a9=function(_0x3fd3f5){while(--_0x3fd3f5){_0x134b6e['push'](_0x134b6e['shift']());}};_0x2229a9(++_0x21b5ca);}(_0xd963,0x93));var _0x3d96=function(_0x592cea,_0x4e72f1){_0x592cea=_0x592cea-0x0;var _0x1e9cc6=_0xd963[_0x592cea];return _0x1e9cc6;};'use strict';var _=require(_0x3d96('0x0'));var util=require(_0x3d96('0x1'));var moment=require(_0x3d96('0x2'));var BPromise=require(_0x3d96('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3d96('0x4'))['db'];var utils=require(_0x3d96('0x5'));var logger=require('../../config/logger')(_0x3d96('0x6'));var config=require(_0x3d96('0x7'));var jayson=require(_0x3d96('0x8'));var client=jayson[_0x3d96('0x9')][_0x3d96('0xa')]({'port':0x232a});config[_0x3d96('0xb')]=_[_0x3d96('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x3d96('0xd'))(new Redis(config[_0x3d96('0xb')]));require(_0x3d96('0xe'))[_0x3d96('0xf')](socket);function respondWithRpcPromise(_0x50c813,_0x433cb3,_0x4a3341){return new BPromise(function(_0x9945ce,_0x29b4ff){return client[_0x3d96('0x10')](_0x50c813,_0x4a3341)[_0x3d96('0x11')](function(_0x620b40){logger[_0x3d96('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x433cb3,_0x3d96('0x13'));logger[_0x3d96('0x14')]('VoiceQueueReport,\x20%s,\x20%s,\x20%s',_0x433cb3,_0x3d96('0x13'),JSON[_0x3d96('0x15')](_0x620b40));if(_0x620b40[_0x3d96('0x16')]){if(_0x620b40[_0x3d96('0x16')]['code']===0x1f4){logger['error'](_0x3d96('0x17'),_0x433cb3,_0x620b40[_0x3d96('0x16')][_0x3d96('0x18')]);return _0x29b4ff(_0x620b40[_0x3d96('0x16')]['message']);}logger[_0x3d96('0x16')](_0x3d96('0x17'),_0x433cb3,_0x620b40[_0x3d96('0x16')]['message']);return _0x9945ce(_0x620b40[_0x3d96('0x16')]['message']);}else{logger[_0x3d96('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x433cb3,_0x3d96('0x13'));_0x9945ce(_0x620b40['result'][_0x3d96('0x18')]);}})['catch'](function(_0x50815b){logger['error'](_0x3d96('0x17'),_0x433cb3,_0x50815b);_0x29b4ff(_0x50815b);});});}exports[_0x3d96('0x19')]=function(_0x56e0e1){var _0x367768=this;return new Promise(function(_0x2cbba3,_0x376848){return db[_0x3d96('0x1a')]['findAll']({'raw':_0x56e0e1[_0x3d96('0x1b')]?_0x56e0e1[_0x3d96('0x1b')][_0x3d96('0x1c')]===undefined?!![]:![]:!![],'where':_0x56e0e1[_0x3d96('0x1b')]?_0x56e0e1[_0x3d96('0x1b')][_0x3d96('0x1d')]||null:null,'attributes':_0x56e0e1['options']?_0x56e0e1[_0x3d96('0x1b')][_0x3d96('0x1e')]||null:null,'limit':_0x56e0e1[_0x3d96('0x1b')]?_0x56e0e1[_0x3d96('0x1b')]['limit']||null:null,'include':_0x56e0e1[_0x3d96('0x1b')]?_0x56e0e1[_0x3d96('0x1b')]['include']?_[_0x3d96('0x1f')](_0x56e0e1[_0x3d96('0x1b')][_0x3d96('0x20')],function(_0x2ab2b0){return{'model':db[_0x2ab2b0['model']],'as':_0x2ab2b0['as'],'attributes':_0x2ab2b0['attributes'],'include':_0x2ab2b0['include']?_[_0x3d96('0x1f')](_0x2ab2b0['include'],function(_0x368eec){return{'model':db[_0x368eec[_0x3d96('0x21')]],'as':_0x368eec['as'],'attributes':_0x368eec['attributes'],'include':_0x368eec[_0x3d96('0x20')]?_[_0x3d96('0x1f')](_0x368eec[_0x3d96('0x20')],function(_0x2ff725){return{'model':db[_0x2ff725[_0x3d96('0x21')]],'as':_0x2ff725['as'],'attributes':_0x2ff725[_0x3d96('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3d96('0x11')](function(_0x110d8f){logger[_0x3d96('0x12')](_0x3d96('0x19'),_0x56e0e1);logger[_0x3d96('0x14')](_0x3d96('0x19'),_0x56e0e1,JSON[_0x3d96('0x15')](_0x110d8f));_0x2cbba3(_0x110d8f);})['catch'](function(_0x133cb6){logger[_0x3d96('0x16')](_0x3d96('0x19'),_0x133cb6[_0x3d96('0x18')],_0x56e0e1);_0x376848(_0x367768[_0x3d96('0x16')](0x1f4,_0x133cb6[_0x3d96('0x18')]));});});};exports['CreateVoiceQueueReport']=function(_0x4a82c8){var _0x400829=this;return new Promise(function(_0xbf5b0b,_0xff22c8){return db[_0x3d96('0x1a')]['create'](_0x4a82c8[_0x3d96('0x22')],{'raw':_0x4a82c8[_0x3d96('0x1b')]?_0x4a82c8['options']['raw']===undefined?!![]:![]:!![]})[_0x3d96('0x11')](function(_0x5c9cf4){logger[_0x3d96('0x12')](_0x3d96('0x23'),_0x4a82c8);logger[_0x3d96('0x14')](_0x3d96('0x23'),_0x4a82c8,JSON[_0x3d96('0x15')](_0x5c9cf4));_0xbf5b0b(_0x5c9cf4);})['catch'](function(_0x15d7c5){logger[_0x3d96('0x16')]('CreateVoiceQueueReport',_0x15d7c5['message'],_0x4a82c8);_0xff22c8(_0x400829[_0x3d96('0x16')](0x1f4,_0x15d7c5[_0x3d96('0x18')]));});});};exports[_0x3d96('0x24')]=function(_0x5a925c){var _0x4c30e4=this;return new Promise(function(_0x4e041b,_0xf08fec){return db[_0x3d96('0x1a')]['update'](_0x5a925c['body'],{'raw':_0x5a925c[_0x3d96('0x1b')]?_0x5a925c[_0x3d96('0x1b')][_0x3d96('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a925c[_0x3d96('0x1b')]?_0x5a925c[_0x3d96('0x1b')]['where']||null:null,'attributes':_0x5a925c['options']?_0x5a925c['options'][_0x3d96('0x1e')]||null:null,'limit':_0x5a925c['options']?_0x5a925c['options'][_0x3d96('0x25')]||null:null})[_0x3d96('0x11')](function(_0xfac65c){logger['info'](_0x3d96('0x24'),_0x5a925c);logger[_0x3d96('0x14')](_0x3d96('0x24'),_0x5a925c,JSON[_0x3d96('0x15')](_0xfac65c));_0x4e041b(_0xfac65c);})[_0x3d96('0x26')](function(_0x1eecc4){logger[_0x3d96('0x16')](_0x3d96('0x24'),_0x1eecc4[_0x3d96('0x18')],_0x5a925c);_0xf08fec(_0x4c30e4[_0x3d96('0x16')](0x1f4,_0x1eecc4['message']));});});}; \ No newline at end of file +var _0x56b1=['CreateVoiceQueueReport','body','then','UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./voiceQueueReport.socket','register','request','info','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueueReport,\x20%s,\x20%s','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','limit','include','map','model','attributes'];(function(_0x718728,_0x3f0352){var _0x137abb=function(_0x2d27bf){while(--_0x2d27bf){_0x718728['push'](_0x718728['shift']());}};_0x137abb(++_0x3f0352);}(_0x56b1,0x19e));var _0x156b=function(_0x3adfc3,_0x3d0486){_0x3adfc3=_0x3adfc3-0x0;var _0x30d7ca=_0x56b1[_0x3adfc3];return _0x30d7ca;};'use strict';var _=require(_0x156b('0x0'));var util=require(_0x156b('0x1'));var moment=require(_0x156b('0x2'));var BPromise=require(_0x156b('0x3'));var rs=require(_0x156b('0x4'));var fs=require('fs');var Redis=require(_0x156b('0x5'));var db=require(_0x156b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x156b('0x7'))('rpc');var config=require(_0x156b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x156b('0x9')][_0x156b('0xa')]({'port':0x232a});config[_0x156b('0xb')]=_[_0x156b('0xc')](config['redis'],{'host':_0x156b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x156b('0xe'))[_0x156b('0xf')](socket);function respondWithRpcPromise(_0x3f14d5,_0x57d2bf,_0xbe6e1c){return new BPromise(function(_0x2593a8,_0x489a1e){return client[_0x156b('0x10')](_0x3f14d5,_0xbe6e1c)['then'](function(_0x58aaac){logger[_0x156b('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x57d2bf,_0x156b('0x12'));logger[_0x156b('0x13')](_0x156b('0x14'),_0x57d2bf,'request\x20sent',JSON[_0x156b('0x15')](_0x58aaac));if(_0x58aaac[_0x156b('0x16')]){if(_0x58aaac[_0x156b('0x16')]['code']===0x1f4){logger[_0x156b('0x16')](_0x156b('0x17'),_0x57d2bf,_0x58aaac[_0x156b('0x16')][_0x156b('0x18')]);return _0x489a1e(_0x58aaac[_0x156b('0x16')][_0x156b('0x18')]);}logger['error'](_0x156b('0x17'),_0x57d2bf,_0x58aaac['error'][_0x156b('0x18')]);return _0x2593a8(_0x58aaac[_0x156b('0x16')][_0x156b('0x18')]);}else{logger[_0x156b('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x57d2bf,'request\x20sent');_0x2593a8(_0x58aaac[_0x156b('0x19')][_0x156b('0x18')]);}})[_0x156b('0x1a')](function(_0x2a9123){logger[_0x156b('0x16')]('VoiceQueueReport,\x20%s,\x20%s',_0x57d2bf,_0x2a9123);_0x489a1e(_0x2a9123);});});}exports[_0x156b('0x1b')]=function(_0x2827b9){var _0x55cef5=this;return new Promise(function(_0x4da1c8,_0x902588){return db[_0x156b('0x1c')]['findAll']({'raw':_0x2827b9[_0x156b('0x1d')]?_0x2827b9[_0x156b('0x1d')][_0x156b('0x1e')]===undefined?!![]:![]:!![],'where':_0x2827b9[_0x156b('0x1d')]?_0x2827b9[_0x156b('0x1d')][_0x156b('0x1f')]||null:null,'attributes':_0x2827b9[_0x156b('0x1d')]?_0x2827b9[_0x156b('0x1d')]['attributes']||null:null,'limit':_0x2827b9[_0x156b('0x1d')]?_0x2827b9['options'][_0x156b('0x20')]||null:null,'include':_0x2827b9[_0x156b('0x1d')]?_0x2827b9[_0x156b('0x1d')][_0x156b('0x21')]?_[_0x156b('0x22')](_0x2827b9[_0x156b('0x1d')][_0x156b('0x21')],function(_0x70f63b){return{'model':db[_0x70f63b[_0x156b('0x23')]],'as':_0x70f63b['as'],'attributes':_0x70f63b[_0x156b('0x24')],'include':_0x70f63b[_0x156b('0x21')]?_['map'](_0x70f63b[_0x156b('0x21')],function(_0x3e6935){return{'model':db[_0x3e6935[_0x156b('0x23')]],'as':_0x3e6935['as'],'attributes':_0x3e6935[_0x156b('0x24')],'include':_0x3e6935[_0x156b('0x21')]?_[_0x156b('0x22')](_0x3e6935[_0x156b('0x21')],function(_0x48ff2f){return{'model':db[_0x48ff2f[_0x156b('0x23')]],'as':_0x48ff2f['as'],'attributes':_0x48ff2f[_0x156b('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x53c9c2){logger['info'](_0x156b('0x1b'),_0x2827b9);logger[_0x156b('0x13')]('GetVoiceQueueReport',_0x2827b9,JSON['stringify'](_0x53c9c2));_0x4da1c8(_0x53c9c2);})['catch'](function(_0x55b949){logger[_0x156b('0x16')]('GetVoiceQueueReport',_0x55b949[_0x156b('0x18')],_0x2827b9);_0x902588(_0x55cef5[_0x156b('0x16')](0x1f4,_0x55b949[_0x156b('0x18')]));});});};exports[_0x156b('0x25')]=function(_0x5927a1){var _0x30bcdf=this;return new Promise(function(_0x32f5b2,_0x32947c){return db[_0x156b('0x1c')]['create'](_0x5927a1[_0x156b('0x26')],{'raw':_0x5927a1['options']?_0x5927a1[_0x156b('0x1d')][_0x156b('0x1e')]===undefined?!![]:![]:!![]})[_0x156b('0x27')](function(_0x4f3f33){logger[_0x156b('0x11')](_0x156b('0x25'),_0x5927a1);logger[_0x156b('0x13')](_0x156b('0x25'),_0x5927a1,JSON[_0x156b('0x15')](_0x4f3f33));_0x32f5b2(_0x4f3f33);})[_0x156b('0x1a')](function(_0x12d73c){logger[_0x156b('0x16')]('CreateVoiceQueueReport',_0x12d73c[_0x156b('0x18')],_0x5927a1);_0x32947c(_0x30bcdf['error'](0x1f4,_0x12d73c['message']));});});};exports[_0x156b('0x28')]=function(_0x48453d){var _0x9fede5=this;return new Promise(function(_0x5b7218,_0x55fd8e){return db['VoiceQueueReport']['update'](_0x48453d[_0x156b('0x26')],{'raw':_0x48453d['options']?_0x48453d[_0x156b('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48453d['options']?_0x48453d['options'][_0x156b('0x1f')]||null:null,'attributes':_0x48453d[_0x156b('0x1d')]?_0x48453d[_0x156b('0x1d')][_0x156b('0x24')]||null:null,'limit':_0x48453d['options']?_0x48453d['options']['limit']||null:null})[_0x156b('0x27')](function(_0x5c4479){logger['info'](_0x156b('0x28'),_0x48453d);logger[_0x156b('0x13')](_0x156b('0x28'),_0x48453d,JSON[_0x156b('0x15')](_0x5c4479));_0x5b7218(_0x5c4479);})['catch'](function(_0x53fe44){logger[_0x156b('0x16')](_0x156b('0x28'),_0x53fe44[_0x156b('0x18')],_0x48453d);_0x55fd8e(_0x9fede5['error'](0x1f4,_0x53fe44[_0x156b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 87cb518..308b9d2 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 _0x7bb8=['update','emit','removeListener','voiceQueueReport:','save','remove'];(function(_0x140c01,_0x1063b1){var _0x3ebcc0=function(_0x2dfd07){while(--_0x2dfd07){_0x140c01['push'](_0x140c01['shift']());}};_0x3ebcc0(++_0x1063b1);}(_0x7bb8,0xe8));var _0x87bb=function(_0x18030d,_0x31f551){_0x18030d=_0x18030d-0x0;var _0x261e56=_0x7bb8[_0x18030d];return _0x261e56;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x87bb('0x0'),_0x87bb('0x1'),_0x87bb('0x2')];function createListener(_0x2a8157,_0x57cf25){return function(_0x26d1f5){_0x57cf25[_0x87bb('0x3')](_0x2a8157,_0x26d1f5);};}function removeListener(_0x5c03d3,_0xd7ed75){return function(){VoiceQueueReportEvents[_0x87bb('0x4')](_0x5c03d3,_0xd7ed75);};}exports['register']=function(_0x38b56d){for(var _0x46622e=0x0,_0x5e6e14=events['length'];_0x46622e<_0x5e6e14;_0x46622e++){var _0x317bba=events[_0x46622e];var _0x11d858=createListener(_0x87bb('0x5')+_0x317bba,_0x38b56d);VoiceQueueReportEvents['on'](_0x317bba,_0x11d858);}}; \ No newline at end of file +var _0xf569=['update','emit','removeListener','length','voiceQueueReport:','save','remove'];(function(_0x2e4563,_0x2153a8){var _0x24b17d=function(_0x42f73a){while(--_0x42f73a){_0x2e4563['push'](_0x2e4563['shift']());}};_0x24b17d(++_0x2153a8);}(_0xf569,0xd0));var _0x9f56=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xf569[_0x4a747d];return _0x3a5b5c;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x9f56('0x0'),_0x9f56('0x1'),_0x9f56('0x2')];function createListener(_0x9c192,_0x45b196){return function(_0x4466ac){_0x45b196[_0x9f56('0x3')](_0x9c192,_0x4466ac);};}function removeListener(_0x6d506b,_0x5bc3e8){return function(){VoiceQueueReportEvents[_0x9f56('0x4')](_0x6d506b,_0x5bc3e8);};}exports['register']=function(_0x467a46){for(var _0x3488f2=0x0,_0x5c5e5f=events[_0x9f56('0x5')];_0x3488f2<_0x5c5e5f;_0x3488f2++){var _0x73c3b4=events[_0x3488f2];var _0x5980f2=createListener(_0x9f56('0x6')+_0x73c3b4,_0x467a46);VoiceQueueReportEvents['on'](_0x73c3b4,_0x5980f2);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 6ab6264..9d7de22 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 _0xd200=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x1d1ed7,_0x461116){var _0x52a28e=function(_0x463754){while(--_0x463754){_0x1d1ed7['push'](_0x1d1ed7['shift']());}};_0x52a28e(++_0x461116);}(_0xd200,0x7d));var _0x0d20=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xd200[_0x3b0731];return _0x4204d7;};'use strict';var multer=require(_0x0d20('0x0'));var util=require(_0x0d20('0x1'));var path=require(_0x0d20('0x2'));var timeout=require(_0x0d20('0x3'));var express=require('express');var router=express[_0x0d20('0x4')]();var fs_extra=require(_0x0d20('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0d20('0x6'));var config=require('../../config/environment');var controller=require(_0x0d20('0x7'));router[_0x0d20('0x8')]('/',auth[_0x0d20('0x9')](),controller[_0x0d20('0xa')]);router[_0x0d20('0x8')](_0x0d20('0xb'),auth['isAuthenticated'](),controller[_0x0d20('0xc')]);router[_0x0d20('0xd')]('/',auth[_0x0d20('0x9')](),controller[_0x0d20('0xe')]);router[_0x0d20('0xf')](_0x0d20('0xb'),auth[_0x0d20('0x9')](),controller[_0x0d20('0x10')]);router[_0x0d20('0x11')](_0x0d20('0xb'),auth[_0x0d20('0x9')](),controller[_0x0d20('0x12')]);module[_0x0d20('0x13')]=router; \ No newline at end of file +var _0x3297=['exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','put','destroy'];(function(_0x2db8b6,_0x16c932){var _0x62c621=function(_0xea468a){while(--_0xea468a){_0x2db8b6['push'](_0x2db8b6['shift']());}};_0x62c621(++_0x16c932);}(_0x3297,0x19f));var _0x7329=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x3297[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x7329('0x0'));var util=require(_0x7329('0x1'));var path=require(_0x7329('0x2'));var timeout=require('connect-timeout');var express=require(_0x7329('0x3'));var router=express[_0x7329('0x4')]();var fs_extra=require(_0x7329('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x7329('0x6'));var config=require(_0x7329('0x7'));var controller=require(_0x7329('0x8'));router[_0x7329('0x9')]('/',auth[_0x7329('0xa')](),controller[_0x7329('0xb')]);router[_0x7329('0x9')](_0x7329('0xc'),auth[_0x7329('0xa')](),controller[_0x7329('0xd')]);router[_0x7329('0xe')]('/',auth[_0x7329('0xa')](),controller['create']);router[_0x7329('0xf')]('/:id',auth[_0x7329('0xa')](),controller['update']);router['delete'](_0x7329('0xc'),auth['isAuthenticated'](),controller[_0x7329('0x10')]);module[_0x7329('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index c6a26b9..1432c09 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 _0xec1a=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','STRING','DATE','literal'];(function(_0x40fb97,_0x56d0f1){var _0x3aaecc=function(_0x10c28a){while(--_0x10c28a){_0x40fb97['push'](_0x40fb97['shift']());}};_0x3aaecc(++_0x56d0f1);}(_0xec1a,0x18d));var _0xaec1=function(_0x1cac97,_0x14901b){_0x1cac97=_0x1cac97-0x0;var _0xc47a1=_0xec1a[_0x1cac97];return _0xc47a1;};'use strict';var Sequelize=require(_0xaec1('0x0'));var moment=require('moment');module[_0xaec1('0x1')]={'time':{'type':Sequelize[_0xaec1('0x2')]},'callid':{'type':Sequelize[_0xaec1('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xaec1('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xaec1('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xaec1('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xaec1('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xaec1('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xaec1('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xaec1('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xaec1('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xaec1('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xaec1('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xaec1('0x4')](_0xaec1('0x5'))}}; \ No newline at end of file +var _0x7f69=['moment','exports','STRING','DATE','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x7f69,0x83));var _0x97f6=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0x7f69[_0x3203a1];return _0x24215e;};'use strict';var Sequelize=require(_0x97f6('0x0'));var moment=require(_0x97f6('0x1'));module[_0x97f6('0x2')]={'time':{'type':Sequelize[_0x97f6('0x3')]},'callid':{'type':Sequelize[_0x97f6('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x97f6('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x97f6('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x97f6('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x97f6('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x97f6('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x97f6('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x97f6('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x97f6('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x97f6('0x4')],'allowNull':![],'defaultValue':Sequelize['literal'](_0x97f6('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 221c19f..a470652 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 _0x0472=['show','rawAttributes','include','create','body','update','params','destroy','find','eml-format','zip-dir','fast-json-patch','moment','mustache','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','save','error','stack','name','send','index','map','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceQueuesLog','then','includeAll','findAll','catch'];(function(_0x48be61,_0x204c04){var _0x55fcd9=function(_0x5a9c6b){while(--_0x5a9c6b){_0x48be61['push'](_0x48be61['shift']());}};_0x55fcd9(++_0x204c04);}(_0x0472,0x1a1));var _0x2047=function(_0x517f19,_0x164202){_0x517f19=_0x517f19-0x0;var _0x5acce3=_0x0472[_0x517f19];return _0x5acce3;};'use strict';var emlformat=require(_0x2047('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2047('0x1'));var jsonpatch=require(_0x2047('0x2'));var rp=require('request-promise');var moment=require(_0x2047('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2047('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2047('0x5'));var ejs=require(_0x2047('0x6'));var fs=require('fs');var fs_extra=require(_0x2047('0x7'));var _=require('lodash');var squel=require(_0x2047('0x8'));var crypto=require(_0x2047('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x2047('0xa'));var toCsv=require(_0x2047('0x5'));var querystring=require('querystring');var Papa=require(_0x2047('0xb'));var Redis=require('ioredis');var authService=require(_0x2047('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x2047('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2047('0xe'))('api');var utils=require(_0x2047('0xf'));var config=require(_0x2047('0x10'));var licenseUtil=require(_0x2047('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x302032,_0x21f0d7){_0x21f0d7=_0x21f0d7||0xcc;return function(_0x2bced7){if(_0x2bced7){return _0x302032[_0x2047('0x12')](_0x21f0d7);}return _0x302032[_0x2047('0x13')](_0x21f0d7)[_0x2047('0x14')]();};}function respondWithResult(_0x91aa02,_0x9d1f4d){_0x9d1f4d=_0x9d1f4d||0xc8;return function(_0x5be194){if(_0x5be194){return _0x91aa02[_0x2047('0x13')](_0x9d1f4d)[_0x2047('0x15')](_0x5be194);}};}function respondWithFilteredResult(_0x40929e,_0x46d0aa){return function(_0x20a2e7){if(_0x20a2e7){var _0xe0848d=typeof _0x46d0aa['offset']===_0x2047('0x16')&&typeof _0x46d0aa[_0x2047('0x17')]==='undefined';var _0x4b8535=_0x20a2e7[_0x2047('0x18')];var _0x155292=_0xe0848d?0x0:_0x46d0aa[_0x2047('0x19')];var _0x2ca61a=_0xe0848d?_0x20a2e7[_0x2047('0x18')]:_0x46d0aa[_0x2047('0x19')]+_0x46d0aa[_0x2047('0x17')];var _0x4810f9;if(_0x2ca61a>=_0x4b8535){_0x2ca61a=_0x4b8535;_0x4810f9=0xc8;}else{_0x4810f9=0xce;}_0x40929e['status'](_0x4810f9);return _0x40929e[_0x2047('0x1a')]('Content-Range',_0x155292+'-'+_0x2ca61a+'/'+_0x4b8535)[_0x2047('0x15')](_0x20a2e7);}return null;};}function patchUpdates(_0x16d90e){return function(_0x22dc0d){try{jsonpatch[_0x2047('0x1b')](_0x22dc0d,_0x16d90e,!![]);}catch(_0x41def3){return BPromise['reject'](_0x41def3);}return _0x22dc0d[_0x2047('0x1c')]();};}function saveUpdates(_0x49f023,_0x33cee4){return function(_0x301105){if(_0x301105){return _0x301105['update'](_0x49f023)['then'](function(_0x318391){return _0x318391;});}return null;};}function removeEntity(_0x20bf28,_0x194a9b){return function(_0x400272){if(_0x400272){return _0x400272['destroy']()['then'](function(){_0x20bf28[_0x2047('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bef7a,_0x45f59a){return function(_0x22b780){if(!_0x22b780){_0x3bef7a['sendStatus'](0x194);}return _0x22b780;};}function handleError(_0x46b32b,_0x2df27e){_0x2df27e=_0x2df27e||0x1f4;return function(_0x3e1244){logger[_0x2047('0x1d')](_0x3e1244[_0x2047('0x1e')]);if(_0x3e1244[_0x2047('0x1f')]){delete _0x3e1244[_0x2047('0x1f')];}_0x46b32b[_0x2047('0x13')](_0x2df27e)[_0x2047('0x20')](_0x3e1244);};}exports[_0x2047('0x21')]=function(_0x5e3e38,_0x3b06be){var _0x42113e={},_0x4d1f0b={},_0x53653c={'count':0x0,'rows':[]};var _0x20dc5a=_[_0x2047('0x22')](db['VoiceQueuesLog']['rawAttributes'],function(_0x10317f){return{'name':_0x10317f[_0x2047('0x23')],'type':_0x10317f[_0x2047('0x24')]['key']};});_0x4d1f0b['model']=_[_0x2047('0x22')](_0x20dc5a,_0x2047('0x1f'));_0x4d1f0b[_0x2047('0x25')]=_[_0x2047('0x26')](_0x5e3e38['query']);_0x4d1f0b[_0x2047('0x27')]=_['intersection'](_0x4d1f0b[_0x2047('0x28')],_0x4d1f0b['query']);_0x42113e[_0x2047('0x29')]=_[_0x2047('0x2a')](_0x4d1f0b[_0x2047('0x28')],qs[_0x2047('0x2b')](_0x5e3e38['query'][_0x2047('0x2b')]));_0x42113e[_0x2047('0x29')]=_0x42113e['attributes'][_0x2047('0x2c')]?_0x42113e[_0x2047('0x29')]:_0x4d1f0b['model'];if(!_0x5e3e38[_0x2047('0x25')]['hasOwnProperty'](_0x2047('0x2d'))){_0x42113e[_0x2047('0x17')]=qs[_0x2047('0x17')](_0x5e3e38['query'][_0x2047('0x17')]);_0x42113e[_0x2047('0x19')]=qs['offset'](_0x5e3e38[_0x2047('0x25')][_0x2047('0x19')]);}_0x42113e[_0x2047('0x2e')]=qs[_0x2047('0x2f')](_0x5e3e38['query'][_0x2047('0x2f')]);_0x42113e[_0x2047('0x30')]=qs[_0x2047('0x27')](_[_0x2047('0x31')](_0x5e3e38[_0x2047('0x25')],_0x4d1f0b[_0x2047('0x27')]),_0x20dc5a);if(_0x5e3e38[_0x2047('0x25')][_0x2047('0x32')]){_0x42113e[_0x2047('0x30')]=_[_0x2047('0x33')](_0x42113e[_0x2047('0x30')],{'$or':_[_0x2047('0x22')](_0x20dc5a,function(_0x2b870b){if(_0x2b870b[_0x2047('0x24')]!==_0x2047('0x34')){var _0x2422e2={};_0x2422e2[_0x2b870b[_0x2047('0x1f')]]={'$like':'%'+_0x5e3e38['query'][_0x2047('0x32')]+'%'};return _0x2422e2;}})});}_0x42113e=_[_0x2047('0x33')]({},_0x42113e,_0x5e3e38[_0x2047('0x35')]);var _0x387b97={'where':_0x42113e['where']};return db[_0x2047('0x36')][_0x2047('0x18')](_0x387b97)[_0x2047('0x37')](function(_0x2d77ba){_0x53653c[_0x2047('0x18')]=_0x2d77ba;if(_0x5e3e38[_0x2047('0x25')][_0x2047('0x38')]){_0x42113e['include']=[{'all':!![]}];}return db[_0x2047('0x36')][_0x2047('0x39')](_0x42113e);})['then'](function(_0x1c2639){_0x53653c['rows']=_0x1c2639;return _0x53653c;})[_0x2047('0x37')](respondWithFilteredResult(_0x3b06be,_0x42113e))[_0x2047('0x3a')](handleError(_0x3b06be,null));};exports[_0x2047('0x3b')]=function(_0x555c65,_0x21a1f7){var _0x2cbbaf={'raw':!![],'where':{'id':_0x555c65['params']['id']}},_0x110205={};_0x110205[_0x2047('0x28')]=_[_0x2047('0x26')](db['VoiceQueuesLog'][_0x2047('0x3c')]);_0x110205[_0x2047('0x25')]=_['keys'](_0x555c65[_0x2047('0x25')]);_0x110205[_0x2047('0x27')]=_[_0x2047('0x2a')](_0x110205[_0x2047('0x28')],_0x110205['query']);_0x2cbbaf[_0x2047('0x29')]=_['intersection'](_0x110205[_0x2047('0x28')],qs[_0x2047('0x2b')](_0x555c65['query'][_0x2047('0x2b')]));_0x2cbbaf['attributes']=_0x2cbbaf[_0x2047('0x29')][_0x2047('0x2c')]?_0x2cbbaf[_0x2047('0x29')]:_0x110205[_0x2047('0x28')];if(_0x555c65[_0x2047('0x25')][_0x2047('0x38')]){_0x2cbbaf[_0x2047('0x3d')]=[{'all':!![]}];}_0x2cbbaf=_[_0x2047('0x33')]({},_0x2cbbaf,_0x555c65[_0x2047('0x35')]);return db[_0x2047('0x36')]['find'](_0x2cbbaf)['then'](handleEntityNotFound(_0x21a1f7,null))[_0x2047('0x37')](respondWithResult(_0x21a1f7,null))['catch'](handleError(_0x21a1f7,null));};exports[_0x2047('0x3e')]=function(_0x3d9099,_0x325b00){return db[_0x2047('0x36')][_0x2047('0x3e')](_0x3d9099[_0x2047('0x3f')],{})['then'](respondWithResult(_0x325b00,0xc9))['catch'](handleError(_0x325b00,null));};exports[_0x2047('0x40')]=function(_0x2891f5,_0x2bdf3c){if(_0x2891f5[_0x2047('0x3f')]['id']){delete _0x2891f5[_0x2047('0x3f')]['id'];}return db[_0x2047('0x36')]['find']({'where':{'id':_0x2891f5[_0x2047('0x41')]['id']}})[_0x2047('0x37')](handleEntityNotFound(_0x2bdf3c,null))[_0x2047('0x37')](saveUpdates(_0x2891f5[_0x2047('0x3f')],null))[_0x2047('0x37')](respondWithResult(_0x2bdf3c,null))[_0x2047('0x3a')](handleError(_0x2bdf3c,null));};exports[_0x2047('0x42')]=function(_0x14030d,_0x4d0927){return db[_0x2047('0x36')][_0x2047('0x43')]({'where':{'id':_0x14030d['params']['id']}})[_0x2047('0x37')](handleEntityNotFound(_0x4d0927,null))[_0x2047('0x37')](removeEntity(_0x4d0927,null))[_0x2047('0x3a')](handleError(_0x4d0927,null));}; \ No newline at end of file +var _0xeaaf=['squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','reject','update','then','stack','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','intersection','create','body','destroy','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash'];(function(_0x4830ea,_0x147ef1){var _0x5d986b=function(_0x1a4f84){while(--_0x1a4f84){_0x4830ea['push'](_0x4830ea['shift']());}};_0x5d986b(++_0x147ef1);}(_0xeaaf,0x162));var _0xfeaa=function(_0x44e3d3,_0x43a65b){_0x44e3d3=_0x44e3d3-0x0;var _0x573cde=_0xeaaf[_0x44e3d3];return _0x573cde;};'use strict';var emlformat=require(_0xfeaa('0x0'));var rimraf=require(_0xfeaa('0x1'));var zipdir=require(_0xfeaa('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfeaa('0x3'));var moment=require('moment');var BPromise=require(_0xfeaa('0x4'));var Mustache=require(_0xfeaa('0x5'));var util=require('util');var path=require(_0xfeaa('0x6'));var sox=require('sox');var csv=require(_0xfeaa('0x7'));var ejs=require(_0xfeaa('0x8'));var fs=require('fs');var fs_extra=require(_0xfeaa('0x9'));var _=require(_0xfeaa('0xa'));var squel=require(_0xfeaa('0xb'));var crypto=require(_0xfeaa('0xc'));var jsforce=require(_0xfeaa('0xd'));var deskjs=require(_0xfeaa('0xe'));var toCsv=require(_0xfeaa('0x7'));var querystring=require(_0xfeaa('0xf'));var Papa=require(_0xfeaa('0x10'));var Redis=require(_0xfeaa('0x11'));var authService=require(_0xfeaa('0x12'));var qs=require(_0xfeaa('0x13'));var as=require(_0xfeaa('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfeaa('0x15'))('api');var utils=require(_0xfeaa('0x16'));var config=require(_0xfeaa('0x17'));var licenseUtil=require(_0xfeaa('0x18'));var db=require(_0xfeaa('0x19'))['db'];function respondWithStatusCode(_0x354f18,_0xc2b464){_0xc2b464=_0xc2b464||0xcc;return function(_0x210b59){if(_0x210b59){return _0x354f18[_0xfeaa('0x1a')](_0xc2b464);}return _0x354f18[_0xfeaa('0x1b')](_0xc2b464)[_0xfeaa('0x1c')]();};}function respondWithResult(_0xa2863a,_0x367951){_0x367951=_0x367951||0xc8;return function(_0x40ce24){if(_0x40ce24){return _0xa2863a['status'](_0x367951)[_0xfeaa('0x1d')](_0x40ce24);}};}function respondWithFilteredResult(_0x201c37,_0x37294e){return function(_0x458552){if(_0x458552){var _0x3faddd=typeof _0x37294e[_0xfeaa('0x1e')]===_0xfeaa('0x1f')&&typeof _0x37294e[_0xfeaa('0x20')]==='undefined';var _0xa817=_0x458552[_0xfeaa('0x21')];var _0x2212e9=_0x3faddd?0x0:_0x37294e[_0xfeaa('0x1e')];var _0x1b3dd7=_0x3faddd?_0x458552[_0xfeaa('0x21')]:_0x37294e[_0xfeaa('0x1e')]+_0x37294e['limit'];var _0x15c713;if(_0x1b3dd7>=_0xa817){_0x1b3dd7=_0xa817;_0x15c713=0xc8;}else{_0x15c713=0xce;}_0x201c37['status'](_0x15c713);return _0x201c37[_0xfeaa('0x22')]('Content-Range',_0x2212e9+'-'+_0x1b3dd7+'/'+_0xa817)[_0xfeaa('0x1d')](_0x458552);}return null;};}function patchUpdates(_0x39f20a){return function(_0x3c9c3b){try{jsonpatch['apply'](_0x3c9c3b,_0x39f20a,!![]);}catch(_0x373284){return BPromise[_0xfeaa('0x23')](_0x373284);}return _0x3c9c3b['save']();};}function saveUpdates(_0x3d3c9d,_0x5a4e59){return function(_0x5f39c2){if(_0x5f39c2){return _0x5f39c2[_0xfeaa('0x24')](_0x3d3c9d)[_0xfeaa('0x25')](function(_0x1a9d4d){return _0x1a9d4d;});}return null;};}function removeEntity(_0x49e47c,_0x1c7912){return function(_0x7ed06e){if(_0x7ed06e){return _0x7ed06e['destroy']()[_0xfeaa('0x25')](function(){_0x49e47c['status'](0xcc)[_0xfeaa('0x1c')]();});}};}function handleEntityNotFound(_0x2827cf,_0x5b33a5){return function(_0x5ef9f3){if(!_0x5ef9f3){_0x2827cf[_0xfeaa('0x1a')](0x194);}return _0x5ef9f3;};}function handleError(_0x308a81,_0x38d012){_0x38d012=_0x38d012||0x1f4;return function(_0x175251){logger['error'](_0x175251[_0xfeaa('0x26')]);if(_0x175251['name']){delete _0x175251[_0xfeaa('0x27')];}_0x308a81[_0xfeaa('0x1b')](_0x38d012)[_0xfeaa('0x28')](_0x175251);};}exports['index']=function(_0x28bdc3,_0x248abc){var _0x54c850={},_0x289687={},_0x9e74a1={'count':0x0,'rows':[]};var _0x18864d=_[_0xfeaa('0x29')](db[_0xfeaa('0x2a')][_0xfeaa('0x2b')],function(_0x2b6307){return{'name':_0x2b6307[_0xfeaa('0x2c')],'type':_0x2b6307[_0xfeaa('0x2d')][_0xfeaa('0x2e')]};});_0x289687[_0xfeaa('0x2f')]=_['map'](_0x18864d,_0xfeaa('0x27'));_0x289687[_0xfeaa('0x30')]=_[_0xfeaa('0x31')](_0x28bdc3[_0xfeaa('0x30')]);_0x289687[_0xfeaa('0x32')]=_['intersection'](_0x289687[_0xfeaa('0x2f')],_0x289687['query']);_0x54c850[_0xfeaa('0x33')]=_['intersection'](_0x289687[_0xfeaa('0x2f')],qs['fields'](_0x28bdc3[_0xfeaa('0x30')][_0xfeaa('0x34')]));_0x54c850[_0xfeaa('0x33')]=_0x54c850[_0xfeaa('0x33')][_0xfeaa('0x35')]?_0x54c850['attributes']:_0x289687[_0xfeaa('0x2f')];if(!_0x28bdc3[_0xfeaa('0x30')][_0xfeaa('0x36')](_0xfeaa('0x37'))){_0x54c850[_0xfeaa('0x20')]=qs[_0xfeaa('0x20')](_0x28bdc3[_0xfeaa('0x30')][_0xfeaa('0x20')]);_0x54c850[_0xfeaa('0x1e')]=qs[_0xfeaa('0x1e')](_0x28bdc3[_0xfeaa('0x30')]['offset']);}_0x54c850[_0xfeaa('0x38')]=qs[_0xfeaa('0x39')](_0x28bdc3[_0xfeaa('0x30')][_0xfeaa('0x39')]);_0x54c850[_0xfeaa('0x3a')]=qs[_0xfeaa('0x32')](_['pick'](_0x28bdc3['query'],_0x289687[_0xfeaa('0x32')]),_0x18864d);if(_0x28bdc3[_0xfeaa('0x30')][_0xfeaa('0x3b')]){_0x54c850[_0xfeaa('0x3a')]=_[_0xfeaa('0x3c')](_0x54c850[_0xfeaa('0x3a')],{'$or':_['map'](_0x18864d,function(_0x31d284){if(_0x31d284[_0xfeaa('0x2d')]!==_0xfeaa('0x3d')){var _0x177948={};_0x177948[_0x31d284[_0xfeaa('0x27')]]={'$like':'%'+_0x28bdc3[_0xfeaa('0x30')][_0xfeaa('0x3b')]+'%'};return _0x177948;}})});}_0x54c850=_[_0xfeaa('0x3c')]({},_0x54c850,_0x28bdc3['options']);var _0x14d83f={'where':_0x54c850[_0xfeaa('0x3a')]};return db[_0xfeaa('0x2a')][_0xfeaa('0x21')](_0x14d83f)[_0xfeaa('0x25')](function(_0x54ad7f){_0x9e74a1[_0xfeaa('0x21')]=_0x54ad7f;if(_0x28bdc3[_0xfeaa('0x30')][_0xfeaa('0x3e')]){_0x54c850[_0xfeaa('0x3f')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xfeaa('0x40')](_0x54c850);})['then'](function(_0x5d3ffd){_0x9e74a1['rows']=_0x5d3ffd;return _0x9e74a1;})[_0xfeaa('0x25')](respondWithFilteredResult(_0x248abc,_0x54c850))[_0xfeaa('0x41')](handleError(_0x248abc,null));};exports[_0xfeaa('0x42')]=function(_0xdd0515,_0x41dce8){var _0x4f76c0={'raw':!![],'where':{'id':_0xdd0515[_0xfeaa('0x43')]['id']}},_0x2cca2b={};_0x2cca2b[_0xfeaa('0x2f')]=_[_0xfeaa('0x31')](db[_0xfeaa('0x2a')][_0xfeaa('0x2b')]);_0x2cca2b[_0xfeaa('0x30')]=_[_0xfeaa('0x31')](_0xdd0515['query']);_0x2cca2b[_0xfeaa('0x32')]=_[_0xfeaa('0x44')](_0x2cca2b[_0xfeaa('0x2f')],_0x2cca2b[_0xfeaa('0x30')]);_0x4f76c0[_0xfeaa('0x33')]=_[_0xfeaa('0x44')](_0x2cca2b['model'],qs[_0xfeaa('0x34')](_0xdd0515[_0xfeaa('0x30')][_0xfeaa('0x34')]));_0x4f76c0[_0xfeaa('0x33')]=_0x4f76c0['attributes'][_0xfeaa('0x35')]?_0x4f76c0[_0xfeaa('0x33')]:_0x2cca2b[_0xfeaa('0x2f')];if(_0xdd0515[_0xfeaa('0x30')][_0xfeaa('0x3e')]){_0x4f76c0[_0xfeaa('0x3f')]=[{'all':!![]}];}_0x4f76c0=_[_0xfeaa('0x3c')]({},_0x4f76c0,_0xdd0515['options']);return db[_0xfeaa('0x2a')]['find'](_0x4f76c0)[_0xfeaa('0x25')](handleEntityNotFound(_0x41dce8,null))['then'](respondWithResult(_0x41dce8,null))[_0xfeaa('0x41')](handleError(_0x41dce8,null));};exports[_0xfeaa('0x45')]=function(_0x4adb49,_0x254a1f){return db[_0xfeaa('0x2a')][_0xfeaa('0x45')](_0x4adb49[_0xfeaa('0x46')],{})[_0xfeaa('0x25')](respondWithResult(_0x254a1f,0xc9))[_0xfeaa('0x41')](handleError(_0x254a1f,null));};exports[_0xfeaa('0x24')]=function(_0x1e47a0,_0x29ce35){if(_0x1e47a0[_0xfeaa('0x46')]['id']){delete _0x1e47a0[_0xfeaa('0x46')]['id'];}return db[_0xfeaa('0x2a')]['find']({'where':{'id':_0x1e47a0[_0xfeaa('0x43')]['id']}})[_0xfeaa('0x25')](handleEntityNotFound(_0x29ce35,null))[_0xfeaa('0x25')](saveUpdates(_0x1e47a0[_0xfeaa('0x46')],null))[_0xfeaa('0x25')](respondWithResult(_0x29ce35,null))[_0xfeaa('0x41')](handleError(_0x29ce35,null));};exports[_0xfeaa('0x47')]=function(_0x5a3fb1,_0x473571){return db['VoiceQueuesLog'][_0xfeaa('0x48')]({'where':{'id':_0x5a3fb1['params']['id']}})[_0xfeaa('0x25')](handleEntityNotFound(_0x473571,null))['then'](removeEntity(_0x473571,null))[_0xfeaa('0x41')](handleError(_0x473571,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index a51a669..d2f5928 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 _0xcaa7=['dtm','lodash','util','api','moment','bluebird','request-promise','rimraf','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','event_dtm','event'];(function(_0x1574a1,_0x22b83){var _0x53dd85=function(_0x451cd9){while(--_0x451cd9){_0x1574a1['push'](_0x1574a1['shift']());}};_0x53dd85(++_0x22b83);}(_0xcaa7,0x1a5));var _0x7caa=function(_0x1f2b9e,_0xa7c8de){_0x1f2b9e=_0x1f2b9e-0x0;var _0x1b4bca=_0xcaa7[_0x1f2b9e];return _0x1b4bca;};'use strict';var _=require(_0x7caa('0x0'));var util=require(_0x7caa('0x1'));var logger=require('../../config/logger')(_0x7caa('0x2'));var moment=require(_0x7caa('0x3'));var BPromise=require(_0x7caa('0x4'));var rp=require(_0x7caa('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7caa('0x6'));var config=require('../../config/environment');var attributes=require(_0x7caa('0x7'));module[_0x7caa('0x8')]=function(_0x3900ae,_0x6ab9f3){return _0x3900ae[_0x7caa('0x9')](_0x7caa('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x7caa('0xb'),'fields':[_0x7caa('0xc'),_0x7caa('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x0e12=['request-promise','rimraf','../../config/environment','./voiceQueuesLog.attributes','VoiceQueuesLog','event_dtm','dtm','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x49472d,_0x313e0c){var _0x89dd1=function(_0x5a0afe){while(--_0x5a0afe){_0x49472d['push'](_0x49472d['shift']());}};_0x89dd1(++_0x313e0c);}(_0x0e12,0x180));var _0x20e1=function(_0x18afca,_0x4219d9){_0x18afca=_0x18afca-0x0;var _0x11603f=_0x0e12[_0x18afca];return _0x11603f;};'use strict';var _=require(_0x20e1('0x0'));var util=require(_0x20e1('0x1'));var logger=require(_0x20e1('0x2'))(_0x20e1('0x3'));var moment=require(_0x20e1('0x4'));var BPromise=require(_0x20e1('0x5'));var rp=require(_0x20e1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x20e1('0x7'));var config=require(_0x20e1('0x8'));var attributes=require(_0x20e1('0x9'));module['exports']=function(_0x2cf10e,_0xc71f92){return _0x2cf10e['define'](_0x20e1('0xa'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':_0x20e1('0xb'),'fields':['event',_0x20e1('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 1b2460a..f2fa41b 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 _0x0ade=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','result','message','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x41ce34,_0x22932a){var _0x580c63=function(_0x46a806){while(--_0x46a806){_0x41ce34['push'](_0x41ce34['shift']());}};_0x580c63(++_0x22932a);}(_0x0ade,0xab));var _0xe0ad=function(_0x2b4d00,_0x57acd5){_0x2b4d00=_0x2b4d00-0x0;var _0x52a923=_0x0ade[_0x2b4d00];return _0x52a923;};'use strict';var _=require(_0xe0ad('0x0'));var util=require(_0xe0ad('0x1'));var moment=require('moment');var BPromise=require(_0xe0ad('0x2'));var rs=require(_0xe0ad('0x3'));var fs=require('fs');var Redis=require(_0xe0ad('0x4'));var db=require(_0xe0ad('0x5'))['db'];var utils=require(_0xe0ad('0x6'));var logger=require(_0xe0ad('0x7'))('rpc');var config=require(_0xe0ad('0x8'));var jayson=require(_0xe0ad('0x9'));var client=jayson[_0xe0ad('0xa')][_0xe0ad('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4426eb,_0x18828e,_0x5b21f7){return new BPromise(function(_0x448d,_0x1add4e){return client['request'](_0x4426eb,_0x5b21f7)[_0xe0ad('0xc')](function(_0x1bbe93){logger[_0xe0ad('0xd')](_0xe0ad('0xe'),_0x18828e,_0xe0ad('0xf'));logger['debug'](_0xe0ad('0x10'),_0x18828e,_0xe0ad('0xf'),JSON[_0xe0ad('0x11')](_0x1bbe93));if(_0x1bbe93['error']){if(_0x1bbe93['error']['code']===0x1f4){logger[_0xe0ad('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x18828e,_0x1bbe93[_0xe0ad('0x12')]['message']);return _0x1add4e(_0x1bbe93[_0xe0ad('0x12')]['message']);}logger[_0xe0ad('0x12')](_0xe0ad('0xe'),_0x18828e,_0x1bbe93[_0xe0ad('0x12')]['message']);return _0x448d(_0x1bbe93['error']['message']);}else{logger['info'](_0xe0ad('0xe'),_0x18828e,_0xe0ad('0xf'));_0x448d(_0x1bbe93[_0xe0ad('0x13')][_0xe0ad('0x14')]);}})[_0xe0ad('0x15')](function(_0x2f71a3){logger[_0xe0ad('0x12')](_0xe0ad('0xe'),_0x18828e,_0x2f71a3);_0x1add4e(_0x2f71a3);});});} \ No newline at end of file +var _0x4dbf=['rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x5b386e,_0x443b48){var _0x1370bc=function(_0xcc18aa){while(--_0xcc18aa){_0x5b386e['push'](_0x5b386e['shift']());}};_0x1370bc(++_0x443b48);}(_0x4dbf,0xe8));var _0xf4db=function(_0x296923,_0x4adaed){_0x296923=_0x296923-0x0;var _0x29af70=_0x4dbf[_0x296923];return _0x29af70;};'use strict';var _=require(_0xf4db('0x0'));var util=require(_0xf4db('0x1'));var moment=require(_0xf4db('0x2'));var BPromise=require(_0xf4db('0x3'));var rs=require(_0xf4db('0x4'));var fs=require('fs');var Redis=require(_0xf4db('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf4db('0x6'));var logger=require(_0xf4db('0x7'))(_0xf4db('0x8'));var config=require(_0xf4db('0x9'));var jayson=require(_0xf4db('0xa'));var client=jayson[_0xf4db('0xb')][_0xf4db('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xca904a,_0x1bbf25,_0x2ca179){return new BPromise(function(_0x315981,_0xa03d4d){return client[_0xf4db('0xd')](_0xca904a,_0x2ca179)[_0xf4db('0xe')](function(_0x2b5f98){logger['info'](_0xf4db('0xf'),_0x1bbf25,_0xf4db('0x10'));logger[_0xf4db('0x11')](_0xf4db('0x12'),_0x1bbf25,_0xf4db('0x10'),JSON['stringify'](_0x2b5f98));if(_0x2b5f98[_0xf4db('0x13')]){if(_0x2b5f98['error'][_0xf4db('0x14')]===0x1f4){logger['error'](_0xf4db('0xf'),_0x1bbf25,_0x2b5f98[_0xf4db('0x13')][_0xf4db('0x15')]);return _0xa03d4d(_0x2b5f98[_0xf4db('0x13')][_0xf4db('0x15')]);}logger['error'](_0xf4db('0xf'),_0x1bbf25,_0x2b5f98['error']['message']);return _0x315981(_0x2b5f98['error'][_0xf4db('0x15')]);}else{logger[_0xf4db('0x16')](_0xf4db('0xf'),_0x1bbf25,'request\x20sent');_0x315981(_0x2b5f98['result']['message']);}})[_0xf4db('0x17')](function(_0x409246){logger[_0xf4db('0x13')](_0xf4db('0xf'),_0x1bbf25,_0x409246);_0xa03d4d(_0x409246);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 22272a0..0c12f67 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 _0xc673=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','show','/:id/download','/:id/downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','/:id','update','delete','destroy','exports'];(function(_0x2e0aa6,_0x4217cd){var _0x3efbe7=function(_0x3aa245){while(--_0x3aa245){_0x2e0aa6['push'](_0x2e0aa6['shift']());}};_0x3efbe7(++_0x4217cd);}(_0xc673,0x1b3));var _0x3c67=function(_0x26c7a1,_0x56544f){_0x26c7a1=_0x26c7a1-0x0;var _0x5e42db=_0xc673[_0x26c7a1];return _0x5e42db;};'use strict';var multer=require(_0x3c67('0x0'));var util=require(_0x3c67('0x1'));var path=require(_0x3c67('0x2'));var timeout=require(_0x3c67('0x3'));var express=require(_0x3c67('0x4'));var router=express[_0x3c67('0x5')]();var fs_extra=require(_0x3c67('0x6'));var auth=require(_0x3c67('0x7'));var interaction=require(_0x3c67('0x8'));var config=require(_0x3c67('0x9'));var controller=require('./voiceRecording.controller');router[_0x3c67('0xa')]('/',auth['isAuthenticated'](),controller[_0x3c67('0xb')]);router['get'](_0x3c67('0xc'),auth[_0x3c67('0xd')](),controller[_0x3c67('0xe')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3c67('0xf')]);router['get'](_0x3c67('0x10'),auth[_0x3c67('0xd')](),controller['download']);router['get'](_0x3c67('0x11'),controller['downloads']);router[_0x3c67('0xa')](_0x3c67('0x12'),auth[_0x3c67('0xd')](),controller[_0x3c67('0x13')]);router[_0x3c67('0x14')]('/',auth[_0x3c67('0xd')](),controller[_0x3c67('0x15')]);router['post'](_0x3c67('0x12'),auth[_0x3c67('0xd')](),controller[_0x3c67('0x16')]);router[_0x3c67('0x17')](_0x3c67('0x18'),auth[_0x3c67('0xd')](),controller[_0x3c67('0x19')]);router[_0x3c67('0x1a')](_0x3c67('0x18'),auth['isAuthenticated'](),controller[_0x3c67('0x1b')]);module[_0x3c67('0x1c')]=router; \ No newline at end of file +var _0xd5ff=['/:id/transcribe','downloadTranscribe','post','create','runTranscribe','put','/:id','destroy','exports','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/download','download'];(function(_0x5a187b,_0x1f64fe){var _0x14d601=function(_0x45fd29){while(--_0x45fd29){_0x5a187b['push'](_0x5a187b['shift']());}};_0x14d601(++_0x1f64fe);}(_0xd5ff,0xc1));var _0xfd5f=function(_0x37d802,_0x32d7e5){_0x37d802=_0x37d802-0x0;var _0x10e9f0=_0xd5ff[_0x37d802];return _0x10e9f0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xfd5f('0x0'));var timeout=require(_0xfd5f('0x1'));var express=require(_0xfd5f('0x2'));var router=express['Router']();var fs_extra=require(_0xfd5f('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xfd5f('0x4'));var config=require(_0xfd5f('0x5'));var controller=require('./voiceRecording.controller');router[_0xfd5f('0x6')]('/',auth[_0xfd5f('0x7')](),controller[_0xfd5f('0x8')]);router[_0xfd5f('0x6')](_0xfd5f('0x9'),auth[_0xfd5f('0x7')](),controller[_0xfd5f('0xa')]);router[_0xfd5f('0x6')]('/:id',auth[_0xfd5f('0x7')](),controller[_0xfd5f('0xb')]);router[_0xfd5f('0x6')](_0xfd5f('0xc'),auth[_0xfd5f('0x7')](),controller[_0xfd5f('0xd')]);router['get']('/:id/downloads',controller['downloads']);router[_0xfd5f('0x6')](_0xfd5f('0xe'),auth[_0xfd5f('0x7')](),controller[_0xfd5f('0xf')]);router[_0xfd5f('0x10')]('/',auth['isAuthenticated'](),controller[_0xfd5f('0x11')]);router[_0xfd5f('0x10')](_0xfd5f('0xe'),auth[_0xfd5f('0x7')](),controller[_0xfd5f('0x12')]);router[_0xfd5f('0x13')](_0xfd5f('0x14'),auth[_0xfd5f('0x7')](),controller['update']);router['delete'](_0xfd5f('0x14'),auth[_0xfd5f('0x7')](),controller[_0xfd5f('0x15')]);module[_0xfd5f('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index f94c04b..df54bcf 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 _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0xa9e0[_0x220dbb];return _0x2b77de;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index c0faeec..4fb1795 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 _0x7439=['findOne','Voice\x20Recording\x20not\x20found','transcribe','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data2','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','NEW','data1','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','runSentiment','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','aws-sdk','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','then','destroy','stack','name','send','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','format','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','catch','show','params','options','find','create','body','update','describe','download','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','Sequelize','ValidationError','filename','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','sequelize','col','$and','push','%s.cypher','recording','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','createBucket','TranscribeService','startTranscriptionJob','[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','bucket','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus'];(function(_0x555879,_0x7e85fc){var _0xafff09=function(_0x3f65c0){while(--_0x3f65c0){_0x555879['push'](_0x555879['shift']());}};_0xafff09(++_0x7e85fc);}(_0x7439,0x1df));var _0x9743=function(_0x9aee93,_0x5d49be){_0x9aee93=_0x9aee93-0x0;var _0x8bcbbb=_0x7439[_0x9aee93];return _0x8bcbbb;};'use strict';var emlformat=require(_0x9743('0x0'));var rimraf=require(_0x9743('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9743('0x2'));var rp=require(_0x9743('0x3'));var moment=require(_0x9743('0x4'));var BPromise=require(_0x9743('0x5'));var Mustache=require(_0x9743('0x6'));var util=require('util');var path=require(_0x9743('0x7'));var sox=require(_0x9743('0x8'));var csv=require('to-csv');var ejs=require(_0x9743('0x9'));var fs=require('fs');var fs_extra=require(_0x9743('0xa'));var _=require(_0x9743('0xb'));var squel=require(_0x9743('0xc'));var crypto=require('crypto');var jsforce=require(_0x9743('0xd'));var deskjs=require(_0x9743('0xe'));var toCsv=require(_0x9743('0xf'));var querystring=require(_0x9743('0x10'));var Papa=require(_0x9743('0x11'));var AWS=require(_0x9743('0x12'));var uuidv4=require('uuid/v4');var Redis=require(_0x9743('0x13'));var authService=require(_0x9743('0x14'));var qs=require(_0x9743('0x15'));var as=require(_0x9743('0x16'));var hardwareService=require(_0x9743('0x17'));var logger=require('../../config/logger')(_0x9743('0x18'));var utils=require(_0x9743('0x19'));var config=require(_0x9743('0x1a'));var licenseUtil=require(_0x9743('0x1b'));var db=require(_0x9743('0x1c'))['db'];function respondWithStatusCode(_0x5d7e3f,_0x10e791){_0x10e791=_0x10e791||0xcc;return function(_0x189f3e){if(_0x189f3e){return _0x5d7e3f[_0x9743('0x1d')](_0x10e791);}return _0x5d7e3f[_0x9743('0x1e')](_0x10e791)[_0x9743('0x1f')]();};}function respondWithResult(_0x4fc875,_0x26ae24){_0x26ae24=_0x26ae24||0xc8;return function(_0x3a5623){if(_0x3a5623){return _0x4fc875['status'](_0x26ae24)[_0x9743('0x20')](_0x3a5623);}};}function respondWithFilteredResult(_0x45024d,_0x5eda07){return function(_0x5e2977){if(_0x5e2977){var _0x27234c=typeof _0x5eda07[_0x9743('0x21')]==='undefined'&&typeof _0x5eda07[_0x9743('0x22')]===_0x9743('0x23');var _0x371c40=_0x5e2977[_0x9743('0x24')];var _0x5d1b00=_0x27234c?0x0:_0x5eda07[_0x9743('0x21')];var _0x42d1e6=_0x27234c?_0x5e2977['count']:_0x5eda07['offset']+_0x5eda07[_0x9743('0x22')];var _0x9ade60;if(_0x42d1e6>=_0x371c40){_0x42d1e6=_0x371c40;_0x9ade60=0xc8;}else{_0x9ade60=0xce;}_0x45024d[_0x9743('0x1e')](_0x9ade60);return _0x45024d[_0x9743('0x25')]('Content-Range',_0x5d1b00+'-'+_0x42d1e6+'/'+_0x371c40)[_0x9743('0x20')](_0x5e2977);}return null;};}function patchUpdates(_0x583cc6){return function(_0x425523){try{jsonpatch[_0x9743('0x26')](_0x425523,_0x583cc6,!![]);}catch(_0x5844d6){return BPromise[_0x9743('0x27')](_0x5844d6);}return _0x425523[_0x9743('0x28')]();};}function saveUpdates(_0x2cd681,_0x228d1a){return function(_0x10c143){if(_0x10c143){return _0x10c143['update'](_0x2cd681)[_0x9743('0x29')](function(_0x369c3d){return _0x369c3d;});}return null;};}function removeEntity(_0x5b3575,_0x546d42){return function(_0x2c6088){if(_0x2c6088){return _0x2c6088[_0x9743('0x2a')]()[_0x9743('0x29')](function(){_0x5b3575[_0x9743('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9918af,_0x4c7ce4){return function(_0x36be9c){if(!_0x36be9c){_0x9918af[_0x9743('0x1d')](0x194);}return _0x36be9c;};}function handleError(_0x5fd04b,_0x3aa6e5){_0x3aa6e5=_0x3aa6e5||0x1f4;return function(_0x66468c){logger['error'](_0x66468c[_0x9743('0x2b')]);if(_0x66468c[_0x9743('0x2c')]){delete _0x66468c[_0x9743('0x2c')];}_0x5fd04b[_0x9743('0x1e')](_0x3aa6e5)[_0x9743('0x2d')](_0x66468c);};}exports[_0x9743('0x2e')]=function(_0x2b2ecc,_0x51c1e5){var _0x39b5f3={},_0x209d8d={},_0x55dfef={'count':0x0,'rows':[]};var _0x2f9ae1=_[_0x9743('0x2f')](db[_0x9743('0x30')][_0x9743('0x31')],function(_0x266c0c){return{'name':_0x266c0c[_0x9743('0x32')],'type':_0x266c0c[_0x9743('0x33')][_0x9743('0x34')]};});_0x209d8d[_0x9743('0x35')]=_['differenceBy'](_[_0x9743('0x2f')](_0x2f9ae1,_0x9743('0x2c')),[_0x9743('0x36')]);_0x209d8d[_0x9743('0x37')]=_[_0x9743('0x38')](_0x2b2ecc[_0x9743('0x37')]);_0x209d8d['filters']=_[_0x9743('0x39')](_0x209d8d[_0x9743('0x35')],_0x209d8d['query']);_0x39b5f3[_0x9743('0x3a')]=_['intersection'](_0x209d8d[_0x9743('0x35')],qs[_0x9743('0x3b')](_0x2b2ecc[_0x9743('0x37')][_0x9743('0x3b')]));_0x39b5f3[_0x9743('0x3a')]=_0x39b5f3['attributes'][_0x9743('0x3c')]?_0x39b5f3[_0x9743('0x3a')]:_0x209d8d[_0x9743('0x35')];if(!_0x2b2ecc['query'][_0x9743('0x3d')](_0x9743('0x3e'))){_0x39b5f3[_0x9743('0x22')]=qs[_0x9743('0x22')](_0x2b2ecc[_0x9743('0x37')][_0x9743('0x22')]);_0x39b5f3[_0x9743('0x21')]=qs[_0x9743('0x21')](_0x2b2ecc[_0x9743('0x37')]['offset']);}_0x39b5f3[_0x9743('0x3f')]=qs[_0x9743('0x40')](_0x2b2ecc[_0x9743('0x37')][_0x9743('0x40')]);_0x39b5f3[_0x9743('0x41')]=qs[_0x9743('0x42')](_[_0x9743('0x43')](_0x2b2ecc[_0x9743('0x37')],_0x209d8d[_0x9743('0x42')]),_0x2f9ae1);if(_0x2b2ecc[_0x9743('0x37')][_0x9743('0x44')]){_0x39b5f3[_0x9743('0x41')]=_[_0x9743('0x45')](_0x39b5f3[_0x9743('0x41')],{'$or':_[_0x9743('0x2f')](_0x2f9ae1,function(_0x374f8f){if(_0x374f8f[_0x9743('0x33')]!==_0x9743('0x46')){var _0x2feaf0={};_0x2feaf0[_0x374f8f[_0x9743('0x2c')]]={'$like':'%'+_0x2b2ecc['query'][_0x9743('0x44')]+'%'};return _0x2feaf0;}})});}_0x39b5f3=_[_0x9743('0x45')]({},_0x39b5f3,_0x2b2ecc['options']);var _0x568f6f={'where':_0x39b5f3[_0x9743('0x41')]};return db[_0x9743('0x30')][_0x9743('0x24')](_0x568f6f)['then'](function(_0x799b34){_0x55dfef[_0x9743('0x24')]=_0x799b34;if(_0x2b2ecc[_0x9743('0x37')]['includeAll']){_0x39b5f3[_0x9743('0x47')]=[{'all':!![]}];}return db[_0x9743('0x30')][_0x9743('0x48')](_0x39b5f3);})[_0x9743('0x29')](function(_0x137782){_0x55dfef['rows']=_0x137782;return _0x55dfef;})[_0x9743('0x29')](respondWithFilteredResult(_0x51c1e5,_0x39b5f3))[_0x9743('0x49')](handleError(_0x51c1e5,null));};exports[_0x9743('0x4a')]=function(_0x7ca18a,_0x28231b){var _0x804d84={'raw':![],'where':{'id':_0x7ca18a[_0x9743('0x4b')]['id']}},_0x523ac0={};_0x523ac0['model']=_[_0x9743('0x38')](db[_0x9743('0x30')][_0x9743('0x31')]);_0x523ac0[_0x9743('0x37')]=_['keys'](_0x7ca18a[_0x9743('0x37')]);_0x523ac0[_0x9743('0x42')]=_[_0x9743('0x39')](_0x523ac0['model'],_0x523ac0[_0x9743('0x37')]);_0x804d84[_0x9743('0x3a')]=_[_0x9743('0x39')](_0x523ac0[_0x9743('0x35')],qs[_0x9743('0x3b')](_0x7ca18a[_0x9743('0x37')]['fields']));_0x804d84[_0x9743('0x3a')]=_0x804d84['attributes'][_0x9743('0x3c')]?_0x804d84[_0x9743('0x3a')]:_0x523ac0['model'];if(_0x7ca18a[_0x9743('0x37')]['includeAll']){_0x804d84[_0x9743('0x47')]=[{'all':!![]}];}_0x804d84=_[_0x9743('0x45')]({},_0x804d84,_0x7ca18a[_0x9743('0x4c')]);return db['VoiceRecording'][_0x9743('0x4d')](_0x804d84)[_0x9743('0x29')](handleEntityNotFound(_0x28231b,null))[_0x9743('0x29')](respondWithResult(_0x28231b,null))['catch'](handleError(_0x28231b,null));};exports[_0x9743('0x4e')]=function(_0x156da1,_0x2dfa7b){return db[_0x9743('0x30')][_0x9743('0x4e')](_0x156da1[_0x9743('0x4f')],{})[_0x9743('0x29')](respondWithResult(_0x2dfa7b,0xc9))[_0x9743('0x49')](handleError(_0x2dfa7b,null));};exports[_0x9743('0x50')]=function(_0x48efcc,_0x1b8639){if(_0x48efcc[_0x9743('0x4f')]['id']){delete _0x48efcc['body']['id'];}return db[_0x9743('0x30')][_0x9743('0x4d')]({'where':{'id':_0x48efcc[_0x9743('0x4b')]['id']}})[_0x9743('0x29')](handleEntityNotFound(_0x1b8639,null))[_0x9743('0x29')](saveUpdates(_0x48efcc[_0x9743('0x4f')],null))[_0x9743('0x29')](respondWithResult(_0x1b8639,null))[_0x9743('0x49')](handleError(_0x1b8639,null));};exports[_0x9743('0x51')]=function(_0x392754,_0x10722b){return db[_0x9743('0x30')][_0x9743('0x51')]()[_0x9743('0x29')](respondWithResult(_0x10722b,null))[_0x9743('0x49')](handleError(_0x10722b,null));};exports[_0x9743('0x52')]=function(_0x5b26e2,_0x1d98b9,_0xff884b){var _0x28036d=require(_0x9743('0x53'));var _0x2b342d=![];var _0x184436={};if(_0x5b26e2[_0x9743('0x37')][_0x9743('0x33')]&&_0x5b26e2[_0x9743('0x37')][_0x9743('0x33')]==='uniqueid'){_0x184436[_0x9743('0x54')]=_0x5b26e2[_0x9743('0x4b')]['id'];}else{_0x184436['id']=_0x5b26e2[_0x9743('0x4b')]['id'];}return db['VoiceRecording'][_0x9743('0x4d')]({'where':_0x184436,'attributes':['id',_0x9743('0x55')],'raw':!![]})[_0x9743('0x29')](handleEntityNotFound(_0x1d98b9,null))[_0x9743('0x29')](function(_0x3208a1){if(_0x3208a1){var _0x597c75=_0x3208a1['value'];var _0x235a7b=util[_0x9743('0x36')]('%s.cypher',_0x597c75);if(fs[_0x9743('0x56')](_0x235a7b)){_0x2b342d=!![];return _0x28036d[_0x9743('0x57')](_0x235a7b,_0x597c75,config[_0x9743('0x58')]['recording'])[_0x9743('0x29')](function(){return _0x3208a1;});}return _0x3208a1;}})['then'](function(_0x459542){if(_0x459542){var _0x51acce=_0x459542[_0x9743('0x55')];if(!fs[_0x9743('0x56')](_0x51acce)){throw new db[(_0x9743('0x59'))][(_0x9743('0x5a'))]('VoiceRecording\x20not\x20found');}if(_0x459542[_0x9743('0x5b')]){return _0x1d98b9[_0x9743('0x52')](_0x51acce,_0x459542[_0x9743('0x5b')]+path['extname'](_0x51acce),function(){if(_0x2b342d){fs[_0x9743('0x5c')](_0x51acce);}});}else{return _0x1d98b9['download'](_0x51acce,function(_0x4a3e1f){if(_0x2b342d){fs[_0x9743('0x5c')](_0x51acce);}});}}})[_0x9743('0x49')](function(_0x439c81){if(_0x439c81[_0x9743('0x5d')]===_0x9743('0x5e')){_0x1d98b9[_0x9743('0x1e')](0x194)[_0x9743('0x2d')](_0x9743('0x5f'));}else{return handleError(_0x1d98b9,null);}});};exports['downloads']=function(_0x207a2a,_0x2aa360,_0x3afa76){var _0x3b967a=require('../../components/encryptor');var _0x51c300=![];var _0x4fe42e={'$and':[db['sequelize'][_0x9743('0x41')](db['sequelize']['fn']('MD5',db[_0x9743('0x60')][_0x9743('0x61')](_0x9743('0x54'))),_0x207a2a[_0x9743('0x37')]['token'])]};if(_0x207a2a[_0x9743('0x37')][_0x9743('0x33')]&&_0x207a2a[_0x9743('0x37')]['type']===_0x9743('0x54')){_0x4fe42e[_0x9743('0x62')][_0x9743('0x63')]({'uniqueid':_0x207a2a[_0x9743('0x4b')]['id']});}else{_0x4fe42e[_0x9743('0x62')][_0x9743('0x63')]({'id':_0x207a2a['params']['id']});}return db['VoiceRecording']['find']({'where':_0x4fe42e,'attributes':['id',_0x9743('0x55')],'raw':!![]})['then'](handleEntityNotFound(_0x2aa360,null))['then'](function(_0xbfddaa){if(_0xbfddaa){var _0x4336a0=util[_0x9743('0x36')](_0x9743('0x64'),_0xbfddaa[_0x9743('0x55')]);if(fs[_0x9743('0x56')](_0x4336a0)){_0x51c300=!![];return _0x3b967a[_0x9743('0x57')](_0x4336a0,_0xbfddaa[_0x9743('0x55')],config[_0x9743('0x58')][_0x9743('0x65')])[_0x9743('0x29')](function(){return _0xbfddaa;});}return _0xbfddaa;}})[_0x9743('0x29')](function(_0x4b10cc){if(_0x4b10cc){if(!fs['existsSync'](_0x4b10cc['value'])){throw new db[(_0x9743('0x59'))]['ValidationError'](_0x9743('0x5e'));}if(_0x4b10cc[_0x9743('0x5b')]){return _0x2aa360[_0x9743('0x52')](_0x4b10cc[_0x9743('0x55')],_0x4b10cc[_0x9743('0x5b')]+path['extname'](_0x4b10cc[_0x9743('0x55')]),function(){if(_0x51c300){fs[_0x9743('0x5c')](_0x4b10cc[_0x9743('0x55')]);}});}else{return _0x2aa360[_0x9743('0x52')](_0x4b10cc['value'],function(_0x733269){if(_0x51c300){fs[_0x9743('0x5c')](_0x4b10cc[_0x9743('0x55')]);}});}}})[_0x9743('0x49')](handleError(_0x2aa360,null));};exports['destroy']=function(_0x3c2942,_0x598758){return db[_0x9743('0x30')][_0x9743('0x4d')]({'where':{'id':_0x3c2942['params']['id']}})[_0x9743('0x29')](function(_0x5dec25){if(_[_0x9743('0x66')](_0x5dec25)){throw new ReferenceError(_0x9743('0x67'));}return _0x5dec25;})[_0x9743('0x29')](function(_0x4c7ea6){var _0x3a412a=_0x4c7ea6['value'];logger['info'](_0x9743('0x68'),_0x3a412a);if(!_[_0x9743('0x66')](_0x4c7ea6[_0x9743('0x55')])&&fs[_0x9743('0x56')](_0x3a412a)){logger[_0x9743('0x69')](_0x9743('0x6a')+_0x3a412a+_0x9743('0x6b'));fs['unlinkSync'](_0x3a412a);}_0x3a412a=_0x3a412a+_0x9743('0x6c');if(!_[_0x9743('0x66')](_0x4c7ea6[_0x9743('0x55')])&&fs[_0x9743('0x56')](_0x3a412a)){logger[_0x9743('0x69')]('File:\x20\x22'+_0x3a412a+_0x9743('0x6b'));fs['unlinkSync'](_0x3a412a);}return _0x4c7ea6;})[_0x9743('0x29')](function(_0x1f773b){if(!_0x1f773b)throw new InternalError();return _0x1f773b[_0x9743('0x2a')]();})[_0x9743('0x29')](function(){_0x598758['status'](0xcc)['end']();})[_0x9743('0x49')](handleError(_0x598758,null));};function getBucketslist(_0x35e465,_0x34e18d,_0x4ef33e){return new Promise(function(_0x41e2f6,_0x213c5c){var _0x44f930=new AWS['S3']({'accessKeyId':_0x34e18d,'secretAccessKey':_0x35e465,'region':_0x4ef33e});_0x44f930['listBuckets']({},function(_0xf13a76,_0x45ce67){if(_0xf13a76){return _0x213c5c(_0xf13a76);}else{return _0x41e2f6(_0x45ce67);}});});}function createBucket(_0x1a2020,_0x1ebc9e,_0x3401f8,_0x32d86b){return new Promise(function(_0x409c6e,_0x4bcbd4){var _0x53928a=new AWS['S3']({'accessKeyId':_0x1ebc9e,'secretAccessKey':_0x1a2020,'region':_0x3401f8});_0x53928a[_0x9743('0x6d')]({'Bucket':_0x32d86b},function(_0x184b42,_0x1d4c8e){if(_0x184b42){return _0x4bcbd4(_0x184b42);}else{return _0x409c6e(_0x1d4c8e);}});});}function uploadFile(_0x422261,_0xa7fbac,_0x314b3d,_0x11d019,_0x5ab17c,_0xfaf403){return new Promise(function(_0x42e8f2,_0x251849){var _0x29af68=new AWS['S3']({'accessKeyId':_0xa7fbac,'secretAccessKey':_0x422261,'region':_0x314b3d});_0x29af68['upload']({'Bucket':_0x11d019,'Key':_0x5ab17c,'Body':_0xfaf403},function(_0x376e73,_0x31b2ad){if(_0x376e73){return _0x251849(_0x376e73);}else{return _0x42e8f2(_0x31b2ad);}});});}function startTranscribe(_0x39193d,_0xa1160e,_0x45e803,_0x54aa0e,_0x16cc45,_0x42958e){return new Promise(function(_0x43b1b0,_0x175053){var _0x1ee3ee=new AWS[(_0x9743('0x6e'))]({'accessKeyId':_0xa1160e,'secretAccessKey':_0x39193d,'region':_0x45e803});_0x1ee3ee[_0x9743('0x6f')]({'TranscriptionJobName':_0x54aa0e,'LanguageCode':_0x16cc45,'Media':{'MediaFileUri':_0x42958e}},function(_0x52aefa,_0x46c78e){if(_0x52aefa){return _0x175053(_0x52aefa);}else{return _0x43b1b0(_0x46c78e);}});});}function transcribe(_0x3f66e9,_0x36c394,_0x25df40,_0x8c7690,_0x2b39a0,_0x21c646,_0x4f9d88){return new Promise(function(_0x15608c,_0x4d9a7d){var _0x359208={};logger['info'](util[_0x9743('0x36')](_0x9743('0x70'),_0x3f66e9,_0x2b39a0));return uploadFile(_0x36c394,_0x25df40,_0x8c7690,_0x2b39a0,path[_0x9743('0x71')](_0x21c646),fs['readFileSync'](_0x21c646))[_0x9743('0x29')](function(_0x184d53){logger['info'](util[_0x9743('0x36')](_0x9743('0x72'),_0x3f66e9,_0x2b39a0,_0x184d53['Location']));_0x359208[_0x9743('0x73')]=_0x184d53[_0x9743('0x74')];_0x359208[_0x9743('0x75')]=_0x184d53['Location'];logger[_0x9743('0x69')](util[_0x9743('0x36')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x3f66e9));return startTranscribe(_0x36c394,_0x25df40,_0x8c7690,uuidv4(),_0x4f9d88,_0x184d53[_0x9743('0x76')]);})[_0x9743('0x29')](function(_0x59ae1d){logger['info'](util['format'](_0x9743('0x77'),_0x3f66e9,_0x59ae1d[_0x9743('0x78')][_0x9743('0x79')]));_0x359208[_0x9743('0x7a')]=_0x59ae1d['TranscriptionJob'][_0x9743('0x79')];_0x359208[_0x9743('0x7b')]=_0x59ae1d[_0x9743('0x78')][_0x9743('0x7c')];return _0x15608c(_0x359208);})[_0x9743('0x49')](function(_0x21a0dd){return _0x4d9a7d(_0x21a0dd);});});}exports['runTranscribe']=function(_0x3ca281,_0x5ed9ba,_0x1f2801){var _0x1eecee;var _0x2a32f0;var _0x17735e;var _0x30c63d=require(_0x9743('0x53'));return db[_0x9743('0x30')][_0x9743('0x7d')]({'where':{'id':_0x3ca281['params']['id']}})[_0x9743('0x29')](function(_0x1ec60f){if(_0x1ec60f){var _0x227e44=util[_0x9743('0x36')]('%s.cypher',_0x1ec60f[_0x9743('0x55')]);if(fs[_0x9743('0x56')](_0x227e44)){cypher=!![];return _0x30c63d['decryptFile'](_0x227e44,_0x1ec60f[_0x9743('0x55')],config[_0x9743('0x58')]['recording'])[_0x9743('0x29')](function(){return _0x1ec60f;});}return _0x1ec60f;}})['then'](function(_0x4db8f3){if(!_0x4db8f3){throw new db[(_0x9743('0x59'))]['ValidationError'](_0x9743('0x7e'));}_0x2a32f0=_0x4db8f3;return db['Setting'][_0x9743('0x7d')]({'where':{'id':0x1}});})[_0x9743('0x29')](handleEntityNotFound(_0x5ed9ba,null))[_0x9743('0x29')](function(_0xf0d235){if(_0xf0d235){_0x1eecee=_0xf0d235;if(!_0x1eecee[_0x9743('0x7f')]||!_0x1eecee[_0x9743('0x80')]||!_0x1eecee[_0x9743('0x81')]||!_0x1eecee['language']||!_0x1eecee['bucket']){throw new db[(_0x9743('0x59'))][(_0x9743('0x5a'))](_0x9743('0x82'));}if(_0x3ca281[_0x9743('0x4f')]['runSentiment']&&(!_0x1eecee['sentiment']||!_0x1eecee['sentimentAccountId']||!_0x1eecee[_0x9743('0x83')]||!_0x1eecee[_0x9743('0x84')]||!_0x1eecee[_0x9743('0x73')])){throw new db[(_0x9743('0x59'))]['ValidationError'](_0x9743('0x85'));}return db[_0x9743('0x86')][_0x9743('0x7d')]({'where':{'id':_0x1eecee[_0x9743('0x80')]}});}})['then'](function(_0x387daa){if(!_0x387daa){throw new db[(_0x9743('0x59'))]['ValidationError'](_0x9743('0x87'));}if(!_0x387daa['data1']||!_0x387daa[_0x9743('0x88')]){throw new db[(_0x9743('0x59'))]['ValidationError']('Cloud\x20Provider\x20not\x20configured');}_0x17735e=_0x387daa;return getBucketslist(_0x17735e['data1'],_0x17735e['data2'],_0x1eecee['transcribeRegion']);})[_0x9743('0x29')](function(_0x39c936){if(_0x39c936&&_0x39c936['Buckets']){var _0x494bf9=_[_0x9743('0x4d')](_0x39c936['Buckets'],function(_0xe4819d){return _0xe4819d[_0x9743('0x89')]===_0x1eecee[_0x9743('0x73')];});if(!_0x494bf9){logger[_0x9743('0x69')](util[_0x9743('0x36')](_0x9743('0x8a'),_0x3ca281['params']['id'],_0x1eecee[_0x9743('0x73')]));return createBucket(_0x17735e['data1'],_0x17735e[_0x9743('0x88')],_0x1eecee['transcribeRegion'],_0x1eecee[_0x9743('0x73')]);}logger[_0x9743('0x69')](util['format']('[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available',_0x3ca281['params']['id'],_0x1eecee[_0x9743('0x73')]));return;}})[_0x9743('0x29')](function(_0x2db7b4){if(_0x2a32f0[_0x9743('0x7b')]===_0x9743('0x8b')){return transcribe(_0x3ca281[_0x9743('0x4b')]['id'],_0x17735e[_0x9743('0x8c')],_0x17735e[_0x9743('0x88')],_0x1eecee[_0x9743('0x81')],_0x1eecee[_0x9743('0x73')],_0x2a32f0[_0x9743('0x55')],_0x1eecee[_0x9743('0x84')]);}else{logger[_0x9743('0x69')](util['format'](_0x9743('0x8d'),_0x3ca281[_0x9743('0x4b')]['id']));return{'transcribeStatus':_0x9743('0x8e')};}})['then'](function(_0x1d0e18){if(_0x1d0e18){_0x1d0e18[_0x9743('0x8f')]=_0x3ca281[_0x9743('0x4f')][_0x9743('0x90')];return _0x2a32f0['updateAttributes'](_0x1d0e18);}})['then'](respondWithResult(_0x5ed9ba,null))[_0x9743('0x49')](handleError(_0x5ed9ba,null));};function writeFile(_0x37796d,_0x1bcc0b){return new Promise(function(_0x12a5f8,_0x19e17d){fs[_0x9743('0x91')](_0x1bcc0b,_0x37796d,function(_0x893f9a,_0x5747f0){if(_0x893f9a){return _0x19e17d(_0x893f9a);}else{return _0x12a5f8(_0x5747f0);}});});}exports[_0x9743('0x92')]=function(_0xbece87,_0x8a516c,_0x56382b){return db[_0x9743('0x30')]['findOne']({'where':{'id':_0xbece87['params']['id']}})[_0x9743('0x29')](handleEntityNotFound(_0x8a516c))['then'](function(_0xd9b822){if(_0xd9b822&&_0xd9b822[_0x9743('0x93')]){var _0x10bcba=_0xd9b822['fileText'];var _0x3747d3=config[_0x9743('0x94')]+_0x9743('0x95')+_0xd9b822['id']+_0x9743('0x96');if(fs[_0x9743('0x56')](_0x3747d3)){return _0x3747d3;}return writeFile(_0x10bcba,_0x3747d3)[_0x9743('0x29')](function(){return _0x3747d3;});}else{throw new db[(_0x9743('0x59'))][(_0x9743('0x5a'))]('Transcript\x20not\x20available');}})[_0x9743('0x29')](function(_0x5cf221){return _0x8a516c[_0x9743('0x52')](_0x5cf221);})[_0x9743('0x49')](handleError(_0x8a516c));}; \ No newline at end of file +var _0xc58b=['transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','recording','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeAccountId','language','sentiment','sentimentAccountId','sentimentRegion','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','transcribeRegion','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','tempSentiment','runSentiment','updateAttributes','writeFile','fileText','root','/server/files/transcribes/transcribe_','Transcript\x20not\x20available','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','VoiceRecording','rawAttributes','type','model','differenceBy','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','params','create','body','describe','uniqueid','find','value','%s.cypher','existsSync','decryptFile','ValidationError','download','extname','unlink','message','VoiceRecording\x20not\x20found','send','Not\x20found','downloads','../../components/encryptor','sequelize','col','$and','push','format','secrets','Sequelize','filename','destroy','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','location','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName'];(function(_0x42b8f5,_0x4b9730){var _0x31ca50=function(_0x2060a){while(--_0x2060a){_0x42b8f5['push'](_0x42b8f5['shift']());}};_0x31ca50(++_0x4b9730);}(_0xc58b,0x1eb));var _0xbc58=function(_0x5c4185,_0x3026c5){_0x5c4185=_0x5c4185-0x0;var _0x592c7b=_0xc58b[_0x5c4185];return _0x592c7b;};'use strict';var emlformat=require(_0xbc58('0x0'));var rimraf=require(_0xbc58('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbc58('0x2'));var rp=require(_0xbc58('0x3'));var moment=require('moment');var BPromise=require(_0xbc58('0x4'));var Mustache=require('mustache');var util=require(_0xbc58('0x5'));var path=require(_0xbc58('0x6'));var sox=require(_0xbc58('0x7'));var csv=require(_0xbc58('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc58('0x9'));var _=require('lodash');var squel=require(_0xbc58('0xa'));var crypto=require(_0xbc58('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbc58('0xc'));var Papa=require(_0xbc58('0xd'));var AWS=require('aws-sdk');var uuidv4=require(_0xbc58('0xe'));var Redis=require(_0xbc58('0xf'));var authService=require(_0xbc58('0x10'));var qs=require(_0xbc58('0x11'));var as=require(_0xbc58('0x12'));var hardwareService=require(_0xbc58('0x13'));var logger=require('../../config/logger')(_0xbc58('0x14'));var utils=require('../../config/utils');var config=require(_0xbc58('0x15'));var licenseUtil=require(_0xbc58('0x16'));var db=require(_0xbc58('0x17'))['db'];function respondWithStatusCode(_0x27428b,_0xbe4d68){_0xbe4d68=_0xbe4d68||0xcc;return function(_0x4fef43){if(_0x4fef43){return _0x27428b[_0xbc58('0x18')](_0xbe4d68);}return _0x27428b['status'](_0xbe4d68)[_0xbc58('0x19')]();};}function respondWithResult(_0x35b66e,_0x254967){_0x254967=_0x254967||0xc8;return function(_0x2027c8){if(_0x2027c8){return _0x35b66e[_0xbc58('0x1a')](_0x254967)[_0xbc58('0x1b')](_0x2027c8);}};}function respondWithFilteredResult(_0x171514,_0xaa9f8a){return function(_0x240d66){if(_0x240d66){var _0x362076=typeof _0xaa9f8a[_0xbc58('0x1c')]===_0xbc58('0x1d')&&typeof _0xaa9f8a['limit']==='undefined';var _0x273288=_0x240d66['count'];var _0x45ce24=_0x362076?0x0:_0xaa9f8a[_0xbc58('0x1c')];var _0x17483b=_0x362076?_0x240d66['count']:_0xaa9f8a[_0xbc58('0x1c')]+_0xaa9f8a[_0xbc58('0x1e')];var _0x4a3dc0;if(_0x17483b>=_0x273288){_0x17483b=_0x273288;_0x4a3dc0=0xc8;}else{_0x4a3dc0=0xce;}_0x171514[_0xbc58('0x1a')](_0x4a3dc0);return _0x171514['set'](_0xbc58('0x1f'),_0x45ce24+'-'+_0x17483b+'/'+_0x273288)[_0xbc58('0x1b')](_0x240d66);}return null;};}function patchUpdates(_0x4fe138){return function(_0x177f93){try{jsonpatch[_0xbc58('0x20')](_0x177f93,_0x4fe138,!![]);}catch(_0x4dd6b7){return BPromise[_0xbc58('0x21')](_0x4dd6b7);}return _0x177f93[_0xbc58('0x22')]();};}function saveUpdates(_0x57746d,_0x2c2b26){return function(_0x2cc073){if(_0x2cc073){return _0x2cc073[_0xbc58('0x23')](_0x57746d)[_0xbc58('0x24')](function(_0x3665ed){return _0x3665ed;});}return null;};}function removeEntity(_0x5f543c,_0x3c572c){return function(_0x3b8c14){if(_0x3b8c14){return _0x3b8c14['destroy']()[_0xbc58('0x24')](function(){_0x5f543c[_0xbc58('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b3f0e,_0x1aadb8){return function(_0x4185c0){if(!_0x4185c0){_0x2b3f0e[_0xbc58('0x18')](0x194);}return _0x4185c0;};}function handleError(_0x3a60f8,_0x20b8d0){_0x20b8d0=_0x20b8d0||0x1f4;return function(_0x618d10){logger[_0xbc58('0x25')](_0x618d10[_0xbc58('0x26')]);if(_0x618d10['name']){delete _0x618d10[_0xbc58('0x27')];}_0x3a60f8['status'](_0x20b8d0)['send'](_0x618d10);};}exports[_0xbc58('0x28')]=function(_0x11a055,_0x5546fa){var _0x440ea7={},_0x4252ad={},_0xf85a72={'count':0x0,'rows':[]};var _0x2e7884=_[_0xbc58('0x29')](db[_0xbc58('0x2a')][_0xbc58('0x2b')],function(_0xa58bde){return{'name':_0xa58bde['fieldName'],'type':_0xa58bde[_0xbc58('0x2c')]['key']};});_0x4252ad[_0xbc58('0x2d')]=_[_0xbc58('0x2e')](_[_0xbc58('0x29')](_0x2e7884,'name'),['format']);_0x4252ad[_0xbc58('0x2f')]=_[_0xbc58('0x30')](_0x11a055['query']);_0x4252ad[_0xbc58('0x31')]=_[_0xbc58('0x32')](_0x4252ad['model'],_0x4252ad['query']);_0x440ea7[_0xbc58('0x33')]=_[_0xbc58('0x32')](_0x4252ad[_0xbc58('0x2d')],qs[_0xbc58('0x34')](_0x11a055['query'][_0xbc58('0x34')]));_0x440ea7[_0xbc58('0x33')]=_0x440ea7[_0xbc58('0x33')][_0xbc58('0x35')]?_0x440ea7['attributes']:_0x4252ad['model'];if(!_0x11a055[_0xbc58('0x2f')][_0xbc58('0x36')](_0xbc58('0x37'))){_0x440ea7[_0xbc58('0x1e')]=qs[_0xbc58('0x1e')](_0x11a055['query'][_0xbc58('0x1e')]);_0x440ea7[_0xbc58('0x1c')]=qs[_0xbc58('0x1c')](_0x11a055['query']['offset']);}_0x440ea7[_0xbc58('0x38')]=qs[_0xbc58('0x39')](_0x11a055['query'][_0xbc58('0x39')]);_0x440ea7[_0xbc58('0x3a')]=qs[_0xbc58('0x31')](_[_0xbc58('0x3b')](_0x11a055[_0xbc58('0x2f')],_0x4252ad[_0xbc58('0x31')]),_0x2e7884);if(_0x11a055[_0xbc58('0x2f')][_0xbc58('0x3c')]){_0x440ea7[_0xbc58('0x3a')]=_[_0xbc58('0x3d')](_0x440ea7[_0xbc58('0x3a')],{'$or':_[_0xbc58('0x29')](_0x2e7884,function(_0x5cc323){if(_0x5cc323['type']!==_0xbc58('0x3e')){var _0x545dc4={};_0x545dc4[_0x5cc323['name']]={'$like':'%'+_0x11a055[_0xbc58('0x2f')]['filter']+'%'};return _0x545dc4;}})});}_0x440ea7=_[_0xbc58('0x3d')]({},_0x440ea7,_0x11a055[_0xbc58('0x3f')]);var _0x589dc6={'where':_0x440ea7[_0xbc58('0x3a')]};return db[_0xbc58('0x2a')][_0xbc58('0x40')](_0x589dc6)[_0xbc58('0x24')](function(_0x158794){_0xf85a72[_0xbc58('0x40')]=_0x158794;if(_0x11a055[_0xbc58('0x2f')][_0xbc58('0x41')]){_0x440ea7[_0xbc58('0x42')]=[{'all':!![]}];}return db[_0xbc58('0x2a')]['findAll'](_0x440ea7);})[_0xbc58('0x24')](function(_0x59d325){_0xf85a72[_0xbc58('0x43')]=_0x59d325;return _0xf85a72;})['then'](respondWithFilteredResult(_0x5546fa,_0x440ea7))[_0xbc58('0x44')](handleError(_0x5546fa,null));};exports[_0xbc58('0x45')]=function(_0x13ca73,_0x5d5e63){var _0x12971e={'raw':![],'where':{'id':_0x13ca73[_0xbc58('0x46')]['id']}},_0x318f58={};_0x318f58[_0xbc58('0x2d')]=_[_0xbc58('0x30')](db[_0xbc58('0x2a')][_0xbc58('0x2b')]);_0x318f58['query']=_[_0xbc58('0x30')](_0x13ca73[_0xbc58('0x2f')]);_0x318f58['filters']=_['intersection'](_0x318f58['model'],_0x318f58[_0xbc58('0x2f')]);_0x12971e[_0xbc58('0x33')]=_[_0xbc58('0x32')](_0x318f58[_0xbc58('0x2d')],qs[_0xbc58('0x34')](_0x13ca73[_0xbc58('0x2f')][_0xbc58('0x34')]));_0x12971e['attributes']=_0x12971e[_0xbc58('0x33')]['length']?_0x12971e[_0xbc58('0x33')]:_0x318f58[_0xbc58('0x2d')];if(_0x13ca73[_0xbc58('0x2f')][_0xbc58('0x41')]){_0x12971e[_0xbc58('0x42')]=[{'all':!![]}];}_0x12971e=_[_0xbc58('0x3d')]({},_0x12971e,_0x13ca73[_0xbc58('0x3f')]);return db['VoiceRecording']['find'](_0x12971e)['then'](handleEntityNotFound(_0x5d5e63,null))['then'](respondWithResult(_0x5d5e63,null))[_0xbc58('0x44')](handleError(_0x5d5e63,null));};exports[_0xbc58('0x47')]=function(_0x102498,_0x53787f){return db[_0xbc58('0x2a')][_0xbc58('0x47')](_0x102498[_0xbc58('0x48')],{})[_0xbc58('0x24')](respondWithResult(_0x53787f,0xc9))[_0xbc58('0x44')](handleError(_0x53787f,null));};exports[_0xbc58('0x23')]=function(_0x22c538,_0x4bb9d3){if(_0x22c538[_0xbc58('0x48')]['id']){delete _0x22c538[_0xbc58('0x48')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x22c538['params']['id']}})[_0xbc58('0x24')](handleEntityNotFound(_0x4bb9d3,null))['then'](saveUpdates(_0x22c538[_0xbc58('0x48')],null))[_0xbc58('0x24')](respondWithResult(_0x4bb9d3,null))[_0xbc58('0x44')](handleError(_0x4bb9d3,null));};exports[_0xbc58('0x49')]=function(_0x12270f,_0x356187){return db['VoiceRecording']['describe']()[_0xbc58('0x24')](respondWithResult(_0x356187,null))[_0xbc58('0x44')](handleError(_0x356187,null));};exports['download']=function(_0x80a326,_0x579cf3,_0x8ca013){var _0xf27e40=require('../../components/encryptor');var _0x38373c=![];var _0x1553fa={};if(_0x80a326[_0xbc58('0x2f')][_0xbc58('0x2c')]&&_0x80a326[_0xbc58('0x2f')][_0xbc58('0x2c')]===_0xbc58('0x4a')){_0x1553fa[_0xbc58('0x4a')]=_0x80a326[_0xbc58('0x46')]['id'];}else{_0x1553fa['id']=_0x80a326[_0xbc58('0x46')]['id'];}return db[_0xbc58('0x2a')][_0xbc58('0x4b')]({'where':_0x1553fa,'attributes':['id',_0xbc58('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x579cf3,null))[_0xbc58('0x24')](function(_0x10ca93){if(_0x10ca93){var _0x1c4410=_0x10ca93[_0xbc58('0x4c')];var _0x4b547c=util['format'](_0xbc58('0x4d'),_0x1c4410);if(fs[_0xbc58('0x4e')](_0x4b547c)){_0x38373c=!![];return _0xf27e40[_0xbc58('0x4f')](_0x4b547c,_0x1c4410,config['secrets']['recording'])[_0xbc58('0x24')](function(){return _0x10ca93;});}return _0x10ca93;}})['then'](function(_0x108ff2){if(_0x108ff2){var _0x5c36c6=_0x108ff2[_0xbc58('0x4c')];if(!fs[_0xbc58('0x4e')](_0x5c36c6)){throw new db['Sequelize'][(_0xbc58('0x50'))]('VoiceRecording\x20not\x20found');}if(_0x108ff2['filename']){return _0x579cf3[_0xbc58('0x51')](_0x5c36c6,_0x108ff2['filename']+path[_0xbc58('0x52')](_0x5c36c6),function(){if(_0x38373c){fs[_0xbc58('0x53')](_0x5c36c6);}});}else{return _0x579cf3[_0xbc58('0x51')](_0x5c36c6,function(_0x184362){if(_0x38373c){fs[_0xbc58('0x53')](_0x5c36c6);}});}}})['catch'](function(_0x140a40){if(_0x140a40[_0xbc58('0x54')]===_0xbc58('0x55')){_0x579cf3[_0xbc58('0x1a')](0x194)[_0xbc58('0x56')](_0xbc58('0x57'));}else{return handleError(_0x579cf3,null);}});};exports[_0xbc58('0x58')]=function(_0x1ec448,_0x4e5548,_0x42b02f){var _0x3e5243=require(_0xbc58('0x59'));var _0x1bf477=![];var _0x37d5cd={'$and':[db[_0xbc58('0x5a')][_0xbc58('0x3a')](db[_0xbc58('0x5a')]['fn']('MD5',db['sequelize'][_0xbc58('0x5b')](_0xbc58('0x4a'))),_0x1ec448[_0xbc58('0x2f')]['token'])]};if(_0x1ec448['query'][_0xbc58('0x2c')]&&_0x1ec448[_0xbc58('0x2f')][_0xbc58('0x2c')]===_0xbc58('0x4a')){_0x37d5cd[_0xbc58('0x5c')][_0xbc58('0x5d')]({'uniqueid':_0x1ec448[_0xbc58('0x46')]['id']});}else{_0x37d5cd[_0xbc58('0x5c')][_0xbc58('0x5d')]({'id':_0x1ec448[_0xbc58('0x46')]['id']});}return db[_0xbc58('0x2a')][_0xbc58('0x4b')]({'where':_0x37d5cd,'attributes':['id',_0xbc58('0x4c')],'raw':!![]})['then'](handleEntityNotFound(_0x4e5548,null))[_0xbc58('0x24')](function(_0x46373f){if(_0x46373f){var _0x3b3931=util[_0xbc58('0x5e')](_0xbc58('0x4d'),_0x46373f['value']);if(fs[_0xbc58('0x4e')](_0x3b3931)){_0x1bf477=!![];return _0x3e5243['decryptFile'](_0x3b3931,_0x46373f[_0xbc58('0x4c')],config[_0xbc58('0x5f')]['recording'])[_0xbc58('0x24')](function(){return _0x46373f;});}return _0x46373f;}})['then'](function(_0x1ce0cd){if(_0x1ce0cd){if(!fs[_0xbc58('0x4e')](_0x1ce0cd[_0xbc58('0x4c')])){throw new db[(_0xbc58('0x60'))][(_0xbc58('0x50'))](_0xbc58('0x55'));}if(_0x1ce0cd[_0xbc58('0x61')]){return _0x4e5548[_0xbc58('0x51')](_0x1ce0cd[_0xbc58('0x4c')],_0x1ce0cd[_0xbc58('0x61')]+path['extname'](_0x1ce0cd[_0xbc58('0x4c')]),function(){if(_0x1bf477){fs['unlink'](_0x1ce0cd['value']);}});}else{return _0x4e5548['download'](_0x1ce0cd[_0xbc58('0x4c')],function(_0x359d0c){if(_0x1bf477){fs['unlink'](_0x1ce0cd[_0xbc58('0x4c')]);}});}}})[_0xbc58('0x44')](handleError(_0x4e5548,null));};exports[_0xbc58('0x62')]=function(_0x5372b4,_0x593590){return db[_0xbc58('0x2a')][_0xbc58('0x4b')]({'where':{'id':_0x5372b4['params']['id']}})[_0xbc58('0x24')](function(_0x3cf3de){if(_[_0xbc58('0x63')](_0x3cf3de)){throw new ReferenceError(_0xbc58('0x64'));}return _0x3cf3de;})[_0xbc58('0x24')](function(_0x2fba0b){var _0x37701a=_0x2fba0b[_0xbc58('0x4c')];logger['info'](_0xbc58('0x65'),_0x37701a);if(!_[_0xbc58('0x63')](_0x2fba0b[_0xbc58('0x4c')])&&fs[_0xbc58('0x4e')](_0x37701a)){logger[_0xbc58('0x66')](_0xbc58('0x67')+_0x37701a+_0xbc58('0x68'));fs[_0xbc58('0x69')](_0x37701a);}_0x37701a=_0x37701a+_0xbc58('0x6a');if(!_[_0xbc58('0x63')](_0x2fba0b[_0xbc58('0x4c')])&&fs[_0xbc58('0x4e')](_0x37701a)){logger[_0xbc58('0x66')](_0xbc58('0x67')+_0x37701a+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x37701a);}return _0x2fba0b;})[_0xbc58('0x24')](function(_0x4b7d25){if(!_0x4b7d25)throw new InternalError();return _0x4b7d25[_0xbc58('0x62')]();})[_0xbc58('0x24')](function(){_0x593590[_0xbc58('0x1a')](0xcc)[_0xbc58('0x19')]();})[_0xbc58('0x44')](handleError(_0x593590,null));};function getBucketslist(_0x2a25d3,_0x4635db,_0x46f4ba){return new Promise(function(_0x1d7b4e,_0x4d6a7f){var _0xd89bc7=new AWS['S3']({'accessKeyId':_0x4635db,'secretAccessKey':_0x2a25d3,'region':_0x46f4ba});_0xd89bc7[_0xbc58('0x6b')]({},function(_0x3a9c3d,_0x16e79f){if(_0x3a9c3d){return _0x4d6a7f(_0x3a9c3d);}else{return _0x1d7b4e(_0x16e79f);}});});}function createBucket(_0x4ff966,_0x2a017e,_0x4796b1,_0x3d90fe){return new Promise(function(_0x5ea2af,_0x351a1f){var _0x137a4a=new AWS['S3']({'accessKeyId':_0x2a017e,'secretAccessKey':_0x4ff966,'region':_0x4796b1});_0x137a4a[_0xbc58('0x6c')]({'Bucket':_0x3d90fe},function(_0x2aa29e,_0xe8009d){if(_0x2aa29e){return _0x351a1f(_0x2aa29e);}else{return _0x5ea2af(_0xe8009d);}});});}function uploadFile(_0x391c6f,_0x26da2c,_0x1d96e8,_0x18c5e4,_0x1e494b,_0xc1c16a){return new Promise(function(_0x23452b,_0x4286b3){var _0xc3951f=new AWS['S3']({'accessKeyId':_0x26da2c,'secretAccessKey':_0x391c6f,'region':_0x1d96e8});_0xc3951f[_0xbc58('0x6d')]({'Bucket':_0x18c5e4,'Key':_0x1e494b,'Body':_0xc1c16a},function(_0x36faf9,_0x12d2a5){if(_0x36faf9){return _0x4286b3(_0x36faf9);}else{return _0x23452b(_0x12d2a5);}});});}function startTranscribe(_0x45aa06,_0x372ac1,_0x1bd379,_0x165217,_0x3cff63,_0x592811){return new Promise(function(_0x19b064,_0x21c31e){var _0x37740c=new AWS[(_0xbc58('0x6e'))]({'accessKeyId':_0x372ac1,'secretAccessKey':_0x45aa06,'region':_0x1bd379});_0x37740c[_0xbc58('0x6f')]({'TranscriptionJobName':_0x165217,'LanguageCode':_0x3cff63,'Media':{'MediaFileUri':_0x592811}},function(_0x1217a7,_0x39ae6d){if(_0x1217a7){return _0x21c31e(_0x1217a7);}else{return _0x19b064(_0x39ae6d);}});});}function transcribe(_0x588d2c,_0x583543,_0x40ebd3,_0x3e67eb,_0x35447f,_0x2947db,_0x35e719){return new Promise(function(_0x3837b6,_0x3befb3){var _0x4d555c={};logger[_0xbc58('0x66')](util['format']('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x588d2c,_0x35447f));return uploadFile(_0x583543,_0x40ebd3,_0x3e67eb,_0x35447f,path[_0xbc58('0x70')](_0x2947db),fs['readFileSync'](_0x2947db))[_0xbc58('0x24')](function(_0x1e0298){logger[_0xbc58('0x66')](util[_0xbc58('0x5e')](_0xbc58('0x71'),_0x588d2c,_0x35447f,_0x1e0298[_0xbc58('0x72')]));_0x4d555c[_0xbc58('0x73')]=_0x1e0298['Bucket'];_0x4d555c[_0xbc58('0x74')]=_0x1e0298[_0xbc58('0x72')];logger[_0xbc58('0x66')](util[_0xbc58('0x5e')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x588d2c));return startTranscribe(_0x583543,_0x40ebd3,_0x3e67eb,uuidv4(),_0x35e719,_0x1e0298[_0xbc58('0x72')]);})[_0xbc58('0x24')](function(_0x4b54d8){logger[_0xbc58('0x66')](util['format'](_0xbc58('0x75'),_0x588d2c,_0x4b54d8[_0xbc58('0x76')][_0xbc58('0x77')]));_0x4d555c[_0xbc58('0x78')]=_0x4b54d8['TranscriptionJob'][_0xbc58('0x77')];_0x4d555c[_0xbc58('0x79')]=_0x4b54d8[_0xbc58('0x76')][_0xbc58('0x7a')];return _0x3837b6(_0x4d555c);})['catch'](function(_0x4fa209){return _0x3befb3(_0x4fa209);});});}exports[_0xbc58('0x7b')]=function(_0x4ab472,_0x305330,_0x1ca9aa){var _0x349488;var _0x77f1ca;var _0x335c6e;var _0x190eeb=require(_0xbc58('0x59'));return db['VoiceRecording'][_0xbc58('0x7c')]({'where':{'id':_0x4ab472[_0xbc58('0x46')]['id']}})[_0xbc58('0x24')](function(_0xf0995a){if(_0xf0995a){var _0x1e4199=util[_0xbc58('0x5e')](_0xbc58('0x4d'),_0xf0995a[_0xbc58('0x4c')]);if(fs[_0xbc58('0x4e')](_0x1e4199)){cypher=!![];return _0x190eeb[_0xbc58('0x4f')](_0x1e4199,_0xf0995a[_0xbc58('0x4c')],config[_0xbc58('0x5f')][_0xbc58('0x7d')])['then'](function(){return _0xf0995a;});}return _0xf0995a;}})[_0xbc58('0x24')](function(_0x570d13){if(!_0x570d13){throw new db['Sequelize'][(_0xbc58('0x50'))](_0xbc58('0x7e'));}_0x77f1ca=_0x570d13;return db[_0xbc58('0x7f')][_0xbc58('0x7c')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x305330,null))['then'](function(_0x50b2e7){if(_0x50b2e7){_0x349488=_0x50b2e7;if(!_0x349488[_0xbc58('0x80')]||!_0x349488[_0xbc58('0x81')]||!_0x349488['transcribeRegion']||!_0x349488[_0xbc58('0x82')]||!_0x349488[_0xbc58('0x73')]){throw new db['Sequelize'][(_0xbc58('0x50'))]('Transcribe\x20not\x20configured');}if(_0x4ab472[_0xbc58('0x48')]['runSentiment']&&(!_0x349488[_0xbc58('0x83')]||!_0x349488[_0xbc58('0x84')]||!_0x349488[_0xbc58('0x85')]||!_0x349488[_0xbc58('0x82')]||!_0x349488[_0xbc58('0x73')])){throw new db[(_0xbc58('0x60'))][(_0xbc58('0x50'))]('Sentiment\x20Analysis\x20not\x20configured');}return db[_0xbc58('0x86')]['findOne']({'where':{'id':_0x349488[_0xbc58('0x81')]}});}})[_0xbc58('0x24')](function(_0x209a65){if(!_0x209a65){throw new db[(_0xbc58('0x60'))][(_0xbc58('0x50'))](_0xbc58('0x87'));}if(!_0x209a65[_0xbc58('0x88')]||!_0x209a65[_0xbc58('0x89')]){throw new db[(_0xbc58('0x60'))]['ValidationError'](_0xbc58('0x8a'));}_0x335c6e=_0x209a65;return getBucketslist(_0x335c6e[_0xbc58('0x88')],_0x335c6e[_0xbc58('0x89')],_0x349488[_0xbc58('0x8b')]);})[_0xbc58('0x24')](function(_0x3cdda1){if(_0x3cdda1&&_0x3cdda1[_0xbc58('0x8c')]){var _0x2a1c9f=_[_0xbc58('0x4b')](_0x3cdda1[_0xbc58('0x8c')],function(_0x52da73){return _0x52da73['Name']===_0x349488[_0xbc58('0x73')];});if(!_0x2a1c9f){logger['info'](util[_0xbc58('0x5e')](_0xbc58('0x8d'),_0x4ab472['params']['id'],_0x349488[_0xbc58('0x73')]));return createBucket(_0x335c6e[_0xbc58('0x88')],_0x335c6e['data2'],_0x349488[_0xbc58('0x8b')],_0x349488['bucket']);}logger['info'](util[_0xbc58('0x5e')](_0xbc58('0x8e'),_0x4ab472[_0xbc58('0x46')]['id'],_0x349488[_0xbc58('0x73')]));return;}})[_0xbc58('0x24')](function(_0x5a62b8){if(_0x77f1ca[_0xbc58('0x79')]===_0xbc58('0x8f')){return transcribe(_0x4ab472['params']['id'],_0x335c6e[_0xbc58('0x88')],_0x335c6e[_0xbc58('0x89')],_0x349488['transcribeRegion'],_0x349488[_0xbc58('0x73')],_0x77f1ca[_0xbc58('0x4c')],_0x349488['language']);}else{logger[_0xbc58('0x66')](util[_0xbc58('0x5e')](_0xbc58('0x90'),_0x4ab472[_0xbc58('0x46')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0xbc58('0x24')](function(_0x2905b1){if(_0x2905b1){_0x2905b1[_0xbc58('0x91')]=_0x4ab472['body'][_0xbc58('0x92')];return _0x77f1ca[_0xbc58('0x93')](_0x2905b1);}})[_0xbc58('0x24')](respondWithResult(_0x305330,null))[_0xbc58('0x44')](handleError(_0x305330,null));};function writeFile(_0x30c332,_0x4bb0ec){return new Promise(function(_0x114811,_0x35e1f9){fs[_0xbc58('0x94')](_0x4bb0ec,_0x30c332,function(_0x19313f,_0x439dcf){if(_0x19313f){return _0x35e1f9(_0x19313f);}else{return _0x114811(_0x439dcf);}});});}exports['downloadTranscribe']=function(_0x4f8cd7,_0x52a2aa,_0xa2174b){return db[_0xbc58('0x2a')][_0xbc58('0x7c')]({'where':{'id':_0x4f8cd7[_0xbc58('0x46')]['id']}})[_0xbc58('0x24')](handleEntityNotFound(_0x52a2aa))['then'](function(_0x2a856e){if(_0x2a856e&&_0x2a856e[_0xbc58('0x95')]){var _0x32a372=_0x2a856e[_0xbc58('0x95')];var _0x7e82fa=config[_0xbc58('0x96')]+_0xbc58('0x97')+_0x2a856e['id']+'.txt';if(fs[_0xbc58('0x4e')](_0x7e82fa)){return _0x7e82fa;}return writeFile(_0x32a372,_0x7e82fa)[_0xbc58('0x24')](function(){return _0x7e82fa;});}else{throw new db[(_0xbc58('0x60'))][(_0xbc58('0x50'))](_0xbc58('0x98'));}})[_0xbc58('0x24')](function(_0x28e4ec){return _0x52a2aa[_0xbc58('0x51')](_0x28e4ec);})['catch'](handleError(_0x52a2aa));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index bdfc3eb..adbe9b7 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 _0x6d4a=['voice_recordings','uniqueid','transcribeStatus','./voiceRecording.attributes','define','VoiceRecording'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6d4a,0x117));var _0xa6d4=function(_0x52d11a,_0x5025e4){_0x52d11a=_0x52d11a-0x0;var _0xc7d962=_0x6d4a[_0x52d11a];return _0xc7d962;};'use strict';var attributes=require(_0xa6d4('0x0'));module['exports']=function(_0x1495eb,_0x9d594f){return _0x1495eb[_0xa6d4('0x1')](_0xa6d4('0x2'),attributes,{'tableName':_0xa6d4('0x3'),'paranoid':![],'indexes':[{'name':_0xa6d4('0x4'),'fields':[_0xa6d4('0x4')]},{'name':_0xa6d4('0x5'),'fields':[_0xa6d4('0x5')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2fda=['./voiceRecording.attributes','define','VoiceRecording','voice_recordings','uniqueid'];(function(_0x3d5a82,_0x162257){var _0x498a53=function(_0x10a1ba){while(--_0x10a1ba){_0x3d5a82['push'](_0x3d5a82['shift']());}};_0x498a53(++_0x162257);}(_0x2fda,0x186));var _0xa2fd=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x2fda[_0x29b609];return _0x54c952;};'use strict';var attributes=require(_0xa2fd('0x0'));module['exports']=function(_0x5bfb50,_0x2a1c31){return _0x5bfb50[_0xa2fd('0x1')](_0xa2fd('0x2'),attributes,{'tableName':_0xa2fd('0x3'),'paranoid':![],'indexes':[{'name':_0xa2fd('0x4'),'fields':['uniqueid']},{'name':'transcribeStatus','fields':['transcribeStatus']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 4fcb7d8..d95e103 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 _0x8aad=['VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','then','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','format','%s.cypher','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','bluebird','ioredis','../../mysqldb','rpc','client','http','request','info'];(function(_0x20213,_0x1809ac){var _0xc797ea=function(_0x2a1943){while(--_0x2a1943){_0x20213['push'](_0x20213['shift']());}};_0xc797ea(++_0x1809ac);}(_0x8aad,0x146));var _0xd8aa=function(_0x308991,_0x4e4983){_0x308991=_0x308991-0x0;var _0x43c74b=_0x8aad[_0x308991];return _0x43c74b;};'use strict';var _=require(_0xd8aa('0x0'));var util=require(_0xd8aa('0x1'));var moment=require('moment');var BPromise=require(_0xd8aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8aa('0x3'));var db=require(_0xd8aa('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xd8aa('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd8aa('0x6')][_0xd8aa('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16ea12,_0x4a4b10,_0x2a559d){return new BPromise(function(_0x1da411,_0x2a23b5){return client[_0xd8aa('0x8')](_0x16ea12,_0x2a559d)['then'](function(_0x5de228){logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));logger[_0xd8aa('0xc')](_0xd8aa('0xd'),_0x4a4b10,'request\x20sent',JSON[_0xd8aa('0xe')](_0x5de228));if(_0x5de228[_0xd8aa('0xf')]){if(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x10')]===0x1f4){logger[_0xd8aa('0xf')](_0xd8aa('0xa'),_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x2a23b5(_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);}logger['error']('VoiceRecording,\x20%s,\x20%s',_0x4a4b10,_0x5de228[_0xd8aa('0xf')][_0xd8aa('0x11')]);return _0x1da411(_0x5de228[_0xd8aa('0xf')]['message']);}else{logger[_0xd8aa('0x9')](_0xd8aa('0xa'),_0x4a4b10,_0xd8aa('0xb'));_0x1da411(_0x5de228[_0xd8aa('0x12')]['message']);}})[_0xd8aa('0x13')](function(_0xa9ba1b){logger['error'](_0xd8aa('0xa'),_0x4a4b10,_0xa9ba1b);_0x2a23b5(_0xa9ba1b);});});}exports[_0xd8aa('0x14')]=function(_0x32e2cd){var _0x3a29ca=this;return new Promise(function(_0x2d34ac,_0x4953be){return db[_0xd8aa('0x15')][_0xd8aa('0x16')](_0x32e2cd[_0xd8aa('0x17')],{'raw':_0x32e2cd[_0xd8aa('0x18')]?_0x32e2cd['options'][_0xd8aa('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x32e2cd[_0xd8aa('0x18')]?_0x32e2cd[_0xd8aa('0x18')][_0xd8aa('0x1a')]||null:null,'attributes':_0x32e2cd[_0xd8aa('0x18')]?_0x32e2cd['options'][_0xd8aa('0x1b')]||null:null,'limit':_0x32e2cd[_0xd8aa('0x18')]?_0x32e2cd[_0xd8aa('0x18')]['limit']||null:null})[_0xd8aa('0x1c')](function(_0x7a4ce7){logger[_0xd8aa('0x9')](_0xd8aa('0x14'),_0x32e2cd);logger[_0xd8aa('0xc')](_0xd8aa('0x14'),_0x32e2cd,JSON[_0xd8aa('0xe')](_0x7a4ce7));_0x2d34ac(_0x7a4ce7);})[_0xd8aa('0x13')](function(_0x375f64){logger[_0xd8aa('0xf')](_0xd8aa('0x14'),_0x375f64[_0xd8aa('0x11')],_0x32e2cd);_0x4953be(_0x3a29ca[_0xd8aa('0xf')](0x1f4,_0x375f64['message']));});});};exports[_0xd8aa('0x1d')]=function(_0x59eb3f){var _0xd4d204=this;return new Promise(function(_0x1f6ab2,_0x26cff3){var _0x3696fd=require(_0xd8aa('0x1e'));var _0x19edee;return db[_0xd8aa('0x1f')][_0xd8aa('0x20')]({'attributes':['id','callRecordingEncryption'],'where':{'id':0x1},'raw':!![]})[_0xd8aa('0x1c')](function(_0x34b792){_0x19edee=_0x34b792;return db[_0xd8aa('0x15')]['create'](_0x59eb3f[_0xd8aa('0x17')]);})['then'](function(_0x3052c6){if(_0x19edee[_0xd8aa('0x21')]&&fs[_0xd8aa('0x22')](_0x3052c6[_0xd8aa('0x23')])){var _0x44f783=util[_0xd8aa('0x24')](_0xd8aa('0x25'),_0x3052c6[_0xd8aa('0x23')]);return _0x3696fd['encryptFile'](_0x3052c6[_0xd8aa('0x23')],_0x44f783,config[_0xd8aa('0x26')][_0xd8aa('0x27')])[_0xd8aa('0x1c')](function(){fs[_0xd8aa('0x28')](_0x3052c6[_0xd8aa('0x23')]);logger[_0xd8aa('0x9')](_0xd8aa('0x29'));return _0x3052c6;});}return _0x3052c6;})['then'](function(_0x265217){logger[_0xd8aa('0x9')](_0xd8aa('0x1d'),_0x59eb3f);logger['debug'](_0xd8aa('0x1d'),_0x59eb3f,JSON[_0xd8aa('0xe')](_0x265217));_0x1f6ab2(_0x265217);})[_0xd8aa('0x13')](function(_0x45c216){logger[_0xd8aa('0xf')](_0xd8aa('0x1d'),_0x45c216[_0xd8aa('0x11')],_0x59eb3f);_0x26cff3(_0xd4d204[_0xd8aa('0xf')](0x1f4,_0x45c216[_0xd8aa('0x11')]));});});}; \ No newline at end of file +var _0x25e7=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes','limit','callRecordingEncryption','existsSync','format','%s.cypher','value','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','stringify','CreateVoiceRecording','lodash','util','moment'];(function(_0x2d91c6,_0x10ae0e){var _0x3a8d19=function(_0x27a3ce){while(--_0x27a3ce){_0x2d91c6['push'](_0x2d91c6['shift']());}};_0x3a8d19(++_0x10ae0e);}(_0x25e7,0x1d6));var _0x725e=function(_0x3509d8,_0x5074b5){_0x3509d8=_0x3509d8-0x0;var _0x4dcedb=_0x25e7[_0x3509d8];return _0x4dcedb;};'use strict';var _=require(_0x725e('0x0'));var util=require(_0x725e('0x1'));var moment=require(_0x725e('0x2'));var BPromise=require(_0x725e('0x3'));var rs=require(_0x725e('0x4'));var fs=require('fs');var Redis=require(_0x725e('0x5'));var db=require(_0x725e('0x6'))['db'];var utils=require(_0x725e('0x7'));var logger=require(_0x725e('0x8'))(_0x725e('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x725e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x481316,_0x111a50,_0x192c27){return new BPromise(function(_0x216b33,_0x67de0c){return client[_0x725e('0xb')](_0x481316,_0x192c27)[_0x725e('0xc')](function(_0x39858a){logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,_0x725e('0xf'));logger[_0x725e('0x10')](_0x725e('0x11'),_0x111a50,'request\x20sent',JSON['stringify'](_0x39858a));if(_0x39858a[_0x725e('0x12')]){if(_0x39858a[_0x725e('0x12')]['code']===0x1f4){logger['error'](_0x725e('0xe'),_0x111a50,_0x39858a[_0x725e('0x12')]['message']);return _0x67de0c(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}logger[_0x725e('0x12')]('VoiceRecording,\x20%s,\x20%s',_0x111a50,_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);return _0x216b33(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}else{logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,'request\x20sent');_0x216b33(_0x39858a[_0x725e('0x14')][_0x725e('0x13')]);}})[_0x725e('0x15')](function(_0x54ac0f){logger[_0x725e('0x12')](_0x725e('0xe'),_0x111a50,_0x54ac0f);_0x67de0c(_0x54ac0f);});});}exports[_0x725e('0x16')]=function(_0x397e33){var _0x268438=this;return new Promise(function(_0x2811e7,_0x528e7d){return db[_0x725e('0x17')][_0x725e('0x18')](_0x397e33[_0x725e('0x19')],{'raw':_0x397e33[_0x725e('0x1a')]?_0x397e33[_0x725e('0x1a')][_0x725e('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x397e33['options']?_0x397e33[_0x725e('0x1a')][_0x725e('0x1c')]||null:null,'attributes':_0x397e33[_0x725e('0x1a')]?_0x397e33[_0x725e('0x1a')][_0x725e('0x1d')]||null:null,'limit':_0x397e33[_0x725e('0x1a')]?_0x397e33[_0x725e('0x1a')][_0x725e('0x1e')]||null:null})[_0x725e('0xc')](function(_0x5c33c1){logger[_0x725e('0xd')](_0x725e('0x16'),_0x397e33);logger[_0x725e('0x10')](_0x725e('0x16'),_0x397e33,JSON['stringify'](_0x5c33c1));_0x2811e7(_0x5c33c1);})[_0x725e('0x15')](function(_0x5268c8){logger['error']('UpdateVoiceRecording',_0x5268c8[_0x725e('0x13')],_0x397e33);_0x528e7d(_0x268438[_0x725e('0x12')](0x1f4,_0x5268c8[_0x725e('0x13')]));});});};exports['CreateVoiceRecording']=function(_0xab6cfd){var _0x8a138f=this;return new Promise(function(_0x5a5bef,_0x14e9e0){var _0x339a58=require('../../components/encryptor');var _0x378ace;return db['Setting']['findOne']({'attributes':['id',_0x725e('0x1f')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x3b42bd){_0x378ace=_0x3b42bd;return db['VoiceRecording']['create'](_0xab6cfd[_0x725e('0x19')]);})[_0x725e('0xc')](function(_0x33fe34){if(_0x378ace['callRecordingEncryption']&&fs[_0x725e('0x20')](_0x33fe34['value'])){var _0x85d29c=util[_0x725e('0x21')](_0x725e('0x22'),_0x33fe34[_0x725e('0x23')]);return _0x339a58[_0x725e('0x24')](_0x33fe34[_0x725e('0x23')],_0x85d29c,config[_0x725e('0x25')][_0x725e('0x26')])[_0x725e('0xc')](function(){fs[_0x725e('0x27')](_0x33fe34[_0x725e('0x23')]);logger['info'](_0x725e('0x28'));return _0x33fe34;});}return _0x33fe34;})[_0x725e('0xc')](function(_0x5d3258){logger[_0x725e('0xd')]('CreateVoiceRecording',_0xab6cfd);logger[_0x725e('0x10')]('CreateVoiceRecording',_0xab6cfd,JSON[_0x725e('0x29')](_0x5d3258));_0x5a5bef(_0x5d3258);})[_0x725e('0x15')](function(_0x1f2898){logger[_0x725e('0x12')](_0x725e('0x2a'),_0x1f2898[_0x725e('0x13')],_0xab6cfd);_0x14e9e0(_0x8a138f['error'](0x1f4,_0x1f2898['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index b99a45f..74ab5e2 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 _0x37c0=['index','isAuthenticated','describe','/:id','put','update','delete','destroy','exports','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x37c0,0x1c9));var _0x037c=function(_0x4021de,_0x21c195){_0x4021de=_0x4021de-0x0;var _0x2bc644=_0x37c0[_0x4021de];return _0x2bc644;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x037c('0x0'));var router=express[_0x037c('0x1')]();var fs_extra=require(_0x037c('0x2'));var auth=require(_0x037c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x037c('0x4'));var controller=require(_0x037c('0x5'));router[_0x037c('0x6')]('/',auth['isAuthenticated'](),controller[_0x037c('0x7')]);router['get']('/describe',auth[_0x037c('0x8')](),controller[_0x037c('0x9')]);router[_0x037c('0x6')](_0x037c('0xa'),auth[_0x037c('0x8')](),controller['show']);router['post']('/',auth[_0x037c('0x8')](),controller['create']);router[_0x037c('0xb')](_0x037c('0xa'),auth['isAuthenticated'](),controller[_0x037c('0xc')]);router[_0x037c('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x037c('0xe')]);module[_0x037c('0xf')]=router; \ No newline at end of file +var _0x5f20=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','destroy','exports','util','path','express','fs-extra','../../components/auth/service'];(function(_0x1d57f0,_0x45191a){var _0x2c2b60=function(_0x29bcdc){while(--_0x29bcdc){_0x1d57f0['push'](_0x1d57f0['shift']());}};_0x2c2b60(++_0x45191a);}(_0x5f20,0x93));var _0x05f2=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x5f20[_0x3c8e9a];return _0x2d4c57;};'use strict';var multer=require('multer');var util=require(_0x05f2('0x0'));var path=require(_0x05f2('0x1'));var timeout=require('connect-timeout');var express=require(_0x05f2('0x2'));var router=express['Router']();var fs_extra=require(_0x05f2('0x3'));var auth=require(_0x05f2('0x4'));var interaction=require(_0x05f2('0x5'));var config=require(_0x05f2('0x6'));var controller=require('./voiceTransferReport.controller');router[_0x05f2('0x7')]('/',auth[_0x05f2('0x8')](),controller[_0x05f2('0x9')]);router['get']('/describe',auth[_0x05f2('0x8')](),controller[_0x05f2('0xa')]);router['get'](_0x05f2('0xb'),auth[_0x05f2('0x8')](),controller[_0x05f2('0xc')]);router[_0x05f2('0xd')]('/',auth[_0x05f2('0x8')](),controller[_0x05f2('0xe')]);router[_0x05f2('0xf')]('/:id',auth[_0x05f2('0x8')](),controller[_0x05f2('0x10')]);router['delete'](_0x05f2('0xb'),auth['isAuthenticated'](),controller[_0x05f2('0x11')]);module[_0x05f2('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 0391d85..3256b2c 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 _0xa7b4=['attended','STRING','Yes','moment','exports','blind'];(function(_0x455293,_0x26be07){var _0x2739a3=function(_0x508823){while(--_0x508823){_0x455293['push'](_0x455293['shift']());}};_0x2739a3(++_0x26be07);}(_0xa7b4,0x8d));var _0x4a7b=function(_0x46f6c6,_0x5f337d){_0x46f6c6=_0x46f6c6-0x0;var _0x462bb8=_0xa7b4[_0x46f6c6];return _0x462bb8;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x4a7b('0x0'));module[_0x4a7b('0x1')]={'type':{'type':Sequelize['ENUM'](_0x4a7b('0x2'),_0x4a7b('0x3'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize['STRING']},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x4a7b('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x4a7b('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x4a7b('0x4')]},'transferercontext':{'type':Sequelize[_0x4a7b('0x4')]},'transfererexten':{'type':Sequelize[_0x4a7b('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x4a7b('0x4')]},'transfereechannel':{'type':Sequelize[_0x4a7b('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x4a7b('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x4a7b('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x4a7b('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x4a7b('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x4a7b('0x4')]},'transfereecontext':{'type':Sequelize[_0x4a7b('0x4')]},'transfereeexten':{'type':Sequelize[_0x4a7b('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x4a7b('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0x4a7b('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x4a7b('0x4')]}}; \ No newline at end of file +var _0x9e32=['attended','STRING','Yes','moment','exports','ENUM'];(function(_0x30b473,_0x5754b9){var _0x11b65e=function(_0x40bb99){while(--_0x40bb99){_0x30b473['push'](_0x30b473['shift']());}};_0x11b65e(++_0x5754b9);}(_0x9e32,0xb7));var _0x29e3=function(_0x73a84b,_0x23d3bb){_0x73a84b=_0x73a84b-0x0;var _0x9e2a66=_0x9e32[_0x73a84b];return _0x9e2a66;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x29e3('0x0'));module[_0x29e3('0x1')]={'type':{'type':Sequelize[_0x29e3('0x2')]('blind',_0x29e3('0x3'))},'result':{'type':Sequelize[_0x29e3('0x4')]},'transfererchannel':{'type':Sequelize[_0x29e3('0x4')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x29e3('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x29e3('0x4')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x29e3('0x4')]},'transfererexten':{'type':Sequelize[_0x29e3('0x4')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x29e3('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x29e3('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x29e3('0x4')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize[_0x29e3('0x4')]},'transfereeexten':{'type':Sequelize[_0x29e3('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize[_0x29e3('0x2')](_0x29e3('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x29e3('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 8f6b438..42b6108 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 _0x1c31=['status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','name','map','VoiceTransferReport','fieldName','type','key','query','keys','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','rows','catch','show','params','fields','include','options','find','create','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1c31,0x153));var _0x11c3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1c31[_0x19e35c];return _0x3e1fe8;};'use strict';var emlformat=require(_0x11c3('0x0'));var rimraf=require(_0x11c3('0x1'));var zipdir=require(_0x11c3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x11c3('0x3'));var BPromise=require(_0x11c3('0x4'));var Mustache=require(_0x11c3('0x5'));var util=require('util');var path=require(_0x11c3('0x6'));var sox=require(_0x11c3('0x7'));var csv=require(_0x11c3('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x11c3('0x9'));var _=require(_0x11c3('0xa'));var squel=require(_0x11c3('0xb'));var crypto=require(_0x11c3('0xc'));var jsforce=require(_0x11c3('0xd'));var deskjs=require(_0x11c3('0xe'));var toCsv=require(_0x11c3('0x8'));var querystring=require(_0x11c3('0xf'));var Papa=require('papaparse');var Redis=require(_0x11c3('0x10'));var authService=require(_0x11c3('0x11'));var qs=require(_0x11c3('0x12'));var as=require(_0x11c3('0x13'));var hardwareService=require(_0x11c3('0x14'));var logger=require(_0x11c3('0x15'))(_0x11c3('0x16'));var utils=require('../../config/utils');var config=require(_0x11c3('0x17'));var licenseUtil=require(_0x11c3('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x46470d,_0x583885){_0x583885=_0x583885||0xcc;return function(_0x7b157f){if(_0x7b157f){return _0x46470d[_0x11c3('0x19')](_0x583885);}return _0x46470d[_0x11c3('0x1a')](_0x583885)[_0x11c3('0x1b')]();};}function respondWithResult(_0x5ec73f,_0x4c5371){_0x4c5371=_0x4c5371||0xc8;return function(_0x2e5c45){if(_0x2e5c45){return _0x5ec73f[_0x11c3('0x1a')](_0x4c5371)['json'](_0x2e5c45);}};}function respondWithFilteredResult(_0x14d4dc,_0x1f7de7){return function(_0x1ada43){if(_0x1ada43){var _0x121538=typeof _0x1f7de7[_0x11c3('0x1c')]==='undefined'&&typeof _0x1f7de7[_0x11c3('0x1d')]===_0x11c3('0x1e');var _0x4b9068=_0x1ada43[_0x11c3('0x1f')];var _0x4453e6=_0x121538?0x0:_0x1f7de7[_0x11c3('0x1c')];var _0x374f77=_0x121538?_0x1ada43[_0x11c3('0x1f')]:_0x1f7de7[_0x11c3('0x1c')]+_0x1f7de7['limit'];var _0x56549c;if(_0x374f77>=_0x4b9068){_0x374f77=_0x4b9068;_0x56549c=0xc8;}else{_0x56549c=0xce;}_0x14d4dc[_0x11c3('0x1a')](_0x56549c);return _0x14d4dc[_0x11c3('0x20')](_0x11c3('0x21'),_0x4453e6+'-'+_0x374f77+'/'+_0x4b9068)[_0x11c3('0x22')](_0x1ada43);}return null;};}function patchUpdates(_0x3f6022){return function(_0x3bee5a){try{jsonpatch[_0x11c3('0x23')](_0x3bee5a,_0x3f6022,!![]);}catch(_0xbb3d72){return BPromise[_0x11c3('0x24')](_0xbb3d72);}return _0x3bee5a[_0x11c3('0x25')]();};}function saveUpdates(_0x561842,_0x5e29ca){return function(_0x4b92ab){if(_0x4b92ab){return _0x4b92ab[_0x11c3('0x26')](_0x561842)[_0x11c3('0x27')](function(_0x3c2e7a){return _0x3c2e7a;});}return null;};}function removeEntity(_0xdc53b9,_0x4c035f){return function(_0x40b21b){if(_0x40b21b){return _0x40b21b[_0x11c3('0x28')]()[_0x11c3('0x27')](function(){_0xdc53b9[_0x11c3('0x1a')](0xcc)[_0x11c3('0x1b')]();});}};}function handleEntityNotFound(_0x5c6641,_0x1043e9){return function(_0x19b93d){if(!_0x19b93d){_0x5c6641[_0x11c3('0x19')](0x194);}return _0x19b93d;};}function handleError(_0x6e02f,_0x29bf00){_0x29bf00=_0x29bf00||0x1f4;return function(_0x316a81){logger['error'](_0x316a81['stack']);if(_0x316a81[_0x11c3('0x29')]){delete _0x316a81['name'];}_0x6e02f[_0x11c3('0x1a')](_0x29bf00)['send'](_0x316a81);};}exports['index']=function(_0xe96cc8,_0x2bf215){var _0x44be24={},_0x2e7dea={},_0x43c2a9={'count':0x0,'rows':[]};var _0x9a403d=_[_0x11c3('0x2a')](db[_0x11c3('0x2b')]['rawAttributes'],function(_0x23462b){return{'name':_0x23462b[_0x11c3('0x2c')],'type':_0x23462b[_0x11c3('0x2d')][_0x11c3('0x2e')]};});_0x2e7dea['model']=_['map'](_0x9a403d,_0x11c3('0x29'));_0x2e7dea[_0x11c3('0x2f')]=_[_0x11c3('0x30')](_0xe96cc8[_0x11c3('0x2f')]);_0x2e7dea[_0x11c3('0x31')]=_[_0x11c3('0x32')](_0x2e7dea['model'],_0x2e7dea[_0x11c3('0x2f')]);_0x44be24[_0x11c3('0x33')]=_[_0x11c3('0x32')](_0x2e7dea[_0x11c3('0x34')],qs['fields'](_0xe96cc8['query']['fields']));_0x44be24[_0x11c3('0x33')]=_0x44be24[_0x11c3('0x33')][_0x11c3('0x35')]?_0x44be24[_0x11c3('0x33')]:_0x2e7dea[_0x11c3('0x34')];if(!_0xe96cc8['query'][_0x11c3('0x36')](_0x11c3('0x37'))){_0x44be24[_0x11c3('0x1d')]=qs['limit'](_0xe96cc8[_0x11c3('0x2f')][_0x11c3('0x1d')]);_0x44be24[_0x11c3('0x1c')]=qs[_0x11c3('0x1c')](_0xe96cc8[_0x11c3('0x2f')][_0x11c3('0x1c')]);}_0x44be24[_0x11c3('0x38')]=qs[_0x11c3('0x39')](_0xe96cc8['query']['sort']);_0x44be24[_0x11c3('0x3a')]=qs[_0x11c3('0x31')](_[_0x11c3('0x3b')](_0xe96cc8[_0x11c3('0x2f')],_0x2e7dea[_0x11c3('0x31')]),_0x9a403d);if(_0xe96cc8[_0x11c3('0x2f')][_0x11c3('0x3c')]){_0x44be24[_0x11c3('0x3a')]=_[_0x11c3('0x3d')](_0x44be24[_0x11c3('0x3a')],{'$or':_['map'](_0x9a403d,function(_0x402353){if(_0x402353[_0x11c3('0x2d')]!=='VIRTUAL'){var _0x158d19={};_0x158d19[_0x402353[_0x11c3('0x29')]]={'$like':'%'+_0xe96cc8[_0x11c3('0x2f')][_0x11c3('0x3c')]+'%'};return _0x158d19;}})});}_0x44be24=_[_0x11c3('0x3d')]({},_0x44be24,_0xe96cc8['options']);var _0x5ad6ba={'where':_0x44be24[_0x11c3('0x3a')]};return db['VoiceTransferReport'][_0x11c3('0x1f')](_0x5ad6ba)[_0x11c3('0x27')](function(_0x4e54c3){_0x43c2a9[_0x11c3('0x1f')]=_0x4e54c3;if(_0xe96cc8[_0x11c3('0x2f')][_0x11c3('0x3e')]){_0x44be24['include']=[{'all':!![]}];}return db[_0x11c3('0x2b')]['findAll'](_0x44be24);})[_0x11c3('0x27')](function(_0x3aedc6){_0x43c2a9[_0x11c3('0x3f')]=_0x3aedc6;return _0x43c2a9;})['then'](respondWithFilteredResult(_0x2bf215,_0x44be24))[_0x11c3('0x40')](handleError(_0x2bf215,null));};exports[_0x11c3('0x41')]=function(_0x1bb4df,_0x5c2a90){var _0x173819={'raw':!![],'where':{'id':_0x1bb4df[_0x11c3('0x42')]['id']}},_0x278fca={};_0x278fca[_0x11c3('0x34')]=_[_0x11c3('0x30')](db[_0x11c3('0x2b')]['rawAttributes']);_0x278fca['query']=_[_0x11c3('0x30')](_0x1bb4df[_0x11c3('0x2f')]);_0x278fca[_0x11c3('0x31')]=_[_0x11c3('0x32')](_0x278fca[_0x11c3('0x34')],_0x278fca[_0x11c3('0x2f')]);_0x173819[_0x11c3('0x33')]=_['intersection'](_0x278fca['model'],qs[_0x11c3('0x43')](_0x1bb4df['query'][_0x11c3('0x43')]));_0x173819['attributes']=_0x173819[_0x11c3('0x33')][_0x11c3('0x35')]?_0x173819[_0x11c3('0x33')]:_0x278fca[_0x11c3('0x34')];if(_0x1bb4df[_0x11c3('0x2f')]['includeAll']){_0x173819[_0x11c3('0x44')]=[{'all':!![]}];}_0x173819=_[_0x11c3('0x3d')]({},_0x173819,_0x1bb4df[_0x11c3('0x45')]);return db['VoiceTransferReport'][_0x11c3('0x46')](_0x173819)[_0x11c3('0x27')](handleEntityNotFound(_0x5c2a90,null))['then'](respondWithResult(_0x5c2a90,null))[_0x11c3('0x40')](handleError(_0x5c2a90,null));};exports[_0x11c3('0x47')]=function(_0x33827e,_0x8c8aa0){return db[_0x11c3('0x2b')][_0x11c3('0x47')](_0x33827e['body'],{})[_0x11c3('0x27')](respondWithResult(_0x8c8aa0,0xc9))[_0x11c3('0x40')](handleError(_0x8c8aa0,null));};exports[_0x11c3('0x26')]=function(_0x1dd223,_0x35e0f0){if(_0x1dd223['body']['id']){delete _0x1dd223['body']['id'];}return db['VoiceTransferReport'][_0x11c3('0x46')]({'where':{'id':_0x1dd223[_0x11c3('0x42')]['id']}})[_0x11c3('0x27')](handleEntityNotFound(_0x35e0f0,null))[_0x11c3('0x27')](saveUpdates(_0x1dd223['body'],null))[_0x11c3('0x27')](respondWithResult(_0x35e0f0,null))[_0x11c3('0x40')](handleError(_0x35e0f0,null));};exports[_0x11c3('0x28')]=function(_0x134beb,_0x237064){return db[_0x11c3('0x2b')][_0x11c3('0x46')]({'where':{'id':_0x134beb[_0x11c3('0x42')]['id']}})[_0x11c3('0x27')](handleEntityNotFound(_0x237064,null))[_0x11c3('0x27')](removeEntity(_0x237064,null))[_0x11c3('0x40')](handleError(_0x237064,null));};exports[_0x11c3('0x48')]=function(_0xceeb92,_0x3437f2){return db['VoiceTransferReport']['describe']()[_0x11c3('0x27')](respondWithResult(_0x3437f2,null))[_0x11c3('0x40')](handleError(_0x3437f2,null));}; \ No newline at end of file +var _0xae84=['to-csv','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','offset','count','Content-Range','apply','save','update','then','destroy','end','error','name','send','map','VoiceTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xae84,0x8b));var _0x4ae8=function(_0xe0fc06,_0x4c3b76){_0xe0fc06=_0xe0fc06-0x0;var _0x5a0ed9=_0xae84[_0xe0fc06];return _0x5a0ed9;};'use strict';var emlformat=require(_0x4ae8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4ae8('0x1'));var jsonpatch=require(_0x4ae8('0x2'));var rp=require(_0x4ae8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4ae8('0x4'));var util=require(_0x4ae8('0x5'));var path=require(_0x4ae8('0x6'));var sox=require('sox');var csv=require(_0x4ae8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4ae8('0x8'));var _=require(_0x4ae8('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4ae8('0xa'));var deskjs=require(_0x4ae8('0xb'));var toCsv=require(_0x4ae8('0x7'));var querystring=require(_0x4ae8('0xc'));var Papa=require('papaparse');var Redis=require(_0x4ae8('0xd'));var authService=require(_0x4ae8('0xe'));var qs=require(_0x4ae8('0xf'));var as=require(_0x4ae8('0x10'));var hardwareService=require(_0x4ae8('0x11'));var logger=require(_0x4ae8('0x12'))(_0x4ae8('0x13'));var utils=require('../../config/utils');var config=require(_0x4ae8('0x14'));var licenseUtil=require(_0x4ae8('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x197b25,_0x4c8d3a){_0x4c8d3a=_0x4c8d3a||0xcc;return function(_0x39024e){if(_0x39024e){return _0x197b25[_0x4ae8('0x16')](_0x4c8d3a);}return _0x197b25['status'](_0x4c8d3a)['end']();};}function respondWithResult(_0x3f166d,_0xbd3f78){_0xbd3f78=_0xbd3f78||0xc8;return function(_0x43acfa){if(_0x43acfa){return _0x3f166d[_0x4ae8('0x17')](_0xbd3f78)[_0x4ae8('0x18')](_0x43acfa);}};}function respondWithFilteredResult(_0x2681a5,_0x4371f6){return function(_0x5314ef){if(_0x5314ef){var _0x3599fd=typeof _0x4371f6['offset']===_0x4ae8('0x19')&&typeof _0x4371f6[_0x4ae8('0x1a')]==='undefined';var _0x590042=_0x5314ef['count'];var _0x2358ad=_0x3599fd?0x0:_0x4371f6[_0x4ae8('0x1b')];var _0x188adb=_0x3599fd?_0x5314ef[_0x4ae8('0x1c')]:_0x4371f6[_0x4ae8('0x1b')]+_0x4371f6['limit'];var _0x57b7fd;if(_0x188adb>=_0x590042){_0x188adb=_0x590042;_0x57b7fd=0xc8;}else{_0x57b7fd=0xce;}_0x2681a5[_0x4ae8('0x17')](_0x57b7fd);return _0x2681a5['set'](_0x4ae8('0x1d'),_0x2358ad+'-'+_0x188adb+'/'+_0x590042)['json'](_0x5314ef);}return null;};}function patchUpdates(_0x1cb0b9){return function(_0x40b971){try{jsonpatch[_0x4ae8('0x1e')](_0x40b971,_0x1cb0b9,!![]);}catch(_0x336999){return BPromise['reject'](_0x336999);}return _0x40b971[_0x4ae8('0x1f')]();};}function saveUpdates(_0x2ac5e6,_0x4cc79b){return function(_0x172547){if(_0x172547){return _0x172547[_0x4ae8('0x20')](_0x2ac5e6)[_0x4ae8('0x21')](function(_0x4ccdaf){return _0x4ccdaf;});}return null;};}function removeEntity(_0x1db2e2,_0x447510){return function(_0x430f6f){if(_0x430f6f){return _0x430f6f[_0x4ae8('0x22')]()[_0x4ae8('0x21')](function(){_0x1db2e2['status'](0xcc)[_0x4ae8('0x23')]();});}};}function handleEntityNotFound(_0x35ec7c,_0x1e0220){return function(_0x2a1ecd){if(!_0x2a1ecd){_0x35ec7c[_0x4ae8('0x16')](0x194);}return _0x2a1ecd;};}function handleError(_0xaa4ed4,_0x406e1d){_0x406e1d=_0x406e1d||0x1f4;return function(_0x468cf7){logger[_0x4ae8('0x24')](_0x468cf7['stack']);if(_0x468cf7[_0x4ae8('0x25')]){delete _0x468cf7[_0x4ae8('0x25')];}_0xaa4ed4[_0x4ae8('0x17')](_0x406e1d)[_0x4ae8('0x26')](_0x468cf7);};}exports['index']=function(_0x4ba059,_0x17712a){var _0x594879={},_0x4e89eb={},_0x3fe15d={'count':0x0,'rows':[]};var _0xb6b1c6=_[_0x4ae8('0x27')](db[_0x4ae8('0x28')][_0x4ae8('0x29')],function(_0x332300){return{'name':_0x332300[_0x4ae8('0x2a')],'type':_0x332300[_0x4ae8('0x2b')]['key']};});_0x4e89eb[_0x4ae8('0x2c')]=_[_0x4ae8('0x27')](_0xb6b1c6,_0x4ae8('0x25'));_0x4e89eb[_0x4ae8('0x2d')]=_[_0x4ae8('0x2e')](_0x4ba059[_0x4ae8('0x2d')]);_0x4e89eb[_0x4ae8('0x2f')]=_[_0x4ae8('0x30')](_0x4e89eb['model'],_0x4e89eb[_0x4ae8('0x2d')]);_0x594879[_0x4ae8('0x31')]=_[_0x4ae8('0x30')](_0x4e89eb['model'],qs['fields'](_0x4ba059[_0x4ae8('0x2d')][_0x4ae8('0x32')]));_0x594879['attributes']=_0x594879[_0x4ae8('0x31')][_0x4ae8('0x33')]?_0x594879[_0x4ae8('0x31')]:_0x4e89eb[_0x4ae8('0x2c')];if(!_0x4ba059[_0x4ae8('0x2d')][_0x4ae8('0x34')](_0x4ae8('0x35'))){_0x594879[_0x4ae8('0x1a')]=qs[_0x4ae8('0x1a')](_0x4ba059[_0x4ae8('0x2d')][_0x4ae8('0x1a')]);_0x594879[_0x4ae8('0x1b')]=qs[_0x4ae8('0x1b')](_0x4ba059['query'][_0x4ae8('0x1b')]);}_0x594879[_0x4ae8('0x36')]=qs[_0x4ae8('0x37')](_0x4ba059['query']['sort']);_0x594879[_0x4ae8('0x38')]=qs[_0x4ae8('0x2f')](_[_0x4ae8('0x39')](_0x4ba059[_0x4ae8('0x2d')],_0x4e89eb['filters']),_0xb6b1c6);if(_0x4ba059[_0x4ae8('0x2d')][_0x4ae8('0x3a')]){_0x594879[_0x4ae8('0x38')]=_[_0x4ae8('0x3b')](_0x594879[_0x4ae8('0x38')],{'$or':_['map'](_0xb6b1c6,function(_0x271e53){if(_0x271e53[_0x4ae8('0x2b')]!==_0x4ae8('0x3c')){var _0x4a0db7={};_0x4a0db7[_0x271e53['name']]={'$like':'%'+_0x4ba059[_0x4ae8('0x2d')][_0x4ae8('0x3a')]+'%'};return _0x4a0db7;}})});}_0x594879=_[_0x4ae8('0x3b')]({},_0x594879,_0x4ba059[_0x4ae8('0x3d')]);var _0xa205fe={'where':_0x594879[_0x4ae8('0x38')]};return db[_0x4ae8('0x28')][_0x4ae8('0x1c')](_0xa205fe)[_0x4ae8('0x21')](function(_0x4125d4){_0x3fe15d[_0x4ae8('0x1c')]=_0x4125d4;if(_0x4ba059[_0x4ae8('0x2d')][_0x4ae8('0x3e')]){_0x594879[_0x4ae8('0x3f')]=[{'all':!![]}];}return db[_0x4ae8('0x28')][_0x4ae8('0x40')](_0x594879);})[_0x4ae8('0x21')](function(_0x3665d9){_0x3fe15d[_0x4ae8('0x41')]=_0x3665d9;return _0x3fe15d;})[_0x4ae8('0x21')](respondWithFilteredResult(_0x17712a,_0x594879))[_0x4ae8('0x42')](handleError(_0x17712a,null));};exports[_0x4ae8('0x43')]=function(_0xf8ac0e,_0x38050e){var _0x5b788e={'raw':!![],'where':{'id':_0xf8ac0e[_0x4ae8('0x44')]['id']}},_0x5dff3a={};_0x5dff3a[_0x4ae8('0x2c')]=_[_0x4ae8('0x2e')](db[_0x4ae8('0x28')][_0x4ae8('0x29')]);_0x5dff3a[_0x4ae8('0x2d')]=_[_0x4ae8('0x2e')](_0xf8ac0e[_0x4ae8('0x2d')]);_0x5dff3a['filters']=_['intersection'](_0x5dff3a['model'],_0x5dff3a[_0x4ae8('0x2d')]);_0x5b788e['attributes']=_[_0x4ae8('0x30')](_0x5dff3a[_0x4ae8('0x2c')],qs[_0x4ae8('0x32')](_0xf8ac0e[_0x4ae8('0x2d')]['fields']));_0x5b788e[_0x4ae8('0x31')]=_0x5b788e[_0x4ae8('0x31')][_0x4ae8('0x33')]?_0x5b788e['attributes']:_0x5dff3a[_0x4ae8('0x2c')];if(_0xf8ac0e[_0x4ae8('0x2d')]['includeAll']){_0x5b788e[_0x4ae8('0x3f')]=[{'all':!![]}];}_0x5b788e=_[_0x4ae8('0x3b')]({},_0x5b788e,_0xf8ac0e[_0x4ae8('0x3d')]);return db[_0x4ae8('0x28')][_0x4ae8('0x45')](_0x5b788e)[_0x4ae8('0x21')](handleEntityNotFound(_0x38050e,null))[_0x4ae8('0x21')](respondWithResult(_0x38050e,null))[_0x4ae8('0x42')](handleError(_0x38050e,null));};exports['create']=function(_0x14e722,_0x3719ae){return db[_0x4ae8('0x28')][_0x4ae8('0x46')](_0x14e722['body'],{})[_0x4ae8('0x21')](respondWithResult(_0x3719ae,0xc9))[_0x4ae8('0x42')](handleError(_0x3719ae,null));};exports[_0x4ae8('0x20')]=function(_0x29cd60,_0x2254a2){if(_0x29cd60[_0x4ae8('0x47')]['id']){delete _0x29cd60['body']['id'];}return db[_0x4ae8('0x28')][_0x4ae8('0x45')]({'where':{'id':_0x29cd60[_0x4ae8('0x44')]['id']}})[_0x4ae8('0x21')](handleEntityNotFound(_0x2254a2,null))[_0x4ae8('0x21')](saveUpdates(_0x29cd60[_0x4ae8('0x47')],null))[_0x4ae8('0x21')](respondWithResult(_0x2254a2,null))['catch'](handleError(_0x2254a2,null));};exports[_0x4ae8('0x22')]=function(_0x44617f,_0x5030da){return db['VoiceTransferReport']['find']({'where':{'id':_0x44617f[_0x4ae8('0x44')]['id']}})[_0x4ae8('0x21')](handleEntityNotFound(_0x5030da,null))['then'](removeEntity(_0x5030da,null))[_0x4ae8('0x42')](handleError(_0x5030da,null));};exports[_0x4ae8('0x48')]=function(_0x176bd7,_0x457c04){return db[_0x4ae8('0x28')]['describe']()['then'](respondWithResult(_0x457c04,null))['catch'](handleError(_0x457c04,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index b61834f..579c0c3 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 _0x18ad=['moment','bluebird','request-promise','path','../../config/environment','exports','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api'];(function(_0xdf22cc,_0x3fceff){var _0x1094a7=function(_0x12a4d4){while(--_0x12a4d4){_0xdf22cc['push'](_0xdf22cc['shift']());}};_0x1094a7(++_0x3fceff);}(_0x18ad,0x1c3));var _0xd18a=function(_0x5534fe,_0x43c22e){_0x5534fe=_0x5534fe-0x0;var _0x3d1dc2=_0x18ad[_0x5534fe];return _0x3d1dc2;};'use strict';var _=require(_0xd18a('0x0'));var util=require(_0xd18a('0x1'));var logger=require(_0xd18a('0x2'))(_0xd18a('0x3'));var moment=require(_0xd18a('0x4'));var BPromise=require(_0xd18a('0x5'));var rp=require(_0xd18a('0x6'));var fs=require('fs');var path=require(_0xd18a('0x7'));var rimraf=require('rimraf');var config=require(_0xd18a('0x8'));var attributes=require('./voiceTransferReport.attributes');module[_0xd18a('0x9')]=function(_0x4ee8f0,_0x5757dc){return _0x4ee8f0[_0xd18a('0xa')](_0xd18a('0xb'),attributes,{'tableName':_0xd18a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa8f8=['request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','exports','report_call_transfer','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5951e8,_0x42b9a7){var _0x20a1f5=function(_0x2bc968){while(--_0x2bc968){_0x5951e8['push'](_0x5951e8['shift']());}};_0x20a1f5(++_0x42b9a7);}(_0xa8f8,0x10b));var _0x8a8f=function(_0x53f608,_0x256def){_0x53f608=_0x53f608-0x0;var _0x495b7d=_0xa8f8[_0x53f608];return _0x495b7d;};'use strict';var _=require(_0x8a8f('0x0'));var util=require(_0x8a8f('0x1'));var logger=require(_0x8a8f('0x2'))(_0x8a8f('0x3'));var moment=require(_0x8a8f('0x4'));var BPromise=require(_0x8a8f('0x5'));var rp=require(_0x8a8f('0x6'));var fs=require('fs');var path=require(_0x8a8f('0x7'));var rimraf=require(_0x8a8f('0x8'));var config=require(_0x8a8f('0x9'));var attributes=require(_0x8a8f('0xa'));module[_0x8a8f('0xb')]=function(_0x374a2d,_0x4d5d8d){return _0x374a2d['define']('VoiceTransferReport',attributes,{'tableName':_0x8a8f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 9274bf7..1526c78 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 _0xdae2=['bluebird','randomstring','../../config/utils','../../config/environment','client','http','request','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceTransferReport,\x20%s,\x20%s','result','message','catch','body','options','raw','CreateVoiceTransferReport','lodash','util','moment'];(function(_0x253fc8,_0x2882fa){var _0x4b3bbd=function(_0x4075ab){while(--_0x4075ab){_0x253fc8['push'](_0x253fc8['shift']());}};_0x4b3bbd(++_0x2882fa);}(_0xdae2,0x1b7));var _0x2dae=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xdae2[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0x2dae('0x0'));var util=require(_0x2dae('0x1'));var moment=require(_0x2dae('0x2'));var BPromise=require(_0x2dae('0x3'));var rs=require(_0x2dae('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2dae('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2dae('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x2dae('0x7')][_0x2dae('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19c1e8,_0x2bc1db,_0x338769){return new BPromise(function(_0x538262,_0x5f5541){return client[_0x2dae('0x9')](_0x19c1e8,_0x338769)[_0x2dae('0xa')](function(_0x41e9ec){logger[_0x2dae('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x2bc1db,_0x2dae('0xc'));logger[_0x2dae('0xd')](_0x2dae('0xe'),_0x2bc1db,_0x2dae('0xc'),JSON[_0x2dae('0xf')](_0x41e9ec));if(_0x41e9ec['error']){if(_0x41e9ec[_0x2dae('0x10')][_0x2dae('0x11')]===0x1f4){logger['error'](_0x2dae('0x12'),_0x2bc1db,_0x41e9ec['error']['message']);return _0x5f5541(_0x41e9ec['error']['message']);}logger[_0x2dae('0x10')](_0x2dae('0x12'),_0x2bc1db,_0x41e9ec[_0x2dae('0x10')]['message']);return _0x538262(_0x41e9ec[_0x2dae('0x10')]['message']);}else{logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x2bc1db,'request\x20sent');_0x538262(_0x41e9ec[_0x2dae('0x13')][_0x2dae('0x14')]);}})[_0x2dae('0x15')](function(_0x5ad083){logger[_0x2dae('0x10')](_0x2dae('0x12'),_0x2bc1db,_0x5ad083);_0x5f5541(_0x5ad083);});});}exports['CreateVoiceTransferReport']=function(_0x1ecb79){var _0x54fbb5=this;return new Promise(function(_0xaf81d1,_0x1dfc96){return db['VoiceTransferReport']['create'](_0x1ecb79[_0x2dae('0x16')],{'raw':_0x1ecb79[_0x2dae('0x17')]?_0x1ecb79[_0x2dae('0x17')][_0x2dae('0x18')]===undefined?!![]:![]:!![]})[_0x2dae('0xa')](function(_0x41c654){logger[_0x2dae('0xb')](_0x2dae('0x19'),_0x1ecb79);logger[_0x2dae('0xd')](_0x2dae('0x19'),_0x1ecb79,JSON['stringify'](_0x41c654));_0xaf81d1(_0x41c654);})[_0x2dae('0x15')](function(_0x54a251){logger[_0x2dae('0x10')](_0x2dae('0x19'),_0x54a251[_0x2dae('0x14')],_0x1ecb79);_0x1dfc96(_0x54fbb5['error'](0x1f4,_0x54a251['message']));});});}; \ No newline at end of file +var _0x3bf5=['jayson/promise','client','http','request','then','debug','request\x20sent','stringify','error','code','message','VoiceTransferReport,\x20%s,\x20%s','info','result','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x320835,_0x3f9dda){var _0x1f7e58=function(_0x55a6ae){while(--_0x55a6ae){_0x320835['push'](_0x320835['shift']());}};_0x1f7e58(++_0x3f9dda);}(_0x3bf5,0x19b));var _0x53bf=function(_0x3b2369,_0x4c68b9){_0x3b2369=_0x3b2369-0x0;var _0x5a1367=_0x3bf5[_0x3b2369];return _0x5a1367;};'use strict';var _=require(_0x53bf('0x0'));var util=require(_0x53bf('0x1'));var moment=require('moment');var BPromise=require(_0x53bf('0x2'));var rs=require(_0x53bf('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53bf('0x4'))['db'];var utils=require(_0x53bf('0x5'));var logger=require(_0x53bf('0x6'))(_0x53bf('0x7'));var config=require(_0x53bf('0x8'));var jayson=require(_0x53bf('0x9'));var client=jayson[_0x53bf('0xa')][_0x53bf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x699fae,_0x2921de,_0x2c9e47){return new BPromise(function(_0x5e3f50,_0x23db33){return client[_0x53bf('0xc')](_0x699fae,_0x2c9e47)[_0x53bf('0xd')](function(_0x4c2d06){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x2921de,'request\x20sent');logger[_0x53bf('0xe')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x2921de,_0x53bf('0xf'),JSON[_0x53bf('0x10')](_0x4c2d06));if(_0x4c2d06['error']){if(_0x4c2d06[_0x53bf('0x11')][_0x53bf('0x12')]===0x1f4){logger[_0x53bf('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x2921de,_0x4c2d06[_0x53bf('0x11')][_0x53bf('0x13')]);return _0x23db33(_0x4c2d06[_0x53bf('0x11')][_0x53bf('0x13')]);}logger['error'](_0x53bf('0x14'),_0x2921de,_0x4c2d06[_0x53bf('0x11')]['message']);return _0x5e3f50(_0x4c2d06[_0x53bf('0x11')][_0x53bf('0x13')]);}else{logger[_0x53bf('0x15')](_0x53bf('0x14'),_0x2921de,_0x53bf('0xf'));_0x5e3f50(_0x4c2d06[_0x53bf('0x16')][_0x53bf('0x13')]);}})['catch'](function(_0x58c0f5){logger['error'](_0x53bf('0x14'),_0x2921de,_0x58c0f5);_0x23db33(_0x58c0f5);});});}exports[_0x53bf('0x17')]=function(_0x1b899b){var _0x2e8268=this;return new Promise(function(_0x2eddb4,_0x2750e2){return db[_0x53bf('0x18')][_0x53bf('0x19')](_0x1b899b[_0x53bf('0x1a')],{'raw':_0x1b899b[_0x53bf('0x1b')]?_0x1b899b['options'][_0x53bf('0x1c')]===undefined?!![]:![]:!![]})[_0x53bf('0xd')](function(_0x5bf5a){logger['info'](_0x53bf('0x17'),_0x1b899b);logger[_0x53bf('0xe')]('CreateVoiceTransferReport',_0x1b899b,JSON[_0x53bf('0x10')](_0x5bf5a));_0x2eddb4(_0x5bf5a);})[_0x53bf('0x1d')](function(_0x187620){logger[_0x53bf('0x11')](_0x53bf('0x17'),_0x187620[_0x53bf('0x13')],_0x1b899b);_0x2750e2(_0x2e8268[_0x53bf('0x11')](0x1f4,_0x187620[_0x53bf('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 3a863d7..20b5c2a 100644 --- a/server/api/webbar/index.js +++ b/server/api/webbar/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe5b3=['transfer','Router','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','hangup','answer','hold','/unhold','unhold','/calls','calls','/transfer'];(function(_0x2552e9,_0x4715e7){var _0x2428eb=function(_0x21d38b){while(--_0x21d38b){_0x2552e9['push'](_0x2552e9['shift']());}};_0x2428eb(++_0x4715e7);}(_0xe5b3,0x133));var _0x3e5b=function(_0x18f46a,_0x157938){_0x18f46a=_0x18f46a-0x0;var _0x3e786e=_0xe5b3[_0x18f46a];return _0x3e786e;};'use strict';var express=require('express');var router=express[_0x3e5b('0x0')]();var auth=require(_0x3e5b('0x1'));var controller=require(_0x3e5b('0x2'));router[_0x3e5b('0x3')](_0x3e5b('0x4'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0x7')]);router[_0x3e5b('0x3')](_0x3e5b('0x8'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x9')]);router[_0x3e5b('0x3')]('/answer',auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xa')]);router[_0x3e5b('0x3')]('/hold',auth['isAuthenticated'](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xb')]);router[_0x3e5b('0x3')](_0x3e5b('0xc'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0xd')]);router['post'](_0x3e5b('0xe'),auth[_0x3e5b('0x5')](),auth[_0x3e5b('0x6')](),controller[_0x3e5b('0xf')]);router[_0x3e5b('0x3')](_0x3e5b('0x10'),auth[_0x3e5b('0x5')](),auth['isWebrtcLicence'](),controller[_0x3e5b('0x11')]);module['exports']=router; \ No newline at end of file +var _0x34e8=['/unhold','unhold','/calls','calls','transfer','exports','express','Router','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','isWebrtcLicence','originate','post','/hangup','hangup','/answer','answer','/hold','hold'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0x34e8,0x12c));var _0x834e=function(_0x4f9fff,_0x36d5ee){_0x4f9fff=_0x4f9fff-0x0;var _0x1e5a45=_0x34e8[_0x4f9fff];return _0x1e5a45;};'use strict';var express=require(_0x834e('0x0'));var router=express[_0x834e('0x1')]();var auth=require(_0x834e('0x2'));var controller=require(_0x834e('0x3'));router['post'](_0x834e('0x4'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0x7')]);router[_0x834e('0x8')](_0x834e('0x9'),auth[_0x834e('0x5')](),auth['isWebrtcLicence'](),controller[_0x834e('0xa')]);router['post'](_0x834e('0xb'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0xc')]);router[_0x834e('0x8')](_0x834e('0xd'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0xe')]);router[_0x834e('0x8')](_0x834e('0xf'),auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0x10')]);router[_0x834e('0x8')](_0x834e('0x11'),auth[_0x834e('0x5')](),auth['isWebrtcLicence'](),controller[_0x834e('0x12')]);router[_0x834e('0x8')]('/transfer',auth[_0x834e('0x5')](),auth[_0x834e('0x6')](),controller[_0x834e('0x13')]);module[_0x834e('0x14')]=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 3f19ff8..31c2640 100644 --- a/server/api/webbar/webbar.controller.js +++ b/server/api/webbar/webbar.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bc3=['transfer\x20executed!','path','lodash','../../config/environment','util','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','redis','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','log','handleError:','stack','name','status','send','NotFound','error','code','message','result','catch','findOne','all','then','filter','rows','UserId','sessionId','length','\x20not\x20found!','originate\x20fired:','body','userId','callerId','info','entityFound:','user:%s','webbar:originate','json','originate\x20executed!','hangup','hangup\x20fired:','format','webbar:hangup','hangup\x20executed!','answer\x20fired:','answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','VoiceChannels','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','webbar:transfer'];(function(_0x3e00b7,_0x4a7b42){var _0x53fa95=function(_0xe2a798){while(--_0xe2a798){_0x3e00b7['push'](_0x3e00b7['shift']());}};_0x53fa95(++_0x4a7b42);}(_0x4bc3,0x16e));var _0x34bc=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x4bc3[_0xc0a3d3];return _0x3386e8;};'use strict';var path=require(_0x34bc('0x0'));var fs=require('fs');var _=require(_0x34bc('0x1'));var db=require('../../mysqldb')['db'];var config=require(_0x34bc('0x2'));var util=require(_0x34bc('0x3'));var BPromise=require('bluebird');var jayson=require(_0x34bc('0x4'));var amiClient=jayson[_0x34bc('0x5')][_0x34bc('0x6')]({'port':0x232a});var logger=require(_0x34bc('0x7'))(_0x34bc('0x8'));var Redis=require(_0x34bc('0x9'));config[_0x34bc('0xa')]=_['defaults'](config[_0x34bc('0xa')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x34bc('0xa')]));var Schema=require(_0x34bc('0xb'));var originateValidation=new Schema({'userId':{'type':_0x34bc('0xc'),'required':[!![],_0x34bc('0xd')]},'callNumber':{'type':_0x34bc('0xe'),'required':[!![],_0x34bc('0xf')]},'callerId':{'type':'string'},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0x34bc('0xc'),'required':[!![],_0x34bc('0xd')]},'sessionId':{'type':_0x34bc('0xe'),'required':![]}});var answerValidation=new Schema({'userId':{'type':'number','required':[!![],_0x34bc('0xd')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x34bc('0xc'),'required':[!![],_0x34bc('0xd')]},'sessionId':{'type':_0x34bc('0xe'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x34bc('0xe'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0x34bc('0xc'),'required':[!![],_0x34bc('0xd')]},'sessionId':{'type':_0x34bc('0xe'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x34bc('0xe'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x34bc('0xd')]}});var conferenceValidation=new Schema({'userId':{'type':_0x34bc('0xc'),'required':[!![],_0x34bc('0xd')]}});function emit(_0x25da29,_0x2db2dd,_0x69542f){logger['info'](_0x25da29,_0x2db2dd,JSON['stringify'](_0x69542f));io['to'](_0x25da29)['emit'](_0x2db2dd,_0x69542f);}function handleError(_0x4205eb){return function(_0x3eaedf){console[_0x34bc('0x10')](_0x34bc('0x11'),_0x3eaedf,_0x3eaedf instanceof RangeError);logger['error'](_0x3eaedf[_0x34bc('0x12')]);if(_0x3eaedf instanceof RangeError){if(_0x3eaedf[_0x34bc('0x13')]){delete _0x3eaedf['name'];}_0x4205eb[_0x34bc('0x14')](0x194)[_0x34bc('0x15')](_0x3eaedf);}else{if(_0x3eaedf['name']){delete _0x3eaedf[_0x34bc('0x13')];}_0x4205eb[_0x34bc('0x14')](0x1f4)[_0x34bc('0x15')](_0x3eaedf);}};}function checkError(){return function(_0x120bd3){if(!_0x120bd3){throw new RangeError(_0x34bc('0x16'));}return _0x120bd3;};}function respondWithRpcPromise(_0x42c814,_0x48087e){return new BPromise(function(_0x40e128,_0x3c9939){var _0x38882c=amiClient;return _0x38882c['request'](_0x42c814,_0x48087e)['then'](function(_0x358d51){if(_0x358d51[_0x34bc('0x17')]){if(_0x358d51[_0x34bc('0x17')][_0x34bc('0x18')]===0x1f4){return _0x3c9939(_0x358d51[_0x34bc('0x17')][_0x34bc('0x19')]);}return _0x40e128(_0x358d51[_0x34bc('0x17')][_0x34bc('0x19')]);}else{_0x40e128(_0x358d51[_0x34bc('0x1a')]);}})[_0x34bc('0x1b')](function(_0x2de017){_0x3c9939(_0x2de017);});});}function getAgent(_0x1edcb0){return db['User'][_0x34bc('0x1c')]({'where':{'id':_0x1edcb0,'role':'agent'}})['then'](checkError());}function getAgentCheckSession(_0x3da96b,_0x5332c8){return new BPromise(function(_0x4082c3,_0x446b58){var _0x46fd76=respondWithRpcPromise('VoiceChannels');var _0x2e6d96=getAgent(_0x3da96b);Promise[_0x34bc('0x1d')]([_0x46fd76,_0x2e6d96])[_0x34bc('0x1e')](function(_0x1a83f7){var _0x2bb874=_0x1a83f7[0x0];var _0x33bf46=_0x1a83f7[0x1];var _0x520fd4=_[_0x34bc('0x1f')](_0x2bb874[_0x34bc('0x20')],function(_0x22aacc){return _0x22aacc[_0x34bc('0x21')]==_0x33bf46['id']&&_0x22aacc[_0x34bc('0x22')]==_0x5332c8;});if(_0x520fd4[_0x34bc('0x23')]==0x1){_0x4082c3(_0x33bf46);}else{_0x446b58(new RangeError('sessionId\x20'+_0x5332c8+_0x34bc('0x24')));}});});}exports['originate']=function(_0x530748,_0x42fd40){logger['info'](_0x34bc('0x25'),_0x530748[_0x34bc('0x26')]);var _0xb446f4=originateValidation[_0x34bc('0xb')](_0x530748[_0x34bc('0x26')]);if(_0xb446f4[_0x34bc('0x23')]>0x0){return _0x42fd40[_0x34bc('0x14')](0x190)['json'](_0xb446f4);}var _0xbd59f9=_0x530748[_0x34bc('0x26')][_0x34bc('0x27')];var _0x3224c7=_0x530748[_0x34bc('0x26')]['callNumber'];var _0x3bc739=_0x530748[_0x34bc('0x26')][_0x34bc('0x28')];var _0x493835=_0x530748[_0x34bc('0x26')]['callbackUrl'];return getAgent(_0xbd59f9)['then'](function(_0x39e630){logger[_0x34bc('0x29')](_0x34bc('0x2a'),_0x39e630[_0x34bc('0x13')]);emit(util['format'](_0x34bc('0x2b'),_0x39e630[_0x34bc('0x13')]),_0x34bc('0x2c'),{'callNumber':_0x3224c7,'callerId':_0x3bc739,'callbackUrl':_0x493835});return _0x42fd40['status'](0xc8)[_0x34bc('0x2d')]({'error':![],'message':_0x34bc('0x2e')});})[_0x34bc('0x1b')](handleError(_0x42fd40));};exports[_0x34bc('0x2f')]=function(_0x53a43a,_0x2ac72b){logger[_0x34bc('0x29')](_0x34bc('0x30'),_0x53a43a['body']);var _0x246a86=hangupValidation[_0x34bc('0xb')](_0x53a43a[_0x34bc('0x26')]);if(_0x246a86[_0x34bc('0x23')]>0x0){return _0x2ac72b[_0x34bc('0x14')](0x190)['json'](_0x246a86);}var _0xca2aaf=_0x53a43a[_0x34bc('0x26')][_0x34bc('0x27')];var _0x174cfe=_0x53a43a[_0x34bc('0x26')]['sessionId'];return getAgent(_0xca2aaf)[_0x34bc('0x1e')](function(_0x50f1ee){logger[_0x34bc('0x29')](_0x34bc('0x2a'),_0x50f1ee[_0x34bc('0x13')]);emit(util[_0x34bc('0x31')]('user:%s',_0x50f1ee[_0x34bc('0x13')]),_0x34bc('0x32'),{'sessionId':_0x174cfe});return _0x2ac72b['status'](0xc8)[_0x34bc('0x2d')]({'error':![],'message':_0x34bc('0x33')});})[_0x34bc('0x1b')](handleError(_0x2ac72b));};exports['answer']=function(_0x31afd3,_0xbf2127){logger[_0x34bc('0x29')](_0x34bc('0x34'),_0x31afd3[_0x34bc('0x26')]);var _0x20debf=answerValidation[_0x34bc('0xb')](_0x31afd3[_0x34bc('0x26')]);if(_0x20debf[_0x34bc('0x23')]>0x0){return _0xbf2127[_0x34bc('0x14')](0x190)[_0x34bc('0x2d')](_0x20debf);}var _0x570824=_0x31afd3['body'][_0x34bc('0x27')];var _0x1e1bf3=_0x31afd3[_0x34bc('0x26')][_0x34bc('0x22')];return getAgent(_0x570824)[_0x34bc('0x1e')](function(_0x2db155){logger['info'](_0x34bc('0x2a'),_0x2db155['name']);emit(util[_0x34bc('0x31')](_0x34bc('0x2b'),_0x2db155[_0x34bc('0x13')]),'webbar:answer',{'sessionId':_0x1e1bf3});return _0xbf2127[_0x34bc('0x14')](0xc8)[_0x34bc('0x2d')]({'error':![],'message':_0x34bc('0x35')});})[_0x34bc('0x1b')](handleError(_0xbf2127));};exports[_0x34bc('0x36')]=function(_0x26924c,_0xba179d){logger[_0x34bc('0x29')](_0x34bc('0x37'),_0x26924c[_0x34bc('0x26')]);var _0x100c70=holdValidation[_0x34bc('0xb')](_0x26924c['body']);if(_0x100c70['length']>0x0){return _0xba179d[_0x34bc('0x14')](0x190)[_0x34bc('0x2d')](_0x100c70);}var _0x180a51=_0x26924c['body']['userId'];var _0x898cf8=_0x26924c[_0x34bc('0x26')][_0x34bc('0x22')];return getAgent(_0x180a51)['then'](function(_0x43bfb7){logger[_0x34bc('0x29')]('entityFound:',_0x43bfb7[_0x34bc('0x13')]);emit(util['format'](_0x34bc('0x2b'),_0x43bfb7['name']),_0x34bc('0x38'),{'sessionId':_0x898cf8});return _0xba179d[_0x34bc('0x14')](0xc8)[_0x34bc('0x2d')]({'error':![],'message':_0x34bc('0x39')});})['catch'](handleError(_0xba179d));};exports[_0x34bc('0x3a')]=function(_0x2bbd0b,_0x103bd1){logger[_0x34bc('0x29')](_0x34bc('0x3b'),_0x2bbd0b[_0x34bc('0x26')]);var _0x18eadd=unholdValidation[_0x34bc('0xb')](_0x2bbd0b['body']);if(_0x18eadd['length']>0x0){return _0x103bd1['status'](0x190)[_0x34bc('0x2d')](_0x18eadd);}var _0x1ed088=_0x2bbd0b['body'][_0x34bc('0x27')];var _0xe7b515=_0x2bbd0b[_0x34bc('0x26')][_0x34bc('0x22')];return getAgent(_0x1ed088)[_0x34bc('0x1e')](function(_0x5c82c2){logger['info']('entityFound:',_0x5c82c2[_0x34bc('0x13')]);emit(util[_0x34bc('0x31')](_0x34bc('0x2b'),_0x5c82c2[_0x34bc('0x13')]),_0x34bc('0x3c'),{'sessionId':_0xe7b515});return _0x103bd1['status'](0xc8)[_0x34bc('0x2d')]({'error':![],'message':_0x34bc('0x3d')});})[_0x34bc('0x1b')](handleError(_0x103bd1));};exports[_0x34bc('0x3e')]=function(_0x58e4c3,_0x1a2cf2){logger[_0x34bc('0x29')](_0x34bc('0x3f'),_0x1a2cf2[_0x34bc('0x26')]);var _0x279a83=callsValidation[_0x34bc('0xb')](_0x58e4c3[_0x34bc('0x26')]);if(_0x279a83[_0x34bc('0x23')]>0x0){return _0x1a2cf2[_0x34bc('0x14')](0x190)[_0x34bc('0x2d')](_0x279a83);}var _0x39c580=_0x58e4c3[_0x34bc('0x26')][_0x34bc('0x27')];var _0x592e81=respondWithRpcPromise(_0x34bc('0x40'));var _0x2cc1f5=getAgent(_0x39c580);return Promise[_0x34bc('0x1d')]([_0x592e81,_0x2cc1f5])[_0x34bc('0x1e')](function(_0x426df1){var _0x1b3704=_0x426df1[0x0];var _0x31cf3a=_0x426df1[0x1];var _0x43337d=_[_0x34bc('0x1f')](_0x1b3704[_0x34bc('0x20')],function(_0x11cd4c){return _0x11cd4c[_0x34bc('0x21')]==_0x31cf3a['id'];});return _0x1a2cf2[_0x34bc('0x14')](0xc8)[_0x34bc('0x2d')]({'count':_0x43337d['length'],'rows':_0x43337d});})[_0x34bc('0x1b')](handleError(_0x1a2cf2));};exports[_0x34bc('0x41')]=function(_0x36143f,_0x320d86){logger[_0x34bc('0x29')](_0x34bc('0x42'),_0x36143f[_0x34bc('0x26')]);var _0x36d2fb=conferenceValidation[_0x34bc('0xb')](_0x36143f[_0x34bc('0x26')]);if(_0x36d2fb['length']>0x0){return _0x320d86[_0x34bc('0x14')](0x190)[_0x34bc('0x2d')](_0x36d2fb);}var _0x51bbbd=_0x36143f['body'][_0x34bc('0x27')];return getAgent(_0x51bbbd)[_0x34bc('0x1e')](function(_0x9dd563){logger[_0x34bc('0x29')]('entityFound:',_0x9dd563[_0x34bc('0x13')]);emit(util[_0x34bc('0x31')](_0x34bc('0x2b'),_0x9dd563[_0x34bc('0x13')]),_0x34bc('0x43'));return _0x320d86[_0x34bc('0x14')](0xc8)[_0x34bc('0x2d')]({'error':![],'message':_0x34bc('0x44')});})['catch'](handleError(_0x320d86));};exports['transfer']=function(_0x405abb,_0x1dd036){logger[_0x34bc('0x29')](_0x34bc('0x45'),_0x405abb[_0x34bc('0x26')]);var _0x3066d9=transferValidation[_0x34bc('0xb')](_0x405abb[_0x34bc('0x26')]);if(_0x3066d9[_0x34bc('0x23')]>0x0){return _0x1dd036[_0x34bc('0x14')](0x190)[_0x34bc('0x2d')](_0x3066d9);}var _0x2d0d2c=_0x405abb[_0x34bc('0x26')][_0x34bc('0x27')];var _0x4d7c67=_0x405abb[_0x34bc('0x26')][_0x34bc('0x22')];var _0xa4e120=_0x405abb['body'][_0x34bc('0x46')];return getAgent(_0x2d0d2c)[_0x34bc('0x1e')](function(_0x124945){logger[_0x34bc('0x29')]('entityFound:',_0x124945[_0x34bc('0x13')]);emit(util[_0x34bc('0x31')](_0x34bc('0x2b'),_0x124945[_0x34bc('0x13')]),_0x34bc('0x47'),{'sessionId':_0x4d7c67,'transferNumber':_0xa4e120});return _0x1dd036['status'](0xc8)[_0x34bc('0x2d')]({'error':![],'message':_0x34bc('0x48')});})[_0x34bc('0x1b')](handleError(_0x1dd036));}; \ No newline at end of file +var _0x34e8=['path','lodash','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','ioredis','defaults','localhost','socket.io-emitter','redis','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','log','handleError:','error','stack','name','status','send','request','then','message','result','catch','User','agent','filter','rows','UserId','sessionId','length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','format','hangup','hangup\x20fired:','user:%s','hangup\x20executed!','answer\x20fired:','webbar:answer','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold','unhold\x20fired:','calls','calls\x20fired:','all','conference','conference\x20fired:','webbar:conference','transfer','transfer\x20fired:','webbar:transfer','transfer\x20executed!'];(function(_0xdcd1e6,_0x155292){var _0x3af9fd=function(_0x27dc29){while(--_0x27dc29){_0xdcd1e6['push'](_0xdcd1e6['shift']());}};_0x3af9fd(++_0x155292);}(_0x34e8,0x12c));var _0x834e=function(_0x4f50b6,_0x26b997){_0x4f50b6=_0x4f50b6-0x0;var _0x23424c=_0x34e8[_0x4f50b6];return _0x23424c;};'use strict';var path=require(_0x834e('0x0'));var fs=require('fs');var _=require(_0x834e('0x1'));var db=require(_0x834e('0x2'))['db'];var config=require(_0x834e('0x3'));var util=require('util');var BPromise=require(_0x834e('0x4'));var jayson=require(_0x834e('0x5'));var amiClient=jayson[_0x834e('0x6')][_0x834e('0x7')]({'port':0x232a});var logger=require(_0x834e('0x8'))(_0x834e('0x9'));var Redis=require(_0x834e('0xa'));config['redis']=_[_0x834e('0xb')](config['redis'],{'host':_0x834e('0xc'),'port':0x18eb});var io=require(_0x834e('0xd'))(new Redis(config[_0x834e('0xe')]));var Schema=require(_0x834e('0xf'));var originateValidation=new Schema({'userId':{'type':_0x834e('0x10'),'required':[!![],_0x834e('0x11')]},'callNumber':{'type':_0x834e('0x12'),'required':[!![],_0x834e('0x13')]},'callerId':{'type':_0x834e('0x12')},'callbackUrl':{'type':_0x834e('0x12')}});var hangupValidation=new Schema({'userId':{'type':_0x834e('0x10'),'required':[!![],_0x834e('0x11')]},'sessionId':{'type':_0x834e('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x834e('0x10'),'required':[!![],_0x834e('0x11')]},'sessionId':{'type':_0x834e('0x12'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x834e('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x834e('0x12'),'required':[!![],_0x834e('0x14')]},'transferNumber':{'type':'string','required':[!![],_0x834e('0x15')]}});var holdValidation=new Schema({'userId':{'type':_0x834e('0x10'),'required':[!![],_0x834e('0x11')]},'sessionId':{'type':_0x834e('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x834e('0x11')]},'sessionId':{'type':_0x834e('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0x834e('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0x834e('0x11')]}});function emit(_0x36d443,_0x478afe,_0x43ac41){logger[_0x834e('0x16')](_0x36d443,_0x478afe,JSON[_0x834e('0x17')](_0x43ac41));io['to'](_0x36d443)['emit'](_0x478afe,_0x43ac41);}function handleError(_0x283e56){return function(_0x211e9a){console[_0x834e('0x18')](_0x834e('0x19'),_0x211e9a,_0x211e9a instanceof RangeError);logger[_0x834e('0x1a')](_0x211e9a[_0x834e('0x1b')]);if(_0x211e9a instanceof RangeError){if(_0x211e9a[_0x834e('0x1c')]){delete _0x211e9a['name'];}_0x283e56[_0x834e('0x1d')](0x194)[_0x834e('0x1e')](_0x211e9a);}else{if(_0x211e9a[_0x834e('0x1c')]){delete _0x211e9a[_0x834e('0x1c')];}_0x283e56['status'](0x1f4)[_0x834e('0x1e')](_0x211e9a);}};}function checkError(){return function(_0x62f8f1){if(!_0x62f8f1){throw new RangeError('NotFound');}return _0x62f8f1;};}function respondWithRpcPromise(_0x1b4bdf,_0x28d687){return new BPromise(function(_0x8d406e,_0x5c55ca){var _0x4e3f48=amiClient;return _0x4e3f48[_0x834e('0x1f')](_0x1b4bdf,_0x28d687)[_0x834e('0x20')](function(_0x589dde){if(_0x589dde[_0x834e('0x1a')]){if(_0x589dde[_0x834e('0x1a')]['code']===0x1f4){return _0x5c55ca(_0x589dde[_0x834e('0x1a')][_0x834e('0x21')]);}return _0x8d406e(_0x589dde[_0x834e('0x1a')]['message']);}else{_0x8d406e(_0x589dde[_0x834e('0x22')]);}})[_0x834e('0x23')](function(_0x5e1cc5){_0x5c55ca(_0x5e1cc5);});});}function getAgent(_0x5bef62){return db[_0x834e('0x24')]['findOne']({'where':{'id':_0x5bef62,'role':_0x834e('0x25')}})[_0x834e('0x20')](checkError());}function getAgentCheckSession(_0x3db026,_0x2cc2eb){return new BPromise(function(_0x3cd928,_0x130cc5){var _0x491919=respondWithRpcPromise('VoiceChannels');var _0x4dc64a=getAgent(_0x3db026);Promise['all']([_0x491919,_0x4dc64a])[_0x834e('0x20')](function(_0x567cea){var _0x106d6a=_0x567cea[0x0];var _0x5dacc1=_0x567cea[0x1];var _0xb5bc06=_[_0x834e('0x26')](_0x106d6a[_0x834e('0x27')],function(_0x1e026a){return _0x1e026a[_0x834e('0x28')]==_0x5dacc1['id']&&_0x1e026a[_0x834e('0x29')]==_0x2cc2eb;});if(_0xb5bc06[_0x834e('0x2a')]==0x1){_0x3cd928(_0x5dacc1);}else{_0x130cc5(new RangeError(_0x834e('0x2b')+_0x2cc2eb+_0x834e('0x2c')));}});});}exports['originate']=function(_0xef9ec2,_0x5cad11){logger[_0x834e('0x16')](_0x834e('0x2d'),_0xef9ec2[_0x834e('0x2e')]);var _0x2b3418=originateValidation[_0x834e('0xf')](_0xef9ec2[_0x834e('0x2e')]);if(_0x2b3418[_0x834e('0x2a')]>0x0){return _0x5cad11[_0x834e('0x1d')](0x190)[_0x834e('0x2f')](_0x2b3418);}var _0x12b2bc=_0xef9ec2['body'][_0x834e('0x30')];var _0x2f408a=_0xef9ec2[_0x834e('0x2e')][_0x834e('0x31')];var _0x595cc0=_0xef9ec2[_0x834e('0x2e')][_0x834e('0x32')];var _0x4b12f5=_0xef9ec2['body']['callbackUrl'];return getAgent(_0x12b2bc)[_0x834e('0x20')](function(_0x41bf4d){logger[_0x834e('0x16')](_0x834e('0x33'),_0x41bf4d[_0x834e('0x1c')]);emit(util[_0x834e('0x34')]('user:%s',_0x41bf4d[_0x834e('0x1c')]),'webbar:originate',{'callNumber':_0x2f408a,'callerId':_0x595cc0,'callbackUrl':_0x4b12f5});return _0x5cad11[_0x834e('0x1d')](0xc8)[_0x834e('0x2f')]({'error':![],'message':'originate\x20executed!'});})[_0x834e('0x23')](handleError(_0x5cad11));};exports[_0x834e('0x35')]=function(_0x491c28,_0x481f70){logger[_0x834e('0x16')](_0x834e('0x36'),_0x491c28[_0x834e('0x2e')]);var _0x130c23=hangupValidation[_0x834e('0xf')](_0x491c28['body']);if(_0x130c23[_0x834e('0x2a')]>0x0){return _0x481f70['status'](0x190)['json'](_0x130c23);}var _0x1b2edf=_0x491c28['body'][_0x834e('0x30')];var _0x1ba66d=_0x491c28[_0x834e('0x2e')][_0x834e('0x29')];return getAgent(_0x1b2edf)[_0x834e('0x20')](function(_0x574ea8){logger[_0x834e('0x16')](_0x834e('0x33'),_0x574ea8[_0x834e('0x1c')]);emit(util['format'](_0x834e('0x37'),_0x574ea8[_0x834e('0x1c')]),'webbar:hangup',{'sessionId':_0x1ba66d});return _0x481f70[_0x834e('0x1d')](0xc8)['json']({'error':![],'message':_0x834e('0x38')});})[_0x834e('0x23')](handleError(_0x481f70));};exports['answer']=function(_0x4a6942,_0x22ea21){logger[_0x834e('0x16')](_0x834e('0x39'),_0x4a6942[_0x834e('0x2e')]);var _0x8ad264=answerValidation[_0x834e('0xf')](_0x4a6942[_0x834e('0x2e')]);if(_0x8ad264['length']>0x0){return _0x22ea21[_0x834e('0x1d')](0x190)['json'](_0x8ad264);}var _0x321efa=_0x4a6942['body'][_0x834e('0x30')];var _0x5a5807=_0x4a6942[_0x834e('0x2e')][_0x834e('0x29')];return getAgent(_0x321efa)['then'](function(_0x39e7b9){logger[_0x834e('0x16')](_0x834e('0x33'),_0x39e7b9[_0x834e('0x1c')]);emit(util[_0x834e('0x34')](_0x834e('0x37'),_0x39e7b9[_0x834e('0x1c')]),_0x834e('0x3a'),{'sessionId':_0x5a5807});return _0x22ea21[_0x834e('0x1d')](0xc8)[_0x834e('0x2f')]({'error':![],'message':'answer\x20executed!'});})[_0x834e('0x23')](handleError(_0x22ea21));};exports[_0x834e('0x3b')]=function(_0x47a8a9,_0x112306){logger[_0x834e('0x16')](_0x834e('0x3c'),_0x47a8a9[_0x834e('0x2e')]);var _0x19b5ef=holdValidation[_0x834e('0xf')](_0x47a8a9['body']);if(_0x19b5ef['length']>0x0){return _0x112306[_0x834e('0x1d')](0x190)[_0x834e('0x2f')](_0x19b5ef);}var _0x30568e=_0x47a8a9[_0x834e('0x2e')][_0x834e('0x30')];var _0xd1d83b=_0x47a8a9[_0x834e('0x2e')][_0x834e('0x29')];return getAgent(_0x30568e)[_0x834e('0x20')](function(_0x390c45){logger[_0x834e('0x16')](_0x834e('0x33'),_0x390c45[_0x834e('0x1c')]);emit(util[_0x834e('0x34')](_0x834e('0x37'),_0x390c45[_0x834e('0x1c')]),_0x834e('0x3d'),{'sessionId':_0xd1d83b});return _0x112306[_0x834e('0x1d')](0xc8)[_0x834e('0x2f')]({'error':![],'message':_0x834e('0x3e')});})['catch'](handleError(_0x112306));};exports[_0x834e('0x3f')]=function(_0x1f08b9,_0x4e73e0){logger[_0x834e('0x16')](_0x834e('0x40'),_0x1f08b9['body']);var _0x3dcca3=unholdValidation[_0x834e('0xf')](_0x1f08b9[_0x834e('0x2e')]);if(_0x3dcca3[_0x834e('0x2a')]>0x0){return _0x4e73e0[_0x834e('0x1d')](0x190)[_0x834e('0x2f')](_0x3dcca3);}var _0x4549ba=_0x1f08b9['body'][_0x834e('0x30')];var _0x8bc6c6=_0x1f08b9[_0x834e('0x2e')][_0x834e('0x29')];return getAgent(_0x4549ba)[_0x834e('0x20')](function(_0x396bbe){logger[_0x834e('0x16')](_0x834e('0x33'),_0x396bbe['name']);emit(util[_0x834e('0x34')]('user:%s',_0x396bbe[_0x834e('0x1c')]),'webbar:unhold',{'sessionId':_0x8bc6c6});return _0x4e73e0[_0x834e('0x1d')](0xc8)['json']({'error':![],'message':'unhold\x20executed!'});})[_0x834e('0x23')](handleError(_0x4e73e0));};exports[_0x834e('0x41')]=function(_0x5291ae,_0x5be43d){logger[_0x834e('0x16')](_0x834e('0x42'),_0x5be43d[_0x834e('0x2e')]);var _0x387365=callsValidation[_0x834e('0xf')](_0x5291ae[_0x834e('0x2e')]);if(_0x387365[_0x834e('0x2a')]>0x0){return _0x5be43d[_0x834e('0x1d')](0x190)['json'](_0x387365);}var _0x142334=_0x5291ae[_0x834e('0x2e')]['userId'];var _0x281342=respondWithRpcPromise('VoiceChannels');var _0x3e58ef=getAgent(_0x142334);return Promise[_0x834e('0x43')]([_0x281342,_0x3e58ef])['then'](function(_0x41ef86){var _0x37ee0e=_0x41ef86[0x0];var _0x2de29a=_0x41ef86[0x1];var _0x25f720=_['filter'](_0x37ee0e[_0x834e('0x27')],function(_0x438f75){return _0x438f75[_0x834e('0x28')]==_0x2de29a['id'];});return _0x5be43d['status'](0xc8)[_0x834e('0x2f')]({'count':_0x25f720[_0x834e('0x2a')],'rows':_0x25f720});})[_0x834e('0x23')](handleError(_0x5be43d));};exports[_0x834e('0x44')]=function(_0x3183c5,_0x125f37){logger[_0x834e('0x16')](_0x834e('0x45'),_0x3183c5[_0x834e('0x2e')]);var _0xfcccd8=conferenceValidation[_0x834e('0xf')](_0x3183c5[_0x834e('0x2e')]);if(_0xfcccd8[_0x834e('0x2a')]>0x0){return _0x125f37[_0x834e('0x1d')](0x190)[_0x834e('0x2f')](_0xfcccd8);}var _0x17b8e3=_0x3183c5[_0x834e('0x2e')][_0x834e('0x30')];return getAgent(_0x17b8e3)[_0x834e('0x20')](function(_0x3e3467){logger[_0x834e('0x16')](_0x834e('0x33'),_0x3e3467['name']);emit(util[_0x834e('0x34')](_0x834e('0x37'),_0x3e3467[_0x834e('0x1c')]),_0x834e('0x46'));return _0x125f37['status'](0xc8)[_0x834e('0x2f')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x125f37));};exports[_0x834e('0x47')]=function(_0x2b1ec7,_0x1644dd){logger[_0x834e('0x16')](_0x834e('0x48'),_0x2b1ec7[_0x834e('0x2e')]);var _0xbb926d=transferValidation[_0x834e('0xf')](_0x2b1ec7['body']);if(_0xbb926d[_0x834e('0x2a')]>0x0){return _0x1644dd['status'](0x190)[_0x834e('0x2f')](_0xbb926d);}var _0xd35dda=_0x2b1ec7['body']['userId'];var _0x4a4def=_0x2b1ec7[_0x834e('0x2e')][_0x834e('0x29')];var _0x2cca07=_0x2b1ec7[_0x834e('0x2e')]['transferNumber'];return getAgent(_0xd35dda)[_0x834e('0x20')](function(_0x15018f){logger[_0x834e('0x16')](_0x834e('0x33'),_0x15018f[_0x834e('0x1c')]);emit(util[_0x834e('0x34')](_0x834e('0x37'),_0x15018f[_0x834e('0x1c')]),_0x834e('0x49'),{'sessionId':_0x4a4def,'transferNumber':_0x2cca07});return _0x1644dd[_0x834e('0x1d')](0xc8)['json']({'error':![],'message':_0x834e('0x4a')});})[_0x834e('0x23')](handleError(_0x1644dd));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index d96cb5f..c277c9e 100644 --- a/server/api/whatsappAccount/index.js +++ b/server/api/whatsappAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x33af=['getAnswers','/:id/users','/:id/applications','post','create','addDisposition','addAgents','addApplications','/:id/notify','/:id/send','send','put','/:id','update','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','show','/:id/dispositions','getDispositions'];(function(_0x494c4f,_0x5c97f5){var _0x117f33=function(_0x277a46){while(--_0x277a46){_0x494c4f['push'](_0x494c4f['shift']());}};_0x117f33(++_0x5c97f5);}(_0x33af,0xec));var _0xf33a=function(_0x590b61,_0x4c4335){_0x590b61=_0x590b61-0x0;var _0x1a14dc=_0x33af[_0x590b61];return _0x1a14dc;};'use strict';var multer=require('multer');var util=require(_0xf33a('0x0'));var path=require('path');var timeout=require(_0xf33a('0x1'));var express=require(_0xf33a('0x2'));var router=express[_0xf33a('0x3')]();var fs_extra=require(_0xf33a('0x4'));var auth=require(_0xf33a('0x5'));var interaction=require(_0xf33a('0x6'));var config=require('../../config/environment');var controller=require(_0xf33a('0x7'));router[_0xf33a('0x8')]('/',auth['isAuthenticated'](),controller[_0xf33a('0x9')]);router[_0xf33a('0x8')](_0xf33a('0xa'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xc')]);router[_0xf33a('0x8')]('/:id',auth[_0xf33a('0xb')](),controller[_0xf33a('0xd')]);router[_0xf33a('0x8')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0xf')]);router['get']('/:id/canned_answers',auth[_0xf33a('0xb')](),controller[_0xf33a('0x10')]);router[_0xf33a('0x8')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller['getAgents']);router[_0xf33a('0x8')](_0xf33a('0x12'),auth['isAuthenticated'](),controller['getApplications']);router[_0xf33a('0x13')]('/',auth[_0xf33a('0xb')](),controller[_0xf33a('0x14')]);router[_0xf33a('0x13')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x15')]);router[_0xf33a('0x13')]('/:id/canned_answers',auth[_0xf33a('0xb')](),controller['addAnswer']);router[_0xf33a('0x13')](_0xf33a('0x11'),auth['isAuthenticated'](),controller[_0xf33a('0x16')]);router[_0xf33a('0x13')]('/:id/applications',auth[_0xf33a('0xb')](),controller[_0xf33a('0x17')]);router[_0xf33a('0x13')](_0xf33a('0x18'),controller['notify']);router[_0xf33a('0x13')](_0xf33a('0x19'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x1a')]);router[_0xf33a('0x1b')](_0xf33a('0x1c'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x1d')]);router[_0xf33a('0x1e')](_0xf33a('0x1c'),auth['isAuthenticated'](),controller[_0xf33a('0x1f')]);router[_0xf33a('0x1e')](_0xf33a('0xe'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x20')]);router['delete'](_0xf33a('0x21'),auth['isAuthenticated'](),controller[_0xf33a('0x22')]);router[_0xf33a('0x1e')](_0xf33a('0x11'),auth[_0xf33a('0xb')](),controller[_0xf33a('0x23')]);module['exports']=router; \ No newline at end of file +var _0xda2d=['/:id','removeDispositions','removeAnswers','/:id/users','removeAgents','exports','util','path','connect-timeout','express','Router','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','post','create','addDisposition','addAnswer','addApplications','/:id/notify','notify','/:id/send','send','put','delete'];(function(_0x313754,_0x147f5e){var _0x5a3f2a=function(_0x28267e){while(--_0x28267e){_0x313754['push'](_0x313754['shift']());}};_0x5a3f2a(++_0x147f5e);}(_0xda2d,0x102));var _0xdda2=function(_0xd4589a,_0x4d1c63){_0xd4589a=_0xd4589a-0x0;var _0xa2b8ee=_0xda2d[_0xd4589a];return _0xa2b8ee;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['get'](_0xdda2('0xd'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xe')]);router[_0xdda2('0x7')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xdda2('0x7')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x12')]);router[_0xdda2('0x13')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x14')]);router['post'](_0xdda2('0xd'),auth['isAuthenticated'](),controller[_0xdda2('0x15')]);router[_0xdda2('0x13')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x16')]);router['post']('/:id/users',auth[_0xdda2('0x8')](),controller['addAgents']);router[_0xdda2('0x13')](_0xdda2('0x11'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x17')]);router[_0xdda2('0x13')](_0xdda2('0x18'),controller[_0xdda2('0x19')]);router[_0xdda2('0x13')](_0xdda2('0x1a'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x1b')]);router[_0xdda2('0x1c')]('/:id',auth[_0xdda2('0x8')](),controller['update']);router[_0xdda2('0x1d')](_0xdda2('0x1e'),auth[_0xdda2('0x8')](),controller['destroy']);router[_0xdda2('0x1d')]('/:id/dispositions',auth[_0xdda2('0x8')](),controller[_0xdda2('0x1f')]);router['delete'](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x20')]);router[_0xdda2('0x1d')](_0xdda2('0x21'),auth['isAuthenticated'](),controller[_0xdda2('0x22')]);module[_0xdda2('0x23')]=router; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.attributes.js b/server/api/whatsappAccount/whatsappAccount.attributes.js index 670fc8e..509d3f7 100644 --- a/server/api/whatsappAccount/whatsappAccount.attributes.js +++ b/server/api/whatsappAccount/whatsappAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x046b=['generate','ENUM','twilio','sinch','TEXT','BOOLEAN','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name'];(function(_0x4382bc,_0x231a2d){var _0x13c82a=function(_0x3723b0){while(--_0x3723b0){_0x4382bc['push'](_0x4382bc['shift']());}};_0x13c82a(++_0x231a2d);}(_0x046b,0x11b));var _0xb046=function(_0x51c699,_0x38d5f4){_0x51c699=_0x51c699-0x0;var _0x418e9f=_0x046b[_0x51c699];return _0x418e9f;};'use strict';var Sequelize=require(_0xb046('0x0'));var rs=require(_0xb046('0x1'));module[_0xb046('0x2')]={'name':{'type':Sequelize[_0xb046('0x3')],'unique':_0xb046('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xb046('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xb046('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xb046('0x5')]();}},'phone':{'type':Sequelize[_0xb046('0x3')]},'type':{'type':Sequelize[_0xb046('0x6')](_0xb046('0x7'),_0xb046('0x8'))},'accountSid':{'type':Sequelize[_0xb046('0x3')]},'baseUrl':{'type':Sequelize[_0xb046('0x3')]},'authToken':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0xb046('0x9')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0xb046('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xb046('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb046('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb046('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb046('0xa')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb046('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb046('0xb')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb046('0xa')],'defaultValue':![],'comment':_0xb046('0xc'),'set':function(_0x3fe806){if(!_0x3fe806){this[_0xb046('0xd')](_0xb046('0xe'),null);}this[_0xb046('0xd')](_0xb046('0xf'),_0x3fe806);}},'description':{'type':Sequelize[_0xb046('0x3')]}}; \ No newline at end of file +var _0x43b2=['BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','STRING','name','generate','ENUM','twilio','INTEGER'];(function(_0x4e9ebf,_0x349fc1){var _0x9f7e65=function(_0x2a1ea4){while(--_0x2a1ea4){_0x4e9ebf['push'](_0x4e9ebf['shift']());}};_0x9f7e65(++_0x349fc1);}(_0x43b2,0x1a6));var _0x243b=function(_0x55ceb7,_0x9c967){_0x55ceb7=_0x55ceb7-0x0;var _0x383ee8=_0x43b2[_0x55ceb7];return _0x383ee8;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x243b('0x0'));module['exports']={'name':{'type':Sequelize[_0x243b('0x1')],'unique':_0x243b('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0x243b('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0x243b('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0x243b('0x1')],'defaultValue':function(){return rs[_0x243b('0x3')]();}},'phone':{'type':Sequelize[_0x243b('0x1')]},'type':{'type':Sequelize[_0x243b('0x4')](_0x243b('0x5'),'sinch')},'accountSid':{'type':Sequelize[_0x243b('0x1')]},'baseUrl':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x243b('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x243b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x243b('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x243b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x243b('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x243b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x243b('0x6')],'comment':_0x243b('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x243b('0x7')],'defaultValue':![],'comment':_0x243b('0x9'),'set':function(_0x3faf73){if(!_0x3faf73){this[_0x243b('0xa')](_0x243b('0xb'),null);}this[_0x243b('0xa')](_0x243b('0xc'),_0x3faf73);}},'description':{'type':Sequelize[_0x243b('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index 0e561e8..a86dcc5 100644 --- a/server/api/whatsappAccount/whatsappAccount.controller.js +++ b/server/api/whatsappAccount/whatsappAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca97=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','socket.io-emitter','register','jayson/promise','client','http','request','then','info','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappAccount,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','json','offset','limit','undefined','count','set','apply','reject','save','update','WhatsappAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','filters','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','addDisposition','WhatsappAccountId','getDispositions','findOne','length','filter','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','User','getAgents','addApplications','sequelize','transaction','Transaction','READ_COMMITTED','bulkCreate','priority','finally','getApplications','WhatsappApplication','notify','whatsapp','Applications','account','sinch','statuses','state','read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','ListId','twilio','from','whatsapp:','Body','messageId','notifications','isNil','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','DESC','list','Contacts','WhatsappInteraction','spread','interaction','push','unmanaged','*,*,*,*','created','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','to-csv'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0xca97,0xb6));var _0x7ca9=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xca97[_0x31e29a];return _0x32d892;};'use strict';var emlformat=require(_0x7ca9('0x0'));var rimraf=require(_0x7ca9('0x1'));var zipdir=require(_0x7ca9('0x2'));var jsonpatch=require(_0x7ca9('0x3'));var rp=require('request-promise');var moment=require(_0x7ca9('0x4'));var BPromise=require(_0x7ca9('0x5'));var Mustache=require(_0x7ca9('0x6'));var util=require(_0x7ca9('0x7'));var path=require('path');var sox=require(_0x7ca9('0x8'));var csv=require('to-csv');var ejs=require(_0x7ca9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7ca9('0xa'));var squel=require(_0x7ca9('0xb'));var crypto=require('crypto');var jsforce=require(_0x7ca9('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x7ca9('0xd'));var querystring=require(_0x7ca9('0xe'));var Papa=require(_0x7ca9('0xf'));var Redis=require(_0x7ca9('0x10'));var authService=require(_0x7ca9('0x11'));var qs=require(_0x7ca9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ca9('0x13'));var logger=require(_0x7ca9('0x14'))(_0x7ca9('0x15'));var utils=require(_0x7ca9('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x7ca9('0x17')]=_[_0x7ca9('0x18')](config[_0x7ca9('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x7ca9('0x19'))(new Redis(config[_0x7ca9('0x17')]));require('./whatsappAccount.socket')[_0x7ca9('0x1a')](socket);var jayson=require(_0x7ca9('0x1b'));var client=jayson[_0x7ca9('0x1c')][_0x7ca9('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x15776d,_0x2a50e7,_0x1ff6b1,_0x47aa4c){return new BPromise(function(_0x2a94b0,_0x2116e9){var _0x109b6b=_0x47aa4c||client;return _0x109b6b[_0x7ca9('0x1e')](_0x15776d,_0x1ff6b1)[_0x7ca9('0x1f')](function(_0x46065f){logger[_0x7ca9('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x2a50e7,'request\x20sent');logger[_0x7ca9('0x21')](_0x7ca9('0x22'),_0x2a50e7,_0x7ca9('0x23'),JSON[_0x7ca9('0x24')](_0x46065f));if(_0x46065f[_0x7ca9('0x25')]){if(_0x46065f[_0x7ca9('0x25')][_0x7ca9('0x26')]===0x1f4){logger['error'](_0x7ca9('0x27'),_0x2a50e7,_0x46065f[_0x7ca9('0x25')]['message']);return _0x2116e9(_0x46065f[_0x7ca9('0x25')][_0x7ca9('0x28')]);}logger['error'](_0x7ca9('0x27'),_0x2a50e7,_0x46065f[_0x7ca9('0x25')][_0x7ca9('0x28')]);return _0x2a94b0(_0x46065f[_0x7ca9('0x25')][_0x7ca9('0x28')]);}else{logger[_0x7ca9('0x20')]('WhatsappAccount,\x20%s,\x20%s',_0x2a50e7,'request\x20sent');_0x2a94b0(_0x46065f[_0x7ca9('0x29')][_0x7ca9('0x28')]);}})[_0x7ca9('0x2a')](function(_0x1cc852){logger[_0x7ca9('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x2a50e7,_0x1cc852);_0x2116e9(_0x1cc852);});});}function respondWithStatusCode(_0x4bdbcb,_0x2204fa){_0x2204fa=_0x2204fa||0xcc;return function(_0x36c9a9){if(_0x36c9a9){return _0x4bdbcb[_0x7ca9('0x2b')](_0x2204fa);}return _0x4bdbcb['status'](_0x2204fa)[_0x7ca9('0x2c')]();};}function respondWithResult(_0x268691,_0x35ddff){_0x35ddff=_0x35ddff||0xc8;return function(_0x4ef040){if(_0x4ef040){return _0x268691[_0x7ca9('0x2d')](_0x35ddff)[_0x7ca9('0x2e')](_0x4ef040);}};}function respondWithFilteredResult(_0x46107f,_0xaa395c){return function(_0x175a55){if(_0x175a55){var _0x1ff4ac=typeof _0xaa395c[_0x7ca9('0x2f')]==='undefined'&&typeof _0xaa395c[_0x7ca9('0x30')]===_0x7ca9('0x31');var _0xfb1fb0=_0x175a55[_0x7ca9('0x32')];var _0x2ad130=_0x1ff4ac?0x0:_0xaa395c['offset'];var _0x5e6912=_0x1ff4ac?_0x175a55['count']:_0xaa395c['offset']+_0xaa395c[_0x7ca9('0x30')];var _0x394e7f;if(_0x5e6912>=_0xfb1fb0){_0x5e6912=_0xfb1fb0;_0x394e7f=0xc8;}else{_0x394e7f=0xce;}_0x46107f[_0x7ca9('0x2d')](_0x394e7f);return _0x46107f[_0x7ca9('0x33')]('Content-Range',_0x2ad130+'-'+_0x5e6912+'/'+_0xfb1fb0)[_0x7ca9('0x2e')](_0x175a55);}return null;};}function patchUpdates(_0x17361e){return function(_0x5b6a4a){try{jsonpatch[_0x7ca9('0x34')](_0x5b6a4a,_0x17361e,!![]);}catch(_0x5cb73f){return BPromise[_0x7ca9('0x35')](_0x5cb73f);}return _0x5b6a4a[_0x7ca9('0x36')]();};}function saveUpdates(_0x5080dc,_0x57d954){return function(_0x33c617){if(_0x33c617){return _0x33c617[_0x7ca9('0x37')](_0x5080dc)[_0x7ca9('0x1f')](function(_0x5cc1b1){return _0x5cc1b1;});}return null;};}function removeEntity(_0xd2b101,_0x396419){return function(_0x446785){if(_0x446785){return _0x446785['destroy']()['then'](function(){var _0x152279=_0x446785['get']({'plain':!![]});var _0x5b9b54=_0x7ca9('0x38');return db[_0x7ca9('0x39')][_0x7ca9('0x3a')]({'where':{'type':_0x5b9b54,'resourceId':_0x152279['id']}})[_0x7ca9('0x1f')](function(){return _0x446785;});})[_0x7ca9('0x1f')](function(){_0xd2b101[_0x7ca9('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44cd60,_0x3f55cd){return function(_0x5077c9){if(!_0x5077c9){_0x44cd60[_0x7ca9('0x2b')](0x194);}return _0x5077c9;};}function handleError(_0x323208,_0x214974){_0x214974=_0x214974||0x1f4;return function(_0x31a162){logger['error'](_0x31a162[_0x7ca9('0x3b')]);if(_0x31a162[_0x7ca9('0x3c')]){delete _0x31a162[_0x7ca9('0x3c')];}_0x323208[_0x7ca9('0x2d')](_0x214974)[_0x7ca9('0x3d')](_0x31a162);};}exports[_0x7ca9('0x3e')]=function(_0x49b365,_0x148b88){var _0x45d151={'include':[{'model':db[_0x7ca9('0x3f')],'as':_0x7ca9('0x40')}]},_0x5c358a={},_0x32a13a={'count':0x0,'rows':[]};var _0x2cc1ff=_[_0x7ca9('0x41')](db[_0x7ca9('0x42')][_0x7ca9('0x43')],function(_0x1f77b3){return{'name':_0x1f77b3[_0x7ca9('0x44')],'type':_0x1f77b3[_0x7ca9('0x45')]['key']};});_0x5c358a[_0x7ca9('0x46')]=_[_0x7ca9('0x41')](_0x2cc1ff,_0x7ca9('0x3c'));_0x5c358a[_0x7ca9('0x47')]=_[_0x7ca9('0x48')](_0x49b365[_0x7ca9('0x47')]);_0x5c358a['filters']=_['intersection'](_0x5c358a[_0x7ca9('0x46')],_0x5c358a[_0x7ca9('0x47')]);_0x45d151[_0x7ca9('0x49')]=_[_0x7ca9('0x4a')](_0x5c358a[_0x7ca9('0x46')],qs[_0x7ca9('0x4b')](_0x49b365[_0x7ca9('0x47')][_0x7ca9('0x4b')]));_0x45d151['attributes']=_0x45d151[_0x7ca9('0x49')]['length']?_0x45d151[_0x7ca9('0x49')]:_0x5c358a[_0x7ca9('0x46')];if(!_0x49b365[_0x7ca9('0x47')][_0x7ca9('0x4c')](_0x7ca9('0x4d'))){_0x45d151[_0x7ca9('0x30')]=qs[_0x7ca9('0x30')](_0x49b365[_0x7ca9('0x47')][_0x7ca9('0x30')]);_0x45d151['offset']=qs[_0x7ca9('0x2f')](_0x49b365[_0x7ca9('0x47')][_0x7ca9('0x2f')]);}_0x45d151[_0x7ca9('0x4e')]=qs[_0x7ca9('0x4f')](_0x49b365[_0x7ca9('0x47')][_0x7ca9('0x4f')]);_0x45d151[_0x7ca9('0x50')]=qs['filters'](_[_0x7ca9('0x51')](_0x49b365[_0x7ca9('0x47')],_0x5c358a['filters']),_0x2cc1ff);if(_0x49b365[_0x7ca9('0x47')]['filter']){_0x45d151[_0x7ca9('0x50')]=_[_0x7ca9('0x52')](_0x45d151['where'],{'$or':_[_0x7ca9('0x41')](_0x2cc1ff,function(_0x1b4f19){if(_0x1b4f19['type']!==_0x7ca9('0x53')){var _0x1e9e21={};_0x1e9e21[_0x1b4f19[_0x7ca9('0x3c')]]={'$like':'%'+_0x49b365[_0x7ca9('0x47')]['filter']+'%'};return _0x1e9e21;}})});}_0x45d151=_[_0x7ca9('0x52')]({},_0x45d151,_0x49b365[_0x7ca9('0x54')]);var _0x423dfb={'where':_0x45d151['where']};return db['WhatsappAccount'][_0x7ca9('0x32')](_0x423dfb)['then'](function(_0x2c76b4){_0x32a13a[_0x7ca9('0x32')]=_0x2c76b4;if(_0x49b365[_0x7ca9('0x47')][_0x7ca9('0x55')]){_0x45d151[_0x7ca9('0x56')]=[{'all':!![]}];}return db[_0x7ca9('0x42')][_0x7ca9('0x57')](_0x45d151);})[_0x7ca9('0x1f')](function(_0x59c03a){_0x32a13a[_0x7ca9('0x58')]=_0x59c03a;return _0x32a13a;})[_0x7ca9('0x1f')](respondWithFilteredResult(_0x148b88,_0x45d151))[_0x7ca9('0x2a')](handleError(_0x148b88,null));};exports['show']=function(_0x556d20,_0x2d7bd1){var _0x26b106={'raw':![],'where':{'id':_0x556d20['params']['id']},'include':[{'model':db[_0x7ca9('0x3f')],'as':'mandatoryDispositionPause'}]},_0x33ec40={};_0x33ec40[_0x7ca9('0x46')]=_[_0x7ca9('0x48')](db[_0x7ca9('0x42')][_0x7ca9('0x43')]);_0x33ec40[_0x7ca9('0x47')]=_[_0x7ca9('0x48')](_0x556d20[_0x7ca9('0x47')]);_0x33ec40[_0x7ca9('0x59')]=_[_0x7ca9('0x4a')](_0x33ec40['model'],_0x33ec40[_0x7ca9('0x47')]);_0x26b106[_0x7ca9('0x49')]=_[_0x7ca9('0x4a')](_0x33ec40[_0x7ca9('0x46')],qs[_0x7ca9('0x4b')](_0x556d20['query'][_0x7ca9('0x4b')]));_0x26b106[_0x7ca9('0x49')]=_0x26b106[_0x7ca9('0x49')]['length']?_0x26b106['attributes']:_0x33ec40[_0x7ca9('0x46')];if(_0x556d20[_0x7ca9('0x47')]['includeAll']){_0x26b106[_0x7ca9('0x56')]=[{'all':!![]}];}_0x26b106=_[_0x7ca9('0x52')]({},_0x26b106,_0x556d20[_0x7ca9('0x54')]);return db[_0x7ca9('0x42')][_0x7ca9('0x5a')](_0x26b106)[_0x7ca9('0x1f')](handleEntityNotFound(_0x2d7bd1,null))[_0x7ca9('0x1f')](respondWithResult(_0x2d7bd1,null))[_0x7ca9('0x2a')](handleError(_0x2d7bd1,null));};exports[_0x7ca9('0x5b')]=function(_0xdf7bc1,_0x1db66d){return db['WhatsappAccount'][_0x7ca9('0x5b')](_0xdf7bc1['body'],{})[_0x7ca9('0x1f')](function(_0x3f24d8){var _0x41f9a2=_0xdf7bc1['user'][_0x7ca9('0x5c')]({'plain':!![]});if(!_0x41f9a2)throw new Error(_0x7ca9('0x5d'));if(_0x41f9a2[_0x7ca9('0x5e')]===_0x7ca9('0x5f')){var _0x50ca53=_0x3f24d8[_0x7ca9('0x5c')]({'plain':!![]});var _0x381a6b=_0x7ca9('0x38');return db[_0x7ca9('0x60')][_0x7ca9('0x5a')]({'where':{'name':_0x381a6b,'userProfileId':_0x41f9a2['userProfileId']},'raw':!![]})[_0x7ca9('0x1f')](function(_0x5efc6b){if(_0x5efc6b&&_0x5efc6b[_0x7ca9('0x61')]===0x0){return db[_0x7ca9('0x39')]['create']({'name':_0x50ca53[_0x7ca9('0x3c')],'resourceId':_0x50ca53['id'],'type':_0x5efc6b['name'],'sectionId':_0x5efc6b['id']},{})['then'](function(){return _0x3f24d8;});}else{return _0x3f24d8;}})[_0x7ca9('0x2a')](function(_0x5b5491){logger[_0x7ca9('0x25')](_0x7ca9('0x62'),_0x5b5491);throw _0x5b5491;});}return _0x3f24d8;})[_0x7ca9('0x1f')](respondWithResult(_0x1db66d,0xc9))[_0x7ca9('0x2a')](handleError(_0x1db66d,null));};exports['update']=function(_0x5ef30e,_0x586f65){if(_0x5ef30e[_0x7ca9('0x63')]['id']){delete _0x5ef30e[_0x7ca9('0x63')]['id'];}return db[_0x7ca9('0x42')][_0x7ca9('0x5a')]({'where':{'id':_0x5ef30e[_0x7ca9('0x64')]['id']},'include':[{'model':db[_0x7ca9('0x3f')],'as':_0x7ca9('0x40')}]})[_0x7ca9('0x1f')](handleEntityNotFound(_0x586f65,null))[_0x7ca9('0x1f')](saveUpdates(_0x5ef30e[_0x7ca9('0x63')],null))[_0x7ca9('0x1f')](respondWithResult(_0x586f65,null))['catch'](handleError(_0x586f65,null));};exports[_0x7ca9('0x3a')]=function(_0x57466e,_0x1897e1){return db[_0x7ca9('0x42')][_0x7ca9('0x5a')]({'where':{'id':_0x57466e[_0x7ca9('0x64')]['id']}})['then'](handleEntityNotFound(_0x1897e1,null))[_0x7ca9('0x1f')](removeEntity(_0x1897e1,null))['catch'](handleError(_0x1897e1,null));};exports[_0x7ca9('0x65')]=function(_0x7d3e66,_0x247e87){return db['WhatsappAccount'][_0x7ca9('0x65')]()[_0x7ca9('0x1f')](respondWithResult(_0x247e87,null))[_0x7ca9('0x2a')](handleError(_0x247e87,null));};exports[_0x7ca9('0x66')]=function(_0x1192af,_0x21683a,_0x43b0a4){if(_0x1192af[_0x7ca9('0x63')]['id']){delete _0x1192af[_0x7ca9('0x63')]['id'];}return db[_0x7ca9('0x42')][_0x7ca9('0x5a')]({'where':{'id':_0x1192af[_0x7ca9('0x64')]['id']}})[_0x7ca9('0x1f')](handleEntityNotFound(_0x21683a,null))[_0x7ca9('0x1f')](function(_0x474453){if(_0x474453){_0x1192af[_0x7ca9('0x63')][_0x7ca9('0x67')]=_0x474453['id'];return db['Disposition'][_0x7ca9('0x5b')](_0x1192af['body']);}})[_0x7ca9('0x1f')](respondWithResult(_0x21683a,null))[_0x7ca9('0x2a')](handleError(_0x21683a,null));};exports[_0x7ca9('0x68')]=function(_0x181447,_0x5e0477,_0x149a76){var _0x584481={'raw':![],'where':{}};var _0xcab269={};var _0x1a89ca={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0x7ca9('0x69')]({'where':{'id':_0x181447[_0x7ca9('0x64')]['id']}})[_0x7ca9('0x1f')](handleEntityNotFound(_0x5e0477,null))[_0x7ca9('0x1f')](function(_0x577215){if(_0x577215){_0xcab269[_0x7ca9('0x46')]=_[_0x7ca9('0x48')](db['Disposition'][_0x7ca9('0x43')]);_0xcab269['query']=_[_0x7ca9('0x48')](_0x181447['query']);_0xcab269[_0x7ca9('0x59')]=_[_0x7ca9('0x4a')](_0xcab269['model'],_0xcab269[_0x7ca9('0x47')]);_0x584481[_0x7ca9('0x49')]=_[_0x7ca9('0x4a')](_0xcab269[_0x7ca9('0x46')],qs['fields'](_0x181447[_0x7ca9('0x47')][_0x7ca9('0x4b')]));_0x584481[_0x7ca9('0x49')]=_0x584481[_0x7ca9('0x49')][_0x7ca9('0x6a')]?_0x584481[_0x7ca9('0x49')]:_0xcab269[_0x7ca9('0x46')];if(!_0x181447[_0x7ca9('0x47')][_0x7ca9('0x4c')](_0x7ca9('0x4d'))){_0x584481[_0x7ca9('0x30')]=qs['limit'](_0x181447[_0x7ca9('0x47')][_0x7ca9('0x30')]);_0x584481[_0x7ca9('0x2f')]=qs['offset'](_0x181447[_0x7ca9('0x47')][_0x7ca9('0x2f')]);}_0x584481[_0x7ca9('0x4e')]=qs[_0x7ca9('0x4f')](_0x181447[_0x7ca9('0x47')][_0x7ca9('0x4f')]);_0x584481['where']=qs[_0x7ca9('0x59')](_['pick'](_0x181447['query'],_0xcab269[_0x7ca9('0x59')]));_0x584481['where']['WhatsappAccountId']=_0x577215['id'];if(_0x181447[_0x7ca9('0x47')][_0x7ca9('0x6b')]){_0x584481[_0x7ca9('0x50')]=_[_0x7ca9('0x52')](_0x584481[_0x7ca9('0x50')],{'$or':_[_0x7ca9('0x41')](_0x584481[_0x7ca9('0x49')],function(_0x417640){var _0xfddd13={};_0xfddd13[_0x417640]={'$like':'%'+_0x181447[_0x7ca9('0x47')][_0x7ca9('0x6b')]+'%'};return _0xfddd13;})});}_0x584481=_[_0x7ca9('0x52')]({},_0x584481,_0x181447['options']);return db[_0x7ca9('0x6c')][_0x7ca9('0x32')]({'where':_0x584481[_0x7ca9('0x50')]})[_0x7ca9('0x1f')](function(_0x3d1ab4){_0x1a89ca[_0x7ca9('0x32')]=_0x3d1ab4;if(_0x181447[_0x7ca9('0x47')][_0x7ca9('0x55')]){_0x584481['include']=[{'all':!![]}];}return db[_0x7ca9('0x6c')][_0x7ca9('0x57')](_0x584481);})[_0x7ca9('0x1f')](function(_0x41f20b){_0x1a89ca[_0x7ca9('0x58')]=_0x41f20b;return _0x1a89ca;});}})[_0x7ca9('0x1f')](respondWithFilteredResult(_0x5e0477,_0x584481))[_0x7ca9('0x2a')](handleError(_0x5e0477,null));};exports[_0x7ca9('0x6d')]=function(_0x3fca75,_0x5260b1,_0x23b91c){return db[_0x7ca9('0x42')]['find']({'where':{'id':_0x3fca75['params']['id']}})[_0x7ca9('0x1f')](handleEntityNotFound(_0x5260b1,null))['then'](function(_0x3101f3){if(_0x3101f3){return _0x3101f3[_0x7ca9('0x6d')](_0x3fca75[_0x7ca9('0x47')]['ids']);}})[_0x7ca9('0x1f')](respondWithStatusCode(_0x5260b1,null))[_0x7ca9('0x2a')](handleError(_0x5260b1,null));};exports[_0x7ca9('0x6e')]=function(_0x599538,_0x51ac4d,_0x1e3aeb){if(_0x599538[_0x7ca9('0x63')]['id']){delete _0x599538[_0x7ca9('0x63')]['id'];}return db['WhatsappAccount'][_0x7ca9('0x5a')]({'where':{'id':_0x599538[_0x7ca9('0x64')]['id']}})[_0x7ca9('0x1f')](handleEntityNotFound(_0x51ac4d,null))[_0x7ca9('0x1f')](function(_0x59b90f){if(_0x59b90f){_0x599538[_0x7ca9('0x63')]['WhatsappAccountId']=_0x59b90f['id'];return db[_0x7ca9('0x6f')]['create'](_0x599538[_0x7ca9('0x63')]);}})[_0x7ca9('0x1f')](respondWithResult(_0x51ac4d,null))[_0x7ca9('0x2a')](handleError(_0x51ac4d,null));};exports[_0x7ca9('0x70')]=function(_0x333745,_0x360e01,_0x416b2a){var _0x3724c6={'raw':![],'where':{}};var _0x4bbb2c={};var _0x4b06f1={'count':0x0,'rows':[]};return db[_0x7ca9('0x42')][_0x7ca9('0x69')]({'where':{'id':_0x333745[_0x7ca9('0x64')]['id']}})['then'](handleEntityNotFound(_0x360e01,null))[_0x7ca9('0x1f')](function(_0x3726ab){if(_0x3726ab){_0x4bbb2c[_0x7ca9('0x46')]=_[_0x7ca9('0x48')](db[_0x7ca9('0x6f')]['rawAttributes']);_0x4bbb2c[_0x7ca9('0x47')]=_[_0x7ca9('0x48')](_0x333745[_0x7ca9('0x47')]);_0x4bbb2c[_0x7ca9('0x59')]=_['intersection'](_0x4bbb2c[_0x7ca9('0x46')],_0x4bbb2c[_0x7ca9('0x47')]);_0x3724c6[_0x7ca9('0x49')]=_[_0x7ca9('0x4a')](_0x4bbb2c['model'],qs[_0x7ca9('0x4b')](_0x333745[_0x7ca9('0x47')][_0x7ca9('0x4b')]));_0x3724c6[_0x7ca9('0x49')]=_0x3724c6['attributes'][_0x7ca9('0x6a')]?_0x3724c6[_0x7ca9('0x49')]:_0x4bbb2c[_0x7ca9('0x46')];if(!_0x333745[_0x7ca9('0x47')]['hasOwnProperty'](_0x7ca9('0x4d'))){_0x3724c6[_0x7ca9('0x30')]=qs[_0x7ca9('0x30')](_0x333745[_0x7ca9('0x47')][_0x7ca9('0x30')]);_0x3724c6[_0x7ca9('0x2f')]=qs[_0x7ca9('0x2f')](_0x333745['query'][_0x7ca9('0x2f')]);}_0x3724c6['order']=qs['sort'](_0x333745[_0x7ca9('0x47')][_0x7ca9('0x4f')]);_0x3724c6[_0x7ca9('0x50')]=qs['filters'](_['pick'](_0x333745[_0x7ca9('0x47')],_0x4bbb2c[_0x7ca9('0x59')]));_0x3724c6[_0x7ca9('0x50')][_0x7ca9('0x67')]=_0x3726ab['id'];if(_0x333745[_0x7ca9('0x47')][_0x7ca9('0x6b')]){_0x3724c6[_0x7ca9('0x50')]=_[_0x7ca9('0x52')](_0x3724c6[_0x7ca9('0x50')],{'$or':_[_0x7ca9('0x41')](_0x3724c6[_0x7ca9('0x49')],function(_0x5dc313){var _0x277bed={};_0x277bed[_0x5dc313]={'$like':'%'+_0x333745['query'][_0x7ca9('0x6b')]+'%'};return _0x277bed;})});}_0x3724c6=_['merge']({},_0x3724c6,_0x333745[_0x7ca9('0x54')]);return db['CannedAnswer'][_0x7ca9('0x32')]({'where':_0x3724c6['where']})[_0x7ca9('0x1f')](function(_0x144082){_0x4b06f1[_0x7ca9('0x32')]=_0x144082;if(_0x333745['query']['includeAll']){_0x3724c6[_0x7ca9('0x56')]=[{'all':!![]}];}return db[_0x7ca9('0x6f')]['findAll'](_0x3724c6);})[_0x7ca9('0x1f')](function(_0x285660){_0x4b06f1[_0x7ca9('0x58')]=_0x285660;return _0x4b06f1;});}})[_0x7ca9('0x1f')](respondWithFilteredResult(_0x360e01,_0x3724c6))[_0x7ca9('0x2a')](handleError(_0x360e01,null));};exports[_0x7ca9('0x71')]=function(_0x49df1d,_0x3f256c,_0x459328){return db['WhatsappAccount'][_0x7ca9('0x5a')]({'where':{'id':_0x49df1d[_0x7ca9('0x64')]['id']}})['then'](handleEntityNotFound(_0x3f256c,null))[_0x7ca9('0x1f')](function(_0x949007){if(_0x949007){return _0x949007['removeAnswers'](_0x49df1d[_0x7ca9('0x47')][_0x7ca9('0x72')]);}})[_0x7ca9('0x1f')](respondWithStatusCode(_0x3f256c,null))[_0x7ca9('0x2a')](handleError(_0x3f256c,null));};exports['addAgents']=function(_0x1275a4,_0x2ee2cd,_0x1a9646){return db[_0x7ca9('0x42')][_0x7ca9('0x5a')]({'where':{'id':_0x1275a4[_0x7ca9('0x64')]['id']}})[_0x7ca9('0x1f')](handleEntityNotFound(_0x2ee2cd,null))[_0x7ca9('0x1f')](function(_0x394e59){if(_0x394e59){return _0x394e59[_0x7ca9('0x73')](_0x1275a4['body'][_0x7ca9('0x72')],_[_0x7ca9('0x74')](_0x1275a4[_0x7ca9('0x63')],[_0x7ca9('0x72'),'id'])||{})['spread'](function(_0x21dbac){for(var _0x2c7a6f=0x0;_0x2c7a6f<_0x1275a4[_0x7ca9('0x63')][_0x7ca9('0x72')][_0x7ca9('0x6a')];_0x2c7a6f+=0x1){socket[_0x7ca9('0x75')](_0x7ca9('0x76'),{'UserId':Number(_0x1275a4['body'][_0x7ca9('0x72')][_0x2c7a6f]),'WhatsappAccountId':Number(_0x1275a4['params']['id'])});}return _0x21dbac;});}})[_0x7ca9('0x1f')](respondWithResult(_0x2ee2cd,null))[_0x7ca9('0x2a')](handleError(_0x2ee2cd,null));};exports[_0x7ca9('0x77')]=function(_0x19fd63,_0x26b3c7,_0x45dae3){return db[_0x7ca9('0x42')][_0x7ca9('0x5a')]({'where':{'id':_0x19fd63[_0x7ca9('0x64')]['id']}})[_0x7ca9('0x1f')](handleEntityNotFound(_0x26b3c7,null))[_0x7ca9('0x1f')](function(_0x4a14a0){if(_0x4a14a0){return _0x4a14a0[_0x7ca9('0x77')](_0x19fd63[_0x7ca9('0x47')][_0x7ca9('0x72')])['then'](function(){if(_[_0x7ca9('0x78')](_0x19fd63[_0x7ca9('0x47')][_0x7ca9('0x72')])){for(var _0x24ff1a=0x0;_0x24ff1a<_0x19fd63[_0x7ca9('0x47')][_0x7ca9('0x72')][_0x7ca9('0x6a')];_0x24ff1a+=0x1){socket[_0x7ca9('0x75')]('userWhatsappAccount:remove',{'UserId':Number(_0x19fd63['query']['ids'][_0x24ff1a]),'WhatsappAccountId':Number(_0x19fd63[_0x7ca9('0x64')]['id'])});}}else{socket[_0x7ca9('0x75')](_0x7ca9('0x79'),{'UserId':Number(_0x19fd63[_0x7ca9('0x47')][_0x7ca9('0x72')]),'WhatsappAccountId':Number(_0x19fd63[_0x7ca9('0x64')]['id'])});}});}})[_0x7ca9('0x1f')](respondWithStatusCode(_0x26b3c7,null))[_0x7ca9('0x2a')](handleError(_0x26b3c7,null));};exports['getAgents']=function(_0x132e07,_0x2e8af1,_0x36ac17){var _0x6fda05={};var _0x219ffe={};var _0x2f6375;var _0x444893;return db[_0x7ca9('0x42')]['findOne']({'where':{'id':_0x132e07[_0x7ca9('0x64')]['id']}})[_0x7ca9('0x1f')](handleEntityNotFound(_0x2e8af1,null))['then'](function(_0x590330){if(_0x590330){_0x2f6375=_0x590330;_0x219ffe[_0x7ca9('0x46')]=_[_0x7ca9('0x48')](db[_0x7ca9('0x7a')][_0x7ca9('0x43')]);_0x219ffe[_0x7ca9('0x47')]=_['keys'](_0x132e07[_0x7ca9('0x47')]);_0x219ffe['filters']=_[_0x7ca9('0x4a')](_0x219ffe[_0x7ca9('0x46')],_0x219ffe[_0x7ca9('0x47')]);_0x6fda05['attributes']=_['intersection'](_0x219ffe['model'],qs['fields'](_0x132e07['query'][_0x7ca9('0x4b')]));_0x6fda05['attributes']=_0x6fda05[_0x7ca9('0x49')]['length']?_0x6fda05[_0x7ca9('0x49')]:_0x219ffe[_0x7ca9('0x46')];_0x6fda05['order']=qs[_0x7ca9('0x4f')](_0x132e07[_0x7ca9('0x47')][_0x7ca9('0x4f')]);_0x6fda05[_0x7ca9('0x50')]=qs[_0x7ca9('0x59')](_[_0x7ca9('0x51')](_0x132e07[_0x7ca9('0x47')],_0x219ffe['filters']));if(_0x132e07[_0x7ca9('0x47')]['filter']){_0x6fda05[_0x7ca9('0x50')]=_['merge'](_0x6fda05[_0x7ca9('0x50')],{'$or':_[_0x7ca9('0x41')](_0x6fda05[_0x7ca9('0x49')],function(_0x566eb7){var _0x4b3db3={};_0x4b3db3[_0x566eb7]={'$like':'%'+_0x132e07[_0x7ca9('0x47')][_0x7ca9('0x6b')]+'%'};return _0x4b3db3;})});}_0x6fda05=_[_0x7ca9('0x52')]({},_0x6fda05,_0x132e07[_0x7ca9('0x54')]);return _0x2f6375[_0x7ca9('0x7b')](_0x6fda05);}})[_0x7ca9('0x1f')](function(_0x534ccd){if(_0x534ccd){_0x444893=_0x534ccd['length'];if(!_0x132e07[_0x7ca9('0x47')]['hasOwnProperty']('nolimit')){_0x6fda05[_0x7ca9('0x30')]=qs[_0x7ca9('0x30')](_0x132e07[_0x7ca9('0x47')][_0x7ca9('0x30')]);_0x6fda05[_0x7ca9('0x2f')]=qs[_0x7ca9('0x2f')](_0x132e07[_0x7ca9('0x47')]['offset']);}return _0x2f6375[_0x7ca9('0x7b')](_0x6fda05);}})[_0x7ca9('0x1f')](function(_0x2c9f86){if(_0x2c9f86){return _0x2c9f86?{'count':_0x444893,'rows':_0x2c9f86}:null;}})[_0x7ca9('0x1f')](respondWithResult(_0x2e8af1,null))[_0x7ca9('0x2a')](handleError(_0x2e8af1,null));};exports[_0x7ca9('0x7c')]=function(_0x49ac9a,_0x29df39){var _0xcec97c=_0x49ac9a[_0x7ca9('0x64')]['id'];var _0x155abb=_0x49ac9a[_0x7ca9('0x63')];var _0x56ffef=0xc8;var _0x3978ef=null;return db[_0x7ca9('0x7d')][_0x7ca9('0x7e')]({'isolationLevel':db[_0x7ca9('0x7d')][_0x7ca9('0x7f')]['ISOLATION_LEVELS'][_0x7ca9('0x80')]},function(_0x68a19b){return db[_0x7ca9('0x42')][_0x7ca9('0x69')]({'where':{'id':_0xcec97c},'transaction':_0x68a19b})[_0x7ca9('0x1f')](function(_0x543648){if(_0x543648){return db['WhatsappApplication'][_0x7ca9('0x3a')]({'where':{'WhatsappAccountId':_0xcec97c},'transaction':_0x68a19b})[_0x7ca9('0x1f')](function(){var _0x55b3ea=_['map'](_0x155abb,function(_0x550f9c){_0x550f9c['WhatsappAccountId']=_0xcec97c;return _0x550f9c;});return db['WhatsappApplication'][_0x7ca9('0x81')](_0x55b3ea,{'transaction':_0x68a19b});});}else{_0x56ffef=0x194;_0x3978ef=[];}});})[_0x7ca9('0x1f')](function(){if(_0x56ffef!==0x194){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0xcec97c},'order':_0x7ca9('0x82')})['then'](function(_0xf1afc3){_0x3978ef=_0xf1afc3;});}})[_0x7ca9('0x2a')](function(_0x33f7f9){_0x56ffef=0x1f4;logger['error'](_0x33f7f9['stack']);if(_0x33f7f9[_0x7ca9('0x3c')]){delete _0x33f7f9['name'];}_0x3978ef=_0x33f7f9;})[_0x7ca9('0x83')](function(){if(_0x3978ef===null){_0x29df39['sendStatus'](_0x56ffef);}else{if(_0x56ffef===0x1f4){_0x29df39[_0x7ca9('0x2d')](_0x56ffef)['send'](_0x3978ef);}else{_0x29df39['status'](_0x56ffef)[_0x7ca9('0x2e')](_0x3978ef);}}});};exports[_0x7ca9('0x84')]=function(_0x13fa6a,_0x1a6a0a,_0x170660){var _0x4e4f6c={};var _0x3d6ff2={};var _0x305dc5;var _0x2cba1d;return db[_0x7ca9('0x42')]['findOne']({'where':{'id':_0x13fa6a[_0x7ca9('0x64')]['id']}})[_0x7ca9('0x1f')](handleEntityNotFound(_0x1a6a0a,null))[_0x7ca9('0x1f')](function(_0x31de28){if(_0x31de28){_0x305dc5=_0x31de28;_0x3d6ff2[_0x7ca9('0x46')]=_[_0x7ca9('0x48')](db[_0x7ca9('0x85')][_0x7ca9('0x43')]);_0x3d6ff2[_0x7ca9('0x47')]=_['keys'](_0x13fa6a[_0x7ca9('0x47')]);_0x3d6ff2[_0x7ca9('0x59')]=_['intersection'](_0x3d6ff2[_0x7ca9('0x46')],_0x3d6ff2[_0x7ca9('0x47')]);_0x4e4f6c[_0x7ca9('0x49')]=_[_0x7ca9('0x4a')](_0x3d6ff2[_0x7ca9('0x46')],qs['fields'](_0x13fa6a[_0x7ca9('0x47')][_0x7ca9('0x4b')]));_0x4e4f6c[_0x7ca9('0x49')]=_0x4e4f6c[_0x7ca9('0x49')][_0x7ca9('0x6a')]?_0x4e4f6c[_0x7ca9('0x49')]:_0x3d6ff2['model'];_0x4e4f6c[_0x7ca9('0x4e')]=qs[_0x7ca9('0x4f')](_0x13fa6a['query'][_0x7ca9('0x4f')]);_0x4e4f6c[_0x7ca9('0x50')]=qs[_0x7ca9('0x59')](_[_0x7ca9('0x51')](_0x13fa6a[_0x7ca9('0x47')],_0x3d6ff2[_0x7ca9('0x59')]));if(_0x13fa6a[_0x7ca9('0x47')]['filter']){_0x4e4f6c[_0x7ca9('0x50')]=_[_0x7ca9('0x52')](_0x4e4f6c[_0x7ca9('0x50')],{'$or':_[_0x7ca9('0x41')](_0x4e4f6c[_0x7ca9('0x49')],function(_0xa85469){var _0x1bc87f={};_0x1bc87f[_0xa85469]={'$like':'%'+_0x13fa6a['query'][_0x7ca9('0x6b')]+'%'};return _0x1bc87f;})});}_0x4e4f6c=_[_0x7ca9('0x52')]({},_0x4e4f6c,_0x13fa6a[_0x7ca9('0x54')]);return _0x305dc5[_0x7ca9('0x84')](_0x4e4f6c);}})[_0x7ca9('0x1f')](function(_0x41dcbd){if(_0x41dcbd){_0x2cba1d=_0x41dcbd['length'];if(!_0x13fa6a[_0x7ca9('0x47')][_0x7ca9('0x4c')](_0x7ca9('0x4d'))){_0x4e4f6c[_0x7ca9('0x30')]=qs['limit'](_0x13fa6a['query'][_0x7ca9('0x30')]);_0x4e4f6c[_0x7ca9('0x2f')]=qs[_0x7ca9('0x2f')](_0x13fa6a[_0x7ca9('0x47')][_0x7ca9('0x2f')]);}return _0x305dc5[_0x7ca9('0x84')](_0x4e4f6c);}})['then'](function(_0x25efe7){if(_0x25efe7){return _0x25efe7?{'count':_0x2cba1d,'rows':_0x25efe7}:null;}})[_0x7ca9('0x1f')](respondWithResult(_0x1a6a0a,null))[_0x7ca9('0x2a')](handleError(_0x1a6a0a,null));};exports[_0x7ca9('0x86')]=function(_0x48c5bf,_0x299bb9,_0xa7920a){var _0x27f64f={'channel':_0x7ca9('0x87')};var _0x4ca522=[];var _0x321747=[];var _0x2d9948={};return db['WhatsappAccount'][_0x7ca9('0x5a')]({'where':{'id':_0x48c5bf[_0x7ca9('0x64')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x7ca9('0x88')}]})[_0x7ca9('0x1f')](handleEntityNotFound(_0x299bb9,null))['then'](function(_0x49bf5c){_0x27f64f[_0x7ca9('0x89')]=_0x49bf5c;if(_0x27f64f['account']&&_0x27f64f['account'][_0x7ca9('0x45')]===_0x7ca9('0x8a')&&_0x48c5bf[_0x7ca9('0x63')]['statuses']){if(_0x48c5bf[_0x7ca9('0x63')]['statuses'][_0x7ca9('0x6a')]===0x0)return;if(_0x48c5bf[_0x7ca9('0x63')][_0x7ca9('0x8b')][0x0][_0x7ca9('0x8c')]!==_0x7ca9('0x8d'))return;return db[_0x7ca9('0x8e')][_0x7ca9('0x37')]({'read':!![],'readAt':_0x48c5bf['body'][_0x7ca9('0x8b')][0x0][_0x7ca9('0x8f')]},{'where':{'messageId':_0x48c5bf[_0x7ca9('0x63')][_0x7ca9('0x8b')][0x0][_0x7ca9('0x90')]},'individualHooks':!![]})[_0x7ca9('0x1f')](function(_0xc0fcdc){return _0x299bb9[_0x7ca9('0x2d')](0xc8)[_0x7ca9('0x2e')](_0xc0fcdc);});}_0x27f64f[_0x7ca9('0x91')]=_[_0x7ca9('0x92')](_0x49bf5c[_0x7ca9('0x88')],['priority'],[_0x7ca9('0x93')]);if(_0x27f64f[_0x7ca9('0x89')][_0x7ca9('0x88')]){delete _0x27f64f[_0x7ca9('0x89')][_0x7ca9('0x88')];}return db[_0x7ca9('0x94')][_0x7ca9('0x65')]()[_0x7ca9('0x1f')](function(_0x520982){if(!_0x520982){throw new db[(_0x7ca9('0x95'))][(_0x7ca9('0x96'))](_0x7ca9('0x97'));}_0x4ca522=_['difference'](_['keys'](_0x520982),[_0x7ca9('0x98'),_0x7ca9('0x99')]);_0x321747=_[_0x7ca9('0x9a')](_['keys'](_0x520982),[_0x7ca9('0x98'),'updatedAt','CompanyId',_0x7ca9('0x9b')]);_0x27f64f['body']={'mapKey':'mobile'};if(_0x27f64f[_0x7ca9('0x89')]&&_0x27f64f[_0x7ca9('0x89')][_0x7ca9('0x45')]===_0x7ca9('0x9c')){_0x27f64f[_0x7ca9('0x63')][_0x7ca9('0x9d')]=_0x48c5bf[_0x7ca9('0x63')]['From']['replace'](_0x7ca9('0x9e'),'');_0x27f64f[_0x7ca9('0x63')][_0x7ca9('0x63')]=_0x48c5bf['body'][_0x7ca9('0x9f')];_0x27f64f[_0x7ca9('0x63')][_0x7ca9('0xa0')]=_0x48c5bf[_0x7ca9('0x63')]['MessageSid'];}if(_0x27f64f[_0x7ca9('0x89')]&&_0x27f64f[_0x7ca9('0x89')][_0x7ca9('0x45')]==='sinch'){_0x27f64f[_0x7ca9('0x63')][_0x7ca9('0x9d')]=_0x48c5bf[_0x7ca9('0x63')][_0x7ca9('0xa1')][0x0]['from'];_0x27f64f[_0x7ca9('0x63')][_0x7ca9('0x63')]=_0x48c5bf[_0x7ca9('0x63')][_0x7ca9('0xa1')][0x0]['message'][_0x7ca9('0x63')];_0x27f64f[_0x7ca9('0x63')][_0x7ca9('0xa0')]=_0x48c5bf['body'][_0x7ca9('0xa1')][0x0][_0x7ca9('0x90')];}if(_0x27f64f[_0x7ca9('0x63')]['id']){delete _0x27f64f[_0x7ca9('0x63')]['id'];}if(_[_0x7ca9('0xa2')](_0x27f64f['body'][_0x7ca9('0x9d')])){throw new db['Sequelize'][(_0x7ca9('0x96'))]('from\x20is\x20mandatory');}if(_[_0x7ca9('0xa2')](_0x27f64f[_0x7ca9('0x63')]['body'])||_0x27f64f[_0x7ca9('0x63')]['body']===''){throw new db[(_0x7ca9('0x95'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x27f64f[_0x7ca9('0x63')]['mapKey'])){throw new db[(_0x7ca9('0x95'))][(_0x7ca9('0x96'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x321747);}if(!_[_0x7ca9('0xa3')](_0x321747,_0x27f64f[_0x7ca9('0x63')]['mapKey'])){throw new db[(_0x7ca9('0x95'))][(_0x7ca9('0x96'))](_0x7ca9('0xa4')+_0x321747);}_0x2d9948[_0x27f64f[_0x7ca9('0x63')][_0x7ca9('0xa5')]]=_0x27f64f[_0x7ca9('0x63')][_0x7ca9('0x9d')];return db[_0x7ca9('0xa6')]['find']({'where':{'id':_0x27f64f[_0x7ca9('0x89')]['ListId']},'include':[{'model':db[_0x7ca9('0x94')],'as':'Contacts','where':_0x2d9948,'limit':0x1,'order':[[_0x7ca9('0x99'),_0x7ca9('0xa7')]]}]});})[_0x7ca9('0x1f')](handleEntityNotFound(_0x299bb9,null))[_0x7ca9('0x1f')](function(_0x19ced8){if(_0x19ced8){_0x27f64f[_0x7ca9('0xa8')]=_[_0x7ca9('0x74')](_0x19ced8,[_0x7ca9('0xa9')]);if(_0x19ced8['Contacts'][_0x7ca9('0x6a')]){return _0x19ced8[_0x7ca9('0xa9')][0x0];}var _0x25bb33=_[_0x7ca9('0x18')](_0x27f64f[_0x7ca9('0x63')],{'firstName':_0x27f64f[_0x7ca9('0x63')]['from'],'ListId':_0x19ced8['id']});_0x25bb33[_0x27f64f[_0x7ca9('0x63')][_0x7ca9('0xa5')]]=_0x27f64f[_0x7ca9('0x63')][_0x7ca9('0x9d')];return db[_0x7ca9('0x94')][_0x7ca9('0x5b')](_0x25bb33,{'fields':_0x4ca522,'raw':!![]});}})[_0x7ca9('0x1f')](handleEntityNotFound(_0x299bb9,null))[_0x7ca9('0x1f')](function(_0x2c338e){if(_0x2c338e){_0x27f64f['contact']=_0x2c338e;var _0x2d615a={'ContactId':_0x2c338e['id'],'phone':_0x27f64f[_0x7ca9('0x63')]['from'],'WhatsappAccountId':_0x48c5bf[_0x7ca9('0x64')]['id']};var _0x3aae98={'ContactId':_0x2c338e['id'],'WhatsappAccountId':_0x48c5bf[_0x7ca9('0x64')]['id'],'closed':![]};return db[_0x7ca9('0xaa')]['find']({'where':_0x3aae98})[_0x7ca9('0x1f')](function(_0x35a44f){if(_0x35a44f){return[_0x35a44f,![]];}return db[_0x7ca9('0xaa')][_0x7ca9('0x5b')](_0x2d615a)[_0x7ca9('0x1f')](function(_0x22e105){return[_0x22e105,!![]];});});}})[_0x7ca9('0xab')](function(_0x27ada3,_0xd7e3c5){_0x27f64f[_0x7ca9('0xac')]=_0x27ada3[_0x7ca9('0x5c')]({'plain':!![]});_0x27f64f[_0x7ca9('0xac')]['created']=![];if(_0xd7e3c5){if(_0x27f64f[_0x7ca9('0x89')]['autoclose']){_0x27f64f[_0x7ca9('0x91')][_0x7ca9('0xad')]({'id':0x0,'priority':_0x27f64f[_0x7ca9('0x91')][_0x7ca9('0x6a')]+0x1,'app':'close','appdata':_0x7ca9('0xae'),'interval':_0x7ca9('0xaf')});}_0x27f64f['interaction'][_0x7ca9('0xb0')]=!![];}return db['WhatsappMessage'][_0x7ca9('0x5b')]({'phone':_0x27f64f[_0x7ca9('0x63')]['from'],'messageId':_0x27f64f[_0x7ca9('0x63')][_0x7ca9('0xa0')],'body':_0x27f64f['body']['body'],'WhatsappAccountId':_0x48c5bf['params']['id'],'WhatsappInteractionId':_0x27ada3['id'],'direction':'in','ContactId':_0x27ada3[_0x7ca9('0xb1')],'AttachmentId':_0x27f64f[_0x7ca9('0x63')][_0x7ca9('0xb2')]});})['then'](function(_0x12187d){_0x27f64f[_0x7ca9('0x28')]=_0x12187d;if(_0x27f64f[_0x7ca9('0xac')][_0x7ca9('0xb3')]){return db['User'][_0x7ca9('0x5a')]({'attributes':['id',_0x7ca9('0x3c')],'where':{'id':_0x27f64f[_0x7ca9('0xac')][_0x7ca9('0xb3')]}})[_0x7ca9('0x1f')](function(_0x2b9e33){if(_0x2b9e33){_0x27f64f[_0x7ca9('0x91')]['unshift']({'id':0x0,'priority':0x0,'app':_0x7ca9('0xb4'),'appdata':_0x2b9e33[_0x7ca9('0x3c')]+','+(_0x27f64f[_0x7ca9('0x89')][_0x7ca9('0xb5')]||0xa),'interval':_0x7ca9('0xaf')});}return respondWithRpcPromise(_0x7ca9('0xb6'),_0x7ca9('0xb7'),_0x27f64f);});}return respondWithRpcPromise(_0x7ca9('0xb6'),_0x7ca9('0xb7'),_0x27f64f);})[_0x7ca9('0x1f')](function(_0x3b14e2){if(_0x3b14e2){var _0x532139=0xc8;var _0x12e8e2=_0x7ca9('0xb8');logger[_0x7ca9('0x20')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x12e8e2,_0x532139,_0x7ca9('0xb9'));logger['debug'](_0x7ca9('0xba'),_0x12e8e2,_0x532139,_0x7ca9('0xb9'),JSON[_0x7ca9('0x24')](_0x3b14e2));if(_0x27f64f[_0x7ca9('0x89')]['type']==='twilio'){return _0x299bb9['status'](_0x532139)['set'](_0x7ca9('0xbb'),_0x7ca9('0xbc'))['send'](_0x7ca9('0xbd'));}else{return _0x299bb9['status'](_0x532139)[_0x7ca9('0x2e')](_0x3b14e2);}}});})[_0x7ca9('0x2a')](handleError(_0x299bb9,null));};exports['send']=function(_0x2ea1eb,_0x56f826,_0x17ad83){var _0x46a012,_0x367c0b,_0x5a07c7;if(_['isNil'](_0x2ea1eb[_0x7ca9('0x63')]['body'])||_0x2ea1eb[_0x7ca9('0x63')][_0x7ca9('0x63')]===''){throw new db[(_0x7ca9('0x95'))][(_0x7ca9('0x96'))](_0x7ca9('0xbe'));}if(_['isNil'](_0x2ea1eb['body']['to'])){throw new db[(_0x7ca9('0x95'))]['ValidationError'](_0x7ca9('0xbf'));}_0x46a012=_0x2ea1eb[_0x7ca9('0x63')]['to'];return db[_0x7ca9('0x42')][_0x7ca9('0x5a')]({'where':{'id':_0x2ea1eb[_0x7ca9('0x64')]['id']},'include':[{'model':db[_0x7ca9('0xa6')],'as':_0x7ca9('0xc0'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'mobile':_0x46a012},'limit':0x1,'order':[[_0x7ca9('0x99'),_0x7ca9('0xa7')]]}]}]})[_0x7ca9('0x1f')](handleEntityNotFound(_0x56f826,null))[_0x7ca9('0x1f')](function(_0x641c3b){if(_0x641c3b&&_0x641c3b['List']){_0x367c0b=_0x641c3b[_0x7ca9('0x5c')]({'plain':!![]});if(_0x367c0b['List']&&_0x367c0b[_0x7ca9('0xc0')]['Contacts'][_0x7ca9('0x6a')]){return _0x367c0b[_0x7ca9('0xc0')][_0x7ca9('0xa9')][0x0];}return db['CmContact']['create'](_[_0x7ca9('0x18')](_0x2ea1eb['body'],{'firstName':_0x46a012,'mobile':_0x46a012,'phone':_0x46a012,'ListId':_0x367c0b[_0x7ca9('0x9b')]}));}})[_0x7ca9('0x1f')](handleEntityNotFound(_0x56f826,null))[_0x7ca9('0x1f')](function(_0x547d1e){if(_0x547d1e){_0x5a07c7=_0x547d1e;return db[_0x7ca9('0xaa')][_0x7ca9('0x5a')]({'where':{'ContactId':_0x5a07c7['id'],'closed':![],'WhatsappAccountId':_0x367c0b['id']}})[_0x7ca9('0x1f')](function(_0x4f914a){if(_0x4f914a){return[_0x4f914a,![]];}return db[_0x7ca9('0xaa')][_0x7ca9('0x5b')]({'UserId':_0x2ea1eb[_0x7ca9('0x5f')]['id'],'ContactId':_0x5a07c7['id'],'WhatsappAccountId':_0x367c0b['id'],'phone':_0x46a012,'firstMsgDirection':_0x7ca9('0xc1'),'Messages':[_[_0x7ca9('0x52')](_0x2ea1eb[_0x7ca9('0x63')],{'read':![],'body':_0x2ea1eb['body'][_0x7ca9('0x63')],'phone':_0x46a012,'WhatsappAccountId':_0x367c0b['id'],'UserId':_0x2ea1eb[_0x7ca9('0x5f')]['id'],'ContactId':_0x5a07c7['id']})]},{'include':[{'model':db[_0x7ca9('0x8e')],'as':_0x7ca9('0xc2')}]})[_0x7ca9('0x1f')](function(_0x404246){return[_0x404246,!![]];});});}})[_0x7ca9('0xab')](function(_0xf2c8a4,_0x3779ea){if(_0x3779ea){return _0xf2c8a4;}return db[_0x7ca9('0x8e')][_0x7ca9('0x5b')](_[_0x7ca9('0x52')](_0x2ea1eb[_0x7ca9('0x63')],{'read':![],'body':_0x2ea1eb[_0x7ca9('0x63')][_0x7ca9('0x63')],'phone':_0x46a012,'WhatsappAccountId':_0x367c0b['id'],'WhatsappInteractionId':_0xf2c8a4['id'],'UserId':_0x2ea1eb[_0x7ca9('0x5f')]['id'],'ContactId':_0x5a07c7['id']}))[_0x7ca9('0x1f')](function(_0x299413){_0xf2c8a4['dataValues'][_0x7ca9('0xc2')]=[];_0xf2c8a4['dataValues']['Messages']['push'](_0x299413[_0x7ca9('0xc3')]);return _0xf2c8a4;});})['then'](respondWithResult(_0x56f826,null))[_0x7ca9('0x2a')](handleError(_0x56f826,null));}; \ No newline at end of file +var _0x0b00=['WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','\x0a','List','DESC','out','spread','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','then','info','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','WhatsappAccount,\x20%s,\x20%s','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','WhatsappAccounts','UserProfileResource','destroy','end','sendStatus','name','send','Pause','mandatoryDispositionPause','map','WhatsappAccount','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','getDispositions','WhatsappAccountId','ids','addAnswer','CannedAnswer','getAnswers','addAgents','omit','userWhatsappAccount:save','removeAgents','isArray','emit','userWhatsappAccount:remove','getAgents','findOne','User','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','findAndCountAll','priority','stack','getApplications','notify','Applications','account','sinch','statuses','timestamp','message_id','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','replace','whatsapp:','Body','messageId','notifications','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','list','Contacts','contact','WhatsappInteraction','interaction','applications','push','close','*,*,*,*','created','WhatsappMessage','ContactId','AttachmentId','UserId','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','entity\x20found'];(function(_0x2ab885,_0xe6b420){var _0x16e9f4=function(_0x219076){while(--_0x219076){_0x2ab885['push'](_0x2ab885['shift']());}};_0x16e9f4(++_0xe6b420);}(_0x0b00,0xcf));var _0x00b0=function(_0x3aa10c,_0x38c286){_0x3aa10c=_0x3aa10c-0x0;var _0x4da769=_0x0b00[_0x3aa10c];return _0x4da769;};'use strict';var emlformat=require(_0x00b0('0x0'));var rimraf=require(_0x00b0('0x1'));var zipdir=require(_0x00b0('0x2'));var jsonpatch=require(_0x00b0('0x3'));var rp=require(_0x00b0('0x4'));var moment=require('moment');var BPromise=require(_0x00b0('0x5'));var Mustache=require(_0x00b0('0x6'));var util=require(_0x00b0('0x7'));var path=require('path');var sox=require(_0x00b0('0x8'));var csv=require(_0x00b0('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x00b0('0xa'));var _=require(_0x00b0('0xb'));var squel=require(_0x00b0('0xc'));var crypto=require(_0x00b0('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x00b0('0x9'));var querystring=require('querystring');var Papa=require(_0x00b0('0xe'));var Redis=require(_0x00b0('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x00b0('0x10'));var as=require(_0x00b0('0x11'));var hardwareService=require(_0x00b0('0x12'));var logger=require('../../config/logger')(_0x00b0('0x13'));var utils=require(_0x00b0('0x14'));var config=require(_0x00b0('0x15'));var licenseUtil=require(_0x00b0('0x16'));var db=require(_0x00b0('0x17'))['db'];config[_0x00b0('0x18')]=_[_0x00b0('0x19')](config[_0x00b0('0x18')],{'host':_0x00b0('0x1a'),'port':0x18eb});var socket=require(_0x00b0('0x1b'))(new Redis(config[_0x00b0('0x18')]));require(_0x00b0('0x1c'))['register'](socket);var jayson=require(_0x00b0('0x1d'));var client=jayson[_0x00b0('0x1e')][_0x00b0('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x799490,_0x4c35b0,_0x3fbed9,_0x407656){return new BPromise(function(_0x47b1cf,_0xe4c63b){var _0x408671=_0x407656||client;return _0x408671[_0x00b0('0x20')](_0x799490,_0x3fbed9)[_0x00b0('0x21')](function(_0x386c84){logger[_0x00b0('0x22')]('WhatsappAccount,\x20%s,\x20%s',_0x4c35b0,_0x00b0('0x23'));logger[_0x00b0('0x24')](_0x00b0('0x25'),_0x4c35b0,_0x00b0('0x23'),JSON[_0x00b0('0x26')](_0x386c84));if(_0x386c84[_0x00b0('0x27')]){if(_0x386c84[_0x00b0('0x27')][_0x00b0('0x28')]===0x1f4){logger[_0x00b0('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x4c35b0,_0x386c84['error'][_0x00b0('0x29')]);return _0xe4c63b(_0x386c84[_0x00b0('0x27')]['message']);}logger[_0x00b0('0x27')]('WhatsappAccount,\x20%s,\x20%s',_0x4c35b0,_0x386c84['error'][_0x00b0('0x29')]);return _0x47b1cf(_0x386c84[_0x00b0('0x27')][_0x00b0('0x29')]);}else{logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x4c35b0,_0x00b0('0x23'));_0x47b1cf(_0x386c84[_0x00b0('0x2a')]['message']);}})['catch'](function(_0x57a17a){logger['error'](_0x00b0('0x2b'),_0x4c35b0,_0x57a17a);_0xe4c63b(_0x57a17a);});});}function respondWithStatusCode(_0x47f213,_0x30e6d7){_0x30e6d7=_0x30e6d7||0xcc;return function(_0x19ca86){if(_0x19ca86){return _0x47f213['sendStatus'](_0x30e6d7);}return _0x47f213[_0x00b0('0x2c')](_0x30e6d7)['end']();};}function respondWithResult(_0x1c842b,_0x24f99d){_0x24f99d=_0x24f99d||0xc8;return function(_0x336fe0){if(_0x336fe0){return _0x1c842b[_0x00b0('0x2c')](_0x24f99d)['json'](_0x336fe0);}};}function respondWithFilteredResult(_0x1f9f5c,_0x3a88d5){return function(_0x4c48e1){if(_0x4c48e1){var _0xe9e92d=typeof _0x3a88d5[_0x00b0('0x2d')]===_0x00b0('0x2e')&&typeof _0x3a88d5['limit']==='undefined';var _0x170abe=_0x4c48e1['count'];var _0x738a03=_0xe9e92d?0x0:_0x3a88d5['offset'];var _0x24f7e5=_0xe9e92d?_0x4c48e1[_0x00b0('0x2f')]:_0x3a88d5[_0x00b0('0x2d')]+_0x3a88d5[_0x00b0('0x30')];var _0x9a8f51;if(_0x24f7e5>=_0x170abe){_0x24f7e5=_0x170abe;_0x9a8f51=0xc8;}else{_0x9a8f51=0xce;}_0x1f9f5c[_0x00b0('0x2c')](_0x9a8f51);return _0x1f9f5c[_0x00b0('0x31')](_0x00b0('0x32'),_0x738a03+'-'+_0x24f7e5+'/'+_0x170abe)[_0x00b0('0x33')](_0x4c48e1);}return null;};}function patchUpdates(_0x3d0055){return function(_0xe0cc5d){try{jsonpatch[_0x00b0('0x34')](_0xe0cc5d,_0x3d0055,!![]);}catch(_0x150d38){return BPromise[_0x00b0('0x35')](_0x150d38);}return _0xe0cc5d[_0x00b0('0x36')]();};}function saveUpdates(_0x2a072a,_0x32b710){return function(_0x288123){if(_0x288123){return _0x288123[_0x00b0('0x37')](_0x2a072a)[_0x00b0('0x21')](function(_0x260ab9){return _0x260ab9;});}return null;};}function removeEntity(_0x4287b7,_0x32469e){return function(_0x4f1433){if(_0x4f1433){return _0x4f1433['destroy']()[_0x00b0('0x21')](function(){var _0x2cb537=_0x4f1433['get']({'plain':!![]});var _0x105e87=_0x00b0('0x38');return db[_0x00b0('0x39')][_0x00b0('0x3a')]({'where':{'type':_0x105e87,'resourceId':_0x2cb537['id']}})['then'](function(){return _0x4f1433;});})['then'](function(){_0x4287b7[_0x00b0('0x2c')](0xcc)[_0x00b0('0x3b')]();});}};}function handleEntityNotFound(_0x216fc4,_0x1ac05d){return function(_0x32c6ae){if(!_0x32c6ae){_0x216fc4[_0x00b0('0x3c')](0x194);}return _0x32c6ae;};}function handleError(_0x362803,_0xfc40bf){_0xfc40bf=_0xfc40bf||0x1f4;return function(_0x23da73){logger['error'](_0x23da73['stack']);if(_0x23da73[_0x00b0('0x3d')]){delete _0x23da73[_0x00b0('0x3d')];}_0x362803[_0x00b0('0x2c')](_0xfc40bf)[_0x00b0('0x3e')](_0x23da73);};}exports['index']=function(_0x1fce07,_0x5211f5){var _0x4eff18={'include':[{'model':db[_0x00b0('0x3f')],'as':_0x00b0('0x40')}]},_0x2eb405={},_0x58373a={'count':0x0,'rows':[]};var _0x269caa=_[_0x00b0('0x41')](db[_0x00b0('0x42')]['rawAttributes'],function(_0x5eb90a){return{'name':_0x5eb90a[_0x00b0('0x43')],'type':_0x5eb90a[_0x00b0('0x44')][_0x00b0('0x45')]};});_0x2eb405[_0x00b0('0x46')]=_[_0x00b0('0x41')](_0x269caa,_0x00b0('0x3d'));_0x2eb405[_0x00b0('0x47')]=_[_0x00b0('0x48')](_0x1fce07['query']);_0x2eb405['filters']=_[_0x00b0('0x49')](_0x2eb405['model'],_0x2eb405[_0x00b0('0x47')]);_0x4eff18[_0x00b0('0x4a')]=_[_0x00b0('0x49')](_0x2eb405[_0x00b0('0x46')],qs[_0x00b0('0x4b')](_0x1fce07[_0x00b0('0x47')][_0x00b0('0x4b')]));_0x4eff18[_0x00b0('0x4a')]=_0x4eff18[_0x00b0('0x4a')][_0x00b0('0x4c')]?_0x4eff18[_0x00b0('0x4a')]:_0x2eb405[_0x00b0('0x46')];if(!_0x1fce07[_0x00b0('0x47')][_0x00b0('0x4d')](_0x00b0('0x4e'))){_0x4eff18[_0x00b0('0x30')]=qs[_0x00b0('0x30')](_0x1fce07[_0x00b0('0x47')][_0x00b0('0x30')]);_0x4eff18[_0x00b0('0x2d')]=qs[_0x00b0('0x2d')](_0x1fce07['query']['offset']);}_0x4eff18[_0x00b0('0x4f')]=qs[_0x00b0('0x50')](_0x1fce07[_0x00b0('0x47')][_0x00b0('0x50')]);_0x4eff18[_0x00b0('0x51')]=qs[_0x00b0('0x52')](_[_0x00b0('0x53')](_0x1fce07[_0x00b0('0x47')],_0x2eb405[_0x00b0('0x52')]),_0x269caa);if(_0x1fce07['query'][_0x00b0('0x54')]){_0x4eff18['where']=_[_0x00b0('0x55')](_0x4eff18[_0x00b0('0x51')],{'$or':_[_0x00b0('0x41')](_0x269caa,function(_0x43c5c5){if(_0x43c5c5[_0x00b0('0x44')]!==_0x00b0('0x56')){var _0x58d746={};_0x58d746[_0x43c5c5[_0x00b0('0x3d')]]={'$like':'%'+_0x1fce07[_0x00b0('0x47')][_0x00b0('0x54')]+'%'};return _0x58d746;}})});}_0x4eff18=_[_0x00b0('0x55')]({},_0x4eff18,_0x1fce07[_0x00b0('0x57')]);var _0x2b9385={'where':_0x4eff18[_0x00b0('0x51')]};return db[_0x00b0('0x42')][_0x00b0('0x2f')](_0x2b9385)['then'](function(_0x4278a6){_0x58373a[_0x00b0('0x2f')]=_0x4278a6;if(_0x1fce07[_0x00b0('0x47')][_0x00b0('0x58')]){_0x4eff18[_0x00b0('0x59')]=[{'all':!![]}];}return db[_0x00b0('0x42')][_0x00b0('0x5a')](_0x4eff18);})[_0x00b0('0x21')](function(_0x504eeb){_0x58373a[_0x00b0('0x5b')]=_0x504eeb;return _0x58373a;})['then'](respondWithFilteredResult(_0x5211f5,_0x4eff18))['catch'](handleError(_0x5211f5,null));};exports[_0x00b0('0x5c')]=function(_0x58eb5f,_0x3b4e2c){var _0x466829={'raw':![],'where':{'id':_0x58eb5f[_0x00b0('0x5d')]['id']},'include':[{'model':db[_0x00b0('0x3f')],'as':_0x00b0('0x40')}]},_0x4be686={};_0x4be686[_0x00b0('0x46')]=_['keys'](db[_0x00b0('0x42')][_0x00b0('0x5e')]);_0x4be686['query']=_['keys'](_0x58eb5f[_0x00b0('0x47')]);_0x4be686[_0x00b0('0x52')]=_['intersection'](_0x4be686[_0x00b0('0x46')],_0x4be686[_0x00b0('0x47')]);_0x466829[_0x00b0('0x4a')]=_[_0x00b0('0x49')](_0x4be686[_0x00b0('0x46')],qs[_0x00b0('0x4b')](_0x58eb5f[_0x00b0('0x47')]['fields']));_0x466829[_0x00b0('0x4a')]=_0x466829[_0x00b0('0x4a')][_0x00b0('0x4c')]?_0x466829[_0x00b0('0x4a')]:_0x4be686['model'];if(_0x58eb5f['query'][_0x00b0('0x58')]){_0x466829[_0x00b0('0x59')]=[{'all':!![]}];}_0x466829=_[_0x00b0('0x55')]({},_0x466829,_0x58eb5f['options']);return db[_0x00b0('0x42')][_0x00b0('0x5f')](_0x466829)[_0x00b0('0x21')](handleEntityNotFound(_0x3b4e2c,null))[_0x00b0('0x21')](respondWithResult(_0x3b4e2c,null))['catch'](handleError(_0x3b4e2c,null));};exports[_0x00b0('0x60')]=function(_0x5ea73c,_0x928609){return db[_0x00b0('0x42')][_0x00b0('0x60')](_0x5ea73c[_0x00b0('0x61')],{})[_0x00b0('0x21')](function(_0x3dfab2){var _0x43e7e2=_0x5ea73c[_0x00b0('0x62')][_0x00b0('0x63')]({'plain':!![]});if(!_0x43e7e2)throw new Error(_0x00b0('0x64'));if(_0x43e7e2['role']===_0x00b0('0x62')){var _0x22bcb7=_0x3dfab2[_0x00b0('0x63')]({'plain':!![]});var _0x5ad8b3=_0x00b0('0x38');return db[_0x00b0('0x65')][_0x00b0('0x5f')]({'where':{'name':_0x5ad8b3,'userProfileId':_0x43e7e2[_0x00b0('0x66')]},'raw':!![]})['then'](function(_0x3603f3){if(_0x3603f3&&_0x3603f3[_0x00b0('0x67')]===0x0){return db[_0x00b0('0x39')][_0x00b0('0x60')]({'name':_0x22bcb7['name'],'resourceId':_0x22bcb7['id'],'type':_0x3603f3['name'],'sectionId':_0x3603f3['id']},{})['then'](function(){return _0x3dfab2;});}else{return _0x3dfab2;}})[_0x00b0('0x68')](function(_0x53a541){logger[_0x00b0('0x27')](_0x00b0('0x69'),_0x53a541);throw _0x53a541;});}return _0x3dfab2;})[_0x00b0('0x21')](respondWithResult(_0x928609,0xc9))[_0x00b0('0x68')](handleError(_0x928609,null));};exports[_0x00b0('0x37')]=function(_0x1e92c1,_0x317c14){if(_0x1e92c1[_0x00b0('0x61')]['id']){delete _0x1e92c1[_0x00b0('0x61')]['id'];}return db[_0x00b0('0x42')][_0x00b0('0x5f')]({'where':{'id':_0x1e92c1['params']['id']},'include':[{'model':db[_0x00b0('0x3f')],'as':'mandatoryDispositionPause'}]})[_0x00b0('0x21')](handleEntityNotFound(_0x317c14,null))[_0x00b0('0x21')](saveUpdates(_0x1e92c1['body'],null))[_0x00b0('0x21')](respondWithResult(_0x317c14,null))[_0x00b0('0x68')](handleError(_0x317c14,null));};exports[_0x00b0('0x3a')]=function(_0x4c9221,_0x3c3068){return db[_0x00b0('0x42')][_0x00b0('0x5f')]({'where':{'id':_0x4c9221[_0x00b0('0x5d')]['id']}})[_0x00b0('0x21')](handleEntityNotFound(_0x3c3068,null))[_0x00b0('0x21')](removeEntity(_0x3c3068,null))[_0x00b0('0x68')](handleError(_0x3c3068,null));};exports[_0x00b0('0x6a')]=function(_0xd6de80,_0x1d9f48){return db['WhatsappAccount'][_0x00b0('0x6a')]()[_0x00b0('0x21')](respondWithResult(_0x1d9f48,null))[_0x00b0('0x68')](handleError(_0x1d9f48,null));};exports[_0x00b0('0x6b')]=function(_0x5b6033,_0x4e5832,_0x29edf){if(_0x5b6033[_0x00b0('0x61')]['id']){delete _0x5b6033['body']['id'];}return db[_0x00b0('0x42')]['find']({'where':{'id':_0x5b6033[_0x00b0('0x5d')]['id']}})['then'](handleEntityNotFound(_0x4e5832,null))[_0x00b0('0x21')](function(_0x58f673){if(_0x58f673){_0x5b6033[_0x00b0('0x61')]['WhatsappAccountId']=_0x58f673['id'];return db['Disposition']['create'](_0x5b6033[_0x00b0('0x61')]);}})['then'](respondWithResult(_0x4e5832,null))[_0x00b0('0x68')](handleError(_0x4e5832,null));};exports[_0x00b0('0x6c')]=function(_0x4ab650,_0x58231b,_0x3949e1){var _0x24aa54={'raw':![],'where':{}};var _0x25f4d4={};var _0x16fa11={'count':0x0,'rows':[]};return db[_0x00b0('0x42')]['findOne']({'where':{'id':_0x4ab650['params']['id']}})[_0x00b0('0x21')](handleEntityNotFound(_0x58231b,null))[_0x00b0('0x21')](function(_0x4cb022){if(_0x4cb022){_0x25f4d4['model']=_[_0x00b0('0x48')](db['Disposition']['rawAttributes']);_0x25f4d4[_0x00b0('0x47')]=_['keys'](_0x4ab650['query']);_0x25f4d4['filters']=_[_0x00b0('0x49')](_0x25f4d4[_0x00b0('0x46')],_0x25f4d4[_0x00b0('0x47')]);_0x24aa54[_0x00b0('0x4a')]=_[_0x00b0('0x49')](_0x25f4d4[_0x00b0('0x46')],qs[_0x00b0('0x4b')](_0x4ab650[_0x00b0('0x47')][_0x00b0('0x4b')]));_0x24aa54[_0x00b0('0x4a')]=_0x24aa54[_0x00b0('0x4a')][_0x00b0('0x4c')]?_0x24aa54[_0x00b0('0x4a')]:_0x25f4d4['model'];if(!_0x4ab650[_0x00b0('0x47')][_0x00b0('0x4d')]('nolimit')){_0x24aa54['limit']=qs[_0x00b0('0x30')](_0x4ab650[_0x00b0('0x47')]['limit']);_0x24aa54[_0x00b0('0x2d')]=qs[_0x00b0('0x2d')](_0x4ab650[_0x00b0('0x47')][_0x00b0('0x2d')]);}_0x24aa54[_0x00b0('0x4f')]=qs['sort'](_0x4ab650[_0x00b0('0x47')][_0x00b0('0x50')]);_0x24aa54[_0x00b0('0x51')]=qs[_0x00b0('0x52')](_[_0x00b0('0x53')](_0x4ab650[_0x00b0('0x47')],_0x25f4d4[_0x00b0('0x52')]));_0x24aa54[_0x00b0('0x51')][_0x00b0('0x6d')]=_0x4cb022['id'];if(_0x4ab650['query'][_0x00b0('0x54')]){_0x24aa54[_0x00b0('0x51')]=_['merge'](_0x24aa54[_0x00b0('0x51')],{'$or':_[_0x00b0('0x41')](_0x24aa54[_0x00b0('0x4a')],function(_0x466a47){var _0x21edfa={};_0x21edfa[_0x466a47]={'$like':'%'+_0x4ab650['query'][_0x00b0('0x54')]+'%'};return _0x21edfa;})});}_0x24aa54=_[_0x00b0('0x55')]({},_0x24aa54,_0x4ab650[_0x00b0('0x57')]);return db['Disposition'][_0x00b0('0x2f')]({'where':_0x24aa54[_0x00b0('0x51')]})['then'](function(_0x431931){_0x16fa11[_0x00b0('0x2f')]=_0x431931;if(_0x4ab650[_0x00b0('0x47')][_0x00b0('0x58')]){_0x24aa54['include']=[{'all':!![]}];}return db['Disposition'][_0x00b0('0x5a')](_0x24aa54);})[_0x00b0('0x21')](function(_0x175bc7){_0x16fa11[_0x00b0('0x5b')]=_0x175bc7;return _0x16fa11;});}})[_0x00b0('0x21')](respondWithFilteredResult(_0x58231b,_0x24aa54))['catch'](handleError(_0x58231b,null));};exports['removeDispositions']=function(_0xe277f3,_0x18e1e1,_0x1551f3){return db['WhatsappAccount'][_0x00b0('0x5f')]({'where':{'id':_0xe277f3[_0x00b0('0x5d')]['id']}})[_0x00b0('0x21')](handleEntityNotFound(_0x18e1e1,null))[_0x00b0('0x21')](function(_0x882bda){if(_0x882bda){return _0x882bda['removeDispositions'](_0xe277f3[_0x00b0('0x47')][_0x00b0('0x6e')]);}})[_0x00b0('0x21')](respondWithStatusCode(_0x18e1e1,null))['catch'](handleError(_0x18e1e1,null));};exports[_0x00b0('0x6f')]=function(_0x514ed3,_0x5e7258,_0x350407){if(_0x514ed3[_0x00b0('0x61')]['id']){delete _0x514ed3[_0x00b0('0x61')]['id'];}return db[_0x00b0('0x42')]['find']({'where':{'id':_0x514ed3['params']['id']}})[_0x00b0('0x21')](handleEntityNotFound(_0x5e7258,null))[_0x00b0('0x21')](function(_0x3665b0){if(_0x3665b0){_0x514ed3[_0x00b0('0x61')][_0x00b0('0x6d')]=_0x3665b0['id'];return db[_0x00b0('0x70')][_0x00b0('0x60')](_0x514ed3[_0x00b0('0x61')]);}})['then'](respondWithResult(_0x5e7258,null))[_0x00b0('0x68')](handleError(_0x5e7258,null));};exports[_0x00b0('0x71')]=function(_0x111863,_0x292187,_0x4844aa){var _0x4555ef={'raw':![],'where':{}};var _0x142ccd={};var _0x4b1b92={'count':0x0,'rows':[]};return db[_0x00b0('0x42')]['findOne']({'where':{'id':_0x111863[_0x00b0('0x5d')]['id']}})['then'](handleEntityNotFound(_0x292187,null))[_0x00b0('0x21')](function(_0x2b8361){if(_0x2b8361){_0x142ccd[_0x00b0('0x46')]=_['keys'](db['CannedAnswer'][_0x00b0('0x5e')]);_0x142ccd['query']=_['keys'](_0x111863[_0x00b0('0x47')]);_0x142ccd[_0x00b0('0x52')]=_[_0x00b0('0x49')](_0x142ccd['model'],_0x142ccd[_0x00b0('0x47')]);_0x4555ef['attributes']=_[_0x00b0('0x49')](_0x142ccd['model'],qs[_0x00b0('0x4b')](_0x111863[_0x00b0('0x47')][_0x00b0('0x4b')]));_0x4555ef[_0x00b0('0x4a')]=_0x4555ef[_0x00b0('0x4a')][_0x00b0('0x4c')]?_0x4555ef[_0x00b0('0x4a')]:_0x142ccd[_0x00b0('0x46')];if(!_0x111863[_0x00b0('0x47')][_0x00b0('0x4d')](_0x00b0('0x4e'))){_0x4555ef['limit']=qs[_0x00b0('0x30')](_0x111863['query'][_0x00b0('0x30')]);_0x4555ef[_0x00b0('0x2d')]=qs[_0x00b0('0x2d')](_0x111863['query'][_0x00b0('0x2d')]);}_0x4555ef[_0x00b0('0x4f')]=qs['sort'](_0x111863[_0x00b0('0x47')]['sort']);_0x4555ef[_0x00b0('0x51')]=qs['filters'](_['pick'](_0x111863[_0x00b0('0x47')],_0x142ccd[_0x00b0('0x52')]));_0x4555ef['where']['WhatsappAccountId']=_0x2b8361['id'];if(_0x111863[_0x00b0('0x47')]['filter']){_0x4555ef['where']=_[_0x00b0('0x55')](_0x4555ef[_0x00b0('0x51')],{'$or':_[_0x00b0('0x41')](_0x4555ef[_0x00b0('0x4a')],function(_0x4938c7){var _0x518eda={};_0x518eda[_0x4938c7]={'$like':'%'+_0x111863['query'][_0x00b0('0x54')]+'%'};return _0x518eda;})});}_0x4555ef=_['merge']({},_0x4555ef,_0x111863[_0x00b0('0x57')]);return db[_0x00b0('0x70')][_0x00b0('0x2f')]({'where':_0x4555ef['where']})[_0x00b0('0x21')](function(_0x478418){_0x4b1b92[_0x00b0('0x2f')]=_0x478418;if(_0x111863['query'][_0x00b0('0x58')]){_0x4555ef['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x00b0('0x5a')](_0x4555ef);})['then'](function(_0x12d415){_0x4b1b92[_0x00b0('0x5b')]=_0x12d415;return _0x4b1b92;});}})['then'](respondWithFilteredResult(_0x292187,_0x4555ef))['catch'](handleError(_0x292187,null));};exports['removeAnswers']=function(_0x55123d,_0x280c90,_0x567bd5){return db['WhatsappAccount'][_0x00b0('0x5f')]({'where':{'id':_0x55123d[_0x00b0('0x5d')]['id']}})[_0x00b0('0x21')](handleEntityNotFound(_0x280c90,null))[_0x00b0('0x21')](function(_0x313a34){if(_0x313a34){return _0x313a34['removeAnswers'](_0x55123d[_0x00b0('0x47')]['ids']);}})[_0x00b0('0x21')](respondWithStatusCode(_0x280c90,null))[_0x00b0('0x68')](handleError(_0x280c90,null));};exports[_0x00b0('0x72')]=function(_0x3fba88,_0x260316,_0x3d5454){return db['WhatsappAccount'][_0x00b0('0x5f')]({'where':{'id':_0x3fba88[_0x00b0('0x5d')]['id']}})['then'](handleEntityNotFound(_0x260316,null))[_0x00b0('0x21')](function(_0x2d24e9){if(_0x2d24e9){return _0x2d24e9[_0x00b0('0x72')](_0x3fba88[_0x00b0('0x61')][_0x00b0('0x6e')],_[_0x00b0('0x73')](_0x3fba88['body'],[_0x00b0('0x6e'),'id'])||{})['spread'](function(_0x20634c){for(var _0x53c14c=0x0;_0x53c14c<_0x3fba88[_0x00b0('0x61')][_0x00b0('0x6e')][_0x00b0('0x4c')];_0x53c14c+=0x1){socket['emit'](_0x00b0('0x74'),{'UserId':Number(_0x3fba88[_0x00b0('0x61')]['ids'][_0x53c14c]),'WhatsappAccountId':Number(_0x3fba88[_0x00b0('0x5d')]['id'])});}return _0x20634c;});}})[_0x00b0('0x21')](respondWithResult(_0x260316,null))[_0x00b0('0x68')](handleError(_0x260316,null));};exports[_0x00b0('0x75')]=function(_0x33e9ae,_0x459940,_0x20df57){return db[_0x00b0('0x42')][_0x00b0('0x5f')]({'where':{'id':_0x33e9ae[_0x00b0('0x5d')]['id']}})['then'](handleEntityNotFound(_0x459940,null))[_0x00b0('0x21')](function(_0x13764a){if(_0x13764a){return _0x13764a[_0x00b0('0x75')](_0x33e9ae['query'][_0x00b0('0x6e')])[_0x00b0('0x21')](function(){if(_[_0x00b0('0x76')](_0x33e9ae[_0x00b0('0x47')]['ids'])){for(var _0x112b2a=0x0;_0x112b2a<_0x33e9ae['query']['ids'][_0x00b0('0x4c')];_0x112b2a+=0x1){socket[_0x00b0('0x77')]('userWhatsappAccount:remove',{'UserId':Number(_0x33e9ae[_0x00b0('0x47')][_0x00b0('0x6e')][_0x112b2a]),'WhatsappAccountId':Number(_0x33e9ae['params']['id'])});}}else{socket['emit'](_0x00b0('0x78'),{'UserId':Number(_0x33e9ae['query'][_0x00b0('0x6e')]),'WhatsappAccountId':Number(_0x33e9ae[_0x00b0('0x5d')]['id'])});}});}})[_0x00b0('0x21')](respondWithStatusCode(_0x459940,null))['catch'](handleError(_0x459940,null));};exports[_0x00b0('0x79')]=function(_0x4edb90,_0x4182da,_0x5ea1aa){var _0x1d7536={};var _0x5cdca8={};var _0x344317;var _0x22713d;return db[_0x00b0('0x42')][_0x00b0('0x7a')]({'where':{'id':_0x4edb90[_0x00b0('0x5d')]['id']}})[_0x00b0('0x21')](handleEntityNotFound(_0x4182da,null))[_0x00b0('0x21')](function(_0xe6b0d7){if(_0xe6b0d7){_0x344317=_0xe6b0d7;_0x5cdca8[_0x00b0('0x46')]=_[_0x00b0('0x48')](db[_0x00b0('0x7b')][_0x00b0('0x5e')]);_0x5cdca8[_0x00b0('0x47')]=_[_0x00b0('0x48')](_0x4edb90[_0x00b0('0x47')]);_0x5cdca8[_0x00b0('0x52')]=_[_0x00b0('0x49')](_0x5cdca8[_0x00b0('0x46')],_0x5cdca8[_0x00b0('0x47')]);_0x1d7536[_0x00b0('0x4a')]=_[_0x00b0('0x49')](_0x5cdca8['model'],qs[_0x00b0('0x4b')](_0x4edb90['query']['fields']));_0x1d7536[_0x00b0('0x4a')]=_0x1d7536[_0x00b0('0x4a')][_0x00b0('0x4c')]?_0x1d7536['attributes']:_0x5cdca8[_0x00b0('0x46')];_0x1d7536['order']=qs[_0x00b0('0x50')](_0x4edb90[_0x00b0('0x47')][_0x00b0('0x50')]);_0x1d7536[_0x00b0('0x51')]=qs[_0x00b0('0x52')](_[_0x00b0('0x53')](_0x4edb90[_0x00b0('0x47')],_0x5cdca8[_0x00b0('0x52')]));if(_0x4edb90[_0x00b0('0x47')][_0x00b0('0x54')]){_0x1d7536['where']=_[_0x00b0('0x55')](_0x1d7536['where'],{'$or':_[_0x00b0('0x41')](_0x1d7536['attributes'],function(_0x517990){var _0x55620b={};_0x55620b[_0x517990]={'$like':'%'+_0x4edb90['query'][_0x00b0('0x54')]+'%'};return _0x55620b;})});}_0x1d7536=_[_0x00b0('0x55')]({},_0x1d7536,_0x4edb90['options']);return _0x344317[_0x00b0('0x79')](_0x1d7536);}})['then'](function(_0x2d8583){if(_0x2d8583){_0x22713d=_0x2d8583[_0x00b0('0x4c')];if(!_0x4edb90[_0x00b0('0x47')]['hasOwnProperty'](_0x00b0('0x4e'))){_0x1d7536[_0x00b0('0x30')]=qs[_0x00b0('0x30')](_0x4edb90[_0x00b0('0x47')][_0x00b0('0x30')]);_0x1d7536[_0x00b0('0x2d')]=qs[_0x00b0('0x2d')](_0x4edb90[_0x00b0('0x47')][_0x00b0('0x2d')]);}return _0x344317[_0x00b0('0x79')](_0x1d7536);}})[_0x00b0('0x21')](function(_0x1cbeca){if(_0x1cbeca){return _0x1cbeca?{'count':_0x22713d,'rows':_0x1cbeca}:null;}})[_0x00b0('0x21')](respondWithResult(_0x4182da,null))[_0x00b0('0x68')](handleError(_0x4182da,null));};exports['addApplications']=function(_0x101942,_0x460e38){var _0x1d67ce=_0x101942['params']['id'];var _0x10fe72=_0x101942[_0x00b0('0x61')];var _0x518d7d=0xc8;var _0x5dae2=null;return db[_0x00b0('0x7c')][_0x00b0('0x7d')]({'isolationLevel':db[_0x00b0('0x7c')][_0x00b0('0x7e')][_0x00b0('0x7f')][_0x00b0('0x80')]},function(_0x4c5560){return db['WhatsappAccount']['findOne']({'where':{'id':_0x1d67ce},'transaction':_0x4c5560})[_0x00b0('0x21')](function(_0x287f2d){if(_0x287f2d){return db['WhatsappApplication'][_0x00b0('0x3a')]({'where':{'WhatsappAccountId':_0x1d67ce},'transaction':_0x4c5560})[_0x00b0('0x21')](function(){var _0x34f4d2=_[_0x00b0('0x41')](_0x10fe72,function(_0x39db80){_0x39db80[_0x00b0('0x6d')]=_0x1d67ce;return _0x39db80;});return db[_0x00b0('0x81')]['bulkCreate'](_0x34f4d2,{'transaction':_0x4c5560});});}else{_0x518d7d=0x194;_0x5dae2=[];}});})['then'](function(){if(_0x518d7d!==0x194){return db['WhatsappApplication'][_0x00b0('0x82')]({'where':{'WhatsappAccountId':_0x1d67ce},'order':_0x00b0('0x83')})[_0x00b0('0x21')](function(_0x22a4bc){_0x5dae2=_0x22a4bc;});}})[_0x00b0('0x68')](function(_0xfe8447){_0x518d7d=0x1f4;logger[_0x00b0('0x27')](_0xfe8447[_0x00b0('0x84')]);if(_0xfe8447[_0x00b0('0x3d')]){delete _0xfe8447['name'];}_0x5dae2=_0xfe8447;})['finally'](function(){if(_0x5dae2===null){_0x460e38[_0x00b0('0x3c')](_0x518d7d);}else{if(_0x518d7d===0x1f4){_0x460e38[_0x00b0('0x2c')](_0x518d7d)['send'](_0x5dae2);}else{_0x460e38['status'](_0x518d7d)[_0x00b0('0x33')](_0x5dae2);}}});};exports[_0x00b0('0x85')]=function(_0x2826bf,_0x3822a6,_0x4e6cad){var _0x17020e={};var _0x430568={};var _0x1a944f;var _0x13a1bd;return db['WhatsappAccount'][_0x00b0('0x7a')]({'where':{'id':_0x2826bf[_0x00b0('0x5d')]['id']}})['then'](handleEntityNotFound(_0x3822a6,null))['then'](function(_0xca8788){if(_0xca8788){_0x1a944f=_0xca8788;_0x430568[_0x00b0('0x46')]=_['keys'](db[_0x00b0('0x81')][_0x00b0('0x5e')]);_0x430568[_0x00b0('0x47')]=_[_0x00b0('0x48')](_0x2826bf[_0x00b0('0x47')]);_0x430568[_0x00b0('0x52')]=_[_0x00b0('0x49')](_0x430568[_0x00b0('0x46')],_0x430568[_0x00b0('0x47')]);_0x17020e[_0x00b0('0x4a')]=_[_0x00b0('0x49')](_0x430568['model'],qs[_0x00b0('0x4b')](_0x2826bf[_0x00b0('0x47')][_0x00b0('0x4b')]));_0x17020e[_0x00b0('0x4a')]=_0x17020e[_0x00b0('0x4a')][_0x00b0('0x4c')]?_0x17020e[_0x00b0('0x4a')]:_0x430568[_0x00b0('0x46')];_0x17020e[_0x00b0('0x4f')]=qs[_0x00b0('0x50')](_0x2826bf['query'][_0x00b0('0x50')]);_0x17020e[_0x00b0('0x51')]=qs[_0x00b0('0x52')](_[_0x00b0('0x53')](_0x2826bf['query'],_0x430568[_0x00b0('0x52')]));if(_0x2826bf['query'][_0x00b0('0x54')]){_0x17020e['where']=_[_0x00b0('0x55')](_0x17020e[_0x00b0('0x51')],{'$or':_[_0x00b0('0x41')](_0x17020e[_0x00b0('0x4a')],function(_0x33f18a){var _0x552676={};_0x552676[_0x33f18a]={'$like':'%'+_0x2826bf[_0x00b0('0x47')][_0x00b0('0x54')]+'%'};return _0x552676;})});}_0x17020e=_[_0x00b0('0x55')]({},_0x17020e,_0x2826bf['options']);return _0x1a944f[_0x00b0('0x85')](_0x17020e);}})[_0x00b0('0x21')](function(_0x15a8b1){if(_0x15a8b1){_0x13a1bd=_0x15a8b1[_0x00b0('0x4c')];if(!_0x2826bf[_0x00b0('0x47')][_0x00b0('0x4d')](_0x00b0('0x4e'))){_0x17020e[_0x00b0('0x30')]=qs[_0x00b0('0x30')](_0x2826bf[_0x00b0('0x47')][_0x00b0('0x30')]);_0x17020e['offset']=qs[_0x00b0('0x2d')](_0x2826bf[_0x00b0('0x47')][_0x00b0('0x2d')]);}return _0x1a944f[_0x00b0('0x85')](_0x17020e);}})[_0x00b0('0x21')](function(_0x5d14b1){if(_0x5d14b1){return _0x5d14b1?{'count':_0x13a1bd,'rows':_0x5d14b1}:null;}})[_0x00b0('0x21')](respondWithResult(_0x3822a6,null))[_0x00b0('0x68')](handleError(_0x3822a6,null));};exports[_0x00b0('0x86')]=function(_0x4f6b43,_0xc8ab5d,_0x54eff2){var _0x24ef67={'channel':'whatsapp'};var _0x1320e4=[];var _0x349a63=[];var _0x52f4db={};return db[_0x00b0('0x42')]['find']({'where':{'id':_0x4f6b43[_0x00b0('0x5d')]['id']},'include':[{'model':db['WhatsappApplication'],'as':_0x00b0('0x87')}]})[_0x00b0('0x21')](handleEntityNotFound(_0xc8ab5d,null))[_0x00b0('0x21')](function(_0x3fb9c5){_0x24ef67['account']=_0x3fb9c5;if(_0x24ef67[_0x00b0('0x88')]&&_0x24ef67[_0x00b0('0x88')][_0x00b0('0x44')]===_0x00b0('0x89')&&_0x4f6b43[_0x00b0('0x61')][_0x00b0('0x8a')]){if(_0x4f6b43[_0x00b0('0x61')][_0x00b0('0x8a')]['length']===0x0)return;if(_0x4f6b43[_0x00b0('0x61')][_0x00b0('0x8a')][0x0]['state']!=='read')return;return db['WhatsappMessage'][_0x00b0('0x37')]({'read':!![],'readAt':_0x4f6b43['body'][_0x00b0('0x8a')][0x0][_0x00b0('0x8b')]},{'where':{'messageId':_0x4f6b43[_0x00b0('0x61')][_0x00b0('0x8a')][0x0][_0x00b0('0x8c')]},'individualHooks':!![]})['then'](function(_0x401e65){return _0xc8ab5d[_0x00b0('0x2c')](0xc8)['json'](_0x401e65);});}_0x24ef67['applications']=_[_0x00b0('0x8d')](_0x3fb9c5[_0x00b0('0x87')],[_0x00b0('0x83')],[_0x00b0('0x8e')]);if(_0x24ef67[_0x00b0('0x88')]['Applications']){delete _0x24ef67['account']['Applications'];}return db[_0x00b0('0x8f')][_0x00b0('0x6a')]()[_0x00b0('0x21')](function(_0xa20f7e){if(!_0xa20f7e){throw new db[(_0x00b0('0x90'))][(_0x00b0('0x91'))](_0x00b0('0x92'));}_0x1320e4=_[_0x00b0('0x93')](_[_0x00b0('0x48')](_0xa20f7e),[_0x00b0('0x94'),_0x00b0('0x95')]);_0x349a63=_['difference'](_['keys'](_0xa20f7e),['createdAt',_0x00b0('0x95'),_0x00b0('0x96'),_0x00b0('0x97')]);_0x24ef67[_0x00b0('0x61')]={'mapKey':_0x00b0('0x98')};if(_0x24ef67[_0x00b0('0x88')]&&_0x24ef67[_0x00b0('0x88')]['type']===_0x00b0('0x99')){_0x24ef67['body'][_0x00b0('0x9a')]=_0x4f6b43[_0x00b0('0x61')][_0x00b0('0x9b')][_0x00b0('0x9c')](_0x00b0('0x9d'),'');_0x24ef67['body'][_0x00b0('0x61')]=_0x4f6b43[_0x00b0('0x61')][_0x00b0('0x9e')];_0x24ef67['body'][_0x00b0('0x9f')]=_0x4f6b43[_0x00b0('0x61')]['MessageSid'];}if(_0x24ef67[_0x00b0('0x88')]&&_0x24ef67[_0x00b0('0x88')][_0x00b0('0x44')]==='sinch'){_0x24ef67[_0x00b0('0x61')][_0x00b0('0x9a')]=_0x4f6b43['body'][_0x00b0('0xa0')][0x0]['from'];_0x24ef67['body']['body']=_0x4f6b43[_0x00b0('0x61')]['notifications'][0x0][_0x00b0('0x29')][_0x00b0('0x61')];_0x24ef67[_0x00b0('0x61')]['messageId']=_0x4f6b43['body'][_0x00b0('0xa0')][0x0]['message_id'];}if(_0x24ef67[_0x00b0('0x61')]['id']){delete _0x24ef67['body']['id'];}if(_['isNil'](_0x24ef67[_0x00b0('0x61')][_0x00b0('0x9a')])){throw new db[(_0x00b0('0x90'))][(_0x00b0('0x91'))](_0x00b0('0xa1'));}if(_['isNil'](_0x24ef67['body'][_0x00b0('0x61')])||_0x24ef67[_0x00b0('0x61')]['body']===''){throw new db['Sequelize'][(_0x00b0('0x91'))](_0x00b0('0xa2'));}if(_[_0x00b0('0xa3')](_0x24ef67['body']['mapKey'])){throw new db[(_0x00b0('0x90'))][(_0x00b0('0x91'))](_0x00b0('0xa4')+_0x349a63);}if(!_[_0x00b0('0xa5')](_0x349a63,_0x24ef67[_0x00b0('0x61')][_0x00b0('0xa6')])){throw new db[(_0x00b0('0x90'))][(_0x00b0('0x91'))](_0x00b0('0xa7')+_0x349a63);}_0x52f4db[_0x24ef67[_0x00b0('0x61')][_0x00b0('0xa6')]]=_0x24ef67[_0x00b0('0x61')][_0x00b0('0x9a')];return db[_0x00b0('0xa8')][_0x00b0('0x5f')]({'where':{'id':_0x24ef67[_0x00b0('0x88')][_0x00b0('0x97')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x52f4db,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x00b0('0x21')](handleEntityNotFound(_0xc8ab5d,null))[_0x00b0('0x21')](function(_0x21b112){if(_0x21b112){_0x24ef67[_0x00b0('0xa9')]=_[_0x00b0('0x73')](_0x21b112,[_0x00b0('0xaa')]);if(_0x21b112[_0x00b0('0xaa')]['length']){return _0x21b112[_0x00b0('0xaa')][0x0];}var _0x2d6c02=_[_0x00b0('0x19')](_0x24ef67[_0x00b0('0x61')],{'firstName':_0x24ef67[_0x00b0('0x61')][_0x00b0('0x9a')],'ListId':_0x21b112['id']});_0x2d6c02[_0x24ef67[_0x00b0('0x61')]['mapKey']]=_0x24ef67[_0x00b0('0x61')][_0x00b0('0x9a')];return db['CmContact'][_0x00b0('0x60')](_0x2d6c02,{'fields':_0x1320e4,'raw':!![]});}})[_0x00b0('0x21')](handleEntityNotFound(_0xc8ab5d,null))[_0x00b0('0x21')](function(_0x330517){if(_0x330517){_0x24ef67[_0x00b0('0xab')]=_0x330517;var _0x2b4530={'ContactId':_0x330517['id'],'phone':_0x24ef67[_0x00b0('0x61')][_0x00b0('0x9a')],'WhatsappAccountId':_0x4f6b43[_0x00b0('0x5d')]['id']};var _0x59a801={'ContactId':_0x330517['id'],'WhatsappAccountId':_0x4f6b43[_0x00b0('0x5d')]['id'],'closed':![]};return db[_0x00b0('0xac')][_0x00b0('0x5f')]({'where':_0x59a801})[_0x00b0('0x21')](function(_0x5b1181){if(_0x5b1181){return[_0x5b1181,![]];}return db[_0x00b0('0xac')][_0x00b0('0x60')](_0x2b4530)[_0x00b0('0x21')](function(_0x41fe52){return[_0x41fe52,!![]];});});}})['spread'](function(_0x519097,_0x5c6366){_0x24ef67[_0x00b0('0xad')]=_0x519097[_0x00b0('0x63')]({'plain':!![]});_0x24ef67['interaction']['created']=![];if(_0x5c6366){if(_0x24ef67['account']['autoclose']){_0x24ef67[_0x00b0('0xae')][_0x00b0('0xaf')]({'id':0x0,'priority':_0x24ef67['applications'][_0x00b0('0x4c')]+0x1,'app':_0x00b0('0xb0'),'appdata':'unmanaged','interval':_0x00b0('0xb1')});}_0x24ef67[_0x00b0('0xad')][_0x00b0('0xb2')]=!![];}return db[_0x00b0('0xb3')][_0x00b0('0x60')]({'phone':_0x24ef67[_0x00b0('0x61')][_0x00b0('0x9a')],'messageId':_0x24ef67[_0x00b0('0x61')][_0x00b0('0x9f')],'body':_0x24ef67[_0x00b0('0x61')][_0x00b0('0x61')],'WhatsappAccountId':_0x4f6b43[_0x00b0('0x5d')]['id'],'WhatsappInteractionId':_0x519097['id'],'direction':'in','ContactId':_0x519097[_0x00b0('0xb4')],'AttachmentId':_0x24ef67['body'][_0x00b0('0xb5')]});})[_0x00b0('0x21')](function(_0x3a52b8){_0x24ef67[_0x00b0('0x29')]=_0x3a52b8;if(_0x24ef67[_0x00b0('0xad')][_0x00b0('0xb6')]){return db[_0x00b0('0x7b')][_0x00b0('0x5f')]({'attributes':['id',_0x00b0('0x3d')],'where':{'id':_0x24ef67[_0x00b0('0xad')]['UserId']}})[_0x00b0('0x21')](function(_0x327b68){if(_0x327b68){_0x24ef67[_0x00b0('0xae')]['unshift']({'id':0x0,'priority':0x0,'app':_0x00b0('0xb7'),'appdata':_0x327b68[_0x00b0('0x3d')]+','+(_0x24ef67['account'][_0x00b0('0xb8')]||0xa),'interval':_0x00b0('0xb1')});}return respondWithRpcPromise('Start',_0x00b0('0xb9'),_0x24ef67);});}return respondWithRpcPromise(_0x00b0('0xba'),_0x00b0('0xb9'),_0x24ef67);})[_0x00b0('0x21')](function(_0x53110e){if(_0x53110e){var _0x2b972a=0xc8;var _0xb7e30=_0x00b0('0xbb');logger[_0x00b0('0x22')](_0x00b0('0x25'),_0xb7e30,_0x2b972a,_0x00b0('0xbc'));logger[_0x00b0('0x24')](_0x00b0('0xbd'),_0xb7e30,_0x2b972a,'entity\x20found',JSON[_0x00b0('0x26')](_0x53110e));if(_0x24ef67[_0x00b0('0x88')][_0x00b0('0x44')]===_0x00b0('0x99')){return _0xc8ab5d['status'](_0x2b972a)[_0x00b0('0x31')]('Content-Type',_0x00b0('0xbe'))[_0x00b0('0x3e')](_0x00b0('0xbf'));}else{return _0xc8ab5d[_0x00b0('0x2c')](_0x2b972a)['json'](_0x53110e);}}});})[_0x00b0('0x68')](handleError(_0xc8ab5d,null));};exports[_0x00b0('0x3e')]=function(_0x55a10c,_0x1eeebe,_0x2b84cd){var _0x260915,_0x310477,_0x1f73df;if(_[_0x00b0('0xa3')](_0x55a10c['body'][_0x00b0('0x61')])||_0x55a10c[_0x00b0('0x61')][_0x00b0('0x61')]===''){throw new db[(_0x00b0('0x90'))]['ValidationError'](_0x00b0('0xa2'));}if(_['isNil'](_0x55a10c[_0x00b0('0x61')]['to'])){throw new db[(_0x00b0('0x90'))][(_0x00b0('0x91'))]('to\x20is\x20mandatory');}_0x260915=_0x55a10c[_0x00b0('0x61')]['to'];return db[_0x00b0('0x42')]['find']({'where':{'id':_0x55a10c[_0x00b0('0x5d')]['id']},'include':[{'model':db[_0x00b0('0xa8')],'as':_0x00b0('0xc0'),'include':[{'model':db[_0x00b0('0x8f')],'as':_0x00b0('0xaa'),'where':{'mobile':_0x260915},'limit':0x1,'order':[[_0x00b0('0x95'),_0x00b0('0xc1')]]}]}]})[_0x00b0('0x21')](handleEntityNotFound(_0x1eeebe,null))[_0x00b0('0x21')](function(_0x22f8ad){if(_0x22f8ad&&_0x22f8ad[_0x00b0('0xc0')]){_0x310477=_0x22f8ad['get']({'plain':!![]});if(_0x310477['List']&&_0x310477[_0x00b0('0xc0')]['Contacts']['length']){return _0x310477[_0x00b0('0xc0')][_0x00b0('0xaa')][0x0];}return db['CmContact'][_0x00b0('0x60')](_[_0x00b0('0x19')](_0x55a10c[_0x00b0('0x61')],{'firstName':_0x260915,'mobile':_0x260915,'phone':_0x260915,'ListId':_0x310477[_0x00b0('0x97')]}));}})[_0x00b0('0x21')](handleEntityNotFound(_0x1eeebe,null))['then'](function(_0x60afb4){if(_0x60afb4){_0x1f73df=_0x60afb4;return db[_0x00b0('0xac')][_0x00b0('0x5f')]({'where':{'ContactId':_0x1f73df['id'],'closed':![],'WhatsappAccountId':_0x310477['id']}})[_0x00b0('0x21')](function(_0x5e4467){if(_0x5e4467){return[_0x5e4467,![]];}return db[_0x00b0('0xac')][_0x00b0('0x60')]({'UserId':_0x55a10c[_0x00b0('0x62')]['id'],'ContactId':_0x1f73df['id'],'WhatsappAccountId':_0x310477['id'],'phone':_0x260915,'firstMsgDirection':_0x00b0('0xc2'),'Messages':[_[_0x00b0('0x55')](_0x55a10c[_0x00b0('0x61')],{'read':![],'body':_0x55a10c['body']['body'],'phone':_0x260915,'WhatsappAccountId':_0x310477['id'],'UserId':_0x55a10c['user']['id'],'ContactId':_0x1f73df['id']})]},{'include':[{'model':db[_0x00b0('0xb3')],'as':'Messages'}]})[_0x00b0('0x21')](function(_0x1b3cbe){return[_0x1b3cbe,!![]];});});}})[_0x00b0('0xc3')](function(_0x1fcb94,_0x58743a){if(_0x58743a){return _0x1fcb94;}return db[_0x00b0('0xb3')][_0x00b0('0x60')](_['merge'](_0x55a10c[_0x00b0('0x61')],{'read':![],'body':_0x55a10c[_0x00b0('0x61')]['body'],'phone':_0x260915,'WhatsappAccountId':_0x310477['id'],'WhatsappInteractionId':_0x1fcb94['id'],'UserId':_0x55a10c[_0x00b0('0x62')]['id'],'ContactId':_0x1f73df['id']}))[_0x00b0('0x21')](function(_0x2d1553){_0x1fcb94['dataValues']['Messages']=[];_0x1fcb94['dataValues'][_0x00b0('0xc4')][_0x00b0('0xaf')](_0x2d1553[_0x00b0('0xc5')]);return _0x1fcb94;});})[_0x00b0('0x21')](respondWithResult(_0x1eeebe,null))[_0x00b0('0x68')](handleError(_0x1eeebe,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 42e7245..242b512 100644 --- a/server/api/whatsappAccount/whatsappAccount.events.js +++ b/server/api/whatsappAccount/whatsappAccount.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81a6=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappAccount','setMaxListeners','save','update','emit'];(function(_0x27bb0b,_0x3003d6){var _0x58709a=function(_0x35a351){while(--_0x35a351){_0x27bb0b['push'](_0x27bb0b['shift']());}};_0x58709a(++_0x3003d6);}(_0x81a6,0x157));var _0x681a=function(_0xc0a3d3,_0x2c8d00){_0xc0a3d3=_0xc0a3d3-0x0;var _0x3386e8=_0x81a6[_0xc0a3d3];return _0x3386e8;};'use strict';var EventEmitter=require(_0x681a('0x0'));var WhatsappAccount=require(_0x681a('0x1'))['db'][_0x681a('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x681a('0x3')](0x0);var events={'afterCreate':_0x681a('0x4'),'afterUpdate':_0x681a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1e22f1){return function(_0x3217ff,_0x39b464,_0x46c75b){WhatsappAccountEvents[_0x681a('0x6')](_0x1e22f1+':'+_0x3217ff['id'],_0x3217ff);WhatsappAccountEvents[_0x681a('0x6')](_0x1e22f1,_0x3217ff);_0x46c75b(null);};}for(var e in events){if(events[_0x681a('0x7')](e)){var event=events[e];WhatsappAccount[_0x681a('0x8')](e,emitEvent(event));}}module[_0x681a('0x9')]=WhatsappAccountEvents; \ No newline at end of file +var _0x5b73=['../../mysqldb','WhatsappAccount','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3bea89,_0x450dea){var _0x30c612=function(_0x2ff672){while(--_0x2ff672){_0x3bea89['push'](_0x3bea89['shift']());}};_0x30c612(++_0x450dea);}(_0x5b73,0x120));var _0x35b7=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0x5b73[_0x50e593];return _0x3821d0;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x35b7('0x0'))['db'][_0x35b7('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x35b7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x35b7('0x3'),'afterDestroy':_0x35b7('0x4')};function emitEvent(_0xeb23cd){return function(_0x5b1063,_0x1f046a,_0x1a21d4){WhatsappAccountEvents[_0x35b7('0x5')](_0xeb23cd+':'+_0x5b1063['id'],_0x5b1063);WhatsappAccountEvents['emit'](_0xeb23cd,_0x5b1063);_0x1a21d4(null);};}for(var e in events){if(events[_0x35b7('0x6')](e)){var event=events[e];WhatsappAccount[_0x35b7('0x7')](e,emitEvent(event));}}module[_0x35b7('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index ca527fc..17fe95b 100644 --- a/server/api/whatsappAccount/whatsappAccount.model.js +++ b/server/api/whatsappAccount/whatsappAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x262f=['request-promise','path','./whatsappAccount.attributes','whatsapp_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x582f6f,_0x39d0ce){var _0x6efd70=function(_0x412f4f){while(--_0x412f4f){_0x582f6f['push'](_0x582f6f['shift']());}};_0x6efd70(++_0x39d0ce);}(_0x262f,0x67));var _0xf262=function(_0x75f0e3,_0xf48e93){_0x75f0e3=_0x75f0e3-0x0;var _0x3d535b=_0x262f[_0x75f0e3];return _0x3d535b;};'use strict';var _=require(_0xf262('0x0'));var util=require('util');var logger=require(_0xf262('0x1'))(_0xf262('0x2'));var moment=require(_0xf262('0x3'));var BPromise=require(_0xf262('0x4'));var rp=require(_0xf262('0x5'));var fs=require('fs');var path=require(_0xf262('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf262('0x7'));module['exports']=function(_0x2e1631,_0x400709){return _0x2e1631['define']('WhatsappAccount',attributes,{'tableName':_0xf262('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6872=['lodash','api','moment','bluebird','request-promise','rimraf','exports','define','WhatsappAccount','whatsapp_accounts'];(function(_0x42f34c,_0x190ed2){var _0xf9fb24=function(_0x2f5f2b){while(--_0x2f5f2b){_0x42f34c['push'](_0x42f34c['shift']());}};_0xf9fb24(++_0x190ed2);}(_0x6872,0x6e));var _0x2687=function(_0x176329,_0x568c84){_0x176329=_0x176329-0x0;var _0x31997c=_0x6872[_0x176329];return _0x31997c;};'use strict';var _=require(_0x2687('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2687('0x1'));var moment=require(_0x2687('0x2'));var BPromise=require(_0x2687('0x3'));var rp=require(_0x2687('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2687('0x5'));var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module[_0x2687('0x6')]=function(_0x335d26,_0x32f833){return _0x335d26[_0x2687('0x7')](_0x2687('0x8'),attributes,{'tableName':_0x2687('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.rpc.js b/server/api/whatsappAccount/whatsappAccount.rpc.js index f4e9e75..fa3ae53 100644 --- a/server/api/whatsappAccount/whatsappAccount.rpc.js +++ b/server/api/whatsappAccount/whatsappAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5272=['debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','find','options','raw','where','include','map','model','attributes','ShowWhatsappAccount','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','request','then','info','WhatsappAccount,\x20%s,\x20%s'];(function(_0x41c9f2,_0x3dc2c0){var _0x2fb75d=function(_0xb78361){while(--_0xb78361){_0x41c9f2['push'](_0x41c9f2['shift']());}};_0x2fb75d(++_0x3dc2c0);}(_0x5272,0x14a));var _0x2527=function(_0x475927,_0x4b0be7){_0x475927=_0x475927-0x0;var _0x19e8f3=_0x5272[_0x475927];return _0x19e8f3;};'use strict';var _=require(_0x2527('0x0'));var util=require(_0x2527('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2527('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2527('0x3'))['db'];var utils=require(_0x2527('0x4'));var logger=require(_0x2527('0x5'))(_0x2527('0x6'));var config=require(_0x2527('0x7'));var jayson=require(_0x2527('0x8'));var client=jayson[_0x2527('0x9')][_0x2527('0xa')]({'port':0x232a});config[_0x2527('0xb')]=_[_0x2527('0xc')](config[_0x2527('0xb')],{'host':_0x2527('0xd'),'port':0x18eb});var socket=require(_0x2527('0xe'))(new Redis(config['redis']));require(_0x2527('0xf'))[_0x2527('0x10')](socket);function respondWithRpcPromise(_0x194d35,_0xc3af22,_0x40732c){return new BPromise(function(_0x3b01f2,_0x42d07e){return client[_0x2527('0x11')](_0x194d35,_0x40732c)[_0x2527('0x12')](function(_0x1c2a50){logger[_0x2527('0x13')](_0x2527('0x14'),_0xc3af22,'request\x20sent');logger[_0x2527('0x15')](_0x2527('0x16'),_0xc3af22,_0x2527('0x17'),JSON[_0x2527('0x18')](_0x1c2a50));if(_0x1c2a50[_0x2527('0x19')]){if(_0x1c2a50['error'][_0x2527('0x1a')]===0x1f4){logger[_0x2527('0x19')](_0x2527('0x14'),_0xc3af22,_0x1c2a50[_0x2527('0x19')][_0x2527('0x1b')]);return _0x42d07e(_0x1c2a50[_0x2527('0x19')][_0x2527('0x1b')]);}logger[_0x2527('0x19')](_0x2527('0x14'),_0xc3af22,_0x1c2a50[_0x2527('0x19')][_0x2527('0x1b')]);return _0x3b01f2(_0x1c2a50[_0x2527('0x19')]['message']);}else{logger[_0x2527('0x13')](_0x2527('0x14'),_0xc3af22,_0x2527('0x17'));_0x3b01f2(_0x1c2a50[_0x2527('0x1c')][_0x2527('0x1b')]);}})[_0x2527('0x1d')](function(_0x372b4f){logger[_0x2527('0x19')]('WhatsappAccount,\x20%s,\x20%s',_0xc3af22,_0x372b4f);_0x42d07e(_0x372b4f);});});}exports['ShowWhatsappAccount']=function(_0x243959){var _0x2b6f74=this;return new Promise(function(_0xeba6e7,_0xbb70a1){return db['WhatsappAccount'][_0x2527('0x1e')]({'raw':_0x243959['options']?_0x243959[_0x2527('0x1f')][_0x2527('0x20')]===undefined?!![]:![]:!![],'where':_0x243959[_0x2527('0x1f')]?_0x243959[_0x2527('0x1f')][_0x2527('0x21')]||null:null,'attributes':_0x243959[_0x2527('0x1f')]?_0x243959[_0x2527('0x1f')]['attributes']||null:null,'include':_0x243959['options']?_0x243959[_0x2527('0x1f')][_0x2527('0x22')]?_[_0x2527('0x23')](_0x243959['options'][_0x2527('0x22')],function(_0x515a6e){return{'model':db[_0x515a6e[_0x2527('0x24')]],'as':_0x515a6e['as'],'attributes':_0x515a6e[_0x2527('0x25')],'include':_0x515a6e[_0x2527('0x22')]?_[_0x2527('0x23')](_0x515a6e[_0x2527('0x22')],function(_0x5af1d6){return{'model':db[_0x5af1d6['model']],'as':_0x5af1d6['as'],'attributes':_0x5af1d6['attributes'],'include':_0x5af1d6['include']?_[_0x2527('0x23')](_0x5af1d6[_0x2527('0x22')],function(_0x54b9f9){return{'model':db[_0x54b9f9['model']],'as':_0x54b9f9['as'],'attributes':_0x54b9f9['attributes']};}):[]};}):[]};}):[]:[]})[_0x2527('0x12')](function(_0x3a6858){logger[_0x2527('0x13')](_0x2527('0x26'),_0x243959);logger['debug'](_0x2527('0x26'),_0x243959,JSON[_0x2527('0x18')](_0x3a6858));_0xeba6e7(_0x3a6858);})[_0x2527('0x1d')](function(_0x21f7d6){logger['error']('ShowWhatsappAccount',_0x21f7d6[_0x2527('0x1b')],_0x243959);_0xbb70a1(_0x2b6f74[_0x2527('0x19')](0x1f4,_0x21f7d6[_0x2527('0x1b')]));});});}; \ No newline at end of file +var _0x9feb=['../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','request','then','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappAccount,\x20%s,\x20%s','ShowWhatsappAccount','WhatsappAccount','find','options','raw','attributes','include','map','model','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x53711b,_0x4be77a){var _0x29f455=function(_0x562f16){while(--_0x562f16){_0x53711b['push'](_0x53711b['shift']());}};_0x29f455(++_0x4be77a);}(_0x9feb,0x1c0));var _0xb9fe=function(_0x3dd567,_0x276ca9){_0x3dd567=_0x3dd567-0x0;var _0x415024=_0x9feb[_0x3dd567];return _0x415024;};'use strict';var _=require(_0xb9fe('0x0'));var util=require(_0xb9fe('0x1'));var moment=require(_0xb9fe('0x2'));var BPromise=require(_0xb9fe('0x3'));var rs=require(_0xb9fe('0x4'));var fs=require('fs');var Redis=require(_0xb9fe('0x5'));var db=require(_0xb9fe('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb9fe('0x7'))(_0xb9fe('0x8'));var config=require(_0xb9fe('0x9'));var jayson=require(_0xb9fe('0xa'));var client=jayson['client'][_0xb9fe('0xb')]({'port':0x232a});config[_0xb9fe('0xc')]=_[_0xb9fe('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb9fe('0xe'))(new Redis(config[_0xb9fe('0xc')]));require('./whatsappAccount.socket')[_0xb9fe('0xf')](socket);function respondWithRpcPromise(_0x545b9b,_0x35b640,_0x5822b6){return new BPromise(function(_0x24ea90,_0x1dd843){return client[_0xb9fe('0x10')](_0x545b9b,_0x5822b6)[_0xb9fe('0x11')](function(_0x3649d1){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x35b640,_0xb9fe('0x12'));logger['debug'](_0xb9fe('0x13'),_0x35b640,_0xb9fe('0x12'),JSON[_0xb9fe('0x14')](_0x3649d1));if(_0x3649d1[_0xb9fe('0x15')]){if(_0x3649d1[_0xb9fe('0x15')][_0xb9fe('0x16')]===0x1f4){logger[_0xb9fe('0x15')]('WhatsappAccount,\x20%s,\x20%s',_0x35b640,_0x3649d1['error'][_0xb9fe('0x17')]);return _0x1dd843(_0x3649d1[_0xb9fe('0x15')][_0xb9fe('0x17')]);}logger[_0xb9fe('0x15')](_0xb9fe('0x18'),_0x35b640,_0x3649d1['error'][_0xb9fe('0x17')]);return _0x24ea90(_0x3649d1[_0xb9fe('0x15')][_0xb9fe('0x17')]);}else{logger['info'](_0xb9fe('0x18'),_0x35b640,_0xb9fe('0x12'));_0x24ea90(_0x3649d1['result']['message']);}})['catch'](function(_0x1fa7d0){logger[_0xb9fe('0x15')](_0xb9fe('0x18'),_0x35b640,_0x1fa7d0);_0x1dd843(_0x1fa7d0);});});}exports[_0xb9fe('0x19')]=function(_0x13e68a){var _0x50e91b=this;return new Promise(function(_0x32c3f8,_0x416f13){return db[_0xb9fe('0x1a')][_0xb9fe('0x1b')]({'raw':_0x13e68a[_0xb9fe('0x1c')]?_0x13e68a[_0xb9fe('0x1c')][_0xb9fe('0x1d')]===undefined?!![]:![]:!![],'where':_0x13e68a['options']?_0x13e68a['options']['where']||null:null,'attributes':_0x13e68a[_0xb9fe('0x1c')]?_0x13e68a[_0xb9fe('0x1c')][_0xb9fe('0x1e')]||null:null,'include':_0x13e68a['options']?_0x13e68a['options'][_0xb9fe('0x1f')]?_[_0xb9fe('0x20')](_0x13e68a[_0xb9fe('0x1c')][_0xb9fe('0x1f')],function(_0xd4310c){return{'model':db[_0xd4310c[_0xb9fe('0x21')]],'as':_0xd4310c['as'],'attributes':_0xd4310c[_0xb9fe('0x1e')],'include':_0xd4310c[_0xb9fe('0x1f')]?_['map'](_0xd4310c[_0xb9fe('0x1f')],function(_0x31ad43){return{'model':db[_0x31ad43[_0xb9fe('0x21')]],'as':_0x31ad43['as'],'attributes':_0x31ad43['attributes'],'include':_0x31ad43[_0xb9fe('0x1f')]?_[_0xb9fe('0x20')](_0x31ad43['include'],function(_0x5c9cf4){return{'model':db[_0x5c9cf4[_0xb9fe('0x21')]],'as':_0x5c9cf4['as'],'attributes':_0x5c9cf4[_0xb9fe('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb9fe('0x11')](function(_0x499d59){logger[_0xb9fe('0x22')]('ShowWhatsappAccount',_0x13e68a);logger['debug'](_0xb9fe('0x19'),_0x13e68a,JSON[_0xb9fe('0x14')](_0x499d59));_0x32c3f8(_0x499d59);})['catch'](function(_0x49ed4c){logger['error'](_0xb9fe('0x19'),_0x49ed4c[_0xb9fe('0x17')],_0x13e68a);_0x416f13(_0x50e91b['error'](0x1f4,_0x49ed4c[_0xb9fe('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 7a0e481..d6d2c8b 100644 --- a/server/api/whatsappAccount/whatsappAccount.socket.js +++ b/server/api/whatsappAccount/whatsappAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6c57=['remove','update','removeListener','length','whatsappAccount:','./whatsappAccount.events','save'];(function(_0x318ab8,_0x151ef9){var _0x49886a=function(_0x1c3263){while(--_0x1c3263){_0x318ab8['push'](_0x318ab8['shift']());}};_0x49886a(++_0x151ef9);}(_0x6c57,0x140));var _0x76c5=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x6c57[_0x134c2e];return _0x2825db;};'use strict';var WhatsappAccountEvents=require(_0x76c5('0x0'));var events=[_0x76c5('0x1'),_0x76c5('0x2'),_0x76c5('0x3')];function createListener(_0x40f2e8,_0x2d3743){return function(_0xbd912c){_0x2d3743['emit'](_0x40f2e8,_0xbd912c);};}function removeListener(_0x3f3672,_0x48f7dc){return function(){WhatsappAccountEvents[_0x76c5('0x4')](_0x3f3672,_0x48f7dc);};}exports['register']=function(_0x5ade1a){for(var _0x3fb969=0x0,_0x4452f8=events[_0x76c5('0x5')];_0x3fb969<_0x4452f8;_0x3fb969++){var _0x5c2a5d=events[_0x3fb969];var _0x563d9b=createListener(_0x76c5('0x6')+_0x5c2a5d,_0x5ade1a);WhatsappAccountEvents['on'](_0x5c2a5d,_0x563d9b);}}; \ No newline at end of file +var _0x1001=['update','emit','removeListener','length','./whatsappAccount.events','save','remove'];(function(_0x5c0887,_0x403b13){var _0x5ca591=function(_0x38aadb){while(--_0x38aadb){_0x5c0887['push'](_0x5c0887['shift']());}};_0x5ca591(++_0x403b13);}(_0x1001,0xe4));var _0x1100=function(_0x37b6ae,_0x4972a6){_0x37b6ae=_0x37b6ae-0x0;var _0x137b4e=_0x1001[_0x37b6ae];return _0x137b4e;};'use strict';var WhatsappAccountEvents=require(_0x1100('0x0'));var events=[_0x1100('0x1'),_0x1100('0x2'),_0x1100('0x3')];function createListener(_0x17a56e,_0x1c5108){return function(_0x47e13f){_0x1c5108[_0x1100('0x4')](_0x17a56e,_0x47e13f);};}function removeListener(_0x298966,_0x552c15){return function(){WhatsappAccountEvents[_0x1100('0x5')](_0x298966,_0x552c15);};}exports['register']=function(_0x750b74){for(var _0x257579=0x0,_0x551108=events[_0x1100('0x6')];_0x257579<_0x551108;_0x257579++){var _0x56893e=events[_0x257579];var _0x30401d=createListener('whatsappAccount:'+_0x56893e,_0x750b74);WhatsappAccountEvents['on'](_0x56893e,_0x30401d);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 39f9be9..5864906 100644 --- a/server/api/whatsappApplication/index.js +++ b/server/api/whatsappApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7dc9=['./whatsappApplication.controller','isAuthenticated','index','/:id','show','post','create','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4a9973,_0x5228c3){var _0x4695f0=function(_0x30c21f){while(--_0x30c21f){_0x4a9973['push'](_0x4a9973['shift']());}};_0x4695f0(++_0x5228c3);}(_0x7dc9,0x139));var _0x97dc=function(_0x292eb9,_0x4807f8){_0x292eb9=_0x292eb9-0x0;var _0x30f4af=_0x7dc9[_0x292eb9];return _0x30f4af;};'use strict';var multer=require(_0x97dc('0x0'));var util=require(_0x97dc('0x1'));var path=require(_0x97dc('0x2'));var timeout=require(_0x97dc('0x3'));var express=require(_0x97dc('0x4'));var router=express[_0x97dc('0x5')]();var fs_extra=require(_0x97dc('0x6'));var auth=require(_0x97dc('0x7'));var interaction=require(_0x97dc('0x8'));var config=require(_0x97dc('0x9'));var controller=require(_0x97dc('0xa'));router['get']('/',auth[_0x97dc('0xb')](),controller[_0x97dc('0xc')]);router['get'](_0x97dc('0xd'),auth[_0x97dc('0xb')](),controller[_0x97dc('0xe')]);router[_0x97dc('0xf')]('/',auth[_0x97dc('0xb')](),controller[_0x97dc('0x10')]);router['put'](_0x97dc('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x97dc('0xd'),auth[_0x97dc('0xb')](),controller[_0x97dc('0x11')]);module[_0x97dc('0x12')]=router; \ No newline at end of file +var _0xd953=['isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','get'];(function(_0xd22241,_0x3a9d8b){var _0x1fc020=function(_0x5ed440){while(--_0x5ed440){_0xd22241['push'](_0xd22241['shift']());}};_0x1fc020(++_0x3a9d8b);}(_0xd953,0xe7));var _0x3d95=function(_0x5ac8a0,_0x46420b){_0x5ac8a0=_0x5ac8a0-0x0;var _0x1401fd=_0xd953[_0x5ac8a0];return _0x1401fd;};'use strict';var multer=require('multer');var util=require(_0x3d95('0x0'));var path=require(_0x3d95('0x1'));var timeout=require(_0x3d95('0x2'));var express=require(_0x3d95('0x3'));var router=express[_0x3d95('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3d95('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappApplication.controller');router[_0x3d95('0x6')]('/',auth[_0x3d95('0x7')](),controller['index']);router['get'](_0x3d95('0x8'),auth['isAuthenticated'](),controller[_0x3d95('0x9')]);router[_0x3d95('0xa')]('/',auth['isAuthenticated'](),controller[_0x3d95('0xb')]);router[_0x3d95('0xc')](_0x3d95('0x8'),auth[_0x3d95('0x7')](),controller[_0x3d95('0xd')]);router[_0x3d95('0xe')](_0x3d95('0x8'),auth[_0x3d95('0x7')](),controller[_0x3d95('0xf')]);module[_0x3d95('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index bc8d44b..5db110c 100644 --- a/server/api/whatsappApplication/whatsappApplication.attributes.js +++ b/server/api/whatsappApplication/whatsappApplication.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x187b=['INTEGER','STRING','*,*,*,*','sequelize','exports'];(function(_0x40998b,_0x38b1c5){var _0xb33ab8=function(_0xbee60e){while(--_0xbee60e){_0x40998b['push'](_0x40998b['shift']());}};_0xb33ab8(++_0x38b1c5);}(_0x187b,0x12a));var _0xb187=function(_0x16a035,_0x2d520d){_0x16a035=_0x16a035-0x0;var _0x32749a=_0x187b[_0x16a035];return _0x32749a;};'use strict';var Sequelize=require(_0xb187('0x0'));module[_0xb187('0x1')]={'priority':{'type':Sequelize[_0xb187('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xb187('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xb187('0x3')]},'interval':{'type':Sequelize[_0xb187('0x3')],'defaultValue':_0xb187('0x4')}}; \ No newline at end of file +var _0x3542=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x581249,_0x483f03){var _0x284bae=function(_0x2faadd){while(--_0x2faadd){_0x581249['push'](_0x581249['shift']());}};_0x284bae(++_0x483f03);}(_0x3542,0xc3));var _0x2354=function(_0x53afe9,_0x2c9f40){_0x53afe9=_0x53afe9-0x0;var _0x396396=_0x3542[_0x53afe9];return _0x396396;};'use strict';var Sequelize=require(_0x2354('0x0'));module[_0x2354('0x1')]={'priority':{'type':Sequelize[_0x2354('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x2354('0x3')],'allowNull':![],'defaultValue':_0x2354('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x2354('0x3')]},'interval':{'type':Sequelize[_0x2354('0x3')],'defaultValue':_0x2354('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index f5d66f5..dc0128a 100644 --- a/server/api/whatsappApplication/whatsappApplication.controller.js +++ b/server/api/whatsappApplication/whatsappApplication.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1bb4=['sendStatus','status','offset','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','WhatsappApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x527dc5,_0x1de7e7){var _0x216de9=function(_0xde9c52){while(--_0xde9c52){_0x527dc5['push'](_0x527dc5['shift']());}};_0x216de9(++_0x1de7e7);}(_0x1bb4,0x1c7));var _0x41bb=function(_0x4e406f,_0x526785){_0x4e406f=_0x4e406f-0x0;var _0x456590=_0x1bb4[_0x4e406f];return _0x456590;};'use strict';var emlformat=require(_0x41bb('0x0'));var rimraf=require(_0x41bb('0x1'));var zipdir=require(_0x41bb('0x2'));var jsonpatch=require(_0x41bb('0x3'));var rp=require(_0x41bb('0x4'));var moment=require('moment');var BPromise=require(_0x41bb('0x5'));var Mustache=require('mustache');var util=require(_0x41bb('0x6'));var path=require('path');var sox=require(_0x41bb('0x7'));var csv=require('to-csv');var ejs=require(_0x41bb('0x8'));var fs=require('fs');var fs_extra=require(_0x41bb('0x9'));var _=require(_0x41bb('0xa'));var squel=require('squel');var crypto=require(_0x41bb('0xb'));var jsforce=require(_0x41bb('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x41bb('0xd'));var querystring=require(_0x41bb('0xe'));var Papa=require(_0x41bb('0xf'));var Redis=require('ioredis');var authService=require(_0x41bb('0x10'));var qs=require(_0x41bb('0x11'));var as=require(_0x41bb('0x12'));var hardwareService=require(_0x41bb('0x13'));var logger=require(_0x41bb('0x14'))('api');var utils=require(_0x41bb('0x15'));var config=require(_0x41bb('0x16'));var licenseUtil=require(_0x41bb('0x17'));var db=require(_0x41bb('0x18'))['db'];function respondWithStatusCode(_0x28c08a,_0x233473){_0x233473=_0x233473||0xcc;return function(_0x1f4b78){if(_0x1f4b78){return _0x28c08a[_0x41bb('0x19')](_0x233473);}return _0x28c08a['status'](_0x233473)['end']();};}function respondWithResult(_0x4bfeae,_0x43fd1f){_0x43fd1f=_0x43fd1f||0xc8;return function(_0x46a7ec){if(_0x46a7ec){return _0x4bfeae[_0x41bb('0x1a')](_0x43fd1f)['json'](_0x46a7ec);}};}function respondWithFilteredResult(_0x514d8f,_0x18bf70){return function(_0xa66c46){if(_0xa66c46){var _0xfa8f14=typeof _0x18bf70[_0x41bb('0x1b')]===_0x41bb('0x1c')&&typeof _0x18bf70['limit']===_0x41bb('0x1c');var _0x5a8de5=_0xa66c46[_0x41bb('0x1d')];var _0x3fa4a4=_0xfa8f14?0x0:_0x18bf70['offset'];var _0xc202d0=_0xfa8f14?_0xa66c46[_0x41bb('0x1d')]:_0x18bf70['offset']+_0x18bf70['limit'];var _0x3755d7;if(_0xc202d0>=_0x5a8de5){_0xc202d0=_0x5a8de5;_0x3755d7=0xc8;}else{_0x3755d7=0xce;}_0x514d8f['status'](_0x3755d7);return _0x514d8f[_0x41bb('0x1e')](_0x41bb('0x1f'),_0x3fa4a4+'-'+_0xc202d0+'/'+_0x5a8de5)[_0x41bb('0x20')](_0xa66c46);}return null;};}function patchUpdates(_0x2be518){return function(_0x2765e7){try{jsonpatch[_0x41bb('0x21')](_0x2765e7,_0x2be518,!![]);}catch(_0x44d02d){return BPromise[_0x41bb('0x22')](_0x44d02d);}return _0x2765e7[_0x41bb('0x23')]();};}function saveUpdates(_0x407480,_0x5bd58f){return function(_0x29b356){if(_0x29b356){return _0x29b356[_0x41bb('0x24')](_0x407480)[_0x41bb('0x25')](function(_0x177209){return _0x177209;});}return null;};}function removeEntity(_0x54ec2a,_0x4d065e){return function(_0x1a43ad){if(_0x1a43ad){return _0x1a43ad[_0x41bb('0x26')]()[_0x41bb('0x25')](function(){_0x54ec2a['status'](0xcc)[_0x41bb('0x27')]();});}};}function handleEntityNotFound(_0x19bd28,_0x592239){return function(_0x310f09){if(!_0x310f09){_0x19bd28[_0x41bb('0x19')](0x194);}return _0x310f09;};}function handleError(_0x20ebe6,_0x2fba16){_0x2fba16=_0x2fba16||0x1f4;return function(_0x440d33){logger[_0x41bb('0x28')](_0x440d33[_0x41bb('0x29')]);if(_0x440d33[_0x41bb('0x2a')]){delete _0x440d33[_0x41bb('0x2a')];}_0x20ebe6[_0x41bb('0x1a')](_0x2fba16)[_0x41bb('0x2b')](_0x440d33);};}exports[_0x41bb('0x2c')]=function(_0x430131,_0x16b1f6){var _0x148ea5={},_0x4645c8={},_0x501f78={'count':0x0,'rows':[]};var _0x32af99=_[_0x41bb('0x2d')](db[_0x41bb('0x2e')][_0x41bb('0x2f')],function(_0x3a3d23){return{'name':_0x3a3d23[_0x41bb('0x30')],'type':_0x3a3d23[_0x41bb('0x31')][_0x41bb('0x32')]};});_0x4645c8[_0x41bb('0x33')]=_[_0x41bb('0x2d')](_0x32af99,_0x41bb('0x2a'));_0x4645c8[_0x41bb('0x34')]=_[_0x41bb('0x35')](_0x430131[_0x41bb('0x34')]);_0x4645c8[_0x41bb('0x36')]=_[_0x41bb('0x37')](_0x4645c8['model'],_0x4645c8[_0x41bb('0x34')]);_0x148ea5[_0x41bb('0x38')]=_[_0x41bb('0x37')](_0x4645c8[_0x41bb('0x33')],qs[_0x41bb('0x39')](_0x430131[_0x41bb('0x34')][_0x41bb('0x39')]));_0x148ea5['attributes']=_0x148ea5['attributes'][_0x41bb('0x3a')]?_0x148ea5[_0x41bb('0x38')]:_0x4645c8[_0x41bb('0x33')];if(!_0x430131[_0x41bb('0x34')][_0x41bb('0x3b')](_0x41bb('0x3c'))){_0x148ea5[_0x41bb('0x3d')]=qs[_0x41bb('0x3d')](_0x430131['query']['limit']);_0x148ea5['offset']=qs[_0x41bb('0x1b')](_0x430131[_0x41bb('0x34')][_0x41bb('0x1b')]);}_0x148ea5[_0x41bb('0x3e')]=qs[_0x41bb('0x3f')](_0x430131['query'][_0x41bb('0x3f')]);_0x148ea5[_0x41bb('0x40')]=qs[_0x41bb('0x36')](_[_0x41bb('0x41')](_0x430131[_0x41bb('0x34')],_0x4645c8[_0x41bb('0x36')]),_0x32af99);if(_0x430131[_0x41bb('0x34')][_0x41bb('0x42')]){_0x148ea5[_0x41bb('0x40')]=_[_0x41bb('0x43')](_0x148ea5['where'],{'$or':_['map'](_0x32af99,function(_0x5f22eb){if(_0x5f22eb[_0x41bb('0x31')]!==_0x41bb('0x44')){var _0x3ac009={};_0x3ac009[_0x5f22eb[_0x41bb('0x2a')]]={'$like':'%'+_0x430131['query'][_0x41bb('0x42')]+'%'};return _0x3ac009;}})});}_0x148ea5=_[_0x41bb('0x43')]({},_0x148ea5,_0x430131['options']);var _0x4df15e={'where':_0x148ea5[_0x41bb('0x40')]};return db[_0x41bb('0x2e')]['count'](_0x4df15e)[_0x41bb('0x25')](function(_0x4aa5dc){_0x501f78[_0x41bb('0x1d')]=_0x4aa5dc;if(_0x430131[_0x41bb('0x34')][_0x41bb('0x45')]){_0x148ea5[_0x41bb('0x46')]=[{'all':!![]}];}return db[_0x41bb('0x2e')][_0x41bb('0x47')](_0x148ea5);})[_0x41bb('0x25')](function(_0x4e0c7d){_0x501f78[_0x41bb('0x48')]=_0x4e0c7d;return _0x501f78;})[_0x41bb('0x25')](respondWithFilteredResult(_0x16b1f6,_0x148ea5))['catch'](handleError(_0x16b1f6,null));};exports[_0x41bb('0x49')]=function(_0x14a908,_0x6a5364){var _0x59ed00={'raw':!![],'where':{'id':_0x14a908[_0x41bb('0x4a')]['id']}},_0x2deafc={};_0x2deafc[_0x41bb('0x33')]=_['keys'](db[_0x41bb('0x2e')][_0x41bb('0x2f')]);_0x2deafc[_0x41bb('0x34')]=_[_0x41bb('0x35')](_0x14a908[_0x41bb('0x34')]);_0x2deafc[_0x41bb('0x36')]=_[_0x41bb('0x37')](_0x2deafc[_0x41bb('0x33')],_0x2deafc['query']);_0x59ed00[_0x41bb('0x38')]=_[_0x41bb('0x37')](_0x2deafc[_0x41bb('0x33')],qs['fields'](_0x14a908[_0x41bb('0x34')][_0x41bb('0x39')]));_0x59ed00[_0x41bb('0x38')]=_0x59ed00[_0x41bb('0x38')][_0x41bb('0x3a')]?_0x59ed00[_0x41bb('0x38')]:_0x2deafc['model'];if(_0x14a908['query']['includeAll']){_0x59ed00[_0x41bb('0x46')]=[{'all':!![]}];}_0x59ed00=_[_0x41bb('0x43')]({},_0x59ed00,_0x14a908[_0x41bb('0x4b')]);return db['WhatsappApplication']['find'](_0x59ed00)['then'](handleEntityNotFound(_0x6a5364,null))[_0x41bb('0x25')](respondWithResult(_0x6a5364,null))[_0x41bb('0x4c')](handleError(_0x6a5364,null));};exports[_0x41bb('0x4d')]=function(_0x239a67,_0x69292a){return db[_0x41bb('0x2e')]['create'](_0x239a67[_0x41bb('0x4e')],{})[_0x41bb('0x25')](respondWithResult(_0x69292a,0xc9))[_0x41bb('0x4c')](handleError(_0x69292a,null));};exports['update']=function(_0x590f8f,_0x5d2e2e){if(_0x590f8f[_0x41bb('0x4e')]['id']){delete _0x590f8f[_0x41bb('0x4e')]['id'];}return db[_0x41bb('0x2e')][_0x41bb('0x4f')]({'where':{'id':_0x590f8f[_0x41bb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5d2e2e,null))[_0x41bb('0x25')](saveUpdates(_0x590f8f[_0x41bb('0x4e')],null))['then'](respondWithResult(_0x5d2e2e,null))[_0x41bb('0x4c')](handleError(_0x5d2e2e,null));};exports[_0x41bb('0x26')]=function(_0x45ef28,_0x57cd4c){return db[_0x41bb('0x2e')]['find']({'where':{'id':_0x45ef28[_0x41bb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x57cd4c,null))[_0x41bb('0x25')](removeEntity(_0x57cd4c,null))[_0x41bb('0x4c')](handleError(_0x57cd4c,null));}; \ No newline at end of file +var _0xd386=['../../config/logger','api','../../config/utils','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','destroy','then','end','error','name','send','index','WhatsappApplication','fieldName','model','map','query','keys','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','show','params','rawAttributes','filters','intersection','find','create','body','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0xaf660a,_0x31e141){var _0x9626e2=function(_0x31c7a3){while(--_0x31c7a3){_0xaf660a['push'](_0xaf660a['shift']());}};_0x9626e2(++_0x31e141);}(_0xd386,0x10c));var _0x6d38=function(_0x253673,_0x3287fb){_0x253673=_0x253673-0x0;var _0x259903=_0xd386[_0x253673];return _0x259903;};'use strict';var emlformat=require(_0x6d38('0x0'));var rimraf=require(_0x6d38('0x1'));var zipdir=require(_0x6d38('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d38('0x3'));var moment=require(_0x6d38('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6d38('0x5'));var util=require(_0x6d38('0x6'));var path=require(_0x6d38('0x7'));var sox=require(_0x6d38('0x8'));var csv=require('to-csv');var ejs=require(_0x6d38('0x9'));var fs=require('fs');var fs_extra=require(_0x6d38('0xa'));var _=require(_0x6d38('0xb'));var squel=require(_0x6d38('0xc'));var crypto=require(_0x6d38('0xd'));var jsforce=require(_0x6d38('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x6d38('0xf'));var querystring=require('querystring');var Papa=require(_0x6d38('0x10'));var Redis=require('ioredis');var authService=require(_0x6d38('0x11'));var qs=require(_0x6d38('0x12'));var as=require(_0x6d38('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6d38('0x14'))(_0x6d38('0x15'));var utils=require(_0x6d38('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1bde60,_0x2d904c){_0x2d904c=_0x2d904c||0xcc;return function(_0x1f75fa){if(_0x1f75fa){return _0x1bde60[_0x6d38('0x17')](_0x2d904c);}return _0x1bde60[_0x6d38('0x18')](_0x2d904c)['end']();};}function respondWithResult(_0xa01398,_0x499239){_0x499239=_0x499239||0xc8;return function(_0x8a13ed){if(_0x8a13ed){return _0xa01398[_0x6d38('0x18')](_0x499239)[_0x6d38('0x19')](_0x8a13ed);}};}function respondWithFilteredResult(_0x22a822,_0x30a7f5){return function(_0x49c7ac){if(_0x49c7ac){var _0x585db3=typeof _0x30a7f5['offset']===_0x6d38('0x1a')&&typeof _0x30a7f5[_0x6d38('0x1b')]===_0x6d38('0x1a');var _0xdc66e8=_0x49c7ac[_0x6d38('0x1c')];var _0x11298c=_0x585db3?0x0:_0x30a7f5['offset'];var _0x278829=_0x585db3?_0x49c7ac[_0x6d38('0x1c')]:_0x30a7f5[_0x6d38('0x1d')]+_0x30a7f5[_0x6d38('0x1b')];var _0x29a768;if(_0x278829>=_0xdc66e8){_0x278829=_0xdc66e8;_0x29a768=0xc8;}else{_0x29a768=0xce;}_0x22a822[_0x6d38('0x18')](_0x29a768);return _0x22a822[_0x6d38('0x1e')](_0x6d38('0x1f'),_0x11298c+'-'+_0x278829+'/'+_0xdc66e8)['json'](_0x49c7ac);}return null;};}function patchUpdates(_0x3da186){return function(_0x24680b){try{jsonpatch['apply'](_0x24680b,_0x3da186,!![]);}catch(_0x4b68a4){return BPromise[_0x6d38('0x20')](_0x4b68a4);}return _0x24680b[_0x6d38('0x21')]();};}function saveUpdates(_0x45708c,_0x153cae){return function(_0x593d66){if(_0x593d66){return _0x593d66[_0x6d38('0x22')](_0x45708c)['then'](function(_0x44ad2d){return _0x44ad2d;});}return null;};}function removeEntity(_0x52f608,_0x473895){return function(_0x509860){if(_0x509860){return _0x509860[_0x6d38('0x23')]()[_0x6d38('0x24')](function(){_0x52f608[_0x6d38('0x18')](0xcc)[_0x6d38('0x25')]();});}};}function handleEntityNotFound(_0x3c777a,_0x4fc364){return function(_0x5dfb0c){if(!_0x5dfb0c){_0x3c777a[_0x6d38('0x17')](0x194);}return _0x5dfb0c;};}function handleError(_0x7f5c61,_0x552e59){_0x552e59=_0x552e59||0x1f4;return function(_0x4f2769){logger[_0x6d38('0x26')](_0x4f2769['stack']);if(_0x4f2769['name']){delete _0x4f2769[_0x6d38('0x27')];}_0x7f5c61[_0x6d38('0x18')](_0x552e59)[_0x6d38('0x28')](_0x4f2769);};}exports[_0x6d38('0x29')]=function(_0x2b73af,_0x19a674){var _0x513f13={},_0x3e62cf={},_0x572648={'count':0x0,'rows':[]};var _0x19ab6e=_['map'](db[_0x6d38('0x2a')]['rawAttributes'],function(_0x2eddcc){return{'name':_0x2eddcc[_0x6d38('0x2b')],'type':_0x2eddcc['type']['key']};});_0x3e62cf[_0x6d38('0x2c')]=_[_0x6d38('0x2d')](_0x19ab6e,_0x6d38('0x27'));_0x3e62cf[_0x6d38('0x2e')]=_[_0x6d38('0x2f')](_0x2b73af[_0x6d38('0x2e')]);_0x3e62cf['filters']=_['intersection'](_0x3e62cf[_0x6d38('0x2c')],_0x3e62cf['query']);_0x513f13[_0x6d38('0x30')]=_['intersection'](_0x3e62cf[_0x6d38('0x2c')],qs[_0x6d38('0x31')](_0x2b73af[_0x6d38('0x2e')]['fields']));_0x513f13[_0x6d38('0x30')]=_0x513f13[_0x6d38('0x30')][_0x6d38('0x32')]?_0x513f13[_0x6d38('0x30')]:_0x3e62cf[_0x6d38('0x2c')];if(!_0x2b73af[_0x6d38('0x2e')][_0x6d38('0x33')](_0x6d38('0x34'))){_0x513f13[_0x6d38('0x1b')]=qs['limit'](_0x2b73af[_0x6d38('0x2e')][_0x6d38('0x1b')]);_0x513f13[_0x6d38('0x1d')]=qs['offset'](_0x2b73af['query'][_0x6d38('0x1d')]);}_0x513f13['order']=qs[_0x6d38('0x35')](_0x2b73af[_0x6d38('0x2e')][_0x6d38('0x35')]);_0x513f13[_0x6d38('0x36')]=qs['filters'](_[_0x6d38('0x37')](_0x2b73af['query'],_0x3e62cf['filters']),_0x19ab6e);if(_0x2b73af[_0x6d38('0x2e')][_0x6d38('0x38')]){_0x513f13['where']=_['merge'](_0x513f13[_0x6d38('0x36')],{'$or':_[_0x6d38('0x2d')](_0x19ab6e,function(_0x58b5bc){if(_0x58b5bc['type']!==_0x6d38('0x39')){var _0x4491c4={};_0x4491c4[_0x58b5bc['name']]={'$like':'%'+_0x2b73af['query'][_0x6d38('0x38')]+'%'};return _0x4491c4;}})});}_0x513f13=_[_0x6d38('0x3a')]({},_0x513f13,_0x2b73af[_0x6d38('0x3b')]);var _0x2a17a5={'where':_0x513f13[_0x6d38('0x36')]};return db[_0x6d38('0x2a')][_0x6d38('0x1c')](_0x2a17a5)['then'](function(_0x1f4732){_0x572648[_0x6d38('0x1c')]=_0x1f4732;if(_0x2b73af['query'][_0x6d38('0x3c')]){_0x513f13[_0x6d38('0x3d')]=[{'all':!![]}];}return db['WhatsappApplication']['findAll'](_0x513f13);})['then'](function(_0x5c789d){_0x572648[_0x6d38('0x3e')]=_0x5c789d;return _0x572648;})[_0x6d38('0x24')](respondWithFilteredResult(_0x19a674,_0x513f13))['catch'](handleError(_0x19a674,null));};exports[_0x6d38('0x3f')]=function(_0x16da57,_0x4ea04c){var _0x49f278={'raw':!![],'where':{'id':_0x16da57[_0x6d38('0x40')]['id']}},_0x26203c={};_0x26203c[_0x6d38('0x2c')]=_[_0x6d38('0x2f')](db['WhatsappApplication'][_0x6d38('0x41')]);_0x26203c[_0x6d38('0x2e')]=_[_0x6d38('0x2f')](_0x16da57[_0x6d38('0x2e')]);_0x26203c[_0x6d38('0x42')]=_[_0x6d38('0x43')](_0x26203c[_0x6d38('0x2c')],_0x26203c[_0x6d38('0x2e')]);_0x49f278[_0x6d38('0x30')]=_[_0x6d38('0x43')](_0x26203c['model'],qs[_0x6d38('0x31')](_0x16da57[_0x6d38('0x2e')][_0x6d38('0x31')]));_0x49f278[_0x6d38('0x30')]=_0x49f278['attributes'][_0x6d38('0x32')]?_0x49f278[_0x6d38('0x30')]:_0x26203c[_0x6d38('0x2c')];if(_0x16da57[_0x6d38('0x2e')][_0x6d38('0x3c')]){_0x49f278[_0x6d38('0x3d')]=[{'all':!![]}];}_0x49f278=_[_0x6d38('0x3a')]({},_0x49f278,_0x16da57[_0x6d38('0x3b')]);return db[_0x6d38('0x2a')][_0x6d38('0x44')](_0x49f278)[_0x6d38('0x24')](handleEntityNotFound(_0x4ea04c,null))['then'](respondWithResult(_0x4ea04c,null))['catch'](handleError(_0x4ea04c,null));};exports[_0x6d38('0x45')]=function(_0x5de7c4,_0x50f0c7){return db['WhatsappApplication'][_0x6d38('0x45')](_0x5de7c4[_0x6d38('0x46')],{})[_0x6d38('0x24')](respondWithResult(_0x50f0c7,0xc9))['catch'](handleError(_0x50f0c7,null));};exports[_0x6d38('0x22')]=function(_0x30bfc0,_0x492024){if(_0x30bfc0['body']['id']){delete _0x30bfc0[_0x6d38('0x46')]['id'];}return db['WhatsappApplication'][_0x6d38('0x44')]({'where':{'id':_0x30bfc0['params']['id']}})[_0x6d38('0x24')](handleEntityNotFound(_0x492024,null))[_0x6d38('0x24')](saveUpdates(_0x30bfc0[_0x6d38('0x46')],null))['then'](respondWithResult(_0x492024,null))[_0x6d38('0x47')](handleError(_0x492024,null));};exports[_0x6d38('0x23')]=function(_0x5ecb1c,_0x5389f6){return db[_0x6d38('0x2a')][_0x6d38('0x44')]({'where':{'id':_0x5ecb1c[_0x6d38('0x40')]['id']}})[_0x6d38('0x24')](handleEntityNotFound(_0x5389f6,null))[_0x6d38('0x24')](removeEntity(_0x5389f6,null))[_0x6d38('0x47')](handleError(_0x5389f6,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 8f43ec1..c40ca43 100644 --- a/server/api/whatsappApplication/whatsappApplication.model.js +++ b/server/api/whatsappApplication/whatsappApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4bc3=['utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define'];(function(_0x59eacf,_0x56ec4a){var _0x5d74f2=function(_0x5476ed){while(--_0x5476ed){_0x59eacf['push'](_0x59eacf['shift']());}};_0x5d74f2(++_0x56ec4a);}(_0x4bc3,0x16e));var _0x34bc=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x4bc3[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var logger=require('../../config/logger')(_0x34bc('0x2'));var moment=require(_0x34bc('0x3'));var BPromise=require('bluebird');var rp=require(_0x34bc('0x4'));var fs=require('fs');var path=require(_0x34bc('0x5'));var rimraf=require(_0x34bc('0x6'));var config=require(_0x34bc('0x7'));var attributes=require(_0x34bc('0x8'));module[_0x34bc('0x9')]=function(_0x2cc9c2,_0x4c63a1){return _0x2cc9c2[_0x34bc('0xa')]('WhatsappApplication',attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x34bc('0xb'),'collate':_0x34bc('0xc')});}; \ No newline at end of file +var _0xe132=['whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','define','WhatsappApplication'];(function(_0x1f9952,_0x50aceb){var _0x50f523=function(_0x7050dd){while(--_0x7050dd){_0x1f9952['push'](_0x1f9952['shift']());}};_0x50f523(++_0x50aceb);}(_0xe132,0x162));var _0x2e13=function(_0x4ff1ec,_0x18cac2){_0x4ff1ec=_0x4ff1ec-0x0;var _0xe872a8=_0xe132[_0x4ff1ec];return _0xe872a8;};'use strict';var _=require(_0x2e13('0x0'));var util=require('util');var logger=require(_0x2e13('0x1'))(_0x2e13('0x2'));var moment=require(_0x2e13('0x3'));var BPromise=require(_0x2e13('0x4'));var rp=require(_0x2e13('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2e13('0x6'));var config=require(_0x2e13('0x7'));var attributes=require('./whatsappApplication.attributes');module['exports']=function(_0x260dc1,_0x2f9d00){return _0x260dc1[_0x2e13('0x8')](_0x2e13('0x9'),attributes,{'tableName':_0x2e13('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x2e13('0xb'),'collate':_0x2e13('0xc')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 520e3b7..22cab25 100644 --- a/server/api/whatsappApplication/whatsappApplication.rpc.js +++ b/server/api/whatsappApplication/whatsappApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4c4e=['result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x565ac0,_0x559e8b){var _0x54d5c1=function(_0x19a345){while(--_0x19a345){_0x565ac0['push'](_0x565ac0['shift']());}};_0x54d5c1(++_0x559e8b);}(_0x4c4e,0x152));var _0xe4c4=function(_0x4957b6,_0x2ebb38){_0x4957b6=_0x4957b6-0x0;var _0x52f3ad=_0x4c4e[_0x4957b6];return _0x52f3ad;};'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')]('WhatsappApplication,\x20%s,\x20%s',_0xad105,_0x589b2e[_0xe4c4('0x10')][_0xe4c4('0x12')]);return _0x28a42e(_0x589b2e['error'][_0xe4c4('0x12')]);}logger[_0xe4c4('0x10')]('WhatsappApplication,\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 +var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','util'];(function(_0x154a85,_0xecc08f){var _0x848d62=function(_0x5b73b8){while(--_0x5b73b8){_0x154a85['push'](_0x154a85['shift']());}};_0x848d62(++_0xecc08f);}(_0xedd9,0xfc));var _0x9edd=function(_0x47618c,_0x1e977d){_0x47618c=_0x47618c-0x0;var _0x3fcce0=_0xedd9[_0x47618c];return _0x3fcce0;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('WhatsappApplication,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 6fef14e..65923d8 100644 --- a/server/api/whatsappInteraction/index.js +++ b/server/api/whatsappInteraction/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1b20=['getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','put','/:id','update','delete','destroy','removeTags','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','show','/:id/messages'];(function(_0x408d9d,_0x5eb151){var _0x36546c=function(_0x2ddb21){while(--_0x2ddb21){_0x408d9d['push'](_0x408d9d['shift']());}};_0x36546c(++_0x5eb151);}(_0x1b20,0x66));var _0x01b2=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x1b20[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x01b2('0x0'));var path=require(_0x01b2('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x01b2('0x2')]();var fs_extra=require(_0x01b2('0x3'));var auth=require(_0x01b2('0x4'));var interaction=require(_0x01b2('0x5'));var config=require(_0x01b2('0x6'));var controller=require(_0x01b2('0x7'));router[_0x01b2('0x8')]('/',auth[_0x01b2('0x9')](),controller[_0x01b2('0xa')]);router[_0x01b2('0x8')](_0x01b2('0xb'),auth[_0x01b2('0x9')](),controller['describe']);router[_0x01b2('0x8')]('/:id',auth[_0x01b2('0x9')](),controller[_0x01b2('0xc')]);router[_0x01b2('0x8')](_0x01b2('0xd'),auth[_0x01b2('0x9')](),controller[_0x01b2('0xe')]);router[_0x01b2('0x8')](_0x01b2('0xf'),auth['isAuthenticated'](),controller[_0x01b2('0x10')]);router['post']('/',auth[_0x01b2('0x9')](),controller['create']);router[_0x01b2('0x11')](_0x01b2('0xd'),auth[_0x01b2('0x9')](),controller[_0x01b2('0x12')]);router['post'](_0x01b2('0x13'),auth[_0x01b2('0x9')](),interaction[_0x01b2('0x14')](_0x01b2('0x15'),_0x01b2('0x16')),controller['addTags']);router[_0x01b2('0x17')](_0x01b2('0x18'),auth[_0x01b2('0x9')](),interaction[_0x01b2('0x14')]('whatsapp','whatsappinteraction:update'),controller[_0x01b2('0x19')]);router[_0x01b2('0x1a')]('/:id',auth[_0x01b2('0x9')](),interaction[_0x01b2('0x14')](_0x01b2('0x15'),'whatsappinteraction:destroy'),controller[_0x01b2('0x1b')]);router[_0x01b2('0x1a')](_0x01b2('0x13'),auth[_0x01b2('0x9')](),controller[_0x01b2('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xcf98=['tracked','whatsapp','whatsappinteraction:addtags','put','/:id','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','/:id/tags','removeTags','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post'];(function(_0x38e5c5,_0x2d2b27){var _0xc6c71a=function(_0x1820ff){while(--_0x1820ff){_0x38e5c5['push'](_0x38e5c5['shift']());}};_0xc6c71a(++_0x2d2b27);}(_0xcf98,0x8d));var _0x8cf9=function(_0x414cdd,_0xa02a57){_0x414cdd=_0x414cdd-0x0;var _0x319759=_0xcf98[_0x414cdd];return _0x319759;};'use strict';var multer=require('multer');var util=require(_0x8cf9('0x0'));var path=require(_0x8cf9('0x1'));var timeout=require(_0x8cf9('0x2'));var express=require(_0x8cf9('0x3'));var router=express[_0x8cf9('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8cf9('0x5'));var config=require(_0x8cf9('0x6'));var controller=require(_0x8cf9('0x7'));router[_0x8cf9('0x8')]('/',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xa')]);router[_0x8cf9('0x8')](_0x8cf9('0xb'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xc')]);router[_0x8cf9('0x8')]('/:id',auth[_0x8cf9('0x9')](),controller[_0x8cf9('0xd')]);router['get'](_0x8cf9('0xe'),auth['isAuthenticated'](),controller[_0x8cf9('0xf')]);router[_0x8cf9('0x8')](_0x8cf9('0x10'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x11')]);router[_0x8cf9('0x12')]('/',auth[_0x8cf9('0x9')](),controller['create']);router[_0x8cf9('0x12')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0x8cf9('0x12')]('/:id/tags',auth['isAuthenticated'](),interaction[_0x8cf9('0x13')](_0x8cf9('0x14'),_0x8cf9('0x15')),controller['addTags']);router[_0x8cf9('0x16')](_0x8cf9('0x17'),auth['isAuthenticated'](),interaction[_0x8cf9('0x13')](_0x8cf9('0x14'),_0x8cf9('0x18')),controller[_0x8cf9('0x19')]);router[_0x8cf9('0x1a')](_0x8cf9('0x17'),auth[_0x8cf9('0x9')](),interaction[_0x8cf9('0x13')](_0x8cf9('0x14'),_0x8cf9('0x1b')),controller[_0x8cf9('0x1c')]);router[_0x8cf9('0x1a')](_0x8cf9('0x1d'),auth[_0x8cf9('0x9')](),controller[_0x8cf9('0x1e')]);module[_0x8cf9('0x1f')]=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 073202f..fbfca76 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.attributes.js +++ b/server/api/whatsappInteraction/whatsappInteraction.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x29d4=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0x341098,_0x525fe5){var _0x4a39fc=function(_0x82bbdb){while(--_0x82bbdb){_0x341098['push'](_0x341098['shift']());}};_0x4a39fc(++_0x525fe5);}(_0x29d4,0x1a1));var _0x429d=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x29d4[_0x33032e];return _0x13316b;};'use strict';var Sequelize=require(_0x429d('0x0'));var moment=require('moment');module[_0x429d('0x1')]={'closed':{'type':Sequelize[_0x429d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x429d('0x3')]},'disposition':{'type':Sequelize[_0x429d('0x4')]},'secondDisposition':{'type':Sequelize[_0x429d('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x429d('0x4')]},'phone':{'type':Sequelize[_0x429d('0x4')]},'read1stAt':{'type':Sequelize[_0x429d('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x429d('0x5')]('in',_0x429d('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x429d('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x429d('0x5')]('in',_0x429d('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x71ab=['STRING','DATE','ENUM','out','moment','BOOLEAN'];(function(_0xd09ce5,_0x386206){var _0x290757=function(_0x1524b2){while(--_0x1524b2){_0xd09ce5['push'](_0xd09ce5['shift']());}};_0x290757(++_0x386206);}(_0x71ab,0x64));var _0xb71a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x71ab[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb71a('0x0'));module['exports']={'closed':{'type':Sequelize[_0xb71a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xb71a('0x2')]},'secondDisposition':{'type':Sequelize[_0xb71a('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb71a('0x2')]},'note':{'type':Sequelize[_0xb71a('0x2')]},'phone':{'type':Sequelize[_0xb71a('0x2')]},'read1stAt':{'type':Sequelize[_0xb71a('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xb71a('0x4')]('in',_0xb71a('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xb71a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xb71a('0x4')]('in',_0xb71a('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xb71a('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index 2e34385..feaa35d 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.controller.js +++ b/server/api/whatsappInteraction/whatsappInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8294=['error','name','send','WhatsappInteraction','key','getOptions','query','user','catch','params','model','keys','filters','intersection','attributes','fields','length','include','merge','options','create','body','update','find','describe','addMessage','WhatsappMessage','ids','findOne','rawAttributes','nolimit','order','sort','where','pick','filter','map','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','addTags','spread','Tag','color','emit','whatsappInteractionTags:save','removeTags','download','unix','toString','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','push','User','fullname','CmContact','Contact','firstName','Attachment','Messages','createdAt','read','Account','Owner','get','N.A.','closed','closedAt','disposition','basename','createReadStream','pipe','createWriteStream','direction','System','lastName','out','secret','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','unlinkSync','rimraf','zip-dir','bluebird','ejs','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','redis','defaults','socket.io-emitter','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','then','destroy','end'];(function(_0x12d2d7,_0x253ea8){var _0x1defcb=function(_0x4d42e4){while(--_0x4d42e4){_0x12d2d7['push'](_0x12d2d7['shift']());}};_0x1defcb(++_0x253ea8);}(_0x8294,0x1c6));var _0x4829=function(_0x1d004b,_0x31803a){_0x1d004b=_0x1d004b-0x0;var _0x64c34e=_0x8294[_0x1d004b];return _0x64c34e;};'use strict';var rimraf=require(_0x4829('0x0'));var zipdir=require(_0x4829('0x1'));var moment=require('moment');var BPromise=require(_0x4829('0x2'));var util=require('util');var path=require('path');var ejs=require(_0x4829('0x3'));var fs=require('fs');var _=require(_0x4829('0x4'));var Redis=require(_0x4829('0x5'));var interaction=require('../../components/interaction/service');var qs=require(_0x4829('0x6'));var pdf=require('../../components/export/pdf');var logger=require(_0x4829('0x7'))(_0x4829('0x8'));var config=require(_0x4829('0x9'));var db=require('../../mysqldb')['db'];config[_0x4829('0xa')]=_[_0x4829('0xb')](config[_0x4829('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x4829('0xc'))(new Redis(config[_0x4829('0xa')]));require('./whatsappInteraction.socket')[_0x4829('0xd')](socket);function respondWithStatusCode(_0x5e264c,_0x692720){_0x692720=_0x692720||0xcc;return function(_0x200885){if(_0x200885){return _0x5e264c[_0x4829('0xe')](_0x692720);}return _0x5e264c[_0x4829('0xf')](_0x692720)['end']();};}function respondWithResult(_0x154e49,_0xe938fb){_0xe938fb=_0xe938fb||0xc8;return function(_0x1d8089){if(_0x1d8089){return _0x154e49[_0x4829('0xf')](_0xe938fb)[_0x4829('0x10')](_0x1d8089);}};}function respondWithFilteredResult(_0x20620f,_0x5c304a){return function(_0x1ed308){if(_0x1ed308){var _0x2d6b30=typeof _0x5c304a[_0x4829('0x11')]===_0x4829('0x12')&&typeof _0x5c304a[_0x4829('0x13')]===_0x4829('0x12');var _0x42cb28=_0x1ed308['count'];var _0x207ff8=_0x2d6b30?0x0:_0x5c304a['offset'];var _0x2b61ae=_0x2d6b30?_0x1ed308[_0x4829('0x14')]:_0x5c304a[_0x4829('0x11')]+_0x5c304a['limit'];var _0x531355;if(_0x2b61ae>=_0x42cb28){_0x2b61ae=_0x42cb28;_0x531355=0xc8;}else{_0x531355=0xce;}_0x20620f[_0x4829('0xf')](_0x531355);return _0x20620f[_0x4829('0x15')](_0x4829('0x16'),_0x207ff8+'-'+_0x2b61ae+'/'+_0x42cb28)['json'](_0x1ed308);}return null;};}function saveUpdates(_0x53cd35){return function(_0x2c41a3){if(_0x2c41a3){return _0x2c41a3['update'](_0x53cd35)[_0x4829('0x17')](function(_0x3b6808){return _0x3b6808;});}return null;};}function removeEntity(_0x2b482c){return function(_0x2020f2){if(_0x2020f2){return _0x2020f2[_0x4829('0x18')]()['then'](function(){_0x2b482c['status'](0xcc)[_0x4829('0x19')]();});}};}function handleEntityNotFound(_0x1057c4){return function(_0x3b28ce){if(!_0x3b28ce){_0x1057c4[_0x4829('0xe')](0x194);}return _0x3b28ce;};}function handleError(_0x976f61,_0x26ee97){_0x26ee97=_0x26ee97||0x1f4;return function(_0x3f051e){logger[_0x4829('0x1a')](_0x3f051e['stack']);if(_0x3f051e[_0x4829('0x1b')]){delete _0x3f051e[_0x4829('0x1b')];}_0x976f61[_0x4829('0xf')](_0x26ee97)[_0x4829('0x1c')](_0x3f051e);};}exports['index']=function(_0x267ea9,_0x320ec){var _0x3add46={};var _0x5584bc=_['map'](db[_0x4829('0x1d')]['rawAttributes'],function(_0x44d140){return{'name':_0x44d140['fieldName'],'type':_0x44d140['type'][_0x4829('0x1e')]};});_0x3add46=qs[_0x4829('0x1f')](_0x5584bc,_0x267ea9);return interaction['findAll']('whatsapp',_0x267ea9[_0x4829('0x20')],_0x267ea9[_0x4829('0x21')],_0x3add46,_0x5584bc)[_0x4829('0x17')](respondWithFilteredResult(_0x320ec,_0x3add46))[_0x4829('0x22')](handleError(_0x320ec,null));};exports['show']=function(_0x1e5b8d,_0x42ec04){var _0x3b4617={'raw':![],'where':{'id':_0x1e5b8d[_0x4829('0x23')]['id']}},_0x502840={};_0x502840[_0x4829('0x24')]=_['keys'](db[_0x4829('0x1d')]['rawAttributes']);_0x502840[_0x4829('0x20')]=_[_0x4829('0x25')](_0x1e5b8d[_0x4829('0x20')]);_0x502840[_0x4829('0x26')]=_[_0x4829('0x27')](_0x502840['model'],_0x502840[_0x4829('0x20')]);_0x3b4617[_0x4829('0x28')]=_[_0x4829('0x27')](_0x502840['model'],qs[_0x4829('0x29')](_0x1e5b8d[_0x4829('0x20')]['fields']));_0x3b4617[_0x4829('0x28')]=_0x3b4617[_0x4829('0x28')][_0x4829('0x2a')]?_0x3b4617['attributes']:_0x502840['model'];if(_0x1e5b8d[_0x4829('0x20')]['includeAll']){_0x3b4617[_0x4829('0x2b')]=[{'all':!![]}];}_0x3b4617=_[_0x4829('0x2c')]({},_0x3b4617,_0x1e5b8d[_0x4829('0x2d')]);return db[_0x4829('0x1d')]['find'](_0x3b4617)[_0x4829('0x17')](handleEntityNotFound(_0x42ec04,null))[_0x4829('0x17')](respondWithResult(_0x42ec04,null))[_0x4829('0x22')](handleError(_0x42ec04,null));};exports[_0x4829('0x2e')]=function(_0x55fa67,_0x48ad5f){return db[_0x4829('0x1d')][_0x4829('0x2e')](_0x55fa67[_0x4829('0x2f')],{})[_0x4829('0x17')](respondWithResult(_0x48ad5f,0xc9))['catch'](handleError(_0x48ad5f,null));};exports[_0x4829('0x30')]=function(_0x5c09b9,_0x1dc520){if(_0x5c09b9[_0x4829('0x2f')]['id']){delete _0x5c09b9[_0x4829('0x2f')]['id'];}return db[_0x4829('0x1d')][_0x4829('0x31')]({'where':{'id':_0x5c09b9['params']['id']}})['then'](handleEntityNotFound(_0x1dc520,null))[_0x4829('0x17')](saveUpdates(_0x5c09b9[_0x4829('0x2f')],null))[_0x4829('0x17')](respondWithResult(_0x1dc520,null))[_0x4829('0x22')](handleError(_0x1dc520,null));};exports[_0x4829('0x18')]=function(_0x1ad29e,_0x550fb1){return db[_0x4829('0x1d')][_0x4829('0x31')]({'where':{'id':_0x1ad29e[_0x4829('0x23')]['id']}})[_0x4829('0x17')](handleEntityNotFound(_0x550fb1,null))[_0x4829('0x17')](removeEntity(_0x550fb1,null))[_0x4829('0x22')](handleError(_0x550fb1,null));};exports[_0x4829('0x32')]=function(_0x1985e9,_0x14be81){return db[_0x4829('0x1d')][_0x4829('0x32')]()[_0x4829('0x17')](respondWithResult(_0x14be81,null))['catch'](handleError(_0x14be81,null));};exports[_0x4829('0x33')]=function(_0x473d81,_0x410a02){return db[_0x4829('0x34')][_0x4829('0x31')]({'where':{'id':_0x473d81[_0x4829('0x23')]['id']}})['then'](handleEntityNotFound(_0x410a02,null))[_0x4829('0x17')](function(_0xd3d649){if(_0xd3d649){return _0xd3d649[_0x4829('0x33')](_0x473d81[_0x4829('0x2f')]['ids'],_['omit'](_0x473d81['body'],[_0x4829('0x35'),'id'])||{});}})[_0x4829('0x17')](respondWithResult(_0x410a02,null))[_0x4829('0x22')](handleError(_0x410a02,null));};exports['getMessages']=function(_0x1bcbf9,_0x475db6){var _0x29bcd1={'raw':![],'where':{}};var _0x5e0c82={};var _0x4c5e60={'count':0x0,'rows':[]};return db[_0x4829('0x1d')][_0x4829('0x36')]({'where':{'id':_0x1bcbf9[_0x4829('0x23')]['id']}})[_0x4829('0x17')](handleEntityNotFound(_0x475db6,null))[_0x4829('0x17')](function(_0x27d66a){if(_0x27d66a){_0x5e0c82[_0x4829('0x24')]=_[_0x4829('0x25')](db[_0x4829('0x34')][_0x4829('0x37')]);_0x5e0c82[_0x4829('0x20')]=_[_0x4829('0x25')](_0x1bcbf9[_0x4829('0x20')]);_0x5e0c82['filters']=_['intersection'](_0x5e0c82[_0x4829('0x24')],_0x5e0c82['query']);_0x29bcd1[_0x4829('0x28')]=_[_0x4829('0x27')](_0x5e0c82[_0x4829('0x24')],qs[_0x4829('0x29')](_0x1bcbf9[_0x4829('0x20')]['fields']));_0x29bcd1[_0x4829('0x28')]=_0x29bcd1['attributes'][_0x4829('0x2a')]?_0x29bcd1['attributes']:_0x5e0c82[_0x4829('0x24')];if(!_0x1bcbf9['query']['hasOwnProperty'](_0x4829('0x38'))){_0x29bcd1[_0x4829('0x13')]=qs[_0x4829('0x13')](_0x1bcbf9[_0x4829('0x20')]['limit']);_0x29bcd1['offset']=qs['offset'](_0x1bcbf9['query'][_0x4829('0x11')]);}_0x29bcd1[_0x4829('0x39')]=qs[_0x4829('0x3a')](_0x1bcbf9['query'][_0x4829('0x3a')]);_0x29bcd1[_0x4829('0x3b')]=qs[_0x4829('0x26')](_[_0x4829('0x3c')](_0x1bcbf9[_0x4829('0x20')],_0x5e0c82['filters']));_0x29bcd1[_0x4829('0x3b')]['WhatsappInteractionId']=_0x27d66a['id'];if(_0x1bcbf9[_0x4829('0x20')][_0x4829('0x3d')]){_0x29bcd1[_0x4829('0x3b')]=_[_0x4829('0x2c')](_0x29bcd1[_0x4829('0x3b')],{'$or':_[_0x4829('0x3e')](_0x29bcd1[_0x4829('0x28')],function(_0x2729dd){var _0x56b695={};_0x56b695[_0x2729dd]={'$like':'%'+_0x1bcbf9[_0x4829('0x20')][_0x4829('0x3d')]+'%'};return _0x56b695;})});}if(_0x1bcbf9[_0x4829('0x20')][_0x4829('0x3f')]){var _0x54139e=_0x1bcbf9[_0x4829('0x20')]['$gte'][_0x4829('0x40')](',');var _0x208427={};_0x208427[_0x54139e[0x0]]={'$gte':moment(_0x54139e[0x1])[_0x4829('0x41')](_0x4829('0x42'))};_0x29bcd1[_0x4829('0x3b')]=_[_0x4829('0x2c')](_0x29bcd1[_0x4829('0x3b')],_0x208427);}_0x29bcd1=_[_0x4829('0x2c')]({},_0x29bcd1,_0x1bcbf9[_0x4829('0x2d')]);return db['WhatsappMessage'][_0x4829('0x14')]({'where':_0x29bcd1['where']})['then'](function(_0xf4168e){_0x4c5e60['count']=_0xf4168e;if(_0x1bcbf9[_0x4829('0x20')]['includeAll']){_0x29bcd1[_0x4829('0x2b')]=[{'all':!![]}];}return db[_0x4829('0x34')][_0x4829('0x43')](_0x29bcd1);})[_0x4829('0x17')](function(_0x47ef9e){_0x4c5e60[_0x4829('0x44')]=_0x47ef9e;return _0x4c5e60;});}})[_0x4829('0x17')](respondWithFilteredResult(_0x475db6,_0x29bcd1))[_0x4829('0x22')](handleError(_0x475db6,null));};exports[_0x4829('0x45')]=function(_0xf01fcf,_0x22bbc0){return db[_0x4829('0x1d')]['find']({'where':{'id':_0xf01fcf[_0x4829('0x23')]['id']}})[_0x4829('0x17')](handleEntityNotFound(_0x22bbc0,null))[_0x4829('0x17')](function(_0x1115c2){if(_0x1115c2){return _0x1115c2['setTags'](_0xf01fcf[_0x4829('0x2f')][_0x4829('0x35')],_['omit'](_0xf01fcf['body'],[_0x4829('0x35'),'id'])||{})[_0x4829('0x46')](function(){return db[_0x4829('0x47')]['findAll']({'attributes':['id',_0x4829('0x1b'),_0x4829('0x48')],'where':{'id':_0xf01fcf[_0x4829('0x2f')]['ids']}});})[_0x4829('0x17')](function(_0x5c0075){socket[_0x4829('0x49')](_0x4829('0x4a'),{'id':Number(_0xf01fcf['params']['id']),'tags':_0x5c0075||[]});return{'id':Number(_0xf01fcf[_0x4829('0x23')]['id']),'tags':_0x5c0075||[]};});}})[_0x4829('0x17')](respondWithResult(_0x22bbc0,null))[_0x4829('0x22')](handleError(_0x22bbc0,null));};exports[_0x4829('0x4b')]=function(_0x17dfc6,_0x6d7894){return db['WhatsappInteraction'][_0x4829('0x31')]({'where':{'id':_0x17dfc6[_0x4829('0x23')]['id']}})['then'](handleEntityNotFound(_0x6d7894,null))[_0x4829('0x17')](function(_0x45c266){if(_0x45c266){return _0x45c266['removeTags'](_0x17dfc6[_0x4829('0x20')][_0x4829('0x35')]);}})[_0x4829('0x17')](respondWithStatusCode(_0x6d7894,null))[_0x4829('0x22')](handleError(_0x6d7894,null));};exports[_0x4829('0x4c')]=function(_0x3cf1f8,_0x5d0ebe){var _0x12b90a=moment()[_0x4829('0x4d')]()[_0x4829('0x4e')]();var _0x1b79c8=path[_0x4829('0x4f')](config['root'],_0x4829('0x50'),_0x4829('0x51'),_0x4829('0x52'));var _0x45edaa=path[_0x4829('0x4f')](config[_0x4829('0x53')],_0x4829('0x50'),_0x4829('0x51'),_0x4829('0x54'));var _0x57a94c=path[_0x4829('0x4f')](_0x1b79c8,_0x12b90a);var _0x13c632=util[_0x4829('0x41')](_0x4829('0x55'),_0x3cf1f8['params']['id'],_0x12b90a);var _0xe5e769=path['join'](_0x1b79c8,_0x13c632);var _0x59368c=[];_0x59368c[_0x4829('0x56')]({'model':db[_0x4829('0x57')],'as':'User','attributes':['id',_0x4829('0x58')],'raw':!![]});_0x59368c[_0x4829('0x56')]({'model':db[_0x4829('0x59')],'as':_0x4829('0x5a'),'attributes':['id',_0x4829('0x5b'),'lastName'],'raw':!![]});if(_0x3cf1f8[_0x4829('0x20')][_0x4829('0x54')]){_0x59368c[_0x4829('0x56')]({'model':db['Attachment'],'as':_0x4829('0x5c'),'raw':!![]});}var _0x5e1821=[{'model':db[_0x4829('0x34')],'as':_0x4829('0x5d'),'attributes':['id',_0x4829('0x2f'),_0x4829('0x5e'),'direction','secret',_0x4829('0x5f')],'include':_0x59368c}];_0x5e1821[_0x4829('0x56')]({'model':db['WhatsappAccount'],'as':_0x4829('0x60'),'attributes':['id',_0x4829('0x1b')]});_0x5e1821[_0x4829('0x56')]({'model':db[_0x4829('0x57')],'as':_0x4829('0x61'),'attributes':['id',_0x4829('0x58')]});return db[_0x4829('0x1d')][_0x4829('0x31')]({'where':{'id':_0x3cf1f8[_0x4829('0x23')]['id']},'include':_0x5e1821})[_0x4829('0x17')](handleEntityNotFound(_0x5d0ebe,null))[_0x4829('0x17')](function(_0x5838d8){if(_0x5838d8){var _0x269b96=_0x5838d8[_0x4829('0x62')]({'plain':!![]});fs['mkdirSync'](_0x57a94c);var _0xafc341={'channel':'Whatsapp','account':_0x269b96['Account'][_0x4829('0x1b')],'agent':_0x269b96['Owner']?_0x269b96[_0x4829('0x61')]['fullname']:_0x4829('0x63'),'createdAt':moment(_0x269b96[_0x4829('0x5e')])[_0x4829('0x41')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4829('0x4e')](),'closedAt':_0x269b96[_0x4829('0x64')]?moment(_0x269b96[_0x4829('0x65')])[_0x4829('0x41')](_0x4829('0x42'))[_0x4829('0x4e')]():'','disposition':_0x269b96[_0x4829('0x66')],'messages':_(_0x269b96[_0x4829('0x5d')])[_0x4829('0x3d')]({'secret':![]})[_0x4829('0x3e')](function(_0x4b50e4){if(_0x4b50e4[_0x4829('0x5c')]){var _0x2cffd3=path[_0x4829('0x4f')](_0x45edaa,_0x4b50e4[_0x4829('0x5c')][_0x4829('0x67')]);if(fs['existsSync'](_0x2cffd3)){fs[_0x4829('0x68')](_0x2cffd3)[_0x4829('0x69')](fs[_0x4829('0x6a')](path[_0x4829('0x4f')](_0x57a94c,_0x4b50e4[_0x4829('0x5c')][_0x4829('0x67')])));}}return{'date':moment(_0x4b50e4[_0x4829('0x5e')])[_0x4829('0x41')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4829('0x4e')](),'sender':_0x4b50e4[_0x4829('0x6b')]==='out'?_0x4b50e4['User']?_0x4b50e4[_0x4829('0x57')][_0x4829('0x58')]:_0x4829('0x6c'):_0x4b50e4[_0x4829('0x5a')][_0x4829('0x5b')]+(_0x4b50e4['Contact'][_0x4829('0x6d')]?'\x20'+_0x4b50e4[_0x4829('0x5a')]['lastName']:''),'body':_0x4b50e4[_0x4829('0x5c')]?_0x4b50e4[_0x4829('0x5c')]['basename']:_0x4b50e4['body'],'direction':_0x4b50e4[_0x4829('0x6b')]===_0x4829('0x6e')?'A':'C','secret':_0x4b50e4[_0x4829('0x6f')],'read':_0x4b50e4[_0x4829('0x5f')],'attachment':_0x4b50e4[_0x4829('0x5c')]};})[_0x4829('0x70')]()};return ejs[_0x4829('0x71')](path[_0x4829('0x4f')](config[_0x4829('0x53')],'server',_0x4829('0x72'),_0x4829('0x73')),{'interaction':_0xafc341})[_0x4829('0x17')](function(_0x15cf5d){var _0xbd1b3=path['join'](_0x57a94c,_0x4829('0x74')+_0x269b96['id']+'-'+_0x12b90a+_0x4829('0x75'));var _0x5a1098={'path':_0xbd1b3,'channel':'Whatsapp','interactionId':_0x269b96['id']};return pdf['createPdfFromHTML'](_0x15cf5d,_0x5a1098);})[_0x4829('0x17')](function(){return new BPromise(function(_0x51d5ac,_0x8a1854){zipdir(_0x57a94c,{'saveTo':_0xe5e769},function(_0xc0bb97,_0x59b9f7){if(_0xc0bb97)return _0x8a1854(_0xc0bb97);return _0x51d5ac(_0x59b9f7);});})[_0x4829('0x17')](function(){return new BPromise(function(_0x14f339,_0x17aa91){rimraf(_0x57a94c,function(_0x18f987){if(_0x18f987)_0x17aa91(_0x18f987);return _0x14f339();});});})['then'](function(){return _0x5d0ebe[_0x4829('0x4c')](_0xe5e769,_0x13c632,function(_0x4c4606){if(_0x4c4606){console[_0x4829('0x76')]('err',_0x4c4606);}else{fs[_0x4829('0x77')](_0xe5e769);}});});});}else{return _0x5d0ebe[_0x4829('0xe')](0xc8);}})[_0x4829('0x22')](handleError(_0x5d0ebe,null));}; \ No newline at end of file +var _0x19a8=['Tag','color','whatsappInteractionTags:save','removeTags','download','join','root','server','files','attachments','transcript-%d-%s.zip','push','User','CmContact','Contact','lastName','Attachment','Messages','createdAt','direction','secret','read','WhatsappAccount','Owner','fullname','mkdirSync','Whatsapp','Account','YYYY-MM-DD\x20HH:mm:ss','closed','toString','disposition','map','basename','existsSync','pipe','out','firstName','value','renderFile','views','transcript-','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','util','lodash','ioredis','../../components/interaction/service','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','undefined','limit','count','offset','json','then','destroy','error','stack','name','send','index','rawAttributes','key','getOptions','findAll','whatsapp','user','catch','show','WhatsappInteraction','query','keys','intersection','attributes','model','fields','length','includeAll','merge','find','create','body','update','params','describe','WhatsappMessage','addMessage','omit','ids','findOne','filters','hasOwnProperty','order','sort','pick','filter','where','$gte','split','format','options','include','addTags','setTags','spread'];(function(_0x3ca779,_0x292da8){var _0x534657=function(_0x37e600){while(--_0x37e600){_0x3ca779['push'](_0x3ca779['shift']());}};_0x534657(++_0x292da8);}(_0x19a8,0x120));var _0x819a=function(_0x59dea5,_0x41f195){_0x59dea5=_0x59dea5-0x0;var _0x56a51b=_0x19a8[_0x59dea5];return _0x56a51b;};'use strict';var rimraf=require(_0x819a('0x0'));var zipdir=require(_0x819a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x819a('0x2'));var path=require('path');var ejs=require('ejs');var fs=require('fs');var _=require(_0x819a('0x3'));var Redis=require(_0x819a('0x4'));var interaction=require(_0x819a('0x5'));var qs=require('../../components/parsers/qs');var pdf=require(_0x819a('0x6'));var logger=require(_0x819a('0x7'))(_0x819a('0x8'));var config=require(_0x819a('0x9'));var db=require(_0x819a('0xa'))['db'];config[_0x819a('0xb')]=_[_0x819a('0xc')](config[_0x819a('0xb')],{'host':_0x819a('0xd'),'port':0x18eb});var socket=require(_0x819a('0xe'))(new Redis(config[_0x819a('0xb')]));require(_0x819a('0xf'))[_0x819a('0x10')](socket);function respondWithStatusCode(_0x48e68f,_0x2412d3){_0x2412d3=_0x2412d3||0xcc;return function(_0x148e94){if(_0x148e94){return _0x48e68f[_0x819a('0x11')](_0x2412d3);}return _0x48e68f[_0x819a('0x12')](_0x2412d3)['end']();};}function respondWithResult(_0x59b92e,_0x51a392){_0x51a392=_0x51a392||0xc8;return function(_0x167e9c){if(_0x167e9c){return _0x59b92e[_0x819a('0x12')](_0x51a392)['json'](_0x167e9c);}};}function respondWithFilteredResult(_0x3e7588,_0xb9b60d){return function(_0xd5f641){if(_0xd5f641){var _0x484d1a=typeof _0xb9b60d['offset']===_0x819a('0x13')&&typeof _0xb9b60d[_0x819a('0x14')]===_0x819a('0x13');var _0x111f5f=_0xd5f641[_0x819a('0x15')];var _0x359781=_0x484d1a?0x0:_0xb9b60d[_0x819a('0x16')];var _0x51bedd=_0x484d1a?_0xd5f641[_0x819a('0x15')]:_0xb9b60d[_0x819a('0x16')]+_0xb9b60d[_0x819a('0x14')];var _0x222e65;if(_0x51bedd>=_0x111f5f){_0x51bedd=_0x111f5f;_0x222e65=0xc8;}else{_0x222e65=0xce;}_0x3e7588[_0x819a('0x12')](_0x222e65);return _0x3e7588['set']('Content-Range',_0x359781+'-'+_0x51bedd+'/'+_0x111f5f)[_0x819a('0x17')](_0xd5f641);}return null;};}function saveUpdates(_0x519d61){return function(_0x5375f9){if(_0x5375f9){return _0x5375f9['update'](_0x519d61)[_0x819a('0x18')](function(_0x256d6a){return _0x256d6a;});}return null;};}function removeEntity(_0x29191d){return function(_0x3ee55f){if(_0x3ee55f){return _0x3ee55f[_0x819a('0x19')]()['then'](function(){_0x29191d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x558eee){return function(_0x3858a2){if(!_0x3858a2){_0x558eee[_0x819a('0x11')](0x194);}return _0x3858a2;};}function handleError(_0x520439,_0x1142cf){_0x1142cf=_0x1142cf||0x1f4;return function(_0x4251cc){logger[_0x819a('0x1a')](_0x4251cc[_0x819a('0x1b')]);if(_0x4251cc['name']){delete _0x4251cc[_0x819a('0x1c')];}_0x520439[_0x819a('0x12')](_0x1142cf)[_0x819a('0x1d')](_0x4251cc);};}exports[_0x819a('0x1e')]=function(_0x4205bb,_0x48395c){var _0x3e3525={};var _0x5e9be4=_['map'](db['WhatsappInteraction'][_0x819a('0x1f')],function(_0x4a7466){return{'name':_0x4a7466['fieldName'],'type':_0x4a7466['type'][_0x819a('0x20')]};});_0x3e3525=qs[_0x819a('0x21')](_0x5e9be4,_0x4205bb);return interaction[_0x819a('0x22')](_0x819a('0x23'),_0x4205bb['query'],_0x4205bb[_0x819a('0x24')],_0x3e3525,_0x5e9be4)[_0x819a('0x18')](respondWithFilteredResult(_0x48395c,_0x3e3525))[_0x819a('0x25')](handleError(_0x48395c,null));};exports[_0x819a('0x26')]=function(_0x160590,_0x47a6c2){var _0x10ee56={'raw':![],'where':{'id':_0x160590['params']['id']}},_0x408bbf={};_0x408bbf['model']=_['keys'](db[_0x819a('0x27')][_0x819a('0x1f')]);_0x408bbf[_0x819a('0x28')]=_[_0x819a('0x29')](_0x160590[_0x819a('0x28')]);_0x408bbf['filters']=_[_0x819a('0x2a')](_0x408bbf['model'],_0x408bbf['query']);_0x10ee56[_0x819a('0x2b')]=_[_0x819a('0x2a')](_0x408bbf[_0x819a('0x2c')],qs[_0x819a('0x2d')](_0x160590[_0x819a('0x28')][_0x819a('0x2d')]));_0x10ee56[_0x819a('0x2b')]=_0x10ee56[_0x819a('0x2b')][_0x819a('0x2e')]?_0x10ee56['attributes']:_0x408bbf[_0x819a('0x2c')];if(_0x160590[_0x819a('0x28')][_0x819a('0x2f')]){_0x10ee56['include']=[{'all':!![]}];}_0x10ee56=_[_0x819a('0x30')]({},_0x10ee56,_0x160590['options']);return db['WhatsappInteraction'][_0x819a('0x31')](_0x10ee56)['then'](handleEntityNotFound(_0x47a6c2,null))[_0x819a('0x18')](respondWithResult(_0x47a6c2,null))[_0x819a('0x25')](handleError(_0x47a6c2,null));};exports[_0x819a('0x32')]=function(_0x2e3a7f,_0xba2a10){return db['WhatsappInteraction'][_0x819a('0x32')](_0x2e3a7f[_0x819a('0x33')],{})[_0x819a('0x18')](respondWithResult(_0xba2a10,0xc9))[_0x819a('0x25')](handleError(_0xba2a10,null));};exports[_0x819a('0x34')]=function(_0x380f2e,_0x3fbe1d){if(_0x380f2e[_0x819a('0x33')]['id']){delete _0x380f2e[_0x819a('0x33')]['id'];}return db['WhatsappInteraction'][_0x819a('0x31')]({'where':{'id':_0x380f2e[_0x819a('0x35')]['id']}})['then'](handleEntityNotFound(_0x3fbe1d,null))[_0x819a('0x18')](saveUpdates(_0x380f2e[_0x819a('0x33')],null))[_0x819a('0x18')](respondWithResult(_0x3fbe1d,null))[_0x819a('0x25')](handleError(_0x3fbe1d,null));};exports[_0x819a('0x19')]=function(_0x21455b,_0x24e224){return db[_0x819a('0x27')][_0x819a('0x31')]({'where':{'id':_0x21455b[_0x819a('0x35')]['id']}})[_0x819a('0x18')](handleEntityNotFound(_0x24e224,null))[_0x819a('0x18')](removeEntity(_0x24e224,null))['catch'](handleError(_0x24e224,null));};exports[_0x819a('0x36')]=function(_0x596ab1,_0xc30234){return db[_0x819a('0x27')][_0x819a('0x36')]()[_0x819a('0x18')](respondWithResult(_0xc30234,null))[_0x819a('0x25')](handleError(_0xc30234,null));};exports['addMessage']=function(_0x1e7b22,_0x2b810d){return db[_0x819a('0x37')][_0x819a('0x31')]({'where':{'id':_0x1e7b22[_0x819a('0x35')]['id']}})[_0x819a('0x18')](handleEntityNotFound(_0x2b810d,null))[_0x819a('0x18')](function(_0x41609a){if(_0x41609a){return _0x41609a[_0x819a('0x38')](_0x1e7b22[_0x819a('0x33')]['ids'],_[_0x819a('0x39')](_0x1e7b22[_0x819a('0x33')],[_0x819a('0x3a'),'id'])||{});}})[_0x819a('0x18')](respondWithResult(_0x2b810d,null))[_0x819a('0x25')](handleError(_0x2b810d,null));};exports['getMessages']=function(_0x4d0901,_0x4bf195){var _0xfe1c5b={'raw':![],'where':{}};var _0x42e689={};var _0x3e5cef={'count':0x0,'rows':[]};return db[_0x819a('0x27')][_0x819a('0x3b')]({'where':{'id':_0x4d0901[_0x819a('0x35')]['id']}})[_0x819a('0x18')](handleEntityNotFound(_0x4bf195,null))[_0x819a('0x18')](function(_0x3d6006){if(_0x3d6006){_0x42e689['model']=_['keys'](db[_0x819a('0x37')]['rawAttributes']);_0x42e689[_0x819a('0x28')]=_['keys'](_0x4d0901[_0x819a('0x28')]);_0x42e689[_0x819a('0x3c')]=_['intersection'](_0x42e689['model'],_0x42e689[_0x819a('0x28')]);_0xfe1c5b['attributes']=_[_0x819a('0x2a')](_0x42e689[_0x819a('0x2c')],qs[_0x819a('0x2d')](_0x4d0901[_0x819a('0x28')][_0x819a('0x2d')]));_0xfe1c5b[_0x819a('0x2b')]=_0xfe1c5b[_0x819a('0x2b')][_0x819a('0x2e')]?_0xfe1c5b[_0x819a('0x2b')]:_0x42e689[_0x819a('0x2c')];if(!_0x4d0901[_0x819a('0x28')][_0x819a('0x3d')]('nolimit')){_0xfe1c5b['limit']=qs[_0x819a('0x14')](_0x4d0901[_0x819a('0x28')][_0x819a('0x14')]);_0xfe1c5b[_0x819a('0x16')]=qs[_0x819a('0x16')](_0x4d0901[_0x819a('0x28')][_0x819a('0x16')]);}_0xfe1c5b[_0x819a('0x3e')]=qs['sort'](_0x4d0901[_0x819a('0x28')][_0x819a('0x3f')]);_0xfe1c5b['where']=qs[_0x819a('0x3c')](_[_0x819a('0x40')](_0x4d0901['query'],_0x42e689[_0x819a('0x3c')]));_0xfe1c5b['where']['WhatsappInteractionId']=_0x3d6006['id'];if(_0x4d0901[_0x819a('0x28')][_0x819a('0x41')]){_0xfe1c5b[_0x819a('0x42')]=_[_0x819a('0x30')](_0xfe1c5b[_0x819a('0x42')],{'$or':_['map'](_0xfe1c5b[_0x819a('0x2b')],function(_0x5ed054){var _0x564fd3={};_0x564fd3[_0x5ed054]={'$like':'%'+_0x4d0901[_0x819a('0x28')][_0x819a('0x41')]+'%'};return _0x564fd3;})});}if(_0x4d0901[_0x819a('0x28')][_0x819a('0x43')]){var _0x194a21=_0x4d0901[_0x819a('0x28')][_0x819a('0x43')][_0x819a('0x44')](',');var _0x86dd8c={};_0x86dd8c[_0x194a21[0x0]]={'$gte':moment(_0x194a21[0x1])[_0x819a('0x45')]('YYYY-MM-DD\x20HH:mm:ss')};_0xfe1c5b[_0x819a('0x42')]=_[_0x819a('0x30')](_0xfe1c5b[_0x819a('0x42')],_0x86dd8c);}_0xfe1c5b=_[_0x819a('0x30')]({},_0xfe1c5b,_0x4d0901[_0x819a('0x46')]);return db[_0x819a('0x37')][_0x819a('0x15')]({'where':_0xfe1c5b[_0x819a('0x42')]})[_0x819a('0x18')](function(_0x44e971){_0x3e5cef[_0x819a('0x15')]=_0x44e971;if(_0x4d0901['query'][_0x819a('0x2f')]){_0xfe1c5b[_0x819a('0x47')]=[{'all':!![]}];}return db[_0x819a('0x37')][_0x819a('0x22')](_0xfe1c5b);})[_0x819a('0x18')](function(_0x58783e){_0x3e5cef['rows']=_0x58783e;return _0x3e5cef;});}})['then'](respondWithFilteredResult(_0x4bf195,_0xfe1c5b))[_0x819a('0x25')](handleError(_0x4bf195,null));};exports[_0x819a('0x48')]=function(_0x4e12b7,_0x56f775){return db[_0x819a('0x27')][_0x819a('0x31')]({'where':{'id':_0x4e12b7[_0x819a('0x35')]['id']}})['then'](handleEntityNotFound(_0x56f775,null))[_0x819a('0x18')](function(_0x220a4a){if(_0x220a4a){return _0x220a4a[_0x819a('0x49')](_0x4e12b7[_0x819a('0x33')][_0x819a('0x3a')],_[_0x819a('0x39')](_0x4e12b7[_0x819a('0x33')],[_0x819a('0x3a'),'id'])||{})[_0x819a('0x4a')](function(){return db[_0x819a('0x4b')][_0x819a('0x22')]({'attributes':['id','name',_0x819a('0x4c')],'where':{'id':_0x4e12b7['body']['ids']}});})[_0x819a('0x18')](function(_0x49f273){socket['emit'](_0x819a('0x4d'),{'id':Number(_0x4e12b7['params']['id']),'tags':_0x49f273||[]});return{'id':Number(_0x4e12b7['params']['id']),'tags':_0x49f273||[]};});}})['then'](respondWithResult(_0x56f775,null))[_0x819a('0x25')](handleError(_0x56f775,null));};exports[_0x819a('0x4e')]=function(_0x17aa86,_0x1a5745){return db[_0x819a('0x27')][_0x819a('0x31')]({'where':{'id':_0x17aa86[_0x819a('0x35')]['id']}})[_0x819a('0x18')](handleEntityNotFound(_0x1a5745,null))[_0x819a('0x18')](function(_0x20c290){if(_0x20c290){return _0x20c290['removeTags'](_0x17aa86[_0x819a('0x28')][_0x819a('0x3a')]);}})[_0x819a('0x18')](respondWithStatusCode(_0x1a5745,null))[_0x819a('0x25')](handleError(_0x1a5745,null));};exports[_0x819a('0x4f')]=function(_0x154a4f,_0x3b3755){var _0x3cdc87=moment()['unix']()['toString']();var _0x5223c2=path[_0x819a('0x50')](config[_0x819a('0x51')],_0x819a('0x52'),'files','tmp');var _0x41801f=path[_0x819a('0x50')](config[_0x819a('0x51')],_0x819a('0x52'),_0x819a('0x53'),_0x819a('0x54'));var _0x385aa6=path[_0x819a('0x50')](_0x5223c2,_0x3cdc87);var _0xa40e2f=util[_0x819a('0x45')](_0x819a('0x55'),_0x154a4f[_0x819a('0x35')]['id'],_0x3cdc87);var _0x4b373a=path[_0x819a('0x50')](_0x5223c2,_0xa40e2f);var _0x8f9098=[];_0x8f9098[_0x819a('0x56')]({'model':db[_0x819a('0x57')],'as':_0x819a('0x57'),'attributes':['id','fullname'],'raw':!![]});_0x8f9098[_0x819a('0x56')]({'model':db[_0x819a('0x58')],'as':_0x819a('0x59'),'attributes':['id','firstName',_0x819a('0x5a')],'raw':!![]});if(_0x154a4f[_0x819a('0x28')][_0x819a('0x54')]){_0x8f9098[_0x819a('0x56')]({'model':db['Attachment'],'as':_0x819a('0x5b'),'raw':!![]});}var _0x110a96=[{'model':db[_0x819a('0x37')],'as':_0x819a('0x5c'),'attributes':['id',_0x819a('0x33'),_0x819a('0x5d'),_0x819a('0x5e'),_0x819a('0x5f'),_0x819a('0x60')],'include':_0x8f9098}];_0x110a96[_0x819a('0x56')]({'model':db[_0x819a('0x61')],'as':'Account','attributes':['id',_0x819a('0x1c')]});_0x110a96[_0x819a('0x56')]({'model':db[_0x819a('0x57')],'as':_0x819a('0x62'),'attributes':['id',_0x819a('0x63')]});return db['WhatsappInteraction'][_0x819a('0x31')]({'where':{'id':_0x154a4f['params']['id']},'include':_0x110a96})[_0x819a('0x18')](handleEntityNotFound(_0x3b3755,null))[_0x819a('0x18')](function(_0x30d72e){if(_0x30d72e){var _0x1c370a=_0x30d72e['get']({'plain':!![]});fs[_0x819a('0x64')](_0x385aa6);var _0x3b7785={'channel':_0x819a('0x65'),'account':_0x1c370a[_0x819a('0x66')]['name'],'agent':_0x1c370a[_0x819a('0x62')]?_0x1c370a[_0x819a('0x62')][_0x819a('0x63')]:'N.A.','createdAt':moment(_0x1c370a['createdAt'])['format'](_0x819a('0x67'))['toString'](),'closedAt':_0x1c370a[_0x819a('0x68')]?moment(_0x1c370a['closedAt'])[_0x819a('0x45')]('YYYY-MM-DD\x20HH:mm:ss')[_0x819a('0x69')]():'','disposition':_0x1c370a[_0x819a('0x6a')],'messages':_(_0x1c370a[_0x819a('0x5c')])['filter']({'secret':![]})[_0x819a('0x6b')](function(_0x32954b){if(_0x32954b[_0x819a('0x5b')]){var _0x423469=path['join'](_0x41801f,_0x32954b[_0x819a('0x5b')][_0x819a('0x6c')]);if(fs[_0x819a('0x6d')](_0x423469)){fs['createReadStream'](_0x423469)[_0x819a('0x6e')](fs['createWriteStream'](path[_0x819a('0x50')](_0x385aa6,_0x32954b[_0x819a('0x5b')]['basename'])));}}return{'date':moment(_0x32954b['createdAt'])[_0x819a('0x45')](_0x819a('0x67'))['toString'](),'sender':_0x32954b['direction']===_0x819a('0x6f')?_0x32954b[_0x819a('0x57')]?_0x32954b['User'][_0x819a('0x63')]:'System':_0x32954b[_0x819a('0x59')][_0x819a('0x70')]+(_0x32954b[_0x819a('0x59')]['lastName']?'\x20'+_0x32954b['Contact'][_0x819a('0x5a')]:''),'body':_0x32954b['Attachment']?_0x32954b[_0x819a('0x5b')][_0x819a('0x6c')]:_0x32954b[_0x819a('0x33')],'direction':_0x32954b[_0x819a('0x5e')]===_0x819a('0x6f')?'A':'C','secret':_0x32954b[_0x819a('0x5f')],'read':_0x32954b[_0x819a('0x60')],'attachment':_0x32954b[_0x819a('0x5b')]};})[_0x819a('0x71')]()};return ejs[_0x819a('0x72')](path[_0x819a('0x50')](config[_0x819a('0x51')],_0x819a('0x52'),_0x819a('0x73'),'downloadInteraction.ejs'),{'interaction':_0x3b7785})[_0x819a('0x18')](function(_0x30f09e){var _0x4f4458=path[_0x819a('0x50')](_0x385aa6,_0x819a('0x74')+_0x1c370a['id']+'-'+_0x3cdc87+'.pdf');var _0x2bbef4={'path':_0x4f4458,'channel':'Whatsapp','interactionId':_0x1c370a['id']};return pdf[_0x819a('0x75')](_0x30f09e,_0x2bbef4);})[_0x819a('0x18')](function(){return new BPromise(function(_0x56b14a,_0x4a6e51){zipdir(_0x385aa6,{'saveTo':_0x4b373a},function(_0x261ac7,_0x13b1ff){if(_0x261ac7)return _0x4a6e51(_0x261ac7);return _0x56b14a(_0x13b1ff);});})[_0x819a('0x18')](function(){return new BPromise(function(_0x13017f,_0x1eba13){rimraf(_0x385aa6,function(_0x434047){if(_0x434047)_0x1eba13(_0x434047);return _0x13017f();});});})[_0x819a('0x18')](function(){return _0x3b3755[_0x819a('0x4f')](_0x4b373a,_0xa40e2f,function(_0x3de428){if(_0x3de428){console[_0x819a('0x76')](_0x819a('0x77'),_0x3de428);}else{fs[_0x819a('0x78')](_0x4b373a);}});});});}else{return _0x3b3755['sendStatus'](0xc8);}})[_0x819a('0x25')](handleError(_0x3b3755,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index c92dc53..bd7e48c 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.events.js +++ b/server/api/whatsappInteraction/whatsappInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa45b=['exports','../../mysqldb','WhatsappInteraction','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','hook'];(function(_0x505a97,_0x2ffb37){var _0x57703d=function(_0x8aee23){while(--_0x8aee23){_0x505a97['push'](_0x505a97['shift']());}};_0x57703d(++_0x2ffb37);}(_0xa45b,0x199));var _0xba45=function(_0x6437f3,_0x4bc1d0){_0x6437f3=_0x6437f3-0x0;var _0x56dd80=_0xa45b[_0x6437f3];return _0x56dd80;};'use strict';var EventEmitter=require('events');var WhatsappInteraction=require(_0xba45('0x0'))['db'][_0xba45('0x1')];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xba45('0x2'),'afterUpdate':_0xba45('0x3'),'afterDestroy':_0xba45('0x4')};function emitEvent(_0x35008a){return function(_0x53dc1f,_0x197626,_0x14ee6c){_0x53dc1f[_0xba45('0x5')]({'attributes':['id'],'raw':!![]})[_0xba45('0x6')](function(_0x404229){_0x53dc1f[_0xba45('0x7')](_0xba45('0x8'),_0x404229[_0xba45('0x9')](function(_0x4cb181){return{'id':_0x4cb181['id']};}));return WhatsappMessage[_0xba45('0xa')]({'where':{'WhatsappInteractionId':_0x53dc1f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x594b02){_0x53dc1f['setDataValue']('unreadMessages',_0x594b02[_0xba45('0xb')]);WhatsappInteractionEvents[_0xba45('0xc')](_0x35008a+':'+_0x53dc1f['id'],_0x53dc1f);WhatsappInteractionEvents['emit'](_0x35008a,_0x53dc1f);_0x14ee6c(null);})[_0xba45('0xd')](_0x14ee6c(null));};}for(var e in events){if(events[_0xba45('0xe')](e)){var event=events[e];WhatsappInteraction[_0xba45('0xf')](e,emitEvent(event));}}module[_0xba45('0x10')]=WhatsappInteractionEvents; \ No newline at end of file +var _0x97f5=['update','remove','getUsers','setDataValue','Users','map','findAll','unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappInteraction','setMaxListeners','save'];(function(_0x5b589,_0x2b654a){var _0x372e46=function(_0x11da95){while(--_0x11da95){_0x5b589['push'](_0x5b589['shift']());}};_0x372e46(++_0x2b654a);}(_0x97f5,0x72));var _0x597f=function(_0x49692a,_0x3fed4a){_0x49692a=_0x49692a-0x0;var _0x166a18=_0x97f5[_0x49692a];return _0x166a18;};'use strict';var EventEmitter=require(_0x597f('0x0'));var WhatsappInteraction=require(_0x597f('0x1'))['db'][_0x597f('0x2')];var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x597f('0x3')](0x0);var events={'afterCreate':_0x597f('0x4'),'afterUpdate':_0x597f('0x5'),'afterDestroy':_0x597f('0x6')};function emitEvent(_0x3e3c7e){return function(_0x3bca61,_0x38560e,_0x1abf16){_0x3bca61[_0x597f('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x22b5d0){_0x3bca61[_0x597f('0x8')](_0x597f('0x9'),_0x22b5d0[_0x597f('0xa')](function(_0x189e0d){return{'id':_0x189e0d['id']};}));return WhatsappMessage[_0x597f('0xb')]({'where':{'WhatsappInteractionId':_0x3bca61['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x31c4bc){_0x3bca61[_0x597f('0x8')](_0x597f('0xc'),_0x31c4bc['length']);WhatsappInteractionEvents['emit'](_0x3e3c7e+':'+_0x3bca61['id'],_0x3bca61);WhatsappInteractionEvents[_0x597f('0xd')](_0x3e3c7e,_0x3bca61);_0x1abf16(null);})['catch'](_0x1abf16(null));};}for(var e in events){if(events[_0x597f('0xe')](e)){var event=events[e];WhatsappInteraction[_0x597f('0xf')](e,emitEvent(event));}}module[_0x597f('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index bf15310..d26d9f9 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.model.js +++ b/server/api/whatsappInteraction/whatsappInteraction.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x04f8=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','define','whatsapp_interactions','changed','format','lodash','util'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x04f8,0x1be));var _0x804f=function(_0x1b6573,_0x396d7e){_0x1b6573=_0x1b6573-0x0;var _0xddc766=_0x04f8[_0x1b6573];return _0xddc766;};'use strict';var _=require(_0x804f('0x0'));var util=require(_0x804f('0x1'));var logger=require(_0x804f('0x2'))(_0x804f('0x3'));var moment=require(_0x804f('0x4'));var BPromise=require(_0x804f('0x5'));var rp=require(_0x804f('0x6'));var fs=require('fs');var path=require(_0x804f('0x7'));var rimraf=require(_0x804f('0x8'));var config=require(_0x804f('0x9'));var attributes=require(_0x804f('0xa'));module[_0x804f('0xb')]=function(_0x46ded1,_0x4cf62f){return _0x46ded1[_0x804f('0xc')]('WhatsappInteraction',attributes,{'tableName':_0x804f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x47e7ed,_0x98abbb,_0x52cbae){if(_0x47e7ed[_0x804f('0xe')]('closed')){_0x47e7ed['closedAt']=moment()[_0x804f('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x52cbae(null,_0x47e7ed);}}});}; \ No newline at end of file +var _0x9243=['closed','closedAt','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','exports','WhatsappInteraction','whatsapp_interactions','changed'];(function(_0x229f5e,_0x433f0f){var _0x2d62ff=function(_0xe4d381){while(--_0xe4d381){_0x229f5e['push'](_0x229f5e['shift']());}};_0x2d62ff(++_0x433f0f);}(_0x9243,0x89));var _0x3924=function(_0x531cb8,_0x8ef36f){_0x531cb8=_0x531cb8-0x0;var _0x5cf297=_0x9243[_0x531cb8];return _0x5cf297;};'use strict';var _=require(_0x3924('0x0'));var util=require(_0x3924('0x1'));var logger=require(_0x3924('0x2'))(_0x3924('0x3'));var moment=require('moment');var BPromise=require(_0x3924('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3924('0x5'));var rimraf=require(_0x3924('0x6'));var config=require(_0x3924('0x7'));var attributes=require(_0x3924('0x8'));module[_0x3924('0x9')]=function(_0x4ad4e8,_0x725fc9){return _0x4ad4e8['define'](_0x3924('0xa'),attributes,{'tableName':_0x3924('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x22576d,_0x24bd4b,_0x5eee30){if(_0x22576d[_0x3924('0xc')](_0x3924('0xd'))){_0x22576d[_0x3924('0xe')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x5eee30(null,_0x22576d);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index ca59503..3b63307 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.rpc.js +++ b/server/api/whatsappInteraction/whatsappInteraction.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb6d6=['limit','UpdateWhatsappInteraction','catch','AddTagsToWhatsappInteraction','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','WhatsappInteraction','update','body','options','where','attributes'];(function(_0x5cef66,_0x3f9f4a){var _0x2850cb=function(_0x2a0b97){while(--_0x2a0b97){_0x5cef66['push'](_0x5cef66['shift']());}};_0x2850cb(++_0x3f9f4a);}(_0xb6d6,0x1ad));var _0x6b6d=function(_0x337e43,_0xa39a12){_0x337e43=_0x337e43-0x0;var _0x474fe3=_0xb6d6[_0x337e43];return _0x474fe3;};'use strict';var _=require(_0x6b6d('0x0'));var util=require(_0x6b6d('0x1'));var moment=require('moment');var BPromise=require(_0x6b6d('0x2'));var rs=require(_0x6b6d('0x3'));var fs=require('fs');var Redis=require(_0x6b6d('0x4'));var db=require(_0x6b6d('0x5'))['db'];var utils=require(_0x6b6d('0x6'));var logger=require(_0x6b6d('0x7'))(_0x6b6d('0x8'));var config=require(_0x6b6d('0x9'));var jayson=require(_0x6b6d('0xa'));var client=jayson['client'][_0x6b6d('0xb')]({'port':0x232a});config[_0x6b6d('0xc')]=_['defaults'](config[_0x6b6d('0xc')],{'host':_0x6b6d('0xd'),'port':0x18eb});var socket=require(_0x6b6d('0xe'))(new Redis(config['redis']));require(_0x6b6d('0xf'))[_0x6b6d('0x10')](socket);function respondWithRpcPromise(_0x49878a,_0x484b7b,_0x243d5b){return new BPromise(function(_0x108659,_0x3099ef){return client[_0x6b6d('0x11')](_0x49878a,_0x243d5b)[_0x6b6d('0x12')](function(_0xa61113){logger[_0x6b6d('0x13')](_0x6b6d('0x14'),_0x484b7b,_0x6b6d('0x15'));logger[_0x6b6d('0x16')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x484b7b,_0x6b6d('0x15'),JSON[_0x6b6d('0x17')](_0xa61113));if(_0xa61113['error']){if(_0xa61113['error'][_0x6b6d('0x18')]===0x1f4){logger['error'](_0x6b6d('0x14'),_0x484b7b,_0xa61113[_0x6b6d('0x19')][_0x6b6d('0x1a')]);return _0x3099ef(_0xa61113[_0x6b6d('0x19')]['message']);}logger[_0x6b6d('0x19')](_0x6b6d('0x14'),_0x484b7b,_0xa61113[_0x6b6d('0x19')][_0x6b6d('0x1a')]);return _0x108659(_0xa61113['error'][_0x6b6d('0x1a')]);}else{logger[_0x6b6d('0x13')]('WhatsappInteraction,\x20%s,\x20%s',_0x484b7b,'request\x20sent');_0x108659(_0xa61113['result'][_0x6b6d('0x1a')]);}})['catch'](function(_0x3d92c8){logger[_0x6b6d('0x19')]('WhatsappInteraction,\x20%s,\x20%s',_0x484b7b,_0x3d92c8);_0x3099ef(_0x3d92c8);});});}exports['UpdateWhatsappInteraction']=function(_0x378262){var _0x448625=this;return new Promise(function(_0x17b407,_0x5447d3){return db[_0x6b6d('0x1b')][_0x6b6d('0x1c')](_0x378262[_0x6b6d('0x1d')],{'raw':_0x378262[_0x6b6d('0x1e')]?_0x378262[_0x6b6d('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378262['options']?_0x378262['options'][_0x6b6d('0x1f')]||null:null,'attributes':_0x378262[_0x6b6d('0x1e')]?_0x378262[_0x6b6d('0x1e')][_0x6b6d('0x20')]||null:null,'limit':_0x378262[_0x6b6d('0x1e')]?_0x378262[_0x6b6d('0x1e')][_0x6b6d('0x21')]||null:null})[_0x6b6d('0x12')](function(_0x136e19){logger[_0x6b6d('0x13')](_0x6b6d('0x22'),_0x378262);logger[_0x6b6d('0x16')](_0x6b6d('0x22'),_0x378262,JSON[_0x6b6d('0x17')](_0x136e19));_0x17b407(_0x136e19);})[_0x6b6d('0x23')](function(_0x49546e){logger['error'](_0x6b6d('0x22'),_0x49546e['message'],_0x378262);_0x5447d3(_0x448625[_0x6b6d('0x19')](0x1f4,_0x49546e[_0x6b6d('0x1a')]));});});};exports[_0x6b6d('0x24')]=function(_0x532f6d){return new Promise(function(_0x90c3f,_0x19da0d){return db[_0x6b6d('0x1b')]['find']({'where':_0x532f6d['options']?_0x532f6d[_0x6b6d('0x1e')][_0x6b6d('0x1f')]||null:null})[_0x6b6d('0x12')](function(_0x45ae27){if(_0x45ae27){return _0x45ae27[_0x6b6d('0x25')](_0x532f6d[_0x6b6d('0x1d')][_0x6b6d('0x26')],_[_0x6b6d('0x27')](_0x532f6d[_0x6b6d('0x1d')],[_0x6b6d('0x26'),'id'])||{});}})[_0x6b6d('0x28')](function(_0x5900d6){logger['info']('AddTags',_0x532f6d);logger['debug'](_0x6b6d('0x29'),_0x532f6d,JSON['stringify'](_0x5900d6));_0x90c3f(_0x5900d6);})[_0x6b6d('0x23')](function(_0x1a3ac4){logger[_0x6b6d('0x19')]('AddTags',_0x1a3ac4[_0x6b6d('0x1a')],_0x532f6d);_0x19da0d(_this[_0x6b6d('0x19')](0x1f4,_0x1a3ac4[_0x6b6d('0x1a')]));});});}; \ No newline at end of file +var _0x2f59=['AddTagsToWhatsappInteraction','find','ids','omit','spread','AddTags','lodash','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','socket.io-emitter','./whatsappInteraction.socket','register','then','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','where','attributes','limit'];(function(_0x278fa6,_0x59feac){var _0x262a91=function(_0x594e8d){while(--_0x594e8d){_0x278fa6['push'](_0x278fa6['shift']());}};_0x262a91(++_0x59feac);}(_0x2f59,0x1a8));var _0x92f5=function(_0x36fce5,_0x1d352a){_0x36fce5=_0x36fce5-0x0;var _0x247a82=_0x2f59[_0x36fce5];return _0x247a82;};'use strict';var _=require(_0x92f5('0x0'));var util=require('util');var moment=require(_0x92f5('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x92f5('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x92f5('0x3'));var logger=require(_0x92f5('0x4'))('rpc');var config=require(_0x92f5('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x92f5('0x6')][_0x92f5('0x7')]({'port':0x232a});config[_0x92f5('0x8')]=_[_0x92f5('0x9')](config[_0x92f5('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x92f5('0xa'))(new Redis(config[_0x92f5('0x8')]));require(_0x92f5('0xb'))[_0x92f5('0xc')](socket);function respondWithRpcPromise(_0x5a1dd1,_0x123d09,_0x7210a8){return new BPromise(function(_0x34482a,_0x380847){return client['request'](_0x5a1dd1,_0x7210a8)[_0x92f5('0xd')](function(_0x575490){logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x123d09,_0x92f5('0xe'));logger[_0x92f5('0xf')](_0x92f5('0x10'),_0x123d09,_0x92f5('0xe'),JSON[_0x92f5('0x11')](_0x575490));if(_0x575490[_0x92f5('0x12')]){if(_0x575490[_0x92f5('0x12')][_0x92f5('0x13')]===0x1f4){logger[_0x92f5('0x12')](_0x92f5('0x14'),_0x123d09,_0x575490[_0x92f5('0x12')][_0x92f5('0x15')]);return _0x380847(_0x575490[_0x92f5('0x12')][_0x92f5('0x15')]);}logger[_0x92f5('0x12')](_0x92f5('0x14'),_0x123d09,_0x575490[_0x92f5('0x12')][_0x92f5('0x15')]);return _0x34482a(_0x575490[_0x92f5('0x12')]['message']);}else{logger['info']('WhatsappInteraction,\x20%s,\x20%s',_0x123d09,_0x92f5('0xe'));_0x34482a(_0x575490[_0x92f5('0x16')][_0x92f5('0x15')]);}})[_0x92f5('0x17')](function(_0xbc2ccf){logger[_0x92f5('0x12')]('WhatsappInteraction,\x20%s,\x20%s',_0x123d09,_0xbc2ccf);_0x380847(_0xbc2ccf);});});}exports[_0x92f5('0x18')]=function(_0x7666ff){var _0x99c341=this;return new Promise(function(_0x598712,_0x18797f){return db[_0x92f5('0x19')][_0x92f5('0x1a')](_0x7666ff[_0x92f5('0x1b')],{'raw':_0x7666ff[_0x92f5('0x1c')]?_0x7666ff[_0x92f5('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7666ff[_0x92f5('0x1c')]?_0x7666ff['options'][_0x92f5('0x1d')]||null:null,'attributes':_0x7666ff[_0x92f5('0x1c')]?_0x7666ff[_0x92f5('0x1c')][_0x92f5('0x1e')]||null:null,'limit':_0x7666ff['options']?_0x7666ff['options'][_0x92f5('0x1f')]||null:null})[_0x92f5('0xd')](function(_0x2102ac){logger['info'](_0x92f5('0x18'),_0x7666ff);logger[_0x92f5('0xf')](_0x92f5('0x18'),_0x7666ff,JSON['stringify'](_0x2102ac));_0x598712(_0x2102ac);})['catch'](function(_0x12d5d0){logger[_0x92f5('0x12')](_0x92f5('0x18'),_0x12d5d0[_0x92f5('0x15')],_0x7666ff);_0x18797f(_0x99c341[_0x92f5('0x12')](0x1f4,_0x12d5d0['message']));});});};exports[_0x92f5('0x20')]=function(_0x1055ba){return new Promise(function(_0xbe6085,_0x5456e3){return db['WhatsappInteraction'][_0x92f5('0x21')]({'where':_0x1055ba[_0x92f5('0x1c')]?_0x1055ba[_0x92f5('0x1c')]['where']||null:null})['then'](function(_0x289284){if(_0x289284){return _0x289284['addTags'](_0x1055ba[_0x92f5('0x1b')][_0x92f5('0x22')],_[_0x92f5('0x23')](_0x1055ba[_0x92f5('0x1b')],[_0x92f5('0x22'),'id'])||{});}})[_0x92f5('0x24')](function(_0x5c66fe){logger['info'](_0x92f5('0x25'),_0x1055ba);logger['debug']('AddTags',_0x1055ba,JSON[_0x92f5('0x11')](_0x5c66fe));_0xbe6085(_0x5c66fe);})[_0x92f5('0x17')](function(_0x43d9a5){logger[_0x92f5('0x12')](_0x92f5('0x25'),_0x43d9a5[_0x92f5('0x15')],_0x1055ba);_0x5456e3(_this['error'](0x1f4,_0x43d9a5[_0x92f5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index 3b838e0..ba74141 100644 --- a/server/api/whatsappInteraction/whatsappInteraction.socket.js +++ b/server/api/whatsappInteraction/whatsappInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4ae2=['save','emit','whatsappInteraction:','./whatsappInteraction.events'];(function(_0x1dac68,_0x2fc251){var _0x22c215=function(_0x12d572){while(--_0x12d572){_0x1dac68['push'](_0x1dac68['shift']());}};_0x22c215(++_0x2fc251);}(_0x4ae2,0x193));var _0x24ae=function(_0x1fd9e7,_0x24cdbe){_0x1fd9e7=_0x1fd9e7-0x0;var _0x1781f2=_0x4ae2[_0x1fd9e7];return _0x1781f2;};'use strict';var WhatsappInteractionEvents=require(_0x24ae('0x0'));var events=[_0x24ae('0x1'),'remove','update'];function createListener(_0x1cdb6c,_0x2534a2){return function(_0x49762e){_0x2534a2[_0x24ae('0x2')](_0x1cdb6c,_0x49762e);};}function removeListener(_0x4e80e6,_0x1a96e3){return function(){WhatsappInteractionEvents['removeListener'](_0x4e80e6,_0x1a96e3);};}exports['register']=function(_0x5c812a){for(var _0x446033=0x0,_0x3feaf2=events['length'];_0x446033<_0x3feaf2;_0x446033++){var _0x21f0a6=events[_0x446033];var _0x44b1fd=createListener(_0x24ae('0x3')+_0x21f0a6,_0x5c812a);WhatsappInteractionEvents['on'](_0x21f0a6,_0x44b1fd);}}; \ No newline at end of file +var _0x3456=['remove','update','emit','register','length','whatsappInteraction:','save'];(function(_0x5b9252,_0x4bc2f8){var _0x1a4284=function(_0x36e4c7){while(--_0x36e4c7){_0x5b9252['push'](_0x5b9252['shift']());}};_0x1a4284(++_0x4bc2f8);}(_0x3456,0x8b));var _0x6345=function(_0x18776a,_0x4fecab){_0x18776a=_0x18776a-0x0;var _0x484e4a=_0x3456[_0x18776a];return _0x484e4a;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0x6345('0x0'),_0x6345('0x1'),_0x6345('0x2')];function createListener(_0x4934c3,_0x5f4d8b){return function(_0x50a098){_0x5f4d8b[_0x6345('0x3')](_0x4934c3,_0x50a098);};}function removeListener(_0x3c4a10,_0x4388aa){return function(){WhatsappInteractionEvents['removeListener'](_0x3c4a10,_0x4388aa);};}exports[_0x6345('0x4')]=function(_0x11c3d2){for(var _0x1657ae=0x0,_0xd4d4b=events[_0x6345('0x5')];_0x1657ae<_0xd4d4b;_0x1657ae++){var _0x532bb5=events[_0x1657ae];var _0xa091c4=createListener(_0x6345('0x6')+_0x532bb5,_0x11c3d2);WhatsappInteractionEvents['on'](_0x532bb5,_0xa091c4);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index d14730c..02ef45d 100644 --- a/server/api/whatsappMessage/index.js +++ b/server/api/whatsappMessage/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3985=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','whatsappmessage:create','create','status','put','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x223461,_0x2bca70){var _0x4dbe0a=function(_0x3c3cb6){while(--_0x3c3cb6){_0x223461['push'](_0x223461['shift']());}};_0x4dbe0a(++_0x2bca70);}(_0x3985,0xab));var _0x5398=function(_0x80b21b,_0x1ca9b6){_0x80b21b=_0x80b21b-0x0;var _0x4e4392=_0x3985[_0x80b21b];return _0x4e4392;};'use strict';var multer=require(_0x5398('0x0'));var util=require(_0x5398('0x1'));var path=require(_0x5398('0x2'));var timeout=require(_0x5398('0x3'));var express=require(_0x5398('0x4'));var router=express['Router']();var fs_extra=require(_0x5398('0x5'));var auth=require(_0x5398('0x6'));var interaction=require(_0x5398('0x7'));var config=require(_0x5398('0x8'));var controller=require('./whatsappMessage.controller');router[_0x5398('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5398('0x9')]('/describe',auth[_0x5398('0xa')](),controller[_0x5398('0xb')]);router[_0x5398('0x9')](_0x5398('0xc'),auth['isAuthenticated'](),controller[_0x5398('0xd')]);router[_0x5398('0xe')]('/',auth[_0x5398('0xa')](),interaction['tracked']('whatsapp',_0x5398('0xf')),controller[_0x5398('0x10')]);router[_0x5398('0xe')]('/:id/status',controller[_0x5398('0x11')]);router[_0x5398('0x12')](_0x5398('0xc'),auth[_0x5398('0xa')](),controller['update']);router[_0x5398('0x12')](_0x5398('0x13'),auth[_0x5398('0xa')](),controller[_0x5398('0x14')]);router[_0x5398('0x12')]('/:id/reject',auth[_0x5398('0xa')](),controller[_0x5398('0x15')]);router[_0x5398('0x16')](_0x5398('0xc'),auth[_0x5398('0xa')](),controller[_0x5398('0x17')]);module[_0x5398('0x18')]=router; \ No newline at end of file +var _0x1c1f=['../../components/interaction/service','get','isAuthenticated','/describe','show','post','tracked','whatsappmessage:create','/:id/status','status','put','/:id','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x4cfbf1,_0x1e0712){var _0x52fd27=function(_0xc3ec4c){while(--_0xc3ec4c){_0x4cfbf1['push'](_0x4cfbf1['shift']());}};_0x52fd27(++_0x1e0712);}(_0x1c1f,0x158));var _0xf1c1=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0x1c1f[_0x556bb1];return _0x45455f;};'use strict';var multer=require('multer');var util=require(_0xf1c1('0x0'));var path=require(_0xf1c1('0x1'));var timeout=require(_0xf1c1('0x2'));var express=require('express');var router=express[_0xf1c1('0x3')]();var fs_extra=require(_0xf1c1('0x4'));var auth=require(_0xf1c1('0x5'));var interaction=require(_0xf1c1('0x6'));var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0xf1c1('0x7')]('/',auth[_0xf1c1('0x8')](),controller['index']);router[_0xf1c1('0x7')](_0xf1c1('0x9'),auth[_0xf1c1('0x8')](),controller['describe']);router[_0xf1c1('0x7')]('/:id',auth[_0xf1c1('0x8')](),controller[_0xf1c1('0xa')]);router[_0xf1c1('0xb')]('/',auth['isAuthenticated'](),interaction[_0xf1c1('0xc')]('whatsapp',_0xf1c1('0xd')),controller['create']);router[_0xf1c1('0xb')](_0xf1c1('0xe'),controller[_0xf1c1('0xf')]);router[_0xf1c1('0x10')](_0xf1c1('0x11'),auth[_0xf1c1('0x8')](),controller[_0xf1c1('0x12')]);router[_0xf1c1('0x10')](_0xf1c1('0x13'),auth[_0xf1c1('0x8')](),controller['accept']);router[_0xf1c1('0x10')](_0xf1c1('0x14'),auth[_0xf1c1('0x8')](),controller[_0xf1c1('0x15')]);router[_0xf1c1('0x16')](_0xf1c1('0x11'),auth[_0xf1c1('0x8')](),controller[_0xf1c1('0x17')]);module[_0xf1c1('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index e1c5ecb..ef5044f 100644 --- a/server/api/whatsappMessage/whatsappMessage.attributes.js +++ b/server/api/whatsappMessage/whatsappMessage.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0460=['out','STRING','DATE','sequelize','exports','TEXT','BOOLEAN','ENUM'];(function(_0x390b40,_0x32a62e){var _0x11a416=function(_0x985f68){while(--_0x985f68){_0x390b40['push'](_0x390b40['shift']());}};_0x11a416(++_0x32a62e);}(_0x0460,0xab));var _0x0046=function(_0x1c89e1,_0x4e4f6e){_0x1c89e1=_0x1c89e1-0x0;var _0x4df70d=_0x0460[_0x1c89e1];return _0x4df70d;};'use strict';var Sequelize=require(_0x0046('0x0'));module[_0x0046('0x1')]={'body':{'type':Sequelize[_0x0046('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0046('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x0046('0x4')]('in',_0x0046('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x0046('0x6')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x0046('0x7')]},'secret':{'type':Sequelize[_0x0046('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x0046('0x6')]},'providerResponse':{'type':Sequelize[_0x0046('0x2')]}}; \ No newline at end of file +var _0x6d2a=['TEXT','BOOLEAN','out','STRING','sequelize','exports'];(function(_0x3db2a9,_0x910583){var _0x482252=function(_0x1b3b35){while(--_0x1b3b35){_0x3db2a9['push'](_0x3db2a9['shift']());}};_0x482252(++_0x910583);}(_0x6d2a,0x12a));var _0xa6d2=function(_0x4e1119,_0x32dc78){_0x4e1119=_0x4e1119-0x0;var _0x35f53d=_0x6d2a[_0x4e1119];return _0x35f53d;};'use strict';var Sequelize=require(_0xa6d2('0x0'));module[_0xa6d2('0x1')]={'body':{'type':Sequelize[_0xa6d2('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xa6d2('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xa6d2('0x4')),'defaultValue':_0xa6d2('0x4'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xa6d2('0x5')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xa6d2('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xa6d2('0x5')]},'providerResponse':{'type':Sequelize[_0xa6d2('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 9e7733d..c53b04b 100644 --- a/server/api/whatsappMessage/whatsappMessage.controller.js +++ b/server/api/whatsappMessage/whatsappMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc762=['ContactId','sequelize','QueryTypes','SELECT','contact','User','internal','agent','interface','channel','event','EventManager','../../config/logger','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','fullname','email','SIP/%s','motionChannel','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','client','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','order','sort','where','filter','merge','VIRTUAL','options','WhatsappMessage','includeAll','rows','intersection','find','catch','create','body','params','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','UserId','get','WhatsappInteraction','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','info','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0xc762,0x1a6));var _0x2c76=function(_0x3e99cb,_0x1d2fe0){_0x3e99cb=_0x3e99cb-0x0;var _0x1bc729=_0xc762[_0x3e99cb];return _0x1bc729;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x2c76('0x0'));var jsonpatch=require(_0x2c76('0x1'));var rp=require(_0x2c76('0x2'));var moment=require(_0x2c76('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2c76('0x4'));var util=require(_0x2c76('0x5'));var path=require(_0x2c76('0x6'));var sox=require(_0x2c76('0x7'));var csv=require(_0x2c76('0x8'));var ejs=require(_0x2c76('0x9'));var fs=require('fs');var fs_extra=require(_0x2c76('0xa'));var _=require('lodash');var squel=require(_0x2c76('0xb'));var crypto=require(_0x2c76('0xc'));var jsforce=require(_0x2c76('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2c76('0x8'));var querystring=require(_0x2c76('0xe'));var Papa=require(_0x2c76('0xf'));var Redis=require(_0x2c76('0x10'));var authService=require(_0x2c76('0x11'));var qs=require(_0x2c76('0x12'));var as=require(_0x2c76('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2c76('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x2c76('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x2c76('0x16')](config[_0x2c76('0x17')],{'host':_0x2c76('0x18'),'port':0x18eb});var socket=require(_0x2c76('0x19'))(new Redis(config[_0x2c76('0x17')]));require('./whatsappMessage.socket')[_0x2c76('0x1a')](socket);var jayson=require(_0x2c76('0x1b'));var client=jayson['client'][_0x2c76('0x1c')]({'port':0x232c});var client9002=jayson[_0x2c76('0x1d')][_0x2c76('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x1ff0c6,_0x2b4868,_0x58735e,_0x173343){return new BPromise(function(_0x374044,_0x36952f){var _0x28d47e=_0x173343||client;return _0x28d47e['request'](_0x1ff0c6,_0x58735e)[_0x2c76('0x1e')](function(_0x2b53c5){logger['info'](_0x2c76('0x1f'),_0x2b4868,_0x2c76('0x20'));logger[_0x2c76('0x21')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2b4868,_0x2c76('0x20'),JSON[_0x2c76('0x22')](_0x2b53c5));if(_0x2b53c5[_0x2c76('0x23')]){if(_0x2b53c5[_0x2c76('0x23')][_0x2c76('0x24')]===0x1f4){logger[_0x2c76('0x23')](_0x2c76('0x1f'),_0x2b4868,_0x2b53c5[_0x2c76('0x23')][_0x2c76('0x25')]);return _0x36952f(_0x2b53c5[_0x2c76('0x23')]['message']);}logger[_0x2c76('0x23')](_0x2c76('0x1f'),_0x2b4868,_0x2b53c5[_0x2c76('0x23')][_0x2c76('0x25')]);return _0x374044(_0x2b53c5[_0x2c76('0x23')][_0x2c76('0x25')]);}else{logger['info'](_0x2c76('0x1f'),_0x2b4868,'request\x20sent');_0x374044(_0x2b53c5[_0x2c76('0x26')][_0x2c76('0x25')]);}})['catch'](function(_0x8f2c32){logger['error'](_0x2c76('0x1f'),_0x2b4868,_0x8f2c32);_0x36952f(_0x8f2c32);});});}function respondWithStatusCode(_0x16bdf6,_0x5bfb50){_0x5bfb50=_0x5bfb50||0xcc;return function(_0x3bd14f){if(_0x3bd14f){return _0x16bdf6['sendStatus'](_0x5bfb50);}return _0x16bdf6[_0x2c76('0x27')](_0x5bfb50)[_0x2c76('0x28')]();};}function respondWithResult(_0x459a27,_0x284a82){_0x284a82=_0x284a82||0xc8;return function(_0x5f0e0d){if(_0x5f0e0d){return _0x459a27[_0x2c76('0x27')](_0x284a82)[_0x2c76('0x29')](_0x5f0e0d);}};}function respondWithFilteredResult(_0x2133be,_0x27ba0a){return function(_0x17e92b){if(_0x17e92b){var _0x49828a=typeof _0x27ba0a[_0x2c76('0x2a')]===_0x2c76('0x2b')&&typeof _0x27ba0a[_0x2c76('0x2c')]==='undefined';var _0x152c82=_0x17e92b[_0x2c76('0x2d')];var _0xe303a8=_0x49828a?0x0:_0x27ba0a[_0x2c76('0x2a')];var _0x14dd99=_0x49828a?_0x17e92b[_0x2c76('0x2d')]:_0x27ba0a[_0x2c76('0x2a')]+_0x27ba0a['limit'];var _0x3e0229;if(_0x14dd99>=_0x152c82){_0x14dd99=_0x152c82;_0x3e0229=0xc8;}else{_0x3e0229=0xce;}_0x2133be[_0x2c76('0x27')](_0x3e0229);return _0x2133be[_0x2c76('0x2e')](_0x2c76('0x2f'),_0xe303a8+'-'+_0x14dd99+'/'+_0x152c82)[_0x2c76('0x29')](_0x17e92b);}return null;};}function patchUpdates(_0x3f9acf){return function(_0x82510a){try{jsonpatch['apply'](_0x82510a,_0x3f9acf,!![]);}catch(_0x519844){return BPromise[_0x2c76('0x30')](_0x519844);}return _0x82510a[_0x2c76('0x31')]();};}function saveUpdates(_0x360207,_0x55d75e){return function(_0x2a17ae){if(_0x2a17ae){return _0x2a17ae[_0x2c76('0x32')](_0x360207)[_0x2c76('0x1e')](function(_0x8eac79){return _0x8eac79;});}return null;};}function removeEntity(_0x4205f4,_0x2df62b){return function(_0x23f4ce){if(_0x23f4ce){return _0x23f4ce[_0x2c76('0x33')]()[_0x2c76('0x1e')](function(){_0x4205f4[_0x2c76('0x27')](0xcc)[_0x2c76('0x28')]();});}};}function handleEntityNotFound(_0x9eae29,_0x1dc8c3){return function(_0x5016e1){if(!_0x5016e1){_0x9eae29['sendStatus'](0x194);}return _0x5016e1;};}function handleError(_0x32a884,_0x11ac03){_0x11ac03=_0x11ac03||0x1f4;return function(_0x30d9e1){logger[_0x2c76('0x23')](_0x30d9e1['stack']);if(_0x30d9e1[_0x2c76('0x34')]){delete _0x30d9e1[_0x2c76('0x34')];}_0x32a884['status'](_0x11ac03)['send'](_0x30d9e1);};}exports['index']=function(_0x696bff,_0x2968d8){var _0x9ed96e={},_0x84ef3a={},_0x4e1a5d={'count':0x0,'rows':[]};var _0x21be44=_[_0x2c76('0x35')](db['WhatsappMessage'][_0x2c76('0x36')],function(_0x4f061f){return{'name':_0x4f061f[_0x2c76('0x37')],'type':_0x4f061f[_0x2c76('0x38')][_0x2c76('0x39')]};});_0x84ef3a[_0x2c76('0x3a')]=_[_0x2c76('0x35')](_0x21be44,_0x2c76('0x34'));_0x84ef3a[_0x2c76('0x3b')]=_[_0x2c76('0x3c')](_0x696bff[_0x2c76('0x3b')]);_0x84ef3a[_0x2c76('0x3d')]=_['intersection'](_0x84ef3a[_0x2c76('0x3a')],_0x84ef3a['query']);_0x9ed96e[_0x2c76('0x3e')]=_['intersection'](_0x84ef3a[_0x2c76('0x3a')],qs[_0x2c76('0x3f')](_0x696bff['query']['fields']));_0x9ed96e['attributes']=_0x9ed96e[_0x2c76('0x3e')][_0x2c76('0x40')]?_0x9ed96e[_0x2c76('0x3e')]:_0x84ef3a[_0x2c76('0x3a')];if(!_0x696bff[_0x2c76('0x3b')]['hasOwnProperty']('nolimit')){_0x9ed96e[_0x2c76('0x2c')]=qs['limit'](_0x696bff['query'][_0x2c76('0x2c')]);_0x9ed96e[_0x2c76('0x2a')]=qs[_0x2c76('0x2a')](_0x696bff[_0x2c76('0x3b')][_0x2c76('0x2a')]);}_0x9ed96e[_0x2c76('0x41')]=qs[_0x2c76('0x42')](_0x696bff[_0x2c76('0x3b')][_0x2c76('0x42')]);_0x9ed96e[_0x2c76('0x43')]=qs[_0x2c76('0x3d')](_['pick'](_0x696bff[_0x2c76('0x3b')],_0x84ef3a[_0x2c76('0x3d')]),_0x21be44);if(_0x696bff['query'][_0x2c76('0x44')]){_0x9ed96e['where']=_[_0x2c76('0x45')](_0x9ed96e['where'],{'$or':_['map'](_0x21be44,function(_0x40d0f8){if(_0x40d0f8[_0x2c76('0x38')]!==_0x2c76('0x46')){var _0x4d7ee6={};_0x4d7ee6[_0x40d0f8[_0x2c76('0x34')]]={'$like':'%'+_0x696bff[_0x2c76('0x3b')]['filter']+'%'};return _0x4d7ee6;}})});}_0x9ed96e=_['merge']({},_0x9ed96e,_0x696bff[_0x2c76('0x47')]);var _0x5b3103={'where':_0x9ed96e[_0x2c76('0x43')]};return db[_0x2c76('0x48')][_0x2c76('0x2d')](_0x5b3103)['then'](function(_0x13497c){_0x4e1a5d['count']=_0x13497c;if(_0x696bff[_0x2c76('0x3b')][_0x2c76('0x49')]){_0x9ed96e['include']=[{'all':!![]}];}return db[_0x2c76('0x48')]['findAll'](_0x9ed96e);})[_0x2c76('0x1e')](function(_0x4cb2df){_0x4e1a5d[_0x2c76('0x4a')]=_0x4cb2df;return _0x4e1a5d;})['then'](respondWithFilteredResult(_0x2968d8,_0x9ed96e))['catch'](handleError(_0x2968d8,null));};exports['show']=function(_0x4062c2,_0x334c8f){var _0x48a6df={'raw':!![],'where':{'id':_0x4062c2['params']['id']}},_0x466726={};_0x466726[_0x2c76('0x3a')]=_[_0x2c76('0x3c')](db[_0x2c76('0x48')][_0x2c76('0x36')]);_0x466726[_0x2c76('0x3b')]=_['keys'](_0x4062c2['query']);_0x466726[_0x2c76('0x3d')]=_[_0x2c76('0x4b')](_0x466726[_0x2c76('0x3a')],_0x466726[_0x2c76('0x3b')]);_0x48a6df[_0x2c76('0x3e')]=_[_0x2c76('0x4b')](_0x466726['model'],qs[_0x2c76('0x3f')](_0x4062c2[_0x2c76('0x3b')][_0x2c76('0x3f')]));_0x48a6df[_0x2c76('0x3e')]=_0x48a6df['attributes'][_0x2c76('0x40')]?_0x48a6df[_0x2c76('0x3e')]:_0x466726[_0x2c76('0x3a')];if(_0x4062c2[_0x2c76('0x3b')][_0x2c76('0x49')]){_0x48a6df['include']=[{'all':!![]}];}_0x48a6df=_['merge']({},_0x48a6df,_0x4062c2[_0x2c76('0x47')]);return db['WhatsappMessage'][_0x2c76('0x4c')](_0x48a6df)[_0x2c76('0x1e')](handleEntityNotFound(_0x334c8f,null))['then'](respondWithResult(_0x334c8f,null))[_0x2c76('0x4d')](handleError(_0x334c8f,null));};exports['create']=function(_0x21f7e8,_0x3e89ac){return db['WhatsappMessage'][_0x2c76('0x4e')](_0x21f7e8[_0x2c76('0x4f')],{})[_0x2c76('0x1e')](respondWithResult(_0x3e89ac,0xc9))[_0x2c76('0x4d')](handleError(_0x3e89ac,null));};exports['update']=function(_0x569068,_0x336ba6){if(_0x569068[_0x2c76('0x4f')]['id']){delete _0x569068[_0x2c76('0x4f')]['id'];}return db[_0x2c76('0x48')][_0x2c76('0x4c')]({'where':{'id':_0x569068[_0x2c76('0x50')]['id']}})[_0x2c76('0x1e')](handleEntityNotFound(_0x336ba6,null))['then'](saveUpdates(_0x569068[_0x2c76('0x4f')],null))['then'](respondWithResult(_0x336ba6,null))[_0x2c76('0x4d')](handleError(_0x336ba6,null));};exports[_0x2c76('0x33')]=function(_0x2758e5,_0x8220dc){return db[_0x2c76('0x48')][_0x2c76('0x4c')]({'where':{'id':_0x2758e5[_0x2c76('0x50')]['id']}})[_0x2c76('0x1e')](handleEntityNotFound(_0x8220dc,null))[_0x2c76('0x1e')](removeEntity(_0x8220dc,null))[_0x2c76('0x4d')](handleError(_0x8220dc,null));};exports[_0x2c76('0x51')]=function(_0x162e59,_0x1e1ec0){return db['WhatsappMessage'][_0x2c76('0x51')]()['then'](respondWithResult(_0x1e1ec0,null))[_0x2c76('0x4d')](handleError(_0x1e1ec0,null));};var interaction_log=require('../../config/logger')(_0x2c76('0x52'));exports[_0x2c76('0x53')]=function(_0x3176a2,_0xfdd072,_0x1881d6){var _0x343b6b={'agent':{},'channel':_0x2c76('0x54')};if(_0x3176a2[_0x2c76('0x4f')]['id']){delete _0x3176a2['body']['id'];}_0x3176a2[_0x2c76('0x4f')][_0x2c76('0x55')]=!![];_0x3176a2['body'][_0x2c76('0x56')]=moment()[_0x2c76('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x3176a2[_0x2c76('0x4f')][_0x2c76('0x58')]=_0x3176a2[_0x2c76('0x4f')][_0x2c76('0x58')]||_0x3176a2['user']['id'];_0x343b6b['agent']['id']=_0x3176a2[_0x2c76('0x4f')][_0x2c76('0x58')];return db[_0x2c76('0x48')][_0x2c76('0x4c')]({'where':{'id':_0x3176a2['params']['id'],'UserId':null}})[_0x2c76('0x1e')](handleEntityNotFound(_0xfdd072,null))[_0x2c76('0x1e')](saveUpdates(_0x3176a2[_0x2c76('0x4f')],null))[_0x2c76('0x1e')](function(_0x557bb5){if(_0x557bb5){_0x343b6b[_0x2c76('0x25')]=_0x557bb5[_0x2c76('0x59')]({'plain':!![]});return db[_0x2c76('0x5a')][_0x2c76('0x4c')]({'where':{'id':_0x557bb5['WhatsappInteractionId']}});}return null;})[_0x2c76('0x1e')](handleEntityNotFound(_0xfdd072,null))[_0x2c76('0x1e')](function(_0x4b6b08){if(_0x4b6b08){return _0x4b6b08[_0x2c76('0x32')]({'UserId':_0x3176a2[_0x2c76('0x4f')][_0x2c76('0x58')],'read1stAt':_['isNil'](_0x4b6b08[_0x2c76('0x5b')])?moment()[_0x2c76('0x57')](_0x2c76('0x5c')):undefined});}return null;})['then'](function(_0x197524){if(_0x197524){_0x343b6b[_0x2c76('0x5d')]=_0x197524[_0x2c76('0x59')]({'plain':!![]});interaction_log[_0x2c76('0x5e')](_0x2c76('0x5f'),_0x3176a2[_0x2c76('0x60')]['id'],_0x3176a2['user'][_0x2c76('0x34')],_0x3176a2['user'][_0x2c76('0x61')],_0x343b6b[_0x2c76('0x5d')]['id'],_0x3176a2[_0x2c76('0x4f')]?JSON[_0x2c76('0x22')](_0x3176a2[_0x2c76('0x4f')]):_0x2c76('0x62'));return respondWithRpcPromise(_0x2c76('0x63'),_0x2c76('0x64'),_0x343b6b);}return null;})[_0x2c76('0x1e')](function(_0x3e4ddf){var _0x2a3856=_0x2c76('0x65')+_0x3e4ddf[_0x2c76('0x25')][_0x2c76('0x66')];return db[_0x2c76('0x67')][_0x2c76('0x3b')](_0x2a3856,{'type':db['Sequelize'][_0x2c76('0x68')][_0x2c76('0x69')],'raw':!![]})[_0x2c76('0x1e')](function(_0x343437){return _0x343437;});})[_0x2c76('0x1e')](function(_0x9b041d){if(_0x9b041d){_0x343b6b[_0x2c76('0x25')][_0x2c76('0x6a')]=_0x9b041d[0x0];if(!_0x3176a2['body']['UserId'])return;return db[_0x2c76('0x6b')][_0x2c76('0x4c')]({'where':{'id':_0x3176a2['body']['UserId'],'role':'agent'},'attributes':['id',_0x2c76('0x34'),'fullname','email',_0x2c76('0x6c')],'raw':!![]});}return null;})[_0x2c76('0x1e')](function(_0x40603e){if(!_0x40603e)return null;_0x343b6b[_0x2c76('0x25')][_0x2c76('0x6d')]=_0x40603e;return _0x343b6b;})[_0x2c76('0x1e')](function(_0x257c33){if(_0x257c33){if(_0x3176a2[_0x2c76('0x4f')]['manual']){_0x343b6b[_0x2c76('0x25')][_0x2c76('0x6e')]=util[_0x2c76('0x57')]('SIP/%s',_0x3176a2['user']['name']);_0x343b6b[_0x2c76('0x25')]['channel']=_0x343b6b[_0x2c76('0x6f')];_0x343b6b[_0x2c76('0x25')]['motionChannel']=_0x343b6b[_0x2c76('0x6f')];_0x343b6b[_0x2c76('0x25')][_0x2c76('0x70')]=_0x2c76('0x53');return respondWithRpcPromise(_0x2c76('0x71'),'EventManager',{'event':'acceptmessage','message':_0x343b6b['message']},client9002)[_0x2c76('0x1e')](function(){return _0x343b6b;});}return _0x343b6b;}return null;})[_0x2c76('0x1e')](respondWithResult(_0xfdd072,null))[_0x2c76('0x4d')](handleError(_0xfdd072,null));};var interaction_log=require(_0x2c76('0x72'))('whatsapp-interactions');exports[_0x2c76('0x30')]=function(_0x2e94a7,_0x2818c8,_0x33ff0c){var _0x2827ab={'agent':{},'channel':'whatsapp'};if(_0x2e94a7[_0x2c76('0x4f')]['id']){delete _0x2e94a7[_0x2c76('0x4f')]['id'];}_0x2e94a7['body'][_0x2c76('0x58')]=_0x2e94a7['body']['UserId']||_0x2e94a7[_0x2c76('0x60')]['id'];_0x2827ab['agent']['id']=_0x2e94a7[_0x2c76('0x4f')][_0x2c76('0x58')];return db['WhatsappMessage'][_0x2c76('0x4c')]({'where':{'id':_0x2e94a7[_0x2c76('0x50')]['id'],'UserId':null}})[_0x2c76('0x1e')](handleEntityNotFound(_0x2818c8,null))[_0x2c76('0x1e')](function(_0x435b18){if(_0x435b18){_0x2827ab[_0x2c76('0x25')]=_0x435b18[_0x2c76('0x59')]({'plain':!![]});return db[_0x2c76('0x5a')][_0x2c76('0x4c')]({'where':{'id':_0x435b18[_0x2c76('0x73')]}});}return null;})['then'](handleEntityNotFound(_0x2818c8,null))['then'](function(_0x563fb7){if(_0x563fb7){_0x2827ab[_0x2c76('0x5d')]=_0x563fb7[_0x2c76('0x59')]({'plain':!![]});interaction_log[_0x2c76('0x5e')](_0x2c76('0x74'),_0x2e94a7[_0x2c76('0x60')]['id'],_0x2e94a7[_0x2c76('0x60')][_0x2c76('0x34')],_0x2e94a7['user'][_0x2c76('0x61')],_0x2827ab['interaction']['id'],_0x2e94a7['body']?JSON[_0x2c76('0x22')](_0x2e94a7['body']):_0x2c76('0x62'));return respondWithRpcPromise(_0x2c76('0x75'),'rejectMessage',_0x2827ab);}return null;})['then'](function(_0x29aaf3){var _0x3e1a5e=_0x2c76('0x65')+_0x29aaf3[_0x2c76('0x25')][_0x2c76('0x66')];return db[_0x2c76('0x67')][_0x2c76('0x3b')](_0x3e1a5e,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0x2c76('0x1e')](function(_0x28254e){return _0x28254e;});})['then'](function(_0x3ff255){if(_0x3ff255){_0x2827ab['message'][_0x2c76('0x6a')]=_0x3ff255[0x0];if(!_0x2e94a7[_0x2c76('0x4f')][_0x2c76('0x58')])return;return db[_0x2c76('0x6b')][_0x2c76('0x4c')]({'where':{'id':_0x2e94a7[_0x2c76('0x4f')][_0x2c76('0x58')],'role':'agent'},'attributes':['id',_0x2c76('0x34'),_0x2c76('0x76'),_0x2c76('0x77'),'internal'],'raw':!![]});}return null;})['then'](function(_0x26f146){if(!_0x26f146)return null;_0x2827ab['message'][_0x2c76('0x6d')]=_0x26f146;return _0x2827ab;})['then'](function(_0x2b774c){if(_0x2b774c){_0x2b774c['message'][_0x2c76('0x6e')]=util[_0x2c76('0x57')](_0x2c76('0x78'),_0x2e94a7['user'][_0x2c76('0x34')]);_0x2b774c[_0x2c76('0x25')][_0x2c76('0x6f')]=_0x2827ab['channel'];_0x2b774c[_0x2c76('0x25')][_0x2c76('0x79')]=_0x2827ab['channel'];_0x2b774c[_0x2c76('0x25')][_0x2c76('0x70')]=_0x2c76('0x30');respondWithRpcPromise(_0x2c76('0x71'),_0x2c76('0x71'),{'event':_0x2c76('0x7a'),'message':_0x2b774c[_0x2c76('0x25')]},client9002);return _0x2827ab;}return null;})[_0x2c76('0x1e')](respondWithResult(_0x2818c8,null))[_0x2c76('0x4d')](handleError(_0x2818c8,null));};exports[_0x2c76('0x27')]=function(_0x473418,_0x235a8d,_0x2cbe3e){if(_0x473418[_0x2c76('0x4f')]['id']){delete _0x473418[_0x2c76('0x4f')]['id'];}var _0x5ae0ab;return db[_0x2c76('0x48')]['find']({'where':{'id':_0x473418[_0x2c76('0x50')]['id']}})[_0x2c76('0x1e')](handleEntityNotFound(_0x235a8d,null))[_0x2c76('0x1e')](function(_0x4cbd9f){if(_0x4cbd9f){_0x5ae0ab=_0x4cbd9f;return db[_0x2c76('0x7b')][_0x2c76('0x4c')]({'where':{'id':_0x4cbd9f['WhatsappAccountId']}});}})['then'](handleEntityNotFound(_0x235a8d,null))[_0x2c76('0x1e')](function(_0x37b41a){if(_0x37b41a){logger[_0x2c76('0x21')](_0x2c76('0x7c'),_0x2c76('0x27'),_0x2c76('0x7d'),_0x37b41a[_0x2c76('0x38')],util[_0x2c76('0x7e')](_0x473418[_0x2c76('0x4f')],{'showHidden':![],'depth':null}));switch(_0x37b41a[_0x2c76('0x38')]){case'twilio':if(_0x473418[_0x2c76('0x4f')][_0x2c76('0x7f')]&&_0x473418[_0x2c76('0x4f')][_0x2c76('0x7f')]===_0x5ae0ab[_0x2c76('0x80')]&&_0x473418[_0x2c76('0x4f')][_0x2c76('0x81')]&&_0x473418['body'][_0x2c76('0x81')]===_0x2c76('0x55')){return _0x5ae0ab[_0x2c76('0x32')]({'read':!![]});}else{logger['error'](_0x2c76('0x82'),_0x2c76('0x27'),'twilio',util[_0x2c76('0x7e')](_0x473418[_0x2c76('0x4f')],{'showHidden':![],'depth':null}));}break;}return _0x5ae0ab;}})[_0x2c76('0x1e')](respondWithResult(_0x235a8d,null))[_0x2c76('0x4d')](handleError(_0x235a8d,null));}; \ No newline at end of file +var _0x1a0e=['attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','params','rawAttributes','options','find','create','body','destroy','describe','whatsapp-interactions','accept','read','UserId','user','agent','format','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','contact','email','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','whatsapp','WhatsappInteractionId','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','SELECT','User','fullname','internal','rejectmessage','WhatsappAccount','WhatsappAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','WhatsappMessage,\x20%s,\x20%s','message','catch','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','stack','name','send','index','map','WhatsappMessage','type','query','keys','filters','model'];(function(_0x368b9e,_0x2ae528){var _0x8dc3ea=function(_0x4b2edc){while(--_0x4b2edc){_0x368b9e['push'](_0x368b9e['shift']());}};_0x8dc3ea(++_0x2ae528);}(_0x1a0e,0x1d6));var _0xe1a0=function(_0x2b7389,_0x58311b){_0x2b7389=_0x2b7389-0x0;var _0xe5d9da=_0x1a0e[_0x2b7389];return _0xe5d9da;};'use strict';var emlformat=require(_0xe1a0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe1a0('0x1'));var jsonpatch=require(_0xe1a0('0x2'));var rp=require('request-promise');var moment=require(_0xe1a0('0x3'));var BPromise=require(_0xe1a0('0x4'));var Mustache=require('mustache');var util=require(_0xe1a0('0x5'));var path=require('path');var sox=require(_0xe1a0('0x6'));var csv=require(_0xe1a0('0x7'));var ejs=require(_0xe1a0('0x8'));var fs=require('fs');var fs_extra=require(_0xe1a0('0x9'));var _=require(_0xe1a0('0xa'));var squel=require('squel');var crypto=require(_0xe1a0('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe1a0('0xc'));var toCsv=require(_0xe1a0('0x7'));var querystring=require(_0xe1a0('0xd'));var Papa=require(_0xe1a0('0xe'));var Redis=require(_0xe1a0('0xf'));var authService=require(_0xe1a0('0x10'));var qs=require(_0xe1a0('0x11'));var as=require(_0xe1a0('0x12'));var hardwareService=require(_0xe1a0('0x13'));var logger=require(_0xe1a0('0x14'))(_0xe1a0('0x15'));var utils=require(_0xe1a0('0x16'));var config=require(_0xe1a0('0x17'));var licenseUtil=require(_0xe1a0('0x18'));var db=require(_0xe1a0('0x19'))['db'];config[_0xe1a0('0x1a')]=_['defaults'](config[_0xe1a0('0x1a')],{'host':_0xe1a0('0x1b'),'port':0x18eb});var socket=require(_0xe1a0('0x1c'))(new Redis(config[_0xe1a0('0x1a')]));require('./whatsappMessage.socket')[_0xe1a0('0x1d')](socket);var jayson=require(_0xe1a0('0x1e'));var client=jayson[_0xe1a0('0x1f')][_0xe1a0('0x20')]({'port':0x232c});var client9002=jayson[_0xe1a0('0x1f')][_0xe1a0('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x5ac2d6,_0x35bac2,_0xd760a2,_0x1232b2){return new BPromise(function(_0x372a67,_0x3f1d48){var _0x3865bc=_0x1232b2||client;return _0x3865bc['request'](_0x5ac2d6,_0xd760a2)[_0xe1a0('0x21')](function(_0x3fae0f){logger[_0xe1a0('0x22')]('WhatsappMessage,\x20%s,\x20%s',_0x35bac2,_0xe1a0('0x23'));logger[_0xe1a0('0x24')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x35bac2,_0xe1a0('0x23'),JSON[_0xe1a0('0x25')](_0x3fae0f));if(_0x3fae0f[_0xe1a0('0x26')]){if(_0x3fae0f['error'][_0xe1a0('0x27')]===0x1f4){logger[_0xe1a0('0x26')](_0xe1a0('0x28'),_0x35bac2,_0x3fae0f[_0xe1a0('0x26')]['message']);return _0x3f1d48(_0x3fae0f['error']['message']);}logger['error'](_0xe1a0('0x28'),_0x35bac2,_0x3fae0f[_0xe1a0('0x26')][_0xe1a0('0x29')]);return _0x372a67(_0x3fae0f[_0xe1a0('0x26')][_0xe1a0('0x29')]);}else{logger[_0xe1a0('0x22')](_0xe1a0('0x28'),_0x35bac2,_0xe1a0('0x23'));_0x372a67(_0x3fae0f['result'][_0xe1a0('0x29')]);}})[_0xe1a0('0x2a')](function(_0x218493){logger[_0xe1a0('0x26')](_0xe1a0('0x28'),_0x35bac2,_0x218493);_0x3f1d48(_0x218493);});});}function respondWithStatusCode(_0x2273c0,_0x3b9d3e){_0x3b9d3e=_0x3b9d3e||0xcc;return function(_0x54934b){if(_0x54934b){return _0x2273c0[_0xe1a0('0x2b')](_0x3b9d3e);}return _0x2273c0['status'](_0x3b9d3e)['end']();};}function respondWithResult(_0x5bd19a,_0x34bd86){_0x34bd86=_0x34bd86||0xc8;return function(_0x1617f0){if(_0x1617f0){return _0x5bd19a[_0xe1a0('0x2c')](_0x34bd86)[_0xe1a0('0x2d')](_0x1617f0);}};}function respondWithFilteredResult(_0x218f72,_0x2e558c){return function(_0x7081a6){if(_0x7081a6){var _0x48da17=typeof _0x2e558c[_0xe1a0('0x2e')]==='undefined'&&typeof _0x2e558c[_0xe1a0('0x2f')]===_0xe1a0('0x30');var _0x1c2144=_0x7081a6['count'];var _0xcfdafc=_0x48da17?0x0:_0x2e558c[_0xe1a0('0x2e')];var _0x1b5044=_0x48da17?_0x7081a6[_0xe1a0('0x31')]:_0x2e558c[_0xe1a0('0x2e')]+_0x2e558c[_0xe1a0('0x2f')];var _0x59b381;if(_0x1b5044>=_0x1c2144){_0x1b5044=_0x1c2144;_0x59b381=0xc8;}else{_0x59b381=0xce;}_0x218f72['status'](_0x59b381);return _0x218f72['set'](_0xe1a0('0x32'),_0xcfdafc+'-'+_0x1b5044+'/'+_0x1c2144)['json'](_0x7081a6);}return null;};}function patchUpdates(_0x368358){return function(_0xfbbcee){try{jsonpatch[_0xe1a0('0x33')](_0xfbbcee,_0x368358,!![]);}catch(_0x3a6c92){return BPromise[_0xe1a0('0x34')](_0x3a6c92);}return _0xfbbcee[_0xe1a0('0x35')]();};}function saveUpdates(_0x5c1d23,_0x245cad){return function(_0x447792){if(_0x447792){return _0x447792[_0xe1a0('0x36')](_0x5c1d23)['then'](function(_0x3199ad){return _0x3199ad;});}return null;};}function removeEntity(_0x374db8,_0x49f78e){return function(_0x21584c){if(_0x21584c){return _0x21584c['destroy']()['then'](function(){_0x374db8[_0xe1a0('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55259f,_0x277dc2){return function(_0x4a23c0){if(!_0x4a23c0){_0x55259f[_0xe1a0('0x2b')](0x194);}return _0x4a23c0;};}function handleError(_0x5b436f,_0x2effd2){_0x2effd2=_0x2effd2||0x1f4;return function(_0x546291){logger[_0xe1a0('0x26')](_0x546291[_0xe1a0('0x37')]);if(_0x546291[_0xe1a0('0x38')]){delete _0x546291[_0xe1a0('0x38')];}_0x5b436f[_0xe1a0('0x2c')](_0x2effd2)[_0xe1a0('0x39')](_0x546291);};}exports[_0xe1a0('0x3a')]=function(_0x465957,_0x27997a){var _0x2282e5={},_0x2c8fe8={},_0x3f6f16={'count':0x0,'rows':[]};var _0x1c9c63=_[_0xe1a0('0x3b')](db[_0xe1a0('0x3c')]['rawAttributes'],function(_0x5af2e9){return{'name':_0x5af2e9['fieldName'],'type':_0x5af2e9[_0xe1a0('0x3d')]['key']};});_0x2c8fe8['model']=_['map'](_0x1c9c63,_0xe1a0('0x38'));_0x2c8fe8[_0xe1a0('0x3e')]=_[_0xe1a0('0x3f')](_0x465957[_0xe1a0('0x3e')]);_0x2c8fe8[_0xe1a0('0x40')]=_['intersection'](_0x2c8fe8[_0xe1a0('0x41')],_0x2c8fe8[_0xe1a0('0x3e')]);_0x2282e5[_0xe1a0('0x42')]=_[_0xe1a0('0x43')](_0x2c8fe8['model'],qs[_0xe1a0('0x44')](_0x465957[_0xe1a0('0x3e')][_0xe1a0('0x44')]));_0x2282e5[_0xe1a0('0x42')]=_0x2282e5[_0xe1a0('0x42')][_0xe1a0('0x45')]?_0x2282e5[_0xe1a0('0x42')]:_0x2c8fe8[_0xe1a0('0x41')];if(!_0x465957['query'][_0xe1a0('0x46')]('nolimit')){_0x2282e5[_0xe1a0('0x2f')]=qs[_0xe1a0('0x2f')](_0x465957[_0xe1a0('0x3e')][_0xe1a0('0x2f')]);_0x2282e5[_0xe1a0('0x2e')]=qs[_0xe1a0('0x2e')](_0x465957[_0xe1a0('0x3e')][_0xe1a0('0x2e')]);}_0x2282e5[_0xe1a0('0x47')]=qs['sort'](_0x465957[_0xe1a0('0x3e')][_0xe1a0('0x48')]);_0x2282e5[_0xe1a0('0x49')]=qs[_0xe1a0('0x40')](_[_0xe1a0('0x4a')](_0x465957[_0xe1a0('0x3e')],_0x2c8fe8[_0xe1a0('0x40')]),_0x1c9c63);if(_0x465957[_0xe1a0('0x3e')][_0xe1a0('0x4b')]){_0x2282e5[_0xe1a0('0x49')]=_[_0xe1a0('0x4c')](_0x2282e5[_0xe1a0('0x49')],{'$or':_[_0xe1a0('0x3b')](_0x1c9c63,function(_0x5240a1){if(_0x5240a1['type']!==_0xe1a0('0x4d')){var _0x37fa59={};_0x37fa59[_0x5240a1[_0xe1a0('0x38')]]={'$like':'%'+_0x465957[_0xe1a0('0x3e')][_0xe1a0('0x4b')]+'%'};return _0x37fa59;}})});}_0x2282e5=_['merge']({},_0x2282e5,_0x465957['options']);var _0x2c30f3={'where':_0x2282e5[_0xe1a0('0x49')]};return db[_0xe1a0('0x3c')][_0xe1a0('0x31')](_0x2c30f3)[_0xe1a0('0x21')](function(_0x5cfaa1){_0x3f6f16['count']=_0x5cfaa1;if(_0x465957['query'][_0xe1a0('0x4e')]){_0x2282e5[_0xe1a0('0x4f')]=[{'all':!![]}];}return db[_0xe1a0('0x3c')][_0xe1a0('0x50')](_0x2282e5);})[_0xe1a0('0x21')](function(_0x513fbf){_0x3f6f16['rows']=_0x513fbf;return _0x3f6f16;})[_0xe1a0('0x21')](respondWithFilteredResult(_0x27997a,_0x2282e5))[_0xe1a0('0x2a')](handleError(_0x27997a,null));};exports['show']=function(_0x531324,_0x34f0a8){var _0x3d2e9e={'raw':!![],'where':{'id':_0x531324[_0xe1a0('0x51')]['id']}},_0x4794a7={};_0x4794a7['model']=_[_0xe1a0('0x3f')](db[_0xe1a0('0x3c')][_0xe1a0('0x52')]);_0x4794a7[_0xe1a0('0x3e')]=_[_0xe1a0('0x3f')](_0x531324['query']);_0x4794a7[_0xe1a0('0x40')]=_[_0xe1a0('0x43')](_0x4794a7[_0xe1a0('0x41')],_0x4794a7[_0xe1a0('0x3e')]);_0x3d2e9e['attributes']=_[_0xe1a0('0x43')](_0x4794a7[_0xe1a0('0x41')],qs[_0xe1a0('0x44')](_0x531324[_0xe1a0('0x3e')][_0xe1a0('0x44')]));_0x3d2e9e[_0xe1a0('0x42')]=_0x3d2e9e[_0xe1a0('0x42')][_0xe1a0('0x45')]?_0x3d2e9e['attributes']:_0x4794a7[_0xe1a0('0x41')];if(_0x531324[_0xe1a0('0x3e')][_0xe1a0('0x4e')]){_0x3d2e9e[_0xe1a0('0x4f')]=[{'all':!![]}];}_0x3d2e9e=_[_0xe1a0('0x4c')]({},_0x3d2e9e,_0x531324[_0xe1a0('0x53')]);return db[_0xe1a0('0x3c')][_0xe1a0('0x54')](_0x3d2e9e)[_0xe1a0('0x21')](handleEntityNotFound(_0x34f0a8,null))['then'](respondWithResult(_0x34f0a8,null))['catch'](handleError(_0x34f0a8,null));};exports[_0xe1a0('0x55')]=function(_0x36412a,_0xaa62e9){return db[_0xe1a0('0x3c')][_0xe1a0('0x55')](_0x36412a['body'],{})[_0xe1a0('0x21')](respondWithResult(_0xaa62e9,0xc9))[_0xe1a0('0x2a')](handleError(_0xaa62e9,null));};exports['update']=function(_0x4f4b01,_0x79178){if(_0x4f4b01[_0xe1a0('0x56')]['id']){delete _0x4f4b01['body']['id'];}return db['WhatsappMessage'][_0xe1a0('0x54')]({'where':{'id':_0x4f4b01[_0xe1a0('0x51')]['id']}})['then'](handleEntityNotFound(_0x79178,null))[_0xe1a0('0x21')](saveUpdates(_0x4f4b01[_0xe1a0('0x56')],null))[_0xe1a0('0x21')](respondWithResult(_0x79178,null))[_0xe1a0('0x2a')](handleError(_0x79178,null));};exports[_0xe1a0('0x57')]=function(_0x1caae9,_0x3fb2f1){return db['WhatsappMessage']['find']({'where':{'id':_0x1caae9[_0xe1a0('0x51')]['id']}})['then'](handleEntityNotFound(_0x3fb2f1,null))[_0xe1a0('0x21')](removeEntity(_0x3fb2f1,null))['catch'](handleError(_0x3fb2f1,null));};exports[_0xe1a0('0x58')]=function(_0x3c0390,_0x2f7561){return db['WhatsappMessage'][_0xe1a0('0x58')]()[_0xe1a0('0x21')](respondWithResult(_0x2f7561,null))[_0xe1a0('0x2a')](handleError(_0x2f7561,null));};var interaction_log=require(_0xe1a0('0x14'))(_0xe1a0('0x59'));exports[_0xe1a0('0x5a')]=function(_0x3fe057,_0x15a3ec,_0x5cb05b){var _0x54253a={'agent':{},'channel':'whatsapp'};if(_0x3fe057['body']['id']){delete _0x3fe057[_0xe1a0('0x56')]['id'];}_0x3fe057[_0xe1a0('0x56')][_0xe1a0('0x5b')]=!![];_0x3fe057[_0xe1a0('0x56')]['readAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3fe057[_0xe1a0('0x56')]['UserId']=_0x3fe057[_0xe1a0('0x56')][_0xe1a0('0x5c')]||_0x3fe057[_0xe1a0('0x5d')]['id'];_0x54253a[_0xe1a0('0x5e')]['id']=_0x3fe057[_0xe1a0('0x56')][_0xe1a0('0x5c')];return db['WhatsappMessage'][_0xe1a0('0x54')]({'where':{'id':_0x3fe057[_0xe1a0('0x51')]['id'],'UserId':null}})[_0xe1a0('0x21')](handleEntityNotFound(_0x15a3ec,null))['then'](saveUpdates(_0x3fe057[_0xe1a0('0x56')],null))['then'](function(_0x56f379){if(_0x56f379){_0x54253a[_0xe1a0('0x29')]=_0x56f379['get']({'plain':!![]});return db['WhatsappInteraction'][_0xe1a0('0x54')]({'where':{'id':_0x56f379['WhatsappInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x15a3ec,null))[_0xe1a0('0x21')](function(_0x51d430){if(_0x51d430){return _0x51d430['update']({'UserId':_0x3fe057[_0xe1a0('0x56')]['UserId'],'read1stAt':_['isNil'](_0x51d430['read1stAt'])?moment()[_0xe1a0('0x5f')](_0xe1a0('0x60')):undefined});}return null;})[_0xe1a0('0x21')](function(_0x12d3fd){if(_0x12d3fd){_0x54253a[_0xe1a0('0x61')]=_0x12d3fd[_0xe1a0('0x62')]({'plain':!![]});interaction_log['info'](_0xe1a0('0x63'),_0x3fe057[_0xe1a0('0x5d')]['id'],_0x3fe057[_0xe1a0('0x5d')][_0xe1a0('0x38')],_0x3fe057[_0xe1a0('0x5d')]['role'],_0x54253a[_0xe1a0('0x61')]['id'],_0x3fe057[_0xe1a0('0x56')]?JSON[_0xe1a0('0x25')](_0x3fe057[_0xe1a0('0x56')]):_0xe1a0('0x64'));return respondWithRpcPromise(_0xe1a0('0x65'),_0xe1a0('0x66'),_0x54253a);}return null;})[_0xe1a0('0x21')](function(_0x66670b){var _0x2a3508='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x66670b[_0xe1a0('0x29')][_0xe1a0('0x67')];return db[_0xe1a0('0x68')][_0xe1a0('0x3e')](_0x2a3508,{'type':db[_0xe1a0('0x69')][_0xe1a0('0x6a')]['SELECT'],'raw':!![]})['then'](function(_0x2d93e4){return _0x2d93e4;});})[_0xe1a0('0x21')](function(_0x263432){if(_0x263432){_0x54253a['message'][_0xe1a0('0x6b')]=_0x263432[0x0];if(!_0x3fe057[_0xe1a0('0x56')][_0xe1a0('0x5c')])return;return db['User'][_0xe1a0('0x54')]({'where':{'id':_0x3fe057[_0xe1a0('0x56')]['UserId'],'role':_0xe1a0('0x5e')},'attributes':['id',_0xe1a0('0x38'),'fullname',_0xe1a0('0x6c'),'internal'],'raw':!![]});}return null;})['then'](function(_0xf835d3){if(!_0xf835d3)return null;_0x54253a[_0xe1a0('0x29')][_0xe1a0('0x5e')]=_0xf835d3;return _0x54253a;})[_0xe1a0('0x21')](function(_0xb63f9a){if(_0xb63f9a){if(_0x3fe057['body']['manual']){_0x54253a[_0xe1a0('0x29')][_0xe1a0('0x6d')]=util[_0xe1a0('0x5f')](_0xe1a0('0x6e'),_0x3fe057[_0xe1a0('0x5d')][_0xe1a0('0x38')]);_0x54253a[_0xe1a0('0x29')][_0xe1a0('0x6f')]=_0x54253a[_0xe1a0('0x6f')];_0x54253a[_0xe1a0('0x29')][_0xe1a0('0x70')]=_0x54253a[_0xe1a0('0x6f')];_0x54253a[_0xe1a0('0x29')]['event']=_0xe1a0('0x5a');return respondWithRpcPromise(_0xe1a0('0x71'),_0xe1a0('0x71'),{'event':_0xe1a0('0x72'),'message':_0x54253a[_0xe1a0('0x29')]},client9002)[_0xe1a0('0x21')](function(){return _0x54253a;});}return _0x54253a;}return null;})['then'](respondWithResult(_0x15a3ec,null))[_0xe1a0('0x2a')](handleError(_0x15a3ec,null));};var interaction_log=require(_0xe1a0('0x14'))(_0xe1a0('0x59'));exports[_0xe1a0('0x34')]=function(_0x13f117,_0x4b7451,_0x395b43){var _0x506735={'agent':{},'channel':_0xe1a0('0x73')};if(_0x13f117['body']['id']){delete _0x13f117[_0xe1a0('0x56')]['id'];}_0x13f117['body'][_0xe1a0('0x5c')]=_0x13f117[_0xe1a0('0x56')][_0xe1a0('0x5c')]||_0x13f117[_0xe1a0('0x5d')]['id'];_0x506735[_0xe1a0('0x5e')]['id']=_0x13f117[_0xe1a0('0x56')][_0xe1a0('0x5c')];return db[_0xe1a0('0x3c')]['find']({'where':{'id':_0x13f117[_0xe1a0('0x51')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4b7451,null))[_0xe1a0('0x21')](function(_0x3d17e5){if(_0x3d17e5){_0x506735[_0xe1a0('0x29')]=_0x3d17e5[_0xe1a0('0x62')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x3d17e5[_0xe1a0('0x74')]}});}return null;})[_0xe1a0('0x21')](handleEntityNotFound(_0x4b7451,null))[_0xe1a0('0x21')](function(_0x127387){if(_0x127387){_0x506735[_0xe1a0('0x61')]=_0x127387[_0xe1a0('0x62')]({'plain':!![]});interaction_log[_0xe1a0('0x22')](_0xe1a0('0x75'),_0x13f117[_0xe1a0('0x5d')]['id'],_0x13f117[_0xe1a0('0x5d')][_0xe1a0('0x38')],_0x13f117['user'][_0xe1a0('0x76')],_0x506735['interaction']['id'],_0x13f117['body']?JSON['stringify'](_0x13f117[_0xe1a0('0x56')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x506735);}return null;})[_0xe1a0('0x21')](function(_0x391de8){var _0x30deaf=_0xe1a0('0x77')+_0x391de8[_0xe1a0('0x29')]['ContactId'];return db['sequelize'][_0xe1a0('0x3e')](_0x30deaf,{'type':db[_0xe1a0('0x69')][_0xe1a0('0x6a')][_0xe1a0('0x78')],'raw':!![]})[_0xe1a0('0x21')](function(_0x1c48e9){return _0x1c48e9;});})[_0xe1a0('0x21')](function(_0x48ac58){if(_0x48ac58){_0x506735[_0xe1a0('0x29')][_0xe1a0('0x6b')]=_0x48ac58[0x0];if(!_0x13f117[_0xe1a0('0x56')][_0xe1a0('0x5c')])return;return db[_0xe1a0('0x79')][_0xe1a0('0x54')]({'where':{'id':_0x13f117[_0xe1a0('0x56')]['UserId'],'role':_0xe1a0('0x5e')},'attributes':['id',_0xe1a0('0x38'),_0xe1a0('0x7a'),_0xe1a0('0x6c'),_0xe1a0('0x7b')],'raw':!![]});}return null;})[_0xe1a0('0x21')](function(_0x27bf4b){if(!_0x27bf4b)return null;_0x506735['message'][_0xe1a0('0x5e')]=_0x27bf4b;return _0x506735;})['then'](function(_0x2fe6cc){if(_0x2fe6cc){_0x2fe6cc[_0xe1a0('0x29')]['interface']=util[_0xe1a0('0x5f')](_0xe1a0('0x6e'),_0x13f117[_0xe1a0('0x5d')][_0xe1a0('0x38')]);_0x2fe6cc[_0xe1a0('0x29')]['channel']=_0x506735[_0xe1a0('0x6f')];_0x2fe6cc[_0xe1a0('0x29')][_0xe1a0('0x70')]=_0x506735['channel'];_0x2fe6cc[_0xe1a0('0x29')]['event']=_0xe1a0('0x34');respondWithRpcPromise(_0xe1a0('0x71'),_0xe1a0('0x71'),{'event':_0xe1a0('0x7c'),'message':_0x2fe6cc[_0xe1a0('0x29')]},client9002);return _0x506735;}return null;})['then'](respondWithResult(_0x4b7451,null))['catch'](handleError(_0x4b7451,null));};exports['status']=function(_0x747f29,_0x582fce,_0x4ef410){if(_0x747f29[_0xe1a0('0x56')]['id']){delete _0x747f29[_0xe1a0('0x56')]['id'];}var _0x25ec3c;return db['WhatsappMessage'][_0xe1a0('0x54')]({'where':{'id':_0x747f29[_0xe1a0('0x51')]['id']}})[_0xe1a0('0x21')](handleEntityNotFound(_0x582fce,null))[_0xe1a0('0x21')](function(_0x2643ed){if(_0x2643ed){_0x25ec3c=_0x2643ed;return db[_0xe1a0('0x7d')]['find']({'where':{'id':_0x2643ed[_0xe1a0('0x7e')]}});}})[_0xe1a0('0x21')](handleEntityNotFound(_0x582fce,null))['then'](function(_0x54b2fd){if(_0x54b2fd){logger[_0xe1a0('0x24')]('WhatsppMessage,\x20%s,\x20%s,\x20%s',_0xe1a0('0x2c'),_0xe1a0('0x7f'),_0x54b2fd[_0xe1a0('0x3d')],util[_0xe1a0('0x80')](_0x747f29[_0xe1a0('0x56')],{'showHidden':![],'depth':null}));switch(_0x54b2fd[_0xe1a0('0x3d')]){case _0xe1a0('0x81'):if(_0x747f29[_0xe1a0('0x56')][_0xe1a0('0x82')]&&_0x747f29[_0xe1a0('0x56')]['MessageSid']===_0x25ec3c[_0xe1a0('0x83')]&&_0x747f29[_0xe1a0('0x56')]['MessageStatus']&&_0x747f29[_0xe1a0('0x56')][_0xe1a0('0x84')]===_0xe1a0('0x5b')){return _0x25ec3c[_0xe1a0('0x36')]({'read':!![]});}else{logger[_0xe1a0('0x26')](_0xe1a0('0x85'),_0xe1a0('0x2c'),_0xe1a0('0x81'),util['inspect'](_0x747f29[_0xe1a0('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x25ec3c;}})[_0xe1a0('0x21')](respondWithResult(_0x582fce,null))[_0xe1a0('0x2a')](handleError(_0x582fce,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 044756d..3a25130 100644 --- a/server/api/whatsappMessage/whatsappMessage.events.js +++ b/server/api/whatsappMessage/whatsappMessage.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7980=['events','../../mysqldb','WhatsappMessage','setMaxListeners','save','remove','emit','hook','exports'];(function(_0xb2f404,_0x406b79){var _0x3ca35f=function(_0x2de0da){while(--_0x2de0da){_0xb2f404['push'](_0xb2f404['shift']());}};_0x3ca35f(++_0x406b79);}(_0x7980,0xab));var _0x0798=function(_0x2d953a,_0x4d762c){_0x2d953a=_0x2d953a-0x0;var _0x8e49c5=_0x7980[_0x2d953a];return _0x8e49c5;};'use strict';var EventEmitter=require(_0x0798('0x0'));var WhatsappMessage=require(_0x0798('0x1'))['db'][_0x0798('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x0798('0x3')](0x0);var events={'afterCreate':_0x0798('0x4'),'afterUpdate':'update','afterDestroy':_0x0798('0x5')};function emitEvent(_0x31597d){return function(_0xecc24f,_0x1637db,_0x1a1fe7){WhatsappMessageEvents['emit'](_0x31597d+':'+_0xecc24f['id'],_0xecc24f);WhatsappMessageEvents[_0x0798('0x6')](_0x31597d,_0xecc24f);_0x1a1fe7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x0798('0x7')](e,emitEvent(event));}}module[_0x0798('0x8')]=WhatsappMessageEvents; \ No newline at end of file +var _0x06ef=['emit','WhatsappMessage'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x06ef,0x185));var _0xf06e=function(_0x3382f4,_0x32b70b){_0x3382f4=_0x3382f4-0x0;var _0x3a3368=_0x06ef[_0x3382f4];return _0x3a3368;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db'][_0xf06e('0x0')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x404485){return function(_0x1281ca,_0x16d4da,_0x569390){WhatsappMessageEvents[_0xf06e('0x1')](_0x404485+':'+_0x1281ca['id'],_0x1281ca);WhatsappMessageEvents[_0xf06e('0x1')](_0x404485,_0x1281ca);_0x569390(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index dad020e..62c06b0 100644 --- a/server/api/whatsappMessage/whatsappMessage.model.js +++ b/server/api/whatsappMessage/whatsappMessage.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc3b2=['models','get','direction','toLowerCase','out','UserId','WhatsappInteraction','WhatsappInteractionId','then','createdAt','catch','error','secret','WhatsappAccount','find','WhatsappAccountId','type','twilio','authToken','phone','accountSid','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','token','sid','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/','/messages/','POST','application/json','statuses','message_id','update','err','finally','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','request-promise','node-fetch','path','rimraf','../../config/environment','./whatsappMessage.attributes','define','WhatsappMessage','whatsapp_messages','messageId','body','FULLTEXT'];(function(_0x431309,_0xa6a419){var _0x240caa=function(_0x6aab6f){while(--_0x6aab6f){_0x431309['push'](_0x431309['shift']());}};_0x240caa(++_0xa6a419);}(_0xc3b2,0x67));var _0x2c3b=function(_0x52e854,_0x4cef54){_0x52e854=_0x52e854-0x0;var _0x5a8410=_0xc3b2[_0x52e854];return _0x5a8410;};'use strict';var _=require(_0x2c3b('0x0'));var util=require('util');var logger=require(_0x2c3b('0x1'))('api');var moment=require('moment');var BPromise=require(_0x2c3b('0x2'));var rp=require(_0x2c3b('0x3'));var fetch=require(_0x2c3b('0x4'));var fs=require('fs');var path=require(_0x2c3b('0x5'));var rimraf=require(_0x2c3b('0x6'));var config=require(_0x2c3b('0x7'));var attributes=require(_0x2c3b('0x8'));module['exports']=function(_0xf71a8d,_0x3675e6){return _0xf71a8d[_0x2c3b('0x9')](_0x2c3b('0xa'),attributes,{'tableName':_0x2c3b('0xb'),'paranoid':![],'indexes':[{'name':_0x2c3b('0xc'),'fields':[_0x2c3b('0xc')]},{'name':'fti_whatsapp_messages','fields':[_0x2c3b('0xd')],'type':_0x2c3b('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xbf8480,_0x1ebb78,_0x5f41bb){var _0x1bf997=_0xf71a8d[_0x2c3b('0xf')];var _0x444b59=_0xbf8480[_0x2c3b('0x10')]({'plain':!![]});if(_0x444b59[_0x2c3b('0x11')]['toLowerCase']()==='in'||_0x444b59[_0x2c3b('0x11')][_0x2c3b('0x12')]()===_0x2c3b('0x13')&&!_0x444b59['secret']&&!_['isNil'](_0x444b59[_0x2c3b('0x14')])){_0x1bf997[_0x2c3b('0x15')]['findOne']({'where':{'id':_0x444b59[_0x2c3b('0x16')]}})[_0x2c3b('0x17')](function(_0x3bae14){if(_0x3bae14){_0x3bae14['update']({'lastMsgAt':_0x444b59[_0x2c3b('0x18')],'lastMsgDirection':_0x444b59[_0x2c3b('0x11')][_0x2c3b('0x12')]()});}})[_0x2c3b('0x19')](function(_0x40ffcf){console[_0x2c3b('0x1a')](_0x40ffcf);});}if(_0x444b59[_0x2c3b('0x11')]===_0x2c3b('0x13')&&!_0x444b59[_0x2c3b('0x1b')]){var _0x205e62;_0x1bf997[_0x2c3b('0x1c')][_0x2c3b('0x1d')]({'where':{'id':_0x444b59[_0x2c3b('0x1e')]},'raw':!![]})['then'](function(_0x2d96d3){_0x205e62=_0x2d96d3;if(_0x205e62&&_0x205e62[_0x2c3b('0x1f')]){switch(_0x205e62[_0x2c3b('0x1f')]){case _0x2c3b('0x20'):var _0x482d4c=require(_0x2c3b('0x20'));if(_0x205e62['accountSid']&&_0x205e62[_0x2c3b('0x21')]&&_0x205e62[_0x2c3b('0x22')]){var _0x126193=new _0x482d4c(_0x205e62[_0x2c3b('0x23')],_0x205e62[_0x2c3b('0x21')]);_0x126193['messages'][_0x2c3b('0x24')]({'body':_0x444b59[_0x2c3b('0xd')],'to':'whatsapp:'+_0x444b59[_0x2c3b('0x22')],'from':_0x2c3b('0x25')+_0x205e62[_0x2c3b('0x22')],'statusCallback':_0x205e62[_0x2c3b('0x26')]+_0x2c3b('0x27')+_0x444b59['id']+_0x2c3b('0x28')+_0x205e62[_0x2c3b('0x29')]})['then'](function(_0x577fca){if(_0x577fca[_0x2c3b('0x2a')]){return _0xbf8480['update']({'messageId':_0x577fca[_0x2c3b('0x2a')]});}})[_0x2c3b('0x19')](function(_0x2f1567){logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2c3b('0x2b'),_0x2c3b('0x20'),util[_0x2c3b('0x2c')](_0x2f1567,{'showHidden':![],'depth':null}));});}else{logger[_0x2c3b('0x1a')](_0x2c3b('0x2d'),_0x2c3b('0x2b'),_0x2c3b('0x20'),_0x2c3b('0x2e'));}break;case _0x2c3b('0x2f'):var _0x586da4=_0x205e62[_0x2c3b('0x23')];var _0x184256=_0x205e62[_0x2c3b('0x21')];var _0x403a50=_0x205e62[_0x2c3b('0x30')]+_0x2c3b('0x31')+_0x586da4+_0x2c3b('0x32');var _0x2e19c8={'to':[_0x444b59[_0x2c3b('0x22')]],'message':{'type':'text','text':_0x444b59['body']}};var _0xb3ee69={'method':_0x2c3b('0x33'),'uri':_0x403a50,'headers':{'Authorization':'Bearer\x20'+_0x184256,'Content-Type':_0x2c3b('0x34')},'body':_0x2e19c8,'json':!![]};rp(_0xb3ee69)[_0x2c3b('0x17')](function(_0xe8819){if(_0xe8819[_0x2c3b('0x35')][0x0][_0x2c3b('0x36')]){return _0xbf8480[_0x2c3b('0x37')]({'messageId':_0xe8819[_0x2c3b('0x35')][0x0]['message_id']});}})[_0x2c3b('0x19')](function(_0x2c2604){logger[_0x2c3b('0x38')]('WhatsappMessage,\x20%s',_0x2c2604);});break;}}})[_0x2c3b('0x39')](function(){_0x5f41bb();});}else{_0x5f41bb();}}},'charset':'utf8mb4','collate':_0x2c3b('0x3a')});}; \ No newline at end of file +var _0x6c30=['err','WhatsappMessage,\x20%s','finally','utf8mb4','lodash','../../config/logger','api','moment','bluebird','request-promise','node-fetch','path','../../config/environment','./whatsappMessage.attributes','exports','whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','isNil','UserId','then','update','createdAt','catch','error','out','secret','WhatsappAccount','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','baseUrl','/whatsapp/v1/','/messages/','text','Bearer\x20','application/json','message_id','statuses'];(function(_0x35bd6c,_0x585087){var _0x2f421d=function(_0x42ae70){while(--_0x42ae70){_0x35bd6c['push'](_0x35bd6c['shift']());}};_0x2f421d(++_0x585087);}(_0x6c30,0x19a));var _0x06c3=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x6c30[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0x06c3('0x0'));var util=require('util');var logger=require(_0x06c3('0x1'))(_0x06c3('0x2'));var moment=require(_0x06c3('0x3'));var BPromise=require(_0x06c3('0x4'));var rp=require(_0x06c3('0x5'));var fetch=require(_0x06c3('0x6'));var fs=require('fs');var path=require(_0x06c3('0x7'));var rimraf=require('rimraf');var config=require(_0x06c3('0x8'));var attributes=require(_0x06c3('0x9'));module[_0x06c3('0xa')]=function(_0xd6f916,_0x1eebf3){return _0xd6f916['define']('WhatsappMessage',attributes,{'tableName':_0x06c3('0xb'),'paranoid':![],'indexes':[{'name':_0x06c3('0xc'),'fields':[_0x06c3('0xc')]},{'name':_0x06c3('0xd'),'fields':[_0x06c3('0xe')],'type':_0x06c3('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1012fd,_0x2d1578,_0x873dba){var _0x132522=_0xd6f916['models'];var _0x3c03f5=_0x1012fd[_0x06c3('0x10')]({'plain':!![]});if(_0x3c03f5[_0x06c3('0x11')][_0x06c3('0x12')]()==='in'||_0x3c03f5[_0x06c3('0x11')][_0x06c3('0x12')]()==='out'&&!_0x3c03f5['secret']&&!_[_0x06c3('0x13')](_0x3c03f5[_0x06c3('0x14')])){_0x132522['WhatsappInteraction']['findOne']({'where':{'id':_0x3c03f5['WhatsappInteractionId']}})[_0x06c3('0x15')](function(_0x209627){if(_0x209627){_0x209627[_0x06c3('0x16')]({'lastMsgAt':_0x3c03f5[_0x06c3('0x17')],'lastMsgDirection':_0x3c03f5[_0x06c3('0x11')][_0x06c3('0x12')]()});}})[_0x06c3('0x18')](function(_0x2c7eee){console[_0x06c3('0x19')](_0x2c7eee);});}if(_0x3c03f5['direction']===_0x06c3('0x1a')&&!_0x3c03f5[_0x06c3('0x1b')]){var _0x3f9cb0;_0x132522[_0x06c3('0x1c')]['find']({'where':{'id':_0x3c03f5[_0x06c3('0x1d')]},'raw':!![]})[_0x06c3('0x15')](function(_0x1fb10c){_0x3f9cb0=_0x1fb10c;if(_0x3f9cb0&&_0x3f9cb0['type']){switch(_0x3f9cb0[_0x06c3('0x1e')]){case _0x06c3('0x1f'):var _0x319b6a=require('twilio');if(_0x3f9cb0[_0x06c3('0x20')]&&_0x3f9cb0[_0x06c3('0x21')]&&_0x3f9cb0[_0x06c3('0x22')]){var _0x351762=new _0x319b6a(_0x3f9cb0['accountSid'],_0x3f9cb0[_0x06c3('0x21')]);_0x351762[_0x06c3('0x23')][_0x06c3('0x24')]({'body':_0x3c03f5['body'],'to':_0x06c3('0x25')+_0x3c03f5[_0x06c3('0x22')],'from':_0x06c3('0x25')+_0x3f9cb0[_0x06c3('0x22')],'statusCallback':_0x3f9cb0[_0x06c3('0x26')]+_0x06c3('0x27')+_0x3c03f5['id']+_0x06c3('0x28')+_0x3f9cb0['token']})[_0x06c3('0x15')](function(_0x6250f4){if(_0x6250f4[_0x06c3('0x29')]){return _0x1012fd[_0x06c3('0x16')]({'messageId':_0x6250f4['sid']});}})[_0x06c3('0x18')](function(_0x5a39c0){logger[_0x06c3('0x19')](_0x06c3('0x2a'),_0x06c3('0x2b'),_0x06c3('0x1f'),util[_0x06c3('0x2c')](_0x5a39c0,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x06c3('0x2a'),_0x06c3('0x2b'),'twilio',_0x06c3('0x2d'));}break;case'sinch':var _0x2a107f=_0x3f9cb0[_0x06c3('0x20')];var _0x41a463=_0x3f9cb0[_0x06c3('0x21')];var _0xd9e2e7=_0x3f9cb0[_0x06c3('0x2e')]+_0x06c3('0x2f')+_0x2a107f+_0x06c3('0x30');var _0x8f8efd={'to':[_0x3c03f5[_0x06c3('0x22')]],'message':{'type':_0x06c3('0x31'),'text':_0x3c03f5[_0x06c3('0xe')]}};var _0x4dc7b7={'method':'POST','uri':_0xd9e2e7,'headers':{'Authorization':_0x06c3('0x32')+_0x41a463,'Content-Type':_0x06c3('0x33')},'body':_0x8f8efd,'json':!![]};rp(_0x4dc7b7)['then'](function(_0x5bc9f3){if(_0x5bc9f3['statuses'][0x0][_0x06c3('0x34')]){return _0x1012fd[_0x06c3('0x16')]({'messageId':_0x5bc9f3[_0x06c3('0x35')][0x0][_0x06c3('0x34')]});}})[_0x06c3('0x18')](function(_0x362a8c){logger[_0x06c3('0x36')](_0x06c3('0x37'),_0x362a8c);});break;}}})[_0x06c3('0x38')](function(){_0x873dba();});}else{_0x873dba();}}},'charset':_0x06c3('0x39'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index dc6655a..e39f0bb 100644 --- a/server/api/whatsappMessage/whatsappMessage.rpc.js +++ b/server/api/whatsappMessage/whatsappMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xec0c=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./whatsappMessage.socket','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','then','debug','stringify','catch'];(function(_0xcc6a3f,_0xe32370){var _0x45990f=function(_0x9b56c9){while(--_0x9b56c9){_0xcc6a3f['push'](_0xcc6a3f['shift']());}};_0x45990f(++_0xe32370);}(_0xec0c,0x118));var _0xcec0=function(_0x39a92a,_0x4bf484){_0x39a92a=_0x39a92a-0x0;var _0x3a700a=_0xec0c[_0x39a92a];return _0x3a700a;};'use strict';var _=require(_0xcec0('0x0'));var util=require(_0xcec0('0x1'));var moment=require(_0xcec0('0x2'));var BPromise=require('bluebird');var rs=require(_0xcec0('0x3'));var fs=require('fs');var Redis=require(_0xcec0('0x4'));var db=require(_0xcec0('0x5'))['db'];var utils=require(_0xcec0('0x6'));var logger=require(_0xcec0('0x7'))(_0xcec0('0x8'));var config=require(_0xcec0('0x9'));var jayson=require(_0xcec0('0xa'));var client=jayson[_0xcec0('0xb')][_0xcec0('0xc')]({'port':0x232a});config[_0xcec0('0xd')]=_[_0xcec0('0xe')](config[_0xcec0('0xd')],{'host':_0xcec0('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcec0('0xd')]));require(_0xcec0('0x10'))['register'](socket);function respondWithRpcPromise(_0x56f002,_0x2fc003,_0x3aba17){return new BPromise(function(_0x54cca2,_0xb9f4b9){return client[_0xcec0('0x11')](_0x56f002,_0x3aba17)['then'](function(_0x27419f){logger[_0xcec0('0x12')](_0xcec0('0x13'),_0x2fc003,_0xcec0('0x14'));logger['debug']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x2fc003,_0xcec0('0x14'),JSON['stringify'](_0x27419f));if(_0x27419f[_0xcec0('0x15')]){if(_0x27419f[_0xcec0('0x15')][_0xcec0('0x16')]===0x1f4){logger[_0xcec0('0x15')](_0xcec0('0x13'),_0x2fc003,_0x27419f[_0xcec0('0x15')][_0xcec0('0x17')]);return _0xb9f4b9(_0x27419f['error'][_0xcec0('0x17')]);}logger[_0xcec0('0x15')](_0xcec0('0x13'),_0x2fc003,_0x27419f[_0xcec0('0x15')][_0xcec0('0x17')]);return _0x54cca2(_0x27419f[_0xcec0('0x15')]['message']);}else{logger[_0xcec0('0x12')](_0xcec0('0x13'),_0x2fc003,_0xcec0('0x14'));_0x54cca2(_0x27419f[_0xcec0('0x18')][_0xcec0('0x17')]);}})['catch'](function(_0x3f340d){logger[_0xcec0('0x15')](_0xcec0('0x13'),_0x2fc003,_0x3f340d);_0xb9f4b9(_0x3f340d);});});}exports[_0xcec0('0x19')]=function(_0x19a170){var _0x572745=this;return new Promise(function(_0x20aa87,_0x9d3504){return db[_0xcec0('0x1a')][_0xcec0('0x1b')](_0x19a170[_0xcec0('0x1c')],{'raw':_0x19a170[_0xcec0('0x1d')]?_0x19a170['options'][_0xcec0('0x1e')]===undefined?!![]:![]:!![]})[_0xcec0('0x1f')](function(_0x805aa2){logger[_0xcec0('0x12')]('CreateWhatsappMessage',_0x19a170);logger[_0xcec0('0x20')](_0xcec0('0x19'),_0x19a170,JSON[_0xcec0('0x21')](_0x805aa2));_0x20aa87(_0x805aa2);})[_0xcec0('0x22')](function(_0x3ecb2e){logger[_0xcec0('0x15')](_0xcec0('0x19'),_0x3ecb2e[_0xcec0('0x17')],_0x19a170);_0x9d3504(_0x572745['error'](0x1f4,_0x3ecb2e[_0xcec0('0x17')]));});});}; \ No newline at end of file +var _0xbca7=['jayson/promise','client','redis','localhost','./whatsappMessage.socket','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','CreateWhatsappMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbca7,0x90));var _0x7bca=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xbca7[_0x3e112d];return _0x531c31;};'use strict';var _=require(_0x7bca('0x0'));var util=require(_0x7bca('0x1'));var moment=require(_0x7bca('0x2'));var BPromise=require(_0x7bca('0x3'));var rs=require(_0x7bca('0x4'));var fs=require('fs');var Redis=require(_0x7bca('0x5'));var db=require(_0x7bca('0x6'))['db'];var utils=require(_0x7bca('0x7'));var logger=require(_0x7bca('0x8'))(_0x7bca('0x9'));var config=require(_0x7bca('0xa'));var jayson=require(_0x7bca('0xb'));var client=jayson[_0x7bca('0xc')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x7bca('0xd')],{'host':_0x7bca('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7bca('0xd')]));require(_0x7bca('0xf'))['register'](socket);function respondWithRpcPromise(_0x43991c,_0x76dc85,_0x2ccc28){return new BPromise(function(_0x1570db,_0x1352ce){return client[_0x7bca('0x10')](_0x43991c,_0x2ccc28)['then'](function(_0x35fcbc){logger[_0x7bca('0x11')](_0x7bca('0x12'),_0x76dc85,_0x7bca('0x13'));logger[_0x7bca('0x14')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x76dc85,_0x7bca('0x13'),JSON[_0x7bca('0x15')](_0x35fcbc));if(_0x35fcbc[_0x7bca('0x16')]){if(_0x35fcbc[_0x7bca('0x16')]['code']===0x1f4){logger[_0x7bca('0x16')](_0x7bca('0x12'),_0x76dc85,_0x35fcbc['error'][_0x7bca('0x17')]);return _0x1352ce(_0x35fcbc[_0x7bca('0x16')][_0x7bca('0x17')]);}logger[_0x7bca('0x16')](_0x7bca('0x12'),_0x76dc85,_0x35fcbc[_0x7bca('0x16')][_0x7bca('0x17')]);return _0x1570db(_0x35fcbc[_0x7bca('0x16')][_0x7bca('0x17')]);}else{logger[_0x7bca('0x11')](_0x7bca('0x12'),_0x76dc85,'request\x20sent');_0x1570db(_0x35fcbc[_0x7bca('0x18')][_0x7bca('0x17')]);}})[_0x7bca('0x19')](function(_0x4dcf03){logger[_0x7bca('0x16')](_0x7bca('0x12'),_0x76dc85,_0x4dcf03);_0x1352ce(_0x4dcf03);});});}exports[_0x7bca('0x1a')]=function(_0x31e1cc){var _0x433051=this;return new Promise(function(_0x30ece4,_0x479e05){return db['WhatsappMessage'][_0x7bca('0x1b')](_0x31e1cc[_0x7bca('0x1c')],{'raw':_0x31e1cc['options']?_0x31e1cc[_0x7bca('0x1d')][_0x7bca('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0xfbbce9){logger['info'](_0x7bca('0x1a'),_0x31e1cc);logger[_0x7bca('0x14')](_0x7bca('0x1a'),_0x31e1cc,JSON[_0x7bca('0x15')](_0xfbbce9));_0x30ece4(_0xfbbce9);})['catch'](function(_0x245c9e){logger[_0x7bca('0x16')](_0x7bca('0x1a'),_0x245c9e[_0x7bca('0x17')],_0x31e1cc);_0x479e05(_0x433051['error'](0x1f4,_0x245c9e['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 2ab1326..f616716 100644 --- a/server/api/whatsappMessage/whatsappMessage.socket.js +++ b/server/api/whatsappMessage/whatsappMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x415c=['update','removeListener','register','length','./whatsappMessage.events','save','remove'];(function(_0x4bf979,_0x13d7a7){var _0x5570f7=function(_0x30afe6){while(--_0x30afe6){_0x4bf979['push'](_0x4bf979['shift']());}};_0x5570f7(++_0x13d7a7);}(_0x415c,0x1af));var _0xc415=function(_0x2a8fae,_0x54fd0d){_0x2a8fae=_0x2a8fae-0x0;var _0x29a1fa=_0x415c[_0x2a8fae];return _0x29a1fa;};'use strict';var WhatsappMessageEvents=require(_0xc415('0x0'));var events=[_0xc415('0x1'),_0xc415('0x2'),_0xc415('0x3')];function createListener(_0x4d9fa4,_0x2ba8d3){return function(_0x3c4aa5){_0x2ba8d3['emit'](_0x4d9fa4,_0x3c4aa5);};}function removeListener(_0x4c59d6,_0x225cb2){return function(){WhatsappMessageEvents[_0xc415('0x4')](_0x4c59d6,_0x225cb2);};}exports[_0xc415('0x5')]=function(_0x5e3b99){for(var _0x540f93=0x0,_0x46b1fb=events[_0xc415('0x6')];_0x540f93<_0x46b1fb;_0x540f93++){var _0x10af2b=events[_0x540f93];var _0x508447=createListener('whatsappMessage:'+_0x10af2b,_0x5e3b99);WhatsappMessageEvents['on'](_0x10af2b,_0x508447);}}; \ No newline at end of file +var _0x7b20=['whatsappMessage:','./whatsappMessage.events','save','remove','update','emit','length'];(function(_0xe6403a,_0x6d1140){var _0x1f7671=function(_0x176a04){while(--_0x176a04){_0xe6403a['push'](_0xe6403a['shift']());}};_0x1f7671(++_0x6d1140);}(_0x7b20,0xef));var _0x07b2=function(_0x4a05a0,_0x15f328){_0x4a05a0=_0x4a05a0-0x0;var _0x48bc23=_0x7b20[_0x4a05a0];return _0x48bc23;};'use strict';var WhatsappMessageEvents=require(_0x07b2('0x0'));var events=[_0x07b2('0x1'),_0x07b2('0x2'),_0x07b2('0x3')];function createListener(_0x5c9bf5,_0x59b685){return function(_0x448d3f){_0x59b685[_0x07b2('0x4')](_0x5c9bf5,_0x448d3f);};}function removeListener(_0x25d3e3,_0x2f25d1){return function(){WhatsappMessageEvents['removeListener'](_0x25d3e3,_0x2f25d1);};}exports['register']=function(_0x245bb4){for(var _0x29e7aa=0x0,_0x27e55f=events[_0x07b2('0x5')];_0x29e7aa<_0x27e55f;_0x29e7aa++){var _0x2d5457=events[_0x29e7aa];var _0x544c32=createListener(_0x07b2('0x6')+_0x2d5457,_0x245bb4);WhatsappMessageEvents['on'](_0x2d5457,_0x544c32);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index cc52e87..50d6ce3 100644 --- a/server/api/whatsappQueue/index.js +++ b/server/api/whatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc833=['isAuthenticated','index','describe','get','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappQueue.controller'];(function(_0x513a0a,_0x6dfd40){var _0x22f507=function(_0x2efacb){while(--_0x2efacb){_0x513a0a['push'](_0x513a0a['shift']());}};_0x22f507(++_0x6dfd40);}(_0xc833,0xfd));var _0x3c83=function(_0x56823e,_0x460ae2){_0x56823e=_0x56823e-0x0;var _0x5524a8=_0xc833[_0x56823e];return _0x5524a8;};'use strict';var multer=require('multer');var util=require(_0x3c83('0x0'));var path=require(_0x3c83('0x1'));var timeout=require(_0x3c83('0x2'));var express=require(_0x3c83('0x3'));var router=express[_0x3c83('0x4')]();var fs_extra=require(_0x3c83('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3c83('0x6'));var config=require('../../config/environment');var controller=require(_0x3c83('0x7'));router['get']('/',auth[_0x3c83('0x8')](),controller[_0x3c83('0x9')]);router['get']('/describe',auth[_0x3c83('0x8')](),controller[_0x3c83('0xa')]);router[_0x3c83('0xb')](_0x3c83('0xc'),auth[_0x3c83('0x8')](),controller[_0x3c83('0xd')]);router[_0x3c83('0xb')](_0x3c83('0xe'),auth[_0x3c83('0x8')](),controller[_0x3c83('0xf')]);router['get'](_0x3c83('0x10'),auth[_0x3c83('0x8')](),controller[_0x3c83('0x11')]);router[_0x3c83('0xb')](_0x3c83('0x12'),auth[_0x3c83('0x8')](),controller['getAgents']);router[_0x3c83('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3c83('0x13')](_0x3c83('0x10'),auth[_0x3c83('0x8')](),controller[_0x3c83('0x14')]);router[_0x3c83('0x13')](_0x3c83('0x12'),auth[_0x3c83('0x8')](),controller[_0x3c83('0x15')]);router[_0x3c83('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x3c83('0x17')]);router[_0x3c83('0x18')](_0x3c83('0xc'),auth[_0x3c83('0x8')](),controller[_0x3c83('0x19')]);router[_0x3c83('0x18')]('/:id/teams',auth['isAuthenticated'](),controller[_0x3c83('0x1a')]);router[_0x3c83('0x18')](_0x3c83('0x12'),auth[_0x3c83('0x8')](),controller[_0x3c83('0x1b')]);module[_0x3c83('0x1c')]=router; \ No newline at end of file +var _0xa6f4=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','delete','destroy','removeTeams','removeAgents','multer','util'];(function(_0x321ccf,_0x2e780d){var _0x3a9a2a=function(_0x3291c2){while(--_0x3291c2){_0x321ccf['push'](_0x321ccf['shift']());}};_0x3a9a2a(++_0x2e780d);}(_0xa6f4,0x1f2));var _0x4a6f=function(_0x293370,_0x4ddbcd){_0x293370=_0x293370-0x0;var _0x585d7d=_0xa6f4[_0x293370];return _0x585d7d;};'use strict';var multer=require(_0x4a6f('0x0'));var util=require(_0x4a6f('0x1'));var path=require(_0x4a6f('0x2'));var timeout=require(_0x4a6f('0x3'));var express=require(_0x4a6f('0x4'));var router=express[_0x4a6f('0x5')]();var fs_extra=require(_0x4a6f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4a6f('0x7'));var config=require(_0x4a6f('0x8'));var controller=require('./whatsappQueue.controller');router[_0x4a6f('0x9')]('/',auth[_0x4a6f('0xa')](),controller['index']);router['get']('/describe',auth[_0x4a6f('0xa')](),controller[_0x4a6f('0xb')]);router[_0x4a6f('0x9')](_0x4a6f('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x4a6f('0x9')](_0x4a6f('0xd'),auth[_0x4a6f('0xa')](),controller[_0x4a6f('0xe')]);router[_0x4a6f('0x9')](_0x4a6f('0xf'),auth[_0x4a6f('0xa')](),controller[_0x4a6f('0x10')]);router['get'](_0x4a6f('0x11'),auth[_0x4a6f('0xa')](),controller[_0x4a6f('0x12')]);router[_0x4a6f('0x13')]('/',auth[_0x4a6f('0xa')](),controller[_0x4a6f('0x14')]);router[_0x4a6f('0x13')](_0x4a6f('0xf'),auth['isAuthenticated'](),controller['addTeams']);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x4a6f('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x4a6f('0x15')](_0x4a6f('0xc'),auth['isAuthenticated'](),controller[_0x4a6f('0x16')]);router[_0x4a6f('0x15')](_0x4a6f('0xf'),auth[_0x4a6f('0xa')](),controller[_0x4a6f('0x17')]);router[_0x4a6f('0x15')](_0x4a6f('0x11'),auth[_0x4a6f('0xa')](),controller[_0x4a6f('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 145bfaa..5e91c19 100644 --- a/server/api/whatsappQueue/whatsappQueue.attributes.js +++ b/server/api/whatsappQueue/whatsappQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca2b=['STRING','name','INTEGER','ENUM','rrmemory','beepall','sequelize','exports'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xca2b,0x156));var _0xbca2=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xca2b[_0x2be8c2];return _0x97f531;};'use strict';var Sequelize=require(_0xbca2('0x0'));module[_0xbca2('0x1')]={'name':{'type':Sequelize[_0xbca2('0x2')],'unique':_0xbca2('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xbca2('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbca2('0x5')](_0xbca2('0x6'),_0xbca2('0x7'),'roundrobin')},'description':{'type':Sequelize[_0xbca2('0x2')]}}; \ No newline at end of file +var _0x47fd=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x14e6f6,_0x2f8c6e){var _0x30524a=function(_0x125811){while(--_0x125811){_0x14e6f6['push'](_0x14e6f6['shift']());}};_0x30524a(++_0x2f8c6e);}(_0x47fd,0x13c));var _0xd47f=function(_0x4571ae,_0x5309bf){_0x4571ae=_0x4571ae-0x0;var _0x52b48b=_0x47fd[_0x4571ae];return _0x52b48b;};'use strict';var Sequelize=require(_0xd47f('0x0'));module[_0xd47f('0x1')]={'name':{'type':Sequelize[_0xd47f('0x2')],'unique':_0xd47f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xd47f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd47f('0x5')](_0xd47f('0x6'),_0xd47f('0x7'),_0xd47f('0x8'))},'description':{'type':Sequelize[_0xd47f('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index ddee5d6..ec4481c 100644 --- a/server/api/whatsappQueue/whatsappQueue.controller.js +++ b/server/api/whatsappQueue/whatsappQueue.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4baa=['findAll','rows','catch','show','params','intersection','include','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','findOne','nolimit','WhatsappQueueId','UserWhatsappQueue','User','findAndCountAll','UserId','agent','updatedAt','createdAt','format','SIP','whatsappPause','Team','getTeams','addTeams','ids','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','select','field','team_has_whatsapp_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','includes','all','union','compact','value','removeAgents','addAgents','omit','spread','emit','userWhatsappQueue:remove','getAgents','rimraf','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappQueue.socket','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','get','WhatsappQueues','UserProfileResource','end','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x2b36d9,_0x42faf0){var _0x7a8c90=function(_0x4dfba6){while(--_0x4dfba6){_0x2b36d9['push'](_0x2b36d9['shift']());}};_0x7a8c90(++_0x42faf0);}(_0x4baa,0xd5));var _0xa4ba=function(_0x3a23f1,_0x401962){_0x3a23f1=_0x3a23f1-0x0;var _0x484219=_0x4baa[_0x3a23f1];return _0x484219;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa4ba('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa4ba('0x1'));var moment=require(_0xa4ba('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa4ba('0x3'));var sox=require(_0xa4ba('0x4'));var csv=require(_0xa4ba('0x5'));var ejs=require(_0xa4ba('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa4ba('0x7'));var squel=require(_0xa4ba('0x8'));var crypto=require(_0xa4ba('0x9'));var jsforce=require(_0xa4ba('0xa'));var deskjs=require(_0xa4ba('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa4ba('0xc'));var Papa=require(_0xa4ba('0xd'));var Redis=require(_0xa4ba('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xa4ba('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa4ba('0x10'));var logger=require(_0xa4ba('0x11'))('api');var utils=require(_0xa4ba('0x12'));var config=require(_0xa4ba('0x13'));var licenseUtil=require(_0xa4ba('0x14'));var db=require(_0xa4ba('0x15'))['db'];config[_0xa4ba('0x16')]=_[_0xa4ba('0x17')](config[_0xa4ba('0x16')],{'host':_0xa4ba('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa4ba('0x16')]));require(_0xa4ba('0x19'))['register'](socket);function respondWithStatusCode(_0x2475c0,_0x1a4a94){_0x1a4a94=_0x1a4a94||0xcc;return function(_0x32b387){if(_0x32b387){return _0x2475c0[_0xa4ba('0x1a')](_0x1a4a94);}return _0x2475c0[_0xa4ba('0x1b')](_0x1a4a94)['end']();};}function respondWithResult(_0x55d54e,_0x2a81d6){_0x2a81d6=_0x2a81d6||0xc8;return function(_0x2ba393){if(_0x2ba393){return _0x55d54e[_0xa4ba('0x1b')](_0x2a81d6)[_0xa4ba('0x1c')](_0x2ba393);}};}function respondWithFilteredResult(_0xbd608d,_0xe5e189){return function(_0x1c437f){if(_0x1c437f){var _0xe14f19=typeof _0xe5e189[_0xa4ba('0x1d')]===_0xa4ba('0x1e')&&typeof _0xe5e189['limit']==='undefined';var _0x435d2e=_0x1c437f[_0xa4ba('0x1f')];var _0x4a430a=_0xe14f19?0x0:_0xe5e189[_0xa4ba('0x1d')];var _0x580533=_0xe14f19?_0x1c437f[_0xa4ba('0x1f')]:_0xe5e189[_0xa4ba('0x1d')]+_0xe5e189[_0xa4ba('0x20')];var _0x5d88ae;if(_0x580533>=_0x435d2e){_0x580533=_0x435d2e;_0x5d88ae=0xc8;}else{_0x5d88ae=0xce;}_0xbd608d[_0xa4ba('0x1b')](_0x5d88ae);return _0xbd608d[_0xa4ba('0x21')](_0xa4ba('0x22'),_0x4a430a+'-'+_0x580533+'/'+_0x435d2e)['json'](_0x1c437f);}return null;};}function patchUpdates(_0x400d28){return function(_0x26bf2e){try{jsonpatch[_0xa4ba('0x23')](_0x26bf2e,_0x400d28,!![]);}catch(_0x486274){return BPromise[_0xa4ba('0x24')](_0x486274);}return _0x26bf2e['save']();};}function saveUpdates(_0xf9d44f,_0x5921a6){return function(_0x3cd2a0){if(_0x3cd2a0){return _0x3cd2a0[_0xa4ba('0x25')](_0xf9d44f)[_0xa4ba('0x26')](function(_0x2ceee1){return _0x2ceee1;});}return null;};}function removeEntity(_0x1c735a,_0x42dbd3){return function(_0x28d37e){if(_0x28d37e){return _0x28d37e[_0xa4ba('0x27')]()['then'](function(){var _0x181b13=_0x28d37e[_0xa4ba('0x28')]({'plain':!![]});var _0x54d09e=_0xa4ba('0x29');return db[_0xa4ba('0x2a')][_0xa4ba('0x27')]({'where':{'type':_0x54d09e,'resourceId':_0x181b13['id']}})[_0xa4ba('0x26')](function(){return _0x28d37e;});})[_0xa4ba('0x26')](function(){_0x1c735a[_0xa4ba('0x1b')](0xcc)[_0xa4ba('0x2b')]();});}};}function handleEntityNotFound(_0x426102,_0x38578e){return function(_0x3d9465){if(!_0x3d9465){_0x426102[_0xa4ba('0x1a')](0x194);}return _0x3d9465;};}function handleError(_0x5511e3,_0x152c5e){_0x152c5e=_0x152c5e||0x1f4;return function(_0x5a7e9a){logger[_0xa4ba('0x2c')](_0x5a7e9a[_0xa4ba('0x2d')]);if(_0x5a7e9a[_0xa4ba('0x2e')]){delete _0x5a7e9a['name'];}_0x5511e3[_0xa4ba('0x1b')](_0x152c5e)[_0xa4ba('0x2f')](_0x5a7e9a);};}exports[_0xa4ba('0x30')]=function(_0x242985,_0x57fe7f){var _0x50aa55={},_0x4061c9={},_0x2a2254={'count':0x0,'rows':[]};var _0x1c7917=_[_0xa4ba('0x31')](db[_0xa4ba('0x32')][_0xa4ba('0x33')],function(_0x1daece){return{'name':_0x1daece['fieldName'],'type':_0x1daece[_0xa4ba('0x34')][_0xa4ba('0x35')]};});_0x4061c9[_0xa4ba('0x36')]=_[_0xa4ba('0x31')](_0x1c7917,'name');_0x4061c9[_0xa4ba('0x37')]=_[_0xa4ba('0x38')](_0x242985['query']);_0x4061c9[_0xa4ba('0x39')]=_['intersection'](_0x4061c9['model'],_0x4061c9[_0xa4ba('0x37')]);_0x50aa55[_0xa4ba('0x3a')]=_['intersection'](_0x4061c9[_0xa4ba('0x36')],qs[_0xa4ba('0x3b')](_0x242985[_0xa4ba('0x37')][_0xa4ba('0x3b')]));_0x50aa55[_0xa4ba('0x3a')]=_0x50aa55[_0xa4ba('0x3a')][_0xa4ba('0x3c')]?_0x50aa55[_0xa4ba('0x3a')]:_0x4061c9[_0xa4ba('0x36')];if(!_0x242985[_0xa4ba('0x37')][_0xa4ba('0x3d')]('nolimit')){_0x50aa55[_0xa4ba('0x20')]=qs[_0xa4ba('0x20')](_0x242985['query'][_0xa4ba('0x20')]);_0x50aa55[_0xa4ba('0x1d')]=qs[_0xa4ba('0x1d')](_0x242985['query']['offset']);}_0x50aa55[_0xa4ba('0x3e')]=qs['sort'](_0x242985[_0xa4ba('0x37')][_0xa4ba('0x3f')]);_0x50aa55[_0xa4ba('0x40')]=qs[_0xa4ba('0x39')](_[_0xa4ba('0x41')](_0x242985[_0xa4ba('0x37')],_0x4061c9['filters']),_0x1c7917);if(_0x242985['query'][_0xa4ba('0x42')]){_0x50aa55[_0xa4ba('0x40')]=_[_0xa4ba('0x43')](_0x50aa55[_0xa4ba('0x40')],{'$or':_[_0xa4ba('0x31')](_0x1c7917,function(_0x5394a9){if(_0x5394a9[_0xa4ba('0x34')]!==_0xa4ba('0x44')){var _0x3e3af9={};_0x3e3af9[_0x5394a9['name']]={'$like':'%'+_0x242985[_0xa4ba('0x37')][_0xa4ba('0x42')]+'%'};return _0x3e3af9;}})});}_0x50aa55=_['merge']({},_0x50aa55,_0x242985[_0xa4ba('0x45')]);var _0x2a5450={'where':_0x50aa55['where']};return db[_0xa4ba('0x32')][_0xa4ba('0x1f')](_0x2a5450)[_0xa4ba('0x26')](function(_0x147f93){_0x2a2254[_0xa4ba('0x1f')]=_0x147f93;if(_0x242985[_0xa4ba('0x37')][_0xa4ba('0x46')]){_0x50aa55['include']=[{'all':!![]}];}return db[_0xa4ba('0x32')][_0xa4ba('0x47')](_0x50aa55);})['then'](function(_0x4afe64){_0x2a2254[_0xa4ba('0x48')]=_0x4afe64;return _0x2a2254;})[_0xa4ba('0x26')](respondWithFilteredResult(_0x57fe7f,_0x50aa55))[_0xa4ba('0x49')](handleError(_0x57fe7f,null));};exports[_0xa4ba('0x4a')]=function(_0x3db0fb,_0x4a1f19){var _0x4a605e={'raw':!![],'where':{'id':_0x3db0fb[_0xa4ba('0x4b')]['id']}},_0x2ae635={};_0x2ae635[_0xa4ba('0x36')]=_[_0xa4ba('0x38')](db[_0xa4ba('0x32')][_0xa4ba('0x33')]);_0x2ae635[_0xa4ba('0x37')]=_[_0xa4ba('0x38')](_0x3db0fb['query']);_0x2ae635[_0xa4ba('0x39')]=_[_0xa4ba('0x4c')](_0x2ae635[_0xa4ba('0x36')],_0x2ae635[_0xa4ba('0x37')]);_0x4a605e[_0xa4ba('0x3a')]=_[_0xa4ba('0x4c')](_0x2ae635[_0xa4ba('0x36')],qs[_0xa4ba('0x3b')](_0x3db0fb['query'][_0xa4ba('0x3b')]));_0x4a605e[_0xa4ba('0x3a')]=_0x4a605e[_0xa4ba('0x3a')][_0xa4ba('0x3c')]?_0x4a605e[_0xa4ba('0x3a')]:_0x2ae635[_0xa4ba('0x36')];if(_0x3db0fb['query'][_0xa4ba('0x46')]){_0x4a605e[_0xa4ba('0x4d')]=[{'all':!![]}];}_0x4a605e=_[_0xa4ba('0x43')]({},_0x4a605e,_0x3db0fb[_0xa4ba('0x45')]);return db[_0xa4ba('0x32')]['find'](_0x4a605e)['then'](handleEntityNotFound(_0x4a1f19,null))['then'](respondWithResult(_0x4a1f19,null))[_0xa4ba('0x49')](handleError(_0x4a1f19,null));};exports[_0xa4ba('0x4e')]=function(_0x2e968e,_0x4edaa5){return db['WhatsappQueue']['create'](_0x2e968e[_0xa4ba('0x4f')],{})[_0xa4ba('0x26')](function(_0x414d70){var _0x478ae8=_0x2e968e[_0xa4ba('0x50')]['get']({'plain':!![]});if(!_0x478ae8)throw new Error(_0xa4ba('0x51'));if(_0x478ae8[_0xa4ba('0x52')]==='user'){var _0x57a40e=_0x414d70[_0xa4ba('0x28')]({'plain':!![]});var _0x2daec5=_0xa4ba('0x29');return db[_0xa4ba('0x53')][_0xa4ba('0x54')]({'where':{'name':_0x2daec5,'userProfileId':_0x478ae8[_0xa4ba('0x55')]},'raw':!![]})[_0xa4ba('0x26')](function(_0x9ce572){if(_0x9ce572&&_0x9ce572[_0xa4ba('0x56')]===0x0){return db[_0xa4ba('0x2a')][_0xa4ba('0x4e')]({'name':_0x57a40e[_0xa4ba('0x2e')],'resourceId':_0x57a40e['id'],'type':_0x9ce572[_0xa4ba('0x2e')],'sectionId':_0x9ce572['id']},{})[_0xa4ba('0x26')](function(){return _0x414d70;});}else{return _0x414d70;}})[_0xa4ba('0x49')](function(_0x1589b6){logger[_0xa4ba('0x2c')](_0xa4ba('0x57'),_0x1589b6);throw _0x1589b6;});}return _0x414d70;})['then'](respondWithResult(_0x4edaa5,0xc9))[_0xa4ba('0x49')](handleError(_0x4edaa5,null));};exports['update']=function(_0x4c9f95,_0x3e771e){if(_0x4c9f95[_0xa4ba('0x4f')]['id']){delete _0x4c9f95[_0xa4ba('0x4f')]['id'];}return db['WhatsappQueue'][_0xa4ba('0x54')]({'where':{'id':_0x4c9f95['params']['id']}})['then'](handleEntityNotFound(_0x3e771e,null))[_0xa4ba('0x26')](saveUpdates(_0x4c9f95[_0xa4ba('0x4f')],null))[_0xa4ba('0x26')](respondWithResult(_0x3e771e,null))['catch'](handleError(_0x3e771e,null));};exports[_0xa4ba('0x27')]=function(_0x27fc38,_0x2c5dc2){return db[_0xa4ba('0x32')][_0xa4ba('0x54')]({'where':{'id':_0x27fc38[_0xa4ba('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2c5dc2,null))[_0xa4ba('0x26')](removeEntity(_0x2c5dc2,null))['catch'](handleError(_0x2c5dc2,null));};exports[_0xa4ba('0x58')]=function(_0x3c6329,_0x41814e){return db[_0xa4ba('0x32')][_0xa4ba('0x58')]()[_0xa4ba('0x26')](respondWithResult(_0x41814e,null))[_0xa4ba('0x49')](handleError(_0x41814e,null));};exports['getMembers']=function(_0x46d623,_0x2bc78f,_0x1ff193){var _0x52d5dc={'raw':!![],'where':{}},_0xa88e80={},_0x2b2311;return db[_0xa4ba('0x32')][_0xa4ba('0x59')]({'where':{'id':_0x46d623[_0xa4ba('0x4b')]['id']}})[_0xa4ba('0x26')](handleEntityNotFound(_0x2bc78f,null))['then'](function(_0xb14407){if(_0xb14407){_0x2b2311=_0xb14407['get']({'plain':!![]});_0xa88e80['model']=_[_0xa4ba('0x38')](db['UserWhatsappQueue'][_0xa4ba('0x33')]);_0xa88e80[_0xa4ba('0x37')]=_[_0xa4ba('0x38')](_0x46d623[_0xa4ba('0x37')]);_0xa88e80[_0xa4ba('0x39')]=_[_0xa4ba('0x4c')](_0xa88e80['model'],_0xa88e80[_0xa4ba('0x37')]);_0x52d5dc[_0xa4ba('0x3a')]=_[_0xa4ba('0x4c')](_0xa88e80[_0xa4ba('0x36')],qs[_0xa4ba('0x3b')](_0x46d623[_0xa4ba('0x37')][_0xa4ba('0x3b')]));_0x52d5dc[_0xa4ba('0x3a')]=_0x52d5dc[_0xa4ba('0x3a')][_0xa4ba('0x3c')]?_0x52d5dc[_0xa4ba('0x3a')]:_0xa88e80['model'];if(!_0x46d623['query']['hasOwnProperty'](_0xa4ba('0x5a'))){_0x52d5dc[_0xa4ba('0x20')]=qs['limit'](_0x46d623[_0xa4ba('0x37')][_0xa4ba('0x20')]);_0x52d5dc[_0xa4ba('0x1d')]=qs['offset'](_0x46d623[_0xa4ba('0x37')][_0xa4ba('0x1d')]);}_0x52d5dc['order']=qs[_0xa4ba('0x3f')](_0x46d623[_0xa4ba('0x37')]['sort']);_0x52d5dc[_0xa4ba('0x40')]=qs[_0xa4ba('0x39')](_[_0xa4ba('0x41')](_0x46d623['query'],_0xa88e80[_0xa4ba('0x39')]));_0x52d5dc[_0xa4ba('0x40')][_0xa4ba('0x5b')]=_0xb14407['id'];if(_0x46d623['query'][_0xa4ba('0x42')]){_0x52d5dc['where']=_[_0xa4ba('0x43')](_0x52d5dc[_0xa4ba('0x40')],{'$or':_[_0xa4ba('0x31')](_0x52d5dc[_0xa4ba('0x3a')],function(_0x4b0031){var _0x8b7f2c={};_0x8b7f2c[_0x4b0031]={'$like':'%'+_0x46d623['query'][_0xa4ba('0x42')]+'%'};return _0x8b7f2c;})});}_0x52d5dc=_['merge']({},_0x52d5dc,_0x46d623[_0xa4ba('0x45')]);return db[_0xa4ba('0x5c')][_0xa4ba('0x47')](_0x52d5dc);}})[_0xa4ba('0x26')](function(_0x2be995){if(_0x2be995){return db[_0xa4ba('0x5d')][_0xa4ba('0x5e')]({'where':{'id':_[_0xa4ba('0x31')](_0x2be995,_0xa4ba('0x5f')),'role':_0xa4ba('0x60')},'attributes':['id',_0xa4ba('0x2e'),'whatsappPause',_0xa4ba('0x61'),_0xa4ba('0x62')]});}})['then'](function(_0x1f1e47){if(_0x1f1e47){return{'count':_0x1f1e47['count'],'rows':_[_0xa4ba('0x31')](_0x1f1e47['rows'],function(_0xa9bf2b){return{'membername':_0xa9bf2b[_0xa4ba('0x2e')],'UserId':_0xa9bf2b['id'],'queue_name':_0x2b2311[_0xa4ba('0x2e')],'WhatsappQueueId':_0x2b2311['id'],'interface':util[_0xa4ba('0x63')]('%s/%s',_0xa4ba('0x64'),_0xa9bf2b[_0xa4ba('0x2e')]),'penalty':0x0,'paused':_0xa9bf2b[_0xa4ba('0x65')],'createdAt':_0xa9bf2b[_0xa4ba('0x62')],'updatedAt':_0xa9bf2b[_0xa4ba('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa4ba('0x26')](respondWithFilteredResult(_0x2bc78f,_0x52d5dc))['catch'](handleError(_0x2bc78f,null));};exports['getTeams']=function(_0x2ae481,_0x3f18db,_0x48778c){var _0x5a583b={};var _0x20c674={};var _0x5eb189;var _0x4c7d44;return db[_0xa4ba('0x32')]['findOne']({'where':{'id':_0x2ae481[_0xa4ba('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3f18db,null))['then'](function(_0x42bdaf){if(_0x42bdaf){_0x5eb189=_0x42bdaf;_0x20c674['model']=_['keys'](db[_0xa4ba('0x66')][_0xa4ba('0x33')]);_0x20c674['query']=_[_0xa4ba('0x38')](_0x2ae481[_0xa4ba('0x37')]);_0x20c674[_0xa4ba('0x39')]=_[_0xa4ba('0x4c')](_0x20c674[_0xa4ba('0x36')],_0x20c674[_0xa4ba('0x37')]);_0x5a583b[_0xa4ba('0x3a')]=_[_0xa4ba('0x4c')](_0x20c674[_0xa4ba('0x36')],qs[_0xa4ba('0x3b')](_0x2ae481['query'][_0xa4ba('0x3b')]));_0x5a583b['attributes']=_0x5a583b[_0xa4ba('0x3a')][_0xa4ba('0x3c')]?_0x5a583b['attributes']:_0x20c674[_0xa4ba('0x36')];_0x5a583b[_0xa4ba('0x3e')]=qs[_0xa4ba('0x3f')](_0x2ae481[_0xa4ba('0x37')][_0xa4ba('0x3f')]);_0x5a583b[_0xa4ba('0x40')]=qs[_0xa4ba('0x39')](_[_0xa4ba('0x41')](_0x2ae481['query'],_0x20c674[_0xa4ba('0x39')]));if(_0x2ae481[_0xa4ba('0x37')][_0xa4ba('0x42')]){_0x5a583b['where']=_['merge'](_0x5a583b[_0xa4ba('0x40')],{'$or':_[_0xa4ba('0x31')](_0x5a583b[_0xa4ba('0x3a')],function(_0x24ecda){var _0x6484c6={};_0x6484c6[_0x24ecda]={'$like':'%'+_0x2ae481['query'][_0xa4ba('0x42')]+'%'};return _0x6484c6;})});}_0x5a583b=_[_0xa4ba('0x43')]({},_0x5a583b,_0x2ae481[_0xa4ba('0x45')]);return _0x5eb189[_0xa4ba('0x67')](_0x5a583b);}})['then'](function(_0x13f683){if(_0x13f683){_0x4c7d44=_0x13f683[_0xa4ba('0x3c')];if(!_0x2ae481['query'][_0xa4ba('0x3d')]('nolimit')){_0x5a583b[_0xa4ba('0x20')]=qs['limit'](_0x2ae481[_0xa4ba('0x37')][_0xa4ba('0x20')]);_0x5a583b[_0xa4ba('0x1d')]=qs[_0xa4ba('0x1d')](_0x2ae481[_0xa4ba('0x37')][_0xa4ba('0x1d')]);}return _0x5eb189[_0xa4ba('0x67')](_0x5a583b);}})[_0xa4ba('0x26')](function(_0x51a6c9){if(_0x51a6c9){return _0x51a6c9?{'count':_0x4c7d44,'rows':_0x51a6c9}:null;}})[_0xa4ba('0x26')](respondWithResult(_0x3f18db,null))[_0xa4ba('0x49')](handleError(_0x3f18db,null));};exports[_0xa4ba('0x68')]=function(_0x55d31e,_0x808c65,_0x55d042){var _0x232c26=_0x55d31e[_0xa4ba('0x4f')][_0xa4ba('0x69')];return db[_0xa4ba('0x66')][_0xa4ba('0x47')]({'where':{'id':_0x232c26},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0xa4ba('0x2e'),'online',_0xa4ba('0x6a'),_0xa4ba('0x6b')],'raw':!![]}]})[_0xa4ba('0x26')](function(_0x47b6f3){if(_0x47b6f3){var _0x26dd8a=_[_0xa4ba('0x6c')](_0x47b6f3,function(_0x40267e){var _0x20ee22=_0x40267e[_0xa4ba('0x28')]({'plain':!![]});return _0x20ee22[_0xa4ba('0x6d')];});return db['WhatsappQueue'][_0xa4ba('0x54')]({'where':{'id':_0x55d31e[_0xa4ba('0x4b')]['id']}})['then'](function(_0x311c8b){return db[_0xa4ba('0x6e')][_0xa4ba('0x6f')](function(_0x6d25a9){return _0x311c8b[_0xa4ba('0x68')](_0x232c26,{'transaction':_0x6d25a9})['then'](function(){return BPromise[_0xa4ba('0x70')](_0x26dd8a,function(_0x47d903){return db[_0xa4ba('0x5c')][_0xa4ba('0x71')]({'where':{'UserId':_0x47d903['id'],'WhatsappQueueId':_0x55d31e['params']['id']},'transaction':_0x6d25a9});});})[_0xa4ba('0x26')](function(){_0x26dd8a[_0xa4ba('0x72')](function(_0x1bf807){socket['emit'](_0xa4ba('0x73'),{'UserId':_0x1bf807['id'],'WhatsappQueueId':_0x311c8b['id']});});});});});}})[_0xa4ba('0x26')](respondWithStatusCode(_0x808c65,null))['catch'](handleError(_0x808c65,null));};exports[_0xa4ba('0x74')]=function(_0x448601,_0x3417b3,_0x5817fa){return db[_0xa4ba('0x66')][_0xa4ba('0x47')]({'where':{'id':_0x448601[_0xa4ba('0x37')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa4ba('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xa4ba('0x26')](handleEntityNotFound(_0x3417b3,null))['then'](function(_0x13c11e){var _0x336118=_[_0xa4ba('0x31')](_0x13c11e,'id');var _0x2b8a95=[];var _0x1b6a68=[];var _0x5838d9=squel[_0xa4ba('0x75')]();_0x5838d9[_0xa4ba('0x76')]('tq.TeamId')['from'](_0xa4ba('0x77'),'tq')[_0xa4ba('0x78')](_0xa4ba('0x79'),'ut',_0xa4ba('0x7a'))[_0xa4ba('0x40')](_0xa4ba('0x7b'),_0x448601[_0xa4ba('0x4b')]['id']);for(var _0x48f58c=0x0;_0x48f58c<_0x13c11e[_0xa4ba('0x3c')];_0x48f58c+=0x1){let _0x13e4c7=_0x13c11e[_0x48f58c];for(var _0x4fb5a6=0x0;_0x4fb5a6<_0x13e4c7[_0xa4ba('0x6d')][_0xa4ba('0x3c')];_0x4fb5a6+=0x1){let _0x4f1411=_0x13e4c7[_0xa4ba('0x6d')][_0x4fb5a6];var _0x84f99b=_0x5838d9[_0xa4ba('0x7c')]();_0x84f99b[_0xa4ba('0x40')]('ut.UserId\x20=\x20?',_0x4f1411['id']);_0x1b6a68[_0xa4ba('0x7d')](db[_0xa4ba('0x6e')][_0xa4ba('0x37')](_0x84f99b[_0xa4ba('0x7e')](),{'type':db['sequelize']['QueryTypes'][_0xa4ba('0x7f')]})[_0xa4ba('0x26')](function(_0x41d633){if(_0x41d633[_0xa4ba('0x3c')]===0x1){return _0x4f1411['id'];}else{var _0xfea1b0=_[_0xa4ba('0x80')](_[_0xa4ba('0x31')](_0x41d633,_0xa4ba('0x81')),function(_0x3c3f56){return _[_0xa4ba('0x82')](_0x336118,_0x3c3f56);});if(_0xfea1b0){return _0x4f1411['id'];}}}));}}return BPromise[_0xa4ba('0x83')](_0x1b6a68)['then'](function(_0x495d7e){_0x2b8a95=_(_0x2b8a95)[_0xa4ba('0x84')](_0x495d7e)[_0xa4ba('0x85')]()[_0xa4ba('0x86')]();return db[_0xa4ba('0x32')][_0xa4ba('0x54')]({'where':{'id':_0x448601[_0xa4ba('0x4b')]['id']}})[_0xa4ba('0x26')](function(_0x577825){return db[_0xa4ba('0x6e')][_0xa4ba('0x6f')](function(_0x4e86c4){return _0x577825[_0xa4ba('0x74')](_0x448601[_0xa4ba('0x37')]['ids'],{'transaction':_0x4e86c4})['then'](function(){if(!_['isEmpty'](_0x2b8a95)){return _0x577825[_0xa4ba('0x87')](_0x2b8a95,{'transaction':_0x4e86c4});}})['then'](function(){_0x2b8a95[_0xa4ba('0x72')](function(_0x4c7131){socket['emit']('userWhatsappQueue:remove',{'UserId':_0x4c7131,'WhatsappQueueId':_0x577825['id']});});});});});});})[_0xa4ba('0x26')](respondWithStatusCode(_0x3417b3,null))[_0xa4ba('0x49')](handleError(_0x3417b3,null));};exports[_0xa4ba('0x88')]=function(_0xe5ab38,_0x7dc6fd,_0x57aeeb){return db['WhatsappQueue'][_0xa4ba('0x54')]({'where':{'id':_0xe5ab38['params']['id']}})[_0xa4ba('0x26')](handleEntityNotFound(_0x7dc6fd,null))[_0xa4ba('0x26')](function(_0xd2ee0c){if(_0xd2ee0c){return _0xd2ee0c['addAgents'](_0xe5ab38['body'][_0xa4ba('0x69')],_[_0xa4ba('0x89')](_0xe5ab38[_0xa4ba('0x4f')],['ids','id'])||{})[_0xa4ba('0x8a')](function(_0x44015f){for(var _0x25304a=0x0;_0x25304a<_0xe5ab38['body'][_0xa4ba('0x69')][_0xa4ba('0x3c')];_0x25304a+=0x1){socket[_0xa4ba('0x8b')](_0xa4ba('0x73'),{'UserId':Number(_0xe5ab38[_0xa4ba('0x4f')][_0xa4ba('0x69')][_0x25304a]),'WhatsappQueueId':Number(_0xe5ab38[_0xa4ba('0x4b')]['id'])});}return _0x44015f;});}})[_0xa4ba('0x26')](respondWithResult(_0x7dc6fd,null))[_0xa4ba('0x49')](handleError(_0x7dc6fd,null));};exports[_0xa4ba('0x87')]=function(_0x83c440,_0x41b82a,_0x527cbe){return db['WhatsappQueue'][_0xa4ba('0x54')]({'where':{'id':_0x83c440[_0xa4ba('0x4b')]['id']}})[_0xa4ba('0x26')](handleEntityNotFound(_0x41b82a,null))[_0xa4ba('0x26')](function(_0x35b954){if(_0x35b954){return _0x35b954[_0xa4ba('0x87')](_0x83c440[_0xa4ba('0x37')][_0xa4ba('0x69')])[_0xa4ba('0x26')](function(){if(_['isArray'](_0x83c440[_0xa4ba('0x37')][_0xa4ba('0x69')])){for(var _0x20f6a1=0x0;_0x20f6a1<_0x83c440[_0xa4ba('0x37')][_0xa4ba('0x69')][_0xa4ba('0x3c')];_0x20f6a1+=0x1){socket[_0xa4ba('0x8b')]('userWhatsappQueue:remove',{'UserId':Number(_0x83c440[_0xa4ba('0x37')][_0xa4ba('0x69')][_0x20f6a1]),'WhatsappQueueId':Number(_0x83c440[_0xa4ba('0x4b')]['id'])});}}else{socket[_0xa4ba('0x8b')](_0xa4ba('0x8c'),{'UserId':Number(_0x83c440['query'][_0xa4ba('0x69')]),'WhatsappQueueId':Number(_0x83c440[_0xa4ba('0x4b')]['id'])});}});}})[_0xa4ba('0x26')](respondWithStatusCode(_0x41b82a,null))[_0xa4ba('0x49')](handleError(_0x41b82a,null));};exports[_0xa4ba('0x8d')]=function(_0x1c2584,_0x242dff,_0xcaf719){var _0x1f67d0={};var _0x4399cf={};var _0x3f0848;var _0x47a84a;return db[_0xa4ba('0x32')][_0xa4ba('0x59')]({'where':{'id':_0x1c2584[_0xa4ba('0x4b')]['id']}})[_0xa4ba('0x26')](handleEntityNotFound(_0x242dff,null))[_0xa4ba('0x26')](function(_0x3a1d7d){if(_0x3a1d7d){_0x3f0848=_0x3a1d7d;_0x4399cf[_0xa4ba('0x36')]=_[_0xa4ba('0x38')](db['User'][_0xa4ba('0x33')]);_0x4399cf[_0xa4ba('0x37')]=_[_0xa4ba('0x38')](_0x1c2584[_0xa4ba('0x37')]);_0x4399cf[_0xa4ba('0x39')]=_['intersection'](_0x4399cf[_0xa4ba('0x36')],_0x4399cf[_0xa4ba('0x37')]);_0x1f67d0[_0xa4ba('0x3a')]=_[_0xa4ba('0x4c')](_0x4399cf[_0xa4ba('0x36')],qs['fields'](_0x1c2584['query'][_0xa4ba('0x3b')]));_0x1f67d0[_0xa4ba('0x3a')]=_0x1f67d0[_0xa4ba('0x3a')][_0xa4ba('0x3c')]?_0x1f67d0['attributes']:_0x4399cf[_0xa4ba('0x36')];_0x1f67d0['order']=qs[_0xa4ba('0x3f')](_0x1c2584[_0xa4ba('0x37')]['sort']);_0x1f67d0[_0xa4ba('0x40')]=qs[_0xa4ba('0x39')](_[_0xa4ba('0x41')](_0x1c2584[_0xa4ba('0x37')],_0x4399cf['filters']));if(_0x1c2584['query'][_0xa4ba('0x42')]){_0x1f67d0['where']=_[_0xa4ba('0x43')](_0x1f67d0[_0xa4ba('0x40')],{'$or':_[_0xa4ba('0x31')](_0x1f67d0[_0xa4ba('0x3a')],function(_0x6a1333){var _0x184c24={};_0x184c24[_0x6a1333]={'$like':'%'+_0x1c2584['query'][_0xa4ba('0x42')]+'%'};return _0x184c24;})});}_0x1f67d0=_['merge']({},_0x1f67d0,_0x1c2584[_0xa4ba('0x45')]);return _0x3f0848[_0xa4ba('0x8d')](_0x1f67d0);}})[_0xa4ba('0x26')](function(_0x25191c){if(_0x25191c){_0x47a84a=_0x25191c[_0xa4ba('0x3c')];if(!_0x1c2584['query'][_0xa4ba('0x3d')](_0xa4ba('0x5a'))){_0x1f67d0[_0xa4ba('0x20')]=qs[_0xa4ba('0x20')](_0x1c2584[_0xa4ba('0x37')][_0xa4ba('0x20')]);_0x1f67d0[_0xa4ba('0x1d')]=qs[_0xa4ba('0x1d')](_0x1c2584[_0xa4ba('0x37')]['offset']);}return _0x3f0848[_0xa4ba('0x8d')](_0x1f67d0);}})[_0xa4ba('0x26')](function(_0x496d9a){if(_0x496d9a){return _0x496d9a?{'count':_0x47a84a,'rows':_0x496d9a}:null;}})[_0xa4ba('0x26')](respondWithResult(_0x242dff,null))[_0xa4ba('0x49')](handleError(_0x242dff,null));}; \ No newline at end of file +var _0x5f85=['rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','WhatsappQueueId','User','findAndCountAll','UserId','whatsappPause','updatedAt','createdAt','format','%s/%s','Team','getTeams','addTeams','ids','Agents','online','voicePause','interface','sequelize','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','compact','value','transaction','removeAgents','userWhatsappQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','reject','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','name','send','index','map','WhatsappQueue'];(function(_0x5a2e3c,_0x467ec5){var _0x5a01a8=function(_0x2482cb){while(--_0x2482cb){_0x5a2e3c['push'](_0x5a2e3c['shift']());}};_0x5a01a8(++_0x467ec5);}(_0x5f85,0xe8));var _0x55f8=function(_0xefcb1e,_0x1fecd2){_0xefcb1e=_0xefcb1e-0x0;var _0x4cdc03=_0x5f85[_0xefcb1e];return _0x4cdc03;};'use strict';var emlformat=require(_0x55f8('0x0'));var rimraf=require(_0x55f8('0x1'));var zipdir=require(_0x55f8('0x2'));var jsonpatch=require(_0x55f8('0x3'));var rp=require(_0x55f8('0x4'));var moment=require(_0x55f8('0x5'));var BPromise=require(_0x55f8('0x6'));var Mustache=require('mustache');var util=require(_0x55f8('0x7'));var path=require('path');var sox=require(_0x55f8('0x8'));var csv=require(_0x55f8('0x9'));var ejs=require(_0x55f8('0xa'));var fs=require('fs');var fs_extra=require(_0x55f8('0xb'));var _=require(_0x55f8('0xc'));var squel=require(_0x55f8('0xd'));var crypto=require(_0x55f8('0xe'));var jsforce=require(_0x55f8('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x55f8('0x9'));var querystring=require(_0x55f8('0x10'));var Papa=require(_0x55f8('0x11'));var Redis=require(_0x55f8('0x12'));var authService=require(_0x55f8('0x13'));var qs=require(_0x55f8('0x14'));var as=require(_0x55f8('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x55f8('0x16'))(_0x55f8('0x17'));var utils=require(_0x55f8('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x55f8('0x19'));var db=require(_0x55f8('0x1a'))['db'];config[_0x55f8('0x1b')]=_[_0x55f8('0x1c')](config[_0x55f8('0x1b')],{'host':_0x55f8('0x1d'),'port':0x18eb});var socket=require(_0x55f8('0x1e'))(new Redis(config[_0x55f8('0x1b')]));require(_0x55f8('0x1f'))['register'](socket);function respondWithStatusCode(_0x47fdaf,_0xa0d520){_0xa0d520=_0xa0d520||0xcc;return function(_0x207c4d){if(_0x207c4d){return _0x47fdaf[_0x55f8('0x20')](_0xa0d520);}return _0x47fdaf[_0x55f8('0x21')](_0xa0d520)[_0x55f8('0x22')]();};}function respondWithResult(_0x2fa49e,_0x459df2){_0x459df2=_0x459df2||0xc8;return function(_0x19e378){if(_0x19e378){return _0x2fa49e[_0x55f8('0x21')](_0x459df2)[_0x55f8('0x23')](_0x19e378);}};}function respondWithFilteredResult(_0x3f1171,_0x43ac42){return function(_0x55a761){if(_0x55a761){var _0x3533c6=typeof _0x43ac42[_0x55f8('0x24')]===_0x55f8('0x25')&&typeof _0x43ac42['limit']==='undefined';var _0x568711=_0x55a761[_0x55f8('0x26')];var _0x490b24=_0x3533c6?0x0:_0x43ac42[_0x55f8('0x24')];var _0x1f8ff5=_0x3533c6?_0x55a761['count']:_0x43ac42[_0x55f8('0x24')]+_0x43ac42['limit'];var _0x3567fc;if(_0x1f8ff5>=_0x568711){_0x1f8ff5=_0x568711;_0x3567fc=0xc8;}else{_0x3567fc=0xce;}_0x3f1171[_0x55f8('0x21')](_0x3567fc);return _0x3f1171[_0x55f8('0x27')](_0x55f8('0x28'),_0x490b24+'-'+_0x1f8ff5+'/'+_0x568711)[_0x55f8('0x23')](_0x55a761);}return null;};}function patchUpdates(_0x7eb2f){return function(_0x128d13){try{jsonpatch['apply'](_0x128d13,_0x7eb2f,!![]);}catch(_0x33cbd9){return BPromise[_0x55f8('0x29')](_0x33cbd9);}return _0x128d13['save']();};}function saveUpdates(_0x141353,_0x2b780e){return function(_0x741474){if(_0x741474){return _0x741474[_0x55f8('0x2a')](_0x141353)[_0x55f8('0x2b')](function(_0x3e4b22){return _0x3e4b22;});}return null;};}function removeEntity(_0x4d74cf,_0x20b1ab){return function(_0x27c060){if(_0x27c060){return _0x27c060[_0x55f8('0x2c')]()['then'](function(){var _0x337371=_0x27c060[_0x55f8('0x2d')]({'plain':!![]});var _0x833c20=_0x55f8('0x2e');return db[_0x55f8('0x2f')][_0x55f8('0x2c')]({'where':{'type':_0x833c20,'resourceId':_0x337371['id']}})['then'](function(){return _0x27c060;});})[_0x55f8('0x2b')](function(){_0x4d74cf[_0x55f8('0x21')](0xcc)[_0x55f8('0x22')]();});}};}function handleEntityNotFound(_0x20f750,_0x4a0d0d){return function(_0xe6de95){if(!_0xe6de95){_0x20f750[_0x55f8('0x20')](0x194);}return _0xe6de95;};}function handleError(_0xcf00c,_0x41d254){_0x41d254=_0x41d254||0x1f4;return function(_0x28373d){logger[_0x55f8('0x30')](_0x28373d['stack']);if(_0x28373d[_0x55f8('0x31')]){delete _0x28373d[_0x55f8('0x31')];}_0xcf00c[_0x55f8('0x21')](_0x41d254)[_0x55f8('0x32')](_0x28373d);};}exports[_0x55f8('0x33')]=function(_0x26ffc2,_0x342963){var _0x7c9d03={},_0x1aa1c9={},_0x24caf3={'count':0x0,'rows':[]};var _0x433f94=_[_0x55f8('0x34')](db[_0x55f8('0x35')][_0x55f8('0x36')],function(_0x29cfee){return{'name':_0x29cfee[_0x55f8('0x37')],'type':_0x29cfee[_0x55f8('0x38')][_0x55f8('0x39')]};});_0x1aa1c9['model']=_[_0x55f8('0x34')](_0x433f94,_0x55f8('0x31'));_0x1aa1c9[_0x55f8('0x3a')]=_['keys'](_0x26ffc2[_0x55f8('0x3a')]);_0x1aa1c9[_0x55f8('0x3b')]=_[_0x55f8('0x3c')](_0x1aa1c9['model'],_0x1aa1c9[_0x55f8('0x3a')]);_0x7c9d03[_0x55f8('0x3d')]=_[_0x55f8('0x3c')](_0x1aa1c9[_0x55f8('0x3e')],qs[_0x55f8('0x3f')](_0x26ffc2[_0x55f8('0x3a')]['fields']));_0x7c9d03[_0x55f8('0x3d')]=_0x7c9d03[_0x55f8('0x3d')]['length']?_0x7c9d03[_0x55f8('0x3d')]:_0x1aa1c9[_0x55f8('0x3e')];if(!_0x26ffc2[_0x55f8('0x3a')][_0x55f8('0x40')](_0x55f8('0x41'))){_0x7c9d03[_0x55f8('0x42')]=qs[_0x55f8('0x42')](_0x26ffc2[_0x55f8('0x3a')][_0x55f8('0x42')]);_0x7c9d03[_0x55f8('0x24')]=qs[_0x55f8('0x24')](_0x26ffc2['query']['offset']);}_0x7c9d03[_0x55f8('0x43')]=qs[_0x55f8('0x44')](_0x26ffc2['query'][_0x55f8('0x44')]);_0x7c9d03['where']=qs['filters'](_[_0x55f8('0x45')](_0x26ffc2[_0x55f8('0x3a')],_0x1aa1c9['filters']),_0x433f94);if(_0x26ffc2['query'][_0x55f8('0x46')]){_0x7c9d03[_0x55f8('0x47')]=_[_0x55f8('0x48')](_0x7c9d03[_0x55f8('0x47')],{'$or':_[_0x55f8('0x34')](_0x433f94,function(_0x1993a5){if(_0x1993a5[_0x55f8('0x38')]!==_0x55f8('0x49')){var _0x4adb41={};_0x4adb41[_0x1993a5[_0x55f8('0x31')]]={'$like':'%'+_0x26ffc2[_0x55f8('0x3a')][_0x55f8('0x46')]+'%'};return _0x4adb41;}})});}_0x7c9d03=_[_0x55f8('0x48')]({},_0x7c9d03,_0x26ffc2[_0x55f8('0x4a')]);var _0x5d5453={'where':_0x7c9d03[_0x55f8('0x47')]};return db[_0x55f8('0x35')][_0x55f8('0x26')](_0x5d5453)['then'](function(_0x53c6bb){_0x24caf3[_0x55f8('0x26')]=_0x53c6bb;if(_0x26ffc2[_0x55f8('0x3a')][_0x55f8('0x4b')]){_0x7c9d03[_0x55f8('0x4c')]=[{'all':!![]}];}return db[_0x55f8('0x35')][_0x55f8('0x4d')](_0x7c9d03);})[_0x55f8('0x2b')](function(_0x1a645c){_0x24caf3[_0x55f8('0x4e')]=_0x1a645c;return _0x24caf3;})[_0x55f8('0x2b')](respondWithFilteredResult(_0x342963,_0x7c9d03))[_0x55f8('0x4f')](handleError(_0x342963,null));};exports[_0x55f8('0x50')]=function(_0x58e62d,_0x2e6081){var _0x468cff={'raw':!![],'where':{'id':_0x58e62d[_0x55f8('0x51')]['id']}},_0x1b5d3c={};_0x1b5d3c[_0x55f8('0x3e')]=_[_0x55f8('0x52')](db[_0x55f8('0x35')]['rawAttributes']);_0x1b5d3c[_0x55f8('0x3a')]=_[_0x55f8('0x52')](_0x58e62d[_0x55f8('0x3a')]);_0x1b5d3c[_0x55f8('0x3b')]=_[_0x55f8('0x3c')](_0x1b5d3c[_0x55f8('0x3e')],_0x1b5d3c[_0x55f8('0x3a')]);_0x468cff[_0x55f8('0x3d')]=_[_0x55f8('0x3c')](_0x1b5d3c[_0x55f8('0x3e')],qs['fields'](_0x58e62d[_0x55f8('0x3a')][_0x55f8('0x3f')]));_0x468cff[_0x55f8('0x3d')]=_0x468cff[_0x55f8('0x3d')][_0x55f8('0x53')]?_0x468cff[_0x55f8('0x3d')]:_0x1b5d3c[_0x55f8('0x3e')];if(_0x58e62d[_0x55f8('0x3a')][_0x55f8('0x4b')]){_0x468cff['include']=[{'all':!![]}];}_0x468cff=_['merge']({},_0x468cff,_0x58e62d['options']);return db['WhatsappQueue'][_0x55f8('0x54')](_0x468cff)[_0x55f8('0x2b')](handleEntityNotFound(_0x2e6081,null))[_0x55f8('0x2b')](respondWithResult(_0x2e6081,null))['catch'](handleError(_0x2e6081,null));};exports[_0x55f8('0x55')]=function(_0x1429ea,_0x5eda64){return db[_0x55f8('0x35')]['create'](_0x1429ea[_0x55f8('0x56')],{})['then'](function(_0x1678be){var _0x48cb64=_0x1429ea[_0x55f8('0x57')][_0x55f8('0x2d')]({'plain':!![]});if(!_0x48cb64)throw new Error(_0x55f8('0x58'));if(_0x48cb64[_0x55f8('0x59')]===_0x55f8('0x57')){var _0x3e2c41=_0x1678be['get']({'plain':!![]});var _0x1ab5fb=_0x55f8('0x2e');return db[_0x55f8('0x5a')][_0x55f8('0x54')]({'where':{'name':_0x1ab5fb,'userProfileId':_0x48cb64['userProfileId']},'raw':!![]})[_0x55f8('0x2b')](function(_0x15358d){if(_0x15358d&&_0x15358d[_0x55f8('0x5b')]===0x0){return db[_0x55f8('0x2f')][_0x55f8('0x55')]({'name':_0x3e2c41[_0x55f8('0x31')],'resourceId':_0x3e2c41['id'],'type':_0x15358d[_0x55f8('0x31')],'sectionId':_0x15358d['id']},{})['then'](function(){return _0x1678be;});}else{return _0x1678be;}})[_0x55f8('0x4f')](function(_0x37d17b){logger[_0x55f8('0x30')](_0x55f8('0x5c'),_0x37d17b);throw _0x37d17b;});}return _0x1678be;})[_0x55f8('0x2b')](respondWithResult(_0x5eda64,0xc9))['catch'](handleError(_0x5eda64,null));};exports[_0x55f8('0x2a')]=function(_0x1be7f4,_0x48fd6c){if(_0x1be7f4[_0x55f8('0x56')]['id']){delete _0x1be7f4[_0x55f8('0x56')]['id'];}return db[_0x55f8('0x35')][_0x55f8('0x54')]({'where':{'id':_0x1be7f4[_0x55f8('0x51')]['id']}})[_0x55f8('0x2b')](handleEntityNotFound(_0x48fd6c,null))[_0x55f8('0x2b')](saveUpdates(_0x1be7f4[_0x55f8('0x56')],null))[_0x55f8('0x2b')](respondWithResult(_0x48fd6c,null))['catch'](handleError(_0x48fd6c,null));};exports[_0x55f8('0x2c')]=function(_0x2bc591,_0x504fd3){return db['WhatsappQueue'][_0x55f8('0x54')]({'where':{'id':_0x2bc591['params']['id']}})[_0x55f8('0x2b')](handleEntityNotFound(_0x504fd3,null))[_0x55f8('0x2b')](removeEntity(_0x504fd3,null))[_0x55f8('0x4f')](handleError(_0x504fd3,null));};exports[_0x55f8('0x5d')]=function(_0x3a3e95,_0x39d7d6){return db['WhatsappQueue'][_0x55f8('0x5d')]()['then'](respondWithResult(_0x39d7d6,null))[_0x55f8('0x4f')](handleError(_0x39d7d6,null));};exports[_0x55f8('0x5e')]=function(_0x38d499,_0xa3ce48,_0x167d74){var _0x198031={'raw':!![],'where':{}},_0x2911bd={},_0x57757b;return db[_0x55f8('0x35')][_0x55f8('0x5f')]({'where':{'id':_0x38d499[_0x55f8('0x51')]['id']}})[_0x55f8('0x2b')](handleEntityNotFound(_0xa3ce48,null))[_0x55f8('0x2b')](function(_0x4c85c4){if(_0x4c85c4){_0x57757b=_0x4c85c4[_0x55f8('0x2d')]({'plain':!![]});_0x2911bd[_0x55f8('0x3e')]=_['keys'](db[_0x55f8('0x60')][_0x55f8('0x36')]);_0x2911bd['query']=_['keys'](_0x38d499[_0x55f8('0x3a')]);_0x2911bd[_0x55f8('0x3b')]=_[_0x55f8('0x3c')](_0x2911bd[_0x55f8('0x3e')],_0x2911bd[_0x55f8('0x3a')]);_0x198031[_0x55f8('0x3d')]=_[_0x55f8('0x3c')](_0x2911bd[_0x55f8('0x3e')],qs[_0x55f8('0x3f')](_0x38d499['query'][_0x55f8('0x3f')]));_0x198031['attributes']=_0x198031[_0x55f8('0x3d')][_0x55f8('0x53')]?_0x198031[_0x55f8('0x3d')]:_0x2911bd[_0x55f8('0x3e')];if(!_0x38d499[_0x55f8('0x3a')][_0x55f8('0x40')](_0x55f8('0x41'))){_0x198031[_0x55f8('0x42')]=qs[_0x55f8('0x42')](_0x38d499['query'][_0x55f8('0x42')]);_0x198031[_0x55f8('0x24')]=qs[_0x55f8('0x24')](_0x38d499[_0x55f8('0x3a')][_0x55f8('0x24')]);}_0x198031[_0x55f8('0x43')]=qs[_0x55f8('0x44')](_0x38d499['query'][_0x55f8('0x44')]);_0x198031[_0x55f8('0x47')]=qs['filters'](_[_0x55f8('0x45')](_0x38d499[_0x55f8('0x3a')],_0x2911bd['filters']));_0x198031['where'][_0x55f8('0x61')]=_0x4c85c4['id'];if(_0x38d499[_0x55f8('0x3a')][_0x55f8('0x46')]){_0x198031[_0x55f8('0x47')]=_['merge'](_0x198031[_0x55f8('0x47')],{'$or':_['map'](_0x198031['attributes'],function(_0x44010b){var _0x4d74dc={};_0x4d74dc[_0x44010b]={'$like':'%'+_0x38d499[_0x55f8('0x3a')][_0x55f8('0x46')]+'%'};return _0x4d74dc;})});}_0x198031=_['merge']({},_0x198031,_0x38d499[_0x55f8('0x4a')]);return db[_0x55f8('0x60')][_0x55f8('0x4d')](_0x198031);}})[_0x55f8('0x2b')](function(_0x49f2ef){if(_0x49f2ef){return db[_0x55f8('0x62')][_0x55f8('0x63')]({'where':{'id':_['map'](_0x49f2ef,_0x55f8('0x64')),'role':'agent'},'attributes':['id',_0x55f8('0x31'),_0x55f8('0x65'),_0x55f8('0x66'),_0x55f8('0x67')]});}})[_0x55f8('0x2b')](function(_0x478c4d){if(_0x478c4d){return{'count':_0x478c4d[_0x55f8('0x26')],'rows':_[_0x55f8('0x34')](_0x478c4d[_0x55f8('0x4e')],function(_0x4c17df){return{'membername':_0x4c17df[_0x55f8('0x31')],'UserId':_0x4c17df['id'],'queue_name':_0x57757b[_0x55f8('0x31')],'WhatsappQueueId':_0x57757b['id'],'interface':util[_0x55f8('0x68')](_0x55f8('0x69'),'SIP',_0x4c17df[_0x55f8('0x31')]),'penalty':0x0,'paused':_0x4c17df[_0x55f8('0x65')],'createdAt':_0x4c17df[_0x55f8('0x67')],'updatedAt':_0x4c17df['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x55f8('0x2b')](respondWithFilteredResult(_0xa3ce48,_0x198031))[_0x55f8('0x4f')](handleError(_0xa3ce48,null));};exports['getTeams']=function(_0x1e92ca,_0x1d79fb,_0x4396a4){var _0x58028b={};var _0x325752={};var _0x4ec01a;var _0x226ce6;return db['WhatsappQueue']['findOne']({'where':{'id':_0x1e92ca[_0x55f8('0x51')]['id']}})['then'](handleEntityNotFound(_0x1d79fb,null))[_0x55f8('0x2b')](function(_0x5cd3b9){if(_0x5cd3b9){_0x4ec01a=_0x5cd3b9;_0x325752[_0x55f8('0x3e')]=_['keys'](db[_0x55f8('0x6a')][_0x55f8('0x36')]);_0x325752['query']=_[_0x55f8('0x52')](_0x1e92ca['query']);_0x325752['filters']=_['intersection'](_0x325752[_0x55f8('0x3e')],_0x325752[_0x55f8('0x3a')]);_0x58028b[_0x55f8('0x3d')]=_[_0x55f8('0x3c')](_0x325752[_0x55f8('0x3e')],qs[_0x55f8('0x3f')](_0x1e92ca[_0x55f8('0x3a')]['fields']));_0x58028b[_0x55f8('0x3d')]=_0x58028b['attributes']['length']?_0x58028b[_0x55f8('0x3d')]:_0x325752[_0x55f8('0x3e')];_0x58028b[_0x55f8('0x43')]=qs[_0x55f8('0x44')](_0x1e92ca[_0x55f8('0x3a')][_0x55f8('0x44')]);_0x58028b[_0x55f8('0x47')]=qs['filters'](_[_0x55f8('0x45')](_0x1e92ca['query'],_0x325752['filters']));if(_0x1e92ca[_0x55f8('0x3a')][_0x55f8('0x46')]){_0x58028b[_0x55f8('0x47')]=_['merge'](_0x58028b['where'],{'$or':_[_0x55f8('0x34')](_0x58028b[_0x55f8('0x3d')],function(_0x575483){var _0x14ca8c={};_0x14ca8c[_0x575483]={'$like':'%'+_0x1e92ca[_0x55f8('0x3a')]['filter']+'%'};return _0x14ca8c;})});}_0x58028b=_[_0x55f8('0x48')]({},_0x58028b,_0x1e92ca[_0x55f8('0x4a')]);return _0x4ec01a[_0x55f8('0x6b')](_0x58028b);}})[_0x55f8('0x2b')](function(_0x3a3644){if(_0x3a3644){_0x226ce6=_0x3a3644['length'];if(!_0x1e92ca['query'][_0x55f8('0x40')]('nolimit')){_0x58028b['limit']=qs['limit'](_0x1e92ca[_0x55f8('0x3a')]['limit']);_0x58028b[_0x55f8('0x24')]=qs[_0x55f8('0x24')](_0x1e92ca[_0x55f8('0x3a')][_0x55f8('0x24')]);}return _0x4ec01a[_0x55f8('0x6b')](_0x58028b);}})[_0x55f8('0x2b')](function(_0x1a8ba7){if(_0x1a8ba7){return _0x1a8ba7?{'count':_0x226ce6,'rows':_0x1a8ba7}:null;}})[_0x55f8('0x2b')](respondWithResult(_0x1d79fb,null))[_0x55f8('0x4f')](handleError(_0x1d79fb,null));};exports[_0x55f8('0x6c')]=function(_0x4b474d,_0x3c6d23,_0x56154a){var _0x3d84fc=_0x4b474d[_0x55f8('0x56')][_0x55f8('0x6d')];return db[_0x55f8('0x6a')][_0x55f8('0x4d')]({'where':{'id':_0x3d84fc},'attributes':['id'],'include':[{'model':db[_0x55f8('0x62')],'as':_0x55f8('0x6e'),'attributes':['id','name',_0x55f8('0x6f'),_0x55f8('0x70'),_0x55f8('0x71')],'raw':!![]}]})[_0x55f8('0x2b')](function(_0x53f86b){if(_0x53f86b){var _0x5b7a6b=_['flatMap'](_0x53f86b,function(_0x9cbb1d){var _0x62c80f=_0x9cbb1d['get']({'plain':!![]});return _0x62c80f[_0x55f8('0x6e')];});return db[_0x55f8('0x35')][_0x55f8('0x54')]({'where':{'id':_0x4b474d[_0x55f8('0x51')]['id']}})[_0x55f8('0x2b')](function(_0x2d0ffc){return db[_0x55f8('0x72')]['transaction'](function(_0x59eca9){return _0x2d0ffc['addTeams'](_0x3d84fc,{'transaction':_0x59eca9})[_0x55f8('0x2b')](function(){return BPromise[_0x55f8('0x73')](_0x5b7a6b,function(_0x3e9f92){return db[_0x55f8('0x60')][_0x55f8('0x74')]({'where':{'UserId':_0x3e9f92['id'],'WhatsappQueueId':_0x4b474d['params']['id']},'transaction':_0x59eca9});});})[_0x55f8('0x2b')](function(){_0x5b7a6b[_0x55f8('0x75')](function(_0x29613a){socket[_0x55f8('0x76')](_0x55f8('0x77'),{'UserId':_0x29613a['id'],'WhatsappQueueId':_0x2d0ffc['id']});});});});});}})[_0x55f8('0x2b')](respondWithStatusCode(_0x3c6d23,null))['catch'](handleError(_0x3c6d23,null));};exports[_0x55f8('0x78')]=function(_0x4ad3ca,_0x8b1a25,_0x562fa1){return db['Team']['findAll']({'where':{'id':_0x4ad3ca[_0x55f8('0x3a')][_0x55f8('0x6d')]},'attributes':['id'],'include':[{'model':db[_0x55f8('0x62')],'as':_0x55f8('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x55f8('0x2b')](handleEntityNotFound(_0x8b1a25,null))[_0x55f8('0x2b')](function(_0x50be8c){var _0x21f24c=_[_0x55f8('0x34')](_0x50be8c,'id');var _0x4c12d3=[];var _0x31d1df=[];var _0x10d5a4=squel[_0x55f8('0x79')]();_0x10d5a4['field'](_0x55f8('0x7a'))[_0x55f8('0x7b')]('team_has_whatsapp_queues','tq')[_0x55f8('0x7c')]('user_has_teams','ut',_0x55f8('0x7d'))[_0x55f8('0x47')](_0x55f8('0x7e'),_0x4ad3ca[_0x55f8('0x51')]['id']);for(var _0x176d40=0x0;_0x176d40<_0x50be8c['length'];_0x176d40+=0x1){let _0x5f3b0b=_0x50be8c[_0x176d40];for(var _0x5c8764=0x0;_0x5c8764<_0x5f3b0b[_0x55f8('0x6e')][_0x55f8('0x53')];_0x5c8764+=0x1){let _0x5c1c15=_0x5f3b0b['Agents'][_0x5c8764];var _0x228df5=_0x10d5a4['clone']();_0x228df5[_0x55f8('0x47')](_0x55f8('0x7f'),_0x5c1c15['id']);_0x31d1df[_0x55f8('0x80')](db[_0x55f8('0x72')][_0x55f8('0x3a')](_0x228df5[_0x55f8('0x81')](),{'type':db['sequelize'][_0x55f8('0x82')][_0x55f8('0x83')]})[_0x55f8('0x2b')](function(_0x10fabb){if(_0x10fabb[_0x55f8('0x53')]===0x1){return _0x5c1c15['id'];}else{var _0x336146=_[_0x55f8('0x84')](_[_0x55f8('0x34')](_0x10fabb,_0x55f8('0x85')),function(_0x352f46){return _['includes'](_0x21f24c,_0x352f46);});if(_0x336146){return _0x5c1c15['id'];}}}));}}return BPromise['all'](_0x31d1df)[_0x55f8('0x2b')](function(_0x4514cd){_0x4c12d3=_(_0x4c12d3)['union'](_0x4514cd)[_0x55f8('0x86')]()[_0x55f8('0x87')]();return db[_0x55f8('0x35')][_0x55f8('0x54')]({'where':{'id':_0x4ad3ca[_0x55f8('0x51')]['id']}})[_0x55f8('0x2b')](function(_0x5757fb){return db[_0x55f8('0x72')][_0x55f8('0x88')](function(_0x116324){return _0x5757fb[_0x55f8('0x78')](_0x4ad3ca[_0x55f8('0x3a')][_0x55f8('0x6d')],{'transaction':_0x116324})[_0x55f8('0x2b')](function(){if(!_['isEmpty'](_0x4c12d3)){return _0x5757fb[_0x55f8('0x89')](_0x4c12d3,{'transaction':_0x116324});}})[_0x55f8('0x2b')](function(){_0x4c12d3[_0x55f8('0x75')](function(_0x20031e){socket[_0x55f8('0x76')](_0x55f8('0x8a'),{'UserId':_0x20031e,'WhatsappQueueId':_0x5757fb['id']});});});});});});})['then'](respondWithStatusCode(_0x8b1a25,null))[_0x55f8('0x4f')](handleError(_0x8b1a25,null));};exports[_0x55f8('0x8b')]=function(_0x17589d,_0x46476b,_0x30a7af){return db['WhatsappQueue'][_0x55f8('0x54')]({'where':{'id':_0x17589d[_0x55f8('0x51')]['id']}})[_0x55f8('0x2b')](handleEntityNotFound(_0x46476b,null))['then'](function(_0x4f9120){if(_0x4f9120){return _0x4f9120[_0x55f8('0x8b')](_0x17589d[_0x55f8('0x56')][_0x55f8('0x6d')],_[_0x55f8('0x8c')](_0x17589d['body'],[_0x55f8('0x6d'),'id'])||{})['spread'](function(_0x18f3eb){for(var _0x1e0a75=0x0;_0x1e0a75<_0x17589d[_0x55f8('0x56')][_0x55f8('0x6d')]['length'];_0x1e0a75+=0x1){socket[_0x55f8('0x76')](_0x55f8('0x77'),{'UserId':Number(_0x17589d[_0x55f8('0x56')][_0x55f8('0x6d')][_0x1e0a75]),'WhatsappQueueId':Number(_0x17589d[_0x55f8('0x51')]['id'])});}return _0x18f3eb;});}})['then'](respondWithResult(_0x46476b,null))[_0x55f8('0x4f')](handleError(_0x46476b,null));};exports[_0x55f8('0x89')]=function(_0x414fdf,_0x51d71a,_0xf527d9){return db['WhatsappQueue'][_0x55f8('0x54')]({'where':{'id':_0x414fdf[_0x55f8('0x51')]['id']}})[_0x55f8('0x2b')](handleEntityNotFound(_0x51d71a,null))[_0x55f8('0x2b')](function(_0x4b255f){if(_0x4b255f){return _0x4b255f[_0x55f8('0x89')](_0x414fdf[_0x55f8('0x3a')]['ids'])['then'](function(){if(_[_0x55f8('0x8d')](_0x414fdf[_0x55f8('0x3a')][_0x55f8('0x6d')])){for(var _0x5006f7=0x0;_0x5006f7<_0x414fdf['query']['ids'][_0x55f8('0x53')];_0x5006f7+=0x1){socket[_0x55f8('0x76')](_0x55f8('0x8a'),{'UserId':Number(_0x414fdf['query']['ids'][_0x5006f7]),'WhatsappQueueId':Number(_0x414fdf[_0x55f8('0x51')]['id'])});}}else{socket[_0x55f8('0x76')](_0x55f8('0x8a'),{'UserId':Number(_0x414fdf[_0x55f8('0x3a')]['ids']),'WhatsappQueueId':Number(_0x414fdf[_0x55f8('0x51')]['id'])});}});}})[_0x55f8('0x2b')](respondWithStatusCode(_0x51d71a,null))['catch'](handleError(_0x51d71a,null));};exports[_0x55f8('0x8e')]=function(_0x4a51ae,_0x18b6a0,_0x51f48b){var _0x589b8c={};var _0x595016={};var _0x1739ce;var _0x2ca36b;return db[_0x55f8('0x35')]['findOne']({'where':{'id':_0x4a51ae[_0x55f8('0x51')]['id']}})[_0x55f8('0x2b')](handleEntityNotFound(_0x18b6a0,null))['then'](function(_0x37ec5c){if(_0x37ec5c){_0x1739ce=_0x37ec5c;_0x595016[_0x55f8('0x3e')]=_[_0x55f8('0x52')](db[_0x55f8('0x62')][_0x55f8('0x36')]);_0x595016[_0x55f8('0x3a')]=_[_0x55f8('0x52')](_0x4a51ae[_0x55f8('0x3a')]);_0x595016[_0x55f8('0x3b')]=_[_0x55f8('0x3c')](_0x595016[_0x55f8('0x3e')],_0x595016[_0x55f8('0x3a')]);_0x589b8c['attributes']=_[_0x55f8('0x3c')](_0x595016['model'],qs[_0x55f8('0x3f')](_0x4a51ae[_0x55f8('0x3a')][_0x55f8('0x3f')]));_0x589b8c['attributes']=_0x589b8c[_0x55f8('0x3d')][_0x55f8('0x53')]?_0x589b8c['attributes']:_0x595016['model'];_0x589b8c[_0x55f8('0x43')]=qs[_0x55f8('0x44')](_0x4a51ae[_0x55f8('0x3a')][_0x55f8('0x44')]);_0x589b8c[_0x55f8('0x47')]=qs[_0x55f8('0x3b')](_['pick'](_0x4a51ae['query'],_0x595016[_0x55f8('0x3b')]));if(_0x4a51ae[_0x55f8('0x3a')]['filter']){_0x589b8c[_0x55f8('0x47')]=_['merge'](_0x589b8c[_0x55f8('0x47')],{'$or':_['map'](_0x589b8c['attributes'],function(_0x2d9463){var _0x2aaaac={};_0x2aaaac[_0x2d9463]={'$like':'%'+_0x4a51ae[_0x55f8('0x3a')][_0x55f8('0x46')]+'%'};return _0x2aaaac;})});}_0x589b8c=_[_0x55f8('0x48')]({},_0x589b8c,_0x4a51ae[_0x55f8('0x4a')]);return _0x1739ce[_0x55f8('0x8e')](_0x589b8c);}})[_0x55f8('0x2b')](function(_0x340e6e){if(_0x340e6e){_0x2ca36b=_0x340e6e[_0x55f8('0x53')];if(!_0x4a51ae[_0x55f8('0x3a')][_0x55f8('0x40')](_0x55f8('0x41'))){_0x589b8c['limit']=qs[_0x55f8('0x42')](_0x4a51ae['query'][_0x55f8('0x42')]);_0x589b8c[_0x55f8('0x24')]=qs[_0x55f8('0x24')](_0x4a51ae[_0x55f8('0x3a')][_0x55f8('0x24')]);}return _0x1739ce['getAgents'](_0x589b8c);}})['then'](function(_0x1f4cb2){if(_0x1f4cb2){return _0x1f4cb2?{'count':_0x2ca36b,'rows':_0x1f4cb2}:null;}})[_0x55f8('0x2b')](respondWithResult(_0x18b6a0,null))[_0x55f8('0x4f')](handleError(_0x18b6a0,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 5b50023..c7a244a 100644 --- a/server/api/whatsappQueue/whatsappQueue.events.js +++ b/server/api/whatsappQueue/whatsappQueue.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb21a=['../../mysqldb','WhatsappQueue','setMaxListeners','save','remove','emit','hook','exports','events'];(function(_0x4a9520,_0x4e67b2){var _0x27d098=function(_0x3e367c){while(--_0x3e367c){_0x4a9520['push'](_0x4a9520['shift']());}};_0x27d098(++_0x4e67b2);}(_0xb21a,0x1ca));var _0xab21=function(_0x4db352,_0x3d638){_0x4db352=_0x4db352-0x0;var _0x54ff7e=_0xb21a[_0x4db352];return _0x54ff7e;};'use strict';var EventEmitter=require(_0xab21('0x0'));var WhatsappQueue=require(_0xab21('0x1'))['db'][_0xab21('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xab21('0x3')](0x0);var events={'afterCreate':_0xab21('0x4'),'afterUpdate':'update','afterDestroy':_0xab21('0x5')};function emitEvent(_0x31f16c){return function(_0x599ead,_0x26cc79,_0x2691ff){WhatsappQueueEvents[_0xab21('0x6')](_0x31f16c+':'+_0x599ead['id'],_0x599ead);WhatsappQueueEvents[_0xab21('0x6')](_0x31f16c,_0x599ead);_0x2691ff(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0xab21('0x7')](e,emitEvent(event));}}module[_0xab21('0x8')]=WhatsappQueueEvents; \ No newline at end of file +var _0x3c08=['exports','../../mysqldb','WhatsappQueue','setMaxListeners','update','emit','hook'];(function(_0x384f5c,_0x3b4715){var _0x40d2e9=function(_0x38052b){while(--_0x38052b){_0x384f5c['push'](_0x384f5c['shift']());}};_0x40d2e9(++_0x3b4715);}(_0x3c08,0x1e4));var _0x83c0=function(_0x2c24b3,_0x2c5a94){_0x2c24b3=_0x2c24b3-0x0;var _0x4f59c8=_0x3c08[_0x2c24b3];return _0x4f59c8;};'use strict';var EventEmitter=require('events');var WhatsappQueue=require(_0x83c0('0x0'))['db'][_0x83c0('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x83c0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x83c0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x437e24){return function(_0x48480e,_0x2fa100,_0x3809f1){WhatsappQueueEvents[_0x83c0('0x4')](_0x437e24+':'+_0x48480e['id'],_0x48480e);WhatsappQueueEvents[_0x83c0('0x4')](_0x437e24,_0x48480e);_0x3809f1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x83c0('0x5')](e,emitEvent(event));}}module[_0x83c0('0x6')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 8b9f935..e478479 100644 --- a/server/api/whatsappQueue/whatsappQueue.model.js +++ b/server/api/whatsappQueue/whatsappQueue.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0d04=['rimraf','./whatsappQueue.attributes','exports','define','WhatsappQueue','whatsapp_queues','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x0d04,0x18c));var _0x40d0=function(_0x417b1a,_0x3cfce5){_0x417b1a=_0x417b1a-0x0;var _0x1e41af=_0x0d04[_0x417b1a];return _0x1e41af;};'use strict';var _=require(_0x40d0('0x0'));var util=require(_0x40d0('0x1'));var logger=require(_0x40d0('0x2'))(_0x40d0('0x3'));var moment=require(_0x40d0('0x4'));var BPromise=require('bluebird');var rp=require(_0x40d0('0x5'));var fs=require('fs');var path=require(_0x40d0('0x6'));var rimraf=require(_0x40d0('0x7'));var config=require('../../config/environment');var attributes=require(_0x40d0('0x8'));module[_0x40d0('0x9')]=function(_0x3e54fa,_0x491546){return _0x3e54fa[_0x40d0('0xa')](_0x40d0('0xb'),attributes,{'tableName':_0x40d0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9a3=['../../config/environment','define','WhatsappQueue','whatsapp_queues','util','../../config/logger','bluebird'];(function(_0x1df4bf,_0x28ba68){var _0x3a1ee1=function(_0x3cd344){while(--_0x3cd344){_0x1df4bf['push'](_0x1df4bf['shift']());}};_0x3a1ee1(++_0x28ba68);}(_0xe9a3,0xac));var _0x3e9a=function(_0x56478b,_0x193f1d){_0x56478b=_0x56478b-0x0;var _0x2e70b7=_0xe9a3[_0x56478b];return _0x2e70b7;};'use strict';var _=require('lodash');var util=require(_0x3e9a('0x0'));var logger=require(_0x3e9a('0x1'))('api');var moment=require('moment');var BPromise=require(_0x3e9a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3e9a('0x3'));var attributes=require('./whatsappQueue.attributes');module['exports']=function(_0x27cb46,_0xe24460){return _0x27cb46[_0x3e9a('0x4')](_0x3e9a('0x5'),attributes,{'tableName':_0x3e9a('0x6'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.rpc.js b/server/api/whatsappQueue/whatsappQueue.rpc.js index bd21b43..91104b9 100644 --- a/server/api/whatsappQueue/whatsappQueue.rpc.js +++ b/server/api/whatsappQueue/whatsappQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xca00=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','info','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','where','attributes','limit','include','model','map','then','ShowWhatsappQueue','raw','lodash','util','moment','ioredis'];(function(_0x81324,_0x2927ef){var _0x9811c6=function(_0x100955){while(--_0x100955){_0x81324['push'](_0x81324['shift']());}};_0x9811c6(++_0x2927ef);}(_0xca00,0xe6));var _0x0ca0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xca00[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0ca0('0x0'));var util=require(_0x0ca0('0x1'));var moment=require(_0x0ca0('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ca0('0x3'));var db=require(_0x0ca0('0x4'))['db'];var utils=require(_0x0ca0('0x5'));var logger=require(_0x0ca0('0x6'))(_0x0ca0('0x7'));var config=require(_0x0ca0('0x8'));var jayson=require(_0x0ca0('0x9'));var client=jayson[_0x0ca0('0xa')][_0x0ca0('0xb')]({'port':0x232a});config[_0x0ca0('0xc')]=_['defaults'](config['redis'],{'host':_0x0ca0('0xd'),'port':0x18eb});var socket=require(_0x0ca0('0xe'))(new Redis(config[_0x0ca0('0xc')]));require(_0x0ca0('0xf'))[_0x0ca0('0x10')](socket);function respondWithRpcPromise(_0x43cba4,_0xe602ee,_0x54f319){return new BPromise(function(_0x16eee7,_0x2b63bc){return client['request'](_0x43cba4,_0x54f319)['then'](function(_0x508f7c){logger[_0x0ca0('0x11')](_0x0ca0('0x12'),_0xe602ee,'request\x20sent');logger[_0x0ca0('0x13')](_0x0ca0('0x14'),_0xe602ee,_0x0ca0('0x15'),JSON['stringify'](_0x508f7c));if(_0x508f7c['error']){if(_0x508f7c[_0x0ca0('0x16')]['code']===0x1f4){logger[_0x0ca0('0x16')](_0x0ca0('0x12'),_0xe602ee,_0x508f7c['error'][_0x0ca0('0x17')]);return _0x2b63bc(_0x508f7c[_0x0ca0('0x16')][_0x0ca0('0x17')]);}logger[_0x0ca0('0x16')]('WhatsappQueue,\x20%s,\x20%s',_0xe602ee,_0x508f7c['error'][_0x0ca0('0x17')]);return _0x16eee7(_0x508f7c[_0x0ca0('0x16')][_0x0ca0('0x17')]);}else{logger['info']('WhatsappQueue,\x20%s,\x20%s',_0xe602ee,_0x0ca0('0x15'));_0x16eee7(_0x508f7c[_0x0ca0('0x18')][_0x0ca0('0x17')]);}})[_0x0ca0('0x19')](function(_0x1f2469){logger[_0x0ca0('0x16')](_0x0ca0('0x12'),_0xe602ee,_0x1f2469);_0x2b63bc(_0x1f2469);});});}exports[_0x0ca0('0x1a')]=function(_0x171854){var _0x324d4f=this;return new Promise(function(_0x2dd020,_0x1bcf29){return db[_0x0ca0('0x1b')][_0x0ca0('0x1c')]({'raw':_0x171854[_0x0ca0('0x1d')]?_0x171854[_0x0ca0('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x171854[_0x0ca0('0x1d')]?_0x171854[_0x0ca0('0x1d')][_0x0ca0('0x1e')]||null:null,'attributes':_0x171854['options']?_0x171854[_0x0ca0('0x1d')][_0x0ca0('0x1f')]||null:null,'limit':_0x171854[_0x0ca0('0x1d')]?_0x171854[_0x0ca0('0x1d')][_0x0ca0('0x20')]||null:null,'include':_0x171854['options']?_0x171854[_0x0ca0('0x1d')][_0x0ca0('0x21')]?_['map'](_0x171854[_0x0ca0('0x1d')][_0x0ca0('0x21')],function(_0x1565c8){return{'model':db[_0x1565c8[_0x0ca0('0x22')]],'as':_0x1565c8['as'],'attributes':_0x1565c8[_0x0ca0('0x1f')],'include':_0x1565c8[_0x0ca0('0x21')]?_[_0x0ca0('0x23')](_0x1565c8[_0x0ca0('0x21')],function(_0x3c8e11){return{'model':db[_0x3c8e11['model']],'as':_0x3c8e11['as'],'attributes':_0x3c8e11['attributes'],'include':_0x3c8e11[_0x0ca0('0x21')]?_[_0x0ca0('0x23')](_0x3c8e11[_0x0ca0('0x21')],function(_0x138749){return{'model':db[_0x138749[_0x0ca0('0x22')]],'as':_0x138749['as'],'attributes':_0x138749[_0x0ca0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0ca0('0x24')](function(_0x50be16){logger[_0x0ca0('0x11')]('GetWhatsappQueue',_0x171854);logger['debug'](_0x0ca0('0x1a'),_0x171854,JSON['stringify'](_0x50be16));_0x2dd020(_0x50be16);})[_0x0ca0('0x19')](function(_0x28f421){logger[_0x0ca0('0x16')](_0x0ca0('0x1a'),_0x28f421[_0x0ca0('0x17')],_0x171854);_0x1bcf29(_0x324d4f['error'](0x1f4,_0x28f421[_0x0ca0('0x17')]));});});};exports[_0x0ca0('0x25')]=function(_0x43bd3f){var _0x562307=this;return new Promise(function(_0x25b1e6,_0x2d13a7){return db['WhatsappQueue']['find']({'raw':_0x43bd3f[_0x0ca0('0x1d')]?_0x43bd3f[_0x0ca0('0x1d')][_0x0ca0('0x26')]===undefined?!![]:![]:!![],'where':_0x43bd3f[_0x0ca0('0x1d')]?_0x43bd3f[_0x0ca0('0x1d')][_0x0ca0('0x1e')]||null:null,'attributes':_0x43bd3f[_0x0ca0('0x1d')]?_0x43bd3f['options'][_0x0ca0('0x1f')]||null:null,'include':_0x43bd3f[_0x0ca0('0x1d')]?_0x43bd3f[_0x0ca0('0x1d')][_0x0ca0('0x21')]?_[_0x0ca0('0x23')](_0x43bd3f[_0x0ca0('0x1d')]['include'],function(_0x48aa32){return{'model':db[_0x48aa32['model']],'as':_0x48aa32['as'],'attributes':_0x48aa32['attributes'],'include':_0x48aa32[_0x0ca0('0x21')]?_[_0x0ca0('0x23')](_0x48aa32[_0x0ca0('0x21')],function(_0x54896e){return{'model':db[_0x54896e[_0x0ca0('0x22')]],'as':_0x54896e['as'],'attributes':_0x54896e[_0x0ca0('0x1f')],'include':_0x54896e[_0x0ca0('0x21')]?_[_0x0ca0('0x23')](_0x54896e[_0x0ca0('0x21')],function(_0x37e341){return{'model':db[_0x37e341[_0x0ca0('0x22')]],'as':_0x37e341['as'],'attributes':_0x37e341[_0x0ca0('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0ca0('0x24')](function(_0x4c8b81){logger['info'](_0x0ca0('0x25'),_0x43bd3f);logger[_0x0ca0('0x13')](_0x0ca0('0x25'),_0x43bd3f,JSON['stringify'](_0x4c8b81));_0x25b1e6(_0x4c8b81);})[_0x0ca0('0x19')](function(_0x4af046){logger['error'](_0x0ca0('0x25'),_0x4af046[_0x0ca0('0x17')],_0x43bd3f);_0x2d13a7(_0x562307['error'](0x1f4,_0x4af046[_0x0ca0('0x17')]));});});}; \ No newline at end of file +var _0x79f7=['redis','defaults','localhost','./whatsappQueue.socket','register','request','then','info','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','WhatsappQueue,\x20%s,\x20%s','message','result','catch','GetWhatsappQueue','WhatsappQueue','options','raw','where','attributes','limit','include','model','map','ShowWhatsappQueue','find','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x29c696,_0x243038){var _0x2a2ad4=function(_0xf1425e){while(--_0xf1425e){_0x29c696['push'](_0x29c696['shift']());}};_0x2a2ad4(++_0x243038);}(_0x79f7,0x72));var _0x779f=function(_0x55414e,_0x2f5b7b){_0x55414e=_0x55414e-0x0;var _0x5197e3=_0x79f7[_0x55414e];return _0x5197e3;};'use strict';var _=require('lodash');var util=require(_0x779f('0x0'));var moment=require('moment');var BPromise=require(_0x779f('0x1'));var rs=require(_0x779f('0x2'));var fs=require('fs');var Redis=require(_0x779f('0x3'));var db=require(_0x779f('0x4'))['db'];var utils=require(_0x779f('0x5'));var logger=require(_0x779f('0x6'))(_0x779f('0x7'));var config=require(_0x779f('0x8'));var jayson=require(_0x779f('0x9'));var client=jayson[_0x779f('0xa')][_0x779f('0xb')]({'port':0x232a});config[_0x779f('0xc')]=_[_0x779f('0xd')](config[_0x779f('0xc')],{'host':_0x779f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x779f('0xc')]));require(_0x779f('0xf'))[_0x779f('0x10')](socket);function respondWithRpcPromise(_0x438e53,_0x4bb996,_0x2e4d88){return new BPromise(function(_0x35423d,_0x30f212){return client[_0x779f('0x11')](_0x438e53,_0x2e4d88)[_0x779f('0x12')](function(_0x9408c7){logger[_0x779f('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x4bb996,_0x779f('0x14'));logger[_0x779f('0x15')](_0x779f('0x16'),_0x4bb996,'request\x20sent',JSON[_0x779f('0x17')](_0x9408c7));if(_0x9408c7[_0x779f('0x18')]){if(_0x9408c7[_0x779f('0x18')][_0x779f('0x19')]===0x1f4){logger[_0x779f('0x18')](_0x779f('0x1a'),_0x4bb996,_0x9408c7[_0x779f('0x18')]['message']);return _0x30f212(_0x9408c7['error'][_0x779f('0x1b')]);}logger[_0x779f('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x4bb996,_0x9408c7[_0x779f('0x18')][_0x779f('0x1b')]);return _0x35423d(_0x9408c7[_0x779f('0x18')]['message']);}else{logger[_0x779f('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x4bb996,_0x779f('0x14'));_0x35423d(_0x9408c7[_0x779f('0x1c')]['message']);}})[_0x779f('0x1d')](function(_0x53674b){logger[_0x779f('0x18')](_0x779f('0x1a'),_0x4bb996,_0x53674b);_0x30f212(_0x53674b);});});}exports[_0x779f('0x1e')]=function(_0x1ae42f){var _0x2ba525=this;return new Promise(function(_0x42a9a4,_0x1f0f57){return db[_0x779f('0x1f')]['findAll']({'raw':_0x1ae42f[_0x779f('0x20')]?_0x1ae42f[_0x779f('0x20')][_0x779f('0x21')]===undefined?!![]:![]:!![],'where':_0x1ae42f[_0x779f('0x20')]?_0x1ae42f[_0x779f('0x20')][_0x779f('0x22')]||null:null,'attributes':_0x1ae42f['options']?_0x1ae42f['options'][_0x779f('0x23')]||null:null,'limit':_0x1ae42f[_0x779f('0x20')]?_0x1ae42f[_0x779f('0x20')][_0x779f('0x24')]||null:null,'include':_0x1ae42f[_0x779f('0x20')]?_0x1ae42f[_0x779f('0x20')][_0x779f('0x25')]?_['map'](_0x1ae42f[_0x779f('0x20')][_0x779f('0x25')],function(_0x351cde){return{'model':db[_0x351cde[_0x779f('0x26')]],'as':_0x351cde['as'],'attributes':_0x351cde[_0x779f('0x23')],'include':_0x351cde[_0x779f('0x25')]?_[_0x779f('0x27')](_0x351cde[_0x779f('0x25')],function(_0x515a8f){return{'model':db[_0x515a8f[_0x779f('0x26')]],'as':_0x515a8f['as'],'attributes':_0x515a8f[_0x779f('0x23')],'include':_0x515a8f[_0x779f('0x25')]?_[_0x779f('0x27')](_0x515a8f['include'],function(_0x5defaf){return{'model':db[_0x5defaf[_0x779f('0x26')]],'as':_0x5defaf['as'],'attributes':_0x5defaf[_0x779f('0x23')]};}):[]};}):[]};}):[]:[]})[_0x779f('0x12')](function(_0x438a71){logger[_0x779f('0x13')](_0x779f('0x1e'),_0x1ae42f);logger[_0x779f('0x15')](_0x779f('0x1e'),_0x1ae42f,JSON[_0x779f('0x17')](_0x438a71));_0x42a9a4(_0x438a71);})[_0x779f('0x1d')](function(_0x2ef69f){logger[_0x779f('0x18')](_0x779f('0x1e'),_0x2ef69f['message'],_0x1ae42f);_0x1f0f57(_0x2ba525[_0x779f('0x18')](0x1f4,_0x2ef69f['message']));});});};exports[_0x779f('0x28')]=function(_0x360b9e){var _0x3ffb38=this;return new Promise(function(_0x1503ee,_0x331144){return db['WhatsappQueue'][_0x779f('0x29')]({'raw':_0x360b9e[_0x779f('0x20')]?_0x360b9e[_0x779f('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x360b9e[_0x779f('0x20')]?_0x360b9e[_0x779f('0x20')][_0x779f('0x22')]||null:null,'attributes':_0x360b9e['options']?_0x360b9e[_0x779f('0x20')][_0x779f('0x23')]||null:null,'include':_0x360b9e['options']?_0x360b9e[_0x779f('0x20')][_0x779f('0x25')]?_[_0x779f('0x27')](_0x360b9e[_0x779f('0x20')][_0x779f('0x25')],function(_0x3e9bad){return{'model':db[_0x3e9bad[_0x779f('0x26')]],'as':_0x3e9bad['as'],'attributes':_0x3e9bad[_0x779f('0x23')],'include':_0x3e9bad[_0x779f('0x25')]?_[_0x779f('0x27')](_0x3e9bad[_0x779f('0x25')],function(_0x2c6245){return{'model':db[_0x2c6245[_0x779f('0x26')]],'as':_0x2c6245['as'],'attributes':_0x2c6245[_0x779f('0x23')],'include':_0x2c6245[_0x779f('0x25')]?_[_0x779f('0x27')](_0x2c6245[_0x779f('0x25')],function(_0x30d25f){return{'model':db[_0x30d25f[_0x779f('0x26')]],'as':_0x30d25f['as'],'attributes':_0x30d25f['attributes']};}):[]};}):[]};}):[]:[]})[_0x779f('0x12')](function(_0x1d4884){logger['info']('ShowWhatsappQueue',_0x360b9e);logger[_0x779f('0x15')](_0x779f('0x28'),_0x360b9e,JSON[_0x779f('0x17')](_0x1d4884));_0x1503ee(_0x1d4884);})[_0x779f('0x1d')](function(_0x569a0c){logger[_0x779f('0x18')](_0x779f('0x28'),_0x569a0c[_0x779f('0x1b')],_0x360b9e);_0x331144(_0x3ffb38[_0x779f('0x18')](0x1f4,_0x569a0c[_0x779f('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 3044edf..803fa08 100644 --- a/server/api/whatsappQueue/whatsappQueue.socket.js +++ b/server/api/whatsappQueue/whatsappQueue.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2182=['remove','update','emit','register','length','save'];(function(_0x4c4180,_0x4e1bca){var _0x391ee8=function(_0x5277a4){while(--_0x5277a4){_0x4c4180['push'](_0x4c4180['shift']());}};_0x391ee8(++_0x4e1bca);}(_0x2182,0x167));var _0x2218=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x2182[_0x167cc1];return _0x10bc4b;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x2218('0x0'),_0x2218('0x1'),_0x2218('0x2')];function createListener(_0x479709,_0x29d103){return function(_0x33a885){_0x29d103[_0x2218('0x3')](_0x479709,_0x33a885);};}function removeListener(_0xa46ab8,_0x4babce){return function(){WhatsappQueueEvents['removeListener'](_0xa46ab8,_0x4babce);};}exports[_0x2218('0x4')]=function(_0x2f30f7){for(var _0x3445b6=0x0,_0x5ebece=events[_0x2218('0x5')];_0x3445b6<_0x5ebece;_0x3445b6++){var _0x241ce8=events[_0x3445b6];var _0x2888f9=createListener('whatsappQueue:'+_0x241ce8,_0x2f30f7);WhatsappQueueEvents['on'](_0x241ce8,_0x2888f9);}}; \ No newline at end of file +var _0xcd61=['whatsappQueue:','./whatsappQueue.events','save','remove','update','emit','length'];(function(_0x1ed388,_0x4c1474){var _0x356c7f=function(_0x19b7e1){while(--_0x19b7e1){_0x1ed388['push'](_0x1ed388['shift']());}};_0x356c7f(++_0x4c1474);}(_0xcd61,0x1ba));var _0x1cd6=function(_0x36e3fc,_0x419cf1){_0x36e3fc=_0x36e3fc-0x0;var _0xa429da=_0xcd61[_0x36e3fc];return _0xa429da;};'use strict';var WhatsappQueueEvents=require(_0x1cd6('0x0'));var events=[_0x1cd6('0x1'),_0x1cd6('0x2'),_0x1cd6('0x3')];function createListener(_0x21e343,_0x4226a5){return function(_0x4c0a18){_0x4226a5[_0x1cd6('0x4')](_0x21e343,_0x4c0a18);};}function removeListener(_0x4c274d,_0x91a0ba){return function(){WhatsappQueueEvents['removeListener'](_0x4c274d,_0x91a0ba);};}exports['register']=function(_0x505f41){for(var _0x32a9d8=0x0,_0x38ec19=events[_0x1cd6('0x5')];_0x32a9d8<_0x38ec19;_0x32a9d8++){var _0x40a986=events[_0x32a9d8];var _0x102dff=createListener(_0x1cd6('0x6')+_0x40a986,_0x505f41);WhatsappQueueEvents['on'](_0x40a986,_0x102dff);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 1d8c619..40ab015 100644 --- a/server/api/whatsappQueueReport/index.js +++ b/server/api/whatsappQueueReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0223=['fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','create','delete','destroy','exports','util','path','connect-timeout','Router'];(function(_0x3a186f,_0x1fd391){var _0xcd4e18=function(_0x1133b3){while(--_0x1133b3){_0x3a186f['push'](_0x3a186f['shift']());}};_0xcd4e18(++_0x1fd391);}(_0x0223,0x81));var _0x3022=function(_0x4fde83,_0x2d9011){_0x4fde83=_0x4fde83-0x0;var _0x3b33e3=_0x0223[_0x4fde83];return _0x3b33e3;};'use strict';var multer=require('multer');var util=require(_0x3022('0x0'));var path=require(_0x3022('0x1'));var timeout=require(_0x3022('0x2'));var express=require('express');var router=express[_0x3022('0x3')]();var fs_extra=require(_0x3022('0x4'));var auth=require(_0x3022('0x5'));var interaction=require(_0x3022('0x6'));var config=require('../../config/environment');var controller=require(_0x3022('0x7'));router['get']('/',auth[_0x3022('0x8')](),controller[_0x3022('0x9')]);router[_0x3022('0xa')](_0x3022('0xb'),auth[_0x3022('0x8')](),controller['describe']);router[_0x3022('0xa')](_0x3022('0xc'),auth[_0x3022('0x8')](),controller[_0x3022('0xd')]);router[_0x3022('0xe')]('/',auth[_0x3022('0x8')](),controller[_0x3022('0xf')]);router['put']('/:id',auth[_0x3022('0x8')](),controller['update']);router[_0x3022('0x10')](_0x3022('0xc'),auth[_0x3022('0x8')](),controller[_0x3022('0x11')]);module[_0x3022('0x12')]=router; \ No newline at end of file +var _0x2f18=['describe','/:id','isAuthenticated','show','post','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','./whatsappQueueReport.controller','get','index','/describe'];(function(_0x218739,_0x3ea56e){var _0x4bffd6=function(_0x2210bf){while(--_0x2210bf){_0x218739['push'](_0x218739['shift']());}};_0x4bffd6(++_0x3ea56e);}(_0x2f18,0xe0));var _0x82f1=function(_0x1f6ee8,_0x2a2662){_0x1f6ee8=_0x1f6ee8-0x0;var _0x4dcc0d=_0x2f18[_0x1f6ee8];return _0x4dcc0d;};'use strict';var multer=require(_0x82f1('0x0'));var util=require(_0x82f1('0x1'));var path=require('path');var timeout=require(_0x82f1('0x2'));var express=require(_0x82f1('0x3'));var router=express['Router']();var fs_extra=require(_0x82f1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x82f1('0x5'));var config=require('../../config/environment');var controller=require(_0x82f1('0x6'));router[_0x82f1('0x7')]('/',auth['isAuthenticated'](),controller[_0x82f1('0x8')]);router['get'](_0x82f1('0x9'),auth['isAuthenticated'](),controller[_0x82f1('0xa')]);router[_0x82f1('0x7')](_0x82f1('0xb'),auth[_0x82f1('0xc')](),controller[_0x82f1('0xd')]);router[_0x82f1('0xe')]('/',auth[_0x82f1('0xc')](),controller['create']);router['put'](_0x82f1('0xb'),auth[_0x82f1('0xc')](),controller[_0x82f1('0xf')]);router['delete'](_0x82f1('0xb'),auth[_0x82f1('0xc')](),controller[_0x82f1('0x10')]);module[_0x82f1('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 6d44b20..6d4dd61 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x4720dd,_0x396da7){var _0x19bf8b=function(_0x25a78e){while(--_0x25a78e){_0x4720dd['push'](_0x4720dd['shift']());}};_0x19bf8b(++_0x396da7);}(_0x7a54,0x106));var _0x47a5=function(_0x133e53,_0xf8eac2){_0x133e53=_0x133e53-0x0;var _0x5988c4=_0x7a54[_0x133e53];return _0x5988c4;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x5185a3,_0xb988f1){var _0x479429=function(_0x4080ef){while(--_0x4080ef){_0x5185a3['push'](_0x5185a3['shift']());}};_0x479429(++_0xb988f1);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 102d6e3..b8bd0ea 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2547=['order','where','pick','filter','merge','VIRTUAL','options','WhatsappQueueReport','includeAll','include','rows','catch','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2547,0x1cd));var _0x7254=function(_0x15fc43,_0x19a45){_0x15fc43=_0x15fc43-0x0;var _0x57318a=_0x2547[_0x15fc43];return _0x57318a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7254('0x0'));var zipdir=require(_0x7254('0x1'));var jsonpatch=require(_0x7254('0x2'));var rp=require(_0x7254('0x3'));var moment=require(_0x7254('0x4'));var BPromise=require(_0x7254('0x5'));var Mustache=require(_0x7254('0x6'));var util=require(_0x7254('0x7'));var path=require('path');var sox=require(_0x7254('0x8'));var csv=require(_0x7254('0x9'));var ejs=require(_0x7254('0xa'));var fs=require('fs');var fs_extra=require(_0x7254('0xb'));var _=require('lodash');var squel=require(_0x7254('0xc'));var crypto=require(_0x7254('0xd'));var jsforce=require(_0x7254('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7254('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7254('0xf'));var qs=require(_0x7254('0x10'));var as=require(_0x7254('0x11'));var hardwareService=require(_0x7254('0x12'));var logger=require(_0x7254('0x13'))(_0x7254('0x14'));var utils=require('../../config/utils');var config=require(_0x7254('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x7254('0x16'))['db'];function respondWithStatusCode(_0x53fc4f,_0x16c08e){_0x16c08e=_0x16c08e||0xcc;return function(_0x2bfff8){if(_0x2bfff8){return _0x53fc4f[_0x7254('0x17')](_0x16c08e);}return _0x53fc4f[_0x7254('0x18')](_0x16c08e)[_0x7254('0x19')]();};}function respondWithResult(_0x395a8a,_0x124192){_0x124192=_0x124192||0xc8;return function(_0x21cecc){if(_0x21cecc){return _0x395a8a[_0x7254('0x18')](_0x124192)[_0x7254('0x1a')](_0x21cecc);}};}function respondWithFilteredResult(_0x38a99c,_0x1ee5cb){return function(_0x163c8c){if(_0x163c8c){var _0x535065=typeof _0x1ee5cb[_0x7254('0x1b')]===_0x7254('0x1c')&&typeof _0x1ee5cb[_0x7254('0x1d')]===_0x7254('0x1c');var _0x3b5f06=_0x163c8c[_0x7254('0x1e')];var _0x2737e0=_0x535065?0x0:_0x1ee5cb['offset'];var _0x1f48f6=_0x535065?_0x163c8c[_0x7254('0x1e')]:_0x1ee5cb[_0x7254('0x1b')]+_0x1ee5cb[_0x7254('0x1d')];var _0x2a1ddc;if(_0x1f48f6>=_0x3b5f06){_0x1f48f6=_0x3b5f06;_0x2a1ddc=0xc8;}else{_0x2a1ddc=0xce;}_0x38a99c[_0x7254('0x18')](_0x2a1ddc);return _0x38a99c[_0x7254('0x1f')](_0x7254('0x20'),_0x2737e0+'-'+_0x1f48f6+'/'+_0x3b5f06)[_0x7254('0x1a')](_0x163c8c);}return null;};}function patchUpdates(_0x3b6cb6){return function(_0x2594b8){try{jsonpatch[_0x7254('0x21')](_0x2594b8,_0x3b6cb6,!![]);}catch(_0xc617b6){return BPromise[_0x7254('0x22')](_0xc617b6);}return _0x2594b8[_0x7254('0x23')]();};}function saveUpdates(_0x95ceaa,_0x2bb2fe){return function(_0x46c0a2){if(_0x46c0a2){return _0x46c0a2[_0x7254('0x24')](_0x95ceaa)[_0x7254('0x25')](function(_0x1be69b){return _0x1be69b;});}return null;};}function removeEntity(_0x50c34b,_0x493bfd){return function(_0x136ea3){if(_0x136ea3){return _0x136ea3[_0x7254('0x26')]()[_0x7254('0x25')](function(){_0x50c34b[_0x7254('0x18')](0xcc)[_0x7254('0x19')]();});}};}function handleEntityNotFound(_0x36b5d5,_0x133aee){return function(_0x5d6df5){if(!_0x5d6df5){_0x36b5d5[_0x7254('0x17')](0x194);}return _0x5d6df5;};}function handleError(_0x21a579,_0x2b4f46){_0x2b4f46=_0x2b4f46||0x1f4;return function(_0x494cdb){logger[_0x7254('0x27')](_0x494cdb['stack']);if(_0x494cdb[_0x7254('0x28')]){delete _0x494cdb[_0x7254('0x28')];}_0x21a579['status'](_0x2b4f46)[_0x7254('0x29')](_0x494cdb);};}exports[_0x7254('0x2a')]=function(_0x4f684c,_0x14cbea){var _0x6c4927={},_0x37cb5c={},_0xb9198b={'count':0x0,'rows':[]};var _0x43bf02=_[_0x7254('0x2b')](db['WhatsappQueueReport'][_0x7254('0x2c')],function(_0x2dba3f){return{'name':_0x2dba3f['fieldName'],'type':_0x2dba3f[_0x7254('0x2d')][_0x7254('0x2e')]};});_0x37cb5c[_0x7254('0x2f')]=_['map'](_0x43bf02,_0x7254('0x28'));_0x37cb5c[_0x7254('0x30')]=_[_0x7254('0x31')](_0x4f684c[_0x7254('0x30')]);_0x37cb5c[_0x7254('0x32')]=_[_0x7254('0x33')](_0x37cb5c[_0x7254('0x2f')],_0x37cb5c['query']);_0x6c4927[_0x7254('0x34')]=_['intersection'](_0x37cb5c['model'],qs[_0x7254('0x35')](_0x4f684c[_0x7254('0x30')][_0x7254('0x35')]));_0x6c4927[_0x7254('0x34')]=_0x6c4927[_0x7254('0x34')][_0x7254('0x36')]?_0x6c4927[_0x7254('0x34')]:_0x37cb5c[_0x7254('0x2f')];if(!_0x4f684c[_0x7254('0x30')][_0x7254('0x37')](_0x7254('0x38'))){_0x6c4927[_0x7254('0x1d')]=qs[_0x7254('0x1d')](_0x4f684c[_0x7254('0x30')]['limit']);_0x6c4927[_0x7254('0x1b')]=qs[_0x7254('0x1b')](_0x4f684c[_0x7254('0x30')][_0x7254('0x1b')]);}_0x6c4927[_0x7254('0x39')]=qs['sort'](_0x4f684c[_0x7254('0x30')]['sort']);_0x6c4927[_0x7254('0x3a')]=qs[_0x7254('0x32')](_[_0x7254('0x3b')](_0x4f684c[_0x7254('0x30')],_0x37cb5c[_0x7254('0x32')]),_0x43bf02);if(_0x4f684c['query'][_0x7254('0x3c')]){_0x6c4927['where']=_[_0x7254('0x3d')](_0x6c4927[_0x7254('0x3a')],{'$or':_['map'](_0x43bf02,function(_0x1485a0){if(_0x1485a0[_0x7254('0x2d')]!==_0x7254('0x3e')){var _0x9273ee={};_0x9273ee[_0x1485a0[_0x7254('0x28')]]={'$like':'%'+_0x4f684c[_0x7254('0x30')]['filter']+'%'};return _0x9273ee;}})});}_0x6c4927=_[_0x7254('0x3d')]({},_0x6c4927,_0x4f684c[_0x7254('0x3f')]);var _0x105b8c={'where':_0x6c4927['where']};return db[_0x7254('0x40')][_0x7254('0x1e')](_0x105b8c)[_0x7254('0x25')](function(_0x4824d5){_0xb9198b[_0x7254('0x1e')]=_0x4824d5;if(_0x4f684c[_0x7254('0x30')][_0x7254('0x41')]){_0x6c4927[_0x7254('0x42')]=[{'all':!![]}];}return db[_0x7254('0x40')]['findAll'](_0x6c4927);})['then'](function(_0x25004f){_0xb9198b[_0x7254('0x43')]=_0x25004f;return _0xb9198b;})[_0x7254('0x25')](respondWithFilteredResult(_0x14cbea,_0x6c4927))[_0x7254('0x44')](handleError(_0x14cbea,null));};exports['show']=function(_0x53a7a7,_0x29821a){var _0x565cd8={'raw':!![],'where':{'id':_0x53a7a7[_0x7254('0x45')]['id']}},_0x2ae22e={};_0x2ae22e[_0x7254('0x2f')]=_[_0x7254('0x31')](db['WhatsappQueueReport']['rawAttributes']);_0x2ae22e[_0x7254('0x30')]=_[_0x7254('0x31')](_0x53a7a7[_0x7254('0x30')]);_0x2ae22e[_0x7254('0x32')]=_[_0x7254('0x33')](_0x2ae22e['model'],_0x2ae22e['query']);_0x565cd8[_0x7254('0x34')]=_[_0x7254('0x33')](_0x2ae22e[_0x7254('0x2f')],qs['fields'](_0x53a7a7[_0x7254('0x30')][_0x7254('0x35')]));_0x565cd8['attributes']=_0x565cd8[_0x7254('0x34')][_0x7254('0x36')]?_0x565cd8[_0x7254('0x34')]:_0x2ae22e[_0x7254('0x2f')];if(_0x53a7a7['query'][_0x7254('0x41')]){_0x565cd8[_0x7254('0x42')]=[{'all':!![]}];}_0x565cd8=_['merge']({},_0x565cd8,_0x53a7a7[_0x7254('0x3f')]);return db[_0x7254('0x40')][_0x7254('0x46')](_0x565cd8)['then'](handleEntityNotFound(_0x29821a,null))[_0x7254('0x25')](respondWithResult(_0x29821a,null))[_0x7254('0x44')](handleError(_0x29821a,null));};exports['create']=function(_0x5f101e,_0x10b32f){return db['WhatsappQueueReport'][_0x7254('0x47')](_0x5f101e[_0x7254('0x48')],{})['then'](respondWithResult(_0x10b32f,0xc9))['catch'](handleError(_0x10b32f,null));};exports[_0x7254('0x24')]=function(_0xc40bc5,_0x38bcd5){if(_0xc40bc5[_0x7254('0x48')]['id']){delete _0xc40bc5[_0x7254('0x48')]['id'];}return db[_0x7254('0x40')]['find']({'where':{'id':_0xc40bc5[_0x7254('0x45')]['id']}})['then'](handleEntityNotFound(_0x38bcd5,null))[_0x7254('0x25')](saveUpdates(_0xc40bc5[_0x7254('0x48')],null))[_0x7254('0x25')](respondWithResult(_0x38bcd5,null))['catch'](handleError(_0x38bcd5,null));};exports[_0x7254('0x26')]=function(_0x1c1a0e,_0x252758){return db['WhatsappQueueReport'][_0x7254('0x46')]({'where':{'id':_0x1c1a0e[_0x7254('0x45')]['id']}})[_0x7254('0x25')](handleEntityNotFound(_0x252758,null))[_0x7254('0x25')](removeEntity(_0x252758,null))[_0x7254('0x44')](handleError(_0x252758,null));};exports['describe']=function(_0x5e66c6,_0x24c532){return db[_0x7254('0x40')][_0x7254('0x49')]()[_0x7254('0x25')](respondWithResult(_0x24c532,null))[_0x7254('0x44')](handleError(_0x24c532,null));}; \ No newline at end of file +var _0x3f8c=['end','json','offset','limit','count','Content-Range','reject','save','update','then','error','stack','name','send','index','WhatsappQueueReport','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','create','body','find','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status'];(function(_0x54203e,_0x1db8db){var _0xe307cf=function(_0x933016){while(--_0x933016){_0x54203e['push'](_0x54203e['shift']());}};_0xe307cf(++_0x1db8db);}(_0x3f8c,0x104));var _0xc3f8=function(_0x4c02fd,_0x152531){_0x4c02fd=_0x4c02fd-0x0;var _0x3fbcff=_0x3f8c[_0x4c02fd];return _0x3fbcff;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc3f8('0x0'));var jsonpatch=require(_0xc3f8('0x1'));var rp=require(_0xc3f8('0x2'));var moment=require(_0xc3f8('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc3f8('0x4'));var ejs=require(_0xc3f8('0x5'));var fs=require('fs');var fs_extra=require(_0xc3f8('0x6'));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('0x4'));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 as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc3f8('0x10'));var logger=require(_0xc3f8('0x11'))(_0xc3f8('0x12'));var utils=require(_0xc3f8('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc3f8('0x14'));var db=require(_0xc3f8('0x15'))['db'];function respondWithStatusCode(_0x256e3d,_0x155c80){_0x155c80=_0x155c80||0xcc;return function(_0x511763){if(_0x511763){return _0x256e3d[_0xc3f8('0x16')](_0x155c80);}return _0x256e3d[_0xc3f8('0x17')](_0x155c80)[_0xc3f8('0x18')]();};}function respondWithResult(_0x44632a,_0x6155e9){_0x6155e9=_0x6155e9||0xc8;return function(_0x47754c){if(_0x47754c){return _0x44632a[_0xc3f8('0x17')](_0x6155e9)[_0xc3f8('0x19')](_0x47754c);}};}function respondWithFilteredResult(_0x12b141,_0x2fd8e8){return function(_0x3cb28a){if(_0x3cb28a){var _0x2a9f64=typeof _0x2fd8e8[_0xc3f8('0x1a')]==='undefined'&&typeof _0x2fd8e8[_0xc3f8('0x1b')]==='undefined';var _0x51807b=_0x3cb28a[_0xc3f8('0x1c')];var _0x2e7c0f=_0x2a9f64?0x0:_0x2fd8e8[_0xc3f8('0x1a')];var _0xb4ab67=_0x2a9f64?_0x3cb28a['count']:_0x2fd8e8[_0xc3f8('0x1a')]+_0x2fd8e8[_0xc3f8('0x1b')];var _0x5df6f9;if(_0xb4ab67>=_0x51807b){_0xb4ab67=_0x51807b;_0x5df6f9=0xc8;}else{_0x5df6f9=0xce;}_0x12b141[_0xc3f8('0x17')](_0x5df6f9);return _0x12b141['set'](_0xc3f8('0x1d'),_0x2e7c0f+'-'+_0xb4ab67+'/'+_0x51807b)[_0xc3f8('0x19')](_0x3cb28a);}return null;};}function patchUpdates(_0x3b2e98){return function(_0x53ada5){try{jsonpatch['apply'](_0x53ada5,_0x3b2e98,!![]);}catch(_0x113cd2){return BPromise[_0xc3f8('0x1e')](_0x113cd2);}return _0x53ada5[_0xc3f8('0x1f')]();};}function saveUpdates(_0x25a4c7,_0x6522e9){return function(_0x251bf7){if(_0x251bf7){return _0x251bf7[_0xc3f8('0x20')](_0x25a4c7)[_0xc3f8('0x21')](function(_0x49aeea){return _0x49aeea;});}return null;};}function removeEntity(_0x571f92,_0x4b83f0){return function(_0x2559a4){if(_0x2559a4){return _0x2559a4['destroy']()[_0xc3f8('0x21')](function(){_0x571f92[_0xc3f8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4569c2,_0x327b2d){return function(_0x2d237e){if(!_0x2d237e){_0x4569c2[_0xc3f8('0x16')](0x194);}return _0x2d237e;};}function handleError(_0x25088f,_0x9d43b4){_0x9d43b4=_0x9d43b4||0x1f4;return function(_0xf1d460){logger[_0xc3f8('0x22')](_0xf1d460[_0xc3f8('0x23')]);if(_0xf1d460[_0xc3f8('0x24')]){delete _0xf1d460[_0xc3f8('0x24')];}_0x25088f[_0xc3f8('0x17')](_0x9d43b4)[_0xc3f8('0x25')](_0xf1d460);};}exports[_0xc3f8('0x26')]=function(_0x59e4dd,_0x58b303){var _0x2909f8={},_0x218029={},_0x5bf6e2={'count':0x0,'rows':[]};var _0x151bba=_['map'](db[_0xc3f8('0x27')][_0xc3f8('0x28')],function(_0x47ab53){return{'name':_0x47ab53['fieldName'],'type':_0x47ab53[_0xc3f8('0x29')][_0xc3f8('0x2a')]};});_0x218029[_0xc3f8('0x2b')]=_[_0xc3f8('0x2c')](_0x151bba,_0xc3f8('0x24'));_0x218029[_0xc3f8('0x2d')]=_[_0xc3f8('0x2e')](_0x59e4dd[_0xc3f8('0x2d')]);_0x218029[_0xc3f8('0x2f')]=_[_0xc3f8('0x30')](_0x218029['model'],_0x218029[_0xc3f8('0x2d')]);_0x2909f8[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](_0x218029[_0xc3f8('0x2b')],qs[_0xc3f8('0x32')](_0x59e4dd['query']['fields']));_0x2909f8[_0xc3f8('0x31')]=_0x2909f8[_0xc3f8('0x31')][_0xc3f8('0x33')]?_0x2909f8[_0xc3f8('0x31')]:_0x218029[_0xc3f8('0x2b')];if(!_0x59e4dd['query'][_0xc3f8('0x34')](_0xc3f8('0x35'))){_0x2909f8[_0xc3f8('0x1b')]=qs['limit'](_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x1b')]);_0x2909f8[_0xc3f8('0x1a')]=qs['offset'](_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x1a')]);}_0x2909f8['order']=qs[_0xc3f8('0x36')](_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x36')]);_0x2909f8[_0xc3f8('0x37')]=qs[_0xc3f8('0x2f')](_[_0xc3f8('0x38')](_0x59e4dd['query'],_0x218029[_0xc3f8('0x2f')]),_0x151bba);if(_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x39')]){_0x2909f8[_0xc3f8('0x37')]=_[_0xc3f8('0x3a')](_0x2909f8['where'],{'$or':_[_0xc3f8('0x2c')](_0x151bba,function(_0x4451a2){if(_0x4451a2[_0xc3f8('0x29')]!=='VIRTUAL'){var _0x316643={};_0x316643[_0x4451a2[_0xc3f8('0x24')]]={'$like':'%'+_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x39')]+'%'};return _0x316643;}})});}_0x2909f8=_['merge']({},_0x2909f8,_0x59e4dd[_0xc3f8('0x3b')]);var _0x45d416={'where':_0x2909f8[_0xc3f8('0x37')]};return db[_0xc3f8('0x27')]['count'](_0x45d416)[_0xc3f8('0x21')](function(_0x5db44d){_0x5bf6e2['count']=_0x5db44d;if(_0x59e4dd[_0xc3f8('0x2d')][_0xc3f8('0x3c')]){_0x2909f8[_0xc3f8('0x3d')]=[{'all':!![]}];}return db[_0xc3f8('0x27')]['findAll'](_0x2909f8);})['then'](function(_0x361a85){_0x5bf6e2[_0xc3f8('0x3e')]=_0x361a85;return _0x5bf6e2;})[_0xc3f8('0x21')](respondWithFilteredResult(_0x58b303,_0x2909f8))[_0xc3f8('0x3f')](handleError(_0x58b303,null));};exports[_0xc3f8('0x40')]=function(_0x465547,_0x3113b4){var _0x45e6ea={'raw':!![],'where':{'id':_0x465547[_0xc3f8('0x41')]['id']}},_0x13d8dc={};_0x13d8dc[_0xc3f8('0x2b')]=_['keys'](db[_0xc3f8('0x27')][_0xc3f8('0x28')]);_0x13d8dc['query']=_[_0xc3f8('0x2e')](_0x465547[_0xc3f8('0x2d')]);_0x13d8dc['filters']=_[_0xc3f8('0x30')](_0x13d8dc[_0xc3f8('0x2b')],_0x13d8dc[_0xc3f8('0x2d')]);_0x45e6ea[_0xc3f8('0x31')]=_[_0xc3f8('0x30')](_0x13d8dc[_0xc3f8('0x2b')],qs[_0xc3f8('0x32')](_0x465547[_0xc3f8('0x2d')][_0xc3f8('0x32')]));_0x45e6ea[_0xc3f8('0x31')]=_0x45e6ea[_0xc3f8('0x31')]['length']?_0x45e6ea[_0xc3f8('0x31')]:_0x13d8dc[_0xc3f8('0x2b')];if(_0x465547['query'][_0xc3f8('0x3c')]){_0x45e6ea[_0xc3f8('0x3d')]=[{'all':!![]}];}_0x45e6ea=_[_0xc3f8('0x3a')]({},_0x45e6ea,_0x465547[_0xc3f8('0x3b')]);return db['WhatsappQueueReport']['find'](_0x45e6ea)[_0xc3f8('0x21')](handleEntityNotFound(_0x3113b4,null))[_0xc3f8('0x21')](respondWithResult(_0x3113b4,null))[_0xc3f8('0x3f')](handleError(_0x3113b4,null));};exports['create']=function(_0x1b5777,_0x3a665e){return db[_0xc3f8('0x27')][_0xc3f8('0x42')](_0x1b5777[_0xc3f8('0x43')],{})['then'](respondWithResult(_0x3a665e,0xc9))[_0xc3f8('0x3f')](handleError(_0x3a665e,null));};exports[_0xc3f8('0x20')]=function(_0x5961ab,_0x1becae){if(_0x5961ab[_0xc3f8('0x43')]['id']){delete _0x5961ab[_0xc3f8('0x43')]['id'];}return db[_0xc3f8('0x27')][_0xc3f8('0x44')]({'where':{'id':_0x5961ab[_0xc3f8('0x41')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x1becae,null))['then'](saveUpdates(_0x5961ab[_0xc3f8('0x43')],null))[_0xc3f8('0x21')](respondWithResult(_0x1becae,null))['catch'](handleError(_0x1becae,null));};exports[_0xc3f8('0x45')]=function(_0x2e9f93,_0x2448bf){return db[_0xc3f8('0x27')][_0xc3f8('0x44')]({'where':{'id':_0x2e9f93[_0xc3f8('0x41')]['id']}})[_0xc3f8('0x21')](handleEntityNotFound(_0x2448bf,null))['then'](removeEntity(_0x2448bf,null))[_0xc3f8('0x3f')](handleError(_0x2448bf,null));};exports[_0xc3f8('0x46')]=function(_0x425fee,_0x267c95){return db[_0xc3f8('0x27')][_0xc3f8('0x46')]()[_0xc3f8('0x21')](respondWithResult(_0x267c95,null))[_0xc3f8('0x3f')](handleError(_0x267c95,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index 309e3a9..63ac9f7 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.model.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd179=['lodash','util','api','bluebird','request-promise','path','../../config/environment','exports','define','report_whatsapp_queue','uniqueid'];(function(_0x5c1329,_0x44d752){var _0x282631=function(_0x92755d){while(--_0x92755d){_0x5c1329['push'](_0x5c1329['shift']());}};_0x282631(++_0x44d752);}(_0xd179,0x8f));var _0x9d17=function(_0x34843e,_0x4c4224){_0x34843e=_0x34843e-0x0;var _0x598f7f=_0xd179[_0x34843e];return _0x598f7f;};'use strict';var _=require(_0x9d17('0x0'));var util=require(_0x9d17('0x1'));var logger=require('../../config/logger')(_0x9d17('0x2'));var moment=require('moment');var BPromise=require(_0x9d17('0x3'));var rp=require(_0x9d17('0x4'));var fs=require('fs');var path=require(_0x9d17('0x5'));var rimraf=require('rimraf');var config=require(_0x9d17('0x6'));var attributes=require('./whatsappQueueReport.attributes');module[_0x9d17('0x7')]=function(_0x15ee64,_0x432b0b){return _0x15ee64[_0x9d17('0x8')]('WhatsappQueueReport',attributes,{'tableName':_0x9d17('0x9'),'paranoid':![],'indexes':[{'name':_0x9d17('0xa'),'fields':[_0x9d17('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4781=['uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappQueueReport.attributes','exports','define'];(function(_0x3f823d,_0x3896b0){var _0x5bbef9=function(_0x3b11dd){while(--_0x3b11dd){_0x3f823d['push'](_0x3f823d['shift']());}};_0x5bbef9(++_0x3896b0);}(_0x4781,0x76));var _0x1478=function(_0x272e07,_0x575bd2){_0x272e07=_0x272e07-0x0;var _0x4b19de=_0x4781[_0x272e07];return _0x4b19de;};'use strict';var _=require(_0x1478('0x0'));var util=require('util');var logger=require(_0x1478('0x1'))(_0x1478('0x2'));var moment=require(_0x1478('0x3'));var BPromise=require(_0x1478('0x4'));var rp=require(_0x1478('0x5'));var fs=require('fs');var path=require(_0x1478('0x6'));var rimraf=require(_0x1478('0x7'));var config=require(_0x1478('0x8'));var attributes=require(_0x1478('0x9'));module[_0x1478('0xa')]=function(_0x11da3c,_0x25f42b){return _0x11da3c[_0x1478('0xb')]('WhatsappQueueReport',attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0x1478('0xc'),'fields':[_0x1478('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 791237e..25162b7 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x63d9=['update','raw','where','limit','UpdateWhatsappQueueReport','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','WhatsappQueueReport,\x20%s,\x20%s','result','CreateWhatsappQueueReport','create','body','options','WhatsappQueueReport'];(function(_0x3e5147,_0x33eef9){var _0x18c779=function(_0x2a143c){while(--_0x2a143c){_0x3e5147['push'](_0x3e5147['shift']());}};_0x18c779(++_0x33eef9);}(_0x63d9,0x19e));var _0x963d=function(_0x305e72,_0x1f2c2a){_0x305e72=_0x305e72-0x0;var _0x18dcf9=_0x63d9[_0x305e72];return _0x18dcf9;};'use strict';var _=require(_0x963d('0x0'));var util=require('util');var moment=require(_0x963d('0x1'));var BPromise=require(_0x963d('0x2'));var rs=require(_0x963d('0x3'));var fs=require('fs');var Redis=require(_0x963d('0x4'));var db=require(_0x963d('0x5'))['db'];var utils=require(_0x963d('0x6'));var logger=require(_0x963d('0x7'))(_0x963d('0x8'));var config=require(_0x963d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x963d('0xa')][_0x963d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x273297,_0x375c4c,_0x12a1bf){return new BPromise(function(_0x5efe74,_0x59b448){return client['request'](_0x273297,_0x12a1bf)[_0x963d('0xc')](function(_0x54bfbd){logger[_0x963d('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x375c4c,_0x963d('0xe'));logger[_0x963d('0xf')](_0x963d('0x10'),_0x375c4c,'request\x20sent',JSON[_0x963d('0x11')](_0x54bfbd));if(_0x54bfbd[_0x963d('0x12')]){if(_0x54bfbd[_0x963d('0x12')][_0x963d('0x13')]===0x1f4){logger[_0x963d('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x375c4c,_0x54bfbd[_0x963d('0x12')][_0x963d('0x14')]);return _0x59b448(_0x54bfbd['error'][_0x963d('0x14')]);}logger[_0x963d('0x12')](_0x963d('0x15'),_0x375c4c,_0x54bfbd[_0x963d('0x12')][_0x963d('0x14')]);return _0x5efe74(_0x54bfbd[_0x963d('0x12')][_0x963d('0x14')]);}else{logger[_0x963d('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x375c4c,_0x963d('0xe'));_0x5efe74(_0x54bfbd[_0x963d('0x16')][_0x963d('0x14')]);}})['catch'](function(_0x36339c){logger[_0x963d('0x12')]('WhatsappQueueReport,\x20%s,\x20%s',_0x375c4c,_0x36339c);_0x59b448(_0x36339c);});});}exports[_0x963d('0x17')]=function(_0x4e0278){var _0x5b522c=this;return new Promise(function(_0x532ab6,_0x5683f4){return db['WhatsappQueueReport'][_0x963d('0x18')](_0x4e0278[_0x963d('0x19')],{'raw':_0x4e0278[_0x963d('0x1a')]?_0x4e0278[_0x963d('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x963d('0xc')](function(_0x32d870){logger['info'](_0x963d('0x17'),_0x4e0278);logger[_0x963d('0xf')](_0x963d('0x17'),_0x4e0278,JSON[_0x963d('0x11')](_0x32d870));_0x532ab6(_0x32d870);})['catch'](function(_0x91cd4e){logger[_0x963d('0x12')]('CreateWhatsappQueueReport',_0x91cd4e[_0x963d('0x14')],_0x4e0278);_0x5683f4(_0x5b522c['error'](0x1f4,_0x91cd4e[_0x963d('0x14')]));});});};exports['UpdateWhatsappQueueReport']=function(_0x3503b7){var _0x232c8a=this;return new Promise(function(_0xce2d21,_0x3cc319){return db[_0x963d('0x1b')][_0x963d('0x1c')](_0x3503b7[_0x963d('0x19')],{'raw':_0x3503b7[_0x963d('0x1a')]?_0x3503b7[_0x963d('0x1a')][_0x963d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3503b7[_0x963d('0x1a')]?_0x3503b7[_0x963d('0x1a')][_0x963d('0x1e')]||null:null,'attributes':_0x3503b7[_0x963d('0x1a')]?_0x3503b7[_0x963d('0x1a')]['attributes']||null:null,'limit':_0x3503b7[_0x963d('0x1a')]?_0x3503b7[_0x963d('0x1a')][_0x963d('0x1f')]||null:null})[_0x963d('0xc')](function(_0x532153){logger[_0x963d('0xd')](_0x963d('0x20'),_0x3503b7);logger[_0x963d('0xf')](_0x963d('0x20'),_0x3503b7,JSON[_0x963d('0x11')](_0x532153));_0xce2d21(_0x532153);})[_0x963d('0x21')](function(_0x5c4c5c){logger['error'](_0x963d('0x20'),_0x5c4c5c[_0x963d('0x14')],_0x3503b7);_0x3cc319(_0x232c8a[_0x963d('0x12')](0x1f4,_0x5c4c5c[_0x963d('0x14')]));});});}; \ No newline at end of file +var _0xd206=['../../config/utils','../../config/environment','jayson/promise','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','options','UpdateWhatsappQueueReport','body','raw','where','attributes','lodash','randomstring','ioredis'];(function(_0x567e9e,_0x53a545){var _0xf8e116=function(_0x1f7352){while(--_0x1f7352){_0x567e9e['push'](_0x567e9e['shift']());}};_0xf8e116(++_0x53a545);}(_0xd206,0x89));var _0x6d20=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xd206[_0x2080a3];return _0x8d7d17;};'use strict';var _=require(_0x6d20('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6d20('0x1'));var fs=require('fs');var Redis=require(_0x6d20('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d20('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x6d20('0x4'));var jayson=require(_0x6d20('0x5'));var client=jayson['client'][_0x6d20('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x1c50e2,_0x43bf60,_0x1969a1){return new BPromise(function(_0x331f24,_0x9ecd59){return client[_0x6d20('0x7')](_0x1c50e2,_0x1969a1)[_0x6d20('0x8')](function(_0x3c8d42){logger[_0x6d20('0x9')](_0x6d20('0xa'),_0x43bf60,_0x6d20('0xb'));logger[_0x6d20('0xc')](_0x6d20('0xd'),_0x43bf60,'request\x20sent',JSON[_0x6d20('0xe')](_0x3c8d42));if(_0x3c8d42['error']){if(_0x3c8d42[_0x6d20('0xf')]['code']===0x1f4){logger[_0x6d20('0xf')](_0x6d20('0xa'),_0x43bf60,_0x3c8d42[_0x6d20('0xf')][_0x6d20('0x10')]);return _0x9ecd59(_0x3c8d42[_0x6d20('0xf')][_0x6d20('0x10')]);}logger['error'](_0x6d20('0xa'),_0x43bf60,_0x3c8d42[_0x6d20('0xf')][_0x6d20('0x10')]);return _0x331f24(_0x3c8d42['error'][_0x6d20('0x10')]);}else{logger['info'](_0x6d20('0xa'),_0x43bf60,_0x6d20('0xb'));_0x331f24(_0x3c8d42[_0x6d20('0x11')][_0x6d20('0x10')]);}})[_0x6d20('0x12')](function(_0x2acb7b){logger[_0x6d20('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x43bf60,_0x2acb7b);_0x9ecd59(_0x2acb7b);});});}exports[_0x6d20('0x13')]=function(_0x4e83a1){var _0x48f2dc=this;return new Promise(function(_0x3dc1cc,_0x2a3fde){return db[_0x6d20('0x14')][_0x6d20('0x15')](_0x4e83a1['body'],{'raw':_0x4e83a1['options']?_0x4e83a1[_0x6d20('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x6d20('0x8')](function(_0x45cb18){logger[_0x6d20('0x9')](_0x6d20('0x13'),_0x4e83a1);logger[_0x6d20('0xc')](_0x6d20('0x13'),_0x4e83a1,JSON[_0x6d20('0xe')](_0x45cb18));_0x3dc1cc(_0x45cb18);})['catch'](function(_0x5164a1){logger[_0x6d20('0xf')](_0x6d20('0x13'),_0x5164a1[_0x6d20('0x10')],_0x4e83a1);_0x2a3fde(_0x48f2dc[_0x6d20('0xf')](0x1f4,_0x5164a1['message']));});});};exports[_0x6d20('0x17')]=function(_0x103aa7){var _0x24041c=this;return new Promise(function(_0x85c93f,_0x36ac35){return db[_0x6d20('0x14')]['update'](_0x103aa7[_0x6d20('0x18')],{'raw':_0x103aa7[_0x6d20('0x16')]?_0x103aa7[_0x6d20('0x16')][_0x6d20('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x103aa7[_0x6d20('0x16')]?_0x103aa7['options'][_0x6d20('0x1a')]||null:null,'attributes':_0x103aa7[_0x6d20('0x16')]?_0x103aa7[_0x6d20('0x16')][_0x6d20('0x1b')]||null:null,'limit':_0x103aa7[_0x6d20('0x16')]?_0x103aa7['options']['limit']||null:null})[_0x6d20('0x8')](function(_0x3588b7){logger['info'](_0x6d20('0x17'),_0x103aa7);logger[_0x6d20('0xc')](_0x6d20('0x17'),_0x103aa7,JSON[_0x6d20('0xe')](_0x3588b7));_0x85c93f(_0x3588b7);})[_0x6d20('0x12')](function(_0x53fa7f){logger[_0x6d20('0xf')](_0x6d20('0x17'),_0x53fa7f[_0x6d20('0x10')],_0x103aa7);_0x36ac35(_0x24041c[_0x6d20('0xf')](0x1f4,_0x53fa7f[_0x6d20('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 1df67c5..76c4ce0 100644 --- a/server/api/whatsappTransferReport/index.js +++ b/server/api/whatsappTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2c72=['/:id','show','put','update','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x28db55,_0x498814){var _0x12e1d6=function(_0x572bb1){while(--_0x572bb1){_0x28db55['push'](_0x28db55['shift']());}};_0x12e1d6(++_0x498814);}(_0x2c72,0x132));var _0x22c7=function(_0x52a6f1,_0x5e3372){_0x52a6f1=_0x52a6f1-0x0;var _0xacda44=_0x2c72[_0x52a6f1];return _0xacda44;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x22c7('0x0'));var timeout=require(_0x22c7('0x1'));var express=require(_0x22c7('0x2'));var router=express[_0x22c7('0x3')]();var fs_extra=require(_0x22c7('0x4'));var auth=require(_0x22c7('0x5'));var interaction=require(_0x22c7('0x6'));var config=require(_0x22c7('0x7'));var controller=require(_0x22c7('0x8'));router[_0x22c7('0x9')]('/',auth[_0x22c7('0xa')](),controller[_0x22c7('0xb')]);router[_0x22c7('0x9')](_0x22c7('0xc'),auth[_0x22c7('0xa')](),controller[_0x22c7('0xd')]);router[_0x22c7('0x9')](_0x22c7('0xe'),auth[_0x22c7('0xa')](),controller[_0x22c7('0xf')]);router['post']('/',auth[_0x22c7('0xa')](),controller['create']);router[_0x22c7('0x10')]('/:id',auth[_0x22c7('0xa')](),controller[_0x22c7('0x11')]);router[_0x22c7('0x12')](_0x22c7('0xe'),auth[_0x22c7('0xa')](),controller['destroy']);module[_0x22c7('0x13')]=router; \ No newline at end of file +var _0xd5e0=['isAuthenticated','index','get','post','create','put','update','delete','/:id','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappTransferReport.controller'];(function(_0x514f19,_0x5d9b97){var _0x3706e1=function(_0x2ed7a3){while(--_0x2ed7a3){_0x514f19['push'](_0x514f19['shift']());}};_0x3706e1(++_0x5d9b97);}(_0xd5e0,0x196));var _0x0d5e=function(_0x42e4a0,_0x683fdf){_0x42e4a0=_0x42e4a0-0x0;var _0x34ddb0=_0xd5e0[_0x42e4a0];return _0x34ddb0;};'use strict';var multer=require(_0x0d5e('0x0'));var util=require(_0x0d5e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0d5e('0x2'));var router=express[_0x0d5e('0x3')]();var fs_extra=require(_0x0d5e('0x4'));var auth=require(_0x0d5e('0x5'));var interaction=require(_0x0d5e('0x6'));var config=require('../../config/environment');var controller=require(_0x0d5e('0x7'));router['get']('/',auth[_0x0d5e('0x8')](),controller[_0x0d5e('0x9')]);router[_0x0d5e('0xa')]('/describe',auth[_0x0d5e('0x8')](),controller['describe']);router['get']('/:id',auth[_0x0d5e('0x8')](),controller['show']);router[_0x0d5e('0xb')]('/',auth[_0x0d5e('0x8')](),controller[_0x0d5e('0xc')]);router[_0x0d5e('0xd')]('/:id',auth[_0x0d5e('0x8')](),controller[_0x0d5e('0xe')]);router[_0x0d5e('0xf')](_0x0d5e('0x10'),auth['isAuthenticated'](),controller['destroy']);module[_0x0d5e('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 7668e66..654ce2c 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa866=['DATE','sequelize','exports','STRING','ENUM','account','queue'];(function(_0x4345be,_0x1e1dd6){var _0xf851a1=function(_0x2d5ec6){while(--_0x2d5ec6){_0x4345be['push'](_0x4345be['shift']());}};_0xf851a1(++_0x1e1dd6);}(_0xa866,0x6a));var _0x6a86=function(_0x3c5561,_0x29fde6){_0x3c5561=_0x3c5561-0x0;var _0x5b2af5=_0xa866[_0x3c5561];return _0x5b2af5;};'use strict';var Sequelize=require(_0x6a86('0x0'));module[_0x6a86('0x1')]={'uniqueid':{'type':Sequelize[_0x6a86('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x6a86('0x3')](_0x6a86('0x4'),'agent',_0x6a86('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x6a86('0x6')]}}; \ No newline at end of file +var _0x9672=['ENUM','account','agent','queue','sequelize','exports'];(function(_0x82232,_0x4e9ec5){var _0x34cf23=function(_0x2ad71b){while(--_0x2ad71b){_0x82232['push'](_0x82232['shift']());}};_0x34cf23(++_0x4e9ec5);}(_0x9672,0xee));var _0x2967=function(_0x2f1542,_0xd12798){_0x2f1542=_0x2f1542-0x0;var _0x20d0d9=_0x9672[_0x2f1542];return _0x20d0d9;};'use strict';var Sequelize=require(_0x2967('0x0'));module[_0x2967('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x2967('0x2')](_0x2967('0x3'),_0x2967('0x4'),_0x2967('0x5')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index cdec905..dd734f7 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64cd=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','intersection','length','find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','index','map','WhatsappTransferReport','rawAttributes','type','key','query','keys','filters','model','attributes','fields','nolimit','order','sort'];(function(_0x4ce637,_0x463346){var _0x2e9cba=function(_0x11f3d1){while(--_0x11f3d1){_0x4ce637['push'](_0x4ce637['shift']());}};_0x2e9cba(++_0x463346);}(_0x64cd,0x194));var _0xd64c=function(_0x48e86c,_0x9f034d){_0x48e86c=_0x48e86c-0x0;var _0x54fa11=_0x64cd[_0x48e86c];return _0x54fa11;};'use strict';var emlformat=require(_0xd64c('0x0'));var rimraf=require(_0xd64c('0x1'));var zipdir=require(_0xd64c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd64c('0x3'));var moment=require('moment');var BPromise=require(_0xd64c('0x4'));var Mustache=require(_0xd64c('0x5'));var util=require(_0xd64c('0x6'));var path=require(_0xd64c('0x7'));var sox=require(_0xd64c('0x8'));var csv=require('to-csv');var ejs=require(_0xd64c('0x9'));var fs=require('fs');var fs_extra=require(_0xd64c('0xa'));var _=require(_0xd64c('0xb'));var squel=require(_0xd64c('0xc'));var crypto=require('crypto');var jsforce=require(_0xd64c('0xd'));var deskjs=require(_0xd64c('0xe'));var toCsv=require('to-csv');var querystring=require(_0xd64c('0xf'));var Papa=require('papaparse');var Redis=require(_0xd64c('0x10'));var authService=require(_0xd64c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd64c('0x12'));var hardwareService=require(_0xd64c('0x13'));var logger=require(_0xd64c('0x14'))(_0xd64c('0x15'));var utils=require(_0xd64c('0x16'));var config=require(_0xd64c('0x17'));var licenseUtil=require(_0xd64c('0x18'));var db=require(_0xd64c('0x19'))['db'];function respondWithStatusCode(_0x319908,_0x103979){_0x103979=_0x103979||0xcc;return function(_0x48345e){if(_0x48345e){return _0x319908[_0xd64c('0x1a')](_0x103979);}return _0x319908['status'](_0x103979)[_0xd64c('0x1b')]();};}function respondWithResult(_0x3b14b0,_0x2dd345){_0x2dd345=_0x2dd345||0xc8;return function(_0x3dc136){if(_0x3dc136){return _0x3b14b0[_0xd64c('0x1c')](_0x2dd345)[_0xd64c('0x1d')](_0x3dc136);}};}function respondWithFilteredResult(_0x386c3d,_0x338f3e){return function(_0x5ee4f1){if(_0x5ee4f1){var _0x5a9ba2=typeof _0x338f3e[_0xd64c('0x1e')]===_0xd64c('0x1f')&&typeof _0x338f3e[_0xd64c('0x20')]===_0xd64c('0x1f');var _0x12a5d1=_0x5ee4f1[_0xd64c('0x21')];var _0x35b26c=_0x5a9ba2?0x0:_0x338f3e[_0xd64c('0x1e')];var _0x12d925=_0x5a9ba2?_0x5ee4f1[_0xd64c('0x21')]:_0x338f3e['offset']+_0x338f3e[_0xd64c('0x20')];var _0x444bb0;if(_0x12d925>=_0x12a5d1){_0x12d925=_0x12a5d1;_0x444bb0=0xc8;}else{_0x444bb0=0xce;}_0x386c3d['status'](_0x444bb0);return _0x386c3d[_0xd64c('0x22')](_0xd64c('0x23'),_0x35b26c+'-'+_0x12d925+'/'+_0x12a5d1)['json'](_0x5ee4f1);}return null;};}function patchUpdates(_0x333f0b){return function(_0x5c8274){try{jsonpatch[_0xd64c('0x24')](_0x5c8274,_0x333f0b,!![]);}catch(_0x27187b){return BPromise[_0xd64c('0x25')](_0x27187b);}return _0x5c8274['save']();};}function saveUpdates(_0x2a0e42,_0xbab4d9){return function(_0x2b9587){if(_0x2b9587){return _0x2b9587[_0xd64c('0x26')](_0x2a0e42)[_0xd64c('0x27')](function(_0x5873d4){return _0x5873d4;});}return null;};}function removeEntity(_0x4e491e,_0x203729){return function(_0x1d5c71){if(_0x1d5c71){return _0x1d5c71[_0xd64c('0x28')]()[_0xd64c('0x27')](function(){_0x4e491e[_0xd64c('0x1c')](0xcc)[_0xd64c('0x1b')]();});}};}function handleEntityNotFound(_0x24961a,_0x166385){return function(_0x3af946){if(!_0x3af946){_0x24961a['sendStatus'](0x194);}return _0x3af946;};}function handleError(_0x4e1d06,_0x5965ec){_0x5965ec=_0x5965ec||0x1f4;return function(_0x22bb01){logger[_0xd64c('0x29')](_0x22bb01['stack']);if(_0x22bb01[_0xd64c('0x2a')]){delete _0x22bb01[_0xd64c('0x2a')];}_0x4e1d06[_0xd64c('0x1c')](_0x5965ec)['send'](_0x22bb01);};}exports[_0xd64c('0x2b')]=function(_0x28f512,_0x291bc2){var _0x61b320={},_0x5b9340={},_0x21ba65={'count':0x0,'rows':[]};var _0x5adfea=_[_0xd64c('0x2c')](db[_0xd64c('0x2d')][_0xd64c('0x2e')],function(_0x13c820){return{'name':_0x13c820['fieldName'],'type':_0x13c820[_0xd64c('0x2f')][_0xd64c('0x30')]};});_0x5b9340['model']=_[_0xd64c('0x2c')](_0x5adfea,_0xd64c('0x2a'));_0x5b9340[_0xd64c('0x31')]=_[_0xd64c('0x32')](_0x28f512[_0xd64c('0x31')]);_0x5b9340[_0xd64c('0x33')]=_['intersection'](_0x5b9340[_0xd64c('0x34')],_0x5b9340[_0xd64c('0x31')]);_0x61b320[_0xd64c('0x35')]=_['intersection'](_0x5b9340[_0xd64c('0x34')],qs[_0xd64c('0x36')](_0x28f512[_0xd64c('0x31')][_0xd64c('0x36')]));_0x61b320['attributes']=_0x61b320[_0xd64c('0x35')]['length']?_0x61b320[_0xd64c('0x35')]:_0x5b9340[_0xd64c('0x34')];if(!_0x28f512['query']['hasOwnProperty'](_0xd64c('0x37'))){_0x61b320[_0xd64c('0x20')]=qs[_0xd64c('0x20')](_0x28f512[_0xd64c('0x31')][_0xd64c('0x20')]);_0x61b320['offset']=qs[_0xd64c('0x1e')](_0x28f512['query'][_0xd64c('0x1e')]);}_0x61b320[_0xd64c('0x38')]=qs[_0xd64c('0x39')](_0x28f512[_0xd64c('0x31')][_0xd64c('0x39')]);_0x61b320[_0xd64c('0x3a')]=qs[_0xd64c('0x33')](_[_0xd64c('0x3b')](_0x28f512[_0xd64c('0x31')],_0x5b9340['filters']),_0x5adfea);if(_0x28f512[_0xd64c('0x31')][_0xd64c('0x3c')]){_0x61b320[_0xd64c('0x3a')]=_[_0xd64c('0x3d')](_0x61b320[_0xd64c('0x3a')],{'$or':_['map'](_0x5adfea,function(_0x249f03){if(_0x249f03['type']!==_0xd64c('0x3e')){var _0x49e13e={};_0x49e13e[_0x249f03[_0xd64c('0x2a')]]={'$like':'%'+_0x28f512[_0xd64c('0x31')][_0xd64c('0x3c')]+'%'};return _0x49e13e;}})});}_0x61b320=_[_0xd64c('0x3d')]({},_0x61b320,_0x28f512[_0xd64c('0x3f')]);var _0x18a47f={'where':_0x61b320[_0xd64c('0x3a')]};return db[_0xd64c('0x2d')][_0xd64c('0x21')](_0x18a47f)['then'](function(_0xa961a6){_0x21ba65[_0xd64c('0x21')]=_0xa961a6;if(_0x28f512['query'][_0xd64c('0x40')]){_0x61b320[_0xd64c('0x41')]=[{'all':!![]}];}return db[_0xd64c('0x2d')][_0xd64c('0x42')](_0x61b320);})[_0xd64c('0x27')](function(_0x18f5f6){_0x21ba65[_0xd64c('0x43')]=_0x18f5f6;return _0x21ba65;})[_0xd64c('0x27')](respondWithFilteredResult(_0x291bc2,_0x61b320))[_0xd64c('0x44')](handleError(_0x291bc2,null));};exports[_0xd64c('0x45')]=function(_0x1584af,_0x56b1ab){var _0x523f6c={'raw':!![],'where':{'id':_0x1584af[_0xd64c('0x46')]['id']}},_0x207b9d={};_0x207b9d[_0xd64c('0x34')]=_[_0xd64c('0x32')](db['WhatsappTransferReport'][_0xd64c('0x2e')]);_0x207b9d['query']=_[_0xd64c('0x32')](_0x1584af[_0xd64c('0x31')]);_0x207b9d[_0xd64c('0x33')]=_[_0xd64c('0x47')](_0x207b9d[_0xd64c('0x34')],_0x207b9d['query']);_0x523f6c['attributes']=_[_0xd64c('0x47')](_0x207b9d[_0xd64c('0x34')],qs[_0xd64c('0x36')](_0x1584af[_0xd64c('0x31')][_0xd64c('0x36')]));_0x523f6c['attributes']=_0x523f6c[_0xd64c('0x35')][_0xd64c('0x48')]?_0x523f6c['attributes']:_0x207b9d[_0xd64c('0x34')];if(_0x1584af[_0xd64c('0x31')][_0xd64c('0x40')]){_0x523f6c[_0xd64c('0x41')]=[{'all':!![]}];}_0x523f6c=_['merge']({},_0x523f6c,_0x1584af[_0xd64c('0x3f')]);return db[_0xd64c('0x2d')][_0xd64c('0x49')](_0x523f6c)[_0xd64c('0x27')](handleEntityNotFound(_0x56b1ab,null))['then'](respondWithResult(_0x56b1ab,null))[_0xd64c('0x44')](handleError(_0x56b1ab,null));};exports[_0xd64c('0x4a')]=function(_0x965e2e,_0x40ac78){return db[_0xd64c('0x2d')][_0xd64c('0x4a')](_0x965e2e[_0xd64c('0x4b')],{})[_0xd64c('0x27')](respondWithResult(_0x40ac78,0xc9))[_0xd64c('0x44')](handleError(_0x40ac78,null));};exports[_0xd64c('0x26')]=function(_0x19c2ba,_0x1ae56f){if(_0x19c2ba[_0xd64c('0x4b')]['id']){delete _0x19c2ba['body']['id'];}return db[_0xd64c('0x2d')][_0xd64c('0x49')]({'where':{'id':_0x19c2ba[_0xd64c('0x46')]['id']}})[_0xd64c('0x27')](handleEntityNotFound(_0x1ae56f,null))[_0xd64c('0x27')](saveUpdates(_0x19c2ba[_0xd64c('0x4b')],null))[_0xd64c('0x27')](respondWithResult(_0x1ae56f,null))['catch'](handleError(_0x1ae56f,null));};exports[_0xd64c('0x28')]=function(_0x417701,_0x585c95){return db[_0xd64c('0x2d')]['find']({'where':{'id':_0x417701[_0xd64c('0x46')]['id']}})[_0xd64c('0x27')](handleEntityNotFound(_0x585c95,null))['then'](removeEntity(_0x585c95,null))[_0xd64c('0x44')](handleError(_0x585c95,null));};exports[_0xd64c('0x4c')]=function(_0x557d41,_0x2d7eb1){return db[_0xd64c('0x2d')][_0xd64c('0x4c')]()[_0xd64c('0x27')](respondWithResult(_0x2d7eb1,null))['catch'](handleError(_0x2d7eb1,null));}; \ No newline at end of file +var _0xb36f=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','update','then','destroy','error','stack','name','index','map','WhatsappTransferReport','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x2ccc71,_0x1c458a){var _0x20fa15=function(_0x320e61){while(--_0x320e61){_0x2ccc71['push'](_0x2ccc71['shift']());}};_0x20fa15(++_0x1c458a);}(_0xb36f,0x1d6));var _0xfb36=function(_0x437f52,_0x43b332){_0x437f52=_0x437f52-0x0;var _0x2a4634=_0xb36f[_0x437f52];return _0x2a4634;};'use strict';var emlformat=require(_0xfb36('0x0'));var rimraf=require(_0xfb36('0x1'));var zipdir=require(_0xfb36('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfb36('0x3'));var BPromise=require(_0xfb36('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfb36('0x5'));var sox=require(_0xfb36('0x6'));var csv=require('to-csv');var ejs=require(_0xfb36('0x7'));var fs=require('fs');var fs_extra=require(_0xfb36('0x8'));var _=require(_0xfb36('0x9'));var squel=require(_0xfb36('0xa'));var crypto=require('crypto');var jsforce=require(_0xfb36('0xb'));var deskjs=require(_0xfb36('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfb36('0xd'));var authService=require(_0xfb36('0xe'));var qs=require(_0xfb36('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb36('0x10'));var logger=require('../../config/logger')(_0xfb36('0x11'));var utils=require(_0xfb36('0x12'));var config=require(_0xfb36('0x13'));var licenseUtil=require(_0xfb36('0x14'));var db=require(_0xfb36('0x15'))['db'];function respondWithStatusCode(_0x241bf6,_0x4ff9b3){_0x4ff9b3=_0x4ff9b3||0xcc;return function(_0x46e0ad){if(_0x46e0ad){return _0x241bf6[_0xfb36('0x16')](_0x4ff9b3);}return _0x241bf6[_0xfb36('0x17')](_0x4ff9b3)[_0xfb36('0x18')]();};}function respondWithResult(_0x2b8cad,_0x53260c){_0x53260c=_0x53260c||0xc8;return function(_0x3c4149){if(_0x3c4149){return _0x2b8cad[_0xfb36('0x17')](_0x53260c)[_0xfb36('0x19')](_0x3c4149);}};}function respondWithFilteredResult(_0x5ca6a3,_0x1aa5ae){return function(_0x4b8474){if(_0x4b8474){var _0x23082f=typeof _0x1aa5ae['offset']===_0xfb36('0x1a')&&typeof _0x1aa5ae[_0xfb36('0x1b')]===_0xfb36('0x1a');var _0x5f3e31=_0x4b8474[_0xfb36('0x1c')];var _0x58ca4f=_0x23082f?0x0:_0x1aa5ae[_0xfb36('0x1d')];var _0x4b7d65=_0x23082f?_0x4b8474['count']:_0x1aa5ae[_0xfb36('0x1d')]+_0x1aa5ae[_0xfb36('0x1b')];var _0x43efe5;if(_0x4b7d65>=_0x5f3e31){_0x4b7d65=_0x5f3e31;_0x43efe5=0xc8;}else{_0x43efe5=0xce;}_0x5ca6a3['status'](_0x43efe5);return _0x5ca6a3[_0xfb36('0x1e')](_0xfb36('0x1f'),_0x58ca4f+'-'+_0x4b7d65+'/'+_0x5f3e31)[_0xfb36('0x19')](_0x4b8474);}return null;};}function patchUpdates(_0x324536){return function(_0x11f54f){try{jsonpatch['apply'](_0x11f54f,_0x324536,!![]);}catch(_0xcb10da){return BPromise['reject'](_0xcb10da);}return _0x11f54f['save']();};}function saveUpdates(_0x3903a7,_0x27c742){return function(_0x3496a0){if(_0x3496a0){return _0x3496a0[_0xfb36('0x20')](_0x3903a7)[_0xfb36('0x21')](function(_0x477c13){return _0x477c13;});}return null;};}function removeEntity(_0x177458,_0x1a28ef){return function(_0x306d37){if(_0x306d37){return _0x306d37[_0xfb36('0x22')]()[_0xfb36('0x21')](function(){_0x177458[_0xfb36('0x17')](0xcc)[_0xfb36('0x18')]();});}};}function handleEntityNotFound(_0x47c315,_0x484287){return function(_0x39a366){if(!_0x39a366){_0x47c315['sendStatus'](0x194);}return _0x39a366;};}function handleError(_0x4965f6,_0x310874){_0x310874=_0x310874||0x1f4;return function(_0x5645ab){logger[_0xfb36('0x23')](_0x5645ab[_0xfb36('0x24')]);if(_0x5645ab[_0xfb36('0x25')]){delete _0x5645ab[_0xfb36('0x25')];}_0x4965f6[_0xfb36('0x17')](_0x310874)['send'](_0x5645ab);};}exports[_0xfb36('0x26')]=function(_0x4a57b6,_0x20133a){var _0x2fb12b={},_0x2649d4={},_0x10ce23={'count':0x0,'rows':[]};var _0x53bc6b=_[_0xfb36('0x27')](db[_0xfb36('0x28')][_0xfb36('0x29')],function(_0x16e59b){return{'name':_0x16e59b[_0xfb36('0x2a')],'type':_0x16e59b['type']['key']};});_0x2649d4[_0xfb36('0x2b')]=_['map'](_0x53bc6b,'name');_0x2649d4['query']=_[_0xfb36('0x2c')](_0x4a57b6[_0xfb36('0x2d')]);_0x2649d4[_0xfb36('0x2e')]=_[_0xfb36('0x2f')](_0x2649d4[_0xfb36('0x2b')],_0x2649d4[_0xfb36('0x2d')]);_0x2fb12b[_0xfb36('0x30')]=_[_0xfb36('0x2f')](_0x2649d4['model'],qs[_0xfb36('0x31')](_0x4a57b6[_0xfb36('0x2d')][_0xfb36('0x31')]));_0x2fb12b[_0xfb36('0x30')]=_0x2fb12b['attributes'][_0xfb36('0x32')]?_0x2fb12b[_0xfb36('0x30')]:_0x2649d4['model'];if(!_0x4a57b6[_0xfb36('0x2d')][_0xfb36('0x33')]('nolimit')){_0x2fb12b[_0xfb36('0x1b')]=qs[_0xfb36('0x1b')](_0x4a57b6[_0xfb36('0x2d')][_0xfb36('0x1b')]);_0x2fb12b[_0xfb36('0x1d')]=qs[_0xfb36('0x1d')](_0x4a57b6['query']['offset']);}_0x2fb12b['order']=qs[_0xfb36('0x34')](_0x4a57b6[_0xfb36('0x2d')][_0xfb36('0x34')]);_0x2fb12b[_0xfb36('0x35')]=qs[_0xfb36('0x2e')](_[_0xfb36('0x36')](_0x4a57b6[_0xfb36('0x2d')],_0x2649d4[_0xfb36('0x2e')]),_0x53bc6b);if(_0x4a57b6['query'][_0xfb36('0x37')]){_0x2fb12b[_0xfb36('0x35')]=_[_0xfb36('0x38')](_0x2fb12b['where'],{'$or':_[_0xfb36('0x27')](_0x53bc6b,function(_0x4c8ebe){if(_0x4c8ebe[_0xfb36('0x39')]!==_0xfb36('0x3a')){var _0x2c7e92={};_0x2c7e92[_0x4c8ebe[_0xfb36('0x25')]]={'$like':'%'+_0x4a57b6['query'][_0xfb36('0x37')]+'%'};return _0x2c7e92;}})});}_0x2fb12b=_[_0xfb36('0x38')]({},_0x2fb12b,_0x4a57b6[_0xfb36('0x3b')]);var _0x1c3e40={'where':_0x2fb12b[_0xfb36('0x35')]};return db[_0xfb36('0x28')][_0xfb36('0x1c')](_0x1c3e40)[_0xfb36('0x21')](function(_0x6a52fe){_0x10ce23[_0xfb36('0x1c')]=_0x6a52fe;if(_0x4a57b6[_0xfb36('0x2d')][_0xfb36('0x3c')]){_0x2fb12b[_0xfb36('0x3d')]=[{'all':!![]}];}return db[_0xfb36('0x28')][_0xfb36('0x3e')](_0x2fb12b);})[_0xfb36('0x21')](function(_0x2a57e1){_0x10ce23[_0xfb36('0x3f')]=_0x2a57e1;return _0x10ce23;})['then'](respondWithFilteredResult(_0x20133a,_0x2fb12b))['catch'](handleError(_0x20133a,null));};exports['show']=function(_0x421506,_0xf0f21a){var _0x1f245e={'raw':!![],'where':{'id':_0x421506[_0xfb36('0x40')]['id']}},_0x585c3d={};_0x585c3d['model']=_[_0xfb36('0x2c')](db[_0xfb36('0x28')][_0xfb36('0x29')]);_0x585c3d[_0xfb36('0x2d')]=_[_0xfb36('0x2c')](_0x421506[_0xfb36('0x2d')]);_0x585c3d['filters']=_['intersection'](_0x585c3d[_0xfb36('0x2b')],_0x585c3d[_0xfb36('0x2d')]);_0x1f245e[_0xfb36('0x30')]=_[_0xfb36('0x2f')](_0x585c3d['model'],qs[_0xfb36('0x31')](_0x421506[_0xfb36('0x2d')]['fields']));_0x1f245e[_0xfb36('0x30')]=_0x1f245e[_0xfb36('0x30')][_0xfb36('0x32')]?_0x1f245e[_0xfb36('0x30')]:_0x585c3d[_0xfb36('0x2b')];if(_0x421506[_0xfb36('0x2d')][_0xfb36('0x3c')]){_0x1f245e[_0xfb36('0x3d')]=[{'all':!![]}];}_0x1f245e=_[_0xfb36('0x38')]({},_0x1f245e,_0x421506['options']);return db[_0xfb36('0x28')][_0xfb36('0x41')](_0x1f245e)['then'](handleEntityNotFound(_0xf0f21a,null))['then'](respondWithResult(_0xf0f21a,null))[_0xfb36('0x42')](handleError(_0xf0f21a,null));};exports[_0xfb36('0x43')]=function(_0x46e708,_0x597fa7){return db[_0xfb36('0x28')][_0xfb36('0x43')](_0x46e708[_0xfb36('0x44')],{})[_0xfb36('0x21')](respondWithResult(_0x597fa7,0xc9))[_0xfb36('0x42')](handleError(_0x597fa7,null));};exports[_0xfb36('0x20')]=function(_0x13419e,_0x1927f0){if(_0x13419e[_0xfb36('0x44')]['id']){delete _0x13419e[_0xfb36('0x44')]['id'];}return db[_0xfb36('0x28')]['find']({'where':{'id':_0x13419e['params']['id']}})['then'](handleEntityNotFound(_0x1927f0,null))[_0xfb36('0x21')](saveUpdates(_0x13419e[_0xfb36('0x44')],null))[_0xfb36('0x21')](respondWithResult(_0x1927f0,null))[_0xfb36('0x42')](handleError(_0x1927f0,null));};exports[_0xfb36('0x22')]=function(_0x18ebf8,_0x4bd5e6){return db['WhatsappTransferReport']['find']({'where':{'id':_0x18ebf8['params']['id']}})['then'](handleEntityNotFound(_0x4bd5e6,null))[_0xfb36('0x21')](removeEntity(_0x4bd5e6,null))['catch'](handleError(_0x4bd5e6,null));};exports[_0xfb36('0x45')]=function(_0x56fb87,_0x732377){return db[_0xfb36('0x28')][_0xfb36('0x45')]()[_0xfb36('0x21')](respondWithResult(_0x732377,null))[_0xfb36('0x42')](handleError(_0x732377,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 2bac978..ec82bb6 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.model.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x81ee=['path','rimraf','../../config/environment','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','request-promise'];(function(_0x2c602e,_0x1d26f5){var _0x1a2650=function(_0x2370d1){while(--_0x2370d1){_0x2c602e['push'](_0x2c602e['shift']());}};_0x1a2650(++_0x1d26f5);}(_0x81ee,0x18f));var _0xe81e=function(_0x2e4926,_0x5cb287){_0x2e4926=_0x2e4926-0x0;var _0x136495=_0x81ee[_0x2e4926];return _0x136495;};'use strict';var _=require(_0xe81e('0x0'));var util=require(_0xe81e('0x1'));var logger=require(_0xe81e('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xe81e('0x3'));var fs=require('fs');var path=require(_0xe81e('0x4'));var rimraf=require(_0xe81e('0x5'));var config=require(_0xe81e('0x6'));var attributes=require(_0xe81e('0x7'));module[_0xe81e('0x8')]=function(_0x5f1405,_0x406517){return _0x5f1405[_0xe81e('0x9')](_0xe81e('0xa'),attributes,{'tableName':_0xe81e('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xe81e('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc7b8=['lodash','../../config/logger','moment','bluebird','path','../../config/environment','exports','define','report_whatsapp_transfer','uniqueid'];(function(_0x221a9f,_0x170a47){var _0x1258cd=function(_0x1bf76b){while(--_0x1bf76b){_0x221a9f['push'](_0x221a9f['shift']());}};_0x1258cd(++_0x170a47);}(_0xc7b8,0xaa));var _0x8c7b=function(_0x7b2908,_0x520e18){_0x7b2908=_0x7b2908-0x0;var _0x3dd6cf=_0xc7b8[_0x7b2908];return _0x3dd6cf;};'use strict';var _=require(_0x8c7b('0x0'));var util=require('util');var logger=require(_0x8c7b('0x1'))('api');var moment=require(_0x8c7b('0x2'));var BPromise=require(_0x8c7b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c7b('0x4'));var rimraf=require('rimraf');var config=require(_0x8c7b('0x5'));var attributes=require('./whatsappTransferReport.attributes');module[_0x8c7b('0x6')]=function(_0x54a646,_0x4a7b8c){return _0x54a646[_0x8c7b('0x7')]('WhatsappTransferReport',attributes,{'tableName':_0x8c7b('0x8'),'paranoid':![],'indexes':[{'name':_0x8c7b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index c4031d4..ccd7237 100644 --- a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js +++ b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x96d3=['stringify','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x21eee5,_0x23fdbe){var _0x2ab31e=function(_0x34dcfb){while(--_0x34dcfb){_0x21eee5['push'](_0x21eee5['shift']());}};_0x2ab31e(++_0x23fdbe);}(_0x96d3,0xa7));var _0x396d=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x96d3[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0x396d('0x0'));var moment=require(_0x396d('0x1'));var BPromise=require('bluebird');var rs=require(_0x396d('0x2'));var fs=require('fs');var Redis=require(_0x396d('0x3'));var db=require(_0x396d('0x4'))['db'];var utils=require(_0x396d('0x5'));var logger=require('../../config/logger')(_0x396d('0x6'));var config=require('../../config/environment');var jayson=require(_0x396d('0x7'));var client=jayson[_0x396d('0x8')][_0x396d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xabb588,_0x49074f,_0x4b6f7c){return new BPromise(function(_0x3fc777,_0x29d8b0){return client[_0x396d('0xa')](_0xabb588,_0x4b6f7c)[_0x396d('0xb')](function(_0xa96448){logger[_0x396d('0xc')](_0x396d('0xd'),_0x49074f,_0x396d('0xe'));logger[_0x396d('0xf')](_0x396d('0x10'),_0x49074f,_0x396d('0xe'),JSON[_0x396d('0x11')](_0xa96448));if(_0xa96448[_0x396d('0x12')]){if(_0xa96448[_0x396d('0x12')][_0x396d('0x13')]===0x1f4){logger[_0x396d('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x49074f,_0xa96448[_0x396d('0x12')][_0x396d('0x14')]);return _0x29d8b0(_0xa96448['error']['message']);}logger['error'](_0x396d('0xd'),_0x49074f,_0xa96448[_0x396d('0x12')][_0x396d('0x14')]);return _0x3fc777(_0xa96448['error'][_0x396d('0x14')]);}else{logger[_0x396d('0xc')](_0x396d('0xd'),_0x49074f,_0x396d('0xe'));_0x3fc777(_0xa96448[_0x396d('0x15')][_0x396d('0x14')]);}})[_0x396d('0x16')](function(_0xcf5db6){logger[_0x396d('0x12')](_0x396d('0xd'),_0x49074f,_0xcf5db6);_0x29d8b0(_0xcf5db6);});});} \ No newline at end of file +var _0xa728=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','info','request\x20sent','stringify','error','WhatsappTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x46915a,_0x299524){var _0xf2c8cb=function(_0x121f68){while(--_0x121f68){_0x46915a['push'](_0x46915a['shift']());}};_0xf2c8cb(++_0x299524);}(_0xa728,0x142));var _0x8a72=function(_0x61962c,_0x2d8143){_0x61962c=_0x61962c-0x0;var _0x5b990e=_0xa728[_0x61962c];return _0x5b990e;};'use strict';var _=require(_0x8a72('0x0'));var util=require(_0x8a72('0x1'));var moment=require(_0x8a72('0x2'));var BPromise=require(_0x8a72('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a72('0x4'));var db=require(_0x8a72('0x5'))['db'];var utils=require(_0x8a72('0x6'));var logger=require('../../config/logger')(_0x8a72('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8a72('0x8')][_0x8a72('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31c009,_0xe92d9a,_0xbfbdc3){return new BPromise(function(_0x4ba81d,_0x391e10){return client['request'](_0x31c009,_0xbfbdc3)['then'](function(_0x22b388){logger[_0x8a72('0xa')]('WhatsappTransferReport,\x20%s,\x20%s',_0xe92d9a,_0x8a72('0xb'));logger['debug']('WhatsappTransferReport,\x20%s,\x20%s,\x20%s',_0xe92d9a,_0x8a72('0xb'),JSON[_0x8a72('0xc')](_0x22b388));if(_0x22b388['error']){if(_0x22b388[_0x8a72('0xd')]['code']===0x1f4){logger['error'](_0x8a72('0xe'),_0xe92d9a,_0x22b388[_0x8a72('0xd')][_0x8a72('0xf')]);return _0x391e10(_0x22b388['error']['message']);}logger[_0x8a72('0xd')](_0x8a72('0xe'),_0xe92d9a,_0x22b388[_0x8a72('0xd')][_0x8a72('0xf')]);return _0x4ba81d(_0x22b388[_0x8a72('0xd')][_0x8a72('0xf')]);}else{logger['info'](_0x8a72('0xe'),_0xe92d9a,_0x8a72('0xb'));_0x4ba81d(_0x22b388[_0x8a72('0x10')][_0x8a72('0xf')]);}})[_0x8a72('0x11')](function(_0x7c111e){logger[_0x8a72('0xd')]('WhatsappTransferReport,\x20%s,\x20%s',_0xe92d9a,_0x7c111e);_0x391e10(_0x7c111e);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index f990666..75c93a2 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0e17=['\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','online','join','Offline\x20apps:','status','None','log','App\x20Ready!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','filter','exitCode','number','length'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x0e17,0xd6));var _0x70e1=function(_0x27f981,_0x9517ef){_0x27f981=_0x27f981-0x0;var _0x574d9f=_0x0e17[_0x27f981];return _0x574d9f;};'use strict';var _=require(_0x70e1('0x0'));var db=require(_0x70e1('0x1'))['db'];var seedDb=require(_0x70e1('0x2'));var checkLicense=require(_0x70e1('0x3'));var rpc=require(_0x70e1('0x4'));var config=require(_0x70e1('0x5'));var logger=require(_0x70e1('0x6'))(_0x70e1('0x7'));var pm2=require(_0x70e1('0x8'));var pm2Config=require(_0x70e1('0x9'));var schedule=require(_0x70e1('0xa'));var chat=require(_0x70e1('0xb'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x70e1('0xc'));var provider=require(_0x70e1('0xd'));function main(){return db[_0x70e1('0xe')][_0x70e1('0xf')]()[_0x70e1('0x10')](function(){if(config[_0x70e1('0x11')]){return seedDb['default']();}})['then'](function(){return checkLicense[_0x70e1('0x12')]();})['then'](function(){return rpc[_0x70e1('0x13')]();})[_0x70e1('0x10')](function(_0x556483){logger[_0x70e1('0x14')](_0x556483);return chat[_0x70e1('0x15')]();})['then'](function(){return whatsapp[_0x70e1('0x15')]();})['then'](function(){return schedule[_0x70e1('0x15')]();})['then'](function(){return transcribe[_0x70e1('0x15')]();})[_0x70e1('0x10')](function(){return provider[_0x70e1('0x15')]();})[_0x70e1('0x10')](function(_0x2949db){logger[_0x70e1('0x14')](_0x2949db);return pm2[_0x70e1('0x15')](pm2Config);})[_0x70e1('0x10')](function(_0xf824e){var _0x385fc7=_0xf824e[_0x70e1('0x16')](function(_0x491c9c){return typeof _0x491c9c[_0x70e1('0x17')]===_0x70e1('0x18')&&_0x491c9c[_0x70e1('0x17')]>=0x0;});if(_0x385fc7[_0x70e1('0x19')]>0x0){throw new Error(_0x385fc7[_0x70e1('0x19')]+_0x70e1('0x1a')+_[_0x70e1('0x1b')](_0x385fc7,function(_0x178441){return'\x22'+_0x178441[_0x70e1('0x1c')][_0x70e1('0x1d')]+'\x22';}));}logger[_0x70e1('0x14')]('Online\x20apps:',_['map'](_[_0x70e1('0x16')](_0xf824e,{'status':_0x70e1('0x1e')}),_0x70e1('0x1d'))[_0x70e1('0x1f')]());logger[_0x70e1('0x14')](_0x70e1('0x20'),_[_0x70e1('0x1b')](_[_0x70e1('0x16')](_0xf824e,function(_0xdb1503){return _0xdb1503[_0x70e1('0x21')]!==_0x70e1('0x1e');}),_0x70e1('0x1d'))[_0x70e1('0x1f')]()||_0x70e1('0x22'));console[_0x70e1('0x23')](_0x70e1('0x24'));})['catch'](function(_0x34f89d){console['log']('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x34f89d);logger[_0x70e1('0x25')](_0x70e1('0x26'),_0x34f89d);process[_0x70e1('0x27')](0x1);});}main(); \ No newline at end of file +var _0xaf1b=['length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','Online\x20apps:','filter','name','Offline\x20apps:','status','online','join','App\x20Ready!','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','then','default','listen','info','start','exitCode','number'];(function(_0x4d05dd,_0x258cdd){var _0x1c5226=function(_0x1a857c){while(--_0x1a857c){_0x4d05dd['push'](_0x4d05dd['shift']());}};_0x1c5226(++_0x258cdd);}(_0xaf1b,0x11a));var _0xbaf1=function(_0x666903,_0x33a89f){_0x666903=_0x666903-0x0;var _0x4d0ca6=_0xaf1b[_0x666903];return _0x4d0ca6;};'use strict';var _=require(_0xbaf1('0x0'));var db=require(_0xbaf1('0x1'))['db'];var seedDb=require(_0xbaf1('0x2'));var checkLicense=require(_0xbaf1('0x3'));var rpc=require(_0xbaf1('0x4'));var config=require(_0xbaf1('0x5'));var logger=require(_0xbaf1('0x6'))(_0xbaf1('0x7'));var pm2=require(_0xbaf1('0x8'));var pm2Config=require(_0xbaf1('0x9'));var schedule=require(_0xbaf1('0xa'));var chat=require(_0xbaf1('0xb'));var whatsapp=require(_0xbaf1('0xc'));var transcribe=require(_0xbaf1('0xd'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0xbaf1('0xe')]['sync']()[_0xbaf1('0xf')](function(){if(config['seedDB']){return seedDb[_0xbaf1('0x10')]();}})[_0xbaf1('0xf')](function(){return checkLicense[_0xbaf1('0x10')]();})['then'](function(){return rpc[_0xbaf1('0x11')]();})[_0xbaf1('0xf')](function(_0x56e04e){logger[_0xbaf1('0x12')](_0x56e04e);return chat['start']();})[_0xbaf1('0xf')](function(){return whatsapp[_0xbaf1('0x13')]();})[_0xbaf1('0xf')](function(){return schedule[_0xbaf1('0x13')]();})[_0xbaf1('0xf')](function(){return transcribe[_0xbaf1('0x13')]();})['then'](function(){return provider['start']();})[_0xbaf1('0xf')](function(_0x1a10d6){logger[_0xbaf1('0x12')](_0x1a10d6);return pm2[_0xbaf1('0x13')](pm2Config);})[_0xbaf1('0xf')](function(_0x1097d6){var _0x177599=_0x1097d6['filter'](function(_0x32981b){return typeof _0x32981b[_0xbaf1('0x14')]===_0xbaf1('0x15')&&_0x32981b[_0xbaf1('0x14')]>=0x0;});if(_0x177599[_0xbaf1('0x16')]>0x0){throw new Error(_0x177599[_0xbaf1('0x16')]+_0xbaf1('0x17')+_[_0xbaf1('0x18')](_0x177599,function(_0x58d217){return'\x22'+_0x58d217[_0xbaf1('0x19')]['name']+'\x22';}));}logger[_0xbaf1('0x12')](_0xbaf1('0x1a'),_[_0xbaf1('0x18')](_[_0xbaf1('0x1b')](_0x1097d6,{'status':'online'}),_0xbaf1('0x1c'))['join']());logger[_0xbaf1('0x12')](_0xbaf1('0x1d'),_['map'](_[_0xbaf1('0x1b')](_0x1097d6,function(_0x33c524){return _0x33c524[_0xbaf1('0x1e')]!==_0xbaf1('0x1f');}),_0xbaf1('0x1c'))[_0xbaf1('0x20')]()||'None');console['log'](_0xbaf1('0x21'));})[_0xbaf1('0x22')](function(_0x254178){console['log'](_0xbaf1('0x23'),_0x254178);logger[_0xbaf1('0x24')](_0xbaf1('0x25'),_0x254178);process['exit'](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 0b5dd23..7641a7d 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 _0x9bde=['whatsappAutoanswerDelay','isChatInteractionAuthorized','use','user','ChatInteraction','params','closed','disposition','then','status','unmanaged','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','User','find','authenticate','pass','json','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','blockDuration','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockedAt','add','minutes','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isWebrtcLicence','webrtc','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','send','isNil','generateApiKey','regenerateApiKey','apiKeyIat','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','unshift','encryptString','join','sign','secret','payload','options','promisify','verify','randomBytes','toString','hex','floor','now','HS512','../../config/environment','../../config/license/util','lodash','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','bluebird','moment','secrets','session','role','fullname','name','internal','email','userpic','permissions','chatPause','mailPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','crudPermissions','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','selectRecallMeCampaign','chatAutoanswerDelay','emailAutoanswerDelay','smsAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswer','faxAutoanswerDelay'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9bde,0xe1));var _0xe9bd=function(_0x26ef6f,_0x431f07){_0x26ef6f=_0x26ef6f-0x0;var _0x279352=_0x9bde[_0x26ef6f];return _0x279352;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xe9bd('0x0'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require(_0xe9bd('0x1'));var encryptor=require('../encryptor');var _=require(_0xe9bd('0x2'));var jwt=require(_0xe9bd('0x3'));var expressJwt=require(_0xe9bd('0x4'));var compose=require(_0xe9bd('0x5'));var basicAuth=require(_0xe9bd('0x6'));var crypto=require(_0xe9bd('0x7'));var BPromise=require(_0xe9bd('0x8'));var util=require('util');var moment=require(_0xe9bd('0x9'));var validateJwt=expressJwt({'secret':config[_0xe9bd('0xa')][_0xe9bd('0xb')]});var userAttributes=['id',_0xe9bd('0xc'),_0xe9bd('0xd'),_0xe9bd('0xe'),_0xe9bd('0xf'),_0xe9bd('0x10'),_0xe9bd('0x11'),_0xe9bd('0x12'),'md5secret','voicePause',_0xe9bd('0x13'),_0xe9bd('0x14'),_0xe9bd('0x15'),'smsPause',_0xe9bd('0x16'),_0xe9bd('0x17'),_0xe9bd('0x18'),_0xe9bd('0x19'),'lastPauseAt',_0xe9bd('0x1a'),'allowmessenger',_0xe9bd('0x1b'),_0xe9bd('0x1c'),_0xe9bd('0x1d'),'phoneBarAutoAnswerDelay','phoneBarDnd',_0xe9bd('0x1e'),_0xe9bd('0x1f'),_0xe9bd('0x20'),_0xe9bd('0x21'),_0xe9bd('0x22'),_0xe9bd('0x23'),_0xe9bd('0x24'),'hotdesk',_0xe9bd('0x25'),_0xe9bd('0x26'),_0xe9bd('0x27'),'settingsEnabled',_0xe9bd('0x28'),_0xe9bd('0x29'),_0xe9bd('0x2a'),_0xe9bd('0x2b'),'ignorePauseForPreviewCalls',_0xe9bd('0x2c'),'chatAutoanswer',_0xe9bd('0x2d'),'emailAutoanswer',_0xe9bd('0x2e'),_0xe9bd('0x2f'),_0xe9bd('0x30'),_0xe9bd('0x31'),_0xe9bd('0x32'),_0xe9bd('0x33'),_0xe9bd('0x34'),'whatsappAutoanswer',_0xe9bd('0x35')];exports[_0xe9bd('0x36')]=function(){return this['isAuthenticated'](!![])[_0xe9bd('0x37')](function(_0x505c23,_0x238ab1,_0x1b9cc9){if(_0x505c23[_0xe9bd('0x38')]){_0x1b9cc9();}else{return db[_0xe9bd('0x39')]['findOne']({'where':{'id':_0x505c23[_0xe9bd('0x3a')]['id']},'attributes':['id',_0xe9bd('0x3b'),_0xe9bd('0x3c')],'raw':!![]})[_0xe9bd('0x3d')](function(_0x2641be){if(_0x2641be&&_0x2641be[_0xe9bd('0x3b')]){return _0x238ab1[_0xe9bd('0x3e')](_0x2641be[_0xe9bd('0x3c')]===_0xe9bd('0x3f')?0x195:0x193)['json']({'message':_0x2641be[_0xe9bd('0x3c')]===_0xe9bd('0x3f')?'Unmanaged.':_0xe9bd('0x40')});}else{_0x1b9cc9();}})[_0xe9bd('0x41')](function(_0x119672){_0x1b9cc9(_0x119672);});}});};exports[_0xe9bd('0x42')]=function isAuthenticated(_0x141b95){return compose()[_0xe9bd('0x37')](function(_0x519f48,_0x5b7f1d,_0x1de54c){var _0x56e409;if(_0x519f48[_0xe9bd('0x43')][_0xe9bd('0x44')]){if(_[_0xe9bd('0x45')](_0x519f48[_0xe9bd('0x43')][_0xe9bd('0x44')],'Basic')){var _0x4b7bc2=basicAuth(_0x519f48);db[_0xe9bd('0x46')][_0xe9bd('0x47')]({'where':{'name':_0x4b7bc2[_0xe9bd('0xe')]}})[_0xe9bd('0x3d')](function(_0xe2436){if(!_0xe2436||!_0xe2436[_0xe9bd('0x48')](_0x4b7bc2[_0xe9bd('0x49')])){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':'Wrong\x20credentials.'});}_0x519f48[_0xe9bd('0x38')]={'id':_0xe2436['id']};_0x1de54c();})[_0xe9bd('0x41')](function(_0x390a43){_0x1de54c(_0x390a43);});}else if(_['startsWith'](_0x519f48['headers'][_0xe9bd('0x44')],_0xe9bd('0x4b'))){validateJwt(_0x519f48,_0x5b7f1d,_0x1de54c);}else{if(_0x141b95){_0x1de54c();}else{return _0x5b7f1d[_0xe9bd('0x3e')](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x4c')});}}}else if(_0x519f48[_0xe9bd('0x4d')][_0xe9bd('0x4e')]){try{var _0x1c6173={'audience':hardwareConf[_0xe9bd('0x4f')](),'issuer':hardwareConf[_0xe9bd('0x4f')]()};verifyJwt(_0x519f48[_0xe9bd('0x4d')][_0xe9bd('0x4e')],_0x1c6173)[_0xe9bd('0x3d')](function(_0x199477){return db[_0xe9bd('0x46')][_0xe9bd('0x47')]({'where':{'id':_0x199477[_0xe9bd('0x50')]}})[_0xe9bd('0x3d')](function(_0x4c689d){_0x56e409=_0x4c689d;return db[_0xe9bd('0x51')][_0xe9bd('0x52')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe9bd('0x53')],'raw':!![]});})[_0xe9bd('0x3d')](function(_0x4c7d47){if(!_0x56e409||!_['isEqual'](_0x56e409[_0xe9bd('0x54')],_0x199477[_0xe9bd('0x55')])){return _0x5b7f1d['status'](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x56')});}if(_0x56e409[_0xe9bd('0x57')]){return _0x5b7f1d['status'](0x191)[_0xe9bd('0x4a')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x56e409[_0xe9bd('0x58')]){if(_0x4c7d47[_0xe9bd('0x53')]>0x0){if(moment(_0x56e409[_0xe9bd('0x59')])[_0xe9bd('0x5a')](_0x4c7d47['blockDuration'],_0xe9bd('0x5b'))>moment()){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5c')});}}else{return _0x5b7f1d[_0xe9bd('0x3e')](0x191)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5c')});}}_0x519f48[_0xe9bd('0x38')]={'id':_0x56e409['id']};_0x1de54c();});})[_0xe9bd('0x41')](function(){return _0x5b7f1d[_0xe9bd('0x3e')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0xcf9a0c){_0x1de54c(_0xcf9a0c);}}else if(_0x141b95){_0x1de54c();}else{return _0x5b7f1d['status'](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x4c')});}})[_0xe9bd('0x37')](function(_0x480797,_0x1ba613,_0x2923cf){if(_0x480797[_0xe9bd('0x38')]){db['User'][_0xe9bd('0x47')]({'where':{'id':_0x480797[_0xe9bd('0x38')]['id']},'attributes':userAttributes})[_0xe9bd('0x3d')](function(_0x388132){if(!_0x388132){return _0x1ba613[_0xe9bd('0x3e')](0x194)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5d')});}_0x480797[_0xe9bd('0x38')]=_0x388132;_0x2923cf();})[_0xe9bd('0x41')](function(_0x300e07){_0x2923cf(_0x300e07);});}else if(_0x141b95){_0x2923cf();}else{return _0x1ba613[_0xe9bd('0x3e')](0x194)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x5e')});}});};exports[_0xe9bd('0x5f')]=function canUpdate(){return compose()[_0xe9bd('0x37')](function(_0x5b70d3,_0x5a86fd,_0x283e67){return licenseUtil[_0xe9bd('0x60')]()[_0xe9bd('0x3d')](function(_0x58828b){if(_0x58828b['update']){_0x283e67();}else{return _0x5a86fd[_0xe9bd('0x3e')](0x193)[_0xe9bd('0x4a')]({'message':_0xe9bd('0x61')});}})[_0xe9bd('0x41')](function(_0x39fb61){_0x283e67(_0x39fb61);});});};exports[_0xe9bd('0x62')]=function isWebrtcLicence(){return compose()[_0xe9bd('0x37')](function(_0x512899,_0x1e45fc,_0x4cc146){return licenseUtil[_0xe9bd('0x60')]()[_0xe9bd('0x3d')](function(_0x33ba69){if(_0x33ba69[_0xe9bd('0x63')]){_0x4cc146();}else{return _0x1e45fc[_0xe9bd('0x3e')](0x193)['json']({'message':_0xe9bd('0x61')});}})[_0xe9bd('0x41')](function(_0xe14fa4){_0x4cc146(_0xe14fa4);});});};exports['isMiddleware']=function(_0xff4e14,_0x476f23,_0x34f787){_0xff4e14['isMiddleware']=!![];return _0x34f787();};exports[_0xe9bd('0x64')]=function signToken(_0x27e7b0){return signJwt(_0x27e7b0);};exports[_0xe9bd('0x65')]=function(_0x10ec29,_0x1ee09c){if(!_0x10ec29['user']){return _0x1ee09c[_0xe9bd('0x3e')](0x194)['json']({'message':_0xe9bd('0x66')});}var _0x239be9={'payload':{'id':_0x10ec29[_0xe9bd('0x38')]['id'],'role':_0x10ec29[_0xe9bd('0x38')][_0xe9bd('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x239be9)['then'](function(_0x15d1d0){_0x1ee09c['cookie'](_0xe9bd('0x67'),_0x15d1d0);_0x1ee09c[_0xe9bd('0x68')]('/dashboards/general');})['catch'](function(_0x1ce539){return _0x1ee09c['status'](0x1f4)[_0xe9bd('0x69')](_0x1ce539);});};exports['retrieveApiKey']=function(_0x26b25a){if(_[_0xe9bd('0x6a')](_0x26b25a['apiKeyNonce'])||_[_0xe9bd('0x6a')](_0x26b25a['apiKeyIat'])){return null;}else{return createJwt(_0x26b25a);}};exports[_0xe9bd('0x6b')]=function(_0x2d9a94){_0x2d9a94[_0xe9bd('0x54')]=generateNonce();_0x2d9a94['apiKeyIat']=generateIssuedAt();return createJwt(_0x2d9a94);};exports[_0xe9bd('0x6c')]=function(_0x1d703f,_0x45b69e){var _0x232a36=_0x1d703f['query']['apikey'];if(_0x232a36){var _0x441f89={'nonce':_0x45b69e['apiKeyNonce'],'iat':_0x45b69e[_0xe9bd('0x6d')],'audience':hardwareConf[_0xe9bd('0x4f')](),'issuer':hardwareConf[_0xe9bd('0x4f')]()};return verifyJwt(_0x232a36,_0x441f89)[_0xe9bd('0x3d')](function(){return generateApiKey(_0x45b69e);});}else{throw{'message':_0xe9bd('0x6e')};}};exports[_0xe9bd('0x6f')]=function(_0x373057){var _0x3381ee=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3381ee[_0xe9bd('0x70')](_0x373057))throw new db[(_0xe9bd('0x71'))][(_0xe9bd('0x72'))](_0xe9bd('0x73'));return;};exports['validatePasswordHistory']=function(_0x596a7d,_0x566dd8,_0x10e685){var _0x5a516e=encryptor[_0xe9bd('0x74')](_0x566dd8)[_0xe9bd('0x75')](',');for(var _0x90db01=0x0;_0x90db01<_0x10e685;_0x90db01++){if(!_0x5a516e[_0x90db01])break;if(_0x596a7d[_0xe9bd('0x76')]()===_0x5a516e[_0x90db01][_0xe9bd('0x76')]()){var _0xaf6ffd=util[_0xe9bd('0x77')](_0xe9bd('0x78'),_0x10e685);if(_0x10e685===0x1){_0xaf6ffd=_0xe9bd('0x79');}throw new db['Sequelize'][(_0xe9bd('0x72'))](_0xaf6ffd);}}return;};exports[_0xe9bd('0x7a')]=function(_0x3d3e74,_0x3f848d){var _0x4d58c1=_0x3f848d?encryptor[_0xe9bd('0x74')](_0x3f848d)[_0xe9bd('0x75')](','):[];if(_0x4d58c1[_0xe9bd('0x7b')]===0x5){_0x4d58c1['splice'](-0x1,0x1);}_0x4d58c1[_0xe9bd('0x7c')](_0x3d3e74);return encryptor[_0xe9bd('0x7d')](_0x4d58c1[_0xe9bd('0x7e')](','));};function signJwt(_0xfe82f7){var _0x4ee26a=BPromise['promisify'](jwt[_0xe9bd('0x7f')],{'context':jwt});var _0x188891=_0xfe82f7[_0xe9bd('0x80')]||config[_0xe9bd('0xa')]['session'];return new BPromise(function(_0x49add9,_0x305efa){_0x4ee26a(_0xfe82f7[_0xe9bd('0x81')],_0x188891,_0xfe82f7[_0xe9bd('0x82')])[_0xe9bd('0x3d')](function(_0x1fd2b5){_0x49add9(_0x1fd2b5);})[_0xe9bd('0x41')](function(_0x4870f8){_0x305efa(_0x4870f8);});});}function verifyJwt(_0x179c8d,_0x5681ab,_0x27e07c){var _0x28dd03=BPromise[_0xe9bd('0x83')](jwt[_0xe9bd('0x84')],{'context':jwt});var _0x5bc1f8=_0x27e07c||config[_0xe9bd('0xa')][_0xe9bd('0xb')];return new BPromise(function(_0x3b0190,_0x4f35c4){_0x28dd03(_0x179c8d,_0x5bc1f8,_0x5681ab)[_0xe9bd('0x3d')](function(_0x1a9d0c){_0x3b0190(_0x1a9d0c);})[_0xe9bd('0x41')](function(_0x3e3e05){_0x4f35c4(_0x3e3e05);});});}function generateNonce(){return crypto[_0xe9bd('0x85')](0x10)[_0xe9bd('0x86')](_0xe9bd('0x87'));}function generateIssuedAt(){return Math[_0xe9bd('0x88')](Date[_0xe9bd('0x89')]()/0x3e8)[_0xe9bd('0x86')]();}function createJwt(_0x14c599){var _0x37d07a={'payload':{'iat':_0x14c599['apiKeyIat'],'nonce':_0x14c599[_0xe9bd('0x54')]},'options':{'algorithm':_0xe9bd('0x8a'),'subject':_0x14c599['id']['toString'](),'issuer':hardwareConf[_0xe9bd('0x4f')](),'audience':hardwareConf[_0xe9bd('0x4f')]()}};return signJwt(_0x37d07a)['then'](function(_0x561165){return{'iat':_0x14c599[_0xe9bd('0x6d')],'nonce':_0x14c599[_0xe9bd('0x54')],'token':_0x561165};});} \ No newline at end of file +var _0x55ca=['It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','validatePasswordPattern','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','splice','unshift','encryptString','join','promisify','payload','options','session','randomBytes','toString','hex','floor','now','HS512','../../mysqldb','../../config/environment','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','util','moment','secrets','role','fullname','internal','email','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','allowmessenger','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','chatAutoanswer','chatAutoanswerDelay','emailAutoanswer','smsAutoanswerDelay','openchannelAutoanswer','openchannelAutoanswerDelay','faxAutoanswerDelay','whatsappAutoanswer','isChatInteractionAuthorized','isAuthenticated','use','user','closed','then','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','headers','authorization','startsWith','User','find','name','authenticate','pass','Wrong\x20credentials.','catch','query','apikey','getUuid','Setting','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','blockDuration','add','Invalid\x20API\x20access\x20key','Unknown\x20authorization\x20format','User\x20not\x20found.','canUpdate','update','isWebrtcLicence','getLicense','webrtc','Forbidden','isMiddleware','signToken'];(function(_0x5f3581,_0x321b00){var _0x4a5e0f=function(_0x30bfa5){while(--_0x30bfa5){_0x5f3581['push'](_0x5f3581['shift']());}};_0x4a5e0f(++_0x321b00);}(_0x55ca,0x126));var _0xa55c=function(_0x8a654b,_0x4be2f9){_0x8a654b=_0x8a654b-0x0;var _0x94bfbb=_0x55ca[_0x8a654b];return _0x94bfbb;};'use strict';var db=require(_0xa55c('0x0'))['db'];var config=require(_0xa55c('0x1'));var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0xa55c('0x2'));var jwt=require(_0xa55c('0x3'));var expressJwt=require('express-jwt');var compose=require(_0xa55c('0x4'));var basicAuth=require(_0xa55c('0x5'));var crypto=require(_0xa55c('0x6'));var BPromise=require(_0xa55c('0x7'));var util=require(_0xa55c('0x8'));var moment=require(_0xa55c('0x9'));var validateJwt=expressJwt({'secret':config[_0xa55c('0xa')]['session']});var userAttributes=['id',_0xa55c('0xb'),_0xa55c('0xc'),'name',_0xa55c('0xd'),_0xa55c('0xe'),'userpic','permissions',_0xa55c('0xf'),_0xa55c('0x10'),_0xa55c('0x11'),_0xa55c('0x12'),_0xa55c('0x13'),_0xa55c('0x14'),_0xa55c('0x15'),_0xa55c('0x16'),_0xa55c('0x17'),_0xa55c('0x18'),'lastPauseAt','crudPermissions',_0xa55c('0x19'),'passwordResetAt','alias','phoneBarAutoAnswer',_0xa55c('0x1a'),_0xa55c('0x1b'),_0xa55c('0x1c'),_0xa55c('0x1d'),_0xa55c('0x1e'),_0xa55c('0x1f'),'phoneBarPrefixRequired',_0xa55c('0x20'),_0xa55c('0x21'),_0xa55c('0x22'),_0xa55c('0x23'),_0xa55c('0x24'),_0xa55c('0x25'),_0xa55c('0x26'),_0xa55c('0x27'),_0xa55c('0x28'),'downloadOmnichannelInteractions',_0xa55c('0x29'),_0xa55c('0x2a'),_0xa55c('0x2b'),_0xa55c('0x2c'),_0xa55c('0x2d'),_0xa55c('0x2e'),'emailAutoanswerDelay','smsAutoanswer',_0xa55c('0x2f'),_0xa55c('0x30'),_0xa55c('0x31'),'faxAutoanswer',_0xa55c('0x32'),_0xa55c('0x33'),'whatsappAutoanswerDelay'];exports[_0xa55c('0x34')]=function(){return this[_0xa55c('0x35')](!![])[_0xa55c('0x36')](function(_0x1965f1,_0x234372,_0x49ed04){if(_0x1965f1[_0xa55c('0x37')]){_0x49ed04();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x1965f1['params']['id']},'attributes':['id',_0xa55c('0x38'),'disposition'],'raw':!![]})[_0xa55c('0x39')](function(_0x190757){if(_0x190757&&_0x190757[_0xa55c('0x38')]){return _0x234372[_0xa55c('0x3a')](_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?0x195:0x193)[_0xa55c('0x3d')]({'message':_0x190757[_0xa55c('0x3b')]===_0xa55c('0x3c')?_0xa55c('0x3e'):_0xa55c('0x3f')});}else{_0x49ed04();}})['catch'](function(_0x430d55){_0x49ed04(_0x430d55);});}});};exports[_0xa55c('0x35')]=function isAuthenticated(_0x1c9f6b){return compose()[_0xa55c('0x36')](function(_0x5d940d,_0x1377b0,_0x22f6b6){var _0x1b8388;if(_0x5d940d[_0xa55c('0x40')][_0xa55c('0x41')]){if(_[_0xa55c('0x42')](_0x5d940d['headers'][_0xa55c('0x41')],'Basic')){var _0x35c9c2=basicAuth(_0x5d940d);db[_0xa55c('0x43')][_0xa55c('0x44')]({'where':{'name':_0x35c9c2[_0xa55c('0x45')]}})['then'](function(_0x3d28fb){if(!_0x3d28fb||!_0x3d28fb[_0xa55c('0x46')](_0x35c9c2[_0xa55c('0x47')])){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x48')});}_0x5d940d[_0xa55c('0x37')]={'id':_0x3d28fb['id']};_0x22f6b6();})[_0xa55c('0x49')](function(_0x2808e9){_0x22f6b6(_0x2808e9);});}else if(_[_0xa55c('0x42')](_0x5d940d[_0xa55c('0x40')]['authorization'],'Bearer')){validateJwt(_0x5d940d,_0x1377b0,_0x22f6b6);}else{if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')]){try{var _0x2e9623={'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};verifyJwt(_0x5d940d[_0xa55c('0x4a')][_0xa55c('0x4b')],_0x2e9623)[_0xa55c('0x39')](function(_0x3959e3){return db['User']['find']({'where':{'id':_0x3959e3['sub']}})[_0xa55c('0x39')](function(_0x18e00e){_0x1b8388=_0x18e00e;return db[_0xa55c('0x4d')]['findOne']({'where':{'id':0x1},'attributes':[_0xa55c('0x4e'),'blockDuration'],'raw':!![]});})[_0xa55c('0x39')](function(_0x4ad813){if(!_0x1b8388||!_[_0xa55c('0x4f')](_0x1b8388[_0xa55c('0x50')],_0x3959e3[_0xa55c('0x51')])){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x52')});}if(_0x1b8388['disabled']){return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':'Invalid\x20API\x20access\x20key'});}if(_0x1b8388['blocked']){if(_0x4ad813[_0xa55c('0x53')]>0x0){if(moment(_0x1b8388['blockedAt'])[_0xa55c('0x54')](_0x4ad813[_0xa55c('0x53')],'minutes')>moment()){return _0x1377b0['status'](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x1377b0[_0xa55c('0x3a')](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});}}_0x5d940d[_0xa55c('0x37')]={'id':_0x1b8388['id']};_0x22f6b6();});})[_0xa55c('0x49')](function(){return _0x1377b0['status'](0x191)[_0xa55c('0x3d')]({'message':_0xa55c('0x55')});});}catch(_0x77d623){_0x22f6b6(_0x77d623);}}else if(_0x1c9f6b){_0x22f6b6();}else{return _0x1377b0[_0xa55c('0x3a')](0x193)[_0xa55c('0x3d')]({'message':_0xa55c('0x56')});}})['use'](function(_0x386e34,_0x5ee63d,_0x57a972){if(_0x386e34[_0xa55c('0x37')]){db[_0xa55c('0x43')]['find']({'where':{'id':_0x386e34[_0xa55c('0x37')]['id']},'attributes':userAttributes})['then'](function(_0x5f25f7){if(!_0x5f25f7){return _0x5ee63d[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x57')});}_0x386e34['user']=_0x5f25f7;_0x57a972();})[_0xa55c('0x49')](function(_0xd5a006){_0x57a972(_0xd5a006);});}else if(_0x1c9f6b){_0x57a972();}else{return _0x5ee63d['status'](0x194)[_0xa55c('0x3d')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xa55c('0x58')]=function canUpdate(){return compose()[_0xa55c('0x36')](function(_0x5be43f,_0x66d1de,_0x1dae70){return licenseUtil['getLicense']()[_0xa55c('0x39')](function(_0x187e09){if(_0x187e09[_0xa55c('0x59')]){_0x1dae70();}else{return _0x66d1de['status'](0x193)[_0xa55c('0x3d')]({'message':'Forbidden'});}})[_0xa55c('0x49')](function(_0x3a8af4){_0x1dae70(_0x3a8af4);});});};exports[_0xa55c('0x5a')]=function isWebrtcLicence(){return compose()['use'](function(_0x41eab1,_0x106adb,_0x592429){return licenseUtil[_0xa55c('0x5b')]()[_0xa55c('0x39')](function(_0x5d5cf6){if(_0x5d5cf6[_0xa55c('0x5c')]){_0x592429();}else{return _0x106adb[_0xa55c('0x3a')](0x193)['json']({'message':_0xa55c('0x5d')});}})[_0xa55c('0x49')](function(_0x219a68){_0x592429(_0x219a68);});});};exports[_0xa55c('0x5e')]=function(_0x564cb3,_0x143989,_0x58a7ea){_0x564cb3[_0xa55c('0x5e')]=!![];return _0x58a7ea();};exports[_0xa55c('0x5f')]=function signToken(_0x194a79){return signJwt(_0x194a79);};exports['setTokenCookie']=function(_0x39bd3d,_0x250b00){if(!_0x39bd3d['user']){return _0x250b00[_0xa55c('0x3a')](0x194)[_0xa55c('0x3d')]({'message':_0xa55c('0x60')});}var _0xcd78c5={'payload':{'id':_0x39bd3d[_0xa55c('0x37')]['id'],'role':_0x39bd3d[_0xa55c('0x37')][_0xa55c('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0xcd78c5)[_0xa55c('0x39')](function(_0x3c147b){_0x250b00[_0xa55c('0x61')]('motion.token',_0x3c147b);_0x250b00[_0xa55c('0x62')](_0xa55c('0x63'));})[_0xa55c('0x49')](function(_0x4f73b6){return _0x250b00[_0xa55c('0x3a')](0x1f4)[_0xa55c('0x64')](_0x4f73b6);});};exports['retrieveApiKey']=function(_0x21b760){if(_['isNil'](_0x21b760[_0xa55c('0x50')])||_[_0xa55c('0x65')](_0x21b760[_0xa55c('0x66')])){return null;}else{return createJwt(_0x21b760);}};exports[_0xa55c('0x67')]=function(_0x2ecf79){_0x2ecf79['apiKeyNonce']=generateNonce();_0x2ecf79[_0xa55c('0x66')]=generateIssuedAt();return createJwt(_0x2ecf79);};exports[_0xa55c('0x68')]=function(_0x4b85cc,_0x3929a6){var _0x2291e0=_0x4b85cc[_0xa55c('0x4a')][_0xa55c('0x4b')];if(_0x2291e0){var _0x50176b={'nonce':_0x3929a6['apiKeyNonce'],'iat':_0x3929a6[_0xa55c('0x66')],'audience':hardwareConf[_0xa55c('0x4c')](),'issuer':hardwareConf[_0xa55c('0x4c')]()};return verifyJwt(_0x2291e0,_0x50176b)[_0xa55c('0x39')](function(){return generateApiKey(_0x3929a6);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0xa55c('0x69')]=function(_0x5ce463){var _0x2742e4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2742e4[_0xa55c('0x6a')](_0x5ce463))throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0xa55c('0x6d'));return;};exports['validatePasswordHistory']=function(_0x1cb73b,_0x54f776,_0x23f67f){var _0x157afe=encryptor[_0xa55c('0x6e')](_0x54f776)[_0xa55c('0x6f')](',');for(var _0x19aaf5=0x0;_0x19aaf5<_0x23f67f;_0x19aaf5++){if(!_0x157afe[_0x19aaf5])break;if(_0x1cb73b[_0xa55c('0x70')]()===_0x157afe[_0x19aaf5][_0xa55c('0x70')]()){var _0x53e2be=util[_0xa55c('0x71')](_0xa55c('0x72'),_0x23f67f);if(_0x23f67f===0x1){_0x53e2be=_0xa55c('0x73');}throw new db[(_0xa55c('0x6b'))][(_0xa55c('0x6c'))](_0x53e2be);}}return;};exports['updatePasswordsHistory']=function(_0xa72718,_0x3cd40d){var _0x28bac4=_0x3cd40d?encryptor[_0xa55c('0x6e')](_0x3cd40d)[_0xa55c('0x6f')](','):[];if(_0x28bac4['length']===0x5){_0x28bac4[_0xa55c('0x74')](-0x1,0x1);}_0x28bac4[_0xa55c('0x75')](_0xa72718);return encryptor[_0xa55c('0x76')](_0x28bac4[_0xa55c('0x77')](','));};function signJwt(_0x3ba56d){var _0x480dfc=BPromise[_0xa55c('0x78')](jwt['sign'],{'context':jwt});var _0x2e482a=_0x3ba56d['secret']||config[_0xa55c('0xa')]['session'];return new BPromise(function(_0x34edc5,_0x1333da){_0x480dfc(_0x3ba56d[_0xa55c('0x79')],_0x2e482a,_0x3ba56d[_0xa55c('0x7a')])[_0xa55c('0x39')](function(_0x3a5a52){_0x34edc5(_0x3a5a52);})[_0xa55c('0x49')](function(_0x2f2226){_0x1333da(_0x2f2226);});});}function verifyJwt(_0x14b515,_0x1acf50,_0x51c736){var _0x150a07=BPromise[_0xa55c('0x78')](jwt['verify'],{'context':jwt});var _0x18b928=_0x51c736||config[_0xa55c('0xa')][_0xa55c('0x7b')];return new BPromise(function(_0x9fe234,_0x1b8b06){_0x150a07(_0x14b515,_0x18b928,_0x1acf50)[_0xa55c('0x39')](function(_0x3cef1f){_0x9fe234(_0x3cef1f);})[_0xa55c('0x49')](function(_0x47de0a){_0x1b8b06(_0x47de0a);});});}function generateNonce(){return crypto[_0xa55c('0x7c')](0x10)[_0xa55c('0x7d')](_0xa55c('0x7e'));}function generateIssuedAt(){return Math[_0xa55c('0x7f')](Date[_0xa55c('0x80')]()/0x3e8)[_0xa55c('0x7d')]();}function createJwt(_0x2f1237){var _0x4249c1={'payload':{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237['apiKeyNonce']},'options':{'algorithm':_0xa55c('0x81'),'subject':_0x2f1237['id'][_0xa55c('0x7d')](),'issuer':hardwareConf[_0xa55c('0x4c')](),'audience':hardwareConf[_0xa55c('0x4c')]()}};return signJwt(_0x4249c1)[_0xa55c('0x39')](function(_0x10e711){return{'iat':_0x2f1237[_0xa55c('0x66')],'nonce':_0x2f1237[_0xa55c('0x50')],'token':_0x10e711};});} \ No newline at end of file diff --git a/server/components/contacts/index.js b/server/components/contacts/index.js index 3d949b9..01625c2 100644 --- a/server/components/contacts/index.js +++ b/server/components/contacts/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['tags','skip','tag','count','getFilteredContacts','catch','CmContact','keys','cf_','map','findOne','all','length','type','lodash','../../mysqldb','skipContactsQuery','resolve','getContactsSubquery','then','search','parseAdvancedSearchFilter','parseQueryParameters','where','default','fields','filter','user','clause'];(function(_0x3a3c80,_0x3b403a){var _0x29d920=function(_0x519764){while(--_0x519764){_0x3a3c80['push'](_0x3a3c80['shift']());}};_0x29d920(++_0x3b403a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1ad07b,_0x551d55){_0x1ad07b=_0x1ad07b-0x0;var _0x2c447f=_0x0b0e[_0x1ad07b];return _0x2c447f;};'use strict';var _=require(_0xe0b0('0x0'));var sqlUtils=require('./sql-utils');var db=require(_0xe0b0('0x1'))['db'];exports['findAll']=function(_0x7e5a8a,_0xdf715e,_0x3b5e2b,_0x25153a){var _0x28040c={'count':0x0,'rows':[]};var _0x38a058=sqlUtils[_0xe0b0('0x2')](_0xdf715e,_0x7e5a8a);if(_0x38a058){return Promise[_0xe0b0('0x3')](_0x28040c);}var _0x30e20d=sqlUtils[_0xe0b0('0x4')]();var _0x219b1c={};var _0x5cf9cc=![];var _0x50be7f=![];return Promise[_0xe0b0('0x3')]()[_0xe0b0('0x5')](function(){if(_0x7e5a8a[_0xe0b0('0x6')]){return sqlUtils[_0xe0b0('0x7')](_0x7e5a8a['search'],_0x25153a);}else{return sqlUtils[_0xe0b0('0x8')](_0x7e5a8a,_0x25153a);}})[_0xe0b0('0x5')](function(_0x553d4f){_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xa')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xb')]);_0x30e20d[_0xe0b0('0x9')](_0x553d4f[_0xe0b0('0xc')]);_0x30e20d['where'](_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0xe')]);_0x219b1c=_0x553d4f[_0xe0b0('0xf')];_0x50be7f=_0x553d4f[_0xe0b0('0xd')][_0xe0b0('0x10')];return sqlUtils['checkListsRestrictions'](_0xdf715e,_0x7e5a8a,_0x50be7f);})[_0xe0b0('0x5')](function(_0x154de6){_0x30e20d[_0xe0b0('0x9')](_0x154de6);var _0x24babd=_0x7e5a8a[_0xe0b0('0x6')]?_0x219b1c['ids']:_0x7e5a8a[_0xe0b0('0x11')];_0x5cf9cc=_0x24babd?!![]:![];return sqlUtils['countFilteredContacts'](_0x30e20d,_0x24babd);})[_0xe0b0('0x5')](function(_0xadee6e){_0x28040c['count']=_0xadee6e;if(_0x28040c[_0xe0b0('0x12')]===0x0){return;}return sqlUtils['buildContactsQuery'](_0x30e20d,_0x7e5a8a[_0xe0b0('0xb')],_0x3b5e2b,_0x5cf9cc,_0x219b1c[_0xe0b0('0xe')],_0x50be7f);})['then'](function(_0x54a3eb){if(!_0x54a3eb){return[];}return sqlUtils[_0xe0b0('0x13')](_0x54a3eb,_0x7e5a8a,_0x3b5e2b);})['then'](function(_0x4df8da){_0x28040c['rows']=_0x4df8da;return _0x28040c;})[_0xe0b0('0x14')](function(_0x50fa4a){throw _0x50fa4a;});};exports['describe']=function(){var _0x10cde1={};var _0x59dff5=[];return db[_0xe0b0('0x15')]['describe']()[_0xe0b0('0x5')](function(_0x1cd7c4){_0x10cde1=_0x1cd7c4;var _0x3e10b3=Object[_0xe0b0('0x16')](_0x10cde1)[_0xe0b0('0xc')](function(_0x58b804){return _['startsWith'](_0x58b804,_0xe0b0('0x17'))?_0x58b804:undefined;});var _0x5512bb=_0x3e10b3[_0xe0b0('0x18')](function(_0x31b5f8){return db['CmCustomField'][_0xe0b0('0x19')]({'where':{'id':_0x31b5f8['slice'](0x3)},'raw':!![]});});return Promise[_0xe0b0('0x1a')](_0x5512bb);})['then'](function(_0x28586d){for(var _0x576352=0x0;_0x576352<_0x28586d[_0xe0b0('0x1b')];_0x576352++){if(_0x28586d[_0x576352]){var _0x4de537=_0xe0b0('0x17')+_0x28586d[_0x576352]['id'];_0x10cde1[_0x4de537]['fieldType']=_0x28586d[_0x576352][_0xe0b0('0x1c')];}}_0x59dff5=_['map'](Object[_0xe0b0('0x16')](_0x10cde1),function(_0x3c3bc2){return{'name':_0x3c3bc2,'type':_0x10cde1[_0x3c3bc2][_0xe0b0('0x1c')]};});return _0x59dff5;})[_0xe0b0('0x14')](function(_0x3ec2){throw _0x3ec2;});}; \ No newline at end of file +var _0xbaf0=['skip','ids','tag','countFilteredContacts','count','buildContactsQuery','getFilteredContacts','rows','catch','CmContact','describe','keys','startsWith','slice','length','cf_','type','map','./sql-utils','../../mysqldb','findAll','skipContactsQuery','resolve','getContactsSubquery','then','parseAdvancedSearchFilter','search','parseQueryParameters','where','default','fields','filter','clause','tags','user'];(function(_0x17e472,_0x59989f){var _0x6808d5=function(_0xdc061c){while(--_0xdc061c){_0x17e472['push'](_0x17e472['shift']());}};_0x6808d5(++_0x59989f);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbaf0[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var sqlUtils=require(_0x0baf('0x0'));var db=require(_0x0baf('0x1'))['db'];exports[_0x0baf('0x2')]=function(_0x263f79,_0x1688bc,_0x4d2e72,_0x5a3e42){var _0x232cc7={'count':0x0,'rows':[]};var _0x1c383e=sqlUtils[_0x0baf('0x3')](_0x1688bc,_0x263f79);if(_0x1c383e){return Promise[_0x0baf('0x4')](_0x232cc7);}var _0xe4c3c4=sqlUtils[_0x0baf('0x5')]();var _0x1a10b1={};var _0x2dcaac=![];var _0x1d0a0d=![];return Promise['resolve']()[_0x0baf('0x6')](function(){if(_0x263f79['search']){return sqlUtils[_0x0baf('0x7')](_0x263f79[_0x0baf('0x8')],_0x5a3e42);}else{return sqlUtils[_0x0baf('0x9')](_0x263f79,_0x5a3e42);}})[_0x0baf('0x6')](function(_0x7f54d4){_0xe4c3c4[_0x0baf('0xa')](_0x7f54d4[_0x0baf('0xb')]);_0xe4c3c4[_0x0baf('0xa')](_0x7f54d4[_0x0baf('0xc')]);_0xe4c3c4[_0x0baf('0xa')](_0x7f54d4[_0x0baf('0xd')]);_0xe4c3c4['where'](_0x7f54d4['user'][_0x0baf('0xe')]);_0x1a10b1=_0x7f54d4[_0x0baf('0xf')];_0x1d0a0d=_0x7f54d4[_0x0baf('0x10')][_0x0baf('0x11')];return sqlUtils['checkListsRestrictions'](_0x1688bc,_0x263f79,_0x1d0a0d);})[_0x0baf('0x6')](function(_0x49e44b){_0xe4c3c4[_0x0baf('0xa')](_0x49e44b);var _0x1f50c3=_0x263f79[_0x0baf('0x8')]?_0x1a10b1[_0x0baf('0x12')]:_0x263f79[_0x0baf('0x13')];_0x2dcaac=_0x1f50c3?!![]:![];return sqlUtils[_0x0baf('0x14')](_0xe4c3c4,_0x1f50c3);})['then'](function(_0x4cd79d){_0x232cc7[_0x0baf('0x15')]=_0x4cd79d;if(_0x232cc7[_0x0baf('0x15')]===0x0){return;}return sqlUtils[_0x0baf('0x16')](_0xe4c3c4,_0x263f79[_0x0baf('0xc')],_0x4d2e72,_0x2dcaac,_0x1a10b1[_0x0baf('0xe')],_0x1d0a0d);})[_0x0baf('0x6')](function(_0x53c338){if(!_0x53c338){return[];}return sqlUtils[_0x0baf('0x17')](_0x53c338,_0x263f79,_0x4d2e72);})[_0x0baf('0x6')](function(_0x1ef0e5){_0x232cc7[_0x0baf('0x18')]=_0x1ef0e5;return _0x232cc7;})[_0x0baf('0x19')](function(_0x42b7f2){throw _0x42b7f2;});};exports['describe']=function(){var _0x5cff5d={};var _0x1410ec=[];return db[_0x0baf('0x1a')][_0x0baf('0x1b')]()[_0x0baf('0x6')](function(_0x1fa92b){_0x5cff5d=_0x1fa92b;var _0x3e3e20=Object[_0x0baf('0x1c')](_0x5cff5d)[_0x0baf('0xd')](function(_0x2c42e2){return _[_0x0baf('0x1d')](_0x2c42e2,'cf_')?_0x2c42e2:undefined;});var _0x334bd6=_0x3e3e20['map'](function(_0xf6c158){return db['CmCustomField']['findOne']({'where':{'id':_0xf6c158[_0x0baf('0x1e')](0x3)},'raw':!![]});});return Promise['all'](_0x334bd6);})['then'](function(_0x47c4b){for(var _0x27b59c=0x0;_0x27b59c<_0x47c4b[_0x0baf('0x1f')];_0x27b59c++){if(_0x47c4b[_0x27b59c]){var _0x19d9fd=_0x0baf('0x20')+_0x47c4b[_0x27b59c]['id'];_0x5cff5d[_0x19d9fd]['fieldType']=_0x47c4b[_0x27b59c][_0x0baf('0x21')];}}_0x1410ec=_[_0x0baf('0x22')](Object[_0x0baf('0x1c')](_0x5cff5d),function(_0x366e71){return{'name':_0x366e71,'type':_0x5cff5d[_0x366e71][_0x0baf('0x21')]};});return _0x1410ec;})[_0x0baf('0x19')](function(_0x453525){throw _0x453525;});}; \ No newline at end of file diff --git a/server/components/contacts/sql-utils.js b/server/components/contacts/sql-utils.js index 57f137f..d43c21d 100644 --- a/server/components/contacts/sql-utils.js +++ b/server/components/contacts/sql-utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7bf9=['text','value','end','Tag','map','tags','clause','ids','user','skip','compact','Contact','ListId','c.ListId\x20IN\x20?','concat','and','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','role','getLists','c.ListId\x20IS\x20NULL','c.id','limit','subqry.id','offset','having','order','DESC','subqry.','findAll','QueryTypes','SELECT','CmContact','sequelize','Tags','clone','COUNT(*)','group','getSelectedTags','isEmpty','query','toString','exports','squel','../parsers/qs','../interaction/utils','../../mysqldb','agent','search','autocomplete','true','select','from','cm_contacts','c.deletedAt\x20IS\x20NULL','subqry','left_join','cm_user_has_contacts','.id','cm_contact_has_tags','ct.CmContactId\x20=\x20','tools_tags','t.id\x20=\x20ct.TagId','firstName','phone','fax','CompanyId','createdAt','updatedAt','deletedAt','TagIds','push','forEach','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','replace','split','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','parseSearch','conditions','name','dateOfBirth','fieldType','datetime','castTo','DATE','buildExpression','type','default'];(function(_0x566876,_0x4dbd73){var _0x5abe45=function(_0x2aca50){while(--_0x2aca50){_0x566876['push'](_0x566876['shift']());}};_0x5abe45(++_0x4dbd73);}(_0x7bf9,0x100));var _0x97bf=function(_0x3abd17,_0xde01c3){_0x3abd17=_0x3abd17-0x0;var _0x3e1006=_0x7bf9[_0x3abd17];return _0x3e1006;};'use strict';var _=require('lodash');var squel=require(_0x97bf('0x0'));var as=require('../parsers/advancedSearch');var qs=require(_0x97bf('0x1'));var utils=require(_0x97bf('0x2'));var db=require(_0x97bf('0x3'))['db'];function skipContactsQuery(_0x201726,_0x2482b1){var _0x5a160d=![];if(_0x201726['role']===_0x97bf('0x4')&&!_0x2482b1[_0x97bf('0x5')]&&!_0x2482b1['ListId']&&_0x2482b1[_0x97bf('0x6')]!==_0x97bf('0x7')){_0x5a160d=!![];}return _0x5a160d;}function getContactsSubquery(){return squel[_0x97bf('0x8')]()[_0x97bf('0x9')](_0x97bf('0xa'),'c')['where'](_0x97bf('0xb'));}function applyJoinClauses(_0x347dc5,_0x43af07){var _0x3abe3c=_0x43af07?'c':_0x97bf('0xc');_0x347dc5[_0x97bf('0xd')](_0x97bf('0xe'),'uc','uc.CmContactId\x20=\x20'+_0x3abe3c+_0x97bf('0xf'))[_0x97bf('0xd')](_0x97bf('0x10'),'ct',_0x97bf('0x11')+_0x3abe3c+_0x97bf('0xf'))[_0x97bf('0xd')](_0x97bf('0x12'),'t',_0x97bf('0x13'));return _0x347dc5;}function addFieldsToQuery(_0x20a011,_0x25dbe2,_0x2bb0a4,_0x3361ff,_0x26bd21){var _0x415409=_0x26bd21?'c':_0x97bf('0xc');if(!_0x25dbe2){_0x25dbe2=['id',_0x97bf('0x14'),'lastName',_0x97bf('0x15'),'mobile',_0x97bf('0x16'),'email','ListId',_0x97bf('0x17'),_0x97bf('0x18'),_0x97bf('0x19'),_0x97bf('0x1a'),_0x97bf('0x1b')];}else if(!_0x25dbe2['includes']('id')){_0x25dbe2[_0x97bf('0x1c')]('id');}var _0x2401f9=_0x2bb0a4&&_0x26bd21||!_0x2bb0a4&&!_0x26bd21;if(_0x3361ff){_0x2401f9=_0x3361ff&&_0x26bd21||!_0x3361ff&&!_0x26bd21;}_0x25dbe2[_0x97bf('0x1d')](function(_0x17b409){if(_0x17b409===_0x97bf('0x1b')){if(_0x2401f9){_0x20a011['field'](_0x97bf('0x1e'),_0x17b409);}else if(_0x2bb0a4||_0x3361ff){_0x20a011[_0x97bf('0x1f')](_0x415409+'.'+_0x17b409);}}else{_0x20a011[_0x97bf('0x1f')](_0x415409+'.'+_0x17b409);}});return _0x20a011;}function getSqlClauses(){var _0x26d362={'default':squel[_0x97bf('0x20')](),'fields':squel[_0x97bf('0x20')](),'filter':squel[_0x97bf('0x20')](),'tags':{'clause':squel[_0x97bf('0x20')](),'ids':null},'user':{'clause':squel[_0x97bf('0x20')](),'skip':![]}};return _0x26d362;}function parseTagParameter(_0x26f6a9){var _0x28f344=squel[_0x97bf('0x20')]();if(_0x26f6a9){var _0x2e38f4=utils['getSelectedTags'](_0x26f6a9);_0x2e38f4[_0x97bf('0x1d')](function(_0x2ce570){_0x28f344['or']('CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2ce570+',%');});}return _0x28f344;}function parseSearchFilter(_0x59303e){var _0x23752d=squel['expr']();if(_0x59303e){var _0x4c9326=_0x59303e[_0x97bf('0x21')]('\x5c','\x5c\x5c')[_0x97bf('0x21')](/'/g,'\x27\x27');if(_0x4c9326[_0x97bf('0x22')]('\x20')[_0x97bf('0x23')]>0x1){_0x23752d['or'](_0x97bf('0x24'),qs[_0x97bf('0x25')](_0x4c9326),null);}else{if(qs[_0x97bf('0x26')](_0x4c9326)){_0x23752d['or'](_0x97bf('0x27'),_0x4c9326+'%');_0x23752d['or'](_0x97bf('0x28'),_0x4c9326+'%');_0x23752d['or'](_0x97bf('0x29'),_0x4c9326+'%');_0x23752d['or'](_0x97bf('0x2a'),_0x4c9326+'%');}else if(qs[_0x97bf('0x2b')](_0x4c9326)){_0x23752d['or'](_0x97bf('0x2c'),_0x4c9326+'%');}else{_0x23752d['or']('c.firstName\x20LIKE\x20?','%'+_0x4c9326+'%');_0x23752d['or']('c.lastName\x20LIKE\x20?','%'+_0x4c9326+'%');_0x23752d['or'](_0x97bf('0x2c'),'%'+_0x4c9326+'%');}}}return _0x23752d;}function parseAdvancedSearchFilter(_0x475cce,_0x21e13d){var _0x483b3a=getSqlClauses();var _0x4bc161=as[_0x97bf('0x2d')](_0x475cce);var _0x3bef9d=_0x4bc161['sqlOperator'];for(var _0x5ef9ce=0x0;_0x5ef9ce<_0x4bc161['conditions'][_0x97bf('0x23')];_0x5ef9ce++){var _0x7fce3d=_0x4bc161[_0x97bf('0x2e')][_0x5ef9ce];var _0x44b98b='c';var _0x1fee58=_['find'](_0x21e13d,[_0x97bf('0x2f'),_0x7fce3d[_0x97bf('0x1f')]]);if(_0x1fee58){if(_0x7fce3d[_0x97bf('0x1f')]===_0x97bf('0x30')||_0x1fee58[_0x97bf('0x31')]===_0x97bf('0x32')){_0x7fce3d[_0x97bf('0x33')]=_0x97bf('0x34');}var _0x1d64e9=as[_0x97bf('0x35')](_0x44b98b,_0x1fee58[_0x97bf('0x36')],_0x7fce3d);_0x483b3a[_0x97bf('0x37')][_0x3bef9d](_0x1d64e9[_0x97bf('0x38')],_0x1d64e9[_0x97bf('0x39')]['start'],_0x1d64e9['value'][_0x97bf('0x3a')]);}else{if(_0x7fce3d[_0x97bf('0x1f')]===_0x97bf('0x3b')){var _0x413d0e=_0x7fce3d['value'][_0x97bf('0x22')](',')[_0x97bf('0x3c')](function(_0x4f25cd){return Number(_0x4f25cd);});var _0x2d4c12=parseTagParameter(_0x413d0e);_0x483b3a[_0x97bf('0x3d')][_0x97bf('0x3e')]['and'](_0x2d4c12);_0x483b3a[_0x97bf('0x3d')][_0x97bf('0x3f')]=_0x413d0e;}else if(_0x7fce3d['field']==='User'){_0x483b3a[_0x97bf('0x40')]['clause']['and']('uc.UserId\x20=\x20?',_0x7fce3d['value']);_0x483b3a[_0x97bf('0x40')][_0x97bf('0x41')]=!![];}}}return _0x483b3a;}function parseModelFields(_0x874b20,_0x54a345){var _0x40340a=squel[_0x97bf('0x20')]();var _0x2d8ba8=_(_0x874b20)['keys']()['map'](function(_0x23b53a){return _['some'](_0x54a345,[_0x97bf('0x2f'),_0x23b53a])?_0x23b53a:undefined;})[_0x97bf('0x42')]()['value']();if(_0x874b20[_0x97bf('0x43')]){_0x2d8ba8[_0x97bf('0x1c')](_0x97bf('0x43'));}if(_0x2d8ba8['length']>0x0){_0x2d8ba8['forEach'](function(_0x41abf2){if(_0x41abf2===_0x97bf('0x44')){_0x40340a['and'](_0x97bf('0x45'),[][_0x97bf('0x46')](_0x874b20[_0x41abf2]));}else if(_0x41abf2==='Contact'){var _0x40cd23='%'+_0x874b20[_0x41abf2]+'%';_0x40340a[_0x97bf('0x47')](_0x97bf('0x48'),_0x40cd23);}else{_0x40340a[_0x97bf('0x47')]('c.'+_0x41abf2+_0x97bf('0x49'),_0x874b20[_0x41abf2]);}});}return _0x40340a;}function parseQueryParameters(_0x67a217,_0x1f9a71){var _0x4285db=getSqlClauses();return Promise[_0x97bf('0x4a')]()[_0x97bf('0x4b')](function(){return parseModelFields(_0x67a217,_0x1f9a71);})[_0x97bf('0x4b')](function(_0x1f72dc){_0x4285db[_0x97bf('0x4c')][_0x97bf('0x47')](_0x1f72dc);return parseTagParameter(_0x67a217[_0x97bf('0x4d')]);})[_0x97bf('0x4b')](function(_0x1d3ecd){_0x4285db['tags'][_0x97bf('0x3e')]['and'](_0x1d3ecd);return parseSearchFilter(_0x67a217['filter']);})['then'](function(_0x53b7f6){_0x4285db[_0x97bf('0x4e')]=_0x53b7f6;return _0x4285db;});}function checkListsRestrictions(_0x3aab0a,_0x495392,_0x2051f1){var _0x163b69=squel[_0x97bf('0x20')]();return Promise['resolve']()[_0x97bf('0x4b')](function(){if(_0x495392['search']&&_0x3aab0a[_0x97bf('0x4f')]===_0x97bf('0x4')&&!_0x2051f1){return _0x3aab0a[_0x97bf('0x50')]({'attributes':['id'],'raw':!![]});}})['then'](function(_0x304f7e){if(_0x304f7e){if(_0x304f7e[_0x97bf('0x23')]===0x0){_0x163b69['and'](_0x97bf('0x51'));}else{_0x163b69[_0x97bf('0x47')](_0x97bf('0x45'),_['map'](_0x304f7e,'id'));}}})[_0x97bf('0x4b')](function(){return _0x163b69;});}function buildContactsQuery(_0x4b373f,_0x2b8364,_0x124054,_0x26d30e,_0x5d911a,_0x28c6fa){if(_0x2b8364){_0x2b8364=_0x124054['attributes'];}_0x4b373f=addFieldsToQuery(_0x4b373f,_0x2b8364,_0x26d30e,_0x28c6fa,!![]);var _0x198a75=squel[_0x97bf('0x8')]();_0x198a75=addFieldsToQuery(_0x198a75,_0x2b8364,_0x26d30e,_0x28c6fa,![]);if(_0x26d30e||_0x28c6fa){_0x4b373f=applyJoinClauses(_0x4b373f,!![]);_0x4b373f['group'](_0x97bf('0x52'));if(_0x124054[_0x97bf('0x53')]){_0x198a75['limit'](_0x124054[_0x97bf('0x53')]);}if(_0x124054['offset']){_0x198a75['offset'](_0x124054['offset']);}}else{_0x198a75=applyJoinClauses(_0x198a75,![]);_0x198a75['group'](_0x97bf('0x54'));if(_0x124054[_0x97bf('0x53')]){_0x4b373f[_0x97bf('0x53')](_0x124054[_0x97bf('0x53')]);}if(_0x124054['offset']){_0x4b373f['offset'](_0x124054[_0x97bf('0x55')]);}}_0x198a75[_0x97bf('0x56')](_0x5d911a);if(_0x124054[_0x97bf('0x57')]){_0x124054['order'][_0x97bf('0x1d')](function(_0x116a3f){_0x4b373f[_0x97bf('0x57')]('c.'+_0x116a3f[0x0],_0x116a3f[0x1]===_0x97bf('0x58')?![]:!![]);_0x198a75[_0x97bf('0x57')](_0x97bf('0x59')+_0x116a3f[0x0],_0x116a3f[0x1]==='DESC'?![]:!![]);});}_0x198a75['from'](_0x4b373f,_0x97bf('0xc'));return _0x198a75;}function getFilteredContacts(_0x36af27){var _0x447a3e=[];return db[_0x97bf('0x3b')][_0x97bf('0x5a')]({'attributes':['id',_0x97bf('0x2f'),'color'],'raw':!![]})['then'](function(_0x3eb607){_0x447a3e=_['keyBy'](_0x3eb607,'id');var _0x109d74={'type':db['Sequelize'][_0x97bf('0x5b')][_0x97bf('0x5c')],'model':db[_0x97bf('0x5d')],'mapToModel':!![],'nest':!![],'raw':!![]};return db[_0x97bf('0x5e')]['query'](_0x36af27['toString'](),_0x109d74);})[_0x97bf('0x4b')](function(_0x3b7a47){_0x3b7a47[_0x97bf('0x1d')](function(_0x2f3ee1){if(_0x2f3ee1[_0x97bf('0x1b')]){_0x2f3ee1[_0x97bf('0x5f')]=[];_0x2f3ee1['TagIds']['split'](',')[_0x97bf('0x1d')](function(_0x46b6e6){_0x2f3ee1[_0x97bf('0x5f')][_0x97bf('0x1c')](_0x447a3e[_0x46b6e6]);});}delete _0x2f3ee1[_0x97bf('0x1b')];});return _0x3b7a47;});}function countFilteredContacts(_0x399064,_0x1a98b2){var _0x21c906=_0x399064[_0x97bf('0x60')]();_0x21c906[_0x97bf('0x1f')](_0x97bf('0x61'));_0x21c906=applyJoinClauses(_0x21c906,!![]);_0x399064[_0x97bf('0x62')](_0x97bf('0x52'));var _0x2ca71f=utils[_0x97bf('0x63')](_0x1a98b2);if(!_[_0x97bf('0x64')](_0x2ca71f)){_0x21c906['where']('t.id\x20IN\x20?',_0x2ca71f);}var _0x145d07={'type':db['Sequelize'][_0x97bf('0x5b')][_0x97bf('0x5c')],'raw':!![]};return db[_0x97bf('0x5e')][_0x97bf('0x65')](_0x21c906[_0x97bf('0x66')](),_0x145d07)[_0x97bf('0x4b')](function(_0x2d00c2){return _0x2d00c2[0x0][_0x97bf('0x61')];});}module[_0x97bf('0x67')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file +var _0xb629=['c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','parseSearch','name','dateOfBirth','castTo','DATE','buildExpression','start','value','end','Tag','map','tags','clause','ids','user','and','skip','compact','Contact','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','resolve','then','fields','tag','filter','getLists','c.ListId\x20IS\x20NULL','group','c.id','limit','offset','order','DESC','findAll','color','keyBy','QueryTypes','CmContact','query','toString','Tags','clone','COUNT(*)','t.id\x20IN\x20?','sequelize','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','../../mysqldb','role','agent','search','ListId','autocomplete','select','from','where','c.deletedAt\x20IS\x20NULL','left_join','cm_user_has_contacts','ct.CmContactId\x20=\x20','.id','tools_tags','t.id\x20=\x20ct.TagId','subqry','lastName','phone','fax','email','updatedAt','deletedAt','TagIds','includes','push','GROUP_CONCAT(DISTINCT\x20t.id)','field','expr','getSelectedTags','forEach','CONCAT(\x27,\x27,\x20subqry.TagIds,\x20\x27,\x27)\x20LIKE\x20?','replace','split','length','getFullTextValue','isNumeric','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail'];(function(_0x3d0535,_0x253d07){var _0x5cb0e8=function(_0x24c7ba){while(--_0x24c7ba){_0x3d0535['push'](_0x3d0535['shift']());}};_0x5cb0e8(++_0x253d07);}(_0xb629,0x91));var _0x9b62=function(_0x350516,_0x139c24){_0x350516=_0x350516-0x0;var _0x5be443=_0xb629[_0x350516];return _0x5be443;};'use strict';var _=require(_0x9b62('0x0'));var squel=require(_0x9b62('0x1'));var as=require(_0x9b62('0x2'));var qs=require(_0x9b62('0x3'));var utils=require('../interaction/utils');var db=require(_0x9b62('0x4'))['db'];function skipContactsQuery(_0x43c0f8,_0x5bfc48){var _0x47e0ea=![];if(_0x43c0f8[_0x9b62('0x5')]===_0x9b62('0x6')&&!_0x5bfc48[_0x9b62('0x7')]&&!_0x5bfc48[_0x9b62('0x8')]&&_0x5bfc48[_0x9b62('0x9')]!=='true'){_0x47e0ea=!![];}return _0x47e0ea;}function getContactsSubquery(){return squel[_0x9b62('0xa')]()[_0x9b62('0xb')]('cm_contacts','c')[_0x9b62('0xc')](_0x9b62('0xd'));}function applyJoinClauses(_0x82b6cc,_0xdf7661){var _0x512e7e=_0xdf7661?'c':'subqry';_0x82b6cc[_0x9b62('0xe')](_0x9b62('0xf'),'uc','uc.CmContactId\x20=\x20'+_0x512e7e+'.id')[_0x9b62('0xe')]('cm_contact_has_tags','ct',_0x9b62('0x10')+_0x512e7e+_0x9b62('0x11'))[_0x9b62('0xe')](_0x9b62('0x12'),'t',_0x9b62('0x13'));return _0x82b6cc;}function addFieldsToQuery(_0x464523,_0x543b7a,_0x5671d6,_0x1562a2,_0x2adbbd){var _0x16e493=_0x2adbbd?'c':_0x9b62('0x14');if(!_0x543b7a){_0x543b7a=['id','firstName',_0x9b62('0x15'),_0x9b62('0x16'),'mobile',_0x9b62('0x17'),_0x9b62('0x18'),_0x9b62('0x8'),'CompanyId','createdAt',_0x9b62('0x19'),_0x9b62('0x1a'),_0x9b62('0x1b')];}else if(!_0x543b7a[_0x9b62('0x1c')]('id')){_0x543b7a[_0x9b62('0x1d')]('id');}var _0x1004a8=_0x5671d6&&_0x2adbbd||!_0x5671d6&&!_0x2adbbd;if(_0x1562a2){_0x1004a8=_0x1562a2&&_0x2adbbd||!_0x1562a2&&!_0x2adbbd;}_0x543b7a['forEach'](function(_0x1278a9){if(_0x1278a9===_0x9b62('0x1b')){if(_0x1004a8){_0x464523['field'](_0x9b62('0x1e'),_0x1278a9);}else if(_0x5671d6||_0x1562a2){_0x464523[_0x9b62('0x1f')](_0x16e493+'.'+_0x1278a9);}}else{_0x464523['field'](_0x16e493+'.'+_0x1278a9);}});return _0x464523;}function getSqlClauses(){var _0x19891f={'default':squel[_0x9b62('0x20')](),'fields':squel['expr'](),'filter':squel[_0x9b62('0x20')](),'tags':{'clause':squel[_0x9b62('0x20')](),'ids':null},'user':{'clause':squel[_0x9b62('0x20')](),'skip':![]}};return _0x19891f;}function parseTagParameter(_0x2fa1f8){var _0x4b2500=squel['expr']();if(_0x2fa1f8){var _0x2bd4f0=utils[_0x9b62('0x21')](_0x2fa1f8);_0x2bd4f0[_0x9b62('0x22')](function(_0xe6fe15){_0x4b2500['or'](_0x9b62('0x23'),'%,'+_0xe6fe15+',%');});}return _0x4b2500;}function parseSearchFilter(_0x40e5c4){var _0x6fa3a6=squel[_0x9b62('0x20')]();if(_0x40e5c4){var _0x431ba1=_0x40e5c4[_0x9b62('0x24')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(_0x431ba1[_0x9b62('0x25')]('\x20')[_0x9b62('0x26')]>0x1){_0x6fa3a6['or']('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x9b62('0x27')](_0x431ba1),null);}else{if(qs[_0x9b62('0x28')](_0x431ba1)){_0x6fa3a6['or']('c.id\x20LIKE\x20?',_0x431ba1+'%');_0x6fa3a6['or'](_0x9b62('0x29'),_0x431ba1+'%');_0x6fa3a6['or'](_0x9b62('0x2a'),_0x431ba1+'%');_0x6fa3a6['or'](_0x9b62('0x2b'),_0x431ba1+'%');}else if(qs[_0x9b62('0x2c')](_0x431ba1)){_0x6fa3a6['or'](_0x9b62('0x2d'),_0x431ba1+'%');}else{_0x6fa3a6['or'](_0x9b62('0x2e'),'%'+_0x431ba1+'%');_0x6fa3a6['or']('c.lastName\x20LIKE\x20?','%'+_0x431ba1+'%');_0x6fa3a6['or'](_0x9b62('0x2d'),'%'+_0x431ba1+'%');}}}return _0x6fa3a6;}function parseAdvancedSearchFilter(_0x4bfd3c,_0x306e03){var _0x15b0a5=getSqlClauses();var _0x3df86c=as[_0x9b62('0x2f')](_0x4bfd3c);var _0x1fac70=_0x3df86c['sqlOperator'];for(var _0x68236c=0x0;_0x68236c<_0x3df86c['conditions'][_0x9b62('0x26')];_0x68236c++){var _0x38395d=_0x3df86c['conditions'][_0x68236c];var _0x35fbf9='c';var _0x14aceb=_['find'](_0x306e03,[_0x9b62('0x30'),_0x38395d['field']]);if(_0x14aceb){if(_0x38395d[_0x9b62('0x1f')]===_0x9b62('0x31')||_0x14aceb['fieldType']==='datetime'){_0x38395d[_0x9b62('0x32')]=_0x9b62('0x33');}var _0x22ecab=as[_0x9b62('0x34')](_0x35fbf9,_0x14aceb['type'],_0x38395d);_0x15b0a5['default'][_0x1fac70](_0x22ecab['text'],_0x22ecab['value'][_0x9b62('0x35')],_0x22ecab[_0x9b62('0x36')][_0x9b62('0x37')]);}else{if(_0x38395d[_0x9b62('0x1f')]===_0x9b62('0x38')){var _0x57a5e1=_0x38395d[_0x9b62('0x36')]['split'](',')[_0x9b62('0x39')](function(_0x27841c){return Number(_0x27841c);});var _0x50929e=parseTagParameter(_0x57a5e1);_0x15b0a5[_0x9b62('0x3a')][_0x9b62('0x3b')]['and'](_0x50929e);_0x15b0a5[_0x9b62('0x3a')][_0x9b62('0x3c')]=_0x57a5e1;}else if(_0x38395d[_0x9b62('0x1f')]==='User'){_0x15b0a5[_0x9b62('0x3d')][_0x9b62('0x3b')][_0x9b62('0x3e')]('uc.UserId\x20=\x20?',_0x38395d[_0x9b62('0x36')]);_0x15b0a5['user'][_0x9b62('0x3f')]=!![];}}}return _0x15b0a5;}function parseModelFields(_0x4f3a1b,_0x5b16bf){var _0xeee4b9=squel[_0x9b62('0x20')]();var _0x3af8a3=_(_0x4f3a1b)['keys']()[_0x9b62('0x39')](function(_0x1c98da){return _['some'](_0x5b16bf,[_0x9b62('0x30'),_0x1c98da])?_0x1c98da:undefined;})[_0x9b62('0x40')]()['value']();if(_0x4f3a1b[_0x9b62('0x41')]){_0x3af8a3[_0x9b62('0x1d')]('Contact');}if(_0x3af8a3[_0x9b62('0x26')]>0x0){_0x3af8a3['forEach'](function(_0x598dba){if(_0x598dba==='ListId'){_0xeee4b9[_0x9b62('0x3e')]('c.ListId\x20IN\x20?',[][_0x9b62('0x42')](_0x4f3a1b[_0x598dba]));}else if(_0x598dba===_0x9b62('0x41')){var _0x3c1d78='%'+_0x4f3a1b[_0x598dba]+'%';_0xeee4b9['and'](_0x9b62('0x43'),_0x3c1d78);}else{_0xeee4b9[_0x9b62('0x3e')]('c.'+_0x598dba+_0x9b62('0x44'),_0x4f3a1b[_0x598dba]);}});}return _0xeee4b9;}function parseQueryParameters(_0x4f675a,_0x2554d5){var _0x36f2cc=getSqlClauses();return Promise[_0x9b62('0x45')]()[_0x9b62('0x46')](function(){return parseModelFields(_0x4f675a,_0x2554d5);})[_0x9b62('0x46')](function(_0x1faffb){_0x36f2cc[_0x9b62('0x47')]['and'](_0x1faffb);return parseTagParameter(_0x4f675a[_0x9b62('0x48')]);})['then'](function(_0x163b8f){_0x36f2cc[_0x9b62('0x3a')][_0x9b62('0x3b')][_0x9b62('0x3e')](_0x163b8f);return parseSearchFilter(_0x4f675a[_0x9b62('0x49')]);})[_0x9b62('0x46')](function(_0x180810){_0x36f2cc[_0x9b62('0x49')]=_0x180810;return _0x36f2cc;});}function checkListsRestrictions(_0x22e180,_0x3b1c4f,_0x3088b6){var _0x2b73c0=squel[_0x9b62('0x20')]();return Promise[_0x9b62('0x45')]()['then'](function(){if(_0x3b1c4f['search']&&_0x22e180[_0x9b62('0x5')]===_0x9b62('0x6')&&!_0x3088b6){return _0x22e180[_0x9b62('0x4a')]({'attributes':['id'],'raw':!![]});}})[_0x9b62('0x46')](function(_0x25e0c1){if(_0x25e0c1){if(_0x25e0c1[_0x9b62('0x26')]===0x0){_0x2b73c0[_0x9b62('0x3e')](_0x9b62('0x4b'));}else{_0x2b73c0[_0x9b62('0x3e')]('c.ListId\x20IN\x20?',_[_0x9b62('0x39')](_0x25e0c1,'id'));}}})[_0x9b62('0x46')](function(){return _0x2b73c0;});}function buildContactsQuery(_0x3e05ac,_0x155171,_0x5156fe,_0x44adde,_0x17e556,_0x467e85){if(_0x155171){_0x155171=_0x5156fe['attributes'];}_0x3e05ac=addFieldsToQuery(_0x3e05ac,_0x155171,_0x44adde,_0x467e85,!![]);var _0x22ac44=squel['select']();_0x22ac44=addFieldsToQuery(_0x22ac44,_0x155171,_0x44adde,_0x467e85,![]);if(_0x44adde||_0x467e85){_0x3e05ac=applyJoinClauses(_0x3e05ac,!![]);_0x3e05ac[_0x9b62('0x4c')](_0x9b62('0x4d'));if(_0x5156fe[_0x9b62('0x4e')]){_0x22ac44[_0x9b62('0x4e')](_0x5156fe[_0x9b62('0x4e')]);}if(_0x5156fe[_0x9b62('0x4f')]){_0x22ac44['offset'](_0x5156fe[_0x9b62('0x4f')]);}}else{_0x22ac44=applyJoinClauses(_0x22ac44,![]);_0x22ac44[_0x9b62('0x4c')]('subqry.id');if(_0x5156fe[_0x9b62('0x4e')]){_0x3e05ac['limit'](_0x5156fe[_0x9b62('0x4e')]);}if(_0x5156fe['offset']){_0x3e05ac['offset'](_0x5156fe['offset']);}}_0x22ac44['having'](_0x17e556);if(_0x5156fe[_0x9b62('0x50')]){_0x5156fe['order'][_0x9b62('0x22')](function(_0x27b555){_0x3e05ac[_0x9b62('0x50')]('c.'+_0x27b555[0x0],_0x27b555[0x1]===_0x9b62('0x51')?![]:!![]);_0x22ac44['order']('subqry.'+_0x27b555[0x0],_0x27b555[0x1]===_0x9b62('0x51')?![]:!![]);});}_0x22ac44[_0x9b62('0xb')](_0x3e05ac,'subqry');return _0x22ac44;}function getFilteredContacts(_0x1aefcc){var _0x93acc3=[];return db[_0x9b62('0x38')][_0x9b62('0x52')]({'attributes':['id',_0x9b62('0x30'),_0x9b62('0x53')],'raw':!![]})[_0x9b62('0x46')](function(_0x2e86aa){_0x93acc3=_[_0x9b62('0x54')](_0x2e86aa,'id');var _0x1fe053={'type':db['Sequelize'][_0x9b62('0x55')]['SELECT'],'model':db[_0x9b62('0x56')],'mapToModel':!![],'nest':!![],'raw':!![]};return db['sequelize'][_0x9b62('0x57')](_0x1aefcc[_0x9b62('0x58')](),_0x1fe053);})[_0x9b62('0x46')](function(_0x25d5be){_0x25d5be[_0x9b62('0x22')](function(_0x560f6a){if(_0x560f6a[_0x9b62('0x1b')]){_0x560f6a[_0x9b62('0x59')]=[];_0x560f6a[_0x9b62('0x1b')][_0x9b62('0x25')](',')[_0x9b62('0x22')](function(_0x4ad19f){_0x560f6a[_0x9b62('0x59')]['push'](_0x93acc3[_0x4ad19f]);});}delete _0x560f6a[_0x9b62('0x1b')];});return _0x25d5be;});}function countFilteredContacts(_0x164682,_0x36e988){var _0x2975af=_0x164682[_0x9b62('0x5a')]();_0x2975af[_0x9b62('0x1f')](_0x9b62('0x5b'));_0x2975af=applyJoinClauses(_0x2975af,!![]);_0x164682[_0x9b62('0x4c')](_0x9b62('0x4d'));var _0x6e4984=utils[_0x9b62('0x21')](_0x36e988);if(!_['isEmpty'](_0x6e4984)){_0x2975af[_0x9b62('0xc')](_0x9b62('0x5c'),_0x6e4984);}var _0x5b0918={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};return db[_0x9b62('0x5d')][_0x9b62('0x57')](_0x2975af[_0x9b62('0x58')](),_0x5b0918)[_0x9b62('0x46')](function(_0x151d89){return _0x151d89[0x0][_0x9b62('0x5b')];});}module[_0x9b62('0x5e')]={'buildContactsQuery':buildContactsQuery,'checkListsRestrictions':checkListsRestrictions,'countFilteredContacts':countFilteredContacts,'getContactsSubquery':getContactsSubquery,'getFilteredContacts':getFilteredContacts,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipContactsQuery':skipContactsQuery}; \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 08d64f5..0af6702 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 _0xb807=['base64','decryptString','crypto','lodash','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','indexOf','encryptFile','createReadStream','createWriteStream','createCipher','data','binary','write','end','final','close','unlink','decryptFile','createDecipher','update','encryptString','secret','utf8'];(function(_0x25680f,_0x49646a){var _0x135948=function(_0x4b6ebe){while(--_0x4b6ebe){_0x25680f['push'](_0x25680f['shift']());}};_0x135948(++_0x49646a);}(_0xb807,0x1bc));var _0x7b80=function(_0x3de8a2,_0x1c8615){_0x3de8a2=_0x3de8a2-0x0;var _0x267573=_0xb807[_0x3de8a2];return _0x267573;};'use strict';var crypto=require(_0x7b80('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0x7b80('0x1'));var config=require('../../config/environment');var logger=require(_0x7b80('0x2'))(_0x7b80('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x7b80('0x4')][_0x7b80('0x5')],'algorithm':_0x7b80('0x6')};const fileOptions={'algorithm':_0x7b80('0x7')};if(config[_0x7b80('0x8')]&&config[_0x7b80('0x8')][_0x7b80('0x9')]){var isSupported=isAlgorithmSupported(config[_0x7b80('0x8')][_0x7b80('0x9')]);if(isSupported){fileOptions[_0x7b80('0x9')]=config[_0x7b80('0x8')][_0x7b80('0x9')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x7b80('0xa')](',\x20');logger['error'](config[_0x7b80('0x8')][_0x7b80('0x9')],_0x7b80('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x1781a7){return AES_SUPPORTED_RX[_0x7b80('0xc')](_0x1781a7);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x7b80('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0xdaa294){return getSupportedCiphers()[_0x7b80('0xe')](_0xdaa294)>-0x1;}function combineOptions(_0x4ee208){var _0x5a0e6a={};for(var _0x2ba638 in fileOptions){if(fileOptions['hasOwnProperty'](_0x2ba638)){_0x5a0e6a[_0x2ba638]=fileOptions[_0x2ba638];}}if(_0x4ee208){for(var _0x557ca9 in _0x4ee208){if(_0x4ee208['hasOwnProperty'](_0x557ca9)){_0x5a0e6a[_0x557ca9]=_0x4ee208[_0x557ca9];}}}return _0x5a0e6a;}exports[_0x7b80('0xf')]=function(_0x591386,_0x29295f,_0x40ff8a,_0x17e7fa){return new BPromise(function(_0x50ae23,_0x5cf2ab){_0x17e7fa=combineOptions(_0x17e7fa);var _0x55cb11=new Buffer(_0x40ff8a);var _0x38b118=fs[_0x7b80('0x10')](_0x591386);var _0x3ca82d=fs[_0x7b80('0x11')](_0x29295f);var _0x4280c6=crypto[_0x7b80('0x12')](_0x17e7fa[_0x7b80('0x9')],_0x55cb11);_0x38b118['on'](_0x7b80('0x13'),function(_0x365da0){var _0x27f924=new Buffer(_0x4280c6['update'](_0x365da0),_0x7b80('0x14'));_0x3ca82d[_0x7b80('0x15')](_0x27f924);});_0x38b118['on'](_0x7b80('0x16'),function(){try{var _0x683431=new Buffer(_0x4280c6[_0x7b80('0x17')]('binary'),_0x7b80('0x14'));_0x3ca82d['write'](_0x683431);_0x3ca82d[_0x7b80('0x16')]();_0x3ca82d['on'](_0x7b80('0x18'),function(){return _0x50ae23(_0x29295f);});}catch(_0x5268c4){fs[_0x7b80('0x19')](_0x29295f);return _0x5cf2ab(_0x5268c4);}});});};exports[_0x7b80('0x1a')]=function(_0xf31925,_0x350abc,_0x4e602c,_0x3c77f5){return new BPromise(function(_0x3ccf7f,_0x1d6505){_0x3c77f5=combineOptions(_0x3c77f5);var _0x5b5eb3=new Buffer(_0x4e602c);var _0x4e5bb3=fs[_0x7b80('0x10')](_0xf31925);var _0x359f0b=fs[_0x7b80('0x11')](_0x350abc);var _0x3c0598=crypto[_0x7b80('0x1b')](_0x3c77f5[_0x7b80('0x9')],_0x5b5eb3);_0x4e5bb3['on'](_0x7b80('0x13'),function(_0x55f5d9){var _0x2f1e6f=new Buffer(_0x3c0598[_0x7b80('0x1c')](_0x55f5d9),_0x7b80('0x14'));_0x359f0b[_0x7b80('0x15')](_0x2f1e6f);});_0x4e5bb3['on']('end',function(){try{var _0x3415b0=new Buffer(_0x3c0598[_0x7b80('0x17')](_0x7b80('0x14')),_0x7b80('0x14'));_0x359f0b[_0x7b80('0x15')](_0x3415b0);_0x359f0b[_0x7b80('0x16')]();_0x359f0b['on']('close',function(){return _0x3ccf7f(_0x350abc);});}catch(_0x5c6de9){fs[_0x7b80('0x19')](_0x350abc);return _0x1d6505(_0x5c6de9);}});});};exports[_0x7b80('0x1d')]=function(_0x243f15,_0x5aa07c,_0x1715b6){var _0x2fb3eb=_0x1715b6||stringOptions[_0x7b80('0x9')];var _0x2f40f5=_0x5aa07c||stringOptions[_0x7b80('0x1e')];var _0x48792f=crypto[_0x7b80('0x12')](_0x2fb3eb,_0x2f40f5);var _0x449a75=_0x48792f[_0x7b80('0x1c')](_0x243f15,_0x7b80('0x1f'),_0x7b80('0x20'));_0x449a75+=_0x48792f[_0x7b80('0x17')](_0x7b80('0x20'));return _0x449a75;};exports[_0x7b80('0x21')]=function(_0x4e8a42,_0x1bd9c7,_0x49e3f1){var _0x142720=_0x49e3f1||stringOptions[_0x7b80('0x9')];var _0x1fd23f=_0x1bd9c7||stringOptions[_0x7b80('0x1e')];var _0x387792=crypto[_0x7b80('0x1b')](_0x142720,_0x1fd23f);var _0x2db423=_0x387792[_0x7b80('0x1c')](_0x4e8a42,'base64',_0x7b80('0x1f'));_0x2db423+=_0x387792[_0x7b80('0x17')](_0x7b80('0x1f'));return _0x2db423;}; \ No newline at end of file +var _0x5428=['crypto','bluebird','../../config/environment','app','secrets','session','aes-256-ctr','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter','hasOwnProperty','createReadStream','createWriteStream','createCipher','data','update','binary','write','end','final','close','unlink','createDecipher','encryptString','secret','utf8','base64'];(function(_0x2ca330,_0x899f75){var _0x119f7b=function(_0x505dde){while(--_0x505dde){_0x2ca330['push'](_0x2ca330['shift']());}};_0x119f7b(++_0x899f75);}(_0x5428,0x117));var _0x8542=function(_0x23eb5b,_0x3d898c){_0x23eb5b=_0x23eb5b-0x0;var _0x38b7e6=_0x5428[_0x23eb5b];return _0x38b7e6;};'use strict';var crypto=require(_0x8542('0x0'));var fs=require('fs');var BPromise=require(_0x8542('0x1'));var _=require('lodash');var config=require(_0x8542('0x2'));var logger=require('../../config/logger')(_0x8542('0x3'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x8542('0x4')][_0x8542('0x5')],'algorithm':_0x8542('0x6')};const fileOptions={'algorithm':'aes192'};if(config[_0x8542('0x7')]&&config[_0x8542('0x7')][_0x8542('0x8')]){var isSupported=isAlgorithmSupported(config[_0x8542('0x7')][_0x8542('0x8')]);if(isSupported){fileOptions[_0x8542('0x8')]=config[_0x8542('0x7')][_0x8542('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x8542('0x9')](',\x20');logger[_0x8542('0xa')](config[_0x8542('0x7')][_0x8542('0x8')],_0x8542('0xb'),supportedAlgorithms);}}function isASupportedCipher(_0x35c9a8){return AES_SUPPORTED_RX[_0x8542('0xc')](_0x35c9a8);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x8542('0xd')](isASupportedCipher);}function isAlgorithmSupported(_0xe3fc3d){return getSupportedCiphers()['indexOf'](_0xe3fc3d)>-0x1;}function combineOptions(_0x2cde41){var _0x190e9c={};for(var _0x43ec83 in fileOptions){if(fileOptions[_0x8542('0xe')](_0x43ec83)){_0x190e9c[_0x43ec83]=fileOptions[_0x43ec83];}}if(_0x2cde41){for(var _0xd80968 in _0x2cde41){if(_0x2cde41['hasOwnProperty'](_0xd80968)){_0x190e9c[_0xd80968]=_0x2cde41[_0xd80968];}}}return _0x190e9c;}exports['encryptFile']=function(_0x1dca1e,_0x1de9d8,_0x5eb387,_0x214d70){return new BPromise(function(_0xacd20d,_0x5d35da){_0x214d70=combineOptions(_0x214d70);var _0x53aa5f=new Buffer(_0x5eb387);var _0x125dbd=fs[_0x8542('0xf')](_0x1dca1e);var _0x54d504=fs[_0x8542('0x10')](_0x1de9d8);var _0x334316=crypto[_0x8542('0x11')](_0x214d70['algorithm'],_0x53aa5f);_0x125dbd['on'](_0x8542('0x12'),function(_0xc53104){var _0x30954f=new Buffer(_0x334316[_0x8542('0x13')](_0xc53104),_0x8542('0x14'));_0x54d504[_0x8542('0x15')](_0x30954f);});_0x125dbd['on'](_0x8542('0x16'),function(){try{var _0x4889a5=new Buffer(_0x334316[_0x8542('0x17')](_0x8542('0x14')),_0x8542('0x14'));_0x54d504[_0x8542('0x15')](_0x4889a5);_0x54d504['end']();_0x54d504['on'](_0x8542('0x18'),function(){return _0xacd20d(_0x1de9d8);});}catch(_0x340e1a){fs[_0x8542('0x19')](_0x1de9d8);return _0x5d35da(_0x340e1a);}});});};exports['decryptFile']=function(_0x44e6dc,_0x229ab1,_0x17097b,_0x3b238d){return new BPromise(function(_0x4ce938,_0x93d540){_0x3b238d=combineOptions(_0x3b238d);var _0x5423e7=new Buffer(_0x17097b);var _0x259f35=fs[_0x8542('0xf')](_0x44e6dc);var _0x5b3b9b=fs[_0x8542('0x10')](_0x229ab1);var _0x37d9e0=crypto[_0x8542('0x1a')](_0x3b238d['algorithm'],_0x5423e7);_0x259f35['on'](_0x8542('0x12'),function(_0x162420){var _0x218305=new Buffer(_0x37d9e0[_0x8542('0x13')](_0x162420),_0x8542('0x14'));_0x5b3b9b[_0x8542('0x15')](_0x218305);});_0x259f35['on']('end',function(){try{var _0x26c596=new Buffer(_0x37d9e0[_0x8542('0x17')]('binary'),_0x8542('0x14'));_0x5b3b9b[_0x8542('0x15')](_0x26c596);_0x5b3b9b['end']();_0x5b3b9b['on'](_0x8542('0x18'),function(){return _0x4ce938(_0x229ab1);});}catch(_0x493fed){fs['unlink'](_0x229ab1);return _0x93d540(_0x493fed);}});});};exports[_0x8542('0x1b')]=function(_0x3951f3,_0x1c8999,_0x28c07e){var _0x4a22f1=_0x28c07e||stringOptions[_0x8542('0x8')];var _0x2f7e0d=_0x1c8999||stringOptions[_0x8542('0x1c')];var _0x490041=crypto[_0x8542('0x11')](_0x4a22f1,_0x2f7e0d);var _0x134cf3=_0x490041[_0x8542('0x13')](_0x3951f3,_0x8542('0x1d'),_0x8542('0x1e'));_0x134cf3+=_0x490041[_0x8542('0x17')]('base64');return _0x134cf3;};exports['decryptString']=function(_0x3c2ee2,_0x2ca04a,_0x229997){var _0x4345b6=_0x229997||stringOptions[_0x8542('0x8')];var _0x13aff4=_0x2ca04a||stringOptions[_0x8542('0x1c')];var _0x690618=crypto[_0x8542('0x1a')](_0x4345b6,_0x13aff4);var _0x5399ef=_0x690618['update'](_0x3c2ee2,'base64','utf8');_0x5399ef+=_0x690618[_0x8542('0x17')](_0x8542('0x1d'));return _0x5399ef;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index bb65ae6..6b1ccc1 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 _0x8821=['writeFileSync','zip','zip\x20finished','CSV','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','find','split','splitSizeCsv','then','sequelize','query','QueryTypes','SELECT','num','length','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','join','mkdirSync','%s%d.%s','csv','%s.%s'];(function(_0x269a48,_0x88b5d5){var _0x4d849a=function(_0x5d532c){while(--_0x5d532c){_0x269a48['push'](_0x269a48['shift']());}};_0x4d849a(++_0x88b5d5);}(_0x8821,0xc1));var _0x1882=function(_0x11309c,_0xe18a74){_0x11309c=_0x11309c-0x0;var _0x3fea9c=_0x8821[_0x11309c];return _0x3fea9c;};'use strict';var util=require(_0x1882('0x0'));var path=require(_0x1882('0x1'));var _=require(_0x1882('0x2'));var csv=require(_0x1882('0x3'));var fs=require('fs');var BPromise=require(_0x1882('0x4'));var zipdir=require(_0x1882('0x5'));var rimraf=require(_0x1882('0x6'));var db=require(_0x1882('0x7'))['db'];var dbH=require(_0x1882('0x7'))[_0x1882('0x8')];var logger=require('../../config/logger')(_0x1882('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x1882('0xa')][0x2]);var QUERY=process[_0x1882('0xa')][0x3];var PATH=process[_0x1882('0xa')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x341deb,_0xce9204){var _0x1df330={'status':_0x341deb};var _0x39cded={'where':{'id':EXTRACTED_REPORT_ID}};if(_0xce9204){_0x1df330[_0x1882('0xb')]=_0xce9204;}return db[_0x1882('0xc')][_0x1882('0xd')](_0x1df330,_0x39cded);}function main(){var _0x559e28=0x1388;var _0x39b505;logger[_0x1882('0xe')](util[_0x1882('0xf')](_0x1882('0x10'),EXTRACTED_REPORT_ID,'CSV'));return db['Setting'][_0x1882('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x1882('0x12'),_0x1882('0x13')]})[_0x1882('0x14')](function(_0x43d9bc){if(_0x43d9bc){_0x39b505=_0x43d9bc;_0x559e28=_0x39b505[_0x1882('0x13')]||0x1388;}})[_0x1882('0x14')](function(){return dbH[_0x1882('0x15')][_0x1882('0x16')](util['format']('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x1882('0x15')][_0x1882('0x17')][_0x1882('0x18')]});})[_0x1882('0x14')](function(_0x1ccd77){if(!_0x1ccd77[0x0][_0x1882('0x19')]){return analyticExtractedReport('Empty');}var _0x31c3e3=[];var _0xed86cb=0x0;if(_0x39b505['split']){if(_0x1ccd77&&_0x1ccd77[_0x1882('0x1a')]){var _0x5f4967=_['range'](_0x1ccd77[0x0][_0x1882('0x19')]/_0x559e28);var _0x421aae=Number[_0x1882('0x1b')](_0x1ccd77[0x0][_0x1882('0x19')]/_0x559e28)?_0x1ccd77[0x0]['num']%_0x559e28:0x0;_0x5f4967[_0x1882('0x1c')](function(_0x34b2ef){if(_0x34b2ef>0x0){_0xed86cb+=_0x559e28;}_0x31c3e3[_0x1882('0x1d')](dbH[_0x1882('0x15')][_0x1882('0x16')](util[_0x1882('0xf')](_0x1882('0x1e'),QUERY,_0x559e28,_0xed86cb),{'type':dbH[_0x1882('0x15')]['QueryTypes']['SELECT']}));});if(_0x421aae>0x0){_0xed86cb+=_0x559e28;_0x31c3e3[_0x1882('0x1d')](dbH[_0x1882('0x15')]['query'](util[_0x1882('0xf')](_0x1882('0x1e'),QUERY,_0x421aae,_0xed86cb),{'type':dbH[_0x1882('0x15')][_0x1882('0x17')][_0x1882('0x18')]}));}}}else{_0x31c3e3[_0x1882('0x1d')](dbH[_0x1882('0x15')][_0x1882('0x16')](QUERY,{'type':dbH[_0x1882('0x15')][_0x1882('0x17')]['SELECT']}));}var _0xf7949c=path['dirname'](PATH);var _0xc9be91=path[_0x1882('0x1f')](PATH,'.csv');var _0x58f617=_0x39b505[_0x1882('0x12')]&&_0x31c3e3[_0x1882('0x1a')]>0x1;var _0x625196=[];if(!fs['existsSync'](path[_0x1882('0x20')](_0xf7949c,_0xc9be91))&&_0x58f617){fs[_0x1882('0x21')](path[_0x1882('0x20')](_0xf7949c,_0xc9be91));}return BPromise['each'](_0x31c3e3,function(_0x22e56f){_0x625196['push'](_0x22e56f);})[_0x1882('0x14')](function(){for(var _0x42185e=0x0;_0x42185e<_0x625196[_0x1882('0x1a')];_0x42185e+=0x1){var _0x18eb85;var _0x46a971=_0x625196[_0x42185e];if(_0x58f617){_0x18eb85=path['join'](_0xf7949c,_0xc9be91,util[_0x1882('0xf')](_0x1882('0x22'),_0xc9be91,_0x42185e,_0x1882('0x23')));}else{_0x18eb85=path[_0x1882('0x20')](_0xf7949c,util[_0x1882('0xf')](_0x1882('0x24'),_0xc9be91,_0x1882('0x23')));}fs[_0x1882('0x25')](_0x18eb85,csv(_0x46a971));}})[_0x1882('0x14')](function(){if(_0x58f617){return new Promise(function(_0x35f499){zipdir(path[_0x1882('0x20')](_0xf7949c,_0xc9be91),{'saveTo':path['join'](_0xf7949c,util[_0x1882('0xf')](_0x1882('0x24'),_0xc9be91,_0x1882('0x26')))},function(_0x3a6951,_0x37f8e2){rimraf(path[_0x1882('0x20')](_0xf7949c,_0xc9be91),function(){});_0x35f499(_0x1882('0x27'));});});}})[_0x1882('0x14')](function(){logger[_0x1882('0xe')](util[_0x1882('0xf')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x1882('0x28')));return analyticExtractedReport('Completed',_0x58f617?util[_0x1882('0xf')](_0x1882('0x24'),_0xc9be91,_0x58f617?_0x1882('0x26'):'csv'):null);});})[_0x1882('0x29')](function(_0x5365f8){logger[_0x1882('0xe')](util['format'](_0x1882('0x2a'),EXTRACTED_REPORT_ID,'CSV'),util['inspect'](_0x5365f8,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x1882('0x2b'));})[_0x1882('0x2c')](function(){process[_0x1882('0x2d')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x2153=['zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','inspect','finally','exit','util','path','lodash','to-csv','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','zip'];(function(_0x34c8eb,_0x5263fd){var _0x510d4e=function(_0x3d0491){while(--_0x3d0491){_0x34c8eb['push'](_0x34c8eb['shift']());}};_0x510d4e(++_0x5263fd);}(_0x2153,0x134));var _0x3215=function(_0x3f6128,_0xcc0aef){_0x3f6128=_0x3f6128-0x0;var _0x2ecb13=_0x2153[_0x3f6128];return _0x2ecb13;};'use strict';var util=require(_0x3215('0x0'));var path=require(_0x3215('0x1'));var _=require(_0x3215('0x2'));var csv=require(_0x3215('0x3'));var fs=require('fs');var BPromise=require(_0x3215('0x4'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require(_0x3215('0x5'))[_0x3215('0x6')];var logger=require(_0x3215('0x7'))(_0x3215('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x3215('0x9')][0x3];var PATH=process[_0x3215('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x24e714,_0x5c5244){var _0x589ffb={'status':_0x24e714};var _0x48b7b1={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5c5244){_0x589ffb['savename']=_0x5c5244;}return db[_0x3215('0xa')][_0x3215('0xb')](_0x589ffb,_0x48b7b1);}function main(){var _0x2f8741=0x1388;var _0x54e43b;logger[_0x3215('0xc')](util[_0x3215('0xd')](_0x3215('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x3215('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3215('0x10'),_0x3215('0x11')]})[_0x3215('0x12')](function(_0x314054){if(_0x314054){_0x54e43b=_0x314054;_0x2f8741=_0x54e43b['splitSizeCsv']||0x1388;}})[_0x3215('0x12')](function(){return dbH[_0x3215('0x13')][_0x3215('0x14')](util['format'](_0x3215('0x15'),QUERY),{'type':dbH[_0x3215('0x13')][_0x3215('0x16')][_0x3215('0x17')]});})[_0x3215('0x12')](function(_0x4d1739){if(!_0x4d1739[0x0][_0x3215('0x18')]){return analyticExtractedReport('Empty');}var _0x467be9=[];var _0x27cdfe=0x0;if(_0x54e43b[_0x3215('0x10')]){if(_0x4d1739&&_0x4d1739[_0x3215('0x19')]){var _0x967fed=_[_0x3215('0x1a')](_0x4d1739[0x0]['num']/_0x2f8741);var _0x2e3b71=Number[_0x3215('0x1b')](_0x4d1739[0x0][_0x3215('0x18')]/_0x2f8741)?_0x4d1739[0x0][_0x3215('0x18')]%_0x2f8741:0x0;_0x967fed[_0x3215('0x1c')](function(_0x1e9e16){if(_0x1e9e16>0x0){_0x27cdfe+=_0x2f8741;}_0x467be9[_0x3215('0x1d')](dbH[_0x3215('0x13')]['query'](util[_0x3215('0xd')](_0x3215('0x1e'),QUERY,_0x2f8741,_0x27cdfe),{'type':dbH['sequelize'][_0x3215('0x16')][_0x3215('0x17')]}));});if(_0x2e3b71>0x0){_0x27cdfe+=_0x2f8741;_0x467be9[_0x3215('0x1d')](dbH['sequelize'][_0x3215('0x14')](util['format'](_0x3215('0x1e'),QUERY,_0x2e3b71,_0x27cdfe),{'type':dbH['sequelize'][_0x3215('0x16')][_0x3215('0x17')]}));}}}else{_0x467be9[_0x3215('0x1d')](dbH['sequelize'][_0x3215('0x14')](QUERY,{'type':dbH[_0x3215('0x13')][_0x3215('0x16')]['SELECT']}));}var _0x6ed77c=path['dirname'](PATH);var _0x3925c9=path[_0x3215('0x1f')](PATH,_0x3215('0x20'));var _0x347f04=_0x54e43b[_0x3215('0x10')]&&_0x467be9[_0x3215('0x19')]>0x1;var _0x414f9d=[];if(!fs[_0x3215('0x21')](path[_0x3215('0x22')](_0x6ed77c,_0x3925c9))&&_0x347f04){fs[_0x3215('0x23')](path[_0x3215('0x22')](_0x6ed77c,_0x3925c9));}return BPromise[_0x3215('0x24')](_0x467be9,function(_0x3862bc){_0x414f9d['push'](_0x3862bc);})[_0x3215('0x12')](function(){for(var _0x11afa1=0x0;_0x11afa1<_0x414f9d[_0x3215('0x19')];_0x11afa1+=0x1){var _0x3748fd;var _0x2146e1=_0x414f9d[_0x11afa1];if(_0x347f04){_0x3748fd=path['join'](_0x6ed77c,_0x3925c9,util['format'](_0x3215('0x25'),_0x3925c9,_0x11afa1,_0x3215('0x26')));}else{_0x3748fd=path[_0x3215('0x22')](_0x6ed77c,util[_0x3215('0xd')](_0x3215('0x27'),_0x3925c9,_0x3215('0x26')));}fs[_0x3215('0x28')](_0x3748fd,csv(_0x2146e1));}})['then'](function(){if(_0x347f04){return new Promise(function(_0x17732){zipdir(path[_0x3215('0x22')](_0x6ed77c,_0x3925c9),{'saveTo':path['join'](_0x6ed77c,util[_0x3215('0xd')]('%s.%s',_0x3925c9,_0x3215('0x29')))},function(_0x47b293,_0x27126c){rimraf(path[_0x3215('0x22')](_0x6ed77c,_0x3925c9),function(){});_0x17732(_0x3215('0x2a'));});});}})[_0x3215('0x12')](function(){logger['info'](util[_0x3215('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x3215('0x2b'),_0x347f04?util[_0x3215('0xd')]('%s.%s',_0x3925c9,_0x347f04?_0x3215('0x29'):_0x3215('0x26')):null);});})[_0x3215('0x2c')](function(_0xb212ce){logger[_0x3215('0xc')](util['format'](_0x3215('0x2d'),EXTRACTED_REPORT_ID,_0x3215('0x2e')),util[_0x3215('0x2f')](_0xb212ce,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x3215('0x30')](function(){process[_0x3215('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 736d1fb..a13af6e 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 _0x356c=['push','format','name','startDate','endDate','header','pageBreak','landscape','footer','Arial','right','num','Empty','Setting','find','split','then','splitSizePdf','range','isInteger','forEach','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','basename','.pdf','existsSync','join','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','exit','/fonts/arial-regular.ttf','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','finish','error','end','createPdfFromHTML','lodash','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','update','map','tableHeader','pick','toString','length','auto','body','concat','chunk','keys'];(function(_0x4ff2a7,_0x264a62){var _0x36d0ea=function(_0x8b54bf){while(--_0x8b54bf){_0x4ff2a7['push'](_0x4ff2a7['shift']());}};_0x36d0ea(++_0x264a62);}(_0x356c,0x150));var _0xc356=function(_0x29efef,_0x3d8270){_0x29efef=_0x29efef-0x0;var _0x418e36=_0x356c[_0x29efef];return _0x418e36;};'use strict';var _=require(_0xc356('0x0'));var fs=require('fs');var util=require(_0xc356('0x1'));var path=require(_0xc356('0x2'));var moment=require(_0xc356('0x3'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xc356('0x4'));var zipdir=require(_0xc356('0x5'));var rimraf=require(_0xc356('0x6'));var JSDOM=require(_0xc356('0x7'))[_0xc356('0x8')];var window=new JSDOM('')[_0xc356('0x9')];var BPromise=require(_0xc356('0xa'));var db=require(_0xc356('0xb'))['db'];var dbH=require(_0xc356('0xb'))[_0xc356('0xc')];var logger=require(_0xc356('0xd'))(_0xc356('0xe'));var EXTRACTED_REPORT_ID=Number(process[_0xc356('0xf')][0x2]);var QUERY=process[_0xc356('0xf')][0x3];var PATH=process[_0xc356('0xf')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xc356('0x10');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x56519a,_0x5caaef){var _0x312fb6={'status':_0x56519a};var _0x127605={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5caaef){_0x312fb6['savename']=_0x5caaef;}return db['AnalyticExtractedReport'][_0xc356('0x11')](_0x312fb6,_0x127605);}function getHeaders(_0x305242){return _[_0xc356('0x12')](_0x305242,function(_0x1c7565){return{'text':_0x1c7565,'style':_0xc356('0x13')};});}function getRows(_0x139fe2,_0xb44371){return _[_0xc356('0x12')](_0xb44371,function(_0x1dd8f9){return _(_0x1dd8f9)[_0xc356('0x14')](_0x139fe2)[_0xc356('0x12')](function(_0x4f28ca){return _0x4f28ca?_[_0xc356('0x15')](_0x4f28ca):'';})['value']();});}function createTable(_0x3cbdef,_0x1b4576){var _0x560e18={'widths':_['fill'](Array(_0x3cbdef[_0xc356('0x16')]),0x91),'heights':function(_0x267190){return _0x267190===0x0?_0xc356('0x17'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x5444e9=getHeaders(_0x3cbdef);_0x560e18['body']['push'](_0x5444e9);var _0x1d03ca=getRows(_0x3cbdef,_0x1b4576);_0x560e18[_0xc356('0x18')]=_0x560e18[_0xc356('0x18')][_0xc356('0x19')](_0x1d03ca);return _0x560e18;}function createTables(_0x322db9){var _0x367c44=[];var _0x3d396b=_[_0xc356('0x1a')](Object[_0xc356('0x1b')](_0x322db9[0x0]),0x5);_0x3d396b['forEach'](function(_0x385ad1){_0x367c44[_0xc356('0x1c')](createTable(_0x385ad1,_0x322db9));});return _0x367c44;}function getPDFDocDefinition(_0x2f380e){var _0xed52a4=util[_0xc356('0x1d')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xc356('0x1e')],moment(EXTRACTED_REPORT[_0xc356('0x1f')])['format'](FORMAT),moment(EXTRACTED_REPORT[_0xc356('0x20')])['format'](FORMAT));var _0x26cbf5=[];for(var _0x2b9fc9=0x0;_0x2b9fc9<_0x2f380e[_0xc356('0x16')];_0x2b9fc9++){var _0x48f9c1=[];if(_0x2b9fc9===0x0){_0x48f9c1['push']({'text':_0xed52a4,'style':_0xc356('0x21')});}var _0x31de0b={'table':_0x2f380e[_0x2b9fc9]};if(_0x2b9fc9>0x0){_0x31de0b[_0xc356('0x22')]='before';_0x31de0b['margin']=[0x0,0x46,0x0,0x0];}_0x48f9c1[_0xc356('0x1c')](_0x31de0b);_0x26cbf5[_0xc356('0x1c')](_0x48f9c1);}return{'pageSize':'A4','pageOrientation':_0xc356('0x23'),'content':_0x26cbf5,'footer':function(_0x3c20c5,_0x5d3751){return{'text':_0x3c20c5['toString']()+'\x20/\x20'+_0x5d3751,'style':_0xc356('0x24')};},'defaultStyle':{'font':_0xc356('0x25')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xc356('0x26'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0xcefa5){var _0x311fb1=0x1388;var _0x59cfd6;if(!_0xcefa5[0x0][_0xc356('0x27')]){return analyticExtractedReport(_0xc356('0x28'));}return db[_0xc356('0x29')][_0xc356('0x2a')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xc356('0x2b'),'splitSizePdf']})[_0xc356('0x2c')](function(_0x2e08e5){if(_0x2e08e5){_0x59cfd6=_0x2e08e5;_0x311fb1=_0x59cfd6[_0xc356('0x2d')]||0x3e8;}})[_0xc356('0x2c')](function(){var _0x5e43c4=[];var _0x66a9c0=0x0;if(_0x59cfd6[_0xc356('0x2b')]){if(_0xcefa5&&_0xcefa5[_0xc356('0x16')]){var _0x348168=_[_0xc356('0x2e')](_0xcefa5[0x0]['num']/_0x311fb1);var _0x33a0a2=Number[_0xc356('0x2f')](_0xcefa5[0x0]['num']/_0x311fb1)?_0xcefa5[0x0][_0xc356('0x27')]%_0x311fb1:0x0;_0x348168[_0xc356('0x30')](function(_0x265eea){if(_0x265eea>0x0){_0x66a9c0+=_0x311fb1;}_0x5e43c4[_0xc356('0x1c')](dbH[_0xc356('0x31')]['query'](util[_0xc356('0x1d')](_0xc356('0x32'),QUERY,_0x311fb1,_0x66a9c0),{'type':dbH['sequelize'][_0xc356('0x33')][_0xc356('0x34')]}));});if(_0x33a0a2>0x0){_0x66a9c0+=_0x311fb1;_0x5e43c4['push'](dbH['sequelize'][_0xc356('0x35')](util[_0xc356('0x1d')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x33a0a2,_0x66a9c0),{'type':dbH[_0xc356('0x31')]['QueryTypes'][_0xc356('0x34')]}));}}}else{_0x5e43c4[_0xc356('0x1c')](dbH[_0xc356('0x31')][_0xc356('0x35')](QUERY,{'type':dbH[_0xc356('0x31')][_0xc356('0x33')][_0xc356('0x34')]}));}var _0x50a381=path[_0xc356('0x36')](PATH);var _0x546ea0=path[_0xc356('0x37')](PATH,_0xc356('0x38'));var _0x963884=_0x59cfd6[_0xc356('0x2b')]&&_0x5e43c4[_0xc356('0x16')]>0x1;var _0x4c62cd=[];if(!fs[_0xc356('0x39')](path[_0xc356('0x3a')](_0x50a381,_0x546ea0))&&_0x963884){fs['mkdirSync'](path[_0xc356('0x3a')](_0x50a381,_0x546ea0));}return BPromise['each'](_0x5e43c4,function(_0xb1326e){_0x4c62cd[_0xc356('0x1c')](_0xb1326e);})[_0xc356('0x2c')](function(){var _0xf27700=[];for(var _0x18f999=0x0;_0x18f999<_0x4c62cd[_0xc356('0x16')];_0x18f999+=0x1){var _0x48cef1=_0x4c62cd[_0x18f999];var _0x4b1f8d=createTables(_[_0xc356('0x3b')](_0x48cef1));var _0x1fce9d;var _0x2a6ba9=getPDFDocDefinition(_0x4b1f8d);var _0x5782dc=getPDFPrinter();var _0x1e46cc=_0x5782dc[_0xc356('0x3c')](_0x2a6ba9);if(_0x963884){_0x1fce9d=path[_0xc356('0x3a')](_0x50a381,_0x546ea0,util[_0xc356('0x1d')](_0xc356('0x3d'),_0x546ea0,_0x18f999,_0xc356('0x3e')));}else{_0x1fce9d=path[_0xc356('0x3a')](_0x50a381,util['format'](_0xc356('0x3f'),_0x546ea0,_0xc356('0x3e')));}_0xf27700['push'](writePDFDocument(_0x1e46cc,_0x1fce9d));}return Promise['all'](_0xf27700);})['then'](function(){if(_0x963884){return new Promise(function(_0x3a360f){zipdir(path['join'](_0x50a381,_0x546ea0),{'saveTo':path[_0xc356('0x3a')](_0x50a381,util['format'](_0xc356('0x3f'),_0x546ea0,_0xc356('0x40')))},function(){rimraf(path[_0xc356('0x3a')](_0x50a381,_0x546ea0),function(){});_0x3a360f(_0xc356('0x41'));});});}})[_0xc356('0x2c')](function(){if(!_0x963884)return;rimraf(path[_0xc356('0x3a')](_0x50a381,_0x546ea0),function(){});})[_0xc356('0x2c')](function(){logger[_0xc356('0x42')](util['format'](_0xc356('0x43'),EXTRACTED_REPORT_ID,_0xc356('0x44')));return analyticExtractedReport('Completed',_0x963884?util[_0xc356('0x1d')]('%s.%s',_0x546ea0,_0x963884?_0xc356('0x40'):_0xc356('0x3e')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xc356('0x42')](util[_0xc356('0x1d')](_0xc356('0x45'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xc356('0x46')][_0xc356('0x47')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xc356('0x2c')](function(_0x5a740b){EXTRACTED_REPORT=_0x5a740b;return dbH[_0xc356('0x31')][_0xc356('0x35')](util[_0xc356('0x1d')](_0xc356('0x48'),QUERY),{'type':dbH[_0xc356('0x31')][_0xc356('0x33')][_0xc356('0x34')]});})['then'](extractReport)[_0xc356('0x49')](function(_0x1dc71f){logger[_0xc356('0x42')](util[_0xc356('0x1d')](_0xc356('0x4a'),EXTRACTED_REPORT_ID,_0xc356('0x44')),util[_0xc356('0x4b')](_0x1dc71f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})['finally'](function(){process[_0xc356('0x4c')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x147904=new PdfPrinter({'Arial':{'normal':__dirname+_0xc356('0x4d'),'bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0xc356('0x4e'),'bolditalics':__dirname+_0xc356('0x4f')}});return _0x147904;}function getPDFDocDefinitionFromHTML(_0x27ef3d,_0x2458b2){var _0x50d67e=util[_0xc356('0x1d')](_0xc356('0x50'),_0x2458b2[_0xc356('0x51')],_0x2458b2[_0xc356('0x52')]);var _0x5c007f=moment()[_0xc356('0x1d')](_0xc356('0x53'))[_0xc356('0x15')]();var _0x1288b5=htmlToPdfmake(_0x27ef3d,{'window':window,'tableAutoSize':!![]});return{'content':[_0x1288b5],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xc356('0x54'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xc356('0x54'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xc356('0x54')}},'header':function(){return[{'text':'Interaction\x20Transcript','style':_0xc356('0x21')}];},'footer':function(_0x68d6f8,_0x49f485){return[{'text':util[_0xc356('0x1d')](_0xc356('0x55'),_0x50d67e,_0x68d6f8,_0x49f485,_0x5c007f),'style':_0xc356('0x24')}];}};}function writePDFDocument(_0x3af424,_0x59a467){return new Promise(function(_0x54d5b2,_0xb6e41e){var _0x3e1c93=_0x3af424[_0xc356('0x56')](fs['createWriteStream'](_0x59a467));_0x3e1c93['on']('finish',function(){_0x54d5b2(_0xc356('0x57'));});_0x3e1c93['on'](_0xc356('0x58'),function(_0x1c0ded){_0xb6e41e(_0x1c0ded);});_0x3af424[_0xc356('0x59')]();});}exports[_0xc356('0x5a')]=function(_0x1d2d75,_0x4054af){var _0x283cee=getPDFPrinter();var _0x177c05=getPDFDocDefinitionFromHTML(_0x1d2d75,_0x4054af);var _0x69b9c1=_0x283cee[_0xc356('0x3c')](_0x177c05);return writePDFDocument(_0x69b9c1,_0x4054af[_0xc356('0x2')])[_0xc356('0x49')](function(_0x4012cd){throw _0x4012cd;});}; \ No newline at end of file +var _0x5d58=['/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','bluebird','../../mysqldb','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','fill','length','auto','body','push','concat','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','pageBreak','before','margin','landscape','toString','\x20/\x20','footer','black','num','Empty','Setting','split','splitSizePdf','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','each','createPdfKitDocument','%s.%s','pdf','all','then','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','catch','inspect','Failed','finally'];(function(_0x1c2a84,_0x44d2fc){var _0x47dee8=function(_0x3fc187){while(--_0x3fc187){_0x1c2a84['push'](_0x1c2a84['shift']());}};_0x47dee8(++_0x44d2fc);}(_0x5d58,0x10a));var _0x85d5=function(_0x1294d4,_0x1d1074){_0x1294d4=_0x1294d4-0x0;var _0x4aa51d=_0x5d58[_0x1294d4];return _0x4aa51d;};'use strict';var _=require(_0x85d5('0x0'));var fs=require('fs');var util=require(_0x85d5('0x1'));var path=require(_0x85d5('0x2'));var moment=require(_0x85d5('0x3'));var htmlToPdfmake=require(_0x85d5('0x4'));var PdfPrinter=require(_0x85d5('0x5'));var zipdir=require(_0x85d5('0x6'));var rimraf=require(_0x85d5('0x7'));var JSDOM=require(_0x85d5('0x8'))[_0x85d5('0x9')];var window=new JSDOM('')[_0x85d5('0xa')];var BPromise=require(_0x85d5('0xb'));var db=require('../../mysqldb')['db'];var dbH=require(_0x85d5('0xc'))['dbH'];var logger=require(_0x85d5('0xd'))(_0x85d5('0xe'));var EXTRACTED_REPORT_ID=Number(process[_0x85d5('0xf')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x85d5('0xf')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x85d5('0x10');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x29a5d6,_0x2fcc23){var _0x4e84f3={'status':_0x29a5d6};var _0x126a5e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2fcc23){_0x4e84f3[_0x85d5('0x11')]=_0x2fcc23;}return db[_0x85d5('0x12')]['update'](_0x4e84f3,_0x126a5e);}function getHeaders(_0x2fee37){return _[_0x85d5('0x13')](_0x2fee37,function(_0x2a839f){return{'text':_0x2a839f,'style':_0x85d5('0x14')};});}function getRows(_0x36777d,_0x53a9b2){return _[_0x85d5('0x13')](_0x53a9b2,function(_0x2bb4b9){return _(_0x2bb4b9)[_0x85d5('0x15')](_0x36777d)[_0x85d5('0x13')](function(_0x501d48){return _0x501d48?_['toString'](_0x501d48):'';})['value']();});}function createTable(_0x2eb586,_0xa4cff2){var _0x2d75c0={'widths':_[_0x85d5('0x16')](Array(_0x2eb586[_0x85d5('0x17')]),0x91),'heights':function(_0x453935){return _0x453935===0x0?_0x85d5('0x18'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x1515e8=getHeaders(_0x2eb586);_0x2d75c0[_0x85d5('0x19')][_0x85d5('0x1a')](_0x1515e8);var _0x42a71d=getRows(_0x2eb586,_0xa4cff2);_0x2d75c0[_0x85d5('0x19')]=_0x2d75c0['body'][_0x85d5('0x1b')](_0x42a71d);return _0x2d75c0;}function createTables(_0x3a695a){var _0x1b3118=[];var _0x269682=_['chunk'](Object[_0x85d5('0x1c')](_0x3a695a[0x0]),0x5);_0x269682[_0x85d5('0x1d')](function(_0x5c8e2f){_0x1b3118[_0x85d5('0x1a')](createTable(_0x5c8e2f,_0x3a695a));});return _0x1b3118;}function getPDFDocDefinition(_0x441c77){var _0x5a38b1=util[_0x85d5('0x1e')](_0x85d5('0x1f'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x85d5('0x20')])[_0x85d5('0x1e')](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0x85d5('0x1e')](FORMAT));var _0x37493b=[];for(var _0x1805fb=0x0;_0x1805fb<_0x441c77[_0x85d5('0x17')];_0x1805fb++){var _0x5d6234=[];if(_0x1805fb===0x0){_0x5d6234[_0x85d5('0x1a')]({'text':_0x5a38b1,'style':'header'});}var _0x2c3a5d={'table':_0x441c77[_0x1805fb]};if(_0x1805fb>0x0){_0x2c3a5d[_0x85d5('0x21')]=_0x85d5('0x22');_0x2c3a5d[_0x85d5('0x23')]=[0x0,0x46,0x0,0x0];}_0x5d6234[_0x85d5('0x1a')](_0x2c3a5d);_0x37493b['push'](_0x5d6234);}return{'pageSize':'A4','pageOrientation':_0x85d5('0x24'),'content':_0x37493b,'footer':function(_0x34e666,_0x5b78a0){return{'text':_0x34e666[_0x85d5('0x25')]()+_0x85d5('0x26')+_0x5b78a0,'style':_0x85d5('0x27')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x85d5('0x28')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x4cceed){var _0xb0028b=0x1388;var _0xf98084;if(!_0x4cceed[0x0][_0x85d5('0x29')]){return analyticExtractedReport(_0x85d5('0x2a'));}return db[_0x85d5('0x2b')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x85d5('0x2c'),_0x85d5('0x2d')]})['then'](function(_0xb9946f){if(_0xb9946f){_0xf98084=_0xb9946f;_0xb0028b=_0xf98084[_0x85d5('0x2d')]||0x3e8;}})['then'](function(){var _0x3a5685=[];var _0x5ed0a8=0x0;if(_0xf98084[_0x85d5('0x2c')]){if(_0x4cceed&&_0x4cceed[_0x85d5('0x17')]){var _0x4cab34=_['range'](_0x4cceed[0x0]['num']/_0xb0028b);var _0x7c60d1=Number[_0x85d5('0x2e')](_0x4cceed[0x0]['num']/_0xb0028b)?_0x4cceed[0x0][_0x85d5('0x29')]%_0xb0028b:0x0;_0x4cab34[_0x85d5('0x1d')](function(_0x27df95){if(_0x27df95>0x0){_0x5ed0a8+=_0xb0028b;}_0x3a5685[_0x85d5('0x1a')](dbH[_0x85d5('0x2f')][_0x85d5('0x30')](util['format'](_0x85d5('0x31'),QUERY,_0xb0028b,_0x5ed0a8),{'type':dbH[_0x85d5('0x2f')][_0x85d5('0x32')][_0x85d5('0x33')]}));});if(_0x7c60d1>0x0){_0x5ed0a8+=_0xb0028b;_0x3a5685[_0x85d5('0x1a')](dbH['sequelize'][_0x85d5('0x30')](util['format'](_0x85d5('0x31'),QUERY,_0x7c60d1,_0x5ed0a8),{'type':dbH[_0x85d5('0x2f')][_0x85d5('0x32')][_0x85d5('0x33')]}));}}}else{_0x3a5685['push'](dbH[_0x85d5('0x2f')][_0x85d5('0x30')](QUERY,{'type':dbH[_0x85d5('0x2f')][_0x85d5('0x32')][_0x85d5('0x33')]}));}var _0x436980=path[_0x85d5('0x34')](PATH);var _0x49d285=path[_0x85d5('0x35')](PATH,_0x85d5('0x36'));var _0xedb56e=_0xf98084[_0x85d5('0x2c')]&&_0x3a5685[_0x85d5('0x17')]>0x1;var _0x908b2e=[];if(!fs[_0x85d5('0x37')](path[_0x85d5('0x38')](_0x436980,_0x49d285))&&_0xedb56e){fs['mkdirSync'](path['join'](_0x436980,_0x49d285));}return BPromise[_0x85d5('0x39')](_0x3a5685,function(_0xe99e69){_0x908b2e[_0x85d5('0x1a')](_0xe99e69);})['then'](function(){var _0x23fc95=[];for(var _0x11da90=0x0;_0x11da90<_0x908b2e['length'];_0x11da90+=0x1){var _0x5f4e6b=_0x908b2e[_0x11da90];var _0x166a3e=createTables(_['flatten'](_0x5f4e6b));var _0xbb1686;var _0xd14080=getPDFDocDefinition(_0x166a3e);var _0x269022=getPDFPrinter();var _0x41c24d=_0x269022[_0x85d5('0x3a')](_0xd14080);if(_0xedb56e){_0xbb1686=path[_0x85d5('0x38')](_0x436980,_0x49d285,util[_0x85d5('0x1e')]('%s%d.%s',_0x49d285,_0x11da90,'pdf'));}else{_0xbb1686=path[_0x85d5('0x38')](_0x436980,util['format'](_0x85d5('0x3b'),_0x49d285,_0x85d5('0x3c')));}_0x23fc95[_0x85d5('0x1a')](writePDFDocument(_0x41c24d,_0xbb1686));}return Promise[_0x85d5('0x3d')](_0x23fc95);})[_0x85d5('0x3e')](function(){if(_0xedb56e){return new Promise(function(_0x1cb792){zipdir(path[_0x85d5('0x38')](_0x436980,_0x49d285),{'saveTo':path['join'](_0x436980,util[_0x85d5('0x1e')](_0x85d5('0x3b'),_0x49d285,_0x85d5('0x3f')))},function(){rimraf(path['join'](_0x436980,_0x49d285),function(){});_0x1cb792('zip\x20finished');});});}})[_0x85d5('0x3e')](function(){if(!_0xedb56e)return;rimraf(path['join'](_0x436980,_0x49d285),function(){});})[_0x85d5('0x3e')](function(){logger[_0x85d5('0x40')](util['format'](_0x85d5('0x41'),EXTRACTED_REPORT_ID,_0x85d5('0x42')));return analyticExtractedReport(_0x85d5('0x43'),_0xedb56e?util[_0x85d5('0x1e')](_0x85d5('0x3b'),_0x49d285,_0xedb56e?_0x85d5('0x3f'):_0x85d5('0x3c')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger['info'](util['format'](_0x85d5('0x44'),EXTRACTED_REPORT_ID,'PDF'));return db[_0x85d5('0x12')][_0x85d5('0x45')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0xb7022){EXTRACTED_REPORT=_0xb7022;return dbH[_0x85d5('0x2f')][_0x85d5('0x30')](util[_0x85d5('0x1e')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x85d5('0x2f')]['QueryTypes'][_0x85d5('0x33')]});})[_0x85d5('0x3e')](extractReport)[_0x85d5('0x46')](function(_0x1a5d93){logger[_0x85d5('0x40')](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x85d5('0x42')),util[_0x85d5('0x47')](_0x1a5d93,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x85d5('0x48'));})[_0x85d5('0x49')](function(){process['exit'](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3f41dd=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x85d5('0x4a'),'bolditalics':__dirname+_0x85d5('0x4b')}});return _0x3f41dd;}function getPDFDocDefinitionFromHTML(_0x5629e3,_0x35fbb6){var _0x1ffca1=util['format']('%s\x20#%d',_0x35fbb6['channel'],_0x35fbb6[_0x85d5('0x4c')]);var _0x29710d=moment()['format'](_0x85d5('0x4d'))[_0x85d5('0x25')]();var _0x16df0a=htmlToPdfmake(_0x5629e3,{'window':window,'tableAutoSize':!![]});return{'content':[_0x16df0a],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x85d5('0x4e'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x85d5('0x4e'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x85d5('0x4e')}},'header':function(){return[{'text':_0x85d5('0x4f'),'style':'header'}];},'footer':function(_0x2f17d3,_0x30d586){return[{'text':util['format'](_0x85d5('0x50'),_0x1ffca1,_0x2f17d3,_0x30d586,_0x29710d),'style':_0x85d5('0x27')}];}};}function writePDFDocument(_0x2ca7b9,_0x27cc8f){return new Promise(function(_0x1fd53d,_0x4b4827){var _0x40699b=_0x2ca7b9['pipe'](fs[_0x85d5('0x51')](_0x27cc8f));_0x40699b['on'](_0x85d5('0x52'),function(){_0x1fd53d(_0x85d5('0x52'));});_0x40699b['on'](_0x85d5('0x53'),function(_0x557dc1){_0x4b4827(_0x557dc1);});_0x2ca7b9['end']();});}exports[_0x85d5('0x54')]=function(_0x5df5fe,_0x8978d2){var _0x1076da=getPDFPrinter();var _0x577e87=getPDFDocDefinitionFromHTML(_0x5df5fe,_0x8978d2);var _0x3dc697=_0x1076da['createPdfKitDocument'](_0x577e87);return writePDFDocument(_0x3dc697,_0x8978d2[_0x85d5('0x2')])[_0x85d5('0x46')](function(_0x4582a0){throw _0x4582a0;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index ffad105..761ea32 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 _0x3353=['AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','split','splitSizeXlsx','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','isInteger','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','.xlsx','join','mkdirSync','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','info','XLSX','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename'];(function(_0x454dc1,_0x441e0e){var _0x12a656=function(_0x18e19d){while(--_0x18e19d){_0x454dc1['push'](_0x454dc1['shift']());}};_0x12a656(++_0x441e0e);}(_0x3353,0x1ef));var _0x3335=function(_0x579321,_0x5f2ca7){_0x579321=_0x579321-0x0;var _0x12e520=_0x3353[_0x579321];return _0x12e520;};'use strict';var util=require('util');var path=require(_0x3335('0x0'));var _=require(_0x3335('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x3335('0x2'));var zipdir=require(_0x3335('0x3'));var rimraf=require(_0x3335('0x4'));var db=require(_0x3335('0x5'))['db'];var dbH=require(_0x3335('0x5'))[_0x3335('0x6')];var logger=require(_0x3335('0x7'))(_0x3335('0x8'));var EXTRACTED_REPORT_ID=Number(process[_0x3335('0x9')][0x2]);var QUERY=process[_0x3335('0x9')][0x3];var PATH=process[_0x3335('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x3c6941,_0x4f4320){var _0x4c5534={'status':_0x3c6941};var _0x2c3f27={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4f4320){_0x4c5534[_0x3335('0xa')]=_0x4f4320;}return db[_0x3335('0xb')][_0x3335('0xc')](_0x4c5534,_0x2c3f27);}function main(){var _0x337d98=0x1388;var _0x1afd05;logger['info'](util[_0x3335('0xd')](_0x3335('0xe'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x3335('0xf')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3335('0x10'),_0x3335('0x11')]})[_0x3335('0x12')](function(_0x66e23){if(_0x66e23){_0x1afd05=_0x66e23;_0x337d98=_0x1afd05[_0x3335('0x11')]||0x1388;}})[_0x3335('0x12')](function(){return dbH[_0x3335('0x13')]['query'](util[_0x3335('0xd')](_0x3335('0x14'),QUERY),{'type':dbH['sequelize'][_0x3335('0x15')][_0x3335('0x16')]});})[_0x3335('0x12')](function(_0x4bd6e8){if(!_0x4bd6e8[0x0][_0x3335('0x17')]){return analyticExtractedReport(_0x3335('0x18'));}var _0xf05e45=[];var _0x467125=0x0;if(_0x1afd05[_0x3335('0x10')]){if(_0x4bd6e8&&_0x4bd6e8[_0x3335('0x19')]){var _0x31faa1=_['range'](_0x4bd6e8[0x0][_0x3335('0x17')]/_0x337d98);var _0x41fd25=Number[_0x3335('0x1a')](_0x4bd6e8[0x0][_0x3335('0x17')]/_0x337d98)?_0x4bd6e8[0x0][_0x3335('0x17')]%_0x337d98:0x0;_0x31faa1['forEach'](function(_0x106a47){if(_0x106a47>0x0){_0x467125+=_0x337d98;}_0xf05e45[_0x3335('0x1b')](dbH[_0x3335('0x13')][_0x3335('0x1c')](util['format'](_0x3335('0x1d'),QUERY,_0x337d98,_0x467125),{'type':dbH[_0x3335('0x13')][_0x3335('0x15')][_0x3335('0x16')]}));});if(_0x41fd25>0x0){_0x467125+=_0x337d98;_0xf05e45[_0x3335('0x1b')](dbH[_0x3335('0x13')][_0x3335('0x1c')](util['format'](_0x3335('0x1d'),QUERY,_0x41fd25,_0x467125),{'type':dbH[_0x3335('0x13')]['QueryTypes'][_0x3335('0x16')]}));}}}else{_0xf05e45['push'](dbH[_0x3335('0x13')]['query'](QUERY,{'type':dbH[_0x3335('0x13')][_0x3335('0x15')][_0x3335('0x16')]}));}var _0xf8fea9=path['dirname'](PATH);var _0x275410=path['basename'](PATH,_0x3335('0x1e'));var _0x29cd17=_0x1afd05['split']&&_0xf05e45[_0x3335('0x19')]>0x1;var _0x4bdefe=[];if(!fs['existsSync'](path[_0x3335('0x1f')](_0xf8fea9,_0x275410))&&_0x29cd17){fs[_0x3335('0x20')](path[_0x3335('0x1f')](_0xf8fea9,_0x275410));}return BPromise['each'](_0xf05e45,function(_0x2eb7f5){_0x4bdefe[_0x3335('0x1b')](_0x2eb7f5);})[_0x3335('0x12')](function(){for(var _0x254c2f=0x0;_0x254c2f<_0x4bdefe[_0x3335('0x19')];_0x254c2f+=0x1){var _0x3e245d;var _0x1dc7d3=_0x4bdefe[_0x254c2f];if(_0x29cd17){_0x3e245d=path[_0x3335('0x1f')](_0xf8fea9,_0x275410,util[_0x3335('0xd')](_0x3335('0x21'),_0x275410,_0x254c2f,_0x3335('0x22')));}else{_0x3e245d=path[_0x3335('0x1f')](_0xf8fea9,util[_0x3335('0xd')](_0x3335('0x23'),_0x275410,_0x3335('0x22')));}fs[_0x3335('0x24')](_0x3e245d,json2xls(_0x1dc7d3),_0x3335('0x25'));}})[_0x3335('0x12')](function(){if(_0x29cd17){return new Promise(function(_0x180fc7){zipdir(path[_0x3335('0x1f')](_0xf8fea9,_0x275410),{'saveTo':path[_0x3335('0x1f')](_0xf8fea9,util[_0x3335('0xd')](_0x3335('0x23'),_0x275410,_0x3335('0x26')))},function(_0x5dd82f,_0xfb866b){rimraf(path[_0x3335('0x1f')](_0xf8fea9,_0x275410),function(){});_0x180fc7('zip\x20finished');});});}})[_0x3335('0x12')](function(){logger[_0x3335('0x27')](util[_0x3335('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x3335('0x28')));return analyticExtractedReport('Completed',_0x29cd17?util[_0x3335('0xd')](_0x3335('0x23'),_0x275410,_0x29cd17?_0x3335('0x26'):_0x3335('0x22')):null);});})[_0x3335('0x29')](function(_0x43e5de){logger[_0x3335('0x27')](util[_0x3335('0xd')](_0x3335('0x2a'),EXTRACTED_REPORT_ID,_0x3335('0x28')),util[_0x3335('0x2b')](_0x43e5de,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3335('0x2c'));})[_0x3335('0x2d')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0xe172=['xlsx','%s.%s','writeFileSync','binary','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch','inspect','finally','util','path','json2xls','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','sequelize','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','Empty','length','range','num','isInteger','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','existsSync','mkdirSync','join'];(function(_0x4fe5aa,_0x444285){var _0x3fab12=function(_0x59661d){while(--_0x59661d){_0x4fe5aa['push'](_0x4fe5aa['shift']());}};_0x3fab12(++_0x444285);}(_0xe172,0x1bb));var _0x2e17=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xe172[_0x68c979];return _0x4f0001;};'use strict';var util=require(_0x2e17('0x0'));var path=require(_0x2e17('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0x2e17('0x2'));var BPromise=require(_0x2e17('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0x2e17('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0x2e17('0x5'))[_0x2e17('0x6')];var logger=require(_0x2e17('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x2e17('0x8')][0x3];var PATH=process[_0x2e17('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x318c78,_0x413574){var _0x3dd042={'status':_0x318c78};var _0x1e047c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x413574){_0x3dd042[_0x2e17('0x9')]=_0x413574;}return db[_0x2e17('0xa')][_0x2e17('0xb')](_0x3dd042,_0x1e047c);}function main(){var _0x93905f=0x1388;var _0x329967;logger[_0x2e17('0xc')](util['format'](_0x2e17('0xd'),EXTRACTED_REPORT_ID,_0x2e17('0xe')));return db['Setting'][_0x2e17('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2e17('0x10'),_0x2e17('0x11')]})['then'](function(_0x392b41){if(_0x392b41){_0x329967=_0x392b41;_0x93905f=_0x329967[_0x2e17('0x11')]||0x1388;}})[_0x2e17('0x12')](function(){return dbH[_0x2e17('0x13')][_0x2e17('0x14')](util[_0x2e17('0x15')](_0x2e17('0x16'),QUERY),{'type':dbH[_0x2e17('0x13')][_0x2e17('0x17')][_0x2e17('0x18')]});})[_0x2e17('0x12')](function(_0x362317){if(!_0x362317[0x0]['num']){return analyticExtractedReport(_0x2e17('0x19'));}var _0x5685f5=[];var _0x4950f4=0x0;if(_0x329967[_0x2e17('0x10')]){if(_0x362317&&_0x362317[_0x2e17('0x1a')]){var _0x34fd3b=_[_0x2e17('0x1b')](_0x362317[0x0][_0x2e17('0x1c')]/_0x93905f);var _0x532f89=Number[_0x2e17('0x1d')](_0x362317[0x0][_0x2e17('0x1c')]/_0x93905f)?_0x362317[0x0][_0x2e17('0x1c')]%_0x93905f:0x0;_0x34fd3b['forEach'](function(_0x3f3f93){if(_0x3f3f93>0x0){_0x4950f4+=_0x93905f;}_0x5685f5[_0x2e17('0x1e')](dbH[_0x2e17('0x13')]['query'](util[_0x2e17('0x15')](_0x2e17('0x1f'),QUERY,_0x93905f,_0x4950f4),{'type':dbH[_0x2e17('0x13')][_0x2e17('0x17')][_0x2e17('0x18')]}));});if(_0x532f89>0x0){_0x4950f4+=_0x93905f;_0x5685f5[_0x2e17('0x1e')](dbH[_0x2e17('0x13')][_0x2e17('0x14')](util[_0x2e17('0x15')](_0x2e17('0x1f'),QUERY,_0x532f89,_0x4950f4),{'type':dbH[_0x2e17('0x13')]['QueryTypes'][_0x2e17('0x18')]}));}}}else{_0x5685f5['push'](dbH[_0x2e17('0x13')][_0x2e17('0x14')](QUERY,{'type':dbH[_0x2e17('0x13')]['QueryTypes']['SELECT']}));}var _0x128ead=path[_0x2e17('0x20')](PATH);var _0x1f0cd5=path[_0x2e17('0x21')](PATH,'.xlsx');var _0x5aba0e=_0x329967[_0x2e17('0x10')]&&_0x5685f5[_0x2e17('0x1a')]>0x1;var _0x716df8=[];if(!fs[_0x2e17('0x22')](path['join'](_0x128ead,_0x1f0cd5))&&_0x5aba0e){fs[_0x2e17('0x23')](path[_0x2e17('0x24')](_0x128ead,_0x1f0cd5));}return BPromise['each'](_0x5685f5,function(_0x4d3223){_0x716df8[_0x2e17('0x1e')](_0x4d3223);})[_0x2e17('0x12')](function(){for(var _0x4e1f47=0x0;_0x4e1f47<_0x716df8[_0x2e17('0x1a')];_0x4e1f47+=0x1){var _0x209c00;var _0x503f34=_0x716df8[_0x4e1f47];if(_0x5aba0e){_0x209c00=path[_0x2e17('0x24')](_0x128ead,_0x1f0cd5,util[_0x2e17('0x15')]('%s%d.%s',_0x1f0cd5,_0x4e1f47,_0x2e17('0x25')));}else{_0x209c00=path['join'](_0x128ead,util[_0x2e17('0x15')](_0x2e17('0x26'),_0x1f0cd5,_0x2e17('0x25')));}fs[_0x2e17('0x27')](_0x209c00,json2xls(_0x503f34),_0x2e17('0x28'));}})['then'](function(){if(_0x5aba0e){return new Promise(function(_0x345ba6){zipdir(path[_0x2e17('0x24')](_0x128ead,_0x1f0cd5),{'saveTo':path[_0x2e17('0x24')](_0x128ead,util[_0x2e17('0x15')]('%s.%s',_0x1f0cd5,'zip'))},function(_0x237b24,_0x1b0e94){rimraf(path[_0x2e17('0x24')](_0x128ead,_0x1f0cd5),function(){});_0x345ba6(_0x2e17('0x29'));});});}})['then'](function(){logger[_0x2e17('0xc')](util[_0x2e17('0x15')](_0x2e17('0x2a'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x2e17('0x2b'),_0x5aba0e?util['format'](_0x2e17('0x26'),_0x1f0cd5,_0x5aba0e?_0x2e17('0x2c'):_0x2e17('0x25')):null);});})[_0x2e17('0x2d')](function(_0x2a7bad){logger[_0x2e17('0xc')](util[_0x2e17('0x15')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x2e17('0xe')),util[_0x2e17('0x2e')](_0x2a7bad,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x2e17('0x2f')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index c3ae38e..648fa5f 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 _0xbccd=['map','exten','filter','queue','playback','hasOwnProperty','extensions','extension','find','push','Set','format','CDR(type)=%s','type','context','priority','VoiceExtensionId','inbound','CDR(routeid)=','outbound','CDR(destination)=','${EXTEN:','cutdigits','${EXTEN}','ExecIf','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','toLowerCase','createdAt','updatedAt','interval','IntervalId','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','models','bulkCreate','sortBy','catch','rewrite','lodash','util','then','VoiceExtension','findAll','uniq'];(function(_0x5df2ff,_0x48300e){var _0x594f25=function(_0x1f5788){while(--_0x1f5788){_0x5df2ff['push'](_0x5df2ff['shift']());}};_0x594f25(++_0x48300e);}(_0xbccd,0x144));var _0xdbcc=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0xbccd[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0xdbcc('0x0'));var util=require(_0xdbcc('0x1'));function rewrite(_0x4635a1,_0x2e0e66){var _0x229477=this;return _0x4635a1['models']['Interval']['findAll']({'raw':!![]})[_0xdbcc('0x2')](function(_0x46bcd4){_0x229477['intervals']=_0x46bcd4;return _0x4635a1['models'][_0xdbcc('0x3')]['findAll']({'where':{'IntervalId':_0x2e0e66['IntervalId']},'raw':!![]});})['then'](function(_0x44eeef){return _0x4635a1['models'][_0xdbcc('0x3')][_0xdbcc('0x4')]({'where':{'exten':{'$in':_[_0xdbcc('0x5')](_[_0xdbcc('0x6')](_0x44eeef,_0xdbcc('0x7')))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xdbcc('0x2')](function(_0x55473b){var _0x36761f=_[_0xdbcc('0x8')](_0x55473b,{'priority':'1'});var _0x30742c=_[_0xdbcc('0x8')](_0x55473b,{'isApp':0x1});var _0x1a67b5=_['groupBy'](_0x30742c,_0xdbcc('0x7'));var _0x4c4d82=[_0xdbcc('0x9'),_0xdbcc('0xa')];var _0x2413d4=[];var _0x1d4a8b=[];for(var _0x3830e8 in _0x1a67b5){if(_0x1a67b5[_0xdbcc('0xb')](_0x3830e8)){_0x229477['priority']=0x2;_0x229477[_0xdbcc('0xc')]=[];_0x229477[_0xdbcc('0xd')]=_[_0xdbcc('0xe')](_0x36761f,{'exten':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x7')]});_0x229477['extensions'][_0xdbcc('0xf')]({'type':_0x1a67b5[_0x3830e8][0x0]['type'],'app':_0xdbcc('0x10'),'appdata':util[_0xdbcc('0x11')](_0xdbcc('0x12'),_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x13')]),'context':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x14')],'exten':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x7')],'priority':_0x229477[_0xdbcc('0x15')]++,'VoiceExtensionId':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x16')]});if(_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x13')]===_0xdbcc('0x17')){_0x229477[_0xdbcc('0xc')][_0xdbcc('0xf')]({'type':_0x1a67b5[_0x3830e8][0x0]['type'],'app':_0xdbcc('0x10'),'appdata':_0xdbcc('0x18')+_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x16')],'context':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x14')],'exten':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x7')],'priority':_0x229477[_0xdbcc('0x15')]++,'VoiceExtensionId':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x16')]});}else if(_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x13')]===_0xdbcc('0x19')){if(_0x229477[_0xdbcc('0xd')]){_0x229477['extensions'][_0xdbcc('0xf')]({'type':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x13')],'app':_0xdbcc('0x10'),'appdata':_0xdbcc('0x1a')+(_0x229477[_0xdbcc('0xd')]['cutdigits']?_0xdbcc('0x1b')+_0x229477[_0xdbcc('0xd')][_0xdbcc('0x1c')]+'}':_0xdbcc('0x1d')),'context':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x14')],'exten':_0x1a67b5[_0x3830e8][0x0]['exten'],'priority':_0x229477['priority']++,'VoiceExtensionId':_0x1a67b5[_0x3830e8][0x0]['VoiceExtensionId']});}_0x229477[_0xdbcc('0xc')][_0xdbcc('0xf')]({'type':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x13')],'app':_0xdbcc('0x10'),'appdata':'CDR(routeid)='+_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x16')],'context':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x14')],'exten':_0x1a67b5[_0x3830e8][0x0]['exten'],'priority':_0x229477[_0xdbcc('0x15')]++,'VoiceExtensionId':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x16')]});var _0x325c27=_0x229477[_0xdbcc('0x15')]++;_0x229477[_0xdbcc('0xc')]['push']({'type':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x13')],'app':_0xdbcc('0x1e'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x325c27+0x2)+'):Goto('+(_0x325c27+0x1)+')','context':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x14')],'exten':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x7')],'priority':_0x325c27,'VoiceExtensionId':_0x1a67b5[_0x3830e8][0x0]['VoiceExtensionId']});if(_0x229477[_0xdbcc('0xd')]){_0x229477['extensions']['push']({'type':_0x1a67b5[_0x3830e8][0x0]['type'],'app':_0xdbcc('0x10'),'appdata':_0x229477[_0xdbcc('0xd')]['cutdigits']?_0xdbcc('0x1f')+_0x229477[_0xdbcc('0xd')][_0xdbcc('0x1c')]+'}':'CDR(prefix)=noprefix','context':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x14')],'exten':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x7')],'priority':_0x229477['priority']++,'VoiceExtensionId':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x16')]});}_0x229477[_0xdbcc('0xc')][_0xdbcc('0xf')]({'type':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x13')],'app':_0xdbcc('0x10'),'appdata':_0xdbcc('0x20')+_0x1a67b5[_0x3830e8][0x0]['VoiceExtensionId'],'context':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x14')],'exten':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x7')],'priority':_0x229477[_0xdbcc('0x15')]++,'VoiceExtensionId':_0x1a67b5[_0x3830e8][0x0]['VoiceExtensionId']});if(_0x229477[_0xdbcc('0xd')]&&_0x229477['extension'][_0xdbcc('0xb')](_0xdbcc('0x21'))&&_0x229477[_0xdbcc('0xd')][_0xdbcc('0x21')]!==_0xdbcc('0x22')){_0x229477[_0xdbcc('0xc')][_0xdbcc('0xf')]({'type':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x13')],'app':'Set','appdata':_0xdbcc('0x23'),'context':_0x1a67b5[_0x3830e8][0x0]['context'],'exten':_0x1a67b5[_0x3830e8][0x0]['exten'],'priority':_0x229477[_0xdbcc('0x15')]++,'VoiceExtensionId':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x16')]});_0x229477[_0xdbcc('0xc')][_0xdbcc('0xf')]({'type':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x13')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x229477['extension'][_0xdbcc('0x21')]||'wav','context':_0x1a67b5[_0x3830e8][0x0]['context'],'exten':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x7')],'priority':_0x229477['priority']++,'VoiceExtensionId':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x16')]});}}_0x229477[_0xdbcc('0xc')][_0xdbcc('0xf')]({'type':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x13')],'app':_0xdbcc('0x10'),'appdata':_0xdbcc('0x24'),'context':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x14')],'exten':_0x1a67b5[_0x3830e8][0x0]['exten'],'priority':_0x229477[_0xdbcc('0x15')]++,'VoiceExtensionId':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x16')]});_0x229477[_0xdbcc('0xc')]['push']({'type':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x13')],'app':_0xdbcc('0x10'),'appdata':_0xdbcc('0x25'),'context':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x14')],'exten':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x7')],'priority':_0x229477[_0xdbcc('0x15')]++,'VoiceExtensionId':_0x1a67b5[_0x3830e8][0x0]['VoiceExtensionId']});_0x229477[_0xdbcc('0xc')][_0xdbcc('0xf')]({'type':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x13')],'app':_0xdbcc('0x10'),'appdata':'MONITOR_OPTIONS=ab','context':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x14')],'exten':_0x1a67b5[_0x3830e8][0x0]['exten'],'priority':_0x229477[_0xdbcc('0x15')]++,'VoiceExtensionId':_0x1a67b5[_0x3830e8][0x0]['VoiceExtensionId']});for(var _0x4195c3=0x0,_0x5c738a=0x0;_0x4195c3<_0x1a67b5[_0x3830e8][_0xdbcc('0x26')];_0x4195c3+=0x1,_0x5c738a=0x0){var _0x43c565=_0x1a67b5[_0x3830e8][_0x4195c3];if(_0x43c565[_0xdbcc('0x13')]){_0x43c565[_0xdbcc('0x13')]=_0x43c565[_0xdbcc('0x13')][_0xdbcc('0x27')]();}var _0x1423d9=[];var _0x41d653=[];delete _0x43c565['id'];delete _0x43c565[_0xdbcc('0x28')];delete _0x43c565[_0xdbcc('0x29')];var _0x4a6085=_0x43c565['interval']!=='*,*,*,*'?[_0x43c565[_0xdbcc('0x2a')]]:_0x43c565[_0xdbcc('0x2b')]?_['map'](_['filter'](_0x229477[_0xdbcc('0x2c')],{'IntervalId':_0x43c565[_0xdbcc('0x2b')]}),_0xdbcc('0x2a')):[];if(_0x43c565[_0xdbcc('0xb')]('tag')){if(_0x43c565['tag']&&_0x43c565[_0xdbcc('0x2d')]!=='--'){_0x1423d9[_0xdbcc('0xf')]({'type':_0x43c565[_0xdbcc('0x13')],'app':_0xdbcc('0x10'),'appdata':_0xdbcc('0x2e')+_0x43c565[_0xdbcc('0x2d')],'context':_0x43c565[_0xdbcc('0x14')],'exten':_0x43c565[_0xdbcc('0x7')],'priority':_0x4a6085['length']+_0x229477[_0xdbcc('0x15')]+_0x5c738a++,'VoiceExtensionId':_0x43c565[_0xdbcc('0x16')]});}}if(_0x43c565[_0xdbcc('0x13')]==='outbound'&&_0x43c565['hasOwnProperty'](_0xdbcc('0x2f'))){if(_0x43c565[_0xdbcc('0x2f')]){_0x1423d9['push']({'type':_0x43c565[_0xdbcc('0x13')],'app':_0xdbcc('0x1e'),'appdata':_0xdbcc('0x30')+_0x43c565[_0xdbcc('0x2f')]+')','context':_0x43c565[_0xdbcc('0x14')],'exten':_0x43c565[_0xdbcc('0x7')],'priority':_0x4a6085[_0xdbcc('0x26')]+_0x229477[_0xdbcc('0x15')]+_0x5c738a++,'VoiceExtensionId':_0x43c565[_0xdbcc('0x16')]});}else{_0x1423d9[_0xdbcc('0xf')]({'type':_0x43c565[_0xdbcc('0x13')],'app':_0xdbcc('0x1e'),'appdata':_0xdbcc('0x31'),'context':_0x43c565[_0xdbcc('0x14')],'exten':_0x43c565[_0xdbcc('0x7')],'priority':_0x4a6085['length']+_0x229477[_0xdbcc('0x15')]+_0x5c738a++,'VoiceExtensionId':_0x43c565['VoiceExtensionId']});}}if(_0x43c565[_0xdbcc('0xb')](_0xdbcc('0x32'))){if(_0x4c4d82[_0xdbcc('0x33')](_0x43c565[_0xdbcc('0x34')][_0xdbcc('0x27')]())>=0x0&&_0x43c565[_0xdbcc('0x35')]!==_0xdbcc('0x36')){if(_0x43c565[_0xdbcc('0x32')]){_0x1423d9['push']({'type':_0x43c565['type'],'app':_0xdbcc('0x1e'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x43c565[_0xdbcc('0x14')],'exten':_0x43c565['exten'],'priority':_0x4a6085[_0xdbcc('0x26')]+_0x229477[_0xdbcc('0x15')]+_0x5c738a++,'VoiceExtensionId':_0x43c565['VoiceExtensionId']});_0x1423d9[_0xdbcc('0xf')]({'type':_0x43c565[_0xdbcc('0x13')],'app':_0xdbcc('0x10'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x43c565['context'],'exten':_0x43c565[_0xdbcc('0x7')],'priority':_0x4a6085[_0xdbcc('0x26')]+_0x229477[_0xdbcc('0x15')]+_0x5c738a++,'VoiceExtensionId':_0x43c565['VoiceExtensionId']});}else{_0x1423d9['push']({'type':_0x43c565[_0xdbcc('0x13')],'app':_0xdbcc('0x1e'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x43c565[_0xdbcc('0x14')],'exten':_0x43c565[_0xdbcc('0x7')],'priority':_0x4a6085[_0xdbcc('0x26')]+_0x229477['priority']+_0x5c738a++,'VoiceExtensionId':_0x43c565['VoiceExtensionId']});_0x1423d9[_0xdbcc('0xf')]({'type':_0x43c565['type'],'app':_0xdbcc('0x10'),'appdata':_0xdbcc('0x37'),'context':_0x43c565['context'],'exten':_0x43c565['exten'],'priority':_0x4a6085['length']+_0x229477['priority']+_0x5c738a++,'VoiceExtensionId':_0x43c565[_0xdbcc('0x16')]});}}}for(var _0x215365=0x0;_0x215365<_0x4a6085[_0xdbcc('0x26')];_0x215365+=0x1){var _0x2d58a3=_0x229477[_0xdbcc('0x15')]+_0x4a6085[_0xdbcc('0x26')];var _0x4f211e=_0x215365===_0x4a6085[_0xdbcc('0x26')]-0x1?_0x229477[_0xdbcc('0x15')]+_0x1423d9[_0xdbcc('0x26')]+_0x41d653['length']+0x2:_0x229477[_0xdbcc('0x15')]+_0x215365+0x1;_0x1423d9[_0xdbcc('0x38')](_0x215365,0x0,{'type':_0x43c565['type'],'app':_0xdbcc('0x39'),'appdata':_0x4a6085[_0x215365]+'?'+_0x43c565['context']+',${EXTEN},'+_0x2d58a3+':'+_0x43c565[_0xdbcc('0x14')]+_0xdbcc('0x3a')+_0x4f211e,'exten':_0x43c565[_0xdbcc('0x7')],'context':_0x43c565[_0xdbcc('0x14')],'priority':_0x229477[_0xdbcc('0x15')]+_0x215365,'VoiceExtensionId':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x16')]});}_0x43c565['priority']=_0x1423d9['length']?_[_0xdbcc('0x3b')](_0x1423d9)['priority']+0x1:_0x229477[_0xdbcc('0x15')];_0x229477[_0xdbcc('0x15')]=(_0x41d653['length']?_[_0xdbcc('0x3b')](_0x41d653)[_0xdbcc('0x15')]:_0x43c565[_0xdbcc('0x15')])+0x1;_0x229477[_0xdbcc('0xc')]=_[_0xdbcc('0x3c')](_0x229477[_0xdbcc('0xc')],_0x1423d9,[_0x43c565],_0x41d653);}_0x229477[_0xdbcc('0xc')][_0xdbcc('0xf')]({'type':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x13')],'app':'Hangup','exten':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x7')],'context':_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x14')],'priority':_0x229477[_0xdbcc('0x15')],'VoiceExtensionId':_0x1a67b5[_0x3830e8][0x0]['VoiceExtensionId']});_0x2413d4[_0xdbcc('0xf')](_0x1a67b5[_0x3830e8][0x0][_0xdbcc('0x16')]);_0x1d4a8b=_[_0xdbcc('0x3c')](_0x1d4a8b,_0x229477[_0xdbcc('0xc')]);}}return _0x4635a1['transaction'](function(_0x48c2c8){return _0x4635a1['models']['VoiceExtension']['destroy']({'where':{'VoiceExtensionId':{'$in':_0x2413d4}},'transaction':_0x48c2c8})[_0xdbcc('0x2')](function(_0x48f101){return _0x4635a1[_0xdbcc('0x3d')][_0xdbcc('0x3')][_0xdbcc('0x3e')](_[_0xdbcc('0x3f')](_0x1d4a8b,_0xdbcc('0x15')),{'transaction':_0x48c2c8});});});})[_0xdbcc('0x40')](function(_0x434727){console['error'](_0x434727);});}exports[_0xdbcc('0x41')]=rewrite; \ No newline at end of file +var _0xe36c=['cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','interval','*,*,*,*','IntervalId','map','intervals','tag','CDR(tag)=','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','sortBy','error','lodash','util','models','Interval','findAll','then','VoiceExtension','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find','push','type','format','context','VoiceExtensionId','inbound','Set','CDR(destination)='];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe36c,0x13e));var _0xce36=function(_0x474ff5,_0x5241ce){_0x474ff5=_0x474ff5-0x0;var _0x53ba23=_0xe36c[_0x474ff5];return _0x53ba23;};'use strict';var _=require(_0xce36('0x0'));var util=require(_0xce36('0x1'));function rewrite(_0x11ccea,_0x82e59e){var _0x19a249=this;return _0x11ccea[_0xce36('0x2')][_0xce36('0x3')][_0xce36('0x4')]({'raw':!![]})[_0xce36('0x5')](function(_0x3d72c3){_0x19a249['intervals']=_0x3d72c3;return _0x11ccea[_0xce36('0x2')][_0xce36('0x6')]['findAll']({'where':{'IntervalId':_0x82e59e['IntervalId']},'raw':!![]});})[_0xce36('0x5')](function(_0x425764){return _0x11ccea[_0xce36('0x2')][_0xce36('0x6')][_0xce36('0x4')]({'where':{'exten':{'$in':_[_0xce36('0x7')](_['map'](_0x425764,_0xce36('0x8')))}},'order':[{'raw':_0xce36('0x9')}],'raw':!![]});})[_0xce36('0x5')](function(_0x5947ad){var _0x2e6986=_[_0xce36('0xa')](_0x5947ad,{'priority':'1'});var _0x4f716a=_[_0xce36('0xa')](_0x5947ad,{'isApp':0x1});var _0x909d68=_[_0xce36('0xb')](_0x4f716a,_0xce36('0x8'));var _0x4b403c=[_0xce36('0xc'),_0xce36('0xd')];var _0x433d79=[];var _0x23c021=[];for(var _0x4da026 in _0x909d68){if(_0x909d68[_0xce36('0xe')](_0x4da026)){_0x19a249[_0xce36('0xf')]=0x2;_0x19a249[_0xce36('0x10')]=[];_0x19a249[_0xce36('0x11')]=_[_0xce36('0x12')](_0x2e6986,{'exten':_0x909d68[_0x4da026][0x0][_0xce36('0x8')]});_0x19a249[_0xce36('0x10')][_0xce36('0x13')]({'type':_0x909d68[_0x4da026][0x0][_0xce36('0x14')],'app':'Set','appdata':util[_0xce36('0x15')]('CDR(type)=%s',_0x909d68[_0x4da026][0x0][_0xce36('0x14')]),'context':_0x909d68[_0x4da026][0x0][_0xce36('0x16')],'exten':_0x909d68[_0x4da026][0x0][_0xce36('0x8')],'priority':_0x19a249['priority']++,'VoiceExtensionId':_0x909d68[_0x4da026][0x0][_0xce36('0x17')]});if(_0x909d68[_0x4da026][0x0][_0xce36('0x14')]===_0xce36('0x18')){_0x19a249[_0xce36('0x10')][_0xce36('0x13')]({'type':_0x909d68[_0x4da026][0x0][_0xce36('0x14')],'app':_0xce36('0x19'),'appdata':'CDR(routeid)='+_0x909d68[_0x4da026][0x0][_0xce36('0x17')],'context':_0x909d68[_0x4da026][0x0][_0xce36('0x16')],'exten':_0x909d68[_0x4da026][0x0]['exten'],'priority':_0x19a249[_0xce36('0xf')]++,'VoiceExtensionId':_0x909d68[_0x4da026][0x0][_0xce36('0x17')]});}else if(_0x909d68[_0x4da026][0x0]['type']==='outbound'){if(_0x19a249[_0xce36('0x11')]){_0x19a249[_0xce36('0x10')][_0xce36('0x13')]({'type':_0x909d68[_0x4da026][0x0][_0xce36('0x14')],'app':'Set','appdata':_0xce36('0x1a')+(_0x19a249[_0xce36('0x11')][_0xce36('0x1b')]?_0xce36('0x1c')+_0x19a249[_0xce36('0x11')]['cutdigits']+'}':_0xce36('0x1d')),'context':_0x909d68[_0x4da026][0x0][_0xce36('0x16')],'exten':_0x909d68[_0x4da026][0x0][_0xce36('0x8')],'priority':_0x19a249[_0xce36('0xf')]++,'VoiceExtensionId':_0x909d68[_0x4da026][0x0][_0xce36('0x17')]});}_0x19a249[_0xce36('0x10')][_0xce36('0x13')]({'type':_0x909d68[_0x4da026][0x0][_0xce36('0x14')],'app':'Set','appdata':'CDR(routeid)='+_0x909d68[_0x4da026][0x0][_0xce36('0x17')],'context':_0x909d68[_0x4da026][0x0][_0xce36('0x16')],'exten':_0x909d68[_0x4da026][0x0]['exten'],'priority':_0x19a249[_0xce36('0xf')]++,'VoiceExtensionId':_0x909d68[_0x4da026][0x0][_0xce36('0x17')]});var _0x52e373=_0x19a249[_0xce36('0xf')]++;_0x19a249[_0xce36('0x10')][_0xce36('0x13')]({'type':_0x909d68[_0x4da026][0x0][_0xce36('0x14')],'app':_0xce36('0x1e'),'appdata':_0xce36('0x1f')+(_0x52e373+0x2)+'):Goto('+(_0x52e373+0x1)+')','context':_0x909d68[_0x4da026][0x0][_0xce36('0x16')],'exten':_0x909d68[_0x4da026][0x0]['exten'],'priority':_0x52e373,'VoiceExtensionId':_0x909d68[_0x4da026][0x0]['VoiceExtensionId']});if(_0x19a249['extension']){_0x19a249[_0xce36('0x10')][_0xce36('0x13')]({'type':_0x909d68[_0x4da026][0x0][_0xce36('0x14')],'app':_0xce36('0x19'),'appdata':_0x19a249[_0xce36('0x11')][_0xce36('0x1b')]?_0xce36('0x20')+_0x19a249[_0xce36('0x11')]['cutdigits']+'}':_0xce36('0x21'),'context':_0x909d68[_0x4da026][0x0]['context'],'exten':_0x909d68[_0x4da026][0x0][_0xce36('0x8')],'priority':_0x19a249['priority']++,'VoiceExtensionId':_0x909d68[_0x4da026][0x0][_0xce36('0x17')]});}_0x19a249[_0xce36('0x10')][_0xce36('0x13')]({'type':_0x909d68[_0x4da026][0x0][_0xce36('0x14')],'app':_0xce36('0x19'),'appdata':_0xce36('0x22')+_0x909d68[_0x4da026][0x0][_0xce36('0x17')],'context':_0x909d68[_0x4da026][0x0][_0xce36('0x16')],'exten':_0x909d68[_0x4da026][0x0][_0xce36('0x8')],'priority':_0x19a249[_0xce36('0xf')]++,'VoiceExtensionId':_0x909d68[_0x4da026][0x0]['VoiceExtensionId']});if(_0x19a249['extension']&&_0x19a249[_0xce36('0x11')][_0xce36('0xe')](_0xce36('0x23'))&&_0x19a249[_0xce36('0x11')][_0xce36('0x23')]!==_0xce36('0x24')){_0x19a249['extensions'][_0xce36('0x13')]({'type':_0x909d68[_0x4da026][0x0]['type'],'app':_0xce36('0x19'),'appdata':_0xce36('0x25'),'context':_0x909d68[_0x4da026][0x0][_0xce36('0x16')],'exten':_0x909d68[_0x4da026][0x0][_0xce36('0x8')],'priority':_0x19a249[_0xce36('0xf')]++,'VoiceExtensionId':_0x909d68[_0x4da026][0x0][_0xce36('0x17')]});_0x19a249[_0xce36('0x10')][_0xce36('0x13')]({'type':_0x909d68[_0x4da026][0x0][_0xce36('0x14')],'app':_0xce36('0x19'),'appdata':_0xce36('0x26')+_0x19a249[_0xce36('0x11')]['recordingFormat']||'wav','context':_0x909d68[_0x4da026][0x0][_0xce36('0x16')],'exten':_0x909d68[_0x4da026][0x0]['exten'],'priority':_0x19a249[_0xce36('0xf')]++,'VoiceExtensionId':_0x909d68[_0x4da026][0x0][_0xce36('0x17')]});}}_0x19a249['extensions']['push']({'type':_0x909d68[_0x4da026][0x0][_0xce36('0x14')],'app':_0xce36('0x19'),'appdata':_0xce36('0x27'),'context':_0x909d68[_0x4da026][0x0][_0xce36('0x16')],'exten':_0x909d68[_0x4da026][0x0][_0xce36('0x8')],'priority':_0x19a249['priority']++,'VoiceExtensionId':_0x909d68[_0x4da026][0x0]['VoiceExtensionId']});_0x19a249[_0xce36('0x10')][_0xce36('0x13')]({'type':_0x909d68[_0x4da026][0x0][_0xce36('0x14')],'app':_0xce36('0x19'),'appdata':_0xce36('0x28'),'context':_0x909d68[_0x4da026][0x0]['context'],'exten':_0x909d68[_0x4da026][0x0][_0xce36('0x8')],'priority':_0x19a249['priority']++,'VoiceExtensionId':_0x909d68[_0x4da026][0x0][_0xce36('0x17')]});_0x19a249[_0xce36('0x10')][_0xce36('0x13')]({'type':_0x909d68[_0x4da026][0x0][_0xce36('0x14')],'app':'Set','appdata':_0xce36('0x29'),'context':_0x909d68[_0x4da026][0x0][_0xce36('0x16')],'exten':_0x909d68[_0x4da026][0x0][_0xce36('0x8')],'priority':_0x19a249[_0xce36('0xf')]++,'VoiceExtensionId':_0x909d68[_0x4da026][0x0][_0xce36('0x17')]});for(var _0x278798=0x0,_0x2a2f59=0x0;_0x278798<_0x909d68[_0x4da026][_0xce36('0x2a')];_0x278798+=0x1,_0x2a2f59=0x0){var _0x2aafcb=_0x909d68[_0x4da026][_0x278798];if(_0x2aafcb['type']){_0x2aafcb[_0xce36('0x14')]=_0x2aafcb[_0xce36('0x14')][_0xce36('0x2b')]();}var _0x35bcc6=[];var _0x4aa54e=[];delete _0x2aafcb['id'];delete _0x2aafcb[_0xce36('0x2c')];delete _0x2aafcb['updatedAt'];var _0x1e36c6=_0x2aafcb[_0xce36('0x2d')]!==_0xce36('0x2e')?[_0x2aafcb[_0xce36('0x2d')]]:_0x2aafcb[_0xce36('0x2f')]?_[_0xce36('0x30')](_['filter'](_0x19a249[_0xce36('0x31')],{'IntervalId':_0x2aafcb[_0xce36('0x2f')]}),_0xce36('0x2d')):[];if(_0x2aafcb[_0xce36('0xe')]('tag')){if(_0x2aafcb['tag']&&_0x2aafcb[_0xce36('0x32')]!=='--'){_0x35bcc6[_0xce36('0x13')]({'type':_0x2aafcb[_0xce36('0x14')],'app':'Set','appdata':_0xce36('0x33')+_0x2aafcb[_0xce36('0x32')],'context':_0x2aafcb['context'],'exten':_0x2aafcb[_0xce36('0x8')],'priority':_0x1e36c6[_0xce36('0x2a')]+_0x19a249[_0xce36('0xf')]+_0x2a2f59++,'VoiceExtensionId':_0x2aafcb[_0xce36('0x17')]});}}if(_0x2aafcb[_0xce36('0x14')]==='outbound'&&_0x2aafcb['hasOwnProperty'](_0xce36('0x34'))){if(_0x2aafcb['callerID']){_0x35bcc6[_0xce36('0x13')]({'type':_0x2aafcb[_0xce36('0x14')],'app':_0xce36('0x1e'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)='+_0x2aafcb[_0xce36('0x34')]+')','context':_0x2aafcb['context'],'exten':_0x2aafcb[_0xce36('0x8')],'priority':_0x1e36c6[_0xce36('0x2a')]+_0x19a249['priority']+_0x2a2f59++,'VoiceExtensionId':_0x2aafcb[_0xce36('0x17')]});}else{_0x35bcc6[_0xce36('0x13')]({'type':_0x2aafcb[_0xce36('0x14')],'app':_0xce36('0x1e'),'appdata':_0xce36('0x35'),'context':_0x2aafcb['context'],'exten':_0x2aafcb[_0xce36('0x8')],'priority':_0x1e36c6[_0xce36('0x2a')]+_0x19a249[_0xce36('0xf')]+_0x2a2f59++,'VoiceExtensionId':_0x2aafcb[_0xce36('0x17')]});}}if(_0x2aafcb[_0xce36('0xe')](_0xce36('0x36'))){if(_0x4b403c['indexOf'](_0x2aafcb['app'][_0xce36('0x2b')]())>=0x0&&_0x2aafcb[_0xce36('0x37')]!==_0xce36('0x38')){if(_0x2aafcb[_0xce36('0x36')]){_0x35bcc6[_0xce36('0x13')]({'type':_0x2aafcb['type'],'app':_0xce36('0x1e'),'appdata':_0xce36('0x39'),'context':_0x2aafcb[_0xce36('0x16')],'exten':_0x2aafcb['exten'],'priority':_0x1e36c6[_0xce36('0x2a')]+_0x19a249[_0xce36('0xf')]+_0x2a2f59++,'VoiceExtensionId':_0x2aafcb[_0xce36('0x17')]});_0x35bcc6[_0xce36('0x13')]({'type':_0x2aafcb[_0xce36('0x14')],'app':_0xce36('0x19'),'appdata':_0xce36('0x3a'),'context':_0x2aafcb[_0xce36('0x16')],'exten':_0x2aafcb[_0xce36('0x8')],'priority':_0x1e36c6['length']+_0x19a249['priority']+_0x2a2f59++,'VoiceExtensionId':_0x2aafcb[_0xce36('0x17')]});}else{_0x35bcc6[_0xce36('0x13')]({'type':_0x2aafcb['type'],'app':'ExecIf','appdata':_0xce36('0x3b'),'context':_0x2aafcb[_0xce36('0x16')],'exten':_0x2aafcb[_0xce36('0x8')],'priority':_0x1e36c6[_0xce36('0x2a')]+_0x19a249['priority']+_0x2a2f59++,'VoiceExtensionId':_0x2aafcb[_0xce36('0x17')]});_0x35bcc6[_0xce36('0x13')]({'type':_0x2aafcb[_0xce36('0x14')],'app':_0xce36('0x19'),'appdata':_0xce36('0x3c'),'context':_0x2aafcb[_0xce36('0x16')],'exten':_0x2aafcb[_0xce36('0x8')],'priority':_0x1e36c6[_0xce36('0x2a')]+_0x19a249['priority']+_0x2a2f59++,'VoiceExtensionId':_0x2aafcb['VoiceExtensionId']});}}}for(var _0x1cfa84=0x0;_0x1cfa84<_0x1e36c6['length'];_0x1cfa84+=0x1){var _0x199223=_0x19a249[_0xce36('0xf')]+_0x1e36c6[_0xce36('0x2a')];var _0x590838=_0x1cfa84===_0x1e36c6[_0xce36('0x2a')]-0x1?_0x19a249['priority']+_0x35bcc6[_0xce36('0x2a')]+_0x4aa54e[_0xce36('0x2a')]+0x2:_0x19a249[_0xce36('0xf')]+_0x1cfa84+0x1;_0x35bcc6['splice'](_0x1cfa84,0x0,{'type':_0x2aafcb[_0xce36('0x14')],'app':_0xce36('0x3d'),'appdata':_0x1e36c6[_0x1cfa84]+'?'+_0x2aafcb[_0xce36('0x16')]+_0xce36('0x3e')+_0x199223+':'+_0x2aafcb['context']+_0xce36('0x3e')+_0x590838,'exten':_0x2aafcb[_0xce36('0x8')],'context':_0x2aafcb[_0xce36('0x16')],'priority':_0x19a249[_0xce36('0xf')]+_0x1cfa84,'VoiceExtensionId':_0x909d68[_0x4da026][0x0][_0xce36('0x17')]});}_0x2aafcb['priority']=_0x35bcc6['length']?_[_0xce36('0x3f')](_0x35bcc6)[_0xce36('0xf')]+0x1:_0x19a249[_0xce36('0xf')];_0x19a249[_0xce36('0xf')]=(_0x4aa54e['length']?_[_0xce36('0x3f')](_0x4aa54e)[_0xce36('0xf')]:_0x2aafcb[_0xce36('0xf')])+0x1;_0x19a249[_0xce36('0x10')]=_[_0xce36('0x40')](_0x19a249[_0xce36('0x10')],_0x35bcc6,[_0x2aafcb],_0x4aa54e);}_0x19a249[_0xce36('0x10')]['push']({'type':_0x909d68[_0x4da026][0x0][_0xce36('0x14')],'app':'Hangup','exten':_0x909d68[_0x4da026][0x0][_0xce36('0x8')],'context':_0x909d68[_0x4da026][0x0][_0xce36('0x16')],'priority':_0x19a249['priority'],'VoiceExtensionId':_0x909d68[_0x4da026][0x0][_0xce36('0x17')]});_0x433d79[_0xce36('0x13')](_0x909d68[_0x4da026][0x0][_0xce36('0x17')]);_0x23c021=_[_0xce36('0x40')](_0x23c021,_0x19a249[_0xce36('0x10')]);}}return _0x11ccea[_0xce36('0x41')](function(_0x5c6ccd){return _0x11ccea[_0xce36('0x2')][_0xce36('0x6')][_0xce36('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x433d79}},'transaction':_0x5c6ccd})[_0xce36('0x5')](function(_0x7235d1){return _0x11ccea[_0xce36('0x2')][_0xce36('0x6')]['bulkCreate'](_[_0xce36('0x43')](_0x23c021,_0xce36('0xf')),{'transaction':_0x5c6ccd});});});})['catch'](function(_0x171161){console[_0xce36('0x44')](_0x171161);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index d3f32b9..5f52e3c 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 _0x794e=['squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','then','push','catch','Error\x20while\x20creating\x20contact:\x20','message','stringify','inspect','into','cm_hopper','fromQuery','ContactId','updatedAt','select','field','NOW()','scheduledAt','toString','createdAt','from','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','insert','cm_contacts','str','calleridnum','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','dialCheckDuplicateType','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','BlackLists','get','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','resolve','createReadStream','parse','pause','info','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','util','lodash'];(function(_0x5af673,_0x4b6254){var _0x42f51b=function(_0x4afad4){while(--_0x4afad4){_0x5af673['push'](_0x5af673['shift']());}};_0x42f51b(++_0x4b6254);}(_0x794e,0x69));var _0xe794=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x794e[_0x39d544];return _0x5a5ff2;};'use strict';var BPromise=require('bluebird');var util=require(_0xe794('0x0'));var _=require(_0xe794('0x1'));var fs=require('fs');var squel=require(_0xe794('0x2'));var Papa=require(_0xe794('0x3'));var Redis=require(_0xe794('0x4'));var db=require(_0xe794('0x5'))['db'];var config=require(_0xe794('0x6'));var logger=require(_0xe794('0x7'))('api');config[_0xe794('0x8')]=_[_0xe794('0x9')](config[_0xe794('0x8')],{'host':_0xe794('0xa'),'port':0x18eb});var socket=require(_0xe794('0xb'))(new Redis(config[_0xe794('0x8')]));require(_0xe794('0xc'))['register'](socket);try{if(!process[_0xe794('0xd')][0x2]||process[_0xe794('0xd')][0x2]===_0xe794('0xe')||process[_0xe794('0xd')][0x2]===_0xe794('0xf')){throw new Error(_0xe794('0x10'));}var FILEPATH=process['argv'][0x2];if(!process[_0xe794('0xd')][0x3]||process['argv'][0x3]===_0xe794('0xe')||process[_0xe794('0xd')][0x3]===_0xe794('0xf')||!process[_0xe794('0xd')][0x4]||process['argv'][0x4]===_0xe794('0xe')||process[_0xe794('0xd')][0x4]===_0xe794('0xf')){throw new Error(_0xe794('0x11'));}var FIELDS=_[_0xe794('0x12')](process[_0xe794('0xd')][0x3]['split'](','),process[_0xe794('0xd')][0x4][_0xe794('0x13')](','));if(!process[_0xe794('0xd')][0x5]||process[_0xe794('0xd')][0x5]===_0xe794('0xe')||process[_0xe794('0xd')][0x5]===_0xe794('0xf')){throw new Error(_0xe794('0x14'));}var LISTID=process[_0xe794('0xd')][0x5];var COMPANYID=process[_0xe794('0xd')][0x6]&&process[_0xe794('0xd')][0x6]!==_0xe794('0xe')&&process[_0xe794('0xd')][0x6]!==_0xe794('0xf')?process[_0xe794('0xd')][0x6]:null;var DUPLICATES=process[_0xe794('0xd')][0x7]&&process[_0xe794('0xd')][0x7]!=='undefined'&&process[_0xe794('0xd')][0x7]!==_0xe794('0xf')?process[_0xe794('0xd')][0x7]:null;if(!process[_0xe794('0xd')][0x8]||process['argv'][0x8]==='undefined'||process[_0xe794('0xd')][0x8]===_0xe794('0xf')){throw new Error(_0xe794('0x15'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x33af8b){logger[_0xe794('0x16')](_0x33af8b);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(_0x295d68,_0x4d3989,_0x26a48f,_0x1e5cfe){var _0x194a1d={'message':_0x4d3989};_0x194a1d[_0x295d68]=!![];if(_0x26a48f){_0x194a1d[_0xe794('0x17')]=_0x26a48f;}if(_0x1e5cfe){_0x194a1d['index']=_0x1e5cfe;}return _0x194a1d;}function isEmail(_0x3a6ce2){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))*$/[_0xe794('0x18')](_0x3a6ce2);}function checkRow(_0x2bad67,_0x3f76b0,_0x3ea9a5){return new BPromise(function(_0x33bd41,_0xa0f3e2){if(_['isNil'](_0x2bad67)){return _0xa0f3e2(handleCheckRowError(_0xe794('0x16'),_0xe794('0x19'),null,_0x3ea9a5));}if(_0x2bad67[_0xe794('0x1a')]&&_0x2bad67[_0xe794('0x1a')][_0xe794('0x1b')]){var _0x53a4f2=_[_0xe794('0x1c')](_0x2bad67['errors'],'message')['join'](';');return _0xa0f3e2(handleCheckRowError(_0xe794('0x16'),_0x53a4f2,null,_0x3ea9a5));}var _0x1142fc={};for(var _0x5f2dfb in FIELDS){if(FIELDS[_0xe794('0x1d')](_0x5f2dfb)&&FIELDS[_0x5f2dfb]){_0x1142fc[_0x5f2dfb]=_0x2bad67['data'][0x0][FIELDS[_0x5f2dfb]]||_0x2bad67[_0xe794('0x1e')][0x0]['\ufeff'+FIELDS[_0x5f2dfb]];}}if(!_0x1142fc[_0xe794('0x1f')]){return _0xa0f3e2(handleCheckRowError('error',_0xe794('0x20'),null,_0x3ea9a5));}if(!_0x1142fc[_0xe794('0x21')]){return _0xa0f3e2(handleCheckRowError(_0xe794('0x16'),_0xe794('0x22'),null,_0x3ea9a5));}if(_0x1142fc['birthDate']){var _0x1a201b=moment(_0x1142fc[_0xe794('0x23')],_0xe794('0x24'));if(!_0x1a201b[_0xe794('0x25')]()){return _0xa0f3e2(handleCheckRowError(_0xe794('0x16'),_0xe794('0x26'),null,_0x3ea9a5));}}if(_0x1142fc[_0xe794('0x27')]){if(!isEmail(_0x1142fc[_0xe794('0x27')])){return _0xa0f3e2(handleCheckRowError(_0xe794('0x16'),'email\x20format\x20is\x20not\x20valid!',null,_0x3ea9a5));}}_0x1142fc[_0xe794('0x28')]=LISTID;_0x1142fc[_0xe794('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xe794('0x1b')]&&_0x3f76b0){var _0x2cc614={};for(var _0x368b35=0x0,_0x397c00=DUPLICATES['length'];_0x368b35<_0x397c00;_0x368b35+=0x1){_0x2cc614[DUPLICATES[_0x368b35]]=_0x1142fc[DUPLICATES[_0x368b35]];}var _0x34e7a5=_[_0xe794('0x2a')](_0x3f76b0,_0x2cc614);if(_0x34e7a5){return _0xa0f3e2(handleCheckRowError(_0xe794('0x2b'),_0xe794('0x2c'),_0x34e7a5,_0x3ea9a5));}}return db['CmContact']['create'](_0x1142fc,{'raw':!![],'hooks':![],'fields':_['keys'](_0x1142fc)})[_0xe794('0x2d')](function(_0x17676d){if(DUPLICATES&&DUPLICATES[_0xe794('0x1b')]&&_0x3f76b0){_0x3f76b0[_0xe794('0x2e')](_['pick'](_0x1142fc,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x17676d['id'];return _0x33bd41();})[_0xe794('0x2f')](function(_0xa48cf9){return _0xa0f3e2(handleCheckRowError('error',_0xe794('0x30')+(_0xa48cf9[_0xe794('0x31')]||JSON[_0xe794('0x32')](_0xa48cf9)),null,_0x3ea9a5));});});}function checkHopper(){function _0x586769(){return function(_0x59f9c7){logger[_0xe794('0x16')]('cmContact','checkHopper',util[_0xe794('0x33')](_0x59f9c7,{'showHidden':![],'depth':null}));};}var _0x83d76f=function(_0x3639c7,_0x335ba9){var _0x18dfa0=squel['insert']()[_0xe794('0x34')](_0xe794('0x35'))[_0xe794('0x36')]([_0xe794('0x21'),'scheduledAt',_0xe794('0x37'),'ListId',_0x335ba9,'createdAt',_0xe794('0x38')],squel[_0xe794('0x39')]()[_0xe794('0x3a')]('phone','phone')['field'](_0xe794('0x3b'),_0xe794('0x3c'))[_0xe794('0x3a')]('id',_0xe794('0x37'))[_0xe794('0x3a')](LISTID[_0xe794('0x3d')](),_0xe794('0x28'))[_0xe794('0x3a')](_0x3639c7['id'][_0xe794('0x3d')](),_0x335ba9)['field'](_0xe794('0x3b'),_0xe794('0x3e'))[_0xe794('0x3a')](_0xe794('0x3b'),'updatedAt')[_0xe794('0x3f')]('cm_contacts')[_0xe794('0x40')](_0xe794('0x41'))[_0xe794('0x40')](_0xe794('0x42'),LISTID[_0xe794('0x3d')]())[_0xe794('0x40')](_0xe794('0x43'))[_0xe794('0x40')](_0xe794('0x44'),squel['select']()[_0xe794('0x3a')](_0xe794('0x21'))[_0xe794('0x3f')](_0xe794('0x35'))[_0xe794('0x40')](_0x335ba9+_0xe794('0x45'),_0x3639c7['id'][_0xe794('0x3d')]())))[_0xe794('0x3d')]();return _0x18dfa0;};var _0x4fde78=function(_0x52161b,_0x1ca1a2){var _0x255a48=squel[_0xe794('0x46')]()['into'](_0xe794('0x35'))['fromQuery']([_0xe794('0x21'),_0xe794('0x3c'),_0xe794('0x37'),'ListId',_0x1ca1a2,'createdAt','updatedAt'],squel[_0xe794('0x39')]()[_0xe794('0x3a')](_0xe794('0x21'),_0xe794('0x21'))[_0xe794('0x3a')](_0xe794('0x3b'),_0xe794('0x3c'))[_0xe794('0x3a')]('id',_0xe794('0x37'))['field'](LISTID[_0xe794('0x3d')](),_0xe794('0x28'))[_0xe794('0x3a')](_0x52161b['id'][_0xe794('0x3d')](),_0x1ca1a2)[_0xe794('0x3a')](_0xe794('0x3b'),_0xe794('0x3e'))[_0xe794('0x3a')]('NOW()','updatedAt')[_0xe794('0x3f')](_0xe794('0x47'))[_0xe794('0x40')](_0xe794('0x41'))[_0xe794('0x40')](_0xe794('0x42'),LISTID[_0xe794('0x3d')]())[_0xe794('0x40')]('id\x20IN\x20?',squel[_0xe794('0x48')](hopperContacts))[_0xe794('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0xe794('0x40')](_0xe794('0x44'),squel[_0xe794('0x39')]()[_0xe794('0x3a')](_0xe794('0x49'))[_0xe794('0x3f')]('cm_hopper_final')[_0xe794('0x40')](_0x1ca1a2+'\x20=\x20?',_0x52161b['id'][_0xe794('0x3d')]()))[_0xe794('0x40')](_0xe794('0x44'),squel[_0xe794('0x39')]()[_0xe794('0x3a')](_0xe794('0x21'))['from']('cm_hopper')[_0xe794('0x40')](_0x1ca1a2+_0xe794('0x45'),_0x52161b['id']['toString']())))[_0xe794('0x3d')]();return _0x255a48;};function _0x292175(_0x2288cb,_0x4899c7){var _0x238f14=squel[_0xe794('0x46')]()[_0xe794('0x34')](_0xe794('0x35'))[_0xe794('0x36')]([_0xe794('0x21'),_0xe794('0x3c'),_0xe794('0x37'),_0xe794('0x28'),_0x4899c7,_0xe794('0x3e'),_0xe794('0x38')],squel[_0xe794('0x39')]()[_0xe794('0x3a')]('phone',_0xe794('0x21'))[_0xe794('0x3a')]('NOW()',_0xe794('0x3c'))[_0xe794('0x3a')]('id',_0xe794('0x37'))[_0xe794('0x3a')](LISTID[_0xe794('0x3d')](),'ListId')[_0xe794('0x3a')](_0x2288cb['id'][_0xe794('0x3d')](),_0x4899c7)[_0xe794('0x3a')](_0xe794('0x3b'),_0xe794('0x3e'))[_0xe794('0x3a')]('NOW()',_0xe794('0x38'))[_0xe794('0x3f')]('cm_contacts')[_0xe794('0x40')](_0xe794('0x41'))[_0xe794('0x40')]('ListId\x20=\x20?',LISTID[_0xe794('0x3d')]())[_0xe794('0x40')](_0xe794('0x4a'),squel['str'](hopperContacts))[_0xe794('0x40')](_0xe794('0x43')))[_0xe794('0x3d')]();return _0x238f14;}function _0x1140ba(_0x3c11ed,_0x2d5eed){var _0x28918c=squel[_0xe794('0x46')]()[_0xe794('0x34')](_0xe794('0x4b'))[_0xe794('0x36')]([_0xe794('0x21'),_0xe794('0x37'),'ListId',_0x2d5eed,_0xe794('0x3e'),_0xe794('0x38')],squel[_0xe794('0x39')]()[_0xe794('0x3a')](_0xe794('0x21'),'phone')['field']('id',_0xe794('0x37'))[_0xe794('0x3a')](LISTID[_0xe794('0x3d')](),_0xe794('0x28'))[_0xe794('0x3a')](_0x3c11ed['id'][_0xe794('0x3d')](),_0x2d5eed)['field'](_0xe794('0x3b'),_0xe794('0x3e'))[_0xe794('0x3a')]('NOW()','updatedAt')[_0xe794('0x3f')](_0xe794('0x47'))[_0xe794('0x40')](_0xe794('0x41'))['where'](_0xe794('0x42'),LISTID['toString']())[_0xe794('0x40')]('id\x20IN\x20?',squel['str'](hopperContacts))['where'](_0xe794('0x43')))['toString']();return _0x28918c;}return db[_0xe794('0x4c')][_0xe794('0x4d')]({'where':{'type':_0xe794('0x4e')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0xe794('0x4f')],'as':_0xe794('0x50'),'where':{'id':LISTID}}]})[_0xe794('0x2d')](function(_0x1d2b07){var _0x38180a=[];if(_0x1d2b07){var _0x57fec9;for(var _0x266f09=0x0,_0x757ca7;_0x266f09<_0x1d2b07[_0xe794('0x1b')];_0x266f09+=0x1){_0x757ca7=_0x1d2b07[_0x266f09]['get']({'plain':!![]});switch(_0x757ca7[_0xe794('0x51')]){case _0xe794('0x52'):_0x38180a[_0xe794('0x2e')](db[_0xe794('0x53')][_0xe794('0x54')](_0x4fde78(_0x757ca7,_0xe794('0x55')))[_0xe794('0x2d')](function(){})[_0xe794('0x2f')](_0x586769()));break;case _0xe794('0x56'):_0x38180a[_0xe794('0x2e')](db[_0xe794('0x53')][_0xe794('0x54')](_0x83d76f(_0x757ca7,_0xe794('0x55')))[_0xe794('0x2d')](function(){})[_0xe794('0x2f')](_0x586769()));break;default:_0x38180a[_0xe794('0x2e')](db['sequelize'][_0xe794('0x54')](_0x292175(_0x757ca7,'VoiceQueueId'))[_0xe794('0x2d')](function(){})[_0xe794('0x2f')](_0x586769()));}}}return _0x38180a;})[_0xe794('0x57')]()['then'](function(){return db[_0xe794('0x4c')][_0xe794('0x4d')]({'where':{'type':_0xe794('0x4e')},'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xe794('0x58'),'where':{'id':LISTID}}]})[_0xe794('0x2d')](function(_0x1264d3){var _0x182393=[];if(_0x1264d3){var _0x5b9175;for(var _0x4e7a39=0x0,_0x80f4cf;_0x4e7a39<_0x1264d3[_0xe794('0x1b')];_0x4e7a39+=0x1){_0x80f4cf=_0x1264d3[_0x4e7a39][_0xe794('0x59')]({'plain':!![]});_0x182393[_0xe794('0x2e')](db[_0xe794('0x53')][_0xe794('0x54')](_0x1140ba(_0x80f4cf,_0xe794('0x55')))['then'](function(){})[_0xe794('0x2f')](_0x586769()));}}return _0x182393;})[_0xe794('0x57')]();})[_0xe794('0x2d')](function(){return db['Campaign'][_0xe794('0x4d')]({'attributes':['id',_0xe794('0x51')],'include':[{'model':db[_0xe794('0x4f')],'as':_0xe794('0x50'),'where':{'id':LISTID}}]})[_0xe794('0x2d')](function(_0x2bf16a){var _0x33b1ef=[];if(_0x2bf16a){for(var _0xa3edbc=0x0,_0x31d41e;_0xa3edbc<_0x2bf16a[_0xe794('0x1b')];_0xa3edbc+=0x1){_0x31d41e=_0x2bf16a[_0xa3edbc][_0xe794('0x59')]({'plain':!![]});switch(_0x31d41e['dialCheckDuplicateType']){case'always':_0x33b1ef[_0xe794('0x2e')](db['sequelize'][_0xe794('0x54')](_0x4fde78(_0x31d41e,_0xe794('0x5a')))[_0xe794('0x2d')](function(){})[_0xe794('0x2f')](_0x586769()));break;case _0xe794('0x56'):_0x33b1ef[_0xe794('0x2e')](db[_0xe794('0x53')][_0xe794('0x54')](_0x83d76f(_0x31d41e,_0xe794('0x5a')))['then'](function(){})[_0xe794('0x2f')](_0x586769()));break;default:_0x33b1ef[_0xe794('0x2e')](db[_0xe794('0x53')]['query'](_0x292175(_0x31d41e,_0xe794('0x5a')))[_0xe794('0x2d')](function(){})['catch'](_0x586769()));}}}return _0x33b1ef;})[_0xe794('0x57')]();})['then'](function(){return db['Campaign'][_0xe794('0x4d')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0xe794('0x2d')](function(_0x4eb90b){var _0x4d2a82=[];if(_0x4eb90b){for(var _0x2fd8f2=0x0,_0xfb019b;_0x2fd8f2<_0x4eb90b[_0xe794('0x1b')];_0x2fd8f2+=0x1){_0xfb019b=_0x4eb90b[_0x2fd8f2][_0xe794('0x59')]({'plain':!![]});_0x4d2a82[_0xe794('0x2e')](db[_0xe794('0x53')]['query'](_0x1140ba(_0xfb019b,_0xe794('0x5a')))[_0xe794('0x2d')](function(){})[_0xe794('0x2f')](_0x586769()));}}return _0x4d2a82;})[_0xe794('0x57')]();})[_0xe794('0x2f')](function(_0x179c86){logger[_0xe794('0x16')](_0xe794('0x5b'),_0xe794('0x5c'),_0x179c86['message']);});}var processPromises=function(_0x410cde){return BPromise[_0xe794('0x57')](promises)['then'](function(_0x3d5e34){})['catch'](function(_0x266561){logger[_0xe794('0x16')](_0xe794('0x5d'),JSON[_0xe794('0x32')](_0x266561));})[_0xe794('0x5e')](function(){socket['emit'](_0xe794('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x410cde){return _0x410cde[_0xe794('0x60')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xe794('0x2d')](function(){if(hopperContacts){return checkHopper();}})[_0xe794('0x2d')](function(){socket['emit'](_0xe794('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x4ae71a){logger['error'](_0xe794('0x61'),JSON[_0xe794('0x32')](_0x4ae71a));}finally{process[_0xe794('0x62')](0x0);}});};process['on'](_0xe794('0x63'),function(){logger['info']('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0xe794('0x64')]()[_0xe794('0x2d')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0xe794('0x13')](',');return db['CmContact'][_0xe794('0x4d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xe794('0x2d')](function(_0x6a0da3){var _0x4857ea=fs[_0xe794('0x65')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xe794('0x66')](_0x4857ea,{'header':!![],'skipEmptyLines':!![],'step':function(_0x2bb2cc,_0x4825ec){total+=0x1;var _0x8ce762=total;promises[_0xe794('0x2e')](checkRow(_0x2bb2cc,_0x6a0da3,_0x8ce762)['then'](function(){success+=0x1;})[_0xe794('0x2f')](function(_0xd63c13){if(_0xd63c13[_0xe794('0x16')]){errors+=0x1;delete _0xd63c13[_0xe794('0x16')];}else if(_0xd63c13[_0xe794('0x2b')]){duplicates+=0x1;delete _0xd63c13[_0xe794('0x2b')];}rows[_0xe794('0x2e')](_0xd63c13);}));if(total%0xc8===0x0){_0x4825ec[_0xe794('0x67')]();return processPromises(_0x4825ec);}},'complete':function(){return processPromises()[_0xe794('0x2d')](function(){logger[_0xe794('0x68')](_0xe794('0x69'));endCsv();});},'error':function(_0x1c51ab,_0x4dd2d5){logger[_0xe794('0x68')](_0xe794('0x6a'),JSON[_0xe794('0x32')](_0x1c51ab));endCsv();}});})[_0xe794('0x2f')](function(_0x3287de){logger[_0xe794('0x16')]('Error\x20executing\x20contact\x20csv\x20import:',JSON['stringify'](_0x3287de));});}main(); \ No newline at end of file +var _0x21cc=['birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','create','keys','push','catch','cmContact','inspect','into','cm_hopper','fromQuery','phone','scheduledAt','field','NOW()','ContactId','toString','createdAt','updatedAt','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','\x20=\x20?','str','calleridnum','cm_hopper_final','insert','id\x20IN\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','then','get','always','sequelize','query','VoiceQueueId','onlyIfOpen','all','Campaign','Lists','CampaignId','BlackLists','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','CmContact','createReadStream','parse','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','stringify','bluebird','util','lodash','squel','../../../mysqldb','../../../config/environment','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','data','firstName\x20not\x20specified!','phone\x20not\x20specified!'];(function(_0x4ba5f1,_0x16b3b0){var _0x4e22b0=function(_0x130c39){while(--_0x130c39){_0x4ba5f1['push'](_0x4ba5f1['shift']());}};_0x4e22b0(++_0x16b3b0);}(_0x21cc,0xbe));var _0xc21c=function(_0x4b69c5,_0x28f0bd){_0x4b69c5=_0x4b69c5-0x0;var _0x54aa0c=_0x21cc[_0x4b69c5];return _0x54aa0c;};'use strict';var BPromise=require(_0xc21c('0x0'));var util=require(_0xc21c('0x1'));var _=require(_0xc21c('0x2'));var fs=require('fs');var squel=require(_0xc21c('0x3'));var Papa=require('papaparse');var Redis=require('ioredis');var db=require(_0xc21c('0x4'))['db'];var config=require(_0xc21c('0x5'));var logger=require('../../../config/logger')(_0xc21c('0x6'));config[_0xc21c('0x7')]=_[_0xc21c('0x8')](config[_0xc21c('0x7')],{'host':_0xc21c('0x9'),'port':0x18eb});var socket=require(_0xc21c('0xa'))(new Redis(config[_0xc21c('0x7')]));require(_0xc21c('0xb'))[_0xc21c('0xc')](socket);try{if(!process[_0xc21c('0xd')][0x2]||process[_0xc21c('0xd')][0x2]===_0xc21c('0xe')||process[_0xc21c('0xd')][0x2]===_0xc21c('0xf')){throw new Error(_0xc21c('0x10'));}var FILEPATH=process[_0xc21c('0xd')][0x2];if(!process[_0xc21c('0xd')][0x3]||process['argv'][0x3]==='undefined'||process[_0xc21c('0xd')][0x3]===_0xc21c('0xf')||!process[_0xc21c('0xd')][0x4]||process[_0xc21c('0xd')][0x4]===_0xc21c('0xe')||process['argv'][0x4]===_0xc21c('0xf')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0xc21c('0x11')](process[_0xc21c('0xd')][0x3][_0xc21c('0x12')](','),process[_0xc21c('0xd')][0x4][_0xc21c('0x12')](','));if(!process[_0xc21c('0xd')][0x5]||process[_0xc21c('0xd')][0x5]===_0xc21c('0xe')||process[_0xc21c('0xd')][0x5]==='null'){throw new Error(_0xc21c('0x13'));}var LISTID=process[_0xc21c('0xd')][0x5];var COMPANYID=process['argv'][0x6]&&process['argv'][0x6]!==_0xc21c('0xe')&&process[_0xc21c('0xd')][0x6]!==_0xc21c('0xf')?process[_0xc21c('0xd')][0x6]:null;var DUPLICATES=process[_0xc21c('0xd')][0x7]&&process[_0xc21c('0xd')][0x7]!=='undefined'&&process[_0xc21c('0xd')][0x7]!=='null'?process[_0xc21c('0xd')][0x7]:null;if(!process[_0xc21c('0xd')][0x8]||process['argv'][0x8]===_0xc21c('0xe')||process['argv'][0x8]==='null'){throw new Error(_0xc21c('0x14'));}var SOCKET_TIMESTAMP=process[_0xc21c('0xd')][0x8];}catch(_0x5f23f5){logger[_0xc21c('0x15')](_0x5f23f5);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(_0x22720a,_0x5f3755,_0x3ab360,_0x505e6c){var _0x2cd249={'message':_0x5f3755};_0x2cd249[_0x22720a]=!![];if(_0x3ab360){_0x2cd249[_0xc21c('0x16')]=_0x3ab360;}if(_0x505e6c){_0x2cd249[_0xc21c('0x17')]=_0x505e6c;}return _0x2cd249;}function isEmail(_0x4f013d){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))*$/[_0xc21c('0x18')](_0x4f013d);}function checkRow(_0x5cb61a,_0x345afa,_0xbb0d96){return new BPromise(function(_0x23cb94,_0x2d6e54){if(_['isNil'](_0x5cb61a)){return _0x2d6e54(handleCheckRowError(_0xc21c('0x15'),_0xc21c('0x19'),null,_0xbb0d96));}if(_0x5cb61a[_0xc21c('0x1a')]&&_0x5cb61a[_0xc21c('0x1a')][_0xc21c('0x1b')]){var _0x264fb4=_[_0xc21c('0x1c')](_0x5cb61a['errors'],_0xc21c('0x1d'))[_0xc21c('0x1e')](';');return _0x2d6e54(handleCheckRowError(_0xc21c('0x15'),_0x264fb4,null,_0xbb0d96));}var _0x8cee49={};for(var _0x3e322c in FIELDS){if(FIELDS['hasOwnProperty'](_0x3e322c)&&FIELDS[_0x3e322c]){_0x8cee49[_0x3e322c]=_0x5cb61a[_0xc21c('0x1f')][0x0][FIELDS[_0x3e322c]]||_0x5cb61a[_0xc21c('0x1f')][0x0]['\ufeff'+FIELDS[_0x3e322c]];}}if(!_0x8cee49['firstName']){return _0x2d6e54(handleCheckRowError(_0xc21c('0x15'),_0xc21c('0x20'),null,_0xbb0d96));}if(!_0x8cee49['phone']){return _0x2d6e54(handleCheckRowError(_0xc21c('0x15'),_0xc21c('0x21'),null,_0xbb0d96));}if(_0x8cee49[_0xc21c('0x22')]){var _0x3ad3f6=moment(_0x8cee49[_0xc21c('0x22')],_0xc21c('0x23'));if(!_0x3ad3f6[_0xc21c('0x24')]()){return _0x2d6e54(handleCheckRowError(_0xc21c('0x15'),_0xc21c('0x25'),null,_0xbb0d96));}}if(_0x8cee49[_0xc21c('0x26')]){if(!isEmail(_0x8cee49[_0xc21c('0x26')])){return _0x2d6e54(handleCheckRowError('error',_0xc21c('0x27'),null,_0xbb0d96));}}_0x8cee49[_0xc21c('0x28')]=LISTID;_0x8cee49[_0xc21c('0x29')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0xc21c('0x1b')]&&_0x345afa){var _0x4b765a={};for(var _0x4b1cc4=0x0,_0x10b44d=DUPLICATES[_0xc21c('0x1b')];_0x4b1cc4<_0x10b44d;_0x4b1cc4+=0x1){_0x4b765a[DUPLICATES[_0x4b1cc4]]=_0x8cee49[DUPLICATES[_0x4b1cc4]];}var _0x22dd07=_[_0xc21c('0x2a')](_0x345afa,_0x4b765a);if(_0x22dd07){return _0x2d6e54(handleCheckRowError(_0xc21c('0x2b'),_0xc21c('0x2c'),_0x22dd07,_0xbb0d96));}}return db['CmContact'][_0xc21c('0x2d')](_0x8cee49,{'raw':!![],'hooks':![],'fields':_[_0xc21c('0x2e')](_0x8cee49)})['then'](function(_0x175441){if(DUPLICATES&&DUPLICATES['length']&&_0x345afa){_0x345afa[_0xc21c('0x2f')](_['pick'](_0x8cee49,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x175441['id'];return _0x23cb94();})[_0xc21c('0x30')](function(_0x312129){return _0x2d6e54(handleCheckRowError(_0xc21c('0x15'),'Error\x20while\x20creating\x20contact:\x20'+(_0x312129[_0xc21c('0x1d')]||JSON['stringify'](_0x312129)),null,_0xbb0d96));});});}function checkHopper(){function _0x385106(){return function(_0x38e937){logger[_0xc21c('0x15')](_0xc21c('0x31'),'checkHopper',util[_0xc21c('0x32')](_0x38e937,{'showHidden':![],'depth':null}));};}var _0x17374a=function(_0x174522,_0x3a17dc){var _0xca1f46=squel['insert']()[_0xc21c('0x33')](_0xc21c('0x34'))[_0xc21c('0x35')]([_0xc21c('0x36'),_0xc21c('0x37'),'ContactId',_0xc21c('0x28'),_0x3a17dc,'createdAt','updatedAt'],squel['select']()[_0xc21c('0x38')](_0xc21c('0x36'),_0xc21c('0x36'))[_0xc21c('0x38')](_0xc21c('0x39'),_0xc21c('0x37'))[_0xc21c('0x38')]('id',_0xc21c('0x3a'))[_0xc21c('0x38')](LISTID[_0xc21c('0x3b')](),_0xc21c('0x28'))[_0xc21c('0x38')](_0x174522['id'][_0xc21c('0x3b')](),_0x3a17dc)['field'](_0xc21c('0x39'),_0xc21c('0x3c'))[_0xc21c('0x38')](_0xc21c('0x39'),_0xc21c('0x3d'))[_0xc21c('0x3e')](_0xc21c('0x3f'))['where'](_0xc21c('0x40'))['where'](_0xc21c('0x41'),LISTID[_0xc21c('0x3b')]())[_0xc21c('0x42')](_0xc21c('0x43'))[_0xc21c('0x42')](_0xc21c('0x44'),squel[_0xc21c('0x45')]()[_0xc21c('0x38')](_0xc21c('0x36'))[_0xc21c('0x3e')]('cm_hopper')[_0xc21c('0x42')](_0x3a17dc+_0xc21c('0x46'),_0x174522['id'][_0xc21c('0x3b')]())))[_0xc21c('0x3b')]();return _0xca1f46;};var _0x100d16=function(_0x1932ed,_0x28c0f8){var _0x4508d9=squel['insert']()[_0xc21c('0x33')](_0xc21c('0x34'))[_0xc21c('0x35')]([_0xc21c('0x36'),'scheduledAt',_0xc21c('0x3a'),_0xc21c('0x28'),_0x28c0f8,'createdAt',_0xc21c('0x3d')],squel[_0xc21c('0x45')]()[_0xc21c('0x38')]('phone',_0xc21c('0x36'))[_0xc21c('0x38')](_0xc21c('0x39'),_0xc21c('0x37'))['field']('id',_0xc21c('0x3a'))[_0xc21c('0x38')](LISTID[_0xc21c('0x3b')](),_0xc21c('0x28'))['field'](_0x1932ed['id'][_0xc21c('0x3b')](),_0x28c0f8)['field'](_0xc21c('0x39'),_0xc21c('0x3c'))['field']('NOW()',_0xc21c('0x3d'))[_0xc21c('0x3e')](_0xc21c('0x3f'))['where'](_0xc21c('0x40'))['where'](_0xc21c('0x41'),LISTID['toString']())[_0xc21c('0x42')]('id\x20IN\x20?',squel[_0xc21c('0x47')](hopperContacts))[_0xc21c('0x42')](_0xc21c('0x43'))[_0xc21c('0x42')](_0xc21c('0x44'),squel[_0xc21c('0x45')]()[_0xc21c('0x38')](_0xc21c('0x48'))[_0xc21c('0x3e')](_0xc21c('0x49'))[_0xc21c('0x42')](_0x28c0f8+_0xc21c('0x46'),_0x1932ed['id']['toString']()))[_0xc21c('0x42')]('phone\x20NOT\x20IN\x20(?)',squel[_0xc21c('0x45')]()[_0xc21c('0x38')](_0xc21c('0x36'))['from'](_0xc21c('0x34'))['where'](_0x28c0f8+_0xc21c('0x46'),_0x1932ed['id'][_0xc21c('0x3b')]())))[_0xc21c('0x3b')]();return _0x4508d9;};function _0x3a723c(_0x33d553,_0x38d530){var _0x1983e1=squel[_0xc21c('0x4a')]()[_0xc21c('0x33')](_0xc21c('0x34'))[_0xc21c('0x35')]([_0xc21c('0x36'),_0xc21c('0x37'),_0xc21c('0x3a'),_0xc21c('0x28'),_0x38d530,_0xc21c('0x3c'),_0xc21c('0x3d')],squel[_0xc21c('0x45')]()[_0xc21c('0x38')](_0xc21c('0x36'),_0xc21c('0x36'))[_0xc21c('0x38')]('NOW()',_0xc21c('0x37'))[_0xc21c('0x38')]('id','ContactId')[_0xc21c('0x38')](LISTID['toString'](),'ListId')['field'](_0x33d553['id'][_0xc21c('0x3b')](),_0x38d530)[_0xc21c('0x38')](_0xc21c('0x39'),_0xc21c('0x3c'))['field'](_0xc21c('0x39'),_0xc21c('0x3d'))[_0xc21c('0x3e')]('cm_contacts')[_0xc21c('0x42')](_0xc21c('0x40'))[_0xc21c('0x42')]('ListId\x20=\x20?',LISTID[_0xc21c('0x3b')]())[_0xc21c('0x42')](_0xc21c('0x4b'),squel[_0xc21c('0x47')](hopperContacts))['where'](_0xc21c('0x43')))[_0xc21c('0x3b')]();return _0x1983e1;}function _0x222f63(_0x9ac4f0,_0x27e8bf){var _0x2666ea=squel['insert']()[_0xc21c('0x33')](_0xc21c('0x4c'))[_0xc21c('0x35')](['phone',_0xc21c('0x3a'),_0xc21c('0x28'),_0x27e8bf,_0xc21c('0x3c'),_0xc21c('0x3d')],squel[_0xc21c('0x45')]()[_0xc21c('0x38')](_0xc21c('0x36'),_0xc21c('0x36'))[_0xc21c('0x38')]('id',_0xc21c('0x3a'))['field'](LISTID[_0xc21c('0x3b')](),_0xc21c('0x28'))[_0xc21c('0x38')](_0x9ac4f0['id']['toString'](),_0x27e8bf)[_0xc21c('0x38')](_0xc21c('0x39'),_0xc21c('0x3c'))[_0xc21c('0x38')](_0xc21c('0x39'),'updatedAt')[_0xc21c('0x3e')](_0xc21c('0x3f'))['where']('deletedAt\x20IS\x20NULL')[_0xc21c('0x42')](_0xc21c('0x41'),LISTID[_0xc21c('0x3b')]())[_0xc21c('0x42')]('id\x20IN\x20?',squel[_0xc21c('0x47')](hopperContacts))[_0xc21c('0x42')]('phone\x20IS\x20NOT\x20NULL'))[_0xc21c('0x3b')]();return _0x2666ea;}return db[_0xc21c('0x4d')][_0xc21c('0x4e')]({'where':{'type':_0xc21c('0x4f')},'attributes':['id',_0xc21c('0x50')],'include':[{'model':db[_0xc21c('0x51')],'as':'Lists','where':{'id':LISTID}}]})[_0xc21c('0x52')](function(_0x165ca0){var _0xedcbd5=[];if(_0x165ca0){var _0x1a4a52;for(var _0x376ce9=0x0,_0x57d1ee;_0x376ce9<_0x165ca0[_0xc21c('0x1b')];_0x376ce9+=0x1){_0x57d1ee=_0x165ca0[_0x376ce9][_0xc21c('0x53')]({'plain':!![]});switch(_0x57d1ee['dialCheckDuplicateType']){case _0xc21c('0x54'):_0xedcbd5[_0xc21c('0x2f')](db[_0xc21c('0x55')][_0xc21c('0x56')](_0x100d16(_0x57d1ee,_0xc21c('0x57')))[_0xc21c('0x52')](function(){})[_0xc21c('0x30')](_0x385106()));break;case _0xc21c('0x58'):_0xedcbd5[_0xc21c('0x2f')](db['sequelize'][_0xc21c('0x56')](_0x17374a(_0x57d1ee,'VoiceQueueId'))[_0xc21c('0x52')](function(){})['catch'](_0x385106()));break;default:_0xedcbd5[_0xc21c('0x2f')](db[_0xc21c('0x55')][_0xc21c('0x56')](_0x3a723c(_0x57d1ee,_0xc21c('0x57')))[_0xc21c('0x52')](function(){})[_0xc21c('0x30')](_0x385106()));}}}return _0xedcbd5;})[_0xc21c('0x59')]()[_0xc21c('0x52')](function(){return db[_0xc21c('0x4d')][_0xc21c('0x4e')]({'where':{'type':_0xc21c('0x4f')},'attributes':['id'],'include':[{'model':db[_0xc21c('0x51')],'as':'BlackLists','where':{'id':LISTID}}]})[_0xc21c('0x52')](function(_0x349905){var _0x44a4c9=[];if(_0x349905){var _0x25f8f0;for(var _0x3afc93=0x0,_0x446668;_0x3afc93<_0x349905[_0xc21c('0x1b')];_0x3afc93+=0x1){_0x446668=_0x349905[_0x3afc93]['get']({'plain':!![]});_0x44a4c9[_0xc21c('0x2f')](db[_0xc21c('0x55')][_0xc21c('0x56')](_0x222f63(_0x446668,_0xc21c('0x57')))['then'](function(){})[_0xc21c('0x30')](_0x385106()));}}return _0x44a4c9;})['all']();})[_0xc21c('0x52')](function(){return db[_0xc21c('0x5a')][_0xc21c('0x4e')]({'attributes':['id',_0xc21c('0x50')],'include':[{'model':db[_0xc21c('0x51')],'as':_0xc21c('0x5b'),'where':{'id':LISTID}}]})[_0xc21c('0x52')](function(_0x406674){var _0x5897d7=[];if(_0x406674){for(var _0x395a68=0x0,_0x384a44;_0x395a68<_0x406674[_0xc21c('0x1b')];_0x395a68+=0x1){_0x384a44=_0x406674[_0x395a68][_0xc21c('0x53')]({'plain':!![]});switch(_0x384a44['dialCheckDuplicateType']){case'always':_0x5897d7['push'](db[_0xc21c('0x55')][_0xc21c('0x56')](_0x100d16(_0x384a44,_0xc21c('0x5c')))['then'](function(){})['catch'](_0x385106()));break;case _0xc21c('0x58'):_0x5897d7['push'](db['sequelize']['query'](_0x17374a(_0x384a44,_0xc21c('0x5c')))[_0xc21c('0x52')](function(){})[_0xc21c('0x30')](_0x385106()));break;default:_0x5897d7['push'](db[_0xc21c('0x55')][_0xc21c('0x56')](_0x3a723c(_0x384a44,'CampaignId'))['then'](function(){})[_0xc21c('0x30')](_0x385106()));}}}return _0x5897d7;})[_0xc21c('0x59')]();})[_0xc21c('0x52')](function(){return db[_0xc21c('0x5a')][_0xc21c('0x4e')]({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0xc21c('0x5d'),'where':{'id':LISTID}}]})[_0xc21c('0x52')](function(_0x414c24){var _0x1a2285=[];if(_0x414c24){for(var _0x34f968=0x0,_0xf55d28;_0x34f968<_0x414c24[_0xc21c('0x1b')];_0x34f968+=0x1){_0xf55d28=_0x414c24[_0x34f968][_0xc21c('0x53')]({'plain':!![]});_0x1a2285['push'](db[_0xc21c('0x55')]['query'](_0x222f63(_0xf55d28,_0xc21c('0x5c')))[_0xc21c('0x52')](function(){})[_0xc21c('0x30')](_0x385106()));}}return _0x1a2285;})[_0xc21c('0x59')]();})[_0xc21c('0x30')](function(_0x2c09b3){logger[_0xc21c('0x15')]('cmContact,\x20%s,\x20%s','generalCheckHopper',_0x2c09b3[_0xc21c('0x1d')]);});}var processPromises=function(_0x50a5cd){return BPromise[_0xc21c('0x59')](promises)[_0xc21c('0x52')](function(_0x1d0ebc){})[_0xc21c('0x30')](function(_0x5c47d7){logger[_0xc21c('0x15')](_0xc21c('0x5e'),JSON['stringify'](_0x5c47d7));})[_0xc21c('0x5f')](function(){socket[_0xc21c('0x60')](_0xc21c('0x61')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x50a5cd){return _0x50a5cd[_0xc21c('0x62')]();}});};var endCsv=function(){return BPromise['resolve']()[_0xc21c('0x52')](function(){if(hopperContacts){return checkHopper();}})[_0xc21c('0x52')](function(){socket['emit'](_0xc21c('0x61')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x510aac){logger[_0xc21c('0x15')](_0xc21c('0x63'),JSON['stringify'](_0x510aac));}finally{process[_0xc21c('0x64')](0x0);}});};process['on'](_0xc21c('0x65'),function(){logger[_0xc21c('0x66')](_0xc21c('0x67'));endCsv();});function main(){return BPromise[_0xc21c('0x68')]()[_0xc21c('0x52')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0xc21c('0x69')][_0xc21c('0x4e')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0xc21c('0x52')](function(_0xe2316b){var _0x1ba2b7=fs[_0xc21c('0x6a')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0xc21c('0x6b')](_0x1ba2b7,{'header':!![],'skipEmptyLines':!![],'step':function(_0x32af9c,_0x32f4b8){total+=0x1;var _0x5da067=total;promises[_0xc21c('0x2f')](checkRow(_0x32af9c,_0xe2316b,_0x5da067)['then'](function(){success+=0x1;})[_0xc21c('0x30')](function(_0x2eaa55){if(_0x2eaa55[_0xc21c('0x15')]){errors+=0x1;delete _0x2eaa55['error'];}else if(_0x2eaa55[_0xc21c('0x2b')]){duplicates+=0x1;delete _0x2eaa55[_0xc21c('0x2b')];}rows[_0xc21c('0x2f')](_0x2eaa55);}));if(total%0xc8===0x0){_0x32f4b8[_0xc21c('0x6c')]();return processPromises(_0x32f4b8);}},'complete':function(){return processPromises()[_0xc21c('0x52')](function(){logger[_0xc21c('0x66')](_0xc21c('0x6d'));endCsv();});},'error':function(_0x527b16,_0x1551ab){logger[_0xc21c('0x66')](_0xc21c('0x6e'),JSON['stringify'](_0x527b16));endCsv();}});})[_0xc21c('0x30')](function(_0x4ff632){logger[_0xc21c('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0xc21c('0x6f')](_0x4ff632));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 7e1f534..2344451 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 _0xb8f0=['uncaughtException','path','lodash','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','defaults','redis','localhost','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','from','join','where','\x20=\x20','CmContact','findAll','AdditionalPhones','then','length','push','all','split','isNil','filter','CmContactHasItem','update','updated','create','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','fromQuery','phone','scheduledat','createdAt','updatedAt','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','cm_hopper_black','ContactId','ListId','priority','UserId','cm_contacts.id','.CmListId','ListId\x20=\x20?','toString','cm_contact_has_items.item','cm_contact_has_items.createdAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','code','catch','campaigns.id','campaigns.dialTimezone','campaigns','campaigns_has_cm_lists','campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId','sequelize','spread','voice_queues.id','voice_queues.dialTimezone','voice_queues_has_cm_lists','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','query','timezones','dialTimezone','utcOffset','set','stringify','send','binding','socket_timestamp','server/files/tmp','.csv','includes','header','ContactItemType','name','_description','parse','createReadStream','data','rows','find','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','replace','itemTypeId','description','SystemRow','appendFileSync','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','(id\x20int,dialTimezone\x20varchar(255),offset\x20int);','each','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','contactTypeId','orderBy','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','emit','unlink','complete','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','No\x20agent\x20available','SIGINT'];(function(_0x1e1e0a,_0x23d3f1){var _0x5ab3d6=function(_0x50674b){while(--_0x50674b){_0x1e1e0a['push'](_0x1e1e0a['shift']());}};_0x5ab3d6(++_0x23d3f1);}(_0xb8f0,0x16d));var _0x0b8f=function(_0x5c9a6a,_0x4a5804){_0x5c9a6a=_0x5c9a6a-0x0;var _0x115fef=_0xb8f0[_0x5c9a6a];return _0x115fef;};'use strict';var fs=require('fs');var path=require(_0x0b8f('0x0'));var _=require(_0x0b8f('0x1'));var Papa=require('papaparse');var util=require(_0x0b8f('0x2'));var BPromise=require(_0x0b8f('0x3'));var moment=require(_0x0b8f('0x4'));var squel=require(_0x0b8f('0x5'));var Redis=require(_0x0b8f('0x6'));var db=require(_0x0b8f('0x7'))['db'];var config=require(_0x0b8f('0x8'));var shared=require(_0x0b8f('0x9'));var logger=require(_0x0b8f('0xa'))(_0x0b8f('0xb'));config['redis']=_[_0x0b8f('0xc')](config[_0x0b8f('0xd')],{'host':_0x0b8f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0b8f('0xd')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x0b8f('0xf')]('YYYY-MM-DD\x20HH:mm:ss');var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x0b8f('0x10'));function isEmail(_0x4d1823){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))*$/[_0x0b8f('0x11')](_0x4d1823);}function selectNotIn(_0x947b0,_0x4116d8,_0x3a5d9d,_0x49f5bd,_0xa7321b){return squel[_0x0b8f('0x12')]()[_0x0b8f('0x13')]('phone')[_0x0b8f('0x14')](_0x49f5bd)[_0x0b8f('0x15')](_0x4116d8,null,_0x4116d8+'.id\x20=\x20'+_0x49f5bd+'.'+_0x3a5d9d)[_0x0b8f('0x16')](_0x49f5bd+'.'+_0x3a5d9d+_0x0b8f('0x17')+_0x947b0+'.'+_0x3a5d9d)[_0x0b8f('0x16')](_0x4116d8+'.dialCheckDuplicateType\x20IN\x20('+_0xa7321b['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x5746f6,_0x23bd6f){promisesAdditionalPhones=[];return db[_0x0b8f('0x18')][_0x0b8f('0x19')]({'raw':!![],'attributes':['id',_0x0b8f('0x1a')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x0b8f('0x1b')](function(_0x496522){if(_0x496522!==null){var _0x5327bd=[];for(var _0x326c9f=0x0;_0x326c9f<_0x496522[_0x0b8f('0x1c')];_0x326c9f++){var _0x3b5f0f=_0x496522[_0x326c9f];_0x5327bd[_0x0b8f('0x1d')](insertAdditionalPhones(_0x3b5f0f));}}Promise[_0x0b8f('0x1e')](_0x5327bd)['then'](function(){_0x5746f6({'val':0x1});});});});}function insertAdditionalPhones(_0x4e3180){return new Promise(function(_0x2eb80b,_0x26fb76){var _0xfe4a7c=_0x4e3180[_0x0b8f('0x1a')];var _0x1053e0=_0xfe4a7c[_0x0b8f('0x1f')](';');var _0x4158a4=[];orderBy=0x0;for(var _0x4b89a1=0x0;_0x4b89a1<_0x1053e0[_0x0b8f('0x1c')];_0x4b89a1++){_0x4158a4['push'](splitAdditionalPhone(_0x4e3180['id'],_0x1053e0[_0x4b89a1]));}Promise[_0x0b8f('0x1e')](_0x4158a4)['then'](function(){_0x2eb80b({'val':_0x1053e0[_0x0b8f('0x1c')]});});});}function splitAdditionalPhone(_0x3a7ca1,_0x1f3b98){return new Promise(function(_0x147c2d,_0x31365b){var _0x52952d=_0x1f3b98[_0x0b8f('0x1f')](':');var _0x12acb9=_0x52952d[0x0];var _0x4c07c6=_0x52952d[0x1];if(!_[_0x0b8f('0x20')](_0x4c07c6)){var _0x25ef26=_0x4c07c6[_0x0b8f('0x1f')]('|');var _0x274781=[];for(var _0x2f72f1=0x0;_0x2f72f1<_0x25ef26[_0x0b8f('0x1c')];_0x2f72f1++){if(_0x25ef26[_0x2f72f1]!==''){var _0x3e7347=_[_0x0b8f('0x21')](promisesAdditionalPhones,{'contactId':_0x3a7ca1,'phone':_0x25ef26[_0x2f72f1]});if(_0x3e7347['length']==0x0){orderBy++;promisesAdditionalPhones[_0x0b8f('0x1d')]({'contactId':_0x3a7ca1,'contactTypeId':_0x12acb9,'phone':_0x25ef26[_0x2f72f1],'orderBy':orderBy});}}}_0x147c2d({'ok':0x1});}else _0x147c2d({'res':0x0});});}function createAdditionalPhone(_0x1f39ba,_0x2537e1,_0x22cee4,_0x57752c){var _0x2ecf33='';var _0x3c8f15='';var _0x4333ad=_0x22cee4[_0x0b8f('0x1f')]('§');_0x2ecf33=_0x4333ad[0x0];if(_0x4333ad[_0x0b8f('0x1c')]==0x2)_0x3c8f15=_0x4333ad[0x1];return new Promise(function(_0x5f119a,_0x14f801){return db[_0x0b8f('0x22')]['findOne']({'where':{'CmContactId':_0x1f39ba,'item':_0x2ecf33}})['then'](function(_0x2665e1){if(_0x2665e1){return db['CmContactHasItem'][_0x0b8f('0x23')]({'ItemTypeId':_0x2537e1,'description':_0x3c8f15,'OrderBy':_0x57752c},{'where':{'CmContactId':_0x1f39ba,'item':_0x2ecf33}})[_0x0b8f('0x1b')](function(_0x2ebb7e){_0x5f119a({'res':_0x0b8f('0x24')});});}else{return db[_0x0b8f('0x22')][_0x0b8f('0x25')]({'CmContactId':_0x1f39ba,'item':_0x2ecf33,'description':_0x3c8f15,'ItemTypeId':_0x2537e1,'OrderBy':_0x57752c,'ItemClass':'PHONE'})[_0x0b8f('0x1b')](function(_0x3f733a){_0x5f119a({'res':'inserted'});});}});});}function insertCmHopper(_0x45f2b4,_0x21011c,_0x28e301,_0x57f86f,_0xa868ce){var _0x5027e1=[_0x0b8f('0x26'),_0x0b8f('0x27'),'cm_contacts.id',_0x0b8f('0x28'),_0x21011c+'.'+_0x57f86f,_0x0b8f('0x29'),_0x0b8f('0x2a'),_0x0b8f('0x2b'),_0x0b8f('0x2c'),'\x22'+_0xa868ce+'\x22'];return squel[_0x0b8f('0x2d')]()[_0x0b8f('0x2e')]('cm_hopper')[_0x0b8f('0x2f')]([_0x0b8f('0x30'),_0x0b8f('0x31'),'ContactId','ListId',_0x57f86f,_0x0b8f('0x32'),_0x0b8f('0x33'),'priority','UserId',_0x0b8f('0x34')],squel['select']()[_0x0b8f('0x35')](_0x5027e1)['from'](_0x21011c)[_0x0b8f('0x15')](_0x0b8f('0x36'),null,_0x0b8f('0x37')+_0x21011c+'.CmListId')[_0x0b8f('0x15')](_0x28e301,null,_0x28e301+_0x0b8f('0x38')+_0x21011c+'.'+_0x57f86f)['where'](_0x21011c+_0x0b8f('0x39'),_0x45f2b4)[_0x0b8f('0x16')](_0x0b8f('0x3a'),NOW)[_0x0b8f('0x16')](_0x0b8f('0x3b'),selectNotIn(_0x21011c,_0x28e301,_0x57f86f,_0x0b8f('0x3c'),[_0x0b8f('0x3d'),_0x0b8f('0x3e')]))[_0x0b8f('0x16')](_0x0b8f('0x3b'),selectNotIn(_0x21011c,_0x28e301,_0x57f86f,_0x0b8f('0x3c'),[_0x0b8f('0x3d')])))['toString']();}function insertCmHopperBlack(_0x329013,_0x494adb,_0x100330,_0xe716c4){var _0x5f2e29=[_0x0b8f('0x26'),'cm_contacts.id','cm_contacts.ListId',_0x494adb+'.'+_0xe716c4,_0x0b8f('0x29'),'cm_contacts.updatedAt'];return squel[_0x0b8f('0x2d')]()['into'](_0x0b8f('0x3f'))[_0x0b8f('0x2f')]([_0x0b8f('0x30'),_0x0b8f('0x40'),'ListId',_0xe716c4,'createdAt',_0x0b8f('0x33')],squel['select']()[_0x0b8f('0x35')](_0x5f2e29)[_0x0b8f('0x14')](_0x494adb)[_0x0b8f('0x15')](_0x0b8f('0x36'),null,_0x0b8f('0x37')+_0x494adb+'.CmListId')[_0x0b8f('0x15')](_0x100330,null,_0x100330+'.id\x20=\x20'+_0x494adb+'.'+_0xe716c4)['where'](_0x494adb+_0x0b8f('0x39'),_0x329013)[_0x0b8f('0x16')](_0x0b8f('0x3a'),NOW)[_0x0b8f('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x0b8f('0x12')]()[_0x0b8f('0x13')]('phone')[_0x0b8f('0x14')](_0x0b8f('0x3f'))[_0x0b8f('0x16')]('ListId\x20=\x20?',_0x329013)['where'](_0xe716c4+'\x20=\x20'+_0x494adb+'.'+_0xe716c4)))['toString']();}function insertTzCmHopper(_0x4398cc,_0x3abc2a,_0x4d8072,_0x2487ae,_0x340a32,_0x1f0a69){var _0x54bd04=['cm_contacts.phone','date_add(cm_contacts.scheduledat,interval\x20'+_0x1f0a69+'.offset-cm_contacts.utcOffset\x20minute)','cm_contacts.id',_0x0b8f('0x28'),_0x3abc2a+'.'+_0x2487ae,'cm_contacts.createdAt',_0x0b8f('0x2a'),'cm_contacts.priority',_0x0b8f('0x2c'),'\x22'+_0x340a32+'\x22'];var _0x1b7b5a=squel[_0x0b8f('0x2d')]()['into'](_0x0b8f('0x3c'))[_0x0b8f('0x2f')](['phone',_0x0b8f('0x31'),'ContactId',_0x0b8f('0x41'),_0x2487ae,_0x0b8f('0x32'),_0x0b8f('0x33'),_0x0b8f('0x42'),_0x0b8f('0x43'),'recallme'],squel[_0x0b8f('0x12')]()[_0x0b8f('0x35')](_0x54bd04)[_0x0b8f('0x14')](_0x3abc2a)[_0x0b8f('0x15')](_0x0b8f('0x36'),null,'cm_contacts.ListId\x20=\x20'+_0x3abc2a+'.CmListId')[_0x0b8f('0x15')](_0x4d8072,null,_0x4d8072+'.id\x20=\x20'+_0x3abc2a+'.'+_0x2487ae)[_0x0b8f('0x15')](_0x1f0a69,null,_0x1f0a69+_0x0b8f('0x38')+_0x3abc2a+'.'+_0x2487ae)[_0x0b8f('0x16')](_0x3abc2a+_0x0b8f('0x39'),_0x4398cc)['where'](_0x0b8f('0x3a'),NOW)['where']('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x3abc2a,_0x4d8072,_0x2487ae,_0x0b8f('0x3c'),[_0x0b8f('0x3d'),_0x0b8f('0x3e')]))['where'](_0x0b8f('0x3b'),selectNotIn(_0x3abc2a,_0x4d8072,_0x2487ae,_0x0b8f('0x3c'),[_0x0b8f('0x3d')])))['toString']();return _0x1b7b5a;}function insertTzCmHopperBlack(_0x111d16,_0x750f38,_0x33f395,_0x1b2744){var _0x39e143=[_0x0b8f('0x26'),_0x0b8f('0x44'),_0x0b8f('0x28'),_0x750f38+'.'+_0x1b2744,_0x0b8f('0x29'),_0x0b8f('0x2a')];return squel[_0x0b8f('0x2d')]()[_0x0b8f('0x2e')](_0x0b8f('0x3f'))['fromQuery']([_0x0b8f('0x30'),_0x0b8f('0x40'),_0x0b8f('0x41'),_0x1b2744,_0x0b8f('0x32'),_0x0b8f('0x33')],squel['select']()[_0x0b8f('0x35')](_0x39e143)[_0x0b8f('0x14')](_0x750f38)[_0x0b8f('0x15')](_0x0b8f('0x36'),null,_0x0b8f('0x37')+_0x750f38+_0x0b8f('0x45'))[_0x0b8f('0x15')](_0x33f395,null,_0x33f395+_0x0b8f('0x38')+_0x750f38+'.'+_0x1b2744)[_0x0b8f('0x16')](_0x750f38+'.CmListId\x20=\x20?',_0x111d16)[_0x0b8f('0x16')](_0x0b8f('0x3a'),NOW)[_0x0b8f('0x16')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x0b8f('0x12')]()[_0x0b8f('0x13')]('phone')[_0x0b8f('0x14')]('cm_hopper_black')['where'](_0x0b8f('0x46'),_0x111d16)['where'](_0x1b2744+'\x20=\x20'+_0x750f38+'.'+_0x1b2744)))[_0x0b8f('0x47')]();}function insertCmHopperAdditionalPhones(_0x262ae5){var _0x34e848=['cm_hopper.id',_0x0b8f('0x48'),'cm_contact_has_items.OrderBy',_0x0b8f('0x49'),'cm_contact_has_items.updatedAt'];return squel[_0x0b8f('0x2d')]()[_0x0b8f('0x2e')](_0x0b8f('0x4a'))[_0x0b8f('0x2f')]([_0x0b8f('0x4b'),'phone',_0x0b8f('0x4c'),_0x0b8f('0x32'),_0x0b8f('0x33')],squel[_0x0b8f('0x12')]()[_0x0b8f('0x35')](_0x34e848)[_0x0b8f('0x14')](_0x0b8f('0x3c'))['join'](_0x0b8f('0x36'),null,_0x0b8f('0x4d'))[_0x0b8f('0x15')](_0x0b8f('0x4e'),null,'cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId')[_0x0b8f('0x16')]('cm_hopper.ListId\x20=\x20?',_0x262ae5)['where'](_0x0b8f('0x3a'),NOW))[_0x0b8f('0x47')]();}function insertCmContact(_0x177b7d,_0x5f02bf,_0x1e446a,_0x10beed){var _0x10a0b6=_[_0x0b8f('0x4f')](_[_0x0b8f('0x50')](_0x10beed),[_0x0b8f('0x41'),_0x0b8f('0x51'),_0x0b8f('0x32'),'updatedAt']);return squel['insert']()[_0x0b8f('0x2e')](_0x0b8f('0x36'))[_0x0b8f('0x2f')](_0x10a0b6,squel[_0x0b8f('0x12')]()[_0x0b8f('0x35')](_0x10a0b6)[_0x0b8f('0x14')](_0x5f02bf)[_0x0b8f('0x16')]('('+_0x1e446a[_0x0b8f('0x15')](',')+_0x0b8f('0x52'),squel[_0x0b8f('0x12')]()[_0x0b8f('0x35')](_0x1e446a)[_0x0b8f('0x14')](_0x0b8f('0x36'))[_0x0b8f('0x16')](_0x0b8f('0x46'),_0x177b7d)[_0x0b8f('0x16')]('deletedAt\x20IS\x20NULL'))[_0x0b8f('0x16')]('id\x20IN\x20?',squel[_0x0b8f('0x12')]()[_0x0b8f('0x13')](_0x0b8f('0x53'),_0x0b8f('0x54'))['from'](_0x5f02bf)[_0x0b8f('0x55')](_0x1e446a[_0x0b8f('0x15')](','))))[_0x0b8f('0x47')]();}function handleStop(){logger[_0x0b8f('0x56')](_0x0b8f('0x57'));stopped=!![];}function handleUncaughtException(_0x47245b){logger[_0x0b8f('0x58')](_0x47245b[_0x0b8f('0x59')]);process[_0x0b8f('0x5a')](0x1);}function handleError(_0x43eace,_0x5c07e9){stats[_0x0b8f('0x5b')][_0x0b8f('0x1d')]({'name':_0x5c07e9[_0x0b8f('0x5c')],'message':_0x5c07e9[_0x0b8f('0x59')],'row':_0x43eace});}function handleQuery(_0x4a3d41){logger[_0x0b8f('0x56')](_0x4a3d41);return db['sequelize']['query'](_0x4a3d41)['spread'](function(_0x128f93){results['push'](_0x128f93);})[_0x0b8f('0x5d')](function(_0x425d82){logger['error'](_0x425d82['message']);});}function updateTzCampaigns(_0x44653e){return new Promise(function(_0x1cf76b,_0x36d527){var _0x3aab01=squel[_0x0b8f('0x12')]()['fields']([_0x0b8f('0x5e'),_0x0b8f('0x5f')])[_0x0b8f('0x14')](_0x0b8f('0x60'))['join'](_0x0b8f('0x61'),null,_0x0b8f('0x62'))[_0x0b8f('0x16')]('campaigns_has_cm_lists.CmListId='+_0x44653e);db[_0x0b8f('0x63')]['query'](_0x3aab01['toString']())[_0x0b8f('0x64')](function(_0x250af0){var _0x3bbce4=[];for(var _0x32c113=0x0;_0x32c113<_0x250af0[_0x0b8f('0x1c')];_0x32c113++){_0x3bbce4['push'](getTimezoneData(_0x250af0[_0x32c113],tmp_campaigns));}BPromise[_0x0b8f('0x1e')](_0x3bbce4)['then'](function(){_0x1cf76b({'val':0x1});});})['catch'](function(_0x99f3a){logger[_0x0b8f('0x58')](_0x99f3a[_0x0b8f('0x59')]);_0x1cf76b({'val':0x0});});});}function updateTzVoiceQueues(_0x3e34c7){return new Promise(function(_0xb0a673,_0x80c7be){var _0x7ebd9e=squel['select']()[_0x0b8f('0x35')]([_0x0b8f('0x65'),_0x0b8f('0x66')])[_0x0b8f('0x14')]('voice_queues')[_0x0b8f('0x15')](_0x0b8f('0x67'),null,_0x0b8f('0x68'))[_0x0b8f('0x16')](_0x0b8f('0x69')+_0x3e34c7);db[_0x0b8f('0x63')][_0x0b8f('0x6a')](_0x7ebd9e['toString']())[_0x0b8f('0x64')](function(_0xf2a9e1){var _0x5cb232=[];for(var _0x1d58c8=0x0;_0x1d58c8<_0xf2a9e1[_0x0b8f('0x1c')];_0x1d58c8++){_0x5cb232[_0x0b8f('0x1d')](getTimezoneData(_0xf2a9e1[_0x1d58c8],tmp_voice_queues));}BPromise[_0x0b8f('0x1e')](_0x5cb232)[_0x0b8f('0x1b')](function(){_0xb0a673({'val':0x1});});})['catch'](function(_0x59a063){logger[_0x0b8f('0x58')](_0x59a063[_0x0b8f('0x59')]);_0xb0a673({'val':0x0});});});}function getTimezoneData(_0x12d388,_0x22c3b1){return new Promise(function(_0x273e26,_0x77bdfa){var _0x160b24=shared[_0x0b8f('0x6b')];var _0xb6e2c8=_0x160b24[_0x12d388[_0x0b8f('0x6c')]];if(_['isNil'](_0xb6e2c8)){_0x273e26({'ret':0x1});}else{var _0x4071fc=_0xb6e2c8[_0x0b8f('0x6d')];var _0x4665cc=squel[_0x0b8f('0x2d')]()[_0x0b8f('0x2e')](_0x22c3b1)[_0x0b8f('0x6e')]('id',_0x12d388['id'])[_0x0b8f('0x6e')]('offset',_0x4071fc)[_0x0b8f('0x6e')](_0x0b8f('0x6c'),_0x12d388[_0x0b8f('0x6c')])['toString']();return db[_0x0b8f('0x63')][_0x0b8f('0x6a')](_0x4665cc)[_0x0b8f('0x64')](function(_0x3b5901){_0x273e26({'ret':0x1});})[_0x0b8f('0x5d')](function(_0x3a21c7){logger[_0x0b8f('0x58')](_0x3a21c7[_0x0b8f('0x59')]);_0x77bdfa({'ret':0x1});});}});}function handleTZQuery(_0x564baf){logger[_0x0b8f('0x56')](_0x564baf);return db['sequelize'][_0x0b8f('0x6a')](_0x564baf)[_0x0b8f('0x64')](function(_0x27dcd5){})[_0x0b8f('0x5d')](function(_0x57da1d){logger['error'](_0x57da1d[_0x0b8f('0x59')]);});}function main(_0x5bf0f4,_0x1b095a,_0x26689b,_0x50f7df){logger[_0x0b8f('0x56')]('main',_0x5bf0f4,JSON[_0x0b8f('0x6f')](_0x1b095a));process[_0x0b8f('0x70')]('start');var _0x8f5512=_0x1b095a[_0x0b8f('0x71')];var _0x27cf85=_['clone'](_0x8f5512);var _0x4ba93e=_0x1b095a[_0x0b8f('0x72')];var _0x163eb1=path[_0x0b8f('0x15')](config['root'],_0x0b8f('0x73'),_0x4ba93e+_0x0b8f('0x74'));hasTZ=_[_0x0b8f('0x50')](_0x8f5512)[_0x0b8f('0x75')](_0x0b8f('0x6c'));var _0x17b60f=_[_0x0b8f('0x50')](_0x8f5512)[_0x0b8f('0x15')]();logger[_0x0b8f('0x56')](_0x0b8f('0x76'),_0x17b60f);db[_0x0b8f('0x77')][_0x0b8f('0x19')]({'raw':!![],'attributes':['id',_0x0b8f('0x78')]})[_0x0b8f('0x1b')](function(_0x7a7cd0){for(var _0x4ca244=0x0;_0x4ca244<_0x7a7cd0[_0x0b8f('0x1c')];_0x4ca244++){if(_0x7a7cd0[_0x4ca244][_0x0b8f('0x78')]in _0x8f5512){contactItemTypes[_0x0b8f('0x1d')](_0x7a7cd0[_0x4ca244]);delete _0x27cf85[_0x7a7cd0[_0x4ca244][_0x0b8f('0x78')]];hasAdditionalPhones=!![];}for(var _0x16760c in _0x8f5512){if(_0x7a7cd0[_0x4ca244][_0x0b8f('0x78')]+_0x0b8f('0x79')===_0x16760c){phoneDescriptions['push']({'itemTypeId':_0x7a7cd0[_0x4ca244]['id'],'description':_0x16760c});delete _0x27cf85[_0x16760c];}}}if(hasAdditionalPhones)_0x27cf85[_0x0b8f('0x1a')]='';var _0x52fabb=_['keys'](_0x27cf85)[_0x0b8f('0x15')]();logger['info']('header',_0x52fabb);fs['writeFileSync'](_0x163eb1,_0x52fabb+'\x0a');Papa[_0x0b8f('0x7a')](fs[_0x0b8f('0x7b')](_0x5bf0f4),{'header':!![],'skipEmptyLines':!![],'step':function(_0x592c5b,_0x565612){try{for(var _0x20a6af=0x0,_0x5e681a=[];_0x20a6af<_0x592c5b[_0x0b8f('0x7c')][_0x0b8f('0x1c')];_0x20a6af++){stats[_0x0b8f('0x7d')]+=0x1;if(_0x592c5b[_0x0b8f('0x5b')][_0x20a6af]){handleError(_0x592c5b[_0x0b8f('0x7c')][_0x20a6af],_0x592c5b['errors'][_0x20a6af]);}else{var _0xe8a9f5=[];var _0x582504=[];var _0x3c398c={};for(var _0x21e85a in _0x8f5512){let _0x437e08=contactItemTypes[_0x0b8f('0x7e')](_0x570bb8=>_0x570bb8['name']===_0x21e85a);let _0xdc4bd0=contactItemTypes[_0x0b8f('0x7e')](_0x3e188a=>_0x3e188a[_0x0b8f('0x78')]+_0x0b8f('0x79')===_0x21e85a);if(_[_0x0b8f('0x20')](_0x437e08)&&_[_0x0b8f('0x20')](_0xdc4bd0)){if(_0x8f5512[_0x0b8f('0x7f')](_0x21e85a)){if(_0x592c5b['data'][_0x20a6af][_0x8f5512[_0x21e85a]]){var _0x3aa43e=_[_0x0b8f('0x80')](_0x592c5b['data'][_0x20a6af][_0x8f5512[_0x21e85a]]['replace'](/"/g,'\x27'));switch(_0x21e85a){case _0x0b8f('0x31'):var _0xaed7b5=moment(_0x3aa43e,_0x0b8f('0x10'),!![]);if(_0xaed7b5[_0x0b8f('0x81')]()){_0x5e681a[_0x0b8f('0x1d')]('\x22'+_0x3aa43e+'\x22');}else{_0xe8a9f5[_0x0b8f('0x1d')](_0x0b8f('0x82'));}break;case _0x0b8f('0x42'):var _0xe6e7d3=parseInt(_0x3aa43e);_0x3aa43e=_[_0x0b8f('0x83')](_0xe6e7d3)||_0xe6e7d3<0x0||_0xe6e7d3>0x4?_0x50f7df?0x3:0x2:_0xe6e7d3;_0x5e681a[_0x0b8f('0x1d')]('\x22'+_0x3aa43e+'\x22');break;case _0x0b8f('0x43'):var _0xd088de=parseInt(_0x3aa43e);if(_[_0x0b8f('0x84')](_0xd088de)&&_[_0x0b8f('0x75')](_0x26689b,_0xd088de)){_0x5e681a[_0x0b8f('0x1d')]('\x22'+_0xd088de+'\x22');}else{_0xe8a9f5[_0x0b8f('0x1d')](_0x0b8f('0x85'));}break;case _0x0b8f('0x86'):if(isEmail(_0x3aa43e)){_0x5e681a[_0x0b8f('0x1d')]('\x22'+_0x3aa43e+'\x22');}else{_0xe8a9f5[_0x0b8f('0x1d')](_0x0b8f('0x87'));}break;case _0x0b8f('0x88'):var _0x2b04e9=moment(_0x3aa43e,_0x0b8f('0x89'),!![]);if(_0x2b04e9[_0x0b8f('0x81')]()){_0x5e681a[_0x0b8f('0x1d')]('\x22'+_0x3aa43e+'\x22');}else{_0xe8a9f5[_0x0b8f('0x1d')](_0x0b8f('0x8a'));}break;case _0x0b8f('0x6c'):var _0xb671d5=shared[_0x0b8f('0x6b')];var _0x4a936b=_0xb671d5[_0x3aa43e];if(!_[_0x0b8f('0x20')](_0x4a936b)){var _0x517217=_0x4a936b[_0x0b8f('0x6d')];_0x5e681a[_0x0b8f('0x1d')]('\x22'+_0x3aa43e+'\x22');_0x5e681a[_0x0b8f('0x1d')]('\x22'+_0x517217+'\x22');}break;default:_0x5e681a[_0x0b8f('0x1d')]('\x22'+_0x3aa43e+'\x22');}}else{switch(_0x21e85a){case'firstName':case _0x0b8f('0x30'):_0xe8a9f5['push'](_0x21e85a+_0x0b8f('0x8b'));break;default:_0x5e681a['push']('\x22\x22');}}}}else{var _0x575251='';if(!_[_0x0b8f('0x20')](_0x437e08)){if(!_0x3c398c[_0x0b8f('0x7f')](_0x437e08['id'])){if(!_[_0x0b8f('0x20')](_0x592c5b['data'][_0x20a6af][_0x8f5512[_0x21e85a]])){var _0x3aa43e=_[_0x0b8f('0x80')](_0x592c5b[_0x0b8f('0x7c')][_0x20a6af][_0x8f5512[_0x21e85a]][_0x0b8f('0x8c')](/"/g,'\x27'));var _0x52890d=phoneDescriptions[_0x0b8f('0x7e')](_0x7abde=>_0x7abde[_0x0b8f('0x8d')]===_0x437e08['id']);if(!_[_0x0b8f('0x20')](_0x52890d)){var _0x223a1c=_[_0x0b8f('0x80')](_0x592c5b[_0x0b8f('0x7c')][_0x20a6af][_0x8f5512[_0x52890d[_0x0b8f('0x8e')]]][_0x0b8f('0x8c')](/"/g,'\x27'));if(!_[_0x0b8f('0x20')](_0x223a1c))_0x3aa43e=_0x3aa43e+'§'+_0x223a1c;}if(_0x575251=='')_0x575251=_0x3aa43e;else _0x575251+='|'+_0x3aa43e;}_0x582504[_0x0b8f('0x1d')](_0x437e08['id']+':'+_0x575251);_0x3c398c[_0x437e08['id']]=0x1;}}}}if(hasAdditionalPhones){_0x5e681a['push']('\x22'+_0x582504[_0x0b8f('0x15')](';')+'\x22');}if(_0xe8a9f5[_0x0b8f('0x1c')]){handleError(_0x592c5b[_0x0b8f('0x7c')][_0x20a6af],{'code':_0x0b8f('0x8f'),'message':_0xe8a9f5[_0x0b8f('0x15')]()});}else{fs[_0x0b8f('0x90')](_0x163eb1,_0x5e681a[_0x0b8f('0x15')]()+'\x0a');}_0x5e681a=[];}if(!(stats[_0x0b8f('0x7d')]%0xc8)){socket['emit']('contact:import:'+_0x4ba93e,stats);stats[_0x0b8f('0x5b')]=[];}}if(stopped){logger[_0x0b8f('0x56')](_0x0b8f('0x91'));_0x565612[_0x0b8f('0x92')]();}}catch(_0x31ee1d){handleError(_0x592c5b[_0x0b8f('0x7c')][_0x20a6af],{'code':_0x0b8f('0x93'),'message':_0x31ee1d[_0x0b8f('0x59')]});logger[_0x0b8f('0x58')](_0x0b8f('0x94'),_0x31ee1d[_0x0b8f('0x59')]);}},'complete':function(){try{var _0x553d62=[];var _0x30b5f1=[];var _0x2afa48='cm_contacts';if(_0x1b095a['duplicates']&&_0x1b095a[_0x0b8f('0x95')]['length']){_0x2afa48=_0x0b8f('0x96')+_0x4ba93e;_0x553d62['push'](_0x0b8f('0x97')+_0x2afa48+_0x0b8f('0x98'));}tmp_campaigns=_0x0b8f('0x99')+_0x4ba93e;tmp_voice_queues=_0x0b8f('0x9a')+_0x4ba93e;_0x30b5f1['push'](_0x0b8f('0x97')+tmp_campaigns+_0x0b8f('0x9b'));_0x30b5f1[_0x0b8f('0x1d')]('CREATE\x20TABLE\x20'+tmp_voice_queues+_0x0b8f('0x9b'));BPromise[_0x0b8f('0x9c')](_0x30b5f1,handleTZQuery)[_0x0b8f('0x1b')](function(_0x16b41a){updateTzCampaigns(_0x1b095a[_0x0b8f('0x41')])[_0x0b8f('0x1b')](function(_0x49ddef){updateTzVoiceQueues(_0x1b095a[_0x0b8f('0x41')])[_0x0b8f('0x1b')](function(_0x5be9cb){if(hasTZ)_0x52fabb=_0x52fabb['replace'](_0x0b8f('0x6c'),'dialTimezone,utcOffset');var _0x2f2d4d=util['format'](_0x0b8f('0x9d'),_0x163eb1,_0x2afa48,_0x52fabb,_0x1b095a[_0x0b8f('0x41')],_0x1b095a[_0x0b8f('0x51')]||null,NOW,NOW);if(_[_0x0b8f('0x20')](_0x8f5512['scheduledat'])){_0x2f2d4d+=_0x0b8f('0x9e');}_0x553d62[_0x0b8f('0x1d')](_0x2f2d4d);if(_0x1b095a[_0x0b8f('0x95')]&&_0x1b095a[_0x0b8f('0x95')][_0x0b8f('0x1c')]){_0x553d62['push'](insertCmContact(_0x1b095a['ListId'],_0x2afa48,_0x1b095a['duplicates'],_0x8f5512));_0x553d62['push'](_0x0b8f('0x9f')+_0x2afa48+';');}BPromise[_0x0b8f('0x9c')](_0x553d62,handleQuery)[_0x0b8f('0x1b')](function(_0x25997a){BPromise[_0x0b8f('0x1e')]([handleAdditionalPhones()])[_0x0b8f('0x1b')](function(){_0x553d62=[];for(var _0x3ff80a=0x0;_0x3ff80a\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','../../../config/environment/shared','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','CmContact','findAll','AdditionalPhones','then','length','push','all','split','isNil','filter','CmContactHasItem','update','updated','PHONE','cm_contacts.scheduledat','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','updatedAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.phone','cm_contacts.ListId','createdAt','.CmListId','cm_contacts.createdAt\x20=\x20?','field','cm_hopper_black','ListId\x20=\x20?','date_add(cm_contacts.scheduledat,interval\x20','.offset-cm_contacts.utcOffset\x20minute)','\x22always\x22','cm_contacts.id','cm_hopper.id','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.createdAt','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','CmHopperId','OrderBy','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contact_has_items','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','info','error','exit','errors','code','message','sequelize','spread','catch','campaigns.id','campaigns.dialTimezone','campaigns','query','voice_queues.id','voice_queues','voice_queues.id\x20=\x20voice_queues_has_cm_lists.VoiceQueueId','voice_queues_has_cm_lists.CmListId=','timezones','set','offset','dialTimezone','stringify','send','start','binding','clone','socket_timestamp','root','server/files/tmp','.csv','includes','header','ContactItemType','name','_description','writeFileSync','parse','createReadStream','data','rows','find','hasOwnProperty','trim','replace','isValid','isNaN','isNumber','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','itemTypeId','description','SystemRow','emit','contact:import:','abort','step','duplicates','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','campaigns_','voice_queues_','each','dialTimezone,utcOffset','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','contactId','orderBy','voice_queues_has_cm_lists','VoiceQueueId','campaigns_has_cm_lists','CampaignId','campaigns_has_cm_blacklists','finish','affectedRows','unlink'];(function(_0x4624dc,_0x2d47e2){var _0x230719=function(_0x32cbba){while(--_0x32cbba){_0x4624dc['push'](_0x4624dc['shift']());}};_0x230719(++_0x2d47e2);}(_0x35e5,0xc4));var _0x535e=function(_0x7d8149,_0x494283){_0x7d8149=_0x7d8149-0x0;var _0x6a8e5e=_0x35e5[_0x7d8149];return _0x6a8e5e;};'use strict';var fs=require('fs');var path=require(_0x535e('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require(_0x535e('0x1'));var BPromise=require(_0x535e('0x2'));var moment=require(_0x535e('0x3'));var squel=require(_0x535e('0x4'));var Redis=require(_0x535e('0x5'));var db=require(_0x535e('0x6'))['db'];var config=require(_0x535e('0x7'));var shared=require(_0x535e('0x8'));var logger=require(_0x535e('0x9'))(_0x535e('0xa'));config[_0x535e('0xb')]=_[_0x535e('0xc')](config[_0x535e('0xb')],{'host':_0x535e('0xd'),'port':0x18eb});var socket=require(_0x535e('0xe'))(new Redis(config[_0x535e('0xb')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var orderBy=0x0;var stopped=![];var NOW=moment()[_0x535e('0xf')](_0x535e('0x10'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];var tmp_voice_queues;var tmp_campaigns;var tzOffset=0x0;var hasTZ;var NOW=moment()['format'](_0x535e('0x10'));function isEmail(_0x125d38){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))*$/[_0x535e('0x11')](_0x125d38);}function selectNotIn(_0x2f6dae,_0x12970e,_0x568930,_0x4d25e4,_0x427b92){return squel[_0x535e('0x12')]()['field'](_0x535e('0x13'))[_0x535e('0x14')](_0x4d25e4)['join'](_0x12970e,null,_0x12970e+_0x535e('0x15')+_0x4d25e4+'.'+_0x568930)[_0x535e('0x16')](_0x4d25e4+'.'+_0x568930+_0x535e('0x17')+_0x2f6dae+'.'+_0x568930)['where'](_0x12970e+_0x535e('0x18')+_0x427b92[_0x535e('0x19')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x25afaf,_0x385bba){promisesAdditionalPhones=[];return db[_0x535e('0x1a')][_0x535e('0x1b')]({'raw':!![],'attributes':['id',_0x535e('0x1c')],'where':{'createdAt':NOW,'AdditionalPhones':{'$ne':null}}})[_0x535e('0x1d')](function(_0x5addaf){if(_0x5addaf!==null){var _0x4d8073=[];for(var _0x106c20=0x0;_0x106c20<_0x5addaf[_0x535e('0x1e')];_0x106c20++){var _0x22c5fd=_0x5addaf[_0x106c20];_0x4d8073[_0x535e('0x1f')](insertAdditionalPhones(_0x22c5fd));}}Promise[_0x535e('0x20')](_0x4d8073)[_0x535e('0x1d')](function(){_0x25afaf({'val':0x1});});});});}function insertAdditionalPhones(_0x1969cf){return new Promise(function(_0x5ce841,_0x3eed3e){var _0x39d46e=_0x1969cf['AdditionalPhones'];var _0x318d51=_0x39d46e[_0x535e('0x21')](';');var _0x44c663=[];orderBy=0x0;for(var _0x44554d=0x0;_0x44554d<_0x318d51[_0x535e('0x1e')];_0x44554d++){_0x44c663[_0x535e('0x1f')](splitAdditionalPhone(_0x1969cf['id'],_0x318d51[_0x44554d]));}Promise[_0x535e('0x20')](_0x44c663)[_0x535e('0x1d')](function(){_0x5ce841({'val':_0x318d51['length']});});});}function splitAdditionalPhone(_0xd6133,_0x3b70c5){return new Promise(function(_0x5ae559,_0x517070){var _0x27d787=_0x3b70c5['split'](':');var _0x11b7b8=_0x27d787[0x0];var _0x59358f=_0x27d787[0x1];if(!_[_0x535e('0x22')](_0x59358f)){var _0x5a16c8=_0x59358f['split']('|');var _0x957799=[];for(var _0xb16a07=0x0;_0xb16a07<_0x5a16c8[_0x535e('0x1e')];_0xb16a07++){if(_0x5a16c8[_0xb16a07]!==''){var _0x3c27da=_[_0x535e('0x23')](promisesAdditionalPhones,{'contactId':_0xd6133,'phone':_0x5a16c8[_0xb16a07]});if(_0x3c27da[_0x535e('0x1e')]==0x0){orderBy++;promisesAdditionalPhones[_0x535e('0x1f')]({'contactId':_0xd6133,'contactTypeId':_0x11b7b8,'phone':_0x5a16c8[_0xb16a07],'orderBy':orderBy});}}}_0x5ae559({'ok':0x1});}else _0x5ae559({'res':0x0});});}function createAdditionalPhone(_0x4fa84a,_0x5a5231,_0x34116c,_0x357765){var _0x4e3b19='';var _0xf18b9b='';var _0x38f70b=_0x34116c[_0x535e('0x21')]('§');_0x4e3b19=_0x38f70b[0x0];if(_0x38f70b[_0x535e('0x1e')]==0x2)_0xf18b9b=_0x38f70b[0x1];return new Promise(function(_0x50e5eb,_0x3ba58c){return db[_0x535e('0x24')]['findOne']({'where':{'CmContactId':_0x4fa84a,'item':_0x4e3b19}})[_0x535e('0x1d')](function(_0x5d093a){if(_0x5d093a){return db['CmContactHasItem'][_0x535e('0x25')]({'ItemTypeId':_0x5a5231,'description':_0xf18b9b,'OrderBy':_0x357765},{'where':{'CmContactId':_0x4fa84a,'item':_0x4e3b19}})[_0x535e('0x1d')](function(_0x20258b){_0x50e5eb({'res':_0x535e('0x26')});});}else{return db[_0x535e('0x24')]['create']({'CmContactId':_0x4fa84a,'item':_0x4e3b19,'description':_0xf18b9b,'ItemTypeId':_0x5a5231,'OrderBy':_0x357765,'ItemClass':_0x535e('0x27')})[_0x535e('0x1d')](function(_0x42e343){_0x50e5eb({'res':'inserted'});});}});});}function insertCmHopper(_0x513dcb,_0x41cd67,_0x4b5b00,_0x116109,_0x2e8fa8){var _0x3c1e12=['cm_contacts.phone',_0x535e('0x28'),'cm_contacts.id','cm_contacts.ListId',_0x41cd67+'.'+_0x116109,_0x535e('0x29'),_0x535e('0x2a'),_0x535e('0x2b'),_0x535e('0x2c'),'\x22'+_0x2e8fa8+'\x22'];return squel[_0x535e('0x2d')]()[_0x535e('0x2e')](_0x535e('0x2f'))[_0x535e('0x30')]([_0x535e('0x13'),_0x535e('0x31'),_0x535e('0x32'),_0x535e('0x33'),_0x116109,'createdAt',_0x535e('0x34'),_0x535e('0x35'),_0x535e('0x36'),_0x535e('0x37')],squel['select']()[_0x535e('0x38')](_0x3c1e12)['from'](_0x41cd67)['join'](_0x535e('0x39'),null,_0x535e('0x3a')+_0x41cd67+'.CmListId')[_0x535e('0x19')](_0x4b5b00,null,_0x4b5b00+_0x535e('0x15')+_0x41cd67+'.'+_0x116109)[_0x535e('0x16')](_0x41cd67+_0x535e('0x3b'),_0x513dcb)[_0x535e('0x16')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x535e('0x16')](_0x535e('0x3c'),selectNotIn(_0x41cd67,_0x4b5b00,_0x116109,_0x535e('0x2f'),['\x22always\x22','\x22onlyIfOpen\x22']))[_0x535e('0x16')](_0x535e('0x3c'),selectNotIn(_0x41cd67,_0x4b5b00,_0x116109,_0x535e('0x2f'),['\x22always\x22'])))[_0x535e('0x3d')]();}function insertCmHopperBlack(_0x3c6ac2,_0x48dd36,_0x3d5bae,_0x4964b6){var _0x3753bd=[_0x535e('0x3e'),'cm_contacts.id',_0x535e('0x3f'),_0x48dd36+'.'+_0x4964b6,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel[_0x535e('0x2d')]()[_0x535e('0x2e')]('cm_hopper_black')[_0x535e('0x30')](['phone',_0x535e('0x32'),'ListId',_0x4964b6,_0x535e('0x40'),_0x535e('0x34')],squel['select']()[_0x535e('0x38')](_0x3753bd)[_0x535e('0x14')](_0x48dd36)[_0x535e('0x19')]('cm_contacts',null,_0x535e('0x3a')+_0x48dd36+_0x535e('0x41'))[_0x535e('0x19')](_0x3d5bae,null,_0x3d5bae+_0x535e('0x15')+_0x48dd36+'.'+_0x4964b6)[_0x535e('0x16')](_0x48dd36+_0x535e('0x3b'),_0x3c6ac2)[_0x535e('0x16')](_0x535e('0x42'),NOW)[_0x535e('0x16')](_0x535e('0x3c'),squel[_0x535e('0x12')]()[_0x535e('0x43')](_0x535e('0x13'))[_0x535e('0x14')](_0x535e('0x44'))[_0x535e('0x16')](_0x535e('0x45'),_0x3c6ac2)[_0x535e('0x16')](_0x4964b6+_0x535e('0x17')+_0x48dd36+'.'+_0x4964b6)))[_0x535e('0x3d')]();}function insertTzCmHopper(_0x1433f8,_0x3e4b45,_0x302042,_0x32bdde,_0x196481,_0x816213){var _0x47a563=[_0x535e('0x3e'),_0x535e('0x46')+_0x816213+_0x535e('0x47'),'cm_contacts.id','cm_contacts.ListId',_0x3e4b45+'.'+_0x32bdde,_0x535e('0x29'),_0x535e('0x2a'),_0x535e('0x2b'),'cm_contacts.UserId','\x22'+_0x196481+'\x22'];var _0x5b2467=squel[_0x535e('0x2d')]()[_0x535e('0x2e')](_0x535e('0x2f'))[_0x535e('0x30')]([_0x535e('0x13'),'scheduledat',_0x535e('0x32'),_0x535e('0x33'),_0x32bdde,'createdAt',_0x535e('0x34'),_0x535e('0x35'),_0x535e('0x36'),_0x535e('0x37')],squel[_0x535e('0x12')]()[_0x535e('0x38')](_0x47a563)[_0x535e('0x14')](_0x3e4b45)[_0x535e('0x19')](_0x535e('0x39'),null,_0x535e('0x3a')+_0x3e4b45+_0x535e('0x41'))[_0x535e('0x19')](_0x302042,null,_0x302042+_0x535e('0x15')+_0x3e4b45+'.'+_0x32bdde)[_0x535e('0x19')](_0x816213,null,_0x816213+_0x535e('0x15')+_0x3e4b45+'.'+_0x32bdde)[_0x535e('0x16')](_0x3e4b45+'.CmListId\x20=\x20?',_0x1433f8)[_0x535e('0x16')](_0x535e('0x42'),NOW)['where'](_0x535e('0x3c'),selectNotIn(_0x3e4b45,_0x302042,_0x32bdde,_0x535e('0x2f'),[_0x535e('0x48'),'\x22onlyIfOpen\x22']))['where'](_0x535e('0x3c'),selectNotIn(_0x3e4b45,_0x302042,_0x32bdde,_0x535e('0x2f'),['\x22always\x22'])))[_0x535e('0x3d')]();return _0x5b2467;}function insertTzCmHopperBlack(_0x54450d,_0x3c9f14,_0x1c795d,_0x592999){var _0x1803ea=[_0x535e('0x3e'),_0x535e('0x49'),_0x535e('0x3f'),_0x3c9f14+'.'+_0x592999,_0x535e('0x29'),_0x535e('0x2a')];return squel[_0x535e('0x2d')]()[_0x535e('0x2e')](_0x535e('0x44'))[_0x535e('0x30')]([_0x535e('0x13'),'ContactId','ListId',_0x592999,_0x535e('0x40'),_0x535e('0x34')],squel[_0x535e('0x12')]()[_0x535e('0x38')](_0x1803ea)[_0x535e('0x14')](_0x3c9f14)['join'](_0x535e('0x39'),null,'cm_contacts.ListId\x20=\x20'+_0x3c9f14+_0x535e('0x41'))[_0x535e('0x19')](_0x1c795d,null,_0x1c795d+'.id\x20=\x20'+_0x3c9f14+'.'+_0x592999)['where'](_0x3c9f14+_0x535e('0x3b'),_0x54450d)[_0x535e('0x16')](_0x535e('0x42'),NOW)[_0x535e('0x16')](_0x535e('0x3c'),squel['select']()[_0x535e('0x43')](_0x535e('0x13'))[_0x535e('0x14')]('cm_hopper_black')[_0x535e('0x16')](_0x535e('0x45'),_0x54450d)[_0x535e('0x16')](_0x592999+_0x535e('0x17')+_0x3c9f14+'.'+_0x592999)))['toString']();}function insertCmHopperAdditionalPhones(_0x28007b){var _0x45ecb2=[_0x535e('0x4a'),_0x535e('0x4b'),_0x535e('0x4c'),_0x535e('0x4d'),_0x535e('0x4e')];return squel[_0x535e('0x2d')]()[_0x535e('0x2e')](_0x535e('0x4f'))[_0x535e('0x30')]([_0x535e('0x50'),'phone',_0x535e('0x51'),_0x535e('0x40'),_0x535e('0x34')],squel[_0x535e('0x12')]()['fields'](_0x45ecb2)['from'](_0x535e('0x2f'))[_0x535e('0x19')](_0x535e('0x39'),null,_0x535e('0x52'))[_0x535e('0x19')](_0x535e('0x53'),null,_0x535e('0x54'))['where']('cm_hopper.ListId\x20=\x20?',_0x28007b)[_0x535e('0x16')](_0x535e('0x42'),NOW))[_0x535e('0x3d')]();}function insertCmContact(_0x5cf6cc,_0x298700,_0x27d7bc,_0x1cc6d4){var _0x3891de=_[_0x535e('0x55')](_[_0x535e('0x56')](_0x1cc6d4),[_0x535e('0x33'),_0x535e('0x57'),_0x535e('0x40'),_0x535e('0x34')]);return squel['insert']()[_0x535e('0x2e')](_0x535e('0x39'))[_0x535e('0x30')](_0x3891de,squel[_0x535e('0x12')]()[_0x535e('0x38')](_0x3891de)['from'](_0x298700)['where']('('+_0x27d7bc['join'](',')+_0x535e('0x58'),squel[_0x535e('0x12')]()[_0x535e('0x38')](_0x27d7bc)[_0x535e('0x14')](_0x535e('0x39'))['where'](_0x535e('0x45'),_0x5cf6cc)[_0x535e('0x16')](_0x535e('0x59')))[_0x535e('0x16')](_0x535e('0x5a'),squel['select']()[_0x535e('0x43')](_0x535e('0x5b'),'min_id')[_0x535e('0x14')](_0x298700)['group'](_0x27d7bc['join'](','))))[_0x535e('0x3d')]();}function handleStop(){logger[_0x535e('0x5c')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x23b5ac){logger[_0x535e('0x5d')](_0x23b5ac['message']);process[_0x535e('0x5e')](0x1);}function handleError(_0x326630,_0x5b9752){stats[_0x535e('0x5f')][_0x535e('0x1f')]({'name':_0x5b9752[_0x535e('0x60')],'message':_0x5b9752[_0x535e('0x61')],'row':_0x326630});}function handleQuery(_0x641590){logger['info'](_0x641590);return db[_0x535e('0x62')]['query'](_0x641590)[_0x535e('0x63')](function(_0x18f976){results[_0x535e('0x1f')](_0x18f976);})[_0x535e('0x64')](function(_0x225732){logger[_0x535e('0x5d')](_0x225732[_0x535e('0x61')]);});}function updateTzCampaigns(_0x58fef0){return new Promise(function(_0xb56f00,_0x53d377){var _0x2197ae=squel[_0x535e('0x12')]()[_0x535e('0x38')]([_0x535e('0x65'),_0x535e('0x66')])[_0x535e('0x14')](_0x535e('0x67'))['join']('campaigns_has_cm_lists',null,'campaigns.id\x20=\x20campaigns_has_cm_lists.CampaignId')[_0x535e('0x16')]('campaigns_has_cm_lists.CmListId='+_0x58fef0);db['sequelize'][_0x535e('0x68')](_0x2197ae['toString']())[_0x535e('0x63')](function(_0x3b22bb){var _0x43757e=[];for(var _0x351878=0x0;_0x351878<_0x3b22bb[_0x535e('0x1e')];_0x351878++){_0x43757e[_0x535e('0x1f')](getTimezoneData(_0x3b22bb[_0x351878],tmp_campaigns));}BPromise[_0x535e('0x20')](_0x43757e)[_0x535e('0x1d')](function(){_0xb56f00({'val':0x1});});})['catch'](function(_0x393715){logger[_0x535e('0x5d')](_0x393715[_0x535e('0x61')]);_0xb56f00({'val':0x0});});});}function updateTzVoiceQueues(_0x39a743){return new Promise(function(_0x1fcb68,_0x1884b5){var _0x27e44a=squel[_0x535e('0x12')]()['fields']([_0x535e('0x69'),'voice_queues.dialTimezone'])[_0x535e('0x14')](_0x535e('0x6a'))[_0x535e('0x19')]('voice_queues_has_cm_lists',null,_0x535e('0x6b'))[_0x535e('0x16')](_0x535e('0x6c')+_0x39a743);db['sequelize']['query'](_0x27e44a['toString']())[_0x535e('0x63')](function(_0x5f0c76){var _0x22e881=[];for(var _0x43c095=0x0;_0x43c095<_0x5f0c76[_0x535e('0x1e')];_0x43c095++){_0x22e881[_0x535e('0x1f')](getTimezoneData(_0x5f0c76[_0x43c095],tmp_voice_queues));}BPromise[_0x535e('0x20')](_0x22e881)[_0x535e('0x1d')](function(){_0x1fcb68({'val':0x1});});})[_0x535e('0x64')](function(_0x2ce68c){logger[_0x535e('0x5d')](_0x2ce68c['message']);_0x1fcb68({'val':0x0});});});}function getTimezoneData(_0x3b3e0c,_0x442b0f){return new Promise(function(_0x55c404,_0x5089bd){var _0x6094c4=shared[_0x535e('0x6d')];var _0x31f5d3=_0x6094c4[_0x3b3e0c['dialTimezone']];if(_['isNil'](_0x31f5d3)){_0x55c404({'ret':0x1});}else{var _0x181d83=_0x31f5d3['utcOffset'];var _0x26175f=squel[_0x535e('0x2d')]()[_0x535e('0x2e')](_0x442b0f)[_0x535e('0x6e')]('id',_0x3b3e0c['id'])[_0x535e('0x6e')](_0x535e('0x6f'),_0x181d83)[_0x535e('0x6e')](_0x535e('0x70'),_0x3b3e0c['dialTimezone'])[_0x535e('0x3d')]();return db[_0x535e('0x62')][_0x535e('0x68')](_0x26175f)['spread'](function(_0x84ca84){_0x55c404({'ret':0x1});})[_0x535e('0x64')](function(_0x53ea68){logger[_0x535e('0x5d')](_0x53ea68[_0x535e('0x61')]);_0x5089bd({'ret':0x1});});}});}function handleTZQuery(_0x568fa1){logger[_0x535e('0x5c')](_0x568fa1);return db[_0x535e('0x62')][_0x535e('0x68')](_0x568fa1)[_0x535e('0x63')](function(_0x47cca6){})[_0x535e('0x64')](function(_0x541187){logger[_0x535e('0x5d')](_0x541187[_0x535e('0x61')]);});}function main(_0x37ec9b,_0x5b8b94,_0x220880,_0x59e875){logger[_0x535e('0x5c')]('main',_0x37ec9b,JSON[_0x535e('0x71')](_0x5b8b94));process[_0x535e('0x72')](_0x535e('0x73'));var _0x416390=_0x5b8b94[_0x535e('0x74')];var _0x38b4e2=_[_0x535e('0x75')](_0x416390);var _0x372e88=_0x5b8b94[_0x535e('0x76')];var _0x205750=path[_0x535e('0x19')](config[_0x535e('0x77')],_0x535e('0x78'),_0x372e88+_0x535e('0x79'));hasTZ=_[_0x535e('0x56')](_0x416390)[_0x535e('0x7a')](_0x535e('0x70'));var _0x3854d1=_[_0x535e('0x56')](_0x416390)[_0x535e('0x19')]();logger[_0x535e('0x5c')](_0x535e('0x7b'),_0x3854d1);db[_0x535e('0x7c')][_0x535e('0x1b')]({'raw':!![],'attributes':['id','name']})[_0x535e('0x1d')](function(_0x557b49){for(var _0x2677af=0x0;_0x2677af<_0x557b49[_0x535e('0x1e')];_0x2677af++){if(_0x557b49[_0x2677af][_0x535e('0x7d')]in _0x416390){contactItemTypes[_0x535e('0x1f')](_0x557b49[_0x2677af]);delete _0x38b4e2[_0x557b49[_0x2677af]['name']];hasAdditionalPhones=!![];}for(var _0x14733a in _0x416390){if(_0x557b49[_0x2677af][_0x535e('0x7d')]+_0x535e('0x7e')===_0x14733a){phoneDescriptions['push']({'itemTypeId':_0x557b49[_0x2677af]['id'],'description':_0x14733a});delete _0x38b4e2[_0x14733a];}}}if(hasAdditionalPhones)_0x38b4e2[_0x535e('0x1c')]='';var _0x42758c=_[_0x535e('0x56')](_0x38b4e2)[_0x535e('0x19')]();logger[_0x535e('0x5c')](_0x535e('0x7b'),_0x42758c);fs[_0x535e('0x7f')](_0x205750,_0x42758c+'\x0a');Papa[_0x535e('0x80')](fs[_0x535e('0x81')](_0x37ec9b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5f5ae4,_0x152472){try{for(var _0xb00fb9=0x0,_0x2def65=[];_0xb00fb9<_0x5f5ae4[_0x535e('0x82')][_0x535e('0x1e')];_0xb00fb9++){stats[_0x535e('0x83')]+=0x1;if(_0x5f5ae4[_0x535e('0x5f')][_0xb00fb9]){handleError(_0x5f5ae4['data'][_0xb00fb9],_0x5f5ae4['errors'][_0xb00fb9]);}else{var _0x1a83aa=[];var _0x2cb3ad=[];var _0x47cc70={};for(var _0xfcd047 in _0x416390){let _0x3f5a69=contactItemTypes[_0x535e('0x84')](_0xea6362=>_0xea6362[_0x535e('0x7d')]===_0xfcd047);let _0xa59f6f=contactItemTypes[_0x535e('0x84')](_0x1f9c4b=>_0x1f9c4b[_0x535e('0x7d')]+_0x535e('0x7e')===_0xfcd047);if(_[_0x535e('0x22')](_0x3f5a69)&&_[_0x535e('0x22')](_0xa59f6f)){if(_0x416390[_0x535e('0x85')](_0xfcd047)){if(_0x5f5ae4['data'][_0xb00fb9][_0x416390[_0xfcd047]]){var _0x2dd360=_[_0x535e('0x86')](_0x5f5ae4['data'][_0xb00fb9][_0x416390[_0xfcd047]][_0x535e('0x87')](/"/g,'\x27'));switch(_0xfcd047){case _0x535e('0x31'):var _0x327c28=moment(_0x2dd360,_0x535e('0x10'),!![]);if(_0x327c28[_0x535e('0x88')]()){_0x2def65[_0x535e('0x1f')]('\x22'+_0x2dd360+'\x22');}else{_0x1a83aa['push']('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x535e('0x35'):var _0x288171=parseInt(_0x2dd360);_0x2dd360=_[_0x535e('0x89')](_0x288171)||_0x288171<0x0||_0x288171>0x4?_0x59e875?0x3:0x2:_0x288171;_0x2def65[_0x535e('0x1f')]('\x22'+_0x2dd360+'\x22');break;case _0x535e('0x36'):var _0x364def=parseInt(_0x2dd360);if(_[_0x535e('0x8a')](_0x364def)&&_[_0x535e('0x7a')](_0x220880,_0x364def)){_0x2def65[_0x535e('0x1f')]('\x22'+_0x364def+'\x22');}else{_0x1a83aa[_0x535e('0x1f')]('agent\x20not\x20exists');}break;case _0x535e('0x8b'):if(isEmail(_0x2dd360)){_0x2def65[_0x535e('0x1f')]('\x22'+_0x2dd360+'\x22');}else{_0x1a83aa[_0x535e('0x1f')](_0x535e('0x8c'));}break;case _0x535e('0x8d'):var _0x180519=moment(_0x2dd360,_0x535e('0x8e'),!![]);if(_0x180519[_0x535e('0x88')]()){_0x2def65[_0x535e('0x1f')]('\x22'+_0x2dd360+'\x22');}else{_0x1a83aa[_0x535e('0x1f')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;case _0x535e('0x70'):var _0x3e0c00=shared[_0x535e('0x6d')];var _0x1a05b1=_0x3e0c00[_0x2dd360];if(!_[_0x535e('0x22')](_0x1a05b1)){var _0x116967=_0x1a05b1['utcOffset'];_0x2def65[_0x535e('0x1f')]('\x22'+_0x2dd360+'\x22');_0x2def65['push']('\x22'+_0x116967+'\x22');}break;default:_0x2def65[_0x535e('0x1f')]('\x22'+_0x2dd360+'\x22');}}else{switch(_0xfcd047){case _0x535e('0x8f'):case _0x535e('0x13'):_0x1a83aa['push'](_0xfcd047+_0x535e('0x90'));break;default:_0x2def65[_0x535e('0x1f')]('\x22\x22');}}}}else{var _0x55c0db='';if(!_[_0x535e('0x22')](_0x3f5a69)){if(!_0x47cc70[_0x535e('0x85')](_0x3f5a69['id'])){if(!_[_0x535e('0x22')](_0x5f5ae4[_0x535e('0x82')][_0xb00fb9][_0x416390[_0xfcd047]])){var _0x2dd360=_['trim'](_0x5f5ae4[_0x535e('0x82')][_0xb00fb9][_0x416390[_0xfcd047]][_0x535e('0x87')](/"/g,'\x27'));var _0x180e5c=phoneDescriptions[_0x535e('0x84')](_0x4e3504=>_0x4e3504[_0x535e('0x91')]===_0x3f5a69['id']);if(!_[_0x535e('0x22')](_0x180e5c)){var _0x51cf84=_[_0x535e('0x86')](_0x5f5ae4[_0x535e('0x82')][_0xb00fb9][_0x416390[_0x180e5c[_0x535e('0x92')]]][_0x535e('0x87')](/"/g,'\x27'));if(!_[_0x535e('0x22')](_0x51cf84))_0x2dd360=_0x2dd360+'§'+_0x51cf84;}if(_0x55c0db=='')_0x55c0db=_0x2dd360;else _0x55c0db+='|'+_0x2dd360;}_0x2cb3ad[_0x535e('0x1f')](_0x3f5a69['id']+':'+_0x55c0db);_0x47cc70[_0x3f5a69['id']]=0x1;}}}}if(hasAdditionalPhones){_0x2def65[_0x535e('0x1f')]('\x22'+_0x2cb3ad[_0x535e('0x19')](';')+'\x22');}if(_0x1a83aa[_0x535e('0x1e')]){handleError(_0x5f5ae4[_0x535e('0x82')][_0xb00fb9],{'code':_0x535e('0x93'),'message':_0x1a83aa[_0x535e('0x19')]()});}else{fs['appendFileSync'](_0x205750,_0x2def65[_0x535e('0x19')]()+'\x0a');}_0x2def65=[];}if(!(stats[_0x535e('0x83')]%0xc8)){socket[_0x535e('0x94')](_0x535e('0x95')+_0x372e88,stats);stats[_0x535e('0x5f')]=[];}}if(stopped){logger[_0x535e('0x5c')]('Abort\x20parser');_0x152472[_0x535e('0x96')]();}}catch(_0x50bd80){handleError(_0x5f5ae4[_0x535e('0x82')][_0xb00fb9],{'code':'SystemError','message':_0x50bd80['message']});logger['error'](_0x535e('0x97'),_0x50bd80[_0x535e('0x61')]);}},'complete':function(){try{var _0x51fcf0=[];var _0x1ce887=[];var _0x2004b8='cm_contacts';if(_0x5b8b94[_0x535e('0x98')]&&_0x5b8b94[_0x535e('0x98')][_0x535e('0x1e')]){_0x2004b8='cm_contacts_'+_0x372e88;_0x51fcf0[_0x535e('0x1f')](_0x535e('0x99')+_0x2004b8+_0x535e('0x9a'));}tmp_campaigns=_0x535e('0x9b')+_0x372e88;tmp_voice_queues=_0x535e('0x9c')+_0x372e88;_0x1ce887['push'](_0x535e('0x99')+tmp_campaigns+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');_0x1ce887[_0x535e('0x1f')](_0x535e('0x99')+tmp_voice_queues+'(id\x20int,dialTimezone\x20varchar(255),offset\x20int);');BPromise[_0x535e('0x9d')](_0x1ce887,handleTZQuery)[_0x535e('0x1d')](function(_0x21f8a3){updateTzCampaigns(_0x5b8b94[_0x535e('0x33')])[_0x535e('0x1d')](function(_0x493ca7){updateTzVoiceQueues(_0x5b8b94['ListId'])[_0x535e('0x1d')](function(_0x122c4b){if(hasTZ)_0x42758c=_0x42758c['replace']('dialTimezone',_0x535e('0x9e'));var _0x32bd76=util[_0x535e('0xf')](_0x535e('0x9f'),_0x205750,_0x2004b8,_0x42758c,_0x5b8b94[_0x535e('0x33')],_0x5b8b94[_0x535e('0x57')]||null,NOW,NOW);if(_['isNil'](_0x416390[_0x535e('0x31')])){_0x32bd76+=_0x535e('0xa0');}_0x51fcf0[_0x535e('0x1f')](_0x32bd76);if(_0x5b8b94['duplicates']&&_0x5b8b94[_0x535e('0x98')][_0x535e('0x1e')]){_0x51fcf0[_0x535e('0x1f')](insertCmContact(_0x5b8b94[_0x535e('0x33')],_0x2004b8,_0x5b8b94[_0x535e('0x98')],_0x416390));_0x51fcf0[_0x535e('0x1f')](_0x535e('0xa1')+_0x2004b8+';');}BPromise[_0x535e('0x9d')](_0x51fcf0,handleQuery)[_0x535e('0x1d')](function(_0x37a4a4){BPromise[_0x535e('0x20')]([handleAdditionalPhones()])['then'](function(){_0x51fcf0=[];for(var _0xf1a174=0x0;_0xf1a174\x20\x20','server/files/tmp','existsSync','file\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','uncaughtException','path','util','bluebird','moment','squel','../../../mysqldb','../../../config/logger','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','YYYYMMDDHHmmss','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','sequelize','query','select\x20*\x20from\x20','length','isNil','AdditionalPhones','all','then','catch','error','message','split','push','filter','CmContactHasItem','findOne','update','updated','PHONE','inserted','CmContact','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','ContactId','ListId','createdAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone','cm_hopper_black','fromQuery','ListId\x20=\x20?','\x20=\x20?','cm_contact_has_items.item','cm_contact_has_items.OrderBy','cm_contact_has_items.updatedAt','cm_hopper_additional_phones','OrderBy','updatedAt','cm_contacts.id\x20=\x20cm_hopper.ContactId','cm_contacts.id\x20=\x20cm_contact_has_items.CmContactId','cm_hopper.ListId\x20=\x20?','toString','keys',')\x20NOT\x20IN\x20?','MIN(id)','min_id','info','errors','code','spread','start','binding','clone','socket_timestamp','root','.csv','body','ContactItemType','findAll','name','_description','header','writeFileSync','createReadStream','data','rows','find','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','hasOwnProperty','itemTypeId','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','CIS\x20len','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\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId',',\x20scheduledAt\x20=\x20NOW()','contact','contactTypeId','orderBy','each','affectedRows'];(function(_0x4af038,_0x354822){var _0x5a12f4=function(_0xe71ae1){while(--_0xe71ae1){_0x4af038['push'](_0x4af038['shift']());}};_0x5a12f4(++_0x354822);}(_0x86dc,0x13e));var _0xc86d=function(_0x12e211,_0x28da09){_0x12e211=_0x12e211-0x0;var _0xef2553=_0x86dc[_0x12e211];return _0xef2553;};'use strict';var fs=require('fs');var path=require(_0xc86d('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require(_0xc86d('0x1'));var BPromise=require(_0xc86d('0x2'));var moment=require(_0xc86d('0x3'));var squel=require(_0xc86d('0x4'));var Redis=require('ioredis');var db=require(_0xc86d('0x5'))['db'];var config=require('../../../config/environment');var logger=require(_0xc86d('0x6'))('import');config[_0xc86d('0x7')]=_[_0xc86d('0x8')](config[_0xc86d('0x7')],{'host':'localhost','port':0x18eb});var socket=require(_0xc86d('0x9'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xc86d('0xa')](_0xc86d('0xb'));var tempTableName='cm_contacts_temp_'+moment()['format'](_0xc86d('0xc'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x47086a){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'](_0x47086a);}function selectNotIn(_0x2963c9,_0x332344,_0x41b7dd,_0x44e5dc,_0x1aebff){return squel[_0xc86d('0xd')]()[_0xc86d('0xe')](_0xc86d('0xf'))[_0xc86d('0x10')](_0x44e5dc)[_0xc86d('0x11')](_0x332344,null,_0x332344+_0xc86d('0x12')+_0x44e5dc+'.'+_0x41b7dd)[_0xc86d('0x13')](_0x44e5dc+'.'+_0x41b7dd+_0xc86d('0x14')+_0x2963c9+'.'+_0x41b7dd)[_0xc86d('0x13')](_0x332344+_0xc86d('0x15')+_0x1aebff[_0xc86d('0x11')]()+')');}function handleAdditionalPhones(){return new Promise(function(_0x176ce1,_0x313c16){promisesAdditionalPhones=[];promisesContact=[];return db[_0xc86d('0x16')][_0xc86d('0x17')](_0xc86d('0x18')+tempTableName)['spread'](function(_0x4fb8e7){if(_0x4fb8e7!==null){var _0x49af1f=[];for(var _0x3a253c=0x0;_0x3a253c<_0x4fb8e7[_0xc86d('0x19')];_0x3a253c++){var _0x17f576=_0x4fb8e7[_0x3a253c];if(!_[_0xc86d('0x1a')](_0x17f576[_0xc86d('0xf')])){if(!_[_0xc86d('0x1a')](_0x17f576[_0xc86d('0x1b')]))_0x49af1f['push'](insertAdditionalPhones(_0x17f576));promisesContact['push']({'contact':_0x17f576});}}}Promise[_0xc86d('0x1c')](_0x49af1f)[_0xc86d('0x1d')](function(){_0x176ce1({'val':0x1});});})[_0xc86d('0x1e')](function(_0x56f510){logger[_0xc86d('0x1f')](_0x56f510[_0xc86d('0x20')]);});});}function insertAdditionalPhones(_0x4f1efc){return new Promise(function(_0x4eb0e5,_0x330c70){var _0x210043=_0x4f1efc['AdditionalPhones'];if(_[_0xc86d('0x1a')](_0x210043))_0x330c70({'val':0x0});else{var _0x1adaaa=_0x210043[_0xc86d('0x21')](';');var _0x27ebd8=[];orderBy=0x0;for(var _0x57d804=0x0;_0x57d804<_0x1adaaa[_0xc86d('0x19')];_0x57d804++){_0x27ebd8[_0xc86d('0x22')](splitAdditionalPhone(_0x4f1efc['id'],_0x1adaaa[_0x57d804]));}Promise[_0xc86d('0x1c')](_0x27ebd8)[_0xc86d('0x1d')](function(){_0x4eb0e5({'val':_0x1adaaa[_0xc86d('0x19')]});});}});}function splitAdditionalPhone(_0x56278d,_0x38fb11){return new Promise(function(_0x419afa,_0x41de64){var _0xd59e7b=_0x38fb11[_0xc86d('0x21')](':');var _0x5347f7=_0xd59e7b[0x0];var _0x1458fe=_0xd59e7b[0x1];if(_0x1458fe!==''){var _0x54303e=_0x1458fe['split']('|');var _0x533cce=[];for(var _0x2782b8=0x0;_0x2782b8<_0x54303e[_0xc86d('0x19')];_0x2782b8++){if(_0x54303e[_0x2782b8]!==''){var _0x273c5a=_[_0xc86d('0x23')](promisesAdditionalPhones,{'contactId':_0x56278d,'phone':_0x54303e[_0x2782b8]});if(_0x273c5a[_0xc86d('0x19')]==0x0){orderBy++;promisesAdditionalPhones[_0xc86d('0x22')]({'contactId':_0x56278d,'contactTypeId':_0x5347f7,'phone':_0x54303e[_0x2782b8],'orderBy':orderBy});}}}_0x419afa({'ok':0x1});}else _0x419afa({'res':0x0});});}function createAdditionalPhone(_0x2fabc0,_0x2a35b3,_0x4db581,_0x397a55){var _0x2bce7b='';var _0x581a9e='';var _0x5cf11a=_0x4db581[_0xc86d('0x21')]('§');_0x2bce7b=_0x5cf11a[0x0];if(_0x5cf11a[_0xc86d('0x19')]==0x2)_0x581a9e=_0x5cf11a[0x1];return new Promise(function(_0x54a9f6,_0x271b23){return db[_0xc86d('0x24')][_0xc86d('0x25')]({'where':{'CmContactId':_0x2fabc0,'item':_0x2bce7b}})[_0xc86d('0x1d')](function(_0x5a4ef1){if(_0x5a4ef1){return db['CmContactHasItem'][_0xc86d('0x26')]({'ItemTypeId':_0x2a35b3,'description':_0x581a9e,'OrderBy':_0x397a55},{'where':{'CmContactId':_0x2fabc0,'item':_0x2bce7b}})[_0xc86d('0x1d')](function(_0x18e468){_0x54a9f6({'res':_0xc86d('0x27')});});}else{return db[_0xc86d('0x24')]['create']({'CmContactId':_0x2fabc0,'item':_0x2bce7b,'ItemTypeId':_0x2a35b3,'description':_0x581a9e,'OrderBy':_0x397a55,'ItemClass':_0xc86d('0x28')})['then'](function(_0xc539d0){_0x54a9f6({'res':_0xc86d('0x29')});});}});});}function updateContact(_0x1f01f7){return new Promise(function(_0x21377a,_0x3a469d){var _0x1d7fe8=_0x1f01f7['id'];delete _0x1f01f7['id'];return db[_0xc86d('0x2a')][_0xc86d('0x26')](_0x1f01f7,{'where':{'id':_0x1d7fe8}})[_0xc86d('0x1d')](function(_0x4e51bd){updatedRows+=0x1;return db['CmHopper']['update']({'phone':_0x1f01f7['phone']},{'where':{'ContactId':_0x1d7fe8}})['then'](function(_0x514cf0){_0x21377a({'ret':'OK'});});});});}function insertCmHopper(_0x412dd7,_0x44f4fa,_0x3fa1dd,_0x118007,_0x2cba68){var _0x225a25=['cm_contacts.phone',_0xc86d('0x2b'),_0xc86d('0x2c'),_0xc86d('0x2d'),_0x44f4fa+'.'+_0x118007,_0xc86d('0x2e'),_0xc86d('0x2f'),_0xc86d('0x30'),_0xc86d('0x31'),'\x22'+_0x2cba68+'\x22'];return squel[_0xc86d('0x32')]()[_0xc86d('0x33')](_0xc86d('0x34'))['fromQuery']([_0xc86d('0xf'),'scheduledat',_0xc86d('0x35'),_0xc86d('0x36'),_0x118007,_0xc86d('0x37'),'updatedAt',_0xc86d('0x38'),_0xc86d('0x39'),_0xc86d('0x3a')],squel['select']()[_0xc86d('0x3b')](_0x225a25)[_0xc86d('0x10')](_0x44f4fa)[_0xc86d('0x11')](_0xc86d('0x3c'),null,_0xc86d('0x3d')+_0x44f4fa+'.CmListId')[_0xc86d('0x11')](_0x3fa1dd,null,_0x3fa1dd+_0xc86d('0x12')+_0x44f4fa+'.'+_0x118007)[_0xc86d('0x13')](_0x44f4fa+_0xc86d('0x3e'),_0x412dd7)[_0xc86d('0x13')](_0xc86d('0x3f'),NOW)['where'](_0xc86d('0x40'),selectNotIn(_0x44f4fa,_0x3fa1dd,_0x118007,'cm_hopper',[_0xc86d('0x41'),_0xc86d('0x42')]))[_0xc86d('0x13')](_0xc86d('0x40'),selectNotIn(_0x44f4fa,_0x3fa1dd,_0x118007,'cm_hopper',['\x22always\x22'])))['toString']();}function insertCmHopperBlack(_0x9841ff,_0x1a583b,_0x172f7b,_0x2c3f3d){var _0x549023=[_0xc86d('0x43'),_0xc86d('0x2c'),_0xc86d('0x2d'),_0x1a583b+'.'+_0x2c3f3d,_0xc86d('0x2e'),_0xc86d('0x2f')];return squel['insert']()[_0xc86d('0x33')](_0xc86d('0x44'))[_0xc86d('0x45')]([_0xc86d('0xf'),'ContactId',_0xc86d('0x36'),_0x2c3f3d,'createdAt','updatedAt'],squel[_0xc86d('0xd')]()['fields'](_0x549023)[_0xc86d('0x10')](_0x1a583b)[_0xc86d('0x11')](_0xc86d('0x3c'),null,_0xc86d('0x3d')+_0x1a583b+'.CmListId')[_0xc86d('0x11')](_0x172f7b,null,_0x172f7b+_0xc86d('0x12')+_0x1a583b+'.'+_0x2c3f3d)[_0xc86d('0x13')](_0x1a583b+'.CmListId\x20=\x20?',_0x9841ff)['where'](_0xc86d('0x3f'),NOW)['where'](_0xc86d('0x40'),squel[_0xc86d('0xd')]()[_0xc86d('0xe')]('phone')['from'](_0xc86d('0x44'))[_0xc86d('0x13')](_0xc86d('0x46'),_0x9841ff)['where'](_0x2c3f3d+_0xc86d('0x47'),_0x1a583b+'.'+_0x2c3f3d)))['toString']();}function insertCmHopperAdditionalPhones(_0x280298){var _0x2e9fc3=['cm_hopper.id',_0xc86d('0x48'),_0xc86d('0x49'),'cm_contact_has_items.createdAt',_0xc86d('0x4a')];return squel['insert']()[_0xc86d('0x33')](_0xc86d('0x4b'))[_0xc86d('0x45')](['CmHopperId','phone',_0xc86d('0x4c'),_0xc86d('0x37'),_0xc86d('0x4d')],squel[_0xc86d('0xd')]()['fields'](_0x2e9fc3)[_0xc86d('0x10')](_0xc86d('0x34'))[_0xc86d('0x11')](_0xc86d('0x3c'),null,_0xc86d('0x4e'))[_0xc86d('0x11')]('cm_contact_has_items',null,_0xc86d('0x4f'))[_0xc86d('0x13')](_0xc86d('0x50'),_0x280298)[_0xc86d('0x13')](_0xc86d('0x3f'),NOW))[_0xc86d('0x51')]();}function insertCmContact(_0x1c9b8a,_0x19ada6,_0x5b6fdb,_0x4f57f7){var _0x345c35=_['concat'](_[_0xc86d('0x52')](_0x4f57f7),[_0xc86d('0x36'),'CompanyId',_0xc86d('0x37'),_0xc86d('0x4d')]);return squel[_0xc86d('0x32')]()[_0xc86d('0x33')](_0xc86d('0x3c'))[_0xc86d('0x45')](_0x345c35,squel[_0xc86d('0xd')]()[_0xc86d('0x3b')](_0x345c35)['from'](_0x19ada6)[_0xc86d('0x13')]('('+_0x5b6fdb[_0xc86d('0x11')](',')+_0xc86d('0x53'),squel[_0xc86d('0xd')]()['fields'](_0x5b6fdb)[_0xc86d('0x10')]('cm_contacts')[_0xc86d('0x13')](_0xc86d('0x46'),_0x1c9b8a))[_0xc86d('0x13')]('id\x20IN\x20?',squel[_0xc86d('0xd')]()[_0xc86d('0xe')](_0xc86d('0x54'),_0xc86d('0x55'))['from'](_0x19ada6)['group'](_0x5b6fdb[_0xc86d('0x11')](','))))['toString']();}function handleStop(){logger[_0xc86d('0x56')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x41b5ce){logger[_0xc86d('0x1f')](_0x41b5ce[_0xc86d('0x20')]);process['exit'](0x1);}function handleError(_0x48895c,_0x4f0d12){stats[_0xc86d('0x57')][_0xc86d('0x22')]({'name':_0x4f0d12[_0xc86d('0x58')],'message':_0x4f0d12[_0xc86d('0x20')],'row':_0x48895c});}function handleQuery(_0x7a5d0c){logger[_0xc86d('0x56')](_0x7a5d0c);return db['sequelize']['query'](_0x7a5d0c)[_0xc86d('0x59')](function(_0x6f90f0){results[_0xc86d('0x22')](_0x6f90f0);})[_0xc86d('0x1e')](function(_0x379b99){logger[_0xc86d('0x1f')](_0x379b99[_0xc86d('0x20')]);});}function main(_0xb8425b,_0x4719bc,_0x4be771,_0x17ef2a){logger[_0xc86d('0x56')]('main',_0xb8425b,JSON['stringify'](_0x4719bc));process['send'](_0xc86d('0x5a'));var _0x1d92d8=_0x4719bc[_0xc86d('0x5b')];var _0x1c96ca=_[_0xc86d('0x5c')](_0x1d92d8);var _0x2ce87b=_0x4719bc[_0xc86d('0x5d')];var _0xf99be1=path['join'](config[_0xc86d('0x5e')],'server/files/tmp',_0x2ce87b+_0xc86d('0x5f'));logger[_0xc86d('0x56')](_0xc86d('0x60'),_0x4719bc);db[_0xc86d('0x61')][_0xc86d('0x62')]({'raw':!![],'attributes':['id',_0xc86d('0x63')]})[_0xc86d('0x1d')](function(_0x28e54c){for(var _0x475ff8=0x0;_0x475ff8<_0x28e54c[_0xc86d('0x19')];_0x475ff8++){if(_0x28e54c[_0x475ff8][_0xc86d('0x63')]in _0x1d92d8){contactItemTypes[_0xc86d('0x22')](_0x28e54c[_0x475ff8]);delete _0x1c96ca[_0x28e54c[_0x475ff8]['name']];hasAdditionalPhones=!![];}for(var _0x25e122 in _0x1d92d8){if(_0x28e54c[_0x475ff8][_0xc86d('0x63')]+_0xc86d('0x64')===_0x25e122){phoneDescriptions[_0xc86d('0x22')]({'itemTypeId':_0x28e54c[_0x475ff8]['id'],'description':_0x25e122});delete _0x1c96ca[_0x25e122];}}}if(hasAdditionalPhones)_0x1c96ca[_0xc86d('0x1b')]='';var _0x34741d=_['keys'](_0x1c96ca)['join']();logger[_0xc86d('0x56')](_0xc86d('0x65'),_0x34741d);fs[_0xc86d('0x66')](_0xf99be1,_0x34741d+'\x0a');Papa['parse'](fs[_0xc86d('0x67')](_0xb8425b),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2172c3,_0x542d27){try{for(var _0x5005a4=0x0,_0x129ba9=[];_0x5005a4<_0x2172c3[_0xc86d('0x68')][_0xc86d('0x19')];_0x5005a4++){stats[_0xc86d('0x69')]+=0x1;if(_0x2172c3[_0xc86d('0x57')][_0x5005a4]){handleError(_0x2172c3[_0xc86d('0x68')][_0x5005a4],_0x2172c3[_0xc86d('0x57')][_0x5005a4]);}else{var _0x3cd23d=[];var _0x1b5ea7=[];var _0xd550a3={};for(var _0x34b080 in _0x1d92d8){let _0x296736=contactItemTypes[_0xc86d('0x6a')](_0x160cb1=>_0x160cb1[_0xc86d('0x63')]===_0x34b080);let _0x21babf=contactItemTypes[_0xc86d('0x6a')](_0x32149b=>_0x32149b['name']+_0xc86d('0x64')===_0x34b080);if(_[_0xc86d('0x1a')](_0x296736)&&_['isNil'](_0x21babf)){if(_0x1d92d8['hasOwnProperty'](_0x34b080)){if(_0x2172c3[_0xc86d('0x68')][_0x5005a4][_0x1d92d8[_0x34b080]]){var _0xce0099=_[_0xc86d('0x6b')](_0x2172c3[_0xc86d('0x68')][_0x5005a4][_0x1d92d8[_0x34b080]][_0xc86d('0x6c')](/"/g,'\x27'));switch(_0x34b080){case'scheduledat':var _0x2b3fd3=moment(_0xce0099,_0xc86d('0xb'),!![]);if(_0x2b3fd3[_0xc86d('0x6d')]()){_0x129ba9[_0xc86d('0x22')]('\x22'+_0xce0099+'\x22');}else{_0x3cd23d[_0xc86d('0x22')](_0xc86d('0x6e'));}break;case _0xc86d('0x38'):var _0x526e22=parseInt(_0xce0099);_0xce0099=_[_0xc86d('0x6f')](_0x526e22)||_0x526e22<0x0||_0x526e22>0x4?_0x17ef2a?0x3:0x2:_0x526e22;_0x129ba9[_0xc86d('0x22')]('\x22'+_0xce0099+'\x22');break;case _0xc86d('0x39'):var _0x48224e=parseInt(_0xce0099);if(_[_0xc86d('0x70')](_0x48224e)&&_[_0xc86d('0x71')](_0x4be771,_0x48224e)){_0x129ba9[_0xc86d('0x22')]('\x22'+_0x48224e+'\x22');}else{_0x3cd23d[_0xc86d('0x22')](_0xc86d('0x72'));}break;case _0xc86d('0x73'):if(isEmail(_0xce0099)){_0x129ba9[_0xc86d('0x22')]('\x22'+_0xce0099+'\x22');}else{_0x3cd23d[_0xc86d('0x22')](_0xc86d('0x74'));}break;case _0xc86d('0x75'):var _0x13c6a5=moment(_0xce0099,_0xc86d('0x76'),!![]);if(_0x13c6a5[_0xc86d('0x6d')]()){_0x129ba9[_0xc86d('0x22')]('\x22'+_0xce0099+'\x22');}else{_0x3cd23d[_0xc86d('0x22')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x129ba9[_0xc86d('0x22')]('\x22'+_0xce0099+'\x22');}}else{switch(_0x34b080){case _0xc86d('0x77'):case _0xc86d('0xf'):_0x3cd23d['push'](_0x34b080+_0xc86d('0x78'));break;default:_0x129ba9[_0xc86d('0x22')]('\x22\x22');}}}}else{var _0xee93da='';if(!_[_0xc86d('0x1a')](_0x296736)){if(!_0xd550a3[_0xc86d('0x79')](_0x296736['id'])){for(var _0x90a73f=0x0;_0x90a73f<_0x1d92d8[_0x34b080]['length'];_0x90a73f++){var _0xce0099=_[_0xc86d('0x6b')](_0x2172c3['data'][_0x5005a4][_0x1d92d8[_0x34b080][_0x90a73f]][_0xc86d('0x6c')](/"/g,'\x27'));var _0x1cb58c=phoneDescriptions[_0xc86d('0x6a')](_0x5a34c5=>_0x5a34c5[_0xc86d('0x7a')]===_0x296736['id']);if(!_[_0xc86d('0x1a')](_0x1cb58c)){var _0x306e0a=_[_0xc86d('0x6b')](_0x2172c3[_0xc86d('0x68')][_0x5005a4][_0x1d92d8[_0x1cb58c['description']][0x0]]['replace'](/"/g,'\x27'));if(!_[_0xc86d('0x1a')](_0x306e0a))_0xce0099=_0xce0099+'§'+_0x306e0a;}if(_0xee93da=='')_0xee93da=_0xce0099;else _0xee93da+='|'+_0xce0099;}_0x1b5ea7['push'](_0x296736['id']+':'+_0xee93da);_0xd550a3[_0x296736['id']]=0x1;}}}}if(hasAdditionalPhones){_0x129ba9['push']('\x22'+_0x1b5ea7[_0xc86d('0x11')](';')+'\x22');}if(_0x3cd23d['length']){handleError(_0x2172c3[_0xc86d('0x68')][_0x5005a4],{'code':_0xc86d('0x7b'),'message':_0x3cd23d[_0xc86d('0x11')]()});}else{fs[_0xc86d('0x7c')](_0xf99be1,_0x129ba9[_0xc86d('0x11')]()+'\x0a');}_0x129ba9=[];}if(!(stats[_0xc86d('0x69')]%0xc8)){socket[_0xc86d('0x7d')](_0xc86d('0x7e')+_0x2ce87b,stats);stats[_0xc86d('0x57')]=[];}}if(stopped){logger[_0xc86d('0x56')](_0xc86d('0x7f'));_0x542d27[_0xc86d('0x80')]();}}catch(_0x44adc8){handleError(_0x2172c3['data'][_0x5005a4],{'code':_0xc86d('0x81'),'message':_0x44adc8[_0xc86d('0x20')]});logger['error']('step',_0x44adc8['message']);}},'complete':function(){try{var _0x2789ad=[];var _0x294128=tempTableName;_0x2789ad[_0xc86d('0x22')](_0xc86d('0x82')+_0x294128+_0xc86d('0x83'));logger[_0xc86d('0x56')](_0xc86d('0x84'),contactItemTypes['length']);var _0xeea1a8=util[_0xc86d('0xa')](_0xc86d('0x85'),_0xf99be1,_0x294128,_0x34741d,_0x4719bc['ListId'],_0x4719bc[_0xc86d('0x86')]||null,NOW,NOW);if(_[_0xc86d('0x1a')](_0x1d92d8['scheduledat'])){_0xeea1a8+=_0xc86d('0x87');}_0x2789ad[_0xc86d('0x22')](_0xeea1a8);BPromise['each'](_0x2789ad,handleQuery)[_0xc86d('0x1d')](function(_0x54998e){BPromise[_0xc86d('0x1c')]([handleAdditionalPhones()])[_0xc86d('0x1d')](function(){_0x2789ad=[];for(var _0x449c2f=0x0;_0x449c2f\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','papaparse','bluebird','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','cm_contacts_temp_'];(function(_0x38ea3f,_0x10f0ee){var _0x5297e1=function(_0x3f3069){while(--_0x3f3069){_0x38ea3f['push'](_0x38ea3f['shift']());}};_0x5297e1(++_0x10f0ee);}(_0xc54c,0x1c2));var _0xcc54=function(_0x587ba2,_0x42eb40){_0x587ba2=_0x587ba2-0x0;var _0x50ec73=_0xc54c[_0x587ba2];return _0x50ec73;};'use strict';var fs=require('fs');var path=require(_0xcc54('0x0'));var _=require('lodash');var Papa=require(_0xcc54('0x1'));var util=require('util');var BPromise=require(_0xcc54('0x2'));var moment=require('moment');var squel=require(_0xcc54('0x3'));var Redis=require(_0xcc54('0x4'));var db=require(_0xcc54('0x5'))['db'];var config=require(_0xcc54('0x6'));var logger=require('../../../config/logger')(_0xcc54('0x7'));config[_0xcc54('0x8')]=_[_0xcc54('0x9')](config['redis'],{'host':_0xcc54('0xa'),'port':0x18eb});var socket=require(_0xcc54('0xb'))(new Redis(config[_0xcc54('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var promisesAdditionalPhones=[];var promisesContact=[];var orderBy=0x0;var updatedRows=0x0;var stopped=![];var NOW=moment()[_0xcc54('0xc')](_0xcc54('0xd'));var tempTableName=_0xcc54('0xe')+moment()['format'](_0xcc54('0xf'));var contactItemTypes=[];var phoneDescriptions=[];var hasAdditionalPhones=![];function isEmail(_0x1f87ce){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))*$/[_0xcc54('0x10')](_0x1f87ce);}function selectNotIn(_0x1973af,_0x589e88,_0xc26530,_0x39a5d3,_0x127f2d){return squel['select']()[_0xcc54('0x11')](_0xcc54('0x12'))[_0xcc54('0x13')](_0x39a5d3)[_0xcc54('0x14')](_0x589e88,null,_0x589e88+_0xcc54('0x15')+_0x39a5d3+'.'+_0xc26530)['where'](_0x39a5d3+'.'+_0xc26530+_0xcc54('0x16')+_0x1973af+'.'+_0xc26530)[_0xcc54('0x17')](_0x589e88+_0xcc54('0x18')+_0x127f2d['join']()+')');}function handleAdditionalPhones(){return new Promise(function(_0x57c26f,_0x3d380e){promisesAdditionalPhones=[];promisesContact=[];return db[_0xcc54('0x19')][_0xcc54('0x1a')](_0xcc54('0x1b')+tempTableName)[_0xcc54('0x1c')](function(_0x26feb8){if(_0x26feb8!==null){var _0x56e015=[];for(var _0x8f0098=0x0;_0x8f0098<_0x26feb8[_0xcc54('0x1d')];_0x8f0098++){var _0x537388=_0x26feb8[_0x8f0098];if(!_[_0xcc54('0x1e')](_0x537388['phone'])){if(!_[_0xcc54('0x1e')](_0x537388[_0xcc54('0x1f')]))_0x56e015[_0xcc54('0x20')](insertAdditionalPhones(_0x537388));promisesContact[_0xcc54('0x20')]({'contact':_0x537388});}}}Promise[_0xcc54('0x21')](_0x56e015)[_0xcc54('0x22')](function(){_0x57c26f({'val':0x1});});})['catch'](function(_0x5d6675){logger[_0xcc54('0x23')](_0x5d6675[_0xcc54('0x24')]);});});}function insertAdditionalPhones(_0xc6ac9e){return new Promise(function(_0x3b9df1,_0x4ed9f4){var _0x287310=_0xc6ac9e[_0xcc54('0x1f')];if(_[_0xcc54('0x1e')](_0x287310))_0x4ed9f4({'val':0x0});else{var _0x360b8a=_0x287310[_0xcc54('0x25')](';');var _0x108e63=[];orderBy=0x0;for(var _0x5b2c94=0x0;_0x5b2c94<_0x360b8a[_0xcc54('0x1d')];_0x5b2c94++){_0x108e63[_0xcc54('0x20')](splitAdditionalPhone(_0xc6ac9e['id'],_0x360b8a[_0x5b2c94]));}Promise[_0xcc54('0x21')](_0x108e63)[_0xcc54('0x22')](function(){_0x3b9df1({'val':_0x360b8a[_0xcc54('0x1d')]});});}});}function splitAdditionalPhone(_0x13be64,_0x3e5787){return new Promise(function(_0x43f9e3,_0x3ec10f){var _0x4ee369=_0x3e5787[_0xcc54('0x25')](':');var _0x1811e5=_0x4ee369[0x0];var _0x2a7270=_0x4ee369[0x1];if(_0x2a7270!==''){var _0xf2d040=_0x2a7270[_0xcc54('0x25')]('|');var _0x45fa24=[];for(var _0xffe9d2=0x0;_0xffe9d2<_0xf2d040[_0xcc54('0x1d')];_0xffe9d2++){if(_0xf2d040[_0xffe9d2]!==''){var _0x435591=_['filter'](promisesAdditionalPhones,{'contactId':_0x13be64,'phone':_0xf2d040[_0xffe9d2]});if(_0x435591[_0xcc54('0x1d')]==0x0){orderBy++;promisesAdditionalPhones[_0xcc54('0x20')]({'contactId':_0x13be64,'contactTypeId':_0x1811e5,'phone':_0xf2d040[_0xffe9d2],'orderBy':orderBy});}}}_0x43f9e3({'ok':0x1});}else _0x43f9e3({'res':0x0});});}function createAdditionalPhone(_0x12c6fe,_0x1e389a,_0x3757a2,_0x3ad280){var _0x11fb81='';var _0x361af6='';var _0xec6ccd=_0x3757a2[_0xcc54('0x25')]('§');_0x11fb81=_0xec6ccd[0x0];if(_0xec6ccd['length']==0x2)_0x361af6=_0xec6ccd[0x1];return new Promise(function(_0x5b67f7,_0x202971){return db['CmContactHasItem'][_0xcc54('0x26')]({'where':{'CmContactId':_0x12c6fe,'item':_0x11fb81}})['then'](function(_0x5e19e3){if(_0x5e19e3){return db[_0xcc54('0x27')][_0xcc54('0x28')]({'ItemTypeId':_0x1e389a,'description':_0x361af6,'OrderBy':_0x3ad280},{'where':{'CmContactId':_0x12c6fe,'item':_0x11fb81}})[_0xcc54('0x22')](function(_0x2207e5){_0x5b67f7({'res':_0xcc54('0x29')});});}else{return db[_0xcc54('0x27')][_0xcc54('0x2a')]({'CmContactId':_0x12c6fe,'item':_0x11fb81,'ItemTypeId':_0x1e389a,'description':_0x361af6,'OrderBy':_0x3ad280,'ItemClass':_0xcc54('0x2b')})[_0xcc54('0x22')](function(_0x2e5d1a){_0x5b67f7({'res':_0xcc54('0x2c')});});}});});}function updateContact(_0x1fd37b){return new Promise(function(_0x17a0e5,_0x4c5234){var _0x287506=_0x1fd37b['id'];delete _0x1fd37b['id'];return db['CmContact'][_0xcc54('0x28')](_0x1fd37b,{'where':{'id':_0x287506}})[_0xcc54('0x22')](function(_0x543f32){updatedRows+=0x1;return db[_0xcc54('0x2d')][_0xcc54('0x28')]({'phone':_0x1fd37b[_0xcc54('0x12')]},{'where':{'ContactId':_0x287506}})[_0xcc54('0x22')](function(_0x31c7cc){_0x17a0e5({'ret':'OK'});});});});}function insertCmHopper(_0x2e9de9,_0x1f9c7c,_0x964a,_0x58380a,_0x23dd55){var _0x47c3e=[_0xcc54('0x2e'),'cm_contacts.scheduledat',_0xcc54('0x2f'),_0xcc54('0x30'),_0x1f9c7c+'.'+_0x58380a,_0xcc54('0x31'),_0xcc54('0x32'),_0xcc54('0x33'),_0xcc54('0x34'),'\x22'+_0x23dd55+'\x22'];return squel[_0xcc54('0x35')]()[_0xcc54('0x36')]('cm_hopper')['fromQuery'](['phone',_0xcc54('0x37'),_0xcc54('0x38'),_0xcc54('0x39'),_0x58380a,'createdAt','updatedAt','priority',_0xcc54('0x3a'),_0xcc54('0x3b')],squel[_0xcc54('0x3c')]()[_0xcc54('0x3d')](_0x47c3e)[_0xcc54('0x13')](_0x1f9c7c)[_0xcc54('0x14')](_0xcc54('0x3e'),null,_0xcc54('0x3f')+_0x1f9c7c+_0xcc54('0x40'))[_0xcc54('0x14')](_0x964a,null,_0x964a+'.id\x20=\x20'+_0x1f9c7c+'.'+_0x58380a)['where'](_0x1f9c7c+_0xcc54('0x41'),_0x2e9de9)[_0xcc54('0x17')](_0xcc54('0x42'),NOW)[_0xcc54('0x17')](_0xcc54('0x43'),selectNotIn(_0x1f9c7c,_0x964a,_0x58380a,_0xcc54('0x44'),[_0xcc54('0x45'),_0xcc54('0x46')]))[_0xcc54('0x17')](_0xcc54('0x43'),selectNotIn(_0x1f9c7c,_0x964a,_0x58380a,_0xcc54('0x44'),[_0xcc54('0x45')])))[_0xcc54('0x47')]();}function insertCmHopperBlack(_0x31715a,_0x5d38d8,_0x588af3,_0x50f595){var _0x38d502=[_0xcc54('0x2e'),_0xcc54('0x2f'),'cm_contacts.ListId',_0x5d38d8+'.'+_0x50f595,_0xcc54('0x31'),_0xcc54('0x32')];return squel[_0xcc54('0x35')]()[_0xcc54('0x36')](_0xcc54('0x48'))[_0xcc54('0x49')](['phone',_0xcc54('0x38'),_0xcc54('0x39'),_0x50f595,_0xcc54('0x4a'),'updatedAt'],squel[_0xcc54('0x3c')]()[_0xcc54('0x3d')](_0x38d502)[_0xcc54('0x13')](_0x5d38d8)['join']('cm_contacts',null,'cm_contacts.ListId\x20=\x20'+_0x5d38d8+_0xcc54('0x40'))[_0xcc54('0x14')](_0x588af3,null,_0x588af3+_0xcc54('0x15')+_0x5d38d8+'.'+_0x50f595)[_0xcc54('0x17')](_0x5d38d8+'.CmListId\x20=\x20?',_0x31715a)[_0xcc54('0x17')](_0xcc54('0x42'),NOW)[_0xcc54('0x17')](_0xcc54('0x43'),squel[_0xcc54('0x3c')]()[_0xcc54('0x11')](_0xcc54('0x12'))[_0xcc54('0x13')](_0xcc54('0x48'))[_0xcc54('0x17')]('ListId\x20=\x20?',_0x31715a)['where'](_0x50f595+_0xcc54('0x4b'),_0x5d38d8+'.'+_0x50f595)))[_0xcc54('0x47')]();}function insertCmHopperAdditionalPhones(_0x2affae){var _0x3ea5a9=[_0xcc54('0x4c'),_0xcc54('0x4d'),'cm_contact_has_items.OrderBy',_0xcc54('0x4e'),'cm_contact_has_items.updatedAt'];return squel['insert']()[_0xcc54('0x36')]('cm_hopper_additional_phones')[_0xcc54('0x49')](['CmHopperId',_0xcc54('0x12'),'OrderBy','createdAt',_0xcc54('0x4f')],squel[_0xcc54('0x3c')]()[_0xcc54('0x3d')](_0x3ea5a9)[_0xcc54('0x13')](_0xcc54('0x44'))[_0xcc54('0x14')](_0xcc54('0x3e'),null,_0xcc54('0x50'))[_0xcc54('0x14')](_0xcc54('0x51'),null,_0xcc54('0x52'))[_0xcc54('0x17')]('cm_hopper.ListId\x20=\x20?',_0x2affae)[_0xcc54('0x17')](_0xcc54('0x42'),NOW))['toString']();}function insertCmContact(_0x1ebd09,_0x39759f,_0x465917,_0x1ca75d){var _0x54e71c=_['concat'](_['keys'](_0x1ca75d),[_0xcc54('0x39'),_0xcc54('0x53'),_0xcc54('0x4a'),_0xcc54('0x4f')]);return squel[_0xcc54('0x35')]()['into'](_0xcc54('0x3e'))['fromQuery'](_0x54e71c,squel[_0xcc54('0x3c')]()['fields'](_0x54e71c)[_0xcc54('0x13')](_0x39759f)['where']('('+_0x465917[_0xcc54('0x14')](',')+_0xcc54('0x54'),squel[_0xcc54('0x3c')]()[_0xcc54('0x3d')](_0x465917)[_0xcc54('0x13')](_0xcc54('0x3e'))[_0xcc54('0x17')](_0xcc54('0x55'),_0x1ebd09))[_0xcc54('0x17')]('id\x20IN\x20?',squel[_0xcc54('0x3c')]()[_0xcc54('0x11')]('MIN(id)','min_id')[_0xcc54('0x13')](_0x39759f)[_0xcc54('0x56')](_0x465917['join'](','))))[_0xcc54('0x47')]();}function handleStop(){logger[_0xcc54('0x57')](_0xcc54('0x58'));stopped=!![];}function handleUncaughtException(_0x1f8d44){logger['error'](_0x1f8d44['message']);process[_0xcc54('0x59')](0x1);}function handleError(_0x5d5eaa,_0x26f00a){stats[_0xcc54('0x5a')][_0xcc54('0x20')]({'name':_0x26f00a[_0xcc54('0x5b')],'message':_0x26f00a[_0xcc54('0x24')],'row':_0x5d5eaa});}function handleQuery(_0x1c1c2f){logger[_0xcc54('0x57')](_0x1c1c2f);return db[_0xcc54('0x19')][_0xcc54('0x1a')](_0x1c1c2f)['spread'](function(_0x3349b1){results[_0xcc54('0x20')](_0x3349b1);})[_0xcc54('0x5c')](function(_0x2c523e){logger['error'](_0x2c523e[_0xcc54('0x24')]);});}function main(_0x2c55f1,_0x4496b8,_0x48be00,_0x212ca9){logger[_0xcc54('0x57')](_0xcc54('0x5d'),_0x2c55f1,JSON[_0xcc54('0x5e')](_0x4496b8));process['send']('start');var _0x4c3d52=_0x4496b8[_0xcc54('0x5f')];var _0x1907b4=_[_0xcc54('0x60')](_0x4c3d52);var _0x344cd5=_0x4496b8[_0xcc54('0x61')];var _0xde29ea=path[_0xcc54('0x14')](config['root'],_0xcc54('0x62'),_0x344cd5+'.csv');logger['info'](_0xcc54('0x63'),_0x4496b8);db['ContactItemType'][_0xcc54('0x64')]({'raw':!![],'attributes':['id',_0xcc54('0x65')]})[_0xcc54('0x22')](function(_0x3c4436){for(var _0x4d7c6c=0x0;_0x4d7c6c<_0x3c4436[_0xcc54('0x1d')];_0x4d7c6c++){if(_0x3c4436[_0x4d7c6c][_0xcc54('0x65')]in _0x4c3d52){contactItemTypes['push'](_0x3c4436[_0x4d7c6c]);delete _0x1907b4[_0x3c4436[_0x4d7c6c][_0xcc54('0x65')]];hasAdditionalPhones=!![];}for(var _0x18b7cc in _0x4c3d52){if(_0x3c4436[_0x4d7c6c][_0xcc54('0x65')]+_0xcc54('0x66')===_0x18b7cc){phoneDescriptions[_0xcc54('0x20')]({'itemTypeId':_0x3c4436[_0x4d7c6c]['id'],'description':_0x18b7cc});delete _0x1907b4[_0x18b7cc];}}}if(hasAdditionalPhones)_0x1907b4['AdditionalPhones']='';var _0x87b7c1=_[_0xcc54('0x67')](_0x1907b4)[_0xcc54('0x14')]();logger[_0xcc54('0x57')]('header',_0x87b7c1);fs[_0xcc54('0x68')](_0xde29ea,_0x87b7c1+'\x0a');Papa[_0xcc54('0x69')](fs[_0xcc54('0x6a')](_0x2c55f1),{'header':!![],'skipEmptyLines':!![],'step':function(_0x75a516,_0x33b729){try{for(var _0x3d7ec8=0x0,_0x27e1bf=[];_0x3d7ec8<_0x75a516['data']['length'];_0x3d7ec8++){stats[_0xcc54('0x6b')]+=0x1;if(_0x75a516[_0xcc54('0x5a')][_0x3d7ec8]){handleError(_0x75a516['data'][_0x3d7ec8],_0x75a516[_0xcc54('0x5a')][_0x3d7ec8]);}else{var _0xddef2c=[];var _0x22eb82=[];var _0x3a9d22={};for(var _0x2936e0 in _0x4c3d52){let _0x155cca=contactItemTypes[_0xcc54('0x6c')](_0x54f3d5=>_0x54f3d5[_0xcc54('0x65')]===_0x2936e0);let _0xf96aa4=contactItemTypes['find'](_0x2a18cc=>_0x2a18cc[_0xcc54('0x65')]+_0xcc54('0x66')===_0x2936e0);if(_[_0xcc54('0x1e')](_0x155cca)&&_[_0xcc54('0x1e')](_0xf96aa4)){if(_0x4c3d52[_0xcc54('0x6d')](_0x2936e0)){if(_0x75a516[_0xcc54('0x6e')][_0x3d7ec8][_0x4c3d52[_0x2936e0]]){var _0x1e34ef=_[_0xcc54('0x6f')](_0x75a516[_0xcc54('0x6e')][_0x3d7ec8][_0x4c3d52[_0x2936e0]][_0xcc54('0x70')](/"/g,'\x27'));switch(_0x2936e0){case'scheduledat':var _0x7dcad9=moment(_0x1e34ef,_0xcc54('0xd'),!![]);if(_0x7dcad9[_0xcc54('0x71')]()){_0x27e1bf['push']('\x22'+_0x1e34ef+'\x22');}else{_0xddef2c[_0xcc54('0x20')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xcc54('0x72'):var _0x57ae11=parseInt(_0x1e34ef);_0x1e34ef=_[_0xcc54('0x73')](_0x57ae11)||_0x57ae11<0x0||_0x57ae11>0x4?_0x212ca9?0x3:0x2:_0x57ae11;_0x27e1bf['push']('\x22'+_0x1e34ef+'\x22');break;case'UserId':var _0x5a5cad=parseInt(_0x1e34ef);if(_[_0xcc54('0x74')](_0x5a5cad)&&_[_0xcc54('0x75')](_0x48be00,_0x5a5cad)){_0x27e1bf[_0xcc54('0x20')]('\x22'+_0x5a5cad+'\x22');}else{_0xddef2c[_0xcc54('0x20')]('agent\x20not\x20exists');}break;case _0xcc54('0x76'):if(isEmail(_0x1e34ef)){_0x27e1bf[_0xcc54('0x20')]('\x22'+_0x1e34ef+'\x22');}else{_0xddef2c[_0xcc54('0x20')](_0xcc54('0x77'));}break;case _0xcc54('0x78'):var _0x292346=moment(_0x1e34ef,_0xcc54('0x79'),!![]);if(_0x292346[_0xcc54('0x71')]()){_0x27e1bf['push']('\x22'+_0x1e34ef+'\x22');}else{_0xddef2c[_0xcc54('0x20')](_0xcc54('0x7a'));}break;default:_0x27e1bf[_0xcc54('0x20')]('\x22'+_0x1e34ef+'\x22');}}else{switch(_0x2936e0){case _0xcc54('0x7b'):case _0xcc54('0x12'):_0xddef2c[_0xcc54('0x20')](_0x2936e0+_0xcc54('0x7c'));break;default:_0x27e1bf['push']('\x22\x22');}}}}else{var _0xa800db='';if(!_[_0xcc54('0x1e')](_0x155cca)){if(!_0x3a9d22[_0xcc54('0x6d')](_0x155cca['id'])){for(var _0xd0f8de=0x0;_0xd0f8de<_0x4c3d52[_0x2936e0][_0xcc54('0x1d')];_0xd0f8de++){var _0x1e34ef=_[_0xcc54('0x6f')](_0x75a516[_0xcc54('0x6e')][_0x3d7ec8][_0x4c3d52[_0x2936e0][_0xd0f8de]][_0xcc54('0x70')](/"/g,'\x27'));var _0x2bec35=phoneDescriptions[_0xcc54('0x6c')](_0x166aa0=>_0x166aa0[_0xcc54('0x7d')]===_0x155cca['id']);if(!_[_0xcc54('0x1e')](_0x2bec35)){var _0xe7570e=_[_0xcc54('0x6f')](_0x75a516[_0xcc54('0x6e')][_0x3d7ec8][_0x4c3d52[_0x2bec35['description']][0x0]][_0xcc54('0x70')](/"/g,'\x27'));if(!_[_0xcc54('0x1e')](_0xe7570e))_0x1e34ef=_0x1e34ef+'§'+_0xe7570e;}if(_0xa800db=='')_0xa800db=_0x1e34ef;else _0xa800db+='|'+_0x1e34ef;}_0x22eb82[_0xcc54('0x20')](_0x155cca['id']+':'+_0xa800db);_0x3a9d22[_0x155cca['id']]=0x1;}}}}if(hasAdditionalPhones){_0x27e1bf[_0xcc54('0x20')]('\x22'+_0x22eb82['join'](';')+'\x22');}if(_0xddef2c[_0xcc54('0x1d')]){handleError(_0x75a516[_0xcc54('0x6e')][_0x3d7ec8],{'code':_0xcc54('0x7e'),'message':_0xddef2c[_0xcc54('0x14')]()});}else{fs[_0xcc54('0x7f')](_0xde29ea,_0x27e1bf[_0xcc54('0x14')]()+'\x0a');}_0x27e1bf=[];}if(!(stats[_0xcc54('0x6b')]%0xc8)){socket[_0xcc54('0x80')]('contact:import:'+_0x344cd5,stats);stats[_0xcc54('0x5a')]=[];}}if(stopped){logger[_0xcc54('0x57')]('Abort\x20parser');_0x33b729[_0xcc54('0x81')]();}}catch(_0x4187ff){handleError(_0x75a516[_0xcc54('0x6e')][_0x3d7ec8],{'code':_0xcc54('0x82'),'message':_0x4187ff[_0xcc54('0x24')]});logger['error']('step',_0x4187ff[_0xcc54('0x24')]);}},'complete':function(){try{var _0x43de85=[];var _0x45551b=tempTableName;_0x43de85[_0xcc54('0x20')](_0xcc54('0x83')+_0x45551b+_0xcc54('0x84'));logger[_0xcc54('0x57')](_0xcc54('0x85'),contactItemTypes[_0xcc54('0x1d')]);var _0x3fe6c1=util[_0xcc54('0xc')](_0xcc54('0x86'),_0xde29ea,_0x45551b,_0x87b7c1,_0x4496b8['ListId'],_0x4496b8[_0xcc54('0x53')]||null,NOW,NOW);if(_['isNil'](_0x4c3d52[_0xcc54('0x37')])){_0x3fe6c1+=',\x20scheduledAt\x20=\x20NOW()';}_0x43de85[_0xcc54('0x20')](_0x3fe6c1);BPromise['each'](_0x43de85,handleQuery)[_0xcc54('0x22')](function(_0x106ab8){BPromise[_0xcc54('0x21')]([handleAdditionalPhones()])[_0xcc54('0x22')](function(){_0x43de85=[];for(var _0x56455=0x0;_0x56455\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','Setting','enableEmailPreview','clone','COUNT(*)'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0x153f,0x15b));var _0xf153=function(_0x4cef9c,_0x19508f){_0x4cef9c=_0x4cef9c-0x0;var _0x52d2cf=_0x153f[_0x4cef9c];return _0x52d2cf;};'use strict';var _=require(_0xf153('0x0'));var squel=require(_0xf153('0x1'));var as=require(_0xf153('0x2'));var qs=require(_0xf153('0x3'));var updateInteraction=require(_0xf153('0x4'))[_0xf153('0x5')];var utils=require(_0xf153('0x6'));var db=require('../../mysqldb')['db'];function skipInteractionsQuery(_0x364e65,_0x5c49c7,_0x1f9ead){var _0x2fcb1a=![];var _0x342a45=utils[_0xf153('0x7')](_0x364e65);if(_0x5c49c7[_0xf153('0x8')]==='agent'&&!_0x1f9ead[_0xf153('0x9')]&&!_0x1f9ead[_0x342a45]){_0x2fcb1a=!![];}return _0x2fcb1a;}function getTagsQuery(){return squel[_0xf153('0xa')]()[_0xf153('0xb')]('id')[_0xf153('0xb')](_0xf153('0xc'))[_0xf153('0xb')](_0xf153('0xd'))[_0xf153('0xe')](_0xf153('0xf'));}function getUsersQuery(_0xeaccb0,_0x5c8ae9){var _0x2b76eb=utils[_0xf153('0x10')](_0xeaccb0);var _0x2bea70='user_has_'+_0xeaccb0+_0xf153('0x11');var _0x292f89=squel[_0xf153('0xa')]()[_0xf153('0xb')](_0xf153('0x12'))[_0xf153('0xb')](_0xf153('0x13'))[_0xf153('0xb')](_0xf153('0x14')+_0x2b76eb)['from'](_0x2bea70,'ui')[_0xf153('0x15')](_0xf153('0x16'),'u',_0xf153('0x17'));if(_0x5c8ae9[_0xf153('0x18')]>0x0){_0x292f89[_0xf153('0x19')](_0xf153('0x14')+_0x2b76eb+_0xf153('0x1a'),_[_0xf153('0x1b')](_0x5c8ae9,'id'));}return _0x292f89;}function getInteractionsQuery(_0x47fbfe){var _0x35f4e8=utils['getInteractionsTables'](_0x47fbfe);var _0x37093a=utils[_0xf153('0x7')](_0x47fbfe);var _0x138dbe=utils[_0xf153('0x10')](_0x47fbfe);return squel['select']()[_0xf153('0xe')](_0x35f4e8[_0xf153('0x1c')],'i')[_0xf153('0x15')](_0xf153('0x1d'),'c',_0xf153('0x1e'))[_0xf153('0x15')](_0xf153('0x16'),'o',_0xf153('0x1f'))[_0xf153('0x15')](_0x35f4e8[_0xf153('0x20')],'a',_0xf153('0x21')+_0x37093a)[_0xf153('0x15')](_0x35f4e8['messages'],'me',_0xf153('0x22')+_0x138dbe+_0xf153('0x23'))[_0xf153('0x15')](_0x35f4e8[_0xf153('0x24')],'it',_0xf153('0x25')+_0x138dbe+_0xf153('0x23'))[_0xf153('0x15')](_0xf153('0xf'),'t',_0xf153('0x26'));}function getSqlClauses(){var _0x38190c={'body':squel[_0xf153('0x27')](),'contact':squel[_0xf153('0x27')](),'default':squel[_0xf153('0x27')](),'fields':squel[_0xf153('0x27')](),'filter':squel[_0xf153('0x27')](),'read':squel[_0xf153('0x27')](),'tags':{'clause':squel[_0xf153('0x27')](),'ids':null},'user':squel[_0xf153('0x27')]()};return _0x38190c;}function parseTagParameter(_0x23acc3){var _0x17f7a4=squel['expr']();if(_0x23acc3){var _0x6d62ef=utils[_0xf153('0x28')](_0x23acc3);_0x6d62ef['forEach'](function(_0x16cdcd){_0x17f7a4['or'](_0xf153('0x29'),'%,'+_0x16cdcd+',%');});}return _0x17f7a4;}function parseReadParameter(_0x4e45f9){var _0x17305d='';if(_0x4e45f9){_0x17305d=_0xf153('0x2a');if(_0x4e45f9==='1'){_0x17305d=_0x17305d[_0xf153('0x2b')](_0xf153('0x2c'),'=');}else{_0x17305d=_0x17305d[_0xf153('0x2b')](_0xf153('0x2c'),'>');}}return _0x17305d;}function parseSearchFilter(_0x441436,_0x3b5f4f){var _0x19a568=squel[_0xf153('0x27')]();if(_0x3b5f4f){var _0x13b541=_0x3b5f4f[_0xf153('0x2b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xf153('0x2d')](_0x13b541)){_0x19a568['or'](_0xf153('0x2e'),_0x13b541+'%');if([_0xf153('0x2f'),_0xf153('0x30')]['includes'](_0x441436)){_0x19a568['or']('i.phone\x20LIKE\x20?',_0x13b541+'%');}else if(_0x441436===_0xf153('0x31')){_0x19a568['or']('i.fax\x20LIKE\x20?',_0x13b541+'%');}else if(_0x441436==='openchannel'){_0x19a568['or'](_0xf153('0x32'),_0x13b541+'%');}}else if(_0x441436==='mail'&&qs[_0xf153('0x33')](_0x13b541)){_0x19a568['or']('c.email\x20LIKE\x20?',_0x13b541+'%');}else{if(_0x441436===_0xf153('0x34')){_0x19a568['or'](_0xf153('0x35'),qs['getFullTextValue'](_0x13b541))['or'](_0xf153('0x36'),qs[_0xf153('0x37')](_0x13b541));}else{if(_0x441436!==_0xf153('0x31')){_0x19a568['or'](_0xf153('0x38'),qs[_0xf153('0x37')](_0x13b541));}_0x19a568['or'](_0xf153('0x39'),_0x13b541+'%');}}}return _0x19a568;}function parseAdvancedSearchFilter(_0x4ab69c,_0x23c293){var _0x5c333b=getSqlClauses();var _0x40834b=as[_0xf153('0x3a')](_0x4ab69c);var _0x9b3f4c=_0x40834b[_0xf153('0x3b')];for(var _0x274bcc=0x0;_0x274bcc<_0x40834b[_0xf153('0x3c')]['length'];_0x274bcc++){var _0x1b4bc1=_0x40834b[_0xf153('0x3c')][_0x274bcc];var _0x332809='i';var _0x4e0634=_[_0xf153('0x3d')](_0x23c293,[_0xf153('0xc'),_0x1b4bc1[_0xf153('0xb')]]);if(_0x4e0634){var _0x254692=as[_0xf153('0x3e')](_0x332809,_0x4e0634[_0xf153('0x3f')],_0x1b4bc1);_0x5c333b['default'][_0x9b3f4c](_0x254692[_0xf153('0x40')],_0x254692[_0xf153('0x41')]['start'],_0x254692[_0xf153('0x41')][_0xf153('0x42')]);}else{switch(_0x1b4bc1[_0xf153('0xb')]){case _0xf153('0x43'):var _0x103b91=parseReadParameter(_0x1b4bc1[_0xf153('0x41')]);_0x5c333b[_0xf153('0x44')]['and'](_0x103b91);break;case _0xf153('0x45'):if(_0x1b4bc1[_0xf153('0x46')]===_0xf153('0x47')){if(_0x1b4bc1[_0xf153('0x41')][_0xf153('0x48')]('\x20')[_0xf153('0x18')]>0x1){_0x5c333b['contact'][_0x9b3f4c]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf153('0x37')](_0x1b4bc1['value']),null);}else{var _0x46dd09='%'+_0x1b4bc1[_0xf153('0x41')]+'%';_0x5c333b[_0xf153('0x49')][_0x9b3f4c](_0xf153('0x4a'),_0x46dd09,_0x46dd09,_0x46dd09);}}else{_0x4e0634=_[_0xf153('0x3d')](_0x23c293,[_0xf153('0xc'),'ContactId']);_0x1b4bc1['field']=_0xf153('0x4b');_0x254692=as[_0xf153('0x3e')](_0x332809,_0x4e0634['type'],_0x1b4bc1);_0x5c333b[_0xf153('0x49')][_0x9b3f4c](_0x254692[_0xf153('0x40')],_0x254692[_0xf153('0x41')][_0xf153('0x4c')],_0x254692[_0xf153('0x41')][_0xf153('0x42')]);}break;case _0xf153('0x4d'):var _0x17fb17=_0x1b4bc1[_0xf153('0x41')][_0xf153('0x48')](',')[_0xf153('0x1b')](function(_0x46e279){return Number(_0x46e279);});var _0x59228a=parseTagParameter(_0x17fb17);_0x5c333b[_0xf153('0x4e')][_0xf153('0x4f')][_0xf153('0x50')](_0x59228a);_0x5c333b['tags'][_0xf153('0x51')]=_0x17fb17;break;case _0xf153('0x52'):if(_0x1b4bc1['operator']===_0xf153('0x47')){_0x5c333b['user'][_0x9b3f4c](_0xf153('0x53'),'%'+_0x1b4bc1[_0xf153('0x41')]+'%',null);}else{_0x4e0634=_[_0xf153('0x3d')](_0x23c293,['name',_0xf153('0x54')]);_0x1b4bc1[_0xf153('0xb')]=_0xf153('0x54');_0x254692=as[_0xf153('0x3e')](_0x332809,_0x4e0634[_0xf153('0x3f')],_0x1b4bc1);_0x5c333b['user'][_0x9b3f4c](_0x254692[_0xf153('0x40')],_0x254692[_0xf153('0x41')]['start'],_0x254692[_0xf153('0x41')][_0xf153('0x42')]);}break;case _0xf153('0x55'):case'plainBody':_0x254692=as[_0xf153('0x3e')]('me',null,_0x1b4bc1);_0x5c333b[_0xf153('0x55')][_0x9b3f4c](_0x254692[_0xf153('0x40')],_0x254692[_0xf153('0x41')][_0xf153('0x4c')],_0x254692[_0xf153('0x41')][_0xf153('0x42')]);break;}}}return _0x5c333b;}function parseModelFields(_0x33e48,_0x3b91ed,_0x5b33a5){var _0x5c1444=utils['getAccountFK'](_0x33e48);var _0x5987f0=squel['expr']();var _0x43e608=_(_0x3b91ed)[_0xf153('0x56')]()['map'](function(_0x424b7a){return _[_0xf153('0x57')](_0x5b33a5,['name',_0x424b7a])?_0x424b7a:undefined;})[_0xf153('0x58')]()[_0xf153('0x41')]();if(_0x43e608[_0xf153('0x18')]>0x0){_0x43e608[_0xf153('0x59')](function(_0x3964db){if(_0x3964db===_0x5c1444){_0x5987f0[_0xf153('0x50')]('i.'+_0x5c1444+'\x20IN\x20?',[][_0xf153('0x5a')](_0x3b91ed[_0x3964db]));}else if(_0x3964db===_0xf153('0x5b')){var _0x4dca55=JSON['parse'](_0x3b91ed[_0x3964db])[_0xf153('0x5c')];var _0x8cbb80=JSON[_0xf153('0x5d')](_0x3b91ed[_0x3964db])[_0xf153('0x5e')];_0x5987f0[_0xf153('0x50')](_0xf153('0x5f'),_0x4dca55,_0x8cbb80);}else{if(_0x3b91ed[_0x3964db]==='null'){_0x5987f0[_0xf153('0x50')]('i.'+_0x3964db+'\x20IS\x20NULL');}else{_0x5987f0[_0xf153('0x50')]('i.'+_0x3964db+_0xf153('0x60'),_0x3b91ed[_0x3964db]);}}});}return _0x5987f0;}function parseQueryParameters(_0x454fff,_0x5cc697,_0x35912e){var _0x3a4166=getSqlClauses();return Promise[_0xf153('0x61')]()[_0xf153('0x62')](function(){return parseModelFields(_0x454fff,_0x5cc697,_0x35912e);})[_0xf153('0x62')](function(_0x18d0ce){_0x3a4166[_0xf153('0x63')]['and'](_0x18d0ce);return parseReadParameter(_0x5cc697[_0xf153('0x44')]);})[_0xf153('0x62')](function(_0x546114){_0x3a4166['read'][_0xf153('0x50')](_0x546114);return parseTagParameter(_0x5cc697[_0xf153('0x64')]);})[_0xf153('0x62')](function(_0x2d96eb){_0x3a4166[_0xf153('0x4e')][_0xf153('0x4f')][_0xf153('0x50')](_0x2d96eb);return parseSearchFilter(_0x454fff,_0x5cc697[_0xf153('0x65')]);})['then'](function(_0x308b5f){_0x3a4166[_0xf153('0x65')]=_0x308b5f;return _0x3a4166;});}function checkAccountsRestrictions(_0x5a0cd8,_0x3b112e,_0x3e160a){var _0x2e95f4=utils[_0xf153('0x7')](_0x5a0cd8);var _0x1f2830=_0xf153('0x66')+_[_0xf153('0x67')](_0x5a0cd8)+(_0x5a0cd8===_0xf153('0x68')?_0xf153('0x69'):_0xf153('0x6a'));var _0xca7bec=squel['expr']();return Promise[_0xf153('0x61')]()[_0xf153('0x62')](function(){if(_0x3e160a['search']&&_0x3b112e[_0xf153('0x8')]===_0xf153('0x6b')){return _0x3b112e[_0x1f2830]({'attributes':['id'],'raw':!![]});}})[_0xf153('0x62')](function(_0x147d3a){if(_0x147d3a){if(_0x147d3a[_0xf153('0x18')]===0x0){_0xca7bec[_0xf153('0x50')]('i.'+_0x2e95f4+_0xf153('0x6c'));}else{_0xca7bec['and']('i.'+_0x2e95f4+_0xf153('0x1a'),_[_0xf153('0x1b')](_0x147d3a,'id'));}}else if(!_0x3e160a[_0x2e95f4]){_0xca7bec[_0xf153('0x50')]('i.'+_0x2e95f4+_0xf153('0x6d'));}})[_0xf153('0x62')](function(){return _0xca7bec;});}function getClosedOrderClause(_0x2755b7,_0x19ec0b){var _0x2db5b7='';var _0x437083=['i.thirdDisposition',_0xf153('0x6e'),_0xf153('0x6f')];if(_0x2755b7==='mail'){_0x437083[_0xf153('0x70')]('i.substatus');}if(_0x19ec0b[_0xf153('0x71')]==='0'&&_0x2755b7===_0xf153('0x34')){_0x2db5b7='i.substatus';}else{if(_0x19ec0b[_0xf153('0x71')]==='1'){_0x437083['shift']();}_0x2db5b7=_0xf153('0x72')+_0x437083[_0xf153('0x73')](',\x20')+')';}return _0x2db5b7;}function getFilteredInteractions(_0x1ff298,_0x1c2e33,_0x4ad773,_0x42cd70){var _0xc0095d=utils['getInteractionFK'](_0x1ff298);var _0x43d10b=_[_0xf153('0x67')](_0x1ff298)+_0xf153('0x74');var _0x362e41=[];var _0x1e19f4=getTagsQuery();var _0x55f7c1={'type':db[_0xf153('0x75')]['QueryTypes'][_0xf153('0x76')],'raw':!![]};var _0x38a7c4=[];var _0x5907f8=[];return db['sequelize'][_0xf153('0x77')](_0x1e19f4[_0xf153('0x78')](),_0x55f7c1)['then'](function(_0x4775b1){_0x362e41=_[_0xf153('0x79')](_0x4775b1,'id');_0x55f7c1=_[_0xf153('0x7a')](_0x55f7c1,{'model':db[_0x43d10b],'mapToModel':!![],'nest':!![]});if(_0x4ad773['fields']){_0x42cd70[_0xf153('0x7b')][_0xf153('0x59')](function(_0x3b87e7){_0x1c2e33[_0xf153('0xb')]('i.'+_0x3b87e7);});}else{_0x1c2e33[_0xf153('0xb')](_0xf153('0x7c'),_0xf153('0x43'));_0x1c2e33[_0xf153('0xb')](_0xf153('0x7d'),_0xf153('0x7e'));_0x1c2e33[_0xf153('0xb')](_0xf153('0x7f'),_0xf153('0x80'));if(_0x1ff298===_0xf153('0x34')){_0x1c2e33[_0xf153('0xb')](_0xf153('0x81'),'Account.email');_0x1c2e33[_0xf153('0xb')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x1c2e33[_0xf153('0xb')]('i.id');_0x1c2e33[_0xf153('0xb')](_0xf153('0x82'));_0x1c2e33[_0xf153('0xb')](_0xf153('0x83'));_0x1c2e33[_0xf153('0xb')](_0xf153('0x84'));_0x1c2e33['field'](_0xf153('0x85'));_0x1c2e33[_0xf153('0xb')](_0xf153('0x86'));_0x1c2e33['field']('i.lastMsgAt');_0x1c2e33[_0xf153('0xb')](_0xf153('0x87'));_0x1c2e33[_0xf153('0xb')]('i.subject');_0x1c2e33[_0xf153('0xb')]('i.disposition');_0x1c2e33['field'](_0xf153('0x6e'));_0x1c2e33[_0xf153('0xb')](_0xf153('0x88'));_0x1c2e33['field'](_0xf153('0x89'));_0x1c2e33[_0xf153('0xb')]('i.to');_0x1c2e33[_0xf153('0xb')](_0xf153('0x8a'));_0x1c2e33[_0xf153('0xb')](_0xf153('0x8b'));_0x1c2e33[_0xf153('0xb')]('i.UserId');}else if(_0x1ff298===_0xf153('0x8c')){_0x1c2e33[_0xf153('0xb')](_0xf153('0x8d'),_0xf153('0x8e'));}else{_0x1c2e33[_0xf153('0xb')](_0xf153('0x8f'),_0xf153('0x8e'));}if(_0x1ff298!=='mail'){_0x1c2e33[_0xf153('0xb')](_0xf153('0x90'));}_0x1c2e33[_0xf153('0xb')](_0xf153('0x91'),_0xf153('0x92'));_0x1c2e33[_0xf153('0xb')]('c.lastName',_0xf153('0x93'));_0x1c2e33[_0xf153('0xb')](_0xf153('0x94'),_0xf153('0x95'));_0x1c2e33[_0xf153('0xb')](_0xf153('0x96'),_0xf153('0x97'));_0x1c2e33[_0xf153('0xb')](_0xf153('0x98'),_0xf153('0x99'));_0x1c2e33['field']('c.fax','Contact.fax');_0x1c2e33['field'](_0xf153('0x9a'),_0xf153('0x9b'));_0x1c2e33[_0xf153('0xb')](_0xf153('0x9c'),_0xf153('0x9d'));_0x1c2e33['field'](_0xf153('0x9e'),_0xf153('0x9f'));}if(_0x42cd70[_0xf153('0xa0')]){_0x1c2e33[_0xf153('0xa0')](_0x42cd70['limit']);}if(_0x42cd70[_0xf153('0xa1')]){_0x1c2e33[_0xf153('0xa1')](_0x42cd70[_0xf153('0xa1')]);}return db['sequelize'][_0xf153('0x77')](_0x1c2e33['toString'](),_0x55f7c1);})[_0xf153('0x62')](function(_0x25ab76){_0x38a7c4=_0x25ab76;var _0x2651ff=getUsersQuery(_0x1ff298,_0x38a7c4);return db['sequelize']['query'](_0x2651ff['toString'](),_0x55f7c1);})[_0xf153('0x62')](function(_0x45f965){_0x5907f8=_['groupBy'](_0x45f965,_0xc0095d);if(_0x1ff298==='mail'){return db[_0xf153('0xa2')]['findOne']({'attributes':[_0xf153('0xa3')],'raw':!![]});}})['then'](function(_0xb3632c){var _0x2d007a=_0xb3632c?_0xb3632c[_0xf153('0xa3')]:undefined;var _0x3a1bf2=_0x38a7c4[_0xf153('0x1b')](function(_0x3bb664){return updateInteraction(_0x3bb664,_0x362e41,_0x5907f8,_0x2d007a);});return Promise['all'](_0x3a1bf2);});}function countFilteredInteractions(_0x174546,_0x33cd1a){var _0x56473b=_0x174546[_0xf153('0xa4')]();_0x56473b[_0xf153('0xb')](_0xf153('0xa5'));_0x56473b[_0xf153('0xb')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf153('0x43'));var _0x19534a=utils['getSelectedTags'](_0x33cd1a);if(!_[_0xf153('0xa6')](_0x19534a)){_0x56473b[_0xf153('0x19')](_0xf153('0xa7'),_0x19534a);}var _0x11d650={'type':db['Sequelize'][_0xf153('0xa8')][_0xf153('0x76')],'raw':!![]};return db[_0xf153('0xa9')][_0xf153('0x77')](_0x56473b[_0xf153('0x78')](),_0x11d650);}module[_0xf153('0xaa')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file +var _0xa8a8=['$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','resolve','then','fields','filter','get','capitalize','chat','Websites','i.thirdDisposition','unshift','closed','i.substatus','shift','CONCAT_WS(\x27\x27,\x20','Interaction','Sequelize','SELECT','sequelize','query','toString','merge','attributes','unreadMessages','a.key','Account.mandatoryDisposition','a.email','Account.email','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20CONCAT(\x27%\x27,\x20a.email,\x20\x27%\x27)\x20THEN\x20TRIM(SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201))\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.id','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.subject','i.secondDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','limit','offset','enableEmailPreview','all','COUNT(*)','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','getSelectedTags','t.id\x20IN\x20?','exports','lodash','squel','../parsers/advancedSearch','../parsers/qs','updateInteraction','./utils','../../mysqldb','getAccountFK','role','agent','search','select','field','color','tools_tags','getInteractionFK','_interactions','ui.','from','left_join','users','u.id\x20=\x20ui.UserId','length','map','getInteractionsTables','interactions','accounts','a.id\x20=\x20i.','messages','me.','\x20=\x20i.id','interactionsTags','it.','t.id\x20=\x20it.TagId','expr','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','replace','{OPERATOR}','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','fax','openchannel','i.from\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','mail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','parseSearch','sqlOperator','conditions','buildExpression','type','default','text','value','read','and','Contact','operator','$substring','contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','name','ContactId','start','Tag','split','tags','clause','ids','User','user','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','end','body','plainBody','keys','compact','forEach','\x20IN\x20?','concat','parse','$gte'];(function(_0x46a671,_0x758e9a){var _0x526d75=function(_0xde3640){while(--_0xde3640){_0x46a671['push'](_0x46a671['shift']());}};_0x526d75(++_0x758e9a);}(_0xa8a8,0xec));var _0x8a8a=function(_0x48d856,_0x44657e){_0x48d856=_0x48d856-0x0;var _0x4504d2=_0xa8a8[_0x48d856];return _0x4504d2;};'use strict';var _=require(_0x8a8a('0x0'));var squel=require(_0x8a8a('0x1'));var as=require(_0x8a8a('0x2'));var qs=require(_0x8a8a('0x3'));var updateInteraction=require('./update-interaction')[_0x8a8a('0x4')];var utils=require(_0x8a8a('0x5'));var db=require(_0x8a8a('0x6'))['db'];function skipInteractionsQuery(_0x3ed1de,_0x45515d,_0x1cecd4){var _0x3184a3=![];var _0x12db82=utils[_0x8a8a('0x7')](_0x3ed1de);if(_0x45515d[_0x8a8a('0x8')]===_0x8a8a('0x9')&&!_0x1cecd4[_0x8a8a('0xa')]&&!_0x1cecd4[_0x12db82]){_0x3184a3=!![];}return _0x3184a3;}function getTagsQuery(){return squel[_0x8a8a('0xb')]()[_0x8a8a('0xc')]('id')[_0x8a8a('0xc')]('name')['field'](_0x8a8a('0xd'))['from'](_0x8a8a('0xe'));}function getUsersQuery(_0x3d3a00,_0x532621){var _0x118380=utils[_0x8a8a('0xf')](_0x3d3a00);var _0xb13fca='user_has_'+_0x3d3a00+_0x8a8a('0x10');var _0x42fab7=squel[_0x8a8a('0xb')]()[_0x8a8a('0xc')]('u.id')[_0x8a8a('0xc')]('u.fullname')[_0x8a8a('0xc')](_0x8a8a('0x11')+_0x118380)[_0x8a8a('0x12')](_0xb13fca,'ui')[_0x8a8a('0x13')](_0x8a8a('0x14'),'u',_0x8a8a('0x15'));if(_0x532621[_0x8a8a('0x16')]>0x0){_0x42fab7['where'](_0x8a8a('0x11')+_0x118380+'\x20IN\x20?',_[_0x8a8a('0x17')](_0x532621,'id'));}return _0x42fab7;}function getInteractionsQuery(_0x3046ae){var _0x46a4f4=utils[_0x8a8a('0x18')](_0x3046ae);var _0x42e8b6=utils['getAccountFK'](_0x3046ae);var _0x9d55f9=utils[_0x8a8a('0xf')](_0x3046ae);return squel[_0x8a8a('0xb')]()[_0x8a8a('0x12')](_0x46a4f4[_0x8a8a('0x19')],'i')[_0x8a8a('0x13')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o','o.id\x20=\x20i.UserId')[_0x8a8a('0x13')](_0x46a4f4[_0x8a8a('0x1a')],'a',_0x8a8a('0x1b')+_0x42e8b6)[_0x8a8a('0x13')](_0x46a4f4[_0x8a8a('0x1c')],'me',_0x8a8a('0x1d')+_0x9d55f9+_0x8a8a('0x1e'))[_0x8a8a('0x13')](_0x46a4f4[_0x8a8a('0x1f')],'it',_0x8a8a('0x20')+_0x9d55f9+_0x8a8a('0x1e'))[_0x8a8a('0x13')](_0x8a8a('0xe'),'t',_0x8a8a('0x21'));}function getSqlClauses(){var _0x442c00={'body':squel['expr'](),'contact':squel[_0x8a8a('0x22')](),'default':squel[_0x8a8a('0x22')](),'fields':squel[_0x8a8a('0x22')](),'filter':squel[_0x8a8a('0x22')](),'read':squel[_0x8a8a('0x22')](),'tags':{'clause':squel[_0x8a8a('0x22')](),'ids':null},'user':squel[_0x8a8a('0x22')]()};return _0x442c00;}function parseTagParameter(_0x5f4dcc){var _0x31d21a=squel[_0x8a8a('0x22')]();if(_0x5f4dcc){var _0x2e217a=utils['getSelectedTags'](_0x5f4dcc);_0x2e217a['forEach'](function(_0x2dafcd){_0x31d21a['or'](_0x8a8a('0x23'),'%,'+_0x2dafcd+',%');});}return _0x31d21a;}function parseReadParameter(_0x5c70bd){var _0x4d8760='';if(_0x5c70bd){_0x4d8760='unreadMessages\x20{OPERATOR}\x200';if(_0x5c70bd==='1'){_0x4d8760=_0x4d8760[_0x8a8a('0x24')]('{OPERATOR}','=');}else{_0x4d8760=_0x4d8760[_0x8a8a('0x24')](_0x8a8a('0x25'),'>');}}return _0x4d8760;}function parseSearchFilter(_0x49ea81,_0x36c7f8){var _0x2c8f27=squel[_0x8a8a('0x22')]();if(_0x36c7f8){var _0x8df0cb=_0x36c7f8[_0x8a8a('0x24')]('\x5c','\x5c\x5c')[_0x8a8a('0x24')](/'/g,'\x27\x27');if(qs[_0x8a8a('0x26')](_0x8df0cb)){_0x2c8f27['or'](_0x8a8a('0x27'),_0x8df0cb+'%');if(['sms','whatsapp']['includes'](_0x49ea81)){_0x2c8f27['or'](_0x8a8a('0x28'),_0x8df0cb+'%');}else if(_0x49ea81===_0x8a8a('0x29')){_0x2c8f27['or']('i.fax\x20LIKE\x20?',_0x8df0cb+'%');}else if(_0x49ea81===_0x8a8a('0x2a')){_0x2c8f27['or'](_0x8a8a('0x2b'),_0x8df0cb+'%');}}else if(_0x49ea81==='mail'&&qs[_0x8a8a('0x2c')](_0x8df0cb)){_0x2c8f27['or'](_0x8a8a('0x2d'),_0x8df0cb+'%');}else{if(_0x49ea81===_0x8a8a('0x2e')){_0x2c8f27['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x8df0cb))['or'](_0x8a8a('0x2f'),qs['getFullTextValue'](_0x8df0cb));}else{if(_0x49ea81!==_0x8a8a('0x29')){_0x2c8f27['or'](_0x8a8a('0x30'),qs[_0x8a8a('0x31')](_0x8df0cb));}_0x2c8f27['or'](_0x8a8a('0x32'),_0x8df0cb+'%');}}}return _0x2c8f27;}function parseAdvancedSearchFilter(_0x3c69b4,_0x997136){var _0x37ce45=getSqlClauses();var _0x389ad1=as[_0x8a8a('0x33')](_0x3c69b4);var _0xf7d4d7=_0x389ad1[_0x8a8a('0x34')];for(var _0x45ddb4=0x0;_0x45ddb4<_0x389ad1[_0x8a8a('0x35')][_0x8a8a('0x16')];_0x45ddb4++){var _0x19c21c=_0x389ad1[_0x8a8a('0x35')][_0x45ddb4];var _0x8e3017='i';var _0x29d187=_['find'](_0x997136,['name',_0x19c21c['field']]);if(_0x29d187){var _0x34db33=as[_0x8a8a('0x36')](_0x8e3017,_0x29d187[_0x8a8a('0x37')],_0x19c21c);_0x37ce45[_0x8a8a('0x38')][_0xf7d4d7](_0x34db33[_0x8a8a('0x39')],_0x34db33['value']['start'],_0x34db33[_0x8a8a('0x3a')]['end']);}else{switch(_0x19c21c[_0x8a8a('0xc')]){case'unreadMessages':var _0x52811b=parseReadParameter(_0x19c21c[_0x8a8a('0x3a')]);_0x37ce45[_0x8a8a('0x3b')][_0x8a8a('0x3c')](_0x52811b);break;case _0x8a8a('0x3d'):if(_0x19c21c[_0x8a8a('0x3e')]===_0x8a8a('0x3f')){if(_0x19c21c[_0x8a8a('0x3a')]['split']('\x20')[_0x8a8a('0x16')]>0x1){_0x37ce45[_0x8a8a('0x40')][_0xf7d4d7](_0x8a8a('0x41'),qs['getFullTextValue'](_0x19c21c[_0x8a8a('0x3a')]),null);}else{var _0x323f89='%'+_0x19c21c[_0x8a8a('0x3a')]+'%';_0x37ce45['contact'][_0xf7d4d7](_0x8a8a('0x42'),_0x323f89,_0x323f89,_0x323f89);}}else{_0x29d187=_[_0x8a8a('0x43')](_0x997136,[_0x8a8a('0x44'),_0x8a8a('0x45')]);_0x19c21c[_0x8a8a('0xc')]=_0x8a8a('0x45');_0x34db33=as['buildExpression'](_0x8e3017,_0x29d187['type'],_0x19c21c);_0x37ce45[_0x8a8a('0x40')][_0xf7d4d7](_0x34db33['text'],_0x34db33[_0x8a8a('0x3a')][_0x8a8a('0x46')],_0x34db33['value']['end']);}break;case _0x8a8a('0x47'):var _0x1ea8f7=_0x19c21c[_0x8a8a('0x3a')][_0x8a8a('0x48')](',')['map'](function(_0x103223){return Number(_0x103223);});var _0x4de773=parseTagParameter(_0x1ea8f7);_0x37ce45[_0x8a8a('0x49')][_0x8a8a('0x4a')]['and'](_0x4de773);_0x37ce45[_0x8a8a('0x49')][_0x8a8a('0x4b')]=_0x1ea8f7;break;case _0x8a8a('0x4c'):if(_0x19c21c['operator']===_0x8a8a('0x3f')){_0x37ce45[_0x8a8a('0x4d')][_0xf7d4d7](_0x8a8a('0x4e'),'%'+_0x19c21c['value']+'%',null);}else{_0x29d187=_['find'](_0x997136,[_0x8a8a('0x44'),_0x8a8a('0x4f')]);_0x19c21c[_0x8a8a('0xc')]='UserId';_0x34db33=as[_0x8a8a('0x36')](_0x8e3017,_0x29d187[_0x8a8a('0x37')],_0x19c21c);_0x37ce45[_0x8a8a('0x4d')][_0xf7d4d7](_0x34db33[_0x8a8a('0x39')],_0x34db33[_0x8a8a('0x3a')][_0x8a8a('0x46')],_0x34db33[_0x8a8a('0x3a')][_0x8a8a('0x50')]);}break;case _0x8a8a('0x51'):case _0x8a8a('0x52'):_0x34db33=as[_0x8a8a('0x36')]('me',null,_0x19c21c);_0x37ce45['body'][_0xf7d4d7](_0x34db33[_0x8a8a('0x39')],_0x34db33[_0x8a8a('0x3a')][_0x8a8a('0x46')],_0x34db33[_0x8a8a('0x3a')][_0x8a8a('0x50')]);break;}}}return _0x37ce45;}function parseModelFields(_0x2e22b0,_0x565a49,_0x1dceca){var _0x396ffd=utils[_0x8a8a('0x7')](_0x2e22b0);var _0x2c71f3=squel['expr']();var _0x1faad3=_(_0x565a49)[_0x8a8a('0x53')]()[_0x8a8a('0x17')](function(_0x5220c0){return _['some'](_0x1dceca,[_0x8a8a('0x44'),_0x5220c0])?_0x5220c0:undefined;})[_0x8a8a('0x54')]()[_0x8a8a('0x3a')]();if(_0x1faad3[_0x8a8a('0x16')]>0x0){_0x1faad3[_0x8a8a('0x55')](function(_0x20efe1){if(_0x20efe1===_0x396ffd){_0x2c71f3[_0x8a8a('0x3c')]('i.'+_0x396ffd+_0x8a8a('0x56'),[][_0x8a8a('0x57')](_0x565a49[_0x20efe1]));}else if(_0x20efe1==='createdAt'){var _0x4c1f1a=JSON[_0x8a8a('0x58')](_0x565a49[_0x20efe1])[_0x8a8a('0x59')];var _0x56e170=JSON['parse'](_0x565a49[_0x20efe1])[_0x8a8a('0x5a')];_0x2c71f3['and'](_0x8a8a('0x5b'),_0x4c1f1a,_0x56e170);}else{if(_0x565a49[_0x20efe1]==='null'){_0x2c71f3[_0x8a8a('0x3c')]('i.'+_0x20efe1+_0x8a8a('0x5c'));}else{_0x2c71f3[_0x8a8a('0x3c')]('i.'+_0x20efe1+_0x8a8a('0x5d'),_0x565a49[_0x20efe1]);}}});}return _0x2c71f3;}function parseQueryParameters(_0x330654,_0x14066f,_0x2b718b){var _0x7bab17=getSqlClauses();return Promise[_0x8a8a('0x5e')]()[_0x8a8a('0x5f')](function(){return parseModelFields(_0x330654,_0x14066f,_0x2b718b);})['then'](function(_0x329bfb){_0x7bab17[_0x8a8a('0x60')][_0x8a8a('0x3c')](_0x329bfb);return parseReadParameter(_0x14066f[_0x8a8a('0x3b')]);})[_0x8a8a('0x5f')](function(_0x517446){_0x7bab17[_0x8a8a('0x3b')][_0x8a8a('0x3c')](_0x517446);return parseTagParameter(_0x14066f['tag']);})['then'](function(_0x408657){_0x7bab17[_0x8a8a('0x49')][_0x8a8a('0x4a')][_0x8a8a('0x3c')](_0x408657);return parseSearchFilter(_0x330654,_0x14066f[_0x8a8a('0x61')]);})[_0x8a8a('0x5f')](function(_0x5ed59c){_0x7bab17['filter']=_0x5ed59c;return _0x7bab17;});}function checkAccountsRestrictions(_0x495371,_0x414aa4,_0x54d848){var _0x3984dd=utils[_0x8a8a('0x7')](_0x495371);var _0x4e1ca8=_0x8a8a('0x62')+_[_0x8a8a('0x63')](_0x495371)+(_0x495371===_0x8a8a('0x64')?_0x8a8a('0x65'):'Accounts');var _0x12e040=squel['expr']();return Promise[_0x8a8a('0x5e')]()[_0x8a8a('0x5f')](function(){if(_0x54d848['search']&&_0x414aa4[_0x8a8a('0x8')]===_0x8a8a('0x9')){return _0x414aa4[_0x4e1ca8]({'attributes':['id'],'raw':!![]});}})[_0x8a8a('0x5f')](function(_0x183015){if(_0x183015){if(_0x183015['length']===0x0){_0x12e040[_0x8a8a('0x3c')]('i.'+_0x3984dd+_0x8a8a('0x5c'));}else{_0x12e040[_0x8a8a('0x3c')]('i.'+_0x3984dd+'\x20IN\x20?',_['map'](_0x183015,'id'));}}else if(!_0x54d848[_0x3984dd]){_0x12e040[_0x8a8a('0x3c')]('i.'+_0x3984dd+'\x20IS\x20NOT\x20NULL');}})['then'](function(){return _0x12e040;});}function getClosedOrderClause(_0x52137d,_0x395564){var _0x7d79a4='';var _0x5bdbd3=[_0x8a8a('0x66'),'i.secondDisposition','i.disposition'];if(_0x52137d===_0x8a8a('0x2e')){_0x5bdbd3[_0x8a8a('0x67')]('i.substatus');}if(_0x395564[_0x8a8a('0x68')]==='0'&&_0x52137d===_0x8a8a('0x2e')){_0x7d79a4=_0x8a8a('0x69');}else{if(_0x395564[_0x8a8a('0x68')]==='1'){_0x5bdbd3[_0x8a8a('0x6a')]();}_0x7d79a4=_0x8a8a('0x6b')+_0x5bdbd3['join'](',\x20')+')';}return _0x7d79a4;}function getFilteredInteractions(_0x3ca3d6,_0x402b5f,_0x587ea8,_0x2ce579){var _0x2fcfd8=utils[_0x8a8a('0xf')](_0x3ca3d6);var _0x190c45=_[_0x8a8a('0x63')](_0x3ca3d6)+_0x8a8a('0x6c');var _0x81c1dd=[];var _0x34a079=getTagsQuery();var _0x331979={'type':db[_0x8a8a('0x6d')]['QueryTypes'][_0x8a8a('0x6e')],'raw':!![]};var _0x2f7537=[];var _0x521883=[];return db[_0x8a8a('0x6f')][_0x8a8a('0x70')](_0x34a079[_0x8a8a('0x71')](),_0x331979)[_0x8a8a('0x5f')](function(_0x3e0af2){_0x81c1dd=_['keyBy'](_0x3e0af2,'id');_0x331979=_[_0x8a8a('0x72')](_0x331979,{'model':db[_0x190c45],'mapToModel':!![],'nest':!![]});if(_0x587ea8[_0x8a8a('0x60')]){_0x2ce579[_0x8a8a('0x73')][_0x8a8a('0x55')](function(_0x3fc483){_0x402b5f[_0x8a8a('0xc')]('i.'+_0x3fc483);});}else{_0x402b5f[_0x8a8a('0xc')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x8a8a('0x74'));_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x75'),'Account.key');_0x402b5f[_0x8a8a('0xc')]('a.mandatoryDisposition',_0x8a8a('0x76'));if(_0x3ca3d6===_0x8a8a('0x2e')){_0x402b5f['field'](_0x8a8a('0x77'),_0x8a8a('0x78'));_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x79'),_0x8a8a('0x7a'));_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x7b'));_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x7c'));_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x7d'));_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x7e'));_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x7f'));_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x80'));_0x402b5f[_0x8a8a('0xc')]('i.lastMsgAt');_0x402b5f[_0x8a8a('0xc')]('i.lastMsgDirection');_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x81'));_0x402b5f[_0x8a8a('0xc')]('i.disposition');_0x402b5f['field'](_0x8a8a('0x82'));_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x66'));_0x402b5f['field']('i.substatus');_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x83'));_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x84'));_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x85'));_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x86'));}else if(_0x3ca3d6==='openchannel'){_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x87'),'contactName');}else{_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x88'),_0x8a8a('0x7a'));}if(_0x3ca3d6!==_0x8a8a('0x2e')){_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x89'));}_0x402b5f['field'](_0x8a8a('0x8a'),_0x8a8a('0x8b'));_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x8c'),_0x8a8a('0x8d'));_0x402b5f['field'](_0x8a8a('0x8e'),_0x8a8a('0x8f'));_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x90'),_0x8a8a('0x91'));_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x92'),_0x8a8a('0x93'));_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x94'),'Contact.fax');_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x95'),_0x8a8a('0x96'));_0x402b5f[_0x8a8a('0xc')](_0x8a8a('0x97'),'Owner.internal');_0x402b5f['field'](_0x8a8a('0x98'),_0x8a8a('0x99'));}if(_0x2ce579[_0x8a8a('0x9a')]){_0x402b5f['limit'](_0x2ce579[_0x8a8a('0x9a')]);}if(_0x2ce579[_0x8a8a('0x9b')]){_0x402b5f[_0x8a8a('0x9b')](_0x2ce579[_0x8a8a('0x9b')]);}return db['sequelize'][_0x8a8a('0x70')](_0x402b5f[_0x8a8a('0x71')](),_0x331979);})[_0x8a8a('0x5f')](function(_0x5cee89){_0x2f7537=_0x5cee89;var _0x5a3003=getUsersQuery(_0x3ca3d6,_0x2f7537);return db['sequelize'][_0x8a8a('0x70')](_0x5a3003['toString'](),_0x331979);})[_0x8a8a('0x5f')](function(_0x5a3682){_0x521883=_['groupBy'](_0x5a3682,_0x2fcfd8);if(_0x3ca3d6===_0x8a8a('0x2e')){return db['Setting']['findOne']({'attributes':['enableEmailPreview'],'raw':!![]});}})[_0x8a8a('0x5f')](function(_0x49aa1b){var _0x58a6ff=_0x49aa1b?_0x49aa1b[_0x8a8a('0x9c')]:undefined;var _0x482fa4=_0x2f7537[_0x8a8a('0x17')](function(_0x5dcc61){return updateInteraction(_0x5dcc61,_0x81c1dd,_0x521883,_0x58a6ff);});return Promise[_0x8a8a('0x9d')](_0x482fa4);});}function countFilteredInteractions(_0x27c4ba,_0x353f0d){var _0x238565=_0x27c4ba['clone']();_0x238565[_0x8a8a('0xc')](_0x8a8a('0x9e'));_0x238565['field'](_0x8a8a('0x9f'),_0x8a8a('0x74'));var _0x913e4c=utils[_0x8a8a('0xa0')](_0x353f0d);if(!_['isEmpty'](_0x913e4c)){_0x238565['where'](_0x8a8a('0xa1'),_0x913e4c);}var _0x1ee082={'type':db[_0x8a8a('0x6d')]['QueryTypes'][_0x8a8a('0x6e')],'raw':!![]};return db[_0x8a8a('0x6f')][_0x8a8a('0x70')](_0x238565['toString'](),_0x1ee082);}module[_0x8a8a('0xa2')]={'checkAccountsRestrictions':checkAccountsRestrictions,'countFilteredInteractions':countFilteredInteractions,'getClosedOrderClause':getClosedOrderClause,'getFilteredInteractions':getFilteredInteractions,'getInteractionsQuery':getInteractionsQuery,'parseAdvancedSearchFilter':parseAdvancedSearchFilter,'parseQueryParameters':parseQueryParameters,'skipInteractionsQuery':skipInteractionsQuery}; \ No newline at end of file diff --git a/server/components/interaction/update-interaction.js b/server/components/interaction/update-interaction.js index 9b2b554..76cf811 100644 --- a/server/components/interaction/update-interaction.js +++ b/server/components/interaction/update-interaction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xaee5=['answered','unmanaged','abandoned','total','closed','disposition','UserId','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','updateInteraction','then','Users','TagIds','../../mysqldb','map','fullname','split','waiting','talking'];(function(_0x5105e8,_0x44a2e0){var _0x53bbf5=function(_0x29dfb8){while(--_0x29dfb8){_0x5105e8['push'](_0x5105e8['shift']());}};_0x53bbf5(++_0x44a2e0);}(_0xaee5,0xa9));var _0x5aee=function(_0xbc1ed5,_0x5473a1){_0xbc1ed5=_0xbc1ed5-0x0;var _0x4cb7e4=_0xaee5[_0xbc1ed5];return _0x4cb7e4;};'use strict';var _=require('lodash');var db=require(_0x5aee('0x0'))['db'];function getInteractionUsers(_0x207cd8,_0x402145){return new Promise(function(_0x344bcf,_0xe2081c){try{var _0x155111=[];if(_0x402145[_0x207cd8]){_0x155111=_0x402145[_0x207cd8][_0x5aee('0x1')](function(_0x434e7d){return{'id':_0x434e7d['id'],'fullname':_0x434e7d[_0x5aee('0x2')]};});}return _0x344bcf(_0x155111);}catch(_0x12df4c){_0xe2081c(_0x12df4c);}});}function getInteractionTags(_0x8d2231,_0x104503){var _0x5ddb6f=[];if(_0x8d2231){_0x8d2231[_0x5aee('0x3')](',')['forEach'](function(_0x5c90cb){_0x5ddb6f['push'](_0x104503[_0x5c90cb]);});}return _0x5ddb6f;}function updateWaitingCounter(_0x28c567){if(_0x28c567[_0x5aee('0x4')]){_0x28c567[_0x5aee('0x4')]-=0x1;}}function updateInteractionCounters(_0x59d3b0){_0x59d3b0[_0x5aee('0x4')]=0x0;_0x59d3b0[_0x5aee('0x5')]=0x0;_0x59d3b0[_0x5aee('0x6')]=0x0;_0x59d3b0[_0x5aee('0x7')]=0x0;_0x59d3b0[_0x5aee('0x8')]=0x0;_0x59d3b0[_0x5aee('0x9')]=0x0;if(_0x59d3b0[_0x5aee('0xa')]){if(_0x59d3b0[_0x5aee('0xb')]===_0x5aee('0x8')){_0x59d3b0[_0x5aee('0x8')]+=0x1;updateWaitingCounter(_0x59d3b0);}if(_0x59d3b0[_0x5aee('0xc')]){_0x59d3b0[_0x5aee('0x6')]+=0x1;if(_0x59d3b0[_0x5aee('0x5')]){_0x59d3b0[_0x5aee('0x5')]-=0x1;}}else{if(_0x59d3b0[_0x5aee('0xb')]){_0x59d3b0['unmanaged']+=0x1;updateWaitingCounter(_0x59d3b0);}}}else{if(!_0x59d3b0[_0x5aee('0xc')]){_0x59d3b0[_0x5aee('0x4')]+=0x1;}if(_0x59d3b0[_0x5aee('0xc')]){_0x59d3b0['talking']+=0x1;updateWaitingCounter(_0x59d3b0);}}_0x59d3b0[_0x5aee('0x9')]+=0x1;return _0x59d3b0;}function getLastMessageText(_0x423ebb){return db[_0x5aee('0xd')][_0x5aee('0xe')]({'where':{'$and':[{'MailInteractionId':_0x423ebb['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x5aee('0xf')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x5aee('0x10'),'raw':!![]})['then'](function(_0x4c543c){if(_0x4c543c&&_0x4c543c[_0x5aee('0x11')]){_0x423ebb[_0x5aee('0x12')]=_[_0x5aee('0x13')](_0x4c543c[_0x5aee('0x11')]);}return _0x423ebb;})[_0x5aee('0x14')](function(_0x1639d2){throw _0x1639d2;});}exports[_0x5aee('0x15')]=function(_0x3fe883,_0x59196a,_0x231284,_0x579eaa){return new Promise(function(_0x309b9d,_0x12c941){return getInteractionUsers(_0x3fe883['id'],_0x231284)[_0x5aee('0x16')](function(_0x385ca2){_0x3fe883[_0x5aee('0x17')]=_0x385ca2;return getInteractionTags(_0x3fe883[_0x5aee('0x18')],_0x59196a);})[_0x5aee('0x16')](function(_0x3f7649){_0x3fe883['Tags']=_0x3f7649;delete _0x3fe883[_0x5aee('0x18')];return updateInteractionCounters(_0x3fe883);})[_0x5aee('0x16')](function(_0x42ac3c){if(_0x579eaa){return getLastMessageText(_0x42ac3c);}else{return _0x42ac3c;}})[_0x5aee('0x16')](function(_0x4d5a9c){_0x309b9d(_0x4d5a9c);})[_0x5aee('0x14')](function(_0x3b86e1){_0x12c941(_0x3b86e1);});});}; \ No newline at end of file +var _0xba32=['total','closed','disposition','UserId','plainBody','then','lastMsgText','trimStart','updateInteraction','Users','TagIds','catch','lodash','../../mysqldb','map','fullname','split','push','waiting','talking','answered','unmanaged','abandoned'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xba32,0xf2));var _0x2ba3=function(_0x60369b,_0x525315){_0x60369b=_0x60369b-0x0;var _0x3c9e8e=_0xba32[_0x60369b];return _0x3c9e8e;};'use strict';var _=require(_0x2ba3('0x0'));var db=require(_0x2ba3('0x1'))['db'];function getInteractionUsers(_0x125c32,_0x20df53){return new Promise(function(_0xcb7deb,_0x5c5ba9){try{var _0x2236d8=[];if(_0x20df53[_0x125c32]){_0x2236d8=_0x20df53[_0x125c32][_0x2ba3('0x2')](function(_0x1eb054){return{'id':_0x1eb054['id'],'fullname':_0x1eb054[_0x2ba3('0x3')]};});}return _0xcb7deb(_0x2236d8);}catch(_0x992726){_0x5c5ba9(_0x992726);}});}function getInteractionTags(_0xe351b3,_0x5798a5){var _0xf963cb=[];if(_0xe351b3){_0xe351b3[_0x2ba3('0x4')](',')['forEach'](function(_0x1e3952){_0xf963cb[_0x2ba3('0x5')](_0x5798a5[_0x1e3952]);});}return _0xf963cb;}function updateWaitingCounter(_0x1cbe88){if(_0x1cbe88[_0x2ba3('0x6')]){_0x1cbe88['waiting']-=0x1;}}function updateInteractionCounters(_0x12473a){_0x12473a[_0x2ba3('0x6')]=0x0;_0x12473a[_0x2ba3('0x7')]=0x0;_0x12473a[_0x2ba3('0x8')]=0x0;_0x12473a[_0x2ba3('0x9')]=0x0;_0x12473a[_0x2ba3('0xa')]=0x0;_0x12473a[_0x2ba3('0xb')]=0x0;if(_0x12473a[_0x2ba3('0xc')]){if(_0x12473a[_0x2ba3('0xd')]===_0x2ba3('0xa')){_0x12473a[_0x2ba3('0xa')]+=0x1;updateWaitingCounter(_0x12473a);}if(_0x12473a['UserId']){_0x12473a[_0x2ba3('0x8')]+=0x1;if(_0x12473a[_0x2ba3('0x7')]){_0x12473a['talking']-=0x1;}}else{if(_0x12473a[_0x2ba3('0xd')]){_0x12473a[_0x2ba3('0x9')]+=0x1;updateWaitingCounter(_0x12473a);}}}else{if(!_0x12473a['UserId']){_0x12473a[_0x2ba3('0x6')]+=0x1;}if(_0x12473a[_0x2ba3('0xe')]){_0x12473a[_0x2ba3('0x7')]+=0x1;updateWaitingCounter(_0x12473a);}}_0x12473a[_0x2ba3('0xb')]+=0x1;return _0x12473a;}function getLastMessageText(_0x2479cd){return db['MailMessage']['findOne']({'where':{'$and':[{'MailInteractionId':_0x2479cd['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':'out'},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x2ba3('0xf')],'order':'-id','raw':!![]})[_0x2ba3('0x10')](function(_0x2c9a0f){if(_0x2c9a0f&&_0x2c9a0f[_0x2ba3('0xf')]){_0x2479cd[_0x2ba3('0x11')]=_[_0x2ba3('0x12')](_0x2c9a0f['plainBody']);}return _0x2479cd;})['catch'](function(_0x4fbe77){throw _0x4fbe77;});}exports[_0x2ba3('0x13')]=function(_0x211712,_0x1a9083,_0x3276f7,_0x2ce042){return new Promise(function(_0x3c6756,_0x3f14b6){return getInteractionUsers(_0x211712['id'],_0x3276f7)[_0x2ba3('0x10')](function(_0x72b97b){_0x211712[_0x2ba3('0x14')]=_0x72b97b;return getInteractionTags(_0x211712[_0x2ba3('0x15')],_0x1a9083);})[_0x2ba3('0x10')](function(_0x3459d8){_0x211712['Tags']=_0x3459d8;delete _0x211712[_0x2ba3('0x15')];return updateInteractionCounters(_0x211712);})[_0x2ba3('0x10')](function(_0x4b7b78){if(_0x2ce042){return getLastMessageText(_0x4b7b78);}else{return _0x4b7b78;}})['then'](function(_0x58c3c7){_0x3c6756(_0x58c3c7);})[_0x2ba3('0x16')](function(_0x52e3aa){_0x3f14b6(_0x52e3aa);});});}; \ No newline at end of file diff --git a/server/components/interaction/utils.js b/server/components/interaction/utils.js index 9f38ac2..36bfe50 100644 --- a/server/components/interaction/utils.js +++ b/server/components/interaction/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8df8=['[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','findOne','then','catch','error','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','whatsapp-interactions','chat','Website','Account','capitalize','InteractionId','upperFirst','unknown','websites','accounts','_interactions','_interaction_has_tags','_messages','isArray','toLowerCase'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8df8,0xbd));var _0x88df=function(_0x55a0bf,_0x3f1235){_0x55a0bf=_0x55a0bf-0x0;var _0x20dfec=_0x8df8[_0x55a0bf];return _0x20dfec;};'use strict';var _=require(_0x88df('0x0'));var db=require(_0x88df('0x1'))['db'];var loggers={'openchannel':require(_0x88df('0x2'))(_0x88df('0x3')),'mail':require(_0x88df('0x2'))(_0x88df('0x4')),'fax':require('../../config/logger')(_0x88df('0x5')),'sms':require(_0x88df('0x2'))('sms-interactions'),'chat':require(_0x88df('0x2'))('chat-interactions'),'whatsapp':require(_0x88df('0x2'))(_0x88df('0x6'))};function getAccountFK(_0x175328){return _['capitalize'](_0x175328)+(_0x175328===_0x88df('0x7')?_0x88df('0x8'):_0x88df('0x9'))+'Id';}function getInteractionFK(_0x3a2903){return _[_0x88df('0xa')](_0x3a2903)+_0x88df('0xb');}function getInteractionId(_0x5e803b,_0x36c67f,_0x1db1a5){if(_0x5e803b&&_0x5e803b[_[_0x88df('0xc')](_0x1db1a5)+_0x88df('0xb')]){return _0x5e803b[_[_0x88df('0xc')](_0x1db1a5)+_0x88df('0xb')];}else if(_0x5e803b&&_0x5e803b['id']){return _0x5e803b['id'];}else if(_0x36c67f&&_0x36c67f['id']){return _0x36c67f['id'];}else{return _0x88df('0xd');}}function getInteractionsTables(_0xb56358){return{'accounts':_0xb56358+'_'+(_0xb56358==='chat'?_0x88df('0xe'):_0x88df('0xf')),'interactions':_0xb56358+_0x88df('0x10'),'interactionsTags':_0xb56358+_0x88df('0x11'),'messages':_0xb56358+_0x88df('0x12'),'userInteractions':'user_has_'+_0xb56358+_0x88df('0x10')};}function getSelectedTags(_0xce383f){var _0x248a0e=[];if(_0xce383f){_0x248a0e=Array[_0x88df('0x13')](_0xce383f)?_0xce383f:[_0xce383f];}return _0x248a0e;}function log(_0x5a3ff5,_0x334fef,_0x1e633b,_0x1926da,_0x350720,_0x58919c){loggers[_0x350720[_0x88df('0x14')]()][_0x5a3ff5](_0x88df('0x15'),_0x58919c[_0x88df('0x16')](),_0x334fef?_0x334fef['id']:null,_0x334fef?_0x334fef[_0x88df('0x17')]:null,_0x334fef?_0x334fef[_0x88df('0x18')]:null,getInteractionId(_0x1e633b,_0x1926da,_0x350720),_0x1e633b?JSON['stringify'](_0x1e633b):_0x88df('0x19'));}function updateUser(_0x5684ed,_0x341956,_0x145afe,_0x5e30a2,_0x3603b6){db[_[_0x88df('0xc')](_0x5e30a2)+'Interaction'][_0x88df('0x1a')]({'where':{'id':getInteractionId(_0x341956,_0x145afe,_0x5e30a2)}})['then'](function(_0x3c5c9c){if(_0x3c5c9c){return _0x3c5c9c['update']({'UserId':_0x5684ed?_0x5684ed['id']:null});}})[_0x88df('0x1b')](function(_0x381583){if(_0x381583){log('info',_0x5684ed,_0x341956,_0x145afe,_0x5e30a2,_0x3603b6);}})[_0x88df('0x1c')](function(){log(_0x88df('0x1d'),_0x5684ed,_0x341956,_0x145afe,_0x5e30a2,_0x3603b6);});}module['exports']={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file +var _0x551a=['exports','lodash','../../config/logger','mail-interactions','whatsapp-interactions','capitalize','chat','Website','Account','InteractionId','upperFirst','websites','accounts','_interactions','_interaction_has_tags','_messages','user_has_','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','stringify','null','Interaction','findOne','then','update','catch'];(function(_0xbb5122,_0x4e11c9){var _0x55c6dc=function(_0x4c30a2){while(--_0x4c30a2){_0xbb5122['push'](_0xbb5122['shift']());}};_0x55c6dc(++_0x4e11c9);}(_0x551a,0x16d));var _0xa551=function(_0x2d0134,_0x26661f){_0x2d0134=_0x2d0134-0x0;var _0xfd11d0=_0x551a[_0x2d0134];return _0xfd11d0;};'use strict';var _=require(_0xa551('0x0'));var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0xa551('0x1'))('openchannel-interactions'),'mail':require('../../config/logger')(_0xa551('0x2')),'fax':require(_0xa551('0x1'))('fax-interactions'),'sms':require('../../config/logger')('sms-interactions'),'chat':require(_0xa551('0x1'))('chat-interactions'),'whatsapp':require(_0xa551('0x1'))(_0xa551('0x3'))};function getAccountFK(_0xfb57ec){return _[_0xa551('0x4')](_0xfb57ec)+(_0xfb57ec===_0xa551('0x5')?_0xa551('0x6'):_0xa551('0x7'))+'Id';}function getInteractionFK(_0x1c215f){return _['capitalize'](_0x1c215f)+_0xa551('0x8');}function getInteractionId(_0x4acc8e,_0x5580c7,_0x2f4d11){if(_0x4acc8e&&_0x4acc8e[_[_0xa551('0x9')](_0x2f4d11)+_0xa551('0x8')]){return _0x4acc8e[_[_0xa551('0x9')](_0x2f4d11)+'InteractionId'];}else if(_0x4acc8e&&_0x4acc8e['id']){return _0x4acc8e['id'];}else if(_0x5580c7&&_0x5580c7['id']){return _0x5580c7['id'];}else{return'unknown';}}function getInteractionsTables(_0x175b3c){return{'accounts':_0x175b3c+'_'+(_0x175b3c===_0xa551('0x5')?_0xa551('0xa'):_0xa551('0xb')),'interactions':_0x175b3c+_0xa551('0xc'),'interactionsTags':_0x175b3c+_0xa551('0xd'),'messages':_0x175b3c+_0xa551('0xe'),'userInteractions':_0xa551('0xf')+_0x175b3c+_0xa551('0xc')};}function getSelectedTags(_0x4b8056){var _0x37513b=[];if(_0x4b8056){_0x37513b=Array['isArray'](_0x4b8056)?_0x4b8056:[_0x4b8056];}return _0x37513b;}function log(_0x2e55e1,_0x832ed4,_0x5b2b69,_0x3dcbd7,_0x154172,_0x1088e8){loggers[_0x154172['toLowerCase']()][_0x2e55e1](_0xa551('0x10'),_0x1088e8[_0xa551('0x11')](),_0x832ed4?_0x832ed4['id']:null,_0x832ed4?_0x832ed4['name']:null,_0x832ed4?_0x832ed4['role']:null,getInteractionId(_0x5b2b69,_0x3dcbd7,_0x154172),_0x5b2b69?JSON[_0xa551('0x12')](_0x5b2b69):_0xa551('0x13'));}function updateUser(_0x4da717,_0x25151a,_0x42d5c1,_0x261615,_0x47a8e5){db[_[_0xa551('0x9')](_0x261615)+_0xa551('0x14')][_0xa551('0x15')]({'where':{'id':getInteractionId(_0x25151a,_0x42d5c1,_0x261615)}})[_0xa551('0x16')](function(_0x2c651c){if(_0x2c651c){return _0x2c651c[_0xa551('0x17')]({'UserId':_0x4da717?_0x4da717['id']:null});}})['then'](function(_0x313660){if(_0x313660){log('info',_0x4da717,_0x25151a,_0x42d5c1,_0x261615,_0x47a8e5);}})[_0xa551('0x18')](function(){log('error',_0x4da717,_0x25151a,_0x42d5c1,_0x261615,_0x47a8e5);});}module[_0xa551('0x19')]={'getAccountFK':getAccountFK,'getInteractionFK':getInteractionFK,'getInteractionsTables':getInteractionsTables,'getSelectedTags':getSelectedTags,'updateUser':updateUser}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 7c1a7a5..d57345c 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 _0x280b=['catch','users','User','admin','user','isUserLimit','crypto','util','composable-middleware','../../config/environment','license','data1','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0x280b,0xd8));var _0xb280=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x280b[_0x2f5ac5];return _0x37c9a8;};'use strict';var crypto=require(_0xb280('0x0'));var util=require(_0xb280('0x1'));var compose=require(_0xb280('0x2'));var db=require('../../mysqldb')['db'];var config=require(_0xb280('0x3'));function getValueFromLicense(_0x2370fc,_0xe7c5f9){if(_0x2370fc&&_0xe7c5f9){if(_0xe7c5f9['data1']&&_0xe7c5f9[_0xb280('0x4')]){var _0xb5e7ba=_0xe7c5f9[_0xb280('0x5')];var _0x149565=_0xe7c5f9['license'];var _0x334cb8=_0xb5e7ba[_0xb280('0x6')]('-')[0x4];var _0xca6773=_0xb5e7ba['split']('-')[0x0];var _0x5eb558=crypto['createDecipher'](_0xb280('0x7'),util[_0xb280('0x8')](_0xb280('0x9'),_0x334cb8,_0xb5e7ba,_0xca6773));var _0x33a3b2=_0x5eb558[_0xb280('0xa')](_0x149565,_0xb280('0xb'),_0xb280('0xc'));_0x33a3b2+=_0x5eb558[_0xb280('0xd')]('utf8');var _0x41a90d=JSON[_0xb280('0xe')](_0x33a3b2);return _0x41a90d[_0xb280('0xf')](_0x2370fc)?_0x41a90d[_0x2370fc]:null;}}return null;}function isLimit(_0x35a91f,_0x5c1aa8,_0x413900,_0x512b3a){var _0x7842b8=_0x5c1aa8;return compose()[_0xb280('0x10')](function(_0x320a0d,_0x53bf91,_0x2acbaf){return db[_0xb280('0x11')][_0xb280('0x12')]({'where':{'id':0x1},'raw':!![]})[_0xb280('0x13')](function(_0x428625){var _0x3a49bc=getValueFromLicense(_0x35a91f,_0x428625);return _0x3a49bc?_0x3a49bc:_0x7842b8;})[_0xb280('0x13')](function(_0x504759){_0x7842b8=_0x504759;return _0x413900[_0xb280('0x14')](_0x512b3a);})['then'](function(_0x357688){if(_0x357688>=_0x7842b8){return _0x53bf91[_0xb280('0x15')](0x193)[_0xb280('0x16')]({'message':util[_0xb280('0x8')](_0xb280('0x17'),_0x35a91f)});}_0x2acbaf();})[_0xb280('0x18')](function(_0x30bcb2){_0x2acbaf(_0x30bcb2);});});}function isUserLimit(){return isLimit(_0xb280('0x19'),0x1,db[_0xb280('0x1a')],{'where':{'$or':[{'role':_0xb280('0x1b')},{'role':_0xb280('0x1c')}]}});}exports[_0xb280('0x1d')]=isUserLimit; \ No newline at end of file +var _0xf93c=['use','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','format','update','base64','utf8','final','parse'];(function(_0x12f023,_0x65d0fc){var _0xc152c2=function(_0x3b33ab){while(--_0x3b33ab){_0x12f023['push'](_0x12f023['shift']());}};_0xc152c2(++_0x65d0fc);}(_0xf93c,0x150));var _0xcf93=function(_0x494bb4,_0x25ccaa){_0x494bb4=_0x494bb4-0x0;var _0x58adbf=_0xf93c[_0x494bb4];return _0x58adbf;};'use strict';var crypto=require(_0xcf93('0x0'));var util=require(_0xcf93('0x1'));var compose=require(_0xcf93('0x2'));var db=require(_0xcf93('0x3'))['db'];var config=require(_0xcf93('0x4'));function getValueFromLicense(_0x96dde2,_0x2487bf){if(_0x96dde2&&_0x2487bf){if(_0x2487bf[_0xcf93('0x5')]&&_0x2487bf[_0xcf93('0x6')]){var _0x194817=_0x2487bf['data1'];var _0x20ffca=_0x2487bf[_0xcf93('0x6')];var _0x1fb265=_0x194817[_0xcf93('0x7')]('-')[0x4];var _0x541b5c=_0x194817['split']('-')[0x0];var _0x5673de=crypto[_0xcf93('0x8')]('aes-256-ctr',util[_0xcf93('0x9')]('%s:%s:%s',_0x1fb265,_0x194817,_0x541b5c));var _0xea9883=_0x5673de[_0xcf93('0xa')](_0x20ffca,_0xcf93('0xb'),_0xcf93('0xc'));_0xea9883+=_0x5673de[_0xcf93('0xd')](_0xcf93('0xc'));var _0x377237=JSON[_0xcf93('0xe')](_0xea9883);return _0x377237['hasOwnProperty'](_0x96dde2)?_0x377237[_0x96dde2]:null;}}return null;}function isLimit(_0x446ff5,_0x14aa31,_0x5174ec,_0x2ce2c4){var _0x1301d7=_0x14aa31;return compose()[_0xcf93('0xf')](function(_0x24385d,_0x30200d,_0x5ba721){return db['License'][_0xcf93('0x10')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x20f208){var _0x2579fa=getValueFromLicense(_0x446ff5,_0x20f208);return _0x2579fa?_0x2579fa:_0x1301d7;})[_0xcf93('0x11')](function(_0x2485ac){_0x1301d7=_0x2485ac;return _0x5174ec[_0xcf93('0x12')](_0x2ce2c4);})[_0xcf93('0x11')](function(_0x4e670b){if(_0x4e670b>=_0x1301d7){return _0x30200d[_0xcf93('0x13')](0x193)[_0xcf93('0x14')]({'message':util[_0xcf93('0x9')](_0xcf93('0x15'),_0x446ff5)});}_0x5ba721();})[_0xcf93('0x16')](function(_0x186353){_0x5ba721(_0x186353);});});}function isUserLimit(){return isLimit(_0xcf93('0x17'),0x1,db[_0xcf93('0x18')],{'where':{'$or':[{'role':_0xcf93('0x19')},{'role':_0xcf93('0x1a')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index fed5507..45aefe6 100644 --- a/server/components/parsers/advancedSearch.js +++ b/server/components/parsers/advancedSearch.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4f6=['value','includes','$gt','$lte','add','days','format','castTo','text','CAST(','field','\x20AS\x20','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<=\x20?','$gte','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','utcOffset','hours','lodash','parseSearch','sqlOperator','startsWith','and','replace','[$and]','[$or]','split','length','shift','match','forEach','filter','indexOf','map','push','buildExpression','DATE','$eq','operator'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf4f6,0xfe));var _0x6f4f=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xf4f6[_0x51020b];return _0x371e47;};'use strict';var _=require(_0x6f4f('0x0'));var moment=require('moment');exports[_0x6f4f('0x1')]=function(_0x26c117){var _0x5c5629={'conditions':[]};_0x5c5629[_0x6f4f('0x2')]=_[_0x6f4f('0x3')](_0x26c117,'[$or]')?'or':_0x6f4f('0x4');var _0x28b6f4=_0x26c117[_0x6f4f('0x5')](_0x6f4f('0x6'),'')[_0x6f4f('0x5')](_0x6f4f('0x7'),'')[_0x6f4f('0x8')]('||');for(var _0x3b0343=0x0;_0x3b0343<_0x28b6f4[_0x6f4f('0x9')];_0x3b0343++){var _0x489be2=_0x28b6f4[_0x3b0343][_0x6f4f('0x8')](':=');var _0x3b5027=_0x489be2[0x0];var _0x2c923f=_0x489be2['slice'](0x1);_0x2c923f['forEach'](function(_0x225e18){var _0x1b8369=_0x225e18[_0x6f4f('0x8')]('[')[_0x6f4f('0xa')]();var _0x49b8fe=_0x225e18[_0x6f4f('0xb')](/\[(.*?)\]/g);_0x49b8fe[_0x6f4f('0xc')](function(_0xa0d11a){var _0x29db70=_0xa0d11a[_0x6f4f('0x8')]('[')[_0x6f4f('0xd')](function(_0x3c44e9){return _0x3c44e9[_0x6f4f('0xe')](']')>-0x1;})[_0x6f4f('0xf')](function(_0x412cc1){return _0x412cc1['split'](']')[0x0];})[0x0];_0x5c5629['conditions'][_0x6f4f('0x10')]({'field':_0x3b5027,'operator':_0x1b8369,'value':_0x29db70});});});}return _0x5c5629;};exports[_0x6f4f('0x11')]=function(_0x4f324c,_0x4d4bbb,_0x41e7ea){var _0xa43581={};if(_0x4d4bbb===_0x6f4f('0x12')){if(_0x41e7ea['operator']===_0x6f4f('0x13')){_0x41e7ea[_0x6f4f('0x14')]='$between';_0x41e7ea[_0x6f4f('0x15')]+=','+_0x41e7ea[_0x6f4f('0x15')];}else if(_[_0x6f4f('0x16')]([_0x6f4f('0x17'),_0x6f4f('0x18')],_0x41e7ea['operator'])){_0x41e7ea[_0x6f4f('0x15')]=moment(_0x41e7ea[_0x6f4f('0x15')])[_0x6f4f('0x19')](0x1,_0x6f4f('0x1a'))[_0x6f4f('0x1b')]('YYYY-MM-DD');}}if(_0x41e7ea[_0x6f4f('0x1c')]){_0x4d4bbb=_0x41e7ea[_0x6f4f('0x1c')];_0xa43581[_0x6f4f('0x1d')]=_0x6f4f('0x1e')+_0x4f324c+'.'+_0x41e7ea[_0x6f4f('0x1f')]+_0x6f4f('0x20')+_0x41e7ea['castTo']+')\x20'+parseOperator(_0x41e7ea[_0x6f4f('0x14')]);}else{_0xa43581[_0x6f4f('0x1d')]=_0x4f324c+'.'+_0x41e7ea[_0x6f4f('0x1f')]+'\x20'+parseOperator(_0x41e7ea['operator']);}if(_[_0x6f4f('0x16')](['$ne',_0x6f4f('0x21')],_0x41e7ea[_0x6f4f('0x14')]))_0xa43581[_0x6f4f('0x1d')]='('+_0xa43581['text']+_0x6f4f('0x22')+_0x4f324c+'.'+_0x41e7ea['field']+_0x6f4f('0x23');_0xa43581[_0x6f4f('0x15')]=parseValue(_0x4d4bbb,_0x41e7ea[_0x6f4f('0x14')],_0x41e7ea[_0x6f4f('0x15')]);return _0xa43581;};function parseOperator(_0x44c37d){var _0x2be3fd;switch(_0x44c37d){case _0x6f4f('0x24'):_0x2be3fd=_0x6f4f('0x25');break;case _0x6f4f('0x21'):_0x2be3fd=_0x6f4f('0x26');break;case _0x6f4f('0x13'):_0x2be3fd=_0x6f4f('0x27');break;case _0x6f4f('0x28'):_0x2be3fd=_0x6f4f('0x29');break;case _0x6f4f('0x2a'):case _0x6f4f('0x2b'):case _0x6f4f('0x2c'):_0x2be3fd=_0x6f4f('0x2d');break;case _0x6f4f('0x2e'):_0x2be3fd='<\x20?';break;case _0x6f4f('0x17'):_0x2be3fd='>\x20?';break;case _0x6f4f('0x18'):_0x2be3fd=_0x6f4f('0x2f');break;case _0x6f4f('0x30'):_0x2be3fd=_0x6f4f('0x31');break;case _0x6f4f('0x32'):_0x2be3fd=_0x6f4f('0x33');break;}return _0x2be3fd;}function parseValue(_0x525dea,_0x4002e7,_0x1e09b0){var _0x1a0726={'start':undefined,'end':undefined};switch(_0x4002e7){case _0x6f4f('0x24'):case _0x6f4f('0x21'):_0x1a0726['start']=_0x1e09b0[_0x6f4f('0x8')](',');break;case _0x6f4f('0x2a'):_0x1a0726[_0x6f4f('0x34')]='%'+_0x1e09b0+'%';break;case _0x6f4f('0x2b'):_0x1a0726[_0x6f4f('0x34')]=_0x1e09b0+'%';break;case _0x6f4f('0x2c'):_0x1a0726['start']='%'+_0x1e09b0;break;case _0x6f4f('0x32'):var _0x53f09c=_0x1e09b0[_0x6f4f('0x8')](',');var _0x1e09b0=_0x53f09c['shift']();var _0x3493f5=_0x53f09c['pop']();if(_0x525dea==='DATE'){_0x1e09b0=moment(_0x1e09b0)['utcOffset'](0x0,!![])[_0x6f4f('0x1b')]();_0x3493f5=moment(_0x3493f5)[_0x6f4f('0x35')](0x0,!![])[_0x6f4f('0x19')](0x17,_0x6f4f('0x36'))[_0x6f4f('0x19')](0x3b,'minutes')[_0x6f4f('0x19')](0x3b,'seconds')['format']();}_0x1a0726={'start':_0x1e09b0,'end':_0x3493f5};break;default:_0x1a0726[_0x6f4f('0x34')]=_0x1e09b0;break;}return _0x1a0726;} \ No newline at end of file +var _0x4e96=['DATE','utcOffset','seconds','moment','startsWith','[$or]','and','replace','split','length','slice','forEach','filter','map','conditions','buildExpression','operator','$eq','$between','value','$gt','$lte','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','includes','$notIn','\x20OR\x20','$in','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$substring','LIKE\x20?','$lt','<\x20?','>\x20?','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','start','$startsWith','$endsWith','shift'];(function(_0x2d4421,_0x15a84f){var _0x2d3b01=function(_0xb9e94c){while(--_0xb9e94c){_0x2d4421['push'](_0x2d4421['shift']());}};_0x2d3b01(++_0x15a84f);}(_0x4e96,0x168));var _0x64e9=function(_0x2080c3,_0x7ea4e2){_0x2080c3=_0x2080c3-0x0;var _0x3cf5a2=_0x4e96[_0x2080c3];return _0x3cf5a2;};'use strict';var _=require('lodash');var moment=require(_0x64e9('0x0'));exports['parseSearch']=function(_0x45c0da){var _0x8b4a3f={'conditions':[]};_0x8b4a3f['sqlOperator']=_[_0x64e9('0x1')](_0x45c0da,_0x64e9('0x2'))?'or':_0x64e9('0x3');var _0x1f9f4e=_0x45c0da[_0x64e9('0x4')]('[$and]','')[_0x64e9('0x4')](_0x64e9('0x2'),'')[_0x64e9('0x5')]('||');for(var _0x235eca=0x0;_0x235eca<_0x1f9f4e[_0x64e9('0x6')];_0x235eca++){var _0x115fa3=_0x1f9f4e[_0x235eca][_0x64e9('0x5')](':=');var _0x474b96=_0x115fa3[0x0];var _0x2b283c=_0x115fa3[_0x64e9('0x7')](0x1);_0x2b283c[_0x64e9('0x8')](function(_0x55bda9){var _0x1898f0=_0x55bda9[_0x64e9('0x5')]('[')['shift']();var _0x5eaf8d=_0x55bda9['match'](/\[(.*?)\]/g);_0x5eaf8d['forEach'](function(_0x59e0a2){var _0x32d618=_0x59e0a2[_0x64e9('0x5')]('[')[_0x64e9('0x9')](function(_0x155ac4){return _0x155ac4['indexOf'](']')>-0x1;})[_0x64e9('0xa')](function(_0x18797a){return _0x18797a[_0x64e9('0x5')](']')[0x0];})[0x0];_0x8b4a3f[_0x64e9('0xb')]['push']({'field':_0x474b96,'operator':_0x1898f0,'value':_0x32d618});});});}return _0x8b4a3f;};exports[_0x64e9('0xc')]=function(_0x77b92e,_0x530d92,_0x1e81f8){var _0x53eda1={};if(_0x530d92==='DATE'){if(_0x1e81f8[_0x64e9('0xd')]===_0x64e9('0xe')){_0x1e81f8[_0x64e9('0xd')]=_0x64e9('0xf');_0x1e81f8[_0x64e9('0x10')]+=','+_0x1e81f8[_0x64e9('0x10')];}else if(_['includes']([_0x64e9('0x11'),_0x64e9('0x12')],_0x1e81f8[_0x64e9('0xd')])){_0x1e81f8[_0x64e9('0x10')]=moment(_0x1e81f8[_0x64e9('0x10')])[_0x64e9('0x13')](0x1,_0x64e9('0x14'))[_0x64e9('0x15')](_0x64e9('0x16'));}}if(_0x1e81f8[_0x64e9('0x17')]){_0x530d92=_0x1e81f8[_0x64e9('0x17')];_0x53eda1[_0x64e9('0x18')]=_0x64e9('0x19')+_0x77b92e+'.'+_0x1e81f8[_0x64e9('0x1a')]+_0x64e9('0x1b')+_0x1e81f8[_0x64e9('0x17')]+')\x20'+parseOperator(_0x1e81f8[_0x64e9('0xd')]);}else{_0x53eda1[_0x64e9('0x18')]=_0x77b92e+'.'+_0x1e81f8['field']+'\x20'+parseOperator(_0x1e81f8[_0x64e9('0xd')]);}if(_[_0x64e9('0x1c')](['$ne',_0x64e9('0x1d')],_0x1e81f8[_0x64e9('0xd')]))_0x53eda1[_0x64e9('0x18')]='('+_0x53eda1[_0x64e9('0x18')]+_0x64e9('0x1e')+_0x77b92e+'.'+_0x1e81f8[_0x64e9('0x1a')]+'\x20IS\x20NULL)';_0x53eda1['value']=parseValue(_0x530d92,_0x1e81f8[_0x64e9('0xd')],_0x1e81f8[_0x64e9('0x10')]);return _0x53eda1;};function parseOperator(_0x13a503){var _0x564f6a;switch(_0x13a503){case _0x64e9('0x1f'):_0x564f6a='IN\x20?';break;case _0x64e9('0x1d'):_0x564f6a=_0x64e9('0x20');break;case'$eq':_0x564f6a=_0x64e9('0x21');break;case _0x64e9('0x22'):_0x564f6a=_0x64e9('0x23');break;case _0x64e9('0x24'):case'$startsWith':case'$endsWith':_0x564f6a=_0x64e9('0x25');break;case _0x64e9('0x26'):_0x564f6a=_0x64e9('0x27');break;case _0x64e9('0x11'):_0x564f6a=_0x64e9('0x28');break;case _0x64e9('0x12'):_0x564f6a=_0x64e9('0x29');break;case'$gte':_0x564f6a=_0x64e9('0x2a');break;case _0x64e9('0xf'):_0x564f6a=_0x64e9('0x2b');break;}return _0x564f6a;}function parseValue(_0x291801,_0xfd59f4,_0x25eb3e){var _0x43f3f0={'start':undefined,'end':undefined};switch(_0xfd59f4){case _0x64e9('0x1f'):case _0x64e9('0x1d'):_0x43f3f0[_0x64e9('0x2c')]=_0x25eb3e[_0x64e9('0x5')](',');break;case _0x64e9('0x24'):_0x43f3f0[_0x64e9('0x2c')]='%'+_0x25eb3e+'%';break;case _0x64e9('0x2d'):_0x43f3f0[_0x64e9('0x2c')]=_0x25eb3e+'%';break;case _0x64e9('0x2e'):_0x43f3f0[_0x64e9('0x2c')]='%'+_0x25eb3e;break;case'$between':var _0x1f20e5=_0x25eb3e[_0x64e9('0x5')](',');var _0x25eb3e=_0x1f20e5[_0x64e9('0x2f')]();var _0x3f82d5=_0x1f20e5['pop']();if(_0x291801===_0x64e9('0x30')){_0x25eb3e=moment(_0x25eb3e)[_0x64e9('0x31')](0x0,!![])['format']();_0x3f82d5=moment(_0x3f82d5)[_0x64e9('0x31')](0x0,!![])[_0x64e9('0x13')](0x17,'hours')[_0x64e9('0x13')](0x3b,'minutes')['add'](0x3b,_0x64e9('0x32'))['format']();}_0x43f3f0={'start':_0x25eb3e,'end':_0x3f82d5};break;default:_0x43f3f0[_0x64e9('0x2c')]=_0x25eb3e;break;}return _0x43f3f0;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index b62ecbd..944e4b5 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 _0x2d17=['indexOf','unsigned','substr','priority','cast','col','length','omit','unset','match','^[+]?[0-9]*$','isEmail','forEach','replace','join','getOptions','query','$id','model','name','keys','intersection','attributes','hasOwnProperty','offset','order','where','pick','filter','object','columns','merge','VIRTUAL','lower','lodash','sequelize','parse','includes','fields','split','filters','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','format','YYYY-MM-DD','utc','$lte','subtract','uniqueid','isArray','limit','sort','map'];(function(_0x359345,_0x4f2e67){var _0x27de8d=function(_0x4b060d){while(--_0x4b060d){_0x359345['push'](_0x359345['shift']());}};_0x27de8d(++_0x4f2e67);}(_0x2d17,0x17e));var _0x72d1=function(_0x10dfb8,_0x5ab2e4){_0x10dfb8=_0x10dfb8-0x0;var _0x3ca55c=_0x2d17[_0x10dfb8];return _0x3ca55c;};'use strict';var _=require(_0x72d1('0x0'));var sequelize=require(_0x72d1('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x12f23c){var _0x4727f9=['ne'];try{var _0x531f4e=JSON[_0x72d1('0x2')](_0x12f23c);var _0x38fec7=Object['keys'](_0x531f4e)[0x0];return _0x4727f9[_0x72d1('0x3')](_0x38fec7);}catch(_0x4dfee1){return![];}}function getOperatorValue(_0x39150f){var _0x50f551=JSON[_0x72d1('0x2')](_0x39150f);var _0x239d1f=Object['keys'](_0x50f551)[0x0];var _0x477264=_0x50f551[_0x239d1f];return{['$'+_0x239d1f]:_0x477264};}exports[_0x72d1('0x4')]=function(_0x19e248){var _0x4e7f3e=null;if(_0x19e248){_0x4e7f3e=_0x19e248[_0x72d1('0x5')](',');}return _0x4e7f3e;};exports[_0x72d1('0x6')]=function(_0x283775,_0x593c91){var _0x1d7520={};if(!_[_0x72d1('0x7')](_0x283775)){_[_0x72d1('0x8')](_0x283775,function(_0x14a41e,_0x3cb9c2){try{if(_0x593c91){var _0x3916f2=_[_0x72d1('0x9')](_0x593c91,{'name':_0x3cb9c2})||{};if(hasSequelizeOperator(_0x14a41e)){_0x1d7520[_0x3cb9c2]=getOperatorValue(_0x14a41e);}else if(_0x3916f2[_0x72d1('0xa')]===_0x72d1('0xb')&&_[_0x72d1('0xc')](_0x14a41e)){var _0x5ad4df=JSON[_0x72d1('0x2')](_0x14a41e);var _0x37017c={'$gte':moment(moment(_0x5ad4df[_0x72d1('0xd')])[_0x72d1('0xe')](_0x72d1('0xf')))[_0x72d1('0x10')]()[_0x72d1('0xe')](),'$lte':moment(moment(_0x5ad4df[_0x72d1('0x11')])[_0x72d1('0xe')](_0x72d1('0xf')))[_0x72d1('0x10')]()[_0x72d1('0x12')](0x1,'s')[_0x72d1('0xe')]()};_0x1d7520[_0x3cb9c2]=_0x37017c;}else if(_0x3916f2['name']===_0x72d1('0x13')){_0x1d7520[_0x3cb9c2]=_0x14a41e;}else{_0x1d7520[_0x3cb9c2]=_['isArray'](_0x14a41e)?_0x14a41e:JSON[_0x72d1('0x2')](_0x14a41e);}}else{_0x1d7520[_0x3cb9c2]=_[_0x72d1('0x14')](_0x14a41e)?_0x14a41e:JSON['parse'](_0x14a41e);}}catch(_0x1061b7){_0x1d7520[_0x3cb9c2]=_0x14a41e[_0x72d1('0x5')](',');}});}return _0x1d7520;};exports[_0x72d1('0x15')]=function(_0x49caf4){_0x49caf4=parseInt(_0x49caf4,0xa);if(!_0x49caf4||_0x49caf4<0x0){_0x49caf4=LIMIT_VALUE;}return _0x49caf4;};exports['offset']=function(_0x313d7b){_0x313d7b=parseInt(_0x313d7b,0xa);if(!_0x313d7b||_0x313d7b<0x0){_0x313d7b=0x0;}return _0x313d7b;};exports[_0x72d1('0x16')]=function(_0x2233cb){var _0x1865c1,_0x8d6890=null;if(_0x2233cb){_0x1865c1=_0x2233cb[_0x72d1('0x5')](',');_0x8d6890=_[_0x72d1('0x17')](_0x1865c1,function(_0x5c7982){if(_0x5c7982[_0x72d1('0x18')]('-')===0x0){return[_0x5c7982==='priority'?sequelize['cast'](sequelize['col']('priority'),_0x72d1('0x19')):_0x5c7982[_0x72d1('0x1a')](0x1),'DESC'];}else{return[_0x5c7982===_0x72d1('0x1b')?sequelize[_0x72d1('0x1c')](sequelize[_0x72d1('0x1d')](_0x72d1('0x1b')),_0x72d1('0x19')):_0x5c7982,'ASC'];}});}return _0x8d6890;};exports['omit']=function(_0x188eca,_0x36bc65){if(_[_0x72d1('0x7')](_0x188eca)){return _0x188eca;}if(_[_0x72d1('0x14')](_0x188eca)){for(var _0xdf6a69=0x0;_0xdf6a69<_0x188eca[_0x72d1('0x1e')];_0xdf6a69+=0x1){_0x188eca[_0xdf6a69]=this[_0x72d1('0x1f')](_0x188eca[_0xdf6a69],_0x36bc65);}return _0x188eca;}if(!_['isObject'](_0x188eca)){return _0x188eca;}if(_['isString'](_0x36bc65)){_0x36bc65=[_0x36bc65];}if(!_[_0x72d1('0x14')](_0x36bc65)){return _0x188eca;}for(var _0x482cb8=0x0;_0x482cb8<_0x36bc65[_0x72d1('0x1e')];_0x482cb8+=0x1){_[_0x72d1('0x20')](_0x188eca,_0x36bc65[_0x482cb8]);}for(var _0x2c113d in _0x188eca){if(_0x188eca['hasOwnProperty'](_0x2c113d)){_0x188eca[_0x2c113d]=this[_0x72d1('0x1f')](_0x188eca[_0x2c113d],_0x36bc65);}}return _0x188eca;};exports['isNumeric']=function(_0x707cd0){return _0x707cd0[_0x72d1('0x21')](RegExp(_0x72d1('0x22')))?!![]:![];};exports[_0x72d1('0x23')]=function(_0x51242b){return _0x51242b[_0x72d1('0x21')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x42c03c){var _0x32dc5e=[];_0x42c03c['split'](/[ ,]+/)[_0x72d1('0x24')](function(_0x358b0c){_0x358b0c=_0x358b0c[_0x72d1('0x25')](/([^:]")"+/g,'$1');_0x358b0c='+'+_0x358b0c+'*';var _0x11ea2f=/[ `!@#$%^&*()_\-?~]/;if(_0x358b0c[_0x72d1('0x21')](_0x11ea2f))_0x358b0c='\x22'+_0x358b0c+'\x22';_0x32dc5e['push'](_0x358b0c);});return _0x32dc5e[_0x72d1('0x26')]('\x20');};exports[_0x72d1('0x27')]=function(_0x9efc2f,_0x482033,_0x244f4a){var _0x14669a={},_0x4a2909={};if(_0x482033[_0x72d1('0x28')][_0x72d1('0x29')]){_0x482033[_0x72d1('0x28')]['id']=_0x482033['query'][_0x72d1('0x29')];delete _0x482033['query'][_0x72d1('0x29')];}_0x14669a[_0x72d1('0x2a')]=_[_0x72d1('0x17')](_0x9efc2f,_0x72d1('0x2b'));_0x14669a[_0x72d1('0x28')]=_[_0x72d1('0x2c')](_0x482033[_0x72d1('0x28')]);_0x14669a[_0x72d1('0x6')]=_[_0x72d1('0x2d')](_0x14669a[_0x72d1('0x2a')],_0x14669a[_0x72d1('0x28')]);_0x4a2909['attributes']=_[_0x72d1('0x2d')](_0x14669a[_0x72d1('0x2a')],this[_0x72d1('0x4')](_0x482033[_0x72d1('0x28')]['fields']));_0x4a2909[_0x72d1('0x2e')]=_0x4a2909[_0x72d1('0x2e')][_0x72d1('0x1e')]?_0x4a2909['attributes']:_0x14669a[_0x72d1('0x2a')];if(!_0x482033[_0x72d1('0x28')][_0x72d1('0x2f')]('nolimit')){_0x4a2909[_0x72d1('0x15')]=this[_0x72d1('0x15')](_0x482033[_0x72d1('0x28')]['limit']);_0x4a2909[_0x72d1('0x30')]=this[_0x72d1('0x30')](_0x482033[_0x72d1('0x28')][_0x72d1('0x30')]);}_0x4a2909[_0x72d1('0x31')]=this[_0x72d1('0x16')](_0x482033[_0x72d1('0x28')]['sort']);_0x4a2909[_0x72d1('0x32')]=this[_0x72d1('0x6')](_[_0x72d1('0x33')](_0x482033[_0x72d1('0x28')],_0x14669a[_0x72d1('0x6')]),_0x9efc2f);if(_0x482033[_0x72d1('0x28')][_0x72d1('0x34')]){var _0x1d4fdf=_0x9efc2f;var _0x55438b=_0x482033[_0x72d1('0x28')][_0x72d1('0x34')];if(typeof _0x55438b===_0x72d1('0x35')){_0x1d4fdf=_[_0x72d1('0x34')](_0x9efc2f,function(_0x45870b){return _[_0x72d1('0x3')](_0x55438b[_0x72d1('0x36')],_0x45870b[_0x72d1('0x2b')]);});_0x55438b=_0x55438b['value'];}_0x4a2909['where']=_[_0x72d1('0x37')](_0x4a2909[_0x72d1('0x32')],{'$or':_[_0x72d1('0x17')](_0x1d4fdf,function(_0x21d361){if(_0x21d361['type']!==_0x72d1('0x38')){if(_0x244f4a){return sequelize[_0x72d1('0x32')](sequelize['fn']('lower',sequelize[_0x72d1('0x1d')](_0x21d361['name'])),{'$like':sequelize['fn'](_0x72d1('0x39'),'%'+_0x482033[_0x72d1('0x28')]['filter']+'%')});}else{var _0x37c69a={};_0x37c69a[_0x21d361['name']]={'$like':'%'+_0x482033['query']['filter']+'%'};return _0x37c69a;}}})});}_0x4a2909=_[_0x72d1('0x37')]({},_0x4a2909,_0x482033['options']);return _0x4a2909;}; \ No newline at end of file +var _0x24ca=['format','YYYY-MM-DD','utc','$lte','subtract','isArray','limit','offset','sort','indexOf','priority','cast','col','unsigned','DESC','ASC','omit','length','isObject','isString','unset','isNumeric','match','isEmail','push','getOptions','query','$id','model','map','name','filters','intersection','attributes','fields','hasOwnProperty','order','where','filter','columns','merge','type','VIRTUAL','lower','options','lodash','moment','parse','keys','includes','split','isEmpty','forOwn','find','DATE','isPlainObject','$gte'];(function(_0x1fb704,_0x3e5abb){var _0x194048=function(_0x278eaf){while(--_0x278eaf){_0x1fb704['push'](_0x1fb704['shift']());}};_0x194048(++_0x3e5abb);}(_0x24ca,0x1bc));var _0xa24c=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0x24ca[_0x2d91c6];return _0x3a8d19;};'use strict';var _=require(_0xa24c('0x0'));var sequelize=require('sequelize');var moment=require(_0xa24c('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4ebab4){var _0x4defb1=['ne'];try{var _0x5876d6=JSON[_0xa24c('0x2')](_0x4ebab4);var _0x8a54a0=Object[_0xa24c('0x3')](_0x5876d6)[0x0];return _0x4defb1[_0xa24c('0x4')](_0x8a54a0);}catch(_0xe76a30){return![];}}function getOperatorValue(_0x15a5cd){var _0xf0511=JSON[_0xa24c('0x2')](_0x15a5cd);var _0x2dd348=Object[_0xa24c('0x3')](_0xf0511)[0x0];var _0x9a5013=_0xf0511[_0x2dd348];return{['$'+_0x2dd348]:_0x9a5013};}exports['fields']=function(_0x42d89c){var _0x3a5727=null;if(_0x42d89c){_0x3a5727=_0x42d89c[_0xa24c('0x5')](',');}return _0x3a5727;};exports['filters']=function(_0x399f32,_0x325c6d){var _0x288f76={};if(!_[_0xa24c('0x6')](_0x399f32)){_[_0xa24c('0x7')](_0x399f32,function(_0x43aa5a,_0x1a71a8){try{if(_0x325c6d){var _0xc82af0=_[_0xa24c('0x8')](_0x325c6d,{'name':_0x1a71a8})||{};if(hasSequelizeOperator(_0x43aa5a)){_0x288f76[_0x1a71a8]=getOperatorValue(_0x43aa5a);}else if(_0xc82af0['type']===_0xa24c('0x9')&&_[_0xa24c('0xa')](_0x43aa5a)){var _0xcee4fe=JSON[_0xa24c('0x2')](_0x43aa5a);var _0x5a9486={'$gte':moment(moment(_0xcee4fe[_0xa24c('0xb')])[_0xa24c('0xc')](_0xa24c('0xd')))[_0xa24c('0xe')]()[_0xa24c('0xc')](),'$lte':moment(moment(_0xcee4fe[_0xa24c('0xf')])[_0xa24c('0xc')]('YYYY-MM-DD'))['utc']()[_0xa24c('0x10')](0x1,'s')[_0xa24c('0xc')]()};_0x288f76[_0x1a71a8]=_0x5a9486;}else if(_0xc82af0['name']==='uniqueid'){_0x288f76[_0x1a71a8]=_0x43aa5a;}else{_0x288f76[_0x1a71a8]=_[_0xa24c('0x11')](_0x43aa5a)?_0x43aa5a:JSON[_0xa24c('0x2')](_0x43aa5a);}}else{_0x288f76[_0x1a71a8]=_['isArray'](_0x43aa5a)?_0x43aa5a:JSON[_0xa24c('0x2')](_0x43aa5a);}}catch(_0x5de3e6){_0x288f76[_0x1a71a8]=_0x43aa5a[_0xa24c('0x5')](',');}});}return _0x288f76;};exports[_0xa24c('0x12')]=function(_0x1fcd4b){_0x1fcd4b=parseInt(_0x1fcd4b,0xa);if(!_0x1fcd4b||_0x1fcd4b<0x0){_0x1fcd4b=LIMIT_VALUE;}return _0x1fcd4b;};exports[_0xa24c('0x13')]=function(_0x4ff97c){_0x4ff97c=parseInt(_0x4ff97c,0xa);if(!_0x4ff97c||_0x4ff97c<0x0){_0x4ff97c=0x0;}return _0x4ff97c;};exports[_0xa24c('0x14')]=function(_0x18b7e0){var _0x773f70,_0x4d4bab=null;if(_0x18b7e0){_0x773f70=_0x18b7e0['split'](',');_0x4d4bab=_['map'](_0x773f70,function(_0x4cd77e){if(_0x4cd77e[_0xa24c('0x15')]('-')===0x0){return[_0x4cd77e===_0xa24c('0x16')?sequelize[_0xa24c('0x17')](sequelize[_0xa24c('0x18')]('priority'),_0xa24c('0x19')):_0x4cd77e['substr'](0x1),_0xa24c('0x1a')];}else{return[_0x4cd77e===_0xa24c('0x16')?sequelize['cast'](sequelize[_0xa24c('0x18')](_0xa24c('0x16')),_0xa24c('0x19')):_0x4cd77e,_0xa24c('0x1b')];}});}return _0x4d4bab;};exports[_0xa24c('0x1c')]=function(_0x47e0eb,_0xec9167){if(_['isEmpty'](_0x47e0eb)){return _0x47e0eb;}if(_[_0xa24c('0x11')](_0x47e0eb)){for(var _0x3951ae=0x0;_0x3951ae<_0x47e0eb[_0xa24c('0x1d')];_0x3951ae+=0x1){_0x47e0eb[_0x3951ae]=this['omit'](_0x47e0eb[_0x3951ae],_0xec9167);}return _0x47e0eb;}if(!_[_0xa24c('0x1e')](_0x47e0eb)){return _0x47e0eb;}if(_[_0xa24c('0x1f')](_0xec9167)){_0xec9167=[_0xec9167];}if(!_[_0xa24c('0x11')](_0xec9167)){return _0x47e0eb;}for(var _0x314121=0x0;_0x314121<_0xec9167[_0xa24c('0x1d')];_0x314121+=0x1){_[_0xa24c('0x20')](_0x47e0eb,_0xec9167[_0x314121]);}for(var _0x39609a in _0x47e0eb){if(_0x47e0eb['hasOwnProperty'](_0x39609a)){_0x47e0eb[_0x39609a]=this[_0xa24c('0x1c')](_0x47e0eb[_0x39609a],_0xec9167);}}return _0x47e0eb;};exports[_0xa24c('0x21')]=function(_0x152120){return _0x152120[_0xa24c('0x22')](RegExp('^[+]?[0-9]*$'))?!![]:![];};exports[_0xa24c('0x23')]=function(_0xc96ce7){return _0xc96ce7[_0xa24c('0x22')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x15eaaf){var _0x3dcb1b=[];_0x15eaaf[_0xa24c('0x5')](/[ ,]+/)['forEach'](function(_0x245fb2){_0x245fb2=_0x245fb2['replace'](/([^:]")"+/g,'$1');_0x245fb2='+'+_0x245fb2+'*';var _0x1102ab=/[ `!@#$%^&*()_\-?~]/;if(_0x245fb2[_0xa24c('0x22')](_0x1102ab))_0x245fb2='\x22'+_0x245fb2+'\x22';_0x3dcb1b[_0xa24c('0x24')](_0x245fb2);});return _0x3dcb1b['join']('\x20');};exports[_0xa24c('0x25')]=function(_0x53f90,_0x1d0379,_0x52572f){var _0x1c1ed3={},_0x57c340={};if(_0x1d0379[_0xa24c('0x26')][_0xa24c('0x27')]){_0x1d0379['query']['id']=_0x1d0379['query'][_0xa24c('0x27')];delete _0x1d0379[_0xa24c('0x26')][_0xa24c('0x27')];}_0x1c1ed3[_0xa24c('0x28')]=_[_0xa24c('0x29')](_0x53f90,_0xa24c('0x2a'));_0x1c1ed3[_0xa24c('0x26')]=_['keys'](_0x1d0379[_0xa24c('0x26')]);_0x1c1ed3[_0xa24c('0x2b')]=_[_0xa24c('0x2c')](_0x1c1ed3[_0xa24c('0x28')],_0x1c1ed3[_0xa24c('0x26')]);_0x57c340[_0xa24c('0x2d')]=_[_0xa24c('0x2c')](_0x1c1ed3[_0xa24c('0x28')],this[_0xa24c('0x2e')](_0x1d0379[_0xa24c('0x26')]['fields']));_0x57c340[_0xa24c('0x2d')]=_0x57c340[_0xa24c('0x2d')][_0xa24c('0x1d')]?_0x57c340[_0xa24c('0x2d')]:_0x1c1ed3['model'];if(!_0x1d0379['query'][_0xa24c('0x2f')]('nolimit')){_0x57c340[_0xa24c('0x12')]=this[_0xa24c('0x12')](_0x1d0379[_0xa24c('0x26')][_0xa24c('0x12')]);_0x57c340[_0xa24c('0x13')]=this['offset'](_0x1d0379['query'][_0xa24c('0x13')]);}_0x57c340[_0xa24c('0x30')]=this[_0xa24c('0x14')](_0x1d0379[_0xa24c('0x26')][_0xa24c('0x14')]);_0x57c340[_0xa24c('0x31')]=this['filters'](_['pick'](_0x1d0379[_0xa24c('0x26')],_0x1c1ed3[_0xa24c('0x2b')]),_0x53f90);if(_0x1d0379[_0xa24c('0x26')][_0xa24c('0x32')]){var _0x43beff=_0x53f90;var _0x4c5b7e=_0x1d0379[_0xa24c('0x26')][_0xa24c('0x32')];if(typeof _0x4c5b7e==='object'){_0x43beff=_['filter'](_0x53f90,function(_0xba7407){return _[_0xa24c('0x4')](_0x4c5b7e[_0xa24c('0x33')],_0xba7407['name']);});_0x4c5b7e=_0x4c5b7e['value'];}_0x57c340[_0xa24c('0x31')]=_[_0xa24c('0x34')](_0x57c340[_0xa24c('0x31')],{'$or':_[_0xa24c('0x29')](_0x43beff,function(_0x3f640e){if(_0x3f640e[_0xa24c('0x35')]!==_0xa24c('0x36')){if(_0x52572f){return sequelize[_0xa24c('0x31')](sequelize['fn']('lower',sequelize['col'](_0x3f640e[_0xa24c('0x2a')])),{'$like':sequelize['fn'](_0xa24c('0x37'),'%'+_0x1d0379[_0xa24c('0x26')]['filter']+'%')});}else{var _0x472c1e={};_0x472c1e[_0x3f640e[_0xa24c('0x2a')]]={'$like':'%'+_0x1d0379[_0xa24c('0x26')][_0xa24c('0x32')]+'%'};return _0x472c1e;}}})});}_0x57c340=_[_0xa24c('0x34')]({},_0x57c340,_0x1d0379[_0xa24c('0x38')]);return _0x57c340;}; \ No newline at end of file diff --git a/server/components/realtime/agents.js b/server/components/realtime/agents.js index 6424906..d9ba25c 100644 --- a/server/components/realtime/agents.js +++ b/server/components/realtime/agents.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x87f3=['lodash','jayson/promise','client','http','chatPause','smsPause','voicePause','whatsappPause','filter','length','unknown','unavailable','ringing','isNil','voiceStatus','idle','pause','chatStatus','faxStatus','openchannelStatus','smsStatus','whatsappStatus','then','error','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','result','merge','*pause','busy','getAgentStatus','isArray','Queue','findOne','getAgents','flatten','map','uniq','value','getAgentIdsByStatus','resolve','includes','findAll','name','fullname','mailPause','pauseType','globalStatus','catch','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','internal','indexOf','validateSortParameter','sort','toLowerCase','sortAgentsByStatus','userpic','online','lastLoginAt','lastPauseAt','address','chatCapacity','openchannelCapacity','mailCapacity','smsCapacity','whatsappCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','mailStatus','chatStatusTime','openchannelStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','pick','filterAgentAttributes'];(function(_0xb1a876,_0x5d29d3){var _0x2a0e27=function(_0x6fb612){while(--_0x6fb612){_0xb1a876['push'](_0xb1a876['shift']());}};_0x2a0e27(++_0x5d29d3);}(_0x87f3,0xb8));var _0x387f=function(_0x4eec9b,_0x4aea09){_0x4eec9b=_0x4eec9b-0x0;var _0x2e3849=_0x87f3[_0x4eec9b];return _0x2e3849;};'use strict';var _=require(_0x387f('0x0'));var jayson=require(_0x387f('0x1'));var db=require('../../mysqldb')['db'];var amiClient=jayson[_0x387f('0x2')]['http']({'port':0x232a});var routingClient=jayson[_0x387f('0x2')][_0x387f('0x3')]({'port':0x232c});function isAgentPaused(_0x59be2c,_0x7d1240){var _0x49d129=[_0x59be2c[_0x387f('0x4')],_0x59be2c['faxPause'],_0x59be2c['mailPause'],_0x59be2c['openchannelPause'],_0x59be2c[_0x387f('0x5')],_0x59be2c[_0x387f('0x6')],_0x59be2c[_0x387f('0x7')]];if(!_0x7d1240)return _['every'](_0x49d129);var _0xb0e1fe=_[_0x387f('0x8')](_0x49d129);return _0xb0e1fe[_0x387f('0x9')]>0x0&&_0xb0e1fe[_0x387f('0x9')]<_0x49d129['length']?!![]:![];}function isIdle(_0x3d9e7a){return _0x3d9e7a==='idle'||_0x3d9e7a===_0x387f('0xa')||_0x3d9e7a===_0x387f('0xb')||_0x3d9e7a===_0x387f('0xc')||_[_0x387f('0xd')](_0x3d9e7a);}function isAgentIdle(_0x2e3b4f){if(_0x2e3b4f[_0x387f('0xe')]!==_0x387f('0xf')&&_0x2e3b4f[_0x387f('0x6')]){_0x2e3b4f[_0x387f('0xe')]=_0x387f('0x10');return![];}return _['every']([_0x2e3b4f[_0x387f('0x11')],_0x2e3b4f[_0x387f('0x12')],_0x2e3b4f['mailStatus'],_0x2e3b4f[_0x387f('0x13')],_0x2e3b4f[_0x387f('0x14')],_0x2e3b4f['voiceStatus'],_0x2e3b4f[_0x387f('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient['request']('Agents',{})[_0x387f('0x16')](function(_0x416770){if(_0x416770[_0x387f('0x17')]){throw new Error(_0x387f('0x18'));}var _0x185c0d=_0x416770['result'];return routingClient['request'](_0x387f('0x19'),{})['then'](function(_0x4638ba){if(_0x4638ba[_0x387f('0x17')]){throw new Error(_0x387f('0x1a'));}var _0x2d5f1d=_0x4638ba[_0x387f('0x1b')];return _[_0x387f('0x1c')]({},_0x185c0d,_0x2d5f1d);});})['catch'](function(_0x3093d3){throw _0x3093d3;});}exports['getRealtimeAgents']=getRealtimeAgents;function getAgentStatus(_0x5e0e47){var _0x3f8040=_0x387f('0xa');if(isAgentPaused(_0x5e0e47))_0x3f8040=_0x387f('0x10');else if(isAgentPaused(_0x5e0e47,!![]))_0x3f8040=_0x387f('0x1d');else if(isAgentIdle(_0x5e0e47))_0x3f8040=_0x387f('0xf');else _0x3f8040=_0x387f('0x1e');return _0x3f8040;}exports[_0x387f('0x1f')]=getAgentStatus;function getAgentIdsByQueues(_0x1c0dd0,_0x2b33a2){var _0x351943=_[_0x387f('0x20')](_0x1c0dd0)?_0x1c0dd0:[_0x1c0dd0];var _0x5aec3c=_['startCase'](_0x2b33a2)+_0x387f('0x21');var _0x2d4d04=_['map'](_0x351943,function(_0x2bc326){return db[_0x5aec3c][_0x387f('0x22')]({'where':{'id':_0x2bc326}})[_0x387f('0x16')](function(_0x4e4892){if(!_0x4e4892)return[];return _0x4e4892[_0x387f('0x23')]({'attributes':['id'],'raw':!![]});});});return Promise['all'](_0x2d4d04)['then'](function(_0x2167f9){var _0x22165b=_(_0x2167f9)[_0x387f('0x24')]()[_0x387f('0x25')]('id')[_0x387f('0x26')]()[_0x387f('0x27')]();return _0x22165b;});}exports['getAgentIdsByQueues']=getAgentIdsByQueues;function getAgentIdsByStatus(_0x3cbc50,_0x154460,_0x2af508){try{if(_0x154460['length']>0x0){_0x3cbc50=_0x3cbc50[_0x387f('0x8')](function(_0x4ed11c){return _0x154460['includes'](_0x4ed11c['id']);});}var _0xed497a=_0x3cbc50[_0x387f('0x8')](function(_0x1e481b){var _0x5bbe4f=_0x387f('0x1e');if(isAgentIdle(_0x1e481b)){_0x5bbe4f=_0x387f('0xf');}return _0x5bbe4f===_0x2af508;});return _['map'](_0xed497a,'id');}catch(_0xe7d8f3){throw _0xe7d8f3;}}exports[_0x387f('0x28')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x27c599,_0x524a33,_0x217063){return Promise[_0x387f('0x29')]()['then'](function(){if(_0x524a33['length']>0x0){_0x27c599=_0x27c599[_0x387f('0x8')](function(_0x28de64){return _0x524a33[_0x387f('0x2a')](_0x28de64['id']);});}return _0x27c599;})['then'](function(){return db['User'][_0x387f('0x2b')]({'attributes':['id',_0x387f('0x2c'),_0x387f('0x2d'),_0x387f('0x4'),'faxPause',_0x387f('0x2e'),'openchannelPause',_0x387f('0x5'),_0x387f('0x6'),_0x387f('0x7'),_0x387f('0x2f')],'where':{'id':{'$in':_['map'](_0x27c599,'id')}},'raw':!![]});})['then'](function(_0x347af0){return _0x347af0[_0x387f('0x25')](function(_0x143ff4){var _0x39fbf7=_['find'](_0x27c599,['id',_0x143ff4['id']]);var _0x10f7e1=filterAgentAttributes(_0x39fbf7);_[_0x387f('0x1c')](_0x143ff4,_0x10f7e1);_0x143ff4[_0x387f('0x30')]=getAgentStatus(_0x143ff4);return _0x143ff4;});})[_0x387f('0x16')](function(_0x51109a){var _0x37927b=sortAgentsByStatus(_0x51109a,_0x217063);return _['map'](_0x37927b,'id');})[_0x387f('0x31')](function(_0x2b53cb){throw _0x2b53cb;});}exports[_0x387f('0x32')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x1976db){var _0x52a714={'fields':[],'order':null};var _0x3f3402=_0x1976db[_0x387f('0x33')](',');_0x52a714[_0x387f('0x34')]=_[_0x387f('0x8')](_0x3f3402,function(_0x5301e5){if(!_0x5301e5[_0x387f('0x2a')]('globalStatus')){return!![];}_0x52a714[_0x387f('0x35')]=_[_0x387f('0x36')](_0x5301e5,'-')?_0x387f('0x37'):_0x387f('0x38');return![];});return _0x52a714;}exports[_0x387f('0x39')]=getUpdatedSortOptions;function validateSortParameter(_0x5d7c83){if(_0x5d7c83[_0x387f('0x2a')](_0x387f('0x2d'))&&!_0x5d7c83['includes'](_0x387f('0x3a'))){var _0x467dc7=_0x5d7c83['substring'](0x0,_0x5d7c83[_0x387f('0x3b')](_0x387f('0x2d')));_0x5d7c83+=','+_0x467dc7+_0x387f('0x3a');}return _0x5d7c83;}exports[_0x387f('0x3c')]=validateSortParameter;function sortAgentsByStatus(_0x136333,_0x5ce394){var _0x37a117=_0x136333[_0x387f('0x3d')](function(_0x586a54,_0x273270){if(_0x586a54[_0x387f('0x30')]===_0x273270[_0x387f('0x30')]){if(_0x586a54[_0x387f('0x30')]===_0x387f('0x10')){if(_0x5ce394===_0x387f('0x37')){return(_0x586a54[_0x387f('0x2f')]||'')<(_0x273270['pauseType']||'')||_0x586a54['fullname']['toLowerCase']()>_0x273270[_0x387f('0x2d')]['toLowerCase']()?0x1:-0x1;}else{return(_0x586a54[_0x387f('0x2f')]||'')<(_0x273270[_0x387f('0x2f')]||'')||_0x586a54[_0x387f('0x2d')][_0x387f('0x3e')]()>_0x273270[_0x387f('0x2d')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x5ce394==='DESC'){return _0x586a54[_0x387f('0x2d')][_0x387f('0x3e')]()<_0x273270[_0x387f('0x2d')][_0x387f('0x3e')]()?0x1:-0x1;}else{return _0x586a54[_0x387f('0x2d')][_0x387f('0x3e')]()<_0x273270['fullname'][_0x387f('0x3e')]()?-0x1:0x1;}}}else{if(_0x5ce394==='DESC'){return _0x586a54[_0x387f('0x30')]<_0x273270['globalStatus']?0x1:-0x1;}else{return _0x586a54['globalStatus']<_0x273270[_0x387f('0x30')]?-0x1:0x1;}}});return _0x37a117;}exports[_0x387f('0x3f')]=sortAgentsByStatus;function filterAgentAttributes(_0xa59612){var _0x46d372=[_0x387f('0x40'),_0x387f('0x41'),_0x387f('0x42'),_0x387f('0x43'),_0x387f('0x2f'),_0x387f('0x43'),_0x387f('0x3a'),_0x387f('0x44'),'chatPause','openchannelPause',_0x387f('0x2e'),'smsPause',_0x387f('0x7'),'faxPause','voicePause',_0x387f('0x45'),_0x387f('0x46'),_0x387f('0x47'),_0x387f('0x48'),_0x387f('0x49'),'faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity',_0x387f('0x4a'),_0x387f('0x4b'),_0x387f('0x4c'),_0x387f('0x4d'),'chatStatus',_0x387f('0x13'),_0x387f('0x4e'),_0x387f('0x14'),_0x387f('0x15'),'faxStatus',_0x387f('0xe'),_0x387f('0x4f'),_0x387f('0x50'),'mailStatusTime','smsStatusTime',_0x387f('0x51'),_0x387f('0x52'),_0x387f('0x53'),_0x387f('0x54'),_0x387f('0x55'),_0x387f('0x56'),_0x387f('0x57'),_0x387f('0x58'),_0x387f('0x59')];var _0x4c608c=[_0x387f('0x4'),'openchannelPause','mailPause',_0x387f('0x5'),_0x387f('0x7'),'faxPause',_0x387f('0x6'),_0x387f('0x41')];var _0x39e596=_(_0xa59612)['omit'](_0x4c608c)[_0x387f('0x5a')](_0x46d372)[_0x387f('0x27')]();return _0x39e596;}exports[_0x387f('0x5b')]=filterAgentAttributes; \ No newline at end of file +var _0x010b=['then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','error','merge','catch','getRealtimeAgents','pause','*pause','busy','getAgentStatus','isArray','Queue','map','findOne','getAgents','all','flatten','uniq','value','getAgentIdsByQueues','includes','getAgentIdsByStatus','resolve','User','findAll','name','fullname','chatPause','faxPause','openchannelPause','find','getSortedAgentsIdsByStatus','split','fields','order','startsWith','DESC','ASC','getUpdatedSortOptions','internal','substring','indexOf','validateSortParameter','sort','globalStatus','pauseType','toLowerCase','sortAgentsByStatus','online','lastLoginAt','lastPauseAt','address','chatCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','faxStatus','openchannelStatusTime','smsStatusTime','whatsappStatusTime','queue','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','pick','filterAgentAttributes','lodash','jayson/promise','../../mysqldb','client','http','mailPause','smsPause','voicePause','whatsappPause','every','filter','length','idle','unknown','ringing','isNil','voiceStatus','chatStatus','mailStatus','openchannelStatus','smsStatus','whatsappStatus','request','Agents'];(function(_0x3a118f,_0xb04e94){var _0x4247a1=function(_0x3e16b9){while(--_0x3e16b9){_0x3a118f['push'](_0x3a118f['shift']());}};_0x4247a1(++_0xb04e94);}(_0x010b,0xac));var _0xb010=function(_0x47b6da,_0x5848a4){_0x47b6da=_0x47b6da-0x0;var _0x4a239b=_0x010b[_0x47b6da];return _0x4a239b;};'use strict';var _=require(_0xb010('0x0'));var jayson=require(_0xb010('0x1'));var db=require(_0xb010('0x2'))['db'];var amiClient=jayson[_0xb010('0x3')]['http']({'port':0x232a});var routingClient=jayson[_0xb010('0x3')][_0xb010('0x4')]({'port':0x232c});function isAgentPaused(_0x4a8720,_0x495a89){var _0x3a3721=[_0x4a8720['chatPause'],_0x4a8720['faxPause'],_0x4a8720[_0xb010('0x5')],_0x4a8720['openchannelPause'],_0x4a8720[_0xb010('0x6')],_0x4a8720[_0xb010('0x7')],_0x4a8720[_0xb010('0x8')]];if(!_0x495a89)return _[_0xb010('0x9')](_0x3a3721);var _0x5804f4=_[_0xb010('0xa')](_0x3a3721);return _0x5804f4[_0xb010('0xb')]>0x0&&_0x5804f4[_0xb010('0xb')]<_0x3a3721[_0xb010('0xb')]?!![]:![];}function isIdle(_0x310ab2){return _0x310ab2===_0xb010('0xc')||_0x310ab2===_0xb010('0xd')||_0x310ab2==='unavailable'||_0x310ab2===_0xb010('0xe')||_[_0xb010('0xf')](_0x310ab2);}function isAgentIdle(_0x421fec){if(_0x421fec[_0xb010('0x10')]!==_0xb010('0xc')&&_0x421fec[_0xb010('0x7')]){_0x421fec['voiceStatus']='pause';return![];}return _[_0xb010('0x9')]([_0x421fec[_0xb010('0x11')],_0x421fec['faxStatus'],_0x421fec[_0xb010('0x12')],_0x421fec[_0xb010('0x13')],_0x421fec[_0xb010('0x14')],_0x421fec[_0xb010('0x10')],_0x421fec[_0xb010('0x15')]],isIdle);}function getRealtimeAgents(){return amiClient[_0xb010('0x16')](_0xb010('0x17'),{})[_0xb010('0x18')](function(_0x232770){if(_0x232770['error']){throw new Error(_0xb010('0x19'));}var _0xe272e1=_0x232770[_0xb010('0x1a')];return routingClient[_0xb010('0x16')](_0xb010('0x17'),{})['then'](function(_0x27d814){if(_0x27d814[_0xb010('0x1b')]){throw new Error('Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)');}var _0x16ab3e=_0x27d814[_0xb010('0x1a')];return _[_0xb010('0x1c')]({},_0xe272e1,_0x16ab3e);});})[_0xb010('0x1d')](function(_0x5d0b56){throw _0x5d0b56;});}exports[_0xb010('0x1e')]=getRealtimeAgents;function getAgentStatus(_0x317ed8){var _0x359eaf=_0xb010('0xd');if(isAgentPaused(_0x317ed8))_0x359eaf=_0xb010('0x1f');else if(isAgentPaused(_0x317ed8,!![]))_0x359eaf=_0xb010('0x20');else if(isAgentIdle(_0x317ed8))_0x359eaf=_0xb010('0xc');else _0x359eaf=_0xb010('0x21');return _0x359eaf;}exports[_0xb010('0x22')]=getAgentStatus;function getAgentIdsByQueues(_0x278be5,_0x31e3a4){var _0x477a07=_[_0xb010('0x23')](_0x278be5)?_0x278be5:[_0x278be5];var _0x6a089f=_['startCase'](_0x31e3a4)+_0xb010('0x24');var _0x279cbd=_[_0xb010('0x25')](_0x477a07,function(_0xbc1f63){return db[_0x6a089f][_0xb010('0x26')]({'where':{'id':_0xbc1f63}})[_0xb010('0x18')](function(_0x5987a9){if(!_0x5987a9)return[];return _0x5987a9[_0xb010('0x27')]({'attributes':['id'],'raw':!![]});});});return Promise[_0xb010('0x28')](_0x279cbd)[_0xb010('0x18')](function(_0x4f9a72){var _0x1f2ddc=_(_0x4f9a72)[_0xb010('0x29')]()['map']('id')[_0xb010('0x2a')]()[_0xb010('0x2b')]();return _0x1f2ddc;});}exports[_0xb010('0x2c')]=getAgentIdsByQueues;function getAgentIdsByStatus(_0x422e24,_0x73dcc,_0x2dfc9f){try{if(_0x73dcc[_0xb010('0xb')]>0x0){_0x422e24=_0x422e24[_0xb010('0xa')](function(_0x2fb085){return _0x73dcc[_0xb010('0x2d')](_0x2fb085['id']);});}var _0x3a50e6=_0x422e24[_0xb010('0xa')](function(_0x39405a){var _0x28b69f='busy';if(isAgentIdle(_0x39405a)){_0x28b69f=_0xb010('0xc');}return _0x28b69f===_0x2dfc9f;});return _[_0xb010('0x25')](_0x3a50e6,'id');}catch(_0x901ea6){throw _0x901ea6;}}exports[_0xb010('0x2e')]=getAgentIdsByStatus;function getSortedAgentsIdsByStatus(_0x5ee61d,_0x54b139,_0x44ccc4){return Promise[_0xb010('0x2f')]()[_0xb010('0x18')](function(){if(_0x54b139[_0xb010('0xb')]>0x0){_0x5ee61d=_0x5ee61d['filter'](function(_0x2300f2){return _0x54b139[_0xb010('0x2d')](_0x2300f2['id']);});}return _0x5ee61d;})[_0xb010('0x18')](function(){return db[_0xb010('0x30')][_0xb010('0x31')]({'attributes':['id',_0xb010('0x32'),_0xb010('0x33'),_0xb010('0x34'),_0xb010('0x35'),_0xb010('0x5'),_0xb010('0x36'),_0xb010('0x6'),_0xb010('0x7'),_0xb010('0x8'),'pauseType'],'where':{'id':{'$in':_['map'](_0x5ee61d,'id')}},'raw':!![]});})['then'](function(_0x1fc279){return _0x1fc279['map'](function(_0x240f53){var _0x145955=_[_0xb010('0x37')](_0x5ee61d,['id',_0x240f53['id']]);var _0x2227a6=filterAgentAttributes(_0x145955);_[_0xb010('0x1c')](_0x240f53,_0x2227a6);_0x240f53['globalStatus']=getAgentStatus(_0x240f53);return _0x240f53;});})[_0xb010('0x18')](function(_0x2e7ae6){var _0x5239a0=sortAgentsByStatus(_0x2e7ae6,_0x44ccc4);return _['map'](_0x5239a0,'id');})[_0xb010('0x1d')](function(_0x4f396c){throw _0x4f396c;});}exports[_0xb010('0x38')]=getSortedAgentsIdsByStatus;function getUpdatedSortOptions(_0x5bbb8e){var _0x14ab37={'fields':[],'order':null};var _0x1f15c3=_0x5bbb8e[_0xb010('0x39')](',');_0x14ab37[_0xb010('0x3a')]=_[_0xb010('0xa')](_0x1f15c3,function(_0x3a38d1){if(!_0x3a38d1['includes']('globalStatus')){return!![];}_0x14ab37[_0xb010('0x3b')]=_[_0xb010('0x3c')](_0x3a38d1,'-')?_0xb010('0x3d'):_0xb010('0x3e');return![];});return _0x14ab37;}exports[_0xb010('0x3f')]=getUpdatedSortOptions;function validateSortParameter(_0x364a6a){if(_0x364a6a['includes'](_0xb010('0x33'))&&!_0x364a6a[_0xb010('0x2d')](_0xb010('0x40'))){var _0x4e55ae=_0x364a6a[_0xb010('0x41')](0x0,_0x364a6a[_0xb010('0x42')](_0xb010('0x33')));_0x364a6a+=','+_0x4e55ae+'internal';}return _0x364a6a;}exports[_0xb010('0x43')]=validateSortParameter;function sortAgentsByStatus(_0x10c59f,_0x3ed803){var _0x2789e4=_0x10c59f[_0xb010('0x44')](function(_0x50f071,_0x4301de){if(_0x50f071[_0xb010('0x45')]===_0x4301de[_0xb010('0x45')]){if(_0x50f071['globalStatus']===_0xb010('0x1f')){if(_0x3ed803===_0xb010('0x3d')){return(_0x50f071['pauseType']||'')<(_0x4301de[_0xb010('0x46')]||'')||_0x50f071['fullname'][_0xb010('0x47')]()>_0x4301de[_0xb010('0x33')]['toLowerCase']()?0x1:-0x1;}else{return(_0x50f071[_0xb010('0x46')]||'')<(_0x4301de[_0xb010('0x46')]||'')||_0x50f071[_0xb010('0x33')][_0xb010('0x47')]()>_0x4301de[_0xb010('0x33')]['toLowerCase']()?-0x1:0x1;}}else{if(_0x3ed803===_0xb010('0x3d')){return _0x50f071[_0xb010('0x33')][_0xb010('0x47')]()<_0x4301de[_0xb010('0x33')][_0xb010('0x47')]()?0x1:-0x1;}else{return _0x50f071[_0xb010('0x33')][_0xb010('0x47')]()<_0x4301de[_0xb010('0x33')][_0xb010('0x47')]()?-0x1:0x1;}}}else{if(_0x3ed803===_0xb010('0x3d')){return _0x50f071[_0xb010('0x45')]<_0x4301de[_0xb010('0x45')]?0x1:-0x1;}else{return _0x50f071[_0xb010('0x45')]<_0x4301de[_0xb010('0x45')]?-0x1:0x1;}}});return _0x2789e4;}exports[_0xb010('0x48')]=sortAgentsByStatus;function filterAgentAttributes(_0x3487b0){var _0x3b1d98=['userpic',_0xb010('0x49'),_0xb010('0x4a'),_0xb010('0x4b'),_0xb010('0x46'),_0xb010('0x4b'),'internal',_0xb010('0x4c'),_0xb010('0x34'),'openchannelPause',_0xb010('0x5'),_0xb010('0x6'),_0xb010('0x8'),_0xb010('0x35'),_0xb010('0x7'),_0xb010('0x4d'),'openchannelCapacity','mailCapacity','smsCapacity',_0xb010('0x4e'),_0xb010('0x4f'),_0xb010('0x50'),_0xb010('0x51'),_0xb010('0x52'),_0xb010('0x53'),_0xb010('0x54'),_0xb010('0x55'),_0xb010('0x11'),_0xb010('0x13'),'mailStatus',_0xb010('0x14'),_0xb010('0x15'),_0xb010('0x56'),'voiceStatus','chatStatusTime',_0xb010('0x57'),'mailStatusTime',_0xb010('0x58'),_0xb010('0x59'),'faxStatusTime','voiceStatusTime',_0xb010('0x5a'),_0xb010('0x5b'),_0xb010('0x5c'),_0xb010('0x5d'),_0xb010('0x5e'),_0xb010('0x5f')];var _0x4abd6d=['chatPause',_0xb010('0x36'),_0xb010('0x5'),_0xb010('0x6'),'whatsappPause',_0xb010('0x35'),_0xb010('0x7'),_0xb010('0x49')];var _0x3f81b5=_(_0x3487b0)['omit'](_0x4abd6d)[_0xb010('0x60')](_0x3b1d98)[_0xb010('0x2b')]();return _0x3f81b5;}exports[_0xb010('0x61')]=filterAgentAttributes; \ No newline at end of file diff --git a/server/components/realtime/queues.js b/server/components/realtime/queues.js index 1a9ab71..76e5523 100644 --- a/server/components/realtime/queues.js +++ b/server/components/realtime/queues.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe082=['Trunk','startPredictive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','startCase','Queues','then','error','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','catch','inbound','concat','outbound','get','loggedIn','voice','find','merge','initializeQueues','jayson/promise','util','client','http','available','paused','busy','inUse','loggedInDb','onHold','ringInUse','talking','unavailable','unknown','pTalking','originated','message','statusMessage','dialActive','dialMethod'];(function(_0x334b4d,_0x5c6c01){var _0x1662a6=function(_0x377511){while(--_0x377511){_0x334b4d['push'](_0x334b4d['shift']());}};_0x1662a6(++_0x5c6c01);}(_0xe082,0x143));var _0x2e08=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0xe082[_0x307d86];return _0x361745;};'use strict';var _=require('lodash');var jayson=require(_0x2e08('0x0'));var util=require(_0x2e08('0x1'));var amiClient=jayson[_0x2e08('0x2')][_0x2e08('0x3')]({'port':0x232a});var routingClient=jayson[_0x2e08('0x2')][_0x2e08('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x2e08('0x4'),'loggedIn',_0x2e08('0x5'),'waiting'];var VOICE_QUEUE_ATTRIBUTES=[_0x2e08('0x6'),_0x2e08('0x7'),'invalid',_0x2e08('0x8'),'notInUse',_0x2e08('0x9'),'ringing',_0x2e08('0xa'),_0x2e08('0xb'),_0x2e08('0xc'),_0x2e08('0xd')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x2e08('0xe'),_0x2e08('0xf'),_0x2e08('0x10'),_0x2e08('0x11'),_0x2e08('0x12'),_0x2e08('0x13'),_0x2e08('0x14'),_0x2e08('0x15'),'startProgressive',_0x2e08('0x16'),_0x2e08('0x17'),'erlangAbandonmentRate',_0x2e08('0x18'),_0x2e08('0x19'),'dialPredictiveIntervalMaxThreshold',_0x2e08('0x1a'),'predictiveIntervalAvailable',_0x2e08('0x1b'),_0x2e08('0x1c'),_0x2e08('0x1d'),_0x2e08('0x1e'),_0x2e08('0x1f'),_0x2e08('0x20')];function getRealtimeQueues(_0x59b451,_0x4d9486){var _0x24b905=_0x4d9486==='voice'?amiClient:routingClient;return _0x24b905['request'](_[_0x2e08('0x21')](_0x4d9486)+_0x2e08('0x22'),_0x59b451)[_0x2e08('0x23')](function(_0x35ee2c){if(_0x35ee2c[_0x2e08('0x24')])throw new Error(util['format'](_0x2e08('0x25'),_0x4d9486));return _0x35ee2c[_0x2e08('0x26')];})[_0x2e08('0x27')](function(_0x24c3ce){throw _0x24c3ce;});}exports['getRealtimeQueues']=getRealtimeQueues;function initializeQueues(_0x2281f2,_0x48e4d2,_0x907362,_0x577f88){var _0x70e962=DEFAULT_QUEUE_ATTRIBUTES;if(_0x907362==='voice'){if(_0x577f88===_0x2e08('0x28')){_0x70e962=_0x70e962[_0x2e08('0x29')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x577f88===_0x2e08('0x2a')){_0x70e962=_0x70e962[_0x2e08('0x29')](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x2281f2['map'](function(_0x1de401){var _0x4323eb=_0x1de401[_0x2e08('0x2b')]({'plain':!![]});_0x4323eb[_0x2e08('0x5')]=0x0;_0x4323eb['loggedInDb']=0x0;_0x4323eb[_0x2e08('0x2c')]=0x0;_0x4323eb[_0x2e08('0x4')]=0x0;_0x4323eb['waiting']=0x0;if(_0x907362===_0x2e08('0x2d')){_0x4323eb[_0x2e08('0xb')]=0x0;_0x4323eb['busy']=0x0;if(_0x577f88===_0x2e08('0x2a')){_0x4323eb['pTalking']=0x0;_0x4323eb['originated']=0x0;}}var _0x4316a7=_[_0x2e08('0x2e')](_0x48e4d2,['id',_0x4323eb['id']]);if(_0x4316a7){_[_0x2e08('0x2f')](_0x4323eb,_['pick'](_0x4316a7,_0x70e962));}return _0x4323eb;});}exports[_0x2e08('0x30')]=initializeQueues; \ No newline at end of file +var _0x9488=['available','loggedIn','paused','waiting','busy','inUse','invalid','loggedInDb','notInUse','talking','unknown','pTalking','message','statusMessage','dialActive','dialMethod','Trunk','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsTimeout','voice','request','startCase','Queues','then','error','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','getRealtimeQueues','inbound','concat','outbound','map','get','find','merge','pick','initializeQueues','jayson/promise','util','client','http'];(function(_0x217fcd,_0x32ed22){var _0x4bc114=function(_0x331b3e){while(--_0x331b3e){_0x217fcd['push'](_0x217fcd['shift']());}};_0x4bc114(++_0x32ed22);}(_0x9488,0xc0));var _0x8948=function(_0x5ea611,_0x51dc9f){_0x5ea611=_0x5ea611-0x0;var _0x5a8ed6=_0x9488[_0x5ea611];return _0x5a8ed6;};'use strict';var _=require('lodash');var jayson=require(_0x8948('0x0'));var util=require(_0x8948('0x1'));var amiClient=jayson[_0x8948('0x2')][_0x8948('0x3')]({'port':0x232a});var routingClient=jayson[_0x8948('0x2')][_0x8948('0x3')]({'port':0x232c});var DEFAULT_QUEUE_ATTRIBUTES=[_0x8948('0x4'),_0x8948('0x5'),_0x8948('0x6'),_0x8948('0x7')];var VOICE_QUEUE_ATTRIBUTES=[_0x8948('0x8'),_0x8948('0x9'),_0x8948('0xa'),_0x8948('0xb'),_0x8948('0xc'),'onHold','ringing','ringInUse',_0x8948('0xd'),'unavailable',_0x8948('0xe')];var OUTBOUND_QUEUE_ATTRIBUTES=[_0x8948('0xf'),'originated',_0x8948('0x10'),_0x8948('0x11'),_0x8948('0x12'),_0x8948('0x13'),_0x8948('0x14'),'startPredictive',_0x8948('0x15'),_0x8948('0x16'),_0x8948('0x17'),_0x8948('0x18'),_0x8948('0x19'),_0x8948('0x1a'),_0x8948('0x1b'),_0x8948('0x1c'),_0x8948('0x1d'),_0x8948('0x1e'),'predictiveIntervalAnsweredCalls',_0x8948('0x1f'),'predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime'];function getRealtimeQueues(_0x346cb1,_0x43400f){var _0x31beb8=_0x43400f===_0x8948('0x20')?amiClient:routingClient;return _0x31beb8[_0x8948('0x21')](_[_0x8948('0x22')](_0x43400f)+_0x8948('0x23'),_0x346cb1)[_0x8948('0x24')](function(_0x386463){if(_0x386463[_0x8948('0x25')])throw new Error(util['format'](_0x8948('0x26'),_0x43400f));return _0x386463['result'];})['catch'](function(_0x1d7b93){throw _0x1d7b93;});}exports[_0x8948('0x27')]=getRealtimeQueues;function initializeQueues(_0x1f4852,_0x9d78f5,_0x5a6b4f,_0x702c80){var _0x3e3b3f=DEFAULT_QUEUE_ATTRIBUTES;if(_0x5a6b4f==='voice'){if(_0x702c80===_0x8948('0x28')){_0x3e3b3f=_0x3e3b3f[_0x8948('0x29')](VOICE_QUEUE_ATTRIBUTES);}else if(_0x702c80===_0x8948('0x2a')){_0x3e3b3f=_0x3e3b3f['concat'](VOICE_QUEUE_ATTRIBUTES,OUTBOUND_QUEUE_ATTRIBUTES);}}return _0x1f4852[_0x8948('0x2b')](function(_0x4fda69){var _0x142286=_0x4fda69[_0x8948('0x2c')]({'plain':!![]});_0x142286[_0x8948('0x6')]=0x0;_0x142286[_0x8948('0xb')]=0x0;_0x142286[_0x8948('0x5')]=0x0;_0x142286['available']=0x0;_0x142286['waiting']=0x0;if(_0x5a6b4f===_0x8948('0x20')){_0x142286[_0x8948('0xd')]=0x0;_0x142286[_0x8948('0x8')]=0x0;if(_0x702c80===_0x8948('0x2a')){_0x142286['pTalking']=0x0;_0x142286['originated']=0x0;}}var _0x553066=_[_0x8948('0x2d')](_0x9d78f5,['id',_0x142286['id']]);if(_0x553066){_[_0x8948('0x2e')](_0x142286,_[_0x8948('0x2f')](_0x553066,_0x3e3b3f));}return _0x142286;});}exports[_0x8948('0x30')]=initializeQueues; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 9c4446d..1a598d7 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['get','production','set','appPath','public','join','root','client','use','toISOString','split','static','views','/server/views','engine','html','ejs','urlencoded','50mb','json','initialize','express','method-override','cookie-parser','passport','./environment','default'];(function(_0x5e2489,_0x2fd8be){var _0xa87596=function(_0x3b348d){while(--_0x3b348d){_0x5e2489['push'](_0x5e2489['shift']());}};_0xa87596(++_0x2fd8be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var express=require(_0x0a9e('0x0'));var methodOverride=require(_0x0a9e('0x1'));var cookieParser=require(_0x0a9e('0x2'));var errorHandler=require('errorhandler');var path=require('path');var passport=require(_0x0a9e('0x3'));var cors=require('cors');var config=require(_0x0a9e('0x4'));exports[_0x0a9e('0x5')]=function(_0x2ab90b){var _0x991246=_0x2ab90b[_0x0a9e('0x6')]('env');if(_0x991246===_0x0a9e('0x7')){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path['join'](config['root'],_0x0a9e('0xa')));}if(_0x991246==='development'||_0x991246==='test'){_0x2ab90b[_0x0a9e('0x8')](_0x0a9e('0x9'),path[_0x0a9e('0xb')](config[_0x0a9e('0xc')],_0x0a9e('0xd')));_0x2ab90b[_0x0a9e('0xe')](errorHandler());}_0x2ab90b['set']('json\x20replacer',function(_0x527cdd,_0x4cfe67){if(this[_0x527cdd]instanceof Date){_0x4cfe67=this[_0x527cdd][_0x0a9e('0xf')]()[_0x0a9e('0x10')]('.')[0x0]+'Z';}return _0x4cfe67;});_0x2ab90b[_0x0a9e('0xe')](express[_0x0a9e('0x11')](_0x2ab90b[_0x0a9e('0x6')](_0x0a9e('0x9'))));_0x2ab90b['set'](_0x0a9e('0x12'),config[_0x0a9e('0xc')]+_0x0a9e('0x13'));_0x2ab90b[_0x0a9e('0x14')](_0x0a9e('0x15'),require(_0x0a9e('0x16'))['renderFile']);_0x2ab90b[_0x0a9e('0x8')]('view\x20engine',_0x0a9e('0x15'));_0x2ab90b['use'](express[_0x0a9e('0x17')]({'limit':_0x0a9e('0x18'),'extended':!![]}));_0x2ab90b['use'](express[_0x0a9e('0x19')]({'limit':'50mb'}));_0x2ab90b[_0x0a9e('0xe')](cors());_0x2ab90b[_0x0a9e('0xe')](methodOverride());_0x2ab90b[_0x0a9e('0xe')](cookieParser());_0x2ab90b[_0x0a9e('0xe')](passport[_0x0a9e('0x1a')]());}; \ No newline at end of file +var _0x9957=['root','public','test','join','client','use','json\x20replacer','toISOString','split','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','json','50mb','express','method-override','cookie-parser','errorhandler','passport','cors','./environment','default','get','env','production','set','appPath'];(function(_0x8ae98b,_0x155f88){var _0xc30bd4=function(_0x5ca462){while(--_0x5ca462){_0x8ae98b['push'](_0x8ae98b['shift']());}};_0xc30bd4(++_0x155f88);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var express=require(_0x7995('0x0'));var methodOverride=require(_0x7995('0x1'));var cookieParser=require(_0x7995('0x2'));var errorHandler=require(_0x7995('0x3'));var path=require('path');var passport=require(_0x7995('0x4'));var cors=require(_0x7995('0x5'));var config=require(_0x7995('0x6'));exports[_0x7995('0x7')]=function(_0x576d89){var _0x744bea=_0x576d89[_0x7995('0x8')](_0x7995('0x9'));if(_0x744bea===_0x7995('0xa')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path['join'](config[_0x7995('0xd')],_0x7995('0xe')));}if(_0x744bea==='development'||_0x744bea===_0x7995('0xf')){_0x576d89[_0x7995('0xb')](_0x7995('0xc'),path[_0x7995('0x10')](config[_0x7995('0xd')],_0x7995('0x11')));_0x576d89[_0x7995('0x12')](errorHandler());}_0x576d89['set'](_0x7995('0x13'),function(_0x41c652,_0x581f22){if(this[_0x41c652]instanceof Date){_0x581f22=this[_0x41c652][_0x7995('0x14')]()[_0x7995('0x15')]('.')[0x0]+'Z';}return _0x581f22;});_0x576d89[_0x7995('0x12')](express[_0x7995('0x16')](_0x576d89[_0x7995('0x8')](_0x7995('0xc'))));_0x576d89[_0x7995('0xb')]('views',config['root']+_0x7995('0x17'));_0x576d89[_0x7995('0x18')](_0x7995('0x19'),require(_0x7995('0x1a'))[_0x7995('0x1b')]);_0x576d89[_0x7995('0xb')](_0x7995('0x1c'),_0x7995('0x19'));_0x576d89['use'](express[_0x7995('0x1d')]({'limit':'50mb','extended':!![]}));_0x576d89[_0x7995('0x12')](express[_0x7995('0x1e')]({'limit':_0x7995('0x1f')}));_0x576d89[_0x7995('0x12')](cors());_0x576d89[_0x7995('0x12')](methodOverride());_0x576d89[_0x7995('0x12')](cookieParser());_0x576d89['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 154677c..d186d72 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 _0x4cef=['filter','IPv4','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','createHash','md5','update','hex','getUuid','licenseToken','test','win32','utf8','replace','hostname','macAddress','ipAddress','digest','substring','crypto','bimedia-machine-uuid','execSync','../environment','orderBy','length'];(function(_0x1abb09,_0x18ee91){var _0xea1c07=function(_0x38f42c){while(--_0x38f42c){_0x1abb09['push'](_0x1abb09['shift']());}};_0xea1c07(++_0x18ee91);}(_0x4cef,0x165));var _0xf4ce=function(_0x5b0a4a,_0x11a985){_0x5b0a4a=_0x5b0a4a-0x0;var _0x2ce5c6=_0x4cef[_0x5b0a4a];return _0x2ce5c6;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xf4ce('0x0'));var machine=require(_0xf4ce('0x1'));var exec=require('child_process')[_0xf4ce('0x2')];var config=require(_0xf4ce('0x3'));function getInterfaces(){var _0x2ed3e7=[];var _0xe2ad63=os['networkInterfaces']();var _0x154f81=_[_0xf4ce('0x4')](_['keys'](_0xe2ad63));for(var _0x209553=0x0;_0x209553<_0x154f81[_0xf4ce('0x5')];_0x209553++){var _0x705ae=_0xe2ad63[_0x154f81[_0x209553]][_0xf4ce('0x6')](function(_0x66c549){return _0x66c549['family']===_0xf4ce('0x7')&&_0x66c549[_0xf4ce('0x8')]===![];});_0x2ed3e7=_0x2ed3e7['concat'](_0x705ae);}return _0x2ed3e7;}function getFirstInterface(){var _0x50b496=_[_0xf4ce('0x9')](getInterfaces());return{'macAddress':_0x50b496&&_0x50b496['mac']?_0x50b496[_0xf4ce('0xa')]:_0xf4ce('0xb'),'ipAddress':_0x50b496&&_0x50b496['address']?_0x50b496[_0xf4ce('0xc')]:_0xf4ce('0xd')};}exports[_0xf4ce('0xe')]=getFirstInterface;function getCPUhash(){var _0x2ef959=_[_0xf4ce('0x4')](os[_0xf4ce('0xf')]()[_0xf4ce('0x10')](function(_0x3f7118){return _0x3f7118[_0xf4ce('0x11')];}))['join'](':');return crypto[_0xf4ce('0x12')](_0xf4ce('0x13'))[_0xf4ce('0x14')](_0x2ef959)['digest'](_0xf4ce('0x15'));}exports[_0xf4ce('0x16')]=function(){var _0x5178b4=os['platform']();var _0x523dfa=/[0-9a-f-]{36}/;if(config[_0xf4ce('0x17')]&&_0x523dfa[_0xf4ce('0x18')](config[_0xf4ce('0x17')])){return config[_0xf4ce('0x17')];}else if(_0x5178b4===_0xf4ce('0x19')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0xf4ce('0x1a')})[_0xf4ce('0x1b')]('\x0d\x0a','');}else{var _0x13343e=getFirstInterface();var _0x185338=getCPUhash();var _0x54c370=_0x185338+'|'+os[_0xf4ce('0x1c')]()+'|'+_0x13343e[_0xf4ce('0x1d')]+'|'+_0x13343e[_0xf4ce('0x1e')];var _0x481160=crypto[_0xf4ce('0x12')](_0xf4ce('0x13'))[_0xf4ce('0x14')](_0x54c370)[_0xf4ce('0x1f')](_0xf4ce('0x15'));return _0x481160[_0xf4ce('0x20')](0x0,0x8)+'-'+_0x481160['substring'](0x8,0xc)+'-'+_0x481160[_0xf4ce('0x20')](0xc,0x10)+'-'+_0x481160[_0xf4ce('0x20')](0x10,0x14)+'-'+_0x481160['substring'](0x14);}}; \ No newline at end of file +var _0xb7be=['../environment','networkInterfaces','keys','length','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','model','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken','test','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','ipAddress','substring','crypto','bimedia-machine-uuid','child_process'];(function(_0x357b6e,_0x12d5b8){var _0x41016f=function(_0x5e8c43){while(--_0x5e8c43){_0x357b6e['push'](_0x357b6e['shift']());}};_0x41016f(++_0x12d5b8);}(_0xb7be,0xf9));var _0xeb7b=function(_0x22ca59,_0x33db1f){_0x22ca59=_0x22ca59-0x0;var _0x4c875d=_0xb7be[_0x22ca59];return _0x4c875d;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xeb7b('0x0'));var machine=require(_0xeb7b('0x1'));var exec=require(_0xeb7b('0x2'))['execSync'];var config=require(_0xeb7b('0x3'));function getInterfaces(){var _0x162376=[];var _0x5d247f=os[_0xeb7b('0x4')]();var _0x5504dd=_['orderBy'](_[_0xeb7b('0x5')](_0x5d247f));for(var _0x4d8e06=0x0;_0x4d8e06<_0x5504dd[_0xeb7b('0x6')];_0x4d8e06++){var _0x36e6f7=_0x5d247f[_0x5504dd[_0x4d8e06]]['filter'](function(_0x17b704){return _0x17b704['family']===_0xeb7b('0x7')&&_0x17b704[_0xeb7b('0x8')]===![];});_0x162376=_0x162376[_0xeb7b('0x9')](_0x36e6f7);}return _0x162376;}function getFirstInterface(){var _0x2c5617=_[_0xeb7b('0xa')](getInterfaces());return{'macAddress':_0x2c5617&&_0x2c5617[_0xeb7b('0xb')]?_0x2c5617['mac']:_0xeb7b('0xc'),'ipAddress':_0x2c5617&&_0x2c5617['address']?_0x2c5617[_0xeb7b('0xd')]:_0xeb7b('0xe')};}exports[_0xeb7b('0xf')]=getFirstInterface;function getCPUhash(){var _0x42b450=_[_0xeb7b('0x10')](os[_0xeb7b('0x11')]()[_0xeb7b('0x12')](function(_0xf4cc01){return _0xf4cc01[_0xeb7b('0x13')];}))[_0xeb7b('0x14')](':');return crypto[_0xeb7b('0x15')](_0xeb7b('0x16'))[_0xeb7b('0x17')](_0x42b450)[_0xeb7b('0x18')](_0xeb7b('0x19'));}exports[_0xeb7b('0x1a')]=function(){var _0x1595f6=os[_0xeb7b('0x1b')]();var _0x5876e1=/[0-9a-f-]{36}/;if(config[_0xeb7b('0x1c')]&&_0x5876e1[_0xeb7b('0x1d')](config[_0xeb7b('0x1c')])){return config[_0xeb7b('0x1c')];}else if(_0x1595f6===_0xeb7b('0x1e')){return exec(_0xeb7b('0x1f'),{'encoding':_0xeb7b('0x20')})[_0xeb7b('0x21')]('\x0d\x0a','');}else{var _0x44e06d=getFirstInterface();var _0x212070=getCPUhash();var _0x5cc8f7=_0x212070+'|'+os['hostname']()+'|'+_0x44e06d['macAddress']+'|'+_0x44e06d[_0xeb7b('0x22')];var _0x459b8a=crypto[_0xeb7b('0x15')](_0xeb7b('0x16'))[_0xeb7b('0x17')](_0x5cc8f7)[_0xeb7b('0x18')](_0xeb7b('0x19'));return _0x459b8a[_0xeb7b('0x23')](0x0,0x8)+'-'+_0x459b8a[_0xeb7b('0x23')](0x8,0xc)+'-'+_0x459b8a['substring'](0xc,0x10)+'-'+_0x459b8a[_0xeb7b('0x23')](0x10,0x14)+'-'+_0x459b8a[_0xeb7b('0x23')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 1ac73c7..6b6d685 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 _0x60cd=['get','data1','data2','then','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','error','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','message','bluebird','version','./hardware','../logger','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch'];(function(_0x5216c1,_0x4559ba){var _0x37fb01=function(_0x194c3c){while(--_0x194c3c){_0x5216c1['push'](_0x5216c1['shift']());}};_0x37fb01(++_0x4559ba);}(_0x60cd,0xe0));var _0xd60c=function(_0xade468,_0xa07081){_0xade468=_0xade468-0x0;var _0x54a9dc=_0x60cd[_0xade468];return _0x54a9dc;};'use strict';var util=require('util');var moment=require('moment');var rp=require('request-promise');var BPromise=require(_0xd60c('0x0'));var pkginfo=require('pkginfo')(module,_0xd60c('0x1'));var db=require('../../mysqldb')['db'];var encryptor=require('../../components/encryptor');var hardware=require(_0xd60c('0x2'));var logger=require(_0xd60c('0x3'))('license');var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x642791){return new BPromise(function(_0x28a205,_0x58dbdb){var _0x545824=util[_0xd60c('0x4')](_0xd60c('0x5'),HOST,_0x642791,module[_0xd60c('0x6')]['version']);if(oldToken){_0x545824=util[_0xd60c('0x4')](_0xd60c('0x7'),HOST,_0x642791,module[_0xd60c('0x6')][_0xd60c('0x1')],oldToken);}var _0x20a2fe={'uri':_0x545824,'method':_0xd60c('0x8'),'timeout':0xea60,'json':!![]};return rp(_0x20a2fe)['then'](function(_0xa17420){_0x28a205(_0xa17420);})[_0xd60c('0x9')](function(_0x57c048){_0x58dbdb(_0x57c048);});});}function manageLicense(_0x3223d4,_0x343a8e){var _0xca684e=_0x343a8e[_0xd60c('0xa')]({'plain':!![]});if(!isOldTokenSent&&_0xca684e[_0xd60c('0xb')]!==_0x3223d4&&!_0xca684e[_0xd60c('0xc')]){oldToken=_0xca684e[_0xd60c('0xb')];}httpRequest(_0x3223d4)[_0xd60c('0xd')](function(_0x601259){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x601259[_0xd60c('0xe')]){isOldTokenSent=![];if(!_0xca684e[_0xd60c('0xf')]&&_0xca684e[_0xd60c('0xf')]!=_0x601259['license']||_0xca684e[_0xd60c('0xf')]&&_0xca684e[_0xd60c('0xc')]){logger[_0xd60c('0x10')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0xca684e[_0xd60c('0xf')]&&!_0xca684e[_0xd60c('0xc')]&&_0xca684e[_0xd60c('0xf')]!=_0x601259[_0xd60c('0xf')]){logger['info'](_0xd60c('0x11'));}if(_0xca684e[_0xd60c('0xf')]&&!_0xca684e[_0xd60c('0xc')]&&_0xca684e['license']==_0x601259[_0xd60c('0xf')]){return _0x343a8e;}return _0x343a8e[_0xd60c('0x12')]({'data1':_0x3223d4,'data2':null,'license':_0x601259['license']});}else{if(_0x601259['license']||_0xca684e[_0xd60c('0xf')]){if(!_0xca684e[_0xd60c('0xc')]){if(_0xca684e[_0xd60c('0xb')]==_0x3223d4){GRAY_PERIOD_REASON=_0xd60c('0x13');logger[_0xd60c('0x10')](_0xd60c('0x14'));}else{GRAY_PERIOD_REASON=_0xd60c('0x15');logger[_0xd60c('0x10')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0xca684e['data1'],_0x3223d4);}logger[_0xd60c('0x10')](_0xd60c('0x16'),GRAY_PERIOD_REASON[_0xd60c('0x17')](),moment()['format'](_0xd60c('0x18')));return _0x343a8e[_0xd60c('0x12')]({'data2':encryptor[_0xd60c('0x19')](moment()['format'](_0xd60c('0x18')))});}else{if(moment()[_0xd60c('0x1a')](encryptor[_0xd60c('0x1b')](_0xca684e[_0xd60c('0xc')]),_0xd60c('0x1c'))>DAYS){logger[_0xd60c('0x10')](_0xd60c('0x1d'),moment()[_0xd60c('0x4')](_0xd60c('0x18')));isOldTokenSent=![];return _0x343a8e[_0xd60c('0x12')]({'data1':_0x3223d4,'data2':null,'license':null});}}}else{if(_0xca684e[_0xd60c('0xb')]!=_0x3223d4){logger[_0xd60c('0x10')](_0xd60c('0x1e'),_0xca684e[_0xd60c('0xb')],_0x3223d4);return _0x343a8e[_0xd60c('0x12')]({'data1':_0x3223d4,'data2':null,'license':null});}}}return _0x343a8e;})[_0xd60c('0xd')](function(_0x234184){_0x343a8e=_0x234184;})['catch'](function(_0x26e1f4){logger[_0xd60c('0x1f')](_0x26e1f4['message']);})[_0xd60c('0x20')](function(){setTimeout(function(){manageLicense(hardware[_0xd60c('0x21')](),_0x343a8e);},TIME);});}function defaultLicense(){var _0x3f424c=hardware[_0xd60c('0x21')]();if(_0x3f424c){return db[_0xd60c('0x22')][_0xd60c('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x3f424c}})[_0xd60c('0x24')](function(_0x5f06cb,_0x19037b){logger[_0xd60c('0x10')](_0xd60c('0x25'),_0x3f424c);manageLicense(_0x3f424c,_0x5f06cb);})[_0xd60c('0x9')](function(_0x53390e){logger[_0xd60c('0x1f')](_0x53390e[_0xd60c('0x26')]);});}}exports['default']=defaultLicense; \ No newline at end of file +var _0x9b44=['get','data1','data2','active','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','update','encryptString','YYYY-MM-DD\x20HH:mm','decryptString','days','DEMO\x20START\x20AT\x20%s','catch','error','message','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','util','moment','bluebird','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','format','%s/api/servers/%s/check?version=%s','exports','then'];(function(_0x15e8f5,_0x9d644c){var _0x434d83=function(_0x160045){while(--_0x160045){_0x15e8f5['push'](_0x15e8f5['shift']());}};_0x434d83(++_0x9d644c);}(_0x9b44,0x13f));var _0x49b4=function(_0x1943d9,_0x245bb8){_0x1943d9=_0x1943d9-0x0;var _0x4b4f3f=_0x9b44[_0x1943d9];return _0x4b4f3f;};'use strict';var util=require(_0x49b4('0x0'));var moment=require(_0x49b4('0x1'));var rp=require('request-promise');var BPromise=require(_0x49b4('0x2'));var pkginfo=require(_0x49b4('0x3'))(module,_0x49b4('0x4'));var db=require(_0x49b4('0x5'))['db'];var encryptor=require(_0x49b4('0x6'));var hardware=require(_0x49b4('0x7'));var logger=require(_0x49b4('0x8'))(_0x49b4('0x9'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x111756){return new BPromise(function(_0x41ddf4,_0x1598d2){var _0x17547f=util[_0x49b4('0xa')](_0x49b4('0xb'),HOST,_0x111756,module[_0x49b4('0xc')][_0x49b4('0x4')]);if(oldToken){_0x17547f=util[_0x49b4('0xa')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x111756,module[_0x49b4('0xc')]['version'],oldToken);}var _0x4f5fe8={'uri':_0x17547f,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x4f5fe8)[_0x49b4('0xd')](function(_0x440cff){_0x41ddf4(_0x440cff);})['catch'](function(_0x7d952d){_0x1598d2(_0x7d952d);});});}function manageLicense(_0x2e2438,_0x1ef16a){var _0x51d489=_0x1ef16a[_0x49b4('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x51d489[_0x49b4('0xf')]!==_0x2e2438&&!_0x51d489[_0x49b4('0x10')]){oldToken=_0x51d489[_0x49b4('0xf')];}httpRequest(_0x2e2438)[_0x49b4('0xd')](function(_0x4b18c7){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x4b18c7[_0x49b4('0x11')]){isOldTokenSent=![];if(!_0x51d489[_0x49b4('0x9')]&&_0x51d489[_0x49b4('0x9')]!=_0x4b18c7[_0x49b4('0x9')]||_0x51d489[_0x49b4('0x9')]&&_0x51d489[_0x49b4('0x10')]){logger[_0x49b4('0x12')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x51d489[_0x49b4('0x9')]&&!_0x51d489[_0x49b4('0x10')]&&_0x51d489[_0x49b4('0x9')]!=_0x4b18c7[_0x49b4('0x9')]){logger[_0x49b4('0x12')](_0x49b4('0x13'));}if(_0x51d489[_0x49b4('0x9')]&&!_0x51d489[_0x49b4('0x10')]&&_0x51d489[_0x49b4('0x9')]==_0x4b18c7['license']){return _0x1ef16a;}return _0x1ef16a['update']({'data1':_0x2e2438,'data2':null,'license':_0x4b18c7[_0x49b4('0x9')]});}else{if(_0x4b18c7[_0x49b4('0x9')]||_0x51d489[_0x49b4('0x9')]){if(!_0x51d489[_0x49b4('0x10')]){if(_0x51d489['data1']==_0x2e2438){GRAY_PERIOD_REASON=_0x49b4('0x14');logger['info'](_0x49b4('0x15'));}else{GRAY_PERIOD_REASON=_0x49b4('0x16');logger[_0x49b4('0x12')](_0x49b4('0x17'),_0x51d489['data1'],_0x2e2438);}logger[_0x49b4('0x12')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()[_0x49b4('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x1ef16a[_0x49b4('0x18')]({'data2':encryptor[_0x49b4('0x19')](moment()['format'](_0x49b4('0x1a')))});}else{if(moment()['diff'](encryptor[_0x49b4('0x1b')](_0x51d489[_0x49b4('0x10')]),_0x49b4('0x1c'))>DAYS){logger[_0x49b4('0x12')](_0x49b4('0x1d'),moment()[_0x49b4('0xa')](_0x49b4('0x1a')));isOldTokenSent=![];return _0x1ef16a[_0x49b4('0x18')]({'data1':_0x2e2438,'data2':null,'license':null});}}}else{if(_0x51d489[_0x49b4('0xf')]!=_0x2e2438){logger[_0x49b4('0x12')](_0x49b4('0x17'),_0x51d489[_0x49b4('0xf')],_0x2e2438);return _0x1ef16a[_0x49b4('0x18')]({'data1':_0x2e2438,'data2':null,'license':null});}}}return _0x1ef16a;})[_0x49b4('0xd')](function(_0x55c843){_0x1ef16a=_0x55c843;})[_0x49b4('0x1e')](function(_0x3661a6){logger[_0x49b4('0x1f')](_0x3661a6[_0x49b4('0x20')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x49b4('0x21')](),_0x1ef16a);},TIME);});}function defaultLicense(){var _0x2241d8=hardware['getUuid']();if(_0x2241d8){return db[_0x49b4('0x22')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x2241d8}})[_0x49b4('0x23')](function(_0x447f09,_0x21970c){logger[_0x49b4('0x12')](_0x49b4('0x24'),_0x2241d8);manageLicense(_0x2241d8,_0x447f09);})[_0x49b4('0x1e')](function(_0x3ff784){logger['error'](_0x3ff784[_0x49b4('0x20')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index d3b841c..23e0d18 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 _0x3147=['forEach','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','Demo\x20license','getUuid','2027-01-01T00:00:00.000Z','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','gray','add','days','grayReason','message','User','findAll','role','sequelize','COUNT','col','count','admin','user','telephone','users','telephones'];(function(_0x2b871b,_0x2ced5d){var _0x36918b=function(_0x101552){while(--_0x101552){_0x2b871b['push'](_0x2b871b['shift']());}};_0x36918b(++_0x2ced5d);}(_0x3147,0xc9));var _0x7314=function(_0xb80b68,_0x1180b1){_0xb80b68=_0xb80b68-0x0;var _0x173d69=_0x3147[_0xb80b68];return _0x173d69;};'use strict';var util=require(_0x7314('0x0'));var _=require(_0x7314('0x1'));var moment=require(_0x7314('0x2'));var BPromise=require(_0x7314('0x3'));var hardware=require(_0x7314('0x4'));var encryptor=require('../../components/encryptor');var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x7314('0x5'),'machineUuid':hardware[_0x7314('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x7314('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x7314('0x8'),'machineUuid':hardware[_0x7314('0x6')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x7abbf2){return new BPromise(function(_0x37dfb9,_0x147cec){return db[_0x7314('0x9')][_0x7314('0xa')](_[_0x7314('0xb')](_0x7abbf2,{'raw':!![],'where':{'id':0x1}}))[_0x7314('0xc')](function(_0x1bfac4){return checkLicense(_0x1bfac4,null);})['then'](function(_0x363aaa){_0x37dfb9(_0x363aaa);return;})[_0x7314('0xd')](function(_0x379481){_0x147cec(_0x379481);});});}function checkLicense(_0x2208f0,_0x4c040e){if(!_0x2208f0){demoLicense[_0x7314('0xe')]=_0x2208f0[_0x7314('0xf')];return demoLicense;}try{var _0x33681a=_0x4c040e||_0x2208f0[_0x7314('0x10')];if(_[_0x7314('0x11')](_0x33681a)){throw new Error(_0x7314('0x12'));}var _0x1e7011=_0x2208f0[_0x7314('0xf')];var _0x39a06e=_0x2208f0[_0x7314('0x13')];var _0x437a08=_0x1e7011[_0x7314('0x14')]('-')[0x4];var _0x17b4fe=_0x1e7011[_0x7314('0x14')]('-')[0x0];var _0x2ddfc5=encryptor[_0x7314('0x15')](_0x33681a,util[_0x7314('0x16')](_0x7314('0x17'),_0x437a08,_0x1e7011,_0x17b4fe));var _0x1b9096=JSON[_0x7314('0x18')](_0x2ddfc5);_0x1b9096[_0x7314('0x19')]=![];_0x1b9096[_0x7314('0xe')]=_0x1e7011;_0x1b9096[_0x7314('0x1a')]=hardware[_0x7314('0x6')]();if(_0x39a06e){var _0x24884c=encryptor[_0x7314('0x15')](_0x39a06e);_0x1b9096[_0x7314('0x1b')]=_0x24884c;_0x1b9096['deadline']=moment(_0x24884c)[_0x7314('0x1c')](0x7,_0x7314('0x1d'))['format']();_0x1b9096[_0x7314('0x1e')]=_0x1b9096[_0x7314('0xe')]!=_0x1b9096['machineUuid']?'changed':'disabled';}return _0x1b9096;}catch(_0x1874e2){breakingLicense[_0x7314('0xe')]=_0x2208f0[_0x7314('0xf')];breakingLicense[_0x7314('0x1f')]=_0x1874e2[_0x7314('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x42f900,_0x24093e){getLicense()['then'](function(_0x4e3f6e){return db[_0x7314('0x20')][_0x7314('0x21')]({'attributes':[_0x7314('0x22'),[db[_0x7314('0x23')]['fn'](_0x7314('0x24'),db[_0x7314('0x23')][_0x7314('0x25')](_0x7314('0x22'))),_0x7314('0x26')]],'group':_0x7314('0x22'),'where':{'role':{'$or':[_0x7314('0x27'),_0x7314('0x28'),_0x7314('0x29')]}},'raw':!![]})['then'](function(_0x2e9b41){var _0x12f09e={'user':_0x4e3f6e[_0x7314('0x2a')]||0x0,'telephone':_0x4e3f6e[_0x7314('0x2b')]||0x0};_0x2e9b41[_0x7314('0x2c')](function(_0x5a476c){var _0x2959e9=_0x5a476c['role']===_0x7314('0x27')?'user':_0x5a476c['role'];_0x12f09e[_0x2959e9]-=_0x5a476c[_0x7314('0x26')];if(_0x12f09e[_0x2959e9]<0x0)_0x12f09e[_0x2959e9]=0x0;});_0x42f900(_0x12f09e);return;});})[_0x7314('0xd')](function(_0x162e5b){_0x24093e(_0x162e5b);});});}function checkUserLimits(_0x150c1e){return new BPromise(function(_0x20d6ab,_0x57e691){getLimits()['then'](function(_0x11b2d8){var _0x45a8f9=_['pick'](_[_0x7314('0x2d')](_0x150c1e,'role'),[_0x7314('0x27'),_0x7314('0x28'),'telephone']);var _0x752d5e=(_0x45a8f9[_0x7314('0x27')]||0x0)+(_0x45a8f9['user']||0x0);var _0x38958f=_0x45a8f9['telephone']||0x0;if(_0x752d5e>_0x11b2d8['user'])return _0x57e691(_0x7314('0x2e'));if(_0x38958f>_0x11b2d8[_0x7314('0x29')])return _0x57e691(_0x7314('0x2f'));return _0x20d6ab();})[_0x7314('0xd')](function(_0x1f46e6){_0x57e691(_0x1f46e6);});});}module[_0x7314('0x30')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x51b3=['License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','%s:%s:%s','parse','demo','machineUuid','gray','deadline','add','days','format','grayReason','changed','message','User','role','sequelize','col','count','user','users','telephones','forEach','pick','countBy','telephone'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0x51b3,0x1b3));var _0x351b=function(_0xc93543,_0x13c745){_0xc93543=_0xc93543-0x0;var _0x4ad884=_0x51b3[_0xc93543];return _0x4ad884;};'use strict';var util=require(_0x351b('0x0'));var _=require('lodash');var moment=require(_0x351b('0x1'));var BPromise=require(_0x351b('0x2'));var hardware=require(_0x351b('0x3'));var encryptor=require(_0x351b('0x4'));var db=require(_0x351b('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x351b('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0x351b('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x351b('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x351b('0x8'),'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0xa29329){return new BPromise(function(_0x1446ff,_0x22d002){return db[_0x351b('0x9')][_0x351b('0xa')](_['defaults'](_0xa29329,{'raw':!![],'where':{'id':0x1}}))[_0x351b('0xb')](function(_0xc32faf){return checkLicense(_0xc32faf,null);})['then'](function(_0x62fc29){_0x1446ff(_0x62fc29);return;})[_0x351b('0xc')](function(_0x4aa8ce){_0x22d002(_0x4aa8ce);});});}function checkLicense(_0x31d3c7,_0x5bcaae){if(!_0x31d3c7){demoLicense[_0x351b('0xd')]=_0x31d3c7[_0x351b('0xe')];return demoLicense;}try{var _0x3e2d3d=_0x5bcaae||_0x31d3c7[_0x351b('0xf')];if(_[_0x351b('0x10')](_0x3e2d3d)){throw new Error(_0x351b('0x11'));}var _0x2f04d5=_0x31d3c7['data1'];var _0x4b8194=_0x31d3c7[_0x351b('0x12')];var _0x5122f7=_0x2f04d5[_0x351b('0x13')]('-')[0x4];var _0x1d402a=_0x2f04d5[_0x351b('0x13')]('-')[0x0];var _0x2ed3ca=encryptor[_0x351b('0x14')](_0x3e2d3d,util['format'](_0x351b('0x15'),_0x5122f7,_0x2f04d5,_0x1d402a));var _0x168c2f=JSON[_0x351b('0x16')](_0x2ed3ca);_0x168c2f[_0x351b('0x17')]=![];_0x168c2f[_0x351b('0xd')]=_0x2f04d5;_0x168c2f[_0x351b('0x18')]=hardware['getUuid']();if(_0x4b8194){var _0xd17e8e=encryptor[_0x351b('0x14')](_0x4b8194);_0x168c2f[_0x351b('0x19')]=_0xd17e8e;_0x168c2f[_0x351b('0x1a')]=moment(_0xd17e8e)[_0x351b('0x1b')](0x7,_0x351b('0x1c'))[_0x351b('0x1d')]();_0x168c2f[_0x351b('0x1e')]=_0x168c2f[_0x351b('0xd')]!=_0x168c2f[_0x351b('0x18')]?_0x351b('0x1f'):'disabled';}return _0x168c2f;}catch(_0x5750c1){breakingLicense['uuid']=_0x31d3c7[_0x351b('0xe')];breakingLicense[_0x351b('0x20')]=_0x5750c1[_0x351b('0x20')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x28933f,_0x43bf16){getLicense()['then'](function(_0x43b09c){return db[_0x351b('0x21')]['findAll']({'attributes':[_0x351b('0x22'),[db['sequelize']['fn']('COUNT',db[_0x351b('0x23')][_0x351b('0x24')](_0x351b('0x22'))),_0x351b('0x25')]],'group':_0x351b('0x22'),'where':{'role':{'$or':['admin',_0x351b('0x26'),'telephone']}},'raw':!![]})[_0x351b('0xb')](function(_0x260f60){var _0x40c1e3={'user':_0x43b09c[_0x351b('0x27')]||0x0,'telephone':_0x43b09c[_0x351b('0x28')]||0x0};_0x260f60[_0x351b('0x29')](function(_0x120bd2){var _0x3e9a00=_0x120bd2[_0x351b('0x22')]==='admin'?'user':_0x120bd2[_0x351b('0x22')];_0x40c1e3[_0x3e9a00]-=_0x120bd2['count'];if(_0x40c1e3[_0x3e9a00]<0x0)_0x40c1e3[_0x3e9a00]=0x0;});_0x28933f(_0x40c1e3);return;});})[_0x351b('0xc')](function(_0x1d7e52){_0x43bf16(_0x1d7e52);});});}function checkUserLimits(_0x3f05ff){return new BPromise(function(_0x3afebe,_0x2f040b){getLimits()['then'](function(_0x371d52){var _0x2b8a40=_[_0x351b('0x2a')](_[_0x351b('0x2b')](_0x3f05ff,_0x351b('0x22')),['admin','user',_0x351b('0x2c')]);var _0x1611ea=(_0x2b8a40['admin']||0x0)+(_0x2b8a40[_0x351b('0x26')]||0x0);var _0x443617=_0x2b8a40[_0x351b('0x2c')]||0x0;if(_0x1611ea>_0x371d52['user'])return _0x2f040b(_0x351b('0x2d'));if(_0x443617>_0x371d52[_0x351b('0x2c')])return _0x2f040b(_0x351b('0x2e'));return _0x3afebe();})['catch'](function(_0x2b13fa){_0x2f040b(_0x2b13fa);});});}module[_0x351b('0x2f')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index ba56432..c6e789b 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 _0x25e7=['exports','http://localhost:9000','myappanuglar-secret','app-id','secret'];(function(_0x4ff09b,_0x53f67d){var _0x3f5c2e=function(_0x124592){while(--_0x124592){_0x4ff09b['push'](_0x4ff09b['shift']());}};_0x3f5c2e(++_0x53f67d);}(_0x25e7,0x1d6));var _0x725e=function(_0x5c620a,_0x200a52){_0x5c620a=_0x5c620a-0x0;var _0x5e6424=_0x25e7[_0x5c620a];return _0x5e6424;};'use strict';module[_0x725e('0x0')]={'DOMAIN':_0x725e('0x1'),'SESSION_SECRET':_0x725e('0x2'),'GOOGLE_ID':_0x725e('0x3'),'GOOGLE_SECRET':_0x725e('0x4'),'DEBUG':''}; \ No newline at end of file +var _0x8e3f=['secret','exports','http://localhost:9000','myappanuglar-secret'];(function(_0x3df935,_0x3fc970){var _0x5d45b0=function(_0xf75f24){while(--_0xf75f24){_0x3df935['push'](_0x3df935['shift']());}};_0x5d45b0(++_0x3fc970);}(_0x8e3f,0xc1));var _0xf8e3=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x8e3f[_0x4565bf];return _0x5610ba;};'use strict';module[_0xf8e3('0x0')]={'DOMAIN':_0xf8e3('0x1'),'SESSION_SECRET':_0xf8e3('0x2'),'GOOGLE_ID':'app-id','GOOGLE_SECRET':_0xf8e3('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 3e69a58..128e690 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64ca=['fileLogger','../utils/loggers'];(function(_0x458bf4,_0x42cf71){var _0x1ec4b9=function(_0x37e63a){while(--_0x37e63a){_0x458bf4['push'](_0x458bf4['shift']());}};_0x1ec4b9(++_0x42cf71);}(_0x64ca,0xc7));var _0xa64c=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x64ca[_0x2f5ac5];return _0x37c9a8;};'use strict';var fileLogger=require(_0xa64c('0x0'))[_0xa64c('0x1')];module['exports']=fileLogger; \ No newline at end of file +var _0x4fd7=['fileLogger','../utils/loggers'];(function(_0x5c2311,_0x24ae77){var _0x2f0ab2=function(_0x4769aa){while(--_0x4769aa){_0x5c2311['push'](_0x5c2311['shift']());}};_0x2f0ab2(++_0x24ae77);}(_0x4fd7,0x137));var _0x74fd=function(_0x44ce39,_0x124837){_0x44ce39=_0x44ce39-0x0;var _0x319326=_0x4fd7[_0x44ce39];return _0x319326;};'use strict';var fileLogger=require(_0x74fd('0x0'))[_0x74fd('0x1')];module['exports']=fileLogger; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index c334964..863f8f9 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 _0x9569=['agi','../../services/agi/index.js','../../services/email/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js'];(function(_0x241424,_0x25eb5d){var _0x3da798=function(_0x415153){while(--_0x415153){_0x241424['push'](_0x241424['shift']());}};_0x3da798(++_0x25eb5d);}(_0x9569,0xb0));var _0x9956=function(_0x4b3084,_0x35dad4){_0x4b3084=_0x4b3084-0x0;var _0x149475=_0x9569[_0x4b3084];return _0x149475;};'use strict';var path=require(_0x9956('0x0'));var os=require('os');var config={'apps':[{'name':_0x9956('0x1'),'script':path[_0x9956('0x2')](__dirname,_0x9956('0x3'))},{'name':'ami','script':path[_0x9956('0x2')](__dirname,'../../services/ami/index.js')},{'name':_0x9956('0x4'),'script':path[_0x9956('0x2')](__dirname,_0x9956('0x5'))},{'name':'email','script':path[_0x9956('0x2')](__dirname,_0x9956('0x6'))},{'name':'routing','script':path[_0x9956('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0x9956('0x7'),'script':path[_0x9956('0x2')](__dirname,_0x9956('0x8'))}]};module[_0x9956('0x9')]=config; \ No newline at end of file +var _0x0768=['../../services/email/index.js','routing','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','../../services/ami/index.js','agi','email'];(function(_0x572a28,_0x2d65a7){var _0x733c1=function(_0x357071){while(--_0x357071){_0x572a28['push'](_0x572a28['shift']());}};_0x733c1(++_0x2d65a7);}(_0x0768,0x1d9));var _0x8076=function(_0x164868,_0x48d9bb){_0x164868=_0x164868-0x0;var _0xd2d9a6=_0x0768[_0x164868];return _0xd2d9a6;};'use strict';var path=require(_0x8076('0x0'));var os=require('os');var config={'apps':[{'name':_0x8076('0x1'),'script':path[_0x8076('0x2')](__dirname,_0x8076('0x3'))},{'name':'ami','script':path[_0x8076('0x2')](__dirname,_0x8076('0x4'))},{'name':_0x8076('0x5'),'script':path[_0x8076('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0x8076('0x6'),'script':path[_0x8076('0x2')](__dirname,_0x8076('0x7'))},{'name':_0x8076('0x8'),'script':path[_0x8076('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0x8076('0x9'),'script':path[_0x8076('0x2')](__dirname,_0x8076('0xa'))}]};module[_0x8076('0xb')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 25c7634..26dee62 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 _0x064a=['dump','saved','pm2','bluebird','./config','connect','connected','start','then','disconnect','stop','restart','list','describe','delete'];(function(_0x2de10c,_0x14a21e){var _0x9635ef=function(_0x368193){while(--_0x368193){_0x2de10c['push'](_0x2de10c['shift']());}};_0x9635ef(++_0x14a21e);}(_0x064a,0xf2));var _0xa064=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x064a[_0x14add3];return _0x4a174f;};'use strict';var pm2=require(_0xa064('0x0'));var BPromise=require(_0xa064('0x1'));var config=require(_0xa064('0x2'));function connect(){return new BPromise(function(_0x1c3668,_0x483b52){return pm2[_0xa064('0x3')](function(_0x29501a){if(_0x29501a){return _0x483b52(_0x29501a);}return _0x1c3668(_0xa064('0x4'));});});};exports[_0xa064('0x5')]=function(_0x550b09){return connect()[_0xa064('0x6')](function(){return new BPromise(function(_0x12d008,_0x745469){return pm2[_0xa064('0x5')](_0x550b09,function(_0x3856dc,_0x26b440){if(_0x3856dc){return _0x745469(_0x3856dc);}pm2[_0xa064('0x7')]();return _0x12d008(_0x26b440);});});});};exports['stop']=function(_0x31e0f5){return connect()[_0xa064('0x6')](function(){return new BPromise(function(_0x41bf49,_0x214570){return pm2[_0xa064('0x8')](_0x31e0f5,function(_0x1a810e,_0x3fe676){if(_0x1a810e){return _0x214570(_0x1a810e);}pm2['disconnect']();return _0x41bf49(_0x3fe676);});});});};exports[_0xa064('0x9')]=function(_0x14ba60){return connect()[_0xa064('0x6')](function(){return new BPromise(function(_0x38e4f1,_0x150cca){return pm2[_0xa064('0x9')](_0x14ba60,function(_0x138b45,_0x5467eb){if(_0x138b45){return _0x150cca(_0x138b45);}pm2['disconnect']();return _0x38e4f1(_0x5467eb);});});});};exports[_0xa064('0xa')]=function(){return connect()[_0xa064('0x6')](function(){return new BPromise(function(_0x1f3ff9,_0x249cfb){return pm2[_0xa064('0xa')](function(_0x16a9ce,_0x100f74){if(_0x16a9ce){return _0x249cfb(_0x16a9ce);}pm2[_0xa064('0x7')]();return _0x1f3ff9(_0x100f74);});});});};exports[_0xa064('0xb')]=function(_0x702d60){return connect()[_0xa064('0x6')](function(){return new BPromise(function(_0x35c58f,_0x245a0e){return pm2[_0xa064('0xb')](_0x702d60,function(_0x384556,_0x450e1e){if(_0x384556){return _0x245a0e(_0x384556);}pm2['disconnect']();return _0x35c58f(_0x450e1e);});});});};exports['delete']=function(_0x158d07){return connect()['then'](function(){return new BPromise(function(_0x577b8d,_0x3bf889){return pm2[_0xa064('0xc')](_0x158d07,function(_0x38d95b,_0x249412){if(_0x38d95b){return _0x3bf889(_0x38d95b);}pm2[_0xa064('0x7')]();return _0x577b8d(_0x249412);});});});};exports[_0xa064('0xd')]=function(){return connect()[_0xa064('0x6')](function(){return new BPromise(function(_0x1f833b,_0x22f6dc){return pm2[_0xa064('0xd')](function(_0x43a7a0){if(_0x43a7a0){return _0x22f6dc(_0x43a7a0);}return _0x1f833b(_0xa064('0xe'));});});});}; \ No newline at end of file +var _0x8a1a=['stop','disconnect','restart','list','describe','delete','dump','saved','pm2','connect','connected','then','start'];(function(_0x4c7e4a,_0x2ad13f){var _0x30046e=function(_0x153c89){while(--_0x153c89){_0x4c7e4a['push'](_0x4c7e4a['shift']());}};_0x30046e(++_0x2ad13f);}(_0x8a1a,0x1b5));var _0xa8a1=function(_0x585133,_0x2412a1){_0x585133=_0x585133-0x0;var _0x18254a=_0x8a1a[_0x585133];return _0x18254a;};'use strict';var pm2=require(_0xa8a1('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x462bdb,_0x3be6e8){return pm2[_0xa8a1('0x1')](function(_0x192dd9){if(_0x192dd9){return _0x3be6e8(_0x192dd9);}return _0x462bdb(_0xa8a1('0x2'));});});};exports['start']=function(_0x1e45a3){return connect()[_0xa8a1('0x3')](function(){return new BPromise(function(_0x5d17ae,_0x5d0e6f){return pm2[_0xa8a1('0x4')](_0x1e45a3,function(_0x1d54cd,_0x5a9c06){if(_0x1d54cd){return _0x5d0e6f(_0x1d54cd);}pm2['disconnect']();return _0x5d17ae(_0x5a9c06);});});});};exports[_0xa8a1('0x5')]=function(_0x157e7a){return connect()['then'](function(){return new BPromise(function(_0xc8aa82,_0x5dccb5){return pm2['stop'](_0x157e7a,function(_0x14c070,_0x513a08){if(_0x14c070){return _0x5dccb5(_0x14c070);}pm2[_0xa8a1('0x6')]();return _0xc8aa82(_0x513a08);});});});};exports[_0xa8a1('0x7')]=function(_0xa286cc){return connect()[_0xa8a1('0x3')](function(){return new BPromise(function(_0x2a6b2f,_0x1115dc){return pm2[_0xa8a1('0x7')](_0xa286cc,function(_0x442567,_0x5aac96){if(_0x442567){return _0x1115dc(_0x442567);}pm2[_0xa8a1('0x6')]();return _0x2a6b2f(_0x5aac96);});});});};exports[_0xa8a1('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x54c7d8,_0x5f20cf){return pm2[_0xa8a1('0x8')](function(_0x281eca,_0x3c8ae9){if(_0x281eca){return _0x5f20cf(_0x281eca);}pm2[_0xa8a1('0x6')]();return _0x54c7d8(_0x3c8ae9);});});});};exports[_0xa8a1('0x9')]=function(_0x11a9fe){return connect()['then'](function(){return new BPromise(function(_0x3da8fa,_0x17215e){return pm2['describe'](_0x11a9fe,function(_0xa6dfd5,_0x545d1f){if(_0xa6dfd5){return _0x17215e(_0xa6dfd5);}pm2[_0xa8a1('0x6')]();return _0x3da8fa(_0x545d1f);});});});};exports[_0xa8a1('0xa')]=function(_0x2eb9a1){return connect()[_0xa8a1('0x3')](function(){return new BPromise(function(_0x42db2a,_0x1c0dfa){return pm2[_0xa8a1('0xa')](_0x2eb9a1,function(_0x32693d,_0x324ea7){if(_0x32693d){return _0x1c0dfa(_0x32693d);}pm2[_0xa8a1('0x6')]();return _0x42db2a(_0x324ea7);});});});};exports[_0xa8a1('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x2764e7,_0x1482ac){return pm2[_0xa8a1('0xb')](function(_0x20c944){if(_0x20c944){return _0x1482ac(_0x20c944);}return _0x2764e7(_0xa8a1('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 3b3e394..86b81cb 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 _0xaaa6=['catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','socket.io-emitter','Setting','find','then','ChatInteraction','lastMsgAt','chatTimeout','minutes','length','map','join','update','system','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update'];(function(_0x28aee1,_0x45880b){var _0x12b081=function(_0x115d6d){while(--_0x115d6d){_0x28aee1['push'](_0x28aee1['shift']());}};_0x12b081(++_0x45880b);}(_0xaaa6,0xe4));var _0x6aaa=function(_0x4af7e3,_0x34f989){_0x4af7e3=_0x4af7e3-0x0;var _0x9c8095=_0xaaa6[_0x4af7e3];return _0x9c8095;};'use strict';var _=require(_0x6aaa('0x0'));var moment=require(_0x6aaa('0x1'));var Redis=require(_0x6aaa('0x2'));var util=require('util');var config=require(_0x6aaa('0x3'));var db=require(_0x6aaa('0x4'))['db'];var logger=require(_0x6aaa('0x5'))(_0x6aaa('0x6'));config[_0x6aaa('0x7')]=_[_0x6aaa('0x8')](config[_0x6aaa('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x6aaa('0x9'))(new Redis(config[_0x6aaa('0x7')]));function closeInteractions(){var _0x59aa36=0x0;var _0x3bcbff=[];return db[_0x6aaa('0xa')][_0x6aaa('0xb')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x6aaa('0xc')](function(_0x2f3a8e){_0x59aa36=_0x2f3a8e['chatTimeout'];if(_0x59aa36){return db[_0x6aaa('0xd')]['findAll']({'raw':!![],'attributes':['id',_0x6aaa('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x2f3a8e[_0x6aaa('0xf')],_0x6aaa('0x10'))}}});}else{return[];}})[_0x6aaa('0xc')](function(_0x218152){if(_0x218152&&_0x218152[_0x6aaa('0x11')]){_0x3bcbff=_[_0x6aaa('0x12')](_0x218152||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x3bcbff[_0x6aaa('0x13')]());return db['ChatInteraction'][_0x6aaa('0x14')]({'closeReason':_0x6aaa('0x15'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x6aaa('0x16')](_0x6aaa('0x17'))},{'where':{'id':_0x3bcbff}});}})[_0x6aaa('0xc')](function(){if(_0x3bcbff&&_0x3bcbff['length']){logger[_0x6aaa('0x18')](_0x6aaa('0x19'),_0x3bcbff['join']());for(var _0x20dbf4=0x0;_0x20dbf4<_0x3bcbff[_0x6aaa('0x11')];_0x20dbf4++){io[_0x6aaa('0x1a')](_0x6aaa('0x1b'),{'id':_0x3bcbff[_0x20dbf4],'closed':!![]});}}})[_0x6aaa('0x1c')](function(_0x51eb23){logger[_0x6aaa('0x1d')](_0x6aaa('0x1e'),_0x51eb23?util[_0x6aaa('0x1f')](_0x51eb23,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x0299=['moment','ioredis','schedule','redis','localhost','socket.io-emitter','Setting','find','chatTimeout','then','ChatInteraction','lastMsgAt','subtract','minutes','length','info','[CHAT]\x20Interactions\x20to\x20close:','join','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','chatInteraction:update','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','start','lodash'];(function(_0x65f140,_0x45cbc7){var _0x18fbda=function(_0x26fb39){while(--_0x26fb39){_0x65f140['push'](_0x65f140['shift']());}};_0x18fbda(++_0x45cbc7);}(_0x0299,0x73));var _0x9029=function(_0x55e13b,_0x39f6c7){_0x55e13b=_0x55e13b-0x0;var _0x2d9cd1=_0x0299[_0x55e13b];return _0x2d9cd1;};'use strict';var _=require(_0x9029('0x0'));var moment=require(_0x9029('0x1'));var Redis=require(_0x9029('0x2'));var util=require('util');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var logger=require('../logger')(_0x9029('0x3'));config[_0x9029('0x4')]=_['defaults'](config[_0x9029('0x4')],{'host':_0x9029('0x5'),'port':0x18eb});var io=require(_0x9029('0x6'))(new Redis(config[_0x9029('0x4')]));function closeInteractions(){var _0xe21bf2=0x0;var _0x41b322=[];return db[_0x9029('0x7')][_0x9029('0x8')]({'raw':!![],'attributes':['id',_0x9029('0x9')],'where':{'id':0x1}})[_0x9029('0xa')](function(_0x254652){_0xe21bf2=_0x254652[_0x9029('0x9')];if(_0xe21bf2){return db[_0x9029('0xb')]['findAll']({'raw':!![],'attributes':['id',_0x9029('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x9029('0xd')](_0x254652[_0x9029('0x9')],_0x9029('0xe'))}}});}else{return[];}})['then'](function(_0x4a4bc1){if(_0x4a4bc1&&_0x4a4bc1[_0x9029('0xf')]){_0x41b322=_['map'](_0x4a4bc1||[],'id');logger[_0x9029('0x10')](_0x9029('0x11'),_0x41b322[_0x9029('0x12')]());return db[_0x9029('0xb')]['update']({'closeReason':'system','disposition':_0x9029('0x13'),'closed':!![],'closedAt':moment()[_0x9029('0x14')](_0x9029('0x15'))},{'where':{'id':_0x41b322}});}})[_0x9029('0xa')](function(){if(_0x41b322&&_0x41b322[_0x9029('0xf')]){logger[_0x9029('0x10')](_0x9029('0x16'),_0x41b322[_0x9029('0x12')]());for(var _0x2ba463=0x0;_0x2ba463<_0x41b322[_0x9029('0xf')];_0x2ba463++){io[_0x9029('0x17')](_0x9029('0x18'),{'id':_0x41b322[_0x2ba463],'closed':!![]});}}})['catch'](function(_0x167d37){logger[_0x9029('0x19')](_0x9029('0x1a'),_0x167d37?util[_0x9029('0x1b')](_0x167d37,{'showHidden':![],'depth':null}):'');});}exports[_0x9029('0x1c')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/cloud-provider.js b/server/config/schedule/cloud-provider.js index b881637..8d6976d 100644 --- a/server/config/schedule/cloud-provider.js +++ b/server/config/schedule/cloud-provider.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3896=['../../api/cloudProvider/cloudProvider.oauth.js','exports'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0x3896,0x1ae));var _0x6389=function(_0x5d7c19,_0x46b3ec){_0x5d7c19=_0x5d7c19-0x0;var _0x46108a=_0x3896[_0x5d7c19];return _0x46108a;};'use strict';function start(){var _0x1027ad=require(_0x6389('0x0'));return _0x1027ad['startAllRefreshIntervals']();}module[_0x6389('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0xb1f9=['../../api/cloudProvider/cloudProvider.oauth.js','startAllRefreshIntervals','exports'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0xb1f9,0x177));var _0x9b1f=function(_0x145088,_0x56b565){_0x145088=_0x145088-0x0;var _0xe98efa=_0xb1f9[_0x145088];return _0xe98efa;};'use strict';function start(){var _0x1631bf=require(_0x9b1f('0x0'));return _0x1631bf[_0x9b1f('0x1')]();}module[_0x9b1f('0x2')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 1e2bd76..7dc361f 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 _0x34e7=['jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','getSmtpOptions','format','\x22%s\x22\x20<%s>','name','Smtp','bcc','subtractUnit','savename','%s.%s','basename','extname','zip','join','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','empty\x20file,\x20email\x20not\x20sent','request','SendMail','error','email\x20sent','catch','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','then','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','CloudProvider','keys','jobs','map','toString','keyBy','difference','intersection','length','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','run\x20job','cron','active','isBetween','startAt','add','stop\x20cron','exists','endAt','update','run','start','path','lodash','moment'];(function(_0x410b00,_0x95f65c){var _0x4e5b0b=function(_0x1194d8){while(--_0x1194d8){_0x410b00['push'](_0x410b00['shift']());}};_0x4e5b0b(++_0x95f65c);}(_0x34e7,0x161));var _0x734e=function(_0x29c3b9,_0x4adaf7){_0x29c3b9=_0x29c3b9-0x0;var _0x637286=_0x34e7[_0x29c3b9];return _0x637286;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x734e('0x0'));var _=require(_0x734e('0x1'));var moment=require(_0x734e('0x2'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x734e('0x3'));var BPromise=require('bluebird');var logger=require(_0x734e('0x4'))(_0x734e('0x5'));var db=require(_0x734e('0x6'))['db'];var analyticCustomReportController=require(_0x734e('0x7'));var analyticDefaultReportController=require(_0x734e('0x8'));var client=jayson[_0x734e('0x9')][_0x734e('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x1f70d4,_0x391832){return function(){logger[_0x734e('0xb')](_0x734e('0xc'),_0x1f70d4[_0x734e('0xd')]);var _0x15e358=!![];var _0x179916=_0x1f70d4[_0x734e('0xe')][_0x734e('0xf')]();var _0xc13952={'account':_0x179916,'message':{'from':util[_0x734e('0x10')](_0x734e('0x11'),_0x1f70d4['MailAccount'][_0x734e('0x12')],_0x1f70d4[_0x734e('0xe')][_0x734e('0xd')]||_0x1f70d4['MailAccount'][_0x734e('0x13')]['user']),'to':_0x1f70d4[_0x734e('0xd')],'cc':_0x1f70d4['cc'],'bcc':_0x1f70d4[_0x734e('0x14')],'subject':util[_0x734e('0x10')]('Report\x20%s\x20last\x20%s\x20%s',_0x391832[_0x734e('0x12')],_0x1f70d4['subtractNumber'],_0x1f70d4[_0x734e('0x15')])}};var _0x3d039a=path['join'](__dirname,'../../files/reports');var _0x680225=_0x391832[_0x734e('0x16')];var _0x267985=util[_0x734e('0x10')](_0x734e('0x17'),path[_0x734e('0x18')](_0x391832['savename'],path[_0x734e('0x19')](_0x391832[_0x734e('0x16')])),_0x734e('0x1a'));var _0xf9a691=path[_0x734e('0x1b')](_0x3d039a,_0x680225);var _0x4e268e=path[_0x734e('0x1b')](_0x3d039a,_0x267985);if(fs[_0x734e('0x1c')](_0xf9a691)){_0x391832[_0x734e('0x1d')]=_0x734e('0x1e');_0xc13952[_0x734e('0x1f')][_0x734e('0x20')]=[{'filename':_0x680225,'path':_0xf9a691}];_0xc13952['message'][_0x734e('0x21')]=util['format']('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x734e('0x22')](_0x391832,null,0x2));}else if(fs[_0x734e('0x1c')](_0x4e268e)){_0x391832[_0x734e('0x1d')]=_0x734e('0x1e');_0xc13952['message']['attachments']=[{'filename':_0x267985,'path':_0x4e268e}];}else{_0xc13952[_0x734e('0x1f')][_0x734e('0x21')]=_0x734e('0x23');if(!_0x1f70d4[_0x734e('0x24')]){_0x15e358=![];logger[_0x734e('0xb')](_0x734e('0x25'));}}if(_0x15e358){return client[_0x734e('0x26')](_0x734e('0x27'),_0xc13952)['then'](function(_0x3f353a){if(_0x3f353a[_0x734e('0x28')]){return logger[_0x734e('0x28')]('error\x20mail',JSON[_0x734e('0x22')](_0x3f353a));}return logger[_0x734e('0xb')](_0x734e('0x29'));})[_0x734e('0x2a')](function(_0x4591b7){return logger[_0x734e('0x28')](_0x734e('0x2b'),JSON[_0x734e('0x22')](_0x4591b7));});}};}function handleError(){return function(_0x31831b){return logger[_0x734e('0x28')](JSON[_0x734e('0x22')](_0x31831b));};}function handleResult(_0x546d30){return function(_0x526443){logger['info'](_0x734e('0x2c'),JSON[_0x734e('0x22')](_0x526443));if(_0x546d30[_0x734e('0xe')]&&_0x546d30[_0x734e('0xe')][_0x734e('0x13')]&&!_[_0x734e('0x2d')](_0x546d30[_0x734e('0xd')])){setTimeout(handleSendEmail(_0x546d30,_0x526443),0x3c*0x3e8);}};}function handleJob(_0x4ff583){return function(){try{if(_['isNil'](_0x4ff583['subtractNumber'])){return logger[_0x734e('0xb')](_0x734e('0x2e'));}if(_[_0x734e('0x2d')](_0x4ff583[_0x734e('0x15')])){return logger['info'](_0x734e('0x2f'));}var _0xa0e6d8={'startDate':moment()[_0x734e('0x30')](_0x4ff583['subtractNumber'],_0x4ff583[_0x734e('0x15')])[_0x734e('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()['format'](_0x734e('0x31')),'type':'scheduled','output':_0x4ff583[_0x734e('0x32')],'name':_0x4ff583['name']};if(!_[_0x734e('0x2d')](_0x4ff583[_0x734e('0x33')])){logger[_0x734e('0xb')](_0x734e('0x34'),_0x4ff583[_0x734e('0x33')]);return analyticDefaultReportController[_0x734e('0x35')]({'id':_0x4ff583[_0x734e('0x33')]},_0xa0e6d8)[_0x734e('0x36')](handleResult(_0x4ff583))[_0x734e('0x2a')](handleError());}if(!_[_0x734e('0x2d')](_0x4ff583[_0x734e('0x37')])){logger[_0x734e('0xb')](_0x734e('0x38'),_0x4ff583[_0x734e('0x37')]);return analyticCustomReportController[_0x734e('0x35')]({'id':_0x4ff583[_0x734e('0x37')]},_0xa0e6d8)['then'](handleResult(_0x4ff583))[_0x734e('0x2a')](handleError());}}catch(_0x3f3713){logger[_0x734e('0x28')](JSON[_0x734e('0x22')](_0x3f3713));}return logger[_0x734e('0xb')](_0x734e('0x39'));};}function getJobs(_0x416ee3){var _0x450ffe={};if(_0x416ee3){_0x450ffe['id']=_0x416ee3;}return db[_0x734e('0x3a')][_0x734e('0x3b')]({'where':_0x450ffe,'include':[{'model':db[_0x734e('0xe')],'attributes':['id',_0x734e('0x12'),_0x734e('0xd')],'include':[{'model':db[_0x734e('0x3c')],'as':_0x734e('0x13'),'include':[{'model':db[_0x734e('0x3d')],'as':_0x734e('0x3d')}]}]}]})['then'](function(_0x577e3d){var _0x4e8e79=_[_0x734e('0x3e')](manager[_0x734e('0x3f')]);var _0x63e80a=_[_0x734e('0x40')](_0x577e3d,function(_0x3e33d9){return _0x3e33d9['id'][_0x734e('0x41')]();});var _0x25c4a5=_[_0x734e('0x42')](_0x577e3d,function(_0x3a9242){return _0x3a9242['id'][_0x734e('0x41')]();});var _0x30f2d1=_0x416ee3?_0x63e80a:_[_0x734e('0x43')](_0x63e80a,_0x4e8e79);var _0x1252bc=_[_0x734e('0x44')](_0x63e80a,_0x4e8e79);var _0x40d5ec=_['difference'](_0x4e8e79,_0x63e80a);var _0x213590;var _0x793d58;for(_0x213590=0x0;_0x213590<_0x40d5ec[_0x734e('0x45')]&&!_0x416ee3;_0x213590+=0x1){_0x793d58=_0x40d5ec[_0x213590][_0x734e('0x41')]();if(manager['exists'](_0x793d58)){manager[_0x734e('0x46')](_0x793d58);manager[_0x734e('0x47')](_0x793d58);logger[_0x734e('0xb')](_0x734e('0x48'),_0x793d58);}}logger[_0x734e('0xb')](_0x734e('0x49'),JSON[_0x734e('0x22')](_0x30f2d1));for(_0x213590=0x0;_0x213590<_0x30f2d1[_0x734e('0x45')];_0x213590+=0x1){_0x793d58=_0x30f2d1[_0x213590][_0x734e('0x41')]();logger['info'](_0x734e('0x4a'),_0x793d58);if(_0x416ee3){logger[_0x734e('0xb')](_0x734e('0x4b'),_0x416ee3);logger[_0x734e('0xb')](JSON[_0x734e('0x22')](_0x25c4a5[_0x793d58]));BPromise[_0x734e('0x4c')]()['then'](handleJob(_0x25c4a5[_0x793d58]));logger['info'](_0x734e('0x4d'),_0x25c4a5[_0x793d58][_0x734e('0x12')],_0x25c4a5[_0x793d58][_0x734e('0x4e')]);}else if(_0x25c4a5[_0x793d58][_0x734e('0x4e')]&&_0x25c4a5[_0x793d58][_0x734e('0x4f')]&&moment()[_0x734e('0x50')](_0x25c4a5[_0x793d58][_0x734e('0x51')],_0x25c4a5[_0x793d58]['endAt'])){manager[_0x734e('0x52')](_0x793d58,_0x25c4a5[_0x793d58][_0x734e('0x4e')],handleJob(_0x25c4a5[_0x793d58]));manager['start'](_0x793d58);logger['info']('add\x20cron',_0x25c4a5[_0x793d58][_0x734e('0x12')],_0x25c4a5[_0x793d58]['cron']);}else if(manager['exists'](_0x793d58)){manager[_0x734e('0x46')](_0x793d58);manager['deleteJob'](_0x793d58);logger[_0x734e('0xb')](_0x734e('0x53'),_0x25c4a5[_0x793d58][_0x734e('0x12')],_0x25c4a5[_0x793d58][_0x734e('0x4e')]);}}for(_0x213590=0x0,_0x793d58;_0x213590<_0x1252bc[_0x734e('0x45')]&&!_0x416ee3;_0x213590+=0x1){_0x793d58=_0x1252bc[_0x213590]['toString']();if(manager[_0x734e('0x54')](_0x793d58)){if(_0x25c4a5[_0x793d58][_0x734e('0x4e')]&&_0x25c4a5[_0x793d58][_0x734e('0x4f')]&&moment()[_0x734e('0x50')](_0x25c4a5[_0x793d58]['startAt'],_0x25c4a5[_0x793d58][_0x734e('0x55')])){manager[_0x734e('0x56')](_0x793d58,_0x25c4a5[_0x793d58][_0x734e('0x4e')],handleJob(_0x25c4a5[_0x793d58]));logger[_0x734e('0xb')]('update\x20cron',_0x25c4a5[_0x793d58]['name'],_0x25c4a5[_0x793d58][_0x734e('0x4e')]);}else{manager['stop'](_0x793d58);manager[_0x734e('0x47')](_0x793d58);logger[_0x734e('0xb')]('stop\x20cron',_0x25c4a5[_0x793d58][_0x734e('0x12')],_0x25c4a5[_0x793d58][_0x734e('0x4e')]);}}}})[_0x734e('0x2a')](function(_0x1ae09e){logger[_0x734e('0x28')](JSON[_0x734e('0x22')](_0x1ae09e));});}exports[_0x734e('0x57')]=function(_0xcc2064){return getJobs(_0xcc2064);};exports[_0x734e('0x58')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x570d=['jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','cron','active','startAt','endAt','start','add\x20cron','update','update\x20cron','stop\x20cron','run','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','../../mysqldb','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','format','\x22%s\x22\x20<%s>','name','Smtp','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','%s.%s','basename','extname','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','subtractNumber','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','findAll','CloudProvider','keys'];(function(_0x2247db,_0x2065c0){var _0x1c1e19=function(_0x454a55){while(--_0x454a55){_0x2247db['push'](_0x2247db['shift']());}};_0x1c1e19(++_0x2065c0);}(_0x570d,0x1bc));var _0xd570=function(_0x127e64,_0x45ce7a){_0x127e64=_0x127e64-0x0;var _0x43a2e8=_0x570d[_0x127e64];return _0x43a2e8;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0xd570('0x0'));var _=require(_0xd570('0x1'));var moment=require(_0xd570('0x2'));var CronJobManager=require(_0xd570('0x3'));var jayson=require(_0xd570('0x4'));var BPromise=require(_0xd570('0x5'));var logger=require(_0xd570('0x6'))('schedule');var db=require(_0xd570('0x7'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client']['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x40f16e,_0x15854f){return function(){logger[_0xd570('0x8')](_0xd570('0x9'),_0x40f16e[_0xd570('0xa')]);var _0x1d60dd=!![];var _0x5141fc=_0x40f16e[_0xd570('0xb')]['getSmtpOptions']();var _0x51d449={'account':_0x5141fc,'message':{'from':util[_0xd570('0xc')](_0xd570('0xd'),_0x40f16e['MailAccount'][_0xd570('0xe')],_0x40f16e[_0xd570('0xb')]['email']||_0x40f16e[_0xd570('0xb')][_0xd570('0xf')]['user']),'to':_0x40f16e[_0xd570('0xa')],'cc':_0x40f16e['cc'],'bcc':_0x40f16e[_0xd570('0x10')],'subject':util[_0xd570('0xc')](_0xd570('0x11'),_0x15854f[_0xd570('0xe')],_0x40f16e['subtractNumber'],_0x40f16e[_0xd570('0x12')])}};var _0x5ac3cc=path[_0xd570('0x13')](__dirname,_0xd570('0x14'));var _0x51ddf8=_0x15854f[_0xd570('0x15')];var _0x23bb98=util[_0xd570('0xc')](_0xd570('0x16'),path[_0xd570('0x17')](_0x15854f[_0xd570('0x15')],path[_0xd570('0x18')](_0x15854f[_0xd570('0x15')])),'zip');var _0x231ee2=path[_0xd570('0x13')](_0x5ac3cc,_0x51ddf8);var _0x2cb2cd=path[_0xd570('0x13')](_0x5ac3cc,_0x23bb98);if(fs[_0xd570('0x19')](_0x231ee2)){_0x15854f[_0xd570('0x1a')]=_0xd570('0x1b');_0x51d449[_0xd570('0x1c')][_0xd570('0x1d')]=[{'filename':_0x51ddf8,'path':_0x231ee2}];_0x51d449['message'][_0xd570('0x1e')]=util[_0xd570('0xc')](_0xd570('0x1f'),JSON[_0xd570('0x20')](_0x15854f,null,0x2));}else if(fs['existsSync'](_0x2cb2cd)){_0x15854f[_0xd570('0x1a')]=_0xd570('0x1b');_0x51d449[_0xd570('0x1c')][_0xd570('0x1d')]=[{'filename':_0x23bb98,'path':_0x2cb2cd}];}else{_0x51d449[_0xd570('0x1c')]['text']=_0xd570('0x21');if(!_0x40f16e[_0xd570('0x22')]){_0x1d60dd=![];logger[_0xd570('0x8')](_0xd570('0x23'));}}if(_0x1d60dd){return client[_0xd570('0x24')](_0xd570('0x25'),_0x51d449)[_0xd570('0x26')](function(_0x22170a){if(_0x22170a[_0xd570('0x27')]){return logger[_0xd570('0x27')](_0xd570('0x28'),JSON[_0xd570('0x20')](_0x22170a));}return logger[_0xd570('0x8')](_0xd570('0x29'));})['catch'](function(_0x1c39c9){return logger[_0xd570('0x27')]('error\x20mail',JSON[_0xd570('0x20')](_0x1c39c9));});}};}function handleError(){return function(_0x3686ad){return logger['error'](JSON[_0xd570('0x20')](_0x3686ad));};}function handleResult(_0x58df14){return function(_0x201186){logger[_0xd570('0x8')](_0xd570('0x2a'),JSON[_0xd570('0x20')](_0x201186));if(_0x58df14['MailAccount']&&_0x58df14[_0xd570('0xb')]['Smtp']&&!_[_0xd570('0x2b')](_0x58df14[_0xd570('0xa')])){setTimeout(handleSendEmail(_0x58df14,_0x201186),0x3c*0x3e8);}};}function handleJob(_0x2f206d){return function(){try{if(_[_0xd570('0x2b')](_0x2f206d['subtractNumber'])){return logger[_0xd570('0x8')](_0xd570('0x2c'));}if(_[_0xd570('0x2b')](_0x2f206d[_0xd570('0x12')])){return logger[_0xd570('0x8')](_0xd570('0x2d'));}var _0x2068ad={'startDate':moment()[_0xd570('0x2e')](_0x2f206d[_0xd570('0x2f')],_0x2f206d[_0xd570('0x12')])[_0xd570('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xd570('0xc')](_0xd570('0x30')),'type':_0xd570('0x31'),'output':_0x2f206d[_0xd570('0x32')],'name':_0x2f206d[_0xd570('0xe')]};if(!_[_0xd570('0x2b')](_0x2f206d['DefaultReportId'])){logger['info'](_0xd570('0x33'),_0x2f206d[_0xd570('0x34')]);return analyticDefaultReportController[_0xd570('0x35')]({'id':_0x2f206d['DefaultReportId']},_0x2068ad)[_0xd570('0x26')](handleResult(_0x2f206d))[_0xd570('0x36')](handleError());}if(!_[_0xd570('0x2b')](_0x2f206d[_0xd570('0x37')])){logger['info'](_0xd570('0x38'),_0x2f206d[_0xd570('0x37')]);return analyticCustomReportController[_0xd570('0x35')]({'id':_0x2f206d[_0xd570('0x37')]},_0x2068ad)[_0xd570('0x26')](handleResult(_0x2f206d))[_0xd570('0x36')](handleError());}}catch(_0x4c3580){logger[_0xd570('0x27')](JSON[_0xd570('0x20')](_0x4c3580));}return logger['info']('no\x20report\x20id');};}function getJobs(_0x3a8d09){var _0xdf7ca1={};if(_0x3a8d09){_0xdf7ca1['id']=_0x3a8d09;}return db['Schedule'][_0xd570('0x39')]({'where':_0xdf7ca1,'include':[{'model':db[_0xd570('0xb')],'attributes':['id',_0xd570('0xe'),_0xd570('0xa')],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db[_0xd570('0x3a')],'as':_0xd570('0x3a')}]}]}]})[_0xd570('0x26')](function(_0x240312){var _0x2c64e6=_[_0xd570('0x3b')](manager[_0xd570('0x3c')]);var _0x356ecc=_[_0xd570('0x3d')](_0x240312,function(_0x435994){return _0x435994['id'][_0xd570('0x3e')]();});var _0x179289=_[_0xd570('0x3f')](_0x240312,function(_0x4a86f4){return _0x4a86f4['id'][_0xd570('0x3e')]();});var _0x6c3854=_0x3a8d09?_0x356ecc:_[_0xd570('0x40')](_0x356ecc,_0x2c64e6);var _0x4797c0=_[_0xd570('0x41')](_0x356ecc,_0x2c64e6);var _0x44ccaf=_['difference'](_0x2c64e6,_0x356ecc);var _0x57ea54;var _0x3bc350;for(_0x57ea54=0x0;_0x57ea54<_0x44ccaf[_0xd570('0x42')]&&!_0x3a8d09;_0x57ea54+=0x1){_0x3bc350=_0x44ccaf[_0x57ea54][_0xd570('0x3e')]();if(manager[_0xd570('0x43')](_0x3bc350)){manager[_0xd570('0x44')](_0x3bc350);manager[_0xd570('0x45')](_0x3bc350);logger[_0xd570('0x8')](_0xd570('0x46'),_0x3bc350);}}logger[_0xd570('0x8')](_0xd570('0x47'),JSON['stringify'](_0x6c3854));for(_0x57ea54=0x0;_0x57ea54<_0x6c3854[_0xd570('0x42')];_0x57ea54+=0x1){_0x3bc350=_0x6c3854[_0x57ea54][_0xd570('0x3e')]();logger[_0xd570('0x8')](_0xd570('0x48'),_0x3bc350);if(_0x3a8d09){logger[_0xd570('0x8')](_0xd570('0x49'),_0x3a8d09);logger[_0xd570('0x8')](JSON[_0xd570('0x20')](_0x179289[_0x3bc350]));BPromise['resolve']()['then'](handleJob(_0x179289[_0x3bc350]));logger[_0xd570('0x8')]('run\x20job',_0x179289[_0x3bc350][_0xd570('0xe')],_0x179289[_0x3bc350][_0xd570('0x4a')]);}else if(_0x179289[_0x3bc350][_0xd570('0x4a')]&&_0x179289[_0x3bc350][_0xd570('0x4b')]&&moment()['isBetween'](_0x179289[_0x3bc350][_0xd570('0x4c')],_0x179289[_0x3bc350][_0xd570('0x4d')])){manager['add'](_0x3bc350,_0x179289[_0x3bc350]['cron'],handleJob(_0x179289[_0x3bc350]));manager[_0xd570('0x4e')](_0x3bc350);logger[_0xd570('0x8')](_0xd570('0x4f'),_0x179289[_0x3bc350][_0xd570('0xe')],_0x179289[_0x3bc350][_0xd570('0x4a')]);}else if(manager[_0xd570('0x43')](_0x3bc350)){manager[_0xd570('0x44')](_0x3bc350);manager[_0xd570('0x45')](_0x3bc350);logger[_0xd570('0x8')]('stop\x20cron',_0x179289[_0x3bc350][_0xd570('0xe')],_0x179289[_0x3bc350][_0xd570('0x4a')]);}}for(_0x57ea54=0x0,_0x3bc350;_0x57ea54<_0x4797c0['length']&&!_0x3a8d09;_0x57ea54+=0x1){_0x3bc350=_0x4797c0[_0x57ea54][_0xd570('0x3e')]();if(manager['exists'](_0x3bc350)){if(_0x179289[_0x3bc350][_0xd570('0x4a')]&&_0x179289[_0x3bc350][_0xd570('0x4b')]&&moment()['isBetween'](_0x179289[_0x3bc350][_0xd570('0x4c')],_0x179289[_0x3bc350]['endAt'])){manager[_0xd570('0x50')](_0x3bc350,_0x179289[_0x3bc350][_0xd570('0x4a')],handleJob(_0x179289[_0x3bc350]));logger[_0xd570('0x8')](_0xd570('0x51'),_0x179289[_0x3bc350][_0xd570('0xe')],_0x179289[_0x3bc350][_0xd570('0x4a')]);}else{manager[_0xd570('0x44')](_0x3bc350);manager[_0xd570('0x45')](_0x3bc350);logger['info'](_0xd570('0x52'),_0x179289[_0x3bc350][_0xd570('0xe')],_0x179289[_0x3bc350][_0xd570('0x4a')]);}}}})['catch'](function(_0x4fbbe6){logger[_0xd570('0x27')](JSON[_0xd570('0x20')](_0x4fbbe6));});}exports[_0xd570('0x53')]=function(_0x19e27a){return getJobs(_0x19e27a);};exports[_0xd570('0x4e')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index 6e1c522..a140b40 100644 --- a/server/config/schedule/transcribe.js +++ b/server/config/schedule/transcribe.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x36ee=['[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','transcribeAccountId','Transcribe\x20not\x20configured','all','catch','error','inspect','start','request-promise','bluebird','../../mysqldb','../../config/logger','transcribe','TranscribeService','Comprehend','detectSentiment','substring','format','data1','data2','transcribeRegion','transcribeName','then','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJobStatus','fileText','TranscriptionJob','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','Sequelize','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','ValidationError','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','sentimentRegion','Sentiment','SentimentScore','Positive','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','tempSentiment','sentiment','language','bucket','Transcript\x20not\x20available','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Negative','COMPLETED','name','SequelizeValidationError'];(function(_0x4f1777,_0x2e2e38){var _0x42ba61=function(_0x34c899){while(--_0x34c899){_0x4f1777['push'](_0x4f1777['shift']());}};_0x42ba61(++_0x2e2e38);}(_0x36ee,0xe8));var _0xe36e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x36ee[_0x501510];return _0x1e6ee5;};var _=require('lodash');var AWS=require('aws-sdk');var rp=require(_0xe36e('0x0'));var util=require('util');var BPromise=require(_0xe36e('0x1'));var db=require(_0xe36e('0x2'))['db'];var logger=require(_0xe36e('0x3'))(_0xe36e('0x4'));function getTranscriptionJob(_0x567a84,_0x1118af,_0x29e692,_0x3f29e1){return new Promise(function(_0x25a07d,_0x190404){var _0x21be0b=new AWS[(_0xe36e('0x5'))]({'accessKeyId':_0x1118af,'secretAccessKey':_0x567a84,'region':_0x29e692});_0x21be0b['getTranscriptionJob']({'TranscriptionJobName':_0x3f29e1},function(_0x74b4b7,_0x4aebdd){if(_0x74b4b7){return _0x190404(_0x74b4b7);}else{return _0x25a07d(_0x4aebdd);}});});}function sentiment(_0x2236e9,_0x123c16,_0x46f239,_0x47ce3a,_0xf119e4){return new Promise(function(_0x48981b,_0x2e968d){var _0x2133cf=new AWS[(_0xe36e('0x6'))]({'accessKeyId':_0x123c16,'secretAccessKey':_0x2236e9,'region':_0x46f239});_0x2133cf[_0xe36e('0x7')]({'Text':_0x47ce3a,'LanguageCode':_0xf119e4[_0xe36e('0x8')](0x0,0x2)},function(_0x1f7233,_0x3f6d7f){if(_0x1f7233){return _0x2e968d(_0x1f7233);}else{return _0x48981b(_0x3f6d7f);}});});}function checkTranscribeJob(_0x265473,_0x4fbdb2,_0x32981d){var _0x27841e;return new BPromise(function(_0x23abfb,_0x1fdea2){logger['info'](util[_0xe36e('0x9')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x265473['id'],_0x265473['transcribeName']));return getTranscriptionJob(_0x32981d[_0xe36e('0xa')],_0x32981d[_0xe36e('0xb')],_0x4fbdb2[_0xe36e('0xc')],_0x265473[_0xe36e('0xd')])[_0xe36e('0xe')](function(_0x924cd5){logger[_0xe36e('0xf')](util[_0xe36e('0x9')](_0xe36e('0x10'),_0x265473['id'],_0x265473[_0xe36e('0xd')],_0x924cd5['TranscriptionJob'][_0xe36e('0x11')]));if(!_0x265473[_0xe36e('0x12')]){switch(_0x924cd5['TranscriptionJob'][_0xe36e('0x11')]){case'COMPLETED':var _0x471400={'transcribeStatus':_0x924cd5[_0xe36e('0x13')]['TranscriptionJobStatus'],'fileUri':_0x924cd5[_0xe36e('0x13')][_0xe36e('0x14')][_0xe36e('0x15')]};logger['info'](util[_0xe36e('0x9')](_0xe36e('0x16'),_0x265473['id']));return rp({'uri':_0x924cd5[_0xe36e('0x13')][_0xe36e('0x14')][_0xe36e('0x15')],'json':!![]})[_0xe36e('0xe')](function(_0x4f438a){logger[_0xe36e('0xf')](util[_0xe36e('0x9')](_0xe36e('0x17'),_0x265473['id']));if(_0x4f438a&&_0x4f438a[_0xe36e('0x18')]&&_0x4f438a[_0xe36e('0x18')]['transcripts']&&_0x4f438a['results'][_0xe36e('0x19')][_0xe36e('0x1a')]){_0x471400[_0xe36e('0x12')]='';for(var _0xb32195=0x0;_0xb32195<_0x4f438a[_0xe36e('0x18')][_0xe36e('0x19')][_0xe36e('0x1a')];_0xb32195++){_0x471400['fileText']+=_0x4f438a[_0xe36e('0x18')][_0xe36e('0x19')][_0xb32195][_0xe36e('0x1b')]+'';}}return _0x265473[_0xe36e('0x1c')](_0x471400);})['then'](function(){logger[_0xe36e('0xf')](util['format'](_0xe36e('0x1d'),_0x265473['id']));if(!_0x265473['tempSentiment']){throw new db[(_0xe36e('0x1e'))]['ValidationError'](_0xe36e('0x1f'));}if(!_0x4fbdb2['sentiment']||!_0x4fbdb2[_0xe36e('0x20')]||!_0x4fbdb2['sentimentRegion']||!_0x4fbdb2['language']||!_0x4fbdb2['bucket']){throw new db['Sequelize'][(_0xe36e('0x21'))](_0xe36e('0x22'));}if(!_0x471400['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x4fbdb2[_0xe36e('0x20')]===_0x32981d['id']){return _0x32981d;}else{return db[_0xe36e('0x23')][_0xe36e('0x24')]({'where':{'id':_settings[_0xe36e('0x20')]}});}})[_0xe36e('0xe')](function(_0x4759b4){if(!_0x4759b4){throw new db['Sequelize'][(_0xe36e('0x21'))](_0xe36e('0x25'));}if(!_0x4759b4['data1']||!_0x4759b4[_0xe36e('0xb')]){throw new db[(_0xe36e('0x1e'))][(_0xe36e('0x21'))](_0xe36e('0x26'));}_0x27841e=_0x4759b4;logger[_0xe36e('0xf')](util[_0xe36e('0x9')](_0xe36e('0x27'),_0x265473['id']));return sentiment(_0x27841e[_0xe36e('0xa')],_0x27841e[_0xe36e('0xb')],_0x4fbdb2[_0xe36e('0x28')],_0x471400[_0xe36e('0x12')],_0x4fbdb2['language']);})[_0xe36e('0xe')](function(_0x59231e){logger['info'](util[_0xe36e('0x9')]('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x265473['id']));return _0x265473[_0xe36e('0x1c')]({'sentiment':_0x59231e[_0xe36e('0x29')],'sPositive':_0x59231e[_0xe36e('0x2a')][_0xe36e('0x2b')],'sNegative':_0x59231e['SentimentScore']['Negative'],'sMixed':_0x59231e[_0xe36e('0x2a')][_0xe36e('0x2c')],'sNeutral':_0x59231e[_0xe36e('0x2a')][_0xe36e('0x2d')]});})['then'](function(){logger[_0xe36e('0xf')](util[_0xe36e('0x9')](_0xe36e('0x1d'),_0x265473['id']));_0x23abfb();});case'FAILED':return _0x265473[_0xe36e('0x1c')]({'transcribeStatus':_0xe36e('0x2e'),'failureReason':_0x924cd5['TranscriptionJob'][_0xe36e('0x2f')]})[_0xe36e('0xe')](function(){logger[_0xe36e('0xf')](util[_0xe36e('0x9')](_0xe36e('0x1d'),_0x265473['id']));_0x23abfb();});default:logger[_0xe36e('0xf')](util[_0xe36e('0x9')](_0xe36e('0x30'),_0x265473['id']));break;}}else{return BPromise[_0xe36e('0x31')]()[_0xe36e('0xe')](function(){if(!_0x265473[_0xe36e('0x32')]){throw new db[(_0xe36e('0x1e'))][(_0xe36e('0x21'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x4fbdb2[_0xe36e('0x33')]||!_0x4fbdb2[_0xe36e('0x20')]||!_0x4fbdb2[_0xe36e('0x28')]||!_0x4fbdb2[_0xe36e('0x34')]||!_0x4fbdb2[_0xe36e('0x35')]){throw new db['Sequelize']['ValidationError'](_0xe36e('0x22'));}if(!_0x265473[_0xe36e('0x12')]){throw new Error(_0xe36e('0x36'));}if(_0x4fbdb2[_0xe36e('0x20')]===_0x32981d['id']){return _0x32981d;}else{return db[_0xe36e('0x23')][_0xe36e('0x24')]({'where':{'id':_settings[_0xe36e('0x20')]}});}})[_0xe36e('0xe')](function(_0x48066c){if(!_0x48066c){throw new db[(_0xe36e('0x1e'))][(_0xe36e('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x48066c[_0xe36e('0xa')]||!_0x48066c['data2']){throw new db[(_0xe36e('0x1e'))][(_0xe36e('0x21'))](_0xe36e('0x26'));}_0x27841e=_0x48066c;logger[_0xe36e('0xf')](util[_0xe36e('0x9')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x265473['id']));return sentiment(_0x27841e[_0xe36e('0xa')],_0x27841e[_0xe36e('0xb')],_0x4fbdb2[_0xe36e('0x28')],_0x265473[_0xe36e('0x12')],_0x4fbdb2[_0xe36e('0x34')]);})[_0xe36e('0xe')](function(_0x569809){logger[_0xe36e('0xf')](util[_0xe36e('0x9')](_0xe36e('0x37'),_0x265473['id']));return _0x265473[_0xe36e('0x1c')]({'sentiment':_0x569809[_0xe36e('0x29')],'sPositive':_0x569809['SentimentScore'][_0xe36e('0x2b')],'sNegative':_0x569809[_0xe36e('0x2a')][_0xe36e('0x38')],'sMixed':_0x569809[_0xe36e('0x2a')][_0xe36e('0x2c')],'sNeutral':_0x569809[_0xe36e('0x2a')][_0xe36e('0x2d')],'transcribeStatus':_0xe36e('0x39')});})[_0xe36e('0xe')](function(){logger['info'](util['format'](_0xe36e('0x1d'),_0x265473['id']));_0x23abfb();});}})['catch'](function(_0x1f697f){if(_0x1f697f){if(!_0x1f697f[_0xe36e('0x3a')]||_0x1f697f[_0xe36e('0x3a')]!==_0xe36e('0x3b')){logger['error'](util[_0xe36e('0x9')](_0xe36e('0x3c'),_0x265473['id']),util['inspect'](_0x1f697f,{'showHidden':![],'depth':null}));}}_0x23abfb();});});}function checkTranscribe(){var _0x125e62;var _0x40634a;var _0x2c26e6;return db[_0xe36e('0x3d')][_0xe36e('0x3e')]({'where':{'transcribeStatus':_0xe36e('0x3f')}})[_0xe36e('0xe')](function(_0xaf917c){if(!_0xaf917c||!_0xaf917c[_0xe36e('0x1a')]){throw new db[(_0xe36e('0x1e'))][(_0xe36e('0x21'))](_0xe36e('0x40'));}_0x125e62=_0xaf917c;return db[_0xe36e('0x41')][_0xe36e('0x24')]({'where':{'id':0x1}});})[_0xe36e('0xe')](function(_0x5678d3){if(!_0x5678d3){throw new db[(_0xe36e('0x1e'))]['ValidationError']('Settings\x20not\x20available');}_0x40634a=_0x5678d3;if(!_0x40634a[_0xe36e('0x4')]||!_0x40634a[_0xe36e('0x42')]||!_0x40634a['transcribeRegion']||!_0x40634a[_0xe36e('0x34')]||!_0x40634a[_0xe36e('0x35')]){throw new db[(_0xe36e('0x1e'))][(_0xe36e('0x21'))](_0xe36e('0x43'));}return db[_0xe36e('0x23')][_0xe36e('0x24')]({'where':{'id':_0x40634a[_0xe36e('0x42')]}});})[_0xe36e('0xe')](function(_0x55d190){if(!_0x55d190){throw new db[(_0xe36e('0x1e'))][(_0xe36e('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x55d190[_0xe36e('0xa')]||!_0x55d190[_0xe36e('0xb')]){throw new db[(_0xe36e('0x1e'))][(_0xe36e('0x21'))](_0xe36e('0x26'));}_0x2c26e6=_0x55d190;var _0x53758e=[];_0x125e62['forEach'](function(_0x56f5b6){_0x53758e['push'](checkTranscribeJob(_0x56f5b6,_0x40634a,_0x2c26e6));});return BPromise[_0xe36e('0x44')](_0x53758e);})[_0xe36e('0x45')](function(_0x283365){if(_0x283365){if(!_0x283365[_0xe36e('0x3a')]||_0x283365[_0xe36e('0x3a')]!==_0xe36e('0x3b')){logger[_0xe36e('0x46')](util[_0xe36e('0x47')](_0x283365,{'showHidden':![],'depth':null}));}}});}exports[_0xe36e('0x48')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x05e3=['detectSentiment','substring','info','format','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','fileText','[RECORDING:%d]\x20Get\x20transcript','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','sentimentAccountId','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','Sentiment','SentimentScore','Mixed','Neutral','FAILED','FailureReason','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','Transcript\x20not\x20available','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Negative','COMPLETED','catch','name','error','inspect','VoiceRecording','findAll','IN_PROGRESS','Settings\x20not\x20available','transcribe','transcribeAccountId','push','SequelizeValidationError','start','lodash','aws-sdk','request-promise','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend'];(function(_0x190385,_0x238c8e){var _0x58275c=function(_0x316fd9){while(--_0x316fd9){_0x190385['push'](_0x190385['shift']());}};_0x58275c(++_0x238c8e);}(_0x05e3,0x86));var _0x305e=function(_0x2f5aaa,_0x1aa542){_0x2f5aaa=_0x2f5aaa-0x0;var _0x23b9b6=_0x05e3[_0x2f5aaa];return _0x23b9b6;};var _=require(_0x305e('0x0'));var AWS=require(_0x305e('0x1'));var rp=require(_0x305e('0x2'));var util=require('util');var BPromise=require('bluebird');var db=require(_0x305e('0x3'))['db'];var logger=require(_0x305e('0x4'))('transcribe');function getTranscriptionJob(_0x409b14,_0x112f54,_0x47b973,_0xd743b8){return new Promise(function(_0x404744,_0xfadd27){var _0x143428=new AWS[(_0x305e('0x5'))]({'accessKeyId':_0x112f54,'secretAccessKey':_0x409b14,'region':_0x47b973});_0x143428[_0x305e('0x6')]({'TranscriptionJobName':_0xd743b8},function(_0x86ade0,_0x952a5e){if(_0x86ade0){return _0xfadd27(_0x86ade0);}else{return _0x404744(_0x952a5e);}});});}function sentiment(_0x5e5b91,_0x2fd0bd,_0x4a66fd,_0x2579f6,_0x768a4a){return new Promise(function(_0x557e21,_0x38ead1){var _0x2d92d5=new AWS[(_0x305e('0x7'))]({'accessKeyId':_0x2fd0bd,'secretAccessKey':_0x5e5b91,'region':_0x4a66fd});_0x2d92d5[_0x305e('0x8')]({'Text':_0x2579f6,'LanguageCode':_0x768a4a[_0x305e('0x9')](0x0,0x2)},function(_0x1ae997,_0x67c8f5){if(_0x1ae997){return _0x38ead1(_0x1ae997);}else{return _0x557e21(_0x67c8f5);}});});}function checkTranscribeJob(_0x18f6ca,_0x350b,_0x301068){var _0x3535b9;return new BPromise(function(_0x233bc5,_0x57e8d5){logger[_0x305e('0xa')](util[_0x305e('0xb')]('[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)',_0x18f6ca['id'],_0x18f6ca[_0x305e('0xc')]));return getTranscriptionJob(_0x301068[_0x305e('0xd')],_0x301068[_0x305e('0xe')],_0x350b[_0x305e('0xf')],_0x18f6ca[_0x305e('0xc')])[_0x305e('0x10')](function(_0x475ef4){logger['info'](util[_0x305e('0xb')](_0x305e('0x11'),_0x18f6ca['id'],_0x18f6ca['transcribeName'],_0x475ef4[_0x305e('0x12')][_0x305e('0x13')]));if(!_0x18f6ca[_0x305e('0x14')]){switch(_0x475ef4[_0x305e('0x12')][_0x305e('0x13')]){case'COMPLETED':var _0x55f0fb={'transcribeStatus':_0x475ef4['TranscriptionJob']['TranscriptionJobStatus'],'fileUri':_0x475ef4['TranscriptionJob']['Transcript']['TranscriptFileUri']};logger[_0x305e('0xa')](util[_0x305e('0xb')](_0x305e('0x15'),_0x18f6ca['id']));return rp({'uri':_0x475ef4[_0x305e('0x12')][_0x305e('0x16')][_0x305e('0x17')],'json':!![]})['then'](function(_0x472d2b){logger['info'](util[_0x305e('0xb')](_0x305e('0x18'),_0x18f6ca['id']));if(_0x472d2b&&_0x472d2b['results']&&_0x472d2b[_0x305e('0x19')][_0x305e('0x1a')]&&_0x472d2b[_0x305e('0x19')][_0x305e('0x1a')][_0x305e('0x1b')]){_0x55f0fb[_0x305e('0x14')]='';for(var _0x30cea3=0x0;_0x30cea3<_0x472d2b[_0x305e('0x19')][_0x305e('0x1a')]['length'];_0x30cea3++){_0x55f0fb['fileText']+=_0x472d2b[_0x305e('0x19')][_0x305e('0x1a')][_0x30cea3][_0x305e('0x1c')]+'';}}return _0x18f6ca[_0x305e('0x1d')](_0x55f0fb);})[_0x305e('0x10')](function(){logger['info'](util['format'](_0x305e('0x1e'),_0x18f6ca['id']));if(!_0x18f6ca[_0x305e('0x1f')]){throw new db[(_0x305e('0x20'))][(_0x305e('0x21'))](_0x305e('0x22'));}if(!_0x350b['sentiment']||!_0x350b['sentimentAccountId']||!_0x350b[_0x305e('0x23')]||!_0x350b[_0x305e('0x24')]||!_0x350b[_0x305e('0x25')]){throw new db[(_0x305e('0x20'))]['ValidationError'](_0x305e('0x26'));}if(!_0x55f0fb[_0x305e('0x14')]){throw new Error('Transcript\x20not\x20available');}if(_0x350b[_0x305e('0x27')]===_0x301068['id']){return _0x301068;}else{return db[_0x305e('0x28')][_0x305e('0x29')]({'where':{'id':_settings[_0x305e('0x27')]}});}})[_0x305e('0x10')](function(_0x517ccb){if(!_0x517ccb){throw new db['Sequelize'][(_0x305e('0x21'))](_0x305e('0x2a'));}if(!_0x517ccb['data1']||!_0x517ccb['data2']){throw new db[(_0x305e('0x20'))][(_0x305e('0x21'))](_0x305e('0x2b'));}_0x3535b9=_0x517ccb;logger['info'](util[_0x305e('0xb')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x18f6ca['id']));return sentiment(_0x3535b9[_0x305e('0xd')],_0x3535b9[_0x305e('0xe')],_0x350b[_0x305e('0x23')],_0x55f0fb[_0x305e('0x14')],_0x350b[_0x305e('0x24')]);})[_0x305e('0x10')](function(_0x3c4409){logger['info'](util[_0x305e('0xb')](_0x305e('0x2c'),_0x18f6ca['id']));return _0x18f6ca[_0x305e('0x1d')]({'sentiment':_0x3c4409[_0x305e('0x2d')],'sPositive':_0x3c4409[_0x305e('0x2e')]['Positive'],'sNegative':_0x3c4409[_0x305e('0x2e')]['Negative'],'sMixed':_0x3c4409[_0x305e('0x2e')][_0x305e('0x2f')],'sNeutral':_0x3c4409[_0x305e('0x2e')][_0x305e('0x30')]});})[_0x305e('0x10')](function(){logger[_0x305e('0xa')](util[_0x305e('0xb')](_0x305e('0x1e'),_0x18f6ca['id']));_0x233bc5();});case _0x305e('0x31'):return _0x18f6ca[_0x305e('0x1d')]({'transcribeStatus':_0x305e('0x31'),'failureReason':_0x475ef4['TranscriptionJob'][_0x305e('0x32')]})[_0x305e('0x10')](function(){logger[_0x305e('0xa')](util[_0x305e('0xb')](_0x305e('0x1e'),_0x18f6ca['id']));_0x233bc5();});default:logger[_0x305e('0xa')](util[_0x305e('0xb')](_0x305e('0x33'),_0x18f6ca['id']));break;}}else{return BPromise[_0x305e('0x34')]()[_0x305e('0x10')](function(){if(!_0x18f6ca[_0x305e('0x1f')]){throw new db[(_0x305e('0x20'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x350b[_0x305e('0x35')]||!_0x350b['sentimentAccountId']||!_0x350b[_0x305e('0x23')]||!_0x350b[_0x305e('0x24')]||!_0x350b[_0x305e('0x25')]){throw new db[(_0x305e('0x20'))]['ValidationError'](_0x305e('0x26'));}if(!_0x18f6ca[_0x305e('0x14')]){throw new Error(_0x305e('0x36'));}if(_0x350b[_0x305e('0x27')]===_0x301068['id']){return _0x301068;}else{return db[_0x305e('0x28')]['findOne']({'where':{'id':_settings[_0x305e('0x27')]}});}})[_0x305e('0x10')](function(_0x5eab2e){if(!_0x5eab2e){throw new db['Sequelize'][(_0x305e('0x21'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x5eab2e['data1']||!_0x5eab2e[_0x305e('0xe')]){throw new db[(_0x305e('0x20'))]['ValidationError'](_0x305e('0x2b'));}_0x3535b9=_0x5eab2e;logger[_0x305e('0xa')](util[_0x305e('0xb')](_0x305e('0x37'),_0x18f6ca['id']));return sentiment(_0x3535b9[_0x305e('0xd')],_0x3535b9[_0x305e('0xe')],_0x350b[_0x305e('0x23')],_0x18f6ca[_0x305e('0x14')],_0x350b[_0x305e('0x24')]);})[_0x305e('0x10')](function(_0x3d7f14){logger[_0x305e('0xa')](util[_0x305e('0xb')](_0x305e('0x2c'),_0x18f6ca['id']));return _0x18f6ca[_0x305e('0x1d')]({'sentiment':_0x3d7f14['Sentiment'],'sPositive':_0x3d7f14[_0x305e('0x2e')]['Positive'],'sNegative':_0x3d7f14[_0x305e('0x2e')][_0x305e('0x38')],'sMixed':_0x3d7f14[_0x305e('0x2e')][_0x305e('0x2f')],'sNeutral':_0x3d7f14[_0x305e('0x2e')][_0x305e('0x30')],'transcribeStatus':_0x305e('0x39')});})[_0x305e('0x10')](function(){logger[_0x305e('0xa')](util[_0x305e('0xb')](_0x305e('0x1e'),_0x18f6ca['id']));_0x233bc5();});}})[_0x305e('0x3a')](function(_0x37b089){if(_0x37b089){if(!_0x37b089[_0x305e('0x3b')]||_0x37b089[_0x305e('0x3b')]!=='SequelizeValidationError'){logger[_0x305e('0x3c')](util[_0x305e('0xb')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x18f6ca['id']),util[_0x305e('0x3d')](_0x37b089,{'showHidden':![],'depth':null}));}}_0x233bc5();});});}function checkTranscribe(){var _0x102d8e;var _0x2c0c1d;var _0x3abf32;return db[_0x305e('0x3e')][_0x305e('0x3f')]({'where':{'transcribeStatus':_0x305e('0x40')}})[_0x305e('0x10')](function(_0x168bdb){if(!_0x168bdb||!_0x168bdb[_0x305e('0x1b')]){throw new db['Sequelize'][(_0x305e('0x21'))]('No\x20transcribe\x20job\x20to\x20check');}_0x102d8e=_0x168bdb;return db['Setting'][_0x305e('0x29')]({'where':{'id':0x1}});})['then'](function(_0x5e7c80){if(!_0x5e7c80){throw new db['Sequelize']['ValidationError'](_0x305e('0x41'));}_0x2c0c1d=_0x5e7c80;if(!_0x2c0c1d[_0x305e('0x42')]||!_0x2c0c1d[_0x305e('0x43')]||!_0x2c0c1d[_0x305e('0xf')]||!_0x2c0c1d['language']||!_0x2c0c1d[_0x305e('0x25')]){throw new db[(_0x305e('0x20'))][(_0x305e('0x21'))]('Transcribe\x20not\x20configured');}return db[_0x305e('0x28')][_0x305e('0x29')]({'where':{'id':_0x2c0c1d['transcribeAccountId']}});})['then'](function(_0x54e28a){if(!_0x54e28a){throw new db[(_0x305e('0x20'))][(_0x305e('0x21'))](_0x305e('0x2a'));}if(!_0x54e28a['data1']||!_0x54e28a[_0x305e('0xe')]){throw new db[(_0x305e('0x20'))][(_0x305e('0x21'))](_0x305e('0x2b'));}_0x3abf32=_0x54e28a;var _0x39455b=[];_0x102d8e['forEach'](function(_0x377010){_0x39455b[_0x305e('0x44')](checkTranscribeJob(_0x377010,_0x2c0c1d,_0x3abf32));});return BPromise['all'](_0x39455b);})['catch'](function(_0xc4af8a){if(_0xc4af8a){if(!_0xc4af8a[_0x305e('0x3b')]||_0xc4af8a[_0x305e('0x3b')]!==_0x305e('0x45')){logger['error'](util['inspect'](_0xc4af8a,{'showHidden':![],'depth':null}));}}});}exports[_0x305e('0x46')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 8f6690f..0e56f0b 100644 --- a/server/config/schedule/whatsapp.js +++ b/server/config/schedule/whatsapp.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8fb=['error','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','redis','defaults','localhost','socket.io-emitter','findAll','lastMsgAt','subtract','hours','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','WhatsappInteraction','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch'];(function(_0x5e42a7,_0x3eba35){var _0x36d21b=function(_0x567f0a){while(--_0x567f0a){_0x5e42a7['push'](_0x5e42a7['shift']());}};_0x36d21b(++_0x3eba35);}(_0xf8fb,0x184));var _0xbf8f=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xf8fb[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0xbf8f('0x0'));var moment=require('moment');var Redis=require(_0xbf8f('0x1'));var util=require(_0xbf8f('0x2'));var config=require(_0xbf8f('0x3'));var db=require(_0xbf8f('0x4'))['db'];var logger=require(_0xbf8f('0x5'))('schedule');config[_0xbf8f('0x6')]=_[_0xbf8f('0x7')](config[_0xbf8f('0x6')],{'host':_0xbf8f('0x8'),'port':0x18eb});var io=require(_0xbf8f('0x9'))(new Redis(config[_0xbf8f('0x6')]));function closeInteractions(){var _0x36a720=[];return db['WhatsappInteraction'][_0xbf8f('0xa')]({'raw':!![],'attributes':['id',_0xbf8f('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0xbf8f('0xc')](0x18,_0xbf8f('0xd'))}}})[_0xbf8f('0xe')](function(_0x440729){if(_0x440729&&_0x440729[_0xbf8f('0xf')]){_0x36a720=_[_0xbf8f('0x10')](_0x440729||[],'id');logger[_0xbf8f('0x11')](_0xbf8f('0x12'),_0x36a720[_0xbf8f('0x13')]());return db[_0xbf8f('0x14')]['update']({'closeReason':'system','disposition':_0xbf8f('0x15'),'closed':!![],'closedAt':moment()[_0xbf8f('0x16')](_0xbf8f('0x17'))},{'where':{'id':_0x36a720}});}})[_0xbf8f('0xe')](function(){if(_0x36a720&&_0x36a720[_0xbf8f('0xf')]){logger['info'](_0xbf8f('0x18'),_0x36a720['join']());for(var _0xf812ee=0x0;_0xf812ee<_0x36a720[_0xbf8f('0xf')];_0xf812ee++){io[_0xbf8f('0x19')](_0xbf8f('0x1a'),{'id':_0x36a720[_0xf812ee],'closed':!![]});}}})[_0xbf8f('0x1b')](function(_0x1f6e44){logger[_0xbf8f('0x1c')](_0xbf8f('0x1d'),_0x1f6e44?util[_0xbf8f('0x1e')](_0x1f6e44,{'showHidden':![],'depth':null}):'');});}exports[_0xbf8f('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x6eb2=['findAll','subtract','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','update','system','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','join','emit','catch','error','inspect','start','lodash','ioredis','../../mysqldb','../logger','schedule','redis','defaults','localhost','WhatsappInteraction'];(function(_0x4bfcbe,_0x4630f5){var _0x5b65e6=function(_0x5dcfc8){while(--_0x5dcfc8){_0x4bfcbe['push'](_0x4bfcbe['shift']());}};_0x5b65e6(++_0x4630f5);}(_0x6eb2,0x10a));var _0x26eb=function(_0x5d3f51,_0x3025b6){_0x5d3f51=_0x5d3f51-0x0;var _0x24bcdb=_0x6eb2[_0x5d3f51];return _0x24bcdb;};'use strict';var _=require(_0x26eb('0x0'));var moment=require('moment');var Redis=require(_0x26eb('0x1'));var util=require('util');var config=require('../../config/environment');var db=require(_0x26eb('0x2'))['db'];var logger=require(_0x26eb('0x3'))(_0x26eb('0x4'));config[_0x26eb('0x5')]=_[_0x26eb('0x6')](config[_0x26eb('0x5')],{'host':_0x26eb('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x26eb('0x5')]));function closeInteractions(){var _0x352ab5=[];return db[_0x26eb('0x8')][_0x26eb('0x9')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x26eb('0xa')](0x18,'hours')}}})[_0x26eb('0xb')](function(_0x2e7c53){if(_0x2e7c53&&_0x2e7c53['length']){_0x352ab5=_[_0x26eb('0xc')](_0x2e7c53||[],'id');logger[_0x26eb('0xd')](_0x26eb('0xe'),_0x352ab5['join']());return db[_0x26eb('0x8')][_0x26eb('0xf')]({'closeReason':_0x26eb('0x10'),'disposition':'timeout','closed':!![],'closedAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x352ab5}});}})[_0x26eb('0xb')](function(){if(_0x352ab5&&_0x352ab5[_0x26eb('0x11')]){logger[_0x26eb('0xd')](_0x26eb('0x12'),_0x352ab5[_0x26eb('0x13')]());for(var _0x427897=0x0;_0x427897<_0x352ab5[_0x26eb('0x11')];_0x427897++){io[_0x26eb('0x14')]('whatsappInteraction:update',{'id':_0x352ab5[_0x427897],'closed':!![]});}}})[_0x26eb('0x15')](function(_0x2047fe){logger[_0x26eb('0x16')]('[WHATSAPP]\x20Error\x20closing\x20interactions',_0x2047fe?util[_0x26eb('0x17')](_0x2047fe,{'showHidden':![],'depth':null}):'');});}exports[_0x26eb('0x18')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 548367b..36f4277 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5787=['Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts1','CmHopper','hopper1','hopper2','util','../mysqldb','push','Innocenzo'];(function(_0x3b632f,_0x453380){var _0x10e788=function(_0x2228a4){while(--_0x2228a4){_0x3b632f['push'](_0x3b632f['shift']());}};_0x10e788(++_0x453380);}(_0x5787,0xb0));var _0x7578=function(_0x5b6bc6,_0x25d088){_0x5b6bc6=_0x5b6bc6-0x0;var _0x41fcc5=_0x5787[_0x5b6bc6];return _0x41fcc5;};'use strict';var util=require(_0x7578('0x0'));var db=require(_0x7578('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x7578('0x2')]({'id':i,'firstName':_0x7578('0x3')+i,'lastName':_0x7578('0x4')+i,'phone':0xf879fb460+i,'email':_0x7578('0x5')+i+_0x7578('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x7578('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x7578('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x7578('0x2')]({'id':i,'firstName':_0x7578('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x7578('0x5')+i+_0x7578('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x7578('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x7578('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7578('0x7')](),'updatedAt':Date[_0x7578('0x7')]()});}db[_0x7578('0x8')][_0x7578('0x9')]({'where':{}})[_0x7578('0xa')](function(){return db[_0x7578('0x8')][_0x7578('0xb')](contacts);})['then'](function(){console[_0x7578('0xc')](_0x7578('0xd'),_0x7578('0xe'));return db[_0x7578('0xf')][_0x7578('0x9')]({'where':{}});})[_0x7578('0xa')](function(){return db[_0x7578('0xf')][_0x7578('0xb')](hopper);})[_0x7578('0xa')](function(){console[_0x7578('0xc')](_0x7578('0xd'),_0x7578('0x10'));return db['CmContact'][_0x7578('0xb')](contacts2);})[_0x7578('0xa')](function(){console[_0x7578('0xc')]('finished\x20populating','contacts2');return db[_0x7578('0xf')][_0x7578('0xb')](hopper2);})[_0x7578('0xa')](function(){console[_0x7578('0xc')](_0x7578('0xd'),_0x7578('0x11'));})['catch'](function(_0xe2b191){console[_0x7578('0xc')](_0xe2b191);}); \ No newline at end of file +var _0x70fb=['log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2','catch','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate'];(function(_0x7017e7,_0x243d54){var _0x12331a=function(_0x466138){while(--_0x466138){_0x7017e7['push'](_0x7017e7['shift']());}};_0x12331a(++_0x243d54);}(_0x70fb,0x138));var _0xb70f=function(_0x28ac84,_0x2a75fa){_0x28ac84=_0x28ac84-0x0;var _0x10c42a=_0x70fb[_0x28ac84];return _0x10c42a;};'use strict';var util=require('util');var db=require(_0xb70f('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xb70f('0x1')]({'id':i,'firstName':_0xb70f('0x2')+i,'lastName':_0xb70f('0x3')+i,'phone':0xf879fb460+i,'email':_0xb70f('0x4')+i+_0xb70f('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xb70f('0x1')]({'id':i,'active':![],'scheduledat':Date[_0xb70f('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xb70f('0x6')](),'updatedAt':Date[_0xb70f('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0xb70f('0x2')+i,'lastName':_0xb70f('0x3')+i,'phone':0xf879fb460+i,'email':_0xb70f('0x4')+i+_0xb70f('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xb70f('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xb70f('0x6')]()});}db[_0xb70f('0x7')][_0xb70f('0x8')]({'where':{}})[_0xb70f('0x9')](function(){return db['CmContact'][_0xb70f('0xa')](contacts);})[_0xb70f('0x9')](function(){console[_0xb70f('0xb')](_0xb70f('0xc'),_0xb70f('0xd'));return db[_0xb70f('0xe')]['destroy']({'where':{}});})[_0xb70f('0x9')](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0xb70f('0x9')](function(){console[_0xb70f('0xb')](_0xb70f('0xc'),_0xb70f('0xf'));return db['CmContact'][_0xb70f('0xa')](contacts2);})[_0xb70f('0x9')](function(){console[_0xb70f('0xb')](_0xb70f('0xc'),_0xb70f('0x10'));return db['CmHopper'][_0xb70f('0xa')](hopper2);})[_0xb70f('0x9')](function(){console['log'](_0xb70f('0xc'),_0xb70f('0x11'));})[_0xb70f('0x12')](function(_0xec9a64){console[_0xb70f('0xb')](_0xec9a64);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 65f9636..6ba240a 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd70b=['../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','add\x20user','catch','log','util'];(function(_0x586042,_0x335fbf){var _0x3cccab=function(_0x2aa2d9){while(--_0x2aa2d9){_0x586042['push'](_0x586042['shift']());}};_0x3cccab(++_0x335fbf);}(_0xd70b,0xdb));var _0xbd70=function(_0x2d2ca2,_0x51873f){_0x2d2ca2=_0x2d2ca2-0x0;var _0x48489d=_0xd70b[_0x2d2ca2];return _0x48489d;};'use strict';var util=require(_0xbd70('0x0'));var db=require(_0xbd70('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xbd70('0x2')]({'name':util[_0xbd70('0x3')](_0xbd70('0x4'),_0xbd70('0x5'),i),'fullname':util[_0xbd70('0x3')](_0xbd70('0x4'),'agent',i),'email':util[_0xbd70('0x3')](_0xbd70('0x6'),_0xbd70('0x5'),i),'role':_0xbd70('0x5'),'password':_0xbd70('0x7'),'internal':0xfa0+i,'type':'friend','transport':[_0xbd70('0x8'),'ws',_0xbd70('0x9')],'disallow':[_0xbd70('0xa')],'allow':[_0xbd70('0xb')],'defaultuser':util[_0xbd70('0x3')]('%s%s',_0xbd70('0x5'),i),'encryption':_0xbd70('0xc'),'avpf':_0xbd70('0xc'),'force_avp':_0xbd70('0xc'),'icesupport':_0xbd70('0xc'),'dtlsenable':_0xbd70('0xc'),'dtlsverify':'no','dtlscertfile':_0xbd70('0xd'),'dtlsprivatekey':_0xbd70('0xe'),'dtlssetup':_0xbd70('0xf'),'callerid':util[_0xbd70('0x3')](_0xbd70('0x10'),util[_0xbd70('0x3')](_0xbd70('0x4'),'agent',i),0xfa0+i)});}db[_0xbd70('0x11')][_0xbd70('0x12')](users)['then'](function(){console['log'](_0xbd70('0x13'));})[_0xbd70('0x14')](function(_0x1b936a){console[_0xbd70('0x15')](_0x1b936a);}); \ No newline at end of file +var _0x4e9e=['yes','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','format','%s%s','agent','%s%s@xcally.com','password','friend','all'];(function(_0x21ef6a,_0x3a6814){var _0x22beb2=function(_0x4d2ccc){while(--_0x4d2ccc){_0x21ef6a['push'](_0x21ef6a['shift']());}};_0x22beb2(++_0x3a6814);}(_0x4e9e,0xf3));var _0xe4e9=function(_0x18d38c,_0xc5c2d3){_0x18d38c=_0x18d38c-0x0;var _0x474ba7=_0x4e9e[_0x18d38c];return _0x474ba7;};'use strict';var util=require(_0xe4e9('0x0'));var db=require(_0xe4e9('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0xe4e9('0x2')](_0xe4e9('0x3'),_0xe4e9('0x4'),i),'fullname':util[_0xe4e9('0x2')]('%s%s','agent',i),'email':util[_0xe4e9('0x2')](_0xe4e9('0x5'),'agent',i),'role':_0xe4e9('0x4'),'password':_0xe4e9('0x6'),'internal':0xfa0+i,'type':_0xe4e9('0x7'),'transport':['udp','ws','wss'],'disallow':[_0xe4e9('0x8')],'allow':['ulaw'],'defaultuser':util[_0xe4e9('0x2')]('%s%s','agent',i),'encryption':_0xe4e9('0x9'),'avpf':_0xe4e9('0x9'),'force_avp':_0xe4e9('0x9'),'icesupport':_0xe4e9('0x9'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0xe4e9('0xa'),'dtlssetup':_0xe4e9('0xb'),'callerid':util['format'](_0xe4e9('0xc'),util[_0xe4e9('0x2')](_0xe4e9('0x3'),_0xe4e9('0x4'),i),0xfa0+i)});}db['User'][_0xe4e9('0xd')](users)[_0xe4e9('0xe')](function(){console[_0xe4e9('0xf')](_0xe4e9('0x10'));})[_0xe4e9('0x11')](function(_0x114b81){console['log'](_0x114b81);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 8c76f64..cecdd1c 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb1ad=['findOne','then','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','where','Campaign','format','%s:queue:%s','Agents','length','user:%s','query','find','userProfileId','handshake','ChatInteraction','ChatInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteractions','admin','voice:outbound','hasOwnProperty','include','VoiceQueue','push','FaxQueue','MailQueue','OpenchannelQueue','WhatsappQueue','user','VoiceQueues','SmsQueue','Trunk','getVoiceQueues','getChatQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','map','emit','user_has_chat_interactions:remove','leave','MailInteractions','removeMailInteractions','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeSmsInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','request','connection','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','address','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','User','role','agent','telephone','type','ivr'];(function(_0x3f9a54,_0x3b3c36){var _0x2b1780=function(_0x4bdf57){while(--_0x4bdf57){_0x3f9a54['push'](_0x3f9a54['shift']());}};_0x2b1780(++_0x3b3c36);}(_0xb1ad,0x184));var _0xdb1a=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xb1ad[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0xdb1a('0x0'));var util=require(_0xdb1a('0x1'));var BPromise=require(_0xdb1a('0x2'));var db=require(_0xdb1a('0x3'))['db'];var config=require(_0xdb1a('0x4'));var queryQueues={'attributes':['id',_0xdb1a('0x5')],'include':[{'as':'Agents','model':db[_0xdb1a('0x6')],'attributes':['id',_0xdb1a('0x5'),_0xdb1a('0x7')],'raw':!![],'where':{'role':_0xdb1a('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xdb1a('0x5')],'where':{'role':_0xdb1a('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0xdb1a('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xdb1a('0x5')],'where':{'role':_0xdb1a('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xdb1a('0x5'),_0xdb1a('0xa')],'where':{'type':_0xdb1a('0xb')}};function getAssociatedResources(_0xf62df9,_0x174303,_0x122af8){return db['UserProfileSection'][_0xdb1a('0xc')]({'where':{'name':_0xf62df9,'userProfileId':_0x174303},'raw':!![]})[_0xdb1a('0xd')](function(_0x5a36cf){if(_0x5a36cf){if(_0x5a36cf['autoAssociation']){switch(_0xf62df9){case'VoiceQueues':case _0xdb1a('0xe'):case _0xdb1a('0xf'):case _0xdb1a('0x10'):case _0xdb1a('0x11'):case _0xdb1a('0x12'):case _0xdb1a('0x13'):return db[_0x122af8][_0xdb1a('0x14')](queryQueues);case _0xdb1a('0x15'):return db[_0x122af8][_0xdb1a('0x14')](queryTelephones);case _0xdb1a('0x16'):return db[_0x122af8][_0xdb1a('0x14')](queryTrunks);case _0xdb1a('0x17'):return db[_0x122af8][_0xdb1a('0x14')](queryCampaigns);}}else{return db['UserProfileResource'][_0xdb1a('0x14')]({'attributes':[_0xdb1a('0x18')],'where':{'sectionId':_0x5a36cf['id']},'raw':!![]})[_0xdb1a('0xd')](function(_0x4bdec7){if(_0x4bdec7){var _0x28dfe9={'where':{'id':_['map'](_0x4bdec7,_0xdb1a('0x18'))},'raw':!![]};switch(_0x122af8){case _0xdb1a('0x6'):_0x28dfe9[_0xdb1a('0x19')]['role']=_0xdb1a('0x9');break;case _0xdb1a('0x1a'):_0x28dfe9[_0xdb1a('0x19')]['type']=_0xdb1a('0xb');break;}return db[_0x122af8][_0xdb1a('0x14')](_0x28dfe9);}else{return[];}});}}else{return[];}})[_0xdb1a('0xd')](function(_0x15fc44){return _0x15fc44;});}function joinOrLeaveQueues(_0x37e10c,_0x2882e2,_0x572ee2,_0xde9106){_0x37e10c[_0x2882e2](util[_0xdb1a('0x1b')](_0xdb1a('0x1c'),_0x572ee2,_0xde9106[_0xdb1a('0x5')]));if(_0xde9106[_0xdb1a('0x1d')]){for(var _0x400397=0x0;_0x400397<_0xde9106[_0xdb1a('0x1d')][_0xdb1a('0x1e')];_0x400397+=0x1){_0x37e10c[_0x2882e2](util[_0xdb1a('0x1b')](_0xdb1a('0x1f'),_0xde9106['Agents'][_0x400397][_0xdb1a('0x5')]));}}}function joinOrLeave(_0x4de659,_0x28ccfe,_0x2cc1aa){var _0x3d07fc;if(_0x4de659['handshake'][_0xdb1a('0x20')]['id']){db['User'][_0xdb1a('0x21')]({'attributes':['id',_0xdb1a('0x5'),_0xdb1a('0x7'),_0xdb1a('0x22')],'where':{'id':_0x4de659[_0xdb1a('0x23')][_0xdb1a('0x20')]['id']},'include':[{'model':db[_0xdb1a('0x24')],'as':_0xdb1a('0x25'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xdb1a('0x26')],'as':_0xdb1a('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xdb1a('0x28')],'as':_0xdb1a('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xdb1a('0x2a')],'as':_0xdb1a('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['WhatsappInteraction'],'as':_0xdb1a('0x2c'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x5a67c4){if(_0x5a67c4){_0x3d07fc=_0x5a67c4;_0x4de659[_0x28ccfe](util[_0xdb1a('0x1b')]('user:%s',_0x5a67c4['name']));var _0x3a860d=[];switch(_0x5a67c4[_0xdb1a('0x7')]){case _0xdb1a('0x2d'):_0x4de659[_0x28ccfe]('voice:inbound');_0x4de659[_0x28ccfe](_0xdb1a('0x2e'));if(queryQueues[_0xdb1a('0x2f')](_0xdb1a('0x30'))){delete queryQueues[_0xdb1a('0x30')];}_0x3a860d['push'](db[_0xdb1a('0x31')][_0xdb1a('0x14')](queryQueues));_0x3a860d[_0xdb1a('0x32')](db['ChatQueue'][_0xdb1a('0x14')](queryQueues));_0x3a860d[_0xdb1a('0x32')](db[_0xdb1a('0x33')][_0xdb1a('0x14')](queryQueues));_0x3a860d['push'](db['SmsQueue']['findAll'](queryQueues));_0x3a860d[_0xdb1a('0x32')](db[_0xdb1a('0x34')]['findAll'](queryQueues));_0x3a860d[_0xdb1a('0x32')](db[_0xdb1a('0x35')][_0xdb1a('0x14')](queryQueues));_0x3a860d[_0xdb1a('0x32')](db[_0xdb1a('0x36')]['findAll'](queryQueues));_0x3a860d['push'](db['User'][_0xdb1a('0x14')](queryTelephones));_0x3a860d['push'](db['Trunk'][_0xdb1a('0x14')](queryTrunks));_0x3a860d[_0xdb1a('0x32')](db['Campaign'][_0xdb1a('0x14')](queryCampaigns));_0x3a860d[_0xdb1a('0x32')](db[_0xdb1a('0x6')][_0xdb1a('0x14')](queryAgents));break;case _0xdb1a('0x37'):_0x4de659[_0x28ccfe]('voice:inbound');_0x4de659[_0x28ccfe]('voice:outbound');_0x3a860d[_0xdb1a('0x32')](getAssociatedResources(_0xdb1a('0x38'),_0x5a67c4[_0xdb1a('0x22')],_0xdb1a('0x31')));_0x3a860d[_0xdb1a('0x32')](getAssociatedResources(_0xdb1a('0xe'),_0x5a67c4[_0xdb1a('0x22')],'ChatQueue'));_0x3a860d[_0xdb1a('0x32')](getAssociatedResources('FaxQueues',_0x5a67c4['userProfileId'],'FaxQueue'));_0x3a860d['push'](getAssociatedResources(_0xdb1a('0x10'),_0x5a67c4[_0xdb1a('0x22')],_0xdb1a('0x39')));_0x3a860d[_0xdb1a('0x32')](getAssociatedResources(_0xdb1a('0x11'),_0x5a67c4[_0xdb1a('0x22')],_0xdb1a('0x34')));_0x3a860d[_0xdb1a('0x32')](getAssociatedResources(_0xdb1a('0x12'),_0x5a67c4[_0xdb1a('0x22')],_0xdb1a('0x35')));_0x3a860d[_0xdb1a('0x32')](getAssociatedResources(_0xdb1a('0x13'),_0x5a67c4[_0xdb1a('0x22')],_0xdb1a('0x36')));_0x3a860d[_0xdb1a('0x32')](getAssociatedResources('Telephones',_0x5a67c4['userProfileId'],_0xdb1a('0x6')));_0x3a860d[_0xdb1a('0x32')](getAssociatedResources(_0xdb1a('0x16'),_0x5a67c4[_0xdb1a('0x22')],_0xdb1a('0x3a')));_0x3a860d[_0xdb1a('0x32')](getAssociatedResources(_0xdb1a('0x17'),_0x5a67c4[_0xdb1a('0x22')],_0xdb1a('0x1a')));_0x3a860d[_0xdb1a('0x32')](db[_0xdb1a('0x6')][_0xdb1a('0x14')](queryAgents));break;case _0xdb1a('0x8'):_0x4de659[_0x28ccfe]('voice:inbound');_0x4de659[_0x28ccfe](_0xdb1a('0x2e'));_0x3a860d[_0xdb1a('0x32')](_0x5a67c4[_0xdb1a('0x3b')]({'attributes':['id',_0xdb1a('0x5')]}));_0x3a860d[_0xdb1a('0x32')](_0x5a67c4[_0xdb1a('0x3c')]({'attributes':['id',_0xdb1a('0x5')]}));_0x3a860d['push'](_0x5a67c4['getFaxQueues']({'attributes':['id','name']}));_0x3a860d[_0xdb1a('0x32')](_0x5a67c4[_0xdb1a('0x3d')]({'attributes':['id','name']}));_0x3a860d[_0xdb1a('0x32')](_0x5a67c4[_0xdb1a('0x3e')]({'attributes':['id','name']}));_0x3a860d['push'](_0x5a67c4[_0xdb1a('0x3f')]({'attributes':['id',_0xdb1a('0x5')]}));_0x3a860d['push'](_0x5a67c4[_0xdb1a('0x40')]({'attributes':['id',_0xdb1a('0x5')]}));break;}return BPromise[_0xdb1a('0x41')](_0x3a860d);}})['then'](function(_0x1e1e04){if(_0x1e1e04&&_0x1e1e04[_0xdb1a('0x1e')]){for(var _0x3fe575=0x0;_0x3fe575<_0x1e1e04[_0xdb1a('0x1e')];_0x3fe575+=0x1){for(var _0x57f3f7=0x0;_0x57f3f7<_0x1e1e04[_0x3fe575][_0xdb1a('0x1e')];_0x57f3f7+=0x1){switch(_0x3fe575){case 0x0:joinOrLeaveQueues(_0x4de659,_0x28ccfe,_0xdb1a('0x42'),_0x1e1e04[_0x3fe575][_0x57f3f7]);break;case 0x1:joinOrLeaveQueues(_0x4de659,_0x28ccfe,_0xdb1a('0x43'),_0x1e1e04[_0x3fe575][_0x57f3f7]);break;case 0x2:joinOrLeaveQueues(_0x4de659,_0x28ccfe,_0xdb1a('0x44'),_0x1e1e04[_0x3fe575][_0x57f3f7]);break;case 0x3:joinOrLeaveQueues(_0x4de659,_0x28ccfe,'sms',_0x1e1e04[_0x3fe575][_0x57f3f7]);break;case 0x4:joinOrLeaveQueues(_0x4de659,_0x28ccfe,_0xdb1a('0x45'),_0x1e1e04[_0x3fe575][_0x57f3f7]);break;case 0x5:joinOrLeaveQueues(_0x4de659,_0x28ccfe,_0xdb1a('0x46'),_0x1e1e04[_0x3fe575][_0x57f3f7]);break;case 0x6:joinOrLeaveQueues(_0x4de659,_0x28ccfe,_0xdb1a('0x47'),_0x1e1e04[_0x3fe575][_0x57f3f7]);break;case 0x7:if(_0x3d07fc[_0xdb1a('0x7')]!==_0xdb1a('0x8'))_0x4de659[_0x28ccfe](util[_0xdb1a('0x1b')](_0xdb1a('0x48'),_0x1e1e04[_0x3fe575][_0x57f3f7][_0xdb1a('0x5')]));break;case 0x8:if(_0x3d07fc[_0xdb1a('0x7')]!==_0xdb1a('0x8'))_0x4de659[_0x28ccfe](util['format']('trunk:%s',_0x1e1e04[_0x3fe575][_0x57f3f7]['name']));break;case 0x9:if(_0x3d07fc[_0xdb1a('0x7')]!==_0xdb1a('0x8'))_0x4de659[_0x28ccfe](util[_0xdb1a('0x1b')](_0xdb1a('0x49'),_0x1e1e04[_0x3fe575][_0x57f3f7][_0xdb1a('0xa')],_0x1e1e04[_0x3fe575][_0x57f3f7][_0xdb1a('0x5')]));break;case 0xa:_0x4de659[_0x28ccfe](util[_0xdb1a('0x1b')]('user:%s',_0x1e1e04[_0x3fe575][_0x57f3f7]['name']));break;}}}}})['then'](function(){if(_0x28ccfe==='leave'){var _0xfa239=_[_0xdb1a('0x4a')](_0x3d07fc['ChatInteractions'],'id');return _0x3d07fc['removeChatInteractions'](_0xfa239)['then'](function(){for(var _0xe13eb0=0x0;_0xe13eb0<_0xfa239[_0xdb1a('0x1e')];_0xe13eb0+=0x1){_0x2cc1aa[_0xdb1a('0x4b')](_0xdb1a('0x4c'),{'ChatInteractionId':Number(_0xfa239[_0xe13eb0]),'UserId':Number(_0x3d07fc['id'])});}});}})[_0xdb1a('0xd')](function(){if(_0x28ccfe===_0xdb1a('0x4d')){var _0x4adb49=_[_0xdb1a('0x4a')](_0x3d07fc[_0xdb1a('0x4e')],'id');return _0x3d07fc[_0xdb1a('0x4f')](_0x4adb49)[_0xdb1a('0xd')](function(){for(var _0x314ed2=0x0;_0x314ed2<_0x4adb49[_0xdb1a('0x1e')];_0x314ed2+=0x1){_0x2cc1aa[_0xdb1a('0x4b')](_0xdb1a('0x50'),{'MailInteractionId':Number(_0x4adb49[_0x314ed2]),'UserId':Number(_0x3d07fc['id'])});}});}})[_0xdb1a('0xd')](function(){if(_0x28ccfe==='leave'){var _0x2d09fc=_[_0xdb1a('0x4a')](_0x3d07fc[_0xdb1a('0x27')],'id');return _0x3d07fc['removeFaxInteractions'](_0x2d09fc)[_0xdb1a('0xd')](function(){for(var _0x388781=0x0;_0x388781<_0x2d09fc[_0xdb1a('0x1e')];_0x388781+=0x1){_0x2cc1aa[_0xdb1a('0x4b')](_0xdb1a('0x51'),{'FaxInteractionId':Number(_0x2d09fc[_0x388781]),'UserId':Number(_0x3d07fc['id'])});}});}})[_0xdb1a('0xd')](function(){if(_0x28ccfe===_0xdb1a('0x4d')){var _0x588f84=_[_0xdb1a('0x4a')](_0x3d07fc['SmsInteractions'],'id');return _0x3d07fc[_0xdb1a('0x52')](_0x588f84)['then'](function(){for(var _0xff852a=0x0;_0xff852a<_0x588f84['length'];_0xff852a+=0x1){_0x2cc1aa[_0xdb1a('0x4b')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x588f84[_0xff852a]),'UserId':Number(_0x3d07fc['id'])});}});}})[_0xdb1a('0xd')](function(){if(_0x28ccfe===_0xdb1a('0x4d')){var _0x2305c2=_[_0xdb1a('0x4a')](_0x3d07fc[_0xdb1a('0x2b')],'id');return _0x3d07fc[_0xdb1a('0x53')](_0x2305c2)[_0xdb1a('0xd')](function(){for(var _0x3620e1=0x0;_0x3620e1<_0x2305c2[_0xdb1a('0x1e')];_0x3620e1+=0x1){_0x2cc1aa['emit'](_0xdb1a('0x54'),{'OpenchannelInteractionId':Number(_0x2305c2[_0x3620e1]),'UserId':Number(_0x3d07fc['id'])});}});}})[_0xdb1a('0xd')](function(){if(_0x28ccfe===_0xdb1a('0x4d')){var _0x43d3a2=_[_0xdb1a('0x4a')](_0x3d07fc[_0xdb1a('0x2c')],'id');return _0x3d07fc[_0xdb1a('0x55')](_0x43d3a2)[_0xdb1a('0xd')](function(){for(var _0x5a6556=0x0;_0x5a6556<_0x43d3a2[_0xdb1a('0x1e')];_0x5a6556+=0x1){_0x2cc1aa[_0xdb1a('0x4b')](_0xdb1a('0x56'),{'WhatsappInteractionId':Number(_0x43d3a2[_0x5a6556]),'UserId':Number(_0x3d07fc['id'])});}});}})[_0xdb1a('0x57')](function(_0x54b0ea){_0x4de659['log'](_0x54b0ea);});}}function onDisconnect(_0x39ac9a,_0x2b0616){joinOrLeave(_0x39ac9a,_0xdb1a('0x4d'),_0x2b0616);}function onConnect(_0x47d76e){joinOrLeave(_0x47d76e,_0xdb1a('0x58'));}exports[_0xdb1a('0x59')]=function(_0x429bc4){_0x429bc4['on']('connection',function(_0xa0aac4){_0xa0aac4['setMaxListeners'](0x0);_0xa0aac4['address']=_0xa0aac4[_0xdb1a('0x5a')][_0xdb1a('0x5b')][_0xdb1a('0x5c')]+':'+_0xa0aac4[_0xdb1a('0x5a')][_0xdb1a('0x5b')][_0xdb1a('0x5d')];_0xa0aac4[_0xdb1a('0x5e')]=new Date();_0xa0aac4[_0xdb1a('0x5f')]=function(_0x3f620b){console[_0xdb1a('0x5f')](_0xdb1a('0x60')+_0xa0aac4[_0xdb1a('0x61')]['name']+'['+_0xa0aac4[_0xdb1a('0x62')]+']',_0x3f620b);};_0xa0aac4['on']('disconnect',function(){onDisconnect(_0xa0aac4,_0x429bc4);_0xa0aac4[_0xdb1a('0x5f')]('DISCONNECTED');});onConnect(_0xa0aac4);_0xa0aac4[_0xdb1a('0x5f')](_0xdb1a('0x63'));});}; \ No newline at end of file +var _0x6455=['ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','userProfileId','SmsQueues','OpenchannelQueues','WhatsappQueue','Campaign','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getWhatsappQueues','all','length','voice','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','catch','log','join','default','connection','setMaxListeners','request','remoteAddress','remotePort','SocketIO\x20','address','disconnect','CONNECTED','lodash','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','telephone','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','map','where','type','ivr','format','query','find','ChatInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','voice:inbound','voice:outbound','hasOwnProperty','include','push'];(function(_0x1bd277,_0x193668){var _0x54f6fa=function(_0x1f221f){while(--_0x1f221f){_0x1bd277['push'](_0x1bd277['shift']());}};_0x54f6fa(++_0x193668);}(_0x6455,0x97));var _0x5645=function(_0xfa6a33,_0x51977a){_0xfa6a33=_0xfa6a33-0x0;var _0x56a231=_0x6455[_0xfa6a33];return _0x56a231;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var BPromise=require(_0x5645('0x1'));var db=require(_0x5645('0x2'))['db'];var config=require(_0x5645('0x3'));var queryQueues={'attributes':['id',_0x5645('0x4')],'include':[{'as':_0x5645('0x5'),'model':db[_0x5645('0x6')],'attributes':['id','name',_0x5645('0x7')],'raw':!![],'where':{'role':_0x5645('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x5645('0x4')],'where':{'role':_0x5645('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x5645('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0x5645('0x4')],'where':{'role':_0x5645('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x5645('0x4'),'type'],'where':{'type':'ivr'}};function getAssociatedResources(_0x20efde,_0x37c03a,_0x38c07a){return db[_0x5645('0xa')][_0x5645('0xb')]({'where':{'name':_0x20efde,'userProfileId':_0x37c03a},'raw':!![]})[_0x5645('0xc')](function(_0x587c61){if(_0x587c61){if(_0x587c61[_0x5645('0xd')]){switch(_0x20efde){case _0x5645('0xe'):case _0x5645('0xf'):case _0x5645('0x10'):case'SmsQueues':case _0x5645('0x11'):case'OpenchannelQueues':case _0x5645('0x12'):return db[_0x38c07a][_0x5645('0x13')](queryQueues);case _0x5645('0x14'):return db[_0x38c07a][_0x5645('0x13')](queryTelephones);case _0x5645('0x15'):return db[_0x38c07a][_0x5645('0x13')](queryTrunks);case _0x5645('0x16'):return db[_0x38c07a][_0x5645('0x13')](queryCampaigns);}}else{return db['UserProfileResource'][_0x5645('0x13')]({'attributes':[_0x5645('0x17')],'where':{'sectionId':_0x587c61['id']},'raw':!![]})[_0x5645('0xc')](function(_0x4cbd46){if(_0x4cbd46){var _0x4b3be6={'where':{'id':_[_0x5645('0x18')](_0x4cbd46,_0x5645('0x17'))},'raw':!![]};switch(_0x38c07a){case'User':_0x4b3be6[_0x5645('0x19')][_0x5645('0x7')]=_0x5645('0x9');break;case'Campaign':_0x4b3be6[_0x5645('0x19')][_0x5645('0x1a')]=_0x5645('0x1b');break;}return db[_0x38c07a][_0x5645('0x13')](_0x4b3be6);}else{return[];}});}}else{return[];}})['then'](function(_0x1853a7){return _0x1853a7;});}function joinOrLeaveQueues(_0x52ac46,_0x557ad2,_0x7c39d7,_0x1e2cba){_0x52ac46[_0x557ad2](util[_0x5645('0x1c')]('%s:queue:%s',_0x7c39d7,_0x1e2cba[_0x5645('0x4')]));if(_0x1e2cba['Agents']){for(var _0x2b8cc8=0x0;_0x2b8cc8<_0x1e2cba['Agents']['length'];_0x2b8cc8+=0x1){_0x52ac46[_0x557ad2](util[_0x5645('0x1c')]('user:%s',_0x1e2cba[_0x5645('0x5')][_0x2b8cc8][_0x5645('0x4')]));}}}function joinOrLeave(_0x502c2e,_0x18680f,_0x116bfc){var _0xe83ed7;if(_0x502c2e['handshake'][_0x5645('0x1d')]['id']){db[_0x5645('0x6')][_0x5645('0x1e')]({'attributes':['id',_0x5645('0x4'),'role','userProfileId'],'where':{'id':_0x502c2e['handshake']['query']['id']},'include':[{'model':db[_0x5645('0x1f')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x5645('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x5645('0x21')],'as':_0x5645('0x22'),'attributes':['id'],'raw':!![]},{'model':db[_0x5645('0x23')],'as':_0x5645('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x5645('0x25')],'as':_0x5645('0x26'),'attributes':['id'],'raw':!![]},{'model':db[_0x5645('0x27')],'as':_0x5645('0x28'),'attributes':['id'],'raw':!![]}]})[_0x5645('0xc')](function(_0x1c0aa2){if(_0x1c0aa2){_0xe83ed7=_0x1c0aa2;_0x502c2e[_0x18680f](util[_0x5645('0x1c')](_0x5645('0x29'),_0x1c0aa2[_0x5645('0x4')]));var _0x52ba45=[];switch(_0x1c0aa2[_0x5645('0x7')]){case'admin':_0x502c2e[_0x18680f](_0x5645('0x2a'));_0x502c2e[_0x18680f](_0x5645('0x2b'));if(queryQueues[_0x5645('0x2c')](_0x5645('0x2d'))){delete queryQueues[_0x5645('0x2d')];}_0x52ba45[_0x5645('0x2e')](db['VoiceQueue']['findAll'](queryQueues));_0x52ba45[_0x5645('0x2e')](db[_0x5645('0x2f')][_0x5645('0x13')](queryQueues));_0x52ba45[_0x5645('0x2e')](db[_0x5645('0x30')][_0x5645('0x13')](queryQueues));_0x52ba45[_0x5645('0x2e')](db[_0x5645('0x31')][_0x5645('0x13')](queryQueues));_0x52ba45[_0x5645('0x2e')](db[_0x5645('0x32')]['findAll'](queryQueues));_0x52ba45['push'](db[_0x5645('0x33')]['findAll'](queryQueues));_0x52ba45[_0x5645('0x2e')](db['WhatsappQueue'][_0x5645('0x13')](queryQueues));_0x52ba45['push'](db[_0x5645('0x6')][_0x5645('0x13')](queryTelephones));_0x52ba45[_0x5645('0x2e')](db[_0x5645('0x34')][_0x5645('0x13')](queryTrunks));_0x52ba45[_0x5645('0x2e')](db['Campaign'][_0x5645('0x13')](queryCampaigns));_0x52ba45[_0x5645('0x2e')](db[_0x5645('0x6')][_0x5645('0x13')](queryAgents));break;case _0x5645('0x35'):_0x502c2e[_0x18680f](_0x5645('0x2a'));_0x502c2e[_0x18680f](_0x5645('0x2b'));_0x52ba45[_0x5645('0x2e')](getAssociatedResources('VoiceQueues',_0x1c0aa2[_0x5645('0x36')],'VoiceQueue'));_0x52ba45[_0x5645('0x2e')](getAssociatedResources(_0x5645('0xf'),_0x1c0aa2[_0x5645('0x36')],_0x5645('0x2f')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources('FaxQueues',_0x1c0aa2[_0x5645('0x36')],_0x5645('0x30')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources(_0x5645('0x37'),_0x1c0aa2[_0x5645('0x36')],_0x5645('0x31')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources(_0x5645('0x11'),_0x1c0aa2[_0x5645('0x36')],_0x5645('0x32')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources(_0x5645('0x38'),_0x1c0aa2[_0x5645('0x36')],_0x5645('0x33')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources(_0x5645('0x12'),_0x1c0aa2['userProfileId'],_0x5645('0x39')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources('Telephones',_0x1c0aa2[_0x5645('0x36')],_0x5645('0x6')));_0x52ba45['push'](getAssociatedResources(_0x5645('0x15'),_0x1c0aa2[_0x5645('0x36')],_0x5645('0x34')));_0x52ba45[_0x5645('0x2e')](getAssociatedResources(_0x5645('0x16'),_0x1c0aa2[_0x5645('0x36')],_0x5645('0x3a')));_0x52ba45['push'](db['User'][_0x5645('0x13')](queryAgents));break;case _0x5645('0x8'):_0x502c2e[_0x18680f](_0x5645('0x2a'));_0x502c2e[_0x18680f](_0x5645('0x2b'));_0x52ba45[_0x5645('0x2e')](_0x1c0aa2[_0x5645('0x3b')]({'attributes':['id',_0x5645('0x4')]}));_0x52ba45[_0x5645('0x2e')](_0x1c0aa2[_0x5645('0x3c')]({'attributes':['id',_0x5645('0x4')]}));_0x52ba45[_0x5645('0x2e')](_0x1c0aa2[_0x5645('0x3d')]({'attributes':['id',_0x5645('0x4')]}));_0x52ba45[_0x5645('0x2e')](_0x1c0aa2[_0x5645('0x3e')]({'attributes':['id',_0x5645('0x4')]}));_0x52ba45[_0x5645('0x2e')](_0x1c0aa2['getMailQueues']({'attributes':['id','name']}));_0x52ba45['push'](_0x1c0aa2['getOpenchannelQueues']({'attributes':['id',_0x5645('0x4')]}));_0x52ba45[_0x5645('0x2e')](_0x1c0aa2[_0x5645('0x3f')]({'attributes':['id',_0x5645('0x4')]}));break;}return BPromise[_0x5645('0x40')](_0x52ba45);}})['then'](function(_0x43eaa9){if(_0x43eaa9&&_0x43eaa9[_0x5645('0x41')]){for(var _0x41b607=0x0;_0x41b607<_0x43eaa9[_0x5645('0x41')];_0x41b607+=0x1){for(var _0x30a685=0x0;_0x30a685<_0x43eaa9[_0x41b607]['length'];_0x30a685+=0x1){switch(_0x41b607){case 0x0:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x42'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x1:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x43'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x2:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x44'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x3:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x45'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x4:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x46'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x5:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x47'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x6:joinOrLeaveQueues(_0x502c2e,_0x18680f,_0x5645('0x48'),_0x43eaa9[_0x41b607][_0x30a685]);break;case 0x7:if(_0xe83ed7[_0x5645('0x7')]!=='agent')_0x502c2e[_0x18680f](util['format'](_0x5645('0x49'),_0x43eaa9[_0x41b607][_0x30a685][_0x5645('0x4')]));break;case 0x8:if(_0xe83ed7['role']!=='agent')_0x502c2e[_0x18680f](util[_0x5645('0x1c')]('trunk:%s',_0x43eaa9[_0x41b607][_0x30a685][_0x5645('0x4')]));break;case 0x9:if(_0xe83ed7[_0x5645('0x7')]!==_0x5645('0x8'))_0x502c2e[_0x18680f](util[_0x5645('0x1c')](_0x5645('0x4a'),_0x43eaa9[_0x41b607][_0x30a685]['type'],_0x43eaa9[_0x41b607][_0x30a685][_0x5645('0x4')]));break;case 0xa:_0x502c2e[_0x18680f](util['format']('user:%s',_0x43eaa9[_0x41b607][_0x30a685][_0x5645('0x4')]));break;}}}}})[_0x5645('0xc')](function(){if(_0x18680f===_0x5645('0x4b')){var _0x46637f=_[_0x5645('0x18')](_0xe83ed7[_0x5645('0x4c')],'id');return _0xe83ed7[_0x5645('0x4d')](_0x46637f)[_0x5645('0xc')](function(){for(var _0x13bee1=0x0;_0x13bee1<_0x46637f[_0x5645('0x41')];_0x13bee1+=0x1){_0x116bfc[_0x5645('0x4e')](_0x5645('0x4f'),{'ChatInteractionId':Number(_0x46637f[_0x13bee1]),'UserId':Number(_0xe83ed7['id'])});}});}})['then'](function(){if(_0x18680f==='leave'){var _0x30932d=_[_0x5645('0x18')](_0xe83ed7[_0x5645('0x20')],'id');return _0xe83ed7[_0x5645('0x50')](_0x30932d)[_0x5645('0xc')](function(){for(var _0x4cfe24=0x0;_0x4cfe24<_0x30932d[_0x5645('0x41')];_0x4cfe24+=0x1){_0x116bfc[_0x5645('0x4e')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x30932d[_0x4cfe24]),'UserId':Number(_0xe83ed7['id'])});}});}})[_0x5645('0xc')](function(){if(_0x18680f===_0x5645('0x4b')){var _0x2eea4c=_[_0x5645('0x18')](_0xe83ed7[_0x5645('0x22')],'id');return _0xe83ed7['removeFaxInteractions'](_0x2eea4c)[_0x5645('0xc')](function(){for(var _0xd1f0b=0x0;_0xd1f0b<_0x2eea4c[_0x5645('0x41')];_0xd1f0b+=0x1){_0x116bfc[_0x5645('0x4e')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x2eea4c[_0xd1f0b]),'UserId':Number(_0xe83ed7['id'])});}});}})[_0x5645('0xc')](function(){if(_0x18680f===_0x5645('0x4b')){var _0xd971f5=_[_0x5645('0x18')](_0xe83ed7[_0x5645('0x24')],'id');return _0xe83ed7[_0x5645('0x51')](_0xd971f5)[_0x5645('0xc')](function(){for(var _0x3b4f94=0x0;_0x3b4f94<_0xd971f5[_0x5645('0x41')];_0x3b4f94+=0x1){_0x116bfc['emit'](_0x5645('0x52'),{'SmsInteractionId':Number(_0xd971f5[_0x3b4f94]),'UserId':Number(_0xe83ed7['id'])});}});}})[_0x5645('0xc')](function(){if(_0x18680f==='leave'){var _0x5d90a6=_[_0x5645('0x18')](_0xe83ed7['OpenchannelInteractions'],'id');return _0xe83ed7[_0x5645('0x53')](_0x5d90a6)[_0x5645('0xc')](function(){for(var _0x26431d=0x0;_0x26431d<_0x5d90a6[_0x5645('0x41')];_0x26431d+=0x1){_0x116bfc[_0x5645('0x4e')](_0x5645('0x54'),{'OpenchannelInteractionId':Number(_0x5d90a6[_0x26431d]),'UserId':Number(_0xe83ed7['id'])});}});}})[_0x5645('0xc')](function(){if(_0x18680f==='leave'){var _0x2a7a9a=_[_0x5645('0x18')](_0xe83ed7[_0x5645('0x28')],'id');return _0xe83ed7[_0x5645('0x55')](_0x2a7a9a)[_0x5645('0xc')](function(){for(var _0x302248=0x0;_0x302248<_0x2a7a9a[_0x5645('0x41')];_0x302248+=0x1){_0x116bfc[_0x5645('0x4e')]('user_has_whatsapp_interactions:remove',{'WhatsappInteractionId':Number(_0x2a7a9a[_0x302248]),'UserId':Number(_0xe83ed7['id'])});}});}})[_0x5645('0x56')](function(_0x7e719a){_0x502c2e[_0x5645('0x57')](_0x7e719a);});}}function onDisconnect(_0x2e3899,_0x5e7f9e){joinOrLeave(_0x2e3899,_0x5645('0x4b'),_0x5e7f9e);}function onConnect(_0x31661a){joinOrLeave(_0x31661a,_0x5645('0x58'));}exports[_0x5645('0x59')]=function(_0x4545f8){_0x4545f8['on'](_0x5645('0x5a'),function(_0x83ec55){_0x83ec55[_0x5645('0x5b')](0x0);_0x83ec55['address']=_0x83ec55[_0x5645('0x5c')][_0x5645('0x5a')][_0x5645('0x5d')]+':'+_0x83ec55[_0x5645('0x5c')][_0x5645('0x5a')][_0x5645('0x5e')];_0x83ec55['connectedAt']=new Date();_0x83ec55[_0x5645('0x57')]=function(_0xd12828){console[_0x5645('0x57')](_0x5645('0x5f')+_0x83ec55['nsp']['name']+'['+_0x83ec55[_0x5645('0x60')]+']',_0xd12828);};_0x83ec55['on'](_0x5645('0x61'),function(){onDisconnect(_0x83ec55,_0x4545f8);_0x83ec55[_0x5645('0x57')]('DISCONNECTED');});onConnect(_0x83ec55);_0x83ec55[_0x5645('0x57')](_0x5645('0x62'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index a08cb27..ef2fa5a 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 _0x3160=['code','catch','get','channel','motionChannel','event','direction','ContactId','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','query','Sequelize','QueryTypes','SELECT','contact','UserId','undefined','interface','format','agent','incomingmessage','outgoingmessage','AfterCreateMessage','offlineMessage','opened','resolve','sequelize','SIP/%s','name','AfterCreate','changed','closed','substatus','User','find','fullname','email','default','hasOwnProperty','model','hook','callback','toLowerCase','condition','util','../../mysqldb','triggers','client','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','ChatMessage','newmessage','SmsInteraction','Sms','SmsMessage','Whatsapp','WhatsappInteraction','closedinteraction','WhatsappMessage','Fax','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','then','info','Trigger,\x20%s','EventManager','error'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x3160,0x109));var _0x0316=function(_0xddb0dd,_0x37f9b7){_0xddb0dd=_0xddb0dd-0x0;var _0x38150b=_0x3160[_0xddb0dd];return _0x38150b;};'use strict';var util=require(_0x0316('0x0'));var db=require(_0x0316('0x1'))['db'];var jayson=require('jayson/promise');var logger=require('../logger')(_0x0316('0x2'));var client=jayson[_0x0316('0x3')][_0x0316('0x4')]({'port':0x232a});var triggers=[{'channel':_0x0316('0x5'),'model':_0x0316('0x6'),'event':_0x0316('0x7'),'condition':_0x0316('0x8'),'callback':afterCreate},{'channel':'Chat','model':_0x0316('0x6'),'event':_0x0316('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x0316('0x5'),'model':_0x0316('0xa'),'event':'afterCreate','condition':_0x0316('0xb'),'callback':afterCreateMessage},{'channel':_0x0316('0x5'),'model':'ChatOfflineMessage','event':'afterCreate','condition':_0x0316('0xb'),'callback':afterCreateOfflineMessage},{'channel':'Sms','model':_0x0316('0xc'),'event':_0x0316('0x7'),'condition':_0x0316('0x8'),'callback':afterCreate},{'channel':_0x0316('0xd'),'model':_0x0316('0xc'),'event':_0x0316('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x0316('0xd'),'model':_0x0316('0xe'),'event':_0x0316('0x7'),'condition':_0x0316('0xb'),'callback':afterCreateMessage},{'channel':_0x0316('0xf'),'model':_0x0316('0x10'),'event':_0x0316('0x7'),'condition':_0x0316('0x8'),'callback':afterCreate},{'channel':_0x0316('0xf'),'model':_0x0316('0x10'),'event':'afterUpdate','condition':_0x0316('0x11'),'callback':afterUpdate},{'channel':'Whatsapp','model':_0x0316('0x12'),'event':_0x0316('0x7'),'condition':_0x0316('0xb'),'callback':afterCreateMessage},{'channel':_0x0316('0x13'),'model':'FaxInteraction','event':_0x0316('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x0316('0x13'),'model':'FaxInteraction','event':_0x0316('0x9'),'condition':_0x0316('0x11'),'callback':afterUpdate},{'channel':_0x0316('0x13'),'model':_0x0316('0x14'),'event':_0x0316('0x7'),'condition':_0x0316('0xb'),'callback':afterCreateMessage},{'channel':_0x0316('0x15'),'model':_0x0316('0x16'),'event':'afterCreate','condition':_0x0316('0x8'),'callback':afterCreate},{'channel':_0x0316('0x15'),'model':_0x0316('0x16'),'event':_0x0316('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x0316('0x15'),'model':_0x0316('0x17'),'event':'afterCreate','condition':_0x0316('0xb'),'callback':afterCreateMessage},{'channel':_0x0316('0x18'),'model':_0x0316('0x19'),'event':_0x0316('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x0316('0x18'),'model':_0x0316('0x19'),'event':_0x0316('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x0316('0x18'),'model':'OpenchannelMessage','event':_0x0316('0x7'),'condition':_0x0316('0xb'),'callback':afterCreateMessage}];function request(_0x43354c){return client['request']('EventManager',_0x43354c)[_0x0316('0x1a')](function(_0x261382){logger[_0x0316('0x1b')](_0x0316('0x1c'),_0x0316('0x1d'),_0x261382);if(_0x261382[_0x0316('0x1e')]){if(_0x261382[_0x0316('0x1e')][_0x0316('0x1f')]===0x1f4){logger['error'](_0x0316('0x1c'),_0x0316('0x1d'),_0x261382[_0x0316('0x1e')]);}}})[_0x0316('0x20')](function(_0x5b7f4d){logger['error'](_0x0316('0x1c'),'EventManager',_0x5b7f4d);});}function afterCreateMessage(_0x27cc5c){return function(_0x2664ee){_0x2664ee=_0x2664ee[_0x0316('0x21')]({'plain':!![]});_0x2664ee[_0x0316('0x22')]=_0x27cc5c;_0x2664ee[_0x0316('0x23')]=_0x27cc5c;_0x2664ee[_0x0316('0x24')]=_0x2664ee[_0x0316('0x25')];Promise['resolve']()[_0x0316('0x1a')](function(){if(typeof _0x2664ee[_0x0316('0x26')]==='undefined')return null;var _0x1cfa2d=_0x0316('0x27')+_0x2664ee['ContactId'];return db['sequelize'][_0x0316('0x28')](_0x1cfa2d,{'type':db[_0x0316('0x29')][_0x0316('0x2a')][_0x0316('0x2b')],'raw':!![]});})[_0x0316('0x1a')](function(_0x42be7a){if(_0x42be7a){_0x2664ee[_0x0316('0x2c')]=_0x42be7a[0x0];}if(typeof _0x2664ee[_0x0316('0x2d')]===_0x0316('0x2e'))return;return getAgent(_0x2664ee[_0x0316('0x2d')]);})[_0x0316('0x1a')](function(_0x4ee125){if(_0x4ee125){_0x2664ee[_0x0316('0x2f')]=util[_0x0316('0x30')]('SIP/%s',_0x4ee125['name']);_0x2664ee[_0x0316('0x31')]=_0x4ee125;_0x2664ee[_0x0316('0x22')]=_0x27cc5c;return request({'event':_0x0316('0x32'),'message':_0x2664ee});}else{return request({'event':_0x0316('0x33'),'message':_0x2664ee});}})['catch'](function(_0x3dafba){logger[_0x0316('0x1e')](_0x0316('0x1c'),_0x0316('0x34'),_0x3dafba);});};}function afterCreateOfflineMessage(_0x4c2f7b){return function(_0x5b2c74){_0x5b2c74=_0x5b2c74['get']({'plain':!![]});_0x5b2c74['channel']=_0x4c2f7b;_0x5b2c74[_0x0316('0x23')]=_0x4c2f7b;_0x5b2c74['event']=_0x0316('0x35');return request({'event':_0x5b2c74['event'],'message':_0x5b2c74});};}function afterCreate(_0x424595,_0x51ce9a){return function(_0x57e330){_0x57e330=_0x57e330[_0x0316('0x21')]({'plain':!![]});_0x57e330['channel']=_0x424595;_0x57e330[_0x0316('0x23')]=_0x424595;_0x57e330[_0x0316('0x24')]=_0x0316('0x36');Promise[_0x0316('0x37')]()[_0x0316('0x1a')](function(){var _0x29462a=_0x0316('0x27')+_0x57e330[_0x0316('0x26')];return db[_0x0316('0x38')][_0x0316('0x28')](_0x29462a,{'type':db['Sequelize'][_0x0316('0x2a')]['SELECT'],'raw':!![]});})[_0x0316('0x1a')](function(_0x15aa7f){if(_0x15aa7f){_0x57e330['contact']=_0x15aa7f[0x0];}if(typeof _0x57e330[_0x0316('0x2d')]===_0x0316('0x2e'))return;return getAgent(_0x57e330[_0x0316('0x2d')]);})[_0x0316('0x1a')](function(_0x4e80f2){if(_0x4e80f2){_0x57e330['interface']=util[_0x0316('0x30')](_0x0316('0x39'),_0x4e80f2[_0x0316('0x3a')]);_0x57e330[_0x0316('0x31')]=_0x4e80f2;}return request({'event':_0x51ce9a,'message':_0x57e330});})[_0x0316('0x20')](function(_0x323cfe){logger[_0x0316('0x1e')](_0x0316('0x1c'),_0x0316('0x3b'),_0x323cfe);});};}function afterUpdate(_0xcb692d){return function(_0x1a22fc){var _0x42fac9=_0x1a22fc[_0x0316('0x3c')](_0x0316('0x3d'))&&_0x1a22fc[_0x0316('0x3d')];var _0x4e1f29=_0x1a22fc['changed']('substatus');if(_0x42fac9||_0x4e1f29){var _0xf1d888=_0x42fac9?_0x0316('0x11'):_0x0316('0x3e');var _0x5a3685=_0x1a22fc[_0x0316('0x21')]({'plain':!![]});_0x5a3685[_0x0316('0x22')]=_0xcb692d;_0x5a3685[_0x0316('0x23')]=_0xcb692d;_0x5a3685['event']=_0x42fac9?'closed':_0x0316('0x3e');var _0x4f4a82='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5a3685['ContactId'];return db['sequelize']['query'](_0x4f4a82,{'type':db[_0x0316('0x29')][_0x0316('0x2a')][_0x0316('0x2b')],'raw':!![]})[_0x0316('0x1a')](function(_0x5829ad){if(_0x5829ad){_0x5a3685[_0x0316('0x2c')]=_0x5829ad[0x0];}if(typeof _0x5a3685[_0x0316('0x2d')]==='undefined')return;return getAgent(_0x5a3685[_0x0316('0x2d')]);})[_0x0316('0x1a')](function(_0x198360){if(_0x198360){_0x5a3685[_0x0316('0x2f')]=util[_0x0316('0x30')]('SIP/%s',_0x198360[_0x0316('0x3a')]);_0x5a3685[_0x0316('0x31')]=_0x198360;}return request({'event':_0xf1d888,'message':_0x5a3685});})[_0x0316('0x20')](function(_0x1603f2){logger['error'](_0x0316('0x1c'),'AfterUpdate',_0x1603f2);});}};}function getAgent(_0x3285b4){return db[_0x0316('0x3f')][_0x0316('0x40')]({'where':{'id':_0x3285b4},'attributes':['id','name',_0x0316('0x41'),_0x0316('0x42'),'internal'],'raw':!![]})['then'](function(_0x1ccdf1){return _0x1ccdf1;});}exports[_0x0316('0x43')]=function(){for(var _0x907e7=0x0;_0x907e7=_0x39d8c6[_0xde0d('0x16')]){throw Error(_0xde0d('0x17'));}_0x33f3f7(_0x165271);})[_0xde0d('0x18')](function(_0xe0c00e){_0x41da9c(_0xe0c00e);});});}; \ No newline at end of file +var _0xea52=['whatsapp','openchannel','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','./license/util','voice','mail','chat','fax','sms'];(function(_0x14e010,_0x220f30){var _0x322072=function(_0xcf085f){while(--_0xcf085f){_0x14e010['push'](_0x14e010['shift']());}};_0x322072(++_0x220f30);}(_0xea52,0x160));var _0x2ea5=function(_0x3ae285,_0x27a64f){_0x3ae285=_0x3ae285-0x0;var _0x38de01=_0xea52[_0x3ae285];return _0x38de01;};'use strict';var _=require(_0x2ea5('0x0'));var BPromise=require(_0x2ea5('0x1'));var db=require('../mysqldb')['db'];var util=require(_0x2ea5('0x2'));var channels=[_0x2ea5('0x3'),_0x2ea5('0x4'),_0x2ea5('0x5'),_0x2ea5('0x6'),_0x2ea5('0x7'),_0x2ea5('0x8'),_0x2ea5('0x9')];exports['getChannels']=function(){return channels;};exports['isValidChannel']=function(_0x1cb8cb){_0x1cb8cb=_0x1cb8cb['toLowerCase']();return _[_0x2ea5('0xa')](channels,_0x1cb8cb);};exports[_0x2ea5('0xb')]=function(_0x33601e,_0xebf9f1,_0x4499fe,_0x3260a1){var _0x1f2db7={'loginAttempts':_0xebf9f1,'blocked':_0x4499fe};if(!_[_0x2ea5('0xc')](_0x3260a1)){_0x1f2db7[_0x2ea5('0xd')]=_0x3260a1;}return _0x33601e[_0x2ea5('0xe')](_0x1f2db7);};exports[_0x2ea5('0xf')]=function(_0x443289){return new BPromise(function(_0x11a997,_0x238d14){var _0x59b7f1=0x0;if(_0x443289[_0x2ea5('0x10')]!==_0x2ea5('0x11')){_0x11a997(_0x443289);}db[_0x2ea5('0x12')][_0x2ea5('0x13')]({'where':{'role':_0x2ea5('0x11'),'online':!![],'id':{'$ne':_0x443289['id']}}})[_0x2ea5('0x14')](function(_0x350287){_0x59b7f1=_0x350287;return util[_0x2ea5('0xf')]();})[_0x2ea5('0x14')](function(_0x2cdd95){if(_0x2cdd95&&_0x2cdd95[_0x2ea5('0x15')]&&_0x59b7f1>=_0x2cdd95[_0x2ea5('0x15')]){throw Error(_0x2ea5('0x16'));}_0x11a997(_0x443289);})[_0x2ea5('0x17')](function(_0x32ae7d){_0x238d14(_0x32ae7d);});});}; \ No newline at end of file diff --git a/server/errors/api.js b/server/errors/api.js index 1cd471e..865980a 100644 --- a/server/errors/api.js +++ b/server/errors/api.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4a=['Bad\x20Request','Not\x20Found','OutOfInterval','error','name','send','exports','util','../config/logger','api','message','Error','inherits'];(function(_0x38ab90,_0x17ea77){var _0xff571f=function(_0x4f0990){while(--_0x4f0990){_0x38ab90['push'](_0x38ab90['shift']());}};_0xff571f(++_0x17ea77);}(_0xac4a,0x13f));var _0xaac4=function(_0x3e18c7,_0x5734fe){_0x3e18c7=_0x3e18c7-0x0;var _0x229d91=_0xac4a[_0x3e18c7];return _0x229d91;};'use strict';var util=require(_0xaac4('0x0'));var logger=require(_0xaac4('0x1'))(_0xaac4('0x2'));var APIError=function(_0x132fc3,_0x38f4f4){this[_0xaac4('0x3')]=_0x132fc3||'Internal\x20Server\x20Error';this['name']=_0x38f4f4||_0xaac4('0x4');util[_0xaac4('0x5')](APIError,Error);};var APIBadRequestError=function(_0x32d34c){this['message']=_0x32d34c||_0xaac4('0x6');this['name']=_0xaac4('0x6');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x1e4283){this[_0xaac4('0x3')]=_0x1e4283||'Entity\x20not\x20found';this['name']=_0xaac4('0x7');util['inherits'](APINotFoundError,APIError);};function getStatusCode(_0x452573){switch(_0x452573){case'Bad\x20Request':return 0x190;case'Forbidden',_0xaac4('0x8'):return 0x193;case _0xaac4('0x7'):return 0x194;default:return 0x1f4;}}function handleError(_0x38d1d0){return function(_0x5f393e){logger[_0xaac4('0x9')](_0x5f393e['stack']);var _0x508e14=getStatusCode(_0x5f393e[_0xaac4('0xa')]);if(_0x5f393e[_0xaac4('0xa')])delete _0x5f393e[_0xaac4('0xa')];return _0x38d1d0['status'](_0x508e14)[_0xaac4('0xb')](_0x5f393e);};}module[_0xaac4('0xc')]={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file +var _0xbdb7=['Error','Bad\x20Request','Entity\x20not\x20found','inherits','Forbidden','OutOfInterval','Not\x20Found','status','util','../config/logger','api','message','Internal\x20Server\x20Error','name'];(function(_0x11c5cf,_0x2994e6){var _0x21932c=function(_0x31d78d){while(--_0x31d78d){_0x11c5cf['push'](_0x11c5cf['shift']());}};_0x21932c(++_0x2994e6);}(_0xbdb7,0x12e));var _0x7bdb=function(_0xd3bc07,_0x3a11a5){_0xd3bc07=_0xd3bc07-0x0;var _0x10aa85=_0xbdb7[_0xd3bc07];return _0x10aa85;};'use strict';var util=require(_0x7bdb('0x0'));var logger=require(_0x7bdb('0x1'))(_0x7bdb('0x2'));var APIError=function(_0x2a2c1c,_0x23c326){this[_0x7bdb('0x3')]=_0x2a2c1c||_0x7bdb('0x4');this[_0x7bdb('0x5')]=_0x23c326||_0x7bdb('0x6');util['inherits'](APIError,Error);};var APIBadRequestError=function(_0x28542c){this['message']=_0x28542c||'Bad\x20Request';this[_0x7bdb('0x5')]=_0x7bdb('0x7');util['inherits'](APIBadRequestError,APIError);};var APINotFoundError=function(_0x513cba){this[_0x7bdb('0x3')]=_0x513cba||_0x7bdb('0x8');this['name']='Not\x20Found';util[_0x7bdb('0x9')](APINotFoundError,APIError);};function getStatusCode(_0x1a6b61){switch(_0x1a6b61){case _0x7bdb('0x7'):return 0x190;case _0x7bdb('0xa'),_0x7bdb('0xb'):return 0x193;case _0x7bdb('0xc'):return 0x194;default:return 0x1f4;}}function handleError(_0x297724){return function(_0x258cc6){logger['error'](_0x258cc6['stack']);var _0x52b9b9=getStatusCode(_0x258cc6[_0x7bdb('0x5')]);if(_0x258cc6[_0x7bdb('0x5')])delete _0x258cc6['name'];return _0x297724[_0x7bdb('0xd')](_0x52b9b9)['send'](_0x258cc6);};}module['exports']={'APIError':APIError,'APIBadRequestError':APIBadRequestError,'APINotFoundError':APINotFoundError,'handleError':handleError}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index cbae4d6..44ab503 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x13e6=['status','render','send','exports'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x13e6,0x1a3));var _0x613e=function(_0x318d9f,_0x10b237){_0x318d9f=_0x318d9f-0x0;var _0x2b5422=_0x13e6[_0x318d9f];return _0x2b5422;};'use strict';module[_0x613e('0x0')][0x194]=function pageNotFound(_0x4d60b8,_0x41b5f2){var _0x20c52c='404';var _0x495a3d=0x194;var _0x460f25={'status':_0x495a3d};_0x41b5f2[_0x613e('0x1')](_0x460f25[_0x613e('0x1')]);_0x41b5f2[_0x613e('0x2')](_0x20c52c,{},function(_0x515ca2,_0x9367ef){if(_0x515ca2){return _0x41b5f2[_0x613e('0x1')](_0x460f25['status'])['json'](_0x460f25);}_0x41b5f2[_0x613e('0x3')](_0x9367ef);});}; \ No newline at end of file +var _0x91bb=['status','render','json','send','exports','404'];(function(_0x5ad3d3,_0x2d400c){var _0x4344e7=function(_0x557356){while(--_0x557356){_0x5ad3d3['push'](_0x5ad3d3['shift']());}};_0x4344e7(++_0x2d400c);}(_0x91bb,0xfa));var _0xb91b=function(_0x312835,_0xff273e){_0x312835=_0x312835-0x0;var _0x1da8b9=_0x91bb[_0x312835];return _0x1da8b9;};'use strict';module[_0xb91b('0x0')][0x194]=function pageNotFound(_0x4da211,_0x31078f){var _0x895f22=_0xb91b('0x1');var _0x2b61f6=0x194;var _0x16f672={'status':_0x2b61f6};_0x31078f[_0xb91b('0x2')](_0x16f672['status']);_0x31078f[_0xb91b('0x3')](_0x895f22,{},function(_0x5484f2,_0x28fb06){if(_0x5484f2){return _0x31078f[_0xb91b('0x2')](_0x16f672[_0xb91b('0x2')])[_0xb91b('0x4')](_0x16f672);}_0x31078f[_0xb91b('0x5')](_0x28fb06);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index fbf9816..782b74f 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x727b=['SquareReport','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','CloudProvider','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','userSetting','hasMany','Recordings','UserId','HopperFinals','HopperHistory','ChatInteractions','FaxInteractions','MailInteractions','UserNotifications','UserProfile','userProfileId','belongsToMany','chat_group_has_users','CmContact','Contacts','user_has_mail_interactions','SmsInteractions','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','WhatsappInteractions','user_has_whatsapp_interactions','VoiceQueues','MailQueue','MailQueues','ChatQueues','UserChatQueue','FaxQueues','OpenchannelQueues','WhatsappQueue','ChatWebsites','FaxAccounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','CmHopperBlack','HopperBlacks','JscriptySessions','belongsTo','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','Lists','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','mailboxuser','mailbox','QueueCalls','uniqueid','AgentReports','Contact','MailAccountId','CloudProviderId','restrict','Imap','Smtp','Dispositions','Answers','MailMessage','Messages','List','ListId','TemplateId','mandatoryDispositionPause','mandatoryDispositionPauseId','Agents','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','ThroughTags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','ContactId','Items','FaxAccountId','Interactions','Exntensions','FaxInteractionId','fax_interaction_has_tags','Tags','user_has_fax_interactions','AttachmentId','team_has_fax_queues','FaxQueueReport','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ProactiveActions','user_has_chat_websites','OpenchannelQueueReport','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','CompanyId','CmContactHasItem','Phones','CmContactId','Company','cm_user_has_contacts','cm_contact_has_tags','AdditionalPhones','CmHopperId','OwnerId','AutomationAllId','Automation','Any','OneAny','ParentId','Extensions','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','AnalyticDefaultReport','AnalyticCustomReport','CustomReportId','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyCondition','TriggerAnyId','Actions','AnalyticFieldReport','Fields','DefaultReportId','MetricId','SalesforceAccount','Configurations','Subjects','SubjectId','SalesforceField','Descriptions','DescriptionId','AccountId','Description','Field','VariableId','SugarcrmConfiguration','SugarcrmField','FieldId','Subject','ZohoField','ZendeskAccount','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerConfiguration','ServicenowConfiguration','ServicenowField','FreshsalesAccount','FromId','SessionId','JscriptyProject','ProjectId','user_has_teams','SmsQueues','team_has_whatsapp_queues','WhatsappQueues','CampaignId','HopperHistories','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','FromAgent','ToUserId','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','SmsTransferReport','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','Queues','cm_user_has_lists','UserProfileSection','sectionId','WhatsappAccount','WhatsappAccountId','WhatsappInteractionId','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','user','sequelize','jstz','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8','sequelizeHistory','defaultsDeep','utf8mb4','utf8_general_ci','database','username','options','password','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','Trunk','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../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/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceConfiguration','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model'];(function(_0x42e4aa,_0x2a2f6e){var _0x7b27d3=function(_0x2aa0a8){while(--_0x2aa0a8){_0x42e4aa['push'](_0x42e4aa['shift']());}};_0x7b27d3(++_0x2a2f6e);}(_0x727b,0x125));var _0xb727=function(_0x3dfb4a,_0x4c216a){_0x3dfb4a=_0x3dfb4a-0x0;var _0x144c5f=_0x727b[_0x3dfb4a];return _0x144c5f;};'use strict';var config=require('../config/environment');var Sequelize=require(_0xb727('0x0'));var _=require('lodash');var jstz=require(_0xb727('0x1'));var timezone=jstz['determine']();config[_0xb727('0x0')]=_['defaultsDeep'](config['sequelize'],{'database':_0xb727('0x2'),'username':_0xb727('0x3'),'password':_0xb727('0x4'),'options':{'host':_0xb727('0x5'),'port':0xcea,'dialect':_0xb727('0x6'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xb727('0x7'),'collate':'utf8_general_ci'}}});config[_0xb727('0x8')]=_[_0xb727('0x9')](config['sequelizeHistory'],{'database':_0xb727('0x2'),'username':_0xb727('0x3'),'password':_0xb727('0x4'),'options':{'host':_0xb727('0x5'),'port':0xcea,'dialect':_0xb727('0x6'),'dialectOptions':{'charset':_0xb727('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xb727('0x7'),'collate':_0xb727('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xb727('0xc')],config['sequelize'][_0xb727('0xd')],config[_0xb727('0x0')]['password'],config[_0xb727('0x0')][_0xb727('0xe')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xb727('0x8')][_0xb727('0xc')],config[_0xb727('0x8')][_0xb727('0xd')],config['sequelizeHistory'][_0xb727('0xf')],config['sequelizeHistory']['options'])};db[_0xb727('0x10')]=db[_0xb727('0x0')]['import'](_0xb727('0x11'));db[_0xb727('0x12')]=db['sequelize'][_0xb727('0x13')](_0xb727('0x14'));db[_0xb727('0x15')]=db[_0xb727('0x0')]['import'](_0xb727('0x16'));db[_0xb727('0x17')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x18'));db[_0xb727('0x19')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x1a'));db[_0xb727('0x1b')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x1c'));db[_0xb727('0x1d')]=db[_0xb727('0x0')]['import'](_0xb727('0x1e'));db[_0xb727('0x1f')]=db[_0xb727('0x0')][_0xb727('0x13')]('../api/screenRecording/screenRecording.model');db[_0xb727('0x20')]=db['sequelize'][_0xb727('0x13')](_0xb727('0x21'));db['VoiceMailMessage']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x22'));db[_0xb727('0x23')]=db['sequelize']['import'](_0xb727('0x24'));db['VoiceDialReport']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x25'));db[_0xb727('0x26')]=db[_0xb727('0x0')]['import'](_0xb727('0x27'));db[_0xb727('0x28')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x29'));db[_0xb727('0x2a')]=db['sequelize']['import'](_0xb727('0x2b'));db[_0xb727('0x2c')]=db['sequelize'][_0xb727('0x13')]('../api/trunk/trunk.model');db[_0xb727('0x2d')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x2e'));db[_0xb727('0x2f')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x30'));db[_0xb727('0x31')]=db['sequelize'][_0xb727('0x13')](_0xb727('0x32'));db['UserChatQueue']=db['sequelize'][_0xb727('0x13')](_0xb727('0x33'));db[_0xb727('0x34')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x35'));db[_0xb727('0x36')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x37'));db[_0xb727('0x38')]=db[_0xb727('0x0')]['import']('../api/userSmsQueue/userSmsQueue.model');db[_0xb727('0x39')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x3a'));db[_0xb727('0x3b')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x3c'));db[_0xb727('0x3d')]=db[_0xb727('0x0')]['import']('../api/mailServerIn/mailServerIn.model');db[_0xb727('0x3e')]=db[_0xb727('0x0')][_0xb727('0x13')]('../api/mailServerOut/mailServerOut.model');db[_0xb727('0x3f')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x40'));db['MailQueue']=db['sequelize'][_0xb727('0x13')](_0xb727('0x41'));db[_0xb727('0x42')]=db['sequelize']['import'](_0xb727('0x43'));db[_0xb727('0x44')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x45'));db['MailMessage']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x46'));db[_0xb727('0x47')]=db['sequelize']['import'](_0xb727('0x48'));db[_0xb727('0x49')]=db['sequelize']['import'](_0xb727('0x4a'));db[_0xb727('0x4b')]=db['sequelize'][_0xb727('0x13')]('../api/dashboard/dashboard.model');db[_0xb727('0x4c')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x4d'));db[_0xb727('0x4e')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x4f'));db[_0xb727('0x50')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x51'));db[_0xb727('0x52')]=db[_0xb727('0x0')]['import'](_0xb727('0x53'));db[_0xb727('0x54')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x55'));db[_0xb727('0x56')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x57'));db['FaxQueueReport']=db[_0xb727('0x0')]['import'](_0xb727('0x58'));db[_0xb727('0x59')]=db[_0xb727('0x0')][_0xb727('0x13')]('../api/smsAccount/smsAccount.model');db[_0xb727('0x5a')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x5b'));db[_0xb727('0x5c')]=db[_0xb727('0x0')]['import'](_0xb727('0x5d'));db[_0xb727('0x5e')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x5f'));db[_0xb727('0x60')]=db[_0xb727('0x0')]['import'](_0xb727('0x61'));db[_0xb727('0x62')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x63'));db[_0xb727('0x64')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x65'));db[_0xb727('0x66')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x67'));db[_0xb727('0x68')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x69'));db[_0xb727('0x6a')]=db[_0xb727('0x0')][_0xb727('0x13')]('../api/openchannelQueue/openchannelQueue.model');db[_0xb727('0x6b')]=db[_0xb727('0x0')]['import'](_0xb727('0x6c'));db['OpenchannelQueueReport']=db[_0xb727('0x0')]['import'](_0xb727('0x6d'));db[_0xb727('0x6e')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x6f'));db[_0xb727('0x70')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x71'));db[_0xb727('0x72')]=db[_0xb727('0x0')]['import'](_0xb727('0x73'));db[_0xb727('0x74')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x75'));db[_0xb727('0x76')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x77'));db[_0xb727('0x78')]=db[_0xb727('0x0')][_0xb727('0x13')]('../api/chatGroup/chatGroup.model');db[_0xb727('0x79')]=db[_0xb727('0x0')][_0xb727('0x13')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0xb727('0x7a')]=db[_0xb727('0x0')]['import'](_0xb727('0x7b'));db['CmContact']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x7c'));db[_0xb727('0x7d')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x7e'));db['CmHopperBlack']=db[_0xb727('0x0')]['import'](_0xb727('0x7f'));db[_0xb727('0x80')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x81'));db[_0xb727('0x82')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x83'));db[_0xb727('0x84')]=db['sequelize'][_0xb727('0x13')](_0xb727('0x85'));db['CmCustomField']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x86'));db[_0xb727('0x87')]=db[_0xb727('0x0')][_0xb727('0x13')]('../api/action/action.model');db['Automation']=db['sequelize']['import']('../api/automation/automation.model');db[_0xb727('0x88')]=db['sequelize'][_0xb727('0x13')](_0xb727('0x89'));db[_0xb727('0x8a')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x8b'));db[_0xb727('0x8c')]=db['sequelize']['import']('../api/condition/condition.model');db[_0xb727('0x8d')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x8e'));db[_0xb727('0x8f')]=db['sequelize'][_0xb727('0x13')](_0xb727('0x90'));db[_0xb727('0x91')]=db['sequelize']['import']('../api/cdr/cdr.model');db['VoiceQueuesLog']=db['sequelize'][_0xb727('0x13')](_0xb727('0x92'));db['Schedule']=db['sequelize']['import'](_0xb727('0x93'));db[_0xb727('0x94')]=db['sequelize'][_0xb727('0x13')](_0xb727('0x95'));db[_0xb727('0x96')]=db[_0xb727('0x0')][_0xb727('0x13')]('../api/tag/tag.model');db[_0xb727('0x97')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x98'));db['CmContactHasItem']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x99'));db[_0xb727('0x9a')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x9b'));db['Template']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x9c'));db[_0xb727('0x9d')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x9e'));db[_0xb727('0x9f')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xa0'));db[_0xb727('0xa1')]=db['sequelize'][_0xb727('0x13')](_0xb727('0xa2'));db['IntegrationReport']=db[_0xb727('0x0')]['import']('../api/integrationReport/integrationReport.model');db['AnalyticCustomReport']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xa3'));db['AnalyticDefaultReport']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xa4'));db['AnalyticExtractedReport']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xa5'));db[_0xb727('0xa6')]=db[_0xb727('0x0')][_0xb727('0x13')]('../api/analyticMetric/analyticMetric.model');db['AnalyticFieldReport']=db['sequelize'][_0xb727('0x13')](_0xb727('0xa7'));db[_0xb727('0xa8')]=db[_0xb727('0x0')]['import']('../api/analyticTreeReport/analyticTreeReport.model');db['SalesforceAccount']=db[_0xb727('0x0')][_0xb727('0x13')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xb727('0xa9')]=db[_0xb727('0x0')]['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db['sequelize'][_0xb727('0x13')](_0xb727('0xaa'));db[_0xb727('0xab')]=db[_0xb727('0x0')]['import']('../api/intSugarcrmAccount/intSugarcrmAccount.model');db['SugarcrmConfiguration']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xac'));db['SugarcrmField']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xad'));db[_0xb727('0xae')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xaf'));db[_0xb727('0xb0')]=db['sequelize'][_0xb727('0x13')](_0xb727('0xb1'));db[_0xb727('0xb2')]=db[_0xb727('0x0')]['import'](_0xb727('0xb3'));db[_0xb727('0xb4')]=db[_0xb727('0x0')]['import']('../api/intZohoAccount/intZohoAccount.model');db[_0xb727('0xb5')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xb6'));db['ZohoField']=db['sequelize'][_0xb727('0x13')](_0xb727('0xb7'));db['ZendeskAccount']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xb8'));db[_0xb727('0xb9')]=db['sequelize']['import'](_0xb727('0xba'));db[_0xb727('0xbb')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xbc'));db[_0xb727('0xbd')]=db['sequelize'][_0xb727('0x13')](_0xb727('0xbe'));db[_0xb727('0xbf')]=db[_0xb727('0x0')][_0xb727('0x13')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xb727('0xc0')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xc1'));db[_0xb727('0xc2')]=db['sequelize'][_0xb727('0x13')](_0xb727('0xc3'));db['VtigerConfiguration']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xc4'));db[_0xb727('0xc5')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xc6'));db[_0xb727('0xc7')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xc8'));db['ServicenowConfiguration']=db['sequelize']['import'](_0xb727('0xc9'));db['ServicenowField']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xca'));db[_0xb727('0xcb')]=db['sequelize']['import'](_0xb727('0xcc'));db[_0xb727('0xcd')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xce'));db[_0xb727('0xcf')]=db[_0xb727('0x0')][_0xb727('0x13')]('../api/intDynamics365Field/intDynamics365Field.model');db['FreshsalesAccount']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xd0'));db[_0xb727('0xd1')]=db[_0xb727('0x0')]['import'](_0xb727('0xd2'));db[_0xb727('0xd3')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xd4'));db['Integration']=db['sequelize'][_0xb727('0x13')](_0xb727('0xa2'));db[_0xb727('0xd5')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xd6'));db[_0xb727('0xd7')]=db['sequelize']['import'](_0xb727('0xd8'));db[_0xb727('0xd9')]=db['sequelize']['import'](_0xb727('0xda'));db[_0xb727('0xdb')]=db[_0xb727('0x0')]['import'](_0xb727('0xdc'));db[_0xb727('0xdd')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xde'));db[_0xb727('0xdf')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xe0'));db[_0xb727('0xe1')]=db[_0xb727('0x0')]['import'](_0xb727('0xe2'));db[_0xb727('0xe3')]=db[_0xb727('0x0')][_0xb727('0x13')]('../api/squareReport/squareReport.model');db[_0xb727('0xe4')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xe5'));db['JscriptyProject']=db['sequelize']['import'](_0xb727('0xe6'));db[_0xb727('0xe7')]=db['sequelize']['import'](_0xb727('0xe8'));db[_0xb727('0xe9')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xea'));db[_0xb727('0xeb')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xec'));db['SquareRecording']=db['sequelize']['import']('../api/squareRecording/squareRecording.model');db[_0xb727('0xed')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xee'));db[_0xb727('0xef')]=db[_0xb727('0x0')][_0xb727('0x13')]('../api/team/team.model');db[_0xb727('0xf0')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xf1'));db[_0xb727('0xf2')]=db[_0xb727('0x0')]['import'](_0xb727('0xf3'));db[_0xb727('0xf4')]=db[_0xb727('0x0')][_0xb727('0x13')]('../api/migration/migration.model');db[_0xb727('0xf5')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xf6'));db[_0xb727('0xf7')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xf8'));db[_0xb727('0xf9')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xfa'));db[_0xb727('0xfb')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xfc'));db['FaxTransferReport']=db['sequelize'][_0xb727('0x13')](_0xb727('0xfd'));db[_0xb727('0xfe')]=db[_0xb727('0x0')]['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0xff'));db[_0xb727('0x100')]=db[_0xb727('0x0')][_0xb727('0x13')]('../api/cmList/cmList.model');db[_0xb727('0x101')]=db[_0xb727('0x0')][_0xb727('0x13')]('../api/voicePrefix/voicePrefix.model');db['UserProfile']=db[_0xb727('0x0')][_0xb727('0x13')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x102'));db[_0xb727('0x103')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x104'));db[_0xb727('0x105')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x106'));db['WhatsappAccount']=db[_0xb727('0x0')][_0xb727('0x13')]('../api/whatsappAccount/whatsappAccount.model');db[_0xb727('0x107')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x108'));db[_0xb727('0x109')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x10a'));db[_0xb727('0x10b')]=db[_0xb727('0x0')][_0xb727('0x13')]('../api/whatsappMessage/whatsappMessage.model');db['WhatsappQueueReport']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x10c'));db[_0xb727('0x10d')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x10e'));db['WhatsappQueue']=db[_0xb727('0x0')][_0xb727('0x13')]('../api/whatsappQueue/whatsappQueue.model');db[_0xb727('0x10f')]=db[_0xb727('0x0')][_0xb727('0x13')]('../api/cloudProvider/cloudProvider.model');db[_0xb727('0x110')]=db[_0xb727('0x0')]['import'](_0xb727('0x111'));db[_0xb727('0x112')]=db['sequelize'][_0xb727('0x13')](_0xb727('0x113'));db['UserVoicePrefix']=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x114'));db[_0xb727('0x115')]=db[_0xb727('0x0')][_0xb727('0x13')](_0xb727('0x116'));db[_0xb727('0x10')][_0xb727('0x117')](db['VoiceMail'],{'as':_0xb727('0x20'),'onDelete':_0xb727('0x118'),'foreignKey':'UserId'});db['User'][_0xb727('0x117')](db[_0xb727('0x115')],{'as':_0xb727('0x119'),'onDelete':_0xb727('0x118'),'foreignKey':'UserId'});db[_0xb727('0x10')][_0xb727('0x11a')](db[_0xb727('0x1d')],{'as':_0xb727('0x11b'),'foreignKey':_0xb727('0x11c')});db[_0xb727('0x10')][_0xb727('0x11a')](db[_0xb727('0x2f')],{'as':'VoiceQueuesRt','foreignKey':'UserId'});db['User']['hasMany'](db[_0xb727('0x17')],{'as':'Extensions','onDelete':_0xb727('0x118'),'hooks':!![]});db[_0xb727('0x10')]['hasMany'](db[_0xb727('0x80')],{'as':_0xb727('0x11d'),'foreignKey':_0xb727('0x11c')});db[_0xb727('0x10')]['hasMany'](db[_0xb727('0x82')],{'as':_0xb727('0x11e'),'foreignKey':_0xb727('0x11c')});db[_0xb727('0x10')][_0xb727('0x11a')](db[_0xb727('0x84')],{'as':'ReportAgentPreview','foreignKey':_0xb727('0x11c')});db[_0xb727('0x10')][_0xb727('0x11a')](db[_0xb727('0x66')],{'as':'OpenchannelInteractions','foreignKey':_0xb727('0x11c')});db[_0xb727('0x10')]['hasMany'](db[_0xb727('0x70')],{'as':_0xb727('0x11f'),'foreignKey':_0xb727('0x11c')});db['User'][_0xb727('0x11a')](db['SmsInteraction'],{'as':'SmsInteractions','foreignKey':_0xb727('0x11c')});db[_0xb727('0x10')][_0xb727('0x11a')](db[_0xb727('0x52')],{'as':_0xb727('0x120'),'foreignKey':_0xb727('0x11c')});db[_0xb727('0x10')][_0xb727('0x11a')](db[_0xb727('0x44')],{'as':_0xb727('0x121'),'foreignKey':_0xb727('0x11c')});db[_0xb727('0x10')][_0xb727('0x11a')](db['WhatsappInteraction'],{'as':'WhatsappInteractions','foreignKey':_0xb727('0x11c')});db[_0xb727('0x10')]['hasMany'](db['UserNotification'],{'as':_0xb727('0x122'),'foreignKey':'SenderId'});db[_0xb727('0x10')]['belongsTo'](db[_0xb727('0x123')],{'as':_0xb727('0x123'),'foreignKey':_0xb727('0x124')});db['User'][_0xb727('0x125')](db[_0xb727('0x78')],{'as':'Groups','through':_0xb727('0x126')});db[_0xb727('0x10')][_0xb727('0x125')](db[_0xb727('0x127')],{'as':_0xb727('0x128'),'through':'cm_user_has_contacts'});db[_0xb727('0x10')][_0xb727('0x125')](db[_0xb727('0x100')],{'as':'Lists','through':'cm_user_has_lists'});db['User'][_0xb727('0x125')](db[_0xb727('0xef')],{'through':'user_has_teams'});db[_0xb727('0x10')][_0xb727('0x125')](db[_0xb727('0x44')],{'as':_0xb727('0x121'),'through':_0xb727('0x129')});db[_0xb727('0x10')][_0xb727('0x125')](db[_0xb727('0x70')],{'as':_0xb727('0x11f'),'through':'user_has_chat_interactions'});db[_0xb727('0x10')][_0xb727('0x125')](db[_0xb727('0x52')],{'as':_0xb727('0x120'),'through':'user_has_fax_interactions'});db[_0xb727('0x10')][_0xb727('0x125')](db[_0xb727('0x5c')],{'as':_0xb727('0x12a'),'through':_0xb727('0x12b')});db['User'][_0xb727('0x125')](db['OpenchannelInteraction'],{'as':_0xb727('0x12c'),'through':_0xb727('0x12d')});db['User'][_0xb727('0x125')](db[_0xb727('0x109')],{'as':_0xb727('0x12e'),'through':_0xb727('0x12f')});db[_0xb727('0x10')]['belongsToMany'](db[_0xb727('0x1b')],{'as':_0xb727('0x130'),'through':'UserVoiceQueue','required':![]});db[_0xb727('0x10')][_0xb727('0x125')](db[_0xb727('0x101')],{'as':'VoicePrefixes','through':'UserVoicePrefix','required':![]});db[_0xb727('0x10')][_0xb727('0x125')](db[_0xb727('0x131')],{'as':_0xb727('0x132'),'through':_0xb727('0x34'),'required':![]});db[_0xb727('0x10')][_0xb727('0x125')](db[_0xb727('0x76')],{'as':_0xb727('0x133'),'through':_0xb727('0x134'),'required':![],'hooks':!![]});db[_0xb727('0x10')][_0xb727('0x125')](db[_0xb727('0x56')],{'as':_0xb727('0x135'),'through':_0xb727('0x36'),'required':![]});db[_0xb727('0x10')][_0xb727('0x125')](db[_0xb727('0x60')],{'as':'SmsQueues','through':_0xb727('0x38'),'required':![]});db[_0xb727('0x10')][_0xb727('0x125')](db[_0xb727('0x6a')],{'as':_0xb727('0x136'),'through':_0xb727('0x39'),'required':![]});db[_0xb727('0x10')][_0xb727('0x125')](db[_0xb727('0x137')],{'as':'WhatsappQueues','through':_0xb727('0x3b'),'required':![]});db[_0xb727('0x10')][_0xb727('0x125')](db[_0xb727('0x100')],{'through':'cm_user_has_lists'});db[_0xb727('0x10')][_0xb727('0x125')](db['ChatWebsite'],{'as':_0xb727('0x138'),'through':'user_has_chat_websites'});db[_0xb727('0x10')][_0xb727('0x125')](db[_0xb727('0x4e')],{'as':_0xb727('0x139'),'through':'user_has_fax_accounts'});db['User'][_0xb727('0x125')](db['MailAccount'],{'as':_0xb727('0x13a'),'through':_0xb727('0x13b')});db[_0xb727('0x10')][_0xb727('0x125')](db[_0xb727('0x62')],{'as':_0xb727('0x13c'),'through':_0xb727('0x13d')});db[_0xb727('0x10')]['belongsToMany'](db[_0xb727('0x59')],{'as':'SmsAccounts','through':_0xb727('0x13e')});db['User'][_0xb727('0x125')](db['WhatsappAccount'],{'as':_0xb727('0x13f'),'through':_0xb727('0x140')});db[_0xb727('0x12')]['hasMany'](db[_0xb727('0x17')],{'as':_0xb727('0x141'),'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x142')});db[_0xb727('0x15')][_0xb727('0x11a')](db[_0xb727('0x17')],{'onDelete':'cascade'});db[_0xb727('0x17')][_0xb727('0x11a')](db[_0xb727('0x17')],{'as':_0xb727('0x143'),'onDelete':_0xb727('0x118')});db[_0xb727('0x19')]['belongsToMany'](db['Sound'],{'as':_0xb727('0x144'),'through':_0xb727('0x145')});db[_0xb727('0x1b')]['hasMany'](db['UserVoiceQueueRt'],{'as':_0xb727('0x146'),'foreignKey':_0xb727('0x147')});db['VoiceQueue'][_0xb727('0x11a')](db[_0xb727('0x7d')],{'as':_0xb727('0x148'),'foreignKey':'VoiceQueueId'});db[_0xb727('0x1b')]['hasMany'](db[_0xb727('0x80')],{'as':_0xb727('0x11d'),'foreignKey':_0xb727('0x147')});db[_0xb727('0x1b')][_0xb727('0x11a')](db[_0xb727('0x82')],{'as':'HopperHistories','foreignKey':_0xb727('0x147')});db[_0xb727('0x1b')][_0xb727('0x11a')](db[_0xb727('0x84')],{'as':_0xb727('0x84'),'foreignKey':_0xb727('0x147')});db[_0xb727('0x1b')][_0xb727('0x11a')](db[_0xb727('0x149')],{'as':_0xb727('0x14a'),'foreignKey':_0xb727('0x147')});db['VoiceQueue']['hasMany'](db[_0xb727('0xdf')],{'as':_0xb727('0x14b'),'foreignKey':'VoiceQueueId'});db[_0xb727('0x1b')][_0xb727('0x14c')](db[_0xb727('0x2c')],{'as':_0xb727('0x2c'),'foreignKey':_0xb727('0x14d')});db[_0xb727('0x1b')][_0xb727('0x14c')](db[_0xb727('0x2c')],{'as':_0xb727('0x14e'),'foreignKey':_0xb727('0x14f')});db[_0xb727('0x1b')][_0xb727('0x14c')](db[_0xb727('0x8d')],{'as':_0xb727('0x8d'),'foreignKey':_0xb727('0x150')});db[_0xb727('0x1b')][_0xb727('0x14c')](db[_0xb727('0x8f')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xb727('0x1b')][_0xb727('0x125')](db[_0xb727('0x100')],{'as':_0xb727('0x151'),'through':'voice_queues_has_cm_lists'});db[_0xb727('0x1b')][_0xb727('0x125')](db['User'],{'as':'Agents','through':_0xb727('0x31')});db[_0xb727('0x1b')][_0xb727('0x125')](db[_0xb727('0xef')],{'as':_0xb727('0x152'),'through':'TeamVoiceQueue'});db[_0xb727('0x1b')][_0xb727('0x125')](db[_0xb727('0x100')],{'as':_0xb727('0x153'),'through':_0xb727('0x154')});db[_0xb727('0x1d')][_0xb727('0x14c')](db[_0xb727('0x10')],{'as':_0xb727('0x10'),'foreignKey':_0xb727('0x11c')});db[_0xb727('0x1f')][_0xb727('0x14c')](db[_0xb727('0x10')],{'as':'User','foreignKey':_0xb727('0x11c')});db[_0xb727('0x20')][_0xb727('0x11a')](db[_0xb727('0x155')],{'as':'Messages','onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x156'),'sourceKey':_0xb727('0x157')});db['VoiceMailMessage']['belongsTo'](db[_0xb727('0x20')],{'foreignKey':_0xb727('0x156'),'targetKey':'mailbox'});db[_0xb727('0x23')][_0xb727('0x11a')](db[_0xb727('0x28')],{'as':_0xb727('0x158'),'foreignKey':_0xb727('0x159'),'constraints':![]});db[_0xb727('0x23')]['hasMany'](db[_0xb727('0x26')],{'as':_0xb727('0x15a'),'foreignKey':'uniqueid','constraints':![]});db[_0xb727('0x23')][_0xb727('0x14c')](db[_0xb727('0x10')],{'as':_0xb727('0x10'),'foreignKey':_0xb727('0x11c')});db['VoiceCallReport']['belongsTo'](db[_0xb727('0x127')],{'as':_0xb727('0x15b'),'foreignKey':'ContactId'});db[_0xb727('0x3d')][_0xb727('0x14c')](db['MailAccount'],{'as':_0xb727('0x3f'),'foreignKey':_0xb727('0x15c')});db['MailServerIn'][_0xb727('0x14c')](db[_0xb727('0x10f')],{'as':_0xb727('0x10f'),'foreignKey':_0xb727('0x15d'),'onDelete':_0xb727('0x15e')});db[_0xb727('0x3e')][_0xb727('0x14c')](db[_0xb727('0x3f')],{'as':_0xb727('0x3f'),'foreignKey':_0xb727('0x15c')});db[_0xb727('0x3e')][_0xb727('0x14c')](db[_0xb727('0x10f')],{'as':_0xb727('0x10f'),'foreignKey':_0xb727('0x15d'),'onDelete':_0xb727('0x15e')});db[_0xb727('0x3f')]['hasOne'](db['MailServerIn'],{'as':_0xb727('0x15f'),'onDelete':'cascade'});db[_0xb727('0x3f')][_0xb727('0x117')](db[_0xb727('0x3e')],{'as':_0xb727('0x160'),'onDelete':'cascade'});db[_0xb727('0x3f')][_0xb727('0x11a')](db['Disposition'],{'as':_0xb727('0x161'),'foreignKey':_0xb727('0x15c'),'onDelete':'cascade'});db['MailAccount']['hasMany'](db[_0xb727('0x88')],{'as':_0xb727('0x162'),'foreignKey':_0xb727('0x15c')});db[_0xb727('0x3f')][_0xb727('0x11a')](db[_0xb727('0x163')],{'as':_0xb727('0x164'),'foreignKey':_0xb727('0x15c')});db[_0xb727('0x3f')][_0xb727('0x11a')](db[_0xb727('0x44')],{'as':'Interactions'});db[_0xb727('0x3f')][_0xb727('0x11a')](db[_0xb727('0x47')],{'as':'Applications'});db[_0xb727('0x3f')][_0xb727('0x14c')](db[_0xb727('0x100')],{'as':_0xb727('0x165'),'foreignKey':_0xb727('0x166')});db[_0xb727('0x3f')]['belongsTo'](db['Template'],{'as':'Template','foreignKey':_0xb727('0x167')});db[_0xb727('0x3f')]['belongsTo'](db[_0xb727('0x8f')],{'as':_0xb727('0x168'),'foreignKey':_0xb727('0x169')});db[_0xb727('0x3f')]['belongsToMany'](db[_0xb727('0x10')],{'as':_0xb727('0x16a'),'through':_0xb727('0x13b')});db['MailQueue']['belongsToMany'](db[_0xb727('0x10')],{'as':'Agents','through':'UserMailQueue'});db[_0xb727('0x131')]['belongsToMany'](db[_0xb727('0xef')],{'through':_0xb727('0x16b'),'as':_0xb727('0x152')});db[_0xb727('0x44')][_0xb727('0x11a')](db[_0xb727('0x163')],{'as':_0xb727('0x164'),'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x16c')});db[_0xb727('0x44')]['belongsTo'](db['MailAccount'],{'as':_0xb727('0x16d'),'foreignKey':'MailAccountId'});db['MailInteraction'][_0xb727('0x14c')](db[_0xb727('0x127')],{'as':'Contact','foreignKey':'ContactId'});db[_0xb727('0x44')][_0xb727('0x14c')](db[_0xb727('0x10')],{'as':_0xb727('0x16e'),'foreignKey':_0xb727('0x11c')});db[_0xb727('0x44')]['belongsToMany'](db[_0xb727('0x96')],{'through':_0xb727('0x16f'),'as':'Tags'});db[_0xb727('0x44')][_0xb727('0x125')](db[_0xb727('0x96')],{'through':_0xb727('0x16f'),'as':_0xb727('0x170')});db[_0xb727('0x44')][_0xb727('0x125')](db[_0xb727('0x10')],{'as':_0xb727('0x171'),'through':_0xb727('0x129'),'foreignKey':_0xb727('0x16c')});db['MailMessage'][_0xb727('0x11a')](db['Attachment'],{'as':_0xb727('0x172'),'onDelete':'cascade'});db[_0xb727('0x163')]['belongsTo'](db[_0xb727('0x10')],{'as':_0xb727('0x10')});db[_0xb727('0x163')][_0xb727('0x14c')](db['CmContact'],{'onDelete':_0xb727('0x118'),'as':_0xb727('0x15b')});db[_0xb727('0x163')][_0xb727('0x14c')](db['MailInteraction'],{'as':_0xb727('0x173'),'foreignKey':'MailInteractionId'});db[_0xb727('0x163')][_0xb727('0x14c')](db['MailAccount'],{'as':_0xb727('0x16d'),'foreignKey':'MailAccountId'});db[_0xb727('0x163')][_0xb727('0x14c')](db[_0xb727('0x6b')],{'as':_0xb727('0x6b'),'foreignKey':_0xb727('0x174')});db['MailMessage'][_0xb727('0x14c')](db[_0xb727('0x74')],{'as':_0xb727('0x74'),'foreignKey':_0xb727('0x175')});db[_0xb727('0x47')]['belongsTo'](db['User'],{'onDelete':_0xb727('0x15e')});db[_0xb727('0x47')]['belongsTo'](db[_0xb727('0x131')],{'onDelete':'restrict'});db[_0xb727('0x47')][_0xb727('0x14c')](db[_0xb727('0x3f')],{'onDelete':_0xb727('0x15e')});db[_0xb727('0x47')][_0xb727('0x14c')](db['Interval'],{'onDelete':_0xb727('0x15e'),'foreignKey':_0xb727('0x150')});db['MailApplication'][_0xb727('0x14c')](db['Tag'],{'onDelete':_0xb727('0x15e'),'foreignKey':_0xb727('0x176')});db[_0xb727('0x49')]['belongsTo'](db[_0xb727('0x3f')],{});db[_0xb727('0x49')][_0xb727('0x14c')](db[_0xb727('0x100')],{'as':_0xb727('0x165'),'foreignKey':_0xb727('0x166')});db['MailQueueReport'][_0xb727('0x14c')](db['CmContact'],{'as':_0xb727('0x15b'),'foreignKey':_0xb727('0x177')});db['MailQueueReport'][_0xb727('0x14c')](db[_0xb727('0x44')],{});db['MailQueueReport'][_0xb727('0x14c')](db[_0xb727('0x163')],{});db[_0xb727('0x49')][_0xb727('0x14c')](db[_0xb727('0x10')],{});db[_0xb727('0x49')][_0xb727('0x14c')](db[_0xb727('0x131')],{});db[_0xb727('0x4b')][_0xb727('0x11a')](db['DashboardItem'],{'as':_0xb727('0x178'),'onDelete':_0xb727('0x118')});db[_0xb727('0x4e')][_0xb727('0x11a')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xb727('0x179'),'onDelete':_0xb727('0x118')});db[_0xb727('0x4e')][_0xb727('0x11a')](db[_0xb727('0x88')],{'as':'Answers','foreignKey':_0xb727('0x179')});db['FaxAccount'][_0xb727('0x11a')](db[_0xb727('0x52')],{'as':_0xb727('0x17a')});db['FaxAccount'][_0xb727('0x11a')](db[_0xb727('0x50')],{'as':'Applications'});db['FaxAccount'][_0xb727('0x11a')](db['VoiceExtension'],{'as':_0xb727('0x17b'),'onDelete':'cascade'});db['FaxAccount'][_0xb727('0x11a')](db[_0xb727('0x54')],{'as':_0xb727('0x164')});db[_0xb727('0x4e')][_0xb727('0x14c')](db[_0xb727('0x2c')],{'as':_0xb727('0x2c')});db[_0xb727('0x4e')]['belongsTo'](db[_0xb727('0x100')],{'as':_0xb727('0x165'),'foreignKey':_0xb727('0x166')});db[_0xb727('0x4e')]['belongsTo'](db[_0xb727('0x8f')],{'as':_0xb727('0x168'),'foreignKey':_0xb727('0x169')});db[_0xb727('0x4e')][_0xb727('0x125')](db[_0xb727('0x10')],{'as':'Agents','through':'user_has_fax_accounts'});db[_0xb727('0x50')][_0xb727('0x14c')](db[_0xb727('0x10')],{'onDelete':_0xb727('0x15e')});db[_0xb727('0x50')][_0xb727('0x14c')](db[_0xb727('0x56')],{'onDelete':_0xb727('0x15e')});db[_0xb727('0x50')][_0xb727('0x14c')](db[_0xb727('0x4e')],{'onDelete':_0xb727('0x15e')});db[_0xb727('0x50')][_0xb727('0x14c')](db[_0xb727('0x96')],{'onDelete':_0xb727('0x15e'),'foreignKey':_0xb727('0x176')});db[_0xb727('0x52')][_0xb727('0x11a')](db[_0xb727('0x54')],{'as':_0xb727('0x164'),'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x17c')});db[_0xb727('0x52')][_0xb727('0x14c')](db[_0xb727('0x4e')],{'as':_0xb727('0x16d'),'foreignKey':_0xb727('0x179')});db[_0xb727('0x52')][_0xb727('0x14c')](db[_0xb727('0x127')],{'as':_0xb727('0x15b'),'foreignKey':_0xb727('0x177')});db[_0xb727('0x52')][_0xb727('0x14c')](db[_0xb727('0x10')],{'as':_0xb727('0x16e'),'foreignKey':'UserId'});db[_0xb727('0x52')][_0xb727('0x125')](db['Tag'],{'through':_0xb727('0x17d'),'as':_0xb727('0x17e')});db['FaxInteraction']['belongsToMany'](db['Tag'],{'through':_0xb727('0x17d'),'as':_0xb727('0x170')});db[_0xb727('0x52')]['belongsToMany'](db[_0xb727('0x10')],{'as':_0xb727('0x171'),'through':_0xb727('0x17f'),'foreignKey':_0xb727('0x17c')});db[_0xb727('0x54')][_0xb727('0x14c')](db[_0xb727('0x10')],{'onDelete':_0xb727('0x118'),'as':_0xb727('0x10')});db[_0xb727('0x54')][_0xb727('0x14c')](db[_0xb727('0x52')],{'as':_0xb727('0x173'),'foreignKey':_0xb727('0x17c')});db[_0xb727('0x54')][_0xb727('0x14c')](db[_0xb727('0x127')],{'onDelete':_0xb727('0x118'),'as':_0xb727('0x15b')});db['FaxMessage']['belongsTo'](db['Attachment'],{'as':_0xb727('0xf5'),'foreignKey':_0xb727('0x180')});db['FaxMessage'][_0xb727('0x14c')](db[_0xb727('0x4e')],{'as':_0xb727('0x16d'),'foreignKey':_0xb727('0x179')});db[_0xb727('0x56')][_0xb727('0x125')](db[_0xb727('0x10')],{'as':_0xb727('0x16a'),'through':_0xb727('0x36')});db[_0xb727('0x56')][_0xb727('0x125')](db['Team'],{'through':_0xb727('0x181'),'as':'Teams'});db['FaxQueueReport']['belongsTo'](db[_0xb727('0x4e')],{});db[_0xb727('0x182')]['belongsTo'](db[_0xb727('0x100')],{'as':_0xb727('0x165'),'foreignKey':_0xb727('0x166')});db[_0xb727('0x182')]['belongsTo'](db[_0xb727('0x127')],{'as':_0xb727('0x15b'),'foreignKey':_0xb727('0x177')});db[_0xb727('0x182')]['belongsTo'](db['FaxInteraction'],{});db[_0xb727('0x182')][_0xb727('0x14c')](db[_0xb727('0x54')],{});db['FaxQueueReport'][_0xb727('0x14c')](db['User'],{});db['FaxQueueReport'][_0xb727('0x14c')](db[_0xb727('0x56')],{});db[_0xb727('0x59')][_0xb727('0x11a')](db[_0xb727('0x8a')],{'as':_0xb727('0x161'),'foreignKey':_0xb727('0x183'),'onDelete':_0xb727('0x118')});db[_0xb727('0x59')][_0xb727('0x11a')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0xb727('0x183')});db[_0xb727('0x59')][_0xb727('0x11a')](db[_0xb727('0x5e')],{'as':_0xb727('0x164'),'foreignKey':'SmsAccountId'});db['SmsAccount'][_0xb727('0x11a')](db[_0xb727('0x5c')],{'as':_0xb727('0x17a')});db['SmsAccount'][_0xb727('0x11a')](db[_0xb727('0x5a')],{'as':_0xb727('0x143')});db[_0xb727('0x59')][_0xb727('0x14c')](db['CmList'],{'as':_0xb727('0x165'),'foreignKey':_0xb727('0x166')});db[_0xb727('0x59')][_0xb727('0x14c')](db[_0xb727('0x8f')],{'as':_0xb727('0x168'),'foreignKey':_0xb727('0x169')});db['SmsAccount'][_0xb727('0x125')](db[_0xb727('0x10')],{'as':'Agents','through':_0xb727('0x13e')});db[_0xb727('0x5a')][_0xb727('0x14c')](db[_0xb727('0x10')],{'onDelete':_0xb727('0x15e')});db[_0xb727('0x5a')][_0xb727('0x14c')](db['SmsQueue'],{'onDelete':_0xb727('0x15e')});db[_0xb727('0x5a')][_0xb727('0x14c')](db[_0xb727('0x59')],{'onDelete':_0xb727('0x15e')});db['SmsApplication'][_0xb727('0x14c')](db['Interval'],{'onDelete':_0xb727('0x15e'),'foreignKey':'IntervalId'});db[_0xb727('0x5a')][_0xb727('0x14c')](db[_0xb727('0x96')],{'onDelete':_0xb727('0x15e'),'foreignKey':_0xb727('0x176')});db[_0xb727('0x5c')]['hasMany'](db[_0xb727('0x5e')],{'as':_0xb727('0x164'),'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x184')});db[_0xb727('0x5c')]['belongsTo'](db[_0xb727('0x59')],{'as':_0xb727('0x16d'),'foreignKey':_0xb727('0x183')});db[_0xb727('0x5c')][_0xb727('0x14c')](db[_0xb727('0x127')],{'as':_0xb727('0x15b'),'foreignKey':_0xb727('0x177')});db[_0xb727('0x5c')][_0xb727('0x14c')](db['User'],{'as':'Owner','foreignKey':_0xb727('0x11c')});db[_0xb727('0x5c')]['belongsToMany'](db['Tag'],{'through':'sms_interaction_has_tags','as':'Tags'});db['SmsInteraction'][_0xb727('0x125')](db[_0xb727('0x96')],{'through':_0xb727('0x185'),'as':_0xb727('0x170')});db[_0xb727('0x5c')][_0xb727('0x125')](db[_0xb727('0x10')],{'as':_0xb727('0x171'),'through':_0xb727('0x12b'),'foreignKey':_0xb727('0x184')});db['SmsMessage'][_0xb727('0x14c')](db[_0xb727('0x10')],{'as':_0xb727('0x10')});db['SmsMessage']['belongsTo'](db[_0xb727('0x127')],{'onDelete':_0xb727('0x118'),'as':_0xb727('0x15b')});db[_0xb727('0x5e')][_0xb727('0x14c')](db['SmsInteraction'],{'onDelete':_0xb727('0x118'),'as':'Interaction','foreignKey':'SmsInteractionId'});db[_0xb727('0x5e')][_0xb727('0x14c')](db[_0xb727('0x59')],{'as':_0xb727('0x16d'),'foreignKey':_0xb727('0x183')});db[_0xb727('0x60')][_0xb727('0x125')](db[_0xb727('0x10')],{'as':_0xb727('0x16a'),'through':_0xb727('0x38'),'foreignKey':_0xb727('0x186')});db['SmsQueue'][_0xb727('0x125')](db[_0xb727('0xef')],{'through':_0xb727('0x187'),'as':'Teams'});db[_0xb727('0x62')][_0xb727('0x11a')](db[_0xb727('0x8a')],{'as':_0xb727('0x161'),'foreignKey':_0xb727('0x188'),'onDelete':'cascade'});db[_0xb727('0x62')][_0xb727('0x11a')](db['CannedAnswer'],{'as':_0xb727('0x162'),'foreignKey':_0xb727('0x188')});db[_0xb727('0x62')][_0xb727('0x11a')](db[_0xb727('0x66')],{'as':'Interactions','foreignKey':_0xb727('0x188')});db[_0xb727('0x62')][_0xb727('0x11a')](db[_0xb727('0x68')],{'as':'Messages','foreignKey':_0xb727('0x188')});db[_0xb727('0x62')][_0xb727('0x11a')](db[_0xb727('0x64')],{'as':_0xb727('0x143'),'foreignKey':'OpenchannelAccountId'});db[_0xb727('0x62')][_0xb727('0x14c')](db['CmList'],{'as':_0xb727('0x165'),'foreignKey':_0xb727('0x166')});db[_0xb727('0x62')][_0xb727('0x14c')](db[_0xb727('0x8f')],{'as':_0xb727('0x168'),'foreignKey':_0xb727('0x169')});db['OpenchannelAccount']['belongsToMany'](db[_0xb727('0x10')],{'as':_0xb727('0x16a'),'through':_0xb727('0x13d')});db['OpenchannelApplication'][_0xb727('0x14c')](db[_0xb727('0x10')],{'onDelete':_0xb727('0x15e')});db[_0xb727('0x64')][_0xb727('0x14c')](db[_0xb727('0x6a')],{'onDelete':_0xb727('0x15e'),'foreignKey':_0xb727('0x189')});db[_0xb727('0x64')][_0xb727('0x14c')](db[_0xb727('0x62')],{'onDelete':_0xb727('0x15e'),'foreignKey':_0xb727('0x188')});db[_0xb727('0x64')][_0xb727('0x14c')](db[_0xb727('0x8d')],{'onDelete':_0xb727('0x15e'),'foreignKey':'IntervalId'});db['OpenchannelApplication'][_0xb727('0x14c')](db[_0xb727('0x96')],{'onDelete':_0xb727('0x15e'),'foreignKey':_0xb727('0x176')});db[_0xb727('0x66')]['hasMany'](db[_0xb727('0x68')],{'as':_0xb727('0x164'),'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x18a')});db[_0xb727('0x66')][_0xb727('0x14c')](db[_0xb727('0x62')],{'as':_0xb727('0x16d'),'foreignKey':'OpenchannelAccountId'});db[_0xb727('0x66')][_0xb727('0x14c')](db[_0xb727('0x127')],{'as':'Contact','foreignKey':'ContactId'});db[_0xb727('0x66')][_0xb727('0x14c')](db[_0xb727('0x10')],{'as':_0xb727('0x16e'),'foreignKey':_0xb727('0x11c')});db[_0xb727('0x66')][_0xb727('0x125')](db[_0xb727('0x96')],{'through':_0xb727('0x18b'),'as':'Tags'});db['OpenchannelInteraction'][_0xb727('0x125')](db[_0xb727('0x96')],{'through':'openchannel_interaction_has_tags','as':_0xb727('0x170')});db[_0xb727('0x66')][_0xb727('0x125')](db[_0xb727('0x10')],{'as':'Users','through':'user_has_openchannel_interactions','foreignKey':_0xb727('0x18a')});db[_0xb727('0x68')][_0xb727('0x14c')](db[_0xb727('0x10')],{'onDelete':_0xb727('0x118'),'as':_0xb727('0x10')});db['OpenchannelMessage'][_0xb727('0x14c')](db[_0xb727('0x127')],{'onDelete':_0xb727('0x118'),'as':'Contact'});db[_0xb727('0x68')][_0xb727('0x14c')](db[_0xb727('0x66')],{'onDelete':_0xb727('0x118'),'as':_0xb727('0x173'),'foreignKey':_0xb727('0x18a')});db[_0xb727('0x68')][_0xb727('0x14c')](db[_0xb727('0xf5')],{'as':_0xb727('0xf5'),'foreignKey':_0xb727('0x180')});db[_0xb727('0x68')][_0xb727('0x14c')](db[_0xb727('0x62')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db['OpenchannelQueue']['belongsToMany'](db[_0xb727('0x10')],{'as':_0xb727('0x16a'),'through':_0xb727('0x39'),'foreignKey':_0xb727('0x189')});db[_0xb727('0x6a')][_0xb727('0x125')](db[_0xb727('0xef')],{'through':_0xb727('0x18c'),'as':_0xb727('0x152')});db[_0xb727('0x6b')][_0xb727('0x11a')](db[_0xb727('0x8a')],{'as':_0xb727('0x161'),'foreignKey':_0xb727('0x174'),'onDelete':_0xb727('0x118')});db[_0xb727('0x6b')]['hasMany'](db[_0xb727('0x88')],{'as':_0xb727('0x162'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite'][_0xb727('0x11a')](db['ChatProactiveAction'],{'as':_0xb727('0x18d')});db[_0xb727('0x6b')][_0xb727('0x11a')](db[_0xb727('0x70')],{'as':_0xb727('0x17a')});db[_0xb727('0x6b')][_0xb727('0x11a')](db[_0xb727('0x6e')],{'as':_0xb727('0x143')});db['ChatWebsite'][_0xb727('0x11a')](db[_0xb727('0x72')],{'as':_0xb727('0x164')});db[_0xb727('0x6b')]['belongsTo'](db[_0xb727('0x100')],{'as':_0xb727('0x165'),'foreignKey':_0xb727('0x166')});db[_0xb727('0x6b')]['belongsTo'](db[_0xb727('0x8d')],{'as':_0xb727('0x8d'),'foreignKey':_0xb727('0x150')});db[_0xb727('0x6b')][_0xb727('0x14c')](db[_0xb727('0x3f')],{'as':_0xb727('0x3f'),'foreignKey':'MailAccountId'});db[_0xb727('0x6b')][_0xb727('0x14c')](db[_0xb727('0x8f')],{'as':_0xb727('0x168'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xb727('0x6b')][_0xb727('0x125')](db[_0xb727('0x10')],{'as':_0xb727('0x16a'),'through':_0xb727('0x18e')});db[_0xb727('0x18f')][_0xb727('0x14c')](db[_0xb727('0x62')],{});db['OpenchannelQueueReport'][_0xb727('0x14c')](db[_0xb727('0x100')],{'as':_0xb727('0x165'),'foreignKey':_0xb727('0x166')});db[_0xb727('0x18f')][_0xb727('0x14c')](db[_0xb727('0x127')],{'as':_0xb727('0x15b'),'foreignKey':_0xb727('0x177')});db[_0xb727('0x18f')][_0xb727('0x14c')](db[_0xb727('0x66')],{});db[_0xb727('0x18f')]['belongsTo'](db['OpenchannelMessage'],{});db[_0xb727('0x18f')][_0xb727('0x14c')](db[_0xb727('0x10')],{});db[_0xb727('0x18f')][_0xb727('0x14c')](db[_0xb727('0x6a')],{});db[_0xb727('0x6e')][_0xb727('0x14c')](db[_0xb727('0x10')],{'as':_0xb727('0x190'),'foreignKey':_0xb727('0x11c'),'onDelete':_0xb727('0x15e')});db['ChatApplication'][_0xb727('0x14c')](db[_0xb727('0x76')],{'as':_0xb727('0x191'),'foreignKey':_0xb727('0x192'),'onDelete':_0xb727('0x15e')});db[_0xb727('0x6e')][_0xb727('0x14c')](db[_0xb727('0x6b')],{'as':_0xb727('0x193'),'foreignKey':_0xb727('0x174'),'onDelete':_0xb727('0x15e')});db[_0xb727('0x6e')][_0xb727('0x14c')](db[_0xb727('0x96')],{'onDelete':_0xb727('0x15e'),'foreignKey':_0xb727('0x176')});db[_0xb727('0x70')][_0xb727('0x11a')](db[_0xb727('0x72')],{'as':_0xb727('0x164'),'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x194')});db[_0xb727('0x70')][_0xb727('0x14c')](db[_0xb727('0x6b')],{'as':'Account','foreignKey':_0xb727('0x174')});db[_0xb727('0x70')][_0xb727('0x14c')](db[_0xb727('0x127')],{'as':_0xb727('0x15b'),'foreignKey':_0xb727('0x177')});db[_0xb727('0x70')][_0xb727('0x14c')](db[_0xb727('0x10')],{'as':_0xb727('0x16e'),'foreignKey':_0xb727('0x11c')});db['ChatInteraction'][_0xb727('0x125')](db[_0xb727('0x96')],{'through':_0xb727('0x195'),'as':_0xb727('0x17e')});db[_0xb727('0x70')][_0xb727('0x125')](db['Tag'],{'through':_0xb727('0x195'),'as':'ThroughTags'});db[_0xb727('0x70')][_0xb727('0x125')](db['User'],{'as':_0xb727('0x171'),'through':_0xb727('0x196'),'foreignKey':_0xb727('0x194')});db['ChatMessage'][_0xb727('0x14c')](db[_0xb727('0x10')],{'onDelete':'cascade','as':_0xb727('0x10')});db[_0xb727('0x72')][_0xb727('0x14c')](db['CmContact'],{'onDelete':_0xb727('0x118'),'as':_0xb727('0x15b'),'foreignKey':_0xb727('0x177')});db[_0xb727('0x72')][_0xb727('0x14c')](db[_0xb727('0x70')],{'onDelete':_0xb727('0x118'),'as':_0xb727('0x173'),'foreignKey':_0xb727('0x194')});db[_0xb727('0x72')][_0xb727('0x14c')](db['Attachment'],{'as':_0xb727('0xf5'),'foreignKey':_0xb727('0x180')});db[_0xb727('0x72')][_0xb727('0x14c')](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xb727('0x74')]['hasMany'](db[_0xb727('0xf5')],{'as':_0xb727('0x172'),'foreignKey':_0xb727('0x175'),'onDelete':_0xb727('0x118'),'hooks':!![]});db[_0xb727('0x74')][_0xb727('0x14c')](db[_0xb727('0x127')],{'onDelete':_0xb727('0x118'),'as':'Contact','foreignKey':_0xb727('0x177')});db['ChatOfflineMessage'][_0xb727('0x14c')](db[_0xb727('0x6b')],{'as':'Account','foreignKey':_0xb727('0x174')});db['ChatQueue'][_0xb727('0x125')](db[_0xb727('0x10')],{'as':_0xb727('0x16a'),'through':'UserChatQueue','hooks':!![]});db[_0xb727('0x76')][_0xb727('0x125')](db[_0xb727('0xef')],{'through':_0xb727('0x197'),'as':_0xb727('0x152')});db[_0xb727('0x78')][_0xb727('0x11a')](db[_0xb727('0xd9')],{'as':_0xb727('0x164'),'foreignKey':_0xb727('0x198'),'onDelete':_0xb727('0x118')});db[_0xb727('0x78')][_0xb727('0x125')](db[_0xb727('0x10')],{'as':_0xb727('0x146'),'through':_0xb727('0x126')});db['ChatProactiveAction'][_0xb727('0x14c')](db['ChatWebsite'],{'as':_0xb727('0x193'),'foreignKey':'ChatWebsiteId'});db[_0xb727('0x7a')][_0xb727('0x11a')](db['CmContact'],{'as':_0xb727('0x128'),'foreignKey':_0xb727('0x199')});db['CmContact'][_0xb727('0x11a')](db[_0xb727('0x19a')],{'as':_0xb727('0x19b'),'foreignKey':_0xb727('0x19c')});db[_0xb727('0x127')][_0xb727('0x11a')](db[_0xb727('0x7d')],{'as':_0xb727('0x148'),'foreignKey':'ContactId'});db[_0xb727('0x127')]['hasMany'](db[_0xb727('0x80')],{'as':'HopperFinals','foreignKey':_0xb727('0x177')});db['CmContact'][_0xb727('0x11a')](db[_0xb727('0x82')],{'as':'HopperHistories','foreignKey':_0xb727('0x177')});db[_0xb727('0x127')][_0xb727('0x11a')](db[_0xb727('0x84')],{'as':_0xb727('0x84'),'foreignKey':_0xb727('0x177')});db[_0xb727('0x127')][_0xb727('0x11a')](db[_0xb727('0xdf')],{'as':_0xb727('0x14b'),'foreignKey':'ContactId'});db[_0xb727('0x127')][_0xb727('0x11a')](db[_0xb727('0x66')],{'as':_0xb727('0x12c'),'foreignKey':_0xb727('0x177'),'onDelete':'restrict'});db[_0xb727('0x127')][_0xb727('0x11a')](db[_0xb727('0x70')],{'as':_0xb727('0x11f'),'foreignKey':_0xb727('0x177'),'onDelete':'restrict'});db['CmContact'][_0xb727('0x11a')](db[_0xb727('0x5c')],{'as':_0xb727('0x12a'),'foreignKey':'ContactId','onDelete':_0xb727('0x15e')});db[_0xb727('0x127')]['hasMany'](db[_0xb727('0x52')],{'as':_0xb727('0x120'),'foreignKey':_0xb727('0x177'),'onDelete':_0xb727('0x15e')});db[_0xb727('0x127')][_0xb727('0x11a')](db['MailInteraction'],{'as':_0xb727('0x121'),'foreignKey':_0xb727('0x177'),'onDelete':_0xb727('0x15e')});db[_0xb727('0x127')]['belongsTo'](db[_0xb727('0x7a')],{'as':_0xb727('0x19d'),'foreignKey':_0xb727('0x199')});db['CmContact'][_0xb727('0x14c')](db[_0xb727('0x100')],{'as':_0xb727('0x165'),'foreignKey':_0xb727('0x166'),'onDelete':_0xb727('0x118')});db[_0xb727('0x127')]['belongsToMany'](db[_0xb727('0x10')],{'as':_0xb727('0x171'),'through':_0xb727('0x19e')});db['CmContact'][_0xb727('0x125')](db[_0xb727('0x96')],{'as':_0xb727('0x17e'),'through':'cm_contact_has_tags'});db[_0xb727('0x127')][_0xb727('0x125')](db[_0xb727('0x96')],{'through':_0xb727('0x19f'),'as':_0xb727('0x170')});db[_0xb727('0x7d')][_0xb727('0x11a')](db[_0xb727('0x9a')],{'as':_0xb727('0x1a0'),'foreignKey':_0xb727('0x1a1')});db[_0xb727('0x7d')][_0xb727('0x14c')](db[_0xb727('0x127')],{'as':_0xb727('0x15b'),'foreignKey':_0xb727('0x177'),'onDelete':_0xb727('0x118')});db[_0xb727('0x7d')][_0xb727('0x14c')](db['CmList'],{'as':_0xb727('0x165'),'foreignKey':_0xb727('0x166'),'onDelete':_0xb727('0x118')});db[_0xb727('0x7d')]['belongsTo'](db['User'],{'as':_0xb727('0x190'),'foreignKey':'UserId'});db[_0xb727('0x7d')][_0xb727('0x14c')](db[_0xb727('0x1b')],{'as':_0xb727('0x191'),'foreignKey':'VoiceQueueId','onDelete':_0xb727('0x118')});db[_0xb727('0x7d')][_0xb727('0x14c')](db[_0xb727('0xf2')],{'as':_0xb727('0xf2'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0xb727('0x7d')][_0xb727('0x14c')](db[_0xb727('0x10')],{'as':_0xb727('0x16e'),'foreignKey':_0xb727('0x1a2')});db[_0xb727('0x149')][_0xb727('0x14c')](db[_0xb727('0x127')],{'as':_0xb727('0x15b'),'foreignKey':_0xb727('0x177'),'onDelete':'cascade'});db[_0xb727('0x149')]['belongsTo'](db[_0xb727('0x100')],{'as':'List','foreignKey':'ListId','onDelete':_0xb727('0x118')});db[_0xb727('0x149')][_0xb727('0x14c')](db[_0xb727('0x1b')],{'as':_0xb727('0x191'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db[_0xb727('0x149')][_0xb727('0x14c')](db[_0xb727('0xf2')],{'as':_0xb727('0xf2'),'foreignKey':'CampaignId','onDelete':'cascade'});db['Automation'][_0xb727('0x11a')](db[_0xb727('0x8c')],{'as':{'plural':'All','singular':'OneAll'},'foreignKey':_0xb727('0x1a3'),'onDelete':'cascade','hooks':!![]});db[_0xb727('0x1a4')][_0xb727('0x11a')](db[_0xb727('0x8c')],{'as':{'plural':_0xb727('0x1a5'),'singular':_0xb727('0x1a6')},'foreignKey':'AutomationAnyId','onDelete':_0xb727('0x118'),'hooks':!![]});db[_0xb727('0x1a4')][_0xb727('0x11a')](db['Action'],{'as':'Actions','foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db['Disposition']['hasMany'](db['Disposition'],{'as':_0xb727('0x161'),'foreignKey':_0xb727('0x1a7'),'onDelete':_0xb727('0x118')});db[_0xb727('0x8d')][_0xb727('0x11a')](db[_0xb727('0x8d')],{'as':'Intervals','foreignKey':_0xb727('0x150'),'onDelete':_0xb727('0x118'),'hooks':!![],'required':![]});db[_0xb727('0x8d')][_0xb727('0x11a')](db[_0xb727('0x17')],{'as':_0xb727('0x1a8'),'foreignKey':'IntervalId','onDelete':'restrict'});db[_0xb727('0x8d')]['hasMany'](db['MailApplication'],{'as':_0xb727('0x1a9'),'foreignKey':'IntervalId'});db['Interval'][_0xb727('0x11a')](db['ChatApplication'],{'as':_0xb727('0x1aa'),'foreignKey':_0xb727('0x150')});db[_0xb727('0x8d')][_0xb727('0x11a')](db[_0xb727('0x50')],{'as':_0xb727('0x1ab'),'foreignKey':_0xb727('0x150')});db[_0xb727('0x8d')][_0xb727('0x11a')](db[_0xb727('0x5a')],{'as':_0xb727('0x1ac'),'foreignKey':_0xb727('0x150')});db['Schedule'][_0xb727('0x14c')](db[_0xb727('0x3f')],{});db[_0xb727('0x1ad')][_0xb727('0x14c')](db[_0xb727('0x1ae')],{'foreignKey':'DefaultReportId'});db['Schedule'][_0xb727('0x14c')](db[_0xb727('0x1af')],{'foreignKey':_0xb727('0x1b0')});db[_0xb727('0x94')][_0xb727('0x125')](db[_0xb727('0x19')],{'as':'Mohs','through':_0xb727('0x145'),'onDelete':_0xb727('0x15e')});db[_0xb727('0x96')][_0xb727('0x125')](db[_0xb727('0x127')],{'through':_0xb727('0x19f')});db[_0xb727('0x96')]['belongsToMany'](db[_0xb727('0x70')],{'through':_0xb727('0x195')});db[_0xb727('0x96')][_0xb727('0x125')](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db[_0xb727('0x96')]['belongsToMany'](db[_0xb727('0x5c')],{'through':_0xb727('0x185')});db[_0xb727('0x96')][_0xb727('0x125')](db['FaxInteraction'],{'through':_0xb727('0x17d')});db[_0xb727('0x96')][_0xb727('0x125')](db[_0xb727('0x66')],{'through':'openchannel_interaction_has_tags'});db[_0xb727('0x96')][_0xb727('0x125')](db['WhatsappInteraction'],{'through':_0xb727('0x1b1')});db['CmContactHasItem'][_0xb727('0x14c')](db[_0xb727('0x97')],{'as':_0xb727('0x1b2'),'foreignKey':_0xb727('0x1b3')});db[_0xb727('0x9a')][_0xb727('0x14c')](db['CmHopper'],{'as':_0xb727('0x1b4'),'foreignKey':_0xb727('0x1a1')});db[_0xb727('0x19a')]['belongsTo'](db['CmContact'],{'as':_0xb727('0x15b'),'foreignKey':'CmContactId'});db['Trigger'][_0xb727('0x11a')](db[_0xb727('0x8c')],{'as':{'plural':_0xb727('0x1b5'),'singular':_0xb727('0x1b6')},'foreignKey':_0xb727('0x1b7'),'onDelete':_0xb727('0x118'),'hooks':!![]});db['Trigger'][_0xb727('0x11a')](db['Condition'],{'as':{'plural':'AnyConditions','singular':_0xb727('0x1b8')},'foreignKey':_0xb727('0x1b9'),'onDelete':_0xb727('0x118'),'hooks':!![]});db[_0xb727('0x9d')][_0xb727('0x11a')](db[_0xb727('0x87')],{'as':_0xb727('0x1ba'),'foreignKey':'TriggerId','onDelete':_0xb727('0x118'),'hooks':!![]});db[_0xb727('0x1af')][_0xb727('0x11a')](db[_0xb727('0x1bb')],{'as':_0xb727('0x1bc'),'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x1b0'),'hooks':!![]});db[_0xb727('0x1ae')][_0xb727('0x11a')](db[_0xb727('0x1bb')],{'as':'Fields','onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x1bd')});db[_0xb727('0xa6')][_0xb727('0x11a')](db['AnalyticFieldReport'],{'as':_0xb727('0x1bc'),'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x1be')});db[_0xb727('0x1bb')]['belongsTo'](db[_0xb727('0xa6')],{'foreignKey':_0xb727('0x1be')});db[_0xb727('0x1bf')][_0xb727('0x11a')](db[_0xb727('0xa9')],{'as':_0xb727('0x1c0'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xb727('0xa9')][_0xb727('0x11a')](db['SalesforceField'],{'as':_0xb727('0x1c1'),'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x1c2')});db['SalesforceConfiguration'][_0xb727('0x11a')](db[_0xb727('0x1c3')],{'as':_0xb727('0x1c4'),'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x1c5')});db[_0xb727('0xa9')][_0xb727('0x11a')](db[_0xb727('0x1c3')],{'as':_0xb727('0x1bc'),'onDelete':_0xb727('0x118'),'foreignKey':'FieldId'});db['SalesforceConfiguration']['belongsTo'](db['SalesforceAccount'],{'as':_0xb727('0x16d'),'foreignKey':_0xb727('0x1c6')});db[_0xb727('0x1c3')][_0xb727('0x11a')](db[_0xb727('0x1c3')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xb727('0x1c3')]['hasMany'](db[_0xb727('0x1c3')],{'as':_0xb727('0x1c7'),'foreignKey':'DescriptionId'});db[_0xb727('0x1c3')][_0xb727('0x11a')](db[_0xb727('0x1c3')],{'as':_0xb727('0x1c8'),'foreignKey':'FieldId'});db[_0xb727('0x1c3')][_0xb727('0x14c')](db[_0xb727('0x9f')],{'as':_0xb727('0x9f'),'foreignKey':_0xb727('0x1c9')});db[_0xb727('0xab')][_0xb727('0x11a')](db[_0xb727('0x1ca')],{'as':'Configurations','onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x1c6')});db[_0xb727('0x1ca')][_0xb727('0x11a')](db['SugarcrmField'],{'as':'Subjects','onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x1c2')});db[_0xb727('0x1ca')][_0xb727('0x11a')](db[_0xb727('0x1cb')],{'as':_0xb727('0x1c4'),'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x1c5')});db['SugarcrmConfiguration'][_0xb727('0x11a')](db['SugarcrmField'],{'as':_0xb727('0x1bc'),'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x1cc')});db['SugarcrmConfiguration']['belongsTo'](db[_0xb727('0xab')],{'as':_0xb727('0x16d'),'foreignKey':'AccountId'});db[_0xb727('0x1cb')]['hasMany'](db[_0xb727('0x1cb')],{'as':_0xb727('0x1cd'),'foreignKey':_0xb727('0x1c2')});db[_0xb727('0x1cb')][_0xb727('0x11a')](db[_0xb727('0x1cb')],{'as':_0xb727('0x1c7'),'foreignKey':'DescriptionId'});db[_0xb727('0x1cb')][_0xb727('0x11a')](db[_0xb727('0x1cb')],{'as':_0xb727('0x1c8'),'foreignKey':_0xb727('0x1cc')});db[_0xb727('0x1cb')]['belongsTo'](db[_0xb727('0x9f')],{'as':'Variable','foreignKey':_0xb727('0x1c9')});db[_0xb727('0xae')][_0xb727('0x11a')](db[_0xb727('0xb0')],{'as':_0xb727('0x1c0'),'onDelete':'cascade','foreignKey':_0xb727('0x1c6')});db[_0xb727('0xb0')]['hasMany'](db[_0xb727('0xb2')],{'as':_0xb727('0x1c1'),'onDelete':'cascade','foreignKey':_0xb727('0x1c2')});db[_0xb727('0xb0')][_0xb727('0x11a')](db[_0xb727('0xb2')],{'as':'Descriptions','onDelete':_0xb727('0x118'),'foreignKey':'DescriptionId'});db['DeskConfiguration']['hasMany'](db[_0xb727('0xb2')],{'as':'Fields','onDelete':'cascade','foreignKey':'FieldId'});db['DeskConfiguration'][_0xb727('0x14c')](db[_0xb727('0xae')],{'as':_0xb727('0x16d'),'foreignKey':_0xb727('0x1c6')});db['DeskConfiguration']['belongsToMany'](db[_0xb727('0x96')],{'through':'int_desk_configuration_has_tags'});db[_0xb727('0xb2')][_0xb727('0x11a')](db[_0xb727('0xb2')],{'as':_0xb727('0x1cd'),'foreignKey':'SubjectId'});db[_0xb727('0xb2')][_0xb727('0x11a')](db['DeskField'],{'as':'Description','foreignKey':_0xb727('0x1c5')});db[_0xb727('0xb2')][_0xb727('0x11a')](db['DeskField'],{'as':_0xb727('0x1c8'),'foreignKey':_0xb727('0x1cc')});db[_0xb727('0xb2')]['belongsTo'](db[_0xb727('0x9f')],{'as':_0xb727('0x9f'),'foreignKey':_0xb727('0x1c9')});db[_0xb727('0xb4')][_0xb727('0x11a')](db['ZohoConfiguration'],{'as':_0xb727('0x1c0'),'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x1c6')});db['ZohoConfiguration']['hasMany'](db['ZohoField'],{'as':_0xb727('0x1c1'),'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x1c2')});db['ZohoConfiguration'][_0xb727('0x11a')](db['ZohoField'],{'as':'Descriptions','onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x1c5')});db['ZohoConfiguration'][_0xb727('0x11a')](db['ZohoField'],{'as':_0xb727('0x1bc'),'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x1cc')});db[_0xb727('0xb5')][_0xb727('0x14c')](db[_0xb727('0xb4')],{'as':'Account','foreignKey':_0xb727('0x1c6')});db[_0xb727('0x1ce')][_0xb727('0x11a')](db['ZohoField'],{'as':_0xb727('0x1cd'),'foreignKey':_0xb727('0x1c2')});db[_0xb727('0x1ce')]['hasMany'](db[_0xb727('0x1ce')],{'as':_0xb727('0x1c7'),'foreignKey':'DescriptionId'});db[_0xb727('0x1ce')][_0xb727('0x11a')](db[_0xb727('0x1ce')],{'as':_0xb727('0x1c8'),'foreignKey':'FieldId'});db[_0xb727('0x1ce')][_0xb727('0x14c')](db[_0xb727('0x9f')],{'as':_0xb727('0x9f'),'foreignKey':_0xb727('0x1c9')});db[_0xb727('0x1cf')][_0xb727('0x11a')](db[_0xb727('0xb9')],{'as':_0xb727('0x1c0'),'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x1c6')});db[_0xb727('0xb9')]['hasMany'](db[_0xb727('0xbb')],{'as':_0xb727('0x1c1'),'foreignKey':'SubjectId'});db[_0xb727('0xb9')][_0xb727('0x11a')](db[_0xb727('0xbb')],{'as':_0xb727('0x1c4'),'foreignKey':_0xb727('0x1c5')});db[_0xb727('0xb9')][_0xb727('0x11a')](db[_0xb727('0xbb')],{'as':_0xb727('0x1bc'),'foreignKey':_0xb727('0x1cc')});db['ZendeskConfiguration']['belongsTo'](db['ZendeskAccount'],{'as':'Account','foreignKey':_0xb727('0x1c6')});db[_0xb727('0xb9')][_0xb727('0x125')](db[_0xb727('0x96')],{'through':_0xb727('0x1d0')});db[_0xb727('0xbb')][_0xb727('0x11a')](db[_0xb727('0xbb')],{'as':_0xb727('0x1cd'),'foreignKey':_0xb727('0x1c2')});db['ZendeskField'][_0xb727('0x11a')](db[_0xb727('0xbb')],{'as':_0xb727('0x1c7'),'foreignKey':'DescriptionId'});db[_0xb727('0xbb')][_0xb727('0x11a')](db[_0xb727('0xbb')],{'as':'Field','foreignKey':_0xb727('0x1cc')});db[_0xb727('0xbb')]['belongsTo'](db['Variable'],{'as':_0xb727('0x9f'),'foreignKey':'VariableId'});db[_0xb727('0xbd')][_0xb727('0x11a')](db[_0xb727('0xbf')],{'as':_0xb727('0x1c0'),'onDelete':'cascade','foreignKey':_0xb727('0x1c6')});db['FreshdeskConfiguration']['hasMany'](db[_0xb727('0xc0')],{'as':_0xb727('0x1c1'),'onDelete':_0xb727('0x118'),'foreignKey':'SubjectId'});db[_0xb727('0xbf')]['hasMany'](db[_0xb727('0xc0')],{'as':_0xb727('0x1c4'),'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x1c5')});db[_0xb727('0xbf')][_0xb727('0x11a')](db[_0xb727('0xc0')],{'as':_0xb727('0x1bc'),'onDelete':'cascade','foreignKey':_0xb727('0x1cc')});db[_0xb727('0xbf')][_0xb727('0x14c')](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0xb727('0x1c6')});db[_0xb727('0xbf')][_0xb727('0x125')](db['Tag'],{'through':_0xb727('0x1d1')});db['FreshdeskField'][_0xb727('0x11a')](db[_0xb727('0xc0')],{'as':_0xb727('0x1cd'),'foreignKey':'SubjectId'});db[_0xb727('0xc0')][_0xb727('0x11a')](db[_0xb727('0xc0')],{'as':_0xb727('0x1c7'),'foreignKey':'DescriptionId'});db[_0xb727('0xc0')]['hasMany'](db[_0xb727('0xc0')],{'as':_0xb727('0x1c8'),'foreignKey':'FieldId'});db[_0xb727('0xc0')]['belongsTo'](db[_0xb727('0x9f')],{'as':_0xb727('0x9f'),'foreignKey':_0xb727('0x1c9')});db[_0xb727('0xc2')][_0xb727('0x11a')](db['VtigerConfiguration'],{'as':_0xb727('0x1c0'),'onDelete':'cascade','foreignKey':_0xb727('0x1c6')});db[_0xb727('0x1d2')][_0xb727('0x11a')](db[_0xb727('0xc5')],{'as':'Subjects','foreignKey':_0xb727('0x1c2')});db['VtigerConfiguration'][_0xb727('0x11a')](db[_0xb727('0xc5')],{'as':'Descriptions','foreignKey':_0xb727('0x1c5')});db[_0xb727('0x1d2')][_0xb727('0x11a')](db['VtigerField'],{'as':_0xb727('0x1bc'),'foreignKey':_0xb727('0x1cc')});db['VtigerConfiguration'][_0xb727('0x14c')](db[_0xb727('0xc2')],{'as':_0xb727('0x16d'),'foreignKey':_0xb727('0x1c6')});db[_0xb727('0xc5')][_0xb727('0x11a')](db[_0xb727('0xc5')],{'as':'Subject','foreignKey':_0xb727('0x1c2')});db['VtigerField'][_0xb727('0x11a')](db['VtigerField'],{'as':_0xb727('0x1c7'),'foreignKey':_0xb727('0x1c5')});db[_0xb727('0xc5')]['hasMany'](db[_0xb727('0xc5')],{'as':_0xb727('0x1c8'),'foreignKey':_0xb727('0x1cc')});db[_0xb727('0xc5')][_0xb727('0x14c')](db[_0xb727('0x9f')],{'as':_0xb727('0x9f'),'foreignKey':_0xb727('0x1c9')});db['ServicenowAccount']['hasMany'](db[_0xb727('0x1d3')],{'as':_0xb727('0x1c0'),'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x1c6')});db[_0xb727('0x1d3')][_0xb727('0x11a')](db[_0xb727('0x1d4')],{'as':_0xb727('0x1c1'),'foreignKey':_0xb727('0x1c2')});db[_0xb727('0x1d3')][_0xb727('0x11a')](db['ServicenowField'],{'as':_0xb727('0x1c4'),'foreignKey':_0xb727('0x1c5')});db[_0xb727('0x1d3')][_0xb727('0x11a')](db[_0xb727('0x1d4')],{'as':_0xb727('0x1bc'),'foreignKey':_0xb727('0x1cc')});db['ServicenowConfiguration'][_0xb727('0x14c')](db['ServicenowAccount'],{'as':_0xb727('0x16d'),'foreignKey':_0xb727('0x1c6')});db[_0xb727('0x1d4')][_0xb727('0x11a')](db['ServicenowField'],{'as':'Subject','foreignKey':_0xb727('0x1c2')});db['ServicenowField'][_0xb727('0x11a')](db[_0xb727('0x1d4')],{'as':_0xb727('0x1c7'),'foreignKey':_0xb727('0x1c5')});db[_0xb727('0x1d4')]['hasMany'](db[_0xb727('0x1d4')],{'as':'Field','foreignKey':_0xb727('0x1cc')});db['ServicenowField'][_0xb727('0x14c')](db[_0xb727('0x9f')],{'as':_0xb727('0x9f'),'foreignKey':'VariableId'});db[_0xb727('0xcb')][_0xb727('0x11a')](db[_0xb727('0xcd')],{'as':_0xb727('0x1c0'),'onDelete':_0xb727('0x118'),'foreignKey':'AccountId'});db[_0xb727('0xcb')][_0xb727('0x14c')](db[_0xb727('0x10f')],{'as':_0xb727('0x10f'),'foreignKey':_0xb727('0x15d')});db[_0xb727('0xcd')]['hasMany'](db[_0xb727('0xcf')],{'as':_0xb727('0x1c1'),'onDelete':'cascade','foreignKey':_0xb727('0x1c2')});db[_0xb727('0xcd')][_0xb727('0x11a')](db[_0xb727('0xcf')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xb727('0x1c5')});db[_0xb727('0xcd')][_0xb727('0x11a')](db[_0xb727('0xcf')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xb727('0x1cc')});db['Dynamics365Configuration'][_0xb727('0x14c')](db[_0xb727('0xcb')],{'as':'Account','foreignKey':'AccountId'});db['Dynamics365Field'][_0xb727('0x11a')](db[_0xb727('0xcf')],{'as':_0xb727('0x1cd'),'foreignKey':'SubjectId'});db[_0xb727('0xcf')]['hasMany'](db[_0xb727('0xcf')],{'as':'Description','foreignKey':'DescriptionId'});db[_0xb727('0xcf')]['hasMany'](db[_0xb727('0xcf')],{'as':'Field','foreignKey':_0xb727('0x1cc')});db[_0xb727('0xcf')][_0xb727('0x14c')](db[_0xb727('0x9f')],{'as':_0xb727('0x9f'),'foreignKey':_0xb727('0x1c9')});db[_0xb727('0x1d5')][_0xb727('0x11a')](db['FreshsalesConfiguration'],{'as':_0xb727('0x1c0'),'onDelete':_0xb727('0x118'),'foreignKey':'AccountId'});db['FreshsalesConfiguration'][_0xb727('0x11a')](db[_0xb727('0xd3')],{'as':_0xb727('0x1c1'),'foreignKey':'SubjectId'});db[_0xb727('0xd1')][_0xb727('0x11a')](db[_0xb727('0xd3')],{'as':'Descriptions','foreignKey':_0xb727('0x1c5')});db[_0xb727('0xd1')][_0xb727('0x11a')](db[_0xb727('0xd3')],{'as':'Fields','foreignKey':_0xb727('0x1cc')});db['FreshsalesConfiguration'][_0xb727('0x14c')](db['FreshsalesAccount'],{'as':_0xb727('0x16d'),'foreignKey':'AccountId'});db[_0xb727('0xd3')][_0xb727('0x11a')](db[_0xb727('0xd3')],{'as':'Subject','foreignKey':_0xb727('0x1c2')});db[_0xb727('0xd3')][_0xb727('0x11a')](db[_0xb727('0xd3')],{'as':_0xb727('0x1c7'),'foreignKey':_0xb727('0x1c5')});db[_0xb727('0xd3')][_0xb727('0x11a')](db[_0xb727('0xd3')],{'as':'Field','foreignKey':'FieldId'});db[_0xb727('0xd3')][_0xb727('0x14c')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0xb727('0xd7')][_0xb727('0x14c')](db[_0xb727('0x6b')],{});db[_0xb727('0xd7')][_0xb727('0x14c')](db[_0xb727('0x100')],{'as':'List','foreignKey':_0xb727('0x166')});db[_0xb727('0xd7')][_0xb727('0x14c')](db[_0xb727('0x127')],{'as':'Contact','foreignKey':_0xb727('0x177')});db['ChatQueueReport'][_0xb727('0x14c')](db[_0xb727('0x70')],{});db['ChatQueueReport'][_0xb727('0x14c')](db['ChatMessage'],{});db[_0xb727('0xd7')][_0xb727('0x14c')](db[_0xb727('0x10')],{});db[_0xb727('0xd7')][_0xb727('0x14c')](db[_0xb727('0x76')],{});db[_0xb727('0xd9')]['belongsTo'](db['User'],{'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x1d6')});db[_0xb727('0xd9')]['belongsTo'](db[_0xb727('0x10')],{'onDelete':_0xb727('0x118'),'foreignKey':'ToId'});db[_0xb727('0xdf')][_0xb727('0x11a')](db['JscriptyQuestionReport'],{'foreignKey':'SessionId','onDelete':_0xb727('0x118')});db[_0xb727('0xdf')][_0xb727('0x11a')](db['JscriptyAnswerReport'],{'foreignKey':_0xb727('0x1d7'),'onDelete':_0xb727('0x118')});db[_0xb727('0xe1')]['belongsTo'](db['SmsAccount'],{});db[_0xb727('0xe1')]['belongsTo'](db[_0xb727('0x100')],{'as':_0xb727('0x165'),'foreignKey':_0xb727('0x166')});db[_0xb727('0xe1')][_0xb727('0x14c')](db[_0xb727('0x127')],{'as':_0xb727('0x15b'),'foreignKey':_0xb727('0x177')});db[_0xb727('0xe1')][_0xb727('0x14c')](db['SmsInteraction'],{});db[_0xb727('0xe1')][_0xb727('0x14c')](db[_0xb727('0x5e')],{});db['SmsQueueReport'][_0xb727('0x14c')](db[_0xb727('0x10')],{});db[_0xb727('0xe1')][_0xb727('0x14c')](db[_0xb727('0x60')],{});db[_0xb727('0x1d8')][_0xb727('0x11a')](db['JscriptySessionReport'],{'foreignKey':_0xb727('0x1d9')});db[_0xb727('0x1d8')][_0xb727('0x11a')](db['JscriptyQuestionReport'],{'foreignKey':'ProjectId'});db[_0xb727('0x1d8')][_0xb727('0x11a')](db[_0xb727('0xdb')],{'foreignKey':_0xb727('0x1d9')});db[_0xb727('0xef')][_0xb727('0x125')](db[_0xb727('0x10')],{'as':'Agents','through':_0xb727('0x1da')});db[_0xb727('0xef')][_0xb727('0x125')](db['VoiceQueue'],{'through':_0xb727('0x110'),'as':_0xb727('0x130')});db['Team'][_0xb727('0x125')](db[_0xb727('0x131')],{'through':_0xb727('0x16b'),'as':_0xb727('0x132')});db['Team']['belongsToMany'](db[_0xb727('0x76')],{'through':_0xb727('0x197'),'as':_0xb727('0x133')});db[_0xb727('0xef')][_0xb727('0x125')](db[_0xb727('0x56')],{'through':_0xb727('0x181'),'as':_0xb727('0x135')});db['Team'][_0xb727('0x125')](db['SmsQueue'],{'through':_0xb727('0x187'),'as':_0xb727('0x1db')});db['Team'][_0xb727('0x125')](db[_0xb727('0x6a')],{'through':_0xb727('0x18c'),'as':'OpenchannelQueues'});db[_0xb727('0xef')][_0xb727('0x125')](db[_0xb727('0x137')],{'through':_0xb727('0x1dc'),'as':_0xb727('0x1dd')});db[_0xb727('0xef')][_0xb727('0x125')](db[_0xb727('0x101')],{'through':_0xb727('0x112'),'as':'VoicePrefixes'});db[_0xb727('0xf2')]['hasMany'](db[_0xb727('0x7d')],{'as':_0xb727('0x148'),'foreignKey':_0xb727('0x1de')});db['Campaign'][_0xb727('0x11a')](db[_0xb727('0x80')],{'as':'HopperFinals','foreignKey':_0xb727('0x1de')});db['Campaign']['hasMany'](db[_0xb727('0x82')],{'as':_0xb727('0x1df'),'foreignKey':_0xb727('0x1de')});db['Campaign'][_0xb727('0x11a')](db[_0xb727('0x149')],{'as':_0xb727('0x14a'),'foreignKey':_0xb727('0x1de')});db[_0xb727('0xf2')][_0xb727('0x14c')](db[_0xb727('0x2c')],{'as':'Trunk','foreignKey':_0xb727('0x14d')});db[_0xb727('0xf2')]['belongsTo'](db[_0xb727('0x2c')],{'as':_0xb727('0x14e'),'foreignKey':_0xb727('0x14f')});db[_0xb727('0xf2')]['belongsTo'](db[_0xb727('0x8d')],{'as':'Interval','foreignKey':_0xb727('0x150')});db['Campaign'][_0xb727('0x14c')](db[_0xb727('0xeb')],{'as':_0xb727('0xeb'),'foreignKey':_0xb727('0x1e0')});db[_0xb727('0xf2')][_0xb727('0x125')](db['CmList'],{'as':_0xb727('0x151'),'through':_0xb727('0x1e1')});db[_0xb727('0xf2')][_0xb727('0x125')](db[_0xb727('0x100')],{'as':_0xb727('0x153'),'through':_0xb727('0x1e2')});db[_0xb727('0xf5')][_0xb727('0x14c')](db['ChatOfflineMessage'],{'as':_0xb727('0x74'),'foreignKey':'ChatOfflineMessageId'});db['MailTransferReport'][_0xb727('0x14c')](db[_0xb727('0x163')],{});db[_0xb727('0xf9')][_0xb727('0x14c')](db[_0xb727('0x44')],{});db['MailTransferReport']['belongsTo'](db[_0xb727('0x3f')],{'foreignKey':_0xb727('0x1e3'),'as':_0xb727('0x1e4')});db[_0xb727('0xf9')][_0xb727('0x14c')](db[_0xb727('0x10')],{'foreignKey':_0xb727('0x1e5'),'as':'FromAgent'});db[_0xb727('0xf9')][_0xb727('0x14c')](db[_0xb727('0x10')],{'foreignKey':'ToUserId','as':_0xb727('0x1e6')});db[_0xb727('0xf9')][_0xb727('0x14c')](db[_0xb727('0x131')],{'foreignKey':_0xb727('0x1e7'),'as':_0xb727('0x1e8')});db[_0xb727('0xf9')]['belongsTo'](db[_0xb727('0x3f')],{'foreignKey':_0xb727('0x1e9'),'as':_0xb727('0x1ea')});db['ChatTransferReport'][_0xb727('0x14c')](db[_0xb727('0x72')],{});db[_0xb727('0xfb')][_0xb727('0x14c')](db[_0xb727('0x70')],{});db[_0xb727('0xfb')]['belongsTo'](db[_0xb727('0x6b')],{'foreignKey':_0xb727('0x1eb'),'as':_0xb727('0x1e4')});db[_0xb727('0xfb')][_0xb727('0x14c')](db[_0xb727('0x10')],{'foreignKey':'FromUserId','as':_0xb727('0x1ec')});db['ChatTransferReport'][_0xb727('0x14c')](db[_0xb727('0x10')],{'foreignKey':_0xb727('0x1ed'),'as':_0xb727('0x1e6')});db['ChatTransferReport']['belongsTo'](db[_0xb727('0x76')],{'foreignKey':_0xb727('0x1ee'),'as':_0xb727('0x1e8')});db['ChatTransferReport'][_0xb727('0x14c')](db['ChatWebsite'],{'foreignKey':_0xb727('0x1ef'),'as':_0xb727('0x1ea')});db[_0xb727('0x1f0')][_0xb727('0x14c')](db['FaxMessage'],{});db[_0xb727('0x1f0')][_0xb727('0x14c')](db['FaxInteraction'],{});db['FaxTransferReport']['belongsTo'](db[_0xb727('0x4e')],{'foreignKey':_0xb727('0x1f1'),'as':_0xb727('0x1e4')});db['FaxTransferReport'][_0xb727('0x14c')](db[_0xb727('0x10')],{'foreignKey':_0xb727('0x1e5'),'as':_0xb727('0x1ec')});db[_0xb727('0x1f0')][_0xb727('0x14c')](db[_0xb727('0x10')],{'foreignKey':_0xb727('0x1ed'),'as':_0xb727('0x1e6')});db[_0xb727('0x1f0')][_0xb727('0x14c')](db[_0xb727('0x56')],{'foreignKey':_0xb727('0x1f2'),'as':'ToQueue'});db['FaxTransferReport'][_0xb727('0x14c')](db[_0xb727('0x4e')],{'foreignKey':_0xb727('0x1f3'),'as':_0xb727('0x1ea')});db[_0xb727('0xfe')][_0xb727('0x14c')](db[_0xb727('0x68')],{});db[_0xb727('0xfe')][_0xb727('0x14c')](db['OpenchannelInteraction'],{});db[_0xb727('0xfe')][_0xb727('0x14c')](db[_0xb727('0x62')],{'foreignKey':_0xb727('0x1f4'),'as':_0xb727('0x1e4')});db[_0xb727('0xfe')][_0xb727('0x14c')](db['User'],{'foreignKey':_0xb727('0x1e5'),'as':'FromAgent'});db[_0xb727('0xfe')][_0xb727('0x14c')](db['User'],{'foreignKey':'ToUserId','as':_0xb727('0x1e6')});db[_0xb727('0xfe')][_0xb727('0x14c')](db[_0xb727('0x6a')],{'foreignKey':_0xb727('0x1f5'),'as':_0xb727('0x1e8')});db[_0xb727('0xfe')][_0xb727('0x14c')](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':_0xb727('0x1ea')});db[_0xb727('0x1f6')]['belongsTo'](db[_0xb727('0x5e')],{});db[_0xb727('0x1f6')]['belongsTo'](db[_0xb727('0x5c')],{});db[_0xb727('0x1f6')][_0xb727('0x14c')](db[_0xb727('0x59')],{'foreignKey':'FromSmsAccountId','as':_0xb727('0x1e4')});db[_0xb727('0x1f6')][_0xb727('0x14c')](db[_0xb727('0x10')],{'foreignKey':_0xb727('0x1e5'),'as':_0xb727('0x1ec')});db[_0xb727('0x1f6')]['belongsTo'](db[_0xb727('0x10')],{'foreignKey':_0xb727('0x1ed'),'as':'ToAgent'});db['SmsTransferReport']['belongsTo'](db[_0xb727('0x60')],{'foreignKey':_0xb727('0x1f7'),'as':_0xb727('0x1e8')});db['SmsTransferReport'][_0xb727('0x14c')](db['SmsAccount'],{'foreignKey':_0xb727('0x1f8'),'as':_0xb727('0x1ea')});db[_0xb727('0x100')][_0xb727('0x11a')](db[_0xb727('0x8a')],{'as':_0xb727('0x161'),'foreignKey':_0xb727('0x166'),'onDelete':'cascade'});db['CmList'][_0xb727('0x11a')](db[_0xb727('0x1f9')],{'as':_0xb727('0x1fa'),'foreignKey':_0xb727('0x166')});db['CmList'][_0xb727('0x11a')](db[_0xb727('0x127')],{'as':_0xb727('0x128'),'onDelete':'cascade','foreignKey':'ListId'});db['CmList'][_0xb727('0x11a')](db[_0xb727('0x80')],{'as':_0xb727('0x11d'),'foreignKey':'ListId'});db['CmList'][_0xb727('0x11a')](db['CmHopperHistory'],{'as':_0xb727('0x11e'),'foreignKey':_0xb727('0x166')});db['CmList']['hasMany'](db['ReportAgentPreview'],{'as':_0xb727('0x84'),'foreignKey':'ListId'});db['CmList'][_0xb727('0x125')](db[_0xb727('0x1b')],{'as':_0xb727('0x1fb'),'through':'voice_queues_has_cm_lists'});db['CmList'][_0xb727('0x125')](db['User'],{'as':_0xb727('0x16a'),'through':_0xb727('0x1fc')});db[_0xb727('0x101')][_0xb727('0x11a')](db['VoiceExtension'],{'as':_0xb727('0x1a8'),'onDelete':_0xb727('0x118')});db[_0xb727('0x101')][_0xb727('0x125')](db[_0xb727('0x10')],{'as':_0xb727('0x16a'),'through':'UserVoicePrefix'});db[_0xb727('0x101')][_0xb727('0x125')](db[_0xb727('0xef')],{'through':_0xb727('0x112'),'as':'Teams'});db[_0xb727('0x123')][_0xb727('0x11a')](db['User'],{'as':_0xb727('0x171'),'foreignKey':_0xb727('0x124')});db[_0xb727('0x123')][_0xb727('0x11a')](db[_0xb727('0x1fd')],{'as':'UserProfileSections','foreignKey':_0xb727('0x124'),'onDelete':_0xb727('0x118')});db['UserProfileSection'][_0xb727('0x11a')](db['UserProfileResource'],{'as':'Resources','foreignKey':_0xb727('0x1fe'),'onDelete':'cascade'});db[_0xb727('0x1ff')][_0xb727('0x11a')](db['Disposition'],{'as':_0xb727('0x161'),'foreignKey':'WhatsappAccountId','onDelete':'cascade'});db[_0xb727('0x1ff')][_0xb727('0x11a')](db[_0xb727('0x88')],{'as':_0xb727('0x162'),'foreignKey':_0xb727('0x200')});db[_0xb727('0x1ff')][_0xb727('0x11a')](db[_0xb727('0x10b')],{'as':'Messages','foreignKey':_0xb727('0x200')});db[_0xb727('0x1ff')][_0xb727('0x11a')](db[_0xb727('0x109')],{'as':'Interactions'});db[_0xb727('0x1ff')][_0xb727('0x11a')](db[_0xb727('0x107')],{'as':_0xb727('0x143')});db[_0xb727('0x1ff')][_0xb727('0x14c')](db[_0xb727('0x100')],{'as':_0xb727('0x165'),'foreignKey':'ListId'});db[_0xb727('0x1ff')][_0xb727('0x14c')](db[_0xb727('0x8f')],{'as':'mandatoryDispositionPause','foreignKey':_0xb727('0x169')});db[_0xb727('0x1ff')][_0xb727('0x125')](db['User'],{'as':_0xb727('0x16a'),'through':_0xb727('0x140')});db['WhatsappApplication'][_0xb727('0x14c')](db[_0xb727('0x10')],{'onDelete':_0xb727('0x15e')});db['WhatsappApplication'][_0xb727('0x14c')](db['WhatsappQueue'],{'onDelete':_0xb727('0x15e')});db[_0xb727('0x107')][_0xb727('0x14c')](db[_0xb727('0x1ff')],{'onDelete':'restrict'});db['WhatsappApplication'][_0xb727('0x14c')](db[_0xb727('0x8d')],{'onDelete':'restrict','foreignKey':_0xb727('0x150')});db[_0xb727('0x107')]['belongsTo'](db[_0xb727('0x96')],{'onDelete':_0xb727('0x15e'),'foreignKey':_0xb727('0x176')});db[_0xb727('0x109')][_0xb727('0x11a')](db[_0xb727('0x10b')],{'as':_0xb727('0x164'),'onDelete':_0xb727('0x118'),'foreignKey':_0xb727('0x201')});db[_0xb727('0x109')][_0xb727('0x14c')](db['WhatsappAccount'],{'as':'Account','foreignKey':_0xb727('0x200')});db['WhatsappInteraction']['belongsTo'](db[_0xb727('0x127')],{'as':_0xb727('0x15b'),'foreignKey':'ContactId'});db[_0xb727('0x109')][_0xb727('0x14c')](db['User'],{'as':_0xb727('0x16e'),'foreignKey':_0xb727('0x11c')});db['WhatsappInteraction'][_0xb727('0x125')](db[_0xb727('0x96')],{'through':_0xb727('0x1b1'),'as':_0xb727('0x17e')});db[_0xb727('0x109')][_0xb727('0x125')](db[_0xb727('0x96')],{'through':_0xb727('0x1b1'),'as':_0xb727('0x170')});db['WhatsappInteraction'][_0xb727('0x125')](db[_0xb727('0x10')],{'as':_0xb727('0x171'),'through':_0xb727('0x12f'),'foreignKey':_0xb727('0x201')});db[_0xb727('0x10b')][_0xb727('0x14c')](db[_0xb727('0x10')],{'as':'User'});db[_0xb727('0x10b')][_0xb727('0x14c')](db[_0xb727('0x127')],{'onDelete':'cascade','as':'Contact'});db['WhatsappMessage']['belongsTo'](db[_0xb727('0x109')],{'onDelete':_0xb727('0x118'),'as':_0xb727('0x173'),'foreignKey':'WhatsappInteractionId'});db[_0xb727('0x10b')][_0xb727('0x14c')](db[_0xb727('0x1ff')],{'as':_0xb727('0x16d'),'foreignKey':_0xb727('0x200')});db[_0xb727('0x202')][_0xb727('0x14c')](db[_0xb727('0x1ff')],{});db[_0xb727('0x202')]['belongsTo'](db[_0xb727('0x100')],{'as':'List','foreignKey':_0xb727('0x166')});db[_0xb727('0x202')]['belongsTo'](db[_0xb727('0x127')],{'as':'Contact','foreignKey':_0xb727('0x177')});db[_0xb727('0x202')][_0xb727('0x14c')](db[_0xb727('0x109')],{});db[_0xb727('0x202')]['belongsTo'](db[_0xb727('0x137')],{});db['WhatsappQueueReport'][_0xb727('0x14c')](db[_0xb727('0x10b')],{});db[_0xb727('0x202')][_0xb727('0x14c')](db[_0xb727('0x10')],{});db['WhatsappTransferReport'][_0xb727('0x14c')](db[_0xb727('0x10b')],{});db['WhatsappTransferReport'][_0xb727('0x14c')](db[_0xb727('0x109')],{});db[_0xb727('0x10d')][_0xb727('0x14c')](db[_0xb727('0x1ff')],{'foreignKey':_0xb727('0x203'),'as':'FromAccount'});db[_0xb727('0x10d')]['belongsTo'](db[_0xb727('0x1ff')],{'foreignKey':_0xb727('0x204'),'as':'ToAccount'});db[_0xb727('0x10d')][_0xb727('0x14c')](db['WhatsappQueue'],{'foreignKey':_0xb727('0x205'),'as':_0xb727('0x1e8')});db[_0xb727('0x10d')][_0xb727('0x14c')](db[_0xb727('0x10')],{'foreignKey':_0xb727('0x1e5'),'as':_0xb727('0x1ec')});db[_0xb727('0x10d')][_0xb727('0x14c')](db[_0xb727('0x10')],{'foreignKey':_0xb727('0x1ed'),'as':_0xb727('0x1e6')});db[_0xb727('0x137')][_0xb727('0x125')](db[_0xb727('0x10')],{'as':_0xb727('0x16a'),'through':_0xb727('0x3b'),'foreignKey':_0xb727('0x206')});db[_0xb727('0x137')]['belongsToMany'](db[_0xb727('0xef')],{'through':_0xb727('0x1dc'),'as':_0xb727('0x152')});db[_0xb727('0x115')]['belongsTo'](db[_0xb727('0x10')],{'as':_0xb727('0x207'),'foreignKey':_0xb727('0x11c'),'onDelete':_0xb727('0x118'),'hooks':!![]});db['CloudProvider']['hasOne'](db[_0xb727('0xcb')],{'as':_0xb727('0xcb'),'onDelete':_0xb727('0x15e')});db[_0xb727('0x10f')][_0xb727('0x117')](db[_0xb727('0x3d')],{'as':_0xb727('0x15f'),'onDelete':_0xb727('0x15e')});db[_0xb727('0x10f')][_0xb727('0x117')](db[_0xb727('0x3e')],{'as':'Smtp','onDelete':_0xb727('0x15e')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x43ed=['../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','ChatApplication','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','Disposition','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','Schedule','../api/sound/sound.model','Tag','ContactItemType','../api/contactItemType/contactItemType.model','../api/cmContactHasItem/cmContactHasItem.model','CmHopperAdditionalPhone','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserSetting','../api/user-setting/user-setting.model','hasOne','cascade','UserId','userSetting','hasMany','Recordings','VoiceQueuesRt','VoiceExtension','HopperHistory','OpenchannelInteractions','SmsInteractions','FaxInteraction','MailInteractions','WhatsappInteractions','UserNotification','SenderId','userProfileId','belongsToMany','Groups','chat_group_has_users','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_teams','ChatInteractions','user_has_chat_interactions','FaxInteractions','user_has_sms_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','VoicePrefixes','ChatQueues','UserFaxQueue','SmsQueues','OpenchannelQueue','OpenchannelQueues','WhatsappQueue','WhatsappQueues','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','WhatsappAccounts','ChanSpyId','Applications','Sound','Sounds','moh_has_sounds','Hoppers','HopperFinals','VoiceQueueId','CmHopperHistory','HopperHistories','JscriptySessionReport','JscriptySessions','belongsTo','Trunk','TrunkId','TrunkBackup','TrunkBackupId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceCallReport','VoiceQueueReport','QueueCalls','uniqueid','AgentReports','Contact','ContactId','MailAccountId','CloudProviderId','MailServerOut','restrict','Smtp','Answers','MailApplication','List','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Owner','Tags','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','Interaction','Account','ChatWebsiteId','ChatOfflineMessageId','TagId','Dashboard','Items','Dispositions','FaxAccountId','Interactions','Exntensions','FaxMessage','FaxInteractionId','fax_interaction_has_tags','user_has_fax_interactions','AttachmentId','team_has_fax_queues','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','IntervalId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','ChatGroupId','CompanyId','CmContactHasItem','Phones','CmContactId','CmHopperId','OwnerId','CampaignId','All','AutomationAllId','Actions','AutomationId','ParentId','Intervals','FaxApplications','SmsApplications','DefaultReportId','AnalyticCustomReport','CustomReportId','Mohs','whatsapp_interaction_has_tags','ItemType','ItemTypeId','Hopper','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','AnalyticMetric','MetricId','Configurations','AccountId','Subjects','SubjectId','DescriptionId','FieldId','Subject','Field','VariableId','Description','DeskAccount','DeskField','DeskConfiguration','int_desk_configuration_has_tags','ZohoConfiguration','Descriptions','FreshdeskAccount','Dynamics365Configuration','Dynamics365Field','FreshsalesAccount','FromId','ToId','SessionId','ProjectId','MailQueues','FaxQueues','team_has_whatsapp_queues','VoicePrefix','HopperBlacks','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','FromAccount','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsAccountId','CustomFields','Queues','Extensions','UserVoicePrefix','UserProfileSections','UserProfileResource','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','FromWhatsappAccountId','ToWhatsappAccountId','WhatsappQueueId','user','Imap','../config/environment','sequelize','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','utf8mb4','utf8','utf8_general_ci','sequelizeHistory','name','database','username','password','options','User','import','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','MailMessage','../api/mailApplication/mailApplication.model','MailQueueReport','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxQueue','FaxQueueReport'];(function(_0x32017c,_0x3991d4){var _0xca9140=function(_0xdd4bb){while(--_0xdd4bb){_0x32017c['push'](_0x32017c['shift']());}};_0xca9140(++_0x3991d4);}(_0x43ed,0x1b3));var _0xd43e=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x43ed[_0x4d8ed9];return _0x1e2140;};'use strict';var config=require(_0xd43e('0x0'));var Sequelize=require(_0xd43e('0x1'));var _=require('lodash');var jstz=require('jstz');var timezone=jstz[_0xd43e('0x2')]();config[_0xd43e('0x1')]=_[_0xd43e('0x3')](config[_0xd43e('0x1')],{'database':_0xd43e('0x4'),'username':_0xd43e('0x5'),'password':_0xd43e('0x6'),'options':{'host':_0xd43e('0x7'),'port':0xcea,'dialect':_0xd43e('0x8'),'dialectOptions':{'charset':_0xd43e('0x9')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xd43e('0xa'),'collate':_0xd43e('0xb')}}});config[_0xd43e('0xc')]=_['defaultsDeep'](config['sequelizeHistory'],{'database':_0xd43e('0x4'),'username':_0xd43e('0x5'),'password':_0xd43e('0x6'),'options':{'host':_0xd43e('0x7'),'port':0xcea,'dialect':_0xd43e('0x8'),'dialectOptions':{'charset':_0xd43e('0x9')},'logging':![],'timezone':timezone[_0xd43e('0xd')](),'define':{'charset':_0xd43e('0xa'),'collate':_0xd43e('0xb')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd43e('0x1')][_0xd43e('0xe')],config[_0xd43e('0x1')][_0xd43e('0xf')],config[_0xd43e('0x1')][_0xd43e('0x10')],config['sequelize'][_0xd43e('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd43e('0xc')][_0xd43e('0xe')],config[_0xd43e('0xc')]['username'],config[_0xd43e('0xc')]['password'],config[_0xd43e('0xc')][_0xd43e('0x11')])};db[_0xd43e('0x12')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/user/user.model');db[_0xd43e('0x14')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x15'));db[_0xd43e('0x16')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/voiceContext/voiceContext.model');db['VoiceExtension']=db['sequelize'][_0xd43e('0x13')](_0xd43e('0x17'));db[_0xd43e('0x18')]=db['sequelize'][_0xd43e('0x13')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db['VoiceQueue']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x19'));db[_0xd43e('0x1a')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x1b'));db[_0xd43e('0x1c')]=db[_0xd43e('0x1')]['import'](_0xd43e('0x1d'));db[_0xd43e('0x1e')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x1f'));db[_0xd43e('0x20')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/voiceCallReport/voiceCallReport.model');db[_0xd43e('0x21')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x22'));db[_0xd43e('0x23')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x24'));db['VoiceQueueReport']=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/voiceQueueReport/voiceQueueReport.model');db[_0xd43e('0x25')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0x26'));db['Trunk']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x27'));db['VoiceTransferReport']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x28'));db[_0xd43e('0x29')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db[_0xd43e('0x2a')]=db['sequelize'][_0xd43e('0x13')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xd43e('0x2b')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x2c'));db[_0xd43e('0x2d')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x2e'));db['UserFaxQueue']=db['sequelize'][_0xd43e('0x13')]('../api/userFaxQueue/userFaxQueue.model');db[_0xd43e('0x2f')]=db[_0xd43e('0x1')]['import'](_0xd43e('0x30'));db[_0xd43e('0x31')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xd43e('0x32')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0x33'));db[_0xd43e('0x34')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0x35'));db['MailServerOut']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x36'));db[_0xd43e('0x37')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x38'));db[_0xd43e('0x39')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/mailQueue/mailQueue.model');db[_0xd43e('0x3a')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x3b'));db[_0xd43e('0x3c')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/mailInteraction/mailInteraction.model');db[_0xd43e('0x3d')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/mailMessage/mailMessage.model');db['MailApplication']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x3e'));db[_0xd43e('0x3f')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x40'));db['Dashboard']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x41'));db[_0xd43e('0x42')]=db['sequelize'][_0xd43e('0x13')]('../api/dashboardItem/dashboardItem.model');db[_0xd43e('0x43')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x44'));db[_0xd43e('0x45')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0x46'));db['FaxInteraction']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x47'));db['FaxMessage']=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/faxMessage/faxMessage.model');db[_0xd43e('0x48')]=db['sequelize'][_0xd43e('0x13')]('../api/faxQueue/faxQueue.model');db[_0xd43e('0x49')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x4a'));db[_0xd43e('0x4b')]=db[_0xd43e('0x1')]['import']('../api/smsAccount/smsAccount.model');db[_0xd43e('0x4c')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x4d'));db[_0xd43e('0x4e')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/smsInteraction/smsInteraction.model');db[_0xd43e('0x4f')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/smsMessage/smsMessage.model');db[_0xd43e('0x50')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0x51'));db[_0xd43e('0x52')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x53'));db[_0xd43e('0x54')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x55'));db[_0xd43e('0x56')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x57'));db[_0xd43e('0x58')]=db[_0xd43e('0x1')]['import'](_0xd43e('0x59'));db['OpenchannelQueue']=db['sequelize'][_0xd43e('0x13')](_0xd43e('0x5a'));db[_0xd43e('0x5b')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0x5c'));db[_0xd43e('0x5d')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xd43e('0x5e')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x5f'));db[_0xd43e('0x60')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x61'));db[_0xd43e('0x62')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0x63'));db[_0xd43e('0x64')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0x65'));db[_0xd43e('0x66')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0x67'));db[_0xd43e('0x68')]=db['sequelize']['import'](_0xd43e('0x69'));db['ChatProactiveAction']=db['sequelize'][_0xd43e('0x13')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0xd43e('0x6a')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x6b'));db['CmContact']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x6c'));db[_0xd43e('0x6d')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x6e'));db[_0xd43e('0x6f')]=db['sequelize']['import'](_0xd43e('0x70'));db[_0xd43e('0x71')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x72'));db['CmHopperHistory']=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/cmHopperHistory/cmHopperHistory.model');db[_0xd43e('0x73')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x74'));db[_0xd43e('0x75')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0x76'));db[_0xd43e('0x77')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x78'));db[_0xd43e('0x79')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/automation/automation.model');db[_0xd43e('0x7a')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/cannedAnswer/cannedAnswer.model');db[_0xd43e('0x7b')]=db[_0xd43e('0x1')]['import']('../api/disposition/disposition.model');db[_0xd43e('0x7c')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x7d'));db[_0xd43e('0x7e')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0x7f'));db[_0xd43e('0x80')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x81'));db[_0xd43e('0x82')]=db['sequelize'][_0xd43e('0x13')]('../api/cdr/cdr.model');db[_0xd43e('0x83')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xd43e('0x84')]=db['sequelize'][_0xd43e('0x13')]('../api/schedule/schedule.model');db['Sound']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x85'));db[_0xd43e('0x86')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/tag/tag.model');db[_0xd43e('0x87')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0x88'));db['CmContactHasItem']=db[_0xd43e('0x1')]['import'](_0xd43e('0x89'));db[_0xd43e('0x8a')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.model');db[_0xd43e('0x8b')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x8c'));db[_0xd43e('0x8d')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x8e'));db[_0xd43e('0x8f')]=db[_0xd43e('0x1')]['import'](_0xd43e('0x90'));db[_0xd43e('0x91')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x92'));db[_0xd43e('0x93')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x94'));db['AnalyticCustomReport']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x95'));db[_0xd43e('0x96')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0xd43e('0x97')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x98'));db['AnalyticFieldReport']=db[_0xd43e('0x1')]['import'](_0xd43e('0x99'));db[_0xd43e('0x9a')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0x9b'));db[_0xd43e('0x9c')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x9d'));db[_0xd43e('0x9e')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0x9f'));db[_0xd43e('0xa0')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xa1'));db[_0xd43e('0xa2')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xa3'));db[_0xd43e('0xa4')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0xa5'));db[_0xd43e('0xa6')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xa7'));db['DeskAccount']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xa8'));db['DeskConfiguration']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xa9'));db['DeskField']=db['sequelize'][_0xd43e('0x13')](_0xd43e('0xaa'));db[_0xd43e('0xab')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xac'));db[_0xd43e('0xad')]=db[_0xd43e('0x1')]['import']('../api/intZohoField/intZohoField.model');db[_0xd43e('0xae')]=db['sequelize'][_0xd43e('0x13')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0xd43e('0xaf')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xd43e('0xb0')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xb1'));db['FreshdeskAccount']=db['sequelize'][_0xd43e('0x13')](_0xd43e('0xb2'));db[_0xd43e('0xb3')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xb4'));db[_0xd43e('0xb5')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xb6'));db[_0xd43e('0xb7')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0xb8'));db[_0xd43e('0xb9')]=db[_0xd43e('0x1')]['import'](_0xd43e('0xba'));db[_0xd43e('0xbb')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xbc'));db['ServicenowAccount']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xbd'));db[_0xd43e('0xbe')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xbf'));db[_0xd43e('0xc0')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xc1'));db[_0xd43e('0xc2')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xc3'));db['Dynamics365Configuration']=db['sequelize'][_0xd43e('0x13')](_0xd43e('0xc4'));db['Dynamics365Field']=db[_0xd43e('0x1')]['import'](_0xd43e('0xc5'));db['FreshsalesAccount']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xc6'));db[_0xd43e('0xc7')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db[_0xd43e('0xc8')]=db['sequelize']['import'](_0xd43e('0xc9'));db['Integration']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x92'));db[_0xd43e('0xca')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xcb'));db[_0xd43e('0xcc')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0xcd'));db[_0xd43e('0xce')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/chatInternalMessage/chatInternalMessage.model');db[_0xd43e('0xcf')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xd0'));db[_0xd43e('0xd1')]=db[_0xd43e('0x1')]['import']('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db['JscriptySessionReport']=db['sequelize']['import'](_0xd43e('0xd2'));db[_0xd43e('0xd3')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xd4'));db['SquareReport']=db['sequelize']['import'](_0xd43e('0xd5'));db['SquareDetailsReport']=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/squareReportDetail/squareReportDetail.model');db[_0xd43e('0xd6')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xd7'));db[_0xd43e('0xd8')]=db[_0xd43e('0x1')]['import'](_0xd43e('0xd9'));db['SquareOdbc']=db['sequelize'][_0xd43e('0x13')](_0xd43e('0xda'));db[_0xd43e('0xdb')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0xdc'));db['SquareRecording']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xdd'));db['SquareMessage']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xde'));db[_0xd43e('0xdf')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/team/team.model');db[_0xd43e('0xe0')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xe1'));db[_0xd43e('0xe2')]=db[_0xd43e('0x1')]['import'](_0xd43e('0xe3'));db['Migration']=db[_0xd43e('0x1')]['import'](_0xd43e('0xe4'));db[_0xd43e('0xe5')]=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/attachment/attachment.model');db[_0xd43e('0xe6')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0xe7'));db[_0xd43e('0xe8')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xe9'));db[_0xd43e('0xea')]=db[_0xd43e('0x1')]['import']('../api/chatTransferReport/chatTransferReport.model');db[_0xd43e('0xeb')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xec'));db['OpenchannelTransferReport']=db[_0xd43e('0x1')]['import']('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0xd43e('0xed')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0xee'));db[_0xd43e('0xef')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0xf0'));db['VoicePrefix']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xf1'));db[_0xd43e('0xf2')]=db['sequelize'][_0xd43e('0x13')]('../api/userProfile/userProfile.model');db[_0xd43e('0xf3')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xf4'));db['UserProfileResource']=db[_0xd43e('0x1')]['import'](_0xd43e('0xf5'));db['UserNotification']=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xf6'));db[_0xd43e('0xf7')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xf8'));db[_0xd43e('0xf9')]=db[_0xd43e('0x1')]['import'](_0xd43e('0xfa'));db[_0xd43e('0xfb')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xfc'));db[_0xd43e('0xfd')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0xfe'));db[_0xd43e('0xff')]=db['sequelize'][_0xd43e('0x13')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xd43e('0x100')]=db['sequelize']['import'](_0xd43e('0x101'));db['WhatsappQueue']=db['sequelize'][_0xd43e('0x13')](_0xd43e('0x102'));db[_0xd43e('0x103')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x104'));db[_0xd43e('0x105')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0x106'));db[_0xd43e('0x107')]=db[_0xd43e('0x1')][_0xd43e('0x13')](_0xd43e('0x108'));db['UserVoicePrefix']=db[_0xd43e('0x1')][_0xd43e('0x13')]('../api/userVoicePrefix/userVoicePrefix.model');db[_0xd43e('0x109')]=db['sequelize'][_0xd43e('0x13')](_0xd43e('0x10a'));db[_0xd43e('0x12')][_0xd43e('0x10b')](db[_0xd43e('0x1e')],{'as':_0xd43e('0x1e'),'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x10d')});db[_0xd43e('0x12')]['hasOne'](db[_0xd43e('0x109')],{'as':_0xd43e('0x10e'),'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x10d')});db[_0xd43e('0x12')][_0xd43e('0x10f')](db[_0xd43e('0x1a')],{'as':_0xd43e('0x110'),'foreignKey':_0xd43e('0x10d')});db[_0xd43e('0x12')][_0xd43e('0x10f')](db[_0xd43e('0x29')],{'as':_0xd43e('0x111'),'foreignKey':'UserId'});db[_0xd43e('0x12')]['hasMany'](db[_0xd43e('0x112')],{'as':'Extensions','onDelete':_0xd43e('0x10c'),'hooks':!![]});db[_0xd43e('0x12')][_0xd43e('0x10f')](db[_0xd43e('0x71')],{'as':'HopperFinals','foreignKey':'UserId'});db[_0xd43e('0x12')][_0xd43e('0x10f')](db['CmHopperHistory'],{'as':_0xd43e('0x113'),'foreignKey':'UserId'});db['User'][_0xd43e('0x10f')](db['ReportAgentPreview'],{'as':_0xd43e('0x73'),'foreignKey':'UserId'});db[_0xd43e('0x12')][_0xd43e('0x10f')](db['OpenchannelInteraction'],{'as':_0xd43e('0x114'),'foreignKey':_0xd43e('0x10d')});db[_0xd43e('0x12')][_0xd43e('0x10f')](db[_0xd43e('0x60')],{'as':'ChatInteractions','foreignKey':_0xd43e('0x10d')});db['User']['hasMany'](db['SmsInteraction'],{'as':_0xd43e('0x115'),'foreignKey':_0xd43e('0x10d')});db['User'][_0xd43e('0x10f')](db[_0xd43e('0x116')],{'as':'FaxInteractions','foreignKey':'UserId'});db[_0xd43e('0x12')]['hasMany'](db[_0xd43e('0x3c')],{'as':_0xd43e('0x117'),'foreignKey':_0xd43e('0x10d')});db[_0xd43e('0x12')][_0xd43e('0x10f')](db[_0xd43e('0xfb')],{'as':_0xd43e('0x118'),'foreignKey':_0xd43e('0x10d')});db[_0xd43e('0x12')][_0xd43e('0x10f')](db[_0xd43e('0x119')],{'as':'UserNotifications','foreignKey':_0xd43e('0x11a')});db['User']['belongsTo'](db[_0xd43e('0xf2')],{'as':_0xd43e('0xf2'),'foreignKey':_0xd43e('0x11b')});db[_0xd43e('0x12')][_0xd43e('0x11c')](db[_0xd43e('0x68')],{'as':_0xd43e('0x11d'),'through':_0xd43e('0x11e')});db[_0xd43e('0x12')][_0xd43e('0x11c')](db[_0xd43e('0x11f')],{'as':_0xd43e('0x120'),'through':_0xd43e('0x121')});db['User'][_0xd43e('0x11c')](db[_0xd43e('0xef')],{'as':_0xd43e('0x122'),'through':_0xd43e('0x123')});db[_0xd43e('0x12')][_0xd43e('0x11c')](db['Team'],{'through':_0xd43e('0x124')});db[_0xd43e('0x12')][_0xd43e('0x11c')](db[_0xd43e('0x3c')],{'as':_0xd43e('0x117'),'through':'user_has_mail_interactions'});db[_0xd43e('0x12')][_0xd43e('0x11c')](db[_0xd43e('0x60')],{'as':_0xd43e('0x125'),'through':_0xd43e('0x126')});db[_0xd43e('0x12')]['belongsToMany'](db[_0xd43e('0x116')],{'as':_0xd43e('0x127'),'through':'user_has_fax_interactions'});db[_0xd43e('0x12')][_0xd43e('0x11c')](db[_0xd43e('0x4e')],{'as':'SmsInteractions','through':_0xd43e('0x128')});db[_0xd43e('0x12')]['belongsToMany'](db['OpenchannelInteraction'],{'as':_0xd43e('0x114'),'through':_0xd43e('0x129')});db[_0xd43e('0x12')]['belongsToMany'](db[_0xd43e('0xfb')],{'as':_0xd43e('0x118'),'through':_0xd43e('0x12a')});db[_0xd43e('0x12')]['belongsToMany'](db[_0xd43e('0x12b')],{'as':_0xd43e('0x12c'),'through':_0xd43e('0x2a'),'required':![]});db[_0xd43e('0x12')][_0xd43e('0x11c')](db['VoicePrefix'],{'as':_0xd43e('0x12d'),'through':'UserVoicePrefix','required':![]});db[_0xd43e('0x12')]['belongsToMany'](db[_0xd43e('0x39')],{'as':'MailQueues','through':_0xd43e('0x2d'),'required':![]});db[_0xd43e('0x12')][_0xd43e('0x11c')](db[_0xd43e('0x66')],{'as':_0xd43e('0x12e'),'through':_0xd43e('0x2b'),'required':![],'hooks':!![]});db[_0xd43e('0x12')][_0xd43e('0x11c')](db['FaxQueue'],{'as':'FaxQueues','through':_0xd43e('0x12f'),'required':![]});db[_0xd43e('0x12')][_0xd43e('0x11c')](db[_0xd43e('0x50')],{'as':_0xd43e('0x130'),'through':_0xd43e('0x2f'),'required':![]});db[_0xd43e('0x12')][_0xd43e('0x11c')](db[_0xd43e('0x131')],{'as':_0xd43e('0x132'),'through':_0xd43e('0x31'),'required':![]});db[_0xd43e('0x12')][_0xd43e('0x11c')](db[_0xd43e('0x133')],{'as':_0xd43e('0x134'),'through':_0xd43e('0x32'),'required':![]});db[_0xd43e('0x12')]['belongsToMany'](db[_0xd43e('0xef')],{'through':_0xd43e('0x123')});db[_0xd43e('0x12')][_0xd43e('0x11c')](db[_0xd43e('0x5b')],{'as':_0xd43e('0x135'),'through':_0xd43e('0x136')});db[_0xd43e('0x12')][_0xd43e('0x11c')](db[_0xd43e('0x43')],{'as':'FaxAccounts','through':_0xd43e('0x137')});db[_0xd43e('0x12')][_0xd43e('0x11c')](db['MailAccount'],{'as':_0xd43e('0x138'),'through':_0xd43e('0x139')});db[_0xd43e('0x12')][_0xd43e('0x11c')](db['OpenchannelAccount'],{'as':_0xd43e('0x13a'),'through':_0xd43e('0x13b')});db[_0xd43e('0x12')][_0xd43e('0x11c')](db['SmsAccount'],{'as':'SmsAccounts','through':_0xd43e('0x13c')});db[_0xd43e('0x12')][_0xd43e('0x11c')](db['WhatsappAccount'],{'as':_0xd43e('0x13d'),'through':'user_has_whatsapp_accounts'});db[_0xd43e('0x14')]['hasMany'](db['VoiceExtension'],{'as':'SpiedAgents','onDelete':'cascade','foreignKey':_0xd43e('0x13e')});db[_0xd43e('0x16')][_0xd43e('0x10f')](db['VoiceExtension'],{'onDelete':_0xd43e('0x10c')});db[_0xd43e('0x112')]['hasMany'](db[_0xd43e('0x112')],{'as':_0xd43e('0x13f'),'onDelete':_0xd43e('0x10c')});db[_0xd43e('0x18')][_0xd43e('0x11c')](db[_0xd43e('0x140')],{'as':_0xd43e('0x141'),'through':_0xd43e('0x142')});db[_0xd43e('0x12b')][_0xd43e('0x10f')](db[_0xd43e('0x29')],{'as':'Members','foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xd43e('0x10f')](db[_0xd43e('0x6d')],{'as':_0xd43e('0x143'),'foreignKey':'VoiceQueueId'});db[_0xd43e('0x12b')][_0xd43e('0x10f')](db[_0xd43e('0x71')],{'as':_0xd43e('0x144'),'foreignKey':_0xd43e('0x145')});db[_0xd43e('0x12b')][_0xd43e('0x10f')](db[_0xd43e('0x146')],{'as':_0xd43e('0x147'),'foreignKey':_0xd43e('0x145')});db[_0xd43e('0x12b')][_0xd43e('0x10f')](db[_0xd43e('0x73')],{'as':_0xd43e('0x73'),'foreignKey':_0xd43e('0x145')});db['VoiceQueue']['hasMany'](db['CmHopperBlack'],{'as':'HopperBlacks','foreignKey':_0xd43e('0x145')});db[_0xd43e('0x12b')]['hasMany'](db[_0xd43e('0x148')],{'as':_0xd43e('0x149'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xd43e('0x14a')](db[_0xd43e('0x14b')],{'as':_0xd43e('0x14b'),'foreignKey':_0xd43e('0x14c')});db[_0xd43e('0x12b')][_0xd43e('0x14a')](db[_0xd43e('0x14b')],{'as':_0xd43e('0x14d'),'foreignKey':_0xd43e('0x14e')});db['VoiceQueue'][_0xd43e('0x14a')](db[_0xd43e('0x7e')],{'as':_0xd43e('0x7e'),'foreignKey':'IntervalId'});db[_0xd43e('0x12b')][_0xd43e('0x14a')](db['Pause'],{'as':_0xd43e('0x14f'),'foreignKey':_0xd43e('0x150')});db[_0xd43e('0x12b')]['belongsToMany'](db[_0xd43e('0xef')],{'as':'Lists','through':_0xd43e('0x151')});db[_0xd43e('0x12b')][_0xd43e('0x11c')](db[_0xd43e('0x12')],{'as':_0xd43e('0x152'),'through':'UserVoiceQueue'});db[_0xd43e('0x12b')][_0xd43e('0x11c')](db[_0xd43e('0xdf')],{'as':_0xd43e('0x153'),'through':_0xd43e('0x105')});db[_0xd43e('0x12b')][_0xd43e('0x11c')](db[_0xd43e('0xef')],{'as':_0xd43e('0x154'),'through':_0xd43e('0x155')});db[_0xd43e('0x1a')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'as':'User','foreignKey':_0xd43e('0x10d')});db[_0xd43e('0x1c')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'as':_0xd43e('0x12'),'foreignKey':_0xd43e('0x10d')});db[_0xd43e('0x1e')]['hasMany'](db[_0xd43e('0x20')],{'as':_0xd43e('0x156'),'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x157'),'sourceKey':_0xd43e('0x158')});db[_0xd43e('0x20')][_0xd43e('0x14a')](db[_0xd43e('0x1e')],{'foreignKey':_0xd43e('0x157'),'targetKey':'mailbox'});db[_0xd43e('0x159')][_0xd43e('0x10f')](db[_0xd43e('0x15a')],{'as':_0xd43e('0x15b'),'foreignKey':_0xd43e('0x15c'),'constraints':![]});db[_0xd43e('0x159')][_0xd43e('0x10f')](db[_0xd43e('0x23')],{'as':_0xd43e('0x15d'),'foreignKey':_0xd43e('0x15c'),'constraints':![]});db[_0xd43e('0x159')][_0xd43e('0x14a')](db['User'],{'as':_0xd43e('0x12'),'foreignKey':_0xd43e('0x10d')});db[_0xd43e('0x159')]['belongsTo'](db['CmContact'],{'as':_0xd43e('0x15e'),'foreignKey':_0xd43e('0x15f')});db[_0xd43e('0x34')][_0xd43e('0x14a')](db['MailAccount'],{'as':_0xd43e('0x37'),'foreignKey':_0xd43e('0x160')});db[_0xd43e('0x34')][_0xd43e('0x14a')](db[_0xd43e('0x103')],{'as':_0xd43e('0x103'),'foreignKey':_0xd43e('0x161'),'onDelete':'restrict'});db[_0xd43e('0x162')][_0xd43e('0x14a')](db[_0xd43e('0x37')],{'as':_0xd43e('0x37'),'foreignKey':_0xd43e('0x160')});db[_0xd43e('0x162')]['belongsTo'](db[_0xd43e('0x103')],{'as':_0xd43e('0x103'),'foreignKey':_0xd43e('0x161'),'onDelete':_0xd43e('0x163')});db[_0xd43e('0x37')]['hasOne'](db['MailServerIn'],{'as':'Imap','onDelete':_0xd43e('0x10c')});db['MailAccount'][_0xd43e('0x10b')](db[_0xd43e('0x162')],{'as':_0xd43e('0x164'),'onDelete':_0xd43e('0x10c')});db[_0xd43e('0x37')][_0xd43e('0x10f')](db[_0xd43e('0x7b')],{'as':'Dispositions','foreignKey':_0xd43e('0x160'),'onDelete':_0xd43e('0x10c')});db['MailAccount'][_0xd43e('0x10f')](db[_0xd43e('0x7a')],{'as':_0xd43e('0x165'),'foreignKey':'MailAccountId'});db[_0xd43e('0x37')]['hasMany'](db[_0xd43e('0x3d')],{'as':_0xd43e('0x156'),'foreignKey':_0xd43e('0x160')});db['MailAccount']['hasMany'](db[_0xd43e('0x3c')],{'as':'Interactions'});db['MailAccount'][_0xd43e('0x10f')](db[_0xd43e('0x166')],{'as':_0xd43e('0x13f')});db[_0xd43e('0x37')][_0xd43e('0x14a')](db[_0xd43e('0xef')],{'as':_0xd43e('0x167'),'foreignKey':_0xd43e('0x168')});db[_0xd43e('0x37')][_0xd43e('0x14a')](db[_0xd43e('0x8b')],{'as':_0xd43e('0x8b'),'foreignKey':_0xd43e('0x169')});db[_0xd43e('0x37')][_0xd43e('0x14a')](db[_0xd43e('0x80')],{'as':_0xd43e('0x14f'),'foreignKey':_0xd43e('0x150')});db['MailAccount'][_0xd43e('0x11c')](db[_0xd43e('0x12')],{'as':_0xd43e('0x152'),'through':_0xd43e('0x139')});db['MailQueue'][_0xd43e('0x11c')](db[_0xd43e('0x12')],{'as':_0xd43e('0x152'),'through':_0xd43e('0x2d')});db[_0xd43e('0x39')]['belongsToMany'](db[_0xd43e('0xdf')],{'through':_0xd43e('0x16a'),'as':_0xd43e('0x153')});db[_0xd43e('0x3c')][_0xd43e('0x10f')](db[_0xd43e('0x3d')],{'as':_0xd43e('0x156'),'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x16b')});db[_0xd43e('0x3c')][_0xd43e('0x14a')](db[_0xd43e('0x37')],{'as':'Account','foreignKey':_0xd43e('0x160')});db['MailInteraction']['belongsTo'](db[_0xd43e('0x11f')],{'as':_0xd43e('0x15e'),'foreignKey':_0xd43e('0x15f')});db[_0xd43e('0x3c')][_0xd43e('0x14a')](db['User'],{'as':_0xd43e('0x16c'),'foreignKey':_0xd43e('0x10d')});db[_0xd43e('0x3c')][_0xd43e('0x11c')](db[_0xd43e('0x86')],{'through':'mail_interaction_has_tags','as':_0xd43e('0x16d')});db[_0xd43e('0x3c')][_0xd43e('0x11c')](db[_0xd43e('0x86')],{'through':_0xd43e('0x16e'),'as':_0xd43e('0x16f')});db[_0xd43e('0x3c')][_0xd43e('0x11c')](db[_0xd43e('0x12')],{'as':_0xd43e('0x170'),'through':_0xd43e('0x171'),'foreignKey':_0xd43e('0x16b')});db['MailMessage'][_0xd43e('0x10f')](db[_0xd43e('0xe5')],{'as':'Attachments','onDelete':_0xd43e('0x10c')});db[_0xd43e('0x3d')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'as':_0xd43e('0x12')});db['MailMessage']['belongsTo'](db['CmContact'],{'onDelete':_0xd43e('0x10c'),'as':_0xd43e('0x15e')});db[_0xd43e('0x3d')][_0xd43e('0x14a')](db[_0xd43e('0x3c')],{'as':_0xd43e('0x172'),'foreignKey':_0xd43e('0x16b')});db[_0xd43e('0x3d')]['belongsTo'](db[_0xd43e('0x37')],{'as':_0xd43e('0x173'),'foreignKey':_0xd43e('0x160')});db[_0xd43e('0x3d')][_0xd43e('0x14a')](db[_0xd43e('0x5b')],{'as':_0xd43e('0x5b'),'foreignKey':_0xd43e('0x174')});db[_0xd43e('0x3d')][_0xd43e('0x14a')](db[_0xd43e('0x64')],{'as':_0xd43e('0x64'),'foreignKey':_0xd43e('0x175')});db[_0xd43e('0x166')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'onDelete':'restrict'});db['MailApplication'][_0xd43e('0x14a')](db[_0xd43e('0x39')],{'onDelete':_0xd43e('0x163')});db[_0xd43e('0x166')][_0xd43e('0x14a')](db['MailAccount'],{'onDelete':_0xd43e('0x163')});db['MailApplication'][_0xd43e('0x14a')](db[_0xd43e('0x7e')],{'onDelete':_0xd43e('0x163'),'foreignKey':'IntervalId'});db['MailApplication']['belongsTo'](db[_0xd43e('0x86')],{'onDelete':_0xd43e('0x163'),'foreignKey':_0xd43e('0x176')});db[_0xd43e('0x3f')][_0xd43e('0x14a')](db['MailAccount'],{});db[_0xd43e('0x3f')][_0xd43e('0x14a')](db[_0xd43e('0xef')],{'as':_0xd43e('0x167'),'foreignKey':'ListId'});db[_0xd43e('0x3f')][_0xd43e('0x14a')](db['CmContact'],{'as':_0xd43e('0x15e'),'foreignKey':_0xd43e('0x15f')});db[_0xd43e('0x3f')]['belongsTo'](db[_0xd43e('0x3c')],{});db[_0xd43e('0x3f')][_0xd43e('0x14a')](db['MailMessage'],{});db[_0xd43e('0x3f')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{});db[_0xd43e('0x3f')]['belongsTo'](db[_0xd43e('0x39')],{});db[_0xd43e('0x177')][_0xd43e('0x10f')](db[_0xd43e('0x42')],{'as':_0xd43e('0x178'),'onDelete':'cascade'});db[_0xd43e('0x43')][_0xd43e('0x10f')](db['Disposition'],{'as':_0xd43e('0x179'),'foreignKey':_0xd43e('0x17a'),'onDelete':'cascade'});db[_0xd43e('0x43')]['hasMany'](db[_0xd43e('0x7a')],{'as':_0xd43e('0x165'),'foreignKey':'FaxAccountId'});db[_0xd43e('0x43')][_0xd43e('0x10f')](db[_0xd43e('0x116')],{'as':_0xd43e('0x17b')});db[_0xd43e('0x43')][_0xd43e('0x10f')](db[_0xd43e('0x45')],{'as':_0xd43e('0x13f')});db['FaxAccount'][_0xd43e('0x10f')](db[_0xd43e('0x112')],{'as':_0xd43e('0x17c'),'onDelete':'cascade'});db[_0xd43e('0x43')][_0xd43e('0x10f')](db[_0xd43e('0x17d')],{'as':_0xd43e('0x156')});db[_0xd43e('0x43')][_0xd43e('0x14a')](db[_0xd43e('0x14b')],{'as':_0xd43e('0x14b')});db[_0xd43e('0x43')][_0xd43e('0x14a')](db[_0xd43e('0xef')],{'as':_0xd43e('0x167'),'foreignKey':_0xd43e('0x168')});db[_0xd43e('0x43')][_0xd43e('0x14a')](db['Pause'],{'as':_0xd43e('0x14f'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xd43e('0x43')][_0xd43e('0x11c')](db[_0xd43e('0x12')],{'as':_0xd43e('0x152'),'through':'user_has_fax_accounts'});db[_0xd43e('0x45')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'onDelete':_0xd43e('0x163')});db['FaxApplication'][_0xd43e('0x14a')](db[_0xd43e('0x48')],{'onDelete':_0xd43e('0x163')});db[_0xd43e('0x45')]['belongsTo'](db[_0xd43e('0x43')],{'onDelete':_0xd43e('0x163')});db[_0xd43e('0x45')][_0xd43e('0x14a')](db['Tag'],{'onDelete':_0xd43e('0x163'),'foreignKey':'TagId'});db[_0xd43e('0x116')][_0xd43e('0x10f')](db['FaxMessage'],{'as':'Messages','onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x17e')});db[_0xd43e('0x116')][_0xd43e('0x14a')](db[_0xd43e('0x43')],{'as':_0xd43e('0x173'),'foreignKey':'FaxAccountId'});db[_0xd43e('0x116')][_0xd43e('0x14a')](db[_0xd43e('0x11f')],{'as':_0xd43e('0x15e'),'foreignKey':_0xd43e('0x15f')});db['FaxInteraction']['belongsTo'](db[_0xd43e('0x12')],{'as':_0xd43e('0x16c'),'foreignKey':'UserId'});db[_0xd43e('0x116')]['belongsToMany'](db[_0xd43e('0x86')],{'through':'fax_interaction_has_tags','as':_0xd43e('0x16d')});db[_0xd43e('0x116')][_0xd43e('0x11c')](db[_0xd43e('0x86')],{'through':_0xd43e('0x17f'),'as':_0xd43e('0x16f')});db['FaxInteraction']['belongsToMany'](db[_0xd43e('0x12')],{'as':_0xd43e('0x170'),'through':_0xd43e('0x180'),'foreignKey':_0xd43e('0x17e')});db['FaxMessage']['belongsTo'](db[_0xd43e('0x12')],{'onDelete':_0xd43e('0x10c'),'as':_0xd43e('0x12')});db[_0xd43e('0x17d')][_0xd43e('0x14a')](db['FaxInteraction'],{'as':_0xd43e('0x172'),'foreignKey':'FaxInteractionId'});db[_0xd43e('0x17d')][_0xd43e('0x14a')](db['CmContact'],{'onDelete':_0xd43e('0x10c'),'as':_0xd43e('0x15e')});db[_0xd43e('0x17d')]['belongsTo'](db[_0xd43e('0xe5')],{'as':_0xd43e('0xe5'),'foreignKey':_0xd43e('0x181')});db['FaxMessage']['belongsTo'](db[_0xd43e('0x43')],{'as':_0xd43e('0x173'),'foreignKey':_0xd43e('0x17a')});db['FaxQueue'][_0xd43e('0x11c')](db[_0xd43e('0x12')],{'as':_0xd43e('0x152'),'through':_0xd43e('0x12f')});db[_0xd43e('0x48')][_0xd43e('0x11c')](db[_0xd43e('0xdf')],{'through':_0xd43e('0x182'),'as':'Teams'});db[_0xd43e('0x49')][_0xd43e('0x14a')](db[_0xd43e('0x43')],{});db[_0xd43e('0x49')][_0xd43e('0x14a')](db[_0xd43e('0xef')],{'as':_0xd43e('0x167'),'foreignKey':_0xd43e('0x168')});db[_0xd43e('0x49')][_0xd43e('0x14a')](db[_0xd43e('0x11f')],{'as':_0xd43e('0x15e'),'foreignKey':_0xd43e('0x15f')});db[_0xd43e('0x49')]['belongsTo'](db[_0xd43e('0x116')],{});db['FaxQueueReport']['belongsTo'](db[_0xd43e('0x17d')],{});db['FaxQueueReport'][_0xd43e('0x14a')](db['User'],{});db['FaxQueueReport']['belongsTo'](db[_0xd43e('0x48')],{});db['SmsAccount'][_0xd43e('0x10f')](db[_0xd43e('0x7b')],{'as':'Dispositions','foreignKey':'SmsAccountId','onDelete':_0xd43e('0x10c')});db[_0xd43e('0x4b')][_0xd43e('0x10f')](db[_0xd43e('0x7a')],{'as':_0xd43e('0x165'),'foreignKey':_0xd43e('0x183')});db[_0xd43e('0x4b')]['hasMany'](db[_0xd43e('0x4f')],{'as':_0xd43e('0x156'),'foreignKey':_0xd43e('0x183')});db['SmsAccount'][_0xd43e('0x10f')](db[_0xd43e('0x4e')],{'as':_0xd43e('0x17b')});db[_0xd43e('0x4b')][_0xd43e('0x10f')](db['SmsApplication'],{'as':_0xd43e('0x13f')});db['SmsAccount'][_0xd43e('0x14a')](db[_0xd43e('0xef')],{'as':'List','foreignKey':_0xd43e('0x168')});db[_0xd43e('0x4b')][_0xd43e('0x14a')](db[_0xd43e('0x80')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0xd43e('0x4b')][_0xd43e('0x11c')](db[_0xd43e('0x12')],{'as':'Agents','through':_0xd43e('0x13c')});db[_0xd43e('0x4c')]['belongsTo'](db['User'],{'onDelete':'restrict'});db[_0xd43e('0x4c')][_0xd43e('0x14a')](db['SmsQueue'],{'onDelete':_0xd43e('0x163')});db[_0xd43e('0x4c')][_0xd43e('0x14a')](db[_0xd43e('0x4b')],{'onDelete':'restrict'});db['SmsApplication'][_0xd43e('0x14a')](db[_0xd43e('0x7e')],{'onDelete':_0xd43e('0x163'),'foreignKey':'IntervalId'});db['SmsApplication'][_0xd43e('0x14a')](db['Tag'],{'onDelete':_0xd43e('0x163'),'foreignKey':_0xd43e('0x176')});db[_0xd43e('0x4e')][_0xd43e('0x10f')](db[_0xd43e('0x4f')],{'as':'Messages','onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x184')});db[_0xd43e('0x4e')][_0xd43e('0x14a')](db[_0xd43e('0x4b')],{'as':_0xd43e('0x173'),'foreignKey':'SmsAccountId'});db[_0xd43e('0x4e')][_0xd43e('0x14a')](db['CmContact'],{'as':_0xd43e('0x15e'),'foreignKey':_0xd43e('0x15f')});db[_0xd43e('0x4e')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'as':'Owner','foreignKey':'UserId'});db['SmsInteraction'][_0xd43e('0x11c')](db[_0xd43e('0x86')],{'through':_0xd43e('0x185'),'as':_0xd43e('0x16d')});db[_0xd43e('0x4e')][_0xd43e('0x11c')](db[_0xd43e('0x86')],{'through':_0xd43e('0x185'),'as':_0xd43e('0x16f')});db[_0xd43e('0x4e')]['belongsToMany'](db[_0xd43e('0x12')],{'as':_0xd43e('0x170'),'through':_0xd43e('0x128'),'foreignKey':'SmsInteractionId'});db[_0xd43e('0x4f')]['belongsTo'](db[_0xd43e('0x12')],{'as':_0xd43e('0x12')});db['SmsMessage'][_0xd43e('0x14a')](db[_0xd43e('0x11f')],{'onDelete':_0xd43e('0x10c'),'as':'Contact'});db[_0xd43e('0x4f')][_0xd43e('0x14a')](db['SmsInteraction'],{'onDelete':_0xd43e('0x10c'),'as':_0xd43e('0x172'),'foreignKey':_0xd43e('0x184')});db[_0xd43e('0x4f')]['belongsTo'](db[_0xd43e('0x4b')],{'as':_0xd43e('0x173'),'foreignKey':_0xd43e('0x183')});db['SmsQueue'][_0xd43e('0x11c')](db[_0xd43e('0x12')],{'as':_0xd43e('0x152'),'through':_0xd43e('0x2f'),'foreignKey':'SmsQueueId'});db['SmsQueue']['belongsToMany'](db[_0xd43e('0xdf')],{'through':_0xd43e('0x186'),'as':'Teams'});db[_0xd43e('0x52')][_0xd43e('0x10f')](db[_0xd43e('0x7b')],{'as':'Dispositions','foreignKey':_0xd43e('0x187'),'onDelete':'cascade'});db[_0xd43e('0x52')][_0xd43e('0x10f')](db[_0xd43e('0x7a')],{'as':'Answers','foreignKey':_0xd43e('0x187')});db[_0xd43e('0x52')][_0xd43e('0x10f')](db[_0xd43e('0x56')],{'as':'Interactions','foreignKey':_0xd43e('0x187')});db[_0xd43e('0x52')]['hasMany'](db[_0xd43e('0x58')],{'as':'Messages','foreignKey':_0xd43e('0x187')});db['OpenchannelAccount']['hasMany'](db[_0xd43e('0x54')],{'as':_0xd43e('0x13f'),'foreignKey':_0xd43e('0x187')});db[_0xd43e('0x52')][_0xd43e('0x14a')](db[_0xd43e('0xef')],{'as':'List','foreignKey':_0xd43e('0x168')});db['OpenchannelAccount'][_0xd43e('0x14a')](db[_0xd43e('0x80')],{'as':_0xd43e('0x14f'),'foreignKey':_0xd43e('0x150')});db[_0xd43e('0x52')]['belongsToMany'](db['User'],{'as':_0xd43e('0x152'),'through':_0xd43e('0x13b')});db[_0xd43e('0x54')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'onDelete':_0xd43e('0x163')});db[_0xd43e('0x54')][_0xd43e('0x14a')](db[_0xd43e('0x131')],{'onDelete':_0xd43e('0x163'),'foreignKey':_0xd43e('0x188')});db[_0xd43e('0x54')]['belongsTo'](db[_0xd43e('0x52')],{'onDelete':_0xd43e('0x163'),'foreignKey':_0xd43e('0x187')});db[_0xd43e('0x54')][_0xd43e('0x14a')](db[_0xd43e('0x7e')],{'onDelete':_0xd43e('0x163'),'foreignKey':_0xd43e('0x189')});db['OpenchannelApplication'][_0xd43e('0x14a')](db[_0xd43e('0x86')],{'onDelete':_0xd43e('0x163'),'foreignKey':_0xd43e('0x176')});db[_0xd43e('0x56')][_0xd43e('0x10f')](db[_0xd43e('0x58')],{'as':_0xd43e('0x156'),'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x18a')});db[_0xd43e('0x56')]['belongsTo'](db[_0xd43e('0x52')],{'as':'Account','foreignKey':_0xd43e('0x187')});db[_0xd43e('0x56')][_0xd43e('0x14a')](db[_0xd43e('0x11f')],{'as':_0xd43e('0x15e'),'foreignKey':_0xd43e('0x15f')});db['OpenchannelInteraction'][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'as':_0xd43e('0x16c'),'foreignKey':'UserId'});db[_0xd43e('0x56')]['belongsToMany'](db[_0xd43e('0x86')],{'through':_0xd43e('0x18b'),'as':_0xd43e('0x16d')});db[_0xd43e('0x56')]['belongsToMany'](db['Tag'],{'through':_0xd43e('0x18b'),'as':_0xd43e('0x16f')});db[_0xd43e('0x56')][_0xd43e('0x11c')](db['User'],{'as':_0xd43e('0x170'),'through':_0xd43e('0x129'),'foreignKey':'OpenchannelInteractionId'});db[_0xd43e('0x58')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'onDelete':_0xd43e('0x10c'),'as':_0xd43e('0x12')});db['OpenchannelMessage'][_0xd43e('0x14a')](db['CmContact'],{'onDelete':_0xd43e('0x10c'),'as':_0xd43e('0x15e')});db['OpenchannelMessage'][_0xd43e('0x14a')](db[_0xd43e('0x56')],{'onDelete':'cascade','as':_0xd43e('0x172'),'foreignKey':_0xd43e('0x18a')});db[_0xd43e('0x58')][_0xd43e('0x14a')](db[_0xd43e('0xe5')],{'as':_0xd43e('0xe5'),'foreignKey':_0xd43e('0x181')});db[_0xd43e('0x58')][_0xd43e('0x14a')](db[_0xd43e('0x52')],{'as':_0xd43e('0x173'),'foreignKey':_0xd43e('0x187')});db[_0xd43e('0x131')][_0xd43e('0x11c')](db[_0xd43e('0x12')],{'as':_0xd43e('0x152'),'through':_0xd43e('0x31'),'foreignKey':_0xd43e('0x188')});db[_0xd43e('0x131')][_0xd43e('0x11c')](db['Team'],{'through':_0xd43e('0x18c'),'as':'Teams'});db[_0xd43e('0x5b')]['hasMany'](db[_0xd43e('0x7b')],{'as':_0xd43e('0x179'),'foreignKey':_0xd43e('0x174'),'onDelete':_0xd43e('0x10c')});db[_0xd43e('0x5b')][_0xd43e('0x10f')](db['CannedAnswer'],{'as':_0xd43e('0x165'),'foreignKey':'ChatWebsiteId'});db[_0xd43e('0x5b')][_0xd43e('0x10f')](db[_0xd43e('0x18d')],{'as':_0xd43e('0x18e')});db[_0xd43e('0x5b')][_0xd43e('0x10f')](db['ChatInteraction'],{'as':_0xd43e('0x17b')});db['ChatWebsite'][_0xd43e('0x10f')](db['ChatApplication'],{'as':_0xd43e('0x13f')});db[_0xd43e('0x5b')][_0xd43e('0x10f')](db[_0xd43e('0x62')],{'as':_0xd43e('0x156')});db['ChatWebsite'][_0xd43e('0x14a')](db['CmList'],{'as':_0xd43e('0x167'),'foreignKey':'ListId'});db[_0xd43e('0x5b')]['belongsTo'](db[_0xd43e('0x7e')],{'as':_0xd43e('0x7e'),'foreignKey':_0xd43e('0x189')});db[_0xd43e('0x5b')]['belongsTo'](db[_0xd43e('0x37')],{'as':'MailAccount','foreignKey':_0xd43e('0x160')});db[_0xd43e('0x5b')][_0xd43e('0x14a')](db[_0xd43e('0x80')],{'as':_0xd43e('0x14f'),'foreignKey':_0xd43e('0x150')});db[_0xd43e('0x5b')][_0xd43e('0x11c')](db[_0xd43e('0x12')],{'as':_0xd43e('0x152'),'through':_0xd43e('0x136')});db[_0xd43e('0x5d')][_0xd43e('0x14a')](db[_0xd43e('0x52')],{});db['OpenchannelQueueReport'][_0xd43e('0x14a')](db[_0xd43e('0xef')],{'as':_0xd43e('0x167'),'foreignKey':_0xd43e('0x168')});db['OpenchannelQueueReport'][_0xd43e('0x14a')](db['CmContact'],{'as':_0xd43e('0x15e'),'foreignKey':_0xd43e('0x15f')});db[_0xd43e('0x5d')]['belongsTo'](db[_0xd43e('0x56')],{});db[_0xd43e('0x5d')][_0xd43e('0x14a')](db['OpenchannelMessage'],{});db[_0xd43e('0x5d')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{});db[_0xd43e('0x5d')][_0xd43e('0x14a')](db[_0xd43e('0x131')],{});db[_0xd43e('0x5e')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'as':_0xd43e('0x18f'),'foreignKey':_0xd43e('0x10d'),'onDelete':'restrict'});db[_0xd43e('0x5e')][_0xd43e('0x14a')](db[_0xd43e('0x66')],{'as':_0xd43e('0x190'),'foreignKey':_0xd43e('0x191'),'onDelete':_0xd43e('0x163')});db[_0xd43e('0x5e')][_0xd43e('0x14a')](db[_0xd43e('0x5b')],{'as':_0xd43e('0x192'),'foreignKey':_0xd43e('0x174'),'onDelete':_0xd43e('0x163')});db[_0xd43e('0x5e')][_0xd43e('0x14a')](db[_0xd43e('0x86')],{'onDelete':_0xd43e('0x163'),'foreignKey':_0xd43e('0x176')});db['ChatInteraction'][_0xd43e('0x10f')](db[_0xd43e('0x62')],{'as':'Messages','onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x193')});db[_0xd43e('0x60')][_0xd43e('0x14a')](db['ChatWebsite'],{'as':_0xd43e('0x173'),'foreignKey':'ChatWebsiteId'});db[_0xd43e('0x60')][_0xd43e('0x14a')](db[_0xd43e('0x11f')],{'as':_0xd43e('0x15e'),'foreignKey':_0xd43e('0x15f')});db[_0xd43e('0x60')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'as':_0xd43e('0x16c'),'foreignKey':'UserId'});db['ChatInteraction'][_0xd43e('0x11c')](db['Tag'],{'through':_0xd43e('0x194'),'as':_0xd43e('0x16d')});db[_0xd43e('0x60')][_0xd43e('0x11c')](db[_0xd43e('0x86')],{'through':'chat_interaction_has_tags','as':_0xd43e('0x16f')});db[_0xd43e('0x60')][_0xd43e('0x11c')](db[_0xd43e('0x12')],{'as':'Users','through':_0xd43e('0x126'),'foreignKey':_0xd43e('0x193')});db[_0xd43e('0x62')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'onDelete':_0xd43e('0x10c'),'as':'User'});db['ChatMessage']['belongsTo'](db[_0xd43e('0x11f')],{'onDelete':'cascade','as':'Contact','foreignKey':_0xd43e('0x15f')});db[_0xd43e('0x62')][_0xd43e('0x14a')](db[_0xd43e('0x60')],{'onDelete':_0xd43e('0x10c'),'as':'Interaction','foreignKey':'ChatInteractionId'});db[_0xd43e('0x62')][_0xd43e('0x14a')](db[_0xd43e('0xe5')],{'as':_0xd43e('0xe5'),'foreignKey':'AttachmentId'});db[_0xd43e('0x62')][_0xd43e('0x14a')](db[_0xd43e('0x5b')],{'as':'Account','foreignKey':_0xd43e('0x174')});db['ChatOfflineMessage'][_0xd43e('0x10f')](db[_0xd43e('0xe5')],{'as':'Attachments','foreignKey':_0xd43e('0x175'),'onDelete':'cascade','hooks':!![]});db[_0xd43e('0x64')]['belongsTo'](db[_0xd43e('0x11f')],{'onDelete':_0xd43e('0x10c'),'as':_0xd43e('0x15e'),'foreignKey':'ContactId'});db[_0xd43e('0x64')][_0xd43e('0x14a')](db[_0xd43e('0x5b')],{'as':_0xd43e('0x173'),'foreignKey':'ChatWebsiteId'});db['ChatQueue'][_0xd43e('0x11c')](db[_0xd43e('0x12')],{'as':_0xd43e('0x152'),'through':_0xd43e('0x2b'),'hooks':!![]});db[_0xd43e('0x66')][_0xd43e('0x11c')](db['Team'],{'through':'team_has_chat_queues','as':_0xd43e('0x153')});db['ChatGroup'][_0xd43e('0x10f')](db[_0xd43e('0xce')],{'as':_0xd43e('0x156'),'foreignKey':_0xd43e('0x195'),'onDelete':'cascade'});db[_0xd43e('0x68')][_0xd43e('0x11c')](db[_0xd43e('0x12')],{'as':'Members','through':'chat_group_has_users'});db[_0xd43e('0x18d')][_0xd43e('0x14a')](db[_0xd43e('0x5b')],{'as':_0xd43e('0x192'),'foreignKey':_0xd43e('0x174')});db[_0xd43e('0x6a')][_0xd43e('0x10f')](db[_0xd43e('0x11f')],{'as':'Contacts','foreignKey':_0xd43e('0x196')});db[_0xd43e('0x11f')]['hasMany'](db[_0xd43e('0x197')],{'as':_0xd43e('0x198'),'foreignKey':_0xd43e('0x199')});db[_0xd43e('0x11f')][_0xd43e('0x10f')](db[_0xd43e('0x6d')],{'as':_0xd43e('0x143'),'foreignKey':_0xd43e('0x15f')});db[_0xd43e('0x11f')][_0xd43e('0x10f')](db[_0xd43e('0x71')],{'as':_0xd43e('0x144'),'foreignKey':'ContactId'});db[_0xd43e('0x11f')][_0xd43e('0x10f')](db[_0xd43e('0x146')],{'as':'HopperHistories','foreignKey':_0xd43e('0x15f')});db[_0xd43e('0x11f')][_0xd43e('0x10f')](db[_0xd43e('0x73')],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db[_0xd43e('0x11f')][_0xd43e('0x10f')](db[_0xd43e('0x148')],{'as':_0xd43e('0x149'),'foreignKey':_0xd43e('0x15f')});db[_0xd43e('0x11f')][_0xd43e('0x10f')](db[_0xd43e('0x56')],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0xd43e('0x163')});db[_0xd43e('0x11f')]['hasMany'](db[_0xd43e('0x60')],{'as':'ChatInteractions','foreignKey':_0xd43e('0x15f'),'onDelete':'restrict'});db['CmContact'][_0xd43e('0x10f')](db[_0xd43e('0x4e')],{'as':_0xd43e('0x115'),'foreignKey':_0xd43e('0x15f'),'onDelete':_0xd43e('0x163')});db[_0xd43e('0x11f')]['hasMany'](db['FaxInteraction'],{'as':_0xd43e('0x127'),'foreignKey':'ContactId','onDelete':_0xd43e('0x163')});db[_0xd43e('0x11f')]['hasMany'](db[_0xd43e('0x3c')],{'as':_0xd43e('0x117'),'foreignKey':'ContactId','onDelete':_0xd43e('0x163')});db[_0xd43e('0x11f')]['belongsTo'](db[_0xd43e('0x6a')],{'as':'Company','foreignKey':_0xd43e('0x196')});db[_0xd43e('0x11f')][_0xd43e('0x14a')](db['CmList'],{'as':_0xd43e('0x167'),'foreignKey':_0xd43e('0x168'),'onDelete':_0xd43e('0x10c')});db['CmContact'][_0xd43e('0x11c')](db[_0xd43e('0x12')],{'as':_0xd43e('0x170'),'through':'cm_user_has_contacts'});db[_0xd43e('0x11f')]['belongsToMany'](db[_0xd43e('0x86')],{'as':_0xd43e('0x16d'),'through':'cm_contact_has_tags'});db['CmContact'][_0xd43e('0x11c')](db['Tag'],{'through':'cm_contact_has_tags','as':_0xd43e('0x16f')});db[_0xd43e('0x6d')][_0xd43e('0x10f')](db['CmHopperAdditionalPhone'],{'as':'AdditionalPhones','foreignKey':_0xd43e('0x19a')});db['CmHopper'][_0xd43e('0x14a')](db['CmContact'],{'as':_0xd43e('0x15e'),'foreignKey':_0xd43e('0x15f'),'onDelete':_0xd43e('0x10c')});db[_0xd43e('0x6d')][_0xd43e('0x14a')](db[_0xd43e('0xef')],{'as':_0xd43e('0x167'),'foreignKey':'ListId','onDelete':_0xd43e('0x10c')});db[_0xd43e('0x6d')][_0xd43e('0x14a')](db['User'],{'as':_0xd43e('0x18f'),'foreignKey':_0xd43e('0x10d')});db['CmHopper']['belongsTo'](db[_0xd43e('0x12b')],{'as':_0xd43e('0x190'),'foreignKey':_0xd43e('0x145'),'onDelete':_0xd43e('0x10c')});db[_0xd43e('0x6d')][_0xd43e('0x14a')](db[_0xd43e('0xe2')],{'as':_0xd43e('0xe2'),'foreignKey':'CampaignId','onDelete':_0xd43e('0x10c')});db[_0xd43e('0x6d')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'as':_0xd43e('0x16c'),'foreignKey':_0xd43e('0x19b')});db[_0xd43e('0x6f')][_0xd43e('0x14a')](db[_0xd43e('0x11f')],{'as':_0xd43e('0x15e'),'foreignKey':_0xd43e('0x15f'),'onDelete':_0xd43e('0x10c')});db[_0xd43e('0x6f')]['belongsTo'](db['CmList'],{'as':_0xd43e('0x167'),'foreignKey':_0xd43e('0x168'),'onDelete':_0xd43e('0x10c')});db[_0xd43e('0x6f')][_0xd43e('0x14a')](db['VoiceQueue'],{'as':'Queue','foreignKey':_0xd43e('0x145'),'onDelete':_0xd43e('0x10c')});db['CmHopperBlack'][_0xd43e('0x14a')](db[_0xd43e('0xe2')],{'as':'Campaign','foreignKey':_0xd43e('0x19c'),'onDelete':_0xd43e('0x10c')});db[_0xd43e('0x79')]['hasMany'](db[_0xd43e('0x7c')],{'as':{'plural':_0xd43e('0x19d'),'singular':'OneAll'},'foreignKey':_0xd43e('0x19e'),'onDelete':_0xd43e('0x10c'),'hooks':!![]});db[_0xd43e('0x79')][_0xd43e('0x10f')](db[_0xd43e('0x7c')],{'as':{'plural':'Any','singular':'OneAny'},'foreignKey':'AutomationAnyId','onDelete':'cascade','hooks':!![]});db['Automation'][_0xd43e('0x10f')](db[_0xd43e('0x77')],{'as':_0xd43e('0x19f'),'foreignKey':_0xd43e('0x1a0'),'onDelete':'cascade','hooks':!![]});db[_0xd43e('0x7b')][_0xd43e('0x10f')](db[_0xd43e('0x7b')],{'as':'Dispositions','foreignKey':_0xd43e('0x1a1'),'onDelete':'cascade'});db[_0xd43e('0x7e')]['hasMany'](db['Interval'],{'as':_0xd43e('0x1a2'),'foreignKey':_0xd43e('0x189'),'onDelete':_0xd43e('0x10c'),'hooks':!![],'required':![]});db[_0xd43e('0x7e')][_0xd43e('0x10f')](db[_0xd43e('0x112')],{'as':'Extensions','foreignKey':_0xd43e('0x189'),'onDelete':_0xd43e('0x163')});db['Interval'][_0xd43e('0x10f')](db[_0xd43e('0x166')],{'as':'MailApplications','foreignKey':_0xd43e('0x189')});db[_0xd43e('0x7e')][_0xd43e('0x10f')](db['ChatApplication'],{'as':'ChatApplications','foreignKey':_0xd43e('0x189')});db[_0xd43e('0x7e')][_0xd43e('0x10f')](db['FaxApplication'],{'as':_0xd43e('0x1a3'),'foreignKey':'IntervalId'});db[_0xd43e('0x7e')]['hasMany'](db['SmsApplication'],{'as':_0xd43e('0x1a4'),'foreignKey':_0xd43e('0x189')});db[_0xd43e('0x84')][_0xd43e('0x14a')](db[_0xd43e('0x37')],{});db[_0xd43e('0x84')][_0xd43e('0x14a')](db[_0xd43e('0x96')],{'foreignKey':_0xd43e('0x1a5')});db[_0xd43e('0x84')][_0xd43e('0x14a')](db[_0xd43e('0x1a6')],{'foreignKey':_0xd43e('0x1a7')});db[_0xd43e('0x140')]['belongsToMany'](db[_0xd43e('0x18')],{'as':_0xd43e('0x1a8'),'through':_0xd43e('0x142'),'onDelete':_0xd43e('0x163')});db[_0xd43e('0x86')][_0xd43e('0x11c')](db[_0xd43e('0x11f')],{'through':'cm_contact_has_tags'});db['Tag'][_0xd43e('0x11c')](db[_0xd43e('0x60')],{'through':_0xd43e('0x194')});db[_0xd43e('0x86')][_0xd43e('0x11c')](db[_0xd43e('0x3c')],{'through':'mail_interaction_has_tags'});db[_0xd43e('0x86')][_0xd43e('0x11c')](db[_0xd43e('0x4e')],{'through':_0xd43e('0x185')});db[_0xd43e('0x86')][_0xd43e('0x11c')](db[_0xd43e('0x116')],{'through':_0xd43e('0x17f')});db[_0xd43e('0x86')]['belongsToMany'](db[_0xd43e('0x56')],{'through':_0xd43e('0x18b')});db[_0xd43e('0x86')][_0xd43e('0x11c')](db[_0xd43e('0xfb')],{'through':_0xd43e('0x1a9')});db[_0xd43e('0x197')][_0xd43e('0x14a')](db[_0xd43e('0x87')],{'as':_0xd43e('0x1aa'),'foreignKey':_0xd43e('0x1ab')});db[_0xd43e('0x8a')][_0xd43e('0x14a')](db[_0xd43e('0x6d')],{'as':_0xd43e('0x1ac'),'foreignKey':'CmHopperId'});db['CmContactHasItem'][_0xd43e('0x14a')](db[_0xd43e('0x11f')],{'as':_0xd43e('0x15e'),'foreignKey':'CmContactId'});db[_0xd43e('0x8d')][_0xd43e('0x10f')](db[_0xd43e('0x7c')],{'as':{'plural':_0xd43e('0x1ad'),'singular':_0xd43e('0x1ae')},'foreignKey':_0xd43e('0x1af'),'onDelete':_0xd43e('0x10c'),'hooks':!![]});db['Trigger'][_0xd43e('0x10f')](db[_0xd43e('0x7c')],{'as':{'plural':_0xd43e('0x1b0'),'singular':_0xd43e('0x1b1')},'foreignKey':_0xd43e('0x1b2'),'onDelete':'cascade','hooks':!![]});db[_0xd43e('0x8d')][_0xd43e('0x10f')](db[_0xd43e('0x77')],{'as':_0xd43e('0x19f'),'foreignKey':_0xd43e('0x1b3'),'onDelete':_0xd43e('0x10c'),'hooks':!![]});db[_0xd43e('0x1a6')][_0xd43e('0x10f')](db[_0xd43e('0x1b4')],{'as':_0xd43e('0x1b5'),'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1a7'),'hooks':!![]});db['AnalyticDefaultReport'][_0xd43e('0x10f')](db[_0xd43e('0x1b4')],{'as':_0xd43e('0x1b5'),'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1a5')});db[_0xd43e('0x1b6')][_0xd43e('0x10f')](db['AnalyticFieldReport'],{'as':_0xd43e('0x1b5'),'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1b7')});db['AnalyticFieldReport'][_0xd43e('0x14a')](db[_0xd43e('0x1b6')],{'foreignKey':_0xd43e('0x1b7')});db[_0xd43e('0x9c')][_0xd43e('0x10f')](db[_0xd43e('0x9e')],{'as':_0xd43e('0x1b8'),'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1b9')});db['SalesforceConfiguration'][_0xd43e('0x10f')](db['SalesforceField'],{'as':_0xd43e('0x1ba'),'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1bb')});db['SalesforceConfiguration'][_0xd43e('0x10f')](db[_0xd43e('0xa0')],{'as':'Descriptions','onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1bc')});db[_0xd43e('0x9e')][_0xd43e('0x10f')](db[_0xd43e('0xa0')],{'as':_0xd43e('0x1b5'),'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1bd')});db['SalesforceConfiguration'][_0xd43e('0x14a')](db['SalesforceAccount'],{'as':'Account','foreignKey':'AccountId'});db[_0xd43e('0xa0')][_0xd43e('0x10f')](db[_0xd43e('0xa0')],{'as':_0xd43e('0x1be'),'foreignKey':_0xd43e('0x1bb')});db[_0xd43e('0xa0')]['hasMany'](db['SalesforceField'],{'as':'Description','foreignKey':_0xd43e('0x1bc')});db[_0xd43e('0xa0')]['hasMany'](db[_0xd43e('0xa0')],{'as':_0xd43e('0x1bf'),'foreignKey':_0xd43e('0x1bd')});db[_0xd43e('0xa0')]['belongsTo'](db['Variable'],{'as':_0xd43e('0x8f'),'foreignKey':_0xd43e('0x1c0')});db['SugarcrmAccount'][_0xd43e('0x10f')](db[_0xd43e('0xa4')],{'as':_0xd43e('0x1b8'),'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1b9')});db[_0xd43e('0xa4')]['hasMany'](db['SugarcrmField'],{'as':'Subjects','onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1bb')});db[_0xd43e('0xa4')][_0xd43e('0x10f')](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1bc')});db[_0xd43e('0xa4')][_0xd43e('0x10f')](db[_0xd43e('0xa6')],{'as':_0xd43e('0x1b5'),'onDelete':_0xd43e('0x10c'),'foreignKey':'FieldId'});db['SugarcrmConfiguration'][_0xd43e('0x14a')](db[_0xd43e('0xa2')],{'as':'Account','foreignKey':_0xd43e('0x1b9')});db['SugarcrmField'][_0xd43e('0x10f')](db['SugarcrmField'],{'as':_0xd43e('0x1be'),'foreignKey':_0xd43e('0x1bb')});db['SugarcrmField'][_0xd43e('0x10f')](db[_0xd43e('0xa6')],{'as':_0xd43e('0x1c1'),'foreignKey':_0xd43e('0x1bc')});db[_0xd43e('0xa6')][_0xd43e('0x10f')](db[_0xd43e('0xa6')],{'as':'Field','foreignKey':_0xd43e('0x1bd')});db[_0xd43e('0xa6')][_0xd43e('0x14a')](db[_0xd43e('0x8f')],{'as':'Variable','foreignKey':_0xd43e('0x1c0')});db[_0xd43e('0x1c2')][_0xd43e('0x10f')](db['DeskConfiguration'],{'as':_0xd43e('0x1b8'),'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1b9')});db['DeskConfiguration']['hasMany'](db[_0xd43e('0x1c3')],{'as':_0xd43e('0x1ba'),'onDelete':_0xd43e('0x10c'),'foreignKey':'SubjectId'});db[_0xd43e('0x1c4')]['hasMany'](db['DeskField'],{'as':'Descriptions','onDelete':_0xd43e('0x10c'),'foreignKey':'DescriptionId'});db[_0xd43e('0x1c4')][_0xd43e('0x10f')](db[_0xd43e('0x1c3')],{'as':_0xd43e('0x1b5'),'onDelete':'cascade','foreignKey':_0xd43e('0x1bd')});db[_0xd43e('0x1c4')][_0xd43e('0x14a')](db[_0xd43e('0x1c2')],{'as':_0xd43e('0x173'),'foreignKey':'AccountId'});db[_0xd43e('0x1c4')][_0xd43e('0x11c')](db[_0xd43e('0x86')],{'through':_0xd43e('0x1c5')});db['DeskField']['hasMany'](db['DeskField'],{'as':'Subject','foreignKey':'SubjectId'});db['DeskField']['hasMany'](db[_0xd43e('0x1c3')],{'as':_0xd43e('0x1c1'),'foreignKey':_0xd43e('0x1bc')});db[_0xd43e('0x1c3')][_0xd43e('0x10f')](db['DeskField'],{'as':_0xd43e('0x1bf'),'foreignKey':_0xd43e('0x1bd')});db[_0xd43e('0x1c3')]['belongsTo'](db[_0xd43e('0x8f')],{'as':'Variable','foreignKey':_0xd43e('0x1c0')});db[_0xd43e('0xab')][_0xd43e('0x10f')](db[_0xd43e('0x1c6')],{'as':_0xd43e('0x1b8'),'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1b9')});db[_0xd43e('0x1c6')]['hasMany'](db[_0xd43e('0xad')],{'as':_0xd43e('0x1ba'),'onDelete':'cascade','foreignKey':'SubjectId'});db['ZohoConfiguration'][_0xd43e('0x10f')](db[_0xd43e('0xad')],{'as':_0xd43e('0x1c7'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xd43e('0x1c6')]['hasMany'](db[_0xd43e('0xad')],{'as':_0xd43e('0x1b5'),'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1bd')});db[_0xd43e('0x1c6')][_0xd43e('0x14a')](db['ZohoAccount'],{'as':_0xd43e('0x173'),'foreignKey':_0xd43e('0x1b9')});db[_0xd43e('0xad')][_0xd43e('0x10f')](db['ZohoField'],{'as':_0xd43e('0x1be'),'foreignKey':_0xd43e('0x1bb')});db[_0xd43e('0xad')][_0xd43e('0x10f')](db[_0xd43e('0xad')],{'as':'Description','foreignKey':_0xd43e('0x1bc')});db[_0xd43e('0xad')][_0xd43e('0x10f')](db['ZohoField'],{'as':_0xd43e('0x1bf'),'foreignKey':_0xd43e('0x1bd')});db[_0xd43e('0xad')][_0xd43e('0x14a')](db['Variable'],{'as':_0xd43e('0x8f'),'foreignKey':_0xd43e('0x1c0')});db[_0xd43e('0xae')][_0xd43e('0x10f')](db[_0xd43e('0xaf')],{'as':_0xd43e('0x1b8'),'onDelete':'cascade','foreignKey':_0xd43e('0x1b9')});db[_0xd43e('0xaf')][_0xd43e('0x10f')](db[_0xd43e('0xb0')],{'as':'Subjects','foreignKey':_0xd43e('0x1bb')});db['ZendeskConfiguration'][_0xd43e('0x10f')](db[_0xd43e('0xb0')],{'as':_0xd43e('0x1c7'),'foreignKey':'DescriptionId'});db[_0xd43e('0xaf')]['hasMany'](db['ZendeskField'],{'as':_0xd43e('0x1b5'),'foreignKey':_0xd43e('0x1bd')});db[_0xd43e('0xaf')][_0xd43e('0x14a')](db[_0xd43e('0xae')],{'as':'Account','foreignKey':_0xd43e('0x1b9')});db[_0xd43e('0xaf')][_0xd43e('0x11c')](db[_0xd43e('0x86')],{'through':'int_zendesk_configuration_has_tags'});db[_0xd43e('0xb0')][_0xd43e('0x10f')](db['ZendeskField'],{'as':_0xd43e('0x1be'),'foreignKey':_0xd43e('0x1bb')});db[_0xd43e('0xb0')][_0xd43e('0x10f')](db[_0xd43e('0xb0')],{'as':_0xd43e('0x1c1'),'foreignKey':_0xd43e('0x1bc')});db[_0xd43e('0xb0')][_0xd43e('0x10f')](db[_0xd43e('0xb0')],{'as':'Field','foreignKey':_0xd43e('0x1bd')});db['ZendeskField'][_0xd43e('0x14a')](db[_0xd43e('0x8f')],{'as':_0xd43e('0x8f'),'foreignKey':_0xd43e('0x1c0')});db[_0xd43e('0x1c8')][_0xd43e('0x10f')](db[_0xd43e('0xb3')],{'as':_0xd43e('0x1b8'),'onDelete':'cascade','foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0xd43e('0x10f')](db[_0xd43e('0xb5')],{'as':'Subjects','onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1bb')});db['FreshdeskConfiguration'][_0xd43e('0x10f')](db[_0xd43e('0xb5')],{'as':'Descriptions','onDelete':_0xd43e('0x10c'),'foreignKey':'DescriptionId'});db['FreshdeskConfiguration'][_0xd43e('0x10f')](db[_0xd43e('0xb5')],{'as':_0xd43e('0x1b5'),'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1bd')});db[_0xd43e('0xb3')][_0xd43e('0x14a')](db[_0xd43e('0x1c8')],{'as':_0xd43e('0x173'),'foreignKey':_0xd43e('0x1b9')});db['FreshdeskConfiguration'][_0xd43e('0x11c')](db[_0xd43e('0x86')],{'through':'int_freshdesk_configuration_has_tags'});db[_0xd43e('0xb5')][_0xd43e('0x10f')](db[_0xd43e('0xb5')],{'as':_0xd43e('0x1be'),'foreignKey':_0xd43e('0x1bb')});db[_0xd43e('0xb5')]['hasMany'](db[_0xd43e('0xb5')],{'as':_0xd43e('0x1c1'),'foreignKey':_0xd43e('0x1bc')});db[_0xd43e('0xb5')][_0xd43e('0x10f')](db['FreshdeskField'],{'as':_0xd43e('0x1bf'),'foreignKey':_0xd43e('0x1bd')});db['FreshdeskField'][_0xd43e('0x14a')](db[_0xd43e('0x8f')],{'as':_0xd43e('0x8f'),'foreignKey':_0xd43e('0x1c0')});db[_0xd43e('0xb7')]['hasMany'](db['VtigerConfiguration'],{'as':'Configurations','onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1b9')});db['VtigerConfiguration'][_0xd43e('0x10f')](db['VtigerField'],{'as':_0xd43e('0x1ba'),'foreignKey':_0xd43e('0x1bb')});db['VtigerConfiguration']['hasMany'](db[_0xd43e('0xbb')],{'as':_0xd43e('0x1c7'),'foreignKey':_0xd43e('0x1bc')});db[_0xd43e('0xb9')][_0xd43e('0x10f')](db[_0xd43e('0xbb')],{'as':_0xd43e('0x1b5'),'foreignKey':'FieldId'});db[_0xd43e('0xb9')][_0xd43e('0x14a')](db['VtigerAccount'],{'as':'Account','foreignKey':_0xd43e('0x1b9')});db[_0xd43e('0xbb')]['hasMany'](db['VtigerField'],{'as':'Subject','foreignKey':_0xd43e('0x1bb')});db[_0xd43e('0xbb')][_0xd43e('0x10f')](db[_0xd43e('0xbb')],{'as':_0xd43e('0x1c1'),'foreignKey':'DescriptionId'});db[_0xd43e('0xbb')]['hasMany'](db['VtigerField'],{'as':_0xd43e('0x1bf'),'foreignKey':_0xd43e('0x1bd')});db['VtigerField'][_0xd43e('0x14a')](db[_0xd43e('0x8f')],{'as':'Variable','foreignKey':_0xd43e('0x1c0')});db['ServicenowAccount'][_0xd43e('0x10f')](db[_0xd43e('0xbe')],{'as':_0xd43e('0x1b8'),'onDelete':_0xd43e('0x10c'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0xd43e('0x10f')](db[_0xd43e('0xc0')],{'as':_0xd43e('0x1ba'),'foreignKey':_0xd43e('0x1bb')});db[_0xd43e('0xbe')][_0xd43e('0x10f')](db[_0xd43e('0xc0')],{'as':'Descriptions','foreignKey':_0xd43e('0x1bc')});db[_0xd43e('0xbe')]['hasMany'](db['ServicenowField'],{'as':_0xd43e('0x1b5'),'foreignKey':'FieldId'});db['ServicenowConfiguration'][_0xd43e('0x14a')](db['ServicenowAccount'],{'as':_0xd43e('0x173'),'foreignKey':_0xd43e('0x1b9')});db[_0xd43e('0xc0')][_0xd43e('0x10f')](db[_0xd43e('0xc0')],{'as':_0xd43e('0x1be'),'foreignKey':_0xd43e('0x1bb')});db['ServicenowField'][_0xd43e('0x10f')](db[_0xd43e('0xc0')],{'as':_0xd43e('0x1c1'),'foreignKey':_0xd43e('0x1bc')});db['ServicenowField'][_0xd43e('0x10f')](db[_0xd43e('0xc0')],{'as':'Field','foreignKey':_0xd43e('0x1bd')});db[_0xd43e('0xc0')]['belongsTo'](db[_0xd43e('0x8f')],{'as':_0xd43e('0x8f'),'foreignKey':_0xd43e('0x1c0')});db['Dynamics365Account'][_0xd43e('0x10f')](db[_0xd43e('0x1c9')],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db['Dynamics365Account'][_0xd43e('0x14a')](db['CloudProvider'],{'as':_0xd43e('0x103'),'foreignKey':_0xd43e('0x161')});db[_0xd43e('0x1c9')][_0xd43e('0x10f')](db[_0xd43e('0x1ca')],{'as':'Subjects','onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1bb')});db['Dynamics365Configuration'][_0xd43e('0x10f')](db['Dynamics365Field'],{'as':_0xd43e('0x1c7'),'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1bc')});db[_0xd43e('0x1c9')][_0xd43e('0x10f')](db['Dynamics365Field'],{'as':_0xd43e('0x1b5'),'onDelete':'cascade','foreignKey':'FieldId'});db['Dynamics365Configuration'][_0xd43e('0x14a')](db[_0xd43e('0xc2')],{'as':'Account','foreignKey':_0xd43e('0x1b9')});db[_0xd43e('0x1ca')][_0xd43e('0x10f')](db[_0xd43e('0x1ca')],{'as':'Subject','foreignKey':_0xd43e('0x1bb')});db[_0xd43e('0x1ca')][_0xd43e('0x10f')](db[_0xd43e('0x1ca')],{'as':_0xd43e('0x1c1'),'foreignKey':_0xd43e('0x1bc')});db[_0xd43e('0x1ca')]['hasMany'](db[_0xd43e('0x1ca')],{'as':_0xd43e('0x1bf'),'foreignKey':_0xd43e('0x1bd')});db[_0xd43e('0x1ca')]['belongsTo'](db[_0xd43e('0x8f')],{'as':_0xd43e('0x8f'),'foreignKey':_0xd43e('0x1c0')});db[_0xd43e('0x1cb')][_0xd43e('0x10f')](db[_0xd43e('0xc7')],{'as':_0xd43e('0x1b8'),'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1b9')});db['FreshsalesConfiguration']['hasMany'](db['FreshsalesField'],{'as':_0xd43e('0x1ba'),'foreignKey':_0xd43e('0x1bb')});db['FreshsalesConfiguration']['hasMany'](db[_0xd43e('0xc8')],{'as':_0xd43e('0x1c7'),'foreignKey':_0xd43e('0x1bc')});db['FreshsalesConfiguration'][_0xd43e('0x10f')](db[_0xd43e('0xc8')],{'as':'Fields','foreignKey':_0xd43e('0x1bd')});db['FreshsalesConfiguration']['belongsTo'](db[_0xd43e('0x1cb')],{'as':_0xd43e('0x173'),'foreignKey':_0xd43e('0x1b9')});db['FreshsalesField'][_0xd43e('0x10f')](db['FreshsalesField'],{'as':_0xd43e('0x1be'),'foreignKey':_0xd43e('0x1bb')});db[_0xd43e('0xc8')][_0xd43e('0x10f')](db[_0xd43e('0xc8')],{'as':'Description','foreignKey':_0xd43e('0x1bc')});db['FreshsalesField'][_0xd43e('0x10f')](db['FreshsalesField'],{'as':_0xd43e('0x1bf'),'foreignKey':_0xd43e('0x1bd')});db[_0xd43e('0xc8')][_0xd43e('0x14a')](db[_0xd43e('0x8f')],{'as':_0xd43e('0x8f'),'foreignKey':_0xd43e('0x1c0')});db[_0xd43e('0xcc')][_0xd43e('0x14a')](db[_0xd43e('0x5b')],{});db[_0xd43e('0xcc')]['belongsTo'](db[_0xd43e('0xef')],{'as':'List','foreignKey':_0xd43e('0x168')});db['ChatQueueReport'][_0xd43e('0x14a')](db[_0xd43e('0x11f')],{'as':_0xd43e('0x15e'),'foreignKey':_0xd43e('0x15f')});db[_0xd43e('0xcc')][_0xd43e('0x14a')](db[_0xd43e('0x60')],{});db[_0xd43e('0xcc')][_0xd43e('0x14a')](db[_0xd43e('0x62')],{});db['ChatQueueReport'][_0xd43e('0x14a')](db['User'],{});db[_0xd43e('0xcc')][_0xd43e('0x14a')](db[_0xd43e('0x66')],{});db[_0xd43e('0xce')][_0xd43e('0x14a')](db['User'],{'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1cc')});db[_0xd43e('0xce')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1cd')});db[_0xd43e('0x148')][_0xd43e('0x10f')](db[_0xd43e('0xd1')],{'foreignKey':_0xd43e('0x1ce'),'onDelete':_0xd43e('0x10c')});db[_0xd43e('0x148')][_0xd43e('0x10f')](db[_0xd43e('0xcf')],{'foreignKey':_0xd43e('0x1ce'),'onDelete':'cascade'});db['SmsQueueReport'][_0xd43e('0x14a')](db[_0xd43e('0x4b')],{});db[_0xd43e('0xd3')]['belongsTo'](db[_0xd43e('0xef')],{'as':'List','foreignKey':_0xd43e('0x168')});db['SmsQueueReport'][_0xd43e('0x14a')](db[_0xd43e('0x11f')],{'as':_0xd43e('0x15e'),'foreignKey':_0xd43e('0x15f')});db['SmsQueueReport'][_0xd43e('0x14a')](db['SmsInteraction'],{});db[_0xd43e('0xd3')][_0xd43e('0x14a')](db[_0xd43e('0x4f')],{});db[_0xd43e('0xd3')]['belongsTo'](db[_0xd43e('0x12')],{});db[_0xd43e('0xd3')]['belongsTo'](db[_0xd43e('0x50')],{});db[_0xd43e('0xd6')][_0xd43e('0x10f')](db[_0xd43e('0x148')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0xd43e('0x10f')](db[_0xd43e('0xd1')],{'foreignKey':'ProjectId'});db[_0xd43e('0xd6')][_0xd43e('0x10f')](db[_0xd43e('0xcf')],{'foreignKey':_0xd43e('0x1cf')});db[_0xd43e('0xdf')][_0xd43e('0x11c')](db['User'],{'as':'Agents','through':'user_has_teams'});db[_0xd43e('0xdf')][_0xd43e('0x11c')](db['VoiceQueue'],{'through':_0xd43e('0x105'),'as':'VoiceQueues'});db['Team']['belongsToMany'](db[_0xd43e('0x39')],{'through':_0xd43e('0x16a'),'as':_0xd43e('0x1d0')});db[_0xd43e('0xdf')]['belongsToMany'](db[_0xd43e('0x66')],{'through':'team_has_chat_queues','as':'ChatQueues'});db[_0xd43e('0xdf')][_0xd43e('0x11c')](db['FaxQueue'],{'through':'team_has_fax_queues','as':_0xd43e('0x1d1')});db['Team'][_0xd43e('0x11c')](db[_0xd43e('0x50')],{'through':'team_has_sms_queues','as':_0xd43e('0x130')});db[_0xd43e('0xdf')][_0xd43e('0x11c')](db[_0xd43e('0x131')],{'through':_0xd43e('0x18c'),'as':_0xd43e('0x132')});db['Team']['belongsToMany'](db['WhatsappQueue'],{'through':_0xd43e('0x1d2'),'as':_0xd43e('0x134')});db[_0xd43e('0xdf')][_0xd43e('0x11c')](db[_0xd43e('0x1d3')],{'through':_0xd43e('0x107'),'as':'VoicePrefixes'});db[_0xd43e('0xe2')][_0xd43e('0x10f')](db[_0xd43e('0x6d')],{'as':_0xd43e('0x143'),'foreignKey':_0xd43e('0x19c')});db[_0xd43e('0xe2')][_0xd43e('0x10f')](db[_0xd43e('0x71')],{'as':'HopperFinals','foreignKey':'CampaignId'});db[_0xd43e('0xe2')][_0xd43e('0x10f')](db[_0xd43e('0x146')],{'as':_0xd43e('0x147'),'foreignKey':'CampaignId'});db[_0xd43e('0xe2')]['hasMany'](db[_0xd43e('0x6f')],{'as':_0xd43e('0x1d4'),'foreignKey':'CampaignId'});db[_0xd43e('0xe2')][_0xd43e('0x14a')](db[_0xd43e('0x14b')],{'as':'Trunk','foreignKey':_0xd43e('0x14c')});db['Campaign'][_0xd43e('0x14a')](db[_0xd43e('0x14b')],{'as':_0xd43e('0x14d'),'foreignKey':'TrunkBackupId'});db['Campaign'][_0xd43e('0x14a')](db[_0xd43e('0x7e')],{'as':_0xd43e('0x7e'),'foreignKey':_0xd43e('0x189')});db[_0xd43e('0xe2')]['belongsTo'](db[_0xd43e('0xdb')],{'as':'SquareProject','foreignKey':_0xd43e('0x1d5')});db[_0xd43e('0xe2')][_0xd43e('0x11c')](db[_0xd43e('0xef')],{'as':_0xd43e('0x122'),'through':'campaigns_has_cm_lists'});db[_0xd43e('0xe2')][_0xd43e('0x11c')](db[_0xd43e('0xef')],{'as':_0xd43e('0x154'),'through':_0xd43e('0x1d6')});db[_0xd43e('0xe5')][_0xd43e('0x14a')](db[_0xd43e('0x64')],{'as':_0xd43e('0x64'),'foreignKey':_0xd43e('0x175')});db[_0xd43e('0xe8')][_0xd43e('0x14a')](db[_0xd43e('0x3d')],{});db[_0xd43e('0xe8')][_0xd43e('0x14a')](db[_0xd43e('0x3c')],{});db[_0xd43e('0xe8')][_0xd43e('0x14a')](db[_0xd43e('0x37')],{'foreignKey':_0xd43e('0x1d7'),'as':'FromAccount'});db['MailTransferReport'][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'foreignKey':_0xd43e('0x1d8'),'as':_0xd43e('0x1d9')});db[_0xd43e('0xe8')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'foreignKey':'ToUserId','as':_0xd43e('0x1da')});db[_0xd43e('0xe8')]['belongsTo'](db[_0xd43e('0x39')],{'foreignKey':_0xd43e('0x1db'),'as':_0xd43e('0x1dc')});db[_0xd43e('0xe8')][_0xd43e('0x14a')](db[_0xd43e('0x37')],{'foreignKey':_0xd43e('0x1dd'),'as':_0xd43e('0x1de')});db[_0xd43e('0xea')][_0xd43e('0x14a')](db[_0xd43e('0x62')],{});db[_0xd43e('0xea')]['belongsTo'](db[_0xd43e('0x60')],{});db[_0xd43e('0xea')][_0xd43e('0x14a')](db[_0xd43e('0x5b')],{'foreignKey':_0xd43e('0x1df'),'as':'FromAccount'});db[_0xd43e('0xea')][_0xd43e('0x14a')](db['User'],{'foreignKey':'FromUserId','as':_0xd43e('0x1d9')});db[_0xd43e('0xea')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'foreignKey':_0xd43e('0x1e0'),'as':'ToAgent'});db['ChatTransferReport'][_0xd43e('0x14a')](db['ChatQueue'],{'foreignKey':_0xd43e('0x1e1'),'as':_0xd43e('0x1dc')});db[_0xd43e('0xea')][_0xd43e('0x14a')](db[_0xd43e('0x5b')],{'foreignKey':_0xd43e('0x1e2'),'as':'ToAccount'});db[_0xd43e('0xeb')][_0xd43e('0x14a')](db[_0xd43e('0x17d')],{});db[_0xd43e('0xeb')][_0xd43e('0x14a')](db[_0xd43e('0x116')],{});db[_0xd43e('0xeb')]['belongsTo'](db[_0xd43e('0x43')],{'foreignKey':_0xd43e('0x1e3'),'as':_0xd43e('0x1e4')});db[_0xd43e('0xeb')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'foreignKey':'FromUserId','as':_0xd43e('0x1d9')});db[_0xd43e('0xeb')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'foreignKey':_0xd43e('0x1e0'),'as':'ToAgent'});db[_0xd43e('0xeb')]['belongsTo'](db[_0xd43e('0x48')],{'foreignKey':_0xd43e('0x1e5'),'as':'ToQueue'});db['FaxTransferReport'][_0xd43e('0x14a')](db[_0xd43e('0x43')],{'foreignKey':_0xd43e('0x1e6'),'as':_0xd43e('0x1de')});db[_0xd43e('0x1e7')][_0xd43e('0x14a')](db['OpenchannelMessage'],{});db['OpenchannelTransferReport'][_0xd43e('0x14a')](db['OpenchannelInteraction'],{});db['OpenchannelTransferReport'][_0xd43e('0x14a')](db['OpenchannelAccount'],{'foreignKey':_0xd43e('0x1e8'),'as':'FromAccount'});db[_0xd43e('0x1e7')]['belongsTo'](db[_0xd43e('0x12')],{'foreignKey':_0xd43e('0x1d8'),'as':_0xd43e('0x1d9')});db[_0xd43e('0x1e7')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'foreignKey':'ToUserId','as':'ToAgent'});db['OpenchannelTransferReport']['belongsTo'](db['OpenchannelQueue'],{'foreignKey':_0xd43e('0x1e9'),'as':_0xd43e('0x1dc')});db[_0xd43e('0x1e7')][_0xd43e('0x14a')](db[_0xd43e('0x52')],{'foreignKey':_0xd43e('0x1ea'),'as':'ToAccount'});db[_0xd43e('0xed')][_0xd43e('0x14a')](db[_0xd43e('0x4f')],{});db[_0xd43e('0xed')]['belongsTo'](db[_0xd43e('0x4e')],{});db[_0xd43e('0xed')]['belongsTo'](db[_0xd43e('0x4b')],{'foreignKey':_0xd43e('0x1eb'),'as':_0xd43e('0x1e4')});db['SmsTransferReport'][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'foreignKey':_0xd43e('0x1d8'),'as':'FromAgent'});db['SmsTransferReport']['belongsTo'](db[_0xd43e('0x12')],{'foreignKey':'ToUserId','as':'ToAgent'});db['SmsTransferReport'][_0xd43e('0x14a')](db[_0xd43e('0x50')],{'foreignKey':'ToSmsQueueId','as':_0xd43e('0x1dc')});db[_0xd43e('0xed')][_0xd43e('0x14a')](db['SmsAccount'],{'foreignKey':_0xd43e('0x1ec'),'as':_0xd43e('0x1de')});db[_0xd43e('0xef')][_0xd43e('0x10f')](db[_0xd43e('0x7b')],{'as':_0xd43e('0x179'),'foreignKey':_0xd43e('0x168'),'onDelete':_0xd43e('0x10c')});db['CmList'][_0xd43e('0x10f')](db[_0xd43e('0x75')],{'as':_0xd43e('0x1ed'),'foreignKey':'ListId'});db[_0xd43e('0xef')][_0xd43e('0x10f')](db['CmContact'],{'as':_0xd43e('0x120'),'onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x168')});db[_0xd43e('0xef')][_0xd43e('0x10f')](db[_0xd43e('0x71')],{'as':'HopperFinals','foreignKey':_0xd43e('0x168')});db[_0xd43e('0xef')]['hasMany'](db['CmHopperHistory'],{'as':_0xd43e('0x113'),'foreignKey':_0xd43e('0x168')});db[_0xd43e('0xef')][_0xd43e('0x10f')](db[_0xd43e('0x73')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0xd43e('0xef')][_0xd43e('0x11c')](db[_0xd43e('0x12b')],{'as':_0xd43e('0x1ee'),'through':_0xd43e('0x151')});db[_0xd43e('0xef')]['belongsToMany'](db[_0xd43e('0x12')],{'as':_0xd43e('0x152'),'through':_0xd43e('0x123')});db[_0xd43e('0x1d3')][_0xd43e('0x10f')](db[_0xd43e('0x112')],{'as':_0xd43e('0x1ef'),'onDelete':'cascade'});db['VoicePrefix'][_0xd43e('0x11c')](db[_0xd43e('0x12')],{'as':_0xd43e('0x152'),'through':_0xd43e('0x1f0')});db[_0xd43e('0x1d3')][_0xd43e('0x11c')](db[_0xd43e('0xdf')],{'through':_0xd43e('0x107'),'as':_0xd43e('0x153')});db[_0xd43e('0xf2')][_0xd43e('0x10f')](db[_0xd43e('0x12')],{'as':'Users','foreignKey':_0xd43e('0x11b')});db[_0xd43e('0xf2')][_0xd43e('0x10f')](db[_0xd43e('0xf3')],{'as':_0xd43e('0x1f1'),'foreignKey':_0xd43e('0x11b'),'onDelete':_0xd43e('0x10c')});db[_0xd43e('0xf3')]['hasMany'](db[_0xd43e('0x1f2')],{'as':_0xd43e('0x1f3'),'foreignKey':_0xd43e('0x1f4'),'onDelete':_0xd43e('0x10c')});db[_0xd43e('0xf7')][_0xd43e('0x10f')](db[_0xd43e('0x7b')],{'as':_0xd43e('0x179'),'foreignKey':_0xd43e('0x1f5'),'onDelete':_0xd43e('0x10c')});db[_0xd43e('0xf7')][_0xd43e('0x10f')](db[_0xd43e('0x7a')],{'as':_0xd43e('0x165'),'foreignKey':'WhatsappAccountId'});db[_0xd43e('0xf7')]['hasMany'](db[_0xd43e('0xfd')],{'as':_0xd43e('0x156'),'foreignKey':_0xd43e('0x1f5')});db[_0xd43e('0xf7')][_0xd43e('0x10f')](db['WhatsappInteraction'],{'as':_0xd43e('0x17b')});db[_0xd43e('0xf7')]['hasMany'](db[_0xd43e('0xf9')],{'as':_0xd43e('0x13f')});db[_0xd43e('0xf7')][_0xd43e('0x14a')](db[_0xd43e('0xef')],{'as':_0xd43e('0x167'),'foreignKey':'ListId'});db[_0xd43e('0xf7')][_0xd43e('0x14a')](db[_0xd43e('0x80')],{'as':_0xd43e('0x14f'),'foreignKey':'mandatoryDispositionPauseId'});db['WhatsappAccount'][_0xd43e('0x11c')](db['User'],{'as':_0xd43e('0x152'),'through':_0xd43e('0x1f6')});db[_0xd43e('0xf9')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'onDelete':'restrict'});db[_0xd43e('0xf9')][_0xd43e('0x14a')](db['WhatsappQueue'],{'onDelete':_0xd43e('0x163')});db[_0xd43e('0xf9')][_0xd43e('0x14a')](db[_0xd43e('0xf7')],{'onDelete':_0xd43e('0x163')});db[_0xd43e('0xf9')]['belongsTo'](db[_0xd43e('0x7e')],{'onDelete':_0xd43e('0x163'),'foreignKey':_0xd43e('0x189')});db[_0xd43e('0xf9')][_0xd43e('0x14a')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xd43e('0x176')});db[_0xd43e('0xfb')][_0xd43e('0x10f')](db[_0xd43e('0xfd')],{'as':'Messages','onDelete':_0xd43e('0x10c'),'foreignKey':_0xd43e('0x1f7')});db[_0xd43e('0xfb')][_0xd43e('0x14a')](db['WhatsappAccount'],{'as':_0xd43e('0x173'),'foreignKey':_0xd43e('0x1f5')});db[_0xd43e('0xfb')][_0xd43e('0x14a')](db[_0xd43e('0x11f')],{'as':_0xd43e('0x15e'),'foreignKey':_0xd43e('0x15f')});db[_0xd43e('0xfb')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'as':_0xd43e('0x16c'),'foreignKey':_0xd43e('0x10d')});db[_0xd43e('0xfb')]['belongsToMany'](db[_0xd43e('0x86')],{'through':'whatsapp_interaction_has_tags','as':_0xd43e('0x16d')});db[_0xd43e('0xfb')]['belongsToMany'](db['Tag'],{'through':_0xd43e('0x1a9'),'as':_0xd43e('0x16f')});db[_0xd43e('0xfb')]['belongsToMany'](db['User'],{'as':'Users','through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db[_0xd43e('0xfd')][_0xd43e('0x14a')](db['User'],{'as':_0xd43e('0x12')});db['WhatsappMessage'][_0xd43e('0x14a')](db[_0xd43e('0x11f')],{'onDelete':'cascade','as':_0xd43e('0x15e')});db['WhatsappMessage'][_0xd43e('0x14a')](db[_0xd43e('0xfb')],{'onDelete':_0xd43e('0x10c'),'as':_0xd43e('0x172'),'foreignKey':_0xd43e('0x1f7')});db[_0xd43e('0xfd')]['belongsTo'](db[_0xd43e('0xf7')],{'as':_0xd43e('0x173'),'foreignKey':_0xd43e('0x1f5')});db['WhatsappQueueReport'][_0xd43e('0x14a')](db['WhatsappAccount'],{});db['WhatsappQueueReport'][_0xd43e('0x14a')](db[_0xd43e('0xef')],{'as':_0xd43e('0x167'),'foreignKey':'ListId'});db[_0xd43e('0xff')][_0xd43e('0x14a')](db[_0xd43e('0x11f')],{'as':'Contact','foreignKey':_0xd43e('0x15f')});db[_0xd43e('0xff')][_0xd43e('0x14a')](db[_0xd43e('0xfb')],{});db[_0xd43e('0xff')]['belongsTo'](db[_0xd43e('0x133')],{});db[_0xd43e('0xff')]['belongsTo'](db[_0xd43e('0xfd')],{});db[_0xd43e('0xff')][_0xd43e('0x14a')](db[_0xd43e('0x12')],{});db[_0xd43e('0x100')]['belongsTo'](db[_0xd43e('0xfd')],{});db[_0xd43e('0x100')]['belongsTo'](db['WhatsappInteraction'],{});db[_0xd43e('0x100')][_0xd43e('0x14a')](db[_0xd43e('0xf7')],{'foreignKey':_0xd43e('0x1f8'),'as':_0xd43e('0x1e4')});db['WhatsappTransferReport'][_0xd43e('0x14a')](db[_0xd43e('0xf7')],{'foreignKey':_0xd43e('0x1f9'),'as':_0xd43e('0x1de')});db[_0xd43e('0x100')][_0xd43e('0x14a')](db[_0xd43e('0x133')],{'foreignKey':'ToQueueId','as':_0xd43e('0x1dc')});db['WhatsappTransferReport'][_0xd43e('0x14a')](db['User'],{'foreignKey':_0xd43e('0x1d8'),'as':_0xd43e('0x1d9')});db['WhatsappTransferReport'][_0xd43e('0x14a')](db['User'],{'foreignKey':_0xd43e('0x1e0'),'as':_0xd43e('0x1da')});db['WhatsappQueue']['belongsToMany'](db[_0xd43e('0x12')],{'as':'Agents','through':_0xd43e('0x32'),'foreignKey':_0xd43e('0x1fa')});db[_0xd43e('0x133')][_0xd43e('0x11c')](db[_0xd43e('0xdf')],{'through':_0xd43e('0x1d2'),'as':_0xd43e('0x153')});db['UserSetting'][_0xd43e('0x14a')](db[_0xd43e('0x12')],{'as':_0xd43e('0x1fb'),'foreignKey':_0xd43e('0x10d'),'onDelete':_0xd43e('0x10c'),'hooks':!![]});db[_0xd43e('0x103')][_0xd43e('0x10b')](db[_0xd43e('0xc2')],{'as':_0xd43e('0xc2'),'onDelete':_0xd43e('0x163')});db[_0xd43e('0x103')][_0xd43e('0x10b')](db[_0xd43e('0x34')],{'as':_0xd43e('0x1fc'),'onDelete':'restrict'});db['CloudProvider']['hasOne'](db[_0xd43e('0x162')],{'as':'Smtp','onDelete':_0xd43e('0x163')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 4a19da6..66dde23 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcbda=['/api/license','/api/campaigns','/api/migrations','./api/migration','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','/api/cm/lists','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/rpc','/api/version','./api/version','./api/pm2','./api/webbar','/api/logs','/apidoc','static','join','root','/demo','/snippet','3.1.0','/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','resolve','/index.html','./errors','./config/environment','./utils/client-side-logger','setupLoggers','./api/client-side-logs','then','use','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/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/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./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/chat/interactions','./api/chatInteraction','./api/chatMessage','/api/chat/offline_messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','/api/cm/contacts','./api/cmContact','./api/cmHopper','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','./api/contactItemType','/api/cm_contact_has_items','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./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/integrations/salesforce/fields','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','./api/chatInternalMessage','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcbda,0x160));var _0xacbd=function(_0x10afec,_0x8e39a9){_0x10afec=_0x10afec-0x0;var _0x515643=_0xcbda[_0x10afec];return _0x515643;};'use strict';var path=require('path');var express=require('express');var errors=require(_0xacbd('0x0'));var config=require(_0xacbd('0x1'));var setupLoggers=require(_0xacbd('0x2'))[_0xacbd('0x3')];var clientSideLogs=require(_0xacbd('0x4'));exports['default']=function(_0x4ef5fb){return setupLoggers(_0x4ef5fb)[_0xacbd('0x5')](function(){_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x7'),require(_0xacbd('0x8')));_0x4ef5fb['use'](_0xacbd('0x9'),require(_0xacbd('0xa')));_0x4ef5fb[_0xacbd('0x6')]('/api/voice/contexts',require(_0xacbd('0xb')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xc'),require(_0xacbd('0xd')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xe'),require(_0xacbd('0xf')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x10'),require(_0xacbd('0x11')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x12'),require(_0xacbd('0x13')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x14'),require(_0xacbd('0x15')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x16'),require(_0xacbd('0x17')));_0x4ef5fb['use'](_0xacbd('0x18'),require(_0xacbd('0x19')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x1a'),require(_0xacbd('0x1b')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x1c'),require(_0xacbd('0x1d')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x1e'),require(_0xacbd('0x1f')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x20'),require('./api/voiceQueueReport'));_0x4ef5fb[_0xacbd('0x6')]('/api/members/reports',require('./api/memberReport'));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x21'),require(_0xacbd('0x22')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x23'),require(_0xacbd('0x24')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x25'),require(_0xacbd('0x26')));_0x4ef5fb['use'](_0xacbd('0x27'),require(_0xacbd('0x28')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x29'),require(_0xacbd('0x2a')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x2b'),require(_0xacbd('0x2c')));_0x4ef5fb[_0xacbd('0x6')]('/api/mail/interactions',require(_0xacbd('0x2d')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x2e'),require(_0xacbd('0x2f')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x30'),require(_0xacbd('0x31')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x32'),require(_0xacbd('0x33')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x34'),require('./api/dashboard'));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x35'),require('./api/dashboardItem'));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x36'),require('./api/faxAccount'));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x37'),require(_0xacbd('0x38')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x39'),require(_0xacbd('0x3a')));_0x4ef5fb['use'](_0xacbd('0x3b'),require('./api/faxMessage'));_0x4ef5fb['use']('/api/fax/queues',require(_0xacbd('0x3c')));_0x4ef5fb['use'](_0xacbd('0x3d'),require(_0xacbd('0x3e')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x3f'),require(_0xacbd('0x40')));_0x4ef5fb['use'](_0xacbd('0x41'),require(_0xacbd('0x42')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x43'),require(_0xacbd('0x44')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x45'),require(_0xacbd('0x46')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x47'),require(_0xacbd('0x48')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x49'),require(_0xacbd('0x4a')));_0x4ef5fb[_0xacbd('0x6')]('/api/openchannel/applications',require('./api/openchannelApplication'));_0x4ef5fb[_0xacbd('0x6')]('/api/openchannel/interactions',require(_0xacbd('0x4b')));_0x4ef5fb['use'](_0xacbd('0x4c'),require(_0xacbd('0x4d')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x4e'),require(_0xacbd('0x4f')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x50'),require(_0xacbd('0x51')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x52'),require(_0xacbd('0x53')));_0x4ef5fb['use']('/api/chat/applications',require(_0xacbd('0x54')));_0x4ef5fb['use'](_0xacbd('0x55'),require(_0xacbd('0x56')));_0x4ef5fb[_0xacbd('0x6')]('/api/chat/messages',require(_0xacbd('0x57')));_0x4ef5fb['use'](_0xacbd('0x58'),require('./api/chatOfflineMessage'));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x59'),require(_0xacbd('0x5a')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x5b'),require(_0xacbd('0x5c')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x5d'),require('./api/chatProactiveAction'));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x5e'),require('./api/cmCompany'));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x5f'),require(_0xacbd('0x60')));_0x4ef5fb[_0xacbd('0x6')]('/api/cm/hopper',require(_0xacbd('0x61')));_0x4ef5fb[_0xacbd('0x6')]('/api/cm/hopper_black',require('./api/cmHopperBlack'));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x62'),require(_0xacbd('0x63')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x64'),require(_0xacbd('0x65')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x66'),require(_0xacbd('0x67')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x68'),require(_0xacbd('0x69')));_0x4ef5fb[_0xacbd('0x6')]('/api/automations',require(_0xacbd('0x6a')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x6b'),require(_0xacbd('0x6c')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x6d'),require(_0xacbd('0x6e')));_0x4ef5fb['use'](_0xacbd('0x6f'),require('./api/condition'));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x70'),require(_0xacbd('0x71')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x72'),require(_0xacbd('0x73')));_0x4ef5fb['use'](_0xacbd('0x74'),require(_0xacbd('0x75')));_0x4ef5fb['use']('/api/voiceQueuesLog',require(_0xacbd('0x76')));_0x4ef5fb[_0xacbd('0x6')]('/api/schedules',require(_0xacbd('0x77')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x78'),require(_0xacbd('0x79')));_0x4ef5fb['use'](_0xacbd('0x7a'),require(_0xacbd('0x7b')));_0x4ef5fb[_0xacbd('0x6')]('/api/contact_item_types',require(_0xacbd('0x7c')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x7d'),require('./api/cmContactHasItem'));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x7e'),require(_0xacbd('0x7f')));_0x4ef5fb[_0xacbd('0x6')]('/api/templates',require(_0xacbd('0x80')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x81'),require(_0xacbd('0x82')));_0x4ef5fb['use'](_0xacbd('0x83'),require('./api/variable'));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x84'),require(_0xacbd('0x85')));_0x4ef5fb['use'](_0xacbd('0x86'),require(_0xacbd('0x87')));_0x4ef5fb[_0xacbd('0x6')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x88'),require('./api/analyticDefaultReport'));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x89'),require(_0xacbd('0x8a')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x8b'),require(_0xacbd('0x8c')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x8d'),require(_0xacbd('0x8e')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x8f'),require(_0xacbd('0x90')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x91'),require(_0xacbd('0x92')));_0x4ef5fb['use'](_0xacbd('0x93'),require('./api/intSalesforceConfiguration'));_0x4ef5fb['use'](_0xacbd('0x94'),require('./api/intSalesforceField'));_0x4ef5fb[_0xacbd('0x6')]('/api/integrations/sugarcrm/accounts',require(_0xacbd('0x95')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x96'),require(_0xacbd('0x97')));_0x4ef5fb['use'](_0xacbd('0x98'),require(_0xacbd('0x99')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x9a'),require(_0xacbd('0x9b')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x9c'),require(_0xacbd('0x9d')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x9e'),require(_0xacbd('0x9f')));_0x4ef5fb['use']('/api/integrations/zoho/accounts',require(_0xacbd('0xa0')));_0x4ef5fb['use'](_0xacbd('0xa1'),require(_0xacbd('0xa2')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xa3'),require(_0xacbd('0xa4')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xa5'),require('./api/intZendeskAccount'));_0x4ef5fb['use']('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xa6'),require(_0xacbd('0xa7')));_0x4ef5fb[_0xacbd('0x6')]('/api/integrations/freshdesk/accounts',require(_0xacbd('0xa8')));_0x4ef5fb['use'](_0xacbd('0xa9'),require(_0xacbd('0xaa')));_0x4ef5fb['use'](_0xacbd('0xab'),require(_0xacbd('0xac')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xad'),require(_0xacbd('0xae')));_0x4ef5fb['use']('/api/integrations/vtiger/configurations',require(_0xacbd('0xaf')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xb0'),require(_0xacbd('0xb1')));_0x4ef5fb['use'](_0xacbd('0xb2'),require(_0xacbd('0xb3')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xb4'),require(_0xacbd('0xb5')));_0x4ef5fb[_0xacbd('0x6')]('/api/integrations/servicenow/fields',require(_0xacbd('0xb6')));_0x4ef5fb[_0xacbd('0x6')]('/api/integrations/dynamics365/accounts',require(_0xacbd('0xb7')));_0x4ef5fb['use'](_0xacbd('0xb8'),require(_0xacbd('0xb9')));_0x4ef5fb[_0xacbd('0x6')]('/api/integrations/dynamics365/fields',require(_0xacbd('0xba')));_0x4ef5fb['use'](_0xacbd('0xbb'),require(_0xacbd('0xbc')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xbd'),require(_0xacbd('0xbe')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xbf'),require(_0xacbd('0xc0')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xc1'),require(_0xacbd('0xc2')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xc3'),require(_0xacbd('0xc4')));_0x4ef5fb[_0xacbd('0x6')]('/api/chat/internal/messages',require(_0xacbd('0xc5')));_0x4ef5fb[_0xacbd('0x6')]('/api/jscripty/answers/reports',require(_0xacbd('0xc6')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xc7'),require(_0xacbd('0xc8')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xc9'),require(_0xacbd('0xca')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xcb'),require(_0xacbd('0xcc')));_0x4ef5fb[_0xacbd('0x6')]('/api/square/reports',require(_0xacbd('0xcd')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xce'),require(_0xacbd('0xcf')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xd0'),require(_0xacbd('0xd1')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xd2'),require(_0xacbd('0xd3')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xd4'),require('./api/squareOdbc'));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xd5'),require(_0xacbd('0xd6')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xd7'),require(_0xacbd('0xd8')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xd9'),require(_0xacbd('0xda')));_0x4ef5fb[_0xacbd('0x6')]('/api/teams',require(_0xacbd('0xdb')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xdc'),require('./api/license'));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xdd'),require('./api/campaign'));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xde'),require(_0xacbd('0xdf')));_0x4ef5fb['use']('/api/attachments',require(_0xacbd('0xe0')));_0x4ef5fb[_0xacbd('0x6')]('/api/plugins',require(_0xacbd('0xe1')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xe2'),require('./api/mailTransferReport'));_0x4ef5fb[_0xacbd('0x6')]('/api/chat/reports/transfer',require(_0xacbd('0xe3')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xe4'),require(_0xacbd('0xe5')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xe6'),require(_0xacbd('0xe7')));_0x4ef5fb[_0xacbd('0x6')]('/api/sms/reports/transfer',require(_0xacbd('0xe8')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xe9'),require('./api/cmList'));_0x4ef5fb[_0xacbd('0x6')]('/api/voice/prefixes',require(_0xacbd('0xea')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xeb'),require(_0xacbd('0xec')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xed'),require(_0xacbd('0xee')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xef'),require(_0xacbd('0xf0')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xf1'),require(_0xacbd('0xf2')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xf3'),require(_0xacbd('0xf4')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xf5'),require(_0xacbd('0xf6')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xf7'),require(_0xacbd('0xf8')));_0x4ef5fb['use'](_0xacbd('0xf9'),require('./api/whatsappMessage'));_0x4ef5fb[_0xacbd('0x6')]('/api/whatsapp/reports/queue',require(_0xacbd('0xfa')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0xfb'),require(_0xacbd('0xfc')));_0x4ef5fb['use'](_0xacbd('0xfd'),require(_0xacbd('0xfe')));_0x4ef5fb[_0xacbd('0x6')]('/api/cloudProviders',require(_0xacbd('0xff')));_0x4ef5fb[_0xacbd('0x6')]('/api/realtime',require('./api/realtime'));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x100'),require(_0xacbd('0x101')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x102'),require(_0xacbd('0x103')));_0x4ef5fb['use'](_0xacbd('0x104'),require(_0xacbd('0x105')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x106'),require(_0xacbd('0x107')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x108'),require(_0xacbd('0x109')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x10a'),require(_0xacbd('0x10b')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x10c'),require(_0xacbd('0x10d')));_0x4ef5fb['use']('/api/system',require('./api/system'));_0x4ef5fb[_0xacbd('0x6')]('/api/pm2',require(_0xacbd('0x10e')));_0x4ef5fb[_0xacbd('0x6')]('/api/webbar',require(_0xacbd('0x10f')));_0x4ef5fb['use'](_0xacbd('0x110'),clientSideLogs);_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x111'),express[_0xacbd('0x112')](path[_0xacbd('0x113')](config[_0xacbd('0x114')],_0xacbd('0x111'))));_0x4ef5fb['use']('/www',express[_0xacbd('0x112')](path[_0xacbd('0x113')](config[_0xacbd('0x114')],'/www')));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x115'),express['static'](path[_0xacbd('0x113')](config[_0xacbd('0x114')],_0xacbd('0x115'))));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x116'),express[_0xacbd('0x112')](path['join'](config['root'],'snippet',_0xacbd('0x117'))));_0x4ef5fb[_0xacbd('0x6')](_0xacbd('0x118'),express[_0xacbd('0x112')](path['join'](config[_0xacbd('0x114')],'/server/files/plugins')));_0x4ef5fb['route'](_0xacbd('0x119'))[_0xacbd('0x11a')](errors[0x194]);_0x4ef5fb[_0xacbd('0x11b')]('/*')['get'](function(_0x133f8f,_0x2e954e){_0x2e954e['sendFile'](path[_0xacbd('0x11c')](_0x4ef5fb['get']('appPath')+_0xacbd('0x11d')));});return _0x4ef5fb;});}; \ No newline at end of file +var _0x0b1d=['/api/pm2','/api/webbar','./api/webbar','/apidoc','join','root','/www','static','/demo','/snippet','snippet','3.1.0','/plugins','route','get','sendFile','resolve','appPath','/index.html','path','express','./errors','./config/environment','setupLoggers','default','use','/api/users','./api/user','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceAgentReport','/api/voice/queues/reports','./api/voiceQueueReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/interactions','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','/api/openchannel/queues','./api/openchannelQueue','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/actions','./api/automation','/api/dispositions','./api/disposition','/api/conditions','./api/condition','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','/api/contact_item_types','./api/contactItemType','/api/cm_contact_has_items','./api/cmContactHasItem','/api/cm_hopper_additional_phones','./api/cmHopperAdditionalPhone','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/desk/accounts','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','/api/plugins','./api/plugin','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','/api/whatsapp/accounts','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/realtime','./api/realtime','/api/user-settings','./api/user-setting','/api/auth/local','./api/authLocal','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system'];(function(_0x36909d,_0x2795f1){var _0x1fd29d=function(_0x27d0fa){while(--_0x27d0fa){_0x36909d['push'](_0x36909d['shift']());}};_0x1fd29d(++_0x2795f1);}(_0x0b1d,0x127));var _0xd0b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0b1d[_0x3dd15e];return _0x231fd0;};'use strict';var path=require(_0xd0b1('0x0'));var express=require(_0xd0b1('0x1'));var errors=require(_0xd0b1('0x2'));var config=require(_0xd0b1('0x3'));var setupLoggers=require('./utils/client-side-logger')[_0xd0b1('0x4')];var clientSideLogs=require('./api/client-side-logs');exports[_0xd0b1('0x5')]=function(_0x131c2e){return setupLoggers(_0x131c2e)['then'](function(){_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x7'),require(_0xd0b1('0x8')));_0x131c2e[_0xd0b1('0x6')]('/api/voice/chanspy',require('./api/voiceChanSpy'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x9'),require(_0xd0b1('0xa')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xb'),require(_0xd0b1('0xc')));_0x131c2e['use'](_0xd0b1('0xd'),require(_0xd0b1('0xe')));_0x131c2e[_0xd0b1('0x6')]('/api/voice/queues',require(_0xd0b1('0xf')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x10'),require(_0xd0b1('0x11')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x12'),require(_0xd0b1('0x13')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x14'),require(_0xd0b1('0x15')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x16'),require('./api/voiceMailMessage'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x17'),require(_0xd0b1('0x18')));_0x131c2e['use'](_0xd0b1('0x19'),require('./api/voiceDialReport'));_0x131c2e[_0xd0b1('0x6')]('/api/voice/agents/reports',require(_0xd0b1('0x1a')));_0x131c2e['use'](_0xd0b1('0x1b'),require(_0xd0b1('0x1c')));_0x131c2e[_0xd0b1('0x6')]('/api/members/reports',require('./api/memberReport'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x1d'),require(_0xd0b1('0x1e')));_0x131c2e[_0xd0b1('0x6')]('/api/voice/transfers/reports',require(_0xd0b1('0x1f')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x20'),require(_0xd0b1('0x21')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x22'),require(_0xd0b1('0x23')));_0x131c2e['use'](_0xd0b1('0x24'),require('./api/mailQueue'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x25'),require(_0xd0b1('0x26')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x27'),require(_0xd0b1('0x28')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x29'),require(_0xd0b1('0x2a')));_0x131c2e['use'](_0xd0b1('0x2b'),require(_0xd0b1('0x2c')));_0x131c2e[_0xd0b1('0x6')]('/api/mail/reports/queue',require('./api/mailQueueReport'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x2d'),require(_0xd0b1('0x2e')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x2f'),require('./api/dashboardItem'));_0x131c2e['use'](_0xd0b1('0x30'),require(_0xd0b1('0x31')));_0x131c2e[_0xd0b1('0x6')]('/api/fax/applications',require(_0xd0b1('0x32')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x33'),require(_0xd0b1('0x34')));_0x131c2e['use'](_0xd0b1('0x35'),require(_0xd0b1('0x36')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x37'),require('./api/faxQueue'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x38'),require(_0xd0b1('0x39')));_0x131c2e[_0xd0b1('0x6')]('/api/sms/accounts',require('./api/smsAccount'));_0x131c2e[_0xd0b1('0x6')]('/api/sms/applications',require('./api/smsApplication'));_0x131c2e['use'](_0xd0b1('0x3a'),require('./api/smsInteraction'));_0x131c2e['use'](_0xd0b1('0x3b'),require(_0xd0b1('0x3c')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x3d'),require('./api/smsQueue'));_0x131c2e['use']('/api/openchannel/accounts',require(_0xd0b1('0x3e')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x3f'),require(_0xd0b1('0x40')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x41'),require('./api/openchannelInteraction'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x42'),require('./api/openchannelMessage'));_0x131c2e['use'](_0xd0b1('0x43'),require(_0xd0b1('0x44')));_0x131c2e[_0xd0b1('0x6')]('/api/chat/websites',require(_0xd0b1('0x45')));_0x131c2e['use'](_0xd0b1('0x46'),require(_0xd0b1('0x47')));_0x131c2e['use'](_0xd0b1('0x48'),require(_0xd0b1('0x49')));_0x131c2e[_0xd0b1('0x6')]('/api/chat/interactions',require('./api/chatInteraction'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x4a'),require(_0xd0b1('0x4b')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x4c'),require(_0xd0b1('0x4d')));_0x131c2e['use']('/api/chat/queues',require(_0xd0b1('0x4e')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x4f'),require(_0xd0b1('0x50')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x51'),require('./api/chatProactiveAction'));_0x131c2e['use'](_0xd0b1('0x52'),require(_0xd0b1('0x53')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x54'),require(_0xd0b1('0x55')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x56'),require(_0xd0b1('0x57')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x58'),require(_0xd0b1('0x59')));_0x131c2e['use']('/api/cm/hopper_final',require(_0xd0b1('0x5a')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x5b'),require(_0xd0b1('0x5c')));_0x131c2e[_0xd0b1('0x6')]('/api/cm/custom_fields',require('./api/cmCustomField'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x5d'),require('./api/action'));_0x131c2e[_0xd0b1('0x6')]('/api/automations',require(_0xd0b1('0x5e')));_0x131c2e[_0xd0b1('0x6')]('/api/canned_answers',require('./api/cannedAnswer'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x5f'),require(_0xd0b1('0x60')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x61'),require(_0xd0b1('0x62')));_0x131c2e[_0xd0b1('0x6')]('/api/intervals',require(_0xd0b1('0x63')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x64'),require(_0xd0b1('0x65')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x66'),require(_0xd0b1('0x67')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x68'),require(_0xd0b1('0x69')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x6a'),require(_0xd0b1('0x6b')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x6c'),require(_0xd0b1('0x6d')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x6e'),require('./api/tag'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x6f'),require(_0xd0b1('0x70')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x71'),require(_0xd0b1('0x72')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x73'),require(_0xd0b1('0x74')));_0x131c2e[_0xd0b1('0x6')]('/api/templates',require('./api/template'));_0x131c2e['use']('/api/triggers',require('./api/trigger'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x75'),require(_0xd0b1('0x76')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x77'),require(_0xd0b1('0x78')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x79'),require('./api/integrationReport'));_0x131c2e[_0xd0b1('0x6')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x7a'),require('./api/analyticDefaultReport'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x7b'),require(_0xd0b1('0x7c')));_0x131c2e['use'](_0xd0b1('0x7d'),require(_0xd0b1('0x7e')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x7f'),require(_0xd0b1('0x80')));_0x131c2e[_0xd0b1('0x6')]('/api/analytics/tree_reports',require('./api/analyticTreeReport'));_0x131c2e['use'](_0xd0b1('0x81'),require(_0xd0b1('0x82')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x83'),require(_0xd0b1('0x84')));_0x131c2e[_0xd0b1('0x6')]('/api/integrations/salesforce/fields',require(_0xd0b1('0x85')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x86'),require(_0xd0b1('0x87')));_0x131c2e['use']('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x131c2e[_0xd0b1('0x6')]('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x88'),require('./api/intDeskAccount'));_0x131c2e[_0xd0b1('0x6')]('/api/integrations/desk/configurations',require(_0xd0b1('0x89')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x8a'),require(_0xd0b1('0x8b')));_0x131c2e['use'](_0xd0b1('0x8c'),require(_0xd0b1('0x8d')));_0x131c2e['use'](_0xd0b1('0x8e'),require(_0xd0b1('0x8f')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x90'),require(_0xd0b1('0x91')));_0x131c2e['use'](_0xd0b1('0x92'),require('./api/intZendeskAccount'));_0x131c2e[_0xd0b1('0x6')]('/api/integrations/zendesk/configurations',require(_0xd0b1('0x93')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x94'),require(_0xd0b1('0x95')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x96'),require(_0xd0b1('0x97')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x98'),require(_0xd0b1('0x99')));_0x131c2e['use'](_0xd0b1('0x9a'),require('./api/intFreshdeskField'));_0x131c2e[_0xd0b1('0x6')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x9b'),require('./api/intVtigerConfiguration'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x9c'),require(_0xd0b1('0x9d')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x9e'),require(_0xd0b1('0x9f')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xa0'),require(_0xd0b1('0xa1')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xa2'),require(_0xd0b1('0xa3')));_0x131c2e[_0xd0b1('0x6')]('/api/integrations/dynamics365/accounts',require(_0xd0b1('0xa4')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xa5'),require(_0xd0b1('0xa6')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xa7'),require(_0xd0b1('0xa8')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xa9'),require(_0xd0b1('0xaa')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xab'),require(_0xd0b1('0xac')));_0x131c2e['use'](_0xd0b1('0xad'),require(_0xd0b1('0xae')));_0x131c2e[_0xd0b1('0x6')]('/api/networks',require(_0xd0b1('0xaf')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xb0'),require(_0xd0b1('0xb1')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xb2'),require(_0xd0b1('0xb3')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xb4'),require(_0xd0b1('0xb5')));_0x131c2e['use']('/api/jscripty/questions/reports',require(_0xd0b1('0xb6')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xb7'),require(_0xd0b1('0xb8')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xb9'),require(_0xd0b1('0xba')));_0x131c2e['use'](_0xd0b1('0xbb'),require('./api/squareReport'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xbc'),require(_0xd0b1('0xbd')));_0x131c2e['use'](_0xd0b1('0xbe'),require(_0xd0b1('0xbf')));_0x131c2e['use'](_0xd0b1('0xc0'),require(_0xd0b1('0xc1')));_0x131c2e['use'](_0xd0b1('0xc2'),require(_0xd0b1('0xc3')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xc4'),require(_0xd0b1('0xc5')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xc6'),require(_0xd0b1('0xc7')));_0x131c2e[_0xd0b1('0x6')]('/api/square/messages',require(_0xd0b1('0xc8')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xc9'),require(_0xd0b1('0xca')));_0x131c2e[_0xd0b1('0x6')]('/api/license',require(_0xd0b1('0xcb')));_0x131c2e['use'](_0xd0b1('0xcc'),require(_0xd0b1('0xcd')));_0x131c2e['use'](_0xd0b1('0xce'),require(_0xd0b1('0xcf')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xd0'),require(_0xd0b1('0xd1')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xd2'),require(_0xd0b1('0xd3')));_0x131c2e[_0xd0b1('0x6')]('/api/mail/reports/transfer',require(_0xd0b1('0xd4')));_0x131c2e[_0xd0b1('0x6')]('/api/chat/reports/transfer',require(_0xd0b1('0xd5')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xd6'),require('./api/faxTransferReport'));_0x131c2e['use']('/api/openchannel/reports/transfer',require(_0xd0b1('0xd7')));_0x131c2e['use'](_0xd0b1('0xd8'),require(_0xd0b1('0xd9')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xda'),require(_0xd0b1('0xdb')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xdc'),require(_0xd0b1('0xdd')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xde'),require(_0xd0b1('0xdf')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xe0'),require(_0xd0b1('0xe1')));_0x131c2e['use'](_0xd0b1('0xe2'),require(_0xd0b1('0xe3')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xe4'),require('./api/userNotification'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xe5'),require('./api/whatsappAccount'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xe6'),require(_0xd0b1('0xe7')));_0x131c2e['use'](_0xd0b1('0xe8'),require('./api/whatsappInteraction'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xe9'),require(_0xd0b1('0xea')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xeb'),require(_0xd0b1('0xec')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xed'),require(_0xd0b1('0xee')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xef'),require(_0xd0b1('0xf0')));_0x131c2e['use']('/api/cloudProviders',require('./api/cloudProvider'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xf1'),require(_0xd0b1('0xf2')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xf3'),require(_0xd0b1('0xf4')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xf5'),require(_0xd0b1('0xf6')));_0x131c2e[_0xd0b1('0x6')]('/api/auth/google',require(_0xd0b1('0xf7')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xf8'),require(_0xd0b1('0xf9')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xfa'),require(_0xd0b1('0xfb')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0xfc'),require('./api/rpc'));_0x131c2e['use'](_0xd0b1('0xfd'),require(_0xd0b1('0xfe')));_0x131c2e['use'](_0xd0b1('0xff'),require(_0xd0b1('0x100')));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x101'),require('./api/pm2'));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x102'),require(_0xd0b1('0x103')));_0x131c2e['use']('/api/logs',clientSideLogs);_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x104'),express['static'](path[_0xd0b1('0x105')](config[_0xd0b1('0x106')],_0xd0b1('0x104'))));_0x131c2e['use'](_0xd0b1('0x107'),express[_0xd0b1('0x108')](path[_0xd0b1('0x105')](config[_0xd0b1('0x106')],_0xd0b1('0x107'))));_0x131c2e[_0xd0b1('0x6')]('/demo',express[_0xd0b1('0x108')](path[_0xd0b1('0x105')](config[_0xd0b1('0x106')],_0xd0b1('0x109'))));_0x131c2e['use'](_0xd0b1('0x10a'),express['static'](path[_0xd0b1('0x105')](config[_0xd0b1('0x106')],_0xd0b1('0x10b'),_0xd0b1('0x10c'))));_0x131c2e[_0xd0b1('0x6')](_0xd0b1('0x10d'),express['static'](path[_0xd0b1('0x105')](config[_0xd0b1('0x106')],'/server/files/plugins')));_0x131c2e[_0xd0b1('0x10e')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0xd0b1('0x10f')](errors[0x194]);_0x131c2e[_0xd0b1('0x10e')]('/*')[_0xd0b1('0x10f')](function(_0x120330,_0x1d741d){_0x1d741d[_0xd0b1('0x110')](path[_0xd0b1('0x111')](_0x131c2e[_0xd0b1('0x10f')](_0xd0b1('0x112'))+_0xd0b1('0x113')));});return _0x131c2e;});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 7bb90e7..08ea490 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62ad=['../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','server','http','rpc','port','error','listen','log'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x62ad,0x134));var _0xd62a=function(_0x2c71b2,_0x2faa00){_0x2c71b2=_0x2c71b2-0x0;var _0x314e32=_0x62ad[_0x2c71b2];return _0x314e32;};'use strict';var jayson=require(_0xd62a('0x0'));var _=require(_0xd62a('0x1'));var config=require('../config/environment');exports['listen']=function(){return new Promise(function(_0x15dd6c,_0x34e5f2){var _0x50efae={};_0x50efae=_['merge'](_0x50efae,require(_0xd62a('0x2')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x4')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x5')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/voiceRecording/voiceRecording.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x6')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x7')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x8')));_0x50efae=_['merge'](_0x50efae,require(_0xd62a('0x9')));_0x50efae=_['merge'](_0x50efae,require(_0xd62a('0xa')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0xb')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/mailServerIn/mailServerIn.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/mailAccount/mailAccount.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/mailQueue/mailQueue.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0xc')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0xd')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0xe')));_0x50efae=_['merge'](_0x50efae,require(_0xd62a('0xf')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x10')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x11')));_0x50efae=_['merge'](_0x50efae,require('../api/faxInteraction/faxInteraction.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/faxMessage/faxMessage.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/faxQueue/faxQueue.rpc'));_0x50efae=_['merge'](_0x50efae,require(_0xd62a('0x12')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x13')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x14')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x15')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/smsQueue/smsQueue.rpc'));_0x50efae=_['merge'](_0x50efae,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x16')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x17')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/openchannelQueue/openchannelQueue.rpc'));_0x50efae=_['merge'](_0x50efae,require(_0xd62a('0x18')));_0x50efae=_['merge'](_0x50efae,require('../api/chatInteraction/chatInteraction.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x19')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x1a')));_0x50efae=_['merge'](_0x50efae,require('../api/cmContact/cmContact.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x1b')));_0x50efae=_['merge'](_0x50efae,require(_0xd62a('0x1c')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x1d')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x1e')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/interval/interval.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x1f')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x20')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x21')));_0x50efae=_['merge'](_0x50efae,require('../api/template/template.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x22')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/variable/variable.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x23')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x24')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x25')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x26')));_0x50efae=_['merge'](_0x50efae,require(_0xd62a('0x27')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x28')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x29')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x50efae=_['merge'](_0x50efae,require(_0xd62a('0x2a')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x2b')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x2c')));_0x50efae=_['merge'](_0x50efae,require(_0xd62a('0x2d')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/squareOdbc/squareOdbc.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x2e')));_0x50efae=_['merge'](_0x50efae,require(_0xd62a('0x2f')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/squareMessage/squareMessage.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/campaign/campaign.rpc'));_0x50efae=_['merge'](_0x50efae,require('../api/attachment/attachment.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x30')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x31')));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x50efae=_[_0xd62a('0x3')](_0x50efae,require(_0xd62a('0x32')));_0x50efae=_['merge'](_0x50efae,require('../api/whatsappQueue/whatsappQueue.rpc'));var _0x23ea91=jayson[_0xd62a('0x33')](_0x50efae)[_0xd62a('0x34')]();var _0x39a119=config[_0xd62a('0x35')][_0xd62a('0x36')]||config['port']+0x1;var _0x1bb815=config[_0xd62a('0x35')]['ip']||'localhost';_0x23ea91['on'](_0xd62a('0x37'),function(_0x321342){return _0x34e5f2(_0x321342);});_0x23ea91[_0xd62a('0x38')](_0x39a119,_0x1bb815,function(){console[_0xd62a('0x39')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x1bb815,_0x39a119);require(_0xd62a('0x3a'))[_0xd62a('0x3b')]();return _0x15dd6c(_0xd62a('0x3c')+_0x1bb815+':'+_0x39a119);});});}; \ No newline at end of file +var _0x4a9e=['../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/cmHopperAdditionalPhone/cmHopperAdditionalPhone.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','localhost','error','log','../config/triggers','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc'];(function(_0x463a70,_0x13725c){var _0x3c8fe7=function(_0x32a01e){while(--_0x32a01e){_0x463a70['push'](_0x463a70['shift']());}};_0x3c8fe7(++_0x13725c);}(_0x4a9e,0x1ad));var _0xe4a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4a9e[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require(_0xe4a9('0x0'));var _=require(_0xe4a9('0x1'));var config=require(_0xe4a9('0x2'));exports[_0xe4a9('0x3')]=function(){return new Promise(function(_0x5c5cf5,_0x5875b3){var _0x5374dd={};_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x5')));_0x5374dd=_['merge'](_0x5374dd,require(_0xe4a9('0x6')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x7')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x8')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x5374dd=_['merge'](_0x5374dd,require(_0xe4a9('0x9')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x5374dd=_['merge'](_0x5374dd,require(_0xe4a9('0xa')));_0x5374dd=_['merge'](_0x5374dd,require('../api/memberReport/memberReport.rpc'));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0xb')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0xc')));_0x5374dd=_['merge'](_0x5374dd,require(_0xe4a9('0xd')));_0x5374dd=_['merge'](_0x5374dd,require(_0xe4a9('0xe')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0xf')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x10')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x11')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x12')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x13')));_0x5374dd=_['merge'](_0x5374dd,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/faxAccount/faxAccount.rpc'));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/faxApplication/faxApplication.rpc'));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/faxInteraction/faxInteraction.rpc'));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x14')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/faxQueue/faxQueue.rpc'));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x15')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x16')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/smsInteraction/smsInteraction.rpc'));_0x5374dd=_['merge'](_0x5374dd,require('../api/smsMessage/smsMessage.rpc'));_0x5374dd=_['merge'](_0x5374dd,require(_0xe4a9('0x17')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/openchannelMessage/openchannelMessage.rpc'));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x18')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x19')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x1a')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x1b')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/cmContact/cmContact.rpc'));_0x5374dd=_['merge'](_0x5374dd,require(_0xe4a9('0x1c')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x1d')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x1e')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x1f')));_0x5374dd=_['merge'](_0x5374dd,require(_0xe4a9('0x20')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x21')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x22')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x23')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x24')));_0x5374dd=_['merge'](_0x5374dd,require('../api/trigger/trigger.rpc'));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x25')));_0x5374dd=_['merge'](_0x5374dd,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x5374dd=_['merge'](_0x5374dd,require(_0xe4a9('0x26')));_0x5374dd=_['merge'](_0x5374dd,require(_0xe4a9('0x27')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x28')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x29')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x2a')));_0x5374dd=_['merge'](_0x5374dd,require(_0xe4a9('0x2b')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x2c')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x5374dd=_['merge'](_0x5374dd,require(_0xe4a9('0x2d')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/squareReport/squareReport.rpc'));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x2e')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/setting/setting.rpc'));_0x5374dd=_['merge'](_0x5374dd,require('../api/squareOdbc/squareOdbc.rpc'));_0x5374dd=_['merge'](_0x5374dd,require('../api/squareProject/squareProject.rpc'));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x2f')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x30')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/campaign/campaign.rpc'));_0x5374dd=_['merge'](_0x5374dd,require('../api/attachment/attachment.rpc'));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x31')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x32')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x33')));_0x5374dd=_[_0xe4a9('0x4')](_0x5374dd,require(_0xe4a9('0x34')));_0x5374dd=_['merge'](_0x5374dd,require(_0xe4a9('0x35')));var _0x129468=jayson[_0xe4a9('0x36')](_0x5374dd)['http']();var _0x4755b0=config[_0xe4a9('0x37')][_0xe4a9('0x38')]||config['port']+0x1;var _0x5c0345=config[_0xe4a9('0x37')]['ip']||_0xe4a9('0x39');_0x129468['on'](_0xe4a9('0x3a'),function(_0x5bea5e){return _0x5875b3(_0x5bea5e);});_0x129468[_0xe4a9('0x3')](_0x4755b0,_0x5c0345,function(){console[_0xe4a9('0x3b')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x5c0345,_0x4755b0);require(_0xe4a9('0x3c'))[_0xe4a9('0x3d')]();return _0x5c5cf5(_0xe4a9('0x3e')+_0x5c0345+':'+_0x4755b0);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 31ea8fa..d2733e3 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 _0x9f9e=['HANGUP','isBoolean','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','extension','getVariable','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','events','EventEmitter','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','no\x20code','replace','indexOf','substr','startsWith','length','match','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','pipe','command','function','destroy','inherits','prototype','sync','answer','sendRequest','ANSWER','getData','format','noop','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority'];(function(_0x2154e7,_0x195446){var _0x462859=function(_0x295899){while(--_0x295899){_0x2154e7['push'](_0x2154e7['shift']());}};_0x462859(++_0x195446);}(_0x9f9e,0x183));var _0xe9f9=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0x9f9e[_0xc6be3a];return _0x56a310;};'use strict';var util=require(_0xe9f9('0x0'));var _=require('lodash');var EventEmitter=require(_0xe9f9('0x1'))[_0xe9f9('0x2')];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x12de63){var _0x2eb0f2=this,_0x24430c=new AGIReply(),_0x5aedd3=![],_0x371dca={};EventEmitter[_0xe9f9('0x3')](_0x2eb0f2);_0x12de63[_0xe9f9('0x4')](_0xe9f9('0x5'));_0x12de63[_0xe9f9('0x6')](0x8*0x3c*0x3c*0x3e8);_0x24430c[_0xe9f9('0x4')]('utf8');_0x24430c['on'](_0xe9f9('0x7'),function(_0x34596d){for(var _0x975540 in _0x34596d){_0x2eb0f2[_0x975540]=_0x34596d[_0x975540];}_0x2eb0f2[_0xe9f9('0x8')](_0xe9f9('0x9'));});_0x24430c['on'](_0xe9f9('0xa'),function(_0x4eab89){if(_0x4eab89[_0xe9f9('0xb')]()=='hangup'){_0x2eb0f2['emit'](_0xe9f9('0xc'));return;}if(_0x4eab89[_0xe9f9('0xd')](0x0,0xb)==_0xe9f9('0xe')){_0x5aedd3=!![];}if(_0x5aedd3){_0x371dca['rx']+=_0x4eab89+'\x0a';if(_0x4eab89['search']('520\x20End\x20of\x20proper')!=-0x1){_0x5aedd3=![];}}else{_0x371dca['rx']=_0x4eab89;}if(_0x5aedd3){return;}if(typeof _0x371dca['cb']=='function'){var _0x1eee79=_0x371dca['rx'][_0xe9f9('0xd')](0x0,0x3),_0x8d616a=null,_0x5c25e9=null;_0x1eee79=parseInt(_0x1eee79);if(isNaN(_0x1eee79)){_0x371dca['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xe9f9('0xf')});return;}if(_0x1eee79!=0xc8){_0x371dca['cb'](null,{'code':_0x1eee79,'result':-0x1,'extra':'KO'});return;}_0x8d616a=_0x371dca['rx'][_0xe9f9('0xd')](0x4)[_0xe9f9('0x10')]('result=','');if(_0x8d616a[_0xe9f9('0x11')]('\x20')!=-0x1){_0x8d616a=_0x8d616a[_0xe9f9('0x12')](0x0,_0x8d616a[_0xe9f9('0x11')]('\x20'));}if(_[_0xe9f9('0x13')](_0x8d616a,'-1')){_0x8d616a=parseInt(_0x8d616a);}_0x5c25e9=_0x371dca['rx']['split']('\x20');if(_0x5c25e9[_0xe9f9('0x14')]==0x3){_0x5c25e9=_0x5c25e9[0x2][_0xe9f9('0xd')](0x1,_0x5c25e9[0x2][_0xe9f9('0x14')]-0x1);}else if(_0x5c25e9[_0xe9f9('0x14')]>0x3){var _0x21676a=/\((.+)\)/;var _0x340e3e=_0x371dca['rx'][_0xe9f9('0x15')](_0x21676a);if(_0x340e3e){_0x5c25e9=_0x340e3e[0x1];}else{_0x5c25e9=null;}}else{_0x5c25e9=null;}_0x371dca['cb'](null,{'code':_0x1eee79,'result':_0x8d616a,'extra':_0x5c25e9});}});_0x12de63['on'](_0xe9f9('0x16'),function(_0xcf72f9){_0x2eb0f2[_0xe9f9('0x8')](_0xe9f9('0x16'),new AGIError(_0xe9f9('0x17'),_0xcf72f9['code']));});_0x12de63['on'](_0xe9f9('0x18'),function(){_0x2eb0f2[_0xe9f9('0x8')](_0xe9f9('0x18'),new AGIError(_0xe9f9('0x19')));});_0x12de63['on'](_0xe9f9('0x1a'),function(){_0x2eb0f2[_0xe9f9('0x8')](_0xe9f9('0x1a'),new AGIError(_0xe9f9('0x1b')));_0x12de63['destroy']();});_0x12de63[_0xe9f9('0x1c')](_0x24430c);this[_0xe9f9('0x1d')]=function(_0x4a2408,_0x21b20c){var _0x4a2408=_0x4a2408||'',_0x21b20c=typeof _0x21b20c==_0xe9f9('0x1e')?_0x21b20c:new Function();_0x371dca={'tx':_0x4a2408,'rx':'','cb':_0x21b20c};_0x12de63['write'](_0x4a2408+'\x0a');},this['close']=function(){_0x12de63[_0xe9f9('0x1f')]();};}util[_0xe9f9('0x20')](AGIChannel,EventEmitter);AGIChannel[_0xe9f9('0x21')]['sendRequest']=function(_0x19937e){return this['command'][_0xe9f9('0x22')](this,_0x19937e);};AGIChannel[_0xe9f9('0x21')][_0xe9f9('0x23')]=function(){return this[_0xe9f9('0x24')](_0xe9f9('0x25'));};AGIChannel[_0xe9f9('0x21')][_0xe9f9('0x26')]=function(_0x4726fe,_0x3e87cb,_0x541372){_0x4726fe=_0x4726fe===undefined?'beep':_0x4726fe;_0x3e87cb=_0x3e87cb===undefined?'5':_0x3e87cb;_0x541372=_0x541372===undefined?'1':_0x541372;return this['sendRequest'](util[_0xe9f9('0x27')]('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x4726fe,_0x3e87cb*0x3e8,_0x541372));};AGIChannel[_0xe9f9('0x21')][_0xe9f9('0x28')]=function(_0x3776ad){_0x3776ad=_0x3776ad||_0xe9f9('0x29');return this[_0xe9f9('0x24')](util[_0xe9f9('0x27')]('VERBOSE\x20\x22%s\x22',_0x3776ad));};AGIChannel[_0xe9f9('0x21')][_0xe9f9('0x2a')]=function(_0x2faa66,_0x46ce50){if(_[_0xe9f9('0x2b')](_0x46ce50)){return this[_0xe9f9('0x24')](util[_0xe9f9('0x27')](_0xe9f9('0x2c'),_0x2faa66,_0x46ce50[_0xe9f9('0x2d')](',')));}return this[_0xe9f9('0x24')](util[_0xe9f9('0x27')](_0xe9f9('0x2c'),_0x2faa66,_0x46ce50));};AGIChannel[_0xe9f9('0x21')][_0xe9f9('0x2e')]=function(_0x403944){return this[_0xe9f9('0x24')](util['format'](_0xe9f9('0x2f'),_0x403944));};AGIChannel['prototype'][_0xe9f9('0x30')]=function(_0xcb108){return this['sendRequest'](util[_0xe9f9('0x27')](_0xe9f9('0x31'),_0xcb108));};AGIChannel[_0xe9f9('0x21')][_0xe9f9('0x32')]=function(_0x13709b){return this[_0xe9f9('0x24')](util[_0xe9f9('0x27')]('SET\x20PRIORITY\x20%s',_0x13709b));};AGIChannel[_0xe9f9('0x21')][_0xe9f9('0xc')]=function(){return this[_0xe9f9('0x24')](_0xe9f9('0x33'));};AGIChannel[_0xe9f9('0x21')]['setVariable']=function(_0x291b2e,_0x314450){var _0x4caaf3=_[_0xe9f9('0x34')](_0x314450)||_[_0xe9f9('0x35')](_0x314450)?_0x314450['toString']():_0x314450;return this[_0xe9f9('0x24')](util['format'](_0xe9f9('0x36'),_0x291b2e,_0x4caaf3?_0x4caaf3['toString']()[_0xe9f9('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xe9f9('0x21')][_0xe9f9('0x37')]=function(_0xef9b1f,_0x12c9b2){return this['sendRequest'](util[_0xe9f9('0x27')]('SAY\x20NUMBER\x20%s\x20%s',_0xef9b1f,_0x12c9b2));};AGIChannel[_0xe9f9('0x21')][_0xe9f9('0x38')]=function(_0xf11501,_0x39561e){return this['sendRequest'](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0xf11501,_0x39561e));};AGIChannel[_0xe9f9('0x21')][_0xe9f9('0x39')]=function(_0x5901ad,_0x1dcff2){return this['sendRequest'](util[_0xe9f9('0x27')](_0xe9f9('0x3a'),_0x5901ad,_0x1dcff2));};AGIChannel[_0xe9f9('0x21')][_0xe9f9('0x3b')]=function(_0x48b227,_0x407044,_0x4bb76a){_0x407044=_0x407044||this[_0xe9f9('0x3c')];_0x4bb76a=_0x4bb76a||0x1;this[_0xe9f9('0x2e')](_0x48b227);this['setExtension'](_0x407044);this['setPriority'](_0x4bb76a);return this[_0xe9f9('0x28')](util[_0xe9f9('0x27')]('GOTO\x20%s\x20%s\x20%s',_0x48b227,_0x407044,_0x4bb76a));};AGIChannel[_0xe9f9('0x21')][_0xe9f9('0x3d')]=function(_0x5d43fb){return this[_0xe9f9('0x24')](util['format']('GET\x20VARIABLE\x20\x22%s\x22',_0x5d43fb));};AGIChannel[_0xe9f9('0x21')][_0xe9f9('0x3e')]=function(_0x5e9824,_0x48c816,_0xb864ce,_0x22cf2e,_0x3ed1e0,_0x121e40){_0x48c816=_0x48c816||_0xe9f9('0x3f');_0xb864ce=_0xb864ce||'';_0x22cf2e=_0x22cf2e===undefined?-0x1:_0x22cf2e==='-1'?-0x1:_0x22cf2e*0x3e8;_0x3ed1e0=_0x3ed1e0===undefined?'':'s='+_0x3ed1e0;_0x121e40=_0x121e40?_0xe9f9('0x40'):'';return this[_0xe9f9('0x24')](util[_0xe9f9('0x27')](_0xe9f9('0x41'),_0x5e9824,_0x48c816,_0xb864ce,_0x22cf2e,_0x121e40,_0x3ed1e0));};AGIChannel[_0xe9f9('0x21')][_0xe9f9('0x42')]=function(_0x387513,_0x7973ac){_0x7973ac=_0x7973ac||'';return this[_0xe9f9('0x24')](util['format'](_0xe9f9('0x43'),_0x387513,_0x7973ac));};AGIChannel['prototype']['agi']=function(_0x39518a){return this[_0xe9f9('0x2a')](_0xe9f9('0x44'),_0x39518a);};AGIChannel[_0xe9f9('0x21')][_0xe9f9('0x45')]=function(_0x554e0e){return this[_0xe9f9('0x2a')](_0xe9f9('0x46'),_0x554e0e);};AGIChannel[_0xe9f9('0x21')][_0xe9f9('0x16')]=function(_0x1c6402,_0x574711){this[_0xe9f9('0x28')](util[_0xe9f9('0x27')](_0xe9f9('0x47'),_0x1c6402['id'],_0x1c6402[_0xe9f9('0x48')],_0x574711));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0xdf55=['search','520\x20End\x20of\x20proper','function','substring','no\x20code','replace','indexOf','startsWith','split','length','match','error','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','write','prototype','sendRequest','answer','ANSWER','getData','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','format','setContext','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','setVariable','isNumber','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','noop','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','EventEmitter','./reply','call','setEncoding','utf8','setTimeout','headers','emit','ready','toLowerCase','hangup'];(function(_0x2bb24a,_0x9dcdbb){var _0x3efc47=function(_0x2adb76){while(--_0x2adb76){_0x2bb24a['push'](_0x2bb24a['shift']());}};_0x3efc47(++_0x9dcdbb);}(_0xdf55,0x83));var _0x5df5=function(_0x2fb87c,_0x2dee49){_0x2fb87c=_0x2fb87c-0x0;var _0x43038b=_0xdf55[_0x2fb87c];return _0x43038b;};'use strict';var util=require(_0x5df5('0x0'));var _=require(_0x5df5('0x1'));var EventEmitter=require('events')[_0x5df5('0x2')];var AGIReply=require(_0x5df5('0x3'));var AGIError=require('./error');function AGIChannel(_0x3f503b){var _0x773e15=this,_0x381a4c=new AGIReply(),_0x521007=![],_0x289af4={};EventEmitter[_0x5df5('0x4')](_0x773e15);_0x3f503b[_0x5df5('0x5')](_0x5df5('0x6'));_0x3f503b[_0x5df5('0x7')](0x8*0x3c*0x3c*0x3e8);_0x381a4c[_0x5df5('0x5')](_0x5df5('0x6'));_0x381a4c['on'](_0x5df5('0x8'),function(_0x4d43a3){for(var _0x338f2b in _0x4d43a3){_0x773e15[_0x338f2b]=_0x4d43a3[_0x338f2b];}_0x773e15[_0x5df5('0x9')](_0x5df5('0xa'));});_0x381a4c['on']('line',function(_0x52ed26){if(_0x52ed26[_0x5df5('0xb')]()=='hangup'){_0x773e15[_0x5df5('0x9')](_0x5df5('0xc'));return;}if(_0x52ed26['substring'](0x0,0xb)=='520-Invalid'){_0x521007=!![];}if(_0x521007){_0x289af4['rx']+=_0x52ed26+'\x0a';if(_0x52ed26[_0x5df5('0xd')](_0x5df5('0xe'))!=-0x1){_0x521007=![];}}else{_0x289af4['rx']=_0x52ed26;}if(_0x521007){return;}if(typeof _0x289af4['cb']==_0x5df5('0xf')){var _0x4c3d6f=_0x289af4['rx'][_0x5df5('0x10')](0x0,0x3),_0xe8bcd8=null,_0xb4a4fe=null;_0x4c3d6f=parseInt(_0x4c3d6f);if(isNaN(_0x4c3d6f)){_0x289af4['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x5df5('0x11')});return;}if(_0x4c3d6f!=0xc8){_0x289af4['cb'](null,{'code':_0x4c3d6f,'result':-0x1,'extra':'KO'});return;}_0xe8bcd8=_0x289af4['rx'][_0x5df5('0x10')](0x4)[_0x5df5('0x12')]('result=','');if(_0xe8bcd8[_0x5df5('0x13')]('\x20')!=-0x1){_0xe8bcd8=_0xe8bcd8['substr'](0x0,_0xe8bcd8[_0x5df5('0x13')]('\x20'));}if(_[_0x5df5('0x14')](_0xe8bcd8,'-1')){_0xe8bcd8=parseInt(_0xe8bcd8);}_0xb4a4fe=_0x289af4['rx'][_0x5df5('0x15')]('\x20');if(_0xb4a4fe[_0x5df5('0x16')]==0x3){_0xb4a4fe=_0xb4a4fe[0x2][_0x5df5('0x10')](0x1,_0xb4a4fe[0x2]['length']-0x1);}else if(_0xb4a4fe[_0x5df5('0x16')]>0x3){var _0x457205=/\((.+)\)/;var _0x591a19=_0x289af4['rx'][_0x5df5('0x17')](_0x457205);if(_0x591a19){_0xb4a4fe=_0x591a19[0x1];}else{_0xb4a4fe=null;}}else{_0xb4a4fe=null;}_0x289af4['cb'](null,{'code':_0x4c3d6f,'result':_0xe8bcd8,'extra':_0xb4a4fe});}});_0x3f503b['on'](_0x5df5('0x18'),function(_0xb7e1c2){_0x773e15[_0x5df5('0x9')](_0x5df5('0x18'),new AGIError('E_AGI_SOCKET_ERROR',_0xb7e1c2['code']));});_0x3f503b['on'](_0x5df5('0x19'),function(){_0x773e15['emit'](_0x5df5('0x19'),new AGIError(_0x5df5('0x1a')));});_0x3f503b['on'](_0x5df5('0x1b'),function(){_0x773e15[_0x5df5('0x9')](_0x5df5('0x1b'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x3f503b[_0x5df5('0x1c')]();});_0x3f503b[_0x5df5('0x1d')](_0x381a4c);this[_0x5df5('0x1e')]=function(_0x34af1d,_0x28efc8){var _0x34af1d=_0x34af1d||'',_0x28efc8=typeof _0x28efc8==_0x5df5('0xf')?_0x28efc8:new Function();_0x289af4={'tx':_0x34af1d,'rx':'','cb':_0x28efc8};_0x3f503b[_0x5df5('0x1f')](_0x34af1d+'\x0a');},this[_0x5df5('0x19')]=function(){_0x3f503b[_0x5df5('0x1c')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x5df5('0x20')][_0x5df5('0x21')]=function(_0x395f3e){return this['command']['sync'](this,_0x395f3e);};AGIChannel['prototype'][_0x5df5('0x22')]=function(){return this[_0x5df5('0x21')](_0x5df5('0x23'));};AGIChannel[_0x5df5('0x20')][_0x5df5('0x24')]=function(_0x1fd83c,_0x210d20,_0x28723e){_0x1fd83c=_0x1fd83c===undefined?'beep':_0x1fd83c;_0x210d20=_0x210d20===undefined?'5':_0x210d20;_0x28723e=_0x28723e===undefined?'1':_0x28723e;return this[_0x5df5('0x21')](util['format'](_0x5df5('0x25'),_0x1fd83c,_0x210d20*0x3e8,_0x28723e));};AGIChannel[_0x5df5('0x20')]['noop']=function(_0x3854d0){_0x3854d0=_0x3854d0||'NO\x20MESSAGE';return this[_0x5df5('0x21')](util['format'](_0x5df5('0x26'),_0x3854d0));};AGIChannel['prototype'][_0x5df5('0x27')]=function(_0x5793f5,_0x2f91e3){if(_[_0x5df5('0x28')](_0x2f91e3)){return this[_0x5df5('0x21')](util['format'](_0x5df5('0x29'),_0x5793f5,_0x2f91e3[_0x5df5('0x2a')](',')));}return this[_0x5df5('0x21')](util[_0x5df5('0x2b')](_0x5df5('0x29'),_0x5793f5,_0x2f91e3));};AGIChannel[_0x5df5('0x20')][_0x5df5('0x2c')]=function(_0x5b4deb){return this['sendRequest'](util[_0x5df5('0x2b')](_0x5df5('0x2d'),_0x5b4deb));};AGIChannel[_0x5df5('0x20')][_0x5df5('0x2e')]=function(_0x20ee8a){return this[_0x5df5('0x21')](util['format'](_0x5df5('0x2f'),_0x20ee8a));};AGIChannel[_0x5df5('0x20')][_0x5df5('0x30')]=function(_0x3a6b75){return this['sendRequest'](util[_0x5df5('0x2b')]('SET\x20PRIORITY\x20%s',_0x3a6b75));};AGIChannel[_0x5df5('0x20')][_0x5df5('0xc')]=function(){return this['sendRequest'](_0x5df5('0x31'));};AGIChannel['prototype'][_0x5df5('0x32')]=function(_0x44a6d9,_0x4697c2){var _0x120eaf=_['isBoolean'](_0x4697c2)||_[_0x5df5('0x33')](_0x4697c2)?_0x4697c2[_0x5df5('0x34')]():_0x4697c2;return this[_0x5df5('0x21')](util[_0x5df5('0x2b')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x44a6d9,_0x120eaf?_0x120eaf[_0x5df5('0x34')]()[_0x5df5('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x5df5('0x20')][_0x5df5('0x35')]=function(_0x46c501,_0x47f34f){return this[_0x5df5('0x21')](util['format'](_0x5df5('0x36'),_0x46c501,_0x47f34f));};AGIChannel[_0x5df5('0x20')]['sayDigits']=function(_0x690134,_0x217844){return this['sendRequest'](util[_0x5df5('0x2b')](_0x5df5('0x37'),_0x690134,_0x217844));};AGIChannel[_0x5df5('0x20')][_0x5df5('0x38')]=function(_0x235f3e,_0x14949e){return this[_0x5df5('0x21')](util[_0x5df5('0x2b')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x235f3e,_0x14949e));};AGIChannel['prototype'][_0x5df5('0x39')]=function(_0x5b06f4,_0x2f0f06,_0x156a03){_0x2f0f06=_0x2f0f06||this['extension'];_0x156a03=_0x156a03||0x1;this[_0x5df5('0x2c')](_0x5b06f4);this[_0x5df5('0x2e')](_0x2f0f06);this[_0x5df5('0x30')](_0x156a03);return this[_0x5df5('0x3a')](util[_0x5df5('0x2b')](_0x5df5('0x3b'),_0x5b06f4,_0x2f0f06,_0x156a03));};AGIChannel[_0x5df5('0x20')][_0x5df5('0x3c')]=function(_0x5824c3){return this[_0x5df5('0x21')](util['format'](_0x5df5('0x3d'),_0x5824c3));};AGIChannel[_0x5df5('0x20')][_0x5df5('0x3e')]=function(_0x34a8ed,_0x27a11b,_0x4e4b9f,_0x191450,_0x24c1f7,_0x25915f){_0x27a11b=_0x27a11b||'wav';_0x4e4b9f=_0x4e4b9f||'';_0x191450=_0x191450===undefined?-0x1:_0x191450==='-1'?-0x1:_0x191450*0x3e8;_0x24c1f7=_0x24c1f7===undefined?'':'s='+_0x24c1f7;_0x25915f=_0x25915f?_0x5df5('0x3f'):'';return this[_0x5df5('0x21')](util['format'](_0x5df5('0x40'),_0x34a8ed,_0x27a11b,_0x4e4b9f,_0x191450,_0x25915f,_0x24c1f7));};AGIChannel[_0x5df5('0x20')][_0x5df5('0x41')]=function(_0x116ad9,_0x4de416){_0x4de416=_0x4de416||'';return this[_0x5df5('0x21')](util[_0x5df5('0x2b')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x116ad9,_0x4de416));};AGIChannel[_0x5df5('0x20')][_0x5df5('0x42')]=function(_0x35927b){return this['exec'](_0x5df5('0x43'),_0x35927b);};AGIChannel[_0x5df5('0x20')][_0x5df5('0x44')]=function(_0x2724e3){return this['exec'](_0x5df5('0x45'),_0x2724e3);};AGIChannel[_0x5df5('0x20')][_0x5df5('0x18')]=function(_0x3bbb73,_0x14f9ca){this['noop'](util['format'](_0x5df5('0x46'),_0x3bbb73['id'],_0x3bbb73['label'],_0x14f9ca));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x5df5('0x47')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 3025893..245017d 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 _0x28ea=['Missing\x20\x27ivr.entry\x27\x20menu.','push','format','apply','message','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x28ea,0x1e3));var _0xa28e=function(_0x2af3c0,_0x4a62c4){_0x2af3c0=_0x2af3c0-0x0;var _0x224762=_0x28ea[_0x2af3c0];return _0x224762;};'use strict';var util=require(_0xa28e('0x0'));var error={'E_AGI_UNDEFINED':_0xa28e('0x1'),'E_AGI_ARGUMENT_PORT':_0xa28e('0x2'),'E_AGI_SERVER_ERROR':_0xa28e('0x3'),'E_AGI_SERVER_CLOSE':_0xa28e('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0xa28e('0x5'),'E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0xa28e('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xa28e('0x7'),'E_AGI_COMMAND_EMPTY':_0xa28e('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xa28e('0x9'),'E_AGI_IVR_ENTRY':_0xa28e('0xa')};function AGIError(_0x47a953){var _0x47a953=_0x47a953||null,_0x309b9b=_0x309b9b||[],_0x3b1f32=0x1,_0xbfca40='';if(!error[_0x47a953]){_0x47a953='E_AGI_UNDEFINED';}_0x309b9b[_0xa28e('0xb')](error[_0x47a953]);while(arguments[_0x3b1f32]){_0x309b9b[_0xa28e('0xb')](arguments[_0x3b1f32]);_0x3b1f32++;}_0xbfca40=util[_0xa28e('0xc')][_0xa28e('0xd')](util,_0x309b9b);this[_0xa28e('0xe')]=_0xbfca40;this[_0xa28e('0xf')]=_0x47a953;}module[_0xa28e('0x10')]=AGIError; \ No newline at end of file +var _0xcc7a=['format','apply','message','name','exports','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.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push'];(function(_0x5e1e5e,_0x112444){var _0x140a8f=function(_0x1543ce){while(--_0x1543ce){_0x5e1e5e['push'](_0x5e1e5e['shift']());}};_0x140a8f(++_0x112444);}(_0xcc7a,0x9e));var _0xacc7=function(_0x57cc22,_0x2d351f){_0x57cc22=_0x57cc22-0x0;var _0x6f7bdc=_0xcc7a[_0x57cc22];return _0x6f7bdc;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0xacc7('0x0'),'E_AGI_SERVER_ERROR':_0xacc7('0x1'),'E_AGI_SERVER_CLOSE':_0xacc7('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0xacc7('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0xacc7('0x4'),'E_AGI_SOCKET_ERROR':_0xacc7('0x5'),'E_AGI_SOCKET_CLOSE':_0xacc7('0x6'),'E_AGI_SOCKET_TIMEOUT':_0xacc7('0x7'),'E_AGI_COMMAND_EMPTY':_0xacc7('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0xacc7('0x9')};function AGIError(_0x13c39f){var _0x13c39f=_0x13c39f||null,_0x2aa02b=_0x2aa02b||[],_0x180068=0x1,_0x1c1f28='';if(!error[_0x13c39f]){_0x13c39f=_0xacc7('0xa');}_0x2aa02b[_0xacc7('0xb')](error[_0x13c39f]);while(arguments[_0x180068]){_0x2aa02b['push'](arguments[_0x180068]);_0x180068++;}_0x1c1f28=util[_0xacc7('0xc')][_0xacc7('0xd')](util,_0x2aa02b);this[_0xacc7('0xe')]=_0x1c1f28;this[_0xacc7('0xf')]=_0x13c39f;}module[_0xacc7('0x10')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/events.js b/server/services/agi/events.js index 8a5c4e6..c0587ab 100644 --- a/server/services/agi/events.js +++ b/server/services/agi/events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x52f4=['error','E_AGI_SERVER_ERROR','message','parse','emit','projectUpdate','exports','lodash','EventEmitter','ioredis','./error','../../config/environment','redis','defaults','localhost','subscribe','agi'];(function(_0xa17335,_0x83bb89){var _0x5a4c84=function(_0x405acd){while(--_0x405acd){_0xa17335['push'](_0xa17335['shift']());}};_0x5a4c84(++_0x83bb89);}(_0x52f4,0xb1));var _0x452f=function(_0x149d1d,_0x2e15b9){_0x149d1d=_0x149d1d-0x0;var _0x56b77c=_0x52f4[_0x149d1d];return _0x56b77c;};'use strict';var _=require(_0x452f('0x0'));var EventEmitter=require('events')[_0x452f('0x1')];var Redis=require(_0x452f('0x2'));var AGIError=require(_0x452f('0x3'));var config=require(_0x452f('0x4'));config[_0x452f('0x5')]=_[_0x452f('0x6')](config[_0x452f('0x5')],{'host':_0x452f('0x7'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x452f('0x5')]);sub[_0x452f('0x8')](_0x452f('0x9'),function(_0x209127){if(_0x209127)return eventEmitter['emit'](_0x452f('0xa'),new AGIError(_0x452f('0xb'),_0x209127));});sub['on'](_0x452f('0xc'),function(_0x488b23,_0xc63685){if(_0x488b23!=='agi')return;try{var _0x2a48fd=JSON[_0x452f('0xd')](_0xc63685);eventEmitter[_0x452f('0xe')](_0x452f('0xf'),_0x2a48fd);}catch(_0x2e6428){eventEmitter[_0x452f('0xe')]('error',new AGIError(_0x452f('0xb'),_0x2e6428));}});module[_0x452f('0x10')]={'EventEmitter':eventEmitter}; \ No newline at end of file +var _0x6e35=['message','parse','projectUpdate','exports','events','EventEmitter','ioredis','../../config/environment','redis','defaults','localhost','subscribe','agi','emit','E_AGI_SERVER_ERROR'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6e35,0x7c));var _0x56e3=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x6e35[_0x45d55e];return _0x29812a;};'use strict';var _=require('lodash');var EventEmitter=require(_0x56e3('0x0'))[_0x56e3('0x1')];var Redis=require(_0x56e3('0x2'));var AGIError=require('./error');var config=require(_0x56e3('0x3'));config[_0x56e3('0x4')]=_[_0x56e3('0x5')](config[_0x56e3('0x4')],{'host':_0x56e3('0x6'),'port':0x18eb});var eventEmitter=new EventEmitter();var sub=new Redis(config[_0x56e3('0x4')]);sub[_0x56e3('0x7')](_0x56e3('0x8'),function(_0x32a144){if(_0x32a144)return eventEmitter[_0x56e3('0x9')]('error',new AGIError(_0x56e3('0xa'),_0x32a144));});sub['on'](_0x56e3('0xb'),function(_0x303946,_0x31e511){if(_0x303946!=='agi')return;try{var _0x45584b=JSON[_0x56e3('0xc')](_0x31e511);eventEmitter[_0x56e3('0x9')](_0x56e3('0xd'),_0x45584b);}catch(_0x56bafe){eventEmitter[_0x56e3('0x9')]('error',new AGIError(_0x56e3('0xa'),_0x56bafe));}});module[_0x56e3('0xe')]={'EventEmitter':eventEmitter}; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index bdb0e48..16ab5f3 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 _0xbd9b=['vertices','edges','numberOfEdges','prototype','addVertex','addEdge','size','getVertex','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','default','invalid','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits'];(function(_0x1c1b5b,_0x26ef28){var _0x568db0=function(_0x16913a){while(--_0x16913a){_0x1c1b5b['push'](_0x1c1b5b['shift']());}};_0x568db0(++_0x26ef28);}(_0xbd9b,0x1d7));var _0xbbd9=function(_0x1dfb4a,_0x30f9ec){_0x1dfb4a=_0x1dfb4a-0x0;var _0x220ed6=_0xbd9b[_0x1dfb4a];return _0x220ed6;};'use strict';var _=require(_0xbbd9('0x0'));var logger=require(_0xbbd9('0x1'))(_0xbbd9('0x2'));var verticesWithRetry=[_0xbbd9('0x3'),_0xbbd9('0x4'),'getsecretdigits'];var Graph=function(){this[_0xbbd9('0x5')]={};this[_0xbbd9('0x6')]={};this[_0xbbd9('0x7')]=0x0;};Graph[_0xbbd9('0x8')][_0xbbd9('0x9')]=function(_0x59c434){this[_0xbbd9('0x5')][_0x59c434['id']]=_0x59c434;this[_0xbbd9('0x6')][_0x59c434['id']]=[];};Graph[_0xbbd9('0x8')][_0xbbd9('0xa')]=function(_0x338b7a,_0x35ffee,_0x57fca1){this[_0xbbd9('0x6')][_0x338b7a]['push']({'target':_0x35ffee,'condition':_0x57fca1});this['numberOfEdges']+=0x1;};Graph[_0xbbd9('0x8')][_0xbbd9('0xb')]=function(){return _['size'](this[_0xbbd9('0x5')]);};Graph[_0xbbd9('0x8')]['relations']=function(){return this[_0xbbd9('0x7')];};Graph['prototype'][_0xbbd9('0xc')]=function(_0x517de1){return this['vertices'][_0x517de1];};Graph[_0xbbd9('0x8')][_0xbbd9('0xd')]=function(_0x301ef2,_0x11e243){if(!this[_0xbbd9('0x5')][_0x301ef2]){return logger[_0xbbd9('0xe')]('no\x20vertex\x20found');}var _0x4591ea=_0x11e243(this['vertices'][_0x301ef2]);if(!_0x4591ea){return logger[_0xbbd9('0xe')](_0xbbd9('0xf'));}if(this[_0xbbd9('0x6')][_0x301ef2][_0xbbd9('0x10')]===0x0){return logger[_0xbbd9('0xe')](_0xbbd9('0x11'));}for(var _0x5a66e8=0x0,_0x2320a0=[],_0x666c47=![];_0x5a66e8\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','arg_1','dnid','uniqueid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','evtHangup','createSquareReport','then','indexOf','agi_','substring','debug','variables','stringify','close','timeout','hangup','find','handleNotFound','production','handleUnpublished','initialize','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','catch','[LICENSE]','finally','./server','connection','lodash','syncho','util','../../config/environment','../../config/logger','agi','../../config/license/util','./project','./events'];(function(_0x428407,_0x4406c3){var _0x5b590d=function(_0x54d987){while(--_0x54d987){_0x428407['push'](_0x428407['shift']());}};_0x5b590d(++_0x4406c3);}(_0x31a3,0xf3));var _0x331a=function(_0x4b54fb,_0x2150e4){_0x4b54fb=_0x4b54fb-0x0;var _0x375eb4=_0x31a3[_0x4b54fb];return _0x375eb4;};'use strict';var _=require(_0x331a('0x0'));var syncho=require(_0x331a('0x1'));var util=require(_0x331a('0x2'));var config=require(_0x331a('0x3'));var logger=require(_0x331a('0x4'))(_0x331a('0x5'));var utilLicense=require(_0x331a('0x6'));var rpc=require('./rpc');var Project=require(_0x331a('0x7'));var AGIEmitter=require(_0x331a('0x8'))[_0x331a('0x9')];var projects=[];config[_0x331a('0x5')]=_[_0x331a('0xa')](config[_0x331a('0x5')],{'ip':_0x331a('0xb'),'port':0x11dd});AGIEmitter['on'](_0x331a('0xc'),projectUpdateHandler);function connectionHandler(_0x3b6f09){process[_0x331a('0xd')](function(){syncho(function(){try{setChannelVariables(_0x3b6f09);agiHandler(_0x3b6f09);}catch(_0x3c10b3){logger[_0x331a('0xe')](_0x3c10b3[_0x331a('0xf')]);}});});}function projectUpdateHandler(_0x21aeb0){try{var _0x5a4380=_[_0x331a('0x10')](projects,['id',_0x21aeb0['id']]);if(_0x5a4380>-0x1){if(_0x21aeb0['deleted']===!![]){projects[_0x331a('0x11')](_0x5a4380,0x1);}else{projects[_0x5a4380]=_0x21aeb0;}}else{projects[_0x331a('0x12')](_0x21aeb0);}}catch(_0x5860fa){logger[_0x331a('0xe')](_0x5860fa[_0x331a('0xf')]);}}function listeningHandler(){console[_0x331a('0x13')]('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x331a('0x5')][_0x331a('0x14')]);logger[_0x331a('0x15')](util[_0x331a('0x16')](_0x331a('0x17'),config[_0x331a('0x5')]['ip'],config[_0x331a('0x5')][_0x331a('0x14')]));}function errorHandler(_0x357597){if(_0x357597&&_0x357597['name']&&_0x357597[_0x331a('0x18')]){logger[_0x331a('0xe')](util['format'](_0x331a('0x19'),_0x357597[_0x331a('0x1a')],_0x357597[_0x331a('0x18')]));}else{logger['error'](util[_0x331a('0x16')](_0x331a('0x1b'),_0x357597[_0x331a('0xf')]));}}function closeHandler(){logger[_0x331a('0x15')](util['format'](_0x331a('0x1c'),this['arg_1'],this['calleridname'],this[_0x331a('0x1d')],this['dnid'],this['uniqueid']));try{createSquareReport(this);}catch(_0x38d812){logger[_0x331a('0xe')](_0x38d812[_0x331a('0xf')]);}}function timeoutHandler(){logger[_0x331a('0x15')](util[_0x331a('0x16')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x331a('0x1e')],this['calleridname'],this[_0x331a('0x1d')],this[_0x331a('0x1f')],this[_0x331a('0x20')]));}function hangupHandler(){logger[_0x331a('0x15')](util[_0x331a('0x16')](_0x331a('0x21'),this[_0x331a('0x1e')],this[_0x331a('0x22')],this['callerid'],this[_0x331a('0x1f')],this[_0x331a('0x20')]));this[_0x331a('0x23')]=!![];}function createSquareReport(_0x22769b,_0x52b755){rpc[_0x331a('0x24')](_0x22769b)[_0x331a('0x25')](function(_0xfae693){if(_0x52b755){_0x52b755(null,_0xfae693);}})['catch'](function(_0xf63e70){if(_0x52b755){_0x52b755(null,_0xf63e70);}});}function setChannelVariables(_0x83a0dd){for(var _0x12a5c6 in _0x83a0dd){if(_0x83a0dd['hasOwnProperty'](_0x12a5c6)){if(_0x12a5c6[_0x331a('0x26')](_0x331a('0x27'))===0x0){_0x83a0dd[_0x12a5c6[_0x331a('0x28')](0x4)]=_0x83a0dd[_0x12a5c6];delete _0x83a0dd[_0x12a5c6];}}}}function agiHandler(_0x2978bf){logger[_0x331a('0x29')](_0x331a('0x2a'),JSON[_0x331a('0x2b')](_0x2978bf,null,0x2));logger[_0x331a('0x15')](util[_0x331a('0x16')]('[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x2978bf[_0x331a('0x1e')],_0x2978bf[_0x331a('0x22')],_0x2978bf[_0x331a('0x1d')],_0x2978bf[_0x331a('0x1f')],_0x2978bf[_0x331a('0x20')]));_0x2978bf['on']('error',errorHandler);_0x2978bf['on'](_0x331a('0x2c'),closeHandler);_0x2978bf['on'](_0x331a('0x2d'),timeoutHandler);_0x2978bf['evtHangup']=![];_0x2978bf['on'](_0x331a('0x2e'),hangupHandler);var _0x4fca5e=_[_0x331a('0x2f')](projects,[_0x331a('0x1a'),_0x2978bf[_0x331a('0x1e')]]);if(!_0x4fca5e)return Project[_0x331a('0x30')](_0x2978bf);if(!_0x4fca5e[_0x331a('0x31')])return Project[_0x331a('0x32')](_0x2978bf);return Project[_0x331a('0x33')](_0x4fca5e,_0x2978bf);}function main(){var _0xc1a178;return utilLicense[_0x331a('0x34')]()[_0x331a('0x25')](function(_0x3b0ad8){if(!_0x3b0ad8)return;if(_0x3b0ad8[_0x331a('0x35')]){if(_0x3b0ad8[_0x331a('0x36')]&&_0x3b0ad8[_0x331a('0x36')]>0x0){logger[_0x331a('0x15')](util[_0x331a('0x16')](_0x331a('0x37'),_0x3b0ad8[_0x331a('0x36')]));_0xc1a178=_0x3b0ad8[_0x331a('0x36')];}else{logger[_0x331a('0x15')](_0x331a('0x38'));}}else{logger[_0x331a('0x15')](_0x331a('0x39'));_0xc1a178=-0x1;}})['then'](function(){return Project['getAll']();})[_0x331a('0x25')](function(_0x1ac396){projects=_0x1ac396;return;})[_0x331a('0x3a')](function(_0xa4549b){logger[_0x331a('0xe')](_0x331a('0x3b'),_0xa4549b[_0x331a('0xf')]);})[_0x331a('0x3c')](function(){var _0x3e17a1=require(_0x331a('0x3d'))(config['agi'][_0x331a('0x14')],config[_0x331a('0x5')]['ip'],_0xc1a178);_0x3e17a1['on'](_0x331a('0xe'),errorHandler);_0x3e17a1['on']('listening',listeningHandler);_0x3e17a1['on'](_0x331a('0x3e'),connectionHandler);_0x3e17a1['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x573d=['error','stack','findIndex','deleted','push','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[%s]\x20%s','[ERROR]\x20%s','info','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','createSquareReport','then','catch','hasOwnProperty','indexOf','agi_','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','find','handleNotFound','production','initialize','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','getAll','[LICENSE]','finally','listening','connection','lodash','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./events','EventEmitter','defaults','127.0.0.1','projectUpdate','nextTick'];(function(_0x2aef74,_0x193b61){var _0x1a5857=function(_0x57fdd7){while(--_0x57fdd7){_0x2aef74['push'](_0x2aef74['shift']());}};_0x1a5857(++_0x193b61);}(_0x573d,0x1dc));var _0xd573=function(_0x1a2655,_0x1eb382){_0x1a2655=_0x1a2655-0x0;var _0x4a2665=_0x573d[_0x1a2655];return _0x4a2665;};'use strict';var _=require(_0xd573('0x0'));var syncho=require('syncho');var util=require('util');var config=require(_0xd573('0x1'));var logger=require(_0xd573('0x2'))(_0xd573('0x3'));var utilLicense=require(_0xd573('0x4'));var rpc=require(_0xd573('0x5'));var Project=require('./project');var AGIEmitter=require(_0xd573('0x6'))[_0xd573('0x7')];var projects=[];config[_0xd573('0x3')]=_[_0xd573('0x8')](config[_0xd573('0x3')],{'ip':_0xd573('0x9'),'port':0x11dd});AGIEmitter['on'](_0xd573('0xa'),projectUpdateHandler);function connectionHandler(_0x4154e3){process[_0xd573('0xb')](function(){syncho(function(){try{setChannelVariables(_0x4154e3);agiHandler(_0x4154e3);}catch(_0x1a1e76){logger[_0xd573('0xc')](_0x1a1e76[_0xd573('0xd')]);}});});}function projectUpdateHandler(_0x5ec1c4){try{var _0x1fd09f=_[_0xd573('0xe')](projects,['id',_0x5ec1c4['id']]);if(_0x1fd09f>-0x1){if(_0x5ec1c4[_0xd573('0xf')]===!![]){projects['splice'](_0x1fd09f,0x1);}else{projects[_0x1fd09f]=_0x5ec1c4;}}else{projects[_0xd573('0x10')](_0x5ec1c4);}}catch(_0x377cc7){logger[_0xd573('0xc')](_0x377cc7[_0xd573('0xd')]);}}function listeningHandler(){console[_0xd573('0x11')](_0xd573('0x12'),config[_0xd573('0x3')][_0xd573('0x13')]);logger['info'](util[_0xd573('0x14')](_0xd573('0x15'),config[_0xd573('0x3')]['ip'],config[_0xd573('0x3')][_0xd573('0x13')]));}function errorHandler(_0x156ef7){if(_0x156ef7&&_0x156ef7[_0xd573('0x16')]&&_0x156ef7[_0xd573('0x17')]){logger[_0xd573('0xc')](util[_0xd573('0x14')](_0xd573('0x18'),_0x156ef7['name'],_0x156ef7[_0xd573('0x17')]));}else{logger[_0xd573('0xc')](util['format'](_0xd573('0x19'),_0x156ef7[_0xd573('0xd')]));}}function closeHandler(){logger[_0xd573('0x1a')](util[_0xd573('0x14')](_0xd573('0x1b'),this[_0xd573('0x1c')],this[_0xd573('0x1d')],this[_0xd573('0x1e')],this[_0xd573('0x1f')],this[_0xd573('0x20')]));try{createSquareReport(this);}catch(_0x344bcf){logger['error'](_0x344bcf['stack']);}}function timeoutHandler(){logger[_0xd573('0x1a')](util[_0xd573('0x14')](_0xd573('0x21'),this[_0xd573('0x1c')],this['calleridname'],this['callerid'],this[_0xd573('0x1f')],this['uniqueid']));}function hangupHandler(){logger[_0xd573('0x1a')](util[_0xd573('0x14')](_0xd573('0x22'),this[_0xd573('0x1c')],this[_0xd573('0x1d')],this['callerid'],this[_0xd573('0x1f')],this[_0xd573('0x20')]));this[_0xd573('0x23')]=!![];}function createSquareReport(_0xfdbce0,_0x128ee8){rpc[_0xd573('0x24')](_0xfdbce0)[_0xd573('0x25')](function(_0x45ff01){if(_0x128ee8){_0x128ee8(null,_0x45ff01);}})[_0xd573('0x26')](function(_0x48e0af){if(_0x128ee8){_0x128ee8(null,_0x48e0af);}});}function setChannelVariables(_0x298e6b){for(var _0x2f5ab3 in _0x298e6b){if(_0x298e6b[_0xd573('0x27')](_0x2f5ab3)){if(_0x2f5ab3[_0xd573('0x28')](_0xd573('0x29'))===0x0){_0x298e6b[_0x2f5ab3['substring'](0x4)]=_0x298e6b[_0x2f5ab3];delete _0x298e6b[_0x2f5ab3];}}}}function agiHandler(_0x4676eb){logger[_0xd573('0x2a')](_0xd573('0x2b'),JSON[_0xd573('0x2c')](_0x4676eb,null,0x2));logger['info'](util[_0xd573('0x14')](_0xd573('0x2d'),_0x4676eb['arg_1'],_0x4676eb['calleridname'],_0x4676eb[_0xd573('0x1e')],_0x4676eb[_0xd573('0x1f')],_0x4676eb[_0xd573('0x20')]));_0x4676eb['on'](_0xd573('0xc'),errorHandler);_0x4676eb['on'](_0xd573('0x2e'),closeHandler);_0x4676eb['on'](_0xd573('0x2f'),timeoutHandler);_0x4676eb['evtHangup']=![];_0x4676eb['on']('hangup',hangupHandler);var _0x49f7a6=_[_0xd573('0x30')](projects,[_0xd573('0x16'),_0x4676eb[_0xd573('0x1c')]]);if(!_0x49f7a6)return Project[_0xd573('0x31')](_0x4676eb);if(!_0x49f7a6[_0xd573('0x32')])return Project['handleUnpublished'](_0x4676eb);return Project[_0xd573('0x33')](_0x49f7a6,_0x4676eb);}function main(){var _0x5341a0;return utilLicense['getLicense']()['then'](function(_0x2473d8){if(!_0x2473d8)return;if(_0x2473d8[_0xd573('0x34')]){if(_0x2473d8['callysquare']&&_0x2473d8[_0xd573('0x35')]>0x0){logger[_0xd573('0x1a')](util['format']('[LICENSE]\x20CHANNELS:\x20%s',_0x2473d8[_0xd573('0x35')]));_0x5341a0=_0x2473d8[_0xd573('0x35')];}else{logger[_0xd573('0x1a')](_0xd573('0x36'));}}else{logger['info'](_0xd573('0x37'));_0x5341a0=-0x1;}})['then'](function(){return Project[_0xd573('0x38')]();})[_0xd573('0x25')](function(_0x27aede){projects=_0x27aede;return;})['catch'](function(_0x46ae44){logger['error'](_0xd573('0x39'),_0x46ae44[_0xd573('0xd')]);})[_0xd573('0x3a')](function(){var _0x4a1f1c=require('./server')(config[_0xd573('0x3')][_0xd573('0x13')],config[_0xd573('0x3')]['ip'],_0x5341a0);_0x4a1f1c['on']('error',errorHandler);_0x4a1f1c['on'](_0xd573('0x3b'),listeningHandler);_0x4a1f1c['on'](_0xd573('0x3c'),connectionHandler);_0x4a1f1c['on'](_0xd573('0x2e'),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 05ec2d1..6f5608d 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 _0xd9f4=['jayson/promise','client','request','then','error','result','catch','sendMailMessage','SendMail','bluebird'];(function(_0x3941df,_0x1492cb){var _0xe2da73=function(_0x1dcdf6){while(--_0x1dcdf6){_0x3941df['push'](_0x3941df['shift']());}};_0xe2da73(++_0x1492cb);}(_0xd9f4,0x1f3));var _0x4d9f=function(_0x1fafa5,_0x1aa281){_0x1fafa5=_0x1fafa5-0x0;var _0xcf08c9=_0xd9f4[_0x1fafa5];return _0xcf08c9;};'use strict';var BPromise=require(_0x4d9f('0x0'));var jayson=require(_0x4d9f('0x1'));var client=jayson[_0x4d9f('0x2')]['http']({'port':0x232b});function request(_0x5791ba,_0x31cdf5){return new BPromise(function(_0xce376e,_0x2583ef){return client[_0x4d9f('0x3')](_0x5791ba,_0x31cdf5)[_0x4d9f('0x4')](function(_0x1b3f10){if(_0x1b3f10[_0x4d9f('0x5')]){return _0x2583ef(_0x1b3f10[_0x4d9f('0x5')]['message']);}else{return _0xce376e(_0x1b3f10[_0x4d9f('0x6')]);}})[_0x4d9f('0x7')](function(_0x33f961){return _0x2583ef(_0x33f961);});});}exports[_0x4d9f('0x8')]=function(_0x136529,_0x14514c){return request(_0x4d9f('0x9'),{'account':_0x136529,'message':_0x14514c});}; \ No newline at end of file +var _0x963b=['SendMail','bluebird','jayson/promise','client','http','request','then','error','message','result','catch','sendMailMessage'];(function(_0x321aa7,_0x4e5d3b){var _0x269c6c=function(_0x530d12){while(--_0x530d12){_0x321aa7['push'](_0x321aa7['shift']());}};_0x269c6c(++_0x4e5d3b);}(_0x963b,0x1b1));var _0xb963=function(_0x1e6659,_0x1f860c){_0x1e6659=_0x1e6659-0x0;var _0x4d16e4=_0x963b[_0x1e6659];return _0x4d16e4;};'use strict';var BPromise=require(_0xb963('0x0'));var jayson=require(_0xb963('0x1'));var client=jayson[_0xb963('0x2')][_0xb963('0x3')]({'port':0x232b});function request(_0x5de1e1,_0x54a907){return new BPromise(function(_0x285d65,_0x2bb026){return client[_0xb963('0x4')](_0x5de1e1,_0x54a907)[_0xb963('0x5')](function(_0x4d3655){if(_0x4d3655[_0xb963('0x6')]){return _0x2bb026(_0x4d3655[_0xb963('0x6')][_0xb963('0x7')]);}else{return _0x285d65(_0x4d3655[_0xb963('0x8')]);}})[_0xb963('0x9')](function(_0x29c2ae){return _0x2bb026(_0x29c2ae);});});}exports[_0xb963('0xa')]=function(_0x31b16e,_0x5eda83){return request(_0xb963('0xb'),{'account':_0x31b16e,'message':_0x5eda83});}; \ No newline at end of file diff --git a/server/services/agi/project.js b/server/services/agi/project.js index 629bb74..54df322 100644 --- a/server/services/agi/project.js +++ b/server/services/agi/project.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x149e=['extension','priority','response','code','evtHangup','isUndefined','result','error','agicommand\x20not\x20found','finally','uniqueid','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','exports','lodash','util','../../config/logger','agi','./rpc','./mailRpc','./vertices','getSquareProjects','Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','hasOwnProperty','maxRetry','retry','omit','mxCell','isArray','length','source','addEdge','value','toJson','mxGraphModel','root','production','start','debug','stringify','joinAt','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','traverseBFS','clear','vertex','gotoc','info','gotoc\x20block\x20stop\x20traverse\x20BFS','context'];(function(_0x101320,_0x327215){var _0x10c830=function(_0xd6d1f7){while(--_0xd6d1f7){_0x101320['push'](_0x101320['shift']());}};_0x10c830(++_0x327215);}(_0x149e,0x107));var _0xe149=function(_0xc4dea8,_0x24930a){_0xc4dea8=_0xc4dea8-0x0;var _0x3d5675=_0x149e[_0xc4dea8];return _0x3d5675;};'use strict';var _=require(_0xe149('0x0'));var moment=require('moment');var parser=require('xml2json');var util=require(_0xe149('0x1'));var logger=require(_0xe149('0x2'))(_0xe149('0x3'));var rpc=require(_0xe149('0x4'));var mailRpc=require(_0xe149('0x5'));var Graph=require('./graph');var Vertices=require(_0xe149('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0xe149('0x7')]()['catch'](function(_0x48375a){logger['error'](_0xe149('0x8'),_0x48375a[_0xe149('0x9')]);return[];});}function addVertex(_0x410d49,_0x4bf15a,_0x26dfa6){_0x4bf15a[_0xe149('0xa')]=_0x26dfa6;if(_0x4bf15a[_0xe149('0xb')]('retry')){_0x4bf15a[_0xe149('0xc')]=parseInt(_0x4bf15a[_0xe149('0xd')],0xa);}_0x410d49['addVertex'](_[_0xe149('0xe')](_0x4bf15a,_0xe149('0xf')));}function initGraph(_0x1d32b5,_0x58352f){var _0x3f47cb=new Graph();for(var _0x4affe1 in _0x1d32b5){if(_0x1d32b5[_0xe149('0xb')](_0x4affe1)){if(_[_0xe149('0x10')](_0x1d32b5[_0x4affe1])){for(var _0x33ba55=0x0;_0x33ba55<_0x1d32b5[_0x4affe1][_0xe149('0x11')];_0x33ba55+=0x1){addVertex(_0x3f47cb,_0x1d32b5[_0x4affe1][_0x33ba55],_0x4affe1);}}else{addVertex(_0x3f47cb,_0x1d32b5[_0x4affe1],_0x4affe1);}}}for(var _0x1e2b1d=0x0;_0x1e2b1d<_0x58352f[_0xe149('0x11')];_0x1e2b1d+=0x1){if(_0x58352f[_0x1e2b1d][_0xe149('0x12')]&&_0x58352f[_0x1e2b1d]['target']){_0x3f47cb[_0xe149('0x13')](_0x58352f[_0x1e2b1d][_0xe149('0x12')],_0x58352f[_0x1e2b1d]['target'],_0x58352f[_0x1e2b1d][_0xe149('0x14')]);}}return _0x3f47cb;}function getRoot(_0x15e74b){return parser[_0xe149('0x15')](_0x15e74b,{'object':!![]})[_0xe149('0x16')][_0xe149('0x17')];}function inspect(_0x5b6a1b){return util['inspect'](_0x5b6a1b,{'showHidden':![],'depth':null});}function initialize(_0x56acb4,_0x17afce){var _0xd32175=getRoot(_0x56acb4[_0xe149('0x18')]);if(!_0xd32175||!_0xd32175[_0xe149('0x19')])return;var _0x241f30,_0x289c0c,_0x3a9424;logger[_0xe149('0x1a')](_0xe149('0x17'),JSON[_0xe149('0x1b')](_0xd32175,null,0x2));_0x17afce[_0xe149('0x1c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x241f30=initGraph(_[_0xe149('0xe')](_0xd32175,_0xe149('0xf')),_0xd32175[_0xe149('0xf')]);_0x289c0c=new Vertices(_0x17afce,rpc,mailRpc);logger['info'](util[_0xe149('0x1d')](_0xe149('0x1e'),_0x17afce[_0xe149('0x1f')],_0x17afce[_0xe149('0x20')],_0x17afce[_0xe149('0x21')],_0x17afce[_0xe149('0x22')],_0x17afce['uniqueid']));_0x241f30[_0xe149('0x23')](_0xd32175[_0xe149('0x19')]['id'],function(_0x2800f9){try{_0x2800f9=_0x289c0c[_0xe149('0x24')](_0x2800f9);logger[_0xe149('0x1a')](_0xe149('0x25'),JSON['stringify'](_0x2800f9,null,0x2));if(_0x2800f9[_0xe149('0xa')]===_0xe149('0x26')){logger[_0xe149('0x27')](_0xe149('0x28'));_0x17afce[_0xe149('0x29')]=_0x2800f9['context']||_0x17afce[_0xe149('0x29')];_0x17afce[_0xe149('0x2a')]=_0x2800f9[_0xe149('0x2a')];_0x17afce[_0xe149('0x2b')]=_0x2800f9['priority']?_0x2800f9[_0xe149('0x2b')]-0x1:0x1;return null;}else if(_0x2800f9&&_0x289c0c[_0x2800f9['agicommand']]){_0x3a9424=_0x289c0c[_0x2800f9[_0xe149('0xa')]](_0x2800f9);logger[_0xe149('0x27')](_0xe149('0x2c'),JSON['stringify'](_0x3a9424,null,0x2));if(_0x3a9424&&_0x3a9424[_0xe149('0x2d')]===AGI_CODE_SUCCESS&&_0x3a9424['result']!==AGI_RESULT_ERROR&&!_0x17afce[_0xe149('0x2e')]){logger[_0xe149('0x1a')]('response',inspect(_0x3a9424));return _[_0xe149('0x2f')](_0x3a9424['result'])?null:_0x3a9424[_0xe149('0x30')]['toString']();}else{logger[_0xe149('0x31')]('response',inspect(_0x3a9424));return null;}}else{logger['error'](_0xe149('0x32'));return null;}}catch(_0x10242f){logger[_0xe149('0x31')](_0x10242f[_0xe149('0x9')]);return null;}});if(_0xd32175[_0xe149('0x33')]){logger['info'](util[_0xe149('0x1d')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x17afce[_0xe149('0x1f')],_0x17afce[_0xe149('0x20')],_0x17afce[_0xe149('0x21')],_0x17afce[_0xe149('0x22')],_0x17afce[_0xe149('0x34')]));_0x241f30[_0xe149('0x23')](_0xd32175[_0xe149('0x33')]['id'],function(_0x1b6bb0){try{_0x1b6bb0=_0x289c0c[_0xe149('0x24')](_0x1b6bb0);logger[_0xe149('0x1a')](_0xe149('0x25'),JSON[_0xe149('0x1b')](_0x1b6bb0,null,0x2));if(_0x1b6bb0&&_0x289c0c[_0x1b6bb0[_0xe149('0xa')]]){_0x3a9424=_0x289c0c[_0x1b6bb0['agicommand']](_0x1b6bb0);if(_0x3a9424){logger['debug'](_0xe149('0x2c'),inspect(_0x3a9424));return _[_0xe149('0x2f')](_0x3a9424['result'])?null:_0x3a9424['result'][_0xe149('0x35')]();}else{logger[_0xe149('0x31')](_0xe149('0x2c'),inspect(_0x3a9424));return null;}}else{logger[_0xe149('0x31')](_0xe149('0x32'));return null;}}catch(_0x4fe416){logger[_0xe149('0x31')](_0x4fe416[_0xe149('0x9')]);return null;}});}logger[_0xe149('0x27')](util[_0xe149('0x1d')](_0xe149('0x36'),_0x17afce[_0xe149('0x1f')],_0x17afce['calleridname'],_0x17afce[_0xe149('0x21')],_0x17afce[_0xe149('0x22')],_0x17afce['uniqueid']));logger[_0xe149('0x27')](util[_0xe149('0x1d')](_0xe149('0x37'),_0x17afce['context'],_0x17afce['extension'],parseInt(_0x17afce[_0xe149('0x2b')],0xa)+0x1));_0x17afce[_0xe149('0x38')](_0x17afce['context'],_0x17afce[_0xe149('0x2a')],parseInt(_0x17afce['priority'],0xa)+0x1);_0x17afce[_0xe149('0x39')]();}function handleNotFound(_0x56d16e){logger['error'](util[_0xe149('0x1d')](_0xe149('0x3a'),_0x56d16e[_0xe149('0x1f')]));_0x56d16e[_0xe149('0x38')](_0x56d16e[_0xe149('0x29')],_0x56d16e[_0xe149('0x2a')],parseInt(_0x56d16e[_0xe149('0x2b')],0xa)+0x1);_0x56d16e['close']();}function handleUnpublished(_0x2a998a){logger[_0xe149('0x31')](util['format'](_0xe149('0x3b'),_0x2a998a[_0xe149('0x1f')]));_0x2a998a[_0xe149('0x38')](_0x2a998a[_0xe149('0x29')],_0x2a998a[_0xe149('0x2a')],parseInt(_0x2a998a[_0xe149('0x2b')],0xa)+0x1);_0x2a998a['close']();}module[_0xe149('0x3c')]={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file +var _0x4165=['Unable\x20to\x20download\x20CallySquare\x20projects','stack','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','source','target','addEdge','value','mxGraphModel','root','inspect','production','debug','stringify','info','format','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','dnid','traverseBFS','start','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','evtHangup','isUndefined','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','toString','callerid','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','Project\x20%s\x20not\x20published','close','lodash','moment','../../config/logger','./rpc','./mailRpc','./graph','getSquareProjects','catch','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4165,0x119));var _0x5416=function(_0x5d8ac9,_0x3128ad){_0x5d8ac9=_0x5d8ac9-0x0;var _0x432997=_0x4165[_0x5d8ac9];return _0x432997;};'use strict';var _=require(_0x5416('0x0'));var moment=require(_0x5416('0x1'));var parser=require('xml2json');var util=require('util');var logger=require(_0x5416('0x2'))('agi');var rpc=require(_0x5416('0x3'));var mailRpc=require(_0x5416('0x4'));var Graph=require(_0x5416('0x5'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;function getAll(){return rpc[_0x5416('0x6')]()[_0x5416('0x7')](function(_0xad8ebb){logger[_0x5416('0x8')](_0x5416('0x9'),_0xad8ebb[_0x5416('0xa')]);return[];});}function addVertex(_0xe9f03c,_0x4c43f0,_0x3105ab){_0x4c43f0[_0x5416('0xb')]=_0x3105ab;if(_0x4c43f0['hasOwnProperty'](_0x5416('0xc'))){_0x4c43f0[_0x5416('0xd')]=parseInt(_0x4c43f0['retry'],0xa);}_0xe9f03c[_0x5416('0xe')](_[_0x5416('0xf')](_0x4c43f0,_0x5416('0x10')));}function initGraph(_0x33fb32,_0x179a62){var _0x1265a9=new Graph();for(var _0x50c3c2 in _0x33fb32){if(_0x33fb32[_0x5416('0x11')](_0x50c3c2)){if(_['isArray'](_0x33fb32[_0x50c3c2])){for(var _0x1c5182=0x0;_0x1c5182<_0x33fb32[_0x50c3c2]['length'];_0x1c5182+=0x1){addVertex(_0x1265a9,_0x33fb32[_0x50c3c2][_0x1c5182],_0x50c3c2);}}else{addVertex(_0x1265a9,_0x33fb32[_0x50c3c2],_0x50c3c2);}}}for(var _0x32c39b=0x0;_0x32c39b<_0x179a62['length'];_0x32c39b+=0x1){if(_0x179a62[_0x32c39b][_0x5416('0x12')]&&_0x179a62[_0x32c39b][_0x5416('0x13')]){_0x1265a9[_0x5416('0x14')](_0x179a62[_0x32c39b][_0x5416('0x12')],_0x179a62[_0x32c39b][_0x5416('0x13')],_0x179a62[_0x32c39b][_0x5416('0x15')]);}}return _0x1265a9;}function getRoot(_0x5539ef){return parser['toJson'](_0x5539ef,{'object':!![]})[_0x5416('0x16')][_0x5416('0x17')];}function inspect(_0x2fa9ef){return util[_0x5416('0x18')](_0x2fa9ef,{'showHidden':![],'depth':null});}function initialize(_0x54c29c,_0x24ed37){var _0x104ee9=getRoot(_0x54c29c[_0x5416('0x19')]);if(!_0x104ee9||!_0x104ee9['start'])return;var _0x4f5d65,_0x2f718b,_0x467d53;logger[_0x5416('0x1a')]('root',JSON[_0x5416('0x1b')](_0x104ee9,null,0x2));_0x24ed37['joinAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4f5d65=initGraph(_[_0x5416('0xf')](_0x104ee9,_0x5416('0x10')),_0x104ee9[_0x5416('0x10')]);_0x2f718b=new Vertices(_0x24ed37,rpc,mailRpc);logger[_0x5416('0x1c')](util[_0x5416('0x1d')](_0x5416('0x1e'),_0x24ed37[_0x5416('0x1f')],_0x24ed37[_0x5416('0x20')],_0x24ed37['callerid'],_0x24ed37[_0x5416('0x21')],_0x24ed37['uniqueid']));_0x4f5d65[_0x5416('0x22')](_0x104ee9[_0x5416('0x23')]['id'],function(_0x58af5c){try{_0x58af5c=_0x2f718b[_0x5416('0x24')](_0x58af5c);logger[_0x5416('0x1a')](_0x5416('0x25'),JSON[_0x5416('0x1b')](_0x58af5c,null,0x2));if(_0x58af5c[_0x5416('0xb')]===_0x5416('0x26')){logger[_0x5416('0x1c')](_0x5416('0x27'));_0x24ed37['context']=_0x58af5c[_0x5416('0x28')]||_0x24ed37[_0x5416('0x28')];_0x24ed37[_0x5416('0x29')]=_0x58af5c['extension'];_0x24ed37['priority']=_0x58af5c[_0x5416('0x2a')]?_0x58af5c['priority']-0x1:0x1;return null;}else if(_0x58af5c&&_0x2f718b[_0x58af5c['agicommand']]){_0x467d53=_0x2f718b[_0x58af5c[_0x5416('0xb')]](_0x58af5c);logger[_0x5416('0x1c')](_0x5416('0x2b'),JSON[_0x5416('0x1b')](_0x467d53,null,0x2));if(_0x467d53&&_0x467d53[_0x5416('0x2c')]===AGI_CODE_SUCCESS&&_0x467d53[_0x5416('0x2d')]!==AGI_RESULT_ERROR&&!_0x24ed37[_0x5416('0x2e')]){logger[_0x5416('0x1a')](_0x5416('0x2b'),inspect(_0x467d53));return _[_0x5416('0x2f')](_0x467d53[_0x5416('0x2d')])?null:_0x467d53[_0x5416('0x2d')]['toString']();}else{logger[_0x5416('0x8')](_0x5416('0x2b'),inspect(_0x467d53));return null;}}else{logger[_0x5416('0x8')]('agicommand\x20not\x20found');return null;}}catch(_0x308675){logger['error'](_0x308675[_0x5416('0xa')]);return null;}});if(_0x104ee9[_0x5416('0x30')]){logger[_0x5416('0x1c')](util[_0x5416('0x1d')](_0x5416('0x31'),_0x24ed37['arg_1'],_0x24ed37[_0x5416('0x20')],_0x24ed37['callerid'],_0x24ed37[_0x5416('0x21')],_0x24ed37[_0x5416('0x32')]));_0x4f5d65[_0x5416('0x22')](_0x104ee9['finally']['id'],function(_0x4a6898){try{_0x4a6898=_0x2f718b[_0x5416('0x24')](_0x4a6898);logger[_0x5416('0x1a')](_0x5416('0x25'),JSON[_0x5416('0x1b')](_0x4a6898,null,0x2));if(_0x4a6898&&_0x2f718b[_0x4a6898[_0x5416('0xb')]]){_0x467d53=_0x2f718b[_0x4a6898[_0x5416('0xb')]](_0x4a6898);if(_0x467d53){logger['debug'](_0x5416('0x2b'),inspect(_0x467d53));return _[_0x5416('0x2f')](_0x467d53[_0x5416('0x2d')])?null:_0x467d53[_0x5416('0x2d')][_0x5416('0x33')]();}else{logger[_0x5416('0x8')]('response',inspect(_0x467d53));return null;}}else{logger[_0x5416('0x8')]('agicommand\x20not\x20found');return null;}}catch(_0x5b4307){logger[_0x5416('0x8')](_0x5b4307[_0x5416('0xa')]);return null;}});}logger[_0x5416('0x1c')](util[_0x5416('0x1d')]('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x24ed37['arg_1'],_0x24ed37['calleridname'],_0x24ed37[_0x5416('0x34')],_0x24ed37[_0x5416('0x21')],_0x24ed37['uniqueid']));logger[_0x5416('0x1c')](util[_0x5416('0x1d')](_0x5416('0x35'),_0x24ed37['context'],_0x24ed37['extension'],parseInt(_0x24ed37[_0x5416('0x2a')],0xa)+0x1));_0x24ed37[_0x5416('0x36')](_0x24ed37[_0x5416('0x28')],_0x24ed37['extension'],parseInt(_0x24ed37[_0x5416('0x2a')],0xa)+0x1);_0x24ed37['close']();}function handleNotFound(_0x59e2f4){logger[_0x5416('0x8')](util[_0x5416('0x1d')](_0x5416('0x37'),_0x59e2f4[_0x5416('0x1f')]));_0x59e2f4[_0x5416('0x36')](_0x59e2f4[_0x5416('0x28')],_0x59e2f4[_0x5416('0x29')],parseInt(_0x59e2f4[_0x5416('0x2a')],0xa)+0x1);_0x59e2f4['close']();}function handleUnpublished(_0xca3b48){logger[_0x5416('0x8')](util['format'](_0x5416('0x38'),_0xca3b48[_0x5416('0x1f')]));_0xca3b48[_0x5416('0x36')](_0xca3b48[_0x5416('0x28')],_0xca3b48[_0x5416('0x29')],parseInt(_0xca3b48[_0x5416('0x2a')],0xa)+0x1);_0xca3b48[_0x5416('0x39')]();}module['exports']={'getAll':getAll,'handleNotFound':handleNotFound,'handleUnpublished':handleUnpublished,'initialize':initialize}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 3fed85e..b0a5002 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 _0xe5ec=['Transform','call','prototype','_transform','\x0d\x0a\x0d\x0a','toString','_localBuffer','indexOf','substring','length','split','slice','trim','emit','headers','_inBody','line','exports','util'];(function(_0x1f5895,_0x4e0188){var _0x525e28=function(_0x6bd4dd){while(--_0x6bd4dd){_0x1f5895['push'](_0x1f5895['shift']());}};_0x525e28(++_0x4e0188);}(_0xe5ec,0x1b4));var _0xce5e=function(_0x7762d6,_0x1934b7){_0x7762d6=_0x7762d6-0x0;var _0x2627c3=_0xe5ec[_0x7762d6];return _0x2627c3;};'use strict';var util=require(_0xce5e('0x0'));var Transform=require('stream')[_0xce5e('0x1')];function AGIReply(_0x58542){Transform[_0xce5e('0x2')](this,_0x58542);this['_localBuffer']='';this['_inBody']=![];}util['inherits'](AGIReply,Transform);AGIReply[_0xce5e('0x3')][_0xce5e('0x4')]=function(_0xc9c505,_0xdb1d60,_0x10d862){var _0x538418='\x0a',_0x5f3abe=['\x0a\x0a',_0xce5e('0x5')],_0x2e3d2e=-0x1,_0xf570d8=-0x1,_0x29c26a='',_0x4633e4=0x0,_0x45cf19='',_0x36cdd6='';this['_localBuffer']+=_0xc9c505[_0xce5e('0x6')]();_0x45cf19=this[_0xce5e('0x7')];if(!this['_inBody']){_0x4633e4=0x0;while(_0x5f3abe[_0x4633e4]){while((_0xf570d8=_0x45cf19[_0xce5e('0x8')](_0x5f3abe[_0x4633e4]))!=-0x1){_0x29c26a=_0x5f3abe[_0x4633e4];_0x36cdd6=_0x45cf19[_0xce5e('0x9')](0x0,_0xf570d8);_0x45cf19=_0x45cf19[_0xce5e('0x9')](_0xf570d8+_0x29c26a[_0xce5e('0xa')]);var _0x2fd187=_0x36cdd6[_0xce5e('0xb')](_0x538418),_0x252b69=0x0,_0xcc395={},_0x72e2a9='',_0x1ffff0='',_0x110202=-0x1;while(_0x2fd187[_0x252b69]){_0x110202=_0x2fd187[_0x252b69][_0xce5e('0x8')](':');if(_0x110202!=-0x1){_0x72e2a9=_0x2fd187[_0x252b69][_0xce5e('0xc')](0x0,_0x110202)[_0xce5e('0xd')]();_0x1ffff0=_0x2fd187[_0x252b69][_0xce5e('0xc')](_0x110202+0x1)[_0xce5e('0xd')]();if(_0x72e2a9[_0xce5e('0xa')]>0x0){_0xcc395[_0x72e2a9]=_0x1ffff0;}}else{}_0x252b69++;}this[_0xce5e('0xe')](_0xce5e('0xf'),_0xcc395);this[_0xce5e('0x10')]=!![];}_0x4633e4++;}this[_0xce5e('0x7')]=_0x45cf19;}else{while((_0x2e3d2e=_0x45cf19[_0xce5e('0x8')](_0x538418))!=-0x1){_0x36cdd6=_0x45cf19[_0xce5e('0x9')](0x0,_0x2e3d2e);this['emit'](_0xce5e('0x11'),_0x36cdd6);_0x45cf19=_0x45cf19[_0xce5e('0x9')](_0x2e3d2e+_0x538418['length']);}this[_0xce5e('0x7')]=_0x45cf19;}_0x10d862();};module[_0xce5e('0x12')]=AGIReply; \ No newline at end of file +var _0xcf84=['stream','Transform','call','_localBuffer','_inBody','prototype','\x0d\x0a\x0d\x0a','toString','indexOf','substring','length','split','slice','trim','headers','exports','util'];(function(_0xd81173,_0x2c2062){var _0x5a0a66=function(_0x3471cb){while(--_0x3471cb){_0xd81173['push'](_0xd81173['shift']());}};_0x5a0a66(++_0x2c2062);}(_0xcf84,0x175));var _0x4cf8=function(_0x46c8d6,_0x16fa9b){_0x46c8d6=_0x46c8d6-0x0;var _0x2084ec=_0xcf84[_0x46c8d6];return _0x2084ec;};'use strict';var util=require(_0x4cf8('0x0'));var Transform=require(_0x4cf8('0x1'))[_0x4cf8('0x2')];function AGIReply(_0x1281a8){Transform[_0x4cf8('0x3')](this,_0x1281a8);this[_0x4cf8('0x4')]='';this[_0x4cf8('0x5')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x4cf8('0x6')]['_transform']=function(_0x455916,_0x202b11,_0x2d6d19){var _0x55031c='\x0a',_0x5c25ae=['\x0a\x0a',_0x4cf8('0x7')],_0x2002cc=-0x1,_0x4755cd=-0x1,_0x4ea833='',_0x2ca70f=0x0,_0x467050='',_0x15792c='';this[_0x4cf8('0x4')]+=_0x455916[_0x4cf8('0x8')]();_0x467050=this[_0x4cf8('0x4')];if(!this[_0x4cf8('0x5')]){_0x2ca70f=0x0;while(_0x5c25ae[_0x2ca70f]){while((_0x4755cd=_0x467050[_0x4cf8('0x9')](_0x5c25ae[_0x2ca70f]))!=-0x1){_0x4ea833=_0x5c25ae[_0x2ca70f];_0x15792c=_0x467050['substring'](0x0,_0x4755cd);_0x467050=_0x467050[_0x4cf8('0xa')](_0x4755cd+_0x4ea833[_0x4cf8('0xb')]);var _0xf61aa9=_0x15792c[_0x4cf8('0xc')](_0x55031c),_0x15650a=0x0,_0xd15e6b={},_0x29f1cb='',_0x35b483='',_0x17290c=-0x1;while(_0xf61aa9[_0x15650a]){_0x17290c=_0xf61aa9[_0x15650a][_0x4cf8('0x9')](':');if(_0x17290c!=-0x1){_0x29f1cb=_0xf61aa9[_0x15650a][_0x4cf8('0xd')](0x0,_0x17290c)['trim']();_0x35b483=_0xf61aa9[_0x15650a][_0x4cf8('0xd')](_0x17290c+0x1)[_0x4cf8('0xe')]();if(_0x29f1cb['length']>0x0){_0xd15e6b[_0x29f1cb]=_0x35b483;}}else{}_0x15650a++;}this['emit'](_0x4cf8('0xf'),_0xd15e6b);this['_inBody']=!![];}_0x2ca70f++;}this[_0x4cf8('0x4')]=_0x467050;}else{while((_0x2002cc=_0x467050[_0x4cf8('0x9')](_0x55031c))!=-0x1){_0x15792c=_0x467050['substring'](0x0,_0x2002cc);this['emit']('line',_0x15792c);_0x467050=_0x467050[_0x4cf8('0xa')](_0x2002cc+_0x55031c[_0x4cf8('0xb')]);}this['_localBuffer']=_0x467050;}_0x2d6d19();};module[_0x4cf8('0x10')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index b57198d..39bbcc1 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 _0x4c4e=['agentUnpause','UnpauseUser','lodash','jayson/promise','client','http','then','error','message','result','catch','getSquareProjects','GetSquareProjects','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','CloudProvider','email','getSquareProjectById','name','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getContactByPhone','GetContactByPhone','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','merge','arg_2','format','createSquareMessage','createCmContact','ListId','CreateCmContact','getPauseById','agentLogin','LoginUser'];(function(_0xe01acf,_0x3a345a){var _0x2d218e=function(_0x1d03c1){while(--_0x1d03c1){_0xe01acf['push'](_0xe01acf['shift']());}};_0x2d218e(++_0x3a345a);}(_0x4c4e,0x152));var _0xe4c4=function(_0x5960c2,_0x55b471){_0x5960c2=_0x5960c2-0x0;var _0x288092=_0x4c4e[_0x5960c2];return _0x288092;};'use strict';var _=require(_0xe4c4('0x0'));var moment=require('moment');var jayson=require(_0xe4c4('0x1'));var client=jayson[_0xe4c4('0x2')][_0xe4c4('0x3')]({'port':0x2329});function request(_0x58c8f6,_0x1b6c91){return new Promise(function(_0x7d7655,_0x1a4483){return client['request'](_0x58c8f6,_0x1b6c91)[_0xe4c4('0x4')](function(_0x533a68){if(_0x533a68[_0xe4c4('0x5')]){return _0x1a4483(_0x533a68[_0xe4c4('0x5')][_0xe4c4('0x6')]);}else{return _0x7d7655(_0x533a68[_0xe4c4('0x7')]);}})[_0xe4c4('0x8')](function(_0x329d29){return _0x1a4483(_0x329d29);});});}exports[_0xe4c4('0x9')]=function(){return request(_0xe4c4('0xa'),{'options':{'raw':![],'attributes':['id','name','production']}});};exports[_0xe4c4('0xb')]=function(_0x6f2545){return request(_0xe4c4('0xc'),{'options':{'raw':![],'where':{'name':_0x6f2545},'attributes':[_0xe4c4('0xd')]}});};exports[_0xe4c4('0xe')]=function(_0x2f4d5f){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x2f4d5f},'include':[{'model':_0xe4c4('0xf'),'as':_0xe4c4('0x10'),'include':[{'model':_0xe4c4('0x11'),'as':_0xe4c4('0x11')}]}],'attributes':['id','name',_0xe4c4('0x12')],'smtp':!![]}});};exports[_0xe4c4('0x13')]=function(_0x515056){return request(_0xe4c4('0xc'),{'options':{'where':{'id':_0x515056},'attributes':[_0xe4c4('0x14')]}});};exports['getVoiceQueueById']=function(_0x42ce9e){return request(_0xe4c4('0x15'),{'options':{'where':{'id':_0x42ce9e},'attributes':['name']}});};exports[_0xe4c4('0x16')]=function(_0x465c9b){return request(_0xe4c4('0x17'),{'options':{'where':{'id':_0x465c9b},'attributes':[_0xe4c4('0x14')]}});};exports[_0xe4c4('0x18')]=function(_0x882be2){return request(_0xe4c4('0x19'),{'options':{'where':{'id':_0x882be2},'attributes':[_0xe4c4('0x1a')]}});};exports[_0xe4c4('0x1b')]=function(_0x36b10c){return request(_0xe4c4('0x1c'),{'options':{'where':{'id':_0x36b10c},'attributes':[_0xe4c4('0x14')]}});};exports[_0xe4c4('0x1d')]=function(_0x43a9ce){return request(_0xe4c4('0x1e'),{'options':{'where':{'phone':_0x43a9ce['phone']},'attributes':['id']}});};exports[_0xe4c4('0x1f')]=function(_0x24f946){return request(_0xe4c4('0x20'),{'options':{'where':{'id':_0x24f946},'attributes':[_0xe4c4('0x14')]}});};exports['getSoundById']=function(_0x3d5856){return request(_0xe4c4('0x21'),{'options':{'where':{'id':_0x3d5856},'attributes':[_0xe4c4('0x22')]}});};exports[_0xe4c4('0x23')]=function(_0x2c5aea){return request(_0xe4c4('0x24'),{'options':{'raw':![],'where':{'id':_0x2c5aea},'include':[{'model':_0xe4c4('0x25'),'as':_0xe4c4('0x26')}]}});};exports[_0xe4c4('0x27')]=function(_0x1a7690){return request(_0xe4c4('0x28'),{'options':{'where':{'id':_0x1a7690},'attributes':['id',_0xe4c4('0x14')]}});};exports[_0xe4c4('0x29')]=function(_0x1db719){return request(_0xe4c4('0x2a'),{'body':_0x1db719});};exports['createSquareDetailsReport']=function(_0x49cadc){return request(_0xe4c4('0x2b'),{'body':_0x49cadc});};exports['createSquareReport']=function(_0xf6024d){return request('CreateSquareReport',{'body':_[_0xe4c4('0x2c')](_0xf6024d,{'project_name':_0xf6024d['arg_1'],'prev_project_name':_0xf6024d[_0xe4c4('0x2d')]||'','is_subproject':_0xf6024d['arg_2']?!![]:![],'leaveAt':moment()[_0xe4c4('0x2e')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x4cea1f){return request('CreateSquareRecording',{'body':_0x4cea1f});};exports[_0xe4c4('0x2f')]=function(_0x48cfe0){return request('CreateSquareMessage',{'body':_0x48cfe0});};exports[_0xe4c4('0x30')]=function(_0x11deab){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x11deab['phone'],'ListId':_0x11deab[_0xe4c4('0x31')]}}})[_0xe4c4('0x4')](function(_0x4aa6c1){if(_0x4aa6c1){return _0x4aa6c1;}return request(_0xe4c4('0x32'),{'body':_0x11deab});});};exports[_0xe4c4('0x33')]=function(_0x3f60fc){return request('ShowPause',{'options':{'where':{'id':_0x3f60fc},'attributes':['name']}});};exports[_0xe4c4('0x34')]=function(_0x2c5652,_0x12bde8){return request(_0xe4c4('0x35'),{'body':{'interface':_0x12bde8},'options':{'where':_0x2c5652}});};exports['agentPause']=function(_0x49c913,_0x1731c8,_0x2e4282){return request('PauseUser',{'body':{'type':_0x1731c8,'uniqueid':_0x2e4282},'options':{'where':_0x49c913}});};exports[_0xe4c4('0x36')]=function(_0x1ad3e6){return request(_0xe4c4('0x37'),{'body':{},'options':{'where':_0x1ad3e6}});};exports['agentLogout']=function(_0x137f40){return request('LogoutUser',{'body':{},'options':{'where':_0x137f40}});}; \ No newline at end of file +var _0xbe02=['getPauseById','agentLogin','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','moment','jayson/promise','client','request','then','error','message','result','getSquareProjects','production','ShowSquareProject','getMailAccountById','MailServerOut','Smtp','CloudProvider','getSquareProjectById','name','ShowVoiceQueue','getVariableById','ShowSquareOdbc','dsn','getUserById','GetContactByPhone','phone','getTrunkById','ShowTrunk','getSoundById','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact'];(function(_0x476b5f,_0x1f9952){var _0x5a23d8=function(_0x50b464){while(--_0x50b464){_0x476b5f['push'](_0x476b5f['shift']());}};_0x5a23d8(++_0x1f9952);}(_0xbe02,0x124));var _0x2be0=function(_0x44f5fc,_0x44a60a){_0x44f5fc=_0x44f5fc-0x0;var _0x404b4b=_0xbe02[_0x44f5fc];return _0x404b4b;};'use strict';var _=require('lodash');var moment=require(_0x2be0('0x0'));var jayson=require(_0x2be0('0x1'));var client=jayson[_0x2be0('0x2')]['http']({'port':0x2329});function request(_0x499c2b,_0x1d7a85){return new Promise(function(_0x248e93,_0x506aad){return client[_0x2be0('0x3')](_0x499c2b,_0x1d7a85)[_0x2be0('0x4')](function(_0x443ace){if(_0x443ace[_0x2be0('0x5')]){return _0x506aad(_0x443ace[_0x2be0('0x5')][_0x2be0('0x6')]);}else{return _0x248e93(_0x443ace[_0x2be0('0x7')]);}})['catch'](function(_0xdf1605){return _0x506aad(_0xdf1605);});});}exports[_0x2be0('0x8')]=function(){return request('GetSquareProjects',{'options':{'raw':![],'attributes':['id','name',_0x2be0('0x9')]}});};exports['getSquareProject']=function(_0xebe843){return request(_0x2be0('0xa'),{'options':{'raw':![],'where':{'name':_0xebe843},'attributes':[_0x2be0('0x9')]}});};exports[_0x2be0('0xb')]=function(_0x104667){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x104667},'include':[{'model':_0x2be0('0xc'),'as':_0x2be0('0xd'),'include':[{'model':_0x2be0('0xe'),'as':_0x2be0('0xe')}]}],'attributes':['id','name','email'],'smtp':!![]}});};exports[_0x2be0('0xf')]=function(_0x3baa57){return request(_0x2be0('0xa'),{'options':{'where':{'id':_0x3baa57},'attributes':[_0x2be0('0x10')]}});};exports['getVoiceQueueById']=function(_0x44d709){return request(_0x2be0('0x11'),{'options':{'where':{'id':_0x44d709},'attributes':[_0x2be0('0x10')]}});};exports[_0x2be0('0x12')]=function(_0x818f20){return request('ShowVariable',{'options':{'where':{'id':_0x818f20},'attributes':[_0x2be0('0x10')]}});};exports['getSquareOdbcById']=function(_0x698b89){return request(_0x2be0('0x13'),{'options':{'where':{'id':_0x698b89},'attributes':[_0x2be0('0x14')]}});};exports[_0x2be0('0x15')]=function(_0x3c247e){return request('ShowUser',{'options':{'where':{'id':_0x3c247e},'attributes':[_0x2be0('0x10')]}});};exports['getContactByPhone']=function(_0x473c97){return request(_0x2be0('0x16'),{'options':{'where':{'phone':_0x473c97[_0x2be0('0x17')]},'attributes':['id']}});};exports[_0x2be0('0x18')]=function(_0xc3b92a){return request(_0x2be0('0x19'),{'options':{'where':{'id':_0xc3b92a},'attributes':[_0x2be0('0x10')]}});};exports[_0x2be0('0x1a')]=function(_0x98bad6){return request('ShowSound',{'options':{'where':{'id':_0x98bad6},'attributes':[_0x2be0('0x1b')]}});};exports[_0x2be0('0x1c')]=function(_0x2cba28){return request(_0x2be0('0x1d'),{'options':{'raw':![],'where':{'id':_0x2cba28},'include':[{'model':'Interval','as':_0x2be0('0x1e')}]}});};exports[_0x2be0('0x1f')]=function(_0x55ea94){return request('ShowSmsAccount',{'options':{'where':{'id':_0x55ea94},'attributes':['id',_0x2be0('0x10')]}});};exports['createSmsMessage']=function(_0x20eb86){return request(_0x2be0('0x20'),{'body':_0x20eb86});};exports[_0x2be0('0x21')]=function(_0x4e6e4c){return request(_0x2be0('0x22'),{'body':_0x4e6e4c});};exports[_0x2be0('0x23')]=function(_0xab3a77){return request(_0x2be0('0x24'),{'body':_[_0x2be0('0x25')](_0xab3a77,{'project_name':_0xab3a77[_0x2be0('0x26')],'prev_project_name':_0xab3a77['arg_2']||'','is_subproject':_0xab3a77[_0x2be0('0x27')]?!![]:![],'leaveAt':moment()[_0x2be0('0x28')](_0x2be0('0x29'))})});};exports[_0x2be0('0x2a')]=function(_0x4686ca){return request(_0x2be0('0x2b'),{'body':_0x4686ca});};exports[_0x2be0('0x2c')]=function(_0xb83ebf){return request(_0x2be0('0x2d'),{'body':_0xb83ebf});};exports[_0x2be0('0x2e')]=function(_0x131dfb){return request(_0x2be0('0x2f'),{'options':{'raw':![],'where':{'phone':_0x131dfb[_0x2be0('0x17')],'ListId':_0x131dfb[_0x2be0('0x30')]}}})[_0x2be0('0x4')](function(_0x273df5){if(_0x273df5){return _0x273df5;}return request(_0x2be0('0x31'),{'body':_0x131dfb});});};exports[_0x2be0('0x32')]=function(_0x36d7c7){return request('ShowPause',{'options':{'where':{'id':_0x36d7c7},'attributes':['name']}});};exports[_0x2be0('0x33')]=function(_0x263479,_0x2745b9){return request('LoginUser',{'body':{'interface':_0x2745b9},'options':{'where':_0x263479}});};exports['agentPause']=function(_0x41ad52,_0x53020e,_0x316d9f){return request(_0x2be0('0x34'),{'body':{'type':_0x53020e,'uniqueid':_0x316d9f},'options':{'where':_0x41ad52}});};exports[_0x2be0('0x35')]=function(_0x229d7d){return request(_0x2be0('0x36'),{'body':{},'options':{'where':_0x229d7d}});};exports[_0x2be0('0x37')]=function(_0x44e36b){return request(_0x2be0('0x38'),{'body':{},'options':{'where':_0x44e36b}});}; \ 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 e62f86d..b8986bf 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 _0x8a5c=['./lex','exports'];(function(_0x3937cb,_0x9677b0){var _0x376a57=function(_0x1f20bd){while(--_0x1f20bd){_0x3937cb['push'](_0x3937cb['shift']());}};_0x376a57(++_0x9677b0);}(_0x8a5c,0x112));var _0xc8a5=function(_0x4399bd,_0x4468e9){_0x4399bd=_0x4399bd-0x0;var _0x29489a=_0x8a5c[_0x4399bd];return _0x29489a;};var polly=require('./polly');var lex=require(_0xc8a5('0x0'));module[_0xc8a5('0x1')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x90ec=['./polly','./lex'];(function(_0x43841f,_0x4df0c4){var _0x417f61=function(_0x4a354e){while(--_0x4a354e){_0x43841f['push'](_0x43841f['shift']());}};_0x417f61(++_0x4df0c4);}(_0x90ec,0x1d4));var _0xc90e=function(_0x554e66,_0x4c7936){_0x554e66=_0x554e66-0x0;var _0x487a08=_0x90ec[_0x554e66];return _0x487a08;};var polly=require(_0xc90e('0x0'));var lex=require(_0xc90e('0x1'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 17a9f7b..22515b4 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 _0x6f7a=['./lib/api','exports'];(function(_0x3a68a8,_0x136d9f){var _0x451461=function(_0x3dde19){while(--_0x3dde19){_0x3a68a8['push'](_0x3a68a8['shift']());}};_0x451461(++_0x136d9f);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x1f3650,_0x2a809e){_0x1f3650=_0x1f3650-0x0;var _0x16111e=_0x6f7a[_0x1f3650];return _0x16111e;};'use strict';var lex=require(_0xa6f7('0x0'));module[_0xa6f7('0x1')]=function(_0x205e14,_0x982062,_0x4dd99d,_0x93614a,_0x407de3,_0x12ecb8){return lex(_0x205e14,_0x982062,_0x4dd99d,_0x93614a,_0x407de3,_0x12ecb8);}; \ No newline at end of file +'use strict';var lex=require('./lib/api');module['exports']=function(_0x2936e7,_0x2afa91,_0x27405a,_0x305d85,_0x864539,_0x52b5fb){return lex(_0x2936e7,_0x2afa91,_0x27405a,_0x305d85,_0x864539,_0x52b5fb);}; \ 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 182eec4..0bc0ce6 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 _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0xef6438,_0x2ce72e){var _0x2ebd69=function(_0x2b9c6d){while(--_0x2b9c6d){_0xef6438['push'](_0xef6438['shift']());}};_0x2ebd69(++_0x2ce72e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xa9e0[_0x3e112d];return _0x531c31;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ No newline at end of file +var _0xa9e0=['LexRuntime','bluebird','aws-sdk','slots','hasOwnProperty'];(function(_0x4bae1e,_0xe6d628){var _0x2a1460=function(_0x36b647){while(--_0x36b647){_0x4bae1e['push'](_0x4bae1e['shift']());}};_0x2a1460(++_0xe6d628);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var BPromise=require(_0x0a9e('0x0'));var AWS=require(_0x0a9e('0x1'));function lexResult(_0x29929c,_0x5dd881){return new BPromise(function(_0x550fbc,_0x18d5c9){_0x29929c['postText'](_0x5dd881,function(_0x333808,_0x432180){if(_0x333808){_0x18d5c9(_0x333808);}if(_0x432180[_0x0a9e('0x2')]){for(const _0x991246 in _0x432180[_0x0a9e('0x2')]){if(_0x432180['slots'][_0x0a9e('0x3')](_0x991246)){var _0x441e3a=_0x432180[_0x0a9e('0x2')][_0x991246];_0x432180['slot_'+_0x991246]=_0x441e3a;}}}_0x550fbc(_0x432180);});});}module['exports']=function(_0xe42b77,_0x56465b,_0x52cace,_0x39753a,_0xf81284,_0x307b3e){var _0x3ab53f=new AWS[(_0x0a9e('0x4'))]({'accessKeyId':_0x56465b,'secretAccessKey':_0x52cace,'region':_0x39753a});var _0xbd1168={'botAlias':'$LATEST','botName':_0x307b3e,'inputText':_0xf81284,'userId':_0xe42b77};return lexResult(_0x3ab53f,_0xbd1168);}; \ 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 af4ae89..a480519 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 _0x6afc=['./lib/api'];(function(_0x1a40df,_0x3cbeb7){var _0x1712ce=function(_0x32b6b5){while(--_0x32b6b5){_0x1a40df['push'](_0x1a40df['shift']());}};_0x1712ce(++_0x3cbeb7);}(_0x6afc,0x1e9));var _0xc6af=function(_0x18c6d5,_0x21cf58){_0x18c6d5=_0x18c6d5-0x0;var _0x235ee9=_0x6afc[_0x18c6d5];return _0x235ee9;};'use strict';var polly=require(_0xc6af('0x0'));module['exports']=function(_0x3d3a5a,_0x3d07b9,_0x458d02,_0x3cd7a9,_0xab52ea,_0x5bde49,_0x1123b6){return polly(_0x3d3a5a,_0x3d07b9,_0x458d02,_0x3cd7a9,_0xab52ea,_0x5bde49,_0x1123b6);}; \ No newline at end of file +var _0xfa0d=['exports','./lib/api'];(function(_0x4e85ec,_0x2913b6){var _0x1c1ab3=function(_0x2c55b6){while(--_0x2c55b6){_0x4e85ec['push'](_0x4e85ec['shift']());}};_0x1c1ab3(++_0x2913b6);}(_0xfa0d,0xcd));var _0xdfa0=function(_0x5dc7ac,_0x1d5e66){_0x5dc7ac=_0x5dc7ac-0x0;var _0x3852fc=_0xfa0d[_0x5dc7ac];return _0x3852fc;};'use strict';var polly=require(_0xdfa0('0x0'));module[_0xdfa0('0x1')]=function(_0xfdd907,_0x3db41d,_0x122c2b,_0x119c18,_0x175ca,_0x125984,_0x355c71){return polly(_0xfdd907,_0x3db41d,_0x122c2b,_0x119c18,_0x175ca,_0x125984,_0x355c71);}; \ 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 2cb9888..a918666 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 _0x3554=['bluebird','randomstring','synthesizeSpeech','AudioStream','writeFile','Polly','text','mp3','path'];(function(_0x59eefb,_0x2151ce){var _0x1a49e8=function(_0x5a758c){while(--_0x5a758c){_0x59eefb['push'](_0x59eefb['shift']());}};_0x1a49e8(++_0x2151ce);}(_0x3554,0x1ee));var _0x4355=function(_0x2edf63,_0x1f9dd8){_0x2edf63=_0x2edf63-0x0;var _0x20f865=_0x3554[_0x2edf63];return _0x20f865;};'use strict';var fs=require('fs');var path=require(_0x4355('0x0'));var BPromise=require(_0x4355('0x1'));var rs=require(_0x4355('0x2'));var AWS=require('aws-sdk');function pollyResult(_0x31c841,_0x9c851a,_0x1fd434){return new BPromise(function(_0x2b1f63,_0x29772c){_0x31c841[_0x4355('0x3')](_0x9c851a,function(_0x11a2de,_0x59ea96){if(_0x11a2de){_0x29772c(_0x11a2de);}else if(_0x59ea96){if(_0x59ea96[_0x4355('0x4')]instanceof Buffer){fs[_0x4355('0x5')](_0x1fd434,_0x59ea96['AudioStream'],function(_0x44e6df){if(_0x44e6df){_0x29772c(_0x44e6df);}else{_0x2b1f63();}});}else{_0x29772c(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x29772c(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module['exports']=function(_0x2319a2,_0x5019ff,_0x3322bf,_0x529153,_0x243fe0,_0x1f4572,_0x5a4455){var _0x57131e=new AWS[(_0x4355('0x6'))]({'accessKeyId':_0x2319a2,'secretAccessKey':_0x5019ff,'region':_0x3322bf});var _0x44d565={'Text':_0x243fe0,'TextType':_0x1f4572||_0x4355('0x7'),'OutputFormat':_0x4355('0x8'),'VoiceId':_0x529153};return pollyResult(_0x57131e,_0x44d565,_0x5a4455);}; \ No newline at end of file +var _0x8272=['AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','aws-sdk','synthesizeSpeech','writeFile'];(function(_0x26371f,_0x3529d6){var _0x7bf77f=function(_0xaaf7ec){while(--_0xaaf7ec){_0x26371f['push'](_0x26371f['shift']());}};_0x7bf77f(++_0x3529d6);}(_0x8272,0x1d4));var _0x2827=function(_0x311170,_0x5ecf43){_0x311170=_0x311170-0x0;var _0x3b4a19=_0x8272[_0x311170];return _0x3b4a19;};'use strict';var fs=require('fs');var path=require(_0x2827('0x0'));var BPromise=require(_0x2827('0x1'));var rs=require('randomstring');var AWS=require(_0x2827('0x2'));function pollyResult(_0x501d16,_0x57522f,_0x1b4769){return new BPromise(function(_0x99b32f,_0x2803c6){_0x501d16[_0x2827('0x3')](_0x57522f,function(_0x30f38d,_0x5eea04){if(_0x30f38d){_0x2803c6(_0x30f38d);}else if(_0x5eea04){if(_0x5eea04['AudioStream']instanceof Buffer){fs[_0x2827('0x4')](_0x1b4769,_0x5eea04[_0x2827('0x5')],function(_0x12cfd6){if(_0x12cfd6){_0x2803c6(_0x12cfd6);}else{_0x99b32f();}});}else{_0x2803c6(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x2803c6(new Error(_0x2827('0x6')));}});});}module[_0x2827('0x7')]=function(_0x4c6f30,_0xe72a46,_0x5072ea,_0x2305bf,_0x246f37,_0x25b129,_0x50288f){var _0x2f1727=new AWS[(_0x2827('0x8'))]({'accessKeyId':_0x4c6f30,'secretAccessKey':_0xe72a46,'region':_0x5072ea});var _0x24a6cc={'Text':_0x246f37,'TextType':_0x25b129||_0x2827('0x9'),'OutputFormat':_0x2827('0xa'),'VoiceId':_0x2305bf};return pollyResult(_0x2f1727,_0x24a6cc,_0x50288f);}; \ 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 fd6ffa3..0ba73ba 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 _0x3ed3=['exports'];(function(_0x4f7418,_0x1755cc){var _0x4afe7e=function(_0x5ae646){while(--_0x5ae646){_0x4f7418['push'](_0x4f7418['shift']());}};_0x4afe7e(++_0x1755cc);}(_0x3ed3,0x162));var _0x33ed=function(_0x3f6f3c,_0x323d8a){_0x3f6f3c=_0x3f6f3c-0x0;var _0x4b84bb=_0x3ed3[_0x3f6f3c];return _0x4b84bb;};'use strict';var asr=require('./lib/api');module[_0x33ed('0x0')]=function(_0x48ded1,_0xf3518c,_0x1f4c20,_0x154dfe){return asr(_0x48ded1,_0xf3518c,_0x1f4c20);}; \ No newline at end of file +'use strict';var asr=require('./lib/api');module['exports']=function(_0x317fdd,_0x3b038b,_0x3a87a8,_0x52ce90){return asr(_0x317fdd,_0x3b038b,_0x3a87a8);}; \ 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 5271f7d..0570e5c 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 _0x66fa=['length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','string'];(function(_0x38ce4c,_0xfdbe8c){var _0x5d4544=function(_0x503537){while(--_0x503537){_0x38ce4c['push'](_0x38ce4c['shift']());}};_0x5d4544(++_0xfdbe8c);}(_0x66fa,0x168));var _0xa66f=function(_0x5b1b1a,_0x296663){_0x5b1b1a=_0x5b1b1a-0x0;var _0x3a01e5=_0x66fa[_0x5b1b1a];return _0x3a01e5;};'use strict';var url=require(_0xa66f('0x0'));var BPromise=require(_0xa66f('0x1'));var fs=require('fs');var host=_0xa66f('0x2');module['exports']=function(_0x4a6840,_0x3dc747,_0x2325d7){return new BPromise(function(_0x3aaeff,_0x2e663b){var _0x2143e6;if(typeof _0x4a6840!==_0xa66f('0x3')||_0x4a6840[_0xa66f('0x4')]===0x0){return _0x2e663b(_0xa66f('0x5'));}if(typeof _0x3dc747!==_0xa66f('0x3')||_0x3dc747[_0xa66f('0x4')]===0x0){return _0x2e663b(_0xa66f('0x6'));}if(typeof _0x2325d7!=='undefined'&&(typeof _0x2325d7!==_0xa66f('0x3')||_0x2325d7['length']===0x0)){return _0x2e663b(_0xa66f('0x7'));}try{_0x2143e6=fs[_0xa66f('0x8')](_0x4a6840)['toString'](_0xa66f('0x9'));}catch(_0x32dc03){return _0x2e663b(_0x32dc03);}return _0x3aaeff({'method':_0xa66f('0xa'),'uri':host+_0xa66f('0xb')+_0x3dc747,'body':{'config':{'encoding':_0xa66f('0xc'),'sampleRateHertz':_0xa66f('0xd'),'languageCode':_0x2325d7},'audio':{'content':_0x2143e6}},'json':!![]});});}; \ No newline at end of file +var _0x85b5=['8000','url','bluebird','exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','POST','/v1/speech:recognize?key=','LINEAR16'];(function(_0x243df1,_0x191379){var _0xdb18ee=function(_0xa19801){while(--_0xa19801){_0x243df1['push'](_0x243df1['shift']());}};_0xdb18ee(++_0x191379);}(_0x85b5,0x7f));var _0x585b=function(_0x4bb223,_0x13ebbe){_0x4bb223=_0x4bb223-0x0;var _0x559caa=_0x85b5[_0x4bb223];return _0x559caa;};'use strict';var url=require(_0x585b('0x0'));var BPromise=require(_0x585b('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x585b('0x2')]=function(_0x4a79cf,_0x18ab39,_0x5a7ff0){return new BPromise(function(_0x4d5064,_0x331fe8){var _0x4f37a9;if(typeof _0x4a79cf!==_0x585b('0x3')||_0x4a79cf[_0x585b('0x4')]===0x0){return _0x331fe8(_0x585b('0x5'));}if(typeof _0x18ab39!=='string'||_0x18ab39[_0x585b('0x4')]===0x0){return _0x331fe8('key\x20should\x20be\x20a\x20string');}if(typeof _0x5a7ff0!==_0x585b('0x6')&&(typeof _0x5a7ff0!==_0x585b('0x3')||_0x5a7ff0[_0x585b('0x4')]===0x0)){return _0x331fe8(_0x585b('0x7'));}try{_0x4f37a9=fs['readFileSync'](_0x4a79cf)[_0x585b('0x8')](_0x585b('0x9'));}catch(_0x430c16){return _0x331fe8(_0x430c16);}return _0x4d5064({'method':_0x585b('0xa'),'uri':host+_0x585b('0xb')+_0x18ab39,'body':{'config':{'encoding':_0x585b('0xc'),'sampleRateHertz':_0x585b('0xd'),'languageCode':_0x5a7ff0},'audio':{'content':_0x4f37a9}},'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 dbeb934..9d2a45d 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 _0x993c=['exports','./asr'];(function(_0x278d83,_0x293390){var _0x2853d2=function(_0x4346f1){while(--_0x4346f1){_0x278d83['push'](_0x278d83['shift']());}};_0x2853d2(++_0x293390);}(_0x993c,0x16b));var _0xc993=function(_0x5e1b2d,_0x34cfb8){_0x5e1b2d=_0x5e1b2d-0x0;var _0x27dff8=_0x993c[_0x5e1b2d];return _0x27dff8;};var asr=require(_0xc993('0x0'));module[_0xc993('0x1')]={'asr':asr}; \ No newline at end of file +var _0xd006=['./asr','exports'];(function(_0x270b7e,_0x1b380a){var _0x4d039d=function(_0x59f916){while(--_0x59f916){_0x270b7e['push'](_0x270b7e['shift']());}};_0x4d039d(++_0x1b380a);}(_0xd006,0x8a));var _0x6d00=function(_0xfbdff6,_0x2af690){_0xfbdff6=_0xfbdff6-0x0;var _0x4cb9be=_0xd006[_0xfbdff6];return _0x4cb9be;};var asr=require(_0x6d00('0x0'));module[_0x6d00('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index 2065c3d..2dbdc5a 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 _0x85db=['status','code','metadata','endConversation','googleDialogflowV2','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','action','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','intent','displayName','languageCode','queryText','responseId','intentDetectionConfidence','fulfillmentText','Tilde\x20ASR\x20confidence','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','nda','text','channelData','AudioFromTts','Data','dirName','apiai-promise','dialogflow','http','https','md5','path','querystring','request-promise','randomstring','url','parse','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','info','finish\x20download\x20file','pipe','end','https:','transcode','wav','start','resolve','generate','.wav','base64','then','unlink','chmodSync','split','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','MP3','text:synthesize','tmp','.mp3','from','writeFile','777','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','f.req=','jQ1olc','stringify','generic','parse\x20response\x20failed:\x0a','data','length','\x22\x20might\x20not\x20exist','writeFileSync','goggleTTS\x20path','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','message','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','score'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85db,0xa6));var _0xb85d=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x85db[_0x344a3f];return _0x264712;};'use strict';var apiai=require(_0xb85d('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0xb85d('0x1'));var fs=require('fs');var http=require(_0xb85d('0x2'));var https=require(_0xb85d('0x3'));var md5=require(_0xb85d('0x4'));var path=require(_0xb85d('0x5'));var querystring=require(_0xb85d('0x6'));var rp=require(_0xb85d('0x7'));var rs=require(_0xb85d('0x8'));var sox=require('sox');var tts=require('google-tts-api');var urlParse=require(_0xb85d('0x9'))[_0xb85d('0xa')];var util=require('util');var aws=require(_0xb85d('0xb'));var google=require(_0xb85d('0xc'));var sestek=require(_0xb85d('0xd'));var tilde=require(_0xb85d('0xe'));var logger=require(_0xb85d('0xf'))(_0xb85d('0x10'));var ISPEECH_API=_0xb85d('0x11');function downloadFile(_0x1cd8a4,_0x30c310){return new BPromise(function(_0x578b3d,_0xd640e1){var _0xbae064=urlParse(_0x1cd8a4);var _0x5f48aa=_0xbae064[_0xb85d('0x12')]==='https:'?https:http;var _0x22024b={'host':_0xbae064[_0xb85d('0x13')],'path':_0xbae064[_0xb85d('0x5')],'headers':{'user-agent':_0xb85d('0x14')}};_0x5f48aa[_0xb85d('0x15')](_0x22024b,function(_0x2ca120){if(_0x2ca120[_0xb85d('0x16')]!==0xc8){logger[_0xb85d('0x17')](_0xb85d('0x18')+_0x1cd8a4+'\x20failed,\x20status\x20code\x20=\x20'+_0x2ca120[_0xb85d('0x16')]+'\x20('+_0x2ca120[_0xb85d('0x19')]+')');_0xd640e1(new Error(_0xb85d('0x18')+_0x1cd8a4+_0xb85d('0x1a')+_0x2ca120[_0xb85d('0x16')]+'\x20('+_0x2ca120[_0xb85d('0x19')]+')'));return;}var _0x464548=fs[_0xb85d('0x1b')](_0x30c310);_0x464548['on']('finish',function(){logger[_0xb85d('0x1c')](_0xb85d('0x1d'));_0x464548['close'](_0x578b3d);});_0x464548['on'](_0xb85d('0x17'),function(_0x1bc67d){fs['unlink'](_0x30c310);logger[_0xb85d('0x17')]('download\x20error',_0x1bc67d);_0xd640e1(_0x1bc67d);});_0x2ca120[_0xb85d('0x1e')](_0x464548);})['on'](_0xb85d('0x17'),function(_0x281f3c){logger['error'](_0x281f3c);_0xd640e1(_0x281f3c);})[_0xb85d('0x1f')]();});}function uploadFile(_0x1158be){return new BPromise(function(_0x4acc61,_0xb4fe37){var _0x45204d=urlParse(_0x1158be);var _0x444a92=_0x45204d[_0xb85d('0x12')]===_0xb85d('0x20')?https:http;var _0x5e8b04={'host':_0x45204d['host'],'path':_0x45204d[_0xb85d('0x5')],'headers':{'user-agent':_0xb85d('0x14')}};_0x444a92[_0xb85d('0x15')](_0x5e8b04,function(_0x140d1a){if(_0x140d1a['statusCode']!==0xc8){_0xb4fe37(new Error(_0xb85d('0x18')+_0x1158be+_0xb85d('0x1a')+_0x140d1a['statusCode']+'\x20('+_0x140d1a[_0xb85d('0x19')]+')'));return;}var _0x1aaf4a='';_0x140d1a['on']('data',function(_0x8e7625){_0x1aaf4a+=_0x8e7625;});_0x140d1a['on'](_0xb85d('0x1f'),function(){_0x4acc61(_0x1aaf4a);});})['on'](_0xb85d('0x17'),function(_0x3425d4){_0xb4fe37(_0x3425d4);})['end']();});}function convertFile(_0x530665,_0x381812){return new BPromise(function(_0x5e50e3,_0x2751c0){var _0x3e94c4=sox[_0xb85d('0x21')](_0x530665,_0x381812,{'sampleRate':0x1f40,'format':_0xb85d('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3e94c4['on'](_0xb85d('0x17'),function(_0x58e46b){logger['error']('error\x20convert',_0x58e46b);_0x2751c0(_0x58e46b);});_0x3e94c4['on'](_0xb85d('0x1f'),function(){logger[_0xb85d('0x1c')]('finish\x20to\x20convert');_0x5e50e3();});_0x3e94c4[_0xb85d('0x23')]();});}function base64Decode(_0x341d54,_0x32cae0){var _0x44a5be=path[_0xb85d('0x24')](__dirname,'tmp',rs[_0xb85d('0x25')](0x4)+_0xb85d('0x26'));fs['writeFileSync'](_0x44a5be,_0x341d54,_0xb85d('0x27'));return convertFile(_0x44a5be,_0x32cae0)[_0xb85d('0x28')](function(){try{fs[_0xb85d('0x29')](_0x44a5be);fs[_0xb85d('0x2a')](_0x32cae0,'777');}catch(_0x3bfec2){logger[_0xb85d('0x17')](_0x3bfec2);}return _0x32cae0[_0xb85d('0x2b')]('.')[0x0];});}function base64Encode(_0x5e480e){var _0x34210a=fs['readFileSync'](_0x5e480e);return new Buffer(_0x34210a)['toString']('base64');}exports['googleCloudTTS']=function(_0x572393,_0x25d89a,_0x3fec7e,_0x5201ca,_0x31a763,_0x206016){var _0x3de617,_0xb55e0a;var _0x13479f=_0xb85d('0x2c');var _0x13372a=_0xb85d('0x2d')+_0x572393;var _0x267c1f={};if(_0x25d89a===_0xb85d('0x2e')){_0x267c1f[_0xb85d('0x2f')]={'ssml':_0x3fec7e};}else{_0x267c1f[_0xb85d('0x2f')]={'text':_0x3fec7e};};_0x267c1f['voice']={'languageCode':_0x5201ca,'ssmlGender':_0x31a763};_0x267c1f['audioConfig']={'audioEncoding':_0xb85d('0x30'),'sampleRateHertz':0x1f40};var _0x46733f={'url':_0x13479f+_0xb85d('0x31')+_0x13372a,'method':'POST','json':!![],'body':_0x267c1f};return rp(_0x46733f)['then'](function(_0x611a5e){return new BPromise(function(_0x2f7df5,_0x5003ef){_0x3de617=path[_0xb85d('0x24')](__dirname,_0xb85d('0x32'),rs['generate'](0x4)+_0xb85d('0x33'));var _0x5e12bd=Buffer[_0xb85d('0x34')](_0x611a5e['audioContent'],'base64');return fs[_0xb85d('0x35')](_0x3de617,_0x5e12bd,function(_0x5325c0){_0x5003ef(_0x5325c0);},function(_0x4b4b15){fs[_0xb85d('0x2a')](_0x3de617,_0xb85d('0x36'));_0x2f7df5(_0x4b4b15);});});})[_0xb85d('0x28')](function(_0x44be19){_0xb55e0a=path[_0xb85d('0x24')](__dirname,'tmp',rs[_0xb85d('0x25')](0x4)+'.wav');return convertFile(_0x3de617,_0xb55e0a);})[_0xb85d('0x28')](function(){try{fs[_0xb85d('0x29')](_0x3de617);fs[_0xb85d('0x2a')](_0xb55e0a,'777');}catch(_0x2faebb){logger[_0xb85d('0x17')](_0x2faebb);}logger[_0xb85d('0x1c')]('googleCloudTTS\x20path',_0xb55e0a[_0xb85d('0x2b')]('.')[0x0]);return _0xb55e0a[_0xb85d('0x2b')]('.')[0x0];});};exports[_0xb85d('0x37')]=function(_0x5302e6,_0x5ade9a){var _0x15cba5=_0xb85d('0x38');var _0x129f74,_0x17fd15;var _0x15c50b;var _0x47a91d={'encoding':_0xb85d('0x39'),'method':_0xb85d('0x3a'),'timeout':0x2710,'url':_0x15cba5,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xb85d('0x3b')+encodeURIComponent(JSON['stringify']([[[_0xb85d('0x3c'),JSON[_0xb85d('0x3d')]([_0x5302e6,_0x5ade9a||'en',![],'null']),null,_0xb85d('0x3e')]]]))};return rp(_0x47a91d)[_0xb85d('0x28')](function(_0x17e9c9){try{_0x15c50b=eval(_0x17e9c9['slice'](0x5))[0x0][0x2];}catch(_0x1fe52c){throw new Error(_0xb85d('0x3f')+_0x17e9c9[_0xb85d('0x40')]);}if(!_0x15c50b){if(_0x5302e6[_0xb85d('0x41')]>0xc8){throw new Error('text\x20length\x20limit\x20reached');}else{throw new Error('lang\x20\x22'+_0x5ade9a+_0xb85d('0x42'));}}try{_0x15c50b=eval(_0x15c50b)[0x0];}catch(_0x12c4be){throw new Error(_0xb85d('0x3f')+res[_0xb85d('0x40')]);}const _0x4f9043=_0x15c50b;_0x129f74=path['resolve'](__dirname,_0xb85d('0x32'),rs[_0xb85d('0x25')](0x4)+'.mp3');fs[_0xb85d('0x43')](_0x129f74,_0x15c50b,{'encoding':_0xb85d('0x27')});_0x17fd15=path['resolve'](__dirname,'tmp',rs[_0xb85d('0x25')](0x4)+_0xb85d('0x26'));return convertFile(_0x129f74,_0x17fd15);})[_0xb85d('0x28')](function(){try{fs[_0xb85d('0x29')](_0x129f74);fs['chmodSync'](_0x17fd15,_0xb85d('0x36'));}catch(_0x282b58){logger[_0xb85d('0x17')](_0x282b58);}logger[_0xb85d('0x1c')](_0xb85d('0x44'),_0x17fd15[_0xb85d('0x2b')]('.')[0x0]);return _0x17fd15[_0xb85d('0x2b')]('.')[0x0];});};exports[_0xb85d('0x45')]=function(_0x272d92,_0x23d36e,_0x4161ec){return google[_0xb85d('0x46')](_0x272d92,_0x23d36e,_0x4161ec)[_0xb85d('0x28')](function(_0x2efc2e){logger[_0xb85d('0x1c')](_0x2efc2e['uri']);return rp(_0x2efc2e);})[_0xb85d('0x28')](function(_0x31d934){var _0x529d46='';var _0x113e09=0x0;try{fs[_0xb85d('0x29')](_0x272d92);}catch(_0x256bd1){logger[_0xb85d('0x17')](_0x256bd1);}if(_0x31d934&&_0x31d934[_0xb85d('0x47')]){_0x529d46=_0x31d934[_0xb85d('0x47')][_0xb85d('0x48')](function(_0x4e0d04){return _0x4e0d04&&_0x4e0d04[_0xb85d('0x49')][0x0]&&_0x4e0d04[_0xb85d('0x49')][0x0][_0xb85d('0x4a')]?_0x4e0d04[_0xb85d('0x49')][0x0][_0xb85d('0x4a')]:'';})[_0xb85d('0x4b')]('\x0a');_0x113e09=_0x31d934[_0xb85d('0x47')][_0xb85d('0x48')](function(_0x6cfd6f){return _0x6cfd6f&&_0x6cfd6f[_0xb85d('0x49')][0x0]&&_0x6cfd6f['alternatives'][0x0][_0xb85d('0x4c')]?_0x6cfd6f[_0xb85d('0x49')][0x0]['confidence']:0x0;})[_0xb85d('0x4b')]('\x0a');}logger['info'](_0xb85d('0x4d'),_0x529d46);logger[_0xb85d('0x1c')](_0xb85d('0x4e'),_0x113e09);return{'transcript':_0x529d46,'confidence':_0x113e09};})[_0xb85d('0x4f')](function(_0x4e8d9a){logger[_0xb85d('0x17')]('[%s]\x20%s:%s',_0x4e8d9a[_0xb85d('0x16')],_0x4e8d9a['name'],_0x4e8d9a[_0xb85d('0x50')]);});};exports['googleDialogflow']=function(_0x1ade5e,_0x222555,_0x132e05,_0xda200d){var _0x19e402=apiai(_0x222555,{'language':_0xda200d||'en'});return _0x19e402['textRequest'](_0x132e05,{'sessionId':md5(_0x1ade5e)})[_0xb85d('0x28')](function(_0x31b559){logger['info'](JSON[_0xb85d('0x3d')](_0x31b559));return{'source':_0x31b559[_0xb85d('0x51')][_0xb85d('0x52')],'resolvedQuery':_0x31b559[_0xb85d('0x51')][_0xb85d('0x53')],'action':_0x31b559[_0xb85d('0x51')]['action'],'actionIncomplete':_0x31b559[_0xb85d('0x51')][_0xb85d('0x54')],'speech':_0x31b559[_0xb85d('0x51')][_0xb85d('0x55')][_0xb85d('0x56')],'score':_0x31b559[_0xb85d('0x51')][_0xb85d('0x57')],'statusCode':_0x31b559[_0xb85d('0x58')][_0xb85d('0x59')],'endConversation':_0x31b559[_0xb85d('0x51')][_0xb85d('0x5a')][_0xb85d('0x5b')]||![],'isFallbackIntent':_0x31b559[_0xb85d('0x51')][_0xb85d('0x5a')]['isFallbackIntent']};});};exports[_0xb85d('0x5c')]=function(_0x5bf743,_0x200273,_0x3b5628,_0x4591ea,_0x3bd5be,_0x1a134c){var _0x48ac75=_0x4591ea[_0xb85d('0x5d')](/\\n/g,'\x0a');var _0x2389ee={'credentials':{'private_key':_0x48ac75,'client_email':_0x3b5628}};var _0x5e5af7=new dialogflow[(_0xb85d('0x5e'))](_0x2389ee);var _0x47c8d1=_0x5e5af7['sessionPath'](_0x200273,md5(_0x5bf743));var _0x34c794={'session':_0x47c8d1,'queryInput':{'text':{'text':_0x3bd5be,'languageCode':_0x1a134c}}};return _0x5e5af7[_0xb85d('0x5f')](_0x34c794)['then'](function(_0x19024f){if(_0x19024f&&_0x19024f[_0xb85d('0x41')]){logger[_0xb85d('0x1c')](_0xb85d('0x60'),JSON[_0xb85d('0x3d')](_0x19024f));var _0x93fd04=_0x19024f[0x0];if(_0x93fd04){var _0x7642bd={'action':_0x93fd04[_0xb85d('0x61')][_0xb85d('0x62')],'allRequiredParamsPresent':_0x93fd04[_0xb85d('0x61')][_0xb85d('0x63')],'endConversation':_0x93fd04['queryResult'][_0xb85d('0x64')]&&_0x93fd04[_0xb85d('0x61')][_0xb85d('0x64')]['fields']?_0x93fd04[_0xb85d('0x61')][_0xb85d('0x64')][_0xb85d('0x65')][_0xb85d('0x66')][_0xb85d('0x67')]:![],'fulfillmentText':_0x93fd04[_0xb85d('0x61')]['fulfillmentText'],'intentName':_0x93fd04[_0xb85d('0x61')][_0xb85d('0x68')]['name'],'intentDisplayName':_0x93fd04[_0xb85d('0x61')][_0xb85d('0x68')][_0xb85d('0x69')],'isFallbackIntent':_0x93fd04['queryResult'][_0xb85d('0x68')]['isFallback'],'languageCode':_0x93fd04['queryResult'][_0xb85d('0x6a')],'queryText':_0x93fd04[_0xb85d('0x61')][_0xb85d('0x6b')],'responseId':_0x93fd04[_0xb85d('0x6c')],'score':_0x93fd04[_0xb85d('0x61')][_0xb85d('0x6d')],'speech':_0x93fd04['queryResult'][_0xb85d('0x6e')],'providerResponse':JSON[_0xb85d('0x3d')](_0x19024f)};return _0x7642bd;}}});};exports['tildeASR']=function(_0x325312,_0x19b970,_0x374b9f,_0x8c612f){return tilde[_0xb85d('0x46')](_0x325312,_0x19b970,_0x374b9f,_0x8c612f)[_0xb85d('0x28')](function(_0x15eb8d){try{fs[_0xb85d('0x29')](_0x325312);}catch(_0x4379f2){logger[_0xb85d('0x17')](_0x4379f2);}logger['info']('Tilde\x20ASR\x20transcription',_0x15eb8d[_0xb85d('0x4a')]);logger[_0xb85d('0x1c')](_0xb85d('0x6f'),_0x15eb8d[_0xb85d('0x4c')]);return _0x15eb8d;});};exports['awsPolly']=function(_0xcd75c7,_0x397a92,_0xb45583,_0x2428d1,_0x5a9a3c,_0x4dfd5d){var _0x34daf5=path[_0xb85d('0x24')](__dirname,_0xb85d('0x32'),rs[_0xb85d('0x25')](0x4)+_0xb85d('0x33'));var _0x3221a5;return aws[_0xb85d('0x70')](_0xcd75c7,_0x397a92,_0xb45583,_0x2428d1,_0x5a9a3c,_0x4dfd5d,_0x34daf5)[_0xb85d('0x28')](function(){_0x3221a5=path['resolve'](__dirname,_0xb85d('0x32'),rs[_0xb85d('0x25')](0x4)+'.wav');return convertFile(_0x34daf5,_0x3221a5);})[_0xb85d('0x28')](function(){try{fs[_0xb85d('0x29')](_0x34daf5);fs['chmodSync'](_0x3221a5,_0xb85d('0x36'));}catch(_0x4303ff){logger[_0xb85d('0x17')](_0x4303ff);}return _0x3221a5[_0xb85d('0x2b')]('.')[0x0];});};exports[_0xb85d('0x71')]=function(_0x251cf2,_0x46e3df,_0x4e5b94,_0x2ff5e8,_0x32b8d2,_0x10c1bd){return aws[_0xb85d('0x72')](_0x251cf2,_0x46e3df,_0x4e5b94,_0x2ff5e8,_0x32b8d2,_0x10c1bd)[_0xb85d('0x28')](function(_0x5bde9e){logger[_0xb85d('0x1c')](JSON[_0xb85d('0x3d')](_0x5bde9e));return _0x5bde9e;});};exports[_0xb85d('0x73')]=function(_0x44b704,_0x13be76,_0x4e538f,_0x3d4045){var _0x1cc93b=util[_0xb85d('0x74')](_0xb85d('0x75'),ISPEECH_API,_0x44b704,encodeURIComponent(_0x13be76),_0x4e538f,_0x3d4045);var _0x19fe8d=path[_0xb85d('0x24')](__dirname,_0xb85d('0x32'),rs[_0xb85d('0x25')](0x4)+_0xb85d('0x33'));var _0x537ddb;return downloadFile(_0x1cc93b,_0x19fe8d)[_0xb85d('0x28')](function(){_0x537ddb=path[_0xb85d('0x24')](__dirname,_0xb85d('0x32'),rs['generate'](0x4)+_0xb85d('0x26'));return convertFile(_0x19fe8d,_0x537ddb);})['then'](function(){try{fs['unlink'](_0x19fe8d);fs[_0xb85d('0x2a')](_0x537ddb,_0xb85d('0x36'));}catch(_0x12bf51){logger[_0xb85d('0x17')](_0x12bf51);}return _0x537ddb[_0xb85d('0x2b')]('.')[0x0];});};exports['ispeechASR']=function(_0x1f5126,_0x39f076,_0x3bb5a9,_0x1570a1){var _0x23561a=util['format'](_0xb85d('0x76'),ISPEECH_API,_0x39f076,_0x3bb5a9,base64Encode(_0x1f5126),_0x1570a1?util['format'](_0xb85d('0x77'),encodeURIComponent(_0x1570a1)):_0xb85d('0x78'));return uploadFile(_0x23561a)['then'](function(_0x2ccb96){return querystring['parse'](_0x2ccb96);});};exports['sestekNDA']=function(_0x21723c,_0x1ee83b){return sestek[_0xb85d('0x79')](_0x21723c,_0x1ee83b)[_0xb85d('0x28')](function(_0x54de66){logger[_0xb85d('0x1c')](JSON[_0xb85d('0x3d')](_0x54de66));var _0x49e68a={'speech':_0x54de66[_0xb85d('0x7a')],'action':_0x54de66[_0xb85d('0x7b')]?_0x54de66[_0xb85d('0x7b')]['CustomAction']:undefined,'actiondata':_0x54de66['channelData']?_0x54de66['channelData']['CustomActionData']:undefined};if(_0x54de66['channelData']&&_0x54de66[_0xb85d('0x7b')][_0xb85d('0x7c')]){return base64Decode(_0x54de66[_0xb85d('0x7b')][_0xb85d('0x7c')][_0xb85d('0x7d')],path[_0xb85d('0x24')](__dirname,_0xb85d('0x32'),rs[_0xb85d('0x25')](0x4)+_0xb85d('0x26')))[_0xb85d('0x28')](function(_0xaa5857){_0x49e68a['audiofile']=_0xaa5857;return _0x49e68a;});}return _0x49e68a;});};exports[_0xb85d('0x7e')]=function(){return __dirname;}; \ No newline at end of file +var _0xbc58=['toString','base64','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','audioConfig','MP3','.mp3','from','audioContent','writeFile','777','unlink','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','POST','stringify','jQ1olc','generic','slice','parse\x20response\x20failed:\x0a','data','length','text\x20length\x20limit\x20reached','lang\x20\x22','googleASR','asr','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20confidence','catch','[%s]\x20%s:%s','message','googleDialogflow','textRequest','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','score','status','metadata','endConversation','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','Dialogflow\x20V2\x20response:','action','allRequiredParamsPresent','diagnosticInfo','queryResult','fields','end_conversation','fulfillmentText','intent','isFallback','languageCode','responseId','intentDetectionConfidence','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','lex','ispeechTTS','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','nda','channelData','CustomAction','Data','audiofile','dirName','bluebird','dialogflow','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','parse','./aws','./google','./sestek','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','close','download\x20error','pipe','end','https:','transcode','wav','error\x20convert','info','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','then','chmodSync','split','readFileSync'];(function(_0x5ead4c,_0x2151b6){var _0x2ea307=function(_0x2580c3){while(--_0x2580c3){_0x5ead4c['push'](_0x5ead4c['shift']());}};_0x2ea307(++_0x2151b6);}(_0xbc58,0xe1));var _0x8bc5=function(_0x12ee61,_0x2c2591){_0x12ee61=_0x12ee61-0x0;var _0x474063=_0xbc58[_0x12ee61];return _0x474063;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0x8bc5('0x0'));var dialogflow=require(_0x8bc5('0x1'));var fs=require('fs');var http=require('http');var https=require(_0x8bc5('0x2'));var md5=require(_0x8bc5('0x3'));var path=require(_0x8bc5('0x4'));var querystring=require(_0x8bc5('0x5'));var rp=require(_0x8bc5('0x6'));var rs=require(_0x8bc5('0x7'));var sox=require(_0x8bc5('0x8'));var tts=require(_0x8bc5('0x9'));var urlParse=require('url')[_0x8bc5('0xa')];var util=require('util');var aws=require(_0x8bc5('0xb'));var google=require(_0x8bc5('0xc'));var sestek=require(_0x8bc5('0xd'));var tilde=require('./tilde');var logger=require('../../../config/logger')(_0x8bc5('0xe'));var ISPEECH_API=_0x8bc5('0xf');function downloadFile(_0x487e44,_0x215220){return new BPromise(function(_0x34d81b,_0x526794){var _0x1ff087=urlParse(_0x487e44);var _0x376abd=_0x1ff087[_0x8bc5('0x10')]==='https:'?https:http;var _0x5031f3={'host':_0x1ff087[_0x8bc5('0x11')],'path':_0x1ff087[_0x8bc5('0x4')],'headers':{'user-agent':_0x8bc5('0x12')}};_0x376abd[_0x8bc5('0x13')](_0x5031f3,function(_0x3d3907){if(_0x3d3907[_0x8bc5('0x14')]!==0xc8){logger[_0x8bc5('0x15')](_0x8bc5('0x16')+_0x487e44+_0x8bc5('0x17')+_0x3d3907['statusCode']+'\x20('+_0x3d3907[_0x8bc5('0x18')]+')');_0x526794(new Error(_0x8bc5('0x16')+_0x487e44+_0x8bc5('0x17')+_0x3d3907[_0x8bc5('0x14')]+'\x20('+_0x3d3907['statusMessage']+')'));return;}var _0x25451d=fs[_0x8bc5('0x19')](_0x215220);_0x25451d['on'](_0x8bc5('0x1a'),function(){logger['info']('finish\x20download\x20file');_0x25451d[_0x8bc5('0x1b')](_0x34d81b);});_0x25451d['on'](_0x8bc5('0x15'),function(_0x27a6d6){fs['unlink'](_0x215220);logger[_0x8bc5('0x15')](_0x8bc5('0x1c'),_0x27a6d6);_0x526794(_0x27a6d6);});_0x3d3907[_0x8bc5('0x1d')](_0x25451d);})['on'](_0x8bc5('0x15'),function(_0x5487ed){logger[_0x8bc5('0x15')](_0x5487ed);_0x526794(_0x5487ed);})[_0x8bc5('0x1e')]();});}function uploadFile(_0x52ce31){return new BPromise(function(_0x4006af,_0x5e4886){var _0x289ffa=urlParse(_0x52ce31);var _0x43b5d1=_0x289ffa[_0x8bc5('0x10')]===_0x8bc5('0x1f')?https:http;var _0x5bcc2d={'host':_0x289ffa['host'],'path':_0x289ffa['path'],'headers':{'user-agent':_0x8bc5('0x12')}};_0x43b5d1['get'](_0x5bcc2d,function(_0x422fe3){if(_0x422fe3[_0x8bc5('0x14')]!==0xc8){_0x5e4886(new Error('request\x20to\x20'+_0x52ce31+'\x20failed,\x20status\x20code\x20=\x20'+_0x422fe3[_0x8bc5('0x14')]+'\x20('+_0x422fe3[_0x8bc5('0x18')]+')'));return;}var _0x378a81='';_0x422fe3['on']('data',function(_0xf60443){_0x378a81+=_0xf60443;});_0x422fe3['on'](_0x8bc5('0x1e'),function(){_0x4006af(_0x378a81);});})['on'](_0x8bc5('0x15'),function(_0x39b4bb){_0x5e4886(_0x39b4bb);})[_0x8bc5('0x1e')]();});}function convertFile(_0x173e16,_0x4eb549){return new BPromise(function(_0x5d247d,_0x3e575a){var _0x4a5454=sox[_0x8bc5('0x20')](_0x173e16,_0x4eb549,{'sampleRate':0x1f40,'format':_0x8bc5('0x21'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x4a5454['on'](_0x8bc5('0x15'),function(_0x46584e){logger[_0x8bc5('0x15')](_0x8bc5('0x22'),_0x46584e);_0x3e575a(_0x46584e);});_0x4a5454['on'](_0x8bc5('0x1e'),function(){logger[_0x8bc5('0x23')](_0x8bc5('0x24'));_0x5d247d();});_0x4a5454[_0x8bc5('0x25')]();});}function base64Decode(_0x5138bc,_0x40b662){var _0x203e68=path[_0x8bc5('0x26')](__dirname,_0x8bc5('0x27'),rs[_0x8bc5('0x28')](0x4)+_0x8bc5('0x29'));fs[_0x8bc5('0x2a')](_0x203e68,_0x5138bc,'base64');return convertFile(_0x203e68,_0x40b662)[_0x8bc5('0x2b')](function(){try{fs['unlink'](_0x203e68);fs[_0x8bc5('0x2c')](_0x40b662,'777');}catch(_0x5ae4ca){logger['error'](_0x5ae4ca);}return _0x40b662[_0x8bc5('0x2d')]('.')[0x0];});}function base64Encode(_0x397622){var _0x2e8d04=fs[_0x8bc5('0x2e')](_0x397622);return new Buffer(_0x2e8d04)[_0x8bc5('0x2f')](_0x8bc5('0x30'));}exports[_0x8bc5('0x31')]=function(_0x1870ee,_0x594d28,_0x3d2ca0,_0x9f27d5,_0x3ab8ed,_0x32f1ef){var _0x54fc7c,_0x4bdeb4;var _0x24c9a7=_0x8bc5('0x32');var _0x2117d1='?key='+_0x1870ee;var _0xae9754={};if(_0x594d28===_0x8bc5('0x33')){_0xae9754[_0x8bc5('0x34')]={'ssml':_0x3d2ca0};}else{_0xae9754[_0x8bc5('0x34')]={'text':_0x3d2ca0};};_0xae9754[_0x8bc5('0x35')]={'languageCode':_0x9f27d5,'ssmlGender':_0x3ab8ed};_0xae9754[_0x8bc5('0x36')]={'audioEncoding':_0x8bc5('0x37'),'sampleRateHertz':0x1f40};var _0x56fd94={'url':_0x24c9a7+'text:synthesize'+_0x2117d1,'method':'POST','json':!![],'body':_0xae9754};return rp(_0x56fd94)[_0x8bc5('0x2b')](function(_0x305606){return new BPromise(function(_0x4cd18a,_0x23818e){_0x54fc7c=path[_0x8bc5('0x26')](__dirname,_0x8bc5('0x27'),rs[_0x8bc5('0x28')](0x4)+_0x8bc5('0x38'));var _0x103bb9=Buffer[_0x8bc5('0x39')](_0x305606[_0x8bc5('0x3a')],_0x8bc5('0x30'));return fs[_0x8bc5('0x3b')](_0x54fc7c,_0x103bb9,function(_0x3c6f84){_0x23818e(_0x3c6f84);},function(_0x44fa9e){fs['chmodSync'](_0x54fc7c,_0x8bc5('0x3c'));_0x4cd18a(_0x44fa9e);});});})['then'](function(_0x5b075d){_0x4bdeb4=path[_0x8bc5('0x26')](__dirname,'tmp',rs['generate'](0x4)+_0x8bc5('0x29'));return convertFile(_0x54fc7c,_0x4bdeb4);})[_0x8bc5('0x2b')](function(){try{fs[_0x8bc5('0x3d')](_0x54fc7c);fs[_0x8bc5('0x2c')](_0x4bdeb4,_0x8bc5('0x3c'));}catch(_0x439582){logger[_0x8bc5('0x15')](_0x439582);}logger[_0x8bc5('0x23')](_0x8bc5('0x3e'),_0x4bdeb4['split']('.')[0x0]);return _0x4bdeb4[_0x8bc5('0x2d')]('.')[0x0];});};exports[_0x8bc5('0x3f')]=function(_0x57a97c,_0x7fa63c){var _0x92b7d3=_0x8bc5('0x40');var _0x4ac798,_0x4d6a06;var _0x3e9173;var _0x5b7ad3={'encoding':_0x8bc5('0x41'),'method':_0x8bc5('0x42'),'timeout':0x2710,'url':_0x92b7d3,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':'f.req='+encodeURIComponent(JSON[_0x8bc5('0x43')]([[[_0x8bc5('0x44'),JSON[_0x8bc5('0x43')]([_0x57a97c,_0x7fa63c||'en',![],'null']),null,_0x8bc5('0x45')]]]))};return rp(_0x5b7ad3)[_0x8bc5('0x2b')](function(_0x20570c){try{_0x3e9173=eval(_0x20570c[_0x8bc5('0x46')](0x5))[0x0][0x2];}catch(_0x34a7c1){throw new Error(_0x8bc5('0x47')+_0x20570c[_0x8bc5('0x48')]);}if(!_0x3e9173){if(_0x57a97c[_0x8bc5('0x49')]>0xc8){throw new Error(_0x8bc5('0x4a'));}else{throw new Error(_0x8bc5('0x4b')+_0x7fa63c+'\x22\x20might\x20not\x20exist');}}try{_0x3e9173=eval(_0x3e9173)[0x0];}catch(_0x3a9748){throw new Error('parse\x20response\x20failed:\x0a'+res['data']);}const _0x35771e=_0x3e9173;_0x4ac798=path[_0x8bc5('0x26')](__dirname,'tmp',rs[_0x8bc5('0x28')](0x4)+_0x8bc5('0x38'));fs[_0x8bc5('0x2a')](_0x4ac798,_0x3e9173,{'encoding':_0x8bc5('0x30')});_0x4d6a06=path[_0x8bc5('0x26')](__dirname,_0x8bc5('0x27'),rs[_0x8bc5('0x28')](0x4)+_0x8bc5('0x29'));return convertFile(_0x4ac798,_0x4d6a06);})[_0x8bc5('0x2b')](function(){try{fs[_0x8bc5('0x3d')](_0x4ac798);fs['chmodSync'](_0x4d6a06,_0x8bc5('0x3c'));}catch(_0x309209){logger['error'](_0x309209);}logger[_0x8bc5('0x23')]('goggleTTS\x20path',_0x4d6a06[_0x8bc5('0x2d')]('.')[0x0]);return _0x4d6a06[_0x8bc5('0x2d')]('.')[0x0];});};exports[_0x8bc5('0x4c')]=function(_0x3c2bfb,_0x195a80,_0x4f7787){return google[_0x8bc5('0x4d')](_0x3c2bfb,_0x195a80,_0x4f7787)[_0x8bc5('0x2b')](function(_0x9a5606){logger[_0x8bc5('0x23')](_0x9a5606[_0x8bc5('0x4e')]);return rp(_0x9a5606);})[_0x8bc5('0x2b')](function(_0x4b4d7b){var _0x497c5a='';var _0x42943d=0x0;try{fs['unlink'](_0x3c2bfb);}catch(_0x2f3887){logger[_0x8bc5('0x15')](_0x2f3887);}if(_0x4b4d7b&&_0x4b4d7b[_0x8bc5('0x4f')]){_0x497c5a=_0x4b4d7b['results'][_0x8bc5('0x50')](function(_0x4f0986){return _0x4f0986&&_0x4f0986[_0x8bc5('0x51')][0x0]&&_0x4f0986[_0x8bc5('0x51')][0x0][_0x8bc5('0x52')]?_0x4f0986['alternatives'][0x0][_0x8bc5('0x52')]:'';})['join']('\x0a');_0x42943d=_0x4b4d7b[_0x8bc5('0x4f')][_0x8bc5('0x50')](function(_0x3ccad4){return _0x3ccad4&&_0x3ccad4[_0x8bc5('0x51')][0x0]&&_0x3ccad4['alternatives'][0x0][_0x8bc5('0x53')]?_0x3ccad4[_0x8bc5('0x51')][0x0][_0x8bc5('0x53')]:0x0;})[_0x8bc5('0x54')]('\x0a');}logger['info']('googleASR\x20transcription',_0x497c5a);logger[_0x8bc5('0x23')](_0x8bc5('0x55'),_0x42943d);return{'transcript':_0x497c5a,'confidence':_0x42943d};})[_0x8bc5('0x56')](function(_0x3f3cdb){logger[_0x8bc5('0x15')](_0x8bc5('0x57'),_0x3f3cdb[_0x8bc5('0x14')],_0x3f3cdb['name'],_0x3f3cdb[_0x8bc5('0x58')]);});};exports[_0x8bc5('0x59')]=function(_0x819372,_0x39fc8d,_0x517cef,_0x2b3369){var _0x222a3b=apiai(_0x39fc8d,{'language':_0x2b3369||'en'});return _0x222a3b[_0x8bc5('0x5a')](_0x517cef,{'sessionId':md5(_0x819372)})['then'](function(_0x27ce32){logger[_0x8bc5('0x23')](JSON[_0x8bc5('0x43')](_0x27ce32));return{'source':_0x27ce32[_0x8bc5('0x5b')][_0x8bc5('0x5c')],'resolvedQuery':_0x27ce32[_0x8bc5('0x5b')][_0x8bc5('0x5d')],'action':_0x27ce32[_0x8bc5('0x5b')]['action'],'actionIncomplete':_0x27ce32[_0x8bc5('0x5b')][_0x8bc5('0x5e')],'speech':_0x27ce32[_0x8bc5('0x5b')][_0x8bc5('0x5f')][_0x8bc5('0x60')],'score':_0x27ce32[_0x8bc5('0x5b')][_0x8bc5('0x61')],'statusCode':_0x27ce32[_0x8bc5('0x62')]['code'],'endConversation':_0x27ce32[_0x8bc5('0x5b')][_0x8bc5('0x63')][_0x8bc5('0x64')]||![],'isFallbackIntent':_0x27ce32['result'][_0x8bc5('0x63')][_0x8bc5('0x65')]};});};exports[_0x8bc5('0x66')]=function(_0x402e5e,_0x25f791,_0x50d8b8,_0x398565,_0x298a4e,_0x45e95b){var _0x4071bd=_0x398565[_0x8bc5('0x67')](/\\n/g,'\x0a');var _0x46b76a={'credentials':{'private_key':_0x4071bd,'client_email':_0x50d8b8}};var _0x542b16=new dialogflow[(_0x8bc5('0x68'))](_0x46b76a);var _0x995edd=_0x542b16[_0x8bc5('0x69')](_0x25f791,md5(_0x402e5e));var _0x4063b2={'session':_0x995edd,'queryInput':{'text':{'text':_0x298a4e,'languageCode':_0x45e95b}}};return _0x542b16['detectIntent'](_0x4063b2)[_0x8bc5('0x2b')](function(_0x491fea){if(_0x491fea&&_0x491fea[_0x8bc5('0x49')]){logger[_0x8bc5('0x23')](_0x8bc5('0x6a'),JSON[_0x8bc5('0x43')](_0x491fea));var _0x169bab=_0x491fea[0x0];if(_0x169bab){var _0xeeb738={'action':_0x169bab['queryResult'][_0x8bc5('0x6b')],'allRequiredParamsPresent':_0x169bab['queryResult'][_0x8bc5('0x6c')],'endConversation':_0x169bab['queryResult'][_0x8bc5('0x6d')]&&_0x169bab[_0x8bc5('0x6e')][_0x8bc5('0x6d')]['fields']?_0x169bab['queryResult']['diagnosticInfo'][_0x8bc5('0x6f')][_0x8bc5('0x70')]['boolValue']:![],'fulfillmentText':_0x169bab[_0x8bc5('0x6e')][_0x8bc5('0x71')],'intentName':_0x169bab[_0x8bc5('0x6e')][_0x8bc5('0x72')]['name'],'intentDisplayName':_0x169bab[_0x8bc5('0x6e')][_0x8bc5('0x72')]['displayName'],'isFallbackIntent':_0x169bab[_0x8bc5('0x6e')][_0x8bc5('0x72')][_0x8bc5('0x73')],'languageCode':_0x169bab[_0x8bc5('0x6e')][_0x8bc5('0x74')],'queryText':_0x169bab[_0x8bc5('0x6e')]['queryText'],'responseId':_0x169bab[_0x8bc5('0x75')],'score':_0x169bab[_0x8bc5('0x6e')][_0x8bc5('0x76')],'speech':_0x169bab[_0x8bc5('0x6e')][_0x8bc5('0x71')],'providerResponse':JSON[_0x8bc5('0x43')](_0x491fea)};return _0xeeb738;}}});};exports['tildeASR']=function(_0x1dfaf8,_0x180cc9,_0x2b804b,_0x529025){return tilde['asr'](_0x1dfaf8,_0x180cc9,_0x2b804b,_0x529025)[_0x8bc5('0x2b')](function(_0x23a267){try{fs['unlink'](_0x1dfaf8);}catch(_0x221c14){logger['error'](_0x221c14);}logger[_0x8bc5('0x23')](_0x8bc5('0x77'),_0x23a267['transcript']);logger['info']('Tilde\x20ASR\x20confidence',_0x23a267[_0x8bc5('0x53')]);return _0x23a267;});};exports[_0x8bc5('0x78')]=function(_0x5a60be,_0x5f14df,_0x4a7417,_0x10cd3a,_0x4e5179,_0x4da1fd){var _0x32e3d5=path[_0x8bc5('0x26')](__dirname,_0x8bc5('0x27'),rs[_0x8bc5('0x28')](0x4)+_0x8bc5('0x38'));var _0x31d4e8;return aws[_0x8bc5('0x79')](_0x5a60be,_0x5f14df,_0x4a7417,_0x10cd3a,_0x4e5179,_0x4da1fd,_0x32e3d5)['then'](function(){_0x31d4e8=path['resolve'](__dirname,_0x8bc5('0x27'),rs[_0x8bc5('0x28')](0x4)+_0x8bc5('0x29'));return convertFile(_0x32e3d5,_0x31d4e8);})[_0x8bc5('0x2b')](function(){try{fs[_0x8bc5('0x3d')](_0x32e3d5);fs['chmodSync'](_0x31d4e8,_0x8bc5('0x3c'));}catch(_0x522e09){logger['error'](_0x522e09);}return _0x31d4e8[_0x8bc5('0x2d')]('.')[0x0];});};exports[_0x8bc5('0x7a')]=function(_0x111139,_0x5bf398,_0x385f93,_0x366222,_0x4e1134,_0x23bf7e){return aws[_0x8bc5('0x7b')](_0x111139,_0x5bf398,_0x385f93,_0x366222,_0x4e1134,_0x23bf7e)[_0x8bc5('0x2b')](function(_0x394352){logger[_0x8bc5('0x23')](JSON['stringify'](_0x394352));return _0x394352;});};exports[_0x8bc5('0x7c')]=function(_0x124311,_0xabb480,_0x4c38f9,_0xb76531){var _0x57f34a=util['format'](_0x8bc5('0x7d'),ISPEECH_API,_0x124311,encodeURIComponent(_0xabb480),_0x4c38f9,_0xb76531);var _0x5ad55e=path[_0x8bc5('0x26')](__dirname,_0x8bc5('0x27'),rs[_0x8bc5('0x28')](0x4)+_0x8bc5('0x38'));var _0x48606f;return downloadFile(_0x57f34a,_0x5ad55e)[_0x8bc5('0x2b')](function(){_0x48606f=path[_0x8bc5('0x26')](__dirname,_0x8bc5('0x27'),rs[_0x8bc5('0x28')](0x4)+_0x8bc5('0x29'));return convertFile(_0x5ad55e,_0x48606f);})[_0x8bc5('0x2b')](function(){try{fs[_0x8bc5('0x3d')](_0x5ad55e);fs['chmodSync'](_0x48606f,_0x8bc5('0x3c'));}catch(_0x575bc1){logger[_0x8bc5('0x15')](_0x575bc1);}return _0x48606f['split']('.')[0x0];});};exports[_0x8bc5('0x7e')]=function(_0x459452,_0x467437,_0x6fc2de,_0x4734f0){var _0x77df6f=util[_0x8bc5('0x7f')](_0x8bc5('0x80'),ISPEECH_API,_0x467437,_0x6fc2de,base64Encode(_0x459452),_0x4734f0?util[_0x8bc5('0x7f')](_0x8bc5('0x81'),encodeURIComponent(_0x4734f0)):'freeform=3');return uploadFile(_0x77df6f)[_0x8bc5('0x2b')](function(_0x4704b5){return querystring['parse'](_0x4704b5);});};exports['sestekNDA']=function(_0x394c03,_0x4c9bfb){return sestek[_0x8bc5('0x82')](_0x394c03,_0x4c9bfb)[_0x8bc5('0x2b')](function(_0x2ccdb3){logger[_0x8bc5('0x23')](JSON['stringify'](_0x2ccdb3));var _0x19172d={'speech':_0x2ccdb3['text'],'action':_0x2ccdb3[_0x8bc5('0x83')]?_0x2ccdb3[_0x8bc5('0x83')][_0x8bc5('0x84')]:undefined,'actiondata':_0x2ccdb3[_0x8bc5('0x83')]?_0x2ccdb3['channelData']['CustomActionData']:undefined};if(_0x2ccdb3[_0x8bc5('0x83')]&&_0x2ccdb3[_0x8bc5('0x83')]['AudioFromTts']){return base64Decode(_0x2ccdb3['channelData']['AudioFromTts'][_0x8bc5('0x85')],path[_0x8bc5('0x26')](__dirname,_0x8bc5('0x27'),rs[_0x8bc5('0x28')](0x4)+'.wav'))[_0x8bc5('0x2b')](function(_0x40363c){_0x19172d[_0x8bc5('0x86')]=_0x40363c;return _0x19172d;});}return _0x19172d;});};exports[_0x8bc5('0x87')]=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 240fb8d..9ed66c4 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 _0xbf22=['exports'];(function(_0x2e7a9d,_0xd42e55){var _0x51ab1b=function(_0x1fad3a){while(--_0x1fad3a){_0x2e7a9d['push'](_0x2e7a9d['shift']());}};_0x51ab1b(++_0xd42e55);}(_0xbf22,0xc4));var _0x2bf2=function(_0x53d3fd,_0x9d9fb0){_0x53d3fd=_0x53d3fd-0x0;var _0x1f6f7e=_0xbf22[_0x53d3fd];return _0x1f6f7e;};var nda=require('./nda');module[_0x2bf2('0x0')]={'nda':nda}; \ No newline at end of file +var _0x3b7f=['exports','./nda'];(function(_0x557404,_0x1f162){var _0x2fdec8=function(_0x3f4ef2){while(--_0x3f4ef2){_0x557404['push'](_0x557404['shift']());}};_0x2fdec8(++_0x1f162);}(_0x3b7f,0x99));var _0xf3b7=function(_0xfc1680,_0x59384e){_0xfc1680=_0xfc1680-0x0;var _0x1111c0=_0x3b7f[_0xfc1680];return _0x1111c0;};var nda=require(_0xf3b7('0x0'));module[_0xf3b7('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 803a8a4..32c3fc8 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 _0xee4e=['then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','uniqueid','calleridname','dnid','extension','Bearer\x20','access_token','project','body','ndagenerate_audio','channelData','AudioOutputSettings','CustomAction','custom_action','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger','exports','POST','resolve','ndauth_url','/token','username','password'];(function(_0x5aca71,_0x583dfa){var _0x375f79=function(_0x3b2d5e){while(--_0x3b2d5e){_0x5aca71['push'](_0x5aca71['shift']());}};_0x375f79(++_0x583dfa);}(_0xee4e,0x122));var _0xeee4=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xee4e[_0x122096];return _0x3d1966;};'use strict';var rp=require(_0xeee4('0x0'));var url=require(_0xeee4('0x1'));var logger=require(_0xeee4('0x2'))('agi');module[_0xeee4('0x3')]=function(_0x827900,_0x33e574){var _0xea0952={'method':_0xeee4('0x4'),'uri':url[_0xeee4('0x5')](_0x33e574[_0xeee4('0x6')],_0xeee4('0x7')),'form':{'grant_type':'password','username':_0x33e574[_0xeee4('0x8')],'password':_0x33e574[_0xeee4('0x9')]},'json':!![]};return rp(_0xea0952)[_0xeee4('0xa')](function(_0x593262){var _0x25f0ed={'method':_0xeee4('0x4'),'uri':url[_0xeee4('0x5')](_0x33e574['ndassistant_url'],_0xeee4('0xb')),'body':{'type':_0x33e574[_0xeee4('0xc')]||_0xeee4('0xd'),'channelId':'Nda','conversation':{'id':_0x827900[_0xeee4('0xe')]},'from':{'id':_0x827900['callerid'],'name':_0x827900[_0xeee4('0xf')]},'recipient':{'id':_0x827900[_0xeee4('0x10')],'name':_0x827900[_0xeee4('0x11')]},'text':_0x33e574['text'],'channelData':{}},'headers':{'Authorization':_0xeee4('0x12')+_0x593262[_0xeee4('0x13')]},'json':!![]};if(_0x33e574[_0xeee4('0x14')]){_0x25f0ed[_0xeee4('0x15')]['channelData']['ProjectName']=_0x33e574[_0xeee4('0x14')];}if(_0x33e574[_0xeee4('0x16')]=='1'){_0x25f0ed[_0xeee4('0x15')][_0xeee4('0x17')][_0xeee4('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x33e574['custom_action']){_0x25f0ed[_0xeee4('0x15')][_0xeee4('0x17')][_0xeee4('0x19')]=_0x33e574[_0xeee4('0x1a')];if(_0x33e574[_0xeee4('0x1b')]){_0x25f0ed[_0xeee4('0x15')]['channelData'][_0xeee4('0x1c')]=_0x33e574['custom_action_data'];}}logger[_0xeee4('0x1d')](JSON['stringify'](_0x25f0ed));return rp(_0x25f0ed);});}; \ No newline at end of file +var _0x1db3=['custom_action','CustomActionData','custom_action_data','info','stringify','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','/token','password','username','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','calleridname','dnid','extension','Bearer\x20','access_token','project','body','channelData','ProjectName','AudioOutputSettings','audio/wav'];(function(_0x50a469,_0x239410){var _0x232555=function(_0x301ecf){while(--_0x301ecf){_0x50a469['push'](_0x50a469['shift']());}};_0x232555(++_0x239410);}(_0x1db3,0x1e5));var _0x31db=function(_0x466743,_0x5a50e0){_0x466743=_0x466743-0x0;var _0x898ddb=_0x1db3[_0x466743];return _0x898ddb;};'use strict';var rp=require('request-promise');var url=require(_0x31db('0x0'));var logger=require(_0x31db('0x1'))(_0x31db('0x2'));module[_0x31db('0x3')]=function(_0x840c38,_0x4537f0){var _0x1888ef={'method':_0x31db('0x4'),'uri':url[_0x31db('0x5')](_0x4537f0[_0x31db('0x6')],_0x31db('0x7')),'form':{'grant_type':_0x31db('0x8'),'username':_0x4537f0[_0x31db('0x9')],'password':_0x4537f0[_0x31db('0x8')]},'json':!![]};return rp(_0x1888ef)[_0x31db('0xa')](function(_0x44e204){var _0x3a431e={'method':_0x31db('0x4'),'uri':url[_0x31db('0x5')](_0x4537f0['ndassistant_url'],_0x31db('0xb')),'body':{'type':_0x4537f0[_0x31db('0xc')]||_0x31db('0xd'),'channelId':_0x31db('0xe'),'conversation':{'id':_0x840c38[_0x31db('0xf')]},'from':{'id':_0x840c38['callerid'],'name':_0x840c38[_0x31db('0x10')]},'recipient':{'id':_0x840c38[_0x31db('0x11')],'name':_0x840c38[_0x31db('0x12')]},'text':_0x4537f0['text'],'channelData':{}},'headers':{'Authorization':_0x31db('0x13')+_0x44e204[_0x31db('0x14')]},'json':!![]};if(_0x4537f0[_0x31db('0x15')]){_0x3a431e[_0x31db('0x16')][_0x31db('0x17')][_0x31db('0x18')]=_0x4537f0['project'];}if(_0x4537f0['ndagenerate_audio']=='1'){_0x3a431e[_0x31db('0x16')]['channelData'][_0x31db('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x31db('0x1a')};}if(_0x4537f0[_0x31db('0x1b')]){_0x3a431e[_0x31db('0x16')][_0x31db('0x17')]['CustomAction']=_0x4537f0['custom_action'];if(_0x4537f0['custom_action_data']){_0x3a431e[_0x31db('0x16')][_0x31db('0x17')][_0x31db('0x1c')]=_0x4537f0[_0x31db('0x1d')];}}logger[_0x31db('0x1e')](JSON[_0x31db('0x1f')](_0x3a431e));return rp(_0x3a431e);});}; \ 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 0863ff7..efbc060 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 _0x0c98=['./lib/api'];(function(_0x465c5e,_0x4b938e){var _0x55d352=function(_0x1889ee){while(--_0x1889ee){_0x465c5e['push'](_0x465c5e['shift']());}};_0x55d352(++_0x4b938e);}(_0x0c98,0x19e));var _0x80c9=function(_0x237a42,_0x4a98ca){_0x237a42=_0x237a42-0x0;var _0x3097e4=_0x0c98[_0x237a42];return _0x3097e4;};'use strict';var asr=require(_0x80c9('0x0'));module['exports']=function(_0x1e5b4f,_0x1ae5ca,_0x2d6f61,_0x4d51e6){return asr(_0x1e5b4f,_0x1ae5ca,_0x2d6f61,_0x4d51e6);}; \ No newline at end of file +var _0xcaae=['./lib/api','exports'];(function(_0x53e3de,_0x13da7b){var _0x7b905b=function(_0x29b56a){while(--_0x29b56a){_0x53e3de['push'](_0x53e3de['shift']());}};_0x7b905b(++_0x13da7b);}(_0xcaae,0xc0));var _0xecaa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcaae[_0x3dd15e];return _0x231fd0;};'use strict';var asr=require(_0xecaa('0x0'));module[_0xecaa('0x1')]=function(_0x4b5e31,_0x3cad28,_0x505fbc,_0x3207e1){return asr(_0x4b5e31,_0x3cad28,_0x505fbc,_0x3207e1);}; \ 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 1809b13..8bcb646 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 _0x275f=['moment','crypto','exports','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','update','digest','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','EOS','error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','bluebird'];(function(_0x1ebe5b,_0x22fbb5){var _0x3f47af=function(_0xa58097){while(--_0xa58097){_0x1ebe5b['push'](_0x1ebe5b['shift']());}};_0x3f47af(++_0x22fbb5);}(_0x275f,0x1bb));var _0xf275=function(_0x1488cd,_0x25a893){_0x1488cd=_0x1488cd-0x0;var _0x63fa13=_0x275f[_0x1488cd];return _0x63fa13;};'use strict';var BPromise=require(_0xf275('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xf275('0x1'));var crypto=require(_0xf275('0x2'));var logger=require('../../../../../../config/logger')('agi');module[_0xf275('0x3')]=function(_0x5f5c81,_0x240ad2,_0x3aef66,_0x18f7eb){return new BPromise(function(_0x58a9a2,_0x10e277){logger['info']('Tilde\x20URI',_0x18f7eb||_0xf275('0x4'));var _0x399f1f=new WebSocket(_0x18f7eb||_0xf275('0x4'),{'perMessageDeflate':![]});var _0x3ee0a1='';var _0x247caf='0';var _0x11943e='1';var _0x536b68=_0xf275('0x5');function _0x140cd1(_0x5d3dc8){var _0x42426b=crypto['createHash']('sha1');_0x42426b[_0xf275('0x6')](_0x5d3dc8);return _0x42426b[_0xf275('0x7')]('hex');}function _0x4b5334(){try{logger[_0xf275('0x8')](_0xf275('0x9'));var _0x2322da=moment()[_0xf275('0xa')]();var _0x318fda=_0x140cd1(_0x2322da+_0x240ad2+_0x3aef66);_0x399f1f[_0xf275('0xb')](JSON[_0xf275('0xc')]({'appID':_0x240ad2,'timestamp':_0x2322da,'appKey':_0x318fda}));var _0x1e8101=fs[_0xf275('0xd')](_0x5f5c81);_0x1e8101['on'](_0xf275('0xe'),function(_0x5a7dd1){_0x399f1f[_0xf275('0xb')](_0x5a7dd1);});_0x1e8101['on']('close',function(){_0x399f1f[_0xf275('0xb')](_0xf275('0xf'));});}catch(_0x1635e9){logger[_0xf275('0x10')]('Tilde\x20ASR\x20send\x20error',JSON[_0xf275('0xc')](_0x1635e9));_0x399f1f[_0xf275('0x11')]();}}function _0x209c44(_0x34f8ba){try{if(_0x34f8ba){var _0x26b2d5=JSON[_0xf275('0x12')](_0x34f8ba);switch(_0x26b2d5[_0xf275('0x13')]){case 0x0:if(_0x26b2d5[_0xf275('0x14')]){if(_0x26b2d5[_0xf275('0x14')][_0xf275('0x15')]){logger[_0xf275('0x8')](_0xf275('0x16'),JSON['stringify'](_0x26b2d5['result'][_0xf275('0x17')]));_0x3ee0a1=_0x26b2d5[_0xf275('0x14')][_0xf275('0x17')][0x0][_0xf275('0x18')];_0x247caf=_0x26b2d5[_0xf275('0x14')]['hypotheses'][0x0][_0xf275('0x19')];_0x11943e='0';_0x536b68='Success.';_0x399f1f[_0xf275('0x11')]();}}break;case 0x1:logger[_0xf275('0x8')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x11943e='1';_0x536b68=_0xf275('0x5');break;case 0x2:logger[_0xf275('0x8')](_0xf275('0x1a'));_0x11943e='2';_0x536b68=_0xf275('0x1a');break;case 0x9:logger[_0xf275('0x8')](_0xf275('0x1b'));_0x11943e='9';_0x536b68=_0xf275('0x1b');break;case 0xa:logger[_0xf275('0x8')]('Authentication\x20failed.');_0x11943e='10';_0x536b68='Authentication\x20failed.';break;case 0xb:logger[_0xf275('0x8')](_0xf275('0x1c'));_0x11943e='11';_0x536b68=_0xf275('0x1c');}}}catch(_0x4ad0a4){logger[_0xf275('0x10')](_0xf275('0x1d'),JSON[_0xf275('0xc')](_0x4ad0a4));_0x399f1f['terminate']();}}function _0x5d1dd4(){logger[_0xf275('0x8')](_0xf275('0x1e'));_0x58a9a2({'transcript':_0x3ee0a1,'confidence':_0x247caf,'status':_0x11943e,'status_message':_0x536b68});}function _0x30314e(_0x850be5){logger['error'](_0xf275('0x1f'));if(!_[_0xf275('0x20')](_0x850be5)){logger['error'](_[_0xf275('0x21')](_0x850be5)?JSON[_0xf275('0xc')](_0x850be5):_0x850be5);}}_0x399f1f['on'](_0xf275('0x22'),_0x4b5334);_0x399f1f['on'](_0xf275('0x23'),_0x209c44);_0x399f1f['on'](_0xf275('0x24'),_0x5d1dd4);_0x399f1f['on'](_0xf275('0x10'),_0x30314e);});}; \ No newline at end of file +var _0xcf0e=['wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','sha1','update','hex','info','Open\x20Tilde\x20ASR\x20socket','stringify','data','send','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isObject','open','message','lodash','moment','crypto','../../../../../../config/logger','agi','Tilde\x20URI'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xcf0e,0x13a));var _0xecf0=function(_0x35b18a,_0x6b2fbe){_0x35b18a=_0x35b18a-0x0;var _0x4db1bd=_0xcf0e[_0x35b18a];return _0x4db1bd;};'use strict';var BPromise=require('bluebird');var _=require(_0xecf0('0x0'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xecf0('0x1'));var crypto=require(_0xecf0('0x2'));var logger=require(_0xecf0('0x3'))(_0xecf0('0x4'));module['exports']=function(_0x329295,_0x17c62c,_0x89a1d5,_0x233131){return new BPromise(function(_0x1aba89,_0x250297){logger['info'](_0xecf0('0x5'),_0x233131||_0xecf0('0x6'));var _0x589d30=new WebSocket(_0x233131||_0xecf0('0x6'),{'perMessageDeflate':![]});var _0x5c71e0='';var _0x5c0b76='0';var _0x227d50='1';var _0x2bbf6d=_0xecf0('0x7');function _0x25f5a4(_0x512dfe){var _0x34c54b=crypto[_0xecf0('0x8')](_0xecf0('0x9'));_0x34c54b[_0xecf0('0xa')](_0x512dfe);return _0x34c54b['digest'](_0xecf0('0xb'));}function _0x1dc613(){try{logger[_0xecf0('0xc')](_0xecf0('0xd'));var _0x31be4c=moment()['unix']();var _0x53c721=_0x25f5a4(_0x31be4c+_0x17c62c+_0x89a1d5);_0x589d30['send'](JSON[_0xecf0('0xe')]({'appID':_0x17c62c,'timestamp':_0x31be4c,'appKey':_0x53c721}));var _0x8a583b=fs['createReadStream'](_0x329295);_0x8a583b['on'](_0xecf0('0xf'),function(_0xc7beff){_0x589d30[_0xecf0('0x10')](_0xc7beff);});_0x8a583b['on'](_0xecf0('0x11'),function(){_0x589d30[_0xecf0('0x10')](_0xecf0('0x12'));});}catch(_0x58c59f){logger[_0xecf0('0x13')](_0xecf0('0x14'),JSON['stringify'](_0x58c59f));_0x589d30[_0xecf0('0x15')]();}}function _0x38d408(_0x5c6504){try{if(_0x5c6504){var _0x7a2b96=JSON[_0xecf0('0x16')](_0x5c6504);switch(_0x7a2b96[_0xecf0('0x17')]){case 0x0:if(_0x7a2b96[_0xecf0('0x18')]){if(_0x7a2b96[_0xecf0('0x18')][_0xecf0('0x19')]){logger[_0xecf0('0xc')](_0xecf0('0x1a'),JSON[_0xecf0('0xe')](_0x7a2b96[_0xecf0('0x18')][_0xecf0('0x1b')]));_0x5c71e0=_0x7a2b96[_0xecf0('0x18')][_0xecf0('0x1b')][0x0][_0xecf0('0x1c')];_0x5c0b76=_0x7a2b96[_0xecf0('0x18')][_0xecf0('0x1b')][0x0][_0xecf0('0x1d')];_0x227d50='0';_0x2bbf6d=_0xecf0('0x1e');_0x589d30['terminate']();}}break;case 0x1:logger[_0xecf0('0xc')](_0xecf0('0x7'));_0x227d50='1';_0x2bbf6d='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xecf0('0xc')](_0xecf0('0x1f'));_0x227d50='2';_0x2bbf6d=_0xecf0('0x1f');break;case 0x9:logger[_0xecf0('0xc')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x227d50='9';_0x2bbf6d=_0xecf0('0x20');break;case 0xa:logger[_0xecf0('0xc')]('Authentication\x20failed.');_0x227d50='10';_0x2bbf6d=_0xecf0('0x21');break;case 0xb:logger['info'](_0xecf0('0x22'));_0x227d50='11';_0x2bbf6d=_0xecf0('0x22');}}}catch(_0x115e4e){logger[_0xecf0('0x13')](_0xecf0('0x23'),JSON['stringify'](_0x115e4e));_0x589d30['terminate']();}}function _0x49bbf4(){logger[_0xecf0('0xc')]('Close\x20Tilde\x20ASR\x20socket');_0x1aba89({'transcript':_0x5c71e0,'confidence':_0x5c0b76,'status':_0x227d50,'status_message':_0x2bbf6d});}function _0x487c85(_0x1078ba){logger[_0xecf0('0x13')](_0xecf0('0x24'));if(!_['isNil'](_0x1078ba)){logger['error'](_[_0xecf0('0x25')](_0x1078ba)?JSON[_0xecf0('0xe')](_0x1078ba):_0x1078ba);}}_0x589d30['on'](_0xecf0('0x26'),_0x1dc613);_0x589d30['on'](_0xecf0('0x27'),_0x38d408);_0x589d30['on'](_0xecf0('0x11'),_0x49bbf4);_0x589d30['on'](_0xecf0('0x13'),_0x487c85);});}; \ 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 8e4d34d..5ab8f26 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 _0x561d=['exports'];(function(_0x572293,_0x4cc5bb){var _0x38fac3=function(_0x4e5a85){while(--_0x4e5a85){_0x572293['push'](_0x572293['shift']());}};_0x38fac3(++_0x4cc5bb);}(_0x561d,0x1e3));var _0xd561=function(_0x32e165,_0x3ff2f9){_0x32e165=_0x32e165-0x0;var _0x1c4867=_0x561d[_0x32e165];return _0x1c4867;};var asr=require('./asr');module[_0xd561('0x0')]={'asr':asr}; \ No newline at end of file +var _0x43d6=['./asr','exports'];(function(_0x2a5f5b,_0x1eecda){var _0x5da4e5=function(_0x5a0d85){while(--_0x5a0d85){_0x2a5f5b['push'](_0x2a5f5b['shift']());}};_0x5da4e5(++_0x1eecda);}(_0x43d6,0x176));var _0x643d=function(_0x2da95d,_0x520946){_0x2da95d=_0x2da95d-0x0;var _0x111a21=_0x43d6[_0x2da95d];return _0x111a21;};var asr=require(_0x643d('0x0'));module[_0x643d('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 33b39e5..b382a3b 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 _0xa9e0=['ready','E_AGI_SERVER_ERROR','close','E_AGI_SERVER_CLOSE','inherits','exports','util','net','events','./channel','call','emit','createServer','listening','connection','getConnections','error','E_AGI_SERVER_VOICE_DISABLED','destroy'];(function(_0x500785,_0x15e5ff){var _0x1f8bcc=function(_0x406983){while(--_0x406983){_0x500785['push'](_0x500785['shift']());}};_0x1f8bcc(++_0x15e5ff);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var util=require(_0x0a9e('0x0'));var net=require(_0x0a9e('0x1'));var EventEmitter=require(_0x0a9e('0x2'))['EventEmitter'];var AGIError=require('./error');var AGIChannel=require(_0x0a9e('0x3'));var AGIServer=function(_0x4ce2f1,_0x333808,_0x432180){var _0x2ab90b=this;var _0x991246=null;var _0x981158=0x0;if(!_0x4ce2f1)_0x4ce2f1=0x11dd;if(!_0x333808)_0x333808='127.0.0.1';EventEmitter[_0x0a9e('0x4')](_0x2ab90b);function _0x441e3a(){if(!_0x4ce2f1){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x991246=net[_0x0a9e('0x6')]();_0x991246['listen'](_0x4ce2f1,_0x333808);_0x991246['on']('listening',function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x7'));});_0x991246['on'](_0x0a9e('0x8'),function(_0x3ab53f){_0x991246[_0x0a9e('0x9')](function(_0xbd1168,_0x4a4c56){if(_0xbd1168){_0x2ab90b['emit']('error',new AGIError('E_AGI_SERVER_ERROR',_0xbd1168));}else if(_0x432180&&_0x432180<0x0){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError(_0x0a9e('0xb')));_0x3ab53f[_0x0a9e('0xc')]();}else if(_0x432180&&_0x432180>0x0&&_0x432180<_0x4a4c56){_0x981158+=0x1;_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0xa'),new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x981158));_0x3ab53f[_0x0a9e('0xc')]();}else{var _0x239b12=new AGIChannel(_0x3ab53f);_0x239b12['on'](_0x0a9e('0xd'),function(){_0x2ab90b[_0x0a9e('0x5')](_0x0a9e('0x8'),_0x239b12);});}});});_0x991246['on'](_0x0a9e('0xa'),function(_0x52a03d){_0x2ab90b[_0x0a9e('0x5')]('error',new AGIError(_0x0a9e('0xe'),_0x52a03d['code']));});_0x991246['on'](_0x0a9e('0xf'),function(){_0x2ab90b[_0x0a9e('0x5')]('close',new AGIError(_0x0a9e('0x10')));});}process['nextTick'](function(){_0x441e3a();});};util[_0x0a9e('0x11')](AGIServer,EventEmitter);module[_0x0a9e('0x12')]=function(_0x106033,_0x205fd6,_0x31b1ca){return new AGIServer(_0x106033,_0x205fd6,_0x31b1ca);}; \ No newline at end of file +var _0x9c44=['./error','./channel','127.0.0.1','call','emit','error','createServer','listen','listening','getConnections','destroy','E_AGI_SERVER_MAXCONNECTION','ready','connection','E_AGI_SERVER_ERROR','code','close','E_AGI_SERVER_CLOSE','nextTick','events','EventEmitter'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c44,0x178));var _0x49c4=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0x9c44[_0x5f09c5];return _0x426ad9;};'use strict';var util=require('util');var net=require('net');var EventEmitter=require(_0x49c4('0x0'))[_0x49c4('0x1')];var AGIError=require(_0x49c4('0x2'));var AGIChannel=require(_0x49c4('0x3'));var AGIServer=function(_0x455700,_0x2ad237,_0x4e0313){var _0x4941f1=this;var _0x41a183=null;var _0x57effd=0x0;if(!_0x455700)_0x455700=0x11dd;if(!_0x2ad237)_0x2ad237=_0x49c4('0x4');EventEmitter[_0x49c4('0x5')](_0x4941f1);function _0x69bc41(){if(!_0x455700){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x41a183=net[_0x49c4('0x8')]();_0x41a183[_0x49c4('0x9')](_0x455700,_0x2ad237);_0x41a183['on'](_0x49c4('0xa'),function(){_0x4941f1[_0x49c4('0x6')]('listening');});_0x41a183['on']('connection',function(_0x451ea6){_0x41a183[_0x49c4('0xb')](function(_0x58cad7,_0xb611a1){if(_0x58cad7){_0x4941f1[_0x49c4('0x6')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x58cad7));}else if(_0x4e0313&&_0x4e0313<0x0){_0x4941f1[_0x49c4('0x6')](_0x49c4('0x7'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x451ea6[_0x49c4('0xc')]();}else if(_0x4e0313&&_0x4e0313>0x0&&_0x4e0313<_0xb611a1){_0x57effd+=0x1;_0x4941f1[_0x49c4('0x6')]('error',new AGIError(_0x49c4('0xd'),_0x57effd));_0x451ea6[_0x49c4('0xc')]();}else{var _0x21f15a=new AGIChannel(_0x451ea6);_0x21f15a['on'](_0x49c4('0xe'),function(){_0x4941f1[_0x49c4('0x6')](_0x49c4('0xf'),_0x21f15a);});}});});_0x41a183['on'](_0x49c4('0x7'),function(_0x3de397){_0x4941f1['emit'](_0x49c4('0x7'),new AGIError(_0x49c4('0x10'),_0x3de397[_0x49c4('0x11')]));});_0x41a183['on'](_0x49c4('0x12'),function(){_0x4941f1[_0x49c4('0x6')]('close',new AGIError(_0x49c4('0x13')));});}process[_0x49c4('0x14')](function(){_0x69bc41();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x3c782d,_0x2f82d5,_0x3addb2){return new AGIServer(_0x3c782d,_0x2f82d5,_0x3addb2);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 0fc9059..e9f51a9 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 _0x9a86=['Answer','Skipped\x20Answer','subproject','project_id','no\x20subproject\x20selected','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','AGI','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','rpc','mailRpc','getVariableById','name','prototype','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','then','catch','getSquareOdbc','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','label','agicommand','createSquareRecording','callerid','calleridname','extension','accountcode','dnid','arg_1','createSquareMessage','createCmContact','isNil','random','isEmpty','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','getPauseById','agentPause','agentUnpause','agent','agentLogout','agentLogin','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','apiKey','google_cloud_tts_text_type','text','languageCode','ssmlGender','MALE','MP3','googleTTS','google_tts_language','restAPI','url','timeout','number','includes','method','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','message','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','speed','ispeechASR','ispeech_asr_language','en-US','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','awsLex','aws_lex_region','aws_bot_name','googleASR','appid','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isArray','length','saveRestApiResult','isPlainObject','%s.%s','setVariable','split','replaceAll','getVariable','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','isConfigured','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','getQueryOdbc','variable_id','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','sip_id','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','dialogflowV2_project_id','no\x20client_email\x20configured','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','dialogflowV2','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','streamFile','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','response','maxdigit','test','mindigit','no\x20variable\x20found','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','GOAL\x20%s','goalname','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','amazonlex','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','context','priority','no\x20condition\x20configured','condition','true','false','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','intKey','ispeech\x20TTS\x20is\x20unreachable','login','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','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','failure','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','pause_id','playback','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','QUEUE','macro','gosub','record','recordingFormat','%s_%s','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','set','no\x20variable\x20selected','start','Enter\x20in\x20START\x20(%s)\x20block','yes'];(function(_0x560448,_0x2c1082){var _0x550276=function(_0x37e949){while(--_0x37e949){_0x560448['push'](_0x560448['shift']());}};_0x550276(++_0x2c1082);}(_0x9a86,0x1ed));var _0x69a8=function(_0x4c98b9,_0x1ad11b){_0x4c98b9=_0x4c98b9-0x0;var _0x3a257a=_0x9a86[_0x4c98b9];return _0x3a257a;};'use strict';var fs=require('fs');var util=require(_0x69a8('0x0'));var _=require(_0x69a8('0x1'));var sh=require('shelljs');var odbc=require(_0x69a8('0x2'))();var rs=require(_0x69a8('0x3'));var moment=require(_0x69a8('0x4'));var Mustache=require(_0x69a8('0x5'));var rp=require(_0x69a8('0x6'));var logger=require(_0x69a8('0x7'))(_0x69a8('0x8'));var config=require(_0x69a8('0x9'));var shared=require(_0x69a8('0xa'));var scripts=require(_0x69a8('0xb'));var FILES_PATH=_0x69a8('0xc');var recursiveMapAttributes=[_0x69a8('0xd'),_0x69a8('0xe')];var verticesWithRetry=[_0x69a8('0xf'),_0x69a8('0x10'),_0x69a8('0x11')];var AGIVertices=function(_0x54248e,_0x10a1e7,_0xaf3ed6){this['channel']=_0x54248e;this[_0x69a8('0x12')]=_0x10a1e7;this[_0x69a8('0x13')]=_0xaf3ed6;};AGIVertices['prototype']['getVariable']=function(_0x43c11e,_0xf7e885){this[_0x69a8('0x12')][_0x69a8('0x14')](_0x43c11e)['then'](function(_0x4e818b){_0xf7e885(null,_0x4e818b?_0x4e818b[_0x69a8('0x15')]:![]);})['catch'](function(_0x18f782){_0xf7e885(_0x18f782);});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x17')]=function(_0x12b148,_0x272100){this['rpc'][_0x69a8('0x18')](_0x12b148)['then'](function(_0x381a2a){_0x272100(null,_0x381a2a?_0x381a2a[_0x69a8('0x15')]:![]);})['catch'](function(_0x33b701){_0x272100(_0x33b701);});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x19')]=function(_0x35906f,_0x1d3ebf){this[_0x69a8('0x12')][_0x69a8('0x1a')](_0x35906f)[_0x69a8('0x1b')](function(_0x3c6252){_0x1d3ebf(null,_0x3c6252?_0x3c6252[_0x69a8('0x15')]:![]);})[_0x69a8('0x1c')](function(_0x5e123c){_0x1d3ebf(_0x5e123c);});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x1d')]=function(_0x237232,_0x4a769a){this[_0x69a8('0x12')]['getSquareOdbcById'](_0x237232)[_0x69a8('0x1b')](function(_0x2db796){_0x4a769a(null,_0x2db796?_0x2db796[_0x69a8('0x1e')]:![]);})[_0x69a8('0x1c')](function(_0x23df9e){_0x4a769a(_0x23df9e);});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x1f')]=function(_0x40a35d,_0x363fc0){this[_0x69a8('0x12')][_0x69a8('0x20')](_0x40a35d)[_0x69a8('0x1b')](function(_0x33e39c){_0x363fc0(null,_0x33e39c?_0x33e39c['name']:![]);})['catch'](function(_0x2381bf){_0x363fc0(_0x2381bf);});};AGIVertices['prototype'][_0x69a8('0x21')]=function(_0x115cdd,_0x45f1e9){this[_0x69a8('0x12')][_0x69a8('0x22')](_0x115cdd)[_0x69a8('0x1b')](function(_0x21412d){_0x45f1e9(null,_0x21412d?_0x21412d[_0x69a8('0x15')]:![]);})[_0x69a8('0x1c')](function(_0x1c9588){_0x45f1e9(_0x1c9588);});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x23')]=function(_0x3d0754,_0xb61a04){var _0x2244c7=this;this[_0x69a8('0x12')][_0x69a8('0x24')](_0x3d0754)[_0x69a8('0x1b')](function(_0x3242ef){_0xb61a04(null,_0x3242ef?_0x2244c7[_0x69a8('0x25')](_0x3242ef[_0x69a8('0x26')]):![]);})['catch'](function(_0x24f1d1){_0xb61a04(_0x24f1d1);});};AGIVertices[_0x69a8('0x16')]['getMailAccount']=function(_0x2e7355,_0x5c8981){this[_0x69a8('0x12')][_0x69a8('0x27')](_0x2e7355)['then'](function(_0x51a25e){_0x5c8981(null,_0x51a25e?_0x51a25e:![]);})[_0x69a8('0x1c')](function(_0x2dbdb0){_0x5c8981(_0x2dbdb0);});};AGIVertices['prototype'][_0x69a8('0x28')]=function(_0x4fd0ee,_0x3fc8a9,_0x19a271){this['mailRpc']['sendMailMessage'](_0x4fd0ee,_0x3fc8a9)[_0x69a8('0x1b')](function(){_0x19a271(null);})[_0x69a8('0x1c')](function(_0x1561e3){_0x19a271(_0x1561e3);});};AGIVertices['prototype'][_0x69a8('0x29')]=function(_0x4c8279,_0x131fd9){this[_0x69a8('0x12')][_0x69a8('0x2a')](_0x4c8279)[_0x69a8('0x1b')](function(_0x5965c1){if(_0x5965c1){if(_0x5965c1[_0x69a8('0x2b')]){_0x131fd9(null,[_0x5965c1[_0x69a8('0x2c')]]);}else{_0x131fd9(null,_[_0x69a8('0x2d')](_0x5965c1[_0x69a8('0x2e')],_0x69a8('0x2c')));}}else{_0x131fd9(null,![]);}})['catch'](function(_0x5c3673){_0x131fd9(_0x5c3673);});};AGIVertices[_0x69a8('0x16')]['getSoundPath']=function(_0x51f130){return util[_0x69a8('0x2f')]('%s/sounds/converted/%s',FILES_PATH,_0x51f130);};AGIVertices[_0x69a8('0x16')]['getQueryOdbc']=function(_0x51a7ca,_0x1273be,_0x38037f){odbc[_0x69a8('0x30')](_0x51a7ca,function(_0x451310){if(_0x451310){logger[_0x69a8('0x31')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x451310);_0x38037f(_0x451310);}else{logger[_0x69a8('0x32')](_0x69a8('0x33'));odbc[_0x69a8('0x34')](_0x1273be,function(_0x3c30ce,_0x16744d){if(_0x3c30ce){logger[_0x69a8('0x32')](_0x69a8('0x35'),_0x1273be);_0x38037f(_0x3c30ce);}else{logger[_0x69a8('0x32')](_0x69a8('0x36'),_0x1273be);odbc[_0x69a8('0x37')](function(_0x5a80a8){if(_0x5a80a8){logger[_0x69a8('0x31')](_0x69a8('0x38'),_0x5a80a8);}_0x38037f(null,_0x16744d);});}});}});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x39')]=function(_0x54204c,_0x19d2f0){this['rpc'][_0x69a8('0x3a')](_0x54204c)['then'](function(_0x2559bf){_0x19d2f0(null,_0x2559bf?_0x2559bf:![]);})[_0x69a8('0x1c')](function(_0x36b2a1){_0x19d2f0(_0x36b2a1);});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x3b')]=function(_0x412b42,_0x2269d6){this[_0x69a8('0x12')]['createSmsMessage'](_0x412b42)['then'](function(_0x279dac){_0x2269d6(null,_0x279dac);})[_0x69a8('0x1c')](function(_0x228739){_0x2269d6(_0x228739);});};AGIVertices['prototype'][_0x69a8('0x3c')]=function(_0x3e0da3,_0x5aed65,_0x39895a){this['rpc'][_0x69a8('0x3c')]({'uniqueid':this[_0x69a8('0x3d')][_0x69a8('0x3e')],'node':_0x3e0da3[_0x69a8('0x3f')],'application':_0x3e0da3[_0x69a8('0x40')],'data':_0x5aed65||null,'project_name':this[_0x69a8('0x3d')]['arg_1'],'callerid':this['channel']['callerid']})['then'](function(_0x16eba3){if(_0x39895a){_0x39895a(null,_0x16eba3);}})[_0x69a8('0x1c')](function(_0x403c40){if(_0x39895a){_0x39895a(_0x403c40);}});};AGIVertices[_0x69a8('0x16')]['createSquareRecording']=function(_0x2480ca,_0x5580d2,_0x34c461,_0x3c831e){this[_0x69a8('0x12')][_0x69a8('0x41')]({'uniqueid':this[_0x69a8('0x3d')][_0x69a8('0x3e')],'callerid':this[_0x69a8('0x3d')][_0x69a8('0x42')],'calleridname':this[_0x69a8('0x3d')][_0x69a8('0x43')],'context':this[_0x69a8('0x3d')]['context'],'extension':this[_0x69a8('0x3d')][_0x69a8('0x44')],'priority':this[_0x69a8('0x3d')]['priority'],'accountcode':this[_0x69a8('0x3d')][_0x69a8('0x45')],'dnid':this['channel'][_0x69a8('0x46')],'projectName':this[_0x69a8('0x3d')][_0x69a8('0x47')],'saveName':_0x5580d2,'filename':_0x2480ca['file']||_0x5580d2,'savePath':_0x34c461})[_0x69a8('0x1b')](function(_0x3512fd){_0x3c831e(null,_0x3512fd);})[_0x69a8('0x1c')](function(_0x243370){_0x3c831e(_0x243370);});};AGIVertices['prototype']['createSquareMessage']=function(_0x231213,_0x54bc76,_0x250c29,_0x54c2f0,_0x4e930f){this[_0x69a8('0x12')][_0x69a8('0x48')]({'uniqueid':this[_0x69a8('0x3d')][_0x69a8('0x3e')],'body':_0x231213,'direction':_0x54bc76,'providerName':_0x250c29,'providerResponse':_0x54c2f0})['then'](function(_0xfed272){if(_0x4e930f){_0x4e930f(null,_0xfed272);}})[_0x69a8('0x1c')](function(_0x36dd79){if(_0x4e930f){_0x4e930f(_0x36dd79);}});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x49')]=function(_0x4fb1f3,_0x270320){this[_0x69a8('0x12')][_0x69a8('0x49')]({'firstName':_['isEmpty'](_0x4fb1f3[_0x69a8('0x15')])||_[_0x69a8('0x4a')](_0x4fb1f3[_0x69a8('0x15')])?'callback_'+Math[_0x69a8('0x4b')]():_0x4fb1f3[_0x69a8('0x15')],'lastName':_[_0x69a8('0x4c')](_0x4fb1f3[_0x69a8('0x4d')])||_['isNil'](_0x4fb1f3[_0x69a8('0x4d')])?null:_0x4fb1f3[_0x69a8('0x4d')],'phone':_0x4fb1f3[_0x69a8('0x4e')],'ListId':_0x4fb1f3[_0x69a8('0x4f')],'scheduledat':_0x4fb1f3[_0x69a8('0x50')],'callbackUniqueid':this[_0x69a8('0x3d')][_0x69a8('0x3e')],'tags':_0x69a8('0x51'),'description':'Callback\x20scheduled\x20at\x20'+_0x4fb1f3['scheduledAt'][_0x69a8('0x52')](),'priority':_0x4fb1f3[_0x69a8('0x53')]})[_0x69a8('0x1b')](function(_0x4698ca){_0x270320(null,_0x4698ca);})[_0x69a8('0x1c')](function(_0x47c6cb){_0x270320(_0x47c6cb);});};AGIVertices['prototype']['getPause']=function(_0xce9ef0,_0x32542b){this[_0x69a8('0x12')][_0x69a8('0x54')](_0xce9ef0)[_0x69a8('0x1b')](function(_0x53dcbc){_0x32542b(null,_0x53dcbc?_0x53dcbc['name']:![]);})[_0x69a8('0x1c')](function(_0x286eea){_0x32542b(_0x286eea);});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x55')]=function(_0x4f1bbc,_0x1d8dda,_0x9c7438){var _0x387703={'role':'agent'};_0x387703[_0x4f1bbc]=this[_0x69a8('0x3d')][_0x69a8('0x42')];this[_0x69a8('0x12')][_0x69a8('0x55')](_0x387703,_0x1d8dda,this[_0x69a8('0x3d')][_0x69a8('0x3e')])['then'](function(_0x116fd9){_0x9c7438(null,_[_0x69a8('0x4a')](_0x116fd9)?![]:!![]);})[_0x69a8('0x1c')](function(_0x3662de){logger[_0x69a8('0x31')](_0x3662de);_0x9c7438(null,![]);});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x56')]=function(_0x347106,_0x40580f){var _0x3c26af={'role':_0x69a8('0x57')};_0x3c26af[_0x347106]=this[_0x69a8('0x3d')][_0x69a8('0x42')];this[_0x69a8('0x12')][_0x69a8('0x56')](_0x3c26af)[_0x69a8('0x1b')](function(_0x57b944){_0x40580f(null,_[_0x69a8('0x4a')](_0x57b944)?![]:!![]);})['catch'](function(_0x43d082){logger[_0x69a8('0x31')](_0x43d082);_0x40580f(null,![]);});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x58')]=function(_0x517621,_0x31ff6f){var _0x4c1250={'role':'agent'};_0x4c1250[_0x517621]=this['channel'][_0x69a8('0x42')];this[_0x69a8('0x12')][_0x69a8('0x58')](_0x4c1250)[_0x69a8('0x1b')](function(_0x494ad6){_0x31ff6f(null,_[_0x69a8('0x4a')](_0x494ad6)?![]:!![]);})[_0x69a8('0x1c')](function(_0x2c210c){logger['error'](_0x2c210c);_0x31ff6f(null,![]);});};AGIVertices['prototype'][_0x69a8('0x59')]=function(_0x5cdca7,_0x4cc15a){var _0x2ed0bb={'role':_0x69a8('0x57')};_0x2ed0bb[_0x5cdca7]=this[_0x69a8('0x3d')][_0x69a8('0x42')];var _0x40880f=_0x5cdca7!='internal'?util[_0x69a8('0x2f')](_0x69a8('0x5a'),_0x69a8('0x5b'),this[_0x69a8('0x3d')]['callerid']):undefined;this[_0x69a8('0x12')][_0x69a8('0x59')](_0x2ed0bb,_0x40880f)['then'](function(_0x367ea1){_0x4cc15a(null,_['isNil'](_0x367ea1)?![]:!![]);})[_0x69a8('0x1c')](function(_0x2e292e){logger[_0x69a8('0x31')](_0x2e292e);_0x4cc15a(null,![]);});};AGIVertices['prototype'][_0x69a8('0x5c')]=function(_0x19df24,_0x44b7f3){sh[_0x69a8('0x5d')](_[_0x69a8('0x5e')](_0x19df24),function(_0x4c0f64,_0x38ecaf){var _0x57b807=_0x38ecaf[_0x69a8('0x5f')](/(\r\n|\n|\r)/gm,'');_0x44b7f3(null,_0x57b807);});};AGIVertices[_0x69a8('0x16')]['googleCloudTTS']=function(_0xe5023,_0x237dab){scripts['googleCloudTTS'](_0xe5023[_0x69a8('0x60')],_0xe5023[_0x69a8('0x61')]||_0x69a8('0x62'),_0xe5023[_0x69a8('0x62')],_0xe5023[_0x69a8('0x63')]||'en-US',_0xe5023[_0x69a8('0x64')]||_0x69a8('0x65'),_0xe5023['audioEncoding']||_0x69a8('0x66'))[_0x69a8('0x1b')](function(_0x456528){_0x237dab(null,_0x456528);})[_0x69a8('0x1c')](function(_0x4d4aad){_0x237dab(_0x4d4aad);});};AGIVertices['prototype'][_0x69a8('0x67')]=function(_0x2c8b1a,_0x562240){scripts['googleTTS'](_0x2c8b1a[_0x69a8('0x62')],_0x2c8b1a[_0x69a8('0x68')]||'en',0x1)['then'](function(_0x5d0bb5){_0x562240(null,_0x5d0bb5);})[_0x69a8('0x1c')](function(_0x228757){_0x562240(_0x228757);});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x69')]=function(_0x402147,_0x4a0741){var _0x378e08={'uri':_0x402147[_0x69a8('0x6a')],'method':_0x402147['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x402147[_0x69a8('0x6b')])===_0x69a8('0x6c')&&parseInt(_0x402147[_0x69a8('0x6b')])>=0x1?parseInt(_0x402147['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x69a8('0x6d')](['POST','PUT'],_0x378e08[_0x69a8('0x6e')][_0x69a8('0x6f')]())){try{_0x378e08[_0x69a8('0x70')]=_0x402147[_0x69a8('0xe')]?JSON[_0x69a8('0x71')](_0x402147[_0x69a8('0xe')]):{};}catch(_0x185e11){logger[_0x69a8('0x31')](_0x69a8('0x72'),_0x185e11);}}try{_0x378e08[_0x69a8('0x73')]=_0x402147['rawHeaders']?JSON[_0x69a8('0x71')](_0x402147['rawHeaders']):{};}catch(_0x45d779){logger[_0x69a8('0x31')](_0x69a8('0x74'),_0x45d779);}if(_0x402147[_0x69a8('0x75')]){try{var _0x4d5be4=require(_0x402147[_0x69a8('0x75')])[_0x69a8('0x76')](this,_0x378e08);_0x378e08[_0x69a8('0x77')]=Mustache[_0x69a8('0x78')](_0x402147[_0x69a8('0x6a')],_0x4d5be4,{},['$$','$$']);if(_0x378e08[_0x69a8('0x73')]){_0x378e08[_0x69a8('0x73')]=JSON[_0x69a8('0x71')](Mustache[_0x69a8('0x78')](JSON[_0x69a8('0x79')](_0x378e08[_0x69a8('0x73')]),_0x4d5be4,{},['$$','$$']));}if(_0x378e08[_0x69a8('0x70')]){_0x378e08[_0x69a8('0x70')]=JSON[_0x69a8('0x71')](Mustache['render'](JSON[_0x69a8('0x79')](_0x378e08[_0x69a8('0x70')]),_0x4d5be4,{},['$$','$$']));}}catch(_0x583672){logger['error'](_0x69a8('0x7a'),_0x583672);}}rp(_0x378e08)['then'](function(_0x470e4a){var _0x259445={'statusCode':_0x470e4a[_0x69a8('0x7b')]||0xc8,'statusMessage':_0x470e4a['statusMessage']||'OK','headers':_0x470e4a[_0x69a8('0x73')]||{},'body':_0x470e4a[_0x69a8('0x70')]||{}};_0x4a0741(null,_0x259445);})[_0x69a8('0x1c')](function(_0x1993c9){var _0x51e957={'statusCode':_0x1993c9['statusCode']||0x1f4,'statusMessage':_0x1993c9[_0x69a8('0x7c')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x1993c9[_0x69a8('0x7d')][_0x69a8('0x73')]||{},'body':_0x1993c9['options'][_0x69a8('0x70')]||{}};_0x4a0741(null,_0x51e957);});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x7e')]=function(_0x3604f4,_0x1428d9){scripts['googleDialogflow'](this[_0x69a8('0x3d')][_0x69a8('0x3e')],_0x3604f4[_0x69a8('0x7f')],_0x3604f4['text'],_0x3604f4[_0x69a8('0x80')]||'en')[_0x69a8('0x1b')](function(_0x275513){_0x1428d9(null,_0x275513);})[_0x69a8('0x1c')](function(_0x2481ba){_0x1428d9(_0x2481ba);});};AGIVertices[_0x69a8('0x16')]['googleDialogflowV2']=function(_0x3f13b5,_0xb2add1){scripts[_0x69a8('0x81')](this[_0x69a8('0x3d')]['uniqueid'],_0x3f13b5['dialogflowV2_project_id'],_0x3f13b5[_0x69a8('0x82')],_0x3f13b5[_0x69a8('0x83')],_0x3f13b5[_0x69a8('0x62')],_0x3f13b5[_0x69a8('0x84')]||'en')[_0x69a8('0x1b')](function(_0x5888a3){_0xb2add1(null,_0x5888a3);})[_0x69a8('0x1c')](function(_0x384893){_0xb2add1(_0x384893);});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x85')]=function(_0x1507a8,_0x546a8f){scripts[_0x69a8('0x85')](this[_0x69a8('0x3d')],_0x1507a8)[_0x69a8('0x1b')](function(_0x2498e9){_0x546a8f(null,_0x2498e9);})['catch'](function(_0x52bbf8){_0x546a8f(_0x52bbf8);});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x86')]=function(_0x5d7665,_0x255af1){scripts['ispeechTTS'](_0x5d7665[_0x69a8('0x7f')],_0x5d7665[_0x69a8('0x62')],_0x5d7665['ispeech_tts_language']||'en-US',_0x5d7665[_0x69a8('0x87')])[_0x69a8('0x1b')](function(_0x255d6e){_0x255af1(null,_0x255d6e);})[_0x69a8('0x1c')](function(_0x508ec5){_0x255af1(_0x508ec5);});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x88')]=function(_0x139b3d,_0x1c1c36,_0xfc314b){scripts[_0x69a8('0x88')](_0x1c1c36,_0x139b3d[_0x69a8('0x7f')],_0x139b3d[_0x69a8('0x89')]||_0x69a8('0x8a'),this['isConfigured'](_0x139b3d[_0x69a8('0x8b')])?_0x139b3d[_0x69a8('0x8b')]:undefined)[_0x69a8('0x1b')](function(_0x3b0d29){_0xfc314b(null,_0x3b0d29);})[_0x69a8('0x1c')](function(_0x98ddd8){_0xfc314b(_0x98ddd8);});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x8c')]=function(_0x54edb2,_0x194831){scripts[_0x69a8('0x8c')](_0x54edb2[_0x69a8('0x8d')],_0x54edb2[_0x69a8('0x8e')],_0x54edb2[_0x69a8('0x8f')],_0x54edb2[_0x69a8('0x90')]||'Amy',_0x54edb2[_0x69a8('0x62')],_0x54edb2['aws_text_type']||_0x69a8('0x62'))[_0x69a8('0x1b')](function(_0x2fadbc){_0x194831(null,_0x2fadbc);})[_0x69a8('0x1c')](function(_0x5ab484){_0x194831(_0x5ab484);});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x91')]=function(_0x27cc56,_0x1aaf84){scripts[_0x69a8('0x91')](this[_0x69a8('0x3d')][_0x69a8('0x3e')],_0x27cc56[_0x69a8('0x8d')],_0x27cc56[_0x69a8('0x8e')],_0x27cc56[_0x69a8('0x92')],_0x27cc56['text'],_0x27cc56[_0x69a8('0x93')])[_0x69a8('0x1b')](function(_0x38efb3){_0x1aaf84(null,_0x38efb3);})[_0x69a8('0x1c')](function(_0x1a5ce2){_0x1aaf84(_0x1a5ce2);});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x94')]=function(_0x3af192,_0x1eb1e0,_0x2a6a37){scripts[_0x69a8('0x94')](_0x1eb1e0,_0x3af192['key'],_0x3af192['google_asr_language']||_0x69a8('0x8a'))['then'](function(_0x572a16){_0x2a6a37(null,_0x572a16);})[_0x69a8('0x1c')](function(_0x48223f){_0x2a6a37(_0x48223f);});};AGIVertices[_0x69a8('0x16')]['tildeASR']=function(_0x273d99,_0x44608c,_0x54cf48){scripts['tildeASR'](_0x44608c,_0x273d99[_0x69a8('0x95')],_0x273d99[_0x69a8('0x96')],_0x273d99['uri'])[_0x69a8('0x1b')](function(_0x49fd09){_0x54cf48(null,_0x49fd09);})[_0x69a8('0x1c')](function(_0x398309){_0x54cf48(_0x398309);});};AGIVertices[_0x69a8('0x16')][_0x69a8('0x97')]=function(_0x3e82e3){var _0x510aba=_[_0x69a8('0x6d')](verticesWithRetry,_0x3e82e3[_0x69a8('0x40')])?_0x3e82e3:_[_0x69a8('0x98')](_0x3e82e3);for(var _0xbf3c34 in _0x510aba){if(_0x510aba[_0x69a8('0x99')](_0xbf3c34)){if(_0x510aba[_0xbf3c34]&&_[_0x69a8('0x9a')](_0x510aba[_0xbf3c34])){if(_[_0x69a8('0x6d')](recursiveMapAttributes,_0xbf3c34)){_0x510aba[_0xbf3c34]=this[_0x69a8('0x9b')](_0x510aba[_0xbf3c34]);}else{_0x510aba[_0xbf3c34]=this[_0x69a8('0x9c')](_0x510aba[_0xbf3c34]);}}}}return _0x510aba;};AGIVertices[_0x69a8('0x16')][_0x69a8('0x9d')]=function(_0x284c31){for(var _0x2c990f in _0x284c31){if(_0x284c31[_0x69a8('0x99')](_0x2c990f)){if(_['isPlainObject'](_0x284c31[_0x2c990f])){this[_0x69a8('0x9d')](_0x284c31[_0x2c990f]);}else if(_[_0x69a8('0x9e')](_0x284c31[_0x2c990f])){for(var _0x16b4ec=0x0;_0x16b4ec<_0x284c31[_0x2c990f][_0x69a8('0x9f')];_0x16b4ec++){this[_0x69a8('0x9d')](_0x284c31[_0x2c990f][_0x16b4ec]);}}else if(_['isString'](_0x284c31[_0x2c990f])){_0x284c31[_0x2c990f]=this['replaceAllVariables'](_0x284c31[_0x2c990f]);}}}};AGIVertices[_0x69a8('0x16')][_0x69a8('0xa0')]=function(_0x3c2898,_0xde4fca){for(var _0x43b76a in _0x3c2898){if(_0x3c2898[_0x69a8('0x99')](_0x43b76a)){if(_[_0x69a8('0xa1')](_0x3c2898[_0x43b76a])){if(!_[_0x69a8('0x4c')](_0x3c2898[_0x43b76a])){this[_0x69a8('0xa0')](_0x3c2898[_0x43b76a],util[_0x69a8('0x2f')](_0x69a8('0xa2'),_0xde4fca,_0x43b76a));}}else if(_[_0x69a8('0x9e')](_0x3c2898[_0x43b76a])){for(var _0x3efb41=0x0;_0x3efb41<_0x3c2898[_0x43b76a][_0x69a8('0x9f')];_0x3efb41++){this[_0x69a8('0xa0')](_0x3c2898[_0x43b76a][_0x3efb41],util[_0x69a8('0x2f')](_0x69a8('0xa2'),_0xde4fca,_0x43b76a+'['+_0x3efb41+']'));}}else{if(!_[_0x69a8('0x4a')](_0x3c2898[_0x43b76a])){this[_0x69a8('0x3d')][_0x69a8('0xa3')](util['format']('%s.%s',_0xde4fca,_0x43b76a),_0x3c2898[_0x43b76a]);}}}}};AGIVertices['prototype']['replaceObjectAllVariables']=function(_0x4e72e6){try{var _0x274243=JSON['parse'](_0x4e72e6);this['recursiveNodeIndex'](_0x274243);return JSON[_0x69a8('0x79')](_0x274243);}catch(_0x563d9b){return this[_0x69a8('0x9c')](_0x4e72e6);}};AGIVertices['prototype'][_0x69a8('0x9c')]=function(_0x4bde38){var _0x44dc9d=_0x4bde38[_0x69a8('0xa4')]('{');for(var _0x429263=0x1;_0x429263<_0x44dc9d[_0x69a8('0x9f')];_0x429263+=0x1){var _0x2ab374=_0x44dc9d[_0x429263]['split']('}');if(_0x2ab374[_0x69a8('0x9f')]>0x1){_0x4bde38=_0x4bde38[_0x69a8('0xa5')]('{'+_0x2ab374[0x0]+'}',this[_0x69a8('0x3d')][_0x69a8('0xa6')](_0x2ab374[0x0])[_0x69a8('0xa7')]||_0x2ab374[0x0]);}}if(_0x44dc9d[_0x69a8('0x9f')]===0x1){return _0x4bde38[_0x69a8('0x52')]();}return this[_0x69a8('0x9c')](_0x4bde38);};AGIVertices[_0x69a8('0x16')][_0x69a8('0xa8')]=function(_0x4afa57,_0x1ea58a){var _0x2dee4d=this[_0x69a8('0x3d')][_0x69a8('0xa6')](_0x4afa57);if(_0x2dee4d[_0x69a8('0xa9')]===-0x1){return _0x2dee4d;}logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0xaa'),_0x1ea58a,_0x2dee4d[_0x69a8('0xa7')]));return this['channel'][_0x69a8('0xa3')](_0x1ea58a,_0x2dee4d[_0x69a8('0xa7')]);};AGIVertices['prototype'][_0x69a8('0xab')]=function(_0x493cba){return _0x493cba&&_0x493cba!=='0'&&_0x493cba!=='-1'&&_0x493cba!=='';};AGIVertices[_0x69a8('0x16')][_0x69a8('0xac')]=function(_0x389915){this[_0x69a8('0x3c')][_0x69a8('0x76')](this,_0x389915,'-');_0x389915[_0x69a8('0xad')]=_0x389915[_0x69a8('0xac')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x69a8('0x16')]['mrcpsynth']=function(_0x7432b0){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0xae'),_0x7432b0[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0x7432b0[_0x69a8('0x62')])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')]('no\x20text\x20configured');}var _0xd060a6='\x22'+_0x7432b0[_0x69a8('0x62')]+'\x22';if(this['isConfigured'](_0x7432b0[_0x69a8('0x7d')])){_0xd060a6+=','+_0x7432b0[_0x69a8('0x7d')];}var _0x4b32b8=this['channel'][_0x69a8('0x5d')](_0x69a8('0xb0'),_0xd060a6);if(_0x4b32b8[_0x69a8('0xa9')]===-0x1){return _0x4b32b8;}return this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')]('Executed\x20command\x20MRCPSynth\x20%s',_0xd060a6));};AGIVertices[_0x69a8('0x16')][_0x69a8('0xb1')]=function(_0x2db5a6){logger[_0x69a8('0x32')](util['format'](_0x69a8('0xb2'),_0x2db5a6[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0x2db5a6[_0x69a8('0xb3')])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')](_0x69a8('0xb4'));}var _0x4c471b=_0x2db5a6[_0x69a8('0xb3')];if(this[_0x69a8('0xab')](_0x2db5a6[_0x69a8('0x7d')])){_0x4c471b+=','+_0x2db5a6[_0x69a8('0x7d')];}var _0x322d28=this[_0x69a8('0x3d')][_0x69a8('0x5d')](_0x69a8('0xb5'),_0x4c471b);if(_0x322d28[_0x69a8('0xa9')]===-0x1){return _0x322d28;}var _0xe33197=this[_0x69a8('0xa8')]('RECOG_CONFIDENCE()',_0x69a8('0xb6'));if(_0xe33197[_0x69a8('0xa9')]===-0x1){return _0xe33197;}var _0x57d6b3=this['getAndSetVariable'](_0x69a8('0xb7'),_0x69a8('0xb8'));if(_0x57d6b3[_0x69a8('0xa9')]===-0x1){return _0x57d6b3;}var _0x219590=this[_0x69a8('0xa8')](_0x69a8('0xb9'),_0x69a8('0xba'));if(_0x219590[_0x69a8('0xa9')]===-0x1){return _0x219590;}return this[_0x69a8('0x3d')][_0x69a8('0xaf')](util['format'](_0x69a8('0xbb'),_0x4c471b));};AGIVertices[_0x69a8('0x16')]['agi']=function(_0x2ce2b1){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0xbc'),_0x2ce2b1[_0x69a8('0x3f')]));return this[_0x69a8('0x3d')][_0x69a8('0x8')]([_0x2ce2b1[_0x69a8('0xbd')],_0x2ce2b1[_0x69a8('0xbe')]]);};AGIVertices[_0x69a8('0x16')]['answer']=function(_0x500601){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0xbf'),_0x500601[_0x69a8('0x3f')]));if(this[_0x69a8('0xab')](_0x500601[_0x69a8('0x6b')])){logger[_0x69a8('0x32')](util['format'](_0x69a8('0xc0'),_0x500601[_0x69a8('0x6b')]));var _0xf348b4=this[_0x69a8('0x3d')][_0x69a8('0xc1')](_0x500601[_0x69a8('0x6b')]);if(_0xf348b4[_0x69a8('0xa9')]===-0x1){return _0xf348b4;}}return this[_0x69a8('0x3d')][_0x69a8('0xc2')]();};AGIVertices['prototype'][_0x69a8('0x51')]=function(_0x2d2005){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0xc3'),_0x2d2005[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0x2d2005[_0x69a8('0x4f')])){return this['channel'][_0x69a8('0x31')](_0x2d2005,_0x69a8('0xc4'));}_0x2d2005[_0x69a8('0x50')]=moment();if(this[_0x69a8('0xab')](_0x2d2005[_0x69a8('0xc5')])){_0x2d2005[_0x69a8('0x50')]=moment()[_0x69a8('0xc6')](_0x2d2005['delay'],'minutes');}if(!this[_0x69a8('0xab')](_0x2d2005[_0x69a8('0x53')])){_0x2d2005[_0x69a8('0x53')]=0x2;}this[_0x69a8('0x49')][_0x69a8('0x76')](this,_0x2d2005);return this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0xc7'),_0x2d2005[_0x69a8('0x4e')],_0x2d2005[_0x69a8('0x4f')],_0x2d2005[_0x69a8('0x50')]));};AGIVertices['prototype'][_0x69a8('0xc8')]=function(_0x35d249){logger[_0x69a8('0x32')](util['format'](_0x69a8('0xc9'),_0x35d249[_0x69a8('0x3f')]));var _0x3bbf69=this[_0x69a8('0x3d')][_0x69a8('0x5d')](_0x35d249[_0x69a8('0xca')],_0x35d249[_0x69a8('0x7d')]);if(_0x3bbf69['result']===-0x1){return _0x3bbf69;}return this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0xcb'),_0x35d249[_0x69a8('0xca')],_0x35d249[_0x69a8('0x7d')]));};AGIVertices[_0x69a8('0x16')][_0x69a8('0xcc')]=function(_0x24344b){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0xcd'),_0x24344b[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0x24344b[_0x69a8('0x62')])){return this[_0x69a8('0x3d')]['noop'](_0x69a8('0xce'));}var _0x38382d='\x22'+_0x24344b['text']+'\x22';if(this['isConfigured'](_0x24344b['options'])){_0x38382d+=','+_0x24344b[_0x69a8('0x7d')];}var _0xd1c13d=this[_0x69a8('0x3d')][_0x69a8('0x5d')](_0x69a8('0xb0'),_0x38382d);if(_0xd1c13d[_0x69a8('0xa9')]===-0x1){return _0xd1c13d;}return this['channel'][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0xcf'),_0x38382d));};AGIVertices[_0x69a8('0x16')][_0x69a8('0xd0')]=function(_0x4b45db){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0xd1'),_0x4b45db[_0x69a8('0x3f')]));if(!this['isConfigured'](_0x4b45db[_0x69a8('0x62')])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')](_0x69a8('0xce'));}var _0x13ee8d='\x22'+_0x4b45db[_0x69a8('0x62')]+'\x22';if(this[_0x69a8('0xab')](_0x4b45db[_0x69a8('0x7d')])){_0x13ee8d+=','+_0x4b45db[_0x69a8('0x7d')];}var _0xcd5a22=this[_0x69a8('0x3d')][_0x69a8('0x5d')](_0x69a8('0xb0'),_0x13ee8d);if(_0xcd5a22[_0x69a8('0xa9')]===-0x1){return _0xcd5a22;}return this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0xcf'),_0x13ee8d));};AGIVertices[_0x69a8('0x16')][_0x69a8('0xd2')]=function(_0xb086e8){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0xd3'),_0xb086e8[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0xb086e8[_0x69a8('0xb3')])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')](_0x69a8('0xb4'));}var _0x5e9fd9=_0xb086e8[_0x69a8('0xb3')];if(this['isConfigured'](_0xb086e8[_0x69a8('0x7d')])){_0x5e9fd9+=','+_0xb086e8[_0x69a8('0x7d')];}var _0x36b6fe=this['channel'][_0x69a8('0x5d')](_0x69a8('0xb5'),_0x5e9fd9);if(_0x36b6fe[_0x69a8('0xa9')]===-0x1){return _0x36b6fe;}var _0x8edc61=this['getAndSetVariable'](_0x69a8('0xd4'),'LUMENVOX_ASR_CONFIDENCE');if(_0x8edc61['result']===-0x1){return _0x8edc61;}var _0x19272a=this['getAndSetVariable'](_0x69a8('0xb7'),_0x69a8('0xd5'));if(_0x19272a[_0x69a8('0xa9')]===-0x1){return _0x19272a;}var _0x3588a9=this[_0x69a8('0xa8')](_0x69a8('0xb9'),_0x69a8('0xd6'));if(_0x3588a9[_0x69a8('0xa9')]===-0x1){return _0x3588a9;}return this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0xbb'),_0x5e9fd9));};AGIVertices[_0x69a8('0x16')][_0x69a8('0xd7')]=function(_0x77b3b9){logger[_0x69a8('0x32')](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x77b3b9[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0x77b3b9[_0x69a8('0xb3')])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')]('no\x20grammar\x20configured');}var _0x21cbfa=_0x77b3b9[_0x69a8('0xb3')];if(this['isConfigured'](_0x77b3b9[_0x69a8('0x7d')])){_0x21cbfa+=','+_0x77b3b9[_0x69a8('0x7d')];}var _0x4ab209=this[_0x69a8('0x3d')][_0x69a8('0x5d')]('MRCPRecog',_0x21cbfa);if(_0x4ab209[_0x69a8('0xa9')]===-0x1){return _0x4ab209;}var _0x5de5a9=this['getAndSetVariable'](_0x69a8('0xd4'),_0x69a8('0xd8'));if(_0x5de5a9[_0x69a8('0xa9')]===-0x1){return _0x5de5a9;}var _0x5c990e=this[_0x69a8('0xa8')]('RECOG_INPUT()',_0x69a8('0xd9'));if(_0x5c990e['result']===-0x1){return _0x5c990e;}var _0x32b817=this[_0x69a8('0xa8')](_0x69a8('0xb9'),_0x69a8('0xda'));if(_0x32b817[_0x69a8('0xa9')]===-0x1){return _0x32b817;}return this[_0x69a8('0x3d')]['noop'](util[_0x69a8('0x2f')]('Executed\x20command\x20MRCPRecog\x20%s',_0x21cbfa));};AGIVertices[_0x69a8('0x16')][_0x69a8('0xdb')]=function(_0x222718){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0xdc'),_0x222718['label']));if(!this[_0x69a8('0xab')](_0x222718[_0x69a8('0xdd')])){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x222718,'no\x20database\x20selected');}var _0x1a2c82=this[_0x69a8('0x1d')]['sync'](this,_0x222718[_0x69a8('0xdd')]);if(!_0x1a2c82){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x222718,_0x69a8('0xde'));}if(!this[_0x69a8('0xab')](_0x222718[_0x69a8('0x34')])){return this['channel'][_0x69a8('0x31')](_0x222718,_0x69a8('0xdf'));}var _0x16dd63=_0x222718[_0x69a8('0x34')]['replace'](/(\r\n|\n|\r)/gm,'\x20');this[_0x69a8('0x3d')]['noop'](util[_0x69a8('0x2f')]('query:\x20%s',_0x16dd63));var _0x457eea=this[_0x69a8('0xe0')][_0x69a8('0x76')](this,_0x1a2c82,_0x16dd63);this[_0x69a8('0x3c')]['sync'](this,_0x222718,_0x16dd63);if(!this[_0x69a8('0xab')](_0x222718[_0x69a8('0xe1')])){return this['channel'][_0x69a8('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1feeb9=this[_0x69a8('0xa6')][_0x69a8('0x76')](this,_0x222718[_0x69a8('0xe1')]);if(!_0x1feeb9){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x222718,'no\x20variable\x20found');}var _0x4197ce=this;_0x457eea[_0x69a8('0xe2')](function(_0xc7aa1,_0x1eafcc){Object[_0x69a8('0xe3')](_0xc7aa1)['forEach'](function(_0x5c8784){_0x4197ce[_0x69a8('0x3d')][_0x69a8('0xa3')](util[_0x69a8('0x2f')](_0x69a8('0xe4'),_0x1feeb9,_0x1eafcc,_0x5c8784),_0xc7aa1[_0x5c8784]);});});this[_0x69a8('0x3d')][_0x69a8('0xa3')](util[_0x69a8('0x2f')](_0x69a8('0xe5'),_0x1feeb9),_0x457eea[_0x69a8('0x9f')]);return this[_0x69a8('0x3d')]['noop'](util['format'](_0x69a8('0xe6'),_0x1feeb9));};AGIVertices[_0x69a8('0x16')][_0x69a8('0xe7')]=function(_0x5b3711){logger[_0x69a8('0xe8')](util[_0x69a8('0x2f')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x5b3711[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0x5b3711[_0x69a8('0xe9')])){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x5b3711,'no\x20user\x20selected');}var _0x1ee36a=this['getUser'][_0x69a8('0x76')](this,_0x5b3711[_0x69a8('0xe9')]);if(!_0x1ee36a){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x5b3711,'no\x20user\x20found');}var _0x53bb35=this[_0x69a8('0x3d')]['exec'](_0x69a8('0xea'),[util[_0x69a8('0x2f')]('SIP/%s',_0x1ee36a),_0x5b3711[_0x69a8('0x6b')],_0x5b3711[_0x69a8('0xeb')],_0x5b3711['url']]);if(_0x53bb35[_0x69a8('0xa9')]===-0x1){return _0x53bb35;}return this['channel'][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0xec'),_0x69a8('0xea')));};AGIVertices[_0x69a8('0x16')][_0x69a8('0xed')]=function(_0x52194f){logger['info'](util['format'](_0x69a8('0xee'),_0x52194f[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0x52194f[_0x69a8('0x7f')])){return this[_0x69a8('0x3d')]['noop']('no\x20key\x20configured');}if(!this[_0x69a8('0xab')](_0x52194f['text'])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')]('no\x20text\x20configured');}this[_0x69a8('0x3d')][_0x69a8('0xef')]=!![];this[_0x69a8('0x3c')](_0x52194f);this[_0x69a8('0x48')](_0x52194f[_0x69a8('0x62')],'in','','');this['channel'][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0xf0'),_0x52194f[_0x69a8('0x62')]));var _0x3b800a=this[_0x69a8('0x7e')]['sync'](this,_0x52194f);if(_0x3b800a){for(var _0x62a917 in _0x3b800a){if(_0x3b800a[_0x69a8('0x99')](_0x62a917)){this[_0x69a8('0x3d')][_0x69a8('0xa3')](util[_0x69a8('0x2f')](_0x69a8('0xf1'),_0x62a917[_0x69a8('0x6f')]()),_0x3b800a[_0x62a917]);}}this[_0x69a8('0x48')](_0x3b800a[_0x69a8('0xf2')],_0x69a8('0xf3'),_0x69a8('0xed'),'');return this['channel'][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0xf4'),_0x3b800a['speech']));}return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x52194f,_0x69a8('0xf5'));};AGIVertices['prototype']['dialogflowV2']=function(_0x3788e0){logger[_0x69a8('0x32')](util['format'](_0x69a8('0xf6'),_0x3788e0[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0x3788e0[_0x69a8('0xf7')])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')]('no\x20project_id\x20configured');}if(!this[_0x69a8('0xab')](_0x3788e0[_0x69a8('0x82')])){return this[_0x69a8('0x3d')]['noop'](_0x69a8('0xf8'));}if(!this[_0x69a8('0xab')](_0x3788e0['private_key'])){return this[_0x69a8('0x3d')]['noop']('no\x20private_key\x20configured');}if(!this[_0x69a8('0xab')](_0x3788e0[_0x69a8('0x84')])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')](_0x69a8('0xf9'));}if(!this[_0x69a8('0xab')](_0x3788e0[_0x69a8('0x62')])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')](_0x69a8('0xce'));}this[_0x69a8('0x3d')][_0x69a8('0xef')]=!![];this['createSquareDetailsReport'](_0x3788e0);this[_0x69a8('0x48')](_0x3788e0[_0x69a8('0x62')],'in','','');this['channel']['noop'](util[_0x69a8('0x2f')](_0x69a8('0xfa'),_0x3788e0[_0x69a8('0x62')]));var _0x51d4d3=this['googleDialogflowV2'][_0x69a8('0x76')](this,_0x3788e0);if(_0x51d4d3){for(var _0x57ceb0 in _0x51d4d3){if(_0x51d4d3[_0x69a8('0x99')](_0x57ceb0)){if(_0x57ceb0!==_0x69a8('0xfb')){this[_0x69a8('0x3d')][_0x69a8('0xa3')](util[_0x69a8('0x2f')](_0x69a8('0xf1'),_0x57ceb0['toUpperCase']()),_0x51d4d3[_0x57ceb0]);}}}this[_0x69a8('0x48')](_0x51d4d3[_0x69a8('0xf2')],_0x69a8('0xf3'),_0x69a8('0xfc'),_0x51d4d3['providerResponse']);return this[_0x69a8('0x3d')]['noop'](util[_0x69a8('0x2f')](_0x69a8('0xfd'),_0x51d4d3[_0x69a8('0xf2')]));}return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x3788e0,_0x69a8('0xfe'));};AGIVertices[_0x69a8('0x16')][_0x69a8('0xff')]=function(_0x5147c9){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x5147c9[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0x5147c9[_0x69a8('0x100')])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')](_0x69a8('0x101'));}if(!this['isConfigured'](_0x5147c9['username'])){return this['channel'][_0x69a8('0xaf')](_0x69a8('0x102'));}if(!this[_0x69a8('0xab')](_0x5147c9[_0x69a8('0x103')])){return this[_0x69a8('0x3d')]['noop'](_0x69a8('0x104'));}if(!this[_0x69a8('0xab')](_0x5147c9[_0x69a8('0x105')])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')](_0x69a8('0xce'));}this['channel'][_0x69a8('0xef')]=!![];this[_0x69a8('0x3c')](_0x5147c9);this[_0x69a8('0x48')](_0x5147c9[_0x69a8('0x62')],'in','','');this[_0x69a8('0x3d')][_0x69a8('0xaf')](util['format'](_0x69a8('0x106'),_0x5147c9[_0x69a8('0x62')]));var _0x1c26f5=this[_0x69a8('0x85')][_0x69a8('0x76')](this,_0x5147c9);if(_0x1c26f5){for(var _0xaf1fef in _0x1c26f5){if(_0x1c26f5[_0x69a8('0x99')](_0xaf1fef)){this['channel']['setVariable'](util[_0x69a8('0x2f')](_0x69a8('0x107'),_0xaf1fef['toUpperCase']()),_0x1c26f5[_0xaf1fef]);}}this[_0x69a8('0x48')](_0x1c26f5['speech'],_0x69a8('0xf3'),_0x69a8('0xff'),'');if(_0x1c26f5['audiofile']){this['channel'][_0x69a8('0xaf')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x1c26f5[_0x69a8('0x108')]));var _0x57556=this[_0x69a8('0x3d')][_0x69a8('0x109')](_0x1c26f5[_0x69a8('0x108')]);try{fs['unlink'](_0x1c26f5[_0x69a8('0x108')]+_0x69a8('0x10a'));}catch(_0x3c2f56){logger[_0x69a8('0x31')](_0x3c2f56);}return _0x57556;}else{return this[_0x69a8('0x3d')]['noop'](util[_0x69a8('0x2f')](_0x69a8('0x10b'),_0x1c26f5[_0x69a8('0xf2')]));}}return this[_0x69a8('0x3d')]['error'](_0x5147c9,_0x69a8('0x10c'));};AGIVertices[_0x69a8('0x16')][_0x69a8('0x10d')]=function(_0x249899){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0x10e'),_0x249899[_0x69a8('0x3f')]));return this['channel'][_0x69a8('0xaf')]('end');};AGIVertices[_0x69a8('0x16')]['ext_dial']=function(_0x52bfb4){logger['info'](util[_0x69a8('0x2f')](_0x69a8('0x10f'),_0x52bfb4[_0x69a8('0x3f')]));var _0x7c6ab3='';if(_0x52bfb4[_0x69a8('0x110')]){if(!this[_0x69a8('0xab')](_0x52bfb4['trunk_id'])){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x52bfb4,'no\x20trunk\x20selected');}else{var _0x4c5224=parseInt(_0x52bfb4['trunk_id'],0xa);if(isNaN(_0x4c5224)){_0x7c6ab3=_0x52bfb4[_0x69a8('0x110')];}else{_0x7c6ab3=this[_0x69a8('0x21')][_0x69a8('0x76')](this,_0x52bfb4['trunk_id']);if(!_0x7c6ab3){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x52bfb4,_0x69a8('0x111'));}}}}else if(_0x52bfb4[_0x69a8('0x112')]){_0x7c6ab3=_0x52bfb4['trunk_name'];}else{return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x52bfb4,_0x69a8('0x113'));}var _0x390bce=this[_0x69a8('0x3d')][_0x69a8('0x5d')](_0x69a8('0xea'),[util[_0x69a8('0x2f')]('SIP/%s/%s',_0x7c6ab3,_0x52bfb4[_0x69a8('0x4e')]),_0x52bfb4['timeout'],_0x52bfb4[_0x69a8('0xeb')],_0x52bfb4[_0x69a8('0x6a')]]);if(_0x390bce[_0x69a8('0xa9')]===-0x1){return _0x390bce;}return this['channel'][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0xec'),_0x69a8('0xea')));};AGIVertices[_0x69a8('0x16')][_0x69a8('0x114')]=function(_0xca71f2){logger[_0x69a8('0x32')](util['format'](_0x69a8('0x115'),_0xca71f2[_0x69a8('0x3f')]));return this[_0x69a8('0x3d')][_0x69a8('0xaf')](_0x69a8('0x114'));};AGIVertices[_0x69a8('0x16')][_0x69a8('0x10')]=function(_0x432f71){logger[_0x69a8('0x32')](util['format'](_0x69a8('0x116'),_0x432f71[_0x69a8('0x3f')]));if(_0x432f71[_0x69a8('0xad')]===0x0){return this[_0x69a8('0xac')](_0x432f71);}_0x432f71[_0x69a8('0xad')]-=0x1;if(!this['isConfigured'](_0x432f71['file_id'])){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x432f71,_0x69a8('0x117'));}var _0x4ecfbd=this[_0x69a8('0x23')]['sync'](this,_0x432f71[_0x69a8('0x118')]);if(!_0x4ecfbd){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x432f71,_0x69a8('0x119'));}if(!this[_0x69a8('0xab')](_0x432f71['variable_id'])){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x69a8('0x11a'));}var _0x55cb1e=this[_0x69a8('0x3d')]['getData'](_0x4ecfbd,_0x432f71[_0x69a8('0x11b')],_0x432f71[_0x69a8('0x11c')]);var _0x3e060c=_0x55cb1e[_0x69a8('0xa9')]?_0x55cb1e[_0x69a8('0xa9')]['toString']():'';logger[_0x69a8('0x32')](_0x69a8('0x11d'),JSON[_0x69a8('0x79')](_0x55cb1e));if(_0x55cb1e[_0x69a8('0xa9')]===-0x1){this[_0x69a8('0x3c')][_0x69a8('0x76')](this,_0x432f71,_0x3e060c);return _0x55cb1e;}else if(_0x55cb1e['extra']==='timeout'){_0x55cb1e[_0x69a8('0xa9')]=_0x3e060c['length']>=parseInt(_0x432f71[_0x69a8('0x11e')])?'x':'i';}else{_0x55cb1e[_0x69a8('0xa9')]=_0x3e060c[_0x69a8('0x9f')]>=parseInt(_0x432f71[_0x69a8('0x11e')])&&_0x3e060c[_0x69a8('0x9f')]<=parseInt(_0x432f71['maxdigit'])?'x':'i';}var _0x3d3d62=this[_0x69a8('0xa6')][_0x69a8('0x76')](this,_0x432f71[_0x69a8('0xe1')]);if(!_0x3d3d62){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x432f71,_0x69a8('0x11f'));}this[_0x69a8('0x3d')]['setVariable'](_0x3d3d62,_0x3e060c);if(this[_0x69a8('0xab')](_0x432f71['hiddendigitsnum'])){var _0x1192bd=parseInt(_0x432f71['hiddendigitsnum'],0xa);var _0xc014d7=rs[_0x69a8('0x120')]({'charset':'*','length':_0x1192bd});var _0x45535a=_0x3e060c[_0x69a8('0x9f')];if(_0x45535a>0x0){if(_0x45535a>_0x1192bd){this[_0x69a8('0x3c')]['sync'](this,_0x432f71,_0x432f71['hiddendigitspos']===_0x69a8('0x121')?_0xc014d7+_0x3e060c[_0x69a8('0x122')](_0x1192bd):_0x3e060c['substr'](0x0,_0x45535a-_0x1192bd)+_0xc014d7);}else{this[_0x69a8('0x3c')]['sync'](this,_0x432f71,rs[_0x69a8('0x120')]({'charset':'*','length':_0x45535a}));}}else{this[_0x69a8('0x3c')][_0x69a8('0x76')](this,_0x432f71,'');}}else{this[_0x69a8('0x3c')][_0x69a8('0x76')](this,_0x432f71,_0x3e060c);}return _0x55cb1e;};AGIVertices[_0x69a8('0x16')]['getsecretdigits']=function(_0x5d7de9){logger['info'](util[_0x69a8('0x2f')](_0x69a8('0x123'),_0x5d7de9[_0x69a8('0x3f')]));return this['getdigits'](_0x5d7de9);};AGIVertices[_0x69a8('0x16')][_0x69a8('0x124')]=function(_0x3d6cb7){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x3d6cb7[_0x69a8('0x3f')]));this[_0x69a8('0x3c')]['sync'](this,_0x3d6cb7,_0x3d6cb7['goalname']);return this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0x125'),_0x3d6cb7[_0x69a8('0x126')]));};AGIVertices[_0x69a8('0x16')][_0x69a8('0x127')]=function(_0x3e4170){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x3e4170[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0x3e4170[_0x69a8('0x8d')])||!this[_0x69a8('0xab')](_0x3e4170[_0x69a8('0x8e')])){return this[_0x69a8('0x3d')]['noop'](_0x69a8('0x128'));}if(!this[_0x69a8('0xab')](_0x3e4170[_0x69a8('0x62')])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')](_0x69a8('0xce'));}this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0x129'),_0x3e4170['text']));var _0x215a53=this[_0x69a8('0x8c')][_0x69a8('0x76')](this,_0x3e4170);if(_0x215a53){this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0x12a'),_0x215a53));var _0x38ebc8=this[_0x69a8('0x3d')][_0x69a8('0x109')](_0x215a53);try{fs[_0x69a8('0x12b')](_0x215a53+'.wav');}catch(_0x447f41){logger[_0x69a8('0x31')](_0x447f41);}return _0x38ebc8;}return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x3e4170,_0x69a8('0x12c'));};AGIVertices[_0x69a8('0x16')][_0x69a8('0x12d')]=function(_0x31b975){logger['info'](util[_0x69a8('0x2f')](_0x69a8('0x12e'),_0x31b975[_0x69a8('0x3f')]));if(!this['isConfigured'](_0x31b975[_0x69a8('0x8d')])||!this[_0x69a8('0xab')](_0x31b975[_0x69a8('0x8e')])){return this['channel']['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x69a8('0xab')](_0x31b975[_0x69a8('0x93')])){return this[_0x69a8('0x3d')]['noop'](_0x69a8('0x12f'));}if(!this[_0x69a8('0xab')](_0x31b975[_0x69a8('0x62')])){return this[_0x69a8('0x3d')]['noop']('no\x20text\x20configured');}this[_0x69a8('0x3d')][_0x69a8('0xef')]=!![];this['createSquareDetailsReport'](_0x31b975);this[_0x69a8('0x48')](_0x31b975[_0x69a8('0x62')],'in','','');this[_0x69a8('0x3d')]['noop'](util[_0x69a8('0x2f')]('Trying\x20Amazon\x20Lex:\x20%s',_0x31b975[_0x69a8('0x62')]));var _0x20e7ac=this['awsLex'][_0x69a8('0x76')](this,_0x31b975);if(_0x20e7ac){for(var _0x4bba8b in _0x20e7ac){if(_0x20e7ac[_0x69a8('0x99')](_0x4bba8b)&&_[_0x69a8('0x9a')](_0x20e7ac[_0x4bba8b])){this[_0x69a8('0x3d')][_0x69a8('0xa3')](util[_0x69a8('0x2f')]('AWS_LEX_%s',_0x4bba8b['toUpperCase']()),_0x20e7ac[_0x4bba8b]);}}if(_[_0x69a8('0x4a')](_0x20e7ac[_0x69a8('0x7c')])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x69a8('0x48')](_0x20e7ac[_0x69a8('0x7c')],_0x69a8('0xf3'),_0x69a8('0x130'),'');return this['channel']['noop'](util['format'](_0x69a8('0x131'),_0x20e7ac[_0x69a8('0x7c')]));}}return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x31b975,_0x69a8('0x132'));};AGIVertices[_0x69a8('0x16')][_0x69a8('0x133')]=function(_0x4f13c2){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0x134'),_0x4f13c2[_0x69a8('0x3f')],_0x4f13c2['timeout']));if(!this[_0x69a8('0xab')](_0x4f13c2[_0x69a8('0x7f')])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')](_0x69a8('0x135'));}var _0x350bcf=_0x69a8('0x136');var _0x1b5bd0=util[_0x69a8('0x2f')](_0x69a8('0x137'),FILES_PATH,rs[_0x69a8('0x120')](0x4));var _0x13e979=util[_0x69a8('0x2f')](_0x69a8('0xa2'),_0x1b5bd0,_0x350bcf);var _0x4a4cfc=!![];if(_0x4f13c2[_0x69a8('0x138')]===_0x69a8('0x139')){_0x4a4cfc=![];}var _0x44e406=this[_0x69a8('0x3d')]['recordFile'](_0x1b5bd0,_0x350bcf,_0x4f13c2['intKey'],_0x4f13c2['timeout'],undefined,_0x4a4cfc);if(_0x44e406[_0x69a8('0xa9')]!==-0x1){this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0x13a'),_0x13e979));var _0x14961a=this[_0x69a8('0x94')][_0x69a8('0x76')](this,_0x4f13c2,_0x13e979);if(_0x14961a){for(var _0x5ee7a7 in _0x14961a){if(_0x14961a[_0x69a8('0x99')](_0x5ee7a7)){this[_0x69a8('0x3d')]['setVariable'](util[_0x69a8('0x2f')](_0x69a8('0x13b'),_0x5ee7a7[_0x69a8('0x6f')]()),_0x14961a[_0x5ee7a7]);}}return this['channel'][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0x13c'),JSON[_0x69a8('0x79')](_0x14961a)));}}return _0x44e406;};AGIVertices[_0x69a8('0x16')]['tildeasr']=function(_0xf0870e){logger['info'](util[_0x69a8('0x2f')](_0x69a8('0x13d'),_0xf0870e[_0x69a8('0x3f')]));if(!this['isConfigured'](_0xf0870e[_0x69a8('0x95')])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')](_0x69a8('0x13e'));}if(!this[_0x69a8('0xab')](_0xf0870e['appsecret'])){return this[_0x69a8('0x3d')]['noop'](_0x69a8('0x13f'));}var _0x21ddb9=_0x69a8('0x136');var _0x12ad9a=util['format']('%s/recordings/%s',FILES_PATH,rs[_0x69a8('0x120')](0x4));var _0x46b80d=util[_0x69a8('0x2f')](_0x69a8('0xa2'),_0x12ad9a,_0x21ddb9);var _0x32b584=!![];if(_0xf0870e[_0x69a8('0x138')]===_0x69a8('0x139')){_0x32b584=![];}var _0x31c922=this[_0x69a8('0x3d')][_0x69a8('0x140')](_0x12ad9a,_0x21ddb9,_0xf0870e['intKey'],_0xf0870e[_0x69a8('0x6b')],undefined,_0x32b584);if(_0x31c922['result']!==-0x1){this[_0x69a8('0x3d')]['noop'](util[_0x69a8('0x2f')](_0x69a8('0x141'),_0x46b80d));var _0x39d90c=this['tildeASR'][_0x69a8('0x76')](this,_0xf0870e,_0x46b80d);if(_0x39d90c){for(var _0x125a06 in _0x39d90c){if(_0x39d90c['hasOwnProperty'](_0x125a06)){this['channel'][_0x69a8('0xa3')](util[_0x69a8('0x2f')](_0x69a8('0x142'),_0x125a06['toUpperCase']()),_0x39d90c[_0x125a06]);}}return this['channel'][_0x69a8('0xaf')](util[_0x69a8('0x2f')]('TildeASR\x20Result\x20%s',JSON[_0x69a8('0x79')](_0x39d90c)));}}return _0x31c922;};AGIVertices[_0x69a8('0x16')][_0x69a8('0x143')]=function(_0x182cb4){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0x144'),_0x182cb4['label']));return this[_0x69a8('0x3d')][_0x69a8('0x145')](_0x182cb4[_0x69a8('0x146')],_0x182cb4['extension'],_0x182cb4[_0x69a8('0x147')]);};AGIVertices[_0x69a8('0x16')]['gotoif']=function(_0x511ce6){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x511ce6[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0x511ce6['condition'])){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x511ce6,_0x69a8('0x148'));}try{var _0x4083c=eval(_0x511ce6[_0x69a8('0x149')])?_0x69a8('0x14a'):'false';this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')]('EVAL\x20CONDITION\x20%s\x20%s',_0x511ce6[_0x69a8('0x149')],_0x4083c));return{'code':0xc8,'result':_0x4083c};}catch(_0x4d27bf){return{'code':0xc8,'result':_0x69a8('0x14b')};}};AGIVertices[_0x69a8('0x16')][_0x69a8('0x14c')]=function(_0x37873c){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0x14d'),_0x37873c['label']));if(!this[_0x69a8('0xab')](_0x37873c[_0x69a8('0x14e')])){return this['channel'][_0x69a8('0x31')](_0x37873c,_0x69a8('0x14f'));}var _0x520718=this[_0x69a8('0x29')]['sync'](this,_0x37873c[_0x69a8('0x14e')]);if(!_0x520718){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x37873c,'no\x20intervals\x20found');}for(var _0x531237=0x0;_0x531237<_0x520718[_0x69a8('0x9f')];_0x531237+=0x1){var _0x6cd28d=this[_0x69a8('0x3d')][_0x69a8('0xa6')](util[_0x69a8('0x2f')](_0x69a8('0x150'),_0x520718[_0x531237]));if(_0x6cd28d[_0x69a8('0xa9')]===-0x1){return _0x6cd28d;}logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0x151'),_0x520718[_0x531237],_0x6cd28d[_0x69a8('0xa7')]));if(_0x6cd28d[_0x69a8('0xa7')]===_0x69a8('0x14a')){logger['info'](util[_0x69a8('0x2f')](_0x69a8('0x151'),_0x520718[_0x531237],_0x69a8('0x14a')));this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')]('IFTIME\x20%s\x20%s',_0x520718[_0x531237],'true'));return{'code':0xc8,'result':'true'};}else{logger[_0x69a8('0x32')](util['format'](_0x69a8('0x151'),_0x520718[_0x531237],_0x69a8('0x14b')));this['channel'][_0x69a8('0xaf')](util[_0x69a8('0x2f')]('IFTIME\x20%s\x20%s',_0x520718[_0x531237],_0x69a8('0x14b')));}}return{'code':0xc8,'result':_0x69a8('0x14b')};};AGIVertices[_0x69a8('0x16')]['hangup']=function(_0x5ddceb){logger[_0x69a8('0x32')](util['format']('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x5ddceb['label']));return this['channel']['hangup']();};AGIVertices['prototype'][_0x69a8('0x152')]=function(_0x4c0b76){logger[_0x69a8('0x32')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x4c0b76[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0x4c0b76[_0x69a8('0x7f')])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')]('no\x20key\x20configured');}var _0x557ff0=_0x69a8('0x136');var _0x286071=util[_0x69a8('0x2f')](_0x69a8('0x137'),FILES_PATH,rs[_0x69a8('0x120')](0x4));var _0xd31a40=util['format'](_0x69a8('0xa2'),_0x286071,_0x557ff0);var _0x2dc245=!![];if(_0x4c0b76[_0x69a8('0x138')]==='NOBEEP'){_0x2dc245=![];}var _0x536464=this['channel'][_0x69a8('0x140')](_0x286071,_0x557ff0,_0x4c0b76['intKey'],_0x4c0b76[_0x69a8('0x6b')],undefined,_0x2dc245);if(_0x536464['result']!==-0x1){this[_0x69a8('0x3d')][_0x69a8('0xaf')](util['format'](_0x69a8('0x153'),_0xd31a40));var _0x5ba675=this[_0x69a8('0x88')][_0x69a8('0x76')](this,_0x4c0b76,_0xd31a40);if(_0x5ba675){for(var _0x4e6a42 in _0x5ba675){if(_0x5ba675[_0x69a8('0x99')](_0x4e6a42)){this[_0x69a8('0x3d')][_0x69a8('0xa3')](util[_0x69a8('0x2f')](_0x69a8('0x154'),_0x4e6a42[_0x69a8('0x6f')]()),_0x5ba675[_0x4e6a42]);}}return this['channel'][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0x155'),JSON[_0x69a8('0x79')](_0x5ba675)));}}return _0x536464;};AGIVertices['prototype'][_0x69a8('0x156')]=function(_0x2f1ae1){logger['info'](util[_0x69a8('0x2f')]('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x2f1ae1[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0x2f1ae1[_0x69a8('0x7f')])){return this['channel'][_0x69a8('0xaf')](_0x69a8('0x135'));}if(!this[_0x69a8('0xab')](_0x2f1ae1[_0x69a8('0x62')])){return this['channel'][_0x69a8('0xaf')](_0x69a8('0xce'));}this[_0x69a8('0x3d')][_0x69a8('0xaf')](util['format'](_0x69a8('0x157'),_0x2f1ae1['text']));var _0x5afa47=this[_0x69a8('0x86')]['sync'](this,_0x2f1ae1);if(_0x5afa47){this['channel'][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0x153'),_0x5afa47));var _0x554ffb=this['channel'][_0x69a8('0x109')](_0x5afa47,_0x2f1ae1[_0x69a8('0x158')]);try{fs[_0x69a8('0x12b')](_0x5afa47+'.wav');}catch(_0xe6d53d){logger['error'](_0xe6d53d);}return _0x554ffb;}return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x2f1ae1,_0x69a8('0x159'));};AGIVertices['prototype'][_0x69a8('0x15a')]=function(_0x2e090f){logger['info'](util[_0x69a8('0x2f')](_0x69a8('0x15b'),_0x2e090f[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0x2e090f[_0x69a8('0x15c')])){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x2e090f,'no\x20find\x20by\x20configured');}logger['info'](util[_0x69a8('0x2f')](_0x69a8('0x15d'),this[_0x69a8('0x3d')][_0x69a8('0x42')],_0x2e090f[_0x69a8('0x15c')]));var _0x5ea3a8=this['agentLogin']['sync'](this,_0x2e090f[_0x69a8('0x15c')]);if(_0x5ea3a8){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x69a8('0x3d')][_0x69a8('0x42')],_0x2e090f[_0x69a8('0x15c')]));this['channel']['noop'](util[_0x69a8('0x2f')](_0x69a8('0x15e'),this[_0x69a8('0x3d')][_0x69a8('0x42')],_0x2e090f['findBy']));return{'code':0xc8,'result':_0x69a8('0x15f')};}else{logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0x160'),this['channel'][_0x69a8('0x42')],_0x2e090f[_0x69a8('0x15c')]));this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x69a8('0x3d')]['callerid'],_0x2e090f['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x69a8('0x16')][_0x69a8('0x161')]=function(_0xa5123e){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0x162'),_0xa5123e[_0x69a8('0x3f')]));if(!this['isConfigured'](_0xa5123e[_0x69a8('0x15c')])){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0xa5123e,_0x69a8('0x163'));}logger['info'](util[_0x69a8('0x2f')](_0x69a8('0x15d'),this[_0x69a8('0x3d')]['callerid'],_0xa5123e[_0x69a8('0x15c')]));var _0x239d37=this[_0x69a8('0x58')][_0x69a8('0x76')](this,_0xa5123e[_0x69a8('0x15c')]);if(_0x239d37){logger[_0x69a8('0x32')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x69a8('0x3d')]['callerid'],_0xa5123e[_0x69a8('0x15c')]));this['channel'][_0x69a8('0xaf')](util['format'](_0x69a8('0x15e'),this[_0x69a8('0x3d')][_0x69a8('0x42')],_0xa5123e[_0x69a8('0x15c')]));return{'code':0xc8,'result':_0x69a8('0x15f')};}else{logger[_0x69a8('0x32')](util['format'](_0x69a8('0x160'),this[_0x69a8('0x3d')][_0x69a8('0x42')],_0xa5123e['findBy']));this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0x160'),this[_0x69a8('0x3d')]['callerid'],_0xa5123e[_0x69a8('0x15c')]));return{'code':0xc8,'result':_0x69a8('0x164')};}};AGIVertices[_0x69a8('0x16')][_0x69a8('0x165')]=function(_0x3b1ab2){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0x166'),_0x3b1ab2['label']));if(!this['isConfigured'](_0x3b1ab2[_0x69a8('0x167')])){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x3b1ab2,_0x69a8('0x168'));}this[_0x69a8('0x3d')]['noop'](util['format']('math\x20%s',_0x3b1ab2[_0x69a8('0x167')]));var _0x45f388=eval(_0x3b1ab2['operation']);if(!this[_0x69a8('0xab')](_0x3b1ab2['variable_id'])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')](_0x69a8('0x11a'));}var _0x2f23ee=this[_0x69a8('0xa6')]['sync'](this,_0x3b1ab2[_0x69a8('0xe1')]);if(!_0x2f23ee){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x3b1ab2,'no\x20variable\x20found');}if(_[_0x69a8('0x9e')](_0x45f388)){var _0x544243=this;_0x45f388['forEach'](function(_0x567b6e,_0x526d79){_0x544243[_0x69a8('0x3d')][_0x69a8('0xa3')](util[_0x69a8('0x2f')](_0x69a8('0x169'),_0x2f23ee,_0x526d79),_0x567b6e);});return this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0x16a'),_0x2f23ee));}else{return this['channel'][_0x69a8('0xa3')](_0x2f23ee,_0x45f388);}};AGIVertices[_0x69a8('0x16')][_0x69a8('0xf')]=function(_0x32d28d){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0x16b'),_0x32d28d[_0x69a8('0x3f')]));if(_0x32d28d[_0x69a8('0xad')]===0x0){return this[_0x69a8('0xac')](_0x32d28d);}_0x32d28d['retry']-=0x1;if(!this[_0x69a8('0xab')](_0x32d28d[_0x69a8('0x118')])){return this[_0x69a8('0x3d')]['error'](_0x32d28d,'no\x20file\x20audio\x20selected');}var _0x2d19a1=this[_0x69a8('0x23')][_0x69a8('0x76')](this,_0x32d28d[_0x69a8('0x118')]);if(!_0x2d19a1){return this['channel'][_0x69a8('0x31')](_0x32d28d,_0x69a8('0x119'));}var _0x34f90c=this[_0x69a8('0x3d')]['getData'](_0x2d19a1,_0x32d28d[_0x69a8('0x11b')],_0x32d28d['digit']);var _0x1d96f9=_0x34f90c['result'];if(_0x34f90c[_0x69a8('0xa9')]===-0x1){this[_0x69a8('0x3c')]['sync'](this,_0x32d28d,'-1');return _0x34f90c;}else if(_0x34f90c['extra']===_0x69a8('0x6b')){_0x34f90c[_0x69a8('0xa9')]=_0x34f90c[_0x69a8('0xa9')]['length']>0x0?_0x34f90c[_0x69a8('0xa9')]:'t';}else if(_[_0x69a8('0x4c')](_0x34f90c['result'])){_0x34f90c['result']='#';_0x1d96f9='#';}if(!this[_0x69a8('0xab')](_0x32d28d[_0x69a8('0xe1')])){this[_0x69a8('0x3d')]['noop'](_0x69a8('0x11a'));}else{var _0x5832d0=this[_0x69a8('0xa6')][_0x69a8('0x76')](this,_0x32d28d[_0x69a8('0xe1')]);if(!_0x5832d0){return this[_0x69a8('0x3d')]['error'](_0x32d28d,'no\x20variable\x20found');}this['channel']['setVariable'](_0x5832d0,_0x1d96f9);}this[_0x69a8('0x3c')]['sync'](this,_0x32d28d,_0x1d96f9);return _0x34f90c;};AGIVertices[_0x69a8('0x16')][_0x69a8('0xaf')]=function(_0x2e8027){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0x16c'),_0x2e8027[_0x69a8('0x3f')]));return this[_0x69a8('0x3d')][_0x69a8('0xaf')](_0x2e8027['output']||_0x2e8027[_0x69a8('0x3f')]);};AGIVertices[_0x69a8('0x16')][_0x69a8('0x16d')]=function(_0x34f8e3){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0x16e'),_0x34f8e3['label']));if(!this[_0x69a8('0xab')](_0x34f8e3[_0x69a8('0x15c')])){return this[_0x69a8('0x3d')]['error'](_0x34f8e3,'no\x20find\x20by\x20configured');}logger['info'](util['format'](_0x69a8('0x15d'),this['channel'][_0x69a8('0x42')],_0x34f8e3[_0x69a8('0x15c')]));var _0x2d4df3=this[_0x69a8('0x16f')]['sync'](this,_0x34f8e3[_0x69a8('0x170')]);var _0x1937e6=this[_0x69a8('0x55')][_0x69a8('0x76')](this,_0x34f8e3['findBy'],_0x2d4df3);if(_0x1937e6){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0x15e'),this['channel']['callerid'],_0x34f8e3[_0x69a8('0x15c')]));this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x69a8('0x3d')][_0x69a8('0x42')],_0x34f8e3['findBy']));return{'code':0xc8,'result':_0x69a8('0x15f')};}else{logger['info'](util[_0x69a8('0x2f')](_0x69a8('0x160'),this[_0x69a8('0x3d')][_0x69a8('0x42')],_0x34f8e3[_0x69a8('0x15c')]));this[_0x69a8('0x3d')]['noop'](util[_0x69a8('0x2f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x69a8('0x3d')]['callerid'],_0x34f8e3[_0x69a8('0x15c')]));return{'code':0xc8,'result':_0x69a8('0x164')};}};AGIVertices[_0x69a8('0x16')][_0x69a8('0x171')]=function(_0x1988ce){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x1988ce[_0x69a8('0x3f')]));if(!this['isConfigured'](_0x1988ce['file_id'])){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x1988ce,'no\x20file\x20audio\x20selected');}var _0x4cc684=this[_0x69a8('0x23')][_0x69a8('0x76')](this,_0x1988ce[_0x69a8('0x118')]);if(!_0x4cc684){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x1988ce,_0x69a8('0x119'));}var _0x53c794=this[_0x69a8('0x3d')][_0x69a8('0x5d')](_0x69a8('0x172'),[_0x4cc684,_0x1988ce[_0x69a8('0xeb')]]);if(_0x53c794['result']===-0x1){return _0x53c794;}return this[_0x69a8('0x3d')][_0x69a8('0xaf')](util['format']('Executed\x20command\x20%s\x20%s',_0x69a8('0x172'),_0x4cc684));};AGIVertices[_0x69a8('0x16')][_0x69a8('0x173')]=function(_0x1cf507){logger[_0x69a8('0x32')](util['format'](_0x69a8('0x174'),_0x1cf507[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0x1cf507[_0x69a8('0x175')])){return this['channel'][_0x69a8('0x31')](_0x1cf507,_0x69a8('0x176'));}var _0x4d1e31='';var _0x3674f2=parseInt(_0x1cf507[_0x69a8('0x175')],0xa);if(isNaN(_0x3674f2)){_0x4d1e31=_0x1cf507[_0x69a8('0x175')];}else{_0x4d1e31=this['getVoiceQueue'][_0x69a8('0x76')](this,_0x1cf507[_0x69a8('0x175')]);if(!_0x4d1e31){return this['channel'][_0x69a8('0x31')](_0x1cf507,_0x69a8('0x177'));}}var _0x153a4b='';if(this['isConfigured'](_0x1cf507['file_id'])){var _0x38f10a=this[_0x69a8('0x23')][_0x69a8('0x76')](this,_0x1cf507[_0x69a8('0x118')]);if(_0x38f10a){_0x153a4b=_0x38f10a;}}this[_0x69a8('0x3c')][_0x69a8('0x76')](this,_0x1cf507,_0x4d1e31);if(_0x1cf507[_0x69a8('0xeb')][_0x69a8('0x178')]('x')<0x0){_0x1cf507['opts']+='x';}if(_0x1cf507[_0x69a8('0xeb')][_0x69a8('0x178')]('X')<0x0){_0x1cf507[_0x69a8('0xeb')]+='X';}this[_0x69a8('0x3d')][_0x69a8('0xa3')]('XMCS-QUEUE',_0x4d1e31?_0x4d1e31['toLowerCase']():'');var _0x24706f=this[_0x69a8('0x3d')][_0x69a8('0x5d')](_0x69a8('0x179'),[_0x4d1e31,_0x1cf507['opts'],_0x1cf507[_0x69a8('0x6a')],_0x153a4b,_0x1cf507[_0x69a8('0x6b')],_0x1cf507[_0x69a8('0x8')],_0x1cf507[_0x69a8('0x17a')],_0x1cf507[_0x69a8('0x17b')],'',_0x1cf507['position']]);if(_0x24706f[_0x69a8('0xa9')]===-0x1){return _0x24706f;}return this['channel'][_0x69a8('0xaf')](util[_0x69a8('0x2f')]('Executed\x20command\x20%s\x20%s',_0x69a8('0x179'),_0x4d1e31));};AGIVertices[_0x69a8('0x16')][_0x69a8('0x17c')]=function(_0x6b82b9){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x6b82b9[_0x69a8('0x3f')]));var _0x1eb0c8=_0x6b82b9[_0x69a8('0x17d')]||'wav';var _0x340916=util['format'](_0x69a8('0x17e'),this[_0x69a8('0x3d')][_0x69a8('0x3e')],rs[_0x69a8('0x120')](0x5));var _0x13b280=util['format']('%s/recordings/%s.%s',FILES_PATH,_0x340916,_0x1eb0c8);var _0x378c0b=util['format'](_0x69a8('0x137'),FILES_PATH,_0x340916);this[_0x69a8('0x41')]['sync'](this,_0x6b82b9,_0x340916,_0x13b280);this[_0x69a8('0x3d')][_0x69a8('0xa3')]('RECORDING_SAVENAME',_0x340916);logger['info'](_0x69a8('0x17f'),_0x378c0b,_0x1eb0c8,_0x6b82b9[_0x69a8('0x180')],_0x6b82b9[_0x69a8('0x6b')]);return this[_0x69a8('0x3d')][_0x69a8('0x140')](_0x378c0b,_0x1eb0c8,_0x6b82b9[_0x69a8('0x180')],_0x6b82b9[_0x69a8('0x6b')],undefined,!![]);};AGIVertices[_0x69a8('0x16')][_0x69a8('0x181')]=function(_0x2bd875){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0x182'),_0x2bd875[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0x2bd875['url'])){return this[_0x69a8('0x3d')]['noop'](_0x69a8('0x183'));}var _0x230dba=this[_0x69a8('0x69')][_0x69a8('0x76')](this,_0x2bd875);logger['info'](util[_0x69a8('0x2f')](_0x69a8('0x184'),util[_0x69a8('0x185')](_0x230dba,{'showHidden':![],'depth':null})));if(!this[_0x69a8('0xab')](_0x2bd875[_0x69a8('0xe1')])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')](_0x69a8('0x186'));}var _0x33884c=this[_0x69a8('0xa6')][_0x69a8('0x76')](this,_0x2bd875[_0x69a8('0xe1')]);if(!_0x33884c){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x2bd875,'no\x20variable\x20found');}this[_0x69a8('0x3d')][_0x69a8('0xa3')](util['format']('%s_STATUS_CODE',_0x33884c),_0x230dba[_0x69a8('0x7b')]?_0x230dba[_0x69a8('0x7b')]:_0x69a8('0x187'));this[_0x69a8('0x3d')]['setVariable'](util[_0x69a8('0x2f')](_0x69a8('0x188'),_0x33884c),_0x230dba[_0x69a8('0x189')]?_0x230dba['statusMessage']:'OK');if(_0x230dba[_0x69a8('0x70')]){try{this[_0x69a8('0xa0')](_0x230dba[_0x69a8('0x70')],_0x33884c);}catch(_0x4d6859){logger[_0x69a8('0x31')](util['format'](_0x69a8('0x18a'),_0x33884c));}}return this[_0x69a8('0x3d')]['noop'](util['format'](_0x69a8('0xe6'),_0x33884c));};AGIVertices[_0x69a8('0x16')][_0x69a8('0x18b')]=function(_0x4b7367){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0x18c'),_0x4b7367[_0x69a8('0x3f')]));return this[_0x69a8('0x3d')][_0x69a8('0x18d')](_0x4b7367[_0x69a8('0x18e')][_0x69a8('0x5f')](/\s+/g,''),_0x4b7367['escape_digits']);};AGIVertices[_0x69a8('0x16')][_0x69a8('0x18f')]=function(_0xb5b926){logger[_0x69a8('0x32')](util['format'](_0x69a8('0x190'),_0xb5b926[_0x69a8('0x3f')]));return this[_0x69a8('0x3d')][_0x69a8('0x191')](_0xb5b926['number'][_0x69a8('0x5f')](/\s+/g,''),_0xb5b926['escape_digits']);};AGIVertices[_0x69a8('0x16')]['sayphonetic']=function(_0x39a135){logger[_0x69a8('0x32')](util['format'](_0x69a8('0x192'),_0x39a135[_0x69a8('0x3f')]));return this[_0x69a8('0x3d')]['sayPhonetic'](_0x39a135[_0x69a8('0x62')],_0x39a135[_0x69a8('0x180')]);};AGIVertices['prototype'][_0x69a8('0x193')]=function(_0x4c1fad){logger['info'](util['format'](_0x69a8('0x194'),_0x4c1fad['label']));if(!this[_0x69a8('0xab')](_0x4c1fad[_0x69a8('0x195')])){return this['channel'][_0x69a8('0xaf')](_0x69a8('0x196'));}var _0x4b1bfd=this['getMailAccount'][_0x69a8('0x76')](this,_0x4c1fad['account_id']);if(!_0x4b1bfd||!_0x4b1bfd[_0x69a8('0x197')]){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x4c1fad,_0x69a8('0x198'));}var _0x3b6b20={'from':util[_0x69a8('0x2f')](_0x69a8('0x199'),_0x4b1bfd[_0x69a8('0x15')],_0x4b1bfd[_0x69a8('0x19a')]||_0x4b1bfd[_0x69a8('0x197')][_0x69a8('0x19b')]),'to':_0x4c1fad['to']||'','cc':_0x4c1fad['cc']||'','bcc':_0x4c1fad[_0x69a8('0x19c')]||'','subject':_0x4c1fad[_0x69a8('0x19d')],'html':_0x4c1fad[_0x69a8('0x62')],'text':_0x4c1fad[_0x69a8('0x62')]};if(this[_0x69a8('0xab')](_0x4c1fad['template_id'])){}logger['debug'](_0x69a8('0x19e'),JSON[_0x69a8('0x79')](_0x3b6b20));this['createSquareDetailsReport'][_0x69a8('0x76')](this,_0x4c1fad,_0x4c1fad[_0x69a8('0x195')]);this['channel'][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0x19f'),_0x4b1bfd[_0x69a8('0x15')]));this[_0x69a8('0x28')][_0x69a8('0x76')](this,_0x4b1bfd['smtpOptions'],_0x3b6b20);return this[_0x69a8('0x3d')][_0x69a8('0xaf')](_0x69a8('0x1a0'));};AGIVertices[_0x69a8('0x16')][_0x69a8('0x1a1')]=function(_0x2ef7a3){logger['info'](util[_0x69a8('0x2f')](_0x69a8('0x1a2'),_0x2ef7a3[_0x69a8('0x3f')]));return this['channel'][_0x69a8('0xaf')](_0x69a8('0x1a3'));};AGIVertices[_0x69a8('0x16')][_0x69a8('0x1a4')]=function(_0xbd2572){logger[_0x69a8('0x32')](util['format']('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0xbd2572[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0xbd2572[_0x69a8('0x1a5')])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')](_0x69a8('0x1a6'));}var _0x587adc=this[_0x69a8('0x39')][_0x69a8('0x76')](this,_0xbd2572[_0x69a8('0x1a5')]);if(!_0x587adc){return this[_0x69a8('0x3d')]['error'](_0xbd2572,_0x69a8('0x1a7'));}var _0x97fff3={'body':_0xbd2572[_0x69a8('0x1a8')],'phone':_0xbd2572['to']||'','SmsAccountId':_0x587adc['id']};logger[_0x69a8('0xe8')](_0x69a8('0x1a9'),JSON[_0x69a8('0x79')](_0x97fff3));this['createSquareDetailsReport'][_0x69a8('0x76')](this,_0xbd2572,_0xbd2572[_0x69a8('0x1a5')]);this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x587adc[_0x69a8('0x15')]));this[_0x69a8('0x3b')]['sync'](this,_0x97fff3);return this['channel'][_0x69a8('0xaf')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x69a8('0x16')][_0x69a8('0x1aa')]=function(_0x2e9ea8){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x2e9ea8[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0x2e9ea8['variable_id'])){return this['channel'][_0x69a8('0x31')](_0x2e9ea8,_0x69a8('0x1ab'));}var _0xd4fda1=this[_0x69a8('0xa6')][_0x69a8('0x76')](this,_0x2e9ea8[_0x69a8('0xe1')]);if(!_0xd4fda1){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x2e9ea8,_0x69a8('0x11f'));}return this[_0x69a8('0x3d')]['setVariable'](_0xd4fda1,_0x2e9ea8['variable_value']);};AGIVertices[_0x69a8('0x16')][_0x69a8('0x1ac')]=function(_0x2d199c){logger[_0x69a8('0x32')](util['format'](_0x69a8('0x1ad'),_0x2d199c[_0x69a8('0x3f')]));this[_0x69a8('0x3d')][_0x69a8('0xaf')]('START\x20CALLY\x20SQUARE');if(_0x2d199c['answer']===_0x69a8('0x1ae')){this[_0x69a8('0x3d')][_0x69a8('0xaf')](_0x69a8('0x1af'));return this[_0x69a8('0x3d')][_0x69a8('0xc2')]();}return this[_0x69a8('0x3d')][_0x69a8('0xaf')](_0x69a8('0x1b0'));};AGIVertices[_0x69a8('0x16')][_0x69a8('0x1b1')]=function(_0x5ace06){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x5ace06[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0x5ace06[_0x69a8('0x1b2')])){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x5ace06,_0x69a8('0x1b3'));}var _0x372fcc=this[_0x69a8('0x19')][_0x69a8('0x76')](this,_0x5ace06[_0x69a8('0x1b2')]);if(!this[_0x69a8('0xab')](_0x372fcc)){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x5ace06,util[_0x69a8('0x2f')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x5ace06[_0x69a8('0x1b2')]));}if(_0x372fcc===this['channel'][_0x69a8('0x47')]){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x5ace06,_0x69a8('0x1b4'));}this[_0x69a8('0x3c')][_0x69a8('0x76')](this,_0x5ace06,_0x372fcc);var _0x315722=this['channel'][_0x69a8('0x5d')]('AGI',util[_0x69a8('0x2f')](_0x69a8('0x1b5'),config[_0x69a8('0x8')][_0x69a8('0x1b6')]||_0x69a8('0x1b7'),_0x372fcc,this[_0x69a8('0x3d')][_0x69a8('0x47')]));if(_0x315722[_0x69a8('0xa9')]===-0x1){return _0x315722;}return this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')]('Executed\x20command\x20%s\x20%s',_0x69a8('0x1b8'),_0x372fcc));};AGIVertices[_0x69a8('0x16')][_0x69a8('0x1b9')]=function(_0x184380){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0x1ba'),_0x184380['label']));var _0x8ed0d5=this[_0x69a8('0x5c')][_0x69a8('0x76')](this,_0x184380['command']);this[_0x69a8('0x3c')]['sync'](this,_0x184380,_0x184380[_0x69a8('0xbd')]);if(this['isConfigured'](_0x184380[_0x69a8('0xe1')])){var _0x46b099=this[_0x69a8('0xa6')][_0x69a8('0x76')](this,_0x184380[_0x69a8('0xe1')]);if(_0x46b099){this[_0x69a8('0x3d')]['setVariable'](_0x46b099,_0x8ed0d5);return this[_0x69a8('0x3d')][_0x69a8('0xaf')](util['format'](_0x69a8('0x1bb'),_0x184380[_0x69a8('0xbd')],_0x46b099));}}return this[_0x69a8('0x3d')][_0x69a8('0xaf')](util['format'](_0x69a8('0x1bc'),_0x184380[_0x69a8('0xbd')]));};AGIVertices['prototype'][_0x69a8('0x1bd')]=function(_0x3e5b60){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')]('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x3e5b60[_0x69a8('0x3f')]));_0x3e5b60[_0x69a8('0x62')]=_0x3e5b60[_0x69a8('0x62')][_0x69a8('0x5f')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x3e5b60['apiKey'])){return this[_0x69a8('0x3d')][_0x69a8('0xaf')]('no\x20apiKey\x20configured');}if(!this[_0x69a8('0xab')](_0x3e5b60[_0x69a8('0x62')])){return this['channel']['noop'](_0x69a8('0xce'));}this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0x1be'),_0x3e5b60['text']));var _0x1bc73c=this['googleCloudTTS'][_0x69a8('0x76')](this,_0x3e5b60);if(_0x1bc73c){this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x1bc73c));var _0xc5d538=this[_0x69a8('0x3d')]['streamFile'](_0x1bc73c);try{fs[_0x69a8('0x12b')](_0x1bc73c+'.wav');}catch(_0x3c3707){logger[_0x69a8('0x31')](_0x3c3707);}return _0xc5d538;}return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x3e5b60,_0x69a8('0x1bf'));};AGIVertices[_0x69a8('0x16')][_0x69a8('0x1c0')]=function(_0x1e9a56){logger[_0x69a8('0x32')](util['format'](_0x69a8('0x1c1'),_0x1e9a56[_0x69a8('0x3f')]));_0x1e9a56['text']=_0x1e9a56[_0x69a8('0x62')][_0x69a8('0x5f')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x1e9a56[_0x69a8('0x62')])){return this[_0x69a8('0x3d')]['noop']('no\x20text\x20configured');}this['channel'][_0x69a8('0xaf')](util['format']('Trying\x20Google\x20TTS\x20%s',_0x1e9a56[_0x69a8('0x62')]));var _0x42a3bf=this[_0x69a8('0x67')][_0x69a8('0x76')](this,_0x1e9a56);if(_0x42a3bf){this['channel'][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0x1c2'),_0x42a3bf));var _0x17925a=this['channel'][_0x69a8('0x109')](_0x42a3bf);try{fs[_0x69a8('0x12b')](_0x42a3bf+_0x69a8('0x10a'));}catch(_0x3cb216){logger[_0x69a8('0x31')](_0x3cb216);}return _0x17925a;}return this[_0x69a8('0x3d')]['error'](_0x1e9a56,_0x69a8('0x1c3'));};AGIVertices['prototype'][_0x69a8('0x1c4')]=function(_0x32e4f2){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0x1c5'),_0x32e4f2[_0x69a8('0x3f')]));if(!this['isConfigured'](_0x32e4f2[_0x69a8('0x15c')])){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0x32e4f2,_0x69a8('0x163'));}logger['info'](util[_0x69a8('0x2f')](_0x69a8('0x15d'),this[_0x69a8('0x3d')][_0x69a8('0x42')],_0x32e4f2[_0x69a8('0x15c')]));var _0x19bb44=this['agentUnpause'][_0x69a8('0x76')](this,_0x32e4f2['findBy']);if(_0x19bb44){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x69a8('0x3d')][_0x69a8('0x42')],_0x32e4f2[_0x69a8('0x15c')]));this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0x15e'),this[_0x69a8('0x3d')][_0x69a8('0x42')],_0x32e4f2[_0x69a8('0x15c')]));return{'code':0xc8,'result':_0x69a8('0x15f')};}else{logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0x160'),this[_0x69a8('0x3d')][_0x69a8('0x42')],_0x32e4f2[_0x69a8('0x15c')]));this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')](_0x69a8('0x160'),this[_0x69a8('0x3d')][_0x69a8('0x42')],_0x32e4f2['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0x69a8('0x1c6')]=function(_0x55d164){logger[_0x69a8('0x32')](util[_0x69a8('0x2f')](_0x69a8('0x1c7'),_0x55d164[_0x69a8('0x3f')]));var _0x238417=this[_0x69a8('0x3d')][_0x69a8('0x5d')](_0x69a8('0x1c8'),[_0x55d164['mailbox'],_0x55d164['options']]);if(_0x238417[_0x69a8('0xa9')]===-0x1){return _0x238417;}return this[_0x69a8('0x3d')][_0x69a8('0xaf')](util[_0x69a8('0x2f')]('Executed\x20command\x20%s\x20%s',_0x69a8('0x1c8'),_0x55d164[_0x69a8('0x1c9')]));};AGIVertices['prototype'][_0x69a8('0x1ca')]=function(_0xe9d977){logger['info'](util[_0x69a8('0x2f')](_0x69a8('0x1cb'),_0xe9d977[_0x69a8('0x3f')]));if(!this[_0x69a8('0xab')](_0xe9d977[_0x69a8('0xe1')])){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0xe9d977,'no\x20variable\x20selected');}var _0x5f955f=this[_0x69a8('0xa6')][_0x69a8('0x76')](this,_0xe9d977['variable_id']);if(!_0x5f955f){return this[_0x69a8('0x3d')][_0x69a8('0x31')](_0xe9d977,_0x69a8('0x11f'));}var _0xd0e8ef=this[_0x69a8('0x3d')][_0x69a8('0xa6')](_0x5f955f);return{'code':0xc8,'result':_0xd0e8ef[_0x69a8('0xa7')]?_0xd0e8ef[_0x69a8('0xa7')]:'-'};};String[_0x69a8('0x16')][_0x69a8('0xa5')]=function(_0x805bb9,_0x58a269){return this['split'](_0x805bb9)[_0x69a8('0x1cc')](_0x58a269);};module[_0x69a8('0x1cd')]=AGIVertices; \ No newline at end of file +var _0xfc75=['providerResponse','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','sesteknda','audiofile','streamFile','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','opts','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','getSound','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','unlink','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','NOBEEP','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','Enter\x20in\x20GOTOIF\x20(%s)\x20block','no\x20condition\x20configured','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','Enter\x20in\x20LOGOUT\x20(%s)\x20block','no\x20find\x20by\x20configured','math','Enter\x20in\x20MATH\x20(%s)\x20block','no\x20operation\x20configured','math\x20%s','operation','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','getPause','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','restAPI','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','template_id','debug','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','smtpOptions','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','START\x20CALLY\x20SQUARE','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','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','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','.wav','Google\x20Cloud\x20TTS\x20is\x20unreachable','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','replaceAll','join','exports','util','lodash','shelljs','odbc','randomstring','request-promise','agi','../../config/environment','../../config/environment/shared','./scripts','/var/opt/motion2/server/files','rawBody','getdigits','channel','mailRpc','prototype','getVariable','rpc','getVariableById','name','catch','getVoiceQueueById','then','getSquareProject','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','interval','Intervals','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','query','info','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','createSquareRecording','calleridname','context','priority','accountcode','dnid','arg_1','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agentPause','callerid','agentUnpause','agent','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','shellCommand','exec','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','MP3','googleTTS','google_tts_language','url','method','number','timeout','PUT','body','headers','parse','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','private_key','dialogflowV2_language','sestekNDA','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','includes','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','replaceObjectAllVariables','split','extra','result','setVariable','maxRetry','sync','mrcpsynth','MRCPSynth','noop','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','RECOG_INSTANCE()','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','%s[%s][%s]','%s_ROWS_COUNT','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20found','DIAL','SIP/%s','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','toUpperCase','speech','out','Dialogflow\x20Result\x20%s','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','no\x20project_id\x20configured','Trying\x20DialogflowV2:\x20%s'];(function(_0x1d8fa1,_0x18d00f){var _0x528467=function(_0x259e18){while(--_0x259e18){_0x1d8fa1['push'](_0x1d8fa1['shift']());}};_0x528467(++_0x18d00f);}(_0xfc75,0xe1));var _0x5fc7=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfc75[_0x502c7d];return _0x30b7ed;};'use strict';var fs=require('fs');var util=require(_0x5fc7('0x0'));var _=require(_0x5fc7('0x1'));var sh=require(_0x5fc7('0x2'));var odbc=require(_0x5fc7('0x3'))();var rs=require(_0x5fc7('0x4'));var moment=require('moment');var Mustache=require('mustache');var rp=require(_0x5fc7('0x5'));var logger=require('../../config/logger')(_0x5fc7('0x6'));var config=require(_0x5fc7('0x7'));var shared=require(_0x5fc7('0x8'));var scripts=require(_0x5fc7('0x9'));var FILES_PATH=_0x5fc7('0xa');var recursiveMapAttributes=['rawHeaders',_0x5fc7('0xb')];var verticesWithRetry=['menu',_0x5fc7('0xc'),'getsecretdigits'];var AGIVertices=function(_0x5bc5e3,_0x2412b6,_0x5d30b9){this[_0x5fc7('0xd')]=_0x5bc5e3;this['rpc']=_0x2412b6;this[_0x5fc7('0xe')]=_0x5d30b9;};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x10')]=function(_0x483713,_0x2d9b52){this[_0x5fc7('0x11')][_0x5fc7('0x12')](_0x483713)['then'](function(_0x379a0a){_0x2d9b52(null,_0x379a0a?_0x379a0a[_0x5fc7('0x13')]:![]);})[_0x5fc7('0x14')](function(_0x23a387){_0x2d9b52(_0x23a387);});};AGIVertices['prototype']['getVoiceQueue']=function(_0x599c23,_0x53ca56){this[_0x5fc7('0x11')][_0x5fc7('0x15')](_0x599c23)[_0x5fc7('0x16')](function(_0x11e612){_0x53ca56(null,_0x11e612?_0x11e612['name']:![]);})[_0x5fc7('0x14')](function(_0x32d87c){_0x53ca56(_0x32d87c);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x17')]=function(_0x51d176,_0x188101){this[_0x5fc7('0x11')]['getSquareProjectById'](_0x51d176)['then'](function(_0x34c1ee){_0x188101(null,_0x34c1ee?_0x34c1ee[_0x5fc7('0x13')]:![]);})[_0x5fc7('0x14')](function(_0x288508){_0x188101(_0x288508);});};AGIVertices['prototype'][_0x5fc7('0x18')]=function(_0x98d164,_0xa61588){this[_0x5fc7('0x11')][_0x5fc7('0x19')](_0x98d164)['then'](function(_0x56d686){_0xa61588(null,_0x56d686?_0x56d686[_0x5fc7('0x1a')]:![]);})[_0x5fc7('0x14')](function(_0x3de163){_0xa61588(_0x3de163);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x1b')]=function(_0x26c4ae,_0x31a582){this[_0x5fc7('0x11')]['getUserById'](_0x26c4ae)[_0x5fc7('0x16')](function(_0x5eacf6){_0x31a582(null,_0x5eacf6?_0x5eacf6[_0x5fc7('0x13')]:![]);})[_0x5fc7('0x14')](function(_0x2bd0e5){_0x31a582(_0x2bd0e5);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x1c')]=function(_0x51b0f2,_0x3c1c8b){this[_0x5fc7('0x11')][_0x5fc7('0x1d')](_0x51b0f2)[_0x5fc7('0x16')](function(_0x27651f){_0x3c1c8b(null,_0x27651f?_0x27651f[_0x5fc7('0x13')]:![]);})[_0x5fc7('0x14')](function(_0x13752f){_0x3c1c8b(_0x13752f);});};AGIVertices['prototype']['getSound']=function(_0x8dcfab,_0x564981){var _0x423e0f=this;this['rpc'][_0x5fc7('0x1e')](_0x8dcfab)[_0x5fc7('0x16')](function(_0x443b4a){_0x564981(null,_0x443b4a?_0x423e0f[_0x5fc7('0x1f')](_0x443b4a[_0x5fc7('0x20')]):![]);})[_0x5fc7('0x14')](function(_0x186bec){_0x564981(_0x186bec);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x21')]=function(_0x52813,_0x58fa14){this[_0x5fc7('0x11')][_0x5fc7('0x22')](_0x52813)[_0x5fc7('0x16')](function(_0x17de2f){_0x58fa14(null,_0x17de2f?_0x17de2f:![]);})[_0x5fc7('0x14')](function(_0x879b91){_0x58fa14(_0x879b91);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x23')]=function(_0x453c92,_0x5585c2,_0x5aab0b){this[_0x5fc7('0xe')][_0x5fc7('0x23')](_0x453c92,_0x5585c2)[_0x5fc7('0x16')](function(){_0x5aab0b(null);})[_0x5fc7('0x14')](function(_0x38980b){_0x5aab0b(_0x38980b);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x24')]=function(_0x3c81b3,_0x2d6d38){this[_0x5fc7('0x11')][_0x5fc7('0x25')](_0x3c81b3)[_0x5fc7('0x16')](function(_0x4a29ef){if(_0x4a29ef){if(_0x4a29ef['IntervalId']){_0x2d6d38(null,[_0x4a29ef[_0x5fc7('0x26')]]);}else{_0x2d6d38(null,_['map'](_0x4a29ef[_0x5fc7('0x27')],_0x5fc7('0x26')));}}else{_0x2d6d38(null,![]);}})[_0x5fc7('0x14')](function(_0x2e6faf){_0x2d6d38(_0x2e6faf);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x1f')]=function(_0x542160){return util['format'](_0x5fc7('0x28'),FILES_PATH,_0x542160);};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x29')]=function(_0x3ccb66,_0x51d758,_0x5357e8){odbc['open'](_0x3ccb66,function(_0x147764){if(_0x147764){logger[_0x5fc7('0x2a')](_0x5fc7('0x2b'),_0x147764);_0x5357e8(_0x147764);}else{logger['info']('ODBC\x20connection\x20successfully');odbc[_0x5fc7('0x2c')](_0x51d758,function(_0x2e485,_0xac4b1a){if(_0x2e485){logger['info']('Error\x20executing\x20query\x20%s',_0x51d758);_0x5357e8(_0x2e485);}else{logger[_0x5fc7('0x2d')](_0x5fc7('0x2e'),_0x51d758);odbc['close'](function(_0x480fd7){if(_0x480fd7){logger[_0x5fc7('0x2a')](_0x5fc7('0x2f'),_0x480fd7);}_0x5357e8(null,_0xac4b1a);});}});}});};AGIVertices['prototype'][_0x5fc7('0x30')]=function(_0x27ff86,_0x576d9b){this['rpc'][_0x5fc7('0x31')](_0x27ff86)['then'](function(_0xec302a){_0x576d9b(null,_0xec302a?_0xec302a:![]);})['catch'](function(_0x1d7ff2){_0x576d9b(_0x1d7ff2);});};AGIVertices[_0x5fc7('0xf')]['createSmsMessage']=function(_0x1933ea,_0x1cb63a){this['rpc'][_0x5fc7('0x32')](_0x1933ea)[_0x5fc7('0x16')](function(_0x4722fa){_0x1cb63a(null,_0x4722fa);})[_0x5fc7('0x14')](function(_0x4c51d4){_0x1cb63a(_0x4c51d4);});};AGIVertices['prototype'][_0x5fc7('0x33')]=function(_0x3308f9,_0x3fded1,_0x1233d0){this[_0x5fc7('0x11')][_0x5fc7('0x33')]({'uniqueid':this['channel'][_0x5fc7('0x34')],'node':_0x3308f9[_0x5fc7('0x35')],'application':_0x3308f9[_0x5fc7('0x36')],'data':_0x3fded1||null,'project_name':this[_0x5fc7('0xd')]['arg_1'],'callerid':this[_0x5fc7('0xd')]['callerid']})['then'](function(_0x1f9c2e){if(_0x1233d0){_0x1233d0(null,_0x1f9c2e);}})['catch'](function(_0x2df95f){if(_0x1233d0){_0x1233d0(_0x2df95f);}});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x37')]=function(_0xdfd670,_0x3e1b6c,_0x42666a,_0x2d9ccf){this[_0x5fc7('0x11')][_0x5fc7('0x37')]({'uniqueid':this[_0x5fc7('0xd')][_0x5fc7('0x34')],'callerid':this[_0x5fc7('0xd')]['callerid'],'calleridname':this[_0x5fc7('0xd')][_0x5fc7('0x38')],'context':this[_0x5fc7('0xd')][_0x5fc7('0x39')],'extension':this[_0x5fc7('0xd')]['extension'],'priority':this[_0x5fc7('0xd')][_0x5fc7('0x3a')],'accountcode':this[_0x5fc7('0xd')][_0x5fc7('0x3b')],'dnid':this['channel'][_0x5fc7('0x3c')],'projectName':this[_0x5fc7('0xd')][_0x5fc7('0x3d')],'saveName':_0x3e1b6c,'filename':_0xdfd670['file']||_0x3e1b6c,'savePath':_0x42666a})[_0x5fc7('0x16')](function(_0x487f18){_0x2d9ccf(null,_0x487f18);})[_0x5fc7('0x14')](function(_0x285c48){_0x2d9ccf(_0x285c48);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x3e')]=function(_0x34962b,_0x26eb9a,_0xae9898,_0x5a77d4,_0x17454d){this[_0x5fc7('0x11')][_0x5fc7('0x3e')]({'uniqueid':this[_0x5fc7('0xd')][_0x5fc7('0x34')],'body':_0x34962b,'direction':_0x26eb9a,'providerName':_0xae9898,'providerResponse':_0x5a77d4})[_0x5fc7('0x16')](function(_0x4efd37){if(_0x17454d){_0x17454d(null,_0x4efd37);}})[_0x5fc7('0x14')](function(_0x6335bc){if(_0x17454d){_0x17454d(_0x6335bc);}});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x3f')]=function(_0x1a48b5,_0x31942d){this[_0x5fc7('0x11')][_0x5fc7('0x3f')]({'firstName':_[_0x5fc7('0x40')](_0x1a48b5[_0x5fc7('0x13')])||_[_0x5fc7('0x41')](_0x1a48b5[_0x5fc7('0x13')])?_0x5fc7('0x42')+Math[_0x5fc7('0x43')]():_0x1a48b5[_0x5fc7('0x13')],'lastName':_[_0x5fc7('0x40')](_0x1a48b5[_0x5fc7('0x44')])||_[_0x5fc7('0x41')](_0x1a48b5[_0x5fc7('0x44')])?null:_0x1a48b5[_0x5fc7('0x44')],'phone':_0x1a48b5[_0x5fc7('0x45')],'ListId':_0x1a48b5[_0x5fc7('0x46')],'scheduledat':_0x1a48b5[_0x5fc7('0x47')],'callbackUniqueid':this['channel'][_0x5fc7('0x34')],'tags':_0x5fc7('0x48'),'description':_0x5fc7('0x49')+_0x1a48b5['scheduledAt'][_0x5fc7('0x4a')](),'priority':_0x1a48b5[_0x5fc7('0x4b')]})[_0x5fc7('0x16')](function(_0x1a73c0){_0x31942d(null,_0x1a73c0);})[_0x5fc7('0x14')](function(_0x154ea1){_0x31942d(_0x154ea1);});};AGIVertices['prototype']['getPause']=function(_0x556dd2,_0x22f630){this[_0x5fc7('0x11')][_0x5fc7('0x4c')](_0x556dd2)['then'](function(_0x523144){_0x22f630(null,_0x523144?_0x523144[_0x5fc7('0x13')]:![]);})['catch'](function(_0x14db72){_0x22f630(_0x14db72);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x4d')]=function(_0x41c448,_0x1bfd5a,_0x142ce1){var _0x4cb972={'role':'agent'};_0x4cb972[_0x41c448]=this['channel'][_0x5fc7('0x4e')];this[_0x5fc7('0x11')][_0x5fc7('0x4d')](_0x4cb972,_0x1bfd5a,this[_0x5fc7('0xd')][_0x5fc7('0x34')])[_0x5fc7('0x16')](function(_0x22ef0d){_0x142ce1(null,_[_0x5fc7('0x41')](_0x22ef0d)?![]:!![]);})[_0x5fc7('0x14')](function(_0x5ed4e0){logger[_0x5fc7('0x2a')](_0x5ed4e0);_0x142ce1(null,![]);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x4f')]=function(_0x20a45d,_0x18a0fd){var _0x35c73b={'role':_0x5fc7('0x50')};_0x35c73b[_0x20a45d]=this[_0x5fc7('0xd')]['callerid'];this['rpc'][_0x5fc7('0x4f')](_0x35c73b)['then'](function(_0x2b6520){_0x18a0fd(null,_[_0x5fc7('0x41')](_0x2b6520)?![]:!![]);})['catch'](function(_0x35d2f6){logger['error'](_0x35d2f6);_0x18a0fd(null,![]);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x51')]=function(_0xf3cab1,_0x31b3dd){var _0x9ed8d2={'role':'agent'};_0x9ed8d2[_0xf3cab1]=this[_0x5fc7('0xd')][_0x5fc7('0x4e')];this['rpc'][_0x5fc7('0x51')](_0x9ed8d2)[_0x5fc7('0x16')](function(_0x5b0d7a){_0x31b3dd(null,_[_0x5fc7('0x41')](_0x5b0d7a)?![]:!![]);})['catch'](function(_0x53c0f9){logger['error'](_0x53c0f9);_0x31b3dd(null,![]);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x52')]=function(_0x56ab93,_0x26a34c){var _0x16656f={'role':_0x5fc7('0x50')};_0x16656f[_0x56ab93]=this[_0x5fc7('0xd')][_0x5fc7('0x4e')];var _0x1ed46a=_0x56ab93!=_0x5fc7('0x53')?util[_0x5fc7('0x54')](_0x5fc7('0x55'),'LOCAL',this['channel'][_0x5fc7('0x4e')]):undefined;this['rpc'][_0x5fc7('0x52')](_0x16656f,_0x1ed46a)['then'](function(_0xf5554){_0x26a34c(null,_[_0x5fc7('0x41')](_0xf5554)?![]:!![]);})[_0x5fc7('0x14')](function(_0x21a668){logger[_0x5fc7('0x2a')](_0x21a668);_0x26a34c(null,![]);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x56')]=function(_0x29fab1,_0x2bd83f){sh[_0x5fc7('0x57')](_['trim'](_0x29fab1),function(_0x295c79,_0x36e283){var _0x2343ec=_0x36e283['replace'](/(\r\n|\n|\r)/gm,'');_0x2bd83f(null,_0x2343ec);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x58')]=function(_0x55f99c,_0x2ede0c){scripts[_0x5fc7('0x58')](_0x55f99c[_0x5fc7('0x59')],_0x55f99c[_0x5fc7('0x5a')]||'text',_0x55f99c[_0x5fc7('0x5b')],_0x55f99c['languageCode']||_0x5fc7('0x5c'),_0x55f99c[_0x5fc7('0x5d')]||_0x5fc7('0x5e'),_0x55f99c['audioEncoding']||_0x5fc7('0x5f'))['then'](function(_0x119a5d){_0x2ede0c(null,_0x119a5d);})[_0x5fc7('0x14')](function(_0x1802b2){_0x2ede0c(_0x1802b2);});};AGIVertices['prototype'][_0x5fc7('0x60')]=function(_0x3f3acd,_0x46c44a){scripts[_0x5fc7('0x60')](_0x3f3acd[_0x5fc7('0x5b')],_0x3f3acd[_0x5fc7('0x61')]||'en',0x1)[_0x5fc7('0x16')](function(_0x135191){_0x46c44a(null,_0x135191);})[_0x5fc7('0x14')](function(_0x1d0c54){_0x46c44a(_0x1d0c54);});};AGIVertices[_0x5fc7('0xf')]['restAPI']=function(_0x1db9fd,_0x1c09f3){var _0x297dba={'uri':_0x1db9fd[_0x5fc7('0x62')],'method':_0x1db9fd[_0x5fc7('0x63')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x1db9fd['timeout'])===_0x5fc7('0x64')&&parseInt(_0x1db9fd['timeout'])>=0x1?parseInt(_0x1db9fd[_0x5fc7('0x65')])*0x3e8:0x5*0x3e8};if(_['includes'](['POST',_0x5fc7('0x66')],_0x297dba[_0x5fc7('0x63')]['toUpperCase']())){try{_0x297dba[_0x5fc7('0x67')]=_0x1db9fd[_0x5fc7('0xb')]?JSON['parse'](_0x1db9fd[_0x5fc7('0xb')]):{};}catch(_0x39ebc5){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x39ebc5);}}try{_0x297dba[_0x5fc7('0x68')]=_0x1db9fd['rawHeaders']?JSON[_0x5fc7('0x69')](_0x1db9fd[_0x5fc7('0x6a')]):{};}catch(_0xc2a6b3){logger[_0x5fc7('0x2a')](_0x5fc7('0x6b'),_0xc2a6b3);}if(_0x1db9fd[_0x5fc7('0x6c')]){try{var _0x414f6a=require(_0x1db9fd[_0x5fc7('0x6c')])['sync'](this,_0x297dba);_0x297dba[_0x5fc7('0x6d')]=Mustache[_0x5fc7('0x6e')](_0x1db9fd[_0x5fc7('0x62')],_0x414f6a,{},['$$','$$']);if(_0x297dba[_0x5fc7('0x68')]){_0x297dba[_0x5fc7('0x68')]=JSON[_0x5fc7('0x69')](Mustache[_0x5fc7('0x6e')](JSON[_0x5fc7('0x6f')](_0x297dba[_0x5fc7('0x68')]),_0x414f6a,{},['$$','$$']));}if(_0x297dba['body']){_0x297dba['body']=JSON[_0x5fc7('0x69')](Mustache[_0x5fc7('0x6e')](JSON[_0x5fc7('0x6f')](_0x297dba[_0x5fc7('0x67')]),_0x414f6a,{},['$$','$$']));}}catch(_0x2260ee){logger[_0x5fc7('0x2a')](_0x5fc7('0x70'),_0x2260ee);}}rp(_0x297dba)[_0x5fc7('0x16')](function(_0x42b02d){var _0x3e7db8={'statusCode':_0x42b02d[_0x5fc7('0x71')]||0xc8,'statusMessage':_0x42b02d[_0x5fc7('0x72')]||'OK','headers':_0x42b02d['headers']||{},'body':_0x42b02d['body']||{}};_0x1c09f3(null,_0x3e7db8);})[_0x5fc7('0x14')](function(_0x3e0633){var _0x2f0937={'statusCode':_0x3e0633[_0x5fc7('0x71')]||0x1f4,'statusMessage':_0x3e0633[_0x5fc7('0x73')]||_0x5fc7('0x74'),'headers':_0x3e0633[_0x5fc7('0x75')][_0x5fc7('0x68')]||{},'body':_0x3e0633[_0x5fc7('0x75')]['body']||{}};_0x1c09f3(null,_0x2f0937);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x76')]=function(_0x4c0b72,_0x6a3f5){scripts[_0x5fc7('0x76')](this['channel'][_0x5fc7('0x34')],_0x4c0b72[_0x5fc7('0x77')],_0x4c0b72[_0x5fc7('0x5b')],_0x4c0b72[_0x5fc7('0x78')]||'en')[_0x5fc7('0x16')](function(_0x5de36c){_0x6a3f5(null,_0x5de36c);})[_0x5fc7('0x14')](function(_0x465795){_0x6a3f5(_0x465795);});};AGIVertices[_0x5fc7('0xf')]['googleDialogflowV2']=function(_0x313185,_0x10734f){scripts[_0x5fc7('0x79')](this[_0x5fc7('0xd')][_0x5fc7('0x34')],_0x313185[_0x5fc7('0x7a')],_0x313185['client_email'],_0x313185[_0x5fc7('0x7b')],_0x313185[_0x5fc7('0x5b')],_0x313185[_0x5fc7('0x7c')]||'en')[_0x5fc7('0x16')](function(_0x1ee0b8){_0x10734f(null,_0x1ee0b8);})[_0x5fc7('0x14')](function(_0x3d2719){_0x10734f(_0x3d2719);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x7d')]=function(_0x47cd6e,_0x4d17f0){scripts[_0x5fc7('0x7d')](this[_0x5fc7('0xd')],_0x47cd6e)[_0x5fc7('0x16')](function(_0x5ee329){_0x4d17f0(null,_0x5ee329);})[_0x5fc7('0x14')](function(_0x3089ae){_0x4d17f0(_0x3089ae);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x7e')]=function(_0x14e6f9,_0x43aa2b){scripts[_0x5fc7('0x7e')](_0x14e6f9[_0x5fc7('0x77')],_0x14e6f9['text'],_0x14e6f9[_0x5fc7('0x7f')]||_0x5fc7('0x5c'),_0x14e6f9['speed'])[_0x5fc7('0x16')](function(_0x3e3337){_0x43aa2b(null,_0x3e3337);})[_0x5fc7('0x14')](function(_0x358269){_0x43aa2b(_0x358269);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x80')]=function(_0x10cbcd,_0x432ad5,_0x5c26bd){scripts[_0x5fc7('0x80')](_0x432ad5,_0x10cbcd[_0x5fc7('0x77')],_0x10cbcd[_0x5fc7('0x81')]||_0x5fc7('0x5c'),this[_0x5fc7('0x82')](_0x10cbcd[_0x5fc7('0x83')])?_0x10cbcd[_0x5fc7('0x83')]:undefined)[_0x5fc7('0x16')](function(_0x3145dd){_0x5c26bd(null,_0x3145dd);})['catch'](function(_0x512282){_0x5c26bd(_0x512282);});};AGIVertices['prototype'][_0x5fc7('0x84')]=function(_0x1c8f65,_0xf28ed6){scripts[_0x5fc7('0x84')](_0x1c8f65[_0x5fc7('0x85')],_0x1c8f65[_0x5fc7('0x86')],_0x1c8f65[_0x5fc7('0x87')],_0x1c8f65[_0x5fc7('0x88')]||_0x5fc7('0x89'),_0x1c8f65['text'],_0x1c8f65[_0x5fc7('0x8a')]||_0x5fc7('0x5b'))[_0x5fc7('0x16')](function(_0x41e44c){_0xf28ed6(null,_0x41e44c);})[_0x5fc7('0x14')](function(_0x1287fb){_0xf28ed6(_0x1287fb);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x8b')]=function(_0x15cdc8,_0x2008e4){scripts[_0x5fc7('0x8b')](this[_0x5fc7('0xd')][_0x5fc7('0x34')],_0x15cdc8[_0x5fc7('0x85')],_0x15cdc8[_0x5fc7('0x86')],_0x15cdc8[_0x5fc7('0x8c')],_0x15cdc8['text'],_0x15cdc8[_0x5fc7('0x8d')])[_0x5fc7('0x16')](function(_0x35c499){_0x2008e4(null,_0x35c499);})['catch'](function(_0x293a5c){_0x2008e4(_0x293a5c);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x8e')]=function(_0x328da3,_0xbe1c07,_0x57f32c){scripts[_0x5fc7('0x8e')](_0xbe1c07,_0x328da3[_0x5fc7('0x77')],_0x328da3[_0x5fc7('0x8f')]||'en-US')[_0x5fc7('0x16')](function(_0x49058c){_0x57f32c(null,_0x49058c);})[_0x5fc7('0x14')](function(_0x229a39){_0x57f32c(_0x229a39);});};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x90')]=function(_0x2808d8,_0x2b0e40,_0x5cea2e){scripts['tildeASR'](_0x2b0e40,_0x2808d8[_0x5fc7('0x91')],_0x2808d8['appsecret'],_0x2808d8['uri'])[_0x5fc7('0x16')](function(_0x1aa029){_0x5cea2e(null,_0x1aa029);})[_0x5fc7('0x14')](function(_0x8ba50){_0x5cea2e(_0x8ba50);});};AGIVertices[_0x5fc7('0xf')]['clear']=function(_0x48fdf0){var _0x432c66=_[_0x5fc7('0x92')](verticesWithRetry,_0x48fdf0[_0x5fc7('0x36')])?_0x48fdf0:_[_0x5fc7('0x93')](_0x48fdf0);for(var _0xe30011 in _0x432c66){if(_0x432c66[_0x5fc7('0x94')](_0xe30011)){if(_0x432c66[_0xe30011]&&_[_0x5fc7('0x95')](_0x432c66[_0xe30011])){if(_['includes'](recursiveMapAttributes,_0xe30011)){_0x432c66[_0xe30011]=this['replaceObjectAllVariables'](_0x432c66[_0xe30011]);}else{_0x432c66[_0xe30011]=this[_0x5fc7('0x96')](_0x432c66[_0xe30011]);}}}}return _0x432c66;};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x97')]=function(_0x8d1147){for(var _0x5b6d0a in _0x8d1147){if(_0x8d1147[_0x5fc7('0x94')](_0x5b6d0a)){if(_[_0x5fc7('0x98')](_0x8d1147[_0x5b6d0a])){this[_0x5fc7('0x97')](_0x8d1147[_0x5b6d0a]);}else if(_[_0x5fc7('0x99')](_0x8d1147[_0x5b6d0a])){for(var _0x1dfa30=0x0;_0x1dfa30<_0x8d1147[_0x5b6d0a][_0x5fc7('0x9a')];_0x1dfa30++){this[_0x5fc7('0x97')](_0x8d1147[_0x5b6d0a][_0x1dfa30]);}}else if(_['isString'](_0x8d1147[_0x5b6d0a])){_0x8d1147[_0x5b6d0a]=this['replaceAllVariables'](_0x8d1147[_0x5b6d0a]);}}}};AGIVertices['prototype'][_0x5fc7('0x9b')]=function(_0x16f130,_0x3c0752){for(var _0x13d17b in _0x16f130){if(_0x16f130[_0x5fc7('0x94')](_0x13d17b)){if(_[_0x5fc7('0x98')](_0x16f130[_0x13d17b])){if(!_[_0x5fc7('0x40')](_0x16f130[_0x13d17b])){this[_0x5fc7('0x9b')](_0x16f130[_0x13d17b],util[_0x5fc7('0x54')]('%s.%s',_0x3c0752,_0x13d17b));}}else if(_[_0x5fc7('0x99')](_0x16f130[_0x13d17b])){for(var _0x5bb1b6=0x0;_0x5bb1b6<_0x16f130[_0x13d17b][_0x5fc7('0x9a')];_0x5bb1b6++){this[_0x5fc7('0x9b')](_0x16f130[_0x13d17b][_0x5bb1b6],util[_0x5fc7('0x54')](_0x5fc7('0x9c'),_0x3c0752,_0x13d17b+'['+_0x5bb1b6+']'));}}else{if(!_[_0x5fc7('0x41')](_0x16f130[_0x13d17b])){this[_0x5fc7('0xd')]['setVariable'](util[_0x5fc7('0x54')]('%s.%s',_0x3c0752,_0x13d17b),_0x16f130[_0x13d17b]);}}}}};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x9d')]=function(_0x5b1494){try{var _0x20cb10=JSON[_0x5fc7('0x69')](_0x5b1494);this[_0x5fc7('0x97')](_0x20cb10);return JSON[_0x5fc7('0x6f')](_0x20cb10);}catch(_0x52c5b8){return this[_0x5fc7('0x96')](_0x5b1494);}};AGIVertices[_0x5fc7('0xf')]['replaceAllVariables']=function(_0x1f5d7e){var _0x4ef573=_0x1f5d7e[_0x5fc7('0x9e')]('{');for(var _0x5d91ec=0x1;_0x5d91ec<_0x4ef573[_0x5fc7('0x9a')];_0x5d91ec+=0x1){var _0x575d8f=_0x4ef573[_0x5d91ec]['split']('}');if(_0x575d8f[_0x5fc7('0x9a')]>0x1){_0x1f5d7e=_0x1f5d7e['replaceAll']('{'+_0x575d8f[0x0]+'}',this['channel'][_0x5fc7('0x10')](_0x575d8f[0x0])[_0x5fc7('0x9f')]||_0x575d8f[0x0]);}}if(_0x4ef573['length']===0x1){return _0x1f5d7e[_0x5fc7('0x4a')]();}return this[_0x5fc7('0x96')](_0x1f5d7e);};AGIVertices[_0x5fc7('0xf')]['getAndSetVariable']=function(_0x2b3338,_0x2c14ce){var _0x565117=this[_0x5fc7('0xd')][_0x5fc7('0x10')](_0x2b3338);if(_0x565117[_0x5fc7('0xa0')]===-0x1){return _0x565117;}logger['info'](util[_0x5fc7('0x54')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x2c14ce,_0x565117[_0x5fc7('0x9f')]));return this['channel'][_0x5fc7('0xa1')](_0x2c14ce,_0x565117[_0x5fc7('0x9f')]);};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x82')]=function(_0x40aade){return _0x40aade&&_0x40aade!=='0'&&_0x40aade!=='-1'&&_0x40aade!=='';};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0xa2')]=function(_0x36d7bd){this[_0x5fc7('0x33')][_0x5fc7('0xa3')](this,_0x36d7bd,'-');_0x36d7bd['retry']=_0x36d7bd['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0xa4')]=function(_0x36f5aa){logger['info'](util['format']('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x36f5aa[_0x5fc7('0x35')]));if(!this[_0x5fc7('0x82')](_0x36f5aa[_0x5fc7('0x5b')])){return this[_0x5fc7('0xd')]['noop']('no\x20text\x20configured');}var _0x3d98b2='\x22'+_0x36f5aa['text']+'\x22';if(this[_0x5fc7('0x82')](_0x36f5aa[_0x5fc7('0x75')])){_0x3d98b2+=','+_0x36f5aa[_0x5fc7('0x75')];}var _0x4238ec=this[_0x5fc7('0xd')][_0x5fc7('0x57')](_0x5fc7('0xa5'),_0x3d98b2);if(_0x4238ec[_0x5fc7('0xa0')]===-0x1){return _0x4238ec;}return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')]('Executed\x20command\x20MRCPSynth\x20%s',_0x3d98b2));};AGIVertices['prototype']['mrcprecog']=function(_0x6dbc07){logger[_0x5fc7('0x2d')](util['format'](_0x5fc7('0xa7'),_0x6dbc07['label']));if(!this[_0x5fc7('0x82')](_0x6dbc07[_0x5fc7('0xa8')])){return this['channel']['noop'](_0x5fc7('0xa9'));}var _0xd01f6b=_0x6dbc07[_0x5fc7('0xa8')];if(this['isConfigured'](_0x6dbc07['options'])){_0xd01f6b+=','+_0x6dbc07[_0x5fc7('0x75')];}var _0x18bbc8=this[_0x5fc7('0xd')]['exec'](_0x5fc7('0xaa'),_0xd01f6b);if(_0x18bbc8[_0x5fc7('0xa0')]===-0x1){return _0x18bbc8;}var _0x7b688=this[_0x5fc7('0xab')](_0x5fc7('0xac'),_0x5fc7('0xad'));if(_0x7b688['result']===-0x1){return _0x7b688;}var _0x4e2a3f=this[_0x5fc7('0xab')](_0x5fc7('0xae'),_0x5fc7('0xaf'));if(_0x4e2a3f[_0x5fc7('0xa0')]===-0x1){return _0x4e2a3f;}var _0x1163a7=this['getAndSetVariable']('RECOG_INSTANCE()',_0x5fc7('0xb0'));if(_0x1163a7[_0x5fc7('0xa0')]===-0x1){return _0x1163a7;}return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0xb1'),_0xd01f6b));};AGIVertices[_0x5fc7('0xf')]['agi']=function(_0x3ee664){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0xb2'),_0x3ee664['label']));return this['channel'][_0x5fc7('0x6')]([_0x3ee664['command'],_0x3ee664['args']]);};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0xb3')]=function(_0x21c62f){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0xb4'),_0x21c62f[_0x5fc7('0x35')]));if(this[_0x5fc7('0x82')](_0x21c62f['timeout'])){logger[_0x5fc7('0x2d')](util['format'](_0x5fc7('0xb5'),_0x21c62f[_0x5fc7('0x65')]));var _0x3e649f=this['channel'][_0x5fc7('0xb6')](_0x21c62f['timeout']);if(_0x3e649f[_0x5fc7('0xa0')]===-0x1){return _0x3e649f;}}return this[_0x5fc7('0xd')][_0x5fc7('0xb3')]();};AGIVertices[_0x5fc7('0xf')]['callback']=function(_0x2d57a2){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0xb7'),_0x2d57a2['label']));if(!this[_0x5fc7('0x82')](_0x2d57a2[_0x5fc7('0x46')])){return this[_0x5fc7('0xd')]['error'](_0x2d57a2,_0x5fc7('0xb8'));}_0x2d57a2[_0x5fc7('0x47')]=moment();if(this['isConfigured'](_0x2d57a2[_0x5fc7('0xb9')])){_0x2d57a2[_0x5fc7('0x47')]=moment()[_0x5fc7('0xba')](_0x2d57a2[_0x5fc7('0xb9')],_0x5fc7('0xbb'));}if(!this[_0x5fc7('0x82')](_0x2d57a2[_0x5fc7('0x4b')])){_0x2d57a2[_0x5fc7('0x4b')]=0x2;}this[_0x5fc7('0x3f')][_0x5fc7('0xa3')](this,_0x2d57a2);return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0xbc'),_0x2d57a2[_0x5fc7('0x45')],_0x2d57a2[_0x5fc7('0x46')],_0x2d57a2[_0x5fc7('0x47')]));};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0xbd')]=function(_0x20e801){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0xbe'),_0x20e801[_0x5fc7('0x35')]));var _0xdf858a=this[_0x5fc7('0xd')][_0x5fc7('0x57')](_0x20e801[_0x5fc7('0xbf')],_0x20e801['options']);if(_0xdf858a[_0x5fc7('0xa0')]===-0x1){return _0xdf858a;}return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0xc0'),_0x20e801['application'],_0x20e801[_0x5fc7('0x75')]));};AGIVertices['prototype'][_0x5fc7('0xc1')]=function(_0x270585){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0xc2'),_0x270585[_0x5fc7('0x35')]));if(!this['isConfigured'](_0x270585[_0x5fc7('0x5b')])){return this['channel'][_0x5fc7('0xa6')](_0x5fc7('0xc3'));}var _0xed5bc4='\x22'+_0x270585[_0x5fc7('0x5b')]+'\x22';if(this[_0x5fc7('0x82')](_0x270585[_0x5fc7('0x75')])){_0xed5bc4+=','+_0x270585[_0x5fc7('0x75')];}var _0x4dab78=this[_0x5fc7('0xd')][_0x5fc7('0x57')](_0x5fc7('0xa5'),_0xed5bc4);if(_0x4dab78['result']===-0x1){return _0x4dab78;}return this['channel'][_0x5fc7('0xa6')](util['format'](_0x5fc7('0xc4'),_0xed5bc4));};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0xc5')]=function(_0x7cab84){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0xc6'),_0x7cab84['label']));if(!this['isConfigured'](_0x7cab84[_0x5fc7('0x5b')])){return this['channel'][_0x5fc7('0xa6')](_0x5fc7('0xc3'));}var _0x2ff4c7='\x22'+_0x7cab84[_0x5fc7('0x5b')]+'\x22';if(this['isConfigured'](_0x7cab84[_0x5fc7('0x75')])){_0x2ff4c7+=','+_0x7cab84[_0x5fc7('0x75')];}var _0x23b588=this[_0x5fc7('0xd')][_0x5fc7('0x57')]('MRCPSynth',_0x2ff4c7);if(_0x23b588[_0x5fc7('0xa0')]===-0x1){return _0x23b588;}return this['channel']['noop'](util['format']('Executed\x20command\x20MRCPSynth\x20%s',_0x2ff4c7));};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0xc7')]=function(_0x441455){logger[_0x5fc7('0x2d')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x441455[_0x5fc7('0x35')]));if(!this[_0x5fc7('0x82')](_0x441455[_0x5fc7('0xa8')])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')]('no\x20grammar\x20configured');}var _0x2d91a2=_0x441455[_0x5fc7('0xa8')];if(this['isConfigured'](_0x441455[_0x5fc7('0x75')])){_0x2d91a2+=','+_0x441455[_0x5fc7('0x75')];}var _0x488953=this[_0x5fc7('0xd')][_0x5fc7('0x57')]('MRCPRecog',_0x2d91a2);if(_0x488953[_0x5fc7('0xa0')]===-0x1){return _0x488953;}var _0x5c9333=this['getAndSetVariable'](_0x5fc7('0xac'),_0x5fc7('0xc8'));if(_0x5c9333[_0x5fc7('0xa0')]===-0x1){return _0x5c9333;}var _0x574cb0=this[_0x5fc7('0xab')](_0x5fc7('0xae'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x574cb0[_0x5fc7('0xa0')]===-0x1){return _0x574cb0;}var _0x15d284=this['getAndSetVariable'](_0x5fc7('0xc9'),'LUMENVOX_ASR_INSTANCE');if(_0x15d284['result']===-0x1){return _0x15d284;}return this[_0x5fc7('0xd')]['noop'](util[_0x5fc7('0x54')](_0x5fc7('0xb1'),_0x2d91a2));};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0xca')]=function(_0x326c20){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0xcb'),_0x326c20[_0x5fc7('0x35')]));if(!this[_0x5fc7('0x82')](_0x326c20[_0x5fc7('0xa8')])){return this['channel'][_0x5fc7('0xa6')](_0x5fc7('0xa9'));}var _0x3fe61d=_0x326c20[_0x5fc7('0xa8')];if(this[_0x5fc7('0x82')](_0x326c20[_0x5fc7('0x75')])){_0x3fe61d+=','+_0x326c20[_0x5fc7('0x75')];}var _0x290e9b=this[_0x5fc7('0xd')][_0x5fc7('0x57')](_0x5fc7('0xaa'),_0x3fe61d);if(_0x290e9b[_0x5fc7('0xa0')]===-0x1){return _0x290e9b;}var _0x1c4f8d=this[_0x5fc7('0xab')](_0x5fc7('0xac'),_0x5fc7('0xcc'));if(_0x1c4f8d[_0x5fc7('0xa0')]===-0x1){return _0x1c4f8d;}var _0x3fc711=this[_0x5fc7('0xab')](_0x5fc7('0xae'),'SESTEK_ASR_TRANSCRIPT');if(_0x3fc711[_0x5fc7('0xa0')]===-0x1){return _0x3fc711;}var _0x554640=this[_0x5fc7('0xab')](_0x5fc7('0xc9'),_0x5fc7('0xcd'));if(_0x554640['result']===-0x1){return _0x554640;}return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0xb1'),_0x3fe61d));};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0xce')]=function(_0x2225c1){logger['info'](util[_0x5fc7('0x54')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x2225c1[_0x5fc7('0x35')]));if(!this['isConfigured'](_0x2225c1[_0x5fc7('0xcf')])){return this['channel'][_0x5fc7('0x2a')](_0x2225c1,_0x5fc7('0xd0'));}var _0x55712d=this['getSquareOdbc'][_0x5fc7('0xa3')](this,_0x2225c1[_0x5fc7('0xcf')]);if(!_0x55712d){return this[_0x5fc7('0xd')]['error'](_0x2225c1,_0x5fc7('0xd1'));}if(!this['isConfigured'](_0x2225c1[_0x5fc7('0x2c')])){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x2225c1,_0x5fc7('0xd2'));}var _0x18fbad=_0x2225c1[_0x5fc7('0x2c')][_0x5fc7('0xd3')](/(\r\n|\n|\r)/gm,'\x20');this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0xd4'),_0x18fbad));var _0x12962d=this[_0x5fc7('0x29')][_0x5fc7('0xa3')](this,_0x55712d,_0x18fbad);this['createSquareDetailsReport'][_0x5fc7('0xa3')](this,_0x2225c1,_0x18fbad);if(!this[_0x5fc7('0x82')](_0x2225c1[_0x5fc7('0xd5')])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](_0x5fc7('0xd6'));}var _0x17a457=this[_0x5fc7('0x10')][_0x5fc7('0xa3')](this,_0x2225c1['variable_id']);if(!_0x17a457){return this['channel'][_0x5fc7('0x2a')](_0x2225c1,_0x5fc7('0xd7'));}var _0x16bc5a=this;_0x12962d[_0x5fc7('0xd8')](function(_0x152277,_0x3a78d5){Object['keys'](_0x152277)[_0x5fc7('0xd8')](function(_0x3595a8){_0x16bc5a[_0x5fc7('0xd')]['setVariable'](util[_0x5fc7('0x54')](_0x5fc7('0xd9'),_0x17a457,_0x3a78d5,_0x3595a8),_0x152277[_0x3595a8]);});});this[_0x5fc7('0xd')]['setVariable'](util['format'](_0x5fc7('0xda'),_0x17a457),_0x12962d[_0x5fc7('0x9a')]);return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util['format']('variable\x20%s\x20set',_0x17a457));};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0xdb')]=function(_0x355b14){logger['debug'](util[_0x5fc7('0x54')](_0x5fc7('0xdc'),_0x355b14[_0x5fc7('0x35')]));if(!this[_0x5fc7('0x82')](_0x355b14[_0x5fc7('0xdd')])){return this[_0x5fc7('0xd')]['error'](_0x355b14,'no\x20user\x20selected');}var _0x3c8ef5=this['getUser']['sync'](this,_0x355b14[_0x5fc7('0xdd')]);if(!_0x3c8ef5){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x355b14,_0x5fc7('0xde'));}var _0x4d2b48=this['channel']['exec'](_0x5fc7('0xdf'),[util[_0x5fc7('0x54')](_0x5fc7('0xe0'),_0x3c8ef5),_0x355b14[_0x5fc7('0x65')],_0x355b14['opts'],_0x355b14[_0x5fc7('0x62')]]);if(_0x4d2b48[_0x5fc7('0xa0')]===-0x1){return _0x4d2b48;}return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util['format'](_0x5fc7('0xe1'),_0x5fc7('0xdf')));};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0xe2')]=function(_0x18b50e){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x18b50e['label']));if(!this[_0x5fc7('0x82')](_0x18b50e[_0x5fc7('0x77')])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](_0x5fc7('0xe3'));}if(!this[_0x5fc7('0x82')](_0x18b50e['text'])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')]('no\x20text\x20configured');}this['channel'][_0x5fc7('0xe4')]=!![];this[_0x5fc7('0x33')](_0x18b50e);this[_0x5fc7('0x3e')](_0x18b50e[_0x5fc7('0x5b')],'in','','');this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')]('Trying\x20Dialogflow:\x20%s',_0x18b50e['text']));var _0x339953=this[_0x5fc7('0x76')][_0x5fc7('0xa3')](this,_0x18b50e);if(_0x339953){for(var _0x129b6b in _0x339953){if(_0x339953[_0x5fc7('0x94')](_0x129b6b)){this[_0x5fc7('0xd')]['setVariable'](util[_0x5fc7('0x54')]('DIALOGFLOW_%s',_0x129b6b[_0x5fc7('0xe5')]()),_0x339953[_0x129b6b]);}}this[_0x5fc7('0x3e')](_0x339953[_0x5fc7('0xe6')],_0x5fc7('0xe7'),_0x5fc7('0xe2'),'');return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util['format'](_0x5fc7('0xe8'),_0x339953[_0x5fc7('0xe6')]));}return this['channel'][_0x5fc7('0x2a')](_0x18b50e,'Dialogflow\x20is\x20unreachable');};AGIVertices['prototype'][_0x5fc7('0xe9')]=function(_0x49d189){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0xea'),_0x49d189[_0x5fc7('0x35')]));if(!this[_0x5fc7('0x82')](_0x49d189[_0x5fc7('0x7a')])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](_0x5fc7('0xeb'));}if(!this[_0x5fc7('0x82')](_0x49d189['client_email'])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')]('no\x20client_email\x20configured');}if(!this[_0x5fc7('0x82')](_0x49d189['private_key'])){return this['channel']['noop']('no\x20private_key\x20configured');}if(!this[_0x5fc7('0x82')](_0x49d189[_0x5fc7('0x7c')])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')]('no\x20anguage\x20configured');}if(!this['isConfigured'](_0x49d189[_0x5fc7('0x5b')])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](_0x5fc7('0xc3'));}this[_0x5fc7('0xd')][_0x5fc7('0xe4')]=!![];this[_0x5fc7('0x33')](_0x49d189);this[_0x5fc7('0x3e')](_0x49d189['text'],'in','','');this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0xec'),_0x49d189[_0x5fc7('0x5b')]));var _0x2c11f3=this['googleDialogflowV2']['sync'](this,_0x49d189);if(_0x2c11f3){for(var _0x412b41 in _0x2c11f3){if(_0x2c11f3['hasOwnProperty'](_0x412b41)){if(_0x412b41!==_0x5fc7('0xed')){this[_0x5fc7('0xd')][_0x5fc7('0xa1')](util['format'](_0x5fc7('0xee'),_0x412b41['toUpperCase']()),_0x2c11f3[_0x412b41]);}}}this['createSquareMessage'](_0x2c11f3[_0x5fc7('0xe6')],_0x5fc7('0xe7'),_0x5fc7('0xe9'),_0x2c11f3[_0x5fc7('0xed')]);return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0xef'),_0x2c11f3[_0x5fc7('0xe6')]));}return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x49d189,_0x5fc7('0xf0'));};AGIVertices[_0x5fc7('0xf')]['sesteknda']=function(_0x198c45){logger['info'](util[_0x5fc7('0x54')](_0x5fc7('0xf1'),_0x198c45[_0x5fc7('0x35')]));if(!this[_0x5fc7('0x82')](_0x198c45['ndauth_url'])){return this['channel'][_0x5fc7('0xa6')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x5fc7('0x82')](_0x198c45[_0x5fc7('0xf2')])){return this['channel'][_0x5fc7('0xa6')](_0x5fc7('0xf3'));}if(!this[_0x5fc7('0x82')](_0x198c45[_0x5fc7('0xf4')])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](_0x5fc7('0xf5'));}if(!this['isConfigured'](_0x198c45[_0x5fc7('0xf6')])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](_0x5fc7('0xc3'));}this[_0x5fc7('0xd')][_0x5fc7('0xe4')]=!![];this[_0x5fc7('0x33')](_0x198c45);this[_0x5fc7('0x3e')](_0x198c45[_0x5fc7('0x5b')],'in','','');this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util['format'](_0x5fc7('0xf7'),_0x198c45[_0x5fc7('0x5b')]));var _0x35a9f4=this[_0x5fc7('0x7d')]['sync'](this,_0x198c45);if(_0x35a9f4){for(var _0x1c5e71 in _0x35a9f4){if(_0x35a9f4[_0x5fc7('0x94')](_0x1c5e71)){this[_0x5fc7('0xd')]['setVariable'](util['format'](_0x5fc7('0xf8'),_0x1c5e71['toUpperCase']()),_0x35a9f4[_0x1c5e71]);}}this['createSquareMessage'](_0x35a9f4[_0x5fc7('0xe6')],'out',_0x5fc7('0xf9'),'');if(_0x35a9f4[_0x5fc7('0xfa')]){this[_0x5fc7('0xd')]['noop'](util[_0x5fc7('0x54')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x35a9f4[_0x5fc7('0xfa')]));var _0x290ee9=this[_0x5fc7('0xd')][_0x5fc7('0xfb')](_0x35a9f4[_0x5fc7('0xfa')]);try{fs['unlink'](_0x35a9f4[_0x5fc7('0xfa')]+'.wav');}catch(_0x3bde84){logger[_0x5fc7('0x2a')](_0x3bde84);}return _0x290ee9;}else{return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0xfc'),_0x35a9f4[_0x5fc7('0xe6')]));}}return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x198c45,_0x5fc7('0xfd'));};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0xfe')]=function(_0x47b393){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0xff'),_0x47b393[_0x5fc7('0x35')]));return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](_0x5fc7('0xfe'));};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x100')]=function(_0x3da557){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x101'),_0x3da557[_0x5fc7('0x35')]));var _0x348b0f='';if(_0x3da557[_0x5fc7('0x102')]){if(!this[_0x5fc7('0x82')](_0x3da557[_0x5fc7('0x102')])){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x3da557,_0x5fc7('0x103'));}else{var _0x3795bf=parseInt(_0x3da557[_0x5fc7('0x102')],0xa);if(isNaN(_0x3795bf)){_0x348b0f=_0x3da557['trunk_id'];}else{_0x348b0f=this[_0x5fc7('0x1c')][_0x5fc7('0xa3')](this,_0x3da557[_0x5fc7('0x102')]);if(!_0x348b0f){return this['channel']['error'](_0x3da557,'no\x20trunk\x20found');}}}}else if(_0x3da557['trunk_name']){_0x348b0f=_0x3da557[_0x5fc7('0x104')];}else{return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x3da557,_0x5fc7('0x103'));}var _0x3f3335=this['channel'][_0x5fc7('0x57')]('DIAL',[util['format'](_0x5fc7('0x105'),_0x348b0f,_0x3da557['phone']),_0x3da557['timeout'],_0x3da557[_0x5fc7('0x106')],_0x3da557['url']]);if(_0x3f3335[_0x5fc7('0xa0')]===-0x1){return _0x3f3335;}return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0xe1'),_0x5fc7('0xdf')));};AGIVertices[_0x5fc7('0xf')]['finally']=function(_0x1bbe32){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x107'),_0x1bbe32['label']));return this['channel'][_0x5fc7('0xa6')]('finally');};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0xc')]=function(_0x311e3b){logger['info'](util[_0x5fc7('0x54')](_0x5fc7('0x108'),_0x311e3b[_0x5fc7('0x35')]));if(_0x311e3b[_0x5fc7('0x109')]===0x0){return this['maxRetry'](_0x311e3b);}_0x311e3b[_0x5fc7('0x109')]-=0x1;if(!this[_0x5fc7('0x82')](_0x311e3b[_0x5fc7('0x10a')])){return this[_0x5fc7('0xd')]['error'](_0x311e3b,'no\x20file\x20audio\x20selected');}var _0x2909f4=this[_0x5fc7('0x10b')][_0x5fc7('0xa3')](this,_0x311e3b[_0x5fc7('0x10a')]);if(!_0x2909f4){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x311e3b,_0x5fc7('0x10c'));}if(!this[_0x5fc7('0x82')](_0x311e3b['variable_id'])){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x5fc7('0xd6'));}var _0x420688=this['channel'][_0x5fc7('0x10d')](_0x2909f4,_0x311e3b[_0x5fc7('0x10e')],_0x311e3b[_0x5fc7('0x10f')]);var _0x476333=_0x420688[_0x5fc7('0xa0')]?_0x420688[_0x5fc7('0xa0')][_0x5fc7('0x4a')]():'';logger[_0x5fc7('0x2d')](_0x5fc7('0x110'),JSON[_0x5fc7('0x6f')](_0x420688));if(_0x420688[_0x5fc7('0xa0')]===-0x1){this[_0x5fc7('0x33')]['sync'](this,_0x311e3b,_0x476333);return _0x420688;}else if(_0x420688[_0x5fc7('0x9f')]===_0x5fc7('0x65')){_0x420688[_0x5fc7('0xa0')]=_0x476333[_0x5fc7('0x9a')]>=parseInt(_0x311e3b['mindigit'])?'x':'i';}else{_0x420688['result']=_0x476333[_0x5fc7('0x9a')]>=parseInt(_0x311e3b[_0x5fc7('0x111')])&&_0x476333['length']<=parseInt(_0x311e3b[_0x5fc7('0x10f')])?'x':'i';}var _0x1a0897=this[_0x5fc7('0x10')][_0x5fc7('0xa3')](this,_0x311e3b['variable_id']);if(!_0x1a0897){return this[_0x5fc7('0xd')]['error'](_0x311e3b,_0x5fc7('0xd7'));}this[_0x5fc7('0xd')]['setVariable'](_0x1a0897,_0x476333);if(this['isConfigured'](_0x311e3b['hiddendigitsnum'])){var _0x386a6b=parseInt(_0x311e3b[_0x5fc7('0x112')],0xa);var _0x162786=rs['generate']({'charset':'*','length':_0x386a6b});var _0x38d967=_0x476333['length'];if(_0x38d967>0x0){if(_0x38d967>_0x386a6b){this[_0x5fc7('0x33')][_0x5fc7('0xa3')](this,_0x311e3b,_0x311e3b['hiddendigitspos']==='first'?_0x162786+_0x476333['substr'](_0x386a6b):_0x476333['substr'](0x0,_0x38d967-_0x386a6b)+_0x162786);}else{this[_0x5fc7('0x33')][_0x5fc7('0xa3')](this,_0x311e3b,rs[_0x5fc7('0x113')]({'charset':'*','length':_0x38d967}));}}else{this[_0x5fc7('0x33')]['sync'](this,_0x311e3b,'');}}else{this['createSquareDetailsReport'][_0x5fc7('0xa3')](this,_0x311e3b,_0x476333);}return _0x420688;};AGIVertices[_0x5fc7('0xf')]['getsecretdigits']=function(_0x566406){logger['info'](util[_0x5fc7('0x54')](_0x5fc7('0x114'),_0x566406[_0x5fc7('0x35')]));return this['getdigits'](_0x566406);};AGIVertices['prototype'][_0x5fc7('0x115')]=function(_0x5cc71e){logger[_0x5fc7('0x2d')](util['format'](_0x5fc7('0x116'),_0x5cc71e['label']));this['createSquareDetailsReport'][_0x5fc7('0xa3')](this,_0x5cc71e,_0x5cc71e['goalname']);return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')]('GOAL\x20%s',_0x5cc71e['goalname']));};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x117')]=function(_0x36a8c2){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x118'),_0x36a8c2[_0x5fc7('0x35')]));if(!this[_0x5fc7('0x82')](_0x36a8c2['aws_access_key_id'])||!this[_0x5fc7('0x82')](_0x36a8c2[_0x5fc7('0x86')])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](_0x5fc7('0x119'));}if(!this['isConfigured'](_0x36a8c2[_0x5fc7('0x5b')])){return this['channel'][_0x5fc7('0xa6')](_0x5fc7('0xc3'));}this[_0x5fc7('0xd')]['noop'](util['format']('Trying\x20aws\x20Polly\x20%s',_0x36a8c2['text']));var _0x5445d5=this[_0x5fc7('0x84')][_0x5fc7('0xa3')](this,_0x36a8c2);if(_0x5445d5){this['channel'][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0x11a'),_0x5445d5));var _0x340c79=this[_0x5fc7('0xd')][_0x5fc7('0xfb')](_0x5445d5);try{fs[_0x5fc7('0x11b')](_0x5445d5+'.wav');}catch(_0x27c242){logger['error'](_0x27c242);}return _0x340c79;}return this['channel'][_0x5fc7('0x2a')](_0x36a8c2,_0x5fc7('0x11c'));};AGIVertices['prototype'][_0x5fc7('0x11d')]=function(_0xebd67){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x11e'),_0xebd67[_0x5fc7('0x35')]));if(!this[_0x5fc7('0x82')](_0xebd67[_0x5fc7('0x85')])||!this[_0x5fc7('0x82')](_0xebd67['aws_secret_access_key'])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](_0x5fc7('0x119'));}if(!this[_0x5fc7('0x82')](_0xebd67[_0x5fc7('0x8d')])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](_0x5fc7('0x11f'));}if(!this[_0x5fc7('0x82')](_0xebd67[_0x5fc7('0x5b')])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](_0x5fc7('0xc3'));}this[_0x5fc7('0xd')][_0x5fc7('0xe4')]=!![];this[_0x5fc7('0x33')](_0xebd67);this[_0x5fc7('0x3e')](_0xebd67[_0x5fc7('0x5b')],'in','','');this['channel'][_0x5fc7('0xa6')](util['format']('Trying\x20Amazon\x20Lex:\x20%s',_0xebd67[_0x5fc7('0x5b')]));var _0x36de58=this[_0x5fc7('0x8b')]['sync'](this,_0xebd67);if(_0x36de58){for(var _0x17c555 in _0x36de58){if(_0x36de58['hasOwnProperty'](_0x17c555)&&_['isString'](_0x36de58[_0x17c555])){this[_0x5fc7('0xd')][_0x5fc7('0xa1')](util['format'](_0x5fc7('0x120'),_0x17c555[_0x5fc7('0xe5')]()),_0x36de58[_0x17c555]);}}if(_[_0x5fc7('0x41')](_0x36de58[_0x5fc7('0x73')])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](_0x5fc7('0x121'));}else{this[_0x5fc7('0x3e')](_0x36de58[_0x5fc7('0x73')],'out',_0x5fc7('0x122'),'');return this[_0x5fc7('0xd')]['noop'](util[_0x5fc7('0x54')]('Amazon\x20Lex\x20Result\x20%s',_0x36de58[_0x5fc7('0x73')]));}}return this['channel']['error'](_0xebd67,_0x5fc7('0x123'));};AGIVertices['prototype'][_0x5fc7('0x124')]=function(_0x157c03){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x125'),_0x157c03[_0x5fc7('0x35')],_0x157c03[_0x5fc7('0x65')]));if(!this[_0x5fc7('0x82')](_0x157c03[_0x5fc7('0x77')])){return this[_0x5fc7('0xd')]['noop'](_0x5fc7('0xe3'));}var _0x46b3f9=_0x5fc7('0x126');var _0xa458b=util[_0x5fc7('0x54')](_0x5fc7('0x127'),FILES_PATH,rs['generate'](0x4));var _0x218d2f=util[_0x5fc7('0x54')]('%s.%s',_0xa458b,_0x46b3f9);var _0x1361ec=!![];if(_0x157c03[_0x5fc7('0x128')]==='NOBEEP'){_0x1361ec=![];}var _0x2bca5e=this[_0x5fc7('0xd')][_0x5fc7('0x129')](_0xa458b,_0x46b3f9,_0x157c03[_0x5fc7('0x12a')],_0x157c03[_0x5fc7('0x65')],undefined,_0x1361ec);if(_0x2bca5e[_0x5fc7('0xa0')]!==-0x1){this[_0x5fc7('0xd')]['noop'](util[_0x5fc7('0x54')](_0x5fc7('0x12b'),_0x218d2f));var _0x402093=this['googleASR'][_0x5fc7('0xa3')](this,_0x157c03,_0x218d2f);if(_0x402093){for(var _0x5a1f60 in _0x402093){if(_0x402093[_0x5fc7('0x94')](_0x5a1f60)){this['channel'][_0x5fc7('0xa1')](util[_0x5fc7('0x54')](_0x5fc7('0x12c'),_0x5a1f60['toUpperCase']()),_0x402093[_0x5a1f60]);}}return this['channel']['noop'](util[_0x5fc7('0x54')](_0x5fc7('0x12d'),JSON[_0x5fc7('0x6f')](_0x402093)));}}return _0x2bca5e;};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x12e')]=function(_0x503bf5){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x12f'),_0x503bf5[_0x5fc7('0x35')]));if(!this['isConfigured'](_0x503bf5[_0x5fc7('0x91')])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')]('no\x20appid\x20configured');}if(!this[_0x5fc7('0x82')](_0x503bf5['appsecret'])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')]('no\x20appsecret\x20configured');}var _0x2af597=_0x5fc7('0x126');var _0xb55c27=util[_0x5fc7('0x54')](_0x5fc7('0x127'),FILES_PATH,rs['generate'](0x4));var _0x32e9f2=util['format'](_0x5fc7('0x9c'),_0xb55c27,_0x2af597);var _0x2f5418=!![];if(_0x503bf5[_0x5fc7('0x128')]===_0x5fc7('0x130')){_0x2f5418=![];}var _0x168194=this[_0x5fc7('0xd')][_0x5fc7('0x129')](_0xb55c27,_0x2af597,_0x503bf5[_0x5fc7('0x12a')],_0x503bf5[_0x5fc7('0x65')],undefined,_0x2f5418);if(_0x168194[_0x5fc7('0xa0')]!==-0x1){this['channel']['noop'](util['format'](_0x5fc7('0x131'),_0x32e9f2));var _0x217191=this[_0x5fc7('0x90')]['sync'](this,_0x503bf5,_0x32e9f2);if(_0x217191){for(var _0x40ca02 in _0x217191){if(_0x217191[_0x5fc7('0x94')](_0x40ca02)){this[_0x5fc7('0xd')]['setVariable'](util[_0x5fc7('0x54')](_0x5fc7('0x132'),_0x40ca02[_0x5fc7('0xe5')]()),_0x217191[_0x40ca02]);}}return this['channel'][_0x5fc7('0xa6')](util[_0x5fc7('0x54')]('TildeASR\x20Result\x20%s',JSON[_0x5fc7('0x6f')](_0x217191)));}}return _0x168194;};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x133')]=function(_0x1ca4a2){logger[_0x5fc7('0x2d')](util['format'](_0x5fc7('0x134'),_0x1ca4a2[_0x5fc7('0x35')]));return this['channel'][_0x5fc7('0x135')](_0x1ca4a2['context'],_0x1ca4a2[_0x5fc7('0x136')],_0x1ca4a2[_0x5fc7('0x3a')]);};AGIVertices[_0x5fc7('0xf')]['gotoif']=function(_0x467421){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x137'),_0x467421['label']));if(!this[_0x5fc7('0x82')](_0x467421['condition'])){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x467421,_0x5fc7('0x138'));}try{var _0x3f9afa=eval(_0x467421[_0x5fc7('0x139')])?_0x5fc7('0x13a'):_0x5fc7('0x13b');this['channel'][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0x13c'),_0x467421['condition'],_0x3f9afa));return{'code':0xc8,'result':_0x3f9afa};}catch(_0x5c6d3c){return{'code':0xc8,'result':_0x5fc7('0x13b')};}};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x13d')]=function(_0x53204b){logger[_0x5fc7('0x2d')](util['format'](_0x5fc7('0x13e'),_0x53204b[_0x5fc7('0x35')]));if(!this[_0x5fc7('0x82')](_0x53204b[_0x5fc7('0x13f')])){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x53204b,'no\x20interval\x20configured');}var _0x395dcc=this['getIntervals'][_0x5fc7('0xa3')](this,_0x53204b[_0x5fc7('0x13f')]);if(!_0x395dcc){return this[_0x5fc7('0xd')]['error'](_0x53204b,'no\x20intervals\x20found');}for(var _0x511729=0x0;_0x511729<_0x395dcc[_0x5fc7('0x9a')];_0x511729+=0x1){var _0x2fff60=this[_0x5fc7('0xd')]['getVariable'](util[_0x5fc7('0x54')](_0x5fc7('0x140'),_0x395dcc[_0x511729]));if(_0x2fff60[_0x5fc7('0xa0')]===-0x1){return _0x2fff60;}logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x141'),_0x395dcc[_0x511729],_0x2fff60['extra']));if(_0x2fff60['extra']===_0x5fc7('0x13a')){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x141'),_0x395dcc[_0x511729],_0x5fc7('0x13a')));this[_0x5fc7('0xd')]['noop'](util['format'](_0x5fc7('0x141'),_0x395dcc[_0x511729],_0x5fc7('0x13a')));return{'code':0xc8,'result':_0x5fc7('0x13a')};}else{logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x141'),_0x395dcc[_0x511729],'false'));this['channel']['noop'](util[_0x5fc7('0x54')](_0x5fc7('0x141'),_0x395dcc[_0x511729],_0x5fc7('0x13b')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x142')]=function(_0x3d5002){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x143'),_0x3d5002[_0x5fc7('0x35')]));return this['channel'][_0x5fc7('0x142')]();};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x144')]=function(_0x291f69){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x291f69[_0x5fc7('0x35')]));if(!this[_0x5fc7('0x82')](_0x291f69[_0x5fc7('0x77')])){return this['channel'][_0x5fc7('0xa6')](_0x5fc7('0xe3'));}var _0x1ee948=_0x5fc7('0x126');var _0x3b7561=util[_0x5fc7('0x54')]('%s/recordings/%s',FILES_PATH,rs[_0x5fc7('0x113')](0x4));var _0x1e729c=util[_0x5fc7('0x54')](_0x5fc7('0x9c'),_0x3b7561,_0x1ee948);var _0x56b34a=!![];if(_0x291f69[_0x5fc7('0x128')]===_0x5fc7('0x130')){_0x56b34a=![];}var _0x13bde1=this['channel'][_0x5fc7('0x129')](_0x3b7561,_0x1ee948,_0x291f69[_0x5fc7('0x12a')],_0x291f69[_0x5fc7('0x65')],undefined,_0x56b34a);if(_0x13bde1[_0x5fc7('0xa0')]!==-0x1){this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0x145'),_0x1e729c));var _0x485e05=this[_0x5fc7('0x80')][_0x5fc7('0xa3')](this,_0x291f69,_0x1e729c);if(_0x485e05){for(var _0x411499 in _0x485e05){if(_0x485e05[_0x5fc7('0x94')](_0x411499)){this[_0x5fc7('0xd')][_0x5fc7('0xa1')](util[_0x5fc7('0x54')](_0x5fc7('0x146'),_0x411499['toUpperCase']()),_0x485e05[_0x411499]);}}return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0x147'),JSON['stringify'](_0x485e05)));}}return _0x13bde1;};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x148')]=function(_0xe822e5){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x149'),_0xe822e5[_0x5fc7('0x35')]));if(!this['isConfigured'](_0xe822e5['key'])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')]('no\x20key\x20configured');}if(!this[_0x5fc7('0x82')](_0xe822e5[_0x5fc7('0x5b')])){return this['channel'][_0x5fc7('0xa6')](_0x5fc7('0xc3'));}this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0x14a'),_0xe822e5[_0x5fc7('0x5b')]));var _0x4d8812=this[_0x5fc7('0x7e')][_0x5fc7('0xa3')](this,_0xe822e5);if(_0x4d8812){this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0x145'),_0x4d8812));var _0x3ce98f=this[_0x5fc7('0xd')][_0x5fc7('0xfb')](_0x4d8812,_0xe822e5[_0x5fc7('0x12a')]);try{fs['unlink'](_0x4d8812+'.wav');}catch(_0xf97703){logger[_0x5fc7('0x2a')](_0xf97703);}return _0x3ce98f;}return this['channel'][_0x5fc7('0x2a')](_0xe822e5,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x5fc7('0xf')]['login']=function(_0x2d6814){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x14b'),_0x2d6814[_0x5fc7('0x35')]));if(!this['isConfigured'](_0x2d6814[_0x5fc7('0x14c')])){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x2d6814,'no\x20find\x20by\x20configured');}logger[_0x5fc7('0x2d')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x5fc7('0xd')]['callerid'],_0x2d6814[_0x5fc7('0x14c')]));var _0xcab051=this[_0x5fc7('0x52')][_0x5fc7('0xa3')](this,_0x2d6814[_0x5fc7('0x14c')]);if(_0xcab051){logger[_0x5fc7('0x2d')](util['format'](_0x5fc7('0x14d'),this[_0x5fc7('0xd')][_0x5fc7('0x4e')],_0x2d6814['findBy']));this[_0x5fc7('0xd')]['noop'](util[_0x5fc7('0x54')](_0x5fc7('0x14d'),this[_0x5fc7('0xd')][_0x5fc7('0x4e')],_0x2d6814[_0x5fc7('0x14c')]));return{'code':0xc8,'result':_0x5fc7('0x14e')};}else{logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x5fc7('0xd')][_0x5fc7('0x4e')],_0x2d6814[_0x5fc7('0x14c')]));this['channel'][_0x5fc7('0xa6')](util['format'](_0x5fc7('0x14f'),this[_0x5fc7('0xd')][_0x5fc7('0x4e')],_0x2d6814[_0x5fc7('0x14c')]));return{'code':0xc8,'result':_0x5fc7('0x150')};}};AGIVertices['prototype']['logout']=function(_0x222050){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x151'),_0x222050[_0x5fc7('0x35')]));if(!this[_0x5fc7('0x82')](_0x222050[_0x5fc7('0x14c')])){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x222050,_0x5fc7('0x152'));}logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x5fc7('0xd')][_0x5fc7('0x4e')],_0x222050[_0x5fc7('0x14c')]));var _0x2f485f=this['agentLogout'][_0x5fc7('0xa3')](this,_0x222050[_0x5fc7('0x14c')]);if(_0x2f485f){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x14d'),this['channel'][_0x5fc7('0x4e')],_0x222050[_0x5fc7('0x14c')]));this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5fc7('0xd')][_0x5fc7('0x4e')],_0x222050['findBy']));return{'code':0xc8,'result':_0x5fc7('0x14e')};}else{logger['info'](util[_0x5fc7('0x54')](_0x5fc7('0x14f'),this[_0x5fc7('0xd')][_0x5fc7('0x4e')],_0x222050[_0x5fc7('0x14c')]));this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0x14f'),this[_0x5fc7('0xd')][_0x5fc7('0x4e')],_0x222050[_0x5fc7('0x14c')]));return{'code':0xc8,'result':_0x5fc7('0x150')};}};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x153')]=function(_0x1f659f){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x154'),_0x1f659f[_0x5fc7('0x35')]));if(!this[_0x5fc7('0x82')](_0x1f659f['operation'])){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x1f659f,_0x5fc7('0x155'));}this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util['format'](_0x5fc7('0x156'),_0x1f659f[_0x5fc7('0x157')]));var _0x37534d=eval(_0x1f659f[_0x5fc7('0x157')]);if(!this['isConfigured'](_0x1f659f[_0x5fc7('0xd5')])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](_0x5fc7('0xd6'));}var _0x463bc0=this[_0x5fc7('0x10')]['sync'](this,_0x1f659f[_0x5fc7('0xd5')]);if(!_0x463bc0){return this[_0x5fc7('0xd')]['error'](_0x1f659f,_0x5fc7('0xd7'));}if(_[_0x5fc7('0x99')](_0x37534d)){var _0x6dbe6=this;_0x37534d[_0x5fc7('0xd8')](function(_0xa53c1d,_0x4fffd9){_0x6dbe6[_0x5fc7('0xd')][_0x5fc7('0xa1')](util[_0x5fc7('0x54')]('%s[%s]',_0x463bc0,_0x4fffd9),_0xa53c1d);});return this[_0x5fc7('0xd')]['noop'](util[_0x5fc7('0x54')](_0x5fc7('0x158'),_0x463bc0));}else{return this['channel'][_0x5fc7('0xa1')](_0x463bc0,_0x37534d);}};AGIVertices['prototype']['menu']=function(_0x5e3845){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x159'),_0x5e3845[_0x5fc7('0x35')]));if(_0x5e3845[_0x5fc7('0x109')]===0x0){return this['maxRetry'](_0x5e3845);}_0x5e3845[_0x5fc7('0x109')]-=0x1;if(!this[_0x5fc7('0x82')](_0x5e3845[_0x5fc7('0x10a')])){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x5e3845,_0x5fc7('0x15a'));}var _0x1fa97d=this[_0x5fc7('0x10b')][_0x5fc7('0xa3')](this,_0x5e3845[_0x5fc7('0x10a')]);if(!_0x1fa97d){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x5e3845,_0x5fc7('0x10c'));}var _0x245754=this[_0x5fc7('0xd')]['getData'](_0x1fa97d,_0x5e3845[_0x5fc7('0x10e')],_0x5e3845[_0x5fc7('0x15b')]);var _0xfee94b=_0x245754[_0x5fc7('0xa0')];if(_0x245754['result']===-0x1){this['createSquareDetailsReport']['sync'](this,_0x5e3845,'-1');return _0x245754;}else if(_0x245754['extra']===_0x5fc7('0x65')){_0x245754[_0x5fc7('0xa0')]=_0x245754[_0x5fc7('0xa0')][_0x5fc7('0x9a')]>0x0?_0x245754[_0x5fc7('0xa0')]:'t';}else if(_[_0x5fc7('0x40')](_0x245754[_0x5fc7('0xa0')])){_0x245754[_0x5fc7('0xa0')]='#';_0xfee94b='#';}if(!this['isConfigured'](_0x5e3845[_0x5fc7('0xd5')])){this[_0x5fc7('0xd')][_0x5fc7('0xa6')](_0x5fc7('0xd6'));}else{var _0x39d06b=this['getVariable']['sync'](this,_0x5e3845[_0x5fc7('0xd5')]);if(!_0x39d06b){return this['channel']['error'](_0x5e3845,'no\x20variable\x20found');}this[_0x5fc7('0xd')]['setVariable'](_0x39d06b,_0xfee94b);}this['createSquareDetailsReport'][_0x5fc7('0xa3')](this,_0x5e3845,_0xfee94b);return _0x245754;};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0xa6')]=function(_0x261396){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x15c'),_0x261396[_0x5fc7('0x35')]));return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](_0x261396[_0x5fc7('0x15d')]||_0x261396[_0x5fc7('0x35')]);};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x15e')]=function(_0x40653e){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x15f'),_0x40653e[_0x5fc7('0x35')]));if(!this['isConfigured'](_0x40653e[_0x5fc7('0x14c')])){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x40653e,'no\x20find\x20by\x20configured');}logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x160'),this[_0x5fc7('0xd')][_0x5fc7('0x4e')],_0x40653e[_0x5fc7('0x14c')]));var _0x5bd732=this[_0x5fc7('0x161')][_0x5fc7('0xa3')](this,_0x40653e[_0x5fc7('0x162')]);var _0x3e1326=this['agentPause']['sync'](this,_0x40653e['findBy'],_0x5bd732);if(_0x3e1326){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x14d'),this[_0x5fc7('0xd')][_0x5fc7('0x4e')],_0x40653e[_0x5fc7('0x14c')]));this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0x14d'),this['channel'][_0x5fc7('0x4e')],_0x40653e[_0x5fc7('0x14c')]));return{'code':0xc8,'result':'success'};}else{logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x14f'),this[_0x5fc7('0xd')][_0x5fc7('0x4e')],_0x40653e['findBy']));this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0x14d'),this['channel'][_0x5fc7('0x4e')],_0x40653e[_0x5fc7('0x14c')]));return{'code':0xc8,'result':_0x5fc7('0x150')};}};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x163')]=function(_0x393c6f){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x164'),_0x393c6f['label']));if(!this['isConfigured'](_0x393c6f['file_id'])){return this['channel'][_0x5fc7('0x2a')](_0x393c6f,_0x5fc7('0x15a'));}var _0x2bcfae=this[_0x5fc7('0x10b')]['sync'](this,_0x393c6f['file_id']);if(!_0x2bcfae){return this['channel'][_0x5fc7('0x2a')](_0x393c6f,'no\x20file\x20audio\x20found');}var _0xbfa0f4=this[_0x5fc7('0xd')]['exec'](_0x5fc7('0x165'),[_0x2bcfae,_0x393c6f[_0x5fc7('0x106')]]);if(_0xbfa0f4[_0x5fc7('0xa0')]===-0x1){return _0xbfa0f4;}return this[_0x5fc7('0xd')]['noop'](util[_0x5fc7('0x54')]('Executed\x20command\x20%s\x20%s',_0x5fc7('0x165'),_0x2bcfae));};AGIVertices[_0x5fc7('0xf')]['queue']=function(_0x4fa651){logger['info'](util[_0x5fc7('0x54')]('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x4fa651[_0x5fc7('0x35')]));if(!this['isConfigured'](_0x4fa651[_0x5fc7('0x166')])){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x4fa651,_0x5fc7('0x167'));}var _0x5dfee5='';var _0x3cc01c=parseInt(_0x4fa651['queue_id'],0xa);if(isNaN(_0x3cc01c)){_0x5dfee5=_0x4fa651['queue_id'];}else{_0x5dfee5=this[_0x5fc7('0x168')][_0x5fc7('0xa3')](this,_0x4fa651[_0x5fc7('0x166')]);if(!_0x5dfee5){return this[_0x5fc7('0xd')]['error'](_0x4fa651,_0x5fc7('0x169'));}}var _0x3e5969='';if(this[_0x5fc7('0x82')](_0x4fa651['file_id'])){var _0x2b8e75=this[_0x5fc7('0x10b')][_0x5fc7('0xa3')](this,_0x4fa651[_0x5fc7('0x10a')]);if(_0x2b8e75){_0x3e5969=_0x2b8e75;}}this[_0x5fc7('0x33')][_0x5fc7('0xa3')](this,_0x4fa651,_0x5dfee5);if(_0x4fa651[_0x5fc7('0x106')][_0x5fc7('0x16a')]('x')<0x0){_0x4fa651[_0x5fc7('0x106')]+='x';}if(_0x4fa651['opts'][_0x5fc7('0x16a')]('X')<0x0){_0x4fa651[_0x5fc7('0x106')]+='X';}this['channel'][_0x5fc7('0xa1')](_0x5fc7('0x16b'),_0x5dfee5?_0x5dfee5[_0x5fc7('0x16c')]():'');var _0x2d5aa7=this[_0x5fc7('0xd')]['exec'](_0x5fc7('0x16d'),[_0x5dfee5,_0x4fa651['opts'],_0x4fa651[_0x5fc7('0x62')],_0x3e5969,_0x4fa651[_0x5fc7('0x65')],_0x4fa651[_0x5fc7('0x6')],_0x4fa651[_0x5fc7('0x16e')],_0x4fa651[_0x5fc7('0x16f')],'',_0x4fa651[_0x5fc7('0x170')]]);if(_0x2d5aa7['result']===-0x1){return _0x2d5aa7;}return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0xc0'),'QUEUE',_0x5dfee5));};AGIVertices[_0x5fc7('0xf')]['record']=function(_0x3dbb05){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x171'),_0x3dbb05[_0x5fc7('0x35')]));var _0x103850=_0x3dbb05[_0x5fc7('0x172')]||_0x5fc7('0x126');var _0x5d00a3=util[_0x5fc7('0x54')]('%s_%s',this[_0x5fc7('0xd')][_0x5fc7('0x34')],rs[_0x5fc7('0x113')](0x5));var _0x1f3c90=util[_0x5fc7('0x54')]('%s/recordings/%s.%s',FILES_PATH,_0x5d00a3,_0x103850);var _0x48b6ba=util['format']('%s/recordings/%s',FILES_PATH,_0x5d00a3);this[_0x5fc7('0x37')][_0x5fc7('0xa3')](this,_0x3dbb05,_0x5d00a3,_0x1f3c90);this[_0x5fc7('0xd')]['setVariable'](_0x5fc7('0x173'),_0x5d00a3);logger['info'](_0x5fc7('0x174'),_0x48b6ba,_0x103850,_0x3dbb05['escape_digits'],_0x3dbb05[_0x5fc7('0x65')]);return this['channel'][_0x5fc7('0x129')](_0x48b6ba,_0x103850,_0x3dbb05[_0x5fc7('0x175')],_0x3dbb05[_0x5fc7('0x65')],undefined,!![]);};AGIVertices[_0x5fc7('0xf')]['restapi']=function(_0x3785ad){logger['info'](util[_0x5fc7('0x54')](_0x5fc7('0x176'),_0x3785ad[_0x5fc7('0x35')]));if(!this[_0x5fc7('0x82')](_0x3785ad[_0x5fc7('0x62')])){return this[_0x5fc7('0xd')]['noop'](_0x5fc7('0x177'));}var _0x8e26d5=this[_0x5fc7('0x178')][_0x5fc7('0xa3')](this,_0x3785ad);logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x179'),util[_0x5fc7('0x17a')](_0x8e26d5,{'showHidden':![],'depth':null})));if(!this[_0x5fc7('0x82')](_0x3785ad['variable_id'])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](_0x5fc7('0x17b'));}var _0x3d025f=this['getVariable']['sync'](this,_0x3785ad[_0x5fc7('0xd5')]);if(!_0x3d025f){return this[_0x5fc7('0xd')]['error'](_0x3785ad,'no\x20variable\x20found');}this['channel'][_0x5fc7('0xa1')](util['format'](_0x5fc7('0x17c'),_0x3d025f),_0x8e26d5[_0x5fc7('0x71')]?_0x8e26d5[_0x5fc7('0x71')]:_0x5fc7('0x17d'));this[_0x5fc7('0xd')][_0x5fc7('0xa1')](util[_0x5fc7('0x54')](_0x5fc7('0x17e'),_0x3d025f),_0x8e26d5['statusMessage']?_0x8e26d5[_0x5fc7('0x72')]:'OK');if(_0x8e26d5[_0x5fc7('0x67')]){try{this[_0x5fc7('0x9b')](_0x8e26d5[_0x5fc7('0x67')],_0x3d025f);}catch(_0x2a8309){logger['error'](util['format'](_0x5fc7('0x17f'),_0x3d025f));}}return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util['format'](_0x5fc7('0x180'),_0x3d025f));};AGIVertices['prototype'][_0x5fc7('0x181')]=function(_0x35b5b5){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')]('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x35b5b5[_0x5fc7('0x35')]));return this['channel'][_0x5fc7('0x182')](_0x35b5b5[_0x5fc7('0x183')][_0x5fc7('0xd3')](/\s+/g,''),_0x35b5b5[_0x5fc7('0x175')]);};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x184')]=function(_0x3820a0){logger['info'](util[_0x5fc7('0x54')](_0x5fc7('0x185'),_0x3820a0[_0x5fc7('0x35')]));return this[_0x5fc7('0xd')][_0x5fc7('0x186')](_0x3820a0[_0x5fc7('0x64')][_0x5fc7('0xd3')](/\s+/g,''),_0x3820a0[_0x5fc7('0x175')]);};AGIVertices[_0x5fc7('0xf')]['sayphonetic']=function(_0x4716b1){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x187'),_0x4716b1[_0x5fc7('0x35')]));return this[_0x5fc7('0xd')]['sayPhonetic'](_0x4716b1[_0x5fc7('0x5b')],_0x4716b1[_0x5fc7('0x175')]);};AGIVertices[_0x5fc7('0xf')]['sendMail']=function(_0x2c4908){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x188'),_0x2c4908[_0x5fc7('0x35')]));if(!this['isConfigured'](_0x2c4908[_0x5fc7('0x189')])){return this['channel'][_0x5fc7('0xa6')](_0x5fc7('0x18a'));}var _0x372007=this[_0x5fc7('0x21')][_0x5fc7('0xa3')](this,_0x2c4908[_0x5fc7('0x189')]);if(!_0x372007||!_0x372007['Smtp']){return this['channel'][_0x5fc7('0x2a')](_0x2c4908,_0x5fc7('0x18b'));}var _0x37751a={'from':util[_0x5fc7('0x54')](_0x5fc7('0x18c'),_0x372007[_0x5fc7('0x13')],_0x372007[_0x5fc7('0x18d')]||_0x372007[_0x5fc7('0x18e')][_0x5fc7('0x18f')]),'to':_0x2c4908['to']||'','cc':_0x2c4908['cc']||'','bcc':_0x2c4908[_0x5fc7('0x190')]||'','subject':_0x2c4908[_0x5fc7('0x191')],'html':_0x2c4908[_0x5fc7('0x5b')],'text':_0x2c4908[_0x5fc7('0x5b')]};if(this[_0x5fc7('0x82')](_0x2c4908[_0x5fc7('0x192')])){}logger[_0x5fc7('0x193')](_0x5fc7('0x194'),JSON[_0x5fc7('0x6f')](_0x37751a));this[_0x5fc7('0x33')][_0x5fc7('0xa3')](this,_0x2c4908,_0x2c4908['account_id']);this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util['format'](_0x5fc7('0x195'),_0x372007[_0x5fc7('0x13')]));this[_0x5fc7('0x23')]['sync'](this,_0x372007[_0x5fc7('0x196')],_0x37751a);return this[_0x5fc7('0xd')]['noop'](_0x5fc7('0x197'));};AGIVertices['prototype'][_0x5fc7('0x198')]=function(_0x26cffd){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x199'),_0x26cffd[_0x5fc7('0x35')]));return this[_0x5fc7('0xd')]['noop'](_0x5fc7('0x19a'));};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x19b')]=function(_0x7334e6){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x19c'),_0x7334e6['label']));if(!this['isConfigured'](_0x7334e6[_0x5fc7('0x19d')])){return this[_0x5fc7('0xd')]['noop'](_0x5fc7('0x19e'));}var _0x132b2b=this[_0x5fc7('0x30')][_0x5fc7('0xa3')](this,_0x7334e6[_0x5fc7('0x19d')]);if(!_0x132b2b){return this[_0x5fc7('0xd')]['error'](_0x7334e6,_0x5fc7('0x19f'));}var _0x3c77e1={'body':_0x7334e6['sms_text'],'phone':_0x7334e6['to']||'','SmsAccountId':_0x132b2b['id']};logger[_0x5fc7('0x193')](_0x5fc7('0x1a0'),JSON['stringify'](_0x3c77e1));this[_0x5fc7('0x33')][_0x5fc7('0xa3')](this,_0x7334e6,_0x7334e6[_0x5fc7('0x19d')]);this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util['format'](_0x5fc7('0x1a1'),_0x132b2b[_0x5fc7('0x13')]));this[_0x5fc7('0x32')][_0x5fc7('0xa3')](this,_0x3c77e1);return this['channel']['noop'](_0x5fc7('0x1a2'));};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x1a3')]=function(_0xf5bbfc){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x1a4'),_0xf5bbfc[_0x5fc7('0x35')]));if(!this[_0x5fc7('0x82')](_0xf5bbfc[_0x5fc7('0xd5')])){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0xf5bbfc,_0x5fc7('0x1a5'));}var _0x214096=this['getVariable']['sync'](this,_0xf5bbfc[_0x5fc7('0xd5')]);if(!_0x214096){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0xf5bbfc,_0x5fc7('0xd7'));}return this[_0x5fc7('0xd')]['setVariable'](_0x214096,_0xf5bbfc[_0x5fc7('0x1a6')]);};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x1a7')]=function(_0x37f789){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')]('Enter\x20in\x20START\x20(%s)\x20block',_0x37f789[_0x5fc7('0x35')]));this[_0x5fc7('0xd')][_0x5fc7('0xa6')](_0x5fc7('0x1a8'));if(_0x37f789[_0x5fc7('0xb3')]==='yes'){this[_0x5fc7('0xd')][_0x5fc7('0xa6')](_0x5fc7('0x1a9'));return this[_0x5fc7('0xd')][_0x5fc7('0xb3')]();}return this['channel']['noop'](_0x5fc7('0x1aa'));};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x1ab')]=function(_0x4adda9){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x1ac'),_0x4adda9['label']));if(!this['isConfigured'](_0x4adda9[_0x5fc7('0x1ad')])){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x4adda9,_0x5fc7('0x1ae'));}var _0x264a6a=this[_0x5fc7('0x17')]['sync'](this,_0x4adda9[_0x5fc7('0x1ad')]);if(!this[_0x5fc7('0x82')](_0x264a6a)){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x4adda9,util[_0x5fc7('0x54')](_0x5fc7('0x1af'),_0x4adda9[_0x5fc7('0x1ad')]));}if(_0x264a6a===this[_0x5fc7('0xd')][_0x5fc7('0x3d')]){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x4adda9,_0x5fc7('0x1b0'));}this[_0x5fc7('0x33')][_0x5fc7('0xa3')](this,_0x4adda9,_0x264a6a);var _0x27392a=this[_0x5fc7('0xd')][_0x5fc7('0x57')](_0x5fc7('0x1b1'),util['format'](_0x5fc7('0x1b2'),config[_0x5fc7('0x6')][_0x5fc7('0x1b3')]||_0x5fc7('0x1b4'),_0x264a6a,this[_0x5fc7('0xd')][_0x5fc7('0x3d')]));if(_0x27392a[_0x5fc7('0xa0')]===-0x1){return _0x27392a;}return this['channel']['noop'](util[_0x5fc7('0x54')]('Executed\x20command\x20%s\x20%s','AGI',_0x264a6a));};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x1b5')]=function(_0x5beacd){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x1b6'),_0x5beacd[_0x5fc7('0x35')]));var _0x139147=this['shellCommand']['sync'](this,_0x5beacd[_0x5fc7('0x1b7')]);this[_0x5fc7('0x33')][_0x5fc7('0xa3')](this,_0x5beacd,_0x5beacd[_0x5fc7('0x1b7')]);if(this[_0x5fc7('0x82')](_0x5beacd[_0x5fc7('0xd5')])){var _0x2ffaae=this['getVariable'][_0x5fc7('0xa3')](this,_0x5beacd[_0x5fc7('0xd5')]);if(_0x2ffaae){this['channel'][_0x5fc7('0xa1')](_0x2ffaae,_0x139147);return this['channel'][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0x1b8'),_0x5beacd[_0x5fc7('0x1b7')],_0x2ffaae));}}return this[_0x5fc7('0xd')]['noop'](util[_0x5fc7('0x54')](_0x5fc7('0x1b9'),_0x5beacd[_0x5fc7('0x1b7')]));};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x1ba')]=function(_0x495906){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x1bb'),_0x495906[_0x5fc7('0x35')]));_0x495906[_0x5fc7('0x5b')]=_0x495906[_0x5fc7('0x5b')][_0x5fc7('0xd3')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5fc7('0x82')](_0x495906[_0x5fc7('0x59')])){return this['channel'][_0x5fc7('0xa6')](_0x5fc7('0x1bc'));}if(!this[_0x5fc7('0x82')](_0x495906[_0x5fc7('0x5b')])){return this[_0x5fc7('0xd')][_0x5fc7('0xa6')](_0x5fc7('0xc3'));}this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util['format'](_0x5fc7('0x1bd'),_0x495906[_0x5fc7('0x5b')]));var _0x4848fe=this[_0x5fc7('0x58')][_0x5fc7('0xa3')](this,_0x495906);if(_0x4848fe){this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0x1be'),_0x4848fe));var _0x28c456=this['channel']['streamFile'](_0x4848fe);try{fs[_0x5fc7('0x11b')](_0x4848fe+_0x5fc7('0x1bf'));}catch(_0x1c6241){logger[_0x5fc7('0x2a')](_0x1c6241);}return _0x28c456;}return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x495906,_0x5fc7('0x1c0'));};AGIVertices[_0x5fc7('0xf')]['tts']=function(_0x1b074a){logger['info'](util[_0x5fc7('0x54')](_0x5fc7('0x1c1'),_0x1b074a[_0x5fc7('0x35')]));_0x1b074a['text']=_0x1b074a[_0x5fc7('0x5b')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x5fc7('0x82')](_0x1b074a[_0x5fc7('0x5b')])){return this['channel'][_0x5fc7('0xa6')](_0x5fc7('0xc3'));}this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util['format'](_0x5fc7('0x1c2'),_0x1b074a[_0x5fc7('0x5b')]));var _0x4f6d91=this[_0x5fc7('0x60')][_0x5fc7('0xa3')](this,_0x1b074a);if(_0x4f6d91){this[_0x5fc7('0xd')]['noop'](util[_0x5fc7('0x54')](_0x5fc7('0x1c3'),_0x4f6d91));var _0x1a6013=this[_0x5fc7('0xd')][_0x5fc7('0xfb')](_0x4f6d91);try{fs[_0x5fc7('0x11b')](_0x4f6d91+'.wav');}catch(_0x42927f){logger[_0x5fc7('0x2a')](_0x42927f);}return _0x1a6013;}return this[_0x5fc7('0xd')]['error'](_0x1b074a,_0x5fc7('0x1c4'));};AGIVertices['prototype']['unpause']=function(_0x3ea6ca){logger[_0x5fc7('0x2d')](util['format'](_0x5fc7('0x1c5'),_0x3ea6ca[_0x5fc7('0x35')]));if(!this['isConfigured'](_0x3ea6ca[_0x5fc7('0x14c')])){return this[_0x5fc7('0xd')]['error'](_0x3ea6ca,_0x5fc7('0x152'));}logger['info'](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x5fc7('0xd')][_0x5fc7('0x4e')],_0x3ea6ca[_0x5fc7('0x14c')]));var _0x15e31b=this[_0x5fc7('0x4f')][_0x5fc7('0xa3')](this,_0x3ea6ca[_0x5fc7('0x14c')]);if(_0x15e31b){logger[_0x5fc7('0x2d')](util['format'](_0x5fc7('0x14d'),this[_0x5fc7('0xd')][_0x5fc7('0x4e')],_0x3ea6ca[_0x5fc7('0x14c')]));this[_0x5fc7('0xd')][_0x5fc7('0xa6')](util[_0x5fc7('0x54')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x5fc7('0xd')][_0x5fc7('0x4e')],_0x3ea6ca[_0x5fc7('0x14c')]));return{'code':0xc8,'result':'success'};}else{logger[_0x5fc7('0x2d')](util['format'](_0x5fc7('0x14f'),this[_0x5fc7('0xd')][_0x5fc7('0x4e')],_0x3ea6ca[_0x5fc7('0x14c')]));this['channel'][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0x14f'),this[_0x5fc7('0xd')]['callerid'],_0x3ea6ca[_0x5fc7('0x14c')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x5fc7('0xf')][_0x5fc7('0x1c6')]=function(_0x126171){logger['info'](util[_0x5fc7('0x54')](_0x5fc7('0x1c7'),_0x126171[_0x5fc7('0x35')]));var _0x2b06a6=this[_0x5fc7('0xd')][_0x5fc7('0x57')](_0x5fc7('0x1c8'),[_0x126171[_0x5fc7('0x1c9')],_0x126171[_0x5fc7('0x75')]]);if(_0x2b06a6['result']===-0x1){return _0x2b06a6;}return this['channel'][_0x5fc7('0xa6')](util[_0x5fc7('0x54')](_0x5fc7('0xc0'),_0x5fc7('0x1c8'),_0x126171[_0x5fc7('0x1c9')]));};AGIVertices['prototype']['vswitch']=function(_0x116758){logger[_0x5fc7('0x2d')](util[_0x5fc7('0x54')](_0x5fc7('0x1ca'),_0x116758['label']));if(!this[_0x5fc7('0x82')](_0x116758[_0x5fc7('0xd5')])){return this[_0x5fc7('0xd')][_0x5fc7('0x2a')](_0x116758,_0x5fc7('0x1a5'));}var _0x507e6d=this['getVariable'][_0x5fc7('0xa3')](this,_0x116758[_0x5fc7('0xd5')]);if(!_0x507e6d){return this['channel']['error'](_0x116758,_0x5fc7('0xd7'));}var _0x315f51=this[_0x5fc7('0xd')][_0x5fc7('0x10')](_0x507e6d);return{'code':0xc8,'result':_0x315f51['extra']?_0x315f51[_0x5fc7('0x9f')]:'-'};};String[_0x5fc7('0xf')][_0x5fc7('0x1cb')]=function(_0x40ada0,_0x5ab1e2){return this[_0x5fc7('0x9e')](_0x40ada0)[_0x5fc7('0x1cc')](_0x5ab1e2);};module[_0x5fc7('0x1cd')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 3742dae..1626fb4 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 _0xbf77=['transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','hanguprequest','bind','syncHangup','agentringnoanswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','startAcw','channels','interface','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','acwTimeout','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','message','prototype','stopAcw','queue','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','linkedid','attended','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil'];(function(_0x5c595c,_0x113c41){var _0x122cb6=function(_0x4acb44){while(--_0x4acb44){_0x5c595c['push'](_0x5c595c['shift']());}};_0x122cb6(++_0x113c41);}(_0xbf77,0x10a));var _0x7bf7=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xbf77[_0x46698a];return _0x356db0;};'use strict';var _=require('lodash');var moment=require('moment');var ami=require(_0x7bf7('0x0'));var logger=require(_0x7bf7('0x1'))(_0x7bf7('0x2'));var RpcUser=require(_0x7bf7('0x3'));var RpcVoiceAgentReport=require(_0x7bf7('0x4'));function Acw(_0x110fe2){this[_0x7bf7('0x5')]=_0x110fe2['voiceQueues'];this['agents']=_0x110fe2[_0x7bf7('0x6')];this['timers']=_0x110fe2[_0x7bf7('0x7')];this['channels']={};ami['on'](_0x7bf7('0x8'),this[_0x7bf7('0x9')]['bind'](this));ami['on'](_0x7bf7('0xa'),this['syncHangupRequest'][_0x7bf7('0xb')](this));ami['on']('hangup',this[_0x7bf7('0xc')][_0x7bf7('0xb')](this));ami['on'](_0x7bf7('0xd'),this['syncAgentRingNoAnswer'][_0x7bf7('0xb')](this));ami['on'](_0x7bf7('0xe'),this['syncAttendedTransfer'][_0x7bf7('0xb')](this));ami['on'](_0x7bf7('0xf'),this[_0x7bf7('0x10')][_0x7bf7('0xb')](this));ami['on'](_0x7bf7('0x11'),this['syncAgentConnectPreview'][_0x7bf7('0xb')](this));}function getDiff(_0x5a2ba3){var _0x41e8de=moment()['milliseconds'](0x0);var _0x563b51=moment(_0x5a2ba3)[_0x7bf7('0x12')](0x0);return _0x41e8de[_0x7bf7('0x13')](_0x563b51,_0x7bf7('0x14'));}Acw['prototype'][_0x7bf7('0x15')]=function(_0x5e23f2){try{var _0x3db4ed=this;var _0x34b58f=this[_0x7bf7('0x16')][_0x5e23f2][_0x7bf7('0x17')];var _0x326e50=this[_0x7bf7('0x16')][_0x5e23f2]['queue'];var _0x72a943=this['voiceQueues'][_0x326e50];var _0xd8e139=![];var _0x22d225=_0x7bf7('0x18');if(_0x72a943[_0x7bf7('0x19')]){if(_0x72a943['mandatoryDispositionPause'][_0x7bf7('0x1a')]){_0xd8e139=!![];_0x22d225=_0x72a943[_0x7bf7('0x1b')][_0x7bf7('0x1a')];}}return ami[_0x7bf7('0x1c')]({'action':_0x7bf7('0x1d'),'interface':_0x34b58f,'paused':!![],'reason':_0x22d225})[_0x7bf7('0x1e')](function(){if(_0x3db4ed[_0x7bf7('0x6')][_0x34b58f]){return RpcUser[_0x7bf7('0x1f')](_0x3db4ed[_0x7bf7('0x6')][_0x34b58f]['id'])[_0x7bf7('0x1e')](function(_0x54dac7){if(_0x54dac7&&!_0x54dac7[_0x7bf7('0x20')]){logger[_0x7bf7('0x21')](_0x7bf7('0x22'),_0x5e23f2,_0x34b58f,_0x326e50);var _0x576352=_0x3db4ed[_0x7bf7('0x16')][_0x5e23f2]['attended']&&_0x3db4ed[_0x7bf7('0x16')][_0x5e23f2][_0x7bf7('0x23')]?_0x3db4ed[_0x7bf7('0x16')][_0x5e23f2][_0x7bf7('0x23')]:_0x5e23f2;return RpcUser['savePause'](_0x3db4ed[_0x7bf7('0x6')][_0x34b58f],_0x22d225,_0x576352)[_0x7bf7('0x1e')](function(){if(!_0xd8e139){_0x3db4ed['timers'][_0x34b58f]={};logger[_0x7bf7('0x21')](_0x7bf7('0x24'),_0x5e23f2,_0x3db4ed[_0x7bf7('0x5')][_0x326e50]['acwTimeout'],_0x34b58f,_0x326e50);_0x3db4ed[_0x7bf7('0x7')][_0x34b58f][_0x7bf7('0x25')]=setTimeout(_0x3db4ed['stopAcw']['bind'](_0x3db4ed,_0x34b58f),_0x3db4ed[_0x7bf7('0x5')][_0x326e50][_0x7bf7('0x26')]*0x3e8);_0x3db4ed[_0x7bf7('0x7')][_0x34b58f][_0x7bf7('0x27')]=moment()['format'](_0x7bf7('0x28'));_0x3db4ed['timers'][_0x34b58f][_0x7bf7('0x29')]=_0x5e23f2;_0x3db4ed['timers'][_0x34b58f]['queue']=_0x326e50;_0x3db4ed['timers'][_0x34b58f][_0x7bf7('0x2a')]=function(){var _0x307586=getDiff(_0x3db4ed[_0x7bf7('0x7')][_0x34b58f][_0x7bf7('0x27')]);clearTimeout(_0x3db4ed[_0x7bf7('0x7')][_0x34b58f][_0x7bf7('0x25')]);_0x3db4ed[_0x7bf7('0x7')][_0x34b58f][_0x7bf7('0x25')]=![];RpcVoiceAgentReport[_0x7bf7('0x2b')]({'acwtime':_0x307586},_0x3db4ed['timers'][_0x34b58f][_0x7bf7('0x29')],_0x34b58f)['then'](function(_0x137a3a){logger[_0x7bf7('0x21')]('[%s][UPDATE][ACWTIME:%s]',_0x5e23f2,_0x307586,_0x137a3a);})['catch'](function(_0x30de67){logger[_0x7bf7('0x2c')](_0x7bf7('0x2d'),_0x5e23f2,_0x30de67);});delete _0x3db4ed[_0x7bf7('0x7')][_0x34b58f];};}});}else{logger[_0x7bf7('0x21')](_0x7bf7('0x2e'),_0x5e23f2,_0x34b58f,_0x326e50);}});}})[_0x7bf7('0x2f')](function(){logger['error'](_0x7bf7('0x24'),_0x5e23f2,_0x3db4ed['voiceQueues'][_0x326e50][_0x7bf7('0x26')],_0x34b58f,_0x326e50);})[_0x7bf7('0x30')](function(){delete _0x3db4ed[_0x7bf7('0x16')][_0x5e23f2];});}catch(_0x33ae4c){logger['error'](_0x7bf7('0x31'),_0x33ae4c[_0x7bf7('0x32')]);}};Acw[_0x7bf7('0x33')][_0x7bf7('0x34')]=function(_0x3c41c3){try{var _0x4f1bc7=this;if(_0x4f1bc7[_0x7bf7('0x7')][_0x3c41c3]){_0x4f1bc7['timers'][_0x3c41c3][_0x7bf7('0x25')]=![];var _0xd644c4=_0x4f1bc7[_0x7bf7('0x7')][_0x3c41c3]['uniqueid'];var _0x498fdd=_0x4f1bc7['timers'][_0x3c41c3][_0x7bf7('0x35')];var _0x25671f=_0x4f1bc7[_0x7bf7('0x5')][_0x498fdd][_0x7bf7('0x26')];logger[_0x7bf7('0x21')](_0x7bf7('0x36'),_0xd644c4,_0x3c41c3);RpcUser[_0x7bf7('0x37')](this['agents'][_0x3c41c3]);RpcVoiceAgentReport[_0x7bf7('0x2b')]({'acwtime':_0x25671f,'agentacw':!![]},_0xd644c4,_0x3c41c3)[_0x7bf7('0x1e')](function(_0x444592){logger['info'](_0x7bf7('0x38'),_0xd644c4,_0x25671f,_0x444592);})[_0x7bf7('0x2f')](function(_0x5e1430){logger[_0x7bf7('0x2c')]('[%s][UPDATE][ERRORS:%s]',_0xd644c4,_0x5e1430);});}else{logger[_0x7bf7('0x2c')](_0x7bf7('0x39'),_0x3c41c3);if(_0x4f1bc7[_0x7bf7('0x7')]){logger[_0x7bf7('0x21')](_0x7bf7('0x3a'),JSON[_0x7bf7('0x3b')](_0x4f1bc7[_0x7bf7('0x7')]));}}}catch(_0x3c2870){logger[_0x7bf7('0x2c')]('[ACW][STOP]\x20%s',_0x3c2870[_0x7bf7('0x32')]);}};Acw[_0x7bf7('0x33')]['syncAgentConnect']=function(_0x133dc6){try{if(this[_0x7bf7('0x5')][_0x133dc6[_0x7bf7('0x35')]]&&(this['voiceQueues'][_0x133dc6['queue']][_0x7bf7('0x2')]||this[_0x7bf7('0x5')][_0x133dc6['queue']][_0x7bf7('0x19')])){if(this[_0x7bf7('0x6')][_0x133dc6['interface']]){this[_0x7bf7('0x16')][_0x133dc6[_0x7bf7('0x29')]]={'queue':_0x133dc6[_0x7bf7('0x35')],'interface':_0x133dc6[_0x7bf7('0x17')],'destlinkedid':_0x133dc6['destlinkedid']};}}}catch(_0x9ae252){logger[_0x7bf7('0x2c')](_0x7bf7('0x3c'),_0x9ae252['message']);}};Acw[_0x7bf7('0x33')][_0x7bf7('0x3d')]=function(_0x587b9a){try{if(this['voiceQueues'][_0x587b9a[_0x7bf7('0x35')]]&&(this[_0x7bf7('0x5')][_0x587b9a[_0x7bf7('0x35')]][_0x7bf7('0x2')]||this[_0x7bf7('0x5')][_0x587b9a[_0x7bf7('0x35')]]['mandatoryDisposition'])){if(this[_0x7bf7('0x6')][_0x587b9a[_0x7bf7('0x17')]]){this[_0x7bf7('0x16')][_0x587b9a[_0x7bf7('0x29')]]={'queue':_0x587b9a[_0x7bf7('0x35')],'interface':_0x587b9a[_0x7bf7('0x17')]};}}}catch(_0xc65452){logger['error'](_0x7bf7('0x3e'),_0xc65452[_0x7bf7('0x32')]);}};Acw['prototype']['syncHangupRequest']=function(_0x50d614){try{if(this[_0x7bf7('0x16')][_0x50d614[_0x7bf7('0x29')]]&&_['isUndefined'](this['channels'][_0x50d614[_0x7bf7('0x29')]]['attended'])){logger[_0x7bf7('0x21')]('[%s][HANGUP:UNIQUEID]',_0x50d614[_0x7bf7('0x29')]);this[_0x7bf7('0x15')](_0x50d614[_0x7bf7('0x29')]);}else if(this[_0x7bf7('0x16')][_0x50d614[_0x7bf7('0x3f')]]&&_['isUndefined'](this['channels'][_0x50d614[_0x7bf7('0x3f')]][_0x7bf7('0x40')])){logger[_0x7bf7('0x21')](_0x7bf7('0x41'),_0x50d614[_0x7bf7('0x3f')]);this['startAcw'](_0x50d614[_0x7bf7('0x3f')]);}}catch(_0x4bd836){logger[_0x7bf7('0x2c')](_0x7bf7('0x42'),_0x4bd836['message']);}};Acw[_0x7bf7('0x33')][_0x7bf7('0xc')]=function(_0x19869a){try{if(this[_0x7bf7('0x16')][_0x19869a[_0x7bf7('0x29')]]&&this[_0x7bf7('0x16')][_0x19869a[_0x7bf7('0x29')]][_0x7bf7('0x40')]){logger[_0x7bf7('0x21')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x19869a[_0x7bf7('0x29')]);this[_0x7bf7('0x15')](_0x19869a[_0x7bf7('0x29')]);}else if(this['channels'][_0x19869a[_0x7bf7('0x3f')]]&&this['channels'][_0x19869a[_0x7bf7('0x3f')]][_0x7bf7('0x40')]){logger[_0x7bf7('0x21')](_0x7bf7('0x43'),_0x19869a[_0x7bf7('0x3f')]);this['startAcw'](_0x19869a[_0x7bf7('0x3f')]);}}catch(_0x3f4b8d){logger[_0x7bf7('0x2c')](_0x7bf7('0x44'),_0x3f4b8d[_0x7bf7('0x32')]);}};Acw[_0x7bf7('0x33')]['syncAttendedTransfer']=function(_0x278a6b){try{if(!_[_0x7bf7('0x45')](this[_0x7bf7('0x16')][_0x278a6b[_0x7bf7('0x46')]])){this[_0x7bf7('0x15')](_0x278a6b[_0x7bf7('0x46')]);if(this[_0x7bf7('0x16')][_0x278a6b['secondtransfereruniqueid']]){this[_0x7bf7('0x16')][_0x278a6b['secondtransfereruniqueid']][_0x7bf7('0x40')]=!![];this[_0x7bf7('0x16')][_0x278a6b['transfertargetuniqueid']]=this[_0x7bf7('0x16')][_0x278a6b[_0x7bf7('0x47')]];delete this[_0x7bf7('0x16')][_0x278a6b['secondtransfereruniqueid']];}}else if(!_['isNil'](this['channels'][_0x278a6b[_0x7bf7('0x48')]])){this[_0x7bf7('0x15')](_0x278a6b[_0x7bf7('0x48')]);if(this[_0x7bf7('0x16')][_0x278a6b['origtransfereruniqueid']]){this[_0x7bf7('0x16')][_0x278a6b[_0x7bf7('0x49')]]['attended']=!![];this[_0x7bf7('0x16')][_0x278a6b[_0x7bf7('0x46')]]=this[_0x7bf7('0x16')][_0x278a6b['origtransfereruniqueid']];delete this['channels'][_0x278a6b['origtransfereruniqueid']];}}}catch(_0x335d24){logger[_0x7bf7('0x2c')](_0x7bf7('0x4a'),_0x335d24[_0x7bf7('0x32')]);}};Acw[_0x7bf7('0x33')][_0x7bf7('0x10')]=function(_0x3a169d){try{if(this[_0x7bf7('0x16')][_0x3a169d[_0x7bf7('0x4b')]]){logger['info'](_0x7bf7('0x4c'),JSON[_0x7bf7('0x3b')](_0x3a169d[_0x7bf7('0x4b')]));this[_0x7bf7('0x15')](_0x3a169d[_0x7bf7('0x4b')]);}else if(this[_0x7bf7('0x16')][_0x3a169d[_0x7bf7('0x4d')]]){logger[_0x7bf7('0x21')](_0x7bf7('0x4e'),JSON['stringify'](_0x3a169d[_0x7bf7('0x4d')]));this['startAcw'](_0x3a169d[_0x7bf7('0x4d')]);}}catch(_0x53c182){logger['error'](_0x7bf7('0x4f'),_0x53c182[_0x7bf7('0x32')]);}};Acw['prototype'][_0x7bf7('0x50')]=function(_0xe2abd0){try{if(this['voiceQueues'][_0xe2abd0[_0x7bf7('0x35')]]&&this['voiceQueues'][_0xe2abd0[_0x7bf7('0x35')]][_0x7bf7('0x51')]==='all'){if(this[_0x7bf7('0x6')][_0xe2abd0[_0x7bf7('0x17')]]){logger[_0x7bf7('0x21')](_0x7bf7('0x52'),_0xe2abd0[_0x7bf7('0x29')],_0xe2abd0[_0x7bf7('0x17')],_0xe2abd0[_0x7bf7('0x35')]);return RpcUser['savePause'](this['agents'][_0xe2abd0[_0x7bf7('0x17')]],_0x7bf7('0x53'),_0xe2abd0[_0x7bf7('0x29')]);}}}catch(_0x2b75cb){logger[_0x7bf7('0x2c')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x2b75cb[_0x7bf7('0x32')]);}};module['exports']=Acw; \ No newline at end of file +var _0x3fe9=['voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','prototype','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','acw','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','moment','../ami','../../../config/logger','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','interface','queue','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','then','getAgent'];(function(_0x4d843f,_0x4a4401){var _0x58a99e=function(_0x7c4b86){while(--_0x7c4b86){_0x4d843f['push'](_0x4d843f['shift']());}};_0x58a99e(++_0x4a4401);}(_0x3fe9,0xe6));var _0x93fe=function(_0x40a28a,_0x411bd2){_0x40a28a=_0x40a28a-0x0;var _0x116883=_0x3fe9[_0x40a28a];return _0x116883;};'use strict';var _=require('lodash');var moment=require(_0x93fe('0x0'));var ami=require(_0x93fe('0x1'));var logger=require(_0x93fe('0x2'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x93fe('0x3'));function Acw(_0x30fd2c){this[_0x93fe('0x4')]=_0x30fd2c[_0x93fe('0x4')];this[_0x93fe('0x5')]=_0x30fd2c['agents'];this[_0x93fe('0x6')]=_0x30fd2c[_0x93fe('0x6')];this[_0x93fe('0x7')]={};ami['on'](_0x93fe('0x8'),this[_0x93fe('0x9')][_0x93fe('0xa')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x93fe('0xa')](this));ami['on'](_0x93fe('0xb'),this[_0x93fe('0xc')][_0x93fe('0xa')](this));ami['on'](_0x93fe('0xd'),this[_0x93fe('0xe')][_0x93fe('0xa')](this));ami['on'](_0x93fe('0xf'),this[_0x93fe('0x10')][_0x93fe('0xa')](this));ami['on'](_0x93fe('0x11'),this[_0x93fe('0x12')]['bind'](this));ami['on'](_0x93fe('0x13'),this[_0x93fe('0x14')][_0x93fe('0xa')](this));}function getDiff(_0x1dbffa){var _0x47d4dc=moment()['milliseconds'](0x0);var _0x47657c=moment(_0x1dbffa)[_0x93fe('0x15')](0x0);return _0x47d4dc[_0x93fe('0x16')](_0x47657c,_0x93fe('0x17'));}Acw['prototype']['startAcw']=function(_0x17fa13){try{var _0x33b23f=this;var _0x5b873e=this[_0x93fe('0x7')][_0x17fa13][_0x93fe('0x18')];var _0x4e702e=this[_0x93fe('0x7')][_0x17fa13][_0x93fe('0x19')];var _0x225486=this['voiceQueues'][_0x4e702e];var _0x1bc86e=![];var _0x4ef137=_0x93fe('0x1a');if(_0x225486[_0x93fe('0x1b')]){if(_0x225486['mandatoryDispositionPause'][_0x93fe('0x1c')]){_0x1bc86e=!![];_0x4ef137=_0x225486[_0x93fe('0x1d')][_0x93fe('0x1c')];}}return ami[_0x93fe('0x1e')]({'action':_0x93fe('0x1f'),'interface':_0x5b873e,'paused':!![],'reason':_0x4ef137})[_0x93fe('0x20')](function(){if(_0x33b23f[_0x93fe('0x5')][_0x5b873e]){return RpcUser[_0x93fe('0x21')](_0x33b23f[_0x93fe('0x5')][_0x5b873e]['id'])['then'](function(_0x44f8c3){if(_0x44f8c3&&!_0x44f8c3[_0x93fe('0x22')]){logger['info'](_0x93fe('0x23'),_0x17fa13,_0x5b873e,_0x4e702e);var _0x11bf0a=_0x33b23f[_0x93fe('0x7')][_0x17fa13][_0x93fe('0x24')]&&_0x33b23f[_0x93fe('0x7')][_0x17fa13][_0x93fe('0x25')]?_0x33b23f[_0x93fe('0x7')][_0x17fa13][_0x93fe('0x25')]:_0x17fa13;return RpcUser[_0x93fe('0x26')](_0x33b23f[_0x93fe('0x5')][_0x5b873e],_0x4ef137,_0x11bf0a)[_0x93fe('0x20')](function(){if(!_0x1bc86e){_0x33b23f['timers'][_0x5b873e]={};logger[_0x93fe('0x27')](_0x93fe('0x28'),_0x17fa13,_0x33b23f['voiceQueues'][_0x4e702e][_0x93fe('0x29')],_0x5b873e,_0x4e702e);_0x33b23f[_0x93fe('0x6')][_0x5b873e][_0x93fe('0x2a')]=setTimeout(_0x33b23f[_0x93fe('0x2b')][_0x93fe('0xa')](_0x33b23f,_0x5b873e),_0x33b23f['voiceQueues'][_0x4e702e]['acwTimeout']*0x3e8);_0x33b23f[_0x93fe('0x6')][_0x5b873e][_0x93fe('0x2c')]=moment()[_0x93fe('0x2d')](_0x93fe('0x2e'));_0x33b23f[_0x93fe('0x6')][_0x5b873e][_0x93fe('0x2f')]=_0x17fa13;_0x33b23f[_0x93fe('0x6')][_0x5b873e][_0x93fe('0x19')]=_0x4e702e;_0x33b23f[_0x93fe('0x6')][_0x5b873e][_0x93fe('0x30')]=function(){var _0x1d5853=getDiff(_0x33b23f[_0x93fe('0x6')][_0x5b873e][_0x93fe('0x2c')]);clearTimeout(_0x33b23f[_0x93fe('0x6')][_0x5b873e][_0x93fe('0x2a')]);_0x33b23f[_0x93fe('0x6')][_0x5b873e][_0x93fe('0x2a')]=![];RpcVoiceAgentReport[_0x93fe('0x31')]({'acwtime':_0x1d5853},_0x33b23f[_0x93fe('0x6')][_0x5b873e]['uniqueid'],_0x5b873e)[_0x93fe('0x20')](function(_0x504df4){logger[_0x93fe('0x27')](_0x93fe('0x32'),_0x17fa13,_0x1d5853,_0x504df4);})[_0x93fe('0x33')](function(_0x227859){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x17fa13,_0x227859);});delete _0x33b23f[_0x93fe('0x6')][_0x5b873e];};}});}else{logger[_0x93fe('0x27')](_0x93fe('0x34'),_0x17fa13,_0x5b873e,_0x4e702e);}});}})[_0x93fe('0x33')](function(){logger[_0x93fe('0x35')](_0x93fe('0x28'),_0x17fa13,_0x33b23f[_0x93fe('0x4')][_0x4e702e][_0x93fe('0x29')],_0x5b873e,_0x4e702e);})[_0x93fe('0x36')](function(){delete _0x33b23f[_0x93fe('0x7')][_0x17fa13];});}catch(_0x52ae7){logger[_0x93fe('0x35')](_0x93fe('0x37'),_0x52ae7[_0x93fe('0x38')]);}};Acw[_0x93fe('0x39')][_0x93fe('0x2b')]=function(_0x410d46){try{var _0x2d54dd=this;if(_0x2d54dd['timers'][_0x410d46]){_0x2d54dd[_0x93fe('0x6')][_0x410d46][_0x93fe('0x2a')]=![];var _0x18c7ff=_0x2d54dd[_0x93fe('0x6')][_0x410d46]['uniqueid'];var _0x3b2915=_0x2d54dd[_0x93fe('0x6')][_0x410d46]['queue'];var _0x211ce5=_0x2d54dd[_0x93fe('0x4')][_0x3b2915]['acwTimeout'];logger[_0x93fe('0x27')]('[%s][TIMER][STOP][AGENT:%s]',_0x18c7ff,_0x410d46);RpcUser[_0x93fe('0x3a')](this[_0x93fe('0x5')][_0x410d46]);RpcVoiceAgentReport['update']({'acwtime':_0x211ce5,'agentacw':!![]},_0x18c7ff,_0x410d46)[_0x93fe('0x20')](function(_0x397cdb){logger[_0x93fe('0x27')]('[%s][UPDATE][ACWTIME:%s]',_0x18c7ff,_0x211ce5,_0x397cdb);})['catch'](function(_0x77a95c){logger[_0x93fe('0x35')]('[%s][UPDATE][ERRORS:%s]',_0x18c7ff,_0x77a95c);});}else{logger[_0x93fe('0x35')](_0x93fe('0x3b'),_0x410d46);if(_0x2d54dd[_0x93fe('0x6')]){logger[_0x93fe('0x27')](_0x93fe('0x3c'),JSON[_0x93fe('0x3d')](_0x2d54dd['timers']));}}}catch(_0x377cf6){logger[_0x93fe('0x35')](_0x93fe('0x3e'),_0x377cf6['message']);}};Acw[_0x93fe('0x39')][_0x93fe('0x9')]=function(_0x192bc1){try{if(this[_0x93fe('0x4')][_0x192bc1[_0x93fe('0x19')]]&&(this[_0x93fe('0x4')][_0x192bc1[_0x93fe('0x19')]]['acw']||this['voiceQueues'][_0x192bc1[_0x93fe('0x19')]]['mandatoryDisposition'])){if(this['agents'][_0x192bc1[_0x93fe('0x18')]]){this[_0x93fe('0x7')][_0x192bc1[_0x93fe('0x2f')]]={'queue':_0x192bc1['queue'],'interface':_0x192bc1[_0x93fe('0x18')],'destlinkedid':_0x192bc1[_0x93fe('0x25')]};}}}catch(_0x4e3091){logger[_0x93fe('0x35')]('[ACW][syncAgentConnect]\x20%s',_0x4e3091[_0x93fe('0x38')]);}};Acw[_0x93fe('0x39')][_0x93fe('0x14')]=function(_0x2d6f28){try{if(this[_0x93fe('0x4')][_0x2d6f28[_0x93fe('0x19')]]&&(this[_0x93fe('0x4')][_0x2d6f28[_0x93fe('0x19')]][_0x93fe('0x3f')]||this[_0x93fe('0x4')][_0x2d6f28[_0x93fe('0x19')]][_0x93fe('0x1b')])){if(this[_0x93fe('0x5')][_0x2d6f28[_0x93fe('0x18')]]){this[_0x93fe('0x7')][_0x2d6f28[_0x93fe('0x2f')]]={'queue':_0x2d6f28[_0x93fe('0x19')],'interface':_0x2d6f28[_0x93fe('0x18')]};}}}catch(_0x4eba0b){logger[_0x93fe('0x35')]('[ACW][syncAgentConnectPreview]\x20%s',_0x4eba0b[_0x93fe('0x38')]);}};Acw[_0x93fe('0x39')][_0x93fe('0x40')]=function(_0x3db024){try{if(this[_0x93fe('0x7')][_0x3db024[_0x93fe('0x2f')]]&&_[_0x93fe('0x41')](this[_0x93fe('0x7')][_0x3db024[_0x93fe('0x2f')]][_0x93fe('0x24')])){logger[_0x93fe('0x27')](_0x93fe('0x42'),_0x3db024[_0x93fe('0x2f')]);this[_0x93fe('0x43')](_0x3db024[_0x93fe('0x2f')]);}else if(this[_0x93fe('0x7')][_0x3db024[_0x93fe('0x44')]]&&_[_0x93fe('0x41')](this[_0x93fe('0x7')][_0x3db024['linkedid']][_0x93fe('0x24')])){logger[_0x93fe('0x27')](_0x93fe('0x45'),_0x3db024[_0x93fe('0x44')]);this[_0x93fe('0x43')](_0x3db024['linkedid']);}}catch(_0x5be9f8){logger[_0x93fe('0x35')](_0x93fe('0x46'),_0x5be9f8[_0x93fe('0x38')]);}};Acw[_0x93fe('0x39')][_0x93fe('0xc')]=function(_0x16ac9e){try{if(this['channels'][_0x16ac9e[_0x93fe('0x2f')]]&&this['channels'][_0x16ac9e['uniqueid']]['attended']){logger[_0x93fe('0x27')](_0x93fe('0x47'),_0x16ac9e[_0x93fe('0x2f')]);this[_0x93fe('0x43')](_0x16ac9e[_0x93fe('0x2f')]);}else if(this[_0x93fe('0x7')][_0x16ac9e[_0x93fe('0x44')]]&&this['channels'][_0x16ac9e[_0x93fe('0x44')]][_0x93fe('0x24')]){logger['info'](_0x93fe('0x48'),_0x16ac9e['linkedid']);this[_0x93fe('0x43')](_0x16ac9e[_0x93fe('0x44')]);}}catch(_0x3248ca){logger[_0x93fe('0x35')](_0x93fe('0x49'),_0x3248ca[_0x93fe('0x38')]);}};Acw[_0x93fe('0x39')][_0x93fe('0x10')]=function(_0x5d8df5){try{if(!_['isNil'](this[_0x93fe('0x7')][_0x5d8df5[_0x93fe('0x4a')]])){this[_0x93fe('0x43')](_0x5d8df5[_0x93fe('0x4a')]);if(this['channels'][_0x5d8df5['secondtransfereruniqueid']]){this[_0x93fe('0x7')][_0x5d8df5['secondtransfereruniqueid']][_0x93fe('0x24')]=!![];this['channels'][_0x5d8df5['transfertargetuniqueid']]=this[_0x93fe('0x7')][_0x5d8df5[_0x93fe('0x4b')]];delete this['channels'][_0x5d8df5[_0x93fe('0x4b')]];}}else if(!_['isNil'](this[_0x93fe('0x7')][_0x5d8df5[_0x93fe('0x4c')]])){this[_0x93fe('0x43')](_0x5d8df5[_0x93fe('0x4c')]);if(this['channels'][_0x5d8df5[_0x93fe('0x4d')]]){this[_0x93fe('0x7')][_0x5d8df5[_0x93fe('0x4d')]]['attended']=!![];this[_0x93fe('0x7')][_0x5d8df5[_0x93fe('0x4a')]]=this[_0x93fe('0x7')][_0x5d8df5[_0x93fe('0x4d')]];delete this[_0x93fe('0x7')][_0x5d8df5[_0x93fe('0x4d')]];}}}catch(_0xa14d7f){logger[_0x93fe('0x35')](_0x93fe('0x4e'),_0xa14d7f['message']);}};Acw[_0x93fe('0x39')]['syncBlindTransfer']=function(_0x1c0eb3){try{if(this[_0x93fe('0x7')][_0x1c0eb3['transfereruniqueid']]){logger['info'](_0x93fe('0x4f'),JSON['stringify'](_0x1c0eb3[_0x93fe('0x50')]));this['startAcw'](_0x1c0eb3[_0x93fe('0x50')]);}else if(this[_0x93fe('0x7')][_0x1c0eb3['transfererlinkedid']]){logger['info'](_0x93fe('0x51'),JSON[_0x93fe('0x3d')](_0x1c0eb3[_0x93fe('0x52')]));this['startAcw'](_0x1c0eb3['transfererlinkedid']);}}catch(_0x1d0cd9){logger[_0x93fe('0x35')](_0x93fe('0x53'),_0x1d0cd9[_0x93fe('0x38')]);}};Acw[_0x93fe('0x39')][_0x93fe('0xe')]=function(_0x5a2112){try{if(this[_0x93fe('0x4')][_0x5a2112[_0x93fe('0x19')]]&&this[_0x93fe('0x4')][_0x5a2112[_0x93fe('0x19')]][_0x93fe('0x54')]===_0x93fe('0x55')){if(this[_0x93fe('0x5')][_0x5a2112[_0x93fe('0x18')]]){logger['info'](_0x93fe('0x56'),_0x5a2112['uniqueid'],_0x5a2112['interface'],_0x5a2112[_0x93fe('0x19')]);return RpcUser['savePause'](this[_0x93fe('0x5')][_0x5a2112['interface']],'Auto-Pause',_0x5a2112[_0x93fe('0x2f')]);}}}catch(_0x39d4eb){logger[_0x93fe('0x35')](_0x93fe('0x57'),_0x39d4eb['message']);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 63d3f84..655d643 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 _0xf6f4=['queuesummary','actionCoreShowChannels','once','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','info','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','catch','[ami.js][fullybooted]','asterisk-manager','bluebird','util','../../config/logger','ami','asterisk','port','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus'];(function(_0x5b7645,_0x1708e1){var _0xd47880=function(_0x479fd0){while(--_0x479fd0){_0x5b7645['push'](_0x5b7645['shift']());}};_0xd47880(++_0x1708e1);}(_0xf6f4,0x1c6));var _0x4f6f=function(_0x6f27e1,_0x883a63){_0x6f27e1=_0x6f27e1-0x0;var _0x110267=_0xf6f4[_0x6f27e1];return _0x110267;};'use strict';var Manager=require(_0x4f6f('0x0'));var BPromise=require(_0x4f6f('0x1'));var util=require(_0x4f6f('0x2'));var logger=require(_0x4f6f('0x3'))(_0x4f6f('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x4f6f('0x5')][_0x4f6f('0x6')],config[_0x4f6f('0x5')]['ip'],config[_0x4f6f('0x5')]['username'],config[_0x4f6f('0x5')]['password'],!![]);ami['keepConnected']();ami[_0x4f6f('0x7')]=BPromise[_0x4f6f('0x8')](ami[_0x4f6f('0x9')]);function error(_0x19bac8){logger[_0x4f6f('0xa')](util[_0x4f6f('0xb')](_0x4f6f('0xc'),config[_0x4f6f('0x5')][_0x4f6f('0xd')],config[_0x4f6f('0x5')]['ip'],config[_0x4f6f('0x5')][_0x4f6f('0x6')],util[_0x4f6f('0xe')](_0x19bac8,![],null)));}function close(){logger[_0x4f6f('0xa')](util['format'](_0x4f6f('0xf'),config[_0x4f6f('0x5')][_0x4f6f('0xd')],config['asterisk']['ip'],config['asterisk'][_0x4f6f('0x6')]));}ami[_0x4f6f('0x10')]=function(){return function(){return ami['Action']({'action':_0x4f6f('0x11')});};};ami[_0x4f6f('0x12')]=function(){return function(){return ami['Action']({'action':_0x4f6f('0x13')});};};ami[_0x4f6f('0x14')]=function(){return function(){return ami['Action']({'action':_0x4f6f('0x15')});};};ami['actionQueueSummary']=function(){return function(){return ami[_0x4f6f('0x7')]({'action':_0x4f6f('0x16')});};};ami[_0x4f6f('0x17')]=function(){return function(){return ami[_0x4f6f('0x7')]({'action':'coreshowchannels'});};};function connect(){logger['info'](util[_0x4f6f('0xb')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x4f6f('0x5')][_0x4f6f('0xd')],config[_0x4f6f('0x5')]['ip'],config[_0x4f6f('0x5')]['port']));ami[_0x4f6f('0x18')]('error',error);ami[_0x4f6f('0x18')]('close',close);}ami['on'](_0x4f6f('0x19'),connect);ami['on'](_0x4f6f('0x1a'),function(_0x488b7d){logger['info'](util[_0x4f6f('0xb')](_0x4f6f('0x1b'),config[_0x4f6f('0x5')][_0x4f6f('0xd')],config[_0x4f6f('0x5')]['ip'],config[_0x4f6f('0x5')][_0x4f6f('0x6')],util[_0x4f6f('0xe')](_0x488b7d,![],null)));});ami['on']('fullybooted',function(){logger[_0x4f6f('0x1c')](util[_0x4f6f('0xb')](_0x4f6f('0x1d'),config[_0x4f6f('0x5')]['username'],config['asterisk']['ip'],config['asterisk']['port']));return Promise[_0x4f6f('0x1e')]()[_0x4f6f('0x1f')](ami[_0x4f6f('0x10')]())[_0x4f6f('0x1f')](ami[_0x4f6f('0x12')]())[_0x4f6f('0x1f')](ami['actionSipPeerStatus']())['then'](ami['actionQueueSummary']())[_0x4f6f('0x1f')](ami[_0x4f6f('0x17')]())[_0x4f6f('0x20')](function(_0x187764){logger['error'](_0x4f6f('0x21'),util[_0x4f6f('0xe')](_0x187764,{'showHidden':![],'depth':null}));});});ami[_0x4f6f('0x18')](_0x4f6f('0xa'),error);ami[_0x4f6f('0x18')]('close',close);module['exports']=ami; \ No newline at end of file +var _0xf472=['coreshowchannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','close','asterisk-manager','bluebird','util','../../config/logger','../../config/environment','asterisk','username','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels'];(function(_0x126d47,_0x217770){var _0x2cf53c=function(_0x154838){while(--_0x154838){_0x126d47['push'](_0x126d47['shift']());}};_0x2cf53c(++_0x217770);}(_0xf472,0x134));var _0x2f47=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf472[_0x321bb2];return _0x9c12ed;};'use strict';var Manager=require(_0x2f47('0x0'));var BPromise=require(_0x2f47('0x1'));var util=require(_0x2f47('0x2'));var logger=require(_0x2f47('0x3'))('ami');var config=require(_0x2f47('0x4'));var ami=new Manager(config[_0x2f47('0x5')]['port'],config[_0x2f47('0x5')]['ip'],config[_0x2f47('0x5')][_0x2f47('0x6')],config[_0x2f47('0x5')]['password'],!![]);ami[_0x2f47('0x7')]();ami[_0x2f47('0x8')]=BPromise[_0x2f47('0x9')](ami[_0x2f47('0xa')]);function error(_0x2a1b1e){logger[_0x2f47('0xb')](util[_0x2f47('0xc')](_0x2f47('0xd'),config[_0x2f47('0x5')][_0x2f47('0x6')],config[_0x2f47('0x5')]['ip'],config[_0x2f47('0x5')][_0x2f47('0xe')],util[_0x2f47('0xf')](_0x2a1b1e,![],null)));}function close(){logger[_0x2f47('0xb')](util[_0x2f47('0xc')](_0x2f47('0x10'),config[_0x2f47('0x5')][_0x2f47('0x6')],config['asterisk']['ip'],config['asterisk'][_0x2f47('0xe')]));}ami[_0x2f47('0x11')]=function(){return function(){return ami[_0x2f47('0x8')]({'action':_0x2f47('0x12')});};};ami[_0x2f47('0x13')]=function(){return function(){return ami[_0x2f47('0x8')]({'action':'devicestatelist'});};};ami[_0x2f47('0x14')]=function(){return function(){return ami[_0x2f47('0x8')]({'action':_0x2f47('0x15')});};};ami[_0x2f47('0x16')]=function(){return function(){return ami[_0x2f47('0x8')]({'action':_0x2f47('0x17')});};};ami[_0x2f47('0x18')]=function(){return function(){return ami[_0x2f47('0x8')]({'action':_0x2f47('0x19')});};};function connect(){logger['info'](util['format'](_0x2f47('0x1a'),config[_0x2f47('0x5')][_0x2f47('0x6')],config[_0x2f47('0x5')]['ip'],config['asterisk'][_0x2f47('0xe')]));ami[_0x2f47('0x1b')]('error',error);ami[_0x2f47('0x1b')]('close',close);}ami['on'](_0x2f47('0x1c'),connect);ami['on']('shutdown',function(_0x1ebfd9){logger[_0x2f47('0x1d')](util[_0x2f47('0xc')](_0x2f47('0x1e'),config[_0x2f47('0x5')][_0x2f47('0x6')],config[_0x2f47('0x5')]['ip'],config['asterisk']['port'],util['inspect'](_0x1ebfd9,![],null)));});ami['on'](_0x2f47('0x1f'),function(){logger[_0x2f47('0x1d')](util['format'](_0x2f47('0x20'),config[_0x2f47('0x5')][_0x2f47('0x6')],config[_0x2f47('0x5')]['ip'],config['asterisk']['port']));return Promise[_0x2f47('0x21')]()[_0x2f47('0x22')](ami[_0x2f47('0x11')]())[_0x2f47('0x22')](ami[_0x2f47('0x13')]())['then'](ami[_0x2f47('0x14')]())[_0x2f47('0x22')](ami[_0x2f47('0x16')]())['then'](ami[_0x2f47('0x18')]())['catch'](function(_0x4b7832){logger[_0x2f47('0xb')](_0x2f47('0x23'),util[_0x2f47('0xf')](_0x4b7832,{'showHidden':![],'depth':null}));});});ami[_0x2f47('0x1b')]('error',error);ami['once'](_0x2f47('0x24'),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 ffdca76..c75fd66 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 _0xe706=['result','catch','exports','jayson/promise','bluebird','../../config/logger','client','http','Request','request','then','debug','rpc','memberReport','error','message'];(function(_0x77d286,_0x1ddc6d){var _0x5446a5=function(_0x45e2cf){while(--_0x45e2cf){_0x77d286['push'](_0x77d286['shift']());}};_0x5446a5(++_0x1ddc6d);}(_0xe706,0xa3));var _0x6e70=function(_0x3ccc44,_0x207b0c){_0x3ccc44=_0x3ccc44-0x0;var _0x5d74bb=_0xe706[_0x3ccc44];return _0x5d74bb;};'use strict';var jayson=require(_0x6e70('0x0'));var BPromise=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('ami');var client=jayson[_0x6e70('0x3')][_0x6e70('0x4')]({'port':0x2329});client[_0x6e70('0x5')]=function(_0x7dfbc3,_0x142c27){return new BPromise(function(_0x2164a4,_0x376a8d){return client[_0x6e70('0x6')](_0x7dfbc3,_0x142c27)[_0x6e70('0x7')](function(_0x4381d1){logger[_0x6e70('0x8')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x142c27,_0x4381d1);if(_0x4381d1[_0x6e70('0xb')]){logger[_0x6e70('0xb')](_0x6e70('0x9'),_0x6e70('0xa'),_0x7dfbc3,_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')],_0x142c27);return _0x376a8d(_0x4381d1[_0x6e70('0xb')][_0x6e70('0xc')]);}else{return _0x2164a4(_0x4381d1[_0x6e70('0xd')]);}})[_0x6e70('0xe')](function(_0x4600f9){logger['error']('rpc',_0x6e70('0xa'),_0x7dfbc3,_0x4600f9,_0x142c27);return _0x376a8d(_0x4600f9);});});};module[_0x6e70('0xf')]=client; \ No newline at end of file +var _0x70e0=['catch','exports','jayson/promise','bluebird','../../config/logger','http','Request','then','memberReport','error','rpc','message','result'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x70e0,0x17b));var _0x070e=function(_0x1381df,_0x3301fc){_0x1381df=_0x1381df-0x0;var _0x78eeb0=_0x70e0[_0x1381df];return _0x78eeb0;};'use strict';var jayson=require(_0x070e('0x0'));var BPromise=require(_0x070e('0x1'));var logger=require(_0x070e('0x2'))('ami');var client=jayson['client'][_0x070e('0x3')]({'port':0x2329});client[_0x070e('0x4')]=function(_0x277d32,_0x2593e5){return new BPromise(function(_0x5c90fc,_0x7bce9b){return client['request'](_0x277d32,_0x2593e5)[_0x070e('0x5')](function(_0x4b041d){logger['debug']('rpc',_0x070e('0x6'),_0x277d32,_0x2593e5,_0x4b041d);if(_0x4b041d[_0x070e('0x7')]){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x4b041d[_0x070e('0x7')][_0x070e('0x9')],_0x2593e5);return _0x7bce9b(_0x4b041d['error']['message']);}else{return _0x5c90fc(_0x4b041d[_0x070e('0xa')]);}})[_0x070e('0xb')](function(_0x12bb37){logger[_0x070e('0x7')](_0x070e('0x8'),_0x070e('0x6'),_0x277d32,_0x12bb37,_0x2593e5);return _0x7bce9b(_0x12bb37);});});};module[_0x070e('0xc')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 23beef6..ceda212 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 _0x6b26=['\x20Intervals\x20is\x20null\x20','EMPTY_INTERVAL','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','isArray','length','Action','iftime\x20%s,%s','interval','indexOf','catch','push','command','true','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','ifTime','resetActiveCalls','syncCampaigns','undefined','isIVRCampaign','dialGlobalInterval','dialTimezone','launchHandleIvr','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','isGlobal','AMI\x20IfTime','Error','queue','uniqueid','updateOriginated','YYYY-MM-DD\x20HH:mm:ss','ivr','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','syncQueueCallerAbandon','droptime','getSeconds','dialQueueTimeout','predictiveIntervalDroppedCallsTimeout','outboundDropCallsDayTimeout','dropreason','countdropretry','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','ContactId','VoiceQueueId','CampaignId','[rescheduleContact][Drop]','Drop','calleridname','[syncAgentComplete][createHistory][10]','swapAdditionalPhones','outboundDropCallsDayCallersExit','CALLEREXIT','countabandonedretry','countglobal','dialAbandonedRetryFrequency','voiceQueue','dialAbandonedMaxRetry','ListId','Abandoned','calleridnum','[syncAgentComplete][createHistory][11]','actions','channel','actionid','rrmemory','roundrobin','isNil','locked','paused','stateinterface','idHopper','strategy','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','syncVarSet','variable','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','emit','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','MACHINE','outboundAnswerCallsDay','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','stateGlobal','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','dialMachineRetryFrequency','minutes','[rescheduleContact][Machine]','saveInDb','[syncHangupInAMDIvr][createHistory]','Machine','[syncAgentComplete][createHistory][0]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AGI','outboundUnknownCallsDay','cause-txt','Unknow','running','isPreviewCampaign','statusMessage','getQueueCampaignStatusMessage','resolve','available','inUse','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','syncQueueSummaryComplete','filter','online','map','user:dialPreviewRecallReminder','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','UserId','[emptyContact][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','Agent','user:%s','handleIvr','actionOriginate','voiceQueue\x20is\x20undefine','phone','originate','getCaller','NONE','\x22agi://%s/square,%s\x22','isOutboundQueue','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','Contact','createdAt','updatedAt','%s%s','toUpper','getCallerId','callerid','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','XMD-ORIGINATECALLERIDNAME','extractCalleridName','variables','SIP/%s/%s%s','dialPrefix','dialCutDigit','trim','substring','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','dialNoAnswerMaxRetry','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','object','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','outboundNoSuchCallsDay','NoSuchNumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','buildNoAnswerEventPayload','custom:agentnoanswer','dialNoAnswerRetryFrequency','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','busy','checkRetriveMax','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','dialGlobalMaxRetry','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','avgHandleTime','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(','predictiveIntervalHitRate','dropRate','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','check\x20failure','floor','erlangCallToSecond','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','booked','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','outboundReCallsDay','dialRecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','outboundBlacklistCallsDay','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','temp','getContactDialerIvr','dialOrderByScheduledAt','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','checkIsBlackList','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','countReScheduled','[countReScheduled]\x20','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','erlangb','----\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','exports','util','lodash','moment','ioredis','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','dialer','predictive','syncQueueSummary','redis','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/setting','./models/action','./models/agentComplete','./models/queueCallerAbandon','XCALLY_IP_AGI','127.0.0.1','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','agentconnect','syncAgentConnect','bind','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','custom:queuesummarycomplete','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','getSettings','then','previewRecallmeReminderInterval','isUndefined','type','outbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','format','voice:queue:%s','name','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsCallersExit','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','predictiveIntervalAvgHoldtime','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','---------------------------','merge','startProgressive\x20value\x20cleared','startPredictive','startPredictive\x20value\x20cleared','handlePredictive','error','stack','inspect','checkContactLowerLimitOriginate','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','message','NO_AVAILABLE_CONTACTS','state','statedesc','endtime','starttime','queueStatusComplete','stringify','pick','\x20INTERVAL_IS_NULL','Intervals','Interval','NULL_INTERVAL','INACTIVE','\x20NOT\x20Active','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','DISACTIVED','is\x20disactive','[ifTime][Action]','prototype','isTrunkReachable','active','SIP/%s','status','reachable','unmonitored','checkIsTrunkReachable','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTimeIvr','Failure'];(function(_0x1fdcd1,_0x18ffe1){var _0x57a25c=function(_0x3edcb4){while(--_0x3edcb4){_0x1fdcd1['push'](_0x1fdcd1['shift']());}};_0x57a25c(++_0x18ffe1);}(_0x6b26,0x191));var _0x66b2=function(_0x4b56f4,_0x46c976){_0x4b56f4=_0x4b56f4-0x0;var _0x966059=_0x6b26[_0x4b56f4];return _0x966059;};'use strict';var util=require(_0x66b2('0x0'));var _=require(_0x66b2('0x1'));var uuid=require('uuid');var moment=require(_0x66b2('0x2'));var rr=require('rr');var Redis=require(_0x66b2('0x3'));var utils=require('./utils');var hopperUtils=require(_0x66b2('0x4'));var ut=require(_0x66b2('0x5'));var config=require(_0x66b2('0x6'));var logger=require(_0x66b2('0x7'))(_0x66b2('0x8'));var loggerBooked=require(_0x66b2('0x7'))('booked');var loggerPredictive=require(_0x66b2('0x7'))(_0x66b2('0x9'));var loggerPredictiveCalls=require(_0x66b2('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require('../../../config/logger')(_0x66b2('0xa'));var ami=require('../ami');config[_0x66b2('0xb')]=_['defaults'](config[_0x66b2('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x66b2('0xb')]));var cmHopper=require(_0x66b2('0xc'));var voiceQueueRt=require(_0x66b2('0xd'));var RpcSetting=require(_0x66b2('0xe'));var Interval=require('../rpc/interval');var Action=require(_0x66b2('0xf'));var History=require('./models/history');var Final=require('./models/final');var AgentComplete=require(_0x66b2('0x10'));var QueueCallerAbandon=require(_0x66b2('0x11'));var Hangup=require('./models/hangup');var ipAgi=process['env'][_0x66b2('0x12')]||_0x66b2('0x13');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0x66b2('0x14')]=function(_0x41d6b6){this[_0x66b2('0x15')]=this[_0x66b2('0x15')]?this[_0x66b2('0x15')][_0x66b2('0x16')](_0x41d6b6):_0x41d6b6();};function Dialer(_0x49819f,_0xb08291){this[_0x66b2('0x17')]=new Sequence();this[_0x66b2('0x18')]=_0xb08291;this[_0x66b2('0x19')]=_0x49819f[_0x66b2('0x19')];this[_0x66b2('0x1a')]=_0x49819f[_0x66b2('0x1a')];this[_0x66b2('0x1b')]=_0x49819f[_0x66b2('0x1b')];this['trunks']=_0x49819f[_0x66b2('0x1c')];this[_0x66b2('0x1d')]=config['maxNumberOriginate']||0x2;this[_0x66b2('0x1e')]={};this['actions']={};this['contactsId']={};this[_0x66b2('0x1f')]={};this[_0x66b2('0x20')]={};this['startPredictive']={};this[_0x66b2('0x21')]={};this[_0x66b2('0x22')]={};this[_0x66b2('0x23')]={};this[_0x66b2('0x24')]={};this[_0x66b2('0x25')]={};ami['on'](_0x66b2('0x26'),this[_0x66b2('0x27')][_0x66b2('0x28')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0x66b2('0x29'),this[_0x66b2('0x2a')][_0x66b2('0x28')](this));ami['on'](_0x66b2('0x2b'),this[_0x66b2('0x2c')][_0x66b2('0x28')](this));ami['on'](_0x66b2('0x2d'),this['syncQueueSummary'][_0x66b2('0x28')](this));ami['on'](_0x66b2('0x2e'),this['syncQueueSummaryComplete']['bind'](this));ami['on']('hangup',this[_0x66b2('0x2f')][_0x66b2('0x28')](this));ami['on'](_0x66b2('0x30'),this[_0x66b2('0x31')][_0x66b2('0x28')](this));ami['on'](_0x66b2('0x32'),this['syncVarSet'][_0x66b2('0x28')](this));ami['on'](_0x66b2('0x33'),this[_0x66b2('0x34')]['bind'](this));ami['on'](_0x66b2('0x35'),this['syncQueueStatusComplete']['bind'](this));this[_0x66b2('0x36')]();this['loopClearZombieChannels']();RpcSetting[_0x66b2('0x37')]()[_0x66b2('0x38')](function(_0x1e2fa7){previewRecallmeReminderInterval=_0x1e2fa7[_0x66b2('0x39')];});}function isNotNull(_0x3ce410){return _0x3ce410!==null&&!_[_0x66b2('0x3a')](_0x3ce410);}function msgResponse(_0x2bcb73,_0x108041,_0x294e4c){return{'action':_0x2bcb73,'response':_0x108041,'message':_0x294e4c,'stack':_0x294e4c};}function emit(_0x200806,_0x4727cb,_0x31f8f0){io['to'](_0x200806)['emit'](_0x4727cb,_0x31f8f0);}function emitOutboundVoiceQueueSummary(_0xb5e3ae){if(_0xb5e3ae[_0x66b2('0x3b')]===_0x66b2('0x3c')){logger[_0x66b2('0x3d')](_0x66b2('0x3e'),util['inspect'](_0xb5e3ae,{'showHidden':![],'depth':null}));emit(util[_0x66b2('0x3f')](_0x66b2('0x40'),_0xb5e3ae[_0x66b2('0x41')]),'voice_queue:save',_0xb5e3ae);}}function checkGetDataPredictive(_0x79f11c){if(isNotNull(_0x79f11c)&&!_[_0x66b2('0x42')](_0x79f11c)){loggerPredictive[_0x66b2('0x43')](_0x66b2('0x44'));loggerPredictive[_0x66b2('0x43')](_0x66b2('0x45'),_0x79f11c[_0x66b2('0x46')]);loggerPredictive[_0x66b2('0x43')](_0x66b2('0x47'),_0x79f11c[_0x66b2('0x48')]);loggerPredictive[_0x66b2('0x43')](_0x66b2('0x49'),_0x79f11c['predictiveIntervalDroppedCallsTimeout']);loggerPredictive[_0x66b2('0x43')](_0x66b2('0x4a'),_0x79f11c[_0x66b2('0x4b')]);loggerPredictive[_0x66b2('0x43')](_0x66b2('0x4c'),_0x79f11c['predictiveIntervalAvgHoldtime']);loggerPredictive[_0x66b2('0x43')](_0x66b2('0x4d'),_0x79f11c['predictiveIntervalAvgTalktime']);loggerPredictive[_0x66b2('0x43')]('---------------------------');if(_0x79f11c[_0x66b2('0x46')]>0x0){if(!_[_0x66b2('0x3a')](_0x79f11c[_0x66b2('0x4e')])&&_0x79f11c[_0x66b2('0x4e')]>0x0){return!![];}loggerPredictive[_0x66b2('0x43')](_0x66b2('0x4f'));if(!_['isUndefined'](_0x79f11c[_0x66b2('0x50')])&&_0x79f11c[_0x66b2('0x50')]>0x0){return!![];}loggerPredictive[_0x66b2('0x43')](_0x66b2('0x51'));}else{loggerPredictive['info'](_0x66b2('0x52'));}}else{loggerPredictive['info'](_0x66b2('0x53'));}return![];}function mergeDataErlangB(_0x51520d){return function(_0x4a1696){loggerPredictive[_0x66b2('0x43')]('---------\x20ErlangB\x20---------');loggerPredictive['info'](_0x66b2('0x54'),_0x4a1696[_0x66b2('0x55')]);loggerPredictive[_0x66b2('0x43')](_0x66b2('0x56'),_0x4a1696['erlangCallToSecond']);loggerPredictive[_0x66b2('0x43')](_0x66b2('0x57'),_0x4a1696[_0x66b2('0x58')]);loggerPredictive[_0x66b2('0x43')](_0x66b2('0x59'),_0x4a1696[_0x66b2('0x5a')]);loggerPredictive[_0x66b2('0x43')](_0x66b2('0x57'),_0x4a1696['erlangAbandonmentRate']);loggerPredictive['info'](_0x66b2('0x5b'));_[_0x66b2('0x5c')](_0x51520d,_0x4a1696);};}function ifInterval(_0x5276c8,_0x25a76d){if(_[_0x66b2('0x3a')](_0x25a76d)){return![];}return utils['getSeconds'](undefined,_0x25a76d)<_0x5276c8*0x3c;}function clearPredictiveAttributes(_0x2be553){if(_0x2be553['startProgressive']){_0x2be553[_0x66b2('0x21')]=undefined;loggerPredictive['debug'](_0x2be553[_0x66b2('0x41')],_0x66b2('0x5d'));}if(_0x2be553['startPredictive']){_0x2be553[_0x66b2('0x5e')]=undefined;loggerPredictive['debug'](_0x2be553[_0x66b2('0x41')],_0x66b2('0x5f'));}if(_0x2be553['handlePredictive']){clearInterval(_0x2be553[_0x66b2('0x60')]);_0x2be553[_0x66b2('0x60')]=undefined;loggerPredictive[_0x66b2('0x3d')](_0x2be553[_0x66b2('0x41')],'handlePredictive\x20interval\x20cleared');}}function loggerCatchPredictive(_0x117c9e,_0x4491a0){return function(_0x4ed009){loggerPredictive['error'](_0x4491a0['name'],_0x117c9e);loggerPredictive[_0x66b2('0x61')](_0x4ed009[_0x66b2('0x62')]);clearPredictiveAttributes(_0x4491a0);};}function loggerCatch(_0x3437e8){return function(_0x165780){logger[_0x66b2('0x61')](_0x3437e8,util[_0x66b2('0x63')](_0x165780,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x481578,_0x48b6ff,_0x487ebd){return function(_0x40f29a){utils[_0x66b2('0x64')](_0x48b6ff,_0x487ebd,0x0);logger[_0x66b2('0x61')](_0x481578,util[_0x66b2('0x63')](_0x40f29a,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x26f12c){return function(_0x20e94d){if(isNotNull(_0x20e94d)&&isNotNull(_0x20e94d[0x0])){if(_0x20e94d[0x0][_0x66b2('0x65')]>0x0){_0x26f12c['message']=utils[_0x66b2('0x66')][_0x66b2('0x67')];logger[_0x66b2('0x43')](_0x66b2('0x68')+_0x26f12c[_0x66b2('0x41')],_0x20e94d[0x0][_0x66b2('0x65')],_0x66b2('0x69'));}else{_0x26f12c[_0x66b2('0x6a')]=utils[_0x66b2('0x66')][_0x66b2('0x6b')];logger[_0x66b2('0x43')]('[getContactDialer2][Empty]'+_0x26f12c[_0x66b2('0x41')]);}}};}function createObjHistory(_0x2dc340,_0x4594f3,_0x16b9bf,_0x4d9e3e,_0x6897d1){_0x2dc340[_0x66b2('0x6a')]=_0x16b9bf;var _0x5dde53=new Action(_0x2dc340,_0x4594f3);var _0x3724f2=new History(_0x5dde53);_0x3724f2[_0x66b2('0x6c')]=_0x4d9e3e;_0x3724f2[_0x66b2('0x6d')]=_0x6897d1;_0x3724f2[_0x66b2('0x6e')]=_0x5dde53[_0x66b2('0x6f')];return _0x3724f2;}function unlockQueueStatus(_0x2ffe9c,_0x592d0c){setTimeout(function(){if(_[_0x66b2('0x3a')](_0x2ffe9c[_0x66b2('0x70')])){loggerBooked[_0x66b2('0x61')]('[unlockQueueStatus][undefined]',_0x592d0c);}_0x2ffe9c[_0x66b2('0x70')]=!![];loggerBooked[_0x66b2('0x43')]('[booked][unlockQueueStatus]',_0x592d0c,JSON[_0x66b2('0x71')](_[_0x66b2('0x72')](_0x2ffe9c,[_0x66b2('0x41'),_0x66b2('0x70')])));},0x1f3);}function checkInterval(_0x32945c){return function(){if(!isNotNull(_0x32945c['Interval'])){_0x32945c[_0x66b2('0x6a')]=utils[_0x66b2('0x66')]['NULL_INTERVAL'];throw _0x32945c[_0x66b2('0x41')]+_0x66b2('0x73');}if(!isNotNull(_0x32945c['Interval'][_0x66b2('0x74')])){_0x32945c['message']=utils[_0x66b2('0x66')]['NULL_INTERVAL'];throw _0x32945c['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x66b2('0x42')](_0x32945c[_0x66b2('0x75')]['Intervals']))){_0x32945c[_0x66b2('0x6a')]=utils['CAMPAIGN_STATUS'][_0x66b2('0x76')];throw _0x32945c[_0x66b2('0x41')]+_0x66b2('0x73');}};}function checkIsIVRCampaignActive(_0x32fc3b){return function(){if(!utils['isIVRCampaignActive'](_0x32fc3b)){_0x32fc3b['message']=utils['CAMPAIGN_STATUS'][_0x66b2('0x77')];throw _0x32fc3b[_0x66b2('0x41')]+_0x66b2('0x78');}};}function emitCampaignSummary(_0x5e2e48){if(utils['isIVRCampaign'](_0x5e2e48)){emit(util[_0x66b2('0x3f')]('campaign:ivr:%s',_0x5e2e48[_0x66b2('0x41')]),_0x66b2('0x79'),_0x5e2e48);}}function loggerCatchQueueSummary(_0x2c0bdc,_0x3b233a){return function(_0x14f7b4){clearPredictiveAttributes(_0x3b233a);emitCampaignSummary(_0x3b233a);loggerSyncQueueSummary[_0x66b2('0x3d')](_0x2c0bdc,util[_0x66b2('0x63')](_0x14f7b4,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x622852){if(_0x622852[_0x66b2('0x7a')]){if(_0x622852[_0x66b2('0x7b')]===0x0){_0x622852[_0x66b2('0x7a')]=![];_0x622852[_0x66b2('0x6a')]=utils[_0x66b2('0x66')][_0x66b2('0x77')];loggerSyncQueueSummary[_0x66b2('0x3d')](_0x66b2('0x7c'),_0x622852[_0x66b2('0x41')],_0x66b2('0x7d'));}else{_0x622852[_0x66b2('0x6a')]=utils[_0x66b2('0x66')][_0x66b2('0x7e')];loggerSyncQueueSummary[_0x66b2('0x3d')](_0x66b2('0x7c'),_0x622852['name'],_0x66b2('0x7f'));}emitCampaignSummary(_0x622852);}}function myreject(_0x3bb465){return function(_0x24b1eb){return _0x3bb465(msgResponse(_0x66b2('0x80'),'Error',JSON[_0x66b2('0x71')](_0x24b1eb)));};}Dialer[_0x66b2('0x81')][_0x66b2('0x82')]=function(_0x59fb54){return!_['isUndefined'](_0x59fb54)&&_0x59fb54&&!_['isUndefined'](_0x59fb54[_0x66b2('0x41')])&&!_['isUndefined'](_0x59fb54[_0x66b2('0x83')])&&_0x59fb54[_0x66b2('0x83')]&&(this[_0x66b2('0x1c')][util[_0x66b2('0x3f')](_0x66b2('0x84'),_0x59fb54[_0x66b2('0x41')])][_0x66b2('0x85')]===_0x66b2('0x86')||this[_0x66b2('0x1c')][util[_0x66b2('0x3f')](_0x66b2('0x84'),_0x59fb54[_0x66b2('0x41')])]['status']===_0x66b2('0x87'));};Dialer[_0x66b2('0x81')][_0x66b2('0x88')]=function(_0x1be2c9){var _0x37ceb5=this;return function(){if(!_0x37ceb5[_0x66b2('0x82')](_0x1be2c9[_0x66b2('0x89')])){if(!_0x37ceb5[_0x66b2('0x82')](_0x1be2c9[_0x66b2('0x8a')])){_0x1be2c9[_0x66b2('0x6a')]=utils[_0x66b2('0x66')][_0x66b2('0x8b')];throw _0x1be2c9[_0x66b2('0x41')]+_0x66b2('0x8c');}}};};Dialer[_0x66b2('0x81')][_0x66b2('0x8d')]=function(_0x38b7ce,_0x2870f6,_0x3327cb,_0x34b72f){var _0x21488d=this;return function(){var _0x2ef77e=!![];return _0x21488d['ifTimeIvr'](_0x38b7ce,_0x2870f6,_0x3327cb,_0x34b72f,_0x2ef77e);};};Dialer['prototype'][_0x66b2('0x8e')]=function(_0x29878d,_0x2a6a73,_0x816496,_0x57f062){var _0x23c1df=this;return function(){var _0x3c9a05=![];return _0x23c1df[_0x66b2('0x8f')](_0x29878d[_0x66b2('0x74')],_0x2a6a73,_0x816496,_0x57f062,_0x3c9a05);};};Dialer[_0x66b2('0x81')][_0x66b2('0x8f')]=function(_0x11c67b,_0x4c59b9,_0x541e02,_0xbade66,_0x4892a1){var _0x540106=[];return new Promise(function(_0x4c3b75,_0x15299c){if(!isNotNull(_0x11c67b)){_0xbade66[_0x66b2('0x6a')]=utils[_0x66b2('0x66')]['NULL_INTERVAL'];return _0x15299c(msgResponse('ifTime',_0x66b2('0x90'),_0x541e02+_0x66b2('0x91')));}if(_[_0x66b2('0x42')](_0x11c67b)){_0xbade66['message']=utils[_0x66b2('0x66')][_0x66b2('0x92')];return _0x15299c(msgResponse('ifTime',_0x66b2('0x90'),_0x541e02+'\x20Intervals\x20is\x20empty\x20'));}if(_0x4c59b9&&_[_0x66b2('0x3a')](config[_0x66b2('0x93')][_0x4c59b9])){_0xbade66[_0x66b2('0x6a')]=utils['CAMPAIGN_STATUS'][_0x66b2('0x94')];return _0x15299c(msgResponse('ifTime',_0x66b2('0x90'),_0x541e02+_0x66b2('0x95')+_0x4c59b9));}if(_[_0x66b2('0x96')](_0x11c67b)){for(var _0xf6a454=0x0;_0xf6a454<_0x11c67b[_0x66b2('0x97')];_0xf6a454+=0x1){_0x540106['push'](ami[_0x66b2('0x98')]({'action':'command','command':util[_0x66b2('0x3f')](_0x66b2('0x99'),_0x11c67b[_0xf6a454][_0x66b2('0x9a')],!_[_0x66b2('0x3a')](config[_0x66b2('0x93')][_0x4c59b9])?_0x4c59b9:'')})[_0x66b2('0x38')](function(_0x43ea9e){return _0x43ea9e['content'][_0x66b2('0x9b')]('true')>=0x0;})[_0x66b2('0x9c')](myreject(_0x15299c)));}}else{_0x540106[_0x66b2('0x9d')](ami[_0x66b2('0x98')]({'action':_0x66b2('0x9e'),'command':util[_0x66b2('0x3f')](_0x66b2('0x99'),_0x11c67b,!_['isUndefined'](config[_0x66b2('0x93')][_0x4c59b9])?_0x4c59b9:'')})[_0x66b2('0x38')](function(_0x81bac1){return _0x81bac1['content'][_0x66b2('0x9b')](_0x66b2('0x9f'))>=0x0;})[_0x66b2('0x9c')](myreject(_0x15299c)));}Promise[_0x66b2('0xa0')](_0x540106)[_0x66b2('0x38')](function(_0x15f2f2){var _0x485ab1=_[_0x66b2('0xa1')](_0x15f2f2);if(_0x485ab1){return _0x4c3b75(_0x485ab1);}else{_0xbade66[_0x66b2('0x6a')]=_0x4892a1?utils[_0x66b2('0x66')][_0x66b2('0xa2')]:utils[_0x66b2('0x66')][_0x66b2('0xa3')];return _0x15299c(msgResponse(_0x66b2('0xa4'),'Failure',_0x66b2('0xa5')+_0x4892a1+'\x20'+_0x541e02+_0x66b2('0xa6')+util[_0x66b2('0x63')](_0x11c67b,{'showHidden':![],'depth':null})+_0x66b2('0xa7')+_0x4c59b9));}})[_0x66b2('0x9c')](function(_0x166431){return _0x15299c(msgResponse(_0x66b2('0xa8'),_0x66b2('0x90'),JSON[_0x66b2('0x71')](_0x166431)));});});};Dialer[_0x66b2('0x81')]['loopCampaigns']=function(){var _0x96cc21=this;return cmHopper[_0x66b2('0xa9')]({'active':![]},{'where':{'active':!![]}})['then'](function(){setInterval(function(){_0x96cc21[_0x66b2('0xaa')]();},0x3e8);});};Dialer[_0x66b2('0x81')]['syncCampaigns']=function(){var _0x579e89=this;var _0x3e1e28;for(var _0x4e3630 in this['campaigns']){if(typeof this['campaigns'][_0x4e3630]!==_0x66b2('0xab')){_0x3e1e28=this[_0x66b2('0x1a')][_0x4e3630];if(utils[_0x66b2('0xac')](_0x3e1e28)&&utils['isIVRCampaignActive'](_0x3e1e28)){_0x3e1e28[_0x66b2('0x7a')]=!![];Promise['resolve']()[_0x66b2('0x38')](checkIsIVRCampaignActive(_0x3e1e28))[_0x66b2('0x38')](checkInterval(_0x3e1e28))['then'](_0x579e89[_0x66b2('0x88')](_0x3e1e28))['then'](_0x579e89[_0x66b2('0x8d')](_0x3e1e28[_0x66b2('0xad')],_0x3e1e28[_0x66b2('0xae')],_0x3e1e28[_0x66b2('0x41')],_0x3e1e28))[_0x66b2('0x38')](_0x579e89[_0x66b2('0x8e')](_0x3e1e28[_0x66b2('0x75')],_0x3e1e28[_0x66b2('0xae')],_0x3e1e28[_0x66b2('0x41')],_0x3e1e28))[_0x66b2('0x38')](_0x579e89[_0x66b2('0xaf')](_0x3e1e28))['catch'](loggerCatchQueueSummary('[syncCampaigns]',_0x3e1e28));}else{notSendMessagesCampaign(_0x3e1e28);}}}};Dialer['prototype'][_0x66b2('0xb0')]=function(_0x2e54d6){if(_0x2e54d6[_0x66b2('0xb1')]!=='predictive'){clearPredictiveAttributes(_0x2e54d6);}switch(_0x2e54d6[_0x66b2('0xb1')]){case _0x66b2('0xb2'):this[_0x66b2('0xb3')](_0x2e54d6,0x1);break;case _0x66b2('0xb4'):this[_0x66b2('0xb3')](_0x2e54d6,_0x2e54d6[_0x66b2('0xb5')]);break;case _0x66b2('0x9'):this[_0x66b2('0x9')](_0x2e54d6);break;case'booked':this['handlePower'](_0x2e54d6,0x1);break;default:logger['error'](_0x66b2('0xb6'),_0x2e54d6[_0x66b2('0x41')],_0x66b2('0xb7'));}};Dialer[_0x66b2('0x81')][_0x66b2('0xa8')]=function(_0x57a609,_0xbaa802){var _0x451cfc=_0x57a609[_0x66b2('0xae')];var _0x36b2a4=_0xbaa802?_0x57a609[_0x66b2('0xad')]:_0x57a609[_0x66b2('0x75')][_0x66b2('0x74')];logger[_0x66b2('0xb8')](_0x66b2('0xb9'),_0x36b2a4,_0x451cfc,_0x57a609['name'],util[_0x66b2('0x3f')](_0x66b2('0xba'),_0x57a609['name'],_0x57a609['id']));var _0xb481d9=null;return Interval[_0x66b2('0xbb')](_0x36b2a4,_0x451cfc)[_0x66b2('0x38')](function(_0x41e566){if(_0x41e566===!![]){return _0x41e566;}else{_0x57a609['message']=_0xbaa802?utils[_0x66b2('0x66')][_0x66b2('0xa2')]:utils[_0x66b2('0x66')][_0x66b2('0xa3')];_0xb481d9=msgResponse(_0x66b2('0xa4'),_0x66b2('0x90'),_0x66b2('0xa5')+_0xbaa802+'\x20'+_0x57a609[_0x66b2('0x41')]+_0x66b2('0xa6')+util[_0x66b2('0x63')](_0x36b2a4,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x451cfc);}if(_0xb481d9!==null){logger[_0x66b2('0xb8')]('Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:',_0xb481d9);_0xb481d9[_0x66b2('0xbc')]=_0xbaa802;throw _0xb481d9;}})[_0x66b2('0x9c')](function(_0x155d91){logger[_0x66b2('0x61')](_0x66b2('0xbd'),_0x155d91);throw msgResponse('[ifTime][Action]',_0x66b2('0xbe'),util[_0x66b2('0x63')](_0x155d91,{'showHidden':![],'depth':null}));});};Dialer['prototype'][_0x66b2('0x27')]=function(_0x3529f4){if(this['voiceQueues'][_0x3529f4[_0x66b2('0xbf')]]){if(this[_0x66b2('0x1f')][_0x3529f4['uniqueid']]&&this[_0x66b2('0x1f')][_0x3529f4[_0x66b2('0xc0')]][_0x66b2('0x3b')]!=='ivr'){this[_0x66b2('0xc1')](this[_0x66b2('0x19')][_0x3529f4[_0x66b2('0xbf')]]);this[_0x66b2('0x1f')][_0x3529f4['uniqueid']]['answertime']=moment()[_0x66b2('0x3f')](_0x66b2('0xc2'));}}};Dialer[_0x66b2('0x81')][_0x66b2('0x2c')]=function(_0x1b4d91){var _0x18f6d6=this['uniqueId'][_0x1b4d91[_0x66b2('0xc0')]];if(this['voiceQueues'][_0x1b4d91[_0x66b2('0xbf')]]){if(_0x18f6d6&&_0x18f6d6['type']!==_0x66b2('0xc3')){delete this[_0x66b2('0x1f')][_0x1b4d91[_0x66b2('0xc0')]];this[_0x66b2('0x19')][_0x1b4d91[_0x66b2('0xbf')]]['outboundAnswerCallsDay']+=0x1;var _0x2b6c6c=new AgentComplete(_0x18f6d6,_0x1b4d91);if(_0x1b4d91['reason']===_0x66b2('0xc4')){_0x2b6c6c[_0x66b2('0xc5')]=this[_0x66b2('0x19')][_0x1b4d91[_0x66b2('0xbf')]][_0x66b2('0xc6')]&&this[_0x66b2('0x19')][_0x1b4d91[_0x66b2('0xbf')]][_0x66b2('0xc7')]?moment()[_0x66b2('0x3f')](_0x66b2('0xc2')):undefined;}hopperUtils[_0x66b2('0xc8')](_0x2b6c6c)[_0x66b2('0x9c')](loggerCatch(_0x66b2('0xc9')));hopperUtils[_0x66b2('0xca')](_0x2b6c6c)[_0x66b2('0x9c')](loggerCatch(_0x66b2('0xcb')));}}};Dialer[_0x66b2('0x81')][_0x66b2('0xcc')]=function(_0xba8ab1){var _0x45123e=this[_0x66b2('0x1f')][_0xba8ab1[_0x66b2('0xc0')]];var _0x56cf82=this;var _0x203d1e=![];var _0x38ad9f;var _0x12fddc;if(this[_0x66b2('0x19')][_0xba8ab1[_0x66b2('0xbf')]]){if(_0x45123e&&_0x45123e[_0x66b2('0x3b')]!==_0x66b2('0xc3')){delete this['uniqueId'][_0xba8ab1[_0x66b2('0xc0')]];this[_0x66b2('0xc1')](this[_0x66b2('0x19')][_0xba8ab1[_0x66b2('0xbf')]]);_0x45123e[_0x66b2('0xcd')]=moment()[_0x66b2('0x3f')](_0x66b2('0xc2'));var _0xd26129=new QueueCallerAbandon(_0x45123e,_0xba8ab1);if(utils[_0x66b2('0xce')](_0x45123e['droptime'],_0x45123e['responsetime'])>=_0x45123e[_0x66b2('0xcf')]){this['voiceQueues'][_0xba8ab1['queue']][_0x66b2('0xd0')]+=0x1;this[_0x66b2('0x19')][_0xba8ab1[_0x66b2('0xbf')]][_0x66b2('0xd1')]+=0x1;this[_0x66b2('0x19')][_0xba8ab1[_0x66b2('0xbf')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0xd26129['state']=0xa;_0xd26129[_0x66b2('0x6d')]='Drop';_0xd26129[_0x66b2('0xd2')]='TIMEOUT';_0xd26129[_0x66b2('0xc5')]=this[_0x66b2('0x19')][_0xba8ab1[_0x66b2('0xbf')]][_0x66b2('0xc6')]?moment()[_0x66b2('0x3f')](_0x66b2('0xc2')):undefined;_0xd26129[_0x66b2('0xd3')]+=0x1;_0xd26129['countglobal']+=0x1;_0x38ad9f=this[_0x66b2('0x19')][_0xba8ab1['queue']][_0x66b2('0xd4')];_0x12fddc=this[_0x66b2('0x19')][_0xba8ab1[_0x66b2('0xbf')]][_0x66b2('0xd5')];hopperUtils[_0x66b2('0xd6')](_0xd26129,_0xd26129[_0x66b2('0x6c')],_0x45123e['voiceQueue'])['then'](function(_0x1923c2){_0x203d1e=_0x1923c2[_0x66b2('0xd7')]==0x1;if(_0xd26129['countdropretry']>=_0x56cf82[_0x66b2('0x19')][_0xba8ab1[_0x66b2('0xbf')]][_0x66b2('0xd8')]){_0x56cf82[_0x66b2('0xd9')](_0xd26129,_0x1923c2['additional']);}else{hopperUtils[_0x66b2('0xda')]({'active':![],'countdropretry':_0xd26129['countdropretry'],'scheduledat':moment()[_0x66b2('0xdb')](_0x56cf82[_0x66b2('0x19')][_0xba8ab1[_0x66b2('0xbf')]][_0x66b2('0xd4')],'minutes')[_0x66b2('0x3f')](_0x66b2('0xc2')),'ContactId':_0x45123e[_0x66b2('0xdc')],'ListId':_0x45123e['ListId'],'VoiceQueueId':_0x45123e[_0x66b2('0xdd')]||undefined,'CampaignId':_0x45123e[_0x66b2('0xde')]||undefined})['catch'](loggerCatch(_0x66b2('0xdf')));var _0x14de35=new History(_0xd26129);_0x14de35[_0x66b2('0x6c')]=0xa;_0x14de35[_0x66b2('0x6d')]=_0x66b2('0xe0');_0x14de35[_0x66b2('0x6f')]=moment()[_0x66b2('0x3f')]('YYYY-MM-DD\x20HH:mm:ss');_0x14de35[_0x66b2('0x6e')]=_0x14de35[_0x66b2('0x6f')];_0x14de35[_0x66b2('0xe1')]=_0xd26129[_0x66b2('0xe1')];_0x14de35['calleridnum']=_0xd26129['calleridnum'];hopperUtils[_0x66b2('0xc8')](_0x14de35)[_0x66b2('0x9c')](loggerCatch(_0x66b2('0xe2')));}})['then'](function(){if(_0x203d1e)hopperUtils[_0x66b2('0xe3')](_0xd26129,_0x38ad9f,_0x12fddc)[_0x66b2('0x38')](function(){return 0x1;});});}else{this[_0x66b2('0x19')][_0xba8ab1[_0x66b2('0xbf')]][_0x66b2('0x4b')]+=0x1;this[_0x66b2('0x19')][_0xba8ab1['queue']][_0x66b2('0xe4')]+=0x1;_0xd26129[_0x66b2('0x6c')]=0xb;_0xd26129['statedesc']='Abandoned';_0xd26129[_0x66b2('0xd2')]=_0x66b2('0xe5');_0xd26129[_0x66b2('0xe6')]+=0x1;_0xd26129[_0x66b2('0xe7')]+=0x1;_0x38ad9f=this[_0x66b2('0x19')][_0xba8ab1[_0x66b2('0xbf')]][_0x66b2('0xe8')];_0x12fddc=this[_0x66b2('0x19')][_0xba8ab1[_0x66b2('0xbf')]][_0x66b2('0xd5')];hopperUtils[_0x66b2('0xd6')](_0xd26129,_0xd26129[_0x66b2('0x6c')],_0x45123e[_0x66b2('0xe9')])[_0x66b2('0x38')](function(_0x189050){if(_0xd26129[_0x66b2('0xe6')]>=_0x56cf82[_0x66b2('0x19')][_0xba8ab1[_0x66b2('0xbf')]][_0x66b2('0xea')]){_0x56cf82[_0x66b2('0xd9')](_0xd26129,_0x189050[_0x66b2('0xd7')]);}else{hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0xd26129[_0x66b2('0xe6')],'scheduledat':moment()[_0x66b2('0xdb')](_0x56cf82[_0x66b2('0x19')][_0xba8ab1[_0x66b2('0xbf')]]['dialAbandonedRetryFrequency'],'minutes')[_0x66b2('0x3f')](_0x66b2('0xc2')),'ContactId':_0x45123e[_0x66b2('0xdc')],'ListId':_0x45123e[_0x66b2('0xeb')],'VoiceQueueId':_0x45123e['VoiceQueueId']||undefined,'CampaignId':_0x45123e[_0x66b2('0xde')]||undefined})[_0x66b2('0x9c')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x133966=new History(_0xd26129);_0x133966[_0x66b2('0x6c')]=0xb;_0x133966['statedesc']=_0x66b2('0xec');_0x133966[_0x66b2('0x6f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x133966[_0x66b2('0x6e')]=_0x133966[_0x66b2('0x6f')];_0x133966[_0x66b2('0xe1')]=_0xd26129[_0x66b2('0xe1')];_0x133966[_0x66b2('0xed')]=_0xd26129[_0x66b2('0xed')];hopperUtils[_0x66b2('0xc8')](_0x133966)[_0x66b2('0x9c')](loggerCatch(_0x66b2('0xee')));}})[_0x66b2('0x38')](function(){if(_0x203d1e)hopperUtils['swapAdditionalPhones'](_0xd26129,_0x38ad9f,_0x12fddc)['then'](function(){return 0x1;});});}}}};Dialer[_0x66b2('0x81')][_0x66b2('0x31')]=function(_0x41ad5a){if(this[_0x66b2('0xef')][_0x41ad5a[_0x66b2('0xc0')]]){this[_0x66b2('0xef')][_0x41ad5a[_0x66b2('0xc0')]][_0x66b2('0xf0')]=_0x41ad5a['channel'];}if(this[_0x66b2('0x1f')][_0x41ad5a[_0x66b2('0xc0')]]){this[_0x66b2('0x1f')][_0x41ad5a[_0x66b2('0xc0')]]['channel']=_0x41ad5a[_0x66b2('0xf0')];}};Dialer[_0x66b2('0x81')][_0x66b2('0x34')]=function(_0x47e1ef){if(!this['actions'][_0x47e1ef[_0x66b2('0xf1')]]){return;}var _0x4e8115=this['voiceQueues'][this[_0x66b2('0xef')][_0x47e1ef[_0x66b2('0xf1')]][_0x66b2('0xbf')]]['strategy']||_0x66b2('0xf2');if(_0x4e8115===_0x66b2('0xf3')){if(this['actions'][_0x47e1ef[_0x66b2('0xf1')]]&&_[_0x66b2('0xf4')](this[_0x66b2('0xef')][_0x47e1ef[_0x66b2('0xf1')]][_0x66b2('0xf5')])&&_0x47e1ef[_0x66b2('0x85')]==='1'&&_0x47e1ef[_0x66b2('0xf6')]==='0'){if(this[_0x66b2('0x1b')][_0x47e1ef[_0x66b2('0xf7')]]){if(!this[_0x66b2('0x1b')][_0x47e1ef[_0x66b2('0xf7')]][_0x66b2('0xf5')]){this[_0x66b2('0x1b')][_0x47e1ef[_0x66b2('0xf7')]][_0x66b2('0xf5')]=!![];this[_0x66b2('0xef')][_0x47e1ef[_0x66b2('0xf1')]][_0x66b2('0xf5')]=!![];this[_0x66b2('0xef')][_0x47e1ef[_0x66b2('0xf1')]]['stateinterface']=_0x47e1ef[_0x66b2('0xf7')];}}}}else if(_0x4e8115===_0x66b2('0xf2')){if(this[_0x66b2('0xef')][_0x47e1ef[_0x66b2('0xf1')]]){if(this[_0x66b2('0x1b')][_0x47e1ef[_0x66b2('0xf7')]]){this[_0x66b2('0xef')][_0x47e1ef[_0x66b2('0xf1')]][_0x66b2('0xf7')]=_0x47e1ef[_0x66b2('0xf7')];if(_['isNil'](this['queueBooked'][this[_0x66b2('0xef')][_0x47e1ef[_0x66b2('0xf1')]][_0x66b2('0xbf')]])){this[_0x66b2('0x23')][this[_0x66b2('0xef')][_0x47e1ef[_0x66b2('0xf1')]][_0x66b2('0xbf')]]=[];}this[_0x66b2('0x23')][this[_0x66b2('0xef')][_0x47e1ef[_0x66b2('0xf1')]][_0x66b2('0xbf')]][_0x66b2('0x9d')](_[_0x66b2('0x5c')](_[_0x66b2('0x72')](this['actions'][_0x47e1ef[_0x66b2('0xf1')]],[_0x66b2('0xf8'),_0x66b2('0xf7')]),{'status':_0x47e1ef[_0x66b2('0x85')],'paused':_0x47e1ef[_0x66b2('0xf6')]}));}}}};Dialer['prototype']['syncQueueStatusComplete']=function(_0x595cc1){if(!this['actions'][_0x595cc1[_0x66b2('0xf1')]]){return;}var _0x30bcc5=this;var _0x5817d9=this['voiceQueues'][this['actions'][_0x595cc1[_0x66b2('0xf1')]][_0x66b2('0xbf')]];var _0x1b6620=_0x5817d9[_0x66b2('0xf9')]||_0x66b2('0xf2');if(_0x1b6620===_0x66b2('0xf3')){if(this[_0x66b2('0xef')][_0x595cc1[_0x66b2('0xf1')]]&&this[_0x66b2('0xef')][_0x595cc1['actionid']][_0x66b2('0xf7')]){this[_0x66b2('0x18')][_0x66b2('0xfa')](this['actions'][_0x595cc1[_0x66b2('0xf1')]][_0x66b2('0xf8')],this[_0x66b2('0xef')][_0x595cc1[_0x66b2('0xf1')]][_0x66b2('0xf7')])[_0x66b2('0x9c')](function(_0x179727){logger[_0x66b2('0x61')](_0x66b2('0xfb'),util['inspect'](_0x179727,{'showHidden':![],'depth':null}));})['finally'](function(){_0x30bcc5[_0x66b2('0xc1')](_0x30bcc5['voiceQueues'][_0x30bcc5[_0x66b2('0xef')][_0x595cc1['actionid']][_0x66b2('0xbf')]]);_0x30bcc5['agents'][_0x30bcc5[_0x66b2('0xef')][_0x595cc1['actionid']][_0x66b2('0xf7')]][_0x66b2('0xf5')]=![];delete _0x30bcc5[_0x66b2('0xef')][_0x595cc1[_0x66b2('0xf1')]];unlockQueueStatus(_0x5817d9);});}else{this[_0x66b2('0xc1')](this[_0x66b2('0x19')][this['actions'][_0x595cc1[_0x66b2('0xf1')]]['queue']]);hopperUtils['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x595cc1[_0x66b2('0xf1')]][_0x66b2('0xdc')],'ListId':this['actions'][_0x595cc1['actionid']]['ListId'],'VoiceQueueId':this[_0x66b2('0xef')][_0x595cc1[_0x66b2('0xf1')]]['VoiceQueueId']||undefined,'CampaignId':this[_0x66b2('0xef')][_0x595cc1[_0x66b2('0xf1')]][_0x66b2('0xde')]||undefined})[_0x66b2('0x9c')](loggerCatch(_0x66b2('0xfc')));delete this['actions'][_0x595cc1[_0x66b2('0xf1')]];unlockQueueStatus(_0x5817d9);}}else if(_0x1b6620===_0x66b2('0xf2')){var _0x53ef72;if(this[_0x66b2('0xef')][_0x595cc1[_0x66b2('0xf1')]]&&!_[_0x66b2('0x42')](this[_0x66b2('0x23')][this[_0x66b2('0xef')][_0x595cc1['actionid']][_0x66b2('0xbf')]])){if(this[_0x66b2('0x24')][_0x30bcc5[_0x66b2('0xef')][_0x595cc1['actionid']][_0x66b2('0xbf')]]){this[_0x66b2('0x24')][_0x30bcc5['actions'][_0x595cc1[_0x66b2('0xf1')]][_0x66b2('0xbf')]]=this[_0x66b2('0x24')][this[_0x66b2('0xef')][_0x595cc1[_0x66b2('0xf1')]]['queue']]?this[_0x66b2('0x24')][this['actions'][_0x595cc1[_0x66b2('0xf1')]][_0x66b2('0xbf')]]:this[_0x66b2('0x23')][this[_0x66b2('0xef')][_0x595cc1[_0x66b2('0xf1')]][_0x66b2('0xbf')]]?this[_0x66b2('0x23')][this[_0x66b2('0xef')][_0x595cc1[_0x66b2('0xf1')]][_0x66b2('0xbf')]]['_rr']||0x0:0x0;}this[_0x66b2('0x23')][this[_0x66b2('0xef')][_0x595cc1[_0x66b2('0xf1')]][_0x66b2('0xbf')]]['_rr']=this[_0x66b2('0x24')][this[_0x66b2('0xef')][_0x595cc1[_0x66b2('0xf1')]][_0x66b2('0xbf')]];for(var _0x58b67d=0x0;_0x58b67d=_0x5062ff['dialGlobalMaxRetry']){_0x90ac4[_0x66b2('0x121')](_0x33ca58,_0x7f7c18,_0x1b664a,'reason19\x20machine....');}else{if(_0x33ca58['countmachineretry']>=_0x5062ff[_0x66b2('0x122')]){_0x90ac4[_0x66b2('0x123')](_0x33ca58,_0x7f7c18,_0x1b664a,_0x66b2('0x124'));}else{hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x33ca58['countmachineretry'],'scheduledat':moment()[_0x66b2('0xdb')](_0x5062ff[_0x66b2('0x125')],_0x66b2('0x126'))[_0x66b2('0x3f')](_0x66b2('0xc2')),'ContactId':_0x33ca58[_0x66b2('0xdc')],'ListId':_0x33ca58[_0x66b2('0xeb')],'VoiceQueueId':_0x33ca58['VoiceQueueId']||undefined,'CampaignId':_0x33ca58[_0x66b2('0xde')]||undefined})[_0x66b2('0x9c')](loggerCatch(_0x66b2('0x127')));_0x7f7c18({'reschedule':0x1});}}});}if(_0x2bce99[_0x66b2('0x3b')]===_0x66b2('0xc3')&&this[_0x66b2('0x1a')][_0x2bce99[_0x66b2('0xbf')]][_0x66b2('0x10c')]&&_0x1c2ac9[_0x66b2('0x10d')]===_0x66b2('0x10e')){delete this[_0x66b2('0x1f')][_0x1c2ac9[_0x66b2('0xc0')]];this[_0x66b2('0xc1')](this[_0x66b2('0x1a')][_0x2bce99['queue']]);_0x16c97b=new Hangup(_0x2bce99,_0x1c2ac9);_0x16c97b[_0x66b2('0x6c')]=0x12;_0x16c97b[_0x66b2('0x6d')]=_0x66b2('0x110');_0x16c97b['membername']=_0x66b2('0x112');ami['emit']('custom:amd',ut[_0x66b2('0x115')](_0x16c97b,_0x66b2('0x116')));this[_0x66b2('0x128')](_0x16c97b,_0x66b2('0x129'),'[syncHangupInAMDIvr]');}if(_0x2bce99[_0x66b2('0x3b')]===_0x66b2('0xc3')&&this['campaigns'][_0x2bce99[_0x66b2('0xbf')]][_0x66b2('0x10c')]&&_0x1c2ac9['value']===_0x66b2('0x119')){return new Promise(function(_0x30f48a,_0x5d2eac){delete _0x90ac4['uniqueId'][_0x1c2ac9[_0x66b2('0xc0')]];_0x90ac4[_0x66b2('0xc1')](_0x90ac4[_0x66b2('0x1a')][_0x2bce99[_0x66b2('0xbf')]]);_0x90ac4[_0x66b2('0x1a')][_0x2bce99[_0x66b2('0xbf')]]['outboundAnswerCallsDay']+=0x1;_0x90ac4[_0x66b2('0x1a')][_0x2bce99[_0x66b2('0xbf')]][_0x66b2('0x10f')]+=0x1;var _0x122dad=_0x90ac4[_0x66b2('0x1a')][_0x2bce99[_0x66b2('0xbf')]];var _0x22aad0=new Hangup(_0x2bce99,_0x1c2ac9);_0x22aad0[_0x66b2('0x6c')]=0x13;_0x22aad0[_0x66b2('0x6d')]=_0x66b2('0x12a');_0x22aad0[_0x66b2('0x111')]='AMD';_0x22aad0['countmachineretry']+=0x1;_0x22aad0['countglobal']+=0x1;_0x22aad0[_0x66b2('0x116')]=!![];ami[_0x66b2('0x113')](_0x66b2('0x114'),ut[_0x66b2('0x115')](_0x22aad0,_0x66b2('0x116')));hopperUtils[_0x66b2('0xc8')](_0x22aad0)[_0x66b2('0x9c')](loggerCatch(_0x66b2('0x12b')));if(_0x22aad0[_0x66b2('0x11b')]+_0x22aad0[_0x66b2('0x11c')]+_0x22aad0[_0x66b2('0x11d')]+_0x22aad0[_0x66b2('0x11e')]+_0x22aad0[_0x66b2('0xd3')]+_0x22aad0['countabandonedretry']+_0x22aad0[_0x66b2('0x11f')]+_0x22aad0[_0x66b2('0x120')]>=_0x122dad['dialGlobalMaxRetry']){_0x90ac4[_0x66b2('0x121')](_0x22aad0,_0x30f48a,_0x5d2eac,'reason19\x20machine....');}else{if(_0x22aad0['countmachineretry']>=_0x122dad[_0x66b2('0x122')]){_0x90ac4[_0x66b2('0x123')](_0x22aad0,_0x30f48a,_0x5d2eac,'reason\x2019\x20machine....');}else{hopperUtils[_0x66b2('0xda')]({'active':![],'countmachineretry':_0x22aad0[_0x66b2('0x11f')],'scheduledat':moment()[_0x66b2('0xdb')](_0x122dad[_0x66b2('0x125')],_0x66b2('0x126'))['format'](_0x66b2('0xc2')),'ContactId':_0x22aad0['ContactId'],'ListId':_0x22aad0[_0x66b2('0xeb')],'VoiceQueueId':_0x22aad0[_0x66b2('0xdd')]||undefined,'CampaignId':_0x22aad0[_0x66b2('0xde')]||undefined})[_0x66b2('0x9c')](loggerCatch('[rescheduleContact][Machine]'));_0x30f48a({'reschedule':0x1});}}});}}};Dialer[_0x66b2('0x81')][_0x66b2('0x2f')]=function(_0x19ad7b){var _0x21e8a1=this['uniqueId'][_0x19ad7b[_0x66b2('0xc0')]];var _0x2f8041;if(_0x21e8a1&&_0x21e8a1[_0x66b2('0x3b')]===_0x66b2('0xc3')){delete this[_0x66b2('0x1f')][_0x19ad7b[_0x66b2('0xc0')]];this['updateOriginated'](this[_0x66b2('0x1a')][_0x21e8a1['queue']]);this[_0x66b2('0x1a')][_0x21e8a1['queue']][_0x66b2('0x12c')]+=0x1;_0x2f8041=new Hangup(_0x21e8a1,_0x19ad7b);hopperUtils[_0x66b2('0xc8')](_0x2f8041)[_0x66b2('0x9c')](loggerCatch(_0x66b2('0x12d')));hopperUtils['moveContactManagedDialer'](_0x2f8041)['catch'](loggerCatch(_0x66b2('0x12e')));}if(_0x21e8a1&&_0x21e8a1[_0x66b2('0x3b')]!==_0x66b2('0xc3')&&isNotNull(this[_0x66b2('0x19')][_0x21e8a1[_0x66b2('0xbf')]][_0x66b2('0x12f')])){delete this[_0x66b2('0x1f')][_0x19ad7b[_0x66b2('0xc0')]];this[_0x66b2('0xc1')](this['voiceQueues'][_0x21e8a1[_0x66b2('0xbf')]]);this['voiceQueues'][_0x21e8a1[_0x66b2('0xbf')]]['outboundAnswerCallsDay']+=0x1;this[_0x66b2('0x19')][_0x21e8a1['queue']][_0x66b2('0x10f')]+=0x1;_0x2f8041=new Hangup(_0x21e8a1,_0x19ad7b);_0x2f8041[_0x66b2('0x6c')]=0x10;_0x2f8041[_0x66b2('0x6d')]='AnswerAGI';_0x2f8041[_0x66b2('0x111')]=_0x66b2('0x130');hopperUtils[_0x66b2('0xc8')](_0x2f8041)[_0x66b2('0x9c')](loggerCatch(_0x66b2('0x12d')));hopperUtils[_0x66b2('0xca')](_0x2f8041)[_0x66b2('0x9c')](loggerCatch(_0x66b2('0x12e')));}if(_0x21e8a1&&_0x21e8a1[_0x66b2('0x3b')]!==_0x66b2('0xc3')&&!isNotNull(this[_0x66b2('0x19')][_0x21e8a1[_0x66b2('0xbf')]][_0x66b2('0x12f')])){delete this[_0x66b2('0x1f')][_0x19ad7b['uniqueid']];this[_0x66b2('0xc1')](this[_0x66b2('0x19')][_0x21e8a1[_0x66b2('0xbf')]]);this['voiceQueues'][_0x21e8a1['queue']][_0x66b2('0x131')]+=0x1;_0x2f8041=new Hangup(_0x21e8a1,_0x19ad7b);_0x2f8041[_0x66b2('0x6c')]=0xc;_0x2f8041[_0x66b2('0x6d')]=_0x19ad7b[_0x66b2('0x132')];_0x2f8041[_0x66b2('0x111')]=_0x66b2('0x133');hopperUtils[_0x66b2('0xc8')](_0x2f8041)['catch'](loggerCatch(_0x66b2('0x12d')));hopperUtils[_0x66b2('0xca')](_0x2f8041)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer['prototype']['syncQueueSummary']=function(_0x2292aa){var _0x25e4a5=this;if(!_0x25e4a5[_0x66b2('0x25')][_0x2292aa[_0x66b2('0x41')]]){_0x25e4a5[_0x66b2('0x25')][_0x2292aa[_0x66b2('0x41')]]={'running':![]};}else if(_0x25e4a5[_0x66b2('0x25')][_0x2292aa['name']][_0x66b2('0x134')]===!![]){return;}else if(_0x25e4a5[_0x66b2('0x25')][_0x2292aa[_0x66b2('0x41')]][_0x66b2('0x134')]===![]){_0x25e4a5[_0x66b2('0x25')][_0x2292aa[_0x66b2('0x41')]]['running']=!![];}var _0x400450=_0x25e4a5[_0x66b2('0x19')][_0x2292aa['name']];var _0x5dc954=_0x400450['message']!==utils[_0x66b2('0x66')]['INACTIVE'];var _0x7255fe=utils[_0x66b2('0x135')](_0x400450);_0x400450[_0x66b2('0x136')]=utils[_0x66b2('0x137')](_0x400450,_0x25e4a5[_0x66b2('0x1c')]);Promise[_0x66b2('0x138')]()[_0x66b2('0x38')](function(){if(_0x400450[_0x66b2('0x136')]===utils[_0x66b2('0x66')][_0x66b2('0x77')]){if(_0x5dc954){clearPredictiveAttributes(_0x400450);_0x2292aa[_0x66b2('0x5e')]=undefined;_0x2292aa[_0x66b2('0x21')]=undefined;}if(_0x400450[_0x66b2('0x136')]===utils[_0x66b2('0x66')][_0x66b2('0x77')]){_0x2292aa[_0x66b2('0x139')]=0x0;_0x2292aa['paused']=0x0;_0x2292aa[_0x66b2('0x13a')]=0x0;_0x2292aa[_0x66b2('0x13b')]=0x0;_0x2292aa[_0x66b2('0x13c')]=0x0;}}else if(_0x400450['statusMessage']===utils[_0x66b2('0x66')][_0x66b2('0x13d')]&&!_0x7255fe){return _0x25e4a5[_0x66b2('0xa8')](_0x400450,!![])[_0x66b2('0x38')](function(){return _0x25e4a5[_0x66b2('0xa8')](_0x400450,![]);})['then'](function(){return _0x25e4a5[_0x66b2('0xb0')](_0x400450);})[_0x66b2('0x9c')](function(_0x3ac05a){loggerSyncQueueSummary[_0x66b2('0x3d')](_0x66b2('0x13e'),util[_0x66b2('0x63')](_0x3ac05a,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x400450);});}else{clearPredictiveAttributes(_0x400450);}})['then'](function(){var _0xb056cd=_0x2292aa[_0x66b2('0x13f')](_0x400450);if(_0xb056cd||_0x400450[_0x66b2('0x140')]){_0x400450['queueSummaryCountersUpdated']=![];_0x2292aa[_0x66b2('0x141')](_0x400450);Object[_0x66b2('0x142')](_0x400450,_0x2292aa);emitOutboundVoiceQueueSummary(_0x2292aa);}_0x25e4a5[_0x66b2('0x25')][_0x400450[_0x66b2('0x41')]][_0x66b2('0x134')]=![];})[_0x66b2('0x9c')](function(_0x48f66e){logger[_0x66b2('0x61')]('[syncQueueSummary]',util[_0x66b2('0x63')](_0x48f66e,{'showHidden':![],'depth':null}));_0x25e4a5[_0x66b2('0x25')][_0x400450[_0x66b2('0x41')]][_0x66b2('0x134')]=![];});};Dialer[_0x66b2('0x81')][_0x66b2('0x143')]=_['throttle'](function(){var _0x1a1c66=_[_0x66b2('0x144')](this[_0x66b2('0x19')],function(_0xf194be){return _0xf194be['dialPreviewRecallmeReminder'];});var _0xf345a6=_[_0x66b2('0x144')](this[_0x66b2('0x1b')],function(_0x5483c1){return _0x5483c1[_0x66b2('0x145')]&&_0x5483c1[_0x66b2('0x85')]==='reachable';});if(_0x1a1c66[_0x66b2('0x97')]>0x0&&_0xf345a6[_0x66b2('0x97')]>0x0){return Promise[_0x66b2('0x138')]()[_0x66b2('0x38')](cmHopper['handlePreviewRecallNotifications'](_[_0x66b2('0x146')](_0x1a1c66,'id'),previewRecallmeReminderInterval,_[_0x66b2('0x146')](_0xf345a6,'id')))['then'](function(_0x456779){for(var _0x462fea=0x0;_0x462fea<_0x456779['length'];_0x462fea++){var _0x5a9529=_0x456779[_0x462fea]['Agent'][_0x66b2('0x41')];if(_0x5a9529)io['to'](util['format']('user:%s',_0x5a9529))[_0x66b2('0x113')](_0x66b2('0x147'),{'hopper':_0x456779[_0x462fea]});}})[_0x66b2('0x9c')](function(_0x40cf8f){logger[_0x66b2('0x61')](_0x66b2('0x148'),_0x40cf8f);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0x66b2('0x81')]['loopClearZombieChannels']=function(){var _0x284847=this;setInterval(function(){_0x284847[_0x66b2('0x149')](_0x284847[_0x66b2('0x1f')],_0x66b2('0x14a'));_0x284847[_0x66b2('0x149')](_0x284847[_0x66b2('0xef')],'[actions]');},0x32c8);};Dialer['prototype']['clearZombieChannels']=function(_0x3c3a70,_0x347bc9){var _0x39a18c=this;for(var _0x225ec6 in _0x3c3a70){if(typeof _0x3c3a70[_0x225ec6]!==_0x66b2('0xab')){this['sequence'][_0x66b2('0x14')](function(){if(!_['isNil'](_0x3c3a70[_0x225ec6])){return ami[_0x66b2('0x98')]({'action':_0x66b2('0x85'),'channel':_0x3c3a70[_0x225ec6][_0x66b2('0xf0')]})['catch'](function(_0x37b412){if(_0x37b412[_0x66b2('0x6a')]===_0x66b2('0x14b')){setTimeout(function(){if(_0x3c3a70[_0x225ec6]&&_0x3c3a70[_0x225ec6][_0x66b2('0x3b')]!==_0x66b2('0xc3')){_0x39a18c[_0x66b2('0xc1')](_0x39a18c['voiceQueues'][_0x3c3a70[_0x225ec6][_0x66b2('0xbf')]]);logger[_0x66b2('0x61')](_0x66b2('0x14c'),_0x347bc9,_0x225ec6,_0x3c3a70[_0x225ec6][_0x66b2('0xbf')]);delete _0x3c3a70[_0x225ec6];}if(_0x3c3a70[_0x225ec6]&&_0x3c3a70[_0x225ec6]['type']===_0x66b2('0xc3')){_0x39a18c['updateOriginated'](_0x39a18c[_0x66b2('0x1a')][_0x3c3a70[_0x225ec6][_0x66b2('0xbf')]]);logger[_0x66b2('0x61')](_0x66b2('0x14d'),_0x347bc9,_0x225ec6,_0x3c3a70[_0x225ec6][_0x66b2('0xbf')]);delete _0x3c3a70[_0x225ec6];}},0x2328);}});}});}}};Dialer['prototype'][_0x66b2('0x14e')]=function(_0x465284){return Promise[_0x66b2('0x138')]()[_0x66b2('0x38')](voiceQueueRt[_0x66b2('0x14e')](_0x465284))[_0x66b2('0x9c')](loggerCatch(_0x66b2('0x14f')));};Dialer['prototype']['updateOriginated']=function(_0x3b3e29){if(!_[_0x66b2('0x3a')](_0x3b3e29)&&_0x3b3e29!==null){if(typeof _0x3b3e29['originated']!==_0x66b2('0xab')){if(_0x3b3e29['originated']>0x0){_0x3b3e29[_0x66b2('0x7b')]-=0x1;}else{logger[_0x66b2('0x61')](_0x66b2('0x150'));}}}else{logger[_0x66b2('0x61')](_0x66b2('0x151'));}};Dialer[_0x66b2('0x81')][_0x66b2('0x152')]=function(_0x2455a5,_0x52036f){var _0x3d9b3a=this;return function(_0x470387){_0x3d9b3a[_0x66b2('0xc1')](_0x52036f);logger[_0x66b2('0x61')](_0x2455a5,util[_0x66b2('0x63')](_0x470387,{'showHidden':![],'depth':null}));};};Dialer[_0x66b2('0x81')][_0x66b2('0x153')]=function(_0x5f0c2f,_0x1687c7,_0x3e5cde){var _0x73b821={'state':0x19,'statedesc':'notFound'};this[_0x66b2('0xc1')](_0x1687c7);this[_0x66b2('0x128')](_[_0x66b2('0x5c')](_0x73b821,_[_0x66b2('0x72')](_0x3e5cde,[_0x66b2('0xdc'),_0x66b2('0xeb'),_0x66b2('0x154'),_0x66b2('0xdd'),_0x66b2('0xde')])),_0x66b2('0x155'),'[emptyContact]');logger['error'](_0x5f0c2f);};Dialer[_0x66b2('0x81')][_0x66b2('0x128')]=function(_0x5f2143,_0x5cb28e,_0x2fdc98){hopperUtils[_0x66b2('0xc8')](_0x5f2143)[_0x66b2('0x9c')](loggerCatch(_0x5cb28e));hopperUtils[_0x66b2('0xca')](_0x5f2143)[_0x66b2('0x9c')](loggerCatch(_0x2fdc98));};Dialer[_0x66b2('0x81')][_0x66b2('0xd9')]=function(_0x9517ee,_0x2cdc61){hopperUtils[_0x66b2('0xc8')](_0x9517ee)['catch'](loggerCatch(_0x66b2('0xc9')));if(_0x2cdc61==0x0){hopperUtils[_0x66b2('0xca')](_0x9517ee)['catch'](loggerCatch(_0x66b2('0x156')));}};Dialer[_0x66b2('0x81')]['checkPreviewRecallReminder']=function(_0x2a8b5c){return Promise['resolve']()[_0x66b2('0x38')](cmHopper['handlePreviewRecallNotifications'](_0x2a8b5c['id'],previewRecallmeReminderInterval))[_0x66b2('0x38')](function(_0x4659eb){for(var _0x20c40c=0x0;_0x20c40c<_0x4659eb['length'];_0x20c40c++){var _0x3276cc=_0x4659eb[_0x20c40c][_0x66b2('0x157')][_0x66b2('0x41')];if(_0x3276cc)io['to'](util[_0x66b2('0x3f')](_0x66b2('0x158'),_0x3276cc))[_0x66b2('0x113')]('user:dialPreviewRecallReminder',{'hopper':_0x4659eb[_0x20c40c]});}})[_0x66b2('0x9c')](function(){});};Dialer[_0x66b2('0x81')]['launchHandleIvr']=function(_0x23b619){var _0x179a86=this;return function(){_0x179a86[_0x66b2('0x159')](_0x23b619);};};Dialer[_0x66b2('0x81')][_0x66b2('0x15a')]=function(_0x22859b,_0x18eab9){var _0x2ae11c=this;var _0x4cae6b=uuid['v4']();this[_0x66b2('0xef')][_0x4cae6b]=new Action(_0x22859b,_0x18eab9,_0x4cae6b);return new Promise(function(_0x50f3e5,_0x751b17){if(_['isUndefined'](_0x22859b)&&typeof _0x22859b!=='object'){return _0x751b17(msgResponse('originate','Failure',_0x66b2('0x15b')));}if(_[_0x66b2('0x3a')](_0x18eab9[_0x66b2('0x15c')])||_0x18eab9[_0x66b2('0x15c')]===null){return _0x751b17(msgResponse(_0x66b2('0x15d'),_0x66b2('0x90'),'contact\x20is\x20undefine'));}var _0x369f9c={'XMD-CALLERID':_0x2ae11c[_0x66b2('0xef')][_0x4cae6b][_0x66b2('0x15e')](),'XMD-AGI':_0x22859b[_0x66b2('0x12f')]?util[_0x66b2('0x3f')]('\x22agi://%s/square,%s\x22',ipAgi,_0x22859b['dialQueueProject']):_0x66b2('0x15f'),'XMD-AGIAFTER':_0x22859b['dialQueueProject2']?util[_0x66b2('0x3f')](_0x66b2('0x160'),ipAgi,_0x22859b[_0x66b2('0xc6')]):_0x66b2('0x15f'),'XMD-QUEUE':utils[_0x66b2('0x161')](_0x22859b)?util[_0x66b2('0x3f')](_0x66b2('0x162'),_0x22859b[_0x66b2('0x41')],_0x22859b[_0x66b2('0x163')]||'',_0x22859b[_0x66b2('0xc7')]?'c':'',_0x22859b['dialQueueTimeout']||0x3):_0x66b2('0x15f'),'XMD-CONTACTID':_0x18eab9[_0x66b2('0xdc')],'XMD-CDRTYPE':_0x66b2('0x8'),'CALLERID(all)':_0x2ae11c[_0x66b2('0xef')][_0x4cae6b]['getCaller'](),'XMD-AMD':_0x22859b[_0x66b2('0x10c')]?_0x66b2('0x13d'):_0x66b2('0x15f'),'XMD-DESTINATION':_0x66b2('0x10b')};if(_0x22859b[_0x66b2('0x10c')]){_0x369f9c[_0x66b2('0x164')]=_0x22859b[_0x66b2('0x165')]||0x9c4;_0x369f9c['XMD-AMDGREETING']=_0x22859b[_0x66b2('0x166')]||0x5dc;_0x369f9c[_0x66b2('0x167')]=_0x22859b['dialAMDAfterGreetingSilence']||0x320;_0x369f9c[_0x66b2('0x168')]=_0x22859b[_0x66b2('0x169')]||0x1388;_0x369f9c[_0x66b2('0x16a')]=_0x22859b['dialAMDMinWordLength']||0x64;_0x369f9c[_0x66b2('0x16b')]=_0x22859b[_0x66b2('0x16c')]||0x32;_0x369f9c[_0x66b2('0x16d')]=_0x22859b[_0x66b2('0x16e')]||0x3;_0x369f9c[_0x66b2('0x16f')]=_0x22859b[_0x66b2('0x170')]||0x100;_0x369f9c[_0x66b2('0x171')]=_0x22859b['dialAMDMaximumWordLength']||0x1388;}if(utils['isOutboundQueue'](_0x22859b)){_0x369f9c[_0x66b2('0x172')]=_0x18eab9['VoiceQueueId'];}else{_0x369f9c['XMD-CAMPAIGNID']=_0x18eab9[_0x66b2('0xde')];}for(var _0x294d85 in _0x18eab9[_0x66b2('0x173')]){if(typeof _0x18eab9[_0x66b2('0x173')][_0x294d85]!==_0x66b2('0xab')){if(isNotNull(_0x18eab9[_0x66b2('0x173')][_0x294d85])&&_0x294d85!=='id'&&_0x294d85!=='tags'&&_0x294d85!==_0x66b2('0x174')&&_0x294d85!==_0x66b2('0x175')){_0x369f9c[util[_0x66b2('0x3f')](_0x66b2('0x176'),'XMD-',_[_0x66b2('0x177')](_0x294d85))]=_0x18eab9[_0x66b2('0x173')][_0x294d85];}}}var _0x2f5d50=_0x2ae11c[_0x66b2('0x82')](_0x22859b[_0x66b2('0x89')])?utils[_0x66b2('0x178')](_0x22859b[_0x66b2('0x89')][_0x66b2('0x179')],_0x22859b[_0x66b2('0x17a')],_0x22859b['dialRandomLastDigitCallerIdNumber']>0x0?utils['getCallerIdRandom'](_0x22859b[_0x66b2('0x17b')],_0x22859b['dialRandomLastDigitCallerIdNumber']):_0x22859b[_0x66b2('0x17b')]):utils[_0x66b2('0x178')](_[_0x66b2('0xf4')](_0x22859b[_0x66b2('0x8a')])?_0x22859b[_0x66b2('0x89')][_0x66b2('0x179')]:_0x22859b[_0x66b2('0x8a')][_0x66b2('0x179')],_0x22859b['dialOriginateCallerIdName'],_0x22859b[_0x66b2('0x17c')]>0x0?utils[_0x66b2('0x17d')](_0x22859b[_0x66b2('0x17b')],_0x22859b[_0x66b2('0x17c')]):_0x22859b[_0x66b2('0x17b')]);if(_0x2f5d50){_0x369f9c[_0x66b2('0x17e')]=_0x2ae11c[_0x66b2('0xef')][_0x4cae6b]['originatecalleridname']=utils[_0x66b2('0x17f')](_0x2f5d50);_0x369f9c['XMD-ORIGINATECALLERIDNUM']=_0x18eab9[_0x66b2('0x15c')];}_0x22859b[_0x66b2('0x180')]=_0x369f9c;return ami['Action']({'actionid':_0x4cae6b,'action':'originate','channel':_0x2ae11c[_0x66b2('0x82')](_0x22859b[_0x66b2('0x89')])?util[_0x66b2('0x3f')](_0x66b2('0x181'),_0x22859b[_0x66b2('0x89')][_0x66b2('0x41')],isNotNull(_0x22859b[_0x66b2('0x182')])?_0x22859b[_0x66b2('0x182')]['trim']()||'':'',_0x22859b['dialCutDigit']>0x0?_0x18eab9[_0x66b2('0x15c')]['substring'](_0x22859b[_0x66b2('0x183')]):_0x18eab9[_0x66b2('0x15c')]):util['format'](_0x66b2('0x181'),_['isNil'](_0x22859b['TrunkBackup'])?_0x22859b['Trunk']['name']:_0x22859b[_0x66b2('0x8a')][_0x66b2('0x41')],isNotNull(_0x22859b[_0x66b2('0x182')])?_0x22859b[_0x66b2('0x182')][_0x66b2('0x184')]()||'':'',_0x22859b[_0x66b2('0x183')]>0x0?_0x18eab9[_0x66b2('0x15c')][_0x66b2('0x185')](_0x22859b[_0x66b2('0x183')]):_0x18eab9[_0x66b2('0x15c')]),'callerid':_0x2f5d50,'Exten':_0x66b2('0x10b'),'Context':_0x66b2('0x186'),'Priority':'1','variable':_0x369f9c,'timeout':(_0x22859b['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x4cae6b})[_0x66b2('0x38')](function(_0x29e163){return _0x50f3e5(_0x29e163);})['catch'](function(_0x263bf3){_0x22859b[_0x66b2('0x187')]+=0x1;var _0x2fbe1b=new History(_0x2ae11c['actions'][_0x4cae6b]);logger[_0x66b2('0x61')](util[_0x66b2('0x3f')](_0x66b2('0x188'),JSON['stringify'](_0x263bf3)));_0x2fbe1b[_0x66b2('0x6c')]=0xe;_0x2fbe1b[_0x66b2('0x6d')]='OriginateError';_0x2fbe1b[_0x66b2('0x6f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2fbe1b[_0x66b2('0x6e')]=_0x2fbe1b[_0x66b2('0x6f')];hopperUtils[_0x66b2('0xc8')](_0x2fbe1b)[_0x66b2('0x9c')](loggerCatch(_0x66b2('0x189')));_0x2ae11c['moveContactManagedDialer'](_0x2fbe1b)[_0x66b2('0x9c')](loggerCatch('[originate][error]'))[_0x66b2('0x16')](function(){delete _0x2ae11c[_0x66b2('0xef')][_0x4cae6b];return _0x751b17(msgResponse(_0x66b2('0x15d'),'Error',_0x66b2('0x18a')));});});});};Dialer[_0x66b2('0x81')]['checkRetriveMax']=function(_0x3db881,_0x434bf0,_0x5a7edb){var _0x5011f1=new History(_0x434bf0);if(_0x5011f1[_0x66b2('0x11b')]+_0x5011f1['countcongestionretry']+_0x5011f1['countnoanswerretry']+_0x5011f1[_0x66b2('0x11e')]+_0x5011f1['countdropretry']+_0x5011f1[_0x66b2('0xe6')]+_0x5011f1[_0x66b2('0x11f')]+_0x5011f1[_0x66b2('0x120')]>=_0x5a7edb['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x3db881){case 0x3:if(_0x5011f1[_0x66b2('0x11d')]>=_0x5a7edb[_0x66b2('0x18b')]-0x1){return!![];}hopperUtils[_0x66b2('0xda')]({'active':![],'countnoanswerretry':_0x5011f1['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x66b2('0xdb')](_0x5a7edb['dialNoAnswerRetryFrequency'],_0x66b2('0x126'))[_0x66b2('0x3f')](_0x66b2('0xc2')),'ContactId':_0x5011f1['ContactId'],'ListId':_0x5011f1[_0x66b2('0xeb')],'VoiceQueueId':_0x5011f1[_0x66b2('0xdd')]||undefined,'CampaignId':_0x5011f1['CampaignId']||undefined})[_0x66b2('0x9c')](loggerCatch(_0x66b2('0x18c')));break;case 0x5:if(_0x5011f1['countbusyretry']>=_0x5a7edb[_0x66b2('0x18d')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countbusyretry':_0x5011f1[_0x66b2('0x11b')]+=0x1,'scheduledat':moment()[_0x66b2('0xdb')](_0x5a7edb[_0x66b2('0x18e')],_0x66b2('0x126'))[_0x66b2('0x3f')](_0x66b2('0xc2')),'ContactId':_0x5011f1[_0x66b2('0xdc')],'ListId':_0x5011f1[_0x66b2('0xeb')],'VoiceQueueId':_0x5011f1[_0x66b2('0xdd')]||undefined,'CampaignId':_0x5011f1[_0x66b2('0xde')]||undefined})['catch'](loggerCatch(_0x66b2('0x18f')));break;case 0x8:if(_0x5011f1[_0x66b2('0x11c')]>=_0x5a7edb[_0x66b2('0x190')]-0x1){return!![];}hopperUtils[_0x66b2('0xda')]({'active':![],'countcongestionretry':_0x5011f1['countcongestionretry']+=0x1,'scheduledat':moment()[_0x66b2('0xdb')](_0x5a7edb[_0x66b2('0x191')],_0x66b2('0x126'))['format'](_0x66b2('0xc2')),'ContactId':_0x5011f1['ContactId'],'ListId':_0x5011f1[_0x66b2('0xeb')],'VoiceQueueId':_0x5011f1['VoiceQueueId']||undefined,'CampaignId':_0x5011f1[_0x66b2('0xde')]||undefined})['catch'](loggerCatch(_0x66b2('0x192')));break;case 0x0:if(_0x5011f1[_0x66b2('0x11e')]>=_0x5a7edb[_0x66b2('0x193')]-0x1){return!![];}else{hopperUtils[_0x66b2('0xda')]({'active':![],'countnosuchnumberretry':_0x5011f1[_0x66b2('0x11e')]+=0x1,'scheduledat':moment()['add'](_0x5a7edb[_0x66b2('0x194')],_0x66b2('0x126'))[_0x66b2('0x3f')](_0x66b2('0xc2')),'ContactId':_0x5011f1[_0x66b2('0xdc')],'ListId':_0x5011f1[_0x66b2('0xeb')],'VoiceQueueId':_0x5011f1[_0x66b2('0xdd')]||undefined,'CampaignId':_0x5011f1['CampaignId']||undefined})[_0x66b2('0x9c')](loggerCatch(_0x66b2('0x195')));}break;case 0xa:if(_0x5011f1[_0x66b2('0xd3')]>=_0x5a7edb[_0x66b2('0xd8')]-0x1){return!![];}hopperUtils[_0x66b2('0xda')]({'active':![],'countdropretry':_0x5011f1[_0x66b2('0xd3')]+=0x1,'scheduledat':moment()[_0x66b2('0xdb')](_0x5a7edb[_0x66b2('0xd4')],_0x66b2('0x126'))[_0x66b2('0x3f')](_0x66b2('0xc2')),'ContactId':_0x5011f1[_0x66b2('0xdc')],'ListId':_0x5011f1[_0x66b2('0xeb')],'VoiceQueueId':_0x5011f1[_0x66b2('0xdd')]||undefined,'CampaignId':_0x5011f1[_0x66b2('0xde')]||undefined})[_0x66b2('0x9c')](loggerCatch(_0x66b2('0xdf')));break;case 0xb:if(_0x5011f1[_0x66b2('0xe6')]>=_0x5a7edb[_0x66b2('0xea')]-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countabandonedretry':_0x5011f1['countabandonedretry']+=0x1,'scheduledat':moment()['add'](_0x5a7edb[_0x66b2('0xe8')],_0x66b2('0x126'))[_0x66b2('0x3f')](_0x66b2('0xc2')),'ContactId':_0x5011f1['ContactId'],'ListId':_0x5011f1[_0x66b2('0xeb')],'VoiceQueueId':_0x5011f1[_0x66b2('0xdd')]||undefined,'CampaignId':_0x5011f1[_0x66b2('0xde')]||undefined})['catch'](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x5011f1[_0x66b2('0x11f')]>=_0x5a7edb[_0x66b2('0x122')]-0x1){return!![];}hopperUtils[_0x66b2('0xda')]({'active':![],'countmachineretry':_0x5011f1[_0x66b2('0x11f')]+=0x1,'scheduledat':moment()[_0x66b2('0xdb')](_0x5a7edb[_0x66b2('0x125')],'minutes')[_0x66b2('0x3f')](_0x66b2('0xc2')),'ContactId':_0x5011f1[_0x66b2('0xdc')],'ListId':_0x5011f1[_0x66b2('0xeb')],'VoiceQueueId':_0x5011f1['VoiceQueueId']||undefined,'CampaignId':_0x5011f1[_0x66b2('0xde')]||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x5011f1[_0x66b2('0x120')]>=_0x5a7edb[_0x66b2('0x196')]-0x1){return!![];}hopperUtils[_0x66b2('0xda')]({'active':![],'countagentrejectretry':_0x5011f1[_0x66b2('0x120')]+=0x1,'scheduledat':moment()[_0x66b2('0xdb')](_0x5a7edb[_0x66b2('0x197')],_0x66b2('0x126'))[_0x66b2('0x3f')](_0x66b2('0xc2')),'ContactId':_0x5011f1[_0x66b2('0xdc')],'ListId':_0x5011f1[_0x66b2('0xeb')],'VoiceQueueId':_0x5011f1[_0x66b2('0xdd')]||undefined,'CampaignId':_0x5011f1[_0x66b2('0xde')]||undefined})[_0x66b2('0x9c')](loggerCatch(_0x66b2('0x198')));break;default:return!![];}};Dialer[_0x66b2('0x81')][_0x66b2('0x107')]=function(_0x4f7ca9,_0x3179d9,_0x1b228c){var _0x551d4f=this;var _0x45f846=new History(_0x4f7ca9);var _0x422d86=![];var _0x400ef9;var _0x3a6a95;return new Promise(function(_0x386b80,_0x573a71){if(_[_0x66b2('0x3a')](_0x3179d9)&&typeof _0x3179d9!==_0x66b2('0x199')){return _0x573a71(msgResponse(_0x66b2('0x19a'),_0x66b2('0x90'),_0x66b2('0x19b')));}if(_['isUndefined'](_0x1b228c)&&typeof _0x1b228c!==_0x66b2('0x199')){return _0x573a71(msgResponse(_0x66b2('0x19a'),_0x66b2('0x90'),_0x66b2('0x19c')));}hopperUtils['verifyAdditionalPhones'](_0x45f846,_0x1b228c['reason'],_0x3179d9)[_0x66b2('0x38')](function(_0x5c3c0f){if(_0x5c3c0f[_0x66b2('0xd7')]==0x1)_0x422d86=!![];switch(_0x1b228c[_0x66b2('0x19d')]){case'0':_0x3179d9[_0x66b2('0x19e')]+=0x1;_0x45f846['state']=0x0;_0x45f846['statedesc']=_0x66b2('0x19f');_0x45f846[_0x66b2('0x11e')]+=0x1;_0x45f846['countglobal']+=0x1;ami['emit']('custom:agentnosuchnumber',ut[_0x66b2('0x115')](_0x4f7ca9,_0x66b2('0x1a0')));_0x400ef9=_0x3179d9[_0x66b2('0x194')];_0x3a6a95=_0x3179d9[_0x66b2('0xd5')];hopperUtils[_0x66b2('0xc8')](_0x45f846)['catch'](loggerCatch(_0x66b2('0x12b')));if(_0x551d4f['checkRetriveMax'](0x0,_0x4f7ca9,_0x3179d9)&&!_0x422d86){if(_0x45f846['countnosuchnumberretry']>=_0x3179d9[_0x66b2('0x193')]){_0x551d4f[_0x66b2('0x123')](_0x45f846,_0x386b80,_0x573a71,_0x66b2('0x1a1'));}else{_0x551d4f[_0x66b2('0x121')](_0x45f846,_0x386b80,_0x573a71,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x3179d9['outboundNoAnswerCallsDay']+=0x1;_0x45f846['state']=0x3;_0x45f846[_0x66b2('0x6d')]=_0x66b2('0x1a2');_0x45f846['countnoanswerretry']+=0x1;_0x45f846[_0x66b2('0xe7')]+=0x1;var _0x2ea9a=ut[_0x66b2('0x1a3')](_0x4f7ca9,_0x3179d9);ami[_0x66b2('0x113')](_0x66b2('0x1a4'),_0x2ea9a);_0x400ef9=_0x3179d9[_0x66b2('0x1a5')];_0x3a6a95=_0x3179d9[_0x66b2('0xd5')];hopperUtils[_0x66b2('0xc8')](_0x45f846)[_0x66b2('0x9c')](loggerCatch(_0x66b2('0x1a6')));if(_0x551d4f['checkRetriveMax'](0x3,_0x4f7ca9,_0x3179d9)&&!_0x422d86){if(_0x45f846[_0x66b2('0x11d')]>=_0x3179d9[_0x66b2('0x18b')]){_0x551d4f[_0x66b2('0x123')](_0x45f846,_0x386b80,_0x573a71,_0x66b2('0x1a7'));}else{_0x551d4f[_0x66b2('0x121')](_0x45f846,_0x386b80,_0x573a71,_0x66b2('0x1a7'));}}break;case'5':_0x3179d9[_0x66b2('0x1a8')]+=0x1;_0x45f846[_0x66b2('0x6c')]=0x5;_0x45f846[_0x66b2('0x6d')]=_0x66b2('0x1a9');_0x45f846['countbusyretry']+=0x1;_0x45f846['countglobal']+=0x1;ami['emit']('custom:agentbusy',ut[_0x66b2('0x115')](_0x4f7ca9,_0x66b2('0x1aa')));_0x400ef9=_0x3179d9[_0x66b2('0x18e')];_0x3a6a95=_0x3179d9['callAdditionalPhoneAfterMin'];hopperUtils['createHistory'](_0x45f846)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x551d4f[_0x66b2('0x1ab')](0x5,_0x4f7ca9,_0x3179d9)&&!_0x422d86){if(_0x45f846[_0x66b2('0x11b')]>=_0x3179d9[_0x66b2('0x18d')]){_0x551d4f[_0x66b2('0x123')](_0x45f846,_0x386b80,_0x573a71,_0x66b2('0x1ac'));}else{_0x551d4f[_0x66b2('0x121')](_0x45f846,_0x386b80,_0x573a71,_0x66b2('0x1ac'));}}break;case'8':_0x3179d9[_0x66b2('0x1ad')]+=0x1;_0x45f846[_0x66b2('0x6c')]=0x8;_0x45f846[_0x66b2('0x6d')]=_0x66b2('0x1ae');_0x45f846[_0x66b2('0x11c')]+=0x1;_0x45f846[_0x66b2('0xe7')]+=0x1;_0x400ef9=_0x3179d9[_0x66b2('0x191')];_0x3a6a95=_0x3179d9[_0x66b2('0xd5')];ami['emit'](_0x66b2('0x1af'),ut[_0x66b2('0x115')](_0x4f7ca9,'congestion'));hopperUtils[_0x66b2('0xc8')](_0x45f846)[_0x66b2('0x9c')](loggerCatch(_0x66b2('0x1b0')));if(_0x551d4f['checkRetriveMax'](0x8,_0x4f7ca9,_0x3179d9)&&!_0x422d86){if(_0x45f846['countcongestionretry']>=_0x3179d9[_0x66b2('0x190')]){_0x551d4f[_0x66b2('0x123')](_0x45f846,_0x386b80,_0x573a71,_0x66b2('0x1b1'));}else{_0x551d4f['stateGlobal'](_0x45f846,_0x386b80,_0x573a71,'reason\x208\x20congestion');}}break;case'11':_0x3179d9[_0x66b2('0x1b2')]+=0x1;_0x45f846[_0x66b2('0x6c')]=0xb;_0x45f846[_0x66b2('0x6d')]='Abandoned';_0x45f846[_0x66b2('0xe6')]+=0x1;_0x45f846['countglobal']+=0x1;_0x400ef9=_0x3179d9['dialAbandonedRetryFrequency'];_0x3a6a95=_0x3179d9['callAdditionalPhoneAfterMin'];hopperUtils[_0x66b2('0xc8')](_0x45f846)[_0x66b2('0x9c')](loggerCatch(_0x66b2('0xee')));if(_0x551d4f['checkRetriveMax'](0xb,_0x4f7ca9,_0x3179d9)&&!_0x422d86){if(_0x45f846[_0x66b2('0xe6')]>=_0x3179d9[_0x66b2('0xea')]){_0x551d4f[_0x66b2('0x123')](_0x45f846,_0x386b80,_0x573a71,_0x66b2('0x1b3'));}else{_0x551d4f[_0x66b2('0x121')](_0x45f846,_0x386b80,_0x573a71,_0x66b2('0x1b3'));}}break;case'20':_0x3179d9[_0x66b2('0x1b4')]+=0x1;_0x45f846['state']=0x14;_0x45f846['statedesc']=_0x66b2('0x1b5');_0x45f846[_0x66b2('0x120')]+=0x1;_0x45f846[_0x66b2('0xe7')]+=0x1;_0x400ef9=_0x3179d9['dialAgentRejectRetryFrequency'];_0x3a6a95=_0x3179d9[_0x66b2('0xd5')];ami['emit'](_0x66b2('0x1b6'),ut['buildObj'](_0x4f7ca9,'agentreject'));hopperUtils[_0x66b2('0xc8')](_0x45f846)[_0x66b2('0x9c')](loggerCatch(_0x66b2('0x1b7')));if(_0x551d4f[_0x66b2('0x1ab')](0x14,_0x4f7ca9,_0x3179d9)&&!_0x422d86){if(_0x45f846[_0x66b2('0x120')]>=_0x3179d9[_0x66b2('0x196')]){_0x551d4f[_0x66b2('0x123')](_0x45f846,_0x386b80,_0x573a71,_0x66b2('0x1b8'));}else{_0x551d4f['stateGlobal'](_0x45f846,_0x386b80,_0x573a71,'reason\x2020\x20agentreject');}}break;default:_0x3179d9['outboundUnknownCallsDay']+=0x1;_0x45f846['state']=0xc;_0x45f846[_0x66b2('0x6d')]=_0x1b228c[_0x66b2('0x19d')];_0x400ef9=_0x3179d9[_0x66b2('0x197')];_0x3a6a95=_0x3179d9[_0x66b2('0xd5')];hopperUtils['createHistory'](_0x45f846)['catch'](loggerCatch(_0x66b2('0x1b9')));if(_0x551d4f[_0x66b2('0x1ab')](_0x1b228c[_0x66b2('0x19d')],_0x4f7ca9,_0x3179d9)&&!_0x422d86){if(_0x45f846[_0x66b2('0x11b')]+_0x45f846[_0x66b2('0x11c')]+_0x45f846['countnoanswerretry']+_0x45f846['countnosuchnumberretry']+_0x45f846[_0x66b2('0xd3')]+_0x45f846[_0x66b2('0xe6')]+_0x45f846[_0x66b2('0x11f')]+_0x45f846[_0x66b2('0x120')]>=_0x3179d9[_0x66b2('0x1ba')]){_0x551d4f[_0x66b2('0x121')](_0x45f846,_0x386b80,_0x573a71,_0x1b228c[_0x66b2('0x19d')]);}else{_0x551d4f['createStateFinal'](_0x45f846,_0x386b80,_0x573a71,_0x1b228c['reason']);}}}})[_0x66b2('0x38')](function(){if(_0x422d86){hopperUtils[_0x66b2('0xe3')](_0x45f846,_0x400ef9,_0x3a6a95)[_0x66b2('0x38')](function(){return _0x386b80(0x1);});}});});};Dialer[_0x66b2('0x81')][_0x66b2('0x121')]=function(_0x2237c9,_0x30886d,_0x557d2e,_0x11180a){var _0x433b04=new Final(_0x2237c9);_0x433b04[_0x66b2('0x6c')]=0xf;_0x433b04[_0x66b2('0x6d')]=_0x66b2('0x1bb');this[_0x66b2('0x123')](_0x433b04,_0x30886d,_0x557d2e,_0x11180a);};Dialer[_0x66b2('0x81')]['createStateFinal']=function(_0x1b66c0,_0x251779,_0xa10206,_0x4ba9b7){hopperUtils['moveContactManagedDialer'](_0x1b66c0)[_0x66b2('0x38')](function(){return _0x251779(msgResponse(_0x66b2('0x19a'),'Success',_0x4ba9b7));})[_0x66b2('0x9c')](function(){return _0xa10206(msgResponse(_0x66b2('0x1bc'),'Failure',_0x66b2('0x1bd')));});};Dialer[_0x66b2('0x81')][_0x66b2('0x9')]=function(_0x486ed7){var _0x3d2cc1=_0x486ed7[_0x66b2('0x1be')]/0x64;var _0x46207e=_0x486ed7['outboundDropCallsDayTimeout']/(_0x486ed7[_0x66b2('0xd1')]+_0x486ed7[_0x66b2('0x11a')]);var _0x2151b8=Math[_0x66b2('0x1bf')](_0x486ed7[_0x66b2('0x1c0')]*(_0x486ed7[_0x66b2('0x1c1')]/0x64));var _0x101e04=Math['round'](_0x486ed7[_0x66b2('0x1c0')]*(_0x486ed7[_0x66b2('0x1c2')]/0x64));var _0x4a3738=_0x486ed7[_0x66b2('0x139')]+_0x486ed7[_0x66b2('0x13b')];var _0x1305f7=Math['floor'](_0x486ed7[_0x66b2('0x55')]*_0x486ed7[_0x66b2('0x58')]*_0x486ed7['predictiveIntervalHitRate']*_0x486ed7[_0x66b2('0x1c3')]);if(_[_0x66b2('0x3a')](_0x486ed7['startProgressive'])){if(!_[_0x66b2('0x3a')](_0x486ed7['startPredictive'])){_0x486ed7[_0x66b2('0x5e')]=undefined;loggerPredictive['error'](_0x66b2('0x1c4'),_0x66b2('0x1c5'));}if(!_['isUndefined'](_0x486ed7['handlePredictive'])){loggerPredictive[_0x66b2('0x61')](_0x66b2('0x1c4'),_0x66b2('0x1c6'));clearInterval(_0x486ed7['handlePredictive']);_0x486ed7[_0x66b2('0x60')]=undefined;}_0x486ed7[_0x66b2('0x21')]=moment()[_0x66b2('0x3f')](_0x66b2('0xc2'));loggerPredictive[_0x66b2('0x43')](_0x486ed7['name'],'collection\x20data\x20in\x20progressive\x20at',_0x486ed7[_0x66b2('0x21')]);this[_0x66b2('0xb3')](_0x486ed7,0x1);}else if(ifInterval(_0x486ed7[_0x66b2('0x1c7')],_0x486ed7['startProgressive'])){this[_0x66b2('0xb3')](_0x486ed7,0x1);loggerPredictiveCalls[_0x66b2('0x43')](_0x66b2('0x1c8'),_0x486ed7['startProgressive'],_0x486ed7['name']);_0x486ed7[_0x66b2('0x55')]=0x0;_0x486ed7[_0x66b2('0x1c9')]=0x0;}else if(_0x3d2cc1<_0x46207e&&_0x486ed7[_0x66b2('0x1ca')]==='dropRate'){clearPredictiveAttributes(_0x486ed7);loggerPredictive['info'](_0x66b2('0x1cb'),'Dropped\x20calls\x20day',_0x46207e,_0x66b2('0x21'),_0x486ed7['name']);}else if(_0x1305f7<_0x486ed7[_0x66b2('0x1c9')]&&_0x486ed7['dialPredictiveOptimization']==='dropRate'){clearPredictiveAttributes(_0x486ed7);loggerPredictive['info'](_0x66b2('0x1cc'),_0x66b2('0x1cd'),_0x1305f7,'Drop\x20in\x20this\x20interval',_0x486ed7[_0x66b2('0x1c9')],_0x66b2('0x21'),_0x486ed7[_0x66b2('0x41')]);}else if(!ifInterval(_0x486ed7[_0x66b2('0x1c7')],_0x486ed7[_0x66b2('0x21')])&&_[_0x66b2('0x3a')](_0x486ed7[_0x66b2('0x5e')])&&!_[_0x66b2('0x3a')](_0x486ed7[_0x66b2('0x21')])){_0x486ed7[_0x66b2('0x5e')]=moment()[_0x66b2('0x3f')](_0x66b2('0xc2'));loggerPredictive[_0x66b2('0x43')](_0x486ed7[_0x66b2('0x41')],_0x66b2('0x1ce'),_0x486ed7['startPredictive']);hopperUtils['avgHandleTime'](_0x486ed7[_0x66b2('0x1c7')])[_0x66b2('0x38')](this[_0x66b2('0x1cf')](_0x486ed7))[_0x66b2('0x38')](mergeDataErlangB(_0x486ed7))[_0x66b2('0x38')](this[_0x66b2('0x1d0')](_0x486ed7))[_0x66b2('0x9c')](loggerCatchPredictive(_0x66b2('0x1d1'),_0x486ed7));}else if(!ifInterval(_0x486ed7[_0x66b2('0x1c7')],_0x486ed7['startPredictive'])){_0x486ed7['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x486ed7[_0x66b2('0x5e')]=moment()[_0x66b2('0x3f')](_0x66b2('0xc2'));loggerPredictive[_0x66b2('0x43')](_0x486ed7[_0x66b2('0x41')],_0x66b2('0x1d2'),_0x486ed7[_0x66b2('0x5e')]);clearInterval(_0x486ed7[_0x66b2('0x60')]);_0x486ed7[_0x66b2('0x60')]=undefined;hopperUtils[_0x66b2('0x1d3')](_0x486ed7[_0x66b2('0x1c7')])[_0x66b2('0x38')](this[_0x66b2('0x1cf')](_0x486ed7))[_0x66b2('0x38')](mergeDataErlangB(_0x486ed7))[_0x66b2('0x38')](this[_0x66b2('0x1d0')](_0x486ed7))[_0x66b2('0x9c')](loggerCatchPredictive(_0x66b2('0x1d4'),_0x486ed7));}else if(_0x486ed7['predictiveIntervalAvailable']&&_0x4a3738<_0x486ed7['predictiveIntervalAvailable']-_0x101e04){clearPredictiveAttributes(_0x486ed7);loggerPredictive['info'](_0x486ed7[_0x66b2('0x41')],_0x66b2('0x1d5'),_0x4a3738,_0x66b2('0x1d6'),_0x486ed7[_0x66b2('0x1c0')],'-',_0x101e04,'=',_0x486ed7['predictiveIntervalAvailable']-_0x101e04,')');}else if(_0x486ed7[_0x66b2('0x1c0')]&&_0x4a3738>_0x486ed7[_0x66b2('0x1c0')]+_0x2151b8){clearPredictiveAttributes(_0x486ed7);loggerPredictive[_0x66b2('0x43')](_0x486ed7[_0x66b2('0x41')],_0x66b2('0x1d5'),_0x4a3738,')\x20are\x20more\x20than\x20threshold\x20(',_0x486ed7[_0x66b2('0x1c0')],'+',_0x2151b8,'=',_0x486ed7['predictiveIntervalAvailable']+_0x2151b8,')');}};Dialer[_0x66b2('0x81')]['getDataPredictive']=function(_0x2dbc07){var _0x1c6edf=this;return function(_0x355451){return new Promise(function(_0x1d5f48,_0x427814){_[_0x66b2('0x5c')](_0x2dbc07,_0x355451[0x0]);if(checkGetDataPredictive(_0x355451[0x0])){var _0x408d4d=_0x2dbc07[_0x66b2('0x1c0')]=_0x2dbc07['talking']+_0x2dbc07['available'];var _0x2bfb69=_0x2dbc07[_0x66b2('0x1c7')]*0x3c;var _0x3e133a=_0x355451[0x0][_0x66b2('0x4e')]+_0x355451[0x0][_0x66b2('0x50')];var _0x849869=(_0x355451[0x0][_0x66b2('0x48')]+_0x355451[0x0][_0x66b2('0xd0')]+_0x355451[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x355451[0x0][_0x66b2('0x46')];_0x2dbc07[_0x66b2('0x1d7')]=_0x849869>0x0?_0x849869:0x1;switch(_0x2dbc07[_0x66b2('0x1ca')]){case _0x66b2('0x1d8'):var _0x1d53a1=_0x2dbc07[_0x66b2('0x1be')]/0x64;return _0x1c6edf[_0x66b2('0x1d9')](_0x408d4d,_0x2bfb69,_0x3e133a,_0x849869,_0x1d53a1)[_0x66b2('0x38')](function(_0x4daad8){return _0x1d5f48(_0x4daad8);});case _0x66b2('0x1da'):var _0x393f8a=_0x2dbc07['dialPredictiveOptimizationPercentage']/0x64;return _0x1c6edf[_0x66b2('0x1db')](_0x408d4d,_0x2bfb69,_0x3e133a,_0x849869,_0x393f8a)['then'](function(_0x2efc30){return _0x1d5f48(_0x2efc30);});default:return _0x427814(msgResponse(_0x66b2('0x1dc'),_0x66b2('0x90'),_0x66b2('0x1dd')));}}else{return _0x427814(msgResponse(_0x66b2('0x1dc'),_0x66b2('0x90'),'check\x20failure'));}});};};Dialer[_0x66b2('0x81')][_0x66b2('0x1de')]=function(_0x222e3d){var _0xcf9e9d=this;return function(_0x39a1ff){return new Promise(function(_0x2718f7,_0x4651a6){_[_0x66b2('0x5c')](_0x222e3d,_0x39a1ff[0x0]);if(checkGetDataPredictive(_0x39a1ff[0x0])){loggerPredictive[_0x66b2('0x43')](JSON[_0x66b2('0x71')](_0x39a1ff[0x0]));if(_0x222e3d[_0x66b2('0x1ca')]===_0x66b2('0x1d8')){return _0xcf9e9d[_0x66b2('0x14e')](_0x222e3d['id'])[_0x66b2('0x38')](function(_0x2f62b5){var _0x15075f=_0x222e3d['loggedIn']-_0x2f62b5[0x0][_0x66b2('0x1df')];var _0x4bceee=_0x222e3d[_0x66b2('0x1c7')]*0x3c;var _0x2817fb=_0x39a1ff[0x0]['predictiveIntervalAvgTalktime']+_0x39a1ff[0x0][_0x66b2('0x50')];var _0x1080d6=(_0x39a1ff[0x0][_0x66b2('0x48')]+_0x39a1ff[0x0][_0x66b2('0xd0')]+_0x39a1ff[0x0][_0x66b2('0x4b')])/_0x39a1ff[0x0]['predictiveIntervalTotalCalls'];var _0x798a50=_0x222e3d[_0x66b2('0x1be')]/0x64;_0x222e3d['predictiveIntervalPauses']=_0x2f62b5[0x0]['outboundQueuePauses']||0x0;_0x222e3d[_0x66b2('0x1d7')]=_0x1080d6>0x0?_0x1080d6:0x1;return _0xcf9e9d[_0x66b2('0x1d9')](_0x15075f,_0x4bceee,_0x2817fb,_0x1080d6,_0x798a50);})['then'](function(_0x46b011){return _0x2718f7(_0x46b011);})[_0x66b2('0x9c')](function(_0x13600b){return _0x4651a6(msgResponse('[CatchErlangB]',_0x66b2('0x90'),JSON[_0x66b2('0x71')](_0x13600b)));});}if(_0x222e3d[_0x66b2('0x1ca')]===_0x66b2('0x1da')){return _0xcf9e9d[_0x66b2('0x14e')](_0x222e3d['id'])[_0x66b2('0x38')](function(_0x3cccf9){var _0x46abf0=_0x222e3d['loggedIn']-_0x3cccf9[0x0]['outboundQueuePauses'];var _0x1bcbc5=_0x222e3d[_0x66b2('0x1c7')]*0x3c;var _0x8efdd=_0x39a1ff[0x0][_0x66b2('0x4e')]+_0x39a1ff[0x0]['predictiveIntervalAvgHoldtime'];var _0x26f1ca=(_0x39a1ff[0x0][_0x66b2('0x48')]+_0x39a1ff[0x0][_0x66b2('0xd0')]+_0x39a1ff[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x39a1ff[0x0]['predictiveIntervalTotalCalls'];var _0x173b76=_0x222e3d[_0x66b2('0x1be')]/0x64;_0x222e3d[_0x66b2('0x1e0')]=_0x3cccf9[0x0][_0x66b2('0x1df')]||0x0;_0x222e3d['predictiveIntervalHitRate']=_0x26f1ca>0x0?_0x26f1ca:0x1;return _0xcf9e9d['busyFactor'](_0x46abf0,_0x1bcbc5,_0x8efdd,_0x26f1ca,_0x173b76);})['then'](function(_0x12db48){return _0x2718f7(_0x12db48);})[_0x66b2('0x9c')](function(_0x554352){return _0x4651a6(msgResponse(_0x66b2('0x1e1'),_0x66b2('0x90'),JSON[_0x66b2('0x71')](_0x554352)));});}}else{return _0x4651a6(msgResponse(_0x66b2('0x1dc'),_0x66b2('0x90'),_0x66b2('0x1e2')));}});};};Dialer[_0x66b2('0x81')]['startMethodPredictive']=function(_0x12aa5e){var _0x38bd83=this;return function(){var _0x5adeac=0x0;var _0x37ffa6=Math[_0x66b2('0x1e3')](_0x12aa5e[_0x66b2('0x1e4')]*0x3e8);if(_0x37ffa6>0x0){_0x37ffa6=_0x37ffa6<0x64?0x64:_0x37ffa6;loggerPredictive['info'](_0x12aa5e[_0x66b2('0x41')],_0x66b2('0x1e5'),_0x37ffa6,_0x66b2('0x1e6'));_0x12aa5e[_0x66b2('0x60')]=setInterval(function(){_0x38bd83[_0x66b2('0x60')](_0x12aa5e);loggerPredictiveCalls[_0x66b2('0x43')](_0x66b2('0x1e7'),_0x5adeac+=0x1);},_0x37ffa6);}else{loggerPredictive[_0x66b2('0x43')](_0x12aa5e[_0x66b2('0x41')],_0x66b2('0x1e8'));}};};Dialer['prototype'][_0x66b2('0x1e9')]=function(_0x52cb4e,_0x5c02fd){var _0x19cd7b=this;return function(_0x547131){if(_['isEmpty'](_0x547131)){if(_[_0x66b2('0xf4')](_0x5c02fd[_0x66b2('0x154')])||!_0x5c02fd[_0x66b2('0x1ea')]){if(_0x52cb4e['dialMethod']===_0x66b2('0x1eb')){_0x52cb4e[_0x66b2('0x70')]=_[_0x66b2('0x3a')](_0x52cb4e[_0x66b2('0x70')])?!![]:_0x52cb4e[_0x66b2('0x70')];var _0x3552b9=uuid['v4']();_0x19cd7b['actions'][_0x3552b9]=new Action(_0x52cb4e,_0x5c02fd,_0x3552b9);loggerBooked[_0x66b2('0x43')](_0x66b2('0x1ec'),_0x3552b9,_0x66b2('0x1ed'),JSON['stringify'](_0x52cb4e[_0x66b2('0x70')]),_0x66b2('0x1ee'),_0x52cb4e[_0x66b2('0x41')]);if(_0x52cb4e['queueStatusComplete']){_0x52cb4e[_0x66b2('0x70')]=![];_0x19cd7b[_0x66b2('0x23')][_0x19cd7b[_0x66b2('0xef')][_0x3552b9][_0x66b2('0xbf')]]=[];ami[_0x66b2('0x98')]({'actionid':_0x3552b9,'action':_0x66b2('0x1ef'),'queue':_0x52cb4e[_0x66b2('0x41')]})['catch'](function(){_0x19cd7b[_0x66b2('0xc1')](_0x52cb4e);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0x19cd7b[_0x66b2('0xef')][_0x3552b9][_0x66b2('0xdc')],'ListId':_0x19cd7b[_0x66b2('0xef')][_0x3552b9][_0x66b2('0xeb')],'VoiceQueueId':_0x19cd7b[_0x66b2('0xef')][_0x3552b9]['VoiceQueueId']||undefined,'CampaignId':_0x19cd7b[_0x66b2('0xef')][_0x3552b9][_0x66b2('0xde')]||undefined})[_0x66b2('0x9c')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x19cd7b[_0x66b2('0xef')][_0x3552b9];});}else{loggerBooked[_0x66b2('0x43')](_0x66b2('0x1f0'),JSON['stringify'](_0x52cb4e[_0x66b2('0x70')]),_0x66b2('0x1ee'),_0x52cb4e['name']);_0x19cd7b[_0x66b2('0xc1')](_0x52cb4e);hopperUtils[_0x66b2('0xda')]({'active':![],'ContactId':_0x19cd7b[_0x66b2('0xef')][_0x3552b9][_0x66b2('0xdc')],'ListId':_0x19cd7b[_0x66b2('0xef')][_0x3552b9]['ListId'],'VoiceQueueId':_0x19cd7b[_0x66b2('0xef')][_0x3552b9][_0x66b2('0xdd')]||undefined,'CampaignId':_0x19cd7b[_0x66b2('0xef')][_0x3552b9]['CampaignId']||undefined})['catch'](loggerCatch(_0x66b2('0x1f1')));delete _0x19cd7b[_0x66b2('0xef')][_0x3552b9];}}else{return _0x19cd7b['actionOriginate'](_0x52cb4e,_0x5c02fd);}}else{if(utils[_0x66b2('0xce')](undefined,_0x5c02fd[_0x66b2('0x1f2')])<_0x52cb4e[_0x66b2('0x1f3')]*0x3c){if(_0x5c02fd[_0x66b2('0x157')]&&!_0x5c02fd[_0x66b2('0x157')]['voicePause']){_0x19cd7b[_0x66b2('0x18')][_0x66b2('0xfa')](_0x5c02fd['id'])['finally'](function(){_0x19cd7b['updateOriginated'](_0x52cb4e);});}else{hopperUtils['unlockContact']({'active':![]},_0x5c02fd['id'],0x1)[_0x66b2('0x16')](function(){_0x19cd7b[_0x66b2('0xc1')](_0x52cb4e);});}}else{_0x52cb4e[_0x66b2('0x1f4')]+=0x1;_0x19cd7b['updateOriginated'](_0x52cb4e);if(_0x52cb4e[_0x66b2('0x1f5')]){hopperUtils[_0x66b2('0xda')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5c02fd[_0x66b2('0xdc')],'ListId':_0x5c02fd[_0x66b2('0xeb')],'VoiceQueueId':_0x5c02fd[_0x66b2('0xdd')]||undefined,'CampaignId':_0x5c02fd[_0x66b2('0xde')]||undefined})[_0x66b2('0x9c')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));hopperUtils[_0x66b2('0xc8')](createObjHistory(_0x52cb4e,_0x5c02fd,utils[_0x66b2('0x66')]['QUEUE_RECALL'],0x17,'RecallInQueue'))[_0x66b2('0x9c')](loggerCatch(_0x66b2('0x1f6')));}else{_0x19cd7b[_0x66b2('0x128')](createObjHistory(_0x52cb4e,_0x5c02fd,utils[_0x66b2('0x66')]['RECALL_TIMEOUT'],0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]');}}}}else{_0x52cb4e[_0x66b2('0x1f7')]+=0x1;_0x19cd7b[_0x66b2('0x128')](createObjHistory(_0x52cb4e,_0x5c02fd,utils['CAMPAIGN_STATUS']['BLACKLIST'],0xd,_0x66b2('0x1f8')),_0x66b2('0x1f9'),_0x66b2('0x1fa'));throw _0x66b2('0x1fb');}};};Dialer['prototype']['handleIvr']=function(_0x57d5ce){var _0x439632=this;var _0x19e26c=_0x57d5ce['limitCalls']-_0x57d5ce[_0x66b2('0x7b')]-_0x57d5ce[_0x66b2('0x1fc')];emitCampaignSummary(_0x57d5ce);if(_0x19e26c>0x0){if(_0x19e26c>this[_0x66b2('0x1d')]){_0x19e26c=this['maxNumberOriginate'];}_0x57d5ce[_0x66b2('0x1fc')]+=_0x19e26c;hopperUtils[_0x66b2('0x1fd')](_0x57d5ce['id'],_0x19e26c,_0x57d5ce[_0x66b2('0x1fe')],_0x57d5ce)[_0x66b2('0x38')](function(_0x31488c){_0x57d5ce['temp']-=_0x19e26c;_0x57d5ce['temp']=_0x57d5ce[_0x66b2('0x1fc')]>0x0?_0x57d5ce[_0x66b2('0x1fc')]:0x0;if(!utils[_0x66b2('0x1ff')](_0x31488c)){_0x57d5ce[_0x66b2('0x6a')]=utils[_0x66b2('0x66')][_0x66b2('0x6b')];logger[_0x66b2('0x43')](_0x66b2('0x200')+_0x57d5ce[_0x66b2('0x41')]);}else{_0x57d5ce[_0x66b2('0x7b')]+=_0x31488c[_0x66b2('0x97')];_0x57d5ce[_0x66b2('0x6a')]=utils[_0x66b2('0x66')][_0x66b2('0x201')];for(var _0x56c025=0x0;_0x56c025<_0x31488c['length'];_0x56c025+=0x1){_0x57d5ce[_0x66b2('0x202')]+=0x1;if(_[_0x66b2('0xf4')](_0x31488c[_0x56c025])||_[_0x66b2('0xf4')](_0x31488c[_0x56c025]['Contact'])||_['isNil'](_0x31488c[_0x56c025][_0x66b2('0x15c')])){_0x439632[_0x66b2('0x153')](_0x66b2('0x203'),_0x57d5ce,_0x31488c[_0x56c025]);}else{hopperUtils[_0x66b2('0x204')](_[_0x66b2('0x72')](_0x31488c[_0x56c025],[_0x66b2('0xde'),_0x66b2('0x15c')]))[_0x66b2('0x38')](_0x439632[_0x66b2('0x1e9')](_0x57d5ce,_0x31488c[_0x56c025]))[_0x66b2('0x9c')](_0x439632['loggerHandler'](_0x66b2('0x205'),_0x57d5ce));}}}})[_0x66b2('0x9c')](loggerGetContactDialer(_0x66b2('0x206'),_0x57d5ce,_0x19e26c));}};Dialer[_0x66b2('0x81')][_0x66b2('0xb3')]=function(_0x18ee85,_0xdd724d){var _0xa0222c=this;var _0x27f126=[];if(_0xdd724d<0x1||_0x18ee85['dialMethod']==='booked'){_0xdd724d=0x1;}var _0x85b441=Math['floor'](_0x18ee85['available']*_0xdd724d)-_0x18ee85[_0x66b2('0x7b')]-_0x18ee85[_0x66b2('0x1fc')];if(_0x18ee85[_0x66b2('0x207')]>0x0){var _0x4ffc2f=_0x18ee85['dialLimitQueue']-_0x18ee85['originated']-_0x18ee85['talking']-_0x18ee85[_0x66b2('0x1fc')]-_0x18ee85[_0x66b2('0x13c')];if(_0x85b441>_0x4ffc2f){_0x85b441=_0x4ffc2f;}}if(_0x85b441>0x0){if(_0x18ee85[_0x66b2('0xb1')]===_0x66b2('0x1eb')){_0x85b441=0x1;}if(_0x85b441>this[_0x66b2('0x1d')]){_0x85b441=this[_0x66b2('0x1d')];}_0x18ee85[_0x66b2('0x1fc')]+=_0x85b441;for(var _0x32f2b2 in this['agents']){if(typeof this[_0x66b2('0x1b')][_0x32f2b2]!==_0x66b2('0xab')){if(this[_0x66b2('0x1b')][_0x32f2b2]['state']===_0x66b2('0x208')&&this['agents'][_0x32f2b2][_0x66b2('0x85')]==='reachable'){_0x27f126['push'](this[_0x66b2('0x1b')][_0x32f2b2]['id']);}}}hopperUtils['getContactDialer'](_0x18ee85,_0x27f126,_0x85b441)[_0x66b2('0x38')](function(_0x1ad224){_0x18ee85['temp']-=_0x85b441;_0x18ee85[_0x66b2('0x1fc')]=_0x18ee85[_0x66b2('0x1fc')]>0x0?_0x18ee85[_0x66b2('0x1fc')]:0x0;if(!utils[_0x66b2('0x1ff')](_0x1ad224)){hopperUtils['countReScheduled'](_0x18ee85)['then'](sendMessageReschedule(_0x18ee85))[_0x66b2('0x9c')](loggerCatch('[countReScheduled]\x20'));}else{_0x18ee85[_0x66b2('0x7b')]+=_0x1ad224[_0x66b2('0x97')];_0x18ee85[_0x66b2('0x6a')]=_0x18ee85[_0x66b2('0xb1')]===_0x66b2('0x1eb')?utils[_0x66b2('0x66')]['ACTIVE']:utils[_0x66b2('0x66')][_0x66b2('0x201')];for(var _0x5af4b2=0x0;_0x5af4b2<_0x1ad224[_0x66b2('0x97')];_0x5af4b2+=0x1){if(_[_0x66b2('0xf4')](_0x1ad224[_0x5af4b2])||_['isNil'](_0x1ad224[_0x5af4b2][_0x66b2('0x173')])||_[_0x66b2('0xf4')](_0x1ad224[_0x5af4b2][_0x66b2('0x15c')])){_0xa0222c['emptyContact'](_0x66b2('0x203'),_0x18ee85,_0x1ad224[_0x5af4b2]);}else{hopperUtils[_0x66b2('0x209')](_[_0x66b2('0x72')](_0x1ad224[_0x5af4b2],['VoiceQueueId','phone']))['then'](_0xa0222c[_0x66b2('0x1e9')](_0x18ee85,_0x1ad224[_0x5af4b2]))[_0x66b2('0x9c')](_0xa0222c[_0x66b2('0x152')](_0x66b2('0x203'),_0x18ee85));}}}})[_0x66b2('0x9c')](loggerGetContactDialer(_0x66b2('0x20a'),_0x18ee85,_0x85b441));}};Dialer[_0x66b2('0x81')]['handlePredictive']=function(_0x167cac){if(_0x167cac[_0x66b2('0x207')]>0x0){var _0x1f85eb=_0x167cac[_0x66b2('0x207')]-_0x167cac[_0x66b2('0x7b')]-_0x167cac[_0x66b2('0x13b')];if(_0x1f85eb>0x0){this['tryOriginatePredictive'](_0x167cac);}else{loggerPredictiveCalls['info'](_0x66b2('0x20b'));}}else{this[_0x66b2('0x20c')](_0x167cac);}};Dialer['prototype'][_0x66b2('0x20c')]=function(_0x389e27){var _0x54bd00=this;var _0x3b5bdb=[];_0x389e27[_0x66b2('0x7b')]+=0x1;for(var _0x56ab33 in this[_0x66b2('0x1b')]){if(typeof this['agents'][_0x56ab33]!==_0x66b2('0xab')){if(this[_0x66b2('0x1b')][_0x56ab33][_0x66b2('0x6c')]===_0x66b2('0x208')&&this[_0x66b2('0x1b')][_0x56ab33][_0x66b2('0x85')]===_0x66b2('0x86')){_0x3b5bdb['push'](this[_0x66b2('0x1b')][_0x56ab33]['id']);}}}return this['getContactDialer'](_0x389e27['id'],_0x3b5bdb,0x1,_0x389e27[_0x66b2('0x1fe')],_0x389e27)['then'](function(_0xb42d5f){if(!utils['checkContactEmpty'](_0xb42d5f)){utils[_0x66b2('0x64')](_0x389e27,0x1,0x0);return hopperUtils[_0x66b2('0x20d')](_0x389e27)['then'](sendMessageReschedule(_0x389e27))['catch'](loggerCatch(_0x66b2('0x20e')));}else{_0x389e27[_0x66b2('0x6a')]=utils[_0x66b2('0x66')][_0x66b2('0x201')];if(_[_0x66b2('0xf4')](_0xb42d5f[0x0])||_['isNil'](_0xb42d5f[0x0]['Contact'])||_[_0x66b2('0xf4')](_0xb42d5f[0x0][_0x66b2('0x15c')])){_0x54bd00['emptyContact'](_0x66b2('0x203'),_0x389e27,_0xb42d5f[0x0]);}else{return hopperUtils['checkIsBlackList'](_[_0x66b2('0x72')](_0xb42d5f[0x0],['VoiceQueueId',_0x66b2('0x15c')]))[_0x66b2('0x38')](_0x54bd00[_0x66b2('0x1e9')](_0x389e27,_0xb42d5f[0x0]))['catch'](_0x54bd00[_0x66b2('0x152')](_0x66b2('0x20f'),_0x389e27));}}})[_0x66b2('0x9c')](loggerGetContactDialer(_0x66b2('0x210'),_0x389e27,0x1));};Dialer[_0x66b2('0x81')]['abandonmentRate']=function(_0xebe06c,_0x22896d,_0xecab56,_0x33db9d,_0x3e8c1b,_0x3c6059){loggerPredictive[_0x66b2('0x43')](_0x66b2('0x211'));loggerPredictive[_0x66b2('0x43')](_0x66b2('0x212'),_0xebe06c);loggerPredictive[_0x66b2('0x43')](_0x66b2('0x213'),_0x22896d);loggerPredictive[_0x66b2('0x43')](_0x66b2('0x214'),_0xecab56);loggerPredictive[_0x66b2('0x43')](_0x66b2('0x215'),_0x33db9d);loggerPredictive['info'](_0x66b2('0x216'),_0x3e8c1b);loggerPredictive['info'](_0x66b2('0x5b'));return new Promise(function(_0x406d70,_0x50db19){if(_0xebe06c<=0x0||isNaN(_0xebe06c)){return _0x50db19(msgResponse(_0x66b2('0x217'),_0x66b2('0xbe'),_0x66b2('0x218')+_0xebe06c));}if(_0xecab56<=0x0||isNaN(_0xecab56)){return _0x50db19(msgResponse(_0x66b2('0x217'),_0x66b2('0xbe'),_0x66b2('0x219')+_0xecab56));}if(_0x33db9d<=0x0||isNaN(_0x33db9d)){return _0x50db19(msgResponse(_0x66b2('0x217'),_0x66b2('0xbe'),_0x66b2('0x21a')+_0x33db9d));}if(_0x22896d<=0x0||isNaN(_0x22896d)){return _0x50db19(msgResponse(_0x66b2('0x217'),_0x66b2('0xbe'),_0x66b2('0x21b')+_0x22896d));}if(_0x3e8c1b<=0x0||isNaN(_0x3e8c1b)){return _0x50db19(msgResponse(_0x66b2('0x217'),_0x66b2('0xbe'),'Amax\x20=\x20'+_0x3e8c1b));}_0x3c6059=_0x3c6059||0x0;var _0x1e9144=0x1/_0xecab56;var _0x6d7242=0x0;var _0x4a59ad=0x0;var _0x291613=0x0;var _0x2b2190=0x0;for(var _0x3919d3=0x0;_0x291613<_0x3e8c1b;_0x3919d3+=0x1){_0x4a59ad=_0x3919d3/_0x22896d;_0x6d7242=(_0x33db9d*_0x4a59ad+_0x3c6059)/_0x1e9144;_0x291613=utils[_0x66b2('0x21c')](_0x6d7242,_0xebe06c);_0x2b2190=_0x6d7242/_0xebe06c*(0x1-utils[_0x66b2('0x21c')](_0x6d7242,_0xebe06c));}return _0x406d70({'erlangCalls':_0x3919d3,'erlangCallToSecond':_0x22896d/_0x3919d3,'erlangAbandonmentRate':_0x291613,'erlangBusyFactor':_0x2b2190});});};Dialer[_0x66b2('0x81')][_0x66b2('0x1db')]=function(_0x354b4a,_0x2145b8,_0x5e5ef2,_0x39a8c4,_0x449270,_0x5a6f37){loggerPredictive[_0x66b2('0x43')](_0x66b2('0x21d'));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',_0x354b4a);loggerPredictive[_0x66b2('0x43')](_0x66b2('0x213'),_0x2145b8);loggerPredictive[_0x66b2('0x43')](_0x66b2('0x214'),_0x5e5ef2);loggerPredictive[_0x66b2('0x43')](_0x66b2('0x215'),_0x39a8c4);loggerPredictive['info'](_0x66b2('0x21e'),_0x449270);loggerPredictive[_0x66b2('0x43')](_0x66b2('0x5b'));return new Promise(function(_0x11fa00,_0x20dca5){if(_0x354b4a<=0x0||isNaN(_0x354b4a)){return _0x20dca5(msgResponse(_0x66b2('0x21f'),'Error',_0x66b2('0x218')+_0x354b4a));}if(_0x5e5ef2<=0x0||isNaN(_0x5e5ef2)){return _0x20dca5(msgResponse('[busyFactor]',_0x66b2('0xbe'),'Ts\x20=\x20'+_0x5e5ef2));}if(_0x39a8c4<=0x0||isNaN(_0x39a8c4)){return _0x20dca5(msgResponse(_0x66b2('0x21f'),_0x66b2('0xbe'),'p\x20=\x20'+_0x39a8c4));}if(_0x2145b8<=0x0||isNaN(_0x2145b8)){return _0x20dca5(msgResponse(_0x66b2('0x21f'),_0x66b2('0xbe'),_0x66b2('0x21b')+_0x2145b8));}if(_0x449270<=0x0||isNaN(_0x449270)){return _0x20dca5(msgResponse(_0x66b2('0x21f'),'Error',_0x66b2('0x220')+_0x449270));}_0x5a6f37=_0x5a6f37||0x0;var _0x71bd86=0x1/_0x5e5ef2;var _0x441cc0=0x0;var _0x18b102=0x0;var _0x26cb35=0x0;var _0x43f64a=0x0;for(var _0x318fb3=0x0;_0x43f64a<_0x449270;_0x318fb3+=0x1){_0x18b102=_0x318fb3/_0x2145b8;_0x441cc0=(_0x39a8c4*_0x18b102+_0x5a6f37)/_0x71bd86;_0x26cb35=utils[_0x66b2('0x21c')](_0x441cc0,_0x354b4a);_0x43f64a=_0x441cc0/_0x354b4a*(0x1-utils['erlangb'](_0x441cc0,_0x354b4a));}return _0x11fa00({'erlangCalls':_0x318fb3,'erlangCallToSecond':_0x2145b8/_0x318fb3,'erlangAbandonmentRate':_0x26cb35,'erlangBusyFactor':_0x43f64a});});};module[_0x66b2('0x221')]=Dialer; \ No newline at end of file +var _0xb42b=['calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','countabandonedretry','dialAbandonedMaxRetry','VoiceQueueId','swapAdditionalPhones','channel','actionid','strategy','rrmemory','roundrobin','isNil','locked','status','stateinterface','pick','idHopper','paused','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncOriginateResponse','responsetime','getQueue','Success','callProgressDetecting','[callProgressDetecting]\x20','variable','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','custom:amd','buildObj','amd','saveInDb','[syncHangupInAMD][createHistory]','outboundAnswerCallsDay','Machine','countmachineretry','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','dialGlobalMaxRetry','stateGlobal','createStateFinal','dialMachineRetryFrequency','[rescheduleContact][Machine]','HangupInAMD','membername','AMD','[syncHangupInAMDIvr][createHistory]','MACHINE','countagentrejectretry','reason19\x20machine....','dialMachineMaxRetry','reason\x2019\x20machine....','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','running','statusMessage','getQueueCampaignStatusMessage','available','talking','pTalking','ACTIVE','[syncQueueSummary]','compareToOutboundQueue','queueSummaryCountersUpdated','updateReportFromOutboundQueue','assign','throttle','online','handlePreviewRecallNotifications','map','user:%s','checkPreviewRecallReminder','clearZombieChannels','[uniqueid]','undefined','sequence','No\x20such\x20channel','[Dialer][checkChannel]','[Dialer][checkChannel][ivr]','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','UserId','[emptyContact]','[syncQueueCallerAbandon]\x20[Drop]','user:dialPreviewRecallReminder','handleIvr','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','isOutboundQueue','dialQueueOptions','dialer','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','updatedAt','%s%s','XMD-','toUpper','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','dialOriginateCallerIdName','originatecalleridname','extractCalleridName','variables','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','dialOriginateTimeout','outboundOriginateFailureCallsDay','OriginateError','[originate][error]','originate\x20action\x20Error','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','reason','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','checkRetriveMax','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','reason\x2011\x20abandoned','outboundRejectCallsDay','custom:agentreject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','avgHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','predictiveIntervalAvailable','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dropRate','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','one\x20call\x20every:','milliseconds','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','scheduledat','Agent','voicePause','unlockContact','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','QUEUE_RECALL','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALL_TIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','dialOrderByScheduledAt','checkContactEmpty','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','emptyContact','checkIsBlackListIvr','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','getContactDialer','[actionOriginate]\x20','checkIsBlackList','tryOriginatePredictive','[handlePredictive][limitChannel]','countReScheduled','[countReScheduled]\x20','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','Amax\x20=\x20','erlangb','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','uuid','ioredis','./utils','./utils/hopper','../preview/util/util','../../../config/environment/','../../../config/logger','predictive','syncQueueSummary','../ami','defaults','redis','localhost','../rpc/voiceQueueRt','../rpc/setting','../rpc/interval','./models/action','./models/agentComplete','./models/queueCallerAbandon','env','XCALLY_IP_AGI','127.0.0.1','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','startPredictive','ivrOriginated','queueBooked','queueBookedRR','queuesSummary','syncAgentConnect','bind','queuecallerabandon','syncAgentComplete','custom:queuesummarycomplete','syncQueueSummaryComplete','hangup','syncHangup','newexten','syncNewExten','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopClearZombieChannels','getSettings','then','previewRecallmeReminderInterval','isUndefined','emit','type','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','inspect','voice:queue:%s','name','voice_queue:save','isEmpty','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','---------------------------','predictiveIntervalTotalCalls','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','merge','getSeconds','startProgressive','startProgressive\x20value\x20cleared','handlePredictive','handlePredictive\x20interval\x20cleared','error','stack','checkContactLowerLimitOriginate','contactsRescheduled','CAMPAIGN_STATUS','CONTACTS_RESCHEDULED','[getContactDialer2][ReScheduled]','contacts','message','NO_AVAILABLE_CONTACTS','[getContactDialer2][Empty]','state','statedesc','endtime','starttime','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','NULL_INTERVAL','\x20INTERVAL_IS_NULL','Interval','Intervals','isIVRCampaignActive','INACTIVE','\x20NOT\x20Active','isIVRCampaign','campaign:ivr:%s','campaign:save','sendMessageOneNotActive','originated','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','is\x20disactive','[ifTime][Action]','stringify','prototype','isTrunkReachable','format','reachable','SIP/%s','Trunk','TrunkBackup','TRUNK_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','checkIfTimeIntervals','ifTimeIvr','ifTime','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','UNKNOWN_TIMEZONE','\x20Timezone\x20unknow\x20','push','Action','command','content','indexOf','true','catch','iftime\x20%s,%s','all','some','OVERTIME_GLOBAL_INTERVAL','OVERTIME_INTERVAL','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','loopCampaigns','resetActiveCalls','syncCampaigns','resolve','dialTimezone','launchHandleIvr','[syncCampaigns]','checkDialMethod','dialMethod','progressive','handlePower','power','dialPowerLevel','booked','Queue','method\x20not\x20recognized','silly','Dialer::ifTime()','Voice\x20Queue\x20%s\x20$s','intervalIftime','Dialer::ifTime()\x20errResponse\x20NOT\x20NULL:','Error','queue','uniqueId','uniqueid','ivr','updateOriginated','YYYY-MM-DD\x20HH:mm:ss','agent','agiafterat','dialQueueProject2','createHistory','[syncAgentComplete][createHistory]','moveContactManagedDialer','[syncAgentComplete]','syncQueueCallerAbandon','droptime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','countdropretry','countglobal','dialDropRetryFrequency','callAdditionalPhoneAfterMin','verifyAdditionalPhones','voiceQueue','additional','dialDropMaxRetry','queueCallerAbandonCreateState','rescheduleContact','add','minutes','ContactId','ListId','CampaignId','[rescheduleContact][Drop]'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb42b,0x144));var _0xbb42=function(_0x5b8df8,_0xb6d5b3){_0x5b8df8=_0x5b8df8-0x0;var _0x59f62c=_0xb42b[_0x5b8df8];return _0x59f62c;};'use strict';var util=require(_0xbb42('0x0'));var _=require('lodash');var uuid=require(_0xbb42('0x1'));var moment=require('moment');var rr=require('rr');var Redis=require(_0xbb42('0x2'));var utils=require(_0xbb42('0x3'));var hopperUtils=require(_0xbb42('0x4'));var ut=require(_0xbb42('0x5'));var config=require(_0xbb42('0x6'));var logger=require(_0xbb42('0x7'))('dialer');var loggerBooked=require(_0xbb42('0x7'))('booked');var loggerPredictive=require('../../../config/logger')(_0xbb42('0x8'));var loggerPredictiveCalls=require(_0xbb42('0x7'))('predictiveCalls');var loggerSyncQueueSummary=require(_0xbb42('0x7'))(_0xbb42('0x9'));var ami=require(_0xbb42('0xa'));config['redis']=_[_0xbb42('0xb')](config[_0xbb42('0xc')],{'host':_0xbb42('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xbb42('0xc')]));var cmHopper=require('../rpc/cmHopper');var voiceQueueRt=require(_0xbb42('0xe'));var RpcSetting=require(_0xbb42('0xf'));var Interval=require(_0xbb42('0x10'));var Action=require(_0xbb42('0x11'));var History=require('./models/history');var Final=require('./models/final');var AgentComplete=require(_0xbb42('0x12'));var QueueCallerAbandon=require(_0xbb42('0x13'));var Hangup=require('./models/hangup');var ipAgi=process[_0xbb42('0x14')][_0xbb42('0x15')]||_0xbb42('0x16');var previewRecallmeReminderInterval=0x1;var Sequence=function(){};Sequence['prototype'][_0xbb42('0x17')]=function(_0x39b25f){this['tail']=this['tail']?this[_0xbb42('0x18')][_0xbb42('0x19')](_0x39b25f):_0x39b25f();};function Dialer(_0x46541d,_0x3ce8ca){this['sequence']=new Sequence();this[_0xbb42('0x1a')]=_0x3ce8ca;this[_0xbb42('0x1b')]=_0x46541d[_0xbb42('0x1b')];this[_0xbb42('0x1c')]=_0x46541d[_0xbb42('0x1c')];this['agents']=_0x46541d[_0xbb42('0x1d')];this[_0xbb42('0x1e')]=_0x46541d[_0xbb42('0x1e')];this[_0xbb42('0x1f')]=config[_0xbb42('0x1f')]||0x2;this[_0xbb42('0x20')]={};this[_0xbb42('0x21')]={};this['contactsId']={};this['uniqueId']={};this['optionPredictive']={};this[_0xbb42('0x22')]={};this['startProgressive']={};this[_0xbb42('0x23')]={};this[_0xbb42('0x24')]={};this[_0xbb42('0x25')]={};this[_0xbb42('0x26')]={};ami['on']('agentconnect',this[_0xbb42('0x27')][_0xbb42('0x28')](this));ami['on'](_0xbb42('0x29'),this['syncQueueCallerAbandon'][_0xbb42('0x28')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0xbb42('0x28')](this));ami['on']('agentcomplete',this[_0xbb42('0x2a')][_0xbb42('0x28')](this));ami['on']('custom:queuesummary',this['syncQueueSummary'][_0xbb42('0x28')](this));ami['on'](_0xbb42('0x2b'),this[_0xbb42('0x2c')]['bind'](this));ami['on'](_0xbb42('0x2d'),this[_0xbb42('0x2e')]['bind'](this));ami['on'](_0xbb42('0x2f'),this[_0xbb42('0x30')][_0xbb42('0x28')](this));ami['on']('varset',this[_0xbb42('0x31')][_0xbb42('0x28')](this));ami['on'](_0xbb42('0x32'),this[_0xbb42('0x33')]['bind'](this));ami['on']('queuestatuscomplete',this[_0xbb42('0x34')][_0xbb42('0x28')](this));this['loopCampaigns']();this[_0xbb42('0x35')]();RpcSetting[_0xbb42('0x36')]()[_0xbb42('0x37')](function(_0x57a918){previewRecallmeReminderInterval=_0x57a918[_0xbb42('0x38')];});}function isNotNull(_0x108e13){return _0x108e13!==null&&!_[_0xbb42('0x39')](_0x108e13);}function msgResponse(_0x15502c,_0x5a0a89,_0x4fe4fd){return{'action':_0x15502c,'response':_0x5a0a89,'message':_0x4fe4fd,'stack':_0x4fe4fd};}function emit(_0x5045be,_0x4b95b5,_0xbe176){io['to'](_0x5045be)[_0xbb42('0x3a')](_0x4b95b5,_0xbe176);}function emitOutboundVoiceQueueSummary(_0x737cff){if(_0x737cff[_0xbb42('0x3b')]==='outbound'){logger[_0xbb42('0x3c')](_0xbb42('0x3d'),util[_0xbb42('0x3e')](_0x737cff,{'showHidden':![],'depth':null}));emit(util['format'](_0xbb42('0x3f'),_0x737cff[_0xbb42('0x40')]),_0xbb42('0x41'),_0x737cff);}}function checkGetDataPredictive(_0x46e6ae){if(isNotNull(_0x46e6ae)&&!_[_0xbb42('0x42')](_0x46e6ae)){loggerPredictive[_0xbb42('0x43')](_0xbb42('0x44'));loggerPredictive[_0xbb42('0x43')](_0xbb42('0x45'),_0x46e6ae['predictiveIntervalTotalCalls']);loggerPredictive[_0xbb42('0x43')](_0xbb42('0x46'),_0x46e6ae[_0xbb42('0x47')]);loggerPredictive[_0xbb42('0x43')](_0xbb42('0x48'),_0x46e6ae[_0xbb42('0x49')]);loggerPredictive[_0xbb42('0x43')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x46e6ae[_0xbb42('0x4a')]);loggerPredictive[_0xbb42('0x43')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x46e6ae[_0xbb42('0x4b')]);loggerPredictive[_0xbb42('0x43')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x46e6ae[_0xbb42('0x4c')]);loggerPredictive['info'](_0xbb42('0x4d'));if(_0x46e6ae[_0xbb42('0x4e')]>0x0){if(!_['isUndefined'](_0x46e6ae[_0xbb42('0x4c')])&&_0x46e6ae[_0xbb42('0x4c')]>0x0){return!![];}loggerPredictive[_0xbb42('0x43')](_0xbb42('0x4f'));if(!_['isUndefined'](_0x46e6ae['predictiveIntervalAvgHoldtime'])&&_0x46e6ae['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive['info'](_0xbb42('0x50'));}else{loggerPredictive[_0xbb42('0x43')](_0xbb42('0x51'));}}else{loggerPredictive[_0xbb42('0x43')](_0xbb42('0x52'));}return![];}function mergeDataErlangB(_0x726f02){return function(_0x25be18){loggerPredictive['info'](_0xbb42('0x53'));loggerPredictive['info'](_0xbb42('0x54'),_0x25be18[_0xbb42('0x55')]);loggerPredictive[_0xbb42('0x43')](_0xbb42('0x56'),_0x25be18['erlangCallToSecond']);loggerPredictive[_0xbb42('0x43')](_0xbb42('0x57'),_0x25be18[_0xbb42('0x58')]);loggerPredictive[_0xbb42('0x43')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x25be18['erlangBusyFactor']);loggerPredictive[_0xbb42('0x43')](_0xbb42('0x57'),_0x25be18[_0xbb42('0x58')]);loggerPredictive[_0xbb42('0x43')](_0xbb42('0x4d'));_[_0xbb42('0x59')](_0x726f02,_0x25be18);};}function ifInterval(_0x292667,_0x29d077){if(_[_0xbb42('0x39')](_0x29d077)){return![];}return utils[_0xbb42('0x5a')](undefined,_0x29d077)<_0x292667*0x3c;}function clearPredictiveAttributes(_0x203c44){if(_0x203c44[_0xbb42('0x5b')]){_0x203c44[_0xbb42('0x5b')]=undefined;loggerPredictive['debug'](_0x203c44[_0xbb42('0x40')],_0xbb42('0x5c'));}if(_0x203c44[_0xbb42('0x22')]){_0x203c44[_0xbb42('0x22')]=undefined;loggerPredictive[_0xbb42('0x3c')](_0x203c44[_0xbb42('0x40')],'startPredictive\x20value\x20cleared');}if(_0x203c44[_0xbb42('0x5d')]){clearInterval(_0x203c44[_0xbb42('0x5d')]);_0x203c44[_0xbb42('0x5d')]=undefined;loggerPredictive[_0xbb42('0x3c')](_0x203c44[_0xbb42('0x40')],_0xbb42('0x5e'));}}function loggerCatchPredictive(_0x553cd8,_0x2c62fb){return function(_0x4b4ecb){loggerPredictive[_0xbb42('0x5f')](_0x2c62fb[_0xbb42('0x40')],_0x553cd8);loggerPredictive[_0xbb42('0x5f')](_0x4b4ecb[_0xbb42('0x60')]);clearPredictiveAttributes(_0x2c62fb);};}function loggerCatch(_0x5d8dfe){return function(_0x3e79f1){logger[_0xbb42('0x5f')](_0x5d8dfe,util[_0xbb42('0x3e')](_0x3e79f1,{'showHidden':![],'depth':null}));};}function loggerGetContactDialer(_0x50d752,_0x30cc98,_0x2934cb){return function(_0x66826c){utils[_0xbb42('0x61')](_0x30cc98,_0x2934cb,0x0);logger['error'](_0x50d752,util[_0xbb42('0x3e')](_0x66826c,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2b3b40){return function(_0x3636d2){if(isNotNull(_0x3636d2)&&isNotNull(_0x3636d2[0x0])){if(_0x3636d2[0x0][_0xbb42('0x62')]>0x0){_0x2b3b40['message']=utils[_0xbb42('0x63')][_0xbb42('0x64')];logger[_0xbb42('0x43')](_0xbb42('0x65')+_0x2b3b40['name'],_0x3636d2[0x0][_0xbb42('0x62')],_0xbb42('0x66'));}else{_0x2b3b40[_0xbb42('0x67')]=utils['CAMPAIGN_STATUS'][_0xbb42('0x68')];logger[_0xbb42('0x43')](_0xbb42('0x69')+_0x2b3b40['name']);}}};}function createObjHistory(_0x426fbd,_0x41571c,_0x1a9066,_0x39f474,_0x29a27c){_0x426fbd['message']=_0x1a9066;var _0x373476=new Action(_0x426fbd,_0x41571c);var _0x377717=new History(_0x373476);_0x377717[_0xbb42('0x6a')]=_0x39f474;_0x377717[_0xbb42('0x6b')]=_0x29a27c;_0x377717[_0xbb42('0x6c')]=_0x373476[_0xbb42('0x6d')];return _0x377717;}function unlockQueueStatus(_0x22cc73,_0x1f6821){setTimeout(function(){if(_[_0xbb42('0x39')](_0x22cc73[_0xbb42('0x6e')])){loggerBooked[_0xbb42('0x5f')](_0xbb42('0x6f'),_0x1f6821);}_0x22cc73[_0xbb42('0x6e')]=!![];loggerBooked[_0xbb42('0x43')](_0xbb42('0x70'),_0x1f6821,JSON['stringify'](_['pick'](_0x22cc73,[_0xbb42('0x40'),'queueStatusComplete'])));},0x1f3);}function checkInterval(_0x42b800){return function(){if(!isNotNull(_0x42b800['Interval'])){_0x42b800[_0xbb42('0x67')]=utils[_0xbb42('0x63')][_0xbb42('0x71')];throw _0x42b800[_0xbb42('0x40')]+_0xbb42('0x72');}if(!isNotNull(_0x42b800[_0xbb42('0x73')][_0xbb42('0x74')])){_0x42b800[_0xbb42('0x67')]=utils[_0xbb42('0x63')][_0xbb42('0x71')];throw _0x42b800['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0xbb42('0x42')](_0x42b800[_0xbb42('0x73')]['Intervals']))){_0x42b800[_0xbb42('0x67')]=utils['CAMPAIGN_STATUS'][_0xbb42('0x71')];throw _0x42b800[_0xbb42('0x40')]+_0xbb42('0x72');}};}function checkIsIVRCampaignActive(_0x11c1b4){return function(){if(!utils[_0xbb42('0x75')](_0x11c1b4)){_0x11c1b4['message']=utils[_0xbb42('0x63')][_0xbb42('0x76')];throw _0x11c1b4[_0xbb42('0x40')]+_0xbb42('0x77');}};}function emitCampaignSummary(_0x51729d){if(utils[_0xbb42('0x78')](_0x51729d)){emit(util['format'](_0xbb42('0x79'),_0x51729d['name']),_0xbb42('0x7a'),_0x51729d);}}function loggerCatchQueueSummary(_0x2c27e4,_0x2b207d){return function(_0x213bdb){clearPredictiveAttributes(_0x2b207d);emitCampaignSummary(_0x2b207d);loggerSyncQueueSummary['debug'](_0x2c27e4,util[_0xbb42('0x3e')](_0x213bdb,{'showHidden':![],'depth':null}));};}function notSendMessagesCampaign(_0x5340be){if(_0x5340be[_0xbb42('0x7b')]){if(_0x5340be[_0xbb42('0x7c')]===0x0){_0x5340be['sendMessageOneNotActive']=![];_0x5340be[_0xbb42('0x67')]=utils[_0xbb42('0x63')]['INACTIVE'];loggerSyncQueueSummary['debug'](_0xbb42('0x7d'),_0x5340be['name'],_0xbb42('0x7e'));}else{_0x5340be[_0xbb42('0x67')]=utils[_0xbb42('0x63')]['DISACTIVED'];loggerSyncQueueSummary[_0xbb42('0x3c')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x5340be['name'],_0xbb42('0x7f'));}emitCampaignSummary(_0x5340be);}}function myreject(_0x2889f9){return function(_0x15a7be){return _0x2889f9(msgResponse(_0xbb42('0x80'),'Error',JSON[_0xbb42('0x81')](_0x15a7be)));};}Dialer[_0xbb42('0x82')][_0xbb42('0x83')]=function(_0x4e8be8){return!_[_0xbb42('0x39')](_0x4e8be8)&&_0x4e8be8&&!_[_0xbb42('0x39')](_0x4e8be8[_0xbb42('0x40')])&&!_[_0xbb42('0x39')](_0x4e8be8['active'])&&_0x4e8be8['active']&&(this[_0xbb42('0x1e')][util[_0xbb42('0x84')]('SIP/%s',_0x4e8be8[_0xbb42('0x40')])]['status']===_0xbb42('0x85')||this['trunks'][util[_0xbb42('0x84')](_0xbb42('0x86'),_0x4e8be8[_0xbb42('0x40')])]['status']==='unmonitored');};Dialer['prototype']['checkIsTrunkReachable']=function(_0xc5a0fa){var _0x48951a=this;return function(){if(!_0x48951a['isTrunkReachable'](_0xc5a0fa[_0xbb42('0x87')])){if(!_0x48951a['isTrunkReachable'](_0xc5a0fa[_0xbb42('0x88')])){_0xc5a0fa['message']=utils['CAMPAIGN_STATUS'][_0xbb42('0x89')];throw _0xc5a0fa['name']+_0xbb42('0x8a');}}};};Dialer[_0xbb42('0x82')][_0xbb42('0x8b')]=function(_0x46d86b,_0x276806,_0x77f0cb,_0x1e76c8){var _0x23c71b=this;return function(){var _0x24c97b=!![];return _0x23c71b['ifTimeIvr'](_0x46d86b,_0x276806,_0x77f0cb,_0x1e76c8,_0x24c97b);};};Dialer[_0xbb42('0x82')][_0xbb42('0x8c')]=function(_0x3d0406,_0x470035,_0x306fcd,_0x284e53){var _0x3173c0=this;return function(){var _0x443112=![];return _0x3173c0['ifTimeIvr'](_0x3d0406[_0xbb42('0x74')],_0x470035,_0x306fcd,_0x284e53,_0x443112);};};Dialer[_0xbb42('0x82')][_0xbb42('0x8d')]=function(_0x46afe9,_0x7f7325,_0x58e85,_0xabf12a,_0x3386fb){var _0x1052c5=[];return new Promise(function(_0x2b6c0f,_0x2d1135){if(!isNotNull(_0x46afe9)){_0xabf12a[_0xbb42('0x67')]=utils[_0xbb42('0x63')][_0xbb42('0x71')];return _0x2d1135(msgResponse(_0xbb42('0x8e'),_0xbb42('0x8f'),_0x58e85+_0xbb42('0x90')));}if(_[_0xbb42('0x42')](_0x46afe9)){_0xabf12a[_0xbb42('0x67')]=utils[_0xbb42('0x63')]['EMPTY_INTERVAL'];return _0x2d1135(msgResponse(_0xbb42('0x8e'),_0xbb42('0x8f'),_0x58e85+_0xbb42('0x91')));}if(_0x7f7325&&_['isUndefined'](config[_0xbb42('0x92')][_0x7f7325])){_0xabf12a[_0xbb42('0x67')]=utils[_0xbb42('0x63')][_0xbb42('0x93')];return _0x2d1135(msgResponse(_0xbb42('0x8e'),_0xbb42('0x8f'),_0x58e85+_0xbb42('0x94')+_0x7f7325));}if(_['isArray'](_0x46afe9)){for(var _0x32a379=0x0;_0x32a379<_0x46afe9['length'];_0x32a379+=0x1){_0x1052c5[_0xbb42('0x95')](ami[_0xbb42('0x96')]({'action':_0xbb42('0x97'),'command':util[_0xbb42('0x84')]('iftime\x20%s,%s',_0x46afe9[_0x32a379]['interval'],!_[_0xbb42('0x39')](config['timezones'][_0x7f7325])?_0x7f7325:'')})[_0xbb42('0x37')](function(_0x2f46ca){return _0x2f46ca[_0xbb42('0x98')][_0xbb42('0x99')](_0xbb42('0x9a'))>=0x0;})[_0xbb42('0x9b')](myreject(_0x2d1135)));}}else{_0x1052c5['push'](ami[_0xbb42('0x96')]({'action':_0xbb42('0x97'),'command':util[_0xbb42('0x84')](_0xbb42('0x9c'),_0x46afe9,!_['isUndefined'](config[_0xbb42('0x92')][_0x7f7325])?_0x7f7325:'')})[_0xbb42('0x37')](function(_0x284c9e){return _0x284c9e['content'][_0xbb42('0x99')](_0xbb42('0x9a'))>=0x0;})[_0xbb42('0x9b')](myreject(_0x2d1135)));}Promise[_0xbb42('0x9d')](_0x1052c5)[_0xbb42('0x37')](function(_0x36bcb7){var _0x587126=_[_0xbb42('0x9e')](_0x36bcb7);if(_0x587126){return _0x2b6c0f(_0x587126);}else{_0xabf12a['message']=_0x3386fb?utils[_0xbb42('0x63')][_0xbb42('0x9f')]:utils[_0xbb42('0x63')][_0xbb42('0xa0')];return _0x2d1135(msgResponse(_0xbb42('0xa1'),_0xbb42('0x8f'),_0xbb42('0xa2')+_0x3386fb+'\x20'+_0x58e85+_0xbb42('0xa3')+util[_0xbb42('0x3e')](_0x46afe9,{'showHidden':![],'depth':null})+_0xbb42('0xa4')+_0x7f7325));}})[_0xbb42('0x9b')](function(_0x208187){return _0x2d1135(msgResponse(_0xbb42('0x8e'),'Failure',JSON[_0xbb42('0x81')](_0x208187)));});});};Dialer[_0xbb42('0x82')][_0xbb42('0xa5')]=function(){var _0x387863=this;return cmHopper[_0xbb42('0xa6')]({'active':![]},{'where':{'active':!![]}})[_0xbb42('0x37')](function(){setInterval(function(){_0x387863['syncCampaigns']();},0x3e8);});};Dialer[_0xbb42('0x82')][_0xbb42('0xa7')]=function(){var _0x214849=this;var _0x303949;for(var _0x9779f4 in this['campaigns']){if(typeof this[_0xbb42('0x1c')][_0x9779f4]!=='undefined'){_0x303949=this[_0xbb42('0x1c')][_0x9779f4];if(utils[_0xbb42('0x78')](_0x303949)&&utils[_0xbb42('0x75')](_0x303949)){_0x303949[_0xbb42('0x7b')]=!![];Promise[_0xbb42('0xa8')]()[_0xbb42('0x37')](checkIsIVRCampaignActive(_0x303949))[_0xbb42('0x37')](checkInterval(_0x303949))['then'](_0x214849['checkIsTrunkReachable'](_0x303949))['then'](_0x214849['checkIfTime'](_0x303949['dialGlobalInterval'],_0x303949[_0xbb42('0xa9')],_0x303949[_0xbb42('0x40')],_0x303949))[_0xbb42('0x37')](_0x214849['checkIfTimeIntervals'](_0x303949[_0xbb42('0x73')],_0x303949[_0xbb42('0xa9')],_0x303949[_0xbb42('0x40')],_0x303949))[_0xbb42('0x37')](_0x214849[_0xbb42('0xaa')](_0x303949))['catch'](loggerCatchQueueSummary(_0xbb42('0xab'),_0x303949));}else{notSendMessagesCampaign(_0x303949);}}}};Dialer[_0xbb42('0x82')][_0xbb42('0xac')]=function(_0x4754d6){if(_0x4754d6[_0xbb42('0xad')]!==_0xbb42('0x8')){clearPredictiveAttributes(_0x4754d6);}switch(_0x4754d6[_0xbb42('0xad')]){case _0xbb42('0xae'):this[_0xbb42('0xaf')](_0x4754d6,0x1);break;case _0xbb42('0xb0'):this[_0xbb42('0xaf')](_0x4754d6,_0x4754d6[_0xbb42('0xb1')]);break;case _0xbb42('0x8'):this[_0xbb42('0x8')](_0x4754d6);break;case _0xbb42('0xb2'):this[_0xbb42('0xaf')](_0x4754d6,0x1);break;default:logger[_0xbb42('0x5f')](_0xbb42('0xb3'),_0x4754d6['name'],_0xbb42('0xb4'));}};Dialer[_0xbb42('0x82')][_0xbb42('0x8e')]=function(_0x5ea467,_0x18fe37){var _0x5086e1=_0x5ea467[_0xbb42('0xa9')];var _0x3529ca=_0x18fe37?_0x5ea467['dialGlobalInterval']:_0x5ea467[_0xbb42('0x73')][_0xbb42('0x74')];logger[_0xbb42('0xb5')](_0xbb42('0xb6'),_0x3529ca,_0x5086e1,_0x5ea467['name'],util['format'](_0xbb42('0xb7'),_0x5ea467['name'],_0x5ea467['id']));var _0x34cdef=null;return Interval[_0xbb42('0xb8')](_0x3529ca,_0x5086e1)['then'](function(_0x324269){if(_0x324269===!![]){return _0x324269;}else{_0x5ea467[_0xbb42('0x67')]=_0x18fe37?utils['CAMPAIGN_STATUS']['OVERTIME_GLOBAL_INTERVAL']:utils[_0xbb42('0x63')][_0xbb42('0xa0')];_0x34cdef=msgResponse(_0xbb42('0xa1'),'Failure',_0xbb42('0xa2')+_0x18fe37+'\x20'+_0x5ea467[_0xbb42('0x40')]+_0xbb42('0xa3')+util[_0xbb42('0x3e')](_0x3529ca,{'showHidden':![],'depth':null})+_0xbb42('0xa4')+_0x5086e1);}if(_0x34cdef!==null){logger[_0xbb42('0xb5')](_0xbb42('0xb9'),_0x34cdef);_0x34cdef['isGlobal']=_0x18fe37;throw _0x34cdef;}})['catch'](function(_0x37a38e){logger[_0xbb42('0x5f')]('AMI\x20IfTime',_0x37a38e);throw msgResponse(_0xbb42('0x80'),_0xbb42('0xba'),util['inspect'](_0x37a38e,{'showHidden':![],'depth':null}));});};Dialer[_0xbb42('0x82')]['syncAgentConnect']=function(_0x5120d8){if(this[_0xbb42('0x1b')][_0x5120d8[_0xbb42('0xbb')]]){if(this[_0xbb42('0xbc')][_0x5120d8['uniqueid']]&&this[_0xbb42('0xbc')][_0x5120d8[_0xbb42('0xbd')]]['type']!==_0xbb42('0xbe')){this[_0xbb42('0xbf')](this[_0xbb42('0x1b')][_0x5120d8[_0xbb42('0xbb')]]);this[_0xbb42('0xbc')][_0x5120d8[_0xbb42('0xbd')]]['answertime']=moment()[_0xbb42('0x84')](_0xbb42('0xc0'));}}};Dialer[_0xbb42('0x82')]['syncAgentComplete']=function(_0x4ebd0d){var _0x240609=this[_0xbb42('0xbc')][_0x4ebd0d[_0xbb42('0xbd')]];if(this[_0xbb42('0x1b')][_0x4ebd0d['queue']]){if(_0x240609&&_0x240609[_0xbb42('0x3b')]!==_0xbb42('0xbe')){delete this[_0xbb42('0xbc')][_0x4ebd0d['uniqueid']];this['voiceQueues'][_0x4ebd0d['queue']]['outboundAnswerCallsDay']+=0x1;var _0x5f1c7a=new AgentComplete(_0x240609,_0x4ebd0d);if(_0x4ebd0d['reason']===_0xbb42('0xc1')){_0x5f1c7a[_0xbb42('0xc2')]=this['voiceQueues'][_0x4ebd0d[_0xbb42('0xbb')]][_0xbb42('0xc3')]&&this[_0xbb42('0x1b')][_0x4ebd0d[_0xbb42('0xbb')]]['dialAgiAfterHangupAgent']?moment()[_0xbb42('0x84')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}hopperUtils[_0xbb42('0xc4')](_0x5f1c7a)[_0xbb42('0x9b')](loggerCatch(_0xbb42('0xc5')));hopperUtils[_0xbb42('0xc6')](_0x5f1c7a)[_0xbb42('0x9b')](loggerCatch(_0xbb42('0xc7')));}}};Dialer[_0xbb42('0x82')][_0xbb42('0xc8')]=function(_0x2f270b){var _0x54e8eb=this[_0xbb42('0xbc')][_0x2f270b[_0xbb42('0xbd')]];var _0x196d97=this;var _0x43f36e=![];var _0x14c1bf;var _0x5537d6;if(this[_0xbb42('0x1b')][_0x2f270b[_0xbb42('0xbb')]]){if(_0x54e8eb&&_0x54e8eb['type']!=='ivr'){delete this[_0xbb42('0xbc')][_0x2f270b['uniqueid']];this[_0xbb42('0xbf')](this[_0xbb42('0x1b')][_0x2f270b[_0xbb42('0xbb')]]);_0x54e8eb[_0xbb42('0xc9')]=moment()[_0xbb42('0x84')](_0xbb42('0xc0'));var _0x55b4a3=new QueueCallerAbandon(_0x54e8eb,_0x2f270b);if(utils[_0xbb42('0x5a')](_0x54e8eb[_0xbb42('0xc9')],_0x54e8eb['responsetime'])>=_0x54e8eb[_0xbb42('0xca')]){this['voiceQueues'][_0x2f270b[_0xbb42('0xbb')]][_0xbb42('0x49')]+=0x1;this[_0xbb42('0x1b')][_0x2f270b[_0xbb42('0xbb')]][_0xbb42('0xcb')]+=0x1;this['voiceQueues'][_0x2f270b[_0xbb42('0xbb')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x55b4a3[_0xbb42('0x6a')]=0xa;_0x55b4a3['statedesc']=_0xbb42('0xcc');_0x55b4a3[_0xbb42('0xcd')]=_0xbb42('0xce');_0x55b4a3[_0xbb42('0xc2')]=this[_0xbb42('0x1b')][_0x2f270b['queue']][_0xbb42('0xc3')]?moment()[_0xbb42('0x84')](_0xbb42('0xc0')):undefined;_0x55b4a3[_0xbb42('0xcf')]+=0x1;_0x55b4a3[_0xbb42('0xd0')]+=0x1;_0x14c1bf=this[_0xbb42('0x1b')][_0x2f270b[_0xbb42('0xbb')]][_0xbb42('0xd1')];_0x5537d6=this['voiceQueues'][_0x2f270b[_0xbb42('0xbb')]][_0xbb42('0xd2')];hopperUtils[_0xbb42('0xd3')](_0x55b4a3,_0x55b4a3[_0xbb42('0x6a')],_0x54e8eb[_0xbb42('0xd4')])[_0xbb42('0x37')](function(_0x259a72){_0x43f36e=_0x259a72[_0xbb42('0xd5')]==0x1;if(_0x55b4a3['countdropretry']>=_0x196d97[_0xbb42('0x1b')][_0x2f270b[_0xbb42('0xbb')]][_0xbb42('0xd6')]){_0x196d97[_0xbb42('0xd7')](_0x55b4a3,_0x259a72[_0xbb42('0xd5')]);}else{hopperUtils[_0xbb42('0xd8')]({'active':![],'countdropretry':_0x55b4a3[_0xbb42('0xcf')],'scheduledat':moment()[_0xbb42('0xd9')](_0x196d97['voiceQueues'][_0x2f270b['queue']][_0xbb42('0xd1')],_0xbb42('0xda'))[_0xbb42('0x84')](_0xbb42('0xc0')),'ContactId':_0x54e8eb[_0xbb42('0xdb')],'ListId':_0x54e8eb[_0xbb42('0xdc')],'VoiceQueueId':_0x54e8eb['VoiceQueueId']||undefined,'CampaignId':_0x54e8eb[_0xbb42('0xdd')]||undefined})[_0xbb42('0x9b')](loggerCatch(_0xbb42('0xde')));var _0xa2a252=new History(_0x55b4a3);_0xa2a252[_0xbb42('0x6a')]=0xa;_0xa2a252['statedesc']=_0xbb42('0xcc');_0xa2a252[_0xbb42('0x6d')]=moment()[_0xbb42('0x84')](_0xbb42('0xc0'));_0xa2a252[_0xbb42('0x6c')]=_0xa2a252[_0xbb42('0x6d')];_0xa2a252[_0xbb42('0xdf')]=_0x55b4a3[_0xbb42('0xdf')];_0xa2a252['calleridnum']=_0x55b4a3[_0xbb42('0xe0')];hopperUtils[_0xbb42('0xc4')](_0xa2a252)['catch'](loggerCatch(_0xbb42('0xe1')));}})[_0xbb42('0x37')](function(){if(_0x43f36e)hopperUtils['swapAdditionalPhones'](_0x55b4a3,_0x14c1bf,_0x5537d6)[_0xbb42('0x37')](function(){return 0x1;});});}else{this[_0xbb42('0x1b')][_0x2f270b['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xbb42('0x1b')][_0x2f270b[_0xbb42('0xbb')]]['outboundDropCallsDayCallersExit']+=0x1;_0x55b4a3['state']=0xb;_0x55b4a3[_0xbb42('0x6b')]=_0xbb42('0xe2');_0x55b4a3[_0xbb42('0xcd')]=_0xbb42('0xe3');_0x55b4a3['countabandonedretry']+=0x1;_0x55b4a3[_0xbb42('0xd0')]+=0x1;_0x14c1bf=this[_0xbb42('0x1b')][_0x2f270b[_0xbb42('0xbb')]][_0xbb42('0xe4')];_0x5537d6=this[_0xbb42('0x1b')][_0x2f270b[_0xbb42('0xbb')]]['callAdditionalPhoneAfterMin'];hopperUtils[_0xbb42('0xd3')](_0x55b4a3,_0x55b4a3[_0xbb42('0x6a')],_0x54e8eb[_0xbb42('0xd4')])['then'](function(_0x66fdfd){if(_0x55b4a3[_0xbb42('0xe5')]>=_0x196d97[_0xbb42('0x1b')][_0x2f270b[_0xbb42('0xbb')]][_0xbb42('0xe6')]){_0x196d97[_0xbb42('0xd7')](_0x55b4a3,_0x66fdfd['additional']);}else{hopperUtils[_0xbb42('0xd8')]({'active':![],'countabandonedretry':_0x55b4a3[_0xbb42('0xe5')],'scheduledat':moment()[_0xbb42('0xd9')](_0x196d97['voiceQueues'][_0x2f270b[_0xbb42('0xbb')]]['dialAbandonedRetryFrequency'],_0xbb42('0xda'))['format'](_0xbb42('0xc0')),'ContactId':_0x54e8eb['ContactId'],'ListId':_0x54e8eb[_0xbb42('0xdc')],'VoiceQueueId':_0x54e8eb[_0xbb42('0xe7')]||undefined,'CampaignId':_0x54e8eb[_0xbb42('0xdd')]||undefined})[_0xbb42('0x9b')](loggerCatch('[rescheduleContact][Abandoned]'));var _0x5cb8ea=new History(_0x55b4a3);_0x5cb8ea[_0xbb42('0x6a')]=0xb;_0x5cb8ea[_0xbb42('0x6b')]=_0xbb42('0xe2');_0x5cb8ea['starttime']=moment()['format'](_0xbb42('0xc0'));_0x5cb8ea[_0xbb42('0x6c')]=_0x5cb8ea[_0xbb42('0x6d')];_0x5cb8ea[_0xbb42('0xdf')]=_0x55b4a3[_0xbb42('0xdf')];_0x5cb8ea[_0xbb42('0xe0')]=_0x55b4a3[_0xbb42('0xe0')];hopperUtils['createHistory'](_0x5cb8ea)[_0xbb42('0x9b')](loggerCatch('[syncAgentComplete][createHistory][11]'));}})[_0xbb42('0x37')](function(){if(_0x43f36e)hopperUtils[_0xbb42('0xe8')](_0x55b4a3,_0x14c1bf,_0x5537d6)[_0xbb42('0x37')](function(){return 0x1;});});}}}};Dialer[_0xbb42('0x82')][_0xbb42('0x30')]=function(_0xd9a41){if(this[_0xbb42('0x21')][_0xd9a41[_0xbb42('0xbd')]]){this['actions'][_0xd9a41[_0xbb42('0xbd')]][_0xbb42('0xe9')]=_0xd9a41[_0xbb42('0xe9')];}if(this[_0xbb42('0xbc')][_0xd9a41[_0xbb42('0xbd')]]){this['uniqueId'][_0xd9a41[_0xbb42('0xbd')]][_0xbb42('0xe9')]=_0xd9a41[_0xbb42('0xe9')];}};Dialer[_0xbb42('0x82')][_0xbb42('0x33')]=function(_0x5757d0){if(!this['actions'][_0x5757d0[_0xbb42('0xea')]]){return;}var _0x11b1dc=this[_0xbb42('0x1b')][this['actions'][_0x5757d0[_0xbb42('0xea')]][_0xbb42('0xbb')]][_0xbb42('0xeb')]||_0xbb42('0xec');if(_0x11b1dc===_0xbb42('0xed')){if(this[_0xbb42('0x21')][_0x5757d0['actionid']]&&_[_0xbb42('0xee')](this['actions'][_0x5757d0[_0xbb42('0xea')]][_0xbb42('0xef')])&&_0x5757d0[_0xbb42('0xf0')]==='1'&&_0x5757d0['paused']==='0'){if(this[_0xbb42('0x1d')][_0x5757d0[_0xbb42('0xf1')]]){if(!this[_0xbb42('0x1d')][_0x5757d0[_0xbb42('0xf1')]][_0xbb42('0xef')]){this[_0xbb42('0x1d')][_0x5757d0[_0xbb42('0xf1')]][_0xbb42('0xef')]=!![];this[_0xbb42('0x21')][_0x5757d0['actionid']][_0xbb42('0xef')]=!![];this[_0xbb42('0x21')][_0x5757d0[_0xbb42('0xea')]][_0xbb42('0xf1')]=_0x5757d0[_0xbb42('0xf1')];}}}}else if(_0x11b1dc===_0xbb42('0xec')){if(this[_0xbb42('0x21')][_0x5757d0[_0xbb42('0xea')]]){if(this[_0xbb42('0x1d')][_0x5757d0[_0xbb42('0xf1')]]){this[_0xbb42('0x21')][_0x5757d0['actionid']][_0xbb42('0xf1')]=_0x5757d0[_0xbb42('0xf1')];if(_[_0xbb42('0xee')](this['queueBooked'][this['actions'][_0x5757d0[_0xbb42('0xea')]][_0xbb42('0xbb')]])){this[_0xbb42('0x24')][this['actions'][_0x5757d0[_0xbb42('0xea')]][_0xbb42('0xbb')]]=[];}this[_0xbb42('0x24')][this[_0xbb42('0x21')][_0x5757d0['actionid']][_0xbb42('0xbb')]]['push'](_[_0xbb42('0x59')](_[_0xbb42('0xf2')](this['actions'][_0x5757d0[_0xbb42('0xea')]],[_0xbb42('0xf3'),_0xbb42('0xf1')]),{'status':_0x5757d0[_0xbb42('0xf0')],'paused':_0x5757d0[_0xbb42('0xf4')]}));}}}};Dialer[_0xbb42('0x82')]['syncQueueStatusComplete']=function(_0x176935){if(!this['actions'][_0x176935[_0xbb42('0xea')]]){return;}var _0x3d39a8=this;var _0x2650cf=this['voiceQueues'][this['actions'][_0x176935[_0xbb42('0xea')]][_0xbb42('0xbb')]];var _0x405ff0=_0x2650cf[_0xbb42('0xeb')]||_0xbb42('0xec');if(_0x405ff0===_0xbb42('0xed')){if(this[_0xbb42('0x21')][_0x176935['actionid']]&&this['actions'][_0x176935[_0xbb42('0xea')]][_0xbb42('0xf1')]){this[_0xbb42('0x1a')][_0xbb42('0xf5')](this[_0xbb42('0x21')][_0x176935[_0xbb42('0xea')]][_0xbb42('0xf3')],this[_0xbb42('0x21')][_0x176935[_0xbb42('0xea')]][_0xbb42('0xf1')])['catch'](function(_0x56b8da){logger['error'](_0xbb42('0xf6'),util[_0xbb42('0x3e')](_0x56b8da,{'showHidden':![],'depth':null}));})[_0xbb42('0x19')](function(){_0x3d39a8[_0xbb42('0xbf')](_0x3d39a8[_0xbb42('0x1b')][_0x3d39a8[_0xbb42('0x21')][_0x176935[_0xbb42('0xea')]][_0xbb42('0xbb')]]);_0x3d39a8[_0xbb42('0x1d')][_0x3d39a8[_0xbb42('0x21')][_0x176935[_0xbb42('0xea')]][_0xbb42('0xf1')]][_0xbb42('0xef')]=![];delete _0x3d39a8['actions'][_0x176935[_0xbb42('0xea')]];unlockQueueStatus(_0x2650cf);});}else{this[_0xbb42('0xbf')](this[_0xbb42('0x1b')][this[_0xbb42('0x21')][_0x176935['actionid']][_0xbb42('0xbb')]]);hopperUtils[_0xbb42('0xd8')]({'active':![],'ContactId':this[_0xbb42('0x21')][_0x176935['actionid']][_0xbb42('0xdb')],'ListId':this['actions'][_0x176935[_0xbb42('0xea')]]['ListId'],'VoiceQueueId':this[_0xbb42('0x21')][_0x176935[_0xbb42('0xea')]][_0xbb42('0xe7')]||undefined,'CampaignId':this[_0xbb42('0x21')][_0x176935[_0xbb42('0xea')]]['CampaignId']||undefined})[_0xbb42('0x9b')](loggerCatch(_0xbb42('0xf7')));delete this[_0xbb42('0x21')][_0x176935[_0xbb42('0xea')]];unlockQueueStatus(_0x2650cf);}}else if(_0x405ff0===_0xbb42('0xec')){var _0x49356f;if(this[_0xbb42('0x21')][_0x176935[_0xbb42('0xea')]]&&!_[_0xbb42('0x42')](this[_0xbb42('0x24')][this[_0xbb42('0x21')][_0x176935[_0xbb42('0xea')]][_0xbb42('0xbb')]])){if(this[_0xbb42('0x25')][_0x3d39a8[_0xbb42('0x21')][_0x176935['actionid']][_0xbb42('0xbb')]]){this[_0xbb42('0x25')][_0x3d39a8[_0xbb42('0x21')][_0x176935['actionid']][_0xbb42('0xbb')]]=this[_0xbb42('0x25')][this['actions'][_0x176935['actionid']][_0xbb42('0xbb')]]?this[_0xbb42('0x25')][this[_0xbb42('0x21')][_0x176935[_0xbb42('0xea')]]['queue']]:this[_0xbb42('0x24')][this[_0xbb42('0x21')][_0x176935[_0xbb42('0xea')]]['queue']]?this[_0xbb42('0x24')][this[_0xbb42('0x21')][_0x176935[_0xbb42('0xea')]][_0xbb42('0xbb')]][_0xbb42('0xf8')]||0x0:0x0;}this[_0xbb42('0x24')][this[_0xbb42('0x21')][_0x176935[_0xbb42('0xea')]][_0xbb42('0xbb')]][_0xbb42('0xf8')]=this['queueBookedRR'][this[_0xbb42('0x21')][_0x176935[_0xbb42('0xea')]][_0xbb42('0xbb')]];for(var _0x1866b8=0x0;_0x1866b8=_0xdcac3b[_0xbb42('0x11b')]){_0x468b62[_0xbb42('0x11c')](_0x542df9,_0x14527b,_0x51e51f,'reason19\x20machine....');}else{if(_0x542df9[_0xbb42('0x115')]>=_0xdcac3b['dialMachineMaxRetry']){_0x468b62[_0xbb42('0x11d')](_0x542df9,_0x14527b,_0x51e51f,'reason\x2019\x20machine....');}else{hopperUtils[_0xbb42('0xd8')]({'active':![],'countmachineretry':_0x542df9[_0xbb42('0x115')],'scheduledat':moment()[_0xbb42('0xd9')](_0xdcac3b[_0xbb42('0x11e')],_0xbb42('0xda'))[_0xbb42('0x84')](_0xbb42('0xc0')),'ContactId':_0x542df9[_0xbb42('0xdb')],'ListId':_0x542df9['ListId'],'VoiceQueueId':_0x542df9[_0xbb42('0xe7')]||undefined,'CampaignId':_0x542df9[_0xbb42('0xdd')]||undefined})[_0xbb42('0x9b')](loggerCatch(_0xbb42('0x11f')));_0x14527b({'reschedule':0x1});}}});}if(_0x254774[_0xbb42('0x3b')]===_0xbb42('0xbe')&&this[_0xbb42('0x1c')][_0x254774[_0xbb42('0xbb')]][_0xbb42('0x10a')]&&_0x5bdfc6[_0xbb42('0x10b')]==='HANGUP'){delete this['uniqueId'][_0x5bdfc6['uniqueid']];this[_0xbb42('0xbf')](this[_0xbb42('0x1c')][_0x254774['queue']]);_0x428b3b=new Hangup(_0x254774,_0x5bdfc6);_0x428b3b[_0xbb42('0x6a')]=0x12;_0x428b3b['statedesc']=_0xbb42('0x120');_0x428b3b[_0xbb42('0x121')]=_0xbb42('0x122');ami['emit'](_0xbb42('0x10e'),ut[_0xbb42('0x10f')](_0x428b3b,_0xbb42('0x110')));this['saveInDb'](_0x428b3b,_0xbb42('0x123'),'[syncHangupInAMDIvr]');}if(_0x254774[_0xbb42('0x3b')]==='ivr'&&this['campaigns'][_0x254774[_0xbb42('0xbb')]][_0xbb42('0x10a')]&&_0x5bdfc6[_0xbb42('0x10b')]===_0xbb42('0x124')){return new Promise(function(_0x395195,_0x57209d){delete _0x468b62['uniqueId'][_0x5bdfc6['uniqueid']];_0x468b62[_0xbb42('0xbf')](_0x468b62['campaigns'][_0x254774[_0xbb42('0xbb')]]);_0x468b62[_0xbb42('0x1c')][_0x254774[_0xbb42('0xbb')]]['outboundAnswerCallsDay']+=0x1;_0x468b62[_0xbb42('0x1c')][_0x254774[_0xbb42('0xbb')]][_0xbb42('0x10d')]+=0x1;var _0xe7e38c=_0x468b62[_0xbb42('0x1c')][_0x254774[_0xbb42('0xbb')]];var _0xf1ba8b=new Hangup(_0x254774,_0x5bdfc6);_0xf1ba8b['state']=0x13;_0xf1ba8b['statedesc']=_0xbb42('0x114');_0xf1ba8b[_0xbb42('0x121')]=_0xbb42('0x122');_0xf1ba8b['countmachineretry']+=0x1;_0xf1ba8b[_0xbb42('0xd0')]+=0x1;_0xf1ba8b[_0xbb42('0x110')]=!![];ami['emit'](_0xbb42('0x10e'),ut[_0xbb42('0x10f')](_0xf1ba8b,_0xbb42('0x110')));hopperUtils['createHistory'](_0xf1ba8b)['catch'](loggerCatch(_0xbb42('0x116')));if(_0xf1ba8b[_0xbb42('0x117')]+_0xf1ba8b[_0xbb42('0x118')]+_0xf1ba8b[_0xbb42('0x119')]+_0xf1ba8b[_0xbb42('0x11a')]+_0xf1ba8b[_0xbb42('0xcf')]+_0xf1ba8b[_0xbb42('0xe5')]+_0xf1ba8b[_0xbb42('0x115')]+_0xf1ba8b[_0xbb42('0x125')]>=_0xe7e38c[_0xbb42('0x11b')]){_0x468b62[_0xbb42('0x11c')](_0xf1ba8b,_0x395195,_0x57209d,_0xbb42('0x126'));}else{if(_0xf1ba8b[_0xbb42('0x115')]>=_0xe7e38c[_0xbb42('0x127')]){_0x468b62[_0xbb42('0x11d')](_0xf1ba8b,_0x395195,_0x57209d,_0xbb42('0x128'));}else{hopperUtils[_0xbb42('0xd8')]({'active':![],'countmachineretry':_0xf1ba8b['countmachineretry'],'scheduledat':moment()[_0xbb42('0xd9')](_0xe7e38c[_0xbb42('0x11e')],'minutes')[_0xbb42('0x84')](_0xbb42('0xc0')),'ContactId':_0xf1ba8b[_0xbb42('0xdb')],'ListId':_0xf1ba8b['ListId'],'VoiceQueueId':_0xf1ba8b[_0xbb42('0xe7')]||undefined,'CampaignId':_0xf1ba8b['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact][Machine]'));_0x395195({'reschedule':0x1});}}});}}};Dialer[_0xbb42('0x82')][_0xbb42('0x2e')]=function(_0x11d2fc){var _0x363128=this['uniqueId'][_0x11d2fc['uniqueid']];var _0x194a94;if(_0x363128&&_0x363128[_0xbb42('0x3b')]==='ivr'){delete this[_0xbb42('0xbc')][_0x11d2fc[_0xbb42('0xbd')]];this[_0xbb42('0xbf')](this[_0xbb42('0x1c')][_0x363128[_0xbb42('0xbb')]]);this[_0xbb42('0x1c')][_0x363128['queue']][_0xbb42('0x129')]+=0x1;_0x194a94=new Hangup(_0x363128,_0x11d2fc);hopperUtils[_0xbb42('0xc4')](_0x194a94)[_0xbb42('0x9b')](loggerCatch(_0xbb42('0x12a')));hopperUtils['moveContactManagedDialer'](_0x194a94)['catch'](loggerCatch(_0xbb42('0x12b')));}if(_0x363128&&_0x363128[_0xbb42('0x3b')]!==_0xbb42('0xbe')&&isNotNull(this['voiceQueues'][_0x363128[_0xbb42('0xbb')]][_0xbb42('0x12c')])){delete this[_0xbb42('0xbc')][_0x11d2fc[_0xbb42('0xbd')]];this['updateOriginated'](this['voiceQueues'][_0x363128['queue']]);this[_0xbb42('0x1b')][_0x363128[_0xbb42('0xbb')]][_0xbb42('0x113')]+=0x1;this[_0xbb42('0x1b')][_0x363128['queue']][_0xbb42('0x10d')]+=0x1;_0x194a94=new Hangup(_0x363128,_0x11d2fc);_0x194a94[_0xbb42('0x6a')]=0x10;_0x194a94['statedesc']=_0xbb42('0x12d');_0x194a94['membername']=_0xbb42('0x12e');hopperUtils[_0xbb42('0xc4')](_0x194a94)[_0xbb42('0x9b')](loggerCatch(_0xbb42('0x12a')));hopperUtils['moveContactManagedDialer'](_0x194a94)[_0xbb42('0x9b')](loggerCatch(_0xbb42('0x12b')));}if(_0x363128&&_0x363128[_0xbb42('0x3b')]!==_0xbb42('0xbe')&&!isNotNull(this[_0xbb42('0x1b')][_0x363128[_0xbb42('0xbb')]][_0xbb42('0x12c')])){delete this[_0xbb42('0xbc')][_0x11d2fc[_0xbb42('0xbd')]];this[_0xbb42('0xbf')](this['voiceQueues'][_0x363128[_0xbb42('0xbb')]]);this[_0xbb42('0x1b')][_0x363128[_0xbb42('0xbb')]]['outboundUnknownCallsDay']+=0x1;_0x194a94=new Hangup(_0x363128,_0x11d2fc);_0x194a94['state']=0xc;_0x194a94[_0xbb42('0x6b')]=_0x11d2fc[_0xbb42('0x12f')];_0x194a94[_0xbb42('0x121')]=_0xbb42('0x130');hopperUtils[_0xbb42('0xc4')](_0x194a94)[_0xbb42('0x9b')](loggerCatch(_0xbb42('0x12a')));hopperUtils['moveContactManagedDialer'](_0x194a94)[_0xbb42('0x9b')](loggerCatch(_0xbb42('0x12b')));}};Dialer[_0xbb42('0x82')][_0xbb42('0x9')]=function(_0x7503b7){var _0x325edc=this;if(!_0x325edc[_0xbb42('0x26')][_0x7503b7['name']]){_0x325edc[_0xbb42('0x26')][_0x7503b7[_0xbb42('0x40')]]={'running':![]};}else if(_0x325edc['queuesSummary'][_0x7503b7[_0xbb42('0x40')]]['running']===!![]){return;}else if(_0x325edc['queuesSummary'][_0x7503b7[_0xbb42('0x40')]][_0xbb42('0x131')]===![]){_0x325edc[_0xbb42('0x26')][_0x7503b7[_0xbb42('0x40')]]['running']=!![];}var _0x492de5=_0x325edc[_0xbb42('0x1b')][_0x7503b7['name']];var _0x174002=_0x492de5[_0xbb42('0x67')]!==utils['CAMPAIGN_STATUS'][_0xbb42('0x76')];var _0xee793d=utils['isPreviewCampaign'](_0x492de5);_0x492de5[_0xbb42('0x132')]=utils[_0xbb42('0x133')](_0x492de5,_0x325edc[_0xbb42('0x1e')]);Promise[_0xbb42('0xa8')]()[_0xbb42('0x37')](function(){if(_0x492de5[_0xbb42('0x132')]===utils['CAMPAIGN_STATUS'][_0xbb42('0x76')]){if(_0x174002){clearPredictiveAttributes(_0x492de5);_0x7503b7[_0xbb42('0x22')]=undefined;_0x7503b7[_0xbb42('0x5b')]=undefined;}if(_0x492de5[_0xbb42('0x132')]===utils[_0xbb42('0x63')][_0xbb42('0x76')]){_0x7503b7[_0xbb42('0x134')]=0x0;_0x7503b7['paused']=0x0;_0x7503b7['inUse']=0x0;_0x7503b7[_0xbb42('0x135')]=0x0;_0x7503b7[_0xbb42('0x136')]=0x0;}}else if(_0x492de5[_0xbb42('0x132')]===utils[_0xbb42('0x63')][_0xbb42('0x137')]&&!_0xee793d){return _0x325edc['ifTime'](_0x492de5,!![])[_0xbb42('0x37')](function(){return _0x325edc[_0xbb42('0x8e')](_0x492de5,![]);})[_0xbb42('0x37')](function(){return _0x325edc[_0xbb42('0xac')](_0x492de5);})[_0xbb42('0x9b')](function(_0x449610){loggerSyncQueueSummary[_0xbb42('0x3c')](_0xbb42('0x138'),util[_0xbb42('0x3e')](_0x449610,{'showHidden':![],'depth':null}));clearPredictiveAttributes(_0x492de5);});}else{clearPredictiveAttributes(_0x492de5);}})[_0xbb42('0x37')](function(){var _0x466c84=_0x7503b7[_0xbb42('0x139')](_0x492de5);if(_0x466c84||_0x492de5['queueSummaryCountersUpdated']){_0x492de5[_0xbb42('0x13a')]=![];_0x7503b7[_0xbb42('0x13b')](_0x492de5);Object[_0xbb42('0x13c')](_0x492de5,_0x7503b7);emitOutboundVoiceQueueSummary(_0x7503b7);}_0x325edc[_0xbb42('0x26')][_0x492de5['name']]['running']=![];})[_0xbb42('0x9b')](function(_0x142c2b){logger[_0xbb42('0x5f')](_0xbb42('0x138'),util[_0xbb42('0x3e')](_0x142c2b,{'showHidden':![],'depth':null}));_0x325edc[_0xbb42('0x26')][_0x492de5[_0xbb42('0x40')]][_0xbb42('0x131')]=![];});};Dialer[_0xbb42('0x82')][_0xbb42('0x2c')]=_[_0xbb42('0x13d')](function(){var _0x3f2050=_['filter'](this['voiceQueues'],function(_0xffd92d){return _0xffd92d['dialPreviewRecallmeReminder'];});var _0x1faa1a=_['filter'](this[_0xbb42('0x1d')],function(_0x84ab5d){return _0x84ab5d[_0xbb42('0x13e')]&&_0x84ab5d['status']===_0xbb42('0x85');});if(_0x3f2050[_0xbb42('0xf9')]>0x0&&_0x1faa1a[_0xbb42('0xf9')]>0x0){return Promise[_0xbb42('0xa8')]()[_0xbb42('0x37')](cmHopper[_0xbb42('0x13f')](_[_0xbb42('0x140')](_0x3f2050,'id'),previewRecallmeReminderInterval,_[_0xbb42('0x140')](_0x1faa1a,'id')))[_0xbb42('0x37')](function(_0x2e7176){for(var _0x3895b0=0x0;_0x3895b0<_0x2e7176['length'];_0x3895b0++){var _0x18cc81=_0x2e7176[_0x3895b0]['Agent']['name'];if(_0x18cc81)io['to'](util['format'](_0xbb42('0x141'),_0x18cc81))[_0xbb42('0x3a')]('user:dialPreviewRecallReminder',{'hopper':_0x2e7176[_0x3895b0]});}})[_0xbb42('0x9b')](function(_0x25b92a){logger[_0xbb42('0x5f')](_0xbb42('0x142'),_0x25b92a);});}},0x3c*0x3e8,{'leading':!![]});Dialer[_0xbb42('0x82')][_0xbb42('0x35')]=function(){var _0x2e4e3f=this;setInterval(function(){_0x2e4e3f[_0xbb42('0x143')](_0x2e4e3f['uniqueId'],_0xbb42('0x144'));_0x2e4e3f['clearZombieChannels'](_0x2e4e3f[_0xbb42('0x21')],'[actions]');},0x32c8);};Dialer['prototype']['clearZombieChannels']=function(_0x1541f9,_0x173629){var _0x2b31ad=this;for(var _0x39cab5 in _0x1541f9){if(typeof _0x1541f9[_0x39cab5]!==_0xbb42('0x145')){this[_0xbb42('0x146')][_0xbb42('0x17')](function(){if(!_[_0xbb42('0xee')](_0x1541f9[_0x39cab5])){return ami['Action']({'action':_0xbb42('0xf0'),'channel':_0x1541f9[_0x39cab5][_0xbb42('0xe9')]})[_0xbb42('0x9b')](function(_0x44b82a){if(_0x44b82a['message']===_0xbb42('0x147')){setTimeout(function(){if(_0x1541f9[_0x39cab5]&&_0x1541f9[_0x39cab5][_0xbb42('0x3b')]!==_0xbb42('0xbe')){_0x2b31ad[_0xbb42('0xbf')](_0x2b31ad[_0xbb42('0x1b')][_0x1541f9[_0x39cab5][_0xbb42('0xbb')]]);logger[_0xbb42('0x5f')](_0xbb42('0x148'),_0x173629,_0x39cab5,_0x1541f9[_0x39cab5][_0xbb42('0xbb')]);delete _0x1541f9[_0x39cab5];}if(_0x1541f9[_0x39cab5]&&_0x1541f9[_0x39cab5][_0xbb42('0x3b')]==='ivr'){_0x2b31ad[_0xbb42('0xbf')](_0x2b31ad[_0xbb42('0x1c')][_0x1541f9[_0x39cab5]['queue']]);logger[_0xbb42('0x5f')](_0xbb42('0x149'),_0x173629,_0x39cab5,_0x1541f9[_0x39cab5][_0xbb42('0xbb')]);delete _0x1541f9[_0x39cab5];}},0x2328);}});}});}}};Dialer['prototype'][_0xbb42('0x14a')]=function(_0xcaaa99){return Promise[_0xbb42('0xa8')]()[_0xbb42('0x37')](voiceQueueRt[_0xbb42('0x14a')](_0xcaaa99))['catch'](loggerCatch(_0xbb42('0x14b')));};Dialer[_0xbb42('0x82')][_0xbb42('0xbf')]=function(_0x1c331c){if(!_[_0xbb42('0x39')](_0x1c331c)&&_0x1c331c!==null){if(typeof _0x1c331c[_0xbb42('0x7c')]!==_0xbb42('0x145')){if(_0x1c331c['originated']>0x0){_0x1c331c['originated']-=0x1;}else{logger['error'](_0xbb42('0x14c'));}}}else{logger[_0xbb42('0x5f')](_0xbb42('0x14d'));}};Dialer['prototype'][_0xbb42('0x14e')]=function(_0x142d61,_0x42da1a){var _0x895bcb=this;return function(_0x3fc723){_0x895bcb[_0xbb42('0xbf')](_0x42da1a);logger[_0xbb42('0x5f')](_0x142d61,util[_0xbb42('0x3e')](_0x3fc723,{'showHidden':![],'depth':null}));};};Dialer['prototype']['emptyContact']=function(_0x499fb3,_0x1b7222,_0x7c7eba){var _0x4cc1fb={'state':0x19,'statedesc':_0xbb42('0x14f')};this[_0xbb42('0xbf')](_0x1b7222);this[_0xbb42('0x111')](_[_0xbb42('0x59')](_0x4cc1fb,_[_0xbb42('0xf2')](_0x7c7eba,['ContactId',_0xbb42('0xdc'),_0xbb42('0x150'),_0xbb42('0xe7'),_0xbb42('0xdd')])),'[emptyContact][createHistory]',_0xbb42('0x151'));logger[_0xbb42('0x5f')](_0x499fb3);};Dialer['prototype'][_0xbb42('0x111')]=function(_0x445069,_0x831dd7,_0x2b1929){hopperUtils[_0xbb42('0xc4')](_0x445069)[_0xbb42('0x9b')](loggerCatch(_0x831dd7));hopperUtils[_0xbb42('0xc6')](_0x445069)[_0xbb42('0x9b')](loggerCatch(_0x2b1929));};Dialer['prototype'][_0xbb42('0xd7')]=function(_0x36663a,_0x302e93){hopperUtils[_0xbb42('0xc4')](_0x36663a)[_0xbb42('0x9b')](loggerCatch(_0xbb42('0xc5')));if(_0x302e93==0x0){hopperUtils[_0xbb42('0xc6')](_0x36663a)[_0xbb42('0x9b')](loggerCatch(_0xbb42('0x152')));}};Dialer['prototype'][_0xbb42('0x142')]=function(_0x997f29){return Promise['resolve']()[_0xbb42('0x37')](cmHopper['handlePreviewRecallNotifications'](_0x997f29['id'],previewRecallmeReminderInterval))[_0xbb42('0x37')](function(_0x26946b){for(var _0x7e12f5=0x0;_0x7e12f5<_0x26946b[_0xbb42('0xf9')];_0x7e12f5++){var _0x2b35ae=_0x26946b[_0x7e12f5]['Agent'][_0xbb42('0x40')];if(_0x2b35ae)io['to'](util['format']('user:%s',_0x2b35ae))[_0xbb42('0x3a')](_0xbb42('0x153'),{'hopper':_0x26946b[_0x7e12f5]});}})[_0xbb42('0x9b')](function(){});};Dialer[_0xbb42('0x82')][_0xbb42('0xaa')]=function(_0x460b19){var _0x473aa8=this;return function(){_0x473aa8[_0xbb42('0x154')](_0x460b19);};};Dialer[_0xbb42('0x82')][_0xbb42('0x155')]=function(_0x4da459,_0x2361c9){var _0x3e168d=this;var _0xbf2f6=uuid['v4']();this[_0xbb42('0x21')][_0xbf2f6]=new Action(_0x4da459,_0x2361c9,_0xbf2f6);return new Promise(function(_0x575351,_0x68b058){if(_[_0xbb42('0x39')](_0x4da459)&&typeof _0x4da459!==_0xbb42('0x156')){return _0x68b058(msgResponse(_0xbb42('0x157'),_0xbb42('0x8f'),_0xbb42('0x158')));}if(_[_0xbb42('0x39')](_0x2361c9[_0xbb42('0x159')])||_0x2361c9['phone']===null){return _0x68b058(msgResponse(_0xbb42('0x157'),_0xbb42('0x8f'),_0xbb42('0x15a')));}var _0x323486={'XMD-CALLERID':_0x3e168d['actions'][_0xbf2f6][_0xbb42('0x15b')](),'XMD-AGI':_0x4da459[_0xbb42('0x12c')]?util[_0xbb42('0x84')](_0xbb42('0x15c'),ipAgi,_0x4da459[_0xbb42('0x12c')]):'NONE','XMD-AGIAFTER':_0x4da459[_0xbb42('0xc3')]?util[_0xbb42('0x84')](_0xbb42('0x15c'),ipAgi,_0x4da459[_0xbb42('0xc3')]):_0xbb42('0x15d'),'XMD-QUEUE':utils[_0xbb42('0x15e')](_0x4da459)?util[_0xbb42('0x84')]('\x22%s,%s%s,,,%s\x22',_0x4da459['name'],_0x4da459[_0xbb42('0x15f')]||'',_0x4da459['dialAgiAfterHangupAgent']?'c':'',_0x4da459[_0xbb42('0xca')]||0x3):'NONE','XMD-CONTACTID':_0x2361c9[_0xbb42('0xdb')],'XMD-CDRTYPE':_0xbb42('0x160'),'CALLERID(all)':_0x3e168d[_0xbb42('0x21')][_0xbf2f6][_0xbb42('0x15b')](),'XMD-AMD':_0x4da459[_0xbb42('0x10a')]?_0xbb42('0x137'):_0xbb42('0x15d'),'XMD-DESTINATION':_0xbb42('0x109')};if(_0x4da459['dialAMDActive']){_0x323486[_0xbb42('0x161')]=_0x4da459[_0xbb42('0x162')]||0x9c4;_0x323486['XMD-AMDGREETING']=_0x4da459[_0xbb42('0x163')]||0x5dc;_0x323486[_0xbb42('0x164')]=_0x4da459[_0xbb42('0x165')]||0x320;_0x323486[_0xbb42('0x166')]=_0x4da459[_0xbb42('0x167')]||0x1388;_0x323486[_0xbb42('0x168')]=_0x4da459[_0xbb42('0x169')]||0x64;_0x323486['XMD-AMDBETWEENWORDSSILENCE']=_0x4da459[_0xbb42('0x16a')]||0x32;_0x323486['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x4da459[_0xbb42('0x16b')]||0x3;_0x323486[_0xbb42('0x16c')]=_0x4da459[_0xbb42('0x16d')]||0x100;_0x323486[_0xbb42('0x16e')]=_0x4da459[_0xbb42('0x16f')]||0x1388;}if(utils[_0xbb42('0x15e')](_0x4da459)){_0x323486[_0xbb42('0x170')]=_0x2361c9[_0xbb42('0xe7')];}else{_0x323486[_0xbb42('0x171')]=_0x2361c9[_0xbb42('0xdd')];}for(var _0x34fda7 in _0x2361c9[_0xbb42('0x172')]){if(typeof _0x2361c9[_0xbb42('0x172')][_0x34fda7]!==_0xbb42('0x145')){if(isNotNull(_0x2361c9['Contact'][_0x34fda7])&&_0x34fda7!=='id'&&_0x34fda7!==_0xbb42('0x173')&&_0x34fda7!=='createdAt'&&_0x34fda7!==_0xbb42('0x174')){_0x323486[util['format'](_0xbb42('0x175'),_0xbb42('0x176'),_[_0xbb42('0x177')](_0x34fda7))]=_0x2361c9[_0xbb42('0x172')][_0x34fda7];}}}var _0x3708aa=_0x3e168d[_0xbb42('0x83')](_0x4da459['Trunk'])?utils[_0xbb42('0x178')](_0x4da459[_0xbb42('0x87')][_0xbb42('0x179')],_0x4da459['dialOriginateCallerIdName'],_0x4da459[_0xbb42('0x17a')]>0x0?utils[_0xbb42('0x17b')](_0x4da459[_0xbb42('0x17c')],_0x4da459[_0xbb42('0x17a')]):_0x4da459[_0xbb42('0x17c')]):utils[_0xbb42('0x178')](_[_0xbb42('0xee')](_0x4da459['TrunkBackup'])?_0x4da459[_0xbb42('0x87')][_0xbb42('0x179')]:_0x4da459[_0xbb42('0x88')][_0xbb42('0x179')],_0x4da459[_0xbb42('0x17d')],_0x4da459[_0xbb42('0x17a')]>0x0?utils[_0xbb42('0x17b')](_0x4da459[_0xbb42('0x17c')],_0x4da459[_0xbb42('0x17a')]):_0x4da459[_0xbb42('0x17c')]);if(_0x3708aa){_0x323486['XMD-ORIGINATECALLERIDNAME']=_0x3e168d['actions'][_0xbf2f6][_0xbb42('0x17e')]=utils[_0xbb42('0x17f')](_0x3708aa);_0x323486['XMD-ORIGINATECALLERIDNUM']=_0x2361c9[_0xbb42('0x159')];}_0x4da459[_0xbb42('0x180')]=_0x323486;return ami[_0xbb42('0x96')]({'actionid':_0xbf2f6,'action':_0xbb42('0x157'),'channel':_0x3e168d['isTrunkReachable'](_0x4da459['Trunk'])?util[_0xbb42('0x84')](_0xbb42('0x181'),_0x4da459[_0xbb42('0x87')]['name'],isNotNull(_0x4da459[_0xbb42('0x182')])?_0x4da459[_0xbb42('0x182')][_0xbb42('0x183')]()||'':'',_0x4da459[_0xbb42('0x184')]>0x0?_0x2361c9[_0xbb42('0x159')][_0xbb42('0x185')](_0x4da459[_0xbb42('0x184')]):_0x2361c9['phone']):util[_0xbb42('0x84')](_0xbb42('0x181'),_['isNil'](_0x4da459[_0xbb42('0x88')])?_0x4da459[_0xbb42('0x87')]['name']:_0x4da459['TrunkBackup'][_0xbb42('0x40')],isNotNull(_0x4da459['dialPrefix'])?_0x4da459[_0xbb42('0x182')]['trim']()||'':'',_0x4da459['dialCutDigit']>0x0?_0x2361c9['phone'][_0xbb42('0x185')](_0x4da459[_0xbb42('0x184')]):_0x2361c9['phone']),'callerid':_0x3708aa,'Exten':_0xbb42('0x109'),'Context':'from-sip','Priority':'1','variable':_0x323486,'timeout':(_0x4da459[_0xbb42('0x186')]||0x1e)*0x3e8,'async':!![],'channelid':_0xbf2f6})[_0xbb42('0x37')](function(_0x194c32){return _0x575351(_0x194c32);})[_0xbb42('0x9b')](function(_0x27ea20){_0x4da459[_0xbb42('0x187')]+=0x1;var _0x562104=new History(_0x3e168d[_0xbb42('0x21')][_0xbf2f6]);logger[_0xbb42('0x5f')](util['format']('[originateError]:\x20%s',JSON[_0xbb42('0x81')](_0x27ea20)));_0x562104[_0xbb42('0x6a')]=0xe;_0x562104[_0xbb42('0x6b')]=_0xbb42('0x188');_0x562104[_0xbb42('0x6d')]=moment()[_0xbb42('0x84')](_0xbb42('0xc0'));_0x562104['endtime']=_0x562104[_0xbb42('0x6d')];hopperUtils['createHistory'](_0x562104)['catch'](loggerCatch('[originate][error]'));_0x3e168d[_0xbb42('0xc6')](_0x562104)['catch'](loggerCatch(_0xbb42('0x189')))[_0xbb42('0x19')](function(){delete _0x3e168d[_0xbb42('0x21')][_0xbf2f6];return _0x68b058(msgResponse(_0xbb42('0x157'),_0xbb42('0xba'),_0xbb42('0x18a')));});});});};Dialer[_0xbb42('0x82')]['checkRetriveMax']=function(_0x272ccf,_0x507123,_0x12a4d7){var _0x22a065=new History(_0x507123);if(_0x22a065['countbusyretry']+_0x22a065[_0xbb42('0x118')]+_0x22a065['countnoanswerretry']+_0x22a065[_0xbb42('0x11a')]+_0x22a065[_0xbb42('0xcf')]+_0x22a065[_0xbb42('0xe5')]+_0x22a065[_0xbb42('0x115')]+_0x22a065[_0xbb42('0x125')]>=_0x12a4d7[_0xbb42('0x11b')]-0x1){return!![];}switch(_0x272ccf){case 0x3:if(_0x22a065['countnoanswerretry']>=_0x12a4d7['dialNoAnswerMaxRetry']-0x1){return!![];}hopperUtils[_0xbb42('0xd8')]({'active':![],'countnoanswerretry':_0x22a065[_0xbb42('0x119')]+=0x1,'scheduledat':moment()[_0xbb42('0xd9')](_0x12a4d7[_0xbb42('0x18b')],_0xbb42('0xda'))[_0xbb42('0x84')](_0xbb42('0xc0')),'ContactId':_0x22a065[_0xbb42('0xdb')],'ListId':_0x22a065['ListId'],'VoiceQueueId':_0x22a065[_0xbb42('0xe7')]||undefined,'CampaignId':_0x22a065['CampaignId']||undefined})['catch'](loggerCatch(_0xbb42('0x18c')));break;case 0x5:if(_0x22a065['countbusyretry']>=_0x12a4d7[_0xbb42('0x18d')]-0x1){return!![];}hopperUtils[_0xbb42('0xd8')]({'active':![],'countbusyretry':_0x22a065[_0xbb42('0x117')]+=0x1,'scheduledat':moment()[_0xbb42('0xd9')](_0x12a4d7[_0xbb42('0x18e')],'minutes')[_0xbb42('0x84')](_0xbb42('0xc0')),'ContactId':_0x22a065[_0xbb42('0xdb')],'ListId':_0x22a065[_0xbb42('0xdc')],'VoiceQueueId':_0x22a065[_0xbb42('0xe7')]||undefined,'CampaignId':_0x22a065['CampaignId']||undefined})[_0xbb42('0x9b')](loggerCatch(_0xbb42('0x18f')));break;case 0x8:if(_0x22a065[_0xbb42('0x118')]>=_0x12a4d7[_0xbb42('0x190')]-0x1){return!![];}hopperUtils[_0xbb42('0xd8')]({'active':![],'countcongestionretry':_0x22a065[_0xbb42('0x118')]+=0x1,'scheduledat':moment()[_0xbb42('0xd9')](_0x12a4d7['dialCongestionRetryFrequency'],_0xbb42('0xda'))[_0xbb42('0x84')](_0xbb42('0xc0')),'ContactId':_0x22a065[_0xbb42('0xdb')],'ListId':_0x22a065[_0xbb42('0xdc')],'VoiceQueueId':_0x22a065[_0xbb42('0xe7')]||undefined,'CampaignId':_0x22a065['CampaignId']||undefined})[_0xbb42('0x9b')](loggerCatch(_0xbb42('0x191')));break;case 0x0:if(_0x22a065[_0xbb42('0x11a')]>=_0x12a4d7[_0xbb42('0x192')]-0x1){return!![];}else{hopperUtils[_0xbb42('0xd8')]({'active':![],'countnosuchnumberretry':_0x22a065[_0xbb42('0x11a')]+=0x1,'scheduledat':moment()['add'](_0x12a4d7['dialNoSuchNumberRetryFrequency'],_0xbb42('0xda'))[_0xbb42('0x84')](_0xbb42('0xc0')),'ContactId':_0x22a065[_0xbb42('0xdb')],'ListId':_0x22a065[_0xbb42('0xdc')],'VoiceQueueId':_0x22a065[_0xbb42('0xe7')]||undefined,'CampaignId':_0x22a065[_0xbb42('0xdd')]||undefined})[_0xbb42('0x9b')](loggerCatch(_0xbb42('0x193')));}break;case 0xa:if(_0x22a065[_0xbb42('0xcf')]>=_0x12a4d7[_0xbb42('0xd6')]-0x1){return!![];}hopperUtils[_0xbb42('0xd8')]({'active':![],'countdropretry':_0x22a065[_0xbb42('0xcf')]+=0x1,'scheduledat':moment()[_0xbb42('0xd9')](_0x12a4d7[_0xbb42('0xd1')],_0xbb42('0xda'))[_0xbb42('0x84')](_0xbb42('0xc0')),'ContactId':_0x22a065[_0xbb42('0xdb')],'ListId':_0x22a065[_0xbb42('0xdc')],'VoiceQueueId':_0x22a065['VoiceQueueId']||undefined,'CampaignId':_0x22a065[_0xbb42('0xdd')]||undefined})['catch'](loggerCatch(_0xbb42('0xde')));break;case 0xb:if(_0x22a065[_0xbb42('0xe5')]>=_0x12a4d7[_0xbb42('0xe6')]-0x1){return!![];}hopperUtils[_0xbb42('0xd8')]({'active':![],'countabandonedretry':_0x22a065[_0xbb42('0xe5')]+=0x1,'scheduledat':moment()[_0xbb42('0xd9')](_0x12a4d7[_0xbb42('0xe4')],_0xbb42('0xda'))['format'](_0xbb42('0xc0')),'ContactId':_0x22a065[_0xbb42('0xdb')],'ListId':_0x22a065[_0xbb42('0xdc')],'VoiceQueueId':_0x22a065[_0xbb42('0xe7')]||undefined,'CampaignId':_0x22a065[_0xbb42('0xdd')]||undefined})[_0xbb42('0x9b')](loggerCatch('[rescheduleContact][Abandoned]'));break;case 0x13:if(_0x22a065[_0xbb42('0x115')]>=_0x12a4d7['dialMachineMaxRetry']-0x1){return!![];}hopperUtils['rescheduleContact']({'active':![],'countmachineretry':_0x22a065[_0xbb42('0x115')]+=0x1,'scheduledat':moment()[_0xbb42('0xd9')](_0x12a4d7[_0xbb42('0x11e')],_0xbb42('0xda'))['format'](_0xbb42('0xc0')),'ContactId':_0x22a065['ContactId'],'ListId':_0x22a065[_0xbb42('0xdc')],'VoiceQueueId':_0x22a065[_0xbb42('0xe7')]||undefined,'CampaignId':_0x22a065[_0xbb42('0xdd')]||undefined})['catch'](loggerCatch(_0xbb42('0x11f')));break;case 0x14:if(_0x22a065[_0xbb42('0x125')]>=_0x12a4d7[_0xbb42('0x194')]-0x1){return!![];}hopperUtils[_0xbb42('0xd8')]({'active':![],'countagentrejectretry':_0x22a065[_0xbb42('0x125')]+=0x1,'scheduledat':moment()['add'](_0x12a4d7[_0xbb42('0x195')],_0xbb42('0xda'))[_0xbb42('0x84')](_0xbb42('0xc0')),'ContactId':_0x22a065[_0xbb42('0xdb')],'ListId':_0x22a065[_0xbb42('0xdc')],'VoiceQueueId':_0x22a065['VoiceQueueId']||undefined,'CampaignId':_0x22a065[_0xbb42('0xdd')]||undefined})[_0xbb42('0x9b')](loggerCatch(_0xbb42('0x196')));break;default:return!![];}};Dialer[_0xbb42('0x82')][_0xbb42('0x105')]=function(_0x6e9438,_0x11eb20,_0x3ea846){var _0x5dcffb=this;var _0x129c62=new History(_0x6e9438);var _0x330a90=![];var _0x2ce0c0;var _0x13475b;return new Promise(function(_0x415c2d,_0x519738){if(_[_0xbb42('0x39')](_0x11eb20)&&typeof _0x11eb20!==_0xbb42('0x156')){return _0x519738(msgResponse(_0xbb42('0x197'),_0xbb42('0x8f'),_0xbb42('0x198')));}if(_[_0xbb42('0x39')](_0x3ea846)&&typeof _0x3ea846!==_0xbb42('0x156')){return _0x519738(msgResponse(_0xbb42('0x197'),_0xbb42('0x8f'),_0xbb42('0x199')));}hopperUtils[_0xbb42('0xd3')](_0x129c62,_0x3ea846[_0xbb42('0x19a')],_0x11eb20)[_0xbb42('0x37')](function(_0x3b5607){if(_0x3b5607[_0xbb42('0xd5')]==0x1)_0x330a90=!![];switch(_0x3ea846[_0xbb42('0x19a')]){case'0':_0x11eb20['outboundNoSuchCallsDay']+=0x1;_0x129c62[_0xbb42('0x6a')]=0x0;_0x129c62[_0xbb42('0x6b')]=_0xbb42('0x19b');_0x129c62[_0xbb42('0x11a')]+=0x1;_0x129c62[_0xbb42('0xd0')]+=0x1;ami[_0xbb42('0x3a')](_0xbb42('0x19c'),ut[_0xbb42('0x10f')](_0x6e9438,_0xbb42('0x19d')));_0x2ce0c0=_0x11eb20['dialNoSuchNumberRetryFrequency'];_0x13475b=_0x11eb20[_0xbb42('0xd2')];hopperUtils['createHistory'](_0x129c62)['catch'](loggerCatch(_0xbb42('0x116')));if(_0x5dcffb[_0xbb42('0x19e')](0x0,_0x6e9438,_0x11eb20)&&!_0x330a90){if(_0x129c62[_0xbb42('0x11a')]>=_0x11eb20[_0xbb42('0x192')]){_0x5dcffb['createStateFinal'](_0x129c62,_0x415c2d,_0x519738,_0xbb42('0x19f'));}else{_0x5dcffb[_0xbb42('0x11c')](_0x129c62,_0x415c2d,_0x519738,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x11eb20['outboundNoAnswerCallsDay']+=0x1;_0x129c62[_0xbb42('0x6a')]=0x3;_0x129c62['statedesc']=_0xbb42('0x1a0');_0x129c62[_0xbb42('0x119')]+=0x1;_0x129c62['countglobal']+=0x1;var _0x4f416a=ut['buildNoAnswerEventPayload'](_0x6e9438,_0x11eb20);ami[_0xbb42('0x3a')](_0xbb42('0x1a1'),_0x4f416a);_0x2ce0c0=_0x11eb20[_0xbb42('0x18b')];_0x13475b=_0x11eb20[_0xbb42('0xd2')];hopperUtils[_0xbb42('0xc4')](_0x129c62)['catch'](loggerCatch(_0xbb42('0x1a2')));if(_0x5dcffb[_0xbb42('0x19e')](0x3,_0x6e9438,_0x11eb20)&&!_0x330a90){if(_0x129c62[_0xbb42('0x119')]>=_0x11eb20[_0xbb42('0x1a3')]){_0x5dcffb[_0xbb42('0x11d')](_0x129c62,_0x415c2d,_0x519738,_0xbb42('0x1a4'));}else{_0x5dcffb['stateGlobal'](_0x129c62,_0x415c2d,_0x519738,_0xbb42('0x1a4'));}}break;case'5':_0x11eb20['outboundBusyCallsDay']+=0x1;_0x129c62[_0xbb42('0x6a')]=0x5;_0x129c62[_0xbb42('0x6b')]=_0xbb42('0x1a5');_0x129c62[_0xbb42('0x117')]+=0x1;_0x129c62['countglobal']+=0x1;ami['emit'](_0xbb42('0x1a6'),ut['buildObj'](_0x6e9438,_0xbb42('0x1a7')));_0x2ce0c0=_0x11eb20[_0xbb42('0x18e')];_0x13475b=_0x11eb20[_0xbb42('0xd2')];hopperUtils[_0xbb42('0xc4')](_0x129c62)['catch'](loggerCatch(_0xbb42('0x1a8')));if(_0x5dcffb[_0xbb42('0x19e')](0x5,_0x6e9438,_0x11eb20)&&!_0x330a90){if(_0x129c62['countbusyretry']>=_0x11eb20[_0xbb42('0x18d')]){_0x5dcffb[_0xbb42('0x11d')](_0x129c62,_0x415c2d,_0x519738,_0xbb42('0x1a9'));}else{_0x5dcffb['stateGlobal'](_0x129c62,_0x415c2d,_0x519738,_0xbb42('0x1a9'));}}break;case'8':_0x11eb20[_0xbb42('0x1aa')]+=0x1;_0x129c62['state']=0x8;_0x129c62[_0xbb42('0x6b')]=_0xbb42('0x1ab');_0x129c62[_0xbb42('0x118')]+=0x1;_0x129c62[_0xbb42('0xd0')]+=0x1;_0x2ce0c0=_0x11eb20['dialCongestionRetryFrequency'];_0x13475b=_0x11eb20[_0xbb42('0xd2')];ami['emit'](_0xbb42('0x1ac'),ut['buildObj'](_0x6e9438,_0xbb42('0x1ad')));hopperUtils[_0xbb42('0xc4')](_0x129c62)[_0xbb42('0x9b')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x5dcffb[_0xbb42('0x19e')](0x8,_0x6e9438,_0x11eb20)&&!_0x330a90){if(_0x129c62[_0xbb42('0x118')]>=_0x11eb20[_0xbb42('0x190')]){_0x5dcffb[_0xbb42('0x11d')](_0x129c62,_0x415c2d,_0x519738,_0xbb42('0x1ae'));}else{_0x5dcffb[_0xbb42('0x11c')](_0x129c62,_0x415c2d,_0x519738,_0xbb42('0x1ae'));}}break;case'11':_0x11eb20[_0xbb42('0x1af')]+=0x1;_0x129c62[_0xbb42('0x6a')]=0xb;_0x129c62['statedesc']=_0xbb42('0xe2');_0x129c62[_0xbb42('0xe5')]+=0x1;_0x129c62[_0xbb42('0xd0')]+=0x1;_0x2ce0c0=_0x11eb20[_0xbb42('0xe4')];_0x13475b=_0x11eb20[_0xbb42('0xd2')];hopperUtils[_0xbb42('0xc4')](_0x129c62)[_0xbb42('0x9b')](loggerCatch(_0xbb42('0x1b0')));if(_0x5dcffb[_0xbb42('0x19e')](0xb,_0x6e9438,_0x11eb20)&&!_0x330a90){if(_0x129c62[_0xbb42('0xe5')]>=_0x11eb20[_0xbb42('0xe6')]){_0x5dcffb[_0xbb42('0x11d')](_0x129c62,_0x415c2d,_0x519738,_0xbb42('0x1b1'));}else{_0x5dcffb[_0xbb42('0x11c')](_0x129c62,_0x415c2d,_0x519738,_0xbb42('0x1b1'));}}break;case'20':_0x11eb20[_0xbb42('0x1b2')]+=0x1;_0x129c62[_0xbb42('0x6a')]=0x14;_0x129c62['statedesc']='AgentReject';_0x129c62['countagentrejectretry']+=0x1;_0x129c62[_0xbb42('0xd0')]+=0x1;_0x2ce0c0=_0x11eb20[_0xbb42('0x195')];_0x13475b=_0x11eb20['callAdditionalPhoneAfterMin'];ami[_0xbb42('0x3a')](_0xbb42('0x1b3'),ut['buildObj'](_0x6e9438,'agentreject'));hopperUtils[_0xbb42('0xc4')](_0x129c62)[_0xbb42('0x9b')](loggerCatch(_0xbb42('0x1b4')));if(_0x5dcffb[_0xbb42('0x19e')](0x14,_0x6e9438,_0x11eb20)&&!_0x330a90){if(_0x129c62[_0xbb42('0x125')]>=_0x11eb20[_0xbb42('0x194')]){_0x5dcffb[_0xbb42('0x11d')](_0x129c62,_0x415c2d,_0x519738,'reason\x2020\x20agentreject');}else{_0x5dcffb[_0xbb42('0x11c')](_0x129c62,_0x415c2d,_0x519738,_0xbb42('0x1b5'));}}break;default:_0x11eb20['outboundUnknownCallsDay']+=0x1;_0x129c62[_0xbb42('0x6a')]=0xc;_0x129c62['statedesc']=_0x3ea846['reason'];_0x2ce0c0=_0x11eb20[_0xbb42('0x195')];_0x13475b=_0x11eb20[_0xbb42('0xd2')];hopperUtils[_0xbb42('0xc4')](_0x129c62)[_0xbb42('0x9b')](loggerCatch(_0xbb42('0x1b6')));if(_0x5dcffb['checkRetriveMax'](_0x3ea846[_0xbb42('0x19a')],_0x6e9438,_0x11eb20)&&!_0x330a90){if(_0x129c62['countbusyretry']+_0x129c62[_0xbb42('0x118')]+_0x129c62[_0xbb42('0x119')]+_0x129c62['countnosuchnumberretry']+_0x129c62[_0xbb42('0xcf')]+_0x129c62['countabandonedretry']+_0x129c62['countmachineretry']+_0x129c62['countagentrejectretry']>=_0x11eb20[_0xbb42('0x11b')]){_0x5dcffb['stateGlobal'](_0x129c62,_0x415c2d,_0x519738,_0x3ea846['reason']);}else{_0x5dcffb[_0xbb42('0x11d')](_0x129c62,_0x415c2d,_0x519738,_0x3ea846[_0xbb42('0x19a')]);}}}})[_0xbb42('0x37')](function(){if(_0x330a90){hopperUtils['swapAdditionalPhones'](_0x129c62,_0x2ce0c0,_0x13475b)[_0xbb42('0x37')](function(){return _0x415c2d(0x1);});}});});};Dialer['prototype'][_0xbb42('0x11c')]=function(_0x52481c,_0x30aa67,_0x381cf2,_0x5a9fd8){var _0x1a8e1d=new Final(_0x52481c);_0x1a8e1d['state']=0xf;_0x1a8e1d['statedesc']=_0xbb42('0x1b7');this[_0xbb42('0x11d')](_0x1a8e1d,_0x30aa67,_0x381cf2,_0x5a9fd8);};Dialer[_0xbb42('0x82')][_0xbb42('0x11d')]=function(_0x5c3412,_0x3d8bf3,_0x41333b,_0x5c5b02){hopperUtils[_0xbb42('0xc6')](_0x5c3412)[_0xbb42('0x37')](function(){return _0x3d8bf3(msgResponse(_0xbb42('0x197'),'Success',_0x5c5b02));})[_0xbb42('0x9b')](function(){return _0x41333b(msgResponse('[moveContactManagedDialer][0]',_0xbb42('0x8f'),_0xbb42('0x1b8')));});};Dialer[_0xbb42('0x82')][_0xbb42('0x8')]=function(_0x4dd6cc){var _0x70828d=_0x4dd6cc[_0xbb42('0x1b9')]/0x64;var _0x5d55da=_0x4dd6cc['outboundDropCallsDayTimeout']/(_0x4dd6cc[_0xbb42('0xcb')]+_0x4dd6cc[_0xbb42('0x113')]);var _0x97ca24=Math[_0xbb42('0x1ba')](_0x4dd6cc['predictiveIntervalAvailable']*(_0x4dd6cc[_0xbb42('0x1bb')]/0x64));var _0x1913a3=Math[_0xbb42('0x1ba')](_0x4dd6cc['predictiveIntervalAvailable']*(_0x4dd6cc['predictiveIntervalMinThreshold']/0x64));var _0x23bf28=_0x4dd6cc[_0xbb42('0x134')]+_0x4dd6cc[_0xbb42('0x135')];var _0x31b7cd=Math[_0xbb42('0x1bc')](_0x4dd6cc[_0xbb42('0x55')]*_0x4dd6cc['erlangAbandonmentRate']*_0x4dd6cc[_0xbb42('0x1bd')]*_0x4dd6cc['predictiveIntervalMultiplicativeFactor']);if(_[_0xbb42('0x39')](_0x4dd6cc[_0xbb42('0x5b')])){if(!_['isUndefined'](_0x4dd6cc[_0xbb42('0x22')])){_0x4dd6cc[_0xbb42('0x22')]=undefined;loggerPredictive[_0xbb42('0x5f')](_0xbb42('0x1be'),_0xbb42('0x1bf'));}if(!_['isUndefined'](_0x4dd6cc['handlePredictive'])){loggerPredictive[_0xbb42('0x5f')](_0xbb42('0x1be'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x4dd6cc[_0xbb42('0x5d')]);_0x4dd6cc[_0xbb42('0x5d')]=undefined;}_0x4dd6cc[_0xbb42('0x5b')]=moment()[_0xbb42('0x84')](_0xbb42('0xc0'));loggerPredictive[_0xbb42('0x43')](_0x4dd6cc[_0xbb42('0x40')],'collection\x20data\x20in\x20progressive\x20at',_0x4dd6cc['startProgressive']);this['handlePower'](_0x4dd6cc,0x1);}else if(ifInterval(_0x4dd6cc[_0xbb42('0x1c0')],_0x4dd6cc[_0xbb42('0x5b')])){this[_0xbb42('0xaf')](_0x4dd6cc,0x1);loggerPredictiveCalls['info'](_0xbb42('0x1c1'),_0x4dd6cc[_0xbb42('0x5b')],_0x4dd6cc['name']);_0x4dd6cc[_0xbb42('0x55')]=0x0;_0x4dd6cc['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x70828d<_0x5d55da&&_0x4dd6cc['dialPredictiveOptimization']==='dropRate'){clearPredictiveAttributes(_0x4dd6cc);loggerPredictive['info'](_0xbb42('0x1c2'),_0xbb42('0x1c3'),_0x5d55da,_0xbb42('0x5b'),_0x4dd6cc[_0xbb42('0x40')]);}else if(_0x31b7cd<_0x4dd6cc[_0xbb42('0x1c4')]&&_0x4dd6cc[_0xbb42('0x1c5')]==='dropRate'){clearPredictiveAttributes(_0x4dd6cc);loggerPredictive['info'](_0xbb42('0x1c6'),_0xbb42('0x1c7'),_0x31b7cd,'Drop\x20in\x20this\x20interval',_0x4dd6cc[_0xbb42('0x1c4')],_0xbb42('0x5b'),_0x4dd6cc[_0xbb42('0x40')]);}else if(!ifInterval(_0x4dd6cc['dialPredictiveInterval'],_0x4dd6cc[_0xbb42('0x5b')])&&_[_0xbb42('0x39')](_0x4dd6cc[_0xbb42('0x22')])&&!_[_0xbb42('0x39')](_0x4dd6cc[_0xbb42('0x5b')])){_0x4dd6cc[_0xbb42('0x22')]=moment()[_0xbb42('0x84')](_0xbb42('0xc0'));loggerPredictive['info'](_0x4dd6cc[_0xbb42('0x40')],_0xbb42('0x1c8'),_0x4dd6cc[_0xbb42('0x22')]);hopperUtils[_0xbb42('0x1c9')](_0x4dd6cc[_0xbb42('0x1c0')])[_0xbb42('0x37')](this[_0xbb42('0x1ca')](_0x4dd6cc))[_0xbb42('0x37')](mergeDataErlangB(_0x4dd6cc))[_0xbb42('0x37')](this[_0xbb42('0x1cb')](_0x4dd6cc))[_0xbb42('0x9b')](loggerCatchPredictive(_0xbb42('0x1cc'),_0x4dd6cc));}else if(!ifInterval(_0x4dd6cc[_0xbb42('0x1c0')],_0x4dd6cc[_0xbb42('0x22')])){_0x4dd6cc['predictiveIntervalErlangCallsDroppedCalls']=0x0;_0x4dd6cc['startPredictive']=moment()[_0xbb42('0x84')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x4dd6cc[_0xbb42('0x40')],_0xbb42('0x1cd'),_0x4dd6cc['startPredictive']);clearInterval(_0x4dd6cc['handlePredictive']);_0x4dd6cc[_0xbb42('0x5d')]=undefined;hopperUtils[_0xbb42('0x1c9')](_0x4dd6cc['dialPredictiveInterval'])['then'](this[_0xbb42('0x1ca')](_0x4dd6cc))[_0xbb42('0x37')](mergeDataErlangB(_0x4dd6cc))[_0xbb42('0x37')](this[_0xbb42('0x1cb')](_0x4dd6cc))[_0xbb42('0x9b')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x4dd6cc));}else if(_0x4dd6cc[_0xbb42('0x1ce')]&&_0x23bf28<_0x4dd6cc['predictiveIntervalAvailable']-_0x1913a3){clearPredictiveAttributes(_0x4dd6cc);loggerPredictive[_0xbb42('0x43')](_0x4dd6cc[_0xbb42('0x40')],_0xbb42('0x1cf'),_0x23bf28,_0xbb42('0x1d0'),_0x4dd6cc[_0xbb42('0x1ce')],'-',_0x1913a3,'=',_0x4dd6cc['predictiveIntervalAvailable']-_0x1913a3,')');}else if(_0x4dd6cc[_0xbb42('0x1ce')]&&_0x23bf28>_0x4dd6cc[_0xbb42('0x1ce')]+_0x97ca24){clearPredictiveAttributes(_0x4dd6cc);loggerPredictive[_0xbb42('0x43')](_0x4dd6cc[_0xbb42('0x40')],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x23bf28,_0xbb42('0x1d1'),_0x4dd6cc[_0xbb42('0x1ce')],'+',_0x97ca24,'=',_0x4dd6cc[_0xbb42('0x1ce')]+_0x97ca24,')');}};Dialer['prototype'][_0xbb42('0x1ca')]=function(_0x4bb824){var _0x6bce90=this;return function(_0x39405f){return new Promise(function(_0x56e499,_0x4e5bb4){_[_0xbb42('0x59')](_0x4bb824,_0x39405f[0x0]);if(checkGetDataPredictive(_0x39405f[0x0])){var _0x2be988=_0x4bb824[_0xbb42('0x1ce')]=_0x4bb824[_0xbb42('0x135')]+_0x4bb824[_0xbb42('0x134')];var _0x5f4aad=_0x4bb824[_0xbb42('0x1c0')]*0x3c;var _0x2013dc=_0x39405f[0x0][_0xbb42('0x4c')]+_0x39405f[0x0][_0xbb42('0x4b')];var _0x585714=(_0x39405f[0x0][_0xbb42('0x47')]+_0x39405f[0x0][_0xbb42('0x49')]+_0x39405f[0x0][_0xbb42('0x4a')])/_0x39405f[0x0][_0xbb42('0x4e')];_0x4bb824[_0xbb42('0x1bd')]=_0x585714>0x0?_0x585714:0x1;switch(_0x4bb824[_0xbb42('0x1c5')]){case _0xbb42('0x1d2'):var _0x5ed381=_0x4bb824['dialPredictiveOptimizationPercentage']/0x64;return _0x6bce90[_0xbb42('0x1d3')](_0x2be988,_0x5f4aad,_0x2013dc,_0x585714,_0x5ed381)[_0xbb42('0x37')](function(_0x19d9d4){return _0x56e499(_0x19d9d4);});case _0xbb42('0x1d4'):var _0x17e0c5=_0x4bb824[_0xbb42('0x1b9')]/0x64;return _0x6bce90[_0xbb42('0x1d5')](_0x2be988,_0x5f4aad,_0x2013dc,_0x585714,_0x17e0c5)[_0xbb42('0x37')](function(_0x4eef7b){return _0x56e499(_0x4eef7b);});default:return _0x4e5bb4(msgResponse(_0xbb42('0x1d6'),_0xbb42('0x8f'),_0xbb42('0x1d7')));}}else{return _0x4e5bb4(msgResponse(_0xbb42('0x1d6'),_0xbb42('0x8f'),_0xbb42('0x1d8')));}});};};Dialer[_0xbb42('0x82')][_0xbb42('0x1d9')]=function(_0xc81163){var _0x12d6b4=this;return function(_0x2409ce){return new Promise(function(_0x2d2cef,_0x26c45a){_[_0xbb42('0x59')](_0xc81163,_0x2409ce[0x0]);if(checkGetDataPredictive(_0x2409ce[0x0])){loggerPredictive[_0xbb42('0x43')](JSON[_0xbb42('0x81')](_0x2409ce[0x0]));if(_0xc81163[_0xbb42('0x1c5')]===_0xbb42('0x1d2')){return _0x12d6b4[_0xbb42('0x14a')](_0xc81163['id'])[_0xbb42('0x37')](function(_0x3d3da1){var _0x37c695=_0xc81163[_0xbb42('0x1da')]-_0x3d3da1[0x0][_0xbb42('0x1db')];var _0x3b7ac1=_0xc81163['dialPredictiveInterval']*0x3c;var _0x3fbd30=_0x2409ce[0x0][_0xbb42('0x4c')]+_0x2409ce[0x0][_0xbb42('0x4b')];var _0x534f5f=(_0x2409ce[0x0]['predictiveIntervalAnsweredCalls']+_0x2409ce[0x0][_0xbb42('0x49')]+_0x2409ce[0x0][_0xbb42('0x4a')])/_0x2409ce[0x0][_0xbb42('0x4e')];var _0x58310e=_0xc81163[_0xbb42('0x1b9')]/0x64;_0xc81163['predictiveIntervalPauses']=_0x3d3da1[0x0][_0xbb42('0x1db')]||0x0;_0xc81163[_0xbb42('0x1bd')]=_0x534f5f>0x0?_0x534f5f:0x1;return _0x12d6b4[_0xbb42('0x1d3')](_0x37c695,_0x3b7ac1,_0x3fbd30,_0x534f5f,_0x58310e);})['then'](function(_0x5b2751){return _0x2d2cef(_0x5b2751);})[_0xbb42('0x9b')](function(_0x4087b8){return _0x26c45a(msgResponse('[CatchErlangB]',_0xbb42('0x8f'),JSON[_0xbb42('0x81')](_0x4087b8)));});}if(_0xc81163[_0xbb42('0x1c5')]==='agentBusyFactor'){return _0x12d6b4['getVoiceQueueRtPauses'](_0xc81163['id'])[_0xbb42('0x37')](function(_0x32722b){var _0x3960e1=_0xc81163[_0xbb42('0x1da')]-_0x32722b[0x0][_0xbb42('0x1db')];var _0x335925=_0xc81163['dialPredictiveInterval']*0x3c;var _0x31df6a=_0x2409ce[0x0]['predictiveIntervalAvgTalktime']+_0x2409ce[0x0][_0xbb42('0x4b')];var _0x96c805=(_0x2409ce[0x0][_0xbb42('0x47')]+_0x2409ce[0x0][_0xbb42('0x49')]+_0x2409ce[0x0][_0xbb42('0x4a')])/_0x2409ce[0x0][_0xbb42('0x4e')];var _0x4c2df1=_0xc81163[_0xbb42('0x1b9')]/0x64;_0xc81163[_0xbb42('0x1dc')]=_0x32722b[0x0][_0xbb42('0x1db')]||0x0;_0xc81163['predictiveIntervalHitRate']=_0x96c805>0x0?_0x96c805:0x1;return _0x12d6b4[_0xbb42('0x1d5')](_0x3960e1,_0x335925,_0x31df6a,_0x96c805,_0x4c2df1);})[_0xbb42('0x37')](function(_0x11eae3){return _0x2d2cef(_0x11eae3);})[_0xbb42('0x9b')](function(_0x8aa90b){return _0x26c45a(msgResponse(_0xbb42('0x1dd'),'Failure',JSON[_0xbb42('0x81')](_0x8aa90b)));});}}else{return _0x26c45a(msgResponse('[getDataPredictive]',_0xbb42('0x8f'),_0xbb42('0x1d8')));}});};};Dialer[_0xbb42('0x82')][_0xbb42('0x1cb')]=function(_0x94a0dd){var _0x4ba9ab=this;return function(){var _0x44c652=0x0;var _0xb7b83a=Math[_0xbb42('0x1bc')](_0x94a0dd['erlangCallToSecond']*0x3e8);if(_0xb7b83a>0x0){_0xb7b83a=_0xb7b83a<0x64?0x64:_0xb7b83a;loggerPredictive[_0xbb42('0x43')](_0x94a0dd[_0xbb42('0x40')],_0xbb42('0x1de'),_0xb7b83a,_0xbb42('0x1df'));_0x94a0dd['handlePredictive']=setInterval(function(){_0x4ba9ab['handlePredictive'](_0x94a0dd);loggerPredictiveCalls[_0xbb42('0x43')](_0xbb42('0x1e0'),_0x44c652+=0x1);},_0xb7b83a);}else{loggerPredictive['info'](_0x94a0dd[_0xbb42('0x40')],_0xbb42('0x1e1'));}};};Dialer['prototype'][_0xbb42('0x1e2')]=function(_0x214816,_0x5d6ab1){var _0xcb0183=this;return function(_0x36eca2){if(_[_0xbb42('0x42')](_0x36eca2)){if(_[_0xbb42('0xee')](_0x5d6ab1[_0xbb42('0x150')])||!_0x5d6ab1[_0xbb42('0x1e3')]){if(_0x214816[_0xbb42('0xad')]==='booked'){_0x214816[_0xbb42('0x6e')]=_[_0xbb42('0x39')](_0x214816[_0xbb42('0x6e')])?!![]:_0x214816[_0xbb42('0x6e')];var _0x43ed50=uuid['v4']();_0xcb0183['actions'][_0x43ed50]=new Action(_0x214816,_0x5d6ab1,_0x43ed50);loggerBooked[_0xbb42('0x43')]('[booked][checkContactBlack]',_0x43ed50,_0xbb42('0x1e4'),JSON['stringify'](_0x214816[_0xbb42('0x6e')]),_0xbb42('0x1e5'),_0x214816['name']);if(_0x214816[_0xbb42('0x6e')]){_0x214816[_0xbb42('0x6e')]=![];_0xcb0183['queueBooked'][_0xcb0183[_0xbb42('0x21')][_0x43ed50]['queue']]=[];ami[_0xbb42('0x96')]({'actionid':_0x43ed50,'action':_0xbb42('0x1e6'),'queue':_0x214816[_0xbb42('0x40')]})['catch'](function(){_0xcb0183[_0xbb42('0xbf')](_0x214816);hopperUtils[_0xbb42('0xd8')]({'active':![],'ContactId':_0xcb0183[_0xbb42('0x21')][_0x43ed50][_0xbb42('0xdb')],'ListId':_0xcb0183[_0xbb42('0x21')][_0x43ed50]['ListId'],'VoiceQueueId':_0xcb0183[_0xbb42('0x21')][_0x43ed50][_0xbb42('0xe7')]||undefined,'CampaignId':_0xcb0183[_0xbb42('0x21')][_0x43ed50][_0xbb42('0xdd')]||undefined})[_0xbb42('0x9b')](loggerCatch(_0xbb42('0x1e7')));delete _0xcb0183[_0xbb42('0x21')][_0x43ed50];});}else{loggerBooked[_0xbb42('0x43')]('[booked][checkContactBlack][else]',JSON[_0xbb42('0x81')](_0x214816['queueStatusComplete']),_0xbb42('0x1e5'),_0x214816[_0xbb42('0x40')]);_0xcb0183[_0xbb42('0xbf')](_0x214816);hopperUtils['rescheduleContact']({'active':![],'ContactId':_0xcb0183[_0xbb42('0x21')][_0x43ed50][_0xbb42('0xdb')],'ListId':_0xcb0183[_0xbb42('0x21')][_0x43ed50][_0xbb42('0xdc')],'VoiceQueueId':_0xcb0183[_0xbb42('0x21')][_0x43ed50][_0xbb42('0xe7')]||undefined,'CampaignId':_0xcb0183['actions'][_0x43ed50]['CampaignId']||undefined})[_0xbb42('0x9b')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0xcb0183[_0xbb42('0x21')][_0x43ed50];}}else{return _0xcb0183[_0xbb42('0x155')](_0x214816,_0x5d6ab1);}}else{if(utils[_0xbb42('0x5a')](undefined,_0x5d6ab1[_0xbb42('0x1e8')])<_0x214816['dialRecallMeTimeout']*0x3c){if(_0x5d6ab1[_0xbb42('0x1e9')]&&!_0x5d6ab1[_0xbb42('0x1e9')][_0xbb42('0x1ea')]){_0xcb0183[_0xbb42('0x1a')]['run'](_0x5d6ab1['id'])['finally'](function(){_0xcb0183[_0xbb42('0xbf')](_0x214816);});}else{hopperUtils[_0xbb42('0x1eb')]({'active':![]},_0x5d6ab1['id'],0x1)[_0xbb42('0x19')](function(){_0xcb0183[_0xbb42('0xbf')](_0x214816);});}}else{_0x214816[_0xbb42('0x1ec')]+=0x1;_0xcb0183['updateOriginated'](_0x214816);if(_0x214816[_0xbb42('0x1ed')]){hopperUtils['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5d6ab1[_0xbb42('0xdb')],'ListId':_0x5d6ab1['ListId'],'VoiceQueueId':_0x5d6ab1[_0xbb42('0xe7')]||undefined,'CampaignId':_0x5d6ab1[_0xbb42('0xdd')]||undefined})[_0xbb42('0x9b')](loggerCatch(_0xbb42('0x1ee')));hopperUtils[_0xbb42('0xc4')](createObjHistory(_0x214816,_0x5d6ab1,utils[_0xbb42('0x63')][_0xbb42('0x1ef')],0x17,_0xbb42('0x1f0')))[_0xbb42('0x9b')](loggerCatch(_0xbb42('0x1f1')));}else{_0xcb0183['saveInDb'](createObjHistory(_0x214816,_0x5d6ab1,utils[_0xbb42('0x63')][_0xbb42('0x1f2')],0x16,_0xbb42('0x1f3')),_0xbb42('0x1f4'),_0xbb42('0x1f5'));}}}}else{_0x214816[_0xbb42('0x1f6')]+=0x1;_0xcb0183['saveInDb'](createObjHistory(_0x214816,_0x5d6ab1,utils[_0xbb42('0x63')][_0xbb42('0x1f7')],0xd,_0xbb42('0x1f8')),_0xbb42('0x1f9'),_0xbb42('0x1fa'));throw _0xbb42('0x1fb');}};};Dialer[_0xbb42('0x82')][_0xbb42('0x154')]=function(_0x1a7159){var _0x6f3ece=this;var _0x854cc6=_0x1a7159[_0xbb42('0x1fc')]-_0x1a7159['originated']-_0x1a7159['temp'];emitCampaignSummary(_0x1a7159);if(_0x854cc6>0x0){if(_0x854cc6>this['maxNumberOriginate']){_0x854cc6=this[_0xbb42('0x1f')];}_0x1a7159[_0xbb42('0x1fd')]+=_0x854cc6;hopperUtils[_0xbb42('0x1fe')](_0x1a7159['id'],_0x854cc6,_0x1a7159[_0xbb42('0x1ff')],_0x1a7159)[_0xbb42('0x37')](function(_0x45b967){_0x1a7159[_0xbb42('0x1fd')]-=_0x854cc6;_0x1a7159[_0xbb42('0x1fd')]=_0x1a7159[_0xbb42('0x1fd')]>0x0?_0x1a7159[_0xbb42('0x1fd')]:0x0;if(!utils[_0xbb42('0x200')](_0x45b967)){_0x1a7159['message']=utils['CAMPAIGN_STATUS'][_0xbb42('0x68')];logger['info'](_0xbb42('0x201')+_0x1a7159[_0xbb42('0x40')]);}else{_0x1a7159[_0xbb42('0x7c')]+=_0x45b967[_0xbb42('0xf9')];_0x1a7159['message']=utils[_0xbb42('0x63')][_0xbb42('0x202')];for(var _0x3a7970=0x0;_0x3a7970<_0x45b967[_0xbb42('0xf9')];_0x3a7970+=0x1){_0x1a7159[_0xbb42('0x203')]+=0x1;if(_[_0xbb42('0xee')](_0x45b967[_0x3a7970])||_[_0xbb42('0xee')](_0x45b967[_0x3a7970]['Contact'])||_[_0xbb42('0xee')](_0x45b967[_0x3a7970]['phone'])){_0x6f3ece[_0xbb42('0x204')]('[actionOriginate]\x20',_0x1a7159,_0x45b967[_0x3a7970]);}else{hopperUtils[_0xbb42('0x205')](_[_0xbb42('0xf2')](_0x45b967[_0x3a7970],[_0xbb42('0xdd'),_0xbb42('0x159')]))[_0xbb42('0x37')](_0x6f3ece[_0xbb42('0x1e2')](_0x1a7159,_0x45b967[_0x3a7970]))['catch'](_0x6f3ece['loggerHandler'](_0xbb42('0x206'),_0x1a7159));}}}})[_0xbb42('0x9b')](loggerGetContactDialer(_0xbb42('0x207'),_0x1a7159,_0x854cc6));}};Dialer[_0xbb42('0x82')][_0xbb42('0xaf')]=function(_0xa6654a,_0x473114){var _0x39d0cc=this;var _0x2a9e68=[];if(_0x473114<0x1||_0xa6654a[_0xbb42('0xad')]===_0xbb42('0xb2')){_0x473114=0x1;}var _0x9a36e6=Math[_0xbb42('0x1bc')](_0xa6654a[_0xbb42('0x134')]*_0x473114)-_0xa6654a[_0xbb42('0x7c')]-_0xa6654a['temp'];if(_0xa6654a[_0xbb42('0x208')]>0x0){var _0x3334e3=_0xa6654a[_0xbb42('0x208')]-_0xa6654a['originated']-_0xa6654a[_0xbb42('0x135')]-_0xa6654a['temp']-_0xa6654a[_0xbb42('0x136')];if(_0x9a36e6>_0x3334e3){_0x9a36e6=_0x3334e3;}}if(_0x9a36e6>0x0){if(_0xa6654a[_0xbb42('0xad')]==='booked'){_0x9a36e6=0x1;}if(_0x9a36e6>this[_0xbb42('0x1f')]){_0x9a36e6=this[_0xbb42('0x1f')];}_0xa6654a['temp']+=_0x9a36e6;for(var _0x53f248 in this[_0xbb42('0x1d')]){if(typeof this['agents'][_0x53f248]!=='undefined'){if(this[_0xbb42('0x1d')][_0x53f248][_0xbb42('0x6a')]===_0xbb42('0x209')&&this['agents'][_0x53f248][_0xbb42('0xf0')]==='reachable'){_0x2a9e68['push'](this[_0xbb42('0x1d')][_0x53f248]['id']);}}}hopperUtils[_0xbb42('0x20a')](_0xa6654a,_0x2a9e68,_0x9a36e6)[_0xbb42('0x37')](function(_0x5ebdb9){_0xa6654a[_0xbb42('0x1fd')]-=_0x9a36e6;_0xa6654a[_0xbb42('0x1fd')]=_0xa6654a[_0xbb42('0x1fd')]>0x0?_0xa6654a[_0xbb42('0x1fd')]:0x0;if(!utils[_0xbb42('0x200')](_0x5ebdb9)){hopperUtils['countReScheduled'](_0xa6654a)[_0xbb42('0x37')](sendMessageReschedule(_0xa6654a))[_0xbb42('0x9b')](loggerCatch('[countReScheduled]\x20'));}else{_0xa6654a[_0xbb42('0x7c')]+=_0x5ebdb9[_0xbb42('0xf9')];_0xa6654a[_0xbb42('0x67')]=_0xa6654a[_0xbb42('0xad')]===_0xbb42('0xb2')?utils[_0xbb42('0x63')][_0xbb42('0x137')]:utils[_0xbb42('0x63')][_0xbb42('0x202')];for(var _0x18d5ae=0x0;_0x18d5ae<_0x5ebdb9[_0xbb42('0xf9')];_0x18d5ae+=0x1){if(_[_0xbb42('0xee')](_0x5ebdb9[_0x18d5ae])||_[_0xbb42('0xee')](_0x5ebdb9[_0x18d5ae][_0xbb42('0x172')])||_[_0xbb42('0xee')](_0x5ebdb9[_0x18d5ae][_0xbb42('0x159')])){_0x39d0cc[_0xbb42('0x204')](_0xbb42('0x20b'),_0xa6654a,_0x5ebdb9[_0x18d5ae]);}else{hopperUtils[_0xbb42('0x20c')](_['pick'](_0x5ebdb9[_0x18d5ae],[_0xbb42('0xe7'),_0xbb42('0x159')]))[_0xbb42('0x37')](_0x39d0cc[_0xbb42('0x1e2')](_0xa6654a,_0x5ebdb9[_0x18d5ae]))[_0xbb42('0x9b')](_0x39d0cc[_0xbb42('0x14e')](_0xbb42('0x20b'),_0xa6654a));}}}})[_0xbb42('0x9b')](loggerGetContactDialer('[getContactDialer2]',_0xa6654a,_0x9a36e6));}};Dialer['prototype'][_0xbb42('0x5d')]=function(_0x1e7313){if(_0x1e7313[_0xbb42('0x208')]>0x0){var _0xc80d02=_0x1e7313[_0xbb42('0x208')]-_0x1e7313['originated']-_0x1e7313[_0xbb42('0x135')];if(_0xc80d02>0x0){this[_0xbb42('0x20d')](_0x1e7313);}else{loggerPredictiveCalls[_0xbb42('0x43')](_0xbb42('0x20e'));}}else{this[_0xbb42('0x20d')](_0x1e7313);}};Dialer['prototype'][_0xbb42('0x20d')]=function(_0x4bed9a){var _0x457ea2=this;var _0x5cb97e=[];_0x4bed9a['originated']+=0x1;for(var _0x3c7ced in this[_0xbb42('0x1d')]){if(typeof this['agents'][_0x3c7ced]!=='undefined'){if(this[_0xbb42('0x1d')][_0x3c7ced]['state']===_0xbb42('0x209')&&this[_0xbb42('0x1d')][_0x3c7ced][_0xbb42('0xf0')]===_0xbb42('0x85')){_0x5cb97e[_0xbb42('0x95')](this[_0xbb42('0x1d')][_0x3c7ced]['id']);}}}return this['getContactDialer'](_0x4bed9a['id'],_0x5cb97e,0x1,_0x4bed9a[_0xbb42('0x1ff')],_0x4bed9a)['then'](function(_0x4e0934){if(!utils[_0xbb42('0x200')](_0x4e0934)){utils[_0xbb42('0x61')](_0x4bed9a,0x1,0x0);return hopperUtils[_0xbb42('0x20f')](_0x4bed9a)['then'](sendMessageReschedule(_0x4bed9a))[_0xbb42('0x9b')](loggerCatch(_0xbb42('0x210')));}else{_0x4bed9a[_0xbb42('0x67')]=utils[_0xbb42('0x63')][_0xbb42('0x202')];if(_['isNil'](_0x4e0934[0x0])||_[_0xbb42('0xee')](_0x4e0934[0x0][_0xbb42('0x172')])||_['isNil'](_0x4e0934[0x0]['phone'])){_0x457ea2[_0xbb42('0x204')]('[actionOriginate]\x20',_0x4bed9a,_0x4e0934[0x0]);}else{return hopperUtils[_0xbb42('0x20c')](_[_0xbb42('0xf2')](_0x4e0934[0x0],['VoiceQueueId','phone']))[_0xbb42('0x37')](_0x457ea2[_0xbb42('0x1e2')](_0x4bed9a,_0x4e0934[0x0]))[_0xbb42('0x9b')](_0x457ea2[_0xbb42('0x14e')](_0xbb42('0x211'),_0x4bed9a));}}})[_0xbb42('0x9b')](loggerGetContactDialer(_0xbb42('0x212'),_0x4bed9a,0x1));};Dialer[_0xbb42('0x82')]['abandonmentRate']=function(_0x308c31,_0x199533,_0x837c82,_0x437594,_0x3407fd,_0xd34046){loggerPredictive[_0xbb42('0x43')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xbb42('0x43')]('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',_0x308c31);loggerPredictive[_0xbb42('0x43')](_0xbb42('0x213'),_0x199533);loggerPredictive[_0xbb42('0x43')](_0xbb42('0x214'),_0x837c82);loggerPredictive[_0xbb42('0x43')](_0xbb42('0x215'),_0x437594);loggerPredictive[_0xbb42('0x43')](_0xbb42('0x216'),_0x3407fd);loggerPredictive[_0xbb42('0x43')](_0xbb42('0x4d'));return new Promise(function(_0xb3ed63,_0x319d13){if(_0x308c31<=0x0||isNaN(_0x308c31)){return _0x319d13(msgResponse(_0xbb42('0x217'),_0xbb42('0xba'),_0xbb42('0x218')+_0x308c31));}if(_0x837c82<=0x0||isNaN(_0x837c82)){return _0x319d13(msgResponse(_0xbb42('0x217'),'Error',_0xbb42('0x219')+_0x837c82));}if(_0x437594<=0x0||isNaN(_0x437594)){return _0x319d13(msgResponse(_0xbb42('0x217'),_0xbb42('0xba'),_0xbb42('0x21a')+_0x437594));}if(_0x199533<=0x0||isNaN(_0x199533)){return _0x319d13(msgResponse(_0xbb42('0x217'),_0xbb42('0xba'),'interval\x20=\x20'+_0x199533));}if(_0x3407fd<=0x0||isNaN(_0x3407fd)){return _0x319d13(msgResponse(_0xbb42('0x217'),_0xbb42('0xba'),_0xbb42('0x21b')+_0x3407fd));}_0xd34046=_0xd34046||0x0;var _0x2db4c3=0x1/_0x837c82;var _0x3b6d1e=0x0;var _0x527f26=0x0;var _0x9f5cac=0x0;var _0x319935=0x0;for(var _0x4ae0c5=0x0;_0x9f5cac<_0x3407fd;_0x4ae0c5+=0x1){_0x527f26=_0x4ae0c5/_0x199533;_0x3b6d1e=(_0x437594*_0x527f26+_0xd34046)/_0x2db4c3;_0x9f5cac=utils[_0xbb42('0x21c')](_0x3b6d1e,_0x308c31);_0x319935=_0x3b6d1e/_0x308c31*(0x1-utils[_0xbb42('0x21c')](_0x3b6d1e,_0x308c31));}return _0xb3ed63({'erlangCalls':_0x4ae0c5,'erlangCallToSecond':_0x199533/_0x4ae0c5,'erlangAbandonmentRate':_0x9f5cac,'erlangBusyFactor':_0x319935});});};Dialer['prototype'][_0xbb42('0x1d5')]=function(_0x4c7035,_0x5e2f0d,_0x31ca1a,_0x33a9bd,_0x1b228e,_0x142b51){loggerPredictive[_0xbb42('0x43')](_0xbb42('0x21d'));loggerPredictive[_0xbb42('0x43')](_0xbb42('0x21e'),_0x4c7035);loggerPredictive[_0xbb42('0x43')](_0xbb42('0x213'),_0x5e2f0d);loggerPredictive['info'](_0xbb42('0x214'),_0x31ca1a);loggerPredictive[_0xbb42('0x43')](_0xbb42('0x215'),_0x33a9bd);loggerPredictive[_0xbb42('0x43')](_0xbb42('0x21f'),_0x1b228e);loggerPredictive[_0xbb42('0x43')](_0xbb42('0x4d'));return new Promise(function(_0x4da9a4,_0x2e6d04){if(_0x4c7035<=0x0||isNaN(_0x4c7035)){return _0x2e6d04(msgResponse(_0xbb42('0x220'),_0xbb42('0xba'),_0xbb42('0x218')+_0x4c7035));}if(_0x31ca1a<=0x0||isNaN(_0x31ca1a)){return _0x2e6d04(msgResponse(_0xbb42('0x220'),_0xbb42('0xba'),_0xbb42('0x219')+_0x31ca1a));}if(_0x33a9bd<=0x0||isNaN(_0x33a9bd)){return _0x2e6d04(msgResponse(_0xbb42('0x220'),'Error',_0xbb42('0x21a')+_0x33a9bd));}if(_0x5e2f0d<=0x0||isNaN(_0x5e2f0d)){return _0x2e6d04(msgResponse(_0xbb42('0x220'),'Error','interval\x20=\x20'+_0x5e2f0d));}if(_0x1b228e<=0x0||isNaN(_0x1b228e)){return _0x2e6d04(msgResponse(_0xbb42('0x220'),_0xbb42('0xba'),_0xbb42('0x221')+_0x1b228e));}_0x142b51=_0x142b51||0x0;var _0x59cb0c=0x1/_0x31ca1a;var _0x44664c=0x0;var _0x57eeb0=0x0;var _0x1e7e30=0x0;var _0x5d193c=0x0;for(var _0x2c23b9=0x0;_0x5d193c<_0x1b228e;_0x2c23b9+=0x1){_0x57eeb0=_0x2c23b9/_0x5e2f0d;_0x44664c=(_0x33a9bd*_0x57eeb0+_0x142b51)/_0x59cb0c;_0x1e7e30=utils['erlangb'](_0x44664c,_0x4c7035);_0x5d193c=_0x44664c/_0x4c7035*(0x1-utils[_0xbb42('0x21c')](_0x44664c,_0x4c7035));}return _0x4da9a4({'erlangCalls':_0x2c23b9,'erlangCallToSecond':_0x5e2f0d/_0x2c23b9,'erlangAbandonmentRate':_0x1e7e30,'erlangBusyFactor':_0x5d193c});});};module[_0xbb42('0x222')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/models/action.js b/server/services/ami/dialer/models/action.js index a4d12b4..1260eea 100644 --- a/server/services/ami/dialer/models/action.js +++ b/server/services/ami/dialer/models/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5321=['countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','substring','getQueue','exports','util','lodash','moment','isNil','string','name','Contact','firstName','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat'];(function(_0x21383b,_0x5158af){var _0x1e55ed=function(_0x3bbc5d){while(--_0x3bbc5d){_0x21383b['push'](_0x21383b['shift']());}};_0x1e55ed(++_0x5158af);}(_0x5321,0x1d4));var _0x1532=function(_0x1cce4d,_0x5bc2cc){_0x1cce4d=_0x1cce4d-0x0;var _0x5aa577=_0x5321[_0x1cce4d];return _0x5aa577;};'use strict';var util=require(_0x1532('0x0'));var _=require(_0x1532('0x1'));var moment=require(_0x1532('0x2'));function checkNameSurname(_0x3ceee8,_0x77ea13,_0x190a3c){var _0x29c7d6='';if(!_[_0x1532('0x3')](_0x77ea13)&&_0x1532('0x4')===typeof _0x77ea13){_0x29c7d6+=_0x77ea13;}if(!_[_0x1532('0x3')](_0x190a3c)&&'string'===typeof _0x190a3c){_0x29c7d6+='\x20'+_0x190a3c;}if(_0x29c7d6!==''){return _0x29c7d6;}return _0x3ceee8;}function Action(_0x8d8e24,_0xc976a8,_0x589db8){this['voiceQueue']=_0x8d8e24;this['uniqueid']=_0x589db8||undefined;this[_0x1532('0x5')]=checkNameSurname(_0xc976a8[_0x1532('0x6')]['phone'],_0xc976a8[_0x1532('0x6')][_0x1532('0x7')],_0xc976a8[_0x1532('0x6')][_0x1532('0x8')]);this[_0x1532('0x9')]=_0xc976a8[_0x1532('0xa')];this[_0x1532('0xb')]=_0x8d8e24[_0x1532('0x5')];this['active']=_0xc976a8[_0x1532('0xc')]||![];this[_0x1532('0xd')]=_0x8d8e24['type'];this[_0x1532('0xe')]=_0x8d8e24[_0x1532('0xe')]||0x3;this[_0x1532('0xf')]=_0xc976a8[_0x1532('0xf')];this[_0x1532('0x10')]=_0xc976a8[_0x1532('0x10')];this[_0x1532('0x11')]=_0xc976a8['countcongestionretry'];this[_0x1532('0x12')]=_0xc976a8[_0x1532('0x12')];this[_0x1532('0x13')]=_0xc976a8[_0x1532('0x13')];this['countdropretry']=_0xc976a8['countdropretry'];this[_0x1532('0x14')]=_0xc976a8[_0x1532('0x14')];this[_0x1532('0x15')]=_0xc976a8['countmachineretry'];this[_0x1532('0x16')]=_0xc976a8[_0x1532('0x16')];this[_0x1532('0x17')]=_0xc976a8[_0x1532('0x17')];this[_0x1532('0x18')]=_0xc976a8['ListId'];this['UserId']=_0xc976a8[_0x1532('0x19')];this[_0x1532('0x1a')]=_0xc976a8['VoiceQueueId'];this[_0x1532('0x1b')]=_0xc976a8[_0x1532('0x1b')];this[_0x1532('0x1c')]=_0xc976a8['id'];this[_0x1532('0x1d')]=_0xc976a8[_0x1532('0x6')][_0x1532('0x7')]||'';this[_0x1532('0x1e')]=moment()[_0x1532('0x1f')](_0x1532('0x20'));this[_0x1532('0x21')]=_0xc976a8[_0x1532('0x21')];this[_0x1532('0x22')]=_0xc976a8[_0x1532('0x22')];this[_0x1532('0x23')]=_0xc976a8[_0x1532('0x23')];this[_0x1532('0x24')]=_0xc976a8[_0x1532('0x24')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x1532('0x25')][_0x1532('0x26')]=function(){return util['format'](_0x1532('0x27'),this[_0x1532('0x5')],this[_0x1532('0x28')]['dialCutDigit']>0x0?this[_0x1532('0x9')][_0x1532('0x29')](this[_0x1532('0x28')]['dialCutDigit']):this[_0x1532('0x9')]);};Action[_0x1532('0x25')][_0x1532('0x2a')]=function(){return this[_0x1532('0xb')];};module[_0x1532('0x2b')]=Action; \ No newline at end of file +var _0x4d90=['voiceQueue','name','Contact','firstName','lastName','number','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','getCaller','format','\x22%s\x22\x20<%s>','dialCutDigit','prototype','exports','lodash','isNil','string'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4d90,0x1a1));var _0x04d9=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x4d90[_0x376b45];return _0x2341b3;};'use strict';var util=require('util');var _=require(_0x04d9('0x0'));var moment=require('moment');function checkNameSurname(_0x12ad66,_0x8c1bd0,_0x54d57b){var _0x4f0d1f='';if(!_[_0x04d9('0x1')](_0x8c1bd0)&&'string'===typeof _0x8c1bd0){_0x4f0d1f+=_0x8c1bd0;}if(!_[_0x04d9('0x1')](_0x54d57b)&&_0x04d9('0x2')===typeof _0x54d57b){_0x4f0d1f+='\x20'+_0x54d57b;}if(_0x4f0d1f!==''){return _0x4f0d1f;}return _0x12ad66;}function Action(_0xbba453,_0x41259c,_0x1d42d8){this[_0x04d9('0x3')]=_0xbba453;this['uniqueid']=_0x1d42d8||undefined;this[_0x04d9('0x4')]=checkNameSurname(_0x41259c[_0x04d9('0x5')]['phone'],_0x41259c[_0x04d9('0x5')][_0x04d9('0x6')],_0x41259c['Contact'][_0x04d9('0x7')]);this[_0x04d9('0x8')]=_0x41259c[_0x04d9('0x9')];this[_0x04d9('0xa')]=_0xbba453[_0x04d9('0x4')];this[_0x04d9('0xb')]=_0x41259c[_0x04d9('0xb')]||![];this[_0x04d9('0xc')]=_0xbba453['type'];this[_0x04d9('0xd')]=_0xbba453['dialQueueTimeout']||0x3;this[_0x04d9('0xe')]=_0x41259c[_0x04d9('0xe')];this[_0x04d9('0xf')]=_0x41259c[_0x04d9('0xf')];this['countcongestionretry']=_0x41259c[_0x04d9('0x10')];this[_0x04d9('0x11')]=_0x41259c[_0x04d9('0x11')];this[_0x04d9('0x12')]=_0x41259c[_0x04d9('0x12')];this[_0x04d9('0x13')]=_0x41259c['countdropretry'];this[_0x04d9('0x14')]=_0x41259c[_0x04d9('0x14')];this['countmachineretry']=_0x41259c[_0x04d9('0x15')];this[_0x04d9('0x16')]=_0x41259c['countagentrejectretry'];this[_0x04d9('0x17')]=_0x41259c['ContactId'];this['ListId']=_0x41259c['ListId'];this[_0x04d9('0x18')]=_0x41259c[_0x04d9('0x18')];this[_0x04d9('0x19')]=_0x41259c[_0x04d9('0x19')];this[_0x04d9('0x1a')]=_0x41259c['CampaignId'];this[_0x04d9('0x1b')]=_0x41259c['id'];this[_0x04d9('0x1c')]=_0x41259c['Contact'][_0x04d9('0x6')]||'';this[_0x04d9('0x1d')]=moment()['format'](_0x04d9('0x1e'));this[_0x04d9('0x1f')]=_0x41259c[_0x04d9('0x1f')];this[_0x04d9('0x20')]=_0x41259c[_0x04d9('0x20')];this[_0x04d9('0x21')]=_0x41259c[_0x04d9('0x21')];this['recallme']=_0x41259c[_0x04d9('0x22')];this[_0x04d9('0x23')]='';this['originatecalleridname']='';}Action['prototype'][_0x04d9('0x24')]=function(){return util[_0x04d9('0x25')](_0x04d9('0x26'),this[_0x04d9('0x4')],this[_0x04d9('0x3')][_0x04d9('0x27')]>0x0?this['number']['substring'](this[_0x04d9('0x3')][_0x04d9('0x27')]):this['number']);};Action[_0x04d9('0x28')]['getQueue']=function(){return this[_0x04d9('0xa')];};module[_0x04d9('0x29')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/models/agentComplete.js b/server/services/ami/dialer/models/agentComplete.js index 9960451..22372a0 100644 --- a/server/services/ami/dialer/models/agentComplete.js +++ b/server/services/ami/dialer/models/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2187=['statedesc','Answer','scheduledat','campaigntype','outbound','queue','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','../utils','state'];(function(_0x140ca1,_0x37dbca){var _0x12d530=function(_0x5f3aaa){while(--_0x5f3aaa){_0x140ca1['push'](_0x140ca1['shift']());}};_0x12d530(++_0x37dbca);}(_0x2187,0x1e2));var _0x7218=function(_0x2e6c75,_0x1bdbb7){_0x2e6c75=_0x2e6c75-0x0;var _0x13a9ea=_0x2187[_0x2e6c75];return _0x13a9ea;};'use strict';var moment=require('moment');var utils=require(_0x7218('0x0'));function AgentComplete(_0x373dd3,_0x1058ab){this[_0x7218('0x1')]=0x4;this[_0x7218('0x2')]=_0x7218('0x3');this[_0x7218('0x4')]=_0x373dd3[_0x7218('0x4')];this['type']=_0x373dd3['type'];this[_0x7218('0x5')]=_0x373dd3['type']===_0x7218('0x6')?_0x7218('0x7'):_0x373dd3[_0x7218('0x8')];this[_0x7218('0x9')]=_0x373dd3[_0x7218('0x9')];this[_0x7218('0xa')]=_0x373dd3[_0x7218('0xa')];this[_0x7218('0xb')]=_0x373dd3[_0x7218('0xb')];this[_0x7218('0xc')]=_0x373dd3[_0x7218('0x9')]+_0x373dd3[_0x7218('0xa')]+_0x373dd3['countnoanswerretry']+_0x373dd3['countnosuchnumberretry']+_0x373dd3[_0x7218('0xd')]+_0x373dd3[_0x7218('0xe')]+_0x373dd3[_0x7218('0xf')]+_0x373dd3[_0x7218('0x10')];this[_0x7218('0x11')]=_0x373dd3[_0x7218('0x11')];this['countdropretry']=_0x373dd3[_0x7218('0xd')];this[_0x7218('0xe')]=_0x373dd3[_0x7218('0xe')];this['countmachineretry']=_0x373dd3[_0x7218('0xf')];this[_0x7218('0x10')]=_0x373dd3['countagentrejectretry'];this[_0x7218('0x12')]=_0x1058ab[_0x7218('0x12')];this[_0x7218('0x13')]=_0x373dd3[_0x7218('0x14')];this[_0x7218('0x15')]=_0x373dd3[_0x7218('0x16')];this[_0x7218('0x17')]=_0x373dd3[_0x7218('0x17')];this[_0x7218('0x18')]=_0x373dd3[_0x7218('0x18')];this['answertime']=_0x373dd3[_0x7218('0x19')];this['endtime']=moment()['format'](_0x7218('0x1a'));this[_0x7218('0x1b')]=utils[_0x7218('0x1c')](_0x373dd3['responsetime'],_0x373dd3[_0x7218('0x17')]);this['holdtime']=utils[_0x7218('0x1c')](_0x373dd3['answertime'],_0x373dd3[_0x7218('0x18')]);this[_0x7218('0x1d')]=utils[_0x7218('0x1c')](this['endtime'],_0x373dd3[_0x7218('0x19')]);this['queue']=_0x1058ab[_0x7218('0x7')];this[_0x7218('0x1e')]=_0x1058ab['membername'];this[_0x7218('0x1f')]=_0x1058ab[_0x7218('0x1f')];this[_0x7218('0x20')]=_0x373dd3['callback'];this[_0x7218('0x21')]=_0x373dd3[_0x7218('0x21')];this[_0x7218('0x22')]=_0x373dd3[_0x7218('0x22')];this['recallme']=_0x373dd3[_0x7218('0x23')];this[_0x7218('0x24')]=_0x373dd3['ContactId'];this['ListId']=_0x373dd3['ListId'];this[_0x7218('0x25')]=_0x373dd3[_0x7218('0x25')];this[_0x7218('0x26')]=_0x373dd3[_0x7218('0x26')];this[_0x7218('0x27')]=_0x373dd3[_0x7218('0x27')];this[_0x7218('0x28')]=_0x373dd3[_0x7218('0x28')]||'';this[_0x7218('0x29')]=_0x373dd3[_0x7218('0x29')]||'';this[_0x7218('0x2a')]=_0x373dd3['agiafterat'];}module[_0x7218('0x2b')]=AgentComplete; \ No newline at end of file +var _0xa908=['answertime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','exports','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','talktime'];(function(_0x46729c,_0x948b04){var _0x2318c6=function(_0x5d9190){while(--_0x5d9190){_0x46729c['push'](_0x46729c['shift']());}};_0x2318c6(++_0x948b04);}(_0xa908,0x1f4));var _0x8a90=function(_0x48c9b3,_0x1fb678){_0x48c9b3=_0x48c9b3-0x0;var _0x4c782f=_0xa908[_0x48c9b3];return _0x4c782f;};'use strict';var moment=require('moment');var utils=require('../utils');function AgentComplete(_0x2da4aa,_0x22fa95){this[_0x8a90('0x0')]=0x4;this[_0x8a90('0x1')]=_0x8a90('0x2');this[_0x8a90('0x3')]=_0x2da4aa[_0x8a90('0x3')];this['type']=_0x2da4aa[_0x8a90('0x4')];this[_0x8a90('0x5')]=_0x2da4aa['type']===_0x8a90('0x6')?_0x8a90('0x7'):_0x2da4aa[_0x8a90('0x4')];this[_0x8a90('0x8')]=_0x2da4aa[_0x8a90('0x8')];this[_0x8a90('0x9')]=_0x2da4aa[_0x8a90('0x9')];this[_0x8a90('0xa')]=_0x2da4aa[_0x8a90('0xa')];this[_0x8a90('0xb')]=_0x2da4aa['countbusyretry']+_0x2da4aa[_0x8a90('0x9')]+_0x2da4aa['countnoanswerretry']+_0x2da4aa[_0x8a90('0xc')]+_0x2da4aa['countdropretry']+_0x2da4aa[_0x8a90('0xd')]+_0x2da4aa[_0x8a90('0xe')]+_0x2da4aa[_0x8a90('0xf')];this[_0x8a90('0xc')]=_0x2da4aa['countnosuchnumberretry'];this[_0x8a90('0x10')]=_0x2da4aa[_0x8a90('0x10')];this['countabandonedretry']=_0x2da4aa['countabandonedretry'];this[_0x8a90('0xe')]=_0x2da4aa[_0x8a90('0xe')];this['countagentrejectretry']=_0x2da4aa['countagentrejectretry'];this[_0x8a90('0x11')]=_0x22fa95[_0x8a90('0x11')];this[_0x8a90('0x12')]=_0x2da4aa[_0x8a90('0x13')];this[_0x8a90('0x14')]=_0x2da4aa['number'];this[_0x8a90('0x15')]=_0x2da4aa[_0x8a90('0x15')];this[_0x8a90('0x16')]=_0x2da4aa[_0x8a90('0x16')];this['answertime']=_0x2da4aa['answertime'];this[_0x8a90('0x17')]=moment()['format'](_0x8a90('0x18'));this[_0x8a90('0x19')]=utils[_0x8a90('0x1a')](_0x2da4aa[_0x8a90('0x16')],_0x2da4aa[_0x8a90('0x15')]);this['holdtime']=utils[_0x8a90('0x1a')](_0x2da4aa['answertime'],_0x2da4aa[_0x8a90('0x16')]);this[_0x8a90('0x1b')]=utils['getSeconds'](this[_0x8a90('0x17')],_0x2da4aa[_0x8a90('0x1c')]);this[_0x8a90('0x7')]=_0x22fa95[_0x8a90('0x7')];this[_0x8a90('0x1d')]=_0x22fa95[_0x8a90('0x1d')];this['reason']=_0x22fa95[_0x8a90('0x1e')];this[_0x8a90('0x1f')]=_0x2da4aa[_0x8a90('0x1f')];this['callbackuniqueid']=_0x2da4aa[_0x8a90('0x20')];this[_0x8a90('0x21')]=_0x2da4aa[_0x8a90('0x21')];this[_0x8a90('0x22')]=_0x2da4aa[_0x8a90('0x22')];this['ContactId']=_0x2da4aa[_0x8a90('0x23')];this['ListId']=_0x2da4aa[_0x8a90('0x24')];this[_0x8a90('0x25')]=_0x2da4aa[_0x8a90('0x25')];this[_0x8a90('0x26')]=_0x2da4aa[_0x8a90('0x26')];this['CampaignId']=_0x2da4aa[_0x8a90('0x27')];this[_0x8a90('0x28')]=_0x2da4aa[_0x8a90('0x28')]||'';this[_0x8a90('0x29')]=_0x2da4aa[_0x8a90('0x29')]||'';this['agiafterat']=_0x2da4aa[_0x8a90('0x2a')];}module[_0x8a90('0x2b')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/models/final.js b/server/services/ami/dialer/models/final.js index a64735c..4d7127d 100644 --- a/server/services/ami/dialer/models/final.js +++ b/server/services/ami/dialer/models/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x975d=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','state','statedesc','exports','uniqueid','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','calleridname','calleridnum','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackat','recallme'];(function(_0x4ab286,_0x15f6bd){var _0x102661=function(_0x2dff3b){while(--_0x2dff3b){_0x4ab286['push'](_0x4ab286['shift']());}};_0x102661(++_0x15f6bd);}(_0x975d,0xb9));var _0xd975=function(_0x53693a,_0x2a7209){_0x53693a=_0x53693a-0x0;var _0x70b250=_0x975d[_0x53693a];return _0x70b250;};'use strict';function Final(_0x3e0ac7){this['uniqueid']=_0x3e0ac7[_0xd975('0x0')];this[_0xd975('0x1')]=_0x3e0ac7[_0xd975('0x1')];this['type']=_0x3e0ac7['type'];this[_0xd975('0x2')]=_0x3e0ac7[_0xd975('0x3')]===_0xd975('0x4')?_0xd975('0x5'):_0x3e0ac7[_0xd975('0x3')];this[_0xd975('0x6')]=_0x3e0ac7['countbusyretry'];this[_0xd975('0x7')]=_0x3e0ac7['countcongestionretry'];this[_0xd975('0x8')]=_0x3e0ac7['countnoanswerretry'];this[_0xd975('0x9')]=_0x3e0ac7['countbusyretry']+_0x3e0ac7['countcongestionretry']+_0x3e0ac7['countnoanswerretry']+_0x3e0ac7[_0xd975('0xa')]+_0x3e0ac7[_0xd975('0xb')]+_0x3e0ac7[_0xd975('0xc')]+_0x3e0ac7['countmachineretry']+_0x3e0ac7['countagentrejectretry'];this[_0xd975('0xa')]=_0x3e0ac7[_0xd975('0xa')];this[_0xd975('0xb')]=_0x3e0ac7[_0xd975('0xb')];this[_0xd975('0xc')]=_0x3e0ac7[_0xd975('0xc')];this[_0xd975('0xd')]=_0x3e0ac7[_0xd975('0xd')];this['countagentrejectretry']=_0x3e0ac7['countagentrejectretry'];this[_0xd975('0x5')]=_0x3e0ac7[_0xd975('0x5')];this[_0xd975('0xe')]=_0x3e0ac7[_0xd975('0xe')];this[_0xd975('0xf')]=_0x3e0ac7[_0xd975('0xf')];this[_0xd975('0x10')]=_0x3e0ac7[_0xd975('0x10')];this['responsetime']=_0x3e0ac7['responsetime'];this[_0xd975('0x11')]=_0x3e0ac7[_0xd975('0x12')];this[_0xd975('0x13')]=_0x3e0ac7[_0xd975('0x13')]||0x0;this[_0xd975('0x14')]=_0x3e0ac7[_0xd975('0x14')]||0x0;this[_0xd975('0x15')]=_0x3e0ac7[_0xd975('0x15')]||0x0;this[_0xd975('0x16')]=_0x3e0ac7[_0xd975('0x16')];this['callbackuniqueid']=_0x3e0ac7['callbackuniqueid'];this[_0xd975('0x17')]=_0x3e0ac7[_0xd975('0x17')];this[_0xd975('0x18')]=_0x3e0ac7['recallme'];this[_0xd975('0x19')]=_0x3e0ac7[_0xd975('0x19')];this[_0xd975('0x1a')]=_0x3e0ac7[_0xd975('0x1a')];this[_0xd975('0x1b')]=_0x3e0ac7[_0xd975('0x1b')];this[_0xd975('0x1c')]=_0x3e0ac7[_0xd975('0x1c')];this[_0xd975('0x1d')]=_0x3e0ac7[_0xd975('0x1d')];this[_0xd975('0x1e')]=_0x3e0ac7['originatecalleridnum']||'';this[_0xd975('0x1f')]=_0x3e0ac7[_0xd975('0x1f')]||'';this[_0xd975('0x20')]=_0x3e0ac7[_0xd975('0x20')];this[_0xd975('0x21')]=_0x3e0ac7['statedesc'];}module[_0xd975('0x22')]=Final; \ No newline at end of file +var _0x0909=['calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','statedesc','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','calleridname'];(function(_0x3d7e48,_0x41acda){var _0x594bd8=function(_0x49a79e){while(--_0x49a79e){_0x3d7e48['push'](_0x3d7e48['shift']());}};_0x594bd8(++_0x41acda);}(_0x0909,0xf9));var _0x9090=function(_0x333d45,_0x580c57){_0x333d45=_0x333d45-0x0;var _0x32cb6c=_0x0909[_0x333d45];return _0x32cb6c;};'use strict';function Final(_0x1733b5){this[_0x9090('0x0')]=_0x1733b5['uniqueid'];this[_0x9090('0x1')]=_0x1733b5[_0x9090('0x1')];this[_0x9090('0x2')]=_0x1733b5['type'];this['campaigntype']=_0x1733b5[_0x9090('0x2')]===_0x9090('0x3')?_0x9090('0x4'):_0x1733b5[_0x9090('0x2')];this[_0x9090('0x5')]=_0x1733b5[_0x9090('0x5')];this[_0x9090('0x6')]=_0x1733b5[_0x9090('0x6')];this['countnoanswerretry']=_0x1733b5[_0x9090('0x7')];this[_0x9090('0x8')]=_0x1733b5[_0x9090('0x5')]+_0x1733b5['countcongestionretry']+_0x1733b5[_0x9090('0x7')]+_0x1733b5[_0x9090('0x9')]+_0x1733b5[_0x9090('0xa')]+_0x1733b5['countabandonedretry']+_0x1733b5[_0x9090('0xb')]+_0x1733b5[_0x9090('0xc')];this[_0x9090('0x9')]=_0x1733b5[_0x9090('0x9')];this['countdropretry']=_0x1733b5['countdropretry'];this[_0x9090('0xd')]=_0x1733b5[_0x9090('0xd')];this[_0x9090('0xb')]=_0x1733b5[_0x9090('0xb')];this[_0x9090('0xc')]=_0x1733b5[_0x9090('0xc')];this[_0x9090('0x4')]=_0x1733b5[_0x9090('0x4')];this[_0x9090('0xe')]=_0x1733b5[_0x9090('0xe')];this[_0x9090('0xf')]=_0x1733b5[_0x9090('0xf')];this[_0x9090('0x10')]=_0x1733b5[_0x9090('0x10')];this[_0x9090('0x11')]=_0x1733b5[_0x9090('0x11')];this[_0x9090('0x12')]=_0x1733b5['responsetime'];this[_0x9090('0x13')]=_0x1733b5[_0x9090('0x13')]||0x0;this['holdtime']=_0x1733b5[_0x9090('0x14')]||0x0;this[_0x9090('0x15')]=_0x1733b5[_0x9090('0x15')]||0x0;this[_0x9090('0x16')]=_0x1733b5[_0x9090('0x16')];this['callbackuniqueid']=_0x1733b5['callbackuniqueid'];this['callbackat']=_0x1733b5[_0x9090('0x17')];this['recallme']=_0x1733b5[_0x9090('0x18')];this[_0x9090('0x19')]=_0x1733b5[_0x9090('0x19')];this['ListId']=_0x1733b5[_0x9090('0x1a')];this['UserId']=_0x1733b5[_0x9090('0x1b')];this[_0x9090('0x1c')]=_0x1733b5[_0x9090('0x1c')];this[_0x9090('0x1d')]=_0x1733b5[_0x9090('0x1d')];this[_0x9090('0x1e')]=_0x1733b5['originatecalleridnum']||'';this[_0x9090('0x1f')]=_0x1733b5[_0x9090('0x1f')]||'';this['state']=_0x1733b5['state'];this['statedesc']=_0x1733b5[_0x9090('0x20')];}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/models/hangup.js b/server/services/ami/dialer/models/hangup.js index 5012e1e..17d5799 100644 --- a/server/services/ami/dialer/models/hangup.js +++ b/server/services/ami/dialer/models/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x688e=['countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','queue','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','moment','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','amd'];(function(_0x3bd6c0,_0x6c45b9){var _0xdbf20c=function(_0x59817a){while(--_0x59817a){_0x3bd6c0['push'](_0x3bd6c0['shift']());}};_0xdbf20c(++_0x6c45b9);}(_0x688e,0x72));var _0xe688=function(_0x25e632,_0x18f3f1){_0x25e632=_0x25e632-0x0;var _0x387e4d=_0x688e[_0x25e632];return _0x387e4d;};'use strict';var moment=require(_0xe688('0x0'));var utils=require('../utils');function Hangup(_0x3842b1,_0x1f2cf4){this[_0xe688('0x1')]=0x4;this[_0xe688('0x2')]=_0xe688('0x3');this[_0xe688('0x4')]=_0x3842b1['scheduledat'];this['type']=_0x3842b1[_0xe688('0x5')];this[_0xe688('0x6')]=_0x3842b1[_0xe688('0x5')]===_0xe688('0x7')?'queue':_0x3842b1[_0xe688('0x5')];this[_0xe688('0x8')]=_0x3842b1['amd']||![];this[_0xe688('0x9')]=_0x3842b1[_0xe688('0x9')];this['countcongestionretry']=_0x3842b1['countcongestionretry'];this['countnoanswerretry']=_0x3842b1[_0xe688('0xa')];this[_0xe688('0xb')]=_0x3842b1[_0xe688('0x9')]+_0x3842b1[_0xe688('0xc')]+_0x3842b1[_0xe688('0xa')]+_0x3842b1[_0xe688('0xd')]+_0x3842b1[_0xe688('0xe')]+_0x3842b1[_0xe688('0xf')]+_0x3842b1[_0xe688('0x10')]+_0x3842b1['countagentrejectretry'];this[_0xe688('0xd')]=_0x3842b1[_0xe688('0xd')];this[_0xe688('0xe')]=_0x3842b1['countdropretry'];this[_0xe688('0xf')]=_0x3842b1[_0xe688('0xf')];this[_0xe688('0x10')]=_0x3842b1[_0xe688('0x10')];this[_0xe688('0x11')]=_0x3842b1[_0xe688('0x11')];this[_0xe688('0x12')]=_0x1f2cf4[_0xe688('0x12')];this['calleridname']=_0x3842b1['name'];this[_0xe688('0x13')]=_0x3842b1[_0xe688('0x14')];this[_0xe688('0x15')]=_0x3842b1[_0xe688('0x15')];this[_0xe688('0x16')]=_0x3842b1[_0xe688('0x16')];this[_0xe688('0x17')]=moment()['format'](_0xe688('0x18'));this[_0xe688('0x19')]=utils['getSeconds'](_0x3842b1['responsetime'],_0x3842b1[_0xe688('0x15')]);this['holdtime']=0x0;this[_0xe688('0x1a')]=utils['getSeconds'](this[_0xe688('0x17')],_0x3842b1['responsetime']);this[_0xe688('0x1b')]=_0x3842b1['queue'];this[_0xe688('0x1c')]=_0xe688('0x1d');this[_0xe688('0x1e')]=_0x1f2cf4[_0xe688('0x1f')];this[_0xe688('0x20')]=_0x3842b1['callback'];this[_0xe688('0x21')]=_0x3842b1[_0xe688('0x21')];this[_0xe688('0x22')]=_0x3842b1[_0xe688('0x22')];this[_0xe688('0x23')]=_0x3842b1[_0xe688('0x23')];this[_0xe688('0x24')]=_0x3842b1[_0xe688('0x24')];this[_0xe688('0x25')]=_0x3842b1[_0xe688('0x25')];this[_0xe688('0x26')]=_0x3842b1['UserId'];this[_0xe688('0x27')]=_0x3842b1['VoiceQueueId'];this[_0xe688('0x28')]=_0x3842b1[_0xe688('0x28')];}module['exports']=Hangup; \ No newline at end of file +var _0x4cc8=['holdtime','talktime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','moment','../utils','state','statedesc','scheduledat','type','outbound','queue','amd','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds'];(function(_0x9bce71,_0x49a3b4){var _0x5608bc=function(_0x479d2b){while(--_0x479d2b){_0x9bce71['push'](_0x9bce71['shift']());}};_0x5608bc(++_0x49a3b4);}(_0x4cc8,0x1bc));var _0x84cc=function(_0x30eac4,_0x4e589c){_0x30eac4=_0x30eac4-0x0;var _0x1b0d3e=_0x4cc8[_0x30eac4];return _0x1b0d3e;};'use strict';var moment=require(_0x84cc('0x0'));var utils=require(_0x84cc('0x1'));function Hangup(_0x49650c,_0x274d32){this[_0x84cc('0x2')]=0x4;this[_0x84cc('0x3')]='Answer';this[_0x84cc('0x4')]=_0x49650c[_0x84cc('0x4')];this[_0x84cc('0x5')]=_0x49650c[_0x84cc('0x5')];this['campaigntype']=_0x49650c[_0x84cc('0x5')]===_0x84cc('0x6')?_0x84cc('0x7'):_0x49650c[_0x84cc('0x5')];this['amd']=_0x49650c[_0x84cc('0x8')]||![];this[_0x84cc('0x9')]=_0x49650c[_0x84cc('0x9')];this['countcongestionretry']=_0x49650c[_0x84cc('0xa')];this[_0x84cc('0xb')]=_0x49650c[_0x84cc('0xb')];this[_0x84cc('0xc')]=_0x49650c[_0x84cc('0x9')]+_0x49650c[_0x84cc('0xa')]+_0x49650c[_0x84cc('0xb')]+_0x49650c[_0x84cc('0xd')]+_0x49650c[_0x84cc('0xe')]+_0x49650c[_0x84cc('0xf')]+_0x49650c[_0x84cc('0x10')]+_0x49650c[_0x84cc('0x11')];this[_0x84cc('0xd')]=_0x49650c[_0x84cc('0xd')];this[_0x84cc('0xe')]=_0x49650c['countdropretry'];this[_0x84cc('0xf')]=_0x49650c['countabandonedretry'];this[_0x84cc('0x10')]=_0x49650c[_0x84cc('0x10')];this[_0x84cc('0x11')]=_0x49650c['countagentrejectretry'];this['uniqueid']=_0x274d32[_0x84cc('0x12')];this[_0x84cc('0x13')]=_0x49650c[_0x84cc('0x14')];this['calleridnum']=_0x49650c[_0x84cc('0x15')];this['starttime']=_0x49650c[_0x84cc('0x16')];this[_0x84cc('0x17')]=_0x49650c['responsetime'];this[_0x84cc('0x18')]=moment()[_0x84cc('0x19')](_0x84cc('0x1a'));this[_0x84cc('0x1b')]=utils[_0x84cc('0x1c')](_0x49650c[_0x84cc('0x17')],_0x49650c['starttime']);this[_0x84cc('0x1d')]=0x0;this[_0x84cc('0x1e')]=utils['getSeconds'](this[_0x84cc('0x18')],_0x49650c['responsetime']);this[_0x84cc('0x7')]=_0x49650c[_0x84cc('0x7')];this['membername']=_0x84cc('0x1f');this[_0x84cc('0x20')]=_0x274d32[_0x84cc('0x21')];this[_0x84cc('0x22')]=_0x49650c[_0x84cc('0x22')];this[_0x84cc('0x23')]=_0x49650c[_0x84cc('0x23')];this[_0x84cc('0x24')]=_0x49650c['callbackat'];this[_0x84cc('0x25')]=_0x49650c[_0x84cc('0x25')];this[_0x84cc('0x26')]=_0x49650c[_0x84cc('0x26')];this[_0x84cc('0x27')]=_0x49650c[_0x84cc('0x27')];this['UserId']=_0x49650c[_0x84cc('0x28')];this['VoiceQueueId']=_0x49650c[_0x84cc('0x29')];this['CampaignId']=_0x49650c[_0x84cc('0x2a')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/models/history.js b/server/services/ami/dialer/models/history.js index e39642a..7705d64 100644 --- a/server/services/ami/dialer/models/history.js +++ b/server/services/ami/dialer/models/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe907=['calleridname','name','number','starttime','responsetime','endtime','ringtime','getSeconds','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','state','statedesc','../utils','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x72e04a,_0x398f0b){var _0x4e8acf=function(_0x56ea91){while(--_0x56ea91){_0x72e04a['push'](_0x72e04a['shift']());}};_0x4e8acf(++_0x398f0b);}(_0xe907,0xe1));var _0x7e90=function(_0x483c0a,_0xcc3bc1){_0x483c0a=_0x483c0a-0x0;var _0x312228=_0xe907[_0x483c0a];return _0x312228;};'use strict';var utils=require(_0x7e90('0x0'));function History(_0x539361){this[_0x7e90('0x1')]=_0x539361[_0x7e90('0x1')];this[_0x7e90('0x2')]=_0x539361[_0x7e90('0x2')]||undefined;this[_0x7e90('0x3')]=_0x539361[_0x7e90('0x3')];this[_0x7e90('0x4')]=_0x539361['type']==='outbound'?_0x7e90('0x5'):_0x539361[_0x7e90('0x3')];this[_0x7e90('0x6')]=_0x539361['countbusyretry'];this[_0x7e90('0x7')]=_0x539361[_0x7e90('0x7')];this['countnoanswerretry']=_0x539361['countnoanswerretry'];this['countglobal']=_0x539361[_0x7e90('0x6')]+_0x539361[_0x7e90('0x7')]+_0x539361['countnoanswerretry']+_0x539361[_0x7e90('0x8')]+_0x539361[_0x7e90('0x9')]+_0x539361[_0x7e90('0xa')]+_0x539361[_0x7e90('0xb')]+_0x539361[_0x7e90('0xc')];this[_0x7e90('0x8')]=_0x539361['countnosuchnumberretry'];this['countdropretry']=_0x539361[_0x7e90('0x9')];this[_0x7e90('0xa')]=_0x539361[_0x7e90('0xa')];this[_0x7e90('0xb')]=_0x539361['countmachineretry'];this['countagentrejectretry']=_0x539361[_0x7e90('0xc')];this['queue']=_0x539361[_0x7e90('0x5')];this[_0x7e90('0xd')]=_0x539361[_0x7e90('0xe')];this['calleridnum']=_0x539361[_0x7e90('0xf')];this[_0x7e90('0x10')]=_0x539361[_0x7e90('0x10')];this[_0x7e90('0x11')]=_0x539361[_0x7e90('0x11')];this[_0x7e90('0x12')]=_0x539361['responsetime'];this[_0x7e90('0x13')]=utils[_0x7e90('0x14')](_0x539361[_0x7e90('0x11')],_0x539361[_0x7e90('0x10')]);this['holdtime']=0x0;this[_0x7e90('0x15')]=0x0;this[_0x7e90('0x16')]=_0x539361['callback'];this[_0x7e90('0x17')]=_0x539361[_0x7e90('0x17')];this[_0x7e90('0x18')]=_0x539361[_0x7e90('0x18')];this[_0x7e90('0x19')]=_0x539361[_0x7e90('0x19')];this['ContactId']=_0x539361[_0x7e90('0x1a')];this[_0x7e90('0x1b')]=_0x539361['ListId'];this[_0x7e90('0x1c')]=_0x539361[_0x7e90('0x1c')];this[_0x7e90('0x1d')]=_0x539361['VoiceQueueId'];this['CampaignId']=_0x539361['CampaignId'];this[_0x7e90('0x1e')]=_0x539361[_0x7e90('0x1e')]||'';this['originatecalleridname']=_0x539361[_0x7e90('0x1f')]||'';this[_0x7e90('0x20')]=_0x539361[_0x7e90('0x20')];this['statedesc']=_0x539361[_0x7e90('0x21')];}module['exports']=History; \ No newline at end of file +var _0x8e04=['UserId','CampaignId','originatecalleridnum','originatecalleridname','statedesc','exports','../utils','uniqueid','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countabandonedretry','countagentrejectretry','queue','calleridnum','number','starttime','responsetime','endtime','getSeconds','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId'];(function(_0x1bf89a,_0x2a2949){var _0x198910=function(_0x171142){while(--_0x171142){_0x1bf89a['push'](_0x1bf89a['shift']());}};_0x198910(++_0x2a2949);}(_0x8e04,0x116));var _0x48e0=function(_0x1e0499,_0x2222ed){_0x1e0499=_0x1e0499-0x0;var _0x527766=_0x8e04[_0x1e0499];return _0x527766;};'use strict';var utils=require(_0x48e0('0x0'));function History(_0x538247){this[_0x48e0('0x1')]=_0x538247[_0x48e0('0x1')];this[_0x48e0('0x2')]=_0x538247[_0x48e0('0x2')]||undefined;this['type']=_0x538247[_0x48e0('0x3')];this['campaigntype']=_0x538247[_0x48e0('0x3')]===_0x48e0('0x4')?'queue':_0x538247['type'];this['countbusyretry']=_0x538247[_0x48e0('0x5')];this[_0x48e0('0x6')]=_0x538247['countcongestionretry'];this[_0x48e0('0x7')]=_0x538247[_0x48e0('0x7')];this[_0x48e0('0x8')]=_0x538247[_0x48e0('0x5')]+_0x538247[_0x48e0('0x6')]+_0x538247[_0x48e0('0x7')]+_0x538247[_0x48e0('0x9')]+_0x538247[_0x48e0('0xa')]+_0x538247['countabandonedretry']+_0x538247[_0x48e0('0xb')]+_0x538247['countagentrejectretry'];this['countnosuchnumberretry']=_0x538247['countnosuchnumberretry'];this[_0x48e0('0xa')]=_0x538247['countdropretry'];this[_0x48e0('0xc')]=_0x538247[_0x48e0('0xc')];this[_0x48e0('0xb')]=_0x538247['countmachineretry'];this[_0x48e0('0xd')]=_0x538247[_0x48e0('0xd')];this[_0x48e0('0xe')]=_0x538247[_0x48e0('0xe')];this['calleridname']=_0x538247['name'];this[_0x48e0('0xf')]=_0x538247[_0x48e0('0x10')];this[_0x48e0('0x11')]=_0x538247[_0x48e0('0x11')];this[_0x48e0('0x12')]=_0x538247[_0x48e0('0x12')];this[_0x48e0('0x13')]=_0x538247[_0x48e0('0x12')];this['ringtime']=utils[_0x48e0('0x14')](_0x538247[_0x48e0('0x12')],_0x538247[_0x48e0('0x11')]);this['holdtime']=0x0;this[_0x48e0('0x15')]=0x0;this['callback']=_0x538247[_0x48e0('0x16')];this[_0x48e0('0x17')]=_0x538247[_0x48e0('0x17')];this['callbackat']=_0x538247[_0x48e0('0x18')];this[_0x48e0('0x19')]=_0x538247[_0x48e0('0x19')];this['ContactId']=_0x538247[_0x48e0('0x1a')];this[_0x48e0('0x1b')]=_0x538247['ListId'];this['UserId']=_0x538247[_0x48e0('0x1c')];this['VoiceQueueId']=_0x538247['VoiceQueueId'];this[_0x48e0('0x1d')]=_0x538247['CampaignId'];this[_0x48e0('0x1e')]=_0x538247[_0x48e0('0x1e')]||'';this[_0x48e0('0x1f')]=_0x538247[_0x48e0('0x1f')]||'';this['state']=_0x538247['state'];this[_0x48e0('0x20')]=_0x538247[_0x48e0('0x20')];}module[_0x48e0('0x21')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/models/queueCallerAbandon.js b/server/services/ami/dialer/models/queueCallerAbandon.js index 27d5ea9..c05d249 100644 --- a/server/services/ami/dialer/models/queueCallerAbandon.js +++ b/server/services/ami/dialer/models/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8d18=['droptime','dropreason','endtime','ringtime','getSeconds','holdtime','talktime','membername','connectedlinename','reason','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime'];(function(_0x45fefe,_0x438dbe){var _0x4bec6b=function(_0x201b29){while(--_0x201b29){_0x45fefe['push'](_0x45fefe['shift']());}};_0x4bec6b(++_0x438dbe);}(_0x8d18,0x97));var _0x88d1=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0x8d18[_0x55e08b];return _0xd1a7ff;};'use strict';var utils=require('../utils');function QueueCallerAbandon(_0x45ed4c,_0x176899){this[_0x88d1('0x0')]=_0x45ed4c['scheduledat'];this['type']=_0x45ed4c[_0x88d1('0x1')];this[_0x88d1('0x2')]=_0x45ed4c['type']===_0x88d1('0x3')?_0x88d1('0x4'):_0x45ed4c[_0x88d1('0x1')];this[_0x88d1('0x5')]=_0x45ed4c[_0x88d1('0x5')];this[_0x88d1('0x6')]=_0x45ed4c['countcongestionretry'];this[_0x88d1('0x7')]=_0x45ed4c[_0x88d1('0x7')];this[_0x88d1('0x8')]=_0x45ed4c['countbusyretry']+_0x45ed4c['countcongestionretry']+_0x45ed4c['countnoanswerretry']+_0x45ed4c['countnosuchnumberretry']+_0x45ed4c[_0x88d1('0x9')]+_0x45ed4c['countabandonedretry']+_0x45ed4c[_0x88d1('0xa')]+_0x45ed4c[_0x88d1('0xb')];this[_0x88d1('0xc')]=_0x45ed4c[_0x88d1('0xc')];this['countdropretry']=_0x45ed4c['countdropretry'];this['countabandonedretry']=_0x45ed4c[_0x88d1('0xd')];this[_0x88d1('0xa')]=_0x45ed4c[_0x88d1('0xa')];this[_0x88d1('0xb')]=_0x45ed4c[_0x88d1('0xb')];this[_0x88d1('0xe')]=_0x176899['uniqueid'];this[_0x88d1('0xf')]=_0x45ed4c[_0x88d1('0x10')];this[_0x88d1('0x11')]=_0x45ed4c[_0x88d1('0x12')];this[_0x88d1('0x13')]=_0x45ed4c[_0x88d1('0x13')];this[_0x88d1('0x14')]=_0x45ed4c[_0x88d1('0x14')];this['droptime']=_0x45ed4c[_0x88d1('0x15')];this['dropreason']=_0x45ed4c[_0x88d1('0x16')];this[_0x88d1('0x17')]=this['droptime'];this[_0x88d1('0x18')]=utils[_0x88d1('0x19')](_0x45ed4c[_0x88d1('0x14')],_0x45ed4c[_0x88d1('0x13')]);this[_0x88d1('0x1a')]=utils['getSeconds'](this['droptime'],_0x45ed4c[_0x88d1('0x14')]);this[_0x88d1('0x1b')]=0x0;this[_0x88d1('0x4')]=_0x176899[_0x88d1('0x4')];this[_0x88d1('0x1c')]=_0x176899[_0x88d1('0x1d')];this[_0x88d1('0x1e')]=_0x176899[_0x88d1('0x1e')];this['callback']=_0x45ed4c['callback'];this[_0x88d1('0x1f')]=_0x45ed4c[_0x88d1('0x1f')];this[_0x88d1('0x20')]=_0x45ed4c['callbackat'];this[_0x88d1('0x21')]=_0x45ed4c['recallme'];this['ContactId']=_0x45ed4c[_0x88d1('0x22')];this['ListId']=_0x45ed4c['ListId'];this[_0x88d1('0x23')]=_0x45ed4c['UserId'];this[_0x88d1('0x24')]=_0x45ed4c[_0x88d1('0x24')];this[_0x88d1('0x25')]=_0x45ed4c['CampaignId'];this[_0x88d1('0x26')]=_0x45ed4c[_0x88d1('0x26')]||'';this[_0x88d1('0x27')]=_0x45ed4c[_0x88d1('0x27')]||'';this[_0x88d1('0x28')]=_0x45ed4c['agiafterat'];this[_0x88d1('0x29')]=_0x45ed4c[_0x88d1('0x29')];this[_0x88d1('0x2a')]=_0x45ed4c[_0x88d1('0x2a')];}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0xff90=['campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','getSeconds','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','agiafterat','state','statedesc','exports','../utils','scheduledat','type'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xff90,0x7b));var _0x0ff9=function(_0x477c0c,_0x48b400){_0x477c0c=_0x477c0c-0x0;var _0x37d540=_0xff90[_0x477c0c];return _0x37d540;};'use strict';var utils=require(_0x0ff9('0x0'));function QueueCallerAbandon(_0x1878ea,_0x5c383a){this[_0x0ff9('0x1')]=_0x1878ea['scheduledat'];this[_0x0ff9('0x2')]=_0x1878ea['type'];this[_0x0ff9('0x3')]=_0x1878ea[_0x0ff9('0x2')]==='outbound'?_0x0ff9('0x4'):_0x1878ea[_0x0ff9('0x2')];this[_0x0ff9('0x5')]=_0x1878ea[_0x0ff9('0x5')];this[_0x0ff9('0x6')]=_0x1878ea[_0x0ff9('0x6')];this[_0x0ff9('0x7')]=_0x1878ea[_0x0ff9('0x7')];this[_0x0ff9('0x8')]=_0x1878ea[_0x0ff9('0x5')]+_0x1878ea[_0x0ff9('0x6')]+_0x1878ea[_0x0ff9('0x7')]+_0x1878ea[_0x0ff9('0x9')]+_0x1878ea[_0x0ff9('0xa')]+_0x1878ea['countabandonedretry']+_0x1878ea[_0x0ff9('0xb')]+_0x1878ea[_0x0ff9('0xc')];this[_0x0ff9('0x9')]=_0x1878ea[_0x0ff9('0x9')];this[_0x0ff9('0xa')]=_0x1878ea['countdropretry'];this[_0x0ff9('0xd')]=_0x1878ea['countabandonedretry'];this[_0x0ff9('0xb')]=_0x1878ea[_0x0ff9('0xb')];this[_0x0ff9('0xc')]=_0x1878ea[_0x0ff9('0xc')];this[_0x0ff9('0xe')]=_0x5c383a[_0x0ff9('0xe')];this[_0x0ff9('0xf')]=_0x1878ea[_0x0ff9('0x10')];this[_0x0ff9('0x11')]=_0x1878ea[_0x0ff9('0x12')];this[_0x0ff9('0x13')]=_0x1878ea[_0x0ff9('0x13')];this[_0x0ff9('0x14')]=_0x1878ea['responsetime'];this[_0x0ff9('0x15')]=_0x1878ea[_0x0ff9('0x15')];this['dropreason']=_0x1878ea['dropreason'];this['endtime']=this['droptime'];this['ringtime']=utils['getSeconds'](_0x1878ea['responsetime'],_0x1878ea[_0x0ff9('0x13')]);this['holdtime']=utils[_0x0ff9('0x16')](this[_0x0ff9('0x15')],_0x1878ea[_0x0ff9('0x14')]);this[_0x0ff9('0x17')]=0x0;this[_0x0ff9('0x4')]=_0x5c383a['queue'];this[_0x0ff9('0x18')]=_0x5c383a[_0x0ff9('0x19')];this[_0x0ff9('0x1a')]=_0x5c383a[_0x0ff9('0x1a')];this[_0x0ff9('0x1b')]=_0x1878ea[_0x0ff9('0x1b')];this[_0x0ff9('0x1c')]=_0x1878ea[_0x0ff9('0x1c')];this[_0x0ff9('0x1d')]=_0x1878ea['callbackat'];this[_0x0ff9('0x1e')]=_0x1878ea[_0x0ff9('0x1e')];this[_0x0ff9('0x1f')]=_0x1878ea[_0x0ff9('0x1f')];this[_0x0ff9('0x20')]=_0x1878ea['ListId'];this[_0x0ff9('0x21')]=_0x1878ea[_0x0ff9('0x21')];this[_0x0ff9('0x22')]=_0x1878ea[_0x0ff9('0x22')];this[_0x0ff9('0x23')]=_0x1878ea[_0x0ff9('0x23')];this['originatecalleridnum']=_0x1878ea[_0x0ff9('0x24')]||'';this[_0x0ff9('0x25')]=_0x1878ea[_0x0ff9('0x25')]||'';this[_0x0ff9('0x26')]=_0x1878ea['agiafterat'];this[_0x0ff9('0x27')]=_0x1878ea[_0x0ff9('0x27')];this[_0x0ff9('0x28')]=_0x1878ea[_0x0ff9('0x28')];}module[_0x0ff9('0x29')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/hopper.js b/server/services/ami/dialer/utils/hopper.js index 9d8f575..181768d 100644 --- a/server/services/ami/dialer/utils/hopper.js +++ b/server/services/ami/dialer/utils/hopper.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','createHistory','util','../../../../config/logger','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x3cc234,_0x4e009f){var _0x48b3f4=function(_0x56a85e){while(--_0x56a85e){_0x3cc234['push'](_0x3cc234['shift']());}};_0x48b3f4(++_0x4e009f);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x0d8b('0x0'));var logger=require(_0x0d8b('0x1'))('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0d8b('0x2'));var cmHopperHistory=require(_0x0d8b('0x3'));function inspectError(_0x43bca1){return util[_0x0d8b('0x4')](_0x43bca1,{'showHidden':![],'depth':null});}function getContactDialer(_0x8196ed,_0x577834,_0x5e15e6){return cmHopper[_0x0d8b('0x5')](_0x8196ed['id'],_0x577834,_0x5e15e6,_0x8196ed[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x4a4470){_0x8196ed[_0x0d8b('0x8')]-=_0x5e15e6;if(_0x8196ed[_0x0d8b('0x8')]<0x0){_0x8196ed['temp']=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xa'),inspectError(_0x4a4470));});}exports[_0x0d8b('0x5')]=getContactDialer;function getContactDialerIvr(_0x1f4800,_0x28ff7f){return cmHopper[_0x0d8b('0xb')](_0x1f4800['id'],_0x28ff7f,_0x1f4800[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x48fa16){_0x1f4800[_0x0d8b('0x8')]-=_0x28ff7f;if(_0x1f4800['temp']<0x0){_0x1f4800[_0x0d8b('0x8')]=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xc'),inspectError(_0x48fa16));});}exports[_0x0d8b('0xb')]=getContactDialerIvr;function countReScheduled(_0x35a07b){return cmHopper[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0x7')](function(_0x31a8cc){logger[_0x0d8b('0x9')](_0x0d8b('0xe'),inspectError(_0x31a8cc));});}exports[_0x0d8b('0xd')]=countReScheduled;function rescheduleContact(_0xe65334){return cmHopper[_0x0d8b('0xf')](_0xe65334)[_0x0d8b('0x7')](function(_0x4f6f21){logger[_0x0d8b('0x9')](_0x0d8b('0x10'),inspectError(_0x4f6f21));});}exports[_0x0d8b('0xf')]=rescheduleContact;function unlockContact(_0xe2e167,_0x2cb03c,_0x5cd485){return cmHopper[_0x0d8b('0x11')](_0xe2e167,_0x2cb03c,_0x5cd485)[_0x0d8b('0x7')](function(_0x2fd0fc){logger[_0x0d8b('0x9')](_0x0d8b('0x12'),inspectError(_0x2fd0fc));});}exports[_0x0d8b('0x11')]=unlockContact;function moveContactManagedDialer(_0x264b39){return cmHopper[_0x0d8b('0x13')](_0x264b39)['catch'](function(_0x27512e){logger[_0x0d8b('0x9')](_0x0d8b('0x14'),inspectError(_0x27512e));});}exports[_0x0d8b('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x24e8ed){return cmHopperBlack[_0x0d8b('0x15')](_0x24e8ed)[_0x0d8b('0x7')](function(_0x352c17){logger['error']('[checkIsBlackList]',inspectError(_0x352c17));});}exports[_0x0d8b('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x54a9a7){return cmHopperBlack['checkIsBlackListIvr'](_0x54a9a7)['catch'](function(_0x238728){logger[_0x0d8b('0x9')](_0x0d8b('0x16'),inspectError(_0x238728));});}exports[_0x0d8b('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x221071,_0x2c64e2,_0x30980c){return cmHopperAdditionalPhone[_0x0d8b('0x18')](_0x221071,_0x2c64e2,_0x30980c)[_0x0d8b('0x7')](function(_0x5e5bc3){logger[_0x0d8b('0x9')](_0x0d8b('0x19'),inspectError(_0x5e5bc3));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xe1ef20,_0x4a0ae4,_0x3dd149){return cmHopperAdditionalPhone[_0x0d8b('0x1a')](_0xe1ef20,_0x4a0ae4,_0x3dd149)[_0x0d8b('0x7')](function(_0x4fe6f9){logger['error'](_0x0d8b('0x1b'),inspectError(_0x4fe6f9));});}exports[_0x0d8b('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x4c05ee){return cmHopperHistory[_0x0d8b('0x1c')](_0x4c05ee)['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x1d'),inspectError(_0x1b2b59));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x2ab00d){return cmHopperHistory['createHistory'](_0x2ab00d)[_0x0d8b('0x7')](function(_0x544735){logger[_0x0d8b('0x9')](_0x0d8b('0x1e'),inspectError(_0x544735));});}exports[_0x0d8b('0x1f')]=createHistory; \ No newline at end of file +var _0xd8b0=['moveContactManagedDialer','[moveContactManagedDialer]','checkIsBlackList','[checkIsBlackListIvr]','checkIsBlackListIvr','verifyAdditionalPhones','[verifyAdditionalPhone]','swapAdditionalPhones','[swapAdditionalPhone]','avgHandleTime','[avgHandleTime]','[createHistory]','createHistory','util','../../../../config/logger','../../rpc/cmHopperBlack','../../rpc/cmHopperHistory','inspect','getContactDialer','dialOrderByScheduledAt','catch','temp','error','[getContactDialer]','getContactDialerIvr','[getContactDialerIvr]','countReScheduled','[countReScheduled]','rescheduleContact','[rescheduleContact]','unlockContact','[unlockContact]'];(function(_0x13a3ff,_0x1c3457){var _0x28bcb8=function(_0x505ac5){while(--_0x505ac5){_0x13a3ff['push'](_0x13a3ff['shift']());}};_0x28bcb8(++_0x1c3457);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x0d8b('0x0'));var logger=require(_0x0d8b('0x1'))('dialer');var cmHopper=require('../../rpc/cmHopper');var cmHopperAdditionalPhone=require('../../rpc/cmHopperAdditionalPhone');var cmHopperBlack=require(_0x0d8b('0x2'));var cmHopperHistory=require(_0x0d8b('0x3'));function inspectError(_0x43bca1){return util[_0x0d8b('0x4')](_0x43bca1,{'showHidden':![],'depth':null});}function getContactDialer(_0x8196ed,_0x577834,_0x5e15e6){return cmHopper[_0x0d8b('0x5')](_0x8196ed['id'],_0x577834,_0x5e15e6,_0x8196ed[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x4a4470){_0x8196ed[_0x0d8b('0x8')]-=_0x5e15e6;if(_0x8196ed[_0x0d8b('0x8')]<0x0){_0x8196ed['temp']=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xa'),inspectError(_0x4a4470));});}exports[_0x0d8b('0x5')]=getContactDialer;function getContactDialerIvr(_0x1f4800,_0x28ff7f){return cmHopper[_0x0d8b('0xb')](_0x1f4800['id'],_0x28ff7f,_0x1f4800[_0x0d8b('0x6')])[_0x0d8b('0x7')](function(_0x48fa16){_0x1f4800[_0x0d8b('0x8')]-=_0x28ff7f;if(_0x1f4800['temp']<0x0){_0x1f4800[_0x0d8b('0x8')]=0x0;}logger[_0x0d8b('0x9')](_0x0d8b('0xc'),inspectError(_0x48fa16));});}exports[_0x0d8b('0xb')]=getContactDialerIvr;function countReScheduled(_0x35a07b){return cmHopper[_0x0d8b('0xd')](_0x35a07b)[_0x0d8b('0x7')](function(_0x31a8cc){logger[_0x0d8b('0x9')](_0x0d8b('0xe'),inspectError(_0x31a8cc));});}exports[_0x0d8b('0xd')]=countReScheduled;function rescheduleContact(_0xe65334){return cmHopper[_0x0d8b('0xf')](_0xe65334)[_0x0d8b('0x7')](function(_0x4f6f21){logger[_0x0d8b('0x9')](_0x0d8b('0x10'),inspectError(_0x4f6f21));});}exports[_0x0d8b('0xf')]=rescheduleContact;function unlockContact(_0xe2e167,_0x2cb03c,_0x5cd485){return cmHopper[_0x0d8b('0x11')](_0xe2e167,_0x2cb03c,_0x5cd485)[_0x0d8b('0x7')](function(_0x2fd0fc){logger[_0x0d8b('0x9')](_0x0d8b('0x12'),inspectError(_0x2fd0fc));});}exports[_0x0d8b('0x11')]=unlockContact;function moveContactManagedDialer(_0x264b39){return cmHopper[_0x0d8b('0x13')](_0x264b39)['catch'](function(_0x27512e){logger[_0x0d8b('0x9')](_0x0d8b('0x14'),inspectError(_0x27512e));});}exports[_0x0d8b('0x13')]=moveContactManagedDialer;function checkIsBlackList(_0x24e8ed){return cmHopperBlack[_0x0d8b('0x15')](_0x24e8ed)[_0x0d8b('0x7')](function(_0x352c17){logger['error']('[checkIsBlackList]',inspectError(_0x352c17));});}exports[_0x0d8b('0x15')]=checkIsBlackList;function checkIsBlackListIvr(_0x54a9a7){return cmHopperBlack['checkIsBlackListIvr'](_0x54a9a7)['catch'](function(_0x238728){logger[_0x0d8b('0x9')](_0x0d8b('0x16'),inspectError(_0x238728));});}exports[_0x0d8b('0x17')]=checkIsBlackListIvr;function verifyAdditionalPhones(_0x221071,_0x2c64e2,_0x30980c){return cmHopperAdditionalPhone[_0x0d8b('0x18')](_0x221071,_0x2c64e2,_0x30980c)[_0x0d8b('0x7')](function(_0x5e5bc3){logger[_0x0d8b('0x9')](_0x0d8b('0x19'),inspectError(_0x5e5bc3));});}exports['verifyAdditionalPhones']=verifyAdditionalPhones;function swapAdditionalPhones(_0xe1ef20,_0x4a0ae4,_0x3dd149){return cmHopperAdditionalPhone[_0x0d8b('0x1a')](_0xe1ef20,_0x4a0ae4,_0x3dd149)[_0x0d8b('0x7')](function(_0x4fe6f9){logger['error'](_0x0d8b('0x1b'),inspectError(_0x4fe6f9));});}exports[_0x0d8b('0x1a')]=swapAdditionalPhones;function avgHandleTime(_0x4c05ee){return cmHopperHistory[_0x0d8b('0x1c')](_0x4c05ee)['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x1d'),inspectError(_0x1b2b59));});}exports['avgHandleTime']=avgHandleTime;function createHistory(_0x2ab00d){return cmHopperHistory['createHistory'](_0x2ab00d)[_0x0d8b('0x7')](function(_0x544735){logger[_0x0d8b('0x9')](_0x0d8b('0x1e'),inspectError(_0x544735));});}exports[_0x0d8b('0x1f')]=createHistory; \ No newline at end of file diff --git a/server/services/ami/dialer/utils/index.js b/server/services/ami/dialer/utils/index.js index 7800e1c..31da492 100644 --- a/server/services/ami/dialer/utils/index.js +++ b/server/services/ami/dialer/utils/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xeb3e=['milliseconds','seconds','getSeconds','message','loggedIn','loggedInDb','paused','talking','pTalking','waiting','inUse','originated','Trunk','name','hasQueueCampaignDataChanged','dialTimezone','isNil','Interval','Intervals','NULL_INTERVAL','isEmpty','dialGlobalInterval','EMPTY_INTERVAL','UNKNOWN_TIMEZONE','SIP/','unmonitored','includes','status','TrunkBackup','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','match','isUndefined','string','\x22%s\x22\x20<%s>','format','\x22\x22\x20<>','getCallerId','\x5cw{0,','pow','random','toString','getCallerIdRandom','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','checkContactLowerLimitOriginate','lodash','moment','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','IS_DISACTIVED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','INTERVAL_IS_OVERTIME','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','isPreviewCampaign','type','ivr','isIVRCampaign','outbound','dialActive','isQueueCampaignActive','active','isIVRCampaignActive'];(function(_0x2d8cf6,_0x94997c){var _0x930c42=function(_0x3a186c){while(--_0x3a186c){_0x2d8cf6['push'](_0x2d8cf6['shift']());}};_0x930c42(++_0x94997c);}(_0xeb3e,0x1c3));var _0xeeb3=function(_0xfd58c7,_0x28c446){_0xfd58c7=_0xfd58c7-0x0;var _0x2563f6=_0xeb3e[_0xfd58c7];return _0x2563f6;};'use strict';var _=require(_0xeeb3('0x0'));var moment=require(_0xeeb3('0x1'));var util=require('util');var logger=require(_0xeeb3('0x2'))(_0xeeb3('0x3'));var timezones=require(_0xeeb3('0x4'))[_0xeeb3('0x5')];var CAMPAIGN_STATUS={'ACTIVE':_0xeeb3('0x6'),'BLACKLIST':'BLACKLIST','CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':'DEACTIVATED','DISACTIVED':_0xeeb3('0x7'),'EMPTY_INTERVAL':_0xeeb3('0x8'),'INACTIVE':_0xeeb3('0x9'),'NO_AGENTS_LOGGED':'AGENTS_NOT_LOGGED','NO_AVAILABLE_CONTACTS':_0xeeb3('0xa'),'NULL_INTERVAL':_0xeeb3('0xb'),'OVERTIME_INTERVAL':_0xeeb3('0xc'),'OVERTIME_GLOBAL_INTERVAL':_0xeeb3('0xd'),'QUEUE_RECALL':_0xeeb3('0xe'),'RECALL_TIMEOUT':_0xeeb3('0xf'),'RUNNING':_0xeeb3('0x10'),'UNKNOWN_TIMEZONE':'TIMEZONE_UNKNOW','UNREACHABLE_TRUNK':_0xeeb3('0x11')};exports[_0xeeb3('0x12')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x57958f){return _0x57958f[_0xeeb3('0x13')]==='preview';}exports[_0xeeb3('0x14')]=isPreviewCampaign;function isIVRCampaign(_0xf7a96a){return _0xf7a96a[_0xeeb3('0x15')]===_0xeeb3('0x16');}exports[_0xeeb3('0x17')]=isIVRCampaign;function isOutboundQueue(_0x2876c6){return _0x2876c6[_0xeeb3('0x15')]===_0xeeb3('0x18');}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0x5603ee){return _0x5603ee[_0xeeb3('0x19')];}exports[_0xeeb3('0x1a')]=isQueueCampaignActive;function isIVRCampaignActive(_0x425893){return _0x425893[_0xeeb3('0x1b')];}exports[_0xeeb3('0x1c')]=isIVRCampaignActive;function getSeconds(_0x146bdb,_0x1cf8e){var _0x85b298=moment(_0x146bdb)[_0xeeb3('0x1d')](0x0);var _0x529a14=moment(_0x1cf8e)['milliseconds'](0x0);return _0x85b298['diff'](_0x529a14,_0xeeb3('0x1e'));}exports[_0xeeb3('0x1f')]=getSeconds;function hasQueueCampaignDataChanged(_0x12194a,_0x31b798){var _0x3ea494=![];var _0x27c23a=_0x12194a[_0xeeb3('0x13')]!==_0x31b798[_0xeeb3('0x13')]||_0x12194a[_0xeeb3('0x19')]!==_0x31b798[_0xeeb3('0x19')]||_0x12194a['message']!==_0x31b798[_0xeeb3('0x20')];var _0xb0dfba=_0x12194a['available']!==_0x31b798['available']||_0x12194a[_0xeeb3('0x21')]!==_0x31b798[_0xeeb3('0x21')]||_0x12194a[_0xeeb3('0x22')]!==_0x31b798['loggedInDb']||_0x12194a[_0xeeb3('0x23')]!==_0x31b798[_0xeeb3('0x23')]||_0x12194a[_0xeeb3('0x24')]!==_0x31b798['talking']||_0x12194a[_0xeeb3('0x25')]!==_0x31b798['pTalking']||_0x12194a[_0xeeb3('0x26')]!==_0x31b798[_0xeeb3('0x26')]||_0x12194a[_0xeeb3('0x27')]!==_0x31b798['inUse']||_0x12194a[_0xeeb3('0x28')]!==_0x31b798['originated'];if(_0x12194a[_0xeeb3('0x29')]&&_0x31b798[_0xeeb3('0x29')]){_0x3ea494=_0x12194a[_0xeeb3('0x29')][_0xeeb3('0x2a')]!==_0x31b798[_0xeeb3('0x29')][_0xeeb3('0x2a')]||_0x12194a[_0xeeb3('0x29')][_0xeeb3('0x1b')]!==_0x31b798[_0xeeb3('0x29')][_0xeeb3('0x1b')];}return _0x27c23a||_0xb0dfba||_0x3ea494;}exports[_0xeeb3('0x2b')]=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x1268b3){var _0x4254d8=null;var _0x1816f1=_0x1268b3[_0xeeb3('0x2c')];if(_[_0xeeb3('0x2d')](_0x1268b3['dialGlobalInterval'])||_[_0xeeb3('0x2d')](_0x1268b3[_0xeeb3('0x2e')])||_[_0xeeb3('0x2d')](_0x1268b3[_0xeeb3('0x2e')][_0xeeb3('0x2f')])){_0x4254d8=CAMPAIGN_STATUS[_0xeeb3('0x30')];}else if(_[_0xeeb3('0x31')](_0x1268b3[_0xeeb3('0x32')])||_[_0xeeb3('0x31')](_0x1268b3['Interval']['Intervals'])){_0x4254d8=CAMPAIGN_STATUS[_0xeeb3('0x33')];}else if(_0x1816f1&&!timezones[_0x1816f1]){_0x4254d8=CAMPAIGN_STATUS[_0xeeb3('0x34')];}return _0x4254d8;}function checkAnyValidTrunk(_0x3859ed,_0x514974){var _0xbdf0e8=null;var _0xc9ce5f=_0xeeb3('0x35');var _0x8a881b=['reachable',_0xeeb3('0x36')];var _0x303162=!![];if(_0x3859ed[_0xeeb3('0x29')]&&_0x3859ed[_0xeeb3('0x29')][_0xeeb3('0x1b')]){_0xc9ce5f+=_0x3859ed[_0xeeb3('0x29')][_0xeeb3('0x2a')];_0xbdf0e8=_0x514974[_0xc9ce5f];_0x303162=_0x8a881b[_0xeeb3('0x37')](_0xbdf0e8[_0xeeb3('0x38')]);}else if(_0x3859ed['TrunkBackup']&&_0x3859ed[_0xeeb3('0x39')][_0xeeb3('0x1b')]){_0xc9ce5f+=_0x3859ed[_0xeeb3('0x39')]['name'];_0xbdf0e8=_0x514974[_0xc9ce5f];_0x303162=_0x8a881b[_0xeeb3('0x37')](_0xbdf0e8[_0xeeb3('0x38')]);}return _0x303162;}function getQueueCampaignStatusMessage(_0x2d1045,_0x464102){var _0x273151=CAMPAIGN_STATUS[_0xeeb3('0x6')];var _0x5a59ba=isPreviewCampaign(_0x2d1045);if(!isQueueCampaignActive(_0x2d1045)){if(_0x5a59ba){_0x273151=CAMPAIGN_STATUS[_0xeeb3('0x3a')];}else{if(_0x2d1045[_0xeeb3('0x28')]===0x0&&_0x2d1045['talking']===0x0&&_0x2d1045[_0xeeb3('0x26')]===0x0&&(_0x2d1045[_0xeeb3('0x25')]||0x0)===0x0){_0x273151=CAMPAIGN_STATUS[_0xeeb3('0x3a')];}else{_0x273151=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x2d1045['loggedIn']===0x0){_0x273151=CAMPAIGN_STATUS[_0xeeb3('0x3b')];}else if(!checkAnyValidTrunk(_0x2d1045,_0x464102)){_0x273151=CAMPAIGN_STATUS[_0xeeb3('0x3c')];}else if(!isPreviewCampaign(_0x2d1045)){var _0x44d669=checkAnyValidQueueCampaignInterval(_0x2d1045);if(_0x44d669){_0x273151=_0x44d669;}}return _0x273151;}exports[_0xeeb3('0x3d')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0xc328f5){var _0x3ab7ac=CAMPAIGN_STATUS[_0xeeb3('0x3e')];if(_0xc328f5['originated']===0x0&&_0xc328f5[_0xeeb3('0x24')]===0x0&&_0xc328f5[_0xeeb3('0x26')]===0x0&&(_0xc328f5[_0xeeb3('0x25')]||0x0)===0x0){_0x3ab7ac=CAMPAIGN_STATUS[_0xeeb3('0x3a')];}return _0x3ab7ac;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x4d028e){var _0x33e5c3=_0x4d028e[_0xeeb3('0x3f')](/"(.*?)"/);return _0x33e5c3?_0x33e5c3[0x1]:_0x4d028e;}exports['extractCalleridName']=extractCalleridName;function getCallerId(_0x594c4b,_0x3b11f7,_0x29a989){if(!_[_0xeeb3('0x40')](_0x29a989)&&typeof _0x29a989==='string'&&!_[_0xeeb3('0x31')](_0x29a989)){if(!_[_0xeeb3('0x40')](_0x3b11f7)&&typeof _0x3b11f7===_0xeeb3('0x41')&&!_['isEmpty'](_0x3b11f7)){return util['format'](_0xeeb3('0x42'),_0x3b11f7,_0x29a989);}return util[_0xeeb3('0x43')](_0xeeb3('0x42'),_0x29a989,_0x29a989);}if(!_['isUndefined'](_0x594c4b)&&typeof _0x594c4b===_0xeeb3('0x41')&&!_[_0xeeb3('0x31')](_0x594c4b)){return _0x594c4b;}return _0xeeb3('0x44');}exports[_0xeeb3('0x45')]=getCallerId;function getCallerIdRandom(_0x5d98c4,_0x1607d4){var _0x46316e;var _0x2cba08;var _0x11903f;if(_0x1607d4<=0x0){_0x1607d4=0x1;}_0x46316e=new RegExp(_0xeeb3('0x46')+_0x1607d4+'}$');_0x2cba08=Math[_0xeeb3('0x47')](0xa,_0x1607d4-0x1);_0x11903f=Math['pow'](0xa,_0x1607d4)-0x1;return util['format']('%s',_['replace'](_0x5d98c4,_0x46316e,_[_0xeeb3('0x48')](_0x2cba08,_0x11903f)[_0xeeb3('0x49')]()));}exports[_0xeeb3('0x4a')]=getCallerIdRandom;function decrementOriginate(_0x588bf5){if(_0x588bf5['originated']&&_0x588bf5[_0xeeb3('0x28')]>0x0){_0x588bf5[_0xeeb3('0x28')]-=0x1;}else{logger['error'](_0xeeb3('0x4b'));}}exports[_0xeeb3('0x4c')]=decrementOriginate;function checkContactEmpty(_0x4ec8cb){return _0x4ec8cb&&_0x4ec8cb[_0xeeb3('0x4d')]>0x0;}exports[_0xeeb3('0x4e')]=checkContactEmpty;function erlangb(_0x435ba7,_0x495c6e){if(_0x495c6e===0x0){return 0x0;}var _0x4bdde6=0x1;for(var _0x26ebc7=0x1;_0x26ebc7<=_0x495c6e;_0x26ebc7+=0x1){_0x4bdde6=0x1+_0x4bdde6*_0x26ebc7/_0x435ba7;}return 0x1/_0x4bdde6;}exports['erlangb']=erlangb;function checkContactLowerLimitOriginate(_0x4d8bbd,_0x2792ba,_0x564415){if(_0x2792ba>_0x564415){for(var _0x554452=0x0;_0x554452<_0x2792ba-_0x564415;_0x554452+=0x1){decrementOriginate(_0x4d8bbd);}}}exports[_0xeeb3('0x4f')]=checkContactLowerLimitOriginate; \ No newline at end of file +var _0x627e=['isIVRCampaignActive','milliseconds','seconds','getSeconds','message','available','loggedIn','loggedInDb','paused','talking','pTalking','waiting','originated','Trunk','name','active','isNil','Interval','isEmpty','UNKNOWN_TIMEZONE','SIP/','reachable','unmonitored','TrunkBackup','includes','INACTIVE','NO_AGENTS_LOGGED','UNREACHABLE_TRUNK','getQueueCampaignStatusMessage','DISACTIVED','match','extractCalleridName','isUndefined','string','format','\x22%s\x22\x20<%s>','getCallerId','\x5cw{0,','pow','replace','toString','getCallerIdRandom','error','[decrementOriginate]\x20queue\x20originate\x20value\x20is\x20negative','decrementOriginate','length','checkContactEmpty','erlangb','lodash','../../../../config/logger','dialer','../../../../config/environment/shared','timezones','ACTIVE','BLACKLIST','DEACTIVATED','INTERVAL_IS_EMPTY','NOT_ACTIVE','AGENTS_NOT_LOGGED','AVAILABLE_CONTACTS_FINISHED','INTERVAL_IS_NULL','GLOBAL_INTERVAL_IS_OVERTIME','RECALLINQUEUE','RECALLFAILEDTIMEOUT','RUNNING','TIMEZONE_UNKNOW','TRUNK_IS_NOT_REACHABLE','CAMPAIGN_STATUS','dialMethod','preview','isPreviewCampaign','type','ivr','isIVRCampaign','dialActive'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x627e,0x1a7));var _0xe627=function(_0x3216c5,_0x4a19f0){_0x3216c5=_0x3216c5-0x0;var _0x5279cf=_0x627e[_0x3216c5];return _0x5279cf;};'use strict';var _=require(_0xe627('0x0'));var moment=require('moment');var util=require('util');var logger=require(_0xe627('0x1'))(_0xe627('0x2'));var timezones=require(_0xe627('0x3'))[_0xe627('0x4')];var CAMPAIGN_STATUS={'ACTIVE':_0xe627('0x5'),'BLACKLIST':_0xe627('0x6'),'CONTACTS_RESCHEDULED':'RESCHEDULED_CONTACTS','DEACTIVATED':_0xe627('0x7'),'DISACTIVED':'IS_DISACTIVED','EMPTY_INTERVAL':_0xe627('0x8'),'INACTIVE':_0xe627('0x9'),'NO_AGENTS_LOGGED':_0xe627('0xa'),'NO_AVAILABLE_CONTACTS':_0xe627('0xb'),'NULL_INTERVAL':_0xe627('0xc'),'OVERTIME_INTERVAL':'INTERVAL_IS_OVERTIME','OVERTIME_GLOBAL_INTERVAL':_0xe627('0xd'),'QUEUE_RECALL':_0xe627('0xe'),'RECALL_TIMEOUT':_0xe627('0xf'),'RUNNING':_0xe627('0x10'),'UNKNOWN_TIMEZONE':_0xe627('0x11'),'UNREACHABLE_TRUNK':_0xe627('0x12')};exports[_0xe627('0x13')]=CAMPAIGN_STATUS;function isPreviewCampaign(_0x56d8b5){return _0x56d8b5[_0xe627('0x14')]===_0xe627('0x15');}exports[_0xe627('0x16')]=isPreviewCampaign;function isIVRCampaign(_0x44eb53){return _0x44eb53[_0xe627('0x17')]===_0xe627('0x18');}exports[_0xe627('0x19')]=isIVRCampaign;function isOutboundQueue(_0x4a4155){return _0x4a4155[_0xe627('0x17')]==='outbound';}exports['isOutboundQueue']=isOutboundQueue;function isQueueCampaignActive(_0xa24290){return _0xa24290[_0xe627('0x1a')];}exports['isQueueCampaignActive']=isQueueCampaignActive;function isIVRCampaignActive(_0x310fea){return _0x310fea['active'];}exports[_0xe627('0x1b')]=isIVRCampaignActive;function getSeconds(_0x24bfaf,_0x1dde84){var _0x41d016=moment(_0x24bfaf)[_0xe627('0x1c')](0x0);var _0x246b9d=moment(_0x1dde84)['milliseconds'](0x0);return _0x41d016['diff'](_0x246b9d,_0xe627('0x1d'));}exports[_0xe627('0x1e')]=getSeconds;function hasQueueCampaignDataChanged(_0x6ee703,_0x5e4e57){var _0x53da69=![];var _0x53e1b8=_0x6ee703[_0xe627('0x14')]!==_0x5e4e57['dialMethod']||_0x6ee703[_0xe627('0x1a')]!==_0x5e4e57[_0xe627('0x1a')]||_0x6ee703[_0xe627('0x1f')]!==_0x5e4e57[_0xe627('0x1f')];var _0x357cf5=_0x6ee703[_0xe627('0x20')]!==_0x5e4e57[_0xe627('0x20')]||_0x6ee703['loggedIn']!==_0x5e4e57[_0xe627('0x21')]||_0x6ee703[_0xe627('0x22')]!==_0x5e4e57[_0xe627('0x22')]||_0x6ee703[_0xe627('0x23')]!==_0x5e4e57['paused']||_0x6ee703['talking']!==_0x5e4e57[_0xe627('0x24')]||_0x6ee703['pTalking']!==_0x5e4e57[_0xe627('0x25')]||_0x6ee703[_0xe627('0x26')]!==_0x5e4e57['waiting']||_0x6ee703['inUse']!==_0x5e4e57['inUse']||_0x6ee703[_0xe627('0x27')]!==_0x5e4e57['originated'];if(_0x6ee703[_0xe627('0x28')]&&_0x5e4e57[_0xe627('0x28')]){_0x53da69=_0x6ee703[_0xe627('0x28')][_0xe627('0x29')]!==_0x5e4e57[_0xe627('0x28')]['name']||_0x6ee703[_0xe627('0x28')][_0xe627('0x2a')]!==_0x5e4e57[_0xe627('0x28')]['active'];}return _0x53e1b8||_0x357cf5||_0x53da69;}exports['hasQueueCampaignDataChanged']=hasQueueCampaignDataChanged;function checkAnyValidQueueCampaignInterval(_0x1ac423){var _0x2aba58=null;var _0x771323=_0x1ac423['dialTimezone'];if(_[_0xe627('0x2b')](_0x1ac423['dialGlobalInterval'])||_['isNil'](_0x1ac423[_0xe627('0x2c')])||_[_0xe627('0x2b')](_0x1ac423[_0xe627('0x2c')]['Intervals'])){_0x2aba58=CAMPAIGN_STATUS['NULL_INTERVAL'];}else if(_[_0xe627('0x2d')](_0x1ac423['dialGlobalInterval'])||_[_0xe627('0x2d')](_0x1ac423[_0xe627('0x2c')]['Intervals'])){_0x2aba58=CAMPAIGN_STATUS['EMPTY_INTERVAL'];}else if(_0x771323&&!timezones[_0x771323]){_0x2aba58=CAMPAIGN_STATUS[_0xe627('0x2e')];}return _0x2aba58;}function checkAnyValidTrunk(_0x557c63,_0x10c8a5){var _0x4a8509=null;var _0x122dc9=_0xe627('0x2f');var _0x42bd02=[_0xe627('0x30'),_0xe627('0x31')];var _0x520a27=!![];if(_0x557c63[_0xe627('0x28')]&&_0x557c63[_0xe627('0x28')][_0xe627('0x2a')]){_0x122dc9+=_0x557c63[_0xe627('0x28')]['name'];_0x4a8509=_0x10c8a5[_0x122dc9];_0x520a27=_0x42bd02['includes'](_0x4a8509['status']);}else if(_0x557c63[_0xe627('0x32')]&&_0x557c63[_0xe627('0x32')][_0xe627('0x2a')]){_0x122dc9+=_0x557c63[_0xe627('0x32')]['name'];_0x4a8509=_0x10c8a5[_0x122dc9];_0x520a27=_0x42bd02[_0xe627('0x33')](_0x4a8509['status']);}return _0x520a27;}function getQueueCampaignStatusMessage(_0x1cad75,_0x1702b7){var _0x77f3da=CAMPAIGN_STATUS[_0xe627('0x5')];var _0x479742=isPreviewCampaign(_0x1cad75);if(!isQueueCampaignActive(_0x1cad75)){if(_0x479742){_0x77f3da=CAMPAIGN_STATUS[_0xe627('0x34')];}else{if(_0x1cad75['originated']===0x0&&_0x1cad75[_0xe627('0x24')]===0x0&&_0x1cad75[_0xe627('0x26')]===0x0&&(_0x1cad75['pTalking']||0x0)===0x0){_0x77f3da=CAMPAIGN_STATUS[_0xe627('0x34')];}else{_0x77f3da=CAMPAIGN_STATUS['DISACTIVED'];}}}else if(_0x1cad75[_0xe627('0x21')]===0x0){_0x77f3da=CAMPAIGN_STATUS[_0xe627('0x35')];}else if(!checkAnyValidTrunk(_0x1cad75,_0x1702b7)){_0x77f3da=CAMPAIGN_STATUS[_0xe627('0x36')];}else if(!isPreviewCampaign(_0x1cad75)){var _0x354ed0=checkAnyValidQueueCampaignInterval(_0x1cad75);if(_0x354ed0){_0x77f3da=_0x354ed0;}}return _0x77f3da;}exports[_0xe627('0x37')]=getQueueCampaignStatusMessage;function getQueueCampaignActiveStatusMessage(_0x2e0141){var _0x33c006=CAMPAIGN_STATUS[_0xe627('0x38')];if(_0x2e0141['originated']===0x0&&_0x2e0141['talking']===0x0&&_0x2e0141[_0xe627('0x26')]===0x0&&(_0x2e0141[_0xe627('0x25')]||0x0)===0x0){_0x33c006=CAMPAIGN_STATUS[_0xe627('0x34')];}return _0x33c006;}exports['getQueueCampaignActiveStatusMessage']=getQueueCampaignActiveStatusMessage;function extractCalleridName(_0x1e474f){var _0x19f7da=_0x1e474f[_0xe627('0x39')](/"(.*?)"/);return _0x19f7da?_0x19f7da[0x1]:_0x1e474f;}exports[_0xe627('0x3a')]=extractCalleridName;function getCallerId(_0x1dbf0a,_0x1a8ed3,_0x4fa782){if(!_[_0xe627('0x3b')](_0x4fa782)&&typeof _0x4fa782===_0xe627('0x3c')&&!_['isEmpty'](_0x4fa782)){if(!_[_0xe627('0x3b')](_0x1a8ed3)&&typeof _0x1a8ed3===_0xe627('0x3c')&&!_[_0xe627('0x2d')](_0x1a8ed3)){return util[_0xe627('0x3d')](_0xe627('0x3e'),_0x1a8ed3,_0x4fa782);}return util[_0xe627('0x3d')](_0xe627('0x3e'),_0x4fa782,_0x4fa782);}if(!_[_0xe627('0x3b')](_0x1dbf0a)&&typeof _0x1dbf0a===_0xe627('0x3c')&&!_[_0xe627('0x2d')](_0x1dbf0a)){return _0x1dbf0a;}return'\x22\x22\x20<>';}exports[_0xe627('0x3f')]=getCallerId;function getCallerIdRandom(_0x242353,_0x20a1d4){var _0x411e1e;var _0x1b2f7a;var _0x103ce5;if(_0x20a1d4<=0x0){_0x20a1d4=0x1;}_0x411e1e=new RegExp(_0xe627('0x40')+_0x20a1d4+'}$');_0x1b2f7a=Math[_0xe627('0x41')](0xa,_0x20a1d4-0x1);_0x103ce5=Math[_0xe627('0x41')](0xa,_0x20a1d4)-0x1;return util[_0xe627('0x3d')]('%s',_[_0xe627('0x42')](_0x242353,_0x411e1e,_['random'](_0x1b2f7a,_0x103ce5)[_0xe627('0x43')]()));}exports[_0xe627('0x44')]=getCallerIdRandom;function decrementOriginate(_0x4e168a){if(_0x4e168a['originated']&&_0x4e168a['originated']>0x0){_0x4e168a[_0xe627('0x27')]-=0x1;}else{logger[_0xe627('0x45')](_0xe627('0x46'));}}exports[_0xe627('0x47')]=decrementOriginate;function checkContactEmpty(_0x355640){return _0x355640&&_0x355640[_0xe627('0x48')]>0x0;}exports[_0xe627('0x49')]=checkContactEmpty;function erlangb(_0xcc54da,_0x171e4d){if(_0x171e4d===0x0){return 0x0;}var _0x2cc329=0x1;for(var _0x37f6d1=0x1;_0x37f6d1<=_0x171e4d;_0x37f6d1+=0x1){_0x2cc329=0x1+_0x2cc329*_0x37f6d1/_0xcc54da;}return 0x1/_0x2cc329;}exports[_0xe627('0x4a')]=erlangb;function checkContactLowerLimitOriginate(_0x433e73,_0x175502,_0x577655){if(_0x175502>_0x577655){for(var _0x2467fe=0x0;_0x2467fe<_0x175502-_0x577655;_0x2467fe+=0x1){decrementOriginate(_0x433e73);}}}exports['checkContactLowerLimitOriginate']=checkContactLowerLimitOriginate; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 71a7db0..c45f7cf 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 _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x54f0c4,_0x5cd3cf){var _0x8b37b3=function(_0x9b6725){while(--_0x9b6725){_0x54f0c4['push'](_0x54f0c4['shift']());}};_0x8b37b3(++_0x5cd3cf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file +var _0xa9e0=['fax','localstationid','path','AttachmentId','exports','util','lodash','moment','channel','format','%s/%s/%s','tech','Trunk'];(function(_0x339813,_0x1af39f){var _0x34678e=function(_0x66df61){while(--_0x66df61){_0x339813['push'](_0x339813['shift']());}};_0x34678e(++_0x1af39f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function Action(_0x5dd881,_0x550fbc,_0x18d5c9){this['uniqueid']=_0x5dd881||undefined;this[_0x0a9e('0x3')]=util[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x550fbc[_0x0a9e('0x6')],_0x550fbc[_0x0a9e('0x7')]['name'],_0x18d5c9[_0x0a9e('0x8')]);this[_0x0a9e('0x9')]=_0x550fbc[_0x0a9e('0x9')];this['headerinfo']=_0x550fbc['headerinfo'];this[_0x0a9e('0xa')]=_0x18d5c9['path'];this['AttachmentId']=_0x18d5c9[_0x0a9e('0xb')];}module[_0x0a9e('0xc')]=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index e9a1431..9b6486f 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 _0xadd7=['../rpc/faxAccount','../rpc/attachment','faxAccounts','trunks','actions','newchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','faxstatus','syncFaxStatus','receivefax','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','localstationid','uniqueid','channels','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','syncNewExten','operation','status','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','filename','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','response','update','AttachmentId','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','execOriginate','FaxAccountId','[Fax][execOriginate][success]','[Fax][execOriginate][failure]','Fax\x20failed','checkTrunk','isValid','format','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable','isNil','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','lodash','bluebird','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./channel','./util/util','./action'];(function(_0x17c00c,_0x20665b){var _0xedd744=function(_0x1f99b5){while(--_0x1f99b5){_0x17c00c['push'](_0x17c00c['shift']());}};_0xedd744(++_0x20665b);}(_0xadd7,0x1b9));var _0x7add=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xadd7[_0x321bb2];return _0x9c12ed;};'use strict';var util=require('util');var _=require(_0x7add('0x0'));var BPromise=require(_0x7add('0x1'));var uuid=require('uuid');var moment=require('moment');var path=require(_0x7add('0x2'));var tiff2pdf=require(_0x7add('0x3'));var gs=require(_0x7add('0x4'));var logger=require(_0x7add('0x5'))(_0x7add('0x6'));var ami=require(_0x7add('0x7'));var rpcDb=require('./rpcDb');var Channel=require(_0x7add('0x8'));var ut=require(_0x7add('0x9'));var Action=require(_0x7add('0xa'));var faxAccount=require(_0x7add('0xb'));var attachment=require(_0x7add('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x28e39a){this['channels']={};this[_0x7add('0xd')]=_0x28e39a[_0x7add('0xd')];this[_0x7add('0xe')]=_0x28e39a['trunks'];this[_0x7add('0xf')]={};ami['on'](_0x7add('0x10'),this['syncNewchannel'][_0x7add('0x11')](this));ami['on'](_0x7add('0x12'),this[_0x7add('0x13')]['bind'](this));ami['on'](_0x7add('0x14'),this[_0x7add('0x15')][_0x7add('0x11')](this));ami['on'](_0x7add('0x16'),this['syncNewExten'][_0x7add('0x11')](this));ami['on'](_0x7add('0x17'),this[_0x7add('0x18')][_0x7add('0x11')](this));ami['on'](_0x7add('0x19'),this['syncReceiveFax']['bind'](this));ami['on']('hangup',this[_0x7add('0x1a')][_0x7add('0x11')](this));ami['on'](_0x7add('0x1b'),this[_0x7add('0x1c')]['bind'](this));}Fax[_0x7add('0x1d')]['syncNewchannel']=function(_0x2195d0){if(_0x2195d0[_0x7add('0x1e')]===_0x7add('0x1f')){for(var _0x559109 in this[_0x7add('0xd')]){if(this[_0x7add('0xd')][_0x7add('0x20')](_0x559109)){if(_0x2195d0['exten']===this[_0x7add('0xd')][_0x559109][_0x7add('0x21')]){this['channels'][_0x2195d0[_0x7add('0x22')]]={};this[_0x7add('0x23')][_0x2195d0[_0x7add('0x22')]][_0x7add('0x24')]=_0x2195d0[_0x7add('0x24')];this['channels'][_0x2195d0[_0x7add('0x22')]]['id']=this[_0x7add('0xd')][_0x559109]['id'];this['channels'][_0x2195d0[_0x7add('0x22')]]['name']=this[_0x7add('0xd')][_0x559109][_0x7add('0x25')];logger[_0x7add('0x26')](_0x2195d0[_0x7add('0x22')],_0x7add('0x27'));}}}}if(this[_0x7add('0xf')][_0x2195d0[_0x7add('0x22')]]){this[_0x7add('0x23')][_0x2195d0[_0x7add('0x22')]]={};this[_0x7add('0x23')][_0x2195d0[_0x7add('0x22')]][_0x7add('0x24')]=_0x2195d0['channel'];logger['info'](_0x2195d0[_0x7add('0x22')],'\x20syncNewchannel\x20');}};Fax[_0x7add('0x1d')][_0x7add('0x13')]=function(_0x1a4a51){if(this[_0x7add('0x23')][_0x1a4a51[_0x7add('0x22')]]){for(var _0x1a5fdf in _0x1a4a51['variable']){if(_0x1a4a51[_0x7add('0x28')][_0x7add('0x20')](_0x1a5fdf)){this[_0x7add('0x23')][_0x1a4a51[_0x7add('0x22')]][_0x1a5fdf]=_0x1a4a51[_0x7add('0x29')];}}}};Fax['prototype']['syncNewState']=function(_0x5d0158){if(this[_0x7add('0x23')][_0x5d0158[_0x7add('0x22')]]){this['channels'][_0x5d0158[_0x7add('0x22')]][_0x7add('0x2a')]=_0x5d0158[_0x7add('0x2a')];this[_0x7add('0x23')][_0x5d0158[_0x7add('0x22')]][_0x7add('0x2b')]=_0x5d0158[_0x7add('0x2b')];}};Fax['prototype'][_0x7add('0x2c')]=function(_0x32b0d7){if(this[_0x7add('0x23')][_0x32b0d7[_0x7add('0x22')]]){for(var _0xd937d9 in _0x32b0d7[_0x7add('0x28')]){if(_0x32b0d7[_0x7add('0x28')][_0x7add('0x20')](_0xd937d9)){this[_0x7add('0x23')][_0x32b0d7[_0x7add('0x22')]][_0xd937d9]=_0x32b0d7[_0x7add('0x29')];}}}};Fax['prototype'][_0x7add('0x18')]=function(_0x218ffb){if(this['channels'][_0x218ffb[_0x7add('0x22')]]){this['channels'][_0x218ffb['uniqueid']][_0x7add('0x2d')]=_0x218ffb[_0x7add('0x2d')];this[_0x7add('0x23')][_0x218ffb[_0x7add('0x22')]][_0x7add('0x2e')]=_0x218ffb[_0x7add('0x2e')];this['channels'][_0x218ffb['uniqueid']]['localstationid']=_0x218ffb[_0x7add('0x21')];this[_0x7add('0x23')][_0x218ffb['uniqueid']]['filename']=_0x218ffb['filename'];logger['info'](_0x218ffb[_0x7add('0x22')],_0x7add('0x2f'));}};Fax[_0x7add('0x1d')][_0x7add('0x30')]=function(_0x32ffce){var _0x3c2004=this;if(this['channels'][_0x32ffce['uniqueid']]){var _0x3585ec=this[_0x7add('0x23')][_0x32ffce[_0x7add('0x22')]]['id'];this[_0x7add('0x23')][_0x32ffce[_0x7add('0x22')]][_0x7add('0x31')]=_0x32ffce['remotestationid'];this['channels'][_0x32ffce['uniqueid']][_0x7add('0x32')]=_0x32ffce[_0x7add('0x32')];this[_0x7add('0x23')][_0x32ffce[_0x7add('0x22')]]['localstationid']=_0x32ffce[_0x7add('0x21')];this[_0x7add('0x23')][_0x32ffce[_0x7add('0x22')]][_0x7add('0x33')]=_0x32ffce[_0x7add('0x33')];this[_0x7add('0x23')][_0x32ffce[_0x7add('0x22')]][_0x7add('0x34')]=_0x32ffce['transferrate'];this[_0x7add('0x23')][_0x32ffce[_0x7add('0x22')]][_0x7add('0x35')]=_0x32ffce[_0x7add('0x35')];this[_0x7add('0x23')][_0x32ffce['uniqueid']][_0x7add('0x36')]=_0x32ffce[_0x7add('0x36')];if(this[_0x7add('0x23')][_0x32ffce['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x32ffce[_0x7add('0x35')],_0x7add('0x37'),function(_0x461f10){logger[_0x7add('0x26')](_0x32ffce['uniqueid'],_0x7add('0x38'),_0x461f10[_0x7add('0x39')]);attachment[_0x7add('0x3a')]({'name':path[_0x7add('0x3b')](_0x32ffce[_0x7add('0x35')])['name'],'basename':path[_0x7add('0x3b')](_0x32ffce['filename'])[_0x7add('0x25')]+_0x7add('0x3c'),'type':'application/pdf'})['then'](function(_0x3f7328){faxAccount[_0x7add('0x3d')](_0x3585ec,{'from':_0x32ffce[_0x7add('0x36')],'mapKey':_0x7add('0x6'),'body':path[_0x7add('0x3b')](_0x32ffce[_0x7add('0x35')])[_0x7add('0x25')]+'.pdf','AttachmentId':_0x3f7328['id']})[_0x7add('0x3e')](function(_0x41893c){logger[_0x7add('0x3f')](_0x32ffce[_0x7add('0x22')],_0x7add('0x40'),JSON[_0x7add('0x41')](_0x41893c));});})[_0x7add('0x3e')](function(_0x3d46dc){logger[_0x7add('0x3f')](_0x32ffce['uniqueid'],_0x7add('0x42'),JSON[_0x7add('0x41')](_0x3d46dc));});});}logger[_0x7add('0x26')](_0x32ffce['uniqueid'],'\x20receiveFax\x20');}};Fax[_0x7add('0x1d')]['syncOriginateResponse']=function(_0x1fc080){if(this[_0x7add('0xf')][_0x1fc080[_0x7add('0x22')]]){_['merge'](this[_0x7add('0x23')][_0x1fc080[_0x7add('0x22')]],_['pick'](_0x1fc080,[_0x7add('0x43'),'reason']));}};function updateStatus(_0x339d10){if(_0x339d10['AttachmentId']){faxMessage[_0x7add('0x44')](_0x339d10[_0x7add('0x45')],{'failMessage':_0x7add('0x46')})[_0x7add('0x47')](function(_0x523233){ut[_0x7add('0x48')]('[Fax][Message][Error][Updated]',_0x523233);})[_0x7add('0x3e')](function(_0x5e14c0){ut[_0x7add('0x48')](_0x7add('0x49'),_0x5e14c0);});}else{ut[_0x7add('0x48')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x7add('0x1d')]['updateStatus']=function(_0x4d5892,_0x32d02f,_0x888a4c){var _0x6d528f=this;var _0x15c1d4={};if(_0x32d02f){_0x15c1d4={'read':_0x32d02f};}else{_0x15c1d4={'failMessage':_0x888a4c};}if(this[_0x7add('0xf')][_0x4d5892]['AttachmentId']){faxMessage['update'](this[_0x7add('0xf')][_0x4d5892][_0x7add('0x45')],_0x15c1d4)['then'](function(_0x3675cb){ut[_0x7add('0x48')](_0x7add('0x4a'),_0x3675cb);})[_0x7add('0x3e')](function(_0x183fff){ut[_0x7add('0x48')](_0x7add('0x4b'),_0x183fff);})[_0x7add('0x4c')](function(){delete _0x6d528f[_0x7add('0x23')][_0x4d5892];delete _0x6d528f[_0x7add('0xf')][_0x4d5892];});}else{ut[_0x7add('0x48')]('[Fax][Message][NoUpdate2]');delete this[_0x7add('0x23')][_0x4d5892];delete this[_0x7add('0xf')][_0x4d5892];}};Fax[_0x7add('0x1d')]['syncHangup']=function(_0x100c3c){var _0x24f9c1=this;if(this[_0x7add('0x23')][_0x100c3c[_0x7add('0x22')]]){if(this[_0x7add('0xf')][_0x100c3c[_0x7add('0x22')]]){this[_0x7add('0x23')][_0x100c3c[_0x7add('0x22')]]['id']=this['actions'][_0x100c3c[_0x7add('0x22')]]['id'];this['channels'][_0x100c3c[_0x7add('0x22')]][_0x7add('0x25')]=this[_0x7add('0xf')][_0x100c3c['uniqueid']][_0x7add('0x25')];}logger[_0x7add('0x26')](_0x100c3c[_0x7add('0x22')],this[_0x7add('0xf')][_0x100c3c['uniqueid']]?_0x7add('0x4d'):'\x20hangup\x20faxRiceive\x20',JSON[_0x7add('0x41')](this[_0x7add('0x23')][_0x100c3c[_0x7add('0x22')]]));if(this[_0x7add('0xf')][_0x100c3c[_0x7add('0x22')]]){if(this[_0x7add('0x23')][_0x100c3c[_0x7add('0x22')]][_0x7add('0x4e')]>0x0&&this[_0x7add('0x23')][_0x100c3c[_0x7add('0x22')]][_0x7add('0x17')]===_0x7add('0x4f')){this['updateStatus'](_0x100c3c[_0x7add('0x22')],!![]);}else{this[_0x7add('0x50')](_0x100c3c[_0x7add('0x22')],![],this[_0x7add('0x23')][_0x100c3c[_0x7add('0x22')]][_0x7add('0x51')]?_0x7add('0x52')+this[_0x7add('0x23')][_0x100c3c[_0x7add('0x22')]]['faxstatusstring']:_0x7add('0x53'));}}}};Fax[_0x7add('0x1d')]['send']=function(_0x34d0ca){var _0x129eb9=this;return new BPromise(function(_0x856c23,_0x2b6fa1){_0x129eb9[_0x7add('0x54')](_0x34d0ca,_0x129eb9['faxAccounts'][_0x34d0ca[_0x7add('0x55')]])[_0x7add('0x47')](function(_0x32811e){ut[_0x7add('0x48')](_0x7add('0x56'),_0x32811e);_0x856c23(ut[_0x7add('0x39')]('Fax\x20received'));})[_0x7add('0x3e')](function(_0x2f1a3b){ut['logger'](_0x7add('0x57'),_0x2f1a3b);updateStatus(_0x34d0ca);_0x2b6fa1(ut['message'](_0x7add('0x58')));});});};Fax[_0x7add('0x1d')]['checkAfterSend']=function(_0xa24208){var _0x361d70=this;return new BPromise(function(_0x50974f,_0x2853f0){var _0x1e3877=_0x361d70[_0x7add('0x59')](_0x361d70['faxAccounts'][_0xa24208[_0x7add('0x55')]]['Trunk'],_0xa24208);if(_0x1e3877[_0x7add('0x5a')]){_0x50974f(ut[_0x7add('0x39')]('Trunk\x20Reachable'));}else{_0x2853f0(ut[_0x7add('0x39')](_0x1e3877[_0x7add('0x39')]));}});};function originate(_0x4bf47e,_0xd6ad13,_0x5bb86c){return new BPromise(function(_0x25f51c,_0x398654){if(_0x5bb86c){var _0x13c958=util[_0x7add('0x5b')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x7add('0x3b')](_0x4bf47e[_0x7add('0x2')])[_0x7add('0x25')],_0x4bf47e[_0x7add('0x2')]);gs[_0x7add('0x5c')](_0x13c958)[_0x7add('0x47')](function(){_0x4bf47e['path']=util[_0x7add('0x5b')](_0x7add('0x5d'),path['parse'](_0x4bf47e['path'])['dir'],path[_0x7add('0x3b')](_0x4bf47e[_0x7add('0x2')])[_0x7add('0x25')]);_0xd6ad13[_0x7add('0x5e')]=_0x4bf47e['path'];ut[_0x7add('0x48')](_0x7add('0x5f'),'');ami[_0x7add('0x60')](ut[_0x7add('0x61')](_0x4bf47e,_0xd6ad13))[_0x7add('0x47')](function(_0x3a08e6){_0x25f51c(_0x3a08e6);})['catch'](function(_0x25a74a){_0x398654(_0x25a74a);});})[_0x7add('0x3e')](function(_0x4ad1fd){_0x398654(_0x4ad1fd);});}else{ami[_0x7add('0x60')](ut[_0x7add('0x61')](_0x4bf47e,_0xd6ad13))['then'](function(_0x21c0f6){_0x25f51c(_0x21c0f6);})[_0x7add('0x3e')](function(_0x36df02){_0x398654(_0x36df02);});}});}Fax['prototype']['execOriginate']=function(_0xf6301a,_0x249a7b){var _0x22945b=this;return new BPromise(function(_0x597ce4,_0x3b7a96){var _0x4a7a95=uuid['v4']();var _0xf471f8=ut['addVariables'](_0xf6301a,_0x249a7b);_0x22945b[_0x7add('0xf')][_0x4a7a95]=new Action(_0x4a7a95,_0x249a7b,_0xf6301a);var _0x160a69=_0x22945b[_0x7add('0xf')][_0x4a7a95];if(path[_0x7add('0x3b')](_0xf6301a[_0x7add('0x2')])[_0x7add('0x62')]===_0x7add('0x3c')){originate(_0x160a69,_0xf471f8,!![])[_0x7add('0x47')](function(_0x881513){_0x597ce4(_0x881513);})['catch'](function(_0x28abdc){_0x3b7a96(_0x28abdc);});}else{originate(_0x160a69,_0xf471f8,![])['then'](function(_0x4615c5){_0x597ce4(_0x4615c5);})['catch'](function(_0x317068){_0x3b7a96(_0x317068);});}});};Fax[_0x7add('0x1d')][_0x7add('0x63')]=function(_0xc91d8c){return!_[_0x7add('0x64')](_0xc91d8c)&&!_[_0x7add('0x64')](_0xc91d8c[_0x7add('0x25')])&&!_[_0x7add('0x64')](_0xc91d8c['active'])&&_0xc91d8c['active']&&!_['isNil'](this[_0x7add('0xe')][util[_0x7add('0x5b')](_0x7add('0x65'),_0xc91d8c[_0x7add('0x25')])])&&!_[_0x7add('0x64')](this[_0x7add('0xe')][util[_0x7add('0x5b')]('SIP/%s',_0xc91d8c[_0x7add('0x25')])][_0x7add('0x2e')])&&(this['trunks'][util[_0x7add('0x5b')](_0x7add('0x65'),_0xc91d8c[_0x7add('0x25')])][_0x7add('0x2e')]===_0x7add('0x66')||this[_0x7add('0xe')][util[_0x7add('0x5b')](_0x7add('0x65'),_0xc91d8c['name'])][_0x7add('0x2e')]===_0x7add('0x67'));};Fax[_0x7add('0x1d')][_0x7add('0x59')]=function(_0x105c7d,_0x42ba2f){if(!this[_0x7add('0x63')](_0x105c7d)){ut[_0x7add('0x48')](_0x7add('0x68'),_[_0x7add('0x64')](_0x105c7d)?'':_0x105c7d['name']+_0x7add('0x69'));return{'isValid':![],'message':_0x7add('0x6a')};}if(_[_0x7add('0x64')](_0x42ba2f['fax'])){ut[_0x7add('0x48')](_0x7add('0x6b'),JSON['stringify'](_0x42ba2f));return{'isValid':![],'message':_0x7add('0x6c')};}if(_[_0x7add('0x64')](_0x42ba2f[_0x7add('0x2')])){ut['logger'](_0x7add('0x6d'),JSON[_0x7add('0x41')](_0x42ba2f));return{'isValid':![],'message':_0x7add('0x6e')};}return{'isValid':!![],'message':_0x7add('0x6f')};};module[_0x7add('0x70')]=Fax; \ No newline at end of file +var _0x89c0=['Trunk\x20not\x20working\x20correctly','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','moment','path','tiff2pdf','./util/gs','fax','../ami','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','channels','trunks','newchannel','varset','bind','newstate','newexten','syncNewExten','syncFaxStatus','receivefax','syncReceiveFax','originateresponse','prototype','syncNewchannel','context','from-voip-provider','hasOwnProperty','exten','faxAccounts','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','syncVarSet','variable','syncNewState','channelstate','channelstatedesc','value','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','catch','error','stringify','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','then','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','\x20Trunk\x20is\x20not\x20active'];(function(_0xd63e3a,_0x1bd6eb){var _0x19c178=function(_0x56be0d){while(--_0x56be0d){_0xd63e3a['push'](_0xd63e3a['shift']());}};_0x19c178(++_0x1bd6eb);}(_0x89c0,0x173));var _0x089c=function(_0x3ed4e8,_0x3d1911){_0x3ed4e8=_0x3ed4e8-0x0;var _0x5ed8a5=_0x89c0[_0x3ed4e8];return _0x5ed8a5;};'use strict';var util=require(_0x089c('0x0'));var _=require(_0x089c('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x089c('0x2'));var path=require(_0x089c('0x3'));var tiff2pdf=require(_0x089c('0x4'));var gs=require(_0x089c('0x5'));var logger=require('../../../config/logger')(_0x089c('0x6'));var ami=require(_0x089c('0x7'));var rpcDb=require(_0x089c('0x8'));var Channel=require(_0x089c('0x9'));var ut=require('./util/util');var Action=require(_0x089c('0xa'));var faxAccount=require(_0x089c('0xb'));var attachment=require(_0x089c('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x235ec6){this[_0x089c('0xd')]={};this['faxAccounts']=_0x235ec6['faxAccounts'];this[_0x089c('0xe')]=_0x235ec6[_0x089c('0xe')];this['actions']={};ami['on'](_0x089c('0xf'),this['syncNewchannel']['bind'](this));ami['on'](_0x089c('0x10'),this['syncVarSet'][_0x089c('0x11')](this));ami['on'](_0x089c('0x12'),this['syncNewState'][_0x089c('0x11')](this));ami['on'](_0x089c('0x13'),this[_0x089c('0x14')][_0x089c('0x11')](this));ami['on']('faxstatus',this[_0x089c('0x15')]['bind'](this));ami['on'](_0x089c('0x16'),this[_0x089c('0x17')][_0x089c('0x11')](this));ami['on']('hangup',this['syncHangup'][_0x089c('0x11')](this));ami['on'](_0x089c('0x18'),this['syncOriginateResponse'][_0x089c('0x11')](this));}Fax[_0x089c('0x19')][_0x089c('0x1a')]=function(_0x5868c4){if(_0x5868c4[_0x089c('0x1b')]===_0x089c('0x1c')){for(var _0xa47ea5 in this['faxAccounts']){if(this['faxAccounts'][_0x089c('0x1d')](_0xa47ea5)){if(_0x5868c4[_0x089c('0x1e')]===this[_0x089c('0x1f')][_0xa47ea5]['localstationid']){this[_0x089c('0xd')][_0x5868c4[_0x089c('0x20')]]={};this[_0x089c('0xd')][_0x5868c4['uniqueid']][_0x089c('0x21')]=_0x5868c4[_0x089c('0x21')];this[_0x089c('0xd')][_0x5868c4[_0x089c('0x20')]]['id']=this[_0x089c('0x1f')][_0xa47ea5]['id'];this[_0x089c('0xd')][_0x5868c4[_0x089c('0x20')]]['name']=this[_0x089c('0x1f')][_0xa47ea5][_0x089c('0x22')];logger[_0x089c('0x23')](_0x5868c4[_0x089c('0x20')],_0x089c('0x24'));}}}}if(this[_0x089c('0x25')][_0x5868c4[_0x089c('0x20')]]){this['channels'][_0x5868c4[_0x089c('0x20')]]={};this[_0x089c('0xd')][_0x5868c4[_0x089c('0x20')]]['channel']=_0x5868c4['channel'];logger['info'](_0x5868c4[_0x089c('0x20')],_0x089c('0x24'));}};Fax[_0x089c('0x19')][_0x089c('0x26')]=function(_0x7314a7){if(this[_0x089c('0xd')][_0x7314a7['uniqueid']]){for(var _0x1640c5 in _0x7314a7[_0x089c('0x27')]){if(_0x7314a7[_0x089c('0x27')]['hasOwnProperty'](_0x1640c5)){this[_0x089c('0xd')][_0x7314a7[_0x089c('0x20')]][_0x1640c5]=_0x7314a7['value'];}}}};Fax[_0x089c('0x19')][_0x089c('0x28')]=function(_0x3c2dc8){if(this['channels'][_0x3c2dc8[_0x089c('0x20')]]){this['channels'][_0x3c2dc8[_0x089c('0x20')]][_0x089c('0x29')]=_0x3c2dc8[_0x089c('0x29')];this[_0x089c('0xd')][_0x3c2dc8[_0x089c('0x20')]]['channelstatedesc']=_0x3c2dc8[_0x089c('0x2a')];}};Fax['prototype']['syncNewExten']=function(_0xe550a0){if(this[_0x089c('0xd')][_0xe550a0[_0x089c('0x20')]]){for(var _0x7506e2 in _0xe550a0[_0x089c('0x27')]){if(_0xe550a0[_0x089c('0x27')][_0x089c('0x1d')](_0x7506e2)){this['channels'][_0xe550a0[_0x089c('0x20')]][_0x7506e2]=_0xe550a0[_0x089c('0x2b')];}}}};Fax[_0x089c('0x19')]['syncFaxStatus']=function(_0x2c02c5){if(this['channels'][_0x2c02c5[_0x089c('0x20')]]){this[_0x089c('0xd')][_0x2c02c5['uniqueid']][_0x089c('0x2c')]=_0x2c02c5[_0x089c('0x2c')];this[_0x089c('0xd')][_0x2c02c5[_0x089c('0x20')]][_0x089c('0x2d')]=_0x2c02c5[_0x089c('0x2d')];this[_0x089c('0xd')][_0x2c02c5[_0x089c('0x20')]][_0x089c('0x2e')]=_0x2c02c5['localstationid'];this[_0x089c('0xd')][_0x2c02c5['uniqueid']][_0x089c('0x2f')]=_0x2c02c5[_0x089c('0x2f')];logger[_0x089c('0x23')](_0x2c02c5[_0x089c('0x20')],_0x089c('0x30'));}};Fax[_0x089c('0x19')][_0x089c('0x17')]=function(_0x1751a8){var _0x54ccf0=this;if(this['channels'][_0x1751a8[_0x089c('0x20')]]){var _0x5976d1=this[_0x089c('0xd')][_0x1751a8['uniqueid']]['id'];this['channels'][_0x1751a8[_0x089c('0x20')]]['remotestationid']=_0x1751a8[_0x089c('0x31')];this[_0x089c('0xd')][_0x1751a8[_0x089c('0x20')]][_0x089c('0x32')]=_0x1751a8['pagestransferred'];this['channels'][_0x1751a8[_0x089c('0x20')]][_0x089c('0x2e')]=_0x1751a8[_0x089c('0x2e')];this[_0x089c('0xd')][_0x1751a8[_0x089c('0x20')]]['resolution']=_0x1751a8[_0x089c('0x33')];this[_0x089c('0xd')][_0x1751a8[_0x089c('0x20')]][_0x089c('0x34')]=_0x1751a8[_0x089c('0x34')];this['channels'][_0x1751a8[_0x089c('0x20')]]['filename']=_0x1751a8[_0x089c('0x2f')];this[_0x089c('0xd')][_0x1751a8[_0x089c('0x20')]]['calleridnum']=_0x1751a8[_0x089c('0x35')];if(this[_0x089c('0xd')][_0x1751a8[_0x089c('0x20')]]['pagestransferred']>0x0){tiff2pdf(_0x1751a8['filename'],'/var/opt/motion2/server/files/attachments/',function(_0xd42842){logger['info'](_0x1751a8[_0x089c('0x20')],_0x089c('0x36'),_0xd42842[_0x089c('0x37')]);attachment[_0x089c('0x38')]({'name':path['parse'](_0x1751a8[_0x089c('0x2f')])['name'],'basename':path[_0x089c('0x39')](_0x1751a8[_0x089c('0x2f')])['name']+_0x089c('0x3a'),'type':_0x089c('0x3b')})['then'](function(_0x21f558){faxAccount['notify'](_0x5976d1,{'from':_0x1751a8[_0x089c('0x35')],'mapKey':_0x089c('0x6'),'body':path[_0x089c('0x39')](_0x1751a8[_0x089c('0x2f')])['name']+_0x089c('0x3a'),'AttachmentId':_0x21f558['id']})[_0x089c('0x3c')](function(_0x4c97b7){logger[_0x089c('0x3d')](_0x1751a8[_0x089c('0x20')],'\x20notify\x20',JSON[_0x089c('0x3e')](_0x4c97b7));});})[_0x089c('0x3c')](function(_0x71fb26){logger['error'](_0x1751a8['uniqueid'],_0x089c('0x3f'),JSON['stringify'](_0x71fb26));});});}logger[_0x089c('0x23')](_0x1751a8[_0x089c('0x20')],_0x089c('0x3f'));}};Fax['prototype'][_0x089c('0x40')]=function(_0x222934){if(this[_0x089c('0x25')][_0x222934[_0x089c('0x20')]]){_[_0x089c('0x41')](this[_0x089c('0xd')][_0x222934[_0x089c('0x20')]],_[_0x089c('0x42')](_0x222934,[_0x089c('0x43'),_0x089c('0x44')]));}};function updateStatus(_0x4a6c68){if(_0x4a6c68['AttachmentId']){faxMessage[_0x089c('0x45')](_0x4a6c68[_0x089c('0x46')],{'failMessage':_0x089c('0x47')})['then'](function(_0x144e6e){ut[_0x089c('0x48')](_0x089c('0x49'),_0x144e6e);})[_0x089c('0x3c')](function(_0x221d53){ut[_0x089c('0x48')](_0x089c('0x4a'),_0x221d53);});}else{ut['logger'](_0x089c('0x4b'));}}Fax[_0x089c('0x19')][_0x089c('0x4c')]=function(_0x1f607e,_0x2661ca,_0xcdd395){var _0x34565c=this;var _0x559d08={};if(_0x2661ca){_0x559d08={'read':_0x2661ca};}else{_0x559d08={'failMessage':_0xcdd395};}if(this[_0x089c('0x25')][_0x1f607e][_0x089c('0x46')]){faxMessage[_0x089c('0x45')](this[_0x089c('0x25')][_0x1f607e][_0x089c('0x46')],_0x559d08)[_0x089c('0x4d')](function(_0x39eed7){ut[_0x089c('0x48')]('[Fax][Message][Updated]',_0x39eed7);})['catch'](function(_0x5131fc){ut['logger'](_0x089c('0x4e'),_0x5131fc);})[_0x089c('0x4f')](function(){delete _0x34565c[_0x089c('0xd')][_0x1f607e];delete _0x34565c['actions'][_0x1f607e];});}else{ut[_0x089c('0x48')](_0x089c('0x50'));delete this[_0x089c('0xd')][_0x1f607e];delete this['actions'][_0x1f607e];}};Fax[_0x089c('0x19')][_0x089c('0x51')]=function(_0x2fa74a){var _0x2a73d8=this;if(this[_0x089c('0xd')][_0x2fa74a[_0x089c('0x20')]]){if(this[_0x089c('0x25')][_0x2fa74a['uniqueid']]){this[_0x089c('0xd')][_0x2fa74a[_0x089c('0x20')]]['id']=this['actions'][_0x2fa74a[_0x089c('0x20')]]['id'];this[_0x089c('0xd')][_0x2fa74a[_0x089c('0x20')]][_0x089c('0x22')]=this[_0x089c('0x25')][_0x2fa74a[_0x089c('0x20')]][_0x089c('0x22')];}logger[_0x089c('0x23')](_0x2fa74a[_0x089c('0x20')],this[_0x089c('0x25')][_0x2fa74a[_0x089c('0x20')]]?_0x089c('0x52'):_0x089c('0x53'),JSON[_0x089c('0x3e')](this[_0x089c('0xd')][_0x2fa74a[_0x089c('0x20')]]));if(this[_0x089c('0x25')][_0x2fa74a[_0x089c('0x20')]]){if(this[_0x089c('0xd')][_0x2fa74a[_0x089c('0x20')]][_0x089c('0x54')]>0x0&&this[_0x089c('0xd')][_0x2fa74a[_0x089c('0x20')]]['faxstatus']===_0x089c('0x55')){this[_0x089c('0x4c')](_0x2fa74a[_0x089c('0x20')],!![]);}else{this[_0x089c('0x4c')](_0x2fa74a[_0x089c('0x20')],![],this[_0x089c('0xd')][_0x2fa74a[_0x089c('0x20')]][_0x089c('0x56')]?_0x089c('0x57')+this[_0x089c('0xd')][_0x2fa74a['uniqueid']][_0x089c('0x56')]:_0x089c('0x58'));}}}};Fax['prototype'][_0x089c('0x59')]=function(_0x8ed1da){var _0x347126=this;return new BPromise(function(_0x131b0a,_0x2a578a){_0x347126[_0x089c('0x5a')](_0x8ed1da,_0x347126[_0x089c('0x1f')][_0x8ed1da[_0x089c('0x5b')]])[_0x089c('0x4d')](function(_0x584d96){ut[_0x089c('0x48')](_0x089c('0x5c'),_0x584d96);_0x131b0a(ut[_0x089c('0x37')](_0x089c('0x5d')));})[_0x089c('0x3c')](function(_0x3df324){ut[_0x089c('0x48')]('[Fax][execOriginate][failure]',_0x3df324);updateStatus(_0x8ed1da);_0x2a578a(ut[_0x089c('0x37')](_0x089c('0x5e')));});});};Fax[_0x089c('0x19')]['checkAfterSend']=function(_0x3d3b79){var _0x3683c1=this;return new BPromise(function(_0x53514c,_0x5381fa){var _0x3bd3df=_0x3683c1[_0x089c('0x5f')](_0x3683c1[_0x089c('0x1f')][_0x3d3b79[_0x089c('0x5b')]][_0x089c('0x60')],_0x3d3b79);if(_0x3bd3df[_0x089c('0x61')]){_0x53514c(ut[_0x089c('0x37')](_0x089c('0x62')));}else{_0x5381fa(ut[_0x089c('0x37')](_0x3bd3df['message']));}});};function originate(_0xb21c3,_0x734a0c,_0x1d17b8){return new BPromise(function(_0x785b09,_0x4b4f34){if(_0x1d17b8){var _0x3f13d2=util[_0x089c('0x63')](_0x089c('0x64'),path[_0x089c('0x39')](_0xb21c3['path'])[_0x089c('0x22')],_0xb21c3[_0x089c('0x3')]);gs[_0x089c('0x65')](_0x3f13d2)['then'](function(){_0xb21c3['path']=util[_0x089c('0x63')](_0x089c('0x66'),path[_0x089c('0x39')](_0xb21c3['path'])[_0x089c('0x67')],path[_0x089c('0x39')](_0xb21c3[_0x089c('0x3')])[_0x089c('0x22')]);_0x734a0c[_0x089c('0x68')]=_0xb21c3[_0x089c('0x3')];ut[_0x089c('0x48')](_0x089c('0x69'),'');ami[_0x089c('0x6a')](ut[_0x089c('0x6b')](_0xb21c3,_0x734a0c))[_0x089c('0x4d')](function(_0x58ba29){_0x785b09(_0x58ba29);})[_0x089c('0x3c')](function(_0x534b43){_0x4b4f34(_0x534b43);});})[_0x089c('0x3c')](function(_0x22b708){_0x4b4f34(_0x22b708);});}else{ami[_0x089c('0x6a')](ut[_0x089c('0x6b')](_0xb21c3,_0x734a0c))[_0x089c('0x4d')](function(_0x370303){_0x785b09(_0x370303);})[_0x089c('0x3c')](function(_0x146042){_0x4b4f34(_0x146042);});}});}Fax[_0x089c('0x19')]['execOriginate']=function(_0xd114dc,_0x84ccde){var _0x464f68=this;return new BPromise(function(_0x4bce4f,_0x3bea1a){var _0x39f9b6=uuid['v4']();var _0x108f07=ut[_0x089c('0x6c')](_0xd114dc,_0x84ccde);_0x464f68[_0x089c('0x25')][_0x39f9b6]=new Action(_0x39f9b6,_0x84ccde,_0xd114dc);var _0xd71944=_0x464f68[_0x089c('0x25')][_0x39f9b6];if(path[_0x089c('0x39')](_0xd114dc['path'])[_0x089c('0x6d')]===_0x089c('0x3a')){originate(_0xd71944,_0x108f07,!![])[_0x089c('0x4d')](function(_0x52ebcb){_0x4bce4f(_0x52ebcb);})['catch'](function(_0x2031ea){_0x3bea1a(_0x2031ea);});}else{originate(_0xd71944,_0x108f07,![])['then'](function(_0x57aea0){_0x4bce4f(_0x57aea0);})['catch'](function(_0x42a7ba){_0x3bea1a(_0x42a7ba);});}});};Fax[_0x089c('0x19')][_0x089c('0x6e')]=function(_0x36dcaa){return!_[_0x089c('0x6f')](_0x36dcaa)&&!_['isNil'](_0x36dcaa[_0x089c('0x22')])&&!_[_0x089c('0x6f')](_0x36dcaa['active'])&&_0x36dcaa[_0x089c('0x70')]&&!_[_0x089c('0x6f')](this[_0x089c('0xe')][util[_0x089c('0x63')](_0x089c('0x71'),_0x36dcaa[_0x089c('0x22')])])&&!_['isNil'](this[_0x089c('0xe')][util['format'](_0x089c('0x71'),_0x36dcaa[_0x089c('0x22')])]['status'])&&(this[_0x089c('0xe')][util[_0x089c('0x63')](_0x089c('0x71'),_0x36dcaa['name'])]['status']===_0x089c('0x72')||this[_0x089c('0xe')][util[_0x089c('0x63')](_0x089c('0x71'),_0x36dcaa[_0x089c('0x22')])][_0x089c('0x2d')]===_0x089c('0x73'));};Fax[_0x089c('0x19')][_0x089c('0x5f')]=function(_0x161a3a,_0x28c4cb){if(!this[_0x089c('0x6e')](_0x161a3a)){ut['logger']('[Fax][checkTrunk][Trunk\x20not\x20working\x20correctly]',_[_0x089c('0x6f')](_0x161a3a)?'':_0x161a3a[_0x089c('0x22')]+_0x089c('0x74'));return{'isValid':![],'message':_0x089c('0x75')};}if(_['isNil'](_0x28c4cb[_0x089c('0x6')])){ut[_0x089c('0x48')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0x089c('0x3e')](_0x28c4cb));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x089c('0x6f')](_0x28c4cb[_0x089c('0x3')])){ut['logger'](_0x089c('0x76'),JSON[_0x089c('0x3e')](_0x28c4cb));return{'isValid':![],'message':_0x089c('0x77')};}return{'isValid':!![],'message':_0x089c('0x78')};};module[_0x089c('0x79')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 6253fc6..041f796 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 _0xeb6d=['lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch','[Notify]\x20','bluebird','preview'];(function(_0x3c67a5,_0x196965){var _0xb63e10=function(_0x160684){while(--_0x160684){_0x3c67a5['push'](_0x3c67a5['shift']());}};_0xb63e10(++_0x196965);}(_0xeb6d,0x153));var _0xdeb6=function(_0x5834bc,_0x3d4801){_0x5834bc=_0x5834bc-0x0;var _0x3e183a=_0xeb6d[_0x5834bc];return _0x3e183a;};'use strict';var util=require('util');var BPromise=require(_0xdeb6('0x0'));var logger=require('../../../config/logger')(_0xdeb6('0x1'));var _=require(_0xdeb6('0x2'));var faxAccount=require(_0xdeb6('0x3'));function loggerCatch(_0x5b5852){return function(_0x5d8ec3){logger[_0xdeb6('0x4')](_0x5b5852,util[_0xdeb6('0x5')](_0x5d8ec3,{'showHidden':![],'depth':null}));};}exports[_0xdeb6('0x6')]=function(_0x1b95f0,_0x54fd81){return BPromise[_0xdeb6('0x7')]()[_0xdeb6('0x8')](faxAccount[_0xdeb6('0x6')](_0x1b95f0,_0x54fd81))[_0xdeb6('0x9')](loggerCatch(_0xdeb6('0xa')));}; \ No newline at end of file +var _0xf7f3=['notify','catch','[Notify]\x20','../../../config/logger','preview','lodash','../rpc/faxAccount','inspect'];(function(_0x4b0f78,_0x5068bf){var _0x5f542e=function(_0x2c7fc5){while(--_0x2c7fc5){_0x4b0f78['push'](_0x4b0f78['shift']());}};_0x5f542e(++_0x5068bf);}(_0xf7f3,0x1b3));var _0x3f7f=function(_0x4d8fb2,_0x3cc518){_0x4d8fb2=_0x4d8fb2-0x0;var _0xc399a2=_0xf7f3[_0x4d8fb2];return _0xc399a2;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x3f7f('0x0'))(_0x3f7f('0x1'));var _=require(_0x3f7f('0x2'));var faxAccount=require(_0x3f7f('0x3'));function loggerCatch(_0x4d568b){return function(_0x26fb19){logger['error'](_0x4d568b,util[_0x3f7f('0x4')](_0x26fb19,{'showHidden':![],'depth':null}));};}exports[_0x3f7f('0x5')]=function(_0x549e36,_0x16c308){return BPromise['resolve']()['then'](faxAccount['notify'](_0x549e36,_0x16c308))[_0x3f7f('0x6')](loggerCatch(_0x3f7f('0x7')));}; \ 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 d66b78e..ad00537 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 _0xd16f=['bluebird','child_process','exec','info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger'];(function(_0x532c0d,_0x5b9288){var _0x11062e=function(_0xee0ac0){while(--_0xee0ac0){_0x532c0d['push'](_0x532c0d['shift']());}};_0x11062e(++_0x5b9288);}(_0xd16f,0x136));var _0xfd16=function(_0x1d386c,_0x283f29){_0x1d386c=_0x1d386c-0x0;var _0x1d41aa=_0xd16f[_0x1d386c];return _0x1d41aa;};'use strict';var util=require(_0xfd16('0x0'));var logger=require(_0xfd16('0x1'))('fax');var BPromise=require(_0xfd16('0x2'));var exec=require(_0xfd16('0x3'))[_0xfd16('0x4')];exports['execute']=function(_0x425ab2){return new BPromise(function(_0x3dc175,_0x54a532){exec(_0x425ab2,function(_0xfdeb54,_0x52c5e0,_0x16c6dd){logger[_0xfd16('0x5')](_0xfd16('0x6'),_0x52c5e0);if(_0xfdeb54){logger[_0xfd16('0x5')](_0xfd16('0x6'),_0xfd16('0x7'),util['inspect'](_0xfdeb54,{'showHidden':![],'depth':null}),_0x52c5e0,_0x16c6dd);_0x54a532(_0xfdeb54);}_0x3dc175(_0x52c5e0);});});}; \ No newline at end of file +var _0xb694=['execute','info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger','bluebird','child_process','exec'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0xb694,0x16c));var _0x4b69=function(_0xc749a6,_0x1c61c8){_0xc749a6=_0xc749a6-0x0;var _0x2c976a=_0xb694[_0xc749a6];return _0x2c976a;};'use strict';var util=require(_0x4b69('0x0'));var logger=require(_0x4b69('0x1'))('fax');var BPromise=require(_0x4b69('0x2'));var exec=require(_0x4b69('0x3'))[_0x4b69('0x4')];exports[_0x4b69('0x5')]=function(_0x1986b8){return new BPromise(function(_0x508c54,_0x5dfcff){exec(_0x1986b8,function(_0x38aee4,_0x22c194,_0x55618f){logger[_0x4b69('0x6')](_0x4b69('0x7'),_0x22c194);if(_0x38aee4){logger[_0x4b69('0x6')](_0x4b69('0x7'),_0x4b69('0x8'),util['inspect'](_0x38aee4,{'showHidden':![],'depth':null}),_0x22c194,_0x55618f);_0x5dfcff(_0x38aee4);}_0x508c54(_0x22c194);});});}; \ 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 7362d22..c87f9c5 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 _0xc627=['moment','../../../../config/logger','fax','message','info','inspect','addVariables','ecm','maxrate','format','\x22%s\x22','modem','faxdetect','t38timeout','localstationid','path','uniqueid','xcally-motion-fax','from-sip','headerinfo','lodash'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc627,0x1cd));var _0x7c62=function(_0x37e9b0,_0x117b2b){_0x37e9b0=_0x37e9b0-0x0;var _0xda9fc6=_0xc627[_0x37e9b0];return _0xda9fc6;};'use strict';var util=require('util');var _=require(_0x7c62('0x0'));var moment=require(_0x7c62('0x1'));var logger=require(_0x7c62('0x2'))(_0x7c62('0x3'));exports[_0x7c62('0x4')]=function(_0xaf337f){return{'message':_0xaf337f};};exports['logger']=function(_0xdbb8d3,_0x1cff98){logger[_0x7c62('0x5')](_0xdbb8d3,util[_0x7c62('0x6')](_0x1cff98,{'showHidden':![],'depth':null}));};exports[_0x7c62('0x7')]=function(_0x447012,_0x150365){var _0x2a369d={'XMF-ECM':_0x150365[_0x7c62('0x8')],'XMF-HEADERINFO':_0x150365['headerinfo'],'XMF-MINRATE':_0x150365['minrate'],'XMF-MAXRATE':_0x150365[_0x7c62('0x9')],'XMF-MODEM':util[_0x7c62('0xa')](_0x7c62('0xb'),_0x150365[_0x7c62('0xc')]),'XMF-GATEWAY':_0x150365['gateway'],'XMF-FAXDETECT':_0x150365[_0x7c62('0xd')],'XMF-T38TIMEOUT':_0x150365[_0x7c62('0xe')],'XMF-LOCALSTATIONID':_0x150365[_0x7c62('0xf')],'XMF-PATH':_0x447012[_0x7c62('0x10')]};return _0x2a369d;};exports['variablesAction']=function(_0x1d8caf,_0x27224f){return{'actionid':_0x1d8caf[_0x7c62('0x11')],'action':'originate','channel':_0x1d8caf['channel'],'Exten':_0x7c62('0x12'),'Context':_0x7c62('0x13'),'Priority':'1','callerid':util[_0x7c62('0xa')]('\x22%s\x22\x20<%s>',_0x1d8caf[_0x7c62('0x14')]?_0x1d8caf[_0x7c62('0x14')]:'',_0x1d8caf['localstationid']),'variable':_0x27224f,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x1d8caf[_0x7c62('0x11')]};}; \ No newline at end of file +var _0x82e3=['maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','localstationid','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','info','addVariables','ecm','headerinfo','minrate'];(function(_0x384b72,_0xbc1ed1){var _0x371713=function(_0x1d6735){while(--_0x1d6735){_0x384b72['push'](_0x384b72['shift']());}};_0x371713(++_0xbc1ed1);}(_0x82e3,0x122));var _0x382e=function(_0x293493,_0x507b91){_0x293493=_0x293493-0x0;var _0x453030=_0x82e3[_0x293493];return _0x453030;};'use strict';var util=require(_0x382e('0x0'));var _=require(_0x382e('0x1'));var moment=require(_0x382e('0x2'));var logger=require(_0x382e('0x3'))(_0x382e('0x4'));exports['message']=function(_0xa82a3b){return{'message':_0xa82a3b};};exports['logger']=function(_0x12611d,_0x55bcd8){logger[_0x382e('0x5')](_0x12611d,util['inspect'](_0x55bcd8,{'showHidden':![],'depth':null}));};exports[_0x382e('0x6')]=function(_0x2a7671,_0x128d3b){var _0x3d4473={'XMF-ECM':_0x128d3b[_0x382e('0x7')],'XMF-HEADERINFO':_0x128d3b[_0x382e('0x8')],'XMF-MINRATE':_0x128d3b[_0x382e('0x9')],'XMF-MAXRATE':_0x128d3b[_0x382e('0xa')],'XMF-MODEM':util[_0x382e('0xb')](_0x382e('0xc'),_0x128d3b[_0x382e('0xd')]),'XMF-GATEWAY':_0x128d3b[_0x382e('0xe')],'XMF-FAXDETECT':_0x128d3b[_0x382e('0xf')],'XMF-T38TIMEOUT':_0x128d3b[_0x382e('0x10')],'XMF-LOCALSTATIONID':_0x128d3b[_0x382e('0x11')],'XMF-PATH':_0x2a7671['path']};return _0x3d4473;};exports[_0x382e('0x12')]=function(_0x503357,_0x20f070){return{'actionid':_0x503357[_0x382e('0x13')],'action':_0x382e('0x14'),'channel':_0x503357[_0x382e('0x15')],'Exten':_0x382e('0x16'),'Context':_0x382e('0x17'),'Priority':'1','callerid':util['format'](_0x382e('0x18'),_0x503357[_0x382e('0x8')]?_0x503357[_0x382e('0x8')]:'',_0x503357[_0x382e('0x11')]),'variable':_0x20f070,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x503357[_0x382e('0x13')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 4904214..ea7474f 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 _0x6e1e=['getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','error','[index.js][initParams]','[index.js][main]','inspect','moment','./server','./report','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','ami','get','hour','resolve','then','initAgents','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts'];(function(_0x38b383,_0x53d603){var _0x305957=function(_0xbb59a7){while(--_0xbb59a7){_0x38b383['push'](_0x38b383['shift']());}};_0x305957(++_0x53d603);}(_0x6e1e,0x1a9));var _0xe6e1=function(_0x3d7649,_0x38a79c){_0x3d7649=_0x3d7649-0x0;var _0x100ee0=_0x6e1e[_0x3d7649];return _0x100ee0;};'use strict';var util=require('util');var moment=require(_0xe6e1('0x0'));var server=require(_0xe6e1('0x1'));var Realtime=require('./realtime');var Report=require(_0xe6e1('0x2'));var Acw=require(_0xe6e1('0x3'));var Trigger=require(_0xe6e1('0x4'));var Dialer=require('./dialer');var Preview=require(_0xe6e1('0x5'));var Fax=require(_0xe6e1('0x6'));var user=require(_0xe6e1('0x7'));var voiceQueue=require(_0xe6e1('0x8'));var voiceQueueReport=require(_0xe6e1('0x9'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xe6e1('0xa'));var trigger=require(_0xe6e1('0xb'));var template=require('./rpc/template');var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0xe6e1('0xc'));var faxAccount=require(_0xe6e1('0xd'));var zendesk=require(_0xe6e1('0xe'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xe6e1('0xf'));var freshdesk=require(_0xe6e1('0x10'));var desk=require(_0xe6e1('0x11'));var zoho=require(_0xe6e1('0x12'));var vtiger=require('./rpc/integrations/vtiger');var freshsales=require(_0xe6e1('0x13'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xe6e1('0x14'));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 logger=require('../../config/logger')(_0xe6e1('0x15'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xe6e1('0x16')](_0xe6e1('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xe6e1('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xe6e1('0x18')]()['then'](user['getAgents']())[_0xe6e1('0x19')](realtime[_0xe6e1('0x1a')]())[_0xe6e1('0x19')](user['getTelephones']())[_0xe6e1('0x19')](realtime[_0xe6e1('0x1b')]())[_0xe6e1('0x19')](trunk[_0xe6e1('0x1c')]())['then'](realtime[_0xe6e1('0x1d')]())[_0xe6e1('0x19')](voiceQueue[_0xe6e1('0x1e')]())[_0xe6e1('0x19')](realtime[_0xe6e1('0x1f')]())['then'](trigger[_0xe6e1('0x20')]())['then'](realtime[_0xe6e1('0x21')]())[_0xe6e1('0x19')](template[_0xe6e1('0x22')]())[_0xe6e1('0x19')](realtime[_0xe6e1('0x23')]())[_0xe6e1('0x19')](zendesk[_0xe6e1('0x24')]())[_0xe6e1('0x19')](realtime[_0xe6e1('0x25')]())[_0xe6e1('0x19')](salesforce[_0xe6e1('0x26')]())[_0xe6e1('0x19')](realtime[_0xe6e1('0x27')]())[_0xe6e1('0x19')](sugarcrm[_0xe6e1('0x28')]())[_0xe6e1('0x19')](realtime[_0xe6e1('0x29')]())[_0xe6e1('0x19')](freshdesk[_0xe6e1('0x2a')]())[_0xe6e1('0x19')](realtime[_0xe6e1('0x2b')]())['then'](desk[_0xe6e1('0x2c')]())[_0xe6e1('0x19')](realtime[_0xe6e1('0x2d')]())['then'](zoho[_0xe6e1('0x2e')]())[_0xe6e1('0x19')](realtime['initZohoAccounts']())[_0xe6e1('0x19')](vtiger[_0xe6e1('0x2f')]())[_0xe6e1('0x19')](realtime['initVtigerAccounts']())[_0xe6e1('0x19')](freshsales[_0xe6e1('0x30')]())['then'](realtime['initFreshsalesAccounts']())[_0xe6e1('0x19')](servicenow[_0xe6e1('0x31')]())[_0xe6e1('0x19')](realtime['initServicenowAccounts']())[_0xe6e1('0x19')](dynamics365['getDynamics365Accounts']())['then'](realtime[_0xe6e1('0x32')]())[_0xe6e1('0x19')](campaign[_0xe6e1('0x33')]())['then'](realtime[_0xe6e1('0x34')]())[_0xe6e1('0x19')](voiceExtension[_0xe6e1('0x35')]())[_0xe6e1('0x19')](realtime['initVoiceExtensions']())[_0xe6e1('0x19')](faxAccount[_0xe6e1('0x36')]())[_0xe6e1('0x19')](realtime[_0xe6e1('0x37')]())[_0xe6e1('0x19')](function(){return realtime;});}function initParams(){return Promise[_0xe6e1('0x18')]()['then'](voiceQueueReport['getVoiceQueueReports']())['then'](realtime[_0xe6e1('0x38')]())[_0xe6e1('0x19')](cmHopperHistory[_0xe6e1('0x39')]())[_0xe6e1('0x19')](realtime[_0xe6e1('0x3a')]())['then'](cmHopperHistory['getCampaignHopperHistory']())[_0xe6e1('0x19')](realtime[_0xe6e1('0x3b')]())[_0xe6e1('0x19')](voiceCallReport[_0xe6e1('0x3c')]())['then'](realtime[_0xe6e1('0x3d')]())[_0xe6e1('0x3e')](function(_0x5c9bae){logger[_0xe6e1('0x3f')](_0xe6e1('0x40'),util['inspect'](_0x5c9bae,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0xe6e1('0x19')](function(){return initRealtime();})[_0xe6e1('0x19')](function(){return initParams();})['then'](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xe6e1('0x3e')](function(_0x28b795){logger[_0xe6e1('0x3f')](_0xe6e1('0x41'),util[_0xe6e1('0x42')](_0x28b795,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0xdffe=['listen','sync','[index.js][main]','inspect','util','moment','./realtime','./report','./acw','./trigger','./preview','./rpc/user','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','../../config/logger','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','initVoiceQueues','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','initFreshsalesAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initVoiceCallReports','catch','error','[index.js][initParams]'];(function(_0x3ccc64,_0x7293e4){var _0x3599ad=function(_0x15d68a){while(--_0x15d68a){_0x3ccc64['push'](_0x3ccc64['shift']());}};_0x3599ad(++_0x7293e4);}(_0xdffe,0xf4));var _0xedff=function(_0x277208,_0x57ab06){_0x277208=_0x277208-0x0;var _0x3e2c03=_0xdffe[_0x277208];return _0x3e2c03;};'use strict';var util=require(_0xedff('0x0'));var moment=require(_0xedff('0x1'));var server=require('./server');var Realtime=require(_0xedff('0x2'));var Report=require(_0xedff('0x3'));var Acw=require(_0xedff('0x4'));var Trigger=require(_0xedff('0x5'));var Dialer=require('./dialer');var Preview=require(_0xedff('0x6'));var Fax=require('./fax');var user=require(_0xedff('0x7'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xedff('0x8'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0xedff('0x9'));var trigger=require(_0xedff('0xa'));var template=require(_0xedff('0xb'));var cmHopperHistory=require(_0xedff('0xc'));var campaign=require(_0xedff('0xd'));var voiceExtension=require(_0xedff('0xe'));var faxAccount=require(_0xedff('0xf'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xedff('0x10'));var freshdesk=require(_0xedff('0x11'));var desk=require(_0xedff('0x12'));var zoho=require(_0xedff('0x13'));var vtiger=require(_0xedff('0x14'));var freshsales=require('./rpc/integrations/freshsales');var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var logger=require(_0xedff('0x15'))(_0xedff('0x16'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xedff('0x17')](_0xedff('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xedff('0x17')](_0xedff('0x18'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return Promise[_0xedff('0x19')]()[_0xedff('0x1a')](user[_0xedff('0x1b')]())[_0xedff('0x1a')](realtime[_0xedff('0x1c')]())[_0xedff('0x1a')](user[_0xedff('0x1d')]())[_0xedff('0x1a')](realtime[_0xedff('0x1e')]())[_0xedff('0x1a')](trunk[_0xedff('0x1f')]())[_0xedff('0x1a')](realtime[_0xedff('0x20')]())[_0xedff('0x1a')](voiceQueue['getVoiceQueues']())[_0xedff('0x1a')](realtime[_0xedff('0x21')]())[_0xedff('0x1a')](trigger['getTriggers']())[_0xedff('0x1a')](realtime['initTriggers']())[_0xedff('0x1a')](template['getTemplates']())[_0xedff('0x1a')](realtime['initTemplates']())['then'](zendesk['getZendeskAccounts']())[_0xedff('0x1a')](realtime[_0xedff('0x22')]())[_0xedff('0x1a')](salesforce[_0xedff('0x23')]())[_0xedff('0x1a')](realtime[_0xedff('0x24')]())[_0xedff('0x1a')](sugarcrm[_0xedff('0x25')]())[_0xedff('0x1a')](realtime['initSugarcrmAccounts']())[_0xedff('0x1a')](freshdesk[_0xedff('0x26')]())[_0xedff('0x1a')](realtime['initFreshdeskAccounts']())[_0xedff('0x1a')](desk[_0xedff('0x27')]())['then'](realtime[_0xedff('0x28')]())[_0xedff('0x1a')](zoho[_0xedff('0x29')]())[_0xedff('0x1a')](realtime[_0xedff('0x2a')]())[_0xedff('0x1a')](vtiger['getVtigerAccounts']())[_0xedff('0x1a')](realtime['initVtigerAccounts']())[_0xedff('0x1a')](freshsales['getFreshsalesAccounts']())[_0xedff('0x1a')](realtime[_0xedff('0x2b')]())[_0xedff('0x1a')](servicenow['getServicenowAccounts']())[_0xedff('0x1a')](realtime['initServicenowAccounts']())['then'](dynamics365[_0xedff('0x2c')]())[_0xedff('0x1a')](realtime[_0xedff('0x2d')]())[_0xedff('0x1a')](campaign[_0xedff('0x2e')]())[_0xedff('0x1a')](realtime[_0xedff('0x2f')]())[_0xedff('0x1a')](voiceExtension[_0xedff('0x30')]())[_0xedff('0x1a')](realtime['initVoiceExtensions']())['then'](faxAccount['getFaxAccounts']())[_0xedff('0x1a')](realtime['initFaxAccounts']())[_0xedff('0x1a')](function(){return realtime;});}function initParams(){return Promise['resolve']()[_0xedff('0x1a')](voiceQueueReport[_0xedff('0x31')]())[_0xedff('0x1a')](realtime['initVoiceQueueReports']())[_0xedff('0x1a')](cmHopperHistory[_0xedff('0x32')]())[_0xedff('0x1a')](realtime['initVoiceQueueHopperHistory']())[_0xedff('0x1a')](cmHopperHistory[_0xedff('0x33')]())[_0xedff('0x1a')](realtime['initCampaignHopperHistory']())['then'](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0xedff('0x34')]())[_0xedff('0x35')](function(_0x4ea475){logger[_0xedff('0x36')](_0xedff('0x37'),util['inspect'](_0x4ea475,{'showHidden':![],'depth':null}));});}function main(){return server[_0xedff('0x38')](realtime,preview,fax)[_0xedff('0x1a')](function(){return initRealtime();})[_0xedff('0x1a')](function(){return initParams();})['then'](function(){report[_0xedff('0x39')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x47ddcc){logger[_0xedff('0x36')](_0xedff('0x3a'),util[_0xedff('0x3b')](_0x47ddcc,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index b052b28..45404de 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 _0xbcae=['toLowerCase','not_inuse','idle','talking','voiceStatus','statePause','format','status','address','stringify','user:%s','emit','user:presence','lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','name','email','accountcode','fullname','state','unknown','stateTime','phone','mobile','interface','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype'];(function(_0x20d7fd,_0x48d9ec){var _0x250857=function(_0x125ff6){while(--_0x125ff6){_0x20d7fd['push'](_0x20d7fd['shift']());}};_0x250857(++_0x48d9ec);}(_0xbcae,0xa9));var _0xebca=function(_0xc611f5,_0x303476){_0xc611f5=_0xc611f5-0x0;var _0x225281=_0xbcae[_0xc611f5];return _0x225281;};'use strict';var _=require(_0xebca('0x0'));var util=require(_0xebca('0x1'));var moment=require(_0xebca('0x2'));var md5=require(_0xebca('0x3'));var Redis=require(_0xebca('0x4'));var config=require(_0xebca('0x5'));config[_0xebca('0x6')]=_[_0xebca('0x7')](config[_0xebca('0x6')],{'host':_0xebca('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xebca('0x6')]));function Agent(_0x149c78){this['id']=_0x149c78['id']||0x0;this['name']=_0x149c78[_0xebca('0x9')]||'';this[_0xebca('0xa')]=_0x149c78[_0xebca('0xa')]||'';this['accountcode']=_0x149c78[_0xebca('0xb')]||'';this[_0xebca('0xc')]=_0x149c78[_0xebca('0xc')]||'';this[_0xebca('0xd')]=_0xebca('0xe');this[_0xebca('0xf')]=0x0;this['status']='unknown';this['address']='';this[_0xebca('0x10')]='';this[_0xebca('0x11')]='';this[_0xebca('0x12')]='';this[_0xebca('0x13')]=_0x149c78[_0xebca('0x13')]||![];this['voiceStatus']=_0xebca('0xe');this[_0xebca('0x14')]=0x0;this[_0xebca('0x15')]='';this[_0xebca('0x16')]='';this[_0xebca('0x17')]=![];this[_0xebca('0x18')]=![];this[_0xebca('0x3')]='';}Agent[_0xebca('0x19')]['updateStatusRealtime']=function(_0x5481f9){var _0x224f4b;if(_0x5481f9&&_0x5481f9['state']){_0x224f4b=_0x5481f9[_0xebca('0xd')][_0xebca('0x1a')]();switch(_0x224f4b){case _0xebca('0x1b'):_0x224f4b=_0xebca('0x1c');break;case'inuse':_0x224f4b=_0xebca('0x1d');break;}}if(_0x224f4b&&this[_0xebca('0x1e')]!==_0x224f4b||_0x5481f9[_0xebca('0x1f')]){this[_0xebca('0x14')]=_['toNumber'](moment()[_0xebca('0x20')]('x'));}if(_0x224f4b){this[_0xebca('0x1e')]=_0x224f4b;}var _0x23b411={'id':this['id'],'name':this['name'],'email':this[_0xebca('0xa')],'accountcode':this[_0xebca('0xb')],'fullname':this['fullname'],'state':this[_0xebca('0xd')],'stateTime':this[_0xebca('0xf')],'status':this[_0xebca('0x21')],'address':this[_0xebca('0x22')],'online':this[_0xebca('0x13')],'voiceStatus':this[_0xebca('0x1e')],'voiceStatusTime':this[_0xebca('0x14')],'voiceStatusCallerIdNumber':this[_0xebca('0x15')],'voiceStatusQueue':this[_0xebca('0x16')],'interface':this[_0xebca('0x12')],'onhold':this[_0xebca('0x17')]};var _0x451ed3=md5(JSON[_0xebca('0x23')](_0x23b411));if(this[_0xebca('0x3')]!==_0x451ed3){this['md5']=_0x451ed3;io['to'](util[_0xebca('0x20')](_0xebca('0x24'),_0x23b411[_0xebca('0x9')]))['emit']('user:save',_0x23b411);io[_0xebca('0x25')](_0xebca('0x26'),_0x23b411);}};module['exports']=Agent; \ No newline at end of file +var _0x357c=['updateStatusRealtime','state','toLowerCase','not_inuse','idle','talking','voiceStatus','statePause','toNumber','format','interface','user:%s','emit','user:save','user:presence','exports','lodash','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','phone','mobile','online','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype'];(function(_0xc340b4,_0x5b93a0){var _0x686db8=function(_0x382839){while(--_0x382839){_0xc340b4['push'](_0xc340b4['shift']());}};_0x686db8(++_0x5b93a0);}(_0x357c,0x150));var _0xc357=function(_0x191154,_0x56f74c){_0x191154=_0x191154-0x0;var _0x3dcd73=_0x357c[_0x191154];return _0x3dcd73;};'use strict';var _=require(_0xc357('0x0'));var util=require('util');var moment=require('moment');var md5=require(_0xc357('0x1'));var Redis=require(_0xc357('0x2'));var config=require(_0xc357('0x3'));config[_0xc357('0x4')]=_[_0xc357('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xc357('0x6'))(new Redis(config[_0xc357('0x4')]));function Agent(_0x57cec3){this['id']=_0x57cec3['id']||0x0;this[_0xc357('0x7')]=_0x57cec3[_0xc357('0x7')]||'';this[_0xc357('0x8')]=_0x57cec3[_0xc357('0x8')]||'';this[_0xc357('0x9')]=_0x57cec3[_0xc357('0x9')]||'';this[_0xc357('0xa')]=_0x57cec3[_0xc357('0xa')]||'';this['state']=_0xc357('0xb');this[_0xc357('0xc')]=0x0;this[_0xc357('0xd')]=_0xc357('0xb');this[_0xc357('0xe')]='';this[_0xc357('0xf')]='';this[_0xc357('0x10')]='';this['interface']='';this[_0xc357('0x11')]=_0x57cec3['online']||![];this['voiceStatus']=_0xc357('0xb');this[_0xc357('0x12')]=0x0;this[_0xc357('0x13')]='';this[_0xc357('0x14')]='';this[_0xc357('0x15')]=![];this[_0xc357('0x16')]=![];this[_0xc357('0x1')]='';}Agent[_0xc357('0x17')][_0xc357('0x18')]=function(_0x5c5b48){var _0x952a34;if(_0x5c5b48&&_0x5c5b48[_0xc357('0x19')]){_0x952a34=_0x5c5b48[_0xc357('0x19')][_0xc357('0x1a')]();switch(_0x952a34){case _0xc357('0x1b'):_0x952a34=_0xc357('0x1c');break;case'inuse':_0x952a34=_0xc357('0x1d');break;}}if(_0x952a34&&this[_0xc357('0x1e')]!==_0x952a34||_0x5c5b48[_0xc357('0x1f')]){this[_0xc357('0x12')]=_[_0xc357('0x20')](moment()[_0xc357('0x21')]('x'));}if(_0x952a34){this[_0xc357('0x1e')]=_0x952a34;}var _0x3a3b84={'id':this['id'],'name':this[_0xc357('0x7')],'email':this[_0xc357('0x8')],'accountcode':this['accountcode'],'fullname':this[_0xc357('0xa')],'state':this[_0xc357('0x19')],'stateTime':this[_0xc357('0xc')],'status':this[_0xc357('0xd')],'address':this['address'],'online':this[_0xc357('0x11')],'voiceStatus':this[_0xc357('0x1e')],'voiceStatusTime':this[_0xc357('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0xc357('0x14')],'interface':this[_0xc357('0x22')],'onhold':this[_0xc357('0x15')]};var _0x519ab1=md5(JSON['stringify'](_0x3a3b84));if(this[_0xc357('0x1')]!==_0x519ab1){this[_0xc357('0x1')]=_0x519ab1;io['to'](util[_0xc357('0x21')](_0xc357('0x23'),_0x3a3b84[_0xc357('0x7')]))[_0xc357('0x24')](_0xc357('0x25'),_0x3a3b84);io['emit'](_0xc357('0x26'),_0x3a3b84);}};module[_0xc357('0x27')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 4581425..382acae 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 _0xfb7f=['Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength','exports','name','type','originated','temp','ivrAnswerCallsDay','message','sendMessageOneNotActive','limitCalls','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk'];(function(_0xdf4058,_0x3d913d){var _0x141888=function(_0x52b935){while(--_0x52b935){_0xdf4058['push'](_0xdf4058['shift']());}};_0x141888(++_0x3d913d);}(_0xfb7f,0x184));var _0xffb7=function(_0x1015b8,_0x3755de){_0x1015b8=_0x1015b8-0x0;var _0x2fc31a=_0xfb7f[_0x1015b8];return _0x2fc31a;};'use strict';function Campaign(_0x100e53){this['id']=_0x100e53['id']||0x0;this['name']=_0x100e53[_0xffb7('0x0')]||'';this[_0xffb7('0x1')]=_0x100e53['type']||'campaign';this[_0xffb7('0x2')]=0x0;this[_0xffb7('0x3')]=0x0;this[_0xffb7('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this[_0xffb7('0x5')]='';this[_0xffb7('0x6')]=!![];this['active']=_0x100e53['active'];this[_0xffb7('0x7')]=_0x100e53[_0xffb7('0x7')];this['dialTimezone']=_0x100e53['dialTimezone']||null;this[_0xffb7('0x8')]=_0x100e53['dialGlobalInterval']?_0x100e53[_0xffb7('0x8')]:null;this[_0xffb7('0x9')]=_0x100e53[_0xffb7('0x9')];this[_0xffb7('0xa')]=_0x100e53[_0xffb7('0xa')];this['dialOriginateTimeout']=_0x100e53[_0xffb7('0xb')]||0x1e;this['dialCongestionMaxRetry']=_0x100e53[_0xffb7('0xc')];this[_0xffb7('0xd')]=_0x100e53['dialCongestionRetryFrequency'];this[_0xffb7('0xe')]=_0x100e53[_0xffb7('0xe')];this[_0xffb7('0xf')]=_0x100e53[_0xffb7('0xf')];this['dialNoAnswerMaxRetry']=_0x100e53['dialNoAnswerMaxRetry'];this[_0xffb7('0x10')]=_0x100e53[_0xffb7('0x10')];this[_0xffb7('0x11')]=_0x100e53[_0xffb7('0x11')];this['dialNoSuchNumberMaxRetry']=_0x100e53[_0xffb7('0x12')]||0x3;this[_0xffb7('0x13')]=_0x100e53['dialNoSuchNumberRetryFrequency']||0x96;this['dialDropMaxRetry']=_0x100e53[_0xffb7('0x14')]||0x3;this[_0xffb7('0x15')]=_0x100e53[_0xffb7('0x15')]||0x96;this[_0xffb7('0x16')]=_0x100e53[_0xffb7('0x16')]||0x3;this[_0xffb7('0x17')]=_0x100e53[_0xffb7('0x17')]||0x96;this[_0xffb7('0x18')]=_0x100e53[_0xffb7('0x18')]||0x3;this[_0xffb7('0x19')]=_0x100e53[_0xffb7('0x19')]||0x96;this[_0xffb7('0x1a')]=_0x100e53['dialAgentRejectMaxRetry']||0x3;this['dialAgentRejectRetryFrequency']=_0x100e53[_0xffb7('0x1b')]||0x96;this[_0xffb7('0x1c')]=_0x100e53[_0xffb7('0x1c')]||_0xffb7('0x1d');this[_0xffb7('0x1e')]=_0x100e53[_0xffb7('0x1e')]||undefined;this[_0xffb7('0x1f')]=_0x100e53['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xffb7('0x20')]=_0x100e53[_0xffb7('0x20')]||undefined;this[_0xffb7('0x21')]=_0x100e53[_0xffb7('0x21')]?_0x100e53[_0xffb7('0x21')]:undefined;this['Trunk']=_0x100e53[_0xffb7('0x22')]?_0x100e53[_0xffb7('0x22')]:undefined;this[_0xffb7('0x23')]=_0x100e53[_0xffb7('0x23')]?_0x100e53[_0xffb7('0x23')]:undefined;this[_0xffb7('0x24')]=_0x100e53[_0xffb7('0x24')]?_0x100e53[_0xffb7('0x24')]:undefined;this['dialQueueProject']=_0x100e53['SquareProject']?_0x100e53[_0xffb7('0x24')][_0xffb7('0x0')]:undefined;this[_0xffb7('0x25')]=_0x100e53[_0xffb7('0x25')]||![];this[_0xffb7('0x26')]=_0x100e53[_0xffb7('0x26')];this[_0xffb7('0x27')]=_0x100e53[_0xffb7('0x27')];this[_0xffb7('0x28')]=_0x100e53[_0xffb7('0x28')];this[_0xffb7('0x29')]=_0x100e53['dialAMDTotalAnalysisTime'];this[_0xffb7('0x2a')]=_0x100e53[_0xffb7('0x2a')];this['dialAMDBetweenWordsSilence']=_0x100e53[_0xffb7('0x2b')];this[_0xffb7('0x2c')]=_0x100e53[_0xffb7('0x2c')];this['dialAMDSilenceThreshold']=_0x100e53['dialAMDSilenceThreshold'];this[_0xffb7('0x2d')]=_0x100e53['dialAMDMaximumWordLength'];}module[_0xffb7('0x2e')]=Campaign; \ No newline at end of file +var _0x125e=['ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','campaign','originated','temp','ivrAnswerCallsDay'];(function(_0xd4e399,_0x4a8481){var _0x1186c9=function(_0x48aa19){while(--_0x48aa19){_0xd4e399['push'](_0xd4e399['shift']());}};_0x1186c9(++_0x4a8481);}(_0x125e,0x1cf));var _0xe125=function(_0x48d7aa,_0x52349c){_0x48d7aa=_0x48d7aa-0x0;var _0x138fc6=_0x125e[_0x48d7aa];return _0x138fc6;};'use strict';function Campaign(_0xc82129){this['id']=_0xc82129['id']||0x0;this[_0xe125('0x0')]=_0xc82129['name']||'';this['type']=_0xc82129['type']||_0xe125('0x1');this[_0xe125('0x2')]=0x0;this[_0xe125('0x3')]=0x0;this[_0xe125('0x4')]=0x0;this[_0xe125('0x5')]=0x0;this[_0xe125('0x6')]='';this[_0xe125('0x7')]=!![];this[_0xe125('0x8')]=_0xc82129[_0xe125('0x8')];this[_0xe125('0x9')]=_0xc82129[_0xe125('0x9')];this[_0xe125('0xa')]=_0xc82129['dialTimezone']||null;this[_0xe125('0xb')]=_0xc82129[_0xe125('0xb')]?_0xc82129['dialGlobalInterval']:null;this[_0xe125('0xc')]=_0xc82129[_0xe125('0xc')];this[_0xe125('0xd')]=_0xc82129[_0xe125('0xd')];this[_0xe125('0xe')]=_0xc82129[_0xe125('0xe')]||0x1e;this['dialCongestionMaxRetry']=_0xc82129[_0xe125('0xf')];this[_0xe125('0x10')]=_0xc82129['dialCongestionRetryFrequency'];this[_0xe125('0x11')]=_0xc82129[_0xe125('0x11')];this[_0xe125('0x12')]=_0xc82129[_0xe125('0x12')];this['dialNoAnswerMaxRetry']=_0xc82129[_0xe125('0x13')];this[_0xe125('0x14')]=_0xc82129[_0xe125('0x14')];this[_0xe125('0x15')]=_0xc82129['dialGlobalMaxRetry'];this[_0xe125('0x16')]=_0xc82129[_0xe125('0x16')]||0x3;this[_0xe125('0x17')]=_0xc82129[_0xe125('0x17')]||0x96;this[_0xe125('0x18')]=_0xc82129[_0xe125('0x18')]||0x3;this[_0xe125('0x19')]=_0xc82129[_0xe125('0x19')]||0x96;this[_0xe125('0x1a')]=_0xc82129[_0xe125('0x1a')]||0x3;this[_0xe125('0x1b')]=_0xc82129[_0xe125('0x1b')]||0x96;this['dialMachineMaxRetry']=_0xc82129[_0xe125('0x1c')]||0x3;this[_0xe125('0x1d')]=_0xc82129[_0xe125('0x1d')]||0x96;this[_0xe125('0x1e')]=_0xc82129[_0xe125('0x1e')]||0x3;this[_0xe125('0x1f')]=_0xc82129[_0xe125('0x1f')]||0x96;this[_0xe125('0x20')]=_0xc82129['dialOrderByScheduledAt']||_0xe125('0x21');this[_0xe125('0x22')]=_0xc82129['dialPrefix']||undefined;this[_0xe125('0x23')]=_0xc82129[_0xe125('0x23')]||undefined;this[_0xe125('0x24')]=_0xc82129['dialCutDigit']||undefined;this[_0xe125('0x25')]=_0xc82129['TrunkBackup']?_0xc82129[_0xe125('0x25')]:undefined;this[_0xe125('0x26')]=_0xc82129[_0xe125('0x26')]?_0xc82129[_0xe125('0x26')]:undefined;this[_0xe125('0x27')]=_0xc82129['Interval']?_0xc82129[_0xe125('0x27')]:undefined;this['SquareProject']=_0xc82129[_0xe125('0x28')]?_0xc82129[_0xe125('0x28')]:undefined;this[_0xe125('0x29')]=_0xc82129['SquareProject']?_0xc82129[_0xe125('0x28')][_0xe125('0x0')]:undefined;this['dialAMDActive']=_0xc82129[_0xe125('0x2a')]||![];this[_0xe125('0x2b')]=_0xc82129[_0xe125('0x2b')];this['dialAMDGreeting']=_0xc82129[_0xe125('0x2c')];this['dialAMDAfterGreetingSilence']=_0xc82129[_0xe125('0x2d')];this[_0xe125('0x2e')]=_0xc82129[_0xe125('0x2e')];this[_0xe125('0x2f')]=_0xc82129[_0xe125('0x2f')];this[_0xe125('0x30')]=_0xc82129[_0xe125('0x30')];this['dialAMDMaximumNumberOfWords']=_0xc82129['dialAMDMaximumNumberOfWords'];this['dialAMDSilenceThreshold']=_0xc82129[_0xe125('0x31')];this[_0xe125('0x32')]=_0xc82129[_0xe125('0x32')];}module[_0xe125('0x33')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index a85de6b..382bcbb 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 _0x7e22=['lastdata','duration','billableseconds','holdtime','type','tag','monitor','monitorFilename','monitors','transfercalleridnum','transferconnectedlinenum','transferType','exports','starttime','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','uniqueid','exten','answered','answertime','endtime','abandoned','lastapplication'];(function(_0x1aba25,_0x1faed1){var _0x47d997=function(_0x4f9e11){while(--_0x4f9e11){_0x1aba25['push'](_0x1aba25['shift']());}};_0x47d997(++_0x1faed1);}(_0x7e22,0x1d8));var _0x27e2=function(_0x47b259,_0x176986){_0x47b259=_0x47b259-0x0;var _0x545d55=_0x7e22[_0x47b259];return _0x545d55;};'use strict';function Channel(){this[_0x27e2('0x0')]=null;this['channel']='';this[_0x27e2('0x1')]='';this[_0x27e2('0x2')]=0x0;this[_0x27e2('0x3')]='';this[_0x27e2('0x4')]=undefined;this[_0x27e2('0x5')]=undefined;this[_0x27e2('0x6')]=0x0;this['context']='';this[_0x27e2('0x7')]=0x0;this['linkedid']=0x0;this[_0x27e2('0x8')]=0x0;this[_0x27e2('0x9')]=![];this[_0x27e2('0xa')]=null;this[_0x27e2('0xb')]=null;this['unmanaged']=![];this[_0x27e2('0xc')]=![];this[_0x27e2('0xd')]='';this[_0x27e2('0xe')]='';this[_0x27e2('0xf')]=0x0;this[_0x27e2('0x10')]=0x0;this[_0x27e2('0x11')]=0x0;this[_0x27e2('0x12')]=null;this[_0x27e2('0x13')]=null;this['disposition']=null;this[_0x27e2('0x14')]=![];this[_0x27e2('0x15')]=null;this['queue']=null;this[_0x27e2('0x16')]=[];this[_0x27e2('0x17')]=undefined;this[_0x27e2('0x18')]=undefined;this[_0x27e2('0x19')]=undefined;this['mohtime']=0x0;}module[_0x27e2('0x1a')]=Channel; \ No newline at end of file +var _0x3c6a=['context','uniqueid','linkedid','exten','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','holdtime','type','tag','monitor','queue','monitors','transfercalleridnum','exports','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode'];(function(_0x281e5e,_0xf320e2){var _0x5a22d2=function(_0x405ff9){while(--_0x405ff9){_0x281e5e['push'](_0x281e5e['shift']());}};_0x5a22d2(++_0xf320e2);}(_0x3c6a,0xd1));var _0xa3c6=function(_0x1d04b5,_0x30792c){_0x1d04b5=_0x1d04b5-0x0;var _0x161342=_0x3c6a[_0x1d04b5];return _0x161342;};'use strict';function Channel(){this['starttime']=null;this[_0xa3c6('0x0')]='';this[_0xa3c6('0x1')]='';this[_0xa3c6('0x2')]=0x0;this[_0xa3c6('0x3')]='';this[_0xa3c6('0x4')]=undefined;this[_0xa3c6('0x5')]=undefined;this[_0xa3c6('0x6')]=0x0;this[_0xa3c6('0x7')]='';this[_0xa3c6('0x8')]=0x0;this[_0xa3c6('0x9')]=0x0;this[_0xa3c6('0xa')]=0x0;this['answered']=![];this[_0xa3c6('0xb')]=null;this[_0xa3c6('0xc')]=null;this[_0xa3c6('0xd')]=![];this[_0xa3c6('0xe')]=![];this[_0xa3c6('0xf')]='';this[_0xa3c6('0x10')]='';this[_0xa3c6('0x11')]=0x0;this[_0xa3c6('0x12')]=0x0;this[_0xa3c6('0x13')]=0x0;this[_0xa3c6('0x14')]=null;this[_0xa3c6('0x15')]=null;this['disposition']=null;this[_0xa3c6('0x16')]=![];this['monitorFilename']=null;this[_0xa3c6('0x17')]=null;this[_0xa3c6('0x18')]=[];this[_0xa3c6('0x19')]=undefined;this['transferconnectedlinenum']=undefined;this['transferType']=undefined;this['mohtime']=0x0;}module[_0xa3c6('0x1a')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index bd18f6b..1f02e17 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 _0x6b58=['remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username'];(function(_0x110e42,_0x134a3e){var _0x343f58=function(_0x58f189){while(--_0x58f189){_0x110e42['push'](_0x110e42['shift']());}};_0x343f58(++_0x134a3e);}(_0x6b58,0xce));var _0x86b5=function(_0x10291b,_0x518773){_0x10291b=_0x10291b-0x0;var _0x1d5fbe=_0x6b58[_0x10291b];return _0x1d5fbe;};'use strict';function DeskAccount(_0x2613d5){this['id']=_0x2613d5['id']||0x0;this[_0x86b5('0x0')]=_0x2613d5[_0x86b5('0x0')]||'';this['username']=_0x2613d5[_0x86b5('0x1')]||'';this[_0x86b5('0x2')]=_0x2613d5[_0x86b5('0x2')]||'';this[_0x86b5('0x3')]=_0x2613d5[_0x86b5('0x3')]||'';this['password']=_0x2613d5[_0x86b5('0x4')]||'';this[_0x86b5('0x5')]=_0x2613d5['consumerKey']||'';this['consumerSecret']=_0x2613d5[_0x86b5('0x6')]||'';this[_0x86b5('0x7')]=_0x2613d5[_0x86b5('0x7')]||'';this[_0x86b5('0x8')]=_0x2613d5[_0x86b5('0x8')]||'';this[_0x86b5('0x9')]=_0x2613d5['type']||'';this[_0x86b5('0xa')]=_0x2613d5[_0x86b5('0xa')]||'';this[_0x86b5('0xb')]=_0x2613d5[_0x86b5('0xb')]||{};}module[_0x86b5('0xc')]=DeskAccount; \ No newline at end of file +var _0xc8b8=['exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations'];(function(_0x2f3a46,_0x25335f){var _0x98fa2f=function(_0x377b08){while(--_0x377b08){_0x2f3a46['push'](_0x2f3a46['shift']());}};_0x98fa2f(++_0x25335f);}(_0xc8b8,0x12c));var _0x8c8b=function(_0x4a7631,_0x2c85b9){_0x4a7631=_0x4a7631-0x0;var _0x1a5a6f=_0xc8b8[_0x4a7631];return _0x1a5a6f;};'use strict';function DeskAccount(_0x4c463a){this['id']=_0x4c463a['id']||0x0;this[_0x8c8b('0x0')]=_0x4c463a[_0x8c8b('0x0')]||'';this[_0x8c8b('0x1')]=_0x4c463a[_0x8c8b('0x1')]||'';this[_0x8c8b('0x2')]=_0x4c463a[_0x8c8b('0x2')]||'';this[_0x8c8b('0x3')]=_0x4c463a[_0x8c8b('0x3')]||'';this['password']=_0x4c463a[_0x8c8b('0x4')]||'';this[_0x8c8b('0x5')]=_0x4c463a[_0x8c8b('0x5')]||'';this[_0x8c8b('0x6')]=_0x4c463a[_0x8c8b('0x6')]||'';this[_0x8c8b('0x7')]=_0x4c463a[_0x8c8b('0x7')]||'';this[_0x8c8b('0x8')]=_0x4c463a[_0x8c8b('0x8')]||'';this[_0x8c8b('0x9')]=_0x4c463a[_0x8c8b('0x9')]||'';this[_0x8c8b('0xa')]=_0x4c463a[_0x8c8b('0xa')]||'';this[_0x8c8b('0xb')]=_0x4c463a[_0x8c8b('0xb')]||{};}module[_0x8c8b('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 5c47919..0269a7e 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 _0x832d=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider'];(function(_0x38fb0d,_0x52b5db){var _0x30a5d6=function(_0x31eba6){while(--_0x31eba6){_0x38fb0d['push'](_0x38fb0d['shift']());}};_0x30a5d6(++_0x52b5db);}(_0x832d,0x108));var _0xd832=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x832d[_0x14add3];return _0x4a174f;};'use strict';function Dynamics365Account(_0x33b9c0){this['id']=_0x33b9c0['id']||0x0;this[_0xd832('0x0')]=_0x33b9c0[_0xd832('0x0')]||'';this[_0xd832('0x1')]=_0x33b9c0[_0xd832('0x1')]||'';this[_0xd832('0x2')]=_0x33b9c0['password']||'';this[_0xd832('0x3')]=_0x33b9c0['remoteUri']||'';this[_0xd832('0x4')]=_0x33b9c0[_0xd832('0x4')]||'';this[_0xd832('0x5')]=_0x33b9c0[_0xd832('0x5')]||'';this[_0xd832('0x6')]=_0x33b9c0[_0xd832('0x6')]||{};this[_0xd832('0x7')]=_0x33b9c0[_0xd832('0x7')]||'';this['modernAuthentication']=_0x33b9c0[_0xd832('0x8')]||![];this[_0xd832('0x9')]=_0x33b9c0[_0xd832('0x9')]||{};this['CloudProvider']=_0x33b9c0[_0xd832('0xa')]||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x3b67=['remoteUri','tenantId','clientId','clientSecret','serverUrl','modernAuthentication','Configurations','CloudProvider','exports','name','username','password'];(function(_0x2bc00e,_0xc847fb){var _0x7f9249=function(_0x44b7f0){while(--_0x44b7f0){_0x2bc00e['push'](_0x2bc00e['shift']());}};_0x7f9249(++_0xc847fb);}(_0x3b67,0x171));var _0x73b6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3b67[_0x3dd15e];return _0x231fd0;};'use strict';function Dynamics365Account(_0x5e4ffc){this['id']=_0x5e4ffc['id']||0x0;this[_0x73b6('0x0')]=_0x5e4ffc[_0x73b6('0x0')]||'';this[_0x73b6('0x1')]=_0x5e4ffc[_0x73b6('0x1')]||'';this['password']=_0x5e4ffc[_0x73b6('0x2')]||'';this[_0x73b6('0x3')]=_0x5e4ffc['remoteUri']||'';this[_0x73b6('0x4')]=_0x5e4ffc[_0x73b6('0x4')]||'';this[_0x73b6('0x5')]=_0x5e4ffc[_0x73b6('0x5')]||'';this[_0x73b6('0x6')]=_0x5e4ffc[_0x73b6('0x6')]||{};this[_0x73b6('0x7')]=_0x5e4ffc['serverUrl']||'';this[_0x73b6('0x8')]=_0x5e4ffc['modernAuthentication']||![];this[_0x73b6('0x9')]=_0x5e4ffc[_0x73b6('0x9')]||{};this[_0x73b6('0xa')]=_0x5e4ffc[_0x73b6('0xa')]||{};}module[_0x73b6('0xb')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 92d7bd3..b063479 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 _0x646e=['t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0x646e,0xc2));var _0xe646=function(_0x5220be,_0x1933b7){_0x5220be=_0x5220be-0x0;var _0x4eaa77=_0x646e[_0x5220be];return _0x4eaa77;};'use strict';function FaxAccount(_0x7352e3){this['id']=_0x7352e3['id']||0x0;this[_0xe646('0x0')]=_0x7352e3[_0xe646('0x0')]||'';this['description']=_0x7352e3[_0xe646('0x1')];this['ecm']=_0x7352e3['ecm'];this[_0xe646('0x2')]=_0x7352e3['headerinfo'];this[_0xe646('0x3')]=_0x7352e3[_0xe646('0x3')];this[_0xe646('0x4')]=_0x7352e3[_0xe646('0x4')]||0x960;this[_0xe646('0x5')]=_0x7352e3['maxrate']||0x3840;this[_0xe646('0x6')]=_0x7352e3[_0xe646('0x6')]||_0xe646('0x7');this[_0xe646('0x8')]=_0x7352e3[_0xe646('0x8')]||'no';this[_0xe646('0x9')]=_0x7352e3[_0xe646('0x9')]||'no';this[_0xe646('0xa')]=_0x7352e3[_0xe646('0xa')]||0x1388;this[_0xe646('0xb')]=_0x7352e3[_0xe646('0xb')]||_0xe646('0xc');this[_0xe646('0xd')]=_0x7352e3['Trunk']?_0x7352e3[_0xe646('0xd')]:undefined;this[_0xe646('0xe')]=_0x7352e3['ListId'];this['key']=_0x7352e3[_0xe646('0xf')];}module[_0xe646('0x10')]=FaxAccount; \ No newline at end of file +var _0x2193=['name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','key','exports'];(function(_0x483211,_0x3ebe9e){var _0x46bfdb=function(_0x579bfb){while(--_0x579bfb){_0x483211['push'](_0x483211['shift']());}};_0x46bfdb(++_0x3ebe9e);}(_0x2193,0xee));var _0x3219=function(_0x4cd09d,_0x11f4ca){_0x4cd09d=_0x4cd09d-0x0;var _0x35cdac=_0x2193[_0x4cd09d];return _0x35cdac;};'use strict';function FaxAccount(_0x40456a){this['id']=_0x40456a['id']||0x0;this[_0x3219('0x0')]=_0x40456a[_0x3219('0x0')]||'';this[_0x3219('0x1')]=_0x40456a[_0x3219('0x1')];this[_0x3219('0x2')]=_0x40456a['ecm'];this[_0x3219('0x3')]=_0x40456a[_0x3219('0x3')];this[_0x3219('0x4')]=_0x40456a[_0x3219('0x4')];this[_0x3219('0x5')]=_0x40456a[_0x3219('0x5')]||0x960;this[_0x3219('0x6')]=_0x40456a[_0x3219('0x6')]||0x3840;this['modem']=_0x40456a[_0x3219('0x7')]||_0x3219('0x8');this[_0x3219('0x9')]=_0x40456a['gateway']||'no';this['faxdetect']=_0x40456a[_0x3219('0xa')]||'no';this[_0x3219('0xb')]=_0x40456a[_0x3219('0xb')]||0x1388;this[_0x3219('0xc')]=_0x40456a[_0x3219('0xc')]||_0x3219('0xd');this[_0x3219('0xe')]=_0x40456a[_0x3219('0xe')]?_0x40456a[_0x3219('0xe')]:undefined;this['ListId']=_0x40456a['ListId'];this[_0x3219('0xf')]=_0x40456a[_0x3219('0xf')];}module[_0x3219('0x10')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 06e788e..11d9e64 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 _0x9184=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x9184,0x172));var _0x4918=function(_0x2ae099,_0x1d9376){_0x2ae099=_0x2ae099-0x0;var _0x2ce323=_0x9184[_0x2ae099];return _0x2ce323;};'use strict';function FreshdeskAccount(_0x5b543a){this['id']=_0x5b543a['id']||0x0;this['name']=_0x5b543a[_0x4918('0x0')]||'';this[_0x4918('0x1')]=_0x5b543a['username']||'';this[_0x4918('0x2')]=_0x5b543a[_0x4918('0x3')]||'';this[_0x4918('0x4')]=_0x5b543a[_0x4918('0x4')]||'';this[_0x4918('0x5')]=_0x5b543a[_0x4918('0x5')]||'';this[_0x4918('0x6')]=_0x5b543a['Configurations']||{};}module[_0x4918('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x2c74=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c74,0x18a));var _0x42c7=function(_0x1a15cd,_0x1b95c6){_0x1a15cd=_0x1a15cd-0x0;var _0x33f1eb=_0x2c74[_0x1a15cd];return _0x33f1eb;};'use strict';function FreshdeskAccount(_0x5db14d){this['id']=_0x5db14d['id']||0x0;this['name']=_0x5db14d[_0x42c7('0x0')]||'';this['username']=_0x5db14d[_0x42c7('0x1')]||'';this[_0x42c7('0x2')]=_0x5db14d[_0x42c7('0x3')]||'';this[_0x42c7('0x4')]=_0x5db14d[_0x42c7('0x4')]||'';this[_0x42c7('0x5')]=_0x5db14d[_0x42c7('0x5')]||'';this[_0x42c7('0x6')]=_0x5db14d[_0x42c7('0x6')]||{};}module[_0x42c7('0x7')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 37ea983..7c38072 100644 --- a/server/services/ami/model/freshsalesAccount.js +++ b/server/services/ami/model/freshsalesAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf3cc=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x6ca7f4,_0x51a5df){var _0x494fa6=function(_0x359532){while(--_0x359532){_0x6ca7f4['push'](_0x6ca7f4['shift']());}};_0x494fa6(++_0x51a5df);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x59eacf,_0x56ec4a){_0x59eacf=_0x59eacf-0x0;var _0x5d74f2=_0xf3cc[_0x59eacf];return _0x5d74f2;};'use strict';function FreshsalesAccount(_0x48162b){this['id']=_0x48162b['id']||0x0;this[_0xcf3c('0x0')]=_0x48162b[_0xcf3c('0x0')]||'';this[_0xcf3c('0x1')]=_0x48162b['username']||'';this[_0xcf3c('0x2')]=_0x48162b[_0xcf3c('0x3')]||'';this[_0xcf3c('0x4')]=_0x48162b['remoteUri']||'';this[_0xcf3c('0x5')]=_0x48162b[_0xcf3c('0x5')]||'';this['Configurations']=_0x48162b[_0xcf3c('0x6')]||{};}module[_0xcf3c('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xc474=['name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x21ded3,_0x323180){var _0x1c220a=function(_0x31793f){while(--_0x31793f){_0x21ded3['push'](_0x21ded3['shift']());}};_0x1c220a(++_0x323180);}(_0xc474,0xfc));var _0x4c47=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xc474[_0x7e2eb0];return _0xd92de4;};'use strict';function FreshsalesAccount(_0x1daf8a){this['id']=_0x1daf8a['id']||0x0;this[_0x4c47('0x0')]=_0x1daf8a[_0x4c47('0x0')]||'';this['username']=_0x1daf8a[_0x4c47('0x1')]||'';this[_0x4c47('0x2')]=_0x1daf8a[_0x4c47('0x3')]||'';this[_0x4c47('0x4')]=_0x1daf8a[_0x4c47('0x4')]||'';this[_0x4c47('0x5')]=_0x1daf8a[_0x4c47('0x5')]||'';this[_0x4c47('0x6')]=_0x1daf8a['Configurations']||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index a8b8856..091502b 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 _0xe7e2=['type','calleridname','queue','queuecallerjoinAt','queuecallerabandonAt','queuecallercompleteAt','queuecallerexitAt','originalposition','connectedlinenum','accountcode','context','exten','priority','motionChannel','voice','mohtime','variables','exports'];(function(_0x4f7c42,_0x28a695){var _0x5da7de=function(_0x4b10e4){while(--_0x4b10e4){_0x4f7c42['push'](_0x4f7c42['shift']());}};_0x5da7de(++_0x28a695);}(_0xe7e2,0xa2));var _0x2e7e=function(_0x3e3e86,_0x4f6b0a){_0x3e3e86=_0x3e3e86-0x0;var _0x4da863=_0xe7e2[_0x3e3e86];return _0x4da863;};'use strict';function QueueReport(){this[_0x2e7e('0x0')]='inbound';this['uniqueid']='';this['calleridnum']='';this[_0x2e7e('0x1')]='';this[_0x2e7e('0x2')]='';this[_0x2e7e('0x3')]=null;this['queuecallerleaveAt']=null;this['position']=0x1;this['count']=0x1;this['queuecallerabandon']=![];this[_0x2e7e('0x4')]=null;this['queuecallercomplete']=![];this[_0x2e7e('0x5')]=null;this['queuecallerexit']=![];this[_0x2e7e('0x6')]=null;this[_0x2e7e('0x7')]=0x1;this['channel']='';this[_0x2e7e('0x8')]='';this['connectedlinename']='';this[_0x2e7e('0x9')]='';this[_0x2e7e('0xa')]='';this[_0x2e7e('0xb')]='';this[_0x2e7e('0xc')]='';this['holdtime']=0x0;this['assigned']=![];this['lastAssignedTo']='';this[_0x2e7e('0xd')]=_0x2e7e('0xe');this['routealias']=null;this[_0x2e7e('0xf')]=0x0;this[_0x2e7e('0x10')]={};}module[_0x2e7e('0x11')]=QueueReport; \ No newline at end of file +var _0x5e2c=['mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','channel','connectedlinename','accountcode','context','exten','holdtime','assigned','lastAssignedTo','motionChannel','routealias'];(function(_0x3f7fea,_0x2777f6){var _0x5364b1=function(_0x588e9c){while(--_0x588e9c){_0x3f7fea['push'](_0x3f7fea['shift']());}};_0x5364b1(++_0x2777f6);}(_0x5e2c,0x155));var _0xc5e2=function(_0x23c73d,_0x357b21){_0x23c73d=_0x23c73d-0x0;var _0x36ba47=_0x5e2c[_0x23c73d];return _0x36ba47;};'use strict';function QueueReport(){this[_0xc5e2('0x0')]=_0xc5e2('0x1');this[_0xc5e2('0x2')]='';this[_0xc5e2('0x3')]='';this[_0xc5e2('0x4')]='';this[_0xc5e2('0x5')]='';this[_0xc5e2('0x6')]=null;this[_0xc5e2('0x7')]=null;this[_0xc5e2('0x8')]=0x1;this['count']=0x1;this[_0xc5e2('0x9')]=![];this[_0xc5e2('0xa')]=null;this['queuecallercomplete']=![];this['queuecallercompleteAt']=null;this[_0xc5e2('0xb')]=![];this[_0xc5e2('0xc')]=null;this['originalposition']=0x1;this[_0xc5e2('0xd')]='';this['connectedlinenum']='';this[_0xc5e2('0xe')]='';this[_0xc5e2('0xf')]='';this[_0xc5e2('0x10')]='';this[_0xc5e2('0x11')]='';this['priority']='';this[_0xc5e2('0x12')]=0x0;this[_0xc5e2('0x13')]=![];this[_0xc5e2('0x14')]='';this[_0xc5e2('0x15')]='voice';this[_0xc5e2('0x16')]=null;this[_0xc5e2('0x17')]=0x0;this[_0xc5e2('0x18')]={};}module[_0xc5e2('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 91eeeca..f27b393 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 _0x4469=['Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken','type','integrationTab','serverUrl'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x4469,0xb6));var _0x9446=function(_0x3016d3,_0x2ff811){_0x3016d3=_0x3016d3-0x0;var _0xb6f505=_0x4469[_0x3016d3];return _0xb6f505;};'use strict';function SalesforceAccount(_0x31b9e1){this['id']=_0x31b9e1['id']||0x0;this[_0x9446('0x0')]=_0x31b9e1['name']||'';this[_0x9446('0x1')]=_0x31b9e1[_0x9446('0x1')]||'';this[_0x9446('0x2')]=_0x31b9e1[_0x9446('0x2')]||'';this[_0x9446('0x3')]=_0x31b9e1['password']||'';this[_0x9446('0x4')]=_0x31b9e1['clientId']||'';this[_0x9446('0x5')]=_0x31b9e1[_0x9446('0x5')]||'';this[_0x9446('0x6')]=_0x31b9e1[_0x9446('0x6')]||'';this[_0x9446('0x7')]=_0x31b9e1[_0x9446('0x7')]||_0x9446('0x8');this[_0x9446('0x9')]=_0x31b9e1[_0x9446('0x9')]||'';this[_0x9446('0xa')]=_0x31b9e1['Configurations']||{};}module[_0x9446('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x8fcd=['username','password','clientId','clientSecret','type','integrationTab','serverUrl','Configurations','name'];(function(_0x4b9f0d,_0x54a744){var _0x5201f4=function(_0x373efe){while(--_0x373efe){_0x4b9f0d['push'](_0x4b9f0d['shift']());}};_0x5201f4(++_0x54a744);}(_0x8fcd,0xa1));var _0xd8fc=function(_0x250e8e,_0x218ece){_0x250e8e=_0x250e8e-0x0;var _0x11e88f=_0x8fcd[_0x250e8e];return _0x11e88f;};'use strict';function SalesforceAccount(_0x552a5e){this['id']=_0x552a5e['id']||0x0;this[_0xd8fc('0x0')]=_0x552a5e[_0xd8fc('0x0')]||'';this[_0xd8fc('0x1')]=_0x552a5e[_0xd8fc('0x1')]||'';this['remoteUri']=_0x552a5e['remoteUri']||'';this[_0xd8fc('0x2')]=_0x552a5e[_0xd8fc('0x2')]||'';this[_0xd8fc('0x3')]=_0x552a5e[_0xd8fc('0x3')]||'';this[_0xd8fc('0x4')]=_0x552a5e[_0xd8fc('0x4')]||'';this['securityToken']=_0x552a5e['securityToken']||'';this[_0xd8fc('0x5')]=_0x552a5e['type']||_0xd8fc('0x6');this[_0xd8fc('0x7')]=_0x552a5e[_0xd8fc('0x7')]||'';this[_0xd8fc('0x8')]=_0x552a5e['Configurations']||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 9d760e1..ea2303f 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 _0x007b=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x007b,0x13b));var _0xb007=function(_0x2465ed,_0x54d08b){_0x2465ed=_0x2465ed-0x0;var _0x1654d3=_0x007b[_0x2465ed];return _0x1654d3;};'use strict';function ServicenowAccount(_0xa000b4){this['id']=_0xa000b4['id']||0x0;this[_0xb007('0x0')]=_0xa000b4['name']||'';this['username']=_0xa000b4[_0xb007('0x1')]||'';this[_0xb007('0x2')]=_0xa000b4[_0xb007('0x2')]||'';this[_0xb007('0x3')]=_0xa000b4[_0xb007('0x3')]||'';this[_0xb007('0x4')]=_0xa000b4[_0xb007('0x4')]||'';this[_0xb007('0x5')]=_0xa000b4[_0xb007('0x5')]||{};}module[_0xb007('0x6')]=ServicenowAccount; \ No newline at end of file +var _0x315b=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x315b,0x9a));var _0xb315=function(_0x43d5ab,_0x2b8009){_0x43d5ab=_0x43d5ab-0x0;var _0x2c913c=_0x315b[_0x43d5ab];return _0x2c913c;};'use strict';function ServicenowAccount(_0xe6052e){this['id']=_0xe6052e['id']||0x0;this[_0xb315('0x0')]=_0xe6052e[_0xb315('0x0')]||'';this[_0xb315('0x1')]=_0xe6052e['username']||'';this[_0xb315('0x2')]=_0xe6052e[_0xb315('0x2')]||'';this[_0xb315('0x3')]=_0xe6052e[_0xb315('0x3')]||'';this[_0xb315('0x4')]=_0xe6052e[_0xb315('0x4')]||'';this[_0xb315('0x5')]=_0xe6052e[_0xb315('0x5')]||{};}module[_0xb315('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 42aa24c..5f66488 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 _0xdb8d=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0xaade6a,_0xd15afd){var _0x4f9ce1=function(_0x269ce6){while(--_0x269ce6){_0xaade6a['push'](_0xaade6a['shift']());}};_0x4f9ce1(++_0xd15afd);}(_0xdb8d,0x128));var _0xddb8=function(_0x1c1f3e,_0x665593){_0x1c1f3e=_0x1c1f3e-0x0;var _0x325903=_0xdb8d[_0x1c1f3e];return _0x325903;};'use strict';function SugarcrmAccount(_0xfd8fe1){this['id']=_0xfd8fe1['id']||0x0;this[_0xddb8('0x0')]=_0xfd8fe1[_0xddb8('0x0')]||'';this[_0xddb8('0x1')]=_0xfd8fe1[_0xddb8('0x1')]||'';this[_0xddb8('0x2')]=_0xfd8fe1[_0xddb8('0x2')]||'';this[_0xddb8('0x3')]=_0xfd8fe1[_0xddb8('0x3')]||'';this[_0xddb8('0x4')]=_0xfd8fe1[_0xddb8('0x4')]||'';this[_0xddb8('0x5')]=_0xfd8fe1[_0xddb8('0x5')]||{};}module[_0xddb8('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xd405=['remoteUri','serverUrl','Configurations','exports','username','password'];(function(_0x43c63e,_0x38c0c7){var _0x51abc0=function(_0x1021bf){while(--_0x1021bf){_0x43c63e['push'](_0x43c63e['shift']());}};_0x51abc0(++_0x38c0c7);}(_0xd405,0x1d2));var _0x5d40=function(_0x1e381c,_0x47b5b9){_0x1e381c=_0x1e381c-0x0;var _0x9b5ea9=_0xd405[_0x1e381c];return _0x9b5ea9;};'use strict';function SugarcrmAccount(_0x505d13){this['id']=_0x505d13['id']||0x0;this['name']=_0x505d13['name']||'';this['username']=_0x505d13[_0x5d40('0x0')]||'';this[_0x5d40('0x1')]=_0x505d13[_0x5d40('0x1')]||'';this[_0x5d40('0x2')]=_0x505d13[_0x5d40('0x2')]||'';this[_0x5d40('0x3')]=_0x505d13[_0x5d40('0x3')]||'';this[_0x5d40('0x4')]=_0x505d13['Configurations']||{};}module[_0x5d40('0x5')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 51ba11c..7d6e196 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 _0xf29f=['exports','name','accountcode','state','unknown','status'];(function(_0x1bab46,_0x4cfb6d){var _0x12fb36=function(_0x4fb6ed){while(--_0x4fb6ed){_0x1bab46['push'](_0x1bab46['shift']());}};_0x12fb36(++_0x4cfb6d);}(_0xf29f,0x18d));var _0xff29=function(_0x3ad166,_0x4d06dc){_0x3ad166=_0x3ad166-0x0;var _0x384d22=_0xf29f[_0x3ad166];return _0x384d22;};'use strict';function Telephone(_0xb467ef){this['id']=_0xb467ef['id']||0x0;this[_0xff29('0x0')]=_0xb467ef[_0xff29('0x0')]||'';this[_0xff29('0x1')]=_0xb467ef['accountcode']||'';this[_0xff29('0x2')]=_0xff29('0x3');this['stateTime']=0x0;this[_0xff29('0x4')]=_0xff29('0x3');this['address']='';}module[_0xff29('0x5')]=Telephone; \ No newline at end of file +var _0xc893=['unknown','stateTime','status','address','exports','name','state'];(function(_0x5dc314,_0x3fd117){var _0x5d16f8=function(_0x2f23e6){while(--_0x2f23e6){_0x5dc314['push'](_0x5dc314['shift']());}};_0x5d16f8(++_0x3fd117);}(_0xc893,0x194));var _0x3c89=function(_0xd4f10f,_0x4f6eda){_0xd4f10f=_0xd4f10f-0x0;var _0x8ca385=_0xc893[_0xd4f10f];return _0x8ca385;};'use strict';function Telephone(_0x59051a){this['id']=_0x59051a['id']||0x0;this[_0x3c89('0x0')]=_0x59051a[_0x3c89('0x0')]||'';this['accountcode']=_0x59051a['accountcode']||'';this[_0x3c89('0x1')]=_0x3c89('0x2');this[_0x3c89('0x3')]=0x0;this[_0x3c89('0x4')]=_0x3c89('0x2');this[_0x3c89('0x5')]='';}module[_0x3c89('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 bff255c..ad8863c 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 _0xa9e0=['exports','name'];(function(_0x46d008,_0x553fed){var _0x4b1f5d=function(_0x363e08){while(--_0x363e08){_0x46d008['push'](_0x46d008['shift']());}};_0x4b1f5d(++_0x553fed);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'use strict';function template(_0x1f0015){this['id']=_0x1f0015['id']||0x0;this[_0x0a9e('0x0')]=_0x1f0015[_0x0a9e('0x0')]||'';this['html']=_0x1f0015['html']||'';}module[_0x0a9e('0x1')]=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x472949,_0x455be7){var _0x3c3e56=function(_0x29cc8b){while(--_0x29cc8b){_0x472949['push'](_0x472949['shift']());}};_0x3c3e56(++_0x455be7);}(_0xb10b,0x12a));var _0xbb10=function(_0x4ce1b9,_0x397a4b){_0x4ce1b9=_0x4ce1b9-0x0;var _0x2bb15d=_0xb10b[_0x4ce1b9];return _0x2bb15d;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 3ecf76d..bc4106c 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 _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x4d66d5,_0x366a6c){var _0x27edd8=function(_0xcf6a40){while(--_0xcf6a40){_0x4d66d5['push'](_0x4d66d5['shift']());}};_0x27edd8(++_0x366a6c);}(_0xda2d,0x102));var _0xdda2=function(_0x18bc5b,_0x13cab6){_0x18bc5b=_0x18bc5b-0x0;var _0x290f86=_0xda2d[_0x18bc5b];return _0x290f86;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('0x6')]=Trigger; \ No newline at end of file +var _0x5eb8=['Actions','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0x5eb8,0xb0));var _0x85eb=function(_0x4239bd,_0x1f310b){_0x4239bd=_0x4239bd-0x0;var _0x21f061=_0x5eb8[_0x4239bd];return _0x21f061;};'use strict';function Trigger(_0x5ea4df){this['id']=_0x5ea4df['id']||0x0;this['name']=_0x5ea4df[_0x85eb('0x0')]||'';this[_0x85eb('0x1')]=_0x5ea4df[_0x85eb('0x1')]||_0x85eb('0x2');this[_0x85eb('0x3')]=_0x5ea4df[_0x85eb('0x3')]||![];this[_0x85eb('0x4')]=_0x5ea4df[_0x85eb('0x4')]||[];this[_0x85eb('0x5')]=_0x5ea4df[_0x85eb('0x5')]||[];this[_0x85eb('0x6')]=_0x5ea4df[_0x85eb('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 5cae107..ebf889b 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 _0x7b64=['unknown','stateTime','status','registry','domain','domainport','refresh','stateRegistry','registrationtime','defaultuser','exports','active','name','state'];(function(_0x5b27da,_0x4a6532){var _0x3254f4=function(_0x4194c6){while(--_0x4194c6){_0x5b27da['push'](_0x5b27da['shift']());}};_0x3254f4(++_0x4a6532);}(_0x7b64,0x107));var _0x47b6=function(_0x537013,_0x5c6c65){_0x537013=_0x537013-0x0;var _0x1c7c94=_0x7b64[_0x537013];return _0x1c7c94;};'use strict';function Trunk(_0x210b90){this['id']=_0x210b90['id']||0x0;this['active']=_0x210b90[_0x47b6('0x0')]||![];this[_0x47b6('0x1')]=_0x210b90[_0x47b6('0x1')]||'';this[_0x47b6('0x2')]=_0x47b6('0x3');this[_0x47b6('0x4')]=0x0;this[_0x47b6('0x5')]=_0x47b6('0x3');this[_0x47b6('0x6')]=_0x210b90[_0x47b6('0x6')]&&_0x210b90[_0x47b6('0x6')]['indexOf'](':')?_0x210b90['registry']['split'](':')[0x0]:'';this['host']='';this['port']='';this[_0x47b6('0x7')]='';this[_0x47b6('0x8')]='';this[_0x47b6('0x9')]='';this[_0x47b6('0xa')]=_0x47b6('0x3');this[_0x47b6('0xb')]='';this['address']='';this[_0x47b6('0xc')]=_0x210b90['defaultuser']||'';}module[_0x47b6('0xd')]=Trunk; \ No newline at end of file +var _0x0439=['registrationtime','address','defaultuser','active','name','state','unknown','registry','indexOf','split','port','domain','stateRegistry'];(function(_0x4f879c,_0x434b46){var _0x24bae6=function(_0x47ada6){while(--_0x47ada6){_0x4f879c['push'](_0x4f879c['shift']());}};_0x24bae6(++_0x434b46);}(_0x0439,0xd3));var _0x9043=function(_0x35fa3f,_0x500d59){_0x35fa3f=_0x35fa3f-0x0;var _0x158869=_0x0439[_0x35fa3f];return _0x158869;};'use strict';function Trunk(_0x144d66){this['id']=_0x144d66['id']||0x0;this[_0x9043('0x0')]=_0x144d66['active']||![];this[_0x9043('0x1')]=_0x144d66[_0x9043('0x1')]||'';this[_0x9043('0x2')]=_0x9043('0x3');this['stateTime']=0x0;this['status']=_0x9043('0x3');this['registry']=_0x144d66['registry']&&_0x144d66[_0x9043('0x4')][_0x9043('0x5')](':')?_0x144d66['registry'][_0x9043('0x6')](':')[0x0]:'';this['host']='';this[_0x9043('0x7')]='';this[_0x9043('0x8')]='';this['domainport']='';this['refresh']='';this[_0x9043('0x9')]=_0x9043('0x3');this[_0x9043('0xa')]='';this[_0x9043('0xb')]='';this[_0x9043('0xc')]=_0x144d66[_0x9043('0xc')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index c85582f..0545537 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 _0xda42=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x22ef56,_0x57ebb7){var _0x1d3c5a=function(_0x2a36da){while(--_0x2a36da){_0x22ef56['push'](_0x22ef56['shift']());}};_0x1d3c5a(++_0x57ebb7);}(_0xda42,0x1a6));var _0x2da4=function(_0x309d86,_0x827499){_0x309d86=_0x309d86-0x0;var _0xe326be=_0xda42[_0x309d86];return _0xe326be;};'use strict';function voiceExtension(_0x5ef6d1){this['id']=_0x5ef6d1['id']||0x0;this[_0x2da4('0x0')]=_0x5ef6d1['exten']||'';this[_0x2da4('0x1')]=_0x5ef6d1[_0x2da4('0x1')]||_0x2da4('0x2');this['mandatoryDisposition']=_0x5ef6d1[_0x2da4('0x3')]||![];}module[_0x2da4('0x4')]=voiceExtension; \ No newline at end of file +var _0x7d0a=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x5b8ede,_0xf69201){var _0x4eb76f=function(_0x3cb0bb){while(--_0x3cb0bb){_0x5b8ede['push'](_0x5b8ede['shift']());}};_0x4eb76f(++_0xf69201);}(_0x7d0a,0x90));var _0xa7d0=function(_0x133fc0,_0x1edda8){_0x133fc0=_0x133fc0-0x0;var _0x4ce619=_0x7d0a[_0x133fc0];return _0x4ce619;};'use strict';function voiceExtension(_0x1a8b17){this['id']=_0x1a8b17['id']||0x0;this[_0xa7d0('0x0')]=_0x1a8b17[_0xa7d0('0x0')]||'';this['recordingFormat']=_0x1a8b17[_0xa7d0('0x1')]||_0xa7d0('0x2');this[_0xa7d0('0x3')]=_0x1a8b17[_0xa7d0('0x3')]||![];}module[_0xa7d0('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 c7c2edf..185ad7e 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 _0x37b2=['dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','queueSummaryCountersUpdated','wav49','gsm','fewestcalls','linear','random','ringall','rrmemory','rrordered','wrandom','name','monitor_format','type','inbound','total','sumHoldTime','unmanaged','abandoned','available','loggedIn','notInUse','onHold','ringing','ringInUse','talking','unavailable','acw','acwTimeout','autopause','sendMessageOneNotActive','message','statusMessage','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x37b2,0xf8));var _0x237b=function(_0x422a51,_0x1782d8){_0x422a51=_0x422a51-0x0;var _0x250b2a=_0x37b2[_0x422a51];return _0x250b2a;};'use strict';var monitorFormat={'wav':'wav','wav49':_0x237b('0x0'),'gsm':_0x237b('0x1')};var strategy={'fewestcalls':_0x237b('0x2'),'leastrecent':'leastrecent','linear':_0x237b('0x3'),'random':_0x237b('0x4'),'ringall':_0x237b('0x5'),'rr':'roundrobin','rrmemory':_0x237b('0x6'),'rrordered':_0x237b('0x7'),'wrandom':_0x237b('0x8')};function VoiceQueue(_0x5a3d8e){this['id']=_0x5a3d8e['id']||0x0;this[_0x237b('0x9')]=_0x5a3d8e[_0x237b('0x9')]||'';this['monitor_format']=_0x5a3d8e[_0x237b('0xa')]||'';this[_0x237b('0xb')]=_0x5a3d8e[_0x237b('0xb')]||_0x237b('0xc');this['waiting']=0x0;this[_0x237b('0xd')]=0x0;this['answered']=0x0;this['sumDuration']=0x0;this[_0x237b('0xe')]=0x0;this['sumBillable']=0x0;this[_0x237b('0xf')]=0x0;this[_0x237b('0x10')]=0x0;this[_0x237b('0x11')]=0x0;this['busy']=0x0;this['inUse']=0x0;this['invalid']=0x0;this[_0x237b('0x12')]=0x0;this[_0x237b('0x13')]=0x0;this[_0x237b('0x14')]=0x0;this['paused']=0x0;this[_0x237b('0x15')]=0x0;this[_0x237b('0x16')]=0x0;this[_0x237b('0x17')]=0x0;this[_0x237b('0x18')]=0x0;this['unknown']=0x0;this[_0x237b('0x19')]=_0x5a3d8e[_0x237b('0x19')]||![];this[_0x237b('0x1a')]=_0x5a3d8e[_0x237b('0x1a')]||0xa;this[_0x237b('0x1b')]=_0x5a3d8e[_0x237b('0x1b')]||'no';this[_0x237b('0x1c')]=!![];this[_0x237b('0x1d')]='';this[_0x237b('0x1e')]='';this['originated']=0x0;this['temp']=0x0;this[_0x237b('0x1f')]=_0x5a3d8e[_0x237b('0x1f')]||null;this['dialGlobalInterval']=_0x5a3d8e[_0x237b('0x20')]?_0x5a3d8e['dialGlobalInterval']:null;this[_0x237b('0x21')]=_0x5a3d8e['dialActive'];this[_0x237b('0x22')]=_0x5a3d8e[_0x237b('0x22')]||'progressive';this[_0x237b('0x23')]=_0x5a3d8e[_0x237b('0x23')]||0x0;this[_0x237b('0x24')]=_0x5a3d8e[_0x237b('0x24')]||0x0;this[_0x237b('0x25')]=_0x5a3d8e[_0x237b('0x25')]||0x1;this[_0x237b('0x26')]=_0x5a3d8e[_0x237b('0x26')]||'dropRate';this[_0x237b('0x27')]=_0x5a3d8e['dialPredictiveOptimizationPercentage']||0.03;this[_0x237b('0x28')]=_0x5a3d8e[_0x237b('0x28')]||0x258;this['dialOriginateCallerIdName']=_0x5a3d8e[_0x237b('0x29')]||_0x237b('0x2a');this['dialOriginateCallerIdNumber']=_0x5a3d8e[_0x237b('0x2b')]||_0x237b('0x2a');this[_0x237b('0x2c')]=_0x5a3d8e[_0x237b('0x2c')]||0x1e;this['dialQueueOptions']=_0x5a3d8e[_0x237b('0x2d')]||'tTxX';this[_0x237b('0x2e')]=_0x5a3d8e[_0x237b('0x2e')]||0x3;this[_0x237b('0x2f')]=_0x5a3d8e[_0x237b('0x2f')]||undefined;this[_0x237b('0x30')]=_0x5a3d8e[_0x237b('0x30')]||0x3;this[_0x237b('0x31')]=_0x5a3d8e[_0x237b('0x31')]||0x96;this[_0x237b('0x32')]=_0x5a3d8e['dialBusyMaxRetry']||0x3;this[_0x237b('0x33')]=_0x5a3d8e[_0x237b('0x33')]||0x96;this[_0x237b('0x34')]=_0x5a3d8e[_0x237b('0x34')]||0x3;this['dialNoAnswerRetryFrequency']=_0x5a3d8e['dialNoAnswerRetryFrequency']||0x96;this[_0x237b('0x35')]=_0x5a3d8e[_0x237b('0x35')]||0x3;this[_0x237b('0x36')]=_0x5a3d8e[_0x237b('0x36')]||0x96;this['dialDropMaxRetry']=_0x5a3d8e[_0x237b('0x37')]||0x3;this['dialDropRetryFrequency']=_0x5a3d8e[_0x237b('0x38')]||0x96;this[_0x237b('0x39')]=_0x5a3d8e['dialAbandonedMaxRetry']||0x3;this[_0x237b('0x3a')]=_0x5a3d8e[_0x237b('0x3a')]||0x96;this[_0x237b('0x3b')]=_0x5a3d8e[_0x237b('0x3b')]||0x3;this[_0x237b('0x3c')]=_0x5a3d8e[_0x237b('0x3c')]||0x96;this['dialAgentRejectMaxRetry']=_0x5a3d8e[_0x237b('0x3d')]||0x3;this[_0x237b('0x3e')]=_0x5a3d8e['dialAgentRejectRetryFrequency']||0x96;this[_0x237b('0x3f')]=_0x5a3d8e[_0x237b('0x3f')]||0x3;this['dialGlobalMaxRetry']=_0x5a3d8e[_0x237b('0x40')]||0x4;this['Trunk']=_0x5a3d8e[_0x237b('0x41')]?_0x5a3d8e[_0x237b('0x41')]:undefined;this[_0x237b('0x42')]=_0x5a3d8e[_0x237b('0x42')]?_0x5a3d8e[_0x237b('0x42')]:undefined;this[_0x237b('0x43')]=_0x5a3d8e[_0x237b('0x43')]||undefined;this[_0x237b('0x44')]=_0x5a3d8e[_0x237b('0x44')]?_0x5a3d8e[_0x237b('0x44')]:undefined;this[_0x237b('0x45')]=_0x5a3d8e[_0x237b('0x45')]||_0x237b('0x46');this[_0x237b('0x47')]=_0x5a3d8e[_0x237b('0x47')]||undefined;this['dialCutDigit']=_0x5a3d8e[_0x237b('0x48')]||undefined;this[_0x237b('0x49')]=strategy[_0x5a3d8e[_0x237b('0x49')]];this[_0x237b('0x4a')]=!![];this[_0x237b('0x4b')]=_0x5a3d8e[_0x237b('0x4b')]||![];this[_0x237b('0x4c')]=_0x5a3d8e[_0x237b('0x4c')];this[_0x237b('0x4d')]=_0x5a3d8e[_0x237b('0x4d')];this['dialAMDAfterGreetingSilence']=_0x5a3d8e['dialAMDAfterGreetingSilence'];this[_0x237b('0x4e')]=_0x5a3d8e[_0x237b('0x4e')];this['dialAMDMinWordLength']=_0x5a3d8e[_0x237b('0x4f')];this['dialAMDBetweenWordsSilence']=_0x5a3d8e[_0x237b('0x50')];this[_0x237b('0x51')]=_0x5a3d8e[_0x237b('0x51')];this['dialAMDSilenceThreshold']=_0x5a3d8e[_0x237b('0x52')];this[_0x237b('0x53')]=_0x5a3d8e[_0x237b('0x53')];this['outboundRejectCallsDay']=0x0;this[_0x237b('0x54')]=0x0;this[_0x237b('0x55')]=_0x5a3d8e[_0x237b('0x55')];this[_0x237b('0x56')]=0x0;this[_0x237b('0x57')]=0x0;this[_0x237b('0x58')]=0x0;this['outboundBusyCallsDay']=0x0;this[_0x237b('0x59')]=0x0;this[_0x237b('0x5a')]=0x0;this['outboundUnknownCallsDay']=0x0;this[_0x237b('0x5b')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x237b('0x5c')]=0x0;this[_0x237b('0x5d')]=0x0;this[_0x237b('0x5e')]=0x0;this[_0x237b('0x5f')]=0x0;this[_0x237b('0x60')]=0x0;this[_0x237b('0x61')]=undefined;this[_0x237b('0x62')]=undefined;this[_0x237b('0x63')]=undefined;this[_0x237b('0x64')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x237b('0x65')]=0x0;this['predictiveIntervalDroppedCallsCallersExit']=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x237b('0x66')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this[_0x237b('0x67')]=0x0;this[_0x237b('0x68')]=_0x5a3d8e[_0x237b('0x69')]||0x14;this[_0x237b('0x6a')]=_0x5a3d8e[_0x237b('0x69')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x237b('0x6b')]=0x0;this[_0x237b('0x6c')]=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this[_0x237b('0x6d')]=0x0;this[_0x237b('0x6e')]=0x0;this['dialRecallMeTimeout']=_0x5a3d8e[_0x237b('0x6f')]||0x1e;this[_0x237b('0x70')]=_0x5a3d8e[_0x237b('0x70')]||![];this[_0x237b('0x71')]=!!_0x5a3d8e[_0x237b('0x71')]||![];this['dialPreviewRecallmeReminder']=!!_0x5a3d8e[_0x237b('0x72')]||![];this['dialQueueProject2']=_0x5a3d8e[_0x237b('0x73')]||undefined;this[_0x237b('0x74')]=_0x5a3d8e[_0x237b('0x74')]||![];this[_0x237b('0x75')]=_0x5a3d8e[_0x237b('0x75')]||![];this['monitor_format']=monitorFormat[_0x5a3d8e[_0x237b('0xa')]]?monitorFormat[_0x5a3d8e[_0x237b('0xa')]]:undefined;this[_0x237b('0x76')]=_0x5a3d8e['mandatoryDisposition']||![];this['mandatoryDispositionPause']=_0x5a3d8e['mandatoryDispositionPause']?_0x5a3d8e[_0x237b('0x77')]:undefined;this[_0x237b('0x78')]=![];}module['exports']=VoiceQueue; \ No newline at end of file +var _0x1407=['dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','outboundRejectCallsDay','pTalking','timeout','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','monitor_format','mandatoryDisposition','mandatoryDispositionPause','exports','wav','wav49','fewestcalls','leastrecent','random','ringall','roundrobin','rrmemory','rrordered','name','type','inbound','waiting','total','sumDuration','sumBillable','unmanaged','abandoned','available','busy','invalid','loggedIn','paused','ringInUse','talking','unavailable','acw','acwTimeout','autopause','message','statusMessage','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous'];(function(_0x3662b4,_0x503b4d){var _0x50928c=function(_0x15db69){while(--_0x15db69){_0x3662b4['push'](_0x3662b4['shift']());}};_0x50928c(++_0x503b4d);}(_0x1407,0xd1));var _0x7140=function(_0x21612a,_0x1fb95c){_0x21612a=_0x21612a-0x0;var _0x241f5d=_0x1407[_0x21612a];return _0x241f5d;};'use strict';var monitorFormat={'wav':_0x7140('0x0'),'wav49':_0x7140('0x1'),'gsm':'gsm'};var strategy={'fewestcalls':_0x7140('0x2'),'leastrecent':_0x7140('0x3'),'linear':'linear','random':_0x7140('0x4'),'ringall':_0x7140('0x5'),'rr':_0x7140('0x6'),'rrmemory':_0x7140('0x7'),'rrordered':_0x7140('0x8'),'wrandom':'wrandom'};function VoiceQueue(_0x1955b1){this['id']=_0x1955b1['id']||0x0;this[_0x7140('0x9')]=_0x1955b1[_0x7140('0x9')]||'';this['monitor_format']=_0x1955b1['monitor_format']||'';this[_0x7140('0xa')]=_0x1955b1[_0x7140('0xa')]||_0x7140('0xb');this[_0x7140('0xc')]=0x0;this[_0x7140('0xd')]=0x0;this['answered']=0x0;this[_0x7140('0xe')]=0x0;this['sumHoldTime']=0x0;this[_0x7140('0xf')]=0x0;this[_0x7140('0x10')]=0x0;this[_0x7140('0x11')]=0x0;this[_0x7140('0x12')]=0x0;this[_0x7140('0x13')]=0x0;this['inUse']=0x0;this[_0x7140('0x14')]=0x0;this[_0x7140('0x15')]=0x0;this['notInUse']=0x0;this['onHold']=0x0;this[_0x7140('0x16')]=0x0;this['ringing']=0x0;this[_0x7140('0x17')]=0x0;this[_0x7140('0x18')]=0x0;this[_0x7140('0x19')]=0x0;this['unknown']=0x0;this['acw']=_0x1955b1[_0x7140('0x1a')]||![];this[_0x7140('0x1b')]=_0x1955b1['acwTimeout']||0xa;this[_0x7140('0x1c')]=_0x1955b1['autopause']||'no';this['sendMessageOneNotActive']=!![];this[_0x7140('0x1d')]='';this[_0x7140('0x1e')]='';this['originated']=0x0;this[_0x7140('0x1f')]=0x0;this[_0x7140('0x20')]=_0x1955b1[_0x7140('0x20')]||null;this[_0x7140('0x21')]=_0x1955b1[_0x7140('0x21')]?_0x1955b1[_0x7140('0x21')]:null;this[_0x7140('0x22')]=_0x1955b1[_0x7140('0x22')];this[_0x7140('0x23')]=_0x1955b1['dialMethod']||_0x7140('0x24');this[_0x7140('0x25')]=_0x1955b1['dialLimitChannel']||0x0;this['dialLimitQueue']=_0x1955b1[_0x7140('0x26')]||0x0;this[_0x7140('0x27')]=_0x1955b1['dialPowerLevel']||0x1;this[_0x7140('0x28')]=_0x1955b1[_0x7140('0x28')]||'dropRate';this[_0x7140('0x29')]=_0x1955b1[_0x7140('0x29')]||0.03;this['dialPredictiveInterval']=_0x1955b1[_0x7140('0x2a')]||0x258;this[_0x7140('0x2b')]=_0x1955b1['dialOriginateCallerIdName']||_0x7140('0x2c');this[_0x7140('0x2d')]=_0x1955b1[_0x7140('0x2d')]||_0x7140('0x2c');this[_0x7140('0x2e')]=_0x1955b1[_0x7140('0x2e')]||0x1e;this[_0x7140('0x2f')]=_0x1955b1[_0x7140('0x2f')]||_0x7140('0x30');this[_0x7140('0x31')]=_0x1955b1[_0x7140('0x31')]||0x3;this[_0x7140('0x32')]=_0x1955b1['dialQueueProject']||undefined;this[_0x7140('0x33')]=_0x1955b1[_0x7140('0x33')]||0x3;this['dialCongestionRetryFrequency']=_0x1955b1['dialCongestionRetryFrequency']||0x96;this[_0x7140('0x34')]=_0x1955b1['dialBusyMaxRetry']||0x3;this[_0x7140('0x35')]=_0x1955b1[_0x7140('0x35')]||0x96;this[_0x7140('0x36')]=_0x1955b1[_0x7140('0x36')]||0x3;this[_0x7140('0x37')]=_0x1955b1[_0x7140('0x37')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x1955b1[_0x7140('0x38')]||0x3;this[_0x7140('0x39')]=_0x1955b1[_0x7140('0x39')]||0x96;this['dialDropMaxRetry']=_0x1955b1[_0x7140('0x3a')]||0x3;this[_0x7140('0x3b')]=_0x1955b1[_0x7140('0x3b')]||0x96;this[_0x7140('0x3c')]=_0x1955b1[_0x7140('0x3c')]||0x3;this['dialAbandonedRetryFrequency']=_0x1955b1[_0x7140('0x3d')]||0x96;this['dialMachineMaxRetry']=_0x1955b1['dialMachineMaxRetry']||0x3;this[_0x7140('0x3e')]=_0x1955b1[_0x7140('0x3e')]||0x96;this[_0x7140('0x3f')]=_0x1955b1[_0x7140('0x3f')]||0x3;this[_0x7140('0x40')]=_0x1955b1[_0x7140('0x40')]||0x96;this[_0x7140('0x41')]=_0x1955b1[_0x7140('0x41')]||0x3;this['dialGlobalMaxRetry']=_0x1955b1[_0x7140('0x42')]||0x4;this[_0x7140('0x43')]=_0x1955b1[_0x7140('0x43')]?_0x1955b1['Trunk']:undefined;this[_0x7140('0x44')]=_0x1955b1[_0x7140('0x44')]?_0x1955b1['TrunkBackup']:undefined;this[_0x7140('0x45')]=_0x1955b1[_0x7140('0x45')]||undefined;this[_0x7140('0x46')]=_0x1955b1['Interval']?_0x1955b1[_0x7140('0x46')]:undefined;this[_0x7140('0x47')]=_0x1955b1[_0x7140('0x47')]||_0x7140('0x48');this[_0x7140('0x49')]=_0x1955b1[_0x7140('0x49')]||undefined;this['dialCutDigit']=_0x1955b1['dialCutDigit']||undefined;this[_0x7140('0x4a')]=strategy[_0x1955b1[_0x7140('0x4a')]];this[_0x7140('0x4b')]=!![];this['dialAMDActive']=_0x1955b1[_0x7140('0x4c')]||![];this[_0x7140('0x4d')]=_0x1955b1[_0x7140('0x4d')];this[_0x7140('0x4e')]=_0x1955b1[_0x7140('0x4e')];this[_0x7140('0x4f')]=_0x1955b1[_0x7140('0x4f')];this['dialAMDTotalAnalysisTime']=_0x1955b1['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x1955b1[_0x7140('0x50')];this[_0x7140('0x51')]=_0x1955b1[_0x7140('0x51')];this[_0x7140('0x52')]=_0x1955b1[_0x7140('0x52')];this[_0x7140('0x53')]=_0x1955b1[_0x7140('0x53')];this['dialAMDMaximumWordLength']=_0x1955b1['dialAMDMaximumWordLength'];this[_0x7140('0x54')]=0x0;this[_0x7140('0x55')]=0x0;this[_0x7140('0x56')]=_0x1955b1[_0x7140('0x56')];this['outboundAnswerCallsDay']=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x7140('0x57')]=0x0;this[_0x7140('0x58')]=0x0;this['outboundCongestionCallsDay']=0x0;this['outboundNoSuchCallsDay']=0x0;this[_0x7140('0x59')]=0x0;this[_0x7140('0x5a')]=0x0;this[_0x7140('0x5b')]=0x0;this[_0x7140('0x5c')]=0x0;this[_0x7140('0x5d')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this[_0x7140('0x5e')]=undefined;this[_0x7140('0x5f')]=undefined;this[_0x7140('0x60')]=undefined;this[_0x7140('0x61')]=1.05;this[_0x7140('0x62')]=0x0;this[_0x7140('0x63')]=0x0;this[_0x7140('0x64')]=0x0;this[_0x7140('0x65')]=0x0;this[_0x7140('0x66')]=0x0;this[_0x7140('0x67')]=0x0;this[_0x7140('0x68')]=0x0;this[_0x7140('0x69')]=0x0;this[_0x7140('0x6a')]=_0x1955b1[_0x7140('0x6b')]||0x14;this[_0x7140('0x6c')]=_0x1955b1[_0x7140('0x6b')]||0xa;this[_0x7140('0x6d')]=0x0;this[_0x7140('0x6e')]=0x0;this[_0x7140('0x6f')]=0x1;this[_0x7140('0x70')]=0x0;this[_0x7140('0x71')]=0x0;this[_0x7140('0x72')]=0x0;this[_0x7140('0x73')]=0x0;this['dialRecallMeTimeout']=_0x1955b1[_0x7140('0x74')]||0x1e;this['dialRecallInQueue']=_0x1955b1[_0x7140('0x75')]||![];this[_0x7140('0x76')]=!!_0x1955b1[_0x7140('0x76')]||![];this[_0x7140('0x77')]=!!_0x1955b1[_0x7140('0x77')]||![];this['dialQueueProject2']=_0x1955b1[_0x7140('0x78')]||undefined;this['dialAgiAfterHangupClient']=_0x1955b1[_0x7140('0x79')]||![];this[_0x7140('0x7a')]=_0x1955b1[_0x7140('0x7a')]||![];this['monitor_format']=monitorFormat[_0x1955b1[_0x7140('0x7b')]]?monitorFormat[_0x1955b1[_0x7140('0x7b')]]:undefined;this['mandatoryDisposition']=_0x1955b1[_0x7140('0x7c')]||![];this[_0x7140('0x7d')]=_0x1955b1['mandatoryDispositionPause']?_0x1955b1[_0x7140('0x7d')]:undefined;this['queueSummaryCountersUpdated']=![];}module[_0x7140('0x7e')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueueSummary.js b/server/services/ami/model/voiceQueueSummary.js index bf89a1e..82eff62 100644 --- a/server/services/ami/model/voiceQueueSummary.js +++ b/server/services/ami/model/voiceQueueSummary.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe105=['notInUse','paused','ringing','ringInUse','sumBillable','sumHoldTime','type','unavailable','unknown','unmanaged','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','active','callerid','prototype','createReport','loggedin','callers','length','online','incall','includes','status','booked','keys','queue','exten','xcally-motion-preview','compareToOutboundQueue','updateReportFromOutboundQueue','preview','exports','available','talking','waiting','answered','loggedIn','loggedInDb','outboundAbandonedCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','pTalking','sumDuration','total','name','strategy','abandoned','busy','inUse','invalid','onHold'];(function(_0x4fe4ed,_0x5c9ab3){var _0x3e79d4=function(_0x2224e3){while(--_0x2224e3){_0x4fe4ed['push'](_0x4fe4ed['shift']());}};_0x3e79d4(++_0x5c9ab3);}(_0xe105,0xef));var _0x5e10=function(_0x4b48d4,_0x5c5a05){_0x4b48d4=_0x4b48d4-0x0;var _0x517b1b=_0xe105[_0x4b48d4];return _0x517b1b;};'use strict';var INBOUND_COUNTERS=[_0x5e10('0x0'),'loggedIn','loggedInDb','paused','ringing',_0x5e10('0x1'),_0x5e10('0x2')];var OUTBOUND_COUNTERS=[_0x5e10('0x0'),_0x5e10('0x3'),'inUse',_0x5e10('0x4'),_0x5e10('0x5'),'originated',_0x5e10('0x6'),'outboundAnswerCallsDay','outboundBlacklistCallsDay',_0x5e10('0x7'),_0x5e10('0x8'),'outboundNoAnswerCallsDay','outboundNoSuchCallsDay',_0x5e10('0x9'),_0x5e10('0xa'),_0x5e10('0xb'),'paused',_0x5e10('0xc'),_0x5e10('0x1'),'sumBillable',_0x5e10('0xd'),_0x5e10('0xe'),_0x5e10('0x2')];function VoiceQueueSummary(_0x2323a7){this['id']=_0x2323a7['id'];this['name']=_0x2323a7[_0x5e10('0xf')];this['strategy']=_0x2323a7[_0x5e10('0x10')];this[_0x5e10('0x11')]=_0x2323a7[_0x5e10('0x11')]||0x0;this[_0x5e10('0x3')]=_0x2323a7[_0x5e10('0x3')]||0x0;this[_0x5e10('0x0')]=_0x2323a7[_0x5e10('0x0')]||0x0;this['busy']=_0x2323a7[_0x5e10('0x12')]||0x0;this[_0x5e10('0x13')]=_0x2323a7[_0x5e10('0x13')]||0x0;this[_0x5e10('0x14')]=_0x2323a7[_0x5e10('0x14')]||0x0;this['loggedIn']=_0x2323a7[_0x5e10('0x4')]||0x0;this[_0x5e10('0x5')]=_0x2323a7[_0x5e10('0x5')]||0x0;this[_0x5e10('0x15')]=_0x2323a7[_0x5e10('0x15')]||0x0;this[_0x5e10('0x16')]=_0x2323a7[_0x5e10('0x16')]||0x0;this['paused']=_0x2323a7[_0x5e10('0x17')]||0x0;this['ringing']=_0x2323a7[_0x5e10('0x18')]||0x0;this[_0x5e10('0x19')]=_0x2323a7[_0x5e10('0x19')];this['sumBillable']=_0x2323a7[_0x5e10('0x1a')];this[_0x5e10('0xd')]=_0x2323a7[_0x5e10('0xd')];this[_0x5e10('0x1b')]=_0x2323a7[_0x5e10('0x1b')]||0x0;this[_0x5e10('0x1')]=_0x2323a7[_0x5e10('0x1')]||0x0;this[_0x5e10('0xe')]=_0x2323a7[_0x5e10('0xe')]||0x0;this[_0x5e10('0x1c')]=_0x2323a7['type'];this['unavailable']=_0x2323a7[_0x5e10('0x1d')]||0x0;this['unknown']=_0x2323a7[_0x5e10('0x1e')]||0x0;this[_0x5e10('0x1f')]=_0x2323a7[_0x5e10('0x1f')]||0x0;this[_0x5e10('0x2')]=_0x2323a7[_0x5e10('0x2')]||0x0;if(_0x2323a7[_0x5e10('0x1c')]==='outbound'){this['pTalking']=_0x2323a7[_0x5e10('0xc')]||0x0;this['dialActive']=_0x2323a7[_0x5e10('0x20')];this[_0x5e10('0x21')]=_0x2323a7[_0x5e10('0x21')];this[_0x5e10('0x22')]=_0x2323a7[_0x5e10('0x22')];this['dialOriginateCallerIdNumber']=_0x2323a7['dialOriginateCallerIdNumber'];this[_0x5e10('0x23')]=_0x2323a7[_0x5e10('0x23')];this[_0x5e10('0x24')]=_0x2323a7[_0x5e10('0x24')];this[_0x5e10('0x25')]=_0x2323a7[_0x5e10('0x25')];this[_0x5e10('0x26')]=_0x2323a7[_0x5e10('0x26')];this[_0x5e10('0x27')]=_0x2323a7[_0x5e10('0x27')];this[_0x5e10('0x28')]=_0x2323a7[_0x5e10('0x28')];this[_0x5e10('0x7')]=_0x2323a7[_0x5e10('0x7')];this[_0x5e10('0x8')]=_0x2323a7[_0x5e10('0x8')];this['outboundDropCallsDayACS']=_0x2323a7[_0x5e10('0x29')];this[_0x5e10('0x2a')]=_0x2323a7[_0x5e10('0x2a')];this[_0x5e10('0x2b')]=_0x2323a7['outboundDropCallsDayTimeout'];this[_0x5e10('0x2c')]=_0x2323a7[_0x5e10('0x2c')];this['outboundNoSuchCallsDay']=_0x2323a7[_0x5e10('0x2d')];this['outboundOriginateFailureCallsDay']=_0x2323a7['outboundOriginateFailureCallsDay'];this['outboundReCallsDay']=_0x2323a7[_0x5e10('0x9')];this[_0x5e10('0xa')]=_0x2323a7[_0x5e10('0xa')];this[_0x5e10('0xb')]=_0x2323a7[_0x5e10('0xb')];this[_0x5e10('0x2e')]=_0x2323a7[_0x5e10('0x2e')];this['predictiveIntervalAvgHoldtime']=_0x2323a7[_0x5e10('0x2f')];this[_0x5e10('0x30')]=_0x2323a7['predictiveIntervalAvgTalktime'];this[_0x5e10('0x31')]=_0x2323a7['predictiveIntervalDroppedCallsCallersExit'];this[_0x5e10('0x32')]=_0x2323a7[_0x5e10('0x32')];this[_0x5e10('0x33')]=_0x2323a7[_0x5e10('0x33')];this[_0x5e10('0x34')]=_0x2323a7[_0x5e10('0x34')];this['predictiveIntervalHitRate']=_0x2323a7['predictiveIntervalHitRate'];this['predictiveIntervalMultiplicativeFactor']=_0x2323a7[_0x5e10('0x35')];this['predictiveIntervalPauses']=_0x2323a7[_0x5e10('0x36')];this[_0x5e10('0x37')]=_0x2323a7['predictiveIntervalAvailable'];this[_0x5e10('0x38')]=_0x2323a7[_0x5e10('0x38')];this['originated']=_0x2323a7[_0x5e10('0x39')];this[_0x5e10('0x3a')]=_0x2323a7['erlangCalls'];this[_0x5e10('0x3b')]=_0x2323a7['erlangCallToSecond'];this[_0x5e10('0x3c')]=_0x2323a7[_0x5e10('0x3c')];this[_0x5e10('0x3d')]=_0x2323a7[_0x5e10('0x3d')];this[_0x5e10('0x3e')]=_0x2323a7[_0x5e10('0x3e')];this[_0x5e10('0x3f')]=_0x2323a7['startProgressive'];this[_0x5e10('0x40')]=_0x2323a7[_0x5e10('0x40')];this[_0x5e10('0x41')]=_0x2323a7[_0x5e10('0x41')];}if(_0x2323a7[_0x5e10('0x42')]){this[_0x5e10('0x42')]={'id':_0x2323a7['Trunk']['id'],'name':_0x2323a7[_0x5e10('0x42')][_0x5e10('0xf')],'active':_0x2323a7['Trunk'][_0x5e10('0x43')],'callerid':_0x2323a7[_0x5e10('0x42')][_0x5e10('0x44')]};}}VoiceQueueSummary[_0x5e10('0x45')][_0x5e10('0x46')]=function(_0x5c1813,_0x330fc4,_0x6d22da,_0xc1e52){this['loggedInDb']=0x0;this[_0x5e10('0x1')]=0x0;this[_0x5e10('0x17')]=0x0;this[_0x5e10('0x1e')]=0x0;this[_0x5e10('0x16')]=0x0;this[_0x5e10('0x13')]=0x0;this[_0x5e10('0x12')]=0x0;this[_0x5e10('0x14')]=0x0;this['unavailable']=0x0;this[_0x5e10('0x18')]=0x0;this['ringInUse']=0x0;this['onHold']=0x0;if(_0x6d22da){if(_0x6d22da['available']){this[_0x5e10('0x0')]=Number(_0x6d22da[_0x5e10('0x0')]);}if(_0x6d22da['loggedin']){this[_0x5e10('0x4')]=Number(_0x6d22da[_0x5e10('0x47')]);}if(_0x6d22da[_0x5e10('0x48')]){this[_0x5e10('0x2')]=Number(_0x6d22da[_0x5e10('0x48')]);}}for(var _0x1c363b=0x0;_0x1c363b<_0x5c1813[_0x5e10('0x49')];_0x1c363b++){var _0x12d291=_0x330fc4['SIP/'+_0x5c1813[_0x1c363b]['name']];if(_0x12d291&&_0x12d291[_0x5e10('0x4a')]){this[_0x5e10('0x5')]+=0x1;}if(_0x5c1813[_0x1c363b][_0x5e10('0x4b')]==='1'){this['talking']+=0x1;}if(_0x5c1813[_0x1c363b][_0x5e10('0x17')]==='1'&&!['2','7','8'][_0x5e10('0x4c')](_0x5c1813[_0x1c363b][_0x5e10('0x4d')])){this[_0x5e10('0x17')]+=0x1;}switch(_0x5c1813[_0x1c363b][_0x5e10('0x4d')]){case'0':this['unknown']+=0x1;break;case'1':this[_0x5e10('0x16')]+=0x1;break;case'2':this[_0x5e10('0x13')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this['invalid']+=0x1;break;case'5':this[_0x5e10('0x1d')]+=0x1;break;case'6':this[_0x5e10('0x18')]+=0x1;break;case'7':this[_0x5e10('0x19')]+=0x1;break;case'8':this[_0x5e10('0x15')]+=0x1;break;}}if(this[_0x5e10('0x21')]===_0x5e10('0x4e')){var _0x5562bc=Object[_0x5e10('0x4f')](_0xc1e52);for(var _0x4ebdfb=0x0;_0x4ebdfb<_0x5562bc[_0x5e10('0x49')];_0x4ebdfb++){var _0x5290d1=_0x5562bc[_0x4ebdfb];var _0x3bc07a=_0xc1e52[_0x5290d1];if(_0x3bc07a[_0x5e10('0x50')]===this[_0x5e10('0xf')]&&_0x3bc07a[_0x5e10('0x1c')]==='dialer'&&_0x3bc07a[_0x5e10('0x51')]===_0x5e10('0x52')){this[_0x5e10('0x1')]+=0x1;}}if(this[_0x5e10('0x1')]>this[_0x5e10('0x13')]){this[_0x5e10('0x1')]=this[_0x5e10('0x13')];}this[_0x5e10('0xc')]=0x0;}return this;};VoiceQueueSummary[_0x5e10('0x45')]['compareToInboundQueue']=function(_0x59544b){var _0x1f3e91=![];if(_0x59544b){_0x1f3e91=INBOUND_COUNTERS['some'](function(_0x259b54){return this[_0x259b54]!==_0x59544b[_0x259b54];},this);}return _0x1f3e91;};VoiceQueueSummary[_0x5e10('0x45')][_0x5e10('0x53')]=function(_0x2fa8f0){var _0x330f29=![];var _0x14a37b=![];var _0x20d45c=![];if(_0x2fa8f0){_0x330f29=this[_0x5e10('0x21')]!==_0x2fa8f0[_0x5e10('0x21')]||this[_0x5e10('0x20')]!==_0x2fa8f0['dialActive']||this['message']!==_0x2fa8f0[_0x5e10('0x40')]||this[_0x5e10('0x41')]!==_0x2fa8f0[_0x5e10('0x41')];_0x14a37b=OUTBOUND_COUNTERS['some'](function(_0x5ae2b6){return this[_0x5ae2b6]!==_0x2fa8f0[_0x5ae2b6];},this);if(this[_0x5e10('0x42')]&&_0x2fa8f0[_0x5e10('0x42')]){_0x20d45c=this[_0x5e10('0x42')][_0x5e10('0xf')]!==_0x2fa8f0['Trunk'][_0x5e10('0xf')]||this[_0x5e10('0x42')][_0x5e10('0x43')]!==_0x2fa8f0[_0x5e10('0x42')][_0x5e10('0x43')];}}return _0x330f29||_0x14a37b||_0x20d45c;};VoiceQueueSummary[_0x5e10('0x45')][_0x5e10('0x54')]=function(_0x44a6a2){this['answered']=_0x44a6a2[_0x5e10('0x3')];this['message']=_0x44a6a2[_0x5e10('0x40')];this[_0x5e10('0x41')]=_0x44a6a2['statusMessage'];this[_0x5e10('0x39')]=_0x44a6a2[_0x5e10('0x39')];this[_0x5e10('0x6')]=_0x44a6a2[_0x5e10('0x6')];this[_0x5e10('0x27')]=_0x44a6a2[_0x5e10('0x27')];this['outboundBlacklistCallsDay']=_0x44a6a2[_0x5e10('0x28')];this[_0x5e10('0x7')]=_0x44a6a2[_0x5e10('0x7')];this[_0x5e10('0x8')]=_0x44a6a2[_0x5e10('0x8')];this[_0x5e10('0x2c')]=_0x44a6a2[_0x5e10('0x2c')];this[_0x5e10('0x2d')]=_0x44a6a2[_0x5e10('0x2d')];this['outboundReCallsDay']=_0x44a6a2[_0x5e10('0x9')];this[_0x5e10('0xa')]=_0x44a6a2[_0x5e10('0xa')];this[_0x5e10('0xb')]=_0x44a6a2[_0x5e10('0xb')];this['sumBillable']=_0x44a6a2[_0x5e10('0x1a')];this[_0x5e10('0xd')]=_0x44a6a2[_0x5e10('0xd')];this[_0x5e10('0xe')]=_0x44a6a2[_0x5e10('0xe')];if(this[_0x5e10('0x21')]===_0x5e10('0x55')){this['pTalking']=_0x44a6a2[_0x5e10('0xc')];}};module[_0x5e10('0x56')]=VoiceQueueSummary; \ No newline at end of file +var _0x6c7b=['xcally-motion-preview','some','active','updateReportFromOutboundQueue','preview','exports','available','ringing','waiting','answered','loggedIn','loggedInDb','originated','outboundAbandonedCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','paused','sumBillable','sumDuration','total','name','strategy','abandoned','busy','invalid','onHold','notInUse','ringInUse','sumHoldTime','talking','type','unavailable','unknown','unmanaged','outbound','pTalking','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','message','statusMessage','Trunk','callerid','prototype','createReport','inUse','loggedin','callers','online','incall','includes','status','keys','length','queue','exten'];(function(_0x295059,_0x5f05f6){var _0x39d62c=function(_0x27d8b3){while(--_0x27d8b3){_0x295059['push'](_0x295059['shift']());}};_0x39d62c(++_0x5f05f6);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x6007fc,_0x2bdec9){_0x6007fc=_0x6007fc-0x0;var _0x4762b8=_0x6c7b[_0x6007fc];return _0x4762b8;};'use strict';var INBOUND_COUNTERS=[_0xb6c7('0x0'),'loggedIn','loggedInDb','paused',_0xb6c7('0x1'),'talking',_0xb6c7('0x2')];var OUTBOUND_COUNTERS=[_0xb6c7('0x0'),_0xb6c7('0x3'),'inUse',_0xb6c7('0x4'),_0xb6c7('0x5'),_0xb6c7('0x6'),_0xb6c7('0x7'),_0xb6c7('0x8'),'outboundBlacklistCallsDay',_0xb6c7('0x9'),_0xb6c7('0xa'),_0xb6c7('0xb'),_0xb6c7('0xc'),_0xb6c7('0xd'),_0xb6c7('0xe'),_0xb6c7('0xf'),_0xb6c7('0x10'),'pTalking','talking',_0xb6c7('0x11'),_0xb6c7('0x12'),_0xb6c7('0x13'),_0xb6c7('0x2')];function VoiceQueueSummary(_0x12e92f){this['id']=_0x12e92f['id'];this[_0xb6c7('0x14')]=_0x12e92f[_0xb6c7('0x14')];this['strategy']=_0x12e92f[_0xb6c7('0x15')];this[_0xb6c7('0x16')]=_0x12e92f[_0xb6c7('0x16')]||0x0;this[_0xb6c7('0x3')]=_0x12e92f[_0xb6c7('0x3')]||0x0;this[_0xb6c7('0x0')]=_0x12e92f[_0xb6c7('0x0')]||0x0;this['busy']=_0x12e92f[_0xb6c7('0x17')]||0x0;this['inUse']=_0x12e92f['inUse']||0x0;this['invalid']=_0x12e92f[_0xb6c7('0x18')]||0x0;this['loggedIn']=_0x12e92f[_0xb6c7('0x4')]||0x0;this[_0xb6c7('0x5')]=_0x12e92f[_0xb6c7('0x5')]||0x0;this[_0xb6c7('0x19')]=_0x12e92f[_0xb6c7('0x19')]||0x0;this[_0xb6c7('0x1a')]=_0x12e92f[_0xb6c7('0x1a')]||0x0;this[_0xb6c7('0x10')]=_0x12e92f[_0xb6c7('0x10')]||0x0;this[_0xb6c7('0x1')]=_0x12e92f[_0xb6c7('0x1')]||0x0;this[_0xb6c7('0x1b')]=_0x12e92f[_0xb6c7('0x1b')];this['sumBillable']=_0x12e92f[_0xb6c7('0x11')];this[_0xb6c7('0x12')]=_0x12e92f['sumDuration'];this[_0xb6c7('0x1c')]=_0x12e92f['sumHoldTime']||0x0;this[_0xb6c7('0x1d')]=_0x12e92f['talking']||0x0;this[_0xb6c7('0x13')]=_0x12e92f['total']||0x0;this[_0xb6c7('0x1e')]=_0x12e92f[_0xb6c7('0x1e')];this['unavailable']=_0x12e92f[_0xb6c7('0x1f')]||0x0;this[_0xb6c7('0x20')]=_0x12e92f[_0xb6c7('0x20')]||0x0;this[_0xb6c7('0x21')]=_0x12e92f[_0xb6c7('0x21')]||0x0;this[_0xb6c7('0x2')]=_0x12e92f['waiting']||0x0;if(_0x12e92f[_0xb6c7('0x1e')]===_0xb6c7('0x22')){this[_0xb6c7('0x23')]=_0x12e92f[_0xb6c7('0x23')]||0x0;this['dialActive']=_0x12e92f[_0xb6c7('0x24')];this[_0xb6c7('0x25')]=_0x12e92f['dialMethod'];this[_0xb6c7('0x26')]=_0x12e92f[_0xb6c7('0x26')];this[_0xb6c7('0x27')]=_0x12e92f[_0xb6c7('0x27')];this['dialOriginateTimeout']=_0x12e92f[_0xb6c7('0x28')];this['dialPrefix']=_0x12e92f[_0xb6c7('0x29')];this[_0xb6c7('0x2a')]=_0x12e92f[_0xb6c7('0x2a')];this['outboundAnswerAgiCallsDay']=_0x12e92f['outboundAnswerAgiCallsDay'];this['outboundAnswerCallsDay']=_0x12e92f[_0xb6c7('0x8')];this[_0xb6c7('0x2b')]=_0x12e92f[_0xb6c7('0x2b')];this[_0xb6c7('0x9')]=_0x12e92f[_0xb6c7('0x9')];this[_0xb6c7('0xa')]=_0x12e92f[_0xb6c7('0xa')];this[_0xb6c7('0x2c')]=_0x12e92f[_0xb6c7('0x2c')];this[_0xb6c7('0x2d')]=_0x12e92f['outboundDropCallsDayCallersExit'];this[_0xb6c7('0x2e')]=_0x12e92f['outboundDropCallsDayTimeout'];this[_0xb6c7('0xb')]=_0x12e92f[_0xb6c7('0xb')];this[_0xb6c7('0xc')]=_0x12e92f[_0xb6c7('0xc')];this[_0xb6c7('0x2f')]=_0x12e92f['outboundOriginateFailureCallsDay'];this['outboundReCallsDay']=_0x12e92f['outboundReCallsDay'];this[_0xb6c7('0xe')]=_0x12e92f[_0xb6c7('0xe')];this['outboundUnknownCallsDay']=_0x12e92f[_0xb6c7('0xf')];this[_0xb6c7('0x30')]=_0x12e92f['predictiveIntervalAnsweredCalls'];this[_0xb6c7('0x31')]=_0x12e92f[_0xb6c7('0x31')];this[_0xb6c7('0x32')]=_0x12e92f[_0xb6c7('0x32')];this[_0xb6c7('0x33')]=_0x12e92f[_0xb6c7('0x33')];this['predictiveIntervalDroppedCallsTimeout']=_0x12e92f[_0xb6c7('0x34')];this[_0xb6c7('0x35')]=_0x12e92f[_0xb6c7('0x35')];this[_0xb6c7('0x36')]=_0x12e92f[_0xb6c7('0x36')];this[_0xb6c7('0x37')]=_0x12e92f[_0xb6c7('0x37')];this['predictiveIntervalMultiplicativeFactor']=_0x12e92f['predictiveIntervalMultiplicativeFactor'];this[_0xb6c7('0x38')]=_0x12e92f[_0xb6c7('0x38')];this[_0xb6c7('0x39')]=_0x12e92f[_0xb6c7('0x39')];this[_0xb6c7('0x3a')]=_0x12e92f[_0xb6c7('0x3a')];this[_0xb6c7('0x6')]=_0x12e92f[_0xb6c7('0x6')];this[_0xb6c7('0x3b')]=_0x12e92f[_0xb6c7('0x3b')];this['erlangCallToSecond']=_0x12e92f[_0xb6c7('0x3c')];this['erlangAbandonmentRate']=_0x12e92f['erlangAbandonmentRate'];this[_0xb6c7('0x3d')]=_0x12e92f['erlangBusyFactor'];this[_0xb6c7('0x3e')]=_0x12e92f[_0xb6c7('0x3e')];this['startProgressive']=_0x12e92f[_0xb6c7('0x3f')];this[_0xb6c7('0x40')]=_0x12e92f[_0xb6c7('0x40')];this[_0xb6c7('0x41')]=_0x12e92f[_0xb6c7('0x41')];}if(_0x12e92f['Trunk']){this['Trunk']={'id':_0x12e92f[_0xb6c7('0x42')]['id'],'name':_0x12e92f[_0xb6c7('0x42')][_0xb6c7('0x14')],'active':_0x12e92f[_0xb6c7('0x42')]['active'],'callerid':_0x12e92f['Trunk'][_0xb6c7('0x43')]};}}VoiceQueueSummary[_0xb6c7('0x44')][_0xb6c7('0x45')]=function(_0x214d04,_0x793060,_0x4eb2c7,_0x4e0888){this['loggedInDb']=0x0;this[_0xb6c7('0x1d')]=0x0;this[_0xb6c7('0x10')]=0x0;this[_0xb6c7('0x20')]=0x0;this['notInUse']=0x0;this[_0xb6c7('0x46')]=0x0;this[_0xb6c7('0x17')]=0x0;this['invalid']=0x0;this[_0xb6c7('0x1f')]=0x0;this[_0xb6c7('0x1')]=0x0;this[_0xb6c7('0x1b')]=0x0;this[_0xb6c7('0x19')]=0x0;if(_0x4eb2c7){if(_0x4eb2c7[_0xb6c7('0x0')]){this['available']=Number(_0x4eb2c7[_0xb6c7('0x0')]);}if(_0x4eb2c7[_0xb6c7('0x47')]){this[_0xb6c7('0x4')]=Number(_0x4eb2c7['loggedin']);}if(_0x4eb2c7['callers']){this[_0xb6c7('0x2')]=Number(_0x4eb2c7[_0xb6c7('0x48')]);}}for(var _0x2f177c=0x0;_0x2f177c<_0x214d04['length'];_0x2f177c++){var _0x4f243a=_0x793060['SIP/'+_0x214d04[_0x2f177c][_0xb6c7('0x14')]];if(_0x4f243a&&_0x4f243a[_0xb6c7('0x49')]){this[_0xb6c7('0x5')]+=0x1;}if(_0x214d04[_0x2f177c][_0xb6c7('0x4a')]==='1'){this[_0xb6c7('0x1d')]+=0x1;}if(_0x214d04[_0x2f177c][_0xb6c7('0x10')]==='1'&&!['2','7','8'][_0xb6c7('0x4b')](_0x214d04[_0x2f177c]['status'])){this[_0xb6c7('0x10')]+=0x1;}switch(_0x214d04[_0x2f177c][_0xb6c7('0x4c')]){case'0':this[_0xb6c7('0x20')]+=0x1;break;case'1':this[_0xb6c7('0x1a')]+=0x1;break;case'2':this[_0xb6c7('0x46')]+=0x1;break;case'3':this['busy']+=0x1;break;case'4':this[_0xb6c7('0x18')]+=0x1;break;case'5':this[_0xb6c7('0x1f')]+=0x1;break;case'6':this[_0xb6c7('0x1')]+=0x1;break;case'7':this[_0xb6c7('0x1b')]+=0x1;break;case'8':this[_0xb6c7('0x19')]+=0x1;break;}}if(this[_0xb6c7('0x25')]==='booked'){var _0x16b0c2=Object[_0xb6c7('0x4d')](_0x4e0888);for(var _0x2116cb=0x0;_0x2116cb<_0x16b0c2[_0xb6c7('0x4e')];_0x2116cb++){var _0x3153c8=_0x16b0c2[_0x2116cb];var _0x908d7a=_0x4e0888[_0x3153c8];if(_0x908d7a[_0xb6c7('0x4f')]===this['name']&&_0x908d7a['type']==='dialer'&&_0x908d7a[_0xb6c7('0x50')]===_0xb6c7('0x51')){this[_0xb6c7('0x1d')]+=0x1;}}if(this[_0xb6c7('0x1d')]>this[_0xb6c7('0x46')]){this[_0xb6c7('0x1d')]=this['inUse'];}this['pTalking']=0x0;}return this;};VoiceQueueSummary[_0xb6c7('0x44')]['compareToInboundQueue']=function(_0xf6b6a9){var _0x8c5b9c=![];if(_0xf6b6a9){_0x8c5b9c=INBOUND_COUNTERS[_0xb6c7('0x52')](function(_0x210d50){return this[_0x210d50]!==_0xf6b6a9[_0x210d50];},this);}return _0x8c5b9c;};VoiceQueueSummary[_0xb6c7('0x44')]['compareToOutboundQueue']=function(_0x222c72){var _0x5700dc=![];var _0x3956f2=![];var _0xdfcaa9=![];if(_0x222c72){_0x5700dc=this[_0xb6c7('0x25')]!==_0x222c72[_0xb6c7('0x25')]||this[_0xb6c7('0x24')]!==_0x222c72['dialActive']||this[_0xb6c7('0x40')]!==_0x222c72[_0xb6c7('0x40')]||this[_0xb6c7('0x41')]!==_0x222c72[_0xb6c7('0x41')];_0x3956f2=OUTBOUND_COUNTERS[_0xb6c7('0x52')](function(_0x42a4a8){return this[_0x42a4a8]!==_0x222c72[_0x42a4a8];},this);if(this[_0xb6c7('0x42')]&&_0x222c72[_0xb6c7('0x42')]){_0xdfcaa9=this['Trunk'][_0xb6c7('0x14')]!==_0x222c72[_0xb6c7('0x42')][_0xb6c7('0x14')]||this[_0xb6c7('0x42')][_0xb6c7('0x53')]!==_0x222c72[_0xb6c7('0x42')]['active'];}}return _0x5700dc||_0x3956f2||_0xdfcaa9;};VoiceQueueSummary[_0xb6c7('0x44')][_0xb6c7('0x54')]=function(_0x189a63){this[_0xb6c7('0x3')]=_0x189a63['answered'];this[_0xb6c7('0x40')]=_0x189a63[_0xb6c7('0x40')];this[_0xb6c7('0x41')]=_0x189a63[_0xb6c7('0x41')];this[_0xb6c7('0x6')]=_0x189a63[_0xb6c7('0x6')];this[_0xb6c7('0x7')]=_0x189a63['outboundAbandonedCallsDay'];this[_0xb6c7('0x8')]=_0x189a63[_0xb6c7('0x8')];this[_0xb6c7('0x2b')]=_0x189a63['outboundBlacklistCallsDay'];this[_0xb6c7('0x9')]=_0x189a63[_0xb6c7('0x9')];this[_0xb6c7('0xa')]=_0x189a63[_0xb6c7('0xa')];this[_0xb6c7('0xb')]=_0x189a63['outboundNoAnswerCallsDay'];this[_0xb6c7('0xc')]=_0x189a63[_0xb6c7('0xc')];this[_0xb6c7('0xd')]=_0x189a63[_0xb6c7('0xd')];this[_0xb6c7('0xe')]=_0x189a63[_0xb6c7('0xe')];this['outboundUnknownCallsDay']=_0x189a63[_0xb6c7('0xf')];this[_0xb6c7('0x11')]=_0x189a63['sumBillable'];this[_0xb6c7('0x12')]=_0x189a63[_0xb6c7('0x12')];this['total']=_0x189a63[_0xb6c7('0x13')];if(this[_0xb6c7('0x25')]===_0xb6c7('0x55')){this[_0xb6c7('0x23')]=_0x189a63[_0xb6c7('0x23')];}};module[_0xb6c7('0x56')]=VoiceQueueSummary; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index d140cd2..696981d 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 _0x3cb7=['remoteUri','serverUrl','Configurations','exports','name','username','accessKey'];(function(_0x31a9d1,_0x283ae9){var _0x127d8e=function(_0x5b7079){while(--_0x5b7079){_0x31a9d1['push'](_0x31a9d1['shift']());}};_0x127d8e(++_0x283ae9);}(_0x3cb7,0xcf));var _0x73cb=function(_0x276468,_0x29685a){_0x276468=_0x276468-0x0;var _0x36dc3a=_0x3cb7[_0x276468];return _0x36dc3a;};'use strict';function VtigerAccount(_0x56ec4a){this['id']=_0x56ec4a['id']||0x0;this['name']=_0x56ec4a[_0x73cb('0x0')]||'';this['username']=_0x56ec4a[_0x73cb('0x1')]||'';this[_0x73cb('0x2')]=_0x56ec4a[_0x73cb('0x2')]||'';this[_0x73cb('0x3')]=_0x56ec4a[_0x73cb('0x3')]||'';this[_0x73cb('0x4')]=_0x56ec4a[_0x73cb('0x4')]||'';this[_0x73cb('0x5')]=_0x56ec4a['Configurations']||{};}module[_0x73cb('0x6')]=VtigerAccount; \ No newline at end of file +var _0xe676=['username','accessKey','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x48cdd7,_0x35736d){var _0x368692=function(_0x2e0f3e){while(--_0x2e0f3e){_0x48cdd7['push'](_0x48cdd7['shift']());}};_0x368692(++_0x35736d);}(_0xe676,0x14f));var _0x6e67=function(_0x566bdf,_0x1f4861){_0x566bdf=_0x566bdf-0x0;var _0x331215=_0xe676[_0x566bdf];return _0x331215;};'use strict';function VtigerAccount(_0x1102c1){this['id']=_0x1102c1['id']||0x0;this['name']=_0x1102c1[_0x6e67('0x0')]||'';this[_0x6e67('0x1')]=_0x1102c1[_0x6e67('0x1')]||'';this['accessKey']=_0x1102c1[_0x6e67('0x2')]||'';this[_0x6e67('0x3')]=_0x1102c1[_0x6e67('0x3')]||'';this[_0x6e67('0x4')]=_0x1102c1[_0x6e67('0x4')]||'';this['Configurations']=_0x1102c1[_0x6e67('0x5')]||{};}module[_0x6e67('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 3b5b374..e6cc47e 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 _0xa160=['exports','name','username','password','token','remoteUri','authType','integrationTab','serverUrl','Configurations'];(function(_0x43bf40,_0x54ebb0){var _0x38a066=function(_0x32bf15){while(--_0x32bf15){_0x43bf40['push'](_0x43bf40['shift']());}};_0x38a066(++_0x54ebb0);}(_0xa160,0x1a5));var _0x0a16=function(_0x2677f7,_0x629d71){_0x2677f7=_0x2677f7-0x0;var _0x219c85=_0xa160[_0x2677f7];return _0x219c85;};'use strict';function ZendeskAccount(_0x5c7f94){this['id']=_0x5c7f94['id']||0x0;this[_0x0a16('0x0')]=_0x5c7f94[_0x0a16('0x0')]||'';this[_0x0a16('0x1')]=_0x5c7f94['username']||'';this[_0x0a16('0x2')]=_0x5c7f94[_0x0a16('0x2')]||'';this[_0x0a16('0x3')]=_0x5c7f94[_0x0a16('0x3')]||'';this[_0x0a16('0x4')]=_0x5c7f94['remoteUri']||'';this[_0x0a16('0x5')]=_0x5c7f94[_0x0a16('0x5')]||'';this['type']=_0x5c7f94['type']||_0x0a16('0x6');this[_0x0a16('0x7')]=_0x5c7f94['serverUrl']||'';this['Configurations']=_0x5c7f94[_0x0a16('0x8')]||{};}module[_0x0a16('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xb444=['type','integrationTab','serverUrl','Configurations','name','username','password','authType'];(function(_0x30066f,_0x5891c9){var _0x1ad673=function(_0x296b6c){while(--_0x296b6c){_0x30066f['push'](_0x30066f['shift']());}};_0x1ad673(++_0x5891c9);}(_0xb444,0x16c));var _0x4b44=function(_0x37f5db,_0x6a01b8){_0x37f5db=_0x37f5db-0x0;var _0xd4c93b=_0xb444[_0x37f5db];return _0xd4c93b;};'use strict';function ZendeskAccount(_0x3044a7){this['id']=_0x3044a7['id']||0x0;this[_0x4b44('0x0')]=_0x3044a7['name']||'';this[_0x4b44('0x1')]=_0x3044a7['username']||'';this[_0x4b44('0x2')]=_0x3044a7['password']||'';this['token']=_0x3044a7['token']||'';this['remoteUri']=_0x3044a7['remoteUri']||'';this[_0x4b44('0x3')]=_0x3044a7[_0x4b44('0x3')]||'';this[_0x4b44('0x4')]=_0x3044a7[_0x4b44('0x4')]||_0x4b44('0x5');this[_0x4b44('0x6')]=_0x3044a7['serverUrl']||'';this[_0x4b44('0x7')]=_0x3044a7[_0x4b44('0x7')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 993b411..aa623f3 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 _0xb184=['serverUrl','refreshToken','Configurations','exports','name','description','host','zone','clientSecret'];(function(_0x574b0e,_0x4c7f9b){var _0x32db82=function(_0x1e6ac0){while(--_0x1e6ac0){_0x574b0e['push'](_0x574b0e['shift']());}};_0x32db82(++_0x4c7f9b);}(_0xb184,0x124));var _0x4b18=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb184[_0x3dd15e];return _0x231fd0;};'use strict';function ZohoAccount(_0x3dfda1){this['id']=_0x3dfda1['id']||0x0;this['name']=_0x3dfda1[_0x4b18('0x0')]||'';this[_0x4b18('0x1')]=_0x3dfda1[_0x4b18('0x1')]||'';this[_0x4b18('0x2')]=_0x3dfda1[_0x4b18('0x2')]||'';this['zone']=_0x3dfda1[_0x4b18('0x3')]||'';this['clientId']=_0x3dfda1['clientId']||'';this['clientSecret']=_0x3dfda1[_0x4b18('0x4')]||'';this[_0x4b18('0x5')]=_0x3dfda1[_0x4b18('0x5')]||'';this['code']=_0x3dfda1['code']||'';this[_0x4b18('0x6')]=_0x3dfda1[_0x4b18('0x6')]||'';this[_0x4b18('0x7')]=_0x3dfda1[_0x4b18('0x7')]||{};}module[_0x4b18('0x8')]=ZohoAccount; \ No newline at end of file +var _0x3350=['name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports'];(function(_0x20d54d,_0x1adc8e){var _0x516e8b=function(_0x2754e1){while(--_0x2754e1){_0x20d54d['push'](_0x20d54d['shift']());}};_0x516e8b(++_0x1adc8e);}(_0x3350,0xd1));var _0x0335=function(_0x1348d0,_0x28b52d){_0x1348d0=_0x1348d0-0x0;var _0x4b2a1d=_0x3350[_0x1348d0];return _0x4b2a1d;};'use strict';function ZohoAccount(_0x41c484){this['id']=_0x41c484['id']||0x0;this[_0x0335('0x0')]=_0x41c484['name']||'';this['description']=_0x41c484[_0x0335('0x1')]||'';this[_0x0335('0x2')]=_0x41c484[_0x0335('0x2')]||'';this['zone']=_0x41c484[_0x0335('0x3')]||'';this[_0x0335('0x4')]=_0x41c484[_0x0335('0x4')]||'';this[_0x0335('0x5')]=_0x41c484['clientSecret']||'';this[_0x0335('0x6')]=_0x41c484[_0x0335('0x6')]||'';this[_0x0335('0x7')]=_0x41c484['code']||'';this[_0x0335('0x8')]=_0x41c484[_0x0335('0x8')]||'';this[_0x0335('0x9')]=_0x41c484[_0x0335('0x9')]||{};}module[_0x0335('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 56bf2de..346d150 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 _0x7708=['uniqueid','idContact','queue','name','type','campaigntype','membername','Agent','channelAgent','format','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','string','isNil'];(function(_0xdc541e,_0x5e9b6b){var _0x225e81=function(_0x4dd116){while(--_0x4dd116){_0xdc541e['push'](_0xdc541e['shift']());}};_0x225e81(++_0x5e9b6b);}(_0x7708,0x188));var _0x8770=function(_0x41bdd4,_0x3d5c76){_0x41bdd4=_0x41bdd4-0x0;var _0x5c03a6=_0x7708[_0x41bdd4];return _0x5c03a6;};'use strict';var util=require(_0x8770('0x0'));var _=require(_0x8770('0x1'));var moment=require('moment');function checkNameSurname(_0x141ddf,_0x5a8b5b,_0x5ca46f){var _0x555477='';if(!_['isNil'](_0x5a8b5b)&&_0x8770('0x2')===typeof _0x5a8b5b){_0x555477+=_0x5a8b5b;}if(!_[_0x8770('0x3')](_0x5ca46f)&&'string'===typeof _0x5ca46f){_0x555477+='\x20'+_0x5ca46f;}if(_0x555477!==''){return _0x555477;}return _0x141ddf;}function Action(_0x40d401,_0x50bab7,_0x31390d,_0x42d305,_0x2b0295){this[_0x8770('0x4')]=_0x31390d||undefined;this[_0x8770('0x5')]=_0x40d401['id'];this[_0x8770('0x6')]=_0x50bab7[_0x8770('0x7')];this['type']=_0x50bab7[_0x8770('0x8')];this[_0x8770('0x9')]=_0x8770('0x6');this['dialAnswer']=![];this[_0x8770('0xa')]=_[_0x8770('0x3')](_0x40d401[_0x8770('0xb')])?undefined:_0x40d401[_0x8770('0xb')]['name'];this[_0x8770('0xc')]=this[_0x8770('0xa')]?util[_0x8770('0xd')]('SIP/%s',this[_0x8770('0xa')]):_0x42d305||undefined;this[_0x8770('0xe')]=checkNameSurname(_0x40d401[_0x8770('0xf')][_0x8770('0x10')],_0x40d401[_0x8770('0xf')][_0x8770('0x11')],_0x40d401[_0x8770('0xf')][_0x8770('0x12')]);this['active']=_0x40d401[_0x8770('0x13')]||![];this[_0x8770('0x14')]=_0x40d401['phone'];this[_0x8770('0x15')]=_0x40d401['scheduledat'];this[_0x8770('0x16')]=_0x40d401['countbusyretry']||0x0;this['countcongestionretry']=_0x40d401['countcongestionretry']||0x0;this[_0x8770('0x17')]=_0x40d401[_0x8770('0x17')]||0x0;this[_0x8770('0x18')]=(_0x40d401[_0x8770('0x16')]||0x0)+(_0x40d401['countcongestionretry']||0x0)+(_0x40d401['countnoanswerretry']||0x0)+(_0x40d401[_0x8770('0x19')]||0x0)+(_0x40d401[_0x8770('0x1a')]||0x0)+(_0x40d401[_0x8770('0x1b')]||0x0)+(_0x40d401[_0x8770('0x1c')]||0x0)+(_0x40d401[_0x8770('0x1d')]||0x0);this['countnosuchnumberretry']=_0x40d401[_0x8770('0x19')]||0x0;this[_0x8770('0x1a')]=_0x40d401[_0x8770('0x1a')]||0x0;this[_0x8770('0x1b')]=_0x40d401['countabandonedretry']||0x0;this['countmachineretry']=_0x40d401[_0x8770('0x1c')]||0x0;this[_0x8770('0x1d')]=_0x40d401[_0x8770('0x1d')]||0x0;this[_0x8770('0x1e')]=_0x40d401[_0x8770('0x1e')];this[_0x8770('0x1f')]=_0x40d401['callbackuniqueid'];this[_0x8770('0x20')]=_0x40d401[_0x8770('0x20')];this[_0x8770('0x21')]=_0x40d401[_0x8770('0x21')];this['ContactId']=_0x40d401[_0x8770('0x22')];this['ListId']=_0x40d401[_0x8770('0x23')];this[_0x8770('0x24')]=_[_0x8770('0x3')](_0x40d401[_0x8770('0xb')])?_0x40d401[_0x8770('0x24')]:_0x40d401[_0x8770('0xb')]['id'];this[_0x8770('0x25')]=_0x40d401[_0x8770('0x25')];this[_0x8770('0x26')]='';this[_0x8770('0x27')]='';}Action['prototype'][_0x8770('0x28')]=function(){return util[_0x8770('0xd')](_0x8770('0x29'),this[_0x8770('0xe')],this[_0x8770('0x2a')]);};module[_0x8770('0x2b')]=Action; \ No newline at end of file +var _0xfcbb=['name','format','SIP/%s','Contact','firstName','lastName','active','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','calleridname','number','exports','util','lodash','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','Agent'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x4bbba9,_0x58fc76){_0x4bbba9=_0x4bbba9-0x0;var _0x9a2ca5=_0xfcbb[_0x4bbba9];return _0x9a2ca5;};'use strict';var util=require(_0xbfcb('0x0'));var _=require(_0xbfcb('0x1'));var moment=require(_0xbfcb('0x2'));function checkNameSurname(_0x5a1002,_0x5747a4,_0x462349){var _0x280329='';if(!_[_0xbfcb('0x3')](_0x5747a4)&&_0xbfcb('0x4')===typeof _0x5747a4){_0x280329+=_0x5747a4;}if(!_[_0xbfcb('0x3')](_0x462349)&&'string'===typeof _0x462349){_0x280329+='\x20'+_0x462349;}if(_0x280329!==''){return _0x280329;}return _0x5a1002;}function Action(_0x5201d3,_0x32c2aa,_0x4990c,_0x8d4e6a,_0x2df839){this[_0xbfcb('0x5')]=_0x4990c||undefined;this[_0xbfcb('0x6')]=_0x5201d3['id'];this[_0xbfcb('0x7')]=_0x32c2aa['name'];this[_0xbfcb('0x8')]=_0x32c2aa[_0xbfcb('0x8')];this[_0xbfcb('0x9')]='queue';this[_0xbfcb('0xa')]=![];this[_0xbfcb('0xb')]=_[_0xbfcb('0x3')](_0x5201d3[_0xbfcb('0xc')])?undefined:_0x5201d3[_0xbfcb('0xc')][_0xbfcb('0xd')];this['channelAgent']=this[_0xbfcb('0xb')]?util[_0xbfcb('0xe')](_0xbfcb('0xf'),this[_0xbfcb('0xb')]):_0x8d4e6a||undefined;this['calleridname']=checkNameSurname(_0x5201d3[_0xbfcb('0x10')]['phone'],_0x5201d3[_0xbfcb('0x10')][_0xbfcb('0x11')],_0x5201d3[_0xbfcb('0x10')][_0xbfcb('0x12')]);this[_0xbfcb('0x13')]=_0x5201d3[_0xbfcb('0x13')]||![];this[_0xbfcb('0x14')]=_0x5201d3[_0xbfcb('0x15')];this[_0xbfcb('0x16')]=_0x5201d3[_0xbfcb('0x16')];this[_0xbfcb('0x17')]=_0x5201d3[_0xbfcb('0x17')]||0x0;this[_0xbfcb('0x18')]=_0x5201d3[_0xbfcb('0x18')]||0x0;this[_0xbfcb('0x19')]=_0x5201d3[_0xbfcb('0x19')]||0x0;this[_0xbfcb('0x1a')]=(_0x5201d3[_0xbfcb('0x17')]||0x0)+(_0x5201d3[_0xbfcb('0x18')]||0x0)+(_0x5201d3[_0xbfcb('0x19')]||0x0)+(_0x5201d3[_0xbfcb('0x1b')]||0x0)+(_0x5201d3[_0xbfcb('0x1c')]||0x0)+(_0x5201d3['countabandonedretry']||0x0)+(_0x5201d3[_0xbfcb('0x1d')]||0x0)+(_0x5201d3[_0xbfcb('0x1e')]||0x0);this['countnosuchnumberretry']=_0x5201d3[_0xbfcb('0x1b')]||0x0;this[_0xbfcb('0x1c')]=_0x5201d3['countdropretry']||0x0;this['countabandonedretry']=_0x5201d3[_0xbfcb('0x1f')]||0x0;this[_0xbfcb('0x1d')]=_0x5201d3[_0xbfcb('0x1d')]||0x0;this[_0xbfcb('0x1e')]=_0x5201d3[_0xbfcb('0x1e')]||0x0;this['callback']=_0x5201d3[_0xbfcb('0x20')];this[_0xbfcb('0x21')]=_0x5201d3[_0xbfcb('0x21')];this[_0xbfcb('0x22')]=_0x5201d3[_0xbfcb('0x22')];this[_0xbfcb('0x23')]=_0x5201d3[_0xbfcb('0x23')];this[_0xbfcb('0x24')]=_0x5201d3[_0xbfcb('0x24')];this[_0xbfcb('0x25')]=_0x5201d3[_0xbfcb('0x25')];this[_0xbfcb('0x26')]=_[_0xbfcb('0x3')](_0x5201d3[_0xbfcb('0xc')])?_0x5201d3[_0xbfcb('0x26')]:_0x5201d3[_0xbfcb('0xc')]['id'];this['VoiceQueueId']=_0x5201d3[_0xbfcb('0x27')];this[_0xbfcb('0x28')]='';this['originatecalleridname']='';}Action[_0xbfcb('0x29')][_0xbfcb('0x2a')]=function(){return util[_0xbfcb('0xe')](_0xbfcb('0x2b'),this[_0xbfcb('0x2c')],this[_0xbfcb('0x2d')]);};module[_0xbfcb('0x2e')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index b00fa75..a00778b 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 _0xedd9=['channel','catch','message','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','getContactRecallMe','length','getDiff','scheduledat','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','starttime','outboundReCallsDay','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','createCustomerFinal','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','loggedIn','CAMPAIGN_STATUS','NO_AGENTS_LOGGED','isActive','isTrunkReachable','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','outboundNoSuchCallsDay','countnosuchnumberretry','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','callAdditionalPhoneAfterMin','dialGlobalMaxRetry','cloneAction','dialNoSuchNumberMaxRetry','rescheduleContact','dialNoSuchNumberRetryFrequency','activeContact','linkedid','idContact','incrementPreviewCounters','swapAdditionalPhones','then','YYYY-MM-DD\x20HH:mm:ss','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','total','answered','[16]','countglobal','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','sumDuration','talktime','sumBillable','[syncHangup][talking][decrement]','BUSY','dialBusyRetryFrequency','custom:agentbusy','busy','Global','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','scheduledAt','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','outboundRejectCallsDay','countagentrejectretry','AgentReject','dialAgentRejectRetryFrequency','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','dialstatus','amd','[callProgressDetectingCustomer][hangupInAMD]','cause-txt','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','called','Calling','Call\x20failed','outboundBlacklistCallsDay','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','status','reachable','execRun','unlock','unlockContact','getContactPreview','recallme','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','validateContact','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','Trunk','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20working\x20correctly','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','dialPrefix','trim','dialCutDigit','substring','SIP/%s/%s%s','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','responsetime','isFailure','response','custom:agentringnoanswer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','addVariable','variables','syncVarSet','filterKey','keys','variable','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','lodash','uuid','moment','ioredis','../../../config/environment','../../../config/logger','preview','../ami','./rpcDb','../rpc/cmHopperAdditionalPhone','./action','../dialer/utils','defaults','redis','localhost','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','syncNewExten','varset','syncAttendedTransfer','emit','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','format','name','voice_queue_channel:remove','voice_queue_presence:remove','originated','pTalking','sendMessageOneNotActive','available','paused','INACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','DEACTIVATED','\x20is\x20deactivated','loopCampaigns','syncCampaigns','clockClearZombieChannels','hasOwnProperty','dialMethod','booked','type','outbound','dialActive','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','enqueue','isNil','info','Queue','queue','originated:\x20','pTalking:\x20','dialAnswer','pick','contactId','VoiceQueueId','ListId','Action'];(function(_0x5b8b97,_0x6b4dfa){var _0x1fdf84=function(_0x2ced4c){while(--_0x2ced4c){_0x5b8b97['push'](_0x5b8b97['shift']());}};_0x1fdf84(++_0x6b4dfa);}(_0xedd9,0xfc));var _0x9edd=function(_0x4c8884,_0x248d8f){_0x4c8884=_0x4c8884-0x0;var _0x326b7d=_0xedd9[_0x4c8884];return _0x326b7d;};'use strict';var util=require('util');var _=require(_0x9edd('0x0'));var uuid=require(_0x9edd('0x1'));var moment=require(_0x9edd('0x2'));var Redis=require(_0x9edd('0x3'));var config=require(_0x9edd('0x4'));var logger=require(_0x9edd('0x5'))(_0x9edd('0x6'));var loggerAction=require(_0x9edd('0x5'))('actionPreview');var ami=require(_0x9edd('0x7'));var rpcDb=require(_0x9edd('0x8'));var cmHopperAdditionalPhone=require(_0x9edd('0x9'));var Action=require(_0x9edd('0xa'));var ut=require('./util/util');var utils=require(_0x9edd('0xb'));config['redis']=_[_0x9edd('0xc')](config[_0x9edd('0xd')],{'host':_0x9edd('0xe'),'port':0x18eb});var io=require(_0x9edd('0xf'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x9edd('0x10')]['enqueue']=function(_0x2076fc){this[_0x9edd('0x11')]=this['tail']?this[_0x9edd('0x11')][_0x9edd('0x12')](_0x2076fc):_0x2076fc();};function Preview(_0x5b6c00){this[_0x9edd('0x13')]=new Sequence();this[_0x9edd('0x14')]=_0x5b6c00[_0x9edd('0x15')];this[_0x9edd('0x16')]=_0x5b6c00[_0x9edd('0x16')];this[_0x9edd('0x17')]={};this[_0x9edd('0x18')]=_0x5b6c00[_0x9edd('0x18')];this['clockClearZombieChannels']=0x0;ami['on'](_0x9edd('0x19'),this[_0x9edd('0x1a')][_0x9edd('0x1b')](this));ami['on'](_0x9edd('0x1c'),this[_0x9edd('0x1d')][_0x9edd('0x1b')](this));ami['on'](_0x9edd('0x1e'),this[_0x9edd('0x1f')]['bind'](this));ami['on'](_0x9edd('0x20'),this[_0x9edd('0x21')][_0x9edd('0x1b')](this));ami['on']('newexten',this[_0x9edd('0x22')][_0x9edd('0x1b')](this));ami['on'](_0x9edd('0x23'),this['syncVarSet'][_0x9edd('0x1b')](this));ami['on']('attendedtransfer',this[_0x9edd('0x24')][_0x9edd('0x1b')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x9edd('0x1b')](this));this['loopCampaigns'](this[_0x9edd('0x14')]);}function emit(_0x54a03f,_0x535f37,_0x356751){io['to'](_0x54a03f)[_0x9edd('0x25')](_0x535f37,_0x356751);}function emitVoiceQueueChannelRemove(_0x4fb7bf){logger['info'](_0x9edd('0x26'),JSON[_0x9edd('0x27')](_0x4fb7bf));emit(util[_0x9edd('0x28')]('voice:queue:%s',_0x4fb7bf[_0x9edd('0x29')]),_0x9edd('0x2a'),_0x4fb7bf);io[_0x9edd('0x25')](_0x9edd('0x2b'),_0x4fb7bf);}function notSendMessagesQueue(_0x339a0d){if(_0x339a0d['sendMessageOneNotActive']){if(_0x339a0d[_0x9edd('0x2c')]===0x0&&_0x339a0d[_0x9edd('0x2d')]===0x0){_0x339a0d[_0x9edd('0x2e')]=![];_0x339a0d[_0x9edd('0x2f')]=0x0;_0x339a0d[_0x9edd('0x30')]=0x0;_0x339a0d['message']=utils['CAMPAIGN_STATUS'][_0x9edd('0x31')];ut[_0x9edd('0x32')](_0x9edd('0x33'),_0x339a0d[_0x9edd('0x29')]+_0x9edd('0x34'));}else{_0x339a0d['message']=utils['CAMPAIGN_STATUS'][_0x9edd('0x35')];ut[_0x9edd('0x32')](_0x9edd('0x33'),_0x339a0d['name']+_0x9edd('0x36'));}}}Preview[_0x9edd('0x10')][_0x9edd('0x37')]=function(){var _0x41af53=this;setInterval(function(){_0x41af53['syncCampaigns']();},0x7cf);};Preview[_0x9edd('0x10')][_0x9edd('0x38')]=function(){var _0xbe87e1=this[_0x9edd('0x14')];this[_0x9edd('0x39')]+=0x1;for(var _0x42e664 in _0xbe87e1){if(_0xbe87e1[_0x9edd('0x3a')](_0x42e664)&&(_0xbe87e1[_0x42e664][_0x9edd('0x3b')]===_0x9edd('0x6')||_0xbe87e1[_0x42e664][_0x9edd('0x3b')]===_0x9edd('0x3c'))&&_0xbe87e1[_0x42e664][_0x9edd('0x3d')]===_0x9edd('0x3e')){if(this[_0x9edd('0x39')]>0x7){this[_0x9edd('0x39')]=0x0;this['clearZombieChannels']();}}if(_0xbe87e1[_0x9edd('0x3a')](_0x42e664)&&_0xbe87e1[_0x42e664][_0x9edd('0x3b')]===_0x9edd('0x6')&&_0xbe87e1[_0x42e664]['type']===_0x9edd('0x3e')){if(_0xbe87e1[_0x42e664][_0x9edd('0x3f')]){this[_0x9edd('0x40')](_0xbe87e1[_0x42e664]);if(_0xbe87e1[_0x42e664][_0x9edd('0x41')])this[_0x9edd('0x42')](_0xbe87e1[_0x42e664]);}else{notSendMessagesQueue(_0xbe87e1[_0x42e664]);}}}};Preview[_0x9edd('0x10')][_0x9edd('0x43')]=function(_0x438a5d){var _0xd0fd74=this;this[_0x9edd('0x13')][_0x9edd('0x44')](function(){if(!_[_0x9edd('0x45')](_0xd0fd74[_0x9edd('0x17')][_0x438a5d])){loggerAction[_0x9edd('0x46')]('[clearZombieChannels][talking]',_0x438a5d,_0x9edd('0x47'),_0xd0fd74['actions'][_0x438a5d][_0x9edd('0x48')],_0x9edd('0x49'),JSON[_0x9edd('0x27')](_0xd0fd74[_0x9edd('0x14')][_0xd0fd74[_0x9edd('0x17')][_0x438a5d]['queue']][_0x9edd('0x2c')]),_0x9edd('0x4a'),JSON[_0x9edd('0x27')](_0xd0fd74[_0x9edd('0x14')][_0xd0fd74[_0x9edd('0x17')][_0x438a5d][_0x9edd('0x48')]][_0x9edd('0x2d')]),JSON[_0x9edd('0x27')](_0xd0fd74[_0x9edd('0x17')][_0x438a5d][_0x9edd('0x4b')]),JSON['stringify'](_[_0x9edd('0x4c')](_0xd0fd74['actions'][_0x438a5d],[_0x9edd('0x4d'),'UserId',_0x9edd('0x4e'),_0x9edd('0x4f')])));return ami[_0x9edd('0x50')]({'action':'status','channel':_0xd0fd74[_0x9edd('0x17')][_0x438a5d][_0x9edd('0x51')]})[_0x9edd('0x52')](function(_0x48958a){if(_0x48958a[_0x9edd('0x53')]==='No\x20such\x20channel'){setTimeout(function(){if(_0xd0fd74[_0x9edd('0x17')][_0x438a5d]){ut[_0x9edd('0x54')](_0xd0fd74['campaignsPreview'][_0xd0fd74[_0x9edd('0x17')][_0x438a5d][_0x9edd('0x48')]],_0x9edd('0x55'));if(_0xd0fd74[_0x9edd('0x17')][_0x438a5d]['dialAnswer']===!![]){ut[_0x9edd('0x56')](_0xd0fd74['campaignsPreview'][_0xd0fd74[_0x9edd('0x17')][_0x438a5d][_0x9edd('0x48')]],'[clearZombieChannel]');ut[_0x9edd('0x57')]('[Dialer][checkChannel][pTalking][Preview]'+_0x438a5d,_0xd0fd74['actions'][_0x438a5d][_0x9edd('0x48')]);}ut[_0x9edd('0x57')](_0x9edd('0x58')+_0x438a5d,_0xd0fd74[_0x9edd('0x17')][_0x438a5d][_0x9edd('0x48')]);delete _0xd0fd74[_0x9edd('0x17')][_0x438a5d];}},0x2328);}});}});};Preview[_0x9edd('0x10')][_0x9edd('0x59')]=function(){var _0x18c149=this;loggerAction[_0x9edd('0x46')](_0x9edd('0x5a'),_[_0x9edd('0x5b')](this[_0x9edd('0x17')]));for(var _0xbbe8fc in this[_0x9edd('0x17')]){if(_0x18c149['actions'][_0x9edd('0x3a')](_0xbbe8fc)){_0x18c149[_0x9edd('0x43')](_0xbbe8fc);}}};Preview[_0x9edd('0x10')][_0x9edd('0x42')]=function(_0x241929){var _0x3ecdfd=this;rpcDb[_0x9edd('0x5c')](_0x241929['id'],ut['agentReadyId'](this['agents']))['then'](function(_0x4a7dc9){if(!_['isNil'](_0x4a7dc9)){for(var _0x8b1fdb=0x0;_0x8b1fdb<_0x4a7dc9[_0x9edd('0x5d')];_0x8b1fdb+=0x1){if(ut[_0x9edd('0x5e')](_0x4a7dc9[_0x8b1fdb][_0x9edd('0x5f')])<_0x241929[_0x9edd('0x60')]*0x3c){if(_0x4a7dc9[_0x8b1fdb]['Agent']&&!_0x4a7dc9[_0x8b1fdb][_0x9edd('0x61')][_0x9edd('0x62')]){_0x3ecdfd[_0x9edd('0x63')](_0x4a7dc9[_0x8b1fdb]['id'])['then'](ut[_0x9edd('0x64')](_0x9edd('0x65')))[_0x9edd('0x52')](ut[_0x9edd('0x64')](_0x9edd('0x65')));}else{rpcDb[_0x9edd('0x66')](_0x4a7dc9[_0x8b1fdb]['id']);}}else{var _0x4d4f33=new Action(_0x4a7dc9[_0x8b1fdb],_0x241929);_0x4d4f33[_0x9edd('0x67')]=moment()[_0x9edd('0x28')]('YYYY-MM-DD\x20HH:mm:ss');_0x241929[_0x9edd('0x68')]+=0x1;ut[_0x9edd('0x69')](_0x4d4f33,0x17,'RecallInQueue');if(_0x241929[_0x9edd('0x6a')]){rpcDb[_0x9edd('0x6b')](ut[_0x9edd('0x6c')](_0x4a7dc9[_0x8b1fdb]));rpcDb['createCustomerHistory'](_0x4d4f33,_0x9edd('0x6d'));}else{ut[_0x9edd('0x69')](_0x4d4f33,0x16,_0x9edd('0x6e'));rpcDb[_0x9edd('0x6f')](_0x4d4f33,'[HistoryRecallClose]');rpcDb[_0x9edd('0x70')](_0x4d4f33,_0x9edd('0x71'));}}}}})[_0x9edd('0x52')](ut['logger2'](_0x9edd('0x72')));};Preview[_0x9edd('0x10')]['setMessage']=function(_0x8e59bd){_0x8e59bd['sendMessageOneNotActive']=!![];if(ut[_0x9edd('0x73')](_0x8e59bd[_0x9edd('0x74')])){_0x8e59bd[_0x9edd('0x53')]=utils[_0x9edd('0x75')][_0x9edd('0x76')];}else if(!ut[_0x9edd('0x77')](_0x8e59bd[_0x9edd('0x3f')])){_0x8e59bd[_0x9edd('0x53')]=utils[_0x9edd('0x75')][_0x9edd('0x31')];}else if(!this[_0x9edd('0x78')](_0x8e59bd['Trunk'])){if(!this[_0x9edd('0x78')](_0x8e59bd[_0x9edd('0x79')])){_0x8e59bd[_0x9edd('0x53')]=utils['CAMPAIGN_STATUS'][_0x9edd('0x7a')];}else{_0x8e59bd['message']=utils['CAMPAIGN_STATUS']['ACTIVE'];}}else{_0x8e59bd[_0x9edd('0x53')]=utils[_0x9edd('0x75')][_0x9edd('0x7b')];}};Preview[_0x9edd('0x10')]['callProgressDetectingCustomer']=function(_0x56b38b,_0x4e3c3e,_0x71820f){var _0x5f666b=this;var _0xd5090a=this[_0x9edd('0x17')][_0x4e3c3e];var _0x2e2920=this[_0x9edd('0x14')][_0xd5090a[_0x9edd('0x48')]];var _0x1e3087;var _0x4eb780=![];var _0x16dfdc=0x2;var _0x49d0ce=0x3;if(_0x2e2920){switch(_0x71820f){case'1':_0x2e2920[_0x9edd('0x7c')]+=0x1;_0xd5090a[_0x9edd('0x7d')]+=0x1;_0xd5090a['countglobal']=ut[_0x9edd('0x7e')](_0xd5090a);ut[_0x9edd('0x69')](_0xd5090a,0x0,_0x9edd('0x7f'));ami['emit'](_0x9edd('0x80'),ut[_0x9edd('0x81')](_0xd5090a,_0x9edd('0x82')));rpcDb[_0x9edd('0x6f')](_0xd5090a,_0x9edd('0x83'));_0x5f666b[_0x9edd('0x84')](_0xd5090a,'0',_0x2e2920)['then'](function(_0x4aa337){_0x4eb780=_0x4aa337[_0x9edd('0x85')]==0x1;_0x16dfdc=_0x2e2920['dialNoSuchNumberRetryFrequency'];_0x49d0ce=_0x2e2920[_0x9edd('0x86')];if(!_0x4eb780){if(ut[_0x9edd('0x7e')](_0xd5090a)>=_0x2e2920[_0x9edd('0x87')]){_0x1e3087=ut[_0x9edd('0x88')](_0xd5090a,0xf,'Global');rpcDb[_0x9edd('0x70')](_0x1e3087,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0xd5090a[_0x9edd('0x7d')]>=_0x2e2920[_0x9edd('0x89')]){rpcDb[_0x9edd('0x70')](_0xd5090a,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x9edd('0x8a')](ut['scheduledAt'](_0xd5090a,_0x9edd('0x7d'),_0x2e2920[_0x9edd('0x8b')]),_0xd5090a['unlockAgent'],_0xd5090a[_0x9edd('0x8c')]);}}delete this['actions'][_0x56b38b[_0x9edd('0x8d')]];}else{_0xd5090a[_0x9edd('0x7d')]++;logger[_0x9edd('0x46')]('actioncountonusuch',_0xd5090a[_0x9edd('0x7d')]);logger[_0x9edd('0x46')]('id',_0xd5090a[_0x9edd('0x8e')]);_0x5f666b[_0x9edd('0x8f')]({'id':_0xd5090a[_0x9edd('0x8e')],'field':{'countnosuchnumberretry':_0xd5090a['countnosuchnumberretry']}})['then'](function(){_0x5f666b[_0x9edd('0x90')](_0xd5090a,_0x16dfdc,_0x49d0ce)[_0x9edd('0x91')](function(){});});}});break;case'ANSWER':var _0x5496e9=moment()['format'](_0x9edd('0x92'));_0xd5090a['responsetime']=_0x5496e9;_0xd5090a['answertime']=_0x5496e9;_0xd5090a[_0x9edd('0x4b')]=!![];_0x2e2920[_0x9edd('0x2d')]+=0x1;logger['info'](_0x9edd('0x93'),_0xd5090a[_0x9edd('0x94')],_0x9edd('0x95'),_0x2e2920['name'],_0x9edd('0x4a'),_0x2e2920['pTalking']);ami[_0x9edd('0x25')](_0x9edd('0x96'),ut['buildObj'](_0xd5090a,_0x9edd('0x97'),this[_0x9edd('0x14')][_0xd5090a['queue']]));if(_0x2e2920[_0x9edd('0x98')]){ami[_0x9edd('0x25')](_0x9edd('0x99'),ut[_0x9edd('0x9a')](_0xd5090a));}break;case'16':ami['emit'](_0x9edd('0x9b'),ut['buildObj'](_0xd5090a,_0x9edd('0x9c'),this[_0x9edd('0x14')][_0xd5090a[_0x9edd('0x48')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0xd5090a,_0x9edd('0x9c')));_0x2e2920[_0x9edd('0x9d')]+=0x1;_0x2e2920[_0x9edd('0x9e')]+=0x1;_0x2e2920[_0x9edd('0x9f')]+=0x1;ut[_0x9edd('0x56')](_0x2e2920,_0x9edd('0xa0'));_0xd5090a[_0x9edd('0xa1')]=ut['totalGlobal'](_0xd5090a);ut['logCustomer'](_0xd5090a,0x4,_0x9edd('0xa2'));rpcDb[_0x9edd('0x6f')](_0xd5090a,_0x9edd('0xa3'));rpcDb[_0x9edd('0x70')](_0xd5090a,_0x9edd('0xa4'));rpcDb['crateCustomerReportQueue'](_0xd5090a);_0x2e2920[_0x9edd('0xa5')]+=_0xd5090a[_0x9edd('0xa6')];_0x2e2920[_0x9edd('0xa7')]+=_0xd5090a['talktime'];logger[_0x9edd('0x46')](_0x9edd('0xa8'),_0xd5090a['uniqueid'],_0x9edd('0x95'),_0x2e2920[_0x9edd('0x29')],'pTalking:\x20',_0x2e2920[_0x9edd('0x2d')]);delete this[_0x9edd('0x17')][_0x56b38b['linkedid']];break;case _0x9edd('0xa9'):_0x2e2920['outboundBusyCallsDay']+=0x1;_0xd5090a['countbusyretry']+=0x1;_0xd5090a[_0x9edd('0xa1')]=ut[_0x9edd('0x7e')](_0xd5090a);ut[_0x9edd('0x69')](_0xd5090a,0x5,'Busy');_0x16dfdc=_0x2e2920[_0x9edd('0xaa')];_0x49d0ce=_0x2e2920[_0x9edd('0x86')];ami['emit'](_0x9edd('0xab'),ut[_0x9edd('0x81')](_0xd5090a,_0x9edd('0xac')));rpcDb[_0x9edd('0x6f')](_0xd5090a,'[callProgressDetectingCustomer][logBusy]');_0x5f666b['verifyAdditionalPhones'](_0xd5090a,'5',_0x2e2920)[_0x9edd('0x91')](function(_0x5bb28c){_0x4eb780=_0x5bb28c[_0x9edd('0x85')]==0x1;if(!_0x4eb780){if(ut[_0x9edd('0x7e')](_0xd5090a)>=_0x2e2920[_0x9edd('0x87')]){_0x1e3087=ut[_0x9edd('0x88')](_0xd5090a,0xf,_0x9edd('0xad'));rpcDb[_0x9edd('0x70')](_0x1e3087,_0x9edd('0xae'));}else{if(_0xd5090a[_0x9edd('0xaf')]>=_0x2e2920[_0x9edd('0xb0')]){rpcDb['createCustomerFinal'](_0xd5090a,_0x9edd('0xb1'));}else{rpcDb[_0x9edd('0x8a')](ut[_0x9edd('0xb2')](_0xd5090a,_0x9edd('0xaf'),_0x2e2920[_0x9edd('0xaa')]),_0xd5090a[_0x9edd('0xb3')],_0xd5090a[_0x9edd('0x8c')]);}}}else{_0xd5090a['countbusyretry']++;_0x5f666b[_0x9edd('0x8f')]({'id':_0xd5090a[_0x9edd('0x8e')],'field':{'countbusyretry':_0xd5090a['countbusyretry']}})[_0x9edd('0x91')](function(){_0x5f666b[_0x9edd('0x90')](_0xd5090a,_0x16dfdc,_0x49d0ce)['then'](function(){});});}});break;case _0x9edd('0xb4'):_0x2e2920[_0x9edd('0xb5')]+=0x1;_0xd5090a[_0x9edd('0xb6')]+=0x1;_0xd5090a['countglobal']=ut[_0x9edd('0x7e')](_0xd5090a);ut[_0x9edd('0x69')](_0xd5090a,0x3,_0x9edd('0xb7'));_0x16dfdc=_0x2e2920['dialNoAnswerRetryFrequency'];_0x49d0ce=_0x2e2920['callAdditionalPhoneAfterMin'];var _0x5378ca=ut['buildNoAnswerEventPayload'](_0xd5090a,_0x2e2920);ami[_0x9edd('0x25')](_0x9edd('0xb8'),_0x5378ca);rpcDb[_0x9edd('0x6f')](_0xd5090a,'[callProgressDetectingCustomer][logNoAnswer]');_0x5f666b['verifyAdditionalPhones'](_0xd5090a,'3',_0x2e2920)['then'](function(_0x56d794){_0x4eb780=_0x56d794[_0x9edd('0x85')]==0x1;if(!_0x4eb780){if(ut[_0x9edd('0x7e')](_0xd5090a)>=_0x2e2920[_0x9edd('0x87')]){_0x1e3087=ut[_0x9edd('0x88')](_0xd5090a,0xf,_0x9edd('0xad'));rpcDb[_0x9edd('0x70')](_0x1e3087,_0x9edd('0xb9'));}else{if(_0xd5090a[_0x9edd('0xb6')]>=_0x2e2920[_0x9edd('0xba')]){rpcDb[_0x9edd('0x70')](_0xd5090a,_0x9edd('0xbb'));}else{rpcDb['rescheduleContact'](ut[_0x9edd('0xb2')](_0xd5090a,_0x9edd('0xb6'),_0x2e2920[_0x9edd('0xbc')]),_0xd5090a[_0x9edd('0xb3')],_0xd5090a[_0x9edd('0x8c')]);}}}else{_0xd5090a[_0x9edd('0xb6')]++;_0x5f666b[_0x9edd('0x8f')]({'id':_0xd5090a[_0x9edd('0x8e')],'field':{'countnoanswerretry':_0xd5090a['countnoanswerretry']}})['then'](function(){_0x5f666b[_0x9edd('0x90')](_0xd5090a,_0x16dfdc,_0x49d0ce)['then'](function(){});});}});break;case _0x9edd('0xbd'):_0x2e2920['outboundCongestionCallsDay']+=0x1;_0xd5090a[_0x9edd('0xbe')]+=0x1;_0xd5090a[_0x9edd('0xa1')]=ut['totalGlobal'](_0xd5090a);ut[_0x9edd('0x69')](_0xd5090a,0x8,_0x9edd('0xbf'));_0x16dfdc=_0x2e2920['dialCongestionRetryFrequency'];_0x49d0ce=_0x2e2920[_0x9edd('0x86')];ami[_0x9edd('0x25')](_0x9edd('0xc0'),ut[_0x9edd('0x81')](_0xd5090a,_0x9edd('0xc1')));rpcDb['createCustomerHistory'](_0xd5090a,_0x9edd('0xc2'));_0x5f666b[_0x9edd('0x84')](_0xd5090a,'8',_0x2e2920)[_0x9edd('0x91')](function(_0x24488b){_0x4eb780=_0x24488b[_0x9edd('0x85')]==0x1;if(!_0x4eb780){if(ut['totalGlobal'](_0xd5090a)>=_0x2e2920['dialGlobalMaxRetry']){_0x1e3087=ut['cloneAction'](_0xd5090a,0xf,'Global');rpcDb['createCustomerFinal'](_0x1e3087,_0x9edd('0xc3'));}else{if(_0xd5090a['countcongestionretry']>=_0x2e2920['dialCongestionMaxRetry']){rpcDb[_0x9edd('0x70')](_0xd5090a,_0x9edd('0xc2'));}else{rpcDb[_0x9edd('0x8a')](ut[_0x9edd('0xb2')](_0xd5090a,_0x9edd('0xbe'),_0x2e2920[_0x9edd('0xaa')]),_0xd5090a[_0x9edd('0xb3')],_0xd5090a[_0x9edd('0x8c')]);}}}else{_0xd5090a[_0x9edd('0xbe')]++;_0x5f666b[_0x9edd('0x8f')]({'id':_0xd5090a['idContact'],'field':{'countcongestionretry':_0xd5090a[_0x9edd('0xbe')]}})[_0x9edd('0x91')](function(){_0x5f666b[_0x9edd('0x90')](_0xd5090a,_0x16dfdc,_0x49d0ce)[_0x9edd('0x91')](function(){});});}});break;case _0x9edd('0xc4'):_0x2e2920[_0x9edd('0xc5')]+=0x1;_0xd5090a[_0x9edd('0xc6')]+=0x1;_0xd5090a[_0x9edd('0xa1')]=ut['totalGlobal'](_0xd5090a);ut['logCustomer'](_0xd5090a,0x14,_0x9edd('0xc7'));_0x16dfdc=_0x2e2920[_0x9edd('0xc8')];_0x49d0ce=_0x2e2920[_0x9edd('0x86')];ami[_0x9edd('0x25')](_0x9edd('0xc9'),ut[_0x9edd('0x81')](_0xd5090a,_0x9edd('0xca')));rpcDb[_0x9edd('0x6f')](_0xd5090a,_0x9edd('0xcb'));_0x5f666b[_0x9edd('0x84')](_0xd5090a,'20',_0x2e2920)[_0x9edd('0x91')](function(_0x260cc6){_0x4eb780=_0x260cc6[_0x9edd('0x85')]==0x1;if(!_0x4eb780){if(ut[_0x9edd('0x7e')](_0xd5090a)>=_0x2e2920['dialGlobalMaxRetry']){_0x1e3087=ut[_0x9edd('0x88')](_0xd5090a,0x14,_0x9edd('0xc7'));rpcDb['createCustomerFinal'](_0x1e3087,_0x9edd('0xcc'));}else{if(_0xd5090a[_0x9edd('0xc6')]>=_0x2e2920[_0x9edd('0xcd')]){rpcDb[_0x9edd('0x70')](_0xd5090a,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb[_0x9edd('0x8a')](ut[_0x9edd('0xb2')](_0xd5090a,_0x9edd('0xc6'),_0x2e2920[_0x9edd('0xc8')]),_0xd5090a[_0x9edd('0xb3')],_0xd5090a['activeContact']);}}}else{_0xd5090a[_0x9edd('0xb6')]++;_0x5f666b[_0x9edd('0x8f')]({'id':_0xd5090a[_0x9edd('0x8e')],'field':{'countnoanswerretry':_0xd5090a[_0x9edd('0xb6')]}})[_0x9edd('0x91')](function(){_0x5f666b['swapAdditionalPhones'](_0xd5090a,_0x16dfdc,_0x49d0ce)['then'](function(){});});}});break;case _0x9edd('0xce'):_0x2e2920['outboundAbandonedCallsDay']+=0x1;_0xd5090a[_0x9edd('0xcf')]+=0x1;_0xd5090a['countglobal']=ut[_0x9edd('0x7e')](_0xd5090a);ut[_0x9edd('0x69')](_0xd5090a,0xb,_0x9edd('0xd0'));rpcDb[_0x9edd('0x6f')](_0xd5090a,_0x9edd('0xd1'));_0x5f666b[_0x9edd('0x84')](_0xd5090a,'11',_0x2e2920)['then'](function(_0x186e02){_0x4eb780=_0x186e02[_0x9edd('0x85')]==0x1;if(!_0x4eb780){if(ut[_0x9edd('0x7e')](_0xd5090a)>=_0x2e2920[_0x9edd('0x87')]){_0x1e3087=ut[_0x9edd('0x88')](_0xd5090a,0xf,_0x9edd('0xad'));rpcDb[_0x9edd('0x70')](_0x1e3087,_0x9edd('0xd1'));}else{if(_0xd5090a['countabandonedetry']>=_0x2e2920[_0x9edd('0xd2')]){rpcDb[_0x9edd('0x70')](_0xd5090a,_0x9edd('0xd1'));}else{rpcDb[_0x9edd('0x8a')](ut[_0x9edd('0xb2')](_0xd5090a,_0x9edd('0xcf'),_0x2e2920[_0x9edd('0xd3')]),_0xd5090a[_0x9edd('0xb3')],_0xd5090a[_0x9edd('0x8c')]);}}}else{_0xd5090a[_0x9edd('0xb6')]++;_0x5f666b[_0x9edd('0x8f')]({'id':_0xd5090a[_0x9edd('0x8e')],'field':{'countnoanswerretry':_0xd5090a[_0x9edd('0xb6')]}})[_0x9edd('0x91')](function(){_0x5f666b[_0x9edd('0x90')](_0xd5090a,_0x16dfdc,_0x49d0ce)[_0x9edd('0x91')](function(){});});}});break;case'18':_0x2e2920[_0x9edd('0xd4')]+=0x1;_0xd5090a[_0x9edd('0xd5')]+=0x1;_0xd5090a[_0x9edd('0xa1')]=ut[_0x9edd('0x7e')](_0xd5090a);ut[_0x9edd('0x69')](_0xd5090a,0x12,_0x56b38b['cause-txt']||_0x56b38b[_0x9edd('0xd6')]);ami['emit']('custom:amd',ut[_0x9edd('0x81')](_0xd5090a,_0x9edd('0xd7')));rpcDb[_0x9edd('0x6f')](_0xd5090a,_0x9edd('0xd8'));_0x5f666b[_0x9edd('0x84')](_0xd5090a,'18',_0x2e2920)[_0x9edd('0x91')](function(_0x3b5c12){_0x4eb780=_0x3b5c12[_0x9edd('0x85')]==0x1;if(!_0x4eb780){if(ut[_0x9edd('0x7e')](_0xd5090a)>=_0x2e2920[_0x9edd('0x87')]){_0x1e3087=ut['cloneAction'](_0xd5090a,0x12,_0x9edd('0xad'));rpcDb[_0x9edd('0x70')](_0x1e3087,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb['createCustomerFinal'](_0xd5090a,_0x9edd('0xd8'));}}else{_0xd5090a[_0x9edd('0xb6')]++;_0x5f666b[_0x9edd('0x8f')]({'id':_0xd5090a[_0x9edd('0x8e')],'field':{'countnoanswerretry':_0xd5090a['countnoanswerretry']}})['then'](function(){_0x5f666b[_0x9edd('0x90')](_0xd5090a,_0x16dfdc,_0x49d0ce)['then'](function(){});});}});delete this[_0x9edd('0x17')][_0x56b38b[_0x9edd('0x8d')]];break;case'19':_0x2e2920[_0x9edd('0xd4')]+=0x1;_0xd5090a['countglobal']=ut['totalGlobal'](_0xd5090a);ut['logCustomer'](_0xd5090a,0x13,_0x56b38b[_0x9edd('0xd9')]||_0x56b38b[_0x9edd('0xd6')]);ami[_0x9edd('0x25')]('custom:amd',ut[_0x9edd('0x81')](_0xd5090a,_0x9edd('0xd7')));rpcDb['createCustomerHistory'](_0xd5090a,_0x9edd('0xda'));_0x5f666b[_0x9edd('0x84')](_0xd5090a,'18',_0x2e2920)['then'](function(_0x5c9b3e){_0x4eb780=_0x5c9b3e[_0x9edd('0x85')]==0x1;if(!_0x4eb780){if(ut[_0x9edd('0x7e')](_0xd5090a)>=_0x2e2920['dialGlobalMaxRetry']){_0x1e3087=ut[_0x9edd('0x88')](_0xd5090a,0xf,_0x9edd('0xad'));rpcDb['createCustomerFinal'](_0x1e3087,_0x9edd('0xda'));}else{rpcDb['createCustomerFinal'](_0xd5090a,_0x9edd('0xda'));}}else{_0xd5090a[_0x9edd('0xb6')]++;_0x5f666b[_0x9edd('0x8f')]({'id':_0xd5090a[_0x9edd('0x8e')],'field':{'countnoanswerretry':_0xd5090a[_0x9edd('0xb6')]}})[_0x9edd('0x91')](function(){_0x5f666b['swapAdditionalPhones'](_0xd5090a,_0x16dfdc,_0x49d0ce)[_0x9edd('0x91')](function(){});});}});delete this[_0x9edd('0x17')][_0x56b38b[_0x9edd('0x8d')]];break;default:if(_0xd5090a['dialAnswer']){ut[_0x9edd('0x56')](_0x2e2920,'[default]');ut[_0x9edd('0x57')](_0x9edd('0xdb')+_0x2e2920[_0x9edd('0x29')],_0x56b38b);}_0x2e2920[_0x9edd('0xd4')]+=0x1;_0xd5090a['countglobal']=ut['totalGlobal'](_0xd5090a);ut['logCustomer'](_0xd5090a,0xc,_0x56b38b[_0x9edd('0xd9')]||_0x56b38b[_0x9edd('0xd6')]);_0x16dfdc=_0x2e2920[_0x9edd('0xc8')];_0x49d0ce=_0x2e2920['callAdditionalPhoneAfterMin'];rpcDb[_0x9edd('0x6f')](_0xd5090a,_0x9edd('0xdc'));_0x5f666b[_0x9edd('0x84')](_0xd5090a,'20',_0x2e2920)[_0x9edd('0x91')](function(_0x1aa77f){_0x4eb780=_0x1aa77f[_0x9edd('0x85')]==0x1;if(!_0x4eb780){if(ut['totalGlobal'](_0xd5090a)>=_0x2e2920['dialGlobalMaxRetry']){_0x1e3087=ut[_0x9edd('0x88')](_0xd5090a,0xf,_0x9edd('0xad'));rpcDb[_0x9edd('0x70')](_0x1e3087,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x9edd('0x70')](_0xd5090a,_0x9edd('0xdd'));}delete this[_0x9edd('0x17')][_0x56b38b[_0x9edd('0x8d')]];}else{_0x5f666b['swapAdditionalPhones'](_0xd5090a,_0x16dfdc,_0x49d0ce)[_0x9edd('0x91')](function(){});}});}if(!(_0xd5090a['dialAnswer']&&_0x71820f==='16')){ut[_0x9edd('0x54')](_0x2e2920,_0x9edd('0xde'));logger[_0x9edd('0x46')](_0x9edd('0xdf'),_0xd5090a[_0x9edd('0x94')],'\x20Queue',_0x2e2920[_0x9edd('0x29')],'originated:\x20',_0x2e2920[_0x9edd('0x2c')]);}if(_0x71820f!=='ANSWER'){delete this[_0x9edd('0x17')][_0x56b38b['linkedid']];delete this[_0x9edd('0x17')][_0x56b38b[_0x9edd('0xe0')]];}_0x2e2920[_0x9edd('0xe1')]=!![];}};Preview['prototype'][_0x9edd('0xe2')]=function(_0x7512ea,_0x1c5038,_0x2e7b0d){if(_[_0x9edd('0xe3')](_0x1c5038)&&_0x9edd('0xe4')!==typeof _0x1c5038){return;}if(_[_0x9edd('0xe3')](_0x2e7b0d)&&_0x9edd('0xe4')!==typeof _0x2e7b0d){return;}switch(_0x2e7b0d[_0x9edd('0xe5')]){case'0':ut[_0x9edd('0xe6')](_0x7512ea,0x0,_0x9edd('0x7f'));rpcDb[_0x9edd('0xe7')](_0x7512ea,_0x9edd('0xe8'));break;case'3':ut[_0x9edd('0xe6')](_0x7512ea,0x3,_0x9edd('0xb7'));rpcDb[_0x9edd('0xe7')](_0x7512ea,_0x9edd('0xe9'));break;case'5':ut[_0x9edd('0xe6')](_0x7512ea,0x5,_0x9edd('0xea'));rpcDb[_0x9edd('0xe7')](_0x7512ea,_0x9edd('0xeb'));break;case'8':ut[_0x9edd('0xe6')](_0x7512ea,0x8,'Congestion');rpcDb[_0x9edd('0xe7')](_0x7512ea,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x9edd('0xe6')](_0x7512ea,0x16,_0x9edd('0xec'));rpcDb[_0x9edd('0xe7')](_0x7512ea,_0x9edd('0xed'));break;default:ut[_0x9edd('0xe6')](_0x7512ea,0xc,_0x2e7b0d['reason']);rpcDb[_0x9edd('0xe7')](_0x7512ea,'[callProgressDetectingAgent][logCongestion]');}ut[_0x9edd('0x54')](_0x1c5038,_0x9edd('0xee'));logger[_0x9edd('0x46')](_0x9edd('0xef'),_0x7512ea[_0x9edd('0x94')],_0x9edd('0x95'),_0x1c5038['name'],_0x9edd('0x49'),_0x1c5038[_0x9edd('0x2c')]);delete this['actions'][_0x7512ea['uniqueid']];};Preview['prototype']['verifyAdditionalPhones']=function(_0x2a8525,_0x12707f,_0x2e1258){return cmHopperAdditionalPhone[_0x9edd('0x84')](_0x2a8525,_0x12707f,_0x2e1258)[_0x9edd('0x52')](logger[_0x9edd('0x46')](_0x9edd('0xf0')));};Preview[_0x9edd('0x10')][_0x9edd('0x90')]=function(_0x3cddf5,_0x5510a1,_0x361b57){return cmHopperAdditionalPhone['swapAdditionalPhones'](_0x3cddf5,_0x5510a1,_0x361b57)['catch'](logger[_0x9edd('0x46')](_0x9edd('0xf1')));};Preview[_0x9edd('0x10')][_0x9edd('0x8f')]=function(_0x3ee216){return Promise['resolve']()[_0x9edd('0x91')](cmHopperAdditionalPhone[_0x9edd('0x8f')](_0x3ee216))[_0x9edd('0x52')](logger[_0x9edd('0x46')]('[incrementPreviewCounters]\x20'));};Preview[_0x9edd('0x10')][_0x9edd('0xf2')]=function(_0x3df631,_0x236e7d,_0x30a1c5,_0x29fef9,_0x55052b){var _0x9ff2d3=this;return new Promise(function(_0x1eea2f,_0xa8c1f7){if(_[_0x9edd('0x45')](_0x236e7d)||_['isNil'](_0x236e7d[_0x9edd('0xf3')])||_[_0x9edd('0x45')](_0x236e7d[_0x9edd('0xf4')])||_[_0x9edd('0x45')](_0x236e7d[_0x9edd('0x4e')])){_0xa8c1f7(ut[_0x9edd('0x53')](_0x9edd('0xf5'),_0x29fef9,_0x55052b));return;}var _0x39e3b3=uuid['v4']();var _0x4a3955=_0x9ff2d3['campaignsPreview'][_0x236e7d['Queue'][_0x9edd('0x29')]];var _0x46041c=_0x30a1c5?_0x9ff2d3[_0x9edd('0x18')][_0x30a1c5]['id']:undefined;_0x9ff2d3[_0x9edd('0x17')][_0x39e3b3]=new Action(_0x236e7d,_0x4a3955,_0x39e3b3,_0x30a1c5,_0x46041c);var _0x223c42=_0x9ff2d3[_0x9edd('0x17')][_0x39e3b3];_0x223c42[_0x9edd('0xb3')]=_0x29fef9;_0x223c42[_0x9edd('0x8c')]=_0x55052b;_0x223c42[_0x9edd('0xf6')]=_0x30a1c5;if(_[_0x9edd('0xf7')](_0x3df631)){_0x9ff2d3['execCall'](_0x223c42,_0x4a3955,_0x236e7d,_0x30a1c5)[_0x9edd('0x91')](function(_0x56dc7e){logger['info'](_0x9edd('0xf8'),_0x9edd('0xf9')+_0x223c42[_0x9edd('0x48')]+'\x20IdHopper:\x20'+_0x223c42['idContact'],JSON['stringify'](_0x56dc7e));ami['emit']('custom:agentcalled',ut[_0x9edd('0x81')](_0x223c42,_0x9edd('0xfa'),_0x9ff2d3[_0x9edd('0x14')][_0x223c42['queue']]));_0x1eea2f(ut[_0x9edd('0x53')](_0x9edd('0xfb')));})[_0x9edd('0x52')](function(_0x557156){ut[_0x9edd('0x32')]('[Preview][execCall][failure]',_0x557156);_0xa8c1f7(ut[_0x9edd('0x53')](_0x9edd('0xfc'),_0x29fef9,_0x55052b));});}else{_0x4a3955[_0x9edd('0xfd')]+=0x1;ut[_0x9edd('0xfe')](_0x223c42);rpcDb['createHistory'](_0x223c42,_0x9edd('0xff'));delete _0x9ff2d3[_0x9edd('0x17')][_0x39e3b3];_0xa8c1f7(ut['message'](_0x9edd('0x100'),_0x29fef9,_0x55052b));}});};Preview[_0x9edd('0x10')][_0x9edd('0x78')]=function(_0x32fc90){return!_['isNil'](_0x32fc90)&&!_[_0x9edd('0x45')](_0x32fc90[_0x9edd('0x29')])&&!_[_0x9edd('0x45')](_0x32fc90[_0x9edd('0x101')])&&_0x32fc90[_0x9edd('0x101')]&&!_[_0x9edd('0x45')](this[_0x9edd('0x16')][util['format'](_0x9edd('0x102'),_0x32fc90['name'])])&&!_[_0x9edd('0x45')](this[_0x9edd('0x16')][util['format'](_0x9edd('0x102'),_0x32fc90[_0x9edd('0x29')])][_0x9edd('0x103')])&&(this['trunks'][util[_0x9edd('0x28')](_0x9edd('0x102'),_0x32fc90[_0x9edd('0x29')])]['status']===_0x9edd('0x104')||this['trunks'][util[_0x9edd('0x28')](_0x9edd('0x102'),_0x32fc90[_0x9edd('0x29')])][_0x9edd('0x103')]==='unmonitored');};Preview['prototype'][_0x9edd('0x63')]=function(_0x12f23f,_0x29d783){return this[_0x9edd('0x105')](_0x12f23f,_0x29d783)[_0x9edd('0x91')](function(_0x4b92fc){return _[_0x9edd('0x4c')](_0x4b92fc,[_0x9edd('0x53')]);})[_0x9edd('0x52')](function(_0x1a6dba){if(_0x1a6dba[_0x9edd('0x106')]){rpcDb[_0x9edd('0x107')](_0x12f23f);}if(_0x1a6dba[_0x9edd('0x101')]){rpcDb[_0x9edd('0x66')](_0x12f23f);}throw _[_0x9edd('0x4c')](_0x1a6dba,[_0x9edd('0x53')]);});};Preview[_0x9edd('0x10')][_0x9edd('0x105')]=function(_0x10fa41,_0x549cd6){var _0x213818=this;var _0x15d391,_0x404cc6;return rpcDb[_0x9edd('0x108')](_0x10fa41)['then'](function(_0x1d660d){if(!_[_0x9edd('0x45')](_0x1d660d[0x0])){_0x404cc6=_0x1d660d[0x0][_0x9edd('0x109')]?![]:!![];_0x15d391=_0x1d660d[0x0]['recallme']?!![]:![];_0x15d391=_0x549cd6?!![]:_0x15d391;}var _0x910adf=_0x213818['validateContact'](_0x1d660d);if(_0x910adf['isValid']){rpcDb[_0x9edd('0x10a')](_[_0x9edd('0x4c')](_0x1d660d[0x0],[_0x9edd('0x4e'),_0x9edd('0xf4')]))['then'](function(_0x1ead85){_0x213818[_0x9edd('0xf2')](_0x1ead85,_0x1d660d[0x0],_0x549cd6,_0x404cc6,_0x15d391)[_0x9edd('0x91')](function(_0x12a75d){return _0x12a75d;})[_0x9edd('0x52')](function(_0x38efe5){throw _0x38efe5;});})[_0x9edd('0x52')](function(_0x20e500){ut[_0x9edd('0x32')](_0x9edd('0x10b'),_0x20e500);throw ut[_0x9edd('0x53')](_0x9edd('0x10c'),_0x404cc6,_0x15d391);});}else{throw ut['message'](_0x910adf[_0x9edd('0x53')],_0x404cc6,_0x15d391);}})[_0x9edd('0x52')](function(_0x12b2c5){ut[_0x9edd('0x32')](_0x9edd('0x10d'),_0x12b2c5);throw ut['message'](_0x9edd('0x10c'),![],!![]);});};Preview['prototype'][_0x9edd('0x10e')]=function(_0x22fb1d){if(_['isNil'](_0x22fb1d)||_['isEmpty'](_0x22fb1d)||!_[_0x9edd('0x45')](_0x22fb1d[0x0][_0x9edd('0x61')])&&_[_0x9edd('0x45')](_0x22fb1d[0x0][_0x9edd('0x61')][_0x9edd('0x29')])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x22fb1d);return{'isValid':![],'message':_0x9edd('0x10f')};}var _0x2a10ba=this[_0x9edd('0x14')][_0x22fb1d[0x0][_0x9edd('0x47')]['name']];_0x2a10ba[_0x9edd('0x53')]=utils[_0x9edd('0x75')][_0x9edd('0x7b')];if(_[_0x9edd('0x45')](_0x2a10ba)){ut[_0x9edd('0x32')](_0x9edd('0x110'),_0x2a10ba);return{'isValid':![],'message':_0x9edd('0x111')};}if(!this['isTrunkReachable'](_0x2a10ba[_0x9edd('0x112')])){ut[_0x9edd('0x32')](_0x9edd('0x113'),_0x9edd('0x114')+_0x2a10ba[_0x9edd('0x29')]+_0x9edd('0x115'));if(!this[_0x9edd('0x78')](_0x2a10ba[_0x9edd('0x79')])){ut[_0x9edd('0x32')](_0x9edd('0x113'),_0x2a10ba[_0x9edd('0x29')]+_0x9edd('0x116'));return{'isValid':![],'message':_0x9edd('0x117')};}}if(!ut['isActive'](_0x2a10ba[_0x9edd('0x3f')])){ut[_0x9edd('0x32')](_0x9edd('0x118'),_0x2a10ba[_0x9edd('0x29')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x9edd('0x114')+_0x2a10ba[_0x9edd('0x29')]+_0x9edd('0x119')};}return{'isValid':!![],'message':_0x9edd('0x11a')};};Preview[_0x9edd('0x10')][_0x9edd('0x11b')]=function(_0xffe3c4,_0x26a224,_0x21ef16,_0x345d90){var _0x304e90=this;return new Promise(function(_0x524a47,_0x3627be){var _0x7916cf=_0xffe3c4[_0x9edd('0x94')];var _0x257dee=_0x304e90[_0x9edd('0x78')](_0x26a224[_0x9edd('0x112')])?util[_0x9edd('0x28')]('SIP/%s/%s%s',_0x26a224[_0x9edd('0x112')][_0x9edd('0x29')],_[_0x9edd('0x45')](_0x26a224[_0x9edd('0x11c')])?'':_0x26a224[_0x9edd('0x11c')][_0x9edd('0x11d')]()||'',_0x26a224[_0x9edd('0x11e')]>0x0?_0x21ef16[_0x9edd('0xf4')][_0x9edd('0x11f')](_0x26a224[_0x9edd('0x11e')]):_0x21ef16[_0x9edd('0xf4')]):util[_0x9edd('0x28')](_0x9edd('0x120'),_[_0x9edd('0x45')](_0x26a224[_0x9edd('0x79')])?_0x26a224[_0x9edd('0x112')][_0x9edd('0x29')]:_0x26a224['TrunkBackup'][_0x9edd('0x29')],_[_0x9edd('0x45')](_0x26a224[_0x9edd('0x11c')])?'':_0x26a224[_0x9edd('0x11c')][_0x9edd('0x11d')]()||'',_0x26a224[_0x9edd('0x11e')]>0x0?_0x21ef16[_0x9edd('0xf4')][_0x9edd('0x11f')](_0x26a224[_0x9edd('0x11e')]):_0x21ef16['phone']);var _0x12cb33=_0x304e90[_0x9edd('0x78')](_0x26a224[_0x9edd('0x112')])?ut['getCallerId'](_0x26a224[_0x9edd('0x112')]['callerid'],_0x26a224[_0x9edd('0x121')],_0x26a224['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x9edd('0x122')](_0x26a224[_0x9edd('0x123')],_0x26a224['dialRandomLastDigitCallerIdNumber']):_0x26a224[_0x9edd('0x123')]):ut[_0x9edd('0x124')](_[_0x9edd('0x45')](_0x26a224[_0x9edd('0x79')])?_0x26a224[_0x9edd('0x112')][_0x9edd('0x125')]:_0x26a224[_0x9edd('0x79')]['callerid'],_0x26a224[_0x9edd('0x121')],_0x26a224[_0x9edd('0x126')]>0x0?ut['getCallerIdRandom'](_0x26a224[_0x9edd('0x123')],_0x26a224['dialRandomLastDigitCallerIdNumber']):_0x26a224[_0x9edd('0x123')]);if(_0x12cb33){_0xffe3c4[_0x9edd('0x127')]=ut[_0x9edd('0x128')](_0x12cb33);_0xffe3c4[_0x9edd('0x129')]=ut[_0x9edd('0x12a')](_0x12cb33);}var _0x4629fd=ut[_0x9edd('0x12b')](_0x26a224,_0x21ef16,_0x257dee,_0x12cb33,_0x7916cf,_0xffe3c4);_[_0x9edd('0x12c')](_0xffe3c4,ut[_0x9edd('0x12d')](_0x4629fd));_0xffe3c4[_0x9edd('0x67')]=moment()[_0x9edd('0x28')](_0x9edd('0x92'));_0x26a224['variables']=_0x4629fd;var _0x5e9b74=ut[_0x9edd('0x12e')](_0xffe3c4,_0x26a224,_0x4629fd,_0xffe3c4[_0x9edd('0x8c')],_0x345d90);return ami[_0x9edd('0x50')](_0x5e9b74)[_0x9edd('0x91')](function(_0x34dd61){_0x26a224[_0x9edd('0x2c')]+=0x1;logger[_0x9edd('0x46')](_0x9edd('0x12f'),_0x7916cf,_0x9edd('0x95'),_0x26a224['name'],_0x9edd('0x49'),_0x26a224['originated']);_0x524a47(_0x34dd61);})[_0x9edd('0x52')](function(_0x44c0bb){ut[_0x9edd('0xe6')](_0xffe3c4,0xe,_0x9edd('0x130'));rpcDb[_0x9edd('0xe7')](_0xffe3c4,_0x9edd('0x131'));_0x3627be(_0x44c0bb);});});};Preview[_0x9edd('0x10')][_0x9edd('0x22')]=function(_0x39243e){if(this[_0x9edd('0x17')][_0x39243e[_0x9edd('0x8d')]]){this[_0x9edd('0x17')][_0x39243e[_0x9edd('0x8d')]][_0x9edd('0x51')]=_0x39243e[_0x9edd('0x51')];}};Preview[_0x9edd('0x10')][_0x9edd('0x1a')]=function(_0x2a515a){var _0x3f20b7=this;var _0x55bdaf=this['actions'][_0x2a515a[_0x9edd('0x132')]];if(_0x55bdaf){if(_0x55bdaf['lookAgent']&&this[_0x9edd('0x18')][_0x55bdaf[_0x9edd('0xf6')]]){ut[_0x9edd('0x133')](_0x55bdaf,this[_0x9edd('0x18')][_0x55bdaf['lookAgent']]['name'],this[_0x9edd('0x18')][_0x55bdaf[_0x9edd('0xf6')]]['id']);}var _0x7397cc=_[_0x9edd('0x134')](_0x55bdaf);_0x7397cc[_0x9edd('0x135')]=moment()['format'](_0x9edd('0x92'));var _0x48f055=_0x3f20b7[_0x9edd('0x14')][_0x55bdaf[_0x9edd('0x48')]];if(ut[_0x9edd('0x136')](_0x2a515a[_0x9edd('0x137')])){if(_0x55bdaf['unlockAgent']){rpcDb['unlockContact'](_0x55bdaf['idContact']);}if(_0x55bdaf[_0x9edd('0x8c')]){rpcDb[_0x9edd('0x66')](_0x55bdaf[_0x9edd('0x8e')]);}ami[_0x9edd('0x25')](_0x9edd('0x138'),ut[_0x9edd('0x81')](_0x55bdaf,'rejected',this[_0x9edd('0x14')][_0x55bdaf[_0x9edd('0x48')]]));this['callProgressDetectingAgent'](_0x7397cc,_0x48f055,_0x2a515a);}else{_0x55bdaf['starttime']=moment()[_0x9edd('0x28')](_0x9edd('0x92'));ut[_0x9edd('0xe6')](_0x7397cc,0x4,'Answer');rpcDb[_0x9edd('0xe7')](_0x7397cc,_0x9edd('0x139'));}}};Preview[_0x9edd('0x10')][_0x9edd('0x1d')]=function(_0x504550){var _0x3dd408=this[_0x9edd('0x17')][_0x504550[_0x9edd('0x8d')]];var _0x18924e;if(_0x3dd408){_0x18924e=this[_0x9edd('0x14')][_0x3dd408[_0x9edd('0x48')]];logger['info'](_0x9edd('0x13a'),_0x504550[_0x9edd('0x8d')],_0x9edd('0x95'),_0x18924e[_0x9edd('0x29')],'pTalking:\x20',_0x18924e['pTalking']);}if(this[_0x9edd('0x17')][_0x504550[_0x9edd('0x8d')]]&&_0x504550[_0x9edd('0x8d')]!==_0x504550[_0x9edd('0x94')]){if(_0x504550[_0x9edd('0x13b')]==='16'&&this[_0x9edd('0x17')][_0x504550[_0x9edd('0x8d')]][_0x9edd('0x4b')]){this[_0x9edd('0x13c')](_0x504550,_0x504550[_0x9edd('0x8d')],_0x504550[_0x9edd('0x13b')]);}else if(this[_0x9edd('0x17')][_0x504550['linkedid']]['dialAnswer']){logger[_0x9edd('0x46')](_0x9edd('0x13d'),_0x504550[_0x9edd('0x8d')],_0x504550[_0x9edd('0x13b')],_0x9edd('0x95'),_0x18924e[_0x9edd('0x29')],_0x9edd('0x4a'),_0x18924e[_0x9edd('0x2d')]);this['callProgressDetectingCustomer'](_0x504550,_0x504550[_0x9edd('0x8d')],_0x504550[_0x9edd('0x13b')]);}}else if(_0x3dd408&&_[_0x9edd('0x45')](_0x3dd408[_0x9edd('0x13e')])&&_0x18924e[_0x9edd('0x13f')]&&_0x504550[_0x9edd('0x8d')]===_0x504550['uniqueid']&&_['isNil'](_0x504550[_0x9edd('0xe5')])&&_0x504550[_0x9edd('0x13b')]==='16'&&_0x504550[_0x9edd('0x140')]==='6'&&_['isUndefined'](_0x3dd408['transfer'])){if(_0x3dd408[_0x9edd('0xb3')]){rpcDb[_0x9edd('0x107')](_0x3dd408[_0x9edd('0x8e')]);}if(_0x3dd408[_0x9edd('0x8c')]){rpcDb[_0x9edd('0x66')](_0x3dd408[_0x9edd('0x8e')]);}_0x504550[_0x9edd('0xe5')]='22';this[_0x9edd('0xe2')](_0x3dd408,_0x18924e,_0x504550);}else if(_0x3dd408&&_0x3dd408[_0x9edd('0x141')]){if(_0x504550[_0x9edd('0x13b')]==='16'&&this[_0x9edd('0x17')][_0x504550['linkedid']][_0x9edd('0x4b')]){logger['info']('[syncHangup][talking][transfer]',_0x504550['linkedid'],_0x504550[_0x9edd('0x13b')],_0x9edd('0x95'),_0x18924e['name'],'pTalking:\x20',_0x18924e['pTalking']);this['callProgressDetectingCustomer'](_0x504550,_0x504550[_0x9edd('0x8d')],_0x504550[_0x9edd('0x13b')]);}else if(this[_0x9edd('0x17')][_0x504550['linkedid']][_0x9edd('0x4b')]){logger[_0x9edd('0x46')](_0x9edd('0x13d'),_0x504550[_0x9edd('0x8d')],_0x504550[_0x9edd('0x13b')],'\x20Queue',_0x18924e[_0x9edd('0x29')],'pTalking:\x20',_0x18924e[_0x9edd('0x2d')]);this['callProgressDetectingCustomer'](_0x504550,_0x504550[_0x9edd('0x8d')],_0x504550[_0x9edd('0x13b')]);}}};Preview[_0x9edd('0x10')]['syncDialEnd']=function(_0x2ef921){if(this[_0x9edd('0x17')][_0x2ef921[_0x9edd('0xe0')]]&&_0x2ef921['destlinkedid']!==_0x2ef921['destuniqueid']){this[_0x9edd('0x13c')](_0x2ef921,_0x2ef921[_0x9edd('0xe0')],_0x2ef921[_0x9edd('0xd6')]);}};Preview[_0x9edd('0x10')][_0x9edd('0x1f')]=function(_0x83693e){if(this[_0x9edd('0x17')][_0x83693e[_0x9edd('0x8d')]]&&_0x83693e[_0x9edd('0x8d')]!==_0x83693e[_0x9edd('0x94')]&&!this['actions'][_0x83693e[_0x9edd('0x8d')]][_0x9edd('0x4b')]){if(_0x83693e['cause']==='1'){this['callProgressDetectingCustomer'](_0x83693e,_0x83693e[_0x9edd('0x8d')],_0x83693e[_0x9edd('0x13b')]);}}};Preview[_0x9edd('0x10')][_0x9edd('0x142')]=function(_0x5eec20,_0xc23db6,_0x33a71d){if(this[_0x9edd('0x17')][_0x5eec20]){if(_[_0x9edd('0x45')](this['actions'][_0x5eec20][_0x9edd('0x143')])){this[_0x9edd('0x17')][_0x5eec20][_0x9edd('0x143')]={};}this['actions'][_0x5eec20][_0x9edd('0x143')][_0xc23db6]=_0x33a71d;}};Preview[_0x9edd('0x10')][_0x9edd('0x144')]=function(_0x307f73){try{if(!_[_0x9edd('0x45')](_0x307f73)){if(ut[_0x9edd('0x145')](_[_0x9edd('0x146')](_0x307f73['variable'])[0x0])){this[_0x9edd('0x142')](_0x307f73[_0x9edd('0x94')],_['keys'](_0x307f73[_0x9edd('0x147')])[0x0],_0x307f73['value']);}}}catch(_0x5a43af){logger[_0x9edd('0x148')](_0x9edd('0x149'),util[_0x9edd('0x14a')](_0x5a43af,{'showHidden':![],'depth':null}));}};Preview[_0x9edd('0x10')][_0x9edd('0x24')]=function(_0x3109ba){if(_0x3109ba){if(this[_0x9edd('0x17')][_0x3109ba[_0x9edd('0x14b')]]){this[_0x9edd('0x17')][_0x3109ba[_0x9edd('0x14b')]][_0x9edd('0x141')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x211e79){if(_0x211e79){if(this[_0x9edd('0x17')][_0x211e79[_0x9edd('0x14c')]]){this[_0x9edd('0x17')][_0x211e79[_0x9edd('0x14c')]][_0x9edd('0x141')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x34e8=['localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangupRequest','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopCampaigns','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','name','emit','voice_queue_presence:remove','sendMessageOneNotActive','originated','pTalking','available','paused','INACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','message','CAMPAIGN_STATUS','DEACTIVATED','syncCampaigns','hasOwnProperty','dialMethod','booked','outbound','clearZombieChannels','type','dialActive','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','[clearZombieChannels][talking]','Queue','actions','queue','originated:\x20','stringify','dialAnswer','VoiceQueueId','Action','status','channel','catch','No\x20such\x20channel','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[action]','agentReadyId','isNil','length','getDiff','scheduledat','Agent','voicePause','run','then','logger2','[RecallMe]','disableContact','starttime','format','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','setMessage','IsNotLoggedIn','loggedIn','NO_AGENTS_LOGGED','isActive','Trunk','TrunkBackup','UNREACHABLE_TRUNK','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','countnosuchnumberretry','countglobal','NoSuchNumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','verifyAdditionalPhones','additional','dialNoSuchNumberRetryFrequency','callAdditionalPhoneAfterMin','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','idContact','incrementPreviewCounters','swapAdditionalPhones','ANSWER','[syncHangup][talking][increment]','uniqueid','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','outboundAnswerCallsDay','answered','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','\x20Queue','linkedid','outboundBusyCallsDay','countbusyretry','Busy','dialBusyRetryFrequency','custom:agentbusy','[callProgressDetectingCustomer][logBusy]','[callProgressDetectingCustomer][logBusyGlobal]','outboundNoAnswerCallsDay','countnoanswerretry','buildNoAnswerEventPayload','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','outboundCongestionCallsDay','countcongestionretry','dialCongestionRetryFrequency','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','outboundRejectCallsDay','countagentrejectretry','custom:agentreject','agentreject','[syncHangupRequest][logAgentReject]','AgentReject','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','outboundUnknownCallsDay','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','queueSummaryCountersUpdated','callProgressDetectingAgent','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[verifyAdditionalPhone]\x20','[swapAdditionalPhone]\x20','[incrementPreviewCounters]\x20','checkInBlack','Contact','phone','Contact\x20is\x20undefined','isEmpty','execCall','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','called','Calling','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','isTrunkReachable','active','SIP/%s','reachable','unmonitored','unlock','unlockContact','pick','execRun','recallme','isValid','checkIsBlackList','logger','validateContact','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20working\x20correctly]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','dialOriginateCallerIdName','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variables','[originated][increment]','OriginateError','syncNewExten','syncOriginateResponse','lookAgent','logLookAgent','responsetime','isFailure','custom:agentringnoanswer','rejected','syncHangup','[syncHangup][talking]','cause','statedesc','isUndefined','[syncHangup][talking][transfer]','[syncHangup][talking][cause]','destuniqueid','filterKey','keys','addVariable','variable','value','error','inspect','transfertargetlinkedid','transfer','transfererlinkedid','exports','util','lodash','uuid','moment','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./action','../dialer/utils','redis','defaults'];(function(_0x5e2751,_0x518a55){var _0x139a39=function(_0x4802db){while(--_0x4802db){_0x5e2751['push'](_0x5e2751['shift']());}};_0x139a39(++_0x518a55);}(_0x34e8,0x12c));var _0x834e=function(_0x4ee0ec,_0xeb3765){_0x4ee0ec=_0x4ee0ec-0x0;var _0x590346=_0x34e8[_0x4ee0ec];return _0x590346;};'use strict';var util=require(_0x834e('0x0'));var _=require(_0x834e('0x1'));var uuid=require(_0x834e('0x2'));var moment=require(_0x834e('0x3'));var Redis=require('ioredis');var config=require(_0x834e('0x4'));var logger=require(_0x834e('0x5'))(_0x834e('0x6'));var loggerAction=require(_0x834e('0x5'))(_0x834e('0x7'));var ami=require(_0x834e('0x8'));var rpcDb=require(_0x834e('0x9'));var cmHopperAdditionalPhone=require('../rpc/cmHopperAdditionalPhone');var Action=require(_0x834e('0xa'));var ut=require('./util/util');var utils=require(_0x834e('0xb'));config[_0x834e('0xc')]=_[_0x834e('0xd')](config[_0x834e('0xc')],{'host':_0x834e('0xe'),'port':0x18eb});var io=require(_0x834e('0xf'))(new Redis(config[_0x834e('0xc')]));var Sequence=function(){};Sequence[_0x834e('0x10')][_0x834e('0x11')]=function(_0x186b3b){this[_0x834e('0x12')]=this[_0x834e('0x12')]?this[_0x834e('0x12')][_0x834e('0x13')](_0x186b3b):_0x186b3b();};function Preview(_0x293514){this[_0x834e('0x14')]=new Sequence();this[_0x834e('0x15')]=_0x293514['voiceQueues'];this[_0x834e('0x16')]=_0x293514[_0x834e('0x16')];this['actions']={};this[_0x834e('0x17')]=_0x293514[_0x834e('0x17')];this[_0x834e('0x18')]=0x0;ami['on'](_0x834e('0x19'),this['syncOriginateResponse'][_0x834e('0x1a')](this));ami['on'](_0x834e('0x1b'),this['syncHangup'][_0x834e('0x1a')](this));ami['on']('hanguprequest',this[_0x834e('0x1c')][_0x834e('0x1a')](this));ami['on']('dialend',this[_0x834e('0x1d')][_0x834e('0x1a')](this));ami['on'](_0x834e('0x1e'),this['syncNewExten'][_0x834e('0x1a')](this));ami['on'](_0x834e('0x1f'),this[_0x834e('0x20')][_0x834e('0x1a')](this));ami['on'](_0x834e('0x21'),this[_0x834e('0x22')][_0x834e('0x1a')](this));ami['on']('blindtransfer',this[_0x834e('0x23')][_0x834e('0x1a')](this));this[_0x834e('0x24')](this[_0x834e('0x15')]);}function emit(_0x4ab05d,_0x45a630,_0x62f8f1){io['to'](_0x4ab05d)['emit'](_0x45a630,_0x62f8f1);}function emitVoiceQueueChannelRemove(_0x1b4bdf){logger[_0x834e('0x25')](_0x834e('0x26'),JSON['stringify'](_0x1b4bdf));emit(util['format'](_0x834e('0x27'),_0x1b4bdf[_0x834e('0x28')]),'voice_queue_channel:remove',_0x1b4bdf);io[_0x834e('0x29')](_0x834e('0x2a'),_0x1b4bdf);}function notSendMessagesQueue(_0x58f4fd){if(_0x58f4fd[_0x834e('0x2b')]){if(_0x58f4fd[_0x834e('0x2c')]===0x0&&_0x58f4fd[_0x834e('0x2d')]===0x0){_0x58f4fd['sendMessageOneNotActive']=![];_0x58f4fd[_0x834e('0x2e')]=0x0;_0x58f4fd[_0x834e('0x2f')]=0x0;_0x58f4fd['message']=utils['CAMPAIGN_STATUS'][_0x834e('0x30')];ut['logger'](_0x834e('0x31'),_0x58f4fd[_0x834e('0x28')]+_0x834e('0x32'));}else{_0x58f4fd[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x35')];ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x58f4fd['name']+'\x20is\x20deactivated');}}}Preview[_0x834e('0x10')][_0x834e('0x24')]=function(){var _0x106d6a=this;setInterval(function(){_0x106d6a['syncCampaigns']();},0x7cf);};Preview[_0x834e('0x10')][_0x834e('0x36')]=function(){var _0x1f3671=this[_0x834e('0x15')];this[_0x834e('0x18')]+=0x1;for(var _0x390119 in _0x1f3671){if(_0x1f3671[_0x834e('0x37')](_0x390119)&&(_0x1f3671[_0x390119][_0x834e('0x38')]===_0x834e('0x6')||_0x1f3671[_0x390119]['dialMethod']===_0x834e('0x39'))&&_0x1f3671[_0x390119]['type']===_0x834e('0x3a')){if(this[_0x834e('0x18')]>0x7){this[_0x834e('0x18')]=0x0;this[_0x834e('0x3b')]();}}if(_0x1f3671[_0x834e('0x37')](_0x390119)&&_0x1f3671[_0x390119][_0x834e('0x38')]===_0x834e('0x6')&&_0x1f3671[_0x390119][_0x834e('0x3c')]===_0x834e('0x3a')){if(_0x1f3671[_0x390119][_0x834e('0x3d')]){this['setMessage'](_0x1f3671[_0x390119]);if(_0x1f3671[_0x390119][_0x834e('0x3e')])this[_0x834e('0x3f')](_0x1f3671[_0x390119]);}else{notSendMessagesQueue(_0x1f3671[_0x390119]);}}}};Preview[_0x834e('0x10')][_0x834e('0x40')]=function(_0x595cc0){var _0x3f88ad=this;this[_0x834e('0x14')]['enqueue'](function(){if(!_['isNil'](_0x3f88ad['actions'][_0x595cc0])){loggerAction[_0x834e('0x25')](_0x834e('0x41'),_0x595cc0,_0x834e('0x42'),_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x44')],_0x834e('0x45'),JSON['stringify'](_0x3f88ad[_0x834e('0x15')][_0x3f88ad['actions'][_0x595cc0][_0x834e('0x44')]][_0x834e('0x2c')]),'pTalking:\x20',JSON[_0x834e('0x46')](_0x3f88ad[_0x834e('0x15')][_0x3f88ad['actions'][_0x595cc0]['queue']][_0x834e('0x2d')]),JSON[_0x834e('0x46')](_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x47')]),JSON[_0x834e('0x46')](_['pick'](_0x3f88ad[_0x834e('0x43')][_0x595cc0],['contactId','UserId',_0x834e('0x48'),'ListId'])));return ami[_0x834e('0x49')]({'action':_0x834e('0x4a'),'channel':_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x4b')]})[_0x834e('0x4c')](function(_0x574ea8){if(_0x574ea8[_0x834e('0x33')]===_0x834e('0x4d')){setTimeout(function(){if(_0x3f88ad[_0x834e('0x43')][_0x595cc0]){ut['updateOriginated'](_0x3f88ad[_0x834e('0x15')][_0x3f88ad[_0x834e('0x43')][_0x595cc0]['queue']],_0x834e('0x4e'));if(_0x3f88ad['actions'][_0x595cc0][_0x834e('0x47')]===!![]){ut[_0x834e('0x4f')](_0x3f88ad['campaignsPreview'][_0x3f88ad['actions'][_0x595cc0][_0x834e('0x44')]],_0x834e('0x4e'));ut[_0x834e('0x50')](_0x834e('0x51')+_0x595cc0,_0x3f88ad[_0x834e('0x43')][_0x595cc0][_0x834e('0x44')]);}ut[_0x834e('0x50')]('[Dialer][checkChannel][Preview]'+_0x595cc0,_0x3f88ad[_0x834e('0x43')][_0x595cc0]['queue']);delete _0x3f88ad[_0x834e('0x43')][_0x595cc0];}},0x2328);}});}});};Preview['prototype'][_0x834e('0x3b')]=function(){var _0x5a5807=this;loggerAction[_0x834e('0x25')](_0x834e('0x52'),_['size'](this[_0x834e('0x43')]));for(var _0x3f2321 in this[_0x834e('0x43')]){if(_0x5a5807[_0x834e('0x43')][_0x834e('0x37')](_0x3f2321)){_0x5a5807[_0x834e('0x40')](_0x3f2321);}}};Preview[_0x834e('0x10')][_0x834e('0x3f')]=function(_0x5dc63b){var _0x279ea1=this;rpcDb['getContactRecallMe'](_0x5dc63b['id'],ut[_0x834e('0x53')](this[_0x834e('0x17')]))['then'](function(_0x112306){if(!_[_0x834e('0x54')](_0x112306)){for(var _0x25b035=0x0;_0x25b035<_0x112306[_0x834e('0x55')];_0x25b035+=0x1){if(ut[_0x834e('0x56')](_0x112306[_0x25b035][_0x834e('0x57')])<_0x5dc63b['dialRecallMeTimeout']*0x3c){if(_0x112306[_0x25b035]['Agent']&&!_0x112306[_0x25b035][_0x834e('0x58')][_0x834e('0x59')]){_0x279ea1[_0x834e('0x5a')](_0x112306[_0x25b035]['id'])[_0x834e('0x5b')](ut[_0x834e('0x5c')](_0x834e('0x5d')))[_0x834e('0x4c')](ut[_0x834e('0x5c')](_0x834e('0x5d')));}else{rpcDb[_0x834e('0x5e')](_0x112306[_0x25b035]['id']);}}else{var _0xf02f0d=new Action(_0x112306[_0x25b035],_0x5dc63b);_0xf02f0d[_0x834e('0x5f')]=moment()[_0x834e('0x60')](_0x834e('0x61'));_0x5dc63b[_0x834e('0x62')]+=0x1;ut[_0x834e('0x63')](_0xf02f0d,0x17,_0x834e('0x64'));if(_0x5dc63b[_0x834e('0x65')]){rpcDb[_0x834e('0x66')](ut[_0x834e('0x67')](_0x112306[_0x25b035]));rpcDb['createCustomerHistory'](_0xf02f0d,_0x834e('0x68'));}else{ut[_0x834e('0x63')](_0xf02f0d,0x16,'RecallFailedTimeout');rpcDb[_0x834e('0x69')](_0xf02f0d,_0x834e('0x6a'));rpcDb['createCustomerFinal'](_0xf02f0d,_0x834e('0x6a'));}}}}})[_0x834e('0x4c')](ut[_0x834e('0x5c')](_0x834e('0x6b')));};Preview[_0x834e('0x10')][_0x834e('0x6c')]=function(_0x4549ba){_0x4549ba['sendMessageOneNotActive']=!![];if(ut[_0x834e('0x6d')](_0x4549ba[_0x834e('0x6e')])){_0x4549ba[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x6f')];}else if(!ut[_0x834e('0x70')](_0x4549ba[_0x834e('0x3d')])){_0x4549ba[_0x834e('0x33')]=utils['CAMPAIGN_STATUS'][_0x834e('0x30')];}else if(!this['isTrunkReachable'](_0x4549ba[_0x834e('0x71')])){if(!this['isTrunkReachable'](_0x4549ba[_0x834e('0x72')])){_0x4549ba['message']=utils['CAMPAIGN_STATUS'][_0x834e('0x73')];}else{_0x4549ba[_0x834e('0x33')]=utils['CAMPAIGN_STATUS']['ACTIVE'];}}else{_0x4549ba[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x74')];}};Preview[_0x834e('0x10')][_0x834e('0x75')]=function(_0x315858,_0x3d3f2b,_0x4273f1){var _0x528e66=this;var _0x142334=this[_0x834e('0x43')][_0x3d3f2b];var _0x5d5ac2=this[_0x834e('0x15')][_0x142334['queue']];var _0x3e58ef;var _0x45eceb=![];var _0x5160c4=0x2;var _0x41ef86=0x3;if(_0x5d5ac2){switch(_0x4273f1){case'1':_0x5d5ac2[_0x834e('0x76')]+=0x1;_0x142334[_0x834e('0x77')]+=0x1;_0x142334[_0x834e('0x78')]=ut['totalGlobal'](_0x142334);ut[_0x834e('0x63')](_0x142334,0x0,_0x834e('0x79'));ami[_0x834e('0x29')]('custom:agentnosuchnumber',ut[_0x834e('0x7a')](_0x142334,_0x834e('0x7b')));rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0x7c'));_0x528e66[_0x834e('0x7d')](_0x142334,'0',_0x5d5ac2)[_0x834e('0x5b')](function(_0x3a1426){_0x45eceb=_0x3a1426[_0x834e('0x7e')]==0x1;_0x5160c4=_0x5d5ac2[_0x834e('0x7f')];_0x41ef86=_0x5d5ac2[_0x834e('0x80')];if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0x86'));}else{if(_0x142334[_0x834e('0x77')]>=_0x5d5ac2[_0x834e('0x87')]){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0x86'));}else{rpcDb[_0x834e('0x88')](ut[_0x834e('0x89')](_0x142334,'countnosuchnumberretry',_0x5d5ac2[_0x834e('0x7f')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}delete this[_0x834e('0x43')][_0x315858['linkedid']];}else{_0x142334[_0x834e('0x77')]++;logger['info']('actioncountonusuch',_0x142334[_0x834e('0x77')]);logger[_0x834e('0x25')]('id',_0x142334[_0x834e('0x8c')]);_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnosuchnumberretry':_0x142334[_0x834e('0x77')]}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});});}});break;case _0x834e('0x8f'):var _0x5a99e6=moment()[_0x834e('0x60')](_0x834e('0x61'));_0x142334['responsetime']=_0x5a99e6;_0x142334['answertime']=_0x5a99e6;_0x142334[_0x834e('0x47')]=!![];_0x5d5ac2[_0x834e('0x2d')]+=0x1;logger[_0x834e('0x25')](_0x834e('0x90'),_0x142334[_0x834e('0x91')],'\x20Queue',_0x5d5ac2[_0x834e('0x28')],_0x834e('0x92'),_0x5d5ac2[_0x834e('0x2d')]);ami[_0x834e('0x29')](_0x834e('0x93'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0x94'),this[_0x834e('0x15')][_0x142334[_0x834e('0x44')]]));if(_0x5d5ac2[_0x834e('0x95')]){ami['emit'](_0x834e('0x96'),ut[_0x834e('0x97')](_0x142334));}break;case'16':ami[_0x834e('0x29')](_0x834e('0x98'),ut['buildObj'](_0x142334,_0x834e('0x99'),this['campaignsPreview'][_0x142334['queue']]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x142334,_0x834e('0x99')));_0x5d5ac2[_0x834e('0x9a')]+=0x1;_0x5d5ac2['total']+=0x1;_0x5d5ac2[_0x834e('0x9b')]+=0x1;ut[_0x834e('0x4f')](_0x5d5ac2,'[16]');_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut['logCustomer'](_0x142334,0x4,'Answer');rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0x9c'));rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0x9d'));rpcDb[_0x834e('0x9e')](_0x142334);_0x5d5ac2['sumDuration']+=_0x142334[_0x834e('0x9f')];_0x5d5ac2['sumBillable']+=_0x142334[_0x834e('0x9f')];logger[_0x834e('0x25')](_0x834e('0xa0'),_0x142334['uniqueid'],_0x834e('0xa1'),_0x5d5ac2[_0x834e('0x28')],'pTalking:\x20',_0x5d5ac2[_0x834e('0x2d')]);delete this[_0x834e('0x43')][_0x315858[_0x834e('0xa2')]];break;case'BUSY':_0x5d5ac2[_0x834e('0xa3')]+=0x1;_0x142334[_0x834e('0xa4')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x5,_0x834e('0xa5'));_0x5160c4=_0x5d5ac2[_0x834e('0xa6')];_0x41ef86=_0x5d5ac2[_0x834e('0x80')];ami[_0x834e('0x29')](_0x834e('0xa7'),ut['buildObj'](_0x142334,'busy'));rpcDb['createCustomerHistory'](_0x142334,_0x834e('0xa8'));_0x528e66[_0x834e('0x7d')](_0x142334,'5',_0x5d5ac2)[_0x834e('0x5b')](function(_0x37fa2c){_0x45eceb=_0x37fa2c[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2['dialGlobalMaxRetry']){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xa9'));}else{if(_0x142334[_0x834e('0xa4')]>=_0x5d5ac2['dialBusyMaxRetry']){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xa8'));}else{rpcDb[_0x834e('0x88')](ut['scheduledAt'](_0x142334,_0x834e('0xa4'),_0x5d5ac2[_0x834e('0xa6')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xa4')]++;_0x528e66['incrementPreviewCounters']({'id':_0x142334['idContact'],'field':{'countbusyretry':_0x142334[_0x834e('0xa4')]}})[_0x834e('0x5b')](function(){_0x528e66['swapAdditionalPhones'](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});break;case'NOANSWER':_0x5d5ac2[_0x834e('0xaa')]+=0x1;_0x142334[_0x834e('0xab')]+=0x1;_0x142334[_0x834e('0x78')]=ut['totalGlobal'](_0x142334);ut[_0x834e('0x63')](_0x142334,0x3,'NoAnswer');_0x5160c4=_0x5d5ac2['dialNoAnswerRetryFrequency'];_0x41ef86=_0x5d5ac2['callAdditionalPhoneAfterMin'];var _0x6735e6=ut[_0x834e('0xac')](_0x142334,_0x5d5ac2);ami[_0x834e('0x29')](_0x834e('0xad'),_0x6735e6);rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0xae'));_0x528e66[_0x834e('0x7d')](_0x142334,'3',_0x5d5ac2)[_0x834e('0x5b')](function(_0x17e61a){_0x45eceb=_0x17e61a['additional']==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2['dialGlobalMaxRetry']){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xaf'));}else{if(_0x142334[_0x834e('0xab')]>=_0x5d5ac2[_0x834e('0xb0')]){rpcDb['createCustomerFinal'](_0x142334,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x834e('0x88')](ut[_0x834e('0x89')](_0x142334,'countnoanswerretry',_0x5d5ac2[_0x834e('0xb1')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334['idContact'],'field':{'countnoanswerretry':_0x142334[_0x834e('0xab')]}})[_0x834e('0x5b')](function(){_0x528e66['swapAdditionalPhones'](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});});}});break;case'CONGESTION':_0x5d5ac2[_0x834e('0xb2')]+=0x1;_0x142334[_0x834e('0xb3')]+=0x1;_0x142334['countglobal']=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x8,'Congestion');_0x5160c4=_0x5d5ac2[_0x834e('0xb4')];_0x41ef86=_0x5d5ac2['callAdditionalPhoneAfterMin'];ami['emit'](_0x834e('0xb5'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xb6')));rpcDb[_0x834e('0x69')](_0x142334,'[callProgressDetectingCustomer][logCongestion]');_0x528e66[_0x834e('0x7d')](_0x142334,'8',_0x5d5ac2)[_0x834e('0x5b')](function(_0x260934){_0x45eceb=_0x260934[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xb7'));}else{if(_0x142334[_0x834e('0xb3')]>=_0x5d5ac2[_0x834e('0xb8')]){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xb9'));}else{rpcDb[_0x834e('0x88')](ut[_0x834e('0x89')](_0x142334,_0x834e('0xb3'),_0x5d5ac2[_0x834e('0xa6')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xb3')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334['idContact'],'field':{'countcongestionretry':_0x142334[_0x834e('0xb3')]}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});break;case _0x834e('0xba'):_0x5d5ac2[_0x834e('0xbb')]+=0x1;_0x142334[_0x834e('0xbc')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut['logCustomer'](_0x142334,0x14,'AgentReject');_0x5160c4=_0x5d5ac2['dialAgentRejectRetryFrequency'];_0x41ef86=_0x5d5ac2[_0x834e('0x80')];ami['emit'](_0x834e('0xbd'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xbe')));rpcDb['createCustomerHistory'](_0x142334,_0x834e('0xbf'));_0x528e66[_0x834e('0x7d')](_0x142334,'20',_0x5d5ac2)[_0x834e('0x5b')](function(_0x1594ef){_0x45eceb=_0x1594ef[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2['dialGlobalMaxRetry']){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0x14,_0x834e('0xc0'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xc1'));}else{if(_0x142334[_0x834e('0xbc')]>=_0x5d5ac2['dialAgentRejectMaxRetry']){rpcDb['createCustomerFinal'](_0x142334,'[callProgressDetectingCustomer][logAgentReject]');}else{rpcDb['rescheduleContact'](ut[_0x834e('0x89')](_0x142334,_0x834e('0xbc'),_0x5d5ac2['dialAgentRejectRetryFrequency']),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334['countnoanswerretry']++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnoanswerretry':_0x142334[_0x834e('0xab')]}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});break;case'ABANDONED':_0x5d5ac2['outboundAbandonedCallsDay']+=0x1;_0x142334[_0x834e('0xc2')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut['logCustomer'](_0x142334,0xb,_0x834e('0xc3'));rpcDb[_0x834e('0x69')](_0x142334,'[callProgressDetectingCustomer][logAbandoned]');_0x528e66[_0x834e('0x7d')](_0x142334,'11',_0x5d5ac2)[_0x834e('0x5b')](function(_0x216d1f){_0x45eceb=_0x216d1f[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut['cloneAction'](_0x142334,0xf,'Global');rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xc4'));}else{if(_0x142334[_0x834e('0xc5')]>=_0x5d5ac2[_0x834e('0xc6')]){rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xc4'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x142334,_0x834e('0xc2'),_0x5d5ac2[_0x834e('0xc7')]),_0x142334[_0x834e('0x8a')],_0x142334[_0x834e('0x8b')]);}}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnoanswerretry':_0x142334['countnoanswerretry']}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});});}});break;case'18':_0x5d5ac2[_0x834e('0xc8')]+=0x1;_0x142334[_0x834e('0xc9')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x12,_0x315858[_0x834e('0xca')]||_0x315858[_0x834e('0xcb')]);ami[_0x834e('0x29')](_0x834e('0xcc'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xcd')));rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0xce'));_0x528e66[_0x834e('0x7d')](_0x142334,'18',_0x5d5ac2)['then'](function(_0x5f1e3b){_0x45eceb=_0x5f1e3b[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut['cloneAction'](_0x142334,0x12,_0x834e('0x84'));rpcDb['createCustomerFinal'](_0x3e58ef,_0x834e('0xce'));}else{rpcDb['createCustomerFinal'](_0x142334,_0x834e('0xce'));}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334[_0x834e('0x8c')],'field':{'countnoanswerretry':_0x142334['countnoanswerretry']}})[_0x834e('0x5b')](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});delete this[_0x834e('0x43')][_0x315858[_0x834e('0xa2')]];break;case'19':_0x5d5ac2[_0x834e('0xc8')]+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0x13,_0x315858[_0x834e('0xca')]||_0x315858[_0x834e('0xcb')]);ami[_0x834e('0x29')](_0x834e('0xcc'),ut[_0x834e('0x7a')](_0x142334,_0x834e('0xcd')));rpcDb[_0x834e('0x69')](_0x142334,_0x834e('0xcf'));_0x528e66['verifyAdditionalPhones'](_0x142334,'18',_0x5d5ac2)['then'](function(_0x2df814){_0x45eceb=_0x2df814[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut[_0x834e('0x81')](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,_0x834e('0xcf'));}else{rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xcf'));}}else{_0x142334[_0x834e('0xab')]++;_0x528e66[_0x834e('0x8d')]({'id':_0x142334['idContact'],'field':{'countnoanswerretry':_0x142334[_0x834e('0xab')]}})['then'](function(){_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)[_0x834e('0x5b')](function(){});});}});delete this[_0x834e('0x43')][_0x315858['linkedid']];break;default:if(_0x142334[_0x834e('0x47')]){ut[_0x834e('0x4f')](_0x5d5ac2,'[default]');ut['loggerError'](_0x834e('0xd0')+_0x5d5ac2[_0x834e('0x28')],_0x315858);}_0x5d5ac2['outboundUnknownCallsDay']+=0x1;_0x142334[_0x834e('0x78')]=ut[_0x834e('0x81')](_0x142334);ut[_0x834e('0x63')](_0x142334,0xc,_0x315858[_0x834e('0xca')]||_0x315858[_0x834e('0xcb')]);_0x5160c4=_0x5d5ac2['dialAgentRejectRetryFrequency'];_0x41ef86=_0x5d5ac2['callAdditionalPhoneAfterMin'];rpcDb[_0x834e('0x69')](_0x142334,'[callProgressDetectingCustomer][logUnknown]');_0x528e66['verifyAdditionalPhones'](_0x142334,'20',_0x5d5ac2)['then'](function(_0xac9d00){_0x45eceb=_0xac9d00[_0x834e('0x7e')]==0x1;if(!_0x45eceb){if(ut['totalGlobal'](_0x142334)>=_0x5d5ac2[_0x834e('0x82')]){_0x3e58ef=ut[_0x834e('0x83')](_0x142334,0xf,_0x834e('0x84'));rpcDb[_0x834e('0x85')](_0x3e58ef,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x834e('0x85')](_0x142334,_0x834e('0xd1'));}delete this[_0x834e('0x43')][_0x315858['linkedid']];}else{_0x528e66[_0x834e('0x8e')](_0x142334,_0x5160c4,_0x41ef86)['then'](function(){});}});}if(!(_0x142334[_0x834e('0x47')]&&_0x4273f1==='16')){ut['updateOriginated'](_0x5d5ac2,_0x834e('0xd2'));logger[_0x834e('0x25')]('[originated][decrement][callProgressDetectingCustomer]',_0x142334[_0x834e('0x91')],_0x834e('0xa1'),_0x5d5ac2[_0x834e('0x28')],_0x834e('0x45'),_0x5d5ac2[_0x834e('0x2c')]);}if(_0x4273f1!==_0x834e('0x8f')){delete this['actions'][_0x315858[_0x834e('0xa2')]];delete this[_0x834e('0x43')][_0x315858[_0x834e('0xd3')]];}_0x5d5ac2[_0x834e('0xd4')]=!![];}};Preview[_0x834e('0x10')][_0x834e('0xd5')]=function(_0x5d3c6d,_0x448420,_0x490a57){if(_['isUndefined'](_0x448420)&&_0x834e('0xd6')!==typeof _0x448420){return;}if(_['isUndefined'](_0x490a57)&&'object'!==typeof _0x490a57){return;}switch(_0x490a57[_0x834e('0xd7')]){case'0':ut[_0x834e('0xd8')](_0x5d3c6d,0x0,_0x834e('0x79'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xda'));break;case'3':ut[_0x834e('0xd8')](_0x5d3c6d,0x3,_0x834e('0xdb'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xdc'));break;case'5':ut[_0x834e('0xd8')](_0x5d3c6d,0x5,_0x834e('0xa5'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xdd'));break;case'8':ut[_0x834e('0xd8')](_0x5d3c6d,0x8,'Congestion');rpcDb[_0x834e('0xd9')](_0x5d3c6d,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x834e('0xd8')](_0x5d3c6d,0x16,_0x834e('0xde'));rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xdf'));break;default:ut['logAgent'](_0x5d3c6d,0xc,_0x490a57['reason']);rpcDb[_0x834e('0xd9')](_0x5d3c6d,_0x834e('0xe0'));}ut['updateOriginated'](_0x448420,_0x834e('0xe1'));logger[_0x834e('0x25')]('[originated][decrement][callProgressDetectingAgent]',_0x5d3c6d[_0x834e('0x91')],_0x834e('0xa1'),_0x448420[_0x834e('0x28')],_0x834e('0x45'),_0x448420['originated']);delete this['actions'][_0x5d3c6d['uniqueid']];};Preview['prototype'][_0x834e('0x7d')]=function(_0x3c4847,_0x47891e,_0x41ba0c){return cmHopperAdditionalPhone['verifyAdditionalPhones'](_0x3c4847,_0x47891e,_0x41ba0c)[_0x834e('0x4c')](logger[_0x834e('0x25')](_0x834e('0xe2')));};Preview[_0x834e('0x10')][_0x834e('0x8e')]=function(_0xfa6cdb,_0x3c775f,_0x4fc61d){return cmHopperAdditionalPhone[_0x834e('0x8e')](_0xfa6cdb,_0x3c775f,_0x4fc61d)[_0x834e('0x4c')](logger['info'](_0x834e('0xe3')));};Preview[_0x834e('0x10')]['incrementPreviewCounters']=function(_0x486c18){return Promise['resolve']()[_0x834e('0x5b')](cmHopperAdditionalPhone[_0x834e('0x8d')](_0x486c18))[_0x834e('0x4c')](logger['info'](_0x834e('0xe4')));};Preview[_0x834e('0x10')][_0x834e('0xe5')]=function(_0x17e729,_0x4b4f7c,_0xad7b72,_0x19cb0b,_0x13af70){var _0x8804a8=this;return new Promise(function(_0x102640,_0x48b6c4){if(_['isNil'](_0x4b4f7c)||_[_0x834e('0x54')](_0x4b4f7c[_0x834e('0xe6')])||_[_0x834e('0x54')](_0x4b4f7c[_0x834e('0xe7')])||_[_0x834e('0x54')](_0x4b4f7c[_0x834e('0x48')])){_0x48b6c4(ut[_0x834e('0x33')](_0x834e('0xe8'),_0x19cb0b,_0x13af70));return;}var _0x38151c=uuid['v4']();var _0x97a4b2=_0x8804a8[_0x834e('0x15')][_0x4b4f7c[_0x834e('0x42')][_0x834e('0x28')]];var _0x4b12cd=_0xad7b72?_0x8804a8[_0x834e('0x17')][_0xad7b72]['id']:undefined;_0x8804a8[_0x834e('0x43')][_0x38151c]=new Action(_0x4b4f7c,_0x97a4b2,_0x38151c,_0xad7b72,_0x4b12cd);var _0x3f5b2e=_0x8804a8[_0x834e('0x43')][_0x38151c];_0x3f5b2e['unlockAgent']=_0x19cb0b;_0x3f5b2e['activeContact']=_0x13af70;_0x3f5b2e['lookAgent']=_0xad7b72;if(_[_0x834e('0xe9')](_0x17e729)){_0x8804a8[_0x834e('0xea')](_0x3f5b2e,_0x97a4b2,_0x4b4f7c,_0xad7b72)[_0x834e('0x5b')](function(_0x23d7e6){logger[_0x834e('0x25')](_0x834e('0xeb'),_0x834e('0xec')+_0x3f5b2e[_0x834e('0x44')]+'\x20IdHopper:\x20'+_0x3f5b2e['idContact'],JSON['stringify'](_0x23d7e6));ami['emit'](_0x834e('0xed'),ut[_0x834e('0x7a')](_0x3f5b2e,_0x834e('0xee'),_0x8804a8[_0x834e('0x15')][_0x3f5b2e[_0x834e('0x44')]]));_0x102640(ut[_0x834e('0x33')](_0x834e('0xef')));})[_0x834e('0x4c')](function(_0x33757d){ut['logger']('[Preview][execCall][failure]',_0x33757d);_0x48b6c4(ut['message']('Call\x20failed',_0x19cb0b,_0x13af70));});}else{_0x97a4b2[_0x834e('0xf0')]+=0x1;ut[_0x834e('0xf1')](_0x3f5b2e);rpcDb[_0x834e('0xf2')](_0x3f5b2e,_0x834e('0xf3'));delete _0x8804a8[_0x834e('0x43')][_0x38151c];_0x48b6c4(ut[_0x834e('0x33')](_0x834e('0xf4'),_0x19cb0b,_0x13af70));}});};Preview[_0x834e('0x10')][_0x834e('0xf5')]=function(_0xcd64c2){return!_[_0x834e('0x54')](_0xcd64c2)&&!_[_0x834e('0x54')](_0xcd64c2[_0x834e('0x28')])&&!_[_0x834e('0x54')](_0xcd64c2[_0x834e('0xf6')])&&_0xcd64c2[_0x834e('0xf6')]&&!_['isNil'](this[_0x834e('0x16')][util['format'](_0x834e('0xf7'),_0xcd64c2[_0x834e('0x28')])])&&!_[_0x834e('0x54')](this['trunks'][util[_0x834e('0x60')](_0x834e('0xf7'),_0xcd64c2['name'])]['status'])&&(this[_0x834e('0x16')][util[_0x834e('0x60')](_0x834e('0xf7'),_0xcd64c2[_0x834e('0x28')])][_0x834e('0x4a')]===_0x834e('0xf8')||this[_0x834e('0x16')][util[_0x834e('0x60')]('SIP/%s',_0xcd64c2[_0x834e('0x28')])][_0x834e('0x4a')]===_0x834e('0xf9'));};Preview[_0x834e('0x10')][_0x834e('0x5a')]=function(_0x614e15,_0x17aaae){return this['execRun'](_0x614e15,_0x17aaae)[_0x834e('0x5b')](function(_0x59e298){return _['pick'](_0x59e298,[_0x834e('0x33')]);})[_0x834e('0x4c')](function(_0x4b16fa){if(_0x4b16fa[_0x834e('0xfa')]){rpcDb[_0x834e('0xfb')](_0x614e15);}if(_0x4b16fa['active']){rpcDb[_0x834e('0x5e')](_0x614e15);}throw _[_0x834e('0xfc')](_0x4b16fa,['message']);});};Preview['prototype'][_0x834e('0xfd')]=function(_0x2ec9f1,_0x4e6525){var _0x58a935=this;var _0x269ff6,_0xa496aa;return rpcDb['getContactPreview'](_0x2ec9f1)['then'](function(_0x495352){if(!_['isNil'](_0x495352[0x0])){_0xa496aa=_0x495352[0x0][_0x834e('0xfe')]?![]:!![];_0x269ff6=_0x495352[0x0]['recallme']?!![]:![];_0x269ff6=_0x4e6525?!![]:_0x269ff6;}var _0x3be4c3=_0x58a935['validateContact'](_0x495352);if(_0x3be4c3[_0x834e('0xff')]){rpcDb[_0x834e('0x100')](_[_0x834e('0xfc')](_0x495352[0x0],[_0x834e('0x48'),'phone']))[_0x834e('0x5b')](function(_0x446d89){_0x58a935[_0x834e('0xe5')](_0x446d89,_0x495352[0x0],_0x4e6525,_0xa496aa,_0x269ff6)[_0x834e('0x5b')](function(_0x3a3a6c){return _0x3a3a6c;})[_0x834e('0x4c')](function(_0x3d8abb){throw _0x3d8abb;});})[_0x834e('0x4c')](function(_0x464ae6){ut[_0x834e('0x101')]('[Preview][checkIsBlackList]',_0x464ae6);throw ut[_0x834e('0x33')]('Call\x20unsuccessful',_0xa496aa,_0x269ff6);});}else{throw ut[_0x834e('0x33')](_0x3be4c3[_0x834e('0x33')],_0xa496aa,_0x269ff6);}})[_0x834e('0x4c')](function(_0x31a7ae){ut[_0x834e('0x101')]('[Preview][getContactPreview]',_0x31a7ae);throw ut[_0x834e('0x33')]('Call\x20unsuccessful',![],!![]);});};Preview['prototype'][_0x834e('0x102')]=function(_0x30ecb9){if(_[_0x834e('0x54')](_0x30ecb9)||_['isEmpty'](_0x30ecb9)||!_[_0x834e('0x54')](_0x30ecb9[0x0][_0x834e('0x58')])&&_[_0x834e('0x54')](_0x30ecb9[0x0][_0x834e('0x58')][_0x834e('0x28')])){ut[_0x834e('0x101')](_0x834e('0x103'),_0x30ecb9);return{'isValid':![],'message':_0x834e('0x104')};}var _0x125787=this[_0x834e('0x15')][_0x30ecb9[0x0][_0x834e('0x42')]['name']];_0x125787[_0x834e('0x33')]=utils[_0x834e('0x34')][_0x834e('0x74')];if(_[_0x834e('0x54')](_0x125787)){ut[_0x834e('0x101')](_0x834e('0x105'),_0x125787);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x834e('0xf5')](_0x125787[_0x834e('0x71')])){ut[_0x834e('0x101')](_0x834e('0x106'),_0x834e('0x107')+_0x125787[_0x834e('0x28')]+_0x834e('0x108'));if(!this[_0x834e('0xf5')](_0x125787[_0x834e('0x72')])){ut[_0x834e('0x101')]('[Preview][validateContact][Trunk\x20not\x20working\x20correctly]',_0x125787['name']+_0x834e('0x109'));return{'isValid':![],'message':'Trunk\x20not\x20working\x20correctly'};}}if(!ut[_0x834e('0x70')](_0x125787[_0x834e('0x3d')])){ut[_0x834e('0x101')](_0x834e('0x10a'),_0x125787[_0x834e('0x28')]+_0x834e('0x10b'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x125787[_0x834e('0x28')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0x834e('0xea')]=function(_0x3b9429,_0x52cdd5,_0x5cb379,_0x494e08){var _0x2515f6=this;return new Promise(function(_0x45c8e6,_0x3512d8){var _0x5e0bfe=_0x3b9429[_0x834e('0x91')];var _0x21cb1d=_0x2515f6[_0x834e('0xf5')](_0x52cdd5[_0x834e('0x71')])?util[_0x834e('0x60')](_0x834e('0x10c'),_0x52cdd5['Trunk']['name'],_['isNil'](_0x52cdd5['dialPrefix'])?'':_0x52cdd5[_0x834e('0x10d')][_0x834e('0x10e')]()||'',_0x52cdd5[_0x834e('0x10f')]>0x0?_0x5cb379[_0x834e('0xe7')][_0x834e('0x110')](_0x52cdd5[_0x834e('0x10f')]):_0x5cb379[_0x834e('0xe7')]):util[_0x834e('0x60')](_0x834e('0x10c'),_[_0x834e('0x54')](_0x52cdd5[_0x834e('0x72')])?_0x52cdd5[_0x834e('0x71')][_0x834e('0x28')]:_0x52cdd5[_0x834e('0x72')][_0x834e('0x28')],_['isNil'](_0x52cdd5['dialPrefix'])?'':_0x52cdd5[_0x834e('0x10d')][_0x834e('0x10e')]()||'',_0x52cdd5[_0x834e('0x10f')]>0x0?_0x5cb379['phone'][_0x834e('0x110')](_0x52cdd5[_0x834e('0x10f')]):_0x5cb379[_0x834e('0xe7')]);var _0x431f18=_0x2515f6[_0x834e('0xf5')](_0x52cdd5[_0x834e('0x71')])?ut[_0x834e('0x111')](_0x52cdd5[_0x834e('0x71')][_0x834e('0x112')],_0x52cdd5['dialOriginateCallerIdName'],_0x52cdd5[_0x834e('0x113')]>0x0?ut[_0x834e('0x114')](_0x52cdd5[_0x834e('0x115')],_0x52cdd5[_0x834e('0x113')]):_0x52cdd5['dialOriginateCallerIdNumber']):ut[_0x834e('0x111')](_[_0x834e('0x54')](_0x52cdd5[_0x834e('0x72')])?_0x52cdd5[_0x834e('0x71')][_0x834e('0x112')]:_0x52cdd5[_0x834e('0x72')][_0x834e('0x112')],_0x52cdd5[_0x834e('0x116')],_0x52cdd5[_0x834e('0x113')]>0x0?ut['getCallerIdRandom'](_0x52cdd5[_0x834e('0x115')],_0x52cdd5['dialRandomLastDigitCallerIdNumber']):_0x52cdd5[_0x834e('0x115')]);if(_0x431f18){_0x3b9429['originatecalleridname']=ut[_0x834e('0x117')](_0x431f18);_0x3b9429[_0x834e('0x118')]=ut[_0x834e('0x119')](_0x431f18);}var _0x2d2268=ut[_0x834e('0x11a')](_0x52cdd5,_0x5cb379,_0x21cb1d,_0x431f18,_0x5e0bfe,_0x3b9429);_['merge'](_0x3b9429,ut[_0x834e('0x11b')](_0x2d2268));_0x3b9429[_0x834e('0x5f')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x52cdd5[_0x834e('0x11c')]=_0x2d2268;var _0x4db3c5=ut['variablesAction'](_0x3b9429,_0x52cdd5,_0x2d2268,_0x3b9429['activeContact'],_0x494e08);return ami[_0x834e('0x49')](_0x4db3c5)[_0x834e('0x5b')](function(_0xbd9400){_0x52cdd5[_0x834e('0x2c')]+=0x1;logger[_0x834e('0x25')](_0x834e('0x11d'),_0x5e0bfe,_0x834e('0xa1'),_0x52cdd5['name'],_0x834e('0x45'),_0x52cdd5[_0x834e('0x2c')]);_0x45c8e6(_0xbd9400);})['catch'](function(_0x5df60f){ut[_0x834e('0xd8')](_0x3b9429,0xe,_0x834e('0x11e'));rpcDb['createAgentHistory'](_0x3b9429,'[originateFailure][logOriginateFailure]');_0x3512d8(_0x5df60f);});});};Preview[_0x834e('0x10')][_0x834e('0x11f')]=function(_0x42305c){if(this['actions'][_0x42305c[_0x834e('0xa2')]]){this[_0x834e('0x43')][_0x42305c[_0x834e('0xa2')]]['channel']=_0x42305c[_0x834e('0x4b')];}};Preview['prototype'][_0x834e('0x120')]=function(_0x1debf7){var _0x3a1328=this;var _0x10971d=this[_0x834e('0x43')][_0x1debf7['actionid']];if(_0x10971d){if(_0x10971d[_0x834e('0x121')]&&this[_0x834e('0x17')][_0x10971d[_0x834e('0x121')]]){ut[_0x834e('0x122')](_0x10971d,this[_0x834e('0x17')][_0x10971d['lookAgent']]['name'],this[_0x834e('0x17')][_0x10971d[_0x834e('0x121')]]['id']);}var _0x13d670=_['clone'](_0x10971d);_0x13d670[_0x834e('0x123')]=moment()[_0x834e('0x60')](_0x834e('0x61'));var _0x386b73=_0x3a1328['campaignsPreview'][_0x10971d[_0x834e('0x44')]];if(ut[_0x834e('0x124')](_0x1debf7['response'])){if(_0x10971d[_0x834e('0x8a')]){rpcDb[_0x834e('0xfb')](_0x10971d[_0x834e('0x8c')]);}if(_0x10971d[_0x834e('0x8b')]){rpcDb['disableContact'](_0x10971d[_0x834e('0x8c')]);}ami['emit'](_0x834e('0x125'),ut[_0x834e('0x7a')](_0x10971d,_0x834e('0x126'),this[_0x834e('0x15')][_0x10971d[_0x834e('0x44')]]));this[_0x834e('0xd5')](_0x13d670,_0x386b73,_0x1debf7);}else{_0x10971d['starttime']=moment()['format'](_0x834e('0x61'));ut[_0x834e('0xd8')](_0x13d670,0x4,'Answer');rpcDb[_0x834e('0xd9')](_0x13d670,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x834e('0x10')][_0x834e('0x127')]=function(_0x319d6c){var _0x151b58=this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]];var _0x36836f;if(_0x151b58){_0x36836f=this['campaignsPreview'][_0x151b58[_0x834e('0x44')]];logger[_0x834e('0x25')](_0x834e('0x128'),_0x319d6c[_0x834e('0xa2')],_0x834e('0xa1'),_0x36836f['name'],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);}if(this[_0x834e('0x43')][_0x319d6c['linkedid']]&&_0x319d6c['linkedid']!==_0x319d6c['uniqueid']){if(_0x319d6c[_0x834e('0x129')]==='16'&&this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){this[_0x834e('0x75')](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')]);}else if(this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){logger[_0x834e('0x25')]('[syncHangup][talking][cause]',_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')],_0x834e('0xa1'),_0x36836f[_0x834e('0x28')],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);this[_0x834e('0x75')](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c['cause']);}}else if(_0x151b58&&_[_0x834e('0x54')](_0x151b58[_0x834e('0x12a')])&&_0x36836f['dialQueueProject']&&_0x319d6c[_0x834e('0xa2')]===_0x319d6c[_0x834e('0x91')]&&_[_0x834e('0x54')](_0x319d6c[_0x834e('0xd7')])&&_0x319d6c['cause']==='16'&&_0x319d6c['channelstate']==='6'&&_[_0x834e('0x12b')](_0x151b58['transfer'])){if(_0x151b58[_0x834e('0x8a')]){rpcDb[_0x834e('0xfb')](_0x151b58[_0x834e('0x8c')]);}if(_0x151b58[_0x834e('0x8b')]){rpcDb[_0x834e('0x5e')](_0x151b58['idContact']);}_0x319d6c[_0x834e('0xd7')]='22';this['callProgressDetectingAgent'](_0x151b58,_0x36836f,_0x319d6c);}else if(_0x151b58&&_0x151b58['transfer']){if(_0x319d6c[_0x834e('0x129')]==='16'&&this[_0x834e('0x43')][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){logger[_0x834e('0x25')](_0x834e('0x12c'),_0x319d6c['linkedid'],_0x319d6c[_0x834e('0x129')],_0x834e('0xa1'),_0x36836f['name'],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);this['callProgressDetectingCustomer'](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')]);}else if(this['actions'][_0x319d6c[_0x834e('0xa2')]][_0x834e('0x47')]){logger[_0x834e('0x25')](_0x834e('0x12d'),_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')],_0x834e('0xa1'),_0x36836f[_0x834e('0x28')],_0x834e('0x92'),_0x36836f[_0x834e('0x2d')]);this['callProgressDetectingCustomer'](_0x319d6c,_0x319d6c[_0x834e('0xa2')],_0x319d6c[_0x834e('0x129')]);}}};Preview[_0x834e('0x10')][_0x834e('0x1d')]=function(_0x371767){if(this[_0x834e('0x43')][_0x371767[_0x834e('0xd3')]]&&_0x371767[_0x834e('0xd3')]!==_0x371767[_0x834e('0x12e')]){this[_0x834e('0x75')](_0x371767,_0x371767[_0x834e('0xd3')],_0x371767[_0x834e('0xcb')]);}};Preview['prototype'][_0x834e('0x1c')]=function(_0x1cd122){if(this['actions'][_0x1cd122['linkedid']]&&_0x1cd122['linkedid']!==_0x1cd122[_0x834e('0x91')]&&!this[_0x834e('0x43')][_0x1cd122[_0x834e('0xa2')]][_0x834e('0x47')]){if(_0x1cd122[_0x834e('0x129')]==='1'){this[_0x834e('0x75')](_0x1cd122,_0x1cd122[_0x834e('0xa2')],_0x1cd122['cause']);}}};Preview['prototype']['addVariable']=function(_0x47947b,_0x684a97,_0x3c8fc2){if(this[_0x834e('0x43')][_0x47947b]){if(_['isNil'](this['actions'][_0x47947b]['variables'])){this[_0x834e('0x43')][_0x47947b]['variables']={};}this['actions'][_0x47947b][_0x834e('0x11c')][_0x684a97]=_0x3c8fc2;}};Preview[_0x834e('0x10')][_0x834e('0x20')]=function(_0x1acdbd){try{if(!_[_0x834e('0x54')](_0x1acdbd)){if(ut[_0x834e('0x12f')](_[_0x834e('0x130')](_0x1acdbd['variable'])[0x0])){this[_0x834e('0x131')](_0x1acdbd[_0x834e('0x91')],_[_0x834e('0x130')](_0x1acdbd[_0x834e('0x132')])[0x0],_0x1acdbd[_0x834e('0x133')]);}}}catch(_0x488f82){logger[_0x834e('0x134')]('[syncVarSet][Preview]',util[_0x834e('0x135')](_0x488f82,{'showHidden':![],'depth':null}));}};Preview[_0x834e('0x10')][_0x834e('0x22')]=function(_0x57714a){if(_0x57714a){if(this['actions'][_0x57714a['transfertargetlinkedid']]){this['actions'][_0x57714a[_0x834e('0x136')]][_0x834e('0x137')]=!![];}}};Preview['prototype']['syncBlindTransfer']=function(_0x20d61c){if(_0x20d61c){if(this[_0x834e('0x43')][_0x20d61c[_0x834e('0x138')]]){this['actions'][_0x20d61c[_0x834e('0x138')]][_0x834e('0x137')]=!![];}}};module[_0x834e('0x139')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 2e5418e..a1dff93 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 _0xd221=['assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','createHistory','catch','resolve','then','moveContactManagedDialer','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','createCustomerFinal','rescheduleContact','UserId','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','context','exten','xcally-motion-preview'];(function(_0x25d73d,_0xd8facb){var _0xe5dabd=function(_0x27fe79){while(--_0x27fe79){_0x25d73d['push'](_0x25d73d['shift']());}};_0xe5dabd(++_0xd8facb);}(_0xd221,0x157));var _0x1d22=function(_0x2d350d,_0x4d1e87){_0x2d350d=_0x2d350d-0x0;var _0x4ebf60=_0xd221[_0x2d350d];return _0x4ebf60;};'use strict';var util=require(_0x1d22('0x0'));var BPromise=require(_0x1d22('0x1'));var logger=require(_0x1d22('0x2'))(_0x1d22('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x1d22('0x4'));var cmHopperBlack=require(_0x1d22('0x5'));var agentReportPreview=require(_0x1d22('0x6'));var voiceQueueReport=require(_0x1d22('0x7'));function loggerCatch(_0x5e3f03){return function(_0x93222){logger['error'](_0x5e3f03,util['inspect'](_0x93222,{'showHidden':![],'depth':null}));};}function create(_0x52d7c1){return cmHopperHistory[_0x1d22('0x8')](_0x52d7c1)[_0x1d22('0x9')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x37fc50){return BPromise[_0x1d22('0xa')]()[_0x1d22('0xb')](agentReportPreview['createHistory'](_0x37fc50))['catch'](loggerCatch('[createHistory]\x20'));}function moveContact(_0x52bb6b){return cmHopper[_0x1d22('0xc')](_0x52bb6b,!![])['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x1d22('0xd')]=function(_0xd2e8c6){return cmHopperBlack[_0x1d22('0xd')](_0xd2e8c6)['catch'](loggerCatch(_0x1d22('0xe')));};exports[_0x1d22('0xf')]=function(_0x2cb3f1){return BPromise[_0x1d22('0xa')]()[_0x1d22('0xb')](cmHopper[_0x1d22('0xf')](_0x2cb3f1))[_0x1d22('0x9')](loggerCatch('[getContactPreview]\x20'));};exports['createHistory']=function(_0x477e94,_0x452ced){create(_0x477e94)[_0x1d22('0x9')](loggerCatch(_0x452ced));moveContact(_0x477e94)['catch'](loggerCatch(_0x452ced));};exports['createAgentHistory']=function(_0x306901,_0x29361d){createAgent(_0x306901)[_0x1d22('0x9')](loggerCatch(_0x29361d));};exports['createCustomerHistory']=function(_0x3a03ef,_0x5c9940){create(_0x3a03ef)[_0x1d22('0x9')](loggerCatch(_0x5c9940));};exports[_0x1d22('0x10')]=function(_0x2938c5,_0x43850a){moveContact(_0x2938c5)['catch'](loggerCatch(_0x43850a));};exports[_0x1d22('0x11')]=function(_0x56668b,_0xc6e261,_0x105d32){if(_0xc6e261){_0x56668b[_0x1d22('0x12')]=null;}if(_0x105d32){_0x56668b['active']=![];}return cmHopper['rescheduleContact'](_0x56668b)[_0x1d22('0x9')](loggerCatch(_0x1d22('0x13')));};exports[_0x1d22('0x14')]=function(_0xe42041){return cmHopper[_0x1d22('0x14')](_0xe42041)[_0x1d22('0x9')](loggerCatch(_0x1d22('0x15')));};exports[_0x1d22('0x16')]=function(_0x462a1e){return cmHopper['unlockContact']({'UserId':null},_0x462a1e,0x1)['catch'](loggerCatch(_0x1d22('0x17')));};exports[_0x1d22('0x18')]=function(_0x55aa82){return cmHopper[_0x1d22('0x16')]({'active':![]},_0x55aa82,0x1)['catch'](loggerCatch(_0x1d22('0x19')));};exports['crateCustomerReportQueue']=function(_0x30e827){var _0x3034c2={};_0x3034c2[_0x1d22('0x1a')]=_0x30e827[_0x1d22('0x1a')];_0x3034c2[_0x1d22('0x1b')]=_0x30e827['uniqueid'];_0x3034c2[_0x1d22('0x1c')]=_0x30e827[_0x1d22('0x1c')];_0x3034c2[_0x1d22('0x1d')]=_0x30e827[_0x1d22('0x1d')];_0x3034c2[_0x1d22('0x1e')]=_0x30e827[_0x1d22('0x1e')];_0x3034c2[_0x1d22('0x1f')]=_0x30e827['answertime'];_0x3034c2[_0x1d22('0x20')]=_0x30e827[_0x1d22('0x21')];_0x3034c2[_0x1d22('0x22')]=0x1;_0x3034c2[_0x1d22('0x23')]=_0x30e827[_0x1d22('0x24')];_0x3034c2[_0x1d22('0x25')]=_0x30e827['membername'];_0x3034c2[_0x1d22('0x26')]='from-sip';_0x3034c2[_0x1d22('0x27')]=_0x1d22('0x28');_0x3034c2['holdtime']=0x0;_0x3034c2[_0x1d22('0x29')]=0x1;_0x3034c2[_0x1d22('0x2a')]=_0x30e827['membername'];_0x3034c2[_0x1d22('0x2b')]=_0x1d22('0x2c');return BPromise[_0x1d22('0xa')]()[_0x1d22('0xb')](voiceQueueReport['create'](_0x3034c2))['catch'](loggerCatch('[voiceQueueReport]\x20'));};exports['getContactRecallMe']=function(_0x5bd102,_0x35b7eb){return BPromise[_0x1d22('0xa')]()[_0x1d22('0xb')](cmHopper[_0x1d22('0x2d')](_0x5bd102,_0x35b7eb))[_0x1d22('0x9')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x1d22('0x2e')]=function(_0x1722ab){return cmHopper[_0x1d22('0x11')](_0x1722ab,!![],!![])[_0x1d22('0x9')](loggerCatch(_0x1d22('0x2f')));}; \ No newline at end of file +var _0x6483=['createHistory','catch','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','active','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','membername','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','[createHistory]\x20','resolve','then'];(function(_0x51c36c,_0x5a6a97){var _0x8cf065=function(_0x2d9065){while(--_0x2d9065){_0x51c36c['push'](_0x51c36c['shift']());}};_0x8cf065(++_0x5a6a97);}(_0x6483,0x94));var _0x3648=function(_0x51d907,_0xe2e53e){_0x51d907=_0x51d907-0x0;var _0x3058b3=_0x6483[_0x51d907];return _0x3058b3;};'use strict';var util=require(_0x3648('0x0'));var BPromise=require(_0x3648('0x1'));var logger=require(_0x3648('0x2'))('preview');var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x3648('0x3'));var agentReportPreview=require(_0x3648('0x4'));var voiceQueueReport=require(_0x3648('0x5'));function loggerCatch(_0x4ef527){return function(_0x448926){logger[_0x3648('0x6')](_0x4ef527,util[_0x3648('0x7')](_0x448926,{'showHidden':![],'depth':null}));};}function create(_0x2f9d11){return cmHopperHistory['createHistory'](_0x2f9d11)['catch'](loggerCatch(_0x3648('0x8')));}function createAgent(_0x171482){return BPromise[_0x3648('0x9')]()[_0x3648('0xa')](agentReportPreview[_0x3648('0xb')](_0x171482))['catch'](loggerCatch(_0x3648('0x8')));}function moveContact(_0x14e9bb){return cmHopper['moveContactManagedDialer'](_0x14e9bb,!![])[_0x3648('0xc')](loggerCatch(_0x3648('0xd')));}exports[_0x3648('0xe')]=function(_0x30090b){return cmHopperBlack['checkIsBlackList'](_0x30090b)[_0x3648('0xc')](loggerCatch(_0x3648('0xf')));};exports[_0x3648('0x10')]=function(_0x258f46){return BPromise[_0x3648('0x9')]()[_0x3648('0xa')](cmHopper['getContactPreview'](_0x258f46))[_0x3648('0xc')](loggerCatch(_0x3648('0x11')));};exports[_0x3648('0xb')]=function(_0x355463,_0x4cef8e){create(_0x355463)[_0x3648('0xc')](loggerCatch(_0x4cef8e));moveContact(_0x355463)[_0x3648('0xc')](loggerCatch(_0x4cef8e));};exports['createAgentHistory']=function(_0x372a0f,_0x40cc51){createAgent(_0x372a0f)[_0x3648('0xc')](loggerCatch(_0x40cc51));};exports[_0x3648('0x12')]=function(_0xe94861,_0x36515a){create(_0xe94861)[_0x3648('0xc')](loggerCatch(_0x36515a));};exports[_0x3648('0x13')]=function(_0x25c486,_0x593ac4){moveContact(_0x25c486)[_0x3648('0xc')](loggerCatch(_0x593ac4));};exports[_0x3648('0x14')]=function(_0x82b9e0,_0x2fea8d,_0x3604b2){if(_0x2fea8d){_0x82b9e0['UserId']=null;}if(_0x3604b2){_0x82b9e0[_0x3648('0x15')]=![];}return cmHopper[_0x3648('0x14')](_0x82b9e0)['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0x3648('0x16')]=function(_0xebe0a1){return cmHopper['countReScheduled'](_0xebe0a1)[_0x3648('0xc')](loggerCatch(_0x3648('0x17')));};exports['unlockContact']=function(_0x57837f){return cmHopper[_0x3648('0x18')]({'UserId':null},_0x57837f,0x1)[_0x3648('0xc')](loggerCatch(_0x3648('0x19')));};exports[_0x3648('0x1a')]=function(_0x640e99){return cmHopper['unlockContact']({'active':![]},_0x640e99,0x1)[_0x3648('0xc')](loggerCatch(_0x3648('0x1b')));};exports[_0x3648('0x1c')]=function(_0x45170f){var _0x170651={};_0x170651[_0x3648('0x1d')]=_0x45170f[_0x3648('0x1d')];_0x170651[_0x3648('0x1e')]=_0x45170f[_0x3648('0x1e')];_0x170651['calleridnum']=_0x45170f['calleridnum'];_0x170651[_0x3648('0x1f')]=_0x45170f['calleridname'];_0x170651[_0x3648('0x20')]=_0x45170f['queue'];_0x170651[_0x3648('0x21')]=_0x45170f['answertime'];_0x170651[_0x3648('0x22')]=_0x45170f[_0x3648('0x23')];_0x170651[_0x3648('0x24')]=0x1;_0x170651[_0x3648('0x25')]=_0x45170f[_0x3648('0x26')];_0x170651['connectedlinename']=_0x45170f[_0x3648('0x27')];_0x170651[_0x3648('0x28')]=_0x3648('0x29');_0x170651[_0x3648('0x2a')]=_0x3648('0x2b');_0x170651[_0x3648('0x2c')]=0x0;_0x170651[_0x3648('0x2d')]=0x1;_0x170651[_0x3648('0x2e')]=_0x45170f['membername'];_0x170651[_0x3648('0x2f')]=_0x3648('0x30');return BPromise['resolve']()[_0x3648('0xa')](voiceQueueReport[_0x3648('0x31')](_0x170651))[_0x3648('0xc')](loggerCatch('[voiceQueueReport]\x20'));};exports[_0x3648('0x32')]=function(_0x496c9c,_0x3e68a2){return BPromise[_0x3648('0x9')]()[_0x3648('0xa')](cmHopper[_0x3648('0x32')](_0x496c9c,_0x3e68a2))[_0x3648('0xc')](loggerCatch(_0x3648('0x33')));};exports[_0x3648('0x34')]=function(_0x1b2d9e){return cmHopper[_0x3648('0x14')](_0x1b2d9e,!![],!![])[_0x3648('0xc')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 82123c1..3efdbab 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 _0x3e88=['talktime','answertime','Failure','variablesAction','RECALL','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','cloneAction','clone','Global','active','add','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','motionChannel','mandatoryDisposition','buildObj','buildAcw','queue','interface','agentReadyId','not_inuse','reachable','push','getDiff','milliseconds','diff','createBody','CampaignId','type','campaigntype','dialAnswer','scheduledat','countglobal','callback','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','pow','replace','extractCalleridName','extractCalleridNumber','noanswer','variables','keys','forEach','toLowerCase','moment','../../../../config/logger','preview','env','127.0.0.1','../../dialer/utils','loggerCatch','error','inspect','logger','info','logger2','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','isNil','Queue','name','format','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','createdAt','updatedAt','%s%s','toLowerVariables','hasOwnProperty','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','endtime','state','responsetime','ringtime','getSeconds','starttime','logLookAgent','membername','UserId','logCustomer'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3e88,0xdd));var _0x83e8=function(_0x2a60eb,_0x23ec35){_0x2a60eb=_0x2a60eb-0x0;var _0x25ddb6=_0x3e88[_0x2a60eb];return _0x25ddb6;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x83e8('0x0'));var logger=require(_0x83e8('0x1'))(_0x83e8('0x2'));var ipAgi=process[_0x83e8('0x3')]['XCALLY_IP_AGI']||_0x83e8('0x4');var utils=require(_0x83e8('0x5'));exports[_0x83e8('0x6')]=function(_0x4313cf){return function(_0x25441a){logger[_0x83e8('0x7')](_0x4313cf,util[_0x83e8('0x8')](_0x25441a,{'showHidden':![],'depth':null}));};};exports[_0x83e8('0x9')]=function(_0x1aef52,_0x114f8f){logger[_0x83e8('0xa')](_0x1aef52,util[_0x83e8('0x8')](_0x114f8f,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x1b658e,_0x1d5ab0){logger['error'](_0x1b658e,util[_0x83e8('0x8')](_0x1d5ab0,{'showHidden':![],'depth':null}));};exports[_0x83e8('0xb')]=function(_0x186de0){return function(_0x46ae62){logger[_0x83e8('0xa')](_0x186de0,util[_0x83e8('0x8')](_0x46ae62,{'showHidden':![],'depth':null}));};};exports[_0x83e8('0xc')]=function(_0x571fcd,_0xf6f310,_0x16e6a9){return{'message':_0x571fcd,'unlock':_0xf6f310,'active':_0x16e6a9};};exports[_0x83e8('0xd')]=function(_0x1e38bf,_0x42175d,_0x1009e9){if(!_[_0x83e8('0xe')](_0x1009e9)&&_0x83e8('0xf')===typeof _0x1009e9&&!_[_0x83e8('0x10')](_0x1009e9)){if(!_[_0x83e8('0xe')](_0x42175d)&&_0x83e8('0xf')===typeof _0x42175d&&!_[_0x83e8('0x10')](_0x42175d)){return util['format'](_0x83e8('0x11'),_0x42175d,_0x1009e9);}return util['format'](_0x83e8('0x11'),_0x1009e9,_0x1009e9);}if(!_['isUndefined'](_0x1e38bf)&&_0x83e8('0xf')===typeof _0x1e38bf&&!_[_0x83e8('0x10')](_0x1e38bf)){return _0x1e38bf;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x59af2a){if(_[_0x83e8('0x12')](_0x59af2a)){return![];}return _0x59af2a;};exports['addVariables']=function(_0x3ad734,_0x590e26,_0x1dcd7e,_0x1a50ee,_0x2a5070,_0x5efd03){var _0x32d5be={'XMD-QUEUE':_0x590e26[_0x83e8('0x13')]?_0x590e26[_0x83e8('0x13')][_0x83e8('0x14')]:'','XMD-CALLERID':_0x1a50ee,'XMD-CALLERID-PREVIEW':_0x5efd03?util[_0x83e8('0x15')]('\x22%s\x22\x20<%s>',_0x5efd03[_0x83e8('0x16')],_0x5efd03[_0x83e8('0x17')]):_0x1a50ee,'XMD-DIALID':_0x2a5070,'XMD-CONTACTID':_0x590e26[_0x83e8('0x18')],'XMD-CDRTYPE':_0x83e8('0x19'),'CALLERID(all)':_0x1a50ee,'XMD-VOICEQUEUEID':_0x590e26[_0x83e8('0x1a')],'XMD-DIALCHANNEL':_0x1dcd7e,'XMD-DIALTIMEOUT':_0x3ad734[_0x83e8('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x83e8('0x15')](_0x83e8('0x1c'),_0x3ad734[_0x83e8('0x1d')]?'g':'',_[_0x83e8('0x10')](_0x3ad734['monitor_format'])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x3ad734[_0x83e8('0x1e')]||'','XMD-AGI':_0x3ad734['dialQueueProject']?util[_0x83e8('0x15')](_0x83e8('0x1f'),ipAgi,_0x3ad734[_0x83e8('0x20')]):'NONE','XMD-AGIAFTER':_0x3ad734[_0x83e8('0x1d')]?util[_0x83e8('0x15')](_0x83e8('0x1f'),ipAgi,_0x3ad734[_0x83e8('0x1d')]):_0x83e8('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x5efd03?_0x5efd03[_0x83e8('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x5efd03?_0x5efd03['originatecalleridname']:'','XMD-DESTINATION':_0x83e8('0x23'),'SIPADDHEADER':_0x83e8('0x24')};if(!_['isEmpty'](_0x3ad734['monitor_format'])){_0x32d5be[util[_0x83e8('0x15')]('%s',_0x83e8('0x25'))]=_0x3ad734['monitor_format'];_0x32d5be[util[_0x83e8('0x15')]('%s',_0x83e8('0x26'))]=_0x2a5070;}if(_0x590e26&&_0x590e26[_0x83e8('0x27')]){for(var _0x53418d in _0x590e26['Contact']){if(_0x590e26[_0x83e8('0x27')]['hasOwnProperty'](_0x53418d)){if(!_[_0x83e8('0x12')](_0x590e26[_0x83e8('0x27')][_0x53418d])&&_0x53418d!=='id'&&_0x53418d!=='tags'&&_0x53418d!==_0x83e8('0x28')&&_0x53418d!==_0x83e8('0x29')){_0x32d5be[util[_0x83e8('0x15')](_0x83e8('0x2a'),'XMD-',_['toUpper'](_0x53418d))]=_0x590e26[_0x83e8('0x27')][_0x53418d];}}}}return _0x32d5be;};exports[_0x83e8('0x2b')]=function(_0x12c41c){var _0x5d3959={};for(var _0x57c015 in _0x12c41c){if(_0x12c41c[_0x83e8('0x2c')](_0x57c015)){_0x5d3959[util[_0x83e8('0x15')]('%s',_[_0x83e8('0x2d')](_0x57c015))]=_0x12c41c[_0x57c015];}}return{'variables':_0x5d3959};};exports['updateOriginated']=function(_0x452b0d,_0x53114c){if(!_['isNil'](_0x452b0d)){if(_0x452b0d[_0x83e8('0x2c')](_0x83e8('0x2e'))){if(_0x452b0d[_0x83e8('0x2e')]>0x0){_0x452b0d[_0x83e8('0x2e')]-=0x1;}else{logger[_0x83e8('0x7')](_0x83e8('0x2f'),_0x53114c);}}}else{logger['error'](_0x83e8('0x30'),_0x53114c);}};exports[_0x83e8('0x31')]=function(_0x167b3a){var _0x409636=moment()[_0x83e8('0x15')](_0x83e8('0x32'));_0x167b3a['state']=0xd;_0x167b3a[_0x83e8('0x33')]=_0x83e8('0x34');_0x167b3a['starttime']=_0x409636;_0x167b3a['responsetime']=_0x409636;_0x167b3a[_0x83e8('0x35')]=_0x409636;};exports['logAgent']=function(_0x147050,_0x4f7870,_0x1880c9){var _0x2f7df0=moment()[_0x83e8('0x15')](_0x83e8('0x32'));_0x147050[_0x83e8('0x36')]=_0x4f7870;_0x147050['statedesc']=_0x1880c9;_0x147050[_0x83e8('0x37')]=_0x2f7df0;_0x147050[_0x83e8('0x38')]=utils[_0x83e8('0x39')](_0x147050[_0x83e8('0x37')],_0x147050[_0x83e8('0x3a')]);};exports[_0x83e8('0x3b')]=function(_0x33d263,_0x47ddd2,_0x4739cb){_0x33d263[_0x83e8('0x3c')]=_0x47ddd2;_0x33d263[_0x83e8('0x3d')]=_0x4739cb;};exports[_0x83e8('0x3e')]=function(_0x3d15c1,_0x2a54af,_0x424c85){var _0x25fa16=moment()[_0x83e8('0x15')](_0x83e8('0x32'));_0x3d15c1[_0x83e8('0x36')]=_0x2a54af;_0x3d15c1[_0x83e8('0x33')]=_0x424c85;_0x3d15c1[_0x83e8('0x37')]=_0x3d15c1['responsetime']?_0x3d15c1[_0x83e8('0x37')]:_0x25fa16;_0x3d15c1[_0x83e8('0x35')]=_0x3d15c1[_0x83e8('0x35')]?_0x3d15c1[_0x83e8('0x35')]:_0x25fa16;_0x3d15c1[_0x83e8('0x38')]=utils[_0x83e8('0x39')](_0x3d15c1[_0x83e8('0x37')]||0x0,_0x3d15c1[_0x83e8('0x3a')]||0x0);_0x3d15c1[_0x83e8('0x3f')]=_0x3d15c1[_0x83e8('0x40')]?utils['getSeconds'](_0x3d15c1[_0x83e8('0x35')],_0x3d15c1[_0x83e8('0x40')]):0x0;};exports['isFailure']=function(_0x44fda0){return _0x44fda0===_0x83e8('0x41');};exports[_0x83e8('0x42')]=function(_0x494332,_0x21bc83,_0x3bb260,_0x136f8d,_0xd19168){var _0x3cafb4=_0x136f8d?_0x83e8('0x43'):_0x494332[_0x83e8('0x16')];_0x3cafb4=_0xd19168?'BOOKED':_0x3cafb4;return{'actionid':_0x494332[_0x83e8('0x44')],'action':_0x83e8('0x45'),'channel':_0x494332[_0x83e8('0x46')],'callerid':util[_0x83e8('0x15')](_0x83e8('0x11'),_0x3cafb4,_0x494332[_0x83e8('0x17')]),'Exten':'xcally-motion-preview','Context':_0x83e8('0x47'),'Priority':'1','variable':_0x3bb260,'timeout':(_0x21bc83[_0x83e8('0x48')]||0x1e)*0x3e8,'async':!![],'channelid':_0x494332[_0x83e8('0x44')]};};exports[_0x83e8('0x49')]=function(_0xd47861){return _0xd47861[_0x83e8('0x4a')]+_0xd47861[_0x83e8('0x4b')]+_0xd47861[_0x83e8('0x4c')]+_0xd47861[_0x83e8('0x4d')]+_0xd47861['countnosuchnumberretry'];};exports[_0x83e8('0x4e')]=function(_0x164cbe){var _0x21f34e=_[_0x83e8('0x4f')](_0x164cbe);_0x21f34e[_0x83e8('0x36')]=0xf;_0x21f34e[_0x83e8('0x33')]=_0x83e8('0x50');return _0x21f34e;};exports['scheduledAt']=function(_0x1a2472,_0x10f20f,_0x169451){var _0x542365={};_0x542365[_0x10f20f]=_0x1a2472[_0x10f20f];_0x542365[_0x83e8('0x51')]=![];_0x542365['scheduledat']=moment()[_0x83e8('0x52')](_0x169451,_0x83e8('0x53'))['format'](_0x83e8('0x32'));_0x542365[_0x83e8('0x18')]=_0x1a2472[_0x83e8('0x18')];_0x542365['ListId']=_0x1a2472[_0x83e8('0x54')];_0x542365[_0x83e8('0x1a')]=_0x1a2472['VoiceQueueId']||undefined;return _0x542365;};exports['decrementTalkink']=function(_0x49d58d,_0x1b7bee){if(!_['isNil'](_0x49d58d)){if(_0x49d58d[_0x83e8('0x55')]>0x0){_0x49d58d[_0x83e8('0x55')]-=0x1;}else{logger[_0x83e8('0x7')](_0x1b7bee,_0x83e8('0x56'));}}else{logger[_0x83e8('0x7')](_0x1b7bee,_0x83e8('0x57'));}};exports[_0x83e8('0x58')]=function(_0x1eb887){if(_0x1eb887<=0x0){return!![];}return![];};function buildObj(_0x57d25c,_0x2bb3ef,_0x2ed0d7){_0x57d25c[_0x83e8('0x59')]=_0x2bb3ef;_0x57d25c[_0x83e8('0x14')]=_0x57d25c['queue'];_0x57d25c['interface']=_0x57d25c['channelAgent'];_0x57d25c[_0x83e8('0x5a')]='voice';if(_0x2ed0d7){_0x57d25c[_0x83e8('0x5b')]=_0x2ed0d7[_0x83e8('0x5b')];}return _0x57d25c;}exports[_0x83e8('0x5c')]=buildObj;exports[_0x83e8('0x5d')]=function(_0x31f6ca){var _0x401e27={};_0x401e27['queue']=_0x31f6ca[_0x83e8('0x5e')];_0x401e27[_0x83e8('0x5f')]=_0x31f6ca[_0x83e8('0x46')];_0x401e27['uniqueid']=_0x31f6ca['uniqueid'];return _0x401e27;};exports[_0x83e8('0x60')]=function(_0x3bae92){var _0x40cc4e=[];for(var _0x18b9ee in _0x3bae92){if(_0x3bae92['hasOwnProperty'](_0x18b9ee)){if(!_['isNil'](_0x3bae92[_0x18b9ee])&&_0x3bae92[_0x18b9ee][_0x83e8('0x36')]===_0x83e8('0x61')&&_0x3bae92[_0x18b9ee]['status']===_0x83e8('0x62')){_0x40cc4e[_0x83e8('0x63')](_0x3bae92[_0x18b9ee]['id']);}}}return _0x40cc4e;};exports[_0x83e8('0x64')]=function(_0x3b3922){var _0x2d14f3=moment()[_0x83e8('0x65')](0x0);var _0x2723ff=moment(_0x3b3922)[_0x83e8('0x65')](0x0);return _0x2d14f3[_0x83e8('0x66')](_0x2723ff,'seconds');};exports[_0x83e8('0x67')]=function(_0x594aff){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x594aff[_0x83e8('0x18')],'ListId':_0x594aff[_0x83e8('0x54')],'VoiceQueueId':_0x594aff[_0x83e8('0x1a')]||undefined,'CampaignId':_0x594aff[_0x83e8('0x68')]||undefined};};exports['filterKey']=function(_0x1b8754){if(_0x1b8754==='uniqueid'||_0x1b8754==='idContact'||_0x1b8754===_0x83e8('0x5e')||_0x1b8754===_0x83e8('0x69')||_0x1b8754===_0x83e8('0x6a')||_0x1b8754===_0x83e8('0x6b')||_0x1b8754===_0x83e8('0x3c')||_0x1b8754==='channelAgent'||_0x1b8754===_0x83e8('0x16')||_0x1b8754===_0x83e8('0x51')||_0x1b8754===_0x83e8('0x17')||_0x1b8754===_0x83e8('0x6c')||_0x1b8754===_0x83e8('0x4a')||_0x1b8754===_0x83e8('0x4b')||_0x1b8754===_0x83e8('0x4c')||_0x1b8754===_0x83e8('0x6d')||_0x1b8754===_0x83e8('0x6e')||_0x1b8754===_0x83e8('0x6f')||_0x1b8754===_0x83e8('0x70')||_0x1b8754==='recallme'||_0x1b8754===_0x83e8('0x18')||_0x1b8754==='ListId'||_0x1b8754===_0x83e8('0x3d')||_0x1b8754===_0x83e8('0x1a')||_0x1b8754===_0x83e8('0x71')||_0x1b8754===_0x83e8('0x72')||_0x1b8754===_0x83e8('0x73')||_0x1b8754==='xmd-phone'||_0x1b8754==='xmd-listid'||_0x1b8754==='xmd-dialurl'||_0x1b8754===_0x83e8('0x74')||_0x1b8754==='xmd-dialoptions'||_0x1b8754===_0x83e8('0x75')||_0x1b8754===_0x83e8('0x76')||_0x1b8754===_0x83e8('0x77')||_0x1b8754===_0x83e8('0x78')||_0x1b8754===_0x83e8('0x79')||_0x1b8754===_0x83e8('0x7a')||_0x1b8754===_0x83e8('0x7b')||_0x1b8754===_0x83e8('0x7c')||_0x1b8754===_0x83e8('0x7d')||_0x1b8754===_0x83e8('0x7e')||_0x1b8754===_0x83e8('0x7f')||_0x1b8754===_0x83e8('0x80')||_0x1b8754===_0x83e8('0x81')||_0x1b8754===_0x83e8('0x82')||_0x1b8754===_0x83e8('0x83')||_0x1b8754===_0x83e8('0x7c')||_0x1b8754===_0x83e8('0x7d')||_0x1b8754===_0x83e8('0x7e')||_0x1b8754==='rtpaudioqosjitterbridged'||_0x1b8754===_0x83e8('0x80')||_0x1b8754===_0x83e8('0x81')||_0x1b8754==='rtpaudioqosrtt'||_0x1b8754===_0x83e8('0x83')||_0x1b8754===_0x83e8('0x84')||_0x1b8754==='bridgepvtcallid'||_0x1b8754===_0x83e8('0x36')||_0x1b8754==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x2869c6,_0x2e9e75){var _0x4d30b7,_0x24fdd8,_0x1e42fd;if(_0x2e9e75<=0x0){_0x2e9e75=0x1;}_0x4d30b7=new RegExp('\x5cw{0,'+_0x2e9e75+'}$');_0x24fdd8=Math['pow'](0xa,_0x2e9e75-0x1);_0x1e42fd=Math[_0x83e8('0x85')](0xa,_0x2e9e75)-0x1;return util[_0x83e8('0x15')]('%s',_[_0x83e8('0x86')](_0x2869c6,_0x4d30b7,_['random'](_0x24fdd8,_0x1e42fd)));};exports[_0x83e8('0x87')]=function(_0x2aac0c){var _0x311791=_0x2aac0c['match'](/"(.*?)"/);return _0x311791?_0x311791[0x1]:_0x2aac0c;};exports[_0x83e8('0x88')]=function(_0x4afbe0){var _0x3d29d7=_0x4afbe0['match'](/<(.*?)>/);return _0x3d29d7?_0x3d29d7[0x1]:_0x4afbe0;};function buildNoAnswerEventPayload(_0x4535c9,_0x5e50b8){var _0x5a289e=buildObj(_0x4535c9,_0x83e8('0x89'));if(!_[_0x83e8('0x10')](_0x5e50b8[_0x83e8('0x8a')])){Object[_0x83e8('0x8b')](_0x5e50b8['variables'])[_0x83e8('0x8c')](function(_0x17d38e){_0x5a289e[_0x17d38e[_0x83e8('0x8d')]()]=_0x5e50b8[_0x83e8('0x8a')][_0x17d38e];});}return _0x5a289e;}exports['buildNoAnswerEventPayload']=buildNoAnswerEventPayload; \ No newline at end of file +var _0xccdf=['[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','getSeconds','logLookAgent','membername','UserId','logCustomer','talktime','answertime','isFailure','Failure','variablesAction','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','timeout','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','queue','motionChannel','voice','mandatoryDisposition','buildObj','buildAcw','interface','agentReadyId','not_inuse','status','reachable','milliseconds','diff','seconds','createBody','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','scheduledat','countbusyretry','callback','callbackuniqueid','sipcallid','xmd-voicequeueid','xmd-queue','xmd-dialurl','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','noanswer','variables','forEach','toLowerCase','buildNoAnswerEventPayload','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','../../dialer/utils','logger','info','inspect','loggerError','logger2','getCallerId','isUndefined','isEmpty','string','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','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','Call-Type:\x20PREVIEW','Contact','tags','%s%s','XMD-','toLowerVariables','hasOwnProperty','toLower','originated','error'];(function(_0x561975,_0x1d64fc){var _0x15b7f5=function(_0x43bfc1){while(--_0x43bfc1){_0x561975['push'](_0x561975['shift']());}};_0x15b7f5(++_0x1d64fc);}(_0xccdf,0x192));var _0xfccd=function(_0x9d654b,_0x23810e){_0x9d654b=_0x9d654b-0x0;var _0x579053=_0xccdf[_0x9d654b];return _0x579053;};'use strict';var util=require(_0xfccd('0x0'));var _=require(_0xfccd('0x1'));var moment=require(_0xfccd('0x2'));var logger=require(_0xfccd('0x3'))(_0xfccd('0x4'));var ipAgi=process[_0xfccd('0x5')][_0xfccd('0x6')]||_0xfccd('0x7');var utils=require(_0xfccd('0x8'));exports['loggerCatch']=function(_0x1cc86c){return function(_0x414262){logger['error'](_0x1cc86c,util['inspect'](_0x414262,{'showHidden':![],'depth':null}));};};exports[_0xfccd('0x9')]=function(_0x3cdb0e,_0xdf4e0e){logger[_0xfccd('0xa')](_0x3cdb0e,util[_0xfccd('0xb')](_0xdf4e0e,{'showHidden':![],'depth':null}));};exports[_0xfccd('0xc')]=function(_0x737c32,_0x3d033e){logger['error'](_0x737c32,util[_0xfccd('0xb')](_0x3d033e,{'showHidden':![],'depth':null}));};exports[_0xfccd('0xd')]=function(_0x289bed){return function(_0x1f3c33){logger[_0xfccd('0xa')](_0x289bed,util[_0xfccd('0xb')](_0x1f3c33,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x10fecd,_0x537889,_0x18eee3){return{'message':_0x10fecd,'unlock':_0x537889,'active':_0x18eee3};};exports[_0xfccd('0xe')]=function(_0x4c78f6,_0x4630d2,_0x4898f2){if(!_[_0xfccd('0xf')](_0x4898f2)&&'string'===typeof _0x4898f2&&!_[_0xfccd('0x10')](_0x4898f2)){if(!_['isUndefined'](_0x4630d2)&&_0xfccd('0x11')===typeof _0x4630d2&&!_[_0xfccd('0x10')](_0x4630d2)){return util[_0xfccd('0x12')](_0xfccd('0x13'),_0x4630d2,_0x4898f2);}return util[_0xfccd('0x12')](_0xfccd('0x13'),_0x4898f2,_0x4898f2);}if(!_[_0xfccd('0xf')](_0x4c78f6)&&'string'===typeof _0x4c78f6&&!_[_0xfccd('0x10')](_0x4c78f6)){return _0x4c78f6;}return'\x22\x22\x20<>';};exports[_0xfccd('0x14')]=function(_0x139b73){if(_[_0xfccd('0x15')](_0x139b73)){return![];}return _0x139b73;};exports[_0xfccd('0x16')]=function(_0x5469b9,_0x330662,_0x414d18,_0x4021bc,_0x46b893,_0x166433){var _0x5887c6={'XMD-QUEUE':_0x330662[_0xfccd('0x17')]?_0x330662[_0xfccd('0x17')][_0xfccd('0x18')]:'','XMD-CALLERID':_0x4021bc,'XMD-CALLERID-PREVIEW':_0x166433?util['format'](_0xfccd('0x13'),_0x166433[_0xfccd('0x19')],_0x166433[_0xfccd('0x1a')]):_0x4021bc,'XMD-DIALID':_0x46b893,'XMD-CONTACTID':_0x330662[_0xfccd('0x1b')],'XMD-CDRTYPE':_0xfccd('0x1c'),'CALLERID(all)':_0x4021bc,'XMD-VOICEQUEUEID':_0x330662[_0xfccd('0x1d')],'XMD-DIALCHANNEL':_0x414d18,'XMD-DIALTIMEOUT':_0x5469b9[_0xfccd('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0xfccd('0x12')](_0xfccd('0x1f'),_0x5469b9[_0xfccd('0x20')]?'g':'',_[_0xfccd('0x10')](_0x5469b9[_0xfccd('0x21')])?'':_0xfccd('0x22')),'XMD-DIALURL':_0x5469b9[_0xfccd('0x23')]||'','XMD-AGI':_0x5469b9[_0xfccd('0x24')]?util[_0xfccd('0x12')](_0xfccd('0x25'),ipAgi,_0x5469b9[_0xfccd('0x24')]):'NONE','XMD-AGIAFTER':_0x5469b9[_0xfccd('0x20')]?util[_0xfccd('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0x5469b9[_0xfccd('0x20')]):_0xfccd('0x26'),'XMD-ORIGINATECALLERIDNUM':_0x166433?_0x166433[_0xfccd('0x27')]:'','XMD-ORIGINATECALLERIDNAME':_0x166433?_0x166433[_0xfccd('0x28')]:'','XMD-DESTINATION':'xcally-motion-preview','SIPADDHEADER':_0xfccd('0x29')};if(!_['isEmpty'](_0x5469b9[_0xfccd('0x21')])){_0x5887c6[util[_0xfccd('0x12')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x5469b9[_0xfccd('0x21')];_0x5887c6[util[_0xfccd('0x12')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x46b893;}if(_0x330662&&_0x330662[_0xfccd('0x2a')]){for(var _0x4764f7 in _0x330662['Contact']){if(_0x330662[_0xfccd('0x2a')]['hasOwnProperty'](_0x4764f7)){if(!_[_0xfccd('0x15')](_0x330662[_0xfccd('0x2a')][_0x4764f7])&&_0x4764f7!=='id'&&_0x4764f7!==_0xfccd('0x2b')&&_0x4764f7!=='createdAt'&&_0x4764f7!=='updatedAt'){_0x5887c6[util[_0xfccd('0x12')](_0xfccd('0x2c'),_0xfccd('0x2d'),_['toUpper'](_0x4764f7))]=_0x330662[_0xfccd('0x2a')][_0x4764f7];}}}}return _0x5887c6;};exports[_0xfccd('0x2e')]=function(_0xc3cbae){var _0x449a80={};for(var _0xa4b0bf in _0xc3cbae){if(_0xc3cbae[_0xfccd('0x2f')](_0xa4b0bf)){_0x449a80[util[_0xfccd('0x12')]('%s',_[_0xfccd('0x30')](_0xa4b0bf))]=_0xc3cbae[_0xa4b0bf];}}return{'variables':_0x449a80};};exports['updateOriginated']=function(_0x5851ca,_0x436b0c){if(!_[_0xfccd('0x15')](_0x5851ca)){if(_0x5851ca[_0xfccd('0x2f')](_0xfccd('0x31'))){if(_0x5851ca[_0xfccd('0x31')]>0x0){_0x5851ca[_0xfccd('0x31')]-=0x1;}else{logger[_0xfccd('0x32')](_0xfccd('0x33'),_0x436b0c);}}}else{logger[_0xfccd('0x32')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x436b0c);}};exports[_0xfccd('0x34')]=function(_0x14b442){var _0xb7436d=moment()[_0xfccd('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0x14b442[_0xfccd('0x35')]=0xd;_0x14b442[_0xfccd('0x36')]=_0xfccd('0x37');_0x14b442[_0xfccd('0x38')]=_0xb7436d;_0x14b442[_0xfccd('0x39')]=_0xb7436d;_0x14b442[_0xfccd('0x3a')]=_0xb7436d;};exports[_0xfccd('0x3b')]=function(_0x52a56c,_0x2725c4,_0x4e46c7){var _0x33e0a7=moment()['format'](_0xfccd('0x3c'));_0x52a56c['state']=_0x2725c4;_0x52a56c[_0xfccd('0x36')]=_0x4e46c7;_0x52a56c[_0xfccd('0x39')]=_0x33e0a7;_0x52a56c[_0xfccd('0x3d')]=utils[_0xfccd('0x3e')](_0x52a56c[_0xfccd('0x39')],_0x52a56c[_0xfccd('0x38')]);};exports[_0xfccd('0x3f')]=function(_0x221cfd,_0x56bf4a,_0xc9350d){_0x221cfd[_0xfccd('0x40')]=_0x56bf4a;_0x221cfd[_0xfccd('0x41')]=_0xc9350d;};exports[_0xfccd('0x42')]=function(_0x3beadd,_0x569dc1,_0x5cf972){var _0x3a8d3c=moment()[_0xfccd('0x12')](_0xfccd('0x3c'));_0x3beadd['state']=_0x569dc1;_0x3beadd['statedesc']=_0x5cf972;_0x3beadd[_0xfccd('0x39')]=_0x3beadd['responsetime']?_0x3beadd[_0xfccd('0x39')]:_0x3a8d3c;_0x3beadd[_0xfccd('0x3a')]=_0x3beadd[_0xfccd('0x3a')]?_0x3beadd[_0xfccd('0x3a')]:_0x3a8d3c;_0x3beadd['ringtime']=utils['getSeconds'](_0x3beadd[_0xfccd('0x39')]||0x0,_0x3beadd[_0xfccd('0x38')]||0x0);_0x3beadd[_0xfccd('0x43')]=_0x3beadd[_0xfccd('0x44')]?utils[_0xfccd('0x3e')](_0x3beadd['endtime'],_0x3beadd[_0xfccd('0x44')]):0x0;};exports[_0xfccd('0x45')]=function(_0x28cfce){return _0x28cfce===_0xfccd('0x46');};exports[_0xfccd('0x47')]=function(_0x360fe9,_0x8f649a,_0x5e92c3,_0x4ed4a7,_0x1f6241){var _0x46ffe7=_0x4ed4a7?'RECALL':_0x360fe9[_0xfccd('0x19')];_0x46ffe7=_0x1f6241?_0xfccd('0x48'):_0x46ffe7;return{'actionid':_0x360fe9[_0xfccd('0x49')],'action':_0xfccd('0x4a'),'channel':_0x360fe9[_0xfccd('0x4b')],'callerid':util['format'](_0xfccd('0x13'),_0x46ffe7,_0x360fe9[_0xfccd('0x1a')]),'Exten':_0xfccd('0x4c'),'Context':'from-sip','Priority':'1','variable':_0x5e92c3,'timeout':(_0x8f649a[_0xfccd('0x4d')]||0x1e)*0x3e8,'async':!![],'channelid':_0x360fe9[_0xfccd('0x49')]};};exports['totalGlobal']=function(_0x578955){return _0x578955['countbusyretry']+_0x578955[_0xfccd('0x4e')]+_0x578955[_0xfccd('0x4f')]+_0x578955[_0xfccd('0x50')]+_0x578955[_0xfccd('0x51')];};exports[_0xfccd('0x52')]=function(_0x363b05){var _0x1be370=_[_0xfccd('0x53')](_0x363b05);_0x1be370[_0xfccd('0x35')]=0xf;_0x1be370[_0xfccd('0x36')]=_0xfccd('0x54');return _0x1be370;};exports[_0xfccd('0x55')]=function(_0x517b9f,_0x3d87bf,_0x499a3d){var _0x5d71dc={};_0x5d71dc[_0x3d87bf]=_0x517b9f[_0x3d87bf];_0x5d71dc[_0xfccd('0x56')]=![];_0x5d71dc['scheduledat']=moment()['add'](_0x499a3d,_0xfccd('0x57'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5d71dc[_0xfccd('0x1b')]=_0x517b9f[_0xfccd('0x1b')];_0x5d71dc[_0xfccd('0x58')]=_0x517b9f[_0xfccd('0x58')];_0x5d71dc[_0xfccd('0x1d')]=_0x517b9f[_0xfccd('0x1d')]||undefined;return _0x5d71dc;};exports[_0xfccd('0x59')]=function(_0x40cda9,_0x1934df){if(!_['isNil'](_0x40cda9)){if(_0x40cda9[_0xfccd('0x5a')]>0x0){_0x40cda9['pTalking']-=0x1;}else{logger['error'](_0x1934df,_0xfccd('0x5b'));}}else{logger['error'](_0x1934df,_0xfccd('0x5c'));}};exports[_0xfccd('0x5d')]=function(_0x6333cb){if(_0x6333cb<=0x0){return!![];}return![];};function buildObj(_0x363f06,_0x4d4781,_0x2e2655){_0x363f06['lastevent']=_0x4d4781;_0x363f06[_0xfccd('0x18')]=_0x363f06[_0xfccd('0x5e')];_0x363f06['interface']=_0x363f06[_0xfccd('0x4b')];_0x363f06[_0xfccd('0x5f')]=_0xfccd('0x60');if(_0x2e2655){_0x363f06[_0xfccd('0x61')]=_0x2e2655['mandatoryDisposition'];}return _0x363f06;}exports[_0xfccd('0x62')]=buildObj;exports[_0xfccd('0x63')]=function(_0x49c9cc){var _0x580cdc={};_0x580cdc[_0xfccd('0x5e')]=_0x49c9cc[_0xfccd('0x5e')];_0x580cdc[_0xfccd('0x64')]=_0x49c9cc[_0xfccd('0x4b')];_0x580cdc['uniqueid']=_0x49c9cc[_0xfccd('0x49')];return _0x580cdc;};exports[_0xfccd('0x65')]=function(_0x33b03b){var _0x13a40a=[];for(var _0xb7421e in _0x33b03b){if(_0x33b03b[_0xfccd('0x2f')](_0xb7421e)){if(!_[_0xfccd('0x15')](_0x33b03b[_0xb7421e])&&_0x33b03b[_0xb7421e]['state']===_0xfccd('0x66')&&_0x33b03b[_0xb7421e][_0xfccd('0x67')]===_0xfccd('0x68')){_0x13a40a['push'](_0x33b03b[_0xb7421e]['id']);}}}return _0x13a40a;};exports['getDiff']=function(_0x342756){var _0x5202d3=moment()[_0xfccd('0x69')](0x0);var _0x211d37=moment(_0x342756)[_0xfccd('0x69')](0x0);return _0x5202d3[_0xfccd('0x6a')](_0x211d37,_0xfccd('0x6b'));};exports[_0xfccd('0x6c')]=function(_0x24bdd2){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x24bdd2[_0xfccd('0x1b')],'ListId':_0x24bdd2[_0xfccd('0x58')],'VoiceQueueId':_0x24bdd2[_0xfccd('0x1d')]||undefined,'CampaignId':_0x24bdd2[_0xfccd('0x6d')]||undefined};};exports[_0xfccd('0x6e')]=function(_0xb7995d){if(_0xb7995d==='uniqueid'||_0xb7995d===_0xfccd('0x6f')||_0xb7995d===_0xfccd('0x5e')||_0xb7995d===_0xfccd('0x70')||_0xb7995d===_0xfccd('0x71')||_0xb7995d===_0xfccd('0x72')||_0xb7995d===_0xfccd('0x40')||_0xb7995d===_0xfccd('0x4b')||_0xb7995d===_0xfccd('0x19')||_0xb7995d===_0xfccd('0x56')||_0xb7995d==='calleridnum'||_0xb7995d===_0xfccd('0x73')||_0xb7995d===_0xfccd('0x74')||_0xb7995d==='countcongestionretry'||_0xb7995d===_0xfccd('0x4f')||_0xb7995d==='countglobal'||_0xb7995d===_0xfccd('0x75')||_0xb7995d===_0xfccd('0x76')||_0xb7995d==='callbackat'||_0xb7995d==='recallme'||_0xb7995d===_0xfccd('0x1b')||_0xb7995d===_0xfccd('0x58')||_0xb7995d===_0xfccd('0x41')||_0xb7995d===_0xfccd('0x1d')||_0xb7995d===_0xfccd('0x77')||_0xb7995d===_0xfccd('0x78')||_0xb7995d===_0xfccd('0x79')||_0xb7995d==='xmd-phone'||_0xb7995d==='xmd-listid'||_0xb7995d===_0xfccd('0x7a')||_0xb7995d==='xmd-dialtimeout'||_0xb7995d===_0xfccd('0x7b')||_0xb7995d==='xmd-dialid'||_0xb7995d===_0xfccd('0x7c')||_0xb7995d===_0xfccd('0x7d')||_0xb7995d==='xmd-cdrtype'||_0xb7995d===_0xfccd('0x7e')||_0xb7995d===_0xfccd('0x7f')||_0xb7995d===_0xfccd('0x80')||_0xb7995d===_0xfccd('0x81')||_0xb7995d===_0xfccd('0x82')||_0xb7995d==='rtpaudioqosjitter'||_0xb7995d===_0xfccd('0x83')||_0xb7995d==='rtpaudioqosloss'||_0xb7995d==='rtpaudioqoslossbridged'||_0xb7995d===_0xfccd('0x84')||_0xb7995d===_0xfccd('0x85')||_0xb7995d==='rtpaudioqos'||_0xb7995d===_0xfccd('0x82')||_0xb7995d===_0xfccd('0x86')||_0xb7995d==='rtpaudioqosjitterbridged'||_0xb7995d===_0xfccd('0x87')||_0xb7995d===_0xfccd('0x88')||_0xb7995d===_0xfccd('0x84')||_0xb7995d===_0xfccd('0x85')||_0xb7995d===_0xfccd('0x89')||_0xb7995d===_0xfccd('0x8a')||_0xb7995d===_0xfccd('0x35')||_0xb7995d===_0xfccd('0x36')){return![];}return!![];};exports[_0xfccd('0x8b')]=function(_0x5c3307,_0x2f6a06){var _0x328a63,_0x451259,_0x556e53;if(_0x2f6a06<=0x0){_0x2f6a06=0x1;}_0x328a63=new RegExp(_0xfccd('0x8c')+_0x2f6a06+'}$');_0x451259=Math[_0xfccd('0x8d')](0xa,_0x2f6a06-0x1);_0x556e53=Math[_0xfccd('0x8d')](0xa,_0x2f6a06)-0x1;return util[_0xfccd('0x12')]('%s',_[_0xfccd('0x8e')](_0x5c3307,_0x328a63,_['random'](_0x451259,_0x556e53)));};exports[_0xfccd('0x8f')]=function(_0x295522){var _0x17b91a=_0x295522[_0xfccd('0x90')](/"(.*?)"/);return _0x17b91a?_0x17b91a[0x1]:_0x295522;};exports[_0xfccd('0x91')]=function(_0x3f69c9){var _0xeb8666=_0x3f69c9[_0xfccd('0x90')](/<(.*?)>/);return _0xeb8666?_0xeb8666[0x1]:_0x3f69c9;};function buildNoAnswerEventPayload(_0x2eaa99,_0x7b6895){var _0x53c852=buildObj(_0x2eaa99,_0xfccd('0x92'));if(!_[_0xfccd('0x10')](_0x7b6895[_0xfccd('0x93')])){Object['keys'](_0x7b6895[_0xfccd('0x93')])[_0xfccd('0x94')](function(_0x3f51ac){_0x53c852[_0x3f51ac[_0xfccd('0x95')]()]=_0x7b6895[_0xfccd('0x93')][_0x3f51ac];});}return _0x53c852;}exports[_0xfccd('0x96')]=buildNoAnswerEventPayload; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index d81a788..52b2747 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 _0x2bd8=['reload','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean','queueremove','queuepause'];(function(_0xae93a4,_0x14c338){var _0x582985=function(_0x29c47c){while(--_0x29c47c){_0xae93a4['push'](_0xae93a4['shift']());}};_0x582985(++_0x14c338);}(_0x2bd8,0x72));var _0x82bd=function(_0x431721,_0x45b6fc){_0x431721=_0x431721-0x0;var _0x53ee25=_0x2bd8[_0x431721];return _0x53ee25;};'use strict';exports[_0x82bd('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]},'membername':{'type':_0x82bd('0x1'),'required':!![]},'penalty':{'type':_0x82bd('0x2'),'required':![]},'paused':{'type':_0x82bd('0x3'),'required':![]}};exports[_0x82bd('0x4')]={'queue':{'type':'string','required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x82bd('0x5')]={'interface':{'type':_0x82bd('0x1'),'required':!![]},'paused':{'type':_0x82bd('0x3')},'reason':{'type':_0x82bd('0x1'),'required':![]}};exports[_0x82bd('0x6')]={'module':{'type':_0x82bd('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x82bd('0x1'),'required':!![]}};exports[_0x82bd('0x7')]={'uniqueid':{'type':_0x82bd('0x1'),'required':!![]},'filename':{'type':_0x82bd('0x1')},'format':{'type':_0x82bd('0x1')},'mixmonitorid':{'type':_0x82bd('0x1')}};exports[_0x82bd('0x8')]={'uniqueid':{'type':_0x82bd('0x1'),'required':!![]}};exports[_0x82bd('0x9')]={'uniqueid':{'type':_0x82bd('0x1'),'required':!![]},'exten':{'type':_0x82bd('0x1'),'required':!![]},'context':{'type':_0x82bd('0x1')}}; \ No newline at end of file +var _0x2416=['boolean','queueremove','queuepause','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string'];(function(_0x4c0a0e,_0x2e4b1a){var _0x284bd0=function(_0x3b4f3d){while(--_0x3b4f3d){_0x4c0a0e['push'](_0x4c0a0e['shift']());}};_0x284bd0(++_0x2e4b1a);}(_0x2416,0x94));var _0x6241=function(_0x4f3944,_0x3d3a83){_0x4f3944=_0x4f3944-0x0;var _0xcf0458=_0x2416[_0x4f3944];return _0xcf0458;};'use strict';exports[_0x6241('0x0')]={'queue':{'type':_0x6241('0x1'),'required':!![]},'interface':{'type':_0x6241('0x1'),'required':!![]},'membername':{'type':_0x6241('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':_0x6241('0x2'),'required':![]}};exports[_0x6241('0x3')]={'queue':{'type':_0x6241('0x1'),'required':!![]},'interface':{'type':_0x6241('0x1'),'required':!![]}};exports[_0x6241('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x6241('0x1'),'required':![]}};exports[_0x6241('0x5')]={'module':{'type':_0x6241('0x1'),'required':![]}};exports[_0x6241('0x6')]={'uniqueid':{'type':_0x6241('0x1'),'required':!![]}};exports[_0x6241('0x7')]={'uniqueid':{'type':'string','required':!![]},'filename':{'type':'string'},'format':{'type':_0x6241('0x1')},'mixmonitorid':{'type':_0x6241('0x1')}};exports[_0x6241('0x8')]={'uniqueid':{'type':_0x6241('0x1'),'required':!![]}};exports[_0x6241('0x9')]={'uniqueid':{'type':_0x6241('0x1'),'required':!![]},'exten':{'type':_0x6241('0x1'),'required':!![]},'context':{'type':_0x6241('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 0cc94f8..a73e70f 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 _0xadb5=['ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','initAgents','initTelephones','length','isUndefined','triggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initDeskAccounts','initSugarcrmAccounts','sugarcrmAccounts','initVtigerAccounts','vtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','voiceQueues','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallerjoinAt','queuecallercomplete','queuecallercompleteAt','duration','ANSWERED','billableseconds','initCampaigns','dialQueueProject','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','moment','../model/agent','../model/telephone','../model/trunk','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','templates','outbound','channels','outboundChannels','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty','isNil','interface','format','SIP/%s','total','answered','sumHoldTime','sumDuration','isEmpty'];(function(_0x13b470,_0x39f432){var _0x14b02d=function(_0x3b2a22){while(--_0x3b2a22){_0x13b470['push'](_0x13b470['shift']());}};_0x14b02d(++_0x39f432);}(_0xadb5,0xad));var _0x5adb=function(_0xa63ec2,_0x382697){_0xa63ec2=_0xa63ec2-0x0;var _0x562c25=_0xadb5[_0xa63ec2];return _0x562c25;};'use strict';var _=require('lodash');var moment=require(_0x5adb('0x0'));var util=require('util');var Agent=require(_0x5adb('0x1'));var Telephone=require(_0x5adb('0x2'));var Trunk=require(_0x5adb('0x3'));var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x5adb('0x4'));var Template=require(_0x5adb('0x5'));var Campaign=require(_0x5adb('0x6'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x5adb('0x7'));var SalesforceAccount=require(_0x5adb('0x8'));var FreshdeskAccount=require(_0x5adb('0x9'));var SugarcrmAccount=require(_0x5adb('0xa'));var ZohoAccount=require(_0x5adb('0xb'));var DeskAccount=require(_0x5adb('0xc'));var VtigerAccount=require(_0x5adb('0xd'));var ServicenowAccount=require(_0x5adb('0xe'));var Dynamics365Account=require(_0x5adb('0xf'));var FreshsalesAccount=require(_0x5adb('0x10'));var FaxAccount=require(_0x5adb('0x11'));function Realtime(){this[_0x5adb('0x12')]={};this[_0x5adb('0x13')]={};this[_0x5adb('0x14')]={};this['voiceQueues']={};this['triggers']={};this[_0x5adb('0x15')]={};this[_0x5adb('0x16')]={};this[_0x5adb('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x5adb('0x18')]={};this['queueChannels']={};this[_0x5adb('0x19')]={};this['timers']={};this[_0x5adb('0x1a')]={};this[_0x5adb('0x1b')]={};this[_0x5adb('0x1c')]={};this['sugarcrmAccounts']={};this[_0x5adb('0x1d')]={};this[_0x5adb('0x1e')]={};this[_0x5adb('0x1f')]={};this['vtigerAccounts']={};this[_0x5adb('0x20')]={};this['dynamics365Accounts']={};this[_0x5adb('0x21')]={};this[_0x5adb('0x22')]={};}function freeIsNotKey(_0x30614e,_0x304784,_0x1c0f97){var _0x39d24d=_[_0x5adb('0x23')](_0x30614e,function(_0x42f4c6){return _0x42f4c6[_0x1c0f97];});for(var _0xb953a6 in _0x304784){if(_0x304784['hasOwnProperty'](_0xb953a6)){if(!_0x39d24d[_0xb953a6]){delete _0x304784[_0xb953a6];}}}}function freeIsNotKeySip(_0x3fff62,_0x5de028){var _0x1d9e86=_['mapKeys'](_0x3fff62,function(_0x3ef465){return util['format']('SIP/%s',_0x3ef465[_0x5adb('0x24')]);});for(var _0x1bed20 in _0x5de028){if(_0x5de028[_0x5adb('0x25')](_0x1bed20)){if(!_0x1d9e86[_0x1bed20]){delete _0x5de028[_0x1bed20];}}}}function freeIsNotKeyAgent(_0x1fd4a7,_0x99bc6c){var _0x5af69d=_[_0x5adb('0x23')](_0x1fd4a7,function(_0x5c296e){var _0x4e9f16=_[_0x5adb('0x26')](_0x5c296e[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x5c296e[_0x5adb('0x24')]):_0x5c296e[_0x5adb('0x27')];return _0x4e9f16;});for(var _0xfd9bb9 in _0x99bc6c){if(_0x99bc6c['hasOwnProperty'](_0xfd9bb9)){if(!_0x5af69d[_0xfd9bb9]){delete _0x99bc6c[_0xfd9bb9];}}}}function clearVoiceCallReports(_0x4b1957){_0x4b1957[_0x5adb('0x2a')]=0x0;_0x4b1957[_0x5adb('0x2b')]=0x0;_0x4b1957[_0x5adb('0x2c')]=0x0;_0x4b1957[_0x5adb('0x2d')]=0x0;_0x4b1957['sumBillable']=0x0;}function clearCampaigns(_0x2fee18){if(!_[_0x5adb('0x2e')](_0x2fee18)){for(var _0x5aed76 in _0x2fee18){if(_0x2fee18[_0x5adb('0x25')](_0x5aed76)){_0x2fee18[_0x5aed76][_0x5adb('0x2f')]=0x0;_0x2fee18[_0x5aed76][_0x5adb('0x30')]=0x0;}}}}function clearVoiceQueues(_0x55b40a){if(!_[_0x5adb('0x2e')](_0x55b40a)){for(var _0xbe21b1 in _0x55b40a){if(_0x55b40a[_0x5adb('0x25')](_0xbe21b1)){_0x55b40a[_0xbe21b1][_0x5adb('0x2a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x2b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x31')]=0x0;_0x55b40a[_0xbe21b1]['abandoned']=0x0;_0x55b40a[_0xbe21b1]['sumHoldTime']=0x0;_0x55b40a[_0xbe21b1]['sumDuration']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x32')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x34')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x35')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x36')]=0x0;_0x55b40a[_0xbe21b1]['outboundNoSuchCallsDay']=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x37')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x38')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x39')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3a')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3b')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3c')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3d')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x33')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3e')]=0x0;_0x55b40a[_0xbe21b1][_0x5adb('0x3f')]=!![];}}}}Realtime['prototype'][_0x5adb('0x40')]=function(_0x4c8b2e,_0x12424d){for(var _0x20cde6 in _0x12424d){if(_0x4c8b2e['hasOwnProperty'](_0x20cde6)){_0x4c8b2e[_0x20cde6]=_0x12424d[_0x20cde6];}}};Realtime[_0x5adb('0x41')][_0x5adb('0x42')]=function(){var _0x461a39=this;return function(_0x4a3661){if(_0x4a3661){freeIsNotKeyAgent(_0x4a3661,_0x461a39[_0x5adb('0x12')]);for(var _0x14cf00=0x0,_0x4b5887={};_0x14cf00<_0x4a3661['length'];_0x14cf00+=0x1){_0x4b5887=_0x4a3661[_0x14cf00];var _0x1ed9ea=_['isNil'](_0x4b5887[_0x5adb('0x27')])?util[_0x5adb('0x28')](_0x5adb('0x29'),_0x4b5887[_0x5adb('0x24')]):_0x4b5887[_0x5adb('0x27')];if(_['isUndefined'](_0x461a39[_0x5adb('0x12')][_0x1ed9ea])){_0x461a39[_0x5adb('0x12')][_0x1ed9ea]=new Agent(_0x4b5887);}else{_0x461a39[_0x5adb('0x40')](_0x461a39['agents'][_0x1ed9ea],_0x4b5887);}}}return _0x461a39['agents'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x43')]=function(){var _0x586820=this;return function(_0x2355bc){if(_0x2355bc){freeIsNotKeySip(_0x2355bc,_0x586820['telephones']);for(var _0x199d3b=0x0,_0x58cc5d={};_0x199d3b<_0x2355bc[_0x5adb('0x44')];_0x199d3b+=0x1){_0x58cc5d=_0x2355bc[_0x199d3b];if(_['isUndefined'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')]('SIP/%s',_0x58cc5d[_0x5adb('0x24')])])){_0x586820['telephones'][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])]=new Telephone(_0x58cc5d);}else{_0x586820['mergeFromDatabase'](_0x586820[_0x5adb('0x13')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x58cc5d[_0x5adb('0x24')])],_0x58cc5d);}}}return _0x586820[_0x5adb('0x13')];};};Realtime['prototype']['initTrunks']=function(){var _0x4f491a=this;return function(_0x599999){if(_0x599999){freeIsNotKeySip(_0x599999,_0x4f491a[_0x5adb('0x14')]);for(var _0x2fbe14=0x0,_0x3a104a={};_0x2fbe14<_0x599999[_0x5adb('0x44')];_0x2fbe14+=0x1){_0x3a104a=_0x599999[_0x2fbe14];if(_[_0x5adb('0x45')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])])){_0x4f491a['trunks'][util[_0x5adb('0x28')]('SIP/%s',_0x3a104a[_0x5adb('0x24')])]=new Trunk(_0x3a104a);}else{_0x4f491a[_0x5adb('0x40')](_0x4f491a[_0x5adb('0x14')][util[_0x5adb('0x28')](_0x5adb('0x29'),_0x3a104a['name'])],_0x3a104a);}}}return _0x4f491a[_0x5adb('0x14')];};};Realtime[_0x5adb('0x41')]['initTriggers']=function(){var _0x4160ad=this;return function(_0x1a256c){if(_0x1a256c){freeIsNotKey(_0x1a256c,_0x4160ad['triggers'],'id');for(var _0x120497=0x0,_0x407a4c={};_0x120497<_0x1a256c[_0x5adb('0x44')];_0x120497+=0x1){_0x407a4c=_0x1a256c[_0x120497];if(_[_0x5adb('0x45')](_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']])){_0x4160ad[_0x5adb('0x46')][_0x407a4c['id']]=new Trigger(_0x407a4c);}else{_0x4160ad[_0x5adb('0x40')](_0x4160ad['triggers'][_0x407a4c['id']],_0x407a4c);}}}return _0x4160ad['triggers'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x47')]=function(){var _0x1cd0a3=this;return function(_0xb79d85){if(_0xb79d85){freeIsNotKey(_0xb79d85,_0x1cd0a3['templates'],'id');for(var _0x507e48=0x0,_0xaa32e4={};_0x507e48<_0xb79d85[_0x5adb('0x44')];_0x507e48+=0x1){_0xaa32e4=_0xb79d85[_0x507e48];if(_[_0x5adb('0x45')](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']])){_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']]=new Template(_0xaa32e4);}else{_0x1cd0a3['mergeFromDatabase'](_0x1cd0a3[_0x5adb('0x16')][_0xaa32e4['id']],_0xaa32e4);}}}return _0x1cd0a3[_0x5adb('0x16')];};};Realtime['prototype'][_0x5adb('0x48')]=function(){var _0x251f45=this;return function(_0x1cdb03){if(_0x1cdb03){freeIsNotKey(_0x1cdb03,_0x251f45[_0x5adb('0x1b')],'id');for(var _0x186bd2=0x0,_0x3a5409={};_0x186bd2<_0x1cdb03[_0x5adb('0x44')];_0x186bd2+=0x1){_0x3a5409=_0x1cdb03[_0x186bd2];if(_[_0x5adb('0x45')](_0x251f45['zendeskAccounts'][_0x3a5409['id']])){_0x251f45[_0x5adb('0x1b')][_0x3a5409['id']]=new ZendeskAccount(_0x3a5409);}else{_0x251f45['mergeFromDatabase'](_0x251f45['zendeskAccounts'][_0x3a5409['id']],_0x3a5409);}}}return _0x251f45['zendeskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x49')]=function(){var _0x207a81=this;return function(_0x4ba0b5){if(_0x4ba0b5){freeIsNotKey(_0x4ba0b5,_0x207a81[_0x5adb('0x1c')],'id');for(var _0x5cbab5=0x0,_0x177a81={};_0x5cbab5<_0x4ba0b5[_0x5adb('0x44')];_0x5cbab5+=0x1){_0x177a81=_0x4ba0b5[_0x5cbab5];if(_[_0x5adb('0x45')](_0x207a81['salesforceAccounts'][_0x177a81['id']])){_0x207a81[_0x5adb('0x1c')][_0x177a81['id']]=new SalesforceAccount(_0x177a81);}else{_0x207a81['mergeFromDatabase'](_0x207a81[_0x5adb('0x1c')][_0x177a81['id']],_0x177a81);}}}return _0x207a81[_0x5adb('0x1c')];};};Realtime['prototype'][_0x5adb('0x4a')]=function(){var _0x1ab97b=this;return function(_0x3594e3){if(_0x3594e3){freeIsNotKey(_0x3594e3,_0x1ab97b[_0x5adb('0x1d')],'id');for(var _0x372734=0x0,_0x4cb36c={};_0x372734<_0x3594e3[_0x5adb('0x44')];_0x372734+=0x1){_0x4cb36c=_0x3594e3[_0x372734];if(_[_0x5adb('0x45')](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']])){_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']]=new FreshdeskAccount(_0x4cb36c);}else{_0x1ab97b['mergeFromDatabase'](_0x1ab97b[_0x5adb('0x1d')][_0x4cb36c['id']],_0x4cb36c);}}}return _0x1ab97b[_0x5adb('0x1d')];};};Realtime[_0x5adb('0x41')]['initZohoAccounts']=function(){var _0x2b34a8=this;return function(_0xd0e5b7){if(_0xd0e5b7){freeIsNotKey(_0xd0e5b7,_0x2b34a8[_0x5adb('0x1e')],'id');for(var _0xfd3471=0x0,_0x4f2da9={};_0xfd3471<_0xd0e5b7[_0x5adb('0x44')];_0xfd3471+=0x1){_0x4f2da9=_0xd0e5b7[_0xfd3471];if(_[_0x5adb('0x45')](_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']])){_0x2b34a8[_0x5adb('0x1e')][_0x4f2da9['id']]=new ZohoAccount(_0x4f2da9);}else{_0x2b34a8[_0x5adb('0x40')](_0x2b34a8['zohoAccounts'][_0x4f2da9['id']],_0x4f2da9);}}}return _0x2b34a8[_0x5adb('0x1e')];};};Realtime['prototype'][_0x5adb('0x4b')]=function(){var _0x4f7227=this;return function(_0x31ae72){if(_0x31ae72){freeIsNotKey(_0x31ae72,_0x4f7227[_0x5adb('0x1f')],'id');for(var _0x1a9358=0x0,_0x42f6d9={};_0x1a9358<_0x31ae72['length'];_0x1a9358+=0x1){_0x42f6d9=_0x31ae72[_0x1a9358];if(_[_0x5adb('0x45')](_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']])){_0x4f7227[_0x5adb('0x1f')][_0x42f6d9['id']]=new DeskAccount(_0x42f6d9);}else{_0x4f7227['mergeFromDatabase'](_0x4f7227['deskAccounts'][_0x42f6d9['id']],_0x42f6d9);}}}return _0x4f7227['deskAccounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x4c')]=function(){var _0xa5ecc0=this;return function(_0x12a146){if(_0x12a146){freeIsNotKey(_0x12a146,_0xa5ecc0[_0x5adb('0x4d')],'id');for(var _0xb06bee=0x0,_0x204b9b={};_0xb06bee<_0x12a146[_0x5adb('0x44')];_0xb06bee+=0x1){_0x204b9b=_0x12a146[_0xb06bee];if(_[_0x5adb('0x45')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']])){_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']]=new SugarcrmAccount(_0x204b9b);}else{_0xa5ecc0[_0x5adb('0x40')](_0xa5ecc0[_0x5adb('0x4d')][_0x204b9b['id']],_0x204b9b);}}}return _0xa5ecc0['sugarcrmAccounts'];};};Realtime['prototype'][_0x5adb('0x4e')]=function(){var _0x27a8e4=this;return function(_0x43cde9){if(_0x43cde9){freeIsNotKey(_0x43cde9,_0x27a8e4[_0x5adb('0x4f')],'id');for(var _0x5d7a9f=0x0,_0xfba0d5={};_0x5d7a9f<_0x43cde9[_0x5adb('0x44')];_0x5d7a9f+=0x1){_0xfba0d5=_0x43cde9[_0x5d7a9f];if(_['isUndefined'](_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']])){_0x27a8e4[_0x5adb('0x4f')][_0xfba0d5['id']]=new VtigerAccount(_0xfba0d5);}else{_0x27a8e4[_0x5adb('0x40')](_0x27a8e4['vtigerAccounts'][_0xfba0d5['id']],_0xfba0d5);}}}return _0x27a8e4[_0x5adb('0x4f')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x50')]=function(){var _0x30c92c=this;return function(_0x330290){if(_0x330290){freeIsNotKey(_0x330290,_0x30c92c[_0x5adb('0x20')],'id');for(var _0x513f26=0x0,_0x836b91={};_0x513f26<_0x330290[_0x5adb('0x44')];_0x513f26+=0x1){_0x836b91=_0x330290[_0x513f26];if(_[_0x5adb('0x45')](_0x30c92c['servicenowAccounts'][_0x836b91['id']])){_0x30c92c[_0x5adb('0x20')][_0x836b91['id']]=new ServicenowAccount(_0x836b91);}else{_0x30c92c[_0x5adb('0x40')](_0x30c92c[_0x5adb('0x20')][_0x836b91['id']],_0x836b91);}}}return _0x30c92c['servicenowAccounts'];};};Realtime[_0x5adb('0x41')]['initDynamics365Accounts']=function(){var _0xa8ff64=this;return function(_0x1e7e3a){if(_0x1e7e3a){freeIsNotKey(_0x1e7e3a,_0xa8ff64[_0x5adb('0x51')],'id');for(var _0x57f0a4=0x0,_0x192b1f={};_0x57f0a4<_0x1e7e3a[_0x5adb('0x44')];_0x57f0a4+=0x1){_0x192b1f=_0x1e7e3a[_0x57f0a4];if(_['isUndefined'](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']])){_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']]=new Dynamics365Account(_0x192b1f);}else{_0xa8ff64[_0x5adb('0x40')](_0xa8ff64[_0x5adb('0x51')][_0x192b1f['id']],_0x192b1f);}}}return _0xa8ff64['dynamics365Accounts'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x52')]=function(){var _0x307f07=this;return function(_0x16716e){if(_0x16716e){freeIsNotKey(_0x16716e,_0x307f07['freshsalesAccounts'],'id');for(var _0x53a4bc=0x0,_0x304512={};_0x53a4bc<_0x16716e['length'];_0x53a4bc+=0x1){_0x304512=_0x16716e[_0x53a4bc];if(_['isUndefined'](_0x307f07['freshsalesAccounts'][_0x304512['id']])){_0x307f07[_0x5adb('0x21')][_0x304512['id']]=new FreshsalesAccount(_0x304512);}else{_0x307f07[_0x5adb('0x40')](_0x307f07['freshsalesAccounts'][_0x304512['id']],_0x304512);}}}return _0x307f07[_0x5adb('0x21')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x53')]=function(){var _0xf6ef8a=this;return function(_0x358a23){for(var _0x126e38=0x0;_0x126e38<_0x358a23[_0x5adb('0x44')];_0x126e38+=0x1){_[_0x5adb('0x54')](_0xf6ef8a['voiceQueues'][_0x358a23[_0x126e38]['name']],_0x358a23[_0x126e38]);}return _0xf6ef8a['voiceQueues'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x55')]=function(){var _0x3a0d1b=this;return function(_0x2a55a3){clearVoiceQueues(_0x3a0d1b[_0x5adb('0x56')]);if(_0x2a55a3){_0x2a55a3=_[_0x5adb('0x57')](_0x2a55a3,_0x5adb('0x58'));for(var _0x25f761 in _0x2a55a3){if(_0x2a55a3['hasOwnProperty'](_0x25f761)){for(var _0x5e55c2=0x0;_0x5e55c2<_0x2a55a3[_0x25f761][_0x5adb('0x44')];_0x5e55c2+=0x1){var _0x56df90=_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x59')];if(_0x3a0d1b[_0x5adb('0x56')][_0x56df90]){if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5a')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x31')]+=0x1;}if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5b')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x5c')]+=0x1;}_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallerjoinAt']),_0x5adb('0x5f'))||0x0;if(_0x5e55c2===_0x2a55a3[_0x25f761][_0x5adb('0x44')]-0x1){_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=moment(_0x2a55a3[_0x25f761][_0x5e55c2]['queuecallercompleteAt']||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x60')]||_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x61')])['diff'](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x62')]),_0x5adb('0x5f'))||0x0;_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2a')]+=0x1;if(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x63')]){_0x3a0d1b[_0x5adb('0x56')][_0x56df90][_0x5adb('0x2b')]+=0x1;_0x3a0d1b[_0x5adb('0x56')][_0x56df90]['sumBillable']+=moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x64')])[_0x5adb('0x5e')](moment(_0x2a55a3[_0x25f761][_0x5e55c2][_0x5adb('0x5d')]),'seconds')||0x0;}}else{_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2d')]+=_0x3a0d1b['voiceQueues'][_0x56df90][_0x5adb('0x2c')]||0x0;}}}}}}return _0x3a0d1b[_0x5adb('0x56')];};};Realtime[_0x5adb('0x41')]['initVoiceCallReports']=function(){var _0x3a9735=this;return function(_0x288e4f){clearVoiceCallReports(_0x3a9735[_0x5adb('0x17')]);if(_0x288e4f){for(var _0x3ecc56=0x0;_0x3ecc56<_0x288e4f[_0x5adb('0x44')];_0x3ecc56+=0x1){_0x3a9735['outbound'][_0x5adb('0x2a')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2d')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')];if(_0x288e4f[_0x3ecc56]['disposition']===_0x5adb('0x66')){_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2b')]+=0x1;_0x3a9735[_0x5adb('0x17')][_0x5adb('0x2c')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x65')]-_0x288e4f[_0x3ecc56][_0x5adb('0x67')]||0x0;_0x3a9735['outbound'][_0x5adb('0x32')]+=_0x288e4f[_0x3ecc56][_0x5adb('0x67')];}}}return _0x3a9735['outbound'];};};Realtime[_0x5adb('0x41')][_0x5adb('0x68')]=function(){var _0x4fc0d5=this;return function(_0x462fa0){if(_0x462fa0){freeIsNotKey(_0x462fa0,_0x4fc0d5['campaigns'],_0x5adb('0x24'));for(var _0x268df2=0x0,_0x4a2ebc={};_0x268df2<_0x462fa0[_0x5adb('0x44')];_0x268df2+=0x1){_0x4a2ebc=_0x462fa0[_0x268df2];if(_['isUndefined'](_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]])){_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]]=new Campaign(_0x4a2ebc);}else{_0x4fc0d5[_0x5adb('0x40')](_0x4fc0d5['campaigns'][_0x4a2ebc[_0x5adb('0x24')]],_0x4a2ebc);_0x4fc0d5[_0x5adb('0x15')][_0x4a2ebc[_0x5adb('0x24')]][_0x5adb('0x69')]=_0x4a2ebc['SquareProject']?_0x4a2ebc['SquareProject'][_0x5adb('0x24')]:undefined;}}}return _0x4fc0d5[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6a')]=function(){var _0x277668=this;return function(_0xc74e86){if(_0xc74e86){freeIsNotKey(_0xc74e86,_0x277668[_0x5adb('0x6b')],'id');for(var _0x514833=0x0,_0xda26cc={};_0x514833<_0xc74e86[_0x5adb('0x44')];_0x514833+=0x1){_0xda26cc=_0xc74e86[_0x514833];if(_[_0x5adb('0x45')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']])){_0x277668['voiceExtensions'][_0xda26cc['id']]=new VoiceExtension(_0xda26cc);}else{_0x277668[_0x5adb('0x40')](_0x277668[_0x5adb('0x6b')][_0xda26cc['id']],_0xda26cc);}}}return _0x277668[_0x5adb('0x6b')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6c')]=function(){var _0x188cbd=this;return function(_0x315ac6){clearCampaigns(_0x188cbd[_0x5adb('0x15')]);for(var _0x1f753e=0x0;_0x1f753e<_0x315ac6['length'];_0x1f753e+=0x1){_[_0x5adb('0x54')](_0x188cbd[_0x5adb('0x15')][_0x315ac6[_0x1f753e]['name']],_0x315ac6[_0x1f753e]);}return _0x188cbd[_0x5adb('0x15')];};};Realtime[_0x5adb('0x41')][_0x5adb('0x6d')]=function(){var _0x3bb3fc=this;return function(_0x200221){if(_0x200221){freeIsNotKey(_0x200221,_0x3bb3fc[_0x5adb('0x22')],'id');for(var _0x450516=0x0,_0x350bb1={};_0x450516<_0x200221['length'];_0x450516+=0x1){_0x350bb1=_0x200221[_0x450516];if(_[_0x5adb('0x45')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']])){_0x3bb3fc['faxAccounts'][_0x350bb1['id']]=new FaxAccount(_0x350bb1);}else{_0x3bb3fc[_0x5adb('0x40')](_0x3bb3fc[_0x5adb('0x22')][_0x350bb1['id']],_0x350bb1);}}}return _0x3bb3fc[_0x5adb('0x22')];};};Realtime['prototype']['initVoiceQueues']=function(){var _0x2d7a9f=this;return function(_0x328851){if(_0x328851){freeIsNotKey(_0x328851,_0x2d7a9f[_0x5adb('0x56')],'name');for(var _0x14b36f=0x0,_0x321c3a={};_0x14b36f<_0x328851[_0x5adb('0x44')];_0x14b36f+=0x1){_0x321c3a=_0x328851[_0x14b36f];if(_[_0x5adb('0x45')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]])){_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]]=new VoiceQueue(_0x321c3a);}else{_0x2d7a9f[_0x5adb('0x40')](_0x2d7a9f[_0x5adb('0x56')][_0x321c3a[_0x5adb('0x24')]],_0x321c3a);}}}return _0x2d7a9f[_0x5adb('0x56')];};};module['exports']=Realtime; \ No newline at end of file +var _0xdb28=['initTriggers','triggers','initTemplates','initZendeskAccounts','zendeskAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queuecallerexit','queuecallerabandon','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','queuecallerleaveAt','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initVoiceQueues','exports','lodash','moment','util','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','campaigns','templates','voiceExtensions','channels','queueChannels','outboundChannels','timers','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','total','answered','unmanaged','abandoned','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','agents','length','isUndefined','mergeFromDatabase','initTelephones','initTrunks'];(function(_0x5d8168,_0x5b94c7){var _0x17e069=function(_0x1c8e16){while(--_0x1c8e16){_0x5d8168['push'](_0x5d8168['shift']());}};_0x17e069(++_0x5b94c7);}(_0xdb28,0x106));var _0x8db2=function(_0x34c3ed,_0x12b7b3){_0x34c3ed=_0x34c3ed-0x0;var _0xb57bff=_0xdb28[_0x34c3ed];return _0xb57bff;};'use strict';var _=require(_0x8db2('0x0'));var moment=require(_0x8db2('0x1'));var util=require(_0x8db2('0x2'));var Agent=require(_0x8db2('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x8db2('0x4'));var VoiceQueue=require(_0x8db2('0x5'));var Trigger=require(_0x8db2('0x6'));var Template=require(_0x8db2('0x7'));var Campaign=require(_0x8db2('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x8db2('0x9'));var SalesforceAccount=require(_0x8db2('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x8db2('0xb'));var DeskAccount=require(_0x8db2('0xc'));var VtigerAccount=require(_0x8db2('0xd'));var ServicenowAccount=require(_0x8db2('0xe'));var Dynamics365Account=require(_0x8db2('0xf'));var FreshsalesAccount=require(_0x8db2('0x10'));var FaxAccount=require(_0x8db2('0x11'));function Realtime(){this['agents']={};this[_0x8db2('0x12')]={};this[_0x8db2('0x13')]={};this[_0x8db2('0x14')]={};this['triggers']={};this[_0x8db2('0x15')]={};this[_0x8db2('0x16')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x8db2('0x17')]={};this[_0x8db2('0x18')]={};this[_0x8db2('0x19')]={};this[_0x8db2('0x1a')]={};this[_0x8db2('0x1b')]={};this['settings']={};this['zendeskAccounts']={};this[_0x8db2('0x1c')]={};this[_0x8db2('0x1d')]={};this[_0x8db2('0x1e')]={};this[_0x8db2('0x1f')]={};this[_0x8db2('0x20')]={};this[_0x8db2('0x21')]={};this[_0x8db2('0x22')]={};this[_0x8db2('0x23')]={};this[_0x8db2('0x24')]={};this[_0x8db2('0x25')]={};}function freeIsNotKey(_0x5489a9,_0x13b0f5,_0x24da1b){var _0x48101e=_[_0x8db2('0x26')](_0x5489a9,function(_0x44957d){return _0x44957d[_0x24da1b];});for(var _0x21db8c in _0x13b0f5){if(_0x13b0f5[_0x8db2('0x27')](_0x21db8c)){if(!_0x48101e[_0x21db8c]){delete _0x13b0f5[_0x21db8c];}}}}function freeIsNotKeySip(_0x2efd06,_0x46ce14){var _0x51d60d=_['mapKeys'](_0x2efd06,function(_0x77789){return util[_0x8db2('0x28')](_0x8db2('0x29'),_0x77789[_0x8db2('0x2a')]);});for(var _0x58562e in _0x46ce14){if(_0x46ce14[_0x8db2('0x27')](_0x58562e)){if(!_0x51d60d[_0x58562e]){delete _0x46ce14[_0x58562e];}}}}function freeIsNotKeyAgent(_0x36a9ff,_0x260940){var _0x297ba3=_[_0x8db2('0x26')](_0x36a9ff,function(_0x597260){var _0x124467=_[_0x8db2('0x2b')](_0x597260[_0x8db2('0x2c')])?util[_0x8db2('0x28')](_0x8db2('0x29'),_0x597260[_0x8db2('0x2a')]):_0x597260[_0x8db2('0x2c')];return _0x124467;});for(var _0x5c6614 in _0x260940){if(_0x260940[_0x8db2('0x27')](_0x5c6614)){if(!_0x297ba3[_0x5c6614]){delete _0x260940[_0x5c6614];}}}}function clearVoiceCallReports(_0x4f6516){_0x4f6516['total']=0x0;_0x4f6516['answered']=0x0;_0x4f6516['sumHoldTime']=0x0;_0x4f6516[_0x8db2('0x2d')]=0x0;_0x4f6516[_0x8db2('0x2e')]=0x0;}function clearCampaigns(_0x3be281){if(!_[_0x8db2('0x2f')](_0x3be281)){for(var _0x145328 in _0x3be281){if(_0x3be281[_0x8db2('0x27')](_0x145328)){_0x3be281[_0x145328]['ivrTotalCallsDays']=0x0;_0x3be281[_0x145328][_0x8db2('0x30')]=0x0;}}}}function clearVoiceQueues(_0x372311){if(!_[_0x8db2('0x2f')](_0x372311)){for(var _0x8b7cec in _0x372311){if(_0x372311['hasOwnProperty'](_0x8b7cec)){_0x372311[_0x8b7cec][_0x8db2('0x31')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x32')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x33')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x34')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x35')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x2d')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x2e')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x36')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x37')]=0x0;_0x372311[_0x8b7cec]['outboundBusyCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x38')]=0x0;_0x372311[_0x8b7cec]['outboundNoSuchCallsDay']=0x0;_0x372311[_0x8b7cec]['outboundUnknownCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x39')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3a')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3b')]=0x0;_0x372311[_0x8b7cec]['outboundOriginateFailureCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3c')]=0x0;_0x372311[_0x8b7cec]['outboundReCallsDay']=0x0;_0x372311[_0x8b7cec][_0x8db2('0x36')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3d')]=0x0;_0x372311[_0x8b7cec][_0x8db2('0x3e')]=!![];}}}}Realtime['prototype']['mergeFromDatabase']=function(_0x35d337,_0x1a460b){for(var _0x4df530 in _0x1a460b){if(_0x35d337['hasOwnProperty'](_0x4df530)){_0x35d337[_0x4df530]=_0x1a460b[_0x4df530];}}};Realtime[_0x8db2('0x3f')][_0x8db2('0x40')]=function(){var _0xc884a=this;return function(_0x2a2d65){if(_0x2a2d65){freeIsNotKeyAgent(_0x2a2d65,_0xc884a[_0x8db2('0x41')]);for(var _0xd39848=0x0,_0x101711={};_0xd39848<_0x2a2d65[_0x8db2('0x42')];_0xd39848+=0x1){_0x101711=_0x2a2d65[_0xd39848];var _0x46e0c8=_[_0x8db2('0x2b')](_0x101711['interface'])?util[_0x8db2('0x28')](_0x8db2('0x29'),_0x101711['name']):_0x101711[_0x8db2('0x2c')];if(_[_0x8db2('0x43')](_0xc884a['agents'][_0x46e0c8])){_0xc884a['agents'][_0x46e0c8]=new Agent(_0x101711);}else{_0xc884a[_0x8db2('0x44')](_0xc884a['agents'][_0x46e0c8],_0x101711);}}}return _0xc884a[_0x8db2('0x41')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x45')]=function(){var _0x22c896=this;return function(_0x5cc419){if(_0x5cc419){freeIsNotKeySip(_0x5cc419,_0x22c896[_0x8db2('0x12')]);for(var _0x5e34e0=0x0,_0x227a08={};_0x5e34e0<_0x5cc419[_0x8db2('0x42')];_0x5e34e0+=0x1){_0x227a08=_0x5cc419[_0x5e34e0];if(_[_0x8db2('0x43')](_0x22c896[_0x8db2('0x12')][util['format']('SIP/%s',_0x227a08[_0x8db2('0x2a')])])){_0x22c896[_0x8db2('0x12')][util['format'](_0x8db2('0x29'),_0x227a08[_0x8db2('0x2a')])]=new Telephone(_0x227a08);}else{_0x22c896[_0x8db2('0x44')](_0x22c896['telephones'][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x227a08[_0x8db2('0x2a')])],_0x227a08);}}}return _0x22c896[_0x8db2('0x12')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x46')]=function(){var _0x380046=this;return function(_0x1575ea){if(_0x1575ea){freeIsNotKeySip(_0x1575ea,_0x380046[_0x8db2('0x13')]);for(var _0x63c561=0x0,_0x21cf7c={};_0x63c561<_0x1575ea[_0x8db2('0x42')];_0x63c561+=0x1){_0x21cf7c=_0x1575ea[_0x63c561];if(_[_0x8db2('0x43')](_0x380046['trunks'][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x21cf7c['name'])])){_0x380046['trunks'][util[_0x8db2('0x28')]('SIP/%s',_0x21cf7c[_0x8db2('0x2a')])]=new Trunk(_0x21cf7c);}else{_0x380046[_0x8db2('0x44')](_0x380046[_0x8db2('0x13')][util[_0x8db2('0x28')](_0x8db2('0x29'),_0x21cf7c[_0x8db2('0x2a')])],_0x21cf7c);}}}return _0x380046[_0x8db2('0x13')];};};Realtime['prototype'][_0x8db2('0x47')]=function(){var _0x3d44de=this;return function(_0x40c69e){if(_0x40c69e){freeIsNotKey(_0x40c69e,_0x3d44de[_0x8db2('0x48')],'id');for(var _0x482b26=0x0,_0x424c27={};_0x482b26<_0x40c69e[_0x8db2('0x42')];_0x482b26+=0x1){_0x424c27=_0x40c69e[_0x482b26];if(_[_0x8db2('0x43')](_0x3d44de[_0x8db2('0x48')][_0x424c27['id']])){_0x3d44de['triggers'][_0x424c27['id']]=new Trigger(_0x424c27);}else{_0x3d44de[_0x8db2('0x44')](_0x3d44de['triggers'][_0x424c27['id']],_0x424c27);}}}return _0x3d44de[_0x8db2('0x48')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x49')]=function(){var _0x4d2164=this;return function(_0x4b0e72){if(_0x4b0e72){freeIsNotKey(_0x4b0e72,_0x4d2164[_0x8db2('0x16')],'id');for(var _0x47c556=0x0,_0x173cc7={};_0x47c556<_0x4b0e72[_0x8db2('0x42')];_0x47c556+=0x1){_0x173cc7=_0x4b0e72[_0x47c556];if(_[_0x8db2('0x43')](_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']])){_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']]=new Template(_0x173cc7);}else{_0x4d2164[_0x8db2('0x44')](_0x4d2164[_0x8db2('0x16')][_0x173cc7['id']],_0x173cc7);}}}return _0x4d2164[_0x8db2('0x16')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4a')]=function(){var _0x1362ed=this;return function(_0x36f9d6){if(_0x36f9d6){freeIsNotKey(_0x36f9d6,_0x1362ed['zendeskAccounts'],'id');for(var _0x449109=0x0,_0x2ada52={};_0x449109<_0x36f9d6[_0x8db2('0x42')];_0x449109+=0x1){_0x2ada52=_0x36f9d6[_0x449109];if(_[_0x8db2('0x43')](_0x1362ed['zendeskAccounts'][_0x2ada52['id']])){_0x1362ed['zendeskAccounts'][_0x2ada52['id']]=new ZendeskAccount(_0x2ada52);}else{_0x1362ed[_0x8db2('0x44')](_0x1362ed[_0x8db2('0x4b')][_0x2ada52['id']],_0x2ada52);}}}return _0x1362ed[_0x8db2('0x4b')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x494d6e=this;return function(_0x44ac56){if(_0x44ac56){freeIsNotKey(_0x44ac56,_0x494d6e[_0x8db2('0x1c')],'id');for(var _0x55c7dd=0x0,_0x383fa1={};_0x55c7dd<_0x44ac56[_0x8db2('0x42')];_0x55c7dd+=0x1){_0x383fa1=_0x44ac56[_0x55c7dd];if(_[_0x8db2('0x43')](_0x494d6e[_0x8db2('0x1c')][_0x383fa1['id']])){_0x494d6e['salesforceAccounts'][_0x383fa1['id']]=new SalesforceAccount(_0x383fa1);}else{_0x494d6e['mergeFromDatabase'](_0x494d6e[_0x8db2('0x1c')][_0x383fa1['id']],_0x383fa1);}}}return _0x494d6e[_0x8db2('0x1c')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4c')]=function(){var _0x3daed6=this;return function(_0x2bf408){if(_0x2bf408){freeIsNotKey(_0x2bf408,_0x3daed6[_0x8db2('0x1e')],'id');for(var _0x3ca2a7=0x0,_0x4187d6={};_0x3ca2a7<_0x2bf408[_0x8db2('0x42')];_0x3ca2a7+=0x1){_0x4187d6=_0x2bf408[_0x3ca2a7];if(_[_0x8db2('0x43')](_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']])){_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']]=new FreshdeskAccount(_0x4187d6);}else{_0x3daed6[_0x8db2('0x44')](_0x3daed6[_0x8db2('0x1e')][_0x4187d6['id']],_0x4187d6);}}}return _0x3daed6['freshdeskAccounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4d')]=function(){var _0x579317=this;return function(_0x27b644){if(_0x27b644){freeIsNotKey(_0x27b644,_0x579317[_0x8db2('0x1f')],'id');for(var _0x3af298=0x0,_0x547215={};_0x3af298<_0x27b644[_0x8db2('0x42')];_0x3af298+=0x1){_0x547215=_0x27b644[_0x3af298];if(_[_0x8db2('0x43')](_0x579317[_0x8db2('0x1f')][_0x547215['id']])){_0x579317[_0x8db2('0x1f')][_0x547215['id']]=new ZohoAccount(_0x547215);}else{_0x579317[_0x8db2('0x44')](_0x579317['zohoAccounts'][_0x547215['id']],_0x547215);}}}return _0x579317[_0x8db2('0x1f')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4e')]=function(){var _0x58bb60=this;return function(_0x1e7d1a){if(_0x1e7d1a){freeIsNotKey(_0x1e7d1a,_0x58bb60[_0x8db2('0x20')],'id');for(var _0x33dddd=0x0,_0x7b0de8={};_0x33dddd<_0x1e7d1a[_0x8db2('0x42')];_0x33dddd+=0x1){_0x7b0de8=_0x1e7d1a[_0x33dddd];if(_[_0x8db2('0x43')](_0x58bb60[_0x8db2('0x20')][_0x7b0de8['id']])){_0x58bb60['deskAccounts'][_0x7b0de8['id']]=new DeskAccount(_0x7b0de8);}else{_0x58bb60[_0x8db2('0x44')](_0x58bb60[_0x8db2('0x20')][_0x7b0de8['id']],_0x7b0de8);}}}return _0x58bb60['deskAccounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x4f')]=function(){var _0x533e41=this;return function(_0x107bbe){if(_0x107bbe){freeIsNotKey(_0x107bbe,_0x533e41[_0x8db2('0x1d')],'id');for(var _0x63e8f7=0x0,_0x30f4f3={};_0x63e8f7<_0x107bbe[_0x8db2('0x42')];_0x63e8f7+=0x1){_0x30f4f3=_0x107bbe[_0x63e8f7];if(_[_0x8db2('0x43')](_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']])){_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']]=new SugarcrmAccount(_0x30f4f3);}else{_0x533e41[_0x8db2('0x44')](_0x533e41[_0x8db2('0x1d')][_0x30f4f3['id']],_0x30f4f3);}}}return _0x533e41[_0x8db2('0x1d')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x50')]=function(){var _0x1ce89f=this;return function(_0x64ec90){if(_0x64ec90){freeIsNotKey(_0x64ec90,_0x1ce89f[_0x8db2('0x21')],'id');for(var _0x4a20a7=0x0,_0xe0c3e={};_0x4a20a7<_0x64ec90[_0x8db2('0x42')];_0x4a20a7+=0x1){_0xe0c3e=_0x64ec90[_0x4a20a7];if(_[_0x8db2('0x43')](_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']])){_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']]=new VtigerAccount(_0xe0c3e);}else{_0x1ce89f['mergeFromDatabase'](_0x1ce89f[_0x8db2('0x21')][_0xe0c3e['id']],_0xe0c3e);}}}return _0x1ce89f[_0x8db2('0x21')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x51')]=function(){var _0x2ad70f=this;return function(_0x348da8){if(_0x348da8){freeIsNotKey(_0x348da8,_0x2ad70f[_0x8db2('0x22')],'id');for(var _0x2c7b04=0x0,_0x24cfe9={};_0x2c7b04<_0x348da8[_0x8db2('0x42')];_0x2c7b04+=0x1){_0x24cfe9=_0x348da8[_0x2c7b04];if(_[_0x8db2('0x43')](_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']])){_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']]=new ServicenowAccount(_0x24cfe9);}else{_0x2ad70f[_0x8db2('0x44')](_0x2ad70f[_0x8db2('0x22')][_0x24cfe9['id']],_0x24cfe9);}}}return _0x2ad70f[_0x8db2('0x22')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x52')]=function(){var _0x5a719f=this;return function(_0x3273dd){if(_0x3273dd){freeIsNotKey(_0x3273dd,_0x5a719f['dynamics365Accounts'],'id');for(var _0x364176=0x0,_0x570c53={};_0x364176<_0x3273dd[_0x8db2('0x42')];_0x364176+=0x1){_0x570c53=_0x3273dd[_0x364176];if(_[_0x8db2('0x43')](_0x5a719f[_0x8db2('0x23')][_0x570c53['id']])){_0x5a719f[_0x8db2('0x23')][_0x570c53['id']]=new Dynamics365Account(_0x570c53);}else{_0x5a719f[_0x8db2('0x44')](_0x5a719f['dynamics365Accounts'][_0x570c53['id']],_0x570c53);}}}return _0x5a719f['dynamics365Accounts'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x53')]=function(){var _0x21ec87=this;return function(_0x3ba1d2){if(_0x3ba1d2){freeIsNotKey(_0x3ba1d2,_0x21ec87[_0x8db2('0x24')],'id');for(var _0x1f28d2=0x0,_0x3e3de3={};_0x1f28d2<_0x3ba1d2[_0x8db2('0x42')];_0x1f28d2+=0x1){_0x3e3de3=_0x3ba1d2[_0x1f28d2];if(_['isUndefined'](_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']])){_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']]=new FreshsalesAccount(_0x3e3de3);}else{_0x21ec87[_0x8db2('0x44')](_0x21ec87[_0x8db2('0x24')][_0x3e3de3['id']],_0x3e3de3);}}}return _0x21ec87[_0x8db2('0x24')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x54')]=function(){var _0x20caf0=this;return function(_0x4938bb){for(var _0x54318c=0x0;_0x54318c<_0x4938bb[_0x8db2('0x42')];_0x54318c+=0x1){_[_0x8db2('0x55')](_0x20caf0[_0x8db2('0x14')][_0x4938bb[_0x54318c][_0x8db2('0x2a')]],_0x4938bb[_0x54318c]);}return _0x20caf0[_0x8db2('0x14')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0x3611da=this;return function(_0x364807){clearVoiceQueues(_0x3611da['voiceQueues']);if(_0x364807){_0x364807=_[_0x8db2('0x56')](_0x364807,_0x8db2('0x57'));for(var _0x1ab84c in _0x364807){if(_0x364807['hasOwnProperty'](_0x1ab84c)){for(var _0x26523b=0x0;_0x26523b<_0x364807[_0x1ab84c][_0x8db2('0x42')];_0x26523b+=0x1){var _0x2cf731=_0x364807[_0x1ab84c][_0x26523b]['queue'];if(_0x3611da[_0x8db2('0x14')][_0x2cf731]){if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x58')]){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x33')]+=0x1;}if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x59')]){_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x34')]+=0x1;}_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x35')]+=moment(_0x364807[_0x1ab84c][_0x26523b]['queuecallerleaveAt'])['diff'](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5a')]),_0x8db2('0x5b'))||0x0;if(_0x26523b===_0x364807[_0x1ab84c]['length']-0x1){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x2d')]+=moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5c')]||_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5d')]||_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5e')])[_0x8db2('0x5f')](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x5a')]),_0x8db2('0x5b'))||0x0;_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x31')]+=0x1;if(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x60')]){_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x32')]+=0x1;_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x2e')]+=moment(_0x364807[_0x1ab84c][_0x26523b]['queuecallercompleteAt'])[_0x8db2('0x5f')](moment(_0x364807[_0x1ab84c][_0x26523b][_0x8db2('0x61')]),'seconds')||0x0;}}else{_0x3611da[_0x8db2('0x14')][_0x2cf731][_0x8db2('0x2d')]+=_0x3611da['voiceQueues'][_0x2cf731][_0x8db2('0x35')]||0x0;}}}}}}return _0x3611da[_0x8db2('0x14')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x62')]=function(){var _0x242379=this;return function(_0x31a095){clearVoiceCallReports(_0x242379[_0x8db2('0x63')]);if(_0x31a095){for(var _0x3ac0fa=0x0;_0x3ac0fa<_0x31a095[_0x8db2('0x42')];_0x3ac0fa+=0x1){_0x242379['outbound']['total']+=0x1;_0x242379[_0x8db2('0x63')]['sumDuration']+=_0x31a095[_0x3ac0fa][_0x8db2('0x64')];if(_0x31a095[_0x3ac0fa][_0x8db2('0x65')]===_0x8db2('0x66')){_0x242379['outbound'][_0x8db2('0x32')]+=0x1;_0x242379[_0x8db2('0x63')][_0x8db2('0x35')]+=_0x31a095[_0x3ac0fa]['duration']-_0x31a095[_0x3ac0fa][_0x8db2('0x67')]||0x0;_0x242379[_0x8db2('0x63')][_0x8db2('0x2e')]+=_0x31a095[_0x3ac0fa][_0x8db2('0x67')];}}}return _0x242379['outbound'];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x68')]=function(){var _0x299640=this;return function(_0x1edb1a){if(_0x1edb1a){freeIsNotKey(_0x1edb1a,_0x299640[_0x8db2('0x15')],_0x8db2('0x2a'));for(var _0x1aadfb=0x0,_0x3682bf={};_0x1aadfb<_0x1edb1a[_0x8db2('0x42')];_0x1aadfb+=0x1){_0x3682bf=_0x1edb1a[_0x1aadfb];if(_[_0x8db2('0x43')](_0x299640[_0x8db2('0x15')][_0x3682bf['name']])){_0x299640[_0x8db2('0x15')][_0x3682bf[_0x8db2('0x2a')]]=new Campaign(_0x3682bf);}else{_0x299640[_0x8db2('0x44')](_0x299640['campaigns'][_0x3682bf['name']],_0x3682bf);_0x299640['campaigns'][_0x3682bf[_0x8db2('0x2a')]][_0x8db2('0x69')]=_0x3682bf[_0x8db2('0x6a')]?_0x3682bf[_0x8db2('0x6a')][_0x8db2('0x2a')]:undefined;}}}return _0x299640[_0x8db2('0x15')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x6b')]=function(){var _0x3b1929=this;return function(_0x37cf6d){if(_0x37cf6d){freeIsNotKey(_0x37cf6d,_0x3b1929[_0x8db2('0x17')],'id');for(var _0x4d0ff6=0x0,_0x360a06={};_0x4d0ff6<_0x37cf6d[_0x8db2('0x42')];_0x4d0ff6+=0x1){_0x360a06=_0x37cf6d[_0x4d0ff6];if(_[_0x8db2('0x43')](_0x3b1929[_0x8db2('0x17')][_0x360a06['id']])){_0x3b1929['voiceExtensions'][_0x360a06['id']]=new VoiceExtension(_0x360a06);}else{_0x3b1929['mergeFromDatabase'](_0x3b1929[_0x8db2('0x17')][_0x360a06['id']],_0x360a06);}}}return _0x3b1929[_0x8db2('0x17')];};};Realtime['prototype'][_0x8db2('0x6c')]=function(){var _0x121f31=this;return function(_0x9132b4){clearCampaigns(_0x121f31['campaigns']);for(var _0x5dc46c=0x0;_0x5dc46c<_0x9132b4['length'];_0x5dc46c+=0x1){_[_0x8db2('0x55')](_0x121f31[_0x8db2('0x15')][_0x9132b4[_0x5dc46c][_0x8db2('0x2a')]],_0x9132b4[_0x5dc46c]);}return _0x121f31[_0x8db2('0x15')];};};Realtime[_0x8db2('0x3f')]['initFaxAccounts']=function(){var _0x30930a=this;return function(_0x5e349c){if(_0x5e349c){freeIsNotKey(_0x5e349c,_0x30930a[_0x8db2('0x25')],'id');for(var _0x353101=0x0,_0xa083b1={};_0x353101<_0x5e349c[_0x8db2('0x42')];_0x353101+=0x1){_0xa083b1=_0x5e349c[_0x353101];if(_[_0x8db2('0x43')](_0x30930a['faxAccounts'][_0xa083b1['id']])){_0x30930a['faxAccounts'][_0xa083b1['id']]=new FaxAccount(_0xa083b1);}else{_0x30930a[_0x8db2('0x44')](_0x30930a['faxAccounts'][_0xa083b1['id']],_0xa083b1);}}}return _0x30930a[_0x8db2('0x25')];};};Realtime[_0x8db2('0x3f')][_0x8db2('0x6d')]=function(){var _0x1e7bc2=this;return function(_0x2b7224){if(_0x2b7224){freeIsNotKey(_0x2b7224,_0x1e7bc2[_0x8db2('0x14')],'name');for(var _0x19f9a0=0x0,_0x222ea2={};_0x19f9a0<_0x2b7224[_0x8db2('0x42')];_0x19f9a0+=0x1){_0x222ea2=_0x2b7224[_0x19f9a0];if(_['isUndefined'](_0x1e7bc2[_0x8db2('0x14')][_0x222ea2[_0x8db2('0x2a')]])){_0x1e7bc2['voiceQueues'][_0x222ea2[_0x8db2('0x2a')]]=new VoiceQueue(_0x222ea2);}else{_0x1e7bc2[_0x8db2('0x44')](_0x1e7bc2[_0x8db2('0x14')][_0x222ea2[_0x8db2('0x2a')]],_0x222ea2);}}}return _0x1e7bc2[_0x8db2('0x14')];};};module[_0x8db2('0x6e')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/realtime/utils.js b/server/services/ami/realtime/utils.js index 996e8be..0135e91 100644 --- a/server/services/ami/realtime/utils.js +++ b/server/services/ami/realtime/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x230d=['assign'];(function(_0x5c2a2b,_0x22c94e){var _0x19921f=function(_0x3fb937){while(--_0x3fb937){_0x5c2a2b['push'](_0x5c2a2b['shift']());}};_0x19921f(++_0x22c94e);}(_0x230d,0xd4));var _0xd230=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0x230d[_0x4a9fb1];return _0x348672;};'use strict';function mergeDBDataToRealtime(_0x2624d6,_0x1dacf8){var _0x97260a=Object[_0xd230('0x0')]({},_0x2624d6);for(var _0x543423 in _0x1dacf8){if(_0x97260a['hasOwnProperty'](_0x543423)){_0x97260a[_0x543423]=_0x1dacf8[_0x543423];}}return _0x97260a;}exports['mergeDBDataToRealtime']=mergeDBDataToRealtime; \ No newline at end of file +var _0x7628=['mergeDBDataToRealtime','assign','hasOwnProperty'];(function(_0x18cbf6,_0x474e1e){var _0x1183fa=function(_0x2a02ab){while(--_0x2a02ab){_0x18cbf6['push'](_0x18cbf6['shift']());}};_0x1183fa(++_0x474e1e);}(_0x7628,0xd6));var _0x8762=function(_0xeec92d,_0xb36d87){_0xeec92d=_0xeec92d-0x0;var _0x3f4059=_0x7628[_0xeec92d];return _0x3f4059;};'use strict';function mergeDBDataToRealtime(_0x51a3d4,_0x2a2d69){var _0xc5853c=Object[_0x8762('0x0')]({},_0x51a3d4);for(var _0x494ccb in _0x2a2d69){if(_0xc5853c[_0x8762('0x1')](_0x494ccb)){_0xc5853c[_0x494ccb]=_0x2a2d69[_0x494ccb];}}return _0xc5853c;}exports[_0x8762('0x2')]=mergeDBDataToRealtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 5ec1181..063a565 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 _0xe35e=['lastdata','queue','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','calleridnum','destinationchannel','disposition','ANSWERED','callerid','\x22%s\x22\x20<%s>','calleridname','linkedid','transfereelinkedid','uniqueid','transfers','split','monitor','monitors','createdAt','connectedlinename','membername','exten','originatecalleridnum','xcally-motion-dialer','isArray','forEach','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','../../../config/environment','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','interface','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','getAgentByInternal','keys','getCallType','channel','outbound','internal','destination','type','dialer','lastapplication'];(function(_0x50055b,_0x3d86e2){var _0x42d1ae=function(_0x29dbad){while(--_0x29dbad){_0x50055b['push'](_0x50055b['shift']());}};_0x42d1ae(++_0x3d86e2);}(_0xe35e,0xe6));var _0xee35=function(_0x3b90ab,_0x174a22){_0x3b90ab=_0x3b90ab-0x0;var _0x206e92=_0xe35e[_0x3b90ab];return _0x206e92;};'use strict';var _=require(_0xee35('0x0'));var moment=require('moment');var util=require('util');var config=require(_0xee35('0x1'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0xee35('0x2'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xee35('0x3'));var RpcMemberReport=require(_0xee35('0x4'));var RpcVoiceQueueReport=require(_0xee35('0x5'));var RpcVoiceRecording=require(_0xee35('0x6'));var RpcVoiceTransferReport=require(_0xee35('0x7'));var VoiceQueueReport=require(_0xee35('0x8'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xee35('0x9'));var VoiceDialReport=require(_0xee35('0xa'));var UserReport=require(_0xee35('0xb'));function Report(_0xce1ddf){this[_0xee35('0xc')]=_0xce1ddf;this[_0xee35('0xd')]=_0xce1ddf[_0xee35('0xd')];this[_0xee35('0xe')]=_0xce1ddf[_0xee35('0xe')];}Report[_0xee35('0xf')][_0xee35('0x10')]=function(_0x367d22){var _0x4cc277=new VoiceQueueReport(this[_0xee35('0xc')]);var _0xd22d88=new VoiceAgentReport(this['realtime']);var _0x115e0e=new VoiceDialReport(this[_0xee35('0xc')]);var _0x437917=new VoiceCallReport(this[_0xee35('0xc')]);var _0x2d4e2c=new UserReport(this['realtime']);if(config[_0xee35('0x11')]&&config[_0xee35('0x11')][_0xee35('0x12')]){ami['on']('custom:voiceQueueReport',this[_0xee35('0x13')]['bind'](this));ami['on'](_0xee35('0x14'),this[_0xee35('0x15')][_0xee35('0x16')](this));ami['on']('custom:voiceAgentReport',this[_0xee35('0x17')][_0xee35('0x16')](this));ami['on'](_0xee35('0x18'),this[_0xee35('0x19')][_0xee35('0x16')](this));ami['on'](_0xee35('0x1a'),this[_0xee35('0x1b')][_0xee35('0x16')](this));ami['on'](_0xee35('0x1c'),this[_0xee35('0x1d')][_0xee35('0x16')](this));}};Report['prototype'][_0xee35('0x1e')]=function(_0x44cb7e){var _0x1712e1;_0x1712e1=_[_0xee35('0x1f')](this[_0xee35('0xd')],function(_0x45082b){return _0x45082b[_0xee35('0x20')]==_0x44cb7e||_0x45082b[_0xee35('0x21')]==_0x44cb7e;});if(_[_0xee35('0x22')](_0x1712e1)){var _0x336337=_[_0xee35('0x1f')](this[_0xee35('0xe')],function(_0x1887f2){return _0x1887f2[_0xee35('0x20')]==_0x44cb7e||_0x1887f2[_0xee35('0x21')]==_0x44cb7e;});if(_0x336337){_0x1712e1=_[_0xee35('0x1f')](this['agents'],function(_0x51d288){return _0x51d288['interface']==util[_0xee35('0x23')](_0xee35('0x24'),_0x336337['name']);});}}return _0x1712e1;};Report[_0xee35('0xf')][_0xee35('0x13')]=function(_0x2c7b1c){for(var _0x207331=0x0;_0x207331<_0x2c7b1c[_0xee35('0x25')];_0x207331+=0x1){var _0x3686af=this[_0xee35('0x1e')](_0x2c7b1c[_0x207331][_0xee35('0x26')]);if(_0x3686af){_0x2c7b1c[_0x207331][_0xee35('0x20')]=_0x3686af[_0xee35('0x20')];_0x2c7b1c[_0x207331][_0xee35('0x27')]=!![];_0x2c7b1c[_0x207331][_0xee35('0x28')]=_0x3686af['name'];_0x2c7b1c[_0x207331][_0xee35('0x29')]=_['isNil'](_0x3686af[_0xee35('0x29')])?util[_0xee35('0x23')](_0xee35('0x24'),_0x3686af[_0xee35('0x21')]):_0x3686af[_0xee35('0x29')];if(_0x2c7b1c[_0x207331][_0xee35('0x2a')]){_0x2c7b1c[_0x207331]['queuecallercompleteAt']=moment()[_0xee35('0x23')](_0xee35('0x2b'));}if(_0x2c7b1c[_0x207331][_0xee35('0x2c')]){_0x2c7b1c[_0x207331][_0xee35('0x2d')]=moment()['format'](_0xee35('0x2b'));}RpcMemberReport[_0xee35('0x13')](_0x2c7b1c[_0x207331]);}RpcVoiceQueueReport[_0xee35('0x2e')](_0x2c7b1c[_0x207331]);}};function extractCalleridNumber(_0x2f9e11){var _0x5d8306=_0x2f9e11[_0xee35('0x2f')](/<(.*?)>/);return _0x5d8306?_0x5d8306[0x1]:_0x2f9e11;}Report[_0xee35('0xf')][_0xee35('0x30')]=function(_0x5bd489){for(var _0x464ada=0x0;_0x464ada','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','getCallType','UserId','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','forEach','create','voiceDialReport','startsWith','indexOf','mobile','phone','substring','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../rpc/voiceCallReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./userReport','realtime','agents','telephones','sync','xdr','bind','custom:voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','findAgent','accountcode'];(function(_0x46a1a0,_0x13e5a6){var _0x1a5c65=function(_0x3e11b8){while(--_0x3e11b8){_0x46a1a0['push'](_0x46a1a0['shift']());}};_0x1a5c65(++_0x13e5a6);}(_0x22c9,0x153));var _0x922c=function(_0x3a91dc,_0x2bff89){_0x3a91dc=_0x3a91dc-0x0;var _0x7afc54=_0x22c9[_0x3a91dc];return _0x7afc54;};'use strict';var _=require(_0x922c('0x0'));var moment=require(_0x922c('0x1'));var util=require(_0x922c('0x2'));var config=require('../../../config/environment');var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x922c('0x3'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x922c('0x4'));var RpcVoiceRecording=require(_0x922c('0x5'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x922c('0x6'));var VoiceCallReport=require(_0x922c('0x7'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x922c('0x8'));function Report(_0x355f30){this[_0x922c('0x9')]=_0x355f30;this[_0x922c('0xa')]=_0x355f30[_0x922c('0xa')];this[_0x922c('0xb')]=_0x355f30[_0x922c('0xb')];}Report['prototype'][_0x922c('0xc')]=function(_0x55c820){var _0x2e93a2=new VoiceQueueReport(this[_0x922c('0x9')]);var _0x34a830=new VoiceAgentReport(this[_0x922c('0x9')]);var _0x35c5eb=new VoiceDialReport(this[_0x922c('0x9')]);var _0x2908ca=new VoiceCallReport(this[_0x922c('0x9')]);var _0x261d26=new UserReport(this[_0x922c('0x9')]);if(config[_0x922c('0xd')]&&config[_0x922c('0xd')]['disabled']){ami['on']('custom:voiceQueueReport',this['voiceQueueReport'][_0x922c('0xe')](this));ami['on'](_0x922c('0xf'),this['voiceCallReport']['bind'](this));ami['on'](_0x922c('0x10'),this[_0x922c('0x11')]['bind'](this));ami['on'](_0x922c('0x12'),this['voiceDialReport'][_0x922c('0xe')](this));ami['on'](_0x922c('0x13'),this[_0x922c('0x14')][_0x922c('0xe')](this));ami['on'](_0x922c('0x15'),this[_0x922c('0x16')][_0x922c('0xe')](this));}};Report['prototype'][_0x922c('0x17')]=function(_0x3064a2){var _0x1bde45;_0x1bde45=_['find'](this[_0x922c('0xa')],function(_0x22e66f){return _0x22e66f[_0x922c('0x18')]==_0x3064a2||_0x22e66f[_0x922c('0x19')]==_0x3064a2;});if(_[_0x922c('0x1a')](_0x1bde45)){var _0xa5337c=_[_0x922c('0x1b')](this[_0x922c('0xb')],function(_0x35b2b2){return _0x35b2b2[_0x922c('0x18')]==_0x3064a2||_0x35b2b2['name']==_0x3064a2;});if(_0xa5337c){_0x1bde45=_['find'](this[_0x922c('0xa')],function(_0x120da2){return _0x120da2[_0x922c('0x1c')]==util[_0x922c('0x1d')]('SIP/%s',_0xa5337c[_0x922c('0x19')]);});}}return _0x1bde45;};Report[_0x922c('0x1e')]['voiceQueueReport']=function(_0x286ced){for(var _0x48435f=0x0;_0x48435f<_0x286ced['length'];_0x48435f+=0x1){var _0x2326b2=this[_0x922c('0x17')](_0x286ced[_0x48435f][_0x922c('0x1f')]);if(_0x2326b2){_0x286ced[_0x48435f][_0x922c('0x18')]=_0x2326b2['accountcode'];_0x286ced[_0x48435f]['assigned']=!![];_0x286ced[_0x48435f][_0x922c('0x20')]=_0x2326b2['name'];_0x286ced[_0x48435f][_0x922c('0x1c')]=_[_0x922c('0x1a')](_0x2326b2[_0x922c('0x1c')])?util[_0x922c('0x1d')](_0x922c('0x21'),_0x2326b2[_0x922c('0x19')]):_0x2326b2[_0x922c('0x1c')];if(_0x286ced[_0x48435f][_0x922c('0x22')]){_0x286ced[_0x48435f]['queuecallercompleteAt']=moment()[_0x922c('0x1d')](_0x922c('0x23'));}if(_0x286ced[_0x48435f][_0x922c('0x24')]){_0x286ced[_0x48435f][_0x922c('0x25')]=moment()[_0x922c('0x1d')](_0x922c('0x23'));}RpcMemberReport[_0x922c('0x26')](_0x286ced[_0x48435f]);}RpcVoiceQueueReport['create'](_0x286ced[_0x48435f]);}};function extractCalleridNumber(_0x260049){var _0x1aa578=_0x260049[_0x922c('0x27')](/<(.*?)>/);return _0x1aa578?_0x1aa578[0x1]:_0x260049;}Report[_0x922c('0x1e')]['getAgentByInternal']=function(_0x2ef795){for(var _0x1b91a8=0x0;_0x1b91a80x0?!![]:![];if(!_0x6e5c98){return this['syncQueueSummaryComplete'](this[_0x13b0('0x14')][_0x13b0('0x68')]);}};VoiceQueueReport[_0x13b0('0xa')][_0x13b0('0x19')]=function(_0x3cb7b5){var _0x1c52af=this[_0x13b0('0x14')]['id'];if(this[_0x13b0('0x14')]['queuestatus'][_0x1c52af]&&this[_0x13b0('0x14')][_0x13b0('0x60')][_0x1c52af][_0x3cb7b5[_0x13b0('0x5f')]]){this[_0x13b0('0x14')][_0x13b0('0x60')][_0x1c52af][_0x3cb7b5[_0x13b0('0x5f')]][_0x13b0('0x10')][_0x13b0('0x69')](_0x3cb7b5);}};VoiceQueueReport[_0x13b0('0xa')][_0x13b0('0x6a')]=function(_0x2c8dbf){var _0x265d3f=this;try{if(this['isNotNull'](_0x2c8dbf)&&this[_0x13b0('0x58')](_0x2c8dbf[_0x13b0('0x4c')])){logger[_0x13b0('0x46')](_0x13b0('0x6b'),util[_0x13b0('0x40')](_0x2c8dbf,{'showHidden':![],'depth':null}));var _0xa65d3f=this[_0x13b0('0x12')][_0x2c8dbf['queue']];if(_0xa65d3f){logger[_0x13b0('0x6c')](_0x13b0('0x6d'),_0xa65d3f[_0x13b0('0x62')]);this[_0x13b0('0x14')][_0x13b0('0x5a')][_0xa65d3f['name']]={'summaryEvent':_0x2c8dbf};this['summary'][_0x13b0('0x67')]+=0x1;return ami[_0x13b0('0x37')]({'action':'queuestatus','queue':_0xa65d3f['name']})[_0x13b0('0x5e')](function(_0x1ba657){if(!_0x265d3f['summary'][_0x13b0('0x60')][_0x2c8dbf[_0x13b0('0x5f')]]){_0x265d3f[_0x13b0('0x14')][_0x13b0('0x60')][_0x2c8dbf['actionid']]={};}_0x265d3f[_0x13b0('0x14')][_0x13b0('0x60')][_0x2c8dbf[_0x13b0('0x5f')]][_0x1ba657[_0x13b0('0x5f')]]={'queue':_0xa65d3f['name'],'agents':[]};})[_0x13b0('0x3a')](function(_0x8e00b6){throw _0x8e00b6;});}}}catch(_0x46548a){logger['error']('[voiceQueueReport][queuesummary]',util[_0x13b0('0x40')](_0x46548a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x13b0('0xa')]['syncQueueSummaryComplete']=function(_0xe2bc60){if(this[_0x13b0('0x14')]['statusRequests']>0x0){this[_0x13b0('0x14')]['completeEvent']=_0xe2bc60;return;}logger[_0x13b0('0x46')](_0x13b0('0x6e'),util[_0x13b0('0x40')](_0xe2bc60,{'showHidden':![],'depth':null}));this[_0x13b0('0x14')]=initializeSummary();ami[_0x13b0('0x45')](_0x13b0('0x6f'),{});};VoiceQueueReport[_0x13b0('0xa')]['syncQueueCallerJoin']=function(_0x484436){try{if(this[_0x13b0('0x58')](_0x484436)){logger[_0x13b0('0x46')](_0x13b0('0x70'),_0x484436[_0x13b0('0x49')],util[_0x13b0('0x40')](_0x484436,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x13b0('0xe')][_0x484436[_0x13b0('0x49')]])){this[_0x13b0('0xe')][_0x484436['uniqueid']]=[];}if(_[_0x13b0('0x59')](this[_0x13b0('0x11')][_0x484436['uniqueid']])){this[_0x13b0('0x11')][_0x484436[_0x13b0('0x49')]]={};}var _0x445e14=new QueueReport();_0x445e14[_0x13b0('0x4c')]=_0x484436[_0x13b0('0x4c')];_0x445e14['type']=this['voiceQueues'][_0x445e14[_0x13b0('0x4c')]]&&this[_0x13b0('0x12')][_0x445e14['queue']][_0x13b0('0x55')]?this['voiceQueues'][_0x445e14[_0x13b0('0x4c')]]['type']||_0x13b0('0x56'):_0x13b0('0x56');_0x445e14[_0x13b0('0x71')]=moment()[_0x13b0('0x4a')](_0x13b0('0x72'));_0x445e14[_0x13b0('0x73')]=_0x484436[_0x13b0('0x73')];_0x445e14[_0x13b0('0x74')]=_0x484436['count'];_0x445e14[_0x13b0('0x49')]=_0x484436[_0x13b0('0x49')];_0x445e14[_0x13b0('0x75')]=this[_0x13b0('0x11')][_0x484436[_0x13b0('0x49')]][_0x13b0('0x75')];logger[_0x13b0('0x6c')](_0x13b0('0x76'),_0x445e14[_0x13b0('0x4c')],_0x445e14[_0x13b0('0x55')]);_[_0x13b0('0x77')](_0x445e14,_[_0x13b0('0x78')](_0x484436,_['keys'](_0x445e14)));this['queueReports'][_0x484436[_0x13b0('0x49')]][_0x13b0('0x69')](_0x445e14);this[_0x13b0('0x11')][_0x484436[_0x13b0('0x49')]]=_0x445e14;this[_0x13b0('0x79')](_0x445e14,_0x13b0('0x7a'));}}catch(_0x3a0316){logger[_0x13b0('0x3d')](_0x13b0('0x70'),_0x484436[_0x13b0('0x49')],util['inspect'](_0x3a0316,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x13b0('0xa')]['syncQueueCallerAbandon']=function(_0x2d895a){try{if(this[_0x13b0('0x58')](_0x2d895a)){logger[_0x13b0('0x46')](_0x13b0('0x7b'),_0x2d895a['uniqueid'],util[_0x13b0('0x40')](_0x2d895a,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2d895a['uniqueid']]){var _0xc1c019=_[_0x13b0('0x7c')](this[_0x13b0('0xe')][_0x2d895a['uniqueid']]);_0xc1c019[_0x13b0('0x7d')]=![];_0xc1c019[_0x13b0('0x7e')]=null;_0xc1c019['holdtime']=_0x2d895a['holdtime'];_0xc1c019[_0x13b0('0x7f')]=_0x2d895a['originalposition'];_0xc1c019[_0x13b0('0x1c')]=!![];_0xc1c019['queuecallerabandonAt']=moment()[_0x13b0('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0xc1c019[_0x13b0('0x50')]=_0x13b0('0x80');_0xc1c019[_0x13b0('0x81')]=null;logger[_0x13b0('0x6c')](_0x13b0('0x82'),_0xc1c019[_0x13b0('0x4c')],_0xc1c019[_0x13b0('0x55')]);this[_0x13b0('0x11')][_0x2d895a[_0x13b0('0x49')]]=_0xc1c019;this[_0x13b0('0x43')](_0xc1c019,_0x13b0('0x1c'));}}}catch(_0x4ad31a){logger[_0x13b0('0x3d')](_0x13b0('0x7b'),_0x2d895a['uniqueid'],util['inspect'](_0x4ad31a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x13b0('0x1f')]=function(_0x39964b){try{if(this[_0x13b0('0x58')](_0x39964b)){logger[_0x13b0('0x46')]('[%s][voiceQueueReport][queuecallerleave]',_0x39964b[_0x13b0('0x49')],util[_0x13b0('0x40')](_0x39964b,{'showHidden':![],'depth':null}));if(this[_0x13b0('0xe')][_0x39964b['uniqueid']]){var _0x2b5fb9=_[_0x13b0('0x7c')](this[_0x13b0('0xe')][_0x39964b[_0x13b0('0x49')]]);_0x2b5fb9[_0x13b0('0x83')]=moment()[_0x13b0('0x4a')](_0x13b0('0x72'));_0x2b5fb9[_0x13b0('0x84')]=_0x39964b[_0x13b0('0x84')];_0x2b5fb9[_0x13b0('0x85')]=_0x39964b[_0x13b0('0x85')];logger[_0x13b0('0x6c')](_0x13b0('0x86'),_0x2b5fb9['queue'],_0x2b5fb9[_0x13b0('0x55')],_0x39964b[_0x13b0('0x84')],_0x39964b[_0x13b0('0x85')]);this[_0x13b0('0x11')][_0x39964b[_0x13b0('0x49')]]=_0x2b5fb9;this['emitVoiceQueueChannelSave'](_0x2b5fb9,_0x13b0('0x1e'));}}}catch(_0x27516a){logger[_0x13b0('0x3d')]('[%s][voiceQueueReport][queuecallerleave]',_0x39964b['uniqueid'],util[_0x13b0('0x40')](_0x27516a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x13b0('0xa')][_0x13b0('0x21')]=function(_0x3c4a7d){try{if(this['isNotNull'](_0x3c4a7d)){logger[_0x13b0('0x46')]('[%s][voiceQueueReport][agentconnect]',_0x3c4a7d['uniqueid'],util[_0x13b0('0x40')](_0x3c4a7d,{'showHidden':![],'depth':null}));if(this[_0x13b0('0xe')][_0x3c4a7d[_0x13b0('0x49')]]){var _0x169dc8=_['last'](this[_0x13b0('0xe')][_0x3c4a7d[_0x13b0('0x49')]]);_0x169dc8[_0x13b0('0x7d')]=!![];_0x169dc8['queuecallerexitreason']=_0x13b0('0x87');logger[_0x13b0('0x6c')](_0x13b0('0x88'),_0x169dc8[_0x13b0('0x4c')],_0x169dc8[_0x13b0('0x55')]);}}}catch(_0x2910c6){logger['error'](_0x13b0('0x89'),_0x3c4a7d[_0x13b0('0x49')],util[_0x13b0('0x40')](_0x2910c6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x17ddb4){try{if(this['isNotNull'](_0x17ddb4)){logger[_0x13b0('0x46')]('[%s][voiceQueueReport][agentcomplete]',_0x17ddb4[_0x13b0('0x49')],util['inspect'](_0x17ddb4,{'showHidden':![],'depth':null}));if(this[_0x13b0('0xe')][_0x17ddb4['uniqueid']]){var _0x343375=_[_0x13b0('0x7c')](this[_0x13b0('0xe')][_0x17ddb4[_0x13b0('0x49')]]);_0x343375[_0x13b0('0x1c')]=![];_0x343375[_0x13b0('0x8a')]=null;_0x343375[_0x13b0('0x8b')]=!![];_0x343375['lastAssignedTo']=_0x17ddb4['membername'];_0x343375[_0x13b0('0x8c')]=_0x17ddb4[_0x13b0('0x8c')];_0x343375[_0x13b0('0x7d')]=!![];_0x343375['queuecallerexit']=![];_0x343375['queuecallerexitAt']=null;if(!_0x343375[_0x13b0('0x8d')]){if(_0x17ddb4['reason']=='transfer'){_0x343375[_0x13b0('0x50')]=_0x13b0('0x8e');logger[_0x13b0('0x6c')](_0x13b0('0x8f'),_0x343375[_0x13b0('0x4c')],_0x343375[_0x13b0('0x55')]);}else{if(_[_0x13b0('0x90')](_0x17ddb4[_0x13b0('0x39')][_0x13b0('0x91')](),'local/')){if(this[_0x13b0('0xe')][_0x17ddb4[_0x13b0('0x92')]]){var _0x1b093f=_[_0x13b0('0x7c')](this[_0x13b0('0xe')][_0x17ddb4[_0x13b0('0x92')]]);_0x1b093f[_0x13b0('0x7d')]=![];_0x1b093f['queuecallerexit']=!![];_0x1b093f['queuecallerexitAt']=moment(_0x343375[_0x13b0('0x71')])[_0x13b0('0x93')](_0x17ddb4[_0x13b0('0x8c')],_0x13b0('0x94'))[_0x13b0('0x4a')](_0x13b0('0x72'));_0x1b093f[_0x13b0('0x50')]='FORWARDTRANSFER';_0x1b093f[_0x13b0('0x8d')]=!![];_0x1b093f['transfertype']='FORWARD';_0x1b093f[_0x13b0('0x95')]=_0x17ddb4['destexten'];_0x1b093f['transferuniqueid']=_0x17ddb4[_0x13b0('0x49')];logger['info'](_0x13b0('0x96'),_0x1b093f[_0x13b0('0x4c')],_0x1b093f[_0x13b0('0x55')]);var _0x14cf33=this[_0x13b0('0xe')][_0x17ddb4['linkedid']];this['queueReports'][_0x17ddb4[_0x13b0('0x92')]]=this['queueReports'][_0x17ddb4[_0x13b0('0x49')]];this[_0x13b0('0xe')][_0x17ddb4['uniqueid']]=_0x14cf33;}}else{_0x343375[_0x13b0('0x50')]='COMPLETEDBY'+_0x17ddb4[_0x13b0('0x97')]['toUpperCase']();logger['info'](_0x13b0('0x98'),_0x343375[_0x13b0('0x4c')],_0x343375[_0x13b0('0x55')],_0x343375[_0x13b0('0x50')]);}}}this['channels'][_0x17ddb4[_0x13b0('0x49')]]=_0x343375;this[_0x13b0('0x43')](_0x343375,'agentcomplete');}}}catch(_0x566242){logger['error'](_0x13b0('0x99'),_0x17ddb4[_0x13b0('0x49')],util[_0x13b0('0x40')](_0x566242,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x13b0('0xa')]['syncVarSet']=function(_0x132d96){try{if(this[_0x13b0('0x58')](_0x132d96)){logger[_0x13b0('0x46')]('[%s][voiceQueueReport][varset]',_0x132d96['uniqueid'],util[_0x13b0('0x40')](_0x132d96,{'showHidden':![],'depth':null}));this['addVariable'](_0x132d96[_0x13b0('0x49')],_['keys'](_0x132d96['variable'])[0x0],_0x132d96['value']);if(this[_0x13b0('0xe')][_0x132d96[_0x13b0('0x49')]]){var _0x1d9e09=_[_0x13b0('0x7c')](this[_0x13b0('0xe')][_0x132d96[_0x13b0('0x49')]]);if(_0x1d9e09){if(this[_0x13b0('0x58')](_0x132d96['variable'])&&this[_0x13b0('0x58')](_0x132d96[_0x13b0('0x9a')][_0x13b0('0x60')])){switch(_0x132d96[_0x13b0('0x9b')]){case _0x13b0('0x9c'):_0x1d9e09[_0x13b0('0x9d')]=![];_0x1d9e09[_0x13b0('0x9e')]=null;break;case _0x13b0('0x9f'):_0x1d9e09[_0x13b0('0xa0')]='timeout';_0x1d9e09['queuecallerexit']=!![];_0x1d9e09['queuecallerexitAt']=moment()[_0x13b0('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x1d9e09[_0x13b0('0x83')]=moment()[_0x13b0('0x4a')](_0x13b0('0x72'));logger[_0x13b0('0x46')](_0x13b0('0xa1'),_0x132d96['uniqueid'],util[_0x13b0('0x40')](_0x1d9e09,{'showHidden':![],'depth':null}));ami[_0x13b0('0x45')](_0x13b0('0xa2'),_0x1d9e09);break;default:_0x1d9e09[_0x13b0('0x9d')]=!![];_0x1d9e09[_0x13b0('0x9e')]=moment()['format'](_0x13b0('0x72'));_0x1d9e09[_0x13b0('0x83')]=moment()[_0x13b0('0x4a')](_0x13b0('0x72'));}_0x1d9e09['queuecallerabandon']=![];_0x1d9e09[_0x13b0('0x8a')]=null;_0x1d9e09[_0x13b0('0x50')]=_0x132d96[_0x13b0('0x9b')];this['channels'][_0x132d96['uniqueid']]=_0x1d9e09;this[_0x13b0('0x43')](_0x1d9e09,_0x13b0('0x22'));}else if(this['isNotNull'](_0x132d96['variable'])&&this[_0x13b0('0x58')](_0x132d96[_0x13b0('0x9a')][_0x13b0('0xa3')])){if(!_0x1d9e09[_0x13b0('0x1c')]){_0x1d9e09['queuecallerexit']=!![];_0x1d9e09[_0x13b0('0x9e')]=moment()[_0x13b0('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x1d9e09[_0x13b0('0x50')]=_0x13b0('0xa4');_0x1d9e09[_0x13b0('0x83')]=moment()[_0x13b0('0x4a')](_0x13b0('0x72'));this[_0x13b0('0x11')][_0x132d96[_0x13b0('0x49')]]=_0x1d9e09;}}logger['info']('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x132d96['uniqueid'],_0x1d9e09[_0x13b0('0x4c')],_0x1d9e09[_0x13b0('0x55')],_['keys'](_0x132d96[_0x13b0('0x9a')])[0x0],_0x132d96[_0x13b0('0x9b')]);_0x1d9e09['variables']=this[_0x13b0('0x15')][_0x132d96[_0x13b0('0x49')]];}}}}catch(_0x5f0d04){logger[_0x13b0('0x3d')](_0x13b0('0xa5'),_0x132d96[_0x13b0('0x49')],util[_0x13b0('0x40')](_0x5f0d04,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x13b0('0xa')][_0x13b0('0xa6')]=function(_0x2dfd48,_0x321dac,_0x46615a){var _0x5d7656=[_0x13b0('0xa7'),_0x13b0('0xa8'),_0x13b0('0xa9'),_0x13b0('0xaa'),_0x13b0('0xab'),'rtpaudioqoslossbridged',_0x13b0('0xac'),'rtpaudioqosrttbridged',_0x13b0('0xad'),_0x13b0('0xae'),_0x13b0('0xaf'),_0x13b0('0xb0'),_0x13b0('0xb1'),_0x13b0('0xb2'),_0x13b0('0xb3'),'memberlastcall',_0x13b0('0xb4'),'memberpenalty',_0x13b0('0xb5')];if(!_[_0x13b0('0xb6')](_0x321dac)&&!_['includes'](_0x5d7656,_0x321dac)){if(_[_0x13b0('0x59')](this['variables'][_0x2dfd48])){this[_0x13b0('0x15')][_0x2dfd48]={};}this['variables'][_0x2dfd48][_0x321dac]=_0x46615a;}};VoiceQueueReport[_0x13b0('0xa')][_0x13b0('0xb7')]=function(_0x4a3609,_0x54a369,_0x143b27){var _0x2e8d03={};for(var _0x324380=0x0;_0x3243800x0?!![]:![];if(!_0x2d6d60){return this[_0x0061('0x19')](this[_0x0061('0x15')][_0x0061('0x6f')]);}};VoiceQueueReport[_0x0061('0x3a')][_0x0061('0x1b')]=function(_0x5ed8c5){var _0x2d9c77=this[_0x0061('0x15')]['id'];if(this[_0x0061('0x15')][_0x0061('0x63')][_0x2d9c77]&&this[_0x0061('0x15')][_0x0061('0x63')][_0x2d9c77][_0x5ed8c5[_0x0061('0x62')]]){this[_0x0061('0x15')][_0x0061('0x63')][_0x2d9c77][_0x5ed8c5[_0x0061('0x62')]][_0x0061('0x11')][_0x0061('0x70')](_0x5ed8c5);}};VoiceQueueReport[_0x0061('0x3a')][_0x0061('0x17')]=function(_0x171e27){var _0xc7043a=this;try{if(this[_0x0061('0x71')](_0x171e27)&&this['isNotNull'](_0x171e27[_0x0061('0x58')])){logger[_0x0061('0x53')](_0x0061('0x72'),util[_0x0061('0x45')](_0x171e27,{'showHidden':![],'depth':null}));var _0x5d8980=this[_0x0061('0x49')][_0x171e27['queue']];if(_0x5d8980){logger[_0x0061('0x73')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x5d8980[_0x0061('0x5d')]);this[_0x0061('0x15')][_0x0061('0x65')][_0x5d8980['name']]={'summaryEvent':_0x171e27};this[_0x0061('0x15')][_0x0061('0x6e')]+=0x1;return ami[_0x0061('0x3e')]({'action':_0x0061('0x63'),'queue':_0x5d8980[_0x0061('0x5d')]})[_0x0061('0x74')](function(_0x5ccd95){if(!_0xc7043a[_0x0061('0x15')][_0x0061('0x63')][_0x171e27['actionid']]){_0xc7043a[_0x0061('0x15')][_0x0061('0x63')][_0x171e27['actionid']]={};}_0xc7043a[_0x0061('0x15')][_0x0061('0x63')][_0x171e27['actionid']][_0x5ccd95['actionid']]={'queue':_0x5d8980['name'],'agents':[]};})[_0x0061('0x41')](function(_0x475f8b){throw _0x475f8b;});}}}catch(_0x44cdce){logger[_0x0061('0x44')](_0x0061('0x64'),util['inspect'](_0x44cdce,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0061('0x3a')][_0x0061('0x19')]=function(_0x3c0f9b){if(this['summary'][_0x0061('0x6e')]>0x0){this[_0x0061('0x15')][_0x0061('0x6f')]=_0x3c0f9b;return;}logger[_0x0061('0x53')](_0x0061('0x75'),util['inspect'](_0x3c0f9b,{'showHidden':![],'depth':null}));this[_0x0061('0x15')]=initializeSummary();ami['emit']('custom:queuesummarycomplete',{});};VoiceQueueReport[_0x0061('0x3a')][_0x0061('0x1f')]=function(_0x15c7da){try{if(this[_0x0061('0x71')](_0x15c7da)){logger[_0x0061('0x53')](_0x0061('0x76'),_0x15c7da['uniqueid'],util['inspect'](_0x15c7da,{'showHidden':![],'depth':null}));if(_[_0x0061('0x5f')](this[_0x0061('0xf')][_0x15c7da['uniqueid']])){this[_0x0061('0xf')][_0x15c7da['uniqueid']]=[];}if(_['isUndefined'](this[_0x0061('0x12')][_0x15c7da['uniqueid']])){this[_0x0061('0x12')][_0x15c7da[_0x0061('0x77')]]={};}var _0x1fff5f=new QueueReport();_0x1fff5f[_0x0061('0x58')]=_0x15c7da[_0x0061('0x58')];_0x1fff5f[_0x0061('0x5b')]=this['voiceQueues'][_0x1fff5f['queue']]&&this[_0x0061('0x49')][_0x1fff5f[_0x0061('0x58')]][_0x0061('0x5b')]?this['voiceQueues'][_0x1fff5f[_0x0061('0x58')]][_0x0061('0x5b')]||'inbound':_0x0061('0x6b');_0x1fff5f['queuecallerjoinAt']=moment()['format'](_0x0061('0x78'));_0x1fff5f[_0x0061('0x79')]=_0x15c7da[_0x0061('0x79')];_0x1fff5f['count']=_0x15c7da[_0x0061('0x7a')];_0x1fff5f[_0x0061('0x77')]=_0x15c7da[_0x0061('0x77')];_0x1fff5f[_0x0061('0x7b')]=this[_0x0061('0x12')][_0x15c7da[_0x0061('0x77')]][_0x0061('0x7b')];logger[_0x0061('0x73')](_0x0061('0x7c'),_0x1fff5f[_0x0061('0x58')],_0x1fff5f[_0x0061('0x5b')]);_[_0x0061('0x7d')](_0x1fff5f,_[_0x0061('0x7e')](_0x15c7da,_[_0x0061('0x7f')](_0x1fff5f)));this[_0x0061('0xf')][_0x15c7da[_0x0061('0x77')]]['push'](_0x1fff5f);this[_0x0061('0x12')][_0x15c7da[_0x0061('0x77')]]=_0x1fff5f;this[_0x0061('0x4c')](_0x1fff5f,_0x0061('0x1e'));}}catch(_0x16335c){logger[_0x0061('0x44')](_0x0061('0x76'),_0x15c7da['uniqueid'],util[_0x0061('0x45')](_0x16335c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0061('0x3a')][_0x0061('0x80')]=function(_0x2581c4){try{if(this[_0x0061('0x71')](_0x2581c4)){logger[_0x0061('0x53')]('[%s][voiceQueueReport][queuecallerabandon]',_0x2581c4[_0x0061('0x77')],util[_0x0061('0x45')](_0x2581c4,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2581c4[_0x0061('0x77')]]){var _0xe032e4=_[_0x0061('0x81')](this['queueReports'][_0x2581c4[_0x0061('0x77')]]);_0xe032e4[_0x0061('0x82')]=![];_0xe032e4[_0x0061('0x83')]=null;_0xe032e4['holdtime']=_0x2581c4[_0x0061('0x84')];_0xe032e4[_0x0061('0x85')]=_0x2581c4[_0x0061('0x85')];_0xe032e4[_0x0061('0x86')]=!![];_0xe032e4['queuecallerabandonAt']=moment()[_0x0061('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0xe032e4['queuecallerexitreason']=_0x0061('0x87');_0xe032e4[_0x0061('0x88')]=null;logger['info'](_0x0061('0x89'),_0xe032e4[_0x0061('0x58')],_0xe032e4[_0x0061('0x5b')]);this['channels'][_0x2581c4[_0x0061('0x77')]]=_0xe032e4;this[_0x0061('0x4a')](_0xe032e4,_0x0061('0x86'));}}}catch(_0x3ea01b){logger[_0x0061('0x44')]('[%s][voiceQueueReport][queuecallerabandon]',_0x2581c4[_0x0061('0x77')],util[_0x0061('0x45')](_0x3ea01b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0061('0x3a')][_0x0061('0x21')]=function(_0x1331eb){try{if(this['isNotNull'](_0x1331eb)){logger['debug'](_0x0061('0x8a'),_0x1331eb['uniqueid'],util[_0x0061('0x45')](_0x1331eb,{'showHidden':![],'depth':null}));if(this[_0x0061('0xf')][_0x1331eb[_0x0061('0x77')]]){var _0x3995e4=_[_0x0061('0x81')](this['queueReports'][_0x1331eb['uniqueid']]);_0x3995e4[_0x0061('0x8b')]=moment()['format'](_0x0061('0x78'));_0x3995e4['connectedlinenum']=_0x1331eb['connectedlinenum'];_0x3995e4['connectedlinename']=_0x1331eb['connectedlinename'];logger['info'](_0x0061('0x8c'),_0x3995e4['queue'],_0x3995e4[_0x0061('0x5b')],_0x1331eb['connectedlinenum'],_0x1331eb[_0x0061('0x8d')]);this['channels'][_0x1331eb[_0x0061('0x77')]]=_0x3995e4;this[_0x0061('0x4c')](_0x3995e4,_0x0061('0x20'));}}}catch(_0x542cf5){logger[_0x0061('0x44')](_0x0061('0x8a'),_0x1331eb[_0x0061('0x77')],util[_0x0061('0x45')](_0x542cf5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0061('0x8e')]=function(_0x2ac186){try{if(this[_0x0061('0x71')](_0x2ac186)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x2ac186[_0x0061('0x77')],util['inspect'](_0x2ac186,{'showHidden':![],'depth':null}));if(this[_0x0061('0xf')][_0x2ac186[_0x0061('0x77')]]){var _0x5042b1=_['last'](this[_0x0061('0xf')][_0x2ac186[_0x0061('0x77')]]);_0x5042b1[_0x0061('0x82')]=!![];_0x5042b1['queuecallerexitreason']=_0x0061('0x8f');logger[_0x0061('0x73')](_0x0061('0x90'),_0x5042b1[_0x0061('0x58')],_0x5042b1['type']);}}}catch(_0x1af8ee){logger[_0x0061('0x44')](_0x0061('0x91'),_0x2ac186[_0x0061('0x77')],util[_0x0061('0x45')](_0x1af8ee,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0061('0x3a')][_0x0061('0x23')]=function(_0x419481){try{if(this['isNotNull'](_0x419481)){logger['debug'](_0x0061('0x92'),_0x419481[_0x0061('0x77')],util[_0x0061('0x45')](_0x419481,{'showHidden':![],'depth':null}));if(this[_0x0061('0xf')][_0x419481[_0x0061('0x77')]]){var _0x5d99f2=_[_0x0061('0x81')](this[_0x0061('0xf')][_0x419481[_0x0061('0x77')]]);_0x5d99f2[_0x0061('0x86')]=![];_0x5d99f2[_0x0061('0x93')]=null;_0x5d99f2[_0x0061('0x94')]=!![];_0x5d99f2[_0x0061('0x88')]=_0x419481[_0x0061('0x95')];_0x5d99f2[_0x0061('0x84')]=_0x419481['holdtime'];_0x5d99f2[_0x0061('0x82')]=!![];_0x5d99f2[_0x0061('0x96')]=![];_0x5d99f2[_0x0061('0x97')]=null;if(!_0x5d99f2[_0x0061('0x98')]){if(_0x419481[_0x0061('0x99')]==_0x0061('0x98')){_0x5d99f2[_0x0061('0x55')]=_0x0061('0x9a');logger[_0x0061('0x73')](_0x0061('0x9b'),_0x5d99f2[_0x0061('0x58')],_0x5d99f2[_0x0061('0x5b')]);}else{if(_[_0x0061('0x9c')](_0x419481[_0x0061('0x40')]['toLowerCase'](),_0x0061('0x9d'))){if(this[_0x0061('0xf')][_0x419481[_0x0061('0x9e')]]){var _0x40d603=_[_0x0061('0x81')](this[_0x0061('0xf')][_0x419481['linkedid']]);_0x40d603[_0x0061('0x82')]=![];_0x40d603[_0x0061('0x96')]=!![];_0x40d603[_0x0061('0x97')]=moment(_0x5d99f2['queuecallerjoinAt'])['add'](_0x419481[_0x0061('0x84')],'seconds')[_0x0061('0x57')]('YYYY-MM-DD\x20HH:mm:ss');_0x40d603[_0x0061('0x55')]=_0x0061('0x9f');_0x40d603[_0x0061('0x98')]=!![];_0x40d603[_0x0061('0xa0')]=_0x0061('0xa1');_0x40d603['transferexten']=_0x419481[_0x0061('0xa2')];_0x40d603['transferuniqueid']=_0x419481[_0x0061('0x77')];logger['info'](_0x0061('0xa3'),_0x40d603[_0x0061('0x58')],_0x40d603[_0x0061('0x5b')]);var _0xf51219=this[_0x0061('0xf')][_0x419481[_0x0061('0x9e')]];this[_0x0061('0xf')][_0x419481['linkedid']]=this[_0x0061('0xf')][_0x419481['uniqueid']];this['queueReports'][_0x419481['uniqueid']]=_0xf51219;}}else{_0x5d99f2['queuecallerexitreason']='COMPLETEDBY'+_0x419481[_0x0061('0x99')][_0x0061('0xa4')]();logger[_0x0061('0x73')](_0x0061('0xa5'),_0x5d99f2[_0x0061('0x58')],_0x5d99f2['type'],_0x5d99f2['queuecallerexitreason']);}}}this[_0x0061('0x12')][_0x419481[_0x0061('0x77')]]=_0x5d99f2;this[_0x0061('0x4a')](_0x5d99f2,_0x0061('0x22'));}}}catch(_0x307bc5){logger[_0x0061('0x44')]('[%s][voiceQueueReport][agentcomplete]',_0x419481[_0x0061('0x77')],util[_0x0061('0x45')](_0x307bc5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0061('0xa6')]=function(_0x3ef2e5){try{if(this[_0x0061('0x71')](_0x3ef2e5)){logger[_0x0061('0x53')]('[%s][voiceQueueReport][varset]',_0x3ef2e5[_0x0061('0x77')],util[_0x0061('0x45')](_0x3ef2e5,{'showHidden':![],'depth':null}));this[_0x0061('0xa7')](_0x3ef2e5[_0x0061('0x77')],_[_0x0061('0x7f')](_0x3ef2e5['variable'])[0x0],_0x3ef2e5[_0x0061('0xa8')]);if(this[_0x0061('0xf')][_0x3ef2e5[_0x0061('0x77')]]){var _0x34a9f3=_['last'](this[_0x0061('0xf')][_0x3ef2e5[_0x0061('0x77')]]);if(_0x34a9f3){if(this[_0x0061('0x71')](_0x3ef2e5['variable'])&&this[_0x0061('0x71')](_0x3ef2e5['variable'][_0x0061('0x63')])){switch(_0x3ef2e5[_0x0061('0xa8')]){case _0x0061('0xa9'):_0x34a9f3['queuecallerexit']=![];_0x34a9f3[_0x0061('0x97')]=null;break;case _0x0061('0xaa'):_0x34a9f3['lastevent']=_0x0061('0xab');_0x34a9f3['queuecallerexit']=!![];_0x34a9f3[_0x0061('0x97')]=moment()[_0x0061('0x57')](_0x0061('0x78'));_0x34a9f3[_0x0061('0x8b')]=moment()[_0x0061('0x57')](_0x0061('0x78'));logger[_0x0061('0x53')](_0x0061('0xac'),_0x3ef2e5[_0x0061('0x77')],util[_0x0061('0x45')](_0x34a9f3,{'showHidden':![],'depth':null}));ami['emit'](_0x0061('0xad'),_0x34a9f3);break;default:_0x34a9f3[_0x0061('0x96')]=!![];_0x34a9f3[_0x0061('0x97')]=moment()['format'](_0x0061('0x78'));_0x34a9f3[_0x0061('0x8b')]=moment()['format'](_0x0061('0x78'));}_0x34a9f3[_0x0061('0x86')]=![];_0x34a9f3['queuecallerabandonAt']=null;_0x34a9f3[_0x0061('0x55')]=_0x3ef2e5['value'];this[_0x0061('0x12')][_0x3ef2e5['uniqueid']]=_0x34a9f3;this[_0x0061('0x4a')](_0x34a9f3,_0x0061('0x25'));}else if(this[_0x0061('0x71')](_0x3ef2e5[_0x0061('0xae')])&&this[_0x0061('0x71')](_0x3ef2e5[_0x0061('0xae')][_0x0061('0xaf')])){if(!_0x34a9f3[_0x0061('0x86')]){_0x34a9f3[_0x0061('0x96')]=!![];_0x34a9f3[_0x0061('0x97')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x34a9f3[_0x0061('0x55')]=_0x0061('0xb0');_0x34a9f3[_0x0061('0x8b')]=moment()[_0x0061('0x57')](_0x0061('0x78'));this[_0x0061('0x12')][_0x3ef2e5[_0x0061('0x77')]]=_0x34a9f3;}}logger[_0x0061('0x73')](_0x0061('0xb1'),_0x3ef2e5[_0x0061('0x77')],_0x34a9f3[_0x0061('0x58')],_0x34a9f3['type'],_['keys'](_0x3ef2e5[_0x0061('0xae')])[0x0],_0x3ef2e5[_0x0061('0xa8')]);_0x34a9f3[_0x0061('0x16')]=this[_0x0061('0x16')][_0x3ef2e5[_0x0061('0x77')]];}}}}catch(_0x1bc586){logger['error'](_0x0061('0xb2'),_0x3ef2e5['uniqueid'],util[_0x0061('0x45')](_0x1bc586,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0061('0x3a')][_0x0061('0xa7')]=function(_0x26bc29,_0x57bffc,_0x27f0d3){var _0x15079e=[_0x0061('0xb3'),_0x0061('0xb4'),_0x0061('0xb5'),_0x0061('0xb6'),'rtpaudioqosloss',_0x0061('0xb7'),_0x0061('0xb8'),'rtpaudioqosrttbridged','sipcallid',_0x0061('0xb9'),'bridgepeer',_0x0061('0xba'),_0x0061('0xbb'),_0x0061('0xbc'),_0x0061('0xbd'),_0x0061('0xbe'),_0x0061('0x95'),_0x0061('0xbf'),_0x0061('0xc0')];if(!_[_0x0061('0x3d')](_0x57bffc)&&!_[_0x0061('0xc1')](_0x15079e,_0x57bffc)){if(_[_0x0061('0x5f')](this[_0x0061('0x16')][_0x26bc29])){this[_0x0061('0x16')][_0x26bc29]={};}this['variables'][_0x26bc29][_0x57bffc]=_0x27f0d3;}};VoiceQueueReport[_0x0061('0x3a')][_0x0061('0xc2')]=function(_0x27e039,_0x349a5b,_0x2e4335){var _0x2250ec={};for(var _0x62c64c=0x0;_0x62c64c=0x0?moment(_0x13f8f8[_0x46d9('0x18')])[_0x46d9('0xc')](_0x13f8f8['starttime'],'seconds'):null,'data1':_0x46d9('0x19'),'data2':_0x13f8f8[_0x46d9('0x13')],'data3':_0x13f8f8[_0x46d9('0x10')],'data4':_0x13f8f8['dialstring']||null,'role':'agent','internal':_0x13f8f8[_0x46d9('0x13')]?_['toNumber'](_0x13f8f8[_0x46d9('0x13')]):undefined,'uniqueid':_0x13f8f8[_0x46d9('0x1a')]},'log':_0x46d9('0x7')});}; \ No newline at end of file +var _0xe09c=['seconds','inbound','exten','accountcode','uniqueid','voiceDialReport','TALKING','starttime','endtime','outbound','dialstring','agent','toNumber','moment','util','../client','voiceQueueReport','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','SIP/%s','queuecallerleaveAt','diff'];(function(_0x46c865,_0x154b2f){var _0x200973=function(_0x6c1275){while(--_0x6c1275){_0x46c865['push'](_0x46c865['shift']());}};_0x200973(++_0x154b2f);}(_0xe09c,0x109));var _0xce09=function(_0x28fbbc,_0x413c45){_0x28fbbc=_0x28fbbc-0x0;var _0x4505db=_0xe09c[_0x28fbbc];return _0x4505db;};'use strict';var moment=require(_0xce09('0x0'));var _=require('lodash');var util=require(_0xce09('0x1'));var client=require(_0xce09('0x2'));exports[_0xce09('0x3')]=function(_0x3aa9a7){var _0x4de9a1=_0x3aa9a7[_0xce09('0x4')]||_0x3aa9a7[_0xce09('0x5')];return client[_0xce09('0x6')](_0xce09('0x7'),{'body':{'channel':_0xce09('0x8'),'membername':_0x3aa9a7[_0xce09('0x9')],'interface':_[_0xce09('0xa')](_0x3aa9a7[_0xce09('0xb')])?util['format'](_0xce09('0xc'),_0x3aa9a7[_0xce09('0x9')]):_0x3aa9a7[_0xce09('0xb')],'type':'TALKING','enterAt':_0x3aa9a7[_0xce09('0xd')],'exitAt':_0x4de9a1,'duration':moment(_0x4de9a1)[_0xce09('0xe')](_0x3aa9a7[_0xce09('0xd')],_0xce09('0xf')),'data1':_0xce09('0x10'),'data2':_0x3aa9a7['calleridnum'],'data3':_0x3aa9a7[_0xce09('0x11')],'data4':null,'data5':_0x3aa9a7['queue'],'role':'agent','internal':_0x3aa9a7[_0xce09('0x12')]?_['toNumber'](_0x3aa9a7[_0xce09('0x12')]):undefined,'uniqueid':_0x3aa9a7[_0xce09('0x13')]},'log':'CreateMemberReport'});};exports[_0xce09('0x14')]=function(_0x1c6e05){return client['Request']('CreateMemberReport',{'body':{'channel':'voice','membername':_0x1c6e05['membername'],'interface':_0x1c6e05[_0xce09('0xb')],'type':_0xce09('0x15'),'enterAt':_0x1c6e05[_0xce09('0x16')],'exitAt':_0x1c6e05['endtime'],'duration':moment(_0x1c6e05[_0xce09('0x17')])['diff'](_0x1c6e05[_0xce09('0x16')],_0xce09('0xf'))>=0x0?moment(_0x1c6e05[_0xce09('0x17')])['diff'](_0x1c6e05[_0xce09('0x16')],_0xce09('0xf')):null,'data1':_0xce09('0x18'),'data2':_0x1c6e05[_0xce09('0x12')],'data3':_0x1c6e05[_0xce09('0x11')],'data4':_0x1c6e05[_0xce09('0x19')]||null,'role':_0xce09('0x1a'),'internal':_0x1c6e05[_0xce09('0x12')]?_[_0xce09('0x1b')](_0x1c6e05[_0xce09('0x12')]):undefined,'uniqueid':_0x1c6e05['uniqueid']},'log':_0xce09('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 823727e..b5178fd 100644 --- a/server/services/ami/rpc/setting.js +++ b/server/services/ami/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8109=['Request','ShowSetting','previewRecallmeReminderInterval','GetSettings','../client'];(function(_0x2e0763,_0x37e6e4){var _0x189643=function(_0x20802b){while(--_0x20802b){_0x2e0763['push'](_0x2e0763['shift']());}};_0x189643(++_0x37e6e4);}(_0x8109,0xa9));var _0x9810=function(_0x3092c1,_0x57a048){_0x3092c1=_0x3092c1-0x0;var _0x5e22c9=_0x8109[_0x3092c1];return _0x5e22c9;};'use strict';var client=require(_0x9810('0x0'));exports['getSettings']=function(){return client[_0x9810('0x1')](_0x9810('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer',_0x9810('0x3')]},'log':_0x9810('0x4')});}; \ No newline at end of file +var _0xae24=['ShowSetting','stopRecordingOnTransfer','previewRecallmeReminderInterval','GetSettings','Request'];(function(_0x52a82e,_0x173dcd){var _0x25b416=function(_0x457422){while(--_0x457422){_0x52a82e['push'](_0x52a82e['shift']());}};_0x25b416(++_0x173dcd);}(_0xae24,0x180));var _0x4ae2=function(_0x7db900,_0x5a88c8){_0x7db900=_0x7db900-0x0;var _0x1c0edc=_0xae24[_0x7db900];return _0x1c0edc;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x4ae2('0x0')](_0x4ae2('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x4ae2('0x2'),_0x4ae2('0x3')]},'log':_0x4ae2('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index a8211f5..37fe7b9 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 _0xb846=['GetTemplate','../client','getTemplates','html'];(function(_0x5d2ec2,_0x5d0e35){var _0x5a4e5d=function(_0x2f9529){while(--_0x2f9529){_0x5d2ec2['push'](_0x5d2ec2['shift']());}};_0x5a4e5d(++_0x5d0e35);}(_0xb846,0x145));var _0x6b84=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xb846[_0x2b4411];return _0x8e41ef;};'use strict';var client=require(_0x6b84('0x0'));exports[_0x6b84('0x1')]=function(_0x3051c3){return function(_0x14b15b){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id','name',_0x6b84('0x2')]},'log':_0x6b84('0x3')});};}; \ No newline at end of file +var _0x0de3=['Request','GetTemplate','name','html','../client','getTemplates'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x0de3,0x184));var _0x30de=function(_0x37b9c8,_0x19e1e8){_0x37b9c8=_0x37b9c8-0x0;var _0xa3b96e=_0x0de3[_0x37b9c8];return _0xa3b96e;};'use strict';var client=require(_0x30de('0x0'));exports[_0x30de('0x1')]=function(_0x5318e3){return function(_0x243896){return client[_0x30de('0x2')](_0x30de('0x3'),{'options':{'raw':!![],'attributes':['id',_0x30de('0x4'),_0x30de('0x5')]},'log':_0x30de('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index efe5011..e3c0697 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 _0x7a54=['getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','data1','data2','data3','data4','data5','../client'];(function(_0x79ef34,_0x42d1a1){var _0x43d708=function(_0x36576e){while(--_0x36576e){_0x79ef34['push'](_0x79ef34['shift']());}};_0x43d708(++_0x42d1a1);}(_0x7a54,0x117));var _0x47a5=function(_0x2f3e7c,_0x3522f5){_0x2f3e7c=_0x2f3e7c-0x0;var _0x4ffca2=_0x7a54[_0x2f3e7c];return _0x4ffca2;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x3cc94b){return function(_0x431354){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'options':{'raw':![],'attributes':['id',_0x47a5('0x4'),_0x47a5('0x5'),_0x47a5('0x6')],'include':[{'model':_0x47a5('0x7'),'as':_0x47a5('0x8'),'attributes':['id',_0x47a5('0x9'),_0x47a5('0xa'),_0x47a5('0xb')]},{'model':_0x47a5('0x7'),'as':_0x47a5('0xc'),'attributes':['id',_0x47a5('0x9'),_0x47a5('0xa'),_0x47a5('0xb')]},{'model':_0x47a5('0xd'),'as':_0x47a5('0xe'),'attributes':['id','action',_0x47a5('0xf'),_0x47a5('0x10'),_0x47a5('0x11'),_0x47a5('0x12'),_0x47a5('0x13'),'data6','data7']}]},'log':_0x47a5('0x3')});};}; \ No newline at end of file +var _0x5a97=['Request','GetTrigger','channel','Condition','AllConditions','field','value','AnyConditions','operator','Action','Actions','action','data1','data2','data4','data5','data7','../client','getTriggers'];(function(_0x326ff8,_0x386842){var _0x33a9a6=function(_0xe415b0){while(--_0xe415b0){_0x326ff8['push'](_0x326ff8['shift']());}};_0x33a9a6(++_0x386842);}(_0x5a97,0x70));var _0x75a9=function(_0x42a5eb,_0x3c42a1){_0x42a5eb=_0x42a5eb-0x0;var _0x4aa77b=_0x5a97[_0x42a5eb];return _0x4aa77b;};'use strict';var client=require(_0x75a9('0x0'));exports[_0x75a9('0x1')]=function(_0x5b2bfd){return function(_0x119a82){return client[_0x75a9('0x2')](_0x75a9('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x75a9('0x4'),'status'],'include':[{'model':_0x75a9('0x5'),'as':_0x75a9('0x6'),'attributes':['id',_0x75a9('0x7'),'operator',_0x75a9('0x8')]},{'model':'Condition','as':_0x75a9('0x9'),'attributes':['id',_0x75a9('0x7'),_0x75a9('0xa'),_0x75a9('0x8')]},{'model':_0x75a9('0xb'),'as':_0x75a9('0xc'),'attributes':['id',_0x75a9('0xd'),_0x75a9('0xe'),_0x75a9('0xf'),'data3',_0x75a9('0x10'),_0x75a9('0x11'),'data6',_0x75a9('0x12')]}]},'log':_0x75a9('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index e5d9393..e8c5cfc 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 _0xb9bb=['registry'];(function(_0x3b0bcd,_0x553926){var _0x2e6057=function(_0x302bfe){while(--_0x302bfe){_0x3b0bcd['push'](_0x3b0bcd['shift']());}};_0x2e6057(++_0x553926);}(_0xb9bb,0xa4));var _0xbb9b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb9bb[_0x2641f9];return _0x585741;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x1e6836){return function(_0x412d3f){return client['Request']('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xbb9b('0x0'),'defaultuser']},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x455d=['Request','name','registry','defaultuser','GetTrunk'];(function(_0x48a836,_0xa1d010){var _0x249dc8=function(_0x2a95a0){while(--_0x2a95a0){_0x48a836['push'](_0x48a836['shift']());}};_0x249dc8(++_0xa1d010);}(_0x455d,0x190));var _0xd455=function(_0x13aac0,_0x10e853){_0x13aac0=_0x13aac0-0x0;var _0x58466a=_0x455d[_0x13aac0];return _0x58466a;};'use strict';var client=require('../client');exports['getTrunks']=function(_0x1f4dd1){return function(_0x191e5a){return client[_0xd455('0x0')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xd455('0x1'),_0xd455('0x2'),_0xd455('0x3')]},'log':_0xd455('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 4f0935f..04fd4a2 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 _0x34e8=['../client','getAgents','Request','GetUser','name','email','accountcode','fullname','online','lastLoginAt','pauseType','voicePause','mobile','interface','getTelephones','telephone','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','lastPauseAt'];(function(_0x50cc40,_0x2ec2e9){var _0x326844=function(_0x44b797){while(--_0x44b797){_0x50cc40['push'](_0x50cc40['shift']());}};_0x326844(++_0x2ec2e9);}(_0x34e8,0x12c));var _0x834e=function(_0x2809af,_0x583503){_0x2809af=_0x2809af-0x0;var _0x70506c=_0x34e8[_0x2809af];return _0x70506c;};'use strict';var client=require(_0x834e('0x0'));exports[_0x834e('0x1')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6'),_0x834e('0x7'),_0x834e('0x8'),_0x834e('0x9'),_0x834e('0xa'),'lastPauseAt',_0x834e('0xb'),'phone',_0x834e('0xc'),_0x834e('0xd')]},'log':_0x834e('0x1')});};};exports[_0x834e('0xe')]=function(){return function(){return client[_0x834e('0x2')](_0x834e('0x3'),{'options':{'raw':!![],'where':{'role':_0x834e('0xf')},'attributes':['id',_0x834e('0x4'),_0x834e('0x6'),_0x834e('0x10')]},'log':_0x834e('0xe')});};};exports[_0x834e('0x11')]=function(_0x14038b,_0x2e1a37,_0x293514){return client[_0x834e('0x2')](_0x834e('0x12'),{'body':{'type':_0x2e1a37,'uniqueid':_0x293514},'options':{'where':{'id':_0x14038b['id']}},'log':'savePause'});};exports[_0x834e('0x13')]=function(_0x6cd9b9){return client['Request'](_0x834e('0x14'),{'body':{},'options':{'where':{'id':_0x6cd9b9['id']}},'log':_0x834e('0x11')});};exports[_0x834e('0x15')]=function(_0x21cc0a){return client['Request'](_0x834e('0x16'),{'options':{'raw':![],'where':{'role':_0x834e('0x17'),'id':_0x21cc0a},'attributes':['id','name',_0x834e('0x5'),'accountcode',_0x834e('0x7'),_0x834e('0x8'),'lastLoginAt',_0x834e('0xa'),_0x834e('0x18'),_0x834e('0xb'),'interface']},'log':_0x834e('0x15')});}; \ No newline at end of file +var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x153738,_0xe704c1){var _0x3028d9=function(_0x47afa0){while(--_0x47afa0){_0x153738['push'](_0x153738['shift']());}};_0x3028d9(++_0xe704c1);}(_0x9c44,0x178));var _0x49c4=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x9c44[_0x1969a7];return _0x3d665f;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 7e9606e..1926dab 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 _0x1f62=['../client','create','CreateVoiceAgentReport','update','Request','UpdateVoiceAgentReport'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x1f62,0x1b0));var _0x21f6=function(_0xf7058b,_0x22c9b7){_0xf7058b=_0xf7058b-0x0;var _0x24cbf0=_0x1f62[_0xf7058b];return _0x24cbf0;};'use strict';var client=require(_0x21f6('0x0'));exports[_0x21f6('0x1')]=function(_0x2d0479){return client['Request'](_0x21f6('0x2'),{'body':_0x2d0479,'log':_0x21f6('0x2')});};exports[_0x21f6('0x3')]=function(_0x182fe7,_0x28b2fc,_0x52ee9b){return client[_0x21f6('0x4')](_0x21f6('0x5'),{'body':_0x182fe7,'options':{'where':{'uniqueid':_0x28b2fc,'interface':_0x52ee9b,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x9161=['../client','create','Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport'];(function(_0x474d1c,_0x2bf69b){var _0x13e2cb=function(_0x53fe43){while(--_0x53fe43){_0x474d1c['push'](_0x474d1c['shift']());}};_0x13e2cb(++_0x2bf69b);}(_0x9161,0x186));var _0x1916=function(_0x42d22b,_0x4d1186){_0x42d22b=_0x42d22b-0x0;var _0x36796d=_0x9161[_0x42d22b];return _0x36796d;};'use strict';var client=require(_0x1916('0x0'));exports[_0x1916('0x1')]=function(_0x1628b3){return client[_0x1916('0x2')]('CreateVoiceAgentReport',{'body':_0x1628b3,'log':_0x1916('0x3')});};exports[_0x1916('0x4')]=function(_0x1c6592,_0x5d3c6e,_0xaf4d96){return client[_0x1916('0x2')]('UpdateVoiceAgentReport',{'body':_0x1c6592,'options':{'where':{'uniqueid':_0x5d3c6e,'interface':_0xaf4d96,'agentcomplete':!![]}},'log':_0x1916('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 7aefd94..433ce65 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 _0x252f=['startOf','endOf','format','duration','billableseconds','moment','util','../client','create','CreateVoiceCallReport','context','getVoiceCallReports','GetVoiceCallReport','outbound'];(function(_0x456e36,_0x318c15){var _0x188de9=function(_0x76d1de){while(--_0x76d1de){_0x456e36['push'](_0x456e36['shift']());}};_0x188de9(++_0x318c15);}(_0x252f,0xc9));var _0xf252=function(_0x19f8ee,_0x3e08c2){_0x19f8ee=_0x19f8ee-0x0;var _0x3b68f2=_0x252f[_0x19f8ee];return _0x3b68f2;};'use strict';var moment=require(_0xf252('0x0'));var util=require(_0xf252('0x1'));var _=require('lodash');var client=require(_0xf252('0x2'));exports[_0xf252('0x3')]=function(_0x1af5c5){return client['Request'](_0xf252('0x4'),{'body':_['merge'](_0x1af5c5,{'source':_0x1af5c5['calleridnum'],'destinationcontext':_0x1af5c5[_0xf252('0x5')],'callerid':_0x1af5c5['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0xf252('0x4')});};exports[_0xf252('0x6')]=function(){return function(){return client['Request'](_0xf252('0x7'),{'options':{'where':{'type':[_0xf252('0x8')],'createdAt':{'$between':[moment()[_0xf252('0x9')]('day')['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xf252('0xa')]('day')[_0xf252('0xb')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type','disposition',_0xf252('0xc'),_0xf252('0xd')]},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0xa49d=['GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','../client','Request','merge','calleridnum','context','callerid','DOCUMENTATION'];(function(_0x154705,_0x4f7338){var _0xc84768=function(_0x3db077){while(--_0x3db077){_0x154705['push'](_0x154705['shift']());}};_0xc84768(++_0x4f7338);}(_0xa49d,0xf3));var _0xda49=function(_0x201b36,_0x5622a1){_0x201b36=_0x201b36-0x0;var _0xaf48a6=_0xa49d[_0x201b36];return _0xaf48a6;};'use strict';var moment=require(_0xda49('0x0'));var util=require(_0xda49('0x1'));var _=require('lodash');var client=require(_0xda49('0x2'));exports['create']=function(_0x19866e){return client[_0xda49('0x3')]('CreateVoiceCallReport',{'body':_[_0xda49('0x4')](_0x19866e,{'source':_0x19866e[_0xda49('0x5')],'destinationcontext':_0x19866e[_0xda49('0x6')],'callerid':_0x19866e[_0xda49('0x7')],'amaflags':_0xda49('0x8')}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0xda49('0x9'),{'options':{'where':{'type':[_0xda49('0xa')],'createdAt':{'$between':[moment()[_0xda49('0xb')](_0xda49('0xc'))[_0xda49('0xd')](_0xda49('0xe')),moment()[_0xda49('0xf')](_0xda49('0xc'))[_0xda49('0xd')](_0xda49('0xe'))]}},'attributes':[_0xda49('0x10'),_0xda49('0x11'),_0xda49('0x12'),_0xda49('0x13')]},'log':_0xda49('0x14')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index d677bd2..8591c85 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 _0x220b=['Request','CreateVoiceDialReport','create'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x220b,0xd1));var _0xb220=function(_0x46361e,_0x243aaf){_0x46361e=_0x46361e-0x0;var _0x14e302=_0x220b[_0x46361e];return _0x14e302;};'use strict';var client=require('../client');exports[_0xb220('0x0')]=function(_0x499198){return client[_0xb220('0x1')](_0xb220('0x2'),{'body':_0x499198,'log':_0xb220('0x2')});}; \ No newline at end of file +var _0x5e13=['../client','create','CreateVoiceDialReport'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x5e13,0x17d));var _0x35e1=function(_0x141dd8,_0x48363d){_0x141dd8=_0x141dd8-0x0;var _0x348080=_0x5e13[_0x141dd8];return _0x348080;};'use strict';var client=require(_0x35e1('0x0'));exports[_0x35e1('0x1')]=function(_0x5762f9){return client['Request'](_0x35e1('0x2'),{'body':_0x5762f9,'log':_0x35e1('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 229c28b..6ab74dc 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 _0x6ea9=['GetVoiceExtension','exten','../client','getVoiceExtensions','Request'];(function(_0x2c8d60,_0x43fa57){var _0x504dc8=function(_0x5d7fad){while(--_0x5d7fad){_0x2c8d60['push'](_0x2c8d60['shift']());}};_0x504dc8(++_0x43fa57);}(_0x6ea9,0x89));var _0x96ea=function(_0x36b14f,_0x196e83){_0x36b14f=_0x36b14f-0x0;var _0x44faad=_0x6ea9[_0x36b14f];return _0x44faad;};'use strict';var client=require(_0x96ea('0x0'));exports[_0x96ea('0x1')]=function(){return function(){return client[_0x96ea('0x2')](_0x96ea('0x3'),{'options':{'raw':!![],'attributes':['id',_0x96ea('0x4'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0x96ea('0x1')});};}; \ No newline at end of file +var _0x6f0d=['getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x3db2c6,_0x2e9c6a){var _0x4876fd=function(_0x3e8146){while(--_0x3e8146){_0x3db2c6['push'](_0x3db2c6['shift']());}};_0x4876fd(++_0x2e9c6a);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x39aef8,_0x3baee9){_0x39aef8=_0x39aef8-0x0;var _0x24ccd6=_0x6f0d[_0x39aef8];return _0x24ccd6;};'use strict';var client=require('../client');exports[_0xd6f0('0x0')]=function(){return function(){return client[_0xd6f0('0x1')](_0xd6f0('0x2'),{'options':{'raw':!![],'attributes':['id',_0xd6f0('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xd6f0('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 210f818..627d072 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 _0x3cee=['dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewRecallmeReminder','Trunk','callerid','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','interval','getVoiceQueues','../client','GetVoiceQueue','name','acw','acwTimeout','monitor_format','dialActive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry'];(function(_0x5576a9,_0x330f68){var _0xa8eab7=function(_0x18a731){while(--_0x18a731){_0x5576a9['push'](_0x5576a9['shift']());}};_0xa8eab7(++_0x330f68);}(_0x3cee,0x1d5));var _0xe3ce=function(_0x1250ae,_0x1b3225){_0x1250ae=_0x1250ae-0x0;var _0x52df86=_0x3cee[_0x1250ae];return _0x52df86;};'use strict';var client=require(_0xe3ce('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0xe3ce('0x1'),{'options':{'raw':![],'attributes':['id',_0xe3ce('0x2'),_0xe3ce('0x3'),_0xe3ce('0x4'),'autopause',_0xe3ce('0x5'),'type',_0xe3ce('0x6'),'dialMethod',_0xe3ce('0x7'),_0xe3ce('0x8'),_0xe3ce('0x9'),_0xe3ce('0xa'),_0xe3ce('0xb'),'dialPredictiveInterval',_0xe3ce('0xc'),_0xe3ce('0xd'),_0xe3ce('0xe'),_0xe3ce('0xf'),_0xe3ce('0x10'),_0xe3ce('0x11'),_0xe3ce('0x12'),_0xe3ce('0x13'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0xe3ce('0x14'),_0xe3ce('0x15'),'dialGlobalMaxRetry','dialTimezone','dialGlobalInterval',_0xe3ce('0x16'),_0xe3ce('0x17'),_0xe3ce('0x18'),_0xe3ce('0x19'),_0xe3ce('0x1a'),_0xe3ce('0x1b'),_0xe3ce('0x1c'),_0xe3ce('0x1d'),'dialAMDBetweenWordsSilence',_0xe3ce('0x1e'),_0xe3ce('0x1f'),_0xe3ce('0x20'),_0xe3ce('0x21'),_0xe3ce('0x22'),_0xe3ce('0x23'),_0xe3ce('0x24'),_0xe3ce('0x25'),'dialAgiAfterHangupClient',_0xe3ce('0x26'),_0xe3ce('0x5'),_0xe3ce('0x27'),_0xe3ce('0x28'),_0xe3ce('0x29'),_0xe3ce('0x2a'),_0xe3ce('0x2b'),_0xe3ce('0x2c'),_0xe3ce('0x2d'),'dialAbandonedMaxRetry',_0xe3ce('0x2e'),_0xe3ce('0x2f'),_0xe3ce('0x30'),_0xe3ce('0x31'),_0xe3ce('0x32'),_0xe3ce('0x33'),_0xe3ce('0x34'),_0xe3ce('0x35'),'dialPreviewAutoRecallMe',_0xe3ce('0x36')],'include':[{'model':_0xe3ce('0x37'),'as':'Trunk','attributes':['id',_0xe3ce('0x2'),_0xe3ce('0x38'),'active']},{'model':'Pause','as':_0xe3ce('0x39'),'attributes':['id',_0xe3ce('0x2')]},{'model':_0xe3ce('0x37'),'as':_0xe3ce('0x3a'),'attributes':['id',_0xe3ce('0x2'),_0xe3ce('0x38'),_0xe3ce('0x3b')]},{'model':_0xe3ce('0x3c'),'as':_0xe3ce('0x3c'),'attributes':['id','name'],'include':[{'model':_0xe3ce('0x3c'),'as':_0xe3ce('0x3d'),'attributes':['id',_0xe3ce('0x2'),_0xe3ce('0x3e')]}]}]},'log':_0xe3ce('0x3f')});};}; \ No newline at end of file +var _0xea26=['strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','dialPreviewRecallmeReminder','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','timeout','dialRecallInQueue','dialOrderByScheduledAt'];(function(_0x321cff,_0x271a66){var _0x331c4=function(_0x3846e8){while(--_0x3846e8){_0x321cff['push'](_0x321cff['shift']());}};_0x331c4(++_0x271a66);}(_0xea26,0x170));var _0x6ea2=function(_0x146c16,_0x48baf4){_0x146c16=_0x146c16-0x0;var _0x4c38de=_0xea26[_0x146c16];return _0x4c38de;};'use strict';var client=require(_0x6ea2('0x0'));exports[_0x6ea2('0x1')]=function(){return function(){return client[_0x6ea2('0x2')](_0x6ea2('0x3'),{'options':{'raw':![],'attributes':['id',_0x6ea2('0x4'),_0x6ea2('0x5'),'acwTimeout',_0x6ea2('0x6'),'monitor_format','type',_0x6ea2('0x7'),_0x6ea2('0x8'),_0x6ea2('0x9'),'dialLimitQueue',_0x6ea2('0xa'),_0x6ea2('0xb'),_0x6ea2('0xc'),'dialPredictiveInterval',_0x6ea2('0xd'),'dialOriginateCallerIdNumber',_0x6ea2('0xe'),'dialQueueOptions',_0x6ea2('0xf'),_0x6ea2('0x10'),_0x6ea2('0x11'),_0x6ea2('0x12'),_0x6ea2('0x13'),_0x6ea2('0x14'),_0x6ea2('0x15'),_0x6ea2('0x16'),_0x6ea2('0x17'),_0x6ea2('0x18'),_0x6ea2('0x19'),_0x6ea2('0x1a'),_0x6ea2('0x1b'),'dialAMDActive',_0x6ea2('0x1c'),'dialAMDGreeting',_0x6ea2('0x1d'),_0x6ea2('0x1e'),_0x6ea2('0x1f'),_0x6ea2('0x20'),_0x6ea2('0x21'),_0x6ea2('0x22'),'dialAMDMaximumWordLength',_0x6ea2('0x23'),'dialRecallMeTimeout',_0x6ea2('0x24'),_0x6ea2('0x25'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','monitor_format',_0x6ea2('0x26'),_0x6ea2('0x27'),_0x6ea2('0x28'),_0x6ea2('0x29'),'dialNoSuchNumberRetryFrequency',_0x6ea2('0x2a'),'dialDropRetryFrequency',_0x6ea2('0x2b'),_0x6ea2('0x2c'),_0x6ea2('0x2d'),_0x6ea2('0x2e'),'dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold',_0x6ea2('0x2f'),_0x6ea2('0x30'),_0x6ea2('0x31')],'include':[{'model':_0x6ea2('0x32'),'as':_0x6ea2('0x32'),'attributes':['id',_0x6ea2('0x4'),_0x6ea2('0x33'),_0x6ea2('0x34')]},{'model':_0x6ea2('0x35'),'as':_0x6ea2('0x36'),'attributes':['id',_0x6ea2('0x4')]},{'model':_0x6ea2('0x32'),'as':_0x6ea2('0x37'),'attributes':['id',_0x6ea2('0x4'),_0x6ea2('0x33'),_0x6ea2('0x34')]},{'model':_0x6ea2('0x38'),'as':_0x6ea2('0x38'),'attributes':['id',_0x6ea2('0x4')],'include':[{'model':_0x6ea2('0x38'),'as':'Intervals','attributes':['id',_0x6ea2('0x4'),_0x6ea2('0x39')]}]}]},'log':_0x6ea2('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index a5b3b13..3dd264f 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 _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x1214c0,_0x481d4b){var _0x21d39f=function(_0x3b1629){while(--_0x3b1629){_0x1214c0['push'](_0x1214c0['shift']());}};_0x21d39f(++_0x481d4b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xa9e0=['queuecallerexit','queuecallerexitAt','moment','lodash','../client','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt'];(function(_0x3ed49d,_0xddccc6){var _0x4c7524=function(_0x547383){while(--_0x547383){_0x3ed49d['push'](_0x3ed49d['shift']());}};_0x4c7524(++_0xddccc6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var moment=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var client=require(_0x0a9e('0x2'));exports['create']=function(_0x550fbc){return client[_0x0a9e('0x3')]('CreateVoiceQueueReport',{'body':_0x550fbc,'log':_0x0a9e('0x4')});};exports[_0x0a9e('0x5')]=function(){return function(){return client[_0x0a9e('0x3')](_0x0a9e('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x0a9e('0x7')]('day')[_0x0a9e('0x8')](_0x0a9e('0x9')),moment()[_0x0a9e('0xa')]('day')['format'](_0x0a9e('0x9'))]}},'attributes':['uniqueid','queue',_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe'),_0x0a9e('0xf'),_0x0a9e('0x10'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 5b70c61..04db798 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 _0xa330=['../client','Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses'];(function(_0x22f79b,_0x52a971){var _0x41dd15=function(_0x3547c8){while(--_0x3547c8){_0x22f79b['push'](_0x22f79b['shift']());}};_0x41dd15(++_0x52a971);}(_0xa330,0x98));var _0x0a33=function(_0x58e469,_0x95ee3e){_0x58e469=_0x58e469-0x0;var _0x4c01c5=_0xa330[_0x58e469];return _0x4c01c5;};'use strict';var client=require(_0x0a33('0x0'));exports['getVoiceQueueRtPauses']=function(_0xe5237f){return function(){return client[_0x0a33('0x1')](_0x0a33('0x2'),{'options':{'where':{'VoiceQueueId':_0xe5237f,'paused':!![]},'raw':!![]},'log':_0x0a33('0x3')});};}; \ No newline at end of file +var _0x84d4=['GetVoiceQueueRtPauses','Request'];(function(_0x588a8b,_0x33467a){var _0x46835e=function(_0x41c74e){while(--_0x41c74e){_0x588a8b['push'](_0x588a8b['shift']());}};_0x46835e(++_0x33467a);}(_0x84d4,0xa3));var _0x484d=function(_0x56a60a,_0xf4c330){_0x56a60a=_0x56a60a-0x0;var _0x5c4057=_0x84d4[_0x56a60a];return _0x5c4057;};'use strict';var client=require('../client');exports['getVoiceQueueRtPauses']=function(_0x4d8dba){return function(){return client[_0x484d('0x0')](_0x484d('0x1'),{'options':{'where':{'VoiceQueueId':_0x4d8dba,'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 905c63f..fa61e2b 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 _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x403abe,_0xc6b6c5){var _0x313c92=function(_0x3a3d69){while(--_0x3a3d69){_0x403abe['push'](_0x403abe['shift']());}};_0x313c92(++_0xc6b6c5);}(_0x7a54,0x106));var _0x47a5=function(_0x4cc2f7,_0x3573a8){_0x4cc2f7=_0x4cc2f7-0x0;var _0x1062d0=_0x7a54[_0x4cc2f7];return _0x1062d0;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x3ed189,_0x96c6d0){var _0x5eb671=function(_0x90bdbd){while(--_0x90bdbd){_0x3ed189['push'](_0x3ed189['shift']());}};_0x5eb671(++_0x96c6d0);}(_0x7a54,0x106));var _0x47a5=function(_0x555234,_0x87d5c9){_0x555234=_0x555234-0x0;var _0x9611bb=_0x7a54[_0x555234];return _0x9611bb;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 2d5032f..1d5fdc9 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 _0xde5b=['secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','attended','../client','transfers','transfererchannel','transferercalleridnum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereelinkedid','isexternal','context','CreateVoiceTransferReport','attendedTransfer','Request','result','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode'];(function(_0x1bf3de,_0x3b62be){var _0x186596=function(_0x435a45){while(--_0x435a45){_0x1bf3de['push'](_0x1bf3de['shift']());}};_0x186596(++_0x3b62be);}(_0xde5b,0x1e7));var _0xbde5=function(_0x32a3b3,_0x1d630c){_0x32a3b3=_0x32a3b3-0x0;var _0x122f96=_0xde5b[_0x32a3b3];return _0x122f96;};'use strict';var client=require(_0xbde5('0x0'));exports[_0xbde5('0x1')]={};exports['blindTransfer']=function(_0x2f9341){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0x2f9341['result'],'transfererchannel':_0x2f9341[_0xbde5('0x2')],'transferercalleridnum':_0x2f9341[_0xbde5('0x3')],'transferercalleridname':_0x2f9341['transferercalleridname'],'transfererconnectedlinenum':_0x2f9341['transfererconnectedlinenum'],'transfererconnectedlinename':_0x2f9341[_0xbde5('0x4')],'transfereraccountcode':_0x2f9341[_0xbde5('0x5')],'transferercontext':_0x2f9341[_0xbde5('0x6')],'transfererexten':_0x2f9341['transfererexten'],'transfererlinkedid':_0x2f9341[_0xbde5('0x7')],'transfereechannel':_0x2f9341[_0xbde5('0x8')],'transfereecalleridnum':_0x2f9341[_0xbde5('0x9')],'transfereecalleridname':_0x2f9341[_0xbde5('0xa')],'transfereeconnectedlinenum':_0x2f9341['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x2f9341[_0xbde5('0xb')],'transfereeaccountcode':_0x2f9341['transfereeaccountcode'],'transfereecontext':_0x2f9341['transfereecontext'],'transfereeexten':_0x2f9341['transfereeexten'],'transfereelinkedid':_0x2f9341[_0xbde5('0xc')],'isexternal':_0x2f9341[_0xbde5('0xd')],'context':_0x2f9341[_0xbde5('0xe')],'extension':_0x2f9341['extension'],'type':'blind'},'log':_0xbde5('0xf')});};exports[_0xbde5('0x10')]=function(_0x5d3648){return client[_0xbde5('0x11')](_0xbde5('0xf'),{'body':{'result':_0x5d3648[_0xbde5('0x12')],'transfererchannel':_0x5d3648[_0xbde5('0x13')],'transferercalleridnum':_0x5d3648['origtransferercalleridnum'],'transferercalleridname':_0x5d3648[_0xbde5('0x14')],'transfererconnectedlinenum':_0x5d3648['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x5d3648[_0xbde5('0x15')],'transfereraccountcode':_0x5d3648[_0xbde5('0x16')],'transferercontext':_0x5d3648[_0xbde5('0x17')],'transfererexten':_0x5d3648['secondtransfererexten'],'transfererlinkedid':_0x5d3648[_0xbde5('0x18')],'transfereechannel':_0x5d3648[_0xbde5('0x19')],'transfereecalleridnum':_0x5d3648[_0xbde5('0x1a')],'transfereecalleridname':_0x5d3648[_0xbde5('0x1b')],'transfereeconnectedlinenum':_0x5d3648[_0xbde5('0x1c')],'transfereeconnectedlinename':_0x5d3648[_0xbde5('0x1d')],'transfereeaccountcode':_0x5d3648[_0xbde5('0x1e')],'transfereecontext':_0x5d3648[_0xbde5('0x1f')],'transfereeexten':_0x5d3648[_0xbde5('0x20')],'transfereelinkedid':_0x5d3648['transfertargetlinkedid'],'isexternal':_0x5d3648['isexternal'],'context':_0x5d3648['origtransferercontext'],'extension':_0x5d3648['origtransfererexten'],'type':_0xbde5('0x21')},'log':_0xbde5('0xf')});}; \ No newline at end of file +var _0xca4a=['origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','origtransfererexten','attended','../client','transfers','blindTransfer','result','transferercalleridname','transfereraccountcode','transferercontext','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereelinkedid','isexternal','context','extension','blind','CreateVoiceTransferReport','Request','origtransfererchannel'];(function(_0x20cf10,_0x465f55){var _0x53fe52=function(_0x1c2fb2){while(--_0x1c2fb2){_0x20cf10['push'](_0x20cf10['shift']());}};_0x53fe52(++_0x465f55);}(_0xca4a,0x196));var _0xaca4=function(_0x1026ff,_0x1ece0c){_0x1026ff=_0x1026ff-0x0;var _0x19cc2c=_0xca4a[_0x1026ff];return _0x19cc2c;};'use strict';var client=require(_0xaca4('0x0'));exports[_0xaca4('0x1')]={};exports[_0xaca4('0x2')]=function(_0xf0698c){return client['Request']('CreateVoiceTransferReport',{'body':{'result':_0xf0698c[_0xaca4('0x3')],'transfererchannel':_0xf0698c['transfererchannel'],'transferercalleridnum':_0xf0698c['transferercalleridnum'],'transferercalleridname':_0xf0698c[_0xaca4('0x4')],'transfererconnectedlinenum':_0xf0698c['transfererconnectedlinenum'],'transfererconnectedlinename':_0xf0698c['transfererconnectedlinename'],'transfereraccountcode':_0xf0698c[_0xaca4('0x5')],'transferercontext':_0xf0698c[_0xaca4('0x6')],'transfererexten':_0xf0698c['transfererexten'],'transfererlinkedid':_0xf0698c[_0xaca4('0x7')],'transfereechannel':_0xf0698c[_0xaca4('0x8')],'transfereecalleridnum':_0xf0698c[_0xaca4('0x9')],'transfereecalleridname':_0xf0698c[_0xaca4('0xa')],'transfereeconnectedlinenum':_0xf0698c[_0xaca4('0xb')],'transfereeconnectedlinename':_0xf0698c[_0xaca4('0xc')],'transfereeaccountcode':_0xf0698c[_0xaca4('0xd')],'transfereecontext':_0xf0698c[_0xaca4('0xe')],'transfereeexten':_0xf0698c['transfereeexten'],'transfereelinkedid':_0xf0698c[_0xaca4('0xf')],'isexternal':_0xf0698c[_0xaca4('0x10')],'context':_0xf0698c[_0xaca4('0x11')],'extension':_0xf0698c[_0xaca4('0x12')],'type':_0xaca4('0x13')},'log':_0xaca4('0x14')});};exports['attendedTransfer']=function(_0x59260b){return client[_0xaca4('0x15')](_0xaca4('0x14'),{'body':{'result':_0x59260b['result'],'transfererchannel':_0x59260b[_0xaca4('0x16')],'transferercalleridnum':_0x59260b['origtransferercalleridnum'],'transferercalleridname':_0x59260b[_0xaca4('0x17')],'transfererconnectedlinenum':_0x59260b[_0xaca4('0x18')],'transfererconnectedlinename':_0x59260b[_0xaca4('0x19')],'transfereraccountcode':_0x59260b[_0xaca4('0x1a')],'transferercontext':_0x59260b[_0xaca4('0x1b')],'transfererexten':_0x59260b[_0xaca4('0x1c')],'transfererlinkedid':_0x59260b[_0xaca4('0x1d')],'transfereechannel':_0x59260b['transfertargetchannel'],'transfereecalleridnum':_0x59260b[_0xaca4('0x1e')],'transfereecalleridname':_0x59260b[_0xaca4('0x1f')],'transfereeconnectedlinenum':_0x59260b[_0xaca4('0x20')],'transfereeconnectedlinename':_0x59260b[_0xaca4('0x21')],'transfereeaccountcode':_0x59260b[_0xaca4('0x22')],'transfereecontext':_0x59260b['transfertargetcontext'],'transfereeexten':_0x59260b[_0xaca4('0x23')],'transfereelinkedid':_0x59260b[_0xaca4('0x24')],'isexternal':_0x59260b['isexternal'],'context':_0x59260b['origtransferercontext'],'extension':_0x59260b[_0xaca4('0x25')],'type':_0xaca4('0x26')},'log':_0xaca4('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index cf191cd..e795b24 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 _0xdbf5=['outbound','includes','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','exten','context','agents','telephones','trunks','outboundChannels','run','event','Event\x20name\x20mandatory','emit','send','checkAfterSend','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','listen','%s/%s','SIP','name','timers','updateAcw','updateStatusRealtime','QueuePause','asterisk','ami\x20disconnected','join','pick','keys','reload','module','action','then','message','catch','isConnected','error','command','Command','Action','content','voiceQueues','hasOwnProperty','push','length','find','undefined','values','channels','username','voicechannel','validate','map','uniqueid','channel','format','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','%s.%s','stop','StopMixMonitor\x20Success','queueChannels','type','inbound'];(function(_0x320b9e,_0x1f892f){var _0x5e4416=function(_0x160fcc){while(--_0x160fcc){_0x320b9e['push'](_0x320b9e['shift']());}};_0x5e4416(++_0x1f892f);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x352ae1,_0x25fa04){_0x352ae1=_0x352ae1-0x0;var _0x53fd34=_0xdbf5[_0x352ae1];return _0x53fd34;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var jayson=require('jayson/promise');var schema=require('validate');var moment=require(_0x5dbf('0x1'));var config=require(_0x5dbf('0x2'));var properties=require(_0x5dbf('0x3'));var ami=require(_0x5dbf('0x4'));var VoiceQueueSummary=require(_0x5dbf('0x5'));exports[_0x5dbf('0x6')]=function(_0x776036,_0x1decd2,_0x3f8628){return new Promise(function(_0x3f8222,_0x209b7d){var _0x88128e={'QueuePause':function(_0x93e657){return new Promise(function(_0x52b039){var _0x134810=util['format'](_0x5dbf('0x7'),_0x5dbf('0x8'),_0x93e657[_0x5dbf('0x9')]);if(_0x776036[_0x5dbf('0xa')]&&_0x776036['timers'][_0x134810]&&_0x776036[_0x5dbf('0xa')][_0x134810]['timer']){_0x776036['timers'][_0x134810][_0x5dbf('0xb')]();}if(_0x776036['agents'][_0x134810]){_0x776036['agents'][_0x134810][_0x5dbf('0xc')]({'statePause':_0x93e657['pause']?!![]:![]});}_0x52b039({'code':0xc8,'message':_0x5dbf('0xd')});});},'Reload':function(_0x2bb7ed){var _0x1453a9=this;return new Promise(function(_0x7cb848,_0x14493a){if(ami['isConnected']()==![]){return _0x14493a(_0x1453a9['error'](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')]['username'],_0x5dbf('0xf')][_0x5dbf('0x10')]('\x20')));}_0x2bb7ed=_[_0x5dbf('0x11')](_0x2bb7ed,_[_0x5dbf('0x12')](properties[_0x5dbf('0x13')][_0x5dbf('0x14')]));_0x2bb7ed[_0x5dbf('0x15')]='Reload';return ami['Action'](_0x2bb7ed)[_0x5dbf('0x16')](function(_0xc4cb1c){_0x7cb848({'code':0xc8,'message':_0xc4cb1c[_0x5dbf('0x17')]});})[_0x5dbf('0x18')](function(_0x20c2b0){_0x14493a(_0x1453a9['error'](0x1f5,_0x20c2b0[_0x5dbf('0x17')]));});});},'Command':function(_0x4dd03c){var _0x565efa=this;return new Promise(function(_0x577ca2,_0x23d1e7){if(ami[_0x5dbf('0x19')]()==![]){return _0x23d1e7(_0x565efa[_0x5dbf('0x1a')](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')]['username'],_0x5dbf('0xf')]['join']('\x20')));}_0x4dd03c=_[_0x5dbf('0x11')](_0x4dd03c,_0x5dbf('0x1b'));_0x4dd03c[_0x5dbf('0x15')]=_0x5dbf('0x1c');return ami[_0x5dbf('0x1d')](_0x4dd03c)[_0x5dbf('0x16')](function(_0x58085e){_0x577ca2({'code':0xc8,'message':_0x58085e[_0x5dbf('0x1e')]});})[_0x5dbf('0x18')](function(_0x2d3e1b){_0x23d1e7(_0x565efa[_0x5dbf('0x1a')](0x1f5,_0x2d3e1b[_0x5dbf('0x17')]));});});},'VoiceQueues':function(){return new Promise(function(_0x226b93){var _0x290456=[];for(var _0x20ab1b in _0x776036[_0x5dbf('0x1f')]){if(_0x776036[_0x5dbf('0x1f')][_0x5dbf('0x20')](_0x20ab1b)){var _0x232c77=_0x776036[_0x5dbf('0x1f')][_0x20ab1b];var _0x407741=new VoiceQueueSummary(_0x232c77);_0x290456[_0x5dbf('0x21')](_0x407741);}}_0x226b93({'count':_0x290456[_0x5dbf('0x22')],'rows':_0x290456});});},'UpdateVoiceQueue':function(_0x466985){return new Promise(function(_0x3f8341,_0x159e61){var _0x22ec42=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x1f')],{'id':parseInt(_0x466985['id'])});var _0x21cd00=_['omit'](_0x466985,['id']);if(_0x22ec42){for(var _0x2f71eb in _0x21cd00){if(typeof _0x21cd00[_0x2f71eb]!==_0x5dbf('0x24')&&typeof _0x22ec42[_0x2f71eb]!==_0x5dbf('0x24')){_0x22ec42[_0x2f71eb]=_0x21cd00[_0x2f71eb];}}_0x3f8341(_0x22ec42);}else{_0x159e61();}});},'VoiceChannels':function(){return new Promise(function(_0x1fb9a7){var _0x38825a=_[_0x5dbf('0x25')](_0x776036[_0x5dbf('0x26')]);_0x1fb9a7({'count':_0x38825a[_0x5dbf('0x22')],'rows':_0x38825a});});},'VoiceChannelMixMonitor':function(_0x406ce6){var _0x273b63=this;return new Promise(function(_0x294dd7,_0x50a307){if(ami['isConnected']()==![]){return _0x50a307(_0x273b63[_0x5dbf('0x1a')](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')][_0x5dbf('0x27')],_0x5dbf('0xf')]['join']('\x20')));}var _0x5cc3f1=schema(properties[_0x5dbf('0x28')])[_0x5dbf('0x29')](_0x406ce6);if(_0x5cc3f1['length']>0x0){return _0x50a307(_0x273b63[_0x5dbf('0x1a')](0x1f4,_[_0x5dbf('0x2a')](_0x5cc3f1,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x27e058=_['find'](_0x776036[_0x5dbf('0x26')],{'uniqueid':_0x406ce6[_0x5dbf('0x2b')]});if(_0x27e058&&_0x27e058[_0x5dbf('0x2c')]){var _0x273577=util[_0x5dbf('0x2d')]('%s.%s',_0x406ce6[_0x5dbf('0x2e')]||_0x406ce6[_0x5dbf('0x2b')],_0x406ce6[_0x5dbf('0x2d')]||_0x5dbf('0x2f'));return ami['Action']({'action':_0x5dbf('0x30'),'channel':_0x27e058[_0x5dbf('0x2c')],'file':_0x273577,'options':_0x5dbf('0x31')})[_0x5dbf('0x16')](function(_0x3e309a){var _0x843d9a=_[_0x5dbf('0x23')](_0x27e058[_0x5dbf('0x32')],{'filename':_0x5dbf('0x33')+_0x273577[_0x5dbf('0x34')]()});if(_[_0x5dbf('0x35')](_0x843d9a)){_0x27e058['monitors'][_0x5dbf('0x21')]({'filename':_0x5dbf('0x33')+_0x273577[_0x5dbf('0x34')](),'createdAt':moment()['format'](_0x5dbf('0x36')),'mixmonitorid':_0x3e309a[_0x5dbf('0x37')],'status':_0x5dbf('0x38')});}else{_0x843d9a['mixmonitorid']=_0x3e309a[_0x5dbf('0x37')];_0x843d9a[_0x5dbf('0x39')]=_0x5dbf('0x38');}_0x294dd7({'code':0xc8,'message':[_0x406ce6['uniqueid'],_0x5dbf('0x3a'),_0x3e309a[_0x5dbf('0x37')]][_0x5dbf('0x10')]('\x20'),'mixmonitorid':_0x3e309a[_0x5dbf('0x37')]});})[_0x5dbf('0x18')](function(_0x6ebcc6){_0x50a307(_0x273b63[_0x5dbf('0x1a')](0x1f5,[_0x406ce6[_0x5dbf('0x2b')],_0x6ebcc6['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x50a307(_0x273b63['error'](0x1f5,_0x5dbf('0x3b')));}});},'VoiceChannelStopMixMonitor':function(_0x21122d){var _0x54e5e7=this;return new Promise(function(_0x3ef0eb,_0x229abf){if(ami['isConnected']()==![]){return _0x229abf(_0x54e5e7[_0x5dbf('0x1a')](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')][_0x5dbf('0x27')],_0x5dbf('0xf')][_0x5dbf('0x10')]('\x20')));}var _0x2745df=schema(properties[_0x5dbf('0x28')])[_0x5dbf('0x29')](_0x21122d);if(_0x2745df[_0x5dbf('0x22')]>0x0){return _0x229abf(_0x54e5e7['error'](0x1f4,_[_0x5dbf('0x2a')](_0x2745df,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x50880d=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x26')],{'uniqueid':_0x21122d[_0x5dbf('0x2b')]});if(_0x50880d){return Promise[_0x5dbf('0x3c')]()['then'](function(){if(_0x50880d[_0x5dbf('0x2c')]){return ami['Action']({'action':_0x5dbf('0x3d'),'channel':_0x50880d[_0x5dbf('0x2c')],'mixmonitorid':_0x21122d[_0x5dbf('0x37')]})[_0x5dbf('0x18')](function(){});}})['then'](function(){if(_0x50880d['destinationchannel']){return ami[_0x5dbf('0x1d')]({'action':_0x5dbf('0x3d'),'channel':_0x50880d[_0x5dbf('0x3e')],'mixmonitorid':_0x21122d['mixmonitorid']})[_0x5dbf('0x18')](function(){});}})['then'](function(){var _0x4d8df1=_['find'](_0x50880d['monitors'],{'mixmonitorid':_0x21122d[_0x5dbf('0x37')]});if(_0x4d8df1){_0x4d8df1[_0x5dbf('0x39')]='stop';}})[_0x5dbf('0x16')](function(){var _0x3ba5cb=util['format'](_0x5dbf('0x3f'),_0x21122d[_0x5dbf('0x2e')]||_0x21122d['uniqueid'],_0x21122d[_0x5dbf('0x2d')]||'wav');var _0x5ab862=_[_0x5dbf('0x23')](_0x50880d[_0x5dbf('0x32')],{'filename':_0x5dbf('0x33')+_0x3ba5cb['toLowerCase']()});if(_0x5ab862){_0x5ab862['status']=_0x5dbf('0x40');}})[_0x5dbf('0x16')](function(){_0x3ef0eb({'code':0xc8,'message':[_0x21122d[_0x5dbf('0x2b')],_0x5dbf('0x41')][_0x5dbf('0x10')]('\x20')});})[_0x5dbf('0x18')](function(_0x3b49c6){_0x229abf(_0x54e5e7[_0x5dbf('0x1a')](0x1f5,[_0x21122d['uniqueid'],_0x3b49c6[_0x5dbf('0x17')][_0x5dbf('0x34')]()][_0x5dbf('0x10')]('\x20')));});}else{return _0x229abf(_0x54e5e7[_0x5dbf('0x1a')](0x1f5,_0x5dbf('0x3b')));}});},'VoiceQueuesChannels':function(_0x3cc286){var _0x328dc5=this;return new Promise(function(_0x59f825){var _0x1b0b13=_['values'](_0x776036[_0x5dbf('0x42')]);var _0x1a5d82={'count':_0x1b0b13[_0x5dbf('0x22')],'rows':_0x1b0b13};if(_0x3cc286&&_0x3cc286[_0x5dbf('0x43')]){if(![_0x5dbf('0x44'),_0x5dbf('0x45')][_0x5dbf('0x46')](_0x3cc286['type'])){return _0x209b7d(_0x328dc5['error'](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x1e1876=_[_0x5dbf('0x47')](_0x1b0b13,function(_0x36a787){return _0x36a787['type']===_0x3cc286['type'];});_0x1a5d82[_0x5dbf('0x48')]=_0x1e1876[_0x5dbf('0x22')];_0x1a5d82[_0x5dbf('0x49')]=_0x1e1876;}_0x59f825(_0x1a5d82);});},'VoiceQueuesChannel':function(_0x5d70cc){var _0x2c9876=this;return new Promise(function(_0x56633d,_0x3ce224){var _0x37f16f=schema(properties[_0x5dbf('0x4a')])['validate'](_0x5d70cc);if(_0x37f16f['length']>0x0){return _0x3ce224(_0x2c9876[_0x5dbf('0x1a')](0x1f4,_[_0x5dbf('0x2a')](_0x37f16f,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x4c034f=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x42')],{'uniqueid':_0x5d70cc['uniqueid']});if(_0x4c034f){_0x56633d(_0x4c034f);}else{return _0x3ce224(_0x2c9876['error'](0x1f5,_0x5dbf('0x3b')));}});},'VoiceQueuesChannelHangup':function(_0x14bdb1){var _0x197e8c=this;return new Promise(function(_0x20ee69,_0x3e13cb){if(ami[_0x5dbf('0x19')]()==![]){return _0x3e13cb(_0x197e8c['error'](0x1f4,[config[_0x5dbf('0xe')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0x5dbf('0x10')]('\x20')));}var _0x5f2005=schema(properties[_0x5dbf('0x4b')])[_0x5dbf('0x29')](_0x14bdb1);if(_0x5f2005[_0x5dbf('0x22')]>0x0){return _0x3e13cb(_0x197e8c[_0x5dbf('0x1a')](0x1f4,_[_0x5dbf('0x2a')](_0x5f2005,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x100d83=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x42')],{'uniqueid':_0x14bdb1[_0x5dbf('0x2b')]});if(_0x100d83&&_0x100d83[_0x5dbf('0x2c')]){return ami[_0x5dbf('0x1d')]({'action':_0x5dbf('0x4c'),'channel':_0x100d83[_0x5dbf('0x2c')]})['then'](function(_0x3fbc3d){_0x20ee69({'code':0xc8,'message':[_0x14bdb1['uniqueid'],_0x3fbc3d[_0x5dbf('0x17')][_0x5dbf('0x34')]()][_0x5dbf('0x10')]('\x20')});})[_0x5dbf('0x18')](function(_0x5a975a){_0x3e13cb(_0x197e8c[_0x5dbf('0x1a')](0x1f5,[_0x14bdb1[_0x5dbf('0x2b')],_0x5a975a[_0x5dbf('0x17')][_0x5dbf('0x34')]()][_0x5dbf('0x10')]('\x20')));});}else{return _0x3e13cb(_0x197e8c[_0x5dbf('0x1a')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x5ccda4){var _0x3e5a96=this;return new Promise(function(_0x3b0465,_0x18bc53){if(ami[_0x5dbf('0x19')]()==![]){return _0x18bc53(_0x3e5a96[_0x5dbf('0x1a')](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')][_0x5dbf('0x27')],_0x5dbf('0xf')][_0x5dbf('0x10')]('\x20')));}var _0x2997a8=schema(properties['voicequeuechannelredirect'])['validate'](_0x5ccda4);if(_0x2997a8[_0x5dbf('0x22')]>0x0){return _0x18bc53(_0x3e5a96[_0x5dbf('0x1a')](0x1f4,_[_0x5dbf('0x2a')](_0x2997a8,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x377d52=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x42')],{'uniqueid':_0x5ccda4[_0x5dbf('0x2b')]});if(_0x377d52&&_0x377d52['channel']){return ami['Action']({'action':'Redirect','channel':_0x377d52['channel'],'exten':_0x5ccda4[_0x5dbf('0x4d')],'context':_0x5ccda4[_0x5dbf('0x4e')]||_0x377d52[_0x5dbf('0x4e')],'priority':0x1})[_0x5dbf('0x16')](function(_0x29c4d9){_0x3b0465({'code':0xc8,'message':[_0x5ccda4[_0x5dbf('0x2b')],_0x29c4d9['message']['toLowerCase']()][_0x5dbf('0x10')]('\x20')});})[_0x5dbf('0x18')](function(_0x5e84ab){_0x18bc53(_0x3e5a96[_0x5dbf('0x1a')](0x1f5,[_0x5ccda4[_0x5dbf('0x2b')],_0x5e84ab[_0x5dbf('0x17')][_0x5dbf('0x34')]()]['join']('\x20')));});}else{return _0x18bc53(_0x3e5a96[_0x5dbf('0x1a')](0x1f5,_0x5dbf('0x3b')));}});},'Agents':function(_0x131100){return new Promise(function(_0x1afaff){var _0x2aed16=_['values'](_0x776036[_0x5dbf('0x4f')]);if(_0x131100&&_0x131100['id']){var _0x3fce29=_[_0x5dbf('0x23')](_0x2aed16,function(_0x242e02){return _0x242e02['id']===_0x131100['id'];});_0x1afaff(_0x3fce29);}else{_0x1afaff({'count':_0x2aed16['length'],'rows':_0x2aed16});}});},'Telephones':function(){return new Promise(function(_0x11db7e){var _0x5b75a2=_[_0x5dbf('0x25')](_0x776036[_0x5dbf('0x50')]);_0x11db7e({'count':_0x5b75a2[_0x5dbf('0x22')],'rows':_0x5b75a2});});},'Trunks':function(){return new Promise(function(_0x5f2d67){var _0x46db8d=_[_0x5dbf('0x25')](_0x776036[_0x5dbf('0x51')]);_0x5f2d67({'count':_0x46db8d[_0x5dbf('0x22')],'rows':_0x46db8d});});},'OutboundChannels':function(){return new Promise(function(_0x50db0b){var _0x1f9d2d=_[_0x5dbf('0x25')](_0x776036[_0x5dbf('0x52')]);_0x50db0b({'count':_0x1f9d2d[_0x5dbf('0x22')],'rows':_0x1f9d2d});});},'Outbound':function(){return new Promise(function(_0x392a9b){_0x392a9b(_0x776036[_0x5dbf('0x45')]);});},'Campaigns':function(){return new Promise(function(_0x560d62){var _0x1efc21=_[_0x5dbf('0x25')](_0x776036['campaigns']);_0x560d62({'count':_0x1efc21[_0x5dbf('0x22')],'rows':_0x1efc21});});},'VoiceQueuesPreview':function(_0x2754bb){var _0x1a71fe=this;return new Promise(function(_0x3457de,_0x252be1){_0x1decd2[_0x5dbf('0x53')](_0x2754bb['id'])[_0x5dbf('0x16')](function(_0xdc4439){_0x3457de({'code':0xc8,'message':_0xdc4439[_0x5dbf('0x17')]});})[_0x5dbf('0x18')](function(_0x1fa250){_0x252be1(_0x1a71fe[_0x5dbf('0x1a')](0x1f4,_0x1fa250[_0x5dbf('0x17')]));});});},'EventManager':function(_0x248c1d){var _0x19f5ab=this;return new Promise(function(_0x37c1a3,_0x542667){if(!_0x248c1d[_0x5dbf('0x54')]){return _0x542667(_0x19f5ab[_0x5dbf('0x1a')](0x1f4,_0x5dbf('0x55')));}ami[_0x5dbf('0x56')]('custom:'+_0x248c1d[_0x5dbf('0x54')],_0x248c1d[_0x5dbf('0x17')]);_0x37c1a3({'code':0xc8,'message':_0x248c1d});});},'FaxAccounts':function(){return new Promise(function(_0x29a71a){var _0x42df4d=_[_0x5dbf('0x25')](_0x776036['faxAccounts']);_0x29a71a({'count':_0x42df4d[_0x5dbf('0x22')],'rows':_0x42df4d});});},'SendFax':function(_0x1ba14c){var _0x4e0117=this;return new Promise(function(_0x5d02f7,_0x3dac55){_0x3f8628[_0x5dbf('0x57')](_0x1ba14c)[_0x5dbf('0x16')](function(_0x8ca7de){_0x5d02f7({'code':0xc8,'message':_0x8ca7de[_0x5dbf('0x17')]});})[_0x5dbf('0x18')](function(_0x22339b){_0x3dac55(_0x4e0117['error'](0x1f4,_0x22339b[_0x5dbf('0x17')]));});});},'CheckAfterSend':function(_0x3b01c0){var _0x25c831=this;return new Promise(function(_0x1dd5b4,_0x39e600){_0x3f8628[_0x5dbf('0x58')](_0x3b01c0)['then'](function(_0x625875){_0x1dd5b4({'code':0xc8,'message':_0x625875[_0x5dbf('0x17')]});})[_0x5dbf('0x18')](function(_0x2c5a6e){_0x39e600(_0x25c831[_0x5dbf('0x1a')](0x1f4,_0x2c5a6e['message']));});});}};var _0x2ef784=jayson['server'](_0x88128e)['http']();_0x2ef784['on']('error',function(_0x496306){return _0x209b7d(_0x496306);});_0x2ef784[_0x5dbf('0x6')](0x232a,_0x5dbf('0x59'),function(){console[_0x5dbf('0x5a')](_0x5dbf('0x5b'),0x232a);return _0x3f8222(_0x5dbf('0x5c')+0x232a);});});}; \ No newline at end of file +var _0xdbf5=['outbound','includes','filter','count','rows','voicequeuechannel','voicequeuechannelhangup','Hangup','exten','context','agents','telephones','trunks','outboundChannels','run','event','Event\x20name\x20mandatory','emit','send','checkAfterSend','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','moment','../../../config/environment','../properties','../ami','../model/voiceQueueSummary','listen','%s/%s','SIP','name','timers','updateAcw','updateStatusRealtime','QueuePause','asterisk','ami\x20disconnected','join','pick','keys','reload','module','action','then','message','catch','isConnected','error','command','Command','Action','content','voiceQueues','hasOwnProperty','push','length','find','undefined','values','channels','username','voicechannel','validate','map','uniqueid','channel','format','filename','wav','MixMonitor','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','%s.%s','stop','StopMixMonitor\x20Success','queueChannels','type','inbound'];(function(_0x3102ab,_0x481c69){var _0x232720=function(_0x47cdf5){while(--_0x47cdf5){_0x3102ab['push'](_0x3102ab['shift']());}};_0x232720(++_0x481c69);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x2b1a5c,_0x4e3f8e){_0x2b1a5c=_0x2b1a5c-0x0;var _0x3f16a7=_0xdbf5[_0x2b1a5c];return _0x3f16a7;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var jayson=require('jayson/promise');var schema=require('validate');var moment=require(_0x5dbf('0x1'));var config=require(_0x5dbf('0x2'));var properties=require(_0x5dbf('0x3'));var ami=require(_0x5dbf('0x4'));var VoiceQueueSummary=require(_0x5dbf('0x5'));exports[_0x5dbf('0x6')]=function(_0x776036,_0x1decd2,_0x3f8628){return new Promise(function(_0x3f8222,_0x209b7d){var _0x88128e={'QueuePause':function(_0x93e657){return new Promise(function(_0x52b039){var _0x134810=util['format'](_0x5dbf('0x7'),_0x5dbf('0x8'),_0x93e657[_0x5dbf('0x9')]);if(_0x776036[_0x5dbf('0xa')]&&_0x776036['timers'][_0x134810]&&_0x776036[_0x5dbf('0xa')][_0x134810]['timer']){_0x776036['timers'][_0x134810][_0x5dbf('0xb')]();}if(_0x776036['agents'][_0x134810]){_0x776036['agents'][_0x134810][_0x5dbf('0xc')]({'statePause':_0x93e657['pause']?!![]:![]});}_0x52b039({'code':0xc8,'message':_0x5dbf('0xd')});});},'Reload':function(_0x2bb7ed){var _0x1453a9=this;return new Promise(function(_0x7cb848,_0x14493a){if(ami['isConnected']()==![]){return _0x14493a(_0x1453a9['error'](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')]['username'],_0x5dbf('0xf')][_0x5dbf('0x10')]('\x20')));}_0x2bb7ed=_[_0x5dbf('0x11')](_0x2bb7ed,_[_0x5dbf('0x12')](properties[_0x5dbf('0x13')][_0x5dbf('0x14')]));_0x2bb7ed[_0x5dbf('0x15')]='Reload';return ami['Action'](_0x2bb7ed)[_0x5dbf('0x16')](function(_0xc4cb1c){_0x7cb848({'code':0xc8,'message':_0xc4cb1c[_0x5dbf('0x17')]});})[_0x5dbf('0x18')](function(_0x20c2b0){_0x14493a(_0x1453a9['error'](0x1f5,_0x20c2b0[_0x5dbf('0x17')]));});});},'Command':function(_0x4dd03c){var _0x565efa=this;return new Promise(function(_0x577ca2,_0x23d1e7){if(ami[_0x5dbf('0x19')]()==![]){return _0x23d1e7(_0x565efa[_0x5dbf('0x1a')](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')]['username'],_0x5dbf('0xf')]['join']('\x20')));}_0x4dd03c=_[_0x5dbf('0x11')](_0x4dd03c,_0x5dbf('0x1b'));_0x4dd03c[_0x5dbf('0x15')]=_0x5dbf('0x1c');return ami[_0x5dbf('0x1d')](_0x4dd03c)[_0x5dbf('0x16')](function(_0x58085e){_0x577ca2({'code':0xc8,'message':_0x58085e[_0x5dbf('0x1e')]});})[_0x5dbf('0x18')](function(_0x2d3e1b){_0x23d1e7(_0x565efa[_0x5dbf('0x1a')](0x1f5,_0x2d3e1b[_0x5dbf('0x17')]));});});},'VoiceQueues':function(){return new Promise(function(_0x226b93){var _0x290456=[];for(var _0x20ab1b in _0x776036[_0x5dbf('0x1f')]){if(_0x776036[_0x5dbf('0x1f')][_0x5dbf('0x20')](_0x20ab1b)){var _0x232c77=_0x776036[_0x5dbf('0x1f')][_0x20ab1b];var _0x407741=new VoiceQueueSummary(_0x232c77);_0x290456[_0x5dbf('0x21')](_0x407741);}}_0x226b93({'count':_0x290456[_0x5dbf('0x22')],'rows':_0x290456});});},'UpdateVoiceQueue':function(_0x466985){return new Promise(function(_0x3f8341,_0x159e61){var _0x22ec42=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x1f')],{'id':parseInt(_0x466985['id'])});var _0x21cd00=_['omit'](_0x466985,['id']);if(_0x22ec42){for(var _0x2f71eb in _0x21cd00){if(typeof _0x21cd00[_0x2f71eb]!==_0x5dbf('0x24')&&typeof _0x22ec42[_0x2f71eb]!==_0x5dbf('0x24')){_0x22ec42[_0x2f71eb]=_0x21cd00[_0x2f71eb];}}_0x3f8341(_0x22ec42);}else{_0x159e61();}});},'VoiceChannels':function(){return new Promise(function(_0x1fb9a7){var _0x38825a=_[_0x5dbf('0x25')](_0x776036[_0x5dbf('0x26')]);_0x1fb9a7({'count':_0x38825a[_0x5dbf('0x22')],'rows':_0x38825a});});},'VoiceChannelMixMonitor':function(_0x406ce6){var _0x273b63=this;return new Promise(function(_0x294dd7,_0x50a307){if(ami['isConnected']()==![]){return _0x50a307(_0x273b63[_0x5dbf('0x1a')](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')][_0x5dbf('0x27')],_0x5dbf('0xf')]['join']('\x20')));}var _0x5cc3f1=schema(properties[_0x5dbf('0x28')])[_0x5dbf('0x29')](_0x406ce6);if(_0x5cc3f1['length']>0x0){return _0x50a307(_0x273b63[_0x5dbf('0x1a')](0x1f4,_[_0x5dbf('0x2a')](_0x5cc3f1,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x27e058=_['find'](_0x776036[_0x5dbf('0x26')],{'uniqueid':_0x406ce6[_0x5dbf('0x2b')]});if(_0x27e058&&_0x27e058[_0x5dbf('0x2c')]){var _0x273577=util[_0x5dbf('0x2d')]('%s.%s',_0x406ce6[_0x5dbf('0x2e')]||_0x406ce6[_0x5dbf('0x2b')],_0x406ce6[_0x5dbf('0x2d')]||_0x5dbf('0x2f'));return ami['Action']({'action':_0x5dbf('0x30'),'channel':_0x27e058[_0x5dbf('0x2c')],'file':_0x273577,'options':_0x5dbf('0x31')})[_0x5dbf('0x16')](function(_0x3e309a){var _0x843d9a=_[_0x5dbf('0x23')](_0x27e058[_0x5dbf('0x32')],{'filename':_0x5dbf('0x33')+_0x273577[_0x5dbf('0x34')]()});if(_[_0x5dbf('0x35')](_0x843d9a)){_0x27e058['monitors'][_0x5dbf('0x21')]({'filename':_0x5dbf('0x33')+_0x273577[_0x5dbf('0x34')](),'createdAt':moment()['format'](_0x5dbf('0x36')),'mixmonitorid':_0x3e309a[_0x5dbf('0x37')],'status':_0x5dbf('0x38')});}else{_0x843d9a['mixmonitorid']=_0x3e309a[_0x5dbf('0x37')];_0x843d9a[_0x5dbf('0x39')]=_0x5dbf('0x38');}_0x294dd7({'code':0xc8,'message':[_0x406ce6['uniqueid'],_0x5dbf('0x3a'),_0x3e309a[_0x5dbf('0x37')]][_0x5dbf('0x10')]('\x20'),'mixmonitorid':_0x3e309a[_0x5dbf('0x37')]});})[_0x5dbf('0x18')](function(_0x6ebcc6){_0x50a307(_0x273b63[_0x5dbf('0x1a')](0x1f5,[_0x406ce6[_0x5dbf('0x2b')],_0x6ebcc6['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x50a307(_0x273b63['error'](0x1f5,_0x5dbf('0x3b')));}});},'VoiceChannelStopMixMonitor':function(_0x21122d){var _0x54e5e7=this;return new Promise(function(_0x3ef0eb,_0x229abf){if(ami['isConnected']()==![]){return _0x229abf(_0x54e5e7[_0x5dbf('0x1a')](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')][_0x5dbf('0x27')],_0x5dbf('0xf')][_0x5dbf('0x10')]('\x20')));}var _0x2745df=schema(properties[_0x5dbf('0x28')])[_0x5dbf('0x29')](_0x21122d);if(_0x2745df[_0x5dbf('0x22')]>0x0){return _0x229abf(_0x54e5e7['error'](0x1f4,_[_0x5dbf('0x2a')](_0x2745df,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x50880d=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x26')],{'uniqueid':_0x21122d[_0x5dbf('0x2b')]});if(_0x50880d){return Promise[_0x5dbf('0x3c')]()['then'](function(){if(_0x50880d[_0x5dbf('0x2c')]){return ami['Action']({'action':_0x5dbf('0x3d'),'channel':_0x50880d[_0x5dbf('0x2c')],'mixmonitorid':_0x21122d[_0x5dbf('0x37')]})[_0x5dbf('0x18')](function(){});}})['then'](function(){if(_0x50880d['destinationchannel']){return ami[_0x5dbf('0x1d')]({'action':_0x5dbf('0x3d'),'channel':_0x50880d[_0x5dbf('0x3e')],'mixmonitorid':_0x21122d['mixmonitorid']})[_0x5dbf('0x18')](function(){});}})['then'](function(){var _0x4d8df1=_['find'](_0x50880d['monitors'],{'mixmonitorid':_0x21122d[_0x5dbf('0x37')]});if(_0x4d8df1){_0x4d8df1[_0x5dbf('0x39')]='stop';}})[_0x5dbf('0x16')](function(){var _0x3ba5cb=util['format'](_0x5dbf('0x3f'),_0x21122d[_0x5dbf('0x2e')]||_0x21122d['uniqueid'],_0x21122d[_0x5dbf('0x2d')]||'wav');var _0x5ab862=_[_0x5dbf('0x23')](_0x50880d[_0x5dbf('0x32')],{'filename':_0x5dbf('0x33')+_0x3ba5cb['toLowerCase']()});if(_0x5ab862){_0x5ab862['status']=_0x5dbf('0x40');}})[_0x5dbf('0x16')](function(){_0x3ef0eb({'code':0xc8,'message':[_0x21122d[_0x5dbf('0x2b')],_0x5dbf('0x41')][_0x5dbf('0x10')]('\x20')});})[_0x5dbf('0x18')](function(_0x3b49c6){_0x229abf(_0x54e5e7[_0x5dbf('0x1a')](0x1f5,[_0x21122d['uniqueid'],_0x3b49c6[_0x5dbf('0x17')][_0x5dbf('0x34')]()][_0x5dbf('0x10')]('\x20')));});}else{return _0x229abf(_0x54e5e7[_0x5dbf('0x1a')](0x1f5,_0x5dbf('0x3b')));}});},'VoiceQueuesChannels':function(_0x3cc286){var _0x328dc5=this;return new Promise(function(_0x59f825){var _0x1b0b13=_['values'](_0x776036[_0x5dbf('0x42')]);var _0x1a5d82={'count':_0x1b0b13[_0x5dbf('0x22')],'rows':_0x1b0b13};if(_0x3cc286&&_0x3cc286[_0x5dbf('0x43')]){if(![_0x5dbf('0x44'),_0x5dbf('0x45')][_0x5dbf('0x46')](_0x3cc286['type'])){return _0x209b7d(_0x328dc5['error'](0x190,'Invalid\x20type\x20parameter.\x20Allowed\x20values:\x20inbound,\x20outbound'));}var _0x1e1876=_[_0x5dbf('0x47')](_0x1b0b13,function(_0x36a787){return _0x36a787['type']===_0x3cc286['type'];});_0x1a5d82[_0x5dbf('0x48')]=_0x1e1876[_0x5dbf('0x22')];_0x1a5d82[_0x5dbf('0x49')]=_0x1e1876;}_0x59f825(_0x1a5d82);});},'VoiceQueuesChannel':function(_0x5d70cc){var _0x2c9876=this;return new Promise(function(_0x56633d,_0x3ce224){var _0x37f16f=schema(properties[_0x5dbf('0x4a')])['validate'](_0x5d70cc);if(_0x37f16f['length']>0x0){return _0x3ce224(_0x2c9876[_0x5dbf('0x1a')](0x1f4,_[_0x5dbf('0x2a')](_0x37f16f,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x4c034f=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x42')],{'uniqueid':_0x5d70cc['uniqueid']});if(_0x4c034f){_0x56633d(_0x4c034f);}else{return _0x3ce224(_0x2c9876['error'](0x1f5,_0x5dbf('0x3b')));}});},'VoiceQueuesChannelHangup':function(_0x14bdb1){var _0x197e8c=this;return new Promise(function(_0x20ee69,_0x3e13cb){if(ami[_0x5dbf('0x19')]()==![]){return _0x3e13cb(_0x197e8c['error'](0x1f4,[config[_0x5dbf('0xe')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0x5dbf('0x10')]('\x20')));}var _0x5f2005=schema(properties[_0x5dbf('0x4b')])[_0x5dbf('0x29')](_0x14bdb1);if(_0x5f2005[_0x5dbf('0x22')]>0x0){return _0x3e13cb(_0x197e8c[_0x5dbf('0x1a')](0x1f4,_[_0x5dbf('0x2a')](_0x5f2005,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x100d83=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x42')],{'uniqueid':_0x14bdb1[_0x5dbf('0x2b')]});if(_0x100d83&&_0x100d83[_0x5dbf('0x2c')]){return ami[_0x5dbf('0x1d')]({'action':_0x5dbf('0x4c'),'channel':_0x100d83[_0x5dbf('0x2c')]})['then'](function(_0x3fbc3d){_0x20ee69({'code':0xc8,'message':[_0x14bdb1['uniqueid'],_0x3fbc3d[_0x5dbf('0x17')][_0x5dbf('0x34')]()][_0x5dbf('0x10')]('\x20')});})[_0x5dbf('0x18')](function(_0x5a975a){_0x3e13cb(_0x197e8c[_0x5dbf('0x1a')](0x1f5,[_0x14bdb1[_0x5dbf('0x2b')],_0x5a975a[_0x5dbf('0x17')][_0x5dbf('0x34')]()][_0x5dbf('0x10')]('\x20')));});}else{return _0x3e13cb(_0x197e8c[_0x5dbf('0x1a')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x5ccda4){var _0x3e5a96=this;return new Promise(function(_0x3b0465,_0x18bc53){if(ami[_0x5dbf('0x19')]()==![]){return _0x18bc53(_0x3e5a96[_0x5dbf('0x1a')](0x1f4,[config[_0x5dbf('0xe')]['ip'],config[_0x5dbf('0xe')][_0x5dbf('0x27')],_0x5dbf('0xf')][_0x5dbf('0x10')]('\x20')));}var _0x2997a8=schema(properties['voicequeuechannelredirect'])['validate'](_0x5ccda4);if(_0x2997a8[_0x5dbf('0x22')]>0x0){return _0x18bc53(_0x3e5a96[_0x5dbf('0x1a')](0x1f4,_[_0x5dbf('0x2a')](_0x2997a8,_0x5dbf('0x17'))[_0x5dbf('0x10')](',\x20')));}var _0x377d52=_[_0x5dbf('0x23')](_0x776036[_0x5dbf('0x42')],{'uniqueid':_0x5ccda4[_0x5dbf('0x2b')]});if(_0x377d52&&_0x377d52['channel']){return ami['Action']({'action':'Redirect','channel':_0x377d52['channel'],'exten':_0x5ccda4[_0x5dbf('0x4d')],'context':_0x5ccda4[_0x5dbf('0x4e')]||_0x377d52[_0x5dbf('0x4e')],'priority':0x1})[_0x5dbf('0x16')](function(_0x29c4d9){_0x3b0465({'code':0xc8,'message':[_0x5ccda4[_0x5dbf('0x2b')],_0x29c4d9['message']['toLowerCase']()][_0x5dbf('0x10')]('\x20')});})[_0x5dbf('0x18')](function(_0x5e84ab){_0x18bc53(_0x3e5a96[_0x5dbf('0x1a')](0x1f5,[_0x5ccda4[_0x5dbf('0x2b')],_0x5e84ab[_0x5dbf('0x17')][_0x5dbf('0x34')]()]['join']('\x20')));});}else{return _0x18bc53(_0x3e5a96[_0x5dbf('0x1a')](0x1f5,_0x5dbf('0x3b')));}});},'Agents':function(_0x131100){return new Promise(function(_0x1afaff){var _0x2aed16=_['values'](_0x776036[_0x5dbf('0x4f')]);if(_0x131100&&_0x131100['id']){var _0x3fce29=_[_0x5dbf('0x23')](_0x2aed16,function(_0x242e02){return _0x242e02['id']===_0x131100['id'];});_0x1afaff(_0x3fce29);}else{_0x1afaff({'count':_0x2aed16['length'],'rows':_0x2aed16});}});},'Telephones':function(){return new Promise(function(_0x11db7e){var _0x5b75a2=_[_0x5dbf('0x25')](_0x776036[_0x5dbf('0x50')]);_0x11db7e({'count':_0x5b75a2[_0x5dbf('0x22')],'rows':_0x5b75a2});});},'Trunks':function(){return new Promise(function(_0x5f2d67){var _0x46db8d=_[_0x5dbf('0x25')](_0x776036[_0x5dbf('0x51')]);_0x5f2d67({'count':_0x46db8d[_0x5dbf('0x22')],'rows':_0x46db8d});});},'OutboundChannels':function(){return new Promise(function(_0x50db0b){var _0x1f9d2d=_[_0x5dbf('0x25')](_0x776036[_0x5dbf('0x52')]);_0x50db0b({'count':_0x1f9d2d[_0x5dbf('0x22')],'rows':_0x1f9d2d});});},'Outbound':function(){return new Promise(function(_0x392a9b){_0x392a9b(_0x776036[_0x5dbf('0x45')]);});},'Campaigns':function(){return new Promise(function(_0x560d62){var _0x1efc21=_[_0x5dbf('0x25')](_0x776036['campaigns']);_0x560d62({'count':_0x1efc21[_0x5dbf('0x22')],'rows':_0x1efc21});});},'VoiceQueuesPreview':function(_0x2754bb){var _0x1a71fe=this;return new Promise(function(_0x3457de,_0x252be1){_0x1decd2[_0x5dbf('0x53')](_0x2754bb['id'])[_0x5dbf('0x16')](function(_0xdc4439){_0x3457de({'code':0xc8,'message':_0xdc4439[_0x5dbf('0x17')]});})[_0x5dbf('0x18')](function(_0x1fa250){_0x252be1(_0x1a71fe[_0x5dbf('0x1a')](0x1f4,_0x1fa250[_0x5dbf('0x17')]));});});},'EventManager':function(_0x248c1d){var _0x19f5ab=this;return new Promise(function(_0x37c1a3,_0x542667){if(!_0x248c1d[_0x5dbf('0x54')]){return _0x542667(_0x19f5ab[_0x5dbf('0x1a')](0x1f4,_0x5dbf('0x55')));}ami[_0x5dbf('0x56')]('custom:'+_0x248c1d[_0x5dbf('0x54')],_0x248c1d[_0x5dbf('0x17')]);_0x37c1a3({'code':0xc8,'message':_0x248c1d});});},'FaxAccounts':function(){return new Promise(function(_0x29a71a){var _0x42df4d=_[_0x5dbf('0x25')](_0x776036['faxAccounts']);_0x29a71a({'count':_0x42df4d[_0x5dbf('0x22')],'rows':_0x42df4d});});},'SendFax':function(_0x1ba14c){var _0x4e0117=this;return new Promise(function(_0x5d02f7,_0x3dac55){_0x3f8628[_0x5dbf('0x57')](_0x1ba14c)[_0x5dbf('0x16')](function(_0x8ca7de){_0x5d02f7({'code':0xc8,'message':_0x8ca7de[_0x5dbf('0x17')]});})[_0x5dbf('0x18')](function(_0x22339b){_0x3dac55(_0x4e0117['error'](0x1f4,_0x22339b[_0x5dbf('0x17')]));});});},'CheckAfterSend':function(_0x3b01c0){var _0x25c831=this;return new Promise(function(_0x1dd5b4,_0x39e600){_0x3f8628[_0x5dbf('0x58')](_0x3b01c0)['then'](function(_0x625875){_0x1dd5b4({'code':0xc8,'message':_0x625875[_0x5dbf('0x17')]});})[_0x5dbf('0x18')](function(_0x2c5a6e){_0x39e600(_0x25c831[_0x5dbf('0x1a')](0x1f4,_0x2c5a6e['message']));});});}};var _0x2ef784=jayson['server'](_0x88128e)['http']();_0x2ef784['on']('error',function(_0x496306){return _0x209b7d(_0x496306);});_0x2ef784[_0x5dbf('0x6')](0x232a,_0x5dbf('0x59'),function(){console[_0x5dbf('0x5a')](_0x5dbf('0x5b'),0x232a);return _0x3f8222(_0x5dbf('0x5c')+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 f32b736..b0cb2be 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 _0x08e2=['../../../../config/environment','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','exec','data1','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','destcalleridnum','calleridnum','routeId','firstName','lastName','fax','createdAt','scheduledAt','updatedAt','union','resolve','getContacts','then','isEmpty','length','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','name','format','trigger:%s','action','toLowerCase','lodash','bluebird','ioredis','util'];(function(_0x4f7418,_0x1755cc){var _0x4afe7e=function(_0x5ae646){while(--_0x5ae646){_0x4f7418['push'](_0x4f7418['shift']());}};_0x4afe7e(++_0x1755cc);}(_0x08e2,0xe0));var _0x208e=function(_0x1593d4,_0x12895e){_0x1593d4=_0x1593d4-0x0;var _0x4402fd=_0x08e2[_0x1593d4];return _0x4402fd;};'use strict';var _=require(_0x208e('0x0'));var BPromise=require(_0x208e('0x1'));var Redis=require(_0x208e('0x2'));var util=require(_0x208e('0x3'));var config=require(_0x208e('0x4'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0x208e('0x5'));config[_0x208e('0x6')]=_[_0x208e('0x7')](config[_0x208e('0x6')],{'host':_0x208e('0x8'),'port':0x18eb});var io=require(_0x208e('0x9'))(new Redis(config[_0x208e('0x6')]));function emit(_0x17e1fe,_0x4eb19c,_0x584658,_0x3b5841,_0x19b511){logger[_0x208e('0xa')](_0x208e('0xb'),_0x17e1fe,_0x4eb19c['id'],_0x584658,_0x3b5841,JSON[_0x208e('0xc')](_0x19b511));io['to'](_0x584658)['emit'](_0x3b5841,_0x19b511);}exports[_0x208e('0xd')]=function(_0x10f1de,_0x6fa747,_0x8c04e8,_0xec2af8){var _0x261e4a,_0xdd4149;var _0x41f983={};var _0x31257b;var _0x3d3c1c=Number(_0x8c04e8[_0x208e('0xe')]);var _0xc131b1=_0x8c04e8[_0x208e('0xf')]?Boolean(Number(_0x8c04e8[_0x208e('0xf')])):![];var _0x328785;var _0x3bfd48=![];if(!_[_0x208e('0x10')](_0x8c04e8[_0x208e('0x11')])){if(_0x8c04e8[_0x208e('0x11')]=='1')_0x3bfd48=!![];}if(!_0x3bfd48){if(_0xec2af8[_0x208e('0x12')]){_0x41f983['id']=_0xec2af8[_0x208e('0x12')];}}if(!_0x41f983['id']){_0x41f983[_0x208e('0x13')]=_0x3d3c1c;_0x328785=_0x8c04e8[_0x208e('0x14')]&&_0x8c04e8['data3']!=='0'?_0x8c04e8['data3'][_0x208e('0x15')](','):[_0x208e('0x16')];_0x41f983[_0x208e('0x17')]=_[_0x208e('0x18')](_0x328785,function(_0x1dca9f){var _0xc2a1d4={};_0xc2a1d4[_0x1dca9f]=_0xec2af8['routeId']?_0xec2af8[_0x208e('0x19')]:_0xec2af8[_0x208e('0x1a')];return _0xc2a1d4;});_0x31257b=_0xec2af8[_0x208e('0x1b')]?_0xec2af8[_0x208e('0x19')]:_0xec2af8[_0x208e('0x1a')];}var _0x4be8a5=['id',_0x208e('0x1c'),_0x208e('0x1d'),_0x208e('0x16'),'mobile',_0x208e('0x1e'),_0x208e('0x13'),_0x208e('0x1f'),_0x208e('0x20'),_0x208e('0x21')];var _0x1d4cd2=_[_0x208e('0x22')](_0x4be8a5,_0x328785);BPromise[_0x208e('0x23')]()['then'](cmContactRpc[_0x208e('0x24')]({'attributes':_0x1d4cd2,'where':_0x41f983,'phone':_0x31257b}))[_0x208e('0x25')](function(_0x18bc35){_0xdd4149=_0x18bc35;if(!_[_0x208e('0x26')](_0xdd4149)){if(_0xdd4149[_0x208e('0x27')]===0x1){_0x261e4a=_0xdd4149[0x0];logger[_0x208e('0xa')]('[CM][%s][%s]\x20Contact\x20found:%s',_0xec2af8[_0x208e('0x28')],_0x6fa747['id'],_0x261e4a['id']);}else{logger[_0x208e('0xa')](_0x208e('0x29'),_0xec2af8[_0x208e('0x28')],_0x6fa747['id'],_['map'](_0xdd4149,'id')[_0x208e('0x2a')](','));}return;}else{logger[_0x208e('0xa')](_0x208e('0x2b'),_0xec2af8[_0x208e('0x28')],_0x6fa747['id']);var _0x569179={'ListId':_0x3d3c1c};var _0x3e8bd1=_0x8c04e8[_0x208e('0x2c')]&&_0x8c04e8[_0x208e('0x2c')]!=='0'?_0x8c04e8[_0x208e('0x2c')]:_0x208e('0x16');if(_0xc131b1){logger[_0x208e('0xa')]('[CM][%s][%s]\x20Autocreate\x20enabled',_0xec2af8[_0x208e('0x28')],_0x6fa747['id']);_0x569179[_0x3e8bd1]=_[_0x208e('0x10')](_0xec2af8[_0x208e('0x1b')])?_0xec2af8[_0x208e('0x1a')]:_0xec2af8[_0x208e('0x19')];if(_[_0x208e('0x10')](_0xec2af8['routeId'])){_0x569179[_0x208e('0x1c')]=_0xec2af8[_0x208e('0x2d')]&&_0xec2af8[_0x208e('0x2d')]!==_0x208e('0x2e')?_0xec2af8['calleridname']:_0x208e('0x2f');}else{_0x569179[_0x208e('0x1c')]=_0xec2af8[_0x208e('0x30')]&&_0xec2af8['destcalleridname']!==''?_0xec2af8['destcalleridname']:_0x208e('0x2f');}return BPromise[_0x208e('0x23')]()[_0x208e('0x25')](cmContactRpc[_0x208e('0x31')](_0x569179))['then'](function(_0x11e966){_0x261e4a=_0x11e966;_0xdd4149[_0x208e('0x32')](_0x11e966);if(_0x261e4a){logger[_0x208e('0xa')]('[CM][%s][%s]\x20Contact\x20created:%s',_0xec2af8['uniqueid'],_0x6fa747['id'],_0x261e4a['id']);}return;});}else{logger[_0x208e('0xa')](_0x208e('0x33'),_0xec2af8[_0x208e('0x28')],_0x6fa747['id']);_0x569179[_0x3e8bd1]=_[_0x208e('0x10')](_0xec2af8[_0x208e('0x1b')])?_0xec2af8[_0x208e('0x1a')]:_0xec2af8[_0x208e('0x19')];if(_[_0x208e('0x10')](_0xec2af8['routeId'])){_0x569179[_0x208e('0x1c')]=_0xec2af8['calleridname']&&_0xec2af8[_0x208e('0x2d')]!==_0x208e('0x2e')?_0xec2af8[_0x208e('0x2d')]:_0x208e('0x2f');}else{_0x569179[_0x208e('0x1c')]=_0xec2af8[_0x208e('0x30')]&&_0xec2af8['destcalleridname']!==_0x208e('0x2e')?_0xec2af8['destcalleridname']:_0x208e('0x2f');}_0x261e4a=_0x569179;_0xdd4149['push'](_0x569179);return;}}})[_0x208e('0x25')](function(){if(_0x10f1de){emit(_0xec2af8[_0x208e('0x28')],_0x6fa747,util['format']('user:%s',_0x10f1de[_0x208e('0x34')]),util[_0x208e('0x35')](_0x208e('0x36'),_0x8c04e8[_0x208e('0x37')][_0x208e('0x38')]()),{'evt':_['merge'](_0xec2af8,{'autoCreate':_0xc131b1}),'contact':_0x261e4a===undefined?{}:_0x261e4a,'contacts':_0xdd4149[_0x208e('0x27')]===0x0?undefined:_0xdd4149});}});}; \ No newline at end of file +var _0x232f=['scheduledAt','union','resolve','then','getContacts','length','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','uniqueid','join','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','createContact','push','[CM][%s][%s]\x20Contact\x20created:%s','format','trigger:%s','action','toLowerCase','bluebird','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','info','stringify','emit','exec','data2','isNil','data5','xmd-contactid','ListId','data3','split','phone','$or','map','destcalleridnum','calleridnum','routeId','firstName','lastName','mobile'];(function(_0x5848e1,_0x57cb47){var _0xb6069b=function(_0x4c38c1){while(--_0x4c38c1){_0x5848e1['push'](_0x5848e1['shift']());}};_0xb6069b(++_0x57cb47);}(_0x232f,0x7a));var _0xf232=function(_0xc4dbc9,_0x1aa6b6){_0xc4dbc9=_0xc4dbc9-0x0;var _0x531773=_0x232f[_0xc4dbc9];return _0x531773;};'use strict';var _=require('lodash');var BPromise=require(_0xf232('0x0'));var Redis=require(_0xf232('0x1'));var util=require('util');var config=require(_0xf232('0x2'));var logger=require(_0xf232('0x3'))('trigger');var cmContactRpc=require('../../rpc/cmContact');config[_0xf232('0x4')]=_[_0xf232('0x5')](config[_0xf232('0x4')],{'host':_0xf232('0x6'),'port':0x18eb});var io=require(_0xf232('0x7'))(new Redis(config['redis']));function emit(_0x483231,_0x540538,_0x5b14cd,_0x1597f5,_0x39e87b){logger[_0xf232('0x8')]('[CM][%s][%s]',_0x483231,_0x540538['id'],_0x5b14cd,_0x1597f5,JSON[_0xf232('0x9')](_0x39e87b));io['to'](_0x5b14cd)[_0xf232('0xa')](_0x1597f5,_0x39e87b);}exports[_0xf232('0xb')]=function(_0x5e43f1,_0xd0e10e,_0x359b47,_0x4e12a6){var _0x32cae0,_0x51deec;var _0x31f70a={};var _0x4a6373;var _0x7af7ca=Number(_0x359b47['data1']);var _0x5464f9=_0x359b47['data2']?Boolean(Number(_0x359b47[_0xf232('0xc')])):![];var _0x4db010;var _0xa59259=![];if(!_[_0xf232('0xd')](_0x359b47['data5'])){if(_0x359b47[_0xf232('0xe')]=='1')_0xa59259=!![];}if(!_0xa59259){if(_0x4e12a6[_0xf232('0xf')]){_0x31f70a['id']=_0x4e12a6[_0xf232('0xf')];}}if(!_0x31f70a['id']){_0x31f70a[_0xf232('0x10')]=_0x7af7ca;_0x4db010=_0x359b47[_0xf232('0x11')]&&_0x359b47[_0xf232('0x11')]!=='0'?_0x359b47[_0xf232('0x11')][_0xf232('0x12')](','):[_0xf232('0x13')];_0x31f70a[_0xf232('0x14')]=_[_0xf232('0x15')](_0x4db010,function(_0x42d8de){var _0x416a2d={};_0x416a2d[_0x42d8de]=_0x4e12a6['routeId']?_0x4e12a6[_0xf232('0x16')]:_0x4e12a6[_0xf232('0x17')];return _0x416a2d;});_0x4a6373=_0x4e12a6[_0xf232('0x18')]?_0x4e12a6[_0xf232('0x16')]:_0x4e12a6[_0xf232('0x17')];}var _0xf4fdbf=['id',_0xf232('0x19'),_0xf232('0x1a'),_0xf232('0x13'),_0xf232('0x1b'),'fax',_0xf232('0x10'),'createdAt',_0xf232('0x1c'),'updatedAt'];var _0x4f26ca=_[_0xf232('0x1d')](_0xf4fdbf,_0x4db010);BPromise[_0xf232('0x1e')]()[_0xf232('0x1f')](cmContactRpc[_0xf232('0x20')]({'attributes':_0x4f26ca,'where':_0x31f70a,'phone':_0x4a6373}))[_0xf232('0x1f')](function(_0x58d697){_0x51deec=_0x58d697;if(!_['isEmpty'](_0x51deec)){if(_0x51deec[_0xf232('0x21')]===0x1){_0x32cae0=_0x51deec[0x0];logger[_0xf232('0x8')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x4e12a6['uniqueid'],_0xd0e10e['id'],_0x32cae0['id']);}else{logger['info'](_0xf232('0x22'),_0x4e12a6[_0xf232('0x23')],_0xd0e10e['id'],_['map'](_0x51deec,'id')[_0xf232('0x24')](','));}return;}else{logger['info']('[CM][%s][%s]\x20Contact\x20not\x20found',_0x4e12a6[_0xf232('0x23')],_0xd0e10e['id']);var _0x18f304={'ListId':_0x7af7ca};var _0xc1577f=_0x359b47['data4']&&_0x359b47[_0xf232('0x25')]!=='0'?_0x359b47['data4']:_0xf232('0x13');if(_0x5464f9){logger[_0xf232('0x8')](_0xf232('0x26'),_0x4e12a6[_0xf232('0x23')],_0xd0e10e['id']);_0x18f304[_0xc1577f]=_['isNil'](_0x4e12a6[_0xf232('0x18')])?_0x4e12a6['calleridnum']:_0x4e12a6['destcalleridnum'];if(_[_0xf232('0xd')](_0x4e12a6[_0xf232('0x18')])){_0x18f304[_0xf232('0x19')]=_0x4e12a6[_0xf232('0x27')]&&_0x4e12a6[_0xf232('0x27')]!==_0xf232('0x28')?_0x4e12a6[_0xf232('0x27')]:_0xf232('0x29');}else{_0x18f304[_0xf232('0x19')]=_0x4e12a6[_0xf232('0x2a')]&&_0x4e12a6[_0xf232('0x2a')]!==_0xf232('0x28')?_0x4e12a6[_0xf232('0x2a')]:_0xf232('0x29');}return BPromise[_0xf232('0x1e')]()[_0xf232('0x1f')](cmContactRpc[_0xf232('0x2b')](_0x18f304))[_0xf232('0x1f')](function(_0x9b561f){_0x32cae0=_0x9b561f;_0x51deec[_0xf232('0x2c')](_0x9b561f);if(_0x32cae0){logger[_0xf232('0x8')](_0xf232('0x2d'),_0x4e12a6[_0xf232('0x23')],_0xd0e10e['id'],_0x32cae0['id']);}return;});}else{logger[_0xf232('0x8')]('[CM][%s][%s]\x20Autocreate\x20disabled',_0x4e12a6[_0xf232('0x23')],_0xd0e10e['id']);_0x18f304[_0xc1577f]=_['isNil'](_0x4e12a6['routeId'])?_0x4e12a6[_0xf232('0x17')]:_0x4e12a6[_0xf232('0x16')];if(_[_0xf232('0xd')](_0x4e12a6[_0xf232('0x18')])){_0x18f304['firstName']=_0x4e12a6[_0xf232('0x27')]&&_0x4e12a6[_0xf232('0x27')]!==_0xf232('0x28')?_0x4e12a6[_0xf232('0x27')]:'Unknown';}else{_0x18f304['firstName']=_0x4e12a6['destcalleridname']&&_0x4e12a6['destcalleridname']!==_0xf232('0x28')?_0x4e12a6[_0xf232('0x2a')]:_0xf232('0x29');}_0x32cae0=_0x18f304;_0x51deec[_0xf232('0x2c')](_0x18f304);return;}}})[_0xf232('0x1f')](function(){if(_0x5e43f1){emit(_0x4e12a6['uniqueid'],_0xd0e10e,util[_0xf232('0x2e')]('user:%s',_0x5e43f1['name']),util[_0xf232('0x2e')](_0xf232('0x2f'),_0x359b47[_0xf232('0x30')][_0xf232('0x31')]()),{'evt':_['merge'](_0x4e12a6,{'autoCreate':_0x5464f9}),'contact':_0x32cae0===undefined?{}:_0x32cae0,'contacts':_0x51deec[_0xf232('0x21')]===0x0?undefined:_0x51deec});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index d66e222..636c1ae 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 _0xdc86=['length','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','html','data2','render','data3','isNil','data4','location','uriLocation','windowWidth','data5','windowHeight','data6','600','winApplication','winArguments','user:%s','name','format','trigger:%s','exec','integration','accounts','voiceExtensions','routeId','urlforward','script','search','replace','channel','AllConditions','checkConditions','AnyConditions','some','field','chat','ChatWebsiteId','value','operator','AccountId','interaction','event','queue','membername','lastevent','offlineMessage','equals','lodash','mustache','./urlforward','./integration','./cmContact','./script','../../../config/environment','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','url','winapp','triggers','agents','voiceQueues','templates','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','custom:agentnosuchnumber','custom:agentbusy','custom:agentcongestion','custom:timeout','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:closedinteraction','custom:substatus','custom:rejectmessage','emit','info','prototype','clone','motionChannel','voice','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions'];(function(_0x5aca64,_0x4707e6){var _0x695bd0=function(_0x5788be){while(--_0x5788be){_0x5aca64['push'](_0x5aca64['shift']());}};_0x695bd0(++_0x4707e6);}(_0xdc86,0x118));var _0x6dc8=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xdc86[_0x4a747d];return _0x3a5b5c;};'use strict';var util=require('util');var _=require(_0x6dc8('0x0'));var url=require('url');var Mustache=require(_0x6dc8('0x1'));var Redis=require('ioredis');var urlforward=require(_0x6dc8('0x2'));var integration=require(_0x6dc8('0x3'));var cmContact=require(_0x6dc8('0x4'));var script=require(_0x6dc8('0x5'));var config=require(_0x6dc8('0x6'));var logger=require('../../../config/logger')(_0x6dc8('0x7'));var ami=require(_0x6dc8('0x8'));config[_0x6dc8('0x9')]=_[_0x6dc8('0xa')](config[_0x6dc8('0x9')],{'host':_0x6dc8('0xb'),'port':0x18eb});var io=require(_0x6dc8('0xc'))(new Redis(config[_0x6dc8('0x9')]));var operators={'equals':function(_0x4a4efe,_0x4583b7){return _0x4a4efe==_0x4583b7;},'not_equals':function(_0x58dfa6,_0x2f0692){return _0x58dfa6!=_0x2f0692;}};var barAndWebActions=[_0x6dc8('0xd'),_0x6dc8('0xe'),_0x6dc8('0xf')];function Trigger(_0x504a47){this[_0x6dc8('0x10')]=_0x504a47[_0x6dc8('0x10')];this[_0x6dc8('0x11')]=_0x504a47[_0x6dc8('0x11')];this[_0x6dc8('0x12')]=_0x504a47[_0x6dc8('0x12')];this['templates']=_0x504a47[_0x6dc8('0x13')];this['voiceExtensions']=_0x504a47['voiceExtensions'];this[_0x6dc8('0x14')]=_0x504a47[_0x6dc8('0x14')];this[_0x6dc8('0x15')]=_0x504a47['freshdeskAccounts'];this[_0x6dc8('0x16')]=_0x504a47[_0x6dc8('0x16')];this[_0x6dc8('0x17')]=_0x504a47[_0x6dc8('0x17')];this[_0x6dc8('0x18')]=_0x504a47[_0x6dc8('0x18')];this[_0x6dc8('0x19')]=_0x504a47[_0x6dc8('0x19')];this[_0x6dc8('0x1a')]=_0x504a47['vtigerAccounts'];this['servicenowAccounts']=_0x504a47[_0x6dc8('0x1b')];this[_0x6dc8('0x1c')]=_0x504a47[_0x6dc8('0x1c')];this[_0x6dc8('0x1d')]=_0x504a47[_0x6dc8('0x1d')];this['accounts']={'zendesk':this['zendeskAccounts'],'salesforce':this['salesforceAccounts'],'freshdesk':this[_0x6dc8('0x15')],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x6dc8('0x18')],'desk':this['deskAccounts'],'vtiger':this[_0x6dc8('0x1a')],'dynamics365':this[_0x6dc8('0x1c')],'freshsales':this[_0x6dc8('0x1d')],'servicenow':this[_0x6dc8('0x1b')]};ami['on'](_0x6dc8('0x1e'),this[_0x6dc8('0x1f')][_0x6dc8('0x20')](this));ami['on'](_0x6dc8('0x21'),this[_0x6dc8('0x1f')]['bind'](this));ami['on'](_0x6dc8('0x22'),this[_0x6dc8('0x1f')][_0x6dc8('0x20')](this));ami['on']('custom:agentcomplete',this[_0x6dc8('0x1f')]['bind'](this));ami['on'](_0x6dc8('0x23'),this[_0x6dc8('0x1f')][_0x6dc8('0x20')](this));ami['on']('custom:agentnoanswer',this[_0x6dc8('0x1f')][_0x6dc8('0x20')](this));ami['on'](_0x6dc8('0x24'),this['syncCustomEvent'][_0x6dc8('0x20')](this));ami['on'](_0x6dc8('0x25'),this[_0x6dc8('0x1f')]['bind'](this));ami['on']('custom:agentreject',this[_0x6dc8('0x1f')][_0x6dc8('0x20')](this));ami['on']('custom:amd',this[_0x6dc8('0x1f')]['bind'](this));ami['on']('custom:queuecallerabandon',this['syncCustomEvent'][_0x6dc8('0x20')](this));ami['on'](_0x6dc8('0x26'),this[_0x6dc8('0x1f')][_0x6dc8('0x20')](this));ami['on'](_0x6dc8('0x27'),this[_0x6dc8('0x28')][_0x6dc8('0x20')](this));ami['on'](_0x6dc8('0x29'),this[_0x6dc8('0x28')][_0x6dc8('0x20')](this));ami['on']('custom:dialend',this[_0x6dc8('0x28')]['bind'](this));ami['on']('custom:newinteraction',this[_0x6dc8('0x1f')][_0x6dc8('0x20')](this));ami['on'](_0x6dc8('0x2a'),this[_0x6dc8('0x1f')]['bind'](this));ami['on'](_0x6dc8('0x2b'),this['syncCustomEvent'][_0x6dc8('0x20')](this));ami['on']('custom:incomingmessage',this[_0x6dc8('0x1f')][_0x6dc8('0x20')](this));ami['on']('custom:outgoingmessage',this[_0x6dc8('0x1f')][_0x6dc8('0x20')](this));ami['on']('custom:acceptmessage',this[_0x6dc8('0x1f')][_0x6dc8('0x20')](this));ami['on'](_0x6dc8('0x2c'),this[_0x6dc8('0x1f')][_0x6dc8('0x20')](this));ami['on']('custom:offlineMessage',this['syncCustomEvent'][_0x6dc8('0x20')](this));}Trigger['prototype'][_0x6dc8('0x2d')]=function(_0x1cf28f,_0x4b5695,_0x5d91df){logger[_0x6dc8('0x2e')](_0x1cf28f,_0x4b5695,JSON['stringify'](_0x5d91df));io['to'](_0x1cf28f)[_0x6dc8('0x2d')](_0x4b5695,_0x5d91df);};Trigger[_0x6dc8('0x2f')][_0x6dc8('0x1f')]=function(_0x41f5c1){var _0x16532b=_[_0x6dc8('0x30')](_0x41f5c1);if(typeof _0x16532b[_0x6dc8('0x31')]==='undefined'){_0x16532b[_0x6dc8('0x31')]=_0x6dc8('0x32');}this[_0x6dc8('0x33')](_0x16532b);};Trigger[_0x6dc8('0x2f')][_0x6dc8('0x28')]=function(_0x446eb6){if(this[_0x6dc8('0x11')][_0x446eb6[_0x6dc8('0x34')]]){this[_0x6dc8('0x1f')](_0x446eb6);}};Trigger['prototype']['checkTriggers']=function(_0x6cab90){var _0x3159c2;for(var _0x4ca5c4 in this[_0x6dc8('0x10')]){if(this[_0x6dc8('0x10')][_0x6dc8('0x35')](_0x4ca5c4)){if(this[_0x6dc8('0x10')][_0x4ca5c4][_0x6dc8('0x36')]){_0x3159c2=this[_0x6dc8('0x37')](this[_0x6dc8('0x10')][_0x4ca5c4],_0x6cab90);if(_0x3159c2){_[_0x6dc8('0x38')](_0x6cab90,_0x6cab90[_0x6dc8('0x39')]);for(var _0x60c16f=0x0,_0x151630,_0x253cc1,_0x33e04b;_0x60c16f0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ No newline at end of file +var _0x814b=['calleridname','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','desk','redis','defaults','localhost','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','remoteUri','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','%s:%s','authType','token','username','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','map','length','string','nameField','toLowerCase','content','picklist','idField','customField','custom_fields','type','variableName','customVariable','Variable','name','priority','merge','getString','Subjects','xCALLY','CTI','concat','Tags','Descriptions','/api/v2/users/%d','user','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','catch','error','stringify','recordingFormat','none','[OUTBOUND]','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','unmanaged','lastevent'];(function(_0x1d8e7d,_0x3685ff){var _0x13aa36=function(_0x454fe2){while(--_0x454fe2){_0x1d8e7d['push'](_0x1d8e7d['shift']());}};_0x13aa36(++_0x3685ff);}(_0x814b,0x1a2));var _0xb814=function(_0x2e1907,_0x229a70){_0x2e1907=_0x2e1907-0x0;var _0x401555=_0x814b[_0x2e1907];return _0x401555;};'use strict';var _=require(_0xb814('0x0'));var rp=require(_0xb814('0x1'));var md5=require(_0xb814('0x2'));var util=require(_0xb814('0x3'));var Redis=require(_0xb814('0x4'));var intUtil=require(_0xb814('0x5'));var config=require('../../../../config/environment');var logger=require(_0xb814('0x6'))(_0xb814('0x7'));config[_0xb814('0x8')]=_[_0xb814('0x9')](config[_0xb814('0x8')],{'host':_0xb814('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb814('0x8')]));function emit(_0x2e6272,_0x5c8539,_0x271af9){io['to'](_0x2e6272)[_0xb814('0xb')](_0x5c8539,_0x271af9);}var headers={'Content-Type':_0xb814('0xc'),'Accept':_0xb814('0xc')};function getUser(_0x1fea33,_0x21d4a5){if(intUtil[_0xb814('0xd')](_0x21d4a5)===!![]){logger[_0xb814('0xe')](_0xb814('0xf'),_0x21d4a5);return request({'uri':util[_0xb814('0x10')](_0xb814('0x11'),_0x1fea33['remoteUri'])})[_0xb814('0x12')](function(_0x56278f){if(_0x56278f[_0xb814('0x13')]){return _[_0xb814('0x14')](_0x56278f[_0xb814('0x15')][_0xb814('0x16')],{'email':_0x21d4a5});}})[_0xb814('0x12')](function(_0x3bde14){if(_0x3bde14){logger[_0xb814('0xe')](_0xb814('0x17'));return _0x3bde14;}else{logger[_0xb814('0xe')](_0xb814('0x18'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}});}else{logger[_0xb814('0xe')](_0xb814('0x1b'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x19'),_0x1fea33[_0xb814('0x1a')])});}}function request(_0x125ce2){logger[_0xb814('0x1c')](_0xb814('0x1d'),JSON['stringify'](_0x125ce2));return rp(_[_0xb814('0x9')](_0x125ce2,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x270598){var _0xfac75b;if(_0x270598['authType']==='basic'){_0xfac75b=util['format'](_0xb814('0x1e'),_0x270598['username'],_0x270598['password']);}else if(_0x270598[_0xb814('0x1f')]===_0xb814('0x20')){_0xfac75b=util[_0xb814('0x10')]('%s/token:%s',_0x270598[_0xb814('0x21')],_0x270598['token']);}return util[_0xb814('0x10')](_0xb814('0x22'),new Buffer(_0xfac75b)[_0xb814('0x23')](_0xb814('0x24')));}function getEndUser(_0x27352e,_0x2bd039,_0x1f5d40){logger['info'](_0xb814('0x25'),_0x1f5d40);return request({'uri':util['format'](_0xb814('0x26'),_0x27352e[_0xb814('0x1a')]),'qs':{'phone':_0x1f5d40}})[_0xb814('0x12')](function(_0x208927){if(_0x208927[_0xb814('0x13')]){logger[_0xb814('0xe')](_0xb814('0x27'));return _0x208927['_embedded'][_0xb814('0x16')][0x0];}else{logger[_0xb814('0xe')](_0xb814('0x28'));return request({'uri':util[_0xb814('0x10')](_0xb814('0x29'),_0x27352e[_0xb814('0x1a')]),'method':_0xb814('0x2a'),'body':{'first_name':_0x2bd039,'title':_0x2bd039,'phone_numbers':[{'type':_0xb814('0x2b'),'value':_0x1f5d40}]}});}});}function getTags(_0x5a6291,_0x271aa8){var _0x328a08=[];if(_0x5a6291&&_0x5a6291['length']>0x0){_0x328a08=_[_0xb814('0x2c')](_0x5a6291,_0x271aa8);}return _0x328a08;}function getCustomFields(_0x37d24d,_0x530744){var _0x499f22=[];var _0x20577b={'custom_fields':{}};if(_0x37d24d[_0xb814('0x2d')]>0x0){_['forEach'](_0x37d24d,function(_0x338a28){if(_['includes']([_0xb814('0x2e'),'picklist'],_0x338a28['type'])&&_0x338a28[_0xb814('0x2f')]&&!_0x338a28['customField']){_0x20577b[_0x338a28[_0xb814('0x2f')][_0xb814('0x30')]()]=_0x338a28[_0xb814('0x31')]['toString']();}else if(_['includes']([_0xb814('0x2e'),_0xb814('0x32')],_0x338a28['type'])&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x338a28[_0xb814('0x31')][_0xb814('0x23')]();}else if(_0x338a28[_0xb814('0x36')]==='variable'&&_0x338a28[_0xb814('0x37')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28[_0xb814('0x34')]){_0x530744[_0x338a28[_0xb814('0x37')]]&&(_0x20577b[_0xb814('0x35')][_0x338a28['idField']]=_0x530744[_0x338a28[_0xb814('0x37')]]['toString']());}else if(_0x338a28[_0xb814('0x36')]===_0xb814('0x38')&&_0x338a28[_0xb814('0x39')]&&_0x338a28['Variable'][_0xb814('0x3a')]&&_0x338a28[_0xb814('0x33')]&&_0x338a28['customField']){_0x530744[_0x338a28[_0xb814('0x39')][_0xb814('0x3a')][_0xb814('0x30')]()]&&(_0x20577b[_0xb814('0x35')][_0x338a28[_0xb814('0x33')]]=_0x530744[_0x338a28[_0xb814('0x39')]['name'][_0xb814('0x30')]()]['toString']());}});}if(_0x20577b[_0xb814('0x3b')]){_0x20577b['priority']=Number(_0x20577b[_0xb814('0x3b')]);}return _0x20577b;}function getTicket(_0x4b9233,_0x2f8a2e,_0x26675a,_0x54a7fb,_0x4d308a){logger['info']('Creating\x20new\x20ticket...');var _0x17549e=_[_0xb814('0x3c')]({'subject':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x3e')],_0x4d308a,'\x20'),'type':'phone','status':'new','labels':[_0xb814('0x3f'),'Motion',_0xb814('0x40')][_0xb814('0x41')](getTags(_0x54a7fb[_0xb814('0x42')],_0xb814('0x3a'))),'description':intUtil[_0xb814('0x3d')](_0x54a7fb[_0xb814('0x43')],_0x4d308a,'\x0a'),'_links':{'assigned_user':{'href':util[_0xb814('0x10')](_0xb814('0x44'),_0x2f8a2e['id']),'class':_0xb814('0x45')}},'message':{'direction':'in','body':intUtil['getString'](_0x54a7fb['Descriptions'],_0x4d308a,'\x0a')}},getCustomFields(_0x54a7fb['Fields'],_0x4d308a));return request({'uri':util[_0xb814('0x10')]('%s/customers/%d/cases',_0x4b9233[_0xb814('0x1a')],_0x26675a['id']),'method':'POST','body':_0x17549e});}exports[_0xb814('0x46')]=function(_0x44ff56,_0x9ef639,_0x2e97cc,_0x4fae23,_0x30fc57,_0x15f01a){var _0x2b23c7,_0x22cf27;_0x15f01a[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x15f01a['remoteUri']);_0x15f01a[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x15f01a[_0xb814('0x48')]);if(_0x30fc57&&_0x30fc57[_0xb814('0x49')]){logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x4b'));_0x9ef639['recordingURL']=util['format'](_0xb814('0x4c'),_0x15f01a[_0xb814('0x48')],_0x9ef639[_0xb814('0x4d')],md5(_0x9ef639[_0xb814('0x4d')]));}else{_0x9ef639[_0xb814('0x4e')]='';}headers[_0xb814('0x4f')]=getAuth(_0x15f01a);return getUser(_0x15f01a,_0x4fae23[_0xb814('0x50')])[_0xb814('0x12')](function(_0x2eb9b6){_0x2b23c7=_0x2eb9b6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x2b23c7['id']);return getEndUser(_0x15f01a,_0x9ef639['calleridname'],_0x9ef639[_0xb814('0x52')]);})[_0xb814('0x12')](function(_0x4a76bb){_0x22cf27=_0x4a76bb;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x22cf27['id']);return getTicket(_0x15f01a,_0x2b23c7,_0x22cf27,_0x2e97cc,_0x9ef639);})[_0xb814('0x12')](function(_0x37866f){if(_0x37866f){logger[_0xb814('0xe')](_0xb814('0x53'));logger[_0xb814('0xe')](_0xb814('0x54'),_0x37866f['id']);switch(_0x15f01a[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0x37866f['id']});break;case _0xb814('0x58'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util['format'](_0xb814('0x56'),_0x4fae23[_0xb814('0x3a')]),_0xb814('0x5a'),{'uri':util['format'](_0xb814('0x5b'),_0x37866f['id'])});break;default:logger['error'](_0xb814('0x4a'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x3cf8f8){console['error'](_0x3cf8f8);logger[_0xb814('0x5d')](_0xb814('0x4a'),JSON[_0xb814('0x5e')](_0x3cf8f8));});};exports['outbound']=function(_0x3da050,_0x5f0e58,_0x13bdcf,_0x158893,_0x4aed78,_0x39952d,_0x4a3f84){var _0x539be7,_0x3b9709;_0x39952d[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x39952d['remoteUri']);_0x39952d[_0xb814('0x48')]=intUtil['stripTrailingSlash'](_0x39952d[_0xb814('0x48')]);if(_0x4a3f84&&_0x4a3f84[_0xb814('0x5f')]&&_0x4a3f84['recordingFormat']!==_0xb814('0x60')){logger['info'](_0xb814('0x61'),_0xb814('0x4b'));_0x5f0e58[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x39952d[_0xb814('0x48')],_0x5f0e58[_0xb814('0x4d')],md5(_0x5f0e58[_0xb814('0x4d')]));}headers['Authorization']=getAuth(_0x39952d);return getUser(_0x39952d,_0x158893[_0xb814('0x50')])[_0xb814('0x12')](function(_0x5d71d5){_0x539be7=_0x5d71d5;logger[_0xb814('0xe')](_0xb814('0x51'),_0x539be7['id']);return getEndUser(_0x39952d,_0x5f0e58['destcalleridname'],_0x5f0e58[_0xb814('0x62')]);})['then'](function(_0x48362c){_0x3b9709=_0x48362c;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x3b9709['id']);return getTicket(_0x39952d,_0x539be7,_0x3b9709,_0x13bdcf,_0x5f0e58);})[_0xb814('0x12')](function(_0xd1cd8b){if(_0xd1cd8b){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')]('The\x20Ticket\x20ID\x20is:',_0xd1cd8b['id']);switch(_0x39952d[_0xb814('0x36')]){case _0xb814('0x55'):logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x63'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),_0xb814('0x57'),{'recordId':_0xd1cd8b['id']});break;case'newTab':logger[_0xb814('0xe')](_0xb814('0x4a'),_0xb814('0x59'));emit(util[_0xb814('0x10')](_0xb814('0x56'),_0x158893[_0xb814('0x3a')]),'trigger:browser:url',{'uri':util[_0xb814('0x10')]('%s/agent/tickets/%s',_0x39952d[_0xb814('0x1a')],_0xd1cd8b['id'])});break;default:logger[_0xb814('0x5d')](_0xb814('0x61'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0xb814('0x5c')](function(_0x579351){logger[_0xb814('0x5d')]('[OUTBOUND]',JSON[_0xb814('0x5e')](_0x579351));});};exports[_0xb814('0x64')]=function(_0xa03cd2,_0x1b024f,_0x3377d4,_0x167d82,_0x143518,_0x4d44e3){var _0x44088d,_0x51ca51;_0x4d44e3[_0xb814('0x1a')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x1a')]);_0x4d44e3[_0xb814('0x48')]=intUtil[_0xb814('0x47')](_0x4d44e3[_0xb814('0x48')]);if(_0x143518&&_0x143518['monitor_format']){logger[_0xb814('0xe')]('['+_0x1b024f[_0xb814('0x65')]['toUpperCase']()+']',_0xb814('0x4b'));_0x1b024f[_0xb814('0x4e')]=util[_0xb814('0x10')](_0xb814('0x4c'),_0x4d44e3[_0xb814('0x48')],_0x1b024f['uniqueid'],md5(_0x1b024f[_0xb814('0x4d')]));}else{_0x1b024f['recordingURL']='';}headers[_0xb814('0x4f')]=getAuth(_0x4d44e3);return getUser(_0x4d44e3)[_0xb814('0x12')](function(_0x2645f6){_0x44088d=_0x2645f6;logger[_0xb814('0xe')](_0xb814('0x51'),_0x44088d['id']);return getEndUser(_0x4d44e3,_0x1b024f[_0xb814('0x66')],_0x1b024f['calleridnum']);})['then'](function(_0x5d064b){_0x51ca51=_0x5d064b;logger[_0xb814('0xe')]('The\x20Enduser\x20ID\x20is:',_0x51ca51['id']);return getTicket(_0x4d44e3,_0x44088d,_0x51ca51,_0x3377d4,_0x1b024f);})[_0xb814('0x12')](function(_0x1d3954){if(_0x1d3954){logger[_0xb814('0xe')]('Ticket\x20created!');logger[_0xb814('0xe')](_0xb814('0x54'),_0x1d3954['id']);}})[_0xb814('0x5c')](function(_0x5aabbe){logger[_0xb814('0x5d')]('['+_0x1b024f[_0xb814('0x65')][_0xb814('0x67')]()+']',JSON[_0xb814('0x5e')](_0x5aabbe));});}; \ 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 ab64e21..e8d2ce4 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 _0xa3f8=['odata-entityid','substring','lastIndexOf','enduserId','telephone1','contacts?$select=','\x20eq\x20\x27','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','nameField','indexOf','content','ticketType','incident','incidents','getString','Subjects','Descriptions','/contacts(','Fields','callDirection','queue','/systemusers(','assign','format','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','data7','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','openNewTab','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','lodash','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','socket.io-emitter','modernAuthentication','remoteUri','CloudProvider','tenantId','data2','resolve','clientId','username','password','clientSecret','then','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','toLowerCase','outbound','destcalleridnum','calleridnum','POST','contacts','body'];(function(_0x2e3dfc,_0x454d6c){var _0x4b1245=function(_0x5e9faa){while(--_0x5e9faa){_0x2e3dfc['push'](_0x2e3dfc['shift']());}};_0x4b1245(++_0x454d6c);}(_0xa3f8,0x111));var _0x8a3f=function(_0x23ec06,_0x561142){_0x23ec06=_0x23ec06-0x0;var _0x2831d4=_0xa3f8[_0x23ec06];return _0x2831d4;};'use strict';var _=require(_0x8a3f('0x0'));var rp=require('request-promise');var util=require('util');var intUtil=require(_0x8a3f('0x1'));var md5=require(_0x8a3f('0x2'));var Redis=require(_0x8a3f('0x3'));var logger=require(_0x8a3f('0x4'))(_0x8a3f('0x5'));var config=require(_0x8a3f('0x6'));config[_0x8a3f('0x7')]=_[_0x8a3f('0x8')](config[_0x8a3f('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x8a3f('0x9'))(new Redis(config['redis']));function getAuthToken(_0x411795,_0x593e97,_0x51e32c){if(_0x411795[_0x8a3f('0xa')]){_0x411795[_0x8a3f('0xb')]=_0x411795[_0x8a3f('0xc')]['data7'];_0x411795[_0x8a3f('0xd')]=_0x411795[_0x8a3f('0xc')][_0x8a3f('0xe')];return Promise[_0x8a3f('0xf')](_0x411795[_0x8a3f('0xc')]['data5']);}var _0x5bdc00={'method':'POST','uri':_0x593e97,'form':{'client_id':_0x411795[_0x8a3f('0x10')],'resource':_0x411795['remoteUri'],'username':_0x411795[_0x8a3f('0x11')],'password':_0x411795[_0x8a3f('0x12')],'grant_type':'password','client_secret':_0x411795[_0x8a3f('0x13')]},'json':!![]};return rp(_0x5bdc00)[_0x8a3f('0x14')](function(_0x48b5ed){return _0x48b5ed['access_token'];})[_0x8a3f('0x15')](function(_0x47bb78){logger[_0x8a3f('0x16')]('['+[_0x51e32c[_0x8a3f('0x17')]()]+_0x8a3f('0x18'));return _0x47bb78[_0x8a3f('0x19')];});}function getUser(_0x5dbe0b,_0x4e5d94,_0x591ea8,_0x26c298,_0x4610fa,_0x129755){return new Promise(function(_0x11dc84,_0x3551e1){return getAuthToken(_0x4e5d94,_0x26c298,_0x129755)[_0x8a3f('0x14')](function(_0x3f4bc2){var _0x33dde8={'method':'GET','uri':_0x4610fa+_0x8a3f('0x1a'),'headers':{'Authorization':_0x8a3f('0x1b')+_0x3f4bc2,'OData-Version':_0x8a3f('0x1c')},'json':!![]};return rp(_0x33dde8);})[_0x8a3f('0x14')](function(_0x1094e1){var _0x254102=_0x1094e1[_0x8a3f('0x1d')];var _0x3c2da4=![];var _0x3b3655=null;if(!_['isNil'](_0x591ea8)){if(intUtil[_0x8a3f('0x1e')](_0x591ea8[_0x8a3f('0x1f')])){_0x5dbe0b[_0x8a3f('0x20')]=_0x591ea8[_0x8a3f('0x1f')];for(_0x3b3655=0x0;_0x3b3655<_0x254102[_0x8a3f('0x21')];_0x3b3655++){if(_0x254102[_0x3b3655][_0x8a3f('0x22')]===_0x591ea8['email']&&!_0x254102[_0x3b3655][_0x8a3f('0x23')]){_0x3c2da4=!![];logger[_0x8a3f('0x24')]('['+[_0x129755[_0x8a3f('0x17')]()]+_0x8a3f('0x25')+_0x254102[_0x3b3655][_0x8a3f('0x26')]+'!');_0x5dbe0b[_0x8a3f('0x27')]=_0x254102[_0x3b3655]['systemuserid'];}}}}if(!_0x3c2da4){logger[_0x8a3f('0x24')]('['+[_0x129755[_0x8a3f('0x17')]()]+_0x8a3f('0x28'));_0x5dbe0b[_0x8a3f('0x20')]=_0x4e5d94[_0x8a3f('0x11')];for(_0x3b3655=0x0;_0x3b3655<_0x254102[_0x8a3f('0x21')];_0x3b3655++){if(_0x254102[_0x3b3655][_0x8a3f('0x22')]===_0x4e5d94[_0x8a3f('0x11')]){_0x5dbe0b[_0x8a3f('0x27')]=_0x254102[_0x3b3655][_0x8a3f('0x26')];}}}_0x11dc84(_0x5dbe0b);})[_0x8a3f('0x15')](function(_0x570987){_0x3551e1(_0x570987[_0x8a3f('0x19')]);});});}function createEndUser(_0xbc2e5e,_0x37e4d7,_0x5880b5,_0x2f2138,_0xd0ce2b,_0x5c3d13,_0xe4615f){return new Promise(function(_0x9f2ee9,_0x5f3410){return getAuthToken(_0x37e4d7,_0x5880b5,_0x5c3d13)[_0x8a3f('0x14')](function(_0xa2427b){var _0xb49164=_0x5c3d13[_0x8a3f('0x29')]()===_0x8a3f('0x2a')?_0xd0ce2b[_0x8a3f('0x2b')]:_0xd0ce2b[_0x8a3f('0x2c')];var _0x731401={'method':_0x8a3f('0x2d'),'uri':_0x2f2138+_0x8a3f('0x2e'),'body':{'fullname':_0xb49164,'firstname':_0xb49164,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0xbc2e5e[_0x8a3f('0x27')]+')'},'headers':{'Authorization':_0x8a3f('0x1b')+_0xa2427b,'OData-Version':_0x8a3f('0x1c')},'json':!![],'resolveWithFullResponse':!![]};_0x731401[_0x8a3f('0x2f')][_0xe4615f]=_0xb49164;return rp(_0x731401);})[_0x8a3f('0x14')](function(_0x36aff7){var _0x59c2af=_0x36aff7['headers'][_0x8a3f('0x30')];var _0x3ad247=_0x59c2af[_0x8a3f('0x31')](_0x59c2af[_0x8a3f('0x32')]('(')+0x1,_0x59c2af[_0x8a3f('0x32')](')'));_0xbc2e5e[_0x8a3f('0x33')]=_0x3ad247;_0x9f2ee9(_0xbc2e5e);})[_0x8a3f('0x15')](function(_0x1fc5e6){_0x5f3410(_0x1fc5e6['message']);});});}function getEndUser(_0x2cd258,_0x4205e7,_0x8a749e,_0x5d4cc4,_0x3d6912,_0x16ce5e,_0x4cc2ea,_0x272a88){var _0x5c586f=_0x16ce5e[_0x8a3f('0x29')]()===_0x8a3f('0x2a')?_0x3d6912['destcalleridnum']:_0x3d6912[_0x8a3f('0x2c')];return getAuthToken(_0x4205e7,_0x8a749e,_0x16ce5e)[_0x8a3f('0x14')](function(_0x2a85a9){_0x272a88=_0x272a88?_0x272a88:_0x8a3f('0x34');var _0x3d372d={'method':'GET','uri':_0x5d4cc4+_0x8a3f('0x35')+_0x272a88+'&$filter='+_0x272a88+_0x8a3f('0x36')+_0x5c586f[_0x8a3f('0x37')]('+',_0x8a3f('0x38'))+'\x27','headers':{'Authorization':_0x8a3f('0x1b')+_0x2a85a9,'If-None-Match':null,'OData-Version':_0x8a3f('0x1c')},'json':!![]};return rp(_0x3d372d);})['then'](function(_0x49370f){var _0x9ba0ac=![];if(!_0x49370f)return _0x9ba0ac;var _0x7677f0=_0x49370f[_0x8a3f('0x1d')];for(var _0x573709=0x0;_0x573709<_0x7677f0[_0x8a3f('0x21')];_0x573709++){if(_0x7677f0[_0x573709][_0x272a88]===_0x5c586f){_0x9ba0ac=!![];_0x2cd258[_0x8a3f('0x33')]=_0x7677f0[_0x573709][_0x8a3f('0x39')];}}return _0x9ba0ac;})[_0x8a3f('0x14')](function(_0x1ae4b3){if(_0x1ae4b3)return _0x2cd258;if(_0x4cc2ea===_0x8a3f('0x3a')){logger[_0x8a3f('0x24')]('['+[_0x16ce5e[_0x8a3f('0x17')]()]+_0x8a3f('0x3b'));return _0x2cd258;}return createEndUser(_0x2cd258,_0x4205e7,_0x8a749e,_0x5d4cc4,_0x3d6912,_0x16ce5e,_0x272a88)['then'](function(_0x4f14a0){logger[_0x8a3f('0x24')]('['+[_0x16ce5e[_0x8a3f('0x17')]()]+_0x8a3f('0x3c'),_0x4f14a0[_0x8a3f('0x33')]);return _0x4f14a0;});});}function getCustomFields(_0x290f79,_0x1c324b,_0x28e686){var _0x475251={};if(_0x290f79[_0x8a3f('0x21')]>0x0){_[_0x8a3f('0x3d')](_0x290f79,function(_0x76cfc4){if(_[_0x8a3f('0x3e')](['string','picklist'],_0x76cfc4['type'])&&_0x76cfc4[_0x8a3f('0x3f')]&&!_0x76cfc4['customField']){var _0x3b629a=_0x76cfc4['idField'][_0x8a3f('0x29')]();var _0x2875d5=_0x3b629a[_0x8a3f('0x31')](0x0,_0x3b629a[_0x8a3f('0x40')]('_'));var _0x2916af=_0x3b629a[_0x8a3f('0x31')](_0x3b629a[_0x8a3f('0x40')]('_')+0x1);if(_0x2875d5===_0x28e686){_0x475251[_0x2916af]=_0x76cfc4[_0x8a3f('0x41')];}}});}return _0x475251;}function getTicket(_0x56aee4,_0x2d86ae,_0x49cef5,_0x55d431,_0x42cd56,_0x9866d6,_0x8c82d){return new Promise(function(_0x1ab877,_0x40e8e9){var _0x306861;return getAuthToken(_0x2d86ae,_0x49cef5,_0x8c82d)[_0x8a3f('0x14')](function(_0x22cd2e){if(_0x9866d6[_0x8a3f('0x42')]===_0x8a3f('0x43')){_0x306861={'method':_0x8a3f('0x2d'),'uri':_0x55d431+_0x8a3f('0x44'),'body':Object['assign']({},{'title':intUtil[_0x8a3f('0x45')](_0x9866d6[_0x8a3f('0x46')],_0x42cd56,'\x20'),'description':intUtil[_0x8a3f('0x45')](_0x9866d6[_0x8a3f('0x47')],_0x42cd56,'\x0a'),'customerid_contact@odata.bind':_0x56aee4[_0x8a3f('0x33')]?_0x8a3f('0x48')+_0x56aee4[_0x8a3f('0x33')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x56aee4[_0x8a3f('0x27')]+')','caseorigincode':'1'},getCustomFields(_0x9866d6[_0x8a3f('0x49')],_0x42cd56,_0x9866d6[_0x8a3f('0x42')])),'headers':{'Authorization':_0x8a3f('0x1b')+_0x22cd2e,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x9866d6[_0x8a3f('0x42')]==='phonecall'){var _0x15fa9b=_0x56aee4[_0x8a3f('0x33')]?[{'partyid_systemuser@odata.bind':'/systemusers('+_0x56aee4['userId']+')','participationtypemask':_0x56aee4[_0x8a3f('0x4a')]===_0x8a3f('0x4b')?0x2:0x1},{'partyid_contact@odata.bind':_0x8a3f('0x48')+_0x56aee4[_0x8a3f('0x33')]+')','participationtypemask':_0x56aee4[_0x8a3f('0x4a')]==='queue'?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x8a3f('0x4c')+_0x56aee4['userId']+')','participationtypemask':_0x56aee4['callDirection']===_0x8a3f('0x4b')?0x2:0x1}];_0x306861={'method':_0x8a3f('0x2d'),'uri':_0x55d431+'phonecalls','body':Object[_0x8a3f('0x4d')]({},{'subject':intUtil[_0x8a3f('0x45')](_0x9866d6[_0x8a3f('0x46')],_0x42cd56,'\x20'),'phonenumber':String(_0x42cd56[_0x8a3f('0x2c')]),'description':intUtil[_0x8a3f('0x45')](_0x9866d6[_0x8a3f('0x47')],_0x42cd56,'\x0a'),'regardingobjectid_contact@odata.bind':_0x56aee4[_0x8a3f('0x33')]?_0x8a3f('0x48')+_0x56aee4['enduserId']+')':undefined,'ownerid@odata.bind':_0x8a3f('0x4c')+_0x56aee4[_0x8a3f('0x27')]+')','directioncode':_0x56aee4[_0x8a3f('0x4a')]===_0x8a3f('0x4b')?![]:!![],'phonecall_activity_parties':_0x15fa9b},getCustomFields(_0x9866d6[_0x8a3f('0x49')],_0x42cd56,_0x9866d6[_0x8a3f('0x42')])),'headers':{'Authorization':_0x8a3f('0x1b')+_0x22cd2e,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x306861);})[_0x8a3f('0x14')](function(_0x5078c2){var _0x38f3ae=_0x5078c2['headers'][_0x8a3f('0x30')];var _0x12f6ea=_0x38f3ae[_0x8a3f('0x31')](_0x38f3ae['lastIndexOf']('(')+0x1,_0x38f3ae[_0x8a3f('0x32')](')'));_0x56aee4['ticketId']=_0x12f6ea;_0x1ab877(_0x56aee4);})[_0x8a3f('0x15')](function(_0xcbb070){_0x40e8e9(_0xcbb070['message']);});});}function emit(_0x5365cd,_0x39996e,_0xdfe5df,_0x522530){var _0x108d9a={'uri':util[_0x8a3f('0x4e')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x5365cd,_0xdfe5df,_0x522530)};io['to'](util[_0x8a3f('0x4e')]('user:%s',_0x39996e))[_0x8a3f('0x4f')](_0x8a3f('0x50'),_0x108d9a);}exports['cs']=function(_0x3a2ce5,_0x177e45,_0xa61013,_0x555ec2,_0x5ba529,_0xbc2a6c,_0x4d69d8,_0x4d041d){var _0x2b07ed={};_0xbc2a6c[_0x8a3f('0xb')]=_0xbc2a6c[_0x8a3f('0xa')]?intUtil[_0x8a3f('0x51')](_0xbc2a6c[_0x8a3f('0xc')]['data7']):intUtil[_0x8a3f('0x51')](_0xbc2a6c[_0x8a3f('0xb')]);_0xbc2a6c[_0x8a3f('0x52')]=intUtil[_0x8a3f('0x51')](_0xbc2a6c[_0x8a3f('0x52')]);_0x2b07ed[_0x8a3f('0x4a')]=_0x4d041d==='queue'||_0x4d041d===_0x8a3f('0x53')?_0x8a3f('0x4b'):_0x8a3f('0x2a');var _0x4f0836=_0xbc2a6c['modernAuthentication']?util[_0x8a3f('0x4e')](_0x8a3f('0x54'),_0xbc2a6c[_0x8a3f('0xc')][_0x8a3f('0x55')]):util[_0x8a3f('0x4e')]('%s/api/data/v9.0/',_0xbc2a6c[_0x8a3f('0xb')]);var _0x54ae5b=util[_0x8a3f('0x4e')](_0x8a3f('0x56'),_0xbc2a6c['tenantId']);var _0x2cd150=util[_0x8a3f('0x4e')](_0x8a3f('0x57'),_0xbc2a6c[_0x8a3f('0x52')],_0x177e45['uniqueid'],md5(_0x177e45[_0x8a3f('0x58')]));if(_0x5ba529&&_0x5ba529[_0x8a3f('0x59')]){logger[_0x8a3f('0x24')](_0x8a3f('0x5a'),_0x8a3f('0x5b'));_0x177e45[_0x8a3f('0x5c')]=_0x2cd150;}else if(_0x4d69d8&&_0x4d69d8['recordingFormat']&&_0x4d69d8[_0x8a3f('0x5d')]!==_0x8a3f('0x5e')){logger['info'](_0x8a3f('0x5f'),_0x8a3f('0x5b'));_0x177e45[_0x8a3f('0x5c')]=_0x2cd150;}else{_0x177e45[_0x8a3f('0x5c')]='';}return getUser(_0x2b07ed,_0xbc2a6c,_0x555ec2,_0x54ae5b,_0x4f0836,_0x4d041d)[_0x8a3f('0x14')](function(_0x4fde3e){logger[_0x8a3f('0x24')]('['+_0x4d041d[_0x8a3f('0x17')]()+']\x20The\x20User\x20ID\x20is:',_0x4fde3e[_0x8a3f('0x27')]);logger[_0x8a3f('0x24')]('['+_0x4d041d['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x4fde3e['userEmail']);return getEndUser(_0x4fde3e,_0xbc2a6c,_0x54ae5b,_0x4f0836,_0x177e45,_0x4d041d,_0xa61013[_0x8a3f('0x60')],_0xa61013[_0x8a3f('0x61')]);})[_0x8a3f('0x14')](function(_0x41ddff){logger[_0x8a3f('0x24')]('['+_0x4d041d[_0x8a3f('0x17')]()+_0x8a3f('0x62'),_0x41ddff[_0x8a3f('0x33')]);logger[_0x8a3f('0x24')]('['+_0x4d041d[_0x8a3f('0x17')]()+_0x8a3f('0x63'),_0x177e45['calleridnum']);return getTicket(_0x41ddff,_0xbc2a6c,_0x54ae5b,_0x4f0836,_0x177e45,_0xa61013,_0x4d041d);})['then'](function(_0x48a2cd){logger[_0x8a3f('0x24')](util[_0x8a3f('0x4e')]('['+_0x4d041d[_0x8a3f('0x17')]()+_0x8a3f('0x64'),_0xa61013[_0x8a3f('0x42')],_0x48a2cd[_0x8a3f('0x65')]));logger[_0x8a3f('0x24')](util[_0x8a3f('0x4e')]('['+_0x4d041d[_0x8a3f('0x17')]()+_0x8a3f('0x66'),_0x4d041d));if(_0x4d041d!=='unmanaged'&&_0xa61013[_0x8a3f('0x67')]){logger[_0x8a3f('0x24')]('['+_0x4d041d['toUpperCase']()+']',_0x8a3f('0x68'));emit(_0xbc2a6c[_0x8a3f('0xb')],_0x555ec2['name'],_0xa61013[_0x8a3f('0x42')],_0x48a2cd[_0x8a3f('0x65')]);}})[_0x8a3f('0x15')](function(_0x435b9f){logger[_0x8a3f('0x16')]('['+_0x4d041d[_0x8a3f('0x17')]()+_0x8a3f('0x69'),_0x435b9f['message']);console['error'](_0x8a3f('0x6a'),_0x435b9f);});}; \ No newline at end of file +var _0x2451=['Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','Error\x20running\x20Dynamics365\x20integration','request-promise','./util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','localhost','socket.io-emitter','remoteUri','CloudProvider','data7','tenantId','data2','data5','clientId','password','then','catch','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','email','userEmail','internalemailaddress','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','length','toLowerCase','outbound','destcalleridnum','/systemusers(','body','headers','odata-entityid','substring','lastIndexOf','enduserId','calleridnum','telephone1','contacts?$select=','&$filter=','\x20eq\x20\x27','replace','%2b','contactid','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing','forEach','string','picklist','type','nameField','customField','idField','indexOf','ticketType','incident','POST','incidents','assign','getString','Subjects','Descriptions','Fields','callDirection','queue','phonecalls','ticketId','format','user:%s','emit','trigger:browser:url','modernAuthentication','stripTrailingSlash','serverUrl','unmanaged','https://login.microsoftonline.com/%s/oauth2/token','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','moduleCreate','additionalSearchContact',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','openNewTab'];(function(_0x4fc348,_0x35d4f9){var _0x433c43=function(_0x5db994){while(--_0x5db994){_0x4fc348['push'](_0x4fc348['shift']());}};_0x433c43(++_0x35d4f9);}(_0x2451,0x1b5));var _0x1245=function(_0x4dcc2d,_0x422839){_0x4dcc2d=_0x4dcc2d-0x0;var _0x1bbd79=_0x2451[_0x4dcc2d];return _0x1bbd79;};'use strict';var _=require('lodash');var rp=require(_0x1245('0x0'));var util=require('util');var intUtil=require(_0x1245('0x1'));var md5=require(_0x1245('0x2'));var Redis=require(_0x1245('0x3'));var logger=require(_0x1245('0x4'))(_0x1245('0x5'));var config=require(_0x1245('0x6'));config['redis']=_['defaults'](config[_0x1245('0x7')],{'host':_0x1245('0x8'),'port':0x18eb});var io=require(_0x1245('0x9'))(new Redis(config[_0x1245('0x7')]));function getAuthToken(_0x5d1683,_0x2bfcfd,_0xa680e0){if(_0x5d1683['modernAuthentication']){_0x5d1683[_0x1245('0xa')]=_0x5d1683[_0x1245('0xb')][_0x1245('0xc')];_0x5d1683[_0x1245('0xd')]=_0x5d1683[_0x1245('0xb')][_0x1245('0xe')];return Promise['resolve'](_0x5d1683[_0x1245('0xb')][_0x1245('0xf')]);}var _0x16aac8={'method':'POST','uri':_0x2bfcfd,'form':{'client_id':_0x5d1683[_0x1245('0x10')],'resource':_0x5d1683[_0x1245('0xa')],'username':_0x5d1683['username'],'password':_0x5d1683[_0x1245('0x11')],'grant_type':'password','client_secret':_0x5d1683['clientSecret']},'json':!![]};return rp(_0x16aac8)[_0x1245('0x12')](function(_0x39c365){return _0x39c365['access_token'];})[_0x1245('0x13')](function(_0x1e2fc9){logger['error']('['+[_0xa680e0[_0x1245('0x14')]()]+_0x1245('0x15'));return _0x1e2fc9[_0x1245('0x16')];});}function getUser(_0x418bd0,_0x50d62d,_0x1c313c,_0x2ada75,_0x4b5327,_0x9f0bcb){return new Promise(function(_0x314589,_0x906dac){return getAuthToken(_0x50d62d,_0x2ada75,_0x9f0bcb)[_0x1245('0x12')](function(_0x5024a4){var _0x543fa4={'method':_0x1245('0x17'),'uri':_0x4b5327+_0x1245('0x18'),'headers':{'Authorization':_0x1245('0x19')+_0x5024a4,'OData-Version':_0x1245('0x1a')},'json':!![]};return rp(_0x543fa4);})[_0x1245('0x12')](function(_0x31b074){var _0x4af212=_0x31b074[_0x1245('0x1b')];var _0x2e9da2=![];var _0x5948ae=null;if(!_[_0x1245('0x1c')](_0x1c313c)){if(intUtil['validateEmail'](_0x1c313c[_0x1245('0x1d')])){_0x418bd0[_0x1245('0x1e')]=_0x1c313c['email'];for(_0x5948ae=0x0;_0x5948ae<_0x4af212['length'];_0x5948ae++){if(_0x4af212[_0x5948ae][_0x1245('0x1f')]===_0x1c313c[_0x1245('0x1d')]&&!_0x4af212[_0x5948ae]['isdisabled']){_0x2e9da2=!![];logger[_0x1245('0x20')]('['+[_0x9f0bcb[_0x1245('0x14')]()]+_0x1245('0x21')+_0x4af212[_0x5948ae][_0x1245('0x22')]+'!');_0x418bd0[_0x1245('0x23')]=_0x4af212[_0x5948ae][_0x1245('0x22')];}}}}if(!_0x2e9da2){logger[_0x1245('0x20')]('['+[_0x9f0bcb[_0x1245('0x14')]()]+_0x1245('0x24'));_0x418bd0[_0x1245('0x1e')]=_0x50d62d[_0x1245('0x25')];for(_0x5948ae=0x0;_0x5948ae<_0x4af212[_0x1245('0x26')];_0x5948ae++){if(_0x4af212[_0x5948ae][_0x1245('0x1f')]===_0x50d62d['username']){_0x418bd0['userId']=_0x4af212[_0x5948ae][_0x1245('0x22')];}}}_0x314589(_0x418bd0);})[_0x1245('0x13')](function(_0x59c2c4){_0x906dac(_0x59c2c4[_0x1245('0x16')]);});});}function createEndUser(_0x1148a4,_0x510f70,_0x3ecdf0,_0x6f8264,_0x537043,_0x4d20e1,_0x16e222){return new Promise(function(_0x4955c2,_0x575b09){return getAuthToken(_0x510f70,_0x3ecdf0,_0x4d20e1)[_0x1245('0x12')](function(_0x4335f8){var _0x211ae4=_0x4d20e1[_0x1245('0x27')]()===_0x1245('0x28')?_0x537043[_0x1245('0x29')]:_0x537043['calleridnum'];var _0x1e5af3={'method':'POST','uri':_0x6f8264+'contacts','body':{'fullname':_0x211ae4,'firstname':_0x211ae4,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x1245('0x2a')+_0x1148a4[_0x1245('0x23')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x4335f8,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};_0x1e5af3[_0x1245('0x2b')][_0x16e222]=_0x211ae4;return rp(_0x1e5af3);})[_0x1245('0x12')](function(_0x13e9d7){var _0x3594c3=_0x13e9d7[_0x1245('0x2c')][_0x1245('0x2d')];var _0x46fab2=_0x3594c3[_0x1245('0x2e')](_0x3594c3['lastIndexOf']('(')+0x1,_0x3594c3[_0x1245('0x2f')](')'));_0x1148a4[_0x1245('0x30')]=_0x46fab2;_0x4955c2(_0x1148a4);})[_0x1245('0x13')](function(_0x14ff0b){_0x575b09(_0x14ff0b[_0x1245('0x16')]);});});}function getEndUser(_0x841be8,_0x4fa615,_0x3d1d82,_0x162eed,_0x85f646,_0x2b7e5a,_0x2af845,_0xa36f05){var _0xdb6ed3=_0x2b7e5a['toLowerCase']()===_0x1245('0x28')?_0x85f646[_0x1245('0x29')]:_0x85f646[_0x1245('0x31')];return getAuthToken(_0x4fa615,_0x3d1d82,_0x2b7e5a)[_0x1245('0x12')](function(_0x5d570b){_0xa36f05=_0xa36f05?_0xa36f05:_0x1245('0x32');var _0x1a2942={'method':'GET','uri':_0x162eed+_0x1245('0x33')+_0xa36f05+_0x1245('0x34')+_0xa36f05+_0x1245('0x35')+_0xdb6ed3[_0x1245('0x36')]('+',_0x1245('0x37'))+'\x27','headers':{'Authorization':_0x1245('0x19')+_0x5d570b,'If-None-Match':null,'OData-Version':_0x1245('0x1a')},'json':!![]};return rp(_0x1a2942);})[_0x1245('0x12')](function(_0xe6676e){var _0x19e6dc=![];if(!_0xe6676e)return _0x19e6dc;var _0x552114=_0xe6676e[_0x1245('0x1b')];for(var _0xe7647d=0x0;_0xe7647d<_0x552114[_0x1245('0x26')];_0xe7647d++){if(_0x552114[_0xe7647d][_0xa36f05]===_0xdb6ed3){_0x19e6dc=!![];_0x841be8[_0x1245('0x30')]=_0x552114[_0xe7647d][_0x1245('0x38')];}}return _0x19e6dc;})['then'](function(_0x2b43f3){if(_0x2b43f3)return _0x841be8;if(_0x2af845===_0x1245('0x39')){logger[_0x1245('0x20')]('['+[_0x2b7e5a[_0x1245('0x14')]()]+_0x1245('0x3a'));return _0x841be8;}return createEndUser(_0x841be8,_0x4fa615,_0x3d1d82,_0x162eed,_0x85f646,_0x2b7e5a,_0xa36f05)['then'](function(_0x23ae46){logger[_0x1245('0x20')]('['+[_0x2b7e5a[_0x1245('0x14')]()]+']\x20Enduser\x20created!',_0x23ae46[_0x1245('0x30')]);return _0x23ae46;});});}function getCustomFields(_0x288e5f,_0x4994a0,_0x3e1962){var _0x1a52a9={};if(_0x288e5f[_0x1245('0x26')]>0x0){_[_0x1245('0x3b')](_0x288e5f,function(_0x411d09){if(_['includes']([_0x1245('0x3c'),_0x1245('0x3d')],_0x411d09[_0x1245('0x3e')])&&_0x411d09[_0x1245('0x3f')]&&!_0x411d09[_0x1245('0x40')]){var _0x3b87d7=_0x411d09[_0x1245('0x41')][_0x1245('0x27')]();var _0x37d63b=_0x3b87d7[_0x1245('0x2e')](0x0,_0x3b87d7[_0x1245('0x42')]('_'));var _0x208af5=_0x3b87d7[_0x1245('0x2e')](_0x3b87d7[_0x1245('0x42')]('_')+0x1);if(_0x37d63b===_0x3e1962){_0x1a52a9[_0x208af5]=_0x411d09['content'];}}});}return _0x1a52a9;}function getTicket(_0x12defe,_0x538828,_0x545d65,_0x31126e,_0x4502b5,_0x442007,_0x41fd72){return new Promise(function(_0x402ada,_0x27aa77){var _0x5e2110;return getAuthToken(_0x538828,_0x545d65,_0x41fd72)[_0x1245('0x12')](function(_0x2ebbdb){if(_0x442007[_0x1245('0x43')]===_0x1245('0x44')){_0x5e2110={'method':_0x1245('0x45'),'uri':_0x31126e+_0x1245('0x46'),'body':Object[_0x1245('0x47')]({},{'title':intUtil[_0x1245('0x48')](_0x442007[_0x1245('0x49')],_0x4502b5,'\x20'),'description':intUtil[_0x1245('0x48')](_0x442007[_0x1245('0x4a')],_0x4502b5,'\x0a'),'customerid_contact@odata.bind':_0x12defe[_0x1245('0x30')]?'/contacts('+_0x12defe['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x12defe[_0x1245('0x23')]+')','caseorigincode':'1'},getCustomFields(_0x442007[_0x1245('0x4b')],_0x4502b5,_0x442007[_0x1245('0x43')])),'headers':{'Authorization':_0x1245('0x19')+_0x2ebbdb,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x442007[_0x1245('0x43')]==='phonecall'){var _0x73484a=_0x12defe[_0x1245('0x30')]?[{'partyid_systemuser@odata.bind':_0x1245('0x2a')+_0x12defe['userId']+')','participationtypemask':_0x12defe[_0x1245('0x4c')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x12defe[_0x1245('0x30')]+')','participationtypemask':_0x12defe[_0x1245('0x4c')]===_0x1245('0x4d')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':'/systemusers('+_0x12defe[_0x1245('0x23')]+')','participationtypemask':_0x12defe[_0x1245('0x4c')]===_0x1245('0x4d')?0x2:0x1}];_0x5e2110={'method':_0x1245('0x45'),'uri':_0x31126e+_0x1245('0x4e'),'body':Object['assign']({},{'subject':intUtil[_0x1245('0x48')](_0x442007[_0x1245('0x49')],_0x4502b5,'\x20'),'phonenumber':String(_0x4502b5[_0x1245('0x31')]),'description':intUtil[_0x1245('0x48')](_0x442007[_0x1245('0x4a')],_0x4502b5,'\x0a'),'regardingobjectid_contact@odata.bind':_0x12defe[_0x1245('0x30')]?'/contacts('+_0x12defe[_0x1245('0x30')]+')':undefined,'ownerid@odata.bind':_0x1245('0x2a')+_0x12defe[_0x1245('0x23')]+')','directioncode':_0x12defe[_0x1245('0x4c')]===_0x1245('0x4d')?![]:!![],'phonecall_activity_parties':_0x73484a},getCustomFields(_0x442007[_0x1245('0x4b')],_0x4502b5,_0x442007[_0x1245('0x43')])),'headers':{'Authorization':_0x1245('0x19')+_0x2ebbdb,'OData-Version':_0x1245('0x1a')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5e2110);})[_0x1245('0x12')](function(_0x2fc5ff){var _0x30eb7e=_0x2fc5ff[_0x1245('0x2c')][_0x1245('0x2d')];var _0x2a53a5=_0x30eb7e[_0x1245('0x2e')](_0x30eb7e[_0x1245('0x2f')]('(')+0x1,_0x30eb7e[_0x1245('0x2f')](')'));_0x12defe[_0x1245('0x4f')]=_0x2a53a5;_0x402ada(_0x12defe);})[_0x1245('0x13')](function(_0x4b4a8a){_0x27aa77(_0x4b4a8a[_0x1245('0x16')]);});});}function emit(_0x7d08cb,_0x356d62,_0x43ef5a,_0x136f10){var _0x492c12={'uri':util[_0x1245('0x50')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x7d08cb,_0x43ef5a,_0x136f10)};io['to'](util[_0x1245('0x50')](_0x1245('0x51'),_0x356d62))[_0x1245('0x52')](_0x1245('0x53'),_0x492c12);}exports['cs']=function(_0x31bbde,_0x10d438,_0x4521a6,_0x243fc3,_0x343ed6,_0x1a9436,_0x25bd80,_0x50385a){var _0x48e477={};_0x1a9436[_0x1245('0xa')]=_0x1a9436[_0x1245('0x54')]?intUtil[_0x1245('0x55')](_0x1a9436['CloudProvider'][_0x1245('0xc')]):intUtil['stripTrailingSlash'](_0x1a9436[_0x1245('0xa')]);_0x1a9436['serverUrl']=intUtil[_0x1245('0x55')](_0x1a9436[_0x1245('0x56')]);_0x48e477[_0x1245('0x4c')]=_0x50385a===_0x1245('0x4d')||_0x50385a===_0x1245('0x57')?'queue':'outbound';var _0xc79de0=_0x1a9436[_0x1245('0x54')]?util['format']('%s/api/data/v9.0/',_0x1a9436[_0x1245('0xb')][_0x1245('0xc')]):util['format']('%s/api/data/v9.0/',_0x1a9436['remoteUri']);var _0x53995c=util['format'](_0x1245('0x58'),_0x1a9436[_0x1245('0xd')]);var _0x12613e=util['format'](_0x1245('0x59'),_0x1a9436[_0x1245('0x56')],_0x10d438[_0x1245('0x5a')],md5(_0x10d438[_0x1245('0x5a')]));if(_0x343ed6&&_0x343ed6[_0x1245('0x5b')]){logger[_0x1245('0x20')]('[QUEUE]',_0x1245('0x5c'));_0x10d438[_0x1245('0x5d')]=_0x12613e;}else if(_0x25bd80&&_0x25bd80[_0x1245('0x5e')]&&_0x25bd80[_0x1245('0x5e')]!==_0x1245('0x5f')){logger[_0x1245('0x20')](_0x1245('0x60'),_0x1245('0x5c'));_0x10d438[_0x1245('0x5d')]=_0x12613e;}else{_0x10d438[_0x1245('0x5d')]='';}return getUser(_0x48e477,_0x1a9436,_0x243fc3,_0x53995c,_0xc79de0,_0x50385a)['then'](function(_0x13409c){logger[_0x1245('0x20')]('['+_0x50385a[_0x1245('0x14')]()+']\x20The\x20User\x20ID\x20is:',_0x13409c[_0x1245('0x23')]);logger['info']('['+_0x50385a[_0x1245('0x14')]()+']\x20The\x20User\x20email\x20is:',_0x13409c[_0x1245('0x1e')]);return getEndUser(_0x13409c,_0x1a9436,_0x53995c,_0xc79de0,_0x10d438,_0x50385a,_0x4521a6[_0x1245('0x61')],_0x4521a6[_0x1245('0x62')]);})[_0x1245('0x12')](function(_0x2e5f94){logger[_0x1245('0x20')]('['+_0x50385a[_0x1245('0x14')]()+_0x1245('0x63'),_0x2e5f94['enduserId']);logger[_0x1245('0x20')]('['+_0x50385a['toUpperCase']()+_0x1245('0x64'),_0x10d438['calleridnum']);return getTicket(_0x2e5f94,_0x1a9436,_0x53995c,_0xc79de0,_0x10d438,_0x4521a6,_0x50385a);})[_0x1245('0x12')](function(_0x4e4c35){logger[_0x1245('0x20')](util[_0x1245('0x50')]('['+_0x50385a[_0x1245('0x14')]()+_0x1245('0x65'),_0x4521a6[_0x1245('0x43')],_0x4e4c35['ticketId']));logger['info'](util[_0x1245('0x50')]('['+_0x50385a['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x50385a));if(_0x50385a!==_0x1245('0x57')&&_0x4521a6[_0x1245('0x66')]){logger['info']('['+_0x50385a[_0x1245('0x14')]()+']',_0x1245('0x67'));emit(_0x1a9436[_0x1245('0xa')],_0x243fc3[_0x1245('0x68')],_0x4521a6['ticketType'],_0x4e4c35['ticketId']);}})[_0x1245('0x13')](function(_0xa0b831){logger[_0x1245('0x69')]('['+_0x50385a[_0x1245('0x14')]()+_0x1245('0x6a'),_0xa0b831[_0x1245('0x16')]);console['error'](_0x1245('0x6b'),_0xa0b831);});}; \ 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 7c7d67c..de4ad25 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 _0x1ed5=['Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','base64','debug','stringify','GET','includes','content','string','picklist','type','idField','customField','variable','variableName','push','customVariable','Variable','toLowerCase','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','unmanaged','lastevent','toUpperCase','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','Tags','name','Fields','custom_fields','keyBy','format','remoteUri','POST','Ticket\x20created!','validateEmail','then','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts'];(function(_0x22ca9a,_0x462572){var _0x525a23=function(_0x358b44){while(--_0x358b44){_0x22ca9a['push'](_0x22ca9a['shift']());}};_0x525a23(++_0x462572);}(_0x1ed5,0x1ed));var _0x51ed=function(_0x2808d0,_0x221a9f){_0x2808d0=_0x2808d0-0x0;var _0x3aef7c=_0x1ed5[_0x2808d0];return _0x3aef7c;};'use strict';var _=require(_0x51ed('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x51ed('0x1'));var Redis=require(_0x51ed('0x2'));var intUtil=require(_0x51ed('0x3'));var config=require(_0x51ed('0x4'));var logger=require(_0x51ed('0x5'))(_0x51ed('0x6'));config[_0x51ed('0x7')]=_[_0x51ed('0x8')](config[_0x51ed('0x7')],{'host':_0x51ed('0x9'),'port':0x18eb});var io=require(_0x51ed('0xa'))(new Redis(config[_0x51ed('0x7')]));var headers={'Content-Type':_0x51ed('0xb'),'Accept':_0x51ed('0xb')};function emit(_0x2ce675,_0x27c613,_0x4629d4){io['to'](_0x2ce675)['emit'](_0x27c613,_0x4629d4);}function getTicket(_0x1d9bfd,_0x3b47e2,_0x45b712,_0x286cb7,_0x293fc5){logger[_0x51ed('0xc')](_0x51ed('0xd'));var _0x4c753b=_[_0x51ed('0xe')]({'responder_id':_0x3b47e2['id'],'requester_id':_0x45b712['id'],'name':util['format'](_0x51ed('0xf'),_0x293fc5[_0x51ed('0x10')]),'phone':_0x293fc5[_0x51ed('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x286cb7['Subjects'],_0x293fc5,'\x20'),'description':intUtil[_0x51ed('0x12')](_0x286cb7[_0x51ed('0x13')],_0x293fc5,'
'),'tags':getTags(_0x286cb7[_0x51ed('0x14')],_0x51ed('0x15'))},getCustomFields(_0x286cb7[_0x51ed('0x16')],_0x293fc5));_0x4c753b[_0x51ed('0x17')]=_['mapValues'](_[_0x51ed('0x18')](_0x4c753b[_0x51ed('0x17')],'id'),'value');return request({'uri':util[_0x51ed('0x19')]('%s/api/v2/tickets',_0x1d9bfd[_0x51ed('0x1a')]),'method':_0x51ed('0x1b'),'body':_0x4c753b})['then'](function(_0x16e5b2){logger[_0x51ed('0xc')](_0x51ed('0x1c'));return _0x16e5b2;});}function getUser(_0x5279f2,_0x46a213){if(intUtil[_0x51ed('0x1d')](_0x46a213)){return request({'uri':util['format']('%s/api/v2/agents',_0x5279f2['remoteUri']),'qs':{'email':_0x46a213}})[_0x51ed('0x1e')](function(_0x22ee34){if(_0x22ee34[_0x51ed('0x1f')]){logger[_0x51ed('0xc')](_0x51ed('0x20'));return _[_0x51ed('0x21')](_0x22ee34,function(_0x37e2ef){return _0x37e2ef[_0x51ed('0x22')][_0x51ed('0x23')]===_0x46a213;});}else{logger[_0x51ed('0xc')](_0x51ed('0x24'));return request({'uri':util[_0x51ed('0x19')](_0x51ed('0x25'),_0x5279f2[_0x51ed('0x1a')])})[_0x51ed('0x1e')](function(_0x1554b9){logger[_0x51ed('0xc')](_0x51ed('0x26'));return _0x1554b9;});}});}else{logger[_0x51ed('0xc')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x51ed('0x19')](_0x51ed('0x25'),_0x5279f2[_0x51ed('0x1a')])})[_0x51ed('0x1e')](function(_0x4297f4){logger[_0x51ed('0xc')](_0x51ed('0x26'));return _0x4297f4;});}}function getEndUser(_0x578c2a,_0x1a1d72,_0x33f052){logger[_0x51ed('0xc')](_0x51ed('0x27'),_0x33f052);return request({'uri':util[_0x51ed('0x19')](_0x51ed('0x28'),_0x578c2a['remoteUri']),'qs':{'phone':_0x33f052}})[_0x51ed('0x1e')](function(_0x3c50d6){if(_0x3c50d6[_0x51ed('0x1f')]){logger[_0x51ed('0xc')](_0x51ed('0x29'));return _[_0x51ed('0x21')](_0x3c50d6,{'phone':_0x33f052});}else{logger['info'](_0x51ed('0x2a'));return request({'uri':util['format'](_0x51ed('0x28'),_0x578c2a[_0x51ed('0x1a')]),'method':_0x51ed('0x1b'),'body':{'name':_0x1a1d72,'phone':_0x33f052}})[_0x51ed('0x1e')](function(_0x44533e){logger['info'](_0x51ed('0x2b'));return _0x44533e;});}});}function getAuth(_0x22358c){return util['format']('Basic\x20%s',new Buffer(_0x22358c[_0x51ed('0x2c')]+':X')[_0x51ed('0x2d')](_0x51ed('0x2e')));}function request(_0xaf89c0){logger[_0x51ed('0x2f')]('[HTTP]',JSON[_0x51ed('0x30')](_0xaf89c0));return rp(_[_0x51ed('0x8')](_0xaf89c0,{'method':_0x51ed('0x31'),'headers':headers,'json':!![]}));}function getTags(_0x1e6c4e,_0x210150){var _0x419052=[];if(_0x1e6c4e&&_0x1e6c4e[_0x51ed('0x1f')]>0x0){_0x419052=_['map'](_0x1e6c4e,_0x210150);}return _0x419052;}function getCustomFields(_0x42a665,_0xdd8c58){var _0x5427c3=[];var _0x1d05e1={'custom_fields':[]};if(_0x42a665['length']>0x0){_['forEach'](_0x42a665,function(_0x939f62){if(_[_0x51ed('0x32')](['string','picklist'],_0x939f62['type'])&&_0x939f62['nameField']&&!_0x939f62['customField']){_0x1d05e1[_0x939f62['nameField']['toLowerCase']()]=_0x939f62[_0x51ed('0x33')][_0x51ed('0x2d')]();}else if(_[_0x51ed('0x32')]([_0x51ed('0x34'),_0x51ed('0x35')],_0x939f62[_0x51ed('0x36')])&&_0x939f62[_0x51ed('0x37')]&&_0x939f62[_0x51ed('0x38')]){_0x1d05e1['custom_fields']['push']({'id':_0x939f62[_0x51ed('0x37')],'value':_0x939f62['content']['toString']()});}else if(_0x939f62[_0x51ed('0x36')]===_0x51ed('0x39')&&_0x939f62['variableName']&&_0x939f62[_0x51ed('0x37')]&&_0x939f62[_0x51ed('0x38')]){_0xdd8c58[_0x939f62[_0x51ed('0x3a')]]&&_0x1d05e1[_0x51ed('0x17')][_0x51ed('0x3b')]({'id':_0x939f62[_0x51ed('0x37')],'value':_0xdd8c58[_0x939f62[_0x51ed('0x3a')]][_0x51ed('0x2d')]()});}else if(_0x939f62[_0x51ed('0x36')]===_0x51ed('0x3c')&&_0x939f62['Variable']&&_0x939f62[_0x51ed('0x3d')][_0x51ed('0x15')]&&_0x939f62[_0x51ed('0x37')]&&_0x939f62['customField']){_0xdd8c58[_0x939f62['Variable'][_0x51ed('0x15')][_0x51ed('0x3e')]()]&&_0x1d05e1[_0x51ed('0x17')][_0x51ed('0x3b')]({'id':_0x939f62[_0x51ed('0x37')],'value':_0xdd8c58[_0x939f62[_0x51ed('0x3d')][_0x51ed('0x15')][_0x51ed('0x3e')]()][_0x51ed('0x2d')]()});}});}return _0x1d05e1;}exports['queue']=function(_0xb205cc,_0x54178b,_0x5cf7ef,_0x5c3686,_0x40bdcf,_0x5d87cc){var _0x42f676,_0xd85389;_0x5d87cc[_0x51ed('0x1a')]=intUtil[_0x51ed('0x3f')](_0x5d87cc['remoteUri']);_0x5d87cc[_0x51ed('0x40')]=intUtil[_0x51ed('0x3f')](_0x5d87cc[_0x51ed('0x40')]);if(_0x40bdcf&&_0x40bdcf[_0x51ed('0x41')]){logger[_0x51ed('0xc')](_0x51ed('0x42'),_0x51ed('0x43'));_0x54178b[_0x51ed('0x44')]=util['format'](_0x51ed('0x45'),_0x5d87cc[_0x51ed('0x40')],_0x54178b[_0x51ed('0x46')],md5(_0x54178b[_0x51ed('0x46')]));}else{_0x54178b['recordingURL']='';}headers['Authorization']=getAuth(_0x5d87cc);return getUser(_0x5d87cc,_0x5c3686[_0x51ed('0x23')])[_0x51ed('0x1e')](function(_0x17140b){_0x42f676=_0x17140b;logger[_0x51ed('0xc')](_0x51ed('0x47'),_0x42f676['id']);return getEndUser(_0x5d87cc,_0x54178b[_0x51ed('0x10')],_0x54178b['calleridnum']);})['then'](function(_0x2a6584){_0xd85389=_0x2a6584;logger[_0x51ed('0xc')](_0x51ed('0x48'),_0xd85389['id']);return getTicket(_0x5d87cc,_0x42f676,_0xd85389,_0x5cf7ef,_0x54178b);})[_0x51ed('0x1e')](function(_0x801875){if(_0x801875&&_0x801875['id']){logger[_0x51ed('0xc')](_0x51ed('0x1c'));logger[_0x51ed('0xc')](_0x51ed('0x49'),_0x801875['id']);logger[_0x51ed('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x51ed('0x19')](_0x51ed('0x4a'),_0x5c3686[_0x51ed('0x15')]),_0x51ed('0x4b'),{'uri':util[_0x51ed('0x19')](_0x51ed('0x4c'),_0x5d87cc[_0x51ed('0x1a')],_0x801875['id'])});}})['catch'](function(_0x342938){logger[_0x51ed('0x4d')](_0x51ed('0x42'),JSON[_0x51ed('0x30')](_0x342938));});};exports[_0x51ed('0x4e')]=function(_0x5c2d48,_0x3ca6f2,_0x15c50e,_0x20eb43,_0x37d920,_0x378c3c,_0x56a20b){var _0x52a3c2,_0x38d0d8;_0x378c3c[_0x51ed('0x1a')]=intUtil[_0x51ed('0x3f')](_0x378c3c[_0x51ed('0x1a')]);_0x378c3c['serverUrl']=intUtil[_0x51ed('0x3f')](_0x378c3c[_0x51ed('0x40')]);if(_0x56a20b&&_0x56a20b['recordingFormat']&&_0x56a20b[_0x51ed('0x4f')]!==_0x51ed('0x50')){logger[_0x51ed('0xc')](_0x51ed('0x51'),_0x51ed('0x43'));_0x3ca6f2[_0x51ed('0x44')]=util['format'](_0x51ed('0x45'),_0x378c3c[_0x51ed('0x40')],_0x3ca6f2[_0x51ed('0x46')],md5(_0x3ca6f2[_0x51ed('0x46')]));}headers[_0x51ed('0x52')]=getAuth(_0x378c3c);return getUser(_0x378c3c,_0x20eb43[_0x51ed('0x23')])[_0x51ed('0x1e')](function(_0x2283f0){_0x52a3c2=_0x2283f0;logger['info'](_0x51ed('0x47'),_0x52a3c2['id']);return getEndUser(_0x378c3c,_0x3ca6f2[_0x51ed('0x53')],_0x3ca6f2['destcalleridnum']);})[_0x51ed('0x1e')](function(_0xac5ac0){_0x38d0d8=_0xac5ac0;logger[_0x51ed('0xc')](_0x51ed('0x48'),_0x38d0d8['id']);return getTicket(_0x378c3c,_0x52a3c2,_0x38d0d8,_0x15c50e,_0x3ca6f2);})[_0x51ed('0x1e')](function(_0x354aed){if(_0x354aed&&_0x354aed['id']){logger[_0x51ed('0xc')](_0x51ed('0x1c'));logger[_0x51ed('0xc')]('The\x20Ticket\x20ID\x20is:',_0x354aed['id']);logger[_0x51ed('0xc')](_0x51ed('0x51'),_0x51ed('0x54'));emit(util['format']('user:%s',_0x20eb43[_0x51ed('0x15')]),_0x51ed('0x4b'),{'uri':util[_0x51ed('0x19')](_0x51ed('0x4c'),_0x378c3c[_0x51ed('0x1a')],_0x354aed['id'])});}})[_0x51ed('0x55')](function(_0x15cae2){logger[_0x51ed('0x4d')](_0x51ed('0x51'),JSON[_0x51ed('0x30')](_0x15cae2));});};exports[_0x51ed('0x56')]=function(_0x50f2d0,_0x5e138e,_0x11503f,_0x3d7bee,_0x3007ac,_0x42311e){var _0x511950,_0x59722c;_0x42311e['remoteUri']=intUtil[_0x51ed('0x3f')](_0x42311e[_0x51ed('0x1a')]);_0x42311e[_0x51ed('0x40')]=intUtil[_0x51ed('0x3f')](_0x42311e[_0x51ed('0x40')]);if(_0x3007ac&&_0x3007ac[_0x51ed('0x41')]){logger[_0x51ed('0xc')]('['+_0x5e138e[_0x51ed('0x57')][_0x51ed('0x58')]()+']',_0x51ed('0x43'));_0x5e138e[_0x51ed('0x44')]=util[_0x51ed('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x42311e[_0x51ed('0x40')],_0x5e138e['uniqueid'],md5(_0x5e138e[_0x51ed('0x46')]));}else{_0x5e138e[_0x51ed('0x44')]='';}headers[_0x51ed('0x52')]=getAuth(_0x42311e);return getUser(_0x42311e,'')[_0x51ed('0x1e')](function(_0x3e96c3){_0x511950=_0x3e96c3;logger['info'](_0x51ed('0x47'),_0x511950['id']);return getEndUser(_0x42311e,_0x5e138e[_0x51ed('0x10')],_0x5e138e[_0x51ed('0x11')]);})['then'](function(_0x2180e3){_0x59722c=_0x2180e3;logger[_0x51ed('0xc')](_0x51ed('0x48'),_0x59722c['id']);return getTicket(_0x42311e,_0x511950,_0x59722c,_0x11503f,_0x5e138e);})['then'](function(_0xca5078){if(_0xca5078){logger['info'](_0x51ed('0x1c'));logger['info']('The\x20Ticket\x20ID\x20is:',_0xca5078['id']);}})[_0x51ed('0x55')](function(_0x392e47){logger['error']('['+_0x5e138e[_0x51ed('0x57')][_0x51ed('0x58')]()+']',JSON[_0x51ed('0x30')](_0x392e47));});}; \ No newline at end of file +var _0xdf6c=['POST','then','Ticket\x20created!','%s/api/v2/agents','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Enduser\x20created.','Basic\x20%s','apiKey','toString','debug','[HTTP]','stringify','GET','map','forEach','includes','string','picklist','nameField','customField','toLowerCase','content','type','idField','push','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','none','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','md5','util','ioredis','./util','../../../../config/logger','freshdesk','redis','defaults','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','value','%s/api/v2/tickets','remoteUri'];(function(_0x26ae05,_0x53e7ea){var _0x1e8338=function(_0x241a59){while(--_0x241a59){_0x26ae05['push'](_0x26ae05['shift']());}};_0x1e8338(++_0x53e7ea);}(_0xdf6c,0x160));var _0xcdf6=function(_0x446a34,_0x9ff1f7){_0x446a34=_0x446a34-0x0;var _0xbd09d2=_0xdf6c[_0x446a34];return _0xbd09d2;};'use strict';var _=require(_0xcdf6('0x0'));var rp=require('request-promise');var md5=require(_0xcdf6('0x1'));var util=require(_0xcdf6('0x2'));var Redis=require(_0xcdf6('0x3'));var intUtil=require(_0xcdf6('0x4'));var config=require('../../../../config/environment');var logger=require(_0xcdf6('0x5'))(_0xcdf6('0x6'));config[_0xcdf6('0x7')]=_[_0xcdf6('0x8')](config[_0xcdf6('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xcdf6('0x9'))(new Redis(config['redis']));var headers={'Content-Type':'application/json','Accept':'application/json'};function emit(_0x36796e,_0x485a77,_0x20bed2){io['to'](_0x36796e)[_0xcdf6('0xa')](_0x485a77,_0x20bed2);}function getTicket(_0x3b72f7,_0x55595f,_0x48130f,_0x3327fc,_0x9922e0){logger[_0xcdf6('0xb')](_0xcdf6('0xc'));var _0x1faf06=_['merge']({'responder_id':_0x55595f['id'],'requester_id':_0x48130f['id'],'name':util[_0xcdf6('0xd')](_0xcdf6('0xe'),_0x9922e0['calleridname']),'phone':_0x9922e0[_0xcdf6('0xf')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xcdf6('0x10')](_0x3327fc[_0xcdf6('0x11')],_0x9922e0,'\x20'),'description':intUtil['getString'](_0x3327fc[_0xcdf6('0x12')],_0x9922e0,_0xcdf6('0x13')),'tags':getTags(_0x3327fc[_0xcdf6('0x14')],_0xcdf6('0x15'))},getCustomFields(_0x3327fc[_0xcdf6('0x16')],_0x9922e0));_0x1faf06[_0xcdf6('0x17')]=_[_0xcdf6('0x18')](_['keyBy'](_0x1faf06['custom_fields'],'id'),_0xcdf6('0x19'));return request({'uri':util[_0xcdf6('0xd')](_0xcdf6('0x1a'),_0x3b72f7[_0xcdf6('0x1b')]),'method':_0xcdf6('0x1c'),'body':_0x1faf06})[_0xcdf6('0x1d')](function(_0x38d77e){logger[_0xcdf6('0xb')](_0xcdf6('0x1e'));return _0x38d77e;});}function getUser(_0x2d35a5,_0x41a05d){if(intUtil['validateEmail'](_0x41a05d)){return request({'uri':util[_0xcdf6('0xd')](_0xcdf6('0x1f'),_0x2d35a5['remoteUri']),'qs':{'email':_0x41a05d}})[_0xcdf6('0x1d')](function(_0x805c2a){if(_0x805c2a['length']){logger['info'](_0xcdf6('0x20'));return _['find'](_0x805c2a,function(_0x340964){return _0x340964[_0xcdf6('0x21')][_0xcdf6('0x22')]===_0x41a05d;});}else{logger[_0xcdf6('0xb')](_0xcdf6('0x23'));return request({'uri':util['format'](_0xcdf6('0x24'),_0x2d35a5[_0xcdf6('0x1b')])})[_0xcdf6('0x1d')](function(_0x44e15c){logger[_0xcdf6('0xb')](_0xcdf6('0x25'));return _0x44e15c;});}});}else{logger[_0xcdf6('0xb')](_0xcdf6('0x26'));return request({'uri':util[_0xcdf6('0xd')](_0xcdf6('0x24'),_0x2d35a5[_0xcdf6('0x1b')])})[_0xcdf6('0x1d')](function(_0x4bc8c5){logger[_0xcdf6('0xb')](_0xcdf6('0x25'));return _0x4bc8c5;});}}function getEndUser(_0x1b84a6,_0x5de4f1,_0x135d15){logger['info'](_0xcdf6('0x27'),_0x135d15);return request({'uri':util['format']('%s/api/v2/contacts',_0x1b84a6['remoteUri']),'qs':{'phone':_0x135d15}})['then'](function(_0x49acfc){if(_0x49acfc[_0xcdf6('0x28')]){logger[_0xcdf6('0xb')](_0xcdf6('0x29'));return _['find'](_0x49acfc,{'phone':_0x135d15});}else{logger[_0xcdf6('0xb')](_0xcdf6('0x2a'));return request({'uri':util[_0xcdf6('0xd')](_0xcdf6('0x2b'),_0x1b84a6['remoteUri']),'method':'POST','body':{'name':_0x5de4f1,'phone':_0x135d15}})[_0xcdf6('0x1d')](function(_0x57df76){logger[_0xcdf6('0xb')](_0xcdf6('0x2c'));return _0x57df76;});}});}function getAuth(_0x4245de){return util[_0xcdf6('0xd')](_0xcdf6('0x2d'),new Buffer(_0x4245de[_0xcdf6('0x2e')]+':X')[_0xcdf6('0x2f')]('base64'));}function request(_0x4bc65d){logger[_0xcdf6('0x30')](_0xcdf6('0x31'),JSON[_0xcdf6('0x32')](_0x4bc65d));return rp(_[_0xcdf6('0x8')](_0x4bc65d,{'method':_0xcdf6('0x33'),'headers':headers,'json':!![]}));}function getTags(_0x389c38,_0x42e100){var _0x1bcdda=[];if(_0x389c38&&_0x389c38[_0xcdf6('0x28')]>0x0){_0x1bcdda=_[_0xcdf6('0x34')](_0x389c38,_0x42e100);}return _0x1bcdda;}function getCustomFields(_0x2de176,_0xbab999){var _0xc15d29=[];var _0x344fdd={'custom_fields':[]};if(_0x2de176[_0xcdf6('0x28')]>0x0){_[_0xcdf6('0x35')](_0x2de176,function(_0x467ac8){if(_[_0xcdf6('0x36')]([_0xcdf6('0x37'),_0xcdf6('0x38')],_0x467ac8['type'])&&_0x467ac8[_0xcdf6('0x39')]&&!_0x467ac8[_0xcdf6('0x3a')]){_0x344fdd[_0x467ac8[_0xcdf6('0x39')][_0xcdf6('0x3b')]()]=_0x467ac8[_0xcdf6('0x3c')]['toString']();}else if(_[_0xcdf6('0x36')]([_0xcdf6('0x37'),_0xcdf6('0x38')],_0x467ac8[_0xcdf6('0x3d')])&&_0x467ac8[_0xcdf6('0x3e')]&&_0x467ac8[_0xcdf6('0x3a')]){_0x344fdd[_0xcdf6('0x17')][_0xcdf6('0x3f')]({'id':_0x467ac8[_0xcdf6('0x3e')],'value':_0x467ac8['content'][_0xcdf6('0x2f')]()});}else if(_0x467ac8[_0xcdf6('0x3d')]===_0xcdf6('0x40')&&_0x467ac8[_0xcdf6('0x41')]&&_0x467ac8[_0xcdf6('0x3e')]&&_0x467ac8['customField']){_0xbab999[_0x467ac8[_0xcdf6('0x41')]]&&_0x344fdd[_0xcdf6('0x17')][_0xcdf6('0x3f')]({'id':_0x467ac8['idField'],'value':_0xbab999[_0x467ac8[_0xcdf6('0x41')]][_0xcdf6('0x2f')]()});}else if(_0x467ac8['type']===_0xcdf6('0x42')&&_0x467ac8[_0xcdf6('0x43')]&&_0x467ac8[_0xcdf6('0x43')][_0xcdf6('0x15')]&&_0x467ac8[_0xcdf6('0x3e')]&&_0x467ac8['customField']){_0xbab999[_0x467ac8[_0xcdf6('0x43')][_0xcdf6('0x15')][_0xcdf6('0x3b')]()]&&_0x344fdd[_0xcdf6('0x17')][_0xcdf6('0x3f')]({'id':_0x467ac8[_0xcdf6('0x3e')],'value':_0xbab999[_0x467ac8['Variable'][_0xcdf6('0x15')][_0xcdf6('0x3b')]()][_0xcdf6('0x2f')]()});}});}return _0x344fdd;}exports[_0xcdf6('0x44')]=function(_0x32bd99,_0xfb9ea7,_0x501782,_0x43201b,_0x23c745,_0x349b90){var _0x1b4577,_0x2e4881;_0x349b90[_0xcdf6('0x1b')]=intUtil[_0xcdf6('0x45')](_0x349b90['remoteUri']);_0x349b90[_0xcdf6('0x46')]=intUtil['stripTrailingSlash'](_0x349b90[_0xcdf6('0x46')]);if(_0x23c745&&_0x23c745['monitor_format']){logger[_0xcdf6('0xb')](_0xcdf6('0x47'),'Recording\x20is\x20enabled!');_0xfb9ea7[_0xcdf6('0x48')]=util[_0xcdf6('0xd')](_0xcdf6('0x49'),_0x349b90[_0xcdf6('0x46')],_0xfb9ea7[_0xcdf6('0x4a')],md5(_0xfb9ea7[_0xcdf6('0x4a')]));}else{_0xfb9ea7[_0xcdf6('0x48')]='';}headers[_0xcdf6('0x4b')]=getAuth(_0x349b90);return getUser(_0x349b90,_0x43201b[_0xcdf6('0x22')])[_0xcdf6('0x1d')](function(_0x7c6044){_0x1b4577=_0x7c6044;logger[_0xcdf6('0xb')](_0xcdf6('0x4c'),_0x1b4577['id']);return getEndUser(_0x349b90,_0xfb9ea7['calleridname'],_0xfb9ea7[_0xcdf6('0xf')]);})[_0xcdf6('0x1d')](function(_0x43cf0d){_0x2e4881=_0x43cf0d;logger['info'](_0xcdf6('0x4d'),_0x2e4881['id']);return getTicket(_0x349b90,_0x1b4577,_0x2e4881,_0x501782,_0xfb9ea7);})[_0xcdf6('0x1d')](function(_0x4d2ffc){if(_0x4d2ffc&&_0x4d2ffc['id']){logger[_0xcdf6('0xb')]('Ticket\x20created!');logger[_0xcdf6('0xb')]('The\x20Ticket\x20ID\x20is:',_0x4d2ffc['id']);logger['info'](_0xcdf6('0x47'),_0xcdf6('0x4e'));emit(util[_0xcdf6('0xd')](_0xcdf6('0x4f'),_0x43201b['name']),_0xcdf6('0x50'),{'uri':util[_0xcdf6('0xd')](_0xcdf6('0x51'),_0x349b90[_0xcdf6('0x1b')],_0x4d2ffc['id'])});}})[_0xcdf6('0x52')](function(_0x431281){logger[_0xcdf6('0x53')]('[QUEUE]',JSON['stringify'](_0x431281));});};exports['outbound']=function(_0x5b074c,_0xda6c40,_0x4c9c7d,_0x351c25,_0x25bc38,_0x5edc8c,_0xb034e6){var _0x2b65cf,_0x493f75;_0x5edc8c[_0xcdf6('0x1b')]=intUtil[_0xcdf6('0x45')](_0x5edc8c[_0xcdf6('0x1b')]);_0x5edc8c['serverUrl']=intUtil['stripTrailingSlash'](_0x5edc8c[_0xcdf6('0x46')]);if(_0xb034e6&&_0xb034e6[_0xcdf6('0x54')]&&_0xb034e6[_0xcdf6('0x54')]!==_0xcdf6('0x55')){logger[_0xcdf6('0xb')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0xda6c40['recordingURL']=util[_0xcdf6('0xd')](_0xcdf6('0x49'),_0x5edc8c['serverUrl'],_0xda6c40[_0xcdf6('0x4a')],md5(_0xda6c40[_0xcdf6('0x4a')]));}headers[_0xcdf6('0x4b')]=getAuth(_0x5edc8c);return getUser(_0x5edc8c,_0x351c25[_0xcdf6('0x22')])['then'](function(_0x29e60d){_0x2b65cf=_0x29e60d;logger['info']('The\x20User\x20ID\x20is:',_0x2b65cf['id']);return getEndUser(_0x5edc8c,_0xda6c40[_0xcdf6('0x56')],_0xda6c40[_0xcdf6('0x57')]);})[_0xcdf6('0x1d')](function(_0x200517){_0x493f75=_0x200517;logger[_0xcdf6('0xb')](_0xcdf6('0x4d'),_0x493f75['id']);return getTicket(_0x5edc8c,_0x2b65cf,_0x493f75,_0x4c9c7d,_0xda6c40);})['then'](function(_0x77a580){if(_0x77a580&&_0x77a580['id']){logger[_0xcdf6('0xb')](_0xcdf6('0x1e'));logger['info'](_0xcdf6('0x58'),_0x77a580['id']);logger['info'](_0xcdf6('0x59'),_0xcdf6('0x4e'));emit(util['format']('user:%s',_0x351c25[_0xcdf6('0x15')]),_0xcdf6('0x50'),{'uri':util[_0xcdf6('0xd')](_0xcdf6('0x51'),_0x5edc8c[_0xcdf6('0x1b')],_0x77a580['id'])});}})[_0xcdf6('0x52')](function(_0x51de36){logger['error']('[OUTBOUND]',JSON['stringify'](_0x51de36));});};exports[_0xcdf6('0x5a')]=function(_0x113731,_0x4ebc89,_0x4350bb,_0x4c3a67,_0x203feb,_0x4e87d9){var _0x535460,_0x4f508d;_0x4e87d9[_0xcdf6('0x1b')]=intUtil['stripTrailingSlash'](_0x4e87d9['remoteUri']);_0x4e87d9[_0xcdf6('0x46')]=intUtil['stripTrailingSlash'](_0x4e87d9[_0xcdf6('0x46')]);if(_0x203feb&&_0x203feb[_0xcdf6('0x5b')]){logger[_0xcdf6('0xb')]('['+_0x4ebc89[_0xcdf6('0x5c')][_0xcdf6('0x5d')]()+']',_0xcdf6('0x5e'));_0x4ebc89[_0xcdf6('0x48')]=util[_0xcdf6('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4e87d9['serverUrl'],_0x4ebc89['uniqueid'],md5(_0x4ebc89[_0xcdf6('0x4a')]));}else{_0x4ebc89[_0xcdf6('0x48')]='';}headers[_0xcdf6('0x4b')]=getAuth(_0x4e87d9);return getUser(_0x4e87d9,'')[_0xcdf6('0x1d')](function(_0x866154){_0x535460=_0x866154;logger['info'](_0xcdf6('0x4c'),_0x535460['id']);return getEndUser(_0x4e87d9,_0x4ebc89['calleridname'],_0x4ebc89[_0xcdf6('0xf')]);})[_0xcdf6('0x1d')](function(_0x128e07){_0x4f508d=_0x128e07;logger[_0xcdf6('0xb')](_0xcdf6('0x4d'),_0x4f508d['id']);return getTicket(_0x4e87d9,_0x535460,_0x4f508d,_0x4350bb,_0x4ebc89);})[_0xcdf6('0x1d')](function(_0x4f62e2){if(_0x4f62e2){logger['info'](_0xcdf6('0x1e'));logger[_0xcdf6('0xb')](_0xcdf6('0x58'),_0x4f62e2['id']);}})['catch'](function(_0xedd90f){logger[_0xcdf6('0x53')]('['+_0x4ebc89[_0xcdf6('0x5c')][_0xcdf6('0x5d')]()+']',JSON[_0xcdf6('0x32')](_0xedd90f));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js index 8a7863a..5a18b76 100644 --- a/server/services/ami/trigger/integration/freshsales.js +++ b/server/services/ami/trigger/integration/freshsales.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd38a=['Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','lodash','md5','util','moment','./util','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','GET','headers','info','Getting\x20admin\x20information','then','adminEmail','adminId','Admin\x20found:','catch','error','toUpperCase','message','Getting\x20user\x20list','users','agentEmail','userEmail','length','userId','Requested\x20Resource\x20not\x20Found','/api/lookup?q=','&f=','&entities=contact','find','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','work_number','Contact\x20found\x20work_number:','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','POST','getString','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','outbound','destcalleridnum','callDirection','queue','email','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','unmanaged'];(function(_0x397f37,_0x3cf86d){var _0x31cae6=function(_0x5cddb9){while(--_0x5cddb9){_0x397f37['push'](_0x397f37['shift']());}};_0x31cae6(++_0x3cf86d);}(_0xd38a,0x9f));var _0xad38=function(_0xc7d00f,_0x3d31c9){_0xc7d00f=_0xc7d00f-0x0;var _0x416f1d=_0xd38a[_0xc7d00f];return _0x416f1d;};'use strict';var _=require(_0xad38('0x0'));var rp=require('request-promise');var md5=require(_0xad38('0x1'));var util=require(_0xad38('0x2'));var moment=require(_0xad38('0x3'));var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require(_0xad38('0x4'));var config=require(_0xad38('0x5'));var logger=require(_0xad38('0x6'))('freshsales');config[_0xad38('0x7')]=_['defaults'](config[_0xad38('0x7')],{'host':_0xad38('0x8'),'port':0x18eb});var io=require(_0xad38('0x9'))(new Redis(config['redis']));function getAdminId(_0x497953,_0x10d257,_0x381800,_0xcb6fb9){return new Promise(function(_0x3e2dfd,_0x340261){var _0x239ac9=![];var _0x1ece3e={'method':_0xad38('0xa'),'uri':_0xcb6fb9+'/api/selector/owners','json':!![]};_0x1ece3e[_0xad38('0xb')]=_0x381800;logger[_0xad38('0xc')](_0xad38('0xd'));return rp(_0x1ece3e)[_0xad38('0xe')](function(_0x502d93){if(_0x502d93){var _0x45cead=_0x502d93['users'];var _0x2a2f4f=null;for(_0x2a2f4f=0x0;_0x2a2f4f<_0x45cead['length'];_0x2a2f4f++){if(_0x45cead[_0x2a2f4f]['email']===_0x497953[_0xad38('0xf')]){_0x497953[_0xad38('0x10')]=_0x45cead[_0x2a2f4f]['id'];_0x239ac9=!![];}}if(_0x239ac9){logger['info'](_0xad38('0x11'),_0x497953[_0xad38('0x10')]);_0x3e2dfd(_0x497953);}else{_0x340261({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x340261({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xad38('0x12')](function(_0x59dd30){logger[_0xad38('0x13')]('['+[_0x10d257[_0xad38('0x14')]()]+']',_0x59dd30[_0xad38('0x15')]);_0x340261(_0x59dd30);});});}function getUser(_0x3fe7ba,_0x57e5cf,_0x4e4eda){return function(_0x520503){return new Promise(function(_0x321a22,_0x87343a){var _0x56fc66={'method':_0xad38('0xa'),'uri':_0x4e4eda+'/api/selector/owners','json':!![]};_0x56fc66[_0xad38('0xb')]=_0x57e5cf;logger[_0xad38('0xc')](_0xad38('0x16'));return rp(_0x56fc66)['then'](function(_0xdea8a7){if(_0xdea8a7){var _0x151e97=_0xdea8a7[_0xad38('0x17')];var _0x37ee3e=![];var _0x580938=null;if(_0x520503[_0xad38('0x18')]!==null){logger[_0xad38('0xc')]('Getting\x20user\x20with\x20email',_0x520503[_0xad38('0x18')]);_0x520503[_0xad38('0x19')]=_0x520503[_0xad38('0x18')];for(_0x580938=0x0;_0x580938<_0x151e97[_0xad38('0x1a')];_0x580938++){if(_0x151e97[_0x580938]['email']===_0x520503['agentEmail']){_0x37ee3e=!![];_0x520503[_0xad38('0x1b')]=_0x151e97[_0x580938]['id'];logger[_0xad38('0xc')]('User\x20found:',_0x520503[_0xad38('0x1b')]);}}}if(!_0x37ee3e){logger[_0xad38('0xc')]('Admin\x20selected');_0x520503[_0xad38('0x19')]=_0x520503[_0xad38('0xf')];_0x520503[_0xad38('0x1b')]=_0x520503[_0xad38('0x10')];_0x37ee3e=!![];}if(_0x37ee3e){_0x321a22(_0x520503);}else{_0x87343a({'statusCode':0x194,'message':_0xad38('0x1c')});}}else{_0x87343a({'statusCode':0x194,'message':_0xad38('0x1c')});}})[_0xad38('0x12')](function(_0x479a8c){logger[_0xad38('0x13')]('['+[_0x3fe7ba['toUpperCase']()]+']',_0x479a8c[_0xad38('0x15')]);_0x87343a(_0x479a8c);});});};}function searchContact(_0x4283ce,_0x506599,_0x461913,_0x566e1e){return new Promise(function(_0x51faff,_0x2963a0){var _0x45917f={'method':'GET','headers':_0x506599,'uri':_0x4283ce+_0xad38('0x1d')+_0x566e1e+_0xad38('0x1e')+_0x461913+_0xad38('0x1f'),'json':!![]};rp(_0x45917f)[_0xad38('0xe')](function(_0x37fc7f){var _0x30d37f=_[_0xad38('0x20')](_0x37fc7f['contacts']['contacts'],[_0x461913,_0x566e1e]);_0x51faff(_0x30d37f);})[_0xad38('0x12')](function(_0x356eff){_0x2963a0(_0x356eff);});});}function getEndUser(_0x56bb44,_0x1bbc3e,_0x54d75b){return function(_0x1ff932){return new Promise(function(_0x27ed7d,_0x39f8c9){logger[_0xad38('0xc')](util[_0xad38('0x21')]('Searching\x20contact\x20with\x20phone\x20%s',_0x1ff932[_0xad38('0x22')]));searchContact(_0x54d75b,_0x1bbc3e,_0xad38('0x23'),_0x1ff932['contactNumber'])['then'](function(_0x2f7b15){if(_0x2f7b15){_0x1ff932[_0xad38('0x24')]=_0x2f7b15['id'];logger[_0xad38('0xc')](_0xad38('0x25'),_0x1ff932[_0xad38('0x24')]);return _0x27ed7d(_0x1ff932);}searchContact(_0x54d75b,_0x1bbc3e,_0xad38('0x26'),_0x1ff932[_0xad38('0x22')])[_0xad38('0xe')](function(_0x863b24){if(_0x863b24){_0x1ff932[_0xad38('0x24')]=_0x863b24['id'];logger[_0xad38('0xc')](_0xad38('0x27'),_0x1ff932['endUserId']);return _0x27ed7d(_0x1ff932);}createEndUser(_0x1ff932,_0x56bb44,_0x1bbc3e,_0x54d75b)[_0xad38('0xe')](function(_0x3b67d3){logger['info']('Contact\x20created:',_0x3b67d3['endUserId']);return _0x27ed7d(_0x3b67d3);});});})[_0xad38('0x12')](function(_0x561fd7){_0x39f8c9(_0x561fd7);});});};}function createEndUser(_0x74117b,_0x854ef4,_0x2056e7,_0x4ca8d0){return new Promise(function(_0x5da8c0,_0x259323){var _0x3eb925=moment();var _0x10b57b={'method':'POST','uri':_0x4ca8d0+'/api/contacts','body':{'contact':{'last_name':_0x74117b['contactNumber'],'work_number':_0x74117b[_0xad38('0x22')],'mobile_number':_0x74117b['contactNumber'],'owner_id':_0x74117b[_0xad38('0x1b')],'created_at':_0x3eb925[_0xad38('0x21')](_0xad38('0x28'))}},'json':!![]};_0x10b57b['headers']=_0x2056e7;logger['info'](_0xad38('0x29'));return rp(_0x10b57b)[_0xad38('0xe')](function(_0x4e6dc6){_0x74117b[_0xad38('0x24')]=_0x4e6dc6[_0xad38('0x2a')]['id'];_0x5da8c0(_0x74117b);})['catch'](function(_0x2c1420){logger['error']('['+[_0x854ef4['toUpperCase']()]+']',_0x2c1420[_0xad38('0x15')]);_0x259323(_0x2c1420[_0xad38('0x15')]);});});}function getTicket(_0x5729ff,_0x4c782e,_0x3dbc5d,_0x37b4a5,_0x145b67){return function(_0x50866d){logger[_0xad38('0xc')](_0xad38('0x2b'));return new Promise(function(_0x129ba4,_0x41ddc5){var _0x124866=moment();var _0x385e68={'method':_0xad38('0x2c'),'uri':_0x3dbc5d+'/api/tasks','body':{'title':intUtil[_0xad38('0x2d')](_0x37b4a5['Subjects'],_0x145b67,'\x20'),'description':intUtil[_0xad38('0x2d')](_0x37b4a5['Descriptions'],_0x145b67,'\x0a'),'owner_id':_0x50866d['userId'],'creater_id':_0x50866d[_0xad38('0x10')],'targetable_id':_0x50866d['endUserId'],'targetable_type':'Contact','created_at':_0x124866[_0xad38('0x21')](_0xad38('0x28')),'due_date':_0x124866[_0xad38('0x2e')](0x1e,'m')[_0xad38('0x21')](_0xad38('0x28'))},'json':!![]};_0x385e68['headers']=_0x4c782e;return rp(_0x385e68)[_0xad38('0xe')](function(_0x1c68f4){_0x50866d[_0xad38('0x2f')]=_0x1c68f4[_0xad38('0x30')]['id'];logger[_0xad38('0xc')](_0xad38('0x31'),_0x50866d[_0xad38('0x2f')]);_0x129ba4(_0x50866d);})['catch'](function(_0x264a99){logger[_0xad38('0x13')]('['+[_0x5729ff[_0xad38('0x14')]()]+']',_0x264a99[_0xad38('0x15')]);_0x41ddc5(_0x264a99['message']);});});};}function emit(_0x47eda4,_0xad3574,_0x4e7be4){var _0x3f6fef={'uri':_0x47eda4+_0xad38('0x32')+_0x4e7be4};io['to'](util[_0xad38('0x21')](_0xad38('0x33'),_0xad3574))[_0xad38('0x34')](_0xad38('0x35'),_0x3f6fef);}exports['cs']=function(_0xcdb9eb,_0x3a0d60,_0x5f19e5,_0x399695,_0x56f8af,_0x1d1761,_0x2b0eb5,_0x315963){var _0x4d4e09={};var _0xea240d={'Authorization':_0xad38('0x36')+_0x1d1761[_0xad38('0x37')]};_0x1d1761[_0xad38('0x38')]=intUtil[_0xad38('0x39')](_0x1d1761[_0xad38('0x38')]);_0x1d1761[_0xad38('0x3a')]=intUtil[_0xad38('0x39')](_0x1d1761[_0xad38('0x3a')]);var _0x36f1fb=_0x1d1761[_0xad38('0x38')];_0x4d4e09[_0xad38('0xf')]=_0x1d1761[_0xad38('0x3b')];_0x4d4e09[_0xad38('0x22')]=_0x315963[_0xad38('0x3c')]()===_0xad38('0x3d')?_0x3a0d60[_0xad38('0x3e')]:_0x3a0d60['calleridnum'];_0x4d4e09[_0xad38('0x3f')]=_0x315963===_0xad38('0x40')||_0x315963==='unmanaged'?_0xad38('0x40'):'outbound';if(_0x399695){_0x4d4e09[_0xad38('0x18')]=_0x399695[_0xad38('0x41')];}var _0x4f85a2=util['format'](_0xad38('0x42'),_0x1d1761[_0xad38('0x3a')],_0x3a0d60[_0xad38('0x43')],md5(_0x3a0d60[_0xad38('0x43')]));if(_0x56f8af&&_0x56f8af['monitor_format']){logger['info'](_0xad38('0x44'),_0xad38('0x45'));_0x3a0d60[_0xad38('0x46')]=_0x4f85a2;}else if(_0x2b0eb5&&_0x2b0eb5[_0xad38('0x47')]&&_0x2b0eb5['recordingFormat']!==_0xad38('0x48')){logger[_0xad38('0xc')]('[OUTBOUND]',_0xad38('0x45'));_0x3a0d60[_0xad38('0x46')]=_0x4f85a2;}else{_0x3a0d60[_0xad38('0x46')]='';}return getAdminId(_0x4d4e09,_0x315963,_0xea240d,_0x36f1fb)[_0xad38('0xe')](getUser(_0x315963,_0xea240d,_0x36f1fb))[_0xad38('0xe')](getEndUser(_0x315963,_0xea240d,_0x36f1fb))['then'](getTicket(_0x315963,_0xea240d,_0x36f1fb,_0x5f19e5,_0x3a0d60))[_0xad38('0xe')](function(_0x346b38){logger['info'](util['format'](_0xad38('0x49'),_0x346b38[_0xad38('0x2f')]));if(_0x315963!==_0xad38('0x4a')){logger['info']('['+[_0x315963[_0xad38('0x14')]()]+']',_0xad38('0x4b'));emit(_0x36f1fb,_0x399695[_0xad38('0x4c')],_0x346b38[_0xad38('0x24')]);}})[_0xad38('0x12')](function(_0x4a9e4f){logger[_0xad38('0x13')]('['+[_0x315963[_0xad38('0x14')]()]+_0xad38('0x4d'),util['inspect'](_0x4a9e4f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xd7ff=['contactNumber','mobile_number','endUserId','work_number','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','Subjects','getString','Descriptions','add','ticketId','task','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','unmanaged','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name','lodash','request-promise','md5','util','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','agentEmail','length','userId','Admin\x20selected','userEmail','/api/lookup?q=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s'];(function(_0x4778a0,_0x45fafb){var _0x3b7ec5=function(_0x888e7f){while(--_0x888e7f){_0x4778a0['push'](_0x4778a0['shift']());}};_0x3b7ec5(++_0x45fafb);}(_0xd7ff,0x124));var _0xfd7f=function(_0x2a86c1,_0x1c0ce2){_0x2a86c1=_0x2a86c1-0x0;var _0x595f62=_0xd7ff[_0x2a86c1];return _0x595f62;};'use strict';var _=require(_0xfd7f('0x0'));var rp=require(_0xfd7f('0x1'));var md5=require(_0xfd7f('0x2'));var util=require(_0xfd7f('0x3'));var moment=require('moment');var Promise=require(_0xfd7f('0x4'));var Redis=require(_0xfd7f('0x5'));var intUtil=require(_0xfd7f('0x6'));var config=require(_0xfd7f('0x7'));var logger=require(_0xfd7f('0x8'))('freshsales');config[_0xfd7f('0x9')]=_[_0xfd7f('0xa')](config[_0xfd7f('0x9')],{'host':_0xfd7f('0xb'),'port':0x18eb});var io=require(_0xfd7f('0xc'))(new Redis(config['redis']));function getAdminId(_0x4cda83,_0x81114f,_0x22678a,_0x197245){return new Promise(function(_0x1fab5d,_0x503ad9){var _0x3abb22=![];var _0x20516f={'method':_0xfd7f('0xd'),'uri':_0x197245+_0xfd7f('0xe'),'json':!![]};_0x20516f[_0xfd7f('0xf')]=_0x22678a;logger[_0xfd7f('0x10')](_0xfd7f('0x11'));return rp(_0x20516f)[_0xfd7f('0x12')](function(_0x18eab7){if(_0x18eab7){var _0x29dfe6=_0x18eab7[_0xfd7f('0x13')];var _0x324307=null;for(_0x324307=0x0;_0x324307<_0x29dfe6['length'];_0x324307++){if(_0x29dfe6[_0x324307][_0xfd7f('0x14')]===_0x4cda83[_0xfd7f('0x15')]){_0x4cda83['adminId']=_0x29dfe6[_0x324307]['id'];_0x3abb22=!![];}}if(_0x3abb22){logger[_0xfd7f('0x10')](_0xfd7f('0x16'),_0x4cda83[_0xfd7f('0x17')]);_0x1fab5d(_0x4cda83);}else{_0x503ad9({'statusCode':0x194,'message':_0xfd7f('0x18')});}}else{_0x503ad9({'statusCode':0x194,'message':_0xfd7f('0x18')});}})[_0xfd7f('0x19')](function(_0x754585){logger[_0xfd7f('0x1a')]('['+[_0x81114f[_0xfd7f('0x1b')]()]+']',_0x754585[_0xfd7f('0x1c')]);_0x503ad9(_0x754585);});});}function getUser(_0x770ae0,_0x703e23,_0x1c3740){return function(_0x1f56a3){return new Promise(function(_0x1f390e,_0x3e041c){var _0x477ced={'method':'GET','uri':_0x1c3740+'/api/selector/owners','json':!![]};_0x477ced[_0xfd7f('0xf')]=_0x703e23;logger['info']('Getting\x20user\x20list');return rp(_0x477ced)[_0xfd7f('0x12')](function(_0x2b7ea2){if(_0x2b7ea2){var _0x52960a=_0x2b7ea2[_0xfd7f('0x13')];var _0x343bd8=![];var _0x489070=null;if(_0x1f56a3[_0xfd7f('0x1d')]!==null){logger['info']('Getting\x20user\x20with\x20email',_0x1f56a3[_0xfd7f('0x1d')]);_0x1f56a3['userEmail']=_0x1f56a3[_0xfd7f('0x1d')];for(_0x489070=0x0;_0x489070<_0x52960a[_0xfd7f('0x1e')];_0x489070++){if(_0x52960a[_0x489070]['email']===_0x1f56a3[_0xfd7f('0x1d')]){_0x343bd8=!![];_0x1f56a3[_0xfd7f('0x1f')]=_0x52960a[_0x489070]['id'];logger['info']('User\x20found:',_0x1f56a3[_0xfd7f('0x1f')]);}}}if(!_0x343bd8){logger['info'](_0xfd7f('0x20'));_0x1f56a3[_0xfd7f('0x21')]=_0x1f56a3['adminEmail'];_0x1f56a3[_0xfd7f('0x1f')]=_0x1f56a3[_0xfd7f('0x17')];_0x343bd8=!![];}if(_0x343bd8){_0x1f390e(_0x1f56a3);}else{_0x3e041c({'statusCode':0x194,'message':_0xfd7f('0x18')});}}else{_0x3e041c({'statusCode':0x194,'message':_0xfd7f('0x18')});}})['catch'](function(_0x1dfb45){logger['error']('['+[_0x770ae0['toUpperCase']()]+']',_0x1dfb45[_0xfd7f('0x1c')]);_0x3e041c(_0x1dfb45);});});};}function searchContact(_0x352769,_0x19d187,_0x445496,_0x4bc333){return new Promise(function(_0x46bcec,_0x5e217d){var _0x4fab31={'method':_0xfd7f('0xd'),'headers':_0x19d187,'uri':_0x352769+_0xfd7f('0x22')+_0x4bc333+'&f='+_0x445496+_0xfd7f('0x23'),'json':!![]};rp(_0x4fab31)['then'](function(_0x182781){var _0x56b335=_[_0xfd7f('0x24')](_0x182781[_0xfd7f('0x25')]['contacts'],[_0x445496,_0x4bc333]);_0x46bcec(_0x56b335);})[_0xfd7f('0x19')](function(_0x51d53d){_0x5e217d(_0x51d53d);});});}function getEndUser(_0x30bcf3,_0x3ea392,_0x2e9adf){return function(_0x86653d){return new Promise(function(_0x4bafbd,_0x100287){logger[_0xfd7f('0x10')](util[_0xfd7f('0x26')](_0xfd7f('0x27'),_0x86653d[_0xfd7f('0x28')]));searchContact(_0x2e9adf,_0x3ea392,_0xfd7f('0x29'),_0x86653d[_0xfd7f('0x28')])[_0xfd7f('0x12')](function(_0x1c8719){if(_0x1c8719){_0x86653d[_0xfd7f('0x2a')]=_0x1c8719['id'];logger[_0xfd7f('0x10')]('Contact\x20found\x20mobile_number:',_0x86653d['endUserId']);return _0x4bafbd(_0x86653d);}searchContact(_0x2e9adf,_0x3ea392,_0xfd7f('0x2b'),_0x86653d['contactNumber'])[_0xfd7f('0x12')](function(_0x2ad18f){if(_0x2ad18f){_0x86653d[_0xfd7f('0x2a')]=_0x2ad18f['id'];logger[_0xfd7f('0x10')]('Contact\x20found\x20work_number:',_0x86653d['endUserId']);return _0x4bafbd(_0x86653d);}createEndUser(_0x86653d,_0x30bcf3,_0x3ea392,_0x2e9adf)[_0xfd7f('0x12')](function(_0xfa7547){logger[_0xfd7f('0x10')](_0xfd7f('0x2c'),_0xfa7547[_0xfd7f('0x2a')]);return _0x4bafbd(_0xfa7547);});});})[_0xfd7f('0x19')](function(_0x2e7a6c){_0x100287(_0x2e7a6c);});});};}function createEndUser(_0x2f5818,_0x3c0db3,_0x5eed2d,_0x29fd45){return new Promise(function(_0x1cbf2e,_0x5750ed){var _0x1a2c1a=moment();var _0x326b15={'method':_0xfd7f('0x2d'),'uri':_0x29fd45+'/api/contacts','body':{'contact':{'last_name':_0x2f5818[_0xfd7f('0x28')],'work_number':_0x2f5818[_0xfd7f('0x28')],'mobile_number':_0x2f5818['contactNumber'],'owner_id':_0x2f5818['userId'],'created_at':_0x1a2c1a[_0xfd7f('0x26')](_0xfd7f('0x2e'))}},'json':!![]};_0x326b15[_0xfd7f('0xf')]=_0x5eed2d;logger[_0xfd7f('0x10')](_0xfd7f('0x2f'));return rp(_0x326b15)['then'](function(_0x16c5e5){_0x2f5818[_0xfd7f('0x2a')]=_0x16c5e5[_0xfd7f('0x30')]['id'];_0x1cbf2e(_0x2f5818);})[_0xfd7f('0x19')](function(_0x3e3db7){logger[_0xfd7f('0x1a')]('['+[_0x3c0db3['toUpperCase']()]+']',_0x3e3db7[_0xfd7f('0x1c')]);_0x5750ed(_0x3e3db7[_0xfd7f('0x1c')]);});});}function getTicket(_0x459ad4,_0x42a06f,_0x4e3c98,_0x4d79d1,_0x2e3224){return function(_0x548b4a){logger['info'](_0xfd7f('0x31'));return new Promise(function(_0x21f281,_0x8ef9ad){var _0x3ddcf0=moment();var _0xce40d4={'method':_0xfd7f('0x2d'),'uri':_0x4e3c98+_0xfd7f('0x32'),'body':{'title':intUtil['getString'](_0x4d79d1[_0xfd7f('0x33')],_0x2e3224,'\x20'),'description':intUtil[_0xfd7f('0x34')](_0x4d79d1[_0xfd7f('0x35')],_0x2e3224,'\x0a'),'owner_id':_0x548b4a[_0xfd7f('0x1f')],'creater_id':_0x548b4a[_0xfd7f('0x17')],'targetable_id':_0x548b4a[_0xfd7f('0x2a')],'targetable_type':'Contact','created_at':_0x3ddcf0['format'](_0xfd7f('0x2e')),'due_date':_0x3ddcf0[_0xfd7f('0x36')](0x1e,'m')[_0xfd7f('0x26')](_0xfd7f('0x2e'))},'json':!![]};_0xce40d4[_0xfd7f('0xf')]=_0x42a06f;return rp(_0xce40d4)['then'](function(_0x1381c2){_0x548b4a[_0xfd7f('0x37')]=_0x1381c2[_0xfd7f('0x38')]['id'];logger[_0xfd7f('0x10')]('Task\x20created:',_0x548b4a[_0xfd7f('0x37')]);_0x21f281(_0x548b4a);})[_0xfd7f('0x19')](function(_0x106a1a){logger[_0xfd7f('0x1a')]('['+[_0x459ad4[_0xfd7f('0x1b')]()]+']',_0x106a1a[_0xfd7f('0x1c')]);_0x8ef9ad(_0x106a1a[_0xfd7f('0x1c')]);});});};}function emit(_0x1a5fe5,_0x118500,_0x3a1bac){var _0x4416d5={'uri':_0x1a5fe5+_0xfd7f('0x39')+_0x3a1bac};io['to'](util[_0xfd7f('0x26')]('user:%s',_0x118500))[_0xfd7f('0x3a')](_0xfd7f('0x3b'),_0x4416d5);}exports['cs']=function(_0x19a0e7,_0x3a559b,_0x4d1039,_0x51af57,_0x396839,_0x37429d,_0x1ef36f,_0x265750){var _0x4ee878={};var _0x490996={'Authorization':_0xfd7f('0x3c')+_0x37429d[_0xfd7f('0x3d')]};_0x37429d[_0xfd7f('0x3e')]=intUtil[_0xfd7f('0x3f')](_0x37429d[_0xfd7f('0x3e')]);_0x37429d[_0xfd7f('0x40')]=intUtil[_0xfd7f('0x3f')](_0x37429d[_0xfd7f('0x40')]);var _0x2cbc1f=_0x37429d[_0xfd7f('0x3e')];_0x4ee878[_0xfd7f('0x15')]=_0x37429d['username'];_0x4ee878[_0xfd7f('0x28')]=_0x265750[_0xfd7f('0x41')]()==='outbound'?_0x3a559b[_0xfd7f('0x42')]:_0x3a559b[_0xfd7f('0x43')];_0x4ee878[_0xfd7f('0x44')]=_0x265750===_0xfd7f('0x45')||_0x265750===_0xfd7f('0x46')?_0xfd7f('0x45'):_0xfd7f('0x47');if(_0x51af57){_0x4ee878[_0xfd7f('0x1d')]=_0x51af57[_0xfd7f('0x14')];}var _0xf1f13=util[_0xfd7f('0x26')](_0xfd7f('0x48'),_0x37429d[_0xfd7f('0x40')],_0x3a559b[_0xfd7f('0x49')],md5(_0x3a559b[_0xfd7f('0x49')]));if(_0x396839&&_0x396839[_0xfd7f('0x4a')]){logger[_0xfd7f('0x10')](_0xfd7f('0x4b'),_0xfd7f('0x4c'));_0x3a559b[_0xfd7f('0x4d')]=_0xf1f13;}else if(_0x1ef36f&&_0x1ef36f[_0xfd7f('0x4e')]&&_0x1ef36f[_0xfd7f('0x4e')]!==_0xfd7f('0x4f')){logger[_0xfd7f('0x10')]('[OUTBOUND]',_0xfd7f('0x4c'));_0x3a559b[_0xfd7f('0x4d')]=_0xf1f13;}else{_0x3a559b[_0xfd7f('0x4d')]='';}return getAdminId(_0x4ee878,_0x265750,_0x490996,_0x2cbc1f)[_0xfd7f('0x12')](getUser(_0x265750,_0x490996,_0x2cbc1f))['then'](getEndUser(_0x265750,_0x490996,_0x2cbc1f))['then'](getTicket(_0x265750,_0x490996,_0x2cbc1f,_0x4d1039,_0x3a559b))[_0xfd7f('0x12')](function(_0x6f9412){logger['info'](util[_0xfd7f('0x26')](_0xfd7f('0x50'),_0x6f9412['ticketId']));if(_0x265750!==_0xfd7f('0x46')){logger[_0xfd7f('0x10')]('['+[_0x265750['toUpperCase']()]+']',_0xfd7f('0x51'));emit(_0x2cbc1f,_0x51af57[_0xfd7f('0x52')],_0x6f9412[_0xfd7f('0x2a')]);}})['catch'](function(_0x37b136){logger['error']('['+[_0x265750[_0xfd7f('0x1b')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util['inspect'](_0x37b136,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js index a1f758d..63d2b7c 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 _0xd2a4=['toLowerCase','data2','find','Configurations','data3','outbound','log','EVENT\x20UNKNOWN','unmanaged','data1','salesforce','unknown\x20integration','../../../../config/logger','format','%s\x20configuration\x20#%s\x20not\x20found','error','[EXEC]','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./freshdesk','./zoho','./desk','./servicenow','./dynamics365','./freshsales','zendesk','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes'];(function(_0x3d6c3a,_0x37855c){var _0x13de15=function(_0xbe2a7c){while(--_0xbe2a7c){_0x3d6c3a['push'](_0x3d6c3a['shift']());}};_0x13de15(++_0x37855c);}(_0xd2a4,0x15f));var _0x4d2a=function(_0x35e2d7,_0x39e854){_0x35e2d7=_0x35e2d7-0x0;var _0x405bff=_0xd2a4[_0x35e2d7];return _0x405bff;};'use strict';var _=require(_0x4d2a('0x0'));var util=require('util');var zendesk=require(_0x4d2a('0x1'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x4d2a('0x2'));var zoho=require(_0x4d2a('0x3'));var desk=require(_0x4d2a('0x4'));var vtiger=require('./vtiger');var servicenow=require(_0x4d2a('0x5'));var dynamics365=require(_0x4d2a('0x6'));var freshsales=require(_0x4d2a('0x7'));var integrations=[_0x4d2a('0x8'),'salesforce',_0x4d2a('0x9'),_0x4d2a('0xa'),_0x4d2a('0xb'),_0x4d2a('0xc'),_0x4d2a('0xd'),_0x4d2a('0xe'),_0x4d2a('0xf'),_0x4d2a('0x10')];exports[_0x4d2a('0x11')]=function(_0x3d137b,_0x5e2b24,_0x5beea4,_0x408dbe,_0x4e507e,_0x457e68){if(_0x5beea4){if(_[_0x4d2a('0x12')](integrations,_0x3d137b['data1']['toLowerCase']())){try{var _0x9c488d=null;var _0x180f20='';var _0x3e33bb=_0x5beea4[_0x3d137b['data1'][_0x4d2a('0x13')]()];if(_0x3e33bb){var _0x195598=_0x3e33bb[_0x3d137b[_0x4d2a('0x14')]];if(_0x195598){var _0x3b674c=_[_0x4d2a('0x15')](_0x195598[_0x4d2a('0x16')],{'id':parseInt(_0x3d137b[_0x4d2a('0x17')],0xa)});if(_0x3b674c){if(_0x408dbe){if(_0x4e507e&&_0x5e2b24['queue']){_0x180f20='queue';}else if(_0x5e2b24['routeId']){_0x180f20=_0x4d2a('0x18');}else{console[_0x4d2a('0x19')](_0x4d2a('0x1a'),_0x5e2b24);}}else{_0x180f20=_0x4d2a('0x1b');}switch(_0x3d137b[_0x4d2a('0x1c')][_0x4d2a('0x13')]()){case _0x4d2a('0x8'):zendesk[_0x180f20](_0x3d137b,_0x5e2b24,_0x3b674c,_0x408dbe,_0x4e507e,_0x195598,_0x457e68);break;case _0x4d2a('0x1d'):salesforce[_0x180f20](_0x3d137b,_0x5e2b24,_0x3b674c,_0x408dbe,_0x4e507e,_0x195598,_0x457e68);break;case'sugarcrm':sugarcrm[_0x180f20](_0x3d137b,_0x5e2b24,_0x3b674c,_0x408dbe,_0x4e507e,_0x195598,_0x457e68);break;case'freshdesk':freshdesk[_0x180f20](_0x3d137b,_0x5e2b24,_0x3b674c,_0x408dbe,_0x4e507e,_0x195598,_0x457e68);break;case _0x4d2a('0xb'):zoho[_0x180f20](_0x3d137b,_0x5e2b24,_0x3b674c,_0x408dbe,_0x4e507e,_0x195598,_0x457e68);break;case'desk':desk[_0x180f20](_0x3d137b,_0x5e2b24,_0x3b674c,_0x408dbe,_0x4e507e,_0x195598,_0x457e68);break;case _0x4d2a('0xd'):vtiger[_0x180f20](_0x3d137b,_0x5e2b24,_0x3b674c,_0x408dbe,_0x4e507e,_0x195598,_0x457e68);break;case _0x4d2a('0xf'):freshsales['cs'](_0x3d137b,_0x5e2b24,_0x3b674c,_0x408dbe,_0x4e507e,_0x195598,_0x457e68,_0x180f20);break;case _0x4d2a('0x10'):servicenow['cs'](_0x3d137b,_0x5e2b24,_0x3b674c,_0x408dbe,_0x4e507e,_0x195598,_0x457e68,_0x180f20);break;case _0x4d2a('0xe'):dynamics365['cs'](_0x3d137b,_0x5e2b24,_0x3b674c,_0x408dbe,_0x4e507e,_0x195598,_0x457e68,_0x180f20);break;default:console[_0x4d2a('0x19')](_0x4d2a('0x1e'));}}else{_0x9c488d=require(_0x4d2a('0x1f'))(_0x3d137b[_0x4d2a('0x1c')][_0x4d2a('0x13')]());_0x9c488d['error']('[EXEC]',util[_0x4d2a('0x20')](_0x4d2a('0x21'),_0x3d137b[_0x4d2a('0x1c')][_0x4d2a('0x13')](),_0x3d137b[_0x4d2a('0x17')]));}}else{_0x9c488d=require(_0x4d2a('0x1f'))(_0x3d137b['data1'][_0x4d2a('0x13')]());_0x9c488d[_0x4d2a('0x22')](_0x4d2a('0x23'),util['format'](_0x4d2a('0x24'),_0x3d137b[_0x4d2a('0x1c')][_0x4d2a('0x13')](),_0x3d137b['data2']));}}else{}}catch(_0x3f8775){console[_0x4d2a('0x22')](_0x3f8775);}}}}; \ No newline at end of file +var _0xed20=['freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','EVENT\x20UNKNOWN','vtiger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./freshsales','zendesk','sugarcrm','freshdesk','zoho','desk','dynamics365'];(function(_0x48d1b7,_0x1b7aa5){var _0x2c7509=function(_0x4393eb){while(--_0x4393eb){_0x48d1b7['push'](_0x48d1b7['shift']());}};_0x2c7509(++_0x1b7aa5);}(_0xed20,0xce));var _0x0ed2=function(_0x580a17,_0xbaae01){_0x580a17=_0x580a17-0x0;var _0x5b8dfd=_0xed20[_0x580a17];return _0x5b8dfd;};'use strict';var _=require(_0x0ed2('0x0'));var util=require(_0x0ed2('0x1'));var zendesk=require(_0x0ed2('0x2'));var salesforce=require('./salesforce');var sugarcrm=require(_0x0ed2('0x3'));var freshdesk=require(_0x0ed2('0x4'));var zoho=require(_0x0ed2('0x5'));var desk=require(_0x0ed2('0x6'));var vtiger=require(_0x0ed2('0x7'));var servicenow=require(_0x0ed2('0x8'));var dynamics365=require('./dynamics365');var freshsales=require(_0x0ed2('0x9'));var integrations=[_0x0ed2('0xa'),'salesforce',_0x0ed2('0xb'),_0x0ed2('0xc'),_0x0ed2('0xd'),_0x0ed2('0xe'),'vtiger',_0x0ed2('0xf'),_0x0ed2('0x10'),_0x0ed2('0x11')];exports[_0x0ed2('0x12')]=function(_0x48f0aa,_0x4d6fe2,_0x36bd70,_0x1a3885,_0x245e65,_0x14689b){if(_0x36bd70){if(_[_0x0ed2('0x13')](integrations,_0x48f0aa[_0x0ed2('0x14')][_0x0ed2('0x15')]())){try{var _0x191b26=null;var _0x3cc6b4='';var _0x342768=_0x36bd70[_0x48f0aa[_0x0ed2('0x14')][_0x0ed2('0x15')]()];if(_0x342768){var _0x52c70b=_0x342768[_0x48f0aa[_0x0ed2('0x16')]];if(_0x52c70b){var _0x3b0f4b=_[_0x0ed2('0x17')](_0x52c70b[_0x0ed2('0x18')],{'id':parseInt(_0x48f0aa[_0x0ed2('0x19')],0xa)});if(_0x3b0f4b){if(_0x1a3885){if(_0x245e65&&_0x4d6fe2['queue']){_0x3cc6b4=_0x0ed2('0x1a');}else if(_0x4d6fe2[_0x0ed2('0x1b')]){_0x3cc6b4=_0x0ed2('0x1c');}else{console['log'](_0x0ed2('0x1d'),_0x4d6fe2);}}else{_0x3cc6b4='unmanaged';}switch(_0x48f0aa[_0x0ed2('0x14')][_0x0ed2('0x15')]()){case _0x0ed2('0xa'):zendesk[_0x3cc6b4](_0x48f0aa,_0x4d6fe2,_0x3b0f4b,_0x1a3885,_0x245e65,_0x52c70b,_0x14689b);break;case'salesforce':salesforce[_0x3cc6b4](_0x48f0aa,_0x4d6fe2,_0x3b0f4b,_0x1a3885,_0x245e65,_0x52c70b,_0x14689b);break;case'sugarcrm':sugarcrm[_0x3cc6b4](_0x48f0aa,_0x4d6fe2,_0x3b0f4b,_0x1a3885,_0x245e65,_0x52c70b,_0x14689b);break;case _0x0ed2('0xc'):freshdesk[_0x3cc6b4](_0x48f0aa,_0x4d6fe2,_0x3b0f4b,_0x1a3885,_0x245e65,_0x52c70b,_0x14689b);break;case _0x0ed2('0xd'):zoho[_0x3cc6b4](_0x48f0aa,_0x4d6fe2,_0x3b0f4b,_0x1a3885,_0x245e65,_0x52c70b,_0x14689b);break;case'desk':desk[_0x3cc6b4](_0x48f0aa,_0x4d6fe2,_0x3b0f4b,_0x1a3885,_0x245e65,_0x52c70b,_0x14689b);break;case _0x0ed2('0x1e'):vtiger[_0x3cc6b4](_0x48f0aa,_0x4d6fe2,_0x3b0f4b,_0x1a3885,_0x245e65,_0x52c70b,_0x14689b);break;case'freshsales':freshsales['cs'](_0x48f0aa,_0x4d6fe2,_0x3b0f4b,_0x1a3885,_0x245e65,_0x52c70b,_0x14689b,_0x3cc6b4);break;case _0x0ed2('0x11'):servicenow['cs'](_0x48f0aa,_0x4d6fe2,_0x3b0f4b,_0x1a3885,_0x245e65,_0x52c70b,_0x14689b,_0x3cc6b4);break;case _0x0ed2('0xf'):dynamics365['cs'](_0x48f0aa,_0x4d6fe2,_0x3b0f4b,_0x1a3885,_0x245e65,_0x52c70b,_0x14689b,_0x3cc6b4);break;default:console['log']('unknown\x20integration');}}else{_0x191b26=require('../../../../config/logger')(_0x48f0aa[_0x0ed2('0x14')][_0x0ed2('0x15')]());_0x191b26[_0x0ed2('0x1f')](_0x0ed2('0x20'),util[_0x0ed2('0x21')](_0x0ed2('0x22'),_0x48f0aa[_0x0ed2('0x14')]['toLowerCase'](),_0x48f0aa['data3']));}}else{_0x191b26=require(_0x0ed2('0x23'))(_0x48f0aa[_0x0ed2('0x14')][_0x0ed2('0x15')]());_0x191b26[_0x0ed2('0x1f')](_0x0ed2('0x20'),util[_0x0ed2('0x21')](_0x0ed2('0x24'),_0x48f0aa[_0x0ed2('0x14')]['toLowerCase'](),_0x48f0aa[_0x0ed2('0x16')]));}}else{}}catch(_0x24983e){console[_0x0ed2('0x1f')](_0x24983e);}}}}; \ 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 ea43bf6..25206cd 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 _0x5925=['recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','toUpperCase',']\x20Ticket\x20%s\x20created.','lastevent','lodash','request-promise','moment','md5','jsforce','util','ioredis','./util','../../../../config/environment','localhost','socket.io-emitter','redis','getString','Subjects','Descriptions','ticketType','Task','IsReminderSet','endUserType','contact','lead','WhoId','account','ContactId','info','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','isNil','validateEmail','execute','then','length','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','find','additionalSearchLead','account_contact_lead','additionalSearchAccount','Account','Lead','first','Phone','attributes','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','moduleCreate','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','toLowerCase','name','password','concat','securityToken','remoteUri','clientId','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!'];(function(_0x2c3182,_0x252ce0){var _0x3b76fe=function(_0x337626){while(--_0x337626){_0x2c3182['push'](_0x2c3182['shift']());}};_0x3b76fe(++_0x252ce0);}(_0x5925,0x118));var _0x5592=function(_0x547587,_0x48cbd9){_0x547587=_0x547587-0x0;var _0x3d7777=_0x5925[_0x547587];return _0x3d7777;};'use strict';var _=require(_0x5592('0x0'));var rp=require(_0x5592('0x1'));var moment=require(_0x5592('0x2'));var BPromise=require('bluebird');var md5=require(_0x5592('0x3'));var jsforce=require(_0x5592('0x4'));var util=require(_0x5592('0x5'));var Redis=require(_0x5592('0x6'));var intUtil=require(_0x5592('0x7'));var config=require(_0x5592('0x8'));var logger=require('../../../../config/logger')('salesforce');config['redis']=_['defaults'](config['redis'],{'host':_0x5592('0x9'),'port':0x18eb});var io=require(_0x5592('0xa'))(new Redis(config[_0x5592('0xb')]));function emit(_0x9403a7,_0x5f2e8e,_0x1128ca){io['to'](_0x9403a7)['emit'](_0x5f2e8e,_0x1128ca);}function getTicket(_0x108bfc,_0x2c7231,_0x57c616,_0x30f065,_0x2e299c,_0x350ba4,_0xa9e5e5,_0x52a165){var _0x4123f7=Object['assign']({},{'OwnerId':_0x2c7231['id'],'Subject':intUtil[_0x5592('0xc')](_0x30f065[_0x5592('0xd')],_0x2e299c,'\x20'),'Description':intUtil['getString'](_0x30f065[_0x5592('0xe')],_0x2e299c,'\x0a')},getCustomFields(_0x350ba4,_0x2e299c));if(_0x57c616){if(_0x30f065[_0x5592('0xf')]===_0x5592('0x10')){_0x4123f7['ActivityDate']=moment['utc']();_0x4123f7[_0x5592('0x11')]=![];_0x4123f7['IsRecurrence']=![];if(_0x57c616[_0x5592('0x12')]===_0x5592('0x13')||_0x57c616[_0x5592('0x12')]===_0x5592('0x14')){_0x4123f7[_0x5592('0x15')]=_0x57c616['id'];}else if(_0x57c616[_0x5592('0x12')]===_0x5592('0x16')){_0x4123f7['WhatId']=_0x57c616['id'];}}else if(_0x30f065[_0x5592('0xf')]==='Case'){if(_0x57c616[_0x5592('0x12')]===_0x5592('0x13')){_0x4123f7[_0x5592('0x17')]=_0x57c616['id'];}else if(_0x57c616[_0x5592('0x12')]===_0x5592('0x16')){_0x4123f7['AccountId']=_0x57c616['id'];}else if(_0x57c616[_0x5592('0x12')]===_0x5592('0x14')&&_0x30f065['leadId']){_0x4123f7[_0x30f065['leadId']]=_0x57c616['id'];}else{logger[_0x5592('0x18')](_0x5592('0x19'));}}}return _0xa9e5e5[_0x5592('0x1a')](_0x30f065[_0x5592('0xf')])[_0x5592('0x1b')](_0x4123f7);}function getUser(_0x538ffd,_0x2b84ce,_0x45a8b0){if(!_[_0x5592('0x1c')](_0x2b84ce)&&intUtil[_0x5592('0x1d')](_0x2b84ce)){var _0x514519={'Email':_0x2b84ce};var _0x1eef1f={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x45a8b0[_0x5592('0x1a')]('User')['find'](_0x514519,_0x1eef1f)[_0x5592('0x1e')]()[_0x5592('0x1f')](function(_0x357d1a){if(_0x357d1a[_0x5592('0x20')]){var _0x2162e0=_['find'](_0x357d1a,function(_0x1d4ff1){return _0x1d4ff1['Email']===_0x2b84ce;});if(_0x2162e0){logger[_0x5592('0x18')](_0x5592('0x21'),_0x2b84ce);return BPromise['resolve']({'id':_0x2162e0['Id'],'name':_0x2162e0[_0x5592('0x22')]});}}else{logger[_0x5592('0x18')](_0x5592('0x23'),_0x2b84ce);return _0x45a8b0[_0x5592('0x24')]()[_0x5592('0x1f')](function(_0x2c02fe){return BPromise[_0x5592('0x25')]({'id':_0x2c02fe[_0x5592('0x26')],'name':_0x2c02fe[_0x5592('0x27')]});});}});}else{logger['info'](_0x5592('0x23'),_0x2b84ce);return _0x45a8b0[_0x5592('0x24')]()[_0x5592('0x1f')](function(_0x4eee9e){return BPromise[_0x5592('0x25')]({'id':_0x4eee9e[_0x5592('0x26')],'name':_0x4eee9e[_0x5592('0x27')]});});}}function getEndUser(_0x152548,_0x30590f,_0xaca15a,_0x54d8f2,_0x5aa002){var _0x4a6650={'$or':{'Phone':_0x54d8f2}};var _0x22b44a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x5592('0x25')]()[_0x5592('0x1f')](function(){logger[_0x5592('0x18')](_0x5592('0x28'),_0x54d8f2,_0x30590f[_0x5592('0x29')]);switch(_0x30590f['moduleSearch']){case _0x5592('0x2a'):var _0x4dbe9f=_[_0x5592('0x2b')](_0x4a6650);if(_0x30590f[_0x5592('0x2c')]){var _0x461cf2={};_0x461cf2[_0x30590f['additionalSearchContact']]=_0x54d8f2;_[_0x5592('0x2d')](_0x4dbe9f[_0x5592('0x2e')],_0x461cf2);}return _0x5aa002[_0x5592('0x1a')](_0x5592('0x2f'))[_0x5592('0x30')](_0x4dbe9f,_0x22b44a)[_0x5592('0x1e')]()[_0x5592('0x1f')](function(_0x58f8ce){if(_0x58f8ce&&_0x58f8ce['length']){return _0x58f8ce;}else{var _0x353385=_['cloneDeep'](_0x4a6650);if(_0x30590f[_0x5592('0x31')]){var _0x4b27f7={};_0x4b27f7[_0x30590f[_0x5592('0x31')]]=_0x54d8f2;_[_0x5592('0x2d')](_0x353385[_0x5592('0x2e')],_0x4b27f7);}return _0x5aa002['sobject']('Lead')['find'](_0x353385,_0x22b44a);}});case _0x5592('0x32'):var _0xab1a6c=_['cloneDeep'](_0x4a6650);if(_0x30590f[_0x5592('0x33')]){var _0x461cf2={};_0x461cf2[_0x30590f['additionalSearchAccount']]=_0x54d8f2;_[_0x5592('0x2d')](_0xab1a6c[_0x5592('0x2e')],_0x461cf2);}return _0x5aa002['sobject'](_0x5592('0x34'))[_0x5592('0x30')](_0xab1a6c,_0x22b44a)['execute']()[_0x5592('0x1f')](function(_0x210de8){if(_0x210de8&&_0x210de8[_0x5592('0x20')]){return _0x210de8;}else{var _0x2a82bc=_[_0x5592('0x2b')](_0x4a6650);if(_0x30590f[_0x5592('0x2c')]){var _0x37aebe={};_0x37aebe[_0x30590f[_0x5592('0x2c')]]=_0x54d8f2;_[_0x5592('0x2d')](_0x2a82bc[_0x5592('0x2e')],_0x37aebe);}return _0x5aa002['sobject'](_0x5592('0x2f'))[_0x5592('0x30')](_0x2a82bc,_0x22b44a)[_0x5592('0x1f')](function(_0x2597a2){if(_0x2597a2&&_0x2597a2[_0x5592('0x20')]){return _0x2597a2;}else{var _0x3cf79a=_[_0x5592('0x2b')](_0x4a6650);if(_0x30590f[_0x5592('0x31')]){var _0x317e8c={};_0x317e8c[_0x30590f[_0x5592('0x31')]]=_0x54d8f2;_[_0x5592('0x2d')](_0x3cf79a[_0x5592('0x2e')],_0x317e8c);}return _0x5aa002['sobject'](_0x5592('0x35'))['find'](_0x3cf79a,_0x22b44a);}});}});case'contact':var _0x4dbe9f=_[_0x5592('0x2b')](_0x4a6650);if(_0x30590f[_0x5592('0x2c')]){var _0x461cf2={};_0x461cf2[_0x30590f[_0x5592('0x2c')]]=_0x54d8f2;_['merge'](_0x4dbe9f[_0x5592('0x2e')],_0x461cf2);}return _0x5aa002[_0x5592('0x1a')](_0x5592('0x2f'))[_0x5592('0x30')](_0x4dbe9f,_0x22b44a)['execute']();case _0x5592('0x14'):var _0x52060d=_[_0x5592('0x2b')](_0x4a6650);if(_0x30590f['additionalSearchLead']){var _0x461cf2={};_0x461cf2[_0x30590f[_0x5592('0x31')]]=_0x54d8f2;_[_0x5592('0x2d')](_0x52060d[_0x5592('0x2e')],_0x461cf2);}return _0x5aa002[_0x5592('0x1a')](_0x5592('0x35'))[_0x5592('0x30')](_0x52060d,_0x22b44a);case _0x5592('0x16'):var _0xab1a6c=_[_0x5592('0x2b')](_0x4a6650);if(_0x30590f[_0x5592('0x33')]){var _0x461cf2={};_0x461cf2[_0x30590f[_0x5592('0x33')]]=_0x54d8f2;_[_0x5592('0x2d')](_0xab1a6c['$or'],_0x461cf2);}return _0x5aa002[_0x5592('0x1a')](_0x5592('0x34'))[_0x5592('0x30')](_0xab1a6c,_0x22b44a);default:return null;}})['then'](function(_0x360d2e){if(_0x360d2e&&_0x360d2e[_0x5592('0x20')]){var _0x26c09e=_[_0x5592('0x36')](_0x360d2e);if(_0x26c09e){return BPromise[_0x5592('0x25')]({'id':_0x26c09e['Id'],'name':_0x26c09e[_0x5592('0x22')],'phone':_0x26c09e[_0x5592('0x37')],'endUserType':_0x26c09e[_0x5592('0x38')]['type']['toLowerCase']()});}}})[_0x5592('0x1f')](function(_0x24b4ed){if(_0x24b4ed){logger[_0x5592('0x18')](_0x5592('0x39'),_0x24b4ed[_0x5592('0x12')],_0x54d8f2);return BPromise[_0x5592('0x25')](_0x24b4ed);}else{logger[_0x5592('0x18')](_0x5592('0x3a'),_0x54d8f2);var _0x1af2da={'Phone':_0x54d8f2};if(_0x30590f['moduleCreate']){if(_0x30590f['moduleCreate']===_0x5592('0x13')){logger[_0x5592('0x18')](_0x5592('0x3b'),_0x54d8f2,_0x30590f[_0x5592('0x3c')]);_0x1af2da[_0x5592('0x3d')]=_0xaca15a!==_0x5592('0x3e')?_0xaca15a:util[_0x5592('0x3f')](_0x5592('0x40'),_0x54d8f2);}else if(_0x30590f[_0x5592('0x3c')]===_0x5592('0x14')){logger[_0x5592('0x18')](_0x5592('0x3b'),_0x54d8f2,_0x30590f[_0x5592('0x3c')]);_0x1af2da[_0x5592('0x3d')]=_0xaca15a!==_0x5592('0x3e')?_0xaca15a:util[_0x5592('0x3f')]('Caller\x20-\x20%s',_0x54d8f2);_0x1af2da[_0x5592('0x41')]=_0x5592('0x42');}else if(_0x30590f[_0x5592('0x3c')]===_0x5592('0x16')){logger[_0x5592('0x18')](_0x5592('0x3b'),_0x54d8f2,_0x30590f[_0x5592('0x3c')]);_0x1af2da[_0x5592('0x22')]=_0xaca15a!==_0x5592('0x3e')?_0xaca15a:util['format'](_0x5592('0x40'),_0x54d8f2);}else{return null;}}return _0x5aa002[_0x5592('0x1a')](_[_0x5592('0x43')](_0x30590f[_0x5592('0x3c')]))['create'](_0x1af2da)[_0x5592('0x1f')](function(_0x4e6e2d){return BPromise[_0x5592('0x25')]({'id':_0x4e6e2d['id'],'endUserType':_0x30590f[_0x5592('0x3c')]});});}});}function getCustomFields(_0x3f3229,_0x29509a){var _0x3af0ff={};if(_0x3f3229[_0x5592('0x20')]>0x0){_[_0x5592('0x44')](_0x3f3229,function(_0x4ec007){if(_[_0x5592('0x45')]([_0x5592('0x46'),_0x5592('0x47')],_0x4ec007[_0x5592('0x48')])&&_0x4ec007['idField']){_0x3af0ff[_0x4ec007[_0x5592('0x49')]]=_0x4ec007[_0x5592('0x4a')][_0x5592('0x4b')]();}else if(_0x4ec007['type']===_0x5592('0x4c')&&_0x4ec007[_0x5592('0x4d')]&&_0x4ec007[_0x5592('0x49')]){_0x29509a[_0x4ec007[_0x5592('0x4d')]]&&(_0x3af0ff[_0x4ec007[_0x5592('0x49')]]=_0x29509a[_0x4ec007[_0x5592('0x4d')]]['toString']());}else if(_0x4ec007[_0x5592('0x48')]===_0x5592('0x4e')&&_0x4ec007[_0x5592('0x4f')]&&_0x4ec007['Variable']['name']&&_0x4ec007['idField']){_0x29509a[_0x4ec007[_0x5592('0x4f')]['name'][_0x5592('0x50')]()]&&(_0x3af0ff[_0x4ec007[_0x5592('0x49')]]=_0x29509a[_0x4ec007[_0x5592('0x4f')][_0x5592('0x51')][_0x5592('0x50')]()]['toString']());}});}return _0x3af0ff;}function getConnection(_0x46a396){var _0x59e700=_0x46a396[_0x5592('0x52')][_0x5592('0x53')](_0x46a396[_0x5592('0x54')]);var _0x58eacc=new jsforce['Connection']({'oauth2':{'loginUrl':_0x46a396[_0x5592('0x55')]||'https://login.salesforce.com','clientId':_0x46a396[_0x5592('0x56')],'clientSecret':_0x46a396[_0x5592('0x57')]}});return _0x58eacc[_0x5592('0x58')](_0x46a396[_0x5592('0x59')],_0x59e700)['then'](function(){logger[_0x5592('0x18')](_0x5592('0x5a'));return _0x58eacc;});}exports['queue']=function(_0x3b4674,_0xac008f,_0x5de7f6,_0xb878ab,_0xfb142f,_0x3fca90){var _0x42621d,_0x59b1fb,_0x5562ee,_0x2287c3;_0x3fca90[_0x5592('0x5b')]=intUtil[_0x5592('0x5c')](_0x3fca90['serverUrl']);_0x3fca90[_0x5592('0x55')]=intUtil['stripTrailingSlash'](_0x3fca90['remoteUri']);if(_0xfb142f&&_0xfb142f['monitor_format']){logger[_0x5592('0x18')](_0x5592('0x5d'),_0x5592('0x5e'));_0xac008f[_0x5592('0x5f')]=util['format'](_0x5592('0x60'),_0x3fca90[_0x5592('0x5b')],_0xac008f[_0x5592('0x61')],md5(_0xac008f[_0x5592('0x61')]));}else{_0xac008f[_0x5592('0x5f')]='';}return getConnection(_0x3fca90)[_0x5592('0x1f')](function(_0x2d5239){_0x2287c3=_0x2d5239;return getUser(_0x3fca90,_0xb878ab[_0x5592('0x62')],_0x2287c3);})[_0x5592('0x1f')](function(_0x32d9ba){_0x42621d=_0x32d9ba;return getEndUser(_0x3fca90,_0x5de7f6,_0xac008f[_0x5592('0x63')],_0xac008f[_0x5592('0x64')],_0x2287c3);})[_0x5592('0x1f')](function(_0x46cc22){_0x59b1fb=_0x46cc22;return getTicket(_0x3fca90,_0x42621d,_0x59b1fb,_0x5de7f6,_0xac008f,_0x5de7f6[_0x5592('0x65')],_0x2287c3,'queue');})[_0x5592('0x1f')](function(_0x1ba6a4){_0x5562ee=_0x1ba6a4;logger[_0x5592('0x18')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x5562ee['id']);logger[_0x5592('0x18')](_0x5592('0x66'),_0x5562ee['id'],_0xb878ab[_0x5592('0x51')],_0x3fca90['type']);switch(_0x3fca90['type']){case _0x5592('0x67'):emit(util[_0x5592('0x3f')]('user:%s',_0xb878ab['name']),_0x5592('0x68'),{'recordId':_0x5562ee['id']});break;case _0x5592('0x69'):emit(util[_0x5592('0x3f')](_0x5592('0x6a'),_0xb878ab[_0x5592('0x51')]),_0x5592('0x6b'),{'uri':util[_0x5592('0x3f')](_0x5592('0x6c'),_0x2287c3[_0x5592('0x6d')],_0x5562ee['id'])});break;default:logger[_0x5592('0x6e')](_0x5592('0x6f'));}})[_0x5592('0x70')](function(_0x291345){logger['error'](_0x5592('0x5d'),_0x291345);});};exports['outbound']=function(_0x4149a3,_0x575d45,_0x17e679,_0x1544ef,_0x1e2bc7,_0x567a45,_0x25dbf6){var _0x2ace8d,_0x458d36,_0x3d9e91,_0x2bda44;_0x567a45[_0x5592('0x5b')]=intUtil[_0x5592('0x5c')](_0x567a45['serverUrl']);_0x567a45[_0x5592('0x55')]=intUtil[_0x5592('0x5c')](_0x567a45['remoteUri']);if(_0x25dbf6&&_0x25dbf6['recordingFormat']&&_0x25dbf6[_0x5592('0x71')]!==_0x5592('0x72')){logger[_0x5592('0x18')](_0x5592('0x73'),_0x5592('0x5e'));_0x575d45[_0x5592('0x5f')]=util[_0x5592('0x3f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x567a45['serverUrl'],_0x575d45[_0x5592('0x61')],md5(_0x575d45[_0x5592('0x61')]));}return getConnection(_0x567a45)[_0x5592('0x1f')](function(_0x254eef){_0x2bda44=_0x254eef;return getUser(_0x567a45,_0x1544ef[_0x5592('0x62')],_0x2bda44);})[_0x5592('0x1f')](function(_0x365aa9){_0x2ace8d=_0x365aa9;return getEndUser(_0x567a45,_0x17e679,_0x575d45[_0x5592('0x74')],_0x575d45[_0x5592('0x75')],_0x2bda44);})[_0x5592('0x1f')](function(_0x1db8b6){_0x458d36=_0x1db8b6;return getTicket(_0x567a45,_0x2ace8d,_0x458d36,_0x17e679,_0x575d45,_0x17e679[_0x5592('0x65')],_0x2bda44,_0x5592('0x76'));})[_0x5592('0x1f')](function(_0x270cf4){_0x3d9e91=_0x270cf4;logger['info'](_0x5592('0x77'),_0x3d9e91['id']);logger[_0x5592('0x18')](_0x5592('0x78'),_0x3d9e91['id'],_0x1544ef['name'],_0x567a45[_0x5592('0x48')]);switch(_0x567a45[_0x5592('0x48')]){case _0x5592('0x67'):emit(util[_0x5592('0x3f')](_0x5592('0x6a'),_0x1544ef[_0x5592('0x51')]),_0x5592('0x68'),{'recordId':_0x3d9e91['id']});break;case _0x5592('0x69'):emit(util[_0x5592('0x3f')]('user:%s',_0x1544ef[_0x5592('0x51')]),_0x5592('0x6b'),{'uri':util[_0x5592('0x3f')](_0x5592('0x6c'),_0x2bda44[_0x5592('0x6d')],_0x3d9e91['id'])});break;default:logger[_0x5592('0x6e')](_0x5592('0x73'),_0x5592('0x79'));}})[_0x5592('0x70')](function(_0x302fe4){logger['error'](_0x5592('0x73'),_0x302fe4);});};exports['unmanaged']=function(_0x3ed46e,_0x2b42ec,_0x5707e5,_0x255642,_0x4658a4,_0x27fef4){var _0x34e2a2,_0x15eaaf,_0xad0262,_0x5663a2;_0x27fef4[_0x5592('0x5b')]=intUtil['stripTrailingSlash'](_0x27fef4[_0x5592('0x5b')]);_0x27fef4[_0x5592('0x55')]=intUtil[_0x5592('0x5c')](_0x27fef4[_0x5592('0x55')]);if(_0x4658a4&&_0x4658a4['monitor_format']){logger[_0x5592('0x18')]('['+_0x2b42ec['lastevent'][_0x5592('0x7a')]()+']',_0x5592('0x5e'));_0x2b42ec['recordingURL']=util[_0x5592('0x3f')](_0x5592('0x60'),_0x27fef4[_0x5592('0x5b')],_0x2b42ec['uniqueid'],md5(_0x2b42ec[_0x5592('0x61')]));}else{_0x2b42ec[_0x5592('0x5f')]='';}return getConnection(_0x27fef4)[_0x5592('0x1f')](function(_0x56d23e){_0x5663a2=_0x56d23e;if(!_[_0x5592('0x1c')](_0x255642)){return getUser(_0x27fef4,_0x255642[_0x5592('0x51')],_0x5663a2);}else{return getUser(_0x27fef4,null,_0x5663a2);}})[_0x5592('0x1f')](function(_0x50720a){_0x34e2a2=_0x50720a;return getEndUser(_0x27fef4,_0x5707e5,_0x2b42ec[_0x5592('0x63')],_0x2b42ec['calleridnum'],_0x5663a2);})[_0x5592('0x1f')](function(_0x2f64d9){_0x15eaaf=_0x2f64d9;return getTicket(_0x27fef4,_0x34e2a2,_0x15eaaf,_0x5707e5,_0x2b42ec,_0x5707e5['Fields'],_0x5663a2);})[_0x5592('0x1f')](function(_0x2b602c){_0xad0262=_0x2b602c;logger[_0x5592('0x18')]('['+_0x2b42ec['lastevent'][_0x5592('0x7a')]()+_0x5592('0x7b'),_0xad0262['id']);logger[_0x5592('0x18')]('['+_0x2b42ec['lastevent'][_0x5592('0x7a')]()+']\x20Integration\x20account\x20type\x20%s.',_0x27fef4['type']);})[_0x5592('0x70')](function(_0x40863a){logger[_0x5592('0x6e')]('['+_0x2b42ec[_0x5592('0x7c')][_0x5592('0x7a')]()+']',_0x40863a);});}; \ No newline at end of file +var _0x7643=['merge','additionalSearchLead','$or','additionalSearchAccount','Account','Contact','Lead','first','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','Caller\x20-\x20%s','Company','format','upperFirst','string','picklist','idField','content','toString','variableName','customVariable','Variable','name','securityToken','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','user:%s','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','[QUEUE]','outbound','recordingFormat','[OUTBOUND]','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','newTab','Salesforce\x20account\x20type\x20not\x20recognized','lastevent','toUpperCase','lodash','moment','bluebird','md5','jsforce','util','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','assign','Descriptions','Task','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','account','WhatId','ticketType','Case','ContactId','AccountId','leadId','info','sobject','create','isNil','User','find','execute','then','length','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact'];(function(_0x421c56,_0x4efd00){var _0x49b244=function(_0x5cd079){while(--_0x5cd079){_0x421c56['push'](_0x421c56['shift']());}};_0x49b244(++_0x4efd00);}(_0x7643,0x1be));var _0x3764=function(_0x345705,_0x2829c1){_0x345705=_0x345705-0x0;var _0x22c250=_0x7643[_0x345705];return _0x22c250;};'use strict';var _=require(_0x3764('0x0'));var rp=require('request-promise');var moment=require(_0x3764('0x1'));var BPromise=require(_0x3764('0x2'));var md5=require(_0x3764('0x3'));var jsforce=require(_0x3764('0x4'));var util=require(_0x3764('0x5'));var Redis=require('ioredis');var intUtil=require(_0x3764('0x6'));var config=require(_0x3764('0x7'));var logger=require(_0x3764('0x8'))('salesforce');config[_0x3764('0x9')]=_[_0x3764('0xa')](config[_0x3764('0x9')],{'host':_0x3764('0xb'),'port':0x18eb});var io=require(_0x3764('0xc'))(new Redis(config[_0x3764('0x9')]));function emit(_0x51943d,_0x272e1b,_0x5576b2){io['to'](_0x51943d)[_0x3764('0xd')](_0x272e1b,_0x5576b2);}function getTicket(_0x2a050b,_0x54efa1,_0x14f931,_0x448c01,_0x4c6385,_0x37fc16,_0x31d732,_0x386ec7){var _0x4dd6bf=Object[_0x3764('0xe')]({},{'OwnerId':_0x54efa1['id'],'Subject':intUtil['getString'](_0x448c01['Subjects'],_0x4c6385,'\x20'),'Description':intUtil['getString'](_0x448c01[_0x3764('0xf')],_0x4c6385,'\x0a')},getCustomFields(_0x37fc16,_0x4c6385));if(_0x14f931){if(_0x448c01['ticketType']===_0x3764('0x10')){_0x4dd6bf[_0x3764('0x11')]=moment[_0x3764('0x12')]();_0x4dd6bf[_0x3764('0x13')]=![];_0x4dd6bf[_0x3764('0x14')]=![];if(_0x14f931[_0x3764('0x15')]===_0x3764('0x16')||_0x14f931[_0x3764('0x15')]===_0x3764('0x17')){_0x4dd6bf[_0x3764('0x18')]=_0x14f931['id'];}else if(_0x14f931[_0x3764('0x15')]===_0x3764('0x19')){_0x4dd6bf[_0x3764('0x1a')]=_0x14f931['id'];}}else if(_0x448c01[_0x3764('0x1b')]===_0x3764('0x1c')){if(_0x14f931[_0x3764('0x15')]==='contact'){_0x4dd6bf[_0x3764('0x1d')]=_0x14f931['id'];}else if(_0x14f931[_0x3764('0x15')]===_0x3764('0x19')){_0x4dd6bf[_0x3764('0x1e')]=_0x14f931['id'];}else if(_0x14f931[_0x3764('0x15')]===_0x3764('0x17')&&_0x448c01[_0x3764('0x1f')]){_0x4dd6bf[_0x448c01['leadId']]=_0x14f931['id'];}else{logger[_0x3764('0x20')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x31d732[_0x3764('0x21')](_0x448c01[_0x3764('0x1b')])[_0x3764('0x22')](_0x4dd6bf);}function getUser(_0x4a80a1,_0x2feaa9,_0x15e74d){if(!_[_0x3764('0x23')](_0x2feaa9)&&intUtil['validateEmail'](_0x2feaa9)){var _0x5cc362={'Email':_0x2feaa9};var _0x1e0c74={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x15e74d['sobject'](_0x3764('0x24'))[_0x3764('0x25')](_0x5cc362,_0x1e0c74)[_0x3764('0x26')]()[_0x3764('0x27')](function(_0x5ace71){if(_0x5ace71[_0x3764('0x28')]){var _0x4705fd=_[_0x3764('0x25')](_0x5ace71,function(_0x290201){return _0x290201[_0x3764('0x29')]===_0x2feaa9;});if(_0x4705fd){logger[_0x3764('0x20')](_0x3764('0x2a'),_0x2feaa9);return BPromise[_0x3764('0x2b')]({'id':_0x4705fd['Id'],'name':_0x4705fd[_0x3764('0x2c')]});}}else{logger[_0x3764('0x20')](_0x3764('0x2d'),_0x2feaa9);return _0x15e74d[_0x3764('0x2e')]()['then'](function(_0x275f2a){return BPromise[_0x3764('0x2b')]({'id':_0x275f2a[_0x3764('0x2f')],'name':_0x275f2a[_0x3764('0x30')]});});}});}else{logger[_0x3764('0x20')](_0x3764('0x2d'),_0x2feaa9);return _0x15e74d['identity']()[_0x3764('0x27')](function(_0x369df2){return BPromise[_0x3764('0x2b')]({'id':_0x369df2[_0x3764('0x2f')],'name':_0x369df2['display_name']});});}}function getEndUser(_0x395707,_0x18688d,_0x4aa26d,_0x49070e,_0x1bb872){var _0x483c8c={'$or':{'Phone':_0x49070e}};var _0x436448={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x3764('0x2b')]()[_0x3764('0x27')](function(){logger[_0x3764('0x20')](_0x3764('0x31'),_0x49070e,_0x18688d[_0x3764('0x32')]);switch(_0x18688d[_0x3764('0x32')]){case _0x3764('0x33'):var _0x375146=_[_0x3764('0x34')](_0x483c8c);if(_0x18688d[_0x3764('0x35')]){var _0x326c25={};_0x326c25[_0x18688d['additionalSearchContact']]=_0x49070e;_[_0x3764('0x36')](_0x375146['$or'],_0x326c25);}return _0x1bb872[_0x3764('0x21')]('Contact')[_0x3764('0x25')](_0x375146,_0x436448)[_0x3764('0x26')]()['then'](function(_0x4ee99f){if(_0x4ee99f&&_0x4ee99f[_0x3764('0x28')]){return _0x4ee99f;}else{var _0x4684b2=_[_0x3764('0x34')](_0x483c8c);if(_0x18688d[_0x3764('0x37')]){var _0x2fcbd2={};_0x2fcbd2[_0x18688d[_0x3764('0x37')]]=_0x49070e;_[_0x3764('0x36')](_0x4684b2[_0x3764('0x38')],_0x2fcbd2);}return _0x1bb872[_0x3764('0x21')]('Lead')[_0x3764('0x25')](_0x4684b2,_0x436448);}});case'account_contact_lead':var _0x5343b1=_['cloneDeep'](_0x483c8c);if(_0x18688d[_0x3764('0x39')]){var _0x326c25={};_0x326c25[_0x18688d['additionalSearchAccount']]=_0x49070e;_[_0x3764('0x36')](_0x5343b1[_0x3764('0x38')],_0x326c25);}return _0x1bb872[_0x3764('0x21')](_0x3764('0x3a'))[_0x3764('0x25')](_0x5343b1,_0x436448)[_0x3764('0x26')]()['then'](function(_0x5f48d5){if(_0x5f48d5&&_0x5f48d5[_0x3764('0x28')]){return _0x5f48d5;}else{var _0x1fdff8=_[_0x3764('0x34')](_0x483c8c);if(_0x18688d[_0x3764('0x35')]){var _0x23fefd={};_0x23fefd[_0x18688d[_0x3764('0x35')]]=_0x49070e;_[_0x3764('0x36')](_0x1fdff8['$or'],_0x23fefd);}return _0x1bb872['sobject'](_0x3764('0x3b'))['find'](_0x1fdff8,_0x436448)[_0x3764('0x27')](function(_0xa3bd05){if(_0xa3bd05&&_0xa3bd05[_0x3764('0x28')]){return _0xa3bd05;}else{var _0x17bc11=_[_0x3764('0x34')](_0x483c8c);if(_0x18688d[_0x3764('0x37')]){var _0x540b52={};_0x540b52[_0x18688d['additionalSearchLead']]=_0x49070e;_[_0x3764('0x36')](_0x17bc11[_0x3764('0x38')],_0x540b52);}return _0x1bb872[_0x3764('0x21')]('Lead')[_0x3764('0x25')](_0x17bc11,_0x436448);}});}});case _0x3764('0x16'):var _0x375146=_[_0x3764('0x34')](_0x483c8c);if(_0x18688d[_0x3764('0x35')]){var _0x326c25={};_0x326c25[_0x18688d[_0x3764('0x35')]]=_0x49070e;_['merge'](_0x375146[_0x3764('0x38')],_0x326c25);}return _0x1bb872[_0x3764('0x21')](_0x3764('0x3b'))[_0x3764('0x25')](_0x375146,_0x436448)[_0x3764('0x26')]();case _0x3764('0x17'):var _0x3e05e7=_[_0x3764('0x34')](_0x483c8c);if(_0x18688d[_0x3764('0x37')]){var _0x326c25={};_0x326c25[_0x18688d[_0x3764('0x37')]]=_0x49070e;_[_0x3764('0x36')](_0x3e05e7[_0x3764('0x38')],_0x326c25);}return _0x1bb872[_0x3764('0x21')](_0x3764('0x3c'))[_0x3764('0x25')](_0x3e05e7,_0x436448);case _0x3764('0x19'):var _0x5343b1=_['cloneDeep'](_0x483c8c);if(_0x18688d[_0x3764('0x39')]){var _0x326c25={};_0x326c25[_0x18688d[_0x3764('0x39')]]=_0x49070e;_[_0x3764('0x36')](_0x5343b1[_0x3764('0x38')],_0x326c25);}return _0x1bb872[_0x3764('0x21')](_0x3764('0x3a'))['find'](_0x5343b1,_0x436448);default:return null;}})[_0x3764('0x27')](function(_0x3c6824){if(_0x3c6824&&_0x3c6824['length']){var _0x28cf49=_[_0x3764('0x3d')](_0x3c6824);if(_0x28cf49){return BPromise['resolve']({'id':_0x28cf49['Id'],'name':_0x28cf49[_0x3764('0x2c')],'phone':_0x28cf49[_0x3764('0x3e')],'endUserType':_0x28cf49['attributes'][_0x3764('0x3f')][_0x3764('0x40')]()});}}})[_0x3764('0x27')](function(_0x10cb8c){if(_0x10cb8c){logger['info'](_0x3764('0x41'),_0x10cb8c[_0x3764('0x15')],_0x49070e);return BPromise[_0x3764('0x2b')](_0x10cb8c);}else{logger[_0x3764('0x20')](_0x3764('0x42'),_0x49070e);var _0x6a9de7={'Phone':_0x49070e};if(_0x18688d[_0x3764('0x43')]){if(_0x18688d[_0x3764('0x43')]===_0x3764('0x16')){logger['info'](_0x3764('0x44'),_0x49070e,_0x18688d[_0x3764('0x43')]);_0x6a9de7[_0x3764('0x45')]=_0x4aa26d!==_0x3764('0x46')?_0x4aa26d:util['format'](_0x3764('0x47'),_0x49070e);}else if(_0x18688d['moduleCreate']==='lead'){logger[_0x3764('0x20')](_0x3764('0x44'),_0x49070e,_0x18688d[_0x3764('0x43')]);_0x6a9de7[_0x3764('0x45')]=_0x4aa26d!==_0x3764('0x46')?_0x4aa26d:util['format']('Caller\x20-\x20%s',_0x49070e);_0x6a9de7[_0x3764('0x48')]='No\x20Company';}else if(_0x18688d['moduleCreate']===_0x3764('0x19')){logger[_0x3764('0x20')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x49070e,_0x18688d['moduleCreate']);_0x6a9de7[_0x3764('0x2c')]=_0x4aa26d!==''?_0x4aa26d:util[_0x3764('0x49')]('Caller\x20-\x20%s',_0x49070e);}else{return null;}}return _0x1bb872[_0x3764('0x21')](_[_0x3764('0x4a')](_0x18688d[_0x3764('0x43')]))['create'](_0x6a9de7)[_0x3764('0x27')](function(_0x52376f){return BPromise[_0x3764('0x2b')]({'id':_0x52376f['id'],'endUserType':_0x18688d[_0x3764('0x43')]});});}});}function getCustomFields(_0x135f43,_0x1f46ac){var _0x3c5d35={};if(_0x135f43[_0x3764('0x28')]>0x0){_['forEach'](_0x135f43,function(_0x4699a3){if(_['includes']([_0x3764('0x4b'),_0x3764('0x4c')],_0x4699a3[_0x3764('0x3f')])&&_0x4699a3[_0x3764('0x4d')]){_0x3c5d35[_0x4699a3[_0x3764('0x4d')]]=_0x4699a3[_0x3764('0x4e')][_0x3764('0x4f')]();}else if(_0x4699a3[_0x3764('0x3f')]==='variable'&&_0x4699a3[_0x3764('0x50')]&&_0x4699a3[_0x3764('0x4d')]){_0x1f46ac[_0x4699a3[_0x3764('0x50')]]&&(_0x3c5d35[_0x4699a3[_0x3764('0x4d')]]=_0x1f46ac[_0x4699a3[_0x3764('0x50')]][_0x3764('0x4f')]());}else if(_0x4699a3[_0x3764('0x3f')]===_0x3764('0x51')&&_0x4699a3['Variable']&&_0x4699a3[_0x3764('0x52')][_0x3764('0x53')]&&_0x4699a3['idField']){_0x1f46ac[_0x4699a3[_0x3764('0x52')][_0x3764('0x53')][_0x3764('0x40')]()]&&(_0x3c5d35[_0x4699a3[_0x3764('0x4d')]]=_0x1f46ac[_0x4699a3[_0x3764('0x52')]['name'][_0x3764('0x40')]()][_0x3764('0x4f')]());}});}return _0x3c5d35;}function getConnection(_0x12d5be){var _0x1a2bfb=_0x12d5be['password']['concat'](_0x12d5be[_0x3764('0x54')]);var _0x2a2624=new jsforce['Connection']({'oauth2':{'loginUrl':_0x12d5be['remoteUri']||_0x3764('0x55'),'clientId':_0x12d5be[_0x3764('0x56')],'clientSecret':_0x12d5be[_0x3764('0x57')]}});return _0x2a2624[_0x3764('0x58')](_0x12d5be[_0x3764('0x59')],_0x1a2bfb)[_0x3764('0x27')](function(){logger[_0x3764('0x20')](_0x3764('0x5a'));return _0x2a2624;});}exports[_0x3764('0x5b')]=function(_0x40b5f7,_0x129589,_0x4d48e7,_0x3128f3,_0x214280,_0x337e6e){var _0x104fb9,_0x36b227,_0x2a121c,_0x129f12;_0x337e6e[_0x3764('0x5c')]=intUtil[_0x3764('0x5d')](_0x337e6e[_0x3764('0x5c')]);_0x337e6e[_0x3764('0x5e')]=intUtil[_0x3764('0x5d')](_0x337e6e[_0x3764('0x5e')]);if(_0x214280&&_0x214280[_0x3764('0x5f')]){logger[_0x3764('0x20')]('[QUEUE]',_0x3764('0x60'));_0x129589[_0x3764('0x61')]=util[_0x3764('0x49')](_0x3764('0x62'),_0x337e6e[_0x3764('0x5c')],_0x129589[_0x3764('0x63')],md5(_0x129589[_0x3764('0x63')]));}else{_0x129589[_0x3764('0x61')]='';}return getConnection(_0x337e6e)[_0x3764('0x27')](function(_0x21e56c){_0x129f12=_0x21e56c;return getUser(_0x337e6e,_0x3128f3[_0x3764('0x64')],_0x129f12);})[_0x3764('0x27')](function(_0x536036){_0x104fb9=_0x536036;return getEndUser(_0x337e6e,_0x4d48e7,_0x129589[_0x3764('0x65')],_0x129589[_0x3764('0x66')],_0x129f12);})[_0x3764('0x27')](function(_0x2d9ccb){_0x36b227=_0x2d9ccb;return getTicket(_0x337e6e,_0x104fb9,_0x36b227,_0x4d48e7,_0x129589,_0x4d48e7[_0x3764('0x67')],_0x129f12,_0x3764('0x5b'));})[_0x3764('0x27')](function(_0x312a7e){_0x2a121c=_0x312a7e;logger[_0x3764('0x20')](_0x3764('0x68'),_0x2a121c['id']);logger[_0x3764('0x20')](_0x3764('0x69'),_0x2a121c['id'],_0x3128f3[_0x3764('0x53')],_0x337e6e[_0x3764('0x3f')]);switch(_0x337e6e['type']){case'integrationTab':emit(util[_0x3764('0x49')]('user:%s',_0x3128f3[_0x3764('0x53')]),_0x3764('0x6a'),{'recordId':_0x2a121c['id']});break;case'newTab':emit(util[_0x3764('0x49')](_0x3764('0x6b'),_0x3128f3['name']),_0x3764('0x6c'),{'uri':util[_0x3764('0x49')](_0x3764('0x6d'),_0x129f12[_0x3764('0x6e')],_0x2a121c['id'])});break;default:logger[_0x3764('0x6f')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x3764('0x70')](function(_0x352161){logger[_0x3764('0x6f')](_0x3764('0x71'),_0x352161);});};exports[_0x3764('0x72')]=function(_0x580ead,_0xb02df3,_0x382c43,_0x6c8263,_0xd96167,_0x49cd21,_0x3e7677){var _0x25ec5e,_0x1376d7,_0x43aa1d,_0x186a80;_0x49cd21[_0x3764('0x5c')]=intUtil['stripTrailingSlash'](_0x49cd21['serverUrl']);_0x49cd21['remoteUri']=intUtil['stripTrailingSlash'](_0x49cd21[_0x3764('0x5e')]);if(_0x3e7677&&_0x3e7677[_0x3764('0x73')]&&_0x3e7677[_0x3764('0x73')]!=='none'){logger[_0x3764('0x20')](_0x3764('0x74'),_0x3764('0x60'));_0xb02df3['recordingURL']=util[_0x3764('0x49')](_0x3764('0x62'),_0x49cd21[_0x3764('0x5c')],_0xb02df3[_0x3764('0x63')],md5(_0xb02df3[_0x3764('0x63')]));}return getConnection(_0x49cd21)[_0x3764('0x27')](function(_0x2afa8b){_0x186a80=_0x2afa8b;return getUser(_0x49cd21,_0x6c8263[_0x3764('0x64')],_0x186a80);})[_0x3764('0x27')](function(_0x4df8d6){_0x25ec5e=_0x4df8d6;return getEndUser(_0x49cd21,_0x382c43,_0xb02df3[_0x3764('0x75')],_0xb02df3['destcalleridnum'],_0x186a80);})['then'](function(_0x201aea){_0x1376d7=_0x201aea;return getTicket(_0x49cd21,_0x25ec5e,_0x1376d7,_0x382c43,_0xb02df3,_0x382c43['Fields'],_0x186a80,_0x3764('0x72'));})[_0x3764('0x27')](function(_0x36d0ee){_0x43aa1d=_0x36d0ee;logger[_0x3764('0x20')](_0x3764('0x76'),_0x43aa1d['id']);logger[_0x3764('0x20')](_0x3764('0x77'),_0x43aa1d['id'],_0x6c8263[_0x3764('0x53')],_0x49cd21[_0x3764('0x3f')]);switch(_0x49cd21[_0x3764('0x3f')]){case _0x3764('0x78'):emit(util['format']('user:%s',_0x6c8263[_0x3764('0x53')]),_0x3764('0x6a'),{'recordId':_0x43aa1d['id']});break;case _0x3764('0x79'):emit(util[_0x3764('0x49')](_0x3764('0x6b'),_0x6c8263[_0x3764('0x53')]),_0x3764('0x6c'),{'uri':util['format'](_0x3764('0x6d'),_0x186a80['instanceUrl'],_0x43aa1d['id'])});break;default:logger[_0x3764('0x6f')](_0x3764('0x74'),_0x3764('0x7a'));}})[_0x3764('0x70')](function(_0x1469ff){logger[_0x3764('0x6f')](_0x3764('0x74'),_0x1469ff);});};exports['unmanaged']=function(_0x162fc2,_0x27b8e9,_0x19cdf7,_0x4b91f0,_0x2d454c,_0x2381ca){var _0x390696,_0x55fd22,_0x8fb0b5,_0x490b7e;_0x2381ca[_0x3764('0x5c')]=intUtil[_0x3764('0x5d')](_0x2381ca[_0x3764('0x5c')]);_0x2381ca[_0x3764('0x5e')]=intUtil[_0x3764('0x5d')](_0x2381ca[_0x3764('0x5e')]);if(_0x2d454c&&_0x2d454c[_0x3764('0x5f')]){logger[_0x3764('0x20')]('['+_0x27b8e9['lastevent']['toUpperCase']()+']',_0x3764('0x60'));_0x27b8e9['recordingURL']=util[_0x3764('0x49')](_0x3764('0x62'),_0x2381ca['serverUrl'],_0x27b8e9[_0x3764('0x63')],md5(_0x27b8e9[_0x3764('0x63')]));}else{_0x27b8e9['recordingURL']='';}return getConnection(_0x2381ca)[_0x3764('0x27')](function(_0x36530d){_0x490b7e=_0x36530d;if(!_[_0x3764('0x23')](_0x4b91f0)){return getUser(_0x2381ca,_0x4b91f0['name'],_0x490b7e);}else{return getUser(_0x2381ca,null,_0x490b7e);}})['then'](function(_0x474da4){_0x390696=_0x474da4;return getEndUser(_0x2381ca,_0x19cdf7,_0x27b8e9[_0x3764('0x65')],_0x27b8e9[_0x3764('0x66')],_0x490b7e);})['then'](function(_0x58d2e8){_0x55fd22=_0x58d2e8;return getTicket(_0x2381ca,_0x390696,_0x55fd22,_0x19cdf7,_0x27b8e9,_0x19cdf7['Fields'],_0x490b7e);})['then'](function(_0x41eb13){_0x8fb0b5=_0x41eb13;logger[_0x3764('0x20')]('['+_0x27b8e9[_0x3764('0x7b')][_0x3764('0x7c')]()+']\x20Ticket\x20%s\x20created.',_0x8fb0b5['id']);logger[_0x3764('0x20')]('['+_0x27b8e9['lastevent']['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x2381ca['type']);})[_0x3764('0x70')](function(_0x13aefa){logger[_0x3764('0x6f')]('['+_0x27b8e9[_0x3764('0x7b')]['toUpperCase']()+']',_0x13aefa);});}; \ 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 1f79d4b..bc5f5ef 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 _0x8f70=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','length','active','userId','sys_id','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','sys_user?','endUserNumber','System','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','includes','string','nameField','customField','toString','picklist','type','idField','toLowerCase','variableName','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','POST','assign','true','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','incident','Incident\x20-\x20','ticketNumber','forEach','push','all','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','md5','ioredis','../../../../config/environment','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','result','adminId','info','toUpperCase','catch','error','message','],\x20getUser\x20input\x20crm'];(function(_0x4ef4f,_0x510891){var _0x1ea0d1=function(_0x4b3ec){while(--_0x4b3ec){_0x4ef4f['push'](_0x4ef4f['shift']());}};_0x1ea0d1(++_0x510891);}(_0x8f70,0x137));var _0x08f7=function(_0x1d56af,_0x3b8f7e){_0x1d56af=_0x1d56af-0x0;var _0x3d37ee=_0x8f70[_0x1d56af];return _0x3d37ee;};'use strict';var _=require(_0x08f7('0x0'));var Promise=require(_0x08f7('0x1'));var rp=require(_0x08f7('0x2'));var util=require(_0x08f7('0x3'));var md5=require(_0x08f7('0x4'));var Redis=require(_0x08f7('0x5'));var intUtil=require('./util');var config=require(_0x08f7('0x6'));var logger=require('../../../../config/logger')(_0x08f7('0x7'));config[_0x08f7('0x8')]=_[_0x08f7('0x9')](config[_0x08f7('0x8')],{'host':_0x08f7('0xa'),'port':0x18eb});var io=require(_0x08f7('0xb'))(new Redis(config[_0x08f7('0x8')]));function getAdminUser(_0x5d57b3,_0x3f41cd,_0x5b6c66,_0x234c11,_0x2fbb97,_0x5fa836){return new Promise(function(_0x117a1f,_0x16bf08){var _0x315450={'method':_0x08f7('0xc'),'uri':_0x234c11+_0x08f7('0xd')+'&'+_0x2fbb97+'&'+_0x5fa836,'auth':_0x3f41cd,'json':!![]};return rp(_0x315450)['then'](function(_0x3c4634){if(_0x3c4634[_0x08f7('0xe')]['length']>0x0){_0x5b6c66[_0x08f7('0xf')]=_0x3c4634[_0x08f7('0xe')][0x0]['sys_id'];}logger[_0x08f7('0x10')]('['+[_0x5d57b3[_0x08f7('0x11')]()]+'],\x20getAdminUser\x20crm',_0x5b6c66);_0x117a1f(_0x5b6c66);})[_0x08f7('0x12')](function(_0x5b1734){logger[_0x08f7('0x13')]('['+[_0x5d57b3[_0x08f7('0x11')]()]+']',_0x5b1734['message']);_0x16bf08(_0x5b1734[_0x08f7('0x14')]);});});}function getUser(_0x321092,_0x4f9b32,_0x1d4c3e,_0x3aab53,_0x2d91b2){return function(_0x3ebb75){logger[_0x08f7('0x10')]('['+[_0x321092['toUpperCase']()]+_0x08f7('0x15'),_0x3ebb75);return new Promise(function(_0x3cc8db,_0x2fe0b7){if(intUtil[_0x08f7('0x16')](_0x3ebb75[_0x08f7('0x17')])){var _0x3f0b28={'method':_0x08f7('0xc'),'uri':_0x1d4c3e+_0x08f7('0x18')+_0x3ebb75[_0x08f7('0x17')]+'&'+_0x3aab53+'&'+_0x2d91b2,'auth':_0x4f9b32,'json':!![]};logger[_0x08f7('0x10')]('['+[_0x321092[_0x08f7('0x11')]()]+_0x08f7('0x19'),_0x3f0b28);return rp(_0x3f0b28)[_0x08f7('0x1a')](function(_0x572e5f){logger['info']('['+[_0x321092['toUpperCase']()]+'],\x20getUser\x20entity',_0x572e5f);if(_0x572e5f[_0x08f7('0xe')][_0x08f7('0x1b')]>0x0&&String(_0x572e5f[_0x08f7('0xe')][0x0][_0x08f7('0x1c')])==='true'){_0x3ebb75[_0x08f7('0x1d')]=_0x572e5f['result'][0x0][_0x08f7('0x1e')];}else{_0x3ebb75[_0x08f7('0x1d')]=_0x3ebb75['adminId'];_0x3ebb75[_0x08f7('0x17')]=_0x3ebb75[_0x08f7('0x1f')];}logger[_0x08f7('0x10')]('['+[_0x321092['toUpperCase']()]+'],\x20getUser\x20crm',_0x3ebb75);_0x3cc8db(_0x3ebb75);})['catch'](function(_0x5f0c65){logger[_0x08f7('0x13')]('['+[_0x321092[_0x08f7('0x11')]()]+']',_0x5f0c65[_0x08f7('0x14')]);_0x2fe0b7(_0x5f0c65[_0x08f7('0x14')]);});}else{logger[_0x08f7('0x10')]('['+[_0x321092[_0x08f7('0x11')]()]+_0x08f7('0x20'));_0x3ebb75[_0x08f7('0x1d')]=_0x3ebb75[_0x08f7('0xf')];_0x3ebb75[_0x08f7('0x17')]=_0x3ebb75[_0x08f7('0x1f')];_0x3cc8db(_0x3ebb75);}});};}function createEndUser(_0x5b6c9b,_0x66e33b,_0x2a9eb6,_0x5c2b68,_0x1d3944){logger['info']('['+[_0x5b6c9b[_0x08f7('0x11')]()]+_0x08f7('0x21'),_0x2a9eb6);return new Promise(function(_0x194f28,_0x1c176f){var _0x3921ff={'method':'POST','uri':_0x5c2b68+_0x08f7('0x22')+_0x1d3944,'body':{'user_name':_0x2a9eb6['endUserNumber'],'roles':'user','first_name':_0x2a9eb6[_0x08f7('0x23')],'active':'true','date_format':_0x08f7('0x24'),'phone':_0x2a9eb6['endUserNumber']},'auth':_0x66e33b,'json':!![]};return rp(_0x3921ff)[_0x08f7('0x1a')](function(_0x69372d){logger['info']('['+[_0x5b6c9b['toUpperCase']()]+_0x08f7('0x25'),_0x69372d[_0x08f7('0xe')]);_0x2a9eb6[_0x08f7('0x26')]=_0x69372d[_0x08f7('0xe')]['sys_id'];_0x194f28(_0x2a9eb6);})[_0x08f7('0x12')](function(_0x3fba8c){logger['error']('['+[_0x5b6c9b[_0x08f7('0x11')]()]+']',_0x3fba8c[_0x08f7('0x14')]);_0x1c176f(_0x3fba8c[_0x08f7('0x14')]);});});}function getEndUser(_0x2ba147,_0x5ef41f,_0x4a881d,_0x379060,_0x4cfe61){return function(_0x27c05f){logger[_0x08f7('0x10')]('['+[_0x2ba147[_0x08f7('0x11')]()]+_0x08f7('0x27'),_0x27c05f);return new Promise(function(_0x50f2c2,_0x4ef984){var _0x45e46e={'method':_0x08f7('0xc'),'uri':_0x4a881d+_0x08f7('0x28')+_0x27c05f[_0x08f7('0x23')]+'&'+_0x379060+'&'+_0x4cfe61,'auth':_0x5ef41f,'json':!![]};return rp(_0x45e46e)['then'](function(_0xf06513){if(_0xf06513[_0x08f7('0xe')][_0x08f7('0x1b')]>0x0){_0x27c05f[_0x08f7('0x26')]=_0xf06513[_0x08f7('0xe')][0x0]['sys_id'];logger[_0x08f7('0x10')]('['+[_0x2ba147['toUpperCase']()]+_0x08f7('0x29'),_0x27c05f);_0x50f2c2(_0x27c05f);}else{return createEndUser(_0x2ba147,_0x5ef41f,_0x27c05f,_0x4a881d,_0x379060)[_0x08f7('0x1a')](function(_0x40dce5){logger[_0x08f7('0x10')]('['+[_0x2ba147['toUpperCase']()]+'],\x20createEndUser\x20crm',_0x40dce5);_0x50f2c2(_0x40dce5);});}})[_0x08f7('0x12')](function(_0x1b6005){logger['error']('['+[_0x2ba147[_0x08f7('0x11')]()]+']',_0x1b6005[_0x08f7('0x14')]);_0x4ef984(_0x1b6005[_0x08f7('0x14')]);});});};}function getCustomFields(_0xc202b4,_0x1c10ae){var _0xa48289={};if(_0xc202b4[_0x08f7('0x1b')]>0x0){_['forEach'](_0xc202b4,function(_0x565588){if(_[_0x08f7('0x2a')]([_0x08f7('0x2b'),'picklist'],_0x565588['type'])&&_0x565588[_0x08f7('0x2c')]&&!_0x565588[_0x08f7('0x2d')]){_0xa48289[_0x565588[_0x08f7('0x2c')]['toLowerCase']()]=_0x565588['content'][_0x08f7('0x2e')]();}else if(_[_0x08f7('0x2a')]([_0x08f7('0x2b'),_0x08f7('0x2f')],_0x565588[_0x08f7('0x30')])&&_0x565588[_0x08f7('0x31')]&&_0x565588[_0x08f7('0x2d')]){_0xa48289[_0x565588['idField'][_0x08f7('0x32')]()]=_0x565588['content'][_0x08f7('0x2e')]();}else if(_0x565588[_0x08f7('0x30')]==='variable'&&_0x565588[_0x08f7('0x33')]&&_0x565588[_0x08f7('0x31')]&&_0x565588[_0x08f7('0x2d')]){_0xa48289[_0x565588[_0x08f7('0x31')][_0x08f7('0x32')]()]=_0x1c10ae[_0x565588[_0x08f7('0x33')]][_0x08f7('0x2e')]();}else if(_0x565588[_0x08f7('0x30')]===_0x08f7('0x34')&&_0x565588['Variable']&&_0x565588[_0x08f7('0x35')]['name']&&_0x565588[_0x08f7('0x31')]&&_0x565588[_0x08f7('0x2d')]){_0xa48289[_0x565588['idField'][_0x08f7('0x32')]()]=_0x1c10ae[_0x565588['Variable'][_0x08f7('0x36')][_0x08f7('0x32')]()][_0x08f7('0x2e')]();}});}return _0xa48289;}function getTicket(_0x4b61bd,_0x2e38a8,_0x5d7f11,_0x330afb,_0x2b92d9,_0x1b62f8){return function(_0x310816){logger[_0x08f7('0x10')]('['+[_0x4b61bd[_0x08f7('0x11')]()]+_0x08f7('0x37'),_0x310816);return new Promise(function(_0x264fc0,_0x54a449){var _0x5bacce=_0x4b61bd['toLowerCase']()===_0x08f7('0x38')?_0x310816['userId']:_0x310816[_0x08f7('0x26')];var _0x532827={'method':_0x08f7('0x39'),'uri':_0x5d7f11+'incident'+'?'+_0x1b62f8,'body':Object[_0x08f7('0x3a')]({},{'active':_0x08f7('0x3b'),'caller_id':_0x5bacce,'assigned_to':_0x310816['userId'],'short_description':intUtil[_0x08f7('0x3c')](_0x330afb[_0x08f7('0x3d')],_0x2b92d9,'\x20'),'description':intUtil[_0x08f7('0x3c')](_0x330afb[_0x08f7('0x3e')],_0x2b92d9,'\x0a')},getCustomFields(_0x330afb['Fields'],_0x2b92d9)),'auth':_0x2e38a8,'json':!![]};return rp(_0x532827)[_0x08f7('0x1a')](function(_0x2ca08c){logger[_0x08f7('0x10')]('['+[_0x4b61bd['toUpperCase']()]+_0x08f7('0x3f'),_0x2ca08c['result']);_0x310816[_0x08f7('0x40')]=_0x2ca08c[_0x08f7('0xe')][_0x08f7('0x1e')];_0x310816['ticketNumber']=_0x2ca08c[_0x08f7('0xe')][_0x08f7('0x41')];logger[_0x08f7('0x10')]('['+[_0x4b61bd[_0x08f7('0x11')]()]+_0x08f7('0x42'),_0x310816);_0x264fc0(_0x310816);})[_0x08f7('0x12')](function(_0x233b89){logger['error']('['+[_0x4b61bd['toUpperCase']()]+']',_0x233b89[_0x08f7('0x14')]);_0x54a449(_0x233b89[_0x08f7('0x14')]);});});};}function createRemoteTag(_0x1acf05,_0x17c474,_0xc8f083,_0x4379fe){return new Promise(function(_0x783dd5,_0x170098){var _0x1d0683={'method':'POST','uri':_0xc8f083+'label'+'?'+_0x4379fe,'body':{'short_description':_0x1acf05,'global':!![],'active':!![],'name':_0x1acf05},'auth':_0x17c474,'json':!![]};return rp(_0x1d0683)[_0x08f7('0x1a')](function(_0x29898a){var _0x4cc76a=_0x29898a['result'][_0x08f7('0x1e')];_0x783dd5(_0x4cc76a);});});}function getRemoteTag(_0x2922a4,_0x590d1e,_0x14b35d,_0x5f3045,_0x8c8e24){return new Promise(function(_0x3f7a05,_0xee86c7){var _0x3b163a={'method':_0x08f7('0xc'),'uri':_0x14b35d+_0x08f7('0x43')+_0x08f7('0x44')+_0x2922a4+'&'+_0x5f3045,'auth':_0x590d1e,'json':!![]};return rp(_0x3b163a)['then'](function(_0x1b018b){if(_0x1b018b['result']['length']>0x0){var _0xd43b19=_0x1b018b[_0x08f7('0xe')][0x0][_0x08f7('0x1e')];_0x3f7a05(_0xd43b19);}else{return createRemoteTag(_0x2922a4,_0x590d1e,_0x14b35d,_0x5f3045)[_0x08f7('0x1a')](function(_0x5689e2){_0x3f7a05(_0x5689e2);});}});});}function assignTagToIncident(_0x38bf7e,_0x418919,_0x4b9c8e,_0x2e932a,_0x66b7da){return new Promise(function(_0x6abfba,_0x2ff66d){var _0x1fe4f8={'method':_0x08f7('0x39'),'uri':_0x4b9c8e+'label_entry'+'?'+_0x66b7da,'body':{'label':_0x38bf7e,'table':_0x08f7('0x45'),'id_type':'Incident','table_key':_0x2e932a[_0x08f7('0x40')],'title':_0x08f7('0x46')+_0x2e932a[_0x08f7('0x47')],'id_display':_0x2e932a[_0x08f7('0x47')]},'auth':_0x418919,'json':!![]};return rp(_0x1fe4f8)[_0x08f7('0x1a')](function(_0x48e86b){_0x6abfba();})[_0x08f7('0x12')](function(){_0x6abfba();});});}function manageTags(_0x4fe042,_0x1184d4,_0x63e854,_0x56f217,_0x4b83a7,_0x314d69,_0x10c4c2){return new Promise(function(_0x2813d8,_0x14f333){var _0x1726d5=[];_0x1184d4[_0x08f7('0x48')](function(_0x5a1ae7){_0x1726d5[_0x08f7('0x49')](getRemoteTag(_0x5a1ae7,_0x63e854,_0x56f217,_0x314d69,_0x10c4c2));});return Promise['all'](_0x1726d5)['then'](function(_0x8611e3){if(_0x8611e3[_0x08f7('0x1b')]){logger['info']('['+[_0x4fe042[_0x08f7('0x11')]()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x8611e3);var _0x1f31c0=[];_0x8611e3[_0x08f7('0x48')](function(_0x96b517){_0x1f31c0['push'](assignTagToIncident(_0x96b517,_0x63e854,_0x56f217,_0x4b83a7,_0x314d69));});return Promise[_0x08f7('0x4a')](_0x1f31c0)[_0x08f7('0x1a')](function(){_0x2813d8();})['catch'](function(){_0x2813d8();});}else{_0x2813d8();}});});}function getTags(_0x442462,_0x1acc97,_0x29c16c,_0x401aa2,_0x6366a7,_0x1cdd60){return function(_0x4d7dfe){return new Promise(function(_0x17a09f,_0x450289){var _0x327f6d=[];var _0x3e454c=_0x401aa2[_0x08f7('0x4b')];if(_0x3e454c&&_0x3e454c[_0x08f7('0x1b')]>0x0){_0x327f6d=_[_0x08f7('0x4c')](_0x3e454c,_0x08f7('0x36'));}if(_0x327f6d[_0x08f7('0x1b')]>0x0){return manageTags(_0x442462,_0x327f6d,_0x1acc97,_0x29c16c,_0x4d7dfe,_0x6366a7,_0x1cdd60)[_0x08f7('0x1a')](function(){_0x17a09f(_0x4d7dfe);});}else{_0x17a09f(_0x4d7dfe);}});};}function emit(_0x128a60,_0x328590,_0x463816){var _0x2e8275=_0x08f7('0x4d')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x08f7('0x4e')+'%255EORDERBYDESCnumber';var _0x12d309={'uri':_0x128a60+_0x08f7('0x4f')+_0x463816+_0x2e8275};io['to'](util[_0x08f7('0x50')](_0x08f7('0x51'),_0x328590))[_0x08f7('0x52')](_0x08f7('0x53'),_0x12d309);}exports['cs']=function(_0x13c736,_0xfde01f,_0x4a00ff,_0x4bfdb3,_0x9f44ca,_0x4f6ec6,_0x2077d7,_0x40d6b1){var _0x4ef008={};var _0x49fd11={'user':_0x4f6ec6[_0x08f7('0x54')],'pass':_0x4f6ec6[_0x08f7('0x55')]};var _0x3e5b67=_0x08f7('0x56');var _0x5e358b=_0x08f7('0x57');_0x4f6ec6[_0x08f7('0x58')]=intUtil[_0x08f7('0x59')](_0x4f6ec6[_0x08f7('0x58')]);_0x4f6ec6[_0x08f7('0x5a')]=intUtil[_0x08f7('0x59')](_0x4f6ec6['serverUrl']);var _0x4b9c35=util[_0x08f7('0x50')](_0x08f7('0x5b'),_0x4f6ec6[_0x08f7('0x58')]);_0x4ef008[_0x08f7('0x17')]=!_[_0x08f7('0x5c')](_0x4bfdb3)?_0x4bfdb3[_0x08f7('0x5d')]:null;_0x4ef008[_0x08f7('0x1f')]=_0x4f6ec6[_0x08f7('0x5d')];_0x4ef008[_0x08f7('0x23')]=_0x40d6b1[_0x08f7('0x32')]()===_0x08f7('0x38')?_0xfde01f[_0x08f7('0x5e')]:_0xfde01f[_0x08f7('0x5f')];_0x4ef008[_0x08f7('0x60')]=_0x40d6b1==='queue'||_0x40d6b1==='unmanaged'?_0x08f7('0x61'):_0x08f7('0x38');var _0x5ce121=util['format'](_0x08f7('0x62'),_0x4f6ec6[_0x08f7('0x5a')],_0xfde01f[_0x08f7('0x63')],md5(_0xfde01f[_0x08f7('0x63')]));if(_0x9f44ca&&_0x9f44ca['monitor_format']){logger[_0x08f7('0x10')](_0x08f7('0x64'),_0x08f7('0x65'));_0xfde01f[_0x08f7('0x66')]=_0x5ce121;}else if(_0x2077d7&&_0x2077d7[_0x08f7('0x67')]&&_0x2077d7[_0x08f7('0x67')]!==_0x08f7('0x68')){logger[_0x08f7('0x10')](_0x08f7('0x69'),'Recording\x20is\x20enabled!');_0xfde01f[_0x08f7('0x66')]=_0x5ce121;}else{_0xfde01f[_0x08f7('0x66')]='';}return getAdminUser(_0x40d6b1,_0x49fd11,_0x4ef008,_0x4b9c35,_0x5e358b,_0x3e5b67)[_0x08f7('0x1a')](getUser(_0x40d6b1,_0x49fd11,_0x4b9c35,_0x5e358b,_0x3e5b67))[_0x08f7('0x1a')](getEndUser(_0x40d6b1,_0x49fd11,_0x4b9c35,_0x5e358b,_0x3e5b67))[_0x08f7('0x1a')](getTicket(_0x40d6b1,_0x49fd11,_0x4b9c35,_0x4a00ff,_0xfde01f,_0x5e358b))['then'](function(_0x538c90){logger[_0x08f7('0x10')](util[_0x08f7('0x50')](_0x08f7('0x6a'),_0x538c90[_0x08f7('0x40')]));logger[_0x08f7('0x10')](util[_0x08f7('0x50')]('call\x20direction:\x20%s',_0x40d6b1));if(_0x40d6b1!==_0x08f7('0x6b')){logger['info']('['+[_0x40d6b1[_0x08f7('0x11')]()]+']',_0x08f7('0x6c'));emit(_0x4f6ec6[_0x08f7('0x58')],_0x4bfdb3['name'],_0x538c90['ticketId']);}})[_0x08f7('0x12')](function(_0x437157){logger['error']('['+[_0x40d6b1['toUpperCase']()]+_0x08f7('0x6d'),util[_0x08f7('0x6e')](_0x437157,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xfa59=['sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','calleridnum','callDirection','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','util','md5','./util','../../../../config/environment','servicenow','redis','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','length','info','toUpperCase','],\x20getAdminUser\x20crm','catch','error','message','],\x20getUser\x20input\x20crm','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','active','userId','sys_id','adminId','adminEmail',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','System','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','includes','string','picklist','type','nameField','toLowerCase','content','toString','customField','idField','variable','variableName','customVariable','Variable',']\x20getTicket\x20input\x20crm','incident','assign','getString','Subjects','Descriptions','Fields','ticketId','ticketNumber',']\x20getTicket\x20crm','?sysparm_query=name%3D','Incident','Incident\x20-\x20','forEach','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','name','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password'];(function(_0x5e4ecd,_0x46f430){var _0x27eb9e=function(_0x8e1b33){while(--_0x8e1b33){_0x5e4ecd['push'](_0x5e4ecd['shift']());}};_0x27eb9e(++_0x46f430);}(_0xfa59,0x82));var _0x9fa5=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfa59[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x9fa5('0x0'));var Promise=require(_0x9fa5('0x1'));var rp=require('request-promise');var util=require(_0x9fa5('0x2'));var md5=require(_0x9fa5('0x3'));var Redis=require('ioredis');var intUtil=require(_0x9fa5('0x4'));var config=require(_0x9fa5('0x5'));var logger=require('../../../../config/logger')(_0x9fa5('0x6'));config[_0x9fa5('0x7')]=_['defaults'](config['redis'],{'host':_0x9fa5('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9fa5('0x7')]));function getAdminUser(_0x4f1941,_0x3fe2d8,_0x415323,_0x2c3fc3,_0x193130,_0x428335){return new Promise(function(_0x3469a9,_0x1ef1ac){var _0x137117={'method':_0x9fa5('0x9'),'uri':_0x2c3fc3+_0x9fa5('0xa')+'&'+_0x193130+'&'+_0x428335,'auth':_0x3fe2d8,'json':!![]};return rp(_0x137117)[_0x9fa5('0xb')](function(_0x44c7d8){if(_0x44c7d8[_0x9fa5('0xc')][_0x9fa5('0xd')]>0x0){_0x415323['adminId']=_0x44c7d8[_0x9fa5('0xc')][0x0]['sys_id'];}logger[_0x9fa5('0xe')]('['+[_0x4f1941[_0x9fa5('0xf')]()]+_0x9fa5('0x10'),_0x415323);_0x3469a9(_0x415323);})[_0x9fa5('0x11')](function(_0x12f94a){logger[_0x9fa5('0x12')]('['+[_0x4f1941['toUpperCase']()]+']',_0x12f94a[_0x9fa5('0x13')]);_0x1ef1ac(_0x12f94a['message']);});});}function getUser(_0x26d5c8,_0x4ed343,_0x229a7f,_0x58bdfa,_0x4622c1){return function(_0x4e2e3b){logger[_0x9fa5('0xe')]('['+[_0x26d5c8[_0x9fa5('0xf')]()]+_0x9fa5('0x14'),_0x4e2e3b);return new Promise(function(_0x298200,_0xf36465){if(intUtil['validateEmail'](_0x4e2e3b[_0x9fa5('0x15')])){var _0xbd4bcb={'method':'GET','uri':_0x229a7f+_0x9fa5('0x16')+_0x4e2e3b[_0x9fa5('0x15')]+'&'+_0x58bdfa+'&'+_0x4622c1,'auth':_0x4ed343,'json':!![]};logger['info']('['+[_0x26d5c8[_0x9fa5('0xf')]()]+_0x9fa5('0x17'),_0xbd4bcb);return rp(_0xbd4bcb)[_0x9fa5('0xb')](function(_0x4a7b82){logger['info']('['+[_0x26d5c8[_0x9fa5('0xf')]()]+'],\x20getUser\x20entity',_0x4a7b82);if(_0x4a7b82[_0x9fa5('0xc')][_0x9fa5('0xd')]>0x0&&String(_0x4a7b82[_0x9fa5('0xc')][0x0][_0x9fa5('0x18')])==='true'){_0x4e2e3b[_0x9fa5('0x19')]=_0x4a7b82[_0x9fa5('0xc')][0x0][_0x9fa5('0x1a')];}else{_0x4e2e3b['userId']=_0x4e2e3b[_0x9fa5('0x1b')];_0x4e2e3b[_0x9fa5('0x15')]=_0x4e2e3b[_0x9fa5('0x1c')];}logger[_0x9fa5('0xe')]('['+[_0x26d5c8[_0x9fa5('0xf')]()]+'],\x20getUser\x20crm',_0x4e2e3b);_0x298200(_0x4e2e3b);})[_0x9fa5('0x11')](function(_0x3598cd){logger[_0x9fa5('0x12')]('['+[_0x26d5c8[_0x9fa5('0xf')]()]+']',_0x3598cd[_0x9fa5('0x13')]);_0xf36465(_0x3598cd['message']);});}else{logger[_0x9fa5('0xe')]('['+[_0x26d5c8[_0x9fa5('0xf')]()]+_0x9fa5('0x1d'));_0x4e2e3b[_0x9fa5('0x19')]=_0x4e2e3b[_0x9fa5('0x1b')];_0x4e2e3b[_0x9fa5('0x15')]=_0x4e2e3b[_0x9fa5('0x1c')];_0x298200(_0x4e2e3b);}});};}function createEndUser(_0x3fbce4,_0x48f805,_0x12a3c5,_0x47b739,_0x537233){logger['info']('['+[_0x3fbce4[_0x9fa5('0xf')]()]+_0x9fa5('0x1e'),_0x12a3c5);return new Promise(function(_0x22717d,_0x1069c1){var _0x474073={'method':_0x9fa5('0x1f'),'uri':_0x47b739+_0x9fa5('0x20')+_0x537233,'body':{'user_name':_0x12a3c5[_0x9fa5('0x21')],'roles':_0x9fa5('0x22'),'first_name':_0x12a3c5['endUserNumber'],'active':'true','date_format':_0x9fa5('0x23'),'phone':_0x12a3c5[_0x9fa5('0x21')]},'auth':_0x48f805,'json':!![]};return rp(_0x474073)['then'](function(_0x4ba7dd){logger['info']('['+[_0x3fbce4[_0x9fa5('0xf')]()]+'],\x20EndUser\x20schema',_0x4ba7dd[_0x9fa5('0xc')]);_0x12a3c5[_0x9fa5('0x24')]=_0x4ba7dd[_0x9fa5('0xc')][_0x9fa5('0x1a')];_0x22717d(_0x12a3c5);})[_0x9fa5('0x11')](function(_0x5dee32){logger['error']('['+[_0x3fbce4[_0x9fa5('0xf')]()]+']',_0x5dee32[_0x9fa5('0x13')]);_0x1069c1(_0x5dee32['message']);});});}function getEndUser(_0x54dd9c,_0x5d7025,_0x5c7576,_0x3dde2b,_0x2e61f2){return function(_0x4983ca){logger[_0x9fa5('0xe')]('['+[_0x54dd9c[_0x9fa5('0xf')]()]+_0x9fa5('0x25'),_0x4983ca);return new Promise(function(_0xe268c5,_0xd53107){var _0x3f47d8={'method':'GET','uri':_0x5c7576+_0x9fa5('0x26')+_0x4983ca[_0x9fa5('0x21')]+'&'+_0x3dde2b+'&'+_0x2e61f2,'auth':_0x5d7025,'json':!![]};return rp(_0x3f47d8)[_0x9fa5('0xb')](function(_0x5b3855){if(_0x5b3855[_0x9fa5('0xc')][_0x9fa5('0xd')]>0x0){_0x4983ca['endUserId']=_0x5b3855['result'][0x0][_0x9fa5('0x1a')];logger[_0x9fa5('0xe')]('['+[_0x54dd9c[_0x9fa5('0xf')]()]+_0x9fa5('0x27'),_0x4983ca);_0xe268c5(_0x4983ca);}else{return createEndUser(_0x54dd9c,_0x5d7025,_0x4983ca,_0x5c7576,_0x3dde2b)[_0x9fa5('0xb')](function(_0x3a2192){logger[_0x9fa5('0xe')]('['+[_0x54dd9c['toUpperCase']()]+_0x9fa5('0x28'),_0x3a2192);_0xe268c5(_0x3a2192);});}})['catch'](function(_0x3cee7d){logger[_0x9fa5('0x12')]('['+[_0x54dd9c[_0x9fa5('0xf')]()]+']',_0x3cee7d[_0x9fa5('0x13')]);_0xd53107(_0x3cee7d['message']);});});};}function getCustomFields(_0x25fad9,_0x3e4024){var _0x147dd4={};if(_0x25fad9['length']>0x0){_['forEach'](_0x25fad9,function(_0x577fda){if(_[_0x9fa5('0x29')]([_0x9fa5('0x2a'),_0x9fa5('0x2b')],_0x577fda[_0x9fa5('0x2c')])&&_0x577fda[_0x9fa5('0x2d')]&&!_0x577fda['customField']){_0x147dd4[_0x577fda[_0x9fa5('0x2d')][_0x9fa5('0x2e')]()]=_0x577fda[_0x9fa5('0x2f')][_0x9fa5('0x30')]();}else if(_[_0x9fa5('0x29')]([_0x9fa5('0x2a'),_0x9fa5('0x2b')],_0x577fda['type'])&&_0x577fda['idField']&&_0x577fda[_0x9fa5('0x31')]){_0x147dd4[_0x577fda[_0x9fa5('0x32')][_0x9fa5('0x2e')]()]=_0x577fda[_0x9fa5('0x2f')][_0x9fa5('0x30')]();}else if(_0x577fda[_0x9fa5('0x2c')]===_0x9fa5('0x33')&&_0x577fda[_0x9fa5('0x34')]&&_0x577fda[_0x9fa5('0x32')]&&_0x577fda[_0x9fa5('0x31')]){_0x147dd4[_0x577fda[_0x9fa5('0x32')][_0x9fa5('0x2e')]()]=_0x3e4024[_0x577fda[_0x9fa5('0x34')]][_0x9fa5('0x30')]();}else if(_0x577fda[_0x9fa5('0x2c')]===_0x9fa5('0x35')&&_0x577fda['Variable']&&_0x577fda[_0x9fa5('0x36')]['name']&&_0x577fda[_0x9fa5('0x32')]&&_0x577fda['customField']){_0x147dd4[_0x577fda[_0x9fa5('0x32')][_0x9fa5('0x2e')]()]=_0x3e4024[_0x577fda['Variable']['name'][_0x9fa5('0x2e')]()][_0x9fa5('0x30')]();}});}return _0x147dd4;}function getTicket(_0x4896b7,_0x309c47,_0x2561f3,_0x17f5e5,_0x5476b1,_0x113c7f){return function(_0x534bc8){logger['info']('['+[_0x4896b7[_0x9fa5('0xf')]()]+_0x9fa5('0x37'),_0x534bc8);return new Promise(function(_0x36769a,_0x100284){var _0x533010=_0x4896b7['toLowerCase']()==='outbound'?_0x534bc8[_0x9fa5('0x19')]:_0x534bc8[_0x9fa5('0x24')];var _0xb26115={'method':'POST','uri':_0x2561f3+_0x9fa5('0x38')+'?'+_0x113c7f,'body':Object[_0x9fa5('0x39')]({},{'active':'true','caller_id':_0x533010,'assigned_to':_0x534bc8['userId'],'short_description':intUtil[_0x9fa5('0x3a')](_0x17f5e5[_0x9fa5('0x3b')],_0x5476b1,'\x20'),'description':intUtil[_0x9fa5('0x3a')](_0x17f5e5[_0x9fa5('0x3c')],_0x5476b1,'\x0a')},getCustomFields(_0x17f5e5[_0x9fa5('0x3d')],_0x5476b1)),'auth':_0x309c47,'json':!![]};return rp(_0xb26115)[_0x9fa5('0xb')](function(_0x171b35){logger['info']('['+[_0x4896b7['toUpperCase']()]+']\x20POST\x20incident\x20entity\x20schema',_0x171b35[_0x9fa5('0xc')]);_0x534bc8[_0x9fa5('0x3e')]=_0x171b35['result'][_0x9fa5('0x1a')];_0x534bc8[_0x9fa5('0x3f')]=_0x171b35[_0x9fa5('0xc')]['number'];logger[_0x9fa5('0xe')]('['+[_0x4896b7[_0x9fa5('0xf')]()]+_0x9fa5('0x40'),_0x534bc8);_0x36769a(_0x534bc8);})[_0x9fa5('0x11')](function(_0x372669){logger[_0x9fa5('0x12')]('['+[_0x4896b7[_0x9fa5('0xf')]()]+']',_0x372669[_0x9fa5('0x13')]);_0x100284(_0x372669[_0x9fa5('0x13')]);});});};}function createRemoteTag(_0xe880dd,_0x480335,_0xd3360e,_0x3f8bd5){return new Promise(function(_0x241c55,_0x3315ad){var _0x516a79={'method':_0x9fa5('0x1f'),'uri':_0xd3360e+'label'+'?'+_0x3f8bd5,'body':{'short_description':_0xe880dd,'global':!![],'active':!![],'name':_0xe880dd},'auth':_0x480335,'json':!![]};return rp(_0x516a79)[_0x9fa5('0xb')](function(_0x5d3acd){var _0x4f3435=_0x5d3acd[_0x9fa5('0xc')][_0x9fa5('0x1a')];_0x241c55(_0x4f3435);});});}function getRemoteTag(_0x105692,_0x3b27f0,_0x2a27ed,_0x3b665f,_0x153bb2){return new Promise(function(_0x926b37,_0x5b4129){var _0x150898={'method':_0x9fa5('0x9'),'uri':_0x2a27ed+'label'+_0x9fa5('0x41')+_0x105692+'&'+_0x3b665f,'auth':_0x3b27f0,'json':!![]};return rp(_0x150898)[_0x9fa5('0xb')](function(_0x168d42){if(_0x168d42['result']['length']>0x0){var _0x147d60=_0x168d42[_0x9fa5('0xc')][0x0][_0x9fa5('0x1a')];_0x926b37(_0x147d60);}else{return createRemoteTag(_0x105692,_0x3b27f0,_0x2a27ed,_0x3b665f)['then'](function(_0x39c5ea){_0x926b37(_0x39c5ea);});}});});}function assignTagToIncident(_0x595ac4,_0x102f22,_0x3c0791,_0x826a25,_0x41fd6e){return new Promise(function(_0x2adb5b,_0x42b8da){var _0x1ccc6a={'method':_0x9fa5('0x1f'),'uri':_0x3c0791+'label_entry'+'?'+_0x41fd6e,'body':{'label':_0x595ac4,'table':'incident','id_type':_0x9fa5('0x42'),'table_key':_0x826a25[_0x9fa5('0x3e')],'title':_0x9fa5('0x43')+_0x826a25[_0x9fa5('0x3f')],'id_display':_0x826a25[_0x9fa5('0x3f')]},'auth':_0x102f22,'json':!![]};return rp(_0x1ccc6a)[_0x9fa5('0xb')](function(_0xbfd059){_0x2adb5b();})[_0x9fa5('0x11')](function(){_0x2adb5b();});});}function manageTags(_0x544479,_0x89270f,_0x4e24b9,_0x4a46df,_0x3499f8,_0xe88496,_0x4d9975){return new Promise(function(_0x128b16,_0x1a7a54){var _0x2ccf78=[];_0x89270f[_0x9fa5('0x44')](function(_0x503044){_0x2ccf78[_0x9fa5('0x45')](getRemoteTag(_0x503044,_0x4e24b9,_0x4a46df,_0xe88496,_0x4d9975));});return Promise[_0x9fa5('0x46')](_0x2ccf78)[_0x9fa5('0xb')](function(_0x2eaa5b){if(_0x2eaa5b[_0x9fa5('0xd')]){logger[_0x9fa5('0xe')]('['+[_0x544479['toUpperCase']()]+_0x9fa5('0x47'),_0x2eaa5b);var _0x27ddc7=[];_0x2eaa5b[_0x9fa5('0x44')](function(_0x4c4ca8){_0x27ddc7[_0x9fa5('0x45')](assignTagToIncident(_0x4c4ca8,_0x4e24b9,_0x4a46df,_0x3499f8,_0xe88496));});return Promise[_0x9fa5('0x46')](_0x27ddc7)[_0x9fa5('0xb')](function(){_0x128b16();})[_0x9fa5('0x11')](function(){_0x128b16();});}else{_0x128b16();}});});}function getTags(_0x59a84c,_0x48990a,_0x5c7eed,_0x5bedaf,_0x237fdb,_0x57204e){return function(_0x4975b0){return new Promise(function(_0x2a7ceb,_0x4a4f63){var _0x48a00b=[];var _0x1fd216=_0x5bedaf[_0x9fa5('0x48')];if(_0x1fd216&&_0x1fd216['length']>0x0){_0x48a00b=_[_0x9fa5('0x49')](_0x1fd216,_0x9fa5('0x4a'));}if(_0x48a00b[_0x9fa5('0xd')]>0x0){return manageTags(_0x59a84c,_0x48a00b,_0x48990a,_0x5c7eed,_0x4975b0,_0x237fdb,_0x57204e)[_0x9fa5('0xb')](function(){_0x2a7ceb(_0x4975b0);});}else{_0x2a7ceb(_0x4975b0);}});};}function emit(_0x5ad5ed,_0x36a7a4,_0x486eb6){var _0x5599e0='%26sysparm_record_target%3Dincident'+_0x9fa5('0x4b')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0x9fa5('0x4c');var _0x1e2cf9={'uri':_0x5ad5ed+_0x9fa5('0x4d')+_0x486eb6+_0x5599e0};io['to'](util[_0x9fa5('0x4e')](_0x9fa5('0x4f'),_0x36a7a4))[_0x9fa5('0x50')](_0x9fa5('0x51'),_0x1e2cf9);}exports['cs']=function(_0x4ca888,_0x343c47,_0x459d97,_0x3e541a,_0x1e3510,_0x14dd92,_0x386290,_0x141fb3){var _0x2ddc25={};var _0x32706e={'user':_0x14dd92[_0x9fa5('0x52')],'pass':_0x14dd92[_0x9fa5('0x53')]};var _0x264bf2=_0x9fa5('0x54');var _0x1db2a4=_0x9fa5('0x55');_0x14dd92[_0x9fa5('0x56')]=intUtil[_0x9fa5('0x57')](_0x14dd92[_0x9fa5('0x56')]);_0x14dd92[_0x9fa5('0x58')]=intUtil['stripTrailingSlash'](_0x14dd92[_0x9fa5('0x58')]);var _0x2c7955=util[_0x9fa5('0x4e')](_0x9fa5('0x59'),_0x14dd92[_0x9fa5('0x56')]);_0x2ddc25[_0x9fa5('0x15')]=!_[_0x9fa5('0x5a')](_0x3e541a)?_0x3e541a[_0x9fa5('0x5b')]:null;_0x2ddc25[_0x9fa5('0x1c')]=_0x14dd92['email'];_0x2ddc25[_0x9fa5('0x21')]=_0x141fb3[_0x9fa5('0x2e')]()==='outbound'?_0x343c47[_0x9fa5('0x5c')]:_0x343c47[_0x9fa5('0x5d')];_0x2ddc25[_0x9fa5('0x5e')]=_0x141fb3==='queue'||_0x141fb3==='unmanaged'?'queue':'outbound';var _0x38b5f6=util[_0x9fa5('0x4e')](_0x9fa5('0x5f'),_0x14dd92[_0x9fa5('0x58')],_0x343c47['uniqueid'],md5(_0x343c47['uniqueid']));if(_0x1e3510&&_0x1e3510[_0x9fa5('0x60')]){logger[_0x9fa5('0xe')](_0x9fa5('0x61'),_0x9fa5('0x62'));_0x343c47['recordingURL']=_0x38b5f6;}else if(_0x386290&&_0x386290[_0x9fa5('0x63')]&&_0x386290[_0x9fa5('0x63')]!=='none'){logger['info'](_0x9fa5('0x64'),_0x9fa5('0x62'));_0x343c47['recordingURL']=_0x38b5f6;}else{_0x343c47['recordingURL']='';}return getAdminUser(_0x141fb3,_0x32706e,_0x2ddc25,_0x2c7955,_0x1db2a4,_0x264bf2)[_0x9fa5('0xb')](getUser(_0x141fb3,_0x32706e,_0x2c7955,_0x1db2a4,_0x264bf2))[_0x9fa5('0xb')](getEndUser(_0x141fb3,_0x32706e,_0x2c7955,_0x1db2a4,_0x264bf2))[_0x9fa5('0xb')](getTicket(_0x141fb3,_0x32706e,_0x2c7955,_0x459d97,_0x343c47,_0x1db2a4))[_0x9fa5('0xb')](function(_0x3614a6){logger[_0x9fa5('0xe')](util[_0x9fa5('0x4e')](_0x9fa5('0x65'),_0x3614a6['ticketId']));logger[_0x9fa5('0xe')](util[_0x9fa5('0x4e')](_0x9fa5('0x66'),_0x141fb3));if(_0x141fb3!==_0x9fa5('0x67')){logger[_0x9fa5('0xe')]('['+[_0x141fb3[_0x9fa5('0xf')]()]+']',_0x9fa5('0x68'));emit(_0x14dd92[_0x9fa5('0x56')],_0x3e541a[_0x9fa5('0x4a')],_0x3614a6[_0x9fa5('0x3e')]);}})[_0x9fa5('0x11')](function(_0x45e7b0){logger[_0x9fa5('0x12')]('['+[_0x141fb3['toUpperCase']()]+_0x9fa5('0x69'),util[_0x9fa5('0x6a')](_0x45e7b0,{'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 16e252b..754bb60 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 _0xada6=['stripTrailingSlash','remoteUri','serverUrl','uri','%s/service/v4_1/rest.php','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','The\x20Enduser\x20ID\x20is:','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','recordingFormat','none','The\x20User\x20ID\x20is:','Outbound','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','[OUTBOUND]','lastevent','calleridnum','Fields','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','Subjects','getString','Descriptions','date_start','toISOString','slice','duration_minutes','parent_id','parent_type','Contacts','name','direction','length','forEach','variableName','push','idField','set_entry','stringify','Calls','Basic\x20%s','apiKey','base64','get_server_info','JSON','isNil','get_entry_list','format','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','entry_list','name_value_list','value','Agent\x20found!','resolve','user_id','Searching\x20enduser\x20with\x20phone','phone_home','Enduser\x20found!','Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','merge','map','type','string','nameField','customField','toLowerCase','content','custom_fields','toString','customVariable','Variable','login','username','password','xCALLY\x20Motion\x20integration','set_relationship','queue'];(function(_0x8615e8,_0x574b98){var _0x4c366f=function(_0x388633){while(--_0x388633){_0x8615e8['push'](_0x8615e8['shift']());}};_0x4c366f(++_0x574b98);}(_0xada6,0x93));var _0x6ada=function(_0x172709,_0x5e6abe){_0x172709=_0x172709-0x0;var _0x15cde4=_0xada6[_0x172709];return _0x15cde4;};'use strict';var _=require(_0x6ada('0x0'));var rp=require(_0x6ada('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x6ada('0x2'));var Redis=require(_0x6ada('0x3'));var intUtil=require(_0x6ada('0x4'));var config=require('../../../../config/environment');var logger=require(_0x6ada('0x5'))(_0x6ada('0x6'));config[_0x6ada('0x7')]=_[_0x6ada('0x8')](config[_0x6ada('0x7')],{'host':_0x6ada('0x9'),'port':0x18eb});var io=require(_0x6ada('0xa'))(new Redis(config[_0x6ada('0x7')]));var def={'method':_0x6ada('0xb'),'json':!![]};function emit(_0x133898,_0x2e121a,_0x3988ca){io['to'](_0x133898)[_0x6ada('0xc')](_0x2e121a,_0x3988ca);}function getTicket(_0x500347,_0x3e2a78,_0x2f6050,_0x4e587f,_0x47b075,_0x18d5fc,_0x4ffe2d,_0x25b822){logger[_0x6ada('0xd')](_0x6ada('0xe'));var _0x3df48f=new Date();var _0x35a0ee=[{'name':'name','value':intUtil['getString'](_0x4e587f[_0x6ada('0xf')],_0x47b075,'\x20')},{'name':'assigned_user_id','value':_0x3e2a78['id']},{'name':'created_by','value':_0x3e2a78['id']},{'name':'description','value':intUtil[_0x6ada('0x10')](_0x4e587f[_0x6ada('0x11')],_0x47b075,'\x0a')},{'name':_0x6ada('0x12'),'value':_0x3df48f[_0x6ada('0x13')]()[_0x6ada('0x14')](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x6ada('0x15'),'value':'15'},{'name':_0x6ada('0x16'),'value':_0x2f6050['id']},{'name':_0x6ada('0x17'),'value':_0x6ada('0x18')},{'name':'parent_name','value':_0x2f6050[_0x6ada('0x19')]},{'name':_0x6ada('0x1a'),'value':_0x25b822}];if(_0x18d5fc[_0x6ada('0x1b')]){_[_0x6ada('0x1c')](_0x18d5fc,function(_0x45daca){if(_0x47b075[_0x45daca[_0x6ada('0x1d')]]){_0x35a0ee[_0x6ada('0x1e')]({'name':_0x45daca[_0x6ada('0x1f')],'value':_0x47b075[_0x45daca[_0x6ada('0x1d')]]});}});}return request({'form':{'method':_0x6ada('0x20'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x6ada('0x21')]({'session':_0x4ffe2d['id'],'module_name':_0x6ada('0x22'),'name_value_list':_0x35a0ee})}});}function getAuth(_0x189dd2){return util['format'](_0x6ada('0x23'),new Buffer(_0x189dd2[_0x6ada('0x24')]+':X')['toString'](_0x6ada('0x25')));}function getServerInfo(_0x4f551e){return request({'form':{'method':_0x6ada('0x26'),'input_type':_0x6ada('0x27'),'response_type':_0x6ada('0x27'),'rest_data':JSON[_0x6ada('0x21')]({'session':_0x4f551e['id']})}});}function getUser(_0x594f8d,_0x3b21fe,_0x3d074d){if(!_[_0x6ada('0x28')](_0x3b21fe)){logger[_0x6ada('0xd')]('Getting\x20agent\x20with\x20name',_0x3b21fe);return request({'form':{'method':_0x6ada('0x29'),'input_type':_0x6ada('0x27'),'response_type':'JSON','rest_data':JSON[_0x6ada('0x21')]({'session':_0x3d074d['id'],'module_name':'Employees','query':util[_0x6ada('0x2a')](_0x6ada('0x2b'),_0x3b21fe),'order_by':'','offset':'0','select_fields':['id',_0x6ada('0x19'),_0x6ada('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6ada('0x2d')](function(_0x1c357e){if(_0x1c357e['entry_list']['length']){var _0x1342ff=_[_0x6ada('0x2e')](_0x1c357e[_0x6ada('0x2f')],function(_0x53d3eb){return _0x53d3eb[_0x6ada('0x30')][_0x6ada('0x2c')][_0x6ada('0x31')]===_0x3b21fe;});if(_0x1342ff){logger[_0x6ada('0xd')](_0x6ada('0x32'));return BPromise[_0x6ada('0x33')]({'id':_0x1342ff['name_value_list']['id']['value'],'name':_0x1342ff[_0x6ada('0x30')][_0x6ada('0x19')]['value']});}}logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x6ada('0x33')]({'id':_0x3d074d[_0x6ada('0x30')]['user_id']['value'],'name':_0x3d074d[_0x6ada('0x30')][_0x6ada('0x2c')][_0x6ada('0x31')]});});}else{logger[_0x6ada('0xd')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x6ada('0x33')]({'id':_0x3d074d[_0x6ada('0x30')][_0x6ada('0x34')][_0x6ada('0x31')],'name':_0x3d074d['name_value_list'][_0x6ada('0x2c')][_0x6ada('0x31')]});}}function getEndUser(_0x3e2ebf,_0x56e4d8,_0xa39c22,_0x3494f0){logger[_0x6ada('0xd')](_0x6ada('0x35'),_0xa39c22);return request({'form':{'method':_0x6ada('0x29'),'input_type':'JSON','response_type':_0x6ada('0x27'),'rest_data':JSON[_0x6ada('0x21')]({'session':_0x3494f0['id'],'module_name':_0x6ada('0x18'),'query':util[_0x6ada('0x2a')]('contacts.phone_home\x20=\x20\x22%s\x22',_0xa39c22),'order_by':'','offset':'0','select_fields':['id','name',_0x6ada('0x36')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x6ada('0x2d')](function(_0x543e4b){if(_0x543e4b[_0x6ada('0x2f')][_0x6ada('0x1b')]){var _0x2f7c49=_[_0x6ada('0x2e')](_0x543e4b[_0x6ada('0x2f')],function(_0x2ba141){return _0x2ba141[_0x6ada('0x30')][_0x6ada('0x36')]['value']===_0xa39c22;});if(_0x2f7c49){logger[_0x6ada('0xd')](_0x6ada('0x37'));return BPromise[_0x6ada('0x33')]({'id':_0x2f7c49[_0x6ada('0x30')]['id'][_0x6ada('0x31')],'name':_0x2f7c49[_0x6ada('0x30')][_0x6ada('0x19')][_0x6ada('0x31')],'phone':_0x2f7c49[_0x6ada('0x30')][_0x6ada('0x36')][_0x6ada('0x31')]});}}else{logger[_0x6ada('0xd')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'form':{'method':_0x6ada('0x20'),'input_type':'JSON','response_type':_0x6ada('0x27'),'rest_data':JSON[_0x6ada('0x21')]({'session':_0x3494f0['id'],'module_name':'Contacts','name_value_list':[{'name':'first_name','value':_0x56e4d8!==''?_0x56e4d8:util[_0x6ada('0x2a')](_0x6ada('0x38'),_0xa39c22)},{'name':_0x6ada('0x36'),'value':_0xa39c22}]})}})['then'](function(_0x54dd9c){logger[_0x6ada('0xd')](_0x6ada('0x39'));return BPromise[_0x6ada('0x33')]({'id':_0x54dd9c['id'],'name':_0x54dd9c[_0x6ada('0x2f')][_0x6ada('0x3a')]['value'],'phone':_0x54dd9c[_0x6ada('0x2f')][_0x6ada('0x36')]['value']});});}});}function request(_0x3f7df2){logger[_0x6ada('0x3b')](_0x6ada('0x3c'),JSON[_0x6ada('0x21')](_0x3f7df2));return rp(_[_0x6ada('0x3d')](def,_0x3f7df2));}function getTags(_0x2eb053,_0x5bcb5e){var _0x53af15=[];if(_0x2eb053&&_0x2eb053['length']>0x0){_0x53af15=_[_0x6ada('0x3e')](_0x2eb053,_0x5bcb5e);}return _0x53af15;}function getCustomFields(_0x5b6c31,_0x24dbc5){var _0x5ba626=[];var _0x33bcd6={'custom_fields':[]};if(_0x5b6c31[_0x6ada('0x1b')]>0x0){_[_0x6ada('0x1c')](_0x5b6c31,function(_0xc467c9){if(_0xc467c9[_0x6ada('0x3f')]===_0x6ada('0x40')&&_0xc467c9[_0x6ada('0x41')]&&!_0xc467c9[_0x6ada('0x42')]){_0x33bcd6[_0xc467c9[_0x6ada('0x41')][_0x6ada('0x43')]()]=_0xc467c9[_0x6ada('0x44')]['toString']();}else if(_0xc467c9[_0x6ada('0x3f')]===_0x6ada('0x40')&&_0xc467c9['idField']&&_0xc467c9[_0x6ada('0x42')]){_0x33bcd6[_0x6ada('0x45')][_0x6ada('0x1e')]({'id':_0xc467c9[_0x6ada('0x1f')],'value':_0xc467c9[_0x6ada('0x44')][_0x6ada('0x46')]()});}else if(_0xc467c9[_0x6ada('0x3f')]==='variable'&&_0xc467c9['variableName']&&_0xc467c9['idField']&&_0xc467c9['customField']){_0x24dbc5[_0xc467c9[_0x6ada('0x1d')]]&&_0x33bcd6[_0x6ada('0x45')][_0x6ada('0x1e')]({'id':_0xc467c9[_0x6ada('0x1f')],'value':_0x24dbc5[_0xc467c9[_0x6ada('0x1d')]][_0x6ada('0x46')]()});}else if(_0xc467c9['type']===_0x6ada('0x47')&&_0xc467c9['Variable']&&_0xc467c9[_0x6ada('0x48')]['name']&&_0xc467c9[_0x6ada('0x1f')]&&_0xc467c9[_0x6ada('0x42')]){_0x24dbc5[_0xc467c9['Variable'][_0x6ada('0x19')]['toLowerCase']()]&&_0x33bcd6[_0x6ada('0x45')]['push']({'id':_0xc467c9['idField'],'value':_0x24dbc5[_0xc467c9[_0x6ada('0x48')][_0x6ada('0x19')][_0x6ada('0x43')]()][_0x6ada('0x46')]()});}});}return _0x33bcd6;}function getConnection(_0x391f6d){return request({'method':_0x6ada('0xb'),'form':{'method':_0x6ada('0x49'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x6ada('0x21')]({'user_auth':{'user_name':_0x391f6d[_0x6ada('0x4a')],'password':_0x391f6d[_0x6ada('0x4b')],'encryption':'PLAIN'},'application':_0x6ada('0x4c')})}})[_0x6ada('0x2d')](function(_0x325180){var _0x5c9c07=_0x325180;if(_0x5c9c07['id']){def['sessionID']=_0x5c9c07['id'];return BPromise[_0x6ada('0x33')](_0x5c9c07);}else{throw new Error(util[_0x6ada('0x2a')]('Account\x20%d\x20is\x20not\x20valid',_0x391f6d['id']));}});}function setRelationship(_0x46ae89,_0x5d33f5,_0x32e5ac,_0x1b673b){return request({'form':{'method':_0x6ada('0x4d'),'input_type':_0x6ada('0x27'),'response_type':'JSON','rest_data':JSON[_0x6ada('0x21')]({'session':_0x46ae89['id'],'module_name':_0x6ada('0x22'),'module_id':_0x32e5ac['id'],'link_field_name':_0x1b673b,'related_ids':[_0x5d33f5['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x6ada('0x4e')]=function(_0x2548f1,_0x93d8b8,_0x2cb415,_0x361ee7,_0x23aaa4,_0x4bc0c0){var _0x1b74e6,_0x3321ef,_0x18f3f5,_0x9fc1c5;_0x4bc0c0['remoteUri']=intUtil[_0x6ada('0x4f')](_0x4bc0c0[_0x6ada('0x50')]);_0x4bc0c0['serverUrl']=intUtil[_0x6ada('0x4f')](_0x4bc0c0[_0x6ada('0x51')]);def[_0x6ada('0x52')]=util['format'](_0x6ada('0x53'),_0x4bc0c0[_0x6ada('0x50')]);if(_0x23aaa4&&_0x23aaa4['monitor_format']){logger[_0x6ada('0xd')](_0x6ada('0x54'),_0x6ada('0x55'));_0x93d8b8[_0x6ada('0x56')]=util[_0x6ada('0x2a')](_0x6ada('0x57'),_0x4bc0c0[_0x6ada('0x51')],_0x93d8b8[_0x6ada('0x58')],md5(_0x93d8b8[_0x6ada('0x58')]));}else{_0x93d8b8[_0x6ada('0x56')]='';}return getConnection(_0x4bc0c0)[_0x6ada('0x2d')](function(_0x50ae8f){_0x9fc1c5=_0x50ae8f;return getUser(_0x4bc0c0,_0x361ee7[_0x6ada('0x19')],_0x9fc1c5);})['then'](function(_0x35def1){_0x1b74e6=_0x35def1;logger[_0x6ada('0xd')]('The\x20User\x20ID\x20is:',_0x1b74e6['id']);return getEndUser(_0x4bc0c0,_0x93d8b8[_0x6ada('0x59')],_0x93d8b8['calleridnum'],_0x9fc1c5);})[_0x6ada('0x2d')](function(_0x47ec8e){_0x3321ef=_0x47ec8e;logger[_0x6ada('0xd')](_0x6ada('0x5a'),_0x3321ef['id']);return getTicket(_0x4bc0c0,_0x1b74e6,_0x3321ef,_0x2cb415,_0x93d8b8,_0x2cb415['Fields'],_0x9fc1c5,_0x6ada('0x5b'));})[_0x6ada('0x2d')](function(_0x9b3611){_0x18f3f5=_0x9b3611;logger['info'](_0x6ada('0x5c'));logger['info'](_0x6ada('0x5d'),_0x18f3f5['id']);return setRelationship(_0x9fc1c5,_0x1b74e6,_0x18f3f5,_0x6ada('0x5e'));})[_0x6ada('0x2d')](function(){return setRelationship(_0x9fc1c5,_0x3321ef,_0x18f3f5,_0x6ada('0x5f'));})[_0x6ada('0x2d')](function(){return getServerInfo(_0x9fc1c5);})['then'](function(_0x33dac4){var _0x58bdd0=parseInt(_0x33dac4['version'][_0x6ada('0x60')](0x0));var _0x1e93ad=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x4bc0c0['remoteUri'],_0x18f3f5['id']);if(_0x58bdd0>0x6){_0x1e93ad=util[_0x6ada('0x2a')](_0x6ada('0x61'),_0x4bc0c0[_0x6ada('0x50')],_0x18f3f5['id']);}logger['info'](_0x6ada('0x54'),_0x6ada('0x62'));emit(util[_0x6ada('0x2a')](_0x6ada('0x63'),_0x361ee7['name']),_0x6ada('0x64'),{'uri':_0x1e93ad});})[_0x6ada('0x65')](function(_0x4b0297){logger[_0x6ada('0x66')]('[QUEUE]',JSON[_0x6ada('0x21')](_0x4b0297));});};exports['outbound']=function(_0x357334,_0x1ba060,_0x3960ad,_0x2f8198,_0x248fdc,_0x5e187f,_0x1fe058){var _0x9f5d62,_0x403d53,_0x3a1094,_0x34dd99;_0x5e187f['remoteUri']=intUtil[_0x6ada('0x4f')](_0x5e187f[_0x6ada('0x50')]);_0x5e187f['serverUrl']=intUtil[_0x6ada('0x4f')](_0x5e187f[_0x6ada('0x51')]);def[_0x6ada('0x52')]=util[_0x6ada('0x2a')]('%s/service/v4_1/rest.php',_0x5e187f[_0x6ada('0x50')]);if(_0x1fe058&&_0x1fe058[_0x6ada('0x67')]&&_0x1fe058[_0x6ada('0x67')]!==_0x6ada('0x68')){logger[_0x6ada('0xd')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x1ba060[_0x6ada('0x56')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5e187f[_0x6ada('0x51')],_0x1ba060[_0x6ada('0x58')],md5(_0x1ba060['uniqueid']));}return getConnection(_0x5e187f)[_0x6ada('0x2d')](function(_0x1b398e){_0x34dd99=_0x1b398e;return getUser(_0x5e187f,_0x2f8198[_0x6ada('0x19')],_0x34dd99);})[_0x6ada('0x2d')](function(_0x379ec8){_0x9f5d62=_0x379ec8;logger[_0x6ada('0xd')](_0x6ada('0x69'),_0x9f5d62['id']);return getEndUser(_0x5e187f,_0x1ba060['destcalleridname'],_0x1ba060['destcalleridnum'],_0x34dd99);})[_0x6ada('0x2d')](function(_0x21f5d7){_0x403d53=_0x21f5d7;logger['info'](_0x6ada('0x5a'),_0x403d53['id']);return getTicket(_0x5e187f,_0x9f5d62,_0x403d53,_0x3960ad,_0x1ba060,_0x3960ad['Fields'],_0x34dd99,_0x6ada('0x6a'));})[_0x6ada('0x2d')](function(_0x2d614c){_0x3a1094=_0x2d614c;logger[_0x6ada('0xd')](_0x6ada('0x5c'));logger[_0x6ada('0xd')]('The\x20Ticket\x20ID\x20is:',_0x3a1094['id']);return setRelationship(_0x34dd99,_0x9f5d62,_0x3a1094,_0x6ada('0x5e'));})['then'](function(){return setRelationship(_0x34dd99,_0x403d53,_0x3a1094,_0x6ada('0x5f'));})[_0x6ada('0x2d')](function(){return getServerInfo(_0x34dd99);})[_0x6ada('0x2d')](function(_0x4e5d84){var _0x5a4e81=parseInt(_0x4e5d84['version'][_0x6ada('0x60')](0x0));var _0x41c542=util['format'](_0x6ada('0x6b'),_0x5e187f[_0x6ada('0x50')],_0x3a1094['id']);if(_0x5a4e81>0x6){_0x41c542=util[_0x6ada('0x2a')](_0x6ada('0x61'),_0x5e187f[_0x6ada('0x50')],_0x3a1094['id']);}logger[_0x6ada('0xd')](_0x6ada('0x6c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x6ada('0x2a')](_0x6ada('0x63'),_0x2f8198[_0x6ada('0x19')]),'trigger:browser:url',{'uri':_0x41c542});})['catch'](function(_0x5a32ac){logger[_0x6ada('0x66')](_0x6ada('0x6c'),JSON[_0x6ada('0x21')](_0x5a32ac));});};exports['unmanaged']=function(_0x39b128,_0x5ecca8,_0x45728c,_0x2eab01,_0x38768e,_0xab1863){var _0x52da4d,_0x9c9d10,_0xf2e334,_0x4e6269;_0xab1863[_0x6ada('0x50')]=intUtil[_0x6ada('0x4f')](_0xab1863['remoteUri']);_0xab1863[_0x6ada('0x51')]=intUtil[_0x6ada('0x4f')](_0xab1863['serverUrl']);def['uri']=util['format']('%s/service/v4_1/rest.php',_0xab1863[_0x6ada('0x50')]);if(_0x38768e&&_0x38768e['monitor_format']){logger[_0x6ada('0xd')]('['+_0x5ecca8[_0x6ada('0x6d')]['toUpperCase']()+']',_0x6ada('0x55'));_0x5ecca8[_0x6ada('0x56')]=util[_0x6ada('0x2a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xab1863[_0x6ada('0x51')],_0x5ecca8[_0x6ada('0x58')],md5(_0x5ecca8[_0x6ada('0x58')]));}else{_0x5ecca8[_0x6ada('0x56')]='';}return getConnection(_0xab1863)[_0x6ada('0x2d')](function(_0x161f29){_0x4e6269=_0x161f29;if(!_['isNil'](_0x2eab01)){return getUser(_0xab1863,_0x2eab01[_0x6ada('0x19')],_0x4e6269);}else{return getUser(_0xab1863,null,_0x4e6269);}})[_0x6ada('0x2d')](function(_0x2b38fa){_0x52da4d=_0x2b38fa;logger['info'](_0x6ada('0x69'),_0x52da4d['id']);return getEndUser(_0xab1863,_0x5ecca8['calleridname'],_0x5ecca8[_0x6ada('0x6e')],_0x4e6269);})['then'](function(_0x2a72c3){_0x9c9d10=_0x2a72c3;logger['info'](_0x6ada('0x5a'),_0x9c9d10['id']);return getTicket(_0xab1863,_0x52da4d,_0x9c9d10,_0x45728c,_0x5ecca8,_0x45728c[_0x6ada('0x6f')],_0x4e6269,_0x6ada('0x5b'));})[_0x6ada('0x2d')](function(_0x8a9697){_0xf2e334=_0x8a9697;logger[_0x6ada('0xd')](_0x6ada('0x5c'));logger[_0x6ada('0xd')](_0x6ada('0x5d'),_0xf2e334['id']);return setRelationship(_0x4e6269,_0x52da4d,_0xf2e334,_0x6ada('0x5e'));})['then'](function(){return setRelationship(_0x4e6269,_0x9c9d10,_0xf2e334,_0x6ada('0x5f'));})[_0x6ada('0x2d')](function(){return getServerInfo(_0x4e6269);})[_0x6ada('0x65')](function(_0xdeaca7){logger[_0x6ada('0x66')]('['+_0x5ecca8[_0x6ada('0x6d')][_0x6ada('0x70')]()+']',JSON[_0x6ada('0x21')](_0xdeaca7));});}; \ No newline at end of file +var _0x5b0c=['slice','replace','duration_hours','duration_minutes','Contacts','direction','length','forEach','variableName','push','set_entry','JSON','stringify','Calls','format','apiKey','toString','base64','get_server_info','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','entry_list','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','type','string','customField','nameField','toLowerCase','idField','variable','custom_fields','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','version','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','contacts','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','unmanaged','uri','%s/service/v4_1/rest.php','lastevent','recordingURL','isNil','calleridnum','toUpperCase','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','date_start'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0x5b0c,0x68));var _0xc5b0=function(_0x10b434,_0x521745){_0x10b434=_0x10b434-0x0;var _0x31050b=_0x5b0c[_0x10b434];return _0x31050b;};'use strict';var _=require(_0xc5b0('0x0'));var rp=require(_0xc5b0('0x1'));var BPromise=require('bluebird');var md5=require('md5');var util=require(_0xc5b0('0x2'));var Redis=require(_0xc5b0('0x3'));var intUtil=require(_0xc5b0('0x4'));var config=require(_0xc5b0('0x5'));var logger=require(_0xc5b0('0x6'))(_0xc5b0('0x7'));config[_0xc5b0('0x8')]=_['defaults'](config[_0xc5b0('0x8')],{'host':_0xc5b0('0x9'),'port':0x18eb});var io=require(_0xc5b0('0xa'))(new Redis(config[_0xc5b0('0x8')]));var def={'method':_0xc5b0('0xb'),'json':!![]};function emit(_0x554266,_0x51a2a4,_0x36ad54){io['to'](_0x554266)[_0xc5b0('0xc')](_0x51a2a4,_0x36ad54);}function getTicket(_0x28f2fd,_0x2498fc,_0x5cbf6d,_0x50518f,_0x42fcc4,_0x30714b,_0x23e277,_0x4d3d3b){logger[_0xc5b0('0xd')](_0xc5b0('0xe'));var _0x532150=new Date();var _0x2fd924=[{'name':_0xc5b0('0xf'),'value':intUtil[_0xc5b0('0x10')](_0x50518f[_0xc5b0('0x11')],_0x42fcc4,'\x20')},{'name':'assigned_user_id','value':_0x2498fc['id']},{'name':_0xc5b0('0x12'),'value':_0x2498fc['id']},{'name':_0xc5b0('0x13'),'value':intUtil[_0xc5b0('0x10')](_0x50518f['Descriptions'],_0x42fcc4,'\x0a')},{'name':_0xc5b0('0x14'),'value':_0x532150['toISOString']()[_0xc5b0('0x15')](0x0,0x13)[_0xc5b0('0x16')]('T','\x20')},{'name':_0xc5b0('0x17'),'value':'0'},{'name':_0xc5b0('0x18'),'value':'15'},{'name':'parent_id','value':_0x5cbf6d['id']},{'name':'parent_type','value':_0xc5b0('0x19')},{'name':'parent_name','value':_0x5cbf6d['name']},{'name':_0xc5b0('0x1a'),'value':_0x4d3d3b}];if(_0x30714b[_0xc5b0('0x1b')]){_[_0xc5b0('0x1c')](_0x30714b,function(_0x554039){if(_0x42fcc4[_0x554039[_0xc5b0('0x1d')]]){_0x2fd924[_0xc5b0('0x1e')]({'name':_0x554039['idField'],'value':_0x42fcc4[_0x554039[_0xc5b0('0x1d')]]});}});}return request({'form':{'method':_0xc5b0('0x1f'),'input_type':_0xc5b0('0x20'),'response_type':'JSON','rest_data':JSON[_0xc5b0('0x21')]({'session':_0x23e277['id'],'module_name':_0xc5b0('0x22'),'name_value_list':_0x2fd924})}});}function getAuth(_0x11c0a3){return util[_0xc5b0('0x23')]('Basic\x20%s',new Buffer(_0x11c0a3[_0xc5b0('0x24')]+':X')[_0xc5b0('0x25')](_0xc5b0('0x26')));}function getServerInfo(_0x4efdb9){return request({'form':{'method':_0xc5b0('0x27'),'input_type':'JSON','response_type':_0xc5b0('0x20'),'rest_data':JSON[_0xc5b0('0x21')]({'session':_0x4efdb9['id']})}});}function getUser(_0x50363d,_0x7de334,_0x34e35a){if(!_['isNil'](_0x7de334)){logger['info'](_0xc5b0('0x28'),_0x7de334);return request({'form':{'method':_0xc5b0('0x29'),'input_type':_0xc5b0('0x20'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x34e35a['id'],'module_name':_0xc5b0('0x2a'),'query':util[_0xc5b0('0x23')](_0xc5b0('0x2b'),_0x7de334),'order_by':'','offset':'0','select_fields':['id','name',_0xc5b0('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x8954a6){if(_0x8954a6['entry_list'][_0xc5b0('0x1b')]){var _0x105b1a=_['find'](_0x8954a6['entry_list'],function(_0x8003c2){return _0x8003c2[_0xc5b0('0x2d')][_0xc5b0('0x2c')][_0xc5b0('0x2e')]===_0x7de334;});if(_0x105b1a){logger[_0xc5b0('0xd')]('Agent\x20found!');return BPromise[_0xc5b0('0x2f')]({'id':_0x105b1a[_0xc5b0('0x2d')]['id'][_0xc5b0('0x2e')],'name':_0x105b1a['name_value_list'][_0xc5b0('0xf')][_0xc5b0('0x2e')]});}}logger[_0xc5b0('0xd')](_0xc5b0('0x30'));return BPromise[_0xc5b0('0x2f')]({'id':_0x34e35a[_0xc5b0('0x2d')][_0xc5b0('0x31')][_0xc5b0('0x2e')],'name':_0x34e35a['name_value_list'][_0xc5b0('0x2c')][_0xc5b0('0x2e')]});});}else{logger[_0xc5b0('0xd')](_0xc5b0('0x32'));return BPromise[_0xc5b0('0x2f')]({'id':_0x34e35a[_0xc5b0('0x2d')][_0xc5b0('0x31')]['value'],'name':_0x34e35a[_0xc5b0('0x2d')][_0xc5b0('0x2c')][_0xc5b0('0x2e')]});}}function getEndUser(_0x13bd2a,_0x391466,_0x551665,_0xa606bb){logger[_0xc5b0('0xd')](_0xc5b0('0x33'),_0x551665);return request({'form':{'method':'get_entry_list','input_type':_0xc5b0('0x20'),'response_type':_0xc5b0('0x20'),'rest_data':JSON['stringify']({'session':_0xa606bb['id'],'module_name':_0xc5b0('0x19'),'query':util[_0xc5b0('0x23')](_0xc5b0('0x34'),_0x551665),'order_by':'','offset':'0','select_fields':['id',_0xc5b0('0xf'),_0xc5b0('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xc5b0('0x36')](function(_0x125cbe){if(_0x125cbe[_0xc5b0('0x37')][_0xc5b0('0x1b')]){var _0x2e5c9e=_[_0xc5b0('0x38')](_0x125cbe[_0xc5b0('0x37')],function(_0x5a0722){return _0x5a0722[_0xc5b0('0x2d')]['phone_home'][_0xc5b0('0x2e')]===_0x551665;});if(_0x2e5c9e){logger[_0xc5b0('0xd')](_0xc5b0('0x39'));return BPromise[_0xc5b0('0x2f')]({'id':_0x2e5c9e[_0xc5b0('0x2d')]['id']['value'],'name':_0x2e5c9e['name_value_list'][_0xc5b0('0xf')]['value'],'phone':_0x2e5c9e['name_value_list'][_0xc5b0('0x35')][_0xc5b0('0x2e')]});}}else{logger[_0xc5b0('0xd')](_0xc5b0('0x3a'));return request({'form':{'method':'set_entry','input_type':_0xc5b0('0x20'),'response_type':_0xc5b0('0x20'),'rest_data':JSON['stringify']({'session':_0xa606bb['id'],'module_name':_0xc5b0('0x19'),'name_value_list':[{'name':_0xc5b0('0x3b'),'value':_0x391466!==''?_0x391466:util[_0xc5b0('0x23')](_0xc5b0('0x3c'),_0x551665)},{'name':_0xc5b0('0x35'),'value':_0x551665}]})}})['then'](function(_0x2d1495){logger['info'](_0xc5b0('0x3d'));return BPromise[_0xc5b0('0x2f')]({'id':_0x2d1495['id'],'name':_0x2d1495[_0xc5b0('0x37')][_0xc5b0('0x3b')][_0xc5b0('0x2e')],'phone':_0x2d1495['entry_list']['phone_home'][_0xc5b0('0x2e')]});});}});}function request(_0x3ef361){logger[_0xc5b0('0x3e')](_0xc5b0('0x3f'),JSON[_0xc5b0('0x21')](_0x3ef361));return rp(_[_0xc5b0('0x40')](def,_0x3ef361));}function getTags(_0x3a8a8d,_0x2031b0){var _0x52916e=[];if(_0x3a8a8d&&_0x3a8a8d[_0xc5b0('0x1b')]>0x0){_0x52916e=_[_0xc5b0('0x41')](_0x3a8a8d,_0x2031b0);}return _0x52916e;}function getCustomFields(_0x8be504,_0x1e6bc7){var _0x42ad48=[];var _0xb263e8={'custom_fields':[]};if(_0x8be504[_0xc5b0('0x1b')]>0x0){_['forEach'](_0x8be504,function(_0xfec533){if(_0xfec533[_0xc5b0('0x42')]===_0xc5b0('0x43')&&_0xfec533['nameField']&&!_0xfec533[_0xc5b0('0x44')]){_0xb263e8[_0xfec533[_0xc5b0('0x45')][_0xc5b0('0x46')]()]=_0xfec533['content'][_0xc5b0('0x25')]();}else if(_0xfec533[_0xc5b0('0x42')]==='string'&&_0xfec533[_0xc5b0('0x47')]&&_0xfec533[_0xc5b0('0x44')]){_0xb263e8['custom_fields'][_0xc5b0('0x1e')]({'id':_0xfec533[_0xc5b0('0x47')],'value':_0xfec533['content'][_0xc5b0('0x25')]()});}else if(_0xfec533[_0xc5b0('0x42')]===_0xc5b0('0x48')&&_0xfec533['variableName']&&_0xfec533[_0xc5b0('0x47')]&&_0xfec533[_0xc5b0('0x44')]){_0x1e6bc7[_0xfec533['variableName']]&&_0xb263e8[_0xc5b0('0x49')]['push']({'id':_0xfec533['idField'],'value':_0x1e6bc7[_0xfec533[_0xc5b0('0x1d')]][_0xc5b0('0x25')]()});}else if(_0xfec533['type']==='customVariable'&&_0xfec533['Variable']&&_0xfec533['Variable'][_0xc5b0('0xf')]&&_0xfec533['idField']&&_0xfec533[_0xc5b0('0x44')]){_0x1e6bc7[_0xfec533[_0xc5b0('0x4a')][_0xc5b0('0xf')]['toLowerCase']()]&&_0xb263e8[_0xc5b0('0x49')][_0xc5b0('0x1e')]({'id':_0xfec533['idField'],'value':_0x1e6bc7[_0xfec533[_0xc5b0('0x4a')][_0xc5b0('0xf')]['toLowerCase']()][_0xc5b0('0x25')]()});}});}return _0xb263e8;}function getConnection(_0xff4723){return request({'method':_0xc5b0('0xb'),'form':{'method':_0xc5b0('0x4b'),'input_type':_0xc5b0('0x20'),'response_type':_0xc5b0('0x20'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0xff4723[_0xc5b0('0x4c')],'password':_0xff4723[_0xc5b0('0x4d')],'encryption':_0xc5b0('0x4e')},'application':_0xc5b0('0x4f')})}})['then'](function(_0x11dc09){var _0x2ac649=_0x11dc09;if(_0x2ac649['id']){def[_0xc5b0('0x50')]=_0x2ac649['id'];return BPromise[_0xc5b0('0x2f')](_0x2ac649);}else{throw new Error(util['format'](_0xc5b0('0x51'),_0xff4723['id']));}});}function setRelationship(_0x473d45,_0x31c27a,_0x35c0b3,_0x3d310d){return request({'form':{'method':_0xc5b0('0x52'),'input_type':_0xc5b0('0x20'),'response_type':_0xc5b0('0x20'),'rest_data':JSON[_0xc5b0('0x21')]({'session':_0x473d45['id'],'module_name':'Calls','module_id':_0x35c0b3['id'],'link_field_name':_0x3d310d,'related_ids':[_0x31c27a['id']],'name_value_list':[],'delete':0x0})}});}exports[_0xc5b0('0x53')]=function(_0x35d2e0,_0x51e16b,_0x1aac01,_0x3d75ae,_0x18eefb,_0x36a5f0){var _0x3cec99,_0x4318db,_0x115903,_0x2b50a1;_0x36a5f0[_0xc5b0('0x54')]=intUtil[_0xc5b0('0x55')](_0x36a5f0['remoteUri']);_0x36a5f0[_0xc5b0('0x56')]=intUtil[_0xc5b0('0x55')](_0x36a5f0['serverUrl']);def['uri']=util[_0xc5b0('0x23')]('%s/service/v4_1/rest.php',_0x36a5f0[_0xc5b0('0x54')]);if(_0x18eefb&&_0x18eefb[_0xc5b0('0x57')]){logger['info'](_0xc5b0('0x58'),_0xc5b0('0x59'));_0x51e16b['recordingURL']=util[_0xc5b0('0x23')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x36a5f0[_0xc5b0('0x56')],_0x51e16b[_0xc5b0('0x5a')],md5(_0x51e16b[_0xc5b0('0x5a')]));}else{_0x51e16b['recordingURL']='';}return getConnection(_0x36a5f0)[_0xc5b0('0x36')](function(_0x42ceee){_0x2b50a1=_0x42ceee;return getUser(_0x36a5f0,_0x3d75ae[_0xc5b0('0xf')],_0x2b50a1);})[_0xc5b0('0x36')](function(_0x1c3900){_0x3cec99=_0x1c3900;logger[_0xc5b0('0xd')]('The\x20User\x20ID\x20is:',_0x3cec99['id']);return getEndUser(_0x36a5f0,_0x51e16b[_0xc5b0('0x5b')],_0x51e16b['calleridnum'],_0x2b50a1);})[_0xc5b0('0x36')](function(_0x556a93){_0x4318db=_0x556a93;logger[_0xc5b0('0xd')](_0xc5b0('0x5c'),_0x4318db['id']);return getTicket(_0x36a5f0,_0x3cec99,_0x4318db,_0x1aac01,_0x51e16b,_0x1aac01[_0xc5b0('0x5d')],_0x2b50a1,_0xc5b0('0x5e'));})[_0xc5b0('0x36')](function(_0x58d8f1){_0x115903=_0x58d8f1;logger[_0xc5b0('0xd')](_0xc5b0('0x5f'));logger[_0xc5b0('0xd')](_0xc5b0('0x60'),_0x115903['id']);return setRelationship(_0x2b50a1,_0x3cec99,_0x115903,_0xc5b0('0x61'));})[_0xc5b0('0x36')](function(){return setRelationship(_0x2b50a1,_0x4318db,_0x115903,'contacts');})[_0xc5b0('0x36')](function(){return getServerInfo(_0x2b50a1);})[_0xc5b0('0x36')](function(_0x245cff){var _0x391b61=parseInt(_0x245cff[_0xc5b0('0x62')]['charAt'](0x0));var _0x434469=util[_0xc5b0('0x23')](_0xc5b0('0x63'),_0x36a5f0[_0xc5b0('0x54')],_0x115903['id']);if(_0x391b61>0x6){_0x434469=util[_0xc5b0('0x23')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x36a5f0[_0xc5b0('0x54')],_0x115903['id']);}logger[_0xc5b0('0xd')]('[QUEUE]',_0xc5b0('0x64'));emit(util[_0xc5b0('0x23')](_0xc5b0('0x65'),_0x3d75ae['name']),_0xc5b0('0x66'),{'uri':_0x434469});})[_0xc5b0('0x67')](function(_0x292d42){logger[_0xc5b0('0x68')](_0xc5b0('0x58'),JSON['stringify'](_0x292d42));});};exports[_0xc5b0('0x69')]=function(_0x5cecb1,_0x555f65,_0xdd3c20,_0x472239,_0x2eeebc,_0x412e1f,_0x46da28){var _0x5cb609,_0x370582,_0x8b8e93,_0x223c9c;_0x412e1f[_0xc5b0('0x54')]=intUtil[_0xc5b0('0x55')](_0x412e1f[_0xc5b0('0x54')]);_0x412e1f[_0xc5b0('0x56')]=intUtil[_0xc5b0('0x55')](_0x412e1f[_0xc5b0('0x56')]);def['uri']=util['format']('%s/service/v4_1/rest.php',_0x412e1f[_0xc5b0('0x54')]);if(_0x46da28&&_0x46da28[_0xc5b0('0x6a')]&&_0x46da28[_0xc5b0('0x6a')]!==_0xc5b0('0x6b')){logger[_0xc5b0('0xd')](_0xc5b0('0x6c'),'Recording\x20is\x20enabled!');_0x555f65['recordingURL']=util[_0xc5b0('0x23')](_0xc5b0('0x6d'),_0x412e1f['serverUrl'],_0x555f65[_0xc5b0('0x5a')],md5(_0x555f65['uniqueid']));}return getConnection(_0x412e1f)[_0xc5b0('0x36')](function(_0x138517){_0x223c9c=_0x138517;return getUser(_0x412e1f,_0x472239[_0xc5b0('0xf')],_0x223c9c);})[_0xc5b0('0x36')](function(_0x4cfec4){_0x5cb609=_0x4cfec4;logger[_0xc5b0('0xd')](_0xc5b0('0x6e'),_0x5cb609['id']);return getEndUser(_0x412e1f,_0x555f65[_0xc5b0('0x6f')],_0x555f65[_0xc5b0('0x70')],_0x223c9c);})[_0xc5b0('0x36')](function(_0x28fce1){_0x370582=_0x28fce1;logger[_0xc5b0('0xd')](_0xc5b0('0x5c'),_0x370582['id']);return getTicket(_0x412e1f,_0x5cb609,_0x370582,_0xdd3c20,_0x555f65,_0xdd3c20['Fields'],_0x223c9c,_0xc5b0('0x71'));})['then'](function(_0x476481){_0x8b8e93=_0x476481;logger[_0xc5b0('0xd')](_0xc5b0('0x5f'));logger[_0xc5b0('0xd')](_0xc5b0('0x60'),_0x8b8e93['id']);return setRelationship(_0x223c9c,_0x5cb609,_0x8b8e93,_0xc5b0('0x61'));})[_0xc5b0('0x36')](function(){return setRelationship(_0x223c9c,_0x370582,_0x8b8e93,_0xc5b0('0x72'));})[_0xc5b0('0x36')](function(){return getServerInfo(_0x223c9c);})[_0xc5b0('0x36')](function(_0x1b1152){var _0x44826c=parseInt(_0x1b1152[_0xc5b0('0x62')][_0xc5b0('0x73')](0x0));var _0x514898=util[_0xc5b0('0x23')](_0xc5b0('0x63'),_0x412e1f[_0xc5b0('0x54')],_0x8b8e93['id']);if(_0x44826c>0x6){_0x514898=util[_0xc5b0('0x23')](_0xc5b0('0x74'),_0x412e1f['remoteUri'],_0x8b8e93['id']);}logger['info'](_0xc5b0('0x6c'),_0xc5b0('0x64'));emit(util[_0xc5b0('0x23')]('user:%s',_0x472239[_0xc5b0('0xf')]),_0xc5b0('0x66'),{'uri':_0x514898});})[_0xc5b0('0x67')](function(_0x2de54d){logger[_0xc5b0('0x68')]('[OUTBOUND]',JSON['stringify'](_0x2de54d));});};exports[_0xc5b0('0x75')]=function(_0x208646,_0xfb1809,_0x1a2f6a,_0x5becd7,_0x20a29c,_0x4b27a6){var _0x5c7844,_0x360782,_0x3fc1e5,_0x5a8952;_0x4b27a6[_0xc5b0('0x54')]=intUtil[_0xc5b0('0x55')](_0x4b27a6[_0xc5b0('0x54')]);_0x4b27a6['serverUrl']=intUtil[_0xc5b0('0x55')](_0x4b27a6['serverUrl']);def[_0xc5b0('0x76')]=util[_0xc5b0('0x23')](_0xc5b0('0x77'),_0x4b27a6['remoteUri']);if(_0x20a29c&&_0x20a29c[_0xc5b0('0x57')]){logger[_0xc5b0('0xd')]('['+_0xfb1809[_0xc5b0('0x78')]['toUpperCase']()+']','Recording\x20is\x20enabled!');_0xfb1809[_0xc5b0('0x79')]=util['format'](_0xc5b0('0x6d'),_0x4b27a6[_0xc5b0('0x56')],_0xfb1809['uniqueid'],md5(_0xfb1809[_0xc5b0('0x5a')]));}else{_0xfb1809['recordingURL']='';}return getConnection(_0x4b27a6)['then'](function(_0x3995a7){_0x5a8952=_0x3995a7;if(!_[_0xc5b0('0x7a')](_0x5becd7)){return getUser(_0x4b27a6,_0x5becd7[_0xc5b0('0xf')],_0x5a8952);}else{return getUser(_0x4b27a6,null,_0x5a8952);}})[_0xc5b0('0x36')](function(_0x529da6){_0x5c7844=_0x529da6;logger[_0xc5b0('0xd')](_0xc5b0('0x6e'),_0x5c7844['id']);return getEndUser(_0x4b27a6,_0xfb1809['calleridname'],_0xfb1809[_0xc5b0('0x7b')],_0x5a8952);})['then'](function(_0x36026a){_0x360782=_0x36026a;logger[_0xc5b0('0xd')]('The\x20Enduser\x20ID\x20is:',_0x360782['id']);return getTicket(_0x4b27a6,_0x5c7844,_0x360782,_0x1a2f6a,_0xfb1809,_0x1a2f6a['Fields'],_0x5a8952,_0xc5b0('0x5e'));})[_0xc5b0('0x36')](function(_0xcd304a){_0x3fc1e5=_0xcd304a;logger[_0xc5b0('0xd')](_0xc5b0('0x5f'));logger[_0xc5b0('0xd')](_0xc5b0('0x60'),_0x3fc1e5['id']);return setRelationship(_0x5a8952,_0x5c7844,_0x3fc1e5,'users');})[_0xc5b0('0x36')](function(){return setRelationship(_0x5a8952,_0x360782,_0x3fc1e5,'contacts');})[_0xc5b0('0x36')](function(){return getServerInfo(_0x5a8952);})[_0xc5b0('0x67')](function(_0x3f13c4){logger['error']('['+_0xfb1809[_0xc5b0('0x78')][_0xc5b0('0x7c')]()+']',JSON[_0xc5b0('0x21')](_0x3f13c4));});}; \ 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 b6231c7..8538622 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 _0xd8fe=['lodash','util','getString','length','string','push','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','test'];(function(_0x34217f,_0x4954d9){var _0x533721=function(_0x5ea689){while(--_0x5ea689){_0x34217f['push'](_0x34217f['shift']());}};_0x533721(++_0x4954d9);}(_0xd8fe,0xa2));var _0xed8f=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0xd8fe[_0x65c50e];return _0x4573e7;};'use strict';var _=require(_0xed8f('0x0'));var util=require(_0xed8f('0x1'));exports[_0xed8f('0x2')]=function(_0x8b694c,_0x4f8f91,_0x88348f){var _0x5a5cc1=[];if(_0x8b694c[_0xed8f('0x3')]>0x0){var _0x238aaa=_['sortBy'](_0x8b694c,['id']);for(var _0x26a50e=0x0;_0x26a50e<_0x238aaa[_0xed8f('0x3')];_0x26a50e++){var _0x20c641=_0x238aaa[_0x26a50e];if(_0x20c641['type']===_0xed8f('0x4')){_0x5a5cc1[_0xed8f('0x5')](_0x20c641['content']);}else if(_0x20c641[_0xed8f('0x6')]===_0xed8f('0x7')&&_0x20c641[_0xed8f('0x8')]){_0x4f8f91[_0x20c641['variableName']]&&_0x5a5cc1[_0xed8f('0x5')](_0x4f8f91[_0x20c641[_0xed8f('0x8')]][_0xed8f('0x9')]());}else if(_0x20c641['type']===_0xed8f('0xa')&&_0x20c641[_0xed8f('0xb')]&&_0x20c641[_0xed8f('0xb')][_0xed8f('0xc')]){_0x4f8f91[_0x20c641[_0xed8f('0xb')][_0xed8f('0xc')]['toLowerCase']()]&&_0x5a5cc1[_0xed8f('0x5')](_0x4f8f91[_0x20c641[_0xed8f('0xb')]['name'][_0xed8f('0xd')]()][_0xed8f('0x9')]());}else if(_0x20c641[_0xed8f('0x6')]===_0xed8f('0xe')){if(_0x20c641[_0xed8f('0xf')]===_0xed8f('0x4')&&_0x20c641[_0xed8f('0x10')]){_0x5a5cc1[_0xed8f('0x5')](util[_0xed8f('0x11')](_0xed8f('0x12'),_0x20c641[_0xed8f('0x10')],_0x20c641[_0xed8f('0x13')]));}else if(_0x20c641[_0xed8f('0xf')]===_0xed8f('0x7')&&_0x20c641[_0xed8f('0x8')]&&_0x20c641['key']){_0x4f8f91[_0x20c641[_0xed8f('0x8')]]&&_0x5a5cc1[_0xed8f('0x5')](util[_0xed8f('0x11')]('%s:\x20%s',_0x20c641[_0xed8f('0x10')],_0x4f8f91[_0x20c641[_0xed8f('0x8')]]));}else if(_0x20c641[_0xed8f('0xf')]===_0xed8f('0xa')&&_0x20c641[_0xed8f('0xb')]&&_0x20c641[_0xed8f('0xb')]['name']&&_0x20c641['key']){_0x4f8f91[_0x20c641[_0xed8f('0xb')][_0xed8f('0xc')][_0xed8f('0xd')]()]&&_0x5a5cc1[_0xed8f('0x5')](util['format'](_0xed8f('0x12'),_0x20c641[_0xed8f('0x10')],_0x4f8f91[_0x20c641[_0xed8f('0xb')]['name'][_0xed8f('0xd')]()]));}}}}return _0x5a5cc1[_0xed8f('0x14')](_0x88348f);};exports[_0xed8f('0x15')]=function(_0x3bdfa1){var _0x4c221e=_0x3bdfa1[_0xed8f('0x16')](-0x1);if(_0x4c221e==='/'){_0x3bdfa1=_0x3bdfa1[_0xed8f('0x17')](0x0,_0x3bdfa1[_0xed8f('0x18')](_0x4c221e));}return _0x3bdfa1;};exports[_0xed8f('0x19')]=function(_0x3b025a){if(!_['isNil'](_0x3b025a)&&_0x3b025a!==''){var _0x46ea6f=/^(([^<>()\[\]\\.,;:\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 _0x46ea6f[_0xed8f('0x1a')](String(_0x3b025a)[_0xed8f('0xd')]());}else{return![];}}; \ No newline at end of file +var _0x25f6=['customVariable','Variable','name','toLowerCase','keyValue','keyType','string','%s:\x20%s','key','keyContent','join','stripTrailingSlash','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','sortBy','length','type','push','content','variable','variableName','toString'];(function(_0x43dcd9,_0x46c400){var _0x385d33=function(_0x3c9949){while(--_0x3c9949){_0x43dcd9['push'](_0x43dcd9['shift']());}};_0x385d33(++_0x46c400);}(_0x25f6,0x98));var _0x625f=function(_0x47b1a9,_0x14e74f){_0x47b1a9=_0x47b1a9-0x0;var _0x1be6e2=_0x25f6[_0x47b1a9];return _0x1be6e2;};'use strict';var _=require(_0x625f('0x0'));var util=require(_0x625f('0x1'));exports['getString']=function(_0x26ebb3,_0x202be9,_0x3050ec){var _0x18881a=[];if(_0x26ebb3['length']>0x0){var _0x5e562c=_[_0x625f('0x2')](_0x26ebb3,['id']);for(var _0x2c81cd=0x0;_0x2c81cd<_0x5e562c[_0x625f('0x3')];_0x2c81cd++){var _0x16c9d7=_0x5e562c[_0x2c81cd];if(_0x16c9d7[_0x625f('0x4')]==='string'){_0x18881a[_0x625f('0x5')](_0x16c9d7[_0x625f('0x6')]);}else if(_0x16c9d7[_0x625f('0x4')]===_0x625f('0x7')&&_0x16c9d7[_0x625f('0x8')]){_0x202be9[_0x16c9d7[_0x625f('0x8')]]&&_0x18881a['push'](_0x202be9[_0x16c9d7[_0x625f('0x8')]][_0x625f('0x9')]());}else if(_0x16c9d7['type']===_0x625f('0xa')&&_0x16c9d7['Variable']&&_0x16c9d7[_0x625f('0xb')][_0x625f('0xc')]){_0x202be9[_0x16c9d7[_0x625f('0xb')]['name'][_0x625f('0xd')]()]&&_0x18881a['push'](_0x202be9[_0x16c9d7['Variable']['name'][_0x625f('0xd')]()][_0x625f('0x9')]());}else if(_0x16c9d7['type']===_0x625f('0xe')){if(_0x16c9d7[_0x625f('0xf')]===_0x625f('0x10')&&_0x16c9d7['key']){_0x18881a[_0x625f('0x5')](util['format'](_0x625f('0x11'),_0x16c9d7[_0x625f('0x12')],_0x16c9d7[_0x625f('0x13')]));}else if(_0x16c9d7['keyType']===_0x625f('0x7')&&_0x16c9d7['variableName']&&_0x16c9d7[_0x625f('0x12')]){_0x202be9[_0x16c9d7['variableName']]&&_0x18881a[_0x625f('0x5')](util['format'](_0x625f('0x11'),_0x16c9d7['key'],_0x202be9[_0x16c9d7[_0x625f('0x8')]]));}else if(_0x16c9d7[_0x625f('0xf')]===_0x625f('0xa')&&_0x16c9d7['Variable']&&_0x16c9d7[_0x625f('0xb')][_0x625f('0xc')]&&_0x16c9d7[_0x625f('0x12')]){_0x202be9[_0x16c9d7['Variable'][_0x625f('0xc')][_0x625f('0xd')]()]&&_0x18881a[_0x625f('0x5')](util['format']('%s:\x20%s',_0x16c9d7['key'],_0x202be9[_0x16c9d7[_0x625f('0xb')][_0x625f('0xc')]['toLowerCase']()]));}}}}return _0x18881a[_0x625f('0x14')](_0x3050ec);};exports[_0x625f('0x15')]=function(_0x339c68){var _0xbf34e5=_0x339c68['slice'](-0x1);if(_0xbf34e5==='/'){_0x339c68=_0x339c68[_0x625f('0x16')](0x0,_0x339c68[_0x625f('0x17')](_0xbf34e5));}return _0x339c68;};exports[_0x625f('0x18')]=function(_0x5248ce){if(!_[_0x625f('0x19')](_0x5248ce)&&_0x5248ce!==''){var _0x3d4ead=/^(([^<>()\[\]\\.,;:\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 _0x3d4ead[_0x625f('0x1a')](String(_0x5248ce)['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 044a0fc..704f507 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 _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','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','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x1381df,_0xa4f9e9){var _0x3dd915=function(_0x104735){while(--_0x104735){_0x1381df['push'](_0x1381df['shift']());}};_0x3dd915(++_0xa4f9e9);}(_0xe706,0xa3));var _0x6e70=function(_0x59c6dc,_0x2f43d2){_0x59c6dc=_0x59c6dc-0x0;var _0x3ae1b6=_0xe706[_0x59c6dc];return _0x3ae1b6;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x1b8396,_0x191315){var _0x3f29c=function(_0x22cdd7){while(--_0x22cdd7){_0x1b8396['push'](_0x1b8396['shift']());}};_0x3f29c(++_0x191315);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ 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 c1ee891..aa608f1 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 _0x803a=['count','Agent\x20found!','results','agent','%s/users/me.json','remoteUri','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','filter','end-user','length','Enduser\x20found!','%s/users.json','POST','Enduser\x20created.','authType','%s:%s','username','password','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','defaults','map','forEach','includes','string','picklist','type','nameField','customField','toLowerCase','content','idField','custom_fields','push','variable','variableName','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','uniqueid','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','newTab','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','Zendesk\x20account\x20type\x20not\x20recognized','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridnum','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','/api/v2','inspect','unmanaged','toUpperCase','lastevent','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','application/json','info','merge','Tags','getString','Subjects','Fields','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','format'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0x803a,0x1a9));var _0xa803=function(_0x31df30,_0x571312){_0x31df30=_0x31df30-0x0;var _0x54811b=_0x803a[_0x31df30];return _0x54811b;};'use strict';var _=require(_0xa803('0x0'));var rp=require(_0xa803('0x1'));var md5=require(_0xa803('0x2'));var util=require(_0xa803('0x3'));var Redis=require(_0xa803('0x4'));var intUtil=require('./util');var config=require(_0xa803('0x5'));var logger=require(_0xa803('0x6'))(_0xa803('0x7'));config[_0xa803('0x8')]=_['defaults'](config['redis'],{'host':_0xa803('0x9'),'port':0x18eb});var io=require(_0xa803('0xa'))(new Redis(config[_0xa803('0x8')]));function emit(_0x319bdf,_0x1df017,_0xc1a847){io['to'](_0x319bdf)['emit'](_0x1df017,_0xc1a847);}var headers={'Content-Type':'application/json','Accept':_0xa803('0xb')};function getTicket(_0x3f93cd,_0x11c797,_0x25734e,_0x1642b4,_0x5d5c03){logger[_0xa803('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util['format']('%s/tickets.json',_0x3f93cd['remoteUri']),'method':'POST','body':{'ticket':_[_0xa803('0xd')]({'requester_id':_0x25734e['id'],'submitter_id':_0x11c797?_0x11c797['id']:undefined,'assignee_id':_0x11c797?_0x11c797['id']:undefined,'tags':getTags(_0x1642b4[_0xa803('0xe')],'name'),'subject':intUtil[_0xa803('0xf')](_0x1642b4[_0xa803('0x10')],_0x5d5c03,'\x20'),'description':intUtil['getString'](_0x1642b4['Descriptions'],_0x5d5c03,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x1642b4['Descriptions'],_0x5d5c03,'\x0a')}},getCustomFields(_0x1642b4[_0xa803('0x11')],_0x5d5c03))}})[_0xa803('0x12')](function(_0x9490c0){logger[_0xa803('0xc')](_0xa803('0x13'));return _0x9490c0[_0xa803('0x14')];});}function getUser(_0x2e22ef,_0x14bb21){if(intUtil['validateEmail'](_0x14bb21)){logger[_0xa803('0xc')](_0xa803('0x15'),_0x14bb21);return request({'uri':util[_0xa803('0x16')]('%s/search.json',_0x2e22ef['remoteUri']),'qs':{'query':util[_0xa803('0x16')]('type:user\x20role:agent\x20email:%s',_0x14bb21)}})[_0xa803('0x12')](function(_0x428256){if(_0x428256[_0xa803('0x17')]){logger[_0xa803('0xc')](_0xa803('0x18'));return _['find'](_0x428256[_0xa803('0x19')],{'email':_0x14bb21,'role':_0xa803('0x1a')});}else{logger[_0xa803('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa803('0x16')](_0xa803('0x1b'),_0x2e22ef[_0xa803('0x1c')])})[_0xa803('0x12')](function(_0x137f9e){logger[_0xa803('0xc')](_0xa803('0x1d'));return _0x137f9e[_0xa803('0x1e')];});}});}else{logger[_0xa803('0xc')](_0xa803('0x1f'));return request({'uri':util[_0xa803('0x16')](_0xa803('0x1b'),_0x2e22ef[_0xa803('0x1c')])})[_0xa803('0x12')](function(_0x55f1d3){logger['info']('Admin\x20account\x20selected.');return _0x55f1d3[_0xa803('0x1e')];});}}function getEndUser(_0x186454,_0x222655,_0x230a13){logger['info'](_0xa803('0x20'),_0x230a13);return request({'uri':util[_0xa803('0x16')](_0xa803('0x21'),_0x186454['remoteUri']),'qs':{'query':util[_0xa803('0x16')](_0xa803('0x22'),_0x230a13)}})[_0xa803('0x12')](function(_0x4169ce){var _0x326831;if(_0x4169ce['results']['length']){_0x4169ce['results']=_[_0xa803('0x23')](_0x4169ce['results'],{'suspended':![],'role':_0xa803('0x24')});if(_0x4169ce[_0xa803('0x19')][_0xa803('0x25')]){_0x326831=_['first'](_0x4169ce[_0xa803('0x19')]);}}if(_0x326831){logger['info'](_0xa803('0x26'));return _0x326831;}else{logger[_0xa803('0xc')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0xa803('0x16')](_0xa803('0x27'),_0x186454['remoteUri']),'method':_0xa803('0x28'),'body':{'user':{'role':_0xa803('0x24'),'name':util[_0xa803('0x16')]('Caller\x20-\x20%s',_0x222655||_0x230a13),'phone':_0x230a13}}})[_0xa803('0x12')](function(_0x44cdd8){logger[_0xa803('0xc')](_0xa803('0x29'));return _0x44cdd8[_0xa803('0x1e')];});}});}function getAuth(_0xcc0a11){var _0x440d88;if(_0xcc0a11[_0xa803('0x2a')]==='password'){_0x440d88=util[_0xa803('0x16')](_0xa803('0x2b'),_0xcc0a11[_0xa803('0x2c')],_0xcc0a11[_0xa803('0x2d')]);}else if(_0xcc0a11[_0xa803('0x2a')]===_0xa803('0x2e')){_0x440d88=util[_0xa803('0x16')](_0xa803('0x2f'),_0xcc0a11[_0xa803('0x2c')],_0xcc0a11[_0xa803('0x2e')]);}return util[_0xa803('0x16')](_0xa803('0x30'),new Buffer(_0x440d88)[_0xa803('0x31')](_0xa803('0x32')));}function request(_0x4e289b){logger[_0xa803('0x33')](_0xa803('0x34'),JSON[_0xa803('0x35')](_0x4e289b));return rp(_[_0xa803('0x36')](_0x4e289b,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x4cbf1c,_0x57facd){var _0x20b5b0=[];if(_0x4cbf1c&&_0x4cbf1c['length']>0x0){_0x20b5b0=_[_0xa803('0x37')](_0x4cbf1c,_0x57facd);}return _0x20b5b0;}function getCustomFields(_0x519c32,_0x17cd94){var _0x59b81f=[];var _0x1b9c0a={'custom_fields':[]};if(_0x519c32['length']>0x0){_[_0xa803('0x38')](_0x519c32,function(_0x46a424){if(_[_0xa803('0x39')]([_0xa803('0x3a'),_0xa803('0x3b')],_0x46a424[_0xa803('0x3c')])&&_0x46a424[_0xa803('0x3d')]&&!_0x46a424[_0xa803('0x3e')]){_0x1b9c0a[_0x46a424[_0xa803('0x3d')][_0xa803('0x3f')]()]=_0x46a424[_0xa803('0x40')][_0xa803('0x31')]();}else if(_[_0xa803('0x39')](['string','picklist'],_0x46a424[_0xa803('0x3c')])&&_0x46a424[_0xa803('0x41')]&&_0x46a424[_0xa803('0x3e')]){_0x1b9c0a[_0xa803('0x42')][_0xa803('0x43')]({'id':_0x46a424[_0xa803('0x41')],'value':_0x46a424[_0xa803('0x40')]['toString']()});}else if(_0x46a424[_0xa803('0x3c')]===_0xa803('0x44')&&_0x46a424[_0xa803('0x45')]&&_0x46a424[_0xa803('0x41')]&&_0x46a424[_0xa803('0x3e')]){_0x17cd94[_0x46a424[_0xa803('0x45')]]&&_0x1b9c0a[_0xa803('0x42')][_0xa803('0x43')]({'id':_0x46a424['idField'],'value':_0x17cd94[_0x46a424[_0xa803('0x45')]]['toString']()});}else if(_0x46a424['type']===_0xa803('0x46')&&_0x46a424[_0xa803('0x47')]&&_0x46a424[_0xa803('0x47')][_0xa803('0x48')]&&_0x46a424[_0xa803('0x41')]&&_0x46a424[_0xa803('0x3e')]){_0x17cd94[_0x46a424['Variable'][_0xa803('0x48')][_0xa803('0x3f')]()]&&_0x1b9c0a[_0xa803('0x42')][_0xa803('0x43')]({'id':_0x46a424['idField'],'value':_0x17cd94[_0x46a424[_0xa803('0x47')][_0xa803('0x48')][_0xa803('0x3f')]()][_0xa803('0x31')]()});}});}return _0x1b9c0a;}exports[_0xa803('0x49')]=function(_0x4e6f5f,_0x234509,_0x26048a,_0x23b8a0,_0x5cfbee,_0x55d346){var _0x59b02f,_0x48d9e3;_0x55d346[_0xa803('0x1c')]=intUtil[_0xa803('0x4a')](_0x55d346[_0xa803('0x1c')]);_0x55d346[_0xa803('0x4b')]=intUtil[_0xa803('0x4a')](_0x55d346[_0xa803('0x4b')]);if(_0x5cfbee&&_0x5cfbee[_0xa803('0x4c')]){logger[_0xa803('0xc')](_0xa803('0x4d'),_0xa803('0x4e'));_0x234509['recordingURL']=util[_0xa803('0x16')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x55d346[_0xa803('0x4b')],_0x234509['uniqueid'],md5(_0x234509[_0xa803('0x4f')]));}else{_0x234509[_0xa803('0x50')]='';}headers[_0xa803('0x51')]=getAuth(_0x55d346);return getUser(_0x55d346,_0x23b8a0[_0xa803('0x52')])[_0xa803('0x12')](function(_0x969090){_0x59b02f=_0x969090;logger[_0xa803('0xc')](_0xa803('0x53'),_0x59b02f['id']);return getEndUser(_0x55d346,_0x234509[_0xa803('0x54')],_0x234509[_0xa803('0x55')]);})[_0xa803('0x12')](function(_0x12962b){_0x48d9e3=_0x12962b;logger[_0xa803('0xc')](_0xa803('0x56'),_0x48d9e3['id']);return getTicket(_0x55d346,_0x59b02f,_0x48d9e3,_0x26048a,_0x234509);})['then'](function(_0xdcc3e5){if(_0xdcc3e5){logger[_0xa803('0xc')](_0xa803('0x57'),_0xdcc3e5['id']);switch(_0x55d346[_0xa803('0x3c')]){case _0xa803('0x58'):logger[_0xa803('0xc')](_0xa803('0x4d'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x55d346[_0xa803('0x1c')],_0x59b02f['id'],_0xdcc3e5['id']),'method':'POST'});case _0xa803('0x59'):logger[_0xa803('0xc')](_0xa803('0x4d'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xa803('0x16')](_0xa803('0x5a'),_0x23b8a0[_0xa803('0x48')]),_0xa803('0x5b'),{'uri':util[_0xa803('0x16')](_0xa803('0x5c'),_0x55d346[_0xa803('0x1c')][_0xa803('0x5d')]('/api/v2',''),_0xdcc3e5['id'])});break;default:logger['error'](_0xa803('0x4d'),_0xa803('0x5e'));}}})[_0xa803('0x5f')](function(_0x1f3759){logger[_0xa803('0x60')](_0xa803('0x61'),util['inspect'](_0x1f3759,{'showHidden':!![],'depth':null}));});};exports[_0xa803('0x62')]=function(_0x14e587,_0x7f452f,_0x18eef8,_0x55bbea,_0x4cdc2e,_0x507af2,_0x2c6dd7){var _0x269465,_0x3abe2d;_0x507af2[_0xa803('0x1c')]=intUtil[_0xa803('0x4a')](_0x507af2[_0xa803('0x1c')]);_0x507af2[_0xa803('0x4b')]=intUtil[_0xa803('0x4a')](_0x507af2['serverUrl']);if(_0x2c6dd7&&_0x2c6dd7[_0xa803('0x63')]&&_0x2c6dd7[_0xa803('0x63')]!=='none'){logger[_0xa803('0xc')](_0xa803('0x64'),_0xa803('0x4e'));_0x7f452f[_0xa803('0x50')]=util[_0xa803('0x16')](_0xa803('0x65'),_0x507af2['serverUrl'],_0x7f452f['uniqueid'],md5(_0x7f452f[_0xa803('0x4f')]));}headers['Authorization']=getAuth(_0x507af2);return getUser(_0x507af2,_0x55bbea['email'])[_0xa803('0x12')](function(_0x322de9){_0x269465=_0x322de9;logger[_0xa803('0xc')](_0xa803('0x53'),_0x269465['id']);return getEndUser(_0x507af2,_0x7f452f['destcalleridname'],_0x7f452f[_0xa803('0x66')]);})[_0xa803('0x12')](function(_0x347cb2){_0x3abe2d=_0x347cb2;logger[_0xa803('0xc')](_0xa803('0x56'),_0x3abe2d['id']);return getTicket(_0x507af2,_0x269465,_0x3abe2d,_0x18eef8,_0x7f452f);})[_0xa803('0x12')](function(_0x4430a2){if(_0x4430a2){logger[_0xa803('0xc')](_0xa803('0x57'),_0x4430a2['id']);switch(_0x507af2['type']){case _0xa803('0x58'):logger[_0xa803('0xc')](_0xa803('0x64'),_0xa803('0x67'));return request({'uri':util[_0xa803('0x16')](_0xa803('0x68'),_0x507af2[_0xa803('0x1c')],_0x269465['id'],_0x4430a2['id']),'method':_0xa803('0x28')});case _0xa803('0x59'):logger[_0xa803('0xc')](_0xa803('0x64'),_0xa803('0x69'));emit(util[_0xa803('0x16')](_0xa803('0x5a'),_0x55bbea[_0xa803('0x48')]),_0xa803('0x5b'),{'uri':util['format'](_0xa803('0x5c'),_0x507af2['remoteUri']['replace'](_0xa803('0x6a'),''),_0x4430a2['id'])});break;default:logger[_0xa803('0x60')](_0xa803('0x64'),_0xa803('0x5e'));}}})[_0xa803('0x5f')](function(_0x2a4065){logger[_0xa803('0x60')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xa803('0x6b')](_0x2a4065,{'showHidden':!![],'depth':null}));});};exports[_0xa803('0x6c')]=function(_0x7a2050,_0x13227a,_0x5c780c,_0x1ca359,_0x488073,_0x5b4503){var _0x5b39c2,_0x55cbca;_0x5b4503[_0xa803('0x1c')]=intUtil[_0xa803('0x4a')](_0x5b4503['remoteUri']);_0x5b4503[_0xa803('0x4b')]=intUtil[_0xa803('0x4a')](_0x5b4503[_0xa803('0x4b')]);if(_0x488073&&_0x488073[_0xa803('0x4c')]){logger[_0xa803('0xc')]('['+_0x13227a['lastevent'][_0xa803('0x6d')]()+']',_0xa803('0x4e'));_0x13227a[_0xa803('0x50')]=util[_0xa803('0x16')](_0xa803('0x65'),_0x5b4503['serverUrl'],_0x13227a['uniqueid'],md5(_0x13227a[_0xa803('0x4f')]));}else{_0x13227a[_0xa803('0x50')]='';}headers['Authorization']=getAuth(_0x5b4503);return getUser(_0x5b4503)['then'](function(_0x383aa0){_0x5b39c2=_0x383aa0;logger[_0xa803('0xc')](_0xa803('0x53'),_0x5b39c2['id']);return getEndUser(_0x5b4503,_0x13227a[_0xa803('0x54')],_0x13227a['calleridnum']);})[_0xa803('0x12')](function(_0x44b390){_0x55cbca=_0x44b390;logger[_0xa803('0xc')](_0xa803('0x56'),_0x55cbca['id']);return getTicket(_0x5b4503,_0x5b39c2,_0x55cbca,_0x5c780c,_0x13227a);})[_0xa803('0x12')](function(_0x1ce392){if(_0x1ce392){logger['info']('The\x20Ticket\x20ID\x20is:',_0x1ce392['id']);}})[_0xa803('0x5f')](function(_0x3c7db4){logger[_0xa803('0x60')]('['+_0x13227a[_0xa803('0x6e')][_0xa803('0x6d')]()+']'+_0xa803('0x6f'),util['inspect'](_0x3c7db4,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xb177=['customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','/api/v2','unmanaged','toUpperCase','inspect','lodash','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','localhost','socket.io-emitter','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','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','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','stringify','defaults','GET','map','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','custom_fields','push','idField','variable','variableName'];(function(_0x365c20,_0x30762e){var _0xc679bb=function(_0x42133d){while(--_0x42133d){_0x365c20['push'](_0x365c20['shift']());}};_0xc679bb(++_0x30762e);}(_0xb177,0x9a));var _0x7b17=function(_0x19258e,_0x64ecd0){_0x19258e=_0x19258e-0x0;var _0x587312=_0xb177[_0x19258e];return _0x587312;};'use strict';var _=require(_0x7b17('0x0'));var rp=require(_0x7b17('0x1'));var md5=require('md5');var util=require(_0x7b17('0x2'));var Redis=require(_0x7b17('0x3'));var intUtil=require(_0x7b17('0x4'));var config=require(_0x7b17('0x5'));var logger=require(_0x7b17('0x6'))(_0x7b17('0x7'));config[_0x7b17('0x8')]=_['defaults'](config[_0x7b17('0x8')],{'host':_0x7b17('0x9'),'port':0x18eb});var io=require(_0x7b17('0xa'))(new Redis(config['redis']));function emit(_0x10774b,_0x344fce,_0x21765e){io['to'](_0x10774b)['emit'](_0x344fce,_0x21765e);}var headers={'Content-Type':_0x7b17('0xb'),'Accept':'application/json'};function getTicket(_0x471272,_0x165918,_0xa252ff,_0x753eda,_0x3476be){logger[_0x7b17('0xc')](_0x7b17('0xd'));return request({'uri':util[_0x7b17('0xe')](_0x7b17('0xf'),_0x471272[_0x7b17('0x10')]),'method':_0x7b17('0x11'),'body':{'ticket':_[_0x7b17('0x12')]({'requester_id':_0xa252ff['id'],'submitter_id':_0x165918?_0x165918['id']:undefined,'assignee_id':_0x165918?_0x165918['id']:undefined,'tags':getTags(_0x753eda[_0x7b17('0x13')],'name'),'subject':intUtil[_0x7b17('0x14')](_0x753eda[_0x7b17('0x15')],_0x3476be,'\x20'),'description':intUtil[_0x7b17('0x14')](_0x753eda[_0x7b17('0x16')],_0x3476be,'\x0a'),'comment':{'public':![],'body':intUtil[_0x7b17('0x14')](_0x753eda[_0x7b17('0x16')],_0x3476be,'\x0a')}},getCustomFields(_0x753eda[_0x7b17('0x17')],_0x3476be))}})[_0x7b17('0x18')](function(_0x9d4c7f){logger['info'](_0x7b17('0x19'));return _0x9d4c7f['ticket'];});}function getUser(_0x3a4a36,_0x4f7e73){if(intUtil['validateEmail'](_0x4f7e73)){logger['info'](_0x7b17('0x1a'),_0x4f7e73);return request({'uri':util[_0x7b17('0xe')](_0x7b17('0x1b'),_0x3a4a36[_0x7b17('0x10')]),'qs':{'query':util[_0x7b17('0xe')](_0x7b17('0x1c'),_0x4f7e73)}})[_0x7b17('0x18')](function(_0x1c9a2a){if(_0x1c9a2a[_0x7b17('0x1d')]){logger[_0x7b17('0xc')](_0x7b17('0x1e'));return _[_0x7b17('0x1f')](_0x1c9a2a[_0x7b17('0x20')],{'email':_0x4f7e73,'role':_0x7b17('0x21')});}else{logger[_0x7b17('0xc')](_0x7b17('0x22'));return request({'uri':util[_0x7b17('0xe')](_0x7b17('0x23'),_0x3a4a36[_0x7b17('0x10')])})[_0x7b17('0x18')](function(_0x2b2c3a){logger[_0x7b17('0xc')](_0x7b17('0x24'));return _0x2b2c3a[_0x7b17('0x25')];});}});}else{logger['info'](_0x7b17('0x22'));return request({'uri':util['format'](_0x7b17('0x23'),_0x3a4a36[_0x7b17('0x10')])})[_0x7b17('0x18')](function(_0x2f1474){logger[_0x7b17('0xc')](_0x7b17('0x24'));return _0x2f1474[_0x7b17('0x25')];});}}function getEndUser(_0x392ea7,_0x44b9d3,_0x2e2f9a){logger['info'](_0x7b17('0x26'),_0x2e2f9a);return request({'uri':util['format']('%s/search.json',_0x392ea7[_0x7b17('0x10')]),'qs':{'query':util[_0x7b17('0xe')](_0x7b17('0x27'),_0x2e2f9a)}})[_0x7b17('0x18')](function(_0x160ebc){var _0x20a54d;if(_0x160ebc[_0x7b17('0x20')][_0x7b17('0x28')]){_0x160ebc[_0x7b17('0x20')]=_['filter'](_0x160ebc[_0x7b17('0x20')],{'suspended':![],'role':_0x7b17('0x29')});if(_0x160ebc[_0x7b17('0x20')][_0x7b17('0x28')]){_0x20a54d=_[_0x7b17('0x2a')](_0x160ebc[_0x7b17('0x20')]);}}if(_0x20a54d){logger[_0x7b17('0xc')]('Enduser\x20found!');return _0x20a54d;}else{logger['info'](_0x7b17('0x2b'));return request({'uri':util[_0x7b17('0xe')]('%s/users.json',_0x392ea7[_0x7b17('0x10')]),'method':_0x7b17('0x11'),'body':{'user':{'role':'end-user','name':util[_0x7b17('0xe')]('Caller\x20-\x20%s',_0x44b9d3||_0x2e2f9a),'phone':_0x2e2f9a}}})['then'](function(_0x4910cb){logger['info'](_0x7b17('0x2c'));return _0x4910cb[_0x7b17('0x25')];});}});}function getAuth(_0x37d9b8){var _0x3f2b6d;if(_0x37d9b8[_0x7b17('0x2d')]===_0x7b17('0x2e')){_0x3f2b6d=util[_0x7b17('0xe')](_0x7b17('0x2f'),_0x37d9b8[_0x7b17('0x30')],_0x37d9b8[_0x7b17('0x2e')]);}else if(_0x37d9b8[_0x7b17('0x2d')]===_0x7b17('0x31')){_0x3f2b6d=util['format'](_0x7b17('0x32'),_0x37d9b8[_0x7b17('0x30')],_0x37d9b8[_0x7b17('0x31')]);}return util['format'](_0x7b17('0x33'),new Buffer(_0x3f2b6d)[_0x7b17('0x34')](_0x7b17('0x35')));}function request(_0x5494eb){logger[_0x7b17('0x36')]('[HTTP]',JSON[_0x7b17('0x37')](_0x5494eb));return rp(_[_0x7b17('0x38')](_0x5494eb,{'method':_0x7b17('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x11bad5,_0x26ae6b){var _0x134060=[];if(_0x11bad5&&_0x11bad5[_0x7b17('0x28')]>0x0){_0x134060=_[_0x7b17('0x3a')](_0x11bad5,_0x26ae6b);}return _0x134060;}function getCustomFields(_0x326ece,_0x4bccfc){var _0x5915ad=[];var _0x48ec16={'custom_fields':[]};if(_0x326ece['length']>0x0){_[_0x7b17('0x3b')](_0x326ece,function(_0x322fb1){if(_[_0x7b17('0x3c')](['string',_0x7b17('0x3d')],_0x322fb1[_0x7b17('0x3e')])&&_0x322fb1[_0x7b17('0x3f')]&&!_0x322fb1[_0x7b17('0x40')]){_0x48ec16[_0x322fb1[_0x7b17('0x3f')][_0x7b17('0x41')]()]=_0x322fb1[_0x7b17('0x42')][_0x7b17('0x34')]();}else if(_['includes'](['string','picklist'],_0x322fb1[_0x7b17('0x3e')])&&_0x322fb1['idField']&&_0x322fb1[_0x7b17('0x40')]){_0x48ec16[_0x7b17('0x43')][_0x7b17('0x44')]({'id':_0x322fb1[_0x7b17('0x45')],'value':_0x322fb1[_0x7b17('0x42')]['toString']()});}else if(_0x322fb1[_0x7b17('0x3e')]===_0x7b17('0x46')&&_0x322fb1[_0x7b17('0x47')]&&_0x322fb1[_0x7b17('0x45')]&&_0x322fb1['customField']){_0x4bccfc[_0x322fb1['variableName']]&&_0x48ec16[_0x7b17('0x43')]['push']({'id':_0x322fb1['idField'],'value':_0x4bccfc[_0x322fb1[_0x7b17('0x47')]][_0x7b17('0x34')]()});}else if(_0x322fb1[_0x7b17('0x3e')]===_0x7b17('0x48')&&_0x322fb1[_0x7b17('0x49')]&&_0x322fb1['Variable'][_0x7b17('0x4a')]&&_0x322fb1['idField']&&_0x322fb1[_0x7b17('0x40')]){_0x4bccfc[_0x322fb1['Variable'][_0x7b17('0x4a')]['toLowerCase']()]&&_0x48ec16[_0x7b17('0x43')][_0x7b17('0x44')]({'id':_0x322fb1['idField'],'value':_0x4bccfc[_0x322fb1['Variable'][_0x7b17('0x4a')][_0x7b17('0x41')]()][_0x7b17('0x34')]()});}});}return _0x48ec16;}exports[_0x7b17('0x4b')]=function(_0x1c9b38,_0x15ef24,_0x3a80cd,_0x2dab3f,_0x236e5d,_0x4e3f52){var _0x461e57,_0x49df34;_0x4e3f52[_0x7b17('0x10')]=intUtil[_0x7b17('0x4c')](_0x4e3f52[_0x7b17('0x10')]);_0x4e3f52[_0x7b17('0x4d')]=intUtil['stripTrailingSlash'](_0x4e3f52['serverUrl']);if(_0x236e5d&&_0x236e5d[_0x7b17('0x4e')]){logger[_0x7b17('0xc')](_0x7b17('0x4f'),_0x7b17('0x50'));_0x15ef24[_0x7b17('0x51')]=util['format'](_0x7b17('0x52'),_0x4e3f52[_0x7b17('0x4d')],_0x15ef24[_0x7b17('0x53')],md5(_0x15ef24[_0x7b17('0x53')]));}else{_0x15ef24[_0x7b17('0x51')]='';}headers[_0x7b17('0x54')]=getAuth(_0x4e3f52);return getUser(_0x4e3f52,_0x2dab3f[_0x7b17('0x55')])[_0x7b17('0x18')](function(_0x3c69d5){_0x461e57=_0x3c69d5;logger['info'](_0x7b17('0x56'),_0x461e57['id']);return getEndUser(_0x4e3f52,_0x15ef24[_0x7b17('0x57')],_0x15ef24[_0x7b17('0x58')]);})[_0x7b17('0x18')](function(_0x1b776e){_0x49df34=_0x1b776e;logger[_0x7b17('0xc')](_0x7b17('0x59'),_0x49df34['id']);return getTicket(_0x4e3f52,_0x461e57,_0x49df34,_0x3a80cd,_0x15ef24);})[_0x7b17('0x18')](function(_0x1bdf09){if(_0x1bdf09){logger[_0x7b17('0xc')](_0x7b17('0x5a'),_0x1bdf09['id']);switch(_0x4e3f52[_0x7b17('0x3e')]){case _0x7b17('0x5b'):logger['info'](_0x7b17('0x4f'),_0x7b17('0x5c'));return request({'uri':util[_0x7b17('0xe')](_0x7b17('0x5d'),_0x4e3f52[_0x7b17('0x10')],_0x461e57['id'],_0x1bdf09['id']),'method':_0x7b17('0x11')});case _0x7b17('0x5e'):logger['info']('[QUEUE]',_0x7b17('0x5f'));emit(util[_0x7b17('0xe')](_0x7b17('0x60'),_0x2dab3f[_0x7b17('0x4a')]),_0x7b17('0x61'),{'uri':util[_0x7b17('0xe')](_0x7b17('0x62'),_0x4e3f52[_0x7b17('0x10')][_0x7b17('0x63')]('/api/v2',''),_0x1bdf09['id'])});break;default:logger[_0x7b17('0x64')](_0x7b17('0x4f'),_0x7b17('0x65'));}}})[_0x7b17('0x66')](function(_0x418616){logger[_0x7b17('0x64')](_0x7b17('0x67'),util['inspect'](_0x418616,{'showHidden':!![],'depth':null}));});};exports[_0x7b17('0x68')]=function(_0x3a0af7,_0x3af582,_0x5ece67,_0x19ecb0,_0x37bdde,_0x64d366,_0x5ca188){var _0x39318b,_0x4f7768;_0x64d366['remoteUri']=intUtil['stripTrailingSlash'](_0x64d366['remoteUri']);_0x64d366[_0x7b17('0x4d')]=intUtil['stripTrailingSlash'](_0x64d366[_0x7b17('0x4d')]);if(_0x5ca188&&_0x5ca188[_0x7b17('0x69')]&&_0x5ca188[_0x7b17('0x69')]!==_0x7b17('0x6a')){logger[_0x7b17('0xc')](_0x7b17('0x6b'),_0x7b17('0x50'));_0x3af582['recordingURL']=util[_0x7b17('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x64d366[_0x7b17('0x4d')],_0x3af582[_0x7b17('0x53')],md5(_0x3af582['uniqueid']));}headers['Authorization']=getAuth(_0x64d366);return getUser(_0x64d366,_0x19ecb0[_0x7b17('0x55')])[_0x7b17('0x18')](function(_0x30c5e0){_0x39318b=_0x30c5e0;logger[_0x7b17('0xc')]('The\x20User\x20ID\x20is:',_0x39318b['id']);return getEndUser(_0x64d366,_0x3af582['destcalleridname'],_0x3af582[_0x7b17('0x6c')]);})[_0x7b17('0x18')](function(_0x3fc8e5){_0x4f7768=_0x3fc8e5;logger[_0x7b17('0xc')](_0x7b17('0x59'),_0x4f7768['id']);return getTicket(_0x64d366,_0x39318b,_0x4f7768,_0x5ece67,_0x3af582);})[_0x7b17('0x18')](function(_0x47403a){if(_0x47403a){logger[_0x7b17('0xc')](_0x7b17('0x5a'),_0x47403a['id']);switch(_0x64d366[_0x7b17('0x3e')]){case'integrationTab':logger[_0x7b17('0xc')](_0x7b17('0x6b'),_0x7b17('0x5c'));return request({'uri':util[_0x7b17('0xe')]('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x64d366[_0x7b17('0x10')],_0x39318b['id'],_0x47403a['id']),'method':'POST'});case _0x7b17('0x5e'):logger['info'](_0x7b17('0x6b'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x7b17('0x60'),_0x19ecb0[_0x7b17('0x4a')]),_0x7b17('0x61'),{'uri':util['format'](_0x7b17('0x62'),_0x64d366[_0x7b17('0x10')][_0x7b17('0x63')](_0x7b17('0x6d'),''),_0x47403a['id'])});break;default:logger[_0x7b17('0x64')](_0x7b17('0x6b'),_0x7b17('0x65'));}}})[_0x7b17('0x66')](function(_0x133e0d){logger[_0x7b17('0x64')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x133e0d,{'showHidden':!![],'depth':null}));});};exports[_0x7b17('0x6e')]=function(_0x36d555,_0x4982b5,_0x3d1e57,_0x36288a,_0xa7465c,_0x55dc00){var _0x4d8c19,_0xaed10;_0x55dc00[_0x7b17('0x10')]=intUtil[_0x7b17('0x4c')](_0x55dc00[_0x7b17('0x10')]);_0x55dc00['serverUrl']=intUtil[_0x7b17('0x4c')](_0x55dc00[_0x7b17('0x4d')]);if(_0xa7465c&&_0xa7465c[_0x7b17('0x4e')]){logger[_0x7b17('0xc')]('['+_0x4982b5['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x4982b5['recordingURL']=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x55dc00[_0x7b17('0x4d')],_0x4982b5[_0x7b17('0x53')],md5(_0x4982b5[_0x7b17('0x53')]));}else{_0x4982b5[_0x7b17('0x51')]='';}headers[_0x7b17('0x54')]=getAuth(_0x55dc00);return getUser(_0x55dc00)[_0x7b17('0x18')](function(_0xaac60d){_0x4d8c19=_0xaac60d;logger[_0x7b17('0xc')]('The\x20User\x20ID\x20is:',_0x4d8c19['id']);return getEndUser(_0x55dc00,_0x4982b5['calleridname'],_0x4982b5[_0x7b17('0x58')]);})[_0x7b17('0x18')](function(_0x2f8047){_0xaed10=_0x2f8047;logger[_0x7b17('0xc')](_0x7b17('0x59'),_0xaed10['id']);return getTicket(_0x55dc00,_0x4d8c19,_0xaed10,_0x3d1e57,_0x4982b5);})[_0x7b17('0x18')](function(_0x546de0){if(_0x546de0){logger['info']('The\x20Ticket\x20ID\x20is:',_0x546de0['id']);}})['catch'](function(_0x46c946){logger['error']('['+_0x4982b5['lastevent'][_0x7b17('0x6f')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x7b17('0x70')](_0x46c946,{'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 479ac12..a68fd92 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 _0xe589=['calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','[QUEUE]','recordingFormat','none','Recording\x20is\x20enabled!','/downloads?type=uniqueid&token=','email','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','unmanaged','monitor_format','toUpperCase','calleridnum','md5','util','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','debug','[HTTP]','forEach','includes','string','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','Agent\x20found!','info','Using\x20the\x20admin\x20account!','profile','Administrator','user','The\x20failing\x20result\x20is','stringify','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','details','Error:\x20','log','contact_lead','uri','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','contact','lead','Leads','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Subjects','Descriptions','Who_Id','Full_Name','Last_Name','What_Id','First_Name','$se_module','talktime','Call_Duration','endtime','utc','YYYY-MM-DDTHH:mm:ss','mm:ss','lastevent','called','Call_Result','complete','connect','Answered','rejected','Rejected','Abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','merge','Fields','SUCCESS','Call\x20created!','err','queue','host','stripTrailingSlash','serverUrl','recordingURL','/api/voice/recordings/','uniqueid','zoho.eu','com'];(function(_0x5b4dd6,_0x15cd99){var _0x3b2271=function(_0x239d46){while(--_0x239d46){_0x5b4dd6['push'](_0x5b4dd6['shift']());}};_0x3b2271(++_0x15cd99);}(_0xe589,0x14e));var _0x9e58=function(_0x3c532a,_0x5582db){_0x3c532a=_0x3c532a-0x0;var _0x63508c=_0xe589[_0x3c532a];return _0x63508c;};'use strict';var _=require('lodash');var rp=require('request-promise');var md5=require(_0x9e58('0x0'));var util=require(_0x9e58('0x1'));var intUtil=require('./util');var moment=require('moment');var Redis=require(_0x9e58('0x2'));var BPromise=require(_0x9e58('0x3'));var config=require(_0x9e58('0x4'));var logger=require(_0x9e58('0x5'))('zoho');config[_0x9e58('0x6')]=_['defaults'](config[_0x9e58('0x6')],{'host':_0x9e58('0x7'),'port':0x18eb});var io=require(_0x9e58('0x8'))(new Redis(config[_0x9e58('0x6')]));function emit(_0x4f743f,_0x22c9ce,_0x3f6989){io['to'](_0x4f743f)['emit'](_0x22c9ce,_0x3f6989);}function request(_0x5dd085){logger[_0x9e58('0x9')](_0x9e58('0xa'),JSON['stringify'](_0x5dd085));return rp(_0x5dd085);}function getCustomFields(_0x186258,_0x529e1e){var _0x1f0723={};if(_0x186258['length']>0x0){_[_0x9e58('0xb')](_0x186258,function(_0x564feb){if(_[_0x9e58('0xc')]([_0x9e58('0xd'),_0x9e58('0xe')],_0x564feb[_0x9e58('0xf')])&&_0x564feb[_0x9e58('0x10')]){_0x1f0723[_0x564feb[_0x9e58('0x10')]]=_0x564feb[_0x9e58('0x11')][_0x9e58('0x12')]();}else if(_0x564feb['type']===_0x9e58('0x13')&&_0x564feb[_0x9e58('0x14')]&&_0x564feb[_0x9e58('0x10')]&&_0x529e1e[_0x564feb['variableName']]){_0x1f0723[_0x564feb[_0x9e58('0x10')]]=_0x529e1e[_0x564feb[_0x9e58('0x14')]][_0x9e58('0x12')]();}else if(_0x564feb[_0x9e58('0xf')]===_0x9e58('0x15')&&_0x564feb[_0x9e58('0x16')]&&_0x564feb['Variable'][_0x9e58('0x17')]&&_0x564feb[_0x9e58('0x10')]&&_0x529e1e[_0x564feb['Variable'][_0x9e58('0x17')]['toLowerCase']()]){_0x1f0723[_0x564feb[_0x9e58('0x10')]]=_0x529e1e[_0x564feb[_0x9e58('0x16')][_0x9e58('0x17')][_0x9e58('0x18')]()][_0x9e58('0x12')]();}});}return _0x1f0723;}function getName(_0x4b9017){if(_0x4b9017['indexOf']('\x20')>0x0){var _0x44f367=_0x4b9017[_0x9e58('0x19')](/ (.+)/);if(_0x44f367[0x1]){return _0x44f367;}}return[_0x4b9017,_0x4b9017];}var accountsTokens={};function getAccessToken(_0x5b223b){return new Promise(function(_0x41cdd2,_0xc1d41){if(!_[_0x9e58('0x1a')](accountsTokens[_0x5b223b['id']])&&!_['isNil'](accountsTokens[_0x5b223b['id']][_0x9e58('0x1b')])){if(moment()[_0x9e58('0x1c')](accountsTokens[_0x5b223b['id']]['expires_in'])){_0x41cdd2(accountsTokens[_0x5b223b['id']][_0x9e58('0x1b')]);}}var _0xaa24b0;switch(_0x5b223b[_0x9e58('0x1d')]){case'US':_0xaa24b0='https://accounts.zoho.com';break;case'AU':_0xaa24b0=_0x9e58('0x1e');break;case'EU':_0xaa24b0='https://accounts.zoho.eu';break;case'IN':_0xaa24b0=_0x9e58('0x1f');break;case'CN':_0xaa24b0=_0x9e58('0x20');break;default:_0xaa24b0=_0x9e58('0x21');break;}var _0x218f80={'method':_0x9e58('0x22'),'uri':_0xaa24b0+_0x9e58('0x23'),'qs':{'refresh_token':_0x5b223b[_0x9e58('0x24')],'client_id':_0x5b223b[_0x9e58('0x25')],'client_secret':_0x5b223b[_0x9e58('0x26')],'grant_type':_0x9e58('0x27')},'json':!![]};return rp(_0x218f80)[_0x9e58('0x28')](function(_0xc5676){accountsTokens[_0x5b223b['id']]={'access_token':_0xc5676[_0x9e58('0x1b')],'expires_in':moment()[_0x9e58('0x29')](_0xc5676['expires_in'],_0x9e58('0x2a'))};_0x41cdd2(_0xc5676[_0x9e58('0x1b')]);})[_0x9e58('0x2b')](function(_0x1f7b8c){logger[_0x9e58('0x2c')](_0x9e58('0x2d'),_0x1f7b8c[_0x9e58('0x2e')]);_0xc1d41(_0x1f7b8c);});});}function getUser(_0x3baae3,_0x468d6d,_0x27d3c0,_0x3c95c5){logger['info'](_0x9e58('0x2f'));return request({'method':_0x9e58('0x30'),'uri':util[_0x9e58('0x31')](_0x9e58('0x32'),_0x468d6d),'qs':{'type':_0x9e58('0x33')},'headers':{'Authorization':_0x9e58('0x34')+_0x3baae3},'json':!![]})[_0x9e58('0x28')](function(_0x4177fc){if(_0x4177fc[_0x9e58('0x35')]){var _0x15b79e=-0x1;if(_[_0x9e58('0x36')](_0x4177fc['users'])){if(!_[_0x9e58('0x1a')](_0x3c95c5)){_0x15b79e=_[_0x9e58('0x37')](_0x4177fc['users'],function(_0x571c68){return _0x571c68['email']===_0x3c95c5;});}if(_0x15b79e>=0x0){logger['info'](_0x9e58('0x38'));}else{logger[_0x9e58('0x39')](_0x9e58('0x3a'));_0x15b79e=_[_0x9e58('0x37')](_0x4177fc[_0x9e58('0x35')],function(_0x44c147){return _0x44c147[_0x9e58('0x3b')][_0x9e58('0x17')]===_0x9e58('0x3c');});}return _0x4177fc[_0x9e58('0x35')][_0x15b79e];}else{if(_0x4177fc[_0x9e58('0x3d')][_0x9e58('0x3b')][_0x9e58('0x17')]===_0x9e58('0x3c')){logger[_0x9e58('0x39')]('Using\x20the\x20admin\x20account!');user=_0x4177fc[_0x9e58('0x3d')];return user;}else{logger['error'](_0x9e58('0x3e'),JSON[_0x9e58('0x3f')](_0x4177fc));throw new Error(_0x9e58('0x40')+JSON[_0x9e58('0x3f')](_0x4177fc));}}}else{logger[_0x9e58('0x2c')](_0x9e58('0x3e'),JSON[_0x9e58('0x3f')](_0x4177fc));throw new Error(_0x9e58('0x40')+JSON['stringify'](_0x4177fc));}})[_0x9e58('0x2b')](function(_0x17988d){console['error'](_0x17988d);});}function getZohoUser(_0x93de87,_0x1f9934){return new BPromise(function(_0x1e01e2,_0x366a31){request(_0x93de87)[_0x9e58('0x28')](function(_0x4a82a1){var _0x2bdff1=null;if(_0x4a82a1){_0x2bdff1=_0x4a82a1[_0x9e58('0x41')][0x0];_0x2bdff1[_0x9e58('0x42')]=_0x1f9934;}_0x1e01e2(_0x2bdff1);})['catch'](function(_0x3e9188){_0x366a31(_0x3e9188);});});}function createEndUser(_0x41fbf9,_0x3b65a8,_0x2b4fbe,_0x5b7de0,_0x50caa0,_0x24a0b5){var _0x2b4fbe=getName(_0x2b4fbe);return request({'method':_0x9e58('0x22'),'uri':_0x9e58('0x43')+_0x3b65a8+_0x9e58('0x44')+_[_0x9e58('0x45')](_0x24a0b5[_0x9e58('0x46')])+'s','body':{'data':[{'Last_Name':_0x2b4fbe[0x1],'First_Name':_0x2b4fbe[0x0],'Phone':_0x5b7de0,'Owner':{'name':!_['isNil'](_0x50caa0[_0x9e58('0x47')][_0x9e58('0x17')])?_0x50caa0['role'][_0x9e58('0x17')]:!_[_0x9e58('0x1a')](_0x50caa0[_0x9e58('0x48')])?_0x50caa0[_0x9e58('0x48')]+'\x20'+_0x50caa0['last_name']:_0x50caa0[_0x9e58('0x49')],'id':_0x50caa0['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x41fbf9},'json':!![]})[_0x9e58('0x28')](function(_0x39ab73){if(_0x39ab73&&_0x39ab73[_0x9e58('0x41')][0x0][_0x9e58('0x4a')]==='SUCCESS'){var _0x216cb9=_0x39ab73['data'][0x0][_0x9e58('0x4b')];_0x216cb9[_0x9e58('0x42')]=_['startCase'](_0x24a0b5['moduleCreate'])+'s';return _0x216cb9;}logger['error'](_0x9e58('0x3e'),JSON[_0x9e58('0x3f')](data));throw new Error(_0x9e58('0x4c')+JSON[_0x9e58('0x3f')](data));})['catch'](function(_0x2c60c4){console[_0x9e58('0x4d')]('CREATE\x20ERROR',_0x2c60c4);});}function getEndUser(_0x54eec7,_0x3f1b90,_0x57df43,_0xce1a1d,_0x400b46,_0x11a30a,_0x454ae7){var _0x189309={'method':_0x9e58('0x30'),'uri':'','headers':{'Authorization':_0x9e58('0x34')+_0x54eec7},'json':!![]};switch(_0x454ae7['moduleSearch']){case _0x9e58('0x4e'):_0x189309[_0x9e58('0x4f')]='https://www.zohoapis.'+_0x3f1b90+_0x9e58('0x50')+_0x400b46+'))';return getZohoUser(_0x189309,_0x9e58('0x51'))['then'](function(_0x8e8a3f){if(_0x8e8a3f)return _0x8e8a3f;_0x189309[_0x9e58('0x4f')]=_0x9e58('0x43')+_0x3f1b90+_0x9e58('0x52')+_0x400b46+'))';return getZohoUser(_0x189309,'Leads')[_0x9e58('0x28')](function(_0xb6d662){if(_0xb6d662)return _0xb6d662;if(_0x454ae7[_0x9e58('0x46')]!=_0x9e58('0x53')){return createEndUser(_0x54eec7,_0x3f1b90,_0xce1a1d,_0x400b46,_0x11a30a,_0x454ae7);}else{return{};}});});break;case _0x9e58('0x54'):_0x189309[_0x9e58('0x4f')]=_0x9e58('0x43')+_0x3f1b90+_0x9e58('0x50')+_0x400b46+'))';return getZohoUser(_0x189309,_0x9e58('0x51'))[_0x9e58('0x28')](function(_0x2f7dc4){if(_0x2f7dc4)return _0x2f7dc4;if(_0x454ae7['moduleCreate']!=_0x9e58('0x53')){return createEndUser(_0x54eec7,_0x3f1b90,_0xce1a1d,_0x400b46,_0x11a30a,_0x454ae7);}else{return{};}});break;case _0x9e58('0x55'):_0x189309[_0x9e58('0x4f')]=_0x9e58('0x43')+_0x3f1b90+_0x9e58('0x52')+_0x400b46+'))';return getZohoUser(_0x189309,_0x9e58('0x56'))['then'](function(_0x236b65){if(_0x236b65)return _0x236b65;if(_0x454ae7[_0x9e58('0x46')]!=_0x9e58('0x53')){return createEndUser(_0x54eec7,_0x3f1b90,_0xce1a1d,_0x400b46,_0x11a30a,_0x454ae7);}else{return{};}});break;}}function getCall(_0x339f03,_0x423f58,_0x55f4b2,_0x138f27,_0x29efa7,_0x509014,_0x1bc070,_0x593d33){logger[_0x9e58('0x39')](_0x9e58('0x57'));var _0x2fbfee={};_0x2fbfee[_0x9e58('0x58')]={'name':!_[_0x9e58('0x1a')](_0x138f27[_0x9e58('0x47')][_0x9e58('0x17')])&&!_[_0x9e58('0x1a')](_0x138f27['profile'][_0x9e58('0x17')])&&_0x138f27[_0x9e58('0x3b')][_0x9e58('0x17')]===_0x9e58('0x59')?_0x138f27[_0x9e58('0x47')]['name']:!_[_0x9e58('0x1a')](_0x138f27[_0x9e58('0x48')])?_0x138f27[_0x9e58('0x48')]+'\x20'+_0x138f27[_0x9e58('0x49')]:_0x138f27[_0x9e58('0x49')],'id':_0x138f27['id']};_0x2fbfee[_0x9e58('0x5a')]=intUtil[_0x9e58('0x5b')](_0x509014[_0x9e58('0x5c')],_0x1bc070,'\x20');_0x2fbfee['Description']=intUtil[_0x9e58('0x5b')](_0x509014[_0x9e58('0x5d')],_0x1bc070,'\x0a');if(_0x29efa7[_0x9e58('0x42')]===_0x9e58('0x51')){_0x2fbfee[_0x9e58('0x5e')]={'name':!_[_0x9e58('0x1a')](_0x29efa7[_0x9e58('0x5f')])?_0x29efa7[_0x9e58('0x5f')]:!_[_0x9e58('0x1a')](_0x29efa7['First_Name'])?_0x29efa7['First_Name']+'\x20'+_0x29efa7[_0x9e58('0x60')]:_0x29efa7[_0x9e58('0x60')],'id':_0x29efa7['id']};}if(_0x29efa7['enduserType']==='Leads'){_0x2fbfee[_0x9e58('0x61')]={'name':!_[_0x9e58('0x1a')](_0x29efa7[_0x9e58('0x5f')])?_0x29efa7[_0x9e58('0x5f')]:!_[_0x9e58('0x1a')](_0x29efa7[_0x9e58('0x62')])?_0x29efa7[_0x9e58('0x62')]+'\x20'+_0x29efa7[_0x9e58('0x60')]:_0x29efa7[_0x9e58('0x60')],'id':_0x29efa7['id']};_0x2fbfee[_0x9e58('0x63')]=_[_0x9e58('0x45')](_0x29efa7[_0x9e58('0x42')]);}if(_0x1bc070[_0x9e58('0x64')]){_0x2fbfee[_0x9e58('0x65')]=moment['utc'](parseInt(_0x1bc070[_0x9e58('0x64')])*0x3e8)[_0x9e58('0x31')]('mm:ss');}else if(_0x1bc070['answertime']&&_0x1bc070[_0x9e58('0x66')]){_0x2fbfee[_0x9e58('0x65')]=moment[_0x9e58('0x67')](moment(_0x1bc070[_0x9e58('0x66')],_0x9e58('0x68'))['diff'](moment(_0x1bc070['starttime'],'YYYY-MM-DDTHH:mm:ss')))[_0x9e58('0x31')](_0x9e58('0x69'));}switch(_0x1bc070[_0x9e58('0x6a')]){case _0x9e58('0x6b'):_0x2fbfee[_0x9e58('0x6c')]='Called';break;case _0x9e58('0x6d'):case _0x9e58('0x6e'):_0x2fbfee[_0x9e58('0x6c')]=_0x9e58('0x6f');break;case _0x9e58('0x70'):_0x2fbfee['Call_Result']=_0x9e58('0x71');break;case'abandoned':_0x2fbfee['Call_Result']=_0x9e58('0x72');break;case _0x9e58('0x73'):_0x2fbfee['Call_Result']='Timeout';default:}_0x2fbfee[_0x9e58('0x74')]=(_0x593d33===_0x9e58('0x75')?moment(_0x1bc070['starttime'])['format'](_0x9e58('0x68')):moment(_0x1bc070[_0x9e58('0x76')])[_0x9e58('0x31')](_0x9e58('0x68')))||moment()[_0x9e58('0x31')](_0x9e58('0x68'));_0x2fbfee[_0x9e58('0x77')]=_0x593d33||'Inbound';_0x2fbfee=_[_0x9e58('0x78')](_0x2fbfee,getCustomFields(_0x509014[_0x9e58('0x79')],_0x1bc070));return request({'method':_0x9e58('0x22'),'uri':_0x9e58('0x43')+_0x423f58+'/crm/v2/Calls','headers':{'Authorization':_0x9e58('0x34')+_0x339f03},'body':{'data':[_0x2fbfee]},'json':!![]})[_0x9e58('0x28')](function(_0x5ed9c8){if(_0x5ed9c8&&_0x5ed9c8[_0x9e58('0x41')][0x0][_0x9e58('0x4a')]===_0x9e58('0x7a')){logger[_0x9e58('0x39')](_0x9e58('0x7b'));return{'id':_0x5ed9c8[_0x9e58('0x41')][0x0]['details']['id']};}})['catch'](function(_0x2715ab){logger['info'](_0x9e58('0x7c'),_0x2715ab[_0x9e58('0x2e')]);console[_0x9e58('0x4d')](_0x9e58('0x7c'),_0x2715ab);});}exports[_0x9e58('0x7d')]=function(_0x3a847f,_0x63cf8a,_0x43fffc,_0x3010a8,_0x17b418,_0x45f7e5){var _0x346ddf,_0x5b8f5f,_0x87438f;_0x45f7e5[_0x9e58('0x7e')]=intUtil[_0x9e58('0x7f')](_0x45f7e5[_0x9e58('0x7e')]);_0x45f7e5['serverUrl']=intUtil[_0x9e58('0x7f')](_0x45f7e5[_0x9e58('0x80')]);if(_0x17b418&&_0x17b418['monitor_format']){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x63cf8a[_0x9e58('0x81')]=_0x45f7e5[_0x9e58('0x80')]+_0x9e58('0x82')+_0x63cf8a[_0x9e58('0x83')]+'/downloads?type=uniqueid&token='+md5(_0x63cf8a[_0x9e58('0x83')]);}else{_0x63cf8a[_0x9e58('0x81')]='';}var _0x58c0d4=_0x45f7e5[_0x9e58('0x7e')]===_0x9e58('0x84')?'eu':_0x9e58('0x85');return getAccessToken(_0x45f7e5)[_0x9e58('0x28')](function(_0x1905c6){_0x87438f=_0x1905c6;return getUser(_0x87438f,_0x58c0d4,_0x45f7e5,_0x3010a8['email']);})[_0x9e58('0x28')](function(_0x412279){_0x346ddf=_0x412279;logger[_0x9e58('0x39')]('The\x20User\x20ID\x20is:',_0x346ddf['id']);return getEndUser(_0x87438f,_0x58c0d4,_0x45f7e5,_0x63cf8a[_0x9e58('0x86')],_0x63cf8a['calleridnum'],_0x346ddf,_0x43fffc);})[_0x9e58('0x28')](function(_0x27a9b6){_0x5b8f5f=_0x27a9b6;return getCall(_0x87438f,_0x58c0d4,_0x45f7e5,_0x346ddf,_0x5b8f5f,_0x43fffc,_0x63cf8a,'Inbound');})[_0x9e58('0x28')](function(_0x10a4ab){if(_0x10a4ab){logger['info'](_0x9e58('0x87'),_0x10a4ab['id']);logger[_0x9e58('0x39')]('[QUEUE]',_0x9e58('0x88'));emit(util[_0x9e58('0x31')](_0x9e58('0x89'),_0x3010a8[_0x9e58('0x17')]),_0x9e58('0x8a'),{'uri':_0x9e58('0x8b')+_0x45f7e5[_0x9e58('0x7e')]+_0x9e58('0x8c')+_0x10a4ab['id']});}})['catch'](function(_0x2ed616){logger[_0x9e58('0x2c')](_0x9e58('0x8d'),JSON[_0x9e58('0x3f')](_0x2ed616));});};exports[_0x9e58('0x75')]=function(_0x43747f,_0x1451e9,_0x13cacd,_0x1a4348,_0x44a28e,_0xfcda87,_0x34bbad){var _0x5e5f59,_0x296ad8,_0x535d22;_0xfcda87[_0x9e58('0x7e')]=intUtil[_0x9e58('0x7f')](_0xfcda87['host']);_0xfcda87[_0x9e58('0x80')]=intUtil[_0x9e58('0x7f')](_0xfcda87[_0x9e58('0x80')]);if(_0x34bbad&&_0x34bbad[_0x9e58('0x8e')]&&_0x34bbad[_0x9e58('0x8e')]!==_0x9e58('0x8f')){logger[_0x9e58('0x39')]('[OUTBOUND]',_0x9e58('0x90'));_0x1451e9[_0x9e58('0x81')]=_0xfcda87[_0x9e58('0x80')]+_0x9e58('0x82')+_0x1451e9[_0x9e58('0x83')]+_0x9e58('0x91')+md5(_0x1451e9[_0x9e58('0x83')]);}var _0x1b142c=_0xfcda87[_0x9e58('0x7e')]===_0x9e58('0x84')?'eu':_0x9e58('0x85');return getAccessToken(_0xfcda87)[_0x9e58('0x28')](function(_0x1adbc8){_0x535d22=_0x1adbc8;return getUser(_0x535d22,_0x1b142c,_0xfcda87,_0x1a4348[_0x9e58('0x92')]);})[_0x9e58('0x28')](function(_0x39235e){_0x5e5f59=_0x39235e;logger[_0x9e58('0x39')](_0x9e58('0x93'),_0x5e5f59['id']);return getEndUser(_0x535d22,_0x1b142c,_0xfcda87,_0x1451e9[_0x9e58('0x94')],_0x1451e9[_0x9e58('0x95')],_0x5e5f59,_0x13cacd);})['then'](function(_0x46f6b6){_0x296ad8=_0x46f6b6;return getCall(_0x535d22,_0x1b142c,_0xfcda87,_0x5e5f59,_0x296ad8,_0x13cacd,_0x1451e9,_0x9e58('0x96'));})[_0x9e58('0x28')](function(_0x14ffb5){if(_0x14ffb5){logger[_0x9e58('0x39')](_0x9e58('0x87'),_0x14ffb5['id']);logger[_0x9e58('0x39')](_0x9e58('0x97'),_0x9e58('0x88'));emit(util[_0x9e58('0x31')](_0x9e58('0x89'),_0x1a4348[_0x9e58('0x17')]),_0x9e58('0x8a'),{'uri':_0x9e58('0x8b')+_0xfcda87[_0x9e58('0x7e')]+'/crm/EntityInfo.do?module=Calls&id='+_0x14ffb5['id']});}})['catch'](function(_0x3bdfe0){logger[_0x9e58('0x2c')](_0x9e58('0x97'),JSON[_0x9e58('0x3f')](_0x3bdfe0));});};exports[_0x9e58('0x98')]=function(_0x448990,_0x37820f,_0x374e47,_0x211016,_0x5d6854,_0x120326){var _0x4fd224,_0x59e28b,_0x433867;_0x120326[_0x9e58('0x7e')]=intUtil[_0x9e58('0x7f')](_0x120326[_0x9e58('0x7e')]);_0x120326[_0x9e58('0x80')]=intUtil[_0x9e58('0x7f')](_0x120326[_0x9e58('0x80')]);if(_0x5d6854&&_0x5d6854[_0x9e58('0x99')]){logger['info']('['+_0x37820f['lastevent'][_0x9e58('0x9a')]()+']',_0x9e58('0x90'));_0x37820f[_0x9e58('0x81')]=_0x120326[_0x9e58('0x80')]+_0x9e58('0x82')+_0x37820f['uniqueid']+_0x9e58('0x91')+md5(_0x37820f[_0x9e58('0x83')]);}else{_0x37820f['recordingURL']='';}var _0x2012f7=_0x120326[_0x9e58('0x7e')]===_0x9e58('0x84')?'eu':'com';return getAccessToken(_0x120326)['then'](function(_0x54bbb9){_0x433867=_0x54bbb9;return getUser(_0x433867,_0x2012f7,_0x120326);})['then'](function(_0x2914a7){_0x4fd224=_0x2914a7;logger['info'](_0x9e58('0x93'),_0x4fd224['id']);return getEndUser(_0x433867,_0x2012f7,_0x120326,_0x37820f[_0x9e58('0x86')],_0x37820f[_0x9e58('0x9b')],_0x4fd224,_0x374e47);})['then'](function(_0x319475){_0x59e28b=_0x319475;return getCall(_0x433867,_0x2012f7,_0x120326,_0x4fd224,_0x59e28b,_0x374e47,_0x37820f,'Inbound');})[_0x9e58('0x28')](function(_0x320fd0){if(_0x320fd0){logger[_0x9e58('0x39')](_0x9e58('0x87'),_0x320fd0['id']);}})[_0x9e58('0x2b')](function(_0x3b24c9){logger['error']('['+_0x37820f[_0x9e58('0x6a')][_0x9e58('0x9a')]()+']',JSON[_0x9e58('0x3f')](_0x3b24c9));});}; \ No newline at end of file +var _0x3d4f=['expires_in','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','refresh_token','add','seconds','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','then','isArrayLikeObject','findIndex','users','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','user','error','The\x20failing\x20result\x20is','enduserType','https://www.zohoapis.','startCase','role','first_name','last_name','data','code','SUCCESS','details','moduleCreate','Error:\x20','log','CREATE\x20ERROR','contact_lead','uri','Contacts','Leads','nothing','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Creating\x20new\x20call...','Owner','profile','administrator','Subject','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','mm:ss','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','complete','Call_Result','Answered','rejected','Rejected','abandoned','Abandoned','Timeout','Call_Start_Time','outbound','Call_Type','Inbound','merge','Zoho-oauthtoken\x20','Call\x20created!','err','stripTrailingSlash','host','serverUrl','monitor_format','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','email','destcalleridname','destcalleridnum','Outbound','The\x20Call\x20ID\x20is:','unmanaged','toUpperCase','lodash','request-promise','md5','util','./util','ioredis','bluebird','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','includes','picklist','type','idField','content','variable','variableName','toString','customVariable','Variable','toLowerCase','name','indexOf','split','isNil','isBefore'];(function(_0x2ad008,_0x45c253){var _0x4538cf=function(_0xe143e4){while(--_0xe143e4){_0x2ad008['push'](_0x2ad008['shift']());}};_0x4538cf(++_0x45c253);}(_0x3d4f,0x1bb));var _0xf3d4=function(_0xed01eb,_0x275edb){_0xed01eb=_0xed01eb-0x0;var _0x25b9de=_0x3d4f[_0xed01eb];return _0x25b9de;};'use strict';var _=require(_0xf3d4('0x0'));var rp=require(_0xf3d4('0x1'));var md5=require(_0xf3d4('0x2'));var util=require(_0xf3d4('0x3'));var intUtil=require(_0xf3d4('0x4'));var moment=require('moment');var Redis=require(_0xf3d4('0x5'));var BPromise=require(_0xf3d4('0x6'));var config=require(_0xf3d4('0x7'));var logger=require(_0xf3d4('0x8'))('zoho');config[_0xf3d4('0x9')]=_[_0xf3d4('0xa')](config[_0xf3d4('0x9')],{'host':_0xf3d4('0xb'),'port':0x18eb});var io=require(_0xf3d4('0xc'))(new Redis(config[_0xf3d4('0x9')]));function emit(_0x5ccf61,_0x3ee9f3,_0xfad1ce){io['to'](_0x5ccf61)[_0xf3d4('0xd')](_0x3ee9f3,_0xfad1ce);}function request(_0x321bae){logger[_0xf3d4('0xe')](_0xf3d4('0xf'),JSON[_0xf3d4('0x10')](_0x321bae));return rp(_0x321bae);}function getCustomFields(_0x2e3e4e,_0x238a3c){var _0x3d113e={};if(_0x2e3e4e[_0xf3d4('0x11')]>0x0){_['forEach'](_0x2e3e4e,function(_0x56acd7){if(_[_0xf3d4('0x12')](['string',_0xf3d4('0x13')],_0x56acd7[_0xf3d4('0x14')])&&_0x56acd7[_0xf3d4('0x15')]){_0x3d113e[_0x56acd7[_0xf3d4('0x15')]]=_0x56acd7[_0xf3d4('0x16')]['toString']();}else if(_0x56acd7[_0xf3d4('0x14')]===_0xf3d4('0x17')&&_0x56acd7['variableName']&&_0x56acd7[_0xf3d4('0x15')]&&_0x238a3c[_0x56acd7[_0xf3d4('0x18')]]){_0x3d113e[_0x56acd7[_0xf3d4('0x15')]]=_0x238a3c[_0x56acd7[_0xf3d4('0x18')]][_0xf3d4('0x19')]();}else if(_0x56acd7['type']===_0xf3d4('0x1a')&&_0x56acd7[_0xf3d4('0x1b')]&&_0x56acd7[_0xf3d4('0x1b')]['name']&&_0x56acd7['idField']&&_0x238a3c[_0x56acd7['Variable']['name'][_0xf3d4('0x1c')]()]){_0x3d113e[_0x56acd7[_0xf3d4('0x15')]]=_0x238a3c[_0x56acd7[_0xf3d4('0x1b')][_0xf3d4('0x1d')][_0xf3d4('0x1c')]()][_0xf3d4('0x19')]();}});}return _0x3d113e;}function getName(_0x5e2258){if(_0x5e2258[_0xf3d4('0x1e')]('\x20')>0x0){var _0x4cfcbb=_0x5e2258[_0xf3d4('0x1f')](/ (.+)/);if(_0x4cfcbb[0x1]){return _0x4cfcbb;}}return[_0x5e2258,_0x5e2258];}var accountsTokens={};function getAccessToken(_0x36d2aa){return new Promise(function(_0x4299d4,_0x116274){if(!_[_0xf3d4('0x20')](accountsTokens[_0x36d2aa['id']])&&!_[_0xf3d4('0x20')](accountsTokens[_0x36d2aa['id']]['access_token'])){if(moment()[_0xf3d4('0x21')](accountsTokens[_0x36d2aa['id']][_0xf3d4('0x22')])){_0x4299d4(accountsTokens[_0x36d2aa['id']][_0xf3d4('0x23')]);}}var _0x4028d8;switch(_0x36d2aa[_0xf3d4('0x24')]){case'US':_0x4028d8=_0xf3d4('0x25');break;case'AU':_0x4028d8=_0xf3d4('0x26');break;case'EU':_0x4028d8=_0xf3d4('0x27');break;case'IN':_0x4028d8=_0xf3d4('0x28');break;case'CN':_0x4028d8=_0xf3d4('0x29');break;default:_0x4028d8=_0xf3d4('0x27');break;}var _0x5c67bf={'method':_0xf3d4('0x2a'),'uri':_0x4028d8+_0xf3d4('0x2b'),'qs':{'refresh_token':_0x36d2aa['refreshToken'],'client_id':_0x36d2aa[_0xf3d4('0x2c')],'client_secret':_0x36d2aa['clientSecret'],'grant_type':_0xf3d4('0x2d')},'json':!![]};return rp(_0x5c67bf)['then'](function(_0x3453ac){accountsTokens[_0x36d2aa['id']]={'access_token':_0x3453ac[_0xf3d4('0x23')],'expires_in':moment()[_0xf3d4('0x2e')](_0x3453ac['expires_in'],_0xf3d4('0x2f'))};_0x4299d4(_0x3453ac['access_token']);})[_0xf3d4('0x30')](function(_0x4dcf1e){logger['error'](_0xf3d4('0x31'),_0x4dcf1e[_0xf3d4('0x32')]);_0x116274(_0x4dcf1e);});});}function getUser(_0x178234,_0x9d074c,_0x55cc7e,_0x533393){logger[_0xf3d4('0x33')](_0xf3d4('0x34'));return request({'method':_0xf3d4('0x35'),'uri':util[_0xf3d4('0x36')](_0xf3d4('0x37'),_0x9d074c),'qs':{'type':_0xf3d4('0x38')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x178234},'json':!![]})[_0xf3d4('0x39')](function(_0x1e4798){if(_0x1e4798['users']){var _0x4d4647=-0x1;if(_[_0xf3d4('0x3a')](_0x1e4798['users'])){if(!_[_0xf3d4('0x20')](_0x533393)){_0x4d4647=_[_0xf3d4('0x3b')](_0x1e4798[_0xf3d4('0x3c')],function(_0x4349b9){return _0x4349b9['email']===_0x533393;});}if(_0x4d4647>=0x0){logger[_0xf3d4('0x33')](_0xf3d4('0x3d'));}else{logger[_0xf3d4('0x33')](_0xf3d4('0x3e'));_0x4d4647=_[_0xf3d4('0x3b')](_0x1e4798[_0xf3d4('0x3c')],function(_0x4ae6d3){return _0x4ae6d3['profile'][_0xf3d4('0x1d')]===_0xf3d4('0x3f');});}return _0x1e4798[_0xf3d4('0x3c')][_0x4d4647];}else{if(_0x1e4798['user']['profile']['name']===_0xf3d4('0x3f')){logger['info']('Using\x20the\x20admin\x20account!');user=_0x1e4798[_0xf3d4('0x40')];return user;}else{logger[_0xf3d4('0x41')](_0xf3d4('0x42'),JSON[_0xf3d4('0x10')](_0x1e4798));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x1e4798));}}}else{logger[_0xf3d4('0x41')](_0xf3d4('0x42'),JSON[_0xf3d4('0x10')](_0x1e4798));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x1e4798));}})[_0xf3d4('0x30')](function(_0x500dfd){console[_0xf3d4('0x41')](_0x500dfd);});}function getZohoUser(_0x4147ed,_0x1d3c6d){return new BPromise(function(_0x5cd8c7,_0xcceb7f){request(_0x4147ed)['then'](function(_0x9e0eab){var _0x48d2e9=null;if(_0x9e0eab){_0x48d2e9=_0x9e0eab['data'][0x0];_0x48d2e9[_0xf3d4('0x43')]=_0x1d3c6d;}_0x5cd8c7(_0x48d2e9);})[_0xf3d4('0x30')](function(_0x9a2779){_0xcceb7f(_0x9a2779);});});}function createEndUser(_0x1ce9a6,_0x3f8954,_0x44496c,_0x2201a5,_0x566137,_0x493dde){var _0x44496c=getName(_0x44496c);return request({'method':'POST','uri':_0xf3d4('0x44')+_0x3f8954+'/crm/v2/'+_[_0xf3d4('0x45')](_0x493dde['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x44496c[0x1],'First_Name':_0x44496c[0x0],'Phone':_0x2201a5,'Owner':{'name':!_['isNil'](_0x566137['role'][_0xf3d4('0x1d')])?_0x566137[_0xf3d4('0x46')][_0xf3d4('0x1d')]:!_[_0xf3d4('0x20')](_0x566137[_0xf3d4('0x47')])?_0x566137[_0xf3d4('0x47')]+'\x20'+_0x566137['last_name']:_0x566137[_0xf3d4('0x48')],'id':_0x566137['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1ce9a6},'json':!![]})[_0xf3d4('0x39')](function(_0x426c32){if(_0x426c32&&_0x426c32[_0xf3d4('0x49')][0x0][_0xf3d4('0x4a')]===_0xf3d4('0x4b')){var _0x1b1875=_0x426c32[_0xf3d4('0x49')][0x0][_0xf3d4('0x4c')];_0x1b1875[_0xf3d4('0x43')]=_[_0xf3d4('0x45')](_0x493dde[_0xf3d4('0x4d')])+'s';return _0x1b1875;}logger[_0xf3d4('0x41')](_0xf3d4('0x42'),JSON['stringify'](data));throw new Error(_0xf3d4('0x4e')+JSON[_0xf3d4('0x10')](data));})['catch'](function(_0x236aa7){console[_0xf3d4('0x4f')](_0xf3d4('0x50'),_0x236aa7);});}function getEndUser(_0x389ae4,_0x3f2ce9,_0x37e25f,_0x5a703d,_0x55751c,_0x31ab2a,_0x1c90a0){var _0x3d8fd1={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x389ae4},'json':!![]};switch(_0x1c90a0['moduleSearch']){case _0xf3d4('0x51'):_0x3d8fd1[_0xf3d4('0x52')]=_0xf3d4('0x44')+_0x3f2ce9+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x55751c+'))';return getZohoUser(_0x3d8fd1,_0xf3d4('0x53'))[_0xf3d4('0x39')](function(_0x158466){if(_0x158466)return _0x158466;_0x3d8fd1[_0xf3d4('0x52')]=_0xf3d4('0x44')+_0x3f2ce9+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x55751c+'))';return getZohoUser(_0x3d8fd1,_0xf3d4('0x54'))[_0xf3d4('0x39')](function(_0x5749c9){if(_0x5749c9)return _0x5749c9;if(_0x1c90a0['moduleCreate']!=_0xf3d4('0x55')){return createEndUser(_0x389ae4,_0x3f2ce9,_0x5a703d,_0x55751c,_0x31ab2a,_0x1c90a0);}else{return{};}});});break;case'contact':_0x3d8fd1[_0xf3d4('0x52')]='https://www.zohoapis.'+_0x3f2ce9+_0xf3d4('0x56')+_0x55751c+'))';return getZohoUser(_0x3d8fd1,_0xf3d4('0x53'))[_0xf3d4('0x39')](function(_0x40c2a0){if(_0x40c2a0)return _0x40c2a0;if(_0x1c90a0[_0xf3d4('0x4d')]!=_0xf3d4('0x55')){return createEndUser(_0x389ae4,_0x3f2ce9,_0x5a703d,_0x55751c,_0x31ab2a,_0x1c90a0);}else{return{};}});break;case _0xf3d4('0x57'):_0x3d8fd1[_0xf3d4('0x52')]=_0xf3d4('0x44')+_0x3f2ce9+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x55751c+'))';return getZohoUser(_0x3d8fd1,'Leads')[_0xf3d4('0x39')](function(_0x383188){if(_0x383188)return _0x383188;if(_0x1c90a0[_0xf3d4('0x4d')]!=_0xf3d4('0x55')){return createEndUser(_0x389ae4,_0x3f2ce9,_0x5a703d,_0x55751c,_0x31ab2a,_0x1c90a0);}else{return{};}});break;}}function getCall(_0x59c80d,_0x1e6604,_0x1b2fd4,_0x235544,_0x55bbd5,_0xe6cab9,_0x2b1973,_0x3ea74b){logger[_0xf3d4('0x33')](_0xf3d4('0x58'));var _0x16a468={};_0x16a468[_0xf3d4('0x59')]={'name':!_[_0xf3d4('0x20')](_0x235544[_0xf3d4('0x46')][_0xf3d4('0x1d')])&&!_[_0xf3d4('0x20')](_0x235544['profile'][_0xf3d4('0x1d')])&&_0x235544[_0xf3d4('0x5a')][_0xf3d4('0x1d')]===_0xf3d4('0x5b')?_0x235544[_0xf3d4('0x46')]['name']:!_[_0xf3d4('0x20')](_0x235544[_0xf3d4('0x47')])?_0x235544[_0xf3d4('0x47')]+'\x20'+_0x235544[_0xf3d4('0x48')]:_0x235544['last_name'],'id':_0x235544['id']};_0x16a468[_0xf3d4('0x5c')]=intUtil[_0xf3d4('0x5d')](_0xe6cab9['Subjects'],_0x2b1973,'\x20');_0x16a468[_0xf3d4('0x5e')]=intUtil[_0xf3d4('0x5d')](_0xe6cab9[_0xf3d4('0x5f')],_0x2b1973,'\x0a');if(_0x55bbd5[_0xf3d4('0x43')]===_0xf3d4('0x53')){_0x16a468[_0xf3d4('0x60')]={'name':!_['isNil'](_0x55bbd5['Full_Name'])?_0x55bbd5[_0xf3d4('0x61')]:!_[_0xf3d4('0x20')](_0x55bbd5[_0xf3d4('0x62')])?_0x55bbd5[_0xf3d4('0x62')]+'\x20'+_0x55bbd5['Last_Name']:_0x55bbd5[_0xf3d4('0x63')],'id':_0x55bbd5['id']};}if(_0x55bbd5['enduserType']===_0xf3d4('0x54')){_0x16a468[_0xf3d4('0x64')]={'name':!_[_0xf3d4('0x20')](_0x55bbd5[_0xf3d4('0x61')])?_0x55bbd5[_0xf3d4('0x61')]:!_[_0xf3d4('0x20')](_0x55bbd5[_0xf3d4('0x62')])?_0x55bbd5['First_Name']+'\x20'+_0x55bbd5['Last_Name']:_0x55bbd5[_0xf3d4('0x63')],'id':_0x55bbd5['id']};_0x16a468[_0xf3d4('0x65')]=_['startCase'](_0x55bbd5[_0xf3d4('0x43')]);}if(_0x2b1973[_0xf3d4('0x66')]){_0x16a468['Call_Duration']=moment[_0xf3d4('0x67')](parseInt(_0x2b1973['talktime'])*0x3e8)[_0xf3d4('0x36')](_0xf3d4('0x68'));}else if(_0x2b1973[_0xf3d4('0x69')]&&_0x2b1973[_0xf3d4('0x6a')]){_0x16a468[_0xf3d4('0x6b')]=moment[_0xf3d4('0x67')](moment(_0x2b1973[_0xf3d4('0x6a')],_0xf3d4('0x6c'))[_0xf3d4('0x6d')](moment(_0x2b1973[_0xf3d4('0x6e')],_0xf3d4('0x6c'))))[_0xf3d4('0x36')]('mm:ss');}switch(_0x2b1973[_0xf3d4('0x6f')]){case _0xf3d4('0x70'):_0x16a468['Call_Result']='Called';break;case _0xf3d4('0x71'):case'connect':_0x16a468[_0xf3d4('0x72')]=_0xf3d4('0x73');break;case _0xf3d4('0x74'):_0x16a468[_0xf3d4('0x72')]=_0xf3d4('0x75');break;case _0xf3d4('0x76'):_0x16a468[_0xf3d4('0x72')]=_0xf3d4('0x77');break;case'timeout':_0x16a468[_0xf3d4('0x72')]=_0xf3d4('0x78');default:}_0x16a468[_0xf3d4('0x79')]=(_0x3ea74b===_0xf3d4('0x7a')?moment(_0x2b1973['starttime'])[_0xf3d4('0x36')](_0xf3d4('0x6c')):moment(_0x2b1973['agentcalledAt'])['format'](_0xf3d4('0x6c')))||moment()[_0xf3d4('0x36')]('YYYY-MM-DDTHH:mm:ss');_0x16a468[_0xf3d4('0x7b')]=_0x3ea74b||_0xf3d4('0x7c');_0x16a468=_[_0xf3d4('0x7d')](_0x16a468,getCustomFields(_0xe6cab9['Fields'],_0x2b1973));return request({'method':_0xf3d4('0x2a'),'uri':_0xf3d4('0x44')+_0x1e6604+'/crm/v2/Calls','headers':{'Authorization':_0xf3d4('0x7e')+_0x59c80d},'body':{'data':[_0x16a468]},'json':!![]})[_0xf3d4('0x39')](function(_0x52fa28){if(_0x52fa28&&_0x52fa28[_0xf3d4('0x49')][0x0][_0xf3d4('0x4a')]===_0xf3d4('0x4b')){logger[_0xf3d4('0x33')](_0xf3d4('0x7f'));return{'id':_0x52fa28['data'][0x0][_0xf3d4('0x4c')]['id']};}})['catch'](function(_0x5324c0){logger[_0xf3d4('0x33')](_0xf3d4('0x80'),_0x5324c0[_0xf3d4('0x32')]);console[_0xf3d4('0x4f')]('err',_0x5324c0);});}exports['queue']=function(_0x2ac5d7,_0x4dd9b5,_0x13cd68,_0x56ef13,_0x2df095,_0x24dfb0){var _0x36437a,_0x3d7f81,_0x4219e8;_0x24dfb0['host']=intUtil[_0xf3d4('0x81')](_0x24dfb0[_0xf3d4('0x82')]);_0x24dfb0['serverUrl']=intUtil[_0xf3d4('0x81')](_0x24dfb0[_0xf3d4('0x83')]);if(_0x2df095&&_0x2df095[_0xf3d4('0x84')]){logger[_0xf3d4('0x33')](_0xf3d4('0x85'),'Recording\x20is\x20enabled!');_0x4dd9b5[_0xf3d4('0x86')]=_0x24dfb0[_0xf3d4('0x83')]+_0xf3d4('0x87')+_0x4dd9b5[_0xf3d4('0x88')]+_0xf3d4('0x89')+md5(_0x4dd9b5[_0xf3d4('0x88')]);}else{_0x4dd9b5[_0xf3d4('0x86')]='';}var _0x69ff84=_0x24dfb0['host']===_0xf3d4('0x8a')?'eu':_0xf3d4('0x8b');return getAccessToken(_0x24dfb0)[_0xf3d4('0x39')](function(_0x1c02e9){_0x4219e8=_0x1c02e9;return getUser(_0x4219e8,_0x69ff84,_0x24dfb0,_0x56ef13['email']);})[_0xf3d4('0x39')](function(_0x21f25f){_0x36437a=_0x21f25f;logger[_0xf3d4('0x33')](_0xf3d4('0x8c'),_0x36437a['id']);return getEndUser(_0x4219e8,_0x69ff84,_0x24dfb0,_0x4dd9b5[_0xf3d4('0x8d')],_0x4dd9b5[_0xf3d4('0x8e')],_0x36437a,_0x13cd68);})[_0xf3d4('0x39')](function(_0x4839d3){_0x3d7f81=_0x4839d3;return getCall(_0x4219e8,_0x69ff84,_0x24dfb0,_0x36437a,_0x3d7f81,_0x13cd68,_0x4dd9b5,_0xf3d4('0x7c'));})[_0xf3d4('0x39')](function(_0x41a6ed){if(_0x41a6ed){logger[_0xf3d4('0x33')]('The\x20Call\x20ID\x20is:',_0x41a6ed['id']);logger['info'](_0xf3d4('0x85'),_0xf3d4('0x8f'));emit(util[_0xf3d4('0x36')](_0xf3d4('0x90'),_0x56ef13['name']),_0xf3d4('0x91'),{'uri':_0xf3d4('0x92')+_0x24dfb0[_0xf3d4('0x82')]+_0xf3d4('0x93')+_0x41a6ed['id']});}})[_0xf3d4('0x30')](function(_0x3bb274){logger[_0xf3d4('0x41')](_0xf3d4('0x85'),JSON['stringify'](_0x3bb274));});};exports['outbound']=function(_0x93ac44,_0x31de36,_0x544388,_0x3d7a42,_0x126667,_0x4055df,_0x4dd599){var _0x102339,_0x59d2f1,_0x183494;_0x4055df[_0xf3d4('0x82')]=intUtil[_0xf3d4('0x81')](_0x4055df[_0xf3d4('0x82')]);_0x4055df['serverUrl']=intUtil[_0xf3d4('0x81')](_0x4055df['serverUrl']);if(_0x4dd599&&_0x4dd599['recordingFormat']&&_0x4dd599[_0xf3d4('0x94')]!==_0xf3d4('0x95')){logger[_0xf3d4('0x33')](_0xf3d4('0x96'),_0xf3d4('0x97'));_0x31de36[_0xf3d4('0x86')]=_0x4055df['serverUrl']+_0xf3d4('0x87')+_0x31de36['uniqueid']+_0xf3d4('0x89')+md5(_0x31de36[_0xf3d4('0x88')]);}var _0x3955e2=_0x4055df[_0xf3d4('0x82')]==='zoho.eu'?'eu':_0xf3d4('0x8b');return getAccessToken(_0x4055df)['then'](function(_0x5ed975){_0x183494=_0x5ed975;return getUser(_0x183494,_0x3955e2,_0x4055df,_0x3d7a42[_0xf3d4('0x98')]);})['then'](function(_0x11fa44){_0x102339=_0x11fa44;logger[_0xf3d4('0x33')](_0xf3d4('0x8c'),_0x102339['id']);return getEndUser(_0x183494,_0x3955e2,_0x4055df,_0x31de36[_0xf3d4('0x99')],_0x31de36[_0xf3d4('0x9a')],_0x102339,_0x544388);})[_0xf3d4('0x39')](function(_0x1f8fd6){_0x59d2f1=_0x1f8fd6;return getCall(_0x183494,_0x3955e2,_0x4055df,_0x102339,_0x59d2f1,_0x544388,_0x31de36,_0xf3d4('0x9b'));})[_0xf3d4('0x39')](function(_0x39393c){if(_0x39393c){logger[_0xf3d4('0x33')](_0xf3d4('0x9c'),_0x39393c['id']);logger[_0xf3d4('0x33')](_0xf3d4('0x96'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xf3d4('0x90'),_0x3d7a42[_0xf3d4('0x1d')]),_0xf3d4('0x91'),{'uri':'https://crm.'+_0x4055df['host']+_0xf3d4('0x93')+_0x39393c['id']});}})['catch'](function(_0x5355cc){logger[_0xf3d4('0x41')]('[OUTBOUND]',JSON[_0xf3d4('0x10')](_0x5355cc));});};exports[_0xf3d4('0x9d')]=function(_0x28c97b,_0x524bcd,_0x50959e,_0xdea049,_0x27702c,_0x2aeae8){var _0x4db509,_0x443b91,_0x36bde8;_0x2aeae8[_0xf3d4('0x82')]=intUtil[_0xf3d4('0x81')](_0x2aeae8[_0xf3d4('0x82')]);_0x2aeae8[_0xf3d4('0x83')]=intUtil['stripTrailingSlash'](_0x2aeae8[_0xf3d4('0x83')]);if(_0x27702c&&_0x27702c['monitor_format']){logger[_0xf3d4('0x33')]('['+_0x524bcd[_0xf3d4('0x6f')][_0xf3d4('0x9e')]()+']',_0xf3d4('0x97'));_0x524bcd[_0xf3d4('0x86')]=_0x2aeae8['serverUrl']+_0xf3d4('0x87')+_0x524bcd[_0xf3d4('0x88')]+_0xf3d4('0x89')+md5(_0x524bcd[_0xf3d4('0x88')]);}else{_0x524bcd[_0xf3d4('0x86')]='';}var _0x427427=_0x2aeae8['host']===_0xf3d4('0x8a')?'eu':_0xf3d4('0x8b');return getAccessToken(_0x2aeae8)[_0xf3d4('0x39')](function(_0x1f6e6b){_0x36bde8=_0x1f6e6b;return getUser(_0x36bde8,_0x427427,_0x2aeae8);})[_0xf3d4('0x39')](function(_0x144bfa){_0x4db509=_0x144bfa;logger[_0xf3d4('0x33')](_0xf3d4('0x8c'),_0x4db509['id']);return getEndUser(_0x36bde8,_0x427427,_0x2aeae8,_0x524bcd['calleridname'],_0x524bcd[_0xf3d4('0x8e')],_0x4db509,_0x50959e);})['then'](function(_0x5621ba){_0x443b91=_0x5621ba;return getCall(_0x36bde8,_0x427427,_0x2aeae8,_0x4db509,_0x443b91,_0x50959e,_0x524bcd,_0xf3d4('0x7c'));})[_0xf3d4('0x39')](function(_0x10bc25){if(_0x10bc25){logger[_0xf3d4('0x33')]('The\x20Call\x20ID\x20is:',_0x10bc25['id']);}})[_0xf3d4('0x30')](function(_0xf6c5ca){logger[_0xf3d4('0x41')]('['+_0x524bcd[_0xf3d4('0x6f')][_0xf3d4('0x9e')]()+']',JSON[_0xf3d4('0x10')](_0xf6c5ca));});}; \ 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 f468ad1..cbd384c 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 _0xea30=['shelljs','mustache','../../../../config/logger','trigger','exec','data2','Script','render','error','format','%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'];(function(_0x50c492,_0x5c1e67){var _0x3505a8=function(_0x2f7937){while(--_0x2f7937){_0x50c492['push'](_0x50c492['shift']());}};_0x3505a8(++_0x5c1e67);}(_0xea30,0x125));var _0x0ea3=function(_0x6e26b3,_0x27f8c2){_0x6e26b3=_0x6e26b3-0x0;var _0x3ee399=_0xea30[_0x6e26b3];return _0x3ee399;};'use strict';var util=require(_0x0ea3('0x0'));var sh=require(_0x0ea3('0x1'));var Mustache=require(_0x0ea3('0x2'));var logger=require(_0x0ea3('0x3'))(_0x0ea3('0x4'));exports[_0x0ea3('0x5')]=function(_0x53043a,_0x5ca61c){var _0x440613=_0x53043a['data2']?_0x53043a[_0x0ea3('0x6')]:_0x0ea3('0x7');var _0x210199=_0x53043a['data3']?Mustache[_0x0ea3('0x8')](_0x53043a['data3'],_0x5ca61c):_0x5ca61c;sh[_0x0ea3('0x5')](_0x210199,function(_0x10c756,_0x4bf0ec,_0x4777aa){if(_0x10c756!==0x0){logger[_0x0ea3('0x9')](util[_0x0ea3('0xa')](_0x0ea3('0xb'),_0x440613,_0x210199,_0x10c756,_0x4777aa));}else{logger[_0x0ea3('0xc')](util[_0x0ea3('0xa')](_0x0ea3('0xd'),_0x440613,_0x210199,_0x4bf0ec));}});}; \ No newline at end of file +var _0xefbc=['shelljs','mustache','trigger','data2','Script','render','data3','exec','error','format','%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'];(function(_0x1f3190,_0x3eff53){var _0x95e95f=function(_0xcbb102){while(--_0xcbb102){_0x1f3190['push'](_0x1f3190['shift']());}};_0x95e95f(++_0x3eff53);}(_0xefbc,0x1cd));var _0xcefb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xefbc[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xcefb('0x0'));var sh=require(_0xcefb('0x1'));var Mustache=require(_0xcefb('0x2'));var logger=require('../../../../config/logger')(_0xcefb('0x3'));exports['exec']=function(_0xfb582e,_0x59a3fe){var _0x2c480e=_0xfb582e[_0xcefb('0x4')]?_0xfb582e['data2']:_0xcefb('0x5');var _0x36ad4f=_0xfb582e['data3']?Mustache[_0xcefb('0x6')](_0xfb582e[_0xcefb('0x7')],_0x59a3fe):_0x59a3fe;sh[_0xcefb('0x8')](_0x36ad4f,function(_0x52bc18,_0x4e4efb,_0x1de86f){if(_0x52bc18!==0x0){logger[_0xcefb('0x9')](util[_0xcefb('0xa')](_0xcefb('0xb'),_0x2c480e,_0x36ad4f,_0x52bc18,_0x1de86f));}else{logger[_0xcefb('0xc')](util['format'](_0xcefb('0xd'),_0x2c480e,_0x36ad4f,_0x4e4efb));}});}; \ 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 97181ef..56700c3 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 _0x91e9=['data1','GET','DELETE','PUT','parse','data7','stack','body','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','format','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','request-promise','util','lodash','trigger','exec','toUpperCase','render','data2','data5','number','headers','data6','error'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x91e9,0x1d3));var _0x991e=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x91e9[_0x2c91e9];return _0x13f0ff;};'use strict';var rp=require(_0x991e('0x0'));var util=require(_0x991e('0x1'));var _=require(_0x991e('0x2'));var Mustache=require('mustache');var logger=require('../../../../config/logger')(_0x991e('0x3'));exports[_0x991e('0x4')]=function(_0x36c70d,_0x80c81d){var _0x398daa,_0xe11452;var _0x2974b8={'method':_0x36c70d['data1'][_0x991e('0x5')](),'uri':Mustache[_0x991e('0x6')](_0x36c70d[_0x991e('0x7')],_0x80c81d),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x36c70d[_0x991e('0x8')])===_0x991e('0x9')&&parseInt(_0x36c70d[_0x991e('0x8')])>=0x1&&parseInt(_0x36c70d[_0x991e('0x8')])<=0xa?parseInt(_0x36c70d[_0x991e('0x8')])*0x3e8:0x5*0x3e8};try{_0x2974b8[_0x991e('0xa')]=_0x36c70d[_0x991e('0xb')]?JSON['parse'](Mustache[_0x991e('0x6')](_0x36c70d['data6'],_0x80c81d)):{};}catch(_0x1d1f91){logger[_0x991e('0xc')](_0x1d1f91['stack']);}switch(_0x36c70d[_0x991e('0xd')][_0x991e('0x5')]()){case _0x991e('0xe'):case _0x991e('0xf'):_0x398daa=null;_0x2974b8['qs']=_0x80c81d;break;case'POST':case _0x991e('0x10'):if(_0x36c70d['data7']){try{_0x398daa=JSON[_0x991e('0x11')](Mustache[_0x991e('0x6')](_0x36c70d[_0x991e('0x12')],_0x80c81d));_0x2974b8['body']=_0x398daa;}catch(_0x73bbc9){logger[_0x991e('0xc')](_0x73bbc9[_0x991e('0x13')]);logger[_0x991e('0xc')]('body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format');}}else{_0x398daa=_0x80c81d;_0x2974b8[_0x991e('0x14')]=_0x398daa;}break;}logger['info'](util['format'](_0x991e('0x15'),_0x36c70d[_0x991e('0xd')],_0x36c70d[_0x991e('0x7')],JSON[_0x991e('0x16')](_0x2974b8)));rp(_0x2974b8)[_0x991e('0x17')](function(_0x1b830a){_0x398daa=!_[_0x991e('0x18')](_0x398daa)?_0x991e('0x19')+_0x398daa:'';_0xe11452=typeof _0x1b830a[_0x991e('0x14')]===_0x991e('0x1a')?JSON[_0x991e('0x16')](_0x1b830a[_0x991e('0x14')]):_0x1b830a[_0x991e('0x14')];logger['info'](util['format'](_0x991e('0x1b'),_0x36c70d[_0x991e('0xd')],_0x36c70d[_0x991e('0x7')],_0x1b830a['statusCode'],_0xe11452));})[_0x991e('0x1c')](function(_0x5e385c){logger[_0x991e('0xc')](util[_0x991e('0x1d')](_0x991e('0x1e'),_0x36c70d[_0x991e('0xd')],_0x36c70d[_0x991e('0x7')],_0x5e385c['statusCode'],_0x5e385c[_0x991e('0x1f')],_0x5e385c['message']));});}; \ No newline at end of file +var _0x3753=['data5','number','parse','render','data6','error','DELETE','PUT','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','data2'];(function(_0x7ee859,_0x2b5fc0){var _0x383111=function(_0x1aba8b){while(--_0x1aba8b){_0x7ee859['push'](_0x7ee859['shift']());}};_0x383111(++_0x2b5fc0);}(_0x3753,0x7a));var _0x3375=function(_0x51b9d2,_0x412548){_0x51b9d2=_0x51b9d2-0x0;var _0x2d36e8=_0x3753[_0x51b9d2];return _0x2d36e8;};'use strict';var rp=require(_0x3375('0x0'));var util=require(_0x3375('0x1'));var _=require(_0x3375('0x2'));var Mustache=require(_0x3375('0x3'));var logger=require(_0x3375('0x4'))(_0x3375('0x5'));exports[_0x3375('0x6')]=function(_0x52f818,_0x373f43){var _0x1199ff,_0x93a50f;var _0x69b84={'method':_0x52f818[_0x3375('0x7')][_0x3375('0x8')](),'uri':Mustache['render'](_0x52f818[_0x3375('0x9')],_0x373f43),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x52f818[_0x3375('0xa')])===_0x3375('0xb')&&parseInt(_0x52f818[_0x3375('0xa')])>=0x1&&parseInt(_0x52f818['data5'])<=0xa?parseInt(_0x52f818[_0x3375('0xa')])*0x3e8:0x5*0x3e8};try{_0x69b84['headers']=_0x52f818['data6']?JSON[_0x3375('0xc')](Mustache[_0x3375('0xd')](_0x52f818[_0x3375('0xe')],_0x373f43)):{};}catch(_0x13191f){logger[_0x3375('0xf')](_0x13191f['stack']);}switch(_0x52f818[_0x3375('0x7')][_0x3375('0x8')]()){case'GET':case _0x3375('0x10'):_0x1199ff=null;_0x69b84['qs']=_0x373f43;break;case'POST':case _0x3375('0x11'):if(_0x52f818['data7']){try{_0x1199ff=JSON['parse'](Mustache[_0x3375('0xd')](_0x52f818['data7'],_0x373f43));_0x69b84['body']=_0x1199ff;}catch(_0x5c361a){logger[_0x3375('0xf')](_0x5c361a[_0x3375('0x12')]);logger[_0x3375('0xf')](_0x3375('0x13'));}}else{_0x1199ff=_0x373f43;_0x69b84[_0x3375('0x14')]=_0x1199ff;}break;}logger[_0x3375('0x15')](util[_0x3375('0x16')](_0x3375('0x17'),_0x52f818[_0x3375('0x7')],_0x52f818[_0x3375('0x9')],JSON[_0x3375('0x18')](_0x69b84)));rp(_0x69b84)[_0x3375('0x19')](function(_0x3e5eca){_0x1199ff=!_[_0x3375('0x1a')](_0x1199ff)?_0x3375('0x1b')+_0x1199ff:'';_0x93a50f=typeof _0x3e5eca['body']===_0x3375('0x1c')?JSON['stringify'](_0x3e5eca[_0x3375('0x14')]):_0x3e5eca[_0x3375('0x14')];logger['info'](util[_0x3375('0x16')](_0x3375('0x1d'),_0x52f818[_0x3375('0x7')],_0x52f818[_0x3375('0x9')],_0x3e5eca['statusCode'],_0x93a50f));})['catch'](function(_0x5442c5){logger['error'](util['format'](_0x3375('0x1e'),_0x52f818[_0x3375('0x7')],_0x52f818['data2'],_0x5442c5[_0x3375('0x1f')],_0x5442c5['name'],_0x5442c5[_0x3375('0x20')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index e94f808..90a2dab 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 _0x83bd=['exports','jayson/promise','routing','request','then','error','rpc','message','result','catch'];(function(_0x5c41be,_0x18918a){var _0x3dabbe=function(_0x3a4985){while(--_0x3a4985){_0x5c41be['push'](_0x5c41be['shift']());}};_0x3dabbe(++_0x18918a);}(_0x83bd,0xd3));var _0xd83b=function(_0x2459fd,_0x575d9b){_0x2459fd=_0x2459fd-0x0;var _0x364cd2=_0x83bd[_0x2459fd];return _0x364cd2;};'use strict';var jayson=require(_0xd83b('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')(_0xd83b('0x1'));var client=jayson['client']['http']({'port':0x2329});client['Request']=function(_0x474eb6,_0x4d65a4){return new BPromise(function(_0x5a995a,_0x10fef1){return client[_0xd83b('0x2')](_0x474eb6,_0x4d65a4)[_0xd83b('0x3')](function(_0x19e18c){logger['debug']('rpc',_0xd83b('0x1'),_0x474eb6,_0x4d65a4,_0x19e18c);if(_0x19e18c[_0xd83b('0x4')]){logger['error'](_0xd83b('0x5'),_0xd83b('0x1'),_0x474eb6,_0x19e18c['error'][_0xd83b('0x6')],_0x4d65a4);return _0x10fef1(_0x19e18c['error'][_0xd83b('0x6')]);}else{return _0x5a995a(_0x19e18c[_0xd83b('0x7')]);}})[_0xd83b('0x8')](function(_0x1d19a6){logger[_0xd83b('0x4')](_0xd83b('0x5'),'routing',_0x474eb6,_0x1d19a6,_0x4d65a4);return _0x10fef1(_0x1d19a6);});});};module[_0xd83b('0x9')]=client; \ No newline at end of file +var _0x6f80=['exports','jayson/promise','bluebird','routing','client','http','Request','request','then','debug','error','rpc','message','result','catch'];(function(_0x32d456,_0x2a5201){var _0x557946=function(_0xf10bfb){while(--_0xf10bfb){_0x32d456['push'](_0x32d456['shift']());}};_0x557946(++_0x2a5201);}(_0x6f80,0x13c));var _0x06f8=function(_0x194bef,_0x1309bf){_0x194bef=_0x194bef-0x0;var _0x297f5b=_0x6f80[_0x194bef];return _0x297f5b;};'use strict';var jayson=require(_0x06f8('0x0'));var BPromise=require(_0x06f8('0x1'));var logger=require('../../config/logger')(_0x06f8('0x2'));var client=jayson[_0x06f8('0x3')][_0x06f8('0x4')]({'port':0x2329});client[_0x06f8('0x5')]=function(_0x33da6f,_0x239f77){return new BPromise(function(_0x39a670,_0x217776){return client[_0x06f8('0x6')](_0x33da6f,_0x239f77)[_0x06f8('0x7')](function(_0x2449ca){logger[_0x06f8('0x8')]('rpc',_0x06f8('0x2'),_0x33da6f,_0x239f77,_0x2449ca);if(_0x2449ca['error']){logger[_0x06f8('0x9')](_0x06f8('0xa'),_0x06f8('0x2'),_0x33da6f,_0x2449ca[_0x06f8('0x9')]['message'],_0x239f77);return _0x217776(_0x2449ca['error'][_0x06f8('0xb')]);}else{return _0x39a670(_0x2449ca[_0x06f8('0xc')]);}})[_0x06f8('0xd')](function(_0x35ea81){logger['error']('rpc',_0x06f8('0x2'),_0x33da6f,_0x35ea81,_0x239f77);return _0x217776(_0x35ea81);});});};module[_0x06f8('0xe')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 50f2038..582f738 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 _0x49fe=['./lib/email','./rpc/mailAccount','../../config/logger','email','resolve','then','getMailAccounts','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','error','Email\x20service\x20initialization','./server','./realtime'];(function(_0x2157aa,_0x2e5e04){var _0x690e60=function(_0x5142d8){while(--_0x5142d8){_0x2157aa['push'](_0x2157aa['shift']());}};_0x690e60(++_0x2e5e04);}(_0x49fe,0x19e));var _0xe49f=function(_0x35314a,_0x3cca7d){_0x35314a=_0x35314a-0x0;var _0x35ad31=_0x49fe[_0x35314a];return _0x35ad31;};'use strict';var server=require(_0xe49f('0x0'));var Realtime=require(_0xe49f('0x1'));var EmailChannel=require(_0xe49f('0x2'));var mailAccount=require(_0xe49f('0x3'));var setting=require('./rpc/setting');var logger=require(_0xe49f('0x4'))(_0xe49f('0x5'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xe49f('0x6')]()[_0xe49f('0x7')](mailAccount[_0xe49f('0x8')]())['then'](realtime[_0xe49f('0x9')]())['then'](function(){email['refresh'](realtime[_0xe49f('0xa')]);return realtime;});}function main(){return server[_0xe49f('0xb')](realtime,email)['then'](function(){return initRealtime();})[_0xe49f('0x7')](function(){return setting[_0xe49f('0xc')]();})[_0xe49f('0x7')](function(_0x45f8ec){return setInterval(initRealtime,_0x45f8ec[_0xe49f('0xd')]*0x3e8);})['catch'](function(_0xf90820){logger[_0xe49f('0xe')](_0xe49f('0xf'),_0xf90820);});}main(); \ No newline at end of file +var _0xec8c=['then','getMailAccounts','initMailAccounts','mailAccounts','listen','getSettings','loginMailFrequency','error','./server','./realtime','./lib/email','../../config/logger','email','resolve'];(function(_0x179b7b,_0x57b44d){var _0x5eea20=function(_0x5582aa){while(--_0x5582aa){_0x179b7b['push'](_0x179b7b['shift']());}};_0x5eea20(++_0x57b44d);}(_0xec8c,0x190));var _0xcec8=function(_0x2331f8,_0x446a3a){_0x2331f8=_0x2331f8-0x0;var _0x244773=_0xec8c[_0x2331f8];return _0x244773;};'use strict';var server=require(_0xcec8('0x0'));var Realtime=require(_0xcec8('0x1'));var EmailChannel=require(_0xcec8('0x2'));var mailAccount=require('./rpc/mailAccount');var setting=require('./rpc/setting');var logger=require(_0xcec8('0x3'))(_0xcec8('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0xcec8('0x5')]()[_0xcec8('0x6')](mailAccount[_0xcec8('0x7')]())['then'](realtime[_0xcec8('0x8')]())[_0xcec8('0x6')](function(){email['refresh'](realtime[_0xcec8('0x9')]);return realtime;});}function main(){return server[_0xcec8('0xa')](realtime,email)[_0xcec8('0x6')](function(){return initRealtime();})[_0xcec8('0x6')](function(){return setting[_0xcec8('0xb')]();})[_0xcec8('0x6')](function(_0x6de4ca){return setInterval(initRealtime,_0x6de4ca[_0xcec8('0xc')]*0x3e8);})['catch'](function(_0x538dc2){logger[_0xcec8('0xd')]('Email\x20service\x20initialization',_0x538dc2);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 06e2cfe..2b69282 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 _0x9d71=['start\x20email\x20channel','mailAccounts','smtp','prototype','emit','name','active','Imap','total','stringify','mailAccount:update','hasOwnProperty','service','provider','custom','imapAccounts','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','error','handleImapError','isNil','disabled','messageStatus','status','connected','messages','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','send','verifySmtp','Smtp','verify','verified','catch','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info'];(function(_0x1492bd,_0x1ad636){var _0x317259=function(_0x2b90cc){while(--_0x2b90cc){_0x1492bd['push'](_0x1492bd['shift']());}};_0x317259(++_0x1ad636);}(_0x9d71,0x188));var _0x19d7=function(_0x300d6,_0x5aea3f){_0x300d6=_0x300d6-0x0;var _0x33ab97=_0x9d71[_0x300d6];return _0x33ab97;};'use strict';var _=require('lodash');var moment=require(_0x19d7('0x0'));var BPromise=require(_0x19d7('0x1'));var md5=require(_0x19d7('0x2'));var Redis=require(_0x19d7('0x3'));var config=require(_0x19d7('0x4'));var logger=require(_0x19d7('0x5'))(_0x19d7('0x6'));config[_0x19d7('0x7')]=_[_0x19d7('0x8')](config[_0x19d7('0x7')],{'host':_0x19d7('0x9'),'port':0x18eb});var io=require(_0x19d7('0xa'))(new Redis(config['redis']));var EmailImap=require(_0x19d7('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x19d7('0xc'));var md5Accounts={};function EmailChannel(_0x448e15){logger[_0x19d7('0xd')](_0x19d7('0xe'));this[_0x19d7('0xf')]=_0x448e15['mailAccounts'];this['imapAccounts']={};this[_0x19d7('0x10')]=new EmailSmtp();}EmailChannel[_0x19d7('0x11')][_0x19d7('0x12')]=function(_0x19902f){var _0x3fe66b=this[_0x19d7('0xf')][_0x19902f];var _0xdd2e49={'id':_0x3fe66b['id'],'name':_0x3fe66b[_0x19d7('0x13')],'key':_0x3fe66b['key'],'active':_0x3fe66b[_0x19d7('0x14')],'Imap':{'status':_0x3fe66b['Imap']['status'],'messageStatus':_0x3fe66b[_0x19d7('0x15')]['messageStatus'],'total':_0x3fe66b[_0x19d7('0x15')][_0x19d7('0x16')]}};if(_['isNil'](md5Accounts[_0x19902f])){md5Accounts[_0x19902f]={};}var _0x467fe1=md5(JSON[_0x19d7('0x17')](_0xdd2e49));if(md5Accounts[_0x19902f][_0x19d7('0x2')]!==_0x467fe1){md5Accounts[_0x19902f][_0x19d7('0x2')]=_0x467fe1;io[_0x19d7('0x12')](_0x19d7('0x18'),_0xdd2e49);}};EmailChannel['prototype']['refresh']=function(_0x1d4e7c){for(var _0x11727d in _0x1d4e7c){if(_0x1d4e7c[_0x19d7('0x19')](_0x11727d)){if(_0x1d4e7c[_0x11727d][_0x19d7('0x15')]&&_0x1d4e7c[_0x11727d][_0x19d7('0x14')]){var _0x54af62=_0x1d4e7c[_0x11727d][_0x19d7('0x15')];if(!_0x54af62[_0x19d7('0x1a')]&&_0x1d4e7c[_0x11727d][_0x19d7('0x1b')]!==_0x19d7('0x1c'))_0x54af62['service']=_0x1d4e7c[_0x11727d][_0x19d7('0x1b')];if(!this[_0x19d7('0x1d')][_0x19d7('0x19')](_0x54af62['id'])){this[_0x19d7('0x1d')][_0x54af62['id']]=new EmailImap(_0x54af62,_0x1d4e7c[_0x11727d][_0x19d7('0x6')]);this['imapAccounts'][_0x54af62['id']]['on'](_0x19d7('0x1e'),this[_0x19d7('0x1f')][_0x19d7('0x20')](this,_0x11727d));this[_0x19d7('0x1d')][_0x54af62['id']]['on'](_0x19d7('0x6'),this[_0x19d7('0x21')][_0x19d7('0x20')](this,_0x11727d));this[_0x19d7('0x1d')][_0x54af62['id']]['on'](_0x19d7('0x22'),this[_0x19d7('0x23')]['bind'](this,_0x11727d));this['imapAccounts'][_0x54af62['id']]['on'](_0x19d7('0x24'),this[_0x19d7('0x25')][_0x19d7('0x20')](this,_0x11727d));}}else{if(_[_0x19d7('0x26')](this[_0x19d7('0xf')][_0x11727d][_0x19d7('0x15')])){this[_0x19d7('0xf')][_0x11727d][_0x19d7('0x15')]={};}this[_0x19d7('0xf')][_0x11727d]['Imap']['status']=_0x19d7('0x27');this[_0x19d7('0xf')][_0x11727d]['Imap'][_0x19d7('0x28')]='';this[_0x19d7('0x12')](_0x11727d);}}}};EmailChannel[_0x19d7('0x11')][_0x19d7('0x1f')]=function(_0x5786d6,_0x41fe9e){if(this[_0x19d7('0xf')][_0x5786d6]){this['mailAccounts'][_0x5786d6][_0x19d7('0x15')][_0x19d7('0x29')]=_0x19d7('0x2a');this[_0x19d7('0xf')][_0x5786d6][_0x19d7('0x15')][_0x19d7('0x28')]=_0x41fe9e['name'];if(_0x41fe9e[_0x19d7('0x2b')]){this[_0x19d7('0xf')][_0x5786d6][_0x19d7('0x15')][_0x19d7('0x16')]=_0x41fe9e[_0x19d7('0x2b')][_0x19d7('0x16')];}return this[_0x19d7('0x12')](_0x5786d6);}};EmailChannel[_0x19d7('0x11')][_0x19d7('0x21')]=function(_0xcfd040,_0x27ab46){logger[_0x19d7('0xd')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x27ab46['firstName'],_0x27ab46[_0x19d7('0x2c')],_0x27ab46[_0x19d7('0x2d')],_0xcfd040);if(this[_0x19d7('0xf')][_0xcfd040]){return mailAccount[_0x19d7('0x2e')](_0xcfd040,_0x27ab46)[_0x19d7('0x2f')](function(_0x30fc4e){if(_0x30fc4e){logger['info'](_0x19d7('0x30'));}})['catch'](function(_0x93e87a){logger[_0x19d7('0x24')](_0x19d7('0x31'),JSON[_0x19d7('0x17')](_0x93e87a));});}};EmailChannel['prototype']['handleImapEnd']=function(_0x206220){if(this[_0x19d7('0xf')][_0x206220]&&this[_0x19d7('0xf')][_0x206220][_0x19d7('0x15')]){if(this[_0x19d7('0x1d')][this['mailAccounts'][_0x206220][_0x19d7('0x15')]['id']]){delete this[_0x19d7('0x1d')][this[_0x19d7('0xf')][_0x206220]['Imap']['id']];}this[_0x19d7('0xf')][_0x206220][_0x19d7('0x15')][_0x19d7('0x32')]=moment();this[_0x19d7('0x12')](_0x206220);}};EmailChannel[_0x19d7('0x11')]['handleImapError']=function(_0x2ebb2d,_0x52741d){if(this[_0x19d7('0xf')][_0x2ebb2d]){this['mailAccounts'][_0x2ebb2d]['Imap']['status']=_0x19d7('0x24');this[_0x19d7('0xf')][_0x2ebb2d]['Imap']['messageStatus']=_0x52741d;return this[_0x19d7('0x12')](_0x2ebb2d);}};EmailChannel[_0x19d7('0x11')][_0x19d7('0x33')]=function(_0x1357cf,_0x303a5e){return this[_0x19d7('0x10')][_0x19d7('0x34')](_0x1357cf,_0x303a5e);};EmailChannel[_0x19d7('0x11')][_0x19d7('0x35')]=function(_0x5b60a2){var _0x26d712=this;if(this['mailAccounts'][_0x5b60a2['id']]){if(_[_0x19d7('0x26')](this[_0x19d7('0xf')][_0x5b60a2['id']][_0x19d7('0x36')])){this[_0x19d7('0xf')][_0x5b60a2['id']]['Smtp']={};}this[_0x19d7('0xf')][_0x5b60a2['id']][_0x19d7('0x36')]['lastSync']=moment();return new BPromise(function(_0x3f5956,_0x230c99){return _0x26d712[_0x19d7('0x10')][_0x19d7('0x37')](_0x5b60a2)[_0x19d7('0x2f')](function(_0x2faa84){_0x26d712[_0x19d7('0xf')][_0x5b60a2['id']][_0x19d7('0x36')][_0x19d7('0x29')]=_0x19d7('0x38');_0x26d712['mailAccounts'][_0x5b60a2['id']]['Smtp']['messageStatus']='';_0x26d712[_0x19d7('0x12')](_0x5b60a2['id']);_0x3f5956(_0x2faa84);})[_0x19d7('0x39')](function(_0x102f8a){_0x26d712[_0x19d7('0xf')][_0x5b60a2['id']]['Smtp'][_0x19d7('0x29')]=_0x19d7('0x24');_0x26d712['mailAccounts'][_0x5b60a2['id']][_0x19d7('0x36')][_0x19d7('0x28')]=_0x102f8a;_0x26d712['emit'](_0x5b60a2['id']);_0x230c99(_0x102f8a);});});}return this[_0x19d7('0x10')][_0x19d7('0x37')](_0x5b60a2);};module['exports']=EmailChannel; \ No newline at end of file +var _0x6b6d=['hasOwnProperty','active','service','custom','provider','imapAccounts','box','handleImapBox','bind','handleImapEmail','end','handleImapEnd','handleImapError','isNil','connected','name','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','info','Mail\x20accepted\x20from\x20routing','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','verifySmtp','Smtp','verify','catch','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','email','redis','defaults','localhost','socket.io-emitter','./imap','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','smtp','emit','key','status','messageStatus','Imap','total','stringify','mailAccount:update','prototype','refresh'];(function(_0x50da8d,_0x282e16){var _0x2f624b=function(_0x15fed1){while(--_0x15fed1){_0x50da8d['push'](_0x50da8d['shift']());}};_0x2f624b(++_0x282e16);}(_0x6b6d,0x97));var _0xd6b6=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0x6b6d[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0xd6b6('0x0'));var moment=require(_0xd6b6('0x1'));var BPromise=require(_0xd6b6('0x2'));var md5=require(_0xd6b6('0x3'));var Redis=require(_0xd6b6('0x4'));var config=require(_0xd6b6('0x5'));var logger=require('../../../config/logger')(_0xd6b6('0x6'));config[_0xd6b6('0x7')]=_[_0xd6b6('0x8')](config[_0xd6b6('0x7')],{'host':_0xd6b6('0x9'),'port':0x18eb});var io=require(_0xd6b6('0xa'))(new Redis(config['redis']));var EmailImap=require(_0xd6b6('0xb'));var EmailSmtp=require('./smtp');var mailAccount=require(_0xd6b6('0xc'));var md5Accounts={};function EmailChannel(_0xdabc42){logger['info'](_0xd6b6('0xd'));this[_0xd6b6('0xe')]=_0xdabc42[_0xd6b6('0xe')];this['imapAccounts']={};this[_0xd6b6('0xf')]=new EmailSmtp();}EmailChannel['prototype'][_0xd6b6('0x10')]=function(_0x3c3e32){var _0x3a999e=this[_0xd6b6('0xe')][_0x3c3e32];var _0x3f1cc8={'id':_0x3a999e['id'],'name':_0x3a999e['name'],'key':_0x3a999e[_0xd6b6('0x11')],'active':_0x3a999e['active'],'Imap':{'status':_0x3a999e['Imap'][_0xd6b6('0x12')],'messageStatus':_0x3a999e['Imap'][_0xd6b6('0x13')],'total':_0x3a999e[_0xd6b6('0x14')][_0xd6b6('0x15')]}};if(_['isNil'](md5Accounts[_0x3c3e32])){md5Accounts[_0x3c3e32]={};}var _0x23e047=md5(JSON[_0xd6b6('0x16')](_0x3f1cc8));if(md5Accounts[_0x3c3e32][_0xd6b6('0x3')]!==_0x23e047){md5Accounts[_0x3c3e32]['md5']=_0x23e047;io[_0xd6b6('0x10')](_0xd6b6('0x17'),_0x3f1cc8);}};EmailChannel[_0xd6b6('0x18')][_0xd6b6('0x19')]=function(_0x3601cc){for(var _0x3991a2 in _0x3601cc){if(_0x3601cc[_0xd6b6('0x1a')](_0x3991a2)){if(_0x3601cc[_0x3991a2][_0xd6b6('0x14')]&&_0x3601cc[_0x3991a2][_0xd6b6('0x1b')]){var _0x4d42ae=_0x3601cc[_0x3991a2][_0xd6b6('0x14')];if(!_0x4d42ae[_0xd6b6('0x1c')]&&_0x3601cc[_0x3991a2]['provider']!==_0xd6b6('0x1d'))_0x4d42ae['service']=_0x3601cc[_0x3991a2][_0xd6b6('0x1e')];if(!this[_0xd6b6('0x1f')]['hasOwnProperty'](_0x4d42ae['id'])){this[_0xd6b6('0x1f')][_0x4d42ae['id']]=new EmailImap(_0x4d42ae,_0x3601cc[_0x3991a2]['email']);this[_0xd6b6('0x1f')][_0x4d42ae['id']]['on'](_0xd6b6('0x20'),this[_0xd6b6('0x21')][_0xd6b6('0x22')](this,_0x3991a2));this['imapAccounts'][_0x4d42ae['id']]['on'](_0xd6b6('0x6'),this[_0xd6b6('0x23')][_0xd6b6('0x22')](this,_0x3991a2));this[_0xd6b6('0x1f')][_0x4d42ae['id']]['on'](_0xd6b6('0x24'),this[_0xd6b6('0x25')]['bind'](this,_0x3991a2));this[_0xd6b6('0x1f')][_0x4d42ae['id']]['on']('error',this[_0xd6b6('0x26')][_0xd6b6('0x22')](this,_0x3991a2));}}else{if(_[_0xd6b6('0x27')](this[_0xd6b6('0xe')][_0x3991a2]['Imap'])){this['mailAccounts'][_0x3991a2][_0xd6b6('0x14')]={};}this[_0xd6b6('0xe')][_0x3991a2][_0xd6b6('0x14')][_0xd6b6('0x12')]='disabled';this[_0xd6b6('0xe')][_0x3991a2]['Imap']['messageStatus']='';this[_0xd6b6('0x10')](_0x3991a2);}}}};EmailChannel[_0xd6b6('0x18')][_0xd6b6('0x21')]=function(_0x4d45b5,_0x363f58){if(this[_0xd6b6('0xe')][_0x4d45b5]){this['mailAccounts'][_0x4d45b5][_0xd6b6('0x14')][_0xd6b6('0x12')]=_0xd6b6('0x28');this[_0xd6b6('0xe')][_0x4d45b5][_0xd6b6('0x14')]['messageStatus']=_0x363f58[_0xd6b6('0x29')];if(_0x363f58['messages']){this['mailAccounts'][_0x4d45b5][_0xd6b6('0x14')][_0xd6b6('0x15')]=_0x363f58[_0xd6b6('0x2a')]['total'];}return this['emit'](_0x4d45b5);}};EmailChannel[_0xd6b6('0x18')][_0xd6b6('0x23')]=function(_0x458dbb,_0x1716cc){logger['info'](_0xd6b6('0x2b'),_0x1716cc[_0xd6b6('0x2c')],_0x1716cc[_0xd6b6('0x2d')],_0x1716cc[_0xd6b6('0x2e')],_0x458dbb);if(this[_0xd6b6('0xe')][_0x458dbb]){return mailAccount[_0xd6b6('0x2f')](_0x458dbb,_0x1716cc)[_0xd6b6('0x30')](function(_0x47be5f){if(_0x47be5f){logger[_0xd6b6('0x31')](_0xd6b6('0x32'));}})['catch'](function(_0x3270b3){logger[_0xd6b6('0x33')](_0xd6b6('0x34'),JSON[_0xd6b6('0x16')](_0x3270b3));});}};EmailChannel[_0xd6b6('0x18')]['handleImapEnd']=function(_0x1e5369){if(this[_0xd6b6('0xe')][_0x1e5369]&&this[_0xd6b6('0xe')][_0x1e5369][_0xd6b6('0x14')]){if(this[_0xd6b6('0x1f')][this[_0xd6b6('0xe')][_0x1e5369][_0xd6b6('0x14')]['id']]){delete this['imapAccounts'][this[_0xd6b6('0xe')][_0x1e5369][_0xd6b6('0x14')]['id']];}this[_0xd6b6('0xe')][_0x1e5369][_0xd6b6('0x14')]['lastSync']=moment();this[_0xd6b6('0x10')](_0x1e5369);}};EmailChannel[_0xd6b6('0x18')][_0xd6b6('0x26')]=function(_0x1692e4,_0x112344){if(this['mailAccounts'][_0x1692e4]){this[_0xd6b6('0xe')][_0x1692e4][_0xd6b6('0x14')][_0xd6b6('0x12')]=_0xd6b6('0x33');this[_0xd6b6('0xe')][_0x1692e4][_0xd6b6('0x14')]['messageStatus']=_0x112344;return this[_0xd6b6('0x10')](_0x1692e4);}};EmailChannel[_0xd6b6('0x18')][_0xd6b6('0x35')]=function(_0x8ab815,_0x3d218d){return this['smtp']['send'](_0x8ab815,_0x3d218d);};EmailChannel['prototype'][_0xd6b6('0x36')]=function(_0x2f144c){var _0x50c8f5=this;if(this['mailAccounts'][_0x2f144c['id']]){if(_['isNil'](this[_0xd6b6('0xe')][_0x2f144c['id']][_0xd6b6('0x37')])){this[_0xd6b6('0xe')][_0x2f144c['id']][_0xd6b6('0x37')]={};}this['mailAccounts'][_0x2f144c['id']][_0xd6b6('0x37')]['lastSync']=moment();return new BPromise(function(_0x4198bc,_0x263fbf){return _0x50c8f5['smtp'][_0xd6b6('0x38')](_0x2f144c)[_0xd6b6('0x30')](function(_0x3c39a4){_0x50c8f5[_0xd6b6('0xe')][_0x2f144c['id']][_0xd6b6('0x37')][_0xd6b6('0x12')]='verified';_0x50c8f5[_0xd6b6('0xe')][_0x2f144c['id']]['Smtp']['messageStatus']='';_0x50c8f5[_0xd6b6('0x10')](_0x2f144c['id']);_0x4198bc(_0x3c39a4);})[_0xd6b6('0x39')](function(_0x54e9b4){_0x50c8f5[_0xd6b6('0xe')][_0x2f144c['id']][_0xd6b6('0x37')][_0xd6b6('0x12')]='error';_0x50c8f5[_0xd6b6('0xe')][_0x2f144c['id']][_0xd6b6('0x37')][_0xd6b6('0x13')]=_0x54e9b4;_0x50c8f5[_0xd6b6('0x10')](_0x2f144c['id']);_0x263fbf(_0x54e9b4);});});}return this[_0xd6b6('0xf')][_0xd6b6('0x38')](_0x2f144c);};module[_0xd6b6('0x3a')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 18b6214..9e6d617 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 _0x5d51=['password','authentication','email','anonymous@xcally.com','host','port','tls','autotls','required','prototype','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','message','error','handleFetchError','end','handleFetchEnd','handleFetchMessage','body','attributes','handleMessageAttributes','handleSimpleParser','handleMessageEnd','parser','handleEnd','stringify','textCode','upperFirst','lodash','util','imap','iconv','Iconv','events','EventEmitter','mailbox','account','once','ready','handleReady','bind','handleError','connTimeout','authTimeout','service','user','modernAuthentication','xoauth2','generateXOAuth2Token','CloudProvider'];(function(_0x3f2397,_0x154b0b){var _0x3d4ed5=function(_0x5ef9db){while(--_0x5ef9db){_0x3f2397['push'](_0x3f2397['shift']());}};_0x3d4ed5(++_0x154b0b);}(_0x5d51,0x146));var _0x15d5=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x5d51[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x15d5('0x0'));var util=require(_0x15d5('0x1'));var Imap=require(_0x15d5('0x2'));var simpleParser=require('mailparser')['simpleParser'];var Iconv=require(_0x15d5('0x3'))[_0x15d5('0x4')];var EventEmitter=require(_0x15d5('0x5'))[_0x15d5('0x6')];var utils=require('./utils');var logger=require('../../../config/logger')('email');function EmailImap(_0x23ca41,_0x4e13d7){this[_0x15d5('0x7')]=_0x23ca41['mailbox'];this[_0x15d5('0x8')]=this['getAccount'](_0x23ca41,_0x4e13d7);this[_0x15d5('0x2')]=new Imap(this[_0x15d5('0x8')]);this[_0x15d5('0x2')][_0x15d5('0x9')](_0x15d5('0xa'),this[_0x15d5('0xb')][_0x15d5('0xc')](this));this['imap'][_0x15d5('0x9')]('end',this['handleEnd'][_0x15d5('0xc')](this));this[_0x15d5('0x2')]['on']('error',this[_0x15d5('0xd')][_0x15d5('0xc')](this));this[_0x15d5('0x2')]['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap['prototype']['getAccount']=function(_0x3f5caa,_0x42dcff){var _0x11c8c2={'connTimeout':_0x3f5caa['connTimeout']?_0x3f5caa[_0x15d5('0xe')]*0x3e8:0x2710,'authTimeout':_0x3f5caa[_0x15d5('0xf')]?_0x3f5caa[_0x15d5('0xf')]*0x3e8:0x1388};if(_0x3f5caa[_0x15d5('0x10')]){_0x11c8c2[_0x15d5('0x11')]=_0x3f5caa['user'];if(_0x3f5caa[_0x15d5('0x12')]){_0x11c8c2[_0x15d5('0x13')]=utils[_0x15d5('0x14')](_0x3f5caa[_0x15d5('0x15')]['data5'],_0x3f5caa[_0x15d5('0x11')]);}else{_0x11c8c2[_0x15d5('0x16')]=_0x3f5caa[_0x15d5('0x16')];}}else{if(_0x3f5caa[_0x15d5('0x17')]){_0x11c8c2['user']=_0x3f5caa[_0x15d5('0x11')];_0x11c8c2[_0x15d5('0x16')]=_0x3f5caa[_0x15d5('0x16')];}}_0x11c8c2[_0x15d5('0x18')]=_0x42dcff||_0x3f5caa['user']||_0x15d5('0x19');_0x11c8c2[_0x15d5('0x1a')]=_0x3f5caa[_0x15d5('0x1a')];_0x11c8c2[_0x15d5('0x1b')]=_0x3f5caa[_0x15d5('0x1b')]||0x3e1;if(_0x3f5caa[_0x15d5('0x1c')]){_0x11c8c2[_0x15d5('0x1c')]=!![];}else{_0x11c8c2[_0x15d5('0x1c')]=![];_0x11c8c2[_0x15d5('0x1d')]=_0x15d5('0x1e');}return _0x11c8c2;};EmailImap[_0x15d5('0x1f')][_0x15d5('0xb')]=function(){this[_0x15d5('0x2')][_0x15d5('0x20')](this[_0x15d5('0x7')],![],this[_0x15d5('0x21')][_0x15d5('0xc')](this));};EmailImap[_0x15d5('0x1f')]['handleOpenBox']=function(_0x4eef0a,_0x27999b){if(_0x4eef0a){this[_0x15d5('0xd')](_0x4eef0a,!![]);}else{this[_0x15d5('0x22')](_0x15d5('0x23'),_0x27999b);this[_0x15d5('0x24')]();}};EmailImap[_0x15d5('0x1f')][_0x15d5('0x25')]=function(_0x3eb256){if(_0x3eb256){this['handleError'](_0x3eb256,!![]);}else{this[_0x15d5('0x2')]['end']();}};EmailImap[_0x15d5('0x1f')][_0x15d5('0x24')]=function(){this[_0x15d5('0x2')][_0x15d5('0x26')]([_0x15d5('0x27')],this[_0x15d5('0x28')][_0x15d5('0xc')](this));};EmailImap[_0x15d5('0x1f')][_0x15d5('0x28')]=function(_0x5ce2e6,_0x2b7325){if(_0x5ce2e6){this[_0x15d5('0xd')](_0x5ce2e6,!![]);}else{if(_0x2b7325['length']){try{var _0x1aa23d=this[_0x15d5('0x2')][_0x15d5('0x29')](_0x2b7325,{'bodies':'','markSeen':!![]});_0x1aa23d['on'](_0x15d5('0x2a'),this['handleFetchMessage'][_0x15d5('0xc')](this));_0x1aa23d[_0x15d5('0x9')](_0x15d5('0x2b'),this[_0x15d5('0x2c')]['bind'](this));_0x1aa23d['once'](_0x15d5('0x2d'),this[_0x15d5('0x2e')][_0x15d5('0xc')](this));}catch(_0x160286){logger[_0x15d5('0x2b')](_0x160286);}}else{this[_0x15d5('0x2')]['closeBox'](!![],this[_0x15d5('0x25')][_0x15d5('0xc')](this));}}};EmailImap['prototype'][_0x15d5('0x2f')]=function(_0x4dc279){_0x4dc279['on'](_0x15d5('0x30'),this['handleMessageBody'][_0x15d5('0xc')](this));_0x4dc279[_0x15d5('0x9')](_0x15d5('0x31'),this[_0x15d5('0x32')]['bind'](this));_0x4dc279['once']('end',this['handleMessageEnd'][_0x15d5('0xc')](this));};EmailImap[_0x15d5('0x1f')]['handleMessageBody']=function(_0xc0bb6){simpleParser(_0xc0bb6,{'Iconv':Iconv},this[_0x15d5('0x33')][_0x15d5('0xc')](this));};EmailImap[_0x15d5('0x1f')]['handleMessageAttributes']=function(){};EmailImap[_0x15d5('0x1f')][_0x15d5('0x34')]=function(){};EmailImap[_0x15d5('0x1f')][_0x15d5('0x33')]=function(_0x13c40d,_0x34f7e6){if(_0x13c40d){logger[_0x15d5('0x2b')](_0x13c40d);}else{var _0x43f0b4=this;utils[_0x15d5('0x35')](this[_0x15d5('0x8')],_0x34f7e6,function(_0x3e8113){_0x43f0b4[_0x15d5('0x22')](_0x15d5('0x18'),_0x3e8113);});}};EmailImap['prototype'][_0x15d5('0x2e')]=function(){this[_0x15d5('0x2')]['closeBox'](!![],this[_0x15d5('0x25')]['bind'](this));};EmailImap['prototype'][_0x15d5('0x2c')]=function(_0x590c0b){this['handleError'](_0x590c0b);this['imap']['closeBox'](!![],this['handleCloseBox'][_0x15d5('0xc')](this));};EmailImap[_0x15d5('0x1f')][_0x15d5('0x36')]=function(){this[_0x15d5('0x22')](_0x15d5('0x2d'));};EmailImap[_0x15d5('0x1f')]['handleError']=function(_0x5a44b9,_0x3f2234){logger[_0x15d5('0x2b')]('handleError',this[_0x15d5('0x8')][_0x15d5('0x18')],JSON[_0x15d5('0x37')](_0x5a44b9));var _0x2e5a8b='';if(_0x5a44b9){if(_0x5a44b9[_0x15d5('0x38')]){_0x2e5a8b=_0x5a44b9['textCode'];}else{for(var _0x5b8796 in _0x5a44b9){if(_0x5a44b9['hasOwnProperty'](_0x5b8796)){_0x2e5a8b+=_[_0x15d5('0x39')](_0x5b8796)+':\x20'+_0x5a44b9[_0x5b8796]+'\x0a';}}}}if(_0x3f2234){this[_0x15d5('0x2')][_0x15d5('0x2d')]();}else{this[_0x15d5('0x22')]('error',_0x2e5a8b);this['emit'](_0x15d5('0x2d'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x8d78=['getAccount','handleReady','bind','error','handleError','connect','prototype','connTimeout','authTimeout','user','modernAuthentication','generateXOAuth2Token','CloudProvider','password','anonymous@xcally.com','host','port','tls','autotls','required','openBox','handleOpenBox','emit','box','handleCloseBox','readUnseen','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','once','handleFetchError','closeBox','attributes','handleMessageAttributes','end','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','handleFetchEnd','stringify','textCode','hasOwnProperty','upperFirst','exports','lodash','util','imap','simpleParser','iconv','./utils','../../../config/logger','email','mailbox','account'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0x8d78,0x1ce));var _0x88d7=function(_0x4d20eb,_0x37377b){_0x4d20eb=_0x4d20eb-0x0;var _0x75d65d=_0x8d78[_0x4d20eb];return _0x75d65d;};'use strict';var _=require(_0x88d7('0x0'));var util=require(_0x88d7('0x1'));var Imap=require(_0x88d7('0x2'));var simpleParser=require('mailparser')[_0x88d7('0x3')];var Iconv=require(_0x88d7('0x4'))['Iconv'];var EventEmitter=require('events')['EventEmitter'];var utils=require(_0x88d7('0x5'));var logger=require(_0x88d7('0x6'))(_0x88d7('0x7'));function EmailImap(_0x211c1f,_0x96b60f){this[_0x88d7('0x8')]=_0x211c1f[_0x88d7('0x8')];this[_0x88d7('0x9')]=this[_0x88d7('0xa')](_0x211c1f,_0x96b60f);this[_0x88d7('0x2')]=new Imap(this[_0x88d7('0x9')]);this[_0x88d7('0x2')]['once']('ready',this[_0x88d7('0xb')][_0x88d7('0xc')](this));this[_0x88d7('0x2')]['once']('end',this['handleEnd'][_0x88d7('0xc')](this));this[_0x88d7('0x2')]['on'](_0x88d7('0xd'),this[_0x88d7('0xe')][_0x88d7('0xc')](this));this[_0x88d7('0x2')][_0x88d7('0xf')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x88d7('0x10')][_0x88d7('0xa')]=function(_0x21a62c,_0x38ec07){var _0x16dcdf={'connTimeout':_0x21a62c[_0x88d7('0x11')]?_0x21a62c['connTimeout']*0x3e8:0x2710,'authTimeout':_0x21a62c[_0x88d7('0x12')]?_0x21a62c[_0x88d7('0x12')]*0x3e8:0x1388};if(_0x21a62c['service']){_0x16dcdf['user']=_0x21a62c[_0x88d7('0x13')];if(_0x21a62c[_0x88d7('0x14')]){_0x16dcdf['xoauth2']=utils[_0x88d7('0x15')](_0x21a62c[_0x88d7('0x16')]['data5'],_0x21a62c[_0x88d7('0x13')]);}else{_0x16dcdf[_0x88d7('0x17')]=_0x21a62c[_0x88d7('0x17')];}}else{if(_0x21a62c['authentication']){_0x16dcdf[_0x88d7('0x13')]=_0x21a62c[_0x88d7('0x13')];_0x16dcdf[_0x88d7('0x17')]=_0x21a62c[_0x88d7('0x17')];}}_0x16dcdf[_0x88d7('0x7')]=_0x38ec07||_0x21a62c[_0x88d7('0x13')]||_0x88d7('0x18');_0x16dcdf[_0x88d7('0x19')]=_0x21a62c['host'];_0x16dcdf[_0x88d7('0x1a')]=_0x21a62c[_0x88d7('0x1a')]||0x3e1;if(_0x21a62c['tls']){_0x16dcdf[_0x88d7('0x1b')]=!![];}else{_0x16dcdf[_0x88d7('0x1b')]=![];_0x16dcdf[_0x88d7('0x1c')]=_0x88d7('0x1d');}return _0x16dcdf;};EmailImap[_0x88d7('0x10')][_0x88d7('0xb')]=function(){this[_0x88d7('0x2')][_0x88d7('0x1e')](this[_0x88d7('0x8')],![],this[_0x88d7('0x1f')][_0x88d7('0xc')](this));};EmailImap[_0x88d7('0x10')]['handleOpenBox']=function(_0x594051,_0x10697f){if(_0x594051){this['handleError'](_0x594051,!![]);}else{this[_0x88d7('0x20')](_0x88d7('0x21'),_0x10697f);this['readUnseen']();}};EmailImap['prototype'][_0x88d7('0x22')]=function(_0x152768){if(_0x152768){this['handleError'](_0x152768,!![]);}else{this[_0x88d7('0x2')]['end']();}};EmailImap[_0x88d7('0x10')][_0x88d7('0x23')]=function(){this[_0x88d7('0x2')][_0x88d7('0x24')]([_0x88d7('0x25')],this[_0x88d7('0x26')][_0x88d7('0xc')](this));};EmailImap[_0x88d7('0x10')]['handleReadUnseen']=function(_0x209172,_0x23d5b2){if(_0x209172){this['handleError'](_0x209172,!![]);}else{if(_0x23d5b2[_0x88d7('0x27')]){try{var _0x1b0090=this['imap'][_0x88d7('0x28')](_0x23d5b2,{'bodies':'','markSeen':!![]});_0x1b0090['on'](_0x88d7('0x29'),this[_0x88d7('0x2a')][_0x88d7('0xc')](this));_0x1b0090[_0x88d7('0x2b')]('error',this[_0x88d7('0x2c')][_0x88d7('0xc')](this));_0x1b0090[_0x88d7('0x2b')]('end',this['handleFetchEnd'][_0x88d7('0xc')](this));}catch(_0x221101){logger[_0x88d7('0xd')](_0x221101);}}else{this[_0x88d7('0x2')][_0x88d7('0x2d')](!![],this['handleCloseBox'][_0x88d7('0xc')](this));}}};EmailImap[_0x88d7('0x10')][_0x88d7('0x2a')]=function(_0x45fc81){_0x45fc81['on']('body',this['handleMessageBody'][_0x88d7('0xc')](this));_0x45fc81[_0x88d7('0x2b')](_0x88d7('0x2e'),this[_0x88d7('0x2f')]['bind'](this));_0x45fc81[_0x88d7('0x2b')](_0x88d7('0x30'),this[_0x88d7('0x31')][_0x88d7('0xc')](this));};EmailImap[_0x88d7('0x10')][_0x88d7('0x32')]=function(_0x37eb60){simpleParser(_0x37eb60,{'Iconv':Iconv},this[_0x88d7('0x33')]['bind'](this));};EmailImap['prototype']['handleMessageAttributes']=function(){};EmailImap[_0x88d7('0x10')][_0x88d7('0x31')]=function(){};EmailImap[_0x88d7('0x10')]['handleSimpleParser']=function(_0x448469,_0x279fe2){if(_0x448469){logger['error'](_0x448469);}else{var _0x2f79cf=this;utils[_0x88d7('0x34')](this[_0x88d7('0x9')],_0x279fe2,function(_0x35825c){_0x2f79cf['emit'](_0x88d7('0x7'),_0x35825c);});}};EmailImap[_0x88d7('0x10')][_0x88d7('0x35')]=function(){this[_0x88d7('0x2')][_0x88d7('0x2d')](!![],this[_0x88d7('0x22')]['bind'](this));};EmailImap[_0x88d7('0x10')][_0x88d7('0x2c')]=function(_0x453b95){this[_0x88d7('0xe')](_0x453b95);this[_0x88d7('0x2')][_0x88d7('0x2d')](!![],this[_0x88d7('0x22')][_0x88d7('0xc')](this));};EmailImap[_0x88d7('0x10')]['handleEnd']=function(){this[_0x88d7('0x20')](_0x88d7('0x30'));};EmailImap[_0x88d7('0x10')][_0x88d7('0xe')]=function(_0x46632f,_0x182385){logger['error'](_0x88d7('0xe'),this[_0x88d7('0x9')][_0x88d7('0x7')],JSON[_0x88d7('0x36')](_0x46632f));var _0x1605ec='';if(_0x46632f){if(_0x46632f['textCode']){_0x1605ec=_0x46632f[_0x88d7('0x37')];}else{for(var _0x9fb30 in _0x46632f){if(_0x46632f[_0x88d7('0x38')](_0x9fb30)){_0x1605ec+=_[_0x88d7('0x39')](_0x9fb30)+':\x20'+_0x46632f[_0x9fb30]+'\x0a';}}}}if(_0x182385){this['imap']['end']();}else{this['emit'](_0x88d7('0xd'),_0x1605ec);this[_0x88d7('0x20')](_0x88d7('0x30'));}};module[_0x88d7('0x3a')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index a019a98..0b980c6 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 _0x0eaa=['verify','Not\x20verifired','exports','nodemailer-plugin-inline-base64','prototype','send','createTransport','sendMail','toString'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0eaa,0x1a1));var _0xa0ea=function(_0x2a3922,_0x225dd2){_0x2a3922=_0x2a3922-0x0;var _0x3ccc8c=_0x0eaa[_0x2a3922];return _0x3ccc8c;};'use strict';var nodemailer=require('nodemailer');var inlineBase64=require(_0xa0ea('0x0'));function EmailSmtp(){}EmailSmtp[_0xa0ea('0x1')][_0xa0ea('0x2')]=function(_0x407aa2,_0x4ebb0b){return new Promise(function(_0x399aec,_0x4968b1){var _0x5da29e=nodemailer[_0xa0ea('0x3')](_0x407aa2);_0x5da29e['use']('compile',inlineBase64());_0x5da29e[_0xa0ea('0x4')](_0x4ebb0b,function(_0x571be7,_0x15f1d3){if(_0x571be7){_0x4968b1(_0x571be7[_0xa0ea('0x5')]());}else{_0x399aec(_0x15f1d3);}});});};EmailSmtp[_0xa0ea('0x1')][_0xa0ea('0x6')]=function(_0x3ca47a){return new Promise(function(_0x5f0783,_0x547e93){var _0x1f52b5=nodemailer[_0xa0ea('0x3')](_0x3ca47a);_0x1f52b5[_0xa0ea('0x6')](function(_0xcc02d9,_0x5493e8){if(_0xcc02d9){_0x547e93(_0xcc02d9[_0xa0ea('0x5')]());}else{if(_0x5493e8){_0x5f0783(_0x5493e8);}else{_0x547e93(_0xa0ea('0x7'));}}});});};module[_0xa0ea('0x8')]=EmailSmtp; \ No newline at end of file +var _0x3cf7=['exports','nodemailer','nodemailer-plugin-inline-base64','prototype','createTransport','use','compile','sendMail','toString','verify','Not\x20verifired'];(function(_0x51d092,_0x400f47){var _0x12a2c6=function(_0x63489f){while(--_0x63489f){_0x51d092['push'](_0x51d092['shift']());}};_0x12a2c6(++_0x400f47);}(_0x3cf7,0x1e5));var _0x73cf=function(_0x2af160,_0x765b1){_0x2af160=_0x2af160-0x0;var _0x439d67=_0x3cf7[_0x2af160];return _0x439d67;};'use strict';var nodemailer=require(_0x73cf('0x0'));var inlineBase64=require(_0x73cf('0x1'));function EmailSmtp(){}EmailSmtp[_0x73cf('0x2')]['send']=function(_0x3461f4,_0x5b0cc1){return new Promise(function(_0x303461,_0x599d7b){var _0x44548f=nodemailer[_0x73cf('0x3')](_0x3461f4);_0x44548f[_0x73cf('0x4')](_0x73cf('0x5'),inlineBase64());_0x44548f[_0x73cf('0x6')](_0x5b0cc1,function(_0x10386b,_0x586ffd){if(_0x10386b){_0x599d7b(_0x10386b[_0x73cf('0x7')]());}else{_0x303461(_0x586ffd);}});});};EmailSmtp[_0x73cf('0x2')][_0x73cf('0x8')]=function(_0x303be2){return new Promise(function(_0x1dfe5d,_0x2509e8){var _0x4f1ab4=nodemailer['createTransport'](_0x303be2);_0x4f1ab4[_0x73cf('0x8')](function(_0x8dec16,_0x546817){if(_0x8dec16){_0x2509e8(_0x8dec16[_0x73cf('0x7')]());}else{if(_0x546817){_0x1dfe5d(_0x546817);}else{_0x2509e8(_0x73cf('0x9'));}}});});};module[_0x73cf('0xa')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index c11480c..9d720dc 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 _0x9834=['push','filename','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','Empty\x20message

','Attachments','Title','Data','generateXOAuth2Token','auth=Bearer\x20','toString','base64','lodash','moment','randomstring','path','util','node-tnef','email','head','value','address','anonymous','generate','name','substring','indexOf','length','Anonymous','split','pop','isEmpty','@xcally.com','html','test','replace','includes','0x1?_0x4dc239['slice'](0x0,-0x1)['join']('\x20'):_0x46dc61[_0x4983('0xc')];}return _0x4983('0x10');}function getLastName(_0x3b0808){var _0x5dbaa8=_[_0x4983('0x7')](_0x3b0808['value']);if(_0x5dbaa8&&_0x5dbaa8[_0x4983('0xc')]){var _0x31b538=_0x5dbaa8[_0x4983('0xc')][_0x4983('0x11')](/\s+/);return _0x31b538[_0x4983('0xf')]>0x1?_0x31b538[_0x4983('0x12')]():'';}return'';}function getMails(_0xceb729,_0x3c7ff3){var _0xea94fd='';for(var _0x413769=0x0;_0x413769<_0x3c7ff3[_0x4983('0x8')][_0x4983('0xf')];_0x413769+=0x1){if(_0x3c7ff3['value'][_0x413769][_0x4983('0x9')]!==_0xceb729){if(!_[_0x4983('0x13')](_0xea94fd)){_0xea94fd+=',';}_0xea94fd+=_0x3c7ff3[_0x4983('0x8')][_0x413769][_0x4983('0xc')]||_0x3c7ff3['value'][_0x413769]['address']||'';_0xea94fd+='\x20<';_0xea94fd+=_0x3c7ff3[_0x4983('0x8')][_0x413769][_0x4983('0x9')]?_0x3c7ff3[_0x4983('0x8')][_0x413769][_0x4983('0x9')]:_0x4983('0xa')+random[_0x4983('0xb')](0x6)+_0x4983('0x14');_0xea94fd+='>';}}return _0xea94fd;}function parseEmail(_0x176db8,_0x3f39d5,_0x68448b){if(_0x3f39d5[_0x4983('0x15')]){var _0x50b4ee=/)<[^<]*)*<\/script>/gi;while(_0x50b4ee[_0x4983('0x16')](_0x3f39d5[_0x4983('0x15')])){_0x3f39d5[_0x4983('0x15')]=_0x3f39d5[_0x4983('0x15')][_0x4983('0x17')](_0x50b4ee,'');}if(_0x3f39d5[_0x4983('0x15')][_0x4983('0x18')](_0x4983('0x19'))){var _0x1d21a4=[];_0x3f39d5[_0x4983('0x1a')][_0x4983('0x1b')](_0x356d9b=>{_0x1d21a4[_0x4983('0x1c')](_0x356d9b[_0x4983('0x1d')]);});var _0x4e1b85=/]+>/g;var _0x22ac15=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x44871=_0x3f39d5[_0x4983('0x15')][_0x4983('0x17')](_0x22ac15,_0x4983('0x1e'));var _0xb5fa6b=_0x44871[_0x4983('0x17')](_0x4e1b85,_0x4983('0x1f'));for(let _0x31337d=0x0;_0x31337d<_0x1d21a4[_0x4983('0xf')];_0x31337d++){var _0x4dd94c=_0xb5fa6b[_0x4983('0x17')](_0x4983('0x1f'),_0x4983('0x20')+_0x1d21a4[_0x31337d]+_0x4983('0x21'));_0xb5fa6b=_0x4dd94c;}_0x3f39d5[_0x4983('0x15')]=_0xb5fa6b;}_0x68448b[_0x4983('0x22')]=_0x3f39d5[_0x4983('0x15')];}else{_0x68448b[_0x4983('0x22')]=_0x3f39d5['textAsHtml'];}if(_0x68448b[_0x4983('0x22')]){_0x68448b['body']=_0x68448b['body'][_0x4983('0x17')](/0x0){var _0x268ade=[_0x4983('0x33'),_0x4983('0x34'),_0x4983('0x35')];for(var _0x55efbb=0x0;_0x55efbb<_0x3f39d5[_0x4983('0x32')][_0x4983('0xf')];_0x55efbb++){var _0x25e185=_[_0x4983('0xe')](_0x268ade,_0x3f39d5['headerLines'][_0x55efbb][_0x4983('0x36')]);if(_0x25e185>=0x0){_0x68448b['isAutoreply']=!![];}}}return _0x68448b;}exports['parser']=function(_0x5c5435,_0x43c53c,_0x38dd0e){var _0x121409={'from':getAddress(_0x43c53c[_0x4983('0x37')]),'firstName':getFirstName(_0x43c53c[_0x4983('0x37')]),'lastName':getLastName(_0x43c53c[_0x4983('0x37')]),'mapKey':_0x4983('0x6'),'message':{'from':getMails(_0x5c5435[_0x4983('0x6')],_0x43c53c[_0x4983('0x37')]),'to':_0x5c5435['email'],'cc':'','subject':_0x43c53c[_0x4983('0x38')]||'','messageId':_0x43c53c[_0x4983('0x39')],'inReplyTo':_0x43c53c[_0x4983('0x3a')],'sentAt':moment(_0x43c53c[_0x4983('0x3b')])['format'](_0x4983('0x3c')),'attach':![],'attachments':[]}};if(!_0x43c53c[_0x4983('0x15')]&&!_0x43c53c[_0x4983('0x3d')]){var _0x4797ef=_[_0x4983('0x3e')](_0x43c53c['attachments'],{'contentType':_0x4983('0x3f')});if(_0x4797ef['length']){logger[_0x4983('0x40')](util[_0x4983('0x2c')](_0x4983('0x41'),_0x43c53c[_0x4983('0x39')]));tnef[_0x4983('0x42')](_[_0x4983('0x43')](_0x4797ef)[_0x4983('0x44')],function(_0x2661e8,_0x3f23ff){if(_0x3f23ff){_0x43c53c[_0x4983('0x15')]=_0x3f23ff[_0x4983('0x45')]||_0x4983('0x46');if(_0x3f23ff[_0x4983('0x47')]){for(var _0x14dc01=0x0;_0x14dc01<_0x3f23ff[_0x4983('0x47')][_0x4983('0xf')];_0x14dc01++){var _0x2432e0=_0x3f23ff['Attachments'][_0x14dc01];_0x121409[_0x4983('0x24')]['attachments']['push']({'filename':_0x2432e0[_0x4983('0x48')],'content':Buffer['from'](_0x2432e0[_0x4983('0x49')])});}}}_0x38dd0e(parseEmail(_0x5c5435,_0x43c53c,_0x121409));});}else{_0x43c53c[_0x4983('0x15')]=_0x4983('0x46');_0x38dd0e(parseEmail(_0x5c5435,_0x43c53c,_0x121409));}}else{_0x38dd0e(parseEmail(_0x5c5435,_0x43c53c,_0x121409));}};exports[_0x4983('0x4a')]=function(_0x4ad82c,_0x1f5e96){var _0x34e8ee=['user='+(_0x1f5e96||''),_0x4983('0x4b')+_0x4ad82c,'',''];return Buffer[_0x4983('0x37')](_0x34e8ee[_0x4983('0x2e')](''),'utf-8')[_0x4983('0x4c')](_0x4983('0x4d'));}; \ No newline at end of file +var _0xfa01=['YYYY-MM-DD\x20HH:mm:ss','textAsHtml','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','BodyHTML','Attachments','Title','Data','

Empty\x20message

','generateXOAuth2Token','user=','utf-8','toString','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','@xcally.com','name','substring','length','Anonymous','split','pop','address','isEmpty','anonymous','generate','html','test','replace','includes','\x20[Attachment:\x20','\x20]','body','0x1?_0xee8f['slice'](0x0,-0x1)['join']('\x20'):_0x13b240['name'];}return _0x1fa0('0xf');}function getLastName(_0x9f861){var _0x308530=_['head'](_0x9f861[_0x1fa0('0xa')]);if(_0x308530&&_0x308530[_0x1fa0('0xc')]){var _0x4d305a=_0x308530['name'][_0x1fa0('0x10')](/\s+/);return _0x4d305a[_0x1fa0('0xe')]>0x1?_0x4d305a[_0x1fa0('0x11')]():'';}return'';}function getMails(_0x2703e2,_0xd4611d){var _0x52b417='';for(var _0x2ef30d=0x0;_0x2ef30d<_0xd4611d[_0x1fa0('0xa')][_0x1fa0('0xe')];_0x2ef30d+=0x1){if(_0xd4611d[_0x1fa0('0xa')][_0x2ef30d][_0x1fa0('0x12')]!==_0x2703e2){if(!_[_0x1fa0('0x13')](_0x52b417)){_0x52b417+=',';}_0x52b417+=_0xd4611d[_0x1fa0('0xa')][_0x2ef30d]['name']||_0xd4611d['value'][_0x2ef30d][_0x1fa0('0x12')]||'';_0x52b417+='\x20<';_0x52b417+=_0xd4611d['value'][_0x2ef30d][_0x1fa0('0x12')]?_0xd4611d['value'][_0x2ef30d][_0x1fa0('0x12')]:_0x1fa0('0x14')+random[_0x1fa0('0x15')](0x6)+_0x1fa0('0xb');_0x52b417+='>';}}return _0x52b417;}function parseEmail(_0x273a8d,_0x20340d,_0x43015b){if(_0x20340d[_0x1fa0('0x16')]){var _0x19b15d=/)<[^<]*)*<\/script>/gi;while(_0x19b15d[_0x1fa0('0x17')](_0x20340d['html'])){_0x20340d['html']=_0x20340d[_0x1fa0('0x16')][_0x1fa0('0x18')](_0x19b15d,'');}if(_0x20340d[_0x1fa0('0x16')][_0x1fa0('0x19')](_0x1fa0('0x1a'))){var _0x1dd727=[];_0x20340d[_0x1fa0('0x1b')]['forEach'](_0xedfd90=>{_0x1dd727[_0x1fa0('0x1c')](_0xedfd90[_0x1fa0('0x1d')]);});var _0x30f2a4=/]+>/g;var _0x17eb21=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x37ca18=_0x20340d[_0x1fa0('0x16')][_0x1fa0('0x18')](_0x17eb21,'_SRC');var _0x594031=_0x37ca18['replace'](_0x30f2a4,_0x1fa0('0x1e'));for(let _0x49cb0a=0x0;_0x49cb0a<_0x1dd727[_0x1fa0('0xe')];_0x49cb0a++){var _0x3f1c8a=_0x594031['replace'](_0x1fa0('0x1e'),_0x1fa0('0x1f')+_0x1dd727[_0x49cb0a]+_0x1fa0('0x20'));_0x594031=_0x3f1c8a;}_0x20340d[_0x1fa0('0x16')]=_0x594031;}_0x43015b[_0x1fa0('0x21')]=_0x20340d[_0x1fa0('0x16')];}else{_0x43015b[_0x1fa0('0x21')]=_0x20340d['textAsHtml'];}if(_0x43015b[_0x1fa0('0x21')]){_0x43015b[_0x1fa0('0x21')]=_0x43015b['body']['replace'](/0x0){var _0x18719d=[_0x1fa0('0x32'),_0x1fa0('0x33'),_0x1fa0('0x34')];for(var _0x822575=0x0;_0x822575<_0x20340d[_0x1fa0('0x31')]['length'];_0x822575++){var _0x1d4049=_['indexOf'](_0x18719d,_0x20340d['headerLines'][_0x822575]['line']);if(_0x1d4049>=0x0){_0x43015b[_0x1fa0('0x35')]=!![];}}}return _0x43015b;}exports[_0x1fa0('0x36')]=function(_0x164ae9,_0x4b236c,_0x96d5b0){var _0x314be6={'from':getAddress(_0x4b236c[_0x1fa0('0x37')]),'firstName':getFirstName(_0x4b236c['from']),'lastName':getLastName(_0x4b236c[_0x1fa0('0x37')]),'mapKey':_0x1fa0('0x7'),'message':{'from':getMails(_0x164ae9['email'],_0x4b236c['from']),'to':_0x164ae9[_0x1fa0('0x7')],'cc':'','subject':_0x4b236c[_0x1fa0('0x38')]||'','messageId':_0x4b236c[_0x1fa0('0x39')],'inReplyTo':_0x4b236c[_0x1fa0('0x3a')],'sentAt':moment(_0x4b236c[_0x1fa0('0x3b')])['format'](_0x1fa0('0x3c')),'attach':![],'attachments':[]}};if(!_0x4b236c[_0x1fa0('0x16')]&&!_0x4b236c[_0x1fa0('0x3d')]){var _0x219ec0=_[_0x1fa0('0x3e')](_0x4b236c[_0x1fa0('0x1b')],{'contentType':_0x1fa0('0x3f')});if(_0x219ec0[_0x1fa0('0xe')]){logger[_0x1fa0('0x40')](util[_0x1fa0('0x29')](_0x1fa0('0x41'),_0x4b236c[_0x1fa0('0x39')]));tnef[_0x1fa0('0x42')](_[_0x1fa0('0x43')](_0x219ec0)['content'],function(_0x508883,_0x1ca178){if(_0x1ca178){_0x4b236c[_0x1fa0('0x16')]=_0x1ca178[_0x1fa0('0x44')]||'

Empty\x20message

';if(_0x1ca178[_0x1fa0('0x45')]){for(var _0x421503=0x0;_0x421503<_0x1ca178[_0x1fa0('0x45')][_0x1fa0('0xe')];_0x421503++){var _0x5ddcdb=_0x1ca178[_0x1fa0('0x45')][_0x421503];_0x314be6[_0x1fa0('0x23')][_0x1fa0('0x1b')]['push']({'filename':_0x5ddcdb[_0x1fa0('0x46')],'content':Buffer[_0x1fa0('0x37')](_0x5ddcdb[_0x1fa0('0x47')])});}}}_0x96d5b0(parseEmail(_0x164ae9,_0x4b236c,_0x314be6));});}else{_0x4b236c[_0x1fa0('0x16')]=_0x1fa0('0x48');_0x96d5b0(parseEmail(_0x164ae9,_0x4b236c,_0x314be6));}}else{_0x96d5b0(parseEmail(_0x164ae9,_0x4b236c,_0x314be6));}};exports[_0x1fa0('0x49')]=function(_0x92cb18,_0x5cee4a){var _0x13704b=[_0x1fa0('0x4a')+(_0x5cee4a||''),'auth=Bearer\x20'+_0x92cb18,'',''];return Buffer[_0x1fa0('0x37')](_0x13704b[_0x1fa0('0x2c')](''),_0x1fa0('0x4b'))[_0x1fa0('0x4c')]('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index fdcbf41..6f980dc 100644 --- a/server/services/email/model/mailAccount.js +++ b/server/services/email/model/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a3d=['Service','key','SERV','active','Imap','Smtp','lodash','name'];(function(_0x588b89,_0x189acc){var _0x5d7e5e=function(_0x12aa9c){while(--_0x12aa9c){_0x588b89['push'](_0x588b89['shift']());}};_0x5d7e5e(++_0x189acc);}(_0x8a3d,0xb6));var _0xd8a3=function(_0x3d12c0,_0x4fa80f){_0x3d12c0=_0x3d12c0-0x0;var _0x283f59=_0x8a3d[_0x3d12c0];return _0x283f59;};'use strict';var _=require(_0xd8a3('0x0'));function MailAccount(_0x7b9e25){this['id']=_0x7b9e25['id']||0x0;this[_0xd8a3('0x1')]=_0x7b9e25[_0xd8a3('0x1')]||_0xd8a3('0x2');this[_0xd8a3('0x3')]=_0x7b9e25['key']||_0xd8a3('0x4');this[_0xd8a3('0x5')]=_0x7b9e25[_0xd8a3('0x5')]||![];this['Imap']=_0x7b9e25[_0xd8a3('0x6')]||[];this[_0xd8a3('0x7')]=_0x7b9e25[_0xd8a3('0x7')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0x37ef=['active','Imap','Smtp','exports','lodash','name','Service','key','SERV'];(function(_0xf00c1f,_0xb8aec3){var _0x5a41fc=function(_0xb51dbb){while(--_0xb51dbb){_0xf00c1f['push'](_0xf00c1f['shift']());}};_0x5a41fc(++_0xb8aec3);}(_0x37ef,0x16c));var _0xf37e=function(_0x243c94,_0x156778){_0x243c94=_0x243c94-0x0;var _0x33624f=_0x37ef[_0x243c94];return _0x33624f;};'use strict';var _=require(_0xf37e('0x0'));function MailAccount(_0x3ffce4){this['id']=_0x3ffce4['id']||0x0;this[_0xf37e('0x1')]=_0x3ffce4[_0xf37e('0x1')]||_0xf37e('0x2');this['key']=_0x3ffce4[_0xf37e('0x3')]||_0xf37e('0x4');this[_0xf37e('0x5')]=_0x3ffce4[_0xf37e('0x5')]||![];this['Imap']=_0x3ffce4[_0xf37e('0x6')]||[];this[_0xf37e('0x7')]=_0x3ffce4[_0xf37e('0x7')]||[];}module[_0xf37e('0x8')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 7008fbe..163c270 100644 --- a/server/services/email/realtime/index.js +++ b/server/services/email/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa848=['merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','length','isUndefined'];(function(_0x34db7f,_0x3e22f8){var _0x509554=function(_0x112764){while(--_0x112764){_0x34db7f['push'](_0x34db7f['shift']());}};_0x509554(++_0x3e22f8);}(_0xa848,0x120));var _0x8a84=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xa848[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x8a84('0x0'));var MailAccount=require(_0x8a84('0x1'));var Realtime=function(){this[_0x8a84('0x2')]={};};function freeIsNotKey(_0x1f8f06,_0x1a7666,_0x59efac){var _0x5e2525=_[_0x8a84('0x3')](_0x1f8f06,function(_0x4b97df,_0x447e18){return _0x4b97df[_0x59efac];});for(var _0x42dde4 in _0x1a7666){if(_0x1a7666[_0x8a84('0x4')](_0x42dde4)){if(!_0x5e2525[_0x42dde4]){delete _0x1a7666[_0x42dde4];}}}}Realtime[_0x8a84('0x5')][_0x8a84('0x6')]=function(_0x375e6c,_0x684c4){for(var _0x167558 in _0x684c4){if(_0x375e6c['hasOwnProperty'](_0x167558)){_0x375e6c[_0x167558]=_0x684c4[_0x167558];}}};Realtime[_0x8a84('0x5')]['initMailAccounts']=function(){var _0x46eb36=this;return function(_0x4b6b64){if(_0x4b6b64){freeIsNotKey(_0x4b6b64,_0x46eb36[_0x8a84('0x2')],'id');for(var _0x5054b8=0x0,_0x5e6944={},_0x4be4c8={};_0x5054b8<_0x4b6b64[_0x8a84('0x7')];_0x5054b8+=0x1){_0x5e6944=_0x4b6b64[_0x5054b8];if(_[_0x8a84('0x8')](_0x46eb36[_0x8a84('0x2')][_0x5e6944['id']])){_0x46eb36[_0x8a84('0x2')][_0x5e6944['id']]=new MailAccount(_0x5e6944);}else{_[_0x8a84('0x9')](_0x46eb36[_0x8a84('0x2')][_0x5e6944['id']],_0x5e6944);}}}return _0x46eb36[_0x8a84('0x2')];};};module[_0x8a84('0xa')]=Realtime; \ No newline at end of file +var _0x572d=['mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount'];(function(_0x2c6a0d,_0x28a135){var _0x4f9bde=function(_0x2e0f3d){while(--_0x2e0f3d){_0x2c6a0d['push'](_0x2c6a0d['shift']());}};_0x4f9bde(++_0x28a135);}(_0x572d,0x174));var _0xd572=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x572d[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xd572('0x0'));var MailAccount=require(_0xd572('0x1'));var Realtime=function(){this[_0xd572('0x2')]={};};function freeIsNotKey(_0x400f90,_0x5cb1f9,_0x49e860){var _0xdaa4e3=_[_0xd572('0x3')](_0x400f90,function(_0x24cfc7,_0x14a201){return _0x24cfc7[_0x49e860];});for(var _0x3747b9 in _0x5cb1f9){if(_0x5cb1f9[_0xd572('0x4')](_0x3747b9)){if(!_0xdaa4e3[_0x3747b9]){delete _0x5cb1f9[_0x3747b9];}}}}Realtime[_0xd572('0x5')]['mergeFromDatabase']=function(_0x302ffc,_0x1433d2){for(var _0x833363 in _0x1433d2){if(_0x302ffc[_0xd572('0x4')](_0x833363)){_0x302ffc[_0x833363]=_0x1433d2[_0x833363];}}};Realtime[_0xd572('0x5')][_0xd572('0x6')]=function(){var _0x2e0104=this;return function(_0x2c25cf){if(_0x2c25cf){freeIsNotKey(_0x2c25cf,_0x2e0104[_0xd572('0x2')],'id');for(var _0xb481b2=0x0,_0x502d78={},_0x324a4a={};_0xb481b2<_0x2c25cf[_0xd572('0x7')];_0xb481b2+=0x1){_0x502d78=_0x2c25cf[_0xb481b2];if(_[_0xd572('0x8')](_0x2e0104[_0xd572('0x2')][_0x502d78['id']])){_0x2e0104[_0xd572('0x2')][_0x502d78['id']]=new MailAccount(_0x502d78);}else{_[_0xd572('0x9')](_0x2e0104['mailAccounts'][_0x502d78['id']],_0x502d78);}}}return _0x2e0104[_0xd572('0x2')];};};module[_0xd572('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 8fc0ce6..2b89444 100644 --- a/server/services/email/rpc/mailAccount.js +++ b/server/services/email/rpc/mailAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8fcd=['NotifyMailAccount','../client','getMailAccounts','Request','GetMailAccount','name','email','active','key','ListId','TemplateId','MailServerIn','type','data5','CloudProvider','MailServerOut'];(function(_0x328bd3,_0x9cf5a5){var _0x458149=function(_0x3f60d9){while(--_0x3f60d9){_0x328bd3['push'](_0x328bd3['shift']());}};_0x458149(++_0x9cf5a5);}(_0x8fcd,0xa1));var _0xd8fc=function(_0x3406ad,_0x1100c2){_0x3406ad=_0x3406ad-0x0;var _0x52e70=_0x8fcd[_0x3406ad];return _0x52e70;};'use strict';var client=require(_0xd8fc('0x0'));exports[_0xd8fc('0x1')]=function(){return function(){return client[_0xd8fc('0x2')](_0xd8fc('0x3'),{'options':{'attributes':['id',_0xd8fc('0x4'),'provider','service',_0xd8fc('0x5'),_0xd8fc('0x6'),_0xd8fc('0x7'),_0xd8fc('0x8'),_0xd8fc('0x9')],'raw':![],'include':[{'model':_0xd8fc('0xa'),'as':'Imap','include':[{'model':'CloudProvider','attributes':['id',_0xd8fc('0x4'),'service',_0xd8fc('0xb'),_0xd8fc('0xc')],'as':_0xd8fc('0xd')}]},{'model':_0xd8fc('0xe'),'as':'Smtp','include':[{'model':'CloudProvider','attributes':['id',_0xd8fc('0x4'),'service','type',_0xd8fc('0xc')],'as':_0xd8fc('0xd')}]}]},'log':'getMailAccount'});};};exports['notify']=function(_0x1c119d,_0x7023f2){return client['Request'](_0xd8fc('0xf'),{'account':{'id':_0x1c119d},'body':_0x7023f2,'log':_0xd8fc('0xf')});}; \ No newline at end of file +var _0xb96d=['service','email','ListId','TemplateId','MailServerIn','Imap','name','data5','MailServerOut','Smtp','CloudProvider','getMailAccount','notify','NotifyMailAccount','getMailAccounts','Request','GetMailAccount','provider'];(function(_0x49c095,_0x5815b7){var _0x3a2006=function(_0x1d03c5){while(--_0x1d03c5){_0x49c095['push'](_0x49c095['shift']());}};_0x3a2006(++_0x5815b7);}(_0xb96d,0x9e));var _0xdb96=function(_0x1aba25,_0x1faed1){_0x1aba25=_0x1aba25-0x0;var _0x47d997=_0xb96d[_0x1aba25];return _0x47d997;};'use strict';var client=require('../client');exports[_0xdb96('0x0')]=function(){return function(){return client[_0xdb96('0x1')](_0xdb96('0x2'),{'options':{'attributes':['id','name',_0xdb96('0x3'),_0xdb96('0x4'),_0xdb96('0x5'),'active','key',_0xdb96('0x6'),_0xdb96('0x7')],'raw':![],'include':[{'model':_0xdb96('0x8'),'as':_0xdb96('0x9'),'include':[{'model':'CloudProvider','attributes':['id',_0xdb96('0xa'),_0xdb96('0x4'),'type',_0xdb96('0xb')],'as':'CloudProvider'}]},{'model':_0xdb96('0xc'),'as':_0xdb96('0xd'),'include':[{'model':'CloudProvider','attributes':['id',_0xdb96('0xa'),_0xdb96('0x4'),'type',_0xdb96('0xb')],'as':_0xdb96('0xe')}]}]},'log':_0xdb96('0xf')});};};exports[_0xdb96('0x10')]=function(_0x47c94d,_0xa18db8){return client[_0xdb96('0x1')](_0xdb96('0x11'),{'account':{'id':_0x47c94d},'body':_0xa18db8,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index 6145916..34473a5 100644 --- a/server/services/email/rpc/setting.js +++ b/server/services/email/rpc/setting.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x1594=['../client','getSettings','Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x28f4ee,_0x1ff74e){var _0x5b52d7=function(_0x35edf3){while(--_0x35edf3){_0x28f4ee['push'](_0x28f4ee['shift']());}};_0x5b52d7(++_0x1ff74e);}(_0x1594,0x1a4));var _0x4159=function(_0x16a4a8,_0x38799c){_0x16a4a8=_0x16a4a8-0x0;var _0x2c5290=_0x1594[_0x16a4a8];return _0x2c5290;};'use strict';var client=require(_0x4159('0x0'));exports[_0x4159('0x1')]=function(){return client[_0x4159('0x2')](_0x4159('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x4159('0x4')]},'log':_0x4159('0x5')});}; \ No newline at end of file +var _0xee33=['ShowSetting','loginMailFrequency','GetSettings','../client','getSettings','Request'];(function(_0x708535,_0xbd6bbf){var _0x55247d=function(_0x405cd7){while(--_0x405cd7){_0x708535['push'](_0x708535['shift']());}};_0x55247d(++_0xbd6bbf);}(_0xee33,0xa5));var _0x3ee3=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xee33[_0x102e37];return _0x35a07c;};'use strict';var client=require(_0x3ee3('0x0'));exports[_0x3ee3('0x1')]=function(){return client[_0x3ee3('0x2')](_0x3ee3('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3ee3('0x4')]},'log':_0x3ee3('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index e601b99..33d7fd8 100644 --- a/server/services/email/server/index.js +++ b/server/services/email/server/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file +var _0xa9e0=['catch','values','mailAccounts','length','Imap','password','Smtp','pass','server','http','stringify','127.0.0.1','log','Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','lodash','listen','sendMail','then','error','Verified'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index bf81200..7319b69 100644 --- a/server/services/express/index.js +++ b/server/services/express/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe986=['sticky-session','ioredis','createServer','timeout','listen','port','socket.io','polling','redis','localhost','adapter','socket.io-redis','../../config/socketio','../../config/express','default','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','express'];(function(_0x105045,_0x2e471e){var _0x2487d0=function(_0x243428){while(--_0x243428){_0x105045['push'](_0x105045['shift']());}};_0x2487d0(++_0x2e471e);}(_0xe986,0x1b7));var _0x6e98=function(_0xdd96c3,_0x5e61c7){_0xdd96c3=_0xdd96c3-0x0;var _0x1f52ae=_0xe986[_0xdd96c3];return _0x1f52ae;};'use strict';var _=require('lodash');var http=require('http');var express=require(_0x6e98('0x0'));var sticky=require(_0x6e98('0x1'));var Redis=require(_0x6e98('0x2'));var config=require('../../config/environment');var app=express();var server=http[_0x6e98('0x3')](app);server[_0x6e98('0x4')]=0xdbba0;if(sticky[_0x6e98('0x5')](server,config[_0x6e98('0x6')])){var socketio=require(_0x6e98('0x7'))(server,{'transports':['websocket',_0x6e98('0x8')]});config['redis']=_['defaults'](config[_0x6e98('0x9')],{'host':_0x6e98('0xa'),'port':0x18eb});socketio[_0x6e98('0xb')](require(_0x6e98('0xc'))({'pubClient':new Redis(config[_0x6e98('0x9')]),'subClient':new Redis(config[_0x6e98('0x9')])}));require('../../config/triggers')['default']();require(_0x6e98('0xd'))['default'](socketio);require(_0x6e98('0xe'))[_0x6e98('0xf')](app);require(_0x6e98('0x10'))['default'](app);}else{server[_0x6e98('0x11')](_0x6e98('0x12'),function(){console[_0x6e98('0x13')](_0x6e98('0x14'),config[_0x6e98('0x6')]);});}exports=module[_0x6e98('0x15')]=app; \ No newline at end of file +var _0x5d88=['sticky-session','ioredis','../../config/environment','createServer','timeout','listen','socket.io','websocket','polling','defaults','redis','localhost','adapter','socket.io-redis','default','../../config/socketio','../../config/express','../../routes','once','log','port','exports','lodash','http'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x5d88,0x14e));var _0x85d8=function(_0x42e083,_0x204d47){_0x42e083=_0x42e083-0x0;var _0x57b25f=_0x5d88[_0x42e083];return _0x57b25f;};'use strict';var _=require(_0x85d8('0x0'));var http=require(_0x85d8('0x1'));var express=require('express');var sticky=require(_0x85d8('0x2'));var Redis=require(_0x85d8('0x3'));var config=require(_0x85d8('0x4'));var app=express();var server=http[_0x85d8('0x5')](app);server[_0x85d8('0x6')]=0xdbba0;if(sticky[_0x85d8('0x7')](server,config['port'])){var socketio=require(_0x85d8('0x8'))(server,{'transports':[_0x85d8('0x9'),_0x85d8('0xa')]});config['redis']=_[_0x85d8('0xb')](config[_0x85d8('0xc')],{'host':_0x85d8('0xd'),'port':0x18eb});socketio[_0x85d8('0xe')](require(_0x85d8('0xf'))({'pubClient':new Redis(config[_0x85d8('0xc')]),'subClient':new Redis(config[_0x85d8('0xc')])}));require('../../config/triggers')[_0x85d8('0x10')]();require(_0x85d8('0x11'))[_0x85d8('0x10')](socketio);require(_0x85d8('0x12'))[_0x85d8('0x10')](app);require(_0x85d8('0x13'))[_0x85d8('0x10')](app);}else{server[_0x85d8('0x14')]('listening',function(){console[_0x85d8('0x15')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x85d8('0x16')]);});}exports=module[_0x85d8('0x17')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index cc8d813..a3f825d 100644 --- a/server/services/routing/client.js +++ b/server/services/routing/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5ad5=['http','Request','then','debug','rpc','error','message','exports','../../config/logger','routing','client'];(function(_0x3dfa3e,_0x293558){var _0x3ff9ed=function(_0x400e9b){while(--_0x400e9b){_0x3dfa3e['push'](_0x3dfa3e['shift']());}};_0x3ff9ed(++_0x293558);}(_0x5ad5,0x11b));var _0x55ad=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5ad5[_0x5b644e];return _0x49c6bf;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x55ad('0x0'))(_0x55ad('0x1'));var client=jayson[_0x55ad('0x2')][_0x55ad('0x3')]({'port':0x2329});client[_0x55ad('0x4')]=function(_0x2f5620,_0x4fd6c9){return new BPromise(function(_0x5ba9f9,_0x69e883){return client['request'](_0x2f5620,_0x4fd6c9)[_0x55ad('0x5')](function(_0x3ef7ab){logger[_0x55ad('0x6')](_0x55ad('0x7'),_0x55ad('0x1'),_0x2f5620,_0x4fd6c9,_0x3ef7ab);if(_0x3ef7ab[_0x55ad('0x8')]){logger[_0x55ad('0x8')](_0x55ad('0x7'),'routing',_0x2f5620,_0x3ef7ab[_0x55ad('0x8')][_0x55ad('0x9')],_0x4fd6c9);return _0x69e883(_0x3ef7ab[_0x55ad('0x8')]['message']);}else{return _0x5ba9f9(_0x3ef7ab['result']);}})['catch'](function(_0x306727){logger[_0x55ad('0x8')](_0x55ad('0x7'),'routing',_0x2f5620,_0x306727,_0x4fd6c9);return _0x69e883(_0x306727);});});};module[_0x55ad('0xa')]=client; \ No newline at end of file +var _0x765b=['client','http','Request','request','then','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing'];(function(_0x350188,_0x4a8627){var _0x20ddb0=function(_0x5af728){while(--_0x5af728){_0x350188['push'](_0x350188['shift']());}};_0x20ddb0(++_0x4a8627);}(_0x765b,0x137));var _0xb765=function(_0x41d02a,_0x355e19){_0x41d02a=_0x41d02a-0x0;var _0x4c3983=_0x765b[_0x41d02a];return _0x4c3983;};'use strict';var jayson=require(_0xb765('0x0'));var BPromise=require(_0xb765('0x1'));var logger=require(_0xb765('0x2'))(_0xb765('0x3'));var client=jayson[_0xb765('0x4')][_0xb765('0x5')]({'port':0x2329});client[_0xb765('0x6')]=function(_0x4c5f34,_0x3082ca){return new BPromise(function(_0x9d4115,_0x557bae){return client[_0xb765('0x7')](_0x4c5f34,_0x3082ca)[_0xb765('0x8')](function(_0xfe300e){logger['debug'](_0xb765('0x9'),'routing',_0x4c5f34,_0x3082ca,_0xfe300e);if(_0xfe300e['error']){logger[_0xb765('0xa')](_0xb765('0x9'),'routing',_0x4c5f34,_0xfe300e[_0xb765('0xa')][_0xb765('0xb')],_0x3082ca);return _0x557bae(_0xfe300e[_0xb765('0xa')]['message']);}else{return _0x9d4115(_0xfe300e[_0xb765('0xc')]);}})[_0xb765('0xd')](function(_0x1f0ce2){logger[_0xb765('0xa')]('rpc',_0xb765('0x3'),_0x4c5f34,_0x1f0ce2,_0x3082ca);return _0x557bae(_0x1f0ce2);});});};module[_0xb765('0xe')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 686d71c..ecec213 100644 --- a/server/services/routing/index.js +++ b/server/services/routing/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb142=['log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/smsQueue','./rpc/mailQueue','then','getAgents','initAgents','initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','listen','catch'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xb142,0x151));var _0x2b14=function(_0x4316fa,_0x5e6dbf){_0x4316fa=_0x4316fa-0x0;var _0x22183c=_0xb142[_0x4316fa];return _0x22183c;};'use strict';var BPromise=require('bluebird');var server=require(_0x2b14('0x0'));var Realtime=require(_0x2b14('0x1'));var user=require(_0x2b14('0x2'));var interval=require(_0x2b14('0x3'));var openchannelQueue=require(_0x2b14('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require(_0x2b14('0x5'));var mailQueue=require(_0x2b14('0x6'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require('./rpc/whatsappQueue');var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x2b14('0x7')](user[_0x2b14('0x8')]())[_0x2b14('0x7')](realtime[_0x2b14('0x9')]())[_0x2b14('0x7')](interval['getIntervals']())['then'](realtime[_0x2b14('0xa')]())[_0x2b14('0x7')](openchannelQueue[_0x2b14('0xb')]())['then'](realtime['initOpenchannelQueues']())[_0x2b14('0x7')](chatQueue[_0x2b14('0xc')]())['then'](realtime[_0x2b14('0xd')]())[_0x2b14('0x7')](smsQueue[_0x2b14('0xe')]())[_0x2b14('0x7')](realtime[_0x2b14('0xf')]())[_0x2b14('0x7')](mailQueue[_0x2b14('0x10')]())['then'](realtime[_0x2b14('0x11')]())[_0x2b14('0x7')](faxQueue[_0x2b14('0x12')]())['then'](realtime[_0x2b14('0x13')]())[_0x2b14('0x7')](whatsappQueue['getWhatsappQueues']())[_0x2b14('0x7')](realtime[_0x2b14('0x14')]())['then'](function(){return realtime;});}function main(){return server[_0x2b14('0x15')](realtime)[_0x2b14('0x7')](function(_0x11361b){return initRealtime();})[_0x2b14('0x7')](function(_0xf9475a){return setInterval(initRealtime,0x1388);})[_0x2b14('0x16')](function(_0x1b998a){console[_0x2b14('0x17')](_0x1b998a);});}main(); \ No newline at end of file +var _0x9359=['getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','listen','catch','log','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','initAgents','then','getIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x9359,0x1dc));var _0x9935=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9359[_0x14add3];return _0x4a174f;};'use strict';var BPromise=require('bluebird');var server=require(_0x9935('0x0'));var Realtime=require(_0x9935('0x1'));var user=require(_0x9935('0x2'));var interval=require(_0x9935('0x3'));var openchannelQueue=require(_0x9935('0x4'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x9935('0x5'));var faxQueue=require(_0x9935('0x6'));var whatsappQueue=require(_0x9935('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x9935('0x8')]()['then'](user[_0x9935('0x9')]())['then'](realtime[_0x9935('0xa')]())[_0x9935('0xb')](interval[_0x9935('0xc')]())[_0x9935('0xb')](realtime['initIntervals']())[_0x9935('0xb')](openchannelQueue[_0x9935('0xd')]())['then'](realtime['initOpenchannelQueues']())[_0x9935('0xb')](chatQueue[_0x9935('0xe')]())[_0x9935('0xb')](realtime[_0x9935('0xf')]())[_0x9935('0xb')](smsQueue[_0x9935('0x10')]())[_0x9935('0xb')](realtime[_0x9935('0x11')]())['then'](mailQueue[_0x9935('0x12')]())[_0x9935('0xb')](realtime[_0x9935('0x13')]())[_0x9935('0xb')](faxQueue[_0x9935('0x14')]())[_0x9935('0xb')](realtime[_0x9935('0x15')]())[_0x9935('0xb')](whatsappQueue['getWhatsappQueues']())['then'](realtime[_0x9935('0x16')]())[_0x9935('0xb')](function(){return realtime;});}function main(){return server[_0x9935('0x17')](realtime)[_0x9935('0xb')](function(_0x1bde8b){return initRealtime();})[_0x9935('0xb')](function(_0x3ab717){return setInterval(initRealtime,0x1388);})[_0x9935('0x18')](function(_0x6d1c7a){console[_0x9935('0x19')](_0x6d1c7a);});}main(); \ No newline at end of file diff --git a/server/services/routing/lib/rule-engine.js b/server/services/routing/lib/rule-engine.js index a0228aa..aa03cf5 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['ruleRef','name','nextTick','push','call','next','isEqual','restart','isNil','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','fromJSON','isString','parse','register','exports','lodash','util','events','EventEmitter','ignoreFactChanges','inherits','prototype','init','rules','activeRules','isArray','concat','isObject','sync','filter','orderBy','asc','execute','result','clone','consequence'];(function(_0x5b59eb,_0x505169){var _0x143836=function(_0x4ca965){while(--_0x4ca965){_0x5b59eb['push'](_0x5b59eb['shift']());}};_0x143836(++_0x505169);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xc4aa[_0x3d42d8];return _0x27fc41;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var EventEmitter=require(_0xac4a('0x2'))[_0xac4a('0x3')];function RuleEngine(_0x275161,_0x22469d){this['init']();if(!_['isNil'](_0x275161)){this['register'](_0x275161);}if(_0x22469d){this[_0xac4a('0x4')]=_0x22469d[_0xac4a('0x4')];}return this;}util[_0xac4a('0x5')](RuleEngine,EventEmitter);RuleEngine[_0xac4a('0x6')][_0xac4a('0x7')]=function(_0x15cd34){this[_0xac4a('0x8')]=[];this[_0xac4a('0x9')]=[];};RuleEngine['prototype']['register']=function(_0x1aba6d){if(Array[_0xac4a('0xa')](_0x1aba6d)){this[_0xac4a('0x8')]=this['rules'][_0xac4a('0xb')](_0x1aba6d);}else if(_0x1aba6d!==null&&_[_0xac4a('0xc')](_0x1aba6d)){this[_0xac4a('0x8')]['push'](_0x1aba6d);}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0xd')]=function(){this['activeRules']=this[_0xac4a('0x8')][_0xac4a('0xe')](function(_0x24291d){if(_['isNil'](_0x24291d['on'])){_0x24291d['on']=!![];}if(_0x24291d['on']===!![]){return _0x24291d;}});this[_0xac4a('0x9')]=_[_0xac4a('0xf')](this[_0xac4a('0x9')],['p'],[_0xac4a('0x10')]);};RuleEngine[_0xac4a('0x6')][_0xac4a('0x11')]=function(_0x34bc01,_0x33c287){var _0x190418=![];_0x34bc01[_0xac4a('0x12')]=!![];var _0x11e101=_[_0xac4a('0x13')](_0x34bc01);var _0x4a2119=_[_0xac4a('0x13')](_0x34bc01);var _0x34d797=this[_0xac4a('0x9')];var _0x144553=[];var _0x3e88e3=this[_0xac4a('0x4')];(function FnRuleLoop(_0x28e304){var _0x44ec59={'rules':function(){return _0x34d797;},'rule':function(){return _0x34d797[_0x28e304];},'when':function(_0x546c5d){if(_0x546c5d){var _0x5ac21e=_0x34d797[_0x28e304][_0xac4a('0x14')];_0x5ac21e[_0xac4a('0x15')]=_0x34d797[_0x28e304]['id']||_0x34d797[_0x28e304][_0xac4a('0x16')]||'index_'+_0x28e304;process[_0xac4a('0x17')](function(){_0x144553[_0xac4a('0x18')](_0x5ac21e[_0xac4a('0x15')]);_0x5ac21e[_0xac4a('0x19')](_0x11e101,_0x44ec59);});}else{process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1a')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x190418=!![];return FnRuleLoop(0x0);},'next':function(_0xe38996){if(!_0x3e88e3&&!_[_0xac4a('0x1b')](_0x4a2119,_0x11e101)){_0x4a2119=_['clone'](_0x11e101);process[_0xac4a('0x17')](function(){_0x44ec59[_0xac4a('0x1c')]();});}else{process['nextTick'](function(){if(_[_0xac4a('0x1d')](_0xe38996)){return FnRuleLoop(_0x28e304+0x1);}else{return FnRuleLoop(_0xe38996);}});}}};if(_0x28e304<_0x34d797[_0xac4a('0x1e')]&&_0x190418===![]){var _0x3eacd3=_0x34d797[_0x28e304][_0xac4a('0x1f')];_0x3eacd3['call'](_0x11e101,_0x44ec59);}else{process[_0xac4a('0x17')](function(){_0x11e101[_0xac4a('0x20')]=_0x144553;return _0x33c287?_0x33c287(_0x11e101):_[_0xac4a('0x21')]();});}}(0x0));};RuleEngine[_0xac4a('0x6')][_0xac4a('0x22')]=function(_0x2b0dc2){if(_[_0xac4a('0x1d')](_0x2b0dc2)){return this[_0xac4a('0x8')];}else{var _0x3e2c69=_[_0xac4a('0x23')](_0x2b0dc2);return _[_0xac4a('0xe')](this[_0xac4a('0x8')],_0x3e2c69);}};RuleEngine[_0xac4a('0x6')][_0xac4a('0x24')]=function(_0x1c13dc,_0x20202c){var _0x4e17ce=_0x1c13dc==='on'||_0x1c13dc==='ON'?!![]:![];var _0x23b061=this[_0xac4a('0x22')](_0x20202c);for(var _0x42a33c=0x0,_0x2772fe=_0x23b061[_0xac4a('0x1e')];_0x42a33c<_0x2772fe;_0x42a33c+=0x1){_0x23b061[_0x42a33c]['on']=_0x4e17ce;}this['sync']();};RuleEngine['prototype'][_0xac4a('0x25')]=function(_0x7a948b,_0x1f12d5){_0x7a948b=parseInt(_0x7a948b,0xa);var _0x546b65=this['findRules'](_0x1f12d5);for(var _0x355755=0x0,_0x2896bc=_0x546b65[_0xac4a('0x1e')];_0x355755<_0x2896bc;_0x355755+=0x1){_0x546b65[_0x355755][_0xac4a('0x26')]=_0x7a948b;}this[_0xac4a('0xd')]();};RuleEngine['prototype'][_0xac4a('0x27')]=function(){var _0x482afc=this[_0xac4a('0x8')];if(_0x482afc instanceof Array){_0x482afc=_0x482afc['map'](function(_0x17e6de){_0x17e6de[_0xac4a('0x1f')]=_0x17e6de[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x17e6de[_0xac4a('0x14')]=_0x17e6de[_0xac4a('0x14')][_0xac4a('0x28')]();return _0x17e6de;});}else if(!_[_0xac4a('0x1d')](_0x482afc)){_0x482afc[_0xac4a('0x1f')]=_0x482afc[_0xac4a('0x1f')][_0xac4a('0x28')]();_0x482afc[_0xac4a('0x14')]=_0x482afc[_0xac4a('0x14')][_0xac4a('0x28')]();}return _0x482afc;};RuleEngine['prototype'][_0xac4a('0x29')]=function(_0x1c41fb){this['init']();if(_[_0xac4a('0x2a')](_0x1c41fb)){_0x1c41fb=JSON[_0xac4a('0x2b')](_0x1c41fb);}if(_0x1c41fb instanceof Array){_0x1c41fb=_0x1c41fb['map'](function(_0x58804b){_0x58804b[_0xac4a('0x1f')]=eval('('+_0x58804b[_0xac4a('0x1f')]+')');_0x58804b[_0xac4a('0x14')]=eval('('+_0x58804b[_0xac4a('0x14')]+')');return _0x58804b;});}else if(_0x1c41fb!==null&&typeof _0x1c41fb=='object'){_0x1c41fb[_0xac4a('0x1f')]=eval('('+_0x1c41fb[_0xac4a('0x1f')]+')');_0x1c41fb['consequence']=eval('('+_0x1c41fb[_0xac4a('0x14')]+')');}this[_0xac4a('0x2c')](_0x1c41fb);};module[_0xac4a('0x2d')]=RuleEngine; \ No newline at end of file +var _0x1261=['isNil','register','ignoreFactChanges','activeRules','prototype','isArray','rules','concat','isObject','push','sync','filter','orderBy','asc','result','clone','name','nextTick','ruleRef','isEqual','restart','length','condition','noop','findRules','matches','turn','prioritize','priority','toString','consequence','fromJSON','isString','parse','map','object','exports','util','events','EventEmitter','init'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1261,0x144));var _0x1126=function(_0x31c796,_0x2e3c7f){_0x31c796=_0x31c796-0x0;var _0x128356=_0x1261[_0x31c796];return _0x128356;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var EventEmitter=require(_0x1126('0x1'))[_0x1126('0x2')];function RuleEngine(_0x331a2c,_0x39b786){this[_0x1126('0x3')]();if(!_[_0x1126('0x4')](_0x331a2c)){this[_0x1126('0x5')](_0x331a2c);}if(_0x39b786){this[_0x1126('0x6')]=_0x39b786[_0x1126('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine['prototype'][_0x1126('0x3')]=function(_0x907180){this['rules']=[];this[_0x1126('0x7')]=[];};RuleEngine[_0x1126('0x8')][_0x1126('0x5')]=function(_0x3abb0b){if(Array[_0x1126('0x9')](_0x3abb0b)){this['rules']=this[_0x1126('0xa')][_0x1126('0xb')](_0x3abb0b);}else if(_0x3abb0b!==null&&_[_0x1126('0xc')](_0x3abb0b)){this['rules'][_0x1126('0xd')](_0x3abb0b);}this['sync']();};RuleEngine['prototype'][_0x1126('0xe')]=function(){this['activeRules']=this[_0x1126('0xa')][_0x1126('0xf')](function(_0xd26a32){if(_[_0x1126('0x4')](_0xd26a32['on'])){_0xd26a32['on']=!![];}if(_0xd26a32['on']===!![]){return _0xd26a32;}});this[_0x1126('0x7')]=_[_0x1126('0x10')](this[_0x1126('0x7')],['p'],[_0x1126('0x11')]);};RuleEngine[_0x1126('0x8')]['execute']=function(_0x5de9a7,_0x1af673){var _0x154e20=![];_0x5de9a7[_0x1126('0x12')]=!![];var _0x4be0c6=_[_0x1126('0x13')](_0x5de9a7);var _0x4794a7=_[_0x1126('0x13')](_0x5de9a7);var _0x42f379=this[_0x1126('0x7')];var _0x4e1c97=[];var _0x245cd7=this[_0x1126('0x6')];(function FnRuleLoop(_0x4a7b49){var _0x4d2b38={'rules':function(){return _0x42f379;},'rule':function(){return _0x42f379[_0x4a7b49];},'when':function(_0x22ae0b){if(_0x22ae0b){var _0x2b2487=_0x42f379[_0x4a7b49]['consequence'];_0x2b2487['ruleRef']=_0x42f379[_0x4a7b49]['id']||_0x42f379[_0x4a7b49][_0x1126('0x14')]||'index_'+_0x4a7b49;process[_0x1126('0x15')](function(){_0x4e1c97[_0x1126('0xd')](_0x2b2487[_0x1126('0x16')]);_0x2b2487['call'](_0x4be0c6,_0x4d2b38);});}else{process[_0x1126('0x15')](function(){_0x4d2b38['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x154e20=!![];return FnRuleLoop(0x0);},'next':function(_0x56efeb){if(!_0x245cd7&&!_[_0x1126('0x17')](_0x4794a7,_0x4be0c6)){_0x4794a7=_[_0x1126('0x13')](_0x4be0c6);process[_0x1126('0x15')](function(){_0x4d2b38[_0x1126('0x18')]();});}else{process['nextTick'](function(){if(_[_0x1126('0x4')](_0x56efeb)){return FnRuleLoop(_0x4a7b49+0x1);}else{return FnRuleLoop(_0x56efeb);}});}}};if(_0x4a7b49<_0x42f379[_0x1126('0x19')]&&_0x154e20===![]){var _0x48a08d=_0x42f379[_0x4a7b49][_0x1126('0x1a')];_0x48a08d['call'](_0x4be0c6,_0x4d2b38);}else{process['nextTick'](function(){_0x4be0c6['matchPath']=_0x4e1c97;return _0x1af673?_0x1af673(_0x4be0c6):_[_0x1126('0x1b')]();});}}(0x0));};RuleEngine[_0x1126('0x8')][_0x1126('0x1c')]=function(_0x34bcf1){if(_[_0x1126('0x4')](_0x34bcf1)){return this[_0x1126('0xa')];}else{var _0xea0971=_[_0x1126('0x1d')](_0x34bcf1);return _['filter'](this[_0x1126('0xa')],_0xea0971);}};RuleEngine[_0x1126('0x8')][_0x1126('0x1e')]=function(_0x5ddf63,_0x541bc9){var _0xeb7d89=_0x5ddf63==='on'||_0x5ddf63==='ON'?!![]:![];var _0x39bf0e=this['findRules'](_0x541bc9);for(var _0x2fb797=0x0,_0x23d2bc=_0x39bf0e['length'];_0x2fb797<_0x23d2bc;_0x2fb797+=0x1){_0x39bf0e[_0x2fb797]['on']=_0xeb7d89;}this[_0x1126('0xe')]();};RuleEngine['prototype'][_0x1126('0x1f')]=function(_0x4bd50b,_0x771bb8){_0x4bd50b=parseInt(_0x4bd50b,0xa);var _0x583ce6=this[_0x1126('0x1c')](_0x771bb8);for(var _0x5f2611=0x0,_0x5252e0=_0x583ce6['length'];_0x5f2611<_0x5252e0;_0x5f2611+=0x1){_0x583ce6[_0x5f2611][_0x1126('0x20')]=_0x4bd50b;}this[_0x1126('0xe')]();};RuleEngine[_0x1126('0x8')]['toJSON']=function(){var _0x2a3055=this[_0x1126('0xa')];if(_0x2a3055 instanceof Array){_0x2a3055=_0x2a3055['map'](function(_0x3dd50e){_0x3dd50e[_0x1126('0x1a')]=_0x3dd50e[_0x1126('0x1a')][_0x1126('0x21')]();_0x3dd50e['consequence']=_0x3dd50e['consequence'][_0x1126('0x21')]();return _0x3dd50e;});}else if(!_[_0x1126('0x4')](_0x2a3055)){_0x2a3055[_0x1126('0x1a')]=_0x2a3055[_0x1126('0x1a')]['toString']();_0x2a3055[_0x1126('0x22')]=_0x2a3055[_0x1126('0x22')][_0x1126('0x21')]();}return _0x2a3055;};RuleEngine[_0x1126('0x8')][_0x1126('0x23')]=function(_0x5df232){this[_0x1126('0x3')]();if(_[_0x1126('0x24')](_0x5df232)){_0x5df232=JSON[_0x1126('0x25')](_0x5df232);}if(_0x5df232 instanceof Array){_0x5df232=_0x5df232[_0x1126('0x26')](function(_0x5c019d){_0x5c019d['condition']=eval('('+_0x5c019d[_0x1126('0x1a')]+')');_0x5c019d[_0x1126('0x22')]=eval('('+_0x5c019d['consequence']+')');return _0x5c019d;});}else if(_0x5df232!==null&&typeof _0x5df232==_0x1126('0x27')){_0x5df232[_0x1126('0x1a')]=eval('('+_0x5df232[_0x1126('0x1a')]+')');_0x5df232['consequence']=eval('('+_0x5df232['consequence']+')');}this[_0x1126('0x5')](_0x5df232);};module[_0x1126('0x28')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 2c31476..5d0f37e 100644 --- a/server/services/routing/mailRpc/index.js +++ b/server/services/routing/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc761=['message','result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','http','then','error'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xc761,0x181));var _0x1c76=function(_0x484bf4,_0x2b975c){_0x484bf4=_0x484bf4-0x0;var _0x31c683=_0xc761[_0x484bf4];return _0x31c683;};'use strict';var BPromise=require(_0x1c76('0x0'));var jayson=require(_0x1c76('0x1'));var client=jayson['client'][_0x1c76('0x2')]({'port':0x232b});function request(_0x9a3a3f,_0x1ed86f){return new BPromise(function(_0x302fb9,_0x273768){return client['request'](_0x9a3a3f,_0x1ed86f)[_0x1c76('0x3')](function(_0x506b6c){if(_0x506b6c[_0x1c76('0x4')]){return _0x273768(_0x506b6c[_0x1c76('0x4')][_0x1c76('0x5')]);}else{return _0x302fb9(_0x506b6c[_0x1c76('0x6')]);}})[_0x1c76('0x7')](function(_0x395ab1){return _0x273768(_0x395ab1);});});}exports[_0x1c76('0x8')]=function(_0x12a7d8,_0x5bcbd5){return request(_0x1c76('0x9'),{'account':_0x12a7d8,'message':_0x5bcbd5});}; \ No newline at end of file +var _0xe9ce=['message','catch','sendMailMessage','SendMail','bluebird','jayson/promise','then','error'];(function(_0xee2b01,_0x2bb78e){var _0x598107=function(_0x4be3c6){while(--_0x4be3c6){_0xee2b01['push'](_0xee2b01['shift']());}};_0x598107(++_0x2bb78e);}(_0xe9ce,0x1b4));var _0xee9c=function(_0x438bf8,_0x18ce5f){_0x438bf8=_0x438bf8-0x0;var _0x9aad1a=_0xe9ce[_0x438bf8];return _0x9aad1a;};'use strict';var BPromise=require(_0xee9c('0x0'));var jayson=require(_0xee9c('0x1'));var client=jayson['client']['http']({'port':0x232b});function request(_0x2382eb,_0x477242){return new BPromise(function(_0x52cc33,_0x53d51f){return client['request'](_0x2382eb,_0x477242)[_0xee9c('0x2')](function(_0x4f88a7){if(_0x4f88a7['error']){return _0x53d51f(_0x4f88a7[_0xee9c('0x3')][_0xee9c('0x4')]);}else{return _0x52cc33(_0x4f88a7['result']);}})[_0xee9c('0x5')](function(_0x2c5350){return _0x53d51f(_0x2c5350);});});}exports[_0xee9c('0x6')]=function(_0x152e5d,_0x39239e){return request(_0xee9c('0x7'),{'account':_0x152e5d,'message':_0x39239e});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 174c069..c69fb8a 100644 --- a/server/services/routing/model/agent.js +++ b/server/services/routing/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd61c=['openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','faxWaitingInteractions','mailWaitingInteractions','openchannelWaitingInteractions','updateRealtime','getChannelStatus','Capacity','CurrentCapacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','whatsapp','toNumber','format','smsCurrentCapacity','chatWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','stringify','emit','user:save','exports','moment','md5','ioredis','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','unknown','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus'];(function(_0x3c4582,_0x295d6a){var _0xbf1bd4=function(_0x38eb54){while(--_0x38eb54){_0x3c4582['push'](_0x3c4582['shift']());}};_0xbf1bd4(++_0x295d6a);}(_0xd61c,0x1ed));var _0xcd61=function(_0x2b7312,_0xdd928e){_0x2b7312=_0x2b7312-0x0;var _0x18e25f=_0xd61c[_0x2b7312];return _0x18e25f;};'use strict';var _=require('lodash');var moment=require(_0xcd61('0x0'));var md5=require(_0xcd61('0x1'));var Redis=require(_0xcd61('0x2'));var config=require(_0xcd61('0x3'));config['redis']=_[_0xcd61('0x4')](config['redis'],{'host':_0xcd61('0x5'),'port':0x18eb});var io=require(_0xcd61('0x6'))(new Redis(config[_0xcd61('0x7')]));function Agent(_0x438345){this['id']=_0x438345['id']||0x0;this[_0xcd61('0x8')]=_0x438345[_0xcd61('0x8')]||'';this[_0xcd61('0x9')]=_0x438345['online']||!![];this[_0xcd61('0xa')]=_0x438345[_0xcd61('0xa')]||![];this[_0xcd61('0xb')]=_0x438345[_0xcd61('0xb')]||![];this[_0xcd61('0xc')]=_0x438345[_0xcd61('0xc')]||![];this[_0xcd61('0xd')]=_0x438345['faxPause']||![];this[_0xcd61('0xe')]=_0x438345[_0xcd61('0xe')]||![];this['openchannelPause']=_0x438345[_0xcd61('0xf')]||![];this[_0xcd61('0x10')]='unknown';this[_0xcd61('0x11')]=0x0;this['chatCapacity']=_0x438345[_0xcd61('0x12')]||0x0;this[_0xcd61('0x13')]=0x0;this[_0xcd61('0x14')]=_0xcd61('0x15');this[_0xcd61('0x16')]=0x0;this['mailCapacity']=_0x438345[_0xcd61('0x17')]||0x0;this[_0xcd61('0x18')]=0x0;this['faxStatus']='unknown';this[_0xcd61('0x19')]=0x0;this[_0xcd61('0x1a')]=_0x438345['faxCapacity']||0x0;this[_0xcd61('0x1b')]=0x0;this[_0xcd61('0x1c')]=_0xcd61('0x15');this[_0xcd61('0x1d')]=0x0;this[_0xcd61('0x1e')]=_0x438345[_0xcd61('0x1e')]||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']=_0xcd61('0x15');this[_0xcd61('0x1f')]=0x0;this[_0xcd61('0x20')]=_0x438345['whatsappCapacity']||0x0;this[_0xcd61('0x21')]=0x0;this[_0xcd61('0x22')]='unknown';this[_0xcd61('0x23')]=0x0;this[_0xcd61('0x24')]=_0x438345[_0xcd61('0x24')]||0x0;this[_0xcd61('0x25')]=0x0;this[_0xcd61('0x26')]=![];this[_0xcd61('0x27')]=undefined;this[_0xcd61('0x1')]='';this['chatWaitingInteractions']={};this[_0xcd61('0x28')]={};this[_0xcd61('0x29')]={};this[_0xcd61('0x2a')]={};this['smsWaitingInteractions']={};this['whatsappWaitingInteractions']={};this[_0xcd61('0x2b')]();}Agent['prototype'][_0xcd61('0x2c')]=function(_0x260334){if(this[_0x260334+'CurrentCapacity']>0x0){if(this[_0x260334+_0xcd61('0x2d')]>0x0&&this[_0x260334+_0xcd61('0x2e')]>=this[_0x260334+_0xcd61('0x2d')]){return _0xcd61('0x2f');}else{return _0xcd61('0x30');}}else{return _0xcd61('0x31');}};Agent['prototype'][_0xcd61('0x2b')]=function(){var _0x7a1d31=[_0xcd61('0x32'),_0xcd61('0x33'),_0xcd61('0x34'),_0xcd61('0x35'),_0xcd61('0x36'),_0xcd61('0x37')];for(var _0x33f612=0x0;_0x33f612<_0x7a1d31['length'];_0x33f612+=0x1){var _0x4d6425=this[_0xcd61('0x2c')](_0x7a1d31[_0x33f612]);if(this[_0x7a1d31[_0x33f612]+'Status']!==_0x4d6425){this[_0x7a1d31[_0x33f612]+'StatusTime']=_[_0xcd61('0x38')](moment()[_0xcd61('0x39')]('x'));}this[_0x7a1d31[_0x33f612]+'Status']=_0x4d6425;}var _0x5b2455={'id':this['id'],'name':this[_0xcd61('0x8')],'online':this[_0xcd61('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0xcd61('0xb')],'mailPause':this[_0xcd61('0xc')],'smsPause':this['smsPause'],'faxPause':this[_0xcd61('0xd')],'openchannelPause':this[_0xcd61('0xf')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0xcd61('0x11')],'chatCapacity':this[_0xcd61('0x12')],'chatCurrentCapacity':this[_0xcd61('0x13')],'mailStatus':this[_0xcd61('0x14')],'mailStatusTime':this[_0xcd61('0x16')],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this['faxStatus'],'faxStatusTime':this[_0xcd61('0x19')],'faxCapacity':this[_0xcd61('0x1a')],'faxCurrentCapacity':this[_0xcd61('0x1b')],'smsStatus':this[_0xcd61('0x1c')],'smsStatusTime':this['smsStatusTime'],'smsCapacity':this[_0xcd61('0x1e')],'smsCurrentCapacity':this[_0xcd61('0x3a')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0xcd61('0x1f')],'whatsappCapacity':this[_0xcd61('0x20')],'whatsappCurrentCapacity':this[_0xcd61('0x21')],'openchannelStatus':this[_0xcd61('0x22')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xcd61('0x24')],'openchannelCurrentCapacity':this[_0xcd61('0x25')],'busy':this['busy'],'busyQueue':this[_0xcd61('0x27')],'chatWaitingInteractions':this[_0xcd61('0x3b')],'faxWaitingInteractions':this['faxWaitingInteractions'],'mailWaitingInteractions':this['mailWaitingInteractions'],'openchannelWaitingInteractions':this['openchannelWaitingInteractions'],'smsWaitingInteractions':this[_0xcd61('0x3c')],'whatsappWaitingInteractions':this[_0xcd61('0x3d')]};var _0x1cb7d4=md5(JSON[_0xcd61('0x3e')](_0x5b2455));if(this['md5']!==_0x1cb7d4){this[_0xcd61('0x1')]=_0x1cb7d4;io[_0xcd61('0x3f')](_0xcd61('0x40'),_0x5b2455);}};module[_0xcd61('0x41')]=Agent; \ No newline at end of file +var _0x89a8=['smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','mailWaitingInteractions','openchannelWaitingInteractions','smsWaitingInteractions','whatsappWaitingInteractions','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','fax','sms','length','Status','StatusTime','toNumber','format','smsStatus','chatWaitingInteractions','faxWaitingInteractions','stringify','emit','user:save','lodash','md5','defaults','redis','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime'];(function(_0x43d16c,_0x2b5447){var _0x208cce=function(_0x371720){while(--_0x371720){_0x43d16c['push'](_0x43d16c['shift']());}};_0x208cce(++_0x2b5447);}(_0x89a8,0x65));var _0x889a=function(_0x3d86bf,_0x189cfa){_0x3d86bf=_0x3d86bf-0x0;var _0x40bfba=_0x89a8[_0x3d86bf];return _0x40bfba;};'use strict';var _=require(_0x889a('0x0'));var moment=require('moment');var md5=require(_0x889a('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x889a('0x2')](config[_0x889a('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x889a('0x4'))(new Redis(config['redis']));function Agent(_0x590144){this['id']=_0x590144['id']||0x0;this[_0x889a('0x5')]=_0x590144['name']||'';this[_0x889a('0x6')]=_0x590144['online']||!![];this[_0x889a('0x7')]=_0x590144[_0x889a('0x7')]||![];this[_0x889a('0x8')]=_0x590144['chatPause']||![];this[_0x889a('0x9')]=_0x590144[_0x889a('0x9')]||![];this[_0x889a('0xa')]=_0x590144[_0x889a('0xa')]||![];this[_0x889a('0xb')]=_0x590144[_0x889a('0xb')]||![];this[_0x889a('0xc')]=_0x590144[_0x889a('0xc')]||![];this[_0x889a('0xd')]=_0x889a('0xe');this[_0x889a('0xf')]=0x0;this[_0x889a('0x10')]=_0x590144[_0x889a('0x10')]||0x0;this[_0x889a('0x11')]=0x0;this[_0x889a('0x12')]=_0x889a('0xe');this[_0x889a('0x13')]=0x0;this[_0x889a('0x14')]=_0x590144['mailCapacity']||0x0;this[_0x889a('0x15')]=0x0;this[_0x889a('0x16')]='unknown';this[_0x889a('0x17')]=0x0;this[_0x889a('0x18')]=_0x590144[_0x889a('0x18')]||0x0;this[_0x889a('0x19')]=0x0;this['smsStatus']=_0x889a('0xe');this[_0x889a('0x1a')]=0x0;this[_0x889a('0x1b')]=_0x590144[_0x889a('0x1b')]||0x0;this[_0x889a('0x1c')]=0x0;this[_0x889a('0x1d')]=_0x889a('0xe');this[_0x889a('0x1e')]=0x0;this['whatsappCapacity']=_0x590144[_0x889a('0x1f')]||0x0;this[_0x889a('0x20')]=0x0;this[_0x889a('0x21')]=_0x889a('0xe');this[_0x889a('0x22')]=0x0;this[_0x889a('0x23')]=_0x590144[_0x889a('0x23')]||0x0;this['openchannelCurrentCapacity']=0x0;this[_0x889a('0x24')]=![];this[_0x889a('0x25')]=undefined;this['md5']='';this['chatWaitingInteractions']={};this['faxWaitingInteractions']={};this[_0x889a('0x26')]={};this[_0x889a('0x27')]={};this[_0x889a('0x28')]={};this[_0x889a('0x29')]={};this[_0x889a('0x2a')]();}Agent[_0x889a('0x2b')][_0x889a('0x2c')]=function(_0x48fd79){if(this[_0x48fd79+_0x889a('0x2d')]>0x0){if(this[_0x48fd79+'Capacity']>0x0&&this[_0x48fd79+_0x889a('0x2d')]>=this[_0x48fd79+_0x889a('0x2e')]){return _0x889a('0x2f');}else{return _0x889a('0x30');}}else{return _0x889a('0x31');}};Agent[_0x889a('0x2b')][_0x889a('0x2a')]=function(){var _0xbe6ac5=[_0x889a('0x32'),'chat','openchannel',_0x889a('0x33'),_0x889a('0x34'),'whatsapp'];for(var _0x3b575f=0x0;_0x3b575f<_0xbe6ac5[_0x889a('0x35')];_0x3b575f+=0x1){var _0x4fef66=this[_0x889a('0x2c')](_0xbe6ac5[_0x3b575f]);if(this[_0xbe6ac5[_0x3b575f]+_0x889a('0x36')]!==_0x4fef66){this[_0xbe6ac5[_0x3b575f]+_0x889a('0x37')]=_[_0x889a('0x38')](moment()[_0x889a('0x39')]('x'));}this[_0xbe6ac5[_0x3b575f]+_0x889a('0x36')]=_0x4fef66;}var _0x1c8be6={'id':this['id'],'name':this[_0x889a('0x5')],'online':this[_0x889a('0x6')],'voicePause':this[_0x889a('0x7')],'chatPause':this[_0x889a('0x8')],'mailPause':this[_0x889a('0x9')],'smsPause':this[_0x889a('0xb')],'faxPause':this[_0x889a('0xa')],'openchannelPause':this[_0x889a('0xc')],'chatStatus':this[_0x889a('0xd')],'chatStatusTime':this[_0x889a('0xf')],'chatCapacity':this[_0x889a('0x10')],'chatCurrentCapacity':this[_0x889a('0x11')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x889a('0x13')],'mailCapacity':this[_0x889a('0x14')],'mailCurrentCapacity':this[_0x889a('0x15')],'faxStatus':this[_0x889a('0x16')],'faxStatusTime':this[_0x889a('0x17')],'faxCapacity':this[_0x889a('0x18')],'faxCurrentCapacity':this[_0x889a('0x19')],'smsStatus':this[_0x889a('0x3a')],'smsStatusTime':this[_0x889a('0x1a')],'smsCapacity':this[_0x889a('0x1b')],'smsCurrentCapacity':this[_0x889a('0x1c')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x889a('0x1e')],'whatsappCapacity':this[_0x889a('0x1f')],'whatsappCurrentCapacity':this[_0x889a('0x20')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x889a('0x23')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x889a('0x24')],'busyQueue':this['busyQueue'],'chatWaitingInteractions':this[_0x889a('0x3b')],'faxWaitingInteractions':this[_0x889a('0x3c')],'mailWaitingInteractions':this[_0x889a('0x26')],'openchannelWaitingInteractions':this[_0x889a('0x27')],'smsWaitingInteractions':this[_0x889a('0x28')],'whatsappWaitingInteractions':this[_0x889a('0x29')]};var _0x2e99c0=md5(JSON[_0x889a('0x3d')](_0x1c8be6));if(this[_0x889a('0x1')]!==_0x2e99c0){this[_0x889a('0x1')]=_0x2e99c0;io[_0x889a('0x3e')](_0x889a('0x3f'),_0x1c8be6);}};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 a42ffbd..4c6742c 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 _0xdd24=['waiting','stringify','format','chat:queue:%s','exports','lodash','md5','redis','socket.io-emitter','name','strategy','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','chatPause','available'];(function(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0xdd24,0x1e8));var _0x4dd2=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xdd24[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x4dd2('0x0'));var md5=require(_0x4dd2('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x4dd2('0x2')]=_['defaults'](config[_0x4dd2('0x2')],{'host':'localhost','port':0x18eb});var io=require(_0x4dd2('0x3'))(new Redis(config[_0x4dd2('0x2')]));function ChatQueue(_0x3f30b3){this['id']=_0x3f30b3['id']||0x0;this['name']=_0x3f30b3[_0x4dd2('0x4')]||'';this['timeout']=_0x3f30b3['timeout']||0xa;this[_0x4dd2('0x5')]=_0x3f30b3[_0x4dd2('0x5')]||'beepall';this['Agents']=_0x3f30b3[_0x4dd2('0x6')];this[_0x4dd2('0x7')]={};this['waiting']=0x0;this[_0x4dd2('0x1')]='';this[_0x4dd2('0x8')]();this[_0x4dd2('0x9')]();}ChatQueue[_0x4dd2('0xa')][_0x4dd2('0x8')]=function(){var _0x3c018d=this['mapAgentsId'][_0x4dd2('0xb')];this[_0x4dd2('0x7')]=_['map'](this['Agents'],'id');this[_0x4dd2('0x7')]['_rr']=_0x3c018d;};ChatQueue['prototype'][_0x4dd2('0x9')]=function(){this[_0x4dd2('0xc')]=0x0;this[_0x4dd2('0xd')]=0x0;for(var _0x401767=0x0;_0x401767=0x0?this[_0x4dd2('0x11')]:0x0;var _0x5a8605={'id':this['id'],'available':this[_0x4dd2('0x11')],'loggedIn':this[_0x4dd2('0xc')],'name':this[_0x4dd2('0x4')],'paused':this[_0x4dd2('0xd')],'waiting':this[_0x4dd2('0x12')]};var _0x58bcbf=md5(JSON[_0x4dd2('0x13')](_0x5a8605));if(this[_0x4dd2('0x1')]!==_0x58bcbf){this['md5']=_0x58bcbf;io['to'](util[_0x4dd2('0x14')](_0x4dd2('0x15'),_0x5a8605['name']))['emit']('chat_queue:save',_0x5a8605);}};module[_0x4dd2('0x16')]=ChatQueue; \ No newline at end of file +var _0x12d3=['ioredis','../../../config/environment','redis','defaults','name','timeout','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','available','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5'];(function(_0x34f4e3,_0x5ea27d){var _0x4abd77=function(_0x34ba45){while(--_0x34ba45){_0x34f4e3['push'](_0x34f4e3['shift']());}};_0x4abd77(++_0x5ea27d);}(_0x12d3,0x178));var _0x312d=function(_0x48ac6a,_0x531b49){_0x48ac6a=_0x48ac6a-0x0;var _0xc4dd41=_0x12d3[_0x48ac6a];return _0xc4dd41;};'use strict';var _=require(_0x312d('0x0'));var md5=require(_0x312d('0x1'));var util=require('util');var Redis=require(_0x312d('0x2'));var config=require(_0x312d('0x3'));config[_0x312d('0x4')]=_[_0x312d('0x5')](config[_0x312d('0x4')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x312d('0x4')]));function ChatQueue(_0x5c1482){this['id']=_0x5c1482['id']||0x0;this[_0x312d('0x6')]=_0x5c1482[_0x312d('0x6')]||'';this[_0x312d('0x7')]=_0x5c1482[_0x312d('0x7')]||0xa;this['strategy']=_0x5c1482['strategy']||_0x312d('0x8');this[_0x312d('0x9')]=_0x5c1482['Agents'];this[_0x312d('0xa')]={};this[_0x312d('0xb')]=0x0;this['md5']='';this[_0x312d('0xc')]();this[_0x312d('0xd')]();}ChatQueue[_0x312d('0xe')][_0x312d('0xc')]=function(){var _0x2d7be6=this['mapAgentsId'][_0x312d('0xf')];this[_0x312d('0xa')]=_[_0x312d('0x10')](this[_0x312d('0x9')],'id');this['mapAgentsId'][_0x312d('0xf')]=_0x2d7be6;};ChatQueue[_0x312d('0xe')][_0x312d('0xd')]=function(){this[_0x312d('0x11')]=0x0;this[_0x312d('0x12')]=0x0;for(var _0x4f4677=0x0;_0x4f4677=0x0?this[_0x312d('0x14')]:0x0;var _0x49abdd={'id':this['id'],'available':this[_0x312d('0x14')],'loggedIn':this[_0x312d('0x11')],'name':this[_0x312d('0x6')],'paused':this[_0x312d('0x12')],'waiting':this[_0x312d('0xb')]};var _0x51f4a9=md5(JSON[_0x312d('0x15')](_0x49abdd));if(this[_0x312d('0x1')]!==_0x51f4a9){this['md5']=_0x51f4a9;io['to'](util[_0x312d('0x16')](_0x312d('0x17'),_0x49abdd[_0x312d('0x6')]))[_0x312d('0x18')](_0x312d('0x19'),_0x49abdd);}};module[_0x312d('0x1a')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 6f4bfeb..047bfe1 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 _0xcd5c=['loggedIn','paused','length','online','faxPause','available','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','map','updateRealtime'];(function(_0x32e47e,_0x47266e){var _0x502140=function(_0x26a098){while(--_0x26a098){_0x32e47e['push'](_0x32e47e['shift']());}};_0x502140(++_0x47266e);}(_0xcd5c,0x9c));var _0xccd5=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xcd5c[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xccd5('0x0'));var md5=require(_0xccd5('0x1'));var util=require(_0xccd5('0x2'));var Redis=require('ioredis');var config=require(_0xccd5('0x3'));config[_0xccd5('0x4')]=_[_0xccd5('0x5')](config[_0xccd5('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xccd5('0x6'))(new Redis(config[_0xccd5('0x4')]));function FaxQueue(_0x1c0865){this['id']=_0x1c0865['id']||0x0;this[_0xccd5('0x7')]=_0x1c0865['name']||'';this[_0xccd5('0x8')]=_0x1c0865['timeout']||0xa;this[_0xccd5('0x9')]=_0x1c0865['strategy']||'beepall';this[_0xccd5('0xa')]=_0x1c0865[_0xccd5('0xa')];this[_0xccd5('0xb')]={};this[_0xccd5('0xc')]=0x0;this[_0xccd5('0x1')]='';this['updateRouting']();this['updateRealtime']();}FaxQueue[_0xccd5('0xd')][_0xccd5('0xe')]=function(){var _0x24fc91=this[_0xccd5('0xb')][_0xccd5('0xf')];this[_0xccd5('0xb')]=_[_0xccd5('0x10')](this[_0xccd5('0xa')],'id');this[_0xccd5('0xb')][_0xccd5('0xf')]=_0x24fc91;};FaxQueue['prototype'][_0xccd5('0x11')]=function(){this[_0xccd5('0x12')]=0x0;this[_0xccd5('0x13')]=0x0;for(var _0x18586e=0x0;_0x18586e=0x0?this[_0xccd5('0x17')]:0x0;var _0x42de0f={'id':this['id'],'available':this[_0xccd5('0x17')],'loggedIn':this[_0xccd5('0x12')],'name':this[_0xccd5('0x7')],'paused':this[_0xccd5('0x13')],'waiting':this['waiting']};var _0x3c77b9=md5(JSON['stringify'](_0x42de0f));if(this[_0xccd5('0x1')]!==_0x3c77b9){this[_0xccd5('0x1')]=_0x3c77b9;io['to'](util[_0xccd5('0x18')](_0xccd5('0x19'),_0x42de0f[_0xccd5('0x7')]))[_0xccd5('0x1a')](_0xccd5('0x1b'),_0x42de0f);}};module[_0xccd5('0x1c')]=FaxQueue; \ No newline at end of file +var _0x7f00=['online','available','paused','format','fax:queue:%s','emit','fax_queue:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','map','prototype','updateRealtime','loggedIn','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7f00,0x146));var _0x07f0=function(_0x33314d,_0x499628){_0x33314d=_0x33314d-0x0;var _0x4ffe8e=_0x7f00[_0x33314d];return _0x4ffe8e;};'use strict';var _=require(_0x07f0('0x0'));var md5=require(_0x07f0('0x1'));var util=require('util');var Redis=require(_0x07f0('0x2'));var config=require(_0x07f0('0x3'));config[_0x07f0('0x4')]=_[_0x07f0('0x5')](config[_0x07f0('0x4')],{'host':_0x07f0('0x6'),'port':0x18eb});var io=require(_0x07f0('0x7'))(new Redis(config[_0x07f0('0x4')]));function FaxQueue(_0x486c40){this['id']=_0x486c40['id']||0x0;this[_0x07f0('0x8')]=_0x486c40[_0x07f0('0x8')]||'';this['timeout']=_0x486c40[_0x07f0('0x9')]||0xa;this['strategy']=_0x486c40[_0x07f0('0xa')]||_0x07f0('0xb');this[_0x07f0('0xc')]=_0x486c40[_0x07f0('0xc')];this[_0x07f0('0xd')]={};this[_0x07f0('0xe')]=0x0;this[_0x07f0('0x1')]='';this[_0x07f0('0xf')]();this['updateRealtime']();}FaxQueue['prototype'][_0x07f0('0xf')]=function(){var _0x5850b0=this['mapAgentsId'][_0x07f0('0x10')];this[_0x07f0('0xd')]=_[_0x07f0('0x11')](this[_0x07f0('0xc')],'id');this[_0x07f0('0xd')][_0x07f0('0x10')]=_0x5850b0;};FaxQueue[_0x07f0('0x12')][_0x07f0('0x13')]=function(){this[_0x07f0('0x14')]=0x0;this['paused']=0x0;for(var _0x178e33=0x0;_0x178e33=0x0?this['available']:0x0;var _0x2d0084={'id':this['id'],'available':this[_0x07f0('0x17')],'loggedIn':this['loggedIn'],'name':this[_0x07f0('0x8')],'paused':this[_0x07f0('0x18')],'waiting':this[_0x07f0('0xe')]};var _0x58d8d1=md5(JSON['stringify'](_0x2d0084));if(this[_0x07f0('0x1')]!==_0x58d8d1){this[_0x07f0('0x1')]=_0x58d8d1;io['to'](util[_0x07f0('0x19')](_0x07f0('0x1a'),_0x2d0084[_0x07f0('0x8')]))[_0x07f0('0x1b')](_0x07f0('0x1c'),_0x2d0084);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 59c2601..a169b7f 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 _0xab18=['exports','name'];(function(_0x36003e,_0x58b5bb){var _0x5bbadc=function(_0x54ad57){while(--_0x54ad57){_0x36003e['push'](_0x36003e['shift']());}};_0x5bbadc(++_0x58b5bb);}(_0xab18,0x111));var _0x8ab1=function(_0x4cd07c,_0x4474f1){_0x4cd07c=_0x4cd07c-0x0;var _0x4907a7=_0xab18[_0x4cd07c];return _0x4907a7;};'use strict';function Interval(_0x13070a){this['id']=_0x13070a['id']||0x0;this[_0x8ab1('0x0')]=_0x13070a['name']||'';this['Intervals']=_0x13070a['Intervals']||{};}module[_0x8ab1('0x1')]=Interval; \ No newline at end of file +var _0x093c=['name','Intervals','exports'];(function(_0x2ff7c6,_0x56bd3d){var _0x3f9e41=function(_0x4677f8){while(--_0x4677f8){_0x2ff7c6['push'](_0x2ff7c6['shift']());}};_0x3f9e41(++_0x56bd3d);}(_0x093c,0x72));var _0xc093=function(_0x2cdf5b,_0xd7fc9e){_0x2cdf5b=_0x2cdf5b-0x0;var _0x393369=_0x093c[_0x2cdf5b];return _0x393369;};'use strict';function Interval(_0x4bb09e){this['id']=_0x4bb09e['id']||0x0;this[_0xc093('0x0')]=_0x4bb09e['name']||'';this[_0xc093('0x1')]=_0x4bb09e[_0xc093('0x1')]||{};}module[_0xc093('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 1df2209..04a6e9c 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 _0x0c30=['updateRouting','_rr','map','loggedIn','paused','length','online','mailPause','available','stringify','md5','format','mail:queue:%s','emit','mail_queue:save','lodash','ioredis','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','Agents','mapAgentsId','waiting','prototype'];(function(_0x32a767,_0x4e3e76){var _0x2b4e6d=function(_0x5e0702){while(--_0x5e0702){_0x32a767['push'](_0x32a767['shift']());}};_0x2b4e6d(++_0x4e3e76);}(_0x0c30,0x127));var _0x00c3=function(_0x23ec06,_0x561142){_0x23ec06=_0x23ec06-0x0;var _0x2831d4=_0x0c30[_0x23ec06];return _0x2831d4;};'use strict';var _=require(_0x00c3('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0x00c3('0x1'));var config=require(_0x00c3('0x2'));config['redis']=_[_0x00c3('0x3')](config[_0x00c3('0x4')],{'host':_0x00c3('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x00c3('0x4')]));function MailQueue(_0x4ee158){this['id']=_0x4ee158['id']||0x0;this[_0x00c3('0x6')]=_0x4ee158[_0x00c3('0x6')]||'';this['timeout']=_0x4ee158[_0x00c3('0x7')]||0xa;this['strategy']=_0x4ee158[_0x00c3('0x8')]||'beepall';this[_0x00c3('0x9')]=_0x4ee158['Agents'];this[_0x00c3('0xa')]={};this[_0x00c3('0xb')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0x00c3('0xc')][_0x00c3('0xd')]=function(){var _0x140165=this['mapAgentsId'][_0x00c3('0xe')];this[_0x00c3('0xa')]=_[_0x00c3('0xf')](this[_0x00c3('0x9')],'id');this['mapAgentsId']['_rr']=_0x140165;};MailQueue[_0x00c3('0xc')]['updateRealtime']=function(){this[_0x00c3('0x10')]=0x0;this[_0x00c3('0x11')]=0x0;for(var _0x5daea9=0x0;_0x5daea9=0x0?this[_0x00c3('0x15')]:0x0;var _0x98d665={'id':this['id'],'available':this[_0x00c3('0x15')],'loggedIn':this[_0x00c3('0x10')],'name':this[_0x00c3('0x6')],'paused':this[_0x00c3('0x11')],'waiting':this[_0x00c3('0xb')]};var _0x15aee9=md5(JSON[_0x00c3('0x16')](_0x98d665));if(this[_0x00c3('0x17')]!==_0x15aee9){this['md5']=_0x15aee9;io['to'](util[_0x00c3('0x18')](_0x00c3('0x19'),_0x98d665[_0x00c3('0x6')]))[_0x00c3('0x1a')](_0x00c3('0x1b'),_0x98d665);}};module['exports']=MailQueue; \ No newline at end of file +var _0xbc10=['util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','map','_rr','paused','length','online','loggedIn','mailPause','available','stringify','format','emit','lodash','md5'];(function(_0x1a946e,_0x14d21a){var _0x1cf702=function(_0x251b78){while(--_0x251b78){_0x1a946e['push'](_0x1a946e['shift']());}};_0x1cf702(++_0x14d21a);}(_0xbc10,0x76));var _0x0bc1=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xbc10[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0x0bc1('0x0'));var md5=require(_0x0bc1('0x1'));var util=require(_0x0bc1('0x2'));var Redis=require(_0x0bc1('0x3'));var config=require(_0x0bc1('0x4'));config[_0x0bc1('0x5')]=_[_0x0bc1('0x6')](config[_0x0bc1('0x5')],{'host':_0x0bc1('0x7'),'port':0x18eb});var io=require(_0x0bc1('0x8'))(new Redis(config['redis']));function MailQueue(_0x4aac26){this['id']=_0x4aac26['id']||0x0;this['name']=_0x4aac26[_0x0bc1('0x9')]||'';this[_0x0bc1('0xa')]=_0x4aac26[_0x0bc1('0xa')]||0xa;this[_0x0bc1('0xb')]=_0x4aac26['strategy']||_0x0bc1('0xc');this['Agents']=_0x4aac26[_0x0bc1('0xd')];this['mapAgentsId']={};this[_0x0bc1('0xe')]=0x0;this[_0x0bc1('0x1')]='';this[_0x0bc1('0xf')]();this[_0x0bc1('0x10')]();}MailQueue[_0x0bc1('0x11')][_0x0bc1('0xf')]=function(){var _0x12cd9c=this[_0x0bc1('0x12')]['_rr'];this[_0x0bc1('0x12')]=_[_0x0bc1('0x13')](this[_0x0bc1('0xd')],'id');this[_0x0bc1('0x12')][_0x0bc1('0x14')]=_0x12cd9c;};MailQueue[_0x0bc1('0x11')][_0x0bc1('0x10')]=function(){this['loggedIn']=0x0;this[_0x0bc1('0x15')]=0x0;for(var _0xbb9a9b=0x0;_0xbb9a9b=0x0?this[_0x0bc1('0x1a')]:0x0;var _0x21250f={'id':this['id'],'available':this[_0x0bc1('0x1a')],'loggedIn':this[_0x0bc1('0x18')],'name':this[_0x0bc1('0x9')],'paused':this[_0x0bc1('0x15')],'waiting':this[_0x0bc1('0xe')]};var _0x59b05b=md5(JSON[_0x0bc1('0x1b')](_0x21250f));if(this['md5']!==_0x59b05b){this[_0x0bc1('0x1')]=_0x59b05b;io['to'](util[_0x0bc1('0x1c')]('mail:queue:%s',_0x21250f[_0x0bc1('0x9')]))[_0x0bc1('0x1d')]('mail_queue:save',_0x21250f);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index cde677b..cb8bacf 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 _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x5d80de,_0x2cf15d){var _0x1c7556=function(_0x5bd806){while(--_0x5bd806){_0x5d80de['push'](_0x5d80de['shift']());}};_0x1c7556(++_0x2cf15d);}(_0x7a54,0x106));var _0x47a5=function(_0x270d6c,_0x20e37d){_0x270d6c=_0x270d6c-0x0;var _0x14e1ee=_0x7a54[_0x270d6c];return _0x14e1ee;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0xc4aa=['strategy','Agents','mapAgentsId','updateRouting','updateRealtime','map','_rr','prototype','loggedIn','paused','length','online','available','waiting','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout'];(function(_0x2642cb,_0x4b917f){var _0xe6e41=function(_0x281676){while(--_0x281676){_0x2642cb['push'](_0x2642cb['shift']());}};_0xe6e41(++_0x4b917f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xc4aa[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xac4a('0x0'));var md5=require(_0xac4a('0x1'));var util=require(_0xac4a('0x2'));var Redis=require(_0xac4a('0x3'));var config=require(_0xac4a('0x4'));config[_0xac4a('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xac4a('0x6'))(new Redis(config[_0xac4a('0x5')]));function OpenchannelQueue(_0x730a38){this['id']=_0x730a38['id']||0x0;this[_0xac4a('0x7')]=_0x730a38[_0xac4a('0x7')]||'';this[_0xac4a('0x8')]=_0x730a38[_0xac4a('0x8')]||0xa;this[_0xac4a('0x9')]=_0x730a38['strategy']||'beepall';this[_0xac4a('0xa')]=_0x730a38[_0xac4a('0xa')];this[_0xac4a('0xb')]={};this['waiting']=0x0;this[_0xac4a('0x1')]='';this[_0xac4a('0xc')]();this[_0xac4a('0xd')]();}OpenchannelQueue['prototype'][_0xac4a('0xc')]=function(){var _0x488e3c=this[_0xac4a('0xb')]['_rr'];this[_0xac4a('0xb')]=_[_0xac4a('0xe')](this[_0xac4a('0xa')],'id');this['mapAgentsId'][_0xac4a('0xf')]=_0x488e3c;};OpenchannelQueue[_0xac4a('0x10')][_0xac4a('0xd')]=function(){this[_0xac4a('0x11')]=0x0;this[_0xac4a('0x12')]=0x0;for(var _0x3b71c0=0x0;_0x3b71c0=0x0?this[_0xac4a('0x15')]:0x0;var _0x44ec59={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0xac4a('0x7')],'paused':this[_0xac4a('0x12')],'waiting':this[_0xac4a('0x16')]};var _0x4d837c=md5(JSON[_0xac4a('0x17')](_0x44ec59));if(this[_0xac4a('0x1')]!==_0x4d837c){this[_0xac4a('0x1')]=_0x4d837c;io['to'](util[_0xac4a('0x18')](_0xac4a('0x19'),_0x44ec59[_0xac4a('0x7')]))[_0xac4a('0x1a')](_0xac4a('0x1b'),_0x44ec59);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index bd0cc99..d1f2fca 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 _0x01fe=['defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRouting','updateRealtime','mapAgentsId','_rr','map','prototype','loggedIn','paused','length','online','available','stringify','md5','sms:queue:%s','emit','sms_queue:save','exports','lodash','util','ioredis'];(function(_0x1c0e1a,_0x361353){var _0x46840d=function(_0x460250){while(--_0x460250){_0x1c0e1a['push'](_0x1c0e1a['shift']());}};_0x46840d(++_0x361353);}(_0x01fe,0x102));var _0xe01f=function(_0x193ed0,_0x3f2aa1){_0x193ed0=_0x193ed0-0x0;var _0x46ea4b=_0x01fe[_0x193ed0];return _0x46ea4b;};'use strict';var _=require(_0xe01f('0x0'));var md5=require('md5');var util=require(_0xe01f('0x1'));var Redis=require(_0xe01f('0x2'));var config=require('../../../config/environment');config['redis']=_[_0xe01f('0x3')](config[_0xe01f('0x4')],{'host':_0xe01f('0x5'),'port':0x18eb});var io=require(_0xe01f('0x6'))(new Redis(config['redis']));function SmsQueue(_0x14340f){this['id']=_0x14340f['id']||0x0;this['name']=_0x14340f[_0xe01f('0x7')]||'';this[_0xe01f('0x8')]=_0x14340f[_0xe01f('0x8')]||0xa;this[_0xe01f('0x9')]=_0x14340f[_0xe01f('0x9')]||'beepall';this[_0xe01f('0xa')]=_0x14340f[_0xe01f('0xa')];this['mapAgentsId']={};this[_0xe01f('0xb')]=0x0;this['md5']='';this[_0xe01f('0xc')]();this[_0xe01f('0xd')]();}SmsQueue['prototype'][_0xe01f('0xc')]=function(){var _0x4f409c=this[_0xe01f('0xe')][_0xe01f('0xf')];this[_0xe01f('0xe')]=_[_0xe01f('0x10')](this[_0xe01f('0xa')],'id');this[_0xe01f('0xe')][_0xe01f('0xf')]=_0x4f409c;};SmsQueue[_0xe01f('0x11')]['updateRealtime']=function(){this[_0xe01f('0x12')]=0x0;this[_0xe01f('0x13')]=0x0;for(var _0x2d55c8=0x0;_0x2d55c8=0x0?this[_0xe01f('0x16')]:0x0;var _0x26cd4d={'id':this['id'],'available':this[_0xe01f('0x16')],'loggedIn':this[_0xe01f('0x12')],'name':this['name'],'paused':this[_0xe01f('0x13')],'waiting':this['waiting']};var _0x948cfa=md5(JSON[_0xe01f('0x17')](_0x26cd4d));if(this[_0xe01f('0x18')]!==_0x948cfa){this[_0xe01f('0x18')]=_0x948cfa;io['to'](util['format'](_0xe01f('0x19'),_0x26cd4d[_0xe01f('0x7')]))[_0xe01f('0x1a')](_0xe01f('0x1b'),_0x26cd4d);}};module[_0xe01f('0x1c')]=SmsQueue; \ No newline at end of file +var _0xfa2f=['loggedIn','smsPause','paused','available','stringify','format','sms:queue:%s','sms_queue:save','util','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','_rr','map','prototype','length','online'];(function(_0x1c7b5f,_0x192c73){var _0x3df0cf=function(_0x10b782){while(--_0x10b782){_0x1c7b5f['push'](_0x1c7b5f['shift']());}};_0x3df0cf(++_0x192c73);}(_0xfa2f,0xe8));var _0xffa2=function(_0x206b08,_0x8cebf2){_0x206b08=_0x206b08-0x0;var _0x51cfea=_0xfa2f[_0x206b08];return _0x51cfea;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xffa2('0x0'));var Redis=require('ioredis');var config=require(_0xffa2('0x1'));config[_0xffa2('0x2')]=_[_0xffa2('0x3')](config['redis'],{'host':_0xffa2('0x4'),'port':0x18eb});var io=require(_0xffa2('0x5'))(new Redis(config[_0xffa2('0x2')]));function SmsQueue(_0x14787c){this['id']=_0x14787c['id']||0x0;this[_0xffa2('0x6')]=_0x14787c[_0xffa2('0x6')]||'';this[_0xffa2('0x7')]=_0x14787c['timeout']||0xa;this['strategy']=_0x14787c[_0xffa2('0x8')]||_0xffa2('0x9');this[_0xffa2('0xa')]=_0x14787c[_0xffa2('0xa')];this[_0xffa2('0xb')]={};this[_0xffa2('0xc')]=0x0;this[_0xffa2('0xd')]='';this['updateRouting']();this[_0xffa2('0xe')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x2eb5bb=this[_0xffa2('0xb')][_0xffa2('0xf')];this[_0xffa2('0xb')]=_[_0xffa2('0x10')](this['Agents'],'id');this[_0xffa2('0xb')][_0xffa2('0xf')]=_0x2eb5bb;};SmsQueue[_0xffa2('0x11')][_0xffa2('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x32e54e=0x0;_0x32e54e=0x0?this[_0xffa2('0x17')]:0x0;var _0x2ae03f={'id':this['id'],'available':this[_0xffa2('0x17')],'loggedIn':this[_0xffa2('0x14')],'name':this[_0xffa2('0x6')],'paused':this[_0xffa2('0x16')],'waiting':this[_0xffa2('0xc')]};var _0xc10cfb=md5(JSON[_0xffa2('0x18')](_0x2ae03f));if(this[_0xffa2('0xd')]!==_0xc10cfb){this['md5']=_0xc10cfb;io['to'](util[_0xffa2('0x19')](_0xffa2('0x1a'),_0x2ae03f[_0xffa2('0x6')]))['emit'](_0xffa2('0x1b'),_0x2ae03f);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index bb2b904..c463c50 100644 --- a/server/services/routing/model/whatsappQueue.js +++ b/server/services/routing/model/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8351=['socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','_rr','updateRealtime','loggedIn','paused','length','online','available','waiting','stringify','emit','whatsapp_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x8351,0x19d));var _0x1835=function(_0x26c457,_0x3e9e8e){_0x26c457=_0x26c457-0x0;var _0x5a0079=_0x8351[_0x26c457];return _0x5a0079;};'use strict';var _=require('lodash');var md5=require(_0x1835('0x0'));var util=require(_0x1835('0x1'));var Redis=require(_0x1835('0x2'));var config=require(_0x1835('0x3'));config[_0x1835('0x4')]=_[_0x1835('0x5')](config['redis'],{'host':_0x1835('0x6'),'port':0x18eb});var io=require(_0x1835('0x7'))(new Redis(config[_0x1835('0x4')]));function WhatsappQueue(_0x26028e){this['id']=_0x26028e['id']||0x0;this[_0x1835('0x8')]=_0x26028e[_0x1835('0x8')]||'';this[_0x1835('0x9')]=_0x26028e['timeout']||0xa;this[_0x1835('0xa')]=_0x26028e[_0x1835('0xa')]||_0x1835('0xb');this[_0x1835('0xc')]=_0x26028e[_0x1835('0xc')];this[_0x1835('0xd')]={};this['waiting']=0x0;this[_0x1835('0x0')]='';this[_0x1835('0xe')]();this['updateRealtime']();}WhatsappQueue[_0x1835('0xf')]['updateRouting']=function(){var _0x3b4ee5=this['mapAgentsId']['_rr'];this['mapAgentsId']=_['map'](this[_0x1835('0xc')],'id');this[_0x1835('0xd')][_0x1835('0x10')]=_0x3b4ee5;};WhatsappQueue['prototype'][_0x1835('0x11')]=function(){this[_0x1835('0x12')]=0x0;this[_0x1835('0x13')]=0x0;for(var _0x1fea38=0x0;_0x1fea38=0x0?this[_0x1835('0x16')]:0x0;var _0x2461fb={'id':this['id'],'available':this['available'],'loggedIn':this[_0x1835('0x12')],'name':this[_0x1835('0x8')],'paused':this['paused'],'waiting':this[_0x1835('0x17')]};var _0x310150=md5(JSON[_0x1835('0x18')](_0x2461fb));if(this[_0x1835('0x0')]!==_0x310150){this[_0x1835('0x0')]=_0x310150;io['to'](util['format']('whatsapp:queue:%s',_0x2461fb[_0x1835('0x8')]))[_0x1835('0x19')](_0x1835('0x1a'),_0x2461fb);}};module[_0x1835('0x1b')]=WhatsappQueue; \ No newline at end of file +var _0x9e6d=['format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','Agents','waiting','md5','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','loggedIn','paused','online','whatsappPause','available','stringify'];(function(_0x538771,_0x4f7ae5){var _0x747cd0=function(_0x375558){while(--_0x375558){_0x538771['push'](_0x538771['shift']());}};_0x747cd0(++_0x4f7ae5);}(_0x9e6d,0x11d));var _0xd9e6=function(_0x1d0cfa,_0x52607b){_0x1d0cfa=_0x1d0cfa-0x0;var _0x1f31be=_0x9e6d[_0x1d0cfa];return _0x1f31be;};'use strict';var _=require(_0xd9e6('0x0'));var md5=require('md5');var util=require('util');var Redis=require(_0xd9e6('0x1'));var config=require(_0xd9e6('0x2'));config[_0xd9e6('0x3')]=_[_0xd9e6('0x4')](config[_0xd9e6('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xd9e6('0x5'))(new Redis(config[_0xd9e6('0x3')]));function WhatsappQueue(_0x3d6f6e){this['id']=_0x3d6f6e['id']||0x0;this[_0xd9e6('0x6')]=_0x3d6f6e[_0xd9e6('0x6')]||'';this['timeout']=_0x3d6f6e[_0xd9e6('0x7')]||0xa;this[_0xd9e6('0x8')]=_0x3d6f6e[_0xd9e6('0x8')]||'beepall';this[_0xd9e6('0x9')]=_0x3d6f6e[_0xd9e6('0x9')];this['mapAgentsId']={};this[_0xd9e6('0xa')]=0x0;this[_0xd9e6('0xb')]='';this['updateRouting']();this[_0xd9e6('0xc')]();}WhatsappQueue[_0xd9e6('0xd')][_0xd9e6('0xe')]=function(){var _0x3bf863=this[_0xd9e6('0xf')]['_rr'];this[_0xd9e6('0xf')]=_['map'](this['Agents'],'id');this[_0xd9e6('0xf')][_0xd9e6('0x10')]=_0x3bf863;};WhatsappQueue[_0xd9e6('0xd')][_0xd9e6('0xc')]=function(){this[_0xd9e6('0x11')]=0x0;this[_0xd9e6('0x12')]=0x0;for(var _0xee4378=0x0;_0xee4378=0x0?this[_0xd9e6('0x15')]:0x0;var _0x5a590f={'id':this['id'],'available':this[_0xd9e6('0x15')],'loggedIn':this[_0xd9e6('0x11')],'name':this[_0xd9e6('0x6')],'paused':this['paused'],'waiting':this[_0xd9e6('0xa')]};var _0x27ef3b=md5(JSON[_0xd9e6('0x16')](_0x5a590f));if(this['md5']!==_0x27ef3b){this[_0xd9e6('0xb')]=_0x27ef3b;io['to'](util[_0xd9e6('0x17')](_0xd9e6('0x18'),_0x5a590f[_0xd9e6('0x6')]))[_0xd9e6('0x19')](_0xd9e6('0x1a'),_0x5a590f);}};module[_0xd9e6('0x1b')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 0471911..227996d 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 _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xb10b=['faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','isUndefined','initIntervals','length','initOpenchannelQueues','updateRealtime','initChatQueues','chatQueues','initSmsQueues','updateRouting','initMailQueues','initFaxQueues','initWhatsappQueues','exports','bluebird','lodash','moment','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','smsQueues','mailQueues'];(function(_0x3e4912,_0x56327b){var _0x281f7b=function(_0x337314){while(--_0x337314){_0x3e4912['push'](_0x3e4912['shift']());}};_0x281f7b(++_0x56327b);}(_0xb10b,0x12a));var _0xbb10=function(_0x5b9d3a,_0x1f1842){_0x5b9d3a=_0x5b9d3a-0x0;var _0x383375=_0xb10b[_0x5b9d3a];return _0x383375;};'use strict';var BPromise=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var Agent=require(_0xbb10('0x3'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0xbb10('0x4'));var ChatQueue=require(_0xbb10('0x5'));var SmsQueue=require(_0xbb10('0x6'));var MailQueue=require(_0xbb10('0x7'));var FaxQueue=require(_0xbb10('0x8'));var WhatsappQueue=require(_0xbb10('0x9'));var Realtime=function(){this['agents']={};this[_0xbb10('0xa')]={};this[_0xbb10('0xb')]={};this['chatQueues']={};this[_0xbb10('0xc')]={};this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]={};this[_0xbb10('0xf')]={};this[_0xbb10('0x10')]={};this[_0xbb10('0x11')]={};this[_0xbb10('0x12')]={};this[_0xbb10('0x13')]={};this['faxQueuesWaitingInteractions']={};this['whatsappQueuesWaitingInteractions']={};};function freeIsNotKey(_0x20bd61,_0x118a74,_0xce64f3){var _0x5e136d=_[_0xbb10('0x14')](_0x20bd61,function(_0x5be7e0,_0x44fb19){return _0x5be7e0[_0xce64f3];});for(var _0x916a32 in _0x118a74){if(_0x118a74[_0xbb10('0x15')](_0x916a32)){if(!_0x5e136d[_0x916a32]){delete _0x118a74[_0x916a32];}}}}Realtime[_0xbb10('0x16')][_0xbb10('0x17')]=function(_0x147230,_0x58a612){for(var _0x26e021 in _0x58a612){if(_0x147230[_0xbb10('0x15')](_0x26e021)){_0x147230[_0x26e021]=_0x58a612[_0x26e021];}}};Realtime[_0xbb10('0x16')][_0xbb10('0x18')]=function(){var _0x3df17b=this;return function(_0x2f2ebf){if(_0x2f2ebf){freeIsNotKey(_0x2f2ebf,_0x3df17b[_0xbb10('0x19')],'id');for(var _0x36b5e8=0x0,_0x3e26f4={},_0x2b184e={};_0x36b5e8<_0x2f2ebf['length'];_0x36b5e8+=0x1){_0x3e26f4=_0x2f2ebf[_0x36b5e8];if(_[_0xbb10('0x1a')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']])){_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']]=new Agent(_0x3e26f4);}else{_0x3df17b[_0xbb10('0x17')](_0x3df17b[_0xbb10('0x19')][_0x3e26f4['id']],_0x3e26f4);}}}return _0x3df17b[_0xbb10('0x19')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x1b')]=function(){var _0xbf2906=this;return function(_0xe1c665){if(_0xe1c665){freeIsNotKey(_0xe1c665,_0xbf2906['intervals'],'id');for(var _0x5ff0cf=0x0,_0x19f48d={},_0x388fab={};_0x5ff0cf<_0xe1c665[_0xbb10('0x1c')];_0x5ff0cf+=0x1){_0x19f48d=_0xe1c665[_0x5ff0cf];if(_[_0xbb10('0x1a')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']])){_0xbf2906['intervals'][_0x19f48d['id']]=new Interval(_0x19f48d);}else{_0xbf2906[_0xbb10('0x17')](_0xbf2906[_0xbb10('0xa')][_0x19f48d['id']],_0x19f48d);}}}return _0xbf2906['intervals'];};};Realtime['prototype'][_0xbb10('0x1d')]=function(){var _0x311abe=this;return function(_0x2e911d){if(_0x2e911d){freeIsNotKey(_0x2e911d,_0x311abe[_0xbb10('0xb')],'id');for(var _0x445761=0x0,_0x1824b7={},_0x407cb4={};_0x445761<_0x2e911d[_0xbb10('0x1c')];_0x445761+=0x1){_0x1824b7=_0x2e911d[_0x445761];if(_[_0xbb10('0x1a')](_0x311abe[_0xbb10('0xb')][_0x1824b7['id']])){_0x311abe[_0xbb10('0xb')][_0x1824b7['id']]=new OpenchannelQueue(_0x1824b7);}else{_0x311abe[_0xbb10('0x17')](_0x311abe['openchannelQueues'][_0x1824b7['id']],_0x1824b7);}_0x311abe['openchannelQueues'][_0x1824b7['id']]['updateRouting']();_0x311abe[_0xbb10('0xb')][_0x1824b7['id']][_0xbb10('0x1e')]();}}return _0x311abe[_0xbb10('0xb')];};};Realtime['prototype'][_0xbb10('0x1f')]=function(){var _0x24d586=this;return function(_0x6ed43b){if(_0x6ed43b){freeIsNotKey(_0x6ed43b,_0x24d586[_0xbb10('0x20')],'id');for(var _0x1acce9=0x0,_0x20d946={},_0x2a0e8b={};_0x1acce9<_0x6ed43b['length'];_0x1acce9+=0x1){_0x20d946=_0x6ed43b[_0x1acce9];if(_[_0xbb10('0x1a')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']])){_0x24d586[_0xbb10('0x20')][_0x20d946['id']]=new ChatQueue(_0x20d946);}else{_0x24d586[_0xbb10('0x17')](_0x24d586[_0xbb10('0x20')][_0x20d946['id']],_0x20d946);}_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRouting']();_0x24d586[_0xbb10('0x20')][_0x20d946['id']]['updateRealtime']();}}return _0x24d586[_0xbb10('0x20')];};};Realtime['prototype'][_0xbb10('0x21')]=function(){var _0x1dcc9c=this;return function(_0x1b59f9){if(_0x1b59f9){freeIsNotKey(_0x1b59f9,_0x1dcc9c['smsQueues'],'id');for(var _0x518d47=0x0,_0x4c3744={},_0x34f65e={};_0x518d47<_0x1b59f9['length'];_0x518d47+=0x1){_0x4c3744=_0x1b59f9[_0x518d47];if(_[_0xbb10('0x1a')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']])){_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']]=new SmsQueue(_0x4c3744);}else{_0x1dcc9c[_0xbb10('0x17')](_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']],_0x4c3744);}_0x1dcc9c[_0xbb10('0xc')][_0x4c3744['id']][_0xbb10('0x22')]();_0x1dcc9c['smsQueues'][_0x4c3744['id']][_0xbb10('0x1e')]();}}return _0x1dcc9c[_0xbb10('0xc')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x23')]=function(){var _0xfb2c5e=this;return function(_0x9de708){if(_0x9de708){freeIsNotKey(_0x9de708,_0xfb2c5e[_0xbb10('0xd')],'id');for(var _0x10202c=0x0,_0x3c8d7d={},_0x56943c={};_0x10202c<_0x9de708[_0xbb10('0x1c')];_0x10202c+=0x1){_0x3c8d7d=_0x9de708[_0x10202c];if(_[_0xbb10('0x1a')](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']])){_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']]=new MailQueue(_0x3c8d7d);}else{_0xfb2c5e['mergeFromDatabase'](_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']],_0x3c8d7d);}_0xfb2c5e['mailQueues'][_0x3c8d7d['id']]['updateRouting']();_0xfb2c5e[_0xbb10('0xd')][_0x3c8d7d['id']][_0xbb10('0x1e')]();}}return _0xfb2c5e[_0xbb10('0xd')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x24')]=function(){var _0x29d11a=this;return function(_0x547062){if(_0x547062){freeIsNotKey(_0x547062,_0x29d11a[_0xbb10('0xe')],'id');for(var _0x25d72f=0x0,_0x52de31={},_0x5e3fbd={};_0x25d72f<_0x547062['length'];_0x25d72f+=0x1){_0x52de31=_0x547062[_0x25d72f];if(_[_0xbb10('0x1a')](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']])){_0x29d11a[_0xbb10('0xe')][_0x52de31['id']]=new FaxQueue(_0x52de31);}else{_0x29d11a['mergeFromDatabase'](_0x29d11a[_0xbb10('0xe')][_0x52de31['id']],_0x52de31);}_0x29d11a[_0xbb10('0xe')][_0x52de31['id']][_0xbb10('0x22')]();_0x29d11a['faxQueues'][_0x52de31['id']][_0xbb10('0x1e')]();}}return _0x29d11a[_0xbb10('0xe')];};};Realtime[_0xbb10('0x16')][_0xbb10('0x25')]=function(){var _0x4f1cdd=this;return function(_0xd238e9){if(_0xd238e9){freeIsNotKey(_0xd238e9,_0x4f1cdd[_0xbb10('0xf')],'id');for(var _0x5835fd=0x0,_0xe2040f={},_0x2e3214={};_0x5835fd<_0xd238e9[_0xbb10('0x1c')];_0x5835fd+=0x1){_0xe2040f=_0xd238e9[_0x5835fd];if(_[_0xbb10('0x1a')](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']])){_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]=new WhatsappQueue(_0xe2040f);}else{_0x4f1cdd['mergeFromDatabase'](_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']],_0xe2040f);}_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']][_0xbb10('0x22')]();_0x4f1cdd[_0xbb10('0xf')][_0xe2040f['id']]['updateRealtime']();}}return _0x4f1cdd[_0xbb10('0xf')];};};module[_0xbb10('0x26')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 5854942..ccfe516 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 _0x3ccf=['addTagsToChatInteraction','../client','Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction'];(function(_0x4182ba,_0x47372e){var _0x288f8c=function(_0x1e2095){while(--_0x1e2095){_0x4182ba['push'](_0x4182ba['shift']());}};_0x288f8c(++_0x47372e);}(_0x3ccf,0x104));var _0xf3cc=function(_0x450d62,_0x43bda4){_0x450d62=_0x450d62-0x0;var _0x39d501=_0x3ccf[_0x450d62];return _0x39d501;};'use strict';var client=require(_0xf3cc('0x0'));exports['update']=function(_0x1b8ed3,_0x3d5332){return client[_0xf3cc('0x1')](_0xf3cc('0x2'),{'body':_0x3d5332,'options':{'where':{'id':_0x1b8ed3}},'log':_0xf3cc('0x3')});};exports[_0xf3cc('0x4')]=function(_0x58110a,_0x1f45c9){return client[_0xf3cc('0x1')](_0xf3cc('0x5'),{'body':_0x1f45c9,'options':{'where':{'id':_0x58110a}},'log':_0xf3cc('0x6')});}; \ No newline at end of file +var _0x380a=['addTagsToChatInteraction','../client','update','Request','addTags','AddTagsToChatInteraction'];(function(_0x3e478c,_0x152670){var _0x29ef89=function(_0x3d0d77){while(--_0x3d0d77){_0x3e478c['push'](_0x3e478c['shift']());}};_0x29ef89(++_0x152670);}(_0x380a,0x14b));var _0xa380=function(_0x220720,_0x10d6b4){_0x220720=_0x220720-0x0;var _0x20f9a7=_0x380a[_0x220720];return _0x20f9a7;};'use strict';var client=require(_0xa380('0x0'));exports[_0xa380('0x1')]=function(_0x2fc041,_0x3f4867){return client[_0xa380('0x2')]('UpdateChatInteraction',{'body':_0x3f4867,'options':{'where':{'id':_0x2fc041}},'log':'updateChatInteraction'});};exports[_0xa380('0x3')]=function(_0xd13ccb,_0x2b5c51){return client[_0xa380('0x2')](_0xa380('0x4'),{'body':_0x2b5c51,'options':{'where':{'id':_0xd13ccb}},'log':_0xa380('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 2cad043..af00272 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 _0xa129=['../client','create','CreateChatMessage','createChatMessage'];(function(_0x2b3f32,_0x539d64){var _0x1a4335=function(_0x2812e7){while(--_0x2812e7){_0x2b3f32['push'](_0x2b3f32['shift']());}};_0x1a4335(++_0x539d64);}(_0xa129,0x1f4));var _0x9a12=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa129[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x9a12('0x0'));exports[_0x9a12('0x1')]=function(_0xc9287a){return client['Request'](_0x9a12('0x2'),{'body':_0xc9287a,'log':_0x9a12('0x3')});}; \ No newline at end of file +var _0x1514=['Request','CreateChatMessage'];(function(_0x5906af,_0x587e48){var _0x165d8b=function(_0x57c117){while(--_0x57c117){_0x5906af['push'](_0x5906af['shift']());}};_0x165d8b(++_0x587e48);}(_0x1514,0x72));var _0x4151=function(_0x3b1398,_0x1cf2c9){_0x3b1398=_0x3b1398-0x0;var _0x336d1a=_0x1514[_0x3b1398];return _0x336d1a;};'use strict';var client=require('../client');exports['create']=function(_0x2f4b70){return client[_0x4151('0x0')](_0x4151('0x1'),{'body':_0x2f4b70,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 12b302c..faeb427 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 _0xdf98=['strategy','User','Agents','name','online','chatPause','getChatQueues','../client','Request','timeout'];(function(_0x2d7daa,_0x3698e0){var _0x119a17=function(_0x4f717a){while(--_0x4f717a){_0x2d7daa['push'](_0x2d7daa['shift']());}};_0x119a17(++_0x3698e0);}(_0xdf98,0xcf));var _0x8df9=function(_0x5650d7,_0x51f443){_0x5650d7=_0x5650d7-0x0;var _0x42431d=_0xdf98[_0x5650d7];return _0x42431d;};'use strict';var client=require(_0x8df9('0x0'));exports['getChatQueues']=function(){return function(){return client[_0x8df9('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id','name',_0x8df9('0x2'),_0x8df9('0x3')],'include':[{'model':_0x8df9('0x4'),'as':_0x8df9('0x5'),'attributes':['id',_0x8df9('0x6'),_0x8df9('0x7'),_0x8df9('0x8')]}]},'log':_0x8df9('0x9')});};}; \ No newline at end of file +var _0xf9d5=['Agents','online','getChatQueues','Request','name','timeout','strategy','User'];(function(_0x38f70,_0x47a0f6){var _0x81fa37=function(_0x340f57){while(--_0x340f57){_0x38f70['push'](_0x38f70['shift']());}};_0x81fa37(++_0x47a0f6);}(_0xf9d5,0x122));var _0x5f9d=function(_0x3ebeca,_0x349ec2){_0x3ebeca=_0x3ebeca-0x0;var _0xd86f9e=_0xf9d5[_0x3ebeca];return _0xd86f9e;};'use strict';var client=require('../client');exports[_0x5f9d('0x0')]=function(){return function(){return client[_0x5f9d('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x5f9d('0x2'),_0x5f9d('0x3'),_0x5f9d('0x4')],'include':[{'model':_0x5f9d('0x5'),'as':_0x5f9d('0x6'),'attributes':['id',_0x5f9d('0x2'),_0x5f9d('0x7'),'chatPause']}]},'log':_0x5f9d('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index c5f3f23..71856da 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 _0x46fc=['../client','create','Request','CreateChatQueueReport','update','DESC','UpdateChatQueueReport'];(function(_0x32ab41,_0x99f9a2){var _0x118262=function(_0x2b9141){while(--_0x2b9141){_0x32ab41['push'](_0x32ab41['shift']());}};_0x118262(++_0x99f9a2);}(_0x46fc,0x103));var _0xc46f=function(_0x17c56a,_0x329fc8){_0x17c56a=_0x17c56a-0x0;var _0x15cbfc=_0x46fc[_0x17c56a];return _0x15cbfc;};'use strict';var client=require(_0xc46f('0x0'));exports[_0xc46f('0x1')]=function(_0xf5212c){return client[_0xc46f('0x2')](_0xc46f('0x3'),{'body':_0xf5212c,'log':_0xc46f('0x3')});};exports[_0xc46f('0x4')]=function(_0x24058a,_0x3a56db){return client['Request']('UpdateChatQueueReport',{'body':_0x3a56db,'options':{'where':{'uniqueid':_0x24058a},'order':[['id',_0xc46f('0x5')]],'limit':0x1},'log':_0xc46f('0x6')});}; \ No newline at end of file +var _0x3685=['UpdateChatQueueReport','DESC','../client','Request','CreateChatQueueReport','update'];(function(_0x3005ae,_0x44dbe5){var _0x182c38=function(_0x57e3e8){while(--_0x57e3e8){_0x3005ae['push'](_0x3005ae['shift']());}};_0x182c38(++_0x44dbe5);}(_0x3685,0xf8));var _0x5368=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3685[_0x20a584];return _0x4b41a8;};'use strict';var client=require(_0x5368('0x0'));exports['create']=function(_0x31ec8e){return client[_0x5368('0x1')](_0x5368('0x2'),{'body':_0x31ec8e,'log':_0x5368('0x2')});};exports[_0x5368('0x3')]=function(_0xf0428a,_0x271e21){return client[_0x5368('0x1')](_0x5368('0x4'),{'body':_0x271e21,'options':{'where':{'uniqueid':_0xf0428a},'order':[['id',_0x5368('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 00b82ed..e668ecd 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 _0x7a54=['Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction','../client','update'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0x7a54,0x106));var _0x47a5=function(_0x5708d6,_0x224ca2){_0x5708d6=_0x5708d6-0x0;var _0x52f35a=_0x7a54[_0x5708d6];return _0x52f35a;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x5dff45,_0x10cae1){var _0x33a904=function(_0x49bc33){while(--_0x49bc33){_0x5dff45['push'](_0x5dff45['shift']());}};_0x33a904(++_0x10cae1);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index d547759..313704a 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 _0x1a4b=['../client','Request','CreateFaxMessage','createFaxMessage'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x1a4b,0x158));var _0xb1a4=function(_0x283318,_0x2932f4){_0x283318=_0x283318-0x0;var _0x5d4ab2=_0x1a4b[_0x283318];return _0x5d4ab2;};'use strict';var client=require(_0xb1a4('0x0'));exports['create']=function(_0x5652c6){return client[_0xb1a4('0x1')](_0xb1a4('0x2'),{'body':_0x5652c6,'log':_0xb1a4('0x3')});}; \ No newline at end of file +var _0x07a9=['createFaxMessage','../client','Request','CreateFaxMessage'];(function(_0x33bd99,_0xc5f114){var _0x2c253c=function(_0x43a6d0){while(--_0x43a6d0){_0x33bd99['push'](_0x33bd99['shift']());}};_0x2c253c(++_0xc5f114);}(_0x07a9,0x1b1));var _0x907a=function(_0x5c48c2,_0x43c3da){_0x5c48c2=_0x5c48c2-0x0;var _0x25e6bf=_0x07a9[_0x5c48c2];return _0x25e6bf;};'use strict';var client=require(_0x907a('0x0'));exports['create']=function(_0x341483){return client[_0x907a('0x1')](_0x907a('0x2'),{'body':_0x341483,'log':_0x907a('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 832a357..dc1380b 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 _0xc4e0=['Request','GetFaxQueue','timeout','strategy','User','Agents','name','online','../client','getFaxQueues'];(function(_0x2bbe8d,_0x5156c2){var _0x539e7a=function(_0x518447){while(--_0x518447){_0x2bbe8d['push'](_0x2bbe8d['shift']());}};_0x539e7a(++_0x5156c2);}(_0xc4e0,0x1e8));var _0x0c4e=function(_0xc133e4,_0x5e5dea){_0xc133e4=_0xc133e4-0x0;var _0x449769=_0xc4e0[_0xc133e4];return _0x449769;};'use strict';var client=require(_0x0c4e('0x0'));exports[_0x0c4e('0x1')]=function(){return function(){return client[_0x0c4e('0x2')](_0x0c4e('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x0c4e('0x4'),_0x0c4e('0x5')],'include':[{'model':_0x0c4e('0x6'),'as':_0x0c4e('0x7'),'attributes':['id',_0x0c4e('0x8'),_0x0c4e('0x9'),'faxPause']}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x9f04=['../client','getFaxQueues','Request','GetFaxQueue','name','timeout','strategy','Agents','faxPause'];(function(_0x28c7ae,_0x49f978){var _0x2cd8dd=function(_0x3d074f){while(--_0x3d074f){_0x28c7ae['push'](_0x28c7ae['shift']());}};_0x2cd8dd(++_0x49f978);}(_0x9f04,0x15f));var _0x49f0=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x9f04[_0x2c91e9];return _0x13f0ff;};'use strict';var client=require(_0x49f0('0x0'));exports[_0x49f0('0x1')]=function(){return function(){return client[_0x49f0('0x2')](_0x49f0('0x3'),{'options':{'raw':![],'attributes':['id',_0x49f0('0x4'),_0x49f0('0x5'),_0x49f0('0x6')],'include':[{'model':'User','as':_0x49f0('0x7'),'attributes':['id','name','online',_0x49f0('0x8')]}]},'log':_0x49f0('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 3238f83..e3e1d3e 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 _0x0d9c=['CreateFaxQueueReport','update','DESC','UpdateFaxQueueReport','create','Request'];(function(_0x54a9b9,_0x31352f){var _0x2a34ef=function(_0x50f592){while(--_0x50f592){_0x54a9b9['push'](_0x54a9b9['shift']());}};_0x2a34ef(++_0x31352f);}(_0x0d9c,0x7c));var _0xc0d9=function(_0x33d4dd,_0xab8529){_0x33d4dd=_0x33d4dd-0x0;var _0x44d328=_0x0d9c[_0x33d4dd];return _0x44d328;};'use strict';var client=require('../client');exports[_0xc0d9('0x0')]=function(_0x42effb){return client[_0xc0d9('0x1')](_0xc0d9('0x2'),{'body':_0x42effb,'log':'CreateFaxQueueReport'});};exports[_0xc0d9('0x3')]=function(_0x243377,_0x5e6b8d){return client[_0xc0d9('0x1')]('UpdateFaxQueueReport',{'body':_0x5e6b8d,'options':{'where':{'uniqueid':_0x243377},'order':[['id',_0xc0d9('0x4')]],'limit':0x1},'log':_0xc0d9('0x5')});}; \ No newline at end of file +var _0x26ee=['Request','UpdateFaxQueueReport','../client','CreateFaxQueueReport'];(function(_0x1b3f91,_0x2d7894){var _0xcbf3a1=function(_0x2be7af){while(--_0x2be7af){_0x1b3f91['push'](_0x1b3f91['shift']());}};_0xcbf3a1(++_0x2d7894);}(_0x26ee,0x162));var _0xe26e=function(_0x3fc6fe,_0x274be0){_0x3fc6fe=_0x3fc6fe-0x0;var _0x50fdaf=_0x26ee[_0x3fc6fe];return _0x50fdaf;};'use strict';var client=require(_0xe26e('0x0'));exports['create']=function(_0x5d25e0){return client['Request'](_0xe26e('0x1'),{'body':_0x5d25e0,'log':_0xe26e('0x1')});};exports['update']=function(_0xa5ab50,_0xc70269){return client[_0xe26e('0x2')](_0xe26e('0x3'),{'body':_0xc70269,'options':{'where':{'uniqueid':_0xa5ab50},'order':[['id','DESC']],'limit':0x1},'log':_0xe26e('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index b39532d..8b9346e 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 _0x2b3b=['Intervals','name','interval','getIntervals','../client','Request','GetInterval','Interval'];(function(_0x14781a,_0xfb7f61){var _0x154ea4=function(_0x4adead){while(--_0x4adead){_0x14781a['push'](_0x14781a['shift']());}};_0x154ea4(++_0xfb7f61);}(_0x2b3b,0x8c));var _0xb2b3=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x2b3b[_0x167cc1];return _0x10bc4b;};'use strict';var client=require(_0xb2b3('0x0'));exports['getIntervals']=function(){return function(){return client[_0xb2b3('0x1')](_0xb2b3('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0xb2b3('0x3'),'as':_0xb2b3('0x4'),'attributes':['id',_0xb2b3('0x5'),_0xb2b3('0x6')]}]},'log':_0xb2b3('0x7')});};}; \ No newline at end of file +var _0x789a=['Request','name','Interval','Intervals','interval','getIntervals','../client'];(function(_0x7b62cf,_0x591b3d){var _0x19545f=function(_0xb13edd){while(--_0xb13edd){_0x7b62cf['push'](_0x7b62cf['shift']());}};_0x19545f(++_0x591b3d);}(_0x789a,0x12c));var _0xa789=function(_0x4a80df,_0x597722){_0x4a80df=_0x4a80df-0x0;var _0x1473dd=_0x789a[_0x4a80df];return _0x1473dd;};'use strict';var client=require(_0xa789('0x0'));exports['getIntervals']=function(){return function(){return client[_0xa789('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xa789('0x2')],'include':[{'model':_0xa789('0x3'),'as':_0xa789('0x4'),'attributes':['id',_0xa789('0x2'),_0xa789('0x5')]}]},'log':_0xa789('0x6')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 804f6f4..8752a87 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 _0xb03e=['addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction'];(function(_0x49e827,_0x146e0f){var _0x156bf4=function(_0x3d2771){while(--_0x3d2771){_0x49e827['push'](_0x49e827['shift']());}};_0x156bf4(++_0x146e0f);}(_0xb03e,0x1eb));var _0xeb03=function(_0x82aa85,_0x1f7866){_0x82aa85=_0x82aa85-0x0;var _0x4dc5bb=_0xb03e[_0x82aa85];return _0x4dc5bb;};'use strict';var client=require('../client');exports[_0xeb03('0x0')]=function(_0x399504,_0x868905){return client[_0xeb03('0x1')](_0xeb03('0x2'),{'body':_0x868905,'options':{'where':{'id':_0x399504}},'log':_0xeb03('0x3')});};exports[_0xeb03('0x4')]=function(_0x1fe650,_0x474450){return client[_0xeb03('0x1')](_0xeb03('0x5'),{'body':_0x474450,'options':{'where':{'id':_0x1fe650}},'log':_0xeb03('0x6')});}; \ No newline at end of file +var _0x0b0e=['Request','UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client'];(function(_0x163cd0,_0x461c03){var _0x166213=function(_0x450910){while(--_0x450910){_0x163cd0['push'](_0x163cd0['shift']());}};_0x166213(++_0x461c03);}(_0x0b0e,0x187));var _0xe0b0=function(_0xd413a4,_0x3120fe){_0xd413a4=_0xd413a4-0x0;var _0x9170f4=_0x0b0e[_0xd413a4];return _0x9170f4;};'use strict';var client=require(_0xe0b0('0x0'));exports['update']=function(_0xc416e3,_0x536e9b){return client[_0xe0b0('0x1')](_0xe0b0('0x2'),{'body':_0x536e9b,'options':{'where':{'id':_0xc416e3}},'log':_0xe0b0('0x3')});};exports[_0xe0b0('0x4')]=function(_0x28040c,_0x38a058){return client[_0xe0b0('0x1')](_0xe0b0('0x5'),{'body':_0x38a058,'options':{'where':{'id':_0x28040c}},'log':_0xe0b0('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 886a384..e2813be 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 _0x8a14=['../client','create','Request','CreateMailMessage','createMailMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8a14,0x186));var _0x48a1=function(_0x127d7b,_0x54ec03){_0x127d7b=_0x127d7b-0x0;var _0x3da9b7=_0x8a14[_0x127d7b];return _0x3da9b7;};'use strict';var client=require(_0x48a1('0x0'));exports[_0x48a1('0x1')]=function(_0x35b55c){return client[_0x48a1('0x2')](_0x48a1('0x3'),{'body':_0x35b55c,'log':_0x48a1('0x4')});}; \ No newline at end of file +var _0x996b=['CreateMailMessage','../client','create','Request'];(function(_0x16dbfd,_0x2f9431){var _0x382254=function(_0x19dade){while(--_0x19dade){_0x16dbfd['push'](_0x16dbfd['shift']());}};_0x382254(++_0x2f9431);}(_0x996b,0x9d));var _0xb996=function(_0x27b66a,_0x3da51e){_0x27b66a=_0x27b66a-0x0;var _0x4ea2f3=_0x996b[_0x27b66a];return _0x4ea2f3;};'use strict';var client=require(_0xb996('0x0'));exports[_0xb996('0x1')]=function(_0x4c15a3){return client[_0xb996('0x2')](_0xb996('0x3'),{'body':_0x4c15a3,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 1280f4c..a62f91d 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 _0x6cfc=['name','timeout','User','Agents','online','getMailQueues','Request','GetMailQueue'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x6cfc,0x95));var _0xc6cf=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0x6cfc[_0x4c0622];return _0x1799d8;};'use strict';var client=require('../client');exports[_0xc6cf('0x0')]=function(){return function(){return client[_0xc6cf('0x1')](_0xc6cf('0x2'),{'options':{'raw':![],'attributes':['id',_0xc6cf('0x3'),_0xc6cf('0x4'),'strategy'],'include':[{'model':_0xc6cf('0x5'),'as':_0xc6cf('0x6'),'attributes':['id',_0xc6cf('0x3'),_0xc6cf('0x7'),'mailPause']}]},'log':_0xc6cf('0x0')});};}; \ No newline at end of file +var _0x7e47=['Request','GetMailQueue','name','timeout','mailPause','getMailQueues'];(function(_0x214910,_0x191913){var _0xa7b5fc=function(_0x231c7a){while(--_0x231c7a){_0x214910['push'](_0x214910['shift']());}};_0xa7b5fc(++_0x191913);}(_0x7e47,0x19d));var _0x77e4=function(_0x1335ea,_0x4f39d7){_0x1335ea=_0x1335ea-0x0;var _0x5eafa4=_0x7e47[_0x1335ea];return _0x5eafa4;};'use strict';var client=require('../client');exports[_0x77e4('0x0')]=function(){return function(){return client[_0x77e4('0x1')](_0x77e4('0x2'),{'options':{'raw':![],'attributes':['id',_0x77e4('0x3'),_0x77e4('0x4'),'strategy'],'include':[{'model':'User','as':'Agents','attributes':['id',_0x77e4('0x3'),'online',_0x77e4('0x5')]}]},'log':_0x77e4('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 0eec1f4..a541309 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 _0x388e=['DESC','../client','CreateMailQueueReport','update','Request','UpdateMailQueueReport'];(function(_0x40f795,_0x57337a){var _0x1ce6ab=function(_0xca7bea){while(--_0xca7bea){_0x40f795['push'](_0x40f795['shift']());}};_0x1ce6ab(++_0x57337a);}(_0x388e,0x127));var _0xe388=function(_0x420278,_0x23b281){_0x420278=_0x420278-0x0;var _0x3d1dfa=_0x388e[_0x420278];return _0x3d1dfa;};'use strict';var client=require(_0xe388('0x0'));exports['create']=function(_0x1750ae){return client['Request']('CreateMailQueueReport',{'body':_0x1750ae,'log':_0xe388('0x1')});};exports[_0xe388('0x2')]=function(_0x242e8d,_0x4f7887){return client[_0xe388('0x3')](_0xe388('0x4'),{'body':_0x4f7887,'options':{'where':{'uniqueid':_0x242e8d},'order':[['id',_0xe388('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x5e8f=['CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client','create','Request'];(function(_0x500ffe,_0x318d11){var _0x3b1c6e=function(_0x2a8380){while(--_0x2a8380){_0x500ffe['push'](_0x500ffe['shift']());}};_0x3b1c6e(++_0x318d11);}(_0x5e8f,0xac));var _0xf5e8=function(_0x4db46b,_0xadcb1a){_0x4db46b=_0x4db46b-0x0;var _0x565be8=_0x5e8f[_0x4db46b];return _0x565be8;};'use strict';var client=require(_0xf5e8('0x0'));exports[_0xf5e8('0x1')]=function(_0x41a063){return client[_0xf5e8('0x2')](_0xf5e8('0x3'),{'body':_0x41a063,'log':_0xf5e8('0x3')});};exports[_0xf5e8('0x4')]=function(_0x519964,_0x5bb253){return client[_0xf5e8('0x2')](_0xf5e8('0x5'),{'body':_0x5bb253,'options':{'where':{'uniqueid':_0x519964},'order':[['id',_0xf5e8('0x6')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index a0e14dd..38489e9 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 _0x184b=['../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x184b,0x6c));var _0xb184=function(_0x1d094b,_0x251681){_0x1d094b=_0x1d094b-0x0;var _0x1bf90b=_0x184b[_0x1d094b];return _0x1bf90b;};'use strict';var client=require(_0xb184('0x0'));exports['update']=function(_0x5ee8b3,_0x394563){return client[_0xb184('0x1')](_0xb184('0x2'),{'body':_0x394563,'options':{'where':{'id':_0x5ee8b3}},'log':_0xb184('0x3')});};exports['addTags']=function(_0x51c94d,_0x50c4ec){return client[_0xb184('0x1')]('AddTagsToOpenchannelInteraction',{'body':_0x50c4ec,'options':{'where':{'id':_0x51c94d}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0x6f28=['../client','update','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x468edb,_0x3100ea){var _0x194fe2=function(_0x2f8ea6){while(--_0x2f8ea6){_0x468edb['push'](_0x468edb['shift']());}};_0x194fe2(++_0x3100ea);}(_0x6f28,0x196));var _0x86f2=function(_0xce93c,_0x555be5){_0xce93c=_0xce93c-0x0;var _0x230720=_0x6f28[_0xce93c];return _0x230720;};'use strict';var client=require(_0x86f2('0x0'));exports[_0x86f2('0x1')]=function(_0x126f3a,_0x485b33){return client['Request'](_0x86f2('0x2'),{'body':_0x485b33,'options':{'where':{'id':_0x126f3a}},'log':_0x86f2('0x3')});};exports[_0x86f2('0x4')]=function(_0x5c9839,_0x5a3b9b){return client['Request'](_0x86f2('0x5'),{'body':_0x5a3b9b,'options':{'where':{'id':_0x5c9839}},'log':_0x86f2('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 2da8a39..2b0db20 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 _0x0eb4=['../client','create'];(function(_0x4eedda,_0x4f1f2c){var _0x859f0=function(_0x177cb6){while(--_0x177cb6){_0x4eedda['push'](_0x4eedda['shift']());}};_0x859f0(++_0x4f1f2c);}(_0x0eb4,0x1e6));var _0x40eb=function(_0xb1439,_0x2a9484){_0xb1439=_0xb1439-0x0;var _0x2c103b=_0x0eb4[_0xb1439];return _0x2c103b;};'use strict';var client=require(_0x40eb('0x0'));exports[_0x40eb('0x1')]=function(_0x4eb788){return client['Request']('CreateOpenchannelMessage',{'body':_0x4eb788,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0x49d8=['createOpenchannelMessage','../client','Request'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x49d8,0xd3));var _0x849d=function(_0x2c5aba,_0x2da432){_0x2c5aba=_0x2c5aba-0x0;var _0x2c8c15=_0x49d8[_0x2c5aba];return _0x2c8c15;};'use strict';var client=require(_0x849d('0x0'));exports['create']=function(_0x52e2c8){return client[_0x849d('0x1')]('CreateOpenchannelMessage',{'body':_0x52e2c8,'log':_0x849d('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 9f63f78..5a8c8da 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 _0x93ed=['Request','GetOpenchannelQueue','name','strategy','Agents','openchannelPause','../client','getOpenchannelQueues'];(function(_0x3a3ea6,_0x84d32){var _0x13a16b=function(_0x21b739){while(--_0x21b739){_0x3a3ea6['push'](_0x3a3ea6['shift']());}};_0x13a16b(++_0x84d32);}(_0x93ed,0xfe));var _0xd93e=function(_0x3c9eb2,_0x161a8a){_0x3c9eb2=_0x3c9eb2-0x0;var _0x2333ca=_0x93ed[_0x3c9eb2];return _0x2333ca;};'use strict';var client=require(_0xd93e('0x0'));exports[_0xd93e('0x1')]=function(){return function(){return client[_0xd93e('0x2')](_0xd93e('0x3'),{'options':{'raw':![],'attributes':['id',_0xd93e('0x4'),'timeout',_0xd93e('0x5')],'include':[{'model':'User','as':_0xd93e('0x6'),'attributes':['id',_0xd93e('0x4'),'online',_0xd93e('0x7')]}]},'log':_0xd93e('0x1')});};}; \ No newline at end of file +var _0x19b6=['name','User','Agents','../client','getOpenchannelQueues','Request'];(function(_0x3e7462,_0x59c8e1){var _0x203ee4=function(_0x188444){while(--_0x188444){_0x3e7462['push'](_0x3e7462['shift']());}};_0x203ee4(++_0x59c8e1);}(_0x19b6,0x1e9));var _0x619b=function(_0x383627,_0x5be16e){_0x383627=_0x383627-0x0;var _0x2c16a0=_0x19b6[_0x383627];return _0x2c16a0;};'use strict';var client=require(_0x619b('0x0'));exports[_0x619b('0x1')]=function(){return function(){return client[_0x619b('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x619b('0x3'),'timeout','strategy'],'include':[{'model':_0x619b('0x4'),'as':_0x619b('0x5'),'attributes':['id',_0x619b('0x3'),'online','openchannelPause']}]},'log':_0x619b('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 2427c12..adcb56b 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 _0x8978=['CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport'];(function(_0x384ca8,_0x32d496){var _0x1c1cda=function(_0x45317d){while(--_0x45317d){_0x384ca8['push'](_0x384ca8['shift']());}};_0x1c1cda(++_0x32d496);}(_0x8978,0x1cc));var _0x8897=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x8978[_0x1035c1];return _0x308d67;};'use strict';var client=require('../client');exports['create']=function(_0xcf3330){return client['Request'](_0x8897('0x0'),{'body':_0xcf3330,'log':'CreateOpenchannelQueueReport'});};exports[_0x8897('0x1')]=function(_0x477c4e,_0x3b5a32){return client[_0x8897('0x2')](_0x8897('0x3'),{'body':_0x3b5a32,'options':{'where':{'uniqueid':_0x477c4e},'order':[['id','DESC']],'limit':0x1},'log':_0x8897('0x3')});}; \ No newline at end of file +var _0x98d2=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','create','Request'];(function(_0x7275e9,_0x321fa5){var _0x17b99d=function(_0x54af41){while(--_0x54af41){_0x7275e9['push'](_0x7275e9['shift']());}};_0x17b99d(++_0x321fa5);}(_0x98d2,0xb3));var _0x298d=function(_0x4629ed,_0x59ef85){_0x4629ed=_0x4629ed-0x0;var _0x52ca04=_0x98d2[_0x4629ed];return _0x52ca04;};'use strict';var client=require(_0x298d('0x0'));exports[_0x298d('0x1')]=function(_0x375c15){return client[_0x298d('0x2')](_0x298d('0x3'),{'body':_0x375c15,'log':_0x298d('0x3')});};exports[_0x298d('0x4')]=function(_0x2abdc1,_0x183db7){return client['Request'](_0x298d('0x5'),{'body':_0x183db7,'options':{'where':{'uniqueid':_0x2abdc1},'order':[['id',_0x298d('0x6')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 053f3bc..f536343 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 _0xe700=['updateSmsInteraction','addTagsToSmsInteraction','../client','update','Request'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xe700,0x16a));var _0x0e70=function(_0x12e7b7,_0x1ece92){_0x12e7b7=_0x12e7b7-0x0;var _0x5bbd6f=_0xe700[_0x12e7b7];return _0x5bbd6f;};'use strict';var client=require(_0x0e70('0x0'));exports[_0x0e70('0x1')]=function(_0x245ff7,_0x1c63f0){return client[_0x0e70('0x2')]('UpdateSmsInteraction',{'body':_0x1c63f0,'options':{'where':{'id':_0x245ff7}},'log':_0x0e70('0x3')});};exports['addTags']=function(_0x20335e,_0x2cc22e){return client['Request']('AddTagsToSmsInteraction',{'body':_0x2cc22e,'options':{'where':{'id':_0x20335e}},'log':_0x0e70('0x4')});}; \ No newline at end of file +var _0x5697=['Request','../client'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0x5697,0x1b5));var _0x7569=function(_0x1a8ff0,_0x20788d){_0x1a8ff0=_0x1a8ff0-0x0;var _0x3588bf=_0x5697[_0x1a8ff0];return _0x3588bf;};'use strict';var client=require(_0x7569('0x0'));exports['update']=function(_0x394228,_0x3541f6){return client[_0x7569('0x1')]('UpdateSmsInteraction',{'body':_0x3541f6,'options':{'where':{'id':_0x394228}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x499e06,_0x48340f){return client[_0x7569('0x1')]('AddTagsToSmsInteraction',{'body':_0x48340f,'options':{'where':{'id':_0x499e06}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index dc26227..8113030 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 _0xed83=['createSmsMessage','../client','create','Request','CreateSmsMessage'];(function(_0x57b947,_0xd0ccb8){var _0x1b75e9=function(_0x3318f0){while(--_0x3318f0){_0x57b947['push'](_0x57b947['shift']());}};_0x1b75e9(++_0xd0ccb8);}(_0xed83,0x10f));var _0x3ed8=function(_0x24af20,_0xb1b03b){_0x24af20=_0x24af20-0x0;var _0x20bbc5=_0xed83[_0x24af20];return _0x20bbc5;};'use strict';var client=require(_0x3ed8('0x0'));exports[_0x3ed8('0x1')]=function(_0x1b2aee){return client[_0x3ed8('0x2')](_0x3ed8('0x3'),{'body':_0x1b2aee,'log':_0x3ed8('0x4')});}; \ No newline at end of file +var _0x38f7=['create','Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x50f376,_0x18b03f){var _0x3e5d6f=function(_0x5d92bb){while(--_0x5d92bb){_0x50f376['push'](_0x50f376['shift']());}};_0x3e5d6f(++_0x18b03f);}(_0x38f7,0x135));var _0x738f=function(_0x1952e2,_0x45e58b){_0x1952e2=_0x1952e2-0x0;var _0x249cc8=_0x38f7[_0x1952e2];return _0x249cc8;};'use strict';var client=require(_0x738f('0x0'));exports[_0x738f('0x1')]=function(_0x54f078){return client[_0x738f('0x2')](_0x738f('0x3'),{'body':_0x54f078,'log':_0x738f('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 4eae86a..7a75fc6 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 _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x51904f,_0x439694){var _0x24dc27=function(_0x3046b1){while(--_0x3046b1){_0x51904f['push'](_0x51904f['shift']());}};_0x24dc27(++_0x439694);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file +var _0xcb91=['smsPause','Request','GetSmsQueue','name','timeout','User','Agents','online'];(function(_0x3c0252,_0x12a568){var _0x372b55=function(_0x5a938e){while(--_0x5a938e){_0x3c0252['push'](_0x3c0252['shift']());}};_0x372b55(++_0x12a568);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x37c07d,_0xdbdb5f){_0x37c07d=_0x37c07d-0x0;var _0x10dadc=_0xcb91[_0x37c07d];return _0x10dadc;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'attributes':['id',_0x1cb9('0x2'),_0x1cb9('0x3'),'strategy'],'include':[{'model':_0x1cb9('0x4'),'as':_0x1cb9('0x5'),'attributes':['id','name',_0x1cb9('0x6'),_0x1cb9('0x7')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 23d8b32..f4b6a86 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 _0xedd9=['create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0xb6e43,_0x1568fc){var _0x47c40f=function(_0x107786){while(--_0x107786){_0xb6e43['push'](_0xb6e43['shift']());}};_0x47c40f(++_0x1568fc);}(_0xedd9,0xfc));var _0x9edd=function(_0x329073,_0x1ceca5){_0x329073=_0x329073-0x0;var _0x2182f9=_0xedd9[_0x329073];return _0x2182f9;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(_0x2d7989){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'body':_0x2d7989,'log':_0x9edd('0x2')});};exports[_0x9edd('0x3')]=function(_0x3e6d3a,_0x36b53f){return client['Request'](_0x9edd('0x4'),{'body':_0x36b53f,'options':{'where':{'uniqueid':_0x3e6d3a},'order':[['id',_0x9edd('0x5')]],'limit':0x1},'log':_0x9edd('0x4')});}; \ No newline at end of file +var _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x295458,_0x2051a9){var _0x3ee559=function(_0x13bf1f){while(--_0x13bf1f){_0x295458['push'](_0x295458['shift']());}};_0x3ee559(++_0x2051a9);}(_0x9c44,0x178));var _0x49c4=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x9c44[_0x13e741];return _0x3f8bb3;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 4ed55b6..374245e 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 _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x3ec73d,_0x57407b){var _0x401d5c=function(_0x317037){while(--_0x317037){_0x3ec73d['push'](_0x3ec73d['shift']());}};_0x401d5c(++_0x57407b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file +var _0xa9e0=['name','pauseType','lastPauseAt','voicePause','chatPause','mailPause','smsPause','whatsappPause','openchannelPause','faxCapacity','openchannelCapacity','../client','getAgents','Request'];(function(_0x18f1ae,_0x144729){var _0x3e33e3=function(_0x548e91){while(--_0x548e91){_0x18f1ae['push'](_0x18f1ae['shift']());}};_0x3e33e3(++_0x144729);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0x0a9e('0x3'),'online',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'faxPause',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'chatCapacity','mailCapacity',_0x0a9e('0xc'),'smsCapacity','whatsappCapacity',_0x0a9e('0xd')]},'log':_0x0a9e('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappInteraction.js b/server/services/routing/rpc/whatsappInteraction.js index dfda00b..8f954a2 100644 --- a/server/services/routing/rpc/whatsappInteraction.js +++ b/server/services/routing/rpc/whatsappInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7919=['UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request'];(function(_0xaa2270,_0x207784){var _0x41cc2c=function(_0x556c76){while(--_0x556c76){_0xaa2270['push'](_0xaa2270['shift']());}};_0x41cc2c(++_0x207784);}(_0x7919,0xeb));var _0x9791=function(_0x1db7fb,_0x54396b){_0x1db7fb=_0x1db7fb-0x0;var _0x5dd4c7=_0x7919[_0x1db7fb];return _0x5dd4c7;};'use strict';var client=require(_0x9791('0x0'));exports[_0x9791('0x1')]=function(_0x466be6,_0x1c714b){return client[_0x9791('0x2')](_0x9791('0x3'),{'body':_0x1c714b,'options':{'where':{'id':_0x466be6}},'log':_0x9791('0x4')});};exports['addTags']=function(_0x13a1a5,_0x193919){return client['Request'](_0x9791('0x5'),{'body':_0x193919,'options':{'where':{'id':_0x13a1a5}},'log':_0x9791('0x6')});}; \ No newline at end of file +var _0x1883=['addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1883,0xab));var _0x3188=function(_0x3a5b8c,_0x2edf4e){_0x3a5b8c=_0x3a5b8c-0x0;var _0x266560=_0x1883[_0x3a5b8c];return _0x266560;};'use strict';var client=require(_0x3188('0x0'));exports[_0x3188('0x1')]=function(_0x1ffcc1,_0x45f858){return client[_0x3188('0x2')](_0x3188('0x3'),{'body':_0x45f858,'options':{'where':{'id':_0x1ffcc1}},'log':_0x3188('0x4')});};exports[_0x3188('0x5')]=function(_0x1c7c86,_0x44afb8){return client[_0x3188('0x2')](_0x3188('0x6'),{'body':_0x44afb8,'options':{'where':{'id':_0x1c7c86}},'log':_0x3188('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 7f57d89..5e69447 100644 --- a/server/services/routing/rpc/whatsappMessage.js +++ b/server/services/routing/rpc/whatsappMessage.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fbf=['create','Request','CreateWhatsappMessage','createWhatsappMessage','../client'];(function(_0xfcc030,_0x3ec053){var _0x5caa66=function(_0xf2e6d2){while(--_0xf2e6d2){_0xfcc030['push'](_0xfcc030['shift']());}};_0x5caa66(++_0x3ec053);}(_0x0fbf,0x130));var _0xf0fb=function(_0x694e86,_0x2da8d7){_0x694e86=_0x694e86-0x0;var _0x29b21c=_0x0fbf[_0x694e86];return _0x29b21c;};'use strict';var client=require(_0xf0fb('0x0'));exports[_0xf0fb('0x1')]=function(_0x3318b1){return client[_0xf0fb('0x2')](_0xf0fb('0x3'),{'body':_0x3318b1,'log':_0xf0fb('0x4')});}; \ No newline at end of file +var _0x93cc=['../client','create','Request'];(function(_0x60912b,_0x4e90ee){var _0xd25e4c=function(_0x2f4403){while(--_0x2f4403){_0x60912b['push'](_0x60912b['shift']());}};_0xd25e4c(++_0x4e90ee);}(_0x93cc,0x132));var _0xc93c=function(_0x5f293a,_0x159fa4){_0x5f293a=_0x5f293a-0x0;var _0x13763c=_0x93cc[_0x5f293a];return _0x13763c;};'use strict';var client=require(_0xc93c('0x0'));exports[_0xc93c('0x1')]=function(_0x55e8da){return client[_0xc93c('0x2')]('CreateWhatsappMessage',{'body':_0x55e8da,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index 76d4561..15205dc 100644 --- a/server/services/routing/rpc/whatsappQueue.js +++ b/server/services/routing/rpc/whatsappQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbedb=['Agents','online','whatsappPause','../client','getWhatsappQueues','Request','GetWhatsappQueue','name','strategy','User'];(function(_0x1ec280,_0x5b56b3){var _0x4eaf0d=function(_0x333b9d){while(--_0x333b9d){_0x1ec280['push'](_0x1ec280['shift']());}};_0x4eaf0d(++_0x5b56b3);}(_0xbedb,0x17f));var _0xbbed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbedb[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xbbed('0x0'));exports[_0xbbed('0x1')]=function(){return function(){return client[_0xbbed('0x2')](_0xbbed('0x3'),{'options':{'raw':![],'attributes':['id',_0xbbed('0x4'),'timeout',_0xbbed('0x5')],'include':[{'model':_0xbbed('0x6'),'as':_0xbbed('0x7'),'attributes':['id',_0xbbed('0x4'),_0xbbed('0x8'),_0xbbed('0x9')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0x344f=['getWhatsappQueues','Request','GetWhatsappQueue','timeout','strategy','Agents','name','online','whatsappPause','../client'];(function(_0x21f6b2,_0x491db7){var _0x4a2b5a=function(_0x946132){while(--_0x946132){_0x21f6b2['push'](_0x21f6b2['shift']());}};_0x4a2b5a(++_0x491db7);}(_0x344f,0xef));var _0xf344=function(_0x3f3e62,_0x5dce0e){_0x3f3e62=_0x3f3e62-0x0;var _0x5b5549=_0x344f[_0x3f3e62];return _0x5b5549;};'use strict';var client=require(_0xf344('0x0'));exports[_0xf344('0x1')]=function(){return function(){return client[_0xf344('0x2')](_0xf344('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xf344('0x4'),_0xf344('0x5')],'include':[{'model':'User','as':_0xf344('0x6'),'attributes':['id',_0xf344('0x7'),_0xf344('0x8'),_0xf344('0x9')]}]},'log':_0xf344('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 593a26a..69f6f5e 100644 --- a/server/services/routing/rpc/whatsappQueueReport.js +++ b/server/services/routing/rpc/whatsappQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x42a8=['DESC','UpdateWhatsappQueueReport','../client','create','Request','CreateWhatsappQueueReport'];(function(_0x76ccdb,_0x17d9f3){var _0x39ce12=function(_0x1d5d76){while(--_0x1d5d76){_0x76ccdb['push'](_0x76ccdb['shift']());}};_0x39ce12(++_0x17d9f3);}(_0x42a8,0xc8));var _0x842a=function(_0x51d129,_0x175d7d){_0x51d129=_0x51d129-0x0;var _0x44c377=_0x42a8[_0x51d129];return _0x44c377;};'use strict';var client=require(_0x842a('0x0'));exports[_0x842a('0x1')]=function(_0x1daebc){return client[_0x842a('0x2')]('CreateWhatsappQueueReport',{'body':_0x1daebc,'log':_0x842a('0x3')});};exports['update']=function(_0x5ad0c2,_0x3177c6){return client[_0x842a('0x2')]('UpdateWhatsappQueueReport',{'body':_0x3177c6,'options':{'where':{'uniqueid':_0x5ad0c2},'order':[['id',_0x842a('0x4')]],'limit':0x1},'log':_0x842a('0x5')});}; \ No newline at end of file +var _0xe06b=['CreateWhatsappQueueReport','Request','UpdateWhatsappQueueReport','DESC','create'];(function(_0x34199e,_0x4d431a){var _0x14b5ab=function(_0x4c8554){while(--_0x4c8554){_0x34199e['push'](_0x34199e['shift']());}};_0x14b5ab(++_0x4d431a);}(_0xe06b,0xcc));var _0xbe06=function(_0x21e562,_0x488fcd){_0x21e562=_0x21e562-0x0;var _0x5e620d=_0xe06b[_0x21e562];return _0x5e620d;};'use strict';var client=require('../client');exports[_0xbe06('0x0')]=function(_0x2401c5){return client['Request'](_0xbe06('0x1'),{'body':_0x2401c5,'log':'CreateWhatsappQueueReport'});};exports['update']=function(_0x1f885e,_0xe1fa28){return client[_0xbe06('0x2')](_0xbe06('0x3'),{'body':_0xe1fa28,'options':{'where':{'uniqueid':_0x1f885e},'order':[['id',_0xbe06('0x4')]],'limit':0x1},'log':_0xbe06('0x3')});}; \ 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 930f6d7..7a34386 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 _0x1089=['[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','length','message','join','stop','find','createQueue','atimeout','channel','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format'];(function(_0x3342cc,_0x41e015){var _0x3d0d3a=function(_0x32e7b9){while(--_0x32e7b9){_0x3342cc['push'](_0x3342cc['shift']());}};_0x3d0d3a(++_0x41e015);}(_0x1089,0xbb));var _0x9108=function(_0x328a2c,_0xb5d7d5){_0x328a2c=_0x328a2c-0x0;var _0x841706=_0x1089[_0x328a2c];return _0x841706;};'use strict';var schema=require(_0x9108('0x0'));var _=require(_0x9108('0x1'));var util=require(_0x9108('0x2'));var seqqueue=require(_0x9108('0x3'));var logger=require(_0x9108('0x4'))('routing');var strategy=require(_0x9108('0x5'));var queue=schema({'name':{'type':_0x9108('0x6'),'required':!![],'message':_0x9108('0x7')},'timeout':{'type':_0x9108('0x8'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x19ba5d,_0x60ebe5,_0x5a18ef){return logger[_0x9108('0x9')](util[_0x9108('0xa')](_0x9108('0xb'),_0x19ba5d,_0x60ebe5[_0x9108('0xc')],_0x5a18ef));}function handleFindAgent(_0x47dc66){return function(_0x5d8c16){return _0x5d8c16[_0x9108('0xc')]['toLowerCase']()===_0x47dc66[_0x9108('0xd')]();};}exports['consequence']=function(_0xa13e3d,_0x51a00d,_0x4db99e,_0x1f736e){return function(_0x339f85){try{var _0x5dfc11={'name':_0x51a00d[0x0],'timeout':_0x51a00d[0x1]};var _0x127cdb=queue['validate'](_0x5dfc11,{'typecast':!![]});if(_0x127cdb[_0x9108('0xe')]){logger['error']('[%s][AGENT]\x20%s',_0xa13e3d,_['map'](_0x127cdb,_0x9108('0xf'))[_0x9108('0x10')](',\x20'));_0x339f85[_0x9108('0x11')]();}else{var _0x305b00=_[_0x9108('0x12')](_0x4db99e['agents'],handleFindAgent(_0x5dfc11[_0x9108('0xc')]));if(_0x305b00){var _0x1b307c=(_0x5dfc11['timeout']||0xa)*0x3e8;var _0x50f9fd,_0x523f31;var _0x1b17ef=seqqueue[_0x9108('0x13')](_0x1b307c);_0x1b17ef['id']=_0xa13e3d;_0x1b17ef[_0x9108('0x14')]=_0x1b307c;_0x1b17ef[_0x9108('0x15')]=_0x1f736e[_0x9108('0x15')];writeLog(_0xa13e3d,_0x305b00,util['format'](_0x9108('0x16'),_0x1b307c));_0x4db99e['rules'][_0xa13e3d]['on'](_0x9108('0x17'),function(){logger['info'](_0x9108('0x18'),_0xa13e3d);clearTimeout(_0x523f31);_0x523f31=undefined;_0x1b17ef[_0x9108('0x19')]();if(_0x4db99e['rules'][_0xa13e3d]){delete _0x4db99e['rules'][_0xa13e3d];}_0x339f85['stop']();});_0x4db99e[_0x9108('0x1a')][_0xa13e3d]['on'](_0x9108('0x1b'),function(){if(_0x4db99e[_0x9108('0x1a')][_0xa13e3d]){delete _0x4db99e[_0x9108('0x1a')][_0xa13e3d];}});_0x523f31=setTimeout(function(){logger['info'](_0x9108('0x1c'),_0xa13e3d);clearTimeout(_0x523f31);_0x1b17ef[_0x9108('0x19')]();_0x339f85[_0x9108('0x1d')]();},_0x1b307c);strategy[_0x9108('0x1e')](_0x1b17ef,_0x305b00,_0x4db99e,_0x1f736e);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0xa13e3d,_0x5dfc11[_0x9108('0xc')]);_0x339f85[_0x9108('0x11')]();}}}catch(_0x2a094d){console['log'](_0x2a094d);logger['error'](_0x9108('0x1f'),_0xa13e3d,_0x2a094d[_0x9108('0x20')]);_0x339f85[_0x9108('0x11')]();}};}; \ No newline at end of file +var _0x3d47=['lodash','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','join','stop','find','timeout','channel','rules','end','close','complete','[%s][AGENT]\x20ROUTING\x20END','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','validate'];(function(_0x1acd3b,_0x333177){var _0x3318f7=function(_0x23f8a3){while(--_0x23f8a3){_0x1acd3b['push'](_0x1acd3b['shift']());}};_0x3318f7(++_0x333177);}(_0x3d47,0x1df));var _0x73d4=function(_0x3ae8ad,_0x34cf0f){_0x3ae8ad=_0x3ae8ad-0x0;var _0xbf5ec3=_0x3d47[_0x3ae8ad];return _0xbf5ec3;};'use strict';var schema=require(_0x73d4('0x0'));var _=require(_0x73d4('0x1'));var util=require('util');var seqqueue=require('seq-queue');var logger=require(_0x73d4('0x2'))(_0x73d4('0x3'));var strategy=require(_0x73d4('0x4'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x73d4('0x5')},'timeout':{'type':'number','message':_0x73d4('0x6')}});function writeLog(_0x185dd0,_0x1a2e79,_0x72bc3d){return logger[_0x73d4('0x7')](util[_0x73d4('0x8')](_0x73d4('0x9'),_0x185dd0,_0x1a2e79[_0x73d4('0xa')],_0x72bc3d));}function handleFindAgent(_0x2f260a){return function(_0x3d6228){return _0x3d6228[_0x73d4('0xa')][_0x73d4('0xb')]()===_0x2f260a[_0x73d4('0xb')]();};}exports[_0x73d4('0xc')]=function(_0x3262c0,_0x40ed56,_0x28695d,_0x129f62){return function(_0xe9fae){try{var _0x2c8aab={'name':_0x40ed56[0x0],'timeout':_0x40ed56[0x1]};var _0x4cbfae=queue[_0x73d4('0x0')](_0x2c8aab,{'typecast':!![]});if(_0x4cbfae[_0x73d4('0xd')]){logger[_0x73d4('0xe')](_0x73d4('0xf'),_0x3262c0,_[_0x73d4('0x10')](_0x4cbfae,_0x73d4('0x11'))[_0x73d4('0x12')](',\x20'));_0xe9fae[_0x73d4('0x13')]();}else{var _0x59b919=_[_0x73d4('0x14')](_0x28695d['agents'],handleFindAgent(_0x2c8aab[_0x73d4('0xa')]));if(_0x59b919){var _0x345bbd=(_0x2c8aab[_0x73d4('0x15')]||0xa)*0x3e8;var _0x8370aa,_0x44fd4e;var _0x4eb2a3=seqqueue['createQueue'](_0x345bbd);_0x4eb2a3['id']=_0x3262c0;_0x4eb2a3['atimeout']=_0x345bbd;_0x4eb2a3['channel']=_0x129f62[_0x73d4('0x16')];writeLog(_0x3262c0,_0x59b919,util[_0x73d4('0x8')]('START:%s',_0x345bbd));_0x28695d[_0x73d4('0x17')][_0x3262c0]['on'](_0x73d4('0x18'),function(){logger[_0x73d4('0x7')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x3262c0);clearTimeout(_0x44fd4e);_0x44fd4e=undefined;_0x4eb2a3[_0x73d4('0x19')]();if(_0x28695d['rules'][_0x3262c0]){delete _0x28695d['rules'][_0x3262c0];}_0xe9fae['stop']();});_0x28695d['rules'][_0x3262c0]['on'](_0x73d4('0x1a'),function(){if(_0x28695d[_0x73d4('0x17')][_0x3262c0]){delete _0x28695d[_0x73d4('0x17')][_0x3262c0];}});_0x44fd4e=setTimeout(function(){logger[_0x73d4('0x7')](_0x73d4('0x1b'),_0x3262c0);clearTimeout(_0x44fd4e);_0x4eb2a3['close']();_0xe9fae['next']();},_0x345bbd);strategy[_0x73d4('0x1c')](_0x4eb2a3,_0x59b919,_0x28695d,_0x129f62);}else{logger[_0x73d4('0xe')](_0x73d4('0x1d'),_0x3262c0,_0x2c8aab[_0x73d4('0xa')]);_0xe9fae[_0x73d4('0x13')]();}}}catch(_0x3d47d5){console['log'](_0x3d47d5);logger[_0x73d4('0xe')](_0x73d4('0x1e'),_0x3262c0,_0x3d47d5[_0x73d4('0x1f')]);_0xe9fae['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 625bf40..39f6410 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 _0x7254=['out','channel','whatsapp','phone','upperFirst','AccountId','account','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','info','[%s][AMAZONLEX]\x20%s','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','amazonlex','providerName','then','dialogState','Failed','lodash','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','next','contact','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x57e17c,_0x3b99be){var _0x3bb416=function(_0x26c802){while(--_0x26c802){_0x57e17c['push'](_0x57e17c['shift']());}};_0x3bb416(++_0x3b99be);}(_0x7254,0x114));var _0x4725=function(_0x3324e2,_0xcca163){_0x3324e2=_0x3324e2-0x0;var _0x4ce66b=_0x7254[_0x3324e2];return _0x4ce66b;};'use strict';var _=require(_0x4725('0x0'));var moment=require(_0x4725('0x1'));var AWS=require(_0x4725('0x2'));var utils=require(_0x4725('0x3'));var logger=require('../../../../config/logger')(_0x4725('0x4'));var rpc={'chatMessage':require(_0x4725('0x5')),'openchannelMessage':require(_0x4725('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x4725('0x7')),'faxMessage':require(_0x4725('0x8')),'whatsappMessage':require(_0x4725('0x9'))};exports[_0x4725('0xa')]=function(_0x5d4f13,_0x495857){return function(_0x2efa06){try{if(!_[_0x4725('0xb')](this[_0x4725('0xc')][_0x4725('0xd')])){logger['info']('[%s][AMAZONLEX]\x20%s',_0x5d4f13,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2efa06[_0x4725('0xe')]();}var _0x4eed46={'ContactId':this[_0x4725('0xf')]['id'],'sentAt':moment()[_0x4725('0x10')](_0x4725('0x11')),'direction':_0x4725('0x12')};if(this[_0x4725('0x13')]==='sms'||this[_0x4725('0x13')]===_0x4725('0x14')){_0x4eed46['phone']=this[_0x4725('0xc')][_0x4725('0x15')];}var _0x3d999d=this[_0x4725('0x13')];if(_0x3d999d==='chat'){_0x4eed46['ChatWebsiteId']=this['account']['id'];}else{_0x4eed46[_[_0x4725('0x16')](_0x3d999d)+_0x4725('0x17')]=this[_0x4725('0x18')]['id'];}_0x4eed46[_['upperFirst'](_0x3d999d)+_0x4725('0x19')]=this['interaction']['id'];if(this['interaction'][_0x4725('0x1a')]){var _0x19be9a=_0x495857[0x4];if(!_[_0x4725('0x1b')](_0x19be9a)){_0x4eed46[_0x4725('0x1c')]=utils[_0x4725('0x1d')](_0x19be9a,this);return rpc[_0x3d999d+_0x4725('0x1e')][_0x4725('0x1f')](_0x4eed46)['then'](function(_0x5f7ea1){logger[_0x4725('0x20')](_0x4725('0x21'),_0x5d4f13,_0x4eed46['body']);})[_0x4725('0x22')](function(_0x36a626){logger[_0x4725('0x23')](_0x4725('0x21'),_0x5d4f13,JSON[_0x4725('0x24')](_0x36a626));})[_0x4725('0x25')](function(){logger[_0x4725('0x20')](_0x4725('0x26'),_0x5d4f13);_0x2efa06[_0x4725('0x27')]();});}else{logger[_0x4725('0x20')](_0x4725('0x28'),_0x5d4f13);_0x2efa06['stop']();}}else{var _0x21e132=this;var _0x246c6e=new AWS[(_0x4725('0x29'))]({'accessKeyId':_0x495857[0x0],'secretAccessKey':_0x495857[0x1],'region':_0x495857[0x2]});var _0x225973={'botAlias':_0x4725('0x2a'),'botName':_0x495857[0x3],'inputText':this[_0x4725('0x2b')][_0x4725('0x1c')],'userId':this[_0x4725('0x13')]+':'+this[_0x4725('0xc')]['id']['toString']()};_0x246c6e['postText'](_0x225973,function(_0x788f17,_0x24404a){if(_0x788f17){logger[_0x4725('0x23')](_0x4725('0x21'),_0x5d4f13,_0x788f17[_0x4725('0x2b')]);_0x2efa06[_0x4725('0xe')]();}else if(_0x24404a&&_0x24404a[_0x4725('0x2b')]){_0x21e132['body'][_0x4725('0x2c')]=_0x24404a;_0x4eed46['body']=_0x24404a[_0x4725('0x2b')];_0x4eed46[_0x4725('0x2d')]='amazonlex';_0x4eed46['providerResponse']=JSON[_0x4725('0x24')](_0x24404a);return rpc[_0x3d999d+_0x4725('0x1e')][_0x4725('0x1f')](_0x4eed46)[_0x4725('0x2e')](function(_0x265a1e){logger[_0x4725('0x20')](_0x4725('0x21'),_0x5d4f13,_0x4eed46[_0x4725('0x1c')]);if(_0x24404a[_0x4725('0x2f')]==_0x4725('0x30')){_0x2efa06[_0x4725('0xe')]();}else{_0x2efa06[_0x4725('0x27')]();}})[_0x4725('0x22')](function(_0x396d5f){logger[_0x4725('0x23')]('[%s][AMAZONLEX]\x20%s',_0x5d4f13,JSON[_0x4725('0x24')](_0x396d5f));_0x2efa06[_0x4725('0xe')]();});}else{_0x2efa06[_0x4725('0xe')]();}});}}catch(_0x5e4c73){logger['error'](_0x4725('0x21'),_0x5d4f13,JSON['stringify'](_0x5e4c73));_0x2efa06[_0x4725('0x27')]();}};}; \ No newline at end of file +var _0xf4ab=['stop','LexRuntime','message','postText','next','providerName','amazonlex','providerResponse','dialogState','Failed','lodash','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','contact','sms','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','InteractionId','body','getMustacheRender','Message','then','[%s][AMAZONLEX]\x20%s','catch','error','stringify','finally'];(function(_0xc71285,_0x267c83){var _0x2f8666=function(_0x569fe3){while(--_0x569fe3){_0xc71285['push'](_0xc71285['shift']());}};_0x2f8666(++_0x267c83);}(_0xf4ab,0xba));var _0xbf4a=function(_0x56756b,_0x3e8cc7){_0x56756b=_0x56756b-0x0;var _0xa3002=_0xf4ab[_0x56756b];return _0xa3002;};'use strict';var _=require(_0xbf4a('0x0'));var moment=require(_0xbf4a('0x1'));var AWS=require(_0xbf4a('0x2'));var utils=require(_0xbf4a('0x3'));var logger=require('../../../../config/logger')(_0xbf4a('0x4'));var rpc={'chatMessage':require(_0xbf4a('0x5')),'openchannelMessage':require(_0xbf4a('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xbf4a('0x7')),'faxMessage':require(_0xbf4a('0x8')),'whatsappMessage':require(_0xbf4a('0x9'))};exports[_0xbf4a('0xa')]=function(_0x225657,_0x352656){return function(_0x4835cf){try{if(!_[_0xbf4a('0xb')](this[_0xbf4a('0xc')][_0xbf4a('0xd')])){logger[_0xbf4a('0xe')]('[%s][AMAZONLEX]\x20%s',_0x225657,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4835cf['next']();}var _0x2f9649={'ContactId':this[_0xbf4a('0xf')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':'out'};if(this['channel']===_0xbf4a('0x10')||this[_0xbf4a('0x11')]===_0xbf4a('0x12')){_0x2f9649[_0xbf4a('0x13')]=this[_0xbf4a('0xc')]['phone'];}var _0x51e1f0=this[_0xbf4a('0x11')];if(_0x51e1f0===_0xbf4a('0x14')){_0x2f9649[_0xbf4a('0x15')]=this[_0xbf4a('0x16')]['id'];}else{_0x2f9649[_['upperFirst'](_0x51e1f0)+'AccountId']=this[_0xbf4a('0x16')]['id'];}_0x2f9649[_[_0xbf4a('0x17')](_0x51e1f0)+_0xbf4a('0x18')]=this[_0xbf4a('0xc')]['id'];if(this['interaction']['created']){var _0x276cd8=_0x352656[0x4];if(!_['isEmpty'](_0x276cd8)){_0x2f9649[_0xbf4a('0x19')]=utils[_0xbf4a('0x1a')](_0x276cd8,this);return rpc[_0x51e1f0+_0xbf4a('0x1b')]['create'](_0x2f9649)[_0xbf4a('0x1c')](function(_0x33e793){logger[_0xbf4a('0xe')](_0xbf4a('0x1d'),_0x225657,_0x2f9649['body']);})[_0xbf4a('0x1e')](function(_0xc08c3d){logger[_0xbf4a('0x1f')](_0xbf4a('0x1d'),_0x225657,JSON[_0xbf4a('0x20')](_0xc08c3d));})[_0xbf4a('0x21')](function(){logger[_0xbf4a('0xe')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x225657);_0x4835cf[_0xbf4a('0x22')]();});}else{logger['info']('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x225657);_0x4835cf[_0xbf4a('0x22')]();}}else{var _0x4ff0a8=this;var _0xed19b3=new AWS[(_0xbf4a('0x23'))]({'accessKeyId':_0x352656[0x0],'secretAccessKey':_0x352656[0x1],'region':_0x352656[0x2]});var _0x4f524f={'botAlias':'$LATEST','botName':_0x352656[0x3],'inputText':this[_0xbf4a('0x24')][_0xbf4a('0x19')],'userId':this[_0xbf4a('0x11')]+':'+this[_0xbf4a('0xc')]['id']['toString']()};_0xed19b3[_0xbf4a('0x25')](_0x4f524f,function(_0x220599,_0x4be383){if(_0x220599){logger[_0xbf4a('0x1f')](_0xbf4a('0x1d'),_0x225657,_0x220599['message']);_0x4835cf[_0xbf4a('0x26')]();}else if(_0x4be383&&_0x4be383[_0xbf4a('0x24')]){_0x4ff0a8[_0xbf4a('0x19')]['amazonlex']=_0x4be383;_0x2f9649[_0xbf4a('0x19')]=_0x4be383[_0xbf4a('0x24')];_0x2f9649[_0xbf4a('0x27')]=_0xbf4a('0x28');_0x2f9649[_0xbf4a('0x29')]=JSON[_0xbf4a('0x20')](_0x4be383);return rpc[_0x51e1f0+_0xbf4a('0x1b')]['create'](_0x2f9649)['then'](function(_0x1a2b3f){logger['info'](_0xbf4a('0x1d'),_0x225657,_0x2f9649[_0xbf4a('0x19')]);if(_0x4be383[_0xbf4a('0x2a')]==_0xbf4a('0x2b')){_0x4835cf['next']();}else{_0x4835cf['stop']();}})[_0xbf4a('0x1e')](function(_0xc55403){logger[_0xbf4a('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x225657,JSON[_0xbf4a('0x20')](_0xc55403));_0x4835cf[_0xbf4a('0x26')]();});}else{_0x4835cf['next']();}});}}catch(_0x21c8c6){logger['error'](_0xbf4a('0x1d'),_0x225657,JSON[_0xbf4a('0x20')](_0x21c8c6));_0x4835cf['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 6ae47ec..3f83d38 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 _0x92e9=['YYYY-MM-DD\x20HH:mm:ss','getMustacheRender','message','from','phone','read','subject','Re:','Re:\x20','ChatWebsiteId','upperFirst','AccountId','account','Message','inReplyTo','messageId','html','','replace','','auto-replied','All','sendMailMessage','smtpOptions','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','Interaction','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','finally','resolve','stop','lodash','moment','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../mailRpc','channel','mail','body','isAutoreply','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','Autoreply\x20already\x20sent','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','contact','format'];(function(_0x38bcf8,_0x11307d){var _0x2a035e=function(_0x35e3f0){while(--_0x35e3f0){_0x38bcf8['push'](_0x38bcf8['shift']());}};_0x2a035e(++_0x11307d);}(_0x92e9,0xae));var _0x992e=function(_0x158bda,_0x3f9a8b){_0x158bda=_0x158bda-0x0;var _0x2643fe=_0x92e9[_0x158bda];return _0x2643fe;};'use strict';var _=require(_0x992e('0x0'));var moment=require(_0x992e('0x1'));var utils=require(_0x992e('0x2'));var logger=require(_0x992e('0x3'))('routing');var rpc={'chatMessage':require(_0x992e('0x4')),'openchannelMessage':require(_0x992e('0x5')),'mailMessage':require(_0x992e('0x6')),'smsMessage':require(_0x992e('0x7')),'faxMessage':require(_0x992e('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0x992e('0x9')),'openchannelInteraction':require(_0x992e('0xa')),'mailInteraction':require(_0x992e('0xb')),'smsInteraction':require(_0x992e('0xc')),'faxInteraction':require(_0x992e('0xd')),'whatsappInteraction':require(_0x992e('0xe'))};var mailRpc=require(_0x992e('0xf'));exports['consequence']=function(_0x509ea2,_0x193eb6,_0x56226c,_0x29dedb){return function(_0x4a0bf6){try{var _0x5f3eb5=this[_0x992e('0x10')];if(_0x5f3eb5===_0x992e('0x11')&&_0x29dedb[_0x992e('0x12')][_0x992e('0x13')]){logger[_0x992e('0x14')](_0x992e('0x15'),_0x509ea2,_0x992e('0x16'));return _0x4a0bf6[_0x992e('0x17')]();}if(_0x193eb6[0x0]==='1'&&(_[_0x992e('0x18')](this[_0x992e('0x19')][_0x992e('0x1a')])||!this[_0x992e('0x19')][_0x992e('0x1a')])){logger[_0x992e('0x14')](_0x992e('0x15'),_0x509ea2,_0x992e('0x1b'));return _0x4a0bf6['next']();}if(_0x193eb6[0x0]==='2'&&this[_0x992e('0x19')][_0x992e('0x1c')]){logger[_0x992e('0x14')](_0x992e('0x1d'),_0x509ea2,_0x992e('0x1e'));return _0x4a0bf6[_0x992e('0x17')]();}var _0x4a7b72={'ContactId':this[_0x992e('0x1f')]['id'],'sentAt':moment()[_0x992e('0x20')](_0x992e('0x21')),'direction':'out'};if(this[_0x992e('0x10')]===_0x992e('0x11')){_0x4a7b72['body']=utils[_0x992e('0x22')](_0x193eb6[0x2],this);}else{_0x4a7b72['body']=utils[_0x992e('0x22')](_0x193eb6[0x1],this);}if(this[_0x992e('0x23')]){_0x4a7b72['to']=this[_0x992e('0x23')][_0x992e('0x24')]||'';if(this['channel']==='mail'&&_0x193eb6[0x1]==='1'){_0x4a7b72['cc']=this['message']['cc']||'';}_0x4a7b72[_0x992e('0x24')]=this[_0x992e('0x23')]['to']||'';_0x4a7b72[_0x992e('0x25')]=this[_0x992e('0x23')]['phone']||'';_0x4a7b72[_0x992e('0x26')]=!![];if(this[_0x992e('0x23')][_0x992e('0x27')]){_0x4a7b72[_0x992e('0x27')]='';_0x4a7b72['subject']+=_['startsWith'](this[_0x992e('0x23')]['subject'],_0x992e('0x28'))?'':_0x992e('0x29');_0x4a7b72[_0x992e('0x27')]+=this['message']['subject'];}}if(this[_0x992e('0x10')]==='chat'){_0x4a7b72[_0x992e('0x2a')]=this['account']['id'];}else{_0x4a7b72[_[_0x992e('0x2b')](this[_0x992e('0x10')])+_0x992e('0x2c')]=this[_0x992e('0x2d')]['id'];}_0x4a7b72[_[_0x992e('0x2b')](this[_0x992e('0x10')])+'InteractionId']=this[_0x992e('0x19')]['id'];var _0x4012e6=this['interaction'];if(rpc[this['channel']+_0x992e('0x2e')]){if(this[_0x992e('0x10')]===_0x992e('0x11')){_0x4a7b72[_0x992e('0x2f')]=this['message'][_0x992e('0x30')];_0x4a7b72[_0x992e('0x31')]=_0x992e('0x32')+_[_0x992e('0x33')](_0x4a7b72[_0x992e('0x12')],'','','headers','auto-replied','All','smtpOptions','[%s][AUTOREPLY]\x20SMTP\x20SENT','then','stringify','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction'];(function(_0x2109ec,_0x59a97b){var _0x100c87=function(_0x413fc9){while(--_0x413fc9){_0x2109ec['push'](_0x2109ec['shift']());}};_0x100c87(++_0x59a97b);}(_0x5045,0x14b));var _0x5504=function(_0x32d5a4,_0x3d3907){_0x32d5a4=_0x32d5a4-0x0;var _0x227c23=_0x5045[_0x32d5a4];return _0x227c23;};'use strict';var _=require(_0x5504('0x0'));var moment=require(_0x5504('0x1'));var utils=require(_0x5504('0x2'));var logger=require(_0x5504('0x3'))(_0x5504('0x4'));var rpc={'chatMessage':require(_0x5504('0x5')),'openchannelMessage':require(_0x5504('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x5504('0x7')),'whatsappMessage':require(_0x5504('0x8')),'chatInteraction':require(_0x5504('0x9')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0x5504('0xa')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x5504('0xb'));exports[_0x5504('0xc')]=function(_0x92adfb,_0x110998,_0x273c64,_0x419d8e){return function(_0x1e8a95){try{var _0x48ae9a=this[_0x5504('0xd')];if(_0x48ae9a===_0x5504('0xe')&&_0x419d8e[_0x5504('0xf')]['isAutoreply']){logger[_0x5504('0x10')](_0x5504('0x11'),_0x92adfb,_0x5504('0x12'));return _0x1e8a95[_0x5504('0x13')]();}if(_0x110998[0x0]==='1'&&(_[_0x5504('0x14')](this[_0x5504('0x15')][_0x5504('0x16')])||!this[_0x5504('0x15')][_0x5504('0x16')])){logger[_0x5504('0x10')]('[%s][AUTOREPLY]\x20%s',_0x92adfb,'Autoreply\x20already\x20sent');return _0x1e8a95[_0x5504('0x13')]();}if(_0x110998[0x0]==='2'&&this['interaction'][_0x5504('0x17')]){logger[_0x5504('0x10')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x92adfb,_0x5504('0x18'));return _0x1e8a95['next']();}var _0x3ccd58={'ContactId':this[_0x5504('0x19')]['id'],'sentAt':moment()[_0x5504('0x1a')](_0x5504('0x1b')),'direction':'out'};if(this[_0x5504('0xd')]===_0x5504('0xe')){_0x3ccd58[_0x5504('0xf')]=utils[_0x5504('0x1c')](_0x110998[0x2],this);}else{_0x3ccd58[_0x5504('0xf')]=utils[_0x5504('0x1c')](_0x110998[0x1],this);}if(this[_0x5504('0x1d')]){_0x3ccd58['to']=this[_0x5504('0x1d')][_0x5504('0x1e')]||'';if(this['channel']===_0x5504('0xe')&&_0x110998[0x1]==='1'){_0x3ccd58['cc']=this[_0x5504('0x1d')]['cc']||'';}_0x3ccd58[_0x5504('0x1e')]=this[_0x5504('0x1d')]['to']||'';_0x3ccd58['phone']=this[_0x5504('0x1d')]['phone']||'';_0x3ccd58[_0x5504('0x1f')]=!![];if(this[_0x5504('0x1d')][_0x5504('0x20')]){_0x3ccd58['subject']='';_0x3ccd58['subject']+=_['startsWith'](this[_0x5504('0x1d')][_0x5504('0x20')],_0x5504('0x21'))?'':_0x5504('0x22');_0x3ccd58[_0x5504('0x20')]+=this[_0x5504('0x1d')][_0x5504('0x20')];}}if(this[_0x5504('0xd')]===_0x5504('0x23')){_0x3ccd58[_0x5504('0x24')]=this[_0x5504('0x25')]['id'];}else{_0x3ccd58[_['upperFirst'](this['channel'])+_0x5504('0x26')]=this[_0x5504('0x25')]['id'];}_0x3ccd58[_['upperFirst'](this['channel'])+'InteractionId']=this['interaction']['id'];var _0x4e4f6a=this[_0x5504('0x15')];if(rpc[this[_0x5504('0xd')]+_0x5504('0x27')]){if(this[_0x5504('0xd')]==='mail'){_0x3ccd58[_0x5504('0x28')]=this[_0x5504('0x1d')][_0x5504('0x29')];_0x3ccd58[_0x5504('0x2a')]=_0x5504('0x2b')+_['replace'](_0x3ccd58['body'],_0x5504('0x2c'),_0x5504('0x2d'))+_0x5504('0x2e');_0x3ccd58[_0x5504('0x2f')]={'Auto-Submitted':_0x5504('0x30'),'X-Auto-Response-Suppress':_0x5504('0x31'),'Precedence':'auto_reply'};return mailRpc['sendMailMessage'](this[_0x5504('0x25')][_0x5504('0x32')],_0x3ccd58)['then'](function(_0x5d2651){logger[_0x5504('0x10')](_0x5504('0x33'),_0x92adfb);_0x3ccd58['messageId']=_0x5d2651[_0x5504('0x1d')][_0x5504('0x29')];return rpc[_0x48ae9a+_0x5504('0x27')]['create'](_0x3ccd58);})[_0x5504('0x34')](function(_0x6c9847){logger[_0x5504('0x10')](_0x5504('0x11'),_0x92adfb,JSON[_0x5504('0x35')](_0x6c9847));})['catch'](function(_0x5b0f5b){logger[_0x5504('0x36')](_0x5504('0x37'),_0x92adfb,JSON[_0x5504('0x35')](_0x5b0f5b));})[_0x5504('0x38')](function(){Promise[_0x5504('0x39')]()[_0x5504('0x34')](function(){if(_0x110998[0x0]!=='2'||_0x4e4f6a[_0x5504('0x17')])return;return rpc[_0x48ae9a+_0x5504('0x3a')][_0x5504('0x3b')](_0x4e4f6a['id'],{'autoreplyExecuted':!![]})['then'](function(_0x6ee4c1){logger[_0x5504('0x10')](_0x5504('0x3c'),_0x92adfb,JSON[_0x5504('0x35')](_0x6ee4c1));})[_0x5504('0x3d')](function(_0x139e82){logger[_0x5504('0x36')](_0x5504('0x3e'),_0x92adfb,JSON['stringify'](_0x139e82));});})[_0x5504('0x34')](function(){_0x1e8a95[_0x5504('0x13')]();});});}else{return rpc[this[_0x5504('0xd')]+_0x5504('0x27')][_0x5504('0x3f')](_0x3ccd58)['then'](function(){logger['info'](_0x5504('0x11'),_0x92adfb,_0x3ccd58['body']);})['catch'](function(_0x24578c){logger[_0x5504('0x36')]('[%s][AUTOREPLY]\x20%s',_0x92adfb,JSON[_0x5504('0x35')](_0x24578c));})['finally'](function(){Promise[_0x5504('0x39')]()[_0x5504('0x34')](function(){if(_0x110998[0x0]!=='2'||_0x4e4f6a['autoreplyExecuted'])return;return rpc[_0x48ae9a+_0x5504('0x3a')]['update'](_0x4e4f6a['id'],{'autoreplyExecuted':!![]})['then'](function(_0x238323){logger[_0x5504('0x10')](_0x5504('0x3c'),_0x92adfb,JSON[_0x5504('0x35')](_0x238323));})[_0x5504('0x3d')](function(_0x3e7748){logger[_0x5504('0x36')]('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x92adfb,JSON['stringify'](_0x3e7748));});})[_0x5504('0x34')](function(){_0x1e8a95[_0x5504('0x13')]();});});}}}catch(_0x241176){logger[_0x5504('0x36')](_0x5504('0x11'),_0x92adfb,JSON[_0x5504('0x35')](_0x241176));_0x1e8a95[_0x5504('0x40')]();}};}; \ 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 8d6ee3e..c397a62 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 _0x37cd=['moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop'];(function(_0x1ae121,_0x40a449){var _0x371bdb=function(_0x59f9bf){while(--_0x59f9bf){_0x1ae121['push'](_0x1ae121['shift']());}};_0x371bdb(++_0x40a449);}(_0x37cd,0xe7));var _0xd37c=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x37cd[_0x3947c9];return _0x2e7871;};'use strict';var moment=require(_0xd37c('0x0'));var logger=require(_0xd37c('0x1'))('routing');var rpc={'chatInteraction':require(_0xd37c('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xd37c('0x3')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0xd37c('0x4')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports['consequence']=function(_0x27b298,_0x203e8a,_0x1690b1,_0x22fae7){return function(_0x4b6e6b){try{logger[_0xd37c('0x5')](_0xd37c('0x6'),_0x27b298,_0x203e8a[0x0]);var _0x226ed0={'closed':0x1,'closedAt':moment()[_0xd37c('0x7')](_0xd37c('0x8')),'closeReason':'system','disposition':_0x203e8a[0x0]};if(rpc[_0x22fae7[_0xd37c('0x9')]+'Interaction']){rpc[_0x22fae7['channel']+_0xd37c('0xa')][_0xd37c('0xb')](_0x22fae7[_0xd37c('0xc')]['id'],_0x226ed0)[_0xd37c('0xd')](function(_0x92ed0){logger[_0xd37c('0x5')](_0xd37c('0xe'),_0x27b298,_0x22fae7['interaction']['id']);})[_0xd37c('0xf')](function(_0x24bdb9){logger[_0xd37c('0x10')](_0xd37c('0x11'),_0x27b298,JSON[_0xd37c('0x12')](_0x24bdb9));})[_0xd37c('0x13')](function(){_0x4b6e6b[_0xd37c('0x14')]();});}}catch(_0x35d46a){logger[_0xd37c('0x10')](_0xd37c('0x11'),_0x27b298,JSON[_0xd37c('0x12')](_0x35d46a));_0x4b6e6b[_0xd37c('0x14')]();}};}; \ No newline at end of file +var _0xca59=['../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','[%s][CLOSE]\x20%s','stringify','finally','error','stop','moment','../../../../config/logger','routing'];(function(_0x500c56,_0x2a6af7){var _0x2bf300=function(_0x1fcc6a){while(--_0x1fcc6a){_0x500c56['push'](_0x500c56['shift']());}};_0x2bf300(++_0x2a6af7);}(_0xca59,0x7a));var _0x9ca5=function(_0x5ca4e2,_0x598d4a){_0x5ca4e2=_0x5ca4e2-0x0;var _0x61deed=_0xca59[_0x5ca4e2];return _0x61deed;};'use strict';var moment=require(_0x9ca5('0x0'));var logger=require(_0x9ca5('0x1'))(_0x9ca5('0x2'));var rpc={'chatInteraction':require(_0x9ca5('0x3')),'openchannelInteraction':require(_0x9ca5('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x9ca5('0x5')),'faxInteraction':require(_0x9ca5('0x6')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x9ca5('0x7')]=function(_0x615738,_0x12b500,_0x3ef2ff,_0x28d052){return function(_0x3ecc9b){try{logger[_0x9ca5('0x8')](_0x9ca5('0x9'),_0x615738,_0x12b500[0x0]);var _0x27f1b3={'closed':0x1,'closedAt':moment()[_0x9ca5('0xa')](_0x9ca5('0xb')),'closeReason':_0x9ca5('0xc'),'disposition':_0x12b500[0x0]};if(rpc[_0x28d052[_0x9ca5('0xd')]+_0x9ca5('0xe')]){rpc[_0x28d052['channel']+'Interaction'][_0x9ca5('0xf')](_0x28d052[_0x9ca5('0x10')]['id'],_0x27f1b3)[_0x9ca5('0x11')](function(_0x3207c1){logger[_0x9ca5('0x8')](_0x9ca5('0x12'),_0x615738,_0x28d052['interaction']['id']);})[_0x9ca5('0x13')](function(_0x13a747){logger['error'](_0x9ca5('0x14'),_0x615738,JSON[_0x9ca5('0x15')](_0x13a747));})[_0x9ca5('0x16')](function(){_0x3ecc9b['stop']();});}}catch(_0x53c576){logger[_0x9ca5('0x17')](_0x9ca5('0x14'),_0x615738,JSON['stringify'](_0x53c576));_0x3ecc9b[_0x9ca5('0x18')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 92ad02f..c0872a4 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 _0x7374=['out','channel','sms','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','create','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','then','result','fulfillment','speech','providerName','dialogflow','metadata','endConversation','stop','lodash','moment','apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','next','contact'];(function(_0x1b122,_0x1da9df){var _0x52742e=function(_0xfd49a5){while(--_0xfd49a5){_0x1b122['push'](_0x1b122['shift']());}};_0x52742e(++_0x1da9df);}(_0x7374,0x1b9));var _0x4737=function(_0x3f495e,_0x2be967){_0x3f495e=_0x3f495e-0x0;var _0x34c1f2=_0x7374[_0x3f495e];return _0x34c1f2;};'use strict';var _=require(_0x4737('0x0'));var moment=require(_0x4737('0x1'));var apiai=require(_0x4737('0x2'));var md5=require(_0x4737('0x3'));var utils=require(_0x4737('0x4'));var logger=require('../../../../config/logger')(_0x4737('0x5'));var rpc={'chatMessage':require(_0x4737('0x6')),'openchannelMessage':require(_0x4737('0x7')),'mailMessage':require(_0x4737('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x4737('0x9'))};exports[_0x4737('0xa')]=function(_0x311410,_0x3d18dd){return function(_0x4f9804){try{if(!_[_0x4737('0xb')](this[_0x4737('0xc')][_0x4737('0xd')])){logger[_0x4737('0xe')](_0x4737('0xf'),_0x311410,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x4f9804[_0x4737('0x10')]();}var _0x3a51a8={'ContactId':this[_0x4737('0x11')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x4737('0x12')};if(this[_0x4737('0x13')]===_0x4737('0x14')||this[_0x4737('0x13')]===_0x4737('0x15')){_0x3a51a8[_0x4737('0x16')]=this[_0x4737('0xc')][_0x4737('0x16')];}var _0x130705=this['channel'];if(_0x130705===_0x4737('0x17')){_0x3a51a8[_0x4737('0x18')]=this[_0x4737('0x19')]['id'];}else{_0x3a51a8[_[_0x4737('0x1a')](_0x130705)+_0x4737('0x1b')]=this['account']['id'];}_0x3a51a8[_['upperFirst'](_0x130705)+_0x4737('0x1c')]=this['interaction']['id'];if(this[_0x4737('0xc')][_0x4737('0x1d')]){var _0x5f415d=_0x3d18dd[0x2];if(!_[_0x4737('0x1e')](_0x5f415d)){_0x3a51a8[_0x4737('0x1f')]=utils[_0x4737('0x20')](_0x5f415d,this);return rpc[_0x130705+'Message'][_0x4737('0x21')](_0x3a51a8)['then'](function(_0x37b74d){logger[_0x4737('0xe')](_0x4737('0xf'),_0x311410,_0x3a51a8[_0x4737('0x1f')]);})[_0x4737('0x22')](function(_0x4f1b09){logger[_0x4737('0x23')](_0x4737('0xf'),_0x311410,JSON[_0x4737('0x24')](_0x4f1b09));})[_0x4737('0x25')](function(){logger['info'](_0x4737('0x26'),_0x311410);_0x4f9804['stop']();});}else{logger[_0x4737('0xe')](_0x4737('0x27'),_0x311410);_0x4f9804['stop']();}}else{var _0x67fac=this;var _0x1c004f=apiai(_0x3d18dd[0x0],{'language':_0x3d18dd[0x1]||'en'});return _0x1c004f[_0x4737('0x28')](this[_0x4737('0x29')]['body'],{'sessionId':md5(this[_0x4737('0xc')]['id'])})[_0x4737('0x2a')](function(_0x49eddf){_0x67fac[_0x4737('0x1f')]['dialogflow']=_0x49eddf;_0x3a51a8[_0x4737('0x1f')]=_0x49eddf[_0x4737('0x2b')][_0x4737('0x2c')][_0x4737('0x2d')];_0x3a51a8[_0x4737('0x2e')]=_0x4737('0x2f');_0x3a51a8['providerResponse']=JSON[_0x4737('0x24')](_0x49eddf);return rpc[_0x130705+'Message'][_0x4737('0x21')](_0x3a51a8)['then'](function(_0x29618d){logger[_0x4737('0xe')](_0x4737('0xf'),_0x311410,_0x3a51a8['body']);if(_0x49eddf['result'][_0x4737('0x30')][_0x4737('0x31')]){_0x4f9804[_0x4737('0x10')]();}else{_0x4f9804[_0x4737('0x32')]();}})[_0x4737('0x22')](function(_0x5d6a2a){logger[_0x4737('0x23')](_0x4737('0xf'),_0x311410,JSON[_0x4737('0x24')](_0x5d6a2a));_0x4f9804[_0x4737('0x10')]();});})[_0x4737('0x22')](function(_0x2e1689){logger[_0x4737('0x23')](_0x4737('0xf'),_0x311410,_0x2e1689['message']);_0x4f9804[_0x4737('0x10')]();});}}catch(_0x365d66){logger[_0x4737('0x23')](_0x4737('0xf'),_0x311410,JSON[_0x4737('0x24')](_0x365d66));_0x4f9804[_0x4737('0x32')]();}};}; \ No newline at end of file +var _0x8e20=['create','then','body','catch','error','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','message','dialogflow','result','fulfillment','speech','providerResponse','stringify','metadata','endConversation','lodash','moment','apiai-promise','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','next','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','ChatWebsiteId','account','upperFirst','InteractionId','getMustacheRender','Message'];(function(_0x3e5fcf,_0x2ad9c2){var _0x4487b7=function(_0x1b9214){while(--_0x1b9214){_0x3e5fcf['push'](_0x3e5fcf['shift']());}};_0x4487b7(++_0x2ad9c2);}(_0x8e20,0x1af));var _0x08e2=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x8e20[_0x31cb5f];return _0x586042;};'use strict';var _=require(_0x08e2('0x0'));var moment=require(_0x08e2('0x1'));var apiai=require(_0x08e2('0x2'));var md5=require('md5');var utils=require(_0x08e2('0x3'));var logger=require(_0x08e2('0x4'))('routing');var rpc={'chatMessage':require(_0x08e2('0x5')),'openchannelMessage':require(_0x08e2('0x6')),'mailMessage':require(_0x08e2('0x7')),'smsMessage':require(_0x08e2('0x8')),'faxMessage':require(_0x08e2('0x9')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x08e2('0xa')]=function(_0x427444,_0x5e5a52){return function(_0x24af30){try{if(!_[_0x08e2('0xb')](this[_0x08e2('0xc')][_0x08e2('0xd')])){logger[_0x08e2('0xe')](_0x08e2('0xf'),_0x427444,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x24af30[_0x08e2('0x10')]();}var _0x4eb644={'ContactId':this['contact']['id'],'sentAt':moment()[_0x08e2('0x11')](_0x08e2('0x12')),'direction':_0x08e2('0x13')};if(this[_0x08e2('0x14')]==='sms'||this['channel']===_0x08e2('0x15')){_0x4eb644['phone']=this['interaction'][_0x08e2('0x16')];}var _0x56e01c=this[_0x08e2('0x14')];if(_0x56e01c==='chat'){_0x4eb644[_0x08e2('0x17')]=this['account']['id'];}else{_0x4eb644[_['upperFirst'](_0x56e01c)+'AccountId']=this[_0x08e2('0x18')]['id'];}_0x4eb644[_[_0x08e2('0x19')](_0x56e01c)+_0x08e2('0x1a')]=this['interaction']['id'];if(this['interaction']['created']){var _0x5794c9=_0x5e5a52[0x2];if(!_['isEmpty'](_0x5794c9)){_0x4eb644['body']=utils[_0x08e2('0x1b')](_0x5794c9,this);return rpc[_0x56e01c+_0x08e2('0x1c')][_0x08e2('0x1d')](_0x4eb644)[_0x08e2('0x1e')](function(_0xb1e01a){logger[_0x08e2('0xe')](_0x08e2('0xf'),_0x427444,_0x4eb644[_0x08e2('0x1f')]);})[_0x08e2('0x20')](function(_0x3ebd09){logger[_0x08e2('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x427444,JSON['stringify'](_0x3ebd09));})['finally'](function(){logger[_0x08e2('0xe')](_0x08e2('0x22'),_0x427444);_0x24af30['stop']();});}else{logger[_0x08e2('0xe')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x427444);_0x24af30[_0x08e2('0x23')]();}}else{var _0x53f3ab=this;var _0x416e6c=apiai(_0x5e5a52[0x0],{'language':_0x5e5a52[0x1]||'en'});return _0x416e6c[_0x08e2('0x24')](this[_0x08e2('0x25')][_0x08e2('0x1f')],{'sessionId':md5(this[_0x08e2('0xc')]['id'])})['then'](function(_0x5878a9){_0x53f3ab['body'][_0x08e2('0x26')]=_0x5878a9;_0x4eb644[_0x08e2('0x1f')]=_0x5878a9[_0x08e2('0x27')][_0x08e2('0x28')][_0x08e2('0x29')];_0x4eb644['providerName']='dialogflow';_0x4eb644[_0x08e2('0x2a')]=JSON[_0x08e2('0x2b')](_0x5878a9);return rpc[_0x56e01c+_0x08e2('0x1c')][_0x08e2('0x1d')](_0x4eb644)['then'](function(_0x107ab9){logger['info'](_0x08e2('0xf'),_0x427444,_0x4eb644[_0x08e2('0x1f')]);if(_0x5878a9[_0x08e2('0x27')][_0x08e2('0x2c')][_0x08e2('0x2d')]){_0x24af30[_0x08e2('0x10')]();}else{_0x24af30[_0x08e2('0x23')]();}})[_0x08e2('0x20')](function(_0x5b371b){logger[_0x08e2('0x21')](_0x08e2('0xf'),_0x427444,JSON[_0x08e2('0x2b')](_0x5b371b));_0x24af30[_0x08e2('0x10')]();});})['catch'](function(_0x2ab732){logger[_0x08e2('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x427444,_0x2ab732[_0x08e2('0x25')]);_0x24af30['next']();});}}catch(_0x492e6b){logger[_0x08e2('0x21')](_0x08e2('0xf'),_0x427444,JSON[_0x08e2('0x2b')](_0x492e6b));_0x24af30[_0x08e2('0x23')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflowV2.js b/server/services/routing/server/applications/dialogflowV2.js index 066fa22..62fd154 100644 --- a/server/services/routing/server/applications/dialogflowV2.js +++ b/server/services/routing/server/applications/dialogflowV2.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a8d=['md5','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','ChatWebsiteId','account','upperFirst','AccountId','created','getMustacheRender','create','then','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','displayName','isFallback','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerName','providerResponse','fulfillmentText','push','all','lodash','dialogflow'];(function(_0x58e689,_0x52ee84){var _0x50d2c1=function(_0x406034){while(--_0x406034){_0x58e689['push'](_0x58e689['shift']());}};_0x50d2c1(++_0x52ee84);}(_0x2a8d,0x11e));var _0xd2a8=function(_0x1b0bcc,_0x4af3f1){_0x1b0bcc=_0x1b0bcc-0x0;var _0x497cf9=_0x2a8d[_0x1b0bcc];return _0x497cf9;};'use strict';var _=require(_0xd2a8('0x0'));var dialogflow=require(_0xd2a8('0x1'));var md5=require(_0xd2a8('0x2'));var moment=require(_0xd2a8('0x3'));var Promise=require(_0xd2a8('0x4'));var logger=require(_0xd2a8('0x5'))(_0xd2a8('0x6'));var utils=require(_0xd2a8('0x7'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xd2a8('0x8')),'smsMessage':require(_0xd2a8('0x9')),'faxMessage':require(_0xd2a8('0xa')),'whatsappMessage':require(_0xd2a8('0xb'))};function createMessage(_0x39996b,_0x254707,_0xa57f65,_0x18e038){return new Promise(function(_0x4f0824,_0x4d07ae){var _0x5f2b46=_['clone'](_0xa57f65);_0x5f2b46[_0xd2a8('0xc')]=_0x18e038;return rpc[_0x254707+_0xd2a8('0xd')]['create'](_0x5f2b46)['then'](function(){logger[_0xd2a8('0xe')](_0xd2a8('0xf'),_0x39996b,_0x5f2b46['body']);_0x4f0824();})[_0xd2a8('0x10')](function(_0x11d0e2){logger[_0xd2a8('0x11')](_0xd2a8('0xf'),_0x39996b,JSON[_0xd2a8('0x12')](_0x11d0e2));_0x4d07ae(_0x11d0e2);});});}exports[_0xd2a8('0x13')]=function(_0x242e7d,_0x1ee46f){return function(_0x229e2f){try{if(!_['isNil'](this[_0xd2a8('0x14')][_0xd2a8('0x15')])){logger['info'](_0xd2a8('0xf'),_0x242e7d,_0xd2a8('0x16'));return _0x229e2f[_0xd2a8('0x17')]();}var _0x4bcb3c={'ContactId':this[_0xd2a8('0x18')]['id'],'sentAt':moment()[_0xd2a8('0x19')](_0xd2a8('0x1a')),'direction':'out'};if(this[_0xd2a8('0x1b')]===_0xd2a8('0x1c')||this[_0xd2a8('0x1b')]===_0xd2a8('0x1d')){_0x4bcb3c[_0xd2a8('0x1e')]=this[_0xd2a8('0x14')][_0xd2a8('0x1e')];}var _0x29a678=this[_0xd2a8('0x1b')];if(_0x29a678==='chat'){_0x4bcb3c[_0xd2a8('0x1f')]=this[_0xd2a8('0x20')]['id'];}else{_0x4bcb3c[_[_0xd2a8('0x21')](_0x29a678)+_0xd2a8('0x22')]=this['account']['id'];}_0x4bcb3c[_['upperFirst'](_0x29a678)+'InteractionId']=this[_0xd2a8('0x14')]['id'];if(this[_0xd2a8('0x14')][_0xd2a8('0x23')]){var _0x33e7b6=_0x1ee46f[0x4];if(!_['isEmpty'](_0x33e7b6)){_0x4bcb3c[_0xd2a8('0xc')]=utils[_0xd2a8('0x24')](_0x33e7b6,this);return rpc[_0x29a678+_0xd2a8('0xd')][_0xd2a8('0x25')](_0x4bcb3c)[_0xd2a8('0x26')](function(_0x5b9aeb){logger[_0xd2a8('0xe')](_0xd2a8('0xf'),_0x242e7d,_0x4bcb3c['body']);})[_0xd2a8('0x10')](function(_0x1e460e){logger['error'](_0xd2a8('0xf'),_0x242e7d,JSON[_0xd2a8('0x12')](_0x1e460e));})[_0xd2a8('0x27')](function(){logger['info'](_0xd2a8('0x28'),_0x242e7d);_0x229e2f[_0xd2a8('0x29')]();});}else{logger[_0xd2a8('0xe')](_0xd2a8('0x2a'),_0x242e7d);_0x229e2f[_0xd2a8('0x29')]();}}else{var _0xcd992b=this;var _0x5b0bbb=_0x1ee46f[0x2][_0xd2a8('0x2b')](/\\n/g,'\x0a');var _0x577bb4={'credentials':{'private_key':_0x5b0bbb,'client_email':_0x1ee46f[0x1]}};var _0xa00af2=new dialogflow[(_0xd2a8('0x2c'))](_0x577bb4);var _0x1a0c55=_0xa00af2[_0xd2a8('0x2d')](_0x1ee46f[0x0],md5(_0xcd992b['interaction']['id']));var _0x44a728={'session':_0x1a0c55,'queryInput':{'text':{'text':_0xcd992b[_0xd2a8('0x2e')]['body'],'languageCode':_0x1ee46f[0x3]||'en'}}};return _0xa00af2[_0xd2a8('0x2f')](_0x44a728)[_0xd2a8('0x26')](function(_0x209241){if(_0x209241&&_0x209241[_0xd2a8('0x30')]){_0xcd992b['body'][_0xd2a8('0x31')]=_0x209241;var _0x4b51a2=_0x209241[0x0];var _0x1de233=_0x4b51a2[_0xd2a8('0x32')][_0xd2a8('0x33')]&&_0x4b51a2[_0xd2a8('0x32')][_0xd2a8('0x33')]['fields']?_0x4b51a2[_0xd2a8('0x32')][_0xd2a8('0x33')][_0xd2a8('0x34')][_0xd2a8('0x35')][_0xd2a8('0x36')]:![];_0xcd992b['body']['DIALOGFLOWV2_ACTION']=_0x4b51a2[_0xd2a8('0x32')][_0xd2a8('0x37')];_0xcd992b[_0xd2a8('0xc')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x4b51a2[_0xd2a8('0x32')][_0xd2a8('0x38')];_0xcd992b[_0xd2a8('0xc')][_0xd2a8('0x39')]=_0x4b51a2['queryResult'][_0xd2a8('0x33')]&&_0x4b51a2[_0xd2a8('0x32')][_0xd2a8('0x33')]['fields']?_0x4b51a2[_0xd2a8('0x32')][_0xd2a8('0x33')]['fields'][_0xd2a8('0x35')][_0xd2a8('0x36')]:![];_0xcd992b[_0xd2a8('0xc')][_0xd2a8('0x3a')]=_0x4b51a2['queryResult'][_0xd2a8('0x3b')][_0xd2a8('0x3c')];_0xcd992b[_0xd2a8('0xc')]['DIALOGFLOWV2_INTENTDISPLAYNAME']=_0x4b51a2[_0xd2a8('0x32')]['intent'][_0xd2a8('0x3d')];_0xcd992b[_0xd2a8('0xc')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x4b51a2[_0xd2a8('0x32')][_0xd2a8('0x3b')][_0xd2a8('0x3e')];_0xcd992b['body'][_0xd2a8('0x3f')]=_0x4b51a2[_0xd2a8('0x32')]['languageCode'];_0xcd992b['body'][_0xd2a8('0x40')]=_0x4b51a2[_0xd2a8('0x32')][_0xd2a8('0x41')];_0xcd992b['body'][_0xd2a8('0x42')]=_0x4b51a2[_0xd2a8('0x32')]['intentDetectionConfidence'];_0x4bcb3c[_0xd2a8('0x43')]='dialogflowV2';_0x4bcb3c[_0xd2a8('0x44')]=JSON[_0xd2a8('0x12')](_0x209241);var _0x446926=[];for(var _0x320d6e=0x0;_0x320d6e<_0x209241[_0xd2a8('0x30')];_0x320d6e++){var _0x1b0d7e=_0x209241[_0x320d6e];if(_0x1b0d7e&&_0x1b0d7e['queryResult']&&_0x1b0d7e[_0xd2a8('0x32')][_0xd2a8('0x45')]){_0x446926[_0xd2a8('0x46')](createMessage(_0x242e7d,_0x29a678,_0x4bcb3c,_0x1b0d7e[_0xd2a8('0x32')][_0xd2a8('0x45')]));}}return Promise[_0xd2a8('0x47')](_0x446926)['then'](function(){if(_0x1de233){_0x229e2f[_0xd2a8('0x17')]();}else{_0x229e2f[_0xd2a8('0x29')]();}})[_0xd2a8('0x10')](function(_0x1be3cc){logger[_0xd2a8('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x242e7d,JSON['stringify'](_0x1be3cc));_0x229e2f[_0xd2a8('0x17')]();});}})[_0xd2a8('0x10')](function(_0x58e0c6){logger[_0xd2a8('0x11')](_0xd2a8('0xf'),_0x242e7d,_0x58e0c6[_0xd2a8('0x2e')]);_0x229e2f[_0xd2a8('0x17')]();});}}catch(_0x576250){logger[_0xd2a8('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x242e7d,JSON['stringify'](_0x576250));_0x229e2f['stop']();}};}; \ No newline at end of file +var _0x1500=['catch','[%s][DIALOGFLOWV2]\x20%s','consequence','UserId','info','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','interaction','created','isEmpty','getMustacheRender','then','error','stringify','finally','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','detectIntent','length','queryResult','diagnosticInfo','fields','DIALOGFLOWV2_ACTION','action','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_LANGUAGECODE','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','providerName','dialogflowV2','providerResponse','push','fulfillmentText','all','dialogflow','md5','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','body','Message','create'];(function(_0x2d076e,_0x136d59){var _0xaa9a4c=function(_0x535114){while(--_0x535114){_0x2d076e['push'](_0x2d076e['shift']());}};_0xaa9a4c(++_0x136d59);}(_0x1500,0x191));var _0x0150=function(_0x37d683,_0x3c2106){_0x37d683=_0x37d683-0x0;var _0x11d4f4=_0x1500[_0x37d683];return _0x11d4f4;};'use strict';var _=require('lodash');var dialogflow=require(_0x0150('0x0'));var md5=require(_0x0150('0x1'));var moment=require('moment');var Promise=require(_0x0150('0x2'));var logger=require(_0x0150('0x3'))(_0x0150('0x4'));var utils=require('./utils');var rpc={'chatMessage':require(_0x0150('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x0150('0x6')),'smsMessage':require(_0x0150('0x7')),'faxMessage':require(_0x0150('0x8')),'whatsappMessage':require(_0x0150('0x9'))};function createMessage(_0x259566,_0x2cc668,_0x13d1b4,_0x55dabb){return new Promise(function(_0x40d4f,_0x5d7d10){var _0x4ffadf=_['clone'](_0x13d1b4);_0x4ffadf[_0x0150('0xa')]=_0x55dabb;return rpc[_0x2cc668+_0x0150('0xb')][_0x0150('0xc')](_0x4ffadf)['then'](function(){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x259566,_0x4ffadf[_0x0150('0xa')]);_0x40d4f();})[_0x0150('0xd')](function(_0x26dfa1){logger['error'](_0x0150('0xe'),_0x259566,JSON['stringify'](_0x26dfa1));_0x5d7d10(_0x26dfa1);});});}exports[_0x0150('0xf')]=function(_0x45f301,_0x47df25){return function(_0x101e09){try{if(!_['isNil'](this['interaction'][_0x0150('0x10')])){logger[_0x0150('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x45f301,_0x0150('0x12'));return _0x101e09[_0x0150('0x13')]();}var _0x10b3eb={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0x0150('0x14')),'direction':_0x0150('0x15')};if(this['channel']==='sms'||this[_0x0150('0x16')]===_0x0150('0x17')){_0x10b3eb[_0x0150('0x18')]=this['interaction'][_0x0150('0x18')];}var _0xa7cb51=this[_0x0150('0x16')];if(_0xa7cb51===_0x0150('0x19')){_0x10b3eb[_0x0150('0x1a')]=this[_0x0150('0x1b')]['id'];}else{_0x10b3eb[_[_0x0150('0x1c')](_0xa7cb51)+_0x0150('0x1d')]=this[_0x0150('0x1b')]['id'];}_0x10b3eb[_[_0x0150('0x1c')](_0xa7cb51)+_0x0150('0x1e')]=this[_0x0150('0x1f')]['id'];if(this[_0x0150('0x1f')][_0x0150('0x20')]){var _0x360107=_0x47df25[0x4];if(!_[_0x0150('0x21')](_0x360107)){_0x10b3eb['body']=utils[_0x0150('0x22')](_0x360107,this);return rpc[_0xa7cb51+_0x0150('0xb')][_0x0150('0xc')](_0x10b3eb)[_0x0150('0x23')](function(_0x4175b7){logger[_0x0150('0x11')]('[%s][DIALOGFLOWV2]\x20%s',_0x45f301,_0x10b3eb['body']);})[_0x0150('0xd')](function(_0x28429a){logger[_0x0150('0x24')]('[%s][DIALOGFLOWV2]\x20%s',_0x45f301,JSON[_0x0150('0x25')](_0x28429a));})[_0x0150('0x26')](function(){logger[_0x0150('0x11')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x45f301);_0x101e09[_0x0150('0x27')]();});}else{logger[_0x0150('0x11')](_0x0150('0x28'),_0x45f301);_0x101e09[_0x0150('0x27')]();}}else{var _0x44d57f=this;var _0x2fbada=_0x47df25[0x2][_0x0150('0x29')](/\\n/g,'\x0a');var _0x775a47={'credentials':{'private_key':_0x2fbada,'client_email':_0x47df25[0x1]}};var _0x1595af=new dialogflow[(_0x0150('0x2a'))](_0x775a47);var _0x50a965=_0x1595af[_0x0150('0x2b')](_0x47df25[0x0],md5(_0x44d57f[_0x0150('0x1f')]['id']));var _0x4bb59e={'session':_0x50a965,'queryInput':{'text':{'text':_0x44d57f[_0x0150('0x2c')][_0x0150('0xa')],'languageCode':_0x47df25[0x3]||'en'}}};return _0x1595af[_0x0150('0x2d')](_0x4bb59e)[_0x0150('0x23')](function(_0x2c3cec){if(_0x2c3cec&&_0x2c3cec[_0x0150('0x2e')]){_0x44d57f['body']['dialogflowV2']=_0x2c3cec;var _0x546ec6=_0x2c3cec[0x0];var _0x26b9aa=_0x546ec6[_0x0150('0x2f')][_0x0150('0x30')]&&_0x546ec6[_0x0150('0x2f')][_0x0150('0x30')][_0x0150('0x31')]?_0x546ec6[_0x0150('0x2f')]['diagnosticInfo'][_0x0150('0x31')]['end_conversation']['boolValue']:![];_0x44d57f[_0x0150('0xa')][_0x0150('0x32')]=_0x546ec6['queryResult'][_0x0150('0x33')];_0x44d57f['body']['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x546ec6[_0x0150('0x2f')][_0x0150('0x34')];_0x44d57f[_0x0150('0xa')][_0x0150('0x35')]=_0x546ec6[_0x0150('0x2f')][_0x0150('0x30')]&&_0x546ec6[_0x0150('0x2f')][_0x0150('0x30')][_0x0150('0x31')]?_0x546ec6['queryResult'][_0x0150('0x30')][_0x0150('0x31')]['end_conversation']['boolValue']:![];_0x44d57f[_0x0150('0xa')][_0x0150('0x36')]=_0x546ec6[_0x0150('0x2f')][_0x0150('0x37')][_0x0150('0x38')];_0x44d57f['body'][_0x0150('0x39')]=_0x546ec6[_0x0150('0x2f')][_0x0150('0x37')][_0x0150('0x3a')];_0x44d57f[_0x0150('0xa')]['DIALOGFLOWV2_ISFALLBACKINTENT']=_0x546ec6[_0x0150('0x2f')][_0x0150('0x37')]['isFallback'];_0x44d57f['body'][_0x0150('0x3b')]=_0x546ec6[_0x0150('0x2f')]['languageCode'];_0x44d57f[_0x0150('0xa')][_0x0150('0x3c')]=_0x546ec6[_0x0150('0x2f')][_0x0150('0x3d')];_0x44d57f['body'][_0x0150('0x3e')]=_0x546ec6[_0x0150('0x2f')]['intentDetectionConfidence'];_0x10b3eb[_0x0150('0x3f')]=_0x0150('0x40');_0x10b3eb[_0x0150('0x41')]=JSON[_0x0150('0x25')](_0x2c3cec);var _0x661020=[];for(var _0x2d9750=0x0;_0x2d9750<_0x2c3cec[_0x0150('0x2e')];_0x2d9750++){var _0x5948e1=_0x2c3cec[_0x2d9750];if(_0x5948e1&&_0x5948e1[_0x0150('0x2f')]&&_0x5948e1[_0x0150('0x2f')]['fulfillmentText']){_0x661020[_0x0150('0x42')](createMessage(_0x45f301,_0xa7cb51,_0x10b3eb,_0x5948e1['queryResult'][_0x0150('0x43')]));}}return Promise[_0x0150('0x44')](_0x661020)[_0x0150('0x23')](function(){if(_0x26b9aa){_0x101e09[_0x0150('0x13')]();}else{_0x101e09[_0x0150('0x27')]();}})[_0x0150('0xd')](function(_0x47eec7){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x45f301,JSON[_0x0150('0x25')](_0x47eec7));_0x101e09[_0x0150('0x13')]();});}})['catch'](function(_0x1ced01){logger[_0x0150('0x24')]('[%s][DIALOGFLOWV2]\x20%s',_0x45f301,_0x1ced01[_0x0150('0x2c')]);_0x101e09[_0x0150('0x13')]();});}}catch(_0x2ae4a9){logger['error'](_0x0150('0xe'),_0x45f301,JSON[_0x0150('0x25')](_0x2ae4a9));_0x101e09[_0x0150('0x27')]();}};}; \ 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 f426076..7036ac9 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 _0xa565=['priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','info','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','error','[%s][GOTOIF]\x20%s','message','join','stop','condition'];(function(_0x12183c,_0x3e8143){var _0x574064=function(_0x30f4b5){while(--_0x30f4b5){_0x12183c['push'](_0x12183c['shift']());}};_0x574064(++_0x3e8143);}(_0xa565,0x1c8));var _0x5a56=function(_0x49ab17,_0x4e6266){_0x49ab17=_0x49ab17-0x0;var _0x21f476=_0xa565[_0x49ab17];return _0x21f476;};'use strict';var schema=require(_0x5a56('0x0'));var _=require(_0x5a56('0x1'));var htmlToText=require(_0x5a56('0x2'));var utils=require(_0x5a56('0x3'));var logger=require(_0x5a56('0x4'))(_0x5a56('0x5'));var gotoif=schema({'condition':{'type':_0x5a56('0x6'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x5a56('0x7'),'message':_0x5a56('0x8')},'priorityFalse':{'type':_0x5a56('0x7'),'message':_0x5a56('0x9')}});exports[_0x5a56('0xa')]=function(_0x3e1cf1,_0x44c94c){return function(_0x46e433){try{var _0x4304fa={'condition':htmlToText[_0x5a56('0xb')](utils[_0x5a56('0xc')](_0x44c94c[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x44c94c[0x1],'priorityFalse':_0x44c94c[0x2]};var _0x5ae961=gotoif[_0x5a56('0x0')](_0x4304fa,{'typecast':!![]});if(_0x5ae961[_0x5a56('0xd')]){logger[_0x5a56('0xe')](_0x5a56('0xf'),_0x3e1cf1,_['map'](_0x5ae961,_0x5a56('0x10'))[_0x5a56('0x11')](',\x20'));_0x46e433[_0x5a56('0x12')]();}else{try{var _0xb7d41f=eval('('+_0x4304fa[_0x5a56('0x13')]+')');var _0x4d35e0=_0xb7d41f?_0x4304fa['priorityTrue']:_0x4304fa[_0x5a56('0x14')];logger['info'](_0x5a56('0x15'),_0x3e1cf1,_0x4304fa[_0x5a56('0x13')],_0xb7d41f,_0x4d35e0||_0x5a56('0x16'));if(_0x4d35e0){var _0x3e3974=_['findIndex'](_0x46e433[_0x5a56('0x17')](),{'p':_0x4d35e0});if(_0x3e3974>=0x0){logger['info'](_0x5a56('0x18'),_0x3e1cf1,_0x4d35e0||_0x5a56('0x16'),_0x3e3974);_0x46e433[_0x5a56('0x16')](_0x3e3974);}else{logger[_0x5a56('0x19')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x3e1cf1,_0x4d35e0||_0x5a56('0x16'));_0x46e433[_0x5a56('0x12')]();}}else{_0x46e433[_0x5a56('0x16')]();}}catch(_0x520551){logger[_0x5a56('0xe')](_0x5a56('0x1a'),_0x3e1cf1,_0x520551[_0x5a56('0x10')]);_0x46e433[_0x5a56('0x12')]();}}}catch(_0x4395d2){logger['error'](_0x5a56('0xf'),_0x3e1cf1,JSON[_0x5a56('0x1b')](_0x4395d2));_0x46e433['stop']();}};}; \ No newline at end of file +var _0x3f07=['../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','replace','length','[%s][GOTOIF]\x20%s','map','join','stop','condition','priorityTrue','priorityFalse','next','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','stringify','validate','lodash','html-to-text','./utils'];(function(_0x40590e,_0x1adf11){var _0x363fb8=function(_0x30cd19){while(--_0x30cd19){_0x40590e['push'](_0x40590e['shift']());}};_0x363fb8(++_0x1adf11);}(_0x3f07,0x8d));var _0x73f0=function(_0x573a27,_0x26d295){_0x573a27=_0x573a27-0x0;var _0x49f7c0=_0x3f07[_0x573a27];return _0x49f7c0;};'use strict';var schema=require(_0x73f0('0x0'));var _=require(_0x73f0('0x1'));var htmlToText=require(_0x73f0('0x2'));var utils=require(_0x73f0('0x3'));var logger=require(_0x73f0('0x4'))(_0x73f0('0x5'));var gotoif=schema({'condition':{'type':_0x73f0('0x6'),'required':!![],'message':_0x73f0('0x7')},'priorityTrue':{'type':'number','message':_0x73f0('0x8')},'priorityFalse':{'type':_0x73f0('0x9'),'message':_0x73f0('0xa')}});exports[_0x73f0('0xb')]=function(_0x34d21d,_0xa8ee55){return function(_0x3a4e0e){try{var _0x292a79={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0xa8ee55[0x0],this),{'wordwrap':![]})[_0x73f0('0xc')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xa8ee55[0x1],'priorityFalse':_0xa8ee55[0x2]};var _0x1bd7a8=gotoif['validate'](_0x292a79,{'typecast':!![]});if(_0x1bd7a8[_0x73f0('0xd')]){logger['error'](_0x73f0('0xe'),_0x34d21d,_[_0x73f0('0xf')](_0x1bd7a8,'message')[_0x73f0('0x10')](',\x20'));_0x3a4e0e[_0x73f0('0x11')]();}else{try{var _0x300568=eval('('+_0x292a79[_0x73f0('0x12')]+')');var _0x1fd9f1=_0x300568?_0x292a79[_0x73f0('0x13')]:_0x292a79[_0x73f0('0x14')];logger['info']('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x34d21d,_0x292a79[_0x73f0('0x12')],_0x300568,_0x1fd9f1||_0x73f0('0x15'));if(_0x1fd9f1){var _0x11fee9=_['findIndex'](_0x3a4e0e[_0x73f0('0x16')](),{'p':_0x1fd9f1});if(_0x11fee9>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x34d21d,_0x1fd9f1||'next',_0x11fee9);_0x3a4e0e[_0x73f0('0x15')](_0x11fee9);}else{logger[_0x73f0('0x17')](_0x73f0('0x18'),_0x34d21d,_0x1fd9f1||_0x73f0('0x15'));_0x3a4e0e[_0x73f0('0x11')]();}}else{_0x3a4e0e[_0x73f0('0x15')]();}}catch(_0xeaf1fa){logger[_0x73f0('0x19')](_0x73f0('0x1a'),_0x34d21d,_0xeaf1fa[_0x73f0('0x1b')]);_0x3a4e0e[_0x73f0('0x11')]();}}}catch(_0x3ada6d){logger['error'](_0x73f0('0xe'),_0x34d21d,JSON[_0x73f0('0x1c')](_0x3ada6d));_0x3a4e0e['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 6934894..fc186eb 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 _0xc316=['lodash','../../../../config/logger','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','map','message','join','stop','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','info','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','[%s][GOTOP]\x20%s','stringify','validate'];(function(_0x4a3e73,_0x4fea7c){var _0x2d8eb9=function(_0x37f8bf){while(--_0x37f8bf){_0x4a3e73['push'](_0x4a3e73['shift']());}};_0x2d8eb9(++_0x4fea7c);}(_0xc316,0x6d));var _0x6c31=function(_0x23eaf0,_0x347b70){_0x23eaf0=_0x23eaf0-0x0;var _0x353da4=_0xc316[_0x23eaf0];return _0x353da4;};'use strict';var schema=require(_0x6c31('0x0'));var _=require(_0x6c31('0x1'));var logger=require(_0x6c31('0x2'))(_0x6c31('0x3'));var gotop=schema({'priority':{'type':_0x6c31('0x4'),'required':!![],'message':_0x6c31('0x5')}});exports[_0x6c31('0x6')]=function(_0x527483,_0x623393){return function(_0xa7ea79){try{var _0x5b0fdf={'priority':_0x623393[0x0]};var _0x20c4c7=gotop[_0x6c31('0x0')](_0x5b0fdf,{'typecast':!![]});if(_0x20c4c7[_0x6c31('0x7')]){logger[_0x6c31('0x8')]('[%s][GOTOP]\x20%s',_0x527483,_[_0x6c31('0x9')](_0x20c4c7,_0x6c31('0xa'))[_0x6c31('0xb')](',\x20'));_0xa7ea79[_0x6c31('0xc')]();}else{logger['info'](_0x6c31('0xd'),_0x527483,_0x5b0fdf[_0x6c31('0xe')]);if(_0x5b0fdf[_0x6c31('0xe')]){var _0x1909dd=_['findIndex'](_0xa7ea79[_0x6c31('0xf')](),{'p':_0x5b0fdf['priority']});if(_0x1909dd>=0x0){logger['info'](_0x6c31('0x10'),_0x527483,_0x5b0fdf['priority']||_0x6c31('0x11'),_0x1909dd);_0xa7ea79[_0x6c31('0x11')](_0x1909dd);}else{logger[_0x6c31('0x12')](_0x6c31('0x13'),_0x527483,_0x5b0fdf[_0x6c31('0xe')]||'next');_0xa7ea79['stop']();}}else{_0xa7ea79[_0x6c31('0x11')]();}}}catch(_0x96770f){logger['error'](_0x6c31('0x14'),_0x527483,JSON[_0x6c31('0x15')](_0x96770f));_0xa7ea79[_0x6c31('0xc')]();}};}; \ No newline at end of file +var _0x68d7=['rules','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','lodash','../../../../config/logger','routing','number','consequence','length','error','[%s][GOTOP]\x20%s','map','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex'];(function(_0x4ed7a4,_0x5f466b){var _0x59b81c=function(_0x4ba3fa){while(--_0x4ba3fa){_0x4ed7a4['push'](_0x4ed7a4['shift']());}};_0x59b81c(++_0x5f466b);}(_0x68d7,0x1d0));var _0x768d=function(_0x493802,_0x29657e){_0x493802=_0x493802-0x0;var _0x47dfc2=_0x68d7[_0x493802];return _0x47dfc2;};'use strict';var schema=require(_0x768d('0x0'));var _=require(_0x768d('0x1'));var logger=require(_0x768d('0x2'))(_0x768d('0x3'));var gotop=schema({'priority':{'type':_0x768d('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x768d('0x5')]=function(_0xf0ebca,_0x134523){return function(_0x3de569){try{var _0x1d23cd={'priority':_0x134523[0x0]};var _0x54e6fa=gotop[_0x768d('0x0')](_0x1d23cd,{'typecast':!![]});if(_0x54e6fa[_0x768d('0x6')]){logger[_0x768d('0x7')](_0x768d('0x8'),_0xf0ebca,_[_0x768d('0x9')](_0x54e6fa,_0x768d('0xa'))['join'](',\x20'));_0x3de569[_0x768d('0xb')]();}else{logger[_0x768d('0xc')](_0x768d('0xd'),_0xf0ebca,_0x1d23cd[_0x768d('0xe')]);if(_0x1d23cd[_0x768d('0xe')]){var _0xf11c07=_[_0x768d('0xf')](_0x3de569[_0x768d('0x10')](),{'p':_0x1d23cd[_0x768d('0xe')]});if(_0xf11c07>=0x0){logger[_0x768d('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0xf0ebca,_0x1d23cd[_0x768d('0xe')]||_0x768d('0x11'),_0xf11c07);_0x3de569[_0x768d('0x11')](_0xf11c07);}else{logger[_0x768d('0xc')](_0x768d('0x12'),_0xf0ebca,_0x1d23cd['priority']||_0x768d('0x11'));_0x3de569[_0x768d('0xb')]();}}else{_0x3de569[_0x768d('0x11')]();}}}catch(_0x4ecd46){logger['error'](_0x768d('0x8'),_0xf0ebca,JSON[_0x768d('0x13')](_0x4ecd46));_0x3de569['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 3c1a2d4..1c8a1ab 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 _0xe51b=['routing','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','ChatWebsiteId','account','upperFirst','channel','AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','catch','error','stop','stringify','lodash','./utils'];(function(_0x303bdb,_0x443c92){var _0x125fe8=function(_0xd845e8){while(--_0xd845e8){_0x303bdb['push'](_0x303bdb['shift']());}};_0x125fe8(++_0x443c92);}(_0xe51b,0x15c));var _0xbe51=function(_0x867f95,_0x43d423){_0x867f95=_0x867f95-0x0;var _0x4cd98d=_0xe51b[_0x867f95];return _0x4cd98d;};'use strict';var _=require(_0xbe51('0x0'));var utils=require(_0xbe51('0x1'));var logger=require('../../../../config/logger')(_0xbe51('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xbe51('0x3')),'faxMessage':require(_0xbe51('0x4')),'whatsappMessage':require(_0xbe51('0x5'))};exports[_0xbe51('0x6')]=function(_0x320931,_0x480903){return function(_0x12625d){try{var _0x31a7e6={'body':utils[_0xbe51('0x7')](_0x480903[0x0],this),'ContactId':this['contact']['id']};if(this['channel']==='chat'){_0x31a7e6[_0xbe51('0x8')]=this[_0xbe51('0x9')]['id'];}else{_0x31a7e6[_[_0xbe51('0xa')](this[_0xbe51('0xb')])+_0xbe51('0xc')]=this['account']['id'];}_0x31a7e6[_[_0xbe51('0xa')](this[_0xbe51('0xb')])+_0xbe51('0xd')]=this[_0xbe51('0xe')]['id'];if(rpc[this['channel']+_0xbe51('0xf')]){return rpc[this[_0xbe51('0xb')]+_0xbe51('0xf')][_0xbe51('0x10')](_0x31a7e6)[_0xbe51('0x11')](function(_0x26afea){logger[_0xbe51('0x12')](_0xbe51('0x13'),_0x320931,_0x31a7e6[_0xbe51('0x14')]);_0x12625d['next']();})[_0xbe51('0x15')](function(_0x5ae980){logger[_0xbe51('0x16')](_0xbe51('0x13'),_0x320931,JSON['stringify'](_0x5ae980));_0x12625d[_0xbe51('0x17')]();});}}catch(_0xab768c){logger[_0xbe51('0x16')](_0xbe51('0x13'),_0x320931,JSON[_0xbe51('0x18')](_0xab768c));_0x12625d[_0xbe51('0x17')]();}};}; \ No newline at end of file +var _0x93e6=['lodash','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','channel','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','create','info','[%s][MESSAGE]\x20%s','body','next','catch','stringify','stop','error'];(function(_0xfbe06e,_0x2fb7ab){var _0x24e5b6=function(_0x48569f){while(--_0x48569f){_0xfbe06e['push'](_0xfbe06e['shift']());}};_0x24e5b6(++_0x2fb7ab);}(_0x93e6,0x11e));var _0x693e=function(_0x30e228,_0x1dd9ba){_0x30e228=_0x30e228-0x0;var _0x27d19a=_0x93e6[_0x30e228];return _0x27d19a;};'use strict';var _=require(_0x693e('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0x693e('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x693e('0x2')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x693e('0x3')),'faxMessage':require(_0x693e('0x4')),'whatsappMessage':require(_0x693e('0x5'))};exports['consequence']=function(_0x1d2b99,_0x388eb6){return function(_0x2569a4){try{var _0x520113={'body':utils['getMustacheRender'](_0x388eb6[0x0],this),'ContactId':this['contact']['id']};if(this[_0x693e('0x6')]==='chat'){_0x520113[_0x693e('0x7')]=this[_0x693e('0x8')]['id'];}else{_0x520113[_[_0x693e('0x9')](this['channel'])+_0x693e('0xa')]=this['account']['id'];}_0x520113[_[_0x693e('0x9')](this['channel'])+_0x693e('0xb')]=this['interaction']['id'];if(rpc[this['channel']+_0x693e('0xc')]){return rpc[this[_0x693e('0x6')]+_0x693e('0xc')][_0x693e('0xd')](_0x520113)['then'](function(_0x256143){logger[_0x693e('0xe')](_0x693e('0xf'),_0x1d2b99,_0x520113[_0x693e('0x10')]);_0x2569a4[_0x693e('0x11')]();})[_0x693e('0x12')](function(_0x3e44ba){logger['error'](_0x693e('0xf'),_0x1d2b99,JSON[_0x693e('0x13')](_0x3e44ba));_0x2569a4[_0x693e('0x14')]();});}}catch(_0x54d946){logger[_0x693e('0x15')](_0x693e('0xf'),_0x1d2b99,JSON[_0x693e('0x13')](_0x54d946));_0x2569a4[_0x693e('0x14')]();}};}; \ 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 71f6d7f..fe134e1 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 _0x8043=['stringify','./utils','../../../../config/logger','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','next','error'];(function(_0x181b74,_0x31852d){var _0x58595a=function(_0x1290dc){while(--_0x1290dc){_0x181b74['push'](_0x181b74['shift']());}};_0x58595a(++_0x31852d);}(_0x8043,0xa3));var _0x3804=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x8043[_0x2aea9e];return _0x430b92;};'use strict';var utils=require(_0x3804('0x0'));var logger=require(_0x3804('0x1'))('routing');exports[_0x3804('0x2')]=function(_0xd1af9c,_0x32387c){return function(_0x31de5c){try{logger[_0x3804('0x3')](_0x3804('0x4'),_0xd1af9c,utils[_0x3804('0x5')](_0x32387c[0x0],this));_0x31de5c[_0x3804('0x6')]();}catch(_0x2d7877){logger[_0x3804('0x7')](_0x3804('0x4'),_0xd1af9c,JSON[_0x3804('0x8')](_0x2d7877));_0x31de5c['stop']();}};}; \ No newline at end of file +var _0x7ba1=['getMustacheRender','next','error','[%s][NOOP]\x20%s','stringify','stop','./utils','routing','consequence','info'];(function(_0xc2b459,_0x52da01){var _0x42da7a=function(_0x2e6e33){while(--_0x2e6e33){_0xc2b459['push'](_0xc2b459['shift']());}};_0x42da7a(++_0x52da01);}(_0x7ba1,0xc4));var _0x17ba=function(_0x20bad0,_0x3fe18d){_0x20bad0=_0x20bad0-0x0;var _0x32da47=_0x7ba1[_0x20bad0];return _0x32da47;};'use strict';var utils=require(_0x17ba('0x0'));var logger=require('../../../../config/logger')(_0x17ba('0x1'));exports[_0x17ba('0x2')]=function(_0x378fbf,_0x354ec3){return function(_0x2f2cca){try{logger[_0x17ba('0x3')]('[%s][NOOP]\x20%s',_0x378fbf,utils[_0x17ba('0x4')](_0x354ec3[0x0],this));_0x2f2cca[_0x17ba('0x5')]();}catch(_0x1bb920){logger[_0x17ba('0x6')](_0x17ba('0x7'),_0x378fbf,JSON[_0x17ba('0x8')](_0x1bb920));_0x2f2cca[_0x17ba('0x9')]();}};}; \ 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 617c1f0..3e741aa 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 _0x000b=['createQueue','atimeout','qtimeout','rules','close','complete','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','redis','localhost','queue_id','account','from','emit','clone','queue','InteractionId','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','interaction','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','QueueReport','catch','error','name','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues'];(function(_0x3f5744,_0x13b29d){var _0x21c4a0=function(_0xf74015){while(--_0xf74015){_0x3f5744['push'](_0x3f5744['shift']());}};_0x21c4a0(++_0x13b29d);}(_0x000b,0xe0));var _0xb000=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0x000b[_0xb1cf84];return _0x4bad2e;};'use strict';var schema=require(_0xb000('0x0'));var _=require(_0xb000('0x1'));var util=require(_0xb000('0x2'));var seqqueue=require(_0xb000('0x3'));var moment=require(_0xb000('0x4'));var Redis=require('ioredis');var config=require(_0xb000('0x5'));var logger=require(_0xb000('0x6'))(_0xb000('0x7'));var strategy=require('./strategy');config['redis']=_['defaults'](config[_0xb000('0x8')],{'host':_0xb000('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var attributes=['id',_0xb000('0xa'),_0xb000('0xb'),'queue',_0xb000('0xc'),'joinAt'];function emit(_0x3b3584,_0x5c3f6e,_0x5cbc4d){io['to'](_0x3b3584)[_0xb000('0xd')](_0x5c3f6e,_0x5cbc4d);}function emitChannelQueueInteraction(_0x59b355,_0x1c78d2,_0x4257b2,_0x1ee8f8,_0x315f2e,_0x1e5946,_0x5f1f3b,_0xf948a){var _0x5c6155=_[_0xb000('0xe')](_0x4257b2);_0x5c6155['queue_id']=_0xf948a;_0x5c6155[_0xb000('0xf')]=_0x1c78d2;_0x5c6155[_0xb000('0xb')]=_0x1ee8f8;_0x5c6155['id']=_0x315f2e;if(_0x1e5946){attributes['push'](_['capitalize'](_0x59b355)+_0xb000('0x10'));_0x5f1f3b[util[_0xb000('0x11')](_0xb000('0x12'),_0x59b355)][_0x315f2e]=_[_0xb000('0x13')](_0x5c6155,attributes);}else{delete _0x5f1f3b[util['format'](_0xb000('0x12'),_0x59b355)][_0x315f2e];}emit(util['format'](_0xb000('0x14'),_0x59b355,_0x1c78d2),util[_0xb000('0x11')]('%s_queue_waiting_interaction:%s',_0x59b355,_0x1e5946?'save':'remove'),_[_0xb000('0x13')](_0x5c6155,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xb000('0x15')),'chatQueueReport':require(_0xb000('0x16')),'smsQueueReport':require(_0xb000('0x17')),'faxQueueReport':require(_0xb000('0x18')),'whatsappQueueReport':require(_0xb000('0x19'))};var queue=schema({'name':{'type':_0xb000('0x1a'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xb000('0x1b'),'message':_0xb000('0x1c')}});function startRouting(_0x3d0af8,_0x4156e9,_0x558b62,_0xebf1c9){if(_0x3d0af8&&_0x4156e9&&_0x558b62){_0x4156e9[_0xb000('0x1d')]+=0x1;var _0x9125e7={'uniqueid':_0x3d0af8,'from':_0x558b62[_0xb000('0x1e')]?_0x558b62[_0xb000('0x1e')]['from']:'','joinAt':moment()[_0xb000('0x11')](_0xb000('0x1f')),'ContactId':_0x558b62[_0xb000('0x20')]?_0x558b62['contact']['id']:null,'ListId':_0x558b62[_0xb000('0x21')]?_0x558b62[_0xb000('0x21')]['id']:null};_0x9125e7[_[_0xb000('0x22')](_0x558b62[_0xb000('0x23')])+'QueueId']=_0x4156e9['id']||null;_0x9125e7[_[_0xb000('0x22')](_0x558b62[_0xb000('0x23')])+_0xb000('0x10')]=_0x558b62[_0xb000('0x24')]?_0x558b62[_0xb000('0x24')]['id']:null;_0x9125e7[_[_0xb000('0x22')](_0x558b62[_0xb000('0x23')])+'MessageId']=_0x558b62[_0xb000('0x25')]?_0x558b62['message']['id']:null;_0x9125e7[_['upperFirst'](_0x558b62[_0xb000('0x23')])+(_0x558b62[_0xb000('0x23')]!==_0xb000('0x26')?_0xb000('0x27'):_0xb000('0x28'))]=_0x558b62['account']?_0x558b62[_0xb000('0xb')]['id']:null;logger[_0xb000('0x29')](util[_0xb000('0x11')](_0xb000('0x2a'),_0x3d0af8,_0x4156e9['name']));emitChannelQueueInteraction(_0x558b62[_0xb000('0x23')],_0x4156e9['name'],_0x9125e7,_0x558b62[_0xb000('0xb')]['name'],_0x558b62[_0xb000('0x25')]['id'],!![],_0xebf1c9,_0x4156e9['id']);if(rpc[_0x558b62[_0xb000('0x23')]+_0xb000('0x2b')]){return rpc[_0x558b62['channel']+'QueueReport']['create'](_0x9125e7)[_0xb000('0x2c')](function(_0x59a1da){logger[_0xb000('0x2d')]('create\x20queue\x20report');});}}}function stopRouting(_0x194773,_0x1518ef,_0x54985d,_0x5b2682){if(_0x194773&&_0x1518ef){_0x1518ef[_0xb000('0x1d')]-=0x1;var _0x2ff61b={'leaveAt':moment()[_0xb000('0x11')](_0xb000('0x1f')),'acceptAt':moment()[_0xb000('0x11')](_0xb000('0x1f')),'reason':'accepted'};logger[_0xb000('0x29')](util['format']('[%s][STOP:QUEUE][NAME:%s]',_0x194773,_0x1518ef[_0xb000('0x2e')]));emitChannelQueueInteraction(_0x54985d['channel'],_0x1518ef['name'],_0x54985d['body'],_0x54985d[_0xb000('0xb')]['name'],_0x54985d[_0xb000('0x25')]['id'],![],_0x5b2682,_0x1518ef['id']);if(rpc[_0x54985d[_0xb000('0x23')]+_0xb000('0x2b')]){return rpc[_0x54985d[_0xb000('0x23')]+_0xb000('0x2b')][_0xb000('0x2f')](_0x194773,_0x2ff61b)[_0xb000('0x2c')](function(_0x206cb6){logger[_0xb000('0x2d')](_0xb000('0x30'));});}}}function endRouting(_0x58838d,_0x14b9f7,_0x50fe00,_0x1f2333){if(_0x58838d&&_0x14b9f7){_0x14b9f7[_0xb000('0x1d')]-=0x1;var _0x19721d={'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0xb000('0x11')](_0xb000('0x1f')),'reason':_0xb000('0x31')};logger[_0xb000('0x29')](util['format'](_0xb000('0x32'),_0x58838d,_0x14b9f7[_0xb000('0x2e')]));emitChannelQueueInteraction(_0x50fe00[_0xb000('0x23')],_0x14b9f7[_0xb000('0x2e')],_0x50fe00['body'],_0x50fe00['account'][_0xb000('0x2e')],_0x50fe00[_0xb000('0x25')]['id'],![],_0x1f2333);if(rpc[_0x50fe00[_0xb000('0x23')]+_0xb000('0x2b')]){return rpc[_0x50fe00[_0xb000('0x23')]+_0xb000('0x2b')][_0xb000('0x2f')](_0x58838d,_0x19721d)[_0xb000('0x2c')](function(_0x31b5cd){logger[_0xb000('0x2d')](_0xb000('0x30'));});}}}function handleFindQueue(_0x2afd63){return function(_0x1232f0){return _0x1232f0[_0xb000('0x2e')][_0xb000('0x33')]()===_0x2afd63['toLowerCase']();};}exports[_0xb000('0x34')]=function(_0x31fb8b,_0xb9dcc6,_0xb2b2c2,_0x286632){return function(_0x4fbf7c){try{var _0x8d2fc={'name':_0xb9dcc6[0x0],'timeout':_0xb9dcc6[0x1]};var _0x4cc6b5=queue[_0xb000('0x0')](_0x8d2fc,{'typecast':!![]});if(_0x4cc6b5[_0xb000('0x35')]){logger['error'](_0xb000('0x36'),_0x31fb8b,_[_0xb000('0x37')](_0x4cc6b5,_0xb000('0x25'))[_0xb000('0x38')](',\x20'));_0x4fbf7c[_0xb000('0x39')]();}else{var _0x47f565=_[_0xb000('0x3a')](_0xb2b2c2[_0x286632['channel']+_0xb000('0x3b')],handleFindQueue(_0x8d2fc['name']));if(_0x47f565){startRouting(_0x31fb8b,_0x47f565,_0x286632,_0xb2b2c2);var _0x2b4de8=(_0x47f565[_0xb000('0x31')]||0xa)*0x3e8;var _0x2f2048=(_0x8d2fc[_0xb000('0x31')]||0x14)*0x3e8;var _0x28714f;if(_0x2b4de8>_0x2f2048){_0x2f2048=_0x2b4de8;}var _0x2f5b54=seqqueue[_0xb000('0x3c')](_0x2b4de8);_0x2f5b54['id']=_0x31fb8b;_0x2f5b54[_0xb000('0x3d')]=_0x2b4de8;_0x2f5b54[_0xb000('0x3e')]=_0x2f2048;_0x2f5b54['channel']=_0x286632[_0xb000('0x23')];_0xb2b2c2[_0xb000('0x3f')][_0x31fb8b]['on']('end',function(){logger[_0xb000('0x29')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x31fb8b);stopRouting(_0x31fb8b,_0x47f565,_0x286632,_0xb2b2c2);clearTimeout(_0x28714f);_0x28714f=undefined;_0x2f5b54[_0xb000('0x40')](!![]);if(_0xb2b2c2[_0xb000('0x3f')][_0x31fb8b]){delete _0xb2b2c2[_0xb000('0x3f')][_0x31fb8b];}_0x4fbf7c[_0xb000('0x39')]();});_0xb2b2c2[_0xb000('0x3f')][_0x31fb8b]['on'](_0xb000('0x41'),function(){if(_0xb2b2c2['rules'][_0x31fb8b]){delete _0xb2b2c2[_0xb000('0x3f')][_0x31fb8b];}});_0x28714f=setTimeout(function(){logger[_0xb000('0x29')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x31fb8b);endRouting(_0x31fb8b,_0x47f565,_0x286632,_0xb2b2c2);clearTimeout(_0x28714f);_0x2f5b54['close'](!![]);_0x4fbf7c['next']();},_0x2f2048);switch(_0x47f565[_0xb000('0x42')]){case _0xb000('0x43'):strategy[_0xb000('0x43')](_0x2f5b54,_0x47f565,_0xb2b2c2,_0x286632);break;default:strategy[_0xb000('0x44')](_0x2f5b54,_0x47f565,_0xb2b2c2,_0x286632);}}else{logger[_0xb000('0x2d')](_0xb000('0x45'),_0x31fb8b,_0x8d2fc['name']);_0x4fbf7c[_0xb000('0x39')]();}}}catch(_0x4b4e92){console['log'](_0x4b4e92);logger[_0xb000('0x2d')](_0xb000('0x36'),_0x31fb8b,_0x4b4e92[_0xb000('0x46')]);_0x4fbf7c[_0xb000('0x39')]();}};}; \ No newline at end of file +var _0x5991=['upperFirst','channel','QueueId','MessageId','message','AccountId','WebsiteId','info','name','create','catch','create\x20queue\x20report','accepted','[%s][STOP:QUEUE][NAME:%s]','QueueReport','error','update\x20queue\x20report','update','toLowerCase','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','next','strategy','rrmemory','beepall','log','stack','validate','lodash','util','seq-queue','ioredis','../../../../config/environment','../../../../config/logger','./strategy','redis','defaults','localhost','socket.io-emitter','account','queue','from','joinAt','emit','clone','queue_id','push','capitalize','InteractionId','format','%sQueuesWaitingInteractions','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','number','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list'];(function(_0x1d6da1,_0x4ad243){var _0x561a1b=function(_0x1a5ea1){while(--_0x1a5ea1){_0x1d6da1['push'](_0x1d6da1['shift']());}};_0x561a1b(++_0x4ad243);}(_0x5991,0x162));var _0x1599=function(_0x5a369d,_0x140b74){_0x5a369d=_0x5a369d-0x0;var _0x22cfba=_0x5991[_0x5a369d];return _0x22cfba;};'use strict';var schema=require(_0x1599('0x0'));var _=require(_0x1599('0x1'));var util=require(_0x1599('0x2'));var seqqueue=require(_0x1599('0x3'));var moment=require('moment');var Redis=require(_0x1599('0x4'));var config=require(_0x1599('0x5'));var logger=require(_0x1599('0x6'))('routing');var strategy=require(_0x1599('0x7'));config[_0x1599('0x8')]=_[_0x1599('0x9')](config[_0x1599('0x8')],{'host':_0x1599('0xa'),'port':0x18eb});var io=require(_0x1599('0xb'))(new Redis(config[_0x1599('0x8')]));var attributes=['id','queue_id',_0x1599('0xc'),_0x1599('0xd'),_0x1599('0xe'),_0x1599('0xf')];function emit(_0x1fd4ac,_0x8ba360,_0x337295){io['to'](_0x1fd4ac)[_0x1599('0x10')](_0x8ba360,_0x337295);}function emitChannelQueueInteraction(_0x2c995f,_0x213a0c,_0x53c350,_0xfdcdf5,_0x50f199,_0xd0c0a8,_0xa771af,_0x4435ec){var _0x242648=_[_0x1599('0x11')](_0x53c350);_0x242648[_0x1599('0x12')]=_0x4435ec;_0x242648[_0x1599('0xd')]=_0x213a0c;_0x242648[_0x1599('0xc')]=_0xfdcdf5;_0x242648['id']=_0x50f199;if(_0xd0c0a8){attributes[_0x1599('0x13')](_[_0x1599('0x14')](_0x2c995f)+_0x1599('0x15'));_0xa771af[util[_0x1599('0x16')](_0x1599('0x17'),_0x2c995f)][_0x50f199]=_[_0x1599('0x18')](_0x242648,attributes);}else{delete _0xa771af[util['format'](_0x1599('0x17'),_0x2c995f)][_0x50f199];}emit(util[_0x1599('0x16')](_0x1599('0x19'),_0x2c995f,_0x213a0c),util['format'](_0x1599('0x1a'),_0x2c995f,_0xd0c0a8?_0x1599('0x1b'):'remove'),_[_0x1599('0x18')](_0x242648,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x1599('0x1c')),'chatQueueReport':require(_0x1599('0x1d')),'smsQueueReport':require(_0x1599('0x1e')),'faxQueueReport':require(_0x1599('0x1f')),'whatsappQueueReport':require(_0x1599('0x20'))};var queue=schema({'name':{'type':_0x1599('0x21'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x1599('0x22'),'message':_0x1599('0x23')}});function startRouting(_0x56fc85,_0x26a8eb,_0x527885,_0x3b170c){if(_0x56fc85&&_0x26a8eb&&_0x527885){_0x26a8eb[_0x1599('0x24')]+=0x1;var _0x14c0eb={'uniqueid':_0x56fc85,'from':_0x527885['body']?_0x527885[_0x1599('0x25')]['from']:'','joinAt':moment()['format'](_0x1599('0x26')),'ContactId':_0x527885[_0x1599('0x27')]?_0x527885['contact']['id']:null,'ListId':_0x527885[_0x1599('0x28')]?_0x527885[_0x1599('0x28')]['id']:null};_0x14c0eb[_[_0x1599('0x29')](_0x527885[_0x1599('0x2a')])+_0x1599('0x2b')]=_0x26a8eb['id']||null;_0x14c0eb[_['upperFirst'](_0x527885[_0x1599('0x2a')])+_0x1599('0x15')]=_0x527885['interaction']?_0x527885['interaction']['id']:null;_0x14c0eb[_['upperFirst'](_0x527885[_0x1599('0x2a')])+_0x1599('0x2c')]=_0x527885[_0x1599('0x2d')]?_0x527885[_0x1599('0x2d')]['id']:null;_0x14c0eb[_[_0x1599('0x29')](_0x527885[_0x1599('0x2a')])+(_0x527885[_0x1599('0x2a')]!=='chat'?_0x1599('0x2e'):_0x1599('0x2f'))]=_0x527885[_0x1599('0xc')]?_0x527885[_0x1599('0xc')]['id']:null;logger[_0x1599('0x30')](util['format']('[%s][START:QUEUE][NAME:%s]',_0x56fc85,_0x26a8eb[_0x1599('0x31')]));emitChannelQueueInteraction(_0x527885['channel'],_0x26a8eb[_0x1599('0x31')],_0x14c0eb,_0x527885[_0x1599('0xc')][_0x1599('0x31')],_0x527885[_0x1599('0x2d')]['id'],!![],_0x3b170c,_0x26a8eb['id']);if(rpc[_0x527885[_0x1599('0x2a')]+'QueueReport']){return rpc[_0x527885[_0x1599('0x2a')]+'QueueReport'][_0x1599('0x32')](_0x14c0eb)[_0x1599('0x33')](function(_0x10feef){logger['error'](_0x1599('0x34'));});}}}function stopRouting(_0x32c63f,_0x533268,_0x2bf0d2,_0x4cc151){if(_0x32c63f&&_0x533268){_0x533268[_0x1599('0x24')]-=0x1;var _0x31deca={'leaveAt':moment()[_0x1599('0x16')](_0x1599('0x26')),'acceptAt':moment()[_0x1599('0x16')](_0x1599('0x26')),'reason':_0x1599('0x35')};logger[_0x1599('0x30')](util[_0x1599('0x16')](_0x1599('0x36'),_0x32c63f,_0x533268['name']));emitChannelQueueInteraction(_0x2bf0d2['channel'],_0x533268[_0x1599('0x31')],_0x2bf0d2[_0x1599('0x25')],_0x2bf0d2[_0x1599('0xc')][_0x1599('0x31')],_0x2bf0d2[_0x1599('0x2d')]['id'],![],_0x4cc151,_0x533268['id']);if(rpc[_0x2bf0d2[_0x1599('0x2a')]+_0x1599('0x37')]){return rpc[_0x2bf0d2[_0x1599('0x2a')]+_0x1599('0x37')]['update'](_0x32c63f,_0x31deca)[_0x1599('0x33')](function(_0xfae2f3){logger[_0x1599('0x38')](_0x1599('0x39'));});}}}function endRouting(_0x11bdab,_0x32ec53,_0x4239f1,_0x5041c5){if(_0x11bdab&&_0x32ec53){_0x32ec53[_0x1599('0x24')]-=0x1;var _0x446a29={'leaveAt':moment()[_0x1599('0x16')](_0x1599('0x26')),'exitAt':moment()[_0x1599('0x16')](_0x1599('0x26')),'reason':'timeout'};logger[_0x1599('0x30')](util[_0x1599('0x16')]('[%s][END:QUEUE][NAME:%s]',_0x11bdab,_0x32ec53[_0x1599('0x31')]));emitChannelQueueInteraction(_0x4239f1[_0x1599('0x2a')],_0x32ec53[_0x1599('0x31')],_0x4239f1[_0x1599('0x25')],_0x4239f1[_0x1599('0xc')]['name'],_0x4239f1[_0x1599('0x2d')]['id'],![],_0x5041c5);if(rpc[_0x4239f1['channel']+_0x1599('0x37')]){return rpc[_0x4239f1[_0x1599('0x2a')]+_0x1599('0x37')][_0x1599('0x3a')](_0x11bdab,_0x446a29)['catch'](function(_0x44208b){logger['error'](_0x1599('0x39'));});}}}function handleFindQueue(_0x33bc91){return function(_0x52b0c9){return _0x52b0c9[_0x1599('0x31')][_0x1599('0x3b')]()===_0x33bc91[_0x1599('0x3b')]();};}exports['consequence']=function(_0x2845cf,_0x51dba4,_0x2420fc,_0x4106b4){return function(_0x286c05){try{var _0x4d2cc3={'name':_0x51dba4[0x0],'timeout':_0x51dba4[0x1]};var _0x4fc7fd=queue[_0x1599('0x0')](_0x4d2cc3,{'typecast':!![]});if(_0x4fc7fd[_0x1599('0x3c')]){logger[_0x1599('0x38')](_0x1599('0x3d'),_0x2845cf,_[_0x1599('0x3e')](_0x4fc7fd,_0x1599('0x2d'))[_0x1599('0x3f')](',\x20'));_0x286c05[_0x1599('0x40')]();}else{var _0x380f50=_[_0x1599('0x41')](_0x2420fc[_0x4106b4[_0x1599('0x2a')]+_0x1599('0x42')],handleFindQueue(_0x4d2cc3['name']));if(_0x380f50){startRouting(_0x2845cf,_0x380f50,_0x4106b4,_0x2420fc);var _0x170436=(_0x380f50['timeout']||0xa)*0x3e8;var _0x2b2894=(_0x4d2cc3['timeout']||0x14)*0x3e8;var _0xa518b2;if(_0x170436>_0x2b2894){_0x2b2894=_0x170436;}var _0x4019b5=seqqueue[_0x1599('0x43')](_0x170436);_0x4019b5['id']=_0x2845cf;_0x4019b5['atimeout']=_0x170436;_0x4019b5[_0x1599('0x44')]=_0x2b2894;_0x4019b5[_0x1599('0x2a')]=_0x4106b4['channel'];_0x2420fc[_0x1599('0x45')][_0x2845cf]['on'](_0x1599('0x46'),function(){logger[_0x1599('0x30')](_0x1599('0x47'),_0x2845cf);stopRouting(_0x2845cf,_0x380f50,_0x4106b4,_0x2420fc);clearTimeout(_0xa518b2);_0xa518b2=undefined;_0x4019b5['close'](!![]);if(_0x2420fc[_0x1599('0x45')][_0x2845cf]){delete _0x2420fc[_0x1599('0x45')][_0x2845cf];}_0x286c05[_0x1599('0x40')]();});_0x2420fc['rules'][_0x2845cf]['on']('complete',function(){if(_0x2420fc['rules'][_0x2845cf]){delete _0x2420fc[_0x1599('0x45')][_0x2845cf];}});_0xa518b2=setTimeout(function(){logger[_0x1599('0x30')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x2845cf);endRouting(_0x2845cf,_0x380f50,_0x4106b4,_0x2420fc);clearTimeout(_0xa518b2);_0x4019b5[_0x1599('0x48')](!![]);_0x286c05[_0x1599('0x49')]();},_0x2b2894);switch(_0x380f50[_0x1599('0x4a')]){case'rrmemory':strategy[_0x1599('0x4b')](_0x4019b5,_0x380f50,_0x2420fc,_0x4106b4);break;default:strategy[_0x1599('0x4c')](_0x4019b5,_0x380f50,_0x2420fc,_0x4106b4);}}else{logger[_0x1599('0x38')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x2845cf,_0x4d2cc3['name']);_0x286c05[_0x1599('0x40')]();}}}catch(_0x572a82){console[_0x1599('0x4d')](_0x572a82);logger[_0x1599('0x38')](_0x1599('0x3d'),_0x2845cf,_0x572a82[_0x1599('0x4e')]);_0x286c05[_0x1599('0x40')]();}};}; \ 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 3a8ef19..1e130fc 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 _0x29d4=['routing','notificationId','squeue','agent','realtime','push','bind','timeout','handleDrained','prototype','handleRun','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','debug','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','saveWaitingNotification','showNotification','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger'];(function(_0x4ca1d5,_0x404eea){var _0x5bbebc=function(_0x313a47){while(--_0x313a47){_0x4ca1d5['push'](_0x4ca1d5['shift']());}};_0x5bbebc(++_0x404eea);}(_0x29d4,0x1a1));var _0x429d=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0x29d4[_0x4d07cc];return _0x42de3b;};'use strict';var _=require(_0x429d('0x0'));var uuid=require('uuid');var util=require(_0x429d('0x1'));var logger=require(_0x429d('0x2'))(_0x429d('0x3'));var Agent=function(_0x472fc9,_0x45df1c,_0x4e287b,_0xc3989d){this[_0x429d('0x4')]=uuid['v4']();this[_0x429d('0x5')]=_0x472fc9;this[_0x429d('0x6')]=_0x45df1c;this[_0x429d('0x7')]=_0x4e287b;this[_0x429d('0x3')]=_0xc3989d;this[_0x429d('0x5')][_0x429d('0x8')](this['handleRun'][_0x429d('0x9')](this),this['handleTimeout'][_0x429d('0x9')](this));this[_0x429d('0x5')]['on'](_0x429d('0xa'),this['handleTimeout'][_0x429d('0x9')](this));this[_0x429d('0x5')]['on']('drained',this[_0x429d('0xb')][_0x429d('0x9')](this));};Agent[_0x429d('0xc')]['push']=function(){this[_0x429d('0x5')][_0x429d('0x8')](this[_0x429d('0xd')][_0x429d('0x9')](this),this['handleTimeout'][_0x429d('0x9')](this));};Agent[_0x429d('0xc')][_0x429d('0xb')]=function(){this['handleTimeout'](!![]);};Agent[_0x429d('0xc')][_0x429d('0xd')]=function(){logger['debug'](_0x429d('0xe'),this[_0x429d('0x5')]['id'],this[_0x429d('0x6')]['id']);if(_[_0x429d('0xf')](this[_0x429d('0x7')][_0x429d('0x10')][this['agent']['id']])){logger[_0x429d('0x11')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x429d('0x5')]['id'],this[_0x429d('0x6')]['id']);setTimeout(this[_0x429d('0x8')][_0x429d('0x9')](this),0x3e8);}else{if(this['routing'][_0x429d('0x12')]||util[_0x429d('0x13')](this[_0x429d('0x5')]['id'],this['realtime'][_0x429d('0x10')][this[_0x429d('0x6')]['id']],this[_0x429d('0x5')][_0x429d('0x14')],![])){this[_0x429d('0x7')][_0x429d('0x10')][this['agent']['id']][_0x429d('0x15')]=!![];this[_0x429d('0x7')][_0x429d('0x10')][this['agent']['id']][_0x429d('0x16')]=undefined;util[_0x429d('0x17')](this[_0x429d('0x7')],this[_0x429d('0x3')],this[_0x429d('0x6')],this[_0x429d('0x5')]['channel']);util[_0x429d('0x18')](this[_0x429d('0x4')],this['squeue']['id'],this[_0x429d('0x7')][_0x429d('0x10')][this[_0x429d('0x6')]['id']],null,this[_0x429d('0x3')]);util['writeLog'](this[_0x429d('0x5')]['id'],this[_0x429d('0x7')][_0x429d('0x10')][this[_0x429d('0x6')]['id']],_0x429d('0x19')+(this['routing'][_0x429d('0x12')]?_0x429d('0x1a'):''));}else{logger[_0x429d('0x11')](_0x429d('0x1b'),this[_0x429d('0x5')]['id'],this[_0x429d('0x6')]['id']);setTimeout(this[_0x429d('0x8')][_0x429d('0x9')](this),0x3e8);}}};Agent[_0x429d('0xc')]['handleTimeout']=function(_0x31cae6){if(_[_0x429d('0xf')](this['realtime'][_0x429d('0x10')][this[_0x429d('0x6')]['id']])){return logger[_0x429d('0x11')](_0x429d('0x1c'),this[_0x429d('0x5')]['id'],this['agent']['id']);}else{logger[_0x429d('0x11')](_0x429d('0x1d'),this[_0x429d('0x5')]['id'],this[_0x429d('0x6')]['id']);util[_0x429d('0x1e')](this[_0x429d('0x4')],this['squeue']['id'],this['realtime'][_0x429d('0x10')][this[_0x429d('0x6')]['id']],null,this['routing']);this['realtime'][_0x429d('0x10')][this['agent']['id']][_0x429d('0x15')]=![];this[_0x429d('0x7')][_0x429d('0x10')][this[_0x429d('0x6')]['id']]['busyQueue']=undefined;util[_0x429d('0x1f')](this[_0x429d('0x7')],this['routing'],this['agent'],this['squeue']['channel']);util['writeLog'](this[_0x429d('0x5')]['id'],this['realtime']['agents'][this[_0x429d('0x6')]['id']],_0x31cae6?_0x429d('0x20'):_0x429d('0x21'));}if(!_0x31cae6){setTimeout(this[_0x429d('0x8')][_0x429d('0x9')](this),0x3e8);}};function agent(_0x1a5d80,_0x4b23ab,_0x423dc8,_0x2c5fa5){return new Agent(_0x1a5d80,_0x4b23ab,_0x423dc8,_0x2c5fa5);}module[_0x429d('0x22')]=agent; \ No newline at end of file +var _0x3937=['prototype','handleDrained','debug','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','agents','channel','busy','showNotification','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','removeWaitingNotification','STOP','TIMEOUT','exports','lodash','./util','../../../../../config/logger','notificationId','squeue','agent','realtime','routing','push','handleRun','bind','timeout','handleTimeout'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x3937,0xbf));var _0x7393=function(_0x3d1716,_0x3091cc){_0x3d1716=_0x3d1716-0x0;var _0x30cfdd=_0x3937[_0x3d1716];return _0x30cfdd;};'use strict';var _=require(_0x7393('0x0'));var uuid=require('uuid');var util=require(_0x7393('0x1'));var logger=require(_0x7393('0x2'))('routing');var Agent=function(_0x45cd02,_0x503841,_0x224468,_0x4c9c71){this[_0x7393('0x3')]=uuid['v4']();this[_0x7393('0x4')]=_0x45cd02;this[_0x7393('0x5')]=_0x503841;this[_0x7393('0x6')]=_0x224468;this[_0x7393('0x7')]=_0x4c9c71;this[_0x7393('0x4')][_0x7393('0x8')](this[_0x7393('0x9')][_0x7393('0xa')](this),this['handleTimeout']['bind'](this));this[_0x7393('0x4')]['on'](_0x7393('0xb'),this[_0x7393('0xc')]['bind'](this));this[_0x7393('0x4')]['on']('drained',this['handleDrained']['bind'](this));};Agent['prototype'][_0x7393('0x8')]=function(){this[_0x7393('0x4')][_0x7393('0x8')](this['handleRun'][_0x7393('0xa')](this),this[_0x7393('0xc')][_0x7393('0xa')](this));};Agent[_0x7393('0xd')][_0x7393('0xe')]=function(){this[_0x7393('0xc')](!![]);};Agent[_0x7393('0xd')][_0x7393('0x9')]=function(){logger[_0x7393('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this['squeue']['id'],this[_0x7393('0x5')]['id']);if(_['isNil'](this['realtime']['agents'][this[_0x7393('0x5')]['id']])){logger['debug'](_0x7393('0x10'),this[_0x7393('0x4')]['id'],this['agent']['id']);setTimeout(this[_0x7393('0x8')]['bind'](this),0x3e8);}else{if(this['routing'][_0x7393('0x11')]||util[_0x7393('0x12')](this[_0x7393('0x4')]['id'],this[_0x7393('0x6')][_0x7393('0x13')][this[_0x7393('0x5')]['id']],this[_0x7393('0x4')][_0x7393('0x14')],![])){this['realtime']['agents'][this[_0x7393('0x5')]['id']][_0x7393('0x15')]=!![];this[_0x7393('0x6')][_0x7393('0x13')][this[_0x7393('0x5')]['id']]['busyQueue']=undefined;util['saveWaitingNotification'](this['realtime'],this[_0x7393('0x7')],this['agent'],this['squeue'][_0x7393('0x14')]);util[_0x7393('0x16')](this['notificationId'],this[_0x7393('0x4')]['id'],this[_0x7393('0x6')][_0x7393('0x13')][this[_0x7393('0x5')]['id']],null,this[_0x7393('0x7')]);util[_0x7393('0x17')](this[_0x7393('0x4')]['id'],this[_0x7393('0x6')][_0x7393('0x13')][this[_0x7393('0x5')]['id']],_0x7393('0x18')+(this[_0x7393('0x7')][_0x7393('0x11')]?':FORCED':''));}else{logger[_0x7393('0xf')](_0x7393('0x19'),this[_0x7393('0x4')]['id'],this[_0x7393('0x5')]['id']);setTimeout(this[_0x7393('0x8')][_0x7393('0xa')](this),0x3e8);}}};Agent['prototype'][_0x7393('0xc')]=function(_0x4befa4){if(_[_0x7393('0x1a')](this['realtime'][_0x7393('0x13')][this[_0x7393('0x5')]['id']])){return logger[_0x7393('0xf')](_0x7393('0x10'),this[_0x7393('0x4')]['id'],this[_0x7393('0x5')]['id']);}else{logger[_0x7393('0xf')](_0x7393('0x1b'),this[_0x7393('0x4')]['id'],this[_0x7393('0x5')]['id']);util[_0x7393('0x1c')](this[_0x7393('0x3')],this['squeue']['id'],this['realtime'][_0x7393('0x13')][this['agent']['id']],null,this[_0x7393('0x7')]);this['realtime'][_0x7393('0x13')][this['agent']['id']][_0x7393('0x15')]=![];this[_0x7393('0x6')][_0x7393('0x13')][this[_0x7393('0x5')]['id']][_0x7393('0x1d')]=undefined;util[_0x7393('0x1e')](this[_0x7393('0x6')],this[_0x7393('0x7')],this[_0x7393('0x5')],this[_0x7393('0x4')]['channel']);util[_0x7393('0x17')](this['squeue']['id'],this[_0x7393('0x6')]['agents'][this[_0x7393('0x5')]['id']],_0x4befa4?_0x7393('0x1f'):_0x7393('0x20'));}if(!_0x4befa4){setTimeout(this[_0x7393('0x8')][_0x7393('0xa')](this),0x3e8);}};function agent(_0x487a9b,_0x14ee6e,_0x596f49,_0x434333){return new Agent(_0x487a9b,_0x14ee6e,_0x596f49,_0x434333);}module[_0x7393('0x21')]=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 d5761d8..5f56f3c 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 _0x8ac7=['realtime','handleRun','bind','timeout','handleTimeout','handleDrained','prototype','push','isNil','Agents','debug','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agents','channel','writeLog','busyQueue','name','saveWaitingNotification','showNotification','notificationId','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','length','hideNotification','STOP','busy','exports','lodash','uuid','./util','routing','squeue','queue'];(function(_0x721409,_0x2f6eb8){var _0x4aced1=function(_0x27b420){while(--_0x27b420){_0x721409['push'](_0x721409['shift']());}};_0x4aced1(++_0x2f6eb8);}(_0x8ac7,0x9a));var _0x78ac=function(_0xdaee8,_0x9b9d42){_0xdaee8=_0xdaee8-0x0;var _0x3536dd=_0x8ac7[_0xdaee8];return _0x3536dd;};'use strict';var _=require(_0x78ac('0x0'));var uuid=require(_0x78ac('0x1'));var util=require(_0x78ac('0x2'));var logger=require('../../../../../config/logger')(_0x78ac('0x3'));var Beepall=function(_0x1df4cc,_0x11dd0b,_0x30ae50,_0x306266){this['notificationId']=uuid['v4']();this[_0x78ac('0x4')]=_0x1df4cc;this[_0x78ac('0x5')]=_0x11dd0b;this[_0x78ac('0x6')]=_0x30ae50;this[_0x78ac('0x3')]=_0x306266;this['squeue']['push'](this[_0x78ac('0x7')][_0x78ac('0x8')](this),this['handleTimeout'][_0x78ac('0x8')](this));this['squeue']['on'](_0x78ac('0x9'),this[_0x78ac('0xa')]['bind'](this));this['squeue']['on']('drained',this[_0x78ac('0xb')][_0x78ac('0x8')](this));};Beepall[_0x78ac('0xc')][_0x78ac('0xd')]=function(){this[_0x78ac('0x4')]['push'](this[_0x78ac('0x7')]['bind'](this),this['handleTimeout'][_0x78ac('0x8')](this));};Beepall['prototype'][_0x78ac('0xb')]=function(){this[_0x78ac('0xa')](!![]);};Beepall[_0x78ac('0xc')][_0x78ac('0x7')]=function(){var _0x3be3d5=!![];if(!_[_0x78ac('0xe')](this[_0x78ac('0x5')])&&!_[_0x78ac('0xe')](this[_0x78ac('0x5')][_0x78ac('0xf')])&&this[_0x78ac('0x5')][_0x78ac('0xf')]['length']>0x0){for(var _0x46c2a4=0x0,_0x42a000;_0x46c2a40x0){for(var _0x162a60=0x0,_0x30e3cb;_0x162a600x0&&_0x11b408[_0x2cd17f+_0x2c0c('0x26')]>=_0x11b408[_0x2cd17f+_0x2c0c('0x25')]){writeLog(_0x483736,_0x11b408,_0x2cd17f[_0x2c0c('0x27')]()+_0x2c0c('0x28'));return![];}}return!![];};exports[_0x2c0c('0x29')]=function(_0x4fd803,_0xd44322,_0x3452b9,_0x239705,_0x214c4b){return sendNotification(!![],_0x4fd803,_0xd44322,_0x3452b9,_0x239705,_0x214c4b);};exports[_0x2c0c('0x2a')]=function(_0x342462,_0x312a6a,_0x4e462f,_0x3984d7,_0x1593cb){return sendNotification(![],_0x342462,_0x312a6a,_0x4e462f,_0x3984d7,_0x1593cb);};exports[_0x2c0c('0x2b')]=function(_0x335d1d,_0x3f9298,_0x580b10){var _0x348bef=_0x3f9298[_0x2c0c('0x2c')][_0x2c0c('0x2d')];if(!_0x348bef&&_0x580b10){_0x348bef=_0x580b10['id'];}var _0xa93abb=_['some'](_0x335d1d[_0x3f9298[_0x2c0c('0x2e')]+_0x2c0c('0x2f')],function(_0x137fc2){var _0x483a5b=_[_0x2c0c('0x30')](_0x3f9298[_0x2c0c('0x2e')])+_0x2c0c('0x31');return _0x137fc2[_0x483a5b]===_0x3f9298[_0x2c0c('0x2c')]['id'];});if(!_0xa93abb&&_0x348bef){_0xa93abb=_[_0x2c0c('0x32')](_0x335d1d[_0x2c0c('0x33')][_0x348bef][_0x3f9298[_0x2c0c('0x2e')]+_0x2c0c('0x34')],function(_0x1f8b2b){return _0x1f8b2b['id']===_0x3f9298[_0x2c0c('0x2c')]['id'];});}return _0xa93abb;};exports[_0x2c0c('0x35')]=function(_0xa78594,_0x4c7631,_0x22f1b6,_0x3c7ba0){_0xa78594[_0x2c0c('0x33')][_0x22f1b6['id']][_0x3c7ba0+'WaitingInteractions'][_0x4c7631[_0x2c0c('0x1a')]['id']]={'id':_0x4c7631[_0x2c0c('0x2c')]['id']};};exports[_0x2c0c('0x36')]=function(_0x289f03,_0x80c988,_0x54e19c,_0x2014c0){delete _0x289f03[_0x2c0c('0x33')][_0x54e19c['id']][_0x2014c0+_0x2c0c('0x34')][_0x80c988['message']['id']];};exports['writeLog']=writeLog; \ No newline at end of file +var _0xa227=['UserId','some','channel','capitalize','InteractionId','agents','WaitingInteractions','saveWaitingNotification','removeWaitingNotification','writeLog','lodash','util','../utils','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','format','emit','user:save','\x20interaction','notificationShake','body','queue','msg','getMustacheRender','account','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','[%s][QUEUE]\x20%s','message','user:%s','name','notification:%s','save','debug','isAgentAvailable','busy','BUSY','Pause','PAUSE','Capacity','hasOwnProperty','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','interaction'];(function(_0x4b8518,_0x3dc26b){var _0x4361c7=function(_0x14f493){while(--_0x14f493){_0x4b8518['push'](_0x4b8518['shift']());}};_0x4361c7(++_0x3dc26b);}(_0xa227,0x1aa));var _0x7a22=function(_0x513b28,_0x4bea4e){_0x513b28=_0x513b28-0x0;var _0x20bc7e=_0xa227[_0x513b28];return _0x20bc7e;};'use strict';var _=require(_0x7a22('0x0'));var util=require(_0x7a22('0x1'));var utils=require(_0x7a22('0x2'));var Redis=require(_0x7a22('0x3'));var config=require(_0x7a22('0x4'));var logger=require(_0x7a22('0x5'))(_0x7a22('0x6'));config[_0x7a22('0x7')]=_[_0x7a22('0x8')](config['redis'],{'host':_0x7a22('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7a22('0x7')]));function sendNotification(_0x108a18,_0x5b6824,_0x802cf8,_0x4fb975,_0x89672,_0x36fe02){io['to'](util[_0x7a22('0xa')]('user:%s',_0x4fb975['name']))[_0x7a22('0xb')](_0x7a22('0xc'),_0x4fb975);var _0x1cc253=_0x36fe02||{};var _0x1408bc=_0x802cf8['split']('.');var _0x57555d={'uniqueid':_0x5b6824,'channel':_0x1408bc[0x0],'id':_0x1408bc[0x1],'title':_0x1408bc[0x0]+_0x7a22('0xd'),'interactionId':_0x1408bc[0x2],'queue':_0x89672?_0x89672['name']:null,'sound':_0x1cc253['account']['notificationSound'],'shake':_0x1cc253['account'][_0x7a22('0xe')]};try{if(!_0x1cc253['body']){_0x1cc253['body']={};}if(_0x89672){_0x1cc253[_0x7a22('0xf')][_0x7a22('0x10')]=_0x89672;}else if(_0x1cc253['body'][_0x7a22('0x10')]){delete _0x1cc253['body'][_0x7a22('0x10')];}_0x57555d[_0x7a22('0x11')]=utils[_0x7a22('0x12')](_0x1cc253[_0x7a22('0x13')][_0x7a22('0x14')],_0x1cc253);}catch(_0x58c477){_0x57555d['msg']=_0x7a22('0x15');logger['error'](util['format'](_0x7a22('0x16'),_0x5b6824,_0x58c477[_0x7a22('0x17')]));}io['to'](util[_0x7a22('0xa')](_0x7a22('0x18'),_0x4fb975[_0x7a22('0x19')]))[_0x7a22('0xb')](util[_0x7a22('0xa')](_0x7a22('0x1a'),_0x108a18?_0x7a22('0x1b'):'remove'),_0x57555d);}function writeLog(_0x49eb19,_0x28ddf1,_0x2676e2){return logger[_0x7a22('0x1c')](util[_0x7a22('0xa')]('[%s][QUEUE][AGENT:%s][STATUS:%s]',_0x49eb19,_0x28ddf1['name'],_0x2676e2));}exports[_0x7a22('0x1d')]=function(_0x191550,_0x51a2ed,_0x5b26c8,_0x3bead0){if(_0x51a2ed[_0x7a22('0x1e')]){writeLog(_0x191550,_0x51a2ed,_0x7a22('0x1f'));return![];}if(!_0x51a2ed['online']){writeLog(_0x191550,_0x51a2ed,'OFFLINE');return![];}if(_0x51a2ed[_0x5b26c8+_0x7a22('0x20')]){writeLog(_0x191550,_0x51a2ed,_0x7a22('0x21'));return![];}if(_0x3bead0&&_0x51a2ed['hasOwnProperty'](_0x5b26c8+_0x7a22('0x22'))&&_0x51a2ed[_0x7a22('0x23')](_0x5b26c8+_0x7a22('0x24'))){if(_0x51a2ed[_0x5b26c8+'Capacity']>0x0&&_0x51a2ed[_0x5b26c8+_0x7a22('0x24')]>=_0x51a2ed[_0x5b26c8+_0x7a22('0x22')]){writeLog(_0x191550,_0x51a2ed,_0x5b26c8[_0x7a22('0x25')]()+_0x7a22('0x26'));return![];}}return!![];};exports[_0x7a22('0x27')]=function(_0x4c9bbe,_0xb92ed,_0x467a6a,_0x4013f0,_0x1e652b){return sendNotification(!![],_0x4c9bbe,_0xb92ed,_0x467a6a,_0x4013f0,_0x1e652b);};exports[_0x7a22('0x28')]=function(_0x2574c7,_0x3969f2,_0x2b2a01,_0x332a50,_0x27bf7e){return sendNotification(![],_0x2574c7,_0x3969f2,_0x2b2a01,_0x332a50,_0x27bf7e);};exports['checkWaitingNotifications']=function(_0x328f31,_0x2dbf65,_0x4daaae){var _0x47e0af=_0x2dbf65[_0x7a22('0x29')][_0x7a22('0x2a')];if(!_0x47e0af&&_0x4daaae){_0x47e0af=_0x4daaae['id'];}var _0x1f37c7=_[_0x7a22('0x2b')](_0x328f31[_0x2dbf65[_0x7a22('0x2c')]+'QueuesWaitingInteractions'],function(_0x354430){var _0x42a66b=_[_0x7a22('0x2d')](_0x2dbf65[_0x7a22('0x2c')])+_0x7a22('0x2e');return _0x354430[_0x42a66b]===_0x2dbf65[_0x7a22('0x29')]['id'];});if(!_0x1f37c7&&_0x47e0af){_0x1f37c7=_['some'](_0x328f31[_0x7a22('0x2f')][_0x47e0af][_0x2dbf65[_0x7a22('0x2c')]+_0x7a22('0x30')],function(_0x38895d){return _0x38895d['id']===_0x2dbf65[_0x7a22('0x29')]['id'];});}return _0x1f37c7;};exports[_0x7a22('0x31')]=function(_0x777b4,_0x17919a,_0x1ee821,_0x1ae412){_0x777b4[_0x7a22('0x2f')][_0x1ee821['id']][_0x1ae412+_0x7a22('0x30')][_0x17919a['message']['id']]={'id':_0x17919a['interaction']['id']};};exports[_0x7a22('0x32')]=function(_0x148534,_0x4e43e5,_0x2b8308,_0x1365da){delete _0x148534[_0x7a22('0x2f')][_0x2b8308['id']][_0x1365da+_0x7a22('0x30')][_0x4e43e5[_0x7a22('0x17')]['id']];};exports[_0x7a22('0x33')]=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 92e53ad..4a02bdd 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 _0x5b40=['routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','map','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','isEmpty','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','shelljs','lodash','./utils'];(function(_0x5d1935,_0x43a4c5){var _0x210b54=function(_0x229f67){while(--_0x229f67){_0x5d1935['push'](_0x5d1935['shift']());}};_0x210b54(++_0x43a4c5);}(_0x5b40,0x111));var _0x05b4=function(_0x46b5fd,_0x3fef76){_0x46b5fd=_0x46b5fd-0x0;var _0x3ad06c=_0x5b40[_0x46b5fd];return _0x3ad06c;};'use strict';var schema=require('validate');var sh=require(_0x05b4('0x0'));var _=require(_0x05b4('0x1'));var utils=require(_0x05b4('0x2'));var logger=require('../../../../config/logger')(_0x05b4('0x3'));var system=schema({'command':{'type':_0x05b4('0x4'),'required':!![],'message':_0x05b4('0x5')}});exports['consequence']=function(_0x47696a,_0xcb49cc){return function(_0x5c36cc){try{var _0x52ff3c={'command':_0xcb49cc[0x0]};var _0x4b735e=system['validate'](_0x52ff3c,{'typecast':!![]});if(_0x4b735e[_0x05b4('0x6')]){logger[_0x05b4('0x7')]('[%s][SYSTEM]\x20%s',_0x47696a,_[_0x05b4('0x8')](_0x4b735e,'message')[_0x05b4('0x9')](',\x20'));logger[_0x05b4('0xa')](_0x05b4('0xb'),_0x47696a);_0x5c36cc[_0x05b4('0xc')]();}else{var _0x267fe9=this;var _0x4174ad=utils['getMustacheRender'](_0xcb49cc[0x0],this);logger[_0x05b4('0xa')](_0x05b4('0xd'),_0x47696a,_0x4174ad);sh[_0x05b4('0xe')](_[_0x05b4('0xf')](_0x4174ad),function(_0x500390,_0x22f759){logger[_0x05b4('0xa')](_0x05b4('0x10'),_0x47696a,_0x500390);if(_0x500390==0x0){var _0x16d723=_0x22f759['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x05b4('0x11')](_0xcb49cc[0x1])||_[_0x05b4('0x12')](_0xcb49cc[0x1])){logger[_0x05b4('0xa')]('[%s][SYSTEM]\x20no\x20variable',_0x47696a);_0x267fe9[_0x05b4('0x13')][_0xcb49cc[0x1]]=_0x16d723;}else{logger[_0x05b4('0xa')](_0x05b4('0x14'),_0x47696a,_0xcb49cc[0x1],_0x16d723);_0x267fe9['body'][_0xcb49cc[0x1]]=_0x16d723;}}_0x5c36cc[_0x05b4('0xc')]();});}}catch(_0x40cc63){logger[_0x05b4('0x7')]('[%s][SYSTEM]\x20%s',_0x47696a,_[_0x05b4('0x15')](_0x40cc63)?JSON[_0x05b4('0x16')](_0x40cc63):_0x40cc63);logger['info'](_0x05b4('0xb'),_0x47696a);_0x5c36cc[_0x05b4('0xc')]();}};}; \ No newline at end of file +var _0xbd50=['message','join','info','next','getMustacheRender','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','[%s][SYSTEM]\x20%s','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error'];(function(_0x224dda,_0x16d0f9){var _0x2987ac=function(_0x3b1033){while(--_0x3b1033){_0x224dda['push'](_0x224dda['shift']());}};_0x2987ac(++_0x16d0f9);}(_0xbd50,0x196));var _0x0bd5=function(_0x214d37,_0x123f64){_0x214d37=_0x214d37-0x0;var _0x94a78=_0xbd50[_0x214d37];return _0x94a78;};'use strict';var schema=require(_0x0bd5('0x0'));var sh=require(_0x0bd5('0x1'));var _=require(_0x0bd5('0x2'));var utils=require('./utils');var logger=require(_0x0bd5('0x3'))(_0x0bd5('0x4'));var system=schema({'command':{'type':_0x0bd5('0x5'),'required':!![],'message':_0x0bd5('0x6')}});exports[_0x0bd5('0x7')]=function(_0x4c17ee,_0x558e89){return function(_0x560cf1){try{var _0x376024={'command':_0x558e89[0x0]};var _0x2ef1d0=system[_0x0bd5('0x0')](_0x376024,{'typecast':!![]});if(_0x2ef1d0[_0x0bd5('0x8')]){logger[_0x0bd5('0x9')]('[%s][SYSTEM]\x20%s',_0x4c17ee,_['map'](_0x2ef1d0,_0x0bd5('0xa'))[_0x0bd5('0xb')](',\x20'));logger[_0x0bd5('0xc')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x4c17ee);_0x560cf1[_0x0bd5('0xd')]();}else{var _0x2fa7d1=this;var _0x519bc6=utils[_0x0bd5('0xe')](_0x558e89[0x0],this);logger[_0x0bd5('0xc')]('[%s][SYSTEM]\x20commnad:\x20%s',_0x4c17ee,_0x519bc6);sh[_0x0bd5('0xf')](_[_0x0bd5('0x10')](_0x519bc6),function(_0x1aa818,_0x5f49ee){logger[_0x0bd5('0xc')](_0x0bd5('0x11'),_0x4c17ee,_0x1aa818);if(_0x1aa818==0x0){var _0x2f9588=_0x5f49ee[_0x0bd5('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x0bd5('0x13')](_0x558e89[0x1])||_[_0x0bd5('0x14')](_0x558e89[0x1])){logger[_0x0bd5('0xc')](_0x0bd5('0x15'),_0x4c17ee);_0x2fa7d1['body'][_0x558e89[0x1]]=_0x2f9588;}else{logger[_0x0bd5('0xc')](_0x0bd5('0x16'),_0x4c17ee,_0x558e89[0x1],_0x2f9588);_0x2fa7d1['body'][_0x558e89[0x1]]=_0x2f9588;}}_0x560cf1[_0x0bd5('0xd')]();});}}catch(_0x23ef4e){logger[_0x0bd5('0x9')](_0x0bd5('0x17'),_0x4c17ee,_['isObject'](_0x23ef4e)?JSON[_0x0bd5('0x18')](_0x23ef4e):_0x23ef4e);logger[_0x0bd5('0xc')](_0x0bd5('0x19'),_0x4c17ee);_0x560cf1[_0x0bd5('0xd')]();}};}; \ 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 bb285ca..057689e 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 _0x0cd6=['routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','join','info','next','channel','Interaction','then','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0x0cd6,0x181));var _0x60cd=function(_0x229d7e,_0x5bc489){_0x229d7e=_0x229d7e-0x0;var _0xa78280=_0x0cd6[_0x229d7e];return _0xa78280;};'use strict';var schema=require(_0x60cd('0x0'));var _=require(_0x60cd('0x1'));var rpc={'chatInteraction':require(_0x60cd('0x2')),'openchannelInteraction':require(_0x60cd('0x3')),'smsInteraction':require(_0x60cd('0x4')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x60cd('0x5')),'whatsappInteraction':require(_0x60cd('0x6'))};var logger=require('../../../../config/logger')(_0x60cd('0x7'));var tag=schema({'tag':{'type':_0x60cd('0x8'),'required':!![],'message':_0x60cd('0x9')}});exports[_0x60cd('0xa')]=function(_0x27d254,_0x11d6b3,_0x2f6bc1,_0x84563e){return function(_0x102115){try{var _0x1d0e54={'tag':_0x11d6b3[0x0]};var _0x3bf2d1=tag[_0x60cd('0x0')](_0x1d0e54,{'typecast':!![]});if(_0x3bf2d1[_0x60cd('0xb')]){logger[_0x60cd('0xc')](_0x60cd('0xd'),_0x27d254,_[_0x60cd('0xe')](_0x3bf2d1,_0x60cd('0xf'))[_0x60cd('0x10')](',\x20'));logger[_0x60cd('0x11')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x27d254);_0x102115[_0x60cd('0x12')]();}else{var _0x56c41b={'ids':[_0x11d6b3[0x0]]};if(rpc[_0x84563e[_0x60cd('0x13')]+_0x60cd('0x14')]){rpc[_0x84563e[_0x60cd('0x13')]+_0x60cd('0x14')]['addTags'](_0x84563e['interaction']['id'],_0x56c41b)[_0x60cd('0x15')](function(_0x5d1e22){logger[_0x60cd('0x11')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x27d254,_0x11d6b3[0x1],_0x84563e[_0x60cd('0x13')],_0x84563e[_0x60cd('0x16')]['id']);})[_0x60cd('0x17')](function(_0x36b70d){logger[_0x60cd('0xc')]('[%s][TAG]\x20%s',_0x27d254,JSON[_0x60cd('0x18')](_0x36b70d));logger[_0x60cd('0x11')](_0x60cd('0x19'),_0x27d254);})[_0x60cd('0x1a')](function(){_0x102115['next']();});}}}catch(_0x46ca03){logger[_0x60cd('0xc')]('[%s][TAG]\x20%s',_0x27d254,_[_0x60cd('0x1b')](_0x46ca03)?JSON[_0x60cd('0x18')](_0x46ca03):_0x46ca03);logger[_0x60cd('0x11')](_0x60cd('0x19'),_0x27d254);_0x102115[_0x60cd('0x12')]();}};}; \ No newline at end of file +var _0x1088=['../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','channel','Interaction','interaction','stringify','info','next','validate','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction'];(function(_0x4893e1,_0xa54be0){var _0x528cd1=function(_0xe5cd3f){while(--_0xe5cd3f){_0x4893e1['push'](_0x4893e1['shift']());}};_0x528cd1(++_0xa54be0);}(_0x1088,0x10b));var _0x8108=function(_0x257b00,_0x3658be){_0x257b00=_0x257b00-0x0;var _0x247e16=_0x1088[_0x257b00];return _0x247e16;};'use strict';var schema=require(_0x8108('0x0'));var _=require('lodash');var rpc={'chatInteraction':require(_0x8108('0x1')),'openchannelInteraction':require(_0x8108('0x2')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x8108('0x3')),'faxInteraction':require(_0x8108('0x4')),'whatsappInteraction':require(_0x8108('0x5'))};var logger=require(_0x8108('0x6'))('routing');var tag=schema({'tag':{'type':_0x8108('0x7'),'required':!![],'message':_0x8108('0x8')}});exports[_0x8108('0x9')]=function(_0x4ed095,_0x1ede26,_0x2df44b,_0x5dda32){return function(_0x56d31a){try{var _0x4f3eb6={'tag':_0x1ede26[0x0]};var _0x41b7af=tag[_0x8108('0x0')](_0x4f3eb6,{'typecast':!![]});if(_0x41b7af[_0x8108('0xa')]){logger[_0x8108('0xb')](_0x8108('0xc'),_0x4ed095,_['map'](_0x41b7af,'message')[_0x8108('0xd')](',\x20'));logger['info'](_0x8108('0xe'),_0x4ed095);_0x56d31a['next']();}else{var _0x5cc787={'ids':[_0x1ede26[0x0]]};if(rpc[_0x5dda32[_0x8108('0xf')]+_0x8108('0x10')]){rpc[_0x5dda32['channel']+_0x8108('0x10')]['addTags'](_0x5dda32[_0x8108('0x11')]['id'],_0x5cc787)['then'](function(_0x5e1bca){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x4ed095,_0x1ede26[0x1],_0x5dda32[_0x8108('0xf')],_0x5dda32['interaction']['id']);})['catch'](function(_0x4432a3){logger[_0x8108('0xb')](_0x8108('0xc'),_0x4ed095,JSON[_0x8108('0x12')](_0x4432a3));logger[_0x8108('0x13')](_0x8108('0xe'),_0x4ed095);})['finally'](function(){_0x56d31a[_0x8108('0x14')]();});}}}catch(_0x546c3e){logger[_0x8108('0xb')](_0x8108('0xc'),_0x4ed095,_['isObject'](_0x546c3e)?JSON[_0x8108('0x12')](_0x546c3e):_0x546c3e);logger[_0x8108('0x13')](_0x8108('0xe'),_0x4ed095);_0x56d31a[_0x8108('0x14')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tvox.js b/server/services/routing/server/applications/tvox.js index 8f865f3..29a97ba 100644 --- a/server/services/routing/server/applications/tvox.js +++ b/server/services/routing/server/applications/tvox.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x58e9=['urlOnAnswer','?params=','urlOnRing','jsonrpc','method','login','params','stringify','utf8','POST','application/json-rpc','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&data=','then','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','error','[%s][TVOX]\x20%s','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise','routing','lodash','consequence','replace','\x20-\x20','includes','push'];(function(_0x158da6,_0x3cb06d){var _0x429c30=function(_0x2d5895){while(--_0x2d5895){_0x158da6['push'](_0x158da6['shift']());}};_0x429c30(++_0x3cb06d);}(_0x58e9,0x10f));var _0x958e=function(_0x449af4,_0x163251){_0x449af4=_0x449af4-0x0;var _0xf6ad52=_0x58e9[_0x449af4];return _0xf6ad52;};'use strict';var rp=require(_0x958e('0x0'));var logger=require('../../../../config/logger')(_0x958e('0x1'));var _=require(_0x958e('0x2'));var arr=[];exports[_0x958e('0x3')]=function(_0x255f0a,_0x13b0cc){return function(_0x484e11){var _0x34f049=_0x13b0cc[0xa];var _0x30810a=_0x13b0cc[0xb];var _0x53d3c2=_0x13b0cc[0xc];var _0x3daca3=_0x13b0cc[0xd];var _0x14d256=_0x13b0cc[0xe];var _0x31231b=_0x13b0cc[0xf][_0x958e('0x4')](/\n/g,_0x958e('0x5'));var _0x7fef6a=_0x13b0cc[0x10][_0x958e('0x4')](/\n/g,'\x20');if(!arr[_0x958e('0x6')](_0x30810a)){arr[_0x958e('0x7')](_0x30810a);var _0x1e667d=_0x13b0cc[0x3];var _0x109a4d=_0x13b0cc[0x4];var _0x4adf9e=_0x13b0cc[0x1];var _0x17fb89=_0x13b0cc[0x0];var _0x23f746={};_0x23f746[_0x958e('0x8')]=_0x13b0cc[0x8]+_0x958e('0x9')+_0x53d3c2+'|'+_0x34f049+'|'+_0x3daca3+'|'+_0x30810a+'|'+_0x14d256;_0x23f746[_0x958e('0xa')]=_0x13b0cc[0x7]+'?params='+_0x53d3c2+'|'+_0x34f049+'|'+_0x3daca3+'|'+_0x30810a+'|'+_0x14d256+'|'+_0x31231b+'|'+_0x7fef6a;_0x23f746['title']=_0x13b0cc[0x9];var _0x4b0554={};_0x4b0554[_0x958e('0xb')]='2.0';_0x4b0554[_0x958e('0xc')]=_0x958e('0xd');var _0x219d9e=[];_0x219d9e[_0x958e('0x7')](_0x13b0cc[0x2]);_0x219d9e[_0x958e('0x7')](_0x13b0cc[0x5]);_0x219d9e[_0x958e('0x7')](_0x13b0cc[0x6]);_0x4b0554[_0x958e('0xe')]=_0x219d9e;_0x4b0554['id']=0x1;var _0x59f336=JSON[_0x958e('0xf')](_0x4b0554);var _0x59ffb2={'encoding':_0x958e('0x10'),'method':_0x958e('0x11'),'timeout':0x2710,'url':_0x1e667d,'headers':{'Content-Type':_0x958e('0x12')},'body':_0x59f336};return rp(_0x59ffb2)['then'](function(_0x107de9){const _0x2029bf=JSON['parse'](_0x107de9);if(!_0x2029bf['result'][_0x958e('0x13')]){throw new Error(_0x958e('0x14'));}var _0x426cdb=_0x30810a;var _0x244ff5='channelId='+_0x4adf9e+_0x958e('0x15')+_0x17fb89+'&sessionId='+_0x426cdb+_0x958e('0x16')+JSON['stringify'](_0x23f746);var _0x408123=_0x109a4d+'?'+_0x244ff5;return rp(_0x408123);})[_0x958e('0x17')](function(_0x261c2d){logger['info'](_0x958e('0x18'),_0x255f0a,_0x261c2d);_0x484e11[_0x958e('0x19')]();})[_0x958e('0x1a')](function(_0x282e1d){logger[_0x958e('0x1b')](_0x958e('0x1c'),_0x255f0a,_['isObject'](_0x282e1d)?JSON[_0x958e('0xf')](_0x282e1d):_0x282e1d);_0x484e11[_0x958e('0x19')]();});}else{logger[_0x958e('0x1d')](_0x958e('0x1e'),_0x255f0a);_0x484e11['next']();}};}; \ No newline at end of file +var _0xc3d6=['../../../../config/logger','routing','lodash','consequence','replace','\x20-\x20','includes','urlOnAnswer','?params=','jsonrpc','method','login','push','params','stringify','utf8','POST','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','channelId=','&serviceId=','&sessionId=','&data=','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','catch','[%s][TVOX]\x20%s','isObject','info','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','request-promise'];(function(_0x4e501e,_0x3f3f07){var _0x49a913=function(_0x4b157b){while(--_0x4b157b){_0x4e501e['push'](_0x4e501e['shift']());}};_0x49a913(++_0x3f3f07);}(_0xc3d6,0x65));var _0x6c3d=function(_0xdc9597,_0x2f9320){_0xdc9597=_0xdc9597-0x0;var _0x2fa32c=_0xc3d6[_0xdc9597];return _0x2fa32c;};'use strict';var rp=require(_0x6c3d('0x0'));var logger=require(_0x6c3d('0x1'))(_0x6c3d('0x2'));var _=require(_0x6c3d('0x3'));var arr=[];exports[_0x6c3d('0x4')]=function(_0x4ec42d,_0x56353b){return function(_0x3bc7bb){var _0x203856=_0x56353b[0xa];var _0x136d80=_0x56353b[0xb];var _0x3c1ae3=_0x56353b[0xc];var _0x5be4a5=_0x56353b[0xd];var _0x4738d9=_0x56353b[0xe];var _0x456da6=_0x56353b[0xf][_0x6c3d('0x5')](/\n/g,_0x6c3d('0x6'));var _0x138f69=_0x56353b[0x10][_0x6c3d('0x5')](/\n/g,'\x20');if(!arr[_0x6c3d('0x7')](_0x136d80)){arr['push'](_0x136d80);var _0x444a0f=_0x56353b[0x3];var _0x5eb373=_0x56353b[0x4];var _0x37ad4c=_0x56353b[0x1];var _0x480063=_0x56353b[0x0];var _0x3c0072={};_0x3c0072[_0x6c3d('0x8')]=_0x56353b[0x8]+_0x6c3d('0x9')+_0x3c1ae3+'|'+_0x203856+'|'+_0x5be4a5+'|'+_0x136d80+'|'+_0x4738d9;_0x3c0072['urlOnRing']=_0x56353b[0x7]+_0x6c3d('0x9')+_0x3c1ae3+'|'+_0x203856+'|'+_0x5be4a5+'|'+_0x136d80+'|'+_0x4738d9+'|'+_0x456da6+'|'+_0x138f69;_0x3c0072['title']=_0x56353b[0x9];var _0x2fe275={};_0x2fe275[_0x6c3d('0xa')]='2.0';_0x2fe275[_0x6c3d('0xb')]=_0x6c3d('0xc');var _0x541816=[];_0x541816['push'](_0x56353b[0x2]);_0x541816[_0x6c3d('0xd')](_0x56353b[0x5]);_0x541816[_0x6c3d('0xd')](_0x56353b[0x6]);_0x2fe275[_0x6c3d('0xe')]=_0x541816;_0x2fe275['id']=0x1;var _0x56ae26=JSON[_0x6c3d('0xf')](_0x2fe275);var _0x45dc08={'encoding':_0x6c3d('0x10'),'method':_0x6c3d('0x11'),'timeout':0x2710,'url':_0x444a0f,'headers':{'Content-Type':'application/json-rpc'},'body':_0x56ae26};return rp(_0x45dc08)[_0x6c3d('0x12')](function(_0x91acc3){const _0x161182=JSON[_0x6c3d('0x13')](_0x91acc3);if(!_0x161182[_0x6c3d('0x14')][_0x6c3d('0x15')]){throw new Error(_0x6c3d('0x16'));}var _0x1d49a5=_0x136d80;var _0x3add15=_0x6c3d('0x17')+_0x37ad4c+_0x6c3d('0x18')+_0x480063+_0x6c3d('0x19')+_0x1d49a5+_0x6c3d('0x1a')+JSON[_0x6c3d('0xf')](_0x3c0072);var _0x538902=_0x5eb373+'?'+_0x3add15;return rp(_0x538902);})[_0x6c3d('0x12')](function(_0x1ace98){logger['info'](_0x6c3d('0x1b'),_0x4ec42d,_0x1ace98);_0x3bc7bb[_0x6c3d('0x1c')]();})[_0x6c3d('0x1d')](function(_0x55068a){logger['error'](_0x6c3d('0x1e'),_0x4ec42d,_[_0x6c3d('0x1f')](_0x55068a)?JSON['stringify'](_0x55068a):_0x55068a);_0x3bc7bb[_0x6c3d('0x1c')]();});}else{logger[_0x6c3d('0x20')](_0x6c3d('0x21'),_0x4ec42d);_0x3bc7bb['next']();}};}; \ 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 aa0739c..03f38cc 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 _0x9c44=['merge','body','account','list','exports','render'];(function(_0x13a9d7,_0x1949c2){var _0x48ddc3=function(_0x4d1a97){while(--_0x4d1a97){_0x13a9d7['push'](_0x13a9d7['shift']());}};_0x48ddc3(++_0x1949c2);}(_0x9c44,0x178));var _0x49c4=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x9c44[_0x550d12];return _0x12103d;};'use strict';var Mustache=require('mustache');var _=require('lodash');module[_0x49c4('0x0')]={'getMustacheRender':function(_0x18bf2d,_0x26844b){return Mustache[_0x49c4('0x1')](_0x18bf2d,_[_0x49c4('0x2')](_0x26844b[_0x49c4('0x3')],{'contact':_0x26844b['contact'],'message':_0x26844b['message'],'account':_0x26844b[_0x49c4('0x4')],'interaction':_0x26844b['interaction'],'list':_0x26844b[_0x49c4('0x5')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x1ea0d9,_0x5cb711){var _0x52ebcd=function(_0x5c1b29){while(--_0x5c1b29){_0x1ea0d9['push'](_0x1ea0d9['shift']());}};_0x52ebcd(++_0x5cb711);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 82f9891..a4c4ea8 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 _0xe8c6=['rules','channel','message','interaction','isArray','applications','length','existsSync','join','.js','app','toLowerCase','appdata','mail','push','slice','split','dialogflowv2','amazonlex','tag','TagId','tvox','account','notificationTemplate','ChatWebsiteId','body','%s:%s:%s','condition','intervals','./applications/','consequence','priority','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','info','Applications\x20executed','stringify','emit','complete','format','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','stack','agent','agents','busy','busyQueue','end','QueueReport','update','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','find','chatQueues','available','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','listen','127.0.0.1','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','./applications/strategy/util','../../../config/logger','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xe8c6,0x1f0));var _0x6e8c=function(_0x573f8b,_0x3324d9){_0x573f8b=_0x573f8b-0x0;var _0x12e9bd=_0xe8c6[_0x573f8b];return _0x12e9bd;};'use strict';var _=require(_0x6e8c('0x0'));var util=require(_0x6e8c('0x1'));var path=require(_0x6e8c('0x2'));var fs=require('fs');var jayson=require(_0x6e8c('0x3'));var BPromise=require('bluebird');var utils=require('./applications/utils');var sUtils=require(_0x6e8c('0x4'));var logger=require(_0x6e8c('0x5'))('routing');var rpc={'openchannelQueueReport':require(_0x6e8c('0x6')),'mailQueueReport':require(_0x6e8c('0x7')),'chatQueueReport':require(_0x6e8c('0x8')),'smsQueueReport':require(_0x6e8c('0x9')),'faxQueueReport':require(_0x6e8c('0xa')),'whatsappQueueReport':require(_0x6e8c('0xb'))};var RuleEngine=require(_0x6e8c('0xc'));function getId(_0x3d6acf,_0x4a9ce5,_0x5189ab){return util['format'](_0x6e8c('0xd'),_0x3d6acf,_0x4a9ce5||0x0,_0x5189ab||0x0);}function getIntervals(_0x2691ec,_0x11ce88){var _0xb6065d=[];if(!_[_0x6e8c('0xe')](_0x11ce88[_0x6e8c('0xf')])&&!_['isNil'](_0x2691ec[_0x11ce88[_0x6e8c('0xf')]])&&!_[_0x6e8c('0xe')](_0x2691ec[_0x11ce88[_0x6e8c('0xf')]][_0x6e8c('0x10')])){_0xb6065d=_[_0x6e8c('0x11')](_0x2691ec[_0x11ce88[_0x6e8c('0xf')]][_0x6e8c('0x10')],_0x6e8c('0x12'));}else if(!_[_0x6e8c('0xe')](_0x11ce88[_0x6e8c('0x12')])){_0xb6065d=[_0x11ce88['interval']];}return _0xb6065d;}exports['listen']=function(_0x365c5d){_0x365c5d[_0x6e8c('0x13')]={};return new BPromise(function(_0x3903db,_0x29ed51){var _0x3e7ad3={'Start':function(_0x1efe8d){var _0x35b18d=this;return new Promise(function(_0x4de55a,_0x3e52ec){if(_0x1efe8d){try{var _0x3f5873=[];var _0x4c3707=getId(_0x1efe8d[_0x6e8c('0x14')],_0x1efe8d[_0x6e8c('0x15')]?_0x1efe8d[_0x6e8c('0x15')]['id']:0x0,_0x1efe8d[_0x6e8c('0x16')]?_0x1efe8d[_0x6e8c('0x16')]['id']:0x0);var _0x8e37e4=sUtils['checkWaitingNotifications'](_0x365c5d,_0x1efe8d);if(!_0x8e37e4&&_0x1efe8d['applications']&&_[_0x6e8c('0x17')](_0x1efe8d[_0x6e8c('0x18')])&&_0x1efe8d[_0x6e8c('0x18')][_0x6e8c('0x19')]){for(var _0x199c20=0x0;_0x199c20<_0x1efe8d[_0x6e8c('0x18')][_0x6e8c('0x19')];_0x199c20+=0x1){var _0xc00822=_0x1efe8d['applications'][_0x199c20];if(fs[_0x6e8c('0x1a')](path[_0x6e8c('0x1b')](__dirname,_0x6e8c('0x18'),_0xc00822['app']+_0x6e8c('0x1c')))){var _0x53a74f=[];switch(_0xc00822[_0x6e8c('0x1d')][_0x6e8c('0x1e')]()){case'autoreply':var _0x3729f9=_0xc00822[_0x6e8c('0x1f')]['split'](',');if(_0x1efe8d['channel']===_0x6e8c('0x20')){_0x53a74f[_0x6e8c('0x21')](_0x3729f9[0x0]);_0x53a74f['push'](_0x3729f9[0x1]);_0x53a74f[_0x6e8c('0x21')](_0x3729f9['slice'](0x2,_0x3729f9[_0x6e8c('0x19')])[_0x6e8c('0x1b')](','));}else{_0x53a74f[_0x6e8c('0x21')](_0x3729f9[0x0]);_0x53a74f[_0x6e8c('0x21')](_0x3729f9[_0x6e8c('0x22')](0x1,_0x3729f9['length'])[_0x6e8c('0x1b')](','));}break;case'dialogflow':var _0x4c0f3a=_0xc00822[_0x6e8c('0x1f')][_0x6e8c('0x23')](',');_0x53a74f[_0x6e8c('0x21')](_0x4c0f3a[0x0]);_0x53a74f[_0x6e8c('0x21')](_0x4c0f3a[0x1]);_0x53a74f['push'](_0x4c0f3a[_0x6e8c('0x22')](0x2,_0x4c0f3a[_0x6e8c('0x19')])[_0x6e8c('0x1b')](','));break;case _0x6e8c('0x24'):var _0x3cef6a=_0xc00822['appdata']['split'](',');_0x53a74f['push'](_0x3cef6a[0x0]);_0x53a74f[_0x6e8c('0x21')](_0x3cef6a[0x1]);_0x53a74f[_0x6e8c('0x21')](_0x3cef6a[0x2]);_0x53a74f['push'](_0x3cef6a[0x3]);_0x53a74f[_0x6e8c('0x21')](_0x3cef6a[_0x6e8c('0x22')](0x4,_0x3cef6a[_0x6e8c('0x19')])[_0x6e8c('0x1b')](','));break;case _0x6e8c('0x25'):var _0x15d59b=_0xc00822[_0x6e8c('0x1f')]['split'](',');_0x53a74f[_0x6e8c('0x21')](_0x15d59b[0x0]);_0x53a74f[_0x6e8c('0x21')](_0x15d59b[0x1]);_0x53a74f[_0x6e8c('0x21')](_0x15d59b[0x2]);_0x53a74f[_0x6e8c('0x21')](_0x15d59b[0x3]);_0x53a74f[_0x6e8c('0x21')](_0x15d59b['slice'](0x4,_0x15d59b['length'])[_0x6e8c('0x1b')](','));break;case _0x6e8c('0x15'):_0x53a74f[_0x6e8c('0x21')](_0xc00822[_0x6e8c('0x1f')]);break;case _0x6e8c('0x26'):_0x53a74f[_0x6e8c('0x21')](_0xc00822[_0x6e8c('0x27')]);_0x53a74f[_0x6e8c('0x21')](_0xc00822[_0x6e8c('0x1f')]);break;case _0x6e8c('0x28'):var _0x8d0363=utils['getMustacheRender'](_0x1efe8d[_0x6e8c('0x29')][_0x6e8c('0x2a')],_0x1efe8d);var _0xb20da7=_0xc00822['appdata'][_0x6e8c('0x23')](',');_0x53a74f[_0x6e8c('0x21')](_0xb20da7[0x0]);_0x53a74f[_0x6e8c('0x21')](_0xb20da7[0x1]);_0x53a74f[_0x6e8c('0x21')](_0xb20da7[0x2]);_0x53a74f[_0x6e8c('0x21')](_0xb20da7[0x3]);_0x53a74f['push'](_0xb20da7[0x4]);_0x53a74f[_0x6e8c('0x21')](_0xb20da7[0x5]);_0x53a74f[_0x6e8c('0x21')](_0xb20da7[0x6]);_0x53a74f['push'](_0xb20da7[0x7]);_0x53a74f[_0x6e8c('0x21')](_0xb20da7[0x8]);_0x53a74f['push'](_0xb20da7[0x9]);_0x53a74f[_0x6e8c('0x21')](_0xb20da7[0xa]);_0x53a74f[_0x6e8c('0x21')](_0x1efe8d[_0x6e8c('0x16')]['id']);_0x53a74f[_0x6e8c('0x21')](_0x1efe8d[_0x6e8c('0x15')]['id']);_0x53a74f[_0x6e8c('0x21')](_0xc00822[_0x6e8c('0x2b')]);_0x53a74f[_0x6e8c('0x21')](_0x1efe8d[_0x6e8c('0x16')]['ContactId']);_0x53a74f[_0x6e8c('0x21')](_0x1efe8d[_0x6e8c('0x2c')][_0x6e8c('0x2c')]);_0x53a74f[_0x6e8c('0x21')](_0x8d0363);break;default:_0x53a74f=_['isNil'](_0xc00822['appdata'])?[]:_0xc00822[_0x6e8c('0x1f')]['split'](',');}var _0x15fba9={'id':util['format'](_0x6e8c('0x2d'),_0x4c3707,_0xc00822['id'],_0xc00822['app']),'condition':require('./interval')[_0x6e8c('0x2e')](_0x4c3707,getIntervals(_0x365c5d[_0x6e8c('0x2f')],_0xc00822),_0x365c5d),'consequence':require(_0x6e8c('0x30')+_0xc00822[_0x6e8c('0x1d')])[_0x6e8c('0x31')](_0x4c3707,_0x53a74f,_0x365c5d,_0x1efe8d),'p':_0xc00822[_0x6e8c('0x32')]||0x0};logger['info']('Push\x20new\x20rule',_0x15fba9['id'],_0x6e8c('0x33'),getIntervals(_0x365c5d[_0x6e8c('0x2f')],_0xc00822)[_0x6e8c('0x1b')](_0x6e8c('0x34')));_0x3f5873['push'](_0x15fba9);}else{logger[_0x6e8c('0x35')](_0x6e8c('0x36'),path[_0x6e8c('0x1b')](__dirname,_0x6e8c('0x18'),_0xc00822[_0x6e8c('0x1d')]+_0x6e8c('0x1c')));}}_0x365c5d[_0x6e8c('0x13')][_0x4c3707]=new RuleEngine(_0x3f5873);_0x365c5d[_0x6e8c('0x13')][_0x4c3707][_0x6e8c('0x37')](_0x1efe8d,function(_0x2ae531){logger[_0x6e8c('0x38')](_0x6e8c('0x39'),JSON[_0x6e8c('0x3a')](_0x2ae531['matchPath']));if(_0x365c5d[_0x6e8c('0x13')][_0x4c3707]){_0x365c5d[_0x6e8c('0x13')][_0x4c3707][_0x6e8c('0x3b')](_0x6e8c('0x3c'));}});return _0x4de55a({'code':0xc8,'message':_0x1efe8d});}else{if(_0x8e37e4){logger['info'](util[_0x6e8c('0x3d')](_0x6e8c('0x3e'),_0x4c3707));}else{logger[_0x6e8c('0x38')](_0x6e8c('0x3f'));}return _0x4de55a({'code':0xc8,'message':_0x1efe8d});}}catch(_0x3e8912){logger[_0x6e8c('0x35')](_0x3e8912[_0x6e8c('0x40')]);return _0x3e52ec(_0x35b18d[_0x6e8c('0x35')](0x1f4,_0x3e8912));}}return _0x3e52ec('routing\x20is\x20empty');});},'AcceptMessage':function(_0x3b6deb){var _0x210a35=this;return new Promise(function(_0x106790,_0x1f2407){if(_0x3b6deb[_0x6e8c('0x41')]&&_0x3b6deb[_0x6e8c('0x41')]['id']){if(_0x365c5d['agents'][_0x3b6deb[_0x6e8c('0x41')]['id']]){_0x365c5d[_0x6e8c('0x42')][_0x3b6deb[_0x6e8c('0x41')]['id']][_0x6e8c('0x43')]=![];_0x365c5d['agents'][_0x3b6deb[_0x6e8c('0x41')]['id']][_0x6e8c('0x44')]=undefined;}}if(_0x3b6deb['message']&&_0x3b6deb['message']['id']){try{var _0x702c4c=getId(_0x3b6deb[_0x6e8c('0x14')],_0x3b6deb[_0x6e8c('0x15')]?_0x3b6deb[_0x6e8c('0x15')]['id']:0x0,_0x3b6deb[_0x6e8c('0x16')]?_0x3b6deb['interaction']['id']:0x0);if(_0x365c5d[_0x6e8c('0x13')][_0x702c4c]){_0x365c5d['rules'][_0x702c4c][_0x6e8c('0x3b')](_0x6e8c('0x45'));if(rpc[_0x3b6deb[_0x6e8c('0x14')]+'QueueReport']){rpc[_0x3b6deb['channel']+_0x6e8c('0x46')][_0x6e8c('0x47')](_0x702c4c,{'UserId':_0x3b6deb[_0x6e8c('0x15')][_0x6e8c('0x48')]})['catch'](function(){logger[_0x6e8c('0x35')](_0x6e8c('0x49'));});}}return _0x106790({'code':0xc8,'message':_0x3b6deb});}catch(_0x5909ee){logger[_0x6e8c('0x35')](_0x5909ee[_0x6e8c('0x40')]);return _0x1f2407(_0x210a35[_0x6e8c('0x35')](0x1f4,_0x5909ee));}}logger[_0x6e8c('0x35')](_0x6e8c('0x4a'));return _0x1f2407(_0x210a35[_0x6e8c('0x35')](0x1f4,_0x6e8c('0x4a')));});},'RejectMessage':function(_0x2a4134){var _0x5c0672=this;return new Promise(function(_0x58f630,_0x2b667a){if(_0x2a4134[_0x6e8c('0x41')]&&_0x2a4134['agent']['id']){try{if(_0x365c5d[_0x6e8c('0x42')][_0x2a4134[_0x6e8c('0x41')]['id']]){_0x365c5d[_0x6e8c('0x42')][_0x2a4134[_0x6e8c('0x41')]['id']]['busy']=![];_0x365c5d['agents'][_0x2a4134['agent']['id']][_0x6e8c('0x44')]=undefined;}return _0x58f630({'code':0xc8,'message':_0x2a4134});}catch(_0x1112b1){logger['error'](_0x1112b1[_0x6e8c('0x40')]);return _0x2b667a(_0x5c0672[_0x6e8c('0x35')](0x1f4,_0x1112b1));}}logger['error'](_0x6e8c('0x4a'));return _0x2b667a(_0x5c0672[_0x6e8c('0x35')](0x1f4,_0x6e8c('0x4a')));});},'AbandonInteraction':function(_0x96d3f1){var _0x19f1b2=this;return new Promise(function(_0xb4b76e,_0x239bb4){if(_0x96d3f1[_0x6e8c('0x14')]&&_0x96d3f1[_0x6e8c('0x16')]&&_0x96d3f1[_0x6e8c('0x16')]['id']){try{var _0x16dd78=getId(_0x96d3f1[_0x6e8c('0x14')],_0x96d3f1[_0x6e8c('0x15')]?_0x96d3f1[_0x6e8c('0x15')]['id']:0x0,_0x96d3f1[_0x6e8c('0x16')]?_0x96d3f1[_0x6e8c('0x16')]['id']:0x0);if(_0x365c5d[_0x6e8c('0x13')][_0x16dd78]){_0x365c5d[_0x6e8c('0x13')][_0x16dd78]['emit'](_0x6e8c('0x45'));}return _0xb4b76e({'code':0xc8,'message':_0x96d3f1});}catch(_0x509e46){logger[_0x6e8c('0x35')](_0x509e46[_0x6e8c('0x40')]);return _0x239bb4(_0x19f1b2[_0x6e8c('0x35')](0x1f4,_0x509e46));}}logger['error'](_0x6e8c('0x4a'));return _0x239bb4(_0x19f1b2[_0x6e8c('0x35')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x279229){var _0x35ebf6=this;return new Promise(function(_0x4e2226,_0x10c9cd){if(_0x365c5d[_0x6e8c('0x42')][_0x6e8c('0x4b')](_0x279229['id'])){for(var _0x8f1d54 in _0x279229[_0x6e8c('0x4c')]){if(_0x279229['capacity'][_0x6e8c('0x4b')](_0x8f1d54)){if(_0x365c5d[_0x6e8c('0x42')][_0x279229['id']]['hasOwnProperty'](_0x8f1d54+_0x6e8c('0x4d'))){_0x365c5d[_0x6e8c('0x42')][_0x279229['id']][_0x8f1d54+_0x6e8c('0x4d')]=parseInt(_0x279229[_0x6e8c('0x4c')][_0x8f1d54],0xa);}}}_0x365c5d[_0x6e8c('0x42')][_0x279229['id']][_0x6e8c('0x4e')]();return _0x4e2226({'code':0xc8,'message':_0x365c5d[_0x6e8c('0x42')][_0x279229['id']]});}else{return _0x10c9cd(_0x35ebf6[_0x6e8c('0x35')](0x1f4,_0x6e8c('0x4f')));}});},'Agents':function(_0x4bb09e){return new Promise(function(_0xde6e1d){var _0x3defbf=_[_0x6e8c('0x50')](_0x365c5d[_0x6e8c('0x42')]);if(_0x4bb09e&&_0x4bb09e['id']){var _0x5e9558=_[_0x6e8c('0x51')](_0x3defbf,function(_0x7b6207){return _0x7b6207['id']===_0x4bb09e['id'];});_0xde6e1d(_0x5e9558);}else{_0xde6e1d({'count':_0x3defbf[_0x6e8c('0x19')],'rows':_0x3defbf});}});},'ChatQueues':function(){return new Promise(function(_0x300312){var _0x4940f8=[];for(var _0x1c189b in _0x365c5d[_0x6e8c('0x52')]){if(_0x365c5d[_0x6e8c('0x52')][_0x6e8c('0x4b')](_0x1c189b)){var _0x12bdde=_0x365c5d[_0x6e8c('0x52')][_0x1c189b];var _0xb7d7d0={'id':_0x12bdde['id'],'available':_0x12bdde[_0x6e8c('0x53')],'loggedIn':_0x12bdde[_0x6e8c('0x54')],'name':_0x12bdde[_0x6e8c('0x55')],'paused':_0x12bdde['paused'],'waiting':_0x12bdde[_0x6e8c('0x56')]};_0x4940f8[_0x6e8c('0x21')](_0xb7d7d0);}}_0x300312({'count':_0x4940f8['length'],'rows':_0x4940f8});});},'MailQueues':function(){return new Promise(function(_0x171325){var _0x486e4b=[];for(var _0x1d7d17 in _0x365c5d[_0x6e8c('0x57')]){if(_0x365c5d['mailQueues'][_0x6e8c('0x4b')](_0x1d7d17)){var _0x558a1e=_0x365c5d[_0x6e8c('0x57')][_0x1d7d17];var _0x176cd2={'id':_0x558a1e['id'],'available':_0x558a1e['available'],'loggedIn':_0x558a1e[_0x6e8c('0x54')],'name':_0x558a1e[_0x6e8c('0x55')],'paused':_0x558a1e[_0x6e8c('0x58')],'waiting':_0x558a1e[_0x6e8c('0x56')]};_0x486e4b[_0x6e8c('0x21')](_0x176cd2);}}_0x171325({'count':_0x486e4b['length'],'rows':_0x486e4b});});},'OpenchannelQueues':function(){return new Promise(function(_0x567aa6){var _0x139ed4=[];for(var _0x2c0e9d in _0x365c5d[_0x6e8c('0x59')]){if(_0x365c5d[_0x6e8c('0x59')][_0x6e8c('0x4b')](_0x2c0e9d)){var _0x1c8201=_0x365c5d[_0x6e8c('0x59')][_0x2c0e9d];var _0x1ebdb5={'id':_0x1c8201['id'],'available':_0x1c8201[_0x6e8c('0x53')],'loggedIn':_0x1c8201[_0x6e8c('0x54')],'name':_0x1c8201[_0x6e8c('0x55')],'paused':_0x1c8201[_0x6e8c('0x58')],'waiting':_0x1c8201['waiting']};_0x139ed4[_0x6e8c('0x21')](_0x1ebdb5);}}_0x567aa6({'count':_0x139ed4[_0x6e8c('0x19')],'rows':_0x139ed4});});},'SmsQueues':function(){return new Promise(function(_0x10392e){var _0x29a921=[];for(var _0x33ede3 in _0x365c5d[_0x6e8c('0x5a')]){if(_0x365c5d[_0x6e8c('0x5a')][_0x6e8c('0x4b')](_0x33ede3)){var _0x64b8af=_0x365c5d[_0x6e8c('0x5a')][_0x33ede3];var _0x3b23d7={'id':_0x64b8af['id'],'available':_0x64b8af[_0x6e8c('0x53')],'loggedIn':_0x64b8af['loggedIn'],'name':_0x64b8af[_0x6e8c('0x55')],'paused':_0x64b8af[_0x6e8c('0x58')],'waiting':_0x64b8af[_0x6e8c('0x56')]};_0x29a921[_0x6e8c('0x21')](_0x3b23d7);}}_0x10392e({'count':_0x29a921['length'],'rows':_0x29a921});});},'FaxQueues':function(){return new Promise(function(_0x234dac){var _0x113b74=[];for(var _0x5406af in _0x365c5d[_0x6e8c('0x5b')]){if(_0x365c5d[_0x6e8c('0x5b')][_0x6e8c('0x4b')](_0x5406af)){var _0x575088=_0x365c5d[_0x6e8c('0x5b')][_0x5406af];var _0x31d882={'id':_0x575088['id'],'available':_0x575088[_0x6e8c('0x53')],'loggedIn':_0x575088[_0x6e8c('0x54')],'name':_0x575088[_0x6e8c('0x55')],'paused':_0x575088['paused'],'waiting':_0x575088[_0x6e8c('0x56')]};_0x113b74['push'](_0x31d882);}}_0x234dac({'count':_0x113b74[_0x6e8c('0x19')],'rows':_0x113b74});});},'WhatsappQueues':function(){return new Promise(function(_0x4281a){var _0x4f4290=[];for(var _0x1bf57d in _0x365c5d['whatsappQueues']){if(_0x365c5d[_0x6e8c('0x5c')][_0x6e8c('0x4b')](_0x1bf57d)){var _0x51a465=_0x365c5d[_0x6e8c('0x5c')][_0x1bf57d];var _0x1c6add={'id':_0x51a465['id'],'available':_0x51a465[_0x6e8c('0x53')],'loggedIn':_0x51a465[_0x6e8c('0x54')],'name':_0x51a465['name'],'paused':_0x51a465[_0x6e8c('0x58')],'waiting':_0x51a465['waiting']};_0x4f4290[_0x6e8c('0x21')](_0x1c6add);}}_0x4281a({'count':_0x4f4290[_0x6e8c('0x19')],'rows':_0x4f4290});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x3b976f){var _0x48b8c9=_[_0x6e8c('0x50')](_0x365c5d[_0x6e8c('0x5d')]);_0x3b976f({'count':_0x48b8c9[_0x6e8c('0x19')],'rows':_0x48b8c9});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x126bcd){var _0xee6eba=_[_0x6e8c('0x50')](_0x365c5d[_0x6e8c('0x5e')]);_0x126bcd({'count':_0xee6eba[_0x6e8c('0x19')],'rows':_0xee6eba});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x3fc0de){var _0x29df9c=_[_0x6e8c('0x50')](_0x365c5d['openchannelQueuesWaitingInteractions']);_0x3fc0de({'count':_0x29df9c[_0x6e8c('0x19')],'rows':_0x29df9c});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x5ad5dd){var _0x269a41=_[_0x6e8c('0x50')](_0x365c5d[_0x6e8c('0x5f')]);_0x5ad5dd({'count':_0x269a41[_0x6e8c('0x19')],'rows':_0x269a41});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x205710){var _0x1f3101=_[_0x6e8c('0x50')](_0x365c5d[_0x6e8c('0x60')]);_0x205710({'count':_0x1f3101[_0x6e8c('0x19')],'rows':_0x1f3101});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x72e0ab){var _0x1b6b46=_[_0x6e8c('0x50')](_0x365c5d['whatsappQueuesWaitingInteractions']);_0x72e0ab({'count':_0x1b6b46['length'],'rows':_0x1b6b46});});}};var _0x1347a2=jayson[_0x6e8c('0x61')](_0x3e7ad3)[_0x6e8c('0x62')]();_0x1347a2['on'](_0x6e8c('0x35'),function(_0x399618){logger[_0x6e8c('0x35')](JSON[_0x6e8c('0x3a')](_0x399618));return _0x29ed51(_0x399618);});_0x1347a2[_0x6e8c('0x63')](0x232c,_0x6e8c('0x64'),function(){console['log'](_0x6e8c('0x65'),0x232c);return _0x3903db(_0x6e8c('0x66')+0x232c);});});}; \ No newline at end of file +var _0x234c=['name','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','http','stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','./applications/utils','./applications/strategy/util','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','listen','rules','channel','interaction','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','push','slice','dialogflow','split','dialogflowv2','amazonlex','message','TagId','tvox','account','notificationTemplate','ChatWebsiteId','ContactId','body','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','Applications\x20executed','matchPath','complete','Skipped\x20routing\x20for\x20%s','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','emit','end','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','paused','waiting','mailQueues'];(function(_0x4e917c,_0x463a85){var _0x4e8db1=function(_0x3307d0){while(--_0x3307d0){_0x4e917c['push'](_0x4e917c['shift']());}};_0x4e8db1(++_0x463a85);}(_0x234c,0x7d));var _0xc234=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x234c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc234('0x0'));var util=require(_0xc234('0x1'));var path=require(_0xc234('0x2'));var fs=require('fs');var jayson=require(_0xc234('0x3'));var BPromise=require(_0xc234('0x4'));var utils=require(_0xc234('0x5'));var sUtils=require(_0xc234('0x6'));var logger=require(_0xc234('0x7'))(_0xc234('0x8'));var rpc={'openchannelQueueReport':require(_0xc234('0x9')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xc234('0xa')),'smsQueueReport':require(_0xc234('0xb')),'faxQueueReport':require(_0xc234('0xc')),'whatsappQueueReport':require(_0xc234('0xd'))};var RuleEngine=require(_0xc234('0xe'));function getId(_0x22f84a,_0x52dee3,_0x30ab3f){return util[_0xc234('0xf')](_0xc234('0x10'),_0x22f84a,_0x52dee3||0x0,_0x30ab3f||0x0);}function getIntervals(_0x116362,_0x509e4b){var _0x36cc26=[];if(!_[_0xc234('0x11')](_0x509e4b[_0xc234('0x12')])&&!_[_0xc234('0x11')](_0x116362[_0x509e4b[_0xc234('0x12')]])&&!_['isNil'](_0x116362[_0x509e4b[_0xc234('0x12')]][_0xc234('0x13')])){_0x36cc26=_['map'](_0x116362[_0x509e4b[_0xc234('0x12')]][_0xc234('0x13')],_0xc234('0x14'));}else if(!_[_0xc234('0x11')](_0x509e4b[_0xc234('0x14')])){_0x36cc26=[_0x509e4b[_0xc234('0x14')]];}return _0x36cc26;}exports[_0xc234('0x15')]=function(_0x1dd3d7){_0x1dd3d7[_0xc234('0x16')]={};return new BPromise(function(_0x15f78a,_0xa5b69d){var _0x1ebc47={'Start':function(_0x160e9b){var _0x25be7d=this;return new Promise(function(_0x227a92,_0x45f976){if(_0x160e9b){try{var _0x23d1bf=[];var _0x204221=getId(_0x160e9b[_0xc234('0x17')],_0x160e9b['message']?_0x160e9b['message']['id']:0x0,_0x160e9b[_0xc234('0x18')]?_0x160e9b[_0xc234('0x18')]['id']:0x0);var _0xcb623c=sUtils['checkWaitingNotifications'](_0x1dd3d7,_0x160e9b);if(!_0xcb623c&&_0x160e9b[_0xc234('0x19')]&&_['isArray'](_0x160e9b['applications'])&&_0x160e9b[_0xc234('0x19')]['length']){for(var _0x21e3f9=0x0;_0x21e3f9<_0x160e9b[_0xc234('0x19')][_0xc234('0x1a')];_0x21e3f9+=0x1){var _0x4b779a=_0x160e9b['applications'][_0x21e3f9];if(fs[_0xc234('0x1b')](path[_0xc234('0x1c')](__dirname,'applications',_0x4b779a[_0xc234('0x1d')]+_0xc234('0x1e')))){var _0x473b07=[];switch(_0x4b779a[_0xc234('0x1d')][_0xc234('0x1f')]()){case _0xc234('0x20'):var _0x5434b6=_0x4b779a[_0xc234('0x21')]['split'](',');if(_0x160e9b[_0xc234('0x17')]==='mail'){_0x473b07[_0xc234('0x22')](_0x5434b6[0x0]);_0x473b07[_0xc234('0x22')](_0x5434b6[0x1]);_0x473b07[_0xc234('0x22')](_0x5434b6[_0xc234('0x23')](0x2,_0x5434b6['length'])[_0xc234('0x1c')](','));}else{_0x473b07[_0xc234('0x22')](_0x5434b6[0x0]);_0x473b07[_0xc234('0x22')](_0x5434b6[_0xc234('0x23')](0x1,_0x5434b6[_0xc234('0x1a')])[_0xc234('0x1c')](','));}break;case _0xc234('0x24'):var _0x3a7342=_0x4b779a[_0xc234('0x21')][_0xc234('0x25')](',');_0x473b07[_0xc234('0x22')](_0x3a7342[0x0]);_0x473b07[_0xc234('0x22')](_0x3a7342[0x1]);_0x473b07['push'](_0x3a7342[_0xc234('0x23')](0x2,_0x3a7342[_0xc234('0x1a')])[_0xc234('0x1c')](','));break;case _0xc234('0x26'):var _0x3f582b=_0x4b779a['appdata']['split'](',');_0x473b07[_0xc234('0x22')](_0x3f582b[0x0]);_0x473b07['push'](_0x3f582b[0x1]);_0x473b07[_0xc234('0x22')](_0x3f582b[0x2]);_0x473b07[_0xc234('0x22')](_0x3f582b[0x3]);_0x473b07['push'](_0x3f582b[_0xc234('0x23')](0x4,_0x3f582b['length'])[_0xc234('0x1c')](','));break;case _0xc234('0x27'):var _0x18667e=_0x4b779a[_0xc234('0x21')][_0xc234('0x25')](',');_0x473b07['push'](_0x18667e[0x0]);_0x473b07[_0xc234('0x22')](_0x18667e[0x1]);_0x473b07[_0xc234('0x22')](_0x18667e[0x2]);_0x473b07[_0xc234('0x22')](_0x18667e[0x3]);_0x473b07[_0xc234('0x22')](_0x18667e[_0xc234('0x23')](0x4,_0x18667e['length'])[_0xc234('0x1c')](','));break;case _0xc234('0x28'):_0x473b07[_0xc234('0x22')](_0x4b779a['appdata']);break;case'tag':_0x473b07['push'](_0x4b779a[_0xc234('0x29')]);_0x473b07[_0xc234('0x22')](_0x4b779a['appdata']);break;case _0xc234('0x2a'):var _0x350fea=utils['getMustacheRender'](_0x160e9b[_0xc234('0x2b')][_0xc234('0x2c')],_0x160e9b);var _0x357973=_0x4b779a[_0xc234('0x21')][_0xc234('0x25')](',');_0x473b07[_0xc234('0x22')](_0x357973[0x0]);_0x473b07[_0xc234('0x22')](_0x357973[0x1]);_0x473b07[_0xc234('0x22')](_0x357973[0x2]);_0x473b07['push'](_0x357973[0x3]);_0x473b07[_0xc234('0x22')](_0x357973[0x4]);_0x473b07['push'](_0x357973[0x5]);_0x473b07[_0xc234('0x22')](_0x357973[0x6]);_0x473b07['push'](_0x357973[0x7]);_0x473b07[_0xc234('0x22')](_0x357973[0x8]);_0x473b07[_0xc234('0x22')](_0x357973[0x9]);_0x473b07[_0xc234('0x22')](_0x357973[0xa]);_0x473b07[_0xc234('0x22')](_0x160e9b[_0xc234('0x18')]['id']);_0x473b07[_0xc234('0x22')](_0x160e9b['message']['id']);_0x473b07[_0xc234('0x22')](_0x4b779a[_0xc234('0x2d')]);_0x473b07[_0xc234('0x22')](_0x160e9b['interaction'][_0xc234('0x2e')]);_0x473b07[_0xc234('0x22')](_0x160e9b[_0xc234('0x2f')][_0xc234('0x2f')]);_0x473b07[_0xc234('0x22')](_0x350fea);break;default:_0x473b07=_[_0xc234('0x11')](_0x4b779a['appdata'])?[]:_0x4b779a[_0xc234('0x21')][_0xc234('0x25')](',');}var _0x5ceb3b={'id':util[_0xc234('0xf')](_0xc234('0x30'),_0x204221,_0x4b779a['id'],_0x4b779a['app']),'condition':require(_0xc234('0x31'))[_0xc234('0x32')](_0x204221,getIntervals(_0x1dd3d7[_0xc234('0x33')],_0x4b779a),_0x1dd3d7),'consequence':require(_0xc234('0x34')+_0x4b779a[_0xc234('0x1d')])[_0xc234('0x35')](_0x204221,_0x473b07,_0x1dd3d7,_0x160e9b),'p':_0x4b779a[_0xc234('0x36')]||0x0};logger[_0xc234('0x37')](_0xc234('0x38'),_0x5ceb3b['id'],_0xc234('0x39'),getIntervals(_0x1dd3d7['intervals'],_0x4b779a)[_0xc234('0x1c')](_0xc234('0x3a')));_0x23d1bf[_0xc234('0x22')](_0x5ceb3b);}else{logger['error'](_0xc234('0x3b'),path[_0xc234('0x1c')](__dirname,_0xc234('0x19'),_0x4b779a['app']+_0xc234('0x1e')));}}_0x1dd3d7[_0xc234('0x16')][_0x204221]=new RuleEngine(_0x23d1bf);_0x1dd3d7[_0xc234('0x16')][_0x204221]['execute'](_0x160e9b,function(_0x3431c4){logger[_0xc234('0x37')](_0xc234('0x3c'),JSON['stringify'](_0x3431c4[_0xc234('0x3d')]));if(_0x1dd3d7[_0xc234('0x16')][_0x204221]){_0x1dd3d7['rules'][_0x204221]['emit'](_0xc234('0x3e'));}});return _0x227a92({'code':0xc8,'message':_0x160e9b});}else{if(_0xcb623c){logger[_0xc234('0x37')](util[_0xc234('0xf')](_0xc234('0x3f'),_0x204221));}else{logger[_0xc234('0x37')](_0xc234('0x40'));}return _0x227a92({'code':0xc8,'message':_0x160e9b});}}catch(_0x233a45){logger[_0xc234('0x41')](_0x233a45[_0xc234('0x42')]);return _0x45f976(_0x25be7d['error'](0x1f4,_0x233a45));}}return _0x45f976(_0xc234('0x43'));});},'AcceptMessage':function(_0x46d8e6){var _0x19124d=this;return new Promise(function(_0x2b2e9d,_0x4e2922){if(_0x46d8e6[_0xc234('0x44')]&&_0x46d8e6[_0xc234('0x44')]['id']){if(_0x1dd3d7[_0xc234('0x45')][_0x46d8e6[_0xc234('0x44')]['id']]){_0x1dd3d7['agents'][_0x46d8e6[_0xc234('0x44')]['id']][_0xc234('0x46')]=![];_0x1dd3d7[_0xc234('0x45')][_0x46d8e6['agent']['id']][_0xc234('0x47')]=undefined;}}if(_0x46d8e6[_0xc234('0x28')]&&_0x46d8e6[_0xc234('0x28')]['id']){try{var _0x496883=getId(_0x46d8e6[_0xc234('0x17')],_0x46d8e6[_0xc234('0x28')]?_0x46d8e6['message']['id']:0x0,_0x46d8e6['interaction']?_0x46d8e6[_0xc234('0x18')]['id']:0x0);if(_0x1dd3d7[_0xc234('0x16')][_0x496883]){_0x1dd3d7[_0xc234('0x16')][_0x496883][_0xc234('0x48')](_0xc234('0x49'));if(rpc[_0x46d8e6[_0xc234('0x17')]+'QueueReport']){rpc[_0x46d8e6[_0xc234('0x17')]+_0xc234('0x4a')][_0xc234('0x4b')](_0x496883,{'UserId':_0x46d8e6[_0xc234('0x28')]['UserId']})[_0xc234('0x4c')](function(){logger['error'](_0xc234('0x4d'));});}}return _0x2b2e9d({'code':0xc8,'message':_0x46d8e6});}catch(_0x5b6cc2){logger['error'](_0x5b6cc2['stack']);return _0x4e2922(_0x19124d[_0xc234('0x41')](0x1f4,_0x5b6cc2));}}logger[_0xc234('0x41')]('message\x20is\x20empty');return _0x4e2922(_0x19124d[_0xc234('0x41')](0x1f4,_0xc234('0x4e')));});},'RejectMessage':function(_0x563f0b){var _0xbf6764=this;return new Promise(function(_0x4994a1,_0x397bce){if(_0x563f0b['agent']&&_0x563f0b['agent']['id']){try{if(_0x1dd3d7[_0xc234('0x45')][_0x563f0b[_0xc234('0x44')]['id']]){_0x1dd3d7[_0xc234('0x45')][_0x563f0b[_0xc234('0x44')]['id']][_0xc234('0x46')]=![];_0x1dd3d7[_0xc234('0x45')][_0x563f0b[_0xc234('0x44')]['id']]['busyQueue']=undefined;}return _0x4994a1({'code':0xc8,'message':_0x563f0b});}catch(_0xea4e9f){logger[_0xc234('0x41')](_0xea4e9f['stack']);return _0x397bce(_0xbf6764[_0xc234('0x41')](0x1f4,_0xea4e9f));}}logger['error'](_0xc234('0x4e'));return _0x397bce(_0xbf6764[_0xc234('0x41')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x5df3cf){var _0x5e9dc4=this;return new Promise(function(_0x4be1ee,_0x2e2b68){if(_0x5df3cf[_0xc234('0x17')]&&_0x5df3cf[_0xc234('0x18')]&&_0x5df3cf[_0xc234('0x18')]['id']){try{var _0x33845d=getId(_0x5df3cf[_0xc234('0x17')],_0x5df3cf[_0xc234('0x28')]?_0x5df3cf[_0xc234('0x28')]['id']:0x0,_0x5df3cf[_0xc234('0x18')]?_0x5df3cf['interaction']['id']:0x0);if(_0x1dd3d7[_0xc234('0x16')][_0x33845d]){_0x1dd3d7[_0xc234('0x16')][_0x33845d]['emit'](_0xc234('0x49'));}return _0x4be1ee({'code':0xc8,'message':_0x5df3cf});}catch(_0x509346){logger['error'](_0x509346[_0xc234('0x42')]);return _0x2e2b68(_0x5e9dc4[_0xc234('0x41')](0x1f4,_0x509346));}}logger[_0xc234('0x41')](_0xc234('0x4e'));return _0x2e2b68(_0x5e9dc4[_0xc234('0x41')](0x1f4,_0xc234('0x4e')));});},'AgentCapacity':function(_0x4a5d52){var _0x20e36b=this;return new Promise(function(_0x8a9641,_0x52eca9){if(_0x1dd3d7['agents'][_0xc234('0x4f')](_0x4a5d52['id'])){for(var _0x5873ff in _0x4a5d52[_0xc234('0x50')]){if(_0x4a5d52['capacity'][_0xc234('0x4f')](_0x5873ff)){if(_0x1dd3d7['agents'][_0x4a5d52['id']]['hasOwnProperty'](_0x5873ff+_0xc234('0x51'))){_0x1dd3d7[_0xc234('0x45')][_0x4a5d52['id']][_0x5873ff+_0xc234('0x51')]=parseInt(_0x4a5d52[_0xc234('0x50')][_0x5873ff],0xa);}}}_0x1dd3d7['agents'][_0x4a5d52['id']][_0xc234('0x52')]();return _0x8a9641({'code':0xc8,'message':_0x1dd3d7[_0xc234('0x45')][_0x4a5d52['id']]});}else{return _0x52eca9(_0x20e36b[_0xc234('0x41')](0x1f4,_0xc234('0x53')));}});},'Agents':function(_0x21f857){return new Promise(function(_0x4852bc){var _0x19ff82=_[_0xc234('0x54')](_0x1dd3d7[_0xc234('0x45')]);if(_0x21f857&&_0x21f857['id']){var _0x31f090=_['find'](_0x19ff82,function(_0x55cf21){return _0x55cf21['id']===_0x21f857['id'];});_0x4852bc(_0x31f090);}else{_0x4852bc({'count':_0x19ff82[_0xc234('0x1a')],'rows':_0x19ff82});}});},'ChatQueues':function(){return new Promise(function(_0x2fd15b){var _0x53c933=[];for(var _0x1d643c in _0x1dd3d7[_0xc234('0x55')]){if(_0x1dd3d7[_0xc234('0x55')]['hasOwnProperty'](_0x1d643c)){var _0x25e4db=_0x1dd3d7[_0xc234('0x55')][_0x1d643c];var _0x2adbce={'id':_0x25e4db['id'],'available':_0x25e4db[_0xc234('0x56')],'loggedIn':_0x25e4db[_0xc234('0x57')],'name':_0x25e4db['name'],'paused':_0x25e4db[_0xc234('0x58')],'waiting':_0x25e4db[_0xc234('0x59')]};_0x53c933[_0xc234('0x22')](_0x2adbce);}}_0x2fd15b({'count':_0x53c933[_0xc234('0x1a')],'rows':_0x53c933});});},'MailQueues':function(){return new Promise(function(_0x5c5dc9){var _0xa197cb=[];for(var _0x21b660 in _0x1dd3d7[_0xc234('0x5a')]){if(_0x1dd3d7[_0xc234('0x5a')][_0xc234('0x4f')](_0x21b660)){var _0x21cb24=_0x1dd3d7['mailQueues'][_0x21b660];var _0x4b1802={'id':_0x21cb24['id'],'available':_0x21cb24[_0xc234('0x56')],'loggedIn':_0x21cb24[_0xc234('0x57')],'name':_0x21cb24[_0xc234('0x5b')],'paused':_0x21cb24[_0xc234('0x58')],'waiting':_0x21cb24[_0xc234('0x59')]};_0xa197cb[_0xc234('0x22')](_0x4b1802);}}_0x5c5dc9({'count':_0xa197cb[_0xc234('0x1a')],'rows':_0xa197cb});});},'OpenchannelQueues':function(){return new Promise(function(_0x36ac7f){var _0x44d37d=[];for(var _0x4ae6d3 in _0x1dd3d7[_0xc234('0x5c')]){if(_0x1dd3d7[_0xc234('0x5c')][_0xc234('0x4f')](_0x4ae6d3)){var _0x1425f6=_0x1dd3d7[_0xc234('0x5c')][_0x4ae6d3];var _0x16070e={'id':_0x1425f6['id'],'available':_0x1425f6[_0xc234('0x56')],'loggedIn':_0x1425f6[_0xc234('0x57')],'name':_0x1425f6['name'],'paused':_0x1425f6[_0xc234('0x58')],'waiting':_0x1425f6[_0xc234('0x59')]};_0x44d37d[_0xc234('0x22')](_0x16070e);}}_0x36ac7f({'count':_0x44d37d[_0xc234('0x1a')],'rows':_0x44d37d});});},'SmsQueues':function(){return new Promise(function(_0x5dd31a){var _0x1ff943=[];for(var _0x5e604f in _0x1dd3d7[_0xc234('0x5d')]){if(_0x1dd3d7[_0xc234('0x5d')][_0xc234('0x4f')](_0x5e604f)){var _0x5c4752=_0x1dd3d7[_0xc234('0x5d')][_0x5e604f];var _0x580ead={'id':_0x5c4752['id'],'available':_0x5c4752[_0xc234('0x56')],'loggedIn':_0x5c4752[_0xc234('0x57')],'name':_0x5c4752[_0xc234('0x5b')],'paused':_0x5c4752[_0xc234('0x58')],'waiting':_0x5c4752[_0xc234('0x59')]};_0x1ff943[_0xc234('0x22')](_0x580ead);}}_0x5dd31a({'count':_0x1ff943['length'],'rows':_0x1ff943});});},'FaxQueues':function(){return new Promise(function(_0x70494e){var _0x377c4b=[];for(var _0x50d494 in _0x1dd3d7['faxQueues']){if(_0x1dd3d7[_0xc234('0x5e')][_0xc234('0x4f')](_0x50d494)){var _0x56cb36=_0x1dd3d7['faxQueues'][_0x50d494];var _0x38d748={'id':_0x56cb36['id'],'available':_0x56cb36[_0xc234('0x56')],'loggedIn':_0x56cb36[_0xc234('0x57')],'name':_0x56cb36[_0xc234('0x5b')],'paused':_0x56cb36['paused'],'waiting':_0x56cb36[_0xc234('0x59')]};_0x377c4b['push'](_0x38d748);}}_0x70494e({'count':_0x377c4b[_0xc234('0x1a')],'rows':_0x377c4b});});},'WhatsappQueues':function(){return new Promise(function(_0x1cd83f){var _0xec998f=[];for(var _0x54aef6 in _0x1dd3d7[_0xc234('0x5f')]){if(_0x1dd3d7[_0xc234('0x5f')][_0xc234('0x4f')](_0x54aef6)){var _0x205b78=_0x1dd3d7[_0xc234('0x5f')][_0x54aef6];var _0x30675f={'id':_0x205b78['id'],'available':_0x205b78[_0xc234('0x56')],'loggedIn':_0x205b78[_0xc234('0x57')],'name':_0x205b78['name'],'paused':_0x205b78[_0xc234('0x58')],'waiting':_0x205b78[_0xc234('0x59')]};_0xec998f[_0xc234('0x22')](_0x30675f);}}_0x1cd83f({'count':_0xec998f[_0xc234('0x1a')],'rows':_0xec998f});});},'ChatQueuesWaitingInteractions':function(){return new Promise(function(_0x2b8f67){var _0x23ce69=_[_0xc234('0x54')](_0x1dd3d7[_0xc234('0x60')]);_0x2b8f67({'count':_0x23ce69[_0xc234('0x1a')],'rows':_0x23ce69});});},'MailQueuesWaitingInteractions':function(){return new Promise(function(_0x561dc7){var _0x2c6576=_[_0xc234('0x54')](_0x1dd3d7[_0xc234('0x61')]);_0x561dc7({'count':_0x2c6576[_0xc234('0x1a')],'rows':_0x2c6576});});},'OpenchannelQueuesWaitingInteractions':function(){return new Promise(function(_0x2b0b44){var _0x408e9a=_[_0xc234('0x54')](_0x1dd3d7[_0xc234('0x62')]);_0x2b0b44({'count':_0x408e9a['length'],'rows':_0x408e9a});});},'SmsQueuesWaitingInteractions':function(){return new Promise(function(_0x32d59a){var _0x5af069=_[_0xc234('0x54')](_0x1dd3d7[_0xc234('0x63')]);_0x32d59a({'count':_0x5af069[_0xc234('0x1a')],'rows':_0x5af069});});},'FaxQueuesWaitingInteractions':function(){return new Promise(function(_0x3a580a){var _0x2558bb=_[_0xc234('0x54')](_0x1dd3d7['faxQueuesWaitingInteractions']);_0x3a580a({'count':_0x2558bb['length'],'rows':_0x2558bb});});},'WhatsappQueuesWaitingInteractions':function(){return new Promise(function(_0x17956e){var _0x20e3db=_[_0xc234('0x54')](_0x1dd3d7[_0xc234('0x64')]);_0x17956e({'count':_0x20e3db[_0xc234('0x1a')],'rows':_0x20e3db});});}};var _0x197ebb=jayson[_0xc234('0x65')](_0x1ebc47)[_0xc234('0x66')]();_0x197ebb['on'](_0xc234('0x41'),function(_0x2b00be){logger['error'](JSON[_0xc234('0x67')](_0x2b00be));return _0xa5b69d(_0x2b00be);});_0x197ebb[_0xc234('0x15')](0x232c,_0xc234('0x68'),function(){console[_0xc234('0x69')](_0xc234('0x6a'),0x232c);return _0x15f78a(_0xc234('0x6b')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 60f688b..cb25396 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 _0xb049=['format','iftime\x20%s','then','indexOf','some','[%s][INTERVAL]\x20%s\x20%s','join','when','log','\x20|\x20','stack','util','bluebird','jayson/promise','lodash','../../../config/logger','routing','client','http','request','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command'];(function(_0x2ee4c8,_0x316127){var _0x35e4a2=function(_0x594094){while(--_0x594094){_0x2ee4c8['push'](_0x2ee4c8['shift']());}};_0x35e4a2(++_0x316127);}(_0xb049,0x14b));var _0x9b04=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xb049[_0xa464c9];return _0x3d73c4;};'use strict';var util=require(_0x9b04('0x0'));var BPromise=require(_0x9b04('0x1'));var jayson=require(_0x9b04('0x2'));var _=require(_0x9b04('0x3'));var logger=require(_0x9b04('0x4'))(_0x9b04('0x5'));var client=jayson[_0x9b04('0x6')][_0x9b04('0x7')]({'port':0x232a});function request(_0x4fceb3,_0x5dddca){return new BPromise(function(_0x4d5136,_0x227669){return client[_0x9b04('0x8')](_0x4fceb3,_0x5dddca)['then'](function(_0x43834f){if(_0x43834f[_0x9b04('0x9')]){return _0x227669(_0x43834f[_0x9b04('0x9')][_0x9b04('0xa')]);}else{return _0x4d5136(_0x43834f[_0x9b04('0xb')]);}})[_0x9b04('0xc')](function(_0x4aece8){return _0x227669(_0x4aece8);});});}exports[_0x9b04('0xd')]=function(_0xcbeefe,_0x305811,_0x5ddfe0){return function(_0x4e816c){if(_0x5ddfe0[_0x9b04('0xe')]&&!_0x5ddfe0[_0x9b04('0xe')][_0xcbeefe]){logger[_0x9b04('0xf')](_0x9b04('0x10'),_0xcbeefe);return _0x4e816c[_0x9b04('0x11')]();}var _0x56837a=[];for(var _0x5d25c2=0x0;_0x5d25c2<_0x305811[_0x9b04('0x12')];_0x5d25c2+=0x1){_0x56837a[_0x9b04('0x13')](request(_0x9b04('0x14'),{'command':util[_0x9b04('0x15')](_0x9b04('0x16'),_0x305811[_0x5d25c2])})[_0x9b04('0x17')](function(_0x2ac874){return _0x2ac874&&_0x2ac874[_0x9b04('0xa')]&&_0x2ac874[_0x9b04('0xa')][_0x9b04('0x18')]('true')>=0x0?!![]:![];})[_0x9b04('0xc')](function(_0x546081){logger[_0x9b04('0x9')]('[%s][INTERVAL]\x20%s',_0xcbeefe,_0x305811[_0x5d25c2]);}));}BPromise['all'](_0x56837a)[_0x9b04('0x17')](function(_0x4598e2){var _0x497b6e=_[_0x9b04('0x19')](_0x4598e2);logger['info'](_0x9b04('0x1a'),_0xcbeefe,_0x305811[_0x9b04('0x1b')]('\x20|\x20'),_0x497b6e);_0x4e816c[_0x9b04('0x1c')](_0x497b6e);})[_0x9b04('0xc')](function(_0x243bc5){console[_0x9b04('0x1d')](_0x243bc5);logger[_0x9b04('0x9')]('[%s][INTERVAL]\x20%s\x20%s',_0xcbeefe,_0x305811[_0x9b04('0x1b')](_0x9b04('0x1e')),_0x243bc5[_0x9b04('0x1f')]);_0x4e816c[_0x9b04('0x11')]();});};}; \ No newline at end of file +var _0x6f9b=['rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','catch','[%s][INTERVAL]\x20%s','all','[%s][INTERVAL]\x20%s\x20%s','join','when','log','\x20|\x20','stack','bluebird','lodash','routing','client','request','then','error','message','result','condition'];(function(_0x11a903,_0xba2aeb){var _0x447dbb=function(_0x2868f2){while(--_0x2868f2){_0x11a903['push'](_0x11a903['shift']());}};_0x447dbb(++_0xba2aeb);}(_0x6f9b,0x16f));var _0xb6f9=function(_0xdf66d4,_0x8cca53){_0xdf66d4=_0xdf66d4-0x0;var _0x499c6d=_0x6f9b[_0xdf66d4];return _0x499c6d;};'use strict';var util=require('util');var BPromise=require(_0xb6f9('0x0'));var jayson=require('jayson/promise');var _=require(_0xb6f9('0x1'));var logger=require('../../../config/logger')(_0xb6f9('0x2'));var client=jayson[_0xb6f9('0x3')]['http']({'port':0x232a});function request(_0x3b0a1b,_0x51139c){return new BPromise(function(_0x101ff8,_0x1468d3){return client[_0xb6f9('0x4')](_0x3b0a1b,_0x51139c)[_0xb6f9('0x5')](function(_0x4dbb48){if(_0x4dbb48[_0xb6f9('0x6')]){return _0x1468d3(_0x4dbb48[_0xb6f9('0x6')][_0xb6f9('0x7')]);}else{return _0x101ff8(_0x4dbb48[_0xb6f9('0x8')]);}})['catch'](function(_0x216931){return _0x1468d3(_0x216931);});});}exports[_0xb6f9('0x9')]=function(_0x4e652a,_0x135adf,_0x474f7f){return function(_0x2f0d42){if(_0x474f7f[_0xb6f9('0xa')]&&!_0x474f7f['rules'][_0x4e652a]){logger[_0xb6f9('0xb')](_0xb6f9('0xc'),_0x4e652a);return _0x2f0d42[_0xb6f9('0xd')]();}var _0x5154c9=[];for(var _0x104788=0x0;_0x104788<_0x135adf[_0xb6f9('0xe')];_0x104788+=0x1){_0x5154c9[_0xb6f9('0xf')](request(_0xb6f9('0x10'),{'command':util[_0xb6f9('0x11')](_0xb6f9('0x12'),_0x135adf[_0x104788])})[_0xb6f9('0x5')](function(_0x207656){return _0x207656&&_0x207656[_0xb6f9('0x7')]&&_0x207656[_0xb6f9('0x7')][_0xb6f9('0x13')]('true')>=0x0?!![]:![];})[_0xb6f9('0x14')](function(_0x1b0d87){logger[_0xb6f9('0x6')](_0xb6f9('0x15'),_0x4e652a,_0x135adf[_0x104788]);}));}BPromise[_0xb6f9('0x16')](_0x5154c9)[_0xb6f9('0x5')](function(_0x3a0cf0){var _0x350bed=_['some'](_0x3a0cf0);logger[_0xb6f9('0xb')](_0xb6f9('0x17'),_0x4e652a,_0x135adf[_0xb6f9('0x18')]('\x20|\x20'),_0x350bed);_0x2f0d42[_0xb6f9('0x19')](_0x350bed);})[_0xb6f9('0x14')](function(_0x5a4779){console[_0xb6f9('0x1a')](_0x5a4779);logger[_0xb6f9('0x6')](_0xb6f9('0x17'),_0x4e652a,_0x135adf[_0xb6f9('0x18')](_0xb6f9('0x1b')),_0x5a4779[_0xb6f9('0x1c')]);_0x2f0d42[_0xb6f9('0xd')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 136d350..cb55c8a 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 _0x9aea=['[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','error','agentringnoanswer','isNil','debug','agentringnoanswerAt','timeout','reason','holdtime','ringtime','[%s][agents][agentringnoanswer]','forIn','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','talktime','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfertype','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transfer','origtransfererexten','transfereeuniqueid','clone','calleridname','agententerreason','transferexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','lodash','./utils','info','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','request','CreateVoiceAgentReport','destuniqueid','agentcalled','format'];(function(_0x384d13,_0x533f32){var _0x215bc3=function(_0xc9b08d){while(--_0xc9b08d){_0x384d13['push'](_0x384d13['shift']());}};_0x215bc3(++_0x533f32);}(_0x9aea,0xdd));var _0xa9ae=function(_0x2bca07,_0x1049b7){_0x2bca07=_0x2bca07-0x0;var _0x791d26=_0x9aea[_0x2bca07];return _0x791d26;};'use strict';var _=require(_0xa9ae('0x0'));var util=require('util');var utils=require(_0xa9ae('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x5e1d51,_0x2b5e0c){utils[_0xa9ae('0x2')](util['format'](_0xa9ae('0x3'),_0x5e1d51[_0xa9ae('0x4')],_0x5e1d51[_0xa9ae('0x5')],_0x5e1d51[_0xa9ae('0x6')],_0x5e1d51[_0xa9ae('0x7')],_0x5e1d51['interface'],_0x5e1d51[_0xa9ae('0x8')],_0x5e1d51[_0xa9ae('0x9')],_0x5e1d51[_0xa9ae('0xa')]));if(_0x5e1d51['queue']){utils[_0xa9ae('0xb')](_0x5e1d51[_0xa9ae('0x6')])[_0xa9ae('0xc')](function(_0x44cf1b){if(_0x44cf1b){_0x5e1d51[_0xa9ae('0xd')]=_0x44cf1b[_0xa9ae('0xd')];_0x5e1d51[_0xa9ae('0xe')]=_0x5e1d51[_0xa9ae('0xf')]?_0x44cf1b[_0xa9ae('0x10')]:![];_0x5e1d51['acwtime']=_0x5e1d51[_0xa9ae('0xe')]?_0x44cf1b['acwTimeout']:0x0;}utils[_0xa9ae('0x11')](_0xa9ae('0x12'),_0x5e1d51);});}else{utils[_0xa9ae('0x11')](_0xa9ae('0x12'),_0x5e1d51);}if(_0x2b5e0c){delete transfers[_0x5e1d51[_0xa9ae('0x4')]];}else{delete agents[_0x5e1d51[_0xa9ae('0x13')]];}}exports[_0xa9ae('0x14')]=function(_0x2b511a){try{utils['debug'](util[_0xa9ae('0x15')](_0xa9ae('0x16'),_0x2b511a[_0xa9ae('0x4')]),_0x2b511a);agents[_0x2b511a[_0xa9ae('0x13')]]=_0x2b511a;agents[_0x2b511a['destuniqueid']][_0xa9ae('0x17')]=utils[_0xa9ae('0x18')]();agents[_0x2b511a[_0xa9ae('0x13')]][_0xa9ae('0xa')]=_0xa9ae('0x19');agents[_0x2b511a[_0xa9ae('0x13')]]['connectedlinenum']=null;agents[_0x2b511a[_0xa9ae('0x13')]][_0xa9ae('0x1a')]=null;utils[_0xa9ae('0x2')](util['format']('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2b511a[_0xa9ae('0x4')],agents[_0x2b511a['destuniqueid']]['membername'],_0x2b511a[_0xa9ae('0x13')]));}catch(_0x3b8245){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')]('[%s][agents][agentcalled]',_0x2b511a[_0xa9ae('0x4')]),_0x3b8245);}};exports[_0xa9ae('0x1c')]=function(_0x39f133){try{if(!_[_0xa9ae('0x1d')](agents[_0x39f133[_0xa9ae('0x13')]])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')]('[%s][agents][agentringnoanswer]',_0x39f133[_0xa9ae('0x4')]),_0x39f133);utils['info'](util['format']('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x39f133['uniqueid'],agents[_0x39f133[_0xa9ae('0x13')]]['membername'],_0x39f133[_0xa9ae('0x13')]));agents[_0x39f133['destuniqueid']][_0xa9ae('0x1c')]=!![];agents[_0x39f133[_0xa9ae('0x13')]][_0xa9ae('0x1f')]=utils[_0xa9ae('0x18')]();agents[_0x39f133[_0xa9ae('0x13')]][_0xa9ae('0xa')]=_0xa9ae('0x20');agents[_0x39f133['destuniqueid']][_0xa9ae('0x21')]=_0xa9ae('0x20');agents[_0x39f133[_0xa9ae('0x13')]][_0xa9ae('0x22')]=_0x39f133[_0xa9ae('0x23')]?parseInt(_0x39f133[_0xa9ae('0x23')])/0x3e8:0x0;agents[_0x39f133[_0xa9ae('0x13')]]['talktime']=0x0;unanswered['push'](_0x39f133[_0xa9ae('0x13')]);}}catch(_0x3c324e){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x24'),_0x39f133['uniqueid']),_0x3c324e);}};exports['queuecallerabandon']=function(_0x1892b5){try{_[_0xa9ae('0x25')](agents,function(_0x372ec7,_0x3a48b7){if(_0x372ec7[_0xa9ae('0x4')]==_0x1892b5[_0xa9ae('0x4')]&&!_['includes'](unanswered,_0x372ec7['destuniqueid'])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x26'),_0x1892b5[_0xa9ae('0x4')]),_0x1892b5);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x27'),_0x1892b5[_0xa9ae('0x4')],_0x372ec7['membername'],_0x372ec7[_0xa9ae('0x13')]));_0x372ec7['agentringnoanswer']=!![];_0x372ec7[_0xa9ae('0x1f')]=utils[_0xa9ae('0x18')]();_0x372ec7[_0xa9ae('0xa')]='abandoned';_0x372ec7[_0xa9ae('0x21')]=_0xa9ae('0x28');_0x372ec7[_0xa9ae('0x22')]=_0x1892b5[_0xa9ae('0x22')];_0x372ec7[_0xa9ae('0x29')]=0x0;writeDB(_0x372ec7);}});}catch(_0x4cb3ae){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x26'),_0x1892b5['uniqueid']),_0x4cb3ae);}};exports['agentconnect']=function(_0x2155c8){try{if(agents[_0x2155c8[_0xa9ae('0x13')]]){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')]('[%s][agents][agentconnect]',_0x2155c8[_0xa9ae('0x4')]),_0x2155c8);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x2a'),_0x2155c8[_0xa9ae('0x4')],agents[_0x2155c8['destuniqueid']][_0xa9ae('0x7')],_0x2155c8['destuniqueid']));agents[_0x2155c8[_0xa9ae('0x13')]][_0xa9ae('0x2b')]=utils[_0xa9ae('0x18')]();agents[_0x2155c8['destuniqueid']][_0xa9ae('0x9')]=_0x2155c8[_0xa9ae('0x9')];agents[_0x2155c8[_0xa9ae('0x13')]]['connectedlinename']=_0x2155c8[_0xa9ae('0x1a')];agents[_0x2155c8[_0xa9ae('0x13')]]['holdtime']=_0x2155c8[_0xa9ae('0x23')];agents[_0x2155c8['destuniqueid']][_0xa9ae('0xa')]=_0xa9ae('0x2c');_['forIn'](agents,function(_0x37da9b,_0x15ce12){if(_0x37da9b[_0xa9ae('0x13')]!=_0x2155c8[_0xa9ae('0x13')]&&_0x37da9b[_0xa9ae('0x4')]==_0x2155c8[_0xa9ae('0x4')]){_0x37da9b['talktime']=0x0;_0x37da9b[_0xa9ae('0x22')]=_0x2155c8[_0xa9ae('0x23')];_0x37da9b['agentringnoanswer']=!![];_0x37da9b['agentringnoanswerAt']=utils[_0xa9ae('0x18')]();_0x37da9b[_0xa9ae('0xa')]=_0xa9ae('0x2d');_0x37da9b[_0xa9ae('0x21')]='answered_elsewhere';_0x37da9b[_0xa9ae('0x2e')]=_0x2155c8[_0xa9ae('0x13')];_0x37da9b[_0xa9ae('0x2f')]=_0x2155c8[_0xa9ae('0x7')];writeDB(_0x37da9b);}});}}catch(_0x23c91d){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')]('[%s][agents][agentconnect]',_0x2155c8[_0xa9ae('0x4')]),_0x23c91d);}};exports[_0xa9ae('0xf')]=function(_0x566cb0){try{if(!_[_0xa9ae('0x1d')](agents[_0x566cb0['destuniqueid']])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x30'),_0x566cb0[_0xa9ae('0x4')]),_0x566cb0);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x31'),_0x566cb0['uniqueid'],agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0x7')],_0x566cb0['destuniqueid']));agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0xf')]=!![];agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0x32')]=utils[_0xa9ae('0x18')]();agents[_0x566cb0[_0xa9ae('0x13')]]['talktime']=utils[_0xa9ae('0x33')](agents[_0x566cb0['destuniqueid']][_0xa9ae('0x32')],agents[_0x566cb0[_0xa9ae('0x13')]]['agentconnectAt']);agents[_0x566cb0['destuniqueid']][_0xa9ae('0x21')]=_0x566cb0[_0xa9ae('0x21')];agents[_0x566cb0[_0xa9ae('0x13')]][_0xa9ae('0xa')]=_0xa9ae('0x34');writeDB(agents[_0x566cb0[_0xa9ae('0x13')]]);}}catch(_0x2961e4){utils[_0xa9ae('0x1b')](util['format']('[%s][agents][agentcomplete]',_0x566cb0[_0xa9ae('0x4')]),_0x2961e4);}};exports[_0xa9ae('0x35')]=function(_0x4efe55){try{if(!_[_0xa9ae('0x1d')](agents[_0x4efe55[_0xa9ae('0x36')]])){utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x37'),_0x4efe55[_0xa9ae('0x4')]),_0x4efe55);utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x4efe55[_0xa9ae('0x4')],agents[_0x4efe55[_0xa9ae('0x36')]]['membername'],agents[_0x4efe55[_0xa9ae('0x36')]]['uniqueid']));agents[_0x4efe55['transfereruniqueid']]['transfer']=!![];agents[_0x4efe55[_0xa9ae('0x36')]][_0xa9ae('0x38')]='blind';agents[_0x4efe55['transfereruniqueid']]['transferexten']=_0x4efe55[_0xa9ae('0x39')];agents[_0x4efe55['transfereruniqueid']][_0xa9ae('0x3a')]=agents[_0x4efe55[_0xa9ae('0x36')]]['uniqueid'];}}catch(_0x1be415){utils['error'](util[_0xa9ae('0x15')](_0xa9ae('0x37'),_0x4efe55[_0xa9ae('0x4')]),_0x1be415);}};exports[_0xa9ae('0x3b')]=function(_0x371760){try{utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x3c'),_0x371760[_0xa9ae('0x3d')]),_0x371760);if(_0x371760[_0xa9ae('0x3d')]==_0x371760[_0xa9ae('0x3e')]){if(!_[_0xa9ae('0x1d')](agents[_0x371760['secondtransfereruniqueid']])){utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x3f'),_0x371760[_0xa9ae('0x3d')],agents[_0x371760[_0xa9ae('0x40')]]['membername']));agents[_0x371760['secondtransfereruniqueid']][_0xa9ae('0x41')]=!![];agents[_0x371760[_0xa9ae('0x40')]]['transfertype']='ATTENDED';agents[_0x371760[_0xa9ae('0x40')]]['transferexten']=_0x371760[_0xa9ae('0x42')];agents[_0x371760[_0xa9ae('0x40')]][_0xa9ae('0x3a')]=_0x371760['origtransfereruniqueid'];}if(_0x371760[_0xa9ae('0x43')]&&agents[_0x371760['transfereeuniqueid']]){agents[_0x371760[_0xa9ae('0x43')]]['agententerreason']=0x1;transfers[_0x371760[_0xa9ae('0x43')]]=_[_0xa9ae('0x44')](agents[_0x371760[_0xa9ae('0x43')]]);transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x8')]=agents[_0x371760[_0xa9ae('0x40')]]['calleridnum'];transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x45')]=agents[_0x371760[_0xa9ae('0x40')]][_0xa9ae('0x45')];transfers[_0x371760['transfereeuniqueid']][_0xa9ae('0x17')]=utils[_0xa9ae('0x18')]();transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x2b')]=utils[_0xa9ae('0x18')]();transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x22')]=0x0;transfers[_0x371760[_0xa9ae('0x43')]][_0xa9ae('0x46')]=0x2;}}else if(_0x371760[_0xa9ae('0x40')]==_0x371760['secondtransfererlinkedid']){if(!_[_0xa9ae('0x1d')](agents[_0x371760[_0xa9ae('0x3d')]])){utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x371760[_0xa9ae('0x3d')],agents[_0x371760[_0xa9ae('0x3d')]]['membername']));agents[_0x371760[_0xa9ae('0x3d')]][_0xa9ae('0x41')]=!![];agents[_0x371760[_0xa9ae('0x3d')]]['transfertype']='ATTENDED';agents[_0x371760[_0xa9ae('0x3d')]][_0xa9ae('0x47')]=_0x371760['secondtransfererexten'];agents[_0x371760['origtransfereruniqueid']][_0xa9ae('0x3a')]=_0x371760[_0xa9ae('0x40')];}if(_0x371760[_0xa9ae('0x48')]&&agents[_0x371760['transfertargetuniqueid']]){agents[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x46')]=0x1;transfers[_0x371760[_0xa9ae('0x48')]]=_[_0xa9ae('0x44')](agents[_0x371760[_0xa9ae('0x48')]]);transfers[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x8')]=agents[_0x371760[_0xa9ae('0x3d')]][_0xa9ae('0x8')];transfers[_0x371760[_0xa9ae('0x48')]]['calleridname']=agents[_0x371760['origtransfereruniqueid']][_0xa9ae('0x45')];transfers[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x17')]=utils['now']();transfers[_0x371760[_0xa9ae('0x48')]][_0xa9ae('0x2b')]=utils[_0xa9ae('0x18')]();transfers[_0x371760['transfertargetuniqueid']]['holdtime']=0x0;transfers[_0x371760[_0xa9ae('0x48')]]['agententerreason']=0x2;}}}catch(_0x14a720){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x3c'),_0x371760[_0xa9ae('0x3d')]),_0x14a720);}};exports[_0xa9ae('0x49')]=function(_0x1bf8e3){try{utils[_0xa9ae('0x1e')](util[_0xa9ae('0x15')](_0xa9ae('0x4a'),_0x1bf8e3['uniqueid']),_0x1bf8e3);if(agents[_0x1bf8e3[_0xa9ae('0x4')]]&&agents[_0x1bf8e3['uniqueid']][_0xa9ae('0x21')]===_0xa9ae('0x20')){if(_0x1bf8e3[_0xa9ae('0x4b')]==='21'){agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')]='rejected';agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0xa')]=_0xa9ae('0x4c');}utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1bf8e3[_0xa9ae('0x4')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x7')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')],agents[_0x1bf8e3['uniqueid']]['lastevent']));writeDB(agents[_0x1bf8e3[_0xa9ae('0x4')]]);var _0x2f4a73=unanswered[_0xa9ae('0x4d')](_0x1bf8e3[_0xa9ae('0x4')]);if(_0x2f4a73>-0x1){unanswered[_0xa9ae('0x4e')](_0x2f4a73,0x1);}}if(transfers[_0x1bf8e3['uniqueid']]){transfers[_0x1bf8e3['uniqueid']][_0xa9ae('0xf')]=!![];transfers[_0x1bf8e3[_0xa9ae('0x4')]]['agentcompleteAt']=utils['now']();transfers[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x29')]=utils[_0xa9ae('0x33')](transfers[_0x1bf8e3[_0xa9ae('0x4')]]['agentcompleteAt'],transfers[_0x1bf8e3['uniqueid']][_0xa9ae('0x2b')]);transfers[_0x1bf8e3['uniqueid']]['reason']='agent';transfers[_0x1bf8e3['uniqueid']][_0xa9ae('0xa')]=_0xa9ae('0x34');utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x1bf8e3[_0xa9ae('0x4')],transfers[_0x1bf8e3[_0xa9ae('0x4')]]['membername'],transfers[_0x1bf8e3[_0xa9ae('0x4')]]['reason'],transfers[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0xa')]));writeDB(transfers[_0x1bf8e3[_0xa9ae('0x4')]],!![]);}if(agents[_0x1bf8e3[_0xa9ae('0x4')]]&&agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x2b')]){agents[_0x1bf8e3['uniqueid']][_0xa9ae('0xf')]=!![];agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x32')]=utils[_0xa9ae('0x18')]();agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x29')]=utils[_0xa9ae('0x33')](agents[_0x1bf8e3[_0xa9ae('0x4')]]['agentcompleteAt'],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x2b')]);agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')]=agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x41')]?_0xa9ae('0x41'):_0xa9ae('0x4f');agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0xa')]=_0xa9ae('0x34');utils[_0xa9ae('0x2')](util[_0xa9ae('0x15')](_0xa9ae('0x50'),_0x1bf8e3[_0xa9ae('0x4')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x7')],agents[_0x1bf8e3[_0xa9ae('0x4')]][_0xa9ae('0x21')],agents[_0x1bf8e3['uniqueid']][_0xa9ae('0xa')]));writeDB(agents[_0x1bf8e3[_0xa9ae('0x4')]]);}}catch(_0x1f6465){utils[_0xa9ae('0x1b')](util[_0xa9ae('0x15')](_0xa9ae('0x4a'),_0x1bf8e3[_0xa9ae('0x4')]),_0x1f6465);}}; \ No newline at end of file +var _0xd64b=['[%s][agents][attendedtransfer]','origtransfereruniqueid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','ATTENDED','origtransfererexten','transferuniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','indexOf','splice','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','complete','lodash','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','calleridnum','connectedlinenum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','membername','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','timeout','ringtime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','abandoned','holdtime','agentconnect','[%s][agents][agentconnect]','connect','talktime','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','diffTime','agentcompleteAt','agentconnectAt','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','transfertype','blind','transferexten'];(function(_0x551ac3,_0x90ddc5){var _0x4fe50b=function(_0x36dae2){while(--_0x36dae2){_0x551ac3['push'](_0x551ac3['shift']());}};_0x4fe50b(++_0x90ddc5);}(_0xd64b,0xc1));var _0xbd64=function(_0x3fa4bd,_0x14a72d){_0x3fa4bd=_0x3fa4bd-0x0;var _0x358c95=_0xd64b[_0x3fa4bd];return _0x358c95;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var utils=require(_0xbd64('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x4bfb7c,_0x30b9b3){utils[_0xbd64('0x2')](util[_0xbd64('0x3')](_0xbd64('0x4'),_0x4bfb7c[_0xbd64('0x5')],_0x4bfb7c['channel'],_0x4bfb7c['queue'],_0x4bfb7c['membername'],_0x4bfb7c['interface'],_0x4bfb7c[_0xbd64('0x6')],_0x4bfb7c[_0xbd64('0x7')],_0x4bfb7c[_0xbd64('0x8')]));if(_0x4bfb7c[_0xbd64('0x9')]){utils[_0xbd64('0xa')](_0x4bfb7c[_0xbd64('0x9')])[_0xbd64('0xb')](function(_0x5d32b8){if(_0x5d32b8){_0x4bfb7c['type']=_0x5d32b8[_0xbd64('0xc')];_0x4bfb7c[_0xbd64('0xd')]=_0x4bfb7c[_0xbd64('0xe')]?_0x5d32b8['acw']:![];_0x4bfb7c[_0xbd64('0xf')]=_0x4bfb7c[_0xbd64('0xd')]?_0x5d32b8[_0xbd64('0x10')]:0x0;}utils[_0xbd64('0x11')]('CreateVoiceAgentReport',_0x4bfb7c);});}else{utils[_0xbd64('0x11')]('CreateVoiceAgentReport',_0x4bfb7c);}if(_0x30b9b3){delete transfers[_0x4bfb7c[_0xbd64('0x5')]];}else{delete agents[_0x4bfb7c[_0xbd64('0x12')]];}}exports[_0xbd64('0x13')]=function(_0x2183e2){try{utils[_0xbd64('0x14')](util[_0xbd64('0x3')](_0xbd64('0x15'),_0x2183e2[_0xbd64('0x5')]),_0x2183e2);agents[_0x2183e2[_0xbd64('0x12')]]=_0x2183e2;agents[_0x2183e2['destuniqueid']][_0xbd64('0x16')]=utils[_0xbd64('0x17')]();agents[_0x2183e2[_0xbd64('0x12')]][_0xbd64('0x8')]=_0xbd64('0x18');agents[_0x2183e2['destuniqueid']][_0xbd64('0x7')]=null;agents[_0x2183e2['destuniqueid']][_0xbd64('0x19')]=null;utils[_0xbd64('0x2')](util[_0xbd64('0x3')](_0xbd64('0x1a'),_0x2183e2[_0xbd64('0x5')],agents[_0x2183e2[_0xbd64('0x12')]][_0xbd64('0x1b')],_0x2183e2[_0xbd64('0x12')]));}catch(_0x5d3b00){utils[_0xbd64('0x1c')](util[_0xbd64('0x3')]('[%s][agents][agentcalled]',_0x2183e2['uniqueid']),_0x5d3b00);}};exports[_0xbd64('0x1d')]=function(_0x42b328){try{if(!_[_0xbd64('0x1e')](agents[_0x42b328[_0xbd64('0x12')]])){utils[_0xbd64('0x14')](util[_0xbd64('0x3')]('[%s][agents][agentringnoanswer]',_0x42b328['uniqueid']),_0x42b328);utils[_0xbd64('0x2')](util[_0xbd64('0x3')](_0xbd64('0x1f'),_0x42b328[_0xbd64('0x5')],agents[_0x42b328['destuniqueid']]['membername'],_0x42b328[_0xbd64('0x12')]));agents[_0x42b328['destuniqueid']][_0xbd64('0x1d')]=!![];agents[_0x42b328['destuniqueid']][_0xbd64('0x20')]=utils[_0xbd64('0x17')]();agents[_0x42b328[_0xbd64('0x12')]][_0xbd64('0x8')]='timeout';agents[_0x42b328[_0xbd64('0x12')]][_0xbd64('0x21')]=_0xbd64('0x22');agents[_0x42b328[_0xbd64('0x12')]]['holdtime']=_0x42b328['ringtime']?parseInt(_0x42b328[_0xbd64('0x23')])/0x3e8:0x0;agents[_0x42b328['destuniqueid']]['talktime']=0x0;unanswered[_0xbd64('0x24')](_0x42b328['destuniqueid']);}}catch(_0x3cf5b7){utils['error'](util[_0xbd64('0x3')]('[%s][agents][agentringnoanswer]',_0x42b328[_0xbd64('0x5')]),_0x3cf5b7);}};exports[_0xbd64('0x25')]=function(_0x3be63a){try{_[_0xbd64('0x26')](agents,function(_0x306f19,_0x207ffc){if(_0x306f19['uniqueid']==_0x3be63a[_0xbd64('0x5')]&&!_[_0xbd64('0x27')](unanswered,_0x306f19[_0xbd64('0x12')])){utils[_0xbd64('0x14')](util[_0xbd64('0x3')](_0xbd64('0x28'),_0x3be63a['uniqueid']),_0x3be63a);utils['info'](util[_0xbd64('0x3')]('[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned',_0x3be63a[_0xbd64('0x5')],_0x306f19[_0xbd64('0x1b')],_0x306f19['destuniqueid']));_0x306f19['agentringnoanswer']=!![];_0x306f19[_0xbd64('0x20')]=utils['now']();_0x306f19['lastevent']=_0xbd64('0x29');_0x306f19[_0xbd64('0x21')]=_0xbd64('0x29');_0x306f19['holdtime']=_0x3be63a[_0xbd64('0x2a')];_0x306f19['talktime']=0x0;writeDB(_0x306f19);}});}catch(_0x1fc9cf){utils[_0xbd64('0x1c')](util[_0xbd64('0x3')](_0xbd64('0x28'),_0x3be63a[_0xbd64('0x5')]),_0x1fc9cf);}};exports[_0xbd64('0x2b')]=function(_0x513339){try{if(agents[_0x513339['destuniqueid']]){utils[_0xbd64('0x14')](util[_0xbd64('0x3')](_0xbd64('0x2c'),_0x513339[_0xbd64('0x5')]),_0x513339);utils[_0xbd64('0x2')](util[_0xbd64('0x3')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x513339['uniqueid'],agents[_0x513339[_0xbd64('0x12')]][_0xbd64('0x1b')],_0x513339[_0xbd64('0x12')]));agents[_0x513339['destuniqueid']]['agentconnectAt']=utils[_0xbd64('0x17')]();agents[_0x513339['destuniqueid']][_0xbd64('0x7')]=_0x513339['connectedlinenum'];agents[_0x513339[_0xbd64('0x12')]][_0xbd64('0x19')]=_0x513339['connectedlinename'];agents[_0x513339[_0xbd64('0x12')]]['holdtime']=_0x513339['ringtime'];agents[_0x513339[_0xbd64('0x12')]][_0xbd64('0x8')]=_0xbd64('0x2d');_['forIn'](agents,function(_0x540e2a,_0x5d6bcf){if(_0x540e2a[_0xbd64('0x12')]!=_0x513339[_0xbd64('0x12')]&&_0x540e2a['uniqueid']==_0x513339[_0xbd64('0x5')]){_0x540e2a[_0xbd64('0x2e')]=0x0;_0x540e2a[_0xbd64('0x2a')]=_0x513339[_0xbd64('0x23')];_0x540e2a['agentringnoanswer']=!![];_0x540e2a['agentringnoanswerAt']=utils[_0xbd64('0x17')]();_0x540e2a['lastevent']='answered_elsewhere';_0x540e2a[_0xbd64('0x21')]=_0xbd64('0x2f');_0x540e2a[_0xbd64('0x30')]=_0x513339[_0xbd64('0x12')];_0x540e2a[_0xbd64('0x31')]=_0x513339[_0xbd64('0x1b')];writeDB(_0x540e2a);}});}}catch(_0x247775){utils[_0xbd64('0x1c')](util['format'](_0xbd64('0x2c'),_0x513339[_0xbd64('0x5')]),_0x247775);}};exports['agentcomplete']=function(_0x41b27a){try{if(!_[_0xbd64('0x1e')](agents[_0x41b27a[_0xbd64('0x12')]])){utils[_0xbd64('0x14')](util[_0xbd64('0x3')](_0xbd64('0x32'),_0x41b27a[_0xbd64('0x5')]),_0x41b27a);utils['info'](util[_0xbd64('0x3')]('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x41b27a[_0xbd64('0x5')],agents[_0x41b27a['destuniqueid']][_0xbd64('0x1b')],_0x41b27a[_0xbd64('0x12')]));agents[_0x41b27a[_0xbd64('0x12')]]['agentcomplete']=!![];agents[_0x41b27a[_0xbd64('0x12')]]['agentcompleteAt']=utils['now']();agents[_0x41b27a['destuniqueid']][_0xbd64('0x2e')]=utils[_0xbd64('0x33')](agents[_0x41b27a[_0xbd64('0x12')]][_0xbd64('0x34')],agents[_0x41b27a[_0xbd64('0x12')]][_0xbd64('0x35')]);agents[_0x41b27a[_0xbd64('0x12')]]['reason']=_0x41b27a[_0xbd64('0x21')];agents[_0x41b27a[_0xbd64('0x12')]][_0xbd64('0x8')]='complete';writeDB(agents[_0x41b27a[_0xbd64('0x12')]]);}}catch(_0x436f36){utils[_0xbd64('0x1c')](util[_0xbd64('0x3')](_0xbd64('0x32'),_0x41b27a['uniqueid']),_0x436f36);}};exports[_0xbd64('0x36')]=function(_0x1a9ec8){try{if(!_[_0xbd64('0x1e')](agents[_0x1a9ec8[_0xbd64('0x37')]])){utils['debug'](util['format'](_0xbd64('0x38'),_0x1a9ec8[_0xbd64('0x5')]),_0x1a9ec8);utils[_0xbd64('0x2')](util[_0xbd64('0x3')](_0xbd64('0x39'),_0x1a9ec8[_0xbd64('0x5')],agents[_0x1a9ec8[_0xbd64('0x37')]][_0xbd64('0x1b')],agents[_0x1a9ec8[_0xbd64('0x37')]][_0xbd64('0x5')]));agents[_0x1a9ec8[_0xbd64('0x37')]][_0xbd64('0x3a')]=!![];agents[_0x1a9ec8[_0xbd64('0x37')]][_0xbd64('0x3b')]=_0xbd64('0x3c');agents[_0x1a9ec8['transfereruniqueid']][_0xbd64('0x3d')]=_0x1a9ec8['extension'];agents[_0x1a9ec8['transfereruniqueid']]['transferuniqueid']=agents[_0x1a9ec8['transfereruniqueid']][_0xbd64('0x5')];}}catch(_0x2f56df){utils['error'](util[_0xbd64('0x3')](_0xbd64('0x38'),_0x1a9ec8[_0xbd64('0x5')]),_0x2f56df);}};exports['attendedtransfer']=function(_0x2c42fd){try{utils[_0xbd64('0x14')](util[_0xbd64('0x3')](_0xbd64('0x3e'),_0x2c42fd[_0xbd64('0x3f')]),_0x2c42fd);if(_0x2c42fd[_0xbd64('0x3f')]==_0x2c42fd['origtransfererlinkedid']){if(!_['isNil'](agents[_0x2c42fd['secondtransfereruniqueid']])){utils[_0xbd64('0x2')](util[_0xbd64('0x3')](_0xbd64('0x40'),_0x2c42fd[_0xbd64('0x3f')],agents[_0x2c42fd['secondtransfereruniqueid']][_0xbd64('0x1b')]));agents[_0x2c42fd[_0xbd64('0x41')]][_0xbd64('0x3a')]=!![];agents[_0x2c42fd[_0xbd64('0x41')]][_0xbd64('0x3b')]=_0xbd64('0x42');agents[_0x2c42fd['secondtransfereruniqueid']][_0xbd64('0x3d')]=_0x2c42fd[_0xbd64('0x43')];agents[_0x2c42fd[_0xbd64('0x41')]][_0xbd64('0x44')]=_0x2c42fd[_0xbd64('0x3f')];}if(_0x2c42fd[_0xbd64('0x45')]&&agents[_0x2c42fd[_0xbd64('0x45')]]){agents[_0x2c42fd[_0xbd64('0x45')]][_0xbd64('0x46')]=0x1;transfers[_0x2c42fd[_0xbd64('0x45')]]=_[_0xbd64('0x47')](agents[_0x2c42fd[_0xbd64('0x45')]]);transfers[_0x2c42fd['transfereeuniqueid']]['calleridnum']=agents[_0x2c42fd[_0xbd64('0x41')]][_0xbd64('0x6')];transfers[_0x2c42fd['transfereeuniqueid']]['calleridname']=agents[_0x2c42fd[_0xbd64('0x41')]][_0xbd64('0x48')];transfers[_0x2c42fd['transfereeuniqueid']][_0xbd64('0x16')]=utils[_0xbd64('0x17')]();transfers[_0x2c42fd[_0xbd64('0x45')]][_0xbd64('0x35')]=utils[_0xbd64('0x17')]();transfers[_0x2c42fd[_0xbd64('0x45')]][_0xbd64('0x2a')]=0x0;transfers[_0x2c42fd[_0xbd64('0x45')]][_0xbd64('0x46')]=0x2;}}else if(_0x2c42fd['secondtransfereruniqueid']==_0x2c42fd[_0xbd64('0x49')]){if(!_[_0xbd64('0x1e')](agents[_0x2c42fd[_0xbd64('0x3f')]])){utils['info'](util[_0xbd64('0x3')](_0xbd64('0x40'),_0x2c42fd['origtransfereruniqueid'],agents[_0x2c42fd[_0xbd64('0x3f')]][_0xbd64('0x1b')]));agents[_0x2c42fd[_0xbd64('0x3f')]][_0xbd64('0x3a')]=!![];agents[_0x2c42fd[_0xbd64('0x3f')]][_0xbd64('0x3b')]='ATTENDED';agents[_0x2c42fd[_0xbd64('0x3f')]][_0xbd64('0x3d')]=_0x2c42fd[_0xbd64('0x4a')];agents[_0x2c42fd[_0xbd64('0x3f')]]['transferuniqueid']=_0x2c42fd[_0xbd64('0x41')];}if(_0x2c42fd[_0xbd64('0x4b')]&&agents[_0x2c42fd['transfertargetuniqueid']]){agents[_0x2c42fd[_0xbd64('0x4b')]]['agententerreason']=0x1;transfers[_0x2c42fd[_0xbd64('0x4b')]]=_[_0xbd64('0x47')](agents[_0x2c42fd[_0xbd64('0x4b')]]);transfers[_0x2c42fd[_0xbd64('0x4b')]]['calleridnum']=agents[_0x2c42fd[_0xbd64('0x3f')]][_0xbd64('0x6')];transfers[_0x2c42fd[_0xbd64('0x4b')]][_0xbd64('0x48')]=agents[_0x2c42fd[_0xbd64('0x3f')]][_0xbd64('0x48')];transfers[_0x2c42fd['transfertargetuniqueid']]['agentcalledAt']=utils['now']();transfers[_0x2c42fd[_0xbd64('0x4b')]][_0xbd64('0x35')]=utils[_0xbd64('0x17')]();transfers[_0x2c42fd[_0xbd64('0x4b')]][_0xbd64('0x2a')]=0x0;transfers[_0x2c42fd[_0xbd64('0x4b')]]['agententerreason']=0x2;}}}catch(_0x30eddc){utils[_0xbd64('0x1c')](util[_0xbd64('0x3')](_0xbd64('0x3e'),_0x2c42fd[_0xbd64('0x3f')]),_0x30eddc);}};exports[_0xbd64('0x4c')]=function(_0x2f3516){try{utils[_0xbd64('0x14')](util[_0xbd64('0x3')](_0xbd64('0x4d'),_0x2f3516[_0xbd64('0x5')]),_0x2f3516);if(agents[_0x2f3516[_0xbd64('0x5')]]&&agents[_0x2f3516['uniqueid']]['reason']===_0xbd64('0x22')){if(_0x2f3516[_0xbd64('0x4e')]==='21'){agents[_0x2f3516[_0xbd64('0x5')]]['reason']=_0xbd64('0x4f');agents[_0x2f3516['uniqueid']][_0xbd64('0x8')]=_0xbd64('0x4f');}utils[_0xbd64('0x2')](util[_0xbd64('0x3')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x2f3516[_0xbd64('0x5')],agents[_0x2f3516['uniqueid']][_0xbd64('0x1b')],agents[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x21')],agents[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x8')]));writeDB(agents[_0x2f3516['uniqueid']]);var _0x43780f=unanswered[_0xbd64('0x50')](_0x2f3516['uniqueid']);if(_0x43780f>-0x1){unanswered[_0xbd64('0x51')](_0x43780f,0x1);}}if(transfers[_0x2f3516[_0xbd64('0x5')]]){transfers[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0xe')]=!![];transfers[_0x2f3516['uniqueid']][_0xbd64('0x34')]=utils['now']();transfers[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x2e')]=utils[_0xbd64('0x33')](transfers[_0x2f3516['uniqueid']]['agentcompleteAt'],transfers[_0x2f3516['uniqueid']]['agentconnectAt']);transfers[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x21')]=_0xbd64('0x52');transfers[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x8')]='complete';utils[_0xbd64('0x2')](util[_0xbd64('0x3')](_0xbd64('0x53'),_0x2f3516[_0xbd64('0x5')],transfers[_0x2f3516[_0xbd64('0x5')]]['membername'],transfers[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x21')],transfers[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x8')]));writeDB(transfers[_0x2f3516['uniqueid']],!![]);}if(agents[_0x2f3516['uniqueid']]&&agents[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x35')]){agents[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0xe')]=!![];agents[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x34')]=utils[_0xbd64('0x17')]();agents[_0x2f3516[_0xbd64('0x5')]]['talktime']=utils[_0xbd64('0x33')](agents[_0x2f3516['uniqueid']][_0xbd64('0x34')],agents[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x35')]);agents[_0x2f3516['uniqueid']][_0xbd64('0x21')]=agents[_0x2f3516['uniqueid']]['transfer']?_0xbd64('0x3a'):_0xbd64('0x52');agents[_0x2f3516[_0xbd64('0x5')]]['lastevent']=_0xbd64('0x54');utils[_0xbd64('0x2')](util[_0xbd64('0x3')](_0xbd64('0x53'),_0x2f3516['uniqueid'],agents[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x1b')],agents[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x21')],agents[_0x2f3516[_0xbd64('0x5')]][_0xbd64('0x8')]));writeDB(agents[_0x2f3516[_0xbd64('0x5')]]);}}catch(_0x439bbd){utils[_0xbd64('0x1c')](util[_0xbd64('0x3')](_0xbd64('0x4d'),_0x2f3516[_0xbd64('0x5')]),_0x439bbd);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 9f88d3d..4221b40 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 _0x6ff4=['varset','xmd-originatecalleridnum','source','value','variable','destination','\x22\x20<','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-callerid','xmcs-queue','xmd-queue','lastapplication','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','[%s][calls][varset]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','toLowerCase','cdr','substring','includes','hangup','noop','execif','gotoif','[%s][calls][newexten]','lodash','util','./utils','./transfers.controller','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','then','request','CreateVoiceCallReport','recording','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','error','newstate','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','duration','diffTime','endtime','starttime','billableseconds','[%s][calls][hangup]','attendedtransfer','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','localtwolinkedid','secondtransfererchannel','_attended','origtransfererchannel','userfield','[%s][calls][attendedtransfer]','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]'];(function(_0x16e5b3,_0x30d91d){var _0x4d6874=function(_0x2fffbe){while(--_0x2fffbe){_0x16e5b3['push'](_0x16e5b3['shift']());}};_0x4d6874(++_0x30d91d);}(_0x6ff4,0x90));var _0x46ff=function(_0x14b8ee,_0x26d31a){_0x14b8ee=_0x14b8ee-0x0;var _0x50ef2b=_0x6ff4[_0x14b8ee];return _0x50ef2b;};'use strict';var _=require(_0x46ff('0x0'));var util=require(_0x46ff('0x1'));var utils=require(_0x46ff('0x2'));var transfers=require(_0x46ff('0x3'));var dispositions=['NO\x20ANSWER',_0x46ff('0x4'),_0x46ff('0x4'),'NO\x20ANSWER',_0x46ff('0x5'),'NO\x20ANSWER',_0x46ff('0x6'),_0x46ff('0x7'),'FAILED',_0x46ff('0x4'),_0x46ff('0x4')];var channels={};function writeDB(_0x29c1aa){var _0x264ed0;if(transfers[_0x46ff('0x8')][_0x29c1aa[_0x46ff('0x9')]]){_0x264ed0=_0x29c1aa['uniqueid'];_0x29c1aa[_0x46ff('0x9')]=transfers[_0x46ff('0x8')][_0x29c1aa[_0x46ff('0x9')]]['transfereeuniqueid'];}utils[_0x46ff('0xa')](util[_0x46ff('0xb')](_0x46ff('0xc'),_0x29c1aa[_0x46ff('0x9')],_0x29c1aa[_0x46ff('0xd')],_0x29c1aa[_0x46ff('0xe')],_0x29c1aa[_0x46ff('0xf')],_0x29c1aa[_0x46ff('0x10')],_0x29c1aa[_0x46ff('0x11')],_0x29c1aa[_0x46ff('0x12')],_0x29c1aa[_0x46ff('0x13')]));if(_0x29c1aa[_0x46ff('0x14')]){utils[_0x46ff('0x15')](_0x29c1aa['accountcode'])[_0x46ff('0x16')](function(_0x11272b){if(_0x11272b){_0x29c1aa['UserId']=_0x11272b['id'];}utils[_0x46ff('0x17')]('CreateVoiceCallReport',_0x29c1aa);});}else{utils[_0x46ff('0x17')](_0x46ff('0x18'),_0x29c1aa);}if(channels[_0x29c1aa['uniqueid']]){delete channels[_0x29c1aa[_0x46ff('0x9')]];}else if(_0x264ed0&&channels[_0x264ed0]){if(!transfers[_0x46ff('0x8')][_0x264ed0][_0x46ff('0x19')])delete transfers[_0x46ff('0x8')][_0x264ed0];delete channels[_0x264ed0];}}exports['newchannel']=function(_0x38256d){try{utils[_0x46ff('0x1a')](util['format'](_0x46ff('0x1b'),_0x38256d[_0x46ff('0x9')]),_0x38256d);if(_0x38256d[_0x46ff('0x9')]==_0x38256d[_0x46ff('0x1c')]&&_0x38256d[_0x46ff('0xd')]!=_0x46ff('0x1d')){utils['info'](util[_0x46ff('0xb')](_0x46ff('0x1e'),_0x38256d[_0x46ff('0x9')],_0x38256d['context'],_0x38256d['exten']));channels[_0x38256d[_0x46ff('0x9')]]={'uniqueid':_0x38256d[_0x46ff('0x9')],'accountcode':_0x38256d[_0x46ff('0x14')],'source':_0x38256d[_0x46ff('0x11')],'destination':_0x38256d[_0x46ff('0x1f')],'destinationcontext':_0x38256d[_0x46ff('0x20')],'channel':_0x38256d[_0x46ff('0xd')],'starttime':utils[_0x46ff('0x21')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x46ff('0x22')};}}catch(_0x32ca54){utils[_0x46ff('0x23')](util[_0x46ff('0xb')](_0x46ff('0x1b'),_0x38256d[_0x46ff('0x9')]),_0x32ca54);}};exports[_0x46ff('0x24')]=function(_0x53f997){try{utils[_0x46ff('0x1a')](util[_0x46ff('0xb')](_0x46ff('0x25'),_0x53f997[_0x46ff('0x9')]),_0x53f997);if(!_[_0x46ff('0x26')](channels[_0x53f997['uniqueid']])&&_0x53f997[_0x46ff('0x27')]==0x6){utils['info'](util['format'](_0x46ff('0x28'),_0x53f997[_0x46ff('0x9')],_0x53f997[_0x46ff('0x20')],_0x53f997[_0x46ff('0xd')]));if(_[_0x46ff('0x26')](channels[_0x53f997[_0x46ff('0x9')]][_0x46ff('0x29')])){channels[_0x53f997[_0x46ff('0x9')]][_0x46ff('0x29')]=utils[_0x46ff('0x21')]();}}else if(!_[_0x46ff('0x26')](channels[_0x53f997[_0x46ff('0x1c')]])&&_0x53f997['channelstate']==0x6&&_0x53f997[_0x46ff('0x20')]!=_0x46ff('0x2a')){utils[_0x46ff('0xa')](util['format'](_0x46ff('0x2b'),_0x53f997['uniqueid'],_0x53f997[_0x46ff('0x1c')],_0x53f997[_0x46ff('0x20')],_0x53f997['channel']));channels[_0x53f997[_0x46ff('0x1c')]][_0x46ff('0x14')]=_0x53f997['accountcode'];channels[_0x53f997['linkedid']][_0x46ff('0x2c')]=_0x53f997[_0x46ff('0xd')];if(_[_0x46ff('0x26')](channels[_0x53f997['linkedid']][_0x46ff('0x2d')])){channels[_0x53f997[_0x46ff('0x1c')]][_0x46ff('0x2d')]=utils['now']();}channels[_0x53f997[_0x46ff('0x1c')]][_0x46ff('0x2e')]=dispositions[_[_0x46ff('0x2f')](_0x53f997[_0x46ff('0x27')])]||'ANSWERED';}}catch(_0x5534cb){utils[_0x46ff('0x23')](util[_0x46ff('0xb')](_0x46ff('0x25'),_0x53f997[_0x46ff('0x9')]),_0x5534cb);}};exports['hangup']=function(_0x3c26b6){try{if(!_[_0x46ff('0x26')](channels[_0x3c26b6[_0x46ff('0x9')]])){utils[_0x46ff('0x1a')](util[_0x46ff('0xb')]('[%s][calls][hangup]',_0x3c26b6[_0x46ff('0x9')]),_0x3c26b6);if(_[_0x46ff('0x26')](channels[_0x3c26b6[_0x46ff('0x9')]][_0x46ff('0x30')])){channels[_0x3c26b6[_0x46ff('0x9')]]['callerid']=_0x3c26b6[_0x46ff('0x31')]+'\x20<'+_0x3c26b6[_0x46ff('0x11')]+'>';}utils[_0x46ff('0xa')](util[_0x46ff('0xb')](_0x46ff('0x32'),_0x3c26b6[_0x46ff('0x9')],channels[_0x3c26b6[_0x46ff('0x9')]]['callerid'],_0x3c26b6['cause-txt']));channels[_0x3c26b6[_0x46ff('0x9')]]['endtime']=utils['now']();channels[_0x3c26b6[_0x46ff('0x9')]][_0x46ff('0x33')]=utils[_0x46ff('0x34')](channels[_0x3c26b6['uniqueid']][_0x46ff('0x35')],channels[_0x3c26b6[_0x46ff('0x9')]][_0x46ff('0x36')]);channels[_0x3c26b6[_0x46ff('0x9')]][_0x46ff('0x37')]=channels[_0x3c26b6[_0x46ff('0x9')]]['answertime']?utils[_0x46ff('0x34')](channels[_0x3c26b6[_0x46ff('0x9')]][_0x46ff('0x35')],channels[_0x3c26b6[_0x46ff('0x9')]]['answertime']):0x0;writeDB(channels[_0x3c26b6[_0x46ff('0x9')]]);}}catch(_0x527a11){utils[_0x46ff('0x23')](util[_0x46ff('0xb')](_0x46ff('0x38'),_0x3c26b6[_0x46ff('0x9')]),_0x527a11);}};exports[_0x46ff('0x39')]=function(_0x385450){try{if(!_[_0x46ff('0x26')](channels[_0x385450['localtwolinkedid']])){utils['debug'](util[_0x46ff('0xb')]('[%s][calls][attendedtransfer]',_0x385450[_0x46ff('0x3a')]),_0x385450);if(channels[_0x385450['localtwolinkedid']][_0x46ff('0xd')]==_0x385450[_0x46ff('0x3b')]){utils[_0x46ff('0xa')](util[_0x46ff('0xb')](_0x46ff('0x3c'),_0x385450[_0x46ff('0x3a')],_0x385450[_0x46ff('0x3d')],_0x385450[_0x46ff('0x3e')]));channels[_0x385450[_0x46ff('0x3d')]][_0x46ff('0x2c')]=_0x385450['secondtransfererchannel'];channels[_0x385450['localtwolinkedid']]['userfield']=_0x46ff('0x3f');}else if(channels[_0x385450[_0x46ff('0x3d')]][_0x46ff('0xd')]=_0x385450['transfertargetchannel']){utils[_0x46ff('0xa')](util[_0x46ff('0xb')](_0x46ff('0x3c'),_0x385450[_0x46ff('0x3a')],_0x385450[_0x46ff('0x3d')],_0x385450[_0x46ff('0x40')]));channels[_0x385450[_0x46ff('0x3d')]][_0x46ff('0x2c')]=_0x385450[_0x46ff('0x40')];channels[_0x385450[_0x46ff('0x3d')]][_0x46ff('0x41')]='_attended';}}}catch(_0x3d0334){utils['error'](util[_0x46ff('0xb')](_0x46ff('0x42'),_0x385450[_0x46ff('0x3a')]),_0x3d0334);}};exports['musiconholdstart']=function(_0x1b6118){try{if(!_[_0x46ff('0x26')](channels[_0x1b6118['uniqueid']])){utils[_0x46ff('0x1a')](util[_0x46ff('0xb')](_0x46ff('0x43'),_0x1b6118[_0x46ff('0x9')]),_0x1b6118);channels[_0x1b6118['uniqueid']][_0x46ff('0x44')]=utils[_0x46ff('0x21')]();utils['info'](util['format'](_0x46ff('0x45'),_0x1b6118['uniqueid'],channels[_0x1b6118[_0x46ff('0x9')]][_0x46ff('0x44')]));}}catch(_0x113890){utils[_0x46ff('0x23')](util[_0x46ff('0xb')]('[%s][calls][musiconholdstart]',_0x1b6118[_0x46ff('0x9')]),_0x113890);}};exports[_0x46ff('0x46')]=function(_0x27d62c){try{if(!_['isNil'](channels[_0x27d62c[_0x46ff('0x9')]])){utils[_0x46ff('0x1a')](util[_0x46ff('0xb')](_0x46ff('0x47'),_0x27d62c['uniqueid']),_0x27d62c);if(!_[_0x46ff('0x26')](channels[_0x27d62c[_0x46ff('0x9')]][_0x46ff('0x44')])){channels[_0x27d62c['uniqueid']]['mohtime']+=utils['diffTime'](utils[_0x46ff('0x21')](),channels[_0x27d62c[_0x46ff('0x9')]]['musiconholdstartAt']);utils[_0x46ff('0xa')](util[_0x46ff('0xb')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x27d62c[_0x46ff('0x9')],channels[_0x27d62c['uniqueid']]['mohtime']));delete channels[_0x27d62c[_0x46ff('0x9')]]['musiconholdstartAt'];}}}catch(_0x73c5d){utils['error'](util[_0x46ff('0xb')](_0x46ff('0x47'),_0x27d62c['uniqueid']),_0x73c5d);}};exports[_0x46ff('0x48')]=function(_0x35b87c){try{if(!_[_0x46ff('0x26')](channels[_0x35b87c['uniqueid']])){utils[_0x46ff('0x1a')](util[_0x46ff('0xb')]('[%s][calls][varset]',_0x35b87c[_0x46ff('0x9')]),_0x35b87c);if(!_[_0x46ff('0x26')](_0x35b87c['variable'][_0x46ff('0x49')])){utils[_0x46ff('0xa')](util[_0x46ff('0xb')]('[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s',_0x35b87c[_0x46ff('0x9')],_0x35b87c['value']));channels[_0x35b87c[_0x46ff('0x9')]][_0x46ff('0x4a')]=_0x35b87c[_0x46ff('0x4b')];}if(!_['isNil'](_0x35b87c[_0x46ff('0x4c')]['xmd-phone'])){utils[_0x46ff('0xa')](util[_0x46ff('0xb')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x35b87c[_0x46ff('0x9')],_0x35b87c[_0x46ff('0x4b')]));channels[_0x35b87c[_0x46ff('0x9')]][_0x46ff('0x4d')]=_0x35b87c[_0x46ff('0x4b')];channels[_0x35b87c[_0x46ff('0x9')]][_0x46ff('0x30')]='\x22'+_0x35b87c[_0x46ff('0x4b')]+_0x46ff('0x4e')+_0x35b87c[_0x46ff('0x4b')]+'>';}if(!_[_0x46ff('0x26')](_0x35b87c[_0x46ff('0x4c')][_0x46ff('0x4f')])||!_[_0x46ff('0x26')](_0x35b87c['variable']['xmd-callerid'])){utils[_0x46ff('0xa')](util[_0x46ff('0xb')](_0x46ff('0x50'),_0x35b87c['uniqueid'],!_[_0x46ff('0x26')](_0x35b87c['variable'][_0x46ff('0x4f')])?_0x46ff('0x4f'):_0x46ff('0x51'),_0x35b87c[_0x46ff('0x4b')]));channels[_0x35b87c['uniqueid']][_0x46ff('0x30')]=_0x35b87c['value'];}if(!_['isNil'](_0x35b87c[_0x46ff('0x4c')]['xmd-queue'])||!_[_0x46ff('0x26')](_0x35b87c['variable'][_0x46ff('0x52')])){utils[_0x46ff('0xa')](util[_0x46ff('0xb')](_0x46ff('0x50'),_0x35b87c[_0x46ff('0x9')],!_[_0x46ff('0x26')](_0x35b87c[_0x46ff('0x4c')][_0x46ff('0x53')])?'xmd-queue':_0x46ff('0x52'),_0x35b87c[_0x46ff('0x4b')]));channels[_0x35b87c[_0x46ff('0x9')]][_0x46ff('0x54')]='Queue';channels[_0x35b87c[_0x46ff('0x9')]][_0x46ff('0x55')]=_0x35b87c[_0x46ff('0x4b')];channels[_0x35b87c[_0x46ff('0x9')]][_0x46ff('0xe')]=!![];}if(!_['isNil'](_0x35b87c[_0x46ff('0x4c')][_0x46ff('0x56')])){utils['info'](util[_0x46ff('0xb')](_0x46ff('0x57'),_0x35b87c['uniqueid'],_0x35b87c['value']));channels[_0x35b87c[_0x46ff('0x9')]]['ContactId']=_0x35b87c['value'];}if(!_['isNil'](_0x35b87c['variable'][_0x46ff('0x58')])){utils['info'](util['format'](_0x46ff('0x59'),_0x35b87c['uniqueid'],_0x35b87c[_0x46ff('0x4b')]));channels[_0x35b87c['uniqueid']][_0x46ff('0x5a')]=_0x35b87c[_0x46ff('0x4b')];}if(!_[_0x46ff('0x26')](_0x35b87c[_0x46ff('0x4c')][_0x46ff('0x5b')])){utils['info'](util['format'](_0x46ff('0x5c'),_0x35b87c[_0x46ff('0x9')],_0x35b87c[_0x46ff('0x4b')]));channels[_0x35b87c[_0x46ff('0x9')]]['routeid']=_0x35b87c[_0x46ff('0x4b')];}if(!_[_0x46ff('0x26')](_0x35b87c[_0x46ff('0x4c')]['sipcallid'])){utils[_0x46ff('0xa')](util['format'](_0x46ff('0x5d'),_0x35b87c[_0x46ff('0x9')],_0x35b87c[_0x46ff('0x4b')]));channels[_0x35b87c[_0x46ff('0x9')]]['sipcallid']=_0x35b87c[_0x46ff('0x4b')];}}}catch(_0x1e02be){utils[_0x46ff('0x23')](util['format'](_0x46ff('0x5e'),_0x35b87c[_0x46ff('0x9')]),_0x1e02be);}};exports['newexten']=function(_0x21b5ff){try{if(!_[_0x46ff('0x26')](channels[_0x21b5ff['uniqueid']])){utils[_0x46ff('0x1a')](util[_0x46ff('0xb')]('[%s][calls][newexten]',_0x21b5ff[_0x46ff('0x9')]),_0x21b5ff);utils[_0x46ff('0xa')](util['format'](_0x46ff('0x5f'),_0x21b5ff['uniqueid'],_0x21b5ff['application'],_0x21b5ff[_0x46ff('0x60')]));if(_0x21b5ff[_0x46ff('0x61')]['toLowerCase']()==_0x46ff('0x62')&&_['startsWith'](_0x21b5ff[_0x46ff('0x60')][_0x46ff('0x63')](),_0x46ff('0x64'))){var _0x3ef221=_0x21b5ff['appdata']['split']('=');var _0x383b41=_0x3ef221[0x0][_0x46ff('0x65')](_0x3ef221[0x0]['lastIndexOf']('(')+0x1,_0x3ef221[0x0]['lastIndexOf'](')'));var _0x38667a=_0x3ef221[0x1];channels[_0x21b5ff[_0x46ff('0x9')]][_0x383b41]=_0x38667a;}if(!_[_0x46ff('0x66')]([_0x46ff('0x67'),_0x46ff('0x68'),_0x46ff('0x69'),_0x46ff('0x62'),_0x46ff('0x6a')],_0x21b5ff[_0x46ff('0x61')][_0x46ff('0x63')]())){channels[_0x21b5ff['uniqueid']][_0x46ff('0x54')]=_0x21b5ff[_0x46ff('0x61')];channels[_0x21b5ff[_0x46ff('0x9')]][_0x46ff('0x55')]=_0x21b5ff['appdata'];}}}catch(_0x5d8f29){utils['error'](util[_0x46ff('0xb')](_0x46ff('0x6b'),_0x21b5ff[_0x46ff('0x9')]),_0x5d8f29);}}; \ No newline at end of file +var _0x3457=['error','musiconholdstartAt','[%s][calls][musiconholdstart]','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][varset]','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','variable','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','[%s][calls][varset]\x20variable:%s\x20value:%s','lastapplication','Queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','toLowerCase','cdr','split','substring','lastIndexOf','includes','noop','execif','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','channel','queue','membername','calleridnum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','newchannel','[%s][calls][newchannel]','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','[%s][calls][newstate]','isNil','channelstate','systemanswertime','linkedid','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition','toNumber','ANSWERED','hangup','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','diffTime','endtime','starttime','billableseconds','attendedtransfer','localtwolinkedid','debug','[%s][calls][attendedtransfer]','origtransfereruniqueid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','destinationchannel'];(function(_0x25acd3,_0xb73a00){var _0x5c037f=function(_0x333cfe){while(--_0x333cfe){_0x25acd3['push'](_0x25acd3['shift']());}};_0x5c037f(++_0xb73a00);}(_0x3457,0x93));var _0x7345=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3457[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var transfers=require('./transfers.controller');var dispositions=[_0x7345('0x0'),_0x7345('0x1'),_0x7345('0x1'),_0x7345('0x0'),_0x7345('0x0'),_0x7345('0x0'),'ANSWERED',_0x7345('0x2'),'FAILED','FAILED','FAILED'];var channels={};function writeDB(_0x1bd5c1){var _0x4385b3;if(transfers[_0x7345('0x3')][_0x1bd5c1[_0x7345('0x4')]]){_0x4385b3=_0x1bd5c1[_0x7345('0x4')];_0x1bd5c1[_0x7345('0x4')]=transfers['blinds'][_0x1bd5c1[_0x7345('0x4')]][_0x7345('0x5')];}utils[_0x7345('0x6')](util[_0x7345('0x7')]('[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1bd5c1[_0x7345('0x4')],_0x1bd5c1[_0x7345('0x8')],_0x1bd5c1[_0x7345('0x9')],_0x1bd5c1[_0x7345('0xa')],_0x1bd5c1['interface'],_0x1bd5c1[_0x7345('0xb')],_0x1bd5c1['connectedlinenum'],_0x1bd5c1[_0x7345('0xc')]));if(_0x1bd5c1[_0x7345('0xd')]){utils[_0x7345('0xe')](_0x1bd5c1['accountcode'])[_0x7345('0xf')](function(_0x1257b5){if(_0x1257b5){_0x1bd5c1[_0x7345('0x10')]=_0x1257b5['id'];}utils[_0x7345('0x11')](_0x7345('0x12'),_0x1bd5c1);});}else{utils[_0x7345('0x11')]('CreateVoiceCallReport',_0x1bd5c1);}if(channels[_0x1bd5c1[_0x7345('0x4')]]){delete channels[_0x1bd5c1[_0x7345('0x4')]];}else if(_0x4385b3&&channels[_0x4385b3]){if(!transfers[_0x7345('0x3')][_0x4385b3][_0x7345('0x13')])delete transfers[_0x7345('0x3')][_0x4385b3];delete channels[_0x4385b3];}}exports[_0x7345('0x14')]=function(_0x778581){try{utils['debug'](util[_0x7345('0x7')](_0x7345('0x15'),_0x778581['uniqueid']),_0x778581);if(_0x778581[_0x7345('0x4')]==_0x778581['linkedid']&&_0x778581[_0x7345('0x8')]!=_0x7345('0x16')){utils[_0x7345('0x6')](util[_0x7345('0x7')](_0x7345('0x17'),_0x778581[_0x7345('0x4')],_0x778581['context'],_0x778581[_0x7345('0x18')]));channels[_0x778581[_0x7345('0x4')]]={'uniqueid':_0x778581[_0x7345('0x4')],'accountcode':_0x778581[_0x7345('0xd')],'source':_0x778581[_0x7345('0xb')],'destination':_0x778581['exten'],'destinationcontext':_0x778581[_0x7345('0x19')],'channel':_0x778581[_0x7345('0x8')],'starttime':utils[_0x7345('0x1a')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x7345('0x0'),'amaflags':'DOCUMENTATION'};}}catch(_0x58e1b1){utils['error'](util[_0x7345('0x7')](_0x7345('0x15'),_0x778581[_0x7345('0x4')]),_0x58e1b1);}};exports['newstate']=function(_0x4eddb3){try{utils['debug'](util['format'](_0x7345('0x1b'),_0x4eddb3[_0x7345('0x4')]),_0x4eddb3);if(!_[_0x7345('0x1c')](channels[_0x4eddb3[_0x7345('0x4')]])&&_0x4eddb3[_0x7345('0x1d')]==0x6){utils['info'](util['format']('[%s][calls][newstate]\x20context:%s\x20channel:%s',_0x4eddb3[_0x7345('0x4')],_0x4eddb3[_0x7345('0x19')],_0x4eddb3[_0x7345('0x8')]));if(_['isNil'](channels[_0x4eddb3[_0x7345('0x4')]][_0x7345('0x1e')])){channels[_0x4eddb3[_0x7345('0x4')]][_0x7345('0x1e')]=utils['now']();}}else if(!_[_0x7345('0x1c')](channels[_0x4eddb3[_0x7345('0x1f')]])&&_0x4eddb3[_0x7345('0x1d')]==0x6&&_0x4eddb3[_0x7345('0x19')]!=_0x7345('0x20')){utils[_0x7345('0x6')](util[_0x7345('0x7')](_0x7345('0x21'),_0x4eddb3[_0x7345('0x4')],_0x4eddb3[_0x7345('0x1f')],_0x4eddb3[_0x7345('0x19')],_0x4eddb3[_0x7345('0x8')]));channels[_0x4eddb3['linkedid']][_0x7345('0xd')]=_0x4eddb3[_0x7345('0xd')];channels[_0x4eddb3[_0x7345('0x1f')]]['destinationchannel']=_0x4eddb3[_0x7345('0x8')];if(_[_0x7345('0x1c')](channels[_0x4eddb3[_0x7345('0x1f')]][_0x7345('0x22')])){channels[_0x4eddb3[_0x7345('0x1f')]][_0x7345('0x22')]=utils[_0x7345('0x1a')]();}channels[_0x4eddb3['linkedid']][_0x7345('0x23')]=dispositions[_[_0x7345('0x24')](_0x4eddb3['channelstate'])]||_0x7345('0x25');}}catch(_0x7a5f29){utils['error'](util['format'](_0x7345('0x1b'),_0x4eddb3['uniqueid']),_0x7a5f29);}};exports[_0x7345('0x26')]=function(_0x16038f){try{if(!_[_0x7345('0x1c')](channels[_0x16038f[_0x7345('0x4')]])){utils['debug'](util[_0x7345('0x7')](_0x7345('0x27'),_0x16038f['uniqueid']),_0x16038f);if(_[_0x7345('0x1c')](channels[_0x16038f[_0x7345('0x4')]]['callerid'])){channels[_0x16038f['uniqueid']][_0x7345('0x28')]=_0x16038f[_0x7345('0x29')]+'\x20<'+_0x16038f[_0x7345('0xb')]+'>';}utils[_0x7345('0x6')](util[_0x7345('0x7')](_0x7345('0x2a'),_0x16038f['uniqueid'],channels[_0x16038f[_0x7345('0x4')]][_0x7345('0x28')],_0x16038f[_0x7345('0x2b')]));channels[_0x16038f[_0x7345('0x4')]]['endtime']=utils[_0x7345('0x1a')]();channels[_0x16038f[_0x7345('0x4')]]['duration']=utils[_0x7345('0x2c')](channels[_0x16038f[_0x7345('0x4')]][_0x7345('0x2d')],channels[_0x16038f[_0x7345('0x4')]][_0x7345('0x2e')]);channels[_0x16038f[_0x7345('0x4')]][_0x7345('0x2f')]=channels[_0x16038f[_0x7345('0x4')]]['answertime']?utils['diffTime'](channels[_0x16038f['uniqueid']][_0x7345('0x2d')],channels[_0x16038f[_0x7345('0x4')]][_0x7345('0x22')]):0x0;writeDB(channels[_0x16038f[_0x7345('0x4')]]);}}catch(_0xae10d){utils['error'](util[_0x7345('0x7')](_0x7345('0x27'),_0x16038f[_0x7345('0x4')]),_0xae10d);}};exports[_0x7345('0x30')]=function(_0x343dee){try{if(!_[_0x7345('0x1c')](channels[_0x343dee[_0x7345('0x31')]])){utils[_0x7345('0x32')](util[_0x7345('0x7')](_0x7345('0x33'),_0x343dee[_0x7345('0x34')]),_0x343dee);if(channels[_0x343dee['localtwolinkedid']]['channel']==_0x343dee[_0x7345('0x35')]){utils[_0x7345('0x6')](util[_0x7345('0x7')](_0x7345('0x36'),_0x343dee[_0x7345('0x34')],_0x343dee[_0x7345('0x31')],_0x343dee[_0x7345('0x37')]));channels[_0x343dee['localtwolinkedid']]['destinationchannel']=_0x343dee['secondtransfererchannel'];channels[_0x343dee[_0x7345('0x31')]][_0x7345('0x38')]=_0x7345('0x39');}else if(channels[_0x343dee[_0x7345('0x31')]]['channel']=_0x343dee[_0x7345('0x3a')]){utils[_0x7345('0x6')](util[_0x7345('0x7')](_0x7345('0x36'),_0x343dee['origtransfereruniqueid'],_0x343dee['localtwolinkedid'],_0x343dee[_0x7345('0x3b')]));channels[_0x343dee[_0x7345('0x31')]][_0x7345('0x3c')]=_0x343dee[_0x7345('0x3b')];channels[_0x343dee[_0x7345('0x31')]]['userfield']=_0x7345('0x39');}}}catch(_0x10f373){utils[_0x7345('0x3d')](util['format'](_0x7345('0x33'),_0x343dee['origtransfereruniqueid']),_0x10f373);}};exports['musiconholdstart']=function(_0x4eead1){try{if(!_[_0x7345('0x1c')](channels[_0x4eead1[_0x7345('0x4')]])){utils['debug'](util['format']('[%s][calls][musiconholdstart]',_0x4eead1['uniqueid']),_0x4eead1);channels[_0x4eead1[_0x7345('0x4')]][_0x7345('0x3e')]=utils[_0x7345('0x1a')]();utils[_0x7345('0x6')](util['format']('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x4eead1[_0x7345('0x4')],channels[_0x4eead1[_0x7345('0x4')]][_0x7345('0x3e')]));}}catch(_0x3bbed7){utils[_0x7345('0x3d')](util[_0x7345('0x7')](_0x7345('0x3f'),_0x4eead1[_0x7345('0x4')]),_0x3bbed7);}};exports[_0x7345('0x40')]=function(_0x5c2e85){try{if(!_[_0x7345('0x1c')](channels[_0x5c2e85[_0x7345('0x4')]])){utils[_0x7345('0x32')](util[_0x7345('0x7')](_0x7345('0x41'),_0x5c2e85[_0x7345('0x4')]),_0x5c2e85);if(!_[_0x7345('0x1c')](channels[_0x5c2e85[_0x7345('0x4')]]['musiconholdstartAt'])){channels[_0x5c2e85[_0x7345('0x4')]][_0x7345('0x42')]+=utils[_0x7345('0x2c')](utils['now'](),channels[_0x5c2e85['uniqueid']][_0x7345('0x3e')]);utils[_0x7345('0x6')](util[_0x7345('0x7')]('[%s][calls][musiconholdstop]\x20mohtime:%s',_0x5c2e85[_0x7345('0x4')],channels[_0x5c2e85[_0x7345('0x4')]][_0x7345('0x42')]));delete channels[_0x5c2e85[_0x7345('0x4')]][_0x7345('0x3e')];}}}catch(_0x2bd3cc){utils[_0x7345('0x3d')](util['format'](_0x7345('0x41'),_0x5c2e85[_0x7345('0x4')]),_0x2bd3cc);}};exports['varset']=function(_0x295a36){try{if(!_[_0x7345('0x1c')](channels[_0x295a36[_0x7345('0x4')]])){utils[_0x7345('0x32')](util[_0x7345('0x7')](_0x7345('0x43'),_0x295a36['uniqueid']),_0x295a36);if(!_['isNil'](_0x295a36['variable'][_0x7345('0x44')])){utils[_0x7345('0x6')](util[_0x7345('0x7')](_0x7345('0x45'),_0x295a36[_0x7345('0x4')],_0x295a36['value']));channels[_0x295a36['uniqueid']][_0x7345('0x46')]=_0x295a36[_0x7345('0x47')];}if(!_[_0x7345('0x1c')](_0x295a36[_0x7345('0x48')][_0x7345('0x49')])){utils[_0x7345('0x6')](util[_0x7345('0x7')](_0x7345('0x4a'),_0x295a36[_0x7345('0x4')],_0x295a36[_0x7345('0x47')]));channels[_0x295a36['uniqueid']]['destination']=_0x295a36[_0x7345('0x47')];channels[_0x295a36['uniqueid']]['callerid']='\x22'+_0x295a36[_0x7345('0x47')]+_0x7345('0x4b')+_0x295a36['value']+'>';}if(!_[_0x7345('0x1c')](_0x295a36['variable'][_0x7345('0x4c')])||!_[_0x7345('0x1c')](_0x295a36[_0x7345('0x48')][_0x7345('0x4d')])){utils[_0x7345('0x6')](util[_0x7345('0x7')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x295a36[_0x7345('0x4')],!_[_0x7345('0x1c')](_0x295a36[_0x7345('0x48')][_0x7345('0x4c')])?'xmd-callerid-preview':_0x7345('0x4d'),_0x295a36[_0x7345('0x47')]));channels[_0x295a36[_0x7345('0x4')]][_0x7345('0x28')]=_0x295a36[_0x7345('0x47')];}if(!_['isNil'](_0x295a36[_0x7345('0x48')][_0x7345('0x4e')])||!_[_0x7345('0x1c')](_0x295a36[_0x7345('0x48')][_0x7345('0x4f')])){utils[_0x7345('0x6')](util['format'](_0x7345('0x50'),_0x295a36[_0x7345('0x4')],!_['isNil'](_0x295a36[_0x7345('0x48')][_0x7345('0x4e')])?_0x7345('0x4e'):_0x7345('0x4f'),_0x295a36['value']));channels[_0x295a36['uniqueid']][_0x7345('0x51')]=_0x7345('0x52');channels[_0x295a36['uniqueid']][_0x7345('0x53')]=_0x295a36['value'];channels[_0x295a36['uniqueid']]['queue']=!![];}if(!_['isNil'](_0x295a36[_0x7345('0x48')][_0x7345('0x54')])){utils[_0x7345('0x6')](util[_0x7345('0x7')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x295a36['uniqueid'],_0x295a36[_0x7345('0x47')]));channels[_0x295a36[_0x7345('0x4')]]['ContactId']=_0x295a36['value'];}if(!_[_0x7345('0x1c')](_0x295a36['variable']['xmd-cdrtype'])){utils[_0x7345('0x6')](util[_0x7345('0x7')](_0x7345('0x55'),_0x295a36[_0x7345('0x4')],_0x295a36[_0x7345('0x47')]));channels[_0x295a36['uniqueid']][_0x7345('0x56')]=_0x295a36[_0x7345('0x47')];}if(!_[_0x7345('0x1c')](_0x295a36[_0x7345('0x48')][_0x7345('0x57')])){utils[_0x7345('0x6')](util['format']('[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s',_0x295a36['uniqueid'],_0x295a36['value']));channels[_0x295a36[_0x7345('0x4')]]['routeid']=_0x295a36[_0x7345('0x47')];}if(!_['isNil'](_0x295a36[_0x7345('0x48')][_0x7345('0x58')])){utils[_0x7345('0x6')](util['format'](_0x7345('0x59'),_0x295a36[_0x7345('0x4')],_0x295a36['value']));channels[_0x295a36['uniqueid']][_0x7345('0x58')]=_0x295a36[_0x7345('0x47')];}}}catch(_0x46c67b){utils[_0x7345('0x3d')](util['format'](_0x7345('0x43'),_0x295a36[_0x7345('0x4')]),_0x46c67b);}};exports[_0x7345('0x5a')]=function(_0x13d885){try{if(!_[_0x7345('0x1c')](channels[_0x13d885[_0x7345('0x4')]])){utils[_0x7345('0x32')](util[_0x7345('0x7')](_0x7345('0x5b'),_0x13d885[_0x7345('0x4')]),_0x13d885);utils[_0x7345('0x6')](util[_0x7345('0x7')](_0x7345('0x5c'),_0x13d885[_0x7345('0x4')],_0x13d885[_0x7345('0x5d')],_0x13d885[_0x7345('0x5e')]));if(_0x13d885[_0x7345('0x5d')]['toLowerCase']()==_0x7345('0x5f')&&_['startsWith'](_0x13d885[_0x7345('0x5e')][_0x7345('0x60')](),_0x7345('0x61'))){var _0x2f0c0=_0x13d885[_0x7345('0x5e')][_0x7345('0x62')]('=');var _0x8d2e09=_0x2f0c0[0x0][_0x7345('0x63')](_0x2f0c0[0x0][_0x7345('0x64')]('(')+0x1,_0x2f0c0[0x0][_0x7345('0x64')](')'));var _0x307bd9=_0x2f0c0[0x1];channels[_0x13d885[_0x7345('0x4')]][_0x8d2e09]=_0x307bd9;}if(!_[_0x7345('0x65')](['hangup',_0x7345('0x66'),_0x7345('0x67'),_0x7345('0x5f'),'gotoif'],_0x13d885['application']['toLowerCase']())){channels[_0x13d885[_0x7345('0x4')]][_0x7345('0x51')]=_0x13d885[_0x7345('0x5d')];channels[_0x13d885[_0x7345('0x4')]][_0x7345('0x53')]=_0x13d885[_0x7345('0x5e')];}}}catch(_0x4d60ef){utils[_0x7345('0x3d')](util[_0x7345('0x7')]('[%s][calls][newexten]',_0x13d885['uniqueid']),_0x4d60ef);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 1f67ba0..1a31c3e 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 _0x0c75=['[core]\x20shutdown','fullybooted','[core]\x20fullybooted','[core]\x20error','[core]\x20close','managerevent','connect','[core]\x20connected','shutdown','info'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0c75,0x6a));var _0x50c7=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0c75[_0x122ef9];return _0x42fba0;};'use strict';var utils=require('./utils');exports[_0x50c7('0x0')]=function(){utils['info'](_0x50c7('0x1'));};exports[_0x50c7('0x2')]=function(){utils[_0x50c7('0x3')](_0x50c7('0x4'));};exports[_0x50c7('0x5')]=function(){utils[_0x50c7('0x3')](_0x50c7('0x6'));};exports['error']=function(_0x4b982e){utils['error'](_0x50c7('0x7'),_0x4b982e);};exports['close']=function(){utils[_0x50c7('0x3')](_0x50c7('0x8'));};exports[_0x50c7('0x9')]=function(_0x53ef83){}; \ No newline at end of file +var _0x1d2b=['[core]\x20connected','shutdown','fullybooted','[core]\x20fullybooted','error','[core]\x20error','[core]\x20close','managerevent','./utils','connect','info'];(function(_0x494452,_0x5b9635){var _0x456e08=function(_0xf79cd4){while(--_0xf79cd4){_0x494452['push'](_0x494452['shift']());}};_0x456e08(++_0x5b9635);}(_0x1d2b,0x105));var _0xb1d2=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x1d2b[_0x40ac5e];return _0x2839d6;};'use strict';var utils=require(_0xb1d2('0x0'));exports[_0xb1d2('0x1')]=function(){utils[_0xb1d2('0x2')](_0xb1d2('0x3'));};exports[_0xb1d2('0x4')]=function(){utils['info']('[core]\x20shutdown');};exports[_0xb1d2('0x5')]=function(){utils[_0xb1d2('0x2')](_0xb1d2('0x6'));};exports[_0xb1d2('0x7')]=function(_0x3a824d){utils[_0xb1d2('0x7')](_0xb1d2('0x8'),_0x3a824d);};exports['close']=function(){utils['info'](_0xb1d2('0x9'));};exports[_0xb1d2('0xa')]=function(_0x1139cd){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index c222ab9..5717193 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 _0xb733=['startsWith','toLowerCase','cdr(routeid)','split','error','[%s][dials][newexten]','[%s][dials][varset]','isNil','variable','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','[%s][dials][dialbegin]','assign','starttime','now','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','lastevent','connect','hangup','[%s][dials][hangup]','calleridname','complete','duration','endtime','holdtime','diffTime','billableseconds','lodash','util','info','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','calleridnum','dialstatus','CreateVoiceDialReport','debug','format','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xb733,0x7a));var _0x3b73=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb733[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x3b73('0x0'));var util=require(_0x3b73('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x494cea){utils[_0x3b73('0x2')](util['format'](_0x3b73('0x3'),_0x494cea[_0x3b73('0x4')],_0x494cea['channel'],_0x494cea['dialstring'],_0x494cea[_0x3b73('0x5')],_0x494cea['connectedlinenum'],_0x494cea[_0x3b73('0x6')]));utils['request'](_0x3b73('0x7'),_0x494cea);delete dials[_0x494cea['uniqueid']];}exports['newexten']=function(_0x4ad3ae){try{utils[_0x3b73('0x8')](util['format']('[%s][dials][newexten]',_0x4ad3ae[_0x3b73('0x4')]),_0x4ad3ae);utils['info'](util[_0x3b73('0x9')](_0x3b73('0xa'),_0x4ad3ae[_0x3b73('0x4')],_0x4ad3ae[_0x3b73('0xb')],_0x4ad3ae[_0x3b73('0xc')]));if(_0x4ad3ae[_0x3b73('0xb')]['toLowerCase']()=='set'&&_[_0x3b73('0xd')](_0x4ad3ae[_0x3b73('0xc')][_0x3b73('0xe')](),_0x3b73('0xf'))){var _0x3bdf0a=_0x4ad3ae[_0x3b73('0xc')][_0x3b73('0x10')]('=');dials[_0x4ad3ae[_0x3b73('0x4')]]={'routeId':_0x3bdf0a[0x1]};}}catch(_0x37b46e){utils[_0x3b73('0x11')](util[_0x3b73('0x9')](_0x3b73('0x12'),_0x4ad3ae[_0x3b73('0x4')]),_0x37b46e);}};exports['varset']=function(_0xe59492){try{utils[_0x3b73('0x8')](util[_0x3b73('0x9')](_0x3b73('0x13'),_0xe59492[_0x3b73('0x4')]),_0xe59492);if(!_[_0x3b73('0x14')](_0xe59492[_0x3b73('0x15')]['outboundrouteid'])){utils['info'](util[_0x3b73('0x9')](_0x3b73('0x16'),_0xe59492[_0x3b73('0x4')],_0xe59492[_0x3b73('0x17')]));dials[_0xe59492['uniqueid']]={'routeId':_0xe59492[_0x3b73('0x17')]};}}catch(_0x3c087a){utils[_0x3b73('0x11')](util[_0x3b73('0x9')](_0x3b73('0x13'),_0xe59492[_0x3b73('0x4')]),_0x3c087a);}};exports['dialbegin']=function(_0x171bfe){try{if(!_[_0x3b73('0x14')](dials[_0x171bfe[_0x3b73('0x4')]])){utils[_0x3b73('0x8')](util[_0x3b73('0x9')](_0x3b73('0x18'),_0x171bfe['uniqueid']),_0x171bfe);dials[_0x171bfe['uniqueid']]=_[_0x3b73('0x19')](dials[_0x171bfe[_0x3b73('0x4')]],_0x171bfe);dials[_0x171bfe[_0x3b73('0x4')]][_0x3b73('0x1a')]=utils[_0x3b73('0x1b')]();dials[_0x171bfe[_0x3b73('0x4')]]['lastevent']=_0x3b73('0x1c');utils['info'](util['format'](_0x3b73('0x1d'),_0x171bfe[_0x3b73('0x4')],dials[_0x171bfe[_0x3b73('0x4')]][_0x3b73('0x1a')]));}}catch(_0x46b273){utils['error'](util[_0x3b73('0x9')](_0x3b73('0x18'),_0x171bfe[_0x3b73('0x4')]),_0x46b273);}};exports[_0x3b73('0x1e')]=function(_0x3bae1d){try{if(!_[_0x3b73('0x14')](dials[_0x3bae1d[_0x3b73('0x4')]])){utils[_0x3b73('0x8')](util[_0x3b73('0x9')](_0x3b73('0x1f'),_0x3bae1d[_0x3b73('0x4')]),_0x3bae1d);dials[_0x3bae1d[_0x3b73('0x4')]]['dialstatus']=_0x3bae1d['dialstatus'];if(_0x3bae1d[_0x3b73('0x6')]==_0x3b73('0x20')){dials[_0x3bae1d['uniqueid']]=_[_0x3b73('0x19')](dials[_0x3bae1d[_0x3b73('0x4')]],_0x3bae1d);dials[_0x3bae1d[_0x3b73('0x4')]][_0x3b73('0x21')]=utils[_0x3b73('0x1b')]();dials[_0x3bae1d[_0x3b73('0x4')]][_0x3b73('0x22')]=_0x3b73('0x23');utils[_0x3b73('0x2')](util[_0x3b73('0x9')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x3bae1d[_0x3b73('0x4')],_0x3bae1d[_0x3b73('0x6')],dials[_0x3bae1d[_0x3b73('0x4')]][_0x3b73('0x21')]));}else{utils[_0x3b73('0x2')](util[_0x3b73('0x9')]('[%s][dials][dialend]\x20dialstatus:%s',_0x3bae1d[_0x3b73('0x4')],_0x3bae1d['dialstatus']));}}}catch(_0x1c5a6a){utils['error'](util[_0x3b73('0x9')](_0x3b73('0x1f'),_0x3bae1d[_0x3b73('0x4')]),_0x1c5a6a);}};exports[_0x3b73('0x24')]=function(_0x57854b){try{if(!_[_0x3b73('0x14')](dials[_0x57854b[_0x3b73('0x4')]])){utils[_0x3b73('0x8')](util['format'](_0x3b73('0x25'),_0x57854b[_0x3b73('0x4')]),_0x57854b);utils[_0x3b73('0x2')](util[_0x3b73('0x9')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x57854b[_0x3b73('0x4')],_0x57854b[_0x3b73('0x5')],_0x57854b[_0x3b73('0x26')],_0x57854b['cause-txt']));dials[_0x57854b[_0x3b73('0x4')]]=_[_0x3b73('0x19')](dials[_0x57854b[_0x3b73('0x4')]],{'endtime':utils[_0x3b73('0x1b')](),'lastevent':_0x3b73('0x27')});dials[_0x57854b['uniqueid']][_0x3b73('0x28')]=utils['diffTime'](dials[_0x57854b[_0x3b73('0x4')]][_0x3b73('0x29')],dials[_0x57854b[_0x3b73('0x4')]][_0x3b73('0x1a')]);dials[_0x57854b['uniqueid']][_0x3b73('0x2a')]=utils[_0x3b73('0x2b')](dials[_0x57854b[_0x3b73('0x4')]][_0x3b73('0x21')]||dials[_0x57854b[_0x3b73('0x4')]][_0x3b73('0x29')],dials[_0x57854b['uniqueid']][_0x3b73('0x1a')]);dials[_0x57854b[_0x3b73('0x4')]][_0x3b73('0x2c')]=dials[_0x57854b[_0x3b73('0x4')]][_0x3b73('0x21')]?utils['diffTime'](dials[_0x57854b['uniqueid']]['endtime'],dials[_0x57854b[_0x3b73('0x4')]]['answertime']):0x0;writeDB(dials[_0x57854b['uniqueid']]);}}catch(_0x57a554){utils[_0x3b73('0x11')](util[_0x3b73('0x9')](_0x3b73('0x25'),_0x57854b[_0x3b73('0x4')]),_0x57a554);}}; \ No newline at end of file +var _0x013c=['[%s][dials][newexten]','appdata','application','toLowerCase','set','startsWith','cdr(routeid)','split','error','varset','isNil','variable','outboundrouteid','value','[%s][dials][varset]','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','connect','hangup','[%s][dials][hangup]','cause-txt','complete','duration','diffTime','endtime','answertime','lodash','util','info','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','newexten','debug'];(function(_0x8eb69,_0x5d5ef1){var _0x37ed44=function(_0x4c311f){while(--_0x4c311f){_0x8eb69['push'](_0x8eb69['shift']());}};_0x37ed44(++_0x5d5ef1);}(_0x013c,0x173));var _0xc013=function(_0x5bd4f6,_0xf4e45c){_0x5bd4f6=_0x5bd4f6-0x0;var _0x33a165=_0x013c[_0x5bd4f6];return _0x33a165;};'use strict';var _=require(_0xc013('0x0'));var util=require(_0xc013('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x15e3c1){utils[_0xc013('0x2')](util[_0xc013('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x15e3c1[_0xc013('0x4')],_0x15e3c1[_0xc013('0x5')],_0x15e3c1[_0xc013('0x6')],_0x15e3c1[_0xc013('0x7')],_0x15e3c1[_0xc013('0x8')],_0x15e3c1[_0xc013('0x9')]));utils[_0xc013('0xa')]('CreateVoiceDialReport',_0x15e3c1);delete dials[_0x15e3c1[_0xc013('0x4')]];}exports[_0xc013('0xb')]=function(_0x51c2d7){try{utils[_0xc013('0xc')](util[_0xc013('0x3')](_0xc013('0xd'),_0x51c2d7[_0xc013('0x4')]),_0x51c2d7);utils[_0xc013('0x2')](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x51c2d7[_0xc013('0x4')],_0x51c2d7['application'],_0x51c2d7[_0xc013('0xe')]));if(_0x51c2d7[_0xc013('0xf')][_0xc013('0x10')]()==_0xc013('0x11')&&_[_0xc013('0x12')](_0x51c2d7[_0xc013('0xe')]['toLowerCase'](),_0xc013('0x13'))){var _0xad59f8=_0x51c2d7[_0xc013('0xe')][_0xc013('0x14')]('=');dials[_0x51c2d7['uniqueid']]={'routeId':_0xad59f8[0x1]};}}catch(_0x540bc1){utils[_0xc013('0x15')](util[_0xc013('0x3')](_0xc013('0xd'),_0x51c2d7[_0xc013('0x4')]),_0x540bc1);}};exports[_0xc013('0x16')]=function(_0x2f02de){try{utils[_0xc013('0xc')](util[_0xc013('0x3')]('[%s][dials][varset]',_0x2f02de[_0xc013('0x4')]),_0x2f02de);if(!_[_0xc013('0x17')](_0x2f02de[_0xc013('0x18')][_0xc013('0x19')])){utils['info'](util[_0xc013('0x3')]('[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s',_0x2f02de['uniqueid'],_0x2f02de[_0xc013('0x1a')]));dials[_0x2f02de[_0xc013('0x4')]]={'routeId':_0x2f02de['value']};}}catch(_0x54509c){utils[_0xc013('0x15')](util[_0xc013('0x3')](_0xc013('0x1b'),_0x2f02de[_0xc013('0x4')]),_0x54509c);}};exports[_0xc013('0x1c')]=function(_0x5da47f){try{if(!_[_0xc013('0x17')](dials[_0x5da47f[_0xc013('0x4')]])){utils[_0xc013('0xc')](util['format'](_0xc013('0x1d'),_0x5da47f['uniqueid']),_0x5da47f);dials[_0x5da47f['uniqueid']]=_[_0xc013('0x1e')](dials[_0x5da47f[_0xc013('0x4')]],_0x5da47f);dials[_0x5da47f[_0xc013('0x4')]][_0xc013('0x1f')]=utils[_0xc013('0x20')]();dials[_0x5da47f[_0xc013('0x4')]][_0xc013('0x21')]=_0xc013('0x22');utils['info'](util['format'](_0xc013('0x23'),_0x5da47f[_0xc013('0x4')],dials[_0x5da47f[_0xc013('0x4')]][_0xc013('0x1f')]));}}catch(_0x31ad61){utils[_0xc013('0x15')](util[_0xc013('0x3')]('[%s][dials][dialbegin]',_0x5da47f['uniqueid']),_0x31ad61);}};exports[_0xc013('0x24')]=function(_0x40a404){try{if(!_[_0xc013('0x17')](dials[_0x40a404[_0xc013('0x4')]])){utils[_0xc013('0xc')](util[_0xc013('0x3')](_0xc013('0x25'),_0x40a404[_0xc013('0x4')]),_0x40a404);dials[_0x40a404['uniqueid']][_0xc013('0x9')]=_0x40a404[_0xc013('0x9')];if(_0x40a404[_0xc013('0x9')]==_0xc013('0x26')){dials[_0x40a404[_0xc013('0x4')]]=_[_0xc013('0x1e')](dials[_0x40a404[_0xc013('0x4')]],_0x40a404);dials[_0x40a404[_0xc013('0x4')]]['answertime']=utils[_0xc013('0x20')]();dials[_0x40a404[_0xc013('0x4')]][_0xc013('0x21')]=_0xc013('0x27');utils[_0xc013('0x2')](util[_0xc013('0x3')]('[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect',_0x40a404[_0xc013('0x4')],_0x40a404[_0xc013('0x9')],dials[_0x40a404[_0xc013('0x4')]]['answertime']));}else{utils[_0xc013('0x2')](util['format']('[%s][dials][dialend]\x20dialstatus:%s',_0x40a404[_0xc013('0x4')],_0x40a404[_0xc013('0x9')]));}}}catch(_0x5d5130){utils[_0xc013('0x15')](util[_0xc013('0x3')]('[%s][dials][dialend]',_0x40a404[_0xc013('0x4')]),_0x5d5130);}};exports[_0xc013('0x28')]=function(_0x4788a4){try{if(!_[_0xc013('0x17')](dials[_0x4788a4[_0xc013('0x4')]])){utils[_0xc013('0xc')](util[_0xc013('0x3')](_0xc013('0x29'),_0x4788a4['uniqueid']),_0x4788a4);utils['info'](util[_0xc013('0x3')]('[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s',_0x4788a4['uniqueid'],_0x4788a4['calleridnum'],_0x4788a4['calleridname'],_0x4788a4[_0xc013('0x2a')]));dials[_0x4788a4[_0xc013('0x4')]]=_['assign'](dials[_0x4788a4[_0xc013('0x4')]],{'endtime':utils[_0xc013('0x20')](),'lastevent':_0xc013('0x2b')});dials[_0x4788a4[_0xc013('0x4')]][_0xc013('0x2c')]=utils[_0xc013('0x2d')](dials[_0x4788a4[_0xc013('0x4')]][_0xc013('0x2e')],dials[_0x4788a4[_0xc013('0x4')]][_0xc013('0x1f')]);dials[_0x4788a4[_0xc013('0x4')]]['holdtime']=utils['diffTime'](dials[_0x4788a4[_0xc013('0x4')]][_0xc013('0x2f')]||dials[_0x4788a4['uniqueid']][_0xc013('0x2e')],dials[_0x4788a4[_0xc013('0x4')]][_0xc013('0x1f')]);dials[_0x4788a4[_0xc013('0x4')]]['billableseconds']=dials[_0x4788a4[_0xc013('0x4')]][_0xc013('0x2f')]?utils[_0xc013('0x2d')](dials[_0x4788a4['uniqueid']]['endtime'],dials[_0x4788a4[_0xc013('0x4')]][_0xc013('0x2f')]):0x0;writeDB(dials[_0x4788a4[_0xc013('0x4')]]);}}catch(_0x151728){utils[_0xc013('0x15')](util[_0xc013('0x3')]('[%s][dials][hangup]',_0x4788a4['uniqueid']),_0x151728);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index b2d0702..db55ab5 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 _0x5e98=['[%s][index][agentcomplete]','agentcomplete','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','[%s][index][queuecallerleave]','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','[%s][index][hangup]','hangup','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','[%s][index][newchannel]','newchannel','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','./utils','util','xdr','disabled','env','production','local','asterisk','port','username','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','error','close','managerevent','format','[%s][index][devicestatechange]','device','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]'];(function(_0x32bce8,_0x54f965){var _0x38badc=function(_0x1ed1ee){while(--_0x1ed1ee){_0x32bce8['push'](_0x32bce8['shift']());}};_0x38badc(++_0x54f965);}(_0x5e98,0x185));var _0x85e9=function(_0x44436e,_0x44d29c){_0x44436e=_0x44436e-0x0;var _0x2488e9=_0x5e98[_0x44436e];return _0x2488e9;};var AsteriskManager=require('asterisk-manager');var config=require('../../config/environment');var utils=require(_0x85e9('0x0'));var util=require(_0x85e9('0x1'));var isXDREnabled=config[_0x85e9('0x2')]&&config[_0x85e9('0x2')]['disabled']?!config[_0x85e9('0x2')][_0x85e9('0x3')]:!![];var isProduction=config[_0x85e9('0x4')]===_0x85e9('0x5')||![];var isLocalAsterisk=config[_0x85e9('0x2')]&&config[_0x85e9('0x2')][_0x85e9('0x6')]===!![]||![];var ami=new AsteriskManager(config[_0x85e9('0x7')][_0x85e9('0x8')],config[_0x85e9('0x7')]['ip'],config[_0x85e9('0x7')][_0x85e9('0x9')],config[_0x85e9('0x7')]['password'],!![]);ami['keepConnected']();if(!isXDREnabled){utils[_0x85e9('0xa')](_0x85e9('0xb'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x85e9('0xa')](_0x85e9('0xc'));}else{var agents=require(_0x85e9('0xd'));var calls=require(_0x85e9('0xe'));var queues=require(_0x85e9('0xf'));var recordings=require(_0x85e9('0x10'));var members=require(_0x85e9('0x11'));var dials=require(_0x85e9('0x12'));var transfers=require(_0x85e9('0x13'));var core=require(_0x85e9('0x14'));ami['on'](_0x85e9('0x15'),core[_0x85e9('0x15')]);ami['on'](_0x85e9('0x16'),core[_0x85e9('0x16')]);ami['on']('fullybooted',core['fullybooted']);ami['on'](_0x85e9('0x17'),core[_0x85e9('0x17')]);ami['on'](_0x85e9('0x18'),core[_0x85e9('0x18')]);ami['on'](_0x85e9('0x19'),core['managerevent']);ami['on']('devicestatechange',function(_0x406eca){try{utils['debug'](util[_0x85e9('0x1a')](_0x85e9('0x1b'),_0x406eca[_0x85e9('0x1c')]),_0x406eca);members['devicestatechange'](_0x406eca);}catch(_0x3b74dd){utils[_0x85e9('0x17')](util[_0x85e9('0x1a')](_0x85e9('0x1b'),_0x406eca[_0x85e9('0x1c')]),_0x3b74dd);}});ami['on'](_0x85e9('0x1d'),function(_0x24fc3f){try{utils[_0x85e9('0x1e')](util[_0x85e9('0x1a')](_0x85e9('0x1f'),_0x24fc3f[_0x85e9('0x20')]),_0x24fc3f);agents[_0x85e9('0x1d')](_0x24fc3f);}catch(_0x31a2de){utils[_0x85e9('0x17')](util[_0x85e9('0x1a')]('[%s][index][agentcalled]',_0x24fc3f['uniqueid']),_0x31a2de);}});ami['on'](_0x85e9('0x21'),function(_0x25d554){try{utils[_0x85e9('0x1e')](util[_0x85e9('0x1a')](_0x85e9('0x22'),_0x25d554['uniqueid']),_0x25d554);agents[_0x85e9('0x21')](_0x25d554);}catch(_0x2b8f92){utils[_0x85e9('0x17')](util['format'](_0x85e9('0x22'),_0x25d554[_0x85e9('0x20')]),_0x2b8f92);}});ami['on'](_0x85e9('0x23'),function(_0x57243e){try{utils[_0x85e9('0x1e')](util[_0x85e9('0x1a')](_0x85e9('0x24'),_0x57243e['uniqueid']),_0x57243e);agents['agentconnect'](_0x57243e);queues['agentconnect'](_0x57243e);}catch(_0x353256){utils[_0x85e9('0x17')](util[_0x85e9('0x1a')](_0x85e9('0x24'),_0x57243e[_0x85e9('0x20')]),_0x353256);}});ami['on']('agentcomplete',function(_0x45ca6a){try{utils[_0x85e9('0x1e')](util[_0x85e9('0x1a')](_0x85e9('0x25'),_0x45ca6a[_0x85e9('0x20')]),_0x45ca6a);agents[_0x85e9('0x26')](_0x45ca6a);queues['agentcomplete'](_0x45ca6a);members['agentcomplete'](_0x45ca6a);}catch(_0x75c31d){utils['error'](util[_0x85e9('0x1a')]('[%s][index][agentcomplete]',_0x45ca6a[_0x85e9('0x20')]),_0x75c31d);}});ami['on'](_0x85e9('0x27'),function(_0x542ae1){try{utils[_0x85e9('0x1e')](util['format'](_0x85e9('0x28'),_0x542ae1['uniqueid']),_0x542ae1);agents[_0x85e9('0x27')](_0x542ae1);queues[_0x85e9('0x27')](_0x542ae1);}catch(_0x95a185){utils[_0x85e9('0x17')](util[_0x85e9('0x1a')](_0x85e9('0x28'),_0x542ae1[_0x85e9('0x20')]),_0x95a185);}});ami['on'](_0x85e9('0x29'),function(_0x4aa2aa){try{utils['debug'](util[_0x85e9('0x1a')](_0x85e9('0x2a'),_0x4aa2aa[_0x85e9('0x20')]),_0x4aa2aa);queues[_0x85e9('0x29')](_0x4aa2aa);recordings[_0x85e9('0x29')](_0x4aa2aa);}catch(_0x534f08){utils[_0x85e9('0x17')](util[_0x85e9('0x1a')](_0x85e9('0x2a'),_0x4aa2aa[_0x85e9('0x20')]),_0x534f08);}});ami['on']('queuecallerleave',function(_0x3b467d){try{utils['debug'](util[_0x85e9('0x1a')](_0x85e9('0x2b'),_0x3b467d[_0x85e9('0x20')]),_0x3b467d);queues[_0x85e9('0x2c')](_0x3b467d);}catch(_0x4549a6){utils[_0x85e9('0x17')](util[_0x85e9('0x1a')](_0x85e9('0x2b'),_0x3b467d[_0x85e9('0x20')]),_0x4549a6);}});ami['on'](_0x85e9('0x2d'),function(_0x50ea29){try{utils['debug'](util[_0x85e9('0x1a')](_0x85e9('0x2e'),_0x50ea29[_0x85e9('0x20')]),_0x50ea29);queues[_0x85e9('0x2d')](_0x50ea29);calls[_0x85e9('0x2d')](_0x50ea29);}catch(_0x56bcdf){utils[_0x85e9('0x17')](util[_0x85e9('0x1a')](_0x85e9('0x2e'),_0x50ea29[_0x85e9('0x20')]),_0x56bcdf);}});ami['on'](_0x85e9('0x2f'),function(_0x5c93b4){try{utils['debug'](util[_0x85e9('0x1a')](_0x85e9('0x30'),_0x5c93b4[_0x85e9('0x20')]),_0x5c93b4);queues[_0x85e9('0x2f')](_0x5c93b4);calls[_0x85e9('0x2f')](_0x5c93b4);}catch(_0x153fa8){utils[_0x85e9('0x17')](util[_0x85e9('0x1a')](_0x85e9('0x30'),_0x5c93b4[_0x85e9('0x20')]),_0x153fa8);}});ami['on']('newstate',function(_0x377352){try{utils['debug'](util[_0x85e9('0x1a')](_0x85e9('0x31'),_0x377352['uniqueid']),_0x377352);calls[_0x85e9('0x32')](_0x377352);recordings[_0x85e9('0x32')](_0x377352);}catch(_0x577e43){utils[_0x85e9('0x17')](util[_0x85e9('0x1a')]('[%s][index][newstate]',_0x377352['uniqueid']),_0x577e43);}});ami['on']('hangup',function(_0x12c00f){try{utils[_0x85e9('0x1e')](util[_0x85e9('0x1a')](_0x85e9('0x33'),_0x12c00f['uniqueid']),_0x12c00f);calls[_0x85e9('0x34')](_0x12c00f);recordings[_0x85e9('0x34')](_0x12c00f);dials[_0x85e9('0x34')](_0x12c00f);agents[_0x85e9('0x34')](_0x12c00f);queues[_0x85e9('0x34')](_0x12c00f);}catch(_0x4200f4){utils['error'](util[_0x85e9('0x1a')](_0x85e9('0x33'),_0x12c00f[_0x85e9('0x20')]),_0x4200f4);}});ami['on'](_0x85e9('0x35'),function(_0xda5c34){try{utils[_0x85e9('0x1e')](util[_0x85e9('0x1a')](_0x85e9('0x36'),_0xda5c34[_0x85e9('0x20')]),_0xda5c34);members[_0x85e9('0x35')](_0xda5c34);}catch(_0xc0de89){utils[_0x85e9('0x17')](util['format'](_0x85e9('0x36'),_0xda5c34[_0x85e9('0x20')]),_0xc0de89);}});ami['on'](_0x85e9('0x37'),function(_0x8ce7c9){try{utils[_0x85e9('0x1e')](util[_0x85e9('0x1a')]('[%s][index][blindtransfer]',_0x8ce7c9['uniqueid']),_0x8ce7c9);queues[_0x85e9('0x37')](_0x8ce7c9);agents[_0x85e9('0x37')](_0x8ce7c9);transfers['blindtransfer'](_0x8ce7c9);recordings[_0x85e9('0x37')](_0x8ce7c9);}catch(_0x3bfb54){utils['error'](util[_0x85e9('0x1a')](_0x85e9('0x38'),_0x8ce7c9[_0x85e9('0x20')]),_0x3bfb54);}});ami['on'](_0x85e9('0x39'),function(_0x43b810){try{utils[_0x85e9('0x1e')](util[_0x85e9('0x1a')](_0x85e9('0x3a'),_0x43b810[_0x85e9('0x3b')]),_0x43b810);queues['attendedtransfer'](_0x43b810);transfers['attendedtransfer'](_0x43b810);agents['attendedtransfer'](_0x43b810);calls[_0x85e9('0x39')](_0x43b810);}catch(_0x38c055){utils[_0x85e9('0x17')](util[_0x85e9('0x1a')]('[%s][index][attendedtransfer]',_0x43b810['origtransfereruniqueid']),_0x38c055);}});ami['on'](_0x85e9('0x3c'),function(_0x31060a){try{utils[_0x85e9('0x1e')](util['format']('[%s][index][varset]',_0x31060a[_0x85e9('0x20')]),_0x31060a);queues[_0x85e9('0x3c')](_0x31060a);recordings['varset'](_0x31060a);calls[_0x85e9('0x3c')](_0x31060a);dials[_0x85e9('0x3c')](_0x31060a);}catch(_0x1c71af){utils[_0x85e9('0x17')](util[_0x85e9('0x1a')](_0x85e9('0x3d'),_0x31060a[_0x85e9('0x20')]),_0x1c71af);}});ami['on'](_0x85e9('0x3e'),function(_0x5ea71c){try{utils[_0x85e9('0x1e')](util[_0x85e9('0x1a')](_0x85e9('0x3f'),_0x5ea71c[_0x85e9('0x20')]),_0x5ea71c);calls['newexten'](_0x5ea71c);recordings[_0x85e9('0x3e')](_0x5ea71c);dials[_0x85e9('0x3e')](_0x5ea71c);}catch(_0x314d18){utils['error'](util[_0x85e9('0x1a')](_0x85e9('0x3f'),_0x5ea71c[_0x85e9('0x20')]),_0x314d18);}});ami['on']('newchannel',function(_0x2398ae){try{utils[_0x85e9('0x1e')](util['format'](_0x85e9('0x40'),_0x2398ae[_0x85e9('0x20')]),_0x2398ae);calls[_0x85e9('0x41')](_0x2398ae);recordings[_0x85e9('0x41')](_0x2398ae);}catch(_0x44e2ab){utils['error'](util['format'](_0x85e9('0x40'),_0x2398ae['uniqueid']),_0x44e2ab);}});ami['on'](_0x85e9('0x42'),function(_0x5590bd){try{utils[_0x85e9('0x1e')](util[_0x85e9('0x1a')](_0x85e9('0x43'),_0x5590bd[_0x85e9('0x20')]),_0x5590bd);dials[_0x85e9('0x42')](_0x5590bd);}catch(_0x72cc0){utils[_0x85e9('0x17')](util['format'](_0x85e9('0x44'),_0x5590bd[_0x85e9('0x20')]),_0x72cc0);}});ami['on'](_0x85e9('0x45'),function(_0x141715){try{utils[_0x85e9('0x1e')](util[_0x85e9('0x1a')](_0x85e9('0x46'),_0x141715['uniqueid']),_0x141715);dials[_0x85e9('0x45')](_0x141715);}catch(_0x494b51){utils[_0x85e9('0x17')](util[_0x85e9('0x1a')](_0x85e9('0x46'),_0x141715[_0x85e9('0x20')]),_0x494b51);}});} \ No newline at end of file +var _0x3481=['production','local','asterisk','port','password','keepConnected','info','XDR\x20DISABLED','Asterisk\x20disabled\x20on\x20localhost','./agents.controller','./calls.controller','./recordings.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange','debug','device','format','[%s][index][devicestatechange]','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','[%s][index][queuecallerjoin]','queuecallerjoin','queuecallerleave','musiconholdstart','[%s][index][musiconholdstart]','musiconholdstop','[%s][index][musiconholdstop]','[%s][index][newstate]','newstate','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin','dialend','[%s][index][dialend]','../../config/environment','./utils','util','xdr','disabled','env'];(function(_0x57d766,_0x3ef42e){var _0xebb485=function(_0x3ea6b1){while(--_0x3ea6b1){_0x57d766['push'](_0x57d766['shift']());}};_0xebb485(++_0x3ef42e);}(_0x3481,0xc6));var _0x1348=function(_0x514129,_0xcb03fb){_0x514129=_0x514129-0x0;var _0x672ea9=_0x3481[_0x514129];return _0x672ea9;};var AsteriskManager=require('asterisk-manager');var config=require(_0x1348('0x0'));var utils=require(_0x1348('0x1'));var util=require(_0x1348('0x2'));var isXDREnabled=config[_0x1348('0x3')]&&config[_0x1348('0x3')][_0x1348('0x4')]?!config[_0x1348('0x3')]['disabled']:!![];var isProduction=config[_0x1348('0x5')]===_0x1348('0x6')||![];var isLocalAsterisk=config[_0x1348('0x3')]&&config['xdr'][_0x1348('0x7')]===!![]||![];var ami=new AsteriskManager(config[_0x1348('0x8')][_0x1348('0x9')],config['asterisk']['ip'],config[_0x1348('0x8')]['username'],config['asterisk'][_0x1348('0xa')],!![]);ami[_0x1348('0xb')]();if(!isXDREnabled){utils[_0x1348('0xc')](_0x1348('0xd'));}else if(!isProduction&&!isLocalAsterisk){utils[_0x1348('0xc')](_0x1348('0xe'));}else{var agents=require(_0x1348('0xf'));var calls=require(_0x1348('0x10'));var queues=require('./queues.controller');var recordings=require(_0x1348('0x11'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0x1348('0x12'));var core=require(_0x1348('0x13'));ami['on'](_0x1348('0x14'),core[_0x1348('0x14')]);ami['on'](_0x1348('0x15'),core[_0x1348('0x15')]);ami['on'](_0x1348('0x16'),core[_0x1348('0x16')]);ami['on'](_0x1348('0x17'),core[_0x1348('0x17')]);ami['on'](_0x1348('0x18'),core[_0x1348('0x18')]);ami['on']('managerevent',core['managerevent']);ami['on'](_0x1348('0x19'),function(_0x5708ae){try{utils[_0x1348('0x1a')](util['format']('[%s][index][devicestatechange]',_0x5708ae[_0x1348('0x1b')]),_0x5708ae);members[_0x1348('0x19')](_0x5708ae);}catch(_0x3f5686){utils[_0x1348('0x17')](util[_0x1348('0x1c')](_0x1348('0x1d'),_0x5708ae[_0x1348('0x1b')]),_0x3f5686);}});ami['on'](_0x1348('0x1e'),function(_0x32ba6e){try{utils['debug'](util[_0x1348('0x1c')]('[%s][index][agentcalled]',_0x32ba6e[_0x1348('0x1f')]),_0x32ba6e);agents[_0x1348('0x1e')](_0x32ba6e);}catch(_0x2780e8){utils['error'](util[_0x1348('0x1c')](_0x1348('0x20'),_0x32ba6e[_0x1348('0x1f')]),_0x2780e8);}});ami['on'](_0x1348('0x21'),function(_0x5b13b9){try{utils[_0x1348('0x1a')](util['format'](_0x1348('0x22'),_0x5b13b9[_0x1348('0x1f')]),_0x5b13b9);agents[_0x1348('0x21')](_0x5b13b9);}catch(_0x8ef773){utils[_0x1348('0x17')](util['format'](_0x1348('0x22'),_0x5b13b9[_0x1348('0x1f')]),_0x8ef773);}});ami['on'](_0x1348('0x23'),function(_0x1c3723){try{utils[_0x1348('0x1a')](util[_0x1348('0x1c')]('[%s][index][agentconnect]',_0x1c3723[_0x1348('0x1f')]),_0x1c3723);agents[_0x1348('0x23')](_0x1c3723);queues[_0x1348('0x23')](_0x1c3723);}catch(_0x595a0a){utils['error'](util[_0x1348('0x1c')](_0x1348('0x24'),_0x1c3723[_0x1348('0x1f')]),_0x595a0a);}});ami['on'](_0x1348('0x25'),function(_0x242a30){try{utils['debug'](util['format'](_0x1348('0x26'),_0x242a30[_0x1348('0x1f')]),_0x242a30);agents[_0x1348('0x25')](_0x242a30);queues[_0x1348('0x25')](_0x242a30);members[_0x1348('0x25')](_0x242a30);}catch(_0x605385){utils[_0x1348('0x17')](util[_0x1348('0x1c')]('[%s][index][agentcomplete]',_0x242a30[_0x1348('0x1f')]),_0x605385);}});ami['on'](_0x1348('0x27'),function(_0x44203a){try{utils[_0x1348('0x1a')](util[_0x1348('0x1c')](_0x1348('0x28'),_0x44203a['uniqueid']),_0x44203a);agents[_0x1348('0x27')](_0x44203a);queues[_0x1348('0x27')](_0x44203a);}catch(_0x32b376){utils[_0x1348('0x17')](util[_0x1348('0x1c')](_0x1348('0x28'),_0x44203a['uniqueid']),_0x32b376);}});ami['on']('queuecallerjoin',function(_0x406455){try{utils[_0x1348('0x1a')](util[_0x1348('0x1c')](_0x1348('0x29'),_0x406455['uniqueid']),_0x406455);queues[_0x1348('0x2a')](_0x406455);recordings['queuecallerjoin'](_0x406455);}catch(_0x208014){utils[_0x1348('0x17')](util[_0x1348('0x1c')]('[%s][index][queuecallerjoin]',_0x406455[_0x1348('0x1f')]),_0x208014);}});ami['on'](_0x1348('0x2b'),function(_0x57090b){try{utils[_0x1348('0x1a')](util[_0x1348('0x1c')]('[%s][index][queuecallerleave]',_0x57090b[_0x1348('0x1f')]),_0x57090b);queues['queuecallerleave'](_0x57090b);}catch(_0x4a1287){utils[_0x1348('0x17')](util['format']('[%s][index][queuecallerleave]',_0x57090b[_0x1348('0x1f')]),_0x4a1287);}});ami['on'](_0x1348('0x2c'),function(_0x3ccf75){try{utils['debug'](util[_0x1348('0x1c')]('[%s][index][musiconholdstart]',_0x3ccf75['uniqueid']),_0x3ccf75);queues[_0x1348('0x2c')](_0x3ccf75);calls[_0x1348('0x2c')](_0x3ccf75);}catch(_0x5275b1){utils[_0x1348('0x17')](util[_0x1348('0x1c')](_0x1348('0x2d'),_0x3ccf75[_0x1348('0x1f')]),_0x5275b1);}});ami['on'](_0x1348('0x2e'),function(_0x4f1a47){try{utils[_0x1348('0x1a')](util[_0x1348('0x1c')](_0x1348('0x2f'),_0x4f1a47[_0x1348('0x1f')]),_0x4f1a47);queues[_0x1348('0x2e')](_0x4f1a47);calls[_0x1348('0x2e')](_0x4f1a47);}catch(_0x36b4f8){utils[_0x1348('0x17')](util[_0x1348('0x1c')](_0x1348('0x2f'),_0x4f1a47[_0x1348('0x1f')]),_0x36b4f8);}});ami['on']('newstate',function(_0x4942f){try{utils[_0x1348('0x1a')](util['format'](_0x1348('0x30'),_0x4942f[_0x1348('0x1f')]),_0x4942f);calls[_0x1348('0x31')](_0x4942f);recordings[_0x1348('0x31')](_0x4942f);}catch(_0x41ad41){utils[_0x1348('0x17')](util[_0x1348('0x1c')](_0x1348('0x30'),_0x4942f[_0x1348('0x1f')]),_0x41ad41);}});ami['on'](_0x1348('0x32'),function(_0xd4d089){try{utils[_0x1348('0x1a')](util[_0x1348('0x1c')](_0x1348('0x33'),_0xd4d089[_0x1348('0x1f')]),_0xd4d089);calls[_0x1348('0x32')](_0xd4d089);recordings[_0x1348('0x32')](_0xd4d089);dials['hangup'](_0xd4d089);agents['hangup'](_0xd4d089);queues[_0x1348('0x32')](_0xd4d089);}catch(_0x5db379){utils['error'](util[_0x1348('0x1c')](_0x1348('0x33'),_0xd4d089[_0x1348('0x1f')]),_0x5db379);}});ami['on'](_0x1348('0x34'),function(_0x32967a){try{utils['debug'](util['format'](_0x1348('0x35'),_0x32967a['uniqueid']),_0x32967a);members[_0x1348('0x34')](_0x32967a);}catch(_0x22c2ad){utils[_0x1348('0x17')](util[_0x1348('0x1c')]('[%s][index][cdr]',_0x32967a[_0x1348('0x1f')]),_0x22c2ad);}});ami['on']('blindtransfer',function(_0x80e406){try{utils[_0x1348('0x1a')](util[_0x1348('0x1c')]('[%s][index][blindtransfer]',_0x80e406[_0x1348('0x1f')]),_0x80e406);queues[_0x1348('0x36')](_0x80e406);agents[_0x1348('0x36')](_0x80e406);transfers[_0x1348('0x36')](_0x80e406);recordings['blindtransfer'](_0x80e406);}catch(_0x334a61){utils[_0x1348('0x17')](util['format'](_0x1348('0x37'),_0x80e406['uniqueid']),_0x334a61);}});ami['on'](_0x1348('0x38'),function(_0x1e67ce){try{utils['debug'](util[_0x1348('0x1c')](_0x1348('0x39'),_0x1e67ce[_0x1348('0x3a')]),_0x1e67ce);queues[_0x1348('0x38')](_0x1e67ce);transfers[_0x1348('0x38')](_0x1e67ce);agents['attendedtransfer'](_0x1e67ce);calls['attendedtransfer'](_0x1e67ce);}catch(_0x2c90a8){utils[_0x1348('0x17')](util[_0x1348('0x1c')](_0x1348('0x39'),_0x1e67ce[_0x1348('0x3a')]),_0x2c90a8);}});ami['on'](_0x1348('0x3b'),function(_0x3ca500){try{utils[_0x1348('0x1a')](util[_0x1348('0x1c')]('[%s][index][varset]',_0x3ca500['uniqueid']),_0x3ca500);queues['varset'](_0x3ca500);recordings[_0x1348('0x3b')](_0x3ca500);calls[_0x1348('0x3b')](_0x3ca500);dials[_0x1348('0x3b')](_0x3ca500);}catch(_0x5736ea){utils[_0x1348('0x17')](util[_0x1348('0x1c')](_0x1348('0x3c'),_0x3ca500[_0x1348('0x1f')]),_0x5736ea);}});ami['on'](_0x1348('0x3d'),function(_0x57f663){try{utils[_0x1348('0x1a')](util[_0x1348('0x1c')]('[%s][index][newexten]',_0x57f663['uniqueid']),_0x57f663);calls[_0x1348('0x3d')](_0x57f663);recordings[_0x1348('0x3d')](_0x57f663);dials[_0x1348('0x3d')](_0x57f663);}catch(_0x4e1c45){utils[_0x1348('0x17')](util[_0x1348('0x1c')]('[%s][index][newexten]',_0x57f663[_0x1348('0x1f')]),_0x4e1c45);}});ami['on'](_0x1348('0x3e'),function(_0x4de032){try{utils[_0x1348('0x1a')](util[_0x1348('0x1c')](_0x1348('0x3f'),_0x4de032[_0x1348('0x1f')]),_0x4de032);calls[_0x1348('0x3e')](_0x4de032);recordings[_0x1348('0x3e')](_0x4de032);}catch(_0x5e51c3){utils['error'](util['format'](_0x1348('0x3f'),_0x4de032[_0x1348('0x1f')]),_0x5e51c3);}});ami['on'](_0x1348('0x40'),function(_0x27e6bd){try{utils['debug'](util[_0x1348('0x1c')]('[%s][index][dialbegin]',_0x27e6bd[_0x1348('0x1f')]),_0x27e6bd);dials[_0x1348('0x40')](_0x27e6bd);}catch(_0x4477d4){utils[_0x1348('0x17')](util[_0x1348('0x1c')](_0x1348('0x41'),_0x27e6bd['uniqueid']),_0x4477d4);}});ami['on'](_0x1348('0x42'),function(_0x2d6ac7){try{utils['debug'](util['format']('[%s][index][dialend]',_0x2d6ac7['uniqueid']),_0x2d6ac7);dials[_0x1348('0x42')](_0x2d6ac7);}catch(_0x73538b){utils[_0x1348('0x17')](util['format'](_0x1348('0x43'),_0x2d6ac7[_0x1348('0x1f')]),_0x73538b);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index a04b850..8708973 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 _0xc9b7=['then','name','internal','request','CreateMemberReport','split','catch','error','[%s][members][writeDB]','some','startsWith','format','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','debug','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','assign','source','data3','destination','data1','destinationchannel','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','[%s][members][cdr]','lodash','util','./utils','Local/_attended@transfer','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface'];(function(_0x32ac72,_0x41f8a5){var _0x4f6ef2=function(_0x3d4361){while(--_0x3d4361){_0x32ac72['push'](_0x32ac72['shift']());}};_0x4f6ef2(++_0x41f8a5);}(_0xc9b7,0x1ab));var _0x7c9b=function(_0x1b0899,_0x179c99){_0x1b0899=_0x1b0899-0x0;var _0x30273f=_0xc9b7[_0x1b0899];return _0x30273f;};'use strict';var _=require(_0x7c9b('0x0'));var util=require(_0x7c9b('0x1'));var utils=require(_0x7c9b('0x2'));var members={};var exclude=[_0x7c9b('0x3'),'Queue:'];function writeDB(_0x46f817){utils[_0x7c9b('0x4')](util['format'](_0x7c9b('0x5'),_0x46f817[_0x7c9b('0x6')],_0x46f817[_0x7c9b('0x7')],_0x46f817[_0x7c9b('0x8')],_0x46f817[_0x7c9b('0x9')],_0x46f817[_0x7c9b('0xa')],_0x46f817[_0x7c9b('0xb')]));if(_0x46f817[_0x7c9b('0x7')]){utils[_0x7c9b('0xc')](_0x46f817[_0x7c9b('0x7')])[_0x7c9b('0xd')](function(_0x3d2f35){if(_0x3d2f35){_0x46f817[_0x7c9b('0xa')]=_0x3d2f35[_0x7c9b('0xe')];_0x46f817[_0x7c9b('0xf')]=_0x3d2f35[_0x7c9b('0xf')];utils[_0x7c9b('0x10')](_0x7c9b('0x11'),_0x46f817);}else{utils['getUserByName'](_0x46f817[_0x7c9b('0x7')][_0x7c9b('0x12')]('/')[0x1])[_0x7c9b('0xd')](function(_0x4cba7a){if(_0x4cba7a){_0x46f817[_0x7c9b('0xa')]=_0x4cba7a['name'];_0x46f817[_0x7c9b('0xf')]=_0x4cba7a[_0x7c9b('0xf')];utils['request'](_0x7c9b('0x11'),_0x46f817);}});}})[_0x7c9b('0x13')](function(_0x271052){utils[_0x7c9b('0x14')](util['format'](_0x7c9b('0x15'),_0x46f817[_0x7c9b('0x6')]),_0x271052);});}delete members[_0x46f817['interface']];}function startsWith(_0x2f1ecb,_0x482e81){return _[_0x7c9b('0x16')](_0x2f1ecb,function(_0x2f1967){return _[_0x7c9b('0x17')](_0x482e81,_0x2f1967);});}exports['devicestatechange']=function(_0x4bab89){try{utils['debug'](util[_0x7c9b('0x18')](_0x7c9b('0x19'),members[_0x4bab89[_0x7c9b('0x1a')]]?members[_0x4bab89[_0x7c9b('0x1a')]][_0x7c9b('0x6')]:_0x4bab89[_0x7c9b('0x1a')]),_0x4bab89);utils['info'](util[_0x7c9b('0x18')](_0x7c9b('0x1b'),members[_0x4bab89[_0x7c9b('0x1a')]]?members[_0x4bab89['device']][_0x7c9b('0x6')]:_0x4bab89[_0x7c9b('0x1a')],_0x4bab89[_0x7c9b('0x1c')],_0x4bab89[_0x7c9b('0x1a')]));switch(_0x4bab89['state']){case _0x7c9b('0x1d'):case _0x7c9b('0x1e'):if(!startsWith(exclude,_0x4bab89[_0x7c9b('0x1a')])){members[_0x4bab89['device']]={'channel':_0x7c9b('0x1f'),'interface':_0x4bab89['device'],'type':_0x7c9b('0x20'),'enterAt':utils[_0x7c9b('0x21')](),'role':_0x7c9b('0x22')};}break;case _0x7c9b('0x23'):if(!_[_0x7c9b('0x24')](members[_0x4bab89['device']])){members[_0x4bab89[_0x7c9b('0x1a')]][_0x7c9b('0x25')]=utils[_0x7c9b('0x21')]();members[_0x4bab89[_0x7c9b('0x1a')]][_0x7c9b('0x26')]=utils[_0x7c9b('0x27')](members[_0x4bab89[_0x7c9b('0x1a')]][_0x7c9b('0x25')],members[_0x4bab89[_0x7c9b('0x1a')]][_0x7c9b('0x28')]);if(members[_0x4bab89['device']]['uniqueid']){writeDB(members[_0x4bab89[_0x7c9b('0x1a')]]);}}break;default:break;}}catch(_0x4a1392){utils['error'](util[_0x7c9b('0x18')]('[%s][members][devicestatechange]',members[_0x4bab89[_0x7c9b('0x1a')]]?members[_0x4bab89[_0x7c9b('0x1a')]][_0x7c9b('0x6')]:_0x4bab89[_0x7c9b('0x1a')]),_0x4a1392);}};exports[_0x7c9b('0x29')]=function(_0x2cbe6f){try{if(!_[_0x7c9b('0x24')](members[_0x2cbe6f[_0x7c9b('0x7')]])){utils[_0x7c9b('0x2a')](util['format'](_0x7c9b('0x2b'),_0x2cbe6f[_0x7c9b('0x6')]),_0x2cbe6f);utils[_0x7c9b('0x4')](util[_0x7c9b('0x18')](_0x7c9b('0x2c'),_0x2cbe6f[_0x7c9b('0x6')],_0x2cbe6f[_0x7c9b('0x7')],_0x2cbe6f[_0x7c9b('0x2d')]));members[_0x2cbe6f['interface']]=_['assign'](members[_0x2cbe6f[_0x7c9b('0x7')]],{'data4':_0x2cbe6f[_0x7c9b('0x2d')],'uniqueid':_0x2cbe6f[_0x7c9b('0x6')]});}}catch(_0xfc4456){utils[_0x7c9b('0x14')](util[_0x7c9b('0x18')](_0x7c9b('0x2b'),_0x2cbe6f[_0x7c9b('0x6')]),_0xfc4456);}};exports[_0x7c9b('0x2e')]=function(_0x608a13){try{utils[_0x7c9b('0x2a')](util[_0x7c9b('0x18')]('[%s][members][cdr]',_0x608a13[_0x7c9b('0x6')]),_0x608a13);if(_0x608a13[_0x7c9b('0x8')]){var _0x5ad5c2=_0x608a13[_0x7c9b('0x8')][_0x7c9b('0x12')]('-')[0x0];if(!_[_0x7c9b('0x24')](members[_0x5ad5c2])){members[_0x5ad5c2]=_[_0x7c9b('0x2f')](members[_0x5ad5c2],{'data1':members[_0x5ad5c2]['data1']||_0x608a13[_0x7c9b('0xb')],'data2':members[_0x5ad5c2][_0x7c9b('0x9')]||_0x608a13[_0x7c9b('0x30')],'data3':members[_0x5ad5c2][_0x7c9b('0x31')]||_0x608a13[_0x7c9b('0x32')],'uniqueid':members[_0x5ad5c2][_0x7c9b('0x6')]||_0x608a13[_0x7c9b('0x6')]});utils['info'](util[_0x7c9b('0x18')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x608a13['uniqueid'],members[_0x5ad5c2][_0x7c9b('0x33')],members[_0x5ad5c2][_0x7c9b('0x9')],members[_0x5ad5c2][_0x7c9b('0x31')]));if(members[_0x5ad5c2][_0x7c9b('0x25')]){writeDB(members[_0x5ad5c2]);}}}if(_0x608a13[_0x7c9b('0x34')]){var _0x3f1318=_0x608a13[_0x7c9b('0x34')][_0x7c9b('0x12')]('-')[0x0];if(!_['isNil'](members[_0x3f1318])){members[_0x3f1318]=_['assign'](members[_0x3f1318],{'data1':members[_0x3f1318][_0x7c9b('0x33')]||_0x608a13[_0x7c9b('0xb')],'data2':members[_0x3f1318][_0x7c9b('0x9')]||_0x608a13[_0x7c9b('0x30')],'data3':members[_0x3f1318][_0x7c9b('0x31')]||_0x608a13[_0x7c9b('0x32')],'uniqueid':members[_0x3f1318][_0x7c9b('0x6')]||_0x608a13[_0x7c9b('0x6')]});utils[_0x7c9b('0x4')](util[_0x7c9b('0x18')](_0x7c9b('0x35'),_0x608a13[_0x7c9b('0x6')],members[_0x3f1318]['data1'],members[_0x3f1318][_0x7c9b('0x9')],members[_0x3f1318][_0x7c9b('0x31')]));if(members[_0x3f1318][_0x7c9b('0x25')]){writeDB(members[_0x3f1318]);}}}}catch(_0x5b30de){utils['error'](util[_0x7c9b('0x18')](_0x7c9b('0x36'),_0x608a13[_0x7c9b('0x6')]),_0x5b30de);}}; \ No newline at end of file +var _0xfa7a=['split','then','catch','error','[%s][members][writeDB]','some','devicestatechange','debug','uniqueid','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','device','state','INUSE','BUSY','voice','now','isNil','exitAt','duration','diffTime','enterAt','[%s][members][devicestatechange]','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','queue','cdr','data1','source','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','data3','lodash','util','./utils','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','interface','channel','data2','membername','type','getUserByInterface','name','internal','request','CreateMemberReport','getUserByName'];(function(_0x1d046a,_0x30db41){var _0x2c0b0c=function(_0x30a3c5){while(--_0x30a3c5){_0x1d046a['push'](_0x1d046a['shift']());}};_0x2c0b0c(++_0x30db41);}(_0xfa7a,0x1ed));var _0xafa7=function(_0x40c4e4,_0x1b9fcd){_0x40c4e4=_0x40c4e4-0x0;var _0x5c4113=_0xfa7a[_0x40c4e4];return _0x5c4113;};'use strict';var _=require(_0xafa7('0x0'));var util=require(_0xafa7('0x1'));var utils=require(_0xafa7('0x2'));var members={};var exclude=['Local/_attended@transfer','Queue:'];function writeDB(_0x336c0e){utils[_0xafa7('0x3')](util[_0xafa7('0x4')](_0xafa7('0x5'),_0x336c0e['uniqueid'],_0x336c0e[_0xafa7('0x6')],_0x336c0e[_0xafa7('0x7')],_0x336c0e[_0xafa7('0x8')],_0x336c0e[_0xafa7('0x9')],_0x336c0e[_0xafa7('0xa')]));if(_0x336c0e[_0xafa7('0x6')]){utils[_0xafa7('0xb')](_0x336c0e[_0xafa7('0x6')])['then'](function(_0x141f50){if(_0x141f50){_0x336c0e['membername']=_0x141f50[_0xafa7('0xc')];_0x336c0e[_0xafa7('0xd')]=_0x141f50['internal'];utils[_0xafa7('0xe')](_0xafa7('0xf'),_0x336c0e);}else{utils[_0xafa7('0x10')](_0x336c0e[_0xafa7('0x6')][_0xafa7('0x11')]('/')[0x1])[_0xafa7('0x12')](function(_0x15f5e1){if(_0x15f5e1){_0x336c0e[_0xafa7('0x9')]=_0x15f5e1['name'];_0x336c0e['internal']=_0x15f5e1[_0xafa7('0xd')];utils['request'](_0xafa7('0xf'),_0x336c0e);}});}})[_0xafa7('0x13')](function(_0x5f1101){utils[_0xafa7('0x14')](util['format'](_0xafa7('0x15'),_0x336c0e['uniqueid']),_0x5f1101);});}delete members[_0x336c0e[_0xafa7('0x6')]];}function startsWith(_0x7660e2,_0x4e6986){return _[_0xafa7('0x16')](_0x7660e2,function(_0x52c4e3){return _['startsWith'](_0x4e6986,_0x52c4e3);});}exports[_0xafa7('0x17')]=function(_0x58c121){try{utils[_0xafa7('0x18')](util['format']('[%s][members][devicestatechange]',members[_0x58c121['device']]?members[_0x58c121['device']][_0xafa7('0x19')]:_0x58c121['device']),_0x58c121);utils[_0xafa7('0x3')](util[_0xafa7('0x4')](_0xafa7('0x1a'),members[_0x58c121['device']]?members[_0x58c121[_0xafa7('0x1b')]]['uniqueid']:_0x58c121[_0xafa7('0x1b')],_0x58c121['state'],_0x58c121[_0xafa7('0x1b')]));switch(_0x58c121[_0xafa7('0x1c')]){case _0xafa7('0x1d'):case _0xafa7('0x1e'):if(!startsWith(exclude,_0x58c121['device'])){members[_0x58c121['device']]={'channel':_0xafa7('0x1f'),'interface':_0x58c121[_0xafa7('0x1b')],'type':'TALKING','enterAt':utils[_0xafa7('0x20')](),'role':'agent'};}break;case'NOT_INUSE':if(!_[_0xafa7('0x21')](members[_0x58c121['device']])){members[_0x58c121[_0xafa7('0x1b')]][_0xafa7('0x22')]=utils[_0xafa7('0x20')]();members[_0x58c121[_0xafa7('0x1b')]][_0xafa7('0x23')]=utils[_0xafa7('0x24')](members[_0x58c121['device']][_0xafa7('0x22')],members[_0x58c121[_0xafa7('0x1b')]][_0xafa7('0x25')]);if(members[_0x58c121['device']]['uniqueid']){writeDB(members[_0x58c121[_0xafa7('0x1b')]]);}}break;default:break;}}catch(_0x33bd34){utils[_0xafa7('0x14')](util[_0xafa7('0x4')](_0xafa7('0x26'),members[_0x58c121['device']]?members[_0x58c121[_0xafa7('0x1b')]]['uniqueid']:_0x58c121[_0xafa7('0x1b')]),_0x33bd34);}};exports[_0xafa7('0x27')]=function(_0x75522c){try{if(!_['isNil'](members[_0x75522c[_0xafa7('0x6')]])){utils['debug'](util[_0xafa7('0x4')](_0xafa7('0x28'),_0x75522c[_0xafa7('0x19')]),_0x75522c);utils['info'](util[_0xafa7('0x4')](_0xafa7('0x29'),_0x75522c[_0xafa7('0x19')],_0x75522c[_0xafa7('0x6')],_0x75522c['queue']));members[_0x75522c[_0xafa7('0x6')]]=_[_0xafa7('0x2a')](members[_0x75522c[_0xafa7('0x6')]],{'data4':_0x75522c[_0xafa7('0x2b')],'uniqueid':_0x75522c[_0xafa7('0x19')]});}}catch(_0xa496cc){utils[_0xafa7('0x14')](util[_0xafa7('0x4')](_0xafa7('0x28'),_0x75522c[_0xafa7('0x19')]),_0xa496cc);}};exports[_0xafa7('0x2c')]=function(_0x288423){try{utils['debug'](util['format']('[%s][members][cdr]',_0x288423[_0xafa7('0x19')]),_0x288423);if(_0x288423['channel']){var _0x29ea03=_0x288423[_0xafa7('0x7')][_0xafa7('0x11')]('-')[0x0];if(!_[_0xafa7('0x21')](members[_0x29ea03])){members[_0x29ea03]=_[_0xafa7('0x2a')](members[_0x29ea03],{'data1':members[_0x29ea03][_0xafa7('0x2d')]||_0x288423[_0xafa7('0xa')],'data2':members[_0x29ea03][_0xafa7('0x8')]||_0x288423[_0xafa7('0x2e')],'data3':members[_0x29ea03]['data3']||_0x288423[_0xafa7('0x2f')],'uniqueid':members[_0x29ea03][_0xafa7('0x19')]||_0x288423[_0xafa7('0x19')]});utils['info'](util[_0xafa7('0x4')](_0xafa7('0x30'),_0x288423[_0xafa7('0x19')],members[_0x29ea03][_0xafa7('0x2d')],members[_0x29ea03][_0xafa7('0x8')],members[_0x29ea03]['data3']));if(members[_0x29ea03][_0xafa7('0x22')]){writeDB(members[_0x29ea03]);}}}if(_0x288423[_0xafa7('0x31')]){var _0x2d5ccf=_0x288423[_0xafa7('0x31')]['split']('-')[0x0];if(!_[_0xafa7('0x21')](members[_0x2d5ccf])){members[_0x2d5ccf]=_[_0xafa7('0x2a')](members[_0x2d5ccf],{'data1':members[_0x2d5ccf][_0xafa7('0x2d')]||_0x288423[_0xafa7('0xa')],'data2':members[_0x2d5ccf][_0xafa7('0x8')]||_0x288423['source'],'data3':members[_0x2d5ccf][_0xafa7('0x32')]||_0x288423[_0xafa7('0x2f')],'uniqueid':members[_0x2d5ccf][_0xafa7('0x19')]||_0x288423[_0xafa7('0x19')]});utils[_0xafa7('0x3')](util['format']('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x288423[_0xafa7('0x19')],members[_0x2d5ccf][_0xafa7('0x2d')],members[_0x2d5ccf][_0xafa7('0x8')],members[_0x2d5ccf][_0xafa7('0x32')]));if(members[_0x2d5ccf]['exitAt']){writeDB(members[_0x2d5ccf]);}}}}catch(_0x471702){utils[_0xafa7('0x14')](util[_0xafa7('0x4')]('[%s][members][cdr]',_0x288423[_0xafa7('0x19')]),_0x471702);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 65c0360..efb25b6 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 _0x3458=['[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','queuecallerabandon','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','[%s][queues][agentconnect]','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfer','BLIND','transferexten','extension','BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','[%s][queues][attendedtransfer]','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfertype','ATTENDED','transferuniqueid','origtransfereruniqueid','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','transfertargetlinkedid','clone','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','channel','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','assign','now','error','hangup','isNil','queuecallerleaveAt','queuecallerexit','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','[%s][queues][hangup]','varset','variable','queuestatus','value','toUpperCase','queuecallerabandonAt','queuecallerexitAt'];(function(_0x145d21,_0x24e058){var _0x197c9f=function(_0x10d3f7){while(--_0x10d3f7){_0x145d21['push'](_0x145d21['shift']());}};_0x197c9f(++_0x24e058);}(_0x3458,0x10b));var _0x8345=function(_0x5dd8a6,_0x271d66){_0x5dd8a6=_0x5dd8a6-0x0;var _0x2eb653=_0x3458[_0x5dd8a6];return _0x2eb653;};'use strict';var _=require(_0x8345('0x0'));var util=require('util');var utils=require(_0x8345('0x1'));var queues={};function writeDB(_0x4a6ca5){utils[_0x8345('0x2')](util[_0x8345('0x3')](_0x8345('0x4'),_0x4a6ca5[_0x8345('0x5')],_0x4a6ca5[_0x8345('0x6')],_0x4a6ca5[_0x8345('0x7')],_0x4a6ca5[_0x8345('0x8')],_0x4a6ca5[_0x8345('0x9')],_0x4a6ca5[_0x8345('0xa')],_0x4a6ca5[_0x8345('0xb')]));if(_0x4a6ca5['queue']){utils[_0x8345('0xc')](_0x4a6ca5[_0x8345('0x7')])[_0x8345('0xd')](function(_0x2b5792){if(_0x2b5792){_0x4a6ca5[_0x8345('0xe')]=_0x2b5792[_0x8345('0xe')];}utils[_0x8345('0xf')]('CreateVoiceQueueReport',_0x4a6ca5);});}else{utils[_0x8345('0xf')](_0x8345('0x10'),_0x4a6ca5);}if(_0x4a6ca5[_0x8345('0x11')]){delete queues[_0x4a6ca5[_0x8345('0x11')]];}else{delete queues[_0x4a6ca5[_0x8345('0x5')]];}}exports[_0x8345('0x12')]=function(_0x5635c1){try{utils[_0x8345('0x13')](util[_0x8345('0x3')](_0x8345('0x14'),_0x5635c1[_0x8345('0x5')]),_0x5635c1);utils[_0x8345('0x2')](util['format'](_0x8345('0x15'),_0x5635c1[_0x8345('0x5')],_0x5635c1[_0x8345('0x7')],_0x5635c1[_0x8345('0x16')]));queues[_0x5635c1['uniqueid']]=_[_0x8345('0x17')](_0x5635c1,{'originalposition':_0x5635c1[_0x8345('0x16')],'queuecallerjoinAt':utils[_0x8345('0x18')](),'mohtime':0x0});}catch(_0xdf179){utils[_0x8345('0x19')](util[_0x8345('0x3')](_0x8345('0x14'),_0x5635c1[_0x8345('0x5')]),_0xdf179);}};exports[_0x8345('0x1a')]=function(_0x41aae0){try{if(!_[_0x8345('0x1b')](queues[_0x41aae0[_0x8345('0x5')]])){utils[_0x8345('0x13')](util[_0x8345('0x3')]('[%s][queues][hangup]',_0x41aae0[_0x8345('0x5')]),_0x41aae0);if(queues[_0x41aae0[_0x8345('0x5')]][_0x8345('0x1c')]){if(!queues[_0x41aae0[_0x8345('0x5')]]['queuecallerabandon']&&!queues[_0x41aae0[_0x8345('0x5')]][_0x8345('0x1d')]){queues[_0x41aae0[_0x8345('0x5')]]['queuecallercomplete']=!![];queues[_0x41aae0[_0x8345('0x5')]]['queuecallercompleteAt']=utils[_0x8345('0x18')]();queues[_0x41aae0[_0x8345('0x5')]][_0x8345('0xb')]=_0x8345('0x1e');}utils[_0x8345('0x2')](util[_0x8345('0x3')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x41aae0[_0x8345('0x5')],queues[_0x41aae0[_0x8345('0x5')]][_0x8345('0x1f')],queues[_0x41aae0[_0x8345('0x5')]][_0x8345('0xb')]));writeDB(queues[_0x41aae0['uniqueid']]);}else if(queues[_0x41aae0[_0x8345('0x5')]][_0x8345('0x11')]){utils[_0x8345('0x2')](util[_0x8345('0x3')](_0x8345('0x20'),_0x41aae0[_0x8345('0x5')],queues[_0x41aae0[_0x8345('0x5')]]['name'],queues[_0x41aae0['uniqueid']][_0x8345('0x11')]));queues[queues[_0x41aae0[_0x8345('0x5')]][_0x8345('0x11')]]=queues[_0x41aae0['uniqueid']];queues[queues[_0x41aae0[_0x8345('0x5')]][_0x8345('0x11')]][_0x8345('0x21')]=0x2;delete queues[_0x41aae0['uniqueid']];}}}catch(_0x429b4a){utils['error'](util[_0x8345('0x3')](_0x8345('0x22'),_0x41aae0[_0x8345('0x5')]),_0x429b4a);}};exports[_0x8345('0x23')]=function(_0x5d262c){try{utils[_0x8345('0x13')](util[_0x8345('0x3')]('[%s][queues][varset]',_0x5d262c[_0x8345('0x5')]),_0x5d262c);if(!_[_0x8345('0x1b')](_0x5d262c[_0x8345('0x24')][_0x8345('0x25')])&&_0x5d262c[_0x8345('0x26')][_0x8345('0x27')]()!=='CONTINUE'){if(!_[_0x8345('0x1b')](queues[_0x5d262c[_0x8345('0x5')]])){queues[_0x5d262c[_0x8345('0x5')]]['queuecallerabandon']=![];queues[_0x5d262c[_0x8345('0x5')]][_0x8345('0x28')]=null;queues[_0x5d262c['uniqueid']][_0x8345('0x1d')]=!![];queues[_0x5d262c['uniqueid']][_0x8345('0x29')]=utils['now']();queues[_0x5d262c[_0x8345('0x5')]][_0x8345('0xb')]=_0x5d262c[_0x8345('0x26')]['toUpperCase']();utils[_0x8345('0x2')](util[_0x8345('0x3')](_0x8345('0x2a'),_0x5d262c[_0x8345('0x5')],queues[_0x5d262c[_0x8345('0x5')]]['name'],_0x5d262c[_0x8345('0x26')],queues[_0x5d262c[_0x8345('0x5')]][_0x8345('0xb')]));writeDB(queues[_0x5d262c[_0x8345('0x5')]]);}}else if(!_[_0x8345('0x1b')](_0x5d262c[_0x8345('0x24')][_0x8345('0x2b')])){if(!_[_0x8345('0x1b')](queues[_0x5d262c[_0x8345('0x5')]])&&!queues[_0x5d262c['uniqueid']]['queuecallerabandon']){queues[_0x5d262c['uniqueid']]['queuecallerabandon']=![];queues[_0x5d262c[_0x8345('0x5')]][_0x8345('0x28')]=null;queues[_0x5d262c[_0x8345('0x5')]]['queuecallerexit']=!![];queues[_0x5d262c[_0x8345('0x5')]][_0x8345('0x29')]=utils[_0x8345('0x18')]();queues[_0x5d262c[_0x8345('0x5')]][_0x8345('0xb')]='EXITWITHKEY';utils[_0x8345('0x2')](util[_0x8345('0x3')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x5d262c[_0x8345('0x5')],queues[_0x5d262c[_0x8345('0x5')]]['name'],_0x5d262c[_0x8345('0x26')],queues[_0x5d262c[_0x8345('0x5')]]['queuecallerexitreason']));}}}catch(_0x4df9dd){utils[_0x8345('0x19')](util[_0x8345('0x3')]('[%s][queues][varset]',_0x5d262c[_0x8345('0x5')]),_0x4df9dd);}};exports[_0x8345('0x2c')]=function(_0x2533b9){try{if(!_[_0x8345('0x1b')](queues[_0x2533b9[_0x8345('0x5')]])){utils['debug'](util['format'](_0x8345('0x2d'),_0x2533b9[_0x8345('0x5')]),_0x2533b9);queues[_0x2533b9['uniqueid']][_0x8345('0x1d')]=![];queues[_0x2533b9[_0x8345('0x5')]][_0x8345('0x29')]=null;queues[_0x2533b9[_0x8345('0x5')]][_0x8345('0x2c')]=!![];queues[_0x2533b9[_0x8345('0x5')]][_0x8345('0x28')]=utils['now']();queues[_0x2533b9['uniqueid']]['queuecallerexitreason']=_0x8345('0x2e');utils[_0x8345('0x2')](util[_0x8345('0x3')](_0x8345('0x2f'),_0x2533b9[_0x8345('0x5')],queues[_0x2533b9[_0x8345('0x5')]][_0x8345('0x1f')],queues[_0x2533b9['uniqueid']][_0x8345('0xb')]));}}catch(_0x4cd6cc){utils[_0x8345('0x19')](util[_0x8345('0x3')](_0x8345('0x2d'),_0x2533b9['uniqueid']),_0x4cd6cc);}};exports['queuecallerleave']=function(_0xd8606e){try{if(!_[_0x8345('0x1b')](queues[_0xd8606e[_0x8345('0x5')]])){utils[_0x8345('0x13')](util[_0x8345('0x3')](_0x8345('0x30'),_0xd8606e[_0x8345('0x5')]),_0xd8606e);utils[_0x8345('0x2')](util[_0x8345('0x3')](_0x8345('0x31'),_0xd8606e[_0x8345('0x5')],queues[_0xd8606e[_0x8345('0x5')]][_0x8345('0x1f')],_0xd8606e[_0x8345('0x32')],_0xd8606e['connectedlinename']));queues[_0xd8606e[_0x8345('0x5')]][_0x8345('0x33')]=!![];queues[_0xd8606e[_0x8345('0x5')]][_0x8345('0x1c')]=utils[_0x8345('0x18')]();queues[_0xd8606e[_0x8345('0x5')]][_0x8345('0x34')]=utils[_0x8345('0x35')](queues[_0xd8606e[_0x8345('0x5')]][_0x8345('0x1c')],queues[_0xd8606e[_0x8345('0x5')]][_0x8345('0x36')]);queues[_0xd8606e[_0x8345('0x5')]]['position']=_0xd8606e['position'];queues[_0xd8606e[_0x8345('0x5')]][_0x8345('0x37')]=_0xd8606e[_0x8345('0x37')];queues[_0xd8606e[_0x8345('0x5')]][_0x8345('0x32')]=_0xd8606e['connectedlinenum'];queues[_0xd8606e['uniqueid']]['connectedlinename']=_0xd8606e['connectedlinename'];}}catch(_0x45d3dc){utils[_0x8345('0x19')](util[_0x8345('0x3')]('[%s][queues][queuecallerleave]',_0xd8606e['uniqueid']),_0x45d3dc);}};exports['agentconnect']=function(_0xeaa06e){try{if(!_[_0x8345('0x1b')](queues[_0xeaa06e[_0x8345('0x5')]])){utils[_0x8345('0x13')](util[_0x8345('0x3')](_0x8345('0x38'),_0xeaa06e['uniqueid']),_0xeaa06e);utils[_0x8345('0x2')](util[_0x8345('0x3')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0xeaa06e[_0x8345('0x5')],queues[_0xeaa06e[_0x8345('0x5')]][_0x8345('0x1f')],_0xeaa06e[_0x8345('0x39')],_0xeaa06e[_0x8345('0x3a')]));queues[_0xeaa06e[_0x8345('0x5')]][_0x8345('0x2c')]=![];queues[_0xeaa06e[_0x8345('0x5')]][_0x8345('0x2c')]=![];queues[_0xeaa06e[_0x8345('0x5')]][_0x8345('0x28')]=null;queues[_0xeaa06e['uniqueid']]['queuecallerexit']=![];queues[_0xeaa06e['uniqueid']][_0x8345('0xb')]=null;queues[_0xeaa06e[_0x8345('0x5')]][_0x8345('0x29')]=null;queues[_0xeaa06e[_0x8345('0x5')]][_0x8345('0x3b')]=!![];queues[_0xeaa06e[_0x8345('0x5')]][_0x8345('0xa')]=_0xeaa06e[_0x8345('0x3a')];queues[_0xeaa06e[_0x8345('0x5')]][_0x8345('0x8')]=_0xeaa06e['membername'];}}catch(_0x56c2c5){utils['error'](util['format'](_0x8345('0x38'),_0xeaa06e['uniqueid']),_0x56c2c5);}};exports[_0x8345('0x3c')]=function(_0xfb851f){try{if(!_[_0x8345('0x1b')](queues[_0xfb851f['uniqueid']])){if(queues[_0xfb851f[_0x8345('0x5')]][_0x8345('0x1c')]){utils[_0x8345('0x13')](util['format'](_0x8345('0x3d'),_0xfb851f[_0x8345('0x5')]),_0xfb851f);queues[_0xfb851f['uniqueid']][_0x8345('0x2c')]=![];queues[_0xfb851f[_0x8345('0x5')]]['queuecallerabandon']=![];queues[_0xfb851f[_0x8345('0x5')]][_0x8345('0x28')]=null;queues[_0xfb851f[_0x8345('0x5')]][_0x8345('0x1d')]=![];queues[_0xfb851f[_0x8345('0x5')]][_0x8345('0x29')]=null;queues[_0xfb851f[_0x8345('0x5')]][_0x8345('0x3b')]=!![];queues[_0xfb851f[_0x8345('0x5')]][_0x8345('0x8')]=_0xfb851f[_0x8345('0x39')];queues[_0xfb851f[_0x8345('0x5')]]['queuecallercomplete']=!![];queues[_0xfb851f[_0x8345('0x5')]][_0x8345('0x3e')]=utils[_0x8345('0x18')]();if(_0xfb851f[_0x8345('0x3f')]=='transfer'){if(!queues[_0xfb851f['uniqueid']]['transfer']){queues[_0xfb851f[_0x8345('0x5')]][_0x8345('0xb')]=_0x8345('0x40');}}else{queues[_0xfb851f[_0x8345('0x5')]][_0x8345('0xb')]=_0x8345('0x41')+_0xfb851f['reason'][_0x8345('0x27')]();}utils[_0x8345('0x2')](util[_0x8345('0x3')](_0x8345('0x42'),_0xfb851f['uniqueid'],queues[_0xfb851f[_0x8345('0x5')]]['name'],_0xfb851f['membername'],queues[_0xfb851f[_0x8345('0x5')]]['queuecallerexitreason']));writeDB(queues[_0xfb851f['uniqueid']]);}}}catch(_0x28f118){utils['error'](util[_0x8345('0x3')]('[%s][queues][agentcomplete]',_0xfb851f['uniqueid']),_0x28f118);}};exports[_0x8345('0x43')]=function(_0x106963){try{if(!_['isNil'](queues[_0x106963[_0x8345('0x44')]])){utils[_0x8345('0x13')](util[_0x8345('0x3')]('[%s][queues][blindtransfer]',_0x106963[_0x8345('0x5')]),_0x106963);queues[_0x106963[_0x8345('0x44')]][_0x8345('0x45')]=!![];queues[_0x106963['transfereeuniqueid']]['transfertype']=_0x8345('0x46');queues[_0x106963[_0x8345('0x44')]][_0x8345('0x47')]=_0x106963[_0x8345('0x48')];queues[_0x106963[_0x8345('0x44')]]['transferuniqueid']=_0x106963[_0x8345('0x44')];queues[_0x106963[_0x8345('0x44')]][_0x8345('0xb')]=_0x8345('0x49');utils['info'](util[_0x8345('0x3')]('[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER',_0x106963['uniqueid'],queues[_0x106963[_0x8345('0x44')]][_0x8345('0x1f')],_0x106963[_0x8345('0x44')],_0x106963[_0x8345('0x48')]));}}catch(_0x54d578){utils[_0x8345('0x19')](util[_0x8345('0x3')](_0x8345('0x4a'),_0x106963['uniqueid']),_0x54d578);}};exports[_0x8345('0x4b')]=function(_0xc90b2e){try{utils[_0x8345('0x13')](util[_0x8345('0x3')](_0x8345('0x4c'),_0xc90b2e['origtransfereruniqueid']),_0xc90b2e);if(_0xc90b2e['origtransfereruniqueid']==_0xc90b2e[_0x8345('0x4d')]){if(!_[_0x8345('0x1b')](queues[_0xc90b2e[_0x8345('0x4e')]])){utils[_0x8345('0x2')](util[_0x8345('0x3')](_0x8345('0x4f'),_0xc90b2e['origtransfereruniqueid'],queues[_0xc90b2e['secondtransfererlinkedid']]['name'],_0xc90b2e[_0x8345('0x50')]));queues[_0xc90b2e[_0x8345('0x4e')]][_0x8345('0x45')]=!![];queues[_0xc90b2e[_0x8345('0x4e')]][_0x8345('0x51')]=_0x8345('0x52');queues[_0xc90b2e[_0x8345('0x4e')]]['transferexten']=_0xc90b2e['origtransfererexten'];queues[_0xc90b2e[_0x8345('0x4e')]][_0x8345('0x53')]=_0xc90b2e[_0x8345('0x54')];queues[_0xc90b2e[_0x8345('0x4e')]]['queuecallerexitreason']=_0x8345('0x55');}if(!_[_0x8345('0x1b')](queues[_0xc90b2e['origtransfererlinkedid']])){if(_0xc90b2e[_0x8345('0x56')]&&queues[_0xc90b2e['transfereelinkedid']]){queues[_0xc90b2e[_0x8345('0x56')]][_0x8345('0x21')]=0x1;queues[_0xc90b2e['transfereeuniqueid']]=_['clone'](queues[_0xc90b2e[_0x8345('0x56')]]);queues[_0xc90b2e[_0x8345('0x44')]][_0x8345('0x11')]=_0xc90b2e[_0x8345('0x57')];queues[_0xc90b2e[_0x8345('0x44')]][_0x8345('0x21')]=0x2;queues[_0xc90b2e[_0x8345('0x44')]][_0x8345('0x9')]=queues[_0xc90b2e[_0x8345('0x4e')]][_0x8345('0x9')];queues[_0xc90b2e[_0x8345('0x44')]][_0x8345('0x58')]=queues[_0xc90b2e[_0x8345('0x4e')]][_0x8345('0x58')];queues[_0xc90b2e['transfereeuniqueid']][_0x8345('0x36')]=utils['now']();queues[_0xc90b2e[_0x8345('0x44')]][_0x8345('0x1c')]=utils[_0x8345('0x18')]();queues[_0xc90b2e[_0x8345('0x44')]][_0x8345('0x34')]=0x0;queues[_0xc90b2e['transfereeuniqueid']][_0x8345('0x59')]=0x0;utils['info'](util[_0x8345('0x3')](_0x8345('0x5a'),_0xc90b2e[_0x8345('0x54')],queues[_0xc90b2e[_0x8345('0x44')]][_0x8345('0x1f')],queues[_0xc90b2e[_0x8345('0x44')]]['calleridnum'],queues[_0xc90b2e[_0x8345('0x44')]][_0x8345('0x58')]));}else{utils[_0x8345('0x2')](util[_0x8345('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0xc90b2e[_0x8345('0x54')],queues[_0xc90b2e['origtransfererlinkedid']][_0x8345('0x1f')],_0xc90b2e[_0x8345('0x4e')]));queues[_0xc90b2e[_0x8345('0x4d')]][_0x8345('0x11')]=_0xc90b2e[_0x8345('0x4e')];}}}else if(_0xc90b2e[_0x8345('0x5b')]==_0xc90b2e[_0x8345('0x4e')]){if(!_[_0x8345('0x1b')](queues[_0xc90b2e['origtransfererlinkedid']])){utils['info'](util[_0x8345('0x3')](_0x8345('0x5c'),_0xc90b2e[_0x8345('0x54')],queues[_0xc90b2e['origtransfererlinkedid']]['name'],_0xc90b2e[_0x8345('0x5b')],_0xc90b2e['secondtransfererexten']));queues[_0xc90b2e[_0x8345('0x4d')]][_0x8345('0x45')]=!![];queues[_0xc90b2e[_0x8345('0x4d')]][_0x8345('0x51')]=_0x8345('0x52');queues[_0xc90b2e[_0x8345('0x4d')]][_0x8345('0x47')]=_0xc90b2e['secondtransfererexten'];queues[_0xc90b2e[_0x8345('0x4d')]][_0x8345('0x53')]=_0xc90b2e[_0x8345('0x5b')];queues[_0xc90b2e[_0x8345('0x4d')]][_0x8345('0xb')]=_0x8345('0x55');}if(!_[_0x8345('0x1b')](queues[_0xc90b2e[_0x8345('0x4e')]])){if(_0xc90b2e[_0x8345('0x5d')]&&queues[_0xc90b2e['transfertargetlinkedid']]){queues[_0xc90b2e['transfertargetlinkedid']]['queuecallerenterreason']=0x1;queues[_0xc90b2e[_0x8345('0x57')]]=_[_0x8345('0x5e')](queues[_0xc90b2e[_0x8345('0x5d')]]);queues[_0xc90b2e[_0x8345('0x57')]][_0x8345('0x11')]=_0xc90b2e[_0x8345('0x57')];queues[_0xc90b2e[_0x8345('0x57')]][_0x8345('0x21')]=0x2;queues[_0xc90b2e['transfertargetuniqueid']][_0x8345('0x9')]=queues[_0xc90b2e['origtransfererlinkedid']][_0x8345('0x9')];queues[_0xc90b2e[_0x8345('0x57')]][_0x8345('0x58')]=queues[_0xc90b2e[_0x8345('0x4d')]][_0x8345('0x58')];queues[_0xc90b2e[_0x8345('0x57')]][_0x8345('0x36')]=utils[_0x8345('0x18')]();queues[_0xc90b2e[_0x8345('0x57')]][_0x8345('0x1c')]=utils['now']();queues[_0xc90b2e[_0x8345('0x57')]][_0x8345('0x34')]=0x0;queues[_0xc90b2e['transfertargetuniqueid']][_0x8345('0x59')]=0x0;utils[_0x8345('0x2')](util[_0x8345('0x3')](_0x8345('0x5f'),_0xc90b2e[_0x8345('0x54')],queues[_0xc90b2e[_0x8345('0x57')]][_0x8345('0x1f')],queues[_0xc90b2e[_0x8345('0x57')]]['transfereduniqueid'],queues[_0xc90b2e[_0x8345('0x57')]]['calleridnum'],queues[_0xc90b2e['transfertargetuniqueid']][_0x8345('0x58')]));}else{utils[_0x8345('0x2')](util[_0x8345('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0xc90b2e['origtransfereruniqueid'],queues[_0xc90b2e['secondtransfererlinkedid']][_0x8345('0x1f')],_0xc90b2e[_0x8345('0x4d')]));queues[_0xc90b2e['secondtransfererlinkedid']][_0x8345('0x11')]=_0xc90b2e['origtransfererlinkedid'];}}}}catch(_0x3be693){utils[_0x8345('0x19')](util[_0x8345('0x3')](_0x8345('0x4c'),_0xc90b2e[_0x8345('0x54')]),_0x3be693);}};exports[_0x8345('0x60')]=function(_0xf30b8a){try{if(!_[_0x8345('0x1b')](queues[_0xf30b8a[_0x8345('0x5')]])){utils['debug'](util[_0x8345('0x3')](_0x8345('0x61'),_0xf30b8a[_0x8345('0x5')]),_0xf30b8a);queues[_0xf30b8a[_0x8345('0x5')]][_0x8345('0x62')]=utils[_0x8345('0x18')]();utils[_0x8345('0x2')](util[_0x8345('0x3')](_0x8345('0x63'),_0xf30b8a[_0x8345('0x5')],queues[_0xf30b8a[_0x8345('0x5')]]['name'],queues[_0xf30b8a[_0x8345('0x5')]][_0x8345('0x62')]));}}catch(_0x1d6cd8){utils[_0x8345('0x19')](util[_0x8345('0x3')]('[%s][queues][musiconholdstart]',_0xf30b8a[_0x8345('0x5')]),_0x1d6cd8);}};exports[_0x8345('0x64')]=function(_0x343c0a){try{if(!_['isNil'](queues[_0x343c0a[_0x8345('0x5')]])){if(!_[_0x8345('0x1b')](queues[_0x343c0a[_0x8345('0x5')]][_0x8345('0x62')])){utils['debug'](util[_0x8345('0x3')](_0x8345('0x65'),_0x343c0a[_0x8345('0x5')]),_0x343c0a);queues[_0x343c0a[_0x8345('0x5')]][_0x8345('0x59')]+=utils[_0x8345('0x35')](utils[_0x8345('0x18')](),queues[_0x343c0a[_0x8345('0x5')]][_0x8345('0x62')]);utils[_0x8345('0x2')](util['format'](_0x8345('0x66'),_0x343c0a['uniqueid'],queues[_0x343c0a[_0x8345('0x5')]]['name'],queues[_0x343c0a['uniqueid']][_0x8345('0x59')]));delete queues[_0x343c0a[_0x8345('0x5')]][_0x8345('0x62')];}}}catch(_0x2dbfd6){utils[_0x8345('0x19')](util[_0x8345('0x3')](_0x8345('0x65'),_0x343c0a['uniqueid']),_0x2dbfd6);}}; \ No newline at end of file +var _0x7c35=['variable','queuestatus','toUpperCase','CONTINUE','queuecallerexitAt','queuecallerexitreason','value','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerabandonAt','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','queuecallerleave','diffTime','queuecallerleaveAt','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','membername','destaccountcode','[%s][queues][agentcomplete]','assigned','queuecallercompleteAt','transfer','TRANSFER','COMPLETEDBY','reason','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','blindtransfer','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','[%s][queues][attendedtransfer]','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfereruniqueid','origtransfererexten','ATTENDED','transfereelinkedid','queuecallerenterreason','calleridname','holdtime','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','clone','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstart]','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstop]','./utils','info','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','format','[%s][queues][queuecallerjoin]','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','[%s][queues][varset]'];(function(_0x8b8564,_0x162976){var _0x360c61=function(_0x164cc9){while(--_0x164cc9){_0x8b8564['push'](_0x8b8564['shift']());}};_0x360c61(++_0x162976);}(_0x7c35,0xab));var _0x57c3=function(_0x3b49d9,_0x56d7e6){_0x3b49d9=_0x3b49d9-0x0;var _0x51b418=_0x7c35[_0x3b49d9];return _0x51b418;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x57c3('0x0'));var queues={};function writeDB(_0x5ef0b0){utils[_0x57c3('0x1')](util['format']('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x5ef0b0[_0x57c3('0x2')],_0x5ef0b0[_0x57c3('0x3')],_0x5ef0b0['queue'],_0x5ef0b0[_0x57c3('0x4')],_0x5ef0b0[_0x57c3('0x5')],_0x5ef0b0[_0x57c3('0x6')],_0x5ef0b0['queuecallerexitreason']));if(_0x5ef0b0[_0x57c3('0x7')]){utils[_0x57c3('0x8')](_0x5ef0b0[_0x57c3('0x7')])[_0x57c3('0x9')](function(_0xa28f54){if(_0xa28f54){_0x5ef0b0['type']=_0xa28f54[_0x57c3('0xa')];}utils[_0x57c3('0xb')](_0x57c3('0xc'),_0x5ef0b0);});}else{utils[_0x57c3('0xb')](_0x57c3('0xc'),_0x5ef0b0);}if(_0x5ef0b0[_0x57c3('0xd')]){delete queues[_0x5ef0b0['transfereduniqueid']];}else{delete queues[_0x5ef0b0[_0x57c3('0x2')]];}}exports[_0x57c3('0xe')]=function(_0x425200){try{utils[_0x57c3('0xf')](util[_0x57c3('0x10')](_0x57c3('0x11'),_0x425200[_0x57c3('0x2')]),_0x425200);utils[_0x57c3('0x1')](util[_0x57c3('0x10')]('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0x425200['uniqueid'],_0x425200[_0x57c3('0x7')],_0x425200[_0x57c3('0x12')]));queues[_0x425200[_0x57c3('0x2')]]=_[_0x57c3('0x13')](_0x425200,{'originalposition':_0x425200['position'],'queuecallerjoinAt':utils[_0x57c3('0x14')](),'mohtime':0x0});}catch(_0x197c8a){utils[_0x57c3('0x15')](util[_0x57c3('0x10')]('[%s][queues][queuecallerjoin]',_0x425200[_0x57c3('0x2')]),_0x197c8a);}};exports[_0x57c3('0x16')]=function(_0xe5380a){try{if(!_[_0x57c3('0x17')](queues[_0xe5380a[_0x57c3('0x2')]])){utils[_0x57c3('0xf')](util[_0x57c3('0x10')](_0x57c3('0x18'),_0xe5380a[_0x57c3('0x2')]),_0xe5380a);if(queues[_0xe5380a[_0x57c3('0x2')]]['queuecallerleaveAt']){if(!queues[_0xe5380a[_0x57c3('0x2')]][_0x57c3('0x19')]&&!queues[_0xe5380a[_0x57c3('0x2')]][_0x57c3('0x1a')]){queues[_0xe5380a['uniqueid']][_0x57c3('0x1b')]=!![];queues[_0xe5380a[_0x57c3('0x2')]]['queuecallercompleteAt']=utils[_0x57c3('0x14')]();queues[_0xe5380a[_0x57c3('0x2')]]['queuecallerexitreason']=_0x57c3('0x1c');}utils[_0x57c3('0x1')](util[_0x57c3('0x10')](_0x57c3('0x1d'),_0xe5380a[_0x57c3('0x2')],queues[_0xe5380a[_0x57c3('0x2')]][_0x57c3('0x1e')],queues[_0xe5380a[_0x57c3('0x2')]]['queuecallerexitreason']));writeDB(queues[_0xe5380a[_0x57c3('0x2')]]);}else if(queues[_0xe5380a[_0x57c3('0x2')]][_0x57c3('0xd')]){utils[_0x57c3('0x1')](util[_0x57c3('0x10')](_0x57c3('0x1f'),_0xe5380a[_0x57c3('0x2')],queues[_0xe5380a[_0x57c3('0x2')]][_0x57c3('0x1e')],queues[_0xe5380a[_0x57c3('0x2')]][_0x57c3('0xd')]));queues[queues[_0xe5380a[_0x57c3('0x2')]][_0x57c3('0xd')]]=queues[_0xe5380a[_0x57c3('0x2')]];queues[queues[_0xe5380a[_0x57c3('0x2')]][_0x57c3('0xd')]]['queuecallerenterreason']=0x2;delete queues[_0xe5380a['uniqueid']];}}}catch(_0x10fc60){utils[_0x57c3('0x15')](util[_0x57c3('0x10')](_0x57c3('0x18'),_0xe5380a[_0x57c3('0x2')]),_0x10fc60);}};exports['varset']=function(_0x3c55c8){try{utils['debug'](util[_0x57c3('0x10')](_0x57c3('0x20'),_0x3c55c8[_0x57c3('0x2')]),_0x3c55c8);if(!_[_0x57c3('0x17')](_0x3c55c8[_0x57c3('0x21')][_0x57c3('0x22')])&&_0x3c55c8['value'][_0x57c3('0x23')]()!==_0x57c3('0x24')){if(!_[_0x57c3('0x17')](queues[_0x3c55c8[_0x57c3('0x2')]])){queues[_0x3c55c8[_0x57c3('0x2')]]['queuecallerabandon']=![];queues[_0x3c55c8[_0x57c3('0x2')]]['queuecallerabandonAt']=null;queues[_0x3c55c8[_0x57c3('0x2')]][_0x57c3('0x1a')]=!![];queues[_0x3c55c8[_0x57c3('0x2')]][_0x57c3('0x25')]=utils['now']();queues[_0x3c55c8['uniqueid']][_0x57c3('0x26')]=_0x3c55c8[_0x57c3('0x27')]['toUpperCase']();utils[_0x57c3('0x1')](util[_0x57c3('0x10')](_0x57c3('0x28'),_0x3c55c8[_0x57c3('0x2')],queues[_0x3c55c8[_0x57c3('0x2')]][_0x57c3('0x1e')],_0x3c55c8[_0x57c3('0x27')],queues[_0x3c55c8[_0x57c3('0x2')]]['queuecallerexitreason']));writeDB(queues[_0x3c55c8[_0x57c3('0x2')]]);}}else if(!_[_0x57c3('0x17')](_0x3c55c8[_0x57c3('0x21')][_0x57c3('0x29')])){if(!_[_0x57c3('0x17')](queues[_0x3c55c8['uniqueid']])&&!queues[_0x3c55c8[_0x57c3('0x2')]][_0x57c3('0x19')]){queues[_0x3c55c8['uniqueid']][_0x57c3('0x19')]=![];queues[_0x3c55c8[_0x57c3('0x2')]]['queuecallerabandonAt']=null;queues[_0x3c55c8['uniqueid']][_0x57c3('0x1a')]=!![];queues[_0x3c55c8['uniqueid']]['queuecallerexitAt']=utils[_0x57c3('0x14')]();queues[_0x3c55c8[_0x57c3('0x2')]][_0x57c3('0x26')]=_0x57c3('0x2a');utils['info'](util[_0x57c3('0x10')](_0x57c3('0x2b'),_0x3c55c8[_0x57c3('0x2')],queues[_0x3c55c8[_0x57c3('0x2')]][_0x57c3('0x1e')],_0x3c55c8[_0x57c3('0x27')],queues[_0x3c55c8[_0x57c3('0x2')]][_0x57c3('0x26')]));}}}catch(_0x1fc340){utils['error'](util[_0x57c3('0x10')]('[%s][queues][varset]',_0x3c55c8[_0x57c3('0x2')]),_0x1fc340);}};exports[_0x57c3('0x19')]=function(_0x373353){try{if(!_[_0x57c3('0x17')](queues[_0x373353[_0x57c3('0x2')]])){utils[_0x57c3('0xf')](util[_0x57c3('0x10')](_0x57c3('0x2c'),_0x373353[_0x57c3('0x2')]),_0x373353);queues[_0x373353[_0x57c3('0x2')]][_0x57c3('0x1a')]=![];queues[_0x373353[_0x57c3('0x2')]]['queuecallerexitAt']=null;queues[_0x373353[_0x57c3('0x2')]][_0x57c3('0x19')]=!![];queues[_0x373353['uniqueid']][_0x57c3('0x2d')]=utils[_0x57c3('0x14')]();queues[_0x373353[_0x57c3('0x2')]][_0x57c3('0x26')]='ABANDONED';utils[_0x57c3('0x1')](util[_0x57c3('0x10')](_0x57c3('0x2e'),_0x373353['uniqueid'],queues[_0x373353[_0x57c3('0x2')]][_0x57c3('0x1e')],queues[_0x373353[_0x57c3('0x2')]][_0x57c3('0x26')]));}}catch(_0x33bad9){utils[_0x57c3('0x15')](util[_0x57c3('0x10')](_0x57c3('0x2c'),_0x373353[_0x57c3('0x2')]),_0x33bad9);}};exports['queuecallerleave']=function(_0x4ce671){try{if(!_[_0x57c3('0x17')](queues[_0x4ce671[_0x57c3('0x2')]])){utils[_0x57c3('0xf')](util[_0x57c3('0x10')](_0x57c3('0x2f'),_0x4ce671[_0x57c3('0x2')]),_0x4ce671);utils['info'](util[_0x57c3('0x10')](_0x57c3('0x30'),_0x4ce671[_0x57c3('0x2')],queues[_0x4ce671[_0x57c3('0x2')]][_0x57c3('0x1e')],_0x4ce671['connectedlinenum'],_0x4ce671['connectedlinename']));queues[_0x4ce671[_0x57c3('0x2')]][_0x57c3('0x31')]=!![];queues[_0x4ce671[_0x57c3('0x2')]]['queuecallerleaveAt']=utils[_0x57c3('0x14')]();queues[_0x4ce671['uniqueid']]['holdtime']=utils[_0x57c3('0x32')](queues[_0x4ce671['uniqueid']][_0x57c3('0x33')],queues[_0x4ce671[_0x57c3('0x2')]][_0x57c3('0x34')]);queues[_0x4ce671[_0x57c3('0x2')]][_0x57c3('0x12')]=_0x4ce671['position'];queues[_0x4ce671[_0x57c3('0x2')]][_0x57c3('0x35')]=_0x4ce671[_0x57c3('0x35')];queues[_0x4ce671[_0x57c3('0x2')]]['connectedlinenum']=_0x4ce671['connectedlinenum'];queues[_0x4ce671[_0x57c3('0x2')]]['connectedlinename']=_0x4ce671[_0x57c3('0x36')];}}catch(_0x6705f){utils['error'](util[_0x57c3('0x10')](_0x57c3('0x2f'),_0x4ce671[_0x57c3('0x2')]),_0x6705f);}};exports[_0x57c3('0x37')]=function(_0x270d14){try{if(!_[_0x57c3('0x17')](queues[_0x270d14['uniqueid']])){utils[_0x57c3('0xf')](util[_0x57c3('0x10')](_0x57c3('0x38'),_0x270d14[_0x57c3('0x2')]),_0x270d14);utils['info'](util[_0x57c3('0x10')]('[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s',_0x270d14['uniqueid'],queues[_0x270d14['uniqueid']]['name'],_0x270d14[_0x57c3('0x39')],_0x270d14[_0x57c3('0x3a')]));queues[_0x270d14[_0x57c3('0x2')]]['queuecallerabandon']=![];queues[_0x270d14[_0x57c3('0x2')]][_0x57c3('0x19')]=![];queues[_0x270d14[_0x57c3('0x2')]][_0x57c3('0x2d')]=null;queues[_0x270d14[_0x57c3('0x2')]][_0x57c3('0x1a')]=![];queues[_0x270d14[_0x57c3('0x2')]][_0x57c3('0x26')]=null;queues[_0x270d14[_0x57c3('0x2')]][_0x57c3('0x25')]=null;queues[_0x270d14[_0x57c3('0x2')]]['assigned']=!![];queues[_0x270d14[_0x57c3('0x2')]][_0x57c3('0x6')]=_0x270d14['destaccountcode'];queues[_0x270d14[_0x57c3('0x2')]]['lastAssignedTo']=_0x270d14['membername'];}}catch(_0x518d45){utils[_0x57c3('0x15')](util[_0x57c3('0x10')](_0x57c3('0x38'),_0x270d14['uniqueid']),_0x518d45);}};exports['agentcomplete']=function(_0x1b2df0){try{if(!_[_0x57c3('0x17')](queues[_0x1b2df0[_0x57c3('0x2')]])){if(queues[_0x1b2df0[_0x57c3('0x2')]][_0x57c3('0x33')]){utils['debug'](util[_0x57c3('0x10')](_0x57c3('0x3b'),_0x1b2df0[_0x57c3('0x2')]),_0x1b2df0);queues[_0x1b2df0[_0x57c3('0x2')]]['queuecallerabandon']=![];queues[_0x1b2df0['uniqueid']][_0x57c3('0x19')]=![];queues[_0x1b2df0['uniqueid']]['queuecallerabandonAt']=null;queues[_0x1b2df0[_0x57c3('0x2')]][_0x57c3('0x1a')]=![];queues[_0x1b2df0[_0x57c3('0x2')]][_0x57c3('0x25')]=null;queues[_0x1b2df0[_0x57c3('0x2')]][_0x57c3('0x3c')]=!![];queues[_0x1b2df0[_0x57c3('0x2')]][_0x57c3('0x4')]=_0x1b2df0[_0x57c3('0x39')];queues[_0x1b2df0[_0x57c3('0x2')]]['queuecallercomplete']=!![];queues[_0x1b2df0[_0x57c3('0x2')]][_0x57c3('0x3d')]=utils[_0x57c3('0x14')]();if(_0x1b2df0['reason']==_0x57c3('0x3e')){if(!queues[_0x1b2df0[_0x57c3('0x2')]][_0x57c3('0x3e')]){queues[_0x1b2df0['uniqueid']][_0x57c3('0x26')]=_0x57c3('0x3f');}}else{queues[_0x1b2df0[_0x57c3('0x2')]][_0x57c3('0x26')]=_0x57c3('0x40')+_0x1b2df0[_0x57c3('0x41')][_0x57c3('0x23')]();}utils[_0x57c3('0x1')](util[_0x57c3('0x10')](_0x57c3('0x42'),_0x1b2df0[_0x57c3('0x2')],queues[_0x1b2df0[_0x57c3('0x2')]][_0x57c3('0x1e')],_0x1b2df0[_0x57c3('0x39')],queues[_0x1b2df0[_0x57c3('0x2')]][_0x57c3('0x26')]));writeDB(queues[_0x1b2df0[_0x57c3('0x2')]]);}}}catch(_0x4dca89){utils[_0x57c3('0x15')](util[_0x57c3('0x10')](_0x57c3('0x3b'),_0x1b2df0[_0x57c3('0x2')]),_0x4dca89);}};exports[_0x57c3('0x43')]=function(_0x29f99c){try{if(!_[_0x57c3('0x17')](queues[_0x29f99c[_0x57c3('0x44')]])){utils[_0x57c3('0xf')](util[_0x57c3('0x10')]('[%s][queues][blindtransfer]',_0x29f99c[_0x57c3('0x2')]),_0x29f99c);queues[_0x29f99c[_0x57c3('0x44')]][_0x57c3('0x3e')]=!![];queues[_0x29f99c[_0x57c3('0x44')]][_0x57c3('0x45')]='BLIND';queues[_0x29f99c[_0x57c3('0x44')]][_0x57c3('0x46')]=_0x29f99c[_0x57c3('0x47')];queues[_0x29f99c[_0x57c3('0x44')]][_0x57c3('0x48')]=_0x29f99c['transfereeuniqueid'];queues[_0x29f99c[_0x57c3('0x44')]][_0x57c3('0x26')]=_0x57c3('0x49');utils[_0x57c3('0x1')](util[_0x57c3('0x10')](_0x57c3('0x4a'),_0x29f99c['uniqueid'],queues[_0x29f99c[_0x57c3('0x44')]][_0x57c3('0x1e')],_0x29f99c[_0x57c3('0x44')],_0x29f99c[_0x57c3('0x47')]));}}catch(_0x25ae56){utils['error'](util[_0x57c3('0x10')](_0x57c3('0x4b'),_0x29f99c[_0x57c3('0x2')]),_0x25ae56);}};exports['attendedtransfer']=function(_0x11a7a7){try{utils[_0x57c3('0xf')](util[_0x57c3('0x10')](_0x57c3('0x4c'),_0x11a7a7['origtransfereruniqueid']),_0x11a7a7);if(_0x11a7a7['origtransfereruniqueid']==_0x11a7a7[_0x57c3('0x4d')]){if(!_[_0x57c3('0x17')](queues[_0x11a7a7[_0x57c3('0x4e')]])){utils['info'](util['format'](_0x57c3('0x4f'),_0x11a7a7[_0x57c3('0x50')],queues[_0x11a7a7[_0x57c3('0x4e')]][_0x57c3('0x1e')],_0x11a7a7[_0x57c3('0x51')]));queues[_0x11a7a7[_0x57c3('0x4e')]][_0x57c3('0x3e')]=!![];queues[_0x11a7a7['secondtransfererlinkedid']][_0x57c3('0x45')]=_0x57c3('0x52');queues[_0x11a7a7[_0x57c3('0x4e')]][_0x57c3('0x46')]=_0x11a7a7[_0x57c3('0x51')];queues[_0x11a7a7[_0x57c3('0x4e')]][_0x57c3('0x48')]=_0x11a7a7[_0x57c3('0x50')];queues[_0x11a7a7[_0x57c3('0x4e')]][_0x57c3('0x26')]='ATTENDEDTRANSFER';}if(!_[_0x57c3('0x17')](queues[_0x11a7a7['origtransfererlinkedid']])){if(_0x11a7a7[_0x57c3('0x53')]&&queues[_0x11a7a7['transfereelinkedid']]){queues[_0x11a7a7['transfereelinkedid']][_0x57c3('0x54')]=0x1;queues[_0x11a7a7[_0x57c3('0x44')]]=_['clone'](queues[_0x11a7a7[_0x57c3('0x53')]]);queues[_0x11a7a7[_0x57c3('0x44')]]['transfereduniqueid']=_0x11a7a7['transfertargetuniqueid'];queues[_0x11a7a7[_0x57c3('0x44')]][_0x57c3('0x54')]=0x2;queues[_0x11a7a7[_0x57c3('0x44')]]['calleridnum']=queues[_0x11a7a7[_0x57c3('0x4e')]][_0x57c3('0x5')];queues[_0x11a7a7['transfereeuniqueid']][_0x57c3('0x55')]=queues[_0x11a7a7[_0x57c3('0x4e')]][_0x57c3('0x55')];queues[_0x11a7a7['transfereeuniqueid']][_0x57c3('0x34')]=utils[_0x57c3('0x14')]();queues[_0x11a7a7['transfereeuniqueid']]['queuecallerleaveAt']=utils[_0x57c3('0x14')]();queues[_0x11a7a7['transfereeuniqueid']][_0x57c3('0x56')]=0x0;queues[_0x11a7a7[_0x57c3('0x44')]][_0x57c3('0x57')]=0x0;utils[_0x57c3('0x1')](util[_0x57c3('0x10')](_0x57c3('0x58'),_0x11a7a7['origtransfereruniqueid'],queues[_0x11a7a7[_0x57c3('0x44')]][_0x57c3('0x1e')],queues[_0x11a7a7[_0x57c3('0x44')]]['calleridnum'],queues[_0x11a7a7[_0x57c3('0x44')]][_0x57c3('0x55')]));}else{utils['info'](util[_0x57c3('0x10')](_0x57c3('0x59'),_0x11a7a7[_0x57c3('0x50')],queues[_0x11a7a7['origtransfererlinkedid']][_0x57c3('0x1e')],_0x11a7a7[_0x57c3('0x4e')]));queues[_0x11a7a7[_0x57c3('0x4d')]][_0x57c3('0xd')]=_0x11a7a7[_0x57c3('0x4e')];}}}else if(_0x11a7a7[_0x57c3('0x5a')]==_0x11a7a7[_0x57c3('0x4e')]){if(!_[_0x57c3('0x17')](queues[_0x11a7a7[_0x57c3('0x4d')]])){utils[_0x57c3('0x1')](util[_0x57c3('0x10')](_0x57c3('0x5b'),_0x11a7a7['origtransfereruniqueid'],queues[_0x11a7a7[_0x57c3('0x4d')]][_0x57c3('0x1e')],_0x11a7a7['secondtransfereruniqueid'],_0x11a7a7['secondtransfererexten']));queues[_0x11a7a7['origtransfererlinkedid']]['transfer']=!![];queues[_0x11a7a7['origtransfererlinkedid']][_0x57c3('0x45')]='ATTENDED';queues[_0x11a7a7[_0x57c3('0x4d')]][_0x57c3('0x46')]=_0x11a7a7[_0x57c3('0x5c')];queues[_0x11a7a7[_0x57c3('0x4d')]][_0x57c3('0x48')]=_0x11a7a7[_0x57c3('0x5a')];queues[_0x11a7a7['origtransfererlinkedid']][_0x57c3('0x26')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x11a7a7[_0x57c3('0x4e')]])){if(_0x11a7a7[_0x57c3('0x5d')]&&queues[_0x11a7a7[_0x57c3('0x5d')]]){queues[_0x11a7a7['transfertargetlinkedid']][_0x57c3('0x54')]=0x1;queues[_0x11a7a7['transfertargetuniqueid']]=_[_0x57c3('0x5e')](queues[_0x11a7a7[_0x57c3('0x5d')]]);queues[_0x11a7a7[_0x57c3('0x5f')]][_0x57c3('0xd')]=_0x11a7a7[_0x57c3('0x5f')];queues[_0x11a7a7[_0x57c3('0x5f')]]['queuecallerenterreason']=0x2;queues[_0x11a7a7[_0x57c3('0x5f')]][_0x57c3('0x5')]=queues[_0x11a7a7[_0x57c3('0x4d')]][_0x57c3('0x5')];queues[_0x11a7a7['transfertargetuniqueid']][_0x57c3('0x55')]=queues[_0x11a7a7[_0x57c3('0x4d')]]['calleridname'];queues[_0x11a7a7[_0x57c3('0x5f')]][_0x57c3('0x34')]=utils['now']();queues[_0x11a7a7[_0x57c3('0x5f')]][_0x57c3('0x33')]=utils['now']();queues[_0x11a7a7[_0x57c3('0x5f')]]['holdtime']=0x0;queues[_0x11a7a7[_0x57c3('0x5f')]]['mohtime']=0x0;utils[_0x57c3('0x1')](util[_0x57c3('0x10')](_0x57c3('0x60'),_0x11a7a7[_0x57c3('0x50')],queues[_0x11a7a7[_0x57c3('0x5f')]][_0x57c3('0x1e')],queues[_0x11a7a7[_0x57c3('0x5f')]][_0x57c3('0xd')],queues[_0x11a7a7[_0x57c3('0x5f')]][_0x57c3('0x5')],queues[_0x11a7a7[_0x57c3('0x5f')]][_0x57c3('0x55')]));}else{utils[_0x57c3('0x1')](util[_0x57c3('0x10')](_0x57c3('0x59'),_0x11a7a7[_0x57c3('0x50')],queues[_0x11a7a7[_0x57c3('0x4e')]][_0x57c3('0x1e')],_0x11a7a7['origtransfererlinkedid']));queues[_0x11a7a7[_0x57c3('0x4e')]]['transfereduniqueid']=_0x11a7a7[_0x57c3('0x4d')];}}}}catch(_0x210664){utils[_0x57c3('0x15')](util['format'](_0x57c3('0x4c'),_0x11a7a7[_0x57c3('0x50')]),_0x210664);}};exports[_0x57c3('0x61')]=function(_0x5719d8){try{if(!_['isNil'](queues[_0x5719d8['uniqueid']])){utils['debug'](util[_0x57c3('0x10')](_0x57c3('0x62'),_0x5719d8[_0x57c3('0x2')]),_0x5719d8);queues[_0x5719d8[_0x57c3('0x2')]][_0x57c3('0x63')]=utils[_0x57c3('0x14')]();utils['info'](util[_0x57c3('0x10')](_0x57c3('0x64'),_0x5719d8[_0x57c3('0x2')],queues[_0x5719d8[_0x57c3('0x2')]]['name'],queues[_0x5719d8[_0x57c3('0x2')]][_0x57c3('0x63')]));}}catch(_0x2425dc){utils[_0x57c3('0x15')](util[_0x57c3('0x10')](_0x57c3('0x62'),_0x5719d8[_0x57c3('0x2')]),_0x2425dc);}};exports['musiconholdstop']=function(_0x5cab91){try{if(!_[_0x57c3('0x17')](queues[_0x5cab91[_0x57c3('0x2')]])){if(!_[_0x57c3('0x17')](queues[_0x5cab91[_0x57c3('0x2')]]['musiconholdstartAt'])){utils[_0x57c3('0xf')](util[_0x57c3('0x10')](_0x57c3('0x65'),_0x5cab91[_0x57c3('0x2')]),_0x5cab91);queues[_0x5cab91['uniqueid']]['mohtime']+=utils[_0x57c3('0x32')](utils[_0x57c3('0x14')](),queues[_0x5cab91[_0x57c3('0x2')]][_0x57c3('0x63')]);utils['info'](util[_0x57c3('0x10')]('[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s',_0x5cab91[_0x57c3('0x2')],queues[_0x5cab91[_0x57c3('0x2')]][_0x57c3('0x1e')],queues[_0x5cab91[_0x57c3('0x2')]]['mohtime']));delete queues[_0x5cab91[_0x57c3('0x2')]][_0x57c3('0x63')];}}}catch(_0x5ebbf5){utils[_0x57c3('0x15')](util[_0x57c3('0x10')](_0x57c3('0x65'),_0x5cab91[_0x57c3('0x2')]),_0x5ebbf5);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index fe741a4..b19e5e5 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 _0x00e1=['exten','context','channel','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','error','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.wav49','.WAV','find','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','calleridname','cause-txt','connectedlinenum','connectedlinename','type','outbound','clone','newexten','[%s][recordings][newexten]','application','startsWith','toLowerCase','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','[%s][recordings][writeDB]','blinds','uniqueid','accountcode','getUserByInternal','UserId','request','CreateVoiceRecording','newchannel','debug','format','[%s][recordings][newchannel]','linkedid'];(function(_0x1bcc18,_0x375344){var _0x5e942a=function(_0x1f5210){while(--_0x1f5210){_0x1bcc18['push'](_0x1bcc18['shift']());}};_0x5e942a(++_0x375344);}(_0x00e1,0x142));var _0x100e=function(_0x4f9693,_0x13f8c6){_0x4f9693=_0x4f9693-0x0;var _0x4c03b3=_0x00e1[_0x4f9693];return _0x4c03b3;};'use strict';var _=require(_0x100e('0x0'));var util=require(_0x100e('0x1'));var utils=require(_0x100e('0x2'));var transfers=require(_0x100e('0x3'));var recordings={};function writeDB(_0x5565ff){var _0x1f3f67;utils[_0x100e('0x4')](util['format'](_0x100e('0x5'),_0x5565ff['uniqueid']));if(transfers[_0x100e('0x6')][_0x5565ff[_0x100e('0x7')]]){_0x1f3f67=_0x5565ff[_0x100e('0x7')];_0x5565ff['uniqueid']=transfers[_0x100e('0x6')][_0x5565ff[_0x100e('0x7')]]['transfereeuniqueid'];}if(_0x5565ff[_0x100e('0x8')]){utils[_0x100e('0x9')](_0x5565ff[_0x100e('0x8')])['then'](function(_0x4e6969){if(_0x4e6969){_0x5565ff['membername']=_0x4e6969['name'];_0x5565ff[_0x100e('0xa')]=_0x4e6969['id'];}utils[_0x100e('0xb')](_0x100e('0xc'),_0x5565ff);});}else{utils[_0x100e('0xb')](_0x100e('0xc'),_0x5565ff);}if(_0x1f3f67)delete transfers[_0x100e('0x6')][_0x1f3f67];}exports[_0x100e('0xd')]=function(_0x582f4e){try{utils[_0x100e('0xe')](util[_0x100e('0xf')](_0x100e('0x10'),_0x582f4e['uniqueid']),_0x582f4e);if(_0x582f4e[_0x100e('0x7')]==_0x582f4e[_0x100e('0x11')]){utils['info'](util[_0x100e('0xf')]('[%s][recordings][newchannel]\x20context:%s\x20exten:%s',_0x582f4e[_0x100e('0x7')],_0x582f4e['context'],_0x582f4e[_0x100e('0x12')]));recordings[_0x582f4e[_0x100e('0x7')]]={'uniqueid':_0x582f4e['uniqueid'],'accountcode':_0x582f4e[_0x100e('0x8')],'exten':_0x582f4e[_0x100e('0x12')],'context':_0x582f4e[_0x100e('0x13')],'channel':_0x582f4e[_0x100e('0x14')],'monitors':[]};}}catch(_0x1801ba){utils['error'](util[_0x100e('0xf')]('[%s][recordings][newchannel]',_0x582f4e[_0x100e('0x7')]),_0x1801ba);}};exports['newstate']=function(_0x37a50c){try{utils['debug'](util[_0x100e('0xf')](_0x100e('0x15'),_0x37a50c['uniqueid']),_0x37a50c);if(!_[_0x100e('0x16')](recordings[_0x37a50c[_0x100e('0x7')]])&&_0x37a50c[_0x100e('0x17')]==0x6){utils[_0x100e('0x4')](util[_0x100e('0xf')](_0x100e('0x18'),_0x37a50c[_0x100e('0x7')],_0x37a50c[_0x100e('0x13')],_0x37a50c[_0x100e('0x14')]));}else if(!_[_0x100e('0x16')](recordings[_0x37a50c['linkedid']])&&_0x37a50c[_0x100e('0x17')]==0x6&&_0x37a50c[_0x100e('0x13')]!='transfer'){utils[_0x100e('0x4')](util['format']('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x37a50c[_0x100e('0x7')],_0x37a50c[_0x100e('0x11')],_0x37a50c[_0x100e('0x13')],_0x37a50c[_0x100e('0x14')]));recordings[_0x37a50c[_0x100e('0x11')]][_0x100e('0x8')]=_0x37a50c[_0x100e('0x8')];}}catch(_0x50d4bd){utils[_0x100e('0x19')](util['format'](_0x100e('0x15'),_0x37a50c[_0x100e('0x7')]),_0x50d4bd);}};exports[_0x100e('0x1a')]=function(_0x5e9f1c){try{if(!_[_0x100e('0x16')](_0x5e9f1c[_0x100e('0x1b')])&&!_[_0x100e('0x16')](_0x5e9f1c[_0x100e('0x1b')][_0x100e('0x1c')])){utils[_0x100e('0xe')](util[_0x100e('0xf')](_0x100e('0x1d'),_0x5e9f1c[_0x100e('0x7')]),_0x5e9f1c);utils[_0x100e('0x4')](util[_0x100e('0xf')](_0x100e('0x1e'),_0x5e9f1c[_0x100e('0x7')],_0x5e9f1c[_0x100e('0x1b')],_0x5e9f1c[_0x100e('0x1f')]));if(_[_0x100e('0x20')](_0x5e9f1c[_0x100e('0x1f')],'.wav49')){_0x5e9f1c[_0x100e('0x1f')]=_0x5e9f1c[_0x100e('0x1f')][_0x100e('0x21')](_0x100e('0x22'),_0x100e('0x23'));}if(recordings[_0x5e9f1c['linkedid']]){var _0x3e02ae=_[_0x100e('0x24')](recordings[_0x5e9f1c['linkedid']][_0x100e('0x25')],{'value':_0x5e9f1c[_0x100e('0x1f')]});if(_[_0x100e('0x16')](_0x3e02ae)){recordings[_0x5e9f1c[_0x100e('0x11')]]['monitors'][_0x100e('0x26')]({'value':_0x5e9f1c[_0x100e('0x1f')]});}}}}catch(_0x2d74f3){utils[_0x100e('0x19')](util[_0x100e('0xf')](_0x100e('0x1d'),_0x5e9f1c[_0x100e('0x7')]),_0x2d74f3);}};exports[_0x100e('0x27')]=function(_0x9b2328){try{if(!_[_0x100e('0x16')](recordings[_0x9b2328[_0x100e('0x7')]])){utils[_0x100e('0xe')](util[_0x100e('0xf')](_0x100e('0x28'),_0x9b2328[_0x100e('0x7')]),_0x9b2328);utils[_0x100e('0x4')](util[_0x100e('0xf')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x9b2328[_0x100e('0x7')],_0x9b2328[_0x100e('0x29')],_0x9b2328[_0x100e('0x2a')],_0x9b2328[_0x100e('0x2b')]));recordings[_0x9b2328[_0x100e('0x7')]]['calleridnum']=_0x9b2328[_0x100e('0x29')];recordings[_0x9b2328['uniqueid']]['calleridname']=_0x9b2328[_0x100e('0x2a')];recordings[_0x9b2328['uniqueid']][_0x100e('0x2c')]=_0x9b2328[_0x100e('0x2c')];recordings[_0x9b2328['uniqueid']][_0x100e('0x2d')]=_0x9b2328[_0x100e('0x2d')];if(recordings[_0x9b2328['uniqueid']][_0x100e('0x2e')]==_0x100e('0x2f')&&recordings[_0x9b2328[_0x100e('0x7')]]['accountcode']){recordings[_0x9b2328[_0x100e('0x7')]][_0x100e('0x2c')]=recordings[_0x9b2328[_0x100e('0x7')]][_0x100e('0x8')];recordings[_0x9b2328[_0x100e('0x7')]]['connectedlinename']='';}recordings[_0x9b2328[_0x100e('0x7')]][_0x100e('0x25')]['forEach'](function(_0x3a2065){var _0x1ca810=_[_0x100e('0x30')](recordings[_0x9b2328[_0x100e('0x7')]]);_0x1ca810[_0x100e('0x1f')]=_0x3a2065[_0x100e('0x1f')];writeDB(_0x1ca810);});delete recordings[_0x9b2328[_0x100e('0x7')]];}}catch(_0x3e0134){utils[_0x100e('0x19')](util[_0x100e('0xf')](_0x100e('0x28'),_0x9b2328['uniqueid']),_0x3e0134);}};exports[_0x100e('0x31')]=function(_0x592c17){try{if(!_[_0x100e('0x16')](recordings[_0x592c17[_0x100e('0x7')]])){utils['debug'](util['format'](_0x100e('0x32'),_0x592c17[_0x100e('0x7')]),_0x592c17);utils['info'](util[_0x100e('0xf')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x592c17['uniqueid'],_0x592c17[_0x100e('0x33')],_0x592c17['appdata']));if(_0x592c17[_0x100e('0x33')]['toLowerCase']()=='set'&&_[_0x100e('0x34')](_0x592c17['appdata'][_0x100e('0x35')](),_0x100e('0x36'))){var _0x57ed1e=_0x592c17['appdata'][_0x100e('0x37')]('=');var _0x46be55=_0x57ed1e[0x0]['substring'](_0x57ed1e[0x0]['lastIndexOf']('(')+0x1,_0x57ed1e[0x0][_0x100e('0x38')](')'));var _0x4966aa=_0x57ed1e[0x1];recordings[_0x592c17[_0x100e('0x7')]][_0x46be55]=_0x4966aa;}}}catch(_0x5e041e){utils[_0x100e('0x19')](util[_0x100e('0xf')](_0x100e('0x32'),_0x592c17[_0x100e('0x7')]),_0x5e041e);}};exports[_0x100e('0x39')]=function(_0x355503){try{if(!_[_0x100e('0x16')](recordings[_0x355503[_0x100e('0x7')]])){utils[_0x100e('0xe')](util[_0x100e('0xf')](_0x100e('0x3a'),_0x355503[_0x100e('0x7')]),_0x355503);utils[_0x100e('0x4')](util[_0x100e('0xf')](_0x100e('0x3b'),_0x355503[_0x100e('0x7')],_0x355503[_0x100e('0x3c')]));recordings[_0x355503['uniqueid']]['queue']=_0x355503[_0x100e('0x3c')];}}catch(_0x3f4752){utils[_0x100e('0x19')](util[_0x100e('0xf')](_0x100e('0x3a'),_0x355503['uniqueid']),_0x3f4752);}};exports[_0x100e('0x3d')]=function(_0x239e3e){try{utils[_0x100e('0xe')](util[_0x100e('0xf')](_0x100e('0x3e'),_0x239e3e[_0x100e('0x7')]),_0x239e3e);utils[_0x100e('0x4')](util['format']('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x239e3e[_0x100e('0x7')],_0x239e3e[_0x100e('0x3f')],_0x239e3e[_0x100e('0x40')],_0x239e3e[_0x100e('0x41')],_0x239e3e['transfereecalleridname']));if(recordings[_0x239e3e[_0x100e('0x42')]]&&transfers[_0x100e('0x6')][_0x239e3e[_0x100e('0x42')]]){transfers[_0x100e('0x6')][_0x239e3e[_0x100e('0x42')]][_0x100e('0x43')]=!![];}}catch(_0xfb01f4){utils['error'](util[_0x100e('0xf')](_0x100e('0x3e'),_0x239e3e[_0x100e('0x7')]),_0xfb01f4);}}; \ No newline at end of file +var _0x44a4=['appdata','toLowerCase','set','startsWith','split','substring','lastIndexOf','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','transfereruniqueid','lodash','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','name','UserId','CreateVoiceRecording','newchannel','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','error','newstate','debug','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channel','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','.wav49','replace','find','monitors','push','hangup','[%s][recordings][hangup]','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridname','cause-txt','calleridnum','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','application'];(function(_0x4f8d61,_0x29eff0){var _0x3bc078=function(_0x4c7203){while(--_0x4c7203){_0x4f8d61['push'](_0x4f8d61['shift']());}};_0x3bc078(++_0x29eff0);}(_0x44a4,0xa2));var _0x444a=function(_0x25fcc8,_0xecf8ab){_0x25fcc8=_0x25fcc8-0x0;var _0x3575c5=_0x44a4[_0x25fcc8];return _0x3575c5;};'use strict';var _=require(_0x444a('0x0'));var util=require(_0x444a('0x1'));var utils=require(_0x444a('0x2'));var transfers=require(_0x444a('0x3'));var recordings={};function writeDB(_0x3fd677){var _0x1a36d6;utils[_0x444a('0x4')](util[_0x444a('0x5')](_0x444a('0x6'),_0x3fd677['uniqueid']));if(transfers[_0x444a('0x7')][_0x3fd677[_0x444a('0x8')]]){_0x1a36d6=_0x3fd677[_0x444a('0x8')];_0x3fd677['uniqueid']=transfers[_0x444a('0x7')][_0x3fd677[_0x444a('0x8')]][_0x444a('0x9')];}if(_0x3fd677[_0x444a('0xa')]){utils[_0x444a('0xb')](_0x3fd677[_0x444a('0xa')])[_0x444a('0xc')](function(_0x554c23){if(_0x554c23){_0x3fd677['membername']=_0x554c23[_0x444a('0xd')];_0x3fd677[_0x444a('0xe')]=_0x554c23['id'];}utils['request'](_0x444a('0xf'),_0x3fd677);});}else{utils['request']('CreateVoiceRecording',_0x3fd677);}if(_0x1a36d6)delete transfers[_0x444a('0x7')][_0x1a36d6];}exports[_0x444a('0x10')]=function(_0x532a39){try{utils['debug'](util['format'](_0x444a('0x11'),_0x532a39['uniqueid']),_0x532a39);if(_0x532a39[_0x444a('0x8')]==_0x532a39[_0x444a('0x12')]){utils['info'](util[_0x444a('0x5')](_0x444a('0x13'),_0x532a39[_0x444a('0x8')],_0x532a39['context'],_0x532a39['exten']));recordings[_0x532a39[_0x444a('0x8')]]={'uniqueid':_0x532a39[_0x444a('0x8')],'accountcode':_0x532a39[_0x444a('0xa')],'exten':_0x532a39[_0x444a('0x14')],'context':_0x532a39[_0x444a('0x15')],'channel':_0x532a39['channel'],'monitors':[]};}}catch(_0x5d5e20){utils[_0x444a('0x16')](util[_0x444a('0x5')]('[%s][recordings][newchannel]',_0x532a39[_0x444a('0x8')]),_0x5d5e20);}};exports[_0x444a('0x17')]=function(_0x53dd82){try{utils[_0x444a('0x18')](util['format'](_0x444a('0x19'),_0x53dd82[_0x444a('0x8')]),_0x53dd82);if(!_[_0x444a('0x1a')](recordings[_0x53dd82[_0x444a('0x8')]])&&_0x53dd82[_0x444a('0x1b')]==0x6){utils[_0x444a('0x4')](util[_0x444a('0x5')](_0x444a('0x1c'),_0x53dd82[_0x444a('0x8')],_0x53dd82[_0x444a('0x15')],_0x53dd82[_0x444a('0x1d')]));}else if(!_[_0x444a('0x1a')](recordings[_0x53dd82[_0x444a('0x12')]])&&_0x53dd82[_0x444a('0x1b')]==0x6&&_0x53dd82[_0x444a('0x15')]!='transfer'){utils[_0x444a('0x4')](util[_0x444a('0x5')](_0x444a('0x1e'),_0x53dd82[_0x444a('0x8')],_0x53dd82[_0x444a('0x12')],_0x53dd82[_0x444a('0x15')],_0x53dd82['channel']));recordings[_0x53dd82[_0x444a('0x12')]][_0x444a('0xa')]=_0x53dd82['accountcode'];}}catch(_0x3c7641){utils[_0x444a('0x16')](util[_0x444a('0x5')](_0x444a('0x19'),_0x53dd82['uniqueid']),_0x3c7641);}};exports['varset']=function(_0x2662c0){try{if(!_['isNil'](_0x2662c0[_0x444a('0x1f')])&&!_[_0x444a('0x1a')](_0x2662c0['variable'][_0x444a('0x20')])){utils[_0x444a('0x18')](util['format'](_0x444a('0x21'),_0x2662c0[_0x444a('0x8')]),_0x2662c0);utils[_0x444a('0x4')](util[_0x444a('0x5')](_0x444a('0x22'),_0x2662c0['uniqueid'],_0x2662c0[_0x444a('0x1f')],_0x2662c0[_0x444a('0x23')]));if(_[_0x444a('0x24')](_0x2662c0[_0x444a('0x23')],_0x444a('0x25'))){_0x2662c0[_0x444a('0x23')]=_0x2662c0[_0x444a('0x23')][_0x444a('0x26')]('.wav49','.WAV');}if(recordings[_0x2662c0[_0x444a('0x12')]]){var _0xfc3f10=_[_0x444a('0x27')](recordings[_0x2662c0['linkedid']]['monitors'],{'value':_0x2662c0[_0x444a('0x23')]});if(_[_0x444a('0x1a')](_0xfc3f10)){recordings[_0x2662c0[_0x444a('0x12')]][_0x444a('0x28')][_0x444a('0x29')]({'value':_0x2662c0['value']});}}}}catch(_0x47475f){utils[_0x444a('0x16')](util[_0x444a('0x5')](_0x444a('0x21'),_0x2662c0[_0x444a('0x8')]),_0x47475f);}};exports[_0x444a('0x2a')]=function(_0x5467d5){try{if(!_[_0x444a('0x1a')](recordings[_0x5467d5[_0x444a('0x8')]])){utils[_0x444a('0x18')](util[_0x444a('0x5')](_0x444a('0x2b'),_0x5467d5[_0x444a('0x8')]),_0x5467d5);utils[_0x444a('0x4')](util[_0x444a('0x5')](_0x444a('0x2c'),_0x5467d5[_0x444a('0x8')],_0x5467d5['calleridnum'],_0x5467d5[_0x444a('0x2d')],_0x5467d5[_0x444a('0x2e')]));recordings[_0x5467d5[_0x444a('0x8')]][_0x444a('0x2f')]=_0x5467d5['calleridnum'];recordings[_0x5467d5[_0x444a('0x8')]][_0x444a('0x2d')]=_0x5467d5['calleridname'];recordings[_0x5467d5[_0x444a('0x8')]]['connectedlinenum']=_0x5467d5[_0x444a('0x30')];recordings[_0x5467d5[_0x444a('0x8')]][_0x444a('0x31')]=_0x5467d5[_0x444a('0x31')];if(recordings[_0x5467d5[_0x444a('0x8')]]['type']==_0x444a('0x32')&&recordings[_0x5467d5[_0x444a('0x8')]]['accountcode']){recordings[_0x5467d5[_0x444a('0x8')]]['connectedlinenum']=recordings[_0x5467d5['uniqueid']][_0x444a('0xa')];recordings[_0x5467d5[_0x444a('0x8')]][_0x444a('0x31')]='';}recordings[_0x5467d5[_0x444a('0x8')]][_0x444a('0x28')][_0x444a('0x33')](function(_0x441623){var _0x441e79=_[_0x444a('0x34')](recordings[_0x5467d5[_0x444a('0x8')]]);_0x441e79[_0x444a('0x23')]=_0x441623[_0x444a('0x23')];writeDB(_0x441e79);});delete recordings[_0x5467d5['uniqueid']];}}catch(_0x3eed06){utils[_0x444a('0x16')](util[_0x444a('0x5')](_0x444a('0x2b'),_0x5467d5[_0x444a('0x8')]),_0x3eed06);}};exports[_0x444a('0x35')]=function(_0x159264){try{if(!_[_0x444a('0x1a')](recordings[_0x159264[_0x444a('0x8')]])){utils['debug'](util[_0x444a('0x5')](_0x444a('0x36'),_0x159264['uniqueid']),_0x159264);utils[_0x444a('0x4')](util[_0x444a('0x5')](_0x444a('0x37'),_0x159264[_0x444a('0x8')],_0x159264[_0x444a('0x38')],_0x159264[_0x444a('0x39')]));if(_0x159264[_0x444a('0x38')][_0x444a('0x3a')]()==_0x444a('0x3b')&&_[_0x444a('0x3c')](_0x159264[_0x444a('0x39')][_0x444a('0x3a')](),'cdr')){var _0x247f11=_0x159264['appdata'][_0x444a('0x3d')]('=');var _0x389b25=_0x247f11[0x0][_0x444a('0x3e')](_0x247f11[0x0][_0x444a('0x3f')]('(')+0x1,_0x247f11[0x0]['lastIndexOf'](')'));var _0x3529d5=_0x247f11[0x1];recordings[_0x159264[_0x444a('0x8')]][_0x389b25]=_0x3529d5;}}}catch(_0x293a08){utils[_0x444a('0x16')](util['format']('[%s][recordings][newexten]',_0x159264[_0x444a('0x8')]),_0x293a08);}};exports['queuecallerjoin']=function(_0x46e500){try{if(!_[_0x444a('0x1a')](recordings[_0x46e500[_0x444a('0x8')]])){utils[_0x444a('0x18')](util[_0x444a('0x5')](_0x444a('0x40'),_0x46e500[_0x444a('0x8')]),_0x46e500);utils['info'](util[_0x444a('0x5')](_0x444a('0x41'),_0x46e500['uniqueid'],_0x46e500[_0x444a('0x42')]));recordings[_0x46e500[_0x444a('0x8')]][_0x444a('0x42')]=_0x46e500[_0x444a('0x42')];}}catch(_0xd54ffb){utils['error'](util[_0x444a('0x5')]('[%s][recordings][queuecallerjoin]',_0x46e500[_0x444a('0x8')]),_0xd54ffb);}};exports['blindtransfer']=function(_0x59695c){try{utils[_0x444a('0x18')](util[_0x444a('0x5')](_0x444a('0x43'),_0x59695c[_0x444a('0x8')]),_0x59695c);utils[_0x444a('0x4')](util['format'](_0x444a('0x44'),_0x59695c['uniqueid'],_0x59695c['transferercalleridnum'],_0x59695c[_0x444a('0x45')],_0x59695c[_0x444a('0x46')],_0x59695c[_0x444a('0x47')]));if(recordings[_0x59695c[_0x444a('0x48')]]&&transfers[_0x444a('0x7')][_0x59695c[_0x444a('0x48')]]){transfers[_0x444a('0x7')][_0x59695c[_0x444a('0x48')]]['recording']=!![];}}catch(_0x57abf9){utils[_0x444a('0x16')](util[_0x444a('0x5')](_0x444a('0x43'),_0x59695c['uniqueid']),_0x57abf9);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index eca94e0..0bd21a9 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 _0xcd37=['[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','transfereechannel','transfertargetchannel','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','format','[%s][transfers][writeDB]\x20type:%s','origtransfereruniqueid','uniqueid','type','blinds','blindtransfer','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transferercalleridname','transfereecalleridnum','transfereecalleridname','blind','error','[%s][transfers][blindtransfer]','attendedtransfer','debug','[%s][transfers][attendedtransfer]'];(function(_0x72895a,_0x433607){var _0x5226d5=function(_0x5b7d21){while(--_0x5b7d21){_0x72895a['push'](_0x72895a['shift']());}};_0x5226d5(++_0x433607);}(_0xcd37,0x143));var _0x7cd3=function(_0x184bab,_0x581ff5){_0x184bab=_0x184bab-0x0;var _0x2faaf5=_0xcd37[_0x184bab];return _0x2faaf5;};'use strict';var _=require(_0x7cd3('0x0'));var util=require(_0x7cd3('0x1'));var utils=require('./utils');function writeDB(_0x1b9497){utils['info'](util[_0x7cd3('0x2')](_0x7cd3('0x3'),_0x1b9497['type']==='attended'?_0x1b9497[_0x7cd3('0x4')]:_0x1b9497[_0x7cd3('0x5')],_0x1b9497[_0x7cd3('0x6')]));utils['request']('CreateVoiceTransferReport',_0x1b9497);}exports[_0x7cd3('0x7')]={};exports[_0x7cd3('0x8')]=function(_0x5ec926){try{utils['debug'](util[_0x7cd3('0x2')]('[%s][transfers][blindtransfer]',_0x5ec926[_0x7cd3('0x5')]),_0x5ec926);utils[_0x7cd3('0x9')](util[_0x7cd3('0x2')](_0x7cd3('0xa'),_0x5ec926[_0x7cd3('0x5')],_0x5ec926[_0x7cd3('0xb')],_0x5ec926[_0x7cd3('0xc')],_0x5ec926[_0x7cd3('0xd')],_0x5ec926[_0x7cd3('0xe')]));_0x5ec926['type']=_0x7cd3('0xf');exports[_0x7cd3('0x7')][_0x5ec926['transfereruniqueid']]=_0x5ec926;writeDB(_0x5ec926);}catch(_0x444b58){utils[_0x7cd3('0x10')](util[_0x7cd3('0x2')](_0x7cd3('0x11'),_0x5ec926[_0x7cd3('0x5')]),_0x444b58);}};exports[_0x7cd3('0x12')]=function(_0x2f7cd2){try{utils[_0x7cd3('0x13')](util['format'](_0x7cd3('0x14'),_0x2f7cd2[_0x7cd3('0x4')]),_0x2f7cd2);utils[_0x7cd3('0x9')](util[_0x7cd3('0x2')](_0x7cd3('0x15'),_0x2f7cd2[_0x7cd3('0x4')],_0x2f7cd2[_0x7cd3('0x16')],_0x2f7cd2[_0x7cd3('0x17')],_0x2f7cd2[_0x7cd3('0x18')],_0x2f7cd2[_0x7cd3('0x19')]));_0x2f7cd2=_[_0x7cd3('0x1a')](_0x2f7cd2,{'transfererchannel':_0x2f7cd2[_0x7cd3('0x1b')],'transferercalleridnum':_0x2f7cd2[_0x7cd3('0x16')],'transferercalleridname':_0x2f7cd2['origtransferercalleridname'],'transfererconnectedlinenum':_0x2f7cd2['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x2f7cd2[_0x7cd3('0x1c')],'transfereraccountcode':_0x2f7cd2[_0x7cd3('0x1d')],'transferercontext':_0x2f7cd2[_0x7cd3('0x1e')],'transfererexten':_0x2f7cd2[_0x7cd3('0x1f')],'transfererlinkedid':_0x2f7cd2[_0x7cd3('0x20')],'context':_0x2f7cd2[_0x7cd3('0x21')],'extension':_0x2f7cd2[_0x7cd3('0x22')],'type':_0x7cd3('0x23')});if(_['isNil'](_0x2f7cd2[_0x7cd3('0x24')])){_0x2f7cd2=_['assign'](_0x2f7cd2,{'transfereechannel':_0x2f7cd2[_0x7cd3('0x25')],'transfereecalleridnum':_0x2f7cd2[_0x7cd3('0x18')],'transfereecalleridname':_0x2f7cd2[_0x7cd3('0x19')],'transfereeconnectedlinenum':_0x2f7cd2['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2f7cd2[_0x7cd3('0x26')],'transfereeaccountcode':_0x2f7cd2[_0x7cd3('0x27')],'transfereecontext':_0x2f7cd2[_0x7cd3('0x28')],'transfereeexten':_0x2f7cd2[_0x7cd3('0x29')],'transfereelinkedid':_0x2f7cd2[_0x7cd3('0x2a')]});}writeDB(_0x2f7cd2);}catch(_0x3e884f){utils[_0x7cd3('0x10')](util['format']('[%s][transfers][attendedtransfer]',_0x2f7cd2[_0x7cd3('0x4')]),_0x3e884f);}}; \ No newline at end of file +var _0xfb51=['transfereecalleridnum','transfereecalleridname','attendedtransfer','debug','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','attended','isNil','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','error','[%s][transfers][attendedtransfer]','lodash','util','format','type','origtransfereruniqueid','uniqueid','CreateVoiceTransferReport','blinds','blindtransfer','[%s][transfers][blindtransfer]','info','transferercalleridnum','transferercalleridname'];(function(_0x359513,_0x30f896){var _0x4aa572=function(_0x341775){while(--_0x341775){_0x359513['push'](_0x359513['shift']());}};_0x4aa572(++_0x30f896);}(_0xfb51,0x1a0));var _0x1fb5=function(_0x568d32,_0x25edf9){_0x568d32=_0x568d32-0x0;var _0x59d096=_0xfb51[_0x568d32];return _0x59d096;};'use strict';var _=require(_0x1fb5('0x0'));var util=require(_0x1fb5('0x1'));var utils=require('./utils');function writeDB(_0x43d30f){utils['info'](util[_0x1fb5('0x2')]('[%s][transfers][writeDB]\x20type:%s',_0x43d30f[_0x1fb5('0x3')]==='attended'?_0x43d30f[_0x1fb5('0x4')]:_0x43d30f[_0x1fb5('0x5')],_0x43d30f[_0x1fb5('0x3')]));utils['request'](_0x1fb5('0x6'),_0x43d30f);}exports[_0x1fb5('0x7')]={};exports[_0x1fb5('0x8')]=function(_0x4e6502){try{utils['debug'](util[_0x1fb5('0x2')](_0x1fb5('0x9'),_0x4e6502[_0x1fb5('0x5')]),_0x4e6502);utils[_0x1fb5('0xa')](util['format']('[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x4e6502[_0x1fb5('0x5')],_0x4e6502[_0x1fb5('0xb')],_0x4e6502[_0x1fb5('0xc')],_0x4e6502[_0x1fb5('0xd')],_0x4e6502[_0x1fb5('0xe')]));_0x4e6502[_0x1fb5('0x3')]='blind';exports[_0x1fb5('0x7')][_0x4e6502['transfereruniqueid']]=_0x4e6502;writeDB(_0x4e6502);}catch(_0x4482ec){utils['error'](util[_0x1fb5('0x2')](_0x1fb5('0x9'),_0x4e6502[_0x1fb5('0x5')]),_0x4482ec);}};exports[_0x1fb5('0xf')]=function(_0x18aaf5){try{utils[_0x1fb5('0x10')](util[_0x1fb5('0x2')]('[%s][transfers][attendedtransfer]',_0x18aaf5[_0x1fb5('0x4')]),_0x18aaf5);utils[_0x1fb5('0xa')](util['format'](_0x1fb5('0x11'),_0x18aaf5['origtransfereruniqueid'],_0x18aaf5[_0x1fb5('0x12')],_0x18aaf5[_0x1fb5('0x13')],_0x18aaf5[_0x1fb5('0x14')],_0x18aaf5['transfertargetcalleridname']));_0x18aaf5=_[_0x1fb5('0x15')](_0x18aaf5,{'transfererchannel':_0x18aaf5[_0x1fb5('0x16')],'transferercalleridnum':_0x18aaf5[_0x1fb5('0x12')],'transferercalleridname':_0x18aaf5[_0x1fb5('0x13')],'transfererconnectedlinenum':_0x18aaf5['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x18aaf5[_0x1fb5('0x17')],'transfereraccountcode':_0x18aaf5[_0x1fb5('0x18')],'transferercontext':_0x18aaf5['secondtransferercontext'],'transfererexten':_0x18aaf5[_0x1fb5('0x19')],'transfererlinkedid':_0x18aaf5[_0x1fb5('0x1a')],'context':_0x18aaf5[_0x1fb5('0x1b')],'extension':_0x18aaf5[_0x1fb5('0x1c')],'type':_0x1fb5('0x1d')});if(_[_0x1fb5('0x1e')](_0x18aaf5['transfereechannel'])){_0x18aaf5=_[_0x1fb5('0x15')](_0x18aaf5,{'transfereechannel':_0x18aaf5[_0x1fb5('0x1f')],'transfereecalleridnum':_0x18aaf5[_0x1fb5('0x14')],'transfereecalleridname':_0x18aaf5[_0x1fb5('0x20')],'transfereeconnectedlinenum':_0x18aaf5['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x18aaf5[_0x1fb5('0x21')],'transfereeaccountcode':_0x18aaf5[_0x1fb5('0x22')],'transfereecontext':_0x18aaf5[_0x1fb5('0x23')],'transfereeexten':_0x18aaf5[_0x1fb5('0x24')],'transfereelinkedid':_0x18aaf5['transfertargetlinkedid']});}writeDB(_0x18aaf5);}catch(_0x30a28e){utils[_0x1fb5('0x25')](util[_0x1fb5('0x2')](_0x1fb5('0x26'),_0x18aaf5[_0x1fb5('0x4')]),_0x30a28e);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 6b8e5fd..9808d93 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 _0x736c=['[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','seconds','subtractTime','format','YYYY-MM-DD\x20HH:mm:ss','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','util','client','http','../../config/logger','xdr','info','debug','inspect','error','request','then','[utils][request]\x20name:%s','catch','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','[utils][getUserByInterface]','getUserByName'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x736c,0x190));var _0xc736=function(_0x5557c2,_0x37de81){_0x5557c2=_0x5557c2-0x0;var _0x2c1eff=_0x736c[_0x5557c2];return _0x2c1eff;};'use strict';var BPromise=require(_0xc736('0x0'));var jayson=require(_0xc736('0x1'));var moment=require('moment');var util=require(_0xc736('0x2'));var client=jayson[_0xc736('0x3')][_0xc736('0x4')]({'port':0x2329});var logger=require(_0xc736('0x5'))(_0xc736('0x6'));exports[_0xc736('0x7')]=function(_0xb57164,_0x3f00f0){logger['info'](_0xb57164,_0x3f00f0?util['inspect'](_0x3f00f0,{'showHidden':![],'depth':null}):'');};exports[_0xc736('0x8')]=function(_0x480ef2,_0x58245d){logger['debug'](_0x480ef2,_0x58245d?util[_0xc736('0x9')](_0x58245d,{'showHidden':![],'depth':null}):'');};exports[_0xc736('0xa')]=function(_0x268e4a,_0x21eb49){logger[_0xc736('0xa')](_0x268e4a,_0x21eb49?util[_0xc736('0x9')](_0x21eb49,{'showHidden':![],'depth':null}):'');};exports[_0xc736('0xb')]=function(_0x523260,_0x437e33){return client[_0xc736('0xb')](_0x523260,{'body':_0x437e33})[_0xc736('0xc')](function(_0x2537fc){logger[_0xc736('0x8')](_0xc736('0xd'),_0x523260,_0x2537fc?util[_0xc736('0x9')](_0x2537fc,{'showHidden':![],'depth':null}):'');})[_0xc736('0xe')](function(_0x3c3cf7){logger[_0xc736('0xa')]('[utils][request]\x20name:%s',_0x523260,_0x3c3cf7?util[_0xc736('0x9')](_0x3c3cf7,{'showHidden':![],'depth':null}):'');});};function getUser(_0xf24ccd){return client[_0xc736('0xb')](_0xc736('0xf'),{'options':{'raw':!![],'attributes':['id',_0xc736('0x10'),_0xc736('0x11'),_0xc736('0x12')],'where':_0xf24ccd,'limit':0x1}})['then'](function(_0x3dc6c7){logger[_0xc736('0x8')](_0xc736('0x13'),JSON[_0xc736('0x14')](_0xf24ccd),_0x3dc6c7?util[_0xc736('0x9')](_0x3dc6c7,{'showHidden':![],'depth':null}):'');return _0x3dc6c7[_0xc736('0x15')][_0xc736('0x16')]?_0x3dc6c7[_0xc736('0x15')][0x0]:null;});}exports[_0xc736('0x17')]=function(_0x1ce82f){return new BPromise(function(_0x3d54ad,_0x14a290){if(_0x1ce82f){return getUser({'internal':_0x1ce82f})[_0xc736('0xc')](function(_0x4bcf76){logger['info'](_0xc736('0x18'),_0x1ce82f,_0x4bcf76?_0xc736('0x19'):'notfound');return _0x3d54ad(_0x4bcf76);})[_0xc736('0xe')](function(_0xa1d18a){logger['error'](_0xc736('0x1a'),_0xa1d18a?util['inspect'](_0xa1d18a,{'showHidden':![],'depth':null}):'');return _0x3d54ad(null);});}return _0x3d54ad(null);});};exports[_0xc736('0x1b')]=function(_0xbd315f){return new BPromise(function(_0x418637,_0xf72ad3){if(_0xbd315f){return getUser({'interface':_0xbd315f})[_0xc736('0xc')](function(_0x137d0d){logger['info'](_0xc736('0x1c'),_0xbd315f,_0x137d0d?_0xc736('0x19'):_0xc736('0x1d'));return _0x418637(_0x137d0d);})[_0xc736('0xe')](function(_0x59d6c2){logger[_0xc736('0xa')](_0xc736('0x1e'),_0x59d6c2?util[_0xc736('0x9')](_0x59d6c2,{'showHidden':![],'depth':null}):'');return _0x418637(null);});}return _0x418637(null);});};exports[_0xc736('0x1f')]=function(_0x34eca3){return new BPromise(function(_0xa8f3a7,_0x5c2af3){if(_0x34eca3){return getUser({'name':_0x34eca3})[_0xc736('0xc')](function(_0x48ffb3){logger['info']('[utils][getUserByName]\x20name:%s\x20%s',_0x34eca3,_0x48ffb3?_0xc736('0x19'):'notfound');return _0xa8f3a7(_0x48ffb3);})[_0xc736('0xe')](function(_0x6292b1){logger[_0xc736('0xa')](_0xc736('0x20'),_0x6292b1?util[_0xc736('0x9')](_0x6292b1,{'showHidden':![],'depth':null}):'');return _0xa8f3a7(null);});}return _0xa8f3a7(null);});};exports[_0xc736('0x21')]=function(_0x5f20e8){return new BPromise(function(_0x27f074,_0x1a9aa4){if(_0x5f20e8){return client[_0xc736('0xb')](_0xc736('0x22'),{'options':{'raw':!![],'attributes':['id',_0xc736('0x11'),'type',_0xc736('0x23'),_0xc736('0x24')],'where':{'name':_0x5f20e8},'limit':0x1}})[_0xc736('0xc')](function(_0x4a1ada){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x5f20e8,_0x4a1ada?util['inspect'](_0x4a1ada,{'showHidden':![],'depth':null}):'');logger[_0xc736('0x7')](_0xc736('0x25'),_0x5f20e8,_0x4a1ada?_0xc736('0x19'):_0xc736('0x1d'));return _0x27f074(_0x4a1ada[_0xc736('0x15')][_0xc736('0x16')]?_0x4a1ada['result'][0x0]:null);})[_0xc736('0xe')](function(_0x20a17a){logger[_0xc736('0xa')](_0xc736('0x26'),_0x20a17a?util[_0xc736('0x9')](_0x20a17a,{'showHidden':![],'depth':null}):'');return _0x27f074(null);});}return _0x27f074(null);});};exports[_0xc736('0x27')]=function(_0x27faa8,_0x2bc770){return moment(_0x27faa8)['add'](_0x2bc770,_0xc736('0x28'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xc736('0x29')]=function(_0x2fb78b,_0x12d25f){return moment(_0x2fb78b)['subtract'](_0x12d25f,_0xc736('0x28'))[_0xc736('0x2a')](_0xc736('0x2b'));};exports['diffTime']=function(_0x4954ca,_0x2e51b7){return moment(_0x4954ca)['diff'](moment(_0x2e51b7),_0xc736('0x28'));};exports[_0xc736('0x2c')]=function(_0x2951bc,_0x2b3402){return parseInt(_0x2951bc,0xa)+parseInt(_0x2b3402,0xa);};exports[_0xc736('0x2d')]=function(){return moment()[_0xc736('0x2a')](_0xc736('0x2b'));};exports[_0xc736('0x2e')]=function(_0x5616e7,_0xec8272){if(_0xec8272){return moment(_0x5616e7)['isAfter'](_0xec8272);}return!![];};exports[_0xc736('0x2f')]=function(_0x33f1bd,_0x8068e0){if(_0x8068e0){return moment(_0x33f1bd)[_0xc736('0x2f')](_0x8068e0);}else if(_0x33f1bd){return!![];}return![];}; \ No newline at end of file +var _0x517b=['acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','notfound','[utils][getVoiceQueueByName]','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','now','isAfter','isBefore','moment','util','client','http','../../config/logger','xdr','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','GetUser','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','found','catch','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw'];(function(_0x112147,_0x4e692e){var _0x3ba744=function(_0x191b87){while(--_0x191b87){_0x112147['push'](_0x112147['shift']());}};_0x3ba744(++_0x4e692e);}(_0x517b,0xff));var _0xb517=function(_0x14fe8d,_0x500c74){_0x14fe8d=_0x14fe8d-0x0;var _0x1d179a=_0x517b[_0x14fe8d];return _0x1d179a;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var moment=require(_0xb517('0x0'));var util=require(_0xb517('0x1'));var client=jayson[_0xb517('0x2')][_0xb517('0x3')]({'port':0x2329});var logger=require(_0xb517('0x4'))(_0xb517('0x5'));exports[_0xb517('0x6')]=function(_0x27e870,_0x5be34f){logger[_0xb517('0x6')](_0x27e870,_0x5be34f?util[_0xb517('0x7')](_0x5be34f,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0xe41f15,_0x4f55f7){logger[_0xb517('0x8')](_0xe41f15,_0x4f55f7?util[_0xb517('0x7')](_0x4f55f7,{'showHidden':![],'depth':null}):'');};exports[_0xb517('0x9')]=function(_0xde0e96,_0x59279d){logger[_0xb517('0x9')](_0xde0e96,_0x59279d?util['inspect'](_0x59279d,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x3aa3f3,_0xcc23ca){return client[_0xb517('0xa')](_0x3aa3f3,{'body':_0xcc23ca})[_0xb517('0xb')](function(_0x28bbdd){logger[_0xb517('0x8')](_0xb517('0xc'),_0x3aa3f3,_0x28bbdd?util[_0xb517('0x7')](_0x28bbdd,{'showHidden':![],'depth':null}):'');})['catch'](function(_0x3352a0){logger[_0xb517('0x9')](_0xb517('0xc'),_0x3aa3f3,_0x3352a0?util[_0xb517('0x7')](_0x3352a0,{'showHidden':![],'depth':null}):'');});};function getUser(_0x3d2432){return client[_0xb517('0xa')](_0xb517('0xd'),{'options':{'raw':!![],'attributes':['id',_0xb517('0xe'),_0xb517('0xf'),_0xb517('0x10')],'where':_0x3d2432,'limit':0x1}})[_0xb517('0xb')](function(_0xa71c55){logger['debug'](_0xb517('0x11'),JSON[_0xb517('0x12')](_0x3d2432),_0xa71c55?util[_0xb517('0x7')](_0xa71c55,{'showHidden':![],'depth':null}):'');return _0xa71c55[_0xb517('0x13')][_0xb517('0x14')]?_0xa71c55[_0xb517('0x13')][0x0]:null;});}exports[_0xb517('0x15')]=function(_0x519a40){return new BPromise(function(_0x229adc,_0x38de0e){if(_0x519a40){return getUser({'internal':_0x519a40})[_0xb517('0xb')](function(_0x3ef0cf){logger['info']('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x519a40,_0x3ef0cf?_0xb517('0x16'):'notfound');return _0x229adc(_0x3ef0cf);})[_0xb517('0x17')](function(_0x44c2f7){logger['error'](_0xb517('0x18'),_0x44c2f7?util[_0xb517('0x7')](_0x44c2f7,{'showHidden':![],'depth':null}):'');return _0x229adc(null);});}return _0x229adc(null);});};exports[_0xb517('0x19')]=function(_0x598dc3){return new BPromise(function(_0x1e1e1a,_0x2c7ddd){if(_0x598dc3){return getUser({'interface':_0x598dc3})['then'](function(_0xd6d8ad){logger[_0xb517('0x6')]('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x598dc3,_0xd6d8ad?_0xb517('0x16'):'notfound');return _0x1e1e1a(_0xd6d8ad);})[_0xb517('0x17')](function(_0x8dfcda){logger['error'](_0xb517('0x1a'),_0x8dfcda?util[_0xb517('0x7')](_0x8dfcda,{'showHidden':![],'depth':null}):'');return _0x1e1e1a(null);});}return _0x1e1e1a(null);});};exports['getUserByName']=function(_0x5e9051){return new BPromise(function(_0x529cc9,_0x28fbdc){if(_0x5e9051){return getUser({'name':_0x5e9051})['then'](function(_0x11b6b8){logger[_0xb517('0x6')](_0xb517('0x1b'),_0x5e9051,_0x11b6b8?'found':'notfound');return _0x529cc9(_0x11b6b8);})[_0xb517('0x17')](function(_0x26c93){logger['error'](_0xb517('0x1c'),_0x26c93?util[_0xb517('0x7')](_0x26c93,{'showHidden':![],'depth':null}):'');return _0x529cc9(null);});}return _0x529cc9(null);});};exports[_0xb517('0x1d')]=function(_0x99a076){return new BPromise(function(_0x25d967,_0x467101){if(_0x99a076){return client[_0xb517('0xa')](_0xb517('0x1e'),{'options':{'raw':!![],'attributes':['id',_0xb517('0xf'),_0xb517('0x1f'),_0xb517('0x20'),_0xb517('0x21')],'where':{'name':_0x99a076},'limit':0x1}})[_0xb517('0xb')](function(_0xc467dd){logger['debug'](_0xb517('0x22'),_0x99a076,_0xc467dd?util[_0xb517('0x7')](_0xc467dd,{'showHidden':![],'depth':null}):'');logger['info'](_0xb517('0x23'),_0x99a076,_0xc467dd?_0xb517('0x16'):_0xb517('0x24'));return _0x25d967(_0xc467dd['result'][_0xb517('0x14')]?_0xc467dd[_0xb517('0x13')][0x0]:null);})[_0xb517('0x17')](function(_0x25a99d){logger[_0xb517('0x9')](_0xb517('0x25'),_0x25a99d?util[_0xb517('0x7')](_0x25a99d,{'showHidden':![],'depth':null}):'');return _0x25d967(null);});}return _0x25d967(null);});};exports[_0xb517('0x26')]=function(_0x4dd1bb,_0x9e4dcd){return moment(_0x4dd1bb)[_0xb517('0x27')](_0x9e4dcd,_0xb517('0x28'))[_0xb517('0x29')](_0xb517('0x2a'));};exports[_0xb517('0x2b')]=function(_0xd22cd3,_0xbf9020){return moment(_0xd22cd3)[_0xb517('0x2c')](_0xbf9020,_0xb517('0x28'))[_0xb517('0x29')](_0xb517('0x2a'));};exports['diffTime']=function(_0x1d1ca8,_0x4eec5a){return moment(_0x1d1ca8)['diff'](moment(_0x4eec5a),_0xb517('0x28'));};exports['sumTime']=function(_0x391b7d,_0x3222a8){return parseInt(_0x391b7d,0xa)+parseInt(_0x3222a8,0xa);};exports[_0xb517('0x2d')]=function(){return moment()[_0xb517('0x29')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xb517('0x2e')]=function(_0x331773,_0x2cb82a){if(_0x2cb82a){return moment(_0x331773)['isAfter'](_0x2cb82a);}return!![];};exports['isBefore']=function(_0x2b877a,_0x52805e){if(_0x52805e){return moment(_0x2b877a)[_0xb517('0x2f')](_0x52805e);}else if(_0x2b877a){return!![];}return![];}; \ No newline at end of file diff --git a/server/utils/client-side-logger.js b/server/utils/client-side-logger.js index d817792..fc48e56 100644 --- a/server/utils/client-side-logger.js +++ b/server/utils/client-side-logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x277a=['lodash','express-winston','./loggers','fileLogger','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','name','then','catch','user','no-user','data','error','api','auth','set','client-side-logger','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','x-forwarded-for','headers','connection','remoteAddress','url','statusCode','responseTime','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','device','other','agent_name','test','setupLoggers','fs-extra'];(function(_0x30c594,_0x5ccdc8){var _0x4723cc=function(_0x4c76c1){while(--_0x4c76c1){_0x30c594['push'](_0x30c594['shift']());}};_0x4723cc(++_0x5ccdc8);}(_0x277a,0xf4));var _0xa277=function(_0xd43a9b,_0x3ca7dd){_0xd43a9b=_0xd43a9b-0x0;var _0x2a0956=_0x277a[_0xd43a9b];return _0x2a0956;};var fs=require(_0xa277('0x0'));var _=require(_0xa277('0x1'));var ewinston=require(_0xa277('0x2'));var path=require('path');var util=require('util');var fileLogger=require(_0xa277('0x3'))[_0xa277('0x4')];var safeTemplate=require('./safe-template')[_0xa277('0x5')];var maskSensitiveData=require(_0xa277('0x6'))[_0xa277('0x7')];function ClientSideLogger(){function _0x4f60bc(_0x54d6cf){var _0x5c5add=path[_0xa277('0x8')](_0xa277('0x9'),_0xa277('0xa'),_0xa277('0xb'));var _0x339bdb=path[_0xa277('0x8')](_0xa277('0xc'),_0x54d6cf[_0xa277('0xd')]+'-'+_0x54d6cf[_0xa277('0xe')]);return fs['ensureDir'](path['join'](_0x5c5add,_0x339bdb))[_0xa277('0xf')](function(){var _0x5ca09f=fileLogger(_0xa277('0xc'),path['join'](_0x5c5add,_0x339bdb));return _0x5ca09f;})[_0xa277('0x10')](function(_0x5d6f66){throw _0x5d6f66;});}this['log']=function(_0x1e9ebc,_0x16c145,_0x113a24,_0x3e9ce2){return _0x4f60bc(_0x1e9ebc[_0xa277('0x11')])[_0xa277('0xf')](function(_0x5978cd){var _0x373406=_0x5978cd[_0x16c145];return _0x373406;})[_0xa277('0xf')](function(_0x32fd82){var _0x11f3af=_0x1e9ebc[_0xa277('0x11')]?_0x1e9ebc[_0xa277('0x11')]['id']:_0xa277('0x12');var _0x2fe4bd=_0x3e9ce2[_0xa277('0x13')];var _0x525d3f=_0x3e9ce2['timestamp'];var _0x3d6b46=new Date(Number(_0x525d3f));return _0x32fd82(_0x11f3af,_0x3d6b46,_0x113a24,_0x2fe4bd);})[_0xa277('0x10')](function(_0x20a573){fileLogger(_0xa277('0xc'))[_0xa277('0x14')](_0x20a573);});};}function setupLoggers(_0x31599d){return new Promise(function(_0x141816){var _0x190fd1=new ClientSideLogger();var _0x5a36ec=fileLogger(_0xa277('0x15'));var _0x3d9e5b=fileLogger(_0xa277('0x16'));_0x31599d[_0xa277('0x17')](_0xa277('0x18'),_0x190fd1);_0x31599d[_0xa277('0x19')](ewinston[_0xa277('0x1a')]({'winstonInstance':_0x5a36ec,'meta':![],'statusLevels':!![],'msg':function(_0x5928f7,_0x4dc26a){var _0x1db652=_0xa277('0x1b');if(!_[_0xa277('0x1c')](_0x5928f7[_0xa277('0x1d')])){_0x1db652+=_0xa277('0x1e');var _0x1befeb=_0x5928f7[_0xa277('0x1d')];maskSensitiveData(_0x1befeb);}return safeTemplate(util[_0xa277('0x1f')](_0x1db652,_0x5928f7['method'],_0x5928f7['headers'][_0xa277('0x20')]?_0x5928f7[_0xa277('0x21')][_0xa277('0x20')]:_0x5928f7[_0xa277('0x22')][_0xa277('0x23')]||_0x5928f7['ip'],_0x5928f7[_0xa277('0x24')],_0x4dc26a[_0xa277('0x25')],_0x4dc26a[_0xa277('0x26')],_0x5928f7[_0xa277('0x11')]?_0x5928f7[_0xa277('0x11')]['id']:null,_0x5928f7['user']?_0x5928f7[_0xa277('0x11')][_0xa277('0xe')]:null,_0x5928f7[_0xa277('0x11')]?_0x5928f7['user'][_0xa277('0xd')]:null,_0x1befeb?util[_0xa277('0x27')](_0x1befeb,![],null):''));}}));_0x31599d[_0xa277('0x19')](ewinston[_0xa277('0x1a')]({'winstonInstance':_0x3d9e5b,'meta':![],'statusLevels':!![],'msg':function(_0x240b2d,_0x29826f){var _0x2ea211=_0xa277('0x28');if(_0x240b2d[_0xa277('0x1d')]&&_0x240b2d[_0xa277('0x1d')]['device']&&_0x240b2d[_0xa277('0x1d')][_0xa277('0x29')]){_0x2ea211=_0xa277('0x2a');}return util['format'](_0x2ea211,_0x240b2d[_0xa277('0x2b')],_0x240b2d[_0xa277('0x21')][_0xa277('0x20')]?_0x240b2d['headers'][_0xa277('0x20')]:_0x240b2d[_0xa277('0x22')][_0xa277('0x23')]||_0x240b2d['ip'],_0x240b2d['url'],_0x29826f[_0xa277('0x25')],_0x29826f[_0xa277('0x26')],_0x240b2d[_0xa277('0x11')]?_0x240b2d[_0xa277('0x11')]['id']:null,_0x240b2d[_0xa277('0x11')]?_0x240b2d['user'][_0xa277('0xe')]:null,_0x240b2d[_0xa277('0x11')]?_0x240b2d[_0xa277('0x11')]['role']:null,_0x240b2d[_0xa277('0x1d')]&&_0x240b2d[_0xa277('0x1d')][_0xa277('0x2c')]?_0x240b2d[_0xa277('0x1d')][_0xa277('0x2c')]:_0xa277('0x2d'),_0x240b2d[_0xa277('0x1d')]&&_0x240b2d[_0xa277('0x1d')][_0xa277('0x29')]?_0x240b2d[_0xa277('0x1d')][_0xa277('0x29')]:'',_0x240b2d[_0xa277('0x1d')]&&_0x240b2d['body'][_0xa277('0x2e')]?_0x240b2d[_0xa277('0x1d')][_0xa277('0x2e')]:'');},'ignoreRoute':function(_0x1d6bee){var _0x525013=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x525013[_0xa277('0x2f')](_0x1d6bee['url']);}}));return _0x141816();});}exports[_0xa277('0x30')]=setupLoggers; \ No newline at end of file +var _0x4b61=['headers','x-forwarded-for','connection','url','responseTime','name','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','remoteAddress','statusCode','other','agent_id','agent_name','setupLoggers','fs-extra','lodash','path','util','./loggers','fileLogger','./safe-template','safeTemplate','./mask-sensitive-data','maskSensitiveData','join','/var','log','xcally','client','role','ensureDir','then','user','data','catch','api','auth','set','client-side-logger','logger','body','\x20body=%s','format','method'];(function(_0x190ff6,_0x515cfd){var _0x5356d2=function(_0x2cf77c){while(--_0x2cf77c){_0x190ff6['push'](_0x190ff6['shift']());}};_0x5356d2(++_0x515cfd);}(_0x4b61,0x69));var _0x14b6=function(_0x19efbc,_0x10b7d7){_0x19efbc=_0x19efbc-0x0;var _0x205c5e=_0x4b61[_0x19efbc];return _0x205c5e;};var fs=require(_0x14b6('0x0'));var _=require(_0x14b6('0x1'));var ewinston=require('express-winston');var path=require(_0x14b6('0x2'));var util=require(_0x14b6('0x3'));var fileLogger=require(_0x14b6('0x4'))[_0x14b6('0x5')];var safeTemplate=require(_0x14b6('0x6'))[_0x14b6('0x7')];var maskSensitiveData=require(_0x14b6('0x8'))[_0x14b6('0x9')];function ClientSideLogger(){function _0x1cb946(_0x10ceb2){var _0x419fc7=path[_0x14b6('0xa')](_0x14b6('0xb'),_0x14b6('0xc'),_0x14b6('0xd'));var _0x26e9f0=path[_0x14b6('0xa')](_0x14b6('0xe'),_0x10ceb2[_0x14b6('0xf')]+'-'+_0x10ceb2['name']);return fs[_0x14b6('0x10')](path[_0x14b6('0xa')](_0x419fc7,_0x26e9f0))[_0x14b6('0x11')](function(){var _0x389d0e=fileLogger('client',path[_0x14b6('0xa')](_0x419fc7,_0x26e9f0));return _0x389d0e;})['catch'](function(_0x289438){throw _0x289438;});}this[_0x14b6('0xc')]=function(_0x32817a,_0x1f970b,_0x197c1c,_0x33120b){return _0x1cb946(_0x32817a[_0x14b6('0x12')])['then'](function(_0x1704d5){var _0x20116a=_0x1704d5[_0x1f970b];return _0x20116a;})['then'](function(_0x1e8f1c){var _0x4926d7=_0x32817a[_0x14b6('0x12')]?_0x32817a[_0x14b6('0x12')]['id']:'no-user';var _0x54eb77=_0x33120b[_0x14b6('0x13')];var _0x1bfbbb=_0x33120b['timestamp'];var _0x50e9a2=new Date(Number(_0x1bfbbb));return _0x1e8f1c(_0x4926d7,_0x50e9a2,_0x197c1c,_0x54eb77);})[_0x14b6('0x14')](function(_0x21343f){fileLogger(_0x14b6('0xe'))['error'](_0x21343f);});};}function setupLoggers(_0xa26e85){return new Promise(function(_0x1efae7){var _0x31172b=new ClientSideLogger();var _0x442201=fileLogger(_0x14b6('0x15'));var _0x240c5d=fileLogger(_0x14b6('0x16'));_0xa26e85[_0x14b6('0x17')](_0x14b6('0x18'),_0x31172b);_0xa26e85['use'](ewinston[_0x14b6('0x19')]({'winstonInstance':_0x442201,'meta':![],'statusLevels':!![],'msg':function(_0x32d516,_0x32c8f1){var _0x5f5bc8='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_['isEmpty'](_0x32d516[_0x14b6('0x1a')])){_0x5f5bc8+=_0x14b6('0x1b');var _0x537dca=_0x32d516[_0x14b6('0x1a')];maskSensitiveData(_0x537dca);}return safeTemplate(util[_0x14b6('0x1c')](_0x5f5bc8,_0x32d516[_0x14b6('0x1d')],_0x32d516[_0x14b6('0x1e')][_0x14b6('0x1f')]?_0x32d516[_0x14b6('0x1e')][_0x14b6('0x1f')]:_0x32d516[_0x14b6('0x20')]['remoteAddress']||_0x32d516['ip'],_0x32d516[_0x14b6('0x21')],_0x32c8f1['statusCode'],_0x32c8f1[_0x14b6('0x22')],_0x32d516[_0x14b6('0x12')]?_0x32d516[_0x14b6('0x12')]['id']:null,_0x32d516[_0x14b6('0x12')]?_0x32d516[_0x14b6('0x12')][_0x14b6('0x23')]:null,_0x32d516[_0x14b6('0x12')]?_0x32d516[_0x14b6('0x12')][_0x14b6('0xf')]:null,_0x537dca?util[_0x14b6('0x24')](_0x537dca,![],null):''));}}));_0xa26e85['use'](ewinston[_0x14b6('0x19')]({'winstonInstance':_0x240c5d,'meta':![],'statusLevels':!![],'msg':function(_0x5959aa,_0x426f15){var _0x509013=_0x14b6('0x25');if(_0x5959aa[_0x14b6('0x1a')]&&_0x5959aa[_0x14b6('0x1a')][_0x14b6('0x26')]&&_0x5959aa['body']['agent_id']){_0x509013='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x14b6('0x1c')](_0x509013,_0x5959aa[_0x14b6('0x1d')],_0x5959aa[_0x14b6('0x1e')][_0x14b6('0x1f')]?_0x5959aa[_0x14b6('0x1e')][_0x14b6('0x1f')]:_0x5959aa[_0x14b6('0x20')][_0x14b6('0x27')]||_0x5959aa['ip'],_0x5959aa[_0x14b6('0x21')],_0x426f15[_0x14b6('0x28')],_0x426f15['responseTime'],_0x5959aa[_0x14b6('0x12')]?_0x5959aa[_0x14b6('0x12')]['id']:null,_0x5959aa[_0x14b6('0x12')]?_0x5959aa[_0x14b6('0x12')][_0x14b6('0x23')]:null,_0x5959aa[_0x14b6('0x12')]?_0x5959aa[_0x14b6('0x12')]['role']:null,_0x5959aa[_0x14b6('0x1a')]&&_0x5959aa[_0x14b6('0x1a')]['device']?_0x5959aa['body'][_0x14b6('0x26')]:_0x14b6('0x29'),_0x5959aa[_0x14b6('0x1a')]&&_0x5959aa['body'][_0x14b6('0x2a')]?_0x5959aa['body'][_0x14b6('0x2a')]:'',_0x5959aa['body']&&_0x5959aa[_0x14b6('0x1a')]['agent_name']?_0x5959aa[_0x14b6('0x1a')][_0x14b6('0x2b')]:'');},'ignoreRoute':function(_0x4d319c){var _0x70c071=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x70c071['test'](_0x4d319c[_0x14b6('0x21')]);}}));return _0x1efae7();});}exports[_0x14b6('0x2c')]=setupLoggers; \ No newline at end of file diff --git a/server/utils/iftime.js b/server/utils/iftime.js index 85fbeec..ab5a52c 100644 --- a/server/utils/iftime.js +++ b/server/utils/iftime.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9811=['join','isValid','split','locale','weekdaysShort','indexOf','slice','exports','toLowerCase','concat','clone','hours','minutes','endOf','day','isBetween','format','ddd','max','domCompare','MMM','includes','monthCompare','test','isMoment','padStart','length','iftime','lodash','map','source'];(function(_0x20c290,_0x47e736){var _0x3d7b3b=function(_0x5d837f){while(--_0x5d837f){_0x20c290['push'](_0x20c290['shift']());}};_0x3d7b3b(++_0x47e736);}(_0x9811,0x98));var _0x1981=function(_0x4f34f5,_0x4d7309){_0x4f34f5=_0x4f34f5-0x0;var _0xb1e3fd=_0x9811[_0x4f34f5];return _0xb1e3fd;};var _=require(_0x1981('0x0'));var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx][_0x1981('0x1')](function(_0x3ec8f2){return _0x3ec8f2[_0x1981('0x2')];})[_0x1981('0x3')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING='Interval\x20string\x20not\x20valid';var EINVALID_DATE='Date\x20not\x20valid';function throwIfDateNotValid(_0x309a5b){if(!_0x309a5b[_0x1981('0x4')]()){throw new Error(EINVALID_DATE);}}function extractTime(_0x453208){var _0x458ae5=_0x453208[_0x1981('0x5')](':')['map'](function(_0x351f2b){return parseInt(_0x351f2b,0xa);});var _0x585e51=_0x458ae5[0x0];var _0x527ff5=_0x458ae5[0x1];if(_0x585e51<0x0||_0x585e51>0x17||_0x527ff5<0x0||_0x527ff5>0x3b){throw new Error(EINVALID_DATE);}return[_0x585e51,_0x527ff5];}function circularDoWInterval(_0x4b5003,_0x17cff9){if(_0x4b5003===_0x17cff9){return[_0x4b5003];}else{var _0x45249c=moment[_0x1981('0x6')]();moment[_0x1981('0x6')]('en');var _0x800d87=moment[_0x1981('0x7')]()[_0x1981('0x1')](function(_0x22038b){return _0x22038b['toLowerCase']();});moment['locale'](_0x45249c);var _0x5a70a9=_0x800d87[_0x1981('0x8')](_0x4b5003);var _0x388ad2=_0x800d87[_0x1981('0x8')](_0x17cff9);if(_0x388ad2>_0x5a70a9){return _0x800d87[_0x1981('0x9')](_0x5a70a9,_0x388ad2+0x1);}else{var _0x3638ed=_0x800d87['slice'](0x0,_0x388ad2+0x1);var _0x339681=_0x800d87['slice'](_0x5a70a9);return _0x339681['concat'](_0x3638ed);}}}module[_0x1981('0xa')]['circularDoWInterval']=circularDoWInterval;function circularMonthInterval(_0x36b91a,_0x4feb68){if(_0x36b91a===_0x4feb68){return[_0x36b91a];}else{var _0x1282af=moment[_0x1981('0x6')]();moment['locale']('en');var _0x17f4ef=moment['monthsShort']()[_0x1981('0x1')](function(_0x29fe65){return _0x29fe65[_0x1981('0xb')]();});moment[_0x1981('0x6')](_0x1282af);var _0x38ebb2=_0x17f4ef[_0x1981('0x8')](_0x36b91a);var _0x4775bf=_0x17f4ef['indexOf'](_0x4feb68);if(_0x4775bf>_0x38ebb2){return _0x17f4ef[_0x1981('0x9')](_0x38ebb2,_0x4775bf+0x1);}else{var _0x1c85c1=_0x17f4ef[_0x1981('0x9')](0x0,_0x4775bf+0x1);var _0xba11c1=_0x17f4ef['slice'](_0x38ebb2);return _0xba11c1[_0x1981('0xc')](_0x1c85c1);}}}module[_0x1981('0xa')]['circularMonthInterval']=circularMonthInterval;function parseDom(_0x28cf7d){var _0x3caa38=parseInt(_0x28cf7d,0xa);if(_0x3caa38<0x1||_0x3caa38>0x1f){throw new Error(EINVALID_DATE);}return _0x3caa38;}function timeCompare(_0xaec568,_0x196465,_0x3dbc8b){var _0x2be9ea=_0xaec568[_0x1981('0xd')]();var _0xfc6c19=extractTime(_0x196465);var _0x457ab3=_0xfc6c19[0x0];var _0x1fbe36=_0xfc6c19[0x1];var _0x3f786e=_0xaec568[_0x1981('0xd')]()[_0x1981('0xe')](_0x457ab3)['minutes'](_0x1fbe36);throwIfDateNotValid(_0x3f786e);var _0x365a50=extractTime(_0x3dbc8b);var _0x14a633=_0x365a50[0x0];var _0x5be0c6=_0x365a50[0x1];var _0x574417=_0xaec568[_0x1981('0xd')]()['hours'](_0x14a633)[_0x1981('0xf')](_0x5be0c6);throwIfDateNotValid(_0x574417);if(_0x574417['isBefore'](_0x3f786e)){var _0x4922b2=_0x2be9ea[_0x1981('0xd')]()['startOf']('day');var _0x3d04b4=_0x2be9ea[_0x1981('0xd')]()[_0x1981('0x10')](_0x1981('0x11'));return _0x2be9ea['isBetween'](_0x3f786e,_0x3d04b4,undefined,'[]')||_0x2be9ea[_0x1981('0x12')](_0x4922b2,_0x574417,undefined,'[]');}else{return _0x2be9ea[_0x1981('0x12')](_0x3f786e,_0x574417,undefined,'[]');}}module[_0x1981('0xa')]['timeCompare']=timeCompare;function dowCompare(_0x338a3c,_0x245e99,_0x117be5){var _0x223129=_0x338a3c[_0x1981('0x6')]('en')[_0x1981('0x13')](_0x1981('0x14'))[_0x1981('0xb')]();return circularDoWInterval(_0x245e99,_0x117be5)['includes'](_0x223129);}module[_0x1981('0xa')]['dowCompare']=dowCompare;function domCompare(_0x256e8a,_0x3c3ad3,_0x5c5b15){var _0x1cebdd=_0x256e8a['date']();if(_0x3c3ad3===_0x5c5b15){return _0x1cebdd===_0x3c3ad3;}else{var _0x1f67d1=_0x256e8a['daysInMonth']();var _0x2282e6=_0x3c3ad3<_0x5c5b15;let _0x2e367f=![];var _0x4b49f9=0x0;var _0x5cefde=0x0;if(_0x2282e6){_0x4b49f9=Math[_0x1981('0x15')](0x1,_0x3c3ad3);_0x5cefde=Math['min'](_0x5c5b15,_0x1f67d1);_0x2e367f=_0x1cebdd>=_0x4b49f9&&_0x1cebdd<=_0x5cefde;}else{_0x4b49f9=Math['min'](_0x3c3ad3,_0x1f67d1);_0x5cefde=Math[_0x1981('0x15')](0x1,_0x5c5b15);_0x2e367f=_0x1cebdd>=_0x4b49f9||_0x1cebdd<=_0x5cefde;}return _0x2e367f;}}module[_0x1981('0xa')][_0x1981('0x16')]=domCompare;function monthCompare(_0x19faa8,_0x1500e9,_0x5332fa){var _0x1e5fbe=_0x19faa8['locale']('en')[_0x1981('0x13')](_0x1981('0x17'))[_0x1981('0xb')]();return circularMonthInterval(_0x1500e9,_0x5332fa)[_0x1981('0x18')](_0x1e5fbe);}module[_0x1981('0xa')][_0x1981('0x19')]=monthCompare;function iftime(_0x3ee24e,_0x1df82e=moment['tz']['guess'](),_0x13943c=moment()){if(!validateRx[_0x1981('0x1a')](_0x3ee24e)){throw new Error(EINVALID_STRING);}else{var _0x4ee65d=(moment[_0x1981('0x1b')](_0x13943c)?_0x13943c[_0x1981('0xd')]():moment(_0x13943c))['tz'](_0x1df82e)['locale']('en');throwIfDateNotValid(_0x4ee65d);var _0x385154=_0x3ee24e[_0x1981('0x5')](',');var _0x5787b0=_0x385154[0x0];var _0x5050cc=_0x385154[0x1];var _0x15aeca=_0x385154[0x2];var _0x41ed1d=_0x385154[0x3];let _0x9f9266=!![];if(_0x5787b0!=='*'){var _0x5f1424=_0x5787b0[_0x1981('0x5')]('-');var _0x122128=_[_0x1981('0x1c')](_0x5f1424[0x0],0x5,'0');var _0x14606f=_0x5f1424[_0x1981('0x1d')]===0x2?_[_0x1981('0x1c')](_0x5f1424[0x1],0x5,'0'):_0x122128;_0x9f9266=timeCompare(_0x4ee65d,_0x122128,_0x14606f);}let _0x3c31f5=!![];if(_0x5050cc!=='*'){var _0x15f066=_0x5050cc[_0x1981('0x5')]('-');var _0x45e11c=_0x15f066[0x0];var _0x42bc0d=_0x15f066['length']===0x2?_0x15f066[0x1]:_0x45e11c;_0x3c31f5=dowCompare(_0x4ee65d,_0x45e11c,_0x42bc0d);}let _0x4bcf82=!![];if(_0x15aeca!=='*'){var _0x478a0c=_0x15aeca['split']('-');var _0x49ef14=parseDom(_0x478a0c[0x0]);var _0x3f4656=_0x478a0c[_0x1981('0x1d')]===0x2?parseDom(_0x478a0c[0x1]):_0x49ef14;_0x4bcf82=domCompare(_0x4ee65d,_0x49ef14,_0x3f4656);}let _0x26d16e=!![];if(_0x41ed1d!=='*'){var _0x3a8cd8=_0x41ed1d[_0x1981('0x5')]('-');var _0x4bfdc3=_0x3a8cd8[0x0];var _0x26f6f0=_0x3a8cd8[_0x1981('0x1d')]===0x2?_0x3a8cd8[0x1]:_0x3a8cd8[0x0];_0x26d16e=monthCompare(_0x4ee65d,_0x4bfdc3,_0x26f6f0);}return _0x9f9266&&_0x3c31f5&&_0x4bcf82&&_0x26d16e;}}module[_0x1981('0xa')][_0x1981('0x1e')]=iftime; \ No newline at end of file +var _0x3702=['MMM','monthCompare','guess','test','isMoment','split','length','iftime','lodash','source','join','Interval\x20string\x20not\x20valid','Date\x20not\x20valid','map','locale','weekdaysShort','toLowerCase','indexOf','slice','concat','exports','circularDoWInterval','clone','hours','minutes','isBefore','day','isBetween','timeCompare','format','includes','dowCompare','date','max','min','domCompare'];(function(_0x77fd25,_0x226ea2){var _0xe14528=function(_0x1551d5){while(--_0x1551d5){_0x77fd25['push'](_0x77fd25['shift']());}};_0xe14528(++_0x226ea2);}(_0x3702,0x98));var _0x2370=function(_0x575772,_0x438f3a){_0x575772=_0x575772-0x0;var _0x1353a5=_0x3702[_0x575772];return _0x1353a5;};var _=require(_0x2370('0x0'));var moment=require('moment-timezone');var timeRx=/(\*|(\d{1,2}:\d{1,2})(-(\d{1,2}:\d{1,2}))?)/;var dowRx=/(\*|((sun|mon|tue|wed|thu|fri|sat)(-(sun|mon|tue|wed|thu|fri|sat))?))/;var domRx=/(\*|(\d{1,2})(-(\d{1,2}))?)/;var moyRx=/(\*|(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)(-(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec))?)/;var globalRx=[timeRx,dowRx,domRx,moyRx]['map'](function(_0x23ca6f){return _0x23ca6f[_0x2370('0x1')];})[_0x2370('0x2')](',');var validateRx=new RegExp('^'+globalRx+'$');var EINVALID_STRING=_0x2370('0x3');var EINVALID_DATE=_0x2370('0x4');function throwIfDateNotValid(_0x39dbfc){if(!_0x39dbfc['isValid']()){throw new Error(EINVALID_DATE);}}function extractTime(_0x3cb96d){var _0x4a8dd5=_0x3cb96d['split'](':')[_0x2370('0x5')](function(_0x389f9d){return parseInt(_0x389f9d,0xa);});var _0x24de90=_0x4a8dd5[0x0];var _0x316574=_0x4a8dd5[0x1];if(_0x24de90<0x0||_0x24de90>0x17||_0x316574<0x0||_0x316574>0x3b){throw new Error(EINVALID_DATE);}return[_0x24de90,_0x316574];}function circularDoWInterval(_0x1755b2,_0x36fb40){if(_0x1755b2===_0x36fb40){return[_0x1755b2];}else{var _0x21ed1f=moment['locale']();moment[_0x2370('0x6')]('en');var _0x1424bc=moment[_0x2370('0x7')]()[_0x2370('0x5')](function(_0x3f90d0){return _0x3f90d0[_0x2370('0x8')]();});moment[_0x2370('0x6')](_0x21ed1f);var _0x27a683=_0x1424bc['indexOf'](_0x1755b2);var _0x249dba=_0x1424bc[_0x2370('0x9')](_0x36fb40);if(_0x249dba>_0x27a683){return _0x1424bc['slice'](_0x27a683,_0x249dba+0x1);}else{var _0x503eb3=_0x1424bc[_0x2370('0xa')](0x0,_0x249dba+0x1);var _0x3bc9ec=_0x1424bc[_0x2370('0xa')](_0x27a683);return _0x3bc9ec[_0x2370('0xb')](_0x503eb3);}}}module[_0x2370('0xc')][_0x2370('0xd')]=circularDoWInterval;function circularMonthInterval(_0x1fcc58,_0x4ba710){if(_0x1fcc58===_0x4ba710){return[_0x1fcc58];}else{var _0x2a05b0=moment['locale']();moment[_0x2370('0x6')]('en');var _0x75acab=moment['monthsShort']()[_0x2370('0x5')](function(_0x144ed0){return _0x144ed0[_0x2370('0x8')]();});moment['locale'](_0x2a05b0);var _0x3e8a4d=_0x75acab[_0x2370('0x9')](_0x1fcc58);var _0x539614=_0x75acab[_0x2370('0x9')](_0x4ba710);if(_0x539614>_0x3e8a4d){return _0x75acab[_0x2370('0xa')](_0x3e8a4d,_0x539614+0x1);}else{var _0x4851a9=_0x75acab[_0x2370('0xa')](0x0,_0x539614+0x1);var _0x21e541=_0x75acab[_0x2370('0xa')](_0x3e8a4d);return _0x21e541[_0x2370('0xb')](_0x4851a9);}}}module['exports']['circularMonthInterval']=circularMonthInterval;function parseDom(_0x6912f2){var _0x30d935=parseInt(_0x6912f2,0xa);if(_0x30d935<0x1||_0x30d935>0x1f){throw new Error(EINVALID_DATE);}return _0x30d935;}function timeCompare(_0x4afedf,_0x577825,_0x571551){var _0x57ac1c=_0x4afedf[_0x2370('0xe')]();var _0x308f5f=extractTime(_0x577825);var _0x317db3=_0x308f5f[0x0];var _0x2a5990=_0x308f5f[0x1];var _0x495ba9=_0x4afedf[_0x2370('0xe')]()[_0x2370('0xf')](_0x317db3)[_0x2370('0x10')](_0x2a5990);throwIfDateNotValid(_0x495ba9);var _0x299b24=extractTime(_0x571551);var _0x377467=_0x299b24[0x0];var _0x568f62=_0x299b24[0x1];var _0x4eb3df=_0x4afedf[_0x2370('0xe')]()[_0x2370('0xf')](_0x377467)[_0x2370('0x10')](_0x568f62);throwIfDateNotValid(_0x4eb3df);if(_0x4eb3df[_0x2370('0x11')](_0x495ba9)){var _0x171f8c=_0x57ac1c[_0x2370('0xe')]()['startOf'](_0x2370('0x12'));var _0x274f84=_0x57ac1c[_0x2370('0xe')]()['endOf'](_0x2370('0x12'));return _0x57ac1c[_0x2370('0x13')](_0x495ba9,_0x274f84,undefined,'[]')||_0x57ac1c[_0x2370('0x13')](_0x171f8c,_0x4eb3df,undefined,'[]');}else{return _0x57ac1c[_0x2370('0x13')](_0x495ba9,_0x4eb3df,undefined,'[]');}}module['exports'][_0x2370('0x14')]=timeCompare;function dowCompare(_0x39661c,_0x5bdc6d,_0x3c27d9){var _0x91a0ee=_0x39661c[_0x2370('0x6')]('en')[_0x2370('0x15')]('ddd')[_0x2370('0x8')]();return circularDoWInterval(_0x5bdc6d,_0x3c27d9)[_0x2370('0x16')](_0x91a0ee);}module[_0x2370('0xc')][_0x2370('0x17')]=dowCompare;function domCompare(_0x169ec9,_0x34e947,_0x1ad7aa){var _0x59fa1c=_0x169ec9[_0x2370('0x18')]();if(_0x34e947===_0x1ad7aa){return _0x59fa1c===_0x34e947;}else{var _0x583902=_0x169ec9['daysInMonth']();var _0x21cd47=_0x34e947<_0x1ad7aa;let _0x604173=![];var _0x349e7e=0x0;var _0x21eb5d=0x0;if(_0x21cd47){_0x349e7e=Math[_0x2370('0x19')](0x1,_0x34e947);_0x21eb5d=Math[_0x2370('0x1a')](_0x1ad7aa,_0x583902);_0x604173=_0x59fa1c>=_0x349e7e&&_0x59fa1c<=_0x21eb5d;}else{_0x349e7e=Math[_0x2370('0x1a')](_0x34e947,_0x583902);_0x21eb5d=Math['max'](0x1,_0x1ad7aa);_0x604173=_0x59fa1c>=_0x349e7e||_0x59fa1c<=_0x21eb5d;}return _0x604173;}}module[_0x2370('0xc')][_0x2370('0x1b')]=domCompare;function monthCompare(_0xc9006,_0x44c6e3,_0x423b5d){var _0x35dc64=_0xc9006['locale']('en')[_0x2370('0x15')](_0x2370('0x1c'))[_0x2370('0x8')]();return circularMonthInterval(_0x44c6e3,_0x423b5d)[_0x2370('0x16')](_0x35dc64);}module['exports'][_0x2370('0x1d')]=monthCompare;function iftime(_0x52b5e7,_0x408748=moment['tz'][_0x2370('0x1e')](),_0x24a9eb=moment()){if(!validateRx[_0x2370('0x1f')](_0x52b5e7)){throw new Error(EINVALID_STRING);}else{var _0x45eec7=(moment[_0x2370('0x20')](_0x24a9eb)?_0x24a9eb['clone']():moment(_0x24a9eb))['tz'](_0x408748)['locale']('en');throwIfDateNotValid(_0x45eec7);var _0x31f423=_0x52b5e7['split'](',');var _0x233f35=_0x31f423[0x0];var _0x4eadac=_0x31f423[0x1];var _0x4f8119=_0x31f423[0x2];var _0x203d44=_0x31f423[0x3];let _0x56ddcb=!![];if(_0x233f35!=='*'){var _0x120247=_0x233f35[_0x2370('0x21')]('-');var _0x5b50b7=_['padStart'](_0x120247[0x0],0x5,'0');var _0x483dfc=_0x120247['length']===0x2?_['padStart'](_0x120247[0x1],0x5,'0'):_0x5b50b7;_0x56ddcb=timeCompare(_0x45eec7,_0x5b50b7,_0x483dfc);}let _0x410e2c=!![];if(_0x4eadac!=='*'){var _0x4d9bd9=_0x4eadac[_0x2370('0x21')]('-');var _0x2ed784=_0x4d9bd9[0x0];var _0x1a1617=_0x4d9bd9[_0x2370('0x22')]===0x2?_0x4d9bd9[0x1]:_0x2ed784;_0x410e2c=dowCompare(_0x45eec7,_0x2ed784,_0x1a1617);}let _0x3ee336=!![];if(_0x4f8119!=='*'){var _0x49a810=_0x4f8119[_0x2370('0x21')]('-');var _0x260185=parseDom(_0x49a810[0x0]);var _0x588f6a=_0x49a810[_0x2370('0x22')]===0x2?parseDom(_0x49a810[0x1]):_0x260185;_0x3ee336=domCompare(_0x45eec7,_0x260185,_0x588f6a);}let _0x417bea=!![];if(_0x203d44!=='*'){var _0x4d9c62=_0x203d44['split']('-');var _0x510f47=_0x4d9c62[0x0];var _0x45c294=_0x4d9c62[_0x2370('0x22')]===0x2?_0x4d9c62[0x1]:_0x4d9c62[0x0];_0x417bea=monthCompare(_0x45eec7,_0x510f47,_0x45c294);}return _0x56ddcb&&_0x410e2c&&_0x3ee336&&_0x417bea;}}module[_0x2370('0xc')][_0x2370('0x23')]=iftime; \ No newline at end of file diff --git a/server/utils/loggers.js b/server/utils/loggers.js index 9292aa8..944e82d 100644 --- a/server/utils/loggers.js +++ b/server/utils/loggers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdc9f=['{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','stringify','[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s','Logger','transports','Console','warn','File','%s-%s','error','consoleLogger','fileLogger','path','util','moment','winston','../config/environment','debugLevel','toLowerCase','redBG\x20white','red','bold\x20yellow','gray','bold\x20blue','bold\x20cyan','/var/log/xcally','join','format','%s-%s.log','message','replace'];(function(_0x1afbcb,_0x592f0a){var _0x40d039=function(_0x384ddf){while(--_0x384ddf){_0x1afbcb['push'](_0x1afbcb['shift']());}};_0x40d039(++_0x592f0a);}(_0xdc9f,0x13a));var _0xfdc9=function(_0x22fee6,_0x395b9d){_0x22fee6=_0x22fee6-0x0;var _0x258622=_0xdc9f[_0x22fee6];return _0x258622;};'use strict';var path=require(_0xfdc9('0x0'));var util=require(_0xfdc9('0x1'));var moment=require(_0xfdc9('0x2'));var winston=require(_0xfdc9('0x3'));var config=require(_0xfdc9('0x4'));var debugLevel=config[_0xfdc9('0x5')]?config[_0xfdc9('0x5')][_0xfdc9('0x6')]():'info';var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0xfdc9('0x7'),'error':_0xfdc9('0x8'),'warn':_0xfdc9('0x9'),'info':'white','print':'bold\x20white','success':'bold\x20green','http':_0xfdc9('0xa'),'verbose':'bold\x20magenta','debug':_0xfdc9('0xb'),'silly':_0xfdc9('0xc')};winston['addColors'](XC_LOG_COLORS);function getLogFileName(_0x42311a,_0x140ba2,_0x11cf18){var _0x5cb728=_0x42311a||_0xfdc9('0xd');return path[_0xfdc9('0xe')](_0x5cb728,util[_0xfdc9('0xf')](_0xfdc9('0x10'),_0x140ba2,_0x11cf18));}function formatter(_0x4e95b1,_0x5bc43c){_0x5bc43c[_0xfdc9('0x11')]=_0x5bc43c[_0xfdc9('0x11')][_0xfdc9('0x12')](/@@{/g,_0xfdc9('0x13'))[_0xfdc9('0x12')](/}@@/g,'}}}')[_0xfdc9('0x12')](/@{/g,'{{')['replace'](/}@/g,'}}');return util[_0xfdc9('0xf')](_0xfdc9('0x14'),moment()[_0xfdc9('0xf')](_0xfdc9('0x15')),_0x5bc43c[_0xfdc9('0x16')][_0xfdc9('0x17')](),_0x4e95b1,_0x5bc43c[_0xfdc9('0x11')]);}function fileFormat(_0x8b6aee,_0x1d0b49){_0x1d0b49[_0xfdc9('0x11')]=_0x1d0b49['message'][_0xfdc9('0x12')](/@@{/g,_0xfdc9('0x13'))[_0xfdc9('0x12')](/}@@/g,'}}}')['replace'](/@{/g,'{{')[_0xfdc9('0x12')](/}@/g,'}}');var _0x185d9e=_0x1d0b49[_0xfdc9('0x18')]&&Object[_0xfdc9('0x19')](_0x1d0b49['meta'])['length']?'\x0a\x09'+JSON[_0xfdc9('0x1a')](_0x1d0b49['meta']):'';return util[_0xfdc9('0xf')](_0xfdc9('0x1b'),moment()['format'](_0xfdc9('0x15')),_0x1d0b49[_0xfdc9('0x16')]['toUpperCase'](),_0x8b6aee,_0x1d0b49['message'],_0x185d9e);}function consoleLogger(){var _0x2289c8=new winston[(_0xfdc9('0x1c'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xfdc9('0x1d'))][(_0xfdc9('0x1e'))]({'level':_0xfdc9('0x1f'),'json':![],'formatter':function(_0x3a0e3e){return formatter('',_0x3a0e3e);}})]});return _0x2289c8;}function fileLogger(_0x2c5182,_0x140294){var _0x448b09=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0xfdc9('0x1d'))][(_0xfdc9('0x20'))]({'name':util[_0xfdc9('0xf')](_0xfdc9('0x21'),_0x2c5182,_0xfdc9('0x22')),'filename':getLogFileName(_0x140294,_0x2c5182,_0xfdc9('0x22')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2ab842){return fileFormat(_0x2c5182,_0x2ab842);}}),new winston[(_0xfdc9('0x1d'))][(_0xfdc9('0x20'))]({'name':util[_0xfdc9('0xf')]('%s-%s',_0x2c5182,debugLevel),'filename':getLogFileName(_0x140294,_0x2c5182,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x14a3fc){return fileFormat(_0x2c5182,_0x14a3fc);}}),new winston[(_0xfdc9('0x1d'))]['Console']({'level':_0xfdc9('0x1f'),'json':![],'formatter':function(_0x53b371){return fileFormat(_0x2c5182,_0x53b371);}})]});return _0x448b09;}exports[_0xfdc9('0x23')]=consoleLogger;exports[_0xfdc9('0x24')]=fileLogger; \ No newline at end of file +var _0xa8c2=['stringify','transports','Console','Logger','%s-%s','error','File','warn','consoleLogger','path','util','winston','debugLevel','info','redBG\x20white','red','white','gray','bold\x20magenta','bold\x20blue','bold\x20cyan','addColors','/var/log/xcally','format','%s-%s.log','message','replace','{{{','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','meta','keys','length'];(function(_0x476b00,_0x250877){var _0x44ec8e=function(_0xec6b23){while(--_0xec6b23){_0x476b00['push'](_0x476b00['shift']());}};_0x44ec8e(++_0x250877);}(_0xa8c2,0x171));var _0x2a8c=function(_0x5a709c,_0x1e6cfe){_0x5a709c=_0x5a709c-0x0;var _0x719025=_0xa8c2[_0x5a709c];return _0x719025;};'use strict';var path=require(_0x2a8c('0x0'));var util=require(_0x2a8c('0x1'));var moment=require('moment');var winston=require(_0x2a8c('0x2'));var config=require('../config/environment');var debugLevel=config[_0x2a8c('0x3')]?config[_0x2a8c('0x3')]['toLowerCase']():_0x2a8c('0x4');var XC_LOG_LEVELS={'fatal':0x0,'error':0x0,'warn':0x1,'info':0x2,'print':0x2,'success':0x2,'http':0x3,'verbose':0x4,'debug':0x5,'silly':0x6};var XC_LOG_COLORS={'fatal':_0x2a8c('0x5'),'error':_0x2a8c('0x6'),'warn':'bold\x20yellow','info':_0x2a8c('0x7'),'print':'bold\x20white','success':'bold\x20green','http':_0x2a8c('0x8'),'verbose':_0x2a8c('0x9'),'debug':_0x2a8c('0xa'),'silly':_0x2a8c('0xb')};winston[_0x2a8c('0xc')](XC_LOG_COLORS);function getLogFileName(_0x2f2d71,_0x2aa38f,_0x43e9c){var _0x335ada=_0x2f2d71||_0x2a8c('0xd');return path['join'](_0x335ada,util[_0x2a8c('0xe')](_0x2a8c('0xf'),_0x2aa38f,_0x43e9c));}function formatter(_0x58fc35,_0x337e82){_0x337e82[_0x2a8c('0x10')]=_0x337e82['message'][_0x2a8c('0x11')](/@@{/g,_0x2a8c('0x12'))[_0x2a8c('0x11')](/}@@/g,_0x2a8c('0x13'))[_0x2a8c('0x11')](/@{/g,'{{')[_0x2a8c('0x11')](/}@/g,'}}');return util[_0x2a8c('0xe')](_0x2a8c('0x14'),moment()[_0x2a8c('0xe')](_0x2a8c('0x15')),_0x337e82[_0x2a8c('0x16')][_0x2a8c('0x17')](),_0x58fc35,_0x337e82[_0x2a8c('0x10')]);}function fileFormat(_0x43e2d3,_0x26065f){_0x26065f['message']=_0x26065f[_0x2a8c('0x10')]['replace'](/@@{/g,_0x2a8c('0x12'))['replace'](/}@@/g,_0x2a8c('0x13'))['replace'](/@{/g,'{{')[_0x2a8c('0x11')](/}@/g,'}}');var _0x5ae4a7=_0x26065f[_0x2a8c('0x18')]&&Object[_0x2a8c('0x19')](_0x26065f[_0x2a8c('0x18')])[_0x2a8c('0x1a')]?'\x0a\x09'+JSON[_0x2a8c('0x1b')](_0x26065f[_0x2a8c('0x18')]):'';return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s\x20%s',moment()[_0x2a8c('0xe')](_0x2a8c('0x15')),_0x26065f['level'][_0x2a8c('0x17')](),_0x43e2d3,_0x26065f[_0x2a8c('0x10')],_0x5ae4a7);}function consoleLogger(){var _0x19b175=new winston['Logger']({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x2a8c('0x1c'))][(_0x2a8c('0x1d'))]({'level':'warn','json':![],'formatter':function(_0x5bd7e7){return formatter('',_0x5bd7e7);}})]});return _0x19b175;}function fileLogger(_0x3b9331,_0x3440d6){var _0x3b28a4=new winston[(_0x2a8c('0x1e'))]({'levels':XC_LOG_LEVELS,'transports':[new winston[(_0x2a8c('0x1c'))]['File']({'name':util[_0x2a8c('0xe')](_0x2a8c('0x1f'),_0x3b9331,'error'),'filename':getLogFileName(_0x3440d6,_0x3b9331,_0x2a8c('0x20')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x32080b){return fileFormat(_0x3b9331,_0x32080b);}}),new winston[(_0x2a8c('0x1c'))][(_0x2a8c('0x21'))]({'name':util[_0x2a8c('0xe')](_0x2a8c('0x1f'),_0x3b9331,debugLevel),'filename':getLogFileName(_0x3440d6,_0x3b9331,debugLevel),'level':debugLevel,'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x41fe1f){return fileFormat(_0x3b9331,_0x41fe1f);}}),new winston[(_0x2a8c('0x1c'))][(_0x2a8c('0x1d'))]({'level':_0x2a8c('0x22'),'json':![],'formatter':function(_0x31d107){return fileFormat(_0x3b9331,_0x31d107);}})]});return _0x3b28a4;}exports[_0x2a8c('0x23')]=consoleLogger;exports['fileLogger']=fileLogger; \ No newline at end of file diff --git a/server/utils/mask-sensitive-data.js b/server/utils/mask-sensitive-data.js index 0f1587f..7593ede 100644 --- a/server/utils/mask-sensitive-data.js +++ b/server/utils/mask-sensitive-data.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x14a0=['membername','calleridnum','exten','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','localstationid','dsn','secret','registry','isArray','length','isPlainObject','isString','replace','@@{','}@@','includes','exports','maskSensitiveData','username','password','newPassword','apiKey','firstName','lastName','street','fax','email','clientId','code','accessKey','tenantId','accessToken'];(function(_0x562441,_0x35cb3a){var _0x4f5404=function(_0x4e0cee){while(--_0x4e0cee){_0x562441['push'](_0x562441['shift']());}};_0x4f5404(++_0x35cb3a);}(_0x14a0,0x8e));var _0x014a=function(_0x2ae22a,_0x4fe753){_0x2ae22a=_0x2ae22a-0x0;var _0x286a82=_0x14a0[_0x2ae22a];return _0x286a82;};var _=require('lodash');var sensitiveFields=[_0x014a('0x0'),_0x014a('0x1'),_0x014a('0x2'),_0x014a('0x3'),_0x014a('0x4'),_0x014a('0x5'),_0x014a('0x6'),'phone','mobile',_0x014a('0x7'),_0x014a('0x8'),_0x014a('0x9'),'clientSecret','securityToken',_0x014a('0xa'),_0x014a('0xb'),_0x014a('0xc'),'token','channelSecret',_0x014a('0xd'),'accessTokenSecret','authToken','consumerKey','consumerSecret',_0x014a('0xe'),'calleridname',_0x014a('0xf'),_0x014a('0x10'),'vidaooApiKey',_0x014a('0x11'),_0x014a('0x12'),_0x014a('0x13'),_0x014a('0x14'),_0x014a('0x15'),_0x014a('0x16'),_0x014a('0x17'),_0x014a('0x18'),_0x014a('0x19'),_0x014a('0x1a'),_0x014a('0x1b'),_0x014a('0x1c'),'oldPassword'];function maskSensitiveData(_0x130d13){const _0x3cf92f=/(?!^)[\s\S](?!$)/g;if(_['isPlainObject'](_0x130d13)){for(const _0x3a836f in _0x130d13){if(_[_0x014a('0x1d')](_0x130d13[_0x3a836f])){for(let _0x59a4ea=0x0;_0x59a4ea<_0x130d13[_0x3a836f][_0x014a('0x1e')];_0x59a4ea++){maskSensitiveData(_0x130d13[_0x3a836f][_0x59a4ea]);}}else if(_[_0x014a('0x1f')](_0x130d13[_0x3a836f])){maskSensitiveData(_0x130d13[_0x3a836f]);}else if(_[_0x014a('0x20')](_0x130d13[_0x3a836f])){_0x130d13[_0x3a836f]=_0x130d13[_0x3a836f][_0x014a('0x21')](/{{{/g,_0x014a('0x22'))[_0x014a('0x21')](/}}}/g,_0x014a('0x23'))[_0x014a('0x21')](/{{/g,'@{')[_0x014a('0x21')](/}}/g,'}@');if(_[_0x014a('0x24')](sensitiveFields,_0x3a836f)){_0x130d13[_0x3a836f]=_0x130d13[_0x3a836f][_0x014a('0x21')](_0x3cf92f,'*');}}}}}module[_0x014a('0x25')][_0x014a('0x26')]=maskSensitiveData; \ No newline at end of file +var _0x1a85=['isString','@@{','replace','}@@','includes','exports','maskSensitiveData','password','newPassword','apiKey','street','phone','mobile','email','clientSecret','code','accessKey','token','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','secretaccesskey','key','user','pass','accountSid','dsn','secret','registry','isPlainObject','isArray','length'];(function(_0xaaf2e2,_0x19d28a){var _0x28bc36=function(_0x53bdb5){while(--_0x53bdb5){_0xaaf2e2['push'](_0xaaf2e2['shift']());}};_0x28bc36(++_0x19d28a);}(_0x1a85,0x178));var _0x51a8=function(_0x228a4a,_0x23d65e){_0x228a4a=_0x228a4a-0x0;var _0x3d3937=_0x1a85[_0x228a4a];return _0x3d3937;};var _=require('lodash');var sensitiveFields=['username',_0x51a8('0x0'),_0x51a8('0x1'),_0x51a8('0x2'),'firstName','lastName',_0x51a8('0x3'),_0x51a8('0x4'),_0x51a8('0x5'),'fax',_0x51a8('0x6'),'clientId',_0x51a8('0x7'),'securityToken',_0x51a8('0x8'),_0x51a8('0x9'),'tenantId',_0x51a8('0xa'),'channelSecret','accessToken',_0x51a8('0xb'),_0x51a8('0xc'),_0x51a8('0xd'),_0x51a8('0xe'),_0x51a8('0xf'),_0x51a8('0x10'),_0x51a8('0x11'),_0x51a8('0x12'),_0x51a8('0x13'),_0x51a8('0x14'),_0x51a8('0x15'),_0x51a8('0x16'),_0x51a8('0x17'),_0x51a8('0x18'),_0x51a8('0x19'),_0x51a8('0x1a'),_0x51a8('0x1b'),'localstationid',_0x51a8('0x1c'),_0x51a8('0x1d'),_0x51a8('0x1e'),'oldPassword'];function maskSensitiveData(_0xf4eb6e){const _0x547d40=/(?!^)[\s\S](?!$)/g;if(_[_0x51a8('0x1f')](_0xf4eb6e)){for(const _0x2b8d37 in _0xf4eb6e){if(_[_0x51a8('0x20')](_0xf4eb6e[_0x2b8d37])){for(let _0x2b0521=0x0;_0x2b0521<_0xf4eb6e[_0x2b8d37][_0x51a8('0x21')];_0x2b0521++){maskSensitiveData(_0xf4eb6e[_0x2b8d37][_0x2b0521]);}}else if(_[_0x51a8('0x1f')](_0xf4eb6e[_0x2b8d37])){maskSensitiveData(_0xf4eb6e[_0x2b8d37]);}else if(_[_0x51a8('0x22')](_0xf4eb6e[_0x2b8d37])){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](/{{{/g,_0x51a8('0x23'))[_0x51a8('0x24')](/}}}/g,_0x51a8('0x25'))[_0x51a8('0x24')](/{{/g,'@{')[_0x51a8('0x24')](/}}/g,'}@');if(_[_0x51a8('0x26')](sensitiveFields,_0x2b8d37)){_0xf4eb6e[_0x2b8d37]=_0xf4eb6e[_0x2b8d37]['replace'](_0x547d40,'*');}}}}}module[_0x51a8('0x27')][_0x51a8('0x28')]=maskSensitiveData; \ No newline at end of file diff --git a/server/utils/safe-template.js b/server/utils/safe-template.js index e768da0..94df0c0 100644 --- a/server/utils/safe-template.js +++ b/server/utils/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa571=['reduce','exports','lodash','{\x20{\x20','\x20}\x20}','string','map','isPlainObject','keys'];(function(_0x1be54c,_0x5bfa3a){var _0xad0132=function(_0x31fc28){while(--_0x31fc28){_0x1be54c['push'](_0x1be54c['shift']());}};_0xad0132(++_0x5bfa3a);}(_0xa571,0x107));var _0x1a57=function(_0x3baaed,_0xa8994c){_0x3baaed=_0x3baaed-0x0;var _0x1f3d6b=_0xa571[_0x3baaed];return _0x1f3d6b;};var _=require(_0x1a57('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x289e99){return _0x289e99==='{{'?_0x1a57('0x1'):_0x1a57('0x2');}function safeTemplate(_0x48485e){var _0x1a071f=_0x48485e;if(typeof _0x48485e===_0x1a57('0x3')){_0x1a071f=_0x48485e['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array['isArray'](_0x48485e)){_0x1a071f=_0x48485e[_0x1a57('0x4')](function(_0x5067fa){return safeTemplate(_0x5067fa);});}else if(_[_0x1a57('0x5')](_0x48485e)){_0x1a071f=Object[_0x1a57('0x6')](_0x48485e)[_0x1a57('0x7')](function(_0x3c5352,_0x2492f5){_0x3c5352[_0x2492f5]=safeTemplate(_0x48485e[_0x2492f5]);return _0x3c5352;},{});}return _0x1a071f;}module[_0x1a57('0x8')]['safeTemplate']=safeTemplate; \ No newline at end of file +var _0x9c00=['isPlainObject','exports','safeTemplate','lodash','replace','isArray','map'];(function(_0x42c118,_0x197006){var _0x112ebd=function(_0x337411){while(--_0x337411){_0x42c118['push'](_0x42c118['shift']());}};_0x112ebd(++_0x197006);}(_0x9c00,0x1a0));var _0x09c0=function(_0x29b2d0,_0x73bf4b){_0x29b2d0=_0x29b2d0-0x0;var _0x4af937=_0x9c00[_0x29b2d0];return _0x4af937;};var _=require(_0x09c0('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x170d8b){return _0x170d8b==='{{'?'{\x20{\x20':'\x20}\x20}';}function safeTemplate(_0xe0d293){var _0x8c9907=_0xe0d293;if(typeof _0xe0d293==='string'){_0x8c9907=_0xe0d293[_0x09c0('0x1')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x09c0('0x2')](_0xe0d293)){_0x8c9907=_0xe0d293[_0x09c0('0x3')](function(_0x2fd03e){return safeTemplate(_0x2fd03e);});}else if(_[_0x09c0('0x4')](_0xe0d293)){_0x8c9907=Object['keys'](_0xe0d293)['reduce'](function(_0x1f3d7e,_0x17d11f){_0x1f3d7e[_0x17d11f]=safeTemplate(_0xe0d293[_0x17d11f]);return _0x1f3d7e;},{});}return _0x8c9907;}module[_0x09c0('0x5')][_0x09c0('0x6')]=safeTemplate; \ No newline at end of file